From 83b41892d3215866592d916b6ffca42d9d951f71 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 17 Jul 2026 00:22:16 +0000 Subject: [PATCH] chore: update to latest Copilot LSP --- copilot/js/main.js | 2044 +++++++++++++++++++++--------------------- lua/copilot/util.lua | 2 +- 2 files changed, 1034 insertions(+), 1012 deletions(-) diff --git a/copilot/js/main.js b/copilot/js/main.js index c8e6005b..ed789e41 100644 --- a/copilot/js/main.js +++ b/copilot/js/main.js @@ -1,93 +1,93 @@ -"use strict";var eco=Object.create;var hCe=Object.defineProperty;var tco=Object.getOwnPropertyDescriptor;var rco=Object.getOwnPropertyNames;var nco=Object.getPrototypeOf,ico=Object.prototype.hasOwnProperty;var fQr=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),pQr=t=>{throw TypeError(t)};var a=(t,e)=>hCe(t,"name",{value:e,configurable:!0});var ve=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var I=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},ki=(t,e)=>{for(var r in e)hCe(t,r,{get:e[r],enumerable:!0})},hQr=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of rco(e))!ico.call(t,o)&&o!==r&&hCe(t,o,{get:()=>e[o],enumerable:!(n=tco(e,o))||n.enumerable});return t};var de=(t,e,r)=>(r=t!=null?eco(nco(t)):{},hQr(e||!t||!t.__esModule?hCe(r,"default",{value:t,enumerable:!0}):r,t)),ba=t=>hQr(hCe({},"__esModule",{value:!0}),t);var Rkt=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&pQr("Object expected");var n,o;r&&(n=e[fQr("asyncDispose")]),n===void 0&&(n=e[fQr("dispose")],r&&(o=n)),typeof n!="function"&&pQr("Object not disposable"),o&&(n=function(){try{o.call(this)}catch(s){return Promise.reject(s)}}),t.push([r,n,e])}else r&&t.push([r]);return e},kkt=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(c,l,u,d){return d=Error(u),d.name="SuppressedError",d.error=c,d.suppressed=l,d},o=c=>e=r?new n(c,e,"An error was suppressed during disposal"):(r=!0,c),s=c=>{for(;c=t.pop();)try{var l=c[1]&&c[1].call(c[2]);if(c[0])return Promise.resolve(l).then(s,u=>(o(u),s()))}catch(u){o(u)}if(r)throw e};return s()};var importMetaUrlShim,p=ve(()=>{"use strict";importMetaUrlShim=typeof document>"u"?require("node:url").pathToFileURL(__filename).href:importMetaUrlShim});var bQr,SQr=ve(()=>{p();bQr="ffffffff-ffff-ffff-ffff-ffffffffffff"});var TQr,IQr=ve(()=>{p();TQr="00000000-0000-0000-0000-000000000000"});var xQr,wQr=ve(()=>{p();xQr=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});function gco(t){return typeof t=="string"&&xQr.test(t)}var nU,mCe=ve(()=>{p();wQr();a(gco,"validate");nU=gco});function Aco(t){if(!nU(t))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(t.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(t.slice(9,13),16))>>>8,e&255,(e=parseInt(t.slice(14,18),16))>>>8,e&255,(e=parseInt(t.slice(19,23),16))>>>8,e&255,(e=parseInt(t.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255)}var XL,gCe=ve(()=>{p();mCe();a(Aco,"parse");XL=Aco});function h_(t,e=0){return(dA[t[e+0]]+dA[t[e+1]]+dA[t[e+2]]+dA[t[e+3]]+"-"+dA[t[e+4]]+dA[t[e+5]]+"-"+dA[t[e+6]]+dA[t[e+7]]+"-"+dA[t[e+8]]+dA[t[e+9]]+"-"+dA[t[e+10]]+dA[t[e+11]]+dA[t[e+12]]+dA[t[e+13]]+dA[t[e+14]]+dA[t[e+15]]).toLowerCase()}function yco(t,e=0){let r=h_(t,e);if(!nU(r))throw TypeError("Stringified UUID is invalid");return r}var dA,RQr,eB=ve(()=>{p();mCe();dA=[];for(let t=0;t<256;++t)dA.push((t+256).toString(16).slice(1));a(h_,"unsafeStringify");a(yco,"stringify");RQr=yco});function tB(){return crypto.getRandomValues(Eco)}var Eco,D6e=ve(()=>{p();Eco=new Uint8Array(16);a(tB,"rng")});function _co(t,e,r){let n,o=t?._v6??!1;if(t){let s=Object.keys(t);s.length===1&&s[0]==="_v6"&&(t=void 0)}if(t)n=kQr(t.random??t.rng?.()??tB(),t.msecs,t.nsecs,t.clockseq,t.node,e,r);else{let s=Date.now(),c=tB();vco(ACe,s,c),n=kQr(c,ACe.msecs,ACe.nsecs,o?void 0:ACe.clockseq,o?void 0:ACe.node,e,r)}return e??h_(n)}function vco(t,e,r){return t.msecs??=-1/0,t.nsecs??=0,e===t.msecs?(t.nsecs++,t.nsecs>=1e4&&(t.node=void 0,t.nsecs=0)):e>t.msecs?t.nsecs=0:e= 16");if(!s)s=new Uint8Array(16),c=0;else if(c<0||c+16>s.length)throw new RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);e??=Date.now(),r??=0,n??=(t[8]<<8|t[9])&16383,o??=t.slice(10,16),e+=122192928e5;let l=((e&268435455)*1e4+r)%4294967296;s[c++]=l>>>24&255,s[c++]=l>>>16&255,s[c++]=l>>>8&255,s[c++]=l&255;let u=e/4294967296*1e4&268435455;s[c++]=u>>>8&255,s[c++]=u&255,s[c++]=u>>>24&15|16,s[c++]=u>>>16&255,s[c++]=n>>>8|128,s[c++]=n&255;for(let d=0;d<6;++d)s[c++]=o[d];return s}var ACe,N6e,Okt=ve(()=>{p();D6e();eB();ACe={};a(_co,"v1");a(vco,"updateV1State");a(kQr,"v1Bytes");N6e=_co});function yCe(t){let e=typeof t=="string"?XL(t):t,r=Cco(e);return typeof t=="string"?h_(r):r}function Cco(t){return Uint8Array.of((t[6]&15)<<4|t[7]>>4&15,(t[7]&15)<<4|(t[4]&240)>>4,(t[4]&15)<<4|(t[5]&240)>>4,(t[5]&15)<<4|(t[0]&240)>>4,(t[0]&15)<<4|(t[1]&240)>>4,(t[1]&15)<<4|(t[2]&240)>>4,96|t[2]&15,t[3],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}var Lkt=ve(()=>{p();gCe();eB();a(yCe,"v1ToV6");a(Cco,"_v1ToV6")});function bco(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,PQr.createHash)("md5").update(t).digest()}var PQr,DQr,NQr=ve(()=>{p();PQr=require("node:crypto");a(bco,"md5");DQr=bco});function Sco(t){t=unescape(encodeURIComponent(t));let e=new Uint8Array(t.length);for(let r=0;ro.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`);for(let d=0;d<16;++d)o[s+d]=u[d];return o}return h_(u)}var M6e,O6e,Bkt=ve(()=>{p();gCe();eB();a(Sco,"stringToBytes");M6e="6ba7b810-9dad-11d1-80b4-00c04fd430c8",O6e="6ba7b811-9dad-11d1-80b4-00c04fd430c8";a(ECe,"v35")});function Fkt(t,e,r,n){return ECe(48,DQr,t,e,r,n)}var MQr,OQr=ve(()=>{p();NQr();Bkt();a(Fkt,"v3");Fkt.DNS=M6e;Fkt.URL=O6e;MQr=Fkt});function Tco(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():Ico(t,e,r)}function Ico(t,e,r){t=t||{};let n=t.random??t.rng?.()??tB();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)e[r+o]=n[o];return e}return h_(n)}var Mt,LQr=ve(()=>{p();D6e();eB();a(Tco,"v4");a(Ico,"_v4");Mt=Tco});function xco(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,BQr.createHash)("sha1").update(t).digest()}var BQr,FQr,UQr=ve(()=>{p();BQr=require("node:crypto");a(xco,"sha1");FQr=xco});function Ukt(t,e,r,n){return ECe(80,FQr,t,e,r,n)}var QQr,qQr=ve(()=>{p();UQr();Bkt();a(Ukt,"v5");Ukt.DNS=M6e;Ukt.URL=O6e;QQr=Ukt});function wco(t,e,r){t??={},r??=0;let n=N6e({...t,_v6:!0},new Uint8Array(16));if(n=yCe(n),e){if(r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;o++)e[r+o]=n[o];return e}return h_(n)}var jQr,HQr=ve(()=>{p();eB();Okt();Lkt();a(wco,"v6");jQr=wco});function Qkt(t){let e=typeof t=="string"?XL(t):t,r=Rco(e);return typeof t=="string"?h_(r):r}function Rco(t){return Uint8Array.of((t[3]&15)<<4|t[4]>>4&15,(t[4]&15)<<4|(t[5]&240)>>4,(t[5]&15)<<4|t[6]&15,t[7],(t[1]&15)<<4|(t[2]&240)>>4,(t[2]&15)<<4|(t[3]&240)>>4,16|(t[0]&240)>>4,(t[0]&15)<<4|(t[1]&240)>>4,t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}var GQr=ve(()=>{p();gCe();eB();a(Qkt,"v6ToV1");a(Rco,"_v6ToV1")});function kco(t,e,r){let n;if(t)n=$Qr(t.random??t.rng?.()??tB(),t.msecs,t.seq,e,r);else{let o=Date.now(),s=tB();Pco(qkt,o,s),n=$Qr(s,qkt.msecs,qkt.seq,e,r)}return e??h_(n)}function Pco(t,e,r){return t.msecs??=-1/0,t.seq??=0,e>t.msecs?(t.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],t.msecs=e):(t.seq=t.seq+1|0,t.seq===0&&t.msecs++),t}function $Qr(t,e,r,n,o=0){if(t.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),o=0;else if(o<0||o+16>n.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);return e??=Date.now(),r??=t[6]*127<<24|t[7]<<16|t[8]<<8|t[9],n[o++]=e/1099511627776&255,n[o++]=e/4294967296&255,n[o++]=e/16777216&255,n[o++]=e/65536&255,n[o++]=e/256&255,n[o++]=e&255,n[o++]=112|r>>>28&15,n[o++]=r>>>20&255,n[o++]=128|r>>>14&63,n[o++]=r>>>6&255,n[o++]=r<<2&255|t[10]&3,n[o++]=t[11],n[o++]=t[12],n[o++]=t[13],n[o++]=t[14],n[o++]=t[15],n}var qkt,VQr,WQr=ve(()=>{p();D6e();eB();qkt={};a(kco,"v7");a(Pco,"updateV7State");a($Qr,"v7Bytes");VQr=kco});function Dco(t){if(!nU(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}var zQr,YQr=ve(()=>{p();mCe();a(Dco,"version");zQr=Dco});var Cc={};ki(Cc,{MAX:()=>bQr,NIL:()=>TQr,parse:()=>XL,stringify:()=>RQr,v1:()=>N6e,v1ToV6:()=>yCe,v3:()=>MQr,v4:()=>Mt,v5:()=>QQr,v6:()=>jQr,v6ToV1:()=>Qkt,v7:()=>VQr,validate:()=>nU,version:()=>zQr});var Mo=ve(()=>{p();SQr();IQr();gCe();eB();Okt();Lkt();OQr();LQr();qQr();HQr();GQr();WQr();mCe();YQr()});var V0=I(jkt=>{"use strict";p();jkt.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{e.push((o,s)=>o!=null?n(o):r(s)),t.apply(this,e)})},"name",{value:t.name})};jkt.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(n=>r(null,n),r)},"name",{value:t.name})}});var JQr=I(($sl,KQr)=>{p();var iU=require("constants"),Nco=process.cwd,L6e=null,Mco=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return L6e||(L6e=Nco.call(process)),L6e};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Hkt=process.chdir,process.chdir=function(t){L6e=null,Hkt.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Hkt));var Hkt;KQr.exports=Oco;function Oco(t){iU.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=c(t.chownSync),t.fchownSync=c(t.fchownSync),t.lchownSync=c(t.lchownSync),t.chmodSync=o(t.chmodSync),t.fchmodSync=o(t.fchmodSync),t.lchmodSync=o(t.lchmodSync),t.stat=l(t.stat),t.fstat=l(t.fstat),t.lstat=l(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(f,h,m){m&&process.nextTick(m)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(f,h,m,g){g&&process.nextTick(g)},t.lchownSync=function(){}),Mco==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(f){function h(m,g,A){var y=Date.now(),E=0;f(m,g,a(function _(v){if(v&&(v.code==="EACCES"||v.code==="EPERM"||v.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){t.stat(g,function(b,T){b&&b.code==="ENOENT"?f(m,g,_):A(v)})},E),E<100&&(E+=10);return}A&&A(v)},"CB"))}return a(h,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(f){function h(m,g,A,y,E,_){var v;if(_&&typeof _=="function"){var b=0;v=a(function(T,w,R){if(T&&T.code==="EAGAIN"&&b<10)return b++,f.call(t,m,g,A,y,E,v);_.apply(this,arguments)},"callback")}return f.call(t,m,g,A,y,E,v)}return a(h,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(f){return function(h,m,g,A,y){for(var E=0;;)try{return f.call(t,h,m,g,A,y)}catch(_){if(_.code==="EAGAIN"&&E<10){E++;continue}throw _}}})(t.readSync);function e(f){f.lchmod=function(h,m,g){f.open(h,iU.O_WRONLY|iU.O_SYMLINK,m,function(A,y){if(A){g&&g(A);return}f.fchmod(y,m,function(E){f.close(y,function(_){g&&g(E||_)})})})},f.lchmodSync=function(h,m){var g=f.openSync(h,iU.O_WRONLY|iU.O_SYMLINK,m),A=!0,y;try{y=f.fchmodSync(g,m),A=!1}finally{if(A)try{f.closeSync(g)}catch{}else f.closeSync(g)}return y}}a(e,"patchLchmod");function r(f){iU.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(h,m,g,A){f.open(h,iU.O_SYMLINK,function(y,E){if(y){A&&A(y);return}f.futimes(E,m,g,function(_){f.close(E,function(v){A&&A(_||v)})})})},f.lutimesSync=function(h,m,g){var A=f.openSync(h,iU.O_SYMLINK),y,E=!0;try{y=f.futimesSync(A,m,g),E=!1}finally{if(E)try{f.closeSync(A)}catch{}else f.closeSync(A)}return y}):f.futimes&&(f.lutimes=function(h,m,g,A){A&&process.nextTick(A)},f.lutimesSync=function(){})}a(r,"patchLutimes");function n(f){return f&&function(h,m,g){return f.call(t,h,m,function(A){d(A)&&(A=null),g&&g.apply(this,arguments)})}}a(n,"chmodFix");function o(f){return f&&function(h,m){try{return f.call(t,h,m)}catch(g){if(!d(g))throw g}}}a(o,"chmodFixSync");function s(f){return f&&function(h,m,g,A){return f.call(t,h,m,g,function(y){d(y)&&(y=null),A&&A.apply(this,arguments)})}}a(s,"chownFix");function c(f){return f&&function(h,m,g){try{return f.call(t,h,m,g)}catch(A){if(!d(A))throw A}}}a(c,"chownFixSync");function l(f){return f&&function(h,m,g){typeof m=="function"&&(g=m,m=null);function A(y,E){E&&(E.uid<0&&(E.uid+=4294967296),E.gid<0&&(E.gid+=4294967296)),g&&g.apply(this,arguments)}return a(A,"callback"),m?f.call(t,h,m,A):f.call(t,h,A)}}a(l,"statFix");function u(f){return f&&function(h,m){var g=m?f.call(t,h,m):f.call(t,h);return g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),g}}a(u,"statFixSync");function d(f){if(!f||f.code==="ENOSYS")return!0;var h=!process.getuid||process.getuid()!==0;return!!(h&&(f.code==="EINVAL"||f.code==="EPERM"))}a(d,"chownErOk")}a(Oco,"patch")});var eqr=I((zsl,XQr)=>{p();var ZQr=require("stream").Stream;XQr.exports=Lco;function Lco(t){return{ReadStream:e,WriteStream:r};function e(n,o){if(!(this instanceof e))return new e(n,o);ZQr.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,o=o||{};for(var c=Object.keys(o),l=0,u=c.length;lthis.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}t.open(this.path,this.flags,this.mode,function(f,h){if(f){s.emit("error",f),s.readable=!1;return}s.fd=h,s.emit("open",h),s._read()})}function r(n,o){if(!(this instanceof r))return new r(n,o);ZQr.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,o=o||{};for(var s=Object.keys(o),c=0,l=s.length;c= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}a(Lco,"legacy")});var rqr=I((Jsl,tqr)=>{"use strict";p();tqr.exports=Fco;var Bco=Object.getPrototypeOf||function(t){return t.__proto__};function Fco(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Bco(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}a(Fco,"clone")});var Eoe=I((eal,Vkt)=>{p();var sf=require("fs"),Uco=JQr(),Qco=eqr(),qco=rqr(),B6e=require("util"),fA,U6e;typeof Symbol=="function"&&typeof Symbol.for=="function"?(fA=Symbol.for("graceful-fs.queue"),U6e=Symbol.for("graceful-fs.previous")):(fA="___graceful-fs.queue",U6e="___graceful-fs.previous");function jco(){}a(jco,"noop");function oqr(t,e){Object.defineProperty(t,fA,{get:a(function(){return e},"get")})}a(oqr,"publishQueue");var SW=jco;B6e.debuglog?SW=B6e.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(SW=a(function(){var t=B6e.format.apply(B6e,arguments);t="GFS4: "+t.split(/\n/).join(` -GFS4: `),console.error(t)},"debug"));sf[fA]||(nqr=global[fA]||[],oqr(sf,nqr),sf.close=(function(t){function e(r,n){return t.call(sf,r,function(o){o||iqr(),typeof n=="function"&&n.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,U6e,{value:t}),e})(sf.close),sf.closeSync=(function(t){function e(r){t.apply(sf,arguments),iqr()}return a(e,"closeSync"),Object.defineProperty(e,U6e,{value:t}),e})(sf.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){SW(sf[fA]),require("assert").equal(sf[fA].length,0)}));var nqr;global[fA]||oqr(global,sf[fA]);Vkt.exports=Gkt(qco(sf));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!sf.__patched&&(Vkt.exports=Gkt(sf),sf.__patched=!0);function Gkt(t){Uco(t),t.gracefulify=Gkt,t.createReadStream=w,t.createWriteStream=R;var e=t.readFile;t.readFile=r;function r(D,N,L){return typeof N=="function"&&(L=N,N=null),B(D,N,L);function B(q,M,O,j){return e(q,M,function(Q){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?yoe([B,[q,M,O],Q,j||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}a(B,"go$readFile")}a(r,"readFile");var n=t.writeFile;t.writeFile=o;function o(D,N,L,B){return typeof L=="function"&&(B=L,L=null),q(D,N,L,B);function q(M,O,j,Q,U){return n(M,O,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?yoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(q,"go$writeFile")}a(o,"writeFile");var s=t.appendFile;s&&(t.appendFile=c);function c(D,N,L,B){return typeof L=="function"&&(B=L,L=null),q(D,N,L,B);function q(M,O,j,Q,U){return s(M,O,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?yoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(q,"go$appendFile")}a(c,"appendFile");var l=t.copyFile;l&&(t.copyFile=u);function u(D,N,L,B){return typeof L=="function"&&(B=L,L=0),q(D,N,L,B);function q(M,O,j,Q,U){return l(M,O,j,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?yoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(q,"go$copyFile")}a(u,"copyFile");var d=t.readdir;t.readdir=h;var f=/^v[0-5]\./;function h(D,N,L){typeof N=="function"&&(L=N,N=null);var B=f.test(process.version)?a(function(O,j,Q,U){return d(O,q(O,j,Q,U))},"go$readdir"):a(function(O,j,Q,U){return d(O,j,q(O,j,Q,U))},"go$readdir");return B(D,N,L);function q(M,O,j,Q){return function(U,Y){U&&(U.code==="EMFILE"||U.code==="ENFILE")?yoe([B,[M,O,j],U,Q||Date.now(),Date.now()]):(Y&&Y.sort&&Y.sort(),typeof j=="function"&&j.call(this,U,Y))}}}if(a(h,"readdir"),process.version.substr(0,4)==="v0.8"){var m=Qco(t);_=m.ReadStream,b=m.WriteStream}var g=t.ReadStream;g&&(_.prototype=Object.create(g.prototype),_.prototype.open=v);var A=t.WriteStream;A&&(b.prototype=Object.create(A.prototype),b.prototype.open=T),Object.defineProperty(t,"ReadStream",{get:a(function(){return _},"get"),set:a(function(D){_=D},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:a(function(){return b},"get"),set:a(function(D){b=D},"set"),enumerable:!0,configurable:!0});var y=_;Object.defineProperty(t,"FileReadStream",{get:a(function(){return y},"get"),set:a(function(D){y=D},"set"),enumerable:!0,configurable:!0});var E=b;Object.defineProperty(t,"FileWriteStream",{get:a(function(){return E},"get"),set:a(function(D){E=D},"set"),enumerable:!0,configurable:!0});function _(D,N){return this instanceof _?(g.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}a(_,"ReadStream");function v(){var D=this;P(D.path,D.flags,D.mode,function(N,L){N?(D.autoClose&&D.destroy(),D.emit("error",N)):(D.fd=L,D.emit("open",L),D.read())})}a(v,"ReadStream$open");function b(D,N){return this instanceof b?(A.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}a(b,"WriteStream");function T(){var D=this;P(D.path,D.flags,D.mode,function(N,L){N?(D.destroy(),D.emit("error",N)):(D.fd=L,D.emit("open",L))})}a(T,"WriteStream$open");function w(D,N){return new t.ReadStream(D,N)}a(w,"createReadStream");function R(D,N){return new t.WriteStream(D,N)}a(R,"createWriteStream");var x=t.open;t.open=P;function P(D,N,L,B){return typeof L=="function"&&(B=L,L=null),q(D,N,L,B);function q(M,O,j,Q,U){return x(M,O,j,function(Y,W){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?yoe([q,[M,O,j,Q],Y,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(q,"go$open")}return a(P,"open"),t}a(Gkt,"patch");function yoe(t){SW("ENQUEUE",t[0].name,t[1]),sf[fA].push(t),$kt()}a(yoe,"enqueue");var F6e;function iqr(){for(var t=Date.now(),e=0;e2&&(sf[fA][e][3]=t,sf[fA][e][4]=t);$kt()}a(iqr,"resetQueue");function $kt(){if(clearTimeout(F6e),F6e=void 0,sf[fA].length!==0){var t=sf[fA].shift(),e=t[0],r=t[1],n=t[2],o=t[3],s=t[4];if(o===void 0)SW("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-o>=6e4){SW("TIMEOUT",e.name,r);var c=r.pop();typeof c=="function"&&c.call(null,n)}else{var l=Date.now()-s,u=Math.max(s-o,1),d=Math.min(u*1.2,100);l>=d?(SW("RETRY",e.name,r),e.apply(null,r.concat([o]))):sf[fA].push(t)}F6e===void 0&&(F6e=setTimeout($kt,0))}}a($kt,"retry")});var g_=I(rB=>{"use strict";p();var sqr=V0().fromCallback,m_=Eoe(),Hco=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof m_[t]=="function");Object.assign(rB,m_);Hco.forEach(t=>{rB[t]=sqr(m_[t])});rB.exists=function(t,e){return typeof e=="function"?m_.exists(t,e):new Promise(r=>m_.exists(t,r))};rB.read=function(t,e,r,n,o,s){return typeof s=="function"?m_.read(t,e,r,n,o,s):new Promise((c,l)=>{m_.read(t,e,r,n,o,(u,d,f)=>{if(u)return l(u);c({bytesRead:d,buffer:f})})})};rB.write=function(t,e,...r){return typeof r[r.length-1]=="function"?m_.write(t,e,...r):new Promise((n,o)=>{m_.write(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffer:l})})})};rB.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?m_.readv(t,e,...r):new Promise((n,o)=>{m_.readv(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesRead:c,buffers:l})})})};rB.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?m_.writev(t,e,...r):new Promise((n,o)=>{m_.writev(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffers:l})})})};typeof m_.realpath.native=="function"?rB.realpath.native=sqr(m_.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var cqr=I((oal,aqr)=>{"use strict";p();var Gco=require("path");aqr.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Gco.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}},"checkPath")});var fqr=I((cal,Wkt)=>{"use strict";p();var lqr=g_(),{checkPath:uqr}=cqr(),dqr=a(t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode},"getMode");Wkt.exports.makeDir=async(t,e)=>(uqr(t),lqr.mkdir(t,{mode:dqr(e),recursive:!0}));Wkt.exports.makeDirSync=(t,e)=>(uqr(t),lqr.mkdirSync(t,{mode:dqr(e),recursive:!0}))});var Rk=I((dal,pqr)=>{"use strict";p();var $co=V0().fromPromise,{makeDir:Vco,makeDirSync:zkt}=fqr(),Ykt=$co(Vco);pqr.exports={mkdirs:Ykt,mkdirsSync:zkt,mkdirp:Ykt,mkdirpSync:zkt,ensureDir:Ykt,ensureDirSync:zkt}});var oU=I((pal,mqr)=>{"use strict";p();var Wco=V0().fromPromise,hqr=g_();function zco(t){return hqr.access(t).then(()=>!0).catch(()=>!1)}a(zco,"pathExists");mqr.exports={pathExists:Wco(zco),pathExistsSync:hqr.existsSync}});var Kkt=I((gal,gqr)=>{"use strict";p();var _oe=g_(),Yco=V0().fromPromise;async function Kco(t,e,r){let n=await _oe.open(t,"r+"),o=null;try{await _oe.futimes(n,e,r)}finally{try{await _oe.close(n)}catch(s){o=s}}if(o)throw o}a(Kco,"utimesMillis");function Jco(t,e,r){let n=_oe.openSync(t,"r+");return _oe.futimesSync(n,e,r),_oe.closeSync(n)}a(Jco,"utimesMillisSync");gqr.exports={utimesMillis:Yco(Kco),utimesMillisSync:Jco}});var TW=I((Eal,_qr)=>{"use strict";p();var voe=g_(),W0=require("path"),Aqr=V0().fromPromise;function Zco(t,e,r){let n=r.dereference?o=>voe.stat(o,{bigint:!0}):o=>voe.lstat(o,{bigint:!0});return Promise.all([n(t),n(e).catch(o=>{if(o.code==="ENOENT")return null;throw o})]).then(([o,s])=>({srcStat:o,destStat:s}))}a(Zco,"getStats");function Xco(t,e,r){let n,o=r.dereference?c=>voe.statSync(c,{bigint:!0}):c=>voe.lstatSync(c,{bigint:!0}),s=o(t);try{n=o(e)}catch(c){if(c.code==="ENOENT")return{srcStat:s,destStat:null};throw c}return{srcStat:s,destStat:n}}a(Xco,"getStatsSync");async function elo(t,e,r,n){let{srcStat:o,destStat:s}=await Zco(t,e,n);if(s){if(_Ce(o,s)){let c=W0.basename(t),l=W0.basename(e);if(r==="move"&&c!==l&&c.toLowerCase()===l.toLowerCase())return{srcStat:o,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(o.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!o.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(o.isDirectory()&&Jkt(t,e))throw new Error(Q6e(t,e,r));return{srcStat:o,destStat:s}}a(elo,"checkPaths");function tlo(t,e,r,n){let{srcStat:o,destStat:s}=Xco(t,e,n);if(s){if(_Ce(o,s)){let c=W0.basename(t),l=W0.basename(e);if(r==="move"&&c!==l&&c.toLowerCase()===l.toLowerCase())return{srcStat:o,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(o.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!o.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(o.isDirectory()&&Jkt(t,e))throw new Error(Q6e(t,e,r));return{srcStat:o,destStat:s}}a(tlo,"checkPathsSync");async function yqr(t,e,r,n){let o=W0.resolve(W0.dirname(t)),s=W0.resolve(W0.dirname(r));if(s===o||s===W0.parse(s).root)return;let c;try{c=await voe.stat(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(_Ce(e,c))throw new Error(Q6e(t,r,n));return yqr(t,e,s,n)}a(yqr,"checkParentPaths");function Eqr(t,e,r,n){let o=W0.resolve(W0.dirname(t)),s=W0.resolve(W0.dirname(r));if(s===o||s===W0.parse(s).root)return;let c;try{c=voe.statSync(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(_Ce(e,c))throw new Error(Q6e(t,r,n));return Eqr(t,e,s,n)}a(Eqr,"checkParentPathsSync");function _Ce(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}a(_Ce,"areIdentical");function Jkt(t,e){let r=W0.resolve(t).split(W0.sep).filter(o=>o),n=W0.resolve(e).split(W0.sep).filter(o=>o);return r.every((o,s)=>n[s]===o)}a(Jkt,"isSrcSubdir");function Q6e(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}a(Q6e,"errMsg");_qr.exports={checkPaths:Aqr(elo),checkPathsSync:tlo,checkParentPaths:Aqr(yqr),checkParentPathsSync:Eqr,isSrcSubdir:Jkt,areIdentical:_Ce}});var Cqr=I((Cal,vqr)=>{"use strict";p();async function rlo(t,e){let r=[];for await(let n of t)r.push(e(n).then(()=>null,o=>o??new Error("unknown error")));await Promise.all(r.map(n=>n.then(o=>{if(o!==null)throw o})))}a(rlo,"asyncIteratorConcurrentProcess");vqr.exports={asyncIteratorConcurrentProcess:rlo}});var xqr=I((Tal,Iqr)=>{"use strict";p();var Oy=g_(),vCe=require("path"),{mkdirs:nlo}=Rk(),{pathExists:ilo}=oU(),{utimesMillis:olo}=Kkt(),CCe=TW(),{asyncIteratorConcurrentProcess:slo}=Cqr();async function alo(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; +"use strict";var auo=Object.create;var MCe=Object.defineProperty;var cuo=Object.getOwnPropertyDescriptor;var luo=Object.getOwnPropertyNames;var uuo=Object.getPrototypeOf,duo=Object.prototype.hasOwnProperty;var _qr=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),vqr=t=>{throw TypeError(t)};var a=(t,e)=>MCe(t,"name",{value:e,configurable:!0});var Se=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var I=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ri=(t,e)=>{for(var r in e)MCe(t,r,{get:e[r],enumerable:!0})},Cqr=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of luo(e))!duo.call(t,o)&&o!==r&&MCe(t,o,{get:()=>e[o],enumerable:!(n=cuo(e,o))||n.enumerable});return t};var fe=(t,e,r)=>(r=t!=null?auo(uuo(t)):{},Cqr(e||!t||!t.__esModule?MCe(r,"default",{value:t,enumerable:!0}):r,t)),Qa=t=>Cqr(MCe({},"__esModule",{value:!0}),t);var ePt=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&vqr("Object expected");var n,o;r&&(n=e[_qr("asyncDispose")]),n===void 0&&(n=e[_qr("dispose")],r&&(o=n)),typeof n!="function"&&vqr("Object not disposable"),o&&(n=function(){try{o.call(this)}catch(s){return Promise.reject(s)}}),t.push([r,n,e])}else r&&t.push([r]);return e},tPt=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(c,l,u,d){return d=Error(u),d.name="SuppressedError",d.error=c,d.suppressed=l,d},o=c=>e=r?new n(c,e,"An error was suppressed during disposal"):(r=!0,c),s=c=>{for(;c=t.pop();)try{var l=c[1]&&c[1].call(c[2]);if(c[0])return Promise.resolve(l).then(s,u=>(o(u),s()))}catch(u){o(u)}if(r)throw e};return s()};var importMetaUrlShim,p=Se(()=>{"use strict";importMetaUrlShim=typeof document>"u"?require("node:url").pathToFileURL(__filename).href:importMetaUrlShim});var Pqr,Dqr=Se(()=>{p();Pqr="ffffffff-ffff-ffff-ffff-ffffffffffff"});var Nqr,Mqr=Se(()=>{p();Nqr="00000000-0000-0000-0000-000000000000"});var Oqr,Lqr=Se(()=>{p();Oqr=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});function buo(t){return typeof t=="string"&&Oqr.test(t)}var mU,OCe=Se(()=>{p();Lqr();a(buo,"validate");mU=buo});function Suo(t){if(!mU(t))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(t.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(t.slice(9,13),16))>>>8,e&255,(e=parseInt(t.slice(14,18),16))>>>8,e&255,(e=parseInt(t.slice(19,23),16))>>>8,e&255,(e=parseInt(t.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255)}var oB,LCe=Se(()=>{p();OCe();a(Suo,"parse");oB=Suo});function E_(t,e=0){return(hA[t[e+0]]+hA[t[e+1]]+hA[t[e+2]]+hA[t[e+3]]+"-"+hA[t[e+4]]+hA[t[e+5]]+"-"+hA[t[e+6]]+hA[t[e+7]]+"-"+hA[t[e+8]]+hA[t[e+9]]+"-"+hA[t[e+10]]+hA[t[e+11]]+hA[t[e+12]]+hA[t[e+13]]+hA[t[e+14]]+hA[t[e+15]]).toLowerCase()}function Tuo(t,e=0){let r=E_(t,e);if(!mU(r))throw TypeError("Stringified UUID is invalid");return r}var hA,Bqr,sB=Se(()=>{p();OCe();hA=[];for(let t=0;t<256;++t)hA.push((t+256).toString(16).slice(1));a(E_,"unsafeStringify");a(Tuo,"stringify");Bqr=Tuo});function aB(){return crypto.getRandomValues(Iuo)}var Iuo,i9e=Se(()=>{p();Iuo=new Uint8Array(16);a(aB,"rng")});function xuo(t,e,r){let n,o=t?._v6??!1;if(t){let s=Object.keys(t);s.length===1&&s[0]==="_v6"&&(t=void 0)}if(t)n=Fqr(t.random??t.rng?.()??aB(),t.msecs,t.nsecs,t.clockseq,t.node,e,r);else{let s=Date.now(),c=aB();wuo(BCe,s,c),n=Fqr(c,BCe.msecs,BCe.nsecs,o?void 0:BCe.clockseq,o?void 0:BCe.node,e,r)}return e??E_(n)}function wuo(t,e,r){return t.msecs??=-1/0,t.nsecs??=0,e===t.msecs?(t.nsecs++,t.nsecs>=1e4&&(t.node=void 0,t.nsecs=0)):e>t.msecs?t.nsecs=0:e= 16");if(!s)s=new Uint8Array(16),c=0;else if(c<0||c+16>s.length)throw new RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);e??=Date.now(),r??=0,n??=(t[8]<<8|t[9])&16383,o??=t.slice(10,16),e+=122192928e5;let l=((e&268435455)*1e4+r)%4294967296;s[c++]=l>>>24&255,s[c++]=l>>>16&255,s[c++]=l>>>8&255,s[c++]=l&255;let u=e/4294967296*1e4&268435455;s[c++]=u>>>8&255,s[c++]=u&255,s[c++]=u>>>24&15|16,s[c++]=u>>>16&255,s[c++]=n>>>8|128,s[c++]=n&255;for(let d=0;d<6;++d)s[c++]=o[d];return s}var BCe,o9e,sPt=Se(()=>{p();i9e();sB();BCe={};a(xuo,"v1");a(wuo,"updateV1State");a(Fqr,"v1Bytes");o9e=xuo});function FCe(t){let e=typeof t=="string"?oB(t):t,r=Ruo(e);return typeof t=="string"?E_(r):r}function Ruo(t){return Uint8Array.of((t[6]&15)<<4|t[7]>>4&15,(t[7]&15)<<4|(t[4]&240)>>4,(t[4]&15)<<4|(t[5]&240)>>4,(t[5]&15)<<4|(t[0]&240)>>4,(t[0]&15)<<4|(t[1]&240)>>4,(t[1]&15)<<4|(t[2]&240)>>4,96|t[2]&15,t[3],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}var aPt=Se(()=>{p();LCe();sB();a(FCe,"v1ToV6");a(Ruo,"_v1ToV6")});function kuo(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,Uqr.createHash)("md5").update(t).digest()}var Uqr,Qqr,qqr=Se(()=>{p();Uqr=require("node:crypto");a(kuo,"md5");Qqr=kuo});function Puo(t){t=unescape(encodeURIComponent(t));let e=new Uint8Array(t.length);for(let r=0;ro.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`);for(let d=0;d<16;++d)o[s+d]=u[d];return o}return E_(u)}var s9e,a9e,cPt=Se(()=>{p();LCe();sB();a(Puo,"stringToBytes");s9e="6ba7b810-9dad-11d1-80b4-00c04fd430c8",a9e="6ba7b811-9dad-11d1-80b4-00c04fd430c8";a(UCe,"v35")});function lPt(t,e,r,n){return UCe(48,Qqr,t,e,r,n)}var jqr,Hqr=Se(()=>{p();qqr();cPt();a(lPt,"v3");lPt.DNS=s9e;lPt.URL=a9e;jqr=lPt});function Duo(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():Nuo(t,e,r)}function Nuo(t,e,r){t=t||{};let n=t.random??t.rng?.()??aB();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)e[r+o]=n[o];return e}return E_(n)}var Nt,Gqr=Se(()=>{p();i9e();sB();a(Duo,"v4");a(Nuo,"_v4");Nt=Duo});function Muo(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,$qr.createHash)("sha1").update(t).digest()}var $qr,Vqr,Wqr=Se(()=>{p();$qr=require("node:crypto");a(Muo,"sha1");Vqr=Muo});function uPt(t,e,r,n){return UCe(80,Vqr,t,e,r,n)}var zqr,Yqr=Se(()=>{p();Wqr();cPt();a(uPt,"v5");uPt.DNS=s9e;uPt.URL=a9e;zqr=uPt});function Ouo(t,e,r){t??={},r??=0;let n=o9e({...t,_v6:!0},new Uint8Array(16));if(n=FCe(n),e){if(r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;o++)e[r+o]=n[o];return e}return E_(n)}var Kqr,Jqr=Se(()=>{p();sB();sPt();aPt();a(Ouo,"v6");Kqr=Ouo});function dPt(t){let e=typeof t=="string"?oB(t):t,r=Luo(e);return typeof t=="string"?E_(r):r}function Luo(t){return Uint8Array.of((t[3]&15)<<4|t[4]>>4&15,(t[4]&15)<<4|(t[5]&240)>>4,(t[5]&15)<<4|t[6]&15,t[7],(t[1]&15)<<4|(t[2]&240)>>4,(t[2]&15)<<4|(t[3]&240)>>4,16|(t[0]&240)>>4,(t[0]&15)<<4|(t[1]&240)>>4,t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}var Zqr=Se(()=>{p();LCe();sB();a(dPt,"v6ToV1");a(Luo,"_v6ToV1")});function Buo(t,e,r){let n;if(t)n=Xqr(t.random??t.rng?.()??aB(),t.msecs,t.seq,e,r);else{let o=Date.now(),s=aB();Fuo(fPt,o,s),n=Xqr(s,fPt.msecs,fPt.seq,e,r)}return e??E_(n)}function Fuo(t,e,r){return t.msecs??=-1/0,t.seq??=0,e>t.msecs?(t.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],t.msecs=e):(t.seq=t.seq+1|0,t.seq===0&&t.msecs++),t}function Xqr(t,e,r,n,o=0){if(t.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),o=0;else if(o<0||o+16>n.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);return e??=Date.now(),r??=t[6]*127<<24|t[7]<<16|t[8]<<8|t[9],n[o++]=e/1099511627776&255,n[o++]=e/4294967296&255,n[o++]=e/16777216&255,n[o++]=e/65536&255,n[o++]=e/256&255,n[o++]=e&255,n[o++]=112|r>>>28&15,n[o++]=r>>>20&255,n[o++]=128|r>>>14&63,n[o++]=r>>>6&255,n[o++]=r<<2&255|t[10]&3,n[o++]=t[11],n[o++]=t[12],n[o++]=t[13],n[o++]=t[14],n[o++]=t[15],n}var fPt,ejr,tjr=Se(()=>{p();i9e();sB();fPt={};a(Buo,"v7");a(Fuo,"updateV7State");a(Xqr,"v7Bytes");ejr=Buo});function Uuo(t){if(!mU(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}var rjr,njr=Se(()=>{p();OCe();a(Uuo,"version");rjr=Uuo});var Tc={};Ri(Tc,{MAX:()=>Pqr,NIL:()=>Nqr,parse:()=>oB,stringify:()=>Bqr,v1:()=>o9e,v1ToV6:()=>FCe,v3:()=>jqr,v4:()=>Nt,v5:()=>zqr,v6:()=>Kqr,v6ToV1:()=>dPt,v7:()=>ejr,validate:()=>mU,version:()=>rjr});var Mo=Se(()=>{p();Dqr();Mqr();LCe();sB();sPt();aPt();Hqr();Gqr();Yqr();Jqr();Zqr();tjr();OCe();njr()});var z0=I(pPt=>{"use strict";p();pPt.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{e.push((o,s)=>o!=null?n(o):r(s)),t.apply(this,e)})},"name",{value:t.name})};pPt.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(n=>r(null,n),r)},"name",{value:t.name})}});var ojr=I((Zll,ijr)=>{p();var gU=require("constants"),Quo=process.cwd,c9e=null,quo=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return c9e||(c9e=Quo.call(process)),c9e};try{process.cwd()}catch{}typeof process.chdir=="function"&&(hPt=process.chdir,process.chdir=function(t){c9e=null,hPt.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,hPt));var hPt;ijr.exports=juo;function juo(t){gU.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=c(t.chownSync),t.fchownSync=c(t.fchownSync),t.lchownSync=c(t.lchownSync),t.chmodSync=o(t.chmodSync),t.fchmodSync=o(t.fchmodSync),t.lchmodSync=o(t.lchmodSync),t.stat=l(t.stat),t.fstat=l(t.fstat),t.lstat=l(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(f,h,m){m&&process.nextTick(m)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(f,h,m,g){g&&process.nextTick(g)},t.lchownSync=function(){}),quo==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(f){function h(m,g,A){var y=Date.now(),E=0;f(m,g,a(function _(v){if(v&&(v.code==="EACCES"||v.code==="EPERM"||v.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){t.stat(g,function(b,T){b&&b.code==="ENOENT"?f(m,g,_):A(v)})},E),E<100&&(E+=10);return}A&&A(v)},"CB"))}return a(h,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(f){function h(m,g,A,y,E,_){var v;if(_&&typeof _=="function"){var b=0;v=a(function(T,w,R){if(T&&T.code==="EAGAIN"&&b<10)return b++,f.call(t,m,g,A,y,E,v);_.apply(this,arguments)},"callback")}return f.call(t,m,g,A,y,E,v)}return a(h,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(f){return function(h,m,g,A,y){for(var E=0;;)try{return f.call(t,h,m,g,A,y)}catch(_){if(_.code==="EAGAIN"&&E<10){E++;continue}throw _}}})(t.readSync);function e(f){f.lchmod=function(h,m,g){f.open(h,gU.O_WRONLY|gU.O_SYMLINK,m,function(A,y){if(A){g&&g(A);return}f.fchmod(y,m,function(E){f.close(y,function(_){g&&g(E||_)})})})},f.lchmodSync=function(h,m){var g=f.openSync(h,gU.O_WRONLY|gU.O_SYMLINK,m),A=!0,y;try{y=f.fchmodSync(g,m),A=!1}finally{if(A)try{f.closeSync(g)}catch{}else f.closeSync(g)}return y}}a(e,"patchLchmod");function r(f){gU.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(h,m,g,A){f.open(h,gU.O_SYMLINK,function(y,E){if(y){A&&A(y);return}f.futimes(E,m,g,function(_){f.close(E,function(v){A&&A(_||v)})})})},f.lutimesSync=function(h,m,g){var A=f.openSync(h,gU.O_SYMLINK),y,E=!0;try{y=f.futimesSync(A,m,g),E=!1}finally{if(E)try{f.closeSync(A)}catch{}else f.closeSync(A)}return y}):f.futimes&&(f.lutimes=function(h,m,g,A){A&&process.nextTick(A)},f.lutimesSync=function(){})}a(r,"patchLutimes");function n(f){return f&&function(h,m,g){return f.call(t,h,m,function(A){d(A)&&(A=null),g&&g.apply(this,arguments)})}}a(n,"chmodFix");function o(f){return f&&function(h,m){try{return f.call(t,h,m)}catch(g){if(!d(g))throw g}}}a(o,"chmodFixSync");function s(f){return f&&function(h,m,g,A){return f.call(t,h,m,g,function(y){d(y)&&(y=null),A&&A.apply(this,arguments)})}}a(s,"chownFix");function c(f){return f&&function(h,m,g){try{return f.call(t,h,m,g)}catch(A){if(!d(A))throw A}}}a(c,"chownFixSync");function l(f){return f&&function(h,m,g){typeof m=="function"&&(g=m,m=null);function A(y,E){E&&(E.uid<0&&(E.uid+=4294967296),E.gid<0&&(E.gid+=4294967296)),g&&g.apply(this,arguments)}return a(A,"callback"),m?f.call(t,h,m,A):f.call(t,h,A)}}a(l,"statFix");function u(f){return f&&function(h,m){var g=m?f.call(t,h,m):f.call(t,h);return g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),g}}a(u,"statFixSync");function d(f){if(!f||f.code==="ENOSYS")return!0;var h=!process.getuid||process.getuid()!==0;return!!(h&&(f.code==="EINVAL"||f.code==="EPERM"))}a(d,"chownErOk")}a(juo,"patch")});var cjr=I((tul,ajr)=>{p();var sjr=require("stream").Stream;ajr.exports=Huo;function Huo(t){return{ReadStream:e,WriteStream:r};function e(n,o){if(!(this instanceof e))return new e(n,o);sjr.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,o=o||{};for(var c=Object.keys(o),l=0,u=c.length;lthis.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}t.open(this.path,this.flags,this.mode,function(f,h){if(f){s.emit("error",f),s.readable=!1;return}s.fd=h,s.emit("open",h),s._read()})}function r(n,o){if(!(this instanceof r))return new r(n,o);sjr.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,o=o||{};for(var s=Object.keys(o),c=0,l=s.length;c= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}a(Huo,"legacy")});var ujr=I((iul,ljr)=>{"use strict";p();ljr.exports=$uo;var Guo=Object.getPrototypeOf||function(t){return t.__proto__};function $uo(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Guo(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}a($uo,"clone")});var Roe=I((aul,APt)=>{p();var df=require("fs"),Vuo=ojr(),Wuo=cjr(),zuo=ujr(),l9e=require("util"),mA,d9e;typeof Symbol=="function"&&typeof Symbol.for=="function"?(mA=Symbol.for("graceful-fs.queue"),d9e=Symbol.for("graceful-fs.previous")):(mA="___graceful-fs.queue",d9e="___graceful-fs.previous");function Yuo(){}a(Yuo,"noop");function pjr(t,e){Object.defineProperty(t,mA,{get:a(function(){return e},"get")})}a(pjr,"publishQueue");var LW=Yuo;l9e.debuglog?LW=l9e.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(LW=a(function(){var t=l9e.format.apply(l9e,arguments);t="GFS4: "+t.split(/\n/).join(` +GFS4: `),console.error(t)},"debug"));df[mA]||(djr=global[mA]||[],pjr(df,djr),df.close=(function(t){function e(r,n){return t.call(df,r,function(o){o||fjr(),typeof n=="function"&&n.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,d9e,{value:t}),e})(df.close),df.closeSync=(function(t){function e(r){t.apply(df,arguments),fjr()}return a(e,"closeSync"),Object.defineProperty(e,d9e,{value:t}),e})(df.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){LW(df[mA]),require("assert").equal(df[mA].length,0)}));var djr;global[mA]||pjr(global,df[mA]);APt.exports=mPt(zuo(df));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!df.__patched&&(APt.exports=mPt(df),df.__patched=!0);function mPt(t){Vuo(t),t.gracefulify=mPt,t.createReadStream=w,t.createWriteStream=R;var e=t.readFile;t.readFile=r;function r(D,N,L){return typeof N=="function"&&(L=N,N=null),B(D,N,L);function B(j,M,O,U){return e(j,M,function(q){q&&(q.code==="EMFILE"||q.code==="ENFILE")?woe([B,[j,M,O],q,U||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}a(B,"go$readFile")}a(r,"readFile");var n=t.writeFile;t.writeFile=o;function o(D,N,L,B){return typeof L=="function"&&(B=L,L=null),j(D,N,L,B);function j(M,O,U,q,Q){return n(M,O,U,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?woe([j,[M,O,U,q],Y,Q||Date.now(),Date.now()]):typeof q=="function"&&q.apply(this,arguments)})}a(j,"go$writeFile")}a(o,"writeFile");var s=t.appendFile;s&&(t.appendFile=c);function c(D,N,L,B){return typeof L=="function"&&(B=L,L=null),j(D,N,L,B);function j(M,O,U,q,Q){return s(M,O,U,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?woe([j,[M,O,U,q],Y,Q||Date.now(),Date.now()]):typeof q=="function"&&q.apply(this,arguments)})}a(j,"go$appendFile")}a(c,"appendFile");var l=t.copyFile;l&&(t.copyFile=u);function u(D,N,L,B){return typeof L=="function"&&(B=L,L=0),j(D,N,L,B);function j(M,O,U,q,Q){return l(M,O,U,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?woe([j,[M,O,U,q],Y,Q||Date.now(),Date.now()]):typeof q=="function"&&q.apply(this,arguments)})}a(j,"go$copyFile")}a(u,"copyFile");var d=t.readdir;t.readdir=h;var f=/^v[0-5]\./;function h(D,N,L){typeof N=="function"&&(L=N,N=null);var B=f.test(process.version)?a(function(O,U,q,Q){return d(O,j(O,U,q,Q))},"go$readdir"):a(function(O,U,q,Q){return d(O,U,j(O,U,q,Q))},"go$readdir");return B(D,N,L);function j(M,O,U,q){return function(Q,Y){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?woe([B,[M,O,U],Q,q||Date.now(),Date.now()]):(Y&&Y.sort&&Y.sort(),typeof U=="function"&&U.call(this,Q,Y))}}}if(a(h,"readdir"),process.version.substr(0,4)==="v0.8"){var m=Wuo(t);_=m.ReadStream,b=m.WriteStream}var g=t.ReadStream;g&&(_.prototype=Object.create(g.prototype),_.prototype.open=v);var A=t.WriteStream;A&&(b.prototype=Object.create(A.prototype),b.prototype.open=T),Object.defineProperty(t,"ReadStream",{get:a(function(){return _},"get"),set:a(function(D){_=D},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:a(function(){return b},"get"),set:a(function(D){b=D},"set"),enumerable:!0,configurable:!0});var y=_;Object.defineProperty(t,"FileReadStream",{get:a(function(){return y},"get"),set:a(function(D){y=D},"set"),enumerable:!0,configurable:!0});var E=b;Object.defineProperty(t,"FileWriteStream",{get:a(function(){return E},"get"),set:a(function(D){E=D},"set"),enumerable:!0,configurable:!0});function _(D,N){return this instanceof _?(g.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}a(_,"ReadStream");function v(){var D=this;P(D.path,D.flags,D.mode,function(N,L){N?(D.autoClose&&D.destroy(),D.emit("error",N)):(D.fd=L,D.emit("open",L),D.read())})}a(v,"ReadStream$open");function b(D,N){return this instanceof b?(A.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}a(b,"WriteStream");function T(){var D=this;P(D.path,D.flags,D.mode,function(N,L){N?(D.destroy(),D.emit("error",N)):(D.fd=L,D.emit("open",L))})}a(T,"WriteStream$open");function w(D,N){return new t.ReadStream(D,N)}a(w,"createReadStream");function R(D,N){return new t.WriteStream(D,N)}a(R,"createWriteStream");var x=t.open;t.open=P;function P(D,N,L,B){return typeof L=="function"&&(B=L,L=null),j(D,N,L,B);function j(M,O,U,q,Q){return x(M,O,U,function(Y,W){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?woe([j,[M,O,U,q],Y,Q||Date.now(),Date.now()]):typeof q=="function"&&q.apply(this,arguments)})}a(j,"go$open")}return a(P,"open"),t}a(mPt,"patch");function woe(t){LW("ENQUEUE",t[0].name,t[1]),df[mA].push(t),gPt()}a(woe,"enqueue");var u9e;function fjr(){for(var t=Date.now(),e=0;e2&&(df[mA][e][3]=t,df[mA][e][4]=t);gPt()}a(fjr,"resetQueue");function gPt(){if(clearTimeout(u9e),u9e=void 0,df[mA].length!==0){var t=df[mA].shift(),e=t[0],r=t[1],n=t[2],o=t[3],s=t[4];if(o===void 0)LW("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-o>=6e4){LW("TIMEOUT",e.name,r);var c=r.pop();typeof c=="function"&&c.call(null,n)}else{var l=Date.now()-s,u=Math.max(s-o,1),d=Math.min(u*1.2,100);l>=d?(LW("RETRY",e.name,r),e.apply(null,r.concat([o]))):df[mA].push(t)}u9e===void 0&&(u9e=setTimeout(gPt,0))}}a(gPt,"retry")});var v_=I(cB=>{"use strict";p();var hjr=z0().fromCallback,__=Roe(),Kuo=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof __[t]=="function");Object.assign(cB,__);Kuo.forEach(t=>{cB[t]=hjr(__[t])});cB.exists=function(t,e){return typeof e=="function"?__.exists(t,e):new Promise(r=>__.exists(t,r))};cB.read=function(t,e,r,n,o,s){return typeof s=="function"?__.read(t,e,r,n,o,s):new Promise((c,l)=>{__.read(t,e,r,n,o,(u,d,f)=>{if(u)return l(u);c({bytesRead:d,buffer:f})})})};cB.write=function(t,e,...r){return typeof r[r.length-1]=="function"?__.write(t,e,...r):new Promise((n,o)=>{__.write(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffer:l})})})};cB.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?__.readv(t,e,...r):new Promise((n,o)=>{__.readv(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesRead:c,buffers:l})})})};cB.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?__.writev(t,e,...r):new Promise((n,o)=>{__.writev(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffers:l})})})};typeof __.realpath.native=="function"?cB.realpath.native=hjr(__.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var gjr=I((ful,mjr)=>{"use strict";p();var Juo=require("path");mjr.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Juo.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}},"checkPath")});var _jr=I((mul,yPt)=>{"use strict";p();var Ajr=v_(),{checkPath:yjr}=gjr(),Ejr=a(t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode},"getMode");yPt.exports.makeDir=async(t,e)=>(yjr(t),Ajr.mkdir(t,{mode:Ejr(e),recursive:!0}));yPt.exports.makeDirSync=(t,e)=>(yjr(t),Ajr.mkdirSync(t,{mode:Ejr(e),recursive:!0}))});var Fk=I((yul,vjr)=>{"use strict";p();var Zuo=z0().fromPromise,{makeDir:Xuo,makeDirSync:EPt}=_jr(),_Pt=Zuo(Xuo);vjr.exports={mkdirs:_Pt,mkdirsSync:EPt,mkdirp:_Pt,mkdirpSync:EPt,ensureDir:_Pt,ensureDirSync:EPt}});var AU=I((_ul,bjr)=>{"use strict";p();var edo=z0().fromPromise,Cjr=v_();function tdo(t){return Cjr.access(t).then(()=>!0).catch(()=>!1)}a(tdo,"pathExists");bjr.exports={pathExists:edo(tdo),pathExistsSync:Cjr.existsSync}});var vPt=I((bul,Sjr)=>{"use strict";p();var koe=v_(),rdo=z0().fromPromise;async function ndo(t,e,r){let n=await koe.open(t,"r+"),o=null;try{await koe.futimes(n,e,r)}finally{try{await koe.close(n)}catch(s){o=s}}if(o)throw o}a(ndo,"utimesMillis");function ido(t,e,r){let n=koe.openSync(t,"r+");return koe.futimesSync(n,e,r),koe.closeSync(n)}a(ido,"utimesMillisSync");Sjr.exports={utimesMillis:rdo(ndo),utimesMillisSync:ido}});var BW=I((Iul,wjr)=>{"use strict";p();var Poe=v_(),Y0=require("path"),Tjr=z0().fromPromise;function odo(t,e,r){let n=r.dereference?o=>Poe.stat(o,{bigint:!0}):o=>Poe.lstat(o,{bigint:!0});return Promise.all([n(t),n(e).catch(o=>{if(o.code==="ENOENT")return null;throw o})]).then(([o,s])=>({srcStat:o,destStat:s}))}a(odo,"getStats");function sdo(t,e,r){let n,o=r.dereference?c=>Poe.statSync(c,{bigint:!0}):c=>Poe.lstatSync(c,{bigint:!0}),s=o(t);try{n=o(e)}catch(c){if(c.code==="ENOENT")return{srcStat:s,destStat:null};throw c}return{srcStat:s,destStat:n}}a(sdo,"getStatsSync");async function ado(t,e,r,n){let{srcStat:o,destStat:s}=await odo(t,e,n);if(s){if(QCe(o,s)){let c=Y0.basename(t),l=Y0.basename(e);if(r==="move"&&c!==l&&c.toLowerCase()===l.toLowerCase())return{srcStat:o,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(o.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!o.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(o.isDirectory()&&CPt(t,e))throw new Error(f9e(t,e,r));return{srcStat:o,destStat:s}}a(ado,"checkPaths");function cdo(t,e,r,n){let{srcStat:o,destStat:s}=sdo(t,e,n);if(s){if(QCe(o,s)){let c=Y0.basename(t),l=Y0.basename(e);if(r==="move"&&c!==l&&c.toLowerCase()===l.toLowerCase())return{srcStat:o,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(o.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!o.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(o.isDirectory()&&CPt(t,e))throw new Error(f9e(t,e,r));return{srcStat:o,destStat:s}}a(cdo,"checkPathsSync");async function Ijr(t,e,r,n){let o=Y0.resolve(Y0.dirname(t)),s=Y0.resolve(Y0.dirname(r));if(s===o||s===Y0.parse(s).root)return;let c;try{c=await Poe.stat(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(QCe(e,c))throw new Error(f9e(t,r,n));return Ijr(t,e,s,n)}a(Ijr,"checkParentPaths");function xjr(t,e,r,n){let o=Y0.resolve(Y0.dirname(t)),s=Y0.resolve(Y0.dirname(r));if(s===o||s===Y0.parse(s).root)return;let c;try{c=Poe.statSync(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(QCe(e,c))throw new Error(f9e(t,r,n));return xjr(t,e,s,n)}a(xjr,"checkParentPathsSync");function QCe(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}a(QCe,"areIdentical");function CPt(t,e){let r=Y0.resolve(t).split(Y0.sep).filter(o=>o),n=Y0.resolve(e).split(Y0.sep).filter(o=>o);return r.every((o,s)=>n[s]===o)}a(CPt,"isSrcSubdir");function f9e(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}a(f9e,"errMsg");wjr.exports={checkPaths:Tjr(ado),checkPathsSync:cdo,checkParentPaths:Tjr(Ijr),checkParentPathsSync:xjr,isSrcSubdir:CPt,areIdentical:QCe}});var kjr=I((Rul,Rjr)=>{"use strict";p();async function ldo(t,e){let r=[];for await(let n of t)r.push(e(n).then(()=>null,o=>o??new Error("unknown error")));await Promise.all(r.map(n=>n.then(o=>{if(o!==null)throw o})))}a(ldo,"asyncIteratorConcurrentProcess");Rjr.exports={asyncIteratorConcurrentProcess:ldo}});var Ojr=I((Dul,Mjr)=>{"use strict";p();var Uy=v_(),qCe=require("path"),{mkdirs:udo}=Fk(),{pathExists:ddo}=AU(),{utimesMillis:fdo}=vPt(),jCe=BW(),{asyncIteratorConcurrentProcess:pdo}=kjr();async function hdo(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; - see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:o}=await CCe.checkPaths(t,e,"copy",r);if(await CCe.checkParentPaths(t,n,e,"copy"),!await Sqr(t,e,r))return;let c=vCe.dirname(e);await ilo(c)||await nlo(c),await Tqr(o,t,e,r)}a(alo,"copy");async function Sqr(t,e,r){return r.filter?r.filter(t,e):!0}a(Sqr,"runFilter");async function Tqr(t,e,r,n){let s=await(n.dereference?Oy.stat:Oy.lstat)(e);if(s.isDirectory())return dlo(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return clo(s,t,e,r,n);if(s.isSymbolicLink())return flo(t,e,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}a(Tqr,"getStatsAndPerformCopy");async function clo(t,e,r,n,o){if(!e)return bqr(t,r,n,o);if(o.overwrite)return await Oy.unlink(n),bqr(t,r,n,o);if(o.errorOnExist)throw new Error(`'${n}' already exists`)}a(clo,"onFile");async function bqr(t,e,r,n){if(await Oy.copyFile(e,r),n.preserveTimestamps){llo(t.mode)&&await ulo(r,t.mode);let o=await Oy.stat(e);await olo(r,o.atime,o.mtime)}return Oy.chmod(r,t.mode)}a(bqr,"copyFile");function llo(t){return(t&128)===0}a(llo,"fileIsNotWritable");function ulo(t,e){return Oy.chmod(t,e|128)}a(ulo,"makeFileWritable");async function dlo(t,e,r,n,o){e||await Oy.mkdir(n),await slo(await Oy.opendir(r),async s=>{let c=vCe.join(r,s.name),l=vCe.join(n,s.name);if(await Sqr(c,l,o)){let{destStat:d}=await CCe.checkPaths(c,l,"copy",o);await Tqr(d,c,l,o)}}),e||await Oy.chmod(n,t.mode)}a(dlo,"onDir");async function flo(t,e,r,n){let o=await Oy.readlink(e);if(n.dereference&&(o=vCe.resolve(process.cwd(),o)),!t)return Oy.symlink(o,r);let s=null;try{s=await Oy.readlink(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return Oy.symlink(o,r);throw c}if(n.dereference&&(s=vCe.resolve(process.cwd(),s)),o!==s){if(CCe.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(CCe.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return await Oy.unlink(r),Oy.symlink(o,r)}a(flo,"onLink");Iqr.exports=alo});var Dqr=I((wal,Pqr)=>{"use strict";p();var A_=Eoe(),bCe=require("path"),plo=Rk().mkdirsSync,hlo=Kkt().utimesMillisSync,SCe=TW();function mlo(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; + see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:o}=await jCe.checkPaths(t,e,"copy",r);if(await jCe.checkParentPaths(t,n,e,"copy"),!await Djr(t,e,r))return;let c=qCe.dirname(e);await ddo(c)||await udo(c),await Njr(o,t,e,r)}a(hdo,"copy");async function Djr(t,e,r){return r.filter?r.filter(t,e):!0}a(Djr,"runFilter");async function Njr(t,e,r,n){let s=await(n.dereference?Uy.stat:Uy.lstat)(e);if(s.isDirectory())return ydo(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return mdo(s,t,e,r,n);if(s.isSymbolicLink())return Edo(t,e,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}a(Njr,"getStatsAndPerformCopy");async function mdo(t,e,r,n,o){if(!e)return Pjr(t,r,n,o);if(o.overwrite)return await Uy.unlink(n),Pjr(t,r,n,o);if(o.errorOnExist)throw new Error(`'${n}' already exists`)}a(mdo,"onFile");async function Pjr(t,e,r,n){if(await Uy.copyFile(e,r),n.preserveTimestamps){gdo(t.mode)&&await Ado(r,t.mode);let o=await Uy.stat(e);await fdo(r,o.atime,o.mtime)}return Uy.chmod(r,t.mode)}a(Pjr,"copyFile");function gdo(t){return(t&128)===0}a(gdo,"fileIsNotWritable");function Ado(t,e){return Uy.chmod(t,e|128)}a(Ado,"makeFileWritable");async function ydo(t,e,r,n,o){e||await Uy.mkdir(n),await pdo(await Uy.opendir(r),async s=>{let c=qCe.join(r,s.name),l=qCe.join(n,s.name);if(await Djr(c,l,o)){let{destStat:d}=await jCe.checkPaths(c,l,"copy",o);await Njr(d,c,l,o)}}),e||await Uy.chmod(n,t.mode)}a(ydo,"onDir");async function Edo(t,e,r,n){let o=await Uy.readlink(e);if(n.dereference&&(o=qCe.resolve(process.cwd(),o)),!t)return Uy.symlink(o,r);let s=null;try{s=await Uy.readlink(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return Uy.symlink(o,r);throw c}if(n.dereference&&(s=qCe.resolve(process.cwd(),s)),o!==s){if(jCe.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(jCe.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return await Uy.unlink(r),Uy.symlink(o,r)}a(Edo,"onLink");Mjr.exports=hdo});var Qjr=I((Oul,Ujr)=>{"use strict";p();var C_=Roe(),HCe=require("path"),_do=Fk().mkdirsSync,vdo=vPt().utimesMillisSync,GCe=BW();function Cdo(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; - see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:o}=SCe.checkPathsSync(t,e,"copy",r);if(SCe.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let s=bCe.dirname(e);return A_.existsSync(s)||plo(s),wqr(o,t,e,r)}a(mlo,"copySync");function wqr(t,e,r,n){let s=(n.dereference?A_.statSync:A_.lstatSync)(e);if(s.isDirectory())return Clo(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return glo(s,t,e,r,n);if(s.isSymbolicLink())return Tlo(t,e,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}a(wqr,"getStats");function glo(t,e,r,n,o){return e?Alo(t,r,n,o):Rqr(t,r,n,o)}a(glo,"onFile");function Alo(t,e,r,n){if(n.overwrite)return A_.unlinkSync(r),Rqr(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}a(Alo,"mayCopyFile");function Rqr(t,e,r,n){return A_.copyFileSync(e,r),n.preserveTimestamps&&ylo(t.mode,e,r),Zkt(r,t.mode)}a(Rqr,"copyFile");function ylo(t,e,r){return Elo(t)&&_lo(r,t),vlo(e,r)}a(ylo,"handleTimestamps");function Elo(t){return(t&128)===0}a(Elo,"fileIsNotWritable");function _lo(t,e){return Zkt(t,e|128)}a(_lo,"makeFileWritable");function Zkt(t,e){return A_.chmodSync(t,e)}a(Zkt,"setDestMode");function vlo(t,e){let r=A_.statSync(t);return hlo(e,r.atime,r.mtime)}a(vlo,"setDestTimestamps");function Clo(t,e,r,n,o){return e?kqr(r,n,o):blo(t.mode,r,n,o)}a(Clo,"onDir");function blo(t,e,r,n){return A_.mkdirSync(r),kqr(e,r,n),Zkt(r,t)}a(blo,"mkDirAndCopy");function kqr(t,e,r){let n=A_.opendirSync(t);try{let o;for(;(o=n.readSync())!==null;)Slo(o.name,t,e,r)}finally{n.closeSync()}}a(kqr,"copyDir");function Slo(t,e,r,n){let o=bCe.join(e,t),s=bCe.join(r,t);if(n.filter&&!n.filter(o,s))return;let{destStat:c}=SCe.checkPathsSync(o,s,"copy",n);return wqr(c,o,s,n)}a(Slo,"copyDirItem");function Tlo(t,e,r,n){let o=A_.readlinkSync(e);if(n.dereference&&(o=bCe.resolve(process.cwd(),o)),t){let s;try{s=A_.readlinkSync(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return A_.symlinkSync(o,r);throw c}if(n.dereference&&(s=bCe.resolve(process.cwd(),s)),o!==s){if(SCe.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(SCe.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return Ilo(o,r)}else return A_.symlinkSync(o,r)}a(Tlo,"onLink");function Ilo(t,e){return A_.unlinkSync(e),A_.symlinkSync(t,e)}a(Ilo,"copyLink");Pqr.exports=mlo});var q6e=I((Pal,Nqr)=>{"use strict";p();var xlo=V0().fromPromise;Nqr.exports={copy:xlo(xqr()),copySync:Dqr()}});var TCe=I((Nal,Oqr)=>{"use strict";p();var Mqr=Eoe(),wlo=V0().fromCallback;function Rlo(t,e){Mqr.rm(t,{recursive:!0,force:!0},e)}a(Rlo,"remove");function klo(t){Mqr.rmSync(t,{recursive:!0,force:!0})}a(klo,"removeSync");Oqr.exports={remove:wlo(Rlo),removeSync:klo}});var Hqr=I((Lal,jqr)=>{"use strict";p();var Plo=V0().fromPromise,Fqr=g_(),Uqr=require("path"),Qqr=Rk(),qqr=TCe(),Lqr=Plo(a(async function(e){let r;try{r=await Fqr.readdir(e)}catch{return Qqr.mkdirs(e)}return Promise.all(r.map(n=>qqr.remove(Uqr.join(e,n))))},"emptyDir"));function Bqr(t){let e;try{e=Fqr.readdirSync(t)}catch{return Qqr.mkdirsSync(t)}e.forEach(r=>{r=Uqr.join(t,r),qqr.removeSync(r)})}a(Bqr,"emptyDirSync");jqr.exports={emptyDirSync:Bqr,emptydirSync:Bqr,emptyDir:Lqr,emptydir:Lqr}});var Wqr=I((Ual,Vqr)=>{"use strict";p();var Dlo=V0().fromPromise,Gqr=require("path"),nB=g_(),$qr=Rk();async function Nlo(t){let e;try{e=await nB.stat(t)}catch{}if(e&&e.isFile())return;let r=Gqr.dirname(t),n=null;try{n=await nB.stat(r)}catch(o){if(o.code==="ENOENT"){await $qr.mkdirs(r),await nB.writeFile(t,"");return}else throw o}n.isDirectory()?await nB.writeFile(t,""):await nB.readdir(r)}a(Nlo,"createFile");function Mlo(t){let e;try{e=nB.statSync(t)}catch{}if(e&&e.isFile())return;let r=Gqr.dirname(t);try{nB.statSync(r).isDirectory()||nB.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")$qr.mkdirsSync(r);else throw n}nB.writeFileSync(t,"")}a(Mlo,"createFileSync");Vqr.exports={createFile:Dlo(Nlo),createFileSync:Mlo}});var Zqr=I((jal,Jqr)=>{"use strict";p();var Olo=V0().fromPromise,zqr=require("path"),sU=g_(),Yqr=Rk(),{pathExists:Llo}=oU(),{areIdentical:Kqr}=TW();async function Blo(t,e){let r;try{r=await sU.lstat(e)}catch{}let n;try{n=await sU.lstat(t)}catch(c){throw c.message=c.message.replace("lstat","ensureLink"),c}if(r&&Kqr(n,r))return;let o=zqr.dirname(e);await Llo(o)||await Yqr.mkdirs(o),await sU.link(t,e)}a(Blo,"createLink");function Flo(t,e){let r;try{r=sU.lstatSync(e)}catch{}try{let s=sU.lstatSync(t);if(r&&Kqr(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=zqr.dirname(e);return sU.existsSync(n)||Yqr.mkdirsSync(n),sU.linkSync(t,e)}a(Flo,"createLinkSync");Jqr.exports={createLink:Olo(Blo),createLinkSync:Flo}});var ejr=I(($al,Xqr)=>{"use strict";p();var aU=require("path"),ICe=g_(),{pathExists:Ulo}=oU(),Qlo=V0().fromPromise;async function qlo(t,e){if(aU.isAbsolute(t)){try{await ICe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:t}}let r=aU.dirname(e),n=aU.join(r,t);if(await Ulo(n))return{toCwd:n,toDst:t};try{await ICe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:aU.relative(r,t)}}a(qlo,"symlinkPaths");function jlo(t,e){if(aU.isAbsolute(t)){if(!ICe.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=aU.dirname(e),n=aU.join(r,t);if(ICe.existsSync(n))return{toCwd:n,toDst:t};if(!ICe.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:aU.relative(r,t)}}a(jlo,"symlinkPathsSync");Xqr.exports={symlinkPaths:Qlo(qlo),symlinkPathsSync:jlo}});var njr=I((zal,rjr)=>{"use strict";p();var tjr=g_(),Hlo=V0().fromPromise;async function Glo(t,e){if(e)return e;let r;try{r=await tjr.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(Glo,"symlinkType");function $lo(t,e){if(e)return e;let r;try{r=tjr.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a($lo,"symlinkTypeSync");rjr.exports={symlinkType:Hlo(Glo),symlinkTypeSync:$lo}});var sjr=I((Jal,ojr)=>{"use strict";p();var Vlo=V0().fromPromise,cU=require("path"),rC=g_(),{mkdirs:Wlo,mkdirsSync:zlo}=Rk(),{symlinkPaths:Ylo,symlinkPathsSync:Klo}=ejr(),{symlinkType:Jlo,symlinkTypeSync:Zlo}=njr(),{pathExists:Xlo}=oU(),{areIdentical:ijr}=TW();async function euo(t,e,r){let n;try{n=await rC.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(cU.isAbsolute(t))l=await rC.stat(t);else{let d=cU.dirname(e),f=cU.join(d,t);try{l=await rC.stat(f)}catch{l=await rC.stat(t)}}let u=await rC.stat(e);if(ijr(l,u))return}let o=await Ylo(t,e);t=o.toDst;let s=await Jlo(o.toCwd,r),c=cU.dirname(e);return await Xlo(c)||await Wlo(c),rC.symlink(t,e,s)}a(euo,"createSymlink");function tuo(t,e,r){let n;try{n=rC.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(cU.isAbsolute(t))l=rC.statSync(t);else{let d=cU.dirname(e),f=cU.join(d,t);try{l=rC.statSync(f)}catch{l=rC.statSync(t)}}let u=rC.statSync(e);if(ijr(l,u))return}let o=Klo(t,e);t=o.toDst,r=Zlo(o.toCwd,r);let s=cU.dirname(e);return rC.existsSync(s)||zlo(s),rC.symlinkSync(t,e,r)}a(tuo,"createSymlinkSync");ojr.exports={createSymlink:Vlo(euo),createSymlinkSync:tuo}});var hjr=I((ecl,pjr)=>{"use strict";p();var{createFile:ajr,createFileSync:cjr}=Wqr(),{createLink:ljr,createLinkSync:ujr}=Zqr(),{createSymlink:djr,createSymlinkSync:fjr}=sjr();pjr.exports={createFile:ajr,createFileSync:cjr,ensureFile:ajr,ensureFileSync:cjr,createLink:ljr,createLinkSync:ujr,ensureLink:ljr,ensureLinkSync:ujr,createSymlink:djr,createSymlinkSync:fjr,ensureSymlink:djr,ensureSymlinkSync:fjr}});var j6e=I((rcl,mjr)=>{p();function ruo(t,{EOL:e=` -`,finalEOL:r=!0,replacer:n=null,spaces:o}={}){let s=r?e:"",c=JSON.stringify(t,n,o);if(c===void 0)throw new TypeError(`Converting ${typeof t} value to JSON is not supported`);return c.replace(/\n/g,e)+s}a(ruo,"stringify");function nuo(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}a(nuo,"stripBom");mjr.exports={stringify:ruo,stripBom:nuo}});var Ejr=I((ocl,yjr)=>{p();var Coe;try{Coe=Eoe()}catch{Coe=require("fs")}var H6e=V0(),{stringify:gjr,stripBom:Ajr}=j6e();async function iuo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Coe,n="throws"in e?e.throws:!0,o=await H6e.fromCallback(r.readFile)(t,e);o=Ajr(o);let s;try{s=JSON.parse(o,e?e.reviver:null)}catch(c){if(n)throw c.message=`${t}: ${c.message}`,c;return null}return s}a(iuo,"_readFile");var ouo=H6e.fromPromise(iuo);function suo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Coe,n="throws"in e?e.throws:!0;try{let o=r.readFileSync(t,e);return o=Ajr(o),JSON.parse(o,e.reviver)}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}}a(suo,"readFileSync");async function auo(t,e,r={}){let n=r.fs||Coe,o=gjr(e,r);await H6e.fromCallback(n.writeFile)(t,o,r)}a(auo,"_writeFile");var cuo=H6e.fromPromise(auo);function luo(t,e,r={}){let n=r.fs||Coe,o=gjr(e,r);return n.writeFileSync(t,o,r)}a(luo,"writeFileSync");yjr.exports={readFile:ouo,readFileSync:suo,writeFile:cuo,writeFileSync:luo}});var vjr=I((ccl,_jr)=>{"use strict";p();var G6e=Ejr();_jr.exports={readJson:G6e.readFile,readJsonSync:G6e.readFileSync,writeJson:G6e.writeFile,writeJsonSync:G6e.writeFileSync}});var $6e=I((ucl,Sjr)=>{"use strict";p();var uuo=V0().fromPromise,Xkt=g_(),Cjr=require("path"),bjr=Rk(),duo=oU().pathExists;async function fuo(t,e,r="utf-8"){let n=Cjr.dirname(t);return await duo(n)||await bjr.mkdirs(n),Xkt.writeFile(t,e,r)}a(fuo,"outputFile");function puo(t,...e){let r=Cjr.dirname(t);Xkt.existsSync(r)||bjr.mkdirsSync(r),Xkt.writeFileSync(t,...e)}a(puo,"outputFileSync");Sjr.exports={outputFile:uuo(fuo),outputFileSync:puo}});var Ijr=I((pcl,Tjr)=>{"use strict";p();var{stringify:huo}=j6e(),{outputFile:muo}=$6e();async function guo(t,e,r={}){let n=huo(e,r);await muo(t,n,r)}a(guo,"outputJson");Tjr.exports=guo});var wjr=I((gcl,xjr)=>{"use strict";p();var{stringify:Auo}=j6e(),{outputFileSync:yuo}=$6e();function Euo(t,e,r){let n=Auo(e,r);yuo(t,n,r)}a(Euo,"outputJsonSync");xjr.exports=Euo});var kjr=I((Ecl,Rjr)=>{"use strict";p();var _uo=V0().fromPromise,y_=vjr();y_.outputJson=_uo(Ijr());y_.outputJsonSync=wjr();y_.outputJSON=y_.outputJson;y_.outputJSONSync=y_.outputJsonSync;y_.writeJSON=y_.writeJson;y_.writeJSONSync=y_.writeJsonSync;y_.readJSON=y_.readJson;y_.readJSONSync=y_.readJsonSync;Rjr.exports=y_});var Ojr=I((vcl,Mjr)=>{"use strict";p();var vuo=g_(),Pjr=require("path"),{copy:Cuo}=q6e(),{remove:Njr}=TCe(),{mkdirp:buo}=Rk(),{pathExists:Suo}=oU(),Djr=TW();async function Tuo(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=await Djr.checkPaths(t,e,"move",r);await Djr.checkParentPaths(t,o,e,"move");let c=Pjr.dirname(e);return Pjr.parse(c).root!==c&&await buo(c),Iuo(t,e,n,s)}a(Tuo,"move");async function Iuo(t,e,r,n){if(!n){if(r)await Njr(e);else if(await Suo(e))throw new Error("dest already exists.")}try{await vuo.rename(t,e)}catch(o){if(o.code!=="EXDEV")throw o;await xuo(t,e,r)}}a(Iuo,"doRename");async function xuo(t,e,r){return await Cuo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Njr(t)}a(xuo,"moveAcrossDevice");Mjr.exports=Tuo});var Qjr=I((Scl,Ujr)=>{"use strict";p();var Bjr=Eoe(),tPt=require("path"),wuo=q6e().copySync,Fjr=TCe().removeSync,Ruo=Rk().mkdirpSync,Ljr=TW();function kuo(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=Ljr.checkPathsSync(t,e,"move",r);return Ljr.checkParentPathsSync(t,o,e,"move"),Puo(e)||Ruo(tPt.dirname(e)),Duo(t,e,n,s)}a(kuo,"moveSync");function Puo(t){let e=tPt.dirname(t);return tPt.parse(e).root===e}a(Puo,"isParentRoot");function Duo(t,e,r,n){if(n)return ePt(t,e,r);if(r)return Fjr(e),ePt(t,e,r);if(Bjr.existsSync(e))throw new Error("dest already exists.");return ePt(t,e,r)}a(Duo,"doRename");function ePt(t,e,r){try{Bjr.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return Nuo(t,e,r)}}a(ePt,"rename");function Nuo(t,e,r){return wuo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Fjr(t)}a(Nuo,"moveAcrossDevice");Ujr.exports=kuo});var jjr=I((xcl,qjr)=>{"use strict";p();var Muo=V0().fromPromise;qjr.exports={move:Muo(Ojr()),moveSync:Qjr()}});var Gjr=I((Rcl,Hjr)=>{"use strict";p();Hjr.exports={...g_(),...q6e(),...Hqr(),...hjr(),...kjr(),...Rk(),...jjr(),...$6e(),...oU(),...TCe()}});var W6e=I((Pcl,Wjr)=>{p();var rPt=require("fs"),V6e=require("path"),xCe=V6e.join,Ouo=V6e.dirname,$jr=rPt.accessSync&&function(t){try{rPt.accessSync(t)}catch{return!1}return!0}||rPt.existsSync||V6e.existsSync,Vjr={arrow:process.env.NODE_BINDINGS_ARROW||" \u2192 ",compiled:process.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:process.platform,arch:process.arch,nodePreGyp:"node-v"+process.versions.modules+"-"+process.platform+"-"+process.arch,version:process.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","compiled","platform","arch","bindings"]]};function Luo(t){typeof t=="string"?t={bindings:t}:t||(t={}),Object.keys(Vjr).map(function(u){u in t||(t[u]=Vjr[u])}),t.module_root||(t.module_root=Buo(__filename)),V6e.extname(t.bindings)!=".node"&&(t.bindings+=".node");for(var e=typeof __webpack_require__=="function"?__non_webpack_require__:require,r=[],n=0,o=t.try.length,s,c,l;n{"use strict";p();var Mdo=z0().fromPromise;qjr.exports={copy:Mdo(Ojr()),copySync:Qjr()}});var $Ce=I((Qul,Hjr)=>{"use strict";p();var jjr=Roe(),Odo=z0().fromCallback;function Ldo(t,e){jjr.rm(t,{recursive:!0,force:!0},e)}a(Ldo,"remove");function Bdo(t){jjr.rmSync(t,{recursive:!0,force:!0})}a(Bdo,"removeSync");Hjr.exports={remove:Odo(Ldo),removeSync:Bdo}});var Jjr=I((Hul,Kjr)=>{"use strict";p();var Fdo=z0().fromPromise,Vjr=v_(),Wjr=require("path"),zjr=Fk(),Yjr=$Ce(),Gjr=Fdo(a(async function(e){let r;try{r=await Vjr.readdir(e)}catch{return zjr.mkdirs(e)}return Promise.all(r.map(n=>Yjr.remove(Wjr.join(e,n))))},"emptyDir"));function $jr(t){let e;try{e=Vjr.readdirSync(t)}catch{return zjr.mkdirsSync(t)}e.forEach(r=>{r=Wjr.join(t,r),Yjr.removeSync(r)})}a($jr,"emptyDirSync");Kjr.exports={emptyDirSync:$jr,emptydirSync:$jr,emptyDir:Gjr,emptydir:Gjr}});var tHr=I((Vul,eHr)=>{"use strict";p();var Udo=z0().fromPromise,Zjr=require("path"),lB=v_(),Xjr=Fk();async function Qdo(t){let e;try{e=await lB.stat(t)}catch{}if(e&&e.isFile())return;let r=Zjr.dirname(t),n=null;try{n=await lB.stat(r)}catch(o){if(o.code==="ENOENT"){await Xjr.mkdirs(r),await lB.writeFile(t,"");return}else throw o}n.isDirectory()?await lB.writeFile(t,""):await lB.readdir(r)}a(Qdo,"createFile");function qdo(t){let e;try{e=lB.statSync(t)}catch{}if(e&&e.isFile())return;let r=Zjr.dirname(t);try{lB.statSync(r).isDirectory()||lB.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")Xjr.mkdirsSync(r);else throw n}lB.writeFileSync(t,"")}a(qdo,"createFileSync");eHr.exports={createFile:Udo(Qdo),createFileSync:qdo}});var sHr=I((Yul,oHr)=>{"use strict";p();var jdo=z0().fromPromise,rHr=require("path"),yU=v_(),nHr=Fk(),{pathExists:Hdo}=AU(),{areIdentical:iHr}=BW();async function Gdo(t,e){let r;try{r=await yU.lstat(e)}catch{}let n;try{n=await yU.lstat(t)}catch(c){throw c.message=c.message.replace("lstat","ensureLink"),c}if(r&&iHr(n,r))return;let o=rHr.dirname(e);await Hdo(o)||await nHr.mkdirs(o),await yU.link(t,e)}a(Gdo,"createLink");function $do(t,e){let r;try{r=yU.lstatSync(e)}catch{}try{let s=yU.lstatSync(t);if(r&&iHr(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=rHr.dirname(e);return yU.existsSync(n)||nHr.mkdirsSync(n),yU.linkSync(t,e)}a($do,"createLinkSync");oHr.exports={createLink:jdo(Gdo),createLinkSync:$do}});var cHr=I((Zul,aHr)=>{"use strict";p();var EU=require("path"),VCe=v_(),{pathExists:Vdo}=AU(),Wdo=z0().fromPromise;async function zdo(t,e){if(EU.isAbsolute(t)){try{await VCe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:t}}let r=EU.dirname(e),n=EU.join(r,t);if(await Vdo(n))return{toCwd:n,toDst:t};try{await VCe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:EU.relative(r,t)}}a(zdo,"symlinkPaths");function Ydo(t,e){if(EU.isAbsolute(t)){if(!VCe.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=EU.dirname(e),n=EU.join(r,t);if(VCe.existsSync(n))return{toCwd:n,toDst:t};if(!VCe.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:EU.relative(r,t)}}a(Ydo,"symlinkPathsSync");aHr.exports={symlinkPaths:Wdo(zdo),symlinkPathsSync:Ydo}});var dHr=I((tdl,uHr)=>{"use strict";p();var lHr=v_(),Kdo=z0().fromPromise;async function Jdo(t,e){if(e)return e;let r;try{r=await lHr.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(Jdo,"symlinkType");function Zdo(t,e){if(e)return e;let r;try{r=lHr.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(Zdo,"symlinkTypeSync");uHr.exports={symlinkType:Kdo(Jdo),symlinkTypeSync:Zdo}});var hHr=I((idl,pHr)=>{"use strict";p();var Xdo=z0().fromPromise,_U=require("path"),oC=v_(),{mkdirs:efo,mkdirsSync:tfo}=Fk(),{symlinkPaths:rfo,symlinkPathsSync:nfo}=cHr(),{symlinkType:ifo,symlinkTypeSync:ofo}=dHr(),{pathExists:sfo}=AU(),{areIdentical:fHr}=BW();async function afo(t,e,r){let n;try{n=await oC.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(_U.isAbsolute(t))l=await oC.stat(t);else{let d=_U.dirname(e),f=_U.join(d,t);try{l=await oC.stat(f)}catch{l=await oC.stat(t)}}let u=await oC.stat(e);if(fHr(l,u))return}let o=await rfo(t,e);t=o.toDst;let s=await ifo(o.toCwd,r),c=_U.dirname(e);return await sfo(c)||await efo(c),oC.symlink(t,e,s)}a(afo,"createSymlink");function cfo(t,e,r){let n;try{n=oC.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(_U.isAbsolute(t))l=oC.statSync(t);else{let d=_U.dirname(e),f=_U.join(d,t);try{l=oC.statSync(f)}catch{l=oC.statSync(t)}}let u=oC.statSync(e);if(fHr(l,u))return}let o=nfo(t,e);t=o.toDst,r=ofo(o.toCwd,r);let s=_U.dirname(e);return oC.existsSync(s)||tfo(s),oC.symlinkSync(t,e,r)}a(cfo,"createSymlinkSync");pHr.exports={createSymlink:Xdo(afo),createSymlinkSync:cfo}});var CHr=I((adl,vHr)=>{"use strict";p();var{createFile:mHr,createFileSync:gHr}=tHr(),{createLink:AHr,createLinkSync:yHr}=sHr(),{createSymlink:EHr,createSymlinkSync:_Hr}=hHr();vHr.exports={createFile:mHr,createFileSync:gHr,ensureFile:mHr,ensureFileSync:gHr,createLink:AHr,createLinkSync:yHr,ensureLink:AHr,ensureLinkSync:yHr,createSymlink:EHr,createSymlinkSync:_Hr,ensureSymlink:EHr,ensureSymlinkSync:_Hr}});var h9e=I((ldl,bHr)=>{p();function lfo(t,{EOL:e=` +`,finalEOL:r=!0,replacer:n=null,spaces:o}={}){let s=r?e:"",c=JSON.stringify(t,n,o);if(c===void 0)throw new TypeError(`Converting ${typeof t} value to JSON is not supported`);return c.replace(/\n/g,e)+s}a(lfo,"stringify");function ufo(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}a(ufo,"stripBom");bHr.exports={stringify:lfo,stripBom:ufo}});var xHr=I((fdl,IHr)=>{p();var Doe;try{Doe=Roe()}catch{Doe=require("fs")}var m9e=z0(),{stringify:SHr,stripBom:THr}=h9e();async function dfo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Doe,n="throws"in e?e.throws:!0,o=await m9e.fromCallback(r.readFile)(t,e);o=THr(o);let s;try{s=JSON.parse(o,e?e.reviver:null)}catch(c){if(n)throw c.message=`${t}: ${c.message}`,c;return null}return s}a(dfo,"_readFile");var ffo=m9e.fromPromise(dfo);function pfo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Doe,n="throws"in e?e.throws:!0;try{let o=r.readFileSync(t,e);return o=THr(o),JSON.parse(o,e.reviver)}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}}a(pfo,"readFileSync");async function hfo(t,e,r={}){let n=r.fs||Doe,o=SHr(e,r);await m9e.fromCallback(n.writeFile)(t,o,r)}a(hfo,"_writeFile");var mfo=m9e.fromPromise(hfo);function gfo(t,e,r={}){let n=r.fs||Doe,o=SHr(e,r);return n.writeFileSync(t,o,r)}a(gfo,"writeFileSync");IHr.exports={readFile:ffo,readFileSync:pfo,writeFile:mfo,writeFileSync:gfo}});var RHr=I((mdl,wHr)=>{"use strict";p();var g9e=xHr();wHr.exports={readJson:g9e.readFile,readJsonSync:g9e.readFileSync,writeJson:g9e.writeFile,writeJsonSync:g9e.writeFileSync}});var A9e=I((Adl,DHr)=>{"use strict";p();var Afo=z0().fromPromise,SPt=v_(),kHr=require("path"),PHr=Fk(),yfo=AU().pathExists;async function Efo(t,e,r="utf-8"){let n=kHr.dirname(t);return await yfo(n)||await PHr.mkdirs(n),SPt.writeFile(t,e,r)}a(Efo,"outputFile");function _fo(t,...e){let r=kHr.dirname(t);SPt.existsSync(r)||PHr.mkdirsSync(r),SPt.writeFileSync(t,...e)}a(_fo,"outputFileSync");DHr.exports={outputFile:Afo(Efo),outputFileSync:_fo}});var MHr=I((_dl,NHr)=>{"use strict";p();var{stringify:vfo}=h9e(),{outputFile:Cfo}=A9e();async function bfo(t,e,r={}){let n=vfo(e,r);await Cfo(t,n,r)}a(bfo,"outputJson");NHr.exports=bfo});var LHr=I((bdl,OHr)=>{"use strict";p();var{stringify:Sfo}=h9e(),{outputFileSync:Tfo}=A9e();function Ifo(t,e,r){let n=Sfo(e,r);Tfo(t,n,r)}a(Ifo,"outputJsonSync");OHr.exports=Ifo});var FHr=I((Idl,BHr)=>{"use strict";p();var xfo=z0().fromPromise,b_=RHr();b_.outputJson=xfo(MHr());b_.outputJsonSync=LHr();b_.outputJSON=b_.outputJson;b_.outputJSONSync=b_.outputJsonSync;b_.writeJSON=b_.writeJson;b_.writeJSONSync=b_.writeJsonSync;b_.readJSON=b_.readJson;b_.readJSONSync=b_.readJsonSync;BHr.exports=b_});var HHr=I((wdl,jHr)=>{"use strict";p();var wfo=v_(),UHr=require("path"),{copy:Rfo}=p9e(),{remove:qHr}=$Ce(),{mkdirp:kfo}=Fk(),{pathExists:Pfo}=AU(),QHr=BW();async function Dfo(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=await QHr.checkPaths(t,e,"move",r);await QHr.checkParentPaths(t,o,e,"move");let c=UHr.dirname(e);return UHr.parse(c).root!==c&&await kfo(c),Nfo(t,e,n,s)}a(Dfo,"move");async function Nfo(t,e,r,n){if(!n){if(r)await qHr(e);else if(await Pfo(e))throw new Error("dest already exists.")}try{await wfo.rename(t,e)}catch(o){if(o.code!=="EXDEV")throw o;await Mfo(t,e,r)}}a(Nfo,"doRename");async function Mfo(t,e,r){return await Rfo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),qHr(t)}a(Mfo,"moveAcrossDevice");jHr.exports=Dfo});var zHr=I((Pdl,WHr)=>{"use strict";p();var $Hr=Roe(),IPt=require("path"),Ofo=p9e().copySync,VHr=$Ce().removeSync,Lfo=Fk().mkdirpSync,GHr=BW();function Bfo(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=GHr.checkPathsSync(t,e,"move",r);return GHr.checkParentPathsSync(t,o,e,"move"),Ffo(e)||Lfo(IPt.dirname(e)),Ufo(t,e,n,s)}a(Bfo,"moveSync");function Ffo(t){let e=IPt.dirname(t);return IPt.parse(e).root===e}a(Ffo,"isParentRoot");function Ufo(t,e,r,n){if(n)return TPt(t,e,r);if(r)return VHr(e),TPt(t,e,r);if($Hr.existsSync(e))throw new Error("dest already exists.");return TPt(t,e,r)}a(Ufo,"doRename");function TPt(t,e,r){try{$Hr.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return Qfo(t,e,r)}}a(TPt,"rename");function Qfo(t,e,r){return Ofo(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),VHr(t)}a(Qfo,"moveAcrossDevice");WHr.exports=Bfo});var KHr=I((Mdl,YHr)=>{"use strict";p();var qfo=z0().fromPromise;YHr.exports={move:qfo(HHr()),moveSync:zHr()}});var ZHr=I((Ldl,JHr)=>{"use strict";p();JHr.exports={...v_(),...p9e(),...Jjr(),...CHr(),...FHr(),...Fk(),...KHr(),...A9e(),...AU(),...$Ce()}});var E9e=I((Fdl,tGr)=>{p();var xPt=require("fs"),y9e=require("path"),WCe=y9e.join,jfo=y9e.dirname,XHr=xPt.accessSync&&function(t){try{xPt.accessSync(t)}catch{return!1}return!0}||xPt.existsSync||y9e.existsSync,eGr={arrow:process.env.NODE_BINDINGS_ARROW||" \u2192 ",compiled:process.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:process.platform,arch:process.arch,nodePreGyp:"node-v"+process.versions.modules+"-"+process.platform+"-"+process.arch,version:process.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","compiled","platform","arch","bindings"]]};function Hfo(t){typeof t=="string"?t={bindings:t}:t||(t={}),Object.keys(eGr).map(function(u){u in t||(t[u]=eGr[u])}),t.module_root||(t.module_root=Gfo(__filename)),y9e.extname(t.bindings)!=".node"&&(t.bindings+=".node");for(var e=typeof __webpack_require__=="function"?__non_webpack_require__:require,r=[],n=0,o=t.try.length,s,c,l;n{"use strict";p();var Fuo=FI&&FI.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Uuo=FI&&FI.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),zjr=FI&&FI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Fuo(e,t,r);return Uuo(e,t),e};Object.defineProperty(FI,"__esModule",{value:!0});FI.setDeviceId=FI.getDeviceId=void 0;var z6e=zjr(require("path")),Y6e=zjr(Gjr()),Yjr=process.platform==="win32"?W6e()("windows"):null,Quo="deviceid";function Kjr(){let t;if(!process.env.HOME)throw new Error("Home directory not found");if(process.platform==="darwin")t=z6e.join(process.env.HOME,"Library","Application Support");else if(process.platform==="linux")t=process.env.XDG_CACHE_HOME??z6e.join(process.env.HOME,".cache");else throw new Error("Unsupported platform");return z6e.join(t,"Microsoft","DeveloperTools")}a(Kjr,"getDirectory");function nPt(){return z6e.join(Kjr(),Quo)}a(nPt,"getDeviceIdFilePath");async function quo(){return process.platform==="win32"?Yjr?.GetDeviceId():await juo(nPt())?Y6e.readFile(nPt(),"utf8"):void 0}a(quo,"getDeviceId");FI.getDeviceId=quo;async function juo(t){try{return await Y6e.promises.access(t),!0}catch{return!1}}a(juo,"exists");async function Huo(t){process.platform==="win32"?Yjr?.SetDeviceId(t):(await Y6e.ensureDir(Kjr()),await Y6e.writeFile(nPt(),t,"utf8"))}a(Huo,"setDeviceId");FI.setDeviceId=Huo});var Xjr=I(ZN=>{"use strict";p();var Guo=ZN&&ZN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$uo=ZN&&ZN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Vuo=ZN&&ZN.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Guo(e,t,r);return $uo(e,t),e};Object.defineProperty(ZN,"__esModule",{value:!0});ZN.getDeviceId=void 0;var Wuo=(Mo(),ba(Cc)),Zjr=Vuo(Jjr());async function zuo(){let t;try{t=await Zjr.getDeviceId()}catch{}if(t)return t;{let e=(0,Wuo.v4)().toLowerCase();return await Zjr.setDeviceId(e),e}}a(zuo,"getDeviceId");ZN.getDeviceId=zuo});var eHr=I(IW=>{"use strict";p();var Yuo=IW&&IW.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Kuo=IW&&IW.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Yuo(e,t,r)};Object.defineProperty(IW,"__esModule",{value:!0});if(process.platform!=="win32"&&process.platform!=="darwin"&&process.platform!=="linux")throw new Error("Unsupported platform");Kuo(Xjr(),IW)});var sa=I((J6e,tHr)=>{p();(function(t,e){typeof J6e=="object"?tHr.exports=J6e=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(J6e,function(){var t=t||(function(e,r){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&typeof global<"u"&&global.crypto&&(n=global.crypto),!n&&typeof require=="function")try{n=require("crypto")}catch{}var o=a(function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},"cryptoSecureRandomInt"),s=Object.create||(function(){function _(){}return a(_,"F"),function(v){var b;return _.prototype=v,b=new _,_.prototype=null,b}})(),c={},l=c.lib={},u=l.Base=(function(){return{extend:a(function(_){var v=s(this);return _&&v.mixIn(_),(!v.hasOwnProperty("init")||this.init===v.init)&&(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},"extend"),create:a(function(){var _=this.extend();return _.init.apply(_,arguments),_},"create"),init:a(function(){},"init"),mixIn:a(function(_){for(var v in _)_.hasOwnProperty(v)&&(this[v]=_[v]);_.hasOwnProperty("toString")&&(this.toString=_.toString)},"mixIn"),clone:a(function(){return this.init.prototype.extend(this)},"clone")}})(),d=l.WordArray=u.extend({init:a(function(_,v){_=this.words=_||[],v!=r?this.sigBytes=v:this.sigBytes=_.length*4},"init"),toString:a(function(_){return(_||h).stringify(this)},"toString"),concat:a(function(_){var v=this.words,b=_.words,T=this.sigBytes,w=_.sigBytes;if(this.clamp(),T%4)for(var R=0;R>>2]>>>24-R%4*8&255;v[T+R>>>2]|=x<<24-(T+R)%4*8}else for(var P=0;P>>2]=b[P>>>2];return this.sigBytes+=w,this},"concat"),clamp:a(function(){var _=this.words,v=this.sigBytes;_[v>>>2]&=4294967295<<32-v%4*8,_.length=e.ceil(v/4)},"clamp"),clone:a(function(){var _=u.clone.call(this);return _.words=this.words.slice(0),_},"clone"),random:a(function(_){for(var v=[],b=0;b<_;b+=4)v.push(o());return new d.init(v,_)},"random")}),f=c.enc={},h=f.Hex={stringify:a(function(_){for(var v=_.words,b=_.sigBytes,T=[],w=0;w>>2]>>>24-w%4*8&255;T.push((R>>>4).toString(16)),T.push((R&15).toString(16))}return T.join("")},"stringify"),parse:a(function(_){for(var v=_.length,b=[],T=0;T>>3]|=parseInt(_.substr(T,2),16)<<24-T%8*4;return new d.init(b,v/2)},"parse")},m=f.Latin1={stringify:a(function(_){for(var v=_.words,b=_.sigBytes,T=[],w=0;w>>2]>>>24-w%4*8&255;T.push(String.fromCharCode(R))}return T.join("")},"stringify"),parse:a(function(_){for(var v=_.length,b=[],T=0;T>>2]|=(_.charCodeAt(T)&255)<<24-T%4*8;return new d.init(b,v)},"parse")},g=f.Utf8={stringify:a(function(_){try{return decodeURIComponent(escape(m.stringify(_)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:a(function(_){return m.parse(unescape(encodeURIComponent(_)))},"parse")},A=l.BufferedBlockAlgorithm=u.extend({reset:a(function(){this._data=new d.init,this._nDataBytes=0},"reset"),_append:a(function(_){typeof _=="string"&&(_=g.parse(_)),this._data.concat(_),this._nDataBytes+=_.sigBytes},"_append"),_process:a(function(_){var v,b=this._data,T=b.words,w=b.sigBytes,R=this.blockSize,x=R*4,P=w/x;_?P=e.ceil(P):P=e.max((P|0)-this._minBufferSize,0);var D=P*R,N=e.min(D*4,w);if(D){for(var L=0;L{p();(function(t,e){typeof Z6e=="object"?rHr.exports=Z6e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(Z6e,function(t){return(function(e){var r=t,n=r.lib,o=n.Base,s=n.WordArray,c=r.x64={},l=c.Word=o.extend({init:a(function(d,f){this.high=d,this.low=f},"init")}),u=c.WordArray=o.extend({init:a(function(d,f){d=this.words=d||[],f!=e?this.sigBytes=f:this.sigBytes=d.length*8},"init"),toX32:a(function(){for(var d=this.words,f=d.length,h=[],m=0;m{p();(function(t,e){typeof X6e=="object"?nHr.exports=X6e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(X6e,function(t){return(function(){if(typeof ArrayBuffer=="function"){var e=t,r=e.lib,n=r.WordArray,o=n.init,s=n.init=function(c){if(c instanceof ArrayBuffer&&(c=new Uint8Array(c)),(c instanceof Int8Array||typeof Uint8ClampedArray<"u"&&c instanceof Uint8ClampedArray||c instanceof Int16Array||c instanceof Uint16Array||c instanceof Int32Array||c instanceof Uint32Array||c instanceof Float32Array||c instanceof Float64Array)&&(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),c instanceof Uint8Array){for(var l=c.byteLength,u=[],d=0;d>>2]|=c[d]<<24-d%4*8;o.call(this,u,l)}else o.apply(this,arguments)};s.prototype=n}})(),t.lib.WordArray})});var sHr=I((e9e,oHr)=>{p();(function(t,e){typeof e9e=="object"?oHr.exports=e9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(e9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Utf16=o.Utf16BE={stringify:a(function(l){for(var u=l.words,d=l.sigBytes,f=[],h=0;h>>2]>>>16-h%4*8&65535;f.push(String.fromCharCode(m))}return f.join("")},"stringify"),parse:a(function(l){for(var u=l.length,d=[],f=0;f>>1]|=l.charCodeAt(f)<<16-f%2*16;return n.create(d,u*2)},"parse")};o.Utf16LE={stringify:a(function(l){for(var u=l.words,d=l.sigBytes,f=[],h=0;h>>2]>>>16-h%4*8&65535);f.push(String.fromCharCode(m))}return f.join("")},"stringify"),parse:a(function(l){for(var u=l.length,d=[],f=0;f>>1]|=c(l.charCodeAt(f)<<16-f%2*16);return n.create(d,u*2)},"parse")};function c(l){return l<<8&4278255360|l>>>8&16711935}a(c,"swapEndian")})(),t.enc.Utf16})});var lU=I((t9e,aHr)=>{p();(function(t,e){typeof t9e=="object"?aHr.exports=t9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(t9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Base64={stringify:a(function(l){var u=l.words,d=l.sigBytes,f=this._map;l.clamp();for(var h=[],m=0;m>>2]>>>24-m%4*8&255,A=u[m+1>>>2]>>>24-(m+1)%4*8&255,y=u[m+2>>>2]>>>24-(m+2)%4*8&255,E=g<<16|A<<8|y,_=0;_<4&&m+_*.75>>6*(3-_)&63));var v=f.charAt(64);if(v)for(;h.length%4;)h.push(v);return h.join("")},"stringify"),parse:a(function(l){var u=l.length,d=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var h=0;h>>6-m%4*2,y=g|A;f[h>>>2]|=y<<24-h%4*8,h++}return n.create(f,h)}a(c,"parseLoop")})(),t.enc.Base64})});var lHr=I((r9e,cHr)=>{p();(function(t,e){typeof r9e=="object"?cHr.exports=r9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(r9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Base64url={stringify:a(function(l,u){u===void 0&&(u=!0);var d=l.words,f=l.sigBytes,h=u?this._safe_map:this._map;l.clamp();for(var m=[],g=0;g>>2]>>>24-g%4*8&255,y=d[g+1>>>2]>>>24-(g+1)%4*8&255,E=d[g+2>>>2]>>>24-(g+2)%4*8&255,_=A<<16|y<<8|E,v=0;v<4&&g+v*.75>>6*(3-v)&63));var b=h.charAt(64);if(b)for(;m.length%4;)m.push(b);return m.join("")},"stringify"),parse:a(function(l,u){u===void 0&&(u=!0);var d=l.length,f=u?this._safe_map:this._map,h=this._reverseMap;if(!h){h=this._reverseMap=[];for(var m=0;m>>6-m%4*2,y=g|A;f[h>>>2]|=y<<24-h%4*8,h++}return n.create(f,h)}a(c,"parseLoop")})(),t.enc.Base64url})});var uU=I((n9e,uHr)=>{p();(function(t,e){typeof n9e=="object"?uHr.exports=n9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(n9e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=[];(function(){for(var g=0;g<64;g++)l[g]=e.abs(e.sin(g+1))*4294967296|0})();var u=c.MD5=s.extend({_doReset:a(function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},"_doReset"),_doProcessBlock:a(function(g,A){for(var y=0;y<16;y++){var E=A+y,_=g[E];g[E]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360}var v=this._hash.words,b=g[A+0],T=g[A+1],w=g[A+2],R=g[A+3],x=g[A+4],P=g[A+5],D=g[A+6],N=g[A+7],L=g[A+8],B=g[A+9],q=g[A+10],M=g[A+11],O=g[A+12],j=g[A+13],Q=g[A+14],U=g[A+15],Y=v[0],W=v[1],V=v[2],z=v[3];Y=d(Y,W,V,z,b,7,l[0]),z=d(z,Y,W,V,T,12,l[1]),V=d(V,z,Y,W,w,17,l[2]),W=d(W,V,z,Y,R,22,l[3]),Y=d(Y,W,V,z,x,7,l[4]),z=d(z,Y,W,V,P,12,l[5]),V=d(V,z,Y,W,D,17,l[6]),W=d(W,V,z,Y,N,22,l[7]),Y=d(Y,W,V,z,L,7,l[8]),z=d(z,Y,W,V,B,12,l[9]),V=d(V,z,Y,W,q,17,l[10]),W=d(W,V,z,Y,M,22,l[11]),Y=d(Y,W,V,z,O,7,l[12]),z=d(z,Y,W,V,j,12,l[13]),V=d(V,z,Y,W,Q,17,l[14]),W=d(W,V,z,Y,U,22,l[15]),Y=f(Y,W,V,z,T,5,l[16]),z=f(z,Y,W,V,D,9,l[17]),V=f(V,z,Y,W,M,14,l[18]),W=f(W,V,z,Y,b,20,l[19]),Y=f(Y,W,V,z,P,5,l[20]),z=f(z,Y,W,V,q,9,l[21]),V=f(V,z,Y,W,U,14,l[22]),W=f(W,V,z,Y,x,20,l[23]),Y=f(Y,W,V,z,B,5,l[24]),z=f(z,Y,W,V,Q,9,l[25]),V=f(V,z,Y,W,R,14,l[26]),W=f(W,V,z,Y,L,20,l[27]),Y=f(Y,W,V,z,j,5,l[28]),z=f(z,Y,W,V,w,9,l[29]),V=f(V,z,Y,W,N,14,l[30]),W=f(W,V,z,Y,O,20,l[31]),Y=h(Y,W,V,z,P,4,l[32]),z=h(z,Y,W,V,L,11,l[33]),V=h(V,z,Y,W,M,16,l[34]),W=h(W,V,z,Y,Q,23,l[35]),Y=h(Y,W,V,z,T,4,l[36]),z=h(z,Y,W,V,x,11,l[37]),V=h(V,z,Y,W,N,16,l[38]),W=h(W,V,z,Y,q,23,l[39]),Y=h(Y,W,V,z,j,4,l[40]),z=h(z,Y,W,V,b,11,l[41]),V=h(V,z,Y,W,R,16,l[42]),W=h(W,V,z,Y,D,23,l[43]),Y=h(Y,W,V,z,B,4,l[44]),z=h(z,Y,W,V,O,11,l[45]),V=h(V,z,Y,W,U,16,l[46]),W=h(W,V,z,Y,w,23,l[47]),Y=m(Y,W,V,z,b,6,l[48]),z=m(z,Y,W,V,N,10,l[49]),V=m(V,z,Y,W,Q,15,l[50]),W=m(W,V,z,Y,P,21,l[51]),Y=m(Y,W,V,z,O,6,l[52]),z=m(z,Y,W,V,R,10,l[53]),V=m(V,z,Y,W,q,15,l[54]),W=m(W,V,z,Y,T,21,l[55]),Y=m(Y,W,V,z,L,6,l[56]),z=m(z,Y,W,V,U,10,l[57]),V=m(V,z,Y,W,D,15,l[58]),W=m(W,V,z,Y,j,21,l[59]),Y=m(Y,W,V,z,x,6,l[60]),z=m(z,Y,W,V,M,10,l[61]),V=m(V,z,Y,W,w,15,l[62]),W=m(W,V,z,Y,B,21,l[63]),v[0]=v[0]+Y|0,v[1]=v[1]+W|0,v[2]=v[2]+V|0,v[3]=v[3]+z|0},"_doProcessBlock"),_doFinalize:a(function(){var g=this._data,A=g.words,y=this._nDataBytes*8,E=g.sigBytes*8;A[E>>>5]|=128<<24-E%32;var _=e.floor(y/4294967296),v=y;A[(E+64>>>9<<4)+15]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,A[(E+64>>>9<<4)+14]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,g.sigBytes=(A.length+1)*4,this._process();for(var b=this._hash,T=b.words,w=0;w<4;w++){var R=T[w];T[w]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360}return b},"_doFinalize"),clone:a(function(){var g=s.clone.call(this);return g._hash=this._hash.clone(),g},"clone")});function d(g,A,y,E,_,v,b){var T=g+(A&y|~A&E)+_+b;return(T<>>32-v)+A}a(d,"FF");function f(g,A,y,E,_,v,b){var T=g+(A&E|y&~E)+_+b;return(T<>>32-v)+A}a(f,"GG");function h(g,A,y,E,_,v,b){var T=g+(A^y^E)+_+b;return(T<>>32-v)+A}a(h,"HH");function m(g,A,y,E,_,v,b){var T=g+(y^(A|~E))+_+b;return(T<>>32-v)+A}a(m,"II"),r.MD5=s._createHelper(u),r.HmacMD5=s._createHmacHelper(u)})(Math),t.MD5})});var sPt=I((i9e,dHr)=>{p();(function(t,e){typeof i9e=="object"?dHr.exports=i9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(i9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=r.Hasher,s=e.algo,c=[],l=s.SHA1=o.extend({_doReset:a(function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:a(function(u,d){for(var f=this._hash.words,h=f[0],m=f[1],g=f[2],A=f[3],y=f[4],E=0;E<80;E++){if(E<16)c[E]=u[d+E]|0;else{var _=c[E-3]^c[E-8]^c[E-14]^c[E-16];c[E]=_<<1|_>>>31}var v=(h<<5|h>>>27)+y+c[E];E<20?v+=(m&g|~m&A)+1518500249:E<40?v+=(m^g^A)+1859775393:E<60?v+=(m&g|m&A|g&A)-1894007588:v+=(m^g^A)-899497514,y=A,A=g,g=m<<30|m>>>2,m=h,h=v}f[0]=f[0]+h|0,f[1]=f[1]+m|0,f[2]=f[2]+g|0,f[3]=f[3]+A|0,f[4]=f[4]+y|0},"_doProcessBlock"),_doFinalize:a(function(){var u=this._data,d=u.words,f=this._nDataBytes*8,h=u.sigBytes*8;return d[h>>>5]|=128<<24-h%32,d[(h+64>>>9<<4)+14]=Math.floor(f/4294967296),d[(h+64>>>9<<4)+15]=f,u.sigBytes=d.length*4,this._process(),this._hash},"_doFinalize"),clone:a(function(){var u=o.clone.call(this);return u._hash=this._hash.clone(),u},"clone")});e.SHA1=o._createHelper(l),e.HmacSHA1=o._createHmacHelper(l)})(),t.SHA1})});var s9e=I((o9e,fHr)=>{p();(function(t,e){typeof o9e=="object"?fHr.exports=o9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(o9e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=[],u=[];(function(){function h(y){for(var E=e.sqrt(y),_=2;_<=E;_++)if(!(y%_))return!1;return!0}a(h,"isPrime");function m(y){return(y-(y|0))*4294967296|0}a(m,"getFractionalBits");for(var g=2,A=0;A<64;)h(g)&&(A<8&&(l[A]=m(e.pow(g,1/2))),u[A]=m(e.pow(g,1/3)),A++),g++})();var d=[],f=c.SHA256=s.extend({_doReset:a(function(){this._hash=new o.init(l.slice(0))},"_doReset"),_doProcessBlock:a(function(h,m){for(var g=this._hash.words,A=g[0],y=g[1],E=g[2],_=g[3],v=g[4],b=g[5],T=g[6],w=g[7],R=0;R<64;R++){if(R<16)d[R]=h[m+R]|0;else{var x=d[R-15],P=(x<<25|x>>>7)^(x<<14|x>>>18)^x>>>3,D=d[R-2],N=(D<<15|D>>>17)^(D<<13|D>>>19)^D>>>10;d[R]=P+d[R-7]+N+d[R-16]}var L=v&b^~v&T,B=A&y^A&E^y&E,q=(A<<30|A>>>2)^(A<<19|A>>>13)^(A<<10|A>>>22),M=(v<<26|v>>>6)^(v<<21|v>>>11)^(v<<7|v>>>25),O=w+M+L+u[R]+d[R],j=q+B;w=T,T=b,b=v,v=_+O|0,_=E,E=y,y=A,A=O+j|0}g[0]=g[0]+A|0,g[1]=g[1]+y|0,g[2]=g[2]+E|0,g[3]=g[3]+_|0,g[4]=g[4]+v|0,g[5]=g[5]+b|0,g[6]=g[6]+T|0,g[7]=g[7]+w|0},"_doProcessBlock"),_doFinalize:a(function(){var h=this._data,m=h.words,g=this._nDataBytes*8,A=h.sigBytes*8;return m[A>>>5]|=128<<24-A%32,m[(A+64>>>9<<4)+14]=e.floor(g/4294967296),m[(A+64>>>9<<4)+15]=g,h.sigBytes=m.length*4,this._process(),this._hash},"_doFinalize"),clone:a(function(){var h=s.clone.call(this);return h._hash=this._hash.clone(),h},"clone")});r.SHA256=s._createHelper(f),r.HmacSHA256=s._createHmacHelper(f)})(Math),t.SHA256})});var hHr=I((a9e,pHr)=>{p();(function(t,e,r){typeof a9e=="object"?pHr.exports=a9e=e(sa(),s9e()):typeof define=="function"&&define.amd?define(["./core","./sha256"],e):e(t.CryptoJS)})(a9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.algo,s=o.SHA256,c=o.SHA224=s.extend({_doReset:a(function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},"_doReset"),_doFinalize:a(function(){var l=s._doFinalize.call(this);return l.sigBytes-=4,l},"_doFinalize")});e.SHA224=s._createHelper(c),e.HmacSHA224=s._createHmacHelper(c)})(),t.SHA224})});var aPt=I((c9e,mHr)=>{p();(function(t,e,r){typeof c9e=="object"?mHr.exports=c9e=e(sa(),wCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(c9e,function(t){return(function(){var e=t,r=e.lib,n=r.Hasher,o=e.x64,s=o.Word,c=o.WordArray,l=e.algo;function u(){return s.create.apply(s,arguments)}a(u,"X64Word_create");var d=[u(1116352408,3609767458),u(1899447441,602891725),u(3049323471,3964484399),u(3921009573,2173295548),u(961987163,4081628472),u(1508970993,3053834265),u(2453635748,2937671579),u(2870763221,3664609560),u(3624381080,2734883394),u(310598401,1164996542),u(607225278,1323610764),u(1426881987,3590304994),u(1925078388,4068182383),u(2162078206,991336113),u(2614888103,633803317),u(3248222580,3479774868),u(3835390401,2666613458),u(4022224774,944711139),u(264347078,2341262773),u(604807628,2007800933),u(770255983,1495990901),u(1249150122,1856431235),u(1555081692,3175218132),u(1996064986,2198950837),u(2554220882,3999719339),u(2821834349,766784016),u(2952996808,2566594879),u(3210313671,3203337956),u(3336571891,1034457026),u(3584528711,2466948901),u(113926993,3758326383),u(338241895,168717936),u(666307205,1188179964),u(773529912,1546045734),u(1294757372,1522805485),u(1396182291,2643833823),u(1695183700,2343527390),u(1986661051,1014477480),u(2177026350,1206759142),u(2456956037,344077627),u(2730485921,1290863460),u(2820302411,3158454273),u(3259730800,3505952657),u(3345764771,106217008),u(3516065817,3606008344),u(3600352804,1432725776),u(4094571909,1467031594),u(275423344,851169720),u(430227734,3100823752),u(506948616,1363258195),u(659060556,3750685593),u(883997877,3785050280),u(958139571,3318307427),u(1322822218,3812723403),u(1537002063,2003034995),u(1747873779,3602036899),u(1955562222,1575990012),u(2024104815,1125592928),u(2227730452,2716904306),u(2361852424,442776044),u(2428436474,593698344),u(2756734187,3733110249),u(3204031479,2999351573),u(3329325298,3815920427),u(3391569614,3928383900),u(3515267271,566280711),u(3940187606,3454069534),u(4118630271,4000239992),u(116418474,1914138554),u(174292421,2731055270),u(289380356,3203993006),u(460393269,320620315),u(685471733,587496836),u(852142971,1086792851),u(1017036298,365543100),u(1126000580,2618297676),u(1288033470,3409855158),u(1501505948,4234509866),u(1607167915,987167468),u(1816402316,1246189591)],f=[];(function(){for(var m=0;m<80;m++)f[m]=u()})();var h=l.SHA512=n.extend({_doReset:a(function(){this._hash=new c.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},"_doReset"),_doProcessBlock:a(function(m,g){for(var A=this._hash.words,y=A[0],E=A[1],_=A[2],v=A[3],b=A[4],T=A[5],w=A[6],R=A[7],x=y.high,P=y.low,D=E.high,N=E.low,L=_.high,B=_.low,q=v.high,M=v.low,O=b.high,j=b.low,Q=T.high,U=T.low,Y=w.high,W=w.low,V=R.high,z=R.low,ie=x,H=P,re=D,le=N,Le=L,ge=B,Ue=q,ke=M,X=O,ee=j,K=Q,he=U,Z=Y,ue=W,qe=V,ne=z,ce=0;ce<80;ce++){var Ne,we,Be=f[ce];if(ce<16)we=Be.high=m[g+ce*2]|0,Ne=Be.low=m[g+ce*2+1]|0;else{var rt=f[ce-15],st=rt.high,_t=rt.low,Dt=(st>>>1|_t<<31)^(st>>>8|_t<<24)^st>>>7,$t=(_t>>>1|st<<31)^(_t>>>8|st<<24)^(_t>>>7|st<<25),Gt=f[ce-2],Ie=Gt.high,F=Gt.low,be=(Ie>>>19|F<<13)^(Ie<<3|F>>>29)^Ie>>>6,Qe=(F>>>19|Ie<<13)^(F<<3|Ie>>>29)^(F>>>6|Ie<<26),pe=f[ce-7],Se=pe.high,Fe=pe.low,te=f[ce-16],Te=te.high,Ge=te.low;Ne=$t+Fe,we=Dt+Se+(Ne>>>0<$t>>>0?1:0),Ne=Ne+Qe,we=we+be+(Ne>>>0>>0?1:0),Ne=Ne+Ge,we=we+Te+(Ne>>>0>>0?1:0),Be.high=we,Be.low=Ne}var J=X&K^~X&Z,se=ee&he^~ee&ue,me=ie&re^ie&Le^re&Le,Ce=H&le^H&ge^le&ge,He=(ie>>>28|H<<4)^(ie<<30|H>>>2)^(ie<<25|H>>>7),$e=(H>>>28|ie<<4)^(H<<30|ie>>>2)^(H<<25|ie>>>7),et=(X>>>14|ee<<18)^(X>>>18|ee<<14)^(X<<23|ee>>>9),ct=(ee>>>14|X<<18)^(ee>>>18|X<<14)^(ee<<23|X>>>9),bt=d[ce],ht=bt.high,We=bt.low,ae=ne+ct,Re=qe+et+(ae>>>0>>0?1:0),ae=ae+se,Re=Re+J+(ae>>>0>>0?1:0),ae=ae+We,Re=Re+ht+(ae>>>0>>0?1:0),ae=ae+Ne,Re=Re+we+(ae>>>0>>0?1:0),Me=$e+Ce,ye=He+me+(Me>>>0<$e>>>0?1:0);qe=Z,ne=ue,Z=K,ue=he,K=X,he=ee,ee=ke+ae|0,X=Ue+Re+(ee>>>0>>0?1:0)|0,Ue=Le,ke=ge,Le=re,ge=le,re=ie,le=H,H=ae+Me|0,ie=Re+ye+(H>>>0>>0?1:0)|0}P=y.low=P+H,y.high=x+ie+(P>>>0>>0?1:0),N=E.low=N+le,E.high=D+re+(N>>>0>>0?1:0),B=_.low=B+ge,_.high=L+Le+(B>>>0>>0?1:0),M=v.low=M+ke,v.high=q+Ue+(M>>>0>>0?1:0),j=b.low=j+ee,b.high=O+X+(j>>>0>>0?1:0),U=T.low=U+he,T.high=Q+K+(U>>>0>>0?1:0),W=w.low=W+ue,w.high=Y+Z+(W>>>0>>0?1:0),z=R.low=z+ne,R.high=V+qe+(z>>>0>>0?1:0)},"_doProcessBlock"),_doFinalize:a(function(){var m=this._data,g=m.words,A=this._nDataBytes*8,y=m.sigBytes*8;g[y>>>5]|=128<<24-y%32,g[(y+128>>>10<<5)+30]=Math.floor(A/4294967296),g[(y+128>>>10<<5)+31]=A,m.sigBytes=g.length*4,this._process();var E=this._hash.toX32();return E},"_doFinalize"),clone:a(function(){var m=n.clone.call(this);return m._hash=this._hash.clone(),m},"clone"),blockSize:1024/32});e.SHA512=n._createHelper(h),e.HmacSHA512=n._createHmacHelper(h)})(),t.SHA512})});var AHr=I((l9e,gHr)=>{p();(function(t,e,r){typeof l9e=="object"?gHr.exports=l9e=e(sa(),wCe(),aPt()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],e):e(t.CryptoJS)})(l9e,function(t){return(function(){var e=t,r=e.x64,n=r.Word,o=r.WordArray,s=e.algo,c=s.SHA512,l=s.SHA384=c.extend({_doReset:a(function(){this._hash=new o.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},"_doReset"),_doFinalize:a(function(){var u=c._doFinalize.call(this);return u.sigBytes-=16,u},"_doFinalize")});e.SHA384=c._createHelper(l),e.HmacSHA384=c._createHmacHelper(l)})(),t.SHA384})});var EHr=I((u9e,yHr)=>{p();(function(t,e,r){typeof u9e=="object"?yHr.exports=u9e=e(sa(),wCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(u9e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.x64,l=c.Word,u=r.algo,d=[],f=[],h=[];(function(){for(var A=1,y=0,E=0;E<24;E++){d[A+5*y]=(E+1)*(E+2)/2%64;var _=y%5,v=(2*A+3*y)%5;A=_,y=v}for(var A=0;A<5;A++)for(var y=0;y<5;y++)f[A+5*y]=y+(2*A+3*y)%5*5;for(var b=1,T=0;T<24;T++){for(var w=0,R=0,x=0;x<7;x++){if(b&1){var P=(1<>>24)&16711935|(b<<24|b>>>8)&4278255360,T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360;var w=E[v];w.high^=T,w.low^=b}for(var R=0;R<24;R++){for(var x=0;x<5;x++){for(var P=0,D=0,N=0;N<5;N++){var w=E[x+5*N];P^=w.high,D^=w.low}var L=m[x];L.high=P,L.low=D}for(var x=0;x<5;x++)for(var B=m[(x+4)%5],q=m[(x+1)%5],M=q.high,O=q.low,P=B.high^(M<<1|O>>>31),D=B.low^(O<<1|M>>>31),N=0;N<5;N++){var w=E[x+5*N];w.high^=P,w.low^=D}for(var j=1;j<25;j++){var P,D,w=E[j],Q=w.high,U=w.low,Y=d[j];Y<32?(P=Q<>>32-Y,D=U<>>32-Y):(P=U<>>64-Y,D=Q<>>64-Y);var W=m[f[j]];W.high=P,W.low=D}var V=m[0],z=E[0];V.high=z.high,V.low=z.low;for(var x=0;x<5;x++)for(var N=0;N<5;N++){var j=x+5*N,w=E[j],ie=m[j],H=m[(x+1)%5+5*N],re=m[(x+2)%5+5*N];w.high=ie.high^~H.high&re.high,w.low=ie.low^~H.low&re.low}var w=E[0],le=h[R];w.high^=le.high,w.low^=le.low}},"_doProcessBlock"),_doFinalize:a(function(){var A=this._data,y=A.words,E=this._nDataBytes*8,_=A.sigBytes*8,v=this.blockSize*32;y[_>>>5]|=1<<24-_%32,y[(e.ceil((_+1)/v)*v>>>5)-1]|=128,A.sigBytes=y.length*4,this._process();for(var b=this._state,T=this.cfg.outputLength/8,w=T/8,R=[],x=0;x>>24)&16711935|(D<<24|D>>>8)&4278255360,N=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,R.push(N),R.push(D)}return new o.init(R,T)},"_doFinalize"),clone:a(function(){for(var A=s.clone.call(this),y=A._state=this._state.slice(0),E=0;E<25;E++)y[E]=y[E].clone();return A},"clone")});r.SHA3=s._createHelper(g),r.HmacSHA3=s._createHmacHelper(g)})(Math),t.SHA3})});var vHr=I((d9e,_Hr)=>{p();(function(t,e){typeof d9e=="object"?_Hr.exports=d9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(d9e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),d=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=o.create([0,1518500249,1859775393,2400959708,2840853838]),m=o.create([1352829926,1548603684,1836072691,2053994217,0]),g=c.RIPEMD160=s.extend({_doReset:a(function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:a(function(T,w){for(var R=0;R<16;R++){var x=w+R,P=T[x];T[x]=(P<<8|P>>>24)&16711935|(P<<24|P>>>8)&4278255360}var D=this._hash.words,N=h.words,L=m.words,B=l.words,q=u.words,M=d.words,O=f.words,j,Q,U,Y,W,V,z,ie,H,re;V=j=D[0],z=Q=D[1],ie=U=D[2],H=Y=D[3],re=W=D[4];for(var le,R=0;R<80;R+=1)le=j+T[w+B[R]]|0,R<16?le+=A(Q,U,Y)+N[0]:R<32?le+=y(Q,U,Y)+N[1]:R<48?le+=E(Q,U,Y)+N[2]:R<64?le+=_(Q,U,Y)+N[3]:le+=v(Q,U,Y)+N[4],le=le|0,le=b(le,M[R]),le=le+W|0,j=W,W=Y,Y=b(U,10),U=Q,Q=le,le=V+T[w+q[R]]|0,R<16?le+=v(z,ie,H)+L[0]:R<32?le+=_(z,ie,H)+L[1]:R<48?le+=E(z,ie,H)+L[2]:R<64?le+=y(z,ie,H)+L[3]:le+=A(z,ie,H)+L[4],le=le|0,le=b(le,O[R]),le=le+re|0,V=re,re=H,H=b(ie,10),ie=z,z=le;le=D[1]+U+H|0,D[1]=D[2]+Y+re|0,D[2]=D[3]+W+V|0,D[3]=D[4]+j+z|0,D[4]=D[0]+Q+ie|0,D[0]=le},"_doProcessBlock"),_doFinalize:a(function(){var T=this._data,w=T.words,R=this._nDataBytes*8,x=T.sigBytes*8;w[x>>>5]|=128<<24-x%32,w[(x+64>>>9<<4)+14]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,T.sigBytes=(w.length+1)*4,this._process();for(var P=this._hash,D=P.words,N=0;N<5;N++){var L=D[N];D[N]=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360}return P},"_doFinalize"),clone:a(function(){var T=s.clone.call(this);return T._hash=this._hash.clone(),T},"clone")});function A(T,w,R){return T^w^R}a(A,"f1");function y(T,w,R){return T&w|~T&R}a(y,"f2");function E(T,w,R){return(T|~w)^R}a(E,"f3");function _(T,w,R){return T&R|w&~R}a(_,"f4");function v(T,w,R){return T^(w|~R)}a(v,"f5");function b(T,w){return T<>>32-w}a(b,"rotl"),r.RIPEMD160=s._createHelper(g),r.HmacRIPEMD160=s._createHmacHelper(g)})(Math),t.RIPEMD160})});var p9e=I((f9e,CHr)=>{p();(function(t,e){typeof f9e=="object"?CHr.exports=f9e=e(sa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(f9e,function(t){(function(){var e=t,r=e.lib,n=r.Base,o=e.enc,s=o.Utf8,c=e.algo,l=c.HMAC=n.extend({init:a(function(u,d){u=this._hasher=new u.init,typeof d=="string"&&(d=s.parse(d));var f=u.blockSize,h=f*4;d.sigBytes>h&&(d=u.finalize(d)),d.clamp();for(var m=this._oKey=d.clone(),g=this._iKey=d.clone(),A=m.words,y=g.words,E=0;E{p();(function(t,e,r){typeof h9e=="object"?bHr.exports=h9e=e(sa(),s9e(),p9e()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],e):e(t.CryptoJS)})(h9e,function(t){return(function(){var e=t,r=e.lib,n=r.Base,o=r.WordArray,s=e.algo,c=s.SHA256,l=s.HMAC,u=s.PBKDF2=n.extend({cfg:n.extend({keySize:128/32,hasher:c,iterations:25e4}),init:a(function(d){this.cfg=this.cfg.extend(d)},"init"),compute:a(function(d,f){for(var h=this.cfg,m=l.create(h.hasher,d),g=o.create(),A=o.create([1]),y=g.words,E=A.words,_=h.keySize,v=h.iterations;y.length<_;){var b=m.update(f).finalize(A);m.reset();for(var T=b.words,w=T.length,R=b,x=1;x{p();(function(t,e,r){typeof m9e=="object"?THr.exports=m9e=e(sa(),sPt(),p9e()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],e):e(t.CryptoJS)})(m9e,function(t){return(function(){var e=t,r=e.lib,n=r.Base,o=r.WordArray,s=e.algo,c=s.MD5,l=s.EvpKDF=n.extend({cfg:n.extend({keySize:128/32,hasher:c,iterations:1}),init:a(function(u){this.cfg=this.cfg.extend(u)},"init"),compute:a(function(u,d){for(var f,h=this.cfg,m=h.hasher.create(),g=o.create(),A=g.words,y=h.keySize,E=h.iterations;A.length{p();(function(t,e,r){typeof g9e=="object"?IHr.exports=g9e=e(sa(),oB()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],e):e(t.CryptoJS)})(g9e,function(t){t.lib.Cipher||(function(e){var r=t,n=r.lib,o=n.Base,s=n.WordArray,c=n.BufferedBlockAlgorithm,l=r.enc,u=l.Utf8,d=l.Base64,f=r.algo,h=f.EvpKDF,m=n.Cipher=c.extend({cfg:o.extend(),createEncryptor:a(function(L,B){return this.create(this._ENC_XFORM_MODE,L,B)},"createEncryptor"),createDecryptor:a(function(L,B){return this.create(this._DEC_XFORM_MODE,L,B)},"createDecryptor"),init:a(function(L,B,q){this.cfg=this.cfg.extend(q),this._xformMode=L,this._key=B,this.reset()},"init"),reset:a(function(){c.reset.call(this),this._doReset()},"reset"),process:a(function(L){return this._append(L),this._process()},"process"),finalize:a(function(L){L&&this._append(L);var B=this._doFinalize();return B},"finalize"),keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function L(B){return typeof B=="string"?N:x}return a(L,"selectCipherStrategy"),function(B){return{encrypt:a(function(q,M,O){return L(M).encrypt(B,q,M,O)},"encrypt"),decrypt:a(function(q,M,O){return L(M).decrypt(B,q,M,O)},"decrypt")}}})()}),g=n.StreamCipher=m.extend({_doFinalize:a(function(){var L=this._process(!0);return L},"_doFinalize"),blockSize:1}),A=r.mode={},y=n.BlockCipherMode=o.extend({createEncryptor:a(function(L,B){return this.Encryptor.create(L,B)},"createEncryptor"),createDecryptor:a(function(L,B){return this.Decryptor.create(L,B)},"createDecryptor"),init:a(function(L,B){this._cipher=L,this._iv=B},"init")}),E=A.CBC=(function(){var L=y.extend();L.Encryptor=L.extend({processBlock:a(function(q,M){var O=this._cipher,j=O.blockSize;B.call(this,q,M,j),O.encryptBlock(q,M),this._prevBlock=q.slice(M,M+j)},"processBlock")}),L.Decryptor=L.extend({processBlock:a(function(q,M){var O=this._cipher,j=O.blockSize,Q=q.slice(M,M+j);O.decryptBlock(q,M),B.call(this,q,M,j),this._prevBlock=Q},"processBlock")});function B(q,M,O){var j,Q=this._iv;Q?(j=Q,this._iv=e):j=this._prevBlock;for(var U=0;U>>2]&255;L.sigBytes-=B},"unpad")},b=n.BlockCipher=m.extend({cfg:m.cfg.extend({mode:E,padding:v}),reset:a(function(){var L;m.reset.call(this);var B=this.cfg,q=B.iv,M=B.mode;this._xformMode==this._ENC_XFORM_MODE?L=M.createEncryptor:(L=M.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==L?this._mode.init(this,q&&q.words):(this._mode=L.call(M,this,q&&q.words),this._mode.__creator=L)},"reset"),_doProcessBlock:a(function(L,B){this._mode.processBlock(L,B)},"_doProcessBlock"),_doFinalize:a(function(){var L,B=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(B.pad(this._data,this.blockSize),L=this._process(!0)):(L=this._process(!0),B.unpad(L)),L},"_doFinalize"),blockSize:128/32}),T=n.CipherParams=o.extend({init:a(function(L){this.mixIn(L)},"init"),toString:a(function(L){return(L||this.formatter).stringify(this)},"toString")}),w=r.format={},R=w.OpenSSL={stringify:a(function(L){var B,q=L.ciphertext,M=L.salt;return M?B=s.create([1398893684,1701076831]).concat(M).concat(q):B=q,B.toString(d)},"stringify"),parse:a(function(L){var B,q=d.parse(L),M=q.words;return M[0]==1398893684&&M[1]==1701076831&&(B=s.create(M.slice(2,4)),M.splice(0,4),q.sigBytes-=16),T.create({ciphertext:q,salt:B})},"parse")},x=n.SerializableCipher=o.extend({cfg:o.extend({format:R}),encrypt:a(function(L,B,q,M){M=this.cfg.extend(M);var O=L.createEncryptor(q,M),j=O.finalize(B),Q=O.cfg;return T.create({ciphertext:j,key:q,iv:Q.iv,algorithm:L,mode:Q.mode,padding:Q.padding,blockSize:L.blockSize,formatter:M.format})},"encrypt"),decrypt:a(function(L,B,q,M){M=this.cfg.extend(M),B=this._parse(B,M.format);var O=L.createDecryptor(q,M).finalize(B.ciphertext);return O},"decrypt"),_parse:a(function(L,B){return typeof L=="string"?B.parse(L,this):L},"_parse")}),P=r.kdf={},D=P.OpenSSL={execute:a(function(L,B,q,M,O){if(M||(M=s.random(64/8)),O)var j=h.create({keySize:B+q,hasher:O}).compute(L,M);else var j=h.create({keySize:B+q}).compute(L,M);var Q=s.create(j.words.slice(B),q*4);return j.sigBytes=B*4,T.create({key:j,iv:Q,salt:M})},"execute")},N=n.PasswordBasedCipher=x.extend({cfg:x.cfg.extend({kdf:D}),encrypt:a(function(L,B,q,M){M=this.cfg.extend(M);var O=M.kdf.execute(q,L.keySize,L.ivSize,M.salt,M.hasher);M.iv=O.iv;var j=x.encrypt.call(this,L,B,O.key,M);return j.mixIn(O),j},"encrypt"),decrypt:a(function(L,B,q,M){M=this.cfg.extend(M),B=this._parse(B,M.format);var O=M.kdf.execute(q,L.keySize,L.ivSize,B.salt,M.hasher);M.iv=O.iv;var j=x.decrypt.call(this,L,B,O.key,M);return j},"decrypt")})})()})});var wHr=I((A9e,xHr)=>{p();(function(t,e,r){typeof A9e=="object"?xHr.exports=A9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(A9e,function(t){return t.mode.CFB=(function(){var e=t.lib.BlockCipherMode.extend();e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize;r.call(this,n,o,c,s),this._prevBlock=n.slice(o,o+c)},"processBlock")}),e.Decryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=n.slice(o,o+c);r.call(this,n,o,c,s),this._prevBlock=l},"processBlock")});function r(n,o,s,c){var l,u=this._iv;u?(l=u.slice(0),this._iv=void 0):l=this._prevBlock,c.encryptBlock(l,0);for(var d=0;d{p();(function(t,e,r){typeof y9e=="object"?RHr.exports=y9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(y9e,function(t){return t.mode.CTR=(function(){var e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=this._iv,u=this._counter;l&&(u=this._counter=l.slice(0),this._iv=void 0);var d=u.slice(0);s.encryptBlock(d,0),u[c-1]=u[c-1]+1|0;for(var f=0;f{p();(function(t,e,r){typeof E9e=="object"?PHr.exports=E9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(E9e,function(t){return t.mode.CTRGladman=(function(){var e=t.lib.BlockCipherMode.extend();function r(s){if((s>>24&255)===255){var c=s>>16&255,l=s>>8&255,u=s&255;c===255?(c=0,l===255?(l=0,u===255?u=0:++u):++l):++c,s=0,s+=c<<16,s+=l<<8,s+=u}else s+=1<<24;return s}a(r,"incWord");function n(s){return(s[0]=r(s[0]))===0&&(s[1]=r(s[1])),s}a(n,"incCounter");var o=e.Encryptor=e.extend({processBlock:a(function(s,c){var l=this._cipher,u=l.blockSize,d=this._iv,f=this._counter;d&&(f=this._counter=d.slice(0),this._iv=void 0),n(f);var h=f.slice(0);l.encryptBlock(h,0);for(var m=0;m{p();(function(t,e,r){typeof _9e=="object"?NHr.exports=_9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(_9e,function(t){return t.mode.OFB=(function(){var e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=this._iv,u=this._keystream;l&&(u=this._keystream=l.slice(0),this._iv=void 0),s.encryptBlock(u,0);for(var d=0;d{p();(function(t,e,r){typeof v9e=="object"?OHr.exports=v9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(v9e,function(t){return t.mode.ECB=(function(){var e=t.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:a(function(r,n){this._cipher.encryptBlock(r,n)},"processBlock")}),e.Decryptor=e.extend({processBlock:a(function(r,n){this._cipher.decryptBlock(r,n)},"processBlock")}),e})(),t.mode.ECB})});var FHr=I((C9e,BHr)=>{p();(function(t,e,r){typeof C9e=="object"?BHr.exports=C9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(C9e,function(t){return t.pad.AnsiX923={pad:a(function(e,r){var n=e.sigBytes,o=r*4,s=o-n%o,c=n+s-1;e.clamp(),e.words[c>>>2]|=s<<24-c%4*8,e.sigBytes+=s},"pad"),unpad:a(function(e){var r=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=r},"unpad")},t.pad.Ansix923})});var QHr=I((b9e,UHr)=>{p();(function(t,e,r){typeof b9e=="object"?UHr.exports=b9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(b9e,function(t){return t.pad.Iso10126={pad:a(function(e,r){var n=r*4,o=n-e.sigBytes%n;e.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},"pad"),unpad:a(function(e){var r=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=r},"unpad")},t.pad.Iso10126})});var jHr=I((S9e,qHr)=>{p();(function(t,e,r){typeof S9e=="object"?qHr.exports=S9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(S9e,function(t){return t.pad.Iso97971={pad:a(function(e,r){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,r)},"pad"),unpad:a(function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--},"unpad")},t.pad.Iso97971})});var GHr=I((T9e,HHr)=>{p();(function(t,e,r){typeof T9e=="object"?HHr.exports=T9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(T9e,function(t){return t.pad.ZeroPadding={pad:a(function(e,r){var n=r*4;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},"pad"),unpad:a(function(e){for(var r=e.words,n=e.sigBytes-1,n=e.sigBytes-1;n>=0;n--)if(r[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}},"unpad")},t.pad.ZeroPadding})});var VHr=I((I9e,$Hr)=>{p();(function(t,e,r){typeof I9e=="object"?$Hr.exports=I9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(I9e,function(t){return t.pad.NoPadding={pad:a(function(){},"pad"),unpad:a(function(){},"unpad")},t.pad.NoPadding})});var zHr=I((x9e,WHr)=>{p();(function(t,e,r){typeof x9e=="object"?WHr.exports=x9e=e(sa(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(x9e,function(t){return(function(e){var r=t,n=r.lib,o=n.CipherParams,s=r.enc,c=s.Hex,l=r.format,u=l.Hex={stringify:a(function(d){return d.ciphertext.toString(c)},"stringify"),parse:a(function(d){var f=c.parse(d);return o.create({ciphertext:f})},"parse")}})(),t.format.Hex})});var KHr=I((w9e,YHr)=>{p();(function(t,e,r){typeof w9e=="object"?YHr.exports=w9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(w9e,function(t){return(function(){var e=t,r=e.lib,n=r.BlockCipher,o=e.algo,s=[],c=[],l=[],u=[],d=[],f=[],h=[],m=[],g=[],A=[];(function(){for(var _=[],v=0;v<256;v++)v<128?_[v]=v<<1:_[v]=v<<1^283;for(var b=0,T=0,v=0;v<256;v++){var w=T^T<<1^T<<2^T<<3^T<<4;w=w>>>8^w&255^99,s[b]=w,c[w]=b;var R=_[b],x=_[R],P=_[x],D=_[w]*257^w*16843008;l[b]=D<<24|D>>>8,u[b]=D<<16|D>>>16,d[b]=D<<8|D>>>24,f[b]=D;var D=P*16843009^x*65537^R*257^b*16843008;h[w]=D<<24|D>>>8,m[w]=D<<16|D>>>16,g[w]=D<<8|D>>>24,A[w]=D,b?(b=R^_[_[_[P^R]]],T^=_[_[T]]):b=T=1}})();var y=[0,1,2,4,8,16,32,64,128,27,54],E=o.AES=n.extend({_doReset:a(function(){var _;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var v=this._keyPriorReset=this._key,b=v.words,T=v.sigBytes/4,w=this._nRounds=T+6,R=(w+1)*4,x=this._keySchedule=[],P=0;P6&&P%T==4&&(_=s[_>>>24]<<24|s[_>>>16&255]<<16|s[_>>>8&255]<<8|s[_&255]):(_=_<<8|_>>>24,_=s[_>>>24]<<24|s[_>>>16&255]<<16|s[_>>>8&255]<<8|s[_&255],_^=y[P/T|0]<<24),x[P]=x[P-T]^_);for(var D=this._invKeySchedule=[],N=0;N>>24]]^m[s[_>>>16&255]]^g[s[_>>>8&255]]^A[s[_&255]]}}},"_doReset"),encryptBlock:a(function(_,v){this._doCryptBlock(_,v,this._keySchedule,l,u,d,f,s)},"encryptBlock"),decryptBlock:a(function(_,v){var b=_[v+1];_[v+1]=_[v+3],_[v+3]=b,this._doCryptBlock(_,v,this._invKeySchedule,h,m,g,A,c);var b=_[v+1];_[v+1]=_[v+3],_[v+3]=b},"decryptBlock"),_doCryptBlock:a(function(_,v,b,T,w,R,x,P){for(var D=this._nRounds,N=_[v]^b[0],L=_[v+1]^b[1],B=_[v+2]^b[2],q=_[v+3]^b[3],M=4,O=1;O>>24]^w[L>>>16&255]^R[B>>>8&255]^x[q&255]^b[M++],Q=T[L>>>24]^w[B>>>16&255]^R[q>>>8&255]^x[N&255]^b[M++],U=T[B>>>24]^w[q>>>16&255]^R[N>>>8&255]^x[L&255]^b[M++],Y=T[q>>>24]^w[N>>>16&255]^R[L>>>8&255]^x[B&255]^b[M++];N=j,L=Q,B=U,q=Y}var j=(P[N>>>24]<<24|P[L>>>16&255]<<16|P[B>>>8&255]<<8|P[q&255])^b[M++],Q=(P[L>>>24]<<24|P[B>>>16&255]<<16|P[q>>>8&255]<<8|P[N&255])^b[M++],U=(P[B>>>24]<<24|P[q>>>16&255]<<16|P[N>>>8&255]<<8|P[L&255])^b[M++],Y=(P[q>>>24]<<24|P[N>>>16&255]<<16|P[L>>>8&255]<<8|P[B&255])^b[M++];_[v]=j,_[v+1]=Q,_[v+2]=U,_[v+3]=Y},"_doCryptBlock"),keySize:256/32});e.AES=n._createHelper(E)})(),t.AES})});var ZHr=I((R9e,JHr)=>{p();(function(t,e,r){typeof R9e=="object"?JHr.exports=R9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(R9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=r.BlockCipher,s=e.algo,c=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],l=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=s.DES=o.extend({_doReset:a(function(){for(var y=this._key,E=y.words,_=[],v=0;v<56;v++){var b=c[v]-1;_[v]=E[b>>>5]>>>31-b%32&1}for(var T=this._subKeys=[],w=0;w<16;w++){for(var R=T[w]=[],x=u[w],v=0;v<24;v++)R[v/6|0]|=_[(l[v]-1+x)%28]<<31-v%6,R[4+(v/6|0)]|=_[28+(l[v+24]-1+x)%28]<<31-v%6;R[0]=R[0]<<1|R[0]>>>31;for(var v=1;v<7;v++)R[v]=R[v]>>>(v-1)*4+3;R[7]=R[7]<<5|R[7]>>>27}for(var P=this._invSubKeys=[],v=0;v<16;v++)P[v]=T[15-v]},"_doReset"),encryptBlock:a(function(y,E){this._doCryptBlock(y,E,this._subKeys)},"encryptBlock"),decryptBlock:a(function(y,E){this._doCryptBlock(y,E,this._invSubKeys)},"decryptBlock"),_doCryptBlock:a(function(y,E,_){this._lBlock=y[E],this._rBlock=y[E+1],m.call(this,4,252645135),m.call(this,16,65535),g.call(this,2,858993459),g.call(this,8,16711935),m.call(this,1,1431655765);for(var v=0;v<16;v++){for(var b=_[v],T=this._lBlock,w=this._rBlock,R=0,x=0;x<8;x++)R|=d[x][((w^b[x])&f[x])>>>0];this._lBlock=w,this._rBlock=T^R}var P=this._lBlock;this._lBlock=this._rBlock,this._rBlock=P,m.call(this,1,1431655765),g.call(this,8,16711935),g.call(this,2,858993459),m.call(this,16,65535),m.call(this,4,252645135),y[E]=this._lBlock,y[E+1]=this._rBlock},"_doCryptBlock"),keySize:64/32,ivSize:64/32,blockSize:64/32});function m(y,E){var _=(this._lBlock>>>y^this._rBlock)&E;this._rBlock^=_,this._lBlock^=_<>>y^this._lBlock)&E;this._lBlock^=_,this._rBlock^=_<192.");var _=E.slice(0,2),v=E.length<4?E.slice(0,2):E.slice(2,4),b=E.length<6?E.slice(0,2):E.slice(4,6);this._des1=h.createEncryptor(n.create(_)),this._des2=h.createEncryptor(n.create(v)),this._des3=h.createEncryptor(n.create(b))},"_doReset"),encryptBlock:a(function(y,E){this._des1.encryptBlock(y,E),this._des2.decryptBlock(y,E),this._des3.encryptBlock(y,E)},"encryptBlock"),decryptBlock:a(function(y,E){this._des3.decryptBlock(y,E),this._des2.encryptBlock(y,E),this._des1.decryptBlock(y,E)},"decryptBlock"),keySize:192/32,ivSize:64/32,blockSize:64/32});e.TripleDES=o._createHelper(A)})(),t.TripleDES})});var eGr=I((k9e,XHr)=>{p();(function(t,e,r){typeof k9e=="object"?XHr.exports=k9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(k9e,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=o.RC4=n.extend({_doReset:a(function(){for(var u=this._key,d=u.words,f=u.sigBytes,h=this._S=[],m=0;m<256;m++)h[m]=m;for(var m=0,g=0;m<256;m++){var A=m%f,y=d[A>>>2]>>>24-A%4*8&255;g=(g+h[m]+y)%256;var E=h[m];h[m]=h[g],h[g]=E}this._i=this._j=0},"_doReset"),_doProcessBlock:a(function(u,d){u[d]^=c.call(this)},"_doProcessBlock"),keySize:256/32,ivSize:0});function c(){for(var u=this._S,d=this._i,f=this._j,h=0,m=0;m<4;m++){d=(d+1)%256,f=(f+u[d])%256;var g=u[d];u[d]=u[f],u[f]=g,h|=u[(u[d]+u[f])%256]<<24-m*8}return this._i=d,this._j=f,h}a(c,"generateKeystreamWord"),e.RC4=n._createHelper(s);var l=o.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:a(function(){s._doReset.call(this);for(var u=this.cfg.drop;u>0;u--)c.call(this)},"_doReset")});e.RC4Drop=n._createHelper(l)})(),t.RC4})});var rGr=I((P9e,tGr)=>{p();(function(t,e,r){typeof P9e=="object"?tGr.exports=P9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(P9e,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=[],c=[],l=[],u=o.Rabbit=n.extend({_doReset:a(function(){for(var f=this._key.words,h=this.cfg.iv,m=0;m<4;m++)f[m]=(f[m]<<8|f[m]>>>24)&16711935|(f[m]<<24|f[m]>>>8)&4278255360;var g=this._X=[f[0],f[3]<<16|f[2]>>>16,f[1],f[0]<<16|f[3]>>>16,f[2],f[1]<<16|f[0]>>>16,f[3],f[2]<<16|f[1]>>>16],A=this._C=[f[2]<<16|f[2]>>>16,f[0]&4294901760|f[1]&65535,f[3]<<16|f[3]>>>16,f[1]&4294901760|f[2]&65535,f[0]<<16|f[0]>>>16,f[2]&4294901760|f[3]&65535,f[1]<<16|f[1]>>>16,f[3]&4294901760|f[0]&65535];this._b=0;for(var m=0;m<4;m++)d.call(this);for(var m=0;m<8;m++)A[m]^=g[m+4&7];if(h){var y=h.words,E=y[0],_=y[1],v=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,b=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,T=v>>>16|b&4294901760,w=b<<16|v&65535;A[0]^=v,A[1]^=T,A[2]^=b,A[3]^=w,A[4]^=v,A[5]^=T,A[6]^=b,A[7]^=w;for(var m=0;m<4;m++)d.call(this)}},"_doReset"),_doProcessBlock:a(function(f,h){var m=this._X;d.call(this),s[0]=m[0]^m[5]>>>16^m[3]<<16,s[1]=m[2]^m[7]>>>16^m[5]<<16,s[2]=m[4]^m[1]>>>16^m[7]<<16,s[3]=m[6]^m[3]>>>16^m[1]<<16;for(var g=0;g<4;g++)s[g]=(s[g]<<8|s[g]>>>24)&16711935|(s[g]<<24|s[g]>>>8)&4278255360,f[h+g]^=s[g]},"_doProcessBlock"),blockSize:128/32,ivSize:64/32});function d(){for(var f=this._X,h=this._C,m=0;m<8;m++)c[m]=h[m];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var m=0;m<8;m++){var g=f[m]+h[m],A=g&65535,y=g>>>16,E=((A*A>>>17)+A*y>>>15)+y*y,_=((g&4294901760)*g|0)+((g&65535)*g|0);l[m]=E^_}f[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,f[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,f[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,f[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,f[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,f[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,f[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,f[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}a(d,"nextState"),e.Rabbit=n._createHelper(u)})(),t.Rabbit})});var iGr=I((D9e,nGr)=>{p();(function(t,e,r){typeof D9e=="object"?nGr.exports=D9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(D9e,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=[],c=[],l=[],u=o.RabbitLegacy=n.extend({_doReset:a(function(){var f=this._key.words,h=this.cfg.iv,m=this._X=[f[0],f[3]<<16|f[2]>>>16,f[1],f[0]<<16|f[3]>>>16,f[2],f[1]<<16|f[0]>>>16,f[3],f[2]<<16|f[1]>>>16],g=this._C=[f[2]<<16|f[2]>>>16,f[0]&4294901760|f[1]&65535,f[3]<<16|f[3]>>>16,f[1]&4294901760|f[2]&65535,f[0]<<16|f[0]>>>16,f[2]&4294901760|f[3]&65535,f[1]<<16|f[1]>>>16,f[3]&4294901760|f[0]&65535];this._b=0;for(var A=0;A<4;A++)d.call(this);for(var A=0;A<8;A++)g[A]^=m[A+4&7];if(h){var y=h.words,E=y[0],_=y[1],v=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,b=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,T=v>>>16|b&4294901760,w=b<<16|v&65535;g[0]^=v,g[1]^=T,g[2]^=b,g[3]^=w,g[4]^=v,g[5]^=T,g[6]^=b,g[7]^=w;for(var A=0;A<4;A++)d.call(this)}},"_doReset"),_doProcessBlock:a(function(f,h){var m=this._X;d.call(this),s[0]=m[0]^m[5]>>>16^m[3]<<16,s[1]=m[2]^m[7]>>>16^m[5]<<16,s[2]=m[4]^m[1]>>>16^m[7]<<16,s[3]=m[6]^m[3]>>>16^m[1]<<16;for(var g=0;g<4;g++)s[g]=(s[g]<<8|s[g]>>>24)&16711935|(s[g]<<24|s[g]>>>8)&4278255360,f[h+g]^=s[g]},"_doProcessBlock"),blockSize:128/32,ivSize:64/32});function d(){for(var f=this._X,h=this._C,m=0;m<8;m++)c[m]=h[m];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var m=0;m<8;m++){var g=f[m]+h[m],A=g&65535,y=g>>>16,E=((A*A>>>17)+A*y>>>15)+y*y,_=((g&4294901760)*g|0)+((g&65535)*g|0);l[m]=E^_}f[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,f[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,f[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,f[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,f[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,f[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,f[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,f[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}a(d,"nextState"),e.RabbitLegacy=n._createHelper(u)})(),t.RabbitLegacy})});var sGr=I((N9e,oGr)=>{p();(function(t,e,r){typeof N9e=="object"?oGr.exports=N9e=e(sa(),lU(),uU(),oB(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(N9e,function(t){return(function(){var e=t,r=e.lib,n=r.BlockCipher,o=e.algo;let s=16,c=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],l=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var u={pbox:[],sbox:[]};function d(A,y){let E=y>>24&255,_=y>>16&255,v=y>>8&255,b=y&255,T=A.sbox[0][E]+A.sbox[1][_];return T=T^A.sbox[2][v],T=T+A.sbox[3][b],T}a(d,"F");function f(A,y,E){let _=y,v=E,b;for(let T=0;T1;--T)_=_^A.pbox[T],v=d(A,_)^v,b=_,_=v,v=b;return b=_,_=v,v=b,v=v^A.pbox[1],_=_^A.pbox[0],{left:_,right:v}}a(h,"BlowFish_Decrypt");function m(A,y,E){for(let w=0;w<4;w++){A.sbox[w]=[];for(let R=0;R<256;R++)A.sbox[w][R]=l[w][R]}let _=0;for(let w=0;w=E&&(_=0);let v=0,b=0,T=0;for(let w=0;w{p();(function(t,e,r){typeof M9e=="object"?aGr.exports=M9e=e(sa(),wCe(),iHr(),sHr(),lU(),lHr(),uU(),sPt(),s9e(),hHr(),aPt(),AHr(),EHr(),vHr(),p9e(),SHr(),oB(),jm(),wHr(),kHr(),DHr(),MHr(),LHr(),FHr(),QHr(),jHr(),GHr(),VHr(),zHr(),KHr(),ZHr(),eGr(),rGr(),iGr(),sGr()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./enc-base64url","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy","./blowfish"],e):t.CryptoJS=e(t.CryptoJS)})(M9e,function(t){return t})});var Xoe=I(qy=>{"use strict";p();Object.defineProperty(qy,"__esModule",{value:!0});qy.stringArray=qy.array=qy.func=qy.error=qy.number=qy.string=qy.boolean=void 0;function hAo(t){return t===!0||t===!1}a(hAo,"boolean");qy.boolean=hAo;function jVr(t){return typeof t=="string"||t instanceof String}a(jVr,"string");qy.string=jVr;function mAo(t){return typeof t=="number"||t instanceof Number}a(mAo,"number");qy.number=mAo;function gAo(t){return t instanceof Error}a(gAo,"error");qy.error=gAo;function AAo(t){return typeof t=="function"}a(AAo,"func");qy.func=AAo;function HVr(t){return Array.isArray(t)}a(HVr,"array");qy.array=HVr;function yAo(t){return HVr(t)&&t.every(e=>jVr(e))}a(yAo,"stringArray");qy.stringArray=yAo});var D2t=I(pi=>{"use strict";p();Object.defineProperty(pi,"__esModule",{value:!0});pi.Message=pi.NotificationType9=pi.NotificationType8=pi.NotificationType7=pi.NotificationType6=pi.NotificationType5=pi.NotificationType4=pi.NotificationType3=pi.NotificationType2=pi.NotificationType1=pi.NotificationType0=pi.NotificationType=pi.RequestType9=pi.RequestType8=pi.RequestType7=pi.RequestType6=pi.RequestType5=pi.RequestType4=pi.RequestType3=pi.RequestType2=pi.RequestType1=pi.RequestType=pi.RequestType0=pi.AbstractMessageSignature=pi.ParameterStructures=pi.ResponseError=pi.ErrorCodes=void 0;var BW=Xoe(),c2t;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(c2t||(pi.ErrorCodes=c2t={}));var l2t=class t extends Error{static{a(this,"ResponseError")}constructor(e,r,n){super(r),this.code=BW.number(e)?e:c2t.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};pi.ResponseError=l2t;var lC=class t{static{a(this,"ParameterStructures")}constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};pi.ParameterStructures=lC;lC.auto=new lC("auto");lC.byPosition=new lC("byPosition");lC.byName=new lC("byName");var ju=class{static{a(this,"AbstractMessageSignature")}constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return lC.auto}};pi.AbstractMessageSignature=ju;var u2t=class extends ju{static{a(this,"RequestType0")}constructor(e){super(e,0)}};pi.RequestType0=u2t;var d2t=class extends ju{static{a(this,"RequestType")}constructor(e,r=lC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.RequestType=d2t;var f2t=class extends ju{static{a(this,"RequestType1")}constructor(e,r=lC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.RequestType1=f2t;var p2t=class extends ju{static{a(this,"RequestType2")}constructor(e){super(e,2)}};pi.RequestType2=p2t;var h2t=class extends ju{static{a(this,"RequestType3")}constructor(e){super(e,3)}};pi.RequestType3=h2t;var m2t=class extends ju{static{a(this,"RequestType4")}constructor(e){super(e,4)}};pi.RequestType4=m2t;var g2t=class extends ju{static{a(this,"RequestType5")}constructor(e){super(e,5)}};pi.RequestType5=g2t;var A2t=class extends ju{static{a(this,"RequestType6")}constructor(e){super(e,6)}};pi.RequestType6=A2t;var y2t=class extends ju{static{a(this,"RequestType7")}constructor(e){super(e,7)}};pi.RequestType7=y2t;var E2t=class extends ju{static{a(this,"RequestType8")}constructor(e){super(e,8)}};pi.RequestType8=E2t;var _2t=class extends ju{static{a(this,"RequestType9")}constructor(e){super(e,9)}};pi.RequestType9=_2t;var v2t=class extends ju{static{a(this,"NotificationType")}constructor(e,r=lC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.NotificationType=v2t;var C2t=class extends ju{static{a(this,"NotificationType0")}constructor(e){super(e,0)}};pi.NotificationType0=C2t;var b2t=class extends ju{static{a(this,"NotificationType1")}constructor(e,r=lC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.NotificationType1=b2t;var S2t=class extends ju{static{a(this,"NotificationType2")}constructor(e){super(e,2)}};pi.NotificationType2=S2t;var T2t=class extends ju{static{a(this,"NotificationType3")}constructor(e){super(e,3)}};pi.NotificationType3=T2t;var I2t=class extends ju{static{a(this,"NotificationType4")}constructor(e){super(e,4)}};pi.NotificationType4=I2t;var x2t=class extends ju{static{a(this,"NotificationType5")}constructor(e){super(e,5)}};pi.NotificationType5=x2t;var w2t=class extends ju{static{a(this,"NotificationType6")}constructor(e){super(e,6)}};pi.NotificationType6=w2t;var R2t=class extends ju{static{a(this,"NotificationType7")}constructor(e){super(e,7)}};pi.NotificationType7=R2t;var k2t=class extends ju{static{a(this,"NotificationType8")}constructor(e){super(e,8)}};pi.NotificationType8=k2t;var P2t=class extends ju{static{a(this,"NotificationType9")}constructor(e){super(e,9)}};pi.NotificationType9=P2t;var GVr;(function(t){function e(o){let s=o;return s&&BW.string(s.method)&&(BW.string(s.id)||BW.number(s.id))}a(e,"isRequest"),t.isRequest=e;function r(o){let s=o;return s&&BW.string(s.method)&&o.id===void 0}a(r,"isNotification"),t.isNotification=r;function n(o){let s=o;return s&&(s.result!==void 0||!!s.error)&&(BW.string(s.id)||BW.number(s.id)||s.id===null)}a(n,"isResponse"),t.isResponse=n})(GVr||(pi.Message=GVr={}))});var M2t=I(TU=>{"use strict";p();var $Vr;Object.defineProperty(TU,"__esModule",{value:!0});TU.LRUCache=TU.LinkedMap=TU.Touch=void 0;var jy;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(jy||(TU.Touch=jy={}));var gUe=class{static{a(this,"LinkedMap")}constructor(){this[$Vr]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=jy.None){let n=this._map.get(e);if(n)return r!==jy.None&&this.touch(n,r),n.value}set(e,r,n=jy.None){let o=this._map.get(e);if(o)o.value=r,n!==jy.None&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case jy.None:this.addItemLast(o);break;case jy.First:this.addItemFirst(o);break;case jy.Last:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.key,done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.value,done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:[r.key,r.value],done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}[($Vr=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==jy.First&&r!==jy.Last)){if(r===jy.First){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===jy.Last){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};TU.LinkedMap=gUe;var N2t=class extends gUe{static{a(this,"LRUCache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=jy.AsNew){return super.get(e,r)}peek(e){return super.get(e,jy.None)}set(e,r){return super.set(e,r,jy.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};TU.LRUCache=N2t});var WVr=I(AUe=>{"use strict";p();Object.defineProperty(AUe,"__esModule",{value:!0});AUe.Disposable=void 0;var VVr;(function(t){function e(r){return{dispose:r}}a(e,"create"),t.create=e})(VVr||(AUe.Disposable=VVr={}))});var IU=I(B2t=>{"use strict";p();Object.defineProperty(B2t,"__esModule",{value:!0});var O2t;function L2t(){if(O2t===void 0)throw new Error("No runtime abstraction layer installed");return O2t}a(L2t,"RAL");(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");O2t=r}a(e,"install"),t.install=e})(L2t||(L2t={}));B2t.default=L2t});var tse=I(ese=>{"use strict";p();Object.defineProperty(ese,"__esModule",{value:!0});ese.Emitter=ese.Event=void 0;var EAo=IU(),zVr;(function(t){let e={dispose(){}};t.None=function(){return e}})(zVr||(ese.Event=zVr={}));var F2t=class{static{a(this,"CallbackList")}add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:a(()=>this.remove(e,r),"dispose")})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let o=0,s=this._callbacks.length;o{this._callbacks||(this._callbacks=new F2t),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let o={dispose:a(()=>{this._callbacks&&(this._callbacks.remove(e,r),o.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(n)&&n.push(o),o}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};ese.Emitter=yUe;yUe._noop=function(){}});var vUe=I(rse=>{"use strict";p();Object.defineProperty(rse,"__esModule",{value:!0});rse.CancellationTokenSource=rse.CancellationToken=void 0;var _Ao=IU(),vAo=Xoe(),U2t=tse(),EUe;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:U2t.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:U2t.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||vAo.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}a(e,"is"),t.is=e})(EUe||(rse.CancellationToken=EUe={}));var CAo=Object.freeze(function(t,e){let r=(0,_Ao.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),_Ue=class{static{a(this,"MutableToken")}constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?CAo:(this._emitter||(this._emitter=new U2t.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Q2t=class{static{a(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new _Ue),this._token}cancel(){this._token?this._token.cancel():this._token=EUe.Cancelled}dispose(){this._token?this._token instanceof _Ue&&this._token.dispose():this._token=EUe.None}};rse.CancellationTokenSource=Q2t});var YVr=I(nse=>{"use strict";p();Object.defineProperty(nse,"__esModule",{value:!0});nse.SharedArrayReceiverStrategy=nse.SharedArraySenderStrategy=void 0;var bAo=vUe(),zCe;(function(t){t.Continue=0,t.Cancelled=1})(zCe||(zCe={}));var q2t=class{static{a(this,"SharedArraySenderStrategy")}constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=zCe.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let o=new Int32Array(n,0,1);Atomics.store(o,0,zCe.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};nse.SharedArraySenderStrategy=q2t;var j2t=class{static{a(this,"SharedArrayBufferCancellationToken")}constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===zCe.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},H2t=class{static{a(this,"SharedArrayBufferCancellationTokenSource")}constructor(e){this.token=new j2t(e)}cancel(){}dispose(){}},G2t=class{static{a(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new bAo.CancellationTokenSource:new H2t(r)}};nse.SharedArrayReceiverStrategy=G2t});var V2t=I(CUe=>{"use strict";p();Object.defineProperty(CUe,"__esModule",{value:!0});CUe.Semaphore=void 0;var SAo=IU(),$2t=class{static{a(this,"Semaphore")}constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,SAo.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};CUe.Semaphore=$2t});var JVr=I(xU=>{"use strict";p();Object.defineProperty(xU,"__esModule",{value:!0});xU.ReadableStreamMessageReader=xU.AbstractMessageReader=xU.MessageReader=void 0;var z2t=IU(),ise=Xoe(),W2t=tse(),TAo=V2t(),KVr;(function(t){function e(r){let n=r;return n&&ise.func(n.listen)&&ise.func(n.dispose)&&ise.func(n.onError)&&ise.func(n.onClose)&&ise.func(n.onPartialMessage)}a(e,"is"),t.is=e})(KVr||(xU.MessageReader=KVr={}));var bUe=class{static{a(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new W2t.Emitter,this.closeEmitter=new W2t.Emitter,this.partialMessageEmitter=new W2t.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${ise.string(e.message)?e.message:"unknown"}`)}};xU.AbstractMessageReader=bUe;var Y2t;(function(t){function e(r){let n,o,s,c=new Map,l,u=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,c.set(s.name,s)),r.contentDecoders!==void 0)for(let d of r.contentDecoders)c.set(d.name,d);if(r.contentTypeDecoder!==void 0&&(l=r.contentTypeDecoder,u.set(l.name,l)),r.contentTypeDecoders!==void 0)for(let d of r.contentTypeDecoders)u.set(d.name,d)}return l===void 0&&(l=(0,z2t.default)().applicationJson.decoder,u.set(l.name,l)),{charset:n,contentDecoder:s,contentDecoders:c,contentTypeDecoder:l,contentTypeDecoders:u}}a(e,"fromOptions"),t.fromOptions=e})(Y2t||(Y2t={}));var K2t=class extends bUe{static{a(this,"ReadableStreamMessageReader")}constructor(e,r){super(),this.readable=e,this.options=Y2t.fromOptions(r),this.buffer=(0,z2t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new TAo.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let o=n.get("content-length");if(!o){this.fireError(new Error(`Header must provide a Content-Length property. -${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(o);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${o}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,o=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(o)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,z2t.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};xU.ReadableStreamMessageReader=K2t});var rWr=I(wU=>{"use strict";p();Object.defineProperty(wU,"__esModule",{value:!0});wU.WriteableStreamMessageWriter=wU.AbstractMessageWriter=wU.MessageWriter=void 0;var ZVr=IU(),YCe=Xoe(),IAo=V2t(),XVr=tse(),xAo="Content-Length: ",eWr=`\r -`,tWr;(function(t){function e(r){let n=r;return n&&YCe.func(n.dispose)&&YCe.func(n.onClose)&&YCe.func(n.onError)&&YCe.func(n.write)}a(e,"is"),t.is=e})(tWr||(wU.MessageWriter=tWr={}));var SUe=class{static{a(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new XVr.Emitter,this.closeEmitter=new XVr.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${YCe.string(e.message)?e.message:"unknown"}`)}};wU.AbstractMessageWriter=SUe;var J2t;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,ZVr.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,ZVr.default)().applicationJson.encoder}}a(e,"fromOptions"),t.fromOptions=e})(J2t||(J2t={}));var Z2t=class extends SUe{static{a(this,"WriteableStreamMessageWriter")}constructor(e,r){super(),this.writable=e,this.options=J2t.fromOptions(r),this.errorCount=0,this.writeSemaphore=new IAo.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let o=[];return o.push(xAo,n.byteLength.toString(),eWr),o.push(eWr),this.doWrite(e,o,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(o){return this.handleError(o,e),Promise.reject(o)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};wU.WriteableStreamMessageWriter=Z2t});var nWr=I(TUe=>{"use strict";p();Object.defineProperty(TUe,"__esModule",{value:!0});TUe.AbstractMessageBuffer=void 0;var wAo=13,RAo=10,kAo=`\r -`,X2t=class{static{a(this,"AbstractMessageBuffer")}constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,o=0,s=0;e:for(;nthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],c=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,c}let r=this.allocNative(e),n=0,o=0;for(;e>0;){let s=this._chunks[o];if(s.byteLength>e){let c=s.slice(0,e);r.set(c,n),n+=e,this._chunks[o]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};TUe.AbstractMessageBuffer=X2t});var cWr=I(Oo=>{"use strict";p();Object.defineProperty(Oo,"__esModule",{value:!0});Oo.createMessageConnection=Oo.ConnectionOptions=Oo.MessageStrategy=Oo.CancellationStrategy=Oo.CancellationSenderStrategy=Oo.CancellationReceiverStrategy=Oo.RequestCancellationReceiverStrategy=Oo.IdCancellationReceiverStrategy=Oo.ConnectionStrategy=Oo.ConnectionError=Oo.ConnectionErrors=Oo.LogTraceNotification=Oo.SetTraceNotification=Oo.TraceFormat=Oo.TraceValues=Oo.Trace=Oo.NullLogger=Oo.ProgressType=Oo.ProgressToken=void 0;var iWr=IU(),lf=Xoe(),Vi=D2t(),oWr=M2t(),KCe=tse(),eDt=vUe(),XCe;(function(t){t.type=new Vi.NotificationType("$/cancelRequest")})(XCe||(XCe={}));var tDt;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}a(e,"is"),t.is=e})(tDt||(Oo.ProgressToken=tDt={}));var JCe;(function(t){t.type=new Vi.NotificationType("$/progress")})(JCe||(JCe={}));var rDt=class{static{a(this,"ProgressType")}constructor(){}};Oo.ProgressType=rDt;var nDt;(function(t){function e(r){return lf.func(r)}a(e,"is"),t.is=e})(nDt||(nDt={}));Oo.NullLogger=Object.freeze({error:a(()=>{},"error"),warn:a(()=>{},"warn"),info:a(()=>{},"info"),log:a(()=>{},"log")});var bc;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(bc||(Oo.Trace=bc={}));var sWr;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(sWr||(Oo.TraceValues=sWr={}));(function(t){function e(n){if(!lf.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}a(e,"fromString"),t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}a(r,"toString"),t.toString=r})(bc||(Oo.Trace=bc={}));var G1;(function(t){t.Text="text",t.JSON="json"})(G1||(Oo.TraceFormat=G1={}));(function(t){function e(r){return lf.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}a(e,"fromString"),t.fromString=e})(G1||(Oo.TraceFormat=G1={}));var iDt;(function(t){t.type=new Vi.NotificationType("$/setTrace")})(iDt||(Oo.SetTraceNotification=iDt={}));var IUe;(function(t){t.type=new Vi.NotificationType("$/logTrace")})(IUe||(Oo.LogTraceNotification=IUe={}));var ZCe;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(ZCe||(Oo.ConnectionErrors=ZCe={}));var ose=class t extends Error{static{a(this,"ConnectionError")}constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Oo.ConnectionError=ose;var oDt;(function(t){function e(r){let n=r;return n&&lf.func(n.cancelUndispatched)}a(e,"is"),t.is=e})(oDt||(Oo.ConnectionStrategy=oDt={}));var xUe;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&lf.func(n.createCancellationTokenSource)&&(n.dispose===void 0||lf.func(n.dispose))}a(e,"is"),t.is=e})(xUe||(Oo.IdCancellationReceiverStrategy=xUe={}));var sDt;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&lf.func(n.createCancellationTokenSource)&&(n.dispose===void 0||lf.func(n.dispose))}a(e,"is"),t.is=e})(sDt||(Oo.RequestCancellationReceiverStrategy=sDt={}));var wUe;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new eDt.CancellationTokenSource}});function e(r){return xUe.is(r)||sDt.is(r)}a(e,"is"),t.is=e})(wUe||(Oo.CancellationReceiverStrategy=wUe={}));var RUe;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(XCe.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&lf.func(n.sendCancellation)&&lf.func(n.cleanup)}a(e,"is"),t.is=e})(RUe||(Oo.CancellationSenderStrategy=RUe={}));var kUe;(function(t){t.Message=Object.freeze({receiver:wUe.Message,sender:RUe.Message});function e(r){let n=r;return n&&wUe.is(n.receiver)&&RUe.is(n.sender)}a(e,"is"),t.is=e})(kUe||(Oo.CancellationStrategy=kUe={}));var PUe;(function(t){function e(r){let n=r;return n&&lf.func(n.handleMessage)}a(e,"is"),t.is=e})(PUe||(Oo.MessageStrategy=PUe={}));var aWr;(function(t){function e(r){let n=r;return n&&(kUe.is(n.cancellationStrategy)||oDt.is(n.connectionStrategy)||PUe.is(n.messageStrategy))}a(e,"is"),t.is=e})(aWr||(Oo.ConnectionOptions=aWr={}));var $k;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})($k||($k={}));function PAo(t,e,r,n){let o=r!==void 0?r:Oo.NullLogger,s=0,c=0,l=0,u="2.0",d,f=new Map,h,m=new Map,g=new Map,A,y=new oWr.LinkedMap,E=new Map,_=new Set,v=new Map,b=bc.Off,T=G1.Text,w,R=$k.New,x=new KCe.Emitter,P=new KCe.Emitter,D=new KCe.Emitter,N=new KCe.Emitter,L=new KCe.Emitter,B=n&&n.cancellationStrategy?n.cancellationStrategy:kUe.Message;function q(Ie){if(Ie===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Ie.toString()}a(q,"createRequestQueueKey");function M(Ie){return Ie===null?"res-unknown-"+(++l).toString():"res-"+Ie.toString()}a(M,"createResponseQueueKey");function O(){return"not-"+(++c).toString()}a(O,"createNotificationQueueKey");function j(Ie,F){Vi.Message.isRequest(F)?Ie.set(q(F.id),F):Vi.Message.isResponse(F)?Ie.set(M(F.id),F):Ie.set(O(),F)}a(j,"addMessageToQueue");function Q(Ie){}a(Q,"cancelUndispatched");function U(){return R===$k.Listening}a(U,"isListening");function Y(){return R===$k.Closed}a(Y,"isClosed");function W(){return R===$k.Disposed}a(W,"isDisposed");function V(){(R===$k.New||R===$k.Listening)&&(R=$k.Closed,P.fire(void 0))}a(V,"closeHandler");function z(Ie){x.fire([Ie,void 0,void 0])}a(z,"readErrorHandler");function ie(Ie){x.fire(Ie)}a(ie,"writeErrorHandler"),t.onClose(V),t.onError(z),e.onClose(V),e.onError(ie);function H(){A||y.size===0||(A=(0,iWr.default)().timer.setImmediate(()=>{A=void 0,le()}))}a(H,"triggerMessageQueue");function re(Ie){Vi.Message.isRequest(Ie)?ge(Ie):Vi.Message.isNotification(Ie)?ke(Ie):Vi.Message.isResponse(Ie)?Ue(Ie):X(Ie)}a(re,"handleMessage");function le(){if(y.size===0)return;let Ie=y.shift();try{let F=n?.messageStrategy;PUe.is(F)?F.handleMessage(Ie,re):re(Ie)}finally{H()}}a(le,"processMessageQueue");let Le=a(Ie=>{try{if(Vi.Message.isNotification(Ie)&&Ie.method===XCe.type.method){let F=Ie.params.id,be=q(F),Qe=y.get(be);if(Vi.Message.isRequest(Qe)){let Se=n?.connectionStrategy,Fe=Se&&Se.cancelUndispatched?Se.cancelUndispatched(Qe,Q):void 0;if(Fe&&(Fe.error!==void 0||Fe.result!==void 0)){y.delete(be),v.delete(F),Fe.id=Qe.id,Z(Fe,Ie.method,Date.now()),e.write(Fe).catch(()=>o.error("Sending response for canceled message failed."));return}}let pe=v.get(F);if(pe!==void 0){pe.cancel(),qe(Ie);return}else _.add(F)}j(y,Ie)}finally{H()}},"callback");function ge(Ie){if(W())return;function F(Te,Ge,J){let se={jsonrpc:u,id:Ie.id};Te instanceof Vi.ResponseError?se.error=Te.toJson():se.result=Te===void 0?null:Te,Z(se,Ge,J),e.write(se).catch(()=>o.error("Sending response failed."))}a(F,"reply");function be(Te,Ge,J){let se={jsonrpc:u,id:Ie.id,error:Te.toJson()};Z(se,Ge,J),e.write(se).catch(()=>o.error("Sending response failed."))}a(be,"replyError");function Qe(Te,Ge,J){Te===void 0&&(Te=null);let se={jsonrpc:u,id:Ie.id,result:Te};Z(se,Ge,J),e.write(se).catch(()=>o.error("Sending response failed."))}a(Qe,"replySuccess"),ue(Ie);let pe=f.get(Ie.method),Se,Fe;pe&&(Se=pe.type,Fe=pe.handler);let te=Date.now();if(Fe||d){let Te=Ie.id??String(Date.now()),Ge=xUe.is(B.receiver)?B.receiver.createCancellationTokenSource(Te):B.receiver.createCancellationTokenSource(Ie);Ie.id!==null&&_.has(Ie.id)&&Ge.cancel(),Ie.id!==null&&v.set(Te,Ge);try{let J;if(Fe)if(Ie.params===void 0){if(Se!==void 0&&Se.numberOfParams!==0){be(new Vi.ResponseError(Vi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines ${Se.numberOfParams} params but received none.`),Ie.method,te);return}J=Fe(Ge.token)}else if(Array.isArray(Ie.params)){if(Se!==void 0&&Se.parameterStructures===Vi.ParameterStructures.byName){be(new Vi.ResponseError(Vi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines parameters by name but received parameters by position`),Ie.method,te);return}J=Fe(...Ie.params,Ge.token)}else{if(Se!==void 0&&Se.parameterStructures===Vi.ParameterStructures.byPosition){be(new Vi.ResponseError(Vi.ErrorCodes.InvalidParams,`Request ${Ie.method} defines parameters by position but received parameters by name`),Ie.method,te);return}J=Fe(Ie.params,Ge.token)}else d&&(J=d(Ie.method,Ie.params,Ge.token));let se=J;J?se.then?se.then(me=>{v.delete(Te),F(me,Ie.method,te)},me=>{v.delete(Te),me instanceof Vi.ResponseError?be(me,Ie.method,te):me&&lf.string(me.message)?be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed with message: ${me.message}`),Ie.method,te):be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed unexpectedly without providing any details.`),Ie.method,te)}):(v.delete(Te),F(J,Ie.method,te)):(v.delete(Te),Qe(J,Ie.method,te))}catch(J){v.delete(Te),J instanceof Vi.ResponseError?F(J,Ie.method,te):J&&lf.string(J.message)?be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed with message: ${J.message}`),Ie.method,te):be(new Vi.ResponseError(Vi.ErrorCodes.InternalError,`Request ${Ie.method} failed unexpectedly without providing any details.`),Ie.method,te)}}else be(new Vi.ResponseError(Vi.ErrorCodes.MethodNotFound,`Unhandled method ${Ie.method}`),Ie.method,te)}a(ge,"handleRequest");function Ue(Ie){if(!W())if(Ie.id===null)Ie.error?o.error(`Received response message without id: Error is: -${JSON.stringify(Ie.error,void 0,4)}`):o.error("Received response message without id. No further error information provided.");else{let F=Ie.id,be=E.get(F);if(ne(Ie,be),be!==void 0){E.delete(F);try{if(Ie.error){let Qe=Ie.error;be.reject(new Vi.ResponseError(Qe.code,Qe.message,Qe.data))}else if(Ie.result!==void 0)be.resolve(Ie.result);else throw new Error("Should never happen.")}catch(Qe){Qe.message?o.error(`Response handler '${be.method}' failed with message: ${Qe.message}`):o.error(`Response handler '${be.method}' failed unexpectedly.`)}}}}a(Ue,"handleResponse");function ke(Ie){if(W())return;let F,be;if(Ie.method===XCe.type.method){let Qe=Ie.params.id;_.delete(Qe),qe(Ie);return}else{let Qe=m.get(Ie.method);Qe&&(be=Qe.handler,F=Qe.type)}if(be||h)try{if(qe(Ie),be)if(Ie.params===void 0)F!==void 0&&F.numberOfParams!==0&&F.parameterStructures!==Vi.ParameterStructures.byName&&o.error(`Notification ${Ie.method} defines ${F.numberOfParams} params but received none.`),be();else if(Array.isArray(Ie.params)){let Qe=Ie.params;Ie.method===JCe.type.method&&Qe.length===2&&tDt.is(Qe[0])?be({token:Qe[0],value:Qe[1]}):(F!==void 0&&(F.parameterStructures===Vi.ParameterStructures.byName&&o.error(`Notification ${Ie.method} defines parameters by name but received parameters by position`),F.numberOfParams!==Ie.params.length&&o.error(`Notification ${Ie.method} defines ${F.numberOfParams} params but received ${Qe.length} arguments`)),be(...Qe))}else F!==void 0&&F.parameterStructures===Vi.ParameterStructures.byPosition&&o.error(`Notification ${Ie.method} defines parameters by position but received parameters by name`),be(Ie.params);else h&&h(Ie.method,Ie.params)}catch(Qe){Qe.message?o.error(`Notification handler '${Ie.method}' failed with message: ${Qe.message}`):o.error(`Notification handler '${Ie.method}' failed unexpectedly.`)}else D.fire(Ie)}a(ke,"handleNotification");function X(Ie){if(!Ie){o.error("Received empty message.");return}o.error(`Received message which is neither a response nor a notification message: -${JSON.stringify(Ie,null,4)}`);let F=Ie;if(lf.string(F.id)||lf.number(F.id)){let be=F.id,Qe=E.get(be);Qe&&Qe.reject(new Error("The received response has neither a result nor an error property."))}}a(X,"handleInvalidMessage");function ee(Ie){if(Ie!=null)switch(b){case bc.Verbose:return JSON.stringify(Ie,null,4);case bc.Compact:return JSON.stringify(Ie);default:return}}a(ee,"stringifyTrace");function K(Ie){if(!(b===bc.Off||!w))if(T===G1.Text){let F;(b===bc.Verbose||b===bc.Compact)&&Ie.params&&(F=`Params: ${ee(Ie.params)} +`)),l.tries=r,l}a(Hfo,"bindings");tGr.exports=Hfo;function Gfo(t){for(var e=jfo(t),r;;){if(e==="."&&(e=process.cwd()),XHr(WCe(e,"dist")))return WCe(e,"dist");if(XHr(WCe(e,"compiled")))return e;if(r===e)throw new Error('Could not find module root given file: "'+t+'". Do you have a `dist` or `compiled` directory? ');r=e,e=WCe(e,"..")}}a(Gfo,"getRoot")});var oGr=I(GI=>{"use strict";p();var $fo=GI&&GI.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vfo=GI&&GI.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),rGr=GI&&GI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&$fo(e,t,r);return Vfo(e,t),e};Object.defineProperty(GI,"__esModule",{value:!0});GI.setDeviceId=GI.getDeviceId=void 0;var _9e=rGr(require("path")),v9e=rGr(ZHr()),nGr=process.platform==="win32"?E9e()("windows"):null,Wfo="deviceid";function iGr(){let t;if(!process.env.HOME)throw new Error("Home directory not found");if(process.platform==="darwin")t=_9e.join(process.env.HOME,"Library","Application Support");else if(process.platform==="linux")t=process.env.XDG_CACHE_HOME??_9e.join(process.env.HOME,".cache");else throw new Error("Unsupported platform");return _9e.join(t,"Microsoft","DeveloperTools")}a(iGr,"getDirectory");function wPt(){return _9e.join(iGr(),Wfo)}a(wPt,"getDeviceIdFilePath");async function zfo(){return process.platform==="win32"?nGr?.GetDeviceId():await Yfo(wPt())?v9e.readFile(wPt(),"utf8"):void 0}a(zfo,"getDeviceId");GI.getDeviceId=zfo;async function Yfo(t){try{return await v9e.promises.access(t),!0}catch{return!1}}a(Yfo,"exists");async function Kfo(t){process.platform==="win32"?nGr?.SetDeviceId(t):(await v9e.ensureDir(iGr()),await v9e.writeFile(wPt(),t,"utf8"))}a(Kfo,"setDeviceId");GI.setDeviceId=Kfo});var aGr=I(sM=>{"use strict";p();var Jfo=sM&&sM.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Zfo=sM&&sM.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Xfo=sM&&sM.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Jfo(e,t,r);return Zfo(e,t),e};Object.defineProperty(sM,"__esModule",{value:!0});sM.getDeviceId=void 0;var epo=(Mo(),Qa(Tc)),sGr=Xfo(oGr());async function tpo(){let t;try{t=await sGr.getDeviceId()}catch{}if(t)return t;{let e=(0,epo.v4)().toLowerCase();return await sGr.setDeviceId(e),e}}a(tpo,"getDeviceId");sM.getDeviceId=tpo});var cGr=I(FW=>{"use strict";p();var rpo=FW&&FW.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),npo=FW&&FW.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rpo(e,t,r)};Object.defineProperty(FW,"__esModule",{value:!0});if(process.platform!=="win32"&&process.platform!=="darwin"&&process.platform!=="linux")throw new Error("Unsupported platform");npo(aGr(),FW)});var aa=I((b9e,lGr)=>{p();(function(t,e){typeof b9e=="object"?lGr.exports=b9e=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(b9e,function(){var t=t||(function(e,r){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&typeof global<"u"&&global.crypto&&(n=global.crypto),!n&&typeof require=="function")try{n=require("crypto")}catch{}var o=a(function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},"cryptoSecureRandomInt"),s=Object.create||(function(){function _(){}return a(_,"F"),function(v){var b;return _.prototype=v,b=new _,_.prototype=null,b}})(),c={},l=c.lib={},u=l.Base=(function(){return{extend:a(function(_){var v=s(this);return _&&v.mixIn(_),(!v.hasOwnProperty("init")||this.init===v.init)&&(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},"extend"),create:a(function(){var _=this.extend();return _.init.apply(_,arguments),_},"create"),init:a(function(){},"init"),mixIn:a(function(_){for(var v in _)_.hasOwnProperty(v)&&(this[v]=_[v]);_.hasOwnProperty("toString")&&(this.toString=_.toString)},"mixIn"),clone:a(function(){return this.init.prototype.extend(this)},"clone")}})(),d=l.WordArray=u.extend({init:a(function(_,v){_=this.words=_||[],v!=r?this.sigBytes=v:this.sigBytes=_.length*4},"init"),toString:a(function(_){return(_||h).stringify(this)},"toString"),concat:a(function(_){var v=this.words,b=_.words,T=this.sigBytes,w=_.sigBytes;if(this.clamp(),T%4)for(var R=0;R>>2]>>>24-R%4*8&255;v[T+R>>>2]|=x<<24-(T+R)%4*8}else for(var P=0;P>>2]=b[P>>>2];return this.sigBytes+=w,this},"concat"),clamp:a(function(){var _=this.words,v=this.sigBytes;_[v>>>2]&=4294967295<<32-v%4*8,_.length=e.ceil(v/4)},"clamp"),clone:a(function(){var _=u.clone.call(this);return _.words=this.words.slice(0),_},"clone"),random:a(function(_){for(var v=[],b=0;b<_;b+=4)v.push(o());return new d.init(v,_)},"random")}),f=c.enc={},h=f.Hex={stringify:a(function(_){for(var v=_.words,b=_.sigBytes,T=[],w=0;w>>2]>>>24-w%4*8&255;T.push((R>>>4).toString(16)),T.push((R&15).toString(16))}return T.join("")},"stringify"),parse:a(function(_){for(var v=_.length,b=[],T=0;T>>3]|=parseInt(_.substr(T,2),16)<<24-T%8*4;return new d.init(b,v/2)},"parse")},m=f.Latin1={stringify:a(function(_){for(var v=_.words,b=_.sigBytes,T=[],w=0;w>>2]>>>24-w%4*8&255;T.push(String.fromCharCode(R))}return T.join("")},"stringify"),parse:a(function(_){for(var v=_.length,b=[],T=0;T>>2]|=(_.charCodeAt(T)&255)<<24-T%4*8;return new d.init(b,v)},"parse")},g=f.Utf8={stringify:a(function(_){try{return decodeURIComponent(escape(m.stringify(_)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:a(function(_){return m.parse(unescape(encodeURIComponent(_)))},"parse")},A=l.BufferedBlockAlgorithm=u.extend({reset:a(function(){this._data=new d.init,this._nDataBytes=0},"reset"),_append:a(function(_){typeof _=="string"&&(_=g.parse(_)),this._data.concat(_),this._nDataBytes+=_.sigBytes},"_append"),_process:a(function(_){var v,b=this._data,T=b.words,w=b.sigBytes,R=this.blockSize,x=R*4,P=w/x;_?P=e.ceil(P):P=e.max((P|0)-this._minBufferSize,0);var D=P*R,N=e.min(D*4,w);if(D){for(var L=0;L{p();(function(t,e){typeof S9e=="object"?uGr.exports=S9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(S9e,function(t){return(function(e){var r=t,n=r.lib,o=n.Base,s=n.WordArray,c=r.x64={},l=c.Word=o.extend({init:a(function(d,f){this.high=d,this.low=f},"init")}),u=c.WordArray=o.extend({init:a(function(d,f){d=this.words=d||[],f!=e?this.sigBytes=f:this.sigBytes=d.length*8},"init"),toX32:a(function(){for(var d=this.words,f=d.length,h=[],m=0;m{p();(function(t,e){typeof T9e=="object"?dGr.exports=T9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(T9e,function(t){return(function(){if(typeof ArrayBuffer=="function"){var e=t,r=e.lib,n=r.WordArray,o=n.init,s=n.init=function(c){if(c instanceof ArrayBuffer&&(c=new Uint8Array(c)),(c instanceof Int8Array||typeof Uint8ClampedArray<"u"&&c instanceof Uint8ClampedArray||c instanceof Int16Array||c instanceof Uint16Array||c instanceof Int32Array||c instanceof Uint32Array||c instanceof Float32Array||c instanceof Float64Array)&&(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),c instanceof Uint8Array){for(var l=c.byteLength,u=[],d=0;d>>2]|=c[d]<<24-d%4*8;o.call(this,u,l)}else o.apply(this,arguments)};s.prototype=n}})(),t.lib.WordArray})});var hGr=I((I9e,pGr)=>{p();(function(t,e){typeof I9e=="object"?pGr.exports=I9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(I9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Utf16=o.Utf16BE={stringify:a(function(l){for(var u=l.words,d=l.sigBytes,f=[],h=0;h>>2]>>>16-h%4*8&65535;f.push(String.fromCharCode(m))}return f.join("")},"stringify"),parse:a(function(l){for(var u=l.length,d=[],f=0;f>>1]|=l.charCodeAt(f)<<16-f%2*16;return n.create(d,u*2)},"parse")};o.Utf16LE={stringify:a(function(l){for(var u=l.words,d=l.sigBytes,f=[],h=0;h>>2]>>>16-h%4*8&65535);f.push(String.fromCharCode(m))}return f.join("")},"stringify"),parse:a(function(l){for(var u=l.length,d=[],f=0;f>>1]|=c(l.charCodeAt(f)<<16-f%2*16);return n.create(d,u*2)},"parse")};function c(l){return l<<8&4278255360|l>>>8&16711935}a(c,"swapEndian")})(),t.enc.Utf16})});var vU=I((x9e,mGr)=>{p();(function(t,e){typeof x9e=="object"?mGr.exports=x9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(x9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Base64={stringify:a(function(l){var u=l.words,d=l.sigBytes,f=this._map;l.clamp();for(var h=[],m=0;m>>2]>>>24-m%4*8&255,A=u[m+1>>>2]>>>24-(m+1)%4*8&255,y=u[m+2>>>2]>>>24-(m+2)%4*8&255,E=g<<16|A<<8|y,_=0;_<4&&m+_*.75>>6*(3-_)&63));var v=f.charAt(64);if(v)for(;h.length%4;)h.push(v);return h.join("")},"stringify"),parse:a(function(l){var u=l.length,d=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var h=0;h>>6-m%4*2,y=g|A;f[h>>>2]|=y<<24-h%4*8,h++}return n.create(f,h)}a(c,"parseLoop")})(),t.enc.Base64})});var AGr=I((w9e,gGr)=>{p();(function(t,e){typeof w9e=="object"?gGr.exports=w9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(w9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Base64url={stringify:a(function(l,u){u===void 0&&(u=!0);var d=l.words,f=l.sigBytes,h=u?this._safe_map:this._map;l.clamp();for(var m=[],g=0;g>>2]>>>24-g%4*8&255,y=d[g+1>>>2]>>>24-(g+1)%4*8&255,E=d[g+2>>>2]>>>24-(g+2)%4*8&255,_=A<<16|y<<8|E,v=0;v<4&&g+v*.75>>6*(3-v)&63));var b=h.charAt(64);if(b)for(;m.length%4;)m.push(b);return m.join("")},"stringify"),parse:a(function(l,u){u===void 0&&(u=!0);var d=l.length,f=u?this._safe_map:this._map,h=this._reverseMap;if(!h){h=this._reverseMap=[];for(var m=0;m>>6-m%4*2,y=g|A;f[h>>>2]|=y<<24-h%4*8,h++}return n.create(f,h)}a(c,"parseLoop")})(),t.enc.Base64url})});var CU=I((R9e,yGr)=>{p();(function(t,e){typeof R9e=="object"?yGr.exports=R9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(R9e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=[];(function(){for(var g=0;g<64;g++)l[g]=e.abs(e.sin(g+1))*4294967296|0})();var u=c.MD5=s.extend({_doReset:a(function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},"_doReset"),_doProcessBlock:a(function(g,A){for(var y=0;y<16;y++){var E=A+y,_=g[E];g[E]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360}var v=this._hash.words,b=g[A+0],T=g[A+1],w=g[A+2],R=g[A+3],x=g[A+4],P=g[A+5],D=g[A+6],N=g[A+7],L=g[A+8],B=g[A+9],j=g[A+10],M=g[A+11],O=g[A+12],U=g[A+13],q=g[A+14],Q=g[A+15],Y=v[0],W=v[1],V=v[2],z=v[3];Y=d(Y,W,V,z,b,7,l[0]),z=d(z,Y,W,V,T,12,l[1]),V=d(V,z,Y,W,w,17,l[2]),W=d(W,V,z,Y,R,22,l[3]),Y=d(Y,W,V,z,x,7,l[4]),z=d(z,Y,W,V,P,12,l[5]),V=d(V,z,Y,W,D,17,l[6]),W=d(W,V,z,Y,N,22,l[7]),Y=d(Y,W,V,z,L,7,l[8]),z=d(z,Y,W,V,B,12,l[9]),V=d(V,z,Y,W,j,17,l[10]),W=d(W,V,z,Y,M,22,l[11]),Y=d(Y,W,V,z,O,7,l[12]),z=d(z,Y,W,V,U,12,l[13]),V=d(V,z,Y,W,q,17,l[14]),W=d(W,V,z,Y,Q,22,l[15]),Y=f(Y,W,V,z,T,5,l[16]),z=f(z,Y,W,V,D,9,l[17]),V=f(V,z,Y,W,M,14,l[18]),W=f(W,V,z,Y,b,20,l[19]),Y=f(Y,W,V,z,P,5,l[20]),z=f(z,Y,W,V,j,9,l[21]),V=f(V,z,Y,W,Q,14,l[22]),W=f(W,V,z,Y,x,20,l[23]),Y=f(Y,W,V,z,B,5,l[24]),z=f(z,Y,W,V,q,9,l[25]),V=f(V,z,Y,W,R,14,l[26]),W=f(W,V,z,Y,L,20,l[27]),Y=f(Y,W,V,z,U,5,l[28]),z=f(z,Y,W,V,w,9,l[29]),V=f(V,z,Y,W,N,14,l[30]),W=f(W,V,z,Y,O,20,l[31]),Y=h(Y,W,V,z,P,4,l[32]),z=h(z,Y,W,V,L,11,l[33]),V=h(V,z,Y,W,M,16,l[34]),W=h(W,V,z,Y,q,23,l[35]),Y=h(Y,W,V,z,T,4,l[36]),z=h(z,Y,W,V,x,11,l[37]),V=h(V,z,Y,W,N,16,l[38]),W=h(W,V,z,Y,j,23,l[39]),Y=h(Y,W,V,z,U,4,l[40]),z=h(z,Y,W,V,b,11,l[41]),V=h(V,z,Y,W,R,16,l[42]),W=h(W,V,z,Y,D,23,l[43]),Y=h(Y,W,V,z,B,4,l[44]),z=h(z,Y,W,V,O,11,l[45]),V=h(V,z,Y,W,Q,16,l[46]),W=h(W,V,z,Y,w,23,l[47]),Y=m(Y,W,V,z,b,6,l[48]),z=m(z,Y,W,V,N,10,l[49]),V=m(V,z,Y,W,q,15,l[50]),W=m(W,V,z,Y,P,21,l[51]),Y=m(Y,W,V,z,O,6,l[52]),z=m(z,Y,W,V,R,10,l[53]),V=m(V,z,Y,W,j,15,l[54]),W=m(W,V,z,Y,T,21,l[55]),Y=m(Y,W,V,z,L,6,l[56]),z=m(z,Y,W,V,Q,10,l[57]),V=m(V,z,Y,W,D,15,l[58]),W=m(W,V,z,Y,U,21,l[59]),Y=m(Y,W,V,z,x,6,l[60]),z=m(z,Y,W,V,M,10,l[61]),V=m(V,z,Y,W,w,15,l[62]),W=m(W,V,z,Y,B,21,l[63]),v[0]=v[0]+Y|0,v[1]=v[1]+W|0,v[2]=v[2]+V|0,v[3]=v[3]+z|0},"_doProcessBlock"),_doFinalize:a(function(){var g=this._data,A=g.words,y=this._nDataBytes*8,E=g.sigBytes*8;A[E>>>5]|=128<<24-E%32;var _=e.floor(y/4294967296),v=y;A[(E+64>>>9<<4)+15]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,A[(E+64>>>9<<4)+14]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,g.sigBytes=(A.length+1)*4,this._process();for(var b=this._hash,T=b.words,w=0;w<4;w++){var R=T[w];T[w]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360}return b},"_doFinalize"),clone:a(function(){var g=s.clone.call(this);return g._hash=this._hash.clone(),g},"clone")});function d(g,A,y,E,_,v,b){var T=g+(A&y|~A&E)+_+b;return(T<>>32-v)+A}a(d,"FF");function f(g,A,y,E,_,v,b){var T=g+(A&E|y&~E)+_+b;return(T<>>32-v)+A}a(f,"GG");function h(g,A,y,E,_,v,b){var T=g+(A^y^E)+_+b;return(T<>>32-v)+A}a(h,"HH");function m(g,A,y,E,_,v,b){var T=g+(y^(A|~E))+_+b;return(T<>>32-v)+A}a(m,"II"),r.MD5=s._createHelper(u),r.HmacMD5=s._createHmacHelper(u)})(Math),t.MD5})});var PPt=I((k9e,EGr)=>{p();(function(t,e){typeof k9e=="object"?EGr.exports=k9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(k9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=r.Hasher,s=e.algo,c=[],l=s.SHA1=o.extend({_doReset:a(function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:a(function(u,d){for(var f=this._hash.words,h=f[0],m=f[1],g=f[2],A=f[3],y=f[4],E=0;E<80;E++){if(E<16)c[E]=u[d+E]|0;else{var _=c[E-3]^c[E-8]^c[E-14]^c[E-16];c[E]=_<<1|_>>>31}var v=(h<<5|h>>>27)+y+c[E];E<20?v+=(m&g|~m&A)+1518500249:E<40?v+=(m^g^A)+1859775393:E<60?v+=(m&g|m&A|g&A)-1894007588:v+=(m^g^A)-899497514,y=A,A=g,g=m<<30|m>>>2,m=h,h=v}f[0]=f[0]+h|0,f[1]=f[1]+m|0,f[2]=f[2]+g|0,f[3]=f[3]+A|0,f[4]=f[4]+y|0},"_doProcessBlock"),_doFinalize:a(function(){var u=this._data,d=u.words,f=this._nDataBytes*8,h=u.sigBytes*8;return d[h>>>5]|=128<<24-h%32,d[(h+64>>>9<<4)+14]=Math.floor(f/4294967296),d[(h+64>>>9<<4)+15]=f,u.sigBytes=d.length*4,this._process(),this._hash},"_doFinalize"),clone:a(function(){var u=o.clone.call(this);return u._hash=this._hash.clone(),u},"clone")});e.SHA1=o._createHelper(l),e.HmacSHA1=o._createHmacHelper(l)})(),t.SHA1})});var D9e=I((P9e,_Gr)=>{p();(function(t,e){typeof P9e=="object"?_Gr.exports=P9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(P9e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=[],u=[];(function(){function h(y){for(var E=e.sqrt(y),_=2;_<=E;_++)if(!(y%_))return!1;return!0}a(h,"isPrime");function m(y){return(y-(y|0))*4294967296|0}a(m,"getFractionalBits");for(var g=2,A=0;A<64;)h(g)&&(A<8&&(l[A]=m(e.pow(g,1/2))),u[A]=m(e.pow(g,1/3)),A++),g++})();var d=[],f=c.SHA256=s.extend({_doReset:a(function(){this._hash=new o.init(l.slice(0))},"_doReset"),_doProcessBlock:a(function(h,m){for(var g=this._hash.words,A=g[0],y=g[1],E=g[2],_=g[3],v=g[4],b=g[5],T=g[6],w=g[7],R=0;R<64;R++){if(R<16)d[R]=h[m+R]|0;else{var x=d[R-15],P=(x<<25|x>>>7)^(x<<14|x>>>18)^x>>>3,D=d[R-2],N=(D<<15|D>>>17)^(D<<13|D>>>19)^D>>>10;d[R]=P+d[R-7]+N+d[R-16]}var L=v&b^~v&T,B=A&y^A&E^y&E,j=(A<<30|A>>>2)^(A<<19|A>>>13)^(A<<10|A>>>22),M=(v<<26|v>>>6)^(v<<21|v>>>11)^(v<<7|v>>>25),O=w+M+L+u[R]+d[R],U=j+B;w=T,T=b,b=v,v=_+O|0,_=E,E=y,y=A,A=O+U|0}g[0]=g[0]+A|0,g[1]=g[1]+y|0,g[2]=g[2]+E|0,g[3]=g[3]+_|0,g[4]=g[4]+v|0,g[5]=g[5]+b|0,g[6]=g[6]+T|0,g[7]=g[7]+w|0},"_doProcessBlock"),_doFinalize:a(function(){var h=this._data,m=h.words,g=this._nDataBytes*8,A=h.sigBytes*8;return m[A>>>5]|=128<<24-A%32,m[(A+64>>>9<<4)+14]=e.floor(g/4294967296),m[(A+64>>>9<<4)+15]=g,h.sigBytes=m.length*4,this._process(),this._hash},"_doFinalize"),clone:a(function(){var h=s.clone.call(this);return h._hash=this._hash.clone(),h},"clone")});r.SHA256=s._createHelper(f),r.HmacSHA256=s._createHmacHelper(f)})(Math),t.SHA256})});var CGr=I((N9e,vGr)=>{p();(function(t,e,r){typeof N9e=="object"?vGr.exports=N9e=e(aa(),D9e()):typeof define=="function"&&define.amd?define(["./core","./sha256"],e):e(t.CryptoJS)})(N9e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.algo,s=o.SHA256,c=o.SHA224=s.extend({_doReset:a(function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},"_doReset"),_doFinalize:a(function(){var l=s._doFinalize.call(this);return l.sigBytes-=4,l},"_doFinalize")});e.SHA224=s._createHelper(c),e.HmacSHA224=s._createHmacHelper(c)})(),t.SHA224})});var DPt=I((M9e,bGr)=>{p();(function(t,e,r){typeof M9e=="object"?bGr.exports=M9e=e(aa(),zCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(M9e,function(t){return(function(){var e=t,r=e.lib,n=r.Hasher,o=e.x64,s=o.Word,c=o.WordArray,l=e.algo;function u(){return s.create.apply(s,arguments)}a(u,"X64Word_create");var d=[u(1116352408,3609767458),u(1899447441,602891725),u(3049323471,3964484399),u(3921009573,2173295548),u(961987163,4081628472),u(1508970993,3053834265),u(2453635748,2937671579),u(2870763221,3664609560),u(3624381080,2734883394),u(310598401,1164996542),u(607225278,1323610764),u(1426881987,3590304994),u(1925078388,4068182383),u(2162078206,991336113),u(2614888103,633803317),u(3248222580,3479774868),u(3835390401,2666613458),u(4022224774,944711139),u(264347078,2341262773),u(604807628,2007800933),u(770255983,1495990901),u(1249150122,1856431235),u(1555081692,3175218132),u(1996064986,2198950837),u(2554220882,3999719339),u(2821834349,766784016),u(2952996808,2566594879),u(3210313671,3203337956),u(3336571891,1034457026),u(3584528711,2466948901),u(113926993,3758326383),u(338241895,168717936),u(666307205,1188179964),u(773529912,1546045734),u(1294757372,1522805485),u(1396182291,2643833823),u(1695183700,2343527390),u(1986661051,1014477480),u(2177026350,1206759142),u(2456956037,344077627),u(2730485921,1290863460),u(2820302411,3158454273),u(3259730800,3505952657),u(3345764771,106217008),u(3516065817,3606008344),u(3600352804,1432725776),u(4094571909,1467031594),u(275423344,851169720),u(430227734,3100823752),u(506948616,1363258195),u(659060556,3750685593),u(883997877,3785050280),u(958139571,3318307427),u(1322822218,3812723403),u(1537002063,2003034995),u(1747873779,3602036899),u(1955562222,1575990012),u(2024104815,1125592928),u(2227730452,2716904306),u(2361852424,442776044),u(2428436474,593698344),u(2756734187,3733110249),u(3204031479,2999351573),u(3329325298,3815920427),u(3391569614,3928383900),u(3515267271,566280711),u(3940187606,3454069534),u(4118630271,4000239992),u(116418474,1914138554),u(174292421,2731055270),u(289380356,3203993006),u(460393269,320620315),u(685471733,587496836),u(852142971,1086792851),u(1017036298,365543100),u(1126000580,2618297676),u(1288033470,3409855158),u(1501505948,4234509866),u(1607167915,987167468),u(1816402316,1246189591)],f=[];(function(){for(var m=0;m<80;m++)f[m]=u()})();var h=l.SHA512=n.extend({_doReset:a(function(){this._hash=new c.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},"_doReset"),_doProcessBlock:a(function(m,g){for(var A=this._hash.words,y=A[0],E=A[1],_=A[2],v=A[3],b=A[4],T=A[5],w=A[6],R=A[7],x=y.high,P=y.low,D=E.high,N=E.low,L=_.high,B=_.low,j=v.high,M=v.low,O=b.high,U=b.low,q=T.high,Q=T.low,Y=w.high,W=w.low,V=R.high,z=R.low,ie=x,H=P,te=D,le=N,Le=L,ge=B,Oe=j,we=M,re=O,ee=U,K=q,he=Q,X=Y,de=W,qe=V,ne=z,ue=0;ue<80;ue++){var Ne,Ie,Be=f[ue];if(ue<16)Ie=Be.high=m[g+ue*2]|0,Ne=Be.low=m[g+ue*2+1]|0;else{var tt=f[ue-15],st=tt.high,_t=tt.low,kt=(st>>>1|_t<<31)^(st>>>8|_t<<24)^st>>>7,Ht=(_t>>>1|st<<31)^(_t>>>8|st<<24)^(_t>>>7|st<<25),F=f[ue-2],se=F.high,be=F.low,Fe=(se>>>19|be<<13)^(se<<3|be>>>29)^se>>>6,Ue=(be>>>19|se<<13)^(be<<3|se>>>29)^(be>>>6|se<<26),me=f[ue-7],Z=me.high,ve=me.low,Ge=f[ue-16],Qe=Ge.high,je=Ge.low;Ne=Ht+ve,Ie=kt+Z+(Ne>>>0>>0?1:0),Ne=Ne+Ue,Ie=Ie+Fe+(Ne>>>0>>0?1:0),Ne=Ne+je,Ie=Ie+Qe+(Ne>>>0>>0?1:0),Be.high=Ie,Be.low=Ne}var J=re&K^~re&X,ae=ee&he^~ee&de,Ce=ie&te^ie&Le^te&Le,Re=H&le^H&ge^le&ge,$e=(ie>>>28|H<<4)^(ie<<30|H>>>2)^(ie<<25|H>>>7),Ye=(H>>>28|ie<<4)^(H<<30|ie>>>2)^(H<<25|ie>>>7),lt=(re>>>14|ee<<18)^(re>>>18|ee<<14)^(re<<23|ee>>>9),yt=(ee>>>14|re<<18)^(ee>>>18|re<<14)^(ee<<23|re>>>9),$t=d[ue],St=$t.high,We=$t.low,ce=ne+yt,Pe=qe+lt+(ce>>>0>>0?1:0),ce=ce+ae,Pe=Pe+J+(ce>>>0>>0?1:0),ce=ce+We,Pe=Pe+St+(ce>>>0>>0?1:0),ce=ce+Ne,Pe=Pe+Ie+(ce>>>0>>0?1:0),Me=Ye+Re,ye=$e+Ce+(Me>>>0>>0?1:0);qe=X,ne=de,X=K,de=he,K=re,he=ee,ee=we+ce|0,re=Oe+Pe+(ee>>>0>>0?1:0)|0,Oe=Le,we=ge,Le=te,ge=le,te=ie,le=H,H=ce+Me|0,ie=Pe+ye+(H>>>0>>0?1:0)|0}P=y.low=P+H,y.high=x+ie+(P>>>0>>0?1:0),N=E.low=N+le,E.high=D+te+(N>>>0>>0?1:0),B=_.low=B+ge,_.high=L+Le+(B>>>0>>0?1:0),M=v.low=M+we,v.high=j+Oe+(M>>>0>>0?1:0),U=b.low=U+ee,b.high=O+re+(U>>>0>>0?1:0),Q=T.low=Q+he,T.high=q+K+(Q>>>0>>0?1:0),W=w.low=W+de,w.high=Y+X+(W>>>0>>0?1:0),z=R.low=z+ne,R.high=V+qe+(z>>>0>>0?1:0)},"_doProcessBlock"),_doFinalize:a(function(){var m=this._data,g=m.words,A=this._nDataBytes*8,y=m.sigBytes*8;g[y>>>5]|=128<<24-y%32,g[(y+128>>>10<<5)+30]=Math.floor(A/4294967296),g[(y+128>>>10<<5)+31]=A,m.sigBytes=g.length*4,this._process();var E=this._hash.toX32();return E},"_doFinalize"),clone:a(function(){var m=n.clone.call(this);return m._hash=this._hash.clone(),m},"clone"),blockSize:1024/32});e.SHA512=n._createHelper(h),e.HmacSHA512=n._createHmacHelper(h)})(),t.SHA512})});var TGr=I((O9e,SGr)=>{p();(function(t,e,r){typeof O9e=="object"?SGr.exports=O9e=e(aa(),zCe(),DPt()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],e):e(t.CryptoJS)})(O9e,function(t){return(function(){var e=t,r=e.x64,n=r.Word,o=r.WordArray,s=e.algo,c=s.SHA512,l=s.SHA384=c.extend({_doReset:a(function(){this._hash=new o.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},"_doReset"),_doFinalize:a(function(){var u=c._doFinalize.call(this);return u.sigBytes-=16,u},"_doFinalize")});e.SHA384=c._createHelper(l),e.HmacSHA384=c._createHmacHelper(l)})(),t.SHA384})});var xGr=I((L9e,IGr)=>{p();(function(t,e,r){typeof L9e=="object"?IGr.exports=L9e=e(aa(),zCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(L9e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.x64,l=c.Word,u=r.algo,d=[],f=[],h=[];(function(){for(var A=1,y=0,E=0;E<24;E++){d[A+5*y]=(E+1)*(E+2)/2%64;var _=y%5,v=(2*A+3*y)%5;A=_,y=v}for(var A=0;A<5;A++)for(var y=0;y<5;y++)f[A+5*y]=y+(2*A+3*y)%5*5;for(var b=1,T=0;T<24;T++){for(var w=0,R=0,x=0;x<7;x++){if(b&1){var P=(1<>>24)&16711935|(b<<24|b>>>8)&4278255360,T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360;var w=E[v];w.high^=T,w.low^=b}for(var R=0;R<24;R++){for(var x=0;x<5;x++){for(var P=0,D=0,N=0;N<5;N++){var w=E[x+5*N];P^=w.high,D^=w.low}var L=m[x];L.high=P,L.low=D}for(var x=0;x<5;x++)for(var B=m[(x+4)%5],j=m[(x+1)%5],M=j.high,O=j.low,P=B.high^(M<<1|O>>>31),D=B.low^(O<<1|M>>>31),N=0;N<5;N++){var w=E[x+5*N];w.high^=P,w.low^=D}for(var U=1;U<25;U++){var P,D,w=E[U],q=w.high,Q=w.low,Y=d[U];Y<32?(P=q<>>32-Y,D=Q<>>32-Y):(P=Q<>>64-Y,D=q<>>64-Y);var W=m[f[U]];W.high=P,W.low=D}var V=m[0],z=E[0];V.high=z.high,V.low=z.low;for(var x=0;x<5;x++)for(var N=0;N<5;N++){var U=x+5*N,w=E[U],ie=m[U],H=m[(x+1)%5+5*N],te=m[(x+2)%5+5*N];w.high=ie.high^~H.high&te.high,w.low=ie.low^~H.low&te.low}var w=E[0],le=h[R];w.high^=le.high,w.low^=le.low}},"_doProcessBlock"),_doFinalize:a(function(){var A=this._data,y=A.words,E=this._nDataBytes*8,_=A.sigBytes*8,v=this.blockSize*32;y[_>>>5]|=1<<24-_%32,y[(e.ceil((_+1)/v)*v>>>5)-1]|=128,A.sigBytes=y.length*4,this._process();for(var b=this._state,T=this.cfg.outputLength/8,w=T/8,R=[],x=0;x>>24)&16711935|(D<<24|D>>>8)&4278255360,N=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,R.push(N),R.push(D)}return new o.init(R,T)},"_doFinalize"),clone:a(function(){for(var A=s.clone.call(this),y=A._state=this._state.slice(0),E=0;E<25;E++)y[E]=y[E].clone();return A},"clone")});r.SHA3=s._createHelper(g),r.HmacSHA3=s._createHmacHelper(g)})(Math),t.SHA3})});var RGr=I((B9e,wGr)=>{p();(function(t,e){typeof B9e=="object"?wGr.exports=B9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(B9e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),d=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=o.create([0,1518500249,1859775393,2400959708,2840853838]),m=o.create([1352829926,1548603684,1836072691,2053994217,0]),g=c.RIPEMD160=s.extend({_doReset:a(function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:a(function(T,w){for(var R=0;R<16;R++){var x=w+R,P=T[x];T[x]=(P<<8|P>>>24)&16711935|(P<<24|P>>>8)&4278255360}var D=this._hash.words,N=h.words,L=m.words,B=l.words,j=u.words,M=d.words,O=f.words,U,q,Q,Y,W,V,z,ie,H,te;V=U=D[0],z=q=D[1],ie=Q=D[2],H=Y=D[3],te=W=D[4];for(var le,R=0;R<80;R+=1)le=U+T[w+B[R]]|0,R<16?le+=A(q,Q,Y)+N[0]:R<32?le+=y(q,Q,Y)+N[1]:R<48?le+=E(q,Q,Y)+N[2]:R<64?le+=_(q,Q,Y)+N[3]:le+=v(q,Q,Y)+N[4],le=le|0,le=b(le,M[R]),le=le+W|0,U=W,W=Y,Y=b(Q,10),Q=q,q=le,le=V+T[w+j[R]]|0,R<16?le+=v(z,ie,H)+L[0]:R<32?le+=_(z,ie,H)+L[1]:R<48?le+=E(z,ie,H)+L[2]:R<64?le+=y(z,ie,H)+L[3]:le+=A(z,ie,H)+L[4],le=le|0,le=b(le,O[R]),le=le+te|0,V=te,te=H,H=b(ie,10),ie=z,z=le;le=D[1]+Q+H|0,D[1]=D[2]+Y+te|0,D[2]=D[3]+W+V|0,D[3]=D[4]+U+z|0,D[4]=D[0]+q+ie|0,D[0]=le},"_doProcessBlock"),_doFinalize:a(function(){var T=this._data,w=T.words,R=this._nDataBytes*8,x=T.sigBytes*8;w[x>>>5]|=128<<24-x%32,w[(x+64>>>9<<4)+14]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,T.sigBytes=(w.length+1)*4,this._process();for(var P=this._hash,D=P.words,N=0;N<5;N++){var L=D[N];D[N]=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360}return P},"_doFinalize"),clone:a(function(){var T=s.clone.call(this);return T._hash=this._hash.clone(),T},"clone")});function A(T,w,R){return T^w^R}a(A,"f1");function y(T,w,R){return T&w|~T&R}a(y,"f2");function E(T,w,R){return(T|~w)^R}a(E,"f3");function _(T,w,R){return T&R|w&~R}a(_,"f4");function v(T,w,R){return T^(w|~R)}a(v,"f5");function b(T,w){return T<>>32-w}a(b,"rotl"),r.RIPEMD160=s._createHelper(g),r.HmacRIPEMD160=s._createHmacHelper(g)})(Math),t.RIPEMD160})});var U9e=I((F9e,kGr)=>{p();(function(t,e){typeof F9e=="object"?kGr.exports=F9e=e(aa()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(F9e,function(t){(function(){var e=t,r=e.lib,n=r.Base,o=e.enc,s=o.Utf8,c=e.algo,l=c.HMAC=n.extend({init:a(function(u,d){u=this._hasher=new u.init,typeof d=="string"&&(d=s.parse(d));var f=u.blockSize,h=f*4;d.sigBytes>h&&(d=u.finalize(d)),d.clamp();for(var m=this._oKey=d.clone(),g=this._iKey=d.clone(),A=m.words,y=g.words,E=0;E{p();(function(t,e,r){typeof Q9e=="object"?PGr.exports=Q9e=e(aa(),D9e(),U9e()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],e):e(t.CryptoJS)})(Q9e,function(t){return(function(){var e=t,r=e.lib,n=r.Base,o=r.WordArray,s=e.algo,c=s.SHA256,l=s.HMAC,u=s.PBKDF2=n.extend({cfg:n.extend({keySize:128/32,hasher:c,iterations:25e4}),init:a(function(d){this.cfg=this.cfg.extend(d)},"init"),compute:a(function(d,f){for(var h=this.cfg,m=l.create(h.hasher,d),g=o.create(),A=o.create([1]),y=g.words,E=A.words,_=h.keySize,v=h.iterations;y.length<_;){var b=m.update(f).finalize(A);m.reset();for(var T=b.words,w=T.length,R=b,x=1;x{p();(function(t,e,r){typeof q9e=="object"?NGr.exports=q9e=e(aa(),PPt(),U9e()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],e):e(t.CryptoJS)})(q9e,function(t){return(function(){var e=t,r=e.lib,n=r.Base,o=r.WordArray,s=e.algo,c=s.MD5,l=s.EvpKDF=n.extend({cfg:n.extend({keySize:128/32,hasher:c,iterations:1}),init:a(function(u){this.cfg=this.cfg.extend(u)},"init"),compute:a(function(u,d){for(var f,h=this.cfg,m=h.hasher.create(),g=o.create(),A=g.words,y=h.keySize,E=h.iterations;A.length{p();(function(t,e,r){typeof j9e=="object"?MGr.exports=j9e=e(aa(),dB()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],e):e(t.CryptoJS)})(j9e,function(t){t.lib.Cipher||(function(e){var r=t,n=r.lib,o=n.Base,s=n.WordArray,c=n.BufferedBlockAlgorithm,l=r.enc,u=l.Utf8,d=l.Base64,f=r.algo,h=f.EvpKDF,m=n.Cipher=c.extend({cfg:o.extend(),createEncryptor:a(function(L,B){return this.create(this._ENC_XFORM_MODE,L,B)},"createEncryptor"),createDecryptor:a(function(L,B){return this.create(this._DEC_XFORM_MODE,L,B)},"createDecryptor"),init:a(function(L,B,j){this.cfg=this.cfg.extend(j),this._xformMode=L,this._key=B,this.reset()},"init"),reset:a(function(){c.reset.call(this),this._doReset()},"reset"),process:a(function(L){return this._append(L),this._process()},"process"),finalize:a(function(L){L&&this._append(L);var B=this._doFinalize();return B},"finalize"),keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function L(B){return typeof B=="string"?N:x}return a(L,"selectCipherStrategy"),function(B){return{encrypt:a(function(j,M,O){return L(M).encrypt(B,j,M,O)},"encrypt"),decrypt:a(function(j,M,O){return L(M).decrypt(B,j,M,O)},"decrypt")}}})()}),g=n.StreamCipher=m.extend({_doFinalize:a(function(){var L=this._process(!0);return L},"_doFinalize"),blockSize:1}),A=r.mode={},y=n.BlockCipherMode=o.extend({createEncryptor:a(function(L,B){return this.Encryptor.create(L,B)},"createEncryptor"),createDecryptor:a(function(L,B){return this.Decryptor.create(L,B)},"createDecryptor"),init:a(function(L,B){this._cipher=L,this._iv=B},"init")}),E=A.CBC=(function(){var L=y.extend();L.Encryptor=L.extend({processBlock:a(function(j,M){var O=this._cipher,U=O.blockSize;B.call(this,j,M,U),O.encryptBlock(j,M),this._prevBlock=j.slice(M,M+U)},"processBlock")}),L.Decryptor=L.extend({processBlock:a(function(j,M){var O=this._cipher,U=O.blockSize,q=j.slice(M,M+U);O.decryptBlock(j,M),B.call(this,j,M,U),this._prevBlock=q},"processBlock")});function B(j,M,O){var U,q=this._iv;q?(U=q,this._iv=e):U=this._prevBlock;for(var Q=0;Q>>2]&255;L.sigBytes-=B},"unpad")},b=n.BlockCipher=m.extend({cfg:m.cfg.extend({mode:E,padding:v}),reset:a(function(){var L;m.reset.call(this);var B=this.cfg,j=B.iv,M=B.mode;this._xformMode==this._ENC_XFORM_MODE?L=M.createEncryptor:(L=M.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==L?this._mode.init(this,j&&j.words):(this._mode=L.call(M,this,j&&j.words),this._mode.__creator=L)},"reset"),_doProcessBlock:a(function(L,B){this._mode.processBlock(L,B)},"_doProcessBlock"),_doFinalize:a(function(){var L,B=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(B.pad(this._data,this.blockSize),L=this._process(!0)):(L=this._process(!0),B.unpad(L)),L},"_doFinalize"),blockSize:128/32}),T=n.CipherParams=o.extend({init:a(function(L){this.mixIn(L)},"init"),toString:a(function(L){return(L||this.formatter).stringify(this)},"toString")}),w=r.format={},R=w.OpenSSL={stringify:a(function(L){var B,j=L.ciphertext,M=L.salt;return M?B=s.create([1398893684,1701076831]).concat(M).concat(j):B=j,B.toString(d)},"stringify"),parse:a(function(L){var B,j=d.parse(L),M=j.words;return M[0]==1398893684&&M[1]==1701076831&&(B=s.create(M.slice(2,4)),M.splice(0,4),j.sigBytes-=16),T.create({ciphertext:j,salt:B})},"parse")},x=n.SerializableCipher=o.extend({cfg:o.extend({format:R}),encrypt:a(function(L,B,j,M){M=this.cfg.extend(M);var O=L.createEncryptor(j,M),U=O.finalize(B),q=O.cfg;return T.create({ciphertext:U,key:j,iv:q.iv,algorithm:L,mode:q.mode,padding:q.padding,blockSize:L.blockSize,formatter:M.format})},"encrypt"),decrypt:a(function(L,B,j,M){M=this.cfg.extend(M),B=this._parse(B,M.format);var O=L.createDecryptor(j,M).finalize(B.ciphertext);return O},"decrypt"),_parse:a(function(L,B){return typeof L=="string"?B.parse(L,this):L},"_parse")}),P=r.kdf={},D=P.OpenSSL={execute:a(function(L,B,j,M,O){if(M||(M=s.random(64/8)),O)var U=h.create({keySize:B+j,hasher:O}).compute(L,M);else var U=h.create({keySize:B+j}).compute(L,M);var q=s.create(U.words.slice(B),j*4);return U.sigBytes=B*4,T.create({key:U,iv:q,salt:M})},"execute")},N=n.PasswordBasedCipher=x.extend({cfg:x.cfg.extend({kdf:D}),encrypt:a(function(L,B,j,M){M=this.cfg.extend(M);var O=M.kdf.execute(j,L.keySize,L.ivSize,M.salt,M.hasher);M.iv=O.iv;var U=x.encrypt.call(this,L,B,O.key,M);return U.mixIn(O),U},"encrypt"),decrypt:a(function(L,B,j,M){M=this.cfg.extend(M),B=this._parse(B,M.format);var O=M.kdf.execute(j,L.keySize,L.ivSize,B.salt,M.hasher);M.iv=O.iv;var U=x.decrypt.call(this,L,B,O.key,M);return U},"decrypt")})})()})});var LGr=I((H9e,OGr)=>{p();(function(t,e,r){typeof H9e=="object"?OGr.exports=H9e=e(aa(),Wm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(H9e,function(t){return t.mode.CFB=(function(){var e=t.lib.BlockCipherMode.extend();e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize;r.call(this,n,o,c,s),this._prevBlock=n.slice(o,o+c)},"processBlock")}),e.Decryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=n.slice(o,o+c);r.call(this,n,o,c,s),this._prevBlock=l},"processBlock")});function r(n,o,s,c){var l,u=this._iv;u?(l=u.slice(0),this._iv=void 0):l=this._prevBlock,c.encryptBlock(l,0);for(var d=0;d{p();(function(t,e,r){typeof G9e=="object"?BGr.exports=G9e=e(aa(),Wm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(G9e,function(t){return t.mode.CTR=(function(){var e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=this._iv,u=this._counter;l&&(u=this._counter=l.slice(0),this._iv=void 0);var d=u.slice(0);s.encryptBlock(d,0),u[c-1]=u[c-1]+1|0;for(var f=0;f{p();(function(t,e,r){typeof $9e=="object"?UGr.exports=$9e=e(aa(),Wm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})($9e,function(t){return t.mode.CTRGladman=(function(){var e=t.lib.BlockCipherMode.extend();function r(s){if((s>>24&255)===255){var c=s>>16&255,l=s>>8&255,u=s&255;c===255?(c=0,l===255?(l=0,u===255?u=0:++u):++l):++c,s=0,s+=c<<16,s+=l<<8,s+=u}else s+=1<<24;return s}a(r,"incWord");function n(s){return(s[0]=r(s[0]))===0&&(s[1]=r(s[1])),s}a(n,"incCounter");var o=e.Encryptor=e.extend({processBlock:a(function(s,c){var l=this._cipher,u=l.blockSize,d=this._iv,f=this._counter;d&&(f=this._counter=d.slice(0),this._iv=void 0),n(f);var h=f.slice(0);l.encryptBlock(h,0);for(var m=0;m{p();(function(t,e,r){typeof V9e=="object"?qGr.exports=V9e=e(aa(),Wm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(V9e,function(t){return t.mode.OFB=(function(){var e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=this._iv,u=this._keystream;l&&(u=this._keystream=l.slice(0),this._iv=void 0),s.encryptBlock(u,0);for(var d=0;d{p();(function(t,e,r){typeof W9e=="object"?HGr.exports=W9e=e(aa(),Wm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(W9e,function(t){return t.mode.ECB=(function(){var e=t.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:a(function(r,n){this._cipher.encryptBlock(r,n)},"processBlock")}),e.Decryptor=e.extend({processBlock:a(function(r,n){this._cipher.decryptBlock(r,n)},"processBlock")}),e})(),t.mode.ECB})});var VGr=I((z9e,$Gr)=>{p();(function(t,e,r){typeof z9e=="object"?$Gr.exports=z9e=e(aa(),Wm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(z9e,function(t){return t.pad.AnsiX923={pad:a(function(e,r){var n=e.sigBytes,o=r*4,s=o-n%o,c=n+s-1;e.clamp(),e.words[c>>>2]|=s<<24-c%4*8,e.sigBytes+=s},"pad"),unpad:a(function(e){var r=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=r},"unpad")},t.pad.Ansix923})});var zGr=I((Y9e,WGr)=>{p();(function(t,e,r){typeof Y9e=="object"?WGr.exports=Y9e=e(aa(),Wm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(Y9e,function(t){return t.pad.Iso10126={pad:a(function(e,r){var n=r*4,o=n-e.sigBytes%n;e.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},"pad"),unpad:a(function(e){var r=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=r},"unpad")},t.pad.Iso10126})});var KGr=I((K9e,YGr)=>{p();(function(t,e,r){typeof K9e=="object"?YGr.exports=K9e=e(aa(),Wm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(K9e,function(t){return t.pad.Iso97971={pad:a(function(e,r){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,r)},"pad"),unpad:a(function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--},"unpad")},t.pad.Iso97971})});var ZGr=I((J9e,JGr)=>{p();(function(t,e,r){typeof J9e=="object"?JGr.exports=J9e=e(aa(),Wm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(J9e,function(t){return t.pad.ZeroPadding={pad:a(function(e,r){var n=r*4;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},"pad"),unpad:a(function(e){for(var r=e.words,n=e.sigBytes-1,n=e.sigBytes-1;n>=0;n--)if(r[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}},"unpad")},t.pad.ZeroPadding})});var e$r=I((Z9e,XGr)=>{p();(function(t,e,r){typeof Z9e=="object"?XGr.exports=Z9e=e(aa(),Wm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(Z9e,function(t){return t.pad.NoPadding={pad:a(function(){},"pad"),unpad:a(function(){},"unpad")},t.pad.NoPadding})});var r$r=I((X9e,t$r)=>{p();(function(t,e,r){typeof X9e=="object"?t$r.exports=X9e=e(aa(),Wm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(X9e,function(t){return(function(e){var r=t,n=r.lib,o=n.CipherParams,s=r.enc,c=s.Hex,l=r.format,u=l.Hex={stringify:a(function(d){return d.ciphertext.toString(c)},"stringify"),parse:a(function(d){var f=c.parse(d);return o.create({ciphertext:f})},"parse")}})(),t.format.Hex})});var i$r=I((eUe,n$r)=>{p();(function(t,e,r){typeof eUe=="object"?n$r.exports=eUe=e(aa(),vU(),CU(),dB(),Wm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(eUe,function(t){return(function(){var e=t,r=e.lib,n=r.BlockCipher,o=e.algo,s=[],c=[],l=[],u=[],d=[],f=[],h=[],m=[],g=[],A=[];(function(){for(var _=[],v=0;v<256;v++)v<128?_[v]=v<<1:_[v]=v<<1^283;for(var b=0,T=0,v=0;v<256;v++){var w=T^T<<1^T<<2^T<<3^T<<4;w=w>>>8^w&255^99,s[b]=w,c[w]=b;var R=_[b],x=_[R],P=_[x],D=_[w]*257^w*16843008;l[b]=D<<24|D>>>8,u[b]=D<<16|D>>>16,d[b]=D<<8|D>>>24,f[b]=D;var D=P*16843009^x*65537^R*257^b*16843008;h[w]=D<<24|D>>>8,m[w]=D<<16|D>>>16,g[w]=D<<8|D>>>24,A[w]=D,b?(b=R^_[_[_[P^R]]],T^=_[_[T]]):b=T=1}})();var y=[0,1,2,4,8,16,32,64,128,27,54],E=o.AES=n.extend({_doReset:a(function(){var _;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var v=this._keyPriorReset=this._key,b=v.words,T=v.sigBytes/4,w=this._nRounds=T+6,R=(w+1)*4,x=this._keySchedule=[],P=0;P6&&P%T==4&&(_=s[_>>>24]<<24|s[_>>>16&255]<<16|s[_>>>8&255]<<8|s[_&255]):(_=_<<8|_>>>24,_=s[_>>>24]<<24|s[_>>>16&255]<<16|s[_>>>8&255]<<8|s[_&255],_^=y[P/T|0]<<24),x[P]=x[P-T]^_);for(var D=this._invKeySchedule=[],N=0;N>>24]]^m[s[_>>>16&255]]^g[s[_>>>8&255]]^A[s[_&255]]}}},"_doReset"),encryptBlock:a(function(_,v){this._doCryptBlock(_,v,this._keySchedule,l,u,d,f,s)},"encryptBlock"),decryptBlock:a(function(_,v){var b=_[v+1];_[v+1]=_[v+3],_[v+3]=b,this._doCryptBlock(_,v,this._invKeySchedule,h,m,g,A,c);var b=_[v+1];_[v+1]=_[v+3],_[v+3]=b},"decryptBlock"),_doCryptBlock:a(function(_,v,b,T,w,R,x,P){for(var D=this._nRounds,N=_[v]^b[0],L=_[v+1]^b[1],B=_[v+2]^b[2],j=_[v+3]^b[3],M=4,O=1;O>>24]^w[L>>>16&255]^R[B>>>8&255]^x[j&255]^b[M++],q=T[L>>>24]^w[B>>>16&255]^R[j>>>8&255]^x[N&255]^b[M++],Q=T[B>>>24]^w[j>>>16&255]^R[N>>>8&255]^x[L&255]^b[M++],Y=T[j>>>24]^w[N>>>16&255]^R[L>>>8&255]^x[B&255]^b[M++];N=U,L=q,B=Q,j=Y}var U=(P[N>>>24]<<24|P[L>>>16&255]<<16|P[B>>>8&255]<<8|P[j&255])^b[M++],q=(P[L>>>24]<<24|P[B>>>16&255]<<16|P[j>>>8&255]<<8|P[N&255])^b[M++],Q=(P[B>>>24]<<24|P[j>>>16&255]<<16|P[N>>>8&255]<<8|P[L&255])^b[M++],Y=(P[j>>>24]<<24|P[N>>>16&255]<<16|P[L>>>8&255]<<8|P[B&255])^b[M++];_[v]=U,_[v+1]=q,_[v+2]=Q,_[v+3]=Y},"_doCryptBlock"),keySize:256/32});e.AES=n._createHelper(E)})(),t.AES})});var s$r=I((tUe,o$r)=>{p();(function(t,e,r){typeof tUe=="object"?o$r.exports=tUe=e(aa(),vU(),CU(),dB(),Wm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(tUe,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=r.BlockCipher,s=e.algo,c=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],l=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=s.DES=o.extend({_doReset:a(function(){for(var y=this._key,E=y.words,_=[],v=0;v<56;v++){var b=c[v]-1;_[v]=E[b>>>5]>>>31-b%32&1}for(var T=this._subKeys=[],w=0;w<16;w++){for(var R=T[w]=[],x=u[w],v=0;v<24;v++)R[v/6|0]|=_[(l[v]-1+x)%28]<<31-v%6,R[4+(v/6|0)]|=_[28+(l[v+24]-1+x)%28]<<31-v%6;R[0]=R[0]<<1|R[0]>>>31;for(var v=1;v<7;v++)R[v]=R[v]>>>(v-1)*4+3;R[7]=R[7]<<5|R[7]>>>27}for(var P=this._invSubKeys=[],v=0;v<16;v++)P[v]=T[15-v]},"_doReset"),encryptBlock:a(function(y,E){this._doCryptBlock(y,E,this._subKeys)},"encryptBlock"),decryptBlock:a(function(y,E){this._doCryptBlock(y,E,this._invSubKeys)},"decryptBlock"),_doCryptBlock:a(function(y,E,_){this._lBlock=y[E],this._rBlock=y[E+1],m.call(this,4,252645135),m.call(this,16,65535),g.call(this,2,858993459),g.call(this,8,16711935),m.call(this,1,1431655765);for(var v=0;v<16;v++){for(var b=_[v],T=this._lBlock,w=this._rBlock,R=0,x=0;x<8;x++)R|=d[x][((w^b[x])&f[x])>>>0];this._lBlock=w,this._rBlock=T^R}var P=this._lBlock;this._lBlock=this._rBlock,this._rBlock=P,m.call(this,1,1431655765),g.call(this,8,16711935),g.call(this,2,858993459),m.call(this,16,65535),m.call(this,4,252645135),y[E]=this._lBlock,y[E+1]=this._rBlock},"_doCryptBlock"),keySize:64/32,ivSize:64/32,blockSize:64/32});function m(y,E){var _=(this._lBlock>>>y^this._rBlock)&E;this._rBlock^=_,this._lBlock^=_<>>y^this._lBlock)&E;this._lBlock^=_,this._rBlock^=_<192.");var _=E.slice(0,2),v=E.length<4?E.slice(0,2):E.slice(2,4),b=E.length<6?E.slice(0,2):E.slice(4,6);this._des1=h.createEncryptor(n.create(_)),this._des2=h.createEncryptor(n.create(v)),this._des3=h.createEncryptor(n.create(b))},"_doReset"),encryptBlock:a(function(y,E){this._des1.encryptBlock(y,E),this._des2.decryptBlock(y,E),this._des3.encryptBlock(y,E)},"encryptBlock"),decryptBlock:a(function(y,E){this._des3.decryptBlock(y,E),this._des2.encryptBlock(y,E),this._des1.decryptBlock(y,E)},"decryptBlock"),keySize:192/32,ivSize:64/32,blockSize:64/32});e.TripleDES=o._createHelper(A)})(),t.TripleDES})});var c$r=I((rUe,a$r)=>{p();(function(t,e,r){typeof rUe=="object"?a$r.exports=rUe=e(aa(),vU(),CU(),dB(),Wm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(rUe,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=o.RC4=n.extend({_doReset:a(function(){for(var u=this._key,d=u.words,f=u.sigBytes,h=this._S=[],m=0;m<256;m++)h[m]=m;for(var m=0,g=0;m<256;m++){var A=m%f,y=d[A>>>2]>>>24-A%4*8&255;g=(g+h[m]+y)%256;var E=h[m];h[m]=h[g],h[g]=E}this._i=this._j=0},"_doReset"),_doProcessBlock:a(function(u,d){u[d]^=c.call(this)},"_doProcessBlock"),keySize:256/32,ivSize:0});function c(){for(var u=this._S,d=this._i,f=this._j,h=0,m=0;m<4;m++){d=(d+1)%256,f=(f+u[d])%256;var g=u[d];u[d]=u[f],u[f]=g,h|=u[(u[d]+u[f])%256]<<24-m*8}return this._i=d,this._j=f,h}a(c,"generateKeystreamWord"),e.RC4=n._createHelper(s);var l=o.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:a(function(){s._doReset.call(this);for(var u=this.cfg.drop;u>0;u--)c.call(this)},"_doReset")});e.RC4Drop=n._createHelper(l)})(),t.RC4})});var u$r=I((nUe,l$r)=>{p();(function(t,e,r){typeof nUe=="object"?l$r.exports=nUe=e(aa(),vU(),CU(),dB(),Wm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(nUe,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=[],c=[],l=[],u=o.Rabbit=n.extend({_doReset:a(function(){for(var f=this._key.words,h=this.cfg.iv,m=0;m<4;m++)f[m]=(f[m]<<8|f[m]>>>24)&16711935|(f[m]<<24|f[m]>>>8)&4278255360;var g=this._X=[f[0],f[3]<<16|f[2]>>>16,f[1],f[0]<<16|f[3]>>>16,f[2],f[1]<<16|f[0]>>>16,f[3],f[2]<<16|f[1]>>>16],A=this._C=[f[2]<<16|f[2]>>>16,f[0]&4294901760|f[1]&65535,f[3]<<16|f[3]>>>16,f[1]&4294901760|f[2]&65535,f[0]<<16|f[0]>>>16,f[2]&4294901760|f[3]&65535,f[1]<<16|f[1]>>>16,f[3]&4294901760|f[0]&65535];this._b=0;for(var m=0;m<4;m++)d.call(this);for(var m=0;m<8;m++)A[m]^=g[m+4&7];if(h){var y=h.words,E=y[0],_=y[1],v=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,b=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,T=v>>>16|b&4294901760,w=b<<16|v&65535;A[0]^=v,A[1]^=T,A[2]^=b,A[3]^=w,A[4]^=v,A[5]^=T,A[6]^=b,A[7]^=w;for(var m=0;m<4;m++)d.call(this)}},"_doReset"),_doProcessBlock:a(function(f,h){var m=this._X;d.call(this),s[0]=m[0]^m[5]>>>16^m[3]<<16,s[1]=m[2]^m[7]>>>16^m[5]<<16,s[2]=m[4]^m[1]>>>16^m[7]<<16,s[3]=m[6]^m[3]>>>16^m[1]<<16;for(var g=0;g<4;g++)s[g]=(s[g]<<8|s[g]>>>24)&16711935|(s[g]<<24|s[g]>>>8)&4278255360,f[h+g]^=s[g]},"_doProcessBlock"),blockSize:128/32,ivSize:64/32});function d(){for(var f=this._X,h=this._C,m=0;m<8;m++)c[m]=h[m];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var m=0;m<8;m++){var g=f[m]+h[m],A=g&65535,y=g>>>16,E=((A*A>>>17)+A*y>>>15)+y*y,_=((g&4294901760)*g|0)+((g&65535)*g|0);l[m]=E^_}f[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,f[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,f[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,f[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,f[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,f[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,f[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,f[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}a(d,"nextState"),e.Rabbit=n._createHelper(u)})(),t.Rabbit})});var f$r=I((iUe,d$r)=>{p();(function(t,e,r){typeof iUe=="object"?d$r.exports=iUe=e(aa(),vU(),CU(),dB(),Wm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(iUe,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=[],c=[],l=[],u=o.RabbitLegacy=n.extend({_doReset:a(function(){var f=this._key.words,h=this.cfg.iv,m=this._X=[f[0],f[3]<<16|f[2]>>>16,f[1],f[0]<<16|f[3]>>>16,f[2],f[1]<<16|f[0]>>>16,f[3],f[2]<<16|f[1]>>>16],g=this._C=[f[2]<<16|f[2]>>>16,f[0]&4294901760|f[1]&65535,f[3]<<16|f[3]>>>16,f[1]&4294901760|f[2]&65535,f[0]<<16|f[0]>>>16,f[2]&4294901760|f[3]&65535,f[1]<<16|f[1]>>>16,f[3]&4294901760|f[0]&65535];this._b=0;for(var A=0;A<4;A++)d.call(this);for(var A=0;A<8;A++)g[A]^=m[A+4&7];if(h){var y=h.words,E=y[0],_=y[1],v=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,b=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,T=v>>>16|b&4294901760,w=b<<16|v&65535;g[0]^=v,g[1]^=T,g[2]^=b,g[3]^=w,g[4]^=v,g[5]^=T,g[6]^=b,g[7]^=w;for(var A=0;A<4;A++)d.call(this)}},"_doReset"),_doProcessBlock:a(function(f,h){var m=this._X;d.call(this),s[0]=m[0]^m[5]>>>16^m[3]<<16,s[1]=m[2]^m[7]>>>16^m[5]<<16,s[2]=m[4]^m[1]>>>16^m[7]<<16,s[3]=m[6]^m[3]>>>16^m[1]<<16;for(var g=0;g<4;g++)s[g]=(s[g]<<8|s[g]>>>24)&16711935|(s[g]<<24|s[g]>>>8)&4278255360,f[h+g]^=s[g]},"_doProcessBlock"),blockSize:128/32,ivSize:64/32});function d(){for(var f=this._X,h=this._C,m=0;m<8;m++)c[m]=h[m];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var m=0;m<8;m++){var g=f[m]+h[m],A=g&65535,y=g>>>16,E=((A*A>>>17)+A*y>>>15)+y*y,_=((g&4294901760)*g|0)+((g&65535)*g|0);l[m]=E^_}f[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,f[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,f[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,f[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,f[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,f[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,f[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,f[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}a(d,"nextState"),e.RabbitLegacy=n._createHelper(u)})(),t.RabbitLegacy})});var h$r=I((oUe,p$r)=>{p();(function(t,e,r){typeof oUe=="object"?p$r.exports=oUe=e(aa(),vU(),CU(),dB(),Wm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(oUe,function(t){return(function(){var e=t,r=e.lib,n=r.BlockCipher,o=e.algo;let s=16,c=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],l=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var u={pbox:[],sbox:[]};function d(A,y){let E=y>>24&255,_=y>>16&255,v=y>>8&255,b=y&255,T=A.sbox[0][E]+A.sbox[1][_];return T=T^A.sbox[2][v],T=T+A.sbox[3][b],T}a(d,"F");function f(A,y,E){let _=y,v=E,b;for(let T=0;T1;--T)_=_^A.pbox[T],v=d(A,_)^v,b=_,_=v,v=b;return b=_,_=v,v=b,v=v^A.pbox[1],_=_^A.pbox[0],{left:_,right:v}}a(h,"BlowFish_Decrypt");function m(A,y,E){for(let w=0;w<4;w++){A.sbox[w]=[];for(let R=0;R<256;R++)A.sbox[w][R]=l[w][R]}let _=0;for(let w=0;w=E&&(_=0);let v=0,b=0,T=0;for(let w=0;w{p();(function(t,e,r){typeof sUe=="object"?m$r.exports=sUe=e(aa(),zCe(),fGr(),hGr(),vU(),AGr(),CU(),PPt(),D9e(),CGr(),DPt(),TGr(),xGr(),RGr(),U9e(),DGr(),dB(),Wm(),LGr(),FGr(),QGr(),jGr(),GGr(),VGr(),zGr(),KGr(),ZGr(),e$r(),r$r(),i$r(),s$r(),c$r(),u$r(),f$r(),h$r()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./enc-base64url","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy","./blowfish"],e):t.CryptoJS=e(t.CryptoJS)})(sUe,function(t){return t})});var lse=I($y=>{"use strict";p();Object.defineProperty($y,"__esModule",{value:!0});$y.stringArray=$y.array=$y.func=$y.error=$y.number=$y.string=$y.boolean=void 0;function vEo(t){return t===!0||t===!1}a(vEo,"boolean");$y.boolean=vEo;function JWr(t){return typeof t=="string"||t instanceof String}a(JWr,"string");$y.string=JWr;function CEo(t){return typeof t=="number"||t instanceof Number}a(CEo,"number");$y.number=CEo;function bEo(t){return t instanceof Error}a(bEo,"error");$y.error=bEo;function SEo(t){return typeof t=="function"}a(SEo,"func");$y.func=SEo;function ZWr(t){return Array.isArray(t)}a(ZWr,"array");$y.array=ZWr;function TEo(t){return ZWr(t)&&t.every(e=>JWr(e))}a(TEo,"stringArray");$y.stringArray=TEo});var nDt=I(pi=>{"use strict";p();Object.defineProperty(pi,"__esModule",{value:!0});pi.Message=pi.NotificationType9=pi.NotificationType8=pi.NotificationType7=pi.NotificationType6=pi.NotificationType5=pi.NotificationType4=pi.NotificationType3=pi.NotificationType2=pi.NotificationType1=pi.NotificationType0=pi.NotificationType=pi.RequestType9=pi.RequestType8=pi.RequestType7=pi.RequestType6=pi.RequestType5=pi.RequestType4=pi.RequestType3=pi.RequestType2=pi.RequestType1=pi.RequestType=pi.RequestType0=pi.AbstractMessageSignature=pi.ParameterStructures=pi.ResponseError=pi.ErrorCodes=void 0;var YW=lse(),N2t;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(N2t||(pi.ErrorCodes=N2t={}));var M2t=class t extends Error{static{a(this,"ResponseError")}constructor(e,r,n){super(r),this.code=YW.number(e)?e:N2t.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};pi.ResponseError=M2t;var dC=class t{static{a(this,"ParameterStructures")}constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};pi.ParameterStructures=dC;dC.auto=new dC("auto");dC.byPosition=new dC("byPosition");dC.byName=new dC("byName");var Vu=class{static{a(this,"AbstractMessageSignature")}constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return dC.auto}};pi.AbstractMessageSignature=Vu;var O2t=class extends Vu{static{a(this,"RequestType0")}constructor(e){super(e,0)}};pi.RequestType0=O2t;var L2t=class extends Vu{static{a(this,"RequestType")}constructor(e,r=dC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.RequestType=L2t;var B2t=class extends Vu{static{a(this,"RequestType1")}constructor(e,r=dC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.RequestType1=B2t;var F2t=class extends Vu{static{a(this,"RequestType2")}constructor(e){super(e,2)}};pi.RequestType2=F2t;var U2t=class extends Vu{static{a(this,"RequestType3")}constructor(e){super(e,3)}};pi.RequestType3=U2t;var Q2t=class extends Vu{static{a(this,"RequestType4")}constructor(e){super(e,4)}};pi.RequestType4=Q2t;var q2t=class extends Vu{static{a(this,"RequestType5")}constructor(e){super(e,5)}};pi.RequestType5=q2t;var j2t=class extends Vu{static{a(this,"RequestType6")}constructor(e){super(e,6)}};pi.RequestType6=j2t;var H2t=class extends Vu{static{a(this,"RequestType7")}constructor(e){super(e,7)}};pi.RequestType7=H2t;var G2t=class extends Vu{static{a(this,"RequestType8")}constructor(e){super(e,8)}};pi.RequestType8=G2t;var $2t=class extends Vu{static{a(this,"RequestType9")}constructor(e){super(e,9)}};pi.RequestType9=$2t;var V2t=class extends Vu{static{a(this,"NotificationType")}constructor(e,r=dC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.NotificationType=V2t;var W2t=class extends Vu{static{a(this,"NotificationType0")}constructor(e){super(e,0)}};pi.NotificationType0=W2t;var z2t=class extends Vu{static{a(this,"NotificationType1")}constructor(e,r=dC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};pi.NotificationType1=z2t;var Y2t=class extends Vu{static{a(this,"NotificationType2")}constructor(e){super(e,2)}};pi.NotificationType2=Y2t;var K2t=class extends Vu{static{a(this,"NotificationType3")}constructor(e){super(e,3)}};pi.NotificationType3=K2t;var J2t=class extends Vu{static{a(this,"NotificationType4")}constructor(e){super(e,4)}};pi.NotificationType4=J2t;var Z2t=class extends Vu{static{a(this,"NotificationType5")}constructor(e){super(e,5)}};pi.NotificationType5=Z2t;var X2t=class extends Vu{static{a(this,"NotificationType6")}constructor(e){super(e,6)}};pi.NotificationType6=X2t;var eDt=class extends Vu{static{a(this,"NotificationType7")}constructor(e){super(e,7)}};pi.NotificationType7=eDt;var tDt=class extends Vu{static{a(this,"NotificationType8")}constructor(e){super(e,8)}};pi.NotificationType8=tDt;var rDt=class extends Vu{static{a(this,"NotificationType9")}constructor(e){super(e,9)}};pi.NotificationType9=rDt;var XWr;(function(t){function e(o){let s=o;return s&&YW.string(s.method)&&(YW.string(s.id)||YW.number(s.id))}a(e,"isRequest"),t.isRequest=e;function r(o){let s=o;return s&&YW.string(s.method)&&o.id===void 0}a(r,"isNotification"),t.isNotification=r;function n(o){let s=o;return s&&(s.result!==void 0||!!s.error)&&(YW.string(s.id)||YW.number(s.id)||s.id===null)}a(n,"isResponse"),t.isResponse=n})(XWr||(pi.Message=XWr={}))});var oDt=I(BU=>{"use strict";p();var ezr;Object.defineProperty(BU,"__esModule",{value:!0});BU.LRUCache=BU.LinkedMap=BU.Touch=void 0;var Vy;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Vy||(BU.Touch=Vy={}));var jUe=class{static{a(this,"LinkedMap")}constructor(){this[ezr]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=Vy.None){let n=this._map.get(e);if(n)return r!==Vy.None&&this.touch(n,r),n.value}set(e,r,n=Vy.None){let o=this._map.get(e);if(o)o.value=r,n!==Vy.None&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case Vy.None:this.addItemLast(o);break;case Vy.First:this.addItemFirst(o);break;case Vy.Last:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.key,done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.value,done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:[r.key,r.value],done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}[(ezr=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==Vy.First&&r!==Vy.Last)){if(r===Vy.First){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===Vy.Last){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};BU.LinkedMap=jUe;var iDt=class extends jUe{static{a(this,"LRUCache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=Vy.AsNew){return super.get(e,r)}peek(e){return super.get(e,Vy.None)}set(e,r){return super.set(e,r,Vy.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};BU.LRUCache=iDt});var rzr=I(HUe=>{"use strict";p();Object.defineProperty(HUe,"__esModule",{value:!0});HUe.Disposable=void 0;var tzr;(function(t){function e(r){return{dispose:r}}a(e,"create"),t.create=e})(tzr||(HUe.Disposable=tzr={}))});var FU=I(cDt=>{"use strict";p();Object.defineProperty(cDt,"__esModule",{value:!0});var sDt;function aDt(){if(sDt===void 0)throw new Error("No runtime abstraction layer installed");return sDt}a(aDt,"RAL");(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");sDt=r}a(e,"install"),t.install=e})(aDt||(aDt={}));cDt.default=aDt});var dse=I(use=>{"use strict";p();Object.defineProperty(use,"__esModule",{value:!0});use.Emitter=use.Event=void 0;var IEo=FU(),nzr;(function(t){let e={dispose(){}};t.None=function(){return e}})(nzr||(use.Event=nzr={}));var lDt=class{static{a(this,"CallbackList")}add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:a(()=>this.remove(e,r),"dispose")})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let o=0,s=this._callbacks.length;o{this._callbacks||(this._callbacks=new lDt),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let o={dispose:a(()=>{this._callbacks&&(this._callbacks.remove(e,r),o.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(n)&&n.push(o),o}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};use.Emitter=GUe;GUe._noop=function(){}});var WUe=I(fse=>{"use strict";p();Object.defineProperty(fse,"__esModule",{value:!0});fse.CancellationTokenSource=fse.CancellationToken=void 0;var xEo=FU(),wEo=lse(),uDt=dse(),$Ue;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:uDt.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:uDt.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||wEo.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}a(e,"is"),t.is=e})($Ue||(fse.CancellationToken=$Ue={}));var REo=Object.freeze(function(t,e){let r=(0,xEo.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),VUe=class{static{a(this,"MutableToken")}constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?REo:(this._emitter||(this._emitter=new uDt.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},dDt=class{static{a(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new VUe),this._token}cancel(){this._token?this._token.cancel():this._token=$Ue.Cancelled}dispose(){this._token?this._token instanceof VUe&&this._token.dispose():this._token=$Ue.None}};fse.CancellationTokenSource=dDt});var izr=I(pse=>{"use strict";p();Object.defineProperty(pse,"__esModule",{value:!0});pse.SharedArrayReceiverStrategy=pse.SharedArraySenderStrategy=void 0;var kEo=WUe(),hbe;(function(t){t.Continue=0,t.Cancelled=1})(hbe||(hbe={}));var fDt=class{static{a(this,"SharedArraySenderStrategy")}constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=hbe.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let o=new Int32Array(n,0,1);Atomics.store(o,0,hbe.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};pse.SharedArraySenderStrategy=fDt;var pDt=class{static{a(this,"SharedArrayBufferCancellationToken")}constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===hbe.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},hDt=class{static{a(this,"SharedArrayBufferCancellationTokenSource")}constructor(e){this.token=new pDt(e)}cancel(){}dispose(){}},mDt=class{static{a(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new kEo.CancellationTokenSource:new hDt(r)}};pse.SharedArrayReceiverStrategy=mDt});var ADt=I(zUe=>{"use strict";p();Object.defineProperty(zUe,"__esModule",{value:!0});zUe.Semaphore=void 0;var PEo=FU(),gDt=class{static{a(this,"Semaphore")}constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,PEo.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};zUe.Semaphore=gDt});var szr=I(UU=>{"use strict";p();Object.defineProperty(UU,"__esModule",{value:!0});UU.ReadableStreamMessageReader=UU.AbstractMessageReader=UU.MessageReader=void 0;var EDt=FU(),hse=lse(),yDt=dse(),DEo=ADt(),ozr;(function(t){function e(r){let n=r;return n&&hse.func(n.listen)&&hse.func(n.dispose)&&hse.func(n.onError)&&hse.func(n.onClose)&&hse.func(n.onPartialMessage)}a(e,"is"),t.is=e})(ozr||(UU.MessageReader=ozr={}));var YUe=class{static{a(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new yDt.Emitter,this.closeEmitter=new yDt.Emitter,this.partialMessageEmitter=new yDt.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${hse.string(e.message)?e.message:"unknown"}`)}};UU.AbstractMessageReader=YUe;var _Dt;(function(t){function e(r){let n,o,s,c=new Map,l,u=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,c.set(s.name,s)),r.contentDecoders!==void 0)for(let d of r.contentDecoders)c.set(d.name,d);if(r.contentTypeDecoder!==void 0&&(l=r.contentTypeDecoder,u.set(l.name,l)),r.contentTypeDecoders!==void 0)for(let d of r.contentTypeDecoders)u.set(d.name,d)}return l===void 0&&(l=(0,EDt.default)().applicationJson.decoder,u.set(l.name,l)),{charset:n,contentDecoder:s,contentDecoders:c,contentTypeDecoder:l,contentTypeDecoders:u}}a(e,"fromOptions"),t.fromOptions=e})(_Dt||(_Dt={}));var vDt=class extends YUe{static{a(this,"ReadableStreamMessageReader")}constructor(e,r){super(),this.readable=e,this.options=_Dt.fromOptions(r),this.buffer=(0,EDt.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new DEo.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let o=n.get("content-length");if(!o){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(o);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${o}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,o=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(o)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,EDt.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};UU.ReadableStreamMessageReader=vDt});var dzr=I(QU=>{"use strict";p();Object.defineProperty(QU,"__esModule",{value:!0});QU.WriteableStreamMessageWriter=QU.AbstractMessageWriter=QU.MessageWriter=void 0;var azr=FU(),mbe=lse(),NEo=ADt(),czr=dse(),MEo="Content-Length: ",lzr=`\r +`,uzr;(function(t){function e(r){let n=r;return n&&mbe.func(n.dispose)&&mbe.func(n.onClose)&&mbe.func(n.onError)&&mbe.func(n.write)}a(e,"is"),t.is=e})(uzr||(QU.MessageWriter=uzr={}));var KUe=class{static{a(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new czr.Emitter,this.closeEmitter=new czr.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${mbe.string(e.message)?e.message:"unknown"}`)}};QU.AbstractMessageWriter=KUe;var CDt;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,azr.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,azr.default)().applicationJson.encoder}}a(e,"fromOptions"),t.fromOptions=e})(CDt||(CDt={}));var bDt=class extends KUe{static{a(this,"WriteableStreamMessageWriter")}constructor(e,r){super(),this.writable=e,this.options=CDt.fromOptions(r),this.errorCount=0,this.writeSemaphore=new NEo.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let o=[];return o.push(MEo,n.byteLength.toString(),lzr),o.push(lzr),this.doWrite(e,o,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(o){return this.handleError(o,e),Promise.reject(o)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};QU.WriteableStreamMessageWriter=bDt});var fzr=I(JUe=>{"use strict";p();Object.defineProperty(JUe,"__esModule",{value:!0});JUe.AbstractMessageBuffer=void 0;var OEo=13,LEo=10,BEo=`\r +`,SDt=class{static{a(this,"AbstractMessageBuffer")}constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,o=0,s=0;e:for(;nthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],c=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,c}let r=this.allocNative(e),n=0,o=0;for(;e>0;){let s=this._chunks[o];if(s.byteLength>e){let c=s.slice(0,e);r.set(c,n),n+=e,this._chunks[o]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};JUe.AbstractMessageBuffer=SDt});var Azr=I(Oo=>{"use strict";p();Object.defineProperty(Oo,"__esModule",{value:!0});Oo.createMessageConnection=Oo.ConnectionOptions=Oo.MessageStrategy=Oo.CancellationStrategy=Oo.CancellationSenderStrategy=Oo.CancellationReceiverStrategy=Oo.RequestCancellationReceiverStrategy=Oo.IdCancellationReceiverStrategy=Oo.ConnectionStrategy=Oo.ConnectionError=Oo.ConnectionErrors=Oo.LogTraceNotification=Oo.SetTraceNotification=Oo.TraceFormat=Oo.TraceValues=Oo.Trace=Oo.NullLogger=Oo.ProgressType=Oo.ProgressToken=void 0;var pzr=FU(),hf=lse(),$i=nDt(),hzr=oDt(),gbe=dse(),TDt=WUe(),Ebe;(function(t){t.type=new $i.NotificationType("$/cancelRequest")})(Ebe||(Ebe={}));var IDt;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}a(e,"is"),t.is=e})(IDt||(Oo.ProgressToken=IDt={}));var Abe;(function(t){t.type=new $i.NotificationType("$/progress")})(Abe||(Abe={}));var xDt=class{static{a(this,"ProgressType")}constructor(){}};Oo.ProgressType=xDt;var wDt;(function(t){function e(r){return hf.func(r)}a(e,"is"),t.is=e})(wDt||(wDt={}));Oo.NullLogger=Object.freeze({error:a(()=>{},"error"),warn:a(()=>{},"warn"),info:a(()=>{},"info"),log:a(()=>{},"log")});var Ic;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Ic||(Oo.Trace=Ic={}));var mzr;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(mzr||(Oo.TraceValues=mzr={}));(function(t){function e(n){if(!hf.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}a(e,"fromString"),t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}a(r,"toString"),t.toString=r})(Ic||(Oo.Trace=Ic={}));var Y1;(function(t){t.Text="text",t.JSON="json"})(Y1||(Oo.TraceFormat=Y1={}));(function(t){function e(r){return hf.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}a(e,"fromString"),t.fromString=e})(Y1||(Oo.TraceFormat=Y1={}));var RDt;(function(t){t.type=new $i.NotificationType("$/setTrace")})(RDt||(Oo.SetTraceNotification=RDt={}));var ZUe;(function(t){t.type=new $i.NotificationType("$/logTrace")})(ZUe||(Oo.LogTraceNotification=ZUe={}));var ybe;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(ybe||(Oo.ConnectionErrors=ybe={}));var mse=class t extends Error{static{a(this,"ConnectionError")}constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Oo.ConnectionError=mse;var kDt;(function(t){function e(r){let n=r;return n&&hf.func(n.cancelUndispatched)}a(e,"is"),t.is=e})(kDt||(Oo.ConnectionStrategy=kDt={}));var XUe;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&hf.func(n.createCancellationTokenSource)&&(n.dispose===void 0||hf.func(n.dispose))}a(e,"is"),t.is=e})(XUe||(Oo.IdCancellationReceiverStrategy=XUe={}));var PDt;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&hf.func(n.createCancellationTokenSource)&&(n.dispose===void 0||hf.func(n.dispose))}a(e,"is"),t.is=e})(PDt||(Oo.RequestCancellationReceiverStrategy=PDt={}));var e7e;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new TDt.CancellationTokenSource}});function e(r){return XUe.is(r)||PDt.is(r)}a(e,"is"),t.is=e})(e7e||(Oo.CancellationReceiverStrategy=e7e={}));var t7e;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(Ebe.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&hf.func(n.sendCancellation)&&hf.func(n.cleanup)}a(e,"is"),t.is=e})(t7e||(Oo.CancellationSenderStrategy=t7e={}));var r7e;(function(t){t.Message=Object.freeze({receiver:e7e.Message,sender:t7e.Message});function e(r){let n=r;return n&&e7e.is(n.receiver)&&t7e.is(n.sender)}a(e,"is"),t.is=e})(r7e||(Oo.CancellationStrategy=r7e={}));var n7e;(function(t){function e(r){let n=r;return n&&hf.func(n.handleMessage)}a(e,"is"),t.is=e})(n7e||(Oo.MessageStrategy=n7e={}));var gzr;(function(t){function e(r){let n=r;return n&&(r7e.is(n.cancellationStrategy)||kDt.is(n.connectionStrategy)||n7e.is(n.messageStrategy))}a(e,"is"),t.is=e})(gzr||(Oo.ConnectionOptions=gzr={}));var eP;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(eP||(eP={}));function FEo(t,e,r,n){let o=r!==void 0?r:Oo.NullLogger,s=0,c=0,l=0,u="2.0",d,f=new Map,h,m=new Map,g=new Map,A,y=new hzr.LinkedMap,E=new Map,_=new Set,v=new Map,b=Ic.Off,T=Y1.Text,w,R=eP.New,x=new gbe.Emitter,P=new gbe.Emitter,D=new gbe.Emitter,N=new gbe.Emitter,L=new gbe.Emitter,B=n&&n.cancellationStrategy?n.cancellationStrategy:r7e.Message;function j(se){if(se===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+se.toString()}a(j,"createRequestQueueKey");function M(se){return se===null?"res-unknown-"+(++l).toString():"res-"+se.toString()}a(M,"createResponseQueueKey");function O(){return"not-"+(++c).toString()}a(O,"createNotificationQueueKey");function U(se,be){$i.Message.isRequest(be)?se.set(j(be.id),be):$i.Message.isResponse(be)?se.set(M(be.id),be):se.set(O(),be)}a(U,"addMessageToQueue");function q(se){}a(q,"cancelUndispatched");function Q(){return R===eP.Listening}a(Q,"isListening");function Y(){return R===eP.Closed}a(Y,"isClosed");function W(){return R===eP.Disposed}a(W,"isDisposed");function V(){(R===eP.New||R===eP.Listening)&&(R=eP.Closed,P.fire(void 0))}a(V,"closeHandler");function z(se){x.fire([se,void 0,void 0])}a(z,"readErrorHandler");function ie(se){x.fire(se)}a(ie,"writeErrorHandler"),t.onClose(V),t.onError(z),e.onClose(V),e.onError(ie);function H(){A||y.size===0||(A=(0,pzr.default)().timer.setImmediate(()=>{A=void 0,le()}))}a(H,"triggerMessageQueue");function te(se){$i.Message.isRequest(se)?ge(se):$i.Message.isNotification(se)?we(se):$i.Message.isResponse(se)?Oe(se):re(se)}a(te,"handleMessage");function le(){if(y.size===0)return;let se=y.shift();try{let be=n?.messageStrategy;n7e.is(be)?be.handleMessage(se,te):te(se)}finally{H()}}a(le,"processMessageQueue");let Le=a(se=>{try{if($i.Message.isNotification(se)&&se.method===Ebe.type.method){let be=se.params.id,Fe=j(be),Ue=y.get(Fe);if($i.Message.isRequest(Ue)){let Z=n?.connectionStrategy,ve=Z&&Z.cancelUndispatched?Z.cancelUndispatched(Ue,q):void 0;if(ve&&(ve.error!==void 0||ve.result!==void 0)){y.delete(Fe),v.delete(be),ve.id=Ue.id,X(ve,se.method,Date.now()),e.write(ve).catch(()=>o.error("Sending response for canceled message failed."));return}}let me=v.get(be);if(me!==void 0){me.cancel(),qe(se);return}else _.add(be)}U(y,se)}finally{H()}},"callback");function ge(se){if(W())return;function be(Qe,je,J){let ae={jsonrpc:u,id:se.id};Qe instanceof $i.ResponseError?ae.error=Qe.toJson():ae.result=Qe===void 0?null:Qe,X(ae,je,J),e.write(ae).catch(()=>o.error("Sending response failed."))}a(be,"reply");function Fe(Qe,je,J){let ae={jsonrpc:u,id:se.id,error:Qe.toJson()};X(ae,je,J),e.write(ae).catch(()=>o.error("Sending response failed."))}a(Fe,"replyError");function Ue(Qe,je,J){Qe===void 0&&(Qe=null);let ae={jsonrpc:u,id:se.id,result:Qe};X(ae,je,J),e.write(ae).catch(()=>o.error("Sending response failed."))}a(Ue,"replySuccess"),de(se);let me=f.get(se.method),Z,ve;me&&(Z=me.type,ve=me.handler);let Ge=Date.now();if(ve||d){let Qe=se.id??String(Date.now()),je=XUe.is(B.receiver)?B.receiver.createCancellationTokenSource(Qe):B.receiver.createCancellationTokenSource(se);se.id!==null&&_.has(se.id)&&je.cancel(),se.id!==null&&v.set(Qe,je);try{let J;if(ve)if(se.params===void 0){if(Z!==void 0&&Z.numberOfParams!==0){Fe(new $i.ResponseError($i.ErrorCodes.InvalidParams,`Request ${se.method} defines ${Z.numberOfParams} params but received none.`),se.method,Ge);return}J=ve(je.token)}else if(Array.isArray(se.params)){if(Z!==void 0&&Z.parameterStructures===$i.ParameterStructures.byName){Fe(new $i.ResponseError($i.ErrorCodes.InvalidParams,`Request ${se.method} defines parameters by name but received parameters by position`),se.method,Ge);return}J=ve(...se.params,je.token)}else{if(Z!==void 0&&Z.parameterStructures===$i.ParameterStructures.byPosition){Fe(new $i.ResponseError($i.ErrorCodes.InvalidParams,`Request ${se.method} defines parameters by position but received parameters by name`),se.method,Ge);return}J=ve(se.params,je.token)}else d&&(J=d(se.method,se.params,je.token));let ae=J;J?ae.then?ae.then(Ce=>{v.delete(Qe),be(Ce,se.method,Ge)},Ce=>{v.delete(Qe),Ce instanceof $i.ResponseError?Fe(Ce,se.method,Ge):Ce&&hf.string(Ce.message)?Fe(new $i.ResponseError($i.ErrorCodes.InternalError,`Request ${se.method} failed with message: ${Ce.message}`),se.method,Ge):Fe(new $i.ResponseError($i.ErrorCodes.InternalError,`Request ${se.method} failed unexpectedly without providing any details.`),se.method,Ge)}):(v.delete(Qe),be(J,se.method,Ge)):(v.delete(Qe),Ue(J,se.method,Ge))}catch(J){v.delete(Qe),J instanceof $i.ResponseError?be(J,se.method,Ge):J&&hf.string(J.message)?Fe(new $i.ResponseError($i.ErrorCodes.InternalError,`Request ${se.method} failed with message: ${J.message}`),se.method,Ge):Fe(new $i.ResponseError($i.ErrorCodes.InternalError,`Request ${se.method} failed unexpectedly without providing any details.`),se.method,Ge)}}else Fe(new $i.ResponseError($i.ErrorCodes.MethodNotFound,`Unhandled method ${se.method}`),se.method,Ge)}a(ge,"handleRequest");function Oe(se){if(!W())if(se.id===null)se.error?o.error(`Received response message without id: Error is: +${JSON.stringify(se.error,void 0,4)}`):o.error("Received response message without id. No further error information provided.");else{let be=se.id,Fe=E.get(be);if(ne(se,Fe),Fe!==void 0){E.delete(be);try{if(se.error){let Ue=se.error;Fe.reject(new $i.ResponseError(Ue.code,Ue.message,Ue.data))}else if(se.result!==void 0)Fe.resolve(se.result);else throw new Error("Should never happen.")}catch(Ue){Ue.message?o.error(`Response handler '${Fe.method}' failed with message: ${Ue.message}`):o.error(`Response handler '${Fe.method}' failed unexpectedly.`)}}}}a(Oe,"handleResponse");function we(se){if(W())return;let be,Fe;if(se.method===Ebe.type.method){let Ue=se.params.id;_.delete(Ue),qe(se);return}else{let Ue=m.get(se.method);Ue&&(Fe=Ue.handler,be=Ue.type)}if(Fe||h)try{if(qe(se),Fe)if(se.params===void 0)be!==void 0&&be.numberOfParams!==0&&be.parameterStructures!==$i.ParameterStructures.byName&&o.error(`Notification ${se.method} defines ${be.numberOfParams} params but received none.`),Fe();else if(Array.isArray(se.params)){let Ue=se.params;se.method===Abe.type.method&&Ue.length===2&&IDt.is(Ue[0])?Fe({token:Ue[0],value:Ue[1]}):(be!==void 0&&(be.parameterStructures===$i.ParameterStructures.byName&&o.error(`Notification ${se.method} defines parameters by name but received parameters by position`),be.numberOfParams!==se.params.length&&o.error(`Notification ${se.method} defines ${be.numberOfParams} params but received ${Ue.length} arguments`)),Fe(...Ue))}else be!==void 0&&be.parameterStructures===$i.ParameterStructures.byPosition&&o.error(`Notification ${se.method} defines parameters by position but received parameters by name`),Fe(se.params);else h&&h(se.method,se.params)}catch(Ue){Ue.message?o.error(`Notification handler '${se.method}' failed with message: ${Ue.message}`):o.error(`Notification handler '${se.method}' failed unexpectedly.`)}else D.fire(se)}a(we,"handleNotification");function re(se){if(!se){o.error("Received empty message.");return}o.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(se,null,4)}`);let be=se;if(hf.string(be.id)||hf.number(be.id)){let Fe=be.id,Ue=E.get(Fe);Ue&&Ue.reject(new Error("The received response has neither a result nor an error property."))}}a(re,"handleInvalidMessage");function ee(se){if(se!=null)switch(b){case Ic.Verbose:return JSON.stringify(se,null,4);case Ic.Compact:return JSON.stringify(se);default:return}}a(ee,"stringifyTrace");function K(se){if(!(b===Ic.Off||!w))if(T===Y1.Text){let be;(b===Ic.Verbose||b===Ic.Compact)&&se.params&&(be=`Params: ${ee(se.params)} -`),w.log(`Sending request '${Ie.method} - (${Ie.id})'.`,F)}else ce("send-request",Ie)}a(K,"traceSendingRequest");function he(Ie){if(!(b===bc.Off||!w))if(T===G1.Text){let F;(b===bc.Verbose||b===bc.Compact)&&(Ie.params?F=`Params: ${ee(Ie.params)} +`),w.log(`Sending request '${se.method} - (${se.id})'.`,be)}else ue("send-request",se)}a(K,"traceSendingRequest");function he(se){if(!(b===Ic.Off||!w))if(T===Y1.Text){let be;(b===Ic.Verbose||b===Ic.Compact)&&(se.params?be=`Params: ${ee(se.params)} -`:F=`No parameters provided. +`:be=`No parameters provided. -`),w.log(`Sending notification '${Ie.method}'.`,F)}else ce("send-notification",Ie)}a(he,"traceSendingNotification");function Z(Ie,F,be){if(!(b===bc.Off||!w))if(T===G1.Text){let Qe;(b===bc.Verbose||b===bc.Compact)&&(Ie.error&&Ie.error.data?Qe=`Error data: ${ee(Ie.error.data)} +`),w.log(`Sending notification '${se.method}'.`,be)}else ue("send-notification",se)}a(he,"traceSendingNotification");function X(se,be,Fe){if(!(b===Ic.Off||!w))if(T===Y1.Text){let Ue;(b===Ic.Verbose||b===Ic.Compact)&&(se.error&&se.error.data?Ue=`Error data: ${ee(se.error.data)} -`:Ie.result?Qe=`Result: ${ee(Ie.result)} +`:se.result?Ue=`Result: ${ee(se.result)} -`:Ie.error===void 0&&(Qe=`No result returned. +`:se.error===void 0&&(Ue=`No result returned. -`)),w.log(`Sending response '${F} - (${Ie.id})'. Processing request took ${Date.now()-be}ms`,Qe)}else ce("send-response",Ie)}a(Z,"traceSendingResponse");function ue(Ie){if(!(b===bc.Off||!w))if(T===G1.Text){let F;(b===bc.Verbose||b===bc.Compact)&&Ie.params&&(F=`Params: ${ee(Ie.params)} +`)),w.log(`Sending response '${be} - (${se.id})'. Processing request took ${Date.now()-Fe}ms`,Ue)}else ue("send-response",se)}a(X,"traceSendingResponse");function de(se){if(!(b===Ic.Off||!w))if(T===Y1.Text){let be;(b===Ic.Verbose||b===Ic.Compact)&&se.params&&(be=`Params: ${ee(se.params)} -`),w.log(`Received request '${Ie.method} - (${Ie.id})'.`,F)}else ce("receive-request",Ie)}a(ue,"traceReceivedRequest");function qe(Ie){if(!(b===bc.Off||!w||Ie.method===IUe.type.method))if(T===G1.Text){let F;(b===bc.Verbose||b===bc.Compact)&&(Ie.params?F=`Params: ${ee(Ie.params)} +`),w.log(`Received request '${se.method} - (${se.id})'.`,be)}else ue("receive-request",se)}a(de,"traceReceivedRequest");function qe(se){if(!(b===Ic.Off||!w||se.method===ZUe.type.method))if(T===Y1.Text){let be;(b===Ic.Verbose||b===Ic.Compact)&&(se.params?be=`Params: ${ee(se.params)} -`:F=`No parameters provided. +`:be=`No parameters provided. -`),w.log(`Received notification '${Ie.method}'.`,F)}else ce("receive-notification",Ie)}a(qe,"traceReceivedNotification");function ne(Ie,F){if(!(b===bc.Off||!w))if(T===G1.Text){let be;if((b===bc.Verbose||b===bc.Compact)&&(Ie.error&&Ie.error.data?be=`Error data: ${ee(Ie.error.data)} +`),w.log(`Received notification '${se.method}'.`,be)}else ue("receive-notification",se)}a(qe,"traceReceivedNotification");function ne(se,be){if(!(b===Ic.Off||!w))if(T===Y1.Text){let Fe;if((b===Ic.Verbose||b===Ic.Compact)&&(se.error&&se.error.data?Fe=`Error data: ${ee(se.error.data)} -`:Ie.result?be=`Result: ${ee(Ie.result)} +`:se.result?Fe=`Result: ${ee(se.result)} -`:Ie.error===void 0&&(be=`No result returned. +`:se.error===void 0&&(Fe=`No result returned. -`)),F){let Qe=Ie.error?` Request failed: ${Ie.error.message} (${Ie.error.code}).`:"";w.log(`Received response '${F.method} - (${Ie.id})' in ${Date.now()-F.timerStart}ms.${Qe}`,be)}else w.log(`Received response ${Ie.id} without active response promise.`,be)}else ce("receive-response",Ie)}a(ne,"traceReceivedResponse");function ce(Ie,F){if(!w||b===bc.Off)return;let be={isLSPMessage:!0,type:Ie,message:F,timestamp:Date.now()};w.log(be)}a(ce,"logLSPMessage");function Ne(){if(Y())throw new ose(ZCe.Closed,"Connection is closed.");if(W())throw new ose(ZCe.Disposed,"Connection is disposed.")}a(Ne,"throwIfClosedOrDisposed");function we(){if(U())throw new ose(ZCe.AlreadyListening,"Connection is already listening")}a(we,"throwIfListening");function Be(){if(!U())throw new Error("Call listen() first.")}a(Be,"throwIfNotListening");function rt(Ie){return Ie===void 0?null:Ie}a(rt,"undefinedToNull");function st(Ie){if(Ie!==null)return Ie}a(st,"nullToUndefined");function _t(Ie){return Ie!=null&&!Array.isArray(Ie)&&typeof Ie=="object"}a(_t,"isNamedParam");function Dt(Ie,F){switch(Ie){case Vi.ParameterStructures.auto:return _t(F)?st(F):[rt(F)];case Vi.ParameterStructures.byName:if(!_t(F))throw new Error("Received parameters by name but param is not an object literal.");return st(F);case Vi.ParameterStructures.byPosition:return[rt(F)];default:throw new Error(`Unknown parameter structure ${Ie.toString()}`)}}a(Dt,"computeSingleParam");function $t(Ie,F){let be,Qe=Ie.numberOfParams;switch(Qe){case 0:be=void 0;break;case 1:be=Dt(Ie.parameterStructures,F[0]);break;default:be=[];for(let pe=0;pe{Ne();let be,Qe;if(lf.string(Ie)){be=Ie;let Se=F[0],Fe=0,te=Vi.ParameterStructures.auto;Vi.ParameterStructures.is(Se)&&(Fe=1,te=Se);let Te=F.length,Ge=Te-Fe;switch(Ge){case 0:Qe=void 0;break;case 1:Qe=Dt(te,F[Fe]);break;default:if(te===Vi.ParameterStructures.byName)throw new Error(`Received ${Ge} parameters for 'by Name' notification parameter structure.`);Qe=F.slice(Fe,Te).map(J=>rt(J));break}}else{let Se=F;be=Ie.method,Qe=$t(Ie,Se)}let pe={jsonrpc:u,method:be,params:Qe};return he(pe),e.write(pe).catch(Se=>{throw o.error("Sending notification failed."),Se})},"sendNotification"),onNotification:a((Ie,F)=>{Ne();let be;return lf.func(Ie)?h=Ie:F&&(lf.string(Ie)?(be=Ie,m.set(Ie,{type:void 0,handler:F})):(be=Ie.method,m.set(Ie.method,{type:Ie,handler:F}))),{dispose:a(()=>{be!==void 0?m.delete(be):h=void 0},"dispose")}},"onNotification"),onProgress:a((Ie,F,be)=>{if(g.has(F))throw new Error(`Progress handler for token ${F} already registered`);return g.set(F,be),{dispose:a(()=>{g.delete(F)},"dispose")}},"onProgress"),sendProgress:a((Ie,F,be)=>Gt.sendNotification(JCe.type,{token:F,value:be}),"sendProgress"),onUnhandledProgress:N.event,sendRequest:a((Ie,...F)=>{Ne(),Be();let be,Qe,pe;if(lf.string(Ie)){be=Ie;let Te=F[0],Ge=F[F.length-1],J=0,se=Vi.ParameterStructures.auto;Vi.ParameterStructures.is(Te)&&(J=1,se=Te);let me=F.length;eDt.CancellationToken.is(Ge)&&(me=me-1,pe=Ge);let Ce=me-J;switch(Ce){case 0:Qe=void 0;break;case 1:Qe=Dt(se,F[J]);break;default:if(se===Vi.ParameterStructures.byName)throw new Error(`Received ${Ce} parameters for 'by Name' request parameter structure.`);Qe=F.slice(J,me).map(He=>rt(He));break}}else{let Te=F;be=Ie.method,Qe=$t(Ie,Te);let Ge=Ie.numberOfParams;pe=eDt.CancellationToken.is(Te[Ge])?Te[Ge]:void 0}let Se=s++,Fe;pe&&(Fe=pe.onCancellationRequested(()=>{let Te=B.sender.sendCancellation(Gt,Se);return Te===void 0?(o.log(`Received no promise from cancellation strategy when cancelling id ${Se}`),Promise.resolve()):Te.catch(()=>{o.log(`Sending cancellation messages for id ${Se} failed`)})}));let te={jsonrpc:u,id:Se,method:be,params:Qe};return K(te),typeof B.sender.enableCancellation=="function"&&B.sender.enableCancellation(te),new Promise(async(Te,Ge)=>{let J=a(Ce=>{Te(Ce),B.sender.cleanup(Se),Fe?.dispose()},"resolveWithCleanup"),se=a(Ce=>{Ge(Ce),B.sender.cleanup(Se),Fe?.dispose()},"rejectWithCleanup"),me={method:be,timerStart:Date.now(),resolve:J,reject:se};try{await e.write(te),E.set(Se,me)}catch(Ce){throw o.error("Sending request failed."),me.reject(new Vi.ResponseError(Vi.ErrorCodes.MessageWriteError,Ce.message?Ce.message:"Unknown reason")),Ce}})},"sendRequest"),onRequest:a((Ie,F)=>{Ne();let be=null;return nDt.is(Ie)?(be=void 0,d=Ie):lf.string(Ie)?(be=null,F!==void 0&&(be=Ie,f.set(Ie,{handler:F,type:void 0}))):F!==void 0&&(be=Ie.method,f.set(Ie.method,{type:Ie,handler:F})),{dispose:a(()=>{be!==null&&(be!==void 0?f.delete(be):d=void 0)},"dispose")}},"onRequest"),hasPendingResponse:a(()=>E.size>0,"hasPendingResponse"),trace:a(async(Ie,F,be)=>{let Qe=!1,pe=G1.Text;be!==void 0&&(lf.boolean(be)?Qe=be:(Qe=be.sendNotification||!1,pe=be.traceFormat||G1.Text)),b=Ie,T=pe,b===bc.Off?w=void 0:w=F,Qe&&!Y()&&!W()&&await Gt.sendNotification(iDt.type,{value:bc.toString(Ie)})},"trace"),onError:x.event,onClose:P.event,onUnhandledNotification:D.event,onDispose:L.event,end:a(()=>{e.end()},"end"),dispose:a(()=>{if(W())return;R=$k.Disposed,L.fire(void 0);let Ie=new Vi.ResponseError(Vi.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let F of E.values())F.reject(Ie);E=new Map,v=new Map,_=new Set,y=new oWr.LinkedMap,lf.func(e.dispose)&&e.dispose(),lf.func(t.dispose)&&t.dispose()},"dispose"),listen:a(()=>{Ne(),we(),R=$k.Listening,t.listen(Le)},"listen"),inspect:a(()=>{(0,iWr.default)().console.log("inspect")},"inspect")};return Gt.onNotification(IUe.type,Ie=>{if(b===bc.Off||!w)return;let F=b===bc.Verbose||b===bc.Compact;w.log(Ie.message,F?Ie.verbose:void 0)}),Gt.onNotification(JCe.type,Ie=>{let F=g.get(Ie.token);F?F(Ie.value):N.fire(Ie)}),Gt}a(PAo,"createMessageConnection");Oo.createMessageConnection=PAo});var DUe=I(Bt=>{"use strict";p();Object.defineProperty(Bt,"__esModule",{value:!0});Bt.ProgressType=Bt.ProgressToken=Bt.createMessageConnection=Bt.NullLogger=Bt.ConnectionOptions=Bt.ConnectionStrategy=Bt.AbstractMessageBuffer=Bt.WriteableStreamMessageWriter=Bt.AbstractMessageWriter=Bt.MessageWriter=Bt.ReadableStreamMessageReader=Bt.AbstractMessageReader=Bt.MessageReader=Bt.SharedArrayReceiverStrategy=Bt.SharedArraySenderStrategy=Bt.CancellationToken=Bt.CancellationTokenSource=Bt.Emitter=Bt.Event=Bt.Disposable=Bt.LRUCache=Bt.Touch=Bt.LinkedMap=Bt.ParameterStructures=Bt.NotificationType9=Bt.NotificationType8=Bt.NotificationType7=Bt.NotificationType6=Bt.NotificationType5=Bt.NotificationType4=Bt.NotificationType3=Bt.NotificationType2=Bt.NotificationType1=Bt.NotificationType0=Bt.NotificationType=Bt.ErrorCodes=Bt.ResponseError=Bt.RequestType9=Bt.RequestType8=Bt.RequestType7=Bt.RequestType6=Bt.RequestType5=Bt.RequestType4=Bt.RequestType3=Bt.RequestType2=Bt.RequestType1=Bt.RequestType0=Bt.RequestType=Bt.Message=Bt.RAL=void 0;Bt.MessageStrategy=Bt.CancellationStrategy=Bt.CancellationSenderStrategy=Bt.CancellationReceiverStrategy=Bt.ConnectionError=Bt.ConnectionErrors=Bt.LogTraceNotification=Bt.SetTraceNotification=Bt.TraceFormat=Bt.TraceValues=Bt.Trace=void 0;var cu=D2t();Object.defineProperty(Bt,"Message",{enumerable:!0,get:a(function(){return cu.Message},"get")});Object.defineProperty(Bt,"RequestType",{enumerable:!0,get:a(function(){return cu.RequestType},"get")});Object.defineProperty(Bt,"RequestType0",{enumerable:!0,get:a(function(){return cu.RequestType0},"get")});Object.defineProperty(Bt,"RequestType1",{enumerable:!0,get:a(function(){return cu.RequestType1},"get")});Object.defineProperty(Bt,"RequestType2",{enumerable:!0,get:a(function(){return cu.RequestType2},"get")});Object.defineProperty(Bt,"RequestType3",{enumerable:!0,get:a(function(){return cu.RequestType3},"get")});Object.defineProperty(Bt,"RequestType4",{enumerable:!0,get:a(function(){return cu.RequestType4},"get")});Object.defineProperty(Bt,"RequestType5",{enumerable:!0,get:a(function(){return cu.RequestType5},"get")});Object.defineProperty(Bt,"RequestType6",{enumerable:!0,get:a(function(){return cu.RequestType6},"get")});Object.defineProperty(Bt,"RequestType7",{enumerable:!0,get:a(function(){return cu.RequestType7},"get")});Object.defineProperty(Bt,"RequestType8",{enumerable:!0,get:a(function(){return cu.RequestType8},"get")});Object.defineProperty(Bt,"RequestType9",{enumerable:!0,get:a(function(){return cu.RequestType9},"get")});Object.defineProperty(Bt,"ResponseError",{enumerable:!0,get:a(function(){return cu.ResponseError},"get")});Object.defineProperty(Bt,"ErrorCodes",{enumerable:!0,get:a(function(){return cu.ErrorCodes},"get")});Object.defineProperty(Bt,"NotificationType",{enumerable:!0,get:a(function(){return cu.NotificationType},"get")});Object.defineProperty(Bt,"NotificationType0",{enumerable:!0,get:a(function(){return cu.NotificationType0},"get")});Object.defineProperty(Bt,"NotificationType1",{enumerable:!0,get:a(function(){return cu.NotificationType1},"get")});Object.defineProperty(Bt,"NotificationType2",{enumerable:!0,get:a(function(){return cu.NotificationType2},"get")});Object.defineProperty(Bt,"NotificationType3",{enumerable:!0,get:a(function(){return cu.NotificationType3},"get")});Object.defineProperty(Bt,"NotificationType4",{enumerable:!0,get:a(function(){return cu.NotificationType4},"get")});Object.defineProperty(Bt,"NotificationType5",{enumerable:!0,get:a(function(){return cu.NotificationType5},"get")});Object.defineProperty(Bt,"NotificationType6",{enumerable:!0,get:a(function(){return cu.NotificationType6},"get")});Object.defineProperty(Bt,"NotificationType7",{enumerable:!0,get:a(function(){return cu.NotificationType7},"get")});Object.defineProperty(Bt,"NotificationType8",{enumerable:!0,get:a(function(){return cu.NotificationType8},"get")});Object.defineProperty(Bt,"NotificationType9",{enumerable:!0,get:a(function(){return cu.NotificationType9},"get")});Object.defineProperty(Bt,"ParameterStructures",{enumerable:!0,get:a(function(){return cu.ParameterStructures},"get")});var aDt=M2t();Object.defineProperty(Bt,"LinkedMap",{enumerable:!0,get:a(function(){return aDt.LinkedMap},"get")});Object.defineProperty(Bt,"LRUCache",{enumerable:!0,get:a(function(){return aDt.LRUCache},"get")});Object.defineProperty(Bt,"Touch",{enumerable:!0,get:a(function(){return aDt.Touch},"get")});var DAo=WVr();Object.defineProperty(Bt,"Disposable",{enumerable:!0,get:a(function(){return DAo.Disposable},"get")});var lWr=tse();Object.defineProperty(Bt,"Event",{enumerable:!0,get:a(function(){return lWr.Event},"get")});Object.defineProperty(Bt,"Emitter",{enumerable:!0,get:a(function(){return lWr.Emitter},"get")});var uWr=vUe();Object.defineProperty(Bt,"CancellationTokenSource",{enumerable:!0,get:a(function(){return uWr.CancellationTokenSource},"get")});Object.defineProperty(Bt,"CancellationToken",{enumerable:!0,get:a(function(){return uWr.CancellationToken},"get")});var dWr=YVr();Object.defineProperty(Bt,"SharedArraySenderStrategy",{enumerable:!0,get:a(function(){return dWr.SharedArraySenderStrategy},"get")});Object.defineProperty(Bt,"SharedArrayReceiverStrategy",{enumerable:!0,get:a(function(){return dWr.SharedArrayReceiverStrategy},"get")});var cDt=JVr();Object.defineProperty(Bt,"MessageReader",{enumerable:!0,get:a(function(){return cDt.MessageReader},"get")});Object.defineProperty(Bt,"AbstractMessageReader",{enumerable:!0,get:a(function(){return cDt.AbstractMessageReader},"get")});Object.defineProperty(Bt,"ReadableStreamMessageReader",{enumerable:!0,get:a(function(){return cDt.ReadableStreamMessageReader},"get")});var lDt=rWr();Object.defineProperty(Bt,"MessageWriter",{enumerable:!0,get:a(function(){return lDt.MessageWriter},"get")});Object.defineProperty(Bt,"AbstractMessageWriter",{enumerable:!0,get:a(function(){return lDt.AbstractMessageWriter},"get")});Object.defineProperty(Bt,"WriteableStreamMessageWriter",{enumerable:!0,get:a(function(){return lDt.WriteableStreamMessageWriter},"get")});var NAo=nWr();Object.defineProperty(Bt,"AbstractMessageBuffer",{enumerable:!0,get:a(function(){return NAo.AbstractMessageBuffer},"get")});var gA=cWr();Object.defineProperty(Bt,"ConnectionStrategy",{enumerable:!0,get:a(function(){return gA.ConnectionStrategy},"get")});Object.defineProperty(Bt,"ConnectionOptions",{enumerable:!0,get:a(function(){return gA.ConnectionOptions},"get")});Object.defineProperty(Bt,"NullLogger",{enumerable:!0,get:a(function(){return gA.NullLogger},"get")});Object.defineProperty(Bt,"createMessageConnection",{enumerable:!0,get:a(function(){return gA.createMessageConnection},"get")});Object.defineProperty(Bt,"ProgressToken",{enumerable:!0,get:a(function(){return gA.ProgressToken},"get")});Object.defineProperty(Bt,"ProgressType",{enumerable:!0,get:a(function(){return gA.ProgressType},"get")});Object.defineProperty(Bt,"Trace",{enumerable:!0,get:a(function(){return gA.Trace},"get")});Object.defineProperty(Bt,"TraceValues",{enumerable:!0,get:a(function(){return gA.TraceValues},"get")});Object.defineProperty(Bt,"TraceFormat",{enumerable:!0,get:a(function(){return gA.TraceFormat},"get")});Object.defineProperty(Bt,"SetTraceNotification",{enumerable:!0,get:a(function(){return gA.SetTraceNotification},"get")});Object.defineProperty(Bt,"LogTraceNotification",{enumerable:!0,get:a(function(){return gA.LogTraceNotification},"get")});Object.defineProperty(Bt,"ConnectionErrors",{enumerable:!0,get:a(function(){return gA.ConnectionErrors},"get")});Object.defineProperty(Bt,"ConnectionError",{enumerable:!0,get:a(function(){return gA.ConnectionError},"get")});Object.defineProperty(Bt,"CancellationReceiverStrategy",{enumerable:!0,get:a(function(){return gA.CancellationReceiverStrategy},"get")});Object.defineProperty(Bt,"CancellationSenderStrategy",{enumerable:!0,get:a(function(){return gA.CancellationSenderStrategy},"get")});Object.defineProperty(Bt,"CancellationStrategy",{enumerable:!0,get:a(function(){return gA.CancellationStrategy},"get")});Object.defineProperty(Bt,"MessageStrategy",{enumerable:!0,get:a(function(){return gA.MessageStrategy},"get")});var MAo=IU();Bt.RAL=MAo.default});var hWr=I(pDt=>{"use strict";p();Object.defineProperty(pDt,"__esModule",{value:!0});var fWr=require("util"),_B=DUe(),NUe=class t extends _B.AbstractMessageBuffer{static{a(this,"MessageBuffer")}constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new fWr.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};NUe.emptyBuffer=Buffer.allocUnsafe(0);var uDt=class{static{a(this,"ReadableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),_B.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),_B.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),_B.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),_B.Disposable.create(()=>this.stream.off("data",e))}},dDt=class{static{a(this,"WritableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),_B.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),_B.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),_B.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,o)=>{let s=a(c=>{c==null?n():o(c)},"callback");typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},pWr=Object.freeze({messageBuffer:Object.freeze({create:a(t=>new NUe(t),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:a((t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}},"encode")}),decoder:Object.freeze({name:"application/json",decode:a((t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new fWr.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}},"decode")})}),stream:Object.freeze({asReadableStream:a(t=>new uDt(t),"asReadableStream"),asWritableStream:a(t=>new dDt(t),"asWritableStream")}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:a(()=>clearTimeout(n),"dispose")}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:a(()=>clearImmediate(r),"dispose")}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:a(()=>clearInterval(n),"dispose")}}})});function fDt(){return pWr}a(fDt,"RIL");(function(t){function e(){_B.RAL.install(pWr)}a(e,"install"),t.install=e})(fDt||(fDt={}));pDt.default=fDt});var QW=I(xa=>{"use strict";p();var OAo=xa&&xa.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),LAo=xa&&xa.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&OAo(e,t,r)};Object.defineProperty(xa,"__esModule",{value:!0});xa.createMessageConnection=xa.createServerSocketTransport=xa.createClientSocketTransport=xa.createServerPipeTransport=xa.createClientPipeTransport=xa.generateRandomPipeName=xa.StreamMessageWriter=xa.StreamMessageReader=xa.SocketMessageWriter=xa.SocketMessageReader=xa.PortMessageWriter=xa.PortMessageReader=xa.IPCMessageWriter=xa.IPCMessageReader=void 0;var sse=hWr();sse.default.install();var mWr=require("path"),BAo=require("os"),FAo=require("crypto"),LUe=require("net"),$1=DUe();LAo(DUe(),xa);var hDt=class extends $1.AbstractMessageReader{static{a(this,"IPCMessageReader")}constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),$1.Disposable.create(()=>this.process.off("message",e))}};xa.IPCMessageReader=hDt;var mDt=class extends $1.AbstractMessageWriter{static{a(this,"IPCMessageWriter")}constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};xa.IPCMessageWriter=mDt;var gDt=class extends $1.AbstractMessageReader{static{a(this,"PortMessageReader")}constructor(e){super(),this.onData=new $1.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};xa.PortMessageReader=gDt;var ADt=class extends $1.AbstractMessageWriter{static{a(this,"PortMessageWriter")}constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};xa.PortMessageWriter=ADt;var FW=class extends $1.ReadableStreamMessageReader{static{a(this,"SocketMessageReader")}constructor(e,r="utf-8"){super((0,sse.default)().stream.asReadableStream(e),r)}};xa.SocketMessageReader=FW;var UW=class extends $1.WriteableStreamMessageWriter{static{a(this,"SocketMessageWriter")}constructor(e,r){super((0,sse.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};xa.SocketMessageWriter=UW;var MUe=class extends $1.ReadableStreamMessageReader{static{a(this,"StreamMessageReader")}constructor(e,r){super((0,sse.default)().stream.asReadableStream(e),r)}};xa.StreamMessageReader=MUe;var OUe=class extends $1.WriteableStreamMessageWriter{static{a(this,"StreamMessageWriter")}constructor(e,r){super((0,sse.default)().stream.asWritableStream(e),r)}};xa.StreamMessageWriter=OUe;var gWr=process.env.XDG_RUNTIME_DIR,UAo=new Map([["linux",107],["darwin",103]]);function QAo(){let t=(0,FAo.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;gWr?e=mWr.join(gWr,`vscode-ipc-${t}.sock`):e=mWr.join(BAo.tmpdir(),`vscode-${t}.sock`);let r=UAo.get(process.platform);return r!==void 0&&e.length>r&&(0,sse.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}a(QAo,"generateRandomPipeName");xa.generateRandomPipeName=QAo;function qAo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,LUe.createServer)(l=>{c.close(),r([new FW(l,e),new UW(l,e)])});c.on("error",s),c.listen(t,()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(qAo,"createClientPipeTransport");xa.createClientPipeTransport=qAo;function jAo(t,e="utf-8"){let r=(0,LUe.createConnection)(t);return[new FW(r,e),new UW(r,e)]}a(jAo,"createServerPipeTransport");xa.createServerPipeTransport=jAo;function HAo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,LUe.createServer)(l=>{c.close(),r([new FW(l,e),new UW(l,e)])});c.on("error",s),c.listen(t,"127.0.0.1",()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(HAo,"createClientSocketTransport");xa.createClientSocketTransport=HAo;function GAo(t,e="utf-8"){let r=(0,LUe.createConnection)(t,"127.0.0.1");return[new FW(r,e),new UW(r,e)]}a(GAo,"createServerSocketTransport");xa.createServerSocketTransport=GAo;function $Ao(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}a($Ao,"isReadableStream");function VAo(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}a(VAo,"isWritableStream");function WAo(t,e,r,n){r||(r=$1.NullLogger);let o=$Ao(t)?new MUe(t):t,s=VAo(e)?new OUe(e):e;return $1.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,$1.createMessageConnection)(o,s,r,n)}a(WAo,"createMessageConnection");xa.createMessageConnection=WAo});var yDt=I((MIl,AWr)=>{"use strict";p();AWr.exports=QW()});var ebe=I((yWr,BUe)=>{p();(function(t){if(typeof BUe=="object"&&typeof BUe.exports=="object"){var e=t(require,yWr);e!==void 0&&(BUe.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var r;(function(ae){function Re(Me){return typeof Me=="string"}a(Re,"is"),ae.is=Re})(r||(e.DocumentUri=r={}));var n;(function(ae){function Re(Me){return typeof Me=="string"}a(Re,"is"),ae.is=Re})(n||(e.URI=n={}));var o;(function(ae){ae.MIN_VALUE=-2147483648,ae.MAX_VALUE=2147483647;function Re(Me){return typeof Me=="number"&&ae.MIN_VALUE<=Me&&Me<=ae.MAX_VALUE}a(Re,"is"),ae.is=Re})(o||(e.integer=o={}));var s;(function(ae){ae.MIN_VALUE=0,ae.MAX_VALUE=2147483647;function Re(Me){return typeof Me=="number"&&ae.MIN_VALUE<=Me&&Me<=ae.MAX_VALUE}a(Re,"is"),ae.is=Re})(s||(e.uinteger=s={}));var c;(function(ae){function Re(ye,oe){return ye===Number.MAX_VALUE&&(ye=s.MAX_VALUE),oe===Number.MAX_VALUE&&(oe=s.MAX_VALUE),{line:ye,character:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.uinteger(oe.line)&&We.uinteger(oe.character)}a(Me,"is"),ae.is=Me})(c||(e.Position=c={}));var l;(function(ae){function Re(ye,oe,ze,at){if(We.uinteger(ye)&&We.uinteger(oe)&&We.uinteger(ze)&&We.uinteger(at))return{start:c.create(ye,oe),end:c.create(ze,at)};if(c.is(ye)&&c.is(oe))return{start:ye,end:oe};throw new Error("Range#create called with invalid arguments[".concat(ye,", ").concat(oe,", ").concat(ze,", ").concat(at,"]"))}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&c.is(oe.start)&&c.is(oe.end)}a(Me,"is"),ae.is=Me})(l||(e.Range=l={}));var u;(function(ae){function Re(ye,oe){return{uri:ye,range:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.range)&&(We.string(oe.uri)||We.undefined(oe.uri))}a(Me,"is"),ae.is=Me})(u||(e.Location=u={}));var d;(function(ae){function Re(ye,oe,ze,at){return{targetUri:ye,targetRange:oe,targetSelectionRange:ze,originSelectionRange:at}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.targetRange)&&We.string(oe.targetUri)&&l.is(oe.targetSelectionRange)&&(l.is(oe.originSelectionRange)||We.undefined(oe.originSelectionRange))}a(Me,"is"),ae.is=Me})(d||(e.LocationLink=d={}));var f;(function(ae){function Re(ye,oe,ze,at){return{red:ye,green:oe,blue:ze,alpha:at}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.numberRange(oe.red,0,1)&&We.numberRange(oe.green,0,1)&&We.numberRange(oe.blue,0,1)&&We.numberRange(oe.alpha,0,1)}a(Me,"is"),ae.is=Me})(f||(e.Color=f={}));var h;(function(ae){function Re(ye,oe){return{range:ye,color:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.range)&&f.is(oe.color)}a(Me,"is"),ae.is=Me})(h||(e.ColorInformation=h={}));var m;(function(ae){function Re(ye,oe,ze){return{label:ye,textEdit:oe,additionalTextEdits:ze}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.string(oe.label)&&(We.undefined(oe.textEdit)||w.is(oe))&&(We.undefined(oe.additionalTextEdits)||We.typedArray(oe.additionalTextEdits,w.is))}a(Me,"is"),ae.is=Me})(m||(e.ColorPresentation=m={}));var g;(function(ae){ae.Comment="comment",ae.Imports="imports",ae.Region="region"})(g||(e.FoldingRangeKind=g={}));var A;(function(ae){function Re(ye,oe,ze,at,Vt,gr){var cr={startLine:ye,endLine:oe};return We.defined(ze)&&(cr.startCharacter=ze),We.defined(at)&&(cr.endCharacter=at),We.defined(Vt)&&(cr.kind=Vt),We.defined(gr)&&(cr.collapsedText=gr),cr}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.uinteger(oe.startLine)&&We.uinteger(oe.startLine)&&(We.undefined(oe.startCharacter)||We.uinteger(oe.startCharacter))&&(We.undefined(oe.endCharacter)||We.uinteger(oe.endCharacter))&&(We.undefined(oe.kind)||We.string(oe.kind))}a(Me,"is"),ae.is=Me})(A||(e.FoldingRange=A={}));var y;(function(ae){function Re(ye,oe){return{location:ye,message:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&u.is(oe.location)&&We.string(oe.message)}a(Me,"is"),ae.is=Me})(y||(e.DiagnosticRelatedInformation=y={}));var E;(function(ae){ae.Error=1,ae.Warning=2,ae.Information=3,ae.Hint=4})(E||(e.DiagnosticSeverity=E={}));var _;(function(ae){ae.Unnecessary=1,ae.Deprecated=2})(_||(e.DiagnosticTag=_={}));var v;(function(ae){function Re(Me){var ye=Me;return We.objectLiteral(ye)&&We.string(ye.href)}a(Re,"is"),ae.is=Re})(v||(e.CodeDescription=v={}));var b;(function(ae){function Re(ye,oe,ze,at,Vt,gr){var cr={range:ye,message:oe};return We.defined(ze)&&(cr.severity=ze),We.defined(at)&&(cr.code=at),We.defined(Vt)&&(cr.source=Vt),We.defined(gr)&&(cr.relatedInformation=gr),cr}a(Re,"create"),ae.create=Re;function Me(ye){var oe,ze=ye;return We.defined(ze)&&l.is(ze.range)&&We.string(ze.message)&&(We.number(ze.severity)||We.undefined(ze.severity))&&(We.integer(ze.code)||We.string(ze.code)||We.undefined(ze.code))&&(We.undefined(ze.codeDescription)||We.string((oe=ze.codeDescription)===null||oe===void 0?void 0:oe.href))&&(We.string(ze.source)||We.undefined(ze.source))&&(We.undefined(ze.relatedInformation)||We.typedArray(ze.relatedInformation,y.is))}a(Me,"is"),ae.is=Me})(b||(e.Diagnostic=b={}));var T;(function(ae){function Re(ye,oe){for(var ze=[],at=2;at0&&(Vt.arguments=ze),Vt}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.title)&&We.string(oe.command)}a(Me,"is"),ae.is=Me})(T||(e.Command=T={}));var w;(function(ae){function Re(ze,at){return{range:ze,newText:at}}a(Re,"replace"),ae.replace=Re;function Me(ze,at){return{range:{start:ze,end:ze},newText:at}}a(Me,"insert"),ae.insert=Me;function ye(ze){return{range:ze,newText:""}}a(ye,"del"),ae.del=ye;function oe(ze){var at=ze;return We.objectLiteral(at)&&We.string(at.newText)&&l.is(at.range)}a(oe,"is"),ae.is=oe})(w||(e.TextEdit=w={}));var R;(function(ae){function Re(ye,oe,ze){var at={label:ye};return oe!==void 0&&(at.needsConfirmation=oe),ze!==void 0&&(at.description=ze),at}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.string(oe.label)&&(We.boolean(oe.needsConfirmation)||oe.needsConfirmation===void 0)&&(We.string(oe.description)||oe.description===void 0)}a(Me,"is"),ae.is=Me})(R||(e.ChangeAnnotation=R={}));var x;(function(ae){function Re(Me){var ye=Me;return We.string(ye)}a(Re,"is"),ae.is=Re})(x||(e.ChangeAnnotationIdentifier=x={}));var P;(function(ae){function Re(ze,at,Vt){return{range:ze,newText:at,annotationId:Vt}}a(Re,"replace"),ae.replace=Re;function Me(ze,at,Vt){return{range:{start:ze,end:ze},newText:at,annotationId:Vt}}a(Me,"insert"),ae.insert=Me;function ye(ze,at){return{range:ze,newText:"",annotationId:at}}a(ye,"del"),ae.del=ye;function oe(ze){var at=ze;return w.is(at)&&(R.is(at.annotationId)||x.is(at.annotationId))}a(oe,"is"),ae.is=oe})(P||(e.AnnotatedTextEdit=P={}));var D;(function(ae){function Re(ye,oe){return{textDocument:ye,edits:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&Y.is(oe.textDocument)&&Array.isArray(oe.edits)}a(Me,"is"),ae.is=Me})(D||(e.TextDocumentEdit=D={}));var N;(function(ae){function Re(ye,oe,ze){var at={kind:"create",uri:ye};return oe!==void 0&&(oe.overwrite!==void 0||oe.ignoreIfExists!==void 0)&&(at.options=oe),ze!==void 0&&(at.annotationId=ze),at}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return oe&&oe.kind==="create"&&We.string(oe.uri)&&(oe.options===void 0||(oe.options.overwrite===void 0||We.boolean(oe.options.overwrite))&&(oe.options.ignoreIfExists===void 0||We.boolean(oe.options.ignoreIfExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ae.is=Me})(N||(e.CreateFile=N={}));var L;(function(ae){function Re(ye,oe,ze,at){var Vt={kind:"rename",oldUri:ye,newUri:oe};return ze!==void 0&&(ze.overwrite!==void 0||ze.ignoreIfExists!==void 0)&&(Vt.options=ze),at!==void 0&&(Vt.annotationId=at),Vt}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return oe&&oe.kind==="rename"&&We.string(oe.oldUri)&&We.string(oe.newUri)&&(oe.options===void 0||(oe.options.overwrite===void 0||We.boolean(oe.options.overwrite))&&(oe.options.ignoreIfExists===void 0||We.boolean(oe.options.ignoreIfExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ae.is=Me})(L||(e.RenameFile=L={}));var B;(function(ae){function Re(ye,oe,ze){var at={kind:"delete",uri:ye};return oe!==void 0&&(oe.recursive!==void 0||oe.ignoreIfNotExists!==void 0)&&(at.options=oe),ze!==void 0&&(at.annotationId=ze),at}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return oe&&oe.kind==="delete"&&We.string(oe.uri)&&(oe.options===void 0||(oe.options.recursive===void 0||We.boolean(oe.options.recursive))&&(oe.options.ignoreIfNotExists===void 0||We.boolean(oe.options.ignoreIfNotExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ae.is=Me})(B||(e.DeleteFile=B={}));var q;(function(ae){function Re(Me){var ye=Me;return ye&&(ye.changes!==void 0||ye.documentChanges!==void 0)&&(ye.documentChanges===void 0||ye.documentChanges.every(function(oe){return We.string(oe.kind)?N.is(oe)||L.is(oe)||B.is(oe):D.is(oe)}))}a(Re,"is"),ae.is=Re})(q||(e.WorkspaceEdit=q={}));var M=(function(){function ae(Re,Me){this.edits=Re,this.changeAnnotations=Me}return a(ae,"TextEditChangeImpl"),ae.prototype.insert=function(Re,Me,ye){var oe,ze;if(ye===void 0?oe=w.insert(Re,Me):x.is(ye)?(ze=ye,oe=P.insert(Re,Me,ye)):(this.assertChangeAnnotations(this.changeAnnotations),ze=this.changeAnnotations.manage(ye),oe=P.insert(Re,Me,ze)),this.edits.push(oe),ze!==void 0)return ze},ae.prototype.replace=function(Re,Me,ye){var oe,ze;if(ye===void 0?oe=w.replace(Re,Me):x.is(ye)?(ze=ye,oe=P.replace(Re,Me,ye)):(this.assertChangeAnnotations(this.changeAnnotations),ze=this.changeAnnotations.manage(ye),oe=P.replace(Re,Me,ze)),this.edits.push(oe),ze!==void 0)return ze},ae.prototype.delete=function(Re,Me){var ye,oe;if(Me===void 0?ye=w.del(Re):x.is(Me)?(oe=Me,ye=P.del(Re,Me)):(this.assertChangeAnnotations(this.changeAnnotations),oe=this.changeAnnotations.manage(Me),ye=P.del(Re,oe)),this.edits.push(ye),oe!==void 0)return oe},ae.prototype.add=function(Re){this.edits.push(Re)},ae.prototype.all=function(){return this.edits},ae.prototype.clear=function(){this.edits.splice(0,this.edits.length)},ae.prototype.assertChangeAnnotations=function(Re){if(Re===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},ae})(),O=(function(){function ae(Re){this._annotations=Re===void 0?Object.create(null):Re,this._counter=0,this._size=0}return a(ae,"ChangeAnnotations"),ae.prototype.all=function(){return this._annotations},Object.defineProperty(ae.prototype,"size",{get:a(function(){return this._size},"get"),enumerable:!1,configurable:!0}),ae.prototype.manage=function(Re,Me){var ye;if(x.is(Re)?ye=Re:(ye=this.nextId(),Me=Re),this._annotations[ye]!==void 0)throw new Error("Id ".concat(ye," is already in use."));if(Me===void 0)throw new Error("No annotation provided for id ".concat(ye));return this._annotations[ye]=Me,this._size++,ye},ae.prototype.nextId=function(){return this._counter++,this._counter.toString()},ae})(),j=(function(){function ae(Re){var Me=this;this._textEditChanges=Object.create(null),Re!==void 0?(this._workspaceEdit=Re,Re.documentChanges?(this._changeAnnotations=new O(Re.changeAnnotations),Re.changeAnnotations=this._changeAnnotations.all(),Re.documentChanges.forEach(function(ye){if(D.is(ye)){var oe=new M(ye.edits,Me._changeAnnotations);Me._textEditChanges[ye.textDocument.uri]=oe}})):Re.changes&&Object.keys(Re.changes).forEach(function(ye){var oe=new M(Re.changes[ye]);Me._textEditChanges[ye]=oe})):this._workspaceEdit={}}return a(ae,"WorkspaceChange"),Object.defineProperty(ae.prototype,"edit",{get:a(function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},"get"),enumerable:!1,configurable:!0}),ae.prototype.getTextEditChange=function(Re){if(Y.is(Re)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var Me={uri:Re.uri,version:Re.version},ye=this._textEditChanges[Me.uri];if(!ye){var oe=[],ze={textDocument:Me,edits:oe};this._workspaceEdit.documentChanges.push(ze),ye=new M(oe,this._changeAnnotations),this._textEditChanges[Me.uri]=ye}return ye}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var ye=this._textEditChanges[Re];if(!ye){var oe=[];this._workspaceEdit.changes[Re]=oe,ye=new M(oe),this._textEditChanges[Re]=ye}return ye}},ae.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new O,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},ae.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},ae.prototype.createFile=function(Re,Me,ye){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var oe;R.is(Me)||x.is(Me)?oe=Me:ye=Me;var ze,at;if(oe===void 0?ze=N.create(Re,ye):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),ze=N.create(Re,ye,at)),this._workspaceEdit.documentChanges.push(ze),at!==void 0)return at},ae.prototype.renameFile=function(Re,Me,ye,oe){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var ze;R.is(ye)||x.is(ye)?ze=ye:oe=ye;var at,Vt;if(ze===void 0?at=L.create(Re,Me,oe):(Vt=x.is(ze)?ze:this._changeAnnotations.manage(ze),at=L.create(Re,Me,oe,Vt)),this._workspaceEdit.documentChanges.push(at),Vt!==void 0)return Vt},ae.prototype.deleteFile=function(Re,Me,ye){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var oe;R.is(Me)||x.is(Me)?oe=Me:ye=Me;var ze,at;if(oe===void 0?ze=B.create(Re,ye):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),ze=B.create(Re,ye,at)),this._workspaceEdit.documentChanges.push(ze),at!==void 0)return at},ae})();e.WorkspaceChange=j;var Q;(function(ae){function Re(ye){return{uri:ye}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)}a(Me,"is"),ae.is=Me})(Q||(e.TextDocumentIdentifier=Q={}));var U;(function(ae){function Re(ye,oe){return{uri:ye,version:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&We.integer(oe.version)}a(Me,"is"),ae.is=Me})(U||(e.VersionedTextDocumentIdentifier=U={}));var Y;(function(ae){function Re(ye,oe){return{uri:ye,version:oe}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&(oe.version===null||We.integer(oe.version))}a(Me,"is"),ae.is=Me})(Y||(e.OptionalVersionedTextDocumentIdentifier=Y={}));var W;(function(ae){function Re(ye,oe,ze,at){return{uri:ye,languageId:oe,version:ze,text:at}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&We.string(oe.languageId)&&We.integer(oe.version)&&We.string(oe.text)}a(Me,"is"),ae.is=Me})(W||(e.TextDocumentItem=W={}));var V;(function(ae){ae.PlainText="plaintext",ae.Markdown="markdown";function Re(Me){var ye=Me;return ye===ae.PlainText||ye===ae.Markdown}a(Re,"is"),ae.is=Re})(V||(e.MarkupKind=V={}));var z;(function(ae){function Re(Me){var ye=Me;return We.objectLiteral(Me)&&V.is(ye.kind)&&We.string(ye.value)}a(Re,"is"),ae.is=Re})(z||(e.MarkupContent=z={}));var ie;(function(ae){ae.Text=1,ae.Method=2,ae.Function=3,ae.Constructor=4,ae.Field=5,ae.Variable=6,ae.Class=7,ae.Interface=8,ae.Module=9,ae.Property=10,ae.Unit=11,ae.Value=12,ae.Enum=13,ae.Keyword=14,ae.Snippet=15,ae.Color=16,ae.File=17,ae.Reference=18,ae.Folder=19,ae.EnumMember=20,ae.Constant=21,ae.Struct=22,ae.Event=23,ae.Operator=24,ae.TypeParameter=25})(ie||(e.CompletionItemKind=ie={}));var H;(function(ae){ae.PlainText=1,ae.Snippet=2})(H||(e.InsertTextFormat=H={}));var re;(function(ae){ae.Deprecated=1})(re||(e.CompletionItemTag=re={}));var le;(function(ae){function Re(ye,oe,ze){return{newText:ye,insert:oe,replace:ze}}a(Re,"create"),ae.create=Re;function Me(ye){var oe=ye;return oe&&We.string(oe.newText)&&l.is(oe.insert)&&l.is(oe.replace)}a(Me,"is"),ae.is=Me})(le||(e.InsertReplaceEdit=le={}));var Le;(function(ae){ae.asIs=1,ae.adjustIndentation=2})(Le||(e.InsertTextMode=Le={}));var ge;(function(ae){function Re(Me){var ye=Me;return ye&&(We.string(ye.detail)||ye.detail===void 0)&&(We.string(ye.description)||ye.description===void 0)}a(Re,"is"),ae.is=Re})(ge||(e.CompletionItemLabelDetails=ge={}));var Ue;(function(ae){function Re(Me){return{label:Me}}a(Re,"create"),ae.create=Re})(Ue||(e.CompletionItem=Ue={}));var ke;(function(ae){function Re(Me,ye){return{items:Me||[],isIncomplete:!!ye}}a(Re,"create"),ae.create=Re})(ke||(e.CompletionList=ke={}));var X;(function(ae){function Re(ye){return ye.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(Re,"fromPlainText"),ae.fromPlainText=Re;function Me(ye){var oe=ye;return We.string(oe)||We.objectLiteral(oe)&&We.string(oe.language)&&We.string(oe.value)}a(Me,"is"),ae.is=Me})(X||(e.MarkedString=X={}));var ee;(function(ae){function Re(Me){var ye=Me;return!!ye&&We.objectLiteral(ye)&&(z.is(ye.contents)||X.is(ye.contents)||We.typedArray(ye.contents,X.is))&&(Me.range===void 0||l.is(Me.range))}a(Re,"is"),ae.is=Re})(ee||(e.Hover=ee={}));var K;(function(ae){function Re(Me,ye){return ye?{label:Me,documentation:ye}:{label:Me}}a(Re,"create"),ae.create=Re})(K||(e.ParameterInformation=K={}));var he;(function(ae){function Re(Me,ye){for(var oe=[],ze=2;ze{Ne();let Fe,Ue;if(hf.string(se)){Fe=se;let Z=be[0],ve=0,Ge=$i.ParameterStructures.auto;$i.ParameterStructures.is(Z)&&(ve=1,Ge=Z);let Qe=be.length,je=Qe-ve;switch(je){case 0:Ue=void 0;break;case 1:Ue=kt(Ge,be[ve]);break;default:if(Ge===$i.ParameterStructures.byName)throw new Error(`Received ${je} parameters for 'by Name' notification parameter structure.`);Ue=be.slice(ve,Qe).map(J=>tt(J));break}}else{let Z=be;Fe=se.method,Ue=Ht(se,Z)}let me={jsonrpc:u,method:Fe,params:Ue};return he(me),e.write(me).catch(Z=>{throw o.error("Sending notification failed."),Z})},"sendNotification"),onNotification:a((se,be)=>{Ne();let Fe;return hf.func(se)?h=se:be&&(hf.string(se)?(Fe=se,m.set(se,{type:void 0,handler:be})):(Fe=se.method,m.set(se.method,{type:se,handler:be}))),{dispose:a(()=>{Fe!==void 0?m.delete(Fe):h=void 0},"dispose")}},"onNotification"),onProgress:a((se,be,Fe)=>{if(g.has(be))throw new Error(`Progress handler for token ${be} already registered`);return g.set(be,Fe),{dispose:a(()=>{g.delete(be)},"dispose")}},"onProgress"),sendProgress:a((se,be,Fe)=>F.sendNotification(Abe.type,{token:be,value:Fe}),"sendProgress"),onUnhandledProgress:N.event,sendRequest:a((se,...be)=>{Ne(),Be();let Fe,Ue,me;if(hf.string(se)){Fe=se;let Qe=be[0],je=be[be.length-1],J=0,ae=$i.ParameterStructures.auto;$i.ParameterStructures.is(Qe)&&(J=1,ae=Qe);let Ce=be.length;TDt.CancellationToken.is(je)&&(Ce=Ce-1,me=je);let Re=Ce-J;switch(Re){case 0:Ue=void 0;break;case 1:Ue=kt(ae,be[J]);break;default:if(ae===$i.ParameterStructures.byName)throw new Error(`Received ${Re} parameters for 'by Name' request parameter structure.`);Ue=be.slice(J,Ce).map($e=>tt($e));break}}else{let Qe=be;Fe=se.method,Ue=Ht(se,Qe);let je=se.numberOfParams;me=TDt.CancellationToken.is(Qe[je])?Qe[je]:void 0}let Z=s++,ve;me&&(ve=me.onCancellationRequested(()=>{let Qe=B.sender.sendCancellation(F,Z);return Qe===void 0?(o.log(`Received no promise from cancellation strategy when cancelling id ${Z}`),Promise.resolve()):Qe.catch(()=>{o.log(`Sending cancellation messages for id ${Z} failed`)})}));let Ge={jsonrpc:u,id:Z,method:Fe,params:Ue};return K(Ge),typeof B.sender.enableCancellation=="function"&&B.sender.enableCancellation(Ge),new Promise(async(Qe,je)=>{let J=a(Re=>{Qe(Re),B.sender.cleanup(Z),ve?.dispose()},"resolveWithCleanup"),ae=a(Re=>{je(Re),B.sender.cleanup(Z),ve?.dispose()},"rejectWithCleanup"),Ce={method:Fe,timerStart:Date.now(),resolve:J,reject:ae};try{await e.write(Ge),E.set(Z,Ce)}catch(Re){throw o.error("Sending request failed."),Ce.reject(new $i.ResponseError($i.ErrorCodes.MessageWriteError,Re.message?Re.message:"Unknown reason")),Re}})},"sendRequest"),onRequest:a((se,be)=>{Ne();let Fe=null;return wDt.is(se)?(Fe=void 0,d=se):hf.string(se)?(Fe=null,be!==void 0&&(Fe=se,f.set(se,{handler:be,type:void 0}))):be!==void 0&&(Fe=se.method,f.set(se.method,{type:se,handler:be})),{dispose:a(()=>{Fe!==null&&(Fe!==void 0?f.delete(Fe):d=void 0)},"dispose")}},"onRequest"),hasPendingResponse:a(()=>E.size>0,"hasPendingResponse"),trace:a(async(se,be,Fe)=>{let Ue=!1,me=Y1.Text;Fe!==void 0&&(hf.boolean(Fe)?Ue=Fe:(Ue=Fe.sendNotification||!1,me=Fe.traceFormat||Y1.Text)),b=se,T=me,b===Ic.Off?w=void 0:w=be,Ue&&!Y()&&!W()&&await F.sendNotification(RDt.type,{value:Ic.toString(se)})},"trace"),onError:x.event,onClose:P.event,onUnhandledNotification:D.event,onDispose:L.event,end:a(()=>{e.end()},"end"),dispose:a(()=>{if(W())return;R=eP.Disposed,L.fire(void 0);let se=new $i.ResponseError($i.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let be of E.values())be.reject(se);E=new Map,v=new Map,_=new Set,y=new hzr.LinkedMap,hf.func(e.dispose)&&e.dispose(),hf.func(t.dispose)&&t.dispose()},"dispose"),listen:a(()=>{Ne(),Ie(),R=eP.Listening,t.listen(Le)},"listen"),inspect:a(()=>{(0,pzr.default)().console.log("inspect")},"inspect")};return F.onNotification(ZUe.type,se=>{if(b===Ic.Off||!w)return;let be=b===Ic.Verbose||b===Ic.Compact;w.log(se.message,be?se.verbose:void 0)}),F.onNotification(Abe.type,se=>{let be=g.get(se.token);be?be(se.value):N.fire(se)}),F}a(FEo,"createMessageConnection");Oo.createMessageConnection=FEo});var i7e=I(Bt=>{"use strict";p();Object.defineProperty(Bt,"__esModule",{value:!0});Bt.ProgressType=Bt.ProgressToken=Bt.createMessageConnection=Bt.NullLogger=Bt.ConnectionOptions=Bt.ConnectionStrategy=Bt.AbstractMessageBuffer=Bt.WriteableStreamMessageWriter=Bt.AbstractMessageWriter=Bt.MessageWriter=Bt.ReadableStreamMessageReader=Bt.AbstractMessageReader=Bt.MessageReader=Bt.SharedArrayReceiverStrategy=Bt.SharedArraySenderStrategy=Bt.CancellationToken=Bt.CancellationTokenSource=Bt.Emitter=Bt.Event=Bt.Disposable=Bt.LRUCache=Bt.Touch=Bt.LinkedMap=Bt.ParameterStructures=Bt.NotificationType9=Bt.NotificationType8=Bt.NotificationType7=Bt.NotificationType6=Bt.NotificationType5=Bt.NotificationType4=Bt.NotificationType3=Bt.NotificationType2=Bt.NotificationType1=Bt.NotificationType0=Bt.NotificationType=Bt.ErrorCodes=Bt.ResponseError=Bt.RequestType9=Bt.RequestType8=Bt.RequestType7=Bt.RequestType6=Bt.RequestType5=Bt.RequestType4=Bt.RequestType3=Bt.RequestType2=Bt.RequestType1=Bt.RequestType0=Bt.RequestType=Bt.Message=Bt.RAL=void 0;Bt.MessageStrategy=Bt.CancellationStrategy=Bt.CancellationSenderStrategy=Bt.CancellationReceiverStrategy=Bt.ConnectionError=Bt.ConnectionErrors=Bt.LogTraceNotification=Bt.SetTraceNotification=Bt.TraceFormat=Bt.TraceValues=Bt.Trace=void 0;var lu=nDt();Object.defineProperty(Bt,"Message",{enumerable:!0,get:a(function(){return lu.Message},"get")});Object.defineProperty(Bt,"RequestType",{enumerable:!0,get:a(function(){return lu.RequestType},"get")});Object.defineProperty(Bt,"RequestType0",{enumerable:!0,get:a(function(){return lu.RequestType0},"get")});Object.defineProperty(Bt,"RequestType1",{enumerable:!0,get:a(function(){return lu.RequestType1},"get")});Object.defineProperty(Bt,"RequestType2",{enumerable:!0,get:a(function(){return lu.RequestType2},"get")});Object.defineProperty(Bt,"RequestType3",{enumerable:!0,get:a(function(){return lu.RequestType3},"get")});Object.defineProperty(Bt,"RequestType4",{enumerable:!0,get:a(function(){return lu.RequestType4},"get")});Object.defineProperty(Bt,"RequestType5",{enumerable:!0,get:a(function(){return lu.RequestType5},"get")});Object.defineProperty(Bt,"RequestType6",{enumerable:!0,get:a(function(){return lu.RequestType6},"get")});Object.defineProperty(Bt,"RequestType7",{enumerable:!0,get:a(function(){return lu.RequestType7},"get")});Object.defineProperty(Bt,"RequestType8",{enumerable:!0,get:a(function(){return lu.RequestType8},"get")});Object.defineProperty(Bt,"RequestType9",{enumerable:!0,get:a(function(){return lu.RequestType9},"get")});Object.defineProperty(Bt,"ResponseError",{enumerable:!0,get:a(function(){return lu.ResponseError},"get")});Object.defineProperty(Bt,"ErrorCodes",{enumerable:!0,get:a(function(){return lu.ErrorCodes},"get")});Object.defineProperty(Bt,"NotificationType",{enumerable:!0,get:a(function(){return lu.NotificationType},"get")});Object.defineProperty(Bt,"NotificationType0",{enumerable:!0,get:a(function(){return lu.NotificationType0},"get")});Object.defineProperty(Bt,"NotificationType1",{enumerable:!0,get:a(function(){return lu.NotificationType1},"get")});Object.defineProperty(Bt,"NotificationType2",{enumerable:!0,get:a(function(){return lu.NotificationType2},"get")});Object.defineProperty(Bt,"NotificationType3",{enumerable:!0,get:a(function(){return lu.NotificationType3},"get")});Object.defineProperty(Bt,"NotificationType4",{enumerable:!0,get:a(function(){return lu.NotificationType4},"get")});Object.defineProperty(Bt,"NotificationType5",{enumerable:!0,get:a(function(){return lu.NotificationType5},"get")});Object.defineProperty(Bt,"NotificationType6",{enumerable:!0,get:a(function(){return lu.NotificationType6},"get")});Object.defineProperty(Bt,"NotificationType7",{enumerable:!0,get:a(function(){return lu.NotificationType7},"get")});Object.defineProperty(Bt,"NotificationType8",{enumerable:!0,get:a(function(){return lu.NotificationType8},"get")});Object.defineProperty(Bt,"NotificationType9",{enumerable:!0,get:a(function(){return lu.NotificationType9},"get")});Object.defineProperty(Bt,"ParameterStructures",{enumerable:!0,get:a(function(){return lu.ParameterStructures},"get")});var DDt=oDt();Object.defineProperty(Bt,"LinkedMap",{enumerable:!0,get:a(function(){return DDt.LinkedMap},"get")});Object.defineProperty(Bt,"LRUCache",{enumerable:!0,get:a(function(){return DDt.LRUCache},"get")});Object.defineProperty(Bt,"Touch",{enumerable:!0,get:a(function(){return DDt.Touch},"get")});var UEo=rzr();Object.defineProperty(Bt,"Disposable",{enumerable:!0,get:a(function(){return UEo.Disposable},"get")});var yzr=dse();Object.defineProperty(Bt,"Event",{enumerable:!0,get:a(function(){return yzr.Event},"get")});Object.defineProperty(Bt,"Emitter",{enumerable:!0,get:a(function(){return yzr.Emitter},"get")});var Ezr=WUe();Object.defineProperty(Bt,"CancellationTokenSource",{enumerable:!0,get:a(function(){return Ezr.CancellationTokenSource},"get")});Object.defineProperty(Bt,"CancellationToken",{enumerable:!0,get:a(function(){return Ezr.CancellationToken},"get")});var _zr=izr();Object.defineProperty(Bt,"SharedArraySenderStrategy",{enumerable:!0,get:a(function(){return _zr.SharedArraySenderStrategy},"get")});Object.defineProperty(Bt,"SharedArrayReceiverStrategy",{enumerable:!0,get:a(function(){return _zr.SharedArrayReceiverStrategy},"get")});var NDt=szr();Object.defineProperty(Bt,"MessageReader",{enumerable:!0,get:a(function(){return NDt.MessageReader},"get")});Object.defineProperty(Bt,"AbstractMessageReader",{enumerable:!0,get:a(function(){return NDt.AbstractMessageReader},"get")});Object.defineProperty(Bt,"ReadableStreamMessageReader",{enumerable:!0,get:a(function(){return NDt.ReadableStreamMessageReader},"get")});var MDt=dzr();Object.defineProperty(Bt,"MessageWriter",{enumerable:!0,get:a(function(){return MDt.MessageWriter},"get")});Object.defineProperty(Bt,"AbstractMessageWriter",{enumerable:!0,get:a(function(){return MDt.AbstractMessageWriter},"get")});Object.defineProperty(Bt,"WriteableStreamMessageWriter",{enumerable:!0,get:a(function(){return MDt.WriteableStreamMessageWriter},"get")});var QEo=fzr();Object.defineProperty(Bt,"AbstractMessageBuffer",{enumerable:!0,get:a(function(){return QEo.AbstractMessageBuffer},"get")});var EA=Azr();Object.defineProperty(Bt,"ConnectionStrategy",{enumerable:!0,get:a(function(){return EA.ConnectionStrategy},"get")});Object.defineProperty(Bt,"ConnectionOptions",{enumerable:!0,get:a(function(){return EA.ConnectionOptions},"get")});Object.defineProperty(Bt,"NullLogger",{enumerable:!0,get:a(function(){return EA.NullLogger},"get")});Object.defineProperty(Bt,"createMessageConnection",{enumerable:!0,get:a(function(){return EA.createMessageConnection},"get")});Object.defineProperty(Bt,"ProgressToken",{enumerable:!0,get:a(function(){return EA.ProgressToken},"get")});Object.defineProperty(Bt,"ProgressType",{enumerable:!0,get:a(function(){return EA.ProgressType},"get")});Object.defineProperty(Bt,"Trace",{enumerable:!0,get:a(function(){return EA.Trace},"get")});Object.defineProperty(Bt,"TraceValues",{enumerable:!0,get:a(function(){return EA.TraceValues},"get")});Object.defineProperty(Bt,"TraceFormat",{enumerable:!0,get:a(function(){return EA.TraceFormat},"get")});Object.defineProperty(Bt,"SetTraceNotification",{enumerable:!0,get:a(function(){return EA.SetTraceNotification},"get")});Object.defineProperty(Bt,"LogTraceNotification",{enumerable:!0,get:a(function(){return EA.LogTraceNotification},"get")});Object.defineProperty(Bt,"ConnectionErrors",{enumerable:!0,get:a(function(){return EA.ConnectionErrors},"get")});Object.defineProperty(Bt,"ConnectionError",{enumerable:!0,get:a(function(){return EA.ConnectionError},"get")});Object.defineProperty(Bt,"CancellationReceiverStrategy",{enumerable:!0,get:a(function(){return EA.CancellationReceiverStrategy},"get")});Object.defineProperty(Bt,"CancellationSenderStrategy",{enumerable:!0,get:a(function(){return EA.CancellationSenderStrategy},"get")});Object.defineProperty(Bt,"CancellationStrategy",{enumerable:!0,get:a(function(){return EA.CancellationStrategy},"get")});Object.defineProperty(Bt,"MessageStrategy",{enumerable:!0,get:a(function(){return EA.MessageStrategy},"get")});var qEo=FU();Bt.RAL=qEo.default});var bzr=I(FDt=>{"use strict";p();Object.defineProperty(FDt,"__esModule",{value:!0});var vzr=require("util"),IB=i7e(),o7e=class t extends IB.AbstractMessageBuffer{static{a(this,"MessageBuffer")}constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new vzr.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};o7e.emptyBuffer=Buffer.allocUnsafe(0);var ODt=class{static{a(this,"ReadableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),IB.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),IB.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),IB.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),IB.Disposable.create(()=>this.stream.off("data",e))}},LDt=class{static{a(this,"WritableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),IB.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),IB.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),IB.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,o)=>{let s=a(c=>{c==null?n():o(c)},"callback");typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},Czr=Object.freeze({messageBuffer:Object.freeze({create:a(t=>new o7e(t),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:a((t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}},"encode")}),decoder:Object.freeze({name:"application/json",decode:a((t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new vzr.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}},"decode")})}),stream:Object.freeze({asReadableStream:a(t=>new ODt(t),"asReadableStream"),asWritableStream:a(t=>new LDt(t),"asWritableStream")}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:a(()=>clearTimeout(n),"dispose")}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:a(()=>clearImmediate(r),"dispose")}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:a(()=>clearInterval(n),"dispose")}}})});function BDt(){return Czr}a(BDt,"RIL");(function(t){function e(){IB.RAL.install(Czr)}a(e,"install"),t.install=e})(BDt||(BDt={}));FDt.default=BDt});var ZW=I(Ia=>{"use strict";p();var jEo=Ia&&Ia.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),HEo=Ia&&Ia.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jEo(e,t,r)};Object.defineProperty(Ia,"__esModule",{value:!0});Ia.createMessageConnection=Ia.createServerSocketTransport=Ia.createClientSocketTransport=Ia.createServerPipeTransport=Ia.createClientPipeTransport=Ia.generateRandomPipeName=Ia.StreamMessageWriter=Ia.StreamMessageReader=Ia.SocketMessageWriter=Ia.SocketMessageReader=Ia.PortMessageWriter=Ia.PortMessageReader=Ia.IPCMessageWriter=Ia.IPCMessageReader=void 0;var gse=bzr();gse.default.install();var Szr=require("path"),GEo=require("os"),$Eo=require("crypto"),c7e=require("net"),K1=i7e();HEo(i7e(),Ia);var UDt=class extends K1.AbstractMessageReader{static{a(this,"IPCMessageReader")}constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),K1.Disposable.create(()=>this.process.off("message",e))}};Ia.IPCMessageReader=UDt;var QDt=class extends K1.AbstractMessageWriter{static{a(this,"IPCMessageWriter")}constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Ia.IPCMessageWriter=QDt;var qDt=class extends K1.AbstractMessageReader{static{a(this,"PortMessageReader")}constructor(e){super(),this.onData=new K1.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};Ia.PortMessageReader=qDt;var jDt=class extends K1.AbstractMessageWriter{static{a(this,"PortMessageWriter")}constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Ia.PortMessageWriter=jDt;var KW=class extends K1.ReadableStreamMessageReader{static{a(this,"SocketMessageReader")}constructor(e,r="utf-8"){super((0,gse.default)().stream.asReadableStream(e),r)}};Ia.SocketMessageReader=KW;var JW=class extends K1.WriteableStreamMessageWriter{static{a(this,"SocketMessageWriter")}constructor(e,r){super((0,gse.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ia.SocketMessageWriter=JW;var s7e=class extends K1.ReadableStreamMessageReader{static{a(this,"StreamMessageReader")}constructor(e,r){super((0,gse.default)().stream.asReadableStream(e),r)}};Ia.StreamMessageReader=s7e;var a7e=class extends K1.WriteableStreamMessageWriter{static{a(this,"StreamMessageWriter")}constructor(e,r){super((0,gse.default)().stream.asWritableStream(e),r)}};Ia.StreamMessageWriter=a7e;var Tzr=process.env.XDG_RUNTIME_DIR,VEo=new Map([["linux",107],["darwin",103]]);function WEo(){let t=(0,$Eo.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;Tzr?e=Szr.join(Tzr,`vscode-ipc-${t}.sock`):e=Szr.join(GEo.tmpdir(),`vscode-${t}.sock`);let r=VEo.get(process.platform);return r!==void 0&&e.length>r&&(0,gse.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}a(WEo,"generateRandomPipeName");Ia.generateRandomPipeName=WEo;function zEo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,c7e.createServer)(l=>{c.close(),r([new KW(l,e),new JW(l,e)])});c.on("error",s),c.listen(t,()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(zEo,"createClientPipeTransport");Ia.createClientPipeTransport=zEo;function YEo(t,e="utf-8"){let r=(0,c7e.createConnection)(t);return[new KW(r,e),new JW(r,e)]}a(YEo,"createServerPipeTransport");Ia.createServerPipeTransport=YEo;function KEo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,c7e.createServer)(l=>{c.close(),r([new KW(l,e),new JW(l,e)])});c.on("error",s),c.listen(t,"127.0.0.1",()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(KEo,"createClientSocketTransport");Ia.createClientSocketTransport=KEo;function JEo(t,e="utf-8"){let r=(0,c7e.createConnection)(t,"127.0.0.1");return[new KW(r,e),new JW(r,e)]}a(JEo,"createServerSocketTransport");Ia.createServerSocketTransport=JEo;function ZEo(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}a(ZEo,"isReadableStream");function XEo(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}a(XEo,"isWritableStream");function e_o(t,e,r,n){r||(r=K1.NullLogger);let o=ZEo(t)?new s7e(t):t,s=XEo(e)?new a7e(e):e;return K1.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,K1.createMessageConnection)(o,s,r,n)}a(e_o,"createMessageConnection");Ia.createMessageConnection=e_o});var HDt=I((GRl,Izr)=>{"use strict";p();Izr.exports=ZW()});var _be=I((xzr,l7e)=>{p();(function(t){if(typeof l7e=="object"&&typeof l7e.exports=="object"){var e=t(require,xzr);e!==void 0&&(l7e.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var r;(function(ce){function Pe(Me){return typeof Me=="string"}a(Pe,"is"),ce.is=Pe})(r||(e.DocumentUri=r={}));var n;(function(ce){function Pe(Me){return typeof Me=="string"}a(Pe,"is"),ce.is=Pe})(n||(e.URI=n={}));var o;(function(ce){ce.MIN_VALUE=-2147483648,ce.MAX_VALUE=2147483647;function Pe(Me){return typeof Me=="number"&&ce.MIN_VALUE<=Me&&Me<=ce.MAX_VALUE}a(Pe,"is"),ce.is=Pe})(o||(e.integer=o={}));var s;(function(ce){ce.MIN_VALUE=0,ce.MAX_VALUE=2147483647;function Pe(Me){return typeof Me=="number"&&ce.MIN_VALUE<=Me&&Me<=ce.MAX_VALUE}a(Pe,"is"),ce.is=Pe})(s||(e.uinteger=s={}));var c;(function(ce){function Pe(ye,oe){return ye===Number.MAX_VALUE&&(ye=s.MAX_VALUE),oe===Number.MAX_VALUE&&(oe=s.MAX_VALUE),{line:ye,character:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.uinteger(oe.line)&&We.uinteger(oe.character)}a(Me,"is"),ce.is=Me})(c||(e.Position=c={}));var l;(function(ce){function Pe(ye,oe,Ke,at){if(We.uinteger(ye)&&We.uinteger(oe)&&We.uinteger(Ke)&&We.uinteger(at))return{start:c.create(ye,oe),end:c.create(Ke,at)};if(c.is(ye)&&c.is(oe))return{start:ye,end:oe};throw new Error("Range#create called with invalid arguments[".concat(ye,", ").concat(oe,", ").concat(Ke,", ").concat(at,"]"))}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&c.is(oe.start)&&c.is(oe.end)}a(Me,"is"),ce.is=Me})(l||(e.Range=l={}));var u;(function(ce){function Pe(ye,oe){return{uri:ye,range:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.range)&&(We.string(oe.uri)||We.undefined(oe.uri))}a(Me,"is"),ce.is=Me})(u||(e.Location=u={}));var d;(function(ce){function Pe(ye,oe,Ke,at){return{targetUri:ye,targetRange:oe,targetSelectionRange:Ke,originSelectionRange:at}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.targetRange)&&We.string(oe.targetUri)&&l.is(oe.targetSelectionRange)&&(l.is(oe.originSelectionRange)||We.undefined(oe.originSelectionRange))}a(Me,"is"),ce.is=Me})(d||(e.LocationLink=d={}));var f;(function(ce){function Pe(ye,oe,Ke,at){return{red:ye,green:oe,blue:Ke,alpha:at}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.numberRange(oe.red,0,1)&&We.numberRange(oe.green,0,1)&&We.numberRange(oe.blue,0,1)&&We.numberRange(oe.alpha,0,1)}a(Me,"is"),ce.is=Me})(f||(e.Color=f={}));var h;(function(ce){function Pe(ye,oe){return{range:ye,color:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&l.is(oe.range)&&f.is(oe.color)}a(Me,"is"),ce.is=Me})(h||(e.ColorInformation=h={}));var m;(function(ce){function Pe(ye,oe,Ke){return{label:ye,textEdit:oe,additionalTextEdits:Ke}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.string(oe.label)&&(We.undefined(oe.textEdit)||w.is(oe))&&(We.undefined(oe.additionalTextEdits)||We.typedArray(oe.additionalTextEdits,w.is))}a(Me,"is"),ce.is=Me})(m||(e.ColorPresentation=m={}));var g;(function(ce){ce.Comment="comment",ce.Imports="imports",ce.Region="region"})(g||(e.FoldingRangeKind=g={}));var A;(function(ce){function Pe(ye,oe,Ke,at,Gt,gr){var ar={startLine:ye,endLine:oe};return We.defined(Ke)&&(ar.startCharacter=Ke),We.defined(at)&&(ar.endCharacter=at),We.defined(Gt)&&(ar.kind=Gt),We.defined(gr)&&(ar.collapsedText=gr),ar}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.uinteger(oe.startLine)&&We.uinteger(oe.startLine)&&(We.undefined(oe.startCharacter)||We.uinteger(oe.startCharacter))&&(We.undefined(oe.endCharacter)||We.uinteger(oe.endCharacter))&&(We.undefined(oe.kind)||We.string(oe.kind))}a(Me,"is"),ce.is=Me})(A||(e.FoldingRange=A={}));var y;(function(ce){function Pe(ye,oe){return{location:ye,message:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&u.is(oe.location)&&We.string(oe.message)}a(Me,"is"),ce.is=Me})(y||(e.DiagnosticRelatedInformation=y={}));var E;(function(ce){ce.Error=1,ce.Warning=2,ce.Information=3,ce.Hint=4})(E||(e.DiagnosticSeverity=E={}));var _;(function(ce){ce.Unnecessary=1,ce.Deprecated=2})(_||(e.DiagnosticTag=_={}));var v;(function(ce){function Pe(Me){var ye=Me;return We.objectLiteral(ye)&&We.string(ye.href)}a(Pe,"is"),ce.is=Pe})(v||(e.CodeDescription=v={}));var b;(function(ce){function Pe(ye,oe,Ke,at,Gt,gr){var ar={range:ye,message:oe};return We.defined(Ke)&&(ar.severity=Ke),We.defined(at)&&(ar.code=at),We.defined(Gt)&&(ar.source=Gt),We.defined(gr)&&(ar.relatedInformation=gr),ar}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe,Ke=ye;return We.defined(Ke)&&l.is(Ke.range)&&We.string(Ke.message)&&(We.number(Ke.severity)||We.undefined(Ke.severity))&&(We.integer(Ke.code)||We.string(Ke.code)||We.undefined(Ke.code))&&(We.undefined(Ke.codeDescription)||We.string((oe=Ke.codeDescription)===null||oe===void 0?void 0:oe.href))&&(We.string(Ke.source)||We.undefined(Ke.source))&&(We.undefined(Ke.relatedInformation)||We.typedArray(Ke.relatedInformation,y.is))}a(Me,"is"),ce.is=Me})(b||(e.Diagnostic=b={}));var T;(function(ce){function Pe(ye,oe){for(var Ke=[],at=2;at0&&(Gt.arguments=Ke),Gt}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.title)&&We.string(oe.command)}a(Me,"is"),ce.is=Me})(T||(e.Command=T={}));var w;(function(ce){function Pe(Ke,at){return{range:Ke,newText:at}}a(Pe,"replace"),ce.replace=Pe;function Me(Ke,at){return{range:{start:Ke,end:Ke},newText:at}}a(Me,"insert"),ce.insert=Me;function ye(Ke){return{range:Ke,newText:""}}a(ye,"del"),ce.del=ye;function oe(Ke){var at=Ke;return We.objectLiteral(at)&&We.string(at.newText)&&l.is(at.range)}a(oe,"is"),ce.is=oe})(w||(e.TextEdit=w={}));var R;(function(ce){function Pe(ye,oe,Ke){var at={label:ye};return oe!==void 0&&(at.needsConfirmation=oe),Ke!==void 0&&(at.description=Ke),at}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.objectLiteral(oe)&&We.string(oe.label)&&(We.boolean(oe.needsConfirmation)||oe.needsConfirmation===void 0)&&(We.string(oe.description)||oe.description===void 0)}a(Me,"is"),ce.is=Me})(R||(e.ChangeAnnotation=R={}));var x;(function(ce){function Pe(Me){var ye=Me;return We.string(ye)}a(Pe,"is"),ce.is=Pe})(x||(e.ChangeAnnotationIdentifier=x={}));var P;(function(ce){function Pe(Ke,at,Gt){return{range:Ke,newText:at,annotationId:Gt}}a(Pe,"replace"),ce.replace=Pe;function Me(Ke,at,Gt){return{range:{start:Ke,end:Ke},newText:at,annotationId:Gt}}a(Me,"insert"),ce.insert=Me;function ye(Ke,at){return{range:Ke,newText:"",annotationId:at}}a(ye,"del"),ce.del=ye;function oe(Ke){var at=Ke;return w.is(at)&&(R.is(at.annotationId)||x.is(at.annotationId))}a(oe,"is"),ce.is=oe})(P||(e.AnnotatedTextEdit=P={}));var D;(function(ce){function Pe(ye,oe){return{textDocument:ye,edits:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&Y.is(oe.textDocument)&&Array.isArray(oe.edits)}a(Me,"is"),ce.is=Me})(D||(e.TextDocumentEdit=D={}));var N;(function(ce){function Pe(ye,oe,Ke){var at={kind:"create",uri:ye};return oe!==void 0&&(oe.overwrite!==void 0||oe.ignoreIfExists!==void 0)&&(at.options=oe),Ke!==void 0&&(at.annotationId=Ke),at}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return oe&&oe.kind==="create"&&We.string(oe.uri)&&(oe.options===void 0||(oe.options.overwrite===void 0||We.boolean(oe.options.overwrite))&&(oe.options.ignoreIfExists===void 0||We.boolean(oe.options.ignoreIfExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ce.is=Me})(N||(e.CreateFile=N={}));var L;(function(ce){function Pe(ye,oe,Ke,at){var Gt={kind:"rename",oldUri:ye,newUri:oe};return Ke!==void 0&&(Ke.overwrite!==void 0||Ke.ignoreIfExists!==void 0)&&(Gt.options=Ke),at!==void 0&&(Gt.annotationId=at),Gt}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return oe&&oe.kind==="rename"&&We.string(oe.oldUri)&&We.string(oe.newUri)&&(oe.options===void 0||(oe.options.overwrite===void 0||We.boolean(oe.options.overwrite))&&(oe.options.ignoreIfExists===void 0||We.boolean(oe.options.ignoreIfExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ce.is=Me})(L||(e.RenameFile=L={}));var B;(function(ce){function Pe(ye,oe,Ke){var at={kind:"delete",uri:ye};return oe!==void 0&&(oe.recursive!==void 0||oe.ignoreIfNotExists!==void 0)&&(at.options=oe),Ke!==void 0&&(at.annotationId=Ke),at}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return oe&&oe.kind==="delete"&&We.string(oe.uri)&&(oe.options===void 0||(oe.options.recursive===void 0||We.boolean(oe.options.recursive))&&(oe.options.ignoreIfNotExists===void 0||We.boolean(oe.options.ignoreIfNotExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ce.is=Me})(B||(e.DeleteFile=B={}));var j;(function(ce){function Pe(Me){var ye=Me;return ye&&(ye.changes!==void 0||ye.documentChanges!==void 0)&&(ye.documentChanges===void 0||ye.documentChanges.every(function(oe){return We.string(oe.kind)?N.is(oe)||L.is(oe)||B.is(oe):D.is(oe)}))}a(Pe,"is"),ce.is=Pe})(j||(e.WorkspaceEdit=j={}));var M=(function(){function ce(Pe,Me){this.edits=Pe,this.changeAnnotations=Me}return a(ce,"TextEditChangeImpl"),ce.prototype.insert=function(Pe,Me,ye){var oe,Ke;if(ye===void 0?oe=w.insert(Pe,Me):x.is(ye)?(Ke=ye,oe=P.insert(Pe,Me,ye)):(this.assertChangeAnnotations(this.changeAnnotations),Ke=this.changeAnnotations.manage(ye),oe=P.insert(Pe,Me,Ke)),this.edits.push(oe),Ke!==void 0)return Ke},ce.prototype.replace=function(Pe,Me,ye){var oe,Ke;if(ye===void 0?oe=w.replace(Pe,Me):x.is(ye)?(Ke=ye,oe=P.replace(Pe,Me,ye)):(this.assertChangeAnnotations(this.changeAnnotations),Ke=this.changeAnnotations.manage(ye),oe=P.replace(Pe,Me,Ke)),this.edits.push(oe),Ke!==void 0)return Ke},ce.prototype.delete=function(Pe,Me){var ye,oe;if(Me===void 0?ye=w.del(Pe):x.is(Me)?(oe=Me,ye=P.del(Pe,Me)):(this.assertChangeAnnotations(this.changeAnnotations),oe=this.changeAnnotations.manage(Me),ye=P.del(Pe,oe)),this.edits.push(ye),oe!==void 0)return oe},ce.prototype.add=function(Pe){this.edits.push(Pe)},ce.prototype.all=function(){return this.edits},ce.prototype.clear=function(){this.edits.splice(0,this.edits.length)},ce.prototype.assertChangeAnnotations=function(Pe){if(Pe===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},ce})(),O=(function(){function ce(Pe){this._annotations=Pe===void 0?Object.create(null):Pe,this._counter=0,this._size=0}return a(ce,"ChangeAnnotations"),ce.prototype.all=function(){return this._annotations},Object.defineProperty(ce.prototype,"size",{get:a(function(){return this._size},"get"),enumerable:!1,configurable:!0}),ce.prototype.manage=function(Pe,Me){var ye;if(x.is(Pe)?ye=Pe:(ye=this.nextId(),Me=Pe),this._annotations[ye]!==void 0)throw new Error("Id ".concat(ye," is already in use."));if(Me===void 0)throw new Error("No annotation provided for id ".concat(ye));return this._annotations[ye]=Me,this._size++,ye},ce.prototype.nextId=function(){return this._counter++,this._counter.toString()},ce})(),U=(function(){function ce(Pe){var Me=this;this._textEditChanges=Object.create(null),Pe!==void 0?(this._workspaceEdit=Pe,Pe.documentChanges?(this._changeAnnotations=new O(Pe.changeAnnotations),Pe.changeAnnotations=this._changeAnnotations.all(),Pe.documentChanges.forEach(function(ye){if(D.is(ye)){var oe=new M(ye.edits,Me._changeAnnotations);Me._textEditChanges[ye.textDocument.uri]=oe}})):Pe.changes&&Object.keys(Pe.changes).forEach(function(ye){var oe=new M(Pe.changes[ye]);Me._textEditChanges[ye]=oe})):this._workspaceEdit={}}return a(ce,"WorkspaceChange"),Object.defineProperty(ce.prototype,"edit",{get:a(function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},"get"),enumerable:!1,configurable:!0}),ce.prototype.getTextEditChange=function(Pe){if(Y.is(Pe)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var Me={uri:Pe.uri,version:Pe.version},ye=this._textEditChanges[Me.uri];if(!ye){var oe=[],Ke={textDocument:Me,edits:oe};this._workspaceEdit.documentChanges.push(Ke),ye=new M(oe,this._changeAnnotations),this._textEditChanges[Me.uri]=ye}return ye}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var ye=this._textEditChanges[Pe];if(!ye){var oe=[];this._workspaceEdit.changes[Pe]=oe,ye=new M(oe),this._textEditChanges[Pe]=ye}return ye}},ce.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new O,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},ce.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},ce.prototype.createFile=function(Pe,Me,ye){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var oe;R.is(Me)||x.is(Me)?oe=Me:ye=Me;var Ke,at;if(oe===void 0?Ke=N.create(Pe,ye):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),Ke=N.create(Pe,ye,at)),this._workspaceEdit.documentChanges.push(Ke),at!==void 0)return at},ce.prototype.renameFile=function(Pe,Me,ye,oe){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var Ke;R.is(ye)||x.is(ye)?Ke=ye:oe=ye;var at,Gt;if(Ke===void 0?at=L.create(Pe,Me,oe):(Gt=x.is(Ke)?Ke:this._changeAnnotations.manage(Ke),at=L.create(Pe,Me,oe,Gt)),this._workspaceEdit.documentChanges.push(at),Gt!==void 0)return Gt},ce.prototype.deleteFile=function(Pe,Me,ye){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var oe;R.is(Me)||x.is(Me)?oe=Me:ye=Me;var Ke,at;if(oe===void 0?Ke=B.create(Pe,ye):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),Ke=B.create(Pe,ye,at)),this._workspaceEdit.documentChanges.push(Ke),at!==void 0)return at},ce})();e.WorkspaceChange=U;var q;(function(ce){function Pe(ye){return{uri:ye}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)}a(Me,"is"),ce.is=Me})(q||(e.TextDocumentIdentifier=q={}));var Q;(function(ce){function Pe(ye,oe){return{uri:ye,version:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&We.integer(oe.version)}a(Me,"is"),ce.is=Me})(Q||(e.VersionedTextDocumentIdentifier=Q={}));var Y;(function(ce){function Pe(ye,oe){return{uri:ye,version:oe}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&(oe.version===null||We.integer(oe.version))}a(Me,"is"),ce.is=Me})(Y||(e.OptionalVersionedTextDocumentIdentifier=Y={}));var W;(function(ce){function Pe(ye,oe,Ke,at){return{uri:ye,languageId:oe,version:Ke,text:at}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return We.defined(oe)&&We.string(oe.uri)&&We.string(oe.languageId)&&We.integer(oe.version)&&We.string(oe.text)}a(Me,"is"),ce.is=Me})(W||(e.TextDocumentItem=W={}));var V;(function(ce){ce.PlainText="plaintext",ce.Markdown="markdown";function Pe(Me){var ye=Me;return ye===ce.PlainText||ye===ce.Markdown}a(Pe,"is"),ce.is=Pe})(V||(e.MarkupKind=V={}));var z;(function(ce){function Pe(Me){var ye=Me;return We.objectLiteral(Me)&&V.is(ye.kind)&&We.string(ye.value)}a(Pe,"is"),ce.is=Pe})(z||(e.MarkupContent=z={}));var ie;(function(ce){ce.Text=1,ce.Method=2,ce.Function=3,ce.Constructor=4,ce.Field=5,ce.Variable=6,ce.Class=7,ce.Interface=8,ce.Module=9,ce.Property=10,ce.Unit=11,ce.Value=12,ce.Enum=13,ce.Keyword=14,ce.Snippet=15,ce.Color=16,ce.File=17,ce.Reference=18,ce.Folder=19,ce.EnumMember=20,ce.Constant=21,ce.Struct=22,ce.Event=23,ce.Operator=24,ce.TypeParameter=25})(ie||(e.CompletionItemKind=ie={}));var H;(function(ce){ce.PlainText=1,ce.Snippet=2})(H||(e.InsertTextFormat=H={}));var te;(function(ce){ce.Deprecated=1})(te||(e.CompletionItemTag=te={}));var le;(function(ce){function Pe(ye,oe,Ke){return{newText:ye,insert:oe,replace:Ke}}a(Pe,"create"),ce.create=Pe;function Me(ye){var oe=ye;return oe&&We.string(oe.newText)&&l.is(oe.insert)&&l.is(oe.replace)}a(Me,"is"),ce.is=Me})(le||(e.InsertReplaceEdit=le={}));var Le;(function(ce){ce.asIs=1,ce.adjustIndentation=2})(Le||(e.InsertTextMode=Le={}));var ge;(function(ce){function Pe(Me){var ye=Me;return ye&&(We.string(ye.detail)||ye.detail===void 0)&&(We.string(ye.description)||ye.description===void 0)}a(Pe,"is"),ce.is=Pe})(ge||(e.CompletionItemLabelDetails=ge={}));var Oe;(function(ce){function Pe(Me){return{label:Me}}a(Pe,"create"),ce.create=Pe})(Oe||(e.CompletionItem=Oe={}));var we;(function(ce){function Pe(Me,ye){return{items:Me||[],isIncomplete:!!ye}}a(Pe,"create"),ce.create=Pe})(we||(e.CompletionList=we={}));var re;(function(ce){function Pe(ye){return ye.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(Pe,"fromPlainText"),ce.fromPlainText=Pe;function Me(ye){var oe=ye;return We.string(oe)||We.objectLiteral(oe)&&We.string(oe.language)&&We.string(oe.value)}a(Me,"is"),ce.is=Me})(re||(e.MarkedString=re={}));var ee;(function(ce){function Pe(Me){var ye=Me;return!!ye&&We.objectLiteral(ye)&&(z.is(ye.contents)||re.is(ye.contents)||We.typedArray(ye.contents,re.is))&&(Me.range===void 0||l.is(Me.range))}a(Pe,"is"),ce.is=Pe})(ee||(e.Hover=ee={}));var K;(function(ce){function Pe(Me,ye){return ye?{label:Me,documentation:ye}:{label:Me}}a(Pe,"create"),ce.create=Pe})(K||(e.ParameterInformation=K={}));var he;(function(ce){function Pe(Me,ye){for(var oe=[],Ke=2;Ke=0;Mr--){var Hr=gr[Mr],Gr=ze.offsetAt(Hr.range.start),Yt=ze.offsetAt(Hr.range.end);if(Yt<=cr)Vt=Vt.substring(0,Gr)+Hr.newText+Vt.substring(Yt,Vt.length);else throw new Error("Overlapping edit");cr=Gr}return Vt}a(ye,"applyEdits"),ae.applyEdits=ye;function oe(ze,at){if(ze.length<=1)return ze;var Vt=ze.length/2|0,gr=ze.slice(0,Vt),cr=ze.slice(Vt);oe(gr,at),oe(cr,at);for(var Mr=0,Hr=0,Gr=0;Mr0&&Re.push(Me.length),this._lineOffsets=Re}return this._lineOffsets},ae.prototype.positionAt=function(Re){Re=Math.max(Math.min(Re,this._content.length),0);var Me=this.getLineOffsets(),ye=0,oe=Me.length;if(oe===0)return c.create(0,Re);for(;yeRe?oe=ze:ye=ze+1}var at=ye-1;return c.create(at,Re-Me[at])},ae.prototype.offsetAt=function(Re){var Me=this.getLineOffsets();if(Re.line>=Me.length)return this._content.length;if(Re.line<0)return 0;var ye=Me[Re.line],oe=Re.line+1"u"}a(ye,"undefined"),ae.undefined=ye;function oe(Yt){return Yt===!0||Yt===!1}a(oe,"boolean"),ae.boolean=oe;function ze(Yt){return Re.call(Yt)==="[object String]"}a(ze,"string"),ae.string=ze;function at(Yt){return Re.call(Yt)==="[object Number]"}a(at,"number"),ae.number=at;function Vt(Yt,_r,$0){return Re.call(Yt)==="[object Number]"&&_r<=Yt&&Yt<=$0}a(Vt,"numberRange"),ae.numberRange=Vt;function gr(Yt){return Re.call(Yt)==="[object Number]"&&-2147483648<=Yt&&Yt<=2147483647}a(gr,"integer"),ae.integer=gr;function cr(Yt){return Re.call(Yt)==="[object Number]"&&0<=Yt&&Yt<=2147483647}a(cr,"uinteger"),ae.uinteger=cr;function Mr(Yt){return Re.call(Yt)==="[object Function]"}a(Mr,"func"),ae.func=Mr;function Hr(Yt){return Yt!==null&&typeof Yt=="object"}a(Hr,"objectLiteral"),ae.objectLiteral=Hr;function Gr(Yt,_r){return Array.isArray(Yt)&&Yt.every(_r)}a(Gr,"typedArray"),ae.typedArray=Gr})(We||(We={}))})});var Pd=I(uC=>{"use strict";p();Object.defineProperty(uC,"__esModule",{value:!0});uC.ProtocolNotificationType=uC.ProtocolNotificationType0=uC.ProtocolRequestType=uC.ProtocolRequestType0=uC.RegistrationType=uC.MessageDirection=void 0;var ase=QW(),EWr;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(EWr||(uC.MessageDirection=EWr={}));var EDt=class{static{a(this,"RegistrationType")}constructor(e){this.method=e}};uC.RegistrationType=EDt;var _Dt=class extends ase.RequestType0{static{a(this,"ProtocolRequestType0")}constructor(e){super(e)}};uC.ProtocolRequestType0=_Dt;var vDt=class extends ase.RequestType{static{a(this,"ProtocolRequestType")}constructor(e){super(e,ase.ParameterStructures.byName)}};uC.ProtocolRequestType=vDt;var CDt=class extends ase.NotificationType0{static{a(this,"ProtocolNotificationType0")}constructor(e){super(e)}};uC.ProtocolNotificationType0=CDt;var bDt=class extends ase.NotificationType{static{a(this,"ProtocolNotificationType")}constructor(e){super(e,ase.ParameterStructures.byName)}};uC.ProtocolNotificationType=bDt});var FUe=I(wh=>{"use strict";p();Object.defineProperty(wh,"__esModule",{value:!0});wh.objectLiteral=wh.typedArray=wh.stringArray=wh.array=wh.func=wh.error=wh.number=wh.string=wh.boolean=void 0;function zAo(t){return t===!0||t===!1}a(zAo,"boolean");wh.boolean=zAo;function _Wr(t){return typeof t=="string"||t instanceof String}a(_Wr,"string");wh.string=_Wr;function YAo(t){return typeof t=="number"||t instanceof Number}a(YAo,"number");wh.number=YAo;function KAo(t){return t instanceof Error}a(KAo,"error");wh.error=KAo;function JAo(t){return typeof t=="function"}a(JAo,"func");wh.func=JAo;function vWr(t){return Array.isArray(t)}a(vWr,"array");wh.array=vWr;function ZAo(t){return vWr(t)&&t.every(e=>_Wr(e))}a(ZAo,"stringArray");wh.stringArray=ZAo;function XAo(t,e){return Array.isArray(t)&&t.every(e)}a(XAo,"typedArray");wh.typedArray=XAo;function eyo(t){return t!==null&&typeof t=="object"}a(eyo,"objectLiteral");wh.objectLiteral=eyo});var SWr=I(UUe=>{"use strict";p();Object.defineProperty(UUe,"__esModule",{value:!0});UUe.ImplementationRequest=void 0;var CWr=Pd(),bWr;(function(t){t.method="textDocument/implementation",t.messageDirection=CWr.MessageDirection.clientToServer,t.type=new CWr.ProtocolRequestType(t.method)})(bWr||(UUe.ImplementationRequest=bWr={}))});var xWr=I(QUe=>{"use strict";p();Object.defineProperty(QUe,"__esModule",{value:!0});QUe.TypeDefinitionRequest=void 0;var TWr=Pd(),IWr;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=TWr.MessageDirection.clientToServer,t.type=new TWr.ProtocolRequestType(t.method)})(IWr||(QUe.TypeDefinitionRequest=IWr={}))});var kWr=I(cse=>{"use strict";p();Object.defineProperty(cse,"__esModule",{value:!0});cse.DidChangeWorkspaceFoldersNotification=cse.WorkspaceFoldersRequest=void 0;var qUe=Pd(),wWr;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=qUe.MessageDirection.serverToClient,t.type=new qUe.ProtocolRequestType0(t.method)})(wWr||(cse.WorkspaceFoldersRequest=wWr={}));var RWr;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=qUe.MessageDirection.clientToServer,t.type=new qUe.ProtocolNotificationType(t.method)})(RWr||(cse.DidChangeWorkspaceFoldersNotification=RWr={}))});var NWr=I(jUe=>{"use strict";p();Object.defineProperty(jUe,"__esModule",{value:!0});jUe.ConfigurationRequest=void 0;var PWr=Pd(),DWr;(function(t){t.method="workspace/configuration",t.messageDirection=PWr.MessageDirection.serverToClient,t.type=new PWr.ProtocolRequestType(t.method)})(DWr||(jUe.ConfigurationRequest=DWr={}))});var LWr=I(lse=>{"use strict";p();Object.defineProperty(lse,"__esModule",{value:!0});lse.ColorPresentationRequest=lse.DocumentColorRequest=void 0;var HUe=Pd(),MWr;(function(t){t.method="textDocument/documentColor",t.messageDirection=HUe.MessageDirection.clientToServer,t.type=new HUe.ProtocolRequestType(t.method)})(MWr||(lse.DocumentColorRequest=MWr={}));var OWr;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=HUe.MessageDirection.clientToServer,t.type=new HUe.ProtocolRequestType(t.method)})(OWr||(lse.ColorPresentationRequest=OWr={}))});var UWr=I(use=>{"use strict";p();Object.defineProperty(use,"__esModule",{value:!0});use.FoldingRangeRefreshRequest=use.FoldingRangeRequest=void 0;var GUe=Pd(),BWr;(function(t){t.method="textDocument/foldingRange",t.messageDirection=GUe.MessageDirection.clientToServer,t.type=new GUe.ProtocolRequestType(t.method)})(BWr||(use.FoldingRangeRequest=BWr={}));var FWr;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=GUe.MessageDirection.serverToClient,t.type=new GUe.ProtocolRequestType0(t.method)})(FWr||(use.FoldingRangeRefreshRequest=FWr={}))});var jWr=I($Ue=>{"use strict";p();Object.defineProperty($Ue,"__esModule",{value:!0});$Ue.DeclarationRequest=void 0;var QWr=Pd(),qWr;(function(t){t.method="textDocument/declaration",t.messageDirection=QWr.MessageDirection.clientToServer,t.type=new QWr.ProtocolRequestType(t.method)})(qWr||($Ue.DeclarationRequest=qWr={}))});var $Wr=I(VUe=>{"use strict";p();Object.defineProperty(VUe,"__esModule",{value:!0});VUe.SelectionRangeRequest=void 0;var HWr=Pd(),GWr;(function(t){t.method="textDocument/selectionRange",t.messageDirection=HWr.MessageDirection.clientToServer,t.type=new HWr.ProtocolRequestType(t.method)})(GWr||(VUe.SelectionRangeRequest=GWr={}))});var YWr=I(RU=>{"use strict";p();Object.defineProperty(RU,"__esModule",{value:!0});RU.WorkDoneProgressCancelNotification=RU.WorkDoneProgressCreateRequest=RU.WorkDoneProgress=void 0;var tyo=QW(),WUe=Pd(),VWr;(function(t){t.type=new tyo.ProgressType;function e(r){return r===t.type}a(e,"is"),t.is=e})(VWr||(RU.WorkDoneProgress=VWr={}));var WWr;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=WUe.MessageDirection.serverToClient,t.type=new WUe.ProtocolRequestType(t.method)})(WWr||(RU.WorkDoneProgressCreateRequest=WWr={}));var zWr;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=WUe.MessageDirection.clientToServer,t.type=new WUe.ProtocolNotificationType(t.method)})(zWr||(RU.WorkDoneProgressCancelNotification=zWr={}))});var XWr=I(kU=>{"use strict";p();Object.defineProperty(kU,"__esModule",{value:!0});kU.CallHierarchyOutgoingCallsRequest=kU.CallHierarchyIncomingCallsRequest=kU.CallHierarchyPrepareRequest=void 0;var dse=Pd(),KWr;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=dse.MessageDirection.clientToServer,t.type=new dse.ProtocolRequestType(t.method)})(KWr||(kU.CallHierarchyPrepareRequest=KWr={}));var JWr;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=dse.MessageDirection.clientToServer,t.type=new dse.ProtocolRequestType(t.method)})(JWr||(kU.CallHierarchyIncomingCallsRequest=JWr={}));var ZWr;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=dse.MessageDirection.clientToServer,t.type=new dse.ProtocolRequestType(t.method)})(ZWr||(kU.CallHierarchyOutgoingCallsRequest=ZWr={}))});var ozr=I(dC=>{"use strict";p();Object.defineProperty(dC,"__esModule",{value:!0});dC.SemanticTokensRefreshRequest=dC.SemanticTokensRangeRequest=dC.SemanticTokensDeltaRequest=dC.SemanticTokensRequest=dC.SemanticTokensRegistrationType=dC.TokenFormat=void 0;var vB=Pd(),ezr;(function(t){t.Relative="relative"})(ezr||(dC.TokenFormat=ezr={}));var tbe;(function(t){t.method="textDocument/semanticTokens",t.type=new vB.RegistrationType(t.method)})(tbe||(dC.SemanticTokensRegistrationType=tbe={}));var tzr;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=vB.MessageDirection.clientToServer,t.type=new vB.ProtocolRequestType(t.method),t.registrationMethod=tbe.method})(tzr||(dC.SemanticTokensRequest=tzr={}));var rzr;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=vB.MessageDirection.clientToServer,t.type=new vB.ProtocolRequestType(t.method),t.registrationMethod=tbe.method})(rzr||(dC.SemanticTokensDeltaRequest=rzr={}));var nzr;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=vB.MessageDirection.clientToServer,t.type=new vB.ProtocolRequestType(t.method),t.registrationMethod=tbe.method})(nzr||(dC.SemanticTokensRangeRequest=nzr={}));var izr;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=vB.MessageDirection.serverToClient,t.type=new vB.ProtocolRequestType0(t.method)})(izr||(dC.SemanticTokensRefreshRequest=izr={}))});var czr=I(zUe=>{"use strict";p();Object.defineProperty(zUe,"__esModule",{value:!0});zUe.ShowDocumentRequest=void 0;var szr=Pd(),azr;(function(t){t.method="window/showDocument",t.messageDirection=szr.MessageDirection.serverToClient,t.type=new szr.ProtocolRequestType(t.method)})(azr||(zUe.ShowDocumentRequest=azr={}))});var dzr=I(YUe=>{"use strict";p();Object.defineProperty(YUe,"__esModule",{value:!0});YUe.LinkedEditingRangeRequest=void 0;var lzr=Pd(),uzr;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=lzr.MessageDirection.clientToServer,t.type=new lzr.ProtocolRequestType(t.method)})(uzr||(YUe.LinkedEditingRangeRequest=uzr={}))});var Ezr=I(Hy=>{"use strict";p();Object.defineProperty(Hy,"__esModule",{value:!0});Hy.WillDeleteFilesRequest=Hy.DidDeleteFilesNotification=Hy.DidRenameFilesNotification=Hy.WillRenameFilesRequest=Hy.DidCreateFilesNotification=Hy.WillCreateFilesRequest=Hy.FileOperationPatternKind=void 0;var YI=Pd(),fzr;(function(t){t.file="file",t.folder="folder"})(fzr||(Hy.FileOperationPatternKind=fzr={}));var pzr;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolRequestType(t.method)})(pzr||(Hy.WillCreateFilesRequest=pzr={}));var hzr;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolNotificationType(t.method)})(hzr||(Hy.DidCreateFilesNotification=hzr={}));var mzr;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolRequestType(t.method)})(mzr||(Hy.WillRenameFilesRequest=mzr={}));var gzr;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolNotificationType(t.method)})(gzr||(Hy.DidRenameFilesNotification=gzr={}));var Azr;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolNotificationType(t.method)})(Azr||(Hy.DidDeleteFilesNotification=Azr={}));var yzr;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=YI.MessageDirection.clientToServer,t.type=new YI.ProtocolRequestType(t.method)})(yzr||(Hy.WillDeleteFilesRequest=yzr={}))});var Szr=I(PU=>{"use strict";p();Object.defineProperty(PU,"__esModule",{value:!0});PU.MonikerRequest=PU.MonikerKind=PU.UniquenessLevel=void 0;var _zr=Pd(),vzr;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(vzr||(PU.UniquenessLevel=vzr={}));var Czr;(function(t){t.$import="import",t.$export="export",t.local="local"})(Czr||(PU.MonikerKind=Czr={}));var bzr;(function(t){t.method="textDocument/moniker",t.messageDirection=_zr.MessageDirection.clientToServer,t.type=new _zr.ProtocolRequestType(t.method)})(bzr||(PU.MonikerRequest=bzr={}))});var wzr=I(DU=>{"use strict";p();Object.defineProperty(DU,"__esModule",{value:!0});DU.TypeHierarchySubtypesRequest=DU.TypeHierarchySupertypesRequest=DU.TypeHierarchyPrepareRequest=void 0;var fse=Pd(),Tzr;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=fse.MessageDirection.clientToServer,t.type=new fse.ProtocolRequestType(t.method)})(Tzr||(DU.TypeHierarchyPrepareRequest=Tzr={}));var Izr;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=fse.MessageDirection.clientToServer,t.type=new fse.ProtocolRequestType(t.method)})(Izr||(DU.TypeHierarchySupertypesRequest=Izr={}));var xzr;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=fse.MessageDirection.clientToServer,t.type=new fse.ProtocolRequestType(t.method)})(xzr||(DU.TypeHierarchySubtypesRequest=xzr={}))});var Pzr=I(pse=>{"use strict";p();Object.defineProperty(pse,"__esModule",{value:!0});pse.InlineValueRefreshRequest=pse.InlineValueRequest=void 0;var KUe=Pd(),Rzr;(function(t){t.method="textDocument/inlineValue",t.messageDirection=KUe.MessageDirection.clientToServer,t.type=new KUe.ProtocolRequestType(t.method)})(Rzr||(pse.InlineValueRequest=Rzr={}));var kzr;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=KUe.MessageDirection.serverToClient,t.type=new KUe.ProtocolRequestType0(t.method)})(kzr||(pse.InlineValueRefreshRequest=kzr={}))});var Ozr=I(NU=>{"use strict";p();Object.defineProperty(NU,"__esModule",{value:!0});NU.InlayHintRefreshRequest=NU.InlayHintResolveRequest=NU.InlayHintRequest=void 0;var hse=Pd(),Dzr;(function(t){t.method="textDocument/inlayHint",t.messageDirection=hse.MessageDirection.clientToServer,t.type=new hse.ProtocolRequestType(t.method)})(Dzr||(NU.InlayHintRequest=Dzr={}));var Nzr;(function(t){t.method="inlayHint/resolve",t.messageDirection=hse.MessageDirection.clientToServer,t.type=new hse.ProtocolRequestType(t.method)})(Nzr||(NU.InlayHintResolveRequest=Nzr={}));var Mzr;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=hse.MessageDirection.serverToClient,t.type=new hse.ProtocolRequestType0(t.method)})(Mzr||(NU.InlayHintRefreshRequest=Mzr={}))});var jzr=I(KI=>{"use strict";p();Object.defineProperty(KI,"__esModule",{value:!0});KI.DiagnosticRefreshRequest=KI.WorkspaceDiagnosticRequest=KI.DocumentDiagnosticRequest=KI.DocumentDiagnosticReportKind=KI.DiagnosticServerCancellationData=void 0;var qzr=QW(),ryo=FUe(),mse=Pd(),Lzr;(function(t){function e(r){let n=r;return n&&ryo.boolean(n.retriggerRequest)}a(e,"is"),t.is=e})(Lzr||(KI.DiagnosticServerCancellationData=Lzr={}));var Bzr;(function(t){t.Full="full",t.Unchanged="unchanged"})(Bzr||(KI.DocumentDiagnosticReportKind=Bzr={}));var Fzr;(function(t){t.method="textDocument/diagnostic",t.messageDirection=mse.MessageDirection.clientToServer,t.type=new mse.ProtocolRequestType(t.method),t.partialResult=new qzr.ProgressType})(Fzr||(KI.DocumentDiagnosticRequest=Fzr={}));var Uzr;(function(t){t.method="workspace/diagnostic",t.messageDirection=mse.MessageDirection.clientToServer,t.type=new mse.ProtocolRequestType(t.method),t.partialResult=new qzr.ProgressType})(Uzr||(KI.WorkspaceDiagnosticRequest=Uzr={}));var Qzr;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=mse.MessageDirection.serverToClient,t.type=new mse.ProtocolRequestType0(t.method)})(Qzr||(KI.DiagnosticRefreshRequest=Qzr={}))});var Yzr=I(Hf=>{"use strict";p();Object.defineProperty(Hf,"__esModule",{value:!0});Hf.DidCloseNotebookDocumentNotification=Hf.DidSaveNotebookDocumentNotification=Hf.DidChangeNotebookDocumentNotification=Hf.NotebookCellArrayChange=Hf.DidOpenNotebookDocumentNotification=Hf.NotebookDocumentSyncRegistrationType=Hf.NotebookDocument=Hf.NotebookCell=Hf.ExecutionSummary=Hf.NotebookCellKind=void 0;var rbe=ebe(),Vk=FUe(),iM=Pd(),SDt;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(SDt||(Hf.NotebookCellKind=SDt={}));var TDt;(function(t){function e(o,s){let c={executionOrder:o};return(s===!0||s===!1)&&(c.success=s),c}a(e,"create"),t.create=e;function r(o){let s=o;return Vk.objectLiteral(s)&&rbe.uinteger.is(s.executionOrder)&&(s.success===void 0||Vk.boolean(s.success))}a(r,"is"),t.is=r;function n(o,s){return o===s?!0:o==null||s===null||s===void 0?!1:o.executionOrder===s.executionOrder&&o.success===s.success}a(n,"equals"),t.equals=n})(TDt||(Hf.ExecutionSummary=TDt={}));var JUe;(function(t){function e(s,c){return{kind:s,document:c}}a(e,"create"),t.create=e;function r(s){let c=s;return Vk.objectLiteral(c)&&SDt.is(c.kind)&&rbe.DocumentUri.is(c.document)&&(c.metadata===void 0||Vk.objectLiteral(c.metadata))}a(r,"is"),t.is=r;function n(s,c){let l=new Set;return s.document!==c.document&&l.add("document"),s.kind!==c.kind&&l.add("kind"),s.executionSummary!==c.executionSummary&&l.add("executionSummary"),(s.metadata!==void 0||c.metadata!==void 0)&&!o(s.metadata,c.metadata)&&l.add("metadata"),(s.executionSummary!==void 0||c.executionSummary!==void 0)&&!TDt.equals(s.executionSummary,c.executionSummary)&&l.add("executionSummary"),l}a(n,"diff"),t.diff=n;function o(s,c){if(s===c)return!0;if(s==null||c===null||c===void 0||typeof s!=typeof c||typeof s!="object")return!1;let l=Array.isArray(s),u=Array.isArray(c);if(l!==u)return!1;if(l&&u){if(s.length!==c.length)return!1;for(let d=0;d{"use strict";p();Object.defineProperty(ZUe,"__esModule",{value:!0});ZUe.InlineCompletionRequest=void 0;var Kzr=Pd(),Jzr;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=Kzr.MessageDirection.clientToServer,t.type=new Kzr.ProtocolRequestType(t.method)})(Jzr||(ZUe.InlineCompletionRequest=Jzr={}))});var dKr=I(Ve=>{"use strict";p();Object.defineProperty(Ve,"__esModule",{value:!0});Ve.WorkspaceSymbolRequest=Ve.CodeActionResolveRequest=Ve.CodeActionRequest=Ve.DocumentSymbolRequest=Ve.DocumentHighlightRequest=Ve.ReferencesRequest=Ve.DefinitionRequest=Ve.SignatureHelpRequest=Ve.SignatureHelpTriggerKind=Ve.HoverRequest=Ve.CompletionResolveRequest=Ve.CompletionRequest=Ve.CompletionTriggerKind=Ve.PublishDiagnosticsNotification=Ve.WatchKind=Ve.RelativePattern=Ve.FileChangeType=Ve.DidChangeWatchedFilesNotification=Ve.WillSaveTextDocumentWaitUntilRequest=Ve.WillSaveTextDocumentNotification=Ve.TextDocumentSaveReason=Ve.DidSaveTextDocumentNotification=Ve.DidCloseTextDocumentNotification=Ve.DidChangeTextDocumentNotification=Ve.TextDocumentContentChangeEvent=Ve.DidOpenTextDocumentNotification=Ve.TextDocumentSyncKind=Ve.TelemetryEventNotification=Ve.LogMessageNotification=Ve.ShowMessageRequest=Ve.ShowMessageNotification=Ve.MessageType=Ve.DidChangeConfigurationNotification=Ve.ExitNotification=Ve.ShutdownRequest=Ve.InitializedNotification=Ve.InitializeErrorCodes=Ve.InitializeRequest=Ve.WorkDoneProgressOptions=Ve.TextDocumentRegistrationOptions=Ve.StaticRegistrationOptions=Ve.PositionEncodingKind=Ve.FailureHandlingKind=Ve.ResourceOperationKind=Ve.UnregistrationRequest=Ve.RegistrationRequest=Ve.DocumentSelector=Ve.NotebookCellTextDocumentFilter=Ve.NotebookDocumentFilter=Ve.TextDocumentFilter=void 0;Ve.MonikerRequest=Ve.MonikerKind=Ve.UniquenessLevel=Ve.WillDeleteFilesRequest=Ve.DidDeleteFilesNotification=Ve.WillRenameFilesRequest=Ve.DidRenameFilesNotification=Ve.WillCreateFilesRequest=Ve.DidCreateFilesNotification=Ve.FileOperationPatternKind=Ve.LinkedEditingRangeRequest=Ve.ShowDocumentRequest=Ve.SemanticTokensRegistrationType=Ve.SemanticTokensRefreshRequest=Ve.SemanticTokensRangeRequest=Ve.SemanticTokensDeltaRequest=Ve.SemanticTokensRequest=Ve.TokenFormat=Ve.CallHierarchyPrepareRequest=Ve.CallHierarchyOutgoingCallsRequest=Ve.CallHierarchyIncomingCallsRequest=Ve.WorkDoneProgressCancelNotification=Ve.WorkDoneProgressCreateRequest=Ve.WorkDoneProgress=Ve.SelectionRangeRequest=Ve.DeclarationRequest=Ve.FoldingRangeRefreshRequest=Ve.FoldingRangeRequest=Ve.ColorPresentationRequest=Ve.DocumentColorRequest=Ve.ConfigurationRequest=Ve.DidChangeWorkspaceFoldersNotification=Ve.WorkspaceFoldersRequest=Ve.TypeDefinitionRequest=Ve.ImplementationRequest=Ve.ApplyWorkspaceEditRequest=Ve.ExecuteCommandRequest=Ve.PrepareRenameRequest=Ve.RenameRequest=Ve.PrepareSupportDefaultBehavior=Ve.DocumentOnTypeFormattingRequest=Ve.DocumentRangesFormattingRequest=Ve.DocumentRangeFormattingRequest=Ve.DocumentFormattingRequest=Ve.DocumentLinkResolveRequest=Ve.DocumentLinkRequest=Ve.CodeLensRefreshRequest=Ve.CodeLensResolveRequest=Ve.CodeLensRequest=Ve.WorkspaceSymbolResolveRequest=void 0;Ve.InlineCompletionRequest=Ve.DidCloseNotebookDocumentNotification=Ve.DidSaveNotebookDocumentNotification=Ve.DidChangeNotebookDocumentNotification=Ve.NotebookCellArrayChange=Ve.DidOpenNotebookDocumentNotification=Ve.NotebookDocumentSyncRegistrationType=Ve.NotebookDocument=Ve.NotebookCell=Ve.ExecutionSummary=Ve.NotebookCellKind=Ve.DiagnosticRefreshRequest=Ve.WorkspaceDiagnosticRequest=Ve.DocumentDiagnosticRequest=Ve.DocumentDiagnosticReportKind=Ve.DiagnosticServerCancellationData=Ve.InlayHintRefreshRequest=Ve.InlayHintResolveRequest=Ve.InlayHintRequest=Ve.InlineValueRefreshRequest=Ve.InlineValueRequest=Ve.TypeHierarchySupertypesRequest=Ve.TypeHierarchySubtypesRequest=Ve.TypeHierarchyPrepareRequest=void 0;var br=Pd(),Xzr=ebe(),Z0=FUe(),nyo=SWr();Object.defineProperty(Ve,"ImplementationRequest",{enumerable:!0,get:a(function(){return nyo.ImplementationRequest},"get")});var iyo=xWr();Object.defineProperty(Ve,"TypeDefinitionRequest",{enumerable:!0,get:a(function(){return iyo.TypeDefinitionRequest},"get")});var aKr=kWr();Object.defineProperty(Ve,"WorkspaceFoldersRequest",{enumerable:!0,get:a(function(){return aKr.WorkspaceFoldersRequest},"get")});Object.defineProperty(Ve,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:a(function(){return aKr.DidChangeWorkspaceFoldersNotification},"get")});var oyo=NWr();Object.defineProperty(Ve,"ConfigurationRequest",{enumerable:!0,get:a(function(){return oyo.ConfigurationRequest},"get")});var cKr=LWr();Object.defineProperty(Ve,"DocumentColorRequest",{enumerable:!0,get:a(function(){return cKr.DocumentColorRequest},"get")});Object.defineProperty(Ve,"ColorPresentationRequest",{enumerable:!0,get:a(function(){return cKr.ColorPresentationRequest},"get")});var lKr=UWr();Object.defineProperty(Ve,"FoldingRangeRequest",{enumerable:!0,get:a(function(){return lKr.FoldingRangeRequest},"get")});Object.defineProperty(Ve,"FoldingRangeRefreshRequest",{enumerable:!0,get:a(function(){return lKr.FoldingRangeRefreshRequest},"get")});var syo=jWr();Object.defineProperty(Ve,"DeclarationRequest",{enumerable:!0,get:a(function(){return syo.DeclarationRequest},"get")});var ayo=$Wr();Object.defineProperty(Ve,"SelectionRangeRequest",{enumerable:!0,get:a(function(){return ayo.SelectionRangeRequest},"get")});var kDt=YWr();Object.defineProperty(Ve,"WorkDoneProgress",{enumerable:!0,get:a(function(){return kDt.WorkDoneProgress},"get")});Object.defineProperty(Ve,"WorkDoneProgressCreateRequest",{enumerable:!0,get:a(function(){return kDt.WorkDoneProgressCreateRequest},"get")});Object.defineProperty(Ve,"WorkDoneProgressCancelNotification",{enumerable:!0,get:a(function(){return kDt.WorkDoneProgressCancelNotification},"get")});var PDt=XWr();Object.defineProperty(Ve,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:a(function(){return PDt.CallHierarchyIncomingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:a(function(){return PDt.CallHierarchyOutgoingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return PDt.CallHierarchyPrepareRequest},"get")});var Ase=ozr();Object.defineProperty(Ve,"TokenFormat",{enumerable:!0,get:a(function(){return Ase.TokenFormat},"get")});Object.defineProperty(Ve,"SemanticTokensRequest",{enumerable:!0,get:a(function(){return Ase.SemanticTokensRequest},"get")});Object.defineProperty(Ve,"SemanticTokensDeltaRequest",{enumerable:!0,get:a(function(){return Ase.SemanticTokensDeltaRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRangeRequest",{enumerable:!0,get:a(function(){return Ase.SemanticTokensRangeRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRefreshRequest",{enumerable:!0,get:a(function(){return Ase.SemanticTokensRefreshRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRegistrationType",{enumerable:!0,get:a(function(){return Ase.SemanticTokensRegistrationType},"get")});var cyo=czr();Object.defineProperty(Ve,"ShowDocumentRequest",{enumerable:!0,get:a(function(){return cyo.ShowDocumentRequest},"get")});var lyo=dzr();Object.defineProperty(Ve,"LinkedEditingRangeRequest",{enumerable:!0,get:a(function(){return lyo.LinkedEditingRangeRequest},"get")});var qW=Ezr();Object.defineProperty(Ve,"FileOperationPatternKind",{enumerable:!0,get:a(function(){return qW.FileOperationPatternKind},"get")});Object.defineProperty(Ve,"DidCreateFilesNotification",{enumerable:!0,get:a(function(){return qW.DidCreateFilesNotification},"get")});Object.defineProperty(Ve,"WillCreateFilesRequest",{enumerable:!0,get:a(function(){return qW.WillCreateFilesRequest},"get")});Object.defineProperty(Ve,"DidRenameFilesNotification",{enumerable:!0,get:a(function(){return qW.DidRenameFilesNotification},"get")});Object.defineProperty(Ve,"WillRenameFilesRequest",{enumerable:!0,get:a(function(){return qW.WillRenameFilesRequest},"get")});Object.defineProperty(Ve,"DidDeleteFilesNotification",{enumerable:!0,get:a(function(){return qW.DidDeleteFilesNotification},"get")});Object.defineProperty(Ve,"WillDeleteFilesRequest",{enumerable:!0,get:a(function(){return qW.WillDeleteFilesRequest},"get")});var DDt=Szr();Object.defineProperty(Ve,"UniquenessLevel",{enumerable:!0,get:a(function(){return DDt.UniquenessLevel},"get")});Object.defineProperty(Ve,"MonikerKind",{enumerable:!0,get:a(function(){return DDt.MonikerKind},"get")});Object.defineProperty(Ve,"MonikerRequest",{enumerable:!0,get:a(function(){return DDt.MonikerRequest},"get")});var NDt=wzr();Object.defineProperty(Ve,"TypeHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return NDt.TypeHierarchyPrepareRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySubtypesRequest",{enumerable:!0,get:a(function(){return NDt.TypeHierarchySubtypesRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySupertypesRequest",{enumerable:!0,get:a(function(){return NDt.TypeHierarchySupertypesRequest},"get")});var uKr=Pzr();Object.defineProperty(Ve,"InlineValueRequest",{enumerable:!0,get:a(function(){return uKr.InlineValueRequest},"get")});Object.defineProperty(Ve,"InlineValueRefreshRequest",{enumerable:!0,get:a(function(){return uKr.InlineValueRefreshRequest},"get")});var MDt=Ozr();Object.defineProperty(Ve,"InlayHintRequest",{enumerable:!0,get:a(function(){return MDt.InlayHintRequest},"get")});Object.defineProperty(Ve,"InlayHintResolveRequest",{enumerable:!0,get:a(function(){return MDt.InlayHintResolveRequest},"get")});Object.defineProperty(Ve,"InlayHintRefreshRequest",{enumerable:!0,get:a(function(){return MDt.InlayHintRefreshRequest},"get")});var nbe=jzr();Object.defineProperty(Ve,"DiagnosticServerCancellationData",{enumerable:!0,get:a(function(){return nbe.DiagnosticServerCancellationData},"get")});Object.defineProperty(Ve,"DocumentDiagnosticReportKind",{enumerable:!0,get:a(function(){return nbe.DocumentDiagnosticReportKind},"get")});Object.defineProperty(Ve,"DocumentDiagnosticRequest",{enumerable:!0,get:a(function(){return nbe.DocumentDiagnosticRequest},"get")});Object.defineProperty(Ve,"WorkspaceDiagnosticRequest",{enumerable:!0,get:a(function(){return nbe.WorkspaceDiagnosticRequest},"get")});Object.defineProperty(Ve,"DiagnosticRefreshRequest",{enumerable:!0,get:a(function(){return nbe.DiagnosticRefreshRequest},"get")});var oM=Yzr();Object.defineProperty(Ve,"NotebookCellKind",{enumerable:!0,get:a(function(){return oM.NotebookCellKind},"get")});Object.defineProperty(Ve,"ExecutionSummary",{enumerable:!0,get:a(function(){return oM.ExecutionSummary},"get")});Object.defineProperty(Ve,"NotebookCell",{enumerable:!0,get:a(function(){return oM.NotebookCell},"get")});Object.defineProperty(Ve,"NotebookDocument",{enumerable:!0,get:a(function(){return oM.NotebookDocument},"get")});Object.defineProperty(Ve,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:a(function(){return oM.NotebookDocumentSyncRegistrationType},"get")});Object.defineProperty(Ve,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:a(function(){return oM.DidOpenNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"NotebookCellArrayChange",{enumerable:!0,get:a(function(){return oM.NotebookCellArrayChange},"get")});Object.defineProperty(Ve,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:a(function(){return oM.DidChangeNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:a(function(){return oM.DidSaveNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:a(function(){return oM.DidCloseNotebookDocumentNotification},"get")});var uyo=Zzr();Object.defineProperty(Ve,"InlineCompletionRequest",{enumerable:!0,get:a(function(){return uyo.InlineCompletionRequest},"get")});var IDt;(function(t){function e(r){let n=r;return Z0.string(n)||Z0.string(n.language)||Z0.string(n.scheme)||Z0.string(n.pattern)}a(e,"is"),t.is=e})(IDt||(Ve.TextDocumentFilter=IDt={}));var xDt;(function(t){function e(r){let n=r;return Z0.objectLiteral(n)&&(Z0.string(n.notebookType)||Z0.string(n.scheme)||Z0.string(n.pattern))}a(e,"is"),t.is=e})(xDt||(Ve.NotebookDocumentFilter=xDt={}));var wDt;(function(t){function e(r){let n=r;return Z0.objectLiteral(n)&&(Z0.string(n.notebook)||xDt.is(n.notebook))&&(n.language===void 0||Z0.string(n.language))}a(e,"is"),t.is=e})(wDt||(Ve.NotebookCellTextDocumentFilter=wDt={}));var RDt;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Z0.string(n)&&!IDt.is(n)&&!wDt.is(n))return!1;return!0}a(e,"is"),t.is=e})(RDt||(Ve.DocumentSelector=RDt={}));var eYr;(function(t){t.method="client/registerCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(eYr||(Ve.RegistrationRequest=eYr={}));var tYr;(function(t){t.method="client/unregisterCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(tYr||(Ve.UnregistrationRequest=tYr={}));var rYr;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(rYr||(Ve.ResourceOperationKind=rYr={}));var nYr;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(nYr||(Ve.FailureHandlingKind=nYr={}));var iYr;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(iYr||(Ve.PositionEncodingKind=iYr={}));var oYr;(function(t){function e(r){let n=r;return n&&Z0.string(n.id)&&n.id.length>0}a(e,"hasId"),t.hasId=e})(oYr||(Ve.StaticRegistrationOptions=oYr={}));var sYr;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||RDt.is(n.documentSelector))}a(e,"is"),t.is=e})(sYr||(Ve.TextDocumentRegistrationOptions=sYr={}));var aYr;(function(t){function e(n){let o=n;return Z0.objectLiteral(o)&&(o.workDoneProgress===void 0||Z0.boolean(o.workDoneProgress))}a(e,"is"),t.is=e;function r(n){let o=n;return o&&Z0.boolean(o.workDoneProgress)}a(r,"hasWorkDoneProgress"),t.hasWorkDoneProgress=r})(aYr||(Ve.WorkDoneProgressOptions=aYr={}));var cYr;(function(t){t.method="initialize",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(cYr||(Ve.InitializeRequest=cYr={}));var lYr;(function(t){t.unknownProtocolVersion=1})(lYr||(Ve.InitializeErrorCodes=lYr={}));var uYr;(function(t){t.method="initialized",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(uYr||(Ve.InitializedNotification=uYr={}));var dYr;(function(t){t.method="shutdown",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType0(t.method)})(dYr||(Ve.ShutdownRequest=dYr={}));var fYr;(function(t){t.method="exit",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType0(t.method)})(fYr||(Ve.ExitNotification=fYr={}));var pYr;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(pYr||(Ve.DidChangeConfigurationNotification=pYr={}));var hYr;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(hYr||(Ve.MessageType=hYr={}));var mYr;(function(t){t.method="window/showMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(mYr||(Ve.ShowMessageNotification=mYr={}));var gYr;(function(t){t.method="window/showMessageRequest",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(gYr||(Ve.ShowMessageRequest=gYr={}));var AYr;(function(t){t.method="window/logMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(AYr||(Ve.LogMessageNotification=AYr={}));var yYr;(function(t){t.method="telemetry/event",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(yYr||(Ve.TelemetryEventNotification=yYr={}));var EYr;(function(t){t.None=0,t.Full=1,t.Incremental=2})(EYr||(Ve.TextDocumentSyncKind=EYr={}));var _Yr;(function(t){t.method="textDocument/didOpen",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(_Yr||(Ve.DidOpenTextDocumentNotification=_Yr={}));var vYr;(function(t){function e(n){let o=n;return o!=null&&typeof o.text=="string"&&o.range!==void 0&&(o.rangeLength===void 0||typeof o.rangeLength=="number")}a(e,"isIncremental"),t.isIncremental=e;function r(n){let o=n;return o!=null&&typeof o.text=="string"&&o.range===void 0&&o.rangeLength===void 0}a(r,"isFull"),t.isFull=r})(vYr||(Ve.TextDocumentContentChangeEvent=vYr={}));var CYr;(function(t){t.method="textDocument/didChange",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(CYr||(Ve.DidChangeTextDocumentNotification=CYr={}));var bYr;(function(t){t.method="textDocument/didClose",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(bYr||(Ve.DidCloseTextDocumentNotification=bYr={}));var SYr;(function(t){t.method="textDocument/didSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(SYr||(Ve.DidSaveTextDocumentNotification=SYr={}));var TYr;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(TYr||(Ve.TextDocumentSaveReason=TYr={}));var IYr;(function(t){t.method="textDocument/willSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(IYr||(Ve.WillSaveTextDocumentNotification=IYr={}));var xYr;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(xYr||(Ve.WillSaveTextDocumentWaitUntilRequest=xYr={}));var wYr;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(wYr||(Ve.DidChangeWatchedFilesNotification=wYr={}));var RYr;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(RYr||(Ve.FileChangeType=RYr={}));var kYr;(function(t){function e(r){let n=r;return Z0.objectLiteral(n)&&(Xzr.URI.is(n.baseUri)||Xzr.WorkspaceFolder.is(n.baseUri))&&Z0.string(n.pattern)}a(e,"is"),t.is=e})(kYr||(Ve.RelativePattern=kYr={}));var PYr;(function(t){t.Create=1,t.Change=2,t.Delete=4})(PYr||(Ve.WatchKind=PYr={}));var DYr;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(DYr||(Ve.PublishDiagnosticsNotification=DYr={}));var NYr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(NYr||(Ve.CompletionTriggerKind=NYr={}));var MYr;(function(t){t.method="textDocument/completion",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(MYr||(Ve.CompletionRequest=MYr={}));var OYr;(function(t){t.method="completionItem/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(OYr||(Ve.CompletionResolveRequest=OYr={}));var LYr;(function(t){t.method="textDocument/hover",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(LYr||(Ve.HoverRequest=LYr={}));var BYr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(BYr||(Ve.SignatureHelpTriggerKind=BYr={}));var FYr;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(FYr||(Ve.SignatureHelpRequest=FYr={}));var UYr;(function(t){t.method="textDocument/definition",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(UYr||(Ve.DefinitionRequest=UYr={}));var QYr;(function(t){t.method="textDocument/references",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(QYr||(Ve.ReferencesRequest=QYr={}));var qYr;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(qYr||(Ve.DocumentHighlightRequest=qYr={}));var jYr;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(jYr||(Ve.DocumentSymbolRequest=jYr={}));var HYr;(function(t){t.method="textDocument/codeAction",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(HYr||(Ve.CodeActionRequest=HYr={}));var GYr;(function(t){t.method="codeAction/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(GYr||(Ve.CodeActionResolveRequest=GYr={}));var $Yr;(function(t){t.method="workspace/symbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})($Yr||(Ve.WorkspaceSymbolRequest=$Yr={}));var VYr;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(VYr||(Ve.WorkspaceSymbolResolveRequest=VYr={}));var WYr;(function(t){t.method="textDocument/codeLens",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(WYr||(Ve.CodeLensRequest=WYr={}));var zYr;(function(t){t.method="codeLens/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(zYr||(Ve.CodeLensResolveRequest=zYr={}));var YYr;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType0(t.method)})(YYr||(Ve.CodeLensRefreshRequest=YYr={}));var KYr;(function(t){t.method="textDocument/documentLink",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(KYr||(Ve.DocumentLinkRequest=KYr={}));var JYr;(function(t){t.method="documentLink/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(JYr||(Ve.DocumentLinkResolveRequest=JYr={}));var ZYr;(function(t){t.method="textDocument/formatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(ZYr||(Ve.DocumentFormattingRequest=ZYr={}));var XYr;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(XYr||(Ve.DocumentRangeFormattingRequest=XYr={}));var eKr;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(eKr||(Ve.DocumentRangesFormattingRequest=eKr={}));var tKr;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(tKr||(Ve.DocumentOnTypeFormattingRequest=tKr={}));var rKr;(function(t){t.Identifier=1})(rKr||(Ve.PrepareSupportDefaultBehavior=rKr={}));var nKr;(function(t){t.method="textDocument/rename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(nKr||(Ve.RenameRequest=nKr={}));var iKr;(function(t){t.method="textDocument/prepareRename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(iKr||(Ve.PrepareRenameRequest=iKr={}));var oKr;(function(t){t.method="workspace/executeCommand",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(oKr||(Ve.ExecuteCommandRequest=oKr={}));var sKr;(function(t){t.method="workspace/applyEdit",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType("workspace/applyEdit")})(sKr||(Ve.ApplyWorkspaceEditRequest=sKr={}))});var pKr=I(XUe=>{"use strict";p();Object.defineProperty(XUe,"__esModule",{value:!0});XUe.createProtocolConnection=void 0;var fKr=QW();function dyo(t,e,r,n){return fKr.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,fKr.createMessageConnection)(t,e,r,n)}a(dyo,"createProtocolConnection");XUe.createProtocolConnection=dyo});var mKr=I(fC=>{"use strict";p();var fyo=fC&&fC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),e7e=fC&&fC.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fyo(e,t,r)};Object.defineProperty(fC,"__esModule",{value:!0});fC.LSPErrorCodes=fC.createProtocolConnection=void 0;e7e(QW(),fC);e7e(ebe(),fC);e7e(Pd(),fC);e7e(dKr(),fC);var pyo=pKr();Object.defineProperty(fC,"createProtocolConnection",{enumerable:!0,get:a(function(){return pyo.createProtocolConnection},"get")});var hKr;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(hKr||(fC.LSPErrorCodes=hKr={}))});var ri=I(sM=>{"use strict";p();var hyo=sM&&sM.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gKr=sM&&sM.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hyo(e,t,r)};Object.defineProperty(sM,"__esModule",{value:!0});sM.createProtocolConnection=void 0;var myo=yDt();gKr(yDt(),sM);gKr(mKr(),sM);function gyo(t,e,r,n){return(0,myo.createMessageConnection)(t,e,r,n)}a(gyo,"createProtocolConnection");sM.createProtocolConnection=gyo});var q5t=I(kje=>{"use strict";p();Object.defineProperty(kje,"__esModule",{value:!0});kje.state=void 0;kje.state={instrumenterImplementation:void 0}});var Tce=I((_Bt,_nn)=>{p();var kHe=require("buffer"),HM=kHe.Buffer;function Enn(t,e){for(var r in t)e[r]=t[r]}a(Enn,"copyProps");HM.from&&HM.alloc&&HM.allocUnsafe&&HM.allocUnsafeSlow?_nn.exports=kHe:(Enn(kHe,_Bt),_Bt.Buffer=vY);function vY(t,e,r){return HM(t,e,r)}a(vY,"SafeBuffer");vY.prototype=Object.create(HM.prototype);Enn(HM,vY);vY.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return HM(t,e,r)};vY.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=HM(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};vY.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return HM(t)};vY.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return kHe.SlowBuffer(t)}});var vBt=I((ZJl,vnn)=>{p();var PHe=Tce().Buffer,PTo=require("stream"),DTo=require("util");function DHe(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=PHe.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=PHe.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}a(DHe,"DataStream");DTo.inherits(DHe,PTo);DHe.prototype.write=a(function(e){this.buffer=PHe.concat([this.buffer,PHe.from(e)]),this.emit("data",e)},"write");DHe.prototype.end=a(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");vnn.exports=DHe});var bnn=I((tZl,Cnn)=>{"use strict";p();function CBt(t){var e=(t/8|0)+(t%8===0?0:1);return e}a(CBt,"getParamSize");var NTo={ES256:CBt(256),ES384:CBt(384),ES512:CBt(521)};function MTo(t){var e=NTo[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}a(MTo,"getParamBytesForAlg");Cnn.exports=MTo});var knn=I((iZl,Rnn)=>{"use strict";p();var NHe=Tce().Buffer,Tnn=bnn(),MHe=128,Inn=0,OTo=32,LTo=16,BTo=2,xnn=LTo|OTo|Inn<<6,OHe=BTo|Inn<<6;function FTo(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(FTo,"base64Url");function wnn(t){if(NHe.isBuffer(t))return t;if(typeof t=="string")return NHe.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}a(wnn,"signatureAsBuffer");function UTo(t,e){t=wnn(t);var r=Tnn(e),n=r+1,o=t.length,s=0;if(t[s++]!==xnn)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(MHe|1)&&(c=t[s++]),o-s=MHe;return o&&--n,n}a(Snn,"countPadding");function QTo(t,e){t=wnn(t);var r=Tnn(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var o=Snn(t,0,r),s=Snn(t,r,t.length),c=r-o,l=r-s,u=2+c+1+1+l,d=u{"use strict";p();var tTe=require("buffer").Buffer,bBt=require("buffer").SlowBuffer;Pnn.exports=LHe;function LHe(t,e){if(!tTe.isBuffer(t)||!tTe.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n{p();var xce=Tce().Buffer,xx=require("crypto"),Mnn=knn(),Nnn=require("util"),HTo=`"%s" is not a valid algorithm. +`,"\r"];var $t;(function(ce){function Pe(Ke,at,Gt,gr){return new St(Ke,at,Gt,gr)}a(Pe,"create"),ce.create=Pe;function Me(Ke){var at=Ke;return!!(We.defined(at)&&We.string(at.uri)&&(We.undefined(at.languageId)||We.string(at.languageId))&&We.uinteger(at.lineCount)&&We.func(at.getText)&&We.func(at.positionAt)&&We.func(at.offsetAt))}a(Me,"is"),ce.is=Me;function ye(Ke,at){for(var Gt=Ke.getText(),gr=oe(at,function(_r,W0){var Eqr=_r.range.start.line-W0.range.start.line;return Eqr===0?_r.range.start.character-W0.range.start.character:Eqr}),ar=Gt.length,Or=gr.length-1;Or>=0;Or--){var Hr=gr[Or],Gr=Ke.offsetAt(Hr.range.start),zt=Ke.offsetAt(Hr.range.end);if(zt<=ar)Gt=Gt.substring(0,Gr)+Hr.newText+Gt.substring(zt,Gt.length);else throw new Error("Overlapping edit");ar=Gr}return Gt}a(ye,"applyEdits"),ce.applyEdits=ye;function oe(Ke,at){if(Ke.length<=1)return Ke;var Gt=Ke.length/2|0,gr=Ke.slice(0,Gt),ar=Ke.slice(Gt);oe(gr,at),oe(ar,at);for(var Or=0,Hr=0,Gr=0;Or0&&Pe.push(Me.length),this._lineOffsets=Pe}return this._lineOffsets},ce.prototype.positionAt=function(Pe){Pe=Math.max(Math.min(Pe,this._content.length),0);var Me=this.getLineOffsets(),ye=0,oe=Me.length;if(oe===0)return c.create(0,Pe);for(;yePe?oe=Ke:ye=Ke+1}var at=ye-1;return c.create(at,Pe-Me[at])},ce.prototype.offsetAt=function(Pe){var Me=this.getLineOffsets();if(Pe.line>=Me.length)return this._content.length;if(Pe.line<0)return 0;var ye=Me[Pe.line],oe=Pe.line+1"u"}a(ye,"undefined"),ce.undefined=ye;function oe(zt){return zt===!0||zt===!1}a(oe,"boolean"),ce.boolean=oe;function Ke(zt){return Pe.call(zt)==="[object String]"}a(Ke,"string"),ce.string=Ke;function at(zt){return Pe.call(zt)==="[object Number]"}a(at,"number"),ce.number=at;function Gt(zt,_r,W0){return Pe.call(zt)==="[object Number]"&&_r<=zt&&zt<=W0}a(Gt,"numberRange"),ce.numberRange=Gt;function gr(zt){return Pe.call(zt)==="[object Number]"&&-2147483648<=zt&&zt<=2147483647}a(gr,"integer"),ce.integer=gr;function ar(zt){return Pe.call(zt)==="[object Number]"&&0<=zt&&zt<=2147483647}a(ar,"uinteger"),ce.uinteger=ar;function Or(zt){return Pe.call(zt)==="[object Function]"}a(Or,"func"),ce.func=Or;function Hr(zt){return zt!==null&&typeof zt=="object"}a(Hr,"objectLiteral"),ce.objectLiteral=Hr;function Gr(zt,_r){return Array.isArray(zt)&&zt.every(_r)}a(Gr,"typedArray"),ce.typedArray=Gr})(We||(We={}))})});var Ld=I(fC=>{"use strict";p();Object.defineProperty(fC,"__esModule",{value:!0});fC.ProtocolNotificationType=fC.ProtocolNotificationType0=fC.ProtocolRequestType=fC.ProtocolRequestType0=fC.RegistrationType=fC.MessageDirection=void 0;var Ase=ZW(),wzr;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(wzr||(fC.MessageDirection=wzr={}));var GDt=class{static{a(this,"RegistrationType")}constructor(e){this.method=e}};fC.RegistrationType=GDt;var $Dt=class extends Ase.RequestType0{static{a(this,"ProtocolRequestType0")}constructor(e){super(e)}};fC.ProtocolRequestType0=$Dt;var VDt=class extends Ase.RequestType{static{a(this,"ProtocolRequestType")}constructor(e){super(e,Ase.ParameterStructures.byName)}};fC.ProtocolRequestType=VDt;var WDt=class extends Ase.NotificationType0{static{a(this,"ProtocolNotificationType0")}constructor(e){super(e)}};fC.ProtocolNotificationType0=WDt;var zDt=class extends Ase.NotificationType{static{a(this,"ProtocolNotificationType")}constructor(e){super(e,Ase.ParameterStructures.byName)}};fC.ProtocolNotificationType=zDt});var u7e=I(Ph=>{"use strict";p();Object.defineProperty(Ph,"__esModule",{value:!0});Ph.objectLiteral=Ph.typedArray=Ph.stringArray=Ph.array=Ph.func=Ph.error=Ph.number=Ph.string=Ph.boolean=void 0;function t_o(t){return t===!0||t===!1}a(t_o,"boolean");Ph.boolean=t_o;function Rzr(t){return typeof t=="string"||t instanceof String}a(Rzr,"string");Ph.string=Rzr;function r_o(t){return typeof t=="number"||t instanceof Number}a(r_o,"number");Ph.number=r_o;function n_o(t){return t instanceof Error}a(n_o,"error");Ph.error=n_o;function i_o(t){return typeof t=="function"}a(i_o,"func");Ph.func=i_o;function kzr(t){return Array.isArray(t)}a(kzr,"array");Ph.array=kzr;function o_o(t){return kzr(t)&&t.every(e=>Rzr(e))}a(o_o,"stringArray");Ph.stringArray=o_o;function s_o(t,e){return Array.isArray(t)&&t.every(e)}a(s_o,"typedArray");Ph.typedArray=s_o;function a_o(t){return t!==null&&typeof t=="object"}a(a_o,"objectLiteral");Ph.objectLiteral=a_o});var Nzr=I(d7e=>{"use strict";p();Object.defineProperty(d7e,"__esModule",{value:!0});d7e.ImplementationRequest=void 0;var Pzr=Ld(),Dzr;(function(t){t.method="textDocument/implementation",t.messageDirection=Pzr.MessageDirection.clientToServer,t.type=new Pzr.ProtocolRequestType(t.method)})(Dzr||(d7e.ImplementationRequest=Dzr={}))});var Lzr=I(f7e=>{"use strict";p();Object.defineProperty(f7e,"__esModule",{value:!0});f7e.TypeDefinitionRequest=void 0;var Mzr=Ld(),Ozr;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=Mzr.MessageDirection.clientToServer,t.type=new Mzr.ProtocolRequestType(t.method)})(Ozr||(f7e.TypeDefinitionRequest=Ozr={}))});var Uzr=I(yse=>{"use strict";p();Object.defineProperty(yse,"__esModule",{value:!0});yse.DidChangeWorkspaceFoldersNotification=yse.WorkspaceFoldersRequest=void 0;var p7e=Ld(),Bzr;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=p7e.MessageDirection.serverToClient,t.type=new p7e.ProtocolRequestType0(t.method)})(Bzr||(yse.WorkspaceFoldersRequest=Bzr={}));var Fzr;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=p7e.MessageDirection.clientToServer,t.type=new p7e.ProtocolNotificationType(t.method)})(Fzr||(yse.DidChangeWorkspaceFoldersNotification=Fzr={}))});var jzr=I(h7e=>{"use strict";p();Object.defineProperty(h7e,"__esModule",{value:!0});h7e.ConfigurationRequest=void 0;var Qzr=Ld(),qzr;(function(t){t.method="workspace/configuration",t.messageDirection=Qzr.MessageDirection.serverToClient,t.type=new Qzr.ProtocolRequestType(t.method)})(qzr||(h7e.ConfigurationRequest=qzr={}))});var $zr=I(Ese=>{"use strict";p();Object.defineProperty(Ese,"__esModule",{value:!0});Ese.ColorPresentationRequest=Ese.DocumentColorRequest=void 0;var m7e=Ld(),Hzr;(function(t){t.method="textDocument/documentColor",t.messageDirection=m7e.MessageDirection.clientToServer,t.type=new m7e.ProtocolRequestType(t.method)})(Hzr||(Ese.DocumentColorRequest=Hzr={}));var Gzr;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=m7e.MessageDirection.clientToServer,t.type=new m7e.ProtocolRequestType(t.method)})(Gzr||(Ese.ColorPresentationRequest=Gzr={}))});var zzr=I(_se=>{"use strict";p();Object.defineProperty(_se,"__esModule",{value:!0});_se.FoldingRangeRefreshRequest=_se.FoldingRangeRequest=void 0;var g7e=Ld(),Vzr;(function(t){t.method="textDocument/foldingRange",t.messageDirection=g7e.MessageDirection.clientToServer,t.type=new g7e.ProtocolRequestType(t.method)})(Vzr||(_se.FoldingRangeRequest=Vzr={}));var Wzr;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=g7e.MessageDirection.serverToClient,t.type=new g7e.ProtocolRequestType0(t.method)})(Wzr||(_se.FoldingRangeRefreshRequest=Wzr={}))});var Jzr=I(A7e=>{"use strict";p();Object.defineProperty(A7e,"__esModule",{value:!0});A7e.DeclarationRequest=void 0;var Yzr=Ld(),Kzr;(function(t){t.method="textDocument/declaration",t.messageDirection=Yzr.MessageDirection.clientToServer,t.type=new Yzr.ProtocolRequestType(t.method)})(Kzr||(A7e.DeclarationRequest=Kzr={}))});var eYr=I(y7e=>{"use strict";p();Object.defineProperty(y7e,"__esModule",{value:!0});y7e.SelectionRangeRequest=void 0;var Zzr=Ld(),Xzr;(function(t){t.method="textDocument/selectionRange",t.messageDirection=Zzr.MessageDirection.clientToServer,t.type=new Zzr.ProtocolRequestType(t.method)})(Xzr||(y7e.SelectionRangeRequest=Xzr={}))});var iYr=I(qU=>{"use strict";p();Object.defineProperty(qU,"__esModule",{value:!0});qU.WorkDoneProgressCancelNotification=qU.WorkDoneProgressCreateRequest=qU.WorkDoneProgress=void 0;var c_o=ZW(),E7e=Ld(),tYr;(function(t){t.type=new c_o.ProgressType;function e(r){return r===t.type}a(e,"is"),t.is=e})(tYr||(qU.WorkDoneProgress=tYr={}));var rYr;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=E7e.MessageDirection.serverToClient,t.type=new E7e.ProtocolRequestType(t.method)})(rYr||(qU.WorkDoneProgressCreateRequest=rYr={}));var nYr;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=E7e.MessageDirection.clientToServer,t.type=new E7e.ProtocolNotificationType(t.method)})(nYr||(qU.WorkDoneProgressCancelNotification=nYr={}))});var cYr=I(jU=>{"use strict";p();Object.defineProperty(jU,"__esModule",{value:!0});jU.CallHierarchyOutgoingCallsRequest=jU.CallHierarchyIncomingCallsRequest=jU.CallHierarchyPrepareRequest=void 0;var vse=Ld(),oYr;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=vse.MessageDirection.clientToServer,t.type=new vse.ProtocolRequestType(t.method)})(oYr||(jU.CallHierarchyPrepareRequest=oYr={}));var sYr;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=vse.MessageDirection.clientToServer,t.type=new vse.ProtocolRequestType(t.method)})(sYr||(jU.CallHierarchyIncomingCallsRequest=sYr={}));var aYr;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=vse.MessageDirection.clientToServer,t.type=new vse.ProtocolRequestType(t.method)})(aYr||(jU.CallHierarchyOutgoingCallsRequest=aYr={}))});var hYr=I(pC=>{"use strict";p();Object.defineProperty(pC,"__esModule",{value:!0});pC.SemanticTokensRefreshRequest=pC.SemanticTokensRangeRequest=pC.SemanticTokensDeltaRequest=pC.SemanticTokensRequest=pC.SemanticTokensRegistrationType=pC.TokenFormat=void 0;var xB=Ld(),lYr;(function(t){t.Relative="relative"})(lYr||(pC.TokenFormat=lYr={}));var vbe;(function(t){t.method="textDocument/semanticTokens",t.type=new xB.RegistrationType(t.method)})(vbe||(pC.SemanticTokensRegistrationType=vbe={}));var uYr;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=xB.MessageDirection.clientToServer,t.type=new xB.ProtocolRequestType(t.method),t.registrationMethod=vbe.method})(uYr||(pC.SemanticTokensRequest=uYr={}));var dYr;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=xB.MessageDirection.clientToServer,t.type=new xB.ProtocolRequestType(t.method),t.registrationMethod=vbe.method})(dYr||(pC.SemanticTokensDeltaRequest=dYr={}));var fYr;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=xB.MessageDirection.clientToServer,t.type=new xB.ProtocolRequestType(t.method),t.registrationMethod=vbe.method})(fYr||(pC.SemanticTokensRangeRequest=fYr={}));var pYr;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=xB.MessageDirection.serverToClient,t.type=new xB.ProtocolRequestType0(t.method)})(pYr||(pC.SemanticTokensRefreshRequest=pYr={}))});var AYr=I(_7e=>{"use strict";p();Object.defineProperty(_7e,"__esModule",{value:!0});_7e.ShowDocumentRequest=void 0;var mYr=Ld(),gYr;(function(t){t.method="window/showDocument",t.messageDirection=mYr.MessageDirection.serverToClient,t.type=new mYr.ProtocolRequestType(t.method)})(gYr||(_7e.ShowDocumentRequest=gYr={}))});var _Yr=I(v7e=>{"use strict";p();Object.defineProperty(v7e,"__esModule",{value:!0});v7e.LinkedEditingRangeRequest=void 0;var yYr=Ld(),EYr;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=yYr.MessageDirection.clientToServer,t.type=new yYr.ProtocolRequestType(t.method)})(EYr||(v7e.LinkedEditingRangeRequest=EYr={}))});var wYr=I(Wy=>{"use strict";p();Object.defineProperty(Wy,"__esModule",{value:!0});Wy.WillDeleteFilesRequest=Wy.DidDeleteFilesNotification=Wy.DidRenameFilesNotification=Wy.WillRenameFilesRequest=Wy.DidCreateFilesNotification=Wy.WillCreateFilesRequest=Wy.FileOperationPatternKind=void 0;var rx=Ld(),vYr;(function(t){t.file="file",t.folder="folder"})(vYr||(Wy.FileOperationPatternKind=vYr={}));var CYr;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=rx.MessageDirection.clientToServer,t.type=new rx.ProtocolRequestType(t.method)})(CYr||(Wy.WillCreateFilesRequest=CYr={}));var bYr;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=rx.MessageDirection.clientToServer,t.type=new rx.ProtocolNotificationType(t.method)})(bYr||(Wy.DidCreateFilesNotification=bYr={}));var SYr;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=rx.MessageDirection.clientToServer,t.type=new rx.ProtocolRequestType(t.method)})(SYr||(Wy.WillRenameFilesRequest=SYr={}));var TYr;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=rx.MessageDirection.clientToServer,t.type=new rx.ProtocolNotificationType(t.method)})(TYr||(Wy.DidRenameFilesNotification=TYr={}));var IYr;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=rx.MessageDirection.clientToServer,t.type=new rx.ProtocolNotificationType(t.method)})(IYr||(Wy.DidDeleteFilesNotification=IYr={}));var xYr;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=rx.MessageDirection.clientToServer,t.type=new rx.ProtocolRequestType(t.method)})(xYr||(Wy.WillDeleteFilesRequest=xYr={}))});var NYr=I(HU=>{"use strict";p();Object.defineProperty(HU,"__esModule",{value:!0});HU.MonikerRequest=HU.MonikerKind=HU.UniquenessLevel=void 0;var RYr=Ld(),kYr;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(kYr||(HU.UniquenessLevel=kYr={}));var PYr;(function(t){t.$import="import",t.$export="export",t.local="local"})(PYr||(HU.MonikerKind=PYr={}));var DYr;(function(t){t.method="textDocument/moniker",t.messageDirection=RYr.MessageDirection.clientToServer,t.type=new RYr.ProtocolRequestType(t.method)})(DYr||(HU.MonikerRequest=DYr={}))});var BYr=I(GU=>{"use strict";p();Object.defineProperty(GU,"__esModule",{value:!0});GU.TypeHierarchySubtypesRequest=GU.TypeHierarchySupertypesRequest=GU.TypeHierarchyPrepareRequest=void 0;var Cse=Ld(),MYr;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Cse.MessageDirection.clientToServer,t.type=new Cse.ProtocolRequestType(t.method)})(MYr||(GU.TypeHierarchyPrepareRequest=MYr={}));var OYr;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Cse.MessageDirection.clientToServer,t.type=new Cse.ProtocolRequestType(t.method)})(OYr||(GU.TypeHierarchySupertypesRequest=OYr={}));var LYr;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Cse.MessageDirection.clientToServer,t.type=new Cse.ProtocolRequestType(t.method)})(LYr||(GU.TypeHierarchySubtypesRequest=LYr={}))});var QYr=I(bse=>{"use strict";p();Object.defineProperty(bse,"__esModule",{value:!0});bse.InlineValueRefreshRequest=bse.InlineValueRequest=void 0;var C7e=Ld(),FYr;(function(t){t.method="textDocument/inlineValue",t.messageDirection=C7e.MessageDirection.clientToServer,t.type=new C7e.ProtocolRequestType(t.method)})(FYr||(bse.InlineValueRequest=FYr={}));var UYr;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=C7e.MessageDirection.serverToClient,t.type=new C7e.ProtocolRequestType0(t.method)})(UYr||(bse.InlineValueRefreshRequest=UYr={}))});var GYr=I($U=>{"use strict";p();Object.defineProperty($U,"__esModule",{value:!0});$U.InlayHintRefreshRequest=$U.InlayHintResolveRequest=$U.InlayHintRequest=void 0;var Sse=Ld(),qYr;(function(t){t.method="textDocument/inlayHint",t.messageDirection=Sse.MessageDirection.clientToServer,t.type=new Sse.ProtocolRequestType(t.method)})(qYr||($U.InlayHintRequest=qYr={}));var jYr;(function(t){t.method="inlayHint/resolve",t.messageDirection=Sse.MessageDirection.clientToServer,t.type=new Sse.ProtocolRequestType(t.method)})(jYr||($U.InlayHintResolveRequest=jYr={}));var HYr;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=Sse.MessageDirection.serverToClient,t.type=new Sse.ProtocolRequestType0(t.method)})(HYr||($U.InlayHintRefreshRequest=HYr={}))});var JYr=I(nx=>{"use strict";p();Object.defineProperty(nx,"__esModule",{value:!0});nx.DiagnosticRefreshRequest=nx.WorkspaceDiagnosticRequest=nx.DocumentDiagnosticRequest=nx.DocumentDiagnosticReportKind=nx.DiagnosticServerCancellationData=void 0;var KYr=ZW(),l_o=u7e(),Tse=Ld(),$Yr;(function(t){function e(r){let n=r;return n&&l_o.boolean(n.retriggerRequest)}a(e,"is"),t.is=e})($Yr||(nx.DiagnosticServerCancellationData=$Yr={}));var VYr;(function(t){t.Full="full",t.Unchanged="unchanged"})(VYr||(nx.DocumentDiagnosticReportKind=VYr={}));var WYr;(function(t){t.method="textDocument/diagnostic",t.messageDirection=Tse.MessageDirection.clientToServer,t.type=new Tse.ProtocolRequestType(t.method),t.partialResult=new KYr.ProgressType})(WYr||(nx.DocumentDiagnosticRequest=WYr={}));var zYr;(function(t){t.method="workspace/diagnostic",t.messageDirection=Tse.MessageDirection.clientToServer,t.type=new Tse.ProtocolRequestType(t.method),t.partialResult=new KYr.ProgressType})(zYr||(nx.WorkspaceDiagnosticRequest=zYr={}));var YYr;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=Tse.MessageDirection.serverToClient,t.type=new Tse.ProtocolRequestType0(t.method)})(YYr||(nx.DiagnosticRefreshRequest=YYr={}))});var iKr=I(zf=>{"use strict";p();Object.defineProperty(zf,"__esModule",{value:!0});zf.DidCloseNotebookDocumentNotification=zf.DidSaveNotebookDocumentNotification=zf.DidChangeNotebookDocumentNotification=zf.NotebookCellArrayChange=zf.DidOpenNotebookDocumentNotification=zf.NotebookDocumentSyncRegistrationType=zf.NotebookDocument=zf.NotebookCell=zf.ExecutionSummary=zf.NotebookCellKind=void 0;var Cbe=_be(),tP=u7e(),fM=Ld(),YDt;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(YDt||(zf.NotebookCellKind=YDt={}));var KDt;(function(t){function e(o,s){let c={executionOrder:o};return(s===!0||s===!1)&&(c.success=s),c}a(e,"create"),t.create=e;function r(o){let s=o;return tP.objectLiteral(s)&&Cbe.uinteger.is(s.executionOrder)&&(s.success===void 0||tP.boolean(s.success))}a(r,"is"),t.is=r;function n(o,s){return o===s?!0:o==null||s===null||s===void 0?!1:o.executionOrder===s.executionOrder&&o.success===s.success}a(n,"equals"),t.equals=n})(KDt||(zf.ExecutionSummary=KDt={}));var b7e;(function(t){function e(s,c){return{kind:s,document:c}}a(e,"create"),t.create=e;function r(s){let c=s;return tP.objectLiteral(c)&&YDt.is(c.kind)&&Cbe.DocumentUri.is(c.document)&&(c.metadata===void 0||tP.objectLiteral(c.metadata))}a(r,"is"),t.is=r;function n(s,c){let l=new Set;return s.document!==c.document&&l.add("document"),s.kind!==c.kind&&l.add("kind"),s.executionSummary!==c.executionSummary&&l.add("executionSummary"),(s.metadata!==void 0||c.metadata!==void 0)&&!o(s.metadata,c.metadata)&&l.add("metadata"),(s.executionSummary!==void 0||c.executionSummary!==void 0)&&!KDt.equals(s.executionSummary,c.executionSummary)&&l.add("executionSummary"),l}a(n,"diff"),t.diff=n;function o(s,c){if(s===c)return!0;if(s==null||c===null||c===void 0||typeof s!=typeof c||typeof s!="object")return!1;let l=Array.isArray(s),u=Array.isArray(c);if(l!==u)return!1;if(l&&u){if(s.length!==c.length)return!1;for(let d=0;d{"use strict";p();Object.defineProperty(S7e,"__esModule",{value:!0});S7e.InlineCompletionRequest=void 0;var oKr=Ld(),sKr;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=oKr.MessageDirection.clientToServer,t.type=new oKr.ProtocolRequestType(t.method)})(sKr||(S7e.InlineCompletionRequest=sKr={}))});var _Jr=I(Ve=>{"use strict";p();Object.defineProperty(Ve,"__esModule",{value:!0});Ve.WorkspaceSymbolRequest=Ve.CodeActionResolveRequest=Ve.CodeActionRequest=Ve.DocumentSymbolRequest=Ve.DocumentHighlightRequest=Ve.ReferencesRequest=Ve.DefinitionRequest=Ve.SignatureHelpRequest=Ve.SignatureHelpTriggerKind=Ve.HoverRequest=Ve.CompletionResolveRequest=Ve.CompletionRequest=Ve.CompletionTriggerKind=Ve.PublishDiagnosticsNotification=Ve.WatchKind=Ve.RelativePattern=Ve.FileChangeType=Ve.DidChangeWatchedFilesNotification=Ve.WillSaveTextDocumentWaitUntilRequest=Ve.WillSaveTextDocumentNotification=Ve.TextDocumentSaveReason=Ve.DidSaveTextDocumentNotification=Ve.DidCloseTextDocumentNotification=Ve.DidChangeTextDocumentNotification=Ve.TextDocumentContentChangeEvent=Ve.DidOpenTextDocumentNotification=Ve.TextDocumentSyncKind=Ve.TelemetryEventNotification=Ve.LogMessageNotification=Ve.ShowMessageRequest=Ve.ShowMessageNotification=Ve.MessageType=Ve.DidChangeConfigurationNotification=Ve.ExitNotification=Ve.ShutdownRequest=Ve.InitializedNotification=Ve.InitializeErrorCodes=Ve.InitializeRequest=Ve.WorkDoneProgressOptions=Ve.TextDocumentRegistrationOptions=Ve.StaticRegistrationOptions=Ve.PositionEncodingKind=Ve.FailureHandlingKind=Ve.ResourceOperationKind=Ve.UnregistrationRequest=Ve.RegistrationRequest=Ve.DocumentSelector=Ve.NotebookCellTextDocumentFilter=Ve.NotebookDocumentFilter=Ve.TextDocumentFilter=void 0;Ve.MonikerRequest=Ve.MonikerKind=Ve.UniquenessLevel=Ve.WillDeleteFilesRequest=Ve.DidDeleteFilesNotification=Ve.WillRenameFilesRequest=Ve.DidRenameFilesNotification=Ve.WillCreateFilesRequest=Ve.DidCreateFilesNotification=Ve.FileOperationPatternKind=Ve.LinkedEditingRangeRequest=Ve.ShowDocumentRequest=Ve.SemanticTokensRegistrationType=Ve.SemanticTokensRefreshRequest=Ve.SemanticTokensRangeRequest=Ve.SemanticTokensDeltaRequest=Ve.SemanticTokensRequest=Ve.TokenFormat=Ve.CallHierarchyPrepareRequest=Ve.CallHierarchyOutgoingCallsRequest=Ve.CallHierarchyIncomingCallsRequest=Ve.WorkDoneProgressCancelNotification=Ve.WorkDoneProgressCreateRequest=Ve.WorkDoneProgress=Ve.SelectionRangeRequest=Ve.DeclarationRequest=Ve.FoldingRangeRefreshRequest=Ve.FoldingRangeRequest=Ve.ColorPresentationRequest=Ve.DocumentColorRequest=Ve.ConfigurationRequest=Ve.DidChangeWorkspaceFoldersNotification=Ve.WorkspaceFoldersRequest=Ve.TypeDefinitionRequest=Ve.ImplementationRequest=Ve.ApplyWorkspaceEditRequest=Ve.ExecuteCommandRequest=Ve.PrepareRenameRequest=Ve.RenameRequest=Ve.PrepareSupportDefaultBehavior=Ve.DocumentOnTypeFormattingRequest=Ve.DocumentRangesFormattingRequest=Ve.DocumentRangeFormattingRequest=Ve.DocumentFormattingRequest=Ve.DocumentLinkResolveRequest=Ve.DocumentLinkRequest=Ve.CodeLensRefreshRequest=Ve.CodeLensResolveRequest=Ve.CodeLensRequest=Ve.WorkspaceSymbolResolveRequest=void 0;Ve.InlineCompletionRequest=Ve.DidCloseNotebookDocumentNotification=Ve.DidSaveNotebookDocumentNotification=Ve.DidChangeNotebookDocumentNotification=Ve.NotebookCellArrayChange=Ve.DidOpenNotebookDocumentNotification=Ve.NotebookDocumentSyncRegistrationType=Ve.NotebookDocument=Ve.NotebookCell=Ve.ExecutionSummary=Ve.NotebookCellKind=Ve.DiagnosticRefreshRequest=Ve.WorkspaceDiagnosticRequest=Ve.DocumentDiagnosticRequest=Ve.DocumentDiagnosticReportKind=Ve.DiagnosticServerCancellationData=Ve.InlayHintRefreshRequest=Ve.InlayHintResolveRequest=Ve.InlayHintRequest=Ve.InlineValueRefreshRequest=Ve.InlineValueRequest=Ve.TypeHierarchySupertypesRequest=Ve.TypeHierarchySubtypesRequest=Ve.TypeHierarchyPrepareRequest=void 0;var br=Ld(),cKr=_be(),eg=u7e(),u_o=Nzr();Object.defineProperty(Ve,"ImplementationRequest",{enumerable:!0,get:a(function(){return u_o.ImplementationRequest},"get")});var d_o=Lzr();Object.defineProperty(Ve,"TypeDefinitionRequest",{enumerable:!0,get:a(function(){return d_o.TypeDefinitionRequest},"get")});var gJr=Uzr();Object.defineProperty(Ve,"WorkspaceFoldersRequest",{enumerable:!0,get:a(function(){return gJr.WorkspaceFoldersRequest},"get")});Object.defineProperty(Ve,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:a(function(){return gJr.DidChangeWorkspaceFoldersNotification},"get")});var f_o=jzr();Object.defineProperty(Ve,"ConfigurationRequest",{enumerable:!0,get:a(function(){return f_o.ConfigurationRequest},"get")});var AJr=$zr();Object.defineProperty(Ve,"DocumentColorRequest",{enumerable:!0,get:a(function(){return AJr.DocumentColorRequest},"get")});Object.defineProperty(Ve,"ColorPresentationRequest",{enumerable:!0,get:a(function(){return AJr.ColorPresentationRequest},"get")});var yJr=zzr();Object.defineProperty(Ve,"FoldingRangeRequest",{enumerable:!0,get:a(function(){return yJr.FoldingRangeRequest},"get")});Object.defineProperty(Ve,"FoldingRangeRefreshRequest",{enumerable:!0,get:a(function(){return yJr.FoldingRangeRefreshRequest},"get")});var p_o=Jzr();Object.defineProperty(Ve,"DeclarationRequest",{enumerable:!0,get:a(function(){return p_o.DeclarationRequest},"get")});var h_o=eYr();Object.defineProperty(Ve,"SelectionRangeRequest",{enumerable:!0,get:a(function(){return h_o.SelectionRangeRequest},"get")});var tNt=iYr();Object.defineProperty(Ve,"WorkDoneProgress",{enumerable:!0,get:a(function(){return tNt.WorkDoneProgress},"get")});Object.defineProperty(Ve,"WorkDoneProgressCreateRequest",{enumerable:!0,get:a(function(){return tNt.WorkDoneProgressCreateRequest},"get")});Object.defineProperty(Ve,"WorkDoneProgressCancelNotification",{enumerable:!0,get:a(function(){return tNt.WorkDoneProgressCancelNotification},"get")});var rNt=cYr();Object.defineProperty(Ve,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:a(function(){return rNt.CallHierarchyIncomingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:a(function(){return rNt.CallHierarchyOutgoingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return rNt.CallHierarchyPrepareRequest},"get")});var xse=hYr();Object.defineProperty(Ve,"TokenFormat",{enumerable:!0,get:a(function(){return xse.TokenFormat},"get")});Object.defineProperty(Ve,"SemanticTokensRequest",{enumerable:!0,get:a(function(){return xse.SemanticTokensRequest},"get")});Object.defineProperty(Ve,"SemanticTokensDeltaRequest",{enumerable:!0,get:a(function(){return xse.SemanticTokensDeltaRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRangeRequest",{enumerable:!0,get:a(function(){return xse.SemanticTokensRangeRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRefreshRequest",{enumerable:!0,get:a(function(){return xse.SemanticTokensRefreshRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRegistrationType",{enumerable:!0,get:a(function(){return xse.SemanticTokensRegistrationType},"get")});var m_o=AYr();Object.defineProperty(Ve,"ShowDocumentRequest",{enumerable:!0,get:a(function(){return m_o.ShowDocumentRequest},"get")});var g_o=_Yr();Object.defineProperty(Ve,"LinkedEditingRangeRequest",{enumerable:!0,get:a(function(){return g_o.LinkedEditingRangeRequest},"get")});var XW=wYr();Object.defineProperty(Ve,"FileOperationPatternKind",{enumerable:!0,get:a(function(){return XW.FileOperationPatternKind},"get")});Object.defineProperty(Ve,"DidCreateFilesNotification",{enumerable:!0,get:a(function(){return XW.DidCreateFilesNotification},"get")});Object.defineProperty(Ve,"WillCreateFilesRequest",{enumerable:!0,get:a(function(){return XW.WillCreateFilesRequest},"get")});Object.defineProperty(Ve,"DidRenameFilesNotification",{enumerable:!0,get:a(function(){return XW.DidRenameFilesNotification},"get")});Object.defineProperty(Ve,"WillRenameFilesRequest",{enumerable:!0,get:a(function(){return XW.WillRenameFilesRequest},"get")});Object.defineProperty(Ve,"DidDeleteFilesNotification",{enumerable:!0,get:a(function(){return XW.DidDeleteFilesNotification},"get")});Object.defineProperty(Ve,"WillDeleteFilesRequest",{enumerable:!0,get:a(function(){return XW.WillDeleteFilesRequest},"get")});var nNt=NYr();Object.defineProperty(Ve,"UniquenessLevel",{enumerable:!0,get:a(function(){return nNt.UniquenessLevel},"get")});Object.defineProperty(Ve,"MonikerKind",{enumerable:!0,get:a(function(){return nNt.MonikerKind},"get")});Object.defineProperty(Ve,"MonikerRequest",{enumerable:!0,get:a(function(){return nNt.MonikerRequest},"get")});var iNt=BYr();Object.defineProperty(Ve,"TypeHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return iNt.TypeHierarchyPrepareRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySubtypesRequest",{enumerable:!0,get:a(function(){return iNt.TypeHierarchySubtypesRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySupertypesRequest",{enumerable:!0,get:a(function(){return iNt.TypeHierarchySupertypesRequest},"get")});var EJr=QYr();Object.defineProperty(Ve,"InlineValueRequest",{enumerable:!0,get:a(function(){return EJr.InlineValueRequest},"get")});Object.defineProperty(Ve,"InlineValueRefreshRequest",{enumerable:!0,get:a(function(){return EJr.InlineValueRefreshRequest},"get")});var oNt=GYr();Object.defineProperty(Ve,"InlayHintRequest",{enumerable:!0,get:a(function(){return oNt.InlayHintRequest},"get")});Object.defineProperty(Ve,"InlayHintResolveRequest",{enumerable:!0,get:a(function(){return oNt.InlayHintResolveRequest},"get")});Object.defineProperty(Ve,"InlayHintRefreshRequest",{enumerable:!0,get:a(function(){return oNt.InlayHintRefreshRequest},"get")});var bbe=JYr();Object.defineProperty(Ve,"DiagnosticServerCancellationData",{enumerable:!0,get:a(function(){return bbe.DiagnosticServerCancellationData},"get")});Object.defineProperty(Ve,"DocumentDiagnosticReportKind",{enumerable:!0,get:a(function(){return bbe.DocumentDiagnosticReportKind},"get")});Object.defineProperty(Ve,"DocumentDiagnosticRequest",{enumerable:!0,get:a(function(){return bbe.DocumentDiagnosticRequest},"get")});Object.defineProperty(Ve,"WorkspaceDiagnosticRequest",{enumerable:!0,get:a(function(){return bbe.WorkspaceDiagnosticRequest},"get")});Object.defineProperty(Ve,"DiagnosticRefreshRequest",{enumerable:!0,get:a(function(){return bbe.DiagnosticRefreshRequest},"get")});var pM=iKr();Object.defineProperty(Ve,"NotebookCellKind",{enumerable:!0,get:a(function(){return pM.NotebookCellKind},"get")});Object.defineProperty(Ve,"ExecutionSummary",{enumerable:!0,get:a(function(){return pM.ExecutionSummary},"get")});Object.defineProperty(Ve,"NotebookCell",{enumerable:!0,get:a(function(){return pM.NotebookCell},"get")});Object.defineProperty(Ve,"NotebookDocument",{enumerable:!0,get:a(function(){return pM.NotebookDocument},"get")});Object.defineProperty(Ve,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:a(function(){return pM.NotebookDocumentSyncRegistrationType},"get")});Object.defineProperty(Ve,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:a(function(){return pM.DidOpenNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"NotebookCellArrayChange",{enumerable:!0,get:a(function(){return pM.NotebookCellArrayChange},"get")});Object.defineProperty(Ve,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:a(function(){return pM.DidChangeNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:a(function(){return pM.DidSaveNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:a(function(){return pM.DidCloseNotebookDocumentNotification},"get")});var A_o=aKr();Object.defineProperty(Ve,"InlineCompletionRequest",{enumerable:!0,get:a(function(){return A_o.InlineCompletionRequest},"get")});var JDt;(function(t){function e(r){let n=r;return eg.string(n)||eg.string(n.language)||eg.string(n.scheme)||eg.string(n.pattern)}a(e,"is"),t.is=e})(JDt||(Ve.TextDocumentFilter=JDt={}));var ZDt;(function(t){function e(r){let n=r;return eg.objectLiteral(n)&&(eg.string(n.notebookType)||eg.string(n.scheme)||eg.string(n.pattern))}a(e,"is"),t.is=e})(ZDt||(Ve.NotebookDocumentFilter=ZDt={}));var XDt;(function(t){function e(r){let n=r;return eg.objectLiteral(n)&&(eg.string(n.notebook)||ZDt.is(n.notebook))&&(n.language===void 0||eg.string(n.language))}a(e,"is"),t.is=e})(XDt||(Ve.NotebookCellTextDocumentFilter=XDt={}));var eNt;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!eg.string(n)&&!JDt.is(n)&&!XDt.is(n))return!1;return!0}a(e,"is"),t.is=e})(eNt||(Ve.DocumentSelector=eNt={}));var lKr;(function(t){t.method="client/registerCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(lKr||(Ve.RegistrationRequest=lKr={}));var uKr;(function(t){t.method="client/unregisterCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(uKr||(Ve.UnregistrationRequest=uKr={}));var dKr;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(dKr||(Ve.ResourceOperationKind=dKr={}));var fKr;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(fKr||(Ve.FailureHandlingKind=fKr={}));var pKr;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(pKr||(Ve.PositionEncodingKind=pKr={}));var hKr;(function(t){function e(r){let n=r;return n&&eg.string(n.id)&&n.id.length>0}a(e,"hasId"),t.hasId=e})(hKr||(Ve.StaticRegistrationOptions=hKr={}));var mKr;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||eNt.is(n.documentSelector))}a(e,"is"),t.is=e})(mKr||(Ve.TextDocumentRegistrationOptions=mKr={}));var gKr;(function(t){function e(n){let o=n;return eg.objectLiteral(o)&&(o.workDoneProgress===void 0||eg.boolean(o.workDoneProgress))}a(e,"is"),t.is=e;function r(n){let o=n;return o&&eg.boolean(o.workDoneProgress)}a(r,"hasWorkDoneProgress"),t.hasWorkDoneProgress=r})(gKr||(Ve.WorkDoneProgressOptions=gKr={}));var AKr;(function(t){t.method="initialize",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(AKr||(Ve.InitializeRequest=AKr={}));var yKr;(function(t){t.unknownProtocolVersion=1})(yKr||(Ve.InitializeErrorCodes=yKr={}));var EKr;(function(t){t.method="initialized",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(EKr||(Ve.InitializedNotification=EKr={}));var _Kr;(function(t){t.method="shutdown",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType0(t.method)})(_Kr||(Ve.ShutdownRequest=_Kr={}));var vKr;(function(t){t.method="exit",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType0(t.method)})(vKr||(Ve.ExitNotification=vKr={}));var CKr;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(CKr||(Ve.DidChangeConfigurationNotification=CKr={}));var bKr;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(bKr||(Ve.MessageType=bKr={}));var SKr;(function(t){t.method="window/showMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(SKr||(Ve.ShowMessageNotification=SKr={}));var TKr;(function(t){t.method="window/showMessageRequest",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(TKr||(Ve.ShowMessageRequest=TKr={}));var IKr;(function(t){t.method="window/logMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(IKr||(Ve.LogMessageNotification=IKr={}));var xKr;(function(t){t.method="telemetry/event",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(xKr||(Ve.TelemetryEventNotification=xKr={}));var wKr;(function(t){t.None=0,t.Full=1,t.Incremental=2})(wKr||(Ve.TextDocumentSyncKind=wKr={}));var RKr;(function(t){t.method="textDocument/didOpen",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(RKr||(Ve.DidOpenTextDocumentNotification=RKr={}));var kKr;(function(t){function e(n){let o=n;return o!=null&&typeof o.text=="string"&&o.range!==void 0&&(o.rangeLength===void 0||typeof o.rangeLength=="number")}a(e,"isIncremental"),t.isIncremental=e;function r(n){let o=n;return o!=null&&typeof o.text=="string"&&o.range===void 0&&o.rangeLength===void 0}a(r,"isFull"),t.isFull=r})(kKr||(Ve.TextDocumentContentChangeEvent=kKr={}));var PKr;(function(t){t.method="textDocument/didChange",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(PKr||(Ve.DidChangeTextDocumentNotification=PKr={}));var DKr;(function(t){t.method="textDocument/didClose",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(DKr||(Ve.DidCloseTextDocumentNotification=DKr={}));var NKr;(function(t){t.method="textDocument/didSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(NKr||(Ve.DidSaveTextDocumentNotification=NKr={}));var MKr;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(MKr||(Ve.TextDocumentSaveReason=MKr={}));var OKr;(function(t){t.method="textDocument/willSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(OKr||(Ve.WillSaveTextDocumentNotification=OKr={}));var LKr;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(LKr||(Ve.WillSaveTextDocumentWaitUntilRequest=LKr={}));var BKr;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(BKr||(Ve.DidChangeWatchedFilesNotification=BKr={}));var FKr;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(FKr||(Ve.FileChangeType=FKr={}));var UKr;(function(t){function e(r){let n=r;return eg.objectLiteral(n)&&(cKr.URI.is(n.baseUri)||cKr.WorkspaceFolder.is(n.baseUri))&&eg.string(n.pattern)}a(e,"is"),t.is=e})(UKr||(Ve.RelativePattern=UKr={}));var QKr;(function(t){t.Create=1,t.Change=2,t.Delete=4})(QKr||(Ve.WatchKind=QKr={}));var qKr;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(qKr||(Ve.PublishDiagnosticsNotification=qKr={}));var jKr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(jKr||(Ve.CompletionTriggerKind=jKr={}));var HKr;(function(t){t.method="textDocument/completion",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(HKr||(Ve.CompletionRequest=HKr={}));var GKr;(function(t){t.method="completionItem/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(GKr||(Ve.CompletionResolveRequest=GKr={}));var $Kr;(function(t){t.method="textDocument/hover",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})($Kr||(Ve.HoverRequest=$Kr={}));var VKr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(VKr||(Ve.SignatureHelpTriggerKind=VKr={}));var WKr;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(WKr||(Ve.SignatureHelpRequest=WKr={}));var zKr;(function(t){t.method="textDocument/definition",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(zKr||(Ve.DefinitionRequest=zKr={}));var YKr;(function(t){t.method="textDocument/references",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(YKr||(Ve.ReferencesRequest=YKr={}));var KKr;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(KKr||(Ve.DocumentHighlightRequest=KKr={}));var JKr;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(JKr||(Ve.DocumentSymbolRequest=JKr={}));var ZKr;(function(t){t.method="textDocument/codeAction",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(ZKr||(Ve.CodeActionRequest=ZKr={}));var XKr;(function(t){t.method="codeAction/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(XKr||(Ve.CodeActionResolveRequest=XKr={}));var eJr;(function(t){t.method="workspace/symbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(eJr||(Ve.WorkspaceSymbolRequest=eJr={}));var tJr;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(tJr||(Ve.WorkspaceSymbolResolveRequest=tJr={}));var rJr;(function(t){t.method="textDocument/codeLens",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(rJr||(Ve.CodeLensRequest=rJr={}));var nJr;(function(t){t.method="codeLens/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(nJr||(Ve.CodeLensResolveRequest=nJr={}));var iJr;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType0(t.method)})(iJr||(Ve.CodeLensRefreshRequest=iJr={}));var oJr;(function(t){t.method="textDocument/documentLink",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(oJr||(Ve.DocumentLinkRequest=oJr={}));var sJr;(function(t){t.method="documentLink/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(sJr||(Ve.DocumentLinkResolveRequest=sJr={}));var aJr;(function(t){t.method="textDocument/formatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(aJr||(Ve.DocumentFormattingRequest=aJr={}));var cJr;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(cJr||(Ve.DocumentRangeFormattingRequest=cJr={}));var lJr;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(lJr||(Ve.DocumentRangesFormattingRequest=lJr={}));var uJr;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(uJr||(Ve.DocumentOnTypeFormattingRequest=uJr={}));var dJr;(function(t){t.Identifier=1})(dJr||(Ve.PrepareSupportDefaultBehavior=dJr={}));var fJr;(function(t){t.method="textDocument/rename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(fJr||(Ve.RenameRequest=fJr={}));var pJr;(function(t){t.method="textDocument/prepareRename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(pJr||(Ve.PrepareRenameRequest=pJr={}));var hJr;(function(t){t.method="workspace/executeCommand",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(hJr||(Ve.ExecuteCommandRequest=hJr={}));var mJr;(function(t){t.method="workspace/applyEdit",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType("workspace/applyEdit")})(mJr||(Ve.ApplyWorkspaceEditRequest=mJr={}))});var CJr=I(T7e=>{"use strict";p();Object.defineProperty(T7e,"__esModule",{value:!0});T7e.createProtocolConnection=void 0;var vJr=ZW();function y_o(t,e,r,n){return vJr.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,vJr.createMessageConnection)(t,e,r,n)}a(y_o,"createProtocolConnection");T7e.createProtocolConnection=y_o});var SJr=I(hC=>{"use strict";p();var E_o=hC&&hC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),I7e=hC&&hC.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&E_o(e,t,r)};Object.defineProperty(hC,"__esModule",{value:!0});hC.LSPErrorCodes=hC.createProtocolConnection=void 0;I7e(ZW(),hC);I7e(_be(),hC);I7e(Ld(),hC);I7e(_Jr(),hC);var __o=CJr();Object.defineProperty(hC,"createProtocolConnection",{enumerable:!0,get:a(function(){return __o.createProtocolConnection},"get")});var bJr;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(bJr||(hC.LSPErrorCodes=bJr={}))});var ei=I(hM=>{"use strict";p();var v_o=hM&&hM.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),TJr=hM&&hM.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&v_o(e,t,r)};Object.defineProperty(hM,"__esModule",{value:!0});hM.createProtocolConnection=void 0;var C_o=HDt();TJr(HDt(),hM);TJr(SJr(),hM);function b_o(t,e,r,n){return(0,C_o.createMessageConnection)(t,e,r,n)}a(b_o,"createProtocolConnection");hM.createProtocolConnection=b_o});var f4t=I(rHe=>{"use strict";p();Object.defineProperty(rHe,"__esModule",{value:!0});rHe.state=void 0;rHe.state={instrumenterImplementation:void 0}});var Nce=I(($Bt,Iin)=>{p();var rGe=require("buffer"),JM=rGe.Buffer;function Tin(t,e){for(var r in t)e[r]=t[r]}a(Tin,"copyProps");JM.from&&JM.alloc&&JM.allocUnsafe&&JM.allocUnsafeSlow?Iin.exports=rGe:(Tin(rGe,$Bt),$Bt.Buffer=NY);function NY(t,e,r){return JM(t,e,r)}a(NY,"SafeBuffer");NY.prototype=Object.create(JM.prototype);Tin(JM,NY);NY.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return JM(t,e,r)};NY.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=JM(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};NY.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return JM(t)};NY.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return rGe.SlowBuffer(t)}});var VBt=I((ntu,xin)=>{p();var nGe=Nce().Buffer,Uxo=require("stream"),Qxo=require("util");function iGe(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=nGe.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=nGe.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}a(iGe,"DataStream");Qxo.inherits(iGe,Uxo);iGe.prototype.write=a(function(e){this.buffer=nGe.concat([this.buffer,nGe.from(e)]),this.emit("data",e)},"write");iGe.prototype.end=a(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");xin.exports=iGe});var Rin=I((stu,win)=>{"use strict";p();function WBt(t){var e=(t/8|0)+(t%8===0?0:1);return e}a(WBt,"getParamSize");var qxo={ES256:WBt(256),ES384:WBt(384),ES512:WBt(521)};function jxo(t){var e=qxo[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}a(jxo,"getParamBytesForAlg");win.exports=jxo});var Lin=I((ltu,Oin)=>{"use strict";p();var oGe=Nce().Buffer,Pin=Rin(),sGe=128,Din=0,Hxo=32,Gxo=16,$xo=2,Nin=Gxo|Hxo|Din<<6,aGe=$xo|Din<<6;function Vxo(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(Vxo,"base64Url");function Min(t){if(oGe.isBuffer(t))return t;if(typeof t=="string")return oGe.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}a(Min,"signatureAsBuffer");function Wxo(t,e){t=Min(t);var r=Pin(e),n=r+1,o=t.length,s=0;if(t[s++]!==Nin)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(sGe|1)&&(c=t[s++]),o-s=sGe;return o&&--n,n}a(kin,"countPadding");function zxo(t,e){t=Min(t);var r=Pin(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var o=kin(t,0,r),s=kin(t,r,t.length),c=r-o,l=r-s,u=2+c+1+1+l,d=u{"use strict";p();var vTe=require("buffer").Buffer,zBt=require("buffer").SlowBuffer;Bin.exports=cGe;function cGe(t,e){if(!vTe.isBuffer(t)||!vTe.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n{p();var Oce=Nce().Buffer,Mx=require("crypto"),Qin=Lin(),Uin=require("util"),Jxo=`"%s" is not a valid algorithm. Supported algorithms are: - "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,rTe="secret must be a string or buffer",Ice="key must be a string or a buffer",GTo="key must be a string, a buffer or an object",TBt=typeof xx.createPublicKey=="function";TBt&&(Ice+=" or a KeyObject",rTe+="or a KeyObject");function Onn(t){if(!xce.isBuffer(t)&&typeof t!="string"&&(!TBt||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw gP(Ice)}a(Onn,"checkIsPublicKey");function Lnn(t){if(!xce.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw gP(GTo)}a(Lnn,"checkIsPrivateKey");function $To(t){if(!xce.isBuffer(t)){if(typeof t=="string")return t;if(!TBt||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw gP(rTe)}}a($To,"checkIsSecretKey");function IBt(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(IBt,"fromBase64");function Bnn(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r{p();var tIo=require("buffer").Buffer;jnn.exports=a(function(e){return typeof e=="string"?e:typeof e=="number"||tIo.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var znn=I((gZl,Wnn)=>{p();var rIo=Tce().Buffer,Hnn=vBt(),nIo=xBt(),iIo=require("stream"),Gnn=wBt(),RBt=require("util");function $nn(t,e){return rIo.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a($nn,"base64url");function oIo(t,e,r){r=r||"utf8";var n=$nn(Gnn(t),"binary"),o=$nn(Gnn(e),r);return RBt.format("%s.%s",n,o)}a(oIo,"jwsSecuredInput");function Vnn(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,o=t.encoding,s=nIo(e.alg),c=oIo(e,r,o),l=s.sign(c,n);return RBt.format("%s.%s",c,l)}a(Vnn,"jwsSign");function BHe(t){var e=t.secret;if(e=e??t.privateKey,e=e??t.key,/^hs/i.test(t.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new Hnn(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Hnn(t.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}a(BHe,"SignStream");RBt.inherits(BHe,iIo);BHe.prototype.sign=a(function(){try{var e=Vnn({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}},"sign");BHe.sign=Vnn;Wnn.exports=BHe});var iin=I((EZl,nin)=>{p();var Knn=Tce().Buffer,Ynn=vBt(),sIo=xBt(),aIo=require("stream"),Jnn=wBt(),cIo=require("util"),lIo=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function uIo(t){return Object.prototype.toString.call(t)==="[object Object]"}a(uIo,"isObject");function dIo(t){if(uIo(t))return t;try{return JSON.parse(t)}catch{return}}a(dIo,"safeJsonParse");function Znn(t){var e=t.split(".",1)[0];return dIo(Knn.from(e,"base64").toString("binary"))}a(Znn,"headerFromJWS");function fIo(t){return t.split(".",2).join(".")}a(fIo,"securedInputFromJWS");function Xnn(t){return t.split(".")[2]}a(Xnn,"signatureFromJWS");function pIo(t,e){e=e||"utf8";var r=t.split(".")[1];return Knn.from(r,"base64").toString(e)}a(pIo,"payloadFromJWS");function ein(t){return lIo.test(t)&&!!Znn(t)}a(ein,"isValidJws");function tin(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=Jnn(t);var o=Xnn(t),s=fIo(t),c=sIo(e);return c.verify(s,o,r)}a(tin,"jwsVerify");function rin(t,e){if(e=e||{},t=Jnn(t),!ein(t))return null;var r=Znn(t);if(!r)return null;var n=pIo(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:Xnn(t)}}a(rin,"jwsDecode");function wce(t){t=t||{};var e=t.secret;if(e=e??t.publicKey,e=e??t.key,/^hs/i.test(t.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new Ynn(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new Ynn(t.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}a(wce,"VerifyStream");cIo.inherits(wce,aIo);wce.prototype.verify=a(function(){try{var e=tin(this.signature.buffer,this.algorithm,this.key.buffer),r=rin(this.signature.buffer,this.encoding);return this.emit("done",e,r),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}},"verify");wce.decode=rin;wce.isValid=ein;wce.verify=tin;nin.exports=wce});var UHe=I(Z7=>{p();var oin=znn(),FHe=iin(),hIo=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Z7.ALGORITHMS=hIo;Z7.sign=oin.sign;Z7.verify=FHe.verify;Z7.decode=FHe.decode;Z7.isValid=FHe.isValid;Z7.createSign=a(function(e){return new oin(e)},"createSign");Z7.createVerify=a(function(e){return new FHe(e)},"createVerify")});var kBt=I((TZl,sin)=>{p();var mIo=UHe();sin.exports=function(t,e){e=e||{};var r=mIo.decode(t,e);if(!r)return null;var n=r.payload;if(typeof n=="string")try{var o=JSON.parse(n);o!==null&&typeof o=="object"&&(n=o)}catch{}return e.complete===!0?{header:r.header,payload:n,signature:r.signature}:n}});var iTe=I((xZl,ain)=>{p();var QHe=a(function(t,e){Error.call(this,t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=t,e&&(this.inner=e)},"JsonWebTokenError");QHe.prototype=Object.create(Error.prototype);QHe.prototype.constructor=QHe;ain.exports=QHe});var PBt=I((kZl,lin)=>{p();var cin=iTe(),qHe=a(function(t,e){cin.call(this,t),this.name="NotBeforeError",this.date=e},"NotBeforeError");qHe.prototype=Object.create(cin.prototype);qHe.prototype.constructor=qHe;lin.exports=qHe});var DBt=I((NZl,din)=>{p();var uin=iTe(),jHe=a(function(t,e){uin.call(this,t),this.name="TokenExpiredError",this.expiredAt=e},"TokenExpiredError");jHe.prototype=Object.create(uin.prototype);jHe.prototype.constructor=jHe;din.exports=jHe});var NBt=I((LZl,fin)=>{p();var Rce=1e3,kce=Rce*60,Pce=kce*60,CY=Pce*24,gIo=CY*7,AIo=CY*365.25;fin.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return yIo(t);if(r==="number"&&isFinite(t))return e.long?_Io(t):EIo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function yIo(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*AIo;case"weeks":case"week":case"w":return r*gIo;case"days":case"day":case"d":return r*CY;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Pce;case"minutes":case"minute":case"mins":case"min":case"m":return r*kce;case"seconds":case"second":case"secs":case"sec":case"s":return r*Rce;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(yIo,"parse");function EIo(t){var e=Math.abs(t);return e>=CY?Math.round(t/CY)+"d":e>=Pce?Math.round(t/Pce)+"h":e>=kce?Math.round(t/kce)+"m":e>=Rce?Math.round(t/Rce)+"s":t+"ms"}a(EIo,"fmtShort");function _Io(t){var e=Math.abs(t);return e>=CY?HHe(t,e,CY,"day"):e>=Pce?HHe(t,e,Pce,"hour"):e>=kce?HHe(t,e,kce,"minute"):e>=Rce?HHe(t,e,Rce,"second"):t+" ms"}a(_Io,"fmtLong");function HHe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(HHe,"plural")});var MBt=I((UZl,pin)=>{p();var vIo=NBt();pin.exports=function(t,e){var r=e||Math.floor(Date.now()/1e3);if(typeof t=="string"){var n=vIo(t);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof t=="number"?r+t:void 0}});var Dce=I((qZl,hin)=>{"use strict";p();var CIo="2.0.0",bIo=Number.MAX_SAFE_INTEGER||9007199254740991,SIo=16,TIo=250,IIo=["major","premajor","minor","preminor","patch","prepatch","prerelease"];hin.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:SIo,MAX_SAFE_BUILD_LENGTH:TIo,MAX_SAFE_INTEGER:bIo,RELEASE_TYPES:IIo,SEMVER_SPEC_VERSION:CIo,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var oTe=I((HZl,min)=>{"use strict";p();var xIo=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};min.exports=xIo});var Nce=I((GM,gin)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:OBt,MAX_SAFE_BUILD_LENGTH:wIo,MAX_LENGTH:RIo}=Dce(),kIo=oTe();GM=gin.exports={};var PIo=GM.re=[],DIo=GM.safeRe=[],xn=GM.src=[],NIo=GM.safeSrc=[],wn=GM.t={},MIo=0,LBt="[a-zA-Z0-9-]",OIo=[["\\s",1],["\\d",RIo],[LBt,wIo]],LIo=a(t=>{for(let[e,r]of OIo)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},"makeSafeRegex"),Uo=a((t,e,r)=>{let n=LIo(e),o=MIo++;kIo(t,o,e),wn[t]=o,xn[o]=e,NIo[o]=n,PIo[o]=new RegExp(e,r?"g":void 0),DIo[o]=new RegExp(n,r?"g":void 0)},"createToken");Uo("NUMERICIDENTIFIER","0|[1-9]\\d*");Uo("NUMERICIDENTIFIERLOOSE","\\d+");Uo("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${LBt}*`);Uo("MAINVERSION",`(${xn[wn.NUMERICIDENTIFIER]})\\.(${xn[wn.NUMERICIDENTIFIER]})\\.(${xn[wn.NUMERICIDENTIFIER]})`);Uo("MAINVERSIONLOOSE",`(${xn[wn.NUMERICIDENTIFIERLOOSE]})\\.(${xn[wn.NUMERICIDENTIFIERLOOSE]})\\.(${xn[wn.NUMERICIDENTIFIERLOOSE]})`);Uo("PRERELEASEIDENTIFIER",`(?:${xn[wn.NONNUMERICIDENTIFIER]}|${xn[wn.NUMERICIDENTIFIER]})`);Uo("PRERELEASEIDENTIFIERLOOSE",`(?:${xn[wn.NONNUMERICIDENTIFIER]}|${xn[wn.NUMERICIDENTIFIERLOOSE]})`);Uo("PRERELEASE",`(?:-(${xn[wn.PRERELEASEIDENTIFIER]}(?:\\.${xn[wn.PRERELEASEIDENTIFIER]})*))`);Uo("PRERELEASELOOSE",`(?:-?(${xn[wn.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${xn[wn.PRERELEASEIDENTIFIERLOOSE]})*))`);Uo("BUILDIDENTIFIER",`${LBt}+`);Uo("BUILD",`(?:\\+(${xn[wn.BUILDIDENTIFIER]}(?:\\.${xn[wn.BUILDIDENTIFIER]})*))`);Uo("FULLPLAIN",`v?${xn[wn.MAINVERSION]}${xn[wn.PRERELEASE]}?${xn[wn.BUILD]}?`);Uo("FULL",`^${xn[wn.FULLPLAIN]}$`);Uo("LOOSEPLAIN",`[v=\\s]*${xn[wn.MAINVERSIONLOOSE]}${xn[wn.PRERELEASELOOSE]}?${xn[wn.BUILD]}?`);Uo("LOOSE",`^${xn[wn.LOOSEPLAIN]}$`);Uo("GTLT","((?:<|>)?=?)");Uo("XRANGEIDENTIFIERLOOSE",`${xn[wn.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Uo("XRANGEIDENTIFIER",`${xn[wn.NUMERICIDENTIFIER]}|x|X|\\*`);Uo("XRANGEPLAIN",`[v=\\s]*(${xn[wn.XRANGEIDENTIFIER]})(?:\\.(${xn[wn.XRANGEIDENTIFIER]})(?:\\.(${xn[wn.XRANGEIDENTIFIER]})(?:${xn[wn.PRERELEASE]})?${xn[wn.BUILD]}?)?)?`);Uo("XRANGEPLAINLOOSE",`[v=\\s]*(${xn[wn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${xn[wn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${xn[wn.XRANGEIDENTIFIERLOOSE]})(?:${xn[wn.PRERELEASELOOSE]})?${xn[wn.BUILD]}?)?)?`);Uo("XRANGE",`^${xn[wn.GTLT]}\\s*${xn[wn.XRANGEPLAIN]}$`);Uo("XRANGELOOSE",`^${xn[wn.GTLT]}\\s*${xn[wn.XRANGEPLAINLOOSE]}$`);Uo("COERCEPLAIN",`(^|[^\\d])(\\d{1,${OBt}})(?:\\.(\\d{1,${OBt}}))?(?:\\.(\\d{1,${OBt}}))?`);Uo("COERCE",`${xn[wn.COERCEPLAIN]}(?:$|[^\\d])`);Uo("COERCEFULL",xn[wn.COERCEPLAIN]+`(?:${xn[wn.PRERELEASE]})?(?:${xn[wn.BUILD]})?(?:$|[^\\d])`);Uo("COERCERTL",xn[wn.COERCE],!0);Uo("COERCERTLFULL",xn[wn.COERCEFULL],!0);Uo("LONETILDE","(?:~>?)");Uo("TILDETRIM",`(\\s*)${xn[wn.LONETILDE]}\\s+`,!0);GM.tildeTrimReplace="$1~";Uo("TILDE",`^${xn[wn.LONETILDE]}${xn[wn.XRANGEPLAIN]}$`);Uo("TILDELOOSE",`^${xn[wn.LONETILDE]}${xn[wn.XRANGEPLAINLOOSE]}$`);Uo("LONECARET","(?:\\^)");Uo("CARETTRIM",`(\\s*)${xn[wn.LONECARET]}\\s+`,!0);GM.caretTrimReplace="$1^";Uo("CARET",`^${xn[wn.LONECARET]}${xn[wn.XRANGEPLAIN]}$`);Uo("CARETLOOSE",`^${xn[wn.LONECARET]}${xn[wn.XRANGEPLAINLOOSE]}$`);Uo("COMPARATORLOOSE",`^${xn[wn.GTLT]}\\s*(${xn[wn.LOOSEPLAIN]})$|^$`);Uo("COMPARATOR",`^${xn[wn.GTLT]}\\s*(${xn[wn.FULLPLAIN]})$|^$`);Uo("COMPARATORTRIM",`(\\s*)${xn[wn.GTLT]}\\s*(${xn[wn.LOOSEPLAIN]}|${xn[wn.XRANGEPLAIN]})`,!0);GM.comparatorTrimReplace="$1$2$3";Uo("HYPHENRANGE",`^\\s*(${xn[wn.XRANGEPLAIN]})\\s+-\\s+(${xn[wn.XRANGEPLAIN]})\\s*$`);Uo("HYPHENRANGELOOSE",`^\\s*(${xn[wn.XRANGEPLAINLOOSE]})\\s+-\\s+(${xn[wn.XRANGEPLAINLOOSE]})\\s*$`);Uo("STAR","(<|>)?=?\\s*\\*");Uo("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Uo("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var GHe=I((WZl,Ain)=>{"use strict";p();var BIo=Object.freeze({loose:!0}),FIo=Object.freeze({}),UIo=a(t=>t?typeof t!="object"?BIo:t:FIo,"parseOptions");Ain.exports=UIo});var BBt=I((KZl,_in)=>{"use strict";p();var yin=/^[0-9]+$/,Ein=a((t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:tEin(e,t),"rcompareIdentifiers");_in.exports={compareIdentifiers:Ein,rcompareIdentifiers:QIo}});var bA=I((XZl,Cin)=>{"use strict";p();var $He=oTe(),{MAX_LENGTH:vin,MAX_SAFE_INTEGER:VHe}=Dce(),{safeRe:WHe,t:zHe}=Nce(),qIo=GHe(),{compareIdentifiers:FBt}=BBt(),jIo=a((t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;nvin)throw new TypeError(`version is longer than ${vin} characters`);$He("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?WHe[zHe.LOOSE]:WHe[zHe.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>VHe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>VHe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>VHe||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&se.major?1:this.minore.minor?1:this.patche.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],o=e.prerelease[r];if($He("prerelease compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return FBt(n,o)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],o=e.build[r];if($He("build compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return FBt(n,o)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let o=`-${r}`.match(this.options.loose?WHe[zHe.PRERELEASELOOSE]:WHe[zHe.PRERELEASE]);if(!o||o[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(r){let s=[r,o];if(n===!1&&(s=[r]),jIo(this.prerelease,r)){let c=this.prerelease[r.split(".").length];isNaN(c)&&(this.prerelease=s)}else this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Cin.exports=UBt});var X7=I((rXl,Sin)=>{"use strict";p();var bin=bA(),HIo=a((t,e,r=!1)=>{if(t instanceof bin)return t;try{return new bin(t,e)}catch(n){if(!r)return null;throw n}},"parse");Sin.exports=HIo});var Iin=I((oXl,Tin)=>{"use strict";p();var GIo=X7(),$Io=a((t,e)=>{let r=GIo(t,e);return r?r.version:null},"valid");Tin.exports=$Io});var win=I((cXl,xin)=>{"use strict";p();var VIo=X7(),WIo=a((t,e)=>{let r=VIo(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},"clean");xin.exports=WIo});var Pin=I((dXl,kin)=>{"use strict";p();var Rin=bA(),zIo=a((t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new Rin(t instanceof Rin?t.version:t,r).inc(e,n,o).version}catch{return null}},"inc");kin.exports=zIo});var Min=I((hXl,Nin)=>{"use strict";p();var Din=X7(),YIo=a((t,e)=>{let r=Din(t,null,!0),n=Din(e,null,!0),o=r.compare(n);if(o===0)return null;let s=o>0,c=s?r:n,l=s?n:r,u=!!c.prerelease.length;if(!!l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(l.compareMain(c)===0)return l.minor&&!l.patch?"minor":"patch"}let f=u?"pre":"";return r.major!==n.major?f+"major":r.minor!==n.minor?f+"minor":r.patch!==n.patch?f+"patch":"prerelease"},"diff");Nin.exports=YIo});var Lin=I((AXl,Oin)=>{"use strict";p();var KIo=bA(),JIo=a((t,e)=>new KIo(t,e).major,"major");Oin.exports=JIo});var Fin=I((_Xl,Bin)=>{"use strict";p();var ZIo=bA(),XIo=a((t,e)=>new ZIo(t,e).minor,"minor");Bin.exports=XIo});var Qin=I((bXl,Uin)=>{"use strict";p();var exo=bA(),txo=a((t,e)=>new exo(t,e).patch,"patch");Uin.exports=txo});var jin=I((IXl,qin)=>{"use strict";p();var rxo=X7(),nxo=a((t,e)=>{let r=rxo(t,e);return r&&r.prerelease.length?r.prerelease:null},"prerelease");qin.exports=nxo});var wx=I((RXl,Gin)=>{"use strict";p();var Hin=bA(),ixo=a((t,e,r)=>new Hin(t,r).compare(new Hin(e,r)),"compare");Gin.exports=ixo});var Vin=I((DXl,$in)=>{"use strict";p();var oxo=wx(),sxo=a((t,e,r)=>oxo(e,t,r),"rcompare");$in.exports=sxo});var zin=I((OXl,Win)=>{"use strict";p();var axo=wx(),cxo=a((t,e)=>axo(t,e,!0),"compareLoose");Win.exports=cxo});var YHe=I((FXl,Kin)=>{"use strict";p();var Yin=bA(),lxo=a((t,e,r)=>{let n=new Yin(t,r),o=new Yin(e,r);return n.compare(o)||n.compareBuild(o)},"compareBuild");Kin.exports=lxo});var Zin=I((qXl,Jin)=>{"use strict";p();var uxo=YHe(),dxo=a((t,e)=>t.sort((r,n)=>uxo(r,n,e)),"sort");Jin.exports=dxo});var eon=I((GXl,Xin)=>{"use strict";p();var fxo=YHe(),pxo=a((t,e)=>t.sort((r,n)=>fxo(n,r,e)),"rsort");Xin.exports=pxo});var sTe=I((WXl,ton)=>{"use strict";p();var hxo=wx(),mxo=a((t,e,r)=>hxo(t,e,r)>0,"gt");ton.exports=mxo});var KHe=I((KXl,ron)=>{"use strict";p();var gxo=wx(),Axo=a((t,e,r)=>gxo(t,e,r)<0,"lt");ron.exports=Axo});var QBt=I((XXl,non)=>{"use strict";p();var yxo=wx(),Exo=a((t,e,r)=>yxo(t,e,r)===0,"eq");non.exports=Exo});var qBt=I((reu,ion)=>{"use strict";p();var _xo=wx(),vxo=a((t,e,r)=>_xo(t,e,r)!==0,"neq");ion.exports=vxo});var JHe=I((oeu,oon)=>{"use strict";p();var Cxo=wx(),bxo=a((t,e,r)=>Cxo(t,e,r)>=0,"gte");oon.exports=bxo});var ZHe=I((ceu,son)=>{"use strict";p();var Sxo=wx(),Txo=a((t,e,r)=>Sxo(t,e,r)<=0,"lte");son.exports=Txo});var jBt=I((deu,aon)=>{"use strict";p();var Ixo=QBt(),xxo=qBt(),wxo=sTe(),Rxo=JHe(),kxo=KHe(),Pxo=ZHe(),Dxo=a((t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return Ixo(t,r,n);case"!=":return xxo(t,r,n);case">":return wxo(t,r,n);case">=":return Rxo(t,r,n);case"<":return kxo(t,r,n);case"<=":return Pxo(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");aon.exports=Dxo});var lon=I((heu,con)=>{"use strict";p();var Nxo=bA(),Mxo=X7(),{safeRe:XHe,t:eGe}=Nce(),Oxo=a((t,e)=>{if(t instanceof Nxo)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?XHe[eGe.COERCEFULL]:XHe[eGe.COERCE]);else{let u=e.includePrerelease?XHe[eGe.COERCERTLFULL]:XHe[eGe.COERCERTL],d;for(;(d=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||d.index+d[0].length!==r.index+r[0].length)&&(r=d),u.lastIndex=d.index+d[1].length+d[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],o=r[3]||"0",s=r[4]||"0",c=e.includePrerelease&&r[5]?`-${r[5]}`:"",l=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Mxo(`${n}.${o}.${s}${c}${l}`,e)},"coerce");con.exports=Oxo});var don=I((Aeu,uon)=>{"use strict";p();var Lxo=X7(),Bxo=Dce(),Fxo=bA(),Uxo=a((t,e,r)=>{if(!Bxo.RELEASE_TYPES.includes(e))return null;let n=Qxo(t,r);return n&&qxo(n,e)},"truncate"),Qxo=a((t,e)=>{let r=t instanceof Fxo?t.version:t;return Lxo(r,e)},"cloneInputVersion"),qxo=a((t,e)=>{if(jxo(e))return t.version;switch(t.prerelease=[],e){case"major":t.minor=0,t.patch=0;break;case"minor":t.patch=0;break}return t.format()},"doTruncation"),jxo=a(t=>t.startsWith("pre"),"isPrerelease");uon.exports=Uxo});var pon=I((_eu,fon)=>{"use strict";p();var HBt=class{static{a(this,"LRUCache")}constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(e,r)}return this}};fon.exports=HBt});var Rx=I((beu,Aon)=>{"use strict";p();var Hxo=/\s+/g,GBt=class t{static{a(this,"Range")}constructor(e,r){if(r=$xo(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof $Bt)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(Hxo," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(o=>!mon(o[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&ewo(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(Xxo,"");let n=((this.options.includePrerelease&&Jxo)|(this.options.loose&&Zxo))+":"+e,o=hon.get(n);if(o)return o;let s=this.options.loose,c=s?N_[SA.HYPHENRANGELOOSE]:N_[SA.HYPHENRANGE];e=e.replace(c,dwo(this.options.includePrerelease)),Ku("hyphen replace",e),e=e.replace(N_[SA.COMPARATORTRIM],zxo),Ku("comparator trim",e),e=e.replace(N_[SA.TILDETRIM],Yxo),Ku("tilde trim",e),e=e.replace(N_[SA.CARETTRIM],Kxo),Ku("caret trim",e);let l=e.split(" ").map(h=>two(h,this.options)).join(" ").split(/\s+/).map(h=>uwo(h,this.options));s&&(l=l.filter(h=>(Ku("loose invalid filter",h,this.options),!!h.match(N_[SA.COMPARATORLOOSE])))),Ku("range list",l);let u=new Map,d=l.map(h=>new $Bt(h,this.options));for(let h of d){if(mon(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let f=[...u.values()];return hon.set(n,f),f}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>gon(n,r)&&e.set.some(o=>gon(o,r)&&n.every(s=>o.every(c=>s.intersects(c,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Vxo(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0","isNullSet"),ewo=a(t=>t.value==="","isAny"),gon=a((t,e)=>{let r=!0,n=t.slice(),o=n.pop();for(;r&&n.length;)r=n.every(s=>o.intersects(s,e)),o=n.pop();return r},"isSatisfiable"),two=a((t,e)=>(t=t.replace(N_[SA.BUILD],""),Ku("comp",t,e),t=owo(t,e),Ku("caret",t),t=nwo(t,e),Ku("tildes",t),t=awo(t,e),Ku("xrange",t),t=lwo(t,e),Ku("stars",t),t),"parseComparator"),n0=a(t=>!t||t.toLowerCase()==="x"||t==="*","isX"),rwo=a((t,e,r)=>n0(t)&&!n0(e)||n0(e)&&r&&!n0(r),"invalidXRangeOrder"),nwo=a((t,e)=>t.trim().split(/\s+/).map(r=>iwo(r,e)).join(" "),"replaceTildes"),iwo=a((t,e)=>{let r=e.loose?N_[SA.TILDELOOSE]:N_[SA.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{Ku("tilde",t,o,s,c,l,u);let d;return n0(s)?d="":n0(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:n0(l)?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:u?(Ku("replaceTilde pr",u),d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`):d=`>=${s}.${c}.${l} <${s}.${+c+1}.0-0`,Ku("tilde return",d),d})},"replaceTilde"),owo=a((t,e)=>t.trim().split(/\s+/).map(r=>swo(r,e)).join(" "),"replaceCarets"),swo=a((t,e)=>{Ku("caret",t,e);let r=e.loose?N_[SA.CARETLOOSE]:N_[SA.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{Ku("caret",t,o,s,c,l,u);let d;return n0(s)?d="":n0(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:n0(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?(Ku("replaceCaret pr",u),s==="0"?c==="0"?d=`>=${s}.${c}.${l}-${u} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l}-${u} <${+s+1}.0.0-0`):(Ku("no pr"),s==="0"?c==="0"?d=`>=${s}.${c}.${l} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l} <${+s+1}.0.0-0`),Ku("caret return",d),d})},"replaceCaret"),awo=a((t,e)=>(Ku("replaceXRanges",t,e),t.split(/\s+/).map(r=>cwo(r,e)).join(" ")),"replaceXRanges"),cwo=a((t,e)=>{t=t.trim();let r=e.loose?N_[SA.XRANGELOOSE]:N_[SA.XRANGE];return t.replace(r,(n,o,s,c,l,u)=>{if(Ku("xRange",t,n,o,s,c,l,u),rwo(s,c,l))return t;let d=n0(s),f=d||n0(c),h=f||n0(l),m=h;return o==="="&&m&&(o=""),u=e.includePrerelease?"-0":"",d?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),o==="<"&&(u="-0"),n=`${o+s}.${c}.${l}${u}`):f?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:h&&(n=`>=${s}.${c}.0${u} <${s}.${+c+1}.0-0`),Ku("xRange return",n),n})},"replaceXRange"),lwo=a((t,e)=>(Ku("replaceStars",t,e),t.trim().replace(N_[SA.STAR],"")),"replaceStars"),uwo=a((t,e)=>(Ku("replaceGTE0",t,e),t.trim().replace(N_[e.includePrerelease?SA.GTE0PRE:SA.GTE0],"")),"replaceGTE0"),dwo=a(t=>(e,r,n,o,s,c,l,u,d,f,h,m)=>(n0(n)?r="":n0(o)?r=`>=${n}.0.0${t?"-0":""}`:n0(s)?r=`>=${n}.${o}.0${t?"-0":""}`:c?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,n0(d)?u="":n0(f)?u=`<${+d+1}.0.0-0`:n0(h)?u=`<${d}.${+f+1}.0-0`:m?u=`<=${d}.${f}.${h}-${m}`:t?u=`<${d}.${f}.${+h+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),"hyphenReplace"),fwo=a((t,e,r)=>{for(let n=0;n0){let o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0},"testSet")});var aTe=I((Ieu,bon)=>{"use strict";p();var cTe=Symbol("SemVer ANY"),zBt=class t{static{a(this,"Comparator")}static get ANY(){return cTe}constructor(e,r){if(r=yon(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),WBt("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===cTe?this.value="":this.value=this.operator+this.semver.version,WBt("comp",this)}parse(e){let r=this.options.loose?Eon[_on.COMPARATORLOOSE]:Eon[_on.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new von(n[2],this.options.loose):this.semver=cTe}toString(){return this.value}test(e){if(WBt("Comparator.test",e,this.options.loose),this.semver===cTe||e===cTe)return!0;if(typeof e=="string")try{e=new von(e,this.options)}catch{return!1}return VBt(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Con(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Con(this.value,r).test(e.semver):(r=yon(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||VBt(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||VBt(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};bon.exports=zBt;var yon=GHe(),{safeRe:Eon,t:_on}=Nce(),VBt=jBt(),WBt=oTe(),von=bA(),Con=Rx()});var lTe=I((Reu,Son)=>{"use strict";p();var pwo=Rx(),hwo=a((t,e,r)=>{try{e=new pwo(e,r)}catch{return!1}return e.test(t)},"satisfies");Son.exports=hwo});var Ion=I((Deu,Ton)=>{"use strict";p();var mwo=Rx(),gwo=a((t,e)=>new mwo(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" ")),"toComparators");Ton.exports=gwo});var won=I((Oeu,xon)=>{"use strict";p();var Awo=bA(),ywo=Rx(),Ewo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new ywo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Awo(n,r))}),n},"maxSatisfying");xon.exports=Ewo});var kon=I((Feu,Ron)=>{"use strict";p();var _wo=bA(),vwo=Rx(),Cwo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new vwo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new _wo(n,r))}),n},"minSatisfying");Ron.exports=Cwo});var Non=I((qeu,Don)=>{"use strict";p();var YBt=bA(),bwo=Rx(),Pon=sTe(),Swo=a((t,e)=>{t=new bwo(t,e);let r=new YBt("0.0.0");if(t.test(r)||(r=new YBt("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{let l=new YBt(c.semver.version);switch(c.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!s||Pon(l,s))&&(s=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),s&&(!r||Pon(r,s))&&(r=s)}return r&&t.test(r)?r:null},"minVersion");Don.exports=Swo});var Oon=I((Geu,Mon)=>{"use strict";p();var Two=Rx(),Iwo=a((t,e)=>{try{return new Two(t,e).range||"*"}catch{return null}},"validRange");Mon.exports=Iwo});var tGe=I((Weu,Uon)=>{"use strict";p();var xwo=bA(),Fon=aTe(),{ANY:wwo}=Fon,Rwo=Rx(),kwo=lTe(),Lon=sTe(),Bon=KHe(),Pwo=ZHe(),Dwo=JHe(),Nwo=a((t,e,r,n)=>{t=new xwo(t,n),e=new Rwo(e,n);let o,s,c,l,u;switch(r){case">":o=Lon,s=Pwo,c=Bon,l=">",u=">=";break;case"<":o=Bon,s=Dwo,c=Lon,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(kwo(t,e,n))return!1;for(let d=0;d{g.semver===wwo&&(g=new Fon(">=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0},"outside");Uon.exports=Nwo});var qon=I((Keu,Qon)=>{"use strict";p();var Mwo=tGe(),Owo=a((t,e,r)=>Mwo(t,e,">",r),"gtr");Qon.exports=Owo});var Hon=I((Xeu,jon)=>{"use strict";p();var Lwo=tGe(),Bwo=a((t,e,r)=>Lwo(t,e,"<",r),"ltr");jon.exports=Bwo});var Von=I((rtu,$on)=>{"use strict";p();var Gon=Rx(),Fwo=a((t,e,r)=>(t=new Gon(t,r),e=new Gon(e,r),t.intersects(e,r)),"intersects");$on.exports=Fwo});var zon=I((otu,Won)=>{"use strict";p();var Uwo=lTe(),Qwo=wx();Won.exports=(t,e,r)=>{let n=[],o=null,s=null,c=t.sort((f,h)=>Qwo(f,h,r));for(let f of c)Uwo(f,e,r)?(s=f,o||(o=f)):(s&&n.push([o,s]),s=null,o=null);o&&n.push([o,null]);let l=[];for(let[f,h]of n)f===h?l.push(f):!h&&f===c[0]?l.push("*"):h?f===c[0]?l.push(`<=${h}`):l.push(`${f} - ${h}`):l.push(`>=${f}`);let u=l.join(" || "),d=typeof e.raw=="string"?e.raw:String(e);return u.length{"use strict";p();var Yon=Rx(),ZBt=aTe(),{ANY:KBt}=ZBt,JBt=lTe(),XBt=wx(),qwo=a((t,e,r={})=>{if(t===e)return!0;t=new Yon(t,r),e=new Yon(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let c=Hwo(o,s,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},"subset"),jwo=[new ZBt(">=0.0.0-0")],Kon=[new ZBt(">=0.0.0")],Hwo=a((t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===KBt){if(e.length===1&&e[0].semver===KBt)return!0;r.includePrerelease?t=jwo:t=Kon}if(e.length===1&&e[0].semver===KBt){if(r.includePrerelease)return!0;e=Kon}let n=new Set,o,s;for(let g of t)g.operator===">"||g.operator===">="?o=Jon(o,g,r):g.operator==="<"||g.operator==="<="?s=Zon(s,g,r):n.add(g.semver);if(n.size>1)return null;let c;if(o&&s){if(c=XBt(o.semver,s.semver,r),c>0)return null;if(c===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let g of n){if(o&&!JBt(g,String(o),r)||s&&!JBt(g,String(s),r))return null;for(let A of e)if(!JBt(g,String(A),r))return!1;return!0}let l,u,d,f,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;h&&h.prerelease.length===1&&s.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(let g of e){if(f=f||g.operator===">"||g.operator===">=",d=d||g.operator==="<"||g.operator==="<=",o){if(m&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===m.major&&g.semver.minor===m.minor&&g.semver.patch===m.patch&&(m=!1),g.operator===">"||g.operator===">="){if(l=Jon(o,g,r),l===g&&l!==o)return!1}else if(o.operator===">="&&!g.test(o.semver))return!1}if(s){if(h&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===h.major&&g.semver.minor===h.minor&&g.semver.patch===h.patch&&(h=!1),g.operator==="<"||g.operator==="<="){if(u=Zon(s,g,r),u===g&&u!==s)return!1}else if(s.operator==="<="&&!g.test(s.semver))return!1}if(!g.operator&&(s||o)&&c!==0)return!1}return!(o&&d&&!s&&c!==0||s&&f&&!o&&c!==0||m||h)},"simpleSubset"),Jon=a((t,e,r)=>{if(!t)return e;let n=XBt(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},"higherGT"),Zon=a((t,e,r)=>{if(!t)return e;let n=XBt(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t},"lowerLT");Xon.exports=qwo});var AP=I((utu,nsn)=>{"use strict";p();var e3t=Nce(),tsn=Dce(),Gwo=bA(),rsn=BBt(),$wo=X7(),Vwo=Iin(),Wwo=win(),zwo=Pin(),Ywo=Min(),Kwo=Lin(),Jwo=Fin(),Zwo=Qin(),Xwo=jin(),eRo=wx(),tRo=Vin(),rRo=zin(),nRo=YHe(),iRo=Zin(),oRo=eon(),sRo=sTe(),aRo=KHe(),cRo=QBt(),lRo=qBt(),uRo=JHe(),dRo=ZHe(),fRo=jBt(),pRo=lon(),hRo=don(),mRo=aTe(),gRo=Rx(),ARo=lTe(),yRo=Ion(),ERo=won(),_Ro=kon(),vRo=Non(),CRo=Oon(),bRo=tGe(),SRo=qon(),TRo=Hon(),IRo=Von(),xRo=zon(),wRo=esn();nsn.exports={parse:$wo,valid:Vwo,clean:Wwo,inc:zwo,diff:Ywo,major:Kwo,minor:Jwo,patch:Zwo,prerelease:Xwo,compare:eRo,rcompare:tRo,compareLoose:rRo,compareBuild:nRo,sort:iRo,rsort:oRo,gt:sRo,lt:aRo,eq:cRo,neq:lRo,gte:uRo,lte:dRo,cmp:fRo,coerce:pRo,truncate:hRo,Comparator:mRo,Range:gRo,satisfies:ARo,toComparators:yRo,maxSatisfying:ERo,minSatisfying:_Ro,minVersion:vRo,validRange:CRo,outside:bRo,gtr:SRo,ltr:TRo,intersects:IRo,simplifyRange:xRo,subset:wRo,SemVer:Gwo,re:e3t.re,src:e3t.src,tokens:e3t.t,SEMVER_SPEC_VERSION:tsn.SEMVER_SPEC_VERSION,RELEASE_TYPES:tsn.RELEASE_TYPES,compareIdentifiers:rsn.compareIdentifiers,rcompareIdentifiers:rsn.rcompareIdentifiers}});var osn=I((ftu,isn)=>{p();var RRo=AP();isn.exports=RRo.satisfies(process.version,">=15.7.0")});var asn=I((htu,ssn)=>{p();var kRo=AP();ssn.exports=kRo.satisfies(process.version,">=16.9.0")});var t3t=I((gtu,csn)=>{p();var PRo=osn(),DRo=asn(),NRo={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},MRo={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};csn.exports=function(t,e){if(!t||!e)return;let r=e.asymmetricKeyType;if(!r)return;let n=NRo[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(t))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(PRo)switch(r){case"ec":let o=e.asymmetricKeyDetails.namedCurve,s=MRo[t];if(o!==s)throw new Error(`"alg" parameter "${t}" requires curve "${s}".`);break;case"rsa-pss":if(DRo){let c=parseInt(t.slice(-3),10),{hashAlgorithm:l,mgf1HashAlgorithm:u,saltLength:d}=e.asymmetricKeyDetails;if(l!==`sha${c}`||u!==l)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${t}.`);if(d!==void 0&&d>c>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${t}.`)}break}}});var r3t=I((ytu,lsn)=>{p();var ORo=AP();lsn.exports=ORo.satisfies(process.version,"^6.12.0 || >=8.0.0")});var fsn=I((_tu,dsn)=>{p();var pu=iTe(),LRo=PBt(),usn=DBt(),BRo=kBt(),FRo=MBt(),URo=t3t(),QRo=r3t(),qRo=UHe(),{KeyObject:jRo,createSecretKey:HRo,createPublicKey:GRo}=require("crypto"),n3t=["RS256","RS384","RS512"],$Ro=["ES256","ES384","ES512"],i3t=["RS256","RS384","RS512"],VRo=["HS256","HS384","HS512"];QRo&&(n3t.splice(n3t.length,0,"PS256","PS384","PS512"),i3t.splice(i3t.length,0,"PS256","PS384","PS512"));dsn.exports=function(t,e,r,n){typeof r=="function"&&!n&&(n=r,r={}),r||(r={}),r=Object.assign({},r);let o;if(n?o=n:o=a(function(f,h){if(f)throw f;return h},"done"),r.clockTimestamp&&typeof r.clockTimestamp!="number")return o(new pu("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return o(new pu("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return o(new pu("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return o(new pu("jwt must be provided"));if(typeof t!="string")return o(new pu("jwt must be a string"));let c=t.split(".");if(c.length!==3)return o(new pu("jwt malformed"));let l;try{l=BRo(t,{complete:!0})}catch(f){return o(f)}if(!l)return o(new pu("invalid token"));let u=l.header,d;if(typeof e=="function"){if(!n)return o(new pu("verify must be called asynchronous if secret or public key is provided as a callback"));d=e}else d=a(function(f,h){return h(null,e)},"getSecret");return d(u,function(f,h){if(f)return o(new pu("error in secret or public key callback: "+f.message));let m=c[2].trim()!=="";if(!m&&h)return o(new pu("jwt signature is required"));if(m&&!h)return o(new pu("secret or public key must be provided"));if(!m&&!r.algorithms)return o(new pu('please specify "none" in "algorithms" to verify unsigned tokens'));if(h!=null&&!(h instanceof jRo))try{h=GRo(h)}catch{try{h=HRo(typeof h=="string"?Buffer.from(h):h)}catch{return o(new pu("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(h.type==="secret"?r.algorithms=VRo:["rsa","rsa-pss"].includes(h.asymmetricKeyType)?r.algorithms=i3t:h.asymmetricKeyType==="ec"?r.algorithms=$Ro:r.algorithms=n3t),r.algorithms.indexOf(l.header.alg)===-1)return o(new pu("invalid algorithm"));if(u.alg.startsWith("HS")&&h.type!=="secret")return o(new pu(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&h.type!=="public")return o(new pu(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{URo(u.alg,h)}catch(y){return o(y)}let g;try{g=qRo.verify(t,l.header.alg,h)}catch(y){return o(y)}if(!g)return o(new pu("invalid signature"));let A=l.payload;if(typeof A.nbf<"u"&&!r.ignoreNotBefore){if(typeof A.nbf!="number")return o(new pu("invalid nbf value"));if(A.nbf>s+(r.clockTolerance||0))return o(new LRo("jwt not active",new Date(A.nbf*1e3)))}if(typeof A.exp<"u"&&!r.ignoreExpiration){if(typeof A.exp!="number")return o(new pu("invalid exp value"));if(s>=A.exp+(r.clockTolerance||0))return o(new usn("jwt expired",new Date(A.exp*1e3)))}if(r.audience){let y=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(A.aud)?A.aud:[A.aud]).some(function(v){return y.some(function(b){return b instanceof RegExp?b.test(v):b===v})}))return o(new pu("jwt audience invalid. expected: "+y.join(" or ")))}if(r.issuer&&(typeof r.issuer=="string"&&A.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(A.iss)===-1))return o(new pu("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&A.sub!==r.subject)return o(new pu("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&A.jti!==r.jwtid)return o(new pu("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&A.nonce!==r.nonce)return o(new pu("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof A.iat!="number")return o(new pu("iat required when maxAge is specified"));let y=FRo(r.maxAge,A.iat);if(typeof y>"u")return o(new pu('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(s>=y+(r.clockTolerance||0))return o(new usn("maxAge exceeded",new Date(y*1e3)))}if(r.complete===!0){let y=l.signature;return o(null,{header:u,payload:A,signature:y})}return o(null,A)})}});var ysn=I((btu,Asn)=>{p();var psn=1/0,msn=9007199254740991,WRo=17976931348623157e292,hsn=NaN,zRo="[object Arguments]",YRo="[object Function]",KRo="[object GeneratorFunction]",JRo="[object String]",ZRo="[object Symbol]",XRo=/^\s+|\s+$/g,eko=/^[-+]0x[0-9a-f]+$/i,tko=/^0b[01]+$/i,rko=/^0o[0-7]+$/i,nko=/^(?:0|[1-9]\d*)$/,iko=parseInt;function oko(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r-1&&t%1==0&&t-1:!!o&&ako(t,e,r)>-1}a(Eko,"includes");function _ko(t){return vko(t)&&s3t.call(t,"callee")&&(!fko.call(t,"callee")||nGe.call(t)==zRo)}a(_ko,"isArguments");var gsn=Array.isArray;function a3t(t){return t!=null&&bko(t.length)&&!Cko(t)}a(a3t,"isArrayLike");function vko(t){return c3t(t)&&a3t(t)}a(vko,"isArrayLikeObject");function Cko(t){var e=o3t(t)?nGe.call(t):"";return e==YRo||e==KRo}a(Cko,"isFunction");function bko(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=msn}a(bko,"isLength");function o3t(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(o3t,"isObject");function c3t(t){return!!t&&typeof t=="object"}a(c3t,"isObjectLike");function Sko(t){return typeof t=="string"||!gsn(t)&&c3t(t)&&nGe.call(t)==JRo}a(Sko,"isString");function Tko(t){return typeof t=="symbol"||c3t(t)&&nGe.call(t)==ZRo}a(Tko,"isSymbol");function Iko(t){if(!t)return t===0?t:0;if(t=wko(t),t===psn||t===-psn){var e=t<0?-1:1;return e*WRo}return t===t?t:0}a(Iko,"toFinite");function xko(t){var e=Iko(t),r=e%1;return e===e?r?e-r:e:0}a(xko,"toInteger");function wko(t){if(typeof t=="number")return t;if(Tko(t))return hsn;if(o3t(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=o3t(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(XRo,"");var r=tko.test(t);return r||rko.test(t)?iko(t.slice(2),r?2:8):eko.test(t)?hsn:+t}a(wko,"toNumber");function Rko(t){return a3t(t)?mko(t):gko(t)}a(Rko,"keys");function kko(t){return t?uko(t,Rko(t)):[]}a(kko,"values");Asn.exports=Eko});var _sn=I((Itu,Esn)=>{p();var Pko="[object Boolean]",Dko=Object.prototype,Nko=Dko.toString;function Mko(t){return t===!0||t===!1||Oko(t)&&Nko.call(t)==Pko}a(Mko,"isBoolean");function Oko(t){return!!t&&typeof t=="object"}a(Oko,"isObjectLike");Esn.exports=Mko});var Tsn=I((Rtu,Ssn)=>{p();var vsn=1/0,Lko=17976931348623157e292,Csn=NaN,Bko="[object Symbol]",Fko=/^\s+|\s+$/g,Uko=/^[-+]0x[0-9a-f]+$/i,Qko=/^0b[01]+$/i,qko=/^0o[0-7]+$/i,jko=parseInt,Hko=Object.prototype,Gko=Hko.toString;function $ko(t){return typeof t=="number"&&t==Yko(t)}a($ko,"isInteger");function bsn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(bsn,"isObject");function Vko(t){return!!t&&typeof t=="object"}a(Vko,"isObjectLike");function Wko(t){return typeof t=="symbol"||Vko(t)&&Gko.call(t)==Bko}a(Wko,"isSymbol");function zko(t){if(!t)return t===0?t:0;if(t=Kko(t),t===vsn||t===-vsn){var e=t<0?-1:1;return e*Lko}return t===t?t:0}a(zko,"toFinite");function Yko(t){var e=zko(t),r=e%1;return e===e?r?e-r:e:0}a(Yko,"toInteger");function Kko(t){if(typeof t=="number")return t;if(Wko(t))return Csn;if(bsn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=bsn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Fko,"");var r=Qko.test(t);return r||qko.test(t)?jko(t.slice(2),r?2:8):Uko.test(t)?Csn:+t}a(Kko,"toNumber");Ssn.exports=$ko});var xsn=I((Dtu,Isn)=>{p();var Jko="[object Number]",Zko=Object.prototype,Xko=Zko.toString;function ePo(t){return!!t&&typeof t=="object"}a(ePo,"isObjectLike");function tPo(t){return typeof t=="number"||ePo(t)&&Xko.call(t)==Jko}a(tPo,"isNumber");Isn.exports=tPo});var Psn=I((Otu,ksn)=>{p();var rPo="[object Object]";function nPo(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}a(nPo,"isHostObject");function iPo(t,e){return function(r){return t(e(r))}}a(iPo,"overArg");var oPo=Function.prototype,wsn=Object.prototype,Rsn=oPo.toString,sPo=wsn.hasOwnProperty,aPo=Rsn.call(Object),cPo=wsn.toString,lPo=iPo(Object.getPrototypeOf,Object);function uPo(t){return!!t&&typeof t=="object"}a(uPo,"isObjectLike");function dPo(t){if(!uPo(t)||cPo.call(t)!=rPo||nPo(t))return!1;var e=lPo(t);if(e===null)return!0;var r=sPo.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Rsn.call(r)==aPo}a(dPo,"isPlainObject");ksn.exports=dPo});var Nsn=I((Ftu,Dsn)=>{p();var fPo="[object String]",pPo=Object.prototype,hPo=pPo.toString,mPo=Array.isArray;function gPo(t){return!!t&&typeof t=="object"}a(gPo,"isObjectLike");function APo(t){return typeof t=="string"||!mPo(t)&&gPo(t)&&hPo.call(t)==fPo}a(APo,"isString");Dsn.exports=APo});var Fsn=I((qtu,Bsn)=>{p();var yPo="Expected a function",Msn=1/0,EPo=17976931348623157e292,Osn=NaN,_Po="[object Symbol]",vPo=/^\s+|\s+$/g,CPo=/^[-+]0x[0-9a-f]+$/i,bPo=/^0b[01]+$/i,SPo=/^0o[0-7]+$/i,TPo=parseInt,IPo=Object.prototype,xPo=IPo.toString;function wPo(t,e){var r;if(typeof e!="function")throw new TypeError(yPo);return t=NPo(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}a(wPo,"before");function RPo(t){return wPo(2,t)}a(RPo,"once");function Lsn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(Lsn,"isObject");function kPo(t){return!!t&&typeof t=="object"}a(kPo,"isObjectLike");function PPo(t){return typeof t=="symbol"||kPo(t)&&xPo.call(t)==_Po}a(PPo,"isSymbol");function DPo(t){if(!t)return t===0?t:0;if(t=MPo(t),t===Msn||t===-Msn){var e=t<0?-1:1;return e*EPo}return t===t?t:0}a(DPo,"toFinite");function NPo(t){var e=DPo(t),r=e%1;return e===e?r?e-r:e:0}a(NPo,"toInteger");function MPo(t){if(typeof t=="number")return t;if(PPo(t))return Osn;if(Lsn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Lsn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(vPo,"");var r=bPo.test(t);return r||SPo.test(t)?TPo(t.slice(2),r?2:8):CPo.test(t)?Osn:+t}a(MPo,"toNumber");Bsn.exports=RPo});var Wsn=I((Gtu,Vsn)=>{p();var Usn=MBt(),OPo=r3t(),LPo=t3t(),Qsn=UHe(),BPo=ysn(),iGe=_sn(),qsn=Tsn(),l3t=xsn(),Hsn=Psn(),eQ=Nsn(),FPo=Fsn(),{KeyObject:UPo,createSecretKey:QPo,createPrivateKey:qPo}=require("crypto"),Gsn=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];OPo&&Gsn.splice(3,0,"PS256","PS384","PS512");var jPo={expiresIn:{isValid:a(function(t){return qsn(t)||eQ(t)&&t},"isValid"),message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:a(function(t){return qsn(t)||eQ(t)&&t},"isValid"),message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:a(function(t){return eQ(t)||Array.isArray(t)},"isValid"),message:'"audience" must be a string or array'},algorithm:{isValid:BPo.bind(null,Gsn),message:'"algorithm" must be a valid string enum value'},header:{isValid:Hsn,message:'"header" must be an object'},encoding:{isValid:eQ,message:'"encoding" must be a string'},issuer:{isValid:eQ,message:'"issuer" must be a string'},subject:{isValid:eQ,message:'"subject" must be a string'},jwtid:{isValid:eQ,message:'"jwtid" must be a string'},noTimestamp:{isValid:iGe,message:'"noTimestamp" must be a boolean'},keyid:{isValid:eQ,message:'"keyid" must be a string'},mutatePayload:{isValid:iGe,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:iGe,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:iGe,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},HPo={iat:{isValid:l3t,message:'"iat" should be a number of seconds'},exp:{isValid:l3t,message:'"exp" should be a number of seconds'},nbf:{isValid:l3t,message:'"nbf" should be a number of seconds'}};function $sn(t,e,r,n){if(!Hsn(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(o){let s=t[o];if(!s){if(!e)throw new Error('"'+o+'" is not allowed in "'+n+'"');return}if(!s.isValid(r[o]))throw new Error(s.message)})}a($sn,"validate");function GPo(t){return $sn(jPo,!1,t,"options")}a(GPo,"validateOptions");function $Po(t){return $sn(HPo,!0,t,"payload")}a($Po,"validatePayload");var jsn={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},VPo=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];Vsn.exports=function(t,e,r,n){typeof r=="function"?(n=r,r={}):r=r||{};let o=typeof t=="object"&&!Buffer.isBuffer(t),s=Object.assign({alg:r.algorithm||"HS256",typ:o?"JWT":void 0,kid:r.keyid},r.header);function c(d){if(n)return n(d);throw d}if(a(c,"failure"),!e&&r.algorithm!=="none")return c(new Error("secretOrPrivateKey must have a value"));if(e!=null&&!(e instanceof UPo))try{e=qPo(e)}catch{try{e=QPo(typeof e=="string"?Buffer.from(e):e)}catch{return c(new Error("secretOrPrivateKey is not valid key material"))}}if(s.alg.startsWith("HS")&&e.type!=="secret")return c(new Error(`secretOrPrivateKey must be a symmetric key when using ${s.alg}`));if(/^(?:RS|PS|ES)/.test(s.alg)){if(e.type!=="private")return c(new Error(`secretOrPrivateKey must be an asymmetric key when using ${s.alg}`));if(!r.allowInsecureKeySizes&&!s.alg.startsWith("ES")&&e.asymmetricKeyDetails!==void 0&&e.asymmetricKeyDetails.modulusLength<2048)return c(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`))}if(typeof t>"u")return c(new Error("payload is required"));if(o){try{$Po(t)}catch(d){return c(d)}r.mutatePayload||(t=Object.assign({},t))}else{let d=VPo.filter(function(f){return typeof r[f]<"u"});if(d.length>0)return c(new Error("invalid "+d.join(",")+" option for "+typeof t+" payload"))}if(typeof t.exp<"u"&&typeof r.expiresIn<"u")return c(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof t.nbf<"u"&&typeof r.notBefore<"u")return c(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{GPo(r)}catch(d){return c(d)}if(!r.allowInvalidAsymmetricKeyTypes)try{LPo(s.alg,e)}catch(d){return c(d)}let l=t.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete t.iat:o&&(t.iat=l),typeof r.notBefore<"u"){try{t.nbf=Usn(r.notBefore,l)}catch(d){return c(d)}if(typeof t.nbf>"u")return c(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof t=="object"){try{t.exp=Usn(r.expiresIn,l)}catch(d){return c(d)}if(typeof t.exp>"u")return c(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(jsn).forEach(function(d){let f=jsn[d];if(typeof r[d]<"u"){if(typeof t[f]<"u")return c(new Error('Bad "options.'+d+'" option. The payload already has an "'+f+'" property.'));t[f]=r[d]}});let u=r.encoding||"utf8";if(typeof n=="function")n=n&&FPo(n),Qsn.createSign({header:s,privateKey:e,payload:t,encoding:u}).once("error",n).once("done",function(d){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&d.length<256)return n(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`));n(null,d)});else{let d=Qsn.sign({header:s,payload:t,secret:e,encoding:u});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&d.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`);return d}}});var Ysn=I((Wtu,zsn)=>{p();zsn.exports={decode:kBt(),verify:fsn(),sign:Wsn(),JsonWebTokenError:iTe(),NotBeforeError:PBt(),TokenExpiredError:DBt()}});var Q3t=I((qlu,Yan)=>{p();function z2o(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=o,r.enabled=c,r.humanize=NBt(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let P=r.formatters[x];if(typeof P=="function"){let D=E[T];R=P.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,E),(_.log||r.log).apply(_,E)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(E=>{m=E},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h,m=(typeof f=="string"?f:"").split(/[\s,]+/),g=m.length;for(h=0;h"-"+h)].join(",");return r.enable(""),f}a(s,"disable");function c(f){if(f[f.length-1]==="*")return!0;let h,m;for(h=0,m=r.skips.length;h{p();CS.formatArgs=K2o;CS.save=J2o;CS.load=Z2o;CS.useColors=Y2o;CS.storage=X2o();CS.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();CS.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Y2o(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(Y2o,"useColors");function K2o(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+OGe.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(K2o,"formatArgs");CS.log=console.debug||console.log||(()=>{});function J2o(t){try{t?CS.storage.setItem("debug",t):CS.storage.removeItem("debug")}catch{}}a(J2o,"save");function Z2o(){let t;try{t=CS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(Z2o,"load");function X2o(){try{return localStorage}catch{}}a(X2o,"localstorage");OGe.exports=Q3t()(CS);var{formatters:eDo}=OGe.exports;eDo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Zan=I((Vlu,Jan)=>{"use strict";p();Jan.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),o=e.indexOf("--");return n!==-1&&(o===-1||n{"use strict";p();var tDo=require("os"),Xan=require("tty"),Px=Zan(),{env:og}=process,nQ;Px("no-color")||Px("no-colors")||Px("color=false")||Px("color=never")?nQ=0:(Px("color")||Px("colors")||Px("color=true")||Px("color=always"))&&(nQ=1);"FORCE_COLOR"in og&&(og.FORCE_COLOR==="true"?nQ=1:og.FORCE_COLOR==="false"?nQ=0:nQ=og.FORCE_COLOR.length===0?1:Math.min(parseInt(og.FORCE_COLOR,10),3));function q3t(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}a(q3t,"translateLevel");function j3t(t,e){if(nQ===0)return 0;if(Px("color=16m")||Px("color=full")||Px("color=truecolor"))return 3;if(Px("color=256"))return 2;if(t&&!e&&nQ===void 0)return 0;let r=nQ||0;if(og.TERM==="dumb")return r;if(process.platform==="win32"){let n=tDo.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in og)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in og)||og.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in og)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(og.TEAMCITY_VERSION)?1:0;if(og.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in og){let n=parseInt((og.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(og.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(og.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(og.TERM)||"COLORTERM"in og?1:r}a(j3t,"supportsColor");function rDo(t){let e=j3t(t,t&&t.isTTY);return q3t(e)}a(rDo,"getSupportLevel");ecn.exports={supportsColor:rDo,stdout:q3t(j3t(!0,Xan.isatty(1))),stderr:q3t(j3t(!0,Xan.isatty(2)))}});var rcn=I((IA,FGe)=>{p();var nDo=require("tty"),BGe=require("util");IA.init=uDo;IA.log=aDo;IA.formatArgs=oDo;IA.save=cDo;IA.load=lDo;IA.useColors=iDo;IA.destroy=BGe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");IA.colors=[6,2,3,4,5,1];try{let t=LGe();t&&(t.stderr||t).level>=2&&(IA.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}IA.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function iDo(){return"colors"in IA.inspectOpts?!!IA.inspectOpts.colors:nDo.isatty(process.stderr.fd)}a(iDo,"useColors");function oDo(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` + "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,CTe="secret must be a string or buffer",Mce="key must be a string or a buffer",Zxo="key must be a string, a buffer or an object",KBt=typeof Mx.createPublicKey=="function";KBt&&(Mce+=" or a KeyObject",CTe+="or a KeyObject");function qin(t){if(!Oce.isBuffer(t)&&typeof t!="string"&&(!KBt||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw TP(Mce)}a(qin,"checkIsPublicKey");function jin(t){if(!Oce.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw TP(Zxo)}a(jin,"checkIsPrivateKey");function Xxo(t){if(!Oce.isBuffer(t)){if(typeof t=="string")return t;if(!KBt||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw TP(CTe)}}a(Xxo,"checkIsSecretKey");function JBt(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(JBt,"fromBase64");function Hin(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r{p();var lwo=require("buffer").Buffer;zin.exports=a(function(e){return typeof e=="string"?e:typeof e=="number"||lwo.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var eon=I((vtu,Xin)=>{p();var uwo=Nce().Buffer,Yin=VBt(),dwo=ZBt(),fwo=require("stream"),Kin=XBt(),e3t=require("util");function Jin(t,e){return uwo.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(Jin,"base64url");function pwo(t,e,r){r=r||"utf8";var n=Jin(Kin(t),"binary"),o=Jin(Kin(e),r);return e3t.format("%s.%s",n,o)}a(pwo,"jwsSecuredInput");function Zin(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,o=t.encoding,s=dwo(e.alg),c=pwo(e,r,o),l=s.sign(c,n);return e3t.format("%s.%s",c,l)}a(Zin,"jwsSign");function lGe(t){var e=t.secret;if(e=e??t.privateKey,e=e??t.key,/^hs/i.test(t.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new Yin(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Yin(t.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}a(lGe,"SignStream");e3t.inherits(lGe,fwo);lGe.prototype.sign=a(function(){try{var e=Zin({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}},"sign");lGe.sign=Zin;Xin.exports=lGe});var uon=I((Stu,lon)=>{p();var ron=Nce().Buffer,ton=VBt(),hwo=ZBt(),mwo=require("stream"),non=XBt(),gwo=require("util"),Awo=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function ywo(t){return Object.prototype.toString.call(t)==="[object Object]"}a(ywo,"isObject");function Ewo(t){if(ywo(t))return t;try{return JSON.parse(t)}catch{return}}a(Ewo,"safeJsonParse");function ion(t){var e=t.split(".",1)[0];return Ewo(ron.from(e,"base64").toString("binary"))}a(ion,"headerFromJWS");function _wo(t){return t.split(".",2).join(".")}a(_wo,"securedInputFromJWS");function oon(t){return t.split(".")[2]}a(oon,"signatureFromJWS");function vwo(t,e){e=e||"utf8";var r=t.split(".")[1];return ron.from(r,"base64").toString(e)}a(vwo,"payloadFromJWS");function son(t){return Awo.test(t)&&!!ion(t)}a(son,"isValidJws");function aon(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=non(t);var o=oon(t),s=_wo(t),c=hwo(e);return c.verify(s,o,r)}a(aon,"jwsVerify");function con(t,e){if(e=e||{},t=non(t),!son(t))return null;var r=ion(t);if(!r)return null;var n=vwo(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:oon(t)}}a(con,"jwsDecode");function Lce(t){t=t||{};var e=t.secret;if(e=e??t.publicKey,e=e??t.key,/^hs/i.test(t.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new ton(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new ton(t.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}a(Lce,"VerifyStream");gwo.inherits(Lce,mwo);Lce.prototype.verify=a(function(){try{var e=aon(this.signature.buffer,this.algorithm,this.key.buffer),r=con(this.signature.buffer,this.encoding);return this.emit("done",e,r),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}},"verify");Lce.decode=con;Lce.isValid=son;Lce.verify=aon;lon.exports=Lce});var dGe=I(cQ=>{p();var don=eon(),uGe=uon(),Cwo=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];cQ.ALGORITHMS=Cwo;cQ.sign=don.sign;cQ.verify=uGe.verify;cQ.decode=uGe.decode;cQ.isValid=uGe.isValid;cQ.createSign=a(function(e){return new don(e)},"createSign");cQ.createVerify=a(function(e){return new uGe(e)},"createVerify")});var t3t=I((ktu,fon)=>{p();var bwo=dGe();fon.exports=function(t,e){e=e||{};var r=bwo.decode(t,e);if(!r)return null;var n=r.payload;if(typeof n=="string")try{var o=JSON.parse(n);o!==null&&typeof o=="object"&&(n=o)}catch{}return e.complete===!0?{header:r.header,payload:n,signature:r.signature}:n}});var STe=I((Dtu,pon)=>{p();var fGe=a(function(t,e){Error.call(this,t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=t,e&&(this.inner=e)},"JsonWebTokenError");fGe.prototype=Object.create(Error.prototype);fGe.prototype.constructor=fGe;pon.exports=fGe});var r3t=I((Otu,mon)=>{p();var hon=STe(),pGe=a(function(t,e){hon.call(this,t),this.name="NotBeforeError",this.date=e},"NotBeforeError");pGe.prototype=Object.create(hon.prototype);pGe.prototype.constructor=pGe;mon.exports=pGe});var n3t=I((Ftu,Aon)=>{p();var gon=STe(),hGe=a(function(t,e){gon.call(this,t),this.name="TokenExpiredError",this.expiredAt=e},"TokenExpiredError");hGe.prototype=Object.create(gon.prototype);hGe.prototype.constructor=hGe;Aon.exports=hGe});var i3t=I((qtu,yon)=>{p();var Bce=1e3,Fce=Bce*60,Uce=Fce*60,MY=Uce*24,Swo=MY*7,Two=MY*365.25;yon.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Iwo(t);if(r==="number"&&isFinite(t))return e.long?wwo(t):xwo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Iwo(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Two;case"weeks":case"week":case"w":return r*Swo;case"days":case"day":case"d":return r*MY;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Uce;case"minutes":case"minute":case"mins":case"min":case"m":return r*Fce;case"seconds":case"second":case"secs":case"sec":case"s":return r*Bce;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(Iwo,"parse");function xwo(t){var e=Math.abs(t);return e>=MY?Math.round(t/MY)+"d":e>=Uce?Math.round(t/Uce)+"h":e>=Fce?Math.round(t/Fce)+"m":e>=Bce?Math.round(t/Bce)+"s":t+"ms"}a(xwo,"fmtShort");function wwo(t){var e=Math.abs(t);return e>=MY?mGe(t,e,MY,"day"):e>=Uce?mGe(t,e,Uce,"hour"):e>=Fce?mGe(t,e,Fce,"minute"):e>=Bce?mGe(t,e,Bce,"second"):t+" ms"}a(wwo,"fmtLong");function mGe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(mGe,"plural")});var o3t=I((Gtu,Eon)=>{p();var Rwo=i3t();Eon.exports=function(t,e){var r=e||Math.floor(Date.now()/1e3);if(typeof t=="string"){var n=Rwo(t);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof t=="number"?r+t:void 0}});var Qce=I((Vtu,_on)=>{"use strict";p();var kwo="2.0.0",Pwo=Number.MAX_SAFE_INTEGER||9007199254740991,Dwo=16,Nwo=250,Mwo=["major","premajor","minor","preminor","patch","prepatch","prerelease"];_on.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Dwo,MAX_SAFE_BUILD_LENGTH:Nwo,MAX_SAFE_INTEGER:Pwo,RELEASE_TYPES:Mwo,SEMVER_SPEC_VERSION:kwo,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var TTe=I((ztu,von)=>{"use strict";p();var Owo=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};von.exports=Owo});var qce=I((ZM,Con)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:s3t,MAX_SAFE_BUILD_LENGTH:Lwo,MAX_LENGTH:Bwo}=Qce(),Fwo=TTe();ZM=Con.exports={};var Uwo=ZM.re=[],Qwo=ZM.safeRe=[],In=ZM.src=[],qwo=ZM.safeSrc=[],xn=ZM.t={},jwo=0,a3t="[a-zA-Z0-9-]",Hwo=[["\\s",1],["\\d",Bwo],[a3t,Lwo]],Gwo=a(t=>{for(let[e,r]of Hwo)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},"makeSafeRegex"),Uo=a((t,e,r)=>{let n=Gwo(e),o=jwo++;Fwo(t,o,e),xn[t]=o,In[o]=e,qwo[o]=n,Uwo[o]=new RegExp(e,r?"g":void 0),Qwo[o]=new RegExp(n,r?"g":void 0)},"createToken");Uo("NUMERICIDENTIFIER","0|[1-9]\\d*");Uo("NUMERICIDENTIFIERLOOSE","\\d+");Uo("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${a3t}*`);Uo("MAINVERSION",`(${In[xn.NUMERICIDENTIFIER]})\\.(${In[xn.NUMERICIDENTIFIER]})\\.(${In[xn.NUMERICIDENTIFIER]})`);Uo("MAINVERSIONLOOSE",`(${In[xn.NUMERICIDENTIFIERLOOSE]})\\.(${In[xn.NUMERICIDENTIFIERLOOSE]})\\.(${In[xn.NUMERICIDENTIFIERLOOSE]})`);Uo("PRERELEASEIDENTIFIER",`(?:${In[xn.NONNUMERICIDENTIFIER]}|${In[xn.NUMERICIDENTIFIER]})`);Uo("PRERELEASEIDENTIFIERLOOSE",`(?:${In[xn.NONNUMERICIDENTIFIER]}|${In[xn.NUMERICIDENTIFIERLOOSE]})`);Uo("PRERELEASE",`(?:-(${In[xn.PRERELEASEIDENTIFIER]}(?:\\.${In[xn.PRERELEASEIDENTIFIER]})*))`);Uo("PRERELEASELOOSE",`(?:-?(${In[xn.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${In[xn.PRERELEASEIDENTIFIERLOOSE]})*))`);Uo("BUILDIDENTIFIER",`${a3t}+`);Uo("BUILD",`(?:\\+(${In[xn.BUILDIDENTIFIER]}(?:\\.${In[xn.BUILDIDENTIFIER]})*))`);Uo("FULLPLAIN",`v?${In[xn.MAINVERSION]}${In[xn.PRERELEASE]}?${In[xn.BUILD]}?`);Uo("FULL",`^${In[xn.FULLPLAIN]}$`);Uo("LOOSEPLAIN",`[v=\\s]*${In[xn.MAINVERSIONLOOSE]}${In[xn.PRERELEASELOOSE]}?${In[xn.BUILD]}?`);Uo("LOOSE",`^${In[xn.LOOSEPLAIN]}$`);Uo("GTLT","((?:<|>)?=?)");Uo("XRANGEIDENTIFIERLOOSE",`${In[xn.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Uo("XRANGEIDENTIFIER",`${In[xn.NUMERICIDENTIFIER]}|x|X|\\*`);Uo("XRANGEPLAIN",`[v=\\s]*(${In[xn.XRANGEIDENTIFIER]})(?:\\.(${In[xn.XRANGEIDENTIFIER]})(?:\\.(${In[xn.XRANGEIDENTIFIER]})(?:${In[xn.PRERELEASE]})?${In[xn.BUILD]}?)?)?`);Uo("XRANGEPLAINLOOSE",`[v=\\s]*(${In[xn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${In[xn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${In[xn.XRANGEIDENTIFIERLOOSE]})(?:${In[xn.PRERELEASELOOSE]})?${In[xn.BUILD]}?)?)?`);Uo("XRANGE",`^${In[xn.GTLT]}\\s*${In[xn.XRANGEPLAIN]}$`);Uo("XRANGELOOSE",`^${In[xn.GTLT]}\\s*${In[xn.XRANGEPLAINLOOSE]}$`);Uo("COERCEPLAIN",`(^|[^\\d])(\\d{1,${s3t}})(?:\\.(\\d{1,${s3t}}))?(?:\\.(\\d{1,${s3t}}))?`);Uo("COERCE",`${In[xn.COERCEPLAIN]}(?:$|[^\\d])`);Uo("COERCEFULL",In[xn.COERCEPLAIN]+`(?:${In[xn.PRERELEASE]})?(?:${In[xn.BUILD]})?(?:$|[^\\d])`);Uo("COERCERTL",In[xn.COERCE],!0);Uo("COERCERTLFULL",In[xn.COERCEFULL],!0);Uo("LONETILDE","(?:~>?)");Uo("TILDETRIM",`(\\s*)${In[xn.LONETILDE]}\\s+`,!0);ZM.tildeTrimReplace="$1~";Uo("TILDE",`^${In[xn.LONETILDE]}${In[xn.XRANGEPLAIN]}$`);Uo("TILDELOOSE",`^${In[xn.LONETILDE]}${In[xn.XRANGEPLAINLOOSE]}$`);Uo("LONECARET","(?:\\^)");Uo("CARETTRIM",`(\\s*)${In[xn.LONECARET]}\\s+`,!0);ZM.caretTrimReplace="$1^";Uo("CARET",`^${In[xn.LONECARET]}${In[xn.XRANGEPLAIN]}$`);Uo("CARETLOOSE",`^${In[xn.LONECARET]}${In[xn.XRANGEPLAINLOOSE]}$`);Uo("COMPARATORLOOSE",`^${In[xn.GTLT]}\\s*(${In[xn.LOOSEPLAIN]})$|^$`);Uo("COMPARATOR",`^${In[xn.GTLT]}\\s*(${In[xn.FULLPLAIN]})$|^$`);Uo("COMPARATORTRIM",`(\\s*)${In[xn.GTLT]}\\s*(${In[xn.LOOSEPLAIN]}|${In[xn.XRANGEPLAIN]})`,!0);ZM.comparatorTrimReplace="$1$2$3";Uo("HYPHENRANGE",`^\\s*(${In[xn.XRANGEPLAIN]})\\s+-\\s+(${In[xn.XRANGEPLAIN]})\\s*$`);Uo("HYPHENRANGELOOSE",`^\\s*(${In[xn.XRANGEPLAINLOOSE]})\\s+-\\s+(${In[xn.XRANGEPLAINLOOSE]})\\s*$`);Uo("STAR","(<|>)?=?\\s*\\*");Uo("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Uo("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var gGe=I((Ztu,bon)=>{"use strict";p();var $wo=Object.freeze({loose:!0}),Vwo=Object.freeze({}),Wwo=a(t=>t?typeof t!="object"?$wo:t:Vwo,"parseOptions");bon.exports=Wwo});var c3t=I((tru,Ion)=>{"use strict";p();var Son=/^[0-9]+$/,Ton=a((t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:tTon(e,t),"rcompareIdentifiers");Ion.exports={compareIdentifiers:Ton,rcompareIdentifiers:zwo}});var TA=I((iru,won)=>{"use strict";p();var AGe=TTe(),{MAX_LENGTH:xon,MAX_SAFE_INTEGER:yGe}=Qce(),{safeRe:EGe,t:_Ge}=qce(),Ywo=gGe(),{compareIdentifiers:l3t}=c3t(),Kwo=a((t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let n=0;nxon)throw new TypeError(`version is longer than ${xon} characters`);AGe("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?EGe[_Ge.LOOSE]:EGe[_Ge.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>yGe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>yGe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>yGe||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&se.major?1:this.minore.minor?1:this.patche.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],o=e.prerelease[r];if(AGe("prerelease compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return l3t(n,o)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],o=e.build[r];if(AGe("build compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return l3t(n,o)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let o=`-${r}`.match(this.options.loose?EGe[_Ge.PRERELEASELOOSE]:EGe[_Ge.PRERELEASE]);if(!o||o[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(r){let s=[r,o];if(n===!1&&(s=[r]),Kwo(this.prerelease,r)){let c=this.prerelease[r.split(".").length];isNaN(c)&&(this.prerelease=s)}else this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};won.exports=u3t});var lQ=I((aru,kon)=>{"use strict";p();var Ron=TA(),Jwo=a((t,e,r=!1)=>{if(t instanceof Ron)return t;try{return new Ron(t,e)}catch(n){if(!r)return null;throw n}},"parse");kon.exports=Jwo});var Don=I((uru,Pon)=>{"use strict";p();var Zwo=lQ(),Xwo=a((t,e)=>{let r=Zwo(t,e);return r?r.version:null},"valid");Pon.exports=Xwo});var Mon=I((pru,Non)=>{"use strict";p();var eRo=lQ(),tRo=a((t,e)=>{let r=eRo(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},"clean");Non.exports=tRo});var Bon=I((gru,Lon)=>{"use strict";p();var Oon=TA(),rRo=a((t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new Oon(t instanceof Oon?t.version:t,r).inc(e,n,o).version}catch{return null}},"inc");Lon.exports=rRo});var Qon=I((Eru,Uon)=>{"use strict";p();var Fon=lQ(),nRo=a((t,e)=>{let r=Fon(t,null,!0),n=Fon(e,null,!0),o=r.compare(n);if(o===0)return null;let s=o>0,c=s?r:n,l=s?n:r,u=!!c.prerelease.length;if(!!l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(l.compareMain(c)===0)return l.minor&&!l.patch?"minor":"patch"}let f=u?"pre":"";return r.major!==n.major?f+"major":r.minor!==n.minor?f+"minor":r.patch!==n.patch?f+"patch":"prerelease"},"diff");Uon.exports=nRo});var jon=I((Cru,qon)=>{"use strict";p();var iRo=TA(),oRo=a((t,e)=>new iRo(t,e).major,"major");qon.exports=oRo});var Gon=I((Tru,Hon)=>{"use strict";p();var sRo=TA(),aRo=a((t,e)=>new sRo(t,e).minor,"minor");Hon.exports=aRo});var Von=I((wru,$on)=>{"use strict";p();var cRo=TA(),lRo=a((t,e)=>new cRo(t,e).patch,"patch");$on.exports=lRo});var zon=I((Pru,Won)=>{"use strict";p();var uRo=lQ(),dRo=a((t,e)=>{let r=uRo(t,e);return r&&r.prerelease.length?r.prerelease:null},"prerelease");Won.exports=dRo});var Ox=I((Mru,Kon)=>{"use strict";p();var Yon=TA(),fRo=a((t,e,r)=>new Yon(t,r).compare(new Yon(e,r)),"compare");Kon.exports=fRo});var Zon=I((Bru,Jon)=>{"use strict";p();var pRo=Ox(),hRo=a((t,e,r)=>pRo(e,t,r),"rcompare");Jon.exports=hRo});var esn=I((Qru,Xon)=>{"use strict";p();var mRo=Ox(),gRo=a((t,e)=>mRo(t,e,!0),"compareLoose");Xon.exports=gRo});var vGe=I((Hru,rsn)=>{"use strict";p();var tsn=TA(),ARo=a((t,e,r)=>{let n=new tsn(t,r),o=new tsn(e,r);return n.compare(o)||n.compareBuild(o)},"compareBuild");rsn.exports=ARo});var isn=I((Vru,nsn)=>{"use strict";p();var yRo=vGe(),ERo=a((t,e)=>t.sort((r,n)=>yRo(r,n,e)),"sort");nsn.exports=ERo});var ssn=I((Yru,osn)=>{"use strict";p();var _Ro=vGe(),vRo=a((t,e)=>t.sort((r,n)=>_Ro(n,r,e)),"rsort");osn.exports=vRo});var ITe=I((Zru,asn)=>{"use strict";p();var CRo=Ox(),bRo=a((t,e,r)=>CRo(t,e,r)>0,"gt");asn.exports=bRo});var CGe=I((tnu,csn)=>{"use strict";p();var SRo=Ox(),TRo=a((t,e,r)=>SRo(t,e,r)<0,"lt");csn.exports=TRo});var d3t=I((inu,lsn)=>{"use strict";p();var IRo=Ox(),xRo=a((t,e,r)=>IRo(t,e,r)===0,"eq");lsn.exports=xRo});var f3t=I((anu,usn)=>{"use strict";p();var wRo=Ox(),RRo=a((t,e,r)=>wRo(t,e,r)!==0,"neq");usn.exports=RRo});var bGe=I((unu,dsn)=>{"use strict";p();var kRo=Ox(),PRo=a((t,e,r)=>kRo(t,e,r)>=0,"gte");dsn.exports=PRo});var SGe=I((pnu,fsn)=>{"use strict";p();var DRo=Ox(),NRo=a((t,e,r)=>DRo(t,e,r)<=0,"lte");fsn.exports=NRo});var p3t=I((gnu,psn)=>{"use strict";p();var MRo=d3t(),ORo=f3t(),LRo=ITe(),BRo=bGe(),FRo=CGe(),URo=SGe(),QRo=a((t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return MRo(t,r,n);case"!=":return ORo(t,r,n);case">":return LRo(t,r,n);case">=":return BRo(t,r,n);case"<":return FRo(t,r,n);case"<=":return URo(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");psn.exports=QRo});var msn=I((Enu,hsn)=>{"use strict";p();var qRo=TA(),jRo=lQ(),{safeRe:TGe,t:IGe}=qce(),HRo=a((t,e)=>{if(t instanceof qRo)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?TGe[IGe.COERCEFULL]:TGe[IGe.COERCE]);else{let u=e.includePrerelease?TGe[IGe.COERCERTLFULL]:TGe[IGe.COERCERTL],d;for(;(d=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||d.index+d[0].length!==r.index+r[0].length)&&(r=d),u.lastIndex=d.index+d[1].length+d[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],o=r[3]||"0",s=r[4]||"0",c=e.includePrerelease&&r[5]?`-${r[5]}`:"",l=e.includePrerelease&&r[6]?`+${r[6]}`:"";return jRo(`${n}.${o}.${s}${c}${l}`,e)},"coerce");hsn.exports=HRo});var Asn=I((Cnu,gsn)=>{"use strict";p();var GRo=lQ(),$Ro=Qce(),VRo=TA(),WRo=a((t,e,r)=>{if(!$Ro.RELEASE_TYPES.includes(e))return null;let n=zRo(t,r);return n&&YRo(n,e)},"truncate"),zRo=a((t,e)=>{let r=t instanceof VRo?t.version:t;return GRo(r,e)},"cloneInputVersion"),YRo=a((t,e)=>{if(KRo(e))return t.version;switch(t.prerelease=[],e){case"major":t.minor=0,t.patch=0;break;case"minor":t.patch=0;break}return t.format()},"doTruncation"),KRo=a(t=>t.startsWith("pre"),"isPrerelease");gsn.exports=WRo});var Esn=I((Tnu,ysn)=>{"use strict";p();var h3t=class{static{a(this,"LRUCache")}constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(e,r)}return this}};ysn.exports=h3t});var Lx=I((wnu,bsn)=>{"use strict";p();var JRo=/\s+/g,m3t=class t{static{a(this,"Range")}constructor(e,r){if(r=XRo(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof g3t)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(JRo," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(o=>!vsn(o[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&cko(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(ako,"");let n=((this.options.includePrerelease&&oko)|(this.options.loose&&sko))+":"+e,o=_sn.get(n);if(o)return o;let s=this.options.loose,c=s?B_[IA.HYPHENRANGELOOSE]:B_[IA.HYPHENRANGE];e=e.replace(c,Eko(this.options.includePrerelease)),ed("hyphen replace",e),e=e.replace(B_[IA.COMPARATORTRIM],rko),ed("comparator trim",e),e=e.replace(B_[IA.TILDETRIM],nko),ed("tilde trim",e),e=e.replace(B_[IA.CARETTRIM],iko),ed("caret trim",e);let l=e.split(" ").map(h=>lko(h,this.options)).join(" ").split(/\s+/).map(h=>yko(h,this.options));s&&(l=l.filter(h=>(ed("loose invalid filter",h,this.options),!!h.match(B_[IA.COMPARATORLOOSE])))),ed("range list",l);let u=new Map,d=l.map(h=>new g3t(h,this.options));for(let h of d){if(vsn(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let f=[...u.values()];return _sn.set(n,f),f}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>Csn(n,r)&&e.set.some(o=>Csn(o,r)&&n.every(s=>o.every(c=>s.intersects(c,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new eko(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0","isNullSet"),cko=a(t=>t.value==="","isAny"),Csn=a((t,e)=>{let r=!0,n=t.slice(),o=n.pop();for(;r&&n.length;)r=n.every(s=>o.intersects(s,e)),o=n.pop();return r},"isSatisfiable"),lko=a((t,e)=>(t=t.replace(B_[IA.BUILD],""),ed("comp",t,e),t=pko(t,e),ed("caret",t),t=dko(t,e),ed("tildes",t),t=mko(t,e),ed("xrange",t),t=Ako(t,e),ed("stars",t),t),"parseComparator"),c0=a(t=>!t||t.toLowerCase()==="x"||t==="*","isX"),uko=a((t,e,r)=>c0(t)&&!c0(e)||c0(e)&&r&&!c0(r),"invalidXRangeOrder"),dko=a((t,e)=>t.trim().split(/\s+/).map(r=>fko(r,e)).join(" "),"replaceTildes"),fko=a((t,e)=>{let r=e.loose?B_[IA.TILDELOOSE]:B_[IA.TILDE],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{ed("tilde",t,o,s,c,l,u);let d;return c0(s)?d="":c0(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:c0(l)?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:u?(ed("replaceTilde pr",u),d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`):d=`>=${s}.${c}.${l} <${s}.${+c+1}.0-0`,ed("tilde return",d),d})},"replaceTilde"),pko=a((t,e)=>t.trim().split(/\s+/).map(r=>hko(r,e)).join(" "),"replaceCarets"),hko=a((t,e)=>{ed("caret",t,e);let r=e.loose?B_[IA.CARETLOOSE]:B_[IA.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{ed("caret",t,o,s,c,l,u);let d;return c0(s)?d="":c0(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:c0(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?(ed("replaceCaret pr",u),s==="0"?c==="0"?d=`>=${s}.${c}.${l}-${u} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l}-${u} <${+s+1}.0.0-0`):(ed("no pr"),s==="0"?c==="0"?d=`>=${s}.${c}.${l} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l} <${+s+1}.0.0-0`),ed("caret return",d),d})},"replaceCaret"),mko=a((t,e)=>(ed("replaceXRanges",t,e),t.split(/\s+/).map(r=>gko(r,e)).join(" ")),"replaceXRanges"),gko=a((t,e)=>{t=t.trim();let r=e.loose?B_[IA.XRANGELOOSE]:B_[IA.XRANGE];return t.replace(r,(n,o,s,c,l,u)=>{if(ed("xRange",t,n,o,s,c,l,u),uko(s,c,l))return t;let d=c0(s),f=d||c0(c),h=f||c0(l),m=h;return o==="="&&m&&(o=""),u=e.includePrerelease?"-0":"",d?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),o==="<"&&(u="-0"),n=`${o+s}.${c}.${l}${u}`):f?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:h&&(n=`>=${s}.${c}.0${u} <${s}.${+c+1}.0-0`),ed("xRange return",n),n})},"replaceXRange"),Ako=a((t,e)=>(ed("replaceStars",t,e),t.trim().replace(B_[IA.STAR],"")),"replaceStars"),yko=a((t,e)=>(ed("replaceGTE0",t,e),t.trim().replace(B_[e.includePrerelease?IA.GTE0PRE:IA.GTE0],"")),"replaceGTE0"),Eko=a(t=>(e,r,n,o,s,c,l,u,d,f,h,m)=>(c0(n)?r="":c0(o)?r=`>=${n}.0.0${t?"-0":""}`:c0(s)?r=`>=${n}.${o}.0${t?"-0":""}`:c?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,c0(d)?u="":c0(f)?u=`<${+d+1}.0.0-0`:c0(h)?u=`<${d}.${+f+1}.0-0`:m?u=`<=${d}.${f}.${h}-${m}`:t?u=`<${d}.${f}.${+h+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),"hyphenReplace"),_ko=a((t,e,r)=>{for(let n=0;n0){let o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0},"testSet")});var xTe=I((Pnu,Rsn)=>{"use strict";p();var wTe=Symbol("SemVer ANY"),E3t=class t{static{a(this,"Comparator")}static get ANY(){return wTe}constructor(e,r){if(r=Ssn(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),y3t("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===wTe?this.value="":this.value=this.operator+this.semver.version,y3t("comp",this)}parse(e){let r=this.options.loose?Tsn[Isn.COMPARATORLOOSE]:Tsn[Isn.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new xsn(n[2],this.options.loose):this.semver=wTe}toString(){return this.value}test(e){if(y3t("Comparator.test",e,this.options.loose),this.semver===wTe||e===wTe)return!0;if(typeof e=="string")try{e=new xsn(e,this.options)}catch{return!1}return A3t(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new wsn(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new wsn(this.value,r).test(e.semver):(r=Ssn(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||A3t(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||A3t(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Rsn.exports=E3t;var Ssn=gGe(),{safeRe:Tsn,t:Isn}=qce(),A3t=p3t(),y3t=TTe(),xsn=TA(),wsn=Lx()});var RTe=I((Mnu,ksn)=>{"use strict";p();var vko=Lx(),Cko=a((t,e,r)=>{try{e=new vko(e,r)}catch{return!1}return e.test(t)},"satisfies");ksn.exports=Cko});var Dsn=I((Bnu,Psn)=>{"use strict";p();var bko=Lx(),Sko=a((t,e)=>new bko(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" ")),"toComparators");Psn.exports=Sko});var Msn=I((Qnu,Nsn)=>{"use strict";p();var Tko=TA(),Iko=Lx(),xko=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new Iko(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Tko(n,r))}),n},"maxSatisfying");Nsn.exports=xko});var Lsn=I((Hnu,Osn)=>{"use strict";p();var wko=TA(),Rko=Lx(),kko=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new Rko(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new wko(n,r))}),n},"minSatisfying");Osn.exports=kko});var Usn=I((Vnu,Fsn)=>{"use strict";p();var _3t=TA(),Pko=Lx(),Bsn=ITe(),Dko=a((t,e)=>{t=new Pko(t,e);let r=new _3t("0.0.0");if(t.test(r)||(r=new _3t("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{let l=new _3t(c.semver.version);switch(c.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!s||Bsn(l,s))&&(s=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),s&&(!r||Bsn(r,s))&&(r=s)}return r&&t.test(r)?r:null},"minVersion");Fsn.exports=Dko});var qsn=I((Ynu,Qsn)=>{"use strict";p();var Nko=Lx(),Mko=a((t,e)=>{try{return new Nko(t,e).range||"*"}catch{return null}},"validRange");Qsn.exports=Mko});var xGe=I((Znu,$sn)=>{"use strict";p();var Oko=TA(),Gsn=xTe(),{ANY:Lko}=Gsn,Bko=Lx(),Fko=RTe(),jsn=ITe(),Hsn=CGe(),Uko=SGe(),Qko=bGe(),qko=a((t,e,r,n)=>{t=new Oko(t,n),e=new Bko(e,n);let o,s,c,l,u;switch(r){case">":o=jsn,s=Uko,c=Hsn,l=">",u=">=";break;case"<":o=Hsn,s=Qko,c=jsn,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Fko(t,e,n))return!1;for(let d=0;d{g.semver===Lko&&(g=new Gsn(">=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0},"outside");$sn.exports=qko});var Wsn=I((tiu,Vsn)=>{"use strict";p();var jko=xGe(),Hko=a((t,e,r)=>jko(t,e,">",r),"gtr");Vsn.exports=Hko});var Ysn=I((iiu,zsn)=>{"use strict";p();var Gko=xGe(),$ko=a((t,e,r)=>Gko(t,e,"<",r),"ltr");zsn.exports=$ko});var Zsn=I((aiu,Jsn)=>{"use strict";p();var Ksn=Lx(),Vko=a((t,e,r)=>(t=new Ksn(t,r),e=new Ksn(e,r),t.intersects(e,r)),"intersects");Jsn.exports=Vko});var ean=I((uiu,Xsn)=>{"use strict";p();var Wko=RTe(),zko=Ox();Xsn.exports=(t,e,r)=>{let n=[],o=null,s=null,c=t.sort((f,h)=>zko(f,h,r));for(let f of c)Wko(f,e,r)?(s=f,o||(o=f)):(s&&n.push([o,s]),s=null,o=null);o&&n.push([o,null]);let l=[];for(let[f,h]of n)f===h?l.push(f):!h&&f===c[0]?l.push("*"):h?f===c[0]?l.push(`<=${h}`):l.push(`${f} - ${h}`):l.push(`>=${f}`);let u=l.join(" || "),d=typeof e.raw=="string"?e.raw:String(e);return u.length{"use strict";p();var tan=Lx(),b3t=xTe(),{ANY:v3t}=b3t,C3t=RTe(),S3t=Ox(),Yko=a((t,e,r={})=>{if(t===e)return!0;t=new tan(t,r),e=new tan(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let c=Jko(o,s,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},"subset"),Kko=[new b3t(">=0.0.0-0")],ran=[new b3t(">=0.0.0")],Jko=a((t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===v3t){if(e.length===1&&e[0].semver===v3t)return!0;r.includePrerelease?t=Kko:t=ran}if(e.length===1&&e[0].semver===v3t){if(r.includePrerelease)return!0;e=ran}let n=new Set,o,s;for(let g of t)g.operator===">"||g.operator===">="?o=nan(o,g,r):g.operator==="<"||g.operator==="<="?s=ian(s,g,r):n.add(g.semver);if(n.size>1)return null;let c;if(o&&s){if(c=S3t(o.semver,s.semver,r),c>0)return null;if(c===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let g of n){if(o&&!C3t(g,String(o),r)||s&&!C3t(g,String(s),r))return null;for(let A of e)if(!C3t(g,String(A),r))return!1;return!0}let l,u,d,f,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;h&&h.prerelease.length===1&&s.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(let g of e){if(f=f||g.operator===">"||g.operator===">=",d=d||g.operator==="<"||g.operator==="<=",o){if(m&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===m.major&&g.semver.minor===m.minor&&g.semver.patch===m.patch&&(m=!1),g.operator===">"||g.operator===">="){if(l=nan(o,g,r),l===g&&l!==o)return!1}else if(o.operator===">="&&!g.test(o.semver))return!1}if(s){if(h&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===h.major&&g.semver.minor===h.minor&&g.semver.patch===h.patch&&(h=!1),g.operator==="<"||g.operator==="<="){if(u=ian(s,g,r),u===g&&u!==s)return!1}else if(s.operator==="<="&&!g.test(s.semver))return!1}if(!g.operator&&(s||o)&&c!==0)return!1}return!(o&&d&&!s&&c!==0||s&&f&&!o&&c!==0||m||h)},"simpleSubset"),nan=a((t,e,r)=>{if(!t)return e;let n=S3t(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},"higherGT"),ian=a((t,e,r)=>{if(!t)return e;let n=S3t(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t},"lowerLT");oan.exports=Yko});var IP=I((miu,lan)=>{"use strict";p();var T3t=qce(),aan=Qce(),Zko=TA(),can=c3t(),Xko=lQ(),ePo=Don(),tPo=Mon(),rPo=Bon(),nPo=Qon(),iPo=jon(),oPo=Gon(),sPo=Von(),aPo=zon(),cPo=Ox(),lPo=Zon(),uPo=esn(),dPo=vGe(),fPo=isn(),pPo=ssn(),hPo=ITe(),mPo=CGe(),gPo=d3t(),APo=f3t(),yPo=bGe(),EPo=SGe(),_Po=p3t(),vPo=msn(),CPo=Asn(),bPo=xTe(),SPo=Lx(),TPo=RTe(),IPo=Dsn(),xPo=Msn(),wPo=Lsn(),RPo=Usn(),kPo=qsn(),PPo=xGe(),DPo=Wsn(),NPo=Ysn(),MPo=Zsn(),OPo=ean(),LPo=san();lan.exports={parse:Xko,valid:ePo,clean:tPo,inc:rPo,diff:nPo,major:iPo,minor:oPo,patch:sPo,prerelease:aPo,compare:cPo,rcompare:lPo,compareLoose:uPo,compareBuild:dPo,sort:fPo,rsort:pPo,gt:hPo,lt:mPo,eq:gPo,neq:APo,gte:yPo,lte:EPo,cmp:_Po,coerce:vPo,truncate:CPo,Comparator:bPo,Range:SPo,satisfies:TPo,toComparators:IPo,maxSatisfying:xPo,minSatisfying:wPo,minVersion:RPo,validRange:kPo,outside:PPo,gtr:DPo,ltr:NPo,intersects:MPo,simplifyRange:OPo,subset:LPo,SemVer:Zko,re:T3t.re,src:T3t.src,tokens:T3t.t,SEMVER_SPEC_VERSION:aan.SEMVER_SPEC_VERSION,RELEASE_TYPES:aan.RELEASE_TYPES,compareIdentifiers:can.compareIdentifiers,rcompareIdentifiers:can.rcompareIdentifiers}});var dan=I((Aiu,uan)=>{p();var BPo=IP();uan.exports=BPo.satisfies(process.version,">=15.7.0")});var pan=I((Eiu,fan)=>{p();var FPo=IP();fan.exports=FPo.satisfies(process.version,">=16.9.0")});var I3t=I((viu,han)=>{p();var UPo=dan(),QPo=pan(),qPo={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},jPo={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};han.exports=function(t,e){if(!t||!e)return;let r=e.asymmetricKeyType;if(!r)return;let n=qPo[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(t))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(UPo)switch(r){case"ec":let o=e.asymmetricKeyDetails.namedCurve,s=jPo[t];if(o!==s)throw new Error(`"alg" parameter "${t}" requires curve "${s}".`);break;case"rsa-pss":if(QPo){let c=parseInt(t.slice(-3),10),{hashAlgorithm:l,mgf1HashAlgorithm:u,saltLength:d}=e.asymmetricKeyDetails;if(l!==`sha${c}`||u!==l)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${t}.`);if(d!==void 0&&d>c>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${t}.`)}break}}});var x3t=I((biu,man)=>{p();var HPo=IP();man.exports=HPo.satisfies(process.version,"^6.12.0 || >=8.0.0")});var yan=I((Tiu,Aan)=>{p();var hu=STe(),GPo=r3t(),gan=n3t(),$Po=t3t(),VPo=o3t(),WPo=I3t(),zPo=x3t(),YPo=dGe(),{KeyObject:KPo,createSecretKey:JPo,createPublicKey:ZPo}=require("crypto"),w3t=["RS256","RS384","RS512"],XPo=["ES256","ES384","ES512"],R3t=["RS256","RS384","RS512"],e2o=["HS256","HS384","HS512"];zPo&&(w3t.splice(w3t.length,0,"PS256","PS384","PS512"),R3t.splice(R3t.length,0,"PS256","PS384","PS512"));Aan.exports=function(t,e,r,n){typeof r=="function"&&!n&&(n=r,r={}),r||(r={}),r=Object.assign({},r);let o;if(n?o=n:o=a(function(f,h){if(f)throw f;return h},"done"),r.clockTimestamp&&typeof r.clockTimestamp!="number")return o(new hu("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return o(new hu("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return o(new hu("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return o(new hu("jwt must be provided"));if(typeof t!="string")return o(new hu("jwt must be a string"));let c=t.split(".");if(c.length!==3)return o(new hu("jwt malformed"));let l;try{l=$Po(t,{complete:!0})}catch(f){return o(f)}if(!l)return o(new hu("invalid token"));let u=l.header,d;if(typeof e=="function"){if(!n)return o(new hu("verify must be called asynchronous if secret or public key is provided as a callback"));d=e}else d=a(function(f,h){return h(null,e)},"getSecret");return d(u,function(f,h){if(f)return o(new hu("error in secret or public key callback: "+f.message));let m=c[2].trim()!=="";if(!m&&h)return o(new hu("jwt signature is required"));if(m&&!h)return o(new hu("secret or public key must be provided"));if(!m&&!r.algorithms)return o(new hu('please specify "none" in "algorithms" to verify unsigned tokens'));if(h!=null&&!(h instanceof KPo))try{h=ZPo(h)}catch{try{h=JPo(typeof h=="string"?Buffer.from(h):h)}catch{return o(new hu("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(h.type==="secret"?r.algorithms=e2o:["rsa","rsa-pss"].includes(h.asymmetricKeyType)?r.algorithms=R3t:h.asymmetricKeyType==="ec"?r.algorithms=XPo:r.algorithms=w3t),r.algorithms.indexOf(l.header.alg)===-1)return o(new hu("invalid algorithm"));if(u.alg.startsWith("HS")&&h.type!=="secret")return o(new hu(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&h.type!=="public")return o(new hu(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{WPo(u.alg,h)}catch(y){return o(y)}let g;try{g=YPo.verify(t,l.header.alg,h)}catch(y){return o(y)}if(!g)return o(new hu("invalid signature"));let A=l.payload;if(typeof A.nbf<"u"&&!r.ignoreNotBefore){if(typeof A.nbf!="number")return o(new hu("invalid nbf value"));if(A.nbf>s+(r.clockTolerance||0))return o(new GPo("jwt not active",new Date(A.nbf*1e3)))}if(typeof A.exp<"u"&&!r.ignoreExpiration){if(typeof A.exp!="number")return o(new hu("invalid exp value"));if(s>=A.exp+(r.clockTolerance||0))return o(new gan("jwt expired",new Date(A.exp*1e3)))}if(r.audience){let y=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(A.aud)?A.aud:[A.aud]).some(function(v){return y.some(function(b){return b instanceof RegExp?b.test(v):b===v})}))return o(new hu("jwt audience invalid. expected: "+y.join(" or ")))}if(r.issuer&&(typeof r.issuer=="string"&&A.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(A.iss)===-1))return o(new hu("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&A.sub!==r.subject)return o(new hu("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&A.jti!==r.jwtid)return o(new hu("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&A.nonce!==r.nonce)return o(new hu("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof A.iat!="number")return o(new hu("iat required when maxAge is specified"));let y=VPo(r.maxAge,A.iat);if(typeof y>"u")return o(new hu('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(s>=y+(r.clockTolerance||0))return o(new gan("maxAge exceeded",new Date(y*1e3)))}if(r.complete===!0){let y=l.signature;return o(null,{header:u,payload:A,signature:y})}return o(null,A)})}});var San=I((wiu,ban)=>{p();var Ean=1/0,van=9007199254740991,t2o=17976931348623157e292,_an=NaN,r2o="[object Arguments]",n2o="[object Function]",i2o="[object GeneratorFunction]",o2o="[object String]",s2o="[object Symbol]",a2o=/^\s+|\s+$/g,c2o=/^[-+]0x[0-9a-f]+$/i,l2o=/^0b[01]+$/i,u2o=/^0o[0-7]+$/i,d2o=/^(?:0|[1-9]\d*)$/,f2o=parseInt;function p2o(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r-1&&t%1==0&&t-1:!!o&&m2o(t,e,r)>-1}a(x2o,"includes");function w2o(t){return R2o(t)&&P3t.call(t,"callee")&&(!_2o.call(t,"callee")||RGe.call(t)==r2o)}a(w2o,"isArguments");var Can=Array.isArray;function D3t(t){return t!=null&&P2o(t.length)&&!k2o(t)}a(D3t,"isArrayLike");function R2o(t){return N3t(t)&&D3t(t)}a(R2o,"isArrayLikeObject");function k2o(t){var e=k3t(t)?RGe.call(t):"";return e==n2o||e==i2o}a(k2o,"isFunction");function P2o(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=van}a(P2o,"isLength");function k3t(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(k3t,"isObject");function N3t(t){return!!t&&typeof t=="object"}a(N3t,"isObjectLike");function D2o(t){return typeof t=="string"||!Can(t)&&N3t(t)&&RGe.call(t)==o2o}a(D2o,"isString");function N2o(t){return typeof t=="symbol"||N3t(t)&&RGe.call(t)==s2o}a(N2o,"isSymbol");function M2o(t){if(!t)return t===0?t:0;if(t=L2o(t),t===Ean||t===-Ean){var e=t<0?-1:1;return e*t2o}return t===t?t:0}a(M2o,"toFinite");function O2o(t){var e=M2o(t),r=e%1;return e===e?r?e-r:e:0}a(O2o,"toInteger");function L2o(t){if(typeof t=="number")return t;if(N2o(t))return _an;if(k3t(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=k3t(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(a2o,"");var r=l2o.test(t);return r||u2o.test(t)?f2o(t.slice(2),r?2:8):c2o.test(t)?_an:+t}a(L2o,"toNumber");function B2o(t){return D3t(t)?b2o(t):S2o(t)}a(B2o,"keys");function F2o(t){return t?y2o(t,B2o(t)):[]}a(F2o,"values");ban.exports=x2o});var Ian=I((Piu,Tan)=>{p();var U2o="[object Boolean]",Q2o=Object.prototype,q2o=Q2o.toString;function j2o(t){return t===!0||t===!1||H2o(t)&&q2o.call(t)==U2o}a(j2o,"isBoolean");function H2o(t){return!!t&&typeof t=="object"}a(H2o,"isObjectLike");Tan.exports=j2o});var Pan=I((Miu,kan)=>{p();var xan=1/0,G2o=17976931348623157e292,wan=NaN,$2o="[object Symbol]",V2o=/^\s+|\s+$/g,W2o=/^[-+]0x[0-9a-f]+$/i,z2o=/^0b[01]+$/i,Y2o=/^0o[0-7]+$/i,K2o=parseInt,J2o=Object.prototype,Z2o=J2o.toString;function X2o(t){return typeof t=="number"&&t==nDo(t)}a(X2o,"isInteger");function Ran(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(Ran,"isObject");function eDo(t){return!!t&&typeof t=="object"}a(eDo,"isObjectLike");function tDo(t){return typeof t=="symbol"||eDo(t)&&Z2o.call(t)==$2o}a(tDo,"isSymbol");function rDo(t){if(!t)return t===0?t:0;if(t=iDo(t),t===xan||t===-xan){var e=t<0?-1:1;return e*G2o}return t===t?t:0}a(rDo,"toFinite");function nDo(t){var e=rDo(t),r=e%1;return e===e?r?e-r:e:0}a(nDo,"toInteger");function iDo(t){if(typeof t=="number")return t;if(tDo(t))return wan;if(Ran(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ran(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(V2o,"");var r=z2o.test(t);return r||Y2o.test(t)?K2o(t.slice(2),r?2:8):W2o.test(t)?wan:+t}a(iDo,"toNumber");kan.exports=X2o});var Nan=I((Biu,Dan)=>{p();var oDo="[object Number]",sDo=Object.prototype,aDo=sDo.toString;function cDo(t){return!!t&&typeof t=="object"}a(cDo,"isObjectLike");function lDo(t){return typeof t=="number"||cDo(t)&&aDo.call(t)==oDo}a(lDo,"isNumber");Dan.exports=lDo});var Ban=I((Qiu,Lan)=>{p();var uDo="[object Object]";function dDo(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}a(dDo,"isHostObject");function fDo(t,e){return function(r){return t(e(r))}}a(fDo,"overArg");var pDo=Function.prototype,Man=Object.prototype,Oan=pDo.toString,hDo=Man.hasOwnProperty,mDo=Oan.call(Object),gDo=Man.toString,ADo=fDo(Object.getPrototypeOf,Object);function yDo(t){return!!t&&typeof t=="object"}a(yDo,"isObjectLike");function EDo(t){if(!yDo(t)||gDo.call(t)!=uDo||dDo(t))return!1;var e=ADo(t);if(e===null)return!0;var r=hDo.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Oan.call(r)==mDo}a(EDo,"isPlainObject");Lan.exports=EDo});var Uan=I((Hiu,Fan)=>{p();var _Do="[object String]",vDo=Object.prototype,CDo=vDo.toString,bDo=Array.isArray;function SDo(t){return!!t&&typeof t=="object"}a(SDo,"isObjectLike");function TDo(t){return typeof t=="string"||!bDo(t)&&SDo(t)&&CDo.call(t)==_Do}a(TDo,"isString");Fan.exports=TDo});var Gan=I((Viu,Han)=>{p();var IDo="Expected a function",Qan=1/0,xDo=17976931348623157e292,qan=NaN,wDo="[object Symbol]",RDo=/^\s+|\s+$/g,kDo=/^[-+]0x[0-9a-f]+$/i,PDo=/^0b[01]+$/i,DDo=/^0o[0-7]+$/i,NDo=parseInt,MDo=Object.prototype,ODo=MDo.toString;function LDo(t,e){var r;if(typeof e!="function")throw new TypeError(IDo);return t=qDo(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}a(LDo,"before");function BDo(t){return LDo(2,t)}a(BDo,"once");function jan(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(jan,"isObject");function FDo(t){return!!t&&typeof t=="object"}a(FDo,"isObjectLike");function UDo(t){return typeof t=="symbol"||FDo(t)&&ODo.call(t)==wDo}a(UDo,"isSymbol");function QDo(t){if(!t)return t===0?t:0;if(t=jDo(t),t===Qan||t===-Qan){var e=t<0?-1:1;return e*xDo}return t===t?t:0}a(QDo,"toFinite");function qDo(t){var e=QDo(t),r=e%1;return e===e?r?e-r:e:0}a(qDo,"toInteger");function jDo(t){if(typeof t=="number")return t;if(UDo(t))return qan;if(jan(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=jan(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(RDo,"");var r=PDo.test(t);return r||DDo.test(t)?NDo(t.slice(2),r?2:8):kDo.test(t)?qan:+t}a(jDo,"toNumber");Han.exports=BDo});var Xan=I((Yiu,Zan)=>{p();var $an=o3t(),HDo=x3t(),GDo=I3t(),Van=dGe(),$Do=San(),kGe=Ian(),Wan=Pan(),M3t=Nan(),Yan=Ban(),uQ=Uan(),VDo=Gan(),{KeyObject:WDo,createSecretKey:zDo,createPrivateKey:YDo}=require("crypto"),Kan=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];HDo&&Kan.splice(3,0,"PS256","PS384","PS512");var KDo={expiresIn:{isValid:a(function(t){return Wan(t)||uQ(t)&&t},"isValid"),message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:a(function(t){return Wan(t)||uQ(t)&&t},"isValid"),message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:a(function(t){return uQ(t)||Array.isArray(t)},"isValid"),message:'"audience" must be a string or array'},algorithm:{isValid:$Do.bind(null,Kan),message:'"algorithm" must be a valid string enum value'},header:{isValid:Yan,message:'"header" must be an object'},encoding:{isValid:uQ,message:'"encoding" must be a string'},issuer:{isValid:uQ,message:'"issuer" must be a string'},subject:{isValid:uQ,message:'"subject" must be a string'},jwtid:{isValid:uQ,message:'"jwtid" must be a string'},noTimestamp:{isValid:kGe,message:'"noTimestamp" must be a boolean'},keyid:{isValid:uQ,message:'"keyid" must be a string'},mutatePayload:{isValid:kGe,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:kGe,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:kGe,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},JDo={iat:{isValid:M3t,message:'"iat" should be a number of seconds'},exp:{isValid:M3t,message:'"exp" should be a number of seconds'},nbf:{isValid:M3t,message:'"nbf" should be a number of seconds'}};function Jan(t,e,r,n){if(!Yan(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(o){let s=t[o];if(!s){if(!e)throw new Error('"'+o+'" is not allowed in "'+n+'"');return}if(!s.isValid(r[o]))throw new Error(s.message)})}a(Jan,"validate");function ZDo(t){return Jan(KDo,!1,t,"options")}a(ZDo,"validateOptions");function XDo(t){return Jan(JDo,!0,t,"payload")}a(XDo,"validatePayload");var zan={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},eNo=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];Zan.exports=function(t,e,r,n){typeof r=="function"?(n=r,r={}):r=r||{};let o=typeof t=="object"&&!Buffer.isBuffer(t),s=Object.assign({alg:r.algorithm||"HS256",typ:o?"JWT":void 0,kid:r.keyid},r.header);function c(d){if(n)return n(d);throw d}if(a(c,"failure"),!e&&r.algorithm!=="none")return c(new Error("secretOrPrivateKey must have a value"));if(e!=null&&!(e instanceof WDo))try{e=YDo(e)}catch{try{e=zDo(typeof e=="string"?Buffer.from(e):e)}catch{return c(new Error("secretOrPrivateKey is not valid key material"))}}if(s.alg.startsWith("HS")&&e.type!=="secret")return c(new Error(`secretOrPrivateKey must be a symmetric key when using ${s.alg}`));if(/^(?:RS|PS|ES)/.test(s.alg)){if(e.type!=="private")return c(new Error(`secretOrPrivateKey must be an asymmetric key when using ${s.alg}`));if(!r.allowInsecureKeySizes&&!s.alg.startsWith("ES")&&e.asymmetricKeyDetails!==void 0&&e.asymmetricKeyDetails.modulusLength<2048)return c(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`))}if(typeof t>"u")return c(new Error("payload is required"));if(o){try{XDo(t)}catch(d){return c(d)}r.mutatePayload||(t=Object.assign({},t))}else{let d=eNo.filter(function(f){return typeof r[f]<"u"});if(d.length>0)return c(new Error("invalid "+d.join(",")+" option for "+typeof t+" payload"))}if(typeof t.exp<"u"&&typeof r.expiresIn<"u")return c(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof t.nbf<"u"&&typeof r.notBefore<"u")return c(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{ZDo(r)}catch(d){return c(d)}if(!r.allowInvalidAsymmetricKeyTypes)try{GDo(s.alg,e)}catch(d){return c(d)}let l=t.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete t.iat:o&&(t.iat=l),typeof r.notBefore<"u"){try{t.nbf=$an(r.notBefore,l)}catch(d){return c(d)}if(typeof t.nbf>"u")return c(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof t=="object"){try{t.exp=$an(r.expiresIn,l)}catch(d){return c(d)}if(typeof t.exp>"u")return c(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(zan).forEach(function(d){let f=zan[d];if(typeof r[d]<"u"){if(typeof t[f]<"u")return c(new Error('Bad "options.'+d+'" option. The payload already has an "'+f+'" property.'));t[f]=r[d]}});let u=r.encoding||"utf8";if(typeof n=="function")n=n&&VDo(n),Van.createSign({header:s,privateKey:e,payload:t,encoding:u}).once("error",n).once("done",function(d){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&d.length<256)return n(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`));n(null,d)});else{let d=Van.sign({header:s,payload:t,secret:e,encoding:u});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&d.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`);return d}}});var tcn=I((Ziu,ecn)=>{p();ecn.exports={decode:t3t(),verify:yan(),sign:Xan(),JsonWebTokenError:STe(),NotBeforeError:r3t(),TokenExpiredError:n3t()}});var dFt=I((Vfu,tln)=>{p();function rMo(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=o,r.enabled=c,r.humanize=i3t(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let P=r.formatters[x];if(typeof P=="function"){let D=E[T];R=P.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,E),(_.log||r.log).apply(_,E)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(E=>{m=E},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h,m=(typeof f=="string"?f:"").split(/[\s,]+/),g=m.length;for(h=0;h"-"+h)].join(",");return r.enable(""),f}a(s,"disable");function c(f){if(f[f.length-1]==="*")return!0;let h,m;for(h=0,m=r.skips.length;h{p();xS.formatArgs=iMo;xS.save=oMo;xS.load=sMo;xS.useColors=nMo;xS.storage=aMo();xS.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();xS.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function nMo(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(nMo,"useColors");function iMo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+a$e.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(iMo,"formatArgs");xS.log=console.debug||console.log||(()=>{});function oMo(t){try{t?xS.storage.setItem("debug",t):xS.storage.removeItem("debug")}catch{}}a(oMo,"save");function sMo(){let t;try{t=xS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(sMo,"load");function aMo(){try{return localStorage}catch{}}a(aMo,"localstorage");a$e.exports=dFt()(xS);var{formatters:cMo}=a$e.exports;cMo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var iln=I((Jfu,nln)=>{"use strict";p();nln.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),o=e.indexOf("--");return n!==-1&&(o===-1||n{"use strict";p();var lMo=require("os"),oln=require("tty"),Fx=iln(),{env:cg}=process,pQ;Fx("no-color")||Fx("no-colors")||Fx("color=false")||Fx("color=never")?pQ=0:(Fx("color")||Fx("colors")||Fx("color=true")||Fx("color=always"))&&(pQ=1);"FORCE_COLOR"in cg&&(cg.FORCE_COLOR==="true"?pQ=1:cg.FORCE_COLOR==="false"?pQ=0:pQ=cg.FORCE_COLOR.length===0?1:Math.min(parseInt(cg.FORCE_COLOR,10),3));function fFt(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}a(fFt,"translateLevel");function pFt(t,e){if(pQ===0)return 0;if(Fx("color=16m")||Fx("color=full")||Fx("color=truecolor"))return 3;if(Fx("color=256"))return 2;if(t&&!e&&pQ===void 0)return 0;let r=pQ||0;if(cg.TERM==="dumb")return r;if(process.platform==="win32"){let n=lMo.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in cg)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in cg)||cg.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in cg)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(cg.TEAMCITY_VERSION)?1:0;if(cg.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in cg){let n=parseInt((cg.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(cg.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(cg.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(cg.TERM)||"COLORTERM"in cg?1:r}a(pFt,"supportsColor");function uMo(t){let e=pFt(t,t&&t.isTTY);return fFt(e)}a(uMo,"getSupportLevel");sln.exports={supportsColor:uMo,stdout:fFt(pFt(!0,oln.isatty(1))),stderr:fFt(pFt(!0,oln.isatty(2)))}});var cln=I((wA,u$e)=>{p();var dMo=require("tty"),l$e=require("util");wA.init=yMo;wA.log=mMo;wA.formatArgs=pMo;wA.save=gMo;wA.load=AMo;wA.useColors=fMo;wA.destroy=l$e.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");wA.colors=[6,2,3,4,5,1];try{let t=c$e();t&&(t.stderr||t).level>=2&&(wA.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}wA.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function fMo(){return"colors"in wA.inspectOpts?!!wA.inspectOpts.colors:dMo.isatty(process.stderr.fd)}a(fMo,"useColors");function pMo(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` `).join(` -`+s),t.push(o+"m+"+FGe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=sDo()+e+" "+t[0]}a(oDo,"formatArgs");function sDo(){return IA.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(sDo,"getDate");function aDo(...t){return process.stderr.write(BGe.format(...t)+` -`)}a(aDo,"log");function cDo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(cDo,"save");function lDo(){return process.env.DEBUG}a(lDo,"load");function uDo(t){t.inspectOpts={};let e=Object.keys(IA.inspectOpts);for(let r=0;re.trim()).join(" ")};tcn.O=function(t){return this.inspectOpts.colors=this.useColors,BGe.inspect(t,this.inspectOpts)}});var EP=I((Xlu,H3t)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?H3t.exports=Kan():H3t.exports=rcn()});var ocn=I(xC=>{"use strict";p();var dDo=xC&&xC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fDo=xC&&xC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ncn=xC&&xC.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&dDo(e,t,r);return fDo(e,t),e};Object.defineProperty(xC,"__esModule",{value:!0});xC.req=xC.json=xC.toBuffer=void 0;var pDo=ncn(require("http")),hDo=ncn(require("https"));async function icn(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}a(icn,"toBuffer");xC.toBuffer=icn;async function mDo(t){let r=(await icn(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let o=n;throw o.message+=` (input: ${r})`,o}}a(mDo,"json");xC.json=mDo;function gDo(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?hDo:pDo).request(t,e),o=new Promise((s,c)=>{n.once("response",s).once("error",c).end()});return n.then=o.then.bind(o),n}a(gDo,"req");xC.req=gDo});var $3t=I(bS=>{"use strict";p();var acn=bS&&bS.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ADo=bS&&bS.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ccn=bS&&bS.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&acn(e,t,r);return ADo(e,t),e},yDo=bS&&bS.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&acn(e,t,r)};Object.defineProperty(bS,"__esModule",{value:!0});bS.Agent=void 0;var EDo=ccn(require("net")),scn=ccn(require("http")),_Do=require("https");yDo(ocn(),bS);var zM=Symbol("AgentBaseInternalState"),G3t=class extends scn.Agent{static{a(this,"Agent")}constructor(e){super(e),this[zM]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(` -`).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new EDo.Socket({writable:!1});return this.sockets[e].push(r),this.totalSocketCount++,r}decrementSockets(e,r){if(!this.sockets[e]||r===null)return;let n=this.sockets[e],o=n.indexOf(r);o!==-1&&(n.splice(o,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return(typeof e.secureEndpoint=="boolean"?e.secureEndpoint:this.isSecureEndpoint(e))?_Do.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let o={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(o),c=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,o)).then(l=>{if(this.decrementSockets(s,c),l instanceof scn.Agent)return l.addRequest(e,o);this[zM].currentSocket=l,super.createSocket(e,r,n)},l=>{this.decrementSockets(s,c),n(l)})}createConnection(){let e=this[zM].currentSocket;if(this[zM].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[zM].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[zM]&&(this[zM].defaultPort=e)}get protocol(){return this[zM].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[zM]&&(this[zM].protocol=e)}};bS.Agent=G3t});var lcn=I(Wce=>{"use strict";p();var vDo=Wce&&Wce.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wce,"__esModule",{value:!0});Wce.parseProxyResponse=void 0;var CDo=vDo(EP()),UGe=(0,CDo.default)("https-proxy-agent:parse-proxy-response");function bDo(t){return new Promise((e,r)=>{let n=0,o=[];function s(){let f=t.read();f?d(f):t.once("readable",s)}a(s,"read");function c(){t.removeListener("end",l),t.removeListener("error",u),t.removeListener("readable",s)}a(c,"cleanup");function l(){c(),UGe("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}a(l,"onend");function u(f){c(),UGe("onerror %o",f),r(f)}a(u,"onerror");function d(f){o.push(f),n+=f.length;let h=Buffer.concat(o,n),m=h.indexOf(`\r +`+s),t.push(o+"m+"+u$e.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=hMo()+e+" "+t[0]}a(pMo,"formatArgs");function hMo(){return wA.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(hMo,"getDate");function mMo(...t){return process.stderr.write(l$e.format(...t)+` +`)}a(mMo,"log");function gMo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(gMo,"save");function AMo(){return process.env.DEBUG}a(AMo,"load");function yMo(t){t.inspectOpts={};let e=Object.keys(wA.inspectOpts);for(let r=0;re.trim()).join(" ")};aln.O=function(t){return this.inspectOpts.colors=this.useColors,l$e.inspect(t,this.inspectOpts)}});var wP=I((ipu,hFt)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?hFt.exports=rln():hFt.exports=cln()});var dln=I(kC=>{"use strict";p();var EMo=kC&&kC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_Mo=kC&&kC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),lln=kC&&kC.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&EMo(e,t,r);return _Mo(e,t),e};Object.defineProperty(kC,"__esModule",{value:!0});kC.req=kC.json=kC.toBuffer=void 0;var vMo=lln(require("http")),CMo=lln(require("https"));async function uln(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}a(uln,"toBuffer");kC.toBuffer=uln;async function bMo(t){let r=(await uln(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let o=n;throw o.message+=` (input: ${r})`,o}}a(bMo,"json");kC.json=bMo;function SMo(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?CMo:vMo).request(t,e),o=new Promise((s,c)=>{n.once("response",s).once("error",c).end()});return n.then=o.then.bind(o),n}a(SMo,"req");kC.req=SMo});var gFt=I(wS=>{"use strict";p();var pln=wS&&wS.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),TMo=wS&&wS.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),hln=wS&&wS.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&pln(e,t,r);return TMo(e,t),e},IMo=wS&&wS.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pln(e,t,r)};Object.defineProperty(wS,"__esModule",{value:!0});wS.Agent=void 0;var xMo=hln(require("net")),fln=hln(require("http")),wMo=require("https");IMo(dln(),wS);var rO=Symbol("AgentBaseInternalState"),mFt=class extends fln.Agent{static{a(this,"Agent")}constructor(e){super(e),this[rO]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(` +`).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new xMo.Socket({writable:!1});return this.sockets[e].push(r),this.totalSocketCount++,r}decrementSockets(e,r){if(!this.sockets[e]||r===null)return;let n=this.sockets[e],o=n.indexOf(r);o!==-1&&(n.splice(o,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return(typeof e.secureEndpoint=="boolean"?e.secureEndpoint:this.isSecureEndpoint(e))?wMo.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let o={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(o),c=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,o)).then(l=>{if(this.decrementSockets(s,c),l instanceof fln.Agent)return l.addRequest(e,o);this[rO].currentSocket=l,super.createSocket(e,r,n)},l=>{this.decrementSockets(s,c),n(l)})}createConnection(){let e=this[rO].currentSocket;if(this[rO].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[rO].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[rO]&&(this[rO].defaultPort=e)}get protocol(){return this[rO].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[rO]&&(this[rO].protocol=e)}};wS.Agent=mFt});var mln=I(tle=>{"use strict";p();var RMo=tle&&tle.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(tle,"__esModule",{value:!0});tle.parseProxyResponse=void 0;var kMo=RMo(wP()),d$e=(0,kMo.default)("https-proxy-agent:parse-proxy-response");function PMo(t){return new Promise((e,r)=>{let n=0,o=[];function s(){let f=t.read();f?d(f):t.once("readable",s)}a(s,"read");function c(){t.removeListener("end",l),t.removeListener("error",u),t.removeListener("readable",s)}a(c,"cleanup");function l(){c(),d$e("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}a(l,"onend");function u(f){c(),d$e("onerror %o",f),r(f)}a(u,"onerror");function d(f){o.push(f),n+=f.length;let h=Buffer.concat(o,n),m=h.indexOf(`\r \r -`);if(m===-1){UGe("have not received end of HTTP headers yet..."),s();return}let g=h.slice(0,m).toString("ascii").split(`\r -`),A=g.shift();if(!A)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let y=A.split(" "),E=+y[1],_=y.slice(2).join(" "),v={};for(let b of g){if(!b)continue;let T=b.indexOf(":");if(T===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${b}"`));let w=b.slice(0,T).toLowerCase(),R=b.slice(T+1).trimStart(),x=v[w];typeof x=="string"?v[w]=[x,R]:Array.isArray(x)?x.push(R):v[w]=R}UGe("got proxy server response: %o %o",A,v),c(),e({connect:{statusCode:E,statusText:_,headers:v},buffered:h})}a(d,"ondata"),t.on("error",u),t.on("end",l),s()})}a(bDo,"parseProxyResponse");Wce.parseProxyResponse=bDo});var W3t=I(Dx=>{"use strict";p();var SDo=Dx&&Dx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),TDo=Dx&&Dx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fcn=Dx&&Dx.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&SDo(e,t,r);return TDo(e,t),e},pcn=Dx&&Dx.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dx,"__esModule",{value:!0});Dx.HttpsProxyAgent=void 0;var V3t=fcn(require("net")),ucn=fcn(require("tls")),IDo=pcn(require("assert")),xDo=pcn(EP()),wDo=$3t(),RDo=require("url"),kDo=lcn(),CTe=(0,xDo.default)("https-proxy-agent"),QGe=class extends wDo.Agent{static{a(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new RDo.URL(e):e,this.proxyHeaders=r?.headers??{},CTe("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?dcn(r,"headers"):null,host:n,port:o}}async connect(e,r){let{proxy:n}=this;if(!r.host)throw new TypeError('No "host" provided');let o;if(n.protocol==="https:"){CTe("Creating `tls.Socket`: %o",this.connectOpts);let m=this.connectOpts.servername||this.connectOpts.host;o=ucn.connect({...this.connectOpts,servername:m})}else CTe("Creating `net.Socket`: %o",this.connectOpts),o=V3t.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=V3t.isIPv6(r.host)?`[${r.host}]`:r.host,l=`CONNECT ${c}:${r.port} HTTP/1.1\r +`);if(m===-1){d$e("have not received end of HTTP headers yet..."),s();return}let g=h.slice(0,m).toString("ascii").split(`\r +`),A=g.shift();if(!A)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let y=A.split(" "),E=+y[1],_=y.slice(2).join(" "),v={};for(let b of g){if(!b)continue;let T=b.indexOf(":");if(T===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${b}"`));let w=b.slice(0,T).toLowerCase(),R=b.slice(T+1).trimStart(),x=v[w];typeof x=="string"?v[w]=[x,R]:Array.isArray(x)?x.push(R):v[w]=R}d$e("got proxy server response: %o %o",A,v),c(),e({connect:{statusCode:E,statusText:_,headers:v},buffered:h})}a(d,"ondata"),t.on("error",u),t.on("end",l),s()})}a(PMo,"parseProxyResponse");tle.parseProxyResponse=PMo});var yFt=I(Ux=>{"use strict";p();var DMo=Ux&&Ux.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NMo=Ux&&Ux.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),yln=Ux&&Ux.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&DMo(e,t,r);return NMo(e,t),e},Eln=Ux&&Ux.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ux,"__esModule",{value:!0});Ux.HttpsProxyAgent=void 0;var AFt=yln(require("net")),gln=yln(require("tls")),MMo=Eln(require("assert")),OMo=Eln(wP()),LMo=gFt(),BMo=require("url"),FMo=mln(),jTe=(0,OMo.default)("https-proxy-agent"),f$e=class extends LMo.Agent{static{a(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new BMo.URL(e):e,this.proxyHeaders=r?.headers??{},jTe("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?Aln(r,"headers"):null,host:n,port:o}}async connect(e,r){let{proxy:n}=this;if(!r.host)throw new TypeError('No "host" provided');let o;if(n.protocol==="https:"){jTe("Creating `tls.Socket`: %o",this.connectOpts);let m=this.connectOpts.servername||this.connectOpts.host;o=gln.connect({...this.connectOpts,servername:m})}else jTe("Creating `net.Socket`: %o",this.connectOpts),o=AFt.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=AFt.isIPv6(r.host)?`[${r.host}]`:r.host,l=`CONNECT ${c}:${r.port} HTTP/1.1\r `;if(n.username||n.password){let m=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(m).toString("base64")}`}s.Host=`${c}:${r.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let m of Object.keys(s))l+=`${m}: ${s[m]}\r -`;let u=(0,kDo.parseProxyResponse)(o);o.write(`${l}\r -`);let{connect:d,buffered:f}=await u;if(e.emit("proxyConnect",d),this.emit("proxyConnect",d,e),d.statusCode===200){if(e.once("socket",PDo),r.secureEndpoint){CTe("Upgrading socket connection to TLS");let m=r.servername||r.host;return ucn.connect({...dcn(r,"host","path","port"),socket:o,servername:m})}return o}o.destroy();let h=new V3t.Socket({writable:!1});return h.readable=!0,e.once("socket",m=>{CTe("Replaying proxy buffer for failed request"),(0,IDo.default)(m.listenerCount("data")>0),m.push(f),m.push(null)}),h}};QGe.protocols=["http","https"];Dx.HttpsProxyAgent=QGe;function PDo(t){t.resume()}a(PDo,"resume");function dcn(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(dcn,"omit")});var z3t=I(Nx=>{"use strict";p();var DDo=Nx&&Nx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NDo=Nx&&Nx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mcn=Nx&&Nx.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&DDo(e,t,r);return NDo(e,t),e},MDo=Nx&&Nx.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nx,"__esModule",{value:!0});Nx.HttpProxyAgent=void 0;var ODo=mcn(require("net")),LDo=mcn(require("tls")),BDo=MDo(EP()),FDo=require("events"),UDo=$3t(),hcn=require("url"),zce=(0,BDo.default)("http-proxy-agent"),qGe=class extends UDo.Agent{static{a(this,"HttpProxyAgent")}constructor(e,r){super(r),this.proxy=typeof e=="string"?new hcn.URL(e):e,this.proxyHeaders=r?.headers??{},zce("Creating new HttpProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...r?QDo(r,"headers"):null,host:n,port:o}}addRequest(e,r){e._header=null,this.setRequestProps(e,r),super.addRequest(e,r)}setRequestProps(e,r){let{proxy:n}=this,o=r.secureEndpoint?"https:":"http:",s=e.getHeader("host")||"localhost",c=`${o}//${s}`,l=new hcn.URL(e.path,c);r.port!==80&&(l.port=String(r.port)),e.path=String(l);let u=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(n.username||n.password){let d=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;u["Proxy-Authorization"]=`Basic ${Buffer.from(d).toString("base64")}`}u["Proxy-Connection"]||(u["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let d of Object.keys(u)){let f=u[d];f&&e.setHeader(d,f)}}async connect(e,r){e._header=null,e.path.includes("://")||this.setRequestProps(e,r);let n,o;zce("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(zce("Patching connection write() output buffer with updated header"),n=e.outputData[0].data,o=n.indexOf(`\r +`;let u=(0,FMo.parseProxyResponse)(o);o.write(`${l}\r +`);let{connect:d,buffered:f}=await u;if(e.emit("proxyConnect",d),this.emit("proxyConnect",d,e),d.statusCode===200){if(e.once("socket",UMo),r.secureEndpoint){jTe("Upgrading socket connection to TLS");let m=r.servername||r.host;return gln.connect({...Aln(r,"host","path","port"),socket:o,servername:m})}return o}o.destroy();let h=new AFt.Socket({writable:!1});return h.readable=!0,e.once("socket",m=>{jTe("Replaying proxy buffer for failed request"),(0,MMo.default)(m.listenerCount("data")>0),m.push(f),m.push(null)}),h}};f$e.protocols=["http","https"];Ux.HttpsProxyAgent=f$e;function UMo(t){t.resume()}a(UMo,"resume");function Aln(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(Aln,"omit")});var EFt=I(Qx=>{"use strict";p();var QMo=Qx&&Qx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qMo=Qx&&Qx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),vln=Qx&&Qx.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&QMo(e,t,r);return qMo(e,t),e},jMo=Qx&&Qx.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qx,"__esModule",{value:!0});Qx.HttpProxyAgent=void 0;var HMo=vln(require("net")),GMo=vln(require("tls")),$Mo=jMo(wP()),VMo=require("events"),WMo=gFt(),_ln=require("url"),rle=(0,$Mo.default)("http-proxy-agent"),p$e=class extends WMo.Agent{static{a(this,"HttpProxyAgent")}constructor(e,r){super(r),this.proxy=typeof e=="string"?new _ln.URL(e):e,this.proxyHeaders=r?.headers??{},rle("Creating new HttpProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...r?zMo(r,"headers"):null,host:n,port:o}}addRequest(e,r){e._header=null,this.setRequestProps(e,r),super.addRequest(e,r)}setRequestProps(e,r){let{proxy:n}=this,o=r.secureEndpoint?"https:":"http:",s=e.getHeader("host")||"localhost",c=`${o}//${s}`,l=new _ln.URL(e.path,c);r.port!==80&&(l.port=String(r.port)),e.path=String(l);let u=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(n.username||n.password){let d=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;u["Proxy-Authorization"]=`Basic ${Buffer.from(d).toString("base64")}`}u["Proxy-Connection"]||(u["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let d of Object.keys(u)){let f=u[d];f&&e.setHeader(d,f)}}async connect(e,r){e._header=null,e.path.includes("://")||this.setRequestProps(e,r);let n,o;rle("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(rle("Patching connection write() output buffer with updated header"),n=e.outputData[0].data,o=n.indexOf(`\r \r -`)+4,e.outputData[0].data=e._header+n.substring(o),zce("Output buffer: %o",e.outputData[0].data));let s;return this.proxy.protocol==="https:"?(zce("Creating `tls.Socket`: %o",this.connectOpts),s=LDo.connect(this.connectOpts)):(zce("Creating `net.Socket`: %o",this.connectOpts),s=ODo.connect(this.connectOpts)),await(0,FDo.once)(s,"connect"),s}};qGe.protocols=["http","https"];Nx.HttpProxyAgent=qGe;function QDo(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(QDo,"omit")});var iQ={};ki(iQ,{__addDisposableResource:()=>Gcn,__assign:()=>WGe,__asyncDelegator:()=>Bcn,__asyncGenerator:()=>bTe,__asyncValues:()=>KGe,__await:()=>SS,__awaiter:()=>Pcn,__classPrivateFieldGet:()=>qcn,__classPrivateFieldIn:()=>Hcn,__classPrivateFieldSet:()=>jcn,__createBinding:()=>YGe,__decorate:()=>Scn,__disposeResources:()=>$cn,__esDecorate:()=>Icn,__exportStar:()=>Ncn,__extends:()=>Ccn,__generator:()=>Dcn,__importDefault:()=>Qcn,__importStar:()=>Ucn,__makeTemplateObject:()=>Fcn,__metadata:()=>kcn,__param:()=>Tcn,__propKey:()=>wcn,__read:()=>eFt,__rest:()=>bcn,__rewriteRelativeImportExtension:()=>Vcn,__runInitializers:()=>xcn,__setFunctionName:()=>Rcn,__spread:()=>Mcn,__spreadArray:()=>Lcn,__spreadArrays:()=>Ocn,__values:()=>zGe,default:()=>ZDo});function Ccn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Z3t(t,e);function r(){this.constructor=t}a(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function bcn(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}function Tcn(t,e){return function(r,n){e(r,n,t)}}function Icn(t,e,r,n,o,s){function c(_){if(_!==void 0&&typeof _!="function")throw new TypeError("Function expected");return _}a(c,"accept");for(var l=n.kind,u=l==="getter"?"get":l==="setter"?"set":"value",d=!e&&t?n.static?t:t.prototype:null,f=e||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),h,m=!1,g=r.length-1;g>=0;g--){var A={};for(var y in n)A[y]=y==="access"?{}:n[y];for(var y in n.access)A.access[y]=n.access[y];A.addInitializer=function(_){if(m)throw new TypeError("Cannot add initializers after decoration has completed");s.push(c(_||null))};var E=(0,r[g])(l==="accessor"?{get:f.get,set:f.set}:f[u],A);if(l==="accessor"){if(E===void 0)continue;if(E===null||typeof E!="object")throw new TypeError("Object expected");(h=c(E.get))&&(f.get=h),(h=c(E.set))&&(f.set=h),(h=c(E.init))&&o.unshift(h)}else(h=c(E))&&(l==="field"?o.unshift(h):f[u]=h)}d&&Object.defineProperty(d,n.name,f),m=!0}function xcn(t,e,r){for(var n=arguments.length>2,o=0;o0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function eFt(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s}function Mcn(){for(var t=[],e=0;e1||u(g,y)})},A&&(o[g]=A(o[g])))}function u(g,A){try{d(n[g](A))}catch(y){m(s[0][3],y)}}function d(g){g.value instanceof SS?Promise.resolve(g.value.v).then(f,h):m(s[0][2],g)}function f(g){u("next",g)}function h(g){u("throw",g)}function m(g,A){g(A),s.shift(),s.length&&u(s[0][0],s[0][1])}}function Bcn(t){var e,r;return e={},n("next"),n("throw",function(o){throw o}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(o,s){e[o]=t[o]?function(c){return(r=!r)?{value:SS(t[o](c)),done:!1}:s?s(c):c}:s}}function KGe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof zGe=="function"?zGe(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(c){return new Promise(function(l,u){c=t[s](c),o(l,u,c.done,c.value)})}}function o(s,c,l,u){Promise.resolve(u).then(function(d){s({value:d,done:l})},c)}}function Fcn(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Ucn(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=X3t(t),n=0;n{p();Z3t=a(function(t,e){return Z3t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},Z3t(t,e)},"extendStatics");a(Ccn,"__extends");WGe=a(function(){return WGe=Object.assign||a(function(e){for(var r,n=1,o=arguments.length;n{"use strict";p();Object.defineProperty(a$e,"__esModule",{value:!0});a$e.state=void 0;a$e.state={operationRequestMap:new WeakMap}});function XNo(){try{return xFt.default.statSync("/.dockerenv"),!0}catch{return!1}}function eMo(){try{return xFt.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function wFt(){return IFt===void 0&&(IFt=XNo()||eMo()),IFt}var xFt,IFt,Tln=ve(()=>{p();xFt=de(require("node:fs"),1);a(XNo,"hasDockerEnv");a(eMo,"hasDockerCGroup");a(wFt,"isDocker")});function Zce(){return RFt===void 0&&(RFt=tMo()||wFt()),RFt}var Iln,RFt,tMo,kFt=ve(()=>{p();Iln=de(require("node:fs"),1);Tln();tMo=a(()=>{try{return Iln.default.statSync("/run/.containerenv"),!0}catch{return!1}},"hasContainerEnv");a(Zce,"isInsideContainer")});var PFt,wln,Rln,xln,cQ,DFt=ve(()=>{p();PFt=de(require("node:process"),1),wln=de(require("node:os"),1),Rln=de(require("node:fs"),1);kFt();xln=a(()=>{if(PFt.default.platform!=="linux")return!1;if(wln.default.release().toLowerCase().includes("microsoft"))return!Zce();try{return Rln.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Zce():!1}catch{return!1}},"isWsl"),cQ=PFt.default.env.__IS_WSL_TEST__?xln:xln()});var NFt,RTe,rMo,nMo,MFt,kln=ve(()=>{p();NFt=de(require("node:process"),1),RTe=de(require("node:fs/promises"),1);DFt();DFt();rMo=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await RTe.default.access(r,RTe.constants.F_OK),n=!0}catch{}if(!n)return t;let o=await RTe.default.readFile(r,{encoding:"utf8"}),s=/(?.*)/g.exec(o);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),nMo=a(async()=>`${await rMo()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,"powerShellPathFromWsl"),MFt=a(async()=>cQ?nMo():`${NFt.default.env.SYSTEMROOT||NFt.default.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,"powerShellPath")});function lQ(t,e,r){let n=a(o=>Object.defineProperty(t,e,{value:o,enumerable:!0,writable:!0}),"define");return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let o=r();return n(o),o},set(o){n(o)}}),t}var Pln=ve(()=>{p();a(lQ,"defineLazyProperty")});async function OFt(){if(Nln.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await iMo("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var Dln,Nln,Mln,iMo,Oln=ve(()=>{p();Dln=require("node:util"),Nln=de(require("node:process"),1),Mln=require("node:child_process"),iMo=(0,Dln.promisify)(Mln.execFile);a(OFt,"defaultBrowserId")});async function Fln(t,{humanReadableOutput:e=!0}={}){if(Lln.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await oMo("osascript",["-e",t,r]);return n.trim()}var Lln,Bln,LFt,oMo,Uln=ve(()=>{p();Lln=de(require("node:process"),1),Bln=require("node:util"),LFt=require("node:child_process"),oMo=(0,Bln.promisify)(LFt.execFile);a(Fln,"runAppleScript")});async function BFt(t){return Fln(`tell application "Finder" to set app_path to application file id "${t}" as string -tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var Qln=ve(()=>{p();Uln();a(BFt,"bundleName")});async function FFt(t=sMo){let{stdout:e}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?\S+)/.exec(e);if(!r)throw new l$e(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,o=aMo[n];if(!o)throw new l$e(`Unknown browser ID: ${n}`);return o}var qln,jln,sMo,aMo,l$e,Hln=ve(()=>{p();qln=require("node:util"),jln=require("node:child_process"),sMo=(0,qln.promisify)(jln.execFile),aMo={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"}},l$e=class extends Error{static{a(this,"UnknownBrowserError")}};a(FFt,"defaultBrowser")});async function UFt(){if(u$e.default.platform==="darwin"){let t=await OFt();return{name:await BFt(t),id:t}}if(u$e.default.platform==="linux"){let{stdout:t}=await cMo("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:lMo(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(u$e.default.platform==="win32")return FFt();throw new Error("Only macOS, Linux, and Windows are supported")}var Gln,u$e,$ln,cMo,lMo,Vln=ve(()=>{p();Gln=require("node:util"),u$e=de(require("node:process"),1),$ln=require("node:child_process");Oln();Qln();Hln();cMo=(0,Gln.promisify)($ln.execFile),lMo=a(t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),"titleize");a(UFt,"defaultBrowser")});var Xln={};ki(Xln,{apps:()=>uQ,default:()=>PTe,openApp:()=>pMo});async function dMo(){let t=await MFt(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=jFt.Buffer.from(e,"utf16le").toString("base64"),{stdout:n}=await uMo(t,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",r],{encoding:"utf8"}),o=n.trim(),s={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return s[o]?{id:s[o]}:{}}function Kln(t){if(typeof t=="string"||Array.isArray(t))return t;let{[zln]:e}=t;if(!e)throw new Error(`${zln} is not supported`);return e}function f$e({[Xce]:t},{wsl:e}){if(e&&cQ)return Kln(e);if(!t)throw new Error(`${Xce} is not supported`);return Kln(t)}var qFt,jFt,HFt,Jln,Zln,GFt,d$e,uMo,QFt,Wln,Xce,zln,Yln,kTe,fMo,pMo,uQ,PTe,p$e=ve(()=>{p();qFt=de(require("node:process"),1),jFt=require("node:buffer"),HFt=de(require("node:path"),1),Jln=require("node:url"),Zln=require("node:util"),GFt=de(require("node:child_process"),1),d$e=de(require("node:fs/promises"),1);kln();Pln();Vln();kFt();uMo=(0,Zln.promisify)(GFt.default.execFile),QFt=HFt.default.dirname((0,Jln.fileURLToPath)(importMetaUrlShim)),Wln=HFt.default.join(QFt,"xdg-open"),{platform:Xce,arch:zln}=qFt.default;a(dMo,"getWindowsDefaultBrowserFromWsl");Yln=a(async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(o){r=o}throw r},"pTryEach"),kTe=a(async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return Yln(t.app,l=>kTe({...t,app:l}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return Yln(e,l=>kTe({...t,app:{name:l,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let l={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},d=cQ?await dMo():await UFt();if(d.id in l){let f=l[d.id];return e==="browserPrivate"&&r.push(u[f]),kTe({...t,app:{name:uQ[f],arguments:r}})}throw new Error(`${d.name} is not supported as a default browser`)}let n,o=[],s={};if(Xce==="darwin")n="open",t.wait&&o.push("--wait-apps"),t.background&&o.push("--background"),t.newInstance&&o.push("--new"),e&&o.push("-a",e);else if(Xce==="win32"||cQ&&!Zce()&&!e){n=await MFt(),o.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),cQ||(s.windowsVerbatimArguments=!0);let l=["Start"];t.wait&&l.push("-Wait"),e?(l.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&l.push(`"${t.target}"`),r.length>0&&(r=r.map(u=>`"\`"${u}\`""`),l.push("-ArgumentList",r.join(","))),t.target=jFt.Buffer.from(l.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let l=!QFt||QFt==="/",u=!1;try{await d$e.default.access(Wln,d$e.constants.X_OK),u=!0}catch{}n=qFt.default.versions.electron??(Xce==="android"||l||!u)?"xdg-open":Wln}r.length>0&&o.push(...r),t.wait||(s.stdio="ignore",s.detached=!0)}Xce==="darwin"&&r.length>0&&o.push("--args",...r),t.target&&o.push(t.target);let c=GFt.default.spawn(n,o,s);return t.wait?new Promise((l,u)=>{c.once("error",u),c.once("close",d=>{if(!t.allowNonzeroExitCode&&d>0){u(new Error(`Exited with code ${d}`));return}l(c)})}):(c.unref(),c)},"baseOpen"),fMo=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return kTe({...e,target:t})},"open"),pMo=a((t,e)=>{if(typeof t!="string"&&!Array.isArray(t))throw new TypeError("Expected a valid `name`");let{arguments:r=[]}=e??{};if(r!=null&&!Array.isArray(r))throw new TypeError("Expected `appArguments` as Array type");return kTe({...e,app:{name:t,arguments:r}})},"openApp");a(Kln,"detectArchBinary");a(f$e,"detectPlatformBinary");uQ={};lQ(uQ,"chrome",()=>f$e({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));lQ(uQ,"brave",()=>f$e({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));lQ(uQ,"firefox",()=>f$e({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));lQ(uQ,"edge",()=>f$e({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));lQ(uQ,"browser",()=>"browser");lQ(uQ,"browserPrivate",()=>"browserPrivate");PTe=fMo});var h8t=I((dxu,sdn)=>{"use strict";p();sdn.exports=a(function(e,r){r===!0&&(r=0);var n="";if(typeof e=="string")try{n=new URL(e).protocol}catch{}else e&&e.constructor===URL&&(n=e.protocol);var o=n.split(/\:|\+/).filter(Boolean);return typeof r=="number"?o[r]:o},"protocols")});var cdn=I((hxu,adn)=>{"use strict";p();var v4o=h8t();function C4o(t){var e={protocols:[],protocol:null,port:null,resource:"",host:"",user:"",password:"",pathname:"",hash:"",search:"",href:t,query:{},parse_failed:!1};try{var r=new URL(t);e.protocols=v4o(r),e.protocol=e.protocols[0],e.port=r.port,e.resource=r.hostname,e.host=r.host,e.user=r.username||"",e.password=r.password||"",e.pathname=r.pathname,e.hash=r.hash.slice(1),e.search=r.search.slice(1),e.href=r.href,e.query=Object.fromEntries(r.searchParams)}catch{e.protocols=["file"],e.protocol=e.protocols[0],e.port="",e.resource="",e.user="",e.pathname="",e.hash="",e.search="",e.href=t,e.query={},e.parse_failed=!0}return e}a(C4o,"parsePath");adn.exports=C4o});var hdn=I((Axu,pdn)=>{"use strict";p();var b4o=cdn();function S4o(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}a(S4o,"_interopDefaultLegacy");var T4o=S4o(b4o);function I4o(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=a(function n(){if(this instanceof n){var o=[null];o.push.apply(o,arguments);var s=Function.bind.apply(e,o);return new s}return e.apply(this,arguments)},"a");r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:a(function(){return t[n]},"get")})}),r}a(I4o,"getAugmentedNamespace");var udn={},x4o="text/plain",w4o="us-ascii",ldn=a((t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),"testParameter"),R4o=a((t,{stripHash:e})=>{let r=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(t);if(!r)throw new Error(`Invalid URL: ${t}`);let{type:n,data:o,hash:s}=r.groups,c=n.split(";");s=e?"":s;let l=!1;c[c.length-1]==="base64"&&(c.pop(),l=!0);let u=(c.shift()||"").toLowerCase(),f=[...c.map(h=>{let[m,g=""]=h.split("=").map(A=>A.trim());return m==="charset"&&(g=g.toLowerCase(),g===w4o)?"":`${m}${g?`=${g}`:""}`}).filter(Boolean)];return l&&f.push("base64"),(f.length>0||u&&u!==x4o)&&f.unshift(u),`data:${f.join(";")},${l?o.trim():o}${s?`#${s}`:""}`},"normalizeDataURL");function k4o(t,e){if(e={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},t=t.trim(),/^data:/i.test(t))return R4o(t,e);if(/^view-source:/i.test(t))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let o=new URL(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&o.protocol==="https:"&&(o.protocol="http:"),e.forceHttps&&o.protocol==="http:"&&(o.protocol="https:"),e.stripAuthentication&&(o.username="",o.password=""),e.stripHash?o.hash="":e.stripTextFragment&&(o.hash=o.hash.replace(/#?:~:text.*?$/i,"")),o.pathname){let c=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,l=0,u="";for(;;){let f=c.exec(o.pathname);if(!f)break;let h=f[0],m=f.index,g=o.pathname.slice(l,m);u+=g.replace(/\/{2,}/g,"/"),u+=h,l=m+h.length}let d=o.pathname.slice(l,o.pathname.length);u+=d.replace(/\/{2,}/g,"/"),o.pathname=u}if(o.pathname)try{o.pathname=decodeURI(o.pathname)}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let c=o.pathname.split("/"),l=c[c.length-1];ldn(l,e.removeDirectoryIndex)&&(c=c.slice(0,-1),o.pathname=c.slice(1).join("/")+"/")}if(o.hostname&&(o.hostname=o.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(o.hostname)&&(o.hostname=o.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let c of[...o.searchParams.keys()])ldn(c,e.removeQueryParameters)&&o.searchParams.delete(c);if(e.removeQueryParameters===!0&&(o.search=""),e.sortQueryParameters){o.searchParams.sort();try{o.search=decodeURIComponent(o.search)}catch{}}e.removeTrailingSlash&&(o.pathname=o.pathname.replace(/\/$/,""));let s=t;return t=o.toString(),!e.removeSingleSlash&&o.pathname==="/"&&!s.endsWith("/")&&o.hash===""&&(t=t.replace(/\/$/,"")),(e.removeTrailingSlash||o.pathname==="/")&&o.hash===""&&e.removeSingleSlash&&(t=t.replace(/\/$/,"")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t}a(k4o,"normalizeUrl");var P4o=Object.freeze({__proto__:null,default:k4o}),D4o=I4o(P4o);Object.defineProperty(udn,"__esModule",{value:!0});var N4o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M4o=D4o,O4o=ddn(M4o),L4o=T4o.default,B4o=ddn(L4o);function ddn(t){return t&&t.__esModule?t:{default:t}}a(ddn,"_interopRequireDefault");var fdn=a(function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=/^(?:([a-zA-Z_][a-zA-Z0-9_-]{0,31})@|https?:\/\/)([\w\.\-@]+)[\/:](([\~,\.\w,\-,\_,\/,\s]|%[0-9A-Fa-f]{2})+?(?:\.git|\/)?)$/,o=a(function(u){var d=new Error(u);throw d.subject_url=e,d},"throwErr");(typeof e!="string"||!e.trim())&&o("Invalid url."),e.length>t.MAX_INPUT_LENGTH&&o("Input exceeds maximum length. If needed, change the value of parseUrl.MAX_INPUT_LENGTH."),r&&((typeof r>"u"?"undefined":N4o(r))!=="object"&&(r={stripHash:!1}),e=(0,O4o.default)(e,r));var s=(0,B4o.default)(e);if(s.parse_failed){var c=s.href.match(n);c?(s.protocols=["ssh"],s.protocol="ssh",s.resource=c[2],s.host=c[2],s.user=c[1],s.pathname="/"+c[3],s.parse_failed=!1):o("URL parsing failed.")}return s},"parseUrl");fdn.MAX_INPUT_LENGTH=2048;var F4o=udn.default=fdn;pdn.exports=F4o});var Adn=I((_xu,gdn)=>{"use strict";p();var U4o=h8t();function mdn(t){if(Array.isArray(t))return t.indexOf("ssh")!==-1||t.indexOf("rsync")!==-1;if(typeof t!="string")return!1;var e=U4o(t);if(t=t.substring(t.indexOf("://")+3),mdn(e))return!0;var r=new RegExp(".([a-zA-Z\\d]+):(\\d+)/");return!t.match(r)&&t.indexOf("@"){"use strict";p();var Q4o=hdn(),ydn=Adn();function q4o(t){let e=Q4o(t);return e.token="",e.password==="x-oauth-basic"?e.token=e.user:e.user==="x-token-auth"&&(e.token=e.password),ydn(e.protocols)||e.protocols.length===0&&ydn(t)?e.protocol="ssh":e.protocols.length?e.protocol=e.protocols[0]:(e.protocol="file",e.protocols=["file"]),e.href=e.href.replace(/\/$/,""),e}a(q4o,"gitUp");Edn.exports=q4o});var Cdn=I((Ixu,vdn)=>{"use strict";p();var j4o=_dn();function m8t(t,e){if(e=e||[],typeof t!="string")throw new Error("The url must be a string.");if(!e.every(function(v){return typeof v=="string"}))throw new Error("The refs should contain only strings");var r=/^([a-z\d-]{1,39})\/([-\.\w]{1,100})$/i;r.test(t)&&(t="https://github.com/"+t);var n=j4o(t),o=n.resource.split("."),s=null;switch(n.toString=function(v){return m8t.stringify(this,v)},n.source=o.length>2?o.slice(1-o.length).join("."):n.source=n.resource,n.git_suffix=/\.git$/.test(n.pathname),n.name=decodeURIComponent((n.pathname||n.href).replace(/(^\/)|(\/$)/g,"").replace(/\.git$/,"")),n.owner=decodeURIComponent(n.user),n.source){case"git.cloudforge.com":n.owner=n.user,n.organization=o[0],n.source="cloudforge.com";break;case"visualstudio.com":if(n.resource==="vs-ssh.visualstudio.com"){s=n.name.split("/"),s.length===4&&(n.organization=s[1],n.owner=s[2],n.name=s[3],n.full_name=s[2]+"/"+s[3]);break}else{s=n.name.split("/"),s.length===2?(n.owner=s[1],n.name=s[1],n.full_name="_git/"+n.name):s.length===3?(n.name=s[2],s[0]==="DefaultCollection"?(n.owner=s[2],n.organization=s[0],n.full_name=n.organization+"/_git/"+n.name):(n.owner=s[0],n.full_name=n.owner+"/_git/"+n.name)):s.length===4&&(n.organization=s[0],n.owner=s[1],n.name=s[3],n.full_name=n.organization+"/"+n.owner+"/_git/"+n.name);break}case"dev.azure.com":case"azure.com":if(n.resource==="ssh.dev.azure.com"){s=n.name.split("/"),s.length===4&&(n.organization=s[1],n.owner=s[2],n.name=s[3]);break}else{s=n.name.split("/"),s.length===5?(n.organization=s[0],n.owner=s[1],n.name=s[4],n.full_name="_git/"+n.name):s.length===3?(n.name=s[2],s[0]==="DefaultCollection"?(n.owner=s[2],n.organization=s[0],n.full_name=n.organization+"/_git/"+n.name):(n.owner=s[0],n.full_name=n.owner+"/_git/"+n.name)):s.length===4&&(n.organization=s[0],n.owner=s[1],n.name=s[3],n.full_name=n.organization+"/"+n.owner+"/_git/"+n.name),n.query&&n.query.path&&(n.filepath=n.query.path.replace(/^\/+/g,"")),n.query&&n.query.version&&(n.ref=n.query.version.replace(/^GB/,""));break}default:s=n.name.split("/");var c=s.length-1;if(s.length>=2){var l=s.indexOf("-",2),u=s.indexOf("blob",2),d=s.indexOf("tree",2),f=s.indexOf("commit",2),h=s.indexOf("issues",2),m=s.indexOf("src",2),g=s.indexOf("raw",2),A=s.indexOf("edit",2);c=l>0?l-1:u>0&&d>0?Math.min(u-1,d-1):u>0?u-1:h>0?h-1:d>0?d-1:f>0?f-1:m>0?m-1:g>0?g-1:A>0?A-1:c,n.owner=s.slice(0,c).join("/"),n.name=s[c],f&&h<0&&(n.commit=s[c+2])}n.ref="",n.filepathtype="",n.filepath="";var y=s.length>c&&s[c+1]==="-"?c+1:c;s.length>y+2&&["raw","src","blob","tree","edit"].indexOf(s[y+1])>=0&&(n.filepathtype=s[y+1],n.ref=s[y+2],s.length>y+3&&(n.filepath=s.slice(y+3).join("/"))),n.organization=n.owner;break}n.full_name||(n.full_name=n.owner,n.name&&(n.full_name&&(n.full_name+="/"),n.full_name+=n.name)),n.owner.startsWith("scm/")&&(n.source="bitbucket-server",n.owner=n.owner.replace("scm/",""),n.organization=n.owner,n.full_name=n.owner+"/"+n.name);var E=/(projects|users)\/(.*?)\/repos\/(.*?)((\/.*$)|$)/,_=E.exec(n.pathname);return _!=null&&(n.source="bitbucket-server",_[1]==="users"?n.owner="~"+_[2]:n.owner=_[2],n.organization=n.owner,n.name=_[3],s=_[4].split("/"),s.length>1&&(["raw","browse"].indexOf(s[1])>=0?(n.filepathtype=s[1],s.length>2&&(n.filepath=s.slice(2).join("/"))):s[1]==="commits"&&s.length>2&&(n.commit=s[2])),n.full_name=n.owner+"/"+n.name,n.query.at?n.ref=n.query.at:n.ref=""),e.length!==0&&n.ref&&(n.ref=$4o(n.href,e)||n.ref,n.filepath=n.href.split(n.ref+"/")[1]),n}a(m8t,"gitUrlParse");m8t.stringify=function(t,e){e=e||(t.protocols&&t.protocols.length?t.protocols.join("+"):t.protocol);var r=t.port?":"+t.port:"",n=t.user||"git",o=t.git_suffix?".git":"";switch(e){case"ssh":return r?"ssh://"+n+"@"+t.resource+r+"/"+t.full_name+o:n+"@"+t.resource+":"+t.full_name+o;case"git+ssh":case"ssh+git":case"ftp":case"ftps":return e+"://"+n+"@"+t.resource+r+"/"+t.full_name+o;case"http":case"https":var s=t.token?H4o(t):t.user&&(t.protocols.includes("http")||t.protocols.includes("https"))?t.user+"@":"";return e+"://"+s+t.resource+r+"/"+G4o(t)+o;default:return t.href}};function H4o(t){return t.source==="bitbucket.org"?"x-token-auth:"+t.token+"@":t.token+"@"}a(H4o,"buildToken");function G4o(t){if(t.source==="bitbucket-server")return"scm/"+t.full_name;var e=t.full_name.split("/").map(function(r){return encodeURIComponent(r)}).join("/");return e}a(G4o,"buildPath");function $4o(t,e){var r="";return e.forEach(function(n){t.includes(n)&&n.length>r.length&&(r=n)}),r}a($4o,"findLongestMatchingSubstring");vdn.exports=m8t});var ale=I((exports,module)=>{p();var Module=typeof Module<"u"?Module:{},ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",TreeSitter=(function(){var initPromise,document=typeof window=="object"?{currentScript:window.document.currentScript}:null;class Parser{static{a(this,"Parser")}constructor(){this.initialize()}initialize(){throw new Error("cannot construct a Parser before calling `init()`")}static init(moduleOptions){return initPromise||(Module=Object.assign({},Module,moduleOptions),initPromise=new Promise(resolveInitPromise=>{var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=a((t,e)=>{throw e},"quit_"),scriptDirectory="";function locateFile(t){return Module.locateFile?Module.locateFile(t,scriptDirectory):scriptDirectory+t}a(locateFile,"locateFile");var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs"),nodePath=require("path");scriptDirectory=__dirname+"/",readBinary=a(t=>{t=isFileURI(t)?new URL(t):nodePath.normalize(t);var e=fs.readFileSync(t);return e},"readBinary"),readAsync=a((t,e=!0)=>(t=isFileURI(t)?new URL(t):nodePath.normalize(t),new Promise((r,n)=>{fs.readFile(t,e?void 0:"utf8",(o,s)=>{o?n(o):r(e?s.buffer:s)})})),"readAsync"),!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),typeof module<"u"&&(module.exports=Module),quit_=a((t,e)=>{throw process.exitCode=t,e},"quit_")}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:typeof document<"u"&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory.startsWith("blob:")?scriptDirectory="":scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),ENVIRONMENT_IS_WORKER&&(readBinary=a(t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)},"readBinary")),readAsync=a(t=>isFileURI(t)?new Promise((e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{(n.status==200||n.status==0&&n.response)&&r(n.response),e(n.status)},n.onerror=e,n.send(null)}):fetch(t,{credentials:"same-origin"}).then(e=>e.ok?e.arrayBuffer():Promise.reject(new Error(e.status+" : "+e.url))),"readAsync"));var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary;Module.wasmBinary&&(wasmBinary=Module.wasmBinary);var wasmMemory,ABORT=!1,EXITSTATUS,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP_DATA_VIEW;function updateMemoryViews(){var t=wasmMemory.buffer;Module.HEAP_DATA_VIEW=HEAP_DATA_VIEW=new DataView(t),Module.HEAP8=HEAP8=new Int8Array(t),Module.HEAP16=HEAP16=new Int16Array(t),Module.HEAPU8=HEAPU8=new Uint8Array(t),Module.HEAPU16=HEAPU16=new Uint16Array(t),Module.HEAP32=HEAP32=new Int32Array(t),Module.HEAPU32=HEAPU32=new Uint32Array(t),Module.HEAPF32=HEAPF32=new Float32Array(t),Module.HEAPF64=HEAPF64=new Float64Array(t)}if(a(updateMemoryViews,"updateMemoryViews"),Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:2147483648/65536})}updateMemoryViews();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}a(preRun,"preRun");function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),callRuntimeCallbacks(__ATINIT__)}a(initRuntime,"initRuntime");function preMain(){callRuntimeCallbacks(__ATMAIN__)}a(preMain,"preMain");function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}a(postRun,"postRun");function addOnPreRun(t){__ATPRERUN__.unshift(t)}a(addOnPreRun,"addOnPreRun");function addOnInit(t){__ATINIT__.unshift(t)}a(addOnInit,"addOnInit");function addOnPostRun(t){__ATPOSTRUN__.unshift(t)}a(addOnPostRun,"addOnPostRun");var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(t){return t}a(getUniqueRunDependency,"getUniqueRunDependency");function addRunDependency(t){runDependencies++,Module.monitorRunDependencies?.(runDependencies)}a(addRunDependency,"addRunDependency");function removeRunDependency(t){if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var e=dependenciesFulfilled;dependenciesFulfilled=null,e()}}a(removeRunDependency,"removeRunDependency");function abort(t){Module.onAbort?.(t),t="Aborted("+t+")",err(t),ABORT=!0,EXITSTATUS=1,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw e}a(abort,"abort");var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=a(t=>t.startsWith(dataURIPrefix),"isDataURI"),isFileURI=a(t=>t.startsWith("file://"),"isFileURI");function findWasmBinary(){var t="tree-sitter.wasm";return isDataURI(t)?t:locateFile(t)}a(findWasmBinary,"findWasmBinary");var wasmBinaryFile;function getBinarySync(t){if(t==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(t);throw"both async and sync fetching of the wasm failed"}a(getBinarySync,"getBinarySync");function getBinaryPromise(t){return wasmBinary?Promise.resolve().then(()=>getBinarySync(t)):readAsync(t).then(e=>new Uint8Array(e),()=>getBinarySync(t))}a(getBinaryPromise,"getBinaryPromise");function instantiateArrayBuffer(t,e,r){return getBinaryPromise(t).then(n=>WebAssembly.instantiate(n,e)).then(r,n=>{err(`failed to asynchronously prepare wasm: ${n}`),abort(n)})}a(instantiateArrayBuffer,"instantiateArrayBuffer");function instantiateAsync(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(e)&&!isFileURI(e)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(o=>{var s=WebAssembly.instantiateStreaming(o,r);return s.then(n,function(c){return err(`wasm streaming compile failed: ${c}`),err("falling back to ArrayBuffer instantiation"),instantiateArrayBuffer(e,r,n)})}):instantiateArrayBuffer(e,r,n)}a(instantiateAsync,"instantiateAsync");function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}a(getWasmImports,"getWasmImports");function createWasm(){var t=getWasmImports();function e(n,o){wasmExports=n.exports,wasmExports=relocateExports(wasmExports,1024);var s=getDylinkMetadata(o);return s.neededDynlibs&&(dynamicLibraries=s.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency("wasm-instantiate"),wasmExports}a(e,"receiveInstance"),addRunDependency("wasm-instantiate");function r(n){e(n.instance,n.module)}if(a(r,"receiveInstantiationResult"),Module.instantiateWasm)try{return Module.instantiateWasm(t,e)}catch(n){return err(`Module.instantiateWasm callback failed with error: ${n}`),!1}return wasmBinaryFile||(wasmBinaryFile=findWasmBinary()),instantiateAsync(wasmBinary,wasmBinaryFile,t,r),{}}a(createWasm,"createWasm");var ASM_CONSTS={};function ExitStatus(t){this.name="ExitStatus",this.message=`Program terminated with exit(${t})`,this.status=t}a(ExitStatus,"ExitStatus");var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(t,e){var r=GOT[e];return r||(r=GOT[e]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(e)||(r.required=!0),r}},LE_HEAP_LOAD_F32=a(t=>HEAP_DATA_VIEW.getFloat32(t,!0),"LE_HEAP_LOAD_F32"),LE_HEAP_LOAD_F64=a(t=>HEAP_DATA_VIEW.getFloat64(t,!0),"LE_HEAP_LOAD_F64"),LE_HEAP_LOAD_I16=a(t=>HEAP_DATA_VIEW.getInt16(t,!0),"LE_HEAP_LOAD_I16"),LE_HEAP_LOAD_I32=a(t=>HEAP_DATA_VIEW.getInt32(t,!0),"LE_HEAP_LOAD_I32"),LE_HEAP_LOAD_U32=a(t=>HEAP_DATA_VIEW.getUint32(t,!0),"LE_HEAP_LOAD_U32"),LE_HEAP_STORE_F32=a((t,e)=>HEAP_DATA_VIEW.setFloat32(t,e,!0),"LE_HEAP_STORE_F32"),LE_HEAP_STORE_F64=a((t,e)=>HEAP_DATA_VIEW.setFloat64(t,e,!0),"LE_HEAP_STORE_F64"),LE_HEAP_STORE_I16=a((t,e)=>HEAP_DATA_VIEW.setInt16(t,e,!0),"LE_HEAP_STORE_I16"),LE_HEAP_STORE_I32=a((t,e)=>HEAP_DATA_VIEW.setInt32(t,e,!0),"LE_HEAP_STORE_I32"),LE_HEAP_STORE_U32=a((t,e)=>HEAP_DATA_VIEW.setUint32(t,e,!0),"LE_HEAP_STORE_U32"),callRuntimeCallbacks=a(t=>{for(;t.length>0;)t.shift()(Module)},"callRuntimeCallbacks"),UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=a((t,e,r)=>{for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&UTF8Decoder)return UTF8Decoder.decode(t.subarray(e,o));for(var s="";e>10,56320|d&1023)}}return s},"UTF8ArrayToString"),getDylinkMetadata=a(t=>{var e=0,r=0;function n(){return t[e++]}a(n,"getU8");function o(){for(var q=0,M=1;;){var O=t[e++];if(q+=(O&127)*M,M*=128,!(O&128))break}return q}a(o,"getLEB");function s(){var q=o();return e+=q,UTF8ArrayToString(t,e-q,q)}a(s,"getString");function c(q,M){if(q)throw new Error(M)}a(c,"failIf");var l="dylink.0";if(t instanceof WebAssembly.Module){var u=WebAssembly.Module.customSections(t,l);u.length===0&&(l="dylink",u=WebAssembly.Module.customSections(t,l)),c(u.length===0,"need dylink section"),t=new Uint8Array(u[0]),r=t.length}else{var d=new Uint32Array(new Uint8Array(t.subarray(0,24)).buffer),f=d[0]==1836278016||d[0]==6386541;c(!f,"need to see wasm magic number"),c(t[8]!==0,"need the dylink section to be first"),e=9;var h=o();r=e+h,l=s()}var m={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(l=="dylink"){m.memorySize=o(),m.memoryAlign=o(),m.tableSize=o(),m.tableAlign=o();for(var g=o(),A=0;A>1)*2);case"i32":return LE_HEAP_LOAD_I32((t>>2)*4);case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return LE_HEAP_LOAD_F32((t>>2)*4);case"double":return LE_HEAP_LOAD_F64((t>>3)*8);case"*":return LE_HEAP_LOAD_U32((t>>2)*4);default:abort(`invalid type for getValue: ${e}`)}}a(getValue,"getValue");var newDSO=a((t,e,r)=>{var n={refcount:1/0,name:t,exports:r,global:!0};return LDSO.loadedLibsByName[t]=n,e!=null&&(LDSO.loadedLibsByHandle[e]=n),n},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=78112,zeroMemory=a((t,e)=>(HEAPU8.fill(0,t,t+e),t),"zeroMemory"),alignMemory=a((t,e)=>Math.ceil(t/e)*e,"alignMemory"),getMemory=a(t=>{if(runtimeInitialized)return zeroMemory(_malloc(t),t);var e=___heap_base,r=e+alignMemory(t,16);return ___heap_base=r,GOT.__heap_base.value=r,e},"getMemory"),isInternalSym=a(t=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(t)||t.startsWith("__em_js__"),"isInternalSym"),uleb128Encode=a((t,e)=>{t<128?e.push(t):e.push(t%128|128,t>>7)},"uleb128Encode"),sigToWasmTypes=a(t=>{for(var e={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},r={parameters:[],results:t[0]=="v"?[]:[e[t[0]]]},n=1;n{var r=t.slice(0,1),n=t.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111};e.push(96),uleb128Encode(n.length,e);for(var s=0;s{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(e),t);var r=[1];generateFuncType(e,r);var n=[0,97,115,109,1,0,0,0,1];uleb128Encode(r.length,n),n.push(...r),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var o=new WebAssembly.Module(new Uint8Array(n)),s=new WebAssembly.Instance(o,{e:{f:t}}),c=s.exports.f;return c},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:28,element:"anyfunc"}),getWasmTableEntry=a(t=>{var e=wasmTableMirror[t];return e||(t>=wasmTableMirror.length&&(wasmTableMirror.length=t+1),wasmTableMirror[t]=e=wasmTable.get(t)),e},"getWasmTableEntry"),updateTableMap=a((t,e)=>{if(functionsInTableMap)for(var r=t;r(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(t)||0),"getFunctionAddress"),freeTableIndexes=[],getEmptyTableSlot=a(()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(t){throw t instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":t}return wasmTable.length-1},"getEmptyTableSlot"),setWasmTableEntry=a((t,e)=>{wasmTable.set(t,e),wasmTableMirror[t]=wasmTable.get(t)},"setWasmTableEntry"),addFunction=a((t,e)=>{var r=getFunctionAddress(t);if(r)return r;var n=getEmptyTableSlot();try{setWasmTableEntry(n,t)}catch(s){if(!(s instanceof TypeError))throw s;var o=convertJsFunctionToWasm(t,e);setWasmTableEntry(n,o)}return functionsInTableMap.set(t,n),n},"addFunction"),updateGOT=a((t,e)=>{for(var r in t)if(!isInternalSym(r)){var n=t[r];r.startsWith("orig$")&&(r=r.split("$")[1],e=!0),GOT[r]||=new WebAssembly.Global({value:"i32",mutable:!0}),(e||GOT[r].value==0)&&(typeof n=="function"?GOT[r].value=addFunction(n):typeof n=="number"?GOT[r].value=n:err(`unhandled export type for '${r}': ${typeof n}`))}},"updateGOT"),relocateExports=a((t,e,r)=>{var n={};for(var o in t){var s=t[o];typeof s=="object"&&(s=s.value),typeof s=="number"&&(s+=e),n[o]=s}return updateGOT(n,r),n},"relocateExports"),isSymbolDefined=a(t=>{var e=wasmImports[t];return!(!e||e.stub)},"isSymbolDefined"),dynCallLegacy=a((t,e,r)=>{t=t.replace(/p/g,"i");var n=Module["dynCall_"+t];return n(e,...r)},"dynCallLegacy"),dynCall=a((t,e,r=[])=>{if(t.includes("j"))return dynCallLegacy(t,e,r);var n=getWasmTableEntry(e)(...r);return n},"dynCall"),stackSave=a(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=a(t=>__emscripten_stack_restore(t),"stackRestore"),createInvokeFunction=a(t=>(e,...r)=>{var n=stackSave();try{return dynCall(t,e,r)}catch(o){if(stackRestore(n),o!==o+0)throw o;_setThrew(1,0)}},"createInvokeFunction"),resolveGlobalSymbol=a((t,e=!1)=>{var r;return e&&"orig$"+t in wasmImports&&(t="orig$"+t),isSymbolDefined(t)?r=wasmImports[t]:t.startsWith("invoke_")&&(r=wasmImports[t]=createInvokeFunction(t.split("_")[1])),{sym:r,name:t}},"resolveGlobalSymbol"),UTF8ToString=a((t,e)=>t?UTF8ArrayToString(HEAPU8,t,e):"","UTF8ToString"),loadWebAssemblyModule=a((binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,LE_HEAP_STORE_U32((handle+12>>2)*4,memoryBase),LE_HEAP_STORE_I32((handle+16>>2)*4,metadata.memorySize),LE_HEAP_STORE_U32((handle+20>>2)*4,tableBase),LE_HEAP_STORE_I32((handle+24>>2)*4,metadata.tableSize))}else memoryBase=LE_HEAP_LOAD_U32((handle+12>>2)*4),tableBase=LE_HEAP_LOAD_U32((handle+20>>2)*4);var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var moduleExports;function resolveSymbol(t){var e=resolveGlobalSymbol(t).sym;return!e&&localScope&&(e=localScope[t]),e||(e=moduleExports[t]),e}a(resolveSymbol,"resolveSymbol");var proxyHandler={get(t,e){switch(e){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(e in wasmImports&&!wasmImports[e].stub)return wasmImports[e];if(!(e in t)){var r;t[e]=(...n)=>(r||=resolveSymbol(e),r(...n))}return t[e]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(a(addEmAsm,"addEmAsm"),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start ${body};`;moduleExports[name]=eval(func)}a(addEmJs,"addEmJs");for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(a(postInstantiation,"postInstantiation"),flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(t=>postInstantiation(t.module,t.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return a(loadModule,"loadModule"),flags.loadAsync?metadata.neededDynlibs.reduce((t,e)=>t.then(()=>loadDynamicLibrary(e,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(t=>loadDynamicLibrary(t,flags,localScope)),loadModule())},"loadWebAssemblyModule"),mergeLibSymbols=a((t,e)=>{for(var[r,n]of Object.entries(t)){let o=a(c=>{isSymbolDefined(c)||(wasmImports[c]=n)},"setImport");o(r);let s="__main_argc_argv";r=="main"&&o(s),r==s&&o("main"),r.startsWith("dynCall_")&&!Module.hasOwnProperty(r)&&(Module[r]=n)}},"mergeLibSymbols"),asyncLoad=a((t,e,r,n)=>{var o=n?"":`al ${t}`;readAsync(t).then(s=>{e(new Uint8Array(s)),o&&removeRunDependency(o)},s=>{if(r)r();else throw`Loading data file "${t}" failed.`}),o&&addRunDependency(o)},"asyncLoad");function loadDynamicLibrary(t,e={global:!0,nodelete:!0},r,n){var o=LDSO.loadedLibsByName[t];if(o)return e.global?o.global||(o.global=!0,mergeLibSymbols(o.exports,t)):r&&Object.assign(r,o.exports),e.nodelete&&o.refcount!==1/0&&(o.refcount=1/0),o.refcount++,n&&(LDSO.loadedLibsByHandle[n]=o),e.loadAsync?Promise.resolve(!0):!0;o=newDSO(t,n,"loading"),o.refcount=e.nodelete?1/0:1,o.global=e.global;function s(){if(n){var u=LE_HEAP_LOAD_U32((n+28>>2)*4),d=LE_HEAP_LOAD_U32((n+32>>2)*4);if(u&&d){var f=HEAP8.slice(u,u+d);return e.loadAsync?Promise.resolve(f):f}}var h=locateFile(t);if(e.loadAsync)return new Promise(function(m,g){asyncLoad(h,m,g)});if(!readBinary)throw new Error(`${h}: file not found, and synchronous loading of external files is not available`);return readBinary(h)}a(s,"loadLibData");function c(){return e.loadAsync?s().then(u=>loadWebAssemblyModule(u,e,t,r,n)):loadWebAssemblyModule(s(),e,t,r,n)}a(c,"getExports");function l(u){o.global?mergeLibSymbols(u,t):r&&Object.assign(r,u),o.exports=u}return a(l,"moduleLoaded"),e.loadAsync?c().then(u=>(l(u),!0)):(l(c()),!0)}a(loadDynamicLibrary,"loadDynamicLibrary");var reportUndefinedSymbols=a(()=>{for(var[t,e]of Object.entries(GOT))if(e.value==0){var r=resolveGlobalSymbol(t,!0).sym;if(!r&&!e.required)continue;if(typeof r=="function")e.value=addFunction(r,r.sig);else if(typeof r=="number")e.value=r;else throw new Error(`bad export type for '${t}': ${typeof r}`)}},"reportUndefinedSymbols"),loadDylibs=a(()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs"),dynamicLibraries.reduce((t,e)=>t.then(()=>loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency("loadDylibs")})},"loadDylibs"),noExitRuntime=Module.noExitRuntime||!0;function setValue(t,e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":HEAP8[t]=e;break;case"i8":HEAP8[t]=e;break;case"i16":LE_HEAP_STORE_I16((t>>1)*2,e);break;case"i32":LE_HEAP_STORE_I32((t>>2)*4,e);break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":LE_HEAP_STORE_F32((t>>2)*4,e);break;case"double":LE_HEAP_STORE_F64((t>>3)*8,e);break;case"*":LE_HEAP_STORE_U32((t>>2)*4,e);break;default:abort(`invalid type for setValue: ${r}`)}}a(setValue,"setValue");var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78112),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=a(()=>{abort("")},"__abort_js");__abort_js.sig="v";var nowIsMonotonic=1,__emscripten_get_now_is_monotonic=a(()=>nowIsMonotonic,"__emscripten_get_now_is_monotonic");__emscripten_get_now_is_monotonic.sig="i";var __emscripten_memcpy_js=a((t,e,r)=>HEAPU8.copyWithin(t,e,e+r),"__emscripten_memcpy_js");__emscripten_memcpy_js.sig="vppp";var _emscripten_date_now=a(()=>Date.now(),"_emscripten_date_now");_emscripten_date_now.sig="d";var _emscripten_get_now;_emscripten_get_now=a(()=>performance.now(),"_emscripten_get_now"),_emscripten_get_now.sig="d";var getHeapMax=a(()=>2147483648,"getHeapMax"),growMemory=a(t=>{var e=wasmMemory.buffer,r=(t-e.byteLength+65535)/65536;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch{}},"growMemory"),_emscripten_resize_heap=a(t=>{var e=HEAPU8.length;t>>>=0;var r=getHeapMax();if(t>r)return!1;for(var n=a((u,d)=>u+(d-u%d)%d,"alignUp"),o=1;o<=4;o*=2){var s=e*(1+.2/o);s=Math.min(s,t+100663296);var c=Math.min(r,n(Math.max(t,s),65536)),l=growMemory(c);if(l)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";var _fd_close=a(t=>52,"_fd_close");_fd_close.sig="ii";var convertI32PairToI53Checked=a((t,e)=>e+2097152>>>0<4194305-!!t?(t>>>0)+e*4294967296:NaN,"convertI32PairToI53Checked");function _fd_seek(t,e,r,n,o){var s=convertI32PairToI53Checked(e,r);return 70}a(_fd_seek,"_fd_seek"),_fd_seek.sig="iiiiip";var printCharBuffers=[null,[],[]],printChar=a((t,e)=>{var r=printCharBuffers[t];e===0||e===10?((t===1?out:err)(UTF8ArrayToString(r,0)),r.length=0):r.push(e)},"printChar"),_fd_write=a((t,e,r,n)=>{for(var o=0,s=0;s>2)*4),l=LE_HEAP_LOAD_U32((e+4>>2)*4);e+=8;for(var u=0;u>2)*4,o),0},"_fd_write");_fd_write.sig="iippp";function _tree_sitter_log_callback(t,e){if(currentLogCallback){let r=UTF8ToString(e);currentLogCallback(r,t!==0)}}a(_tree_sitter_log_callback,"_tree_sitter_log_callback");function _tree_sitter_parse_callback(t,e,r,n,o){let c=currentParseCallback(e,{row:r,column:n});typeof c=="string"?(setValue(o,c.length,"i32"),stringToUTF16(c,t,10240)):setValue(o,0,"i32")}a(_tree_sitter_parse_callback,"_tree_sitter_parse_callback");var runtimeKeepaliveCounter=0,keepRuntimeAlive=a(()=>noExitRuntime||runtimeKeepaliveCounter>0,"keepRuntimeAlive"),_proc_exit=a(t=>{EXITSTATUS=t,keepRuntimeAlive()||(Module.onExit?.(t),ABORT=!0),quit_(t,new ExitStatus(t))},"_proc_exit");_proc_exit.sig="vi";var exitJS=a((t,e)=>{EXITSTATUS=t,_proc_exit(t)},"exitJS"),handleException=a(t=>{if(t instanceof ExitStatus||t=="unwind")return EXITSTATUS;quit_(1,t)},"handleException"),lengthBytesUTF8=a(t=>{for(var e=0,r=0;r=55296&&n<=57343?(e+=4,++r):e+=3}return e},"lengthBytesUTF8"),stringToUTF8Array=a((t,e,r,n)=>{if(!(n>0))return 0;for(var o=r,s=r+n-1,c=0;c=55296&&l<=57343){var u=t.charCodeAt(++c);l=65536+((l&1023)<<10)|u&1023}if(l<=127){if(r>=s)break;e[r++]=l}else if(l<=2047){if(r+1>=s)break;e[r++]=192|l>>6,e[r++]=128|l&63}else if(l<=65535){if(r+2>=s)break;e[r++]=224|l>>12,e[r++]=128|l>>6&63,e[r++]=128|l&63}else{if(r+3>=s)break;e[r++]=240|l>>18,e[r++]=128|l>>12&63,e[r++]=128|l>>6&63,e[r++]=128|l&63}}return e[r]=0,r-o},"stringToUTF8Array"),stringToUTF8=a((t,e,r)=>stringToUTF8Array(t,HEAPU8,e,r),"stringToUTF8"),stackAlloc=a(t=>__emscripten_stack_alloc(t),"stackAlloc"),stringToUTF8OnStack=a(t=>{var e=lengthBytesUTF8(t)+1,r=stackAlloc(e);return stringToUTF8(t,r,e),r},"stringToUTF8OnStack"),stringToUTF16=a((t,e,r)=>{if(r??=2147483647,r<2)return 0;r-=2;for(var n=e,o=r>1)*2,c),e+=2}return LE_HEAP_STORE_I16((e>>1)*2,0),e-n},"stringToUTF16"),AsciiToString=a(t=>{for(var e="";;){var r=HEAPU8[t++];if(!r)return e;e+=String.fromCharCode(r)}},"AsciiToString"),wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_abort_js:__abort_js,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,_emscripten_memcpy_js:__emscripten_memcpy_js,emscripten_get_now:_emscripten_get_now,emscripten_resize_heap:_emscripten_resize_heap,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback},wasmExports=createWasm(),___wasm_call_ctors=a(()=>(___wasm_call_ctors=wasmExports.__wasm_call_ctors)(),"___wasm_call_ctors"),___wasm_apply_data_relocs=a(()=>(___wasm_apply_data_relocs=wasmExports.__wasm_apply_data_relocs)(),"___wasm_apply_data_relocs"),_malloc=Module._malloc=t=>(_malloc=Module._malloc=wasmExports.malloc)(t),_calloc=Module._calloc=(t,e)=>(_calloc=Module._calloc=wasmExports.calloc)(t,e),_realloc=Module._realloc=(t,e)=>(_realloc=Module._realloc=wasmExports.realloc)(t,e),_free=Module._free=t=>(_free=Module._free=wasmExports.free)(t),_ts_language_symbol_count=Module._ts_language_symbol_count=t=>(_ts_language_symbol_count=Module._ts_language_symbol_count=wasmExports.ts_language_symbol_count)(t),_ts_language_state_count=Module._ts_language_state_count=t=>(_ts_language_state_count=Module._ts_language_state_count=wasmExports.ts_language_state_count)(t),_ts_language_version=Module._ts_language_version=t=>(_ts_language_version=Module._ts_language_version=wasmExports.ts_language_version)(t),_ts_language_field_count=Module._ts_language_field_count=t=>(_ts_language_field_count=Module._ts_language_field_count=wasmExports.ts_language_field_count)(t),_ts_language_next_state=Module._ts_language_next_state=(t,e,r)=>(_ts_language_next_state=Module._ts_language_next_state=wasmExports.ts_language_next_state)(t,e,r),_ts_language_symbol_name=Module._ts_language_symbol_name=(t,e)=>(_ts_language_symbol_name=Module._ts_language_symbol_name=wasmExports.ts_language_symbol_name)(t,e),_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=(t,e,r,n)=>(_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=wasmExports.ts_language_symbol_for_name)(t,e,r,n),_strncmp=Module._strncmp=(t,e,r)=>(_strncmp=Module._strncmp=wasmExports.strncmp)(t,e,r),_ts_language_symbol_type=Module._ts_language_symbol_type=(t,e)=>(_ts_language_symbol_type=Module._ts_language_symbol_type=wasmExports.ts_language_symbol_type)(t,e),_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=(t,e)=>(_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=wasmExports.ts_language_field_name_for_id)(t,e),_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=(t,e)=>(_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=wasmExports.ts_lookahead_iterator_new)(t,e),_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=t=>(_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=wasmExports.ts_lookahead_iterator_delete)(t),_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=(t,e)=>(_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=wasmExports.ts_lookahead_iterator_reset_state)(t,e),_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=(t,e,r)=>(_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=wasmExports.ts_lookahead_iterator_reset)(t,e,r),_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=t=>(_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=wasmExports.ts_lookahead_iterator_next)(t),_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=t=>(_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=wasmExports.ts_lookahead_iterator_current_symbol)(t),_memset=Module._memset=(t,e,r)=>(_memset=Module._memset=wasmExports.memset)(t,e,r),_memcpy=Module._memcpy=(t,e,r)=>(_memcpy=Module._memcpy=wasmExports.memcpy)(t,e,r),_ts_parser_delete=Module._ts_parser_delete=t=>(_ts_parser_delete=Module._ts_parser_delete=wasmExports.ts_parser_delete)(t),_ts_parser_reset=Module._ts_parser_reset=t=>(_ts_parser_reset=Module._ts_parser_reset=wasmExports.ts_parser_reset)(t),_ts_parser_set_language=Module._ts_parser_set_language=(t,e)=>(_ts_parser_set_language=Module._ts_parser_set_language=wasmExports.ts_parser_set_language)(t,e),_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=t=>(_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=wasmExports.ts_parser_timeout_micros)(t),_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=(t,e,r)=>(_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=wasmExports.ts_parser_set_timeout_micros)(t,e,r),_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=(t,e,r)=>(_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=wasmExports.ts_parser_set_included_ranges)(t,e,r),_memmove=Module._memmove=(t,e,r)=>(_memmove=Module._memmove=wasmExports.memmove)(t,e,r),_memcmp=Module._memcmp=(t,e,r)=>(_memcmp=Module._memcmp=wasmExports.memcmp)(t,e,r),_ts_query_new=Module._ts_query_new=(t,e,r,n,o)=>(_ts_query_new=Module._ts_query_new=wasmExports.ts_query_new)(t,e,r,n,o),_ts_query_delete=Module._ts_query_delete=t=>(_ts_query_delete=Module._ts_query_delete=wasmExports.ts_query_delete)(t),_iswspace=Module._iswspace=t=>(_iswspace=Module._iswspace=wasmExports.iswspace)(t),_iswalnum=Module._iswalnum=t=>(_iswalnum=Module._iswalnum=wasmExports.iswalnum)(t),_ts_query_pattern_count=Module._ts_query_pattern_count=t=>(_ts_query_pattern_count=Module._ts_query_pattern_count=wasmExports.ts_query_pattern_count)(t),_ts_query_capture_count=Module._ts_query_capture_count=t=>(_ts_query_capture_count=Module._ts_query_capture_count=wasmExports.ts_query_capture_count)(t),_ts_query_string_count=Module._ts_query_string_count=t=>(_ts_query_string_count=Module._ts_query_string_count=wasmExports.ts_query_string_count)(t),_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=(t,e,r)=>(_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=wasmExports.ts_query_capture_name_for_id)(t,e,r),_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=(t,e,r)=>(_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=wasmExports.ts_query_string_value_for_id)(t,e,r),_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=(t,e,r)=>(_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=wasmExports.ts_query_predicates_for_pattern)(t,e,r),_ts_query_disable_capture=Module._ts_query_disable_capture=(t,e,r)=>(_ts_query_disable_capture=Module._ts_query_disable_capture=wasmExports.ts_query_disable_capture)(t,e,r),_ts_tree_copy=Module._ts_tree_copy=t=>(_ts_tree_copy=Module._ts_tree_copy=wasmExports.ts_tree_copy)(t),_ts_tree_delete=Module._ts_tree_delete=t=>(_ts_tree_delete=Module._ts_tree_delete=wasmExports.ts_tree_delete)(t),_ts_init=Module._ts_init=()=>(_ts_init=Module._ts_init=wasmExports.ts_init)(),_ts_parser_new_wasm=Module._ts_parser_new_wasm=()=>(_ts_parser_new_wasm=Module._ts_parser_new_wasm=wasmExports.ts_parser_new_wasm)(),_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=(t,e)=>(_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=wasmExports.ts_parser_enable_logger_wasm)(t,e),_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=(t,e,r,n,o)=>(_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=wasmExports.ts_parser_parse_wasm)(t,e,r,n,o),_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=t=>(_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=wasmExports.ts_parser_included_ranges_wasm)(t),_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=(t,e)=>(_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=wasmExports.ts_language_type_is_named_wasm)(t,e),_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=(t,e)=>(_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=wasmExports.ts_language_type_is_visible_wasm)(t,e),_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=t=>(_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=wasmExports.ts_tree_root_node_wasm)(t),_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=t=>(_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=wasmExports.ts_tree_root_node_with_offset_wasm)(t),_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=t=>(_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=wasmExports.ts_tree_edit_wasm)(t),_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=t=>(_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=wasmExports.ts_tree_included_ranges_wasm)(t),_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=(t,e)=>(_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=wasmExports.ts_tree_get_changed_ranges_wasm)(t,e),_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=t=>(_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=wasmExports.ts_tree_cursor_new_wasm)(t),_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=t=>(_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=wasmExports.ts_tree_cursor_delete_wasm)(t),_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=t=>(_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=wasmExports.ts_tree_cursor_reset_wasm)(t),_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=(t,e)=>(_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=wasmExports.ts_tree_cursor_reset_to_wasm)(t,e),_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=t=>(_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=wasmExports.ts_tree_cursor_goto_first_child_wasm)(t),_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=t=>(_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=wasmExports.ts_tree_cursor_goto_last_child_wasm)(t),_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=t=>(_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_index_wasm)(t),_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=t=>(_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_position_wasm)(t),_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=t=>(_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=wasmExports.ts_tree_cursor_goto_next_sibling_wasm)(t),_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=t=>(_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=wasmExports.ts_tree_cursor_goto_previous_sibling_wasm)(t),_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=(t,e)=>(_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=wasmExports.ts_tree_cursor_goto_descendant_wasm)(t,e),_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=t=>(_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=wasmExports.ts_tree_cursor_goto_parent_wasm)(t),_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=t=>(_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=wasmExports.ts_tree_cursor_current_node_type_id_wasm)(t),_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=t=>(_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=wasmExports.ts_tree_cursor_current_node_state_id_wasm)(t),_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=t=>(_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=wasmExports.ts_tree_cursor_current_node_is_named_wasm)(t),_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=t=>(_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=wasmExports.ts_tree_cursor_current_node_is_missing_wasm)(t),_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=t=>(_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=wasmExports.ts_tree_cursor_current_node_id_wasm)(t),_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=t=>(_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=wasmExports.ts_tree_cursor_start_position_wasm)(t),_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=t=>(_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=wasmExports.ts_tree_cursor_end_position_wasm)(t),_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=t=>(_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=wasmExports.ts_tree_cursor_start_index_wasm)(t),_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=t=>(_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=wasmExports.ts_tree_cursor_end_index_wasm)(t),_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=t=>(_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=wasmExports.ts_tree_cursor_current_field_id_wasm)(t),_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=t=>(_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=wasmExports.ts_tree_cursor_current_depth_wasm)(t),_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=t=>(_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=wasmExports.ts_tree_cursor_current_descendant_index_wasm)(t),_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=t=>(_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=wasmExports.ts_tree_cursor_current_node_wasm)(t),_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=t=>(_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=wasmExports.ts_node_symbol_wasm)(t),_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=(t,e)=>(_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=wasmExports.ts_node_field_name_for_child_wasm)(t,e),_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=(t,e)=>(_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=wasmExports.ts_node_children_by_field_id_wasm)(t,e),_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=t=>(_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=wasmExports.ts_node_first_child_for_byte_wasm)(t),_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=t=>(_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=wasmExports.ts_node_first_named_child_for_byte_wasm)(t),_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=t=>(_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=wasmExports.ts_node_grammar_symbol_wasm)(t),_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=t=>(_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=wasmExports.ts_node_child_count_wasm)(t),_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=t=>(_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=wasmExports.ts_node_named_child_count_wasm)(t),_ts_node_child_wasm=Module._ts_node_child_wasm=(t,e)=>(_ts_node_child_wasm=Module._ts_node_child_wasm=wasmExports.ts_node_child_wasm)(t,e),_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=(t,e)=>(_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=wasmExports.ts_node_named_child_wasm)(t,e),_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=(t,e)=>(_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=wasmExports.ts_node_child_by_field_id_wasm)(t,e),_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=t=>(_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=wasmExports.ts_node_next_sibling_wasm)(t),_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=t=>(_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=wasmExports.ts_node_prev_sibling_wasm)(t),_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=t=>(_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=wasmExports.ts_node_next_named_sibling_wasm)(t),_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=t=>(_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=wasmExports.ts_node_prev_named_sibling_wasm)(t),_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=t=>(_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=wasmExports.ts_node_descendant_count_wasm)(t),_ts_node_parent_wasm=Module._ts_node_parent_wasm=t=>(_ts_node_parent_wasm=Module._ts_node_parent_wasm=wasmExports.ts_node_parent_wasm)(t),_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=t=>(_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=wasmExports.ts_node_descendant_for_index_wasm)(t),_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=t=>(_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=wasmExports.ts_node_named_descendant_for_index_wasm)(t),_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=t=>(_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=wasmExports.ts_node_descendant_for_position_wasm)(t),_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=t=>(_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=wasmExports.ts_node_named_descendant_for_position_wasm)(t),_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=t=>(_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=wasmExports.ts_node_start_point_wasm)(t),_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=t=>(_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=wasmExports.ts_node_end_point_wasm)(t),_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=t=>(_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=wasmExports.ts_node_start_index_wasm)(t),_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=t=>(_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=wasmExports.ts_node_end_index_wasm)(t),_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=t=>(_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=wasmExports.ts_node_to_string_wasm)(t),_ts_node_children_wasm=Module._ts_node_children_wasm=t=>(_ts_node_children_wasm=Module._ts_node_children_wasm=wasmExports.ts_node_children_wasm)(t),_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=t=>(_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=wasmExports.ts_node_named_children_wasm)(t),_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=(t,e,r,n,o,s,c)=>(_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=wasmExports.ts_node_descendants_of_type_wasm)(t,e,r,n,o,s,c),_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=t=>(_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=wasmExports.ts_node_is_named_wasm)(t),_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=t=>(_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=wasmExports.ts_node_has_changes_wasm)(t),_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=t=>(_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=wasmExports.ts_node_has_error_wasm)(t),_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=t=>(_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=wasmExports.ts_node_is_error_wasm)(t),_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=t=>(_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=wasmExports.ts_node_is_missing_wasm)(t),_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=t=>(_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=wasmExports.ts_node_is_extra_wasm)(t),_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=t=>(_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=wasmExports.ts_node_parse_state_wasm)(t),_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=t=>(_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=wasmExports.ts_node_next_parse_state_wasm)(t),_ts_query_matches_wasm=Module._ts_query_matches_wasm=(t,e,r,n,o,s,c,l,u,d)=>(_ts_query_matches_wasm=Module._ts_query_matches_wasm=wasmExports.ts_query_matches_wasm)(t,e,r,n,o,s,c,l,u,d),_ts_query_captures_wasm=Module._ts_query_captures_wasm=(t,e,r,n,o,s,c,l,u,d)=>(_ts_query_captures_wasm=Module._ts_query_captures_wasm=wasmExports.ts_query_captures_wasm)(t,e,r,n,o,s,c,l,u,d),_iswalpha=Module._iswalpha=t=>(_iswalpha=Module._iswalpha=wasmExports.iswalpha)(t),_iswblank=Module._iswblank=t=>(_iswblank=Module._iswblank=wasmExports.iswblank)(t),_iswdigit=Module._iswdigit=t=>(_iswdigit=Module._iswdigit=wasmExports.iswdigit)(t),_iswlower=Module._iswlower=t=>(_iswlower=Module._iswlower=wasmExports.iswlower)(t),_iswupper=Module._iswupper=t=>(_iswupper=Module._iswupper=wasmExports.iswupper)(t),_iswxdigit=Module._iswxdigit=t=>(_iswxdigit=Module._iswxdigit=wasmExports.iswxdigit)(t),_memchr=Module._memchr=(t,e,r)=>(_memchr=Module._memchr=wasmExports.memchr)(t,e,r),_strlen=Module._strlen=t=>(_strlen=Module._strlen=wasmExports.strlen)(t),_strcmp=Module._strcmp=(t,e)=>(_strcmp=Module._strcmp=wasmExports.strcmp)(t,e),_strncat=Module._strncat=(t,e,r)=>(_strncat=Module._strncat=wasmExports.strncat)(t,e,r),_strncpy=Module._strncpy=(t,e,r)=>(_strncpy=Module._strncpy=wasmExports.strncpy)(t,e,r),_towlower=Module._towlower=t=>(_towlower=Module._towlower=wasmExports.towlower)(t),_towupper=Module._towupper=t=>(_towupper=Module._towupper=wasmExports.towupper)(t),_setThrew=a((t,e)=>(_setThrew=wasmExports.setThrew)(t,e),"_setThrew"),__emscripten_stack_restore=a(t=>(__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(t),"__emscripten_stack_restore"),__emscripten_stack_alloc=a(t=>(__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(t),"__emscripten_stack_alloc"),_emscripten_stack_get_current=a(()=>(_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)(),"_emscripten_stack_get_current"),dynCall_jiji=Module.dynCall_jiji=(t,e,r,n,o)=>(dynCall_jiji=Module.dynCall_jiji=wasmExports.dynCall_jiji)(t,e,r,n,o),_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=t=>(_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=wasmExports.orig$ts_parser_timeout_micros)(t),_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=(t,e)=>(_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=wasmExports.orig$ts_parser_set_timeout_micros)(t,e);Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16;var calledRun;dependenciesFulfilled=a(function t(){calledRun||run(),calledRun||(dependenciesFulfilled=t)},"runCaller");function callMain(t=[]){var e=resolveGlobalSymbol("main").sym;if(e){t.unshift(thisProgram);var r=t.length,n=stackAlloc((r+1)*4),o=n;t.forEach(c=>{LE_HEAP_STORE_U32((o>>2)*4,stringToUTF8OnStack(c)),o+=4}),LE_HEAP_STORE_U32((o>>2)*4,0);try{var s=e(r,n);return exitJS(s,!0),s}catch(c){return handleException(c)}}}a(callMain,"callMain");function run(t=arguments_){if(runDependencies>0||(preRun(),runDependencies>0))return;function e(){calledRun||(calledRun=!0,Module.calledRun=!0,!ABORT&&(initRuntime(),preMain(),Module.onRuntimeInitialized?.(),shouldRunNow&&callMain(t),postRun()))}a(e,"doRun"),Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),e()},1)):e()}if(a(run,"run"),Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run();let C=Module,INTERNAL={},SIZE_OF_INT=4,SIZE_OF_CURSOR=4*SIZE_OF_INT,SIZE_OF_NODE=5*SIZE_OF_INT,SIZE_OF_POINT=2*SIZE_OF_INT,SIZE_OF_RANGE=2*SIZE_OF_INT+2*SIZE_OF_POINT,ZERO_POINT={row:0,column:0},QUERY_WORD_REGEX=/[\w-.]*/g,PREDICATE_STEP_TYPE_CAPTURE=1,PREDICATE_STEP_TYPE_STRING=2,LANGUAGE_FUNCTION_REGEX=/^_?tree_sitter_\w+/,VERSION,MIN_COMPATIBLE_VERSION,TRANSFER_BUFFER,currentParseCallback,currentLogCallback;class ParserImpl{static{a(this,"ParserImpl")}static init(){TRANSFER_BUFFER=C._ts_init(),VERSION=getValue(TRANSFER_BUFFER,"i32"),MIN_COMPATIBLE_VERSION=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}initialize(){C._ts_parser_new_wasm(),this[0]=getValue(TRANSFER_BUFFER,"i32"),this[1]=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}delete(){C._ts_parser_delete(this[0]),C._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let r;if(!e)r=0,e=null;else if(e.constructor===Language){r=e[0];let n=C._ts_language_version(r);if(ne.slice(u),"currentParseCallback");else if(typeof e=="function")currentParseCallback=e;else throw new Error("Argument must be a string or a function");this.logCallback?(currentLogCallback=this.logCallback,C._ts_parser_enable_logger_wasm(this[0],1)):(currentLogCallback=null,C._ts_parser_enable_logger_wasm(this[0],0));let o=0,s=0;if(n?.includedRanges){o=n.includedRanges.length,s=C._calloc(o,SIZE_OF_RANGE);let u=s;for(let d=0;d0){let o=r;for(let s=0;s0){let s=n;for(let c=0;c0){let o=r;for(let s=0;s0){let s=n;for(let c=0;c0){let n=r;for(let o=0;o0){let n=r;for(let o=0;o0){let f=u;for(let h=0;h0){if(v[0].type!=="string")throw new Error("Predicates must begin with a literal value");let x=v[0].value,P=!0,D=!0,N;switch(x){case"any-not-eq?":case"not-eq?":P=!1;case"any-eq?":case"eq?":if(v.length!==3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 2, got ${v.length-1}`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}"`);if(D=!x.startsWith("any-"),v[2].type==="capture"){let M=v[1].name,O=v[2].name;A[y].push(j=>{let Q=[],U=[];for(let W of j)W.name===M&&Q.push(W.node),W.name===O&&U.push(W.node);let Y=a((W,V,z)=>z?W.text===V.text:W.text!==V.text,"compare");return D?Q.every(W=>U.some(V=>Y(W,V,P))):Q.some(W=>U.some(V=>Y(W,V,P)))})}else{N=v[1].name;let M=v[2].value,O=a(Q=>Q.text===M,"matches"),j=a(Q=>Q.text!==M,"doesNotMatch");A[y].push(Q=>{let U=[];for(let W of Q)W.name===N&&U.push(W.node);let Y=P?O:j;return D?U.every(Y):U.some(Y)})}break;case"any-not-match?":case"not-match?":P=!1;case"any-match?":case"match?":if(v.length!==3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 2, got ${v.length-1}.`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}".`);if(v[2].type!=="string")throw new Error(`Second argument of \`#${x}\` predicate must be a string. Got @${v[2].value}.`);N=v[1].name;let L=new RegExp(v[2].value);D=!x.startsWith("any-"),A[y].push(M=>{let O=[];for(let Q of M)Q.name===N&&O.push(Q.node.text);let j=a((Q,U)=>U?L.test(Q):!L.test(Q),"test");return O.length===0?!P:D?O.every(Q=>j(Q,P)):O.some(Q=>j(Q,P))});break;case"set!":if(v.length<2||v.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${v.length-1}.`);if(v.some(M=>M.type!=="string"))throw new Error('Arguments to `#set!` predicate must be a strings.".');f[y]||(f[y]={}),f[y][v[1].value]=v[2]?v[2].value:null;break;case"is?":case"is-not?":if(v.length<2||v.length>3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 1 or 2. Got ${v.length-1}.`);if(v.some(M=>M.type!=="string"))throw new Error(`Arguments to \`#${x}\` predicate must be a strings.".`);let B=x==="is?"?h:m;B[y]||(B[y]={}),B[y][v[1].value]=v[2]?v[2].value:null;break;case"not-any-of?":P=!1;case"any-of?":if(v.length<2)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected at least 1. Got ${v.length-1}.`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}".`);for(let M=2;MM.value);A[y].push(M=>{let O=[];for(let j of M)j.name===N&&O.push(j.node.text);return O.length===0?!P:O.every(j=>q.includes(j))===P});break;default:g[y].push({operator:x,operands:v.slice(1)})}v.length=0}}Object.freeze(f[y]),Object.freeze(h[y]),Object.freeze(m[y])}return C._free(n),new Query(INTERNAL,o,u,A,g,Object.freeze(f),Object.freeze(h),Object.freeze(m))}static load(e){let r;if(e instanceof Uint8Array)r=Promise.resolve(e);else{let n=e;if(typeof process<"u"&&process.versions&&process.versions.node){let o=require("fs");r=Promise.resolve(o.readFileSync(n))}else r=fetch(n).then(o=>o.arrayBuffer().then(s=>{if(o.ok)return new Uint8Array(s);{let c=new TextDecoder("utf-8").decode(s);throw new Error(`Language.load failed with status ${o.status}. +`)+4,e.outputData[0].data=e._header+n.substring(o),rle("Output buffer: %o",e.outputData[0].data));let s;return this.proxy.protocol==="https:"?(rle("Creating `tls.Socket`: %o",this.connectOpts),s=GMo.connect(this.connectOpts)):(rle("Creating `net.Socket`: %o",this.connectOpts),s=HMo.connect(this.connectOpts)),await(0,VMo.once)(s,"connect"),s}};p$e.protocols=["http","https"];Qx.HttpProxyAgent=p$e;function zMo(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(zMo,"omit")});var hQ={};Ri(hQ,{__addDisposableResource:()=>Kln,__assign:()=>E$e,__asyncDelegator:()=>Hln,__asyncGenerator:()=>HTe,__asyncValues:()=>C$e,__await:()=>RS,__awaiter:()=>Bln,__classPrivateFieldGet:()=>Wln,__classPrivateFieldIn:()=>Yln,__classPrivateFieldSet:()=>zln,__createBinding:()=>v$e,__decorate:()=>kln,__disposeResources:()=>Jln,__esDecorate:()=>Dln,__exportStar:()=>Uln,__extends:()=>wln,__generator:()=>Fln,__importDefault:()=>Vln,__importStar:()=>$ln,__makeTemplateObject:()=>Gln,__metadata:()=>Lln,__param:()=>Pln,__propKey:()=>Mln,__read:()=>TFt,__rest:()=>Rln,__rewriteRelativeImportExtension:()=>Zln,__runInitializers:()=>Nln,__setFunctionName:()=>Oln,__spread:()=>Qln,__spreadArray:()=>jln,__spreadArrays:()=>qln,__values:()=>_$e,default:()=>sOo});function wln(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");bFt(t,e);function r(){this.constructor=t}a(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Rln(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}function Pln(t,e){return function(r,n){e(r,n,t)}}function Dln(t,e,r,n,o,s){function c(_){if(_!==void 0&&typeof _!="function")throw new TypeError("Function expected");return _}a(c,"accept");for(var l=n.kind,u=l==="getter"?"get":l==="setter"?"set":"value",d=!e&&t?n.static?t:t.prototype:null,f=e||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),h,m=!1,g=r.length-1;g>=0;g--){var A={};for(var y in n)A[y]=y==="access"?{}:n[y];for(var y in n.access)A.access[y]=n.access[y];A.addInitializer=function(_){if(m)throw new TypeError("Cannot add initializers after decoration has completed");s.push(c(_||null))};var E=(0,r[g])(l==="accessor"?{get:f.get,set:f.set}:f[u],A);if(l==="accessor"){if(E===void 0)continue;if(E===null||typeof E!="object")throw new TypeError("Object expected");(h=c(E.get))&&(f.get=h),(h=c(E.set))&&(f.set=h),(h=c(E.init))&&o.unshift(h)}else(h=c(E))&&(l==="field"?o.unshift(h):f[u]=h)}d&&Object.defineProperty(d,n.name,f),m=!0}function Nln(t,e,r){for(var n=arguments.length>2,o=0;o0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function TFt(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s}function Qln(){for(var t=[],e=0;e1||u(g,y)})},A&&(o[g]=A(o[g])))}function u(g,A){try{d(n[g](A))}catch(y){m(s[0][3],y)}}function d(g){g.value instanceof RS?Promise.resolve(g.value.v).then(f,h):m(s[0][2],g)}function f(g){u("next",g)}function h(g){u("throw",g)}function m(g,A){g(A),s.shift(),s.length&&u(s[0][0],s[0][1])}}function Hln(t){var e,r;return e={},n("next"),n("throw",function(o){throw o}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(o,s){e[o]=t[o]?function(c){return(r=!r)?{value:RS(t[o](c)),done:!1}:s?s(c):c}:s}}function C$e(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof _$e=="function"?_$e(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(c){return new Promise(function(l,u){c=t[s](c),o(l,u,c.done,c.value)})}}function o(s,c,l,u){Promise.resolve(u).then(function(d){s({value:d,done:l})},c)}}function Gln(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function $ln(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=SFt(t),n=0;n{p();bFt=a(function(t,e){return bFt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},bFt(t,e)},"extendStatics");a(wln,"__extends");E$e=a(function(){return E$e=Object.assign||a(function(e){for(var r,n=1,o=arguments.length;n{"use strict";p();Object.defineProperty(N$e,"__esModule",{value:!0});N$e.state=void 0;N$e.state={operationRequestMap:new WeakMap}});function a5o(){try{return ZFt.default.statSync("/.dockerenv"),!0}catch{return!1}}function c5o(){try{return ZFt.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function XFt(){return JFt===void 0&&(JFt=a5o()||c5o()),JFt}var ZFt,JFt,Dun=Se(()=>{p();ZFt=fe(require("node:fs"),1);a(a5o,"hasDockerEnv");a(c5o,"hasDockerCGroup");a(XFt,"isDocker")});function sle(){return e8t===void 0&&(e8t=l5o()||XFt()),e8t}var Nun,e8t,l5o,t8t=Se(()=>{p();Nun=fe(require("node:fs"),1);Dun();l5o=a(()=>{try{return Nun.default.statSync("/run/.containerenv"),!0}catch{return!1}},"hasContainerEnv");a(sle,"isInsideContainer")});var r8t,Oun,Lun,Mun,yQ,n8t=Se(()=>{p();r8t=fe(require("node:process"),1),Oun=fe(require("node:os"),1),Lun=fe(require("node:fs"),1);t8t();Mun=a(()=>{if(r8t.default.platform!=="linux")return!1;if(Oun.default.release().toLowerCase().includes("microsoft"))return!sle();try{return Lun.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!sle():!1}catch{return!1}},"isWsl"),yQ=r8t.default.env.__IS_WSL_TEST__?Mun:Mun()});var i8t,YTe,u5o,d5o,o8t,Fun=Se(()=>{p();i8t=fe(require("node:process"),1),YTe=fe(require("node:fs/promises"),1);n8t();n8t();u5o=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await YTe.default.access(r,YTe.constants.F_OK),n=!0}catch{}if(!n)return t;let o=await YTe.default.readFile(r,{encoding:"utf8"}),s=/(?.*)/g.exec(o);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),d5o=a(async()=>`${await u5o()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,"powerShellPathFromWsl"),o8t=a(async()=>yQ?d5o():`${i8t.default.env.SYSTEMROOT||i8t.default.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,"powerShellPath")});function EQ(t,e,r){let n=a(o=>Object.defineProperty(t,e,{value:o,enumerable:!0,writable:!0}),"define");return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let o=r();return n(o),o},set(o){n(o)}}),t}var Uun=Se(()=>{p();a(EQ,"defineLazyProperty")});async function s8t(){if(qun.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await f5o("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var Qun,qun,jun,f5o,Hun=Se(()=>{p();Qun=require("node:util"),qun=fe(require("node:process"),1),jun=require("node:child_process"),f5o=(0,Qun.promisify)(jun.execFile);a(s8t,"defaultBrowserId")});async function Vun(t,{humanReadableOutput:e=!0}={}){if(Gun.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await p5o("osascript",["-e",t,r]);return n.trim()}var Gun,$un,a8t,p5o,Wun=Se(()=>{p();Gun=fe(require("node:process"),1),$un=require("node:util"),a8t=require("node:child_process"),p5o=(0,$un.promisify)(a8t.execFile);a(Vun,"runAppleScript")});async function c8t(t){return Vun(`tell application "Finder" to set app_path to application file id "${t}" as string +tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var zun=Se(()=>{p();Wun();a(c8t,"bundleName")});async function l8t(t=h5o){let{stdout:e}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?\S+)/.exec(e);if(!r)throw new O$e(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,o=m5o[n];if(!o)throw new O$e(`Unknown browser ID: ${n}`);return o}var Yun,Kun,h5o,m5o,O$e,Jun=Se(()=>{p();Yun=require("node:util"),Kun=require("node:child_process"),h5o=(0,Yun.promisify)(Kun.execFile),m5o={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"}},O$e=class extends Error{static{a(this,"UnknownBrowserError")}};a(l8t,"defaultBrowser")});async function u8t(){if(L$e.default.platform==="darwin"){let t=await s8t();return{name:await c8t(t),id:t}}if(L$e.default.platform==="linux"){let{stdout:t}=await g5o("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:A5o(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(L$e.default.platform==="win32")return l8t();throw new Error("Only macOS, Linux, and Windows are supported")}var Zun,L$e,Xun,g5o,A5o,edn=Se(()=>{p();Zun=require("node:util"),L$e=fe(require("node:process"),1),Xun=require("node:child_process");Hun();zun();Jun();g5o=(0,Zun.promisify)(Xun.execFile),A5o=a(t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),"titleize");a(u8t,"defaultBrowser")});var adn={};Ri(adn,{apps:()=>_Q,default:()=>JTe,openApp:()=>v5o});async function E5o(){let t=await o8t(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=p8t.Buffer.from(e,"utf16le").toString("base64"),{stdout:n}=await y5o(t,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",r],{encoding:"utf8"}),o=n.trim(),s={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return s[o]?{id:s[o]}:{}}function idn(t){if(typeof t=="string"||Array.isArray(t))return t;let{[rdn]:e}=t;if(!e)throw new Error(`${rdn} is not supported`);return e}function F$e({[ale]:t},{wsl:e}){if(e&&yQ)return idn(e);if(!t)throw new Error(`${ale} is not supported`);return idn(t)}var f8t,p8t,h8t,odn,sdn,m8t,B$e,y5o,d8t,tdn,ale,rdn,ndn,KTe,_5o,v5o,_Q,JTe,U$e=Se(()=>{p();f8t=fe(require("node:process"),1),p8t=require("node:buffer"),h8t=fe(require("node:path"),1),odn=require("node:url"),sdn=require("node:util"),m8t=fe(require("node:child_process"),1),B$e=fe(require("node:fs/promises"),1);Fun();Uun();edn();t8t();y5o=(0,sdn.promisify)(m8t.default.execFile),d8t=h8t.default.dirname((0,odn.fileURLToPath)(importMetaUrlShim)),tdn=h8t.default.join(d8t,"xdg-open"),{platform:ale,arch:rdn}=f8t.default;a(E5o,"getWindowsDefaultBrowserFromWsl");ndn=a(async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(o){r=o}throw r},"pTryEach"),KTe=a(async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return ndn(t.app,l=>KTe({...t,app:l}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return ndn(e,l=>KTe({...t,app:{name:l,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let l={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},d=yQ?await E5o():await u8t();if(d.id in l){let f=l[d.id];return e==="browserPrivate"&&r.push(u[f]),KTe({...t,app:{name:_Q[f],arguments:r}})}throw new Error(`${d.name} is not supported as a default browser`)}let n,o=[],s={};if(ale==="darwin")n="open",t.wait&&o.push("--wait-apps"),t.background&&o.push("--background"),t.newInstance&&o.push("--new"),e&&o.push("-a",e);else if(ale==="win32"||yQ&&!sle()&&!e){n=await o8t(),o.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),yQ||(s.windowsVerbatimArguments=!0);let l=["Start"];t.wait&&l.push("-Wait"),e?(l.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&l.push(`"${t.target}"`),r.length>0&&(r=r.map(u=>`"\`"${u}\`""`),l.push("-ArgumentList",r.join(","))),t.target=p8t.Buffer.from(l.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let l=!d8t||d8t==="/",u=!1;try{await B$e.default.access(tdn,B$e.constants.X_OK),u=!0}catch{}n=f8t.default.versions.electron??(ale==="android"||l||!u)?"xdg-open":tdn}r.length>0&&o.push(...r),t.wait||(s.stdio="ignore",s.detached=!0)}ale==="darwin"&&r.length>0&&o.push("--args",...r),t.target&&o.push(t.target);let c=m8t.default.spawn(n,o,s);return t.wait?new Promise((l,u)=>{c.once("error",u),c.once("close",d=>{if(!t.allowNonzeroExitCode&&d>0){u(new Error(`Exited with code ${d}`));return}l(c)})}):(c.unref(),c)},"baseOpen"),_5o=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return KTe({...e,target:t})},"open"),v5o=a((t,e)=>{if(typeof t!="string"&&!Array.isArray(t))throw new TypeError("Expected a valid `name`");let{arguments:r=[]}=e??{};if(r!=null&&!Array.isArray(r))throw new TypeError("Expected `appArguments` as Array type");return KTe({...e,app:{name:t,arguments:r}})},"openApp");a(idn,"detectArchBinary");a(F$e,"detectPlatformBinary");_Q={};EQ(_Q,"chrome",()=>F$e({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));EQ(_Q,"brave",()=>F$e({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));EQ(_Q,"firefox",()=>F$e({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));EQ(_Q,"edge",()=>F$e({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));EQ(_Q,"browser",()=>"browser");EQ(_Q,"browserPrivate",()=>"browserPrivate");JTe=_5o});var U8t=I((gku,ffn)=>{"use strict";p();ffn.exports=a(function(e,r){r===!0&&(r=0);var n="";if(typeof e=="string")try{n=new URL(e).protocol}catch{}else e&&e.constructor===URL&&(n=e.protocol);var o=n.split(/\:|\+/).filter(Boolean);return typeof r=="number"?o[r]:o},"protocols")});var hfn=I((Eku,pfn)=>{"use strict";p();var RBo=U8t();function kBo(t){var e={protocols:[],protocol:null,port:null,resource:"",host:"",user:"",password:"",pathname:"",hash:"",search:"",href:t,query:{},parse_failed:!1};try{var r=new URL(t);e.protocols=RBo(r),e.protocol=e.protocols[0],e.port=r.port,e.resource=r.hostname,e.host=r.host,e.user=r.username||"",e.password=r.password||"",e.pathname=r.pathname,e.hash=r.hash.slice(1),e.search=r.search.slice(1),e.href=r.href,e.query=Object.fromEntries(r.searchParams)}catch{e.protocols=["file"],e.protocol=e.protocols[0],e.port="",e.resource="",e.user="",e.pathname="",e.hash="",e.search="",e.href=t,e.query={},e.parse_failed=!0}return e}a(kBo,"parsePath");pfn.exports=kBo});var _fn=I((Cku,Efn)=>{"use strict";p();var PBo=hfn();function DBo(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}a(DBo,"_interopDefaultLegacy");var NBo=DBo(PBo);function MBo(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=a(function n(){if(this instanceof n){var o=[null];o.push.apply(o,arguments);var s=Function.bind.apply(e,o);return new s}return e.apply(this,arguments)},"a");r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:a(function(){return t[n]},"get")})}),r}a(MBo,"getAugmentedNamespace");var gfn={},OBo="text/plain",LBo="us-ascii",mfn=a((t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),"testParameter"),BBo=a((t,{stripHash:e})=>{let r=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(t);if(!r)throw new Error(`Invalid URL: ${t}`);let{type:n,data:o,hash:s}=r.groups,c=n.split(";");s=e?"":s;let l=!1;c[c.length-1]==="base64"&&(c.pop(),l=!0);let u=(c.shift()||"").toLowerCase(),f=[...c.map(h=>{let[m,g=""]=h.split("=").map(A=>A.trim());return m==="charset"&&(g=g.toLowerCase(),g===LBo)?"":`${m}${g?`=${g}`:""}`}).filter(Boolean)];return l&&f.push("base64"),(f.length>0||u&&u!==OBo)&&f.unshift(u),`data:${f.join(";")},${l?o.trim():o}${s?`#${s}`:""}`},"normalizeDataURL");function FBo(t,e){if(e={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},t=t.trim(),/^data:/i.test(t))return BBo(t,e);if(/^view-source:/i.test(t))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let o=new URL(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&o.protocol==="https:"&&(o.protocol="http:"),e.forceHttps&&o.protocol==="http:"&&(o.protocol="https:"),e.stripAuthentication&&(o.username="",o.password=""),e.stripHash?o.hash="":e.stripTextFragment&&(o.hash=o.hash.replace(/#?:~:text.*?$/i,"")),o.pathname){let c=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,l=0,u="";for(;;){let f=c.exec(o.pathname);if(!f)break;let h=f[0],m=f.index,g=o.pathname.slice(l,m);u+=g.replace(/\/{2,}/g,"/"),u+=h,l=m+h.length}let d=o.pathname.slice(l,o.pathname.length);u+=d.replace(/\/{2,}/g,"/"),o.pathname=u}if(o.pathname)try{o.pathname=decodeURI(o.pathname)}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let c=o.pathname.split("/"),l=c[c.length-1];mfn(l,e.removeDirectoryIndex)&&(c=c.slice(0,-1),o.pathname=c.slice(1).join("/")+"/")}if(o.hostname&&(o.hostname=o.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(o.hostname)&&(o.hostname=o.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let c of[...o.searchParams.keys()])mfn(c,e.removeQueryParameters)&&o.searchParams.delete(c);if(e.removeQueryParameters===!0&&(o.search=""),e.sortQueryParameters){o.searchParams.sort();try{o.search=decodeURIComponent(o.search)}catch{}}e.removeTrailingSlash&&(o.pathname=o.pathname.replace(/\/$/,""));let s=t;return t=o.toString(),!e.removeSingleSlash&&o.pathname==="/"&&!s.endsWith("/")&&o.hash===""&&(t=t.replace(/\/$/,"")),(e.removeTrailingSlash||o.pathname==="/")&&o.hash===""&&e.removeSingleSlash&&(t=t.replace(/\/$/,"")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t}a(FBo,"normalizeUrl");var UBo=Object.freeze({__proto__:null,default:FBo}),QBo=MBo(UBo);Object.defineProperty(gfn,"__esModule",{value:!0});var qBo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jBo=QBo,HBo=Afn(jBo),GBo=NBo.default,$Bo=Afn(GBo);function Afn(t){return t&&t.__esModule?t:{default:t}}a(Afn,"_interopRequireDefault");var yfn=a(function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=/^(?:([a-zA-Z_][a-zA-Z0-9_-]{0,31})@|https?:\/\/)([\w\.\-@]+)[\/:](([\~,\.\w,\-,\_,\/,\s]|%[0-9A-Fa-f]{2})+?(?:\.git|\/)?)$/,o=a(function(u){var d=new Error(u);throw d.subject_url=e,d},"throwErr");(typeof e!="string"||!e.trim())&&o("Invalid url."),e.length>t.MAX_INPUT_LENGTH&&o("Input exceeds maximum length. If needed, change the value of parseUrl.MAX_INPUT_LENGTH."),r&&((typeof r>"u"?"undefined":qBo(r))!=="object"&&(r={stripHash:!1}),e=(0,HBo.default)(e,r));var s=(0,$Bo.default)(e);if(s.parse_failed){var c=s.href.match(n);c?(s.protocols=["ssh"],s.protocol="ssh",s.resource=c[2],s.host=c[2],s.user=c[1],s.pathname="/"+c[3],s.parse_failed=!1):o("URL parsing failed.")}return s},"parseUrl");yfn.MAX_INPUT_LENGTH=2048;var VBo=gfn.default=yfn;Efn.exports=VBo});var bfn=I((Tku,Cfn)=>{"use strict";p();var WBo=U8t();function vfn(t){if(Array.isArray(t))return t.indexOf("ssh")!==-1||t.indexOf("rsync")!==-1;if(typeof t!="string")return!1;var e=WBo(t);if(t=t.substring(t.indexOf("://")+3),vfn(e))return!0;var r=new RegExp(".([a-zA-Z\\d]+):(\\d+)/");return!t.match(r)&&t.indexOf("@"){"use strict";p();var zBo=_fn(),Sfn=bfn();function YBo(t){let e=zBo(t);return e.token="",e.password==="x-oauth-basic"?e.token=e.user:e.user==="x-token-auth"&&(e.token=e.password),Sfn(e.protocols)||e.protocols.length===0&&Sfn(t)?e.protocol="ssh":e.protocols.length?e.protocol=e.protocols[0]:(e.protocol="file",e.protocols=["file"]),e.href=e.href.replace(/\/$/,""),e}a(YBo,"gitUp");Tfn.exports=YBo});var wfn=I((Pku,xfn)=>{"use strict";p();var KBo=Ifn();function Q8t(t,e){if(e=e||[],typeof t!="string")throw new Error("The url must be a string.");if(!e.every(function(v){return typeof v=="string"}))throw new Error("The refs should contain only strings");var r=/^([a-z\d-]{1,39})\/([-\.\w]{1,100})$/i;r.test(t)&&(t="https://github.com/"+t);var n=KBo(t),o=n.resource.split("."),s=null;switch(n.toString=function(v){return Q8t.stringify(this,v)},n.source=o.length>2?o.slice(1-o.length).join("."):n.source=n.resource,n.git_suffix=/\.git$/.test(n.pathname),n.name=decodeURIComponent((n.pathname||n.href).replace(/(^\/)|(\/$)/g,"").replace(/\.git$/,"")),n.owner=decodeURIComponent(n.user),n.source){case"git.cloudforge.com":n.owner=n.user,n.organization=o[0],n.source="cloudforge.com";break;case"visualstudio.com":if(n.resource==="vs-ssh.visualstudio.com"){s=n.name.split("/"),s.length===4&&(n.organization=s[1],n.owner=s[2],n.name=s[3],n.full_name=s[2]+"/"+s[3]);break}else{s=n.name.split("/"),s.length===2?(n.owner=s[1],n.name=s[1],n.full_name="_git/"+n.name):s.length===3?(n.name=s[2],s[0]==="DefaultCollection"?(n.owner=s[2],n.organization=s[0],n.full_name=n.organization+"/_git/"+n.name):(n.owner=s[0],n.full_name=n.owner+"/_git/"+n.name)):s.length===4&&(n.organization=s[0],n.owner=s[1],n.name=s[3],n.full_name=n.organization+"/"+n.owner+"/_git/"+n.name);break}case"dev.azure.com":case"azure.com":if(n.resource==="ssh.dev.azure.com"){s=n.name.split("/"),s.length===4&&(n.organization=s[1],n.owner=s[2],n.name=s[3]);break}else{s=n.name.split("/"),s.length===5?(n.organization=s[0],n.owner=s[1],n.name=s[4],n.full_name="_git/"+n.name):s.length===3?(n.name=s[2],s[0]==="DefaultCollection"?(n.owner=s[2],n.organization=s[0],n.full_name=n.organization+"/_git/"+n.name):(n.owner=s[0],n.full_name=n.owner+"/_git/"+n.name)):s.length===4&&(n.organization=s[0],n.owner=s[1],n.name=s[3],n.full_name=n.organization+"/"+n.owner+"/_git/"+n.name),n.query&&n.query.path&&(n.filepath=n.query.path.replace(/^\/+/g,"")),n.query&&n.query.version&&(n.ref=n.query.version.replace(/^GB/,""));break}default:s=n.name.split("/");var c=s.length-1;if(s.length>=2){var l=s.indexOf("-",2),u=s.indexOf("blob",2),d=s.indexOf("tree",2),f=s.indexOf("commit",2),h=s.indexOf("issues",2),m=s.indexOf("src",2),g=s.indexOf("raw",2),A=s.indexOf("edit",2);c=l>0?l-1:u>0&&d>0?Math.min(u-1,d-1):u>0?u-1:h>0?h-1:d>0?d-1:f>0?f-1:m>0?m-1:g>0?g-1:A>0?A-1:c,n.owner=s.slice(0,c).join("/"),n.name=s[c],f&&h<0&&(n.commit=s[c+2])}n.ref="",n.filepathtype="",n.filepath="";var y=s.length>c&&s[c+1]==="-"?c+1:c;s.length>y+2&&["raw","src","blob","tree","edit"].indexOf(s[y+1])>=0&&(n.filepathtype=s[y+1],n.ref=s[y+2],s.length>y+3&&(n.filepath=s.slice(y+3).join("/"))),n.organization=n.owner;break}n.full_name||(n.full_name=n.owner,n.name&&(n.full_name&&(n.full_name+="/"),n.full_name+=n.name)),n.owner.startsWith("scm/")&&(n.source="bitbucket-server",n.owner=n.owner.replace("scm/",""),n.organization=n.owner,n.full_name=n.owner+"/"+n.name);var E=/(projects|users)\/(.*?)\/repos\/(.*?)((\/.*$)|$)/,_=E.exec(n.pathname);return _!=null&&(n.source="bitbucket-server",_[1]==="users"?n.owner="~"+_[2]:n.owner=_[2],n.organization=n.owner,n.name=_[3],s=_[4].split("/"),s.length>1&&(["raw","browse"].indexOf(s[1])>=0?(n.filepathtype=s[1],s.length>2&&(n.filepath=s.slice(2).join("/"))):s[1]==="commits"&&s.length>2&&(n.commit=s[2])),n.full_name=n.owner+"/"+n.name,n.query.at?n.ref=n.query.at:n.ref=""),e.length!==0&&n.ref&&(n.ref=XBo(n.href,e)||n.ref,n.filepath=n.href.split(n.ref+"/")[1]),n}a(Q8t,"gitUrlParse");Q8t.stringify=function(t,e){e=e||(t.protocols&&t.protocols.length?t.protocols.join("+"):t.protocol);var r=t.port?":"+t.port:"",n=t.user||"git",o=t.git_suffix?".git":"";switch(e){case"ssh":return r?"ssh://"+n+"@"+t.resource+r+"/"+t.full_name+o:n+"@"+t.resource+":"+t.full_name+o;case"git+ssh":case"ssh+git":case"ftp":case"ftps":return e+"://"+n+"@"+t.resource+r+"/"+t.full_name+o;case"http":case"https":var s=t.token?JBo(t):t.user&&(t.protocols.includes("http")||t.protocols.includes("https"))?t.user+"@":"";return e+"://"+s+t.resource+r+"/"+ZBo(t)+o;default:return t.href}};function JBo(t){return t.source==="bitbucket.org"?"x-token-auth:"+t.token+"@":t.token+"@"}a(JBo,"buildToken");function ZBo(t){if(t.source==="bitbucket-server")return"scm/"+t.full_name;var e=t.full_name.split("/").map(function(r){return encodeURIComponent(r)}).join("/");return e}a(ZBo,"buildPath");function XBo(t,e){var r="";return e.forEach(function(n){t.includes(n)&&n.length>r.length&&(r=n)}),r}a(XBo,"findLongestMatchingSubstring");xfn.exports=Q8t});var mle=I((exports,module)=>{p();var Module=typeof Module<"u"?Module:{},ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",TreeSitter=(function(){var initPromise,document=typeof window=="object"?{currentScript:window.document.currentScript}:null;class Parser{static{a(this,"Parser")}constructor(){this.initialize()}initialize(){throw new Error("cannot construct a Parser before calling `init()`")}static init(moduleOptions){return initPromise||(Module=Object.assign({},Module,moduleOptions),initPromise=new Promise(resolveInitPromise=>{var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=a((t,e)=>{throw e},"quit_"),scriptDirectory="";function locateFile(t){return Module.locateFile?Module.locateFile(t,scriptDirectory):scriptDirectory+t}a(locateFile,"locateFile");var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs"),nodePath=require("path");scriptDirectory=__dirname+"/",readBinary=a(t=>{t=isFileURI(t)?new URL(t):nodePath.normalize(t);var e=fs.readFileSync(t);return e},"readBinary"),readAsync=a((t,e=!0)=>(t=isFileURI(t)?new URL(t):nodePath.normalize(t),new Promise((r,n)=>{fs.readFile(t,e?void 0:"utf8",(o,s)=>{o?n(o):r(e?s.buffer:s)})})),"readAsync"),!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),typeof module<"u"&&(module.exports=Module),quit_=a((t,e)=>{throw process.exitCode=t,e},"quit_")}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:typeof document<"u"&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory.startsWith("blob:")?scriptDirectory="":scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),ENVIRONMENT_IS_WORKER&&(readBinary=a(t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)},"readBinary")),readAsync=a(t=>isFileURI(t)?new Promise((e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{(n.status==200||n.status==0&&n.response)&&r(n.response),e(n.status)},n.onerror=e,n.send(null)}):fetch(t,{credentials:"same-origin"}).then(e=>e.ok?e.arrayBuffer():Promise.reject(new Error(e.status+" : "+e.url))),"readAsync"));var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary;Module.wasmBinary&&(wasmBinary=Module.wasmBinary);var wasmMemory,ABORT=!1,EXITSTATUS,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP_DATA_VIEW;function updateMemoryViews(){var t=wasmMemory.buffer;Module.HEAP_DATA_VIEW=HEAP_DATA_VIEW=new DataView(t),Module.HEAP8=HEAP8=new Int8Array(t),Module.HEAP16=HEAP16=new Int16Array(t),Module.HEAPU8=HEAPU8=new Uint8Array(t),Module.HEAPU16=HEAPU16=new Uint16Array(t),Module.HEAP32=HEAP32=new Int32Array(t),Module.HEAPU32=HEAPU32=new Uint32Array(t),Module.HEAPF32=HEAPF32=new Float32Array(t),Module.HEAPF64=HEAPF64=new Float64Array(t)}if(a(updateMemoryViews,"updateMemoryViews"),Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:2147483648/65536})}updateMemoryViews();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}a(preRun,"preRun");function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),callRuntimeCallbacks(__ATINIT__)}a(initRuntime,"initRuntime");function preMain(){callRuntimeCallbacks(__ATMAIN__)}a(preMain,"preMain");function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}a(postRun,"postRun");function addOnPreRun(t){__ATPRERUN__.unshift(t)}a(addOnPreRun,"addOnPreRun");function addOnInit(t){__ATINIT__.unshift(t)}a(addOnInit,"addOnInit");function addOnPostRun(t){__ATPOSTRUN__.unshift(t)}a(addOnPostRun,"addOnPostRun");var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(t){return t}a(getUniqueRunDependency,"getUniqueRunDependency");function addRunDependency(t){runDependencies++,Module.monitorRunDependencies?.(runDependencies)}a(addRunDependency,"addRunDependency");function removeRunDependency(t){if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var e=dependenciesFulfilled;dependenciesFulfilled=null,e()}}a(removeRunDependency,"removeRunDependency");function abort(t){Module.onAbort?.(t),t="Aborted("+t+")",err(t),ABORT=!0,EXITSTATUS=1,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw e}a(abort,"abort");var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=a(t=>t.startsWith(dataURIPrefix),"isDataURI"),isFileURI=a(t=>t.startsWith("file://"),"isFileURI");function findWasmBinary(){var t="tree-sitter.wasm";return isDataURI(t)?t:locateFile(t)}a(findWasmBinary,"findWasmBinary");var wasmBinaryFile;function getBinarySync(t){if(t==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(t);throw"both async and sync fetching of the wasm failed"}a(getBinarySync,"getBinarySync");function getBinaryPromise(t){return wasmBinary?Promise.resolve().then(()=>getBinarySync(t)):readAsync(t).then(e=>new Uint8Array(e),()=>getBinarySync(t))}a(getBinaryPromise,"getBinaryPromise");function instantiateArrayBuffer(t,e,r){return getBinaryPromise(t).then(n=>WebAssembly.instantiate(n,e)).then(r,n=>{err(`failed to asynchronously prepare wasm: ${n}`),abort(n)})}a(instantiateArrayBuffer,"instantiateArrayBuffer");function instantiateAsync(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(e)&&!isFileURI(e)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(o=>{var s=WebAssembly.instantiateStreaming(o,r);return s.then(n,function(c){return err(`wasm streaming compile failed: ${c}`),err("falling back to ArrayBuffer instantiation"),instantiateArrayBuffer(e,r,n)})}):instantiateArrayBuffer(e,r,n)}a(instantiateAsync,"instantiateAsync");function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}a(getWasmImports,"getWasmImports");function createWasm(){var t=getWasmImports();function e(n,o){wasmExports=n.exports,wasmExports=relocateExports(wasmExports,1024);var s=getDylinkMetadata(o);return s.neededDynlibs&&(dynamicLibraries=s.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency("wasm-instantiate"),wasmExports}a(e,"receiveInstance"),addRunDependency("wasm-instantiate");function r(n){e(n.instance,n.module)}if(a(r,"receiveInstantiationResult"),Module.instantiateWasm)try{return Module.instantiateWasm(t,e)}catch(n){return err(`Module.instantiateWasm callback failed with error: ${n}`),!1}return wasmBinaryFile||(wasmBinaryFile=findWasmBinary()),instantiateAsync(wasmBinary,wasmBinaryFile,t,r),{}}a(createWasm,"createWasm");var ASM_CONSTS={};function ExitStatus(t){this.name="ExitStatus",this.message=`Program terminated with exit(${t})`,this.status=t}a(ExitStatus,"ExitStatus");var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(t,e){var r=GOT[e];return r||(r=GOT[e]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(e)||(r.required=!0),r}},LE_HEAP_LOAD_F32=a(t=>HEAP_DATA_VIEW.getFloat32(t,!0),"LE_HEAP_LOAD_F32"),LE_HEAP_LOAD_F64=a(t=>HEAP_DATA_VIEW.getFloat64(t,!0),"LE_HEAP_LOAD_F64"),LE_HEAP_LOAD_I16=a(t=>HEAP_DATA_VIEW.getInt16(t,!0),"LE_HEAP_LOAD_I16"),LE_HEAP_LOAD_I32=a(t=>HEAP_DATA_VIEW.getInt32(t,!0),"LE_HEAP_LOAD_I32"),LE_HEAP_LOAD_U32=a(t=>HEAP_DATA_VIEW.getUint32(t,!0),"LE_HEAP_LOAD_U32"),LE_HEAP_STORE_F32=a((t,e)=>HEAP_DATA_VIEW.setFloat32(t,e,!0),"LE_HEAP_STORE_F32"),LE_HEAP_STORE_F64=a((t,e)=>HEAP_DATA_VIEW.setFloat64(t,e,!0),"LE_HEAP_STORE_F64"),LE_HEAP_STORE_I16=a((t,e)=>HEAP_DATA_VIEW.setInt16(t,e,!0),"LE_HEAP_STORE_I16"),LE_HEAP_STORE_I32=a((t,e)=>HEAP_DATA_VIEW.setInt32(t,e,!0),"LE_HEAP_STORE_I32"),LE_HEAP_STORE_U32=a((t,e)=>HEAP_DATA_VIEW.setUint32(t,e,!0),"LE_HEAP_STORE_U32"),callRuntimeCallbacks=a(t=>{for(;t.length>0;)t.shift()(Module)},"callRuntimeCallbacks"),UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=a((t,e,r)=>{for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&UTF8Decoder)return UTF8Decoder.decode(t.subarray(e,o));for(var s="";e>10,56320|d&1023)}}return s},"UTF8ArrayToString"),getDylinkMetadata=a(t=>{var e=0,r=0;function n(){return t[e++]}a(n,"getU8");function o(){for(var j=0,M=1;;){var O=t[e++];if(j+=(O&127)*M,M*=128,!(O&128))break}return j}a(o,"getLEB");function s(){var j=o();return e+=j,UTF8ArrayToString(t,e-j,j)}a(s,"getString");function c(j,M){if(j)throw new Error(M)}a(c,"failIf");var l="dylink.0";if(t instanceof WebAssembly.Module){var u=WebAssembly.Module.customSections(t,l);u.length===0&&(l="dylink",u=WebAssembly.Module.customSections(t,l)),c(u.length===0,"need dylink section"),t=new Uint8Array(u[0]),r=t.length}else{var d=new Uint32Array(new Uint8Array(t.subarray(0,24)).buffer),f=d[0]==1836278016||d[0]==6386541;c(!f,"need to see wasm magic number"),c(t[8]!==0,"need the dylink section to be first"),e=9;var h=o();r=e+h,l=s()}var m={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(l=="dylink"){m.memorySize=o(),m.memoryAlign=o(),m.tableSize=o(),m.tableAlign=o();for(var g=o(),A=0;A>1)*2);case"i32":return LE_HEAP_LOAD_I32((t>>2)*4);case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return LE_HEAP_LOAD_F32((t>>2)*4);case"double":return LE_HEAP_LOAD_F64((t>>3)*8);case"*":return LE_HEAP_LOAD_U32((t>>2)*4);default:abort(`invalid type for getValue: ${e}`)}}a(getValue,"getValue");var newDSO=a((t,e,r)=>{var n={refcount:1/0,name:t,exports:r,global:!0};return LDSO.loadedLibsByName[t]=n,e!=null&&(LDSO.loadedLibsByHandle[e]=n),n},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=78112,zeroMemory=a((t,e)=>(HEAPU8.fill(0,t,t+e),t),"zeroMemory"),alignMemory=a((t,e)=>Math.ceil(t/e)*e,"alignMemory"),getMemory=a(t=>{if(runtimeInitialized)return zeroMemory(_malloc(t),t);var e=___heap_base,r=e+alignMemory(t,16);return ___heap_base=r,GOT.__heap_base.value=r,e},"getMemory"),isInternalSym=a(t=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(t)||t.startsWith("__em_js__"),"isInternalSym"),uleb128Encode=a((t,e)=>{t<128?e.push(t):e.push(t%128|128,t>>7)},"uleb128Encode"),sigToWasmTypes=a(t=>{for(var e={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},r={parameters:[],results:t[0]=="v"?[]:[e[t[0]]]},n=1;n{var r=t.slice(0,1),n=t.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111};e.push(96),uleb128Encode(n.length,e);for(var s=0;s{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(e),t);var r=[1];generateFuncType(e,r);var n=[0,97,115,109,1,0,0,0,1];uleb128Encode(r.length,n),n.push(...r),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var o=new WebAssembly.Module(new Uint8Array(n)),s=new WebAssembly.Instance(o,{e:{f:t}}),c=s.exports.f;return c},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:28,element:"anyfunc"}),getWasmTableEntry=a(t=>{var e=wasmTableMirror[t];return e||(t>=wasmTableMirror.length&&(wasmTableMirror.length=t+1),wasmTableMirror[t]=e=wasmTable.get(t)),e},"getWasmTableEntry"),updateTableMap=a((t,e)=>{if(functionsInTableMap)for(var r=t;r(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(t)||0),"getFunctionAddress"),freeTableIndexes=[],getEmptyTableSlot=a(()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(t){throw t instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":t}return wasmTable.length-1},"getEmptyTableSlot"),setWasmTableEntry=a((t,e)=>{wasmTable.set(t,e),wasmTableMirror[t]=wasmTable.get(t)},"setWasmTableEntry"),addFunction=a((t,e)=>{var r=getFunctionAddress(t);if(r)return r;var n=getEmptyTableSlot();try{setWasmTableEntry(n,t)}catch(s){if(!(s instanceof TypeError))throw s;var o=convertJsFunctionToWasm(t,e);setWasmTableEntry(n,o)}return functionsInTableMap.set(t,n),n},"addFunction"),updateGOT=a((t,e)=>{for(var r in t)if(!isInternalSym(r)){var n=t[r];r.startsWith("orig$")&&(r=r.split("$")[1],e=!0),GOT[r]||=new WebAssembly.Global({value:"i32",mutable:!0}),(e||GOT[r].value==0)&&(typeof n=="function"?GOT[r].value=addFunction(n):typeof n=="number"?GOT[r].value=n:err(`unhandled export type for '${r}': ${typeof n}`))}},"updateGOT"),relocateExports=a((t,e,r)=>{var n={};for(var o in t){var s=t[o];typeof s=="object"&&(s=s.value),typeof s=="number"&&(s+=e),n[o]=s}return updateGOT(n,r),n},"relocateExports"),isSymbolDefined=a(t=>{var e=wasmImports[t];return!(!e||e.stub)},"isSymbolDefined"),dynCallLegacy=a((t,e,r)=>{t=t.replace(/p/g,"i");var n=Module["dynCall_"+t];return n(e,...r)},"dynCallLegacy"),dynCall=a((t,e,r=[])=>{if(t.includes("j"))return dynCallLegacy(t,e,r);var n=getWasmTableEntry(e)(...r);return n},"dynCall"),stackSave=a(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=a(t=>__emscripten_stack_restore(t),"stackRestore"),createInvokeFunction=a(t=>(e,...r)=>{var n=stackSave();try{return dynCall(t,e,r)}catch(o){if(stackRestore(n),o!==o+0)throw o;_setThrew(1,0)}},"createInvokeFunction"),resolveGlobalSymbol=a((t,e=!1)=>{var r;return e&&"orig$"+t in wasmImports&&(t="orig$"+t),isSymbolDefined(t)?r=wasmImports[t]:t.startsWith("invoke_")&&(r=wasmImports[t]=createInvokeFunction(t.split("_")[1])),{sym:r,name:t}},"resolveGlobalSymbol"),UTF8ToString=a((t,e)=>t?UTF8ArrayToString(HEAPU8,t,e):"","UTF8ToString"),loadWebAssemblyModule=a((binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,LE_HEAP_STORE_U32((handle+12>>2)*4,memoryBase),LE_HEAP_STORE_I32((handle+16>>2)*4,metadata.memorySize),LE_HEAP_STORE_U32((handle+20>>2)*4,tableBase),LE_HEAP_STORE_I32((handle+24>>2)*4,metadata.tableSize))}else memoryBase=LE_HEAP_LOAD_U32((handle+12>>2)*4),tableBase=LE_HEAP_LOAD_U32((handle+20>>2)*4);var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var moduleExports;function resolveSymbol(t){var e=resolveGlobalSymbol(t).sym;return!e&&localScope&&(e=localScope[t]),e||(e=moduleExports[t]),e}a(resolveSymbol,"resolveSymbol");var proxyHandler={get(t,e){switch(e){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(e in wasmImports&&!wasmImports[e].stub)return wasmImports[e];if(!(e in t)){var r;t[e]=(...n)=>(r||=resolveSymbol(e),r(...n))}return t[e]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(a(addEmAsm,"addEmAsm"),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start ${body};`;moduleExports[name]=eval(func)}a(addEmJs,"addEmJs");for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(a(postInstantiation,"postInstantiation"),flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(t=>postInstantiation(t.module,t.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return a(loadModule,"loadModule"),flags.loadAsync?metadata.neededDynlibs.reduce((t,e)=>t.then(()=>loadDynamicLibrary(e,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(t=>loadDynamicLibrary(t,flags,localScope)),loadModule())},"loadWebAssemblyModule"),mergeLibSymbols=a((t,e)=>{for(var[r,n]of Object.entries(t)){let o=a(c=>{isSymbolDefined(c)||(wasmImports[c]=n)},"setImport");o(r);let s="__main_argc_argv";r=="main"&&o(s),r==s&&o("main"),r.startsWith("dynCall_")&&!Module.hasOwnProperty(r)&&(Module[r]=n)}},"mergeLibSymbols"),asyncLoad=a((t,e,r,n)=>{var o=n?"":`al ${t}`;readAsync(t).then(s=>{e(new Uint8Array(s)),o&&removeRunDependency(o)},s=>{if(r)r();else throw`Loading data file "${t}" failed.`}),o&&addRunDependency(o)},"asyncLoad");function loadDynamicLibrary(t,e={global:!0,nodelete:!0},r,n){var o=LDSO.loadedLibsByName[t];if(o)return e.global?o.global||(o.global=!0,mergeLibSymbols(o.exports,t)):r&&Object.assign(r,o.exports),e.nodelete&&o.refcount!==1/0&&(o.refcount=1/0),o.refcount++,n&&(LDSO.loadedLibsByHandle[n]=o),e.loadAsync?Promise.resolve(!0):!0;o=newDSO(t,n,"loading"),o.refcount=e.nodelete?1/0:1,o.global=e.global;function s(){if(n){var u=LE_HEAP_LOAD_U32((n+28>>2)*4),d=LE_HEAP_LOAD_U32((n+32>>2)*4);if(u&&d){var f=HEAP8.slice(u,u+d);return e.loadAsync?Promise.resolve(f):f}}var h=locateFile(t);if(e.loadAsync)return new Promise(function(m,g){asyncLoad(h,m,g)});if(!readBinary)throw new Error(`${h}: file not found, and synchronous loading of external files is not available`);return readBinary(h)}a(s,"loadLibData");function c(){return e.loadAsync?s().then(u=>loadWebAssemblyModule(u,e,t,r,n)):loadWebAssemblyModule(s(),e,t,r,n)}a(c,"getExports");function l(u){o.global?mergeLibSymbols(u,t):r&&Object.assign(r,u),o.exports=u}return a(l,"moduleLoaded"),e.loadAsync?c().then(u=>(l(u),!0)):(l(c()),!0)}a(loadDynamicLibrary,"loadDynamicLibrary");var reportUndefinedSymbols=a(()=>{for(var[t,e]of Object.entries(GOT))if(e.value==0){var r=resolveGlobalSymbol(t,!0).sym;if(!r&&!e.required)continue;if(typeof r=="function")e.value=addFunction(r,r.sig);else if(typeof r=="number")e.value=r;else throw new Error(`bad export type for '${t}': ${typeof r}`)}},"reportUndefinedSymbols"),loadDylibs=a(()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs"),dynamicLibraries.reduce((t,e)=>t.then(()=>loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency("loadDylibs")})},"loadDylibs"),noExitRuntime=Module.noExitRuntime||!0;function setValue(t,e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":HEAP8[t]=e;break;case"i8":HEAP8[t]=e;break;case"i16":LE_HEAP_STORE_I16((t>>1)*2,e);break;case"i32":LE_HEAP_STORE_I32((t>>2)*4,e);break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":LE_HEAP_STORE_F32((t>>2)*4,e);break;case"double":LE_HEAP_STORE_F64((t>>3)*8,e);break;case"*":LE_HEAP_STORE_U32((t>>2)*4,e);break;default:abort(`invalid type for setValue: ${r}`)}}a(setValue,"setValue");var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78112),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=a(()=>{abort("")},"__abort_js");__abort_js.sig="v";var nowIsMonotonic=1,__emscripten_get_now_is_monotonic=a(()=>nowIsMonotonic,"__emscripten_get_now_is_monotonic");__emscripten_get_now_is_monotonic.sig="i";var __emscripten_memcpy_js=a((t,e,r)=>HEAPU8.copyWithin(t,e,e+r),"__emscripten_memcpy_js");__emscripten_memcpy_js.sig="vppp";var _emscripten_date_now=a(()=>Date.now(),"_emscripten_date_now");_emscripten_date_now.sig="d";var _emscripten_get_now;_emscripten_get_now=a(()=>performance.now(),"_emscripten_get_now"),_emscripten_get_now.sig="d";var getHeapMax=a(()=>2147483648,"getHeapMax"),growMemory=a(t=>{var e=wasmMemory.buffer,r=(t-e.byteLength+65535)/65536;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch{}},"growMemory"),_emscripten_resize_heap=a(t=>{var e=HEAPU8.length;t>>>=0;var r=getHeapMax();if(t>r)return!1;for(var n=a((u,d)=>u+(d-u%d)%d,"alignUp"),o=1;o<=4;o*=2){var s=e*(1+.2/o);s=Math.min(s,t+100663296);var c=Math.min(r,n(Math.max(t,s),65536)),l=growMemory(c);if(l)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";var _fd_close=a(t=>52,"_fd_close");_fd_close.sig="ii";var convertI32PairToI53Checked=a((t,e)=>e+2097152>>>0<4194305-!!t?(t>>>0)+e*4294967296:NaN,"convertI32PairToI53Checked");function _fd_seek(t,e,r,n,o){var s=convertI32PairToI53Checked(e,r);return 70}a(_fd_seek,"_fd_seek"),_fd_seek.sig="iiiiip";var printCharBuffers=[null,[],[]],printChar=a((t,e)=>{var r=printCharBuffers[t];e===0||e===10?((t===1?out:err)(UTF8ArrayToString(r,0)),r.length=0):r.push(e)},"printChar"),_fd_write=a((t,e,r,n)=>{for(var o=0,s=0;s>2)*4),l=LE_HEAP_LOAD_U32((e+4>>2)*4);e+=8;for(var u=0;u>2)*4,o),0},"_fd_write");_fd_write.sig="iippp";function _tree_sitter_log_callback(t,e){if(currentLogCallback){let r=UTF8ToString(e);currentLogCallback(r,t!==0)}}a(_tree_sitter_log_callback,"_tree_sitter_log_callback");function _tree_sitter_parse_callback(t,e,r,n,o){let c=currentParseCallback(e,{row:r,column:n});typeof c=="string"?(setValue(o,c.length,"i32"),stringToUTF16(c,t,10240)):setValue(o,0,"i32")}a(_tree_sitter_parse_callback,"_tree_sitter_parse_callback");var runtimeKeepaliveCounter=0,keepRuntimeAlive=a(()=>noExitRuntime||runtimeKeepaliveCounter>0,"keepRuntimeAlive"),_proc_exit=a(t=>{EXITSTATUS=t,keepRuntimeAlive()||(Module.onExit?.(t),ABORT=!0),quit_(t,new ExitStatus(t))},"_proc_exit");_proc_exit.sig="vi";var exitJS=a((t,e)=>{EXITSTATUS=t,_proc_exit(t)},"exitJS"),handleException=a(t=>{if(t instanceof ExitStatus||t=="unwind")return EXITSTATUS;quit_(1,t)},"handleException"),lengthBytesUTF8=a(t=>{for(var e=0,r=0;r=55296&&n<=57343?(e+=4,++r):e+=3}return e},"lengthBytesUTF8"),stringToUTF8Array=a((t,e,r,n)=>{if(!(n>0))return 0;for(var o=r,s=r+n-1,c=0;c=55296&&l<=57343){var u=t.charCodeAt(++c);l=65536+((l&1023)<<10)|u&1023}if(l<=127){if(r>=s)break;e[r++]=l}else if(l<=2047){if(r+1>=s)break;e[r++]=192|l>>6,e[r++]=128|l&63}else if(l<=65535){if(r+2>=s)break;e[r++]=224|l>>12,e[r++]=128|l>>6&63,e[r++]=128|l&63}else{if(r+3>=s)break;e[r++]=240|l>>18,e[r++]=128|l>>12&63,e[r++]=128|l>>6&63,e[r++]=128|l&63}}return e[r]=0,r-o},"stringToUTF8Array"),stringToUTF8=a((t,e,r)=>stringToUTF8Array(t,HEAPU8,e,r),"stringToUTF8"),stackAlloc=a(t=>__emscripten_stack_alloc(t),"stackAlloc"),stringToUTF8OnStack=a(t=>{var e=lengthBytesUTF8(t)+1,r=stackAlloc(e);return stringToUTF8(t,r,e),r},"stringToUTF8OnStack"),stringToUTF16=a((t,e,r)=>{if(r??=2147483647,r<2)return 0;r-=2;for(var n=e,o=r>1)*2,c),e+=2}return LE_HEAP_STORE_I16((e>>1)*2,0),e-n},"stringToUTF16"),AsciiToString=a(t=>{for(var e="";;){var r=HEAPU8[t++];if(!r)return e;e+=String.fromCharCode(r)}},"AsciiToString"),wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_abort_js:__abort_js,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,_emscripten_memcpy_js:__emscripten_memcpy_js,emscripten_get_now:_emscripten_get_now,emscripten_resize_heap:_emscripten_resize_heap,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback},wasmExports=createWasm(),___wasm_call_ctors=a(()=>(___wasm_call_ctors=wasmExports.__wasm_call_ctors)(),"___wasm_call_ctors"),___wasm_apply_data_relocs=a(()=>(___wasm_apply_data_relocs=wasmExports.__wasm_apply_data_relocs)(),"___wasm_apply_data_relocs"),_malloc=Module._malloc=t=>(_malloc=Module._malloc=wasmExports.malloc)(t),_calloc=Module._calloc=(t,e)=>(_calloc=Module._calloc=wasmExports.calloc)(t,e),_realloc=Module._realloc=(t,e)=>(_realloc=Module._realloc=wasmExports.realloc)(t,e),_free=Module._free=t=>(_free=Module._free=wasmExports.free)(t),_ts_language_symbol_count=Module._ts_language_symbol_count=t=>(_ts_language_symbol_count=Module._ts_language_symbol_count=wasmExports.ts_language_symbol_count)(t),_ts_language_state_count=Module._ts_language_state_count=t=>(_ts_language_state_count=Module._ts_language_state_count=wasmExports.ts_language_state_count)(t),_ts_language_version=Module._ts_language_version=t=>(_ts_language_version=Module._ts_language_version=wasmExports.ts_language_version)(t),_ts_language_field_count=Module._ts_language_field_count=t=>(_ts_language_field_count=Module._ts_language_field_count=wasmExports.ts_language_field_count)(t),_ts_language_next_state=Module._ts_language_next_state=(t,e,r)=>(_ts_language_next_state=Module._ts_language_next_state=wasmExports.ts_language_next_state)(t,e,r),_ts_language_symbol_name=Module._ts_language_symbol_name=(t,e)=>(_ts_language_symbol_name=Module._ts_language_symbol_name=wasmExports.ts_language_symbol_name)(t,e),_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=(t,e,r,n)=>(_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=wasmExports.ts_language_symbol_for_name)(t,e,r,n),_strncmp=Module._strncmp=(t,e,r)=>(_strncmp=Module._strncmp=wasmExports.strncmp)(t,e,r),_ts_language_symbol_type=Module._ts_language_symbol_type=(t,e)=>(_ts_language_symbol_type=Module._ts_language_symbol_type=wasmExports.ts_language_symbol_type)(t,e),_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=(t,e)=>(_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=wasmExports.ts_language_field_name_for_id)(t,e),_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=(t,e)=>(_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=wasmExports.ts_lookahead_iterator_new)(t,e),_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=t=>(_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=wasmExports.ts_lookahead_iterator_delete)(t),_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=(t,e)=>(_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=wasmExports.ts_lookahead_iterator_reset_state)(t,e),_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=(t,e,r)=>(_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=wasmExports.ts_lookahead_iterator_reset)(t,e,r),_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=t=>(_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=wasmExports.ts_lookahead_iterator_next)(t),_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=t=>(_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=wasmExports.ts_lookahead_iterator_current_symbol)(t),_memset=Module._memset=(t,e,r)=>(_memset=Module._memset=wasmExports.memset)(t,e,r),_memcpy=Module._memcpy=(t,e,r)=>(_memcpy=Module._memcpy=wasmExports.memcpy)(t,e,r),_ts_parser_delete=Module._ts_parser_delete=t=>(_ts_parser_delete=Module._ts_parser_delete=wasmExports.ts_parser_delete)(t),_ts_parser_reset=Module._ts_parser_reset=t=>(_ts_parser_reset=Module._ts_parser_reset=wasmExports.ts_parser_reset)(t),_ts_parser_set_language=Module._ts_parser_set_language=(t,e)=>(_ts_parser_set_language=Module._ts_parser_set_language=wasmExports.ts_parser_set_language)(t,e),_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=t=>(_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=wasmExports.ts_parser_timeout_micros)(t),_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=(t,e,r)=>(_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=wasmExports.ts_parser_set_timeout_micros)(t,e,r),_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=(t,e,r)=>(_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=wasmExports.ts_parser_set_included_ranges)(t,e,r),_memmove=Module._memmove=(t,e,r)=>(_memmove=Module._memmove=wasmExports.memmove)(t,e,r),_memcmp=Module._memcmp=(t,e,r)=>(_memcmp=Module._memcmp=wasmExports.memcmp)(t,e,r),_ts_query_new=Module._ts_query_new=(t,e,r,n,o)=>(_ts_query_new=Module._ts_query_new=wasmExports.ts_query_new)(t,e,r,n,o),_ts_query_delete=Module._ts_query_delete=t=>(_ts_query_delete=Module._ts_query_delete=wasmExports.ts_query_delete)(t),_iswspace=Module._iswspace=t=>(_iswspace=Module._iswspace=wasmExports.iswspace)(t),_iswalnum=Module._iswalnum=t=>(_iswalnum=Module._iswalnum=wasmExports.iswalnum)(t),_ts_query_pattern_count=Module._ts_query_pattern_count=t=>(_ts_query_pattern_count=Module._ts_query_pattern_count=wasmExports.ts_query_pattern_count)(t),_ts_query_capture_count=Module._ts_query_capture_count=t=>(_ts_query_capture_count=Module._ts_query_capture_count=wasmExports.ts_query_capture_count)(t),_ts_query_string_count=Module._ts_query_string_count=t=>(_ts_query_string_count=Module._ts_query_string_count=wasmExports.ts_query_string_count)(t),_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=(t,e,r)=>(_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=wasmExports.ts_query_capture_name_for_id)(t,e,r),_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=(t,e,r)=>(_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=wasmExports.ts_query_string_value_for_id)(t,e,r),_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=(t,e,r)=>(_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=wasmExports.ts_query_predicates_for_pattern)(t,e,r),_ts_query_disable_capture=Module._ts_query_disable_capture=(t,e,r)=>(_ts_query_disable_capture=Module._ts_query_disable_capture=wasmExports.ts_query_disable_capture)(t,e,r),_ts_tree_copy=Module._ts_tree_copy=t=>(_ts_tree_copy=Module._ts_tree_copy=wasmExports.ts_tree_copy)(t),_ts_tree_delete=Module._ts_tree_delete=t=>(_ts_tree_delete=Module._ts_tree_delete=wasmExports.ts_tree_delete)(t),_ts_init=Module._ts_init=()=>(_ts_init=Module._ts_init=wasmExports.ts_init)(),_ts_parser_new_wasm=Module._ts_parser_new_wasm=()=>(_ts_parser_new_wasm=Module._ts_parser_new_wasm=wasmExports.ts_parser_new_wasm)(),_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=(t,e)=>(_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=wasmExports.ts_parser_enable_logger_wasm)(t,e),_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=(t,e,r,n,o)=>(_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=wasmExports.ts_parser_parse_wasm)(t,e,r,n,o),_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=t=>(_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=wasmExports.ts_parser_included_ranges_wasm)(t),_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=(t,e)=>(_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=wasmExports.ts_language_type_is_named_wasm)(t,e),_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=(t,e)=>(_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=wasmExports.ts_language_type_is_visible_wasm)(t,e),_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=t=>(_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=wasmExports.ts_tree_root_node_wasm)(t),_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=t=>(_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=wasmExports.ts_tree_root_node_with_offset_wasm)(t),_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=t=>(_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=wasmExports.ts_tree_edit_wasm)(t),_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=t=>(_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=wasmExports.ts_tree_included_ranges_wasm)(t),_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=(t,e)=>(_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=wasmExports.ts_tree_get_changed_ranges_wasm)(t,e),_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=t=>(_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=wasmExports.ts_tree_cursor_new_wasm)(t),_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=t=>(_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=wasmExports.ts_tree_cursor_delete_wasm)(t),_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=t=>(_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=wasmExports.ts_tree_cursor_reset_wasm)(t),_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=(t,e)=>(_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=wasmExports.ts_tree_cursor_reset_to_wasm)(t,e),_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=t=>(_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=wasmExports.ts_tree_cursor_goto_first_child_wasm)(t),_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=t=>(_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=wasmExports.ts_tree_cursor_goto_last_child_wasm)(t),_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=t=>(_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_index_wasm)(t),_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=t=>(_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_position_wasm)(t),_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=t=>(_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=wasmExports.ts_tree_cursor_goto_next_sibling_wasm)(t),_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=t=>(_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=wasmExports.ts_tree_cursor_goto_previous_sibling_wasm)(t),_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=(t,e)=>(_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=wasmExports.ts_tree_cursor_goto_descendant_wasm)(t,e),_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=t=>(_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=wasmExports.ts_tree_cursor_goto_parent_wasm)(t),_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=t=>(_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=wasmExports.ts_tree_cursor_current_node_type_id_wasm)(t),_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=t=>(_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=wasmExports.ts_tree_cursor_current_node_state_id_wasm)(t),_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=t=>(_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=wasmExports.ts_tree_cursor_current_node_is_named_wasm)(t),_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=t=>(_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=wasmExports.ts_tree_cursor_current_node_is_missing_wasm)(t),_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=t=>(_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=wasmExports.ts_tree_cursor_current_node_id_wasm)(t),_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=t=>(_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=wasmExports.ts_tree_cursor_start_position_wasm)(t),_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=t=>(_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=wasmExports.ts_tree_cursor_end_position_wasm)(t),_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=t=>(_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=wasmExports.ts_tree_cursor_start_index_wasm)(t),_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=t=>(_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=wasmExports.ts_tree_cursor_end_index_wasm)(t),_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=t=>(_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=wasmExports.ts_tree_cursor_current_field_id_wasm)(t),_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=t=>(_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=wasmExports.ts_tree_cursor_current_depth_wasm)(t),_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=t=>(_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=wasmExports.ts_tree_cursor_current_descendant_index_wasm)(t),_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=t=>(_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=wasmExports.ts_tree_cursor_current_node_wasm)(t),_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=t=>(_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=wasmExports.ts_node_symbol_wasm)(t),_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=(t,e)=>(_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=wasmExports.ts_node_field_name_for_child_wasm)(t,e),_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=(t,e)=>(_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=wasmExports.ts_node_children_by_field_id_wasm)(t,e),_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=t=>(_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=wasmExports.ts_node_first_child_for_byte_wasm)(t),_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=t=>(_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=wasmExports.ts_node_first_named_child_for_byte_wasm)(t),_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=t=>(_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=wasmExports.ts_node_grammar_symbol_wasm)(t),_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=t=>(_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=wasmExports.ts_node_child_count_wasm)(t),_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=t=>(_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=wasmExports.ts_node_named_child_count_wasm)(t),_ts_node_child_wasm=Module._ts_node_child_wasm=(t,e)=>(_ts_node_child_wasm=Module._ts_node_child_wasm=wasmExports.ts_node_child_wasm)(t,e),_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=(t,e)=>(_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=wasmExports.ts_node_named_child_wasm)(t,e),_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=(t,e)=>(_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=wasmExports.ts_node_child_by_field_id_wasm)(t,e),_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=t=>(_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=wasmExports.ts_node_next_sibling_wasm)(t),_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=t=>(_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=wasmExports.ts_node_prev_sibling_wasm)(t),_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=t=>(_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=wasmExports.ts_node_next_named_sibling_wasm)(t),_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=t=>(_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=wasmExports.ts_node_prev_named_sibling_wasm)(t),_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=t=>(_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=wasmExports.ts_node_descendant_count_wasm)(t),_ts_node_parent_wasm=Module._ts_node_parent_wasm=t=>(_ts_node_parent_wasm=Module._ts_node_parent_wasm=wasmExports.ts_node_parent_wasm)(t),_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=t=>(_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=wasmExports.ts_node_descendant_for_index_wasm)(t),_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=t=>(_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=wasmExports.ts_node_named_descendant_for_index_wasm)(t),_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=t=>(_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=wasmExports.ts_node_descendant_for_position_wasm)(t),_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=t=>(_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=wasmExports.ts_node_named_descendant_for_position_wasm)(t),_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=t=>(_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=wasmExports.ts_node_start_point_wasm)(t),_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=t=>(_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=wasmExports.ts_node_end_point_wasm)(t),_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=t=>(_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=wasmExports.ts_node_start_index_wasm)(t),_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=t=>(_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=wasmExports.ts_node_end_index_wasm)(t),_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=t=>(_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=wasmExports.ts_node_to_string_wasm)(t),_ts_node_children_wasm=Module._ts_node_children_wasm=t=>(_ts_node_children_wasm=Module._ts_node_children_wasm=wasmExports.ts_node_children_wasm)(t),_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=t=>(_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=wasmExports.ts_node_named_children_wasm)(t),_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=(t,e,r,n,o,s,c)=>(_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=wasmExports.ts_node_descendants_of_type_wasm)(t,e,r,n,o,s,c),_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=t=>(_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=wasmExports.ts_node_is_named_wasm)(t),_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=t=>(_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=wasmExports.ts_node_has_changes_wasm)(t),_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=t=>(_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=wasmExports.ts_node_has_error_wasm)(t),_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=t=>(_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=wasmExports.ts_node_is_error_wasm)(t),_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=t=>(_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=wasmExports.ts_node_is_missing_wasm)(t),_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=t=>(_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=wasmExports.ts_node_is_extra_wasm)(t),_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=t=>(_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=wasmExports.ts_node_parse_state_wasm)(t),_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=t=>(_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=wasmExports.ts_node_next_parse_state_wasm)(t),_ts_query_matches_wasm=Module._ts_query_matches_wasm=(t,e,r,n,o,s,c,l,u,d)=>(_ts_query_matches_wasm=Module._ts_query_matches_wasm=wasmExports.ts_query_matches_wasm)(t,e,r,n,o,s,c,l,u,d),_ts_query_captures_wasm=Module._ts_query_captures_wasm=(t,e,r,n,o,s,c,l,u,d)=>(_ts_query_captures_wasm=Module._ts_query_captures_wasm=wasmExports.ts_query_captures_wasm)(t,e,r,n,o,s,c,l,u,d),_iswalpha=Module._iswalpha=t=>(_iswalpha=Module._iswalpha=wasmExports.iswalpha)(t),_iswblank=Module._iswblank=t=>(_iswblank=Module._iswblank=wasmExports.iswblank)(t),_iswdigit=Module._iswdigit=t=>(_iswdigit=Module._iswdigit=wasmExports.iswdigit)(t),_iswlower=Module._iswlower=t=>(_iswlower=Module._iswlower=wasmExports.iswlower)(t),_iswupper=Module._iswupper=t=>(_iswupper=Module._iswupper=wasmExports.iswupper)(t),_iswxdigit=Module._iswxdigit=t=>(_iswxdigit=Module._iswxdigit=wasmExports.iswxdigit)(t),_memchr=Module._memchr=(t,e,r)=>(_memchr=Module._memchr=wasmExports.memchr)(t,e,r),_strlen=Module._strlen=t=>(_strlen=Module._strlen=wasmExports.strlen)(t),_strcmp=Module._strcmp=(t,e)=>(_strcmp=Module._strcmp=wasmExports.strcmp)(t,e),_strncat=Module._strncat=(t,e,r)=>(_strncat=Module._strncat=wasmExports.strncat)(t,e,r),_strncpy=Module._strncpy=(t,e,r)=>(_strncpy=Module._strncpy=wasmExports.strncpy)(t,e,r),_towlower=Module._towlower=t=>(_towlower=Module._towlower=wasmExports.towlower)(t),_towupper=Module._towupper=t=>(_towupper=Module._towupper=wasmExports.towupper)(t),_setThrew=a((t,e)=>(_setThrew=wasmExports.setThrew)(t,e),"_setThrew"),__emscripten_stack_restore=a(t=>(__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(t),"__emscripten_stack_restore"),__emscripten_stack_alloc=a(t=>(__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(t),"__emscripten_stack_alloc"),_emscripten_stack_get_current=a(()=>(_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)(),"_emscripten_stack_get_current"),dynCall_jiji=Module.dynCall_jiji=(t,e,r,n,o)=>(dynCall_jiji=Module.dynCall_jiji=wasmExports.dynCall_jiji)(t,e,r,n,o),_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=t=>(_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=wasmExports.orig$ts_parser_timeout_micros)(t),_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=(t,e)=>(_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=wasmExports.orig$ts_parser_set_timeout_micros)(t,e);Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16;var calledRun;dependenciesFulfilled=a(function t(){calledRun||run(),calledRun||(dependenciesFulfilled=t)},"runCaller");function callMain(t=[]){var e=resolveGlobalSymbol("main").sym;if(e){t.unshift(thisProgram);var r=t.length,n=stackAlloc((r+1)*4),o=n;t.forEach(c=>{LE_HEAP_STORE_U32((o>>2)*4,stringToUTF8OnStack(c)),o+=4}),LE_HEAP_STORE_U32((o>>2)*4,0);try{var s=e(r,n);return exitJS(s,!0),s}catch(c){return handleException(c)}}}a(callMain,"callMain");function run(t=arguments_){if(runDependencies>0||(preRun(),runDependencies>0))return;function e(){calledRun||(calledRun=!0,Module.calledRun=!0,!ABORT&&(initRuntime(),preMain(),Module.onRuntimeInitialized?.(),shouldRunNow&&callMain(t),postRun()))}a(e,"doRun"),Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),e()},1)):e()}if(a(run,"run"),Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run();let C=Module,INTERNAL={},SIZE_OF_INT=4,SIZE_OF_CURSOR=4*SIZE_OF_INT,SIZE_OF_NODE=5*SIZE_OF_INT,SIZE_OF_POINT=2*SIZE_OF_INT,SIZE_OF_RANGE=2*SIZE_OF_INT+2*SIZE_OF_POINT,ZERO_POINT={row:0,column:0},QUERY_WORD_REGEX=/[\w-.]*/g,PREDICATE_STEP_TYPE_CAPTURE=1,PREDICATE_STEP_TYPE_STRING=2,LANGUAGE_FUNCTION_REGEX=/^_?tree_sitter_\w+/,VERSION,MIN_COMPATIBLE_VERSION,TRANSFER_BUFFER,currentParseCallback,currentLogCallback;class ParserImpl{static{a(this,"ParserImpl")}static init(){TRANSFER_BUFFER=C._ts_init(),VERSION=getValue(TRANSFER_BUFFER,"i32"),MIN_COMPATIBLE_VERSION=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}initialize(){C._ts_parser_new_wasm(),this[0]=getValue(TRANSFER_BUFFER,"i32"),this[1]=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}delete(){C._ts_parser_delete(this[0]),C._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let r;if(!e)r=0,e=null;else if(e.constructor===Language){r=e[0];let n=C._ts_language_version(r);if(ne.slice(u),"currentParseCallback");else if(typeof e=="function")currentParseCallback=e;else throw new Error("Argument must be a string or a function");this.logCallback?(currentLogCallback=this.logCallback,C._ts_parser_enable_logger_wasm(this[0],1)):(currentLogCallback=null,C._ts_parser_enable_logger_wasm(this[0],0));let o=0,s=0;if(n?.includedRanges){o=n.includedRanges.length,s=C._calloc(o,SIZE_OF_RANGE);let u=s;for(let d=0;d0){let o=r;for(let s=0;s0){let s=n;for(let c=0;c0){let o=r;for(let s=0;s0){let s=n;for(let c=0;c0){let n=r;for(let o=0;o0){let n=r;for(let o=0;o0){let f=u;for(let h=0;h0){if(v[0].type!=="string")throw new Error("Predicates must begin with a literal value");let x=v[0].value,P=!0,D=!0,N;switch(x){case"any-not-eq?":case"not-eq?":P=!1;case"any-eq?":case"eq?":if(v.length!==3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 2, got ${v.length-1}`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}"`);if(D=!x.startsWith("any-"),v[2].type==="capture"){let M=v[1].name,O=v[2].name;A[y].push(U=>{let q=[],Q=[];for(let W of U)W.name===M&&q.push(W.node),W.name===O&&Q.push(W.node);let Y=a((W,V,z)=>z?W.text===V.text:W.text!==V.text,"compare");return D?q.every(W=>Q.some(V=>Y(W,V,P))):q.some(W=>Q.some(V=>Y(W,V,P)))})}else{N=v[1].name;let M=v[2].value,O=a(q=>q.text===M,"matches"),U=a(q=>q.text!==M,"doesNotMatch");A[y].push(q=>{let Q=[];for(let W of q)W.name===N&&Q.push(W.node);let Y=P?O:U;return D?Q.every(Y):Q.some(Y)})}break;case"any-not-match?":case"not-match?":P=!1;case"any-match?":case"match?":if(v.length!==3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 2, got ${v.length-1}.`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}".`);if(v[2].type!=="string")throw new Error(`Second argument of \`#${x}\` predicate must be a string. Got @${v[2].value}.`);N=v[1].name;let L=new RegExp(v[2].value);D=!x.startsWith("any-"),A[y].push(M=>{let O=[];for(let q of M)q.name===N&&O.push(q.node.text);let U=a((q,Q)=>Q?L.test(q):!L.test(q),"test");return O.length===0?!P:D?O.every(q=>U(q,P)):O.some(q=>U(q,P))});break;case"set!":if(v.length<2||v.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${v.length-1}.`);if(v.some(M=>M.type!=="string"))throw new Error('Arguments to `#set!` predicate must be a strings.".');f[y]||(f[y]={}),f[y][v[1].value]=v[2]?v[2].value:null;break;case"is?":case"is-not?":if(v.length<2||v.length>3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 1 or 2. Got ${v.length-1}.`);if(v.some(M=>M.type!=="string"))throw new Error(`Arguments to \`#${x}\` predicate must be a strings.".`);let B=x==="is?"?h:m;B[y]||(B[y]={}),B[y][v[1].value]=v[2]?v[2].value:null;break;case"not-any-of?":P=!1;case"any-of?":if(v.length<2)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected at least 1. Got ${v.length-1}.`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}".`);for(let M=2;MM.value);A[y].push(M=>{let O=[];for(let U of M)U.name===N&&O.push(U.node.text);return O.length===0?!P:O.every(U=>j.includes(U))===P});break;default:g[y].push({operator:x,operands:v.slice(1)})}v.length=0}}Object.freeze(f[y]),Object.freeze(h[y]),Object.freeze(m[y])}return C._free(n),new Query(INTERNAL,o,u,A,g,Object.freeze(f),Object.freeze(h),Object.freeze(m))}static load(e){let r;if(e instanceof Uint8Array)r=Promise.resolve(e);else{let n=e;if(typeof process<"u"&&process.versions&&process.versions.node){let o=require("fs");r=Promise.resolve(o.readFileSync(n))}else r=fetch(n).then(o=>o.arrayBuffer().then(s=>{if(o.ok)return new Uint8Array(s);{let c=new TextDecoder("utf-8").decode(s);throw new Error(`Language.load failed with status ${o.status}. ${c}`)}}))}return r.then(n=>loadWebAssemblyModule(n,{loadAsync:!0})).then(n=>{let o=Object.keys(n),s=o.find(l=>LANGUAGE_FUNCTION_REGEX.test(l)&&!l.includes("external_scanner_"));s||console.log(`Couldn't find language function in WASM file. Symbols: -${JSON.stringify(o,null,2)}`);let c=n[s]();return new Language(INTERNAL,c)})}}class LookaheadIterable{static{a(this,"LookaheadIterable")}constructor(e,r,n){assertInternal(e),this[0]=r,this.language=n}get currentTypeId(){return C._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||"ERROR"}delete(){C._ts_lookahead_iterator_delete(this[0]),this[0]=0}resetState(e){return C._ts_lookahead_iterator_reset_state(this[0],e)}reset(e,r){return C._ts_lookahead_iterator_reset(this[0],e[0],r)?(this.language=e,!0):!1}[Symbol.iterator](){let e=this;return{next(){return C._ts_lookahead_iterator_next(e[0])?{done:!1,value:e.currentType}:{done:!0,value:""}}}}}class Query{static{a(this,"Query")}constructor(e,r,n,o,s,c,l,u){assertInternal(e),this[0]=r,this.captureNames=n,this.textPredicates=o,this.predicates=s,this.setProperties=c,this.assertedProperties=l,this.refutedProperties=u,this.exceededMatchLimit=!1}delete(){C._ts_query_delete(this[0]),this[0]=0}matches(e,{startPosition:r=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:o=0,endIndex:s=0,matchLimit:c=4294967295,maxStartDepth:l=4294967295}={}){if(typeof c!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_matches_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,o,s,c,l);let u=getValue(TRANSFER_BUFFER,"i32"),d=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),f=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),h=new Array(u);this.exceededMatchLimit=!!f;let m=0,g=d;for(let A=0;Av(_))){h[m]={pattern:y,captures:_};let v=this.setProperties[y];v&&(h[m].setProperties=v);let b=this.assertedProperties[y];b&&(h[m].assertedProperties=b);let T=this.refutedProperties[y];T&&(h[m].refutedProperties=T),m++}}return h.length=m,C._free(d),h}captures(e,{startPosition:r=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:o=0,endIndex:s=0,matchLimit:c=4294967295,maxStartDepth:l=4294967295}={}){if(typeof c!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_captures_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,o,s,c,l);let u=getValue(TRANSFER_BUFFER,"i32"),d=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),f=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),h=[];this.exceededMatchLimit=!!f;let m=[],g=d;for(let A=0;Av(m))){let v=m[_],b=this.setProperties[y];b&&(v.setProperties=b);let T=this.assertedProperties[y];T&&(v.assertedProperties=T);let w=this.refutedProperties[y];w&&(v.refutedProperties=w),h.push(v)}}return C._free(d),h}predicatesForPattern(e){return this.predicates[e]}disableCapture(e){let r=lengthBytesUTF8(e),n=C._malloc(r+1);stringToUTF8(e,n,r+1),C._ts_query_disable_capture(this[0],n,r),C._free(n)}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(t,e,r){let n=r-e,o=t.textCallback(e,null,r);for(e+=o.length;e0)e+=s.length,o+=s;else break}return e>r&&(o=o.slice(0,n)),o}a(getText,"getText");function unmarshalCaptures(t,e,r,n){for(let o=0,s=n.length;o>>0,column:getValue(t+SIZE_OF_INT,"i32")>>>0}}a(unmarshalPoint,"unmarshalPoint");function marshalRange(t,e){marshalPoint(t,e.startPosition),t+=SIZE_OF_POINT,marshalPoint(t,e.endPosition),t+=SIZE_OF_POINT,setValue(t,e.startIndex,"i32"),t+=SIZE_OF_INT,setValue(t,e.endIndex,"i32"),t+=SIZE_OF_INT}a(marshalRange,"marshalRange");function unmarshalRange(t){let e={};return e.startPosition=unmarshalPoint(t),t+=SIZE_OF_POINT,e.endPosition=unmarshalPoint(t),t+=SIZE_OF_POINT,e.startIndex=getValue(t,"i32")>>>0,t+=SIZE_OF_INT,e.endIndex=getValue(t,"i32")>>>0,e}a(unmarshalRange,"unmarshalRange");function marshalEdit(t){let e=TRANSFER_BUFFER;marshalPoint(e,t.startPosition),e+=SIZE_OF_POINT,marshalPoint(e,t.oldEndPosition),e+=SIZE_OF_POINT,marshalPoint(e,t.newEndPosition),e+=SIZE_OF_POINT,setValue(e,t.startIndex,"i32"),e+=SIZE_OF_INT,setValue(e,t.oldEndIndex,"i32"),e+=SIZE_OF_INT,setValue(e,t.newEndIndex,"i32"),e+=SIZE_OF_INT}a(marshalEdit,"marshalEdit");for(let t of Object.getOwnPropertyNames(ParserImpl.prototype))Object.defineProperty(Parser.prototype,t,{value:ParserImpl.prototype[t],enumerable:!1,writable:!1});Parser.Language=Language,Module.onRuntimeInitialized=()=>{ParserImpl.init(),resolveInitPromise()}}))}}return Parser})();typeof exports=="object"&&(module.exports=TreeSitter)});var qdn=I((Kwu,Qdn)=>{"use strict";p();var RLo=require("path"),kLo=RLo.join(__dirname,"compiled",process.platform,process.arch,"keytar.node");Qdn.exports=require(kLo)});var epn={};ki(epn,{TextDocument:()=>S3});function E6t(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),o=t.slice(r);E6t(n,e),E6t(o,e);let s=0,c=0,l=0;for(;sr.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function l3o(t){let e=Xfn(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var nWe,S3,_6t=ve(()=>{"use strict";p();nWe=class t{static{a(this,"FullTextDocument")}constructor(e,r,n,o){this._uri=e,this._languageId=r,this._version=n,this._content=o,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let o=Xfn(n.range),s=this.offsetAt(o.start),c=this.offsetAt(o.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(c,this._content.length);let l=Math.max(o.start.line,0),u=Math.max(o.end.line,0),d=this._lineOffsets,f=Jfn(n.text,!1,s);if(u-l===f.length)for(let m=0,g=f.length;me?o=c:n=c+1}let s=n-1;return e=this.ensureBeforeEOL(e,r[s]),{line:s,character:e-r[s]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line];if(e.character<=0)return n;let o=e.line+1r&&Zfn(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}};(function(t){function e(o,s,c,l){return new nWe(o,s,c,l)}a(e,"create"),t.create=e;function r(o,s,c){if(o instanceof nWe)return o.update(s,c),o;throw new Error("TextDocument.update: document must be created by TextDocument.create")}a(r,"update"),t.update=r;function n(o,s){let c=o.getText(),l=E6t(s.map(l3o),(f,h)=>{let m=f.range.start.line-h.range.start.line;return m===0?f.range.start.character-h.range.start.character:m}),u=0,d=[];for(let f of l){let h=o.offsetAt(f.range.start);if(hu&&d.push(c.substring(u,h)),f.newText.length&&d.push(f.newText),u=o.offsetAt(f.range.end)}return d.push(c.substr(u)),d.join("")}a(n,"applyEdits"),t.applyEdits=n})(S3||(S3={}));a(E6t,"mergeSort");a(Jfn,"computeLineOffsets");a(Zfn,"isEOL");a(Xfn,"getWellformedRange");a(l3o,"getWellformedEdit")});var pWe=I(Vh=>{"use strict";p();Object.defineProperty(Vh,"__esModule",{value:!0});Vh.thenable=Vh.typedArray=Vh.stringArray=Vh.array=Vh.func=Vh.error=Vh.number=Vh.string=Vh.boolean=void 0;function h3o(t){return t===!0||t===!1}a(h3o,"boolean");Vh.boolean=h3o;function uhn(t){return typeof t=="string"||t instanceof String}a(uhn,"string");Vh.string=uhn;function m3o(t){return typeof t=="number"||t instanceof Number}a(m3o,"number");Vh.number=m3o;function g3o(t){return t instanceof Error}a(g3o,"error");Vh.error=g3o;function dhn(t){return typeof t=="function"}a(dhn,"func");Vh.func=dhn;function fhn(t){return Array.isArray(t)}a(fhn,"array");Vh.array=fhn;function A3o(t){return fhn(t)&&t.every(e=>uhn(e))}a(A3o,"stringArray");Vh.stringArray=A3o;function y3o(t,e){return Array.isArray(t)&&t.every(e)}a(y3o,"typedArray");Vh.typedArray=y3o;function E3o(t){return t&&dhn(t.then)}a(E3o,"thenable");Vh.thenable=E3o});var F6t=I(Fx=>{"use strict";p();Object.defineProperty(Fx,"__esModule",{value:!0});Fx.generateUuid=Fx.parse=Fx.isUUID=Fx.v4=Fx.empty=void 0;var bIe=class{static{a(this,"ValueUUID")}constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},SIe=class t extends bIe{static{a(this,"V4UUID")}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};SIe._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];SIe._timeHighBits=["8","9","a","b"];Fx.empty=new bIe("00000000-0000-0000-0000-000000000000");function phn(){return new SIe}a(phn,"v4");Fx.v4=phn;var _3o=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function hhn(t){return _3o.test(t)}a(hhn,"isUUID");Fx.isUUID=hhn;function v3o(t){if(!hhn(t))throw new Error("invalid uuid");return new bIe(t)}a(v3o,"parse");Fx.parse=v3o;function C3o(){return phn().asHex()}a(C3o,"generateUuid");Fx.generateUuid=C3o});var mhn=I(DQ=>{"use strict";p();Object.defineProperty(DQ,"__esModule",{value:!0});DQ.attachPartialResult=DQ.ProgressFeature=DQ.attachWorkDone=void 0;var PQ=ri(),b3o=F6t(),$Y=class t{static{a(this,"WorkDoneProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r,t.Instances.set(this._token,this)}begin(e,r,n,o){let s={kind:"begin",title:e,percentage:r,message:n,cancellable:o};this._connection.sendProgress(PQ.WorkDoneProgress.type,this._token,s)}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress(PQ.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(PQ.WorkDoneProgress.type,this._token,{kind:"end"})}};$Y.Instances=new Map;var hWe=class extends $Y{static{a(this,"WorkDoneProgressServerReporterImpl")}constructor(e,r){super(e,r),this._source=new PQ.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},TIe=class{static{a(this,"NullProgressReporter")}constructor(){}begin(){}report(){}done(){}},mWe=class extends TIe{static{a(this,"NullProgressServerReporter")}constructor(){super(),this._source=new PQ.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function S3o(t,e){if(e===void 0||e.workDoneToken===void 0)return new TIe;let r=e.workDoneToken;return delete e.workDoneToken,new $Y(t,r)}a(S3o,"attachWorkDone");DQ.attachWorkDone=S3o;var T3o=a(t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(PQ.WorkDoneProgressCancelNotification.type,r=>{let n=$Y.Instances.get(r.token);(n instanceof hWe||n instanceof mWe)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new TIe:new $Y(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,b3o.generateUuid)();return this.connection.sendRequest(PQ.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new hWe(this.connection,e))}else return Promise.resolve(new mWe)}},"ProgressFeature");DQ.ProgressFeature=T3o;var U6t;(function(t){t.type=new PQ.ProgressType})(U6t||(U6t={}));var Q6t=class{static{a(this,"ResultProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(U6t.type,this._token,e)}};function I3o(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new Q6t(t,r)}a(I3o,"attachPartialResult");DQ.attachPartialResult=I3o});var ghn=I(gWe=>{"use strict";p();Object.defineProperty(gWe,"__esModule",{value:!0});gWe.ConfigurationFeature=void 0;var x3o=ri(),w3o=pWe(),R3o=a(t=>class extends t{getConfiguration(e){return e?w3o.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(x3o.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}},"ConfigurationFeature");gWe.ConfigurationFeature=R3o});var Ahn=I(yWe=>{"use strict";p();Object.defineProperty(yWe,"__esModule",{value:!0});yWe.WorkspaceFoldersFeature=void 0;var AWe=ri(),k3o=a(t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new AWe.Emitter,this.connection.onNotification(AWe.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(AWe.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(AWe.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}},"WorkspaceFoldersFeature");yWe.WorkspaceFoldersFeature=k3o});var yhn=I(EWe=>{"use strict";p();Object.defineProperty(EWe,"__esModule",{value:!0});EWe.CallHierarchyFeature=void 0;var q6t=ri(),P3o=a(t=>class extends t{get callHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(q6t.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onIncomingCalls:a(e=>{let r=q6t.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onIncomingCalls"),onOutgoingCalls:a(e=>{let r=q6t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onOutgoingCalls")}}},"CallHierarchyFeature");EWe.CallHierarchyFeature=P3o});var H6t=I(NQ=>{"use strict";p();Object.defineProperty(NQ,"__esModule",{value:!0});NQ.SemanticTokensBuilder=NQ.SemanticTokensDiff=NQ.SemanticTokensFeature=void 0;var _We=ri(),D3o=a(t=>class extends t{get semanticTokens(){return{refresh:a(()=>this.connection.sendRequest(_We.SemanticTokensRefreshRequest.type),"refresh"),on:a(e=>{let r=_We.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on"),onDelta:a(e=>{let r=_We.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onDelta"),onRange:a(e=>{let r=_We.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onRange")}}},"SemanticTokensFeature");NQ.SemanticTokensFeature=D3o;var vWe=class{static{a(this,"SemanticTokensDiff")}constructor(e,r){this.originalSequence=e,this.modifiedSequence=r}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n=n&&s>=n&&this.originalSequence[o]===this.modifiedSequence[s];)o--,s--;(o0&&(c-=this._prevLine,c===0&&(l-=this._prevChar)),this._data[this._dataLen++]=c,this._data[this._dataLen++]=l,this._data[this._dataLen++]=n,this._data[this._dataLen++]=o,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=r}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new vWe(this._prevData,this._data).computeDiff()}:this.build()}};NQ.SemanticTokensBuilder=j6t});var Ehn=I(CWe=>{"use strict";p();Object.defineProperty(CWe,"__esModule",{value:!0});CWe.ShowDocumentFeature=void 0;var N3o=ri(),M3o=a(t=>class extends t{showDocument(e){return this.connection.sendRequest(N3o.ShowDocumentRequest.type,e)}},"ShowDocumentFeature");CWe.ShowDocumentFeature=M3o});var _hn=I(bWe=>{"use strict";p();Object.defineProperty(bWe,"__esModule",{value:!0});bWe.FileOperationsFeature=void 0;var Tle=ri(),O3o=a(t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Tle.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(Tle.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(Tle.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(Tle.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(Tle.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(Tle.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}},"FileOperationsFeature");bWe.FileOperationsFeature=O3o});var vhn=I(SWe=>{"use strict";p();Object.defineProperty(SWe,"__esModule",{value:!0});SWe.LinkedEditingRangeFeature=void 0;var L3o=ri(),B3o=a(t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(L3o.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}},"LinkedEditingRangeFeature");SWe.LinkedEditingRangeFeature=B3o});var Chn=I(TWe=>{"use strict";p();Object.defineProperty(TWe,"__esModule",{value:!0});TWe.TypeHierarchyFeature=void 0;var G6t=ri(),F3o=a(t=>class extends t{get typeHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(G6t.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onSupertypes:a(e=>{let r=G6t.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSupertypes"),onSubtypes:a(e=>{let r=G6t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSubtypes")}}},"TypeHierarchyFeature");TWe.TypeHierarchyFeature=F3o});var Shn=I(IWe=>{"use strict";p();Object.defineProperty(IWe,"__esModule",{value:!0});IWe.InlineValueFeature=void 0;var bhn=ri(),U3o=a(t=>class extends t{get inlineValue(){return{refresh:a(()=>this.connection.sendRequest(bhn.InlineValueRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(bhn.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineValueFeature");IWe.InlineValueFeature=U3o});var Ihn=I(xWe=>{"use strict";p();Object.defineProperty(xWe,"__esModule",{value:!0});xWe.FoldingRangeFeature=void 0;var Thn=ri(),Q3o=a(t=>class extends t{get foldingRange(){return{refresh:a(()=>this.connection.sendRequest(Thn.FoldingRangeRefreshRequest.type),"refresh"),on:a(e=>{let r=Thn.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"FoldingRangeFeature");xWe.FoldingRangeFeature=Q3o});var xhn=I(wWe=>{"use strict";p();Object.defineProperty(wWe,"__esModule",{value:!0});wWe.InlayHintFeature=void 0;var $6t=ri(),q3o=a(t=>class extends t{get inlayHint(){return{refresh:a(()=>this.connection.sendRequest($6t.InlayHintRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest($6t.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on"),resolve:a(e=>this.connection.onRequest($6t.InlayHintResolveRequest.type,(r,n)=>e(r,n)),"resolve")}}},"InlayHintFeature");wWe.InlayHintFeature=q3o});var whn=I(RWe=>{"use strict";p();Object.defineProperty(RWe,"__esModule",{value:!0});RWe.DiagnosticFeature=void 0;var IIe=ri(),j3o=a(t=>class extends t{get diagnostics(){return{refresh:a(()=>this.connection.sendRequest(IIe.DiagnosticRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(IIe.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(IIe.DocumentDiagnosticRequest.partialResult,r))),"on"),onWorkspace:a(e=>this.connection.onRequest(IIe.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(IIe.WorkspaceDiagnosticRequest.partialResult,r))),"onWorkspace")}}},"DiagnosticFeature");RWe.DiagnosticFeature=j3o});var W6t=I(kWe=>{"use strict";p();Object.defineProperty(kWe,"__esModule",{value:!0});kWe.TextDocuments=void 0;var VY=ri(),V6t=class{static{a(this,"TextDocuments")}constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new VY.Emitter,this._onDidOpen=new VY.Emitter,this._onDidClose=new VY.Emitter,this._onDidSave=new VY.Emitter,this._onWillSave=new VY.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=VY.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let o=n.textDocument,s=this._configuration.create(o.uri,o.languageId,o.version,o.text);this._syncedDocuments.set(o.uri,s);let c=Object.freeze({document:s});this._onDidOpen.fire(c),this._onDidChangeContent.fire(c)})),r.push(e.onDidChangeTextDocument(n=>{let o=n.textDocument,s=n.contentChanges;if(s.length===0)return;let{version:c}=o;if(c==null)throw new Error(`Received document change event for ${o.uri} without valid version identifier`);let l=this._syncedDocuments.get(o.uri);l!==void 0&&(l=this._configuration.update(l,s,c),this._syncedDocuments.set(o.uri,l),this._onDidChangeContent.fire(Object.freeze({document:l})))})),r.push(e.onDidCloseTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:o})))})),r.push(e.onWillSaveTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&this._onWillSave.fire(Object.freeze({document:o,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,o)=>{let s=this._syncedDocuments.get(n.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:n.reason}),o):[]})),r.push(e.onDidSaveTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&this._onDidSave.fire(Object.freeze({document:o}))})),VY.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};kWe.TextDocuments=V6t});var Y6t=I(Ile=>{"use strict";p();Object.defineProperty(Ile,"__esModule",{value:!0});Ile.NotebookDocuments=Ile.NotebookSyncFeature=void 0;var Ux=ri(),Rhn=W6t(),H3o=a(t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:a(e=>this.connection.onNotification(Ux.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),"onDidOpenNotebookDocument"),onDidChangeNotebookDocument:a(e=>this.connection.onNotification(Ux.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),"onDidChangeNotebookDocument"),onDidSaveNotebookDocument:a(e=>this.connection.onNotification(Ux.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),"onDidSaveNotebookDocument"),onDidCloseNotebookDocument:a(e=>this.connection.onNotification(Ux.DidCloseNotebookDocumentNotification.type,r=>{e(r)}),"onDidCloseNotebookDocument")}}},"NotebookSyncFeature");Ile.NotebookSyncFeature=H3o;var PWe=class t{static{a(this,"CellTextDocumentConnection")}onDidOpenTextDocument(e){return this.openHandler=e,Ux.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Ux.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Ux.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};PWe.NULL_DISPOSE=Object.freeze({dispose:a(()=>{},"dispose")});var z6t=class{static{a(this,"NotebookDocuments")}constructor(e){e instanceof Rhn.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Rhn.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Ux.Emitter,this._onDidChange=new Ux.Emitter,this._onDidSave=new Ux.Emitter,this._onDidClose=new Ux.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let r=new PWe,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(o=>{this.notebookDocuments.set(o.notebookDocument.uri,o.notebookDocument);for(let s of o.cellTextDocuments)r.openTextDocument({textDocument:s});this.updateCellMap(o.notebookDocument),this._onDidOpen.fire(o.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);if(s===void 0)return;s.version=o.notebookDocument.version;let c=s.metadata,l=!1,u=o.change;u.metadata!==void 0&&(l=!0,s.metadata=u.metadata);let d=[],f=[],h=[],m=[];if(u.cells!==void 0){let _=u.cells;if(_.structure!==void 0){let v=_.structure.array;if(s.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),_.structure.didOpen!==void 0)for(let b of _.structure.didOpen)r.openTextDocument({textDocument:b}),d.push(b.uri);if(_.structure.didClose)for(let b of _.structure.didClose)r.closeTextDocument({textDocument:b}),f.push(b.uri)}if(_.data!==void 0){let v=new Map(_.data.map(b=>[b.document,b]));for(let b=0;b<=s.cells.length;b++){let T=v.get(s.cells[b].document);if(T!==void 0){let w=s.cells.splice(b,1,T);if(h.push({old:w[0],new:T}),v.delete(T.document),v.size===0)break}}}if(_.textContent!==void 0)for(let v of _.textContent)r.changeTextDocument({textDocument:v.document,contentChanges:v.changes}),m.push(v.document.uri)}this.updateCellMap(s);let g={notebookDocument:s};l&&(g.metadata={old:c,new:s.metadata});let A=[];for(let _ of d)A.push(this.getNotebookCell(_));let y=[];for(let _ of f)y.push(this.getNotebookCell(_));let E=[];for(let _ of m)E.push(this.getNotebookCell(_));(A.length>0||y.length>0||h.length>0||E.length>0)&&(g.cells={added:A,removed:y,changed:{data:h,textContent:E}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let c of o.cellTextDocuments)r.closeTextDocument({textDocument:c});this.notebookDocuments.delete(o.notebookDocument.uri);for(let c of s.cells)this.notebookCellMap.delete(c.document)}})),Ux.Disposable.create(()=>{n.forEach(o=>o.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};Ile.NotebookDocuments=z6t});var khn=I(DWe=>{"use strict";p();Object.defineProperty(DWe,"__esModule",{value:!0});DWe.MonikerFeature=void 0;var G3o=ri(),$3o=a(t=>class extends t{get moniker(){return{on:a(e=>{let r=G3o.MonikerRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"MonikerFeature");DWe.MonikerFeature=$3o});var t9t=I(gc=>{"use strict";p();Object.defineProperty(gc,"__esModule",{value:!0});gc.createConnection=gc.combineFeatures=gc.combineNotebooksFeatures=gc.combineLanguagesFeatures=gc.combineWorkspaceFeatures=gc.combineWindowFeatures=gc.combineClientFeatures=gc.combineTracerFeatures=gc.combineTelemetryFeatures=gc.combineConsoleFeatures=gc._NotebooksImpl=gc._LanguagesImpl=gc.BulkUnregistration=gc.BulkRegistration=gc.ErrorMessageTracker=void 0;var Kr=ri(),Qx=pWe(),J6t=F6t(),To=mhn(),V3o=ghn(),W3o=Ahn(),z3o=yhn(),Y3o=H6t(),K3o=Ehn(),J3o=_hn(),Z3o=vhn(),X3o=Chn(),eFo=Shn(),tFo=Ihn(),rFo=xhn(),nFo=whn(),iFo=Y6t(),oFo=khn();function K6t(t){if(t!==null)return t}a(K6t,"null2Undefined");var Z6t=class{static{a(this,"ErrorMessageTracker")}constructor(){this._messages=Object.create(null)}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r)})}};gc.ErrorMessageTracker=Z6t;var NWe=class{static{a(this,"RemoteConsoleImpl")}constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(Kr.MessageType.Error,e)}warn(e){this.send(Kr.MessageType.Warning,e)}info(e){this.send(Kr.MessageType.Info,e)}log(e){this.send(Kr.MessageType.Log,e)}debug(e){this.send(Kr.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(Kr.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,Kr.RAL)().console.error("Sending log message failed")})}},X6t=class{static{a(this,"_RemoteWindowImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...r){let n={type:Kr.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(K6t)}showWarningMessage(e,...r){let n={type:Kr.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(K6t)}showInformationMessage(e,...r){let n={type:Kr.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(K6t)}},Phn=(0,K3o.ShowDocumentFeature)((0,To.ProgressFeature)(X6t)),Dhn;(function(t){function e(){return new MWe}a(e,"create"),t.create=e})(Dhn||(gc.BulkRegistration=Dhn={}));var MWe=class{static{a(this,"BulkRegistrationImpl")}constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=Qx.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let o=J6t.generateUuid();this._registrations.push({id:o,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},Nhn;(function(t){function e(){return new xIe(void 0,[])}a(e,"create"),t.create=e})(Nhn||(gc.BulkUnregistration=Nhn={}));var xIe=class{static{a(this,"BulkUnregistrationImpl")}constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(Kr.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=Qx.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let o={unregisterations:[n]};return this._connection.sendRequest(Kr.UnregistrationRequest.type,o).then(()=>{this._unregistrations.delete(r)},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},OWe=class{static{a(this,"RemoteClientImpl")}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,r,n){return e instanceof MWe?this.registerMany(e):e instanceof xIe?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let o=Qx.string(r)?r:r.method,s=J6t.generateUuid(),c={registrations:[{id:s,method:o,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(Kr.RegistrationRequest.type,c).then(l=>(e.add({id:s,method:o}),e),l=>(this.connection.console.info(`Registering request handler for ${o} failed.`),Promise.reject(l)))}registerSingle2(e,r){let n=Qx.string(e)?e:e.method,o=J6t.generateUuid(),s={registrations:[{id:o,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(Kr.RegistrationRequest.type,s).then(c=>Kr.Disposable.create(()=>{this.unregisterSingle(o,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${o} failed.`)})}),c=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(c)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(Kr.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(Kr.RegistrationRequest.type,r).then(()=>new xIe(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},e9t=class{static{a(this,"_RemoteWorkspaceImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function r(o){return o&&!!o.edit}a(r,"isApplyWorkspaceEditParams");let n=r(e)?e:{edit:e};return this.connection.sendRequest(Kr.ApplyWorkspaceEditRequest.type,n)}},Mhn=(0,J3o.FileOperationsFeature)((0,W3o.WorkspaceFoldersFeature)((0,V3o.ConfigurationFeature)(e9t))),LWe=class{static{a(this,"TracerImpl")}constructor(){this._trace=Kr.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,r){this._trace!==Kr.Trace.Off&&this.connection.sendNotification(Kr.LogTraceNotification.type,{message:e,verbose:this._trace===Kr.Trace.Verbose?r:void 0}).catch(()=>{})}},BWe=class{static{a(this,"TelemetryImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(Kr.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},FWe=class{static{a(this,"_LanguagesImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,To.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,To.attachPartialResult)(this.connection,r)}};gc._LanguagesImpl=FWe;var Ohn=(0,tFo.FoldingRangeFeature)((0,oFo.MonikerFeature)((0,nFo.DiagnosticFeature)((0,rFo.InlayHintFeature)((0,eFo.InlineValueFeature)((0,X3o.TypeHierarchyFeature)((0,Z3o.LinkedEditingRangeFeature)((0,Y3o.SemanticTokensFeature)((0,z3o.CallHierarchyFeature)(FWe))))))))),UWe=class{static{a(this,"_NotebooksImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,To.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,To.attachPartialResult)(this.connection,r)}};gc._NotebooksImpl=UWe;var Lhn=(0,iFo.NotebookSyncFeature)(UWe);function Bhn(t,e){return function(r){return e(t(r))}}a(Bhn,"combineConsoleFeatures");gc.combineConsoleFeatures=Bhn;function Fhn(t,e){return function(r){return e(t(r))}}a(Fhn,"combineTelemetryFeatures");gc.combineTelemetryFeatures=Fhn;function Uhn(t,e){return function(r){return e(t(r))}}a(Uhn,"combineTracerFeatures");gc.combineTracerFeatures=Uhn;function Qhn(t,e){return function(r){return e(t(r))}}a(Qhn,"combineClientFeatures");gc.combineClientFeatures=Qhn;function qhn(t,e){return function(r){return e(t(r))}}a(qhn,"combineWindowFeatures");gc.combineWindowFeatures=qhn;function jhn(t,e){return function(r){return e(t(r))}}a(jhn,"combineWorkspaceFeatures");gc.combineWorkspaceFeatures=jhn;function Hhn(t,e){return function(r){return e(t(r))}}a(Hhn,"combineLanguagesFeatures");gc.combineLanguagesFeatures=Hhn;function Ghn(t,e){return function(r){return e(t(r))}}a(Ghn,"combineNotebooksFeatures");gc.combineNotebooksFeatures=Ghn;function sFo(t,e){function r(o,s,c){return o&&s?c(o,s):o||s}return a(r,"combine"),{__brand:"features",console:r(t.console,e.console,Bhn),tracer:r(t.tracer,e.tracer,Uhn),telemetry:r(t.telemetry,e.telemetry,Fhn),client:r(t.client,e.client,Qhn),window:r(t.window,e.window,qhn),workspace:r(t.workspace,e.workspace,jhn),languages:r(t.languages,e.languages,Hhn),notebooks:r(t.notebooks,e.notebooks,Ghn)}}a(sFo,"combineFeatures");gc.combineFeatures=sFo;function aFo(t,e,r){let n=r&&r.console?new(r.console(NWe)):new NWe,o=t(n);n.rawAttach(o);let s=r&&r.tracer?new(r.tracer(LWe)):new LWe,c=r&&r.telemetry?new(r.telemetry(BWe)):new BWe,l=r&&r.client?new(r.client(OWe)):new OWe,u=r&&r.window?new(r.window(Phn)):new Phn,d=r&&r.workspace?new(r.workspace(Mhn)):new Mhn,f=r&&r.languages?new(r.languages(Ohn)):new Ohn,h=r&&r.notebooks?new(r.notebooks(Lhn)):new Lhn,m=[n,s,c,l,u,d,f,h];function g(v){return v instanceof Promise?v:Qx.thenable(v)?new Promise((b,T)=>{v.then(w=>b(w),w=>T(w))}):Promise.resolve(v)}a(g,"asPromise");let A,y,E,_={listen:a(()=>o.listen(),"listen"),sendRequest:a((v,...b)=>o.sendRequest(Qx.string(v)?v:v.method,...b),"sendRequest"),onRequest:a((v,b)=>o.onRequest(v,b),"onRequest"),sendNotification:a((v,b)=>{let T=Qx.string(v)?v:v.method;return o.sendNotification(T,b)},"sendNotification"),onNotification:a((v,b)=>o.onNotification(v,b),"onNotification"),onProgress:o.onProgress,sendProgress:o.sendProgress,onInitialize:a(v=>(y=v,{dispose:a(()=>{y=void 0},"dispose")}),"onInitialize"),onInitialized:a(v=>o.onNotification(Kr.InitializedNotification.type,v),"onInitialized"),onShutdown:a(v=>(A=v,{dispose:a(()=>{A=void 0},"dispose")}),"onShutdown"),onExit:a(v=>(E=v,{dispose:a(()=>{E=void 0},"dispose")}),"onExit"),get console(){return n},get telemetry(){return c},get tracer(){return s},get client(){return l},get window(){return u},get workspace(){return d},get languages(){return f},get notebooks(){return h},onDidChangeConfiguration:a(v=>o.onNotification(Kr.DidChangeConfigurationNotification.type,v),"onDidChangeConfiguration"),onDidChangeWatchedFiles:a(v=>o.onNotification(Kr.DidChangeWatchedFilesNotification.type,v),"onDidChangeWatchedFiles"),__textDocumentSync:void 0,onDidOpenTextDocument:a(v=>o.onNotification(Kr.DidOpenTextDocumentNotification.type,v),"onDidOpenTextDocument"),onDidChangeTextDocument:a(v=>o.onNotification(Kr.DidChangeTextDocumentNotification.type,v),"onDidChangeTextDocument"),onDidCloseTextDocument:a(v=>o.onNotification(Kr.DidCloseTextDocumentNotification.type,v),"onDidCloseTextDocument"),onWillSaveTextDocument:a(v=>o.onNotification(Kr.WillSaveTextDocumentNotification.type,v),"onWillSaveTextDocument"),onWillSaveTextDocumentWaitUntil:a(v=>o.onRequest(Kr.WillSaveTextDocumentWaitUntilRequest.type,v),"onWillSaveTextDocumentWaitUntil"),onDidSaveTextDocument:a(v=>o.onNotification(Kr.DidSaveTextDocumentNotification.type,v),"onDidSaveTextDocument"),sendDiagnostics:a(v=>o.sendNotification(Kr.PublishDiagnosticsNotification.type,v),"sendDiagnostics"),onHover:a(v=>o.onRequest(Kr.HoverRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onHover"),onCompletion:a(v=>o.onRequest(Kr.CompletionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onCompletion"),onCompletionResolve:a(v=>o.onRequest(Kr.CompletionResolveRequest.type,v),"onCompletionResolve"),onSignatureHelp:a(v=>o.onRequest(Kr.SignatureHelpRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onSignatureHelp"),onDeclaration:a(v=>o.onRequest(Kr.DeclarationRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDeclaration"),onDefinition:a(v=>o.onRequest(Kr.DefinitionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDefinition"),onTypeDefinition:a(v=>o.onRequest(Kr.TypeDefinitionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onTypeDefinition"),onImplementation:a(v=>o.onRequest(Kr.ImplementationRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onImplementation"),onReferences:a(v=>o.onRequest(Kr.ReferencesRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onReferences"),onDocumentHighlight:a(v=>o.onRequest(Kr.DocumentHighlightRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentHighlight"),onDocumentSymbol:a(v=>o.onRequest(Kr.DocumentSymbolRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentSymbol"),onWorkspaceSymbol:a(v=>o.onRequest(Kr.WorkspaceSymbolRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onWorkspaceSymbol"),onWorkspaceSymbolResolve:a(v=>o.onRequest(Kr.WorkspaceSymbolResolveRequest.type,v),"onWorkspaceSymbolResolve"),onCodeAction:a(v=>o.onRequest(Kr.CodeActionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onCodeAction"),onCodeActionResolve:a(v=>o.onRequest(Kr.CodeActionResolveRequest.type,(b,T)=>v(b,T)),"onCodeActionResolve"),onCodeLens:a(v=>o.onRequest(Kr.CodeLensRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onCodeLens"),onCodeLensResolve:a(v=>o.onRequest(Kr.CodeLensResolveRequest.type,(b,T)=>v(b,T)),"onCodeLensResolve"),onDocumentFormatting:a(v=>o.onRequest(Kr.DocumentFormattingRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onDocumentFormatting"),onDocumentRangeFormatting:a(v=>o.onRequest(Kr.DocumentRangeFormattingRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onDocumentRangeFormatting"),onDocumentOnTypeFormatting:a(v=>o.onRequest(Kr.DocumentOnTypeFormattingRequest.type,(b,T)=>v(b,T)),"onDocumentOnTypeFormatting"),onRenameRequest:a(v=>o.onRequest(Kr.RenameRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onRenameRequest"),onPrepareRename:a(v=>o.onRequest(Kr.PrepareRenameRequest.type,(b,T)=>v(b,T)),"onPrepareRename"),onDocumentLinks:a(v=>o.onRequest(Kr.DocumentLinkRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentLinks"),onDocumentLinkResolve:a(v=>o.onRequest(Kr.DocumentLinkResolveRequest.type,(b,T)=>v(b,T)),"onDocumentLinkResolve"),onDocumentColor:a(v=>o.onRequest(Kr.DocumentColorRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentColor"),onColorPresentation:a(v=>o.onRequest(Kr.ColorPresentationRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onColorPresentation"),onFoldingRanges:a(v=>o.onRequest(Kr.FoldingRangeRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onFoldingRanges"),onSelectionRanges:a(v=>o.onRequest(Kr.SelectionRangeRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onSelectionRanges"),onExecuteCommand:a(v=>o.onRequest(Kr.ExecuteCommandRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onExecuteCommand"),dispose:a(()=>o.dispose(),"dispose")};for(let v of m)v.attach(_);return o.onRequest(Kr.InitializeRequest.type,v=>{e.initialize(v),Qx.string(v.trace)&&(s.trace=Kr.Trace.fromString(v.trace));for(let b of m)b.initialize(v.capabilities);if(y){let b=y(v,new Kr.CancellationTokenSource().token,(0,To.attachWorkDone)(o,v),void 0);return g(b).then(T=>{if(T instanceof Kr.ResponseError)return T;let w=T;w||(w={capabilities:{}});let R=w.capabilities;R||(R={},w.capabilities=R),R.textDocumentSync===void 0||R.textDocumentSync===null?R.textDocumentSync=Qx.number(_.__textDocumentSync)?_.__textDocumentSync:Kr.TextDocumentSyncKind.None:!Qx.number(R.textDocumentSync)&&!Qx.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=Qx.number(_.__textDocumentSync)?_.__textDocumentSync:Kr.TextDocumentSyncKind.None);for(let x of m)x.fillServerCapabilities(R);return w})}else{let b={capabilities:{textDocumentSync:Kr.TextDocumentSyncKind.None}};for(let T of m)T.fillServerCapabilities(b.capabilities);return b}}),o.onRequest(Kr.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,A)return A(new Kr.CancellationTokenSource().token)}),o.onNotification(Kr.ExitNotification.type,()=>{try{E&&E()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),o.onNotification(Kr.SetTraceNotification.type,v=>{s.trace=Kr.Trace.fromString(v.value)}),_}a(aFo,"createConnection");gc.createConnection=aFo});var $hn=I(DC=>{"use strict";p();Object.defineProperty(DC,"__esModule",{value:!0});DC.resolveModulePath=DC.FileSystem=DC.resolveGlobalYarnPath=DC.resolveGlobalNodePath=DC.resolve=DC.uriToFilePath=void 0;var cFo=require("url"),kP=require("path"),r9t=require("fs"),s9t=require("child_process");function lFo(t){let e=cFo.parse(t);if(e.protocol!=="file:"||!e.path)return;let r=e.path.split("/");for(var n=0,o=r.length;n1){let s=r[0],c=r[1];s.length===0&&c.length>1&&c[1]===":"&&r.shift()}return kP.normalize(r.join("/"))}a(lFo,"uriToFilePath");DC.uriToFilePath=lFo;function n9t(){return process.platform==="win32"}a(n9t,"isWindows");function QWe(t,e,r,n){let o="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((c,l)=>{let u=process.env,d=Object.create(null);Object.keys(u).forEach(f=>d[f]=u[f]),e&&r9t.existsSync(e)&&(d[o]?d[o]=e+kP.delimiter+d[o]:d[o]=e,n&&n(`NODE_PATH value is: ${d[o]}`)),d.ELECTRON_RUN_AS_NODE="1";try{let f=(0,s9t.fork)("",[],{cwd:r,env:d,execArgv:["-e",s]});if(f.pid===void 0){l(new Error(`Starting process to resolve node module ${t} failed`));return}f.on("error",m=>{l(m)}),f.on("message",m=>{m.c==="r"&&(f.send({c:"e"}),m.s?c(m.r):l(new Error(`Failed to resolve module: ${t}`)))});let h={c:"rs",a:t};f.send(h)}catch(f){l(f)}})}a(QWe,"resolve");DC.resolve=QWe;function i9t(t){let e="npm",r=Object.create(null);Object.keys(process.env).forEach(s=>r[s]=process.env[s]),r.NO_UPDATE_NOTIFIER="true";let n={encoding:"utf8",env:r};n9t()&&(e="npm.cmd",n.shell=!0);let o=a(()=>{},"handler");try{process.on("SIGPIPE",o);let s=(0,s9t.spawnSync)(e,["config","get","prefix"],n).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let c=s.trim();return t&&t(`'npm config get prefix' value is: ${c}`),c.length>0?n9t()?kP.join(c,"node_modules"):kP.join(c,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",o)}}a(i9t,"resolveGlobalNodePath");DC.resolveGlobalNodePath=i9t;function uFo(t){let e="yarn",r={encoding:"utf8"};n9t()&&(e="yarn.cmd",r.shell=!0);let n=a(()=>{},"handler");try{process.on("SIGPIPE",n);let o=(0,s9t.spawnSync)(e,["global","dir","--json"],r),s=o.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),o.stderr&&t(o.stderr));return}let c=s.trim().split(/\r?\n/);for(let l of c)try{let u=JSON.parse(l);if(u.type==="log")return kP.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}a(uFo,"resolveGlobalYarnPath");DC.resolveGlobalYarnPath=uFo;var o9t;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!r9t.existsSync(__filename.toUpperCase())||!r9t.existsSync(__filename.toLowerCase())),e}a(r,"isCaseSensitive"),t.isCaseSensitive=r;function n(o,s){return r()?kP.normalize(s).indexOf(kP.normalize(o))===0:kP.normalize(s).toLowerCase().indexOf(kP.normalize(o).toLowerCase())===0}a(n,"isParent"),t.isParent=n})(o9t||(DC.FileSystem=o9t={}));function dFo(t,e,r,n){return r?(kP.isAbsolute(r)||(r=kP.join(t,r)),QWe(e,r,r,n).then(o=>o9t.isParent(r,o)?o:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,o=>QWe(e,i9t(n),t,n))):QWe(e,i9t(n),t,n)}a(dFo,"resolveModulePath");DC.resolveModulePath=dFo});var a9t=I((eLu,Vhn)=>{"use strict";p();Vhn.exports=ri()});var Whn=I(qWe=>{"use strict";p();Object.defineProperty(qWe,"__esModule",{value:!0});qWe.InlineCompletionFeature=void 0;var fFo=ri(),pFo=a(t=>class extends t{get inlineCompletion(){return{on:a(e=>this.connection.onRequest(fFo.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineCompletionFeature");qWe.InlineCompletionFeature=pFo});var Khn=I(oE=>{"use strict";p();var hFo=oE&&oE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Yhn=oE&&oE.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hFo(e,t,r)};Object.defineProperty(oE,"__esModule",{value:!0});oE.ProposedFeatures=oE.NotebookDocuments=oE.TextDocuments=oE.SemanticTokensBuilder=void 0;var mFo=H6t();Object.defineProperty(oE,"SemanticTokensBuilder",{enumerable:!0,get:a(function(){return mFo.SemanticTokensBuilder},"get")});var gFo=Whn();Yhn(ri(),oE);var AFo=W6t();Object.defineProperty(oE,"TextDocuments",{enumerable:!0,get:a(function(){return AFo.TextDocuments},"get")});var yFo=Y6t();Object.defineProperty(oE,"NotebookDocuments",{enumerable:!0,get:a(function(){return yFo.NotebookDocuments},"get")});Yhn(t9t(),oE);var zhn;(function(t){t.all={__brand:"features",languages:gFo.InlineCompletionFeature}})(zhn||(oE.ProposedFeatures=zhn={}))});var Xc=I(qx=>{"use strict";p();var EFo=qx&&qx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),emn=qx&&qx.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EFo(e,t,r)};Object.defineProperty(qx,"__esModule",{value:!0});qx.createConnection=qx.Files=void 0;var Jhn=require("node:util"),c9t=pWe(),_Fo=t9t(),wIe=$hn(),WY=a9t();emn(a9t(),qx);emn(Khn(),qx);var Zhn;(function(t){t.uriToFilePath=wIe.uriToFilePath,t.resolveGlobalNodePath=wIe.resolveGlobalNodePath,t.resolveGlobalYarnPath=wIe.resolveGlobalYarnPath,t.resolve=wIe.resolve,t.resolveModulePath=wIe.resolveModulePath})(Zhn||(qx.Files=Zhn={}));var Xhn;function jWe(){if(Xhn!==void 0)try{Xhn.end()}catch{}}a(jWe,"endProtocolConnection");var xle=!1,tmn;function vFo(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(tmn=setInterval(()=>{try{process.kill(n,0)}catch{jWe(),process.exit(xle?0:1)}},3e3))}catch{}}a(e,"runTimer");for(let r=2;r{let e=t.processId;c9t.number(e)&&tmn===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(xle?0:1)}},3e3)},"initialize"),get shutdownReceived(){return xle},set shutdownReceived(t){xle=t},exit:a(t=>{jWe(),process.exit(t)},"exit")};function bFo(t,e,r,n){let o,s,c,l;return t!==void 0&&t.__brand==="features"&&(o=t,t=e,e=r,r=n),WY.ConnectionStrategy.is(t)||WY.ConnectionOptions.is(t)?l=t:(s=t,c=e,l=r),SFo(s,c,l,o)}a(bFo,"createConnection");qx.createConnection=bFo;function SFo(t,e,r,n){let o=!1;if(!t&&!e&&process.argv.length>2){let u,d,f=process.argv.slice(2);for(let h=0;h{jWe(),process.exit(xle?0:1)}),u.on("close",()=>{jWe(),process.exit(xle?0:1)})}let l=a(u=>{let d=(0,WY.createProtocolConnection)(t,e,u,r);return o&&TFo(u),d},"connectionFactory");return(0,_Fo.createConnection)(l,CFo,n)}a(SFo,"_createConnection");function TFo(t){function e(n){return n.map(o=>typeof o=="string"?o:(0,Jhn.inspect)(o)).join(" ")}a(e,"serialize");let r=new Map;console.assert=a(function(o,...s){if(!o)if(s.length===0)t.error("Assertion failed");else{let[c,...l]=s;t.error(`Assertion failed: ${c} ${e(l)}`)}},"assert"),console.count=a(function(o="default"){let s=String(o),c=r.get(s)??0;c+=1,r.set(s,c),t.log(`${s}: ${s}`)},"count"),console.countReset=a(function(o){o===void 0?r.clear():r.delete(String(o))},"countReset"),console.debug=a(function(...o){t.log(e(o))},"debug"),console.dir=a(function(o,s){t.log((0,Jhn.inspect)(o,s))},"dir"),console.log=a(function(...o){t.log(e(o))},"log"),console.error=a(function(...o){t.error(e(o))},"error"),console.trace=a(function(...o){let s=new Error().stack.replace(/(.+\n){2}/,""),c="Trace";o.length!==0&&(c+=`: ${e(o)}`),t.log(`${c} -${s}`)},"trace"),console.warn=a(function(...o){t.warn(e(o))},"warn")}a(TFo,"patchConsole")});var PP=I((fLu,rmn)=>{"use strict";p();rmn.exports=Xc()});var Mmn=I((n3u,Nmn)=>{"use strict";p();Nmn.exports=a(function(e){if(e===void 0&&(e=2),e>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+e+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var r=Error.prepareStackTrace;Error.prepareStackTrace=function(o,s){return s};var n=new Error().stack;if(Error.prepareStackTrace=r,n!==null&&typeof n=="object")return n[e]?n[e].getFileName():void 0},"getCallerFile")});var D0n=I(s0=>{"use strict";p();var G9t=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"a"),I8o=G9t(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sync=t.isexe=void 0;var e=require("node:fs"),r=require("node:fs/promises"),n=a(async(l,u={})=>{let{ignoreErrors:d=!1}=u;try{return s(await(0,r.stat)(l),u)}catch(f){let h=f;if(d||h.code==="EACCES")return!1;throw h}},"q");t.isexe=n;var o=a((l,u={})=>{let{ignoreErrors:d=!1}=u;try{return s((0,e.statSync)(l),u)}catch(f){let h=f;if(d||h.code==="EACCES")return!1;throw h}},"m");t.sync=o;var s=a((l,u)=>l.isFile()&&c(l,u),"d"),c=a((l,u)=>{let d=u.uid??process.getuid?.(),f=u.groups??process.getgroups?.()??[],h=u.gid??process.getgid?.()??f[0];if(d===void 0||h===void 0)throw new Error("cannot get uid or gid");let m=new Set([h,...f]),g=l.mode,A=l.uid,y=l.gid,E=parseInt("100",8),_=parseInt("010",8),v=parseInt("001",8),b=E|_;return!!(g&v||g&_&&m.has(y)||g&E&&A===d||g&b&&d===0)},"A")}),x8o=G9t(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sync=t.isexe=void 0;var e=require("node:fs"),r=require("node:fs/promises"),n=require("node:path"),o=a(async(u,d={})=>{let{ignoreErrors:f=!1}=d;try{return l(await(0,r.stat)(u),u,d)}catch(h){let m=h;if(f||m.code==="EACCES")return!1;throw m}},"F");t.isexe=o;var s=a((u,d={})=>{let{ignoreErrors:f=!1}=d;try{return l((0,e.statSync)(u),u,d)}catch(h){let m=h;if(f||m.code==="EACCES")return!1;throw m}},"L");t.sync=s;var c=a((u,d)=>{let{pathExt:f=process.env.PATHEXT||""}=d,h=f.split(n.delimiter);if(h.indexOf("")!==-1)return!0;for(let m of h){let g=m.toLowerCase(),A=u.substring(u.length-g.length).toLowerCase();if(g&&A===g)return!0}return!1},"B"),l=a((u,d,f)=>u.isFile()&&c(d,f),"y")}),w8o=G9t(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})}),x0n=s0&&s0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),R8o=s0&&s0.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),w0n=s0&&s0.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"t");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{p();var{isexe:D8o,sync:N8o}=D0n(),{join:M8o,delimiter:O8o,sep:N0n,posix:M0n}=require("path"),O0n=process.platform==="win32",L0n=new RegExp(`[${M0n.sep}${N0n===M0n.sep?"":N0n}]`.replace(/(\\)/g,"\\$1")),L8o=new RegExp(`^\\.${L0n.source}`),B0n=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),F0n=a((t,{path:e=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=O8o})=>{let o=t.match(L0n)?[""]:[...O0n?[process.cwd()]:[],...(e||"").split(n)];if(O0n){let s=r||[".EXE",".CMD",".BAT",".COM"].join(n),c=s.split(n).flatMap(l=>[l,l.toLowerCase()]);return t.includes(".")&&c[0]!==""&&c.unshift(""),{pathEnv:o,pathExt:c,pathExtExe:s}}return{pathEnv:o,pathExt:[""]}},"getPathInfo"),U0n=a((t,e)=>{let r=/^".*"$/.test(t)?t.slice(1,-1):t;return(!r&&L8o.test(e)?e.slice(0,2):"")+M8o(r,e)},"getPathPart"),Q0n=a(async(t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=F0n(t,e),s=[];for(let c of r){let l=U0n(c,t);for(let u of n){let d=l+u;if(await D8o(d,{pathExt:o,ignoreErrors:!0})){if(!e.all)return d;s.push(d)}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw B0n(t)},"which"),B8o=a((t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=F0n(t,e),s=[];for(let c of r){let l=U0n(c,t);for(let u of n){let d=l+u;if(N8o(d,{pathExt:o,ignoreErrors:!0})){if(!e.all)return d;s.push(d)}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw B0n(t)},"whichSync");q0n.exports=Q0n;Q0n.sync=B8o});var GIe=I((U7u,rAn)=>{"use strict";p();var Zgn="[^\\\\/]",_9o="(?=.)",Xgn="[^/]",lUt="(?:\\/|$)",eAn="(?:^|\\/)",uUt=`\\.{1,2}${lUt}`,v9o="(?!\\.)",C9o=`(?!${eAn}${uUt})`,b9o=`(?!\\.{0,1}${lUt})`,S9o=`(?!${uUt})`,T9o="[^.\\/]",I9o=`${Xgn}*?`,x9o="/",tAn={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:_9o,QMARK:Xgn,END_ANCHOR:lUt,DOTS_SLASH:uUt,NO_DOT:v9o,NO_DOTS:C9o,NO_DOT_SLASH:b9o,NO_DOTS_SLASH:S9o,QMARK_NO_DOT:T9o,STAR:I9o,START_ANCHOR:eAn,SEP:x9o},w9o={...tAn,SLASH_LITERAL:"[\\\\/]",QMARK:Zgn,STAR:`${Zgn}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},R9o={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};rAn.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:R9o,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?w9o:tAn}}});var $Ie=I(LC=>{"use strict";p();var{REGEX_BACKSLASH:k9o,REGEX_REMOVE_BACKSLASH:P9o,REGEX_SPECIAL_CHARS:D9o,REGEX_SPECIAL_CHARS_GLOBAL:N9o}=GIe();LC.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);LC.hasRegexChars=t=>D9o.test(t);LC.isRegexChar=t=>t.length===1&&LC.hasRegexChars(t);LC.escapeRegex=t=>t.replace(N9o,"\\$1");LC.toPosixSlashes=t=>t.replace(k9o,"/");LC.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};LC.removeBackslashes=t=>t.replace(P9o,e=>e==="\\"?"":e);LC.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?LC.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};LC.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};LC.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",s=`${n}(?:${t})${o}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};LC.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var uAn=I((H7u,lAn)=>{"use strict";p();var nAn=$Ie(),{CHAR_ASTERISK:dUt,CHAR_AT:M9o,CHAR_BACKWARD_SLASH:VIe,CHAR_COMMA:O9o,CHAR_DOT:fUt,CHAR_EXCLAMATION_MARK:pUt,CHAR_FORWARD_SLASH:cAn,CHAR_LEFT_CURLY_BRACE:hUt,CHAR_LEFT_PARENTHESES:mUt,CHAR_LEFT_SQUARE_BRACKET:L9o,CHAR_PLUS:B9o,CHAR_QUESTION_MARK:iAn,CHAR_RIGHT_CURLY_BRACE:F9o,CHAR_RIGHT_PARENTHESES:oAn,CHAR_RIGHT_SQUARE_BRACKET:U9o}=GIe(),sAn=a(t=>t===cAn||t===VIe,"isPathSeparator"),aAn=a(t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},"depth"),Q9o=a((t,e)=>{let r=e||{},n=t.length-1,o=r.parts===!0||r.scanToEnd===!0,s=[],c=[],l=[],u=t,d=-1,f=0,h=0,m=!1,g=!1,A=!1,y=!1,E=!1,_=!1,v=!1,b=!1,T=!1,w=!1,R=0,x,P,D={value:"",depth:0,isGlob:!1},N=a(()=>d>=n,"eos"),L=a(()=>u.charCodeAt(d+1),"peek"),B=a(()=>(x=P,u.charCodeAt(++d)),"advance");for(;d0&&(M=u.slice(0,f),u=u.slice(f),h-=f),q&&A===!0&&h>0?(q=u.slice(0,h),O=u.slice(h)):A===!0?(q="",O=u):q=u,q&&q!==""&&q!=="/"&&q!==u&&sAn(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),r.unescape===!0&&(O&&(O=nAn.removeBackslashes(O)),q&&v===!0&&(q=nAn.removeBackslashes(q)));let j={prefix:M,input:t,start:f,base:q,glob:O,isBrace:m,isBracket:g,isGlob:A,isExtglob:y,isGlobstar:E,negated:b,negatedExtglob:T};if(r.tokens===!0&&(j.maxDepth=0,sAn(P)||c.push(D),j.tokens=c),r.parts===!0||r.tokens===!0){let Q;for(let U=0;U{"use strict";p();var WIe=GIe(),QS=$Ie(),{MAX_LENGTH:Dze,POSIX_REGEX_SOURCE:q9o,REGEX_NON_SPECIAL_CHARS:j9o,REGEX_SPECIAL_CHARS_BACKREF:H9o,REPLACEMENTS:dAn}=WIe,G9o=a((t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(o=>QS.escapeRegex(o)).join("..")}return r},"expandRange"),Qle=a((t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,"syntaxError"),fAn=a(t=>{let e=[],r=0,n=0,o=0,s="",c=!1;for(let l of t){if(c===!0){s+=l,c=!1;continue}if(l==="\\"){s+=l,c=!0;continue}if(l==='"'){o=o===1?0:1,s+=l;continue}if(o===0){if(l==="[")r++;else if(l==="]"&&r>0)r--;else if(r===0){if(l==="(")n++;else if(l===")"&&n>0)n--;else if(l==="|"&&n===0){e.push(s),s="";continue}}}s+=l}return e.push(s),e},"splitTopLevel"),$9o=a(t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},"isPlainBranch"),pAn=a(t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if($9o(e))return e.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),V9o=a(t=>{let e=t.map(pAn).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,o=0,s=!1;for(let c=1;c0){r--;continue}if(!(r>0)){if(l==="("){n++;continue}if(l===")"&&(n--,n===0))return e===!0&&c!==t.length-1?void 0:{type:t[0],body:t.slice(2,c),end:c}}}}},"parseRepeatedExtglob"),W9o=a(t=>{let e=0,r=[];for(;el.trim());if(s.length!==1)return;let c=pAn(s[0]);if(!c||c.length!==1)return;r.push(c),e+=o.end+1}return r.length<1?void 0:`${r.length===1?QS.escapeRegex(r[0]):`[${r.map(o=>QS.escapeRegex(o)).join("")}]`}*`},"getStarExtglobSequenceOutput"),z9o=a(t=>{let e=0,r=t.trim(),n=gUt(r);for(;n;)e++,r=n.body.trim(),n=gUt(r);return e},"repeatedExtglobRecursion"),Y9o=a((t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:WIe.DEFAULT_MAX_EXTGLOB_RECURSION,n=fAn(t).map(o=>o.trim());if(n.length>1&&(n.some(o=>o==="")||n.some(o=>/^[*?]+$/.test(o))||V9o(n)))return{risky:!0};for(let o of n){let s=W9o(o);if(s)return{risky:!0,safeOutput:s};if(z9o(o)>r)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),AUt=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=dAn[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Dze,r.maxLength):Dze,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},c=[s],l=r.capture?"":"?:",u=WIe.globChars(r.windows),d=WIe.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:h,SLASH_LITERAL:m,ONE_CHAR:g,DOTS_SLASH:A,NO_DOT:y,NO_DOT_SLASH:E,NO_DOTS_SLASH:_,QMARK:v,QMARK_NO_DOT:b,STAR:T,START_ANCHOR:w}=u,R=a(ge=>`(${l}(?:(?!${w}${ge.dot?A:f}).)*?)`,"globstar"),x=r.dot?"":y,P=r.dot?v:b,D=r.bash===!0?R(r):T;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let N={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:c};t=QS.removePrefix(t,N),o=t.length;let L=[],B=[],q=[],M=s,O,j=a(()=>N.index===o-1,"eos"),Q=N.peek=(ge=1)=>t[N.index+ge],U=N.advance=()=>t[++N.index]||"",Y=a(()=>t.slice(N.index+1),"remaining"),W=a((ge="",Ue=0)=>{N.consumed+=ge,N.index+=Ue},"consume"),V=a(ge=>{N.output+=ge.output!=null?ge.output:ge.value,W(ge.value)},"append"),z=a(()=>{let ge=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)U(),N.start++,ge++;return ge%2===0?!1:(N.negated=!0,N.start++,!0)},"negate"),ie=a(ge=>{N[ge]++,q.push(ge)},"increment"),H=a(ge=>{N[ge]--,q.pop()},"decrement"),re=a(ge=>{if(M.type==="globstar"){let Ue=N.braces>0&&(ge.type==="comma"||ge.type==="brace"),ke=ge.extglob===!0||L.length&&(ge.type==="pipe"||ge.type==="paren");ge.type!=="slash"&&ge.type!=="paren"&&!Ue&&!ke&&(N.output=N.output.slice(0,-M.output.length),M.type="star",M.value="*",M.output=D,N.output+=M.output)}if(L.length&&ge.type!=="paren"&&(L[L.length-1].inner+=ge.value),(ge.value||ge.output)&&V(ge),M&&M.type==="text"&&ge.type==="text"){M.output=(M.output||M.value)+ge.value,M.value+=ge.value;return}ge.prev=M,c.push(ge),M=ge},"push"),le=a((ge,Ue)=>{let ke={...d[Ue],conditions:1,inner:""};ke.prev=M,ke.parens=N.parens,ke.output=N.output,ke.startIndex=N.index,ke.tokensIndex=c.length;let X=(r.capture?"(":"")+ke.open;ie("parens"),re({type:ge,value:Ue,output:N.output?"":g}),re({type:"paren",extglob:!0,value:U(),output:X}),L.push(ke)},"extglobOpen"),Le=a(ge=>{let Ue=t.slice(ge.startIndex,N.index+1),ke=t.slice(ge.startIndex+2,N.index),X=Y9o(ke,r);if((ge.type==="plus"||ge.type==="star")&&X.risky){let he=X.safeOutput?(ge.output?"":g)+(r.capture?`(${X.safeOutput})`:X.safeOutput):void 0,Z=c[ge.tokensIndex];Z.type="text",Z.value=Ue,Z.output=he||QS.escapeRegex(Ue);for(let ue=ge.tokensIndex+1;ue1&&ge.inner.includes("/")&&(he=R(r)),(he!==D||j()||/^\)+$/.test(Y()))&&(ee=ge.close=`)$))${he}`),ge.inner.includes("*")&&(K=Y())&&/^\.[^\\/.]+$/.test(K)){let Z=AUt(K,{...e,fastpaths:!1}).output;ee=ge.close=`)${Z})${he})`}ge.prev.type==="bos"&&(N.negatedExtglob=!0)}re({type:"paren",extglob:!0,value:O,output:ee}),H("parens")},"extglobClose");if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let ge=!1,Ue=t.replace(H9o,(ke,X,ee,K,he,Z)=>K==="\\"?(ge=!0,ke):K==="?"?X?X+K+(he?v.repeat(he.length):""):Z===0?P+(he?v.repeat(he.length):""):v.repeat(ee.length):K==="."?f.repeat(ee.length):K==="*"?X?X+K+(he?D:""):D:X?ke:`\\${ke}`);return ge===!0&&(r.unescape===!0?Ue=Ue.replace(/\\/g,""):Ue=Ue.replace(/\\+/g,ke=>ke.length%2===0?"\\\\":ke?"\\":"")),Ue===t&&r.contains===!0?(N.output=t,N):(N.output=QS.wrapOutput(Ue,N,e),N)}for(;!j();){if(O=U(),O==="\0")continue;if(O==="\\"){let ke=Q();if(ke==="/"&&r.bash!==!0||ke==="."||ke===";")continue;if(!ke){O+="\\",re({type:"text",value:O});continue}let X=/^\\+/.exec(Y()),ee=0;if(X&&X[0].length>2&&(ee=X[0].length,N.index+=ee,ee%2!==0&&(O+="\\")),r.unescape===!0?O=U():O+=U(),N.brackets===0){re({type:"text",value:O});continue}}if(N.brackets>0&&(O!=="]"||M.value==="["||M.value==="[^")){if(r.posix!==!1&&O===":"){let ke=M.value.slice(1);if(ke.includes("[")&&(M.posix=!0,ke.includes(":"))){let X=M.value.lastIndexOf("["),ee=M.value.slice(0,X),K=M.value.slice(X+2),he=q9o[K];if(he){M.value=ee+he,N.backtrack=!0,U(),!s.output&&c.indexOf(M)===1&&(s.output=g);continue}}}(O==="["&&Q()!==":"||O==="-"&&Q()==="]")&&(O=`\\${O}`),O==="]"&&(M.value==="["||M.value==="[^")&&(O=`\\${O}`),r.posix===!0&&O==="!"&&M.value==="["&&(O="^"),M.value+=O,V({value:O});continue}if(N.quotes===1&&O!=='"'){O=QS.escapeRegex(O),M.value+=O,V({value:O});continue}if(O==='"'){N.quotes=N.quotes===1?0:1,r.keepQuotes===!0&&re({type:"text",value:O});continue}if(O==="("){ie("parens"),re({type:"paren",value:O});continue}if(O===")"){if(N.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Qle("opening","("));let ke=L[L.length-1];if(ke&&N.parens===ke.parens+1){Le(L.pop());continue}re({type:"paren",value:O,output:N.parens?")":"\\)"}),H("parens");continue}if(O==="["){if(r.nobracket===!0||!Y().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Qle("closing","]"));O=`\\${O}`}else ie("brackets");re({type:"bracket",value:O});continue}if(O==="]"){if(r.nobracket===!0||M&&M.type==="bracket"&&M.value.length===1){re({type:"text",value:O,output:`\\${O}`});continue}if(N.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Qle("opening","["));re({type:"text",value:O,output:`\\${O}`});continue}H("brackets");let ke=M.value.slice(1);if(M.posix!==!0&&ke[0]==="^"&&!ke.includes("/")&&(O=`/${O}`),M.value+=O,V({value:O}),r.literalBrackets===!1||QS.hasRegexChars(ke))continue;let X=QS.escapeRegex(M.value);if(N.output=N.output.slice(0,-M.value.length),r.literalBrackets===!0){N.output+=X,M.value=X;continue}M.value=`(${l}${X}|${M.value})`,N.output+=M.value;continue}if(O==="{"&&r.nobrace!==!0){ie("braces");let ke={type:"brace",value:O,output:"(",outputIndex:N.output.length,tokensIndex:N.tokens.length};B.push(ke),re(ke);continue}if(O==="}"){let ke=B[B.length-1];if(r.nobrace===!0||!ke){re({type:"text",value:O,output:O});continue}let X=")";if(ke.dots===!0){let ee=c.slice(),K=[];for(let he=ee.length-1;he>=0&&(c.pop(),ee[he].type!=="brace");he--)ee[he].type!=="dots"&&K.unshift(ee[he].value);X=G9o(K,r),N.backtrack=!0}if(ke.comma!==!0&&ke.dots!==!0){let ee=N.output.slice(0,ke.outputIndex),K=N.tokens.slice(ke.tokensIndex);ke.value=ke.output="\\{",O=X="\\}",N.output=ee;for(let he of K)N.output+=he.output||he.value}re({type:"brace",value:O,output:X}),H("braces"),B.pop();continue}if(O==="|"){L.length>0&&L[L.length-1].conditions++,re({type:"text",value:O});continue}if(O===","){let ke=O,X=B[B.length-1];X&&q[q.length-1]==="braces"&&(X.comma=!0,ke="|"),re({type:"comma",value:O,output:ke});continue}if(O==="/"){if(M.type==="dot"&&N.index===N.start+1){N.start=N.index+1,N.consumed="",N.output="",c.pop(),M=s;continue}re({type:"slash",value:O,output:m});continue}if(O==="."){if(N.braces>0&&M.type==="dot"){M.value==="."&&(M.output=f);let ke=B[B.length-1];M.type="dots",M.output+=O,M.value+=O,ke.dots=!0;continue}if(N.braces+N.parens===0&&M.type!=="bos"&&M.type!=="slash"){re({type:"text",value:O,output:f});continue}re({type:"dot",value:O,output:f});continue}if(O==="?"){if(!(M&&M.value==="(")&&r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){le("qmark",O);continue}if(M&&M.type==="paren"){let X=Q(),ee=O;(M.value==="("&&!/[!=<:]/.test(X)||X==="<"&&!/<([!=]|\w+>)/.test(Y()))&&(ee=`\\${O}`),re({type:"text",value:O,output:ee});continue}if(r.dot!==!0&&(M.type==="slash"||M.type==="bos")){re({type:"qmark",value:O,output:b});continue}re({type:"qmark",value:O,output:v});continue}if(O==="!"){if(r.noextglob!==!0&&Q()==="("&&(Q(2)!=="?"||!/[!=<:]/.test(Q(3)))){le("negate",O);continue}if(r.nonegate!==!0&&N.index===0){z();continue}}if(O==="+"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){le("plus",O);continue}if(M&&M.value==="("||r.regex===!1){re({type:"plus",value:O,output:h});continue}if(M&&(M.type==="bracket"||M.type==="paren"||M.type==="brace")||N.parens>0){re({type:"plus",value:O});continue}re({type:"plus",value:h});continue}if(O==="@"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){re({type:"at",extglob:!0,value:O,output:""});continue}re({type:"text",value:O});continue}if(O!=="*"){(O==="$"||O==="^")&&(O=`\\${O}`);let ke=j9o.exec(Y());ke&&(O+=ke[0],N.index+=ke[0].length),re({type:"text",value:O});continue}if(M&&(M.type==="globstar"||M.star===!0)){M.type="star",M.star=!0,M.value+=O,M.output=D,N.backtrack=!0,N.globstar=!0,W(O);continue}let ge=Y();if(r.noextglob!==!0&&/^\([^?]/.test(ge)){le("star",O);continue}if(M.type==="star"){if(r.noglobstar===!0){W(O);continue}let ke=M.prev,X=ke.prev,ee=ke.type==="slash"||ke.type==="bos",K=X&&(X.type==="star"||X.type==="globstar");if(r.bash===!0&&(!ee||ge[0]&&ge[0]!=="/")){re({type:"star",value:O,output:""});continue}let he=N.braces>0&&(ke.type==="comma"||ke.type==="brace"),Z=L.length&&(ke.type==="pipe"||ke.type==="paren");if(!ee&&ke.type!=="paren"&&!he&&!Z){re({type:"star",value:O,output:""});continue}for(;ge.slice(0,3)==="/**";){let ue=t[N.index+4];if(ue&&ue!=="/")break;ge=ge.slice(3),W("/**",3)}if(ke.type==="bos"&&j()){M.type="globstar",M.value+=O,M.output=R(r),N.output=M.output,N.globstar=!0,W(O);continue}if(ke.type==="slash"&&ke.prev.type!=="bos"&&!K&&j()){N.output=N.output.slice(0,-(ke.output+M.output).length),ke.output=`(?:${ke.output}`,M.type="globstar",M.output=R(r)+(r.strictSlashes?")":"|$)"),M.value+=O,N.globstar=!0,N.output+=ke.output+M.output,W(O);continue}if(ke.type==="slash"&&ke.prev.type!=="bos"&&ge[0]==="/"){let ue=ge[1]!==void 0?"|$":"";N.output=N.output.slice(0,-(ke.output+M.output).length),ke.output=`(?:${ke.output}`,M.type="globstar",M.output=`${R(r)}${m}|${m}${ue})`,M.value+=O,N.output+=ke.output+M.output,N.globstar=!0,W(O+U()),re({type:"slash",value:"/",output:""});continue}if(ke.type==="bos"&&ge[0]==="/"){M.type="globstar",M.value+=O,M.output=`(?:^|${m}|${R(r)}${m})`,N.output=M.output,N.globstar=!0,W(O+U()),re({type:"slash",value:"/",output:""});continue}N.output=N.output.slice(0,-M.output.length),M.type="globstar",M.output=R(r),M.value+=O,N.output+=M.output,N.globstar=!0,W(O);continue}let Ue={type:"star",value:O,output:D};if(r.bash===!0){Ue.output=".*?",(M.type==="bos"||M.type==="slash")&&(Ue.output=x+Ue.output),re(Ue);continue}if(M&&(M.type==="bracket"||M.type==="paren")&&r.regex===!0){Ue.output=O,re(Ue);continue}(N.index===N.start||M.type==="slash"||M.type==="dot")&&(M.type==="dot"?(N.output+=E,M.output+=E):r.dot===!0?(N.output+=_,M.output+=_):(N.output+=x,M.output+=x),Q()!=="*"&&(N.output+=g,M.output+=g)),re(Ue)}for(;N.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qle("closing","]"));N.output=QS.escapeLast(N.output,"["),H("brackets")}for(;N.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qle("closing",")"));N.output=QS.escapeLast(N.output,"("),H("parens")}for(;N.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qle("closing","}"));N.output=QS.escapeLast(N.output,"{"),H("braces")}if(r.strictSlashes!==!0&&(M.type==="star"||M.type==="bracket")&&re({type:"maybe_slash",value:"",output:`${m}?`}),N.backtrack===!0){N.output="";for(let ge of N.tokens)N.output+=ge.output!=null?ge.output:ge.value,ge.suffix&&(N.output+=ge.suffix)}return N},"parse");AUt.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Dze,r.maxLength):Dze,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);t=dAn[t]||t;let{DOT_LITERAL:s,SLASH_LITERAL:c,ONE_CHAR:l,DOTS_SLASH:u,NO_DOT:d,NO_DOTS:f,NO_DOTS_SLASH:h,STAR:m,START_ANCHOR:g}=WIe.globChars(r.windows),A=r.dot?f:d,y=r.dot?h:d,E=r.capture?"":"?:",_={negated:!1,prefix:""},v=r.bash===!0?".*?":m;r.capture&&(v=`(${v})`);let b=a(x=>x.noglobstar===!0?v:`(${E}(?:(?!${g}${x.dot?u:s}).)*?)`,"globstar"),T=a(x=>{switch(x){case"*":return`${A}${l}${v}`;case".*":return`${s}${l}${v}`;case"*.*":return`${A}${v}${s}${l}${v}`;case"*/*":return`${A}${v}${c}${l}${y}${v}`;case"**":return A+b(r);case"**/*":return`(?:${A}${b(r)}${c})?${y}${l}${v}`;case"**/*.*":return`(?:${A}${b(r)}${c})?${y}${v}${s}${l}${v}`;case"**/.*":return`(?:${A}${b(r)}${c})?${s}${l}${v}`;default:{let P=/^(.*?)\.(\w+)$/.exec(x);if(!P)return;let D=T(P[1]);return D?D+s+P[2]:void 0}}},"create"),w=QS.removePrefix(t,_),R=T(w);return R&&r.strictSlashes!==!0&&(R+=`${c}?`),R};hAn.exports=AUt});var yAn=I((Y7u,AAn)=>{"use strict";p();var K9o=uAn(),yUt=mAn(),gAn=$Ie(),J9o=GIe(),Z9o=a(t=>t&&typeof t=="object"&&!Array.isArray(t),"isObject"),Zp=a((t,e,r=!1)=>{if(Array.isArray(t)){let f=t.map(m=>Zp(m,e,r));return a(m=>{for(let g of f){let A=g(m);if(A)return A}return!1},"arrayMatcher")}let n=Z9o(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let o=e||{},s=o.windows,c=n?Zp.compileRe(t,e):Zp.makeRe(t,e,!1,!0),l=c.state;delete c.state;let u=a(()=>!1,"isIgnored");if(o.ignore){let f={...e,ignore:null,onMatch:null,onResult:null};u=Zp(o.ignore,f,r)}let d=a((f,h=!1)=>{let{isMatch:m,match:g,output:A}=Zp.test(f,c,e,{glob:t,posix:s}),y={glob:t,state:l,regex:c,posix:s,input:f,output:A,match:g,isMatch:m};return typeof o.onResult=="function"&&o.onResult(y),m===!1?(y.isMatch=!1,h?y:!1):u(f)?(typeof o.onIgnore=="function"&&o.onIgnore(y),y.isMatch=!1,h?y:!1):(typeof o.onMatch=="function"&&o.onMatch(y),h?y:!0)},"matcher");return r&&(d.state=l),d},"picomatch");Zp.test=(t,e,r,{glob:n,posix:o}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let s=r||{},c=s.format||(o?gAn.toPosixSlashes:null),l=t===n,u=l&&c?c(t):t;return l===!1&&(u=c?c(t):t,l=u===n),(l===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?l=Zp.matchBase(t,e,r,o):l=e.exec(u)),{isMatch:!!l,match:l,output:u}};Zp.matchBase=(t,e,r)=>(e instanceof RegExp?e:Zp.makeRe(e,r)).test(gAn.basename(t));Zp.isMatch=(t,e,r)=>Zp(e,r)(t);Zp.parse=(t,e)=>Array.isArray(t)?t.map(r=>Zp.parse(r,e)):yUt(t,{...e,fastpaths:!1});Zp.scan=(t,e)=>K9o(t,e);Zp.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let o=e||{},s=o.contains?"":"^",c=o.contains?"":"$",l=`${s}(?:${t.output})${c}`;t&&t.negated===!0&&(l=`^(?!${l}).*$`);let u=Zp.toRegex(l,e);return n===!0&&(u.state=t),u};Zp.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(o.output=yUt.fastpaths(t,e)),o.output||(o=yUt(t,e)),Zp.compileRe(o,e,r,n)};Zp.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Zp.constants=J9o;AAn.exports=Zp});var CAn=I((Z7u,vAn)=>{"use strict";p();var EAn=yAn(),X9o=$Ie();function _An(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:X9o.isWindows()}),EAn(t,e,r)}a(_An,"picomatch");Object.assign(_An,EAn);vAn.exports=_An});var SAn=I((tQu,bAn)=>{p();bAn.exports=a(function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1},"isExtglob")});var xAn=I((iQu,IAn)=>{p();var eUo=SAn(),TAn={"{":"}","(":")","[":"]"},tUo=a(function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,n=-2,o=-2,s=-2,c=-2;ee&&(c===-1||c>n||(c=t.indexOf("\\",e),c===-1||c>n)))||o!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(o=t.indexOf("}",e),o>e&&(c=t.indexOf("\\",e),c===-1||c>o))||s!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(s=t.indexOf(")",e),s>e&&(c=t.indexOf("\\",e),c===-1||c>s))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(rr&&(c=t.indexOf("\\",r),c===-1||c>s))))return!0;if(t[e]==="\\"){var l=t[e+1];e+=2;var u=TAn[l];if(u){var d=t.indexOf(u,e);d!==-1&&(e=d+1)}if(t[e]==="!")return!0}else e++}return!1},"strictCheck"),rUo=a(function(t){if(t[0]==="!")return!0;for(var e=0;e{p();var yK=require("path"),nUo=CAn(),iUo=xAn();function Nze(t,e={}){let{ignore:r,...n}=e;if(Array.isArray(r)){e={...n};for(let o of r)if(iUo(o)){e.ignoreGlobs||(e.ignoreGlobs=[]);let s=nUo.makeRe(o,{dot:!0,windows:process.platform==="win32"});e.ignoreGlobs.push(s.source)}else e.ignorePaths||(e.ignorePaths=[]),e.ignorePaths.push(yK.resolve(t,o))}return e}a(Nze,"normalizeOptions");wAn.createWrapper=t=>({writeSnapshot(e,r,n){return t.writeSnapshot(yK.resolve(e),yK.resolve(r),Nze(e,n))},getEventsSince(e,r,n){return t.getEventsSince(yK.resolve(e),yK.resolve(r),Nze(e,n))},async subscribe(e,r,n){return e=yK.resolve(e),n=Nze(e,n),await t.subscribe(e,r,n),{unsubscribe(){return t.unsubscribe(e,r,n)}}},unsubscribe(e,r,n){return t.unsubscribe(yK.resolve(e),r,Nze(e,n))}})});var kAn=I(zIe=>{"use strict";p();var oUo=require("path"),{createWrapper:sUo}=RAn();function aUo(){return oUo.join(__dirname,"compiled",process.platform,process.arch,"watcher.node")}a(aUo,"resolveBindingPath");var cUo=require(aUo()),Mze=sUo(cUo);zIe.writeSnapshot=Mze.writeSnapshot;zIe.getEventsSince=Mze.getEventsSince;zIe.subscribe=Mze.subscribe;zIe.unsubscribe=Mze.unsubscribe});var q_=I(Qze=>{"use strict";p();Object.defineProperty(Qze,"__esModule",{value:!0});Qze.Position=void 0;var bUt=class t{static{a(this,"Position")}constructor(e,r){this.lineNumber=e,this.column=r}with(e=this.lineNumber,r=this.column){return e===this.lineNumber&&r===this.column?this:new t(e,r)}delta(e=0,r=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+r))}equals(e){return t.equals(this,e)}static equals(e,r){return!e&&!r?!0:!!e&&!!r&&e.lineNumber===r.lineNumber&&e.column===r.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,r){return e.lineNumber{"use strict";p();Object.defineProperty(qze,"__esModule",{value:!0});qze.Range=void 0;var LAn=q_(),SUt=class t{static{a(this,"Range")}constructor(e,r,n,o){e>n||e===n&&r>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=e,this.endColumn=r):(this.startLineNumber=e,this.startColumn=r,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.columne.endColumn)}static strictContainsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.column<=e.startColumn||r.lineNumber===e.endLineNumber&&r.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumn<=e.startColumn||r.endLineNumber===e.endLineNumber&&r.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,r){let n,o,s,c;return r.startLineNumbere.endLineNumber?(s=r.endLineNumber,c=r.endColumn):r.endLineNumber===e.endLineNumber?(s=r.endLineNumber,c=Math.max(r.endColumn,e.endColumn)):(s=e.endLineNumber,c=e.endColumn),new t(n,o,s,c)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,r){let n=e.startLineNumber,o=e.startColumn,s=e.endLineNumber,c=e.endColumn,l=r.startLineNumber,u=r.startColumn,d=r.endLineNumber,f=r.endColumn;return nd?(s=d,c=f):s===d&&(c=Math.min(c,f)),n>s||n===s&&o>c?null:new t(n,o,s,c)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,r){return!e&&!r?!0:!!e&&!!r&&e.startLineNumber===r.startLineNumber&&e.startColumn===r.startColumn&&e.endLineNumber===r.endLineNumber&&e.endColumn===r.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new LAn.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new LAn.Position(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,r){return new t(this.startLineNumber,this.startColumn,e,r)}setStartPosition(e,r){return new t(e,r,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,r=e){return new t(e.lineNumber,e.column,r.lineNumber,r.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return!!e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,r){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};qze.Range=SUt});var Fyn=I(l7t=>{"use strict";p();Object.defineProperty(l7t,"__esModule",{value:!0});l7t.assertNever=f7o;function f7o(t,e=`unexpected value ${t}`){throw new Error(`Unreachable: ${e}`)}a(f7o,"assertNever")});var lxe=I(F3=>{"use strict";p();Object.defineProperty(F3,"__esModule",{value:!0});F3.ChatCompletionContentPartOpaque=F3.ChatCompletionContentPartKind=F3.ChatRole=void 0;var p7o=Fyn(),hYe;(function(t){t[t.System=0]="System",t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.Tool=3]="Tool"})(hYe||(F3.ChatRole=hYe={}));(function(t){function e(r){switch(r){case t.System:return"system";case t.User:return"user";case t.Assistant:return"assistant";case t.Tool:return"tool";default:(0,p7o.assertNever)(r,`unknown chat role ${r}}`)}}a(e,"display"),t.display=e})(hYe||(F3.ChatRole=hYe={}));var Uyn;(function(t){t[t.Image=0]="Image",t[t.Text=1]="Text",t[t.Opaque=2]="Opaque",t[t.CacheBreakpoint=3]="CacheBreakpoint",t[t.Document=4]="Document"})(Uyn||(F3.ChatCompletionContentPartKind=Uyn={}));var Qyn;(function(t){function e(r,n){return!r.scope||(r.scope&n)!==0}a(e,"usableIn"),t.usableIn=e})(Qyn||(F3.ChatCompletionContentPartOpaque=Qyn={}))});var u7t=I(EO=>{"use strict";p();Object.defineProperty(EO,"__esModule",{value:!0});EO.BaseTokensPerName=EO.BaseTokensPerMessage=EO.BaseTokensPerCompletion=EO.ChatRole=void 0;var qyn;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(qyn||(EO.ChatRole=qyn={}));EO.BaseTokensPerCompletion=3;EO.BaseTokensPerMessage=3;EO.BaseTokensPerName=1});var $yn=I(gYe=>{"use strict";p();Object.defineProperty(gYe,"__esModule",{value:!0});gYe.toOpenAiChatMessage=Gyn;gYe.toOpenAIChatMessages=m7o;var _O=lxe(),mYe=u7t(),h7o=sq();function jyn(t){return t.filter(e=>e.type===_O.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(jyn,"onlyStringContent");function Hyn(t){let e=t.map(r=>{if(r.type===_O.ChatCompletionContentPartKind.Text)return{type:"text",text:r.text};if(r.type===_O.ChatCompletionContentPartKind.Image)return{image_url:r.imageUrl,type:"image_url"};if(r.type===_O.ChatCompletionContentPartKind.Document)return;if(r.type===_O.ChatCompletionContentPartKind.Opaque&&_O.ChatCompletionContentPartOpaque.usableIn(r,h7o.OutputMode.OpenAI))return r.value}).filter(r=>!!r);return e.every(r=>r.type==="text")?e.map(r=>r.text).join(""):e}a(Hyn,"stringAndImageContent");function Gyn(t){switch(t.role){case _O.ChatRole.System:return{role:mYe.ChatRole.System,content:jyn(t.content),name:t.name};case _O.ChatRole.User:return{role:mYe.ChatRole.User,content:Hyn(t.content),name:t.name};case _O.ChatRole.Assistant:return{role:mYe.ChatRole.Assistant,content:jyn(t.content),name:t.name,tool_calls:t.toolCalls?.map(e=>({id:e.id,function:e.function,type:"function"}))};case _O.ChatRole.Tool:return{role:mYe.ChatRole.Tool,content:Hyn(t.content),tool_call_id:t.toolCallId};default:return}}a(Gyn,"toOpenAiChatMessage");function m7o(t){return t.map(Gyn).filter(e=>!!e)}a(m7o,"toOpenAIChatMessages")});var Wyn=I(EYe=>{"use strict";p();Object.defineProperty(EYe,"__esModule",{value:!0});EYe.toVsCodeChatMessage=Vyn;EYe.toVsCodeChatMessages=g7o;var yYe=lxe();function AYe(t){return t.filter(e=>e.type===yYe.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(AYe,"onlyStringContent");var aq;function Vyn(t){switch(aq??=require("vscode"),t.role){case yYe.ChatRole.Assistant:let e=aq.LanguageModelChatMessage.Assistant(AYe(t.content),t.name);return t.toolCalls&&(e.content=[new aq.LanguageModelTextPart(AYe(t.content)),...t.toolCalls.map(r=>{let n;try{n=JSON.parse(r.function.arguments)}catch{throw new Error("Invalid JSON in tool call arguments for tool call: "+r.id)}return new aq.LanguageModelToolCallPart(r.id,r.function.name,n)})]),e;case yYe.ChatRole.User:return aq.LanguageModelChatMessage.User(AYe(t.content),t.name);case yYe.ChatRole.Tool:{let r=aq.LanguageModelChatMessage.User("");return r.content=[new aq.LanguageModelToolResultPart(t.toolCallId,[new aq.LanguageModelTextPart(AYe(t.content))])],r}default:return}}a(Vyn,"toVsCodeChatMessage");function g7o(t){return t.map(Vyn).filter(e=>!!e)}a(g7o,"toVsCodeChatMessages")});var sq=I(FP=>{"use strict";p();Object.defineProperty(FP,"__esModule",{value:!0});FP.OutputMode=FP.Raw=FP.OpenAI=void 0;FP.toMode=d7t;FP.toVSCode=A7o;FP.toOpenAI=y7o;var zyn=$yn(),Yyn=Wyn();FP.OpenAI=u7t();FP.Raw=lxe();var IK;(function(t){t[t.Raw=1]="Raw",t[t.OpenAI=2]="OpenAI",t[t.VSCode=4]="VSCode"})(IK||(FP.OutputMode=IK={}));function d7t(t,e){switch(t){case IK.Raw:return e;case IK.VSCode:return e instanceof Array?(0,Yyn.toVsCodeChatMessages)(e):(0,Yyn.toVsCodeChatMessage)(e);case IK.OpenAI:return e instanceof Array?(0,zyn.toOpenAIChatMessages)(e):(0,zyn.toOpenAiChatMessage)(e);default:throw new Error(`Unknown output mode: ${t}`)}}a(d7t,"toMode");function A7o(t){return d7t(IK.VSCode,t)}a(A7o,"toVSCode");function y7o(t){return d7t(IK.OpenAI,t)}a(y7o,"toOpenAI")});var f7t=I(uxe=>{"use strict";p();Object.defineProperty(uxe,"__esModule",{value:!0});uxe.jsonRetainedProps=void 0;uxe.forEachNode=Kyn;uxe.jsonRetainedProps=Object.keys({flexBasis:1,flexGrow:1,flexReserve:1,passPriority:1,priority:1});function Kyn(t,e){if(e(t),t.type===1)for(let r of t.children)Kyn(r,e)}a(Kyn,"forEachNode")});var Jyn=I(p7t=>{"use strict";p();Object.defineProperty(p7t,"__esModule",{value:!0});p7t.once=E7o;function E7o(t){let e,r=!1,n=a(((...o)=>(r||(e=t(...o),r=!0),e)),"wrappedFunction");return n.clear=()=>{r=!1},n}a(E7o,"once")});var A7t=I(hg=>{"use strict";p();Object.defineProperty(hg,"__esModule",{value:!0});hg.BudgetExceededError=hg.MaterializedChatMessageDocument=hg.MaterializedChatMessageImage=hg.MaterializedChatMessageBreakpoint=hg.MaterializedChatMessageOpaque=hg.MaterializedChatMessage=hg.MaterializedChatMessageTextChunk=hg.GenericMaterializedContainer=void 0;var xK=Jyn(),RA=sq(),U3=class t{static{a(this,"GenericMaterializedContainer")}parent;id;name;priority;metadata;flags;children;keepWithId;constructor(e,r,n,o,s,c,l){if(this.parent=e,this.id=r,this.name=n,this.priority=o,this.metadata=c,this.flags=l,this.children=s(this),l&8){if(this.children.length!==2)throw new Error("Invalid number of children for EmptyAlternate flag");let[u,d]=this.children;d.isEmpty?this.children=[u]:this.children=[d]}}has(e){return!!(this.flags&e)}async tokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{let o=lq(n)?await n.tokenCount(e):await n.upperBoundTokenCount(e);r+=o})),r}async upperBoundTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{let o=await n.upperBoundTokenCount(e);r+=o})),r}replaceNode(e,r){return sEn(e,this.children,r)}allMetadata(){return oEn(this)}findById(e){return g7t(e,this)}get isEmpty(){return!this.children.some(e=>!e.isEmpty)}onChunksChange(){this.parent?.onChunksChange()}*toChatMessages(){for(let e of this.children)_7o(e),e instanceof t?yield*e.toChatMessages():!e.isEmpty&&e instanceof QP&&(yield e.toChatMessage())}async baseMessageTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{if(n instanceof QP||n instanceof t){let o=await n.baseMessageTokenCount(e);r+=o}})),r}removeLowestPriorityChild(){let e=[];return m7t(this,e),e}};hg.GenericMaterializedContainer=U3;var dxe=class{static{a(this,"MaterializedChatMessageTextChunk")}parent;text;priority;metadata;lineBreakBefore;constructor(e,r,n,o=[],s){this.parent=e,this.text=r,this.priority=n,this.metadata=o,this.lineBreakBefore=s}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,xK.once)(async e=>await e.tokenLength({type:RA.Raw.ChatCompletionContentPartKind.Text,text:this.text})+(this.lineBreakBefore!==0?1:0));get isEmpty(){return!/\S/.test(this.text)}};hg.MaterializedChatMessageTextChunk=dxe;var QP=class{static{a(this,"MaterializedChatMessage")}parent;id;role;name;toolCalls;toolCallId;priority;metadata;children;constructor(e,r,n,o,s,c,l,u,d){this.parent=e,this.id=r,this.role=n,this.name=o,this.toolCalls=s,this.toolCallId=c,this.priority=l,this.metadata=u,this.children=d(this)}async tokenCount(e){return this._tokenCount(e)}async upperBoundTokenCount(e){return this._upperBound(e)}get text(){return this._text()}get isEmpty(){return!this.toolCalls?.length&&!this.children.some(e=>!e.isEmpty)}replaceNode(e,r){let n=sEn(e,this.children,r);return n&&this.onChunksChange(),n}removeLowestPriorityChild(){let e=[];return m7t(this,e),e}onChunksChange(){this._tokenCount.clear(),this._upperBound.clear(),this._text.clear(),this.parent?.onChunksChange()}findById(e){return g7t(e,this)}_tokenCount=(0,xK.once)(async e=>{let r=this.toChatMessage();return e.countMessageTokens((0,RA.toMode)(e.mode,r))});_upperBound=(0,xK.once)(async e=>{let r=await this.baseMessageTokenCount(e);return await Promise.all(this.children.map(async n=>{let o=await n.upperBoundTokenCount(e);r+=o})),r});baseMessageTokenCount=(0,xK.once)(e=>{let r=this.toChatMessage();return r.content=r.content.map(n=>n.type===RA.Raw.ChatCompletionContentPartKind.Text?{...n,text:""}:n.type===RA.Raw.ChatCompletionContentPartKind.Image||n.type===RA.Raw.ChatCompletionContentPartKind.Document?void 0:n).filter(n=>!!n),e.countMessageTokens((0,RA.toMode)(e.mode,r))});_text=(0,xK.once)(()=>{let e=[];for(let{content:r,isTextSibling:n}of nEn(this)){if(r instanceof wK||r instanceof RK||r instanceof cq){e.push(r);continue}if(r instanceof UP){e.at(-1)instanceof UP?e[e.length-1]=r:e.push(r);continue}if(r.lineBreakBefore===1||r.lineBreakBefore===2&&!n){let o=e[e.length-1];typeof o=="string"&&o&&!o.endsWith(` +${JSON.stringify(o,null,2)}`);let c=n[s]();return new Language(INTERNAL,c)})}}class LookaheadIterable{static{a(this,"LookaheadIterable")}constructor(e,r,n){assertInternal(e),this[0]=r,this.language=n}get currentTypeId(){return C._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||"ERROR"}delete(){C._ts_lookahead_iterator_delete(this[0]),this[0]=0}resetState(e){return C._ts_lookahead_iterator_reset_state(this[0],e)}reset(e,r){return C._ts_lookahead_iterator_reset(this[0],e[0],r)?(this.language=e,!0):!1}[Symbol.iterator](){let e=this;return{next(){return C._ts_lookahead_iterator_next(e[0])?{done:!1,value:e.currentType}:{done:!0,value:""}}}}}class Query{static{a(this,"Query")}constructor(e,r,n,o,s,c,l,u){assertInternal(e),this[0]=r,this.captureNames=n,this.textPredicates=o,this.predicates=s,this.setProperties=c,this.assertedProperties=l,this.refutedProperties=u,this.exceededMatchLimit=!1}delete(){C._ts_query_delete(this[0]),this[0]=0}matches(e,{startPosition:r=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:o=0,endIndex:s=0,matchLimit:c=4294967295,maxStartDepth:l=4294967295}={}){if(typeof c!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_matches_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,o,s,c,l);let u=getValue(TRANSFER_BUFFER,"i32"),d=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),f=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),h=new Array(u);this.exceededMatchLimit=!!f;let m=0,g=d;for(let A=0;Av(_))){h[m]={pattern:y,captures:_};let v=this.setProperties[y];v&&(h[m].setProperties=v);let b=this.assertedProperties[y];b&&(h[m].assertedProperties=b);let T=this.refutedProperties[y];T&&(h[m].refutedProperties=T),m++}}return h.length=m,C._free(d),h}captures(e,{startPosition:r=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:o=0,endIndex:s=0,matchLimit:c=4294967295,maxStartDepth:l=4294967295}={}){if(typeof c!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_captures_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,o,s,c,l);let u=getValue(TRANSFER_BUFFER,"i32"),d=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),f=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),h=[];this.exceededMatchLimit=!!f;let m=[],g=d;for(let A=0;Av(m))){let v=m[_],b=this.setProperties[y];b&&(v.setProperties=b);let T=this.assertedProperties[y];T&&(v.assertedProperties=T);let w=this.refutedProperties[y];w&&(v.refutedProperties=w),h.push(v)}}return C._free(d),h}predicatesForPattern(e){return this.predicates[e]}disableCapture(e){let r=lengthBytesUTF8(e),n=C._malloc(r+1);stringToUTF8(e,n,r+1),C._ts_query_disable_capture(this[0],n,r),C._free(n)}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(t,e,r){let n=r-e,o=t.textCallback(e,null,r);for(e+=o.length;e0)e+=s.length,o+=s;else break}return e>r&&(o=o.slice(0,n)),o}a(getText,"getText");function unmarshalCaptures(t,e,r,n){for(let o=0,s=n.length;o>>0,column:getValue(t+SIZE_OF_INT,"i32")>>>0}}a(unmarshalPoint,"unmarshalPoint");function marshalRange(t,e){marshalPoint(t,e.startPosition),t+=SIZE_OF_POINT,marshalPoint(t,e.endPosition),t+=SIZE_OF_POINT,setValue(t,e.startIndex,"i32"),t+=SIZE_OF_INT,setValue(t,e.endIndex,"i32"),t+=SIZE_OF_INT}a(marshalRange,"marshalRange");function unmarshalRange(t){let e={};return e.startPosition=unmarshalPoint(t),t+=SIZE_OF_POINT,e.endPosition=unmarshalPoint(t),t+=SIZE_OF_POINT,e.startIndex=getValue(t,"i32")>>>0,t+=SIZE_OF_INT,e.endIndex=getValue(t,"i32")>>>0,e}a(unmarshalRange,"unmarshalRange");function marshalEdit(t){let e=TRANSFER_BUFFER;marshalPoint(e,t.startPosition),e+=SIZE_OF_POINT,marshalPoint(e,t.oldEndPosition),e+=SIZE_OF_POINT,marshalPoint(e,t.newEndPosition),e+=SIZE_OF_POINT,setValue(e,t.startIndex,"i32"),e+=SIZE_OF_INT,setValue(e,t.oldEndIndex,"i32"),e+=SIZE_OF_INT,setValue(e,t.newEndIndex,"i32"),e+=SIZE_OF_INT}a(marshalEdit,"marshalEdit");for(let t of Object.getOwnPropertyNames(ParserImpl.prototype))Object.defineProperty(Parser.prototype,t,{value:ParserImpl.prototype[t],enumerable:!1,writable:!1});Parser.Language=Language,Module.onRuntimeInitialized=()=>{ParserImpl.init(),resolveInitPromise()}}))}}return Parser})();typeof exports=="object"&&(module.exports=TreeSitter)});var Vfn=I((zPu,$fn)=>{"use strict";p();var L3o=require("path"),B3o=L3o.join(__dirname,"compiled",process.platform,process.arch,"keytar.node");$fn.exports=require(B3o)});var shn={};Ri(shn,{TextDocument:()=>P3});function H6t(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),o=t.slice(r);H6t(n,e),H6t(o,e);let s=0,c=0,l=0;for(;sr.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function g8o(t){let e=ohn(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var RWe,P3,G6t=Se(()=>{"use strict";p();RWe=class t{static{a(this,"FullTextDocument")}constructor(e,r,n,o){this._uri=e,this._languageId=r,this._version=n,this._content=o,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let o=ohn(n.range),s=this.offsetAt(o.start),c=this.offsetAt(o.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(c,this._content.length);let l=Math.max(o.start.line,0),u=Math.max(o.end.line,0),d=this._lineOffsets,f=nhn(n.text,!1,s);if(u-l===f.length)for(let m=0,g=f.length;me?o=c:n=c+1}let s=n-1;return e=this.ensureBeforeEOL(e,r[s]),{line:s,character:e-r[s]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line];if(e.character<=0)return n;let o=e.line+1r&&ihn(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}};(function(t){function e(o,s,c,l){return new RWe(o,s,c,l)}a(e,"create"),t.create=e;function r(o,s,c){if(o instanceof RWe)return o.update(s,c),o;throw new Error("TextDocument.update: document must be created by TextDocument.create")}a(r,"update"),t.update=r;function n(o,s){let c=o.getText(),l=H6t(s.map(g8o),(f,h)=>{let m=f.range.start.line-h.range.start.line;return m===0?f.range.start.character-h.range.start.character:m}),u=0,d=[];for(let f of l){let h=o.offsetAt(f.range.start);if(hu&&d.push(c.substring(u,h)),f.newText.length&&d.push(f.newText),u=o.offsetAt(f.range.end)}return d.push(c.substr(u)),d.join("")}a(n,"applyEdits"),t.applyEdits=n})(P3||(P3={}));a(H6t,"mergeSort");a(nhn,"computeLineOffsets");a(ihn,"isEOL");a(ohn,"getWellformedRange");a(g8o,"getWellformedEdit")});var UWe=I(Kh=>{"use strict";p();Object.defineProperty(Kh,"__esModule",{value:!0});Kh.thenable=Kh.typedArray=Kh.stringArray=Kh.array=Kh.func=Kh.error=Kh.number=Kh.string=Kh.boolean=void 0;function v8o(t){return t===!0||t===!1}a(v8o,"boolean");Kh.boolean=v8o;function gmn(t){return typeof t=="string"||t instanceof String}a(gmn,"string");Kh.string=gmn;function C8o(t){return typeof t=="number"||t instanceof Number}a(C8o,"number");Kh.number=C8o;function b8o(t){return t instanceof Error}a(b8o,"error");Kh.error=b8o;function Amn(t){return typeof t=="function"}a(Amn,"func");Kh.func=Amn;function ymn(t){return Array.isArray(t)}a(ymn,"array");Kh.array=ymn;function S8o(t){return ymn(t)&&t.every(e=>gmn(e))}a(S8o,"stringArray");Kh.stringArray=S8o;function T8o(t,e){return Array.isArray(t)&&t.every(e)}a(T8o,"typedArray");Kh.typedArray=T8o;function I8o(t){return t&&Amn(t.then)}a(I8o,"thenable");Kh.thenable=I8o});var c9t=I($x=>{"use strict";p();Object.defineProperty($x,"__esModule",{value:!0});$x.generateUuid=$x.parse=$x.isUUID=$x.v4=$x.empty=void 0;var HIe=class{static{a(this,"ValueUUID")}constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},GIe=class t extends HIe{static{a(this,"V4UUID")}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};GIe._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];GIe._timeHighBits=["8","9","a","b"];$x.empty=new HIe("00000000-0000-0000-0000-000000000000");function Emn(){return new GIe}a(Emn,"v4");$x.v4=Emn;var x8o=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function _mn(t){return x8o.test(t)}a(_mn,"isUUID");$x.isUUID=_mn;function w8o(t){if(!_mn(t))throw new Error("invalid uuid");return new HIe(t)}a(w8o,"parse");$x.parse=w8o;function R8o(){return Emn().asHex()}a(R8o,"generateUuid");$x.generateUuid=R8o});var vmn=I(HQ=>{"use strict";p();Object.defineProperty(HQ,"__esModule",{value:!0});HQ.attachPartialResult=HQ.ProgressFeature=HQ.attachWorkDone=void 0;var jQ=ei(),k8o=c9t(),nK=class t{static{a(this,"WorkDoneProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r,t.Instances.set(this._token,this)}begin(e,r,n,o){let s={kind:"begin",title:e,percentage:r,message:n,cancellable:o};this._connection.sendProgress(jQ.WorkDoneProgress.type,this._token,s)}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress(jQ.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(jQ.WorkDoneProgress.type,this._token,{kind:"end"})}};nK.Instances=new Map;var QWe=class extends nK{static{a(this,"WorkDoneProgressServerReporterImpl")}constructor(e,r){super(e,r),this._source=new jQ.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},$Ie=class{static{a(this,"NullProgressReporter")}constructor(){}begin(){}report(){}done(){}},qWe=class extends $Ie{static{a(this,"NullProgressServerReporter")}constructor(){super(),this._source=new jQ.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function P8o(t,e){if(e===void 0||e.workDoneToken===void 0)return new $Ie;let r=e.workDoneToken;return delete e.workDoneToken,new nK(t,r)}a(P8o,"attachWorkDone");HQ.attachWorkDone=P8o;var D8o=a(t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(jQ.WorkDoneProgressCancelNotification.type,r=>{let n=nK.Instances.get(r.token);(n instanceof QWe||n instanceof qWe)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new $Ie:new nK(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,k8o.generateUuid)();return this.connection.sendRequest(jQ.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new QWe(this.connection,e))}else return Promise.resolve(new qWe)}},"ProgressFeature");HQ.ProgressFeature=D8o;var l9t;(function(t){t.type=new jQ.ProgressType})(l9t||(l9t={}));var u9t=class{static{a(this,"ResultProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(l9t.type,this._token,e)}};function N8o(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new u9t(t,r)}a(N8o,"attachPartialResult");HQ.attachPartialResult=N8o});var Cmn=I(jWe=>{"use strict";p();Object.defineProperty(jWe,"__esModule",{value:!0});jWe.ConfigurationFeature=void 0;var M8o=ei(),O8o=UWe(),L8o=a(t=>class extends t{getConfiguration(e){return e?O8o.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(M8o.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}},"ConfigurationFeature");jWe.ConfigurationFeature=L8o});var bmn=I(GWe=>{"use strict";p();Object.defineProperty(GWe,"__esModule",{value:!0});GWe.WorkspaceFoldersFeature=void 0;var HWe=ei(),B8o=a(t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new HWe.Emitter,this.connection.onNotification(HWe.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(HWe.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(HWe.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}},"WorkspaceFoldersFeature");GWe.WorkspaceFoldersFeature=B8o});var Smn=I($We=>{"use strict";p();Object.defineProperty($We,"__esModule",{value:!0});$We.CallHierarchyFeature=void 0;var d9t=ei(),F8o=a(t=>class extends t{get callHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(d9t.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onIncomingCalls:a(e=>{let r=d9t.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onIncomingCalls"),onOutgoingCalls:a(e=>{let r=d9t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onOutgoingCalls")}}},"CallHierarchyFeature");$We.CallHierarchyFeature=F8o});var p9t=I(GQ=>{"use strict";p();Object.defineProperty(GQ,"__esModule",{value:!0});GQ.SemanticTokensBuilder=GQ.SemanticTokensDiff=GQ.SemanticTokensFeature=void 0;var VWe=ei(),U8o=a(t=>class extends t{get semanticTokens(){return{refresh:a(()=>this.connection.sendRequest(VWe.SemanticTokensRefreshRequest.type),"refresh"),on:a(e=>{let r=VWe.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on"),onDelta:a(e=>{let r=VWe.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onDelta"),onRange:a(e=>{let r=VWe.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onRange")}}},"SemanticTokensFeature");GQ.SemanticTokensFeature=U8o;var WWe=class{static{a(this,"SemanticTokensDiff")}constructor(e,r){this.originalSequence=e,this.modifiedSequence=r}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n=n&&s>=n&&this.originalSequence[o]===this.modifiedSequence[s];)o--,s--;(o0&&(c-=this._prevLine,c===0&&(l-=this._prevChar)),this._data[this._dataLen++]=c,this._data[this._dataLen++]=l,this._data[this._dataLen++]=n,this._data[this._dataLen++]=o,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=r}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new WWe(this._prevData,this._data).computeDiff()}:this.build()}};GQ.SemanticTokensBuilder=f9t});var Tmn=I(zWe=>{"use strict";p();Object.defineProperty(zWe,"__esModule",{value:!0});zWe.ShowDocumentFeature=void 0;var Q8o=ei(),q8o=a(t=>class extends t{showDocument(e){return this.connection.sendRequest(Q8o.ShowDocumentRequest.type,e)}},"ShowDocumentFeature");zWe.ShowDocumentFeature=q8o});var Imn=I(YWe=>{"use strict";p();Object.defineProperty(YWe,"__esModule",{value:!0});YWe.FileOperationsFeature=void 0;var Ole=ei(),j8o=a(t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Ole.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(Ole.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(Ole.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(Ole.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(Ole.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(Ole.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}},"FileOperationsFeature");YWe.FileOperationsFeature=j8o});var xmn=I(KWe=>{"use strict";p();Object.defineProperty(KWe,"__esModule",{value:!0});KWe.LinkedEditingRangeFeature=void 0;var H8o=ei(),G8o=a(t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(H8o.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}},"LinkedEditingRangeFeature");KWe.LinkedEditingRangeFeature=G8o});var wmn=I(JWe=>{"use strict";p();Object.defineProperty(JWe,"__esModule",{value:!0});JWe.TypeHierarchyFeature=void 0;var h9t=ei(),$8o=a(t=>class extends t{get typeHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(h9t.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onSupertypes:a(e=>{let r=h9t.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSupertypes"),onSubtypes:a(e=>{let r=h9t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSubtypes")}}},"TypeHierarchyFeature");JWe.TypeHierarchyFeature=$8o});var kmn=I(ZWe=>{"use strict";p();Object.defineProperty(ZWe,"__esModule",{value:!0});ZWe.InlineValueFeature=void 0;var Rmn=ei(),V8o=a(t=>class extends t{get inlineValue(){return{refresh:a(()=>this.connection.sendRequest(Rmn.InlineValueRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(Rmn.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineValueFeature");ZWe.InlineValueFeature=V8o});var Dmn=I(XWe=>{"use strict";p();Object.defineProperty(XWe,"__esModule",{value:!0});XWe.FoldingRangeFeature=void 0;var Pmn=ei(),W8o=a(t=>class extends t{get foldingRange(){return{refresh:a(()=>this.connection.sendRequest(Pmn.FoldingRangeRefreshRequest.type),"refresh"),on:a(e=>{let r=Pmn.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"FoldingRangeFeature");XWe.FoldingRangeFeature=W8o});var Nmn=I(eze=>{"use strict";p();Object.defineProperty(eze,"__esModule",{value:!0});eze.InlayHintFeature=void 0;var m9t=ei(),z8o=a(t=>class extends t{get inlayHint(){return{refresh:a(()=>this.connection.sendRequest(m9t.InlayHintRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(m9t.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on"),resolve:a(e=>this.connection.onRequest(m9t.InlayHintResolveRequest.type,(r,n)=>e(r,n)),"resolve")}}},"InlayHintFeature");eze.InlayHintFeature=z8o});var Mmn=I(tze=>{"use strict";p();Object.defineProperty(tze,"__esModule",{value:!0});tze.DiagnosticFeature=void 0;var VIe=ei(),Y8o=a(t=>class extends t{get diagnostics(){return{refresh:a(()=>this.connection.sendRequest(VIe.DiagnosticRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(VIe.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(VIe.DocumentDiagnosticRequest.partialResult,r))),"on"),onWorkspace:a(e=>this.connection.onRequest(VIe.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(VIe.WorkspaceDiagnosticRequest.partialResult,r))),"onWorkspace")}}},"DiagnosticFeature");tze.DiagnosticFeature=Y8o});var A9t=I(rze=>{"use strict";p();Object.defineProperty(rze,"__esModule",{value:!0});rze.TextDocuments=void 0;var iK=ei(),g9t=class{static{a(this,"TextDocuments")}constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new iK.Emitter,this._onDidOpen=new iK.Emitter,this._onDidClose=new iK.Emitter,this._onDidSave=new iK.Emitter,this._onWillSave=new iK.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=iK.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let o=n.textDocument,s=this._configuration.create(o.uri,o.languageId,o.version,o.text);this._syncedDocuments.set(o.uri,s);let c=Object.freeze({document:s});this._onDidOpen.fire(c),this._onDidChangeContent.fire(c)})),r.push(e.onDidChangeTextDocument(n=>{let o=n.textDocument,s=n.contentChanges;if(s.length===0)return;let{version:c}=o;if(c==null)throw new Error(`Received document change event for ${o.uri} without valid version identifier`);let l=this._syncedDocuments.get(o.uri);l!==void 0&&(l=this._configuration.update(l,s,c),this._syncedDocuments.set(o.uri,l),this._onDidChangeContent.fire(Object.freeze({document:l})))})),r.push(e.onDidCloseTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:o})))})),r.push(e.onWillSaveTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&this._onWillSave.fire(Object.freeze({document:o,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,o)=>{let s=this._syncedDocuments.get(n.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:n.reason}),o):[]})),r.push(e.onDidSaveTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&this._onDidSave.fire(Object.freeze({document:o}))})),iK.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};rze.TextDocuments=g9t});var E9t=I(Lle=>{"use strict";p();Object.defineProperty(Lle,"__esModule",{value:!0});Lle.NotebookDocuments=Lle.NotebookSyncFeature=void 0;var Vx=ei(),Omn=A9t(),K8o=a(t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:a(e=>this.connection.onNotification(Vx.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),"onDidOpenNotebookDocument"),onDidChangeNotebookDocument:a(e=>this.connection.onNotification(Vx.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),"onDidChangeNotebookDocument"),onDidSaveNotebookDocument:a(e=>this.connection.onNotification(Vx.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),"onDidSaveNotebookDocument"),onDidCloseNotebookDocument:a(e=>this.connection.onNotification(Vx.DidCloseNotebookDocumentNotification.type,r=>{e(r)}),"onDidCloseNotebookDocument")}}},"NotebookSyncFeature");Lle.NotebookSyncFeature=K8o;var nze=class t{static{a(this,"CellTextDocumentConnection")}onDidOpenTextDocument(e){return this.openHandler=e,Vx.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Vx.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Vx.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};nze.NULL_DISPOSE=Object.freeze({dispose:a(()=>{},"dispose")});var y9t=class{static{a(this,"NotebookDocuments")}constructor(e){e instanceof Omn.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Omn.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Vx.Emitter,this._onDidChange=new Vx.Emitter,this._onDidSave=new Vx.Emitter,this._onDidClose=new Vx.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let r=new nze,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(o=>{this.notebookDocuments.set(o.notebookDocument.uri,o.notebookDocument);for(let s of o.cellTextDocuments)r.openTextDocument({textDocument:s});this.updateCellMap(o.notebookDocument),this._onDidOpen.fire(o.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);if(s===void 0)return;s.version=o.notebookDocument.version;let c=s.metadata,l=!1,u=o.change;u.metadata!==void 0&&(l=!0,s.metadata=u.metadata);let d=[],f=[],h=[],m=[];if(u.cells!==void 0){let _=u.cells;if(_.structure!==void 0){let v=_.structure.array;if(s.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),_.structure.didOpen!==void 0)for(let b of _.structure.didOpen)r.openTextDocument({textDocument:b}),d.push(b.uri);if(_.structure.didClose)for(let b of _.structure.didClose)r.closeTextDocument({textDocument:b}),f.push(b.uri)}if(_.data!==void 0){let v=new Map(_.data.map(b=>[b.document,b]));for(let b=0;b<=s.cells.length;b++){let T=v.get(s.cells[b].document);if(T!==void 0){let w=s.cells.splice(b,1,T);if(h.push({old:w[0],new:T}),v.delete(T.document),v.size===0)break}}}if(_.textContent!==void 0)for(let v of _.textContent)r.changeTextDocument({textDocument:v.document,contentChanges:v.changes}),m.push(v.document.uri)}this.updateCellMap(s);let g={notebookDocument:s};l&&(g.metadata={old:c,new:s.metadata});let A=[];for(let _ of d)A.push(this.getNotebookCell(_));let y=[];for(let _ of f)y.push(this.getNotebookCell(_));let E=[];for(let _ of m)E.push(this.getNotebookCell(_));(A.length>0||y.length>0||h.length>0||E.length>0)&&(g.cells={added:A,removed:y,changed:{data:h,textContent:E}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let c of o.cellTextDocuments)r.closeTextDocument({textDocument:c});this.notebookDocuments.delete(o.notebookDocument.uri);for(let c of s.cells)this.notebookCellMap.delete(c.document)}})),Vx.Disposable.create(()=>{n.forEach(o=>o.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};Lle.NotebookDocuments=y9t});var Lmn=I(ize=>{"use strict";p();Object.defineProperty(ize,"__esModule",{value:!0});ize.MonikerFeature=void 0;var J8o=ei(),Z8o=a(t=>class extends t{get moniker(){return{on:a(e=>{let r=J8o.MonikerRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"MonikerFeature");ize.MonikerFeature=Z8o});var T9t=I(Ac=>{"use strict";p();Object.defineProperty(Ac,"__esModule",{value:!0});Ac.createConnection=Ac.combineFeatures=Ac.combineNotebooksFeatures=Ac.combineLanguagesFeatures=Ac.combineWorkspaceFeatures=Ac.combineWindowFeatures=Ac.combineClientFeatures=Ac.combineTracerFeatures=Ac.combineTelemetryFeatures=Ac.combineConsoleFeatures=Ac._NotebooksImpl=Ac._LanguagesImpl=Ac.BulkUnregistration=Ac.BulkRegistration=Ac.ErrorMessageTracker=void 0;var Kr=ei(),Wx=UWe(),v9t=c9t(),To=vmn(),X8o=Cmn(),e6o=bmn(),t6o=Smn(),r6o=p9t(),n6o=Tmn(),i6o=Imn(),o6o=xmn(),s6o=wmn(),a6o=kmn(),c6o=Dmn(),l6o=Nmn(),u6o=Mmn(),d6o=E9t(),f6o=Lmn();function _9t(t){if(t!==null)return t}a(_9t,"null2Undefined");var C9t=class{static{a(this,"ErrorMessageTracker")}constructor(){this._messages=Object.create(null)}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r)})}};Ac.ErrorMessageTracker=C9t;var oze=class{static{a(this,"RemoteConsoleImpl")}constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(Kr.MessageType.Error,e)}warn(e){this.send(Kr.MessageType.Warning,e)}info(e){this.send(Kr.MessageType.Info,e)}log(e){this.send(Kr.MessageType.Log,e)}debug(e){this.send(Kr.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(Kr.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,Kr.RAL)().console.error("Sending log message failed")})}},b9t=class{static{a(this,"_RemoteWindowImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...r){let n={type:Kr.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(_9t)}showWarningMessage(e,...r){let n={type:Kr.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(_9t)}showInformationMessage(e,...r){let n={type:Kr.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(_9t)}},Bmn=(0,n6o.ShowDocumentFeature)((0,To.ProgressFeature)(b9t)),Fmn;(function(t){function e(){return new sze}a(e,"create"),t.create=e})(Fmn||(Ac.BulkRegistration=Fmn={}));var sze=class{static{a(this,"BulkRegistrationImpl")}constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=Wx.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let o=v9t.generateUuid();this._registrations.push({id:o,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},Umn;(function(t){function e(){return new WIe(void 0,[])}a(e,"create"),t.create=e})(Umn||(Ac.BulkUnregistration=Umn={}));var WIe=class{static{a(this,"BulkUnregistrationImpl")}constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(Kr.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=Wx.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let o={unregisterations:[n]};return this._connection.sendRequest(Kr.UnregistrationRequest.type,o).then(()=>{this._unregistrations.delete(r)},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},aze=class{static{a(this,"RemoteClientImpl")}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,r,n){return e instanceof sze?this.registerMany(e):e instanceof WIe?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let o=Wx.string(r)?r:r.method,s=v9t.generateUuid(),c={registrations:[{id:s,method:o,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(Kr.RegistrationRequest.type,c).then(l=>(e.add({id:s,method:o}),e),l=>(this.connection.console.info(`Registering request handler for ${o} failed.`),Promise.reject(l)))}registerSingle2(e,r){let n=Wx.string(e)?e:e.method,o=v9t.generateUuid(),s={registrations:[{id:o,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(Kr.RegistrationRequest.type,s).then(c=>Kr.Disposable.create(()=>{this.unregisterSingle(o,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${o} failed.`)})}),c=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(c)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(Kr.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(Kr.RegistrationRequest.type,r).then(()=>new WIe(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},S9t=class{static{a(this,"_RemoteWorkspaceImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function r(o){return o&&!!o.edit}a(r,"isApplyWorkspaceEditParams");let n=r(e)?e:{edit:e};return this.connection.sendRequest(Kr.ApplyWorkspaceEditRequest.type,n)}},Qmn=(0,i6o.FileOperationsFeature)((0,e6o.WorkspaceFoldersFeature)((0,X8o.ConfigurationFeature)(S9t))),cze=class{static{a(this,"TracerImpl")}constructor(){this._trace=Kr.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,r){this._trace!==Kr.Trace.Off&&this.connection.sendNotification(Kr.LogTraceNotification.type,{message:e,verbose:this._trace===Kr.Trace.Verbose?r:void 0}).catch(()=>{})}},lze=class{static{a(this,"TelemetryImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(Kr.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},uze=class{static{a(this,"_LanguagesImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,To.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,To.attachPartialResult)(this.connection,r)}};Ac._LanguagesImpl=uze;var qmn=(0,c6o.FoldingRangeFeature)((0,f6o.MonikerFeature)((0,u6o.DiagnosticFeature)((0,l6o.InlayHintFeature)((0,a6o.InlineValueFeature)((0,s6o.TypeHierarchyFeature)((0,o6o.LinkedEditingRangeFeature)((0,r6o.SemanticTokensFeature)((0,t6o.CallHierarchyFeature)(uze))))))))),dze=class{static{a(this,"_NotebooksImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,To.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,To.attachPartialResult)(this.connection,r)}};Ac._NotebooksImpl=dze;var jmn=(0,d6o.NotebookSyncFeature)(dze);function Hmn(t,e){return function(r){return e(t(r))}}a(Hmn,"combineConsoleFeatures");Ac.combineConsoleFeatures=Hmn;function Gmn(t,e){return function(r){return e(t(r))}}a(Gmn,"combineTelemetryFeatures");Ac.combineTelemetryFeatures=Gmn;function $mn(t,e){return function(r){return e(t(r))}}a($mn,"combineTracerFeatures");Ac.combineTracerFeatures=$mn;function Vmn(t,e){return function(r){return e(t(r))}}a(Vmn,"combineClientFeatures");Ac.combineClientFeatures=Vmn;function Wmn(t,e){return function(r){return e(t(r))}}a(Wmn,"combineWindowFeatures");Ac.combineWindowFeatures=Wmn;function zmn(t,e){return function(r){return e(t(r))}}a(zmn,"combineWorkspaceFeatures");Ac.combineWorkspaceFeatures=zmn;function Ymn(t,e){return function(r){return e(t(r))}}a(Ymn,"combineLanguagesFeatures");Ac.combineLanguagesFeatures=Ymn;function Kmn(t,e){return function(r){return e(t(r))}}a(Kmn,"combineNotebooksFeatures");Ac.combineNotebooksFeatures=Kmn;function p6o(t,e){function r(o,s,c){return o&&s?c(o,s):o||s}return a(r,"combine"),{__brand:"features",console:r(t.console,e.console,Hmn),tracer:r(t.tracer,e.tracer,$mn),telemetry:r(t.telemetry,e.telemetry,Gmn),client:r(t.client,e.client,Vmn),window:r(t.window,e.window,Wmn),workspace:r(t.workspace,e.workspace,zmn),languages:r(t.languages,e.languages,Ymn),notebooks:r(t.notebooks,e.notebooks,Kmn)}}a(p6o,"combineFeatures");Ac.combineFeatures=p6o;function h6o(t,e,r){let n=r&&r.console?new(r.console(oze)):new oze,o=t(n);n.rawAttach(o);let s=r&&r.tracer?new(r.tracer(cze)):new cze,c=r&&r.telemetry?new(r.telemetry(lze)):new lze,l=r&&r.client?new(r.client(aze)):new aze,u=r&&r.window?new(r.window(Bmn)):new Bmn,d=r&&r.workspace?new(r.workspace(Qmn)):new Qmn,f=r&&r.languages?new(r.languages(qmn)):new qmn,h=r&&r.notebooks?new(r.notebooks(jmn)):new jmn,m=[n,s,c,l,u,d,f,h];function g(v){return v instanceof Promise?v:Wx.thenable(v)?new Promise((b,T)=>{v.then(w=>b(w),w=>T(w))}):Promise.resolve(v)}a(g,"asPromise");let A,y,E,_={listen:a(()=>o.listen(),"listen"),sendRequest:a((v,...b)=>o.sendRequest(Wx.string(v)?v:v.method,...b),"sendRequest"),onRequest:a((v,b)=>o.onRequest(v,b),"onRequest"),sendNotification:a((v,b)=>{let T=Wx.string(v)?v:v.method;return o.sendNotification(T,b)},"sendNotification"),onNotification:a((v,b)=>o.onNotification(v,b),"onNotification"),onProgress:o.onProgress,sendProgress:o.sendProgress,onInitialize:a(v=>(y=v,{dispose:a(()=>{y=void 0},"dispose")}),"onInitialize"),onInitialized:a(v=>o.onNotification(Kr.InitializedNotification.type,v),"onInitialized"),onShutdown:a(v=>(A=v,{dispose:a(()=>{A=void 0},"dispose")}),"onShutdown"),onExit:a(v=>(E=v,{dispose:a(()=>{E=void 0},"dispose")}),"onExit"),get console(){return n},get telemetry(){return c},get tracer(){return s},get client(){return l},get window(){return u},get workspace(){return d},get languages(){return f},get notebooks(){return h},onDidChangeConfiguration:a(v=>o.onNotification(Kr.DidChangeConfigurationNotification.type,v),"onDidChangeConfiguration"),onDidChangeWatchedFiles:a(v=>o.onNotification(Kr.DidChangeWatchedFilesNotification.type,v),"onDidChangeWatchedFiles"),__textDocumentSync:void 0,onDidOpenTextDocument:a(v=>o.onNotification(Kr.DidOpenTextDocumentNotification.type,v),"onDidOpenTextDocument"),onDidChangeTextDocument:a(v=>o.onNotification(Kr.DidChangeTextDocumentNotification.type,v),"onDidChangeTextDocument"),onDidCloseTextDocument:a(v=>o.onNotification(Kr.DidCloseTextDocumentNotification.type,v),"onDidCloseTextDocument"),onWillSaveTextDocument:a(v=>o.onNotification(Kr.WillSaveTextDocumentNotification.type,v),"onWillSaveTextDocument"),onWillSaveTextDocumentWaitUntil:a(v=>o.onRequest(Kr.WillSaveTextDocumentWaitUntilRequest.type,v),"onWillSaveTextDocumentWaitUntil"),onDidSaveTextDocument:a(v=>o.onNotification(Kr.DidSaveTextDocumentNotification.type,v),"onDidSaveTextDocument"),sendDiagnostics:a(v=>o.sendNotification(Kr.PublishDiagnosticsNotification.type,v),"sendDiagnostics"),onHover:a(v=>o.onRequest(Kr.HoverRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onHover"),onCompletion:a(v=>o.onRequest(Kr.CompletionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onCompletion"),onCompletionResolve:a(v=>o.onRequest(Kr.CompletionResolveRequest.type,v),"onCompletionResolve"),onSignatureHelp:a(v=>o.onRequest(Kr.SignatureHelpRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onSignatureHelp"),onDeclaration:a(v=>o.onRequest(Kr.DeclarationRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDeclaration"),onDefinition:a(v=>o.onRequest(Kr.DefinitionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDefinition"),onTypeDefinition:a(v=>o.onRequest(Kr.TypeDefinitionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onTypeDefinition"),onImplementation:a(v=>o.onRequest(Kr.ImplementationRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onImplementation"),onReferences:a(v=>o.onRequest(Kr.ReferencesRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onReferences"),onDocumentHighlight:a(v=>o.onRequest(Kr.DocumentHighlightRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentHighlight"),onDocumentSymbol:a(v=>o.onRequest(Kr.DocumentSymbolRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentSymbol"),onWorkspaceSymbol:a(v=>o.onRequest(Kr.WorkspaceSymbolRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onWorkspaceSymbol"),onWorkspaceSymbolResolve:a(v=>o.onRequest(Kr.WorkspaceSymbolResolveRequest.type,v),"onWorkspaceSymbolResolve"),onCodeAction:a(v=>o.onRequest(Kr.CodeActionRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onCodeAction"),onCodeActionResolve:a(v=>o.onRequest(Kr.CodeActionResolveRequest.type,(b,T)=>v(b,T)),"onCodeActionResolve"),onCodeLens:a(v=>o.onRequest(Kr.CodeLensRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onCodeLens"),onCodeLensResolve:a(v=>o.onRequest(Kr.CodeLensResolveRequest.type,(b,T)=>v(b,T)),"onCodeLensResolve"),onDocumentFormatting:a(v=>o.onRequest(Kr.DocumentFormattingRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onDocumentFormatting"),onDocumentRangeFormatting:a(v=>o.onRequest(Kr.DocumentRangeFormattingRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onDocumentRangeFormatting"),onDocumentOnTypeFormatting:a(v=>o.onRequest(Kr.DocumentOnTypeFormattingRequest.type,(b,T)=>v(b,T)),"onDocumentOnTypeFormatting"),onRenameRequest:a(v=>o.onRequest(Kr.RenameRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onRenameRequest"),onPrepareRename:a(v=>o.onRequest(Kr.PrepareRenameRequest.type,(b,T)=>v(b,T)),"onPrepareRename"),onDocumentLinks:a(v=>o.onRequest(Kr.DocumentLinkRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentLinks"),onDocumentLinkResolve:a(v=>o.onRequest(Kr.DocumentLinkResolveRequest.type,(b,T)=>v(b,T)),"onDocumentLinkResolve"),onDocumentColor:a(v=>o.onRequest(Kr.DocumentColorRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onDocumentColor"),onColorPresentation:a(v=>o.onRequest(Kr.ColorPresentationRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onColorPresentation"),onFoldingRanges:a(v=>o.onRequest(Kr.FoldingRangeRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onFoldingRanges"),onSelectionRanges:a(v=>o.onRequest(Kr.SelectionRangeRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),(0,To.attachPartialResult)(o,b))),"onSelectionRanges"),onExecuteCommand:a(v=>o.onRequest(Kr.ExecuteCommandRequest.type,(b,T)=>v(b,T,(0,To.attachWorkDone)(o,b),void 0)),"onExecuteCommand"),dispose:a(()=>o.dispose(),"dispose")};for(let v of m)v.attach(_);return o.onRequest(Kr.InitializeRequest.type,v=>{e.initialize(v),Wx.string(v.trace)&&(s.trace=Kr.Trace.fromString(v.trace));for(let b of m)b.initialize(v.capabilities);if(y){let b=y(v,new Kr.CancellationTokenSource().token,(0,To.attachWorkDone)(o,v),void 0);return g(b).then(T=>{if(T instanceof Kr.ResponseError)return T;let w=T;w||(w={capabilities:{}});let R=w.capabilities;R||(R={},w.capabilities=R),R.textDocumentSync===void 0||R.textDocumentSync===null?R.textDocumentSync=Wx.number(_.__textDocumentSync)?_.__textDocumentSync:Kr.TextDocumentSyncKind.None:!Wx.number(R.textDocumentSync)&&!Wx.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=Wx.number(_.__textDocumentSync)?_.__textDocumentSync:Kr.TextDocumentSyncKind.None);for(let x of m)x.fillServerCapabilities(R);return w})}else{let b={capabilities:{textDocumentSync:Kr.TextDocumentSyncKind.None}};for(let T of m)T.fillServerCapabilities(b.capabilities);return b}}),o.onRequest(Kr.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,A)return A(new Kr.CancellationTokenSource().token)}),o.onNotification(Kr.ExitNotification.type,()=>{try{E&&E()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),o.onNotification(Kr.SetTraceNotification.type,v=>{s.trace=Kr.Trace.fromString(v.value)}),_}a(h6o,"createConnection");Ac.createConnection=h6o});var Jmn=I(LC=>{"use strict";p();Object.defineProperty(LC,"__esModule",{value:!0});LC.resolveModulePath=LC.FileSystem=LC.resolveGlobalYarnPath=LC.resolveGlobalNodePath=LC.resolve=LC.uriToFilePath=void 0;var m6o=require("url"),UP=require("path"),I9t=require("fs"),k9t=require("child_process");function g6o(t){let e=m6o.parse(t);if(e.protocol!=="file:"||!e.path)return;let r=e.path.split("/");for(var n=0,o=r.length;n1){let s=r[0],c=r[1];s.length===0&&c.length>1&&c[1]===":"&&r.shift()}return UP.normalize(r.join("/"))}a(g6o,"uriToFilePath");LC.uriToFilePath=g6o;function x9t(){return process.platform==="win32"}a(x9t,"isWindows");function fze(t,e,r,n){let o="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((c,l)=>{let u=process.env,d=Object.create(null);Object.keys(u).forEach(f=>d[f]=u[f]),e&&I9t.existsSync(e)&&(d[o]?d[o]=e+UP.delimiter+d[o]:d[o]=e,n&&n(`NODE_PATH value is: ${d[o]}`)),d.ELECTRON_RUN_AS_NODE="1";try{let f=(0,k9t.fork)("",[],{cwd:r,env:d,execArgv:["-e",s]});if(f.pid===void 0){l(new Error(`Starting process to resolve node module ${t} failed`));return}f.on("error",m=>{l(m)}),f.on("message",m=>{m.c==="r"&&(f.send({c:"e"}),m.s?c(m.r):l(new Error(`Failed to resolve module: ${t}`)))});let h={c:"rs",a:t};f.send(h)}catch(f){l(f)}})}a(fze,"resolve");LC.resolve=fze;function w9t(t){let e="npm",r=Object.create(null);Object.keys(process.env).forEach(s=>r[s]=process.env[s]),r.NO_UPDATE_NOTIFIER="true";let n={encoding:"utf8",env:r};x9t()&&(e="npm.cmd",n.shell=!0);let o=a(()=>{},"handler");try{process.on("SIGPIPE",o);let s=(0,k9t.spawnSync)(e,["config","get","prefix"],n).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let c=s.trim();return t&&t(`'npm config get prefix' value is: ${c}`),c.length>0?x9t()?UP.join(c,"node_modules"):UP.join(c,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",o)}}a(w9t,"resolveGlobalNodePath");LC.resolveGlobalNodePath=w9t;function A6o(t){let e="yarn",r={encoding:"utf8"};x9t()&&(e="yarn.cmd",r.shell=!0);let n=a(()=>{},"handler");try{process.on("SIGPIPE",n);let o=(0,k9t.spawnSync)(e,["global","dir","--json"],r),s=o.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),o.stderr&&t(o.stderr));return}let c=s.trim().split(/\r?\n/);for(let l of c)try{let u=JSON.parse(l);if(u.type==="log")return UP.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}a(A6o,"resolveGlobalYarnPath");LC.resolveGlobalYarnPath=A6o;var R9t;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!I9t.existsSync(__filename.toUpperCase())||!I9t.existsSync(__filename.toLowerCase())),e}a(r,"isCaseSensitive"),t.isCaseSensitive=r;function n(o,s){return r()?UP.normalize(s).indexOf(UP.normalize(o))===0:UP.normalize(s).toLowerCase().indexOf(UP.normalize(o).toLowerCase())===0}a(n,"isParent"),t.isParent=n})(R9t||(LC.FileSystem=R9t={}));function y6o(t,e,r,n){return r?(UP.isAbsolute(r)||(r=UP.join(t,r)),fze(e,r,r,n).then(o=>R9t.isParent(r,o)?o:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,o=>fze(e,w9t(n),t,n))):fze(e,w9t(n),t,n)}a(y6o,"resolveModulePath");LC.resolveModulePath=y6o});var P9t=I((tFu,Zmn)=>{"use strict";p();Zmn.exports=ei()});var Xmn=I(pze=>{"use strict";p();Object.defineProperty(pze,"__esModule",{value:!0});pze.InlineCompletionFeature=void 0;var E6o=ei(),_6o=a(t=>class extends t{get inlineCompletion(){return{on:a(e=>this.connection.onRequest(E6o.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineCompletionFeature");pze.InlineCompletionFeature=_6o});var r0n=I(lE=>{"use strict";p();var v6o=lE&&lE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),t0n=lE&&lE.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&v6o(e,t,r)};Object.defineProperty(lE,"__esModule",{value:!0});lE.ProposedFeatures=lE.NotebookDocuments=lE.TextDocuments=lE.SemanticTokensBuilder=void 0;var C6o=p9t();Object.defineProperty(lE,"SemanticTokensBuilder",{enumerable:!0,get:a(function(){return C6o.SemanticTokensBuilder},"get")});var b6o=Xmn();t0n(ei(),lE);var S6o=A9t();Object.defineProperty(lE,"TextDocuments",{enumerable:!0,get:a(function(){return S6o.TextDocuments},"get")});var T6o=E9t();Object.defineProperty(lE,"NotebookDocuments",{enumerable:!0,get:a(function(){return T6o.NotebookDocuments},"get")});t0n(T9t(),lE);var e0n;(function(t){t.all={__brand:"features",languages:b6o.InlineCompletionFeature}})(e0n||(lE.ProposedFeatures=e0n={}))});var Fc=I(zx=>{"use strict";p();var I6o=zx&&zx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),s0n=zx&&zx.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&I6o(e,t,r)};Object.defineProperty(zx,"__esModule",{value:!0});zx.createConnection=zx.Files=void 0;var n0n=require("node:util"),D9t=UWe(),x6o=T9t(),zIe=Jmn(),oK=P9t();s0n(P9t(),zx);s0n(r0n(),zx);var i0n;(function(t){t.uriToFilePath=zIe.uriToFilePath,t.resolveGlobalNodePath=zIe.resolveGlobalNodePath,t.resolveGlobalYarnPath=zIe.resolveGlobalYarnPath,t.resolve=zIe.resolve,t.resolveModulePath=zIe.resolveModulePath})(i0n||(zx.Files=i0n={}));var o0n;function hze(){if(o0n!==void 0)try{o0n.end()}catch{}}a(hze,"endProtocolConnection");var Ble=!1,a0n;function w6o(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(a0n=setInterval(()=>{try{process.kill(n,0)}catch{hze(),process.exit(Ble?0:1)}},3e3))}catch{}}a(e,"runTimer");for(let r=2;r{let e=t.processId;D9t.number(e)&&a0n===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Ble?0:1)}},3e3)},"initialize"),get shutdownReceived(){return Ble},set shutdownReceived(t){Ble=t},exit:a(t=>{hze(),process.exit(t)},"exit")};function k6o(t,e,r,n){let o,s,c,l;return t!==void 0&&t.__brand==="features"&&(o=t,t=e,e=r,r=n),oK.ConnectionStrategy.is(t)||oK.ConnectionOptions.is(t)?l=t:(s=t,c=e,l=r),P6o(s,c,l,o)}a(k6o,"createConnection");zx.createConnection=k6o;function P6o(t,e,r,n){let o=!1;if(!t&&!e&&process.argv.length>2){let u,d,f=process.argv.slice(2);for(let h=0;h{hze(),process.exit(Ble?0:1)}),u.on("close",()=>{hze(),process.exit(Ble?0:1)})}let l=a(u=>{let d=(0,oK.createProtocolConnection)(t,e,u,r);return o&&D6o(u),d},"connectionFactory");return(0,x6o.createConnection)(l,R6o,n)}a(P6o,"_createConnection");function D6o(t){function e(n){return n.map(o=>typeof o=="string"?o:(0,n0n.inspect)(o)).join(" ")}a(e,"serialize");let r=new Map;console.assert=a(function(o,...s){if(!o)if(s.length===0)t.error("Assertion failed");else{let[c,...l]=s;t.error(`Assertion failed: ${c} ${e(l)}`)}},"assert"),console.count=a(function(o="default"){let s=String(o),c=r.get(s)??0;c+=1,r.set(s,c),t.log(`${s}: ${s}`)},"count"),console.countReset=a(function(o){o===void 0?r.clear():r.delete(String(o))},"countReset"),console.debug=a(function(...o){t.log(e(o))},"debug"),console.dir=a(function(o,s){t.log((0,n0n.inspect)(o,s))},"dir"),console.log=a(function(...o){t.log(e(o))},"log"),console.error=a(function(...o){t.error(e(o))},"error"),console.trace=a(function(...o){let s=new Error().stack.replace(/(.+\n){2}/,""),c="Trace";o.length!==0&&(c+=`: ${e(o)}`),t.log(`${c} +${s}`)},"trace"),console.warn=a(function(...o){t.warn(e(o))},"warn")}a(D6o,"patchConsole")});var QP=I((pFu,c0n)=>{"use strict";p();c0n.exports=Fc()});var Q0n=I((i6u,U0n)=>{"use strict";p();U0n.exports=a(function(e){if(e===void 0&&(e=2),e>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+e+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var r=Error.prepareStackTrace;Error.prepareStackTrace=function(o,s){return s};var n=new Error().stack;if(Error.prepareStackTrace=r,n!==null&&typeof n=="object")return n[e]?n[e].getFileName():void 0},"getCallerFile")});var Fgn=I(u0=>{"use strict";p();var hUt=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"a"),N9o=hUt(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sync=t.isexe=void 0;var e=require("node:fs"),r=require("node:fs/promises"),n=a(async(l,u={})=>{let{ignoreErrors:d=!1}=u;try{return s(await(0,r.stat)(l),u)}catch(f){let h=f;if(d||h.code==="EACCES")return!1;throw h}},"q");t.isexe=n;var o=a((l,u={})=>{let{ignoreErrors:d=!1}=u;try{return s((0,e.statSync)(l),u)}catch(f){let h=f;if(d||h.code==="EACCES")return!1;throw h}},"m");t.sync=o;var s=a((l,u)=>l.isFile()&&c(l,u),"d"),c=a((l,u)=>{let d=u.uid??process.getuid?.(),f=u.groups??process.getgroups?.()??[],h=u.gid??process.getgid?.()??f[0];if(d===void 0||h===void 0)throw new Error("cannot get uid or gid");let m=new Set([h,...f]),g=l.mode,A=l.uid,y=l.gid,E=parseInt("100",8),_=parseInt("010",8),v=parseInt("001",8),b=E|_;return!!(g&v||g&_&&m.has(y)||g&E&&A===d||g&b&&d===0)},"A")}),M9o=hUt(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sync=t.isexe=void 0;var e=require("node:fs"),r=require("node:fs/promises"),n=require("node:path"),o=a(async(u,d={})=>{let{ignoreErrors:f=!1}=d;try{return l(await(0,r.stat)(u),u,d)}catch(h){let m=h;if(f||m.code==="EACCES")return!1;throw m}},"F");t.isexe=o;var s=a((u,d={})=>{let{ignoreErrors:f=!1}=d;try{return l((0,e.statSync)(u),u,d)}catch(h){let m=h;if(f||m.code==="EACCES")return!1;throw m}},"L");t.sync=s;var c=a((u,d)=>{let{pathExt:f=process.env.PATHEXT||""}=d,h=f.split(n.delimiter);if(h.indexOf("")!==-1)return!0;for(let m of h){let g=m.toLowerCase(),A=u.substring(u.length-g.length).toLowerCase();if(g&&A===g)return!0}return!1},"B"),l=a((u,d,f)=>u.isFile()&&c(d,f),"y")}),O9o=hUt(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})}),Ngn=u0&&u0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),L9o=u0&&u0.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Mgn=u0&&u0.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"t");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{p();var{isexe:U9o,sync:Q9o}=Fgn(),{join:q9o,delimiter:j9o,sep:Ugn,posix:Qgn}=require("path"),qgn=process.platform==="win32",jgn=new RegExp(`[${Qgn.sep}${Ugn===Qgn.sep?"":Ugn}]`.replace(/(\\)/g,"\\$1")),H9o=new RegExp(`^\\.${jgn.source}`),Hgn=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),Ggn=a((t,{path:e=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=j9o})=>{let o=t.match(jgn)?[""]:[...qgn?[process.cwd()]:[],...(e||"").split(n)];if(qgn){let s=r||[".EXE",".CMD",".BAT",".COM"].join(n),c=s.split(n).flatMap(l=>[l,l.toLowerCase()]);return t.includes(".")&&c[0]!==""&&c.unshift(""),{pathEnv:o,pathExt:c,pathExtExe:s}}return{pathEnv:o,pathExt:[""]}},"getPathInfo"),$gn=a((t,e)=>{let r=/^".*"$/.test(t)?t.slice(1,-1):t;return(!r&&H9o.test(e)?e.slice(0,2):"")+q9o(r,e)},"getPathPart"),Vgn=a(async(t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=Ggn(t,e),s=[];for(let c of r){let l=$gn(c,t);for(let u of n){let d=l+u;if(await U9o(d,{pathExt:o,ignoreErrors:!0})){if(!e.all)return d;s.push(d)}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw Hgn(t)},"which"),G9o=a((t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=Ggn(t,e),s=[];for(let c of r){let l=$gn(c,t);for(let u of n){let d=l+u;if(Q9o(d,{pathExt:o,ignoreErrors:!0})){if(!e.all)return d;s.push(d)}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw Hgn(t)},"whichSync");Wgn.exports=Vgn;Vgn.sync=G9o});var uxe=I((Uju,Pyn)=>{"use strict";p();var xyn="[^\\\\/]",S7o="(?=.)",wyn="[^/]",t7t="(?:\\/|$)",Ryn="(?:^|\\/)",r7t=`\\.{1,2}${t7t}`,T7o="(?!\\.)",I7o=`(?!${Ryn}${r7t})`,x7o=`(?!\\.{0,1}${t7t})`,w7o=`(?!${r7t})`,R7o="[^.\\/]",k7o=`${wyn}*?`,P7o="/",kyn={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:S7o,QMARK:wyn,END_ANCHOR:t7t,DOTS_SLASH:r7t,NO_DOT:T7o,NO_DOTS:I7o,NO_DOT_SLASH:x7o,NO_DOTS_SLASH:w7o,QMARK_NO_DOT:R7o,STAR:k7o,START_ANCHOR:Ryn,SEP:P7o},D7o={...kyn,SLASH_LITERAL:"[\\\\/]",QMARK:xyn,STAR:`${xyn}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},N7o={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Pyn.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:N7o,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?D7o:kyn}}});var dxe=I(QC=>{"use strict";p();var{REGEX_BACKSLASH:M7o,REGEX_REMOVE_BACKSLASH:O7o,REGEX_SPECIAL_CHARS:L7o,REGEX_SPECIAL_CHARS_GLOBAL:B7o}=uxe();QC.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);QC.hasRegexChars=t=>L7o.test(t);QC.isRegexChar=t=>t.length===1&&QC.hasRegexChars(t);QC.escapeRegex=t=>t.replace(B7o,"\\$1");QC.toPosixSlashes=t=>t.replace(M7o,"/");QC.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};QC.removeBackslashes=t=>t.replace(O7o,e=>e==="\\"?"":e);QC.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?QC.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};QC.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};QC.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",s=`${n}(?:${t})${o}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};QC.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var Uyn=I((Hju,Fyn)=>{"use strict";p();var Dyn=dxe(),{CHAR_ASTERISK:n7t,CHAR_AT:F7o,CHAR_BACKWARD_SLASH:fxe,CHAR_COMMA:U7o,CHAR_DOT:i7t,CHAR_EXCLAMATION_MARK:o7t,CHAR_FORWARD_SLASH:Byn,CHAR_LEFT_CURLY_BRACE:s7t,CHAR_LEFT_PARENTHESES:a7t,CHAR_LEFT_SQUARE_BRACKET:Q7o,CHAR_PLUS:q7o,CHAR_QUESTION_MARK:Nyn,CHAR_RIGHT_CURLY_BRACE:j7o,CHAR_RIGHT_PARENTHESES:Myn,CHAR_RIGHT_SQUARE_BRACKET:H7o}=uxe(),Oyn=a(t=>t===Byn||t===fxe,"isPathSeparator"),Lyn=a(t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},"depth"),G7o=a((t,e)=>{let r=e||{},n=t.length-1,o=r.parts===!0||r.scanToEnd===!0,s=[],c=[],l=[],u=t,d=-1,f=0,h=0,m=!1,g=!1,A=!1,y=!1,E=!1,_=!1,v=!1,b=!1,T=!1,w=!1,R=0,x,P,D={value:"",depth:0,isGlob:!1},N=a(()=>d>=n,"eos"),L=a(()=>u.charCodeAt(d+1),"peek"),B=a(()=>(x=P,u.charCodeAt(++d)),"advance");for(;d0&&(M=u.slice(0,f),u=u.slice(f),h-=f),j&&A===!0&&h>0?(j=u.slice(0,h),O=u.slice(h)):A===!0?(j="",O=u):j=u,j&&j!==""&&j!=="/"&&j!==u&&Oyn(j.charCodeAt(j.length-1))&&(j=j.slice(0,-1)),r.unescape===!0&&(O&&(O=Dyn.removeBackslashes(O)),j&&v===!0&&(j=Dyn.removeBackslashes(j)));let U={prefix:M,input:t,start:f,base:j,glob:O,isBrace:m,isBracket:g,isGlob:A,isExtglob:y,isGlobstar:E,negated:b,negatedExtglob:T};if(r.tokens===!0&&(U.maxDepth=0,Oyn(P)||c.push(D),U.tokens=c),r.parts===!0||r.tokens===!0){let q;for(let Q=0;Q{"use strict";p();var pxe=uxe(),WS=dxe(),{MAX_LENGTH:oYe,POSIX_REGEX_SOURCE:$7o,REGEX_NON_SPECIAL_CHARS:V7o,REGEX_SPECIAL_CHARS_BACKREF:W7o,REPLACEMENTS:Qyn}=pxe,z7o=a((t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(o=>WS.escapeRegex(o)).join("..")}return r},"expandRange"),Kle=a((t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,"syntaxError"),qyn=a(t=>{let e=[],r=0,n=0,o=0,s="",c=!1;for(let l of t){if(c===!0){s+=l,c=!1;continue}if(l==="\\"){s+=l,c=!0;continue}if(l==='"'){o=o===1?0:1,s+=l;continue}if(o===0){if(l==="[")r++;else if(l==="]"&&r>0)r--;else if(r===0){if(l==="(")n++;else if(l===")"&&n>0)n--;else if(l==="|"&&n===0){e.push(s),s="";continue}}}s+=l}return e.push(s),e},"splitTopLevel"),Y7o=a(t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},"isPlainBranch"),jyn=a(t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(Y7o(e))return e.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),K7o=a(t=>{let e=t.map(jyn).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,o=0,s=!1;for(let c=1;c0){r--;continue}if(!(r>0)){if(l==="("){n++;continue}if(l===")"&&(n--,n===0))return e===!0&&c!==t.length-1?void 0:{type:t[0],body:t.slice(2,c),end:c}}}}},"parseRepeatedExtglob"),J7o=a(t=>{let e=0,r=[];for(;el.trim());if(s.length!==1)return;let c=jyn(s[0]);if(!c||c.length!==1)return;r.push(c),e+=o.end+1}return r.length<1?void 0:`${r.length===1?WS.escapeRegex(r[0]):`[${r.map(o=>WS.escapeRegex(o)).join("")}]`}*`},"getStarExtglobSequenceOutput"),Z7o=a(t=>{let e=0,r=t.trim(),n=c7t(r);for(;n;)e++,r=n.body.trim(),n=c7t(r);return e},"repeatedExtglobRecursion"),X7o=a((t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:pxe.DEFAULT_MAX_EXTGLOB_RECURSION,n=qyn(t).map(o=>o.trim());if(n.length>1&&(n.some(o=>o==="")||n.some(o=>/^[*?]+$/.test(o))||K7o(n)))return{risky:!0};for(let o of n){let s=J7o(o);if(s)return{risky:!0,safeOutput:s};if(Z7o(o)>r)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),l7t=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Qyn[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(oYe,r.maxLength):oYe,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},c=[s],l=r.capture?"":"?:",u=pxe.globChars(r.windows),d=pxe.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:h,SLASH_LITERAL:m,ONE_CHAR:g,DOTS_SLASH:A,NO_DOT:y,NO_DOT_SLASH:E,NO_DOTS_SLASH:_,QMARK:v,QMARK_NO_DOT:b,STAR:T,START_ANCHOR:w}=u,R=a(ge=>`(${l}(?:(?!${w}${ge.dot?A:f}).)*?)`,"globstar"),x=r.dot?"":y,P=r.dot?v:b,D=r.bash===!0?R(r):T;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let N={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:c};t=WS.removePrefix(t,N),o=t.length;let L=[],B=[],j=[],M=s,O,U=a(()=>N.index===o-1,"eos"),q=N.peek=(ge=1)=>t[N.index+ge],Q=N.advance=()=>t[++N.index]||"",Y=a(()=>t.slice(N.index+1),"remaining"),W=a((ge="",Oe=0)=>{N.consumed+=ge,N.index+=Oe},"consume"),V=a(ge=>{N.output+=ge.output!=null?ge.output:ge.value,W(ge.value)},"append"),z=a(()=>{let ge=1;for(;q()==="!"&&(q(2)!=="("||q(3)==="?");)Q(),N.start++,ge++;return ge%2===0?!1:(N.negated=!0,N.start++,!0)},"negate"),ie=a(ge=>{N[ge]++,j.push(ge)},"increment"),H=a(ge=>{N[ge]--,j.pop()},"decrement"),te=a(ge=>{if(M.type==="globstar"){let Oe=N.braces>0&&(ge.type==="comma"||ge.type==="brace"),we=ge.extglob===!0||L.length&&(ge.type==="pipe"||ge.type==="paren");ge.type!=="slash"&&ge.type!=="paren"&&!Oe&&!we&&(N.output=N.output.slice(0,-M.output.length),M.type="star",M.value="*",M.output=D,N.output+=M.output)}if(L.length&&ge.type!=="paren"&&(L[L.length-1].inner+=ge.value),(ge.value||ge.output)&&V(ge),M&&M.type==="text"&&ge.type==="text"){M.output=(M.output||M.value)+ge.value,M.value+=ge.value;return}ge.prev=M,c.push(ge),M=ge},"push"),le=a((ge,Oe)=>{let we={...d[Oe],conditions:1,inner:""};we.prev=M,we.parens=N.parens,we.output=N.output,we.startIndex=N.index,we.tokensIndex=c.length;let re=(r.capture?"(":"")+we.open;ie("parens"),te({type:ge,value:Oe,output:N.output?"":g}),te({type:"paren",extglob:!0,value:Q(),output:re}),L.push(we)},"extglobOpen"),Le=a(ge=>{let Oe=t.slice(ge.startIndex,N.index+1),we=t.slice(ge.startIndex+2,N.index),re=X7o(we,r);if((ge.type==="plus"||ge.type==="star")&&re.risky){let he=re.safeOutput?(ge.output?"":g)+(r.capture?`(${re.safeOutput})`:re.safeOutput):void 0,X=c[ge.tokensIndex];X.type="text",X.value=Oe,X.output=he||WS.escapeRegex(Oe);for(let de=ge.tokensIndex+1;de1&&ge.inner.includes("/")&&(he=R(r)),(he!==D||U()||/^\)+$/.test(Y()))&&(ee=ge.close=`)$))${he}`),ge.inner.includes("*")&&(K=Y())&&/^\.[^\\/.]+$/.test(K)){let X=l7t(K,{...e,fastpaths:!1}).output;ee=ge.close=`)${X})${he})`}ge.prev.type==="bos"&&(N.negatedExtglob=!0)}te({type:"paren",extglob:!0,value:O,output:ee}),H("parens")},"extglobClose");if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let ge=!1,Oe=t.replace(W7o,(we,re,ee,K,he,X)=>K==="\\"?(ge=!0,we):K==="?"?re?re+K+(he?v.repeat(he.length):""):X===0?P+(he?v.repeat(he.length):""):v.repeat(ee.length):K==="."?f.repeat(ee.length):K==="*"?re?re+K+(he?D:""):D:re?we:`\\${we}`);return ge===!0&&(r.unescape===!0?Oe=Oe.replace(/\\/g,""):Oe=Oe.replace(/\\+/g,we=>we.length%2===0?"\\\\":we?"\\":"")),Oe===t&&r.contains===!0?(N.output=t,N):(N.output=WS.wrapOutput(Oe,N,e),N)}for(;!U();){if(O=Q(),O==="\0")continue;if(O==="\\"){let we=q();if(we==="/"&&r.bash!==!0||we==="."||we===";")continue;if(!we){O+="\\",te({type:"text",value:O});continue}let re=/^\\+/.exec(Y()),ee=0;if(re&&re[0].length>2&&(ee=re[0].length,N.index+=ee,ee%2!==0&&(O+="\\")),r.unescape===!0?O=Q():O+=Q(),N.brackets===0){te({type:"text",value:O});continue}}if(N.brackets>0&&(O!=="]"||M.value==="["||M.value==="[^")){if(r.posix!==!1&&O===":"){let we=M.value.slice(1);if(we.includes("[")&&(M.posix=!0,we.includes(":"))){let re=M.value.lastIndexOf("["),ee=M.value.slice(0,re),K=M.value.slice(re+2),he=$7o[K];if(he){M.value=ee+he,N.backtrack=!0,Q(),!s.output&&c.indexOf(M)===1&&(s.output=g);continue}}}(O==="["&&q()!==":"||O==="-"&&q()==="]")&&(O=`\\${O}`),O==="]"&&(M.value==="["||M.value==="[^")&&(O=`\\${O}`),r.posix===!0&&O==="!"&&M.value==="["&&(O="^"),M.value+=O,V({value:O});continue}if(N.quotes===1&&O!=='"'){O=WS.escapeRegex(O),M.value+=O,V({value:O});continue}if(O==='"'){N.quotes=N.quotes===1?0:1,r.keepQuotes===!0&&te({type:"text",value:O});continue}if(O==="("){ie("parens"),te({type:"paren",value:O});continue}if(O===")"){if(N.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Kle("opening","("));let we=L[L.length-1];if(we&&N.parens===we.parens+1){Le(L.pop());continue}te({type:"paren",value:O,output:N.parens?")":"\\)"}),H("parens");continue}if(O==="["){if(r.nobracket===!0||!Y().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Kle("closing","]"));O=`\\${O}`}else ie("brackets");te({type:"bracket",value:O});continue}if(O==="]"){if(r.nobracket===!0||M&&M.type==="bracket"&&M.value.length===1){te({type:"text",value:O,output:`\\${O}`});continue}if(N.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Kle("opening","["));te({type:"text",value:O,output:`\\${O}`});continue}H("brackets");let we=M.value.slice(1);if(M.posix!==!0&&we[0]==="^"&&!we.includes("/")&&(O=`/${O}`),M.value+=O,V({value:O}),r.literalBrackets===!1||WS.hasRegexChars(we))continue;let re=WS.escapeRegex(M.value);if(N.output=N.output.slice(0,-M.value.length),r.literalBrackets===!0){N.output+=re,M.value=re;continue}M.value=`(${l}${re}|${M.value})`,N.output+=M.value;continue}if(O==="{"&&r.nobrace!==!0){ie("braces");let we={type:"brace",value:O,output:"(",outputIndex:N.output.length,tokensIndex:N.tokens.length};B.push(we),te(we);continue}if(O==="}"){let we=B[B.length-1];if(r.nobrace===!0||!we){te({type:"text",value:O,output:O});continue}let re=")";if(we.dots===!0){let ee=c.slice(),K=[];for(let he=ee.length-1;he>=0&&(c.pop(),ee[he].type!=="brace");he--)ee[he].type!=="dots"&&K.unshift(ee[he].value);re=z7o(K,r),N.backtrack=!0}if(we.comma!==!0&&we.dots!==!0){let ee=N.output.slice(0,we.outputIndex),K=N.tokens.slice(we.tokensIndex);we.value=we.output="\\{",O=re="\\}",N.output=ee;for(let he of K)N.output+=he.output||he.value}te({type:"brace",value:O,output:re}),H("braces"),B.pop();continue}if(O==="|"){L.length>0&&L[L.length-1].conditions++,te({type:"text",value:O});continue}if(O===","){let we=O,re=B[B.length-1];re&&j[j.length-1]==="braces"&&(re.comma=!0,we="|"),te({type:"comma",value:O,output:we});continue}if(O==="/"){if(M.type==="dot"&&N.index===N.start+1){N.start=N.index+1,N.consumed="",N.output="",c.pop(),M=s;continue}te({type:"slash",value:O,output:m});continue}if(O==="."){if(N.braces>0&&M.type==="dot"){M.value==="."&&(M.output=f);let we=B[B.length-1];M.type="dots",M.output+=O,M.value+=O,we.dots=!0;continue}if(N.braces+N.parens===0&&M.type!=="bos"&&M.type!=="slash"){te({type:"text",value:O,output:f});continue}te({type:"dot",value:O,output:f});continue}if(O==="?"){if(!(M&&M.value==="(")&&r.noextglob!==!0&&q()==="("&&q(2)!=="?"){le("qmark",O);continue}if(M&&M.type==="paren"){let re=q(),ee=O;(M.value==="("&&!/[!=<:]/.test(re)||re==="<"&&!/<([!=]|\w+>)/.test(Y()))&&(ee=`\\${O}`),te({type:"text",value:O,output:ee});continue}if(r.dot!==!0&&(M.type==="slash"||M.type==="bos")){te({type:"qmark",value:O,output:b});continue}te({type:"qmark",value:O,output:v});continue}if(O==="!"){if(r.noextglob!==!0&&q()==="("&&(q(2)!=="?"||!/[!=<:]/.test(q(3)))){le("negate",O);continue}if(r.nonegate!==!0&&N.index===0){z();continue}}if(O==="+"){if(r.noextglob!==!0&&q()==="("&&q(2)!=="?"){le("plus",O);continue}if(M&&M.value==="("||r.regex===!1){te({type:"plus",value:O,output:h});continue}if(M&&(M.type==="bracket"||M.type==="paren"||M.type==="brace")||N.parens>0){te({type:"plus",value:O});continue}te({type:"plus",value:h});continue}if(O==="@"){if(r.noextglob!==!0&&q()==="("&&q(2)!=="?"){te({type:"at",extglob:!0,value:O,output:""});continue}te({type:"text",value:O});continue}if(O!=="*"){(O==="$"||O==="^")&&(O=`\\${O}`);let we=V7o.exec(Y());we&&(O+=we[0],N.index+=we[0].length),te({type:"text",value:O});continue}if(M&&(M.type==="globstar"||M.star===!0)){M.type="star",M.star=!0,M.value+=O,M.output=D,N.backtrack=!0,N.globstar=!0,W(O);continue}let ge=Y();if(r.noextglob!==!0&&/^\([^?]/.test(ge)){le("star",O);continue}if(M.type==="star"){if(r.noglobstar===!0){W(O);continue}let we=M.prev,re=we.prev,ee=we.type==="slash"||we.type==="bos",K=re&&(re.type==="star"||re.type==="globstar");if(r.bash===!0&&(!ee||ge[0]&&ge[0]!=="/")){te({type:"star",value:O,output:""});continue}let he=N.braces>0&&(we.type==="comma"||we.type==="brace"),X=L.length&&(we.type==="pipe"||we.type==="paren");if(!ee&&we.type!=="paren"&&!he&&!X){te({type:"star",value:O,output:""});continue}for(;ge.slice(0,3)==="/**";){let de=t[N.index+4];if(de&&de!=="/")break;ge=ge.slice(3),W("/**",3)}if(we.type==="bos"&&U()){M.type="globstar",M.value+=O,M.output=R(r),N.output=M.output,N.globstar=!0,W(O);continue}if(we.type==="slash"&&we.prev.type!=="bos"&&!K&&U()){N.output=N.output.slice(0,-(we.output+M.output).length),we.output=`(?:${we.output}`,M.type="globstar",M.output=R(r)+(r.strictSlashes?")":"|$)"),M.value+=O,N.globstar=!0,N.output+=we.output+M.output,W(O);continue}if(we.type==="slash"&&we.prev.type!=="bos"&&ge[0]==="/"){let de=ge[1]!==void 0?"|$":"";N.output=N.output.slice(0,-(we.output+M.output).length),we.output=`(?:${we.output}`,M.type="globstar",M.output=`${R(r)}${m}|${m}${de})`,M.value+=O,N.output+=we.output+M.output,N.globstar=!0,W(O+Q()),te({type:"slash",value:"/",output:""});continue}if(we.type==="bos"&&ge[0]==="/"){M.type="globstar",M.value+=O,M.output=`(?:^|${m}|${R(r)}${m})`,N.output=M.output,N.globstar=!0,W(O+Q()),te({type:"slash",value:"/",output:""});continue}N.output=N.output.slice(0,-M.output.length),M.type="globstar",M.output=R(r),M.value+=O,N.output+=M.output,N.globstar=!0,W(O);continue}let Oe={type:"star",value:O,output:D};if(r.bash===!0){Oe.output=".*?",(M.type==="bos"||M.type==="slash")&&(Oe.output=x+Oe.output),te(Oe);continue}if(M&&(M.type==="bracket"||M.type==="paren")&&r.regex===!0){Oe.output=O,te(Oe);continue}(N.index===N.start||M.type==="slash"||M.type==="dot")&&(M.type==="dot"?(N.output+=E,M.output+=E):r.dot===!0?(N.output+=_,M.output+=_):(N.output+=x,M.output+=x),q()!=="*"&&(N.output+=g,M.output+=g)),te(Oe)}for(;N.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Kle("closing","]"));N.output=WS.escapeLast(N.output,"["),H("brackets")}for(;N.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Kle("closing",")"));N.output=WS.escapeLast(N.output,"("),H("parens")}for(;N.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Kle("closing","}"));N.output=WS.escapeLast(N.output,"{"),H("braces")}if(r.strictSlashes!==!0&&(M.type==="star"||M.type==="bracket")&&te({type:"maybe_slash",value:"",output:`${m}?`}),N.backtrack===!0){N.output="";for(let ge of N.tokens)N.output+=ge.output!=null?ge.output:ge.value,ge.suffix&&(N.output+=ge.suffix)}return N},"parse");l7t.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(oYe,r.maxLength):oYe,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);t=Qyn[t]||t;let{DOT_LITERAL:s,SLASH_LITERAL:c,ONE_CHAR:l,DOTS_SLASH:u,NO_DOT:d,NO_DOTS:f,NO_DOTS_SLASH:h,STAR:m,START_ANCHOR:g}=pxe.globChars(r.windows),A=r.dot?f:d,y=r.dot?h:d,E=r.capture?"":"?:",_={negated:!1,prefix:""},v=r.bash===!0?".*?":m;r.capture&&(v=`(${v})`);let b=a(x=>x.noglobstar===!0?v:`(${E}(?:(?!${g}${x.dot?u:s}).)*?)`,"globstar"),T=a(x=>{switch(x){case"*":return`${A}${l}${v}`;case".*":return`${s}${l}${v}`;case"*.*":return`${A}${v}${s}${l}${v}`;case"*/*":return`${A}${v}${c}${l}${y}${v}`;case"**":return A+b(r);case"**/*":return`(?:${A}${b(r)}${c})?${y}${l}${v}`;case"**/*.*":return`(?:${A}${b(r)}${c})?${y}${v}${s}${l}${v}`;case"**/.*":return`(?:${A}${b(r)}${c})?${s}${l}${v}`;default:{let P=/^(.*?)\.(\w+)$/.exec(x);if(!P)return;let D=T(P[1]);return D?D+s+P[2]:void 0}}},"create"),w=WS.removePrefix(t,_),R=T(w);return R&&r.strictSlashes!==!0&&(R+=`${c}?`),R};Hyn.exports=l7t});var Wyn=I((Yju,Vyn)=>{"use strict";p();var eQo=Uyn(),u7t=Gyn(),$yn=dxe(),tQo=uxe(),rQo=a(t=>t&&typeof t=="object"&&!Array.isArray(t),"isObject"),th=a((t,e,r=!1)=>{if(Array.isArray(t)){let f=t.map(m=>th(m,e,r));return a(m=>{for(let g of f){let A=g(m);if(A)return A}return!1},"arrayMatcher")}let n=rQo(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let o=e||{},s=o.windows,c=n?th.compileRe(t,e):th.makeRe(t,e,!1,!0),l=c.state;delete c.state;let u=a(()=>!1,"isIgnored");if(o.ignore){let f={...e,ignore:null,onMatch:null,onResult:null};u=th(o.ignore,f,r)}let d=a((f,h=!1)=>{let{isMatch:m,match:g,output:A}=th.test(f,c,e,{glob:t,posix:s}),y={glob:t,state:l,regex:c,posix:s,input:f,output:A,match:g,isMatch:m};return typeof o.onResult=="function"&&o.onResult(y),m===!1?(y.isMatch=!1,h?y:!1):u(f)?(typeof o.onIgnore=="function"&&o.onIgnore(y),y.isMatch=!1,h?y:!1):(typeof o.onMatch=="function"&&o.onMatch(y),h?y:!0)},"matcher");return r&&(d.state=l),d},"picomatch");th.test=(t,e,r,{glob:n,posix:o}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let s=r||{},c=s.format||(o?$yn.toPosixSlashes:null),l=t===n,u=l&&c?c(t):t;return l===!1&&(u=c?c(t):t,l=u===n),(l===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?l=th.matchBase(t,e,r,o):l=e.exec(u)),{isMatch:!!l,match:l,output:u}};th.matchBase=(t,e,r)=>(e instanceof RegExp?e:th.makeRe(e,r)).test($yn.basename(t));th.isMatch=(t,e,r)=>th(e,r)(t);th.parse=(t,e)=>Array.isArray(t)?t.map(r=>th.parse(r,e)):u7t(t,{...e,fastpaths:!1});th.scan=(t,e)=>eQo(t,e);th.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let o=e||{},s=o.contains?"":"^",c=o.contains?"":"$",l=`${s}(?:${t.output})${c}`;t&&t.negated===!0&&(l=`^(?!${l}).*$`);let u=th.toRegex(l,e);return n===!0&&(u.state=t),u};th.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(o.output=u7t.fastpaths(t,e)),o.output||(o=u7t(t,e)),th.compileRe(o,e,r,n)};th.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};th.constants=tQo;Vyn.exports=th});var Jyn=I((Zju,Kyn)=>{"use strict";p();var zyn=Wyn(),nQo=dxe();function Yyn(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:nQo.isWindows()}),zyn(t,e,r)}a(Yyn,"picomatch");Object.assign(Yyn,zyn);Kyn.exports=Yyn});var Xyn=I((tHu,Zyn)=>{p();Zyn.exports=a(function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1},"isExtglob")});var rEn=I((iHu,tEn)=>{p();var iQo=Xyn(),eEn={"{":"}","(":")","[":"]"},oQo=a(function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,n=-2,o=-2,s=-2,c=-2;ee&&(c===-1||c>n||(c=t.indexOf("\\",e),c===-1||c>n)))||o!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(o=t.indexOf("}",e),o>e&&(c=t.indexOf("\\",e),c===-1||c>o))||s!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(s=t.indexOf(")",e),s>e&&(c=t.indexOf("\\",e),c===-1||c>s))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(rr&&(c=t.indexOf("\\",r),c===-1||c>s))))return!0;if(t[e]==="\\"){var l=t[e+1];e+=2;var u=eEn[l];if(u){var d=t.indexOf(u,e);d!==-1&&(e=d+1)}if(t[e]==="!")return!0}else e++}return!1},"strictCheck"),sQo=a(function(t){if(t[0]==="!")return!0;for(var e=0;e{p();var RK=require("path"),aQo=Jyn(),cQo=rEn();function sYe(t,e={}){let{ignore:r,...n}=e;if(Array.isArray(r)){e={...n};for(let o of r)if(cQo(o)){e.ignoreGlobs||(e.ignoreGlobs=[]);let s=aQo.makeRe(o,{dot:!0,windows:process.platform==="win32"});e.ignoreGlobs.push(s.source)}else e.ignorePaths||(e.ignorePaths=[]),e.ignorePaths.push(RK.resolve(t,o))}return e}a(sYe,"normalizeOptions");nEn.createWrapper=t=>({writeSnapshot(e,r,n){return t.writeSnapshot(RK.resolve(e),RK.resolve(r),sYe(e,n))},getEventsSince(e,r,n){return t.getEventsSince(RK.resolve(e),RK.resolve(r),sYe(e,n))},async subscribe(e,r,n){return e=RK.resolve(e),n=sYe(e,n),await t.subscribe(e,r,n),{unsubscribe(){return t.unsubscribe(e,r,n)}}},unsubscribe(e,r,n){return t.unsubscribe(RK.resolve(e),r,sYe(e,n))}})});var oEn=I(hxe=>{"use strict";p();var lQo=require("path"),{createWrapper:uQo}=iEn();function dQo(){return lQo.join(__dirname,"compiled",process.platform,process.arch,"watcher.node")}a(dQo,"resolveBindingPath");var fQo=require(dQo()),aYe=uQo(fQo);hxe.writeSnapshot=aYe.writeSnapshot;hxe.getEventsSince=aYe.getEventsSince;hxe.subscribe=aYe.subscribe;hxe.unsubscribe=aYe.unsubscribe});var $_=I(pYe=>{"use strict";p();Object.defineProperty(pYe,"__esModule",{value:!0});pYe.Position=void 0;var m7t=class t{static{a(this,"Position")}constructor(e,r){this.lineNumber=e,this.column=r}with(e=this.lineNumber,r=this.column){return e===this.lineNumber&&r===this.column?this:new t(e,r)}delta(e=0,r=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+r))}equals(e){return t.equals(this,e)}static equals(e,r){return!e&&!r?!0:!!e&&!!r&&e.lineNumber===r.lineNumber&&e.column===r.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,r){return e.lineNumber{"use strict";p();Object.defineProperty(hYe,"__esModule",{value:!0});hYe.Range=void 0;var dEn=$_(),g7t=class t{static{a(this,"Range")}constructor(e,r,n,o){e>n||e===n&&r>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=e,this.endColumn=r):(this.startLineNumber=e,this.startColumn=r,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.columne.endColumn)}static strictContainsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.column<=e.startColumn||r.lineNumber===e.endLineNumber&&r.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumn<=e.startColumn||r.endLineNumber===e.endLineNumber&&r.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,r){let n,o,s,c;return r.startLineNumbere.endLineNumber?(s=r.endLineNumber,c=r.endColumn):r.endLineNumber===e.endLineNumber?(s=r.endLineNumber,c=Math.max(r.endColumn,e.endColumn)):(s=e.endLineNumber,c=e.endColumn),new t(n,o,s,c)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,r){let n=e.startLineNumber,o=e.startColumn,s=e.endLineNumber,c=e.endColumn,l=r.startLineNumber,u=r.startColumn,d=r.endLineNumber,f=r.endColumn;return nd?(s=d,c=f):s===d&&(c=Math.min(c,f)),n>s||n===s&&o>c?null:new t(n,o,s,c)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,r){return!e&&!r?!0:!!e&&!!r&&e.startLineNumber===r.startLineNumber&&e.startColumn===r.startColumn&&e.endLineNumber===r.endLineNumber&&e.endColumn===r.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new dEn.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new dEn.Position(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,r){return new t(this.startLineNumber,this.startColumn,e,r)}setStartPosition(e,r){return new t(e,r,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,r=e){return new t(e.lineNumber,e.column,r.lineNumber,r.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return!!e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,r){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};hYe.Range=g7t});var h_n=I(tQt=>{"use strict";p();Object.defineProperty(tQt,"__esModule",{value:!0});tQt.assertNever=Aqo;function Aqo(t,e=`unexpected value ${t}`){throw new Error(`Unreachable: ${e}`)}a(Aqo,"assertNever")});var Rxe=I(V3=>{"use strict";p();Object.defineProperty(V3,"__esModule",{value:!0});V3.ChatCompletionContentPartOpaque=V3.ChatCompletionContentPartKind=V3.ChatRole=void 0;var yqo=h_n(),jYe;(function(t){t[t.System=0]="System",t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.Tool=3]="Tool"})(jYe||(V3.ChatRole=jYe={}));(function(t){function e(r){switch(r){case t.System:return"system";case t.User:return"user";case t.Assistant:return"assistant";case t.Tool:return"tool";default:(0,yqo.assertNever)(r,`unknown chat role ${r}}`)}}a(e,"display"),t.display=e})(jYe||(V3.ChatRole=jYe={}));var m_n;(function(t){t[t.Image=0]="Image",t[t.Text=1]="Text",t[t.Opaque=2]="Opaque",t[t.CacheBreakpoint=3]="CacheBreakpoint",t[t.Document=4]="Document"})(m_n||(V3.ChatCompletionContentPartKind=m_n={}));var g_n;(function(t){function e(r,n){return!r.scope||(r.scope&n)!==0}a(e,"usableIn"),t.usableIn=e})(g_n||(V3.ChatCompletionContentPartOpaque=g_n={}))});var rQt=I(TO=>{"use strict";p();Object.defineProperty(TO,"__esModule",{value:!0});TO.BaseTokensPerName=TO.BaseTokensPerMessage=TO.BaseTokensPerCompletion=TO.ChatRole=void 0;var A_n;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(A_n||(TO.ChatRole=A_n={}));TO.BaseTokensPerCompletion=3;TO.BaseTokensPerMessage=3;TO.BaseTokensPerName=1});var v_n=I(GYe=>{"use strict";p();Object.defineProperty(GYe,"__esModule",{value:!0});GYe.toOpenAiChatMessage=__n;GYe.toOpenAIChatMessages=_qo;var IO=Rxe(),HYe=rQt(),Eqo=Eq();function y_n(t){return t.filter(e=>e.type===IO.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(y_n,"onlyStringContent");function E_n(t){let e=t.map(r=>{if(r.type===IO.ChatCompletionContentPartKind.Text)return{type:"text",text:r.text};if(r.type===IO.ChatCompletionContentPartKind.Image)return{image_url:r.imageUrl,type:"image_url"};if(r.type===IO.ChatCompletionContentPartKind.Document)return;if(r.type===IO.ChatCompletionContentPartKind.Opaque&&IO.ChatCompletionContentPartOpaque.usableIn(r,Eqo.OutputMode.OpenAI))return r.value}).filter(r=>!!r);return e.every(r=>r.type==="text")?e.map(r=>r.text).join(""):e}a(E_n,"stringAndImageContent");function __n(t){switch(t.role){case IO.ChatRole.System:return{role:HYe.ChatRole.System,content:y_n(t.content),name:t.name};case IO.ChatRole.User:return{role:HYe.ChatRole.User,content:E_n(t.content),name:t.name};case IO.ChatRole.Assistant:return{role:HYe.ChatRole.Assistant,content:y_n(t.content),name:t.name,tool_calls:t.toolCalls?.map(e=>({id:e.id,function:e.function,type:"function"}))};case IO.ChatRole.Tool:return{role:HYe.ChatRole.Tool,content:E_n(t.content),tool_call_id:t.toolCallId};default:return}}a(__n,"toOpenAiChatMessage");function _qo(t){return t.map(__n).filter(e=>!!e)}a(_qo,"toOpenAIChatMessages")});var b_n=I(WYe=>{"use strict";p();Object.defineProperty(WYe,"__esModule",{value:!0});WYe.toVsCodeChatMessage=C_n;WYe.toVsCodeChatMessages=vqo;var VYe=Rxe();function $Ye(t){return t.filter(e=>e.type===VYe.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a($Ye,"onlyStringContent");var _q;function C_n(t){switch(_q??=require("vscode"),t.role){case VYe.ChatRole.Assistant:let e=_q.LanguageModelChatMessage.Assistant($Ye(t.content),t.name);return t.toolCalls&&(e.content=[new _q.LanguageModelTextPart($Ye(t.content)),...t.toolCalls.map(r=>{let n;try{n=JSON.parse(r.function.arguments)}catch{throw new Error("Invalid JSON in tool call arguments for tool call: "+r.id)}return new _q.LanguageModelToolCallPart(r.id,r.function.name,n)})]),e;case VYe.ChatRole.User:return _q.LanguageModelChatMessage.User($Ye(t.content),t.name);case VYe.ChatRole.Tool:{let r=_q.LanguageModelChatMessage.User("");return r.content=[new _q.LanguageModelToolResultPart(t.toolCallId,[new _q.LanguageModelTextPart($Ye(t.content))])],r}default:return}}a(C_n,"toVsCodeChatMessage");function vqo(t){return t.map(C_n).filter(e=>!!e)}a(vqo,"toVsCodeChatMessages")});var Eq=I(WP=>{"use strict";p();Object.defineProperty(WP,"__esModule",{value:!0});WP.OutputMode=WP.Raw=WP.OpenAI=void 0;WP.toMode=nQt;WP.toVSCode=Cqo;WP.toOpenAI=bqo;var S_n=v_n(),T_n=b_n();WP.OpenAI=rQt();WP.Raw=Rxe();var LK;(function(t){t[t.Raw=1]="Raw",t[t.OpenAI=2]="OpenAI",t[t.VSCode=4]="VSCode"})(LK||(WP.OutputMode=LK={}));function nQt(t,e){switch(t){case LK.Raw:return e;case LK.VSCode:return e instanceof Array?(0,T_n.toVsCodeChatMessages)(e):(0,T_n.toVsCodeChatMessage)(e);case LK.OpenAI:return e instanceof Array?(0,S_n.toOpenAIChatMessages)(e):(0,S_n.toOpenAiChatMessage)(e);default:throw new Error(`Unknown output mode: ${t}`)}}a(nQt,"toMode");function Cqo(t){return nQt(LK.VSCode,t)}a(Cqo,"toVSCode");function bqo(t){return nQt(LK.OpenAI,t)}a(bqo,"toOpenAI")});var iQt=I(kxe=>{"use strict";p();Object.defineProperty(kxe,"__esModule",{value:!0});kxe.jsonRetainedProps=void 0;kxe.forEachNode=I_n;kxe.jsonRetainedProps=Object.keys({flexBasis:1,flexGrow:1,flexReserve:1,passPriority:1,priority:1});function I_n(t,e){if(e(t),t.type===1)for(let r of t.children)I_n(r,e)}a(I_n,"forEachNode")});var x_n=I(oQt=>{"use strict";p();Object.defineProperty(oQt,"__esModule",{value:!0});oQt.once=Sqo;function Sqo(t){let e,r=!1,n=a(((...o)=>(r||(e=t(...o),r=!0),e)),"wrappedFunction");return n.clear=()=>{r=!1},n}a(Sqo,"once")});var lQt=I(yg=>{"use strict";p();Object.defineProperty(yg,"__esModule",{value:!0});yg.BudgetExceededError=yg.MaterializedChatMessageDocument=yg.MaterializedChatMessageImage=yg.MaterializedChatMessageBreakpoint=yg.MaterializedChatMessageOpaque=yg.MaterializedChatMessage=yg.MaterializedChatMessageTextChunk=yg.GenericMaterializedContainer=void 0;var BK=x_n(),DA=Eq(),W3=class t{static{a(this,"GenericMaterializedContainer")}parent;id;name;priority;metadata;flags;children;keepWithId;constructor(e,r,n,o,s,c,l){if(this.parent=e,this.id=r,this.name=n,this.priority=o,this.metadata=c,this.flags=l,this.children=s(this),l&8){if(this.children.length!==2)throw new Error("Invalid number of children for EmptyAlternate flag");let[u,d]=this.children;d.isEmpty?this.children=[u]:this.children=[d]}}has(e){return!!(this.flags&e)}async tokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{let o=Cq(n)?await n.tokenCount(e):await n.upperBoundTokenCount(e);r+=o})),r}async upperBoundTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{let o=await n.upperBoundTokenCount(e);r+=o})),r}replaceNode(e,r){return L_n(e,this.children,r)}allMetadata(){return O_n(this)}findById(e){return cQt(e,this)}get isEmpty(){return!this.children.some(e=>!e.isEmpty)}onChunksChange(){this.parent?.onChunksChange()}*toChatMessages(){for(let e of this.children)Tqo(e),e instanceof t?yield*e.toChatMessages():!e.isEmpty&&e instanceof YP&&(yield e.toChatMessage())}async baseMessageTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{if(n instanceof YP||n instanceof t){let o=await n.baseMessageTokenCount(e);r+=o}})),r}removeLowestPriorityChild(){let e=[];return aQt(this,e),e}};yg.GenericMaterializedContainer=W3;var Pxe=class{static{a(this,"MaterializedChatMessageTextChunk")}parent;text;priority;metadata;lineBreakBefore;constructor(e,r,n,o=[],s){this.parent=e,this.text=r,this.priority=n,this.metadata=o,this.lineBreakBefore=s}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,BK.once)(async e=>await e.tokenLength({type:DA.Raw.ChatCompletionContentPartKind.Text,text:this.text})+(this.lineBreakBefore!==0?1:0));get isEmpty(){return!/\S/.test(this.text)}};yg.MaterializedChatMessageTextChunk=Pxe;var YP=class{static{a(this,"MaterializedChatMessage")}parent;id;role;name;toolCalls;toolCallId;priority;metadata;children;constructor(e,r,n,o,s,c,l,u,d){this.parent=e,this.id=r,this.role=n,this.name=o,this.toolCalls=s,this.toolCallId=c,this.priority=l,this.metadata=u,this.children=d(this)}async tokenCount(e){return this._tokenCount(e)}async upperBoundTokenCount(e){return this._upperBound(e)}get text(){return this._text()}get isEmpty(){return!this.toolCalls?.length&&!this.children.some(e=>!e.isEmpty)}replaceNode(e,r){let n=L_n(e,this.children,r);return n&&this.onChunksChange(),n}removeLowestPriorityChild(){let e=[];return aQt(this,e),e}onChunksChange(){this._tokenCount.clear(),this._upperBound.clear(),this._text.clear(),this.parent?.onChunksChange()}findById(e){return cQt(e,this)}_tokenCount=(0,BK.once)(async e=>{let r=this.toChatMessage();return e.countMessageTokens((0,DA.toMode)(e.mode,r))});_upperBound=(0,BK.once)(async e=>{let r=await this.baseMessageTokenCount(e);return await Promise.all(this.children.map(async n=>{let o=await n.upperBoundTokenCount(e);r+=o})),r});baseMessageTokenCount=(0,BK.once)(e=>{let r=this.toChatMessage();return r.content=r.content.map(n=>n.type===DA.Raw.ChatCompletionContentPartKind.Text?{...n,text:""}:n.type===DA.Raw.ChatCompletionContentPartKind.Image||n.type===DA.Raw.ChatCompletionContentPartKind.Document?void 0:n).filter(n=>!!n),e.countMessageTokens((0,DA.toMode)(e.mode,r))});_text=(0,BK.once)(()=>{let e=[];for(let{content:r,isTextSibling:n}of N_n(this)){if(r instanceof FK||r instanceof UK||r instanceof vq){e.push(r);continue}if(r instanceof zP){e.at(-1)instanceof zP?e[e.length-1]=r:e.push(r);continue}if(r.lineBreakBefore===1||r.lineBreakBefore===2&&!n){let o=e[e.length-1];typeof o=="string"&&o&&!o.endsWith(` `)&&(e[e.length-1]=o+` -`)}typeof e[e.length-1]=="string"?e[e.length-1]+=r.text:e.push(r.text)}return e});toChatMessage(){let e=this.text.map(r=>{if(typeof r=="string")return{type:RA.Raw.ChatCompletionContentPartKind.Text,text:r};if(r instanceof wK)return{type:RA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:aEn(r.src),detail:r.detail,...r.mimeType?{mediaType:r.mimeType}:{}}};if(r instanceof RK)return{type:RA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:r.data,mediaType:r.mediaType}};if(r instanceof cq)return{type:RA.Raw.ChatCompletionContentPartKind.Opaque,value:r.value};if(r instanceof UP)return r.part;throw new Error("Unexpected element type")});if(this.role===RA.Raw.ChatRole.System)return{role:this.role,content:e,...this.name?{name:this.name}:{}};if(this.role===RA.Raw.ChatRole.Assistant){let r={role:this.role,content:e};return this.name&&(r.name=this.name),this.toolCalls?.length&&(r.toolCalls=this.toolCalls.map(n=>({function:n.function,id:n.id,type:n.type}))),r}else return this.role===RA.Raw.ChatRole.User?{role:this.role,content:e,...this.name?{name:this.name}:{}}:this.role===RA.Raw.ChatRole.Tool?{role:this.role,content:e,toolCallId:this.toolCallId}:{role:this.role,content:e,name:this.name}}};hg.MaterializedChatMessage=QP;var cq=class{static{a(this,"MaterializedChatMessageOpaque")}parent;part;priority;metadata=[];get value(){return this.part.value}constructor(e,r,n=Number.MAX_SAFE_INTEGER){this.parent=e,this.part=r,this.priority=n}upperBoundTokenCount(e){return this.part.tokenUsage&&RA.Raw.ChatCompletionContentPartOpaque.usableIn(this.part,e.mode)?this.part.tokenUsage:0}isEmpty=!1};hg.MaterializedChatMessageOpaque=cq;var UP=class{static{a(this,"MaterializedChatMessageBreakpoint")}parent;part;metadata=[];priority=Number.MAX_SAFE_INTEGER;constructor(e,r){this.parent=e,this.part=r}upperBoundTokenCount(e){return 0}isEmpty=!1};hg.MaterializedChatMessageBreakpoint=UP;var wK=class{static{a(this,"MaterializedChatMessageImage")}parent;id;src;priority;metadata;lineBreakBefore;detail;mimeType;constructor(e,r,n,o,s=[],c,l,u){this.parent=e,this.id=r,this.src=n,this.priority=o,this.metadata=s,this.lineBreakBefore=c,this.detail=l,this.mimeType=u}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,xK.once)(async e=>e.tokenLength({type:RA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:aEn(this.src),detail:this.detail,mediaType:this.mimeType}}));isEmpty=!1};hg.MaterializedChatMessageImage=wK;var RK=class{static{a(this,"MaterializedChatMessageDocument")}parent;id;data;mediaType;priority;metadata;lineBreakBefore;constructor(e,r,n,o,s,c=[],l){this.parent=e,this.id=r,this.data=n,this.mediaType=o,this.priority=s,this.metadata=c,this.lineBreakBefore=l}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,xK.once)(async e=>e.tokenLength({type:RA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:this.data,mediaType:this.mediaType}}));isEmpty=!1};hg.MaterializedChatMessageDocument=RK;function lq(t){return t instanceof U3||t instanceof QP}a(lq,"isContainerType");function rEn(t){return t instanceof dxe||t instanceof wK||t instanceof RK||t instanceof cq||t instanceof UP}a(rEn,"isContentType");function _7o(t){if(!lq(t))throw new Error(`Cannot have a text node outside a ChatMessage. Text: "${t.text}"`)}a(_7o,"assertContainerOrChatMessage");function*nEn(t,e=!1){for(let r of t.children)r instanceof dxe?(yield{content:r,isTextSibling:e},e=!0):r instanceof wK||r instanceof RK||r instanceof cq||r instanceof UP?yield{content:r,isTextSibling:!1}:r instanceof cq?yield{content:r,isTextSibling:!0}:(r&&(yield*nEn(r,e)),e=!1)}a(nEn,"contentChunks");function v7o(t,e){let r;function n(o,s){if(rEn(o))(!r||o.priorityn instanceof UP):t instanceof U3&&(r=t.children.some(iEn)),Zyn.set(t,r),r}a(iEn,"hasCachePoint");function C7o(t){if(t instanceof QP)return!0;for(let e=t.parent;e;e=e.parent)if(e instanceof QP)return!1;return!0}a(C7o,"shouldLookForCachePointInNode");function m7t(t,e){let r;if(t instanceof U3&&t.has(1)){v7o(t,e);return}let n=C7o(t),o=t.children.map((s,c)=>({chain:[t],index:c}));for(let s=0;s({chain:d,index:h})))}else if(!r||u.priorityo instanceof QP?o.role:o.name||"(anonymous)");super(`No lowest priority node found (path: ${n.join(" -> ")})`)}};hg.BudgetExceededError=_Ye;function Xyn(t){if(!lq(t))return-1;let e=Number.MAX_SAFE_INTEGER;for(let r of t.children)e=Math.min(e,r.priority);return e}a(Xyn,"getLowestPriorityAmongChildren");function*oEn(t){yield*t.metadata;for(let e of t.children)lq(e)?yield*oEn(e):yield*e.metadata}a(oEn,"allMetadata");function sEn(t,e,r){for(let n=0;n0;){let r=e.pop();yield r,lq(r)&&e.push(...r.children)}}a(eEn,"forEachNode");function b7o(t){let e=t;for(;e.parent;)e=e.parent;return e}a(b7o,"getRoot");function tEn(t){return t instanceof U3&&t.keepWithId!==void 0}a(tEn,"isKeepWith");var h7t=new Set;function S7o(t,e){let r=new Set;for(let n of eEn(t))tEn(n)&&!h7t.has(n.keepWithId)&&r.add(n.keepWithId);if(r.size===0)return!1;for(let n of r)h7t.add(n);try{let n=b7o(t);for(let o of eEn(n))tEn(o)&&r.has(o.keepWithId)?fxe(o,e):o instanceof QP&&o.toolCalls&&(o.toolCalls=T7o(o.toolCalls,s=>!(s.keepWith&&r.has(s.keepWith.id))),o.isEmpty&&fxe(o,e))}finally{for(let n of r)h7t.delete(n)}}a(S7o,"removeOtherKeepWiths");function g7t(t,e){if(e.id===t)return e;for(let r of e.children)if(lq(r)){let n=g7t(t,r);if(n)return n}}a(g7t,"findNodeById");function fxe(t,e){let r=t.parent;if(!r)return;let n=r.children.indexOf(t);n!==-1&&(r.children.splice(n,1),e.push(t),S7o(t,e),r.isEmpty?fxe(r,e):r.onChunksChange())}a(fxe,"removeNode");function aEn(t){let e={"/9j/":"image/jpeg",iVBOR:"image/png",R0lGOD:"image/gif",UklGR:"image/webp"};for(let r of Object.keys(e))if(t.startsWith(r))return`data:${e[r]};base64,${t}`;return t}a(aEn,"getEncodedBase64");function T7o(t,e){for(let r=0;r{"use strict";p();function I7o(t,e,...r){return{ctor:t,props:e,children:r.flat()}}a(I7o,"_vscpp");function cEn(){throw new Error("This should not be invoked!")}a(cEn,"_vscppf");cEn.isFragment=!0;globalThis.vscpp=I7o;globalThis.vscppf=cEn});var E7t=I(vYe=>{"use strict";p();Object.defineProperty(vYe,"__esModule",{value:!0});vYe.PromptElement=void 0;lEn();var y7t=class{static{a(this,"PromptElement")}props;get priority(){return this.props.priority??Number.MAX_SAFE_INTEGER}get insertLineBreakBefore(){return!0}constructor(e){this.props=e}};vYe.PromptElement=y7t});var k7t=I(Qs=>{"use strict";p();Object.defineProperty(Qs,"__esModule",{value:!0});Qs.LogicalWrapper=Qs.IfEmpty=Qs.AbstractKeepWith=Qs.TokenLimit=Qs.Expandable=Qs.Chunk=Qs.LegacyPrioritization=Qs.ToolResult=Qs.PrioritizedList=Qs.Document=Qs.Image=Qs.TextChunk=Qs.ToolMessage=Qs.AssistantMessage=Qs.UserMessage=Qs.SystemMessage=Qs.BaseChatMessage=void 0;Qs.isChatMessagePromptElement=x7o;Qs.useKeepWith=P7o;var hxe=Io(),$S=E7t();function x7o(t){return t instanceof CYe||t instanceof bYe||t instanceof SYe}a(x7o,"isChatMessagePromptElement");var kK=class extends $S.PromptElement{static{a(this,"BaseChatMessage")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.BaseChatMessage=kK;var CYe=class extends kK{static{a(this,"SystemMessage")}constructor(e){e.role=hxe.Raw.ChatRole.System,super(e)}};Qs.SystemMessage=CYe;var bYe=class extends kK{static{a(this,"UserMessage")}constructor(e){e.role=hxe.Raw.ChatRole.User,super(e)}};Qs.UserMessage=bYe;var SYe=class extends kK{static{a(this,"AssistantMessage")}constructor(e){e.role=hxe.Raw.ChatRole.Assistant,super(e)}};Qs.AssistantMessage=SYe;var w7o=/\s+/g,_7t=class extends kK{static{a(this,"ToolMessage")}constructor(e){e.role=hxe.Raw.ChatRole.Tool,super(e)}};Qs.ToolMessage=_7t;var TYe=class extends $S.PromptElement{static{a(this,"TextChunk")}async prepare(e,r,n){let o=this.props.breakOnWhitespace?w7o:this.props.breakOn;if(!o)return vscpp(vscppf,null,this.props.children);let s="",c=[];for(let u of this.props.children||[])if(u&&typeof u=="object"){if(typeof u.ctor!="string")throw new Error("TextChunk children must be text literals or intrinsic attributes.");u.ctor==="br"?s+=` -`:c.push(u)}else u!=null&&(s+=u);let l=await R7o(e,o,s,n);return vscpp(vscppf,null,c,l)}render(e){return e}};Qs.TextChunk=TYe;async function R7o(t,e,r,n){if(e instanceof RegExp){if(!e.global)throw new Error(`\`breakOn\` expression must have the global flag set (got ${e})`);e.lastIndex=0}let o="",s=-1;for(;st.tokenBudget)return o;o=l,s=c}return o}a(R7o,"getTextContentBelowBudget");var v7t=class extends $S.PromptElement{static{a(this,"Image")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Qs.Image=v7t;var C7t=class extends $S.PromptElement{static{a(this,"Document")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Qs.Document=C7t;var b7t=class extends $S.PromptElement{static{a(this,"PrioritizedList")}render(){let{children:e,priority:r=0,descending:n}=this.props;if(e)return vscpp(vscppf,null,e.map((o,s)=>{if(!o)return;let c=n?r-s:r-e.length+s;return typeof o!="object"?vscpp(TYe,{priority:c},o):(o.props??={},o.props.priority=c,o)}))}};Qs.PrioritizedList=b7t;var S7t=class extends $S.PromptElement{static{a(this,"ToolResult")}render(){return vscpp(vscppf,null,this.props.data.content.map(e=>{if(e&&typeof e.value=="string")return e.value;if(e&&e.value&&typeof e.value.node=="object")return vscpp("elementJSON",{data:e.value})}))}};Qs.ToolResult=S7t;var T7t=class extends $S.PromptElement{static{a(this,"LegacyPrioritization")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.LegacyPrioritization=T7t;var I7t=class extends $S.PromptElement{static{a(this,"Chunk")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.Chunk=I7t;var x7t=class extends $S.PromptElement{static{a(this,"Expandable")}async render(e,r){return vscpp(vscppf,null,await this.props.value(r))}};Qs.Expandable=x7t;var w7t=class extends $S.PromptElement{static{a(this,"TokenLimit")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.TokenLimit=w7t;var IYe=class extends $S.PromptElement{static{a(this,"AbstractKeepWith")}};Qs.AbstractKeepWith=IYe;var k7o=0;function P7o(){let t=k7o++;return class extends IYe{static{a(this,"KeepWith")}static id=t;id=t;render(){return vscpp(vscppf,null,this.props.children)}}}a(P7o,"useKeepWith");var R7t=class extends $S.PromptElement{static{a(this,"IfEmpty")}render(){return vscpp(vscppf,null,vscpp(pxe,null,this.props.alt),vscpp(pxe,{flexGrow:1},this.props.children))}};Qs.IfEmpty=R7t;var pxe=class extends $S.PromptElement{static{a(this,"LogicalWrapper")}render(){return vscpp(vscppf,null,this.props.children)}};Qs.LogicalWrapper=pxe});var dEn=I(mxe=>{"use strict";p();Object.defineProperty(mxe,"__esModule",{value:!0});mxe.localize=D7o;mxe.localize2=N7o;mxe.getConfiguredDefaultLocale=M7o;function uEn(t,e){let r;return e.length===0?r=t:r=t.replace(/\{(\d+)\}/g,function(n,o){let s=o[0];return typeof e[s]<"u"?e[s]:n}),r}a(uEn,"_format");function D7o(t,e,...r){return uEn(e,r)}a(D7o,"localize");function N7o(t,e,...r){let n=uEn(e,r);return{original:n,value:n}}a(N7o,"localize2");function M7o(t){}a(M7o,"getConfiguredDefaultLocale")});var M7t=I(Sr=>{"use strict";p();Object.defineProperty(Sr,"__esModule",{value:!0});Sr.isAndroid=Sr.isEdge=Sr.isSafari=Sr.isFirefox=Sr.isChrome=Sr.OS=Sr.setTimeout0=Sr.setTimeout0IsFaster=Sr.translationsConfigFile=Sr.platformLocale=Sr.locale=Sr.Language=Sr.language=Sr.userAgent=Sr.platform=Sr.isCI=Sr.isMobile=Sr.isIOS=Sr.webWorkerOrigin=Sr.isWebWorker=Sr.isWeb=Sr.isElectron=Sr.isNative=Sr.isLinuxSnap=Sr.isLinux=Sr.isMacintosh=Sr.isWindows=Sr.LANGUAGE_DEFAULT=void 0;Sr.PlatformToString=L7o;Sr.isLittleEndian=B7o;Sr.isBigSurOrNewer=F7o;var fEn=dEn();Sr.LANGUAGE_DEFAULT="en";var yxe=!1,Exe=!1,Axe=!1,gEn=!1,AEn=!1,D7t=!1,yEn=!1,N7t=!1,EEn=!1,_En=!1,gxe,xYe=Sr.LANGUAGE_DEFAULT,P7t=Sr.LANGUAGE_DEFAULT,vEn,Q3,q3=globalThis,VS;typeof q3.vscode<"u"&&typeof q3.vscode.process<"u"?VS=q3.vscode.process:typeof process<"u"&&(VS=process);var CEn=typeof VS?.versions?.electron=="string",O7o=CEn&&VS?.type==="renderer";if(typeof VS=="object"){yxe=VS.platform==="win32",Exe=VS.platform==="darwin",Axe=VS.platform==="linux",gEn=Axe&&!!VS.env.SNAP&&!!VS.env.SNAP_REVISION,yEn=CEn,EEn=!!VS.env.CI||!!VS.env.BUILD_ARTIFACTSTAGINGDIRECTORY,gxe=Sr.LANGUAGE_DEFAULT,xYe=Sr.LANGUAGE_DEFAULT;let t=VS.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t),r=e.availableLanguages["*"];gxe=e.locale,P7t=e.osLocale,xYe=r||Sr.LANGUAGE_DEFAULT,vEn=e._translationsConfigFile}catch{}AEn=!0}else typeof navigator=="object"&&!O7o?(Q3=navigator.userAgent,yxe=Q3.indexOf("Windows")>=0,Exe=Q3.indexOf("Macintosh")>=0,N7t=(Q3.indexOf("Macintosh")>=0||Q3.indexOf("iPad")>=0||Q3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Axe=Q3.indexOf("Linux")>=0,_En=Q3?.indexOf("Mobi")>=0,D7t=!0,gxe=fEn.getConfiguredDefaultLocale(fEn.localize({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"))||Sr.LANGUAGE_DEFAULT,xYe=gxe,P7t=navigator.language):console.error("Unable to resolve platform.");function L7o(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(L7o,"PlatformToString");var wYe=0;Exe?wYe=1:yxe?wYe=3:Axe&&(wYe=2);Sr.isWindows=yxe;Sr.isMacintosh=Exe;Sr.isLinux=Axe;Sr.isLinuxSnap=gEn;Sr.isNative=AEn;Sr.isElectron=yEn;Sr.isWeb=D7t;Sr.isWebWorker=D7t&&typeof q3.importScripts=="function";Sr.webWorkerOrigin=Sr.isWebWorker?q3.origin:void 0;Sr.isIOS=N7t;Sr.isMobile=_En;Sr.isCI=EEn;Sr.platform=wYe;Sr.userAgent=Q3;Sr.language=xYe;var pEn;(function(t){function e(){return Sr.language}a(e,"value"),t.value=e;function r(){return Sr.language.length===2?Sr.language==="en":Sr.language.length>=3?Sr.language[0]==="e"&&Sr.language[1]==="n"&&Sr.language[2]==="-":!1}a(r,"isDefaultVariant"),t.isDefaultVariant=r;function n(){return Sr.language==="en"}a(n,"isDefault"),t.isDefault=n})(pEn||(Sr.Language=pEn={}));Sr.locale=gxe;Sr.platformLocale=P7t;Sr.translationsConfigFile=vEn;Sr.setTimeout0IsFaster=typeof q3.postMessage=="function"&&!q3.importScripts;Sr.setTimeout0=(()=>{if(Sr.setTimeout0IsFaster){let t=[];q3.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),q3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();Sr.OS=Exe||N7t?2:yxe?1:3;var hEn=!0,mEn=!1;function B7o(){if(!mEn){mEn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,hEn=new Uint16Array(t.buffer)[0]===513}return hEn}a(B7o,"isLittleEndian");Sr.isChrome=!!(Sr.userAgent&&Sr.userAgent.indexOf("Chrome")>=0);Sr.isFirefox=!!(Sr.userAgent&&Sr.userAgent.indexOf("Firefox")>=0);Sr.isSafari=!!(!Sr.isChrome&&Sr.userAgent&&Sr.userAgent.indexOf("Safari")>=0);Sr.isEdge=!!(Sr.userAgent&&Sr.userAgent.indexOf("Edg/")>=0);Sr.isAndroid=!!(Sr.userAgent&&Sr.userAgent.indexOf("Android")>=0);function F7o(t){return parseFloat(t)>=20}a(F7o,"isBigSurOrNewer")});var SEn=I(vO=>{"use strict";p();Object.defineProperty(vO,"__esModule",{value:!0});vO.arch=vO.platform=vO.env=vO.cwd=void 0;var bEn=M7t(),PK,O7t=globalThis.vscode;if(typeof O7t<"u"&&typeof O7t.process<"u"){let t=O7t.process;PK={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"?PK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:PK={get platform(){return bEn.isWindows?"win32":bEn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};vO.cwd=PK.cwd;vO.env=PK.env;vO.platform=PK.platform;vO.arch=PK.arch});var IEn=I(An=>{"use strict";p();Object.defineProperty(An,"__esModule",{value:!0});An.delimiter=An.sep=An.toNamespacedPath=An.parse=An.format=An.extname=An.basename=An.dirname=An.relative=An.resolve=An.join=An.isAbsolute=An.normalize=An.posix=An.win32=void 0;var eue=SEn(),U7o=65,Q7o=97,q7o=90,j7o=122,fq=46,mg=47,FC=92,uq=58,H7o=63,RYe=class extends Error{static{a(this,"ErrorInvalidArgType")}code;constructor(e,r,n){let o;typeof r=="string"&&r.indexOf("not ")===0?(o="must not be",r=r.replace(/^not /,"")):o="must be";let s=e.indexOf(".")!==-1?"property":"argument",c=`The "${e}" ${s} ${o} of type ${r}`;c+=`. Received type ${typeof n}`,super(c),this.code="ERR_INVALID_ARG_TYPE"}};function G7o(t,e){if(t===null||typeof t!="object")throw new RYe(e,"Object",t)}a(G7o,"validateObject");function ip(t,e){if(typeof t!="string")throw new RYe(e,"string",t)}a(ip,"validateString");var UC=eue.platform==="win32";function ns(t){return t===mg||t===FC}a(ns,"isPathSeparator");function L7t(t){return t===mg}a(L7t,"isPosixPathSeparator");function dq(t){return t>=U7o&&t<=q7o||t>=Q7o&&t<=j7o}a(dq,"isWindowsDeviceRoot");function kYe(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===fq&&l!==-1?++l:l=-1}return o}a(kYe,"normalizeString");function TEn(t,e){G7o(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${e.ext||""}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(TEn,"_format");An.win32={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],ip(s,"path"),s.length===0)continue}else e.length===0?s=eue.cwd():(s=eue.env[`=${e}`]||eue.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===FC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)ns(f)&&(l=1,d=!0);else if(ns(f))if(d=!0,ns(s.charCodeAt(1))){let h=2,m=h;for(;h2&&ns(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=kYe(r,!n,"\\",ns),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){ip(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return L7t(s)?"\\":t;if(ns(s))if(o=!0,ns(t.charCodeAt(1))){let l=2,u=l;for(;l2&&ns(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&ns(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){ip(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return ns(r)||e>2&&dq(r)&&t.charCodeAt(1)===uq&&ns(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&ns(r.charCodeAt(0))){++o;let s=r.length;s>1&&ns(r.charCodeAt(1))&&(++o,s>2&&(ns(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return An.win32.normalize(e)},relative(t,e){if(ip(t,"from"),ip(e,"to"),t===e)return"";let r=An.win32.resolve(t),n=An.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===FC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===FC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===FC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===FC?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===FC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===FC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=An.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===FC){if(e.charCodeAt(1)===FC){let r=e.charCodeAt(2);if(r!==H7o&&r!==fq)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(dq(e.charCodeAt(0))&&e.charCodeAt(1)===uq&&e.charCodeAt(2)===FC)return`\\\\?\\${e}`;return t},dirname(t){ip(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return ns(o)?t:".";if(ns(o)){if(r=n=1,ns(t.charCodeAt(1))){let l=2,u=l;for(;l2&&ns(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(ns(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&ip(e,"ext"),ip(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&dq(t.charCodeAt(0))&&t.charCodeAt(1)===uq&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(ns(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(ns(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){ip(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===uq&&dq(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(ns(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===fq?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:TEn.bind(null,"\\"),parse(t){ip(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return ns(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(ns(o)){if(n=1,ns(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),ns(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===fq?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null};var $7o=(()=>{if(UC){let t=/\\/g;return()=>{let e=eue.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>eue.cwd()})();An.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:$7o();ip(o,"path"),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===mg)}return e=kYe(e,!r,"/",L7t),r?`/${e}`:e.length>0?e:"."},normalize(t){if(ip(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===mg,r=t.charCodeAt(t.length-1)===mg;return t=kYe(t,!e,"/",L7t),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return ip(t,"path"),t.length>0&&t.charCodeAt(0)===mg},join(...t){if(t.length===0)return".";let e;for(let r=0;r0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":An.posix.normalize(e)},relative(t,e){if(ip(t,"from"),ip(e,"to"),t===e||(t=An.posix.resolve(t),e=An.posix.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===mg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===mg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===mg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(ip(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===mg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===mg){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&ip(e,"ext"),ip(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===mg){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===mg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){ip(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t.charCodeAt(c);if(l===mg){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===fq?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:TEn.bind(null,"/"),parse(t){ip(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===mg,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===mg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===fq?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};An.posix.win32=An.win32.win32=An.win32;An.posix.posix=An.win32.posix=An.posix;An.normalize=UC?An.win32.normalize:An.posix.normalize;An.isAbsolute=UC?An.win32.isAbsolute:An.posix.isAbsolute;An.join=UC?An.win32.join:An.posix.join;An.resolve=UC?An.win32.resolve:An.posix.resolve;An.relative=UC?An.win32.relative:An.posix.relative;An.dirname=UC?An.win32.dirname:An.posix.dirname;An.basename=UC?An.win32.basename:An.posix.basename;An.extname=UC?An.win32.extname:An.posix.extname;An.format=UC?An.win32.format:An.posix.format;An.parse=UC?An.win32.parse:An.posix.parse;An.toNamespacedPath=UC?An.win32.toNamespacedPath:An.posix.toNamespacedPath;An.sep=UC?An.win32.sep:An.posix.sep;An.delimiter=UC?An.win32.delimiter:An.posix.delimiter});var NEn=I(tue=>{"use strict";p();Object.defineProperty(tue,"__esModule",{value:!0});tue.URI=void 0;tue.isUriComponents=X7o;tue.uriToFsPath=MYe;var xEn=IEn(),DYe=M7t(),V7o=/^\w[\w\d+.-]*$/,W7o=/^\//,z7o=/^\/\//;function Y7o(t,e){if(!t.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t.authority}", path: "${t.path}", query: "${t.query}", fragment: "${t.fragment}"}`);if(t.scheme&&!V7o.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!W7o.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(z7o.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(Y7o,"_validateUri");function K7o(t,e){return!t&&!e?"file":t}a(K7o,"_schemeFix");function J7o(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==qP&&(e=qP+e):e=qP;break}return e}a(J7o,"_referenceResolution");var Hl="",qP="/",Z7o=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,NYe=class t{static{a(this,"URI")}static isUri(e){return e instanceof t?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}scheme;authority;path;query;fragment;constructor(e,r,n,o,s,c=!1){typeof e=="object"?(this.scheme=e.scheme||Hl,this.authority=e.authority||Hl,this.path=e.path||Hl,this.query=e.query||Hl,this.fragment=e.fragment||Hl):(this.scheme=K7o(e,c),this.authority=r||Hl,this.path=J7o(this.scheme,n||Hl),this.query=o||Hl,this.fragment=s||Hl,Y7o(this,c))}get fsPath(){return MYe(this,!1)}with(e){if(!e)return this;let{scheme:r,authority:n,path:o,query:s,fragment:c}=e;return r===void 0?r=this.scheme:r===null&&(r=Hl),n===void 0?n=this.authority:n===null&&(n=Hl),o===void 0?o=this.path:o===null&&(o=Hl),s===void 0?s=this.query:s===null&&(s=Hl),c===void 0?c=this.fragment:c===null&&(c=Hl),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new pq(r,n,o,s,c)}static parse(e,r=!1){let n=Z7o.exec(e);return n?new pq(n[2]||Hl,PYe(n[4]||Hl),PYe(n[5]||Hl),PYe(n[7]||Hl),PYe(n[9]||Hl),r):new pq(Hl,Hl,Hl,Hl,Hl)}static file(e){let r=Hl;if(DYe.isWindows&&(e=e.replace(/\\/g,qP)),e[0]===qP&&e[1]===qP){let n=e.indexOf(qP,2);n===-1?(r=e.substring(2),e=qP):(r=e.substring(2,n),e=e.substring(n)||qP)}return new pq("file",r,e,Hl,Hl)}static from(e,r){return new pq(e.scheme,e.authority,e.path,e.query,e.fragment,r)}static joinPath(e,...r){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let n;return DYe.isWindows&&e.scheme==="file"?n=t.file(xEn.win32.join(MYe(e,!0),...r)).path:n=xEn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return B7t(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new pq(e);return r._formatted=e.external??null,r._fsPath=e._sep===kEn?e.fsPath??null:null,r}}else return e}};tue.URI=NYe;function X7o(t){return!t||typeof t!="object"?!1:typeof t.scheme=="string"&&(typeof t.authority=="string"||typeof t.authority>"u")&&(typeof t.path=="string"||typeof t.path>"u")&&(typeof t.query=="string"||typeof t.query>"u")&&(typeof t.fragment=="string"||typeof t.fragment>"u")}a(X7o,"isUriComponents");var kEn=DYe.isWindows?1:void 0,pq=class extends NYe{static{a(this,"Uri")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=MYe(this,!1)),this._fsPath}toString(e=!1){return e?B7t(this,!0):(this._formatted||(this._formatted=B7t(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=kEn),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},PEn={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function wEn(t,e,r){let n,o=-1;for(let s=0;s=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===45||c===46||c===95||c===126||e&&c===47||r&&c===91||r&&c===93||r&&c===58)o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n!==void 0&&(n+=t.charAt(s));else{n===void 0&&(n=t.substr(0,s));let l=PEn[c];l!==void 0?(o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n+=l):o===-1&&(o=s)}}return o!==-1&&(n+=encodeURIComponent(t.substring(o))),n!==void 0?n:t}a(wEn,"encodeURIComponentFast");function eQo(t){let e;for(let r=0;r1&&t.scheme==="file"?r=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?r=t.path.substr(1):r=t.path[1].toLowerCase()+t.path.substr(2):r=t.path,DYe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(MYe,"uriToFsPath");function B7t(t,e){let r=e?eQo:wEn,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=qP,n+=qP),s){let d=s.indexOf("@");if(d!==-1){let f=s.substr(0,d);s=s.substr(d+1),d=f.lastIndexOf(":"),d===-1?n+=r(f,!1,!1):(n+=r(f.substr(0,d),!1,!1),n+=":",n+=r(f.substr(d+1),!1,!0)),n+="@"}s=s.toLowerCase(),d=s.lastIndexOf(":"),d===-1?n+=r(s,!1,!0):(n+=r(s.substr(0,d),!1,!0),n+=s.substr(d))}if(c){if(c.length>=3&&c.charCodeAt(0)===47&&c.charCodeAt(2)===58){let d=c.charCodeAt(1);d>=65&&d<=90&&(c=`/${String.fromCharCode(d+32)}:${c.substr(3)}`)}else if(c.length>=2&&c.charCodeAt(1)===58){let d=c.charCodeAt(0);d>=65&&d<=90&&(c=`${String.fromCharCode(d+32)}:${c.substr(2)}`)}n+=r(c,!0,!1)}return l&&(n+="?",n+=r(l,!1,!1)),u&&(n+="#",n+=e?u:wEn(u,!1,!1)),n}a(B7t,"_asFormatted");function DEn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+DEn(t.substr(3)):t}}a(DEn,"decodeURIComponentGraceful");var REn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function PYe(t){return t.match(REn)?t.replace(REn,e=>DEn(e)):t}a(PYe,"percentDecode")});var Q7t=I(hq=>{"use strict";p();Object.defineProperty(hq,"__esModule",{value:!0});hq.PromptReference=hq.ChatResponseReferencePartStatusKind=hq.PromptMetadata=void 0;var _xe=NEn(),F7t=class{static{a(this,"PromptMetadata")}_marker;toString(){return Object.getPrototypeOf(this).constructor.name}};hq.PromptMetadata=F7t;var MEn;(function(t){t[t.Complete=1]="Complete",t[t.Partial=2]="Partial",t[t.Omitted=3]="Omitted"})(MEn||(hq.ChatResponseReferencePartStatusKind=MEn={}));var U7t=class t{static{a(this,"PromptReference")}anchor;iconPath;options;static fromJSON(e){let r=a(n=>"scheme"in n?_xe.URI.from(n):{uri:_xe.URI.from(n.uri),range:n.range},"uriOrLocation");return new t("variableName"in e.anchor?{variableName:e.anchor.variableName,value:e.anchor.value&&r(e.anchor.value)}:r(e.anchor),e.iconPath&&("scheme"in e.iconPath?_xe.URI.from(e.iconPath):"light"in e.iconPath?{light:_xe.URI.from(e.iconPath.light),dark:_xe.URI.from(e.iconPath.dark)}:e.iconPath),e.options)}constructor(e,r,n){this.anchor=e,this.iconPath=r,this.options=n}toJSON(){return{anchor:this.anchor,iconPath:this.iconPath,options:this.options}}};hq.PromptReference=U7t});var z7t=I(rue=>{"use strict";p();Object.defineProperty(rue,"__esModule",{value:!0});rue.PromptRenderer=rue.MetadataMap=void 0;var tQo=f7t(),mq=A7t(),NK=sq(),Bd=k7t(),W7t=Q7t(),LYe;(function(t){t.empty={get:a(()=>{},"get"),getAll:a(()=>[],"getAll")},t.from=e=>({get:a(r=>e.find(n=>n instanceof r),"get"),getAll:a(r=>e.filter(n=>n instanceof r),"getAll")})})(LYe||(rue.MetadataMap=LYe={}));var q7t=class{static{a(this,"PromptRenderer")}_endpoint;_ctor;_props;_tokenizer;_usedContext=[];_ignoredFiles=[];_growables=[];_root=new UYe(null,0);_tokenLimits=[];tracer=void 0;constructor(e,r,n,o){this._endpoint=e,this._ctor=r,this._props=n,this._tokenizer=o}getIgnoredFiles(){return Array.from(new Set(this._ignoredFiles))}getUsedContext(){return this._usedContext}createElement(e){return new e.ctor(e.props)}async _processPromptPieces(e,r,n,o){let s=new Map;for(let[u,d]of r.entries()){if(Array.isArray(d.children)&&(d.props=d.props??{},d.props.children=d.children),!d.ctor){let A=FEn(d.path);throw new Error(`Invalid ChatMessage child! Child must be a TSX component that extends PromptElement at ${A}`)}let f=this.createElement(d),h;f instanceof Bd.TokenLimit&&(h=d.props.max,this._tokenLimits.push({limit:h,id:d.node.id})),d.node.setObj(f);let m=d.props.flexGrow??1/0,g=s.get(m);g||(g=[],s.set(m,g)),g.push({element:d,promptElementInstance:f,tokenLimit:h})}if(s.size===0)return;let c=[...s.entries()].sort(([u],[d])=>d-u).map(([u,d])=>d),l=a(u=>{let d=0;for(let f=u+1;f{if(E.tokenLimit===void 0)return!1;let _=E.element.props.flexBasis??1,v=_/h;return Math.floor(e.remainingTokenBudget*v){let v=(E.element.props.flexBasis??1)/h;return{tokenBudget:g[_]?E.tokenLimit:Math.floor((e.remainingTokenBudget-m)*v),endpoint:e.endpoint,countTokens:a((b,T)=>this._tokenizer.tokenLength(typeof b=="string"?{type:NK.Raw.ChatCompletionContentPartKind.Text,text:b}:b,T),"countTokens")}});e.consume(-f),this.tracer?.addRenderEpoch?.({inNode:d[0].element.node.parent?.id,flexValue:d[0].element.props.flexGrow??0,tokenBudget:e.remainingTokenBudget,reservedTokens:f,elements:d.map((E,_)=>({id:E.element.node.id,tokenBudget:A[_].tokenBudget}))}),await Promise.all(d.map(async({element:E,promptElementInstance:_},v)=>{let b=await LEn(E,()=>_.prepare?.(A[v],n,o));E.node.setState(b)}));let y=await Promise.all(d.map(async({element:E,promptElementInstance:_},v)=>{let b=A[v];return await LEn(E,()=>_.render(E.node.getState(),b,n,o))}));for(let[E,{element:_,promptElementInstance:v}]of d.entries()){let b=A[E],T=y[E];if(!T)continue;let w=await this._processPromptRenderPiece(new DK(b.tokenBudget,this._endpoint),_,v,T,n,o);v instanceof Bd.Expandable&&this._growables.push({initialConsume:w,elem:_.node}),e.consume(w)}}}async _processPromptRenderPiece(e,r,n,o,s,c){let l=BEn(o),u=new DK(e.tokenBudget,this._endpoint),{tokensConsumed:d}=await rQo(this._tokenizer,r,n,l);return u.consume(d),await this._handlePromptChildren(r,l,u,s,c),u.consumed}async renderElementJSON(e){return await this._processPromptPieces(new DK(this._endpoint.modelMaxPromptTokens,this._endpoint),[{node:this._root,ctor:this._ctor,props:this._props,children:[],path:[this._ctor]}],void 0,e),{node:this._root.toJSON()}}async render(e,r){let n=await this.renderRaw(e,r);return{...n,messages:(0,NK.toMode)(this._tokenizer.mode,n.messages)}}async renderRaw(e,r){await this._processPromptPieces(new DK(this._endpoint.modelMaxPromptTokens,this._endpoint),[{node:this._root,ctor:this._ctor,props:this._props,children:[],path:[this._ctor]}],e,r);let{container:n,allMetadata:o,removed:s}=await this._getFinalElementTree(this._endpoint.modelMaxPromptTokens,r);this.tracer?.didMaterializeTree?.({budget:this._endpoint.modelMaxPromptTokens,renderedTree:{container:n,removed:s,budget:this._endpoint.modelMaxPromptTokens},tokenizer:this._tokenizer,renderTree:a(m=>this._getFinalElementTree(m,void 0).then(g=>({...g,budget:m})),"renderTree")});let c=[...n.toChatMessages()],l=await n.tokenCount(this._tokenizer),u=[...n.allMetadata()],d=new Set,f=u.map(m=>{if(!(m instanceof CO))return;let g=m.reference,A="variableName"in g.anchor;if(A&&!d.has(g.anchor.variableName))return d.add(g.anchor.variableName),g;if(!A)return g}).filter(QYe),h=o.map(m=>{if(!(m instanceof CO)||u.includes(m))return;let g=m.reference,A="variableName"in g.anchor;if(A&&!d.has(g.anchor.variableName))return d.add(g.anchor.variableName),g;if(!A)return g}).filter(QYe);return{metadata:LYe.from(u),messages:c,hasIgnoredFiles:this._ignoredFiles.length>0,tokenCount:l,references:f,omittedReferences:h}}async _getFinalElementTree(e,r){let n=this._root.materialize(),o=[...n.toChatMessages()],s=[...n.allMetadata()],c=[{limit:e,id:this._root.id},...this._tokenLimits],l=0;for(let u=c.length-1;u>=0;u--){let d=c[u];if(d.limit>e)continue;let f=n.findById(d.id);if(!f)continue;let h=await f.tokenCount(this._tokenizer);if(!(hd.limit;){let g=await f.baseMessageTokenCount(this._tokenizer);do for(let A of f.removeLowestPriorityChild()){l++;let y=A.upperBoundTokenCount(this._tokenizer);m-=(typeof y=="number"?y:await y)*1.25}while(m-g>d.limit);m=await f.tokenCount(this._tokenizer)}}catch(m){throw m instanceof mq.BudgetExceededError&&(m.metadata=LYe.from([...n.allMetadata()]),m.messages=o),m}}return{container:n,allMetadata:s,removed:l}}async _grow(e,r,n,o){if(!this._growables.length)return!1;for(let s of this._growables){if(!e.findById(s.elem.id))continue;let c=s.elem.getObj();if(!(c instanceof Bd.Expandable))throw new Error("unreachable: expected growable");let l=new UYe(null,0,s.elem.id),u=new DK(n-r+s.initialConsume,this._endpoint),d=await this._processPromptRenderPiece(u,{node:l,ctor:this._ctor,props:{},children:[],path:[this._ctor]},c,await c.render(void 0,{tokenBudget:u.tokenBudget,endpoint:this._endpoint,countTokens:a((m,g)=>this._tokenizer.tokenLength(typeof m=="string"?{type:NK.Raw.ChatCompletionContentPartKind.Text,text:m}:m,g),"countTokens")}),void 0,o),f=l.materialize();if(!e.replaceNode(s.elem.id,f))throw new Error("unreachable: could not find old element to replace");if(r-=s.initialConsume,r+=d,r>=n)break}return!0}_handlePromptChildren(e,r,n,o,s){if(e.ctor===Bd.TextChunk){this._handleExtrinsicTextChunkChildren(e.node,e.node,e.props,r);return}let c=[];for(let l of r){if(l.kind==="literal"){e.node.appendStringChild(l.value,e.props.priority??Number.MAX_SAFE_INTEGER);continue}if(l.kind==="intrinsic"){this._handleIntrinsic(e.node,l.name,{priority:e.props.priority??Number.MAX_SAFE_INTEGER,...l.props},BYe(l.children));continue}let u=e.node.createChild();c.push({node:u,ctor:l.ctor,props:l.props,children:l.children,path:[...e.path,l.ctor]})}return this._processPromptPieces(n,c,o,s)}_handleIntrinsic(e,r,n,o,s){switch(r){case"meta":return this._handleIntrinsicMeta(e,n,o);case"br":return this._handleIntrinsicLineBreak(e,n,o,n.priority,s);case"usedContext":return this._handleIntrinsicUsedContext(e,n,o);case"references":return this._handleIntrinsicReferences(e,n,o);case"ignoredFiles":return this._handleIntrinsicIgnoredFiles(e,n,o);case"elementJSON":return this._handleIntrinsicElementJSON(e,n.data);case"cacheBreakpoint":return this._handleIntrinsicCacheBreakpoint(e,n,o,s);case"opaque":return this._handleIntrinsicOpaque(e,n,s)}throw new Error(`Unknown intrinsic element ${r}!`)}_handleIntrinsicCacheBreakpoint(e,r,n,o){if(n.length>0)throw new Error(" must not have children!");e.addCacheBreakpoint(r,o)}_handleIntrinsicMeta(e,r,n){if(n.length>0)throw new Error(" must not have children!");r.local?e.addMetadata(r.value):this._root.addMetadata(r.value)}_handleIntrinsicLineBreak(e,r,n,o,s){if(n.length>0)throw new Error("
must not have children!");e.appendLineBreak(o??Number.MAX_SAFE_INTEGER,s)}_handleIntrinsicOpaque(e,r,n){e.appendOpaque(r.value,r.tokenUsage,r.priority,n)}_handleIntrinsicElementJSON(e,r){let n=e.appendPieceJSON(r.node);if(this.tracer?.includeInEpoch)for(let o of n.elements())this.tracer.includeInEpoch({id:o.id,tokenBudget:0})}_handleIntrinsicUsedContext(e,r,n){if(n.length>0)throw new Error(" must not have children!");this._usedContext.push(...r.value)}_handleIntrinsicReferences(e,r,n){if(n.length>0)throw new Error(" must not have children!");for(let o of r.value)e.addMetadata(new CO(o))}_handleIntrinsicIgnoredFiles(e,r,n){if(n.length>0)throw new Error(" must not have children!");this._ignoredFiles.push(...r.value)}_handleExtrinsicTextChunkChildren(e,r,n,o){let s=[],c=[];for(let l of o){if(l.kind==="extrinsic")throw new Error("TextChunk cannot have extrinsic children!");if(l.kind==="literal"&&s.push(l.value),l.kind==="intrinsic")if(l.name==="br")s.push(` -`);else if(l.name==="references")for(let u of l.props.value)c.push(new CO(u));else this._handleIntrinsic(e,l.name,l.props,BYe(l.children),r.childIndex)}e.appendStringChild(s.join(""),n?.priority??Number.MAX_SAFE_INTEGER,c,r.childIndex,!0)}};rue.PromptRenderer=q7t;async function rQo(t,e,r,n){let o=0;if((0,Bd.isChatMessagePromptElement)(r)){let s={role:e.props.role,content:[],...e.props.name?{name:e.props.name}:void 0,...e.props.toolCalls?{toolCalls:e.props.toolCalls}:void 0,...e.props.toolCallId?{toolCallId:e.props.toolCallId}:void 0};o+=await t.countMessageTokens((0,NK.toMode)(t.mode,s))}for(let s of n)s.kind==="literal"&&(o+=await t.tokenLength({type:NK.Raw.ChatCompletionContentPartKind.Text,text:s.value}));return{tokensConsumed:o}}a(rQo,"computeTokensConsumedByLiterals");function BEn(t,e=[]){return typeof t>"u"||typeof t=="boolean"?[]:(typeof t=="string"||typeof t=="number"?e.push(new G7t(String(t))):nQo(t)?BYe(t.children,e):iQo(t)?BYe(t,e):typeof t.ctor=="string"?e.push(new j7t(t.ctor,t.props,t.children)):e.push(new H7t(t.ctor,t.props,t.children)),e)}a(BEn,"flattenAndReduce");function BYe(t,e=[]){for(let r of t)BEn(r,e);return e}a(BYe,"flattenAndReduceArr");var j7t=class{static{a(this,"IntrinsicPromptPiece")}name;props;children;kind="intrinsic";constructor(e,r,n){this.name=e,this.props=r,this.children=n}},H7t=class{static{a(this,"ExtrinsicPromptPiece")}ctor;props;children;kind="extrinsic";constructor(e,r,n){this.ctor=e,this.props=r,this.children=n}},G7t=class{static{a(this,"LiteralPromptPiece")}value;priority;kind="literal";constructor(e,r){this.value=e,this.priority=r}},FYe=class t{static{a(this,"PromptOpaque")}parent;childIndex;value;tokenUsage;priority;static fromJSON(e,r,n){return new t(e,r,n.value,n.tokenUsage,n.priority)}kind=2;constructor(e,r,n,o,s){this.parent=e,this.childIndex=r,this.value=n,this.tokenUsage=o,this.priority=s}materialize(e){return new mq.MaterializedChatMessageOpaque(e,{type:NK.Raw.ChatCompletionContentPartKind.Opaque,value:this.value,tokenUsage:this.tokenUsage},this.priority)}toJSON(){return{type:3,value:this.value,tokenUsage:this.tokenUsage,priority:this.priority}}},DK=class{static{a(this,"PromptSizingContext")}tokenBudget;endpoint;_consumed=0;constructor(e,r){this.tokenBudget=e,this.endpoint=r}get consumed(){return this._consumed>this.tokenBudget?this.tokenBudget:this._consumed}get remainingTokenBudget(){return Math.max(0,this.tokenBudget-this._consumed)}consume(e){this._consumed+=e}},UYe=class t{static{a(this,"PromptTreeElement")}parent;childIndex;id;static _nextId=0;static fromJSON(e,r,n){let o=new t(null,e);switch(o._metadata=r.references?.map(s=>new CO(W7t.PromptReference.fromJSON(s)))??[],o._children=r.children.map((s,c)=>{switch(s.type){case 1:return t.fromJSON(c,s,n);case 2:return vxe.fromJSON(o,c,s);case 3:return FYe.fromJSON(o,c,s);default:}}).filter(QYe),r.ctor){case 1:o._objFlags=r.flags??0,o._obj=new Bd.BaseChatMessage(r.props);break;case 2:{if(r.keepWithId!==void 0){let s=n.get(r.keepWithId);s||(s=(0,Bd.useKeepWith)(),n.set(r.keepWithId,s)),o._obj=new s(r.props||{})}else o._obj=new Bd.LogicalWrapper(r.props||{});o._objFlags=r.flags??0;break}case 3:o._obj=new Bd.Image(r.props);break;case 4:o._obj=new Bd.Document(r.props);break;default:}return o}kind=1;_obj=null;_state=void 0;_children=[];_metadata=[];_objFlags=0;constructor(e=null,r,n=t._nextId++){this.parent=e,this.childIndex=r,this.id=n}setObj(e){this._obj=e,this._obj instanceof Bd.LegacyPrioritization&&(this._objFlags|=1),this._obj instanceof Bd.Chunk&&(this._objFlags|=2),this._obj instanceof Bd.IfEmpty&&(this._objFlags|=8),this._obj.props.passPriority&&(this._objFlags|=4)}getObj(){return this._obj}setState(e){this._state=e}getState(){return this._state}createChild(){let e=new t(this,this._children.length);return this._children.push(e),e}appendPieceJSON(e){let r=t.fromJSON(this._children.length,e,new Map);return this._children.push(r),r}appendStringChild(e,r,n,o=this._children.length,s=!1){this._children.push(new vxe(this,o,e,r,n,s))}appendLineBreak(e,r=this._children.length){this._children.push(new vxe(this,r,` -`,e))}appendOpaque(e,r,n,o=this._children.length){this._children.push(new FYe(this,o,e,r,n))}toJSON(){let e={type:1,ctor:2,ctorName:this._obj?.constructor.name,children:this._children.slice().sort((r,n)=>r.childIndex-n.childIndex).map(r=>r.toJSON()).filter(QYe),props:{},references:this._metadata.filter(r=>r instanceof CO).map(r=>r.reference.toJSON())};if(this._obj&&(e.props=OYe(this._obj.props,tQo.jsonRetainedProps)),this._obj instanceof Bd.BaseChatMessage)e.ctor=1,Object.assign(e.props,OYe(this._obj.props,["role","name","toolCalls","toolCallId"]));else{if(this._obj instanceof Bd.Image)return{...e,ctor:3,props:{...e.props,...OYe(this._obj.props,["src","detail","mimeType"])}};if(this._obj instanceof Bd.Document)return{...e,ctor:4,props:{...e.props,...OYe(this._obj.props,["data","mediaType"])}};this._obj instanceof Bd.AbstractKeepWith&&(e.keepWithId=this._obj.id)}return this._objFlags!==0&&(e.flags=this._objFlags),e}materialize(e){if(this._children.sort((r,n)=>r.childIndex-n.childIndex),this._obj instanceof Bd.Image)return new mq.MaterializedChatMessageImage(e,this.id,this._obj.props.src,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,0,this._obj.props.detail??void 0,this._obj.props.mimeType??void 0);if(this._obj instanceof Bd.Document)return new mq.MaterializedChatMessageDocument(e,this.id,this._obj.props.data,this._obj.props.mediaType,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,0);if(this._obj instanceof Bd.BaseChatMessage){if(this._obj.props.role===void 0||typeof this._obj.props.role!="number")throw new Error("Invalid ChatMessage!");return new mq.MaterializedChatMessage(e,this.id,this._obj.props.role,this._obj.props.name,this._obj instanceof Bd.AssistantMessage?this._obj.props.toolCalls:void 0,this._obj instanceof Bd.ToolMessage?this._obj.props.toolCallId:void 0,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,r=>this._children.map(n=>n.materialize(r)))}else{let r=new mq.GenericMaterializedContainer(e,this.id,this._obj?.constructor.name,this._obj?.props.priority??(this._obj?.props.passPriority?0:Number.MAX_SAFE_INTEGER),n=>this._children.map(o=>o.materialize(n)),this._metadata,this._objFlags);return this._obj instanceof Bd.AbstractKeepWith&&(r.keepWithId=this._obj.id),r}}addMetadata(e){this._metadata.push(e)}addCacheBreakpoint(e,r=this._children.length){if(!(this._obj instanceof Bd.BaseChatMessage))throw new Error("Cache breakpoints may only be direct children of chat messages");this._children.push(new $7t({type:NK.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e.type},r))}*elements(){yield this;for(let e of this._children)e instanceof t&&(yield*e.elements())}},$7t=class{static{a(this,"PromptCacheBreakpoint")}part;childIndex;constructor(e,r){this.part=e,this.childIndex=r}toJSON(){}materialize(e){return new mq.MaterializedChatMessageBreakpoint(e,this.part)}},vxe=class t{static{a(this,"PromptText")}parent;childIndex;text;priority;metadata;lineBreakBefore;static fromJSON(e,r,n){return new t(e,r,n.text,n.priority,n.references?.map(o=>new CO(W7t.PromptReference.fromJSON(o))),n.lineBreakBefore)}kind=2;constructor(e,r,n,o,s,c=!1){this.parent=e,this.childIndex=r,this.text=n,this.priority=o,this.metadata=s,this.lineBreakBefore=c}materialize(e){let r=this.lineBreakBefore?1:this.childIndex===0?2:0;return new mq.MaterializedChatMessageTextChunk(e,this.text,this.priority??Number.MAX_SAFE_INTEGER,this.metadata||[],r)}toJSON(){return{type:2,priority:this.priority,text:this.text,references:this.metadata?.filter(e=>e instanceof CO).map(e=>e.reference.toJSON()),lineBreakBefore:this.lineBreakBefore}}};function nQo(t){return(typeof t.ctor=="function"&&t.ctor.isFragment)??!1}a(nQo,"isFragmentCtor");function QYe(t){return t!==void 0}a(QYe,"isDefined");var V7t=class extends W7t.PromptMetadata{static{a(this,"InternalMetadata")}},CO=class extends V7t{static{a(this,"ReferenceMetadata")}reference;constructor(e){super(),this.reference=e}};function iQo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(iQo,"isIterable");function OYe(t,e){let r={};for(let n of e)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}a(OYe,"pickProps");function FEn(t){return t.map(e=>typeof e=="string"?e:e?e.name||"":String(e)).join(" > ")}a(FEn,"atPath");var OEn=new WeakSet;async function LEn(t,e){try{return await e()}catch(r){throw r instanceof Error&&!OEn.has(r)&&r.constructor.name!=="CancellationError"&&(OEn.add(r),r.message+=` (at tsx element ${FEn(t.path)})`),r}}a(LEn,"annotateError")});var UEn=I(qYe=>{"use strict";p();Object.defineProperty(qYe,"__esModule",{value:!0});qYe.VSCodeTokenizer=void 0;var Y7t=sq(),K7t=class{static{a(this,"VSCodeTokenizer")}countTokens;mode=Y7t.OutputMode.VSCode;constructor(e,r){if(this.countTokens=e,r!==Y7t.OutputMode.VSCode)throw new Error("`mode` must be set to vscode when using vscode.LanguageModelChat as the tokenizer")}async tokenLength(e,r){return e.type===Y7t.Raw.ChatCompletionContentPartKind.Text?this.countTokens(e.text,r):Promise.resolve(0)}async countMessageTokens(e){return this.countTokens(e)}};qYe.VSCodeTokenizer=K7t});var QEn=I(nue=>{"use strict";p();Object.defineProperty(nue,"__esModule",{value:!0});nue.tracerCss=nue.tracerSrc=void 0;nue.tracerSrc='"use strict";(()=>{var $,m,se,Ue,w,re,le,q,X,G,K,Ae,D={},ce=[],Re=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,J=Array.isArray;function E(t,e){for(var n in e)t[n]=e[n];return t}function ue(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function l(t,e,n){var o,r,_,c={};for(_ in e)_=="key"?o=e[_]:_=="ref"?r=e[_]:c[_]=e[_];if(arguments.length>2&&(c.children=arguments.length>3?$.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(_ in t.defaultProps)c[_]===void 0&&(c[_]=t.defaultProps[_]);return R(t,c,o,r,null)}function R(t,e,n,o,r){var _={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:r??++se,__i:-1,__u:0};return r==null&&m.vnode!=null&&m.vnode(_),_}function N(t){return t.children}function B(t,e){this.props=t,this.context=e}function I(t,e){if(e==null)return t.__?I(t.__,t.__i+1):null;for(var n;ee&&w.sort(q));O.__r=0}function pe(t,e,n,o,r,_,c,a,u,s,p){var i,f,d,b,x,C=o&&o.__k||ce,h=e.length;for(n.__d=u,Be(n,e,C),u=n.__d,i=0;i0?R(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r).__=t,r.__b=t.__b+1,_=null,(a=r.__i=Oe(r,n,c,p))!==-1&&(p--,(_=n[a])&&(_.__u|=131072)),_==null||_.__v===null?(a==-1&&i--,typeof r.type!="function"&&(r.__u|=65536)):a!==c&&(a==c-1?i--:a==c+1?i++:(a>c?i--:i++,r.__u|=65536))):r=t.__k[o]=null;if(p)for(o=0;o(u!=null&&(131072&u.__u)==0?1:0))for(;c>=0||a=0){if((u=e[c])&&(131072&u.__u)==0&&r==u.key&&_===u.type)return c;c--}if(a=n.__.length&&n.__.push({}),n.__[t]}function S(t){return V=1,Ve(Ne,t)}function Ve(t,e,n){var o=te(L++,2);if(o.t=t,!o.__c&&(o.__=[n?n(e):Ne(void 0,e),function(a){var u=o.__N?o.__N[0]:o.__[0],s=o.t(u,a);u!==s&&(o.__N=[s,o.__[1]],o.__c.setState({}))}],o.__c=g,!g.u)){var r=function(a,u,s){if(!o.__c.__H)return!0;var p=o.__c.__H.__.filter(function(f){return!!f.__c});if(p.every(function(f){return!f.__N}))return!_||_.call(this,a,u,s);var i=!1;return p.forEach(function(f){if(f.__N){var d=f.__[0];f.__=f.__N,f.__N=void 0,d!==f.__[0]&&(i=!0)}}),!(!i&&o.__c.props===a)&&(!_||_.call(this,a,u,s))};g.u=!0;var _=g.shouldComponentUpdate,c=g.componentWillUpdate;g.componentWillUpdate=function(a,u,s){if(this.__e){var p=_;_=void 0,r(a,u,s),_=p}c&&c.call(this,a,u,s)},g.shouldComponentUpdate=r}return o.__N||o.__}function Se(t,e){var n=te(L++,3);!y.__s&&Ie(n.__H,e)&&(n.__=t,n.i=e,g.__H.__h.push(n))}function we(t){return V=5,je(function(){return{current:t}},[])}function je(t,e){var n=te(L++,7);return Ie(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function qe(){for(var t;t=Ee.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(W),t.__H.__h.forEach(ee),t.__H.__h=[]}catch(e){t.__H.__h=[],y.__e(e,t.__v)}}y.__b=function(t){g=null,be&&be(t)},y.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Te&&Te(t,e)},y.__r=function(t){ye&&ye(t),L=0;var e=(g=t.__c).__H;e&&(Z===g?(e.__h=[],g.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(e.__h.forEach(W),e.__h.forEach(ee),e.__h=[],L=0)),Z=g},y.diffed=function(t){Ce&&Ce(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Ee.push(e)!==1&&ge===y.requestAnimationFrame||((ge=y.requestAnimationFrame)||Ge)(qe)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Z=g=null},y.__c=function(t,e){e.some(function(n){try{n.__h.forEach(W),n.__h=n.__h.filter(function(o){return!o.__||ee(o)})}catch(o){e.some(function(r){r.__h&&(r.__h=[])}),e=[],y.__e(o,n.__v)}}),xe&&xe(t,e)},y.unmount=function(t){ke&&ke(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{W(o)}catch(r){e=r}}),n.__H=void 0,e&&y.__e(e,n.__v))};var Me=typeof requestAnimationFrame=="function";function Ge(t){var e,n=function(){clearTimeout(o),Me&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,100);Me&&(e=requestAnimationFrame(n))}function W(t){var e=g,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),g=e}function ee(t){var e=g;t.__c=t.__(),g=e}function Ie(t,e){return!t||t.length!==e.length||e.some(function(n,o){return n!==t[o]})}function Ne(t,e){return typeof e=="function"?e(t):e}function He(t,e){let n=we(void 0),o=(...r)=>{n.current&&clearTimeout(n.current),n.current=window.setTimeout(()=>{t(...r)},e)};return Se(()=>()=>{n.current&&clearTimeout(n.current)},[]),o}var Ke=new Intl.NumberFormat("en-US"),T=({value:t})=>l(N,null,Ke.format(t));var ne=[{bg:"#c1e7ff",fg:"#000"},{bg:"#abd2ec",fg:"#000"},{bg:"#94bed9",fg:"#000"},{bg:"#7faac6",fg:"#000"},{bg:"#6996b3",fg:"#fff"},{bg:"#5383a1",fg:"#fff"},{bg:"#3d708f",fg:"#fff"},{bg:"#255e7e",fg:"#fff"}],Xe=({scoreBy:t,nodes:e,epoch:n})=>{if(e.length===0)return null;let o=t;if(t.field!=="tokens"){let r=e[0][t.field],_=e[0][t.field];for(let c=1;cr.type===2?l(Je,{scoreBy:o,key:_,node:r}):l(Le,{scoreBy:o,key:_,node:r,epoch:n})))},Fe=({node:t})=>l("div",{className:"node-stats"},"Used Tokens: ",l(T,{value:t.tokens})," / ","Priority:"," ",t.priority===Number.MAX_SAFE_INTEGER?"MAX":l(T,{value:t.priority})),De=({scoreBy:t,node:e,children:n,...o})=>{let r=0;if(t.max!==t.min){let _=(e[t.field]-t.min)/(t.max-t.min);r=Math.round((ne.length-1)*_)}return l("div",{...o,className:`node ${o.className||""}`,style:{backgroundColor:ne[r].bg,color:ne[r].fg}},n)},Je=({scoreBy:t,node:e})=>l(De,{node:e,scoreBy:t,tabIndex:0,className:"node-text"},l(Fe,{node:e}),l("div",{className:"node-content"},e.value)),Le=({scoreBy:t,node:e,epoch:n})=>{let[o,r]=S(!1),_=EPOCHS.findIndex(i=>i.elements.some(f=>f.id===e.id));if(_===void 0)throw new Error(`epoch not found for ${e.id}`);let c=EPOCHS[_],a=EPOCHS.at(n),u=c.elements.find(i=>i.id===e.id).tokenBudget,s=e.type===1?e.name||e.role.slice(0,1).toUpperCase()+e.role.slice(1)+"Message":e.name,p=_===n?"new-in-epoch":n<_?"before-epoch":"";return l(De,{node:e,scoreBy:t,className:p},l(Fe,{node:e}),l("div",{className:"node-content node-toggler",onClick:()=>r(i=>!i)},l("span",null,a?.inNode===e.id?"\\u{1F3C3} ":"",`<${s}>`),l("span",{className:"indicator"},o?"[+]":"[-]")),n===_&&l("div",{className:"node-stats"},"Token Budget: ",l(T,{value:u})),a?.inNode===e.id&&l("div",{className:"node-stats"},"Rendering flexGrow=",a.flexValue,l("br",null),l("br",null),"Splitting"," ",a.reservedTokens?`${a.tokenBudget} - ${a.reservedTokens} (reserved) = `:"",l(T,{value:a.tokenBudget})," tokens among ",a.elements.length," ","elements"),!o&&l(Xe,{nodes:e.children,scoreBy:t,epoch:n}))},Pe=({scoreBy:t,node:e,epoch:n})=>{let o;return t==="tokens"?o={field:"tokens",max:e.tokens,min:0}:o={field:"priority",max:e.priority,min:e.priority},l(Le,{scoreBy:o,node:e,epoch:n})};var ze=({label:t,value:e,onChange:n,min:o,max:r})=>{let _=a=>{n(a.target.valueAsNumber)},c=`number-slider-${Math.random()}`;return l("div",{className:"controls-slider"},l("label",{htmlFor:c},t),l("input",{id:c,type:"range",min:o,max:r,value:e,onInput:_}),l("input",{type:"number",min:o,value:e,onInput:_,onChange:_}))},Qe=({scoreBy:t,onScoreByChange:e})=>{let n=o=>{let r=o.target.value;e(r)};return l("div",{className:"controls-scoreby"},"Visualize by",l("label",null,l("input",{type:"radio",name:"scoreBy",value:"tokens",checked:t==="tokens",onChange:n}),"Tokens"),l("label",null,l("input",{type:"radio",name:"scoreBy",value:"priority",checked:t==="priority",onChange:n}),"Priority"))},Ye=()=>{let[t,e]=S(DEFAULT_TOKENS),[n,o]=S(EPOCHS.length),[r,_]=S(DEFAULT_MODEL),[c,a]=S("tokens"),[u,s]=S("epoch"),p=He(async f=>{if(f===DEFAULT_TOKENS)return DEFAULT_MODEL;let b=await(await fetch(`${SERVER_ADDRESS}regen?n=${f}`)).json();_(b)},100),i=f=>{e(f),p(f),o(EPOCHS.length)};return l("div",{className:"app"},l("div",{className:"controls"},l("div",{className:"tabs"},l("div",{className:`tab ${u==="epoch"?"active":""}`,onClick:()=>s("epoch")},"View Order"),l("div",{className:`tab ${u==="tokens"?"active":""}`,onClick:()=>s("tokens")},"Change Token Budget")),l("div",{className:`tab-content ${u==="epoch"?"active":""}`},l(ze,{label:"Render Epoch",value:n,onChange:o,min:0,max:EPOCHS.length})),l("div",{className:`tab-content ${u==="tokens"?"active":""}`},l(ze,{label:"Token Budget",value:t,onChange:i,min:0,max:DEFAULT_TOKENS*2}))),l("div",{className:"control-description"},u==="tokens"?l("p",null,"Token changes here will prune elements and re-render Expandable ones, but the entire prompt is not being re-rendered"):l("p",null,"Changing the render epoch lets you see the order in which elements are rendered and how the token budget is allocated."),l("div",{className:"controls-stats"},l("span",null,"Used ",l(T,{value:r.container.tokens}),"/",l(T,{value:r.budget})," tokens"),l("span",null,"Removed ",l(T,{value:r.removed})," nodes"),l(Qe,{scoreBy:c,onScoreByChange:a}))),l(Pe,{node:r.container,scoreBy:c,epoch:n}))};ve(l(Ye,null),document.body);})();\n';nue.tracerCss=`body{font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,system-ui,Ubuntu,Droid Sans,sans-serif;background:#fff;margin:0}.render-pass{border-left:2px solid #ccc;&:hover{border-left-color:#000}}.literals li{white-space:pre;font-family:SF Mono,Monaco,Menlo,Consolas,Ubuntu Mono,Liberation Mono,DejaVu Sans Mono,Courier New,monospace}.render-flex,.render-element{padding-left:10px}.node{border:1px solid rgba(255,255,255,.5);margin:3px 10px;padding:3px 10px;border-radius:4px;width:fit-content;&.new-in-epoch{box-shadow:0 0 3px 2px red}&.before-epoch{pointer-events:none;filter:grayscale(1);color:#777!important;.node{color:#777!important}}&:last-child{margin-bottom:0}}.node-content{font-weight:700}.node-children{margin-left:20px;border-left:2px dashed rgba(255,255,255,.5);padding-left:10px}.node-toggler{cursor:pointer;display:flex;align-items:center;justify-content:space-between;.indicator{font-size:.7em}}.node-text{width:400px;&:focus,&:focus-within{outline:1px solid orange;.node-content{white-space:normal}}.node-content{font-weight:400;font-size:.8em;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}}.node-stats{font-family:SF Mono,Monaco,Menlo,Consolas,Ubuntu Mono,Liberation Mono,DejaVu Sans Mono,Courier New,monospace;font-size:.8em}.control-description{padding:10px;p{font-size:.9em;max-width:500px;margin-top:0}}.controls{display:flex;flex-direction:column;gap:10px;position:sticky;top:0;padding:10px;background:#fff;border-bottom:1px solid #ccc;z-index:1}.controls-slider{display:flex;align-items:center;gap:10px}.controls-stats{display:flex;gap:20px;list-style:none;padding:0;margin-top:0}.controls-scoreby{display:flex;gap:10px}.tabs{display:flex;border-bottom:1px solid #ccc;margin-bottom:10px}.tab{padding:10px;cursor:pointer;border:1px solid transparent;border-bottom:none}.tab.active{border-color:#ccc;border-bottom:1px solid #fff;background-color:#f9f9f9}.tab-content{display:none}.tab-content.active{display:block} -`});var $En=I(HYe=>{"use strict";p();Object.defineProperty(HYe,"__esModule",{value:!0});HYe.HTMLTracer=void 0;var qEn=QEn(),gq=A7t(),oQo=sq(),J7t=class{static{a(this,"HTMLTracer")}traceData;epochs=[];addRenderEpoch(e){this.epochs.push(e)}includeInEpoch(e){this.epochs[this.epochs.length-1].elements.push(e)}didMaterializeTree(e){this.traceData=e}async serveHTML(){return Z7t.create({epochs:this.epochs,traceData:HEn(this.traceData)})}serveRouter(e){return new jYe({baseAddress:e,epochs:this.epochs,traceData:HEn(this.traceData)})}};HYe.HTMLTracer=J7t;var jYe=class{static{a(this,"RequestRouter")}opts;serverToken=crypto.randomUUID();constructor(e){this.opts=e}route(e,r){let n=e,o=r,s=new URL(n.url||"/","http://localhost"),c=`/${this.serverToken}`;switch(s.pathname){case c:case`${c}/`:this.onRoot(s,n,o);break;case`${c}/regen`:this.onRegen(s,n,o);break;default:return!1}return!0}get address(){return this.opts.baseAddress+"/"+this.serverToken}async getHTML(){let{traceData:e,epochs:r}=this.opts;return` - +`)}typeof e[e.length-1]=="string"?e[e.length-1]+=r.text:e.push(r.text)}return e});toChatMessage(){let e=this.text.map(r=>{if(typeof r=="string")return{type:DA.Raw.ChatCompletionContentPartKind.Text,text:r};if(r instanceof FK)return{type:DA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:B_n(r.src),detail:r.detail,...r.mimeType?{mediaType:r.mimeType}:{}}};if(r instanceof UK)return{type:DA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:r.data,mediaType:r.mediaType}};if(r instanceof vq)return{type:DA.Raw.ChatCompletionContentPartKind.Opaque,value:r.value};if(r instanceof zP)return r.part;throw new Error("Unexpected element type")});if(this.role===DA.Raw.ChatRole.System)return{role:this.role,content:e,...this.name?{name:this.name}:{}};if(this.role===DA.Raw.ChatRole.Assistant){let r={role:this.role,content:e};return this.name&&(r.name=this.name),this.toolCalls?.length&&(r.toolCalls=this.toolCalls.map(n=>({function:n.function,id:n.id,type:n.type}))),r}else return this.role===DA.Raw.ChatRole.User?{role:this.role,content:e,...this.name?{name:this.name}:{}}:this.role===DA.Raw.ChatRole.Tool?{role:this.role,content:e,toolCallId:this.toolCallId}:{role:this.role,content:e,name:this.name}}};yg.MaterializedChatMessage=YP;var vq=class{static{a(this,"MaterializedChatMessageOpaque")}parent;part;priority;metadata=[];get value(){return this.part.value}constructor(e,r,n=Number.MAX_SAFE_INTEGER){this.parent=e,this.part=r,this.priority=n}upperBoundTokenCount(e){return this.part.tokenUsage&&DA.Raw.ChatCompletionContentPartOpaque.usableIn(this.part,e.mode)?this.part.tokenUsage:0}isEmpty=!1};yg.MaterializedChatMessageOpaque=vq;var zP=class{static{a(this,"MaterializedChatMessageBreakpoint")}parent;part;metadata=[];priority=Number.MAX_SAFE_INTEGER;constructor(e,r){this.parent=e,this.part=r}upperBoundTokenCount(e){return 0}isEmpty=!1};yg.MaterializedChatMessageBreakpoint=zP;var FK=class{static{a(this,"MaterializedChatMessageImage")}parent;id;src;priority;metadata;lineBreakBefore;detail;mimeType;constructor(e,r,n,o,s=[],c,l,u){this.parent=e,this.id=r,this.src=n,this.priority=o,this.metadata=s,this.lineBreakBefore=c,this.detail=l,this.mimeType=u}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,BK.once)(async e=>e.tokenLength({type:DA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:B_n(this.src),detail:this.detail,mediaType:this.mimeType}}));isEmpty=!1};yg.MaterializedChatMessageImage=FK;var UK=class{static{a(this,"MaterializedChatMessageDocument")}parent;id;data;mediaType;priority;metadata;lineBreakBefore;constructor(e,r,n,o,s,c=[],l){this.parent=e,this.id=r,this.data=n,this.mediaType=o,this.priority=s,this.metadata=c,this.lineBreakBefore=l}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,BK.once)(async e=>e.tokenLength({type:DA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:this.data,mediaType:this.mediaType}}));isEmpty=!1};yg.MaterializedChatMessageDocument=UK;function Cq(t){return t instanceof W3||t instanceof YP}a(Cq,"isContainerType");function D_n(t){return t instanceof Pxe||t instanceof FK||t instanceof UK||t instanceof vq||t instanceof zP}a(D_n,"isContentType");function Tqo(t){if(!Cq(t))throw new Error(`Cannot have a text node outside a ChatMessage. Text: "${t.text}"`)}a(Tqo,"assertContainerOrChatMessage");function*N_n(t,e=!1){for(let r of t.children)r instanceof Pxe?(yield{content:r,isTextSibling:e},e=!0):r instanceof FK||r instanceof UK||r instanceof vq||r instanceof zP?yield{content:r,isTextSibling:!1}:r instanceof vq?yield{content:r,isTextSibling:!0}:(r&&(yield*N_n(r,e)),e=!1)}a(N_n,"contentChunks");function Iqo(t,e){let r;function n(o,s){if(D_n(o))(!r||o.priorityn instanceof zP):t instanceof W3&&(r=t.children.some(M_n)),w_n.set(t,r),r}a(M_n,"hasCachePoint");function xqo(t){if(t instanceof YP)return!0;for(let e=t.parent;e;e=e.parent)if(e instanceof YP)return!1;return!0}a(xqo,"shouldLookForCachePointInNode");function aQt(t,e){let r;if(t instanceof W3&&t.has(1)){Iqo(t,e);return}let n=xqo(t),o=t.children.map((s,c)=>({chain:[t],index:c}));for(let s=0;s({chain:d,index:h})))}else if(!r||u.priorityo instanceof YP?o.role:o.name||"(anonymous)");super(`No lowest priority node found (path: ${n.join(" -> ")})`)}};yg.BudgetExceededError=zYe;function R_n(t){if(!Cq(t))return-1;let e=Number.MAX_SAFE_INTEGER;for(let r of t.children)e=Math.min(e,r.priority);return e}a(R_n,"getLowestPriorityAmongChildren");function*O_n(t){yield*t.metadata;for(let e of t.children)Cq(e)?yield*O_n(e):yield*e.metadata}a(O_n,"allMetadata");function L_n(t,e,r){for(let n=0;n0;){let r=e.pop();yield r,Cq(r)&&e.push(...r.children)}}a(k_n,"forEachNode");function wqo(t){let e=t;for(;e.parent;)e=e.parent;return e}a(wqo,"getRoot");function P_n(t){return t instanceof W3&&t.keepWithId!==void 0}a(P_n,"isKeepWith");var sQt=new Set;function Rqo(t,e){let r=new Set;for(let n of k_n(t))P_n(n)&&!sQt.has(n.keepWithId)&&r.add(n.keepWithId);if(r.size===0)return!1;for(let n of r)sQt.add(n);try{let n=wqo(t);for(let o of k_n(n))P_n(o)&&r.has(o.keepWithId)?Dxe(o,e):o instanceof YP&&o.toolCalls&&(o.toolCalls=kqo(o.toolCalls,s=>!(s.keepWith&&r.has(s.keepWith.id))),o.isEmpty&&Dxe(o,e))}finally{for(let n of r)sQt.delete(n)}}a(Rqo,"removeOtherKeepWiths");function cQt(t,e){if(e.id===t)return e;for(let r of e.children)if(Cq(r)){let n=cQt(t,r);if(n)return n}}a(cQt,"findNodeById");function Dxe(t,e){let r=t.parent;if(!r)return;let n=r.children.indexOf(t);n!==-1&&(r.children.splice(n,1),e.push(t),Rqo(t,e),r.isEmpty?Dxe(r,e):r.onChunksChange())}a(Dxe,"removeNode");function B_n(t){let e={"/9j/":"image/jpeg",iVBOR:"image/png",R0lGOD:"image/gif",UklGR:"image/webp"};for(let r of Object.keys(e))if(t.startsWith(r))return`data:${e[r]};base64,${t}`;return t}a(B_n,"getEncodedBase64");function kqo(t,e){for(let r=0;r{"use strict";p();function Pqo(t,e,...r){return{ctor:t,props:e,children:r.flat()}}a(Pqo,"_vscpp");function F_n(){throw new Error("This should not be invoked!")}a(F_n,"_vscppf");F_n.isFragment=!0;globalThis.vscpp=Pqo;globalThis.vscppf=F_n});var dQt=I(YYe=>{"use strict";p();Object.defineProperty(YYe,"__esModule",{value:!0});YYe.PromptElement=void 0;U_n();var uQt=class{static{a(this,"PromptElement")}props;get priority(){return this.props.priority??Number.MAX_SAFE_INTEGER}get insertLineBreakBefore(){return!0}constructor(e){this.props=e}};YYe.PromptElement=uQt});var CQt=I(qs=>{"use strict";p();Object.defineProperty(qs,"__esModule",{value:!0});qs.LogicalWrapper=qs.IfEmpty=qs.AbstractKeepWith=qs.TokenLimit=qs.Expandable=qs.Chunk=qs.LegacyPrioritization=qs.ToolResult=qs.PrioritizedList=qs.Document=qs.Image=qs.TextChunk=qs.ToolMessage=qs.AssistantMessage=qs.UserMessage=qs.SystemMessage=qs.BaseChatMessage=void 0;qs.isChatMessagePromptElement=Dqo;qs.useKeepWith=Lqo;var Mxe=Io(),ZS=dQt();function Dqo(t){return t instanceof KYe||t instanceof JYe||t instanceof ZYe}a(Dqo,"isChatMessagePromptElement");var QK=class extends ZS.PromptElement{static{a(this,"BaseChatMessage")}render(){return vscpp(vscppf,null,this.props.children)}};qs.BaseChatMessage=QK;var KYe=class extends QK{static{a(this,"SystemMessage")}constructor(e){e.role=Mxe.Raw.ChatRole.System,super(e)}};qs.SystemMessage=KYe;var JYe=class extends QK{static{a(this,"UserMessage")}constructor(e){e.role=Mxe.Raw.ChatRole.User,super(e)}};qs.UserMessage=JYe;var ZYe=class extends QK{static{a(this,"AssistantMessage")}constructor(e){e.role=Mxe.Raw.ChatRole.Assistant,super(e)}};qs.AssistantMessage=ZYe;var Nqo=/\s+/g,fQt=class extends QK{static{a(this,"ToolMessage")}constructor(e){e.role=Mxe.Raw.ChatRole.Tool,super(e)}};qs.ToolMessage=fQt;var XYe=class extends ZS.PromptElement{static{a(this,"TextChunk")}async prepare(e,r,n){let o=this.props.breakOnWhitespace?Nqo:this.props.breakOn;if(!o)return vscpp(vscppf,null,this.props.children);let s="",c=[];for(let u of this.props.children||[])if(u&&typeof u=="object"){if(typeof u.ctor!="string")throw new Error("TextChunk children must be text literals or intrinsic attributes.");u.ctor==="br"?s+=` +`:c.push(u)}else u!=null&&(s+=u);let l=await Mqo(e,o,s,n);return vscpp(vscppf,null,c,l)}render(e){return e}};qs.TextChunk=XYe;async function Mqo(t,e,r,n){if(e instanceof RegExp){if(!e.global)throw new Error(`\`breakOn\` expression must have the global flag set (got ${e})`);e.lastIndex=0}let o="",s=-1;for(;st.tokenBudget)return o;o=l,s=c}return o}a(Mqo,"getTextContentBelowBudget");var pQt=class extends ZS.PromptElement{static{a(this,"Image")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};qs.Image=pQt;var hQt=class extends ZS.PromptElement{static{a(this,"Document")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};qs.Document=hQt;var mQt=class extends ZS.PromptElement{static{a(this,"PrioritizedList")}render(){let{children:e,priority:r=0,descending:n}=this.props;if(e)return vscpp(vscppf,null,e.map((o,s)=>{if(!o)return;let c=n?r-s:r-e.length+s;return typeof o!="object"?vscpp(XYe,{priority:c},o):(o.props??={},o.props.priority=c,o)}))}};qs.PrioritizedList=mQt;var gQt=class extends ZS.PromptElement{static{a(this,"ToolResult")}render(){return vscpp(vscppf,null,this.props.data.content.map(e=>{if(e&&typeof e.value=="string")return e.value;if(e&&e.value&&typeof e.value.node=="object")return vscpp("elementJSON",{data:e.value})}))}};qs.ToolResult=gQt;var AQt=class extends ZS.PromptElement{static{a(this,"LegacyPrioritization")}render(){return vscpp(vscppf,null,this.props.children)}};qs.LegacyPrioritization=AQt;var yQt=class extends ZS.PromptElement{static{a(this,"Chunk")}render(){return vscpp(vscppf,null,this.props.children)}};qs.Chunk=yQt;var EQt=class extends ZS.PromptElement{static{a(this,"Expandable")}async render(e,r){return vscpp(vscppf,null,await this.props.value(r))}};qs.Expandable=EQt;var _Qt=class extends ZS.PromptElement{static{a(this,"TokenLimit")}render(){return vscpp(vscppf,null,this.props.children)}};qs.TokenLimit=_Qt;var eKe=class extends ZS.PromptElement{static{a(this,"AbstractKeepWith")}};qs.AbstractKeepWith=eKe;var Oqo=0;function Lqo(){let t=Oqo++;return class extends eKe{static{a(this,"KeepWith")}static id=t;id=t;render(){return vscpp(vscppf,null,this.props.children)}}}a(Lqo,"useKeepWith");var vQt=class extends ZS.PromptElement{static{a(this,"IfEmpty")}render(){return vscpp(vscppf,null,vscpp(Nxe,null,this.props.alt),vscpp(Nxe,{flexGrow:1},this.props.children))}};qs.IfEmpty=vQt;var Nxe=class extends ZS.PromptElement{static{a(this,"LogicalWrapper")}render(){return vscpp(vscppf,null,this.props.children)}};qs.LogicalWrapper=Nxe});var q_n=I(Oxe=>{"use strict";p();Object.defineProperty(Oxe,"__esModule",{value:!0});Oxe.localize=Bqo;Oxe.localize2=Fqo;Oxe.getConfiguredDefaultLocale=Uqo;function Q_n(t,e){let r;return e.length===0?r=t:r=t.replace(/\{(\d+)\}/g,function(n,o){let s=o[0];return typeof e[s]<"u"?e[s]:n}),r}a(Q_n,"_format");function Bqo(t,e,...r){return Q_n(e,r)}a(Bqo,"localize");function Fqo(t,e,...r){let n=Q_n(e,r);return{original:n,value:n}}a(Fqo,"localize2");function Uqo(t){}a(Uqo,"getConfiguredDefaultLocale")});var IQt=I(Sr=>{"use strict";p();Object.defineProperty(Sr,"__esModule",{value:!0});Sr.isAndroid=Sr.isEdge=Sr.isSafari=Sr.isFirefox=Sr.isChrome=Sr.OS=Sr.setTimeout0=Sr.setTimeout0IsFaster=Sr.translationsConfigFile=Sr.platformLocale=Sr.locale=Sr.Language=Sr.language=Sr.userAgent=Sr.platform=Sr.isCI=Sr.isMobile=Sr.isIOS=Sr.webWorkerOrigin=Sr.isWebWorker=Sr.isWeb=Sr.isElectron=Sr.isNative=Sr.isLinuxSnap=Sr.isLinux=Sr.isMacintosh=Sr.isWindows=Sr.LANGUAGE_DEFAULT=void 0;Sr.PlatformToString=qqo;Sr.isLittleEndian=jqo;Sr.isBigSurOrNewer=Hqo;var j_n=q_n();Sr.LANGUAGE_DEFAULT="en";var Fxe=!1,Uxe=!1,Bxe=!1,V_n=!1,W_n=!1,SQt=!1,z_n=!1,TQt=!1,Y_n=!1,K_n=!1,Lxe,tKe=Sr.LANGUAGE_DEFAULT,bQt=Sr.LANGUAGE_DEFAULT,J_n,z3,Y3=globalThis,XS;typeof Y3.vscode<"u"&&typeof Y3.vscode.process<"u"?XS=Y3.vscode.process:typeof process<"u"&&(XS=process);var Z_n=typeof XS?.versions?.electron=="string",Qqo=Z_n&&XS?.type==="renderer";if(typeof XS=="object"){Fxe=XS.platform==="win32",Uxe=XS.platform==="darwin",Bxe=XS.platform==="linux",V_n=Bxe&&!!XS.env.SNAP&&!!XS.env.SNAP_REVISION,z_n=Z_n,Y_n=!!XS.env.CI||!!XS.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Lxe=Sr.LANGUAGE_DEFAULT,tKe=Sr.LANGUAGE_DEFAULT;let t=XS.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t),r=e.availableLanguages["*"];Lxe=e.locale,bQt=e.osLocale,tKe=r||Sr.LANGUAGE_DEFAULT,J_n=e._translationsConfigFile}catch{}W_n=!0}else typeof navigator=="object"&&!Qqo?(z3=navigator.userAgent,Fxe=z3.indexOf("Windows")>=0,Uxe=z3.indexOf("Macintosh")>=0,TQt=(z3.indexOf("Macintosh")>=0||z3.indexOf("iPad")>=0||z3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Bxe=z3.indexOf("Linux")>=0,K_n=z3?.indexOf("Mobi")>=0,SQt=!0,Lxe=j_n.getConfiguredDefaultLocale(j_n.localize({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"))||Sr.LANGUAGE_DEFAULT,tKe=Lxe,bQt=navigator.language):console.error("Unable to resolve platform.");function qqo(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(qqo,"PlatformToString");var rKe=0;Uxe?rKe=1:Fxe?rKe=3:Bxe&&(rKe=2);Sr.isWindows=Fxe;Sr.isMacintosh=Uxe;Sr.isLinux=Bxe;Sr.isLinuxSnap=V_n;Sr.isNative=W_n;Sr.isElectron=z_n;Sr.isWeb=SQt;Sr.isWebWorker=SQt&&typeof Y3.importScripts=="function";Sr.webWorkerOrigin=Sr.isWebWorker?Y3.origin:void 0;Sr.isIOS=TQt;Sr.isMobile=K_n;Sr.isCI=Y_n;Sr.platform=rKe;Sr.userAgent=z3;Sr.language=tKe;var H_n;(function(t){function e(){return Sr.language}a(e,"value"),t.value=e;function r(){return Sr.language.length===2?Sr.language==="en":Sr.language.length>=3?Sr.language[0]==="e"&&Sr.language[1]==="n"&&Sr.language[2]==="-":!1}a(r,"isDefaultVariant"),t.isDefaultVariant=r;function n(){return Sr.language==="en"}a(n,"isDefault"),t.isDefault=n})(H_n||(Sr.Language=H_n={}));Sr.locale=Lxe;Sr.platformLocale=bQt;Sr.translationsConfigFile=J_n;Sr.setTimeout0IsFaster=typeof Y3.postMessage=="function"&&!Y3.importScripts;Sr.setTimeout0=(()=>{if(Sr.setTimeout0IsFaster){let t=[];Y3.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),Y3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();Sr.OS=Uxe||TQt?2:Fxe?1:3;var G_n=!0,$_n=!1;function jqo(){if(!$_n){$_n=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,G_n=new Uint16Array(t.buffer)[0]===513}return G_n}a(jqo,"isLittleEndian");Sr.isChrome=!!(Sr.userAgent&&Sr.userAgent.indexOf("Chrome")>=0);Sr.isFirefox=!!(Sr.userAgent&&Sr.userAgent.indexOf("Firefox")>=0);Sr.isSafari=!!(!Sr.isChrome&&Sr.userAgent&&Sr.userAgent.indexOf("Safari")>=0);Sr.isEdge=!!(Sr.userAgent&&Sr.userAgent.indexOf("Edg/")>=0);Sr.isAndroid=!!(Sr.userAgent&&Sr.userAgent.indexOf("Android")>=0);function Hqo(t){return parseFloat(t)>=20}a(Hqo,"isBigSurOrNewer")});var evn=I(xO=>{"use strict";p();Object.defineProperty(xO,"__esModule",{value:!0});xO.arch=xO.platform=xO.env=xO.cwd=void 0;var X_n=IQt(),qK,xQt=globalThis.vscode;if(typeof xQt<"u"&&typeof xQt.process<"u"){let t=xQt.process;qK={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"?qK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:qK={get platform(){return X_n.isWindows?"win32":X_n.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};xO.cwd=qK.cwd;xO.env=qK.env;xO.platform=qK.platform;xO.arch=qK.arch});var rvn=I(An=>{"use strict";p();Object.defineProperty(An,"__esModule",{value:!0});An.delimiter=An.sep=An.toNamespacedPath=An.parse=An.format=An.extname=An.basename=An.dirname=An.relative=An.resolve=An.join=An.isAbsolute=An.normalize=An.posix=An.win32=void 0;var uue=evn(),Gqo=65,$qo=97,Vqo=90,Wqo=122,Tq=46,Eg=47,qC=92,bq=58,zqo=63,nKe=class extends Error{static{a(this,"ErrorInvalidArgType")}code;constructor(e,r,n){let o;typeof r=="string"&&r.indexOf("not ")===0?(o="must not be",r=r.replace(/^not /,"")):o="must be";let s=e.indexOf(".")!==-1?"property":"argument",c=`The "${e}" ${s} ${o} of type ${r}`;c+=`. Received type ${typeof n}`,super(c),this.code="ERR_INVALID_ARG_TYPE"}};function Yqo(t,e){if(t===null||typeof t!="object")throw new nKe(e,"Object",t)}a(Yqo,"validateObject");function ap(t,e){if(typeof t!="string")throw new nKe(e,"string",t)}a(ap,"validateString");var jC=uue.platform==="win32";function rs(t){return t===Eg||t===qC}a(rs,"isPathSeparator");function wQt(t){return t===Eg}a(wQt,"isPosixPathSeparator");function Sq(t){return t>=Gqo&&t<=Vqo||t>=$qo&&t<=Wqo}a(Sq,"isWindowsDeviceRoot");function iKe(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===Tq&&l!==-1?++l:l=-1}return o}a(iKe,"normalizeString");function tvn(t,e){Yqo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${e.ext||""}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(tvn,"_format");An.win32={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],ap(s,"path"),s.length===0)continue}else e.length===0?s=uue.cwd():(s=uue.env[`=${e}`]||uue.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===qC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)rs(f)&&(l=1,d=!0);else if(rs(f))if(d=!0,rs(s.charCodeAt(1))){let h=2,m=h;for(;h2&&rs(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=iKe(r,!n,"\\",rs),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){ap(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return wQt(s)?"\\":t;if(rs(s))if(o=!0,rs(t.charCodeAt(1))){let l=2,u=l;for(;l2&&rs(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&rs(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){ap(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return rs(r)||e>2&&Sq(r)&&t.charCodeAt(1)===bq&&rs(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&rs(r.charCodeAt(0))){++o;let s=r.length;s>1&&rs(r.charCodeAt(1))&&(++o,s>2&&(rs(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return An.win32.normalize(e)},relative(t,e){if(ap(t,"from"),ap(e,"to"),t===e)return"";let r=An.win32.resolve(t),n=An.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===qC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===qC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===qC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===qC?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===qC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===qC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=An.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===qC){if(e.charCodeAt(1)===qC){let r=e.charCodeAt(2);if(r!==zqo&&r!==Tq)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Sq(e.charCodeAt(0))&&e.charCodeAt(1)===bq&&e.charCodeAt(2)===qC)return`\\\\?\\${e}`;return t},dirname(t){ap(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return rs(o)?t:".";if(rs(o)){if(r=n=1,rs(t.charCodeAt(1))){let l=2,u=l;for(;l2&&rs(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(rs(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&ap(e,"ext"),ap(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&Sq(t.charCodeAt(0))&&t.charCodeAt(1)===bq&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(rs(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(rs(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){ap(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===bq&&Sq(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(rs(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===Tq?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:tvn.bind(null,"\\"),parse(t){ap(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return rs(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(rs(o)){if(n=1,rs(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),rs(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===Tq?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null};var Kqo=(()=>{if(jC){let t=/\\/g;return()=>{let e=uue.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>uue.cwd()})();An.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:Kqo();ap(o,"path"),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===Eg)}return e=iKe(e,!r,"/",wQt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(ap(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Eg,r=t.charCodeAt(t.length-1)===Eg;return t=iKe(t,!e,"/",wQt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return ap(t,"path"),t.length>0&&t.charCodeAt(0)===Eg},join(...t){if(t.length===0)return".";let e;for(let r=0;r0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":An.posix.normalize(e)},relative(t,e){if(ap(t,"from"),ap(e,"to"),t===e||(t=An.posix.resolve(t),e=An.posix.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===Eg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===Eg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===Eg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(ap(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Eg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===Eg){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&ap(e,"ext"),ap(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===Eg){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===Eg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){ap(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t.charCodeAt(c);if(l===Eg){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===Tq?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:tvn.bind(null,"/"),parse(t){ap(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===Eg,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===Eg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===Tq?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};An.posix.win32=An.win32.win32=An.win32;An.posix.posix=An.win32.posix=An.posix;An.normalize=jC?An.win32.normalize:An.posix.normalize;An.isAbsolute=jC?An.win32.isAbsolute:An.posix.isAbsolute;An.join=jC?An.win32.join:An.posix.join;An.resolve=jC?An.win32.resolve:An.posix.resolve;An.relative=jC?An.win32.relative:An.posix.relative;An.dirname=jC?An.win32.dirname:An.posix.dirname;An.basename=jC?An.win32.basename:An.posix.basename;An.extname=jC?An.win32.extname:An.posix.extname;An.format=jC?An.win32.format:An.posix.format;An.parse=jC?An.win32.parse:An.posix.parse;An.toNamespacedPath=jC?An.win32.toNamespacedPath:An.posix.toNamespacedPath;An.sep=jC?An.win32.sep:An.posix.sep;An.delimiter=jC?An.win32.delimiter:An.posix.delimiter});var lvn=I(due=>{"use strict";p();Object.defineProperty(due,"__esModule",{value:!0});due.URI=void 0;due.isUriComponents=ijo;due.uriToFsPath=cKe;var nvn=rvn(),sKe=IQt(),Jqo=/^\w[\w\d+.-]*$/,Zqo=/^\//,Xqo=/^\/\//;function ejo(t,e){if(!t.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t.authority}", path: "${t.path}", query: "${t.query}", fragment: "${t.fragment}"}`);if(t.scheme&&!Jqo.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!Zqo.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Xqo.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(ejo,"_validateUri");function tjo(t,e){return!t&&!e?"file":t}a(tjo,"_schemeFix");function rjo(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==KP&&(e=KP+e):e=KP;break}return e}a(rjo,"_referenceResolution");var Gl="",KP="/",njo=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,aKe=class t{static{a(this,"URI")}static isUri(e){return e instanceof t?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}scheme;authority;path;query;fragment;constructor(e,r,n,o,s,c=!1){typeof e=="object"?(this.scheme=e.scheme||Gl,this.authority=e.authority||Gl,this.path=e.path||Gl,this.query=e.query||Gl,this.fragment=e.fragment||Gl):(this.scheme=tjo(e,c),this.authority=r||Gl,this.path=rjo(this.scheme,n||Gl),this.query=o||Gl,this.fragment=s||Gl,ejo(this,c))}get fsPath(){return cKe(this,!1)}with(e){if(!e)return this;let{scheme:r,authority:n,path:o,query:s,fragment:c}=e;return r===void 0?r=this.scheme:r===null&&(r=Gl),n===void 0?n=this.authority:n===null&&(n=Gl),o===void 0?o=this.path:o===null&&(o=Gl),s===void 0?s=this.query:s===null&&(s=Gl),c===void 0?c=this.fragment:c===null&&(c=Gl),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new Iq(r,n,o,s,c)}static parse(e,r=!1){let n=njo.exec(e);return n?new Iq(n[2]||Gl,oKe(n[4]||Gl),oKe(n[5]||Gl),oKe(n[7]||Gl),oKe(n[9]||Gl),r):new Iq(Gl,Gl,Gl,Gl,Gl)}static file(e){let r=Gl;if(sKe.isWindows&&(e=e.replace(/\\/g,KP)),e[0]===KP&&e[1]===KP){let n=e.indexOf(KP,2);n===-1?(r=e.substring(2),e=KP):(r=e.substring(2,n),e=e.substring(n)||KP)}return new Iq("file",r,e,Gl,Gl)}static from(e,r){return new Iq(e.scheme,e.authority,e.path,e.query,e.fragment,r)}static joinPath(e,...r){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let n;return sKe.isWindows&&e.scheme==="file"?n=t.file(nvn.win32.join(cKe(e,!0),...r)).path:n=nvn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return RQt(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new Iq(e);return r._formatted=e.external??null,r._fsPath=e._sep===svn?e.fsPath??null:null,r}}else return e}};due.URI=aKe;function ijo(t){return!t||typeof t!="object"?!1:typeof t.scheme=="string"&&(typeof t.authority=="string"||typeof t.authority>"u")&&(typeof t.path=="string"||typeof t.path>"u")&&(typeof t.query=="string"||typeof t.query>"u")&&(typeof t.fragment=="string"||typeof t.fragment>"u")}a(ijo,"isUriComponents");var svn=sKe.isWindows?1:void 0,Iq=class extends aKe{static{a(this,"Uri")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=cKe(this,!1)),this._fsPath}toString(e=!1){return e?RQt(this,!0):(this._formatted||(this._formatted=RQt(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=svn),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},avn={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function ivn(t,e,r){let n,o=-1;for(let s=0;s=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===45||c===46||c===95||c===126||e&&c===47||r&&c===91||r&&c===93||r&&c===58)o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n!==void 0&&(n+=t.charAt(s));else{n===void 0&&(n=t.substr(0,s));let l=avn[c];l!==void 0?(o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n+=l):o===-1&&(o=s)}}return o!==-1&&(n+=encodeURIComponent(t.substring(o))),n!==void 0?n:t}a(ivn,"encodeURIComponentFast");function ojo(t){let e;for(let r=0;r1&&t.scheme==="file"?r=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?r=t.path.substr(1):r=t.path[1].toLowerCase()+t.path.substr(2):r=t.path,sKe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(cKe,"uriToFsPath");function RQt(t,e){let r=e?ojo:ivn,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=KP,n+=KP),s){let d=s.indexOf("@");if(d!==-1){let f=s.substr(0,d);s=s.substr(d+1),d=f.lastIndexOf(":"),d===-1?n+=r(f,!1,!1):(n+=r(f.substr(0,d),!1,!1),n+=":",n+=r(f.substr(d+1),!1,!0)),n+="@"}s=s.toLowerCase(),d=s.lastIndexOf(":"),d===-1?n+=r(s,!1,!0):(n+=r(s.substr(0,d),!1,!0),n+=s.substr(d))}if(c){if(c.length>=3&&c.charCodeAt(0)===47&&c.charCodeAt(2)===58){let d=c.charCodeAt(1);d>=65&&d<=90&&(c=`/${String.fromCharCode(d+32)}:${c.substr(3)}`)}else if(c.length>=2&&c.charCodeAt(1)===58){let d=c.charCodeAt(0);d>=65&&d<=90&&(c=`${String.fromCharCode(d+32)}:${c.substr(2)}`)}n+=r(c,!0,!1)}return l&&(n+="?",n+=r(l,!1,!1)),u&&(n+="#",n+=e?u:ivn(u,!1,!1)),n}a(RQt,"_asFormatted");function cvn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+cvn(t.substr(3)):t}}a(cvn,"decodeURIComponentGraceful");var ovn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function oKe(t){return t.match(ovn)?t.replace(ovn,e=>cvn(e)):t}a(oKe,"percentDecode")});var DQt=I(xq=>{"use strict";p();Object.defineProperty(xq,"__esModule",{value:!0});xq.PromptReference=xq.ChatResponseReferencePartStatusKind=xq.PromptMetadata=void 0;var Qxe=lvn(),kQt=class{static{a(this,"PromptMetadata")}_marker;toString(){return Object.getPrototypeOf(this).constructor.name}};xq.PromptMetadata=kQt;var uvn;(function(t){t[t.Complete=1]="Complete",t[t.Partial=2]="Partial",t[t.Omitted=3]="Omitted"})(uvn||(xq.ChatResponseReferencePartStatusKind=uvn={}));var PQt=class t{static{a(this,"PromptReference")}anchor;iconPath;options;static fromJSON(e){let r=a(n=>"scheme"in n?Qxe.URI.from(n):{uri:Qxe.URI.from(n.uri),range:n.range},"uriOrLocation");return new t("variableName"in e.anchor?{variableName:e.anchor.variableName,value:e.anchor.value&&r(e.anchor.value)}:r(e.anchor),e.iconPath&&("scheme"in e.iconPath?Qxe.URI.from(e.iconPath):"light"in e.iconPath?{light:Qxe.URI.from(e.iconPath.light),dark:Qxe.URI.from(e.iconPath.dark)}:e.iconPath),e.options)}constructor(e,r,n){this.anchor=e,this.iconPath=r,this.options=n}toJSON(){return{anchor:this.anchor,iconPath:this.iconPath,options:this.options}}};xq.PromptReference=PQt});var QQt=I(fue=>{"use strict";p();Object.defineProperty(fue,"__esModule",{value:!0});fue.PromptRenderer=fue.MetadataMap=void 0;var sjo=iQt(),wq=lQt(),HK=Eq(),Hd=CQt(),UQt=DQt(),uKe;(function(t){t.empty={get:a(()=>{},"get"),getAll:a(()=>[],"getAll")},t.from=e=>({get:a(r=>e.find(n=>n instanceof r),"get"),getAll:a(r=>e.filter(n=>n instanceof r),"getAll")})})(uKe||(fue.MetadataMap=uKe={}));var NQt=class{static{a(this,"PromptRenderer")}_endpoint;_ctor;_props;_tokenizer;_usedContext=[];_ignoredFiles=[];_growables=[];_root=new pKe(null,0);_tokenLimits=[];tracer=void 0;constructor(e,r,n,o){this._endpoint=e,this._ctor=r,this._props=n,this._tokenizer=o}getIgnoredFiles(){return Array.from(new Set(this._ignoredFiles))}getUsedContext(){return this._usedContext}createElement(e){return new e.ctor(e.props)}async _processPromptPieces(e,r,n,o){let s=new Map;for(let[u,d]of r.entries()){if(Array.isArray(d.children)&&(d.props=d.props??{},d.props.children=d.children),!d.ctor){let A=hvn(d.path);throw new Error(`Invalid ChatMessage child! Child must be a TSX component that extends PromptElement at ${A}`)}let f=this.createElement(d),h;f instanceof Hd.TokenLimit&&(h=d.props.max,this._tokenLimits.push({limit:h,id:d.node.id})),d.node.setObj(f);let m=d.props.flexGrow??1/0,g=s.get(m);g||(g=[],s.set(m,g)),g.push({element:d,promptElementInstance:f,tokenLimit:h})}if(s.size===0)return;let c=[...s.entries()].sort(([u],[d])=>d-u).map(([u,d])=>d),l=a(u=>{let d=0;for(let f=u+1;f{if(E.tokenLimit===void 0)return!1;let _=E.element.props.flexBasis??1,v=_/h;return Math.floor(e.remainingTokenBudget*v){let v=(E.element.props.flexBasis??1)/h;return{tokenBudget:g[_]?E.tokenLimit:Math.floor((e.remainingTokenBudget-m)*v),endpoint:e.endpoint,countTokens:a((b,T)=>this._tokenizer.tokenLength(typeof b=="string"?{type:HK.Raw.ChatCompletionContentPartKind.Text,text:b}:b,T),"countTokens")}});e.consume(-f),this.tracer?.addRenderEpoch?.({inNode:d[0].element.node.parent?.id,flexValue:d[0].element.props.flexGrow??0,tokenBudget:e.remainingTokenBudget,reservedTokens:f,elements:d.map((E,_)=>({id:E.element.node.id,tokenBudget:A[_].tokenBudget}))}),await Promise.all(d.map(async({element:E,promptElementInstance:_},v)=>{let b=await fvn(E,()=>_.prepare?.(A[v],n,o));E.node.setState(b)}));let y=await Promise.all(d.map(async({element:E,promptElementInstance:_},v)=>{let b=A[v];return await fvn(E,()=>_.render(E.node.getState(),b,n,o))}));for(let[E,{element:_,promptElementInstance:v}]of d.entries()){let b=A[E],T=y[E];if(!T)continue;let w=await this._processPromptRenderPiece(new jK(b.tokenBudget,this._endpoint),_,v,T,n,o);v instanceof Hd.Expandable&&this._growables.push({initialConsume:w,elem:_.node}),e.consume(w)}}}async _processPromptRenderPiece(e,r,n,o,s,c){let l=pvn(o),u=new jK(e.tokenBudget,this._endpoint),{tokensConsumed:d}=await ajo(this._tokenizer,r,n,l);return u.consume(d),await this._handlePromptChildren(r,l,u,s,c),u.consumed}async renderElementJSON(e){return await this._processPromptPieces(new jK(this._endpoint.modelMaxPromptTokens,this._endpoint),[{node:this._root,ctor:this._ctor,props:this._props,children:[],path:[this._ctor]}],void 0,e),{node:this._root.toJSON()}}async render(e,r){let n=await this.renderRaw(e,r);return{...n,messages:(0,HK.toMode)(this._tokenizer.mode,n.messages)}}async renderRaw(e,r){await this._processPromptPieces(new jK(this._endpoint.modelMaxPromptTokens,this._endpoint),[{node:this._root,ctor:this._ctor,props:this._props,children:[],path:[this._ctor]}],e,r);let{container:n,allMetadata:o,removed:s}=await this._getFinalElementTree(this._endpoint.modelMaxPromptTokens,r);this.tracer?.didMaterializeTree?.({budget:this._endpoint.modelMaxPromptTokens,renderedTree:{container:n,removed:s,budget:this._endpoint.modelMaxPromptTokens},tokenizer:this._tokenizer,renderTree:a(m=>this._getFinalElementTree(m,void 0).then(g=>({...g,budget:m})),"renderTree")});let c=[...n.toChatMessages()],l=await n.tokenCount(this._tokenizer),u=[...n.allMetadata()],d=new Set,f=u.map(m=>{if(!(m instanceof wO))return;let g=m.reference,A="variableName"in g.anchor;if(A&&!d.has(g.anchor.variableName))return d.add(g.anchor.variableName),g;if(!A)return g}).filter(hKe),h=o.map(m=>{if(!(m instanceof wO)||u.includes(m))return;let g=m.reference,A="variableName"in g.anchor;if(A&&!d.has(g.anchor.variableName))return d.add(g.anchor.variableName),g;if(!A)return g}).filter(hKe);return{metadata:uKe.from(u),messages:c,hasIgnoredFiles:this._ignoredFiles.length>0,tokenCount:l,references:f,omittedReferences:h}}async _getFinalElementTree(e,r){let n=this._root.materialize(),o=[...n.toChatMessages()],s=[...n.allMetadata()],c=[{limit:e,id:this._root.id},...this._tokenLimits],l=0;for(let u=c.length-1;u>=0;u--){let d=c[u];if(d.limit>e)continue;let f=n.findById(d.id);if(!f)continue;let h=await f.tokenCount(this._tokenizer);if(!(hd.limit;){let g=await f.baseMessageTokenCount(this._tokenizer);do for(let A of f.removeLowestPriorityChild()){l++;let y=A.upperBoundTokenCount(this._tokenizer);m-=(typeof y=="number"?y:await y)*1.25}while(m-g>d.limit);m=await f.tokenCount(this._tokenizer)}}catch(m){throw m instanceof wq.BudgetExceededError&&(m.metadata=uKe.from([...n.allMetadata()]),m.messages=o),m}}return{container:n,allMetadata:s,removed:l}}async _grow(e,r,n,o){if(!this._growables.length)return!1;for(let s of this._growables){if(!e.findById(s.elem.id))continue;let c=s.elem.getObj();if(!(c instanceof Hd.Expandable))throw new Error("unreachable: expected growable");let l=new pKe(null,0,s.elem.id),u=new jK(n-r+s.initialConsume,this._endpoint),d=await this._processPromptRenderPiece(u,{node:l,ctor:this._ctor,props:{},children:[],path:[this._ctor]},c,await c.render(void 0,{tokenBudget:u.tokenBudget,endpoint:this._endpoint,countTokens:a((m,g)=>this._tokenizer.tokenLength(typeof m=="string"?{type:HK.Raw.ChatCompletionContentPartKind.Text,text:m}:m,g),"countTokens")}),void 0,o),f=l.materialize();if(!e.replaceNode(s.elem.id,f))throw new Error("unreachable: could not find old element to replace");if(r-=s.initialConsume,r+=d,r>=n)break}return!0}_handlePromptChildren(e,r,n,o,s){if(e.ctor===Hd.TextChunk){this._handleExtrinsicTextChunkChildren(e.node,e.node,e.props,r);return}let c=[];for(let l of r){if(l.kind==="literal"){e.node.appendStringChild(l.value,e.props.priority??Number.MAX_SAFE_INTEGER);continue}if(l.kind==="intrinsic"){this._handleIntrinsic(e.node,l.name,{priority:e.props.priority??Number.MAX_SAFE_INTEGER,...l.props},dKe(l.children));continue}let u=e.node.createChild();c.push({node:u,ctor:l.ctor,props:l.props,children:l.children,path:[...e.path,l.ctor]})}return this._processPromptPieces(n,c,o,s)}_handleIntrinsic(e,r,n,o,s){switch(r){case"meta":return this._handleIntrinsicMeta(e,n,o);case"br":return this._handleIntrinsicLineBreak(e,n,o,n.priority,s);case"usedContext":return this._handleIntrinsicUsedContext(e,n,o);case"references":return this._handleIntrinsicReferences(e,n,o);case"ignoredFiles":return this._handleIntrinsicIgnoredFiles(e,n,o);case"elementJSON":return this._handleIntrinsicElementJSON(e,n.data);case"cacheBreakpoint":return this._handleIntrinsicCacheBreakpoint(e,n,o,s);case"opaque":return this._handleIntrinsicOpaque(e,n,s)}throw new Error(`Unknown intrinsic element ${r}!`)}_handleIntrinsicCacheBreakpoint(e,r,n,o){if(n.length>0)throw new Error(" must not have children!");e.addCacheBreakpoint(r,o)}_handleIntrinsicMeta(e,r,n){if(n.length>0)throw new Error(" must not have children!");r.local?e.addMetadata(r.value):this._root.addMetadata(r.value)}_handleIntrinsicLineBreak(e,r,n,o,s){if(n.length>0)throw new Error("
must not have children!");e.appendLineBreak(o??Number.MAX_SAFE_INTEGER,s)}_handleIntrinsicOpaque(e,r,n){e.appendOpaque(r.value,r.tokenUsage,r.priority,n)}_handleIntrinsicElementJSON(e,r){let n=e.appendPieceJSON(r.node);if(this.tracer?.includeInEpoch)for(let o of n.elements())this.tracer.includeInEpoch({id:o.id,tokenBudget:0})}_handleIntrinsicUsedContext(e,r,n){if(n.length>0)throw new Error(" must not have children!");this._usedContext.push(...r.value)}_handleIntrinsicReferences(e,r,n){if(n.length>0)throw new Error(" must not have children!");for(let o of r.value)e.addMetadata(new wO(o))}_handleIntrinsicIgnoredFiles(e,r,n){if(n.length>0)throw new Error(" must not have children!");this._ignoredFiles.push(...r.value)}_handleExtrinsicTextChunkChildren(e,r,n,o){let s=[],c=[];for(let l of o){if(l.kind==="extrinsic")throw new Error("TextChunk cannot have extrinsic children!");if(l.kind==="literal"&&s.push(l.value),l.kind==="intrinsic")if(l.name==="br")s.push(` +`);else if(l.name==="references")for(let u of l.props.value)c.push(new wO(u));else this._handleIntrinsic(e,l.name,l.props,dKe(l.children),r.childIndex)}e.appendStringChild(s.join(""),n?.priority??Number.MAX_SAFE_INTEGER,c,r.childIndex,!0)}};fue.PromptRenderer=NQt;async function ajo(t,e,r,n){let o=0;if((0,Hd.isChatMessagePromptElement)(r)){let s={role:e.props.role,content:[],...e.props.name?{name:e.props.name}:void 0,...e.props.toolCalls?{toolCalls:e.props.toolCalls}:void 0,...e.props.toolCallId?{toolCallId:e.props.toolCallId}:void 0};o+=await t.countMessageTokens((0,HK.toMode)(t.mode,s))}for(let s of n)s.kind==="literal"&&(o+=await t.tokenLength({type:HK.Raw.ChatCompletionContentPartKind.Text,text:s.value}));return{tokensConsumed:o}}a(ajo,"computeTokensConsumedByLiterals");function pvn(t,e=[]){return typeof t>"u"||typeof t=="boolean"?[]:(typeof t=="string"||typeof t=="number"?e.push(new LQt(String(t))):cjo(t)?dKe(t.children,e):ljo(t)?dKe(t,e):typeof t.ctor=="string"?e.push(new MQt(t.ctor,t.props,t.children)):e.push(new OQt(t.ctor,t.props,t.children)),e)}a(pvn,"flattenAndReduce");function dKe(t,e=[]){for(let r of t)pvn(r,e);return e}a(dKe,"flattenAndReduceArr");var MQt=class{static{a(this,"IntrinsicPromptPiece")}name;props;children;kind="intrinsic";constructor(e,r,n){this.name=e,this.props=r,this.children=n}},OQt=class{static{a(this,"ExtrinsicPromptPiece")}ctor;props;children;kind="extrinsic";constructor(e,r,n){this.ctor=e,this.props=r,this.children=n}},LQt=class{static{a(this,"LiteralPromptPiece")}value;priority;kind="literal";constructor(e,r){this.value=e,this.priority=r}},fKe=class t{static{a(this,"PromptOpaque")}parent;childIndex;value;tokenUsage;priority;static fromJSON(e,r,n){return new t(e,r,n.value,n.tokenUsage,n.priority)}kind=2;constructor(e,r,n,o,s){this.parent=e,this.childIndex=r,this.value=n,this.tokenUsage=o,this.priority=s}materialize(e){return new wq.MaterializedChatMessageOpaque(e,{type:HK.Raw.ChatCompletionContentPartKind.Opaque,value:this.value,tokenUsage:this.tokenUsage},this.priority)}toJSON(){return{type:3,value:this.value,tokenUsage:this.tokenUsage,priority:this.priority}}},jK=class{static{a(this,"PromptSizingContext")}tokenBudget;endpoint;_consumed=0;constructor(e,r){this.tokenBudget=e,this.endpoint=r}get consumed(){return this._consumed>this.tokenBudget?this.tokenBudget:this._consumed}get remainingTokenBudget(){return Math.max(0,this.tokenBudget-this._consumed)}consume(e){this._consumed+=e}},pKe=class t{static{a(this,"PromptTreeElement")}parent;childIndex;id;static _nextId=0;static fromJSON(e,r,n){let o=new t(null,e);switch(o._metadata=r.references?.map(s=>new wO(UQt.PromptReference.fromJSON(s)))??[],o._children=r.children.map((s,c)=>{switch(s.type){case 1:return t.fromJSON(c,s,n);case 2:return qxe.fromJSON(o,c,s);case 3:return fKe.fromJSON(o,c,s);default:}}).filter(hKe),r.ctor){case 1:o._objFlags=r.flags??0,o._obj=new Hd.BaseChatMessage(r.props);break;case 2:{if(r.keepWithId!==void 0){let s=n.get(r.keepWithId);s||(s=(0,Hd.useKeepWith)(),n.set(r.keepWithId,s)),o._obj=new s(r.props||{})}else o._obj=new Hd.LogicalWrapper(r.props||{});o._objFlags=r.flags??0;break}case 3:o._obj=new Hd.Image(r.props);break;case 4:o._obj=new Hd.Document(r.props);break;default:}return o}kind=1;_obj=null;_state=void 0;_children=[];_metadata=[];_objFlags=0;constructor(e=null,r,n=t._nextId++){this.parent=e,this.childIndex=r,this.id=n}setObj(e){this._obj=e,this._obj instanceof Hd.LegacyPrioritization&&(this._objFlags|=1),this._obj instanceof Hd.Chunk&&(this._objFlags|=2),this._obj instanceof Hd.IfEmpty&&(this._objFlags|=8),this._obj.props.passPriority&&(this._objFlags|=4)}getObj(){return this._obj}setState(e){this._state=e}getState(){return this._state}createChild(){let e=new t(this,this._children.length);return this._children.push(e),e}appendPieceJSON(e){let r=t.fromJSON(this._children.length,e,new Map);return this._children.push(r),r}appendStringChild(e,r,n,o=this._children.length,s=!1){this._children.push(new qxe(this,o,e,r,n,s))}appendLineBreak(e,r=this._children.length){this._children.push(new qxe(this,r,` +`,e))}appendOpaque(e,r,n,o=this._children.length){this._children.push(new fKe(this,o,e,r,n))}toJSON(){let e={type:1,ctor:2,ctorName:this._obj?.constructor.name,children:this._children.slice().sort((r,n)=>r.childIndex-n.childIndex).map(r=>r.toJSON()).filter(hKe),props:{},references:this._metadata.filter(r=>r instanceof wO).map(r=>r.reference.toJSON())};if(this._obj&&(e.props=lKe(this._obj.props,sjo.jsonRetainedProps)),this._obj instanceof Hd.BaseChatMessage)e.ctor=1,Object.assign(e.props,lKe(this._obj.props,["role","name","toolCalls","toolCallId"]));else{if(this._obj instanceof Hd.Image)return{...e,ctor:3,props:{...e.props,...lKe(this._obj.props,["src","detail","mimeType"])}};if(this._obj instanceof Hd.Document)return{...e,ctor:4,props:{...e.props,...lKe(this._obj.props,["data","mediaType"])}};this._obj instanceof Hd.AbstractKeepWith&&(e.keepWithId=this._obj.id)}return this._objFlags!==0&&(e.flags=this._objFlags),e}materialize(e){if(this._children.sort((r,n)=>r.childIndex-n.childIndex),this._obj instanceof Hd.Image)return new wq.MaterializedChatMessageImage(e,this.id,this._obj.props.src,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,0,this._obj.props.detail??void 0,this._obj.props.mimeType??void 0);if(this._obj instanceof Hd.Document)return new wq.MaterializedChatMessageDocument(e,this.id,this._obj.props.data,this._obj.props.mediaType,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,0);if(this._obj instanceof Hd.BaseChatMessage){if(this._obj.props.role===void 0||typeof this._obj.props.role!="number")throw new Error("Invalid ChatMessage!");return new wq.MaterializedChatMessage(e,this.id,this._obj.props.role,this._obj.props.name,this._obj instanceof Hd.AssistantMessage?this._obj.props.toolCalls:void 0,this._obj instanceof Hd.ToolMessage?this._obj.props.toolCallId:void 0,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,r=>this._children.map(n=>n.materialize(r)))}else{let r=new wq.GenericMaterializedContainer(e,this.id,this._obj?.constructor.name,this._obj?.props.priority??(this._obj?.props.passPriority?0:Number.MAX_SAFE_INTEGER),n=>this._children.map(o=>o.materialize(n)),this._metadata,this._objFlags);return this._obj instanceof Hd.AbstractKeepWith&&(r.keepWithId=this._obj.id),r}}addMetadata(e){this._metadata.push(e)}addCacheBreakpoint(e,r=this._children.length){if(!(this._obj instanceof Hd.BaseChatMessage))throw new Error("Cache breakpoints may only be direct children of chat messages");this._children.push(new BQt({type:HK.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e.type},r))}*elements(){yield this;for(let e of this._children)e instanceof t&&(yield*e.elements())}},BQt=class{static{a(this,"PromptCacheBreakpoint")}part;childIndex;constructor(e,r){this.part=e,this.childIndex=r}toJSON(){}materialize(e){return new wq.MaterializedChatMessageBreakpoint(e,this.part)}},qxe=class t{static{a(this,"PromptText")}parent;childIndex;text;priority;metadata;lineBreakBefore;static fromJSON(e,r,n){return new t(e,r,n.text,n.priority,n.references?.map(o=>new wO(UQt.PromptReference.fromJSON(o))),n.lineBreakBefore)}kind=2;constructor(e,r,n,o,s,c=!1){this.parent=e,this.childIndex=r,this.text=n,this.priority=o,this.metadata=s,this.lineBreakBefore=c}materialize(e){let r=this.lineBreakBefore?1:this.childIndex===0?2:0;return new wq.MaterializedChatMessageTextChunk(e,this.text,this.priority??Number.MAX_SAFE_INTEGER,this.metadata||[],r)}toJSON(){return{type:2,priority:this.priority,text:this.text,references:this.metadata?.filter(e=>e instanceof wO).map(e=>e.reference.toJSON()),lineBreakBefore:this.lineBreakBefore}}};function cjo(t){return(typeof t.ctor=="function"&&t.ctor.isFragment)??!1}a(cjo,"isFragmentCtor");function hKe(t){return t!==void 0}a(hKe,"isDefined");var FQt=class extends UQt.PromptMetadata{static{a(this,"InternalMetadata")}},wO=class extends FQt{static{a(this,"ReferenceMetadata")}reference;constructor(e){super(),this.reference=e}};function ljo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(ljo,"isIterable");function lKe(t,e){let r={};for(let n of e)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}a(lKe,"pickProps");function hvn(t){return t.map(e=>typeof e=="string"?e:e?e.name||"":String(e)).join(" > ")}a(hvn,"atPath");var dvn=new WeakSet;async function fvn(t,e){try{return await e()}catch(r){throw r instanceof Error&&!dvn.has(r)&&r.constructor.name!=="CancellationError"&&(dvn.add(r),r.message+=` (at tsx element ${hvn(t.path)})`),r}}a(fvn,"annotateError")});var mvn=I(mKe=>{"use strict";p();Object.defineProperty(mKe,"__esModule",{value:!0});mKe.VSCodeTokenizer=void 0;var qQt=Eq(),jQt=class{static{a(this,"VSCodeTokenizer")}countTokens;mode=qQt.OutputMode.VSCode;constructor(e,r){if(this.countTokens=e,r!==qQt.OutputMode.VSCode)throw new Error("`mode` must be set to vscode when using vscode.LanguageModelChat as the tokenizer")}async tokenLength(e,r){return e.type===qQt.Raw.ChatCompletionContentPartKind.Text?this.countTokens(e.text,r):Promise.resolve(0)}async countMessageTokens(e){return this.countTokens(e)}};mKe.VSCodeTokenizer=jQt});var gvn=I(pue=>{"use strict";p();Object.defineProperty(pue,"__esModule",{value:!0});pue.tracerCss=pue.tracerSrc=void 0;pue.tracerSrc='"use strict";(()=>{var $,m,se,Ue,w,re,le,q,X,G,K,Ae,D={},ce=[],Re=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,J=Array.isArray;function E(t,e){for(var n in e)t[n]=e[n];return t}function ue(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function l(t,e,n){var o,r,_,c={};for(_ in e)_=="key"?o=e[_]:_=="ref"?r=e[_]:c[_]=e[_];if(arguments.length>2&&(c.children=arguments.length>3?$.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(_ in t.defaultProps)c[_]===void 0&&(c[_]=t.defaultProps[_]);return R(t,c,o,r,null)}function R(t,e,n,o,r){var _={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:r??++se,__i:-1,__u:0};return r==null&&m.vnode!=null&&m.vnode(_),_}function N(t){return t.children}function B(t,e){this.props=t,this.context=e}function I(t,e){if(e==null)return t.__?I(t.__,t.__i+1):null;for(var n;ee&&w.sort(q));O.__r=0}function pe(t,e,n,o,r,_,c,a,u,s,p){var i,f,d,b,x,C=o&&o.__k||ce,h=e.length;for(n.__d=u,Be(n,e,C),u=n.__d,i=0;i0?R(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r).__=t,r.__b=t.__b+1,_=null,(a=r.__i=Oe(r,n,c,p))!==-1&&(p--,(_=n[a])&&(_.__u|=131072)),_==null||_.__v===null?(a==-1&&i--,typeof r.type!="function"&&(r.__u|=65536)):a!==c&&(a==c-1?i--:a==c+1?i++:(a>c?i--:i++,r.__u|=65536))):r=t.__k[o]=null;if(p)for(o=0;o(u!=null&&(131072&u.__u)==0?1:0))for(;c>=0||a=0){if((u=e[c])&&(131072&u.__u)==0&&r==u.key&&_===u.type)return c;c--}if(a=n.__.length&&n.__.push({}),n.__[t]}function S(t){return V=1,Ve(Ne,t)}function Ve(t,e,n){var o=te(L++,2);if(o.t=t,!o.__c&&(o.__=[n?n(e):Ne(void 0,e),function(a){var u=o.__N?o.__N[0]:o.__[0],s=o.t(u,a);u!==s&&(o.__N=[s,o.__[1]],o.__c.setState({}))}],o.__c=g,!g.u)){var r=function(a,u,s){if(!o.__c.__H)return!0;var p=o.__c.__H.__.filter(function(f){return!!f.__c});if(p.every(function(f){return!f.__N}))return!_||_.call(this,a,u,s);var i=!1;return p.forEach(function(f){if(f.__N){var d=f.__[0];f.__=f.__N,f.__N=void 0,d!==f.__[0]&&(i=!0)}}),!(!i&&o.__c.props===a)&&(!_||_.call(this,a,u,s))};g.u=!0;var _=g.shouldComponentUpdate,c=g.componentWillUpdate;g.componentWillUpdate=function(a,u,s){if(this.__e){var p=_;_=void 0,r(a,u,s),_=p}c&&c.call(this,a,u,s)},g.shouldComponentUpdate=r}return o.__N||o.__}function Se(t,e){var n=te(L++,3);!y.__s&&Ie(n.__H,e)&&(n.__=t,n.i=e,g.__H.__h.push(n))}function we(t){return V=5,je(function(){return{current:t}},[])}function je(t,e){var n=te(L++,7);return Ie(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function qe(){for(var t;t=Ee.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(W),t.__H.__h.forEach(ee),t.__H.__h=[]}catch(e){t.__H.__h=[],y.__e(e,t.__v)}}y.__b=function(t){g=null,be&&be(t)},y.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Te&&Te(t,e)},y.__r=function(t){ye&&ye(t),L=0;var e=(g=t.__c).__H;e&&(Z===g?(e.__h=[],g.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(e.__h.forEach(W),e.__h.forEach(ee),e.__h=[],L=0)),Z=g},y.diffed=function(t){Ce&&Ce(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Ee.push(e)!==1&&ge===y.requestAnimationFrame||((ge=y.requestAnimationFrame)||Ge)(qe)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Z=g=null},y.__c=function(t,e){e.some(function(n){try{n.__h.forEach(W),n.__h=n.__h.filter(function(o){return!o.__||ee(o)})}catch(o){e.some(function(r){r.__h&&(r.__h=[])}),e=[],y.__e(o,n.__v)}}),xe&&xe(t,e)},y.unmount=function(t){ke&&ke(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{W(o)}catch(r){e=r}}),n.__H=void 0,e&&y.__e(e,n.__v))};var Me=typeof requestAnimationFrame=="function";function Ge(t){var e,n=function(){clearTimeout(o),Me&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,100);Me&&(e=requestAnimationFrame(n))}function W(t){var e=g,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),g=e}function ee(t){var e=g;t.__c=t.__(),g=e}function Ie(t,e){return!t||t.length!==e.length||e.some(function(n,o){return n!==t[o]})}function Ne(t,e){return typeof e=="function"?e(t):e}function He(t,e){let n=we(void 0),o=(...r)=>{n.current&&clearTimeout(n.current),n.current=window.setTimeout(()=>{t(...r)},e)};return Se(()=>()=>{n.current&&clearTimeout(n.current)},[]),o}var Ke=new Intl.NumberFormat("en-US"),T=({value:t})=>l(N,null,Ke.format(t));var ne=[{bg:"#c1e7ff",fg:"#000"},{bg:"#abd2ec",fg:"#000"},{bg:"#94bed9",fg:"#000"},{bg:"#7faac6",fg:"#000"},{bg:"#6996b3",fg:"#fff"},{bg:"#5383a1",fg:"#fff"},{bg:"#3d708f",fg:"#fff"},{bg:"#255e7e",fg:"#fff"}],Xe=({scoreBy:t,nodes:e,epoch:n})=>{if(e.length===0)return null;let o=t;if(t.field!=="tokens"){let r=e[0][t.field],_=e[0][t.field];for(let c=1;cr.type===2?l(Je,{scoreBy:o,key:_,node:r}):l(Le,{scoreBy:o,key:_,node:r,epoch:n})))},Fe=({node:t})=>l("div",{className:"node-stats"},"Used Tokens: ",l(T,{value:t.tokens})," / ","Priority:"," ",t.priority===Number.MAX_SAFE_INTEGER?"MAX":l(T,{value:t.priority})),De=({scoreBy:t,node:e,children:n,...o})=>{let r=0;if(t.max!==t.min){let _=(e[t.field]-t.min)/(t.max-t.min);r=Math.round((ne.length-1)*_)}return l("div",{...o,className:`node ${o.className||""}`,style:{backgroundColor:ne[r].bg,color:ne[r].fg}},n)},Je=({scoreBy:t,node:e})=>l(De,{node:e,scoreBy:t,tabIndex:0,className:"node-text"},l(Fe,{node:e}),l("div",{className:"node-content"},e.value)),Le=({scoreBy:t,node:e,epoch:n})=>{let[o,r]=S(!1),_=EPOCHS.findIndex(i=>i.elements.some(f=>f.id===e.id));if(_===void 0)throw new Error(`epoch not found for ${e.id}`);let c=EPOCHS[_],a=EPOCHS.at(n),u=c.elements.find(i=>i.id===e.id).tokenBudget,s=e.type===1?e.name||e.role.slice(0,1).toUpperCase()+e.role.slice(1)+"Message":e.name,p=_===n?"new-in-epoch":n<_?"before-epoch":"";return l(De,{node:e,scoreBy:t,className:p},l(Fe,{node:e}),l("div",{className:"node-content node-toggler",onClick:()=>r(i=>!i)},l("span",null,a?.inNode===e.id?"\\u{1F3C3} ":"",`<${s}>`),l("span",{className:"indicator"},o?"[+]":"[-]")),n===_&&l("div",{className:"node-stats"},"Token Budget: ",l(T,{value:u})),a?.inNode===e.id&&l("div",{className:"node-stats"},"Rendering flexGrow=",a.flexValue,l("br",null),l("br",null),"Splitting"," ",a.reservedTokens?`${a.tokenBudget} - ${a.reservedTokens} (reserved) = `:"",l(T,{value:a.tokenBudget})," tokens among ",a.elements.length," ","elements"),!o&&l(Xe,{nodes:e.children,scoreBy:t,epoch:n}))},Pe=({scoreBy:t,node:e,epoch:n})=>{let o;return t==="tokens"?o={field:"tokens",max:e.tokens,min:0}:o={field:"priority",max:e.priority,min:e.priority},l(Le,{scoreBy:o,node:e,epoch:n})};var ze=({label:t,value:e,onChange:n,min:o,max:r})=>{let _=a=>{n(a.target.valueAsNumber)},c=`number-slider-${Math.random()}`;return l("div",{className:"controls-slider"},l("label",{htmlFor:c},t),l("input",{id:c,type:"range",min:o,max:r,value:e,onInput:_}),l("input",{type:"number",min:o,value:e,onInput:_,onChange:_}))},Qe=({scoreBy:t,onScoreByChange:e})=>{let n=o=>{let r=o.target.value;e(r)};return l("div",{className:"controls-scoreby"},"Visualize by",l("label",null,l("input",{type:"radio",name:"scoreBy",value:"tokens",checked:t==="tokens",onChange:n}),"Tokens"),l("label",null,l("input",{type:"radio",name:"scoreBy",value:"priority",checked:t==="priority",onChange:n}),"Priority"))},Ye=()=>{let[t,e]=S(DEFAULT_TOKENS),[n,o]=S(EPOCHS.length),[r,_]=S(DEFAULT_MODEL),[c,a]=S("tokens"),[u,s]=S("epoch"),p=He(async f=>{if(f===DEFAULT_TOKENS)return DEFAULT_MODEL;let b=await(await fetch(`${SERVER_ADDRESS}regen?n=${f}`)).json();_(b)},100),i=f=>{e(f),p(f),o(EPOCHS.length)};return l("div",{className:"app"},l("div",{className:"controls"},l("div",{className:"tabs"},l("div",{className:`tab ${u==="epoch"?"active":""}`,onClick:()=>s("epoch")},"View Order"),l("div",{className:`tab ${u==="tokens"?"active":""}`,onClick:()=>s("tokens")},"Change Token Budget")),l("div",{className:`tab-content ${u==="epoch"?"active":""}`},l(ze,{label:"Render Epoch",value:n,onChange:o,min:0,max:EPOCHS.length})),l("div",{className:`tab-content ${u==="tokens"?"active":""}`},l(ze,{label:"Token Budget",value:t,onChange:i,min:0,max:DEFAULT_TOKENS*2}))),l("div",{className:"control-description"},u==="tokens"?l("p",null,"Token changes here will prune elements and re-render Expandable ones, but the entire prompt is not being re-rendered"):l("p",null,"Changing the render epoch lets you see the order in which elements are rendered and how the token budget is allocated."),l("div",{className:"controls-stats"},l("span",null,"Used ",l(T,{value:r.container.tokens}),"/",l(T,{value:r.budget})," tokens"),l("span",null,"Removed ",l(T,{value:r.removed})," nodes"),l(Qe,{scoreBy:c,onScoreByChange:a}))),l(Pe,{node:r.container,scoreBy:c,epoch:n}))};ve(l(Ye,null),document.body);})();\n';pue.tracerCss=`body{font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,system-ui,Ubuntu,Droid Sans,sans-serif;background:#fff;margin:0}.render-pass{border-left:2px solid #ccc;&:hover{border-left-color:#000}}.literals li{white-space:pre;font-family:SF Mono,Monaco,Menlo,Consolas,Ubuntu Mono,Liberation Mono,DejaVu Sans Mono,Courier New,monospace}.render-flex,.render-element{padding-left:10px}.node{border:1px solid rgba(255,255,255,.5);margin:3px 10px;padding:3px 10px;border-radius:4px;width:fit-content;&.new-in-epoch{box-shadow:0 0 3px 2px red}&.before-epoch{pointer-events:none;filter:grayscale(1);color:#777!important;.node{color:#777!important}}&:last-child{margin-bottom:0}}.node-content{font-weight:700}.node-children{margin-left:20px;border-left:2px dashed rgba(255,255,255,.5);padding-left:10px}.node-toggler{cursor:pointer;display:flex;align-items:center;justify-content:space-between;.indicator{font-size:.7em}}.node-text{width:400px;&:focus,&:focus-within{outline:1px solid orange;.node-content{white-space:normal}}.node-content{font-weight:400;font-size:.8em;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}}.node-stats{font-family:SF Mono,Monaco,Menlo,Consolas,Ubuntu Mono,Liberation Mono,DejaVu Sans Mono,Courier New,monospace;font-size:.8em}.control-description{padding:10px;p{font-size:.9em;max-width:500px;margin-top:0}}.controls{display:flex;flex-direction:column;gap:10px;position:sticky;top:0;padding:10px;background:#fff;border-bottom:1px solid #ccc;z-index:1}.controls-slider{display:flex;align-items:center;gap:10px}.controls-stats{display:flex;gap:20px;list-style:none;padding:0;margin-top:0}.controls-scoreby{display:flex;gap:10px}.tabs{display:flex;border-bottom:1px solid #ccc;margin-bottom:10px}.tab{padding:10px;cursor:pointer;border:1px solid transparent;border-bottom:none}.tab.active{border-color:#ccc;border-bottom:1px solid #fff;background-color:#f9f9f9}.tab-content{display:none}.tab-content.active{display:block} +`});var vvn=I(AKe=>{"use strict";p();Object.defineProperty(AKe,"__esModule",{value:!0});AKe.HTMLTracer=void 0;var Avn=gvn(),Rq=lQt(),ujo=Eq(),HQt=class{static{a(this,"HTMLTracer")}traceData;epochs=[];addRenderEpoch(e){this.epochs.push(e)}includeInEpoch(e){this.epochs[this.epochs.length-1].elements.push(e)}didMaterializeTree(e){this.traceData=e}async serveHTML(){return GQt.create({epochs:this.epochs,traceData:Evn(this.traceData)})}serveRouter(e){return new gKe({baseAddress:e,epochs:this.epochs,traceData:Evn(this.traceData)})}};AKe.HTMLTracer=HQt;var gKe=class{static{a(this,"RequestRouter")}opts;serverToken=crypto.randomUUID();constructor(e){this.opts=e}route(e,r){let n=e,o=r,s=new URL(n.url||"/","http://localhost"),c=`/${this.serverToken}`;switch(s.pathname){case c:case`${c}/`:this.onRoot(s,n,o);break;case`${c}/regen`:this.onRegen(s,n,o);break;default:return!1}return!0}get address(){return this.opts.baseAddress+"/"+this.serverToken}async getHTML(){let{traceData:e,epochs:r}=this.opts;return` + - `}async onRegen(e,r,n){let{traceData:o}=this.opts,s=Number(e.searchParams.get("n")||o.budget),c=await o.renderTree(s),l=await jEn(o.tokenizer,c),u=JSON.stringify(l);n.setHeader("Content-Type","application/json"),n.setHeader("Content-Length",Buffer.byteLength(u)),n.end(u)}onRoot(e,r,n){this.getHTML().then(o=>{n.setHeader("Content-Type","text/html"),n.setHeader("Content-Length",Buffer.byteLength(o)),n.end(o)})}},Z7t=class t extends jYe{static{a(this,"RequestServer")}server;static async create(e){let{createServer:r}=await Promise.resolve().then(()=>require("http")),n=r((c,l)=>{try{s.route(c,l)||(l.statusCode=404,l.end("Not Found"))}catch(u){l.statusCode=500,l.end(String(u))}}),o=await new Promise((c,l)=>{n.listen(0,"127.0.0.1",()=>c(n.address().port)).on("error",l)}),s=new t({...e,baseAddress:`http://127.0.0.1:${o}`},n);return s}constructor(e,r){super(e),this.server=r}dispose(){this.server.closeAllConnections(),this.server.close()}};async function jEn(t,e){return{container:await GEn(t,e.container,!1),removed:e.removed,budget:e.budget}}a(jEn,"serializeRenderData");async function GEn(t,e,r){let n={metadata:e.metadata.map(aQo),priority:e.priority};if(e instanceof gq.MaterializedChatMessageTextChunk)return{...n,type:2,value:e.text,tokens:await e.upperBoundTokenCount(t)};if(e instanceof gq.MaterializedChatMessageImage)return{...n,name:e.id.toString(),id:e.id,type:3,value:e.src,tokens:await e.upperBoundTokenCount(t)};if(e instanceof gq.MaterializedChatMessageOpaque||e instanceof gq.MaterializedChatMessageBreakpoint||e instanceof gq.MaterializedChatMessageDocument)return;{let o={...n,id:e.id,name:e.name,children:(await Promise.all(e.children.map(s=>GEn(t,s,r||e instanceof gq.MaterializedChatMessage)))).filter(s=>!!s),tokens:r?await e.upperBoundTokenCount(t):await e.tokenCount(t)};if(e instanceof gq.GenericMaterializedContainer)return{...o,type:0};if(e instanceof gq.MaterializedChatMessage){let s=e.text.filter(c=>typeof c=="string").join("").trim();return{...o,type:1,role:oQo.Raw.ChatRole.display(e.role),text:s}}}sQo(e)}a(GEn,"serializeMaterialized");function sQo(t){throw new Error("unreachable")}a(sQo,"assertNever");function aQo(t){return{name:t.constructor.name,value:JSON.stringify(t)}}a(aQo,"serializeMetadata");var HEn=a(t=>{if(t===void 0)throw new Error("Prompt must be rendered before calling HTMLTRacer.serveHTML");return t},"mustGet")});var WEn=I(VEn=>{"use strict";p();Object.defineProperty(VEn,"__esModule",{value:!0})});var YEn=I(zEn=>{"use strict";p();Object.defineProperty(zEn,"__esModule",{value:!0})});var JEn=I(KEn=>{"use strict";p();Object.defineProperty(KEn,"__esModule",{value:!0})});var Io=I(ed=>{"use strict";p();var cQo=ed&&ed.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),MK=ed&&ed.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cQo(e,t,r)};Object.defineProperty(ed,"__esModule",{value:!0});ed.contentType=ed.PromptRenderer=ed.MetadataMap=ed.PromptElement=ed.JSONTree=void 0;ed.renderPrompt=dQo;ed.renderElementJSON=fQo;var X7t=sq(),ZEn=z7t(),lQo=UEn();MK($En(),ed);ed.JSONTree=f7t();MK(sq(),ed);MK(k7t(),ed);MK(Q7t(),ed);MK(WEn(),ed);MK(YEn(),ed);MK(JEn(),ed);var uQo=E7t();Object.defineProperty(ed,"PromptElement",{enumerable:!0,get:a(function(){return uQo.PromptElement},"get")});var XEn=z7t();Object.defineProperty(ed,"MetadataMap",{enumerable:!0,get:a(function(){return XEn.MetadataMap},"get")});Object.defineProperty(ed,"PromptRenderer",{enumerable:!0,get:a(function(){return XEn.PromptRenderer},"get")});async function dQo(t,e,r,n,o,s,c=X7t.OutputMode.VSCode){let l="countTokens"in n?new lQo.VSCodeTokenizer((h,m)=>n.countTokens(h,m),c):n,u=new ZEn.PromptRenderer(r,t,e,l),d=await u.render(o,s),f=u.getUsedContext();return{...d,usedContext:f}}a(dQo,"renderPrompt");ed.contentType="application/vnd.codechat.prompt+json.1";function fQo(t,e,r,n){return new ZEn.PromptRenderer({modelMaxPromptTokens:r?.tokenBudget??Number.MAX_SAFE_INTEGER},t,e,{mode:X7t.OutputMode.Raw,countMessageTokens(s){throw new Error("Tools may only return text, not messages.")},tokenLength(s,c){return s.type===X7t.Raw.ChatCompletionContentPartKind.Text?Promise.resolve(r?.countTokens(s.text,c)??Promise.resolve(1)):Promise.resolve(1)}}).renderElementJSON(n)}a(fQo,"renderElementJSON")});var cCn=I((Asd,Uxe)=>{"use strict";p();var eJe=a(function(){},"NullObject");eJe.prototype=Object.create(null);var ZKe=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,XKe=/\\([\v\u0020-\u00ff])/gu,oCn=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,GK={type:"",parameters:new eJe};Object.freeze(GK.parameters);Object.freeze(GK);function sCn(t){if(typeof t!="string")throw new TypeError("argument header is required and must be a string");let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(oCn.test(r)===!1)throw new TypeError("invalid media type");let n={type:r.toLowerCase(),parameters:new eJe};if(e===-1)return n;let o,s,c;for(ZKe.lastIndex=e;s=ZKe.exec(t);){if(s.index!==e)throw new TypeError("invalid parameter format");e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),XKe.test(c)&&(c=c.replace(XKe,"$1"))),n.parameters[o]=c}if(e!==t.length)throw new TypeError("invalid parameter format");return n}a(sCn,"parse");function aCn(t){if(typeof t!="string")return GK;let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(oCn.test(r)===!1)return GK;let n={type:r.toLowerCase(),parameters:new eJe};if(e===-1)return n;let o,s,c;for(ZKe.lastIndex=e;s=ZKe.exec(t);){if(s.index!==e)return GK;e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),XKe.test(c)&&(c=c.replace(XKe,"$1"))),n.parameters[o]=c}return e!==t.length?GK:n}a(aCn,"safeParse");Uxe.exports.default={parse:sCn,safeParse:aCn};Uxe.exports.parse=sCn;Uxe.exports.safeParse=aCn;Uxe.exports.defaultContentType=GK});var xq=I(Eg=>{"use strict";p();Object.defineProperty(Eg,"__esModule",{value:!0});Eg.MonotonousArray=void 0;Eg.findLast=jHo;Eg.findLastIdx=tbn;Eg.findFirst=HHo;Eg.findFirstIdx=rbn;Eg.findLastMonotonous=GHo;Eg.findLastIdxMonotonous=Fqt;Eg.findFirstMonotonous=$Ho;Eg.findFirstIdxMonotonousOrArrLen=Uqt;Eg.findFirstIdxMonotonous=VHo;Eg.findFirstMax=nbn;Eg.findLastMax=WHo;Eg.findFirstMin=zHo;Eg.findMaxIdx=YHo;Eg.mapFindFirst=KHo;function jHo(t,e,r=t.length-1){let n=tbn(t,e,r);if(n!==-1)return t[n]}a(jHo,"findLast");function tbn(t,e,r=t.length-1){for(let n=r;n>=0;n--){let o=t[n];if(e(o,n))return n}return-1}a(tbn,"findLastIdx");function HHo(t,e,r=0){let n=rbn(t,e,r);if(n!==-1)return t[n]}a(HHo,"findFirst");function rbn(t,e,r=0){for(let n=r;n0&&(r=o)}return r}a(nbn,"findFirstMax");function WHo(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n=0&&(r=o)}return r}a(WHo,"findLastMax");function zHo(t,e){return nbn(t,(r,n)=>-e(r,n))}a(zHo,"findFirstMin");function YHo(t,e){if(t.length===0)return-1;let r=0;for(let n=1;n0&&(r=n)}return r}a(YHo,"findMaxIdx");function KHo(t,e){for(let r of t){let n=e(r);if(n!==void 0)return n}}a(KHo,"mapFindFirst")});var Rs=I(wo=>{"use strict";p();Object.defineProperty(wo,"__esModule",{value:!0});wo.BugIndicatingError=wo.ErrorNoTelemetry=wo.ExpectedError=wo.NotSupportedError=wo.NotImplementedError=wo.ReadonlyError=wo.PendingMigrationError=wo.CancellationError=wo.canceledName=wo.errorHandler=wo.ErrorHandler=void 0;wo.setUnexpectedErrorHandler=JHo;wo.isSigPipeError=ZHo;wo.onBugIndicatingError=XHo;wo.onUnexpectedError=eGo;wo.onUnexpectedExternalError=tGo;wo.transformErrorForSerialization=ibn;wo.transformErrorFromSerialization=obn;wo.isCancellationError=Vqt;wo.canceled=rGo;wo.illegalArgument=nGo;wo.illegalState=iGo;wo.getErrorMessage=oGo;var SJe=class{static{a(this,"ErrorHandler")}constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?zK.isErrorNoTelemetry(e)?new zK(e.message+` + `}async onRegen(e,r,n){let{traceData:o}=this.opts,s=Number(e.searchParams.get("n")||o.budget),c=await o.renderTree(s),l=await yvn(o.tokenizer,c),u=JSON.stringify(l);n.setHeader("Content-Type","application/json"),n.setHeader("Content-Length",Buffer.byteLength(u)),n.end(u)}onRoot(e,r,n){this.getHTML().then(o=>{n.setHeader("Content-Type","text/html"),n.setHeader("Content-Length",Buffer.byteLength(o)),n.end(o)})}},GQt=class t extends gKe{static{a(this,"RequestServer")}server;static async create(e){let{createServer:r}=await Promise.resolve().then(()=>require("http")),n=r((c,l)=>{try{s.route(c,l)||(l.statusCode=404,l.end("Not Found"))}catch(u){l.statusCode=500,l.end(String(u))}}),o=await new Promise((c,l)=>{n.listen(0,"127.0.0.1",()=>c(n.address().port)).on("error",l)}),s=new t({...e,baseAddress:`http://127.0.0.1:${o}`},n);return s}constructor(e,r){super(e),this.server=r}dispose(){this.server.closeAllConnections(),this.server.close()}};async function yvn(t,e){return{container:await _vn(t,e.container,!1),removed:e.removed,budget:e.budget}}a(yvn,"serializeRenderData");async function _vn(t,e,r){let n={metadata:e.metadata.map(fjo),priority:e.priority};if(e instanceof Rq.MaterializedChatMessageTextChunk)return{...n,type:2,value:e.text,tokens:await e.upperBoundTokenCount(t)};if(e instanceof Rq.MaterializedChatMessageImage)return{...n,name:e.id.toString(),id:e.id,type:3,value:e.src,tokens:await e.upperBoundTokenCount(t)};if(e instanceof Rq.MaterializedChatMessageOpaque||e instanceof Rq.MaterializedChatMessageBreakpoint||e instanceof Rq.MaterializedChatMessageDocument)return;{let o={...n,id:e.id,name:e.name,children:(await Promise.all(e.children.map(s=>_vn(t,s,r||e instanceof Rq.MaterializedChatMessage)))).filter(s=>!!s),tokens:r?await e.upperBoundTokenCount(t):await e.tokenCount(t)};if(e instanceof Rq.GenericMaterializedContainer)return{...o,type:0};if(e instanceof Rq.MaterializedChatMessage){let s=e.text.filter(c=>typeof c=="string").join("").trim();return{...o,type:1,role:ujo.Raw.ChatRole.display(e.role),text:s}}}djo(e)}a(_vn,"serializeMaterialized");function djo(t){throw new Error("unreachable")}a(djo,"assertNever");function fjo(t){return{name:t.constructor.name,value:JSON.stringify(t)}}a(fjo,"serializeMetadata");var Evn=a(t=>{if(t===void 0)throw new Error("Prompt must be rendered before calling HTMLTRacer.serveHTML");return t},"mustGet")});var bvn=I(Cvn=>{"use strict";p();Object.defineProperty(Cvn,"__esModule",{value:!0})});var Tvn=I(Svn=>{"use strict";p();Object.defineProperty(Svn,"__esModule",{value:!0})});var xvn=I(Ivn=>{"use strict";p();Object.defineProperty(Ivn,"__esModule",{value:!0})});var Io=I(nd=>{"use strict";p();var pjo=nd&&nd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),GK=nd&&nd.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pjo(e,t,r)};Object.defineProperty(nd,"__esModule",{value:!0});nd.contentType=nd.PromptRenderer=nd.MetadataMap=nd.PromptElement=nd.JSONTree=void 0;nd.renderPrompt=gjo;nd.renderElementJSON=Ajo;var $Qt=Eq(),wvn=QQt(),hjo=mvn();GK(vvn(),nd);nd.JSONTree=iQt();GK(Eq(),nd);GK(CQt(),nd);GK(DQt(),nd);GK(bvn(),nd);GK(Tvn(),nd);GK(xvn(),nd);var mjo=dQt();Object.defineProperty(nd,"PromptElement",{enumerable:!0,get:a(function(){return mjo.PromptElement},"get")});var Rvn=QQt();Object.defineProperty(nd,"MetadataMap",{enumerable:!0,get:a(function(){return Rvn.MetadataMap},"get")});Object.defineProperty(nd,"PromptRenderer",{enumerable:!0,get:a(function(){return Rvn.PromptRenderer},"get")});async function gjo(t,e,r,n,o,s,c=$Qt.OutputMode.VSCode){let l="countTokens"in n?new hjo.VSCodeTokenizer((h,m)=>n.countTokens(h,m),c):n,u=new wvn.PromptRenderer(r,t,e,l),d=await u.render(o,s),f=u.getUsedContext();return{...d,usedContext:f}}a(gjo,"renderPrompt");nd.contentType="application/vnd.codechat.prompt+json.1";function Ajo(t,e,r,n){return new wvn.PromptRenderer({modelMaxPromptTokens:r?.tokenBudget??Number.MAX_SAFE_INTEGER},t,e,{mode:$Qt.OutputMode.Raw,countMessageTokens(s){throw new Error("Tools may only return text, not messages.")},tokenLength(s,c){return s.type===$Qt.Raw.ChatCompletionContentPartKind.Text?Promise.resolve(r?.countTokens(s.text,c)??Promise.resolve(1)):Promise.resolve(1)}}).renderElementJSON(n)}a(Ajo,"renderElementJSON")});var Fbn=I((yld,iwe)=>{"use strict";p();var wJe=a(function(){},"NullObject");wJe.prototype=Object.create(null);var IJe=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,xJe=/\\([\v\u0020-\u00ff])/gu,Obn=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,eJ={type:"",parameters:new wJe};Object.freeze(eJ.parameters);Object.freeze(eJ);function Lbn(t){if(typeof t!="string")throw new TypeError("argument header is required and must be a string");let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(Obn.test(r)===!1)throw new TypeError("invalid media type");let n={type:r.toLowerCase(),parameters:new wJe};if(e===-1)return n;let o,s,c;for(IJe.lastIndex=e;s=IJe.exec(t);){if(s.index!==e)throw new TypeError("invalid parameter format");e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),xJe.test(c)&&(c=c.replace(xJe,"$1"))),n.parameters[o]=c}if(e!==t.length)throw new TypeError("invalid parameter format");return n}a(Lbn,"parse");function Bbn(t){if(typeof t!="string")return eJ;let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(Obn.test(r)===!1)return eJ;let n={type:r.toLowerCase(),parameters:new wJe};if(e===-1)return n;let o,s,c;for(IJe.lastIndex=e;s=IJe.exec(t);){if(s.index!==e)return eJ;e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),xJe.test(c)&&(c=c.replace(xJe,"$1"))),n.parameters[o]=c}return e!==t.length?eJ:n}a(Bbn,"safeParse");iwe.exports.default={parse:Lbn,safeParse:Bbn};iwe.exports.parse=Lbn;iwe.exports.safeParse=Bbn;iwe.exports.defaultContentType=eJ});var Qq=I(bg=>{"use strict";p();Object.defineProperty(bg,"__esModule",{value:!0});bg.MonotonousArray=void 0;bg.findLast=W$o;bg.findLastIdx=P1n;bg.findFirst=z$o;bg.findFirstIdx=D1n;bg.findLastMonotonous=Y$o;bg.findLastIdxMonotonous=kjt;bg.findFirstMonotonous=K$o;bg.findFirstIdxMonotonousOrArrLen=Pjt;bg.findFirstIdxMonotonous=J$o;bg.findFirstMax=N1n;bg.findLastMax=Z$o;bg.findFirstMin=X$o;bg.findMaxIdx=eVo;bg.mapFindFirst=tVo;function W$o(t,e,r=t.length-1){let n=P1n(t,e,r);if(n!==-1)return t[n]}a(W$o,"findLast");function P1n(t,e,r=t.length-1){for(let n=r;n>=0;n--){let o=t[n];if(e(o,n))return n}return-1}a(P1n,"findLastIdx");function z$o(t,e,r=0){let n=D1n(t,e,r);if(n!==-1)return t[n]}a(z$o,"findFirst");function D1n(t,e,r=0){for(let n=r;n0&&(r=o)}return r}a(N1n,"findFirstMax");function Z$o(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n=0&&(r=o)}return r}a(Z$o,"findLastMax");function X$o(t,e){return N1n(t,(r,n)=>-e(r,n))}a(X$o,"findFirstMin");function eVo(t,e){if(t.length===0)return-1;let r=0;for(let n=1;n0&&(r=n)}return r}a(eVo,"findMaxIdx");function tVo(t,e){for(let r of t){let n=e(r);if(n!==void 0)return n}}a(tVo,"mapFindFirst")});var Rs=I(wo=>{"use strict";p();Object.defineProperty(wo,"__esModule",{value:!0});wo.BugIndicatingError=wo.ErrorNoTelemetry=wo.ExpectedError=wo.NotSupportedError=wo.NotImplementedError=wo.ReadonlyError=wo.PendingMigrationError=wo.CancellationError=wo.canceledName=wo.errorHandler=wo.ErrorHandler=void 0;wo.setUnexpectedErrorHandler=rVo;wo.isSigPipeError=nVo;wo.onBugIndicatingError=iVo;wo.onUnexpectedError=oVo;wo.onUnexpectedExternalError=sVo;wo.transformErrorForSerialization=M1n;wo.transformErrorFromSerialization=O1n;wo.isCancellationError=Fjt;wo.canceled=aVo;wo.illegalArgument=cVo;wo.illegalState=lVo;wo.getErrorMessage=uVo;var ZJe=class{static{a(this,"ErrorHandler")}constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?iJ.isErrorNoTelemetry(e)?new iJ(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(r=>{r(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};wo.ErrorHandler=SJe;wo.errorHandler=new SJe;function JHo(t){wo.errorHandler.setUnexpectedErrorHandler(t)}a(JHo,"setUnexpectedErrorHandler");function ZHo(t){if(!t||typeof t!="object")return!1;let e=t;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}a(ZHo,"isSigPipeError");function XHo(t){wo.errorHandler.onUnexpectedError(t)}a(XHo,"onBugIndicatingError");function eGo(t){Vqt(t)||wo.errorHandler.onUnexpectedError(t)}a(eGo,"onUnexpectedError");function tGo(t){Vqt(t)||wo.errorHandler.onUnexpectedExternalError(t)}a(tGo,"onUnexpectedExternalError");function ibn(t){if(t instanceof Error){let{name:e,message:r,cause:n}=t,o=t.stacktrace||t.stack;return{$isError:!0,name:e,message:r,stack:o,noTelemetry:zK.isErrorNoTelemetry(t),cause:n?ibn(n):void 0,code:t.code}}return t}a(ibn,"transformErrorForSerialization");function obn(t){let e;return t.noTelemetry?e=new zK:(e=new Error,e.name=t.name),e.message=t.message,e.stack=t.stack,t.code&&(e.code=t.code),t.cause&&(e.cause=obn(t.cause)),e}a(obn,"transformErrorFromSerialization");wo.canceledName="Canceled";function Vqt(t){return t instanceof TJe?!0:t instanceof Error&&t.name===wo.canceledName&&t.message===wo.canceledName}a(Vqt,"isCancellationError");var TJe=class extends Error{static{a(this,"CancellationError")}constructor(){super(wo.canceledName),this.name=this.message}};wo.CancellationError=TJe;var Qqt=class t extends Error{static{a(this,"PendingMigrationError")}static{this._name="PendingMigrationError"}static is(e){return e instanceof t||e instanceof Error&&e.name===t._name}constructor(e){super(e),this.name=t._name}};wo.PendingMigrationError=Qqt;function rGo(){let t=new Error(wo.canceledName);return t.name=t.message,t}a(rGo,"canceled");function nGo(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}a(nGo,"illegalArgument");function iGo(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}a(iGo,"illegalState");var qqt=class extends TypeError{static{a(this,"ReadonlyError")}constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}};wo.ReadonlyError=qqt;function oGo(t){return t?t.message?t.message:t.stack?t.stack.split(` -`)[0]:String(t):"Error"}a(oGo,"getErrorMessage");var jqt=class extends Error{static{a(this,"NotImplementedError")}constructor(e){super("NotImplemented"),e&&(this.message=e)}};wo.NotImplementedError=jqt;var Hqt=class extends Error{static{a(this,"NotSupportedError")}constructor(e){super("NotSupported"),e&&(this.message=e)}};wo.NotSupportedError=Hqt;var Gqt=class extends Error{static{a(this,"ExpectedError")}constructor(){super(...arguments),this.isExpected=!0}};wo.ExpectedError=Gqt;var zK=class t extends Error{static{a(this,"ErrorNoTelemetry")}constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof t)return e;let r=new t;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};wo.ErrorNoTelemetry=zK;var $qt=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};wo.BugIndicatingError=$qt});var Sl=I(Wn=>{"use strict";p();Object.defineProperty(Wn,"__esModule",{value:!0});Wn.Permutation=Wn.CallbackIterable=Wn.ArrayQueue=Wn.booleanComparator=Wn.numberComparator=Wn.CompareResult=void 0;Wn.tail=cGo;Wn.equals=lGo;Wn.removeFastWithoutKeepingOrder=uGo;Wn.binarySearch=dGo;Wn.binarySearch2=sbn;Wn.quickSelect=Wqt;Wn.groupBy=fGo;Wn.groupAdjacentBy=pGo;Wn.forEachAdjacent=hGo;Wn.forEachWithNeighbors=mGo;Wn.concatArrays=gGo;Wn.sortedDiff=abn;Wn.delta=AGo;Wn.top=yGo;Wn.topAsync=EGo;Wn.coalesce=_Go;Wn.coalesceInPlace=vGo;Wn.move=CGo;Wn.isFalsyOrEmpty=bGo;Wn.isNonEmptyArray=SGo;Wn.distinct=TGo;Wn.uniqueFilter=IGo;Wn.commonPrefixLength=xGo;Wn.range=wGo;Wn.index=RGo;Wn.insert=kGo;Wn.remove=lbn;Wn.arrayInsert=PGo;Wn.shuffle=DGo;Wn.pushToStart=NGo;Wn.pushToEnd=MGo;Wn.pushMany=OGo;Wn.mapArrayOrNot=LGo;Wn.mapFilter=BGo;Wn.withoutDuplicates=FGo;Wn.asArray=UGo;Wn.getRandomElement=QGo;Wn.insertInto=ubn;Wn.splice=qGo;Wn.compareBy=jGo;Wn.tieBreakComparators=HGo;Wn.reverseOrder=VGo;Wn.compareUndefinedSmallest=WGo;Wn.findAsync=zGo;Wn.sum=YGo;Wn.sumBy=KGo;var sGo=xq(),aGo=Rs();function cGo(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}a(cGo,"tail");function lGo(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;nr(t[n],e))}a(dGo,"binarySearch");function sbn(t,e){let r=0,n=t-1;for(;r<=n;){let o=(r+n)/2|0,s=e(o);if(s<0)r=o+1;else if(s>0)n=o-1;else return o}return-(r+1)}a(sbn,"binarySearch2");function Wqt(t,e,r){if(t=t|0,t>=e.length)throw new TypeError("invalid index");let n=e[Math.floor(e.length*Math.random())],o=[],s=[],c=[];for(let l of e){let u=r(l,n);u<0?o.push(l):u>0?s.push(l):c.push(l)}return t0&&(o(s,0,[u]),c+=1)}return n}a(abn,"sortedDiff");function AGo(t,e,r){let n=abn(t,e,r),o=[],s=[];for(let c of n)o.push(...t.slice(c.start,c.start+c.deleteCount)),s.push(...c.toInsert);return{removed:o,added:s}}a(AGo,"delta");function yGo(t,e,r){if(r===0)return[];let n=t.slice(0,r).sort(e);return cbn(t,e,n,r,t.length),n}a(yGo,"top");function EGo(t,e,r,n,o){return r===0?Promise.resolve([]):new Promise((s,c)=>{(async()=>{let l=t.length,u=t.slice(0,r).sort(e);for(let d=r,f=Math.min(r+n,l);dr&&await new Promise(h=>setTimeout(h)),o&&o.isCancellationRequested)throw new aGo.CancellationError;cbn(t,e,u,d,f)}return u})().then(s,c)})}a(EGo,"topAsync");function cbn(t,e,r,n,o){for(let s=r.length;ne(c,u)<0);r.splice(l,0,c)}}}a(cbn,"topStep");function _Go(t){return t.filter(e=>!!e)}a(_Go,"coalesce");function vGo(t){let e=0;for(let r=0;r0}a(SGo,"isNonEmptyArray");function TGo(t,e=r=>r){let r=new Set;return t.filter(n=>{let o=e(n);return r.has(o)?!1:(r.add(o),!0)})}a(TGo,"distinct");function IGo(t){let e=new Set;return r=>{let n=t(r);return e.has(n)?!1:(e.add(n),!0)}}a(IGo,"uniqueFilter");function xGo(t,e,r=(n,o)=>n===o){let n=0;for(let o=0,s=Math.min(t.length,e.length);oe;o--)n.push(o);return n}a(wGo,"range");function RGo(t,e,r){return t.reduce((n,o)=>(n[e(o)]=r?r(o):o,n),Object.create(null))}a(RGo,"index");function kGo(t,e){return t.push(e),()=>lbn(t,e)}a(kGo,"insert");function lbn(t,e){let r=t.indexOf(e);if(r>-1)return t.splice(r,1),e}a(lbn,"remove");function PGo(t,e,r){let n=t.slice(0,e),o=t.slice(e);return n.concat(r,o)}a(PGo,"arrayInsert");function DGo(t,e){let r;if(typeof e=="number"){let n=e;r=a(()=>{let o=Math.sin(n++)*179426549;return o-Math.floor(o)},"rand")}else r=Math.random;for(let n=t.length-1;n>0;n-=1){let o=Math.floor(r()*(n+1)),s=t[n];t[n]=t[o],t[o]=s}}a(DGo,"shuffle");function NGo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.unshift(e))}a(NGo,"pushToStart");function MGo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.push(e))}a(MGo,"pushToEnd");function OGo(t,e){for(let r of e)t.push(r)}a(OGo,"pushMany");function LGo(t,e){return Array.isArray(t)?t.map(e):e(t)}a(LGo,"mapArrayOrNot");function BGo(t,e){let r=[];for(let n of t){let o=e(n);o!==void 0&&r.push(o)}return r}a(BGo,"mapFilter");function FGo(t){let e=new Set(t);return Array.from(e)}a(FGo,"withoutDuplicates");function UGo(t){return Array.isArray(t)?t:[t]}a(UGo,"asArray");function QGo(t){return t[Math.floor(Math.random()*t.length)]}a(QGo,"getRandomElement");function ubn(t,e,r){let n=dbn(t,e),o=t.length,s=r.length;t.length=o+s;for(let c=o-1;c>=n;c--)t[c+s]=t[c];for(let c=0;c0}a(n,"isGreaterThan"),t.isGreaterThan=n;function o(s){return s===0}a(o,"isNeitherLessOrGreaterThan"),t.isNeitherLessOrGreaterThan=o,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(wq||(Wn.CompareResult=wq={}));function jGo(t,e){return(r,n)=>e(t(r),t(n))}a(jGo,"compareBy");function HGo(...t){return(e,r)=>{for(let n of t){let o=n(e,r);if(!wq.isNeitherLessOrGreaterThan(o))return o}return wq.neitherLessOrGreaterThan}}a(HGo,"tieBreakComparators");var GGo=a((t,e)=>t-e,"numberComparator");Wn.numberComparator=GGo;var $Go=a((t,e)=>(0,Wn.numberComparator)(t?1:0,e?1:0),"booleanComparator");Wn.booleanComparator=$Go;function VGo(t){return(e,r)=>-t(e,r)}a(VGo,"reverseOrder");function WGo(t){return(e,r)=>e===void 0?r===void 0?wq.neitherLessOrGreaterThan:wq.lessThan:r===void 0?wq.greaterThan:t(e,r)}a(WGo,"compareUndefinedSmallest");var zqt=class{static{a(this,"ArrayQueue")}constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let r=this.firstIdx;for(;r=0&&e(this.items[r]);)r--;let n=r===this.lastIdx?null:this.items.slice(r+1,this.lastIdx+1);return this.lastIdx=r,n}peek(){if(this.length!==0)return this.items[this.firstIdx]}peekLast(){if(this.length!==0)return this.items[this.lastIdx]}dequeue(){let e=this.items[this.firstIdx];return this.firstIdx++,e}removeLast(){let e=this.items[this.lastIdx];return this.lastIdx--,e}takeCount(e){let r=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,r}};Wn.ArrayQueue=zqt;var Yqt=class t{static{a(this,"CallbackIterable")}static{this.empty=new t(e=>{})}constructor(e){this.iterate=e}forEach(e){this.iterate(r=>(e(r),!0))}toArray(){let e=[];return this.iterate(r=>(e.push(r),!0)),e}filter(e){return new t(r=>this.iterate(n=>e(n)?r(n):!0))}map(e){return new t(r=>this.iterate(n=>r(e(n))))}some(e){let r=!1;return this.iterate(n=>(r=e(n),!r)),r}findFirst(e){let r;return this.iterate(n=>e(n)?(r=n,!1):!0),r}findLast(e){let r;return this.iterate(n=>(e(n)&&(r=n),!0)),r}findLastMaxBy(e){let r,n=!0;return this.iterate(o=>((n||wq.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};Wn.CallbackIterable=Yqt;var Kqt=class t{static{a(this,"Permutation")}constructor(e){this._indexMap=e}static createSortPermutation(e,r){let n=Array.from(e.keys()).sort((o,s)=>r(e[o],e[s]));return new t(n)}apply(e){return e.map((r,n)=>e[this._indexMap[n]])}inverse(){let e=this._indexMap.slice();for(let r=0;r({element:n,ok:await e(n,o)})))).find(n=>n.ok)?.element}a(zGo,"findAsync");function YGo(t){return t.reduce((e,r)=>e+r,0)}a(YGo,"sum");function KGo(t,e){return t.reduce((r,n)=>r+e(n),0)}a(KGo,"sumBy")});var Xqt=I(V3=>{"use strict";p();var pbn;Object.defineProperty(V3,"__esModule",{value:!0});V3.SetWithKey=void 0;V3.groupBy=XGo;V3.groupByMap=e$o;V3.diffSets=t$o;V3.diffMaps=r$o;V3.intersection=n$o;function XGo(t,e){let r=Object.create(null);for(let n of t){let o=e(n),s=r[o];s||(s=r[o]=[]),s.push(n)}return r}a(XGo,"groupBy");function e$o(t,e){let r=new Map;for(let n of t){let o=e(n),s=r.get(o);s||(s=[],r.set(o,s)),s.push(n)}return r}a(e$o,"groupByMap");function t$o(t,e){let r=[],n=[];for(let o of t)e.has(o)||r.push(o);for(let o of e)t.has(o)||n.push(o);return{removed:r,added:n}}a(t$o,"diffSets");function r$o(t,e){let r=[],n=[];for(let[o,s]of t)e.has(o)||r.push(s);for(let[o,s]of e)t.has(o)||n.push(s);return{removed:r,added:n}}a(r$o,"diffMaps");function n$o(t,e){let r=new Set;for(let n of e)t.has(n)&&r.add(n);return r}a(n$o,"intersection");var Zqt=class{static{a(this,"SetWithKey")}static{pbn=Symbol.toStringTag}constructor(e,r){this.toKey=r,this._map=new Map,this[pbn]="SetWithKey";for(let n of e)this.add(n)}get size(){return this._map.size}add(e){let r=this.toKey(e);return this._map.set(r,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,r){this._map.forEach(n=>e.call(r,n,n,this))}[Symbol.iterator](){return this.values()}};V3.SetWithKey=Zqt});var tjt=I(ejt=>{"use strict";p();Object.defineProperty(ejt,"__esModule",{value:!0});ejt.createSingleCallFunction=i$o;function i$o(t,e){let r=this,n=!1,o;return function(){if(n)return o;if(n=!0,e)try{o=t.apply(r,arguments)}finally{e()}else o=t.apply(r,arguments);return o}}a(i$o,"createSingleCallFunction")});var zP=I(Ud=>{"use strict";p();var hbn,mbn,gbn;Object.defineProperty(Ud,"__esModule",{value:!0});Ud.NKeyMap=Ud.SetMap=Ud.BidirectionalMap=Ud.CounterSet=Ud.MRUCache=Ud.LRUCache=Ud.LinkedMap=Ud.ResourceSet=Ud.ResourceMap=void 0;Ud.getOrSet=o$o;Ud.mapToString=s$o;Ud.setToString=a$o;Ud.mapsStrictEqualIgnoreOrder=l$o;function o$o(t,e,r){let n=t.get(e);return n===void 0&&(n=r,t.set(e,n)),n}a(o$o,"getOrSet");function s$o(t){let e=[];return t.forEach((r,n)=>{e.push(`${n} => ${r}`)}),`Map(${t.size}) {${e.join(", ")}}`}a(s$o,"mapToString");function a$o(t){let e=[];return t.forEach(r=>{e.push(r)}),`Set(${t.size}) {${e.join(", ")}}`}a(a$o,"setToString");var rjt=class{static{a(this,"ResourceMapEntry")}constructor(e,r){this.uri=e,this.value=r}};function c$o(t){return Array.isArray(t)}a(c$o,"isEntries");var Jxe=class t{static{a(this,"ResourceMap")}static{this.defaultToKey=e=>e.toString()}constructor(e,r){if(this[hbn]="ResourceMap",e instanceof t)this.map=new Map(e.map),this.toKey=r??t.defaultToKey;else if(c$o(e)){this.map=new Map,this.toKey=r??t.defaultToKey;for(let[n,o]of e)this.set(n,o)}else this.map=new Map,this.toKey=e??t.defaultToKey}set(e,r){return this.map.set(this.toKey(e),new rjt(e,r)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,r){typeof r<"u"&&(e=e.bind(r));for(let[n,o]of this.map)e(o.value,o.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(hbn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};Ud.ResourceMap=Jxe;var njt=class{static{a(this,"ResourceSet")}constructor(e,r){this[mbn]="ResourceSet",!e||typeof e=="function"?this._map=new Jxe(e):(this._map=new Jxe(r),e.forEach(this.add,this))}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,r){this._map.forEach((n,o)=>e.call(r,o,o,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(mbn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};Ud.ResourceSet=njt;var IJe=class{static{a(this,"LinkedMap")}constructor(){this[gbn]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=0){let n=this._map.get(e);if(n)return r!==0&&this.touch(n,r),n.value}set(e,r,n=0){let o=this._map.get(e);if(o)o.value=r,n!==0&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.key,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}values(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.value,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}entries(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:[n.key,n.value],done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}[(gbn=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._tail,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.previous,n--;this._tail=r,this._size=n,r&&(r.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==1&&r!==2)){if(r===1){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===2){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Ud.LinkedMap=IJe;var xJe=class extends IJe{static{a(this,"Cache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=2){return super.get(e,r)}peek(e){return super.get(e,0)}set(e,r){return super.set(e,r,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},ijt=class extends xJe{static{a(this,"LRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimOld(e)}set(e,r){return super.set(e,r),this.checkTrim(),this}};Ud.LRUCache=ijt;var ojt=class extends xJe{static{a(this,"MRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimNew(e)}set(e,r){return this._limit<=this.size&&!this.has(e)&&this.trim(Math.round(this._limit*this._ratio)-1),super.set(e,r),this}};Ud.MRUCache=ojt;var sjt=class{static{a(this,"CounterSet")}constructor(){this.map=new Map}add(e){return this.map.set(e,(this.map.get(e)||0)+1),this}delete(e){let r=this.map.get(e)||0;return r===0?!1:(r--,r===0?this.map.delete(e):this.map.set(e,r),!0)}has(e){return this.map.has(e)}};Ud.CounterSet=sjt;var ajt=class{static{a(this,"BidirectionalMap")}constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(let[r,n]of e)this.set(r,n)}clear(){this._m1.clear(),this._m2.clear()}set(e,r){this._m1.set(e,r),this._m2.set(r,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){let r=this._m1.get(e);return r===void 0?!1:(this._m1.delete(e),this._m2.delete(r),!0)}forEach(e,r){this._m1.forEach((n,o)=>{e.call(r,n,o,this)})}keys(){return this._m1.keys()}values(){return this._m1.values()}};Ud.BidirectionalMap=ajt;var cjt=class{static{a(this,"SetMap")}constructor(){this.map=new Map}add(e,r){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(r)}delete(e,r){let n=this.map.get(e);n&&(n.delete(r),n.size===0&&this.map.delete(e))}forEach(e,r){let n=this.map.get(e);n&&n.forEach(r)}get(e){let r=this.map.get(e);return r||new Set}};Ud.SetMap=cjt;function l$o(t,e){if(t===e)return!0;if(t.size!==e.size)return!1;for(let[r,n]of t)if(!e.has(r)||e.get(r)!==n)return!1;for(let[r]of e)if(!t.has(r))return!1;return!0}a(l$o,"mapsStrictEqualIgnoreOrder");var ljt=class{static{a(this,"NKeyMap")}constructor(){this._data=new Map}set(e,...r){let n=this._data;for(let o=0;o{let o="";for(let[s,c]of r)o+=`${" ".repeat(n)}${s}: `,c instanceof Map?o+=` +`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(r=>{r(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};wo.ErrorHandler=ZJe;wo.errorHandler=new ZJe;function rVo(t){wo.errorHandler.setUnexpectedErrorHandler(t)}a(rVo,"setUnexpectedErrorHandler");function nVo(t){if(!t||typeof t!="object")return!1;let e=t;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}a(nVo,"isSigPipeError");function iVo(t){wo.errorHandler.onUnexpectedError(t)}a(iVo,"onBugIndicatingError");function oVo(t){Fjt(t)||wo.errorHandler.onUnexpectedError(t)}a(oVo,"onUnexpectedError");function sVo(t){Fjt(t)||wo.errorHandler.onUnexpectedExternalError(t)}a(sVo,"onUnexpectedExternalError");function M1n(t){if(t instanceof Error){let{name:e,message:r,cause:n}=t,o=t.stacktrace||t.stack;return{$isError:!0,name:e,message:r,stack:o,noTelemetry:iJ.isErrorNoTelemetry(t),cause:n?M1n(n):void 0,code:t.code}}return t}a(M1n,"transformErrorForSerialization");function O1n(t){let e;return t.noTelemetry?e=new iJ:(e=new Error,e.name=t.name),e.message=t.message,e.stack=t.stack,t.code&&(e.code=t.code),t.cause&&(e.cause=O1n(t.cause)),e}a(O1n,"transformErrorFromSerialization");wo.canceledName="Canceled";function Fjt(t){return t instanceof XJe?!0:t instanceof Error&&t.name===wo.canceledName&&t.message===wo.canceledName}a(Fjt,"isCancellationError");var XJe=class extends Error{static{a(this,"CancellationError")}constructor(){super(wo.canceledName),this.name=this.message}};wo.CancellationError=XJe;var Djt=class t extends Error{static{a(this,"PendingMigrationError")}static{this._name="PendingMigrationError"}static is(e){return e instanceof t||e instanceof Error&&e.name===t._name}constructor(e){super(e),this.name=t._name}};wo.PendingMigrationError=Djt;function aVo(){let t=new Error(wo.canceledName);return t.name=t.message,t}a(aVo,"canceled");function cVo(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}a(cVo,"illegalArgument");function lVo(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}a(lVo,"illegalState");var Njt=class extends TypeError{static{a(this,"ReadonlyError")}constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}};wo.ReadonlyError=Njt;function uVo(t){return t?t.message?t.message:t.stack?t.stack.split(` +`)[0]:String(t):"Error"}a(uVo,"getErrorMessage");var Mjt=class extends Error{static{a(this,"NotImplementedError")}constructor(e){super("NotImplemented"),e&&(this.message=e)}};wo.NotImplementedError=Mjt;var Ojt=class extends Error{static{a(this,"NotSupportedError")}constructor(e){super("NotSupported"),e&&(this.message=e)}};wo.NotSupportedError=Ojt;var Ljt=class extends Error{static{a(this,"ExpectedError")}constructor(){super(...arguments),this.isExpected=!0}};wo.ExpectedError=Ljt;var iJ=class t extends Error{static{a(this,"ErrorNoTelemetry")}constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof t)return e;let r=new t;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};wo.ErrorNoTelemetry=iJ;var Bjt=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};wo.BugIndicatingError=Bjt});var Sl=I(Vn=>{"use strict";p();Object.defineProperty(Vn,"__esModule",{value:!0});Vn.Permutation=Vn.CallbackIterable=Vn.ArrayQueue=Vn.booleanComparator=Vn.numberComparator=Vn.CompareResult=void 0;Vn.tail=pVo;Vn.equals=hVo;Vn.removeFastWithoutKeepingOrder=mVo;Vn.binarySearch=gVo;Vn.binarySearch2=L1n;Vn.quickSelect=Ujt;Vn.groupBy=AVo;Vn.groupAdjacentBy=yVo;Vn.forEachAdjacent=EVo;Vn.forEachWithNeighbors=_Vo;Vn.concatArrays=vVo;Vn.sortedDiff=B1n;Vn.delta=CVo;Vn.top=bVo;Vn.topAsync=SVo;Vn.coalesce=TVo;Vn.coalesceInPlace=IVo;Vn.move=xVo;Vn.isFalsyOrEmpty=wVo;Vn.isNonEmptyArray=RVo;Vn.distinct=kVo;Vn.uniqueFilter=PVo;Vn.commonPrefixLength=DVo;Vn.range=NVo;Vn.index=MVo;Vn.insert=OVo;Vn.remove=U1n;Vn.arrayInsert=LVo;Vn.shuffle=BVo;Vn.pushToStart=FVo;Vn.pushToEnd=UVo;Vn.pushMany=QVo;Vn.mapArrayOrNot=qVo;Vn.mapFilter=jVo;Vn.withoutDuplicates=HVo;Vn.asArray=GVo;Vn.getRandomElement=$Vo;Vn.insertInto=Q1n;Vn.splice=VVo;Vn.compareBy=WVo;Vn.tieBreakComparators=zVo;Vn.reverseOrder=JVo;Vn.compareUndefinedSmallest=ZVo;Vn.findAsync=XVo;Vn.sum=eWo;Vn.sumBy=tWo;var dVo=Qq(),fVo=Rs();function pVo(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}a(pVo,"tail");function hVo(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;nr(t[n],e))}a(gVo,"binarySearch");function L1n(t,e){let r=0,n=t-1;for(;r<=n;){let o=(r+n)/2|0,s=e(o);if(s<0)r=o+1;else if(s>0)n=o-1;else return o}return-(r+1)}a(L1n,"binarySearch2");function Ujt(t,e,r){if(t=t|0,t>=e.length)throw new TypeError("invalid index");let n=e[Math.floor(e.length*Math.random())],o=[],s=[],c=[];for(let l of e){let u=r(l,n);u<0?o.push(l):u>0?s.push(l):c.push(l)}return t0&&(o(s,0,[u]),c+=1)}return n}a(B1n,"sortedDiff");function CVo(t,e,r){let n=B1n(t,e,r),o=[],s=[];for(let c of n)o.push(...t.slice(c.start,c.start+c.deleteCount)),s.push(...c.toInsert);return{removed:o,added:s}}a(CVo,"delta");function bVo(t,e,r){if(r===0)return[];let n=t.slice(0,r).sort(e);return F1n(t,e,n,r,t.length),n}a(bVo,"top");function SVo(t,e,r,n,o){return r===0?Promise.resolve([]):new Promise((s,c)=>{(async()=>{let l=t.length,u=t.slice(0,r).sort(e);for(let d=r,f=Math.min(r+n,l);dr&&await new Promise(h=>setTimeout(h)),o&&o.isCancellationRequested)throw new fVo.CancellationError;F1n(t,e,u,d,f)}return u})().then(s,c)})}a(SVo,"topAsync");function F1n(t,e,r,n,o){for(let s=r.length;ne(c,u)<0);r.splice(l,0,c)}}}a(F1n,"topStep");function TVo(t){return t.filter(e=>!!e)}a(TVo,"coalesce");function IVo(t){let e=0;for(let r=0;r0}a(RVo,"isNonEmptyArray");function kVo(t,e=r=>r){let r=new Set;return t.filter(n=>{let o=e(n);return r.has(o)?!1:(r.add(o),!0)})}a(kVo,"distinct");function PVo(t){let e=new Set;return r=>{let n=t(r);return e.has(n)?!1:(e.add(n),!0)}}a(PVo,"uniqueFilter");function DVo(t,e,r=(n,o)=>n===o){let n=0;for(let o=0,s=Math.min(t.length,e.length);oe;o--)n.push(o);return n}a(NVo,"range");function MVo(t,e,r){return t.reduce((n,o)=>(n[e(o)]=r?r(o):o,n),Object.create(null))}a(MVo,"index");function OVo(t,e){return t.push(e),()=>U1n(t,e)}a(OVo,"insert");function U1n(t,e){let r=t.indexOf(e);if(r>-1)return t.splice(r,1),e}a(U1n,"remove");function LVo(t,e,r){let n=t.slice(0,e),o=t.slice(e);return n.concat(r,o)}a(LVo,"arrayInsert");function BVo(t,e){let r;if(typeof e=="number"){let n=e;r=a(()=>{let o=Math.sin(n++)*179426549;return o-Math.floor(o)},"rand")}else r=Math.random;for(let n=t.length-1;n>0;n-=1){let o=Math.floor(r()*(n+1)),s=t[n];t[n]=t[o],t[o]=s}}a(BVo,"shuffle");function FVo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.unshift(e))}a(FVo,"pushToStart");function UVo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.push(e))}a(UVo,"pushToEnd");function QVo(t,e){for(let r of e)t.push(r)}a(QVo,"pushMany");function qVo(t,e){return Array.isArray(t)?t.map(e):e(t)}a(qVo,"mapArrayOrNot");function jVo(t,e){let r=[];for(let n of t){let o=e(n);o!==void 0&&r.push(o)}return r}a(jVo,"mapFilter");function HVo(t){let e=new Set(t);return Array.from(e)}a(HVo,"withoutDuplicates");function GVo(t){return Array.isArray(t)?t:[t]}a(GVo,"asArray");function $Vo(t){return t[Math.floor(Math.random()*t.length)]}a($Vo,"getRandomElement");function Q1n(t,e,r){let n=q1n(t,e),o=t.length,s=r.length;t.length=o+s;for(let c=o-1;c>=n;c--)t[c+s]=t[c];for(let c=0;c0}a(n,"isGreaterThan"),t.isGreaterThan=n;function o(s){return s===0}a(o,"isNeitherLessOrGreaterThan"),t.isNeitherLessOrGreaterThan=o,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(qq||(Vn.CompareResult=qq={}));function WVo(t,e){return(r,n)=>e(t(r),t(n))}a(WVo,"compareBy");function zVo(...t){return(e,r)=>{for(let n of t){let o=n(e,r);if(!qq.isNeitherLessOrGreaterThan(o))return o}return qq.neitherLessOrGreaterThan}}a(zVo,"tieBreakComparators");var YVo=a((t,e)=>t-e,"numberComparator");Vn.numberComparator=YVo;var KVo=a((t,e)=>(0,Vn.numberComparator)(t?1:0,e?1:0),"booleanComparator");Vn.booleanComparator=KVo;function JVo(t){return(e,r)=>-t(e,r)}a(JVo,"reverseOrder");function ZVo(t){return(e,r)=>e===void 0?r===void 0?qq.neitherLessOrGreaterThan:qq.lessThan:r===void 0?qq.greaterThan:t(e,r)}a(ZVo,"compareUndefinedSmallest");var Qjt=class{static{a(this,"ArrayQueue")}constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let r=this.firstIdx;for(;r=0&&e(this.items[r]);)r--;let n=r===this.lastIdx?null:this.items.slice(r+1,this.lastIdx+1);return this.lastIdx=r,n}peek(){if(this.length!==0)return this.items[this.firstIdx]}peekLast(){if(this.length!==0)return this.items[this.lastIdx]}dequeue(){let e=this.items[this.firstIdx];return this.firstIdx++,e}removeLast(){let e=this.items[this.lastIdx];return this.lastIdx--,e}takeCount(e){let r=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,r}};Vn.ArrayQueue=Qjt;var qjt=class t{static{a(this,"CallbackIterable")}static{this.empty=new t(e=>{})}constructor(e){this.iterate=e}forEach(e){this.iterate(r=>(e(r),!0))}toArray(){let e=[];return this.iterate(r=>(e.push(r),!0)),e}filter(e){return new t(r=>this.iterate(n=>e(n)?r(n):!0))}map(e){return new t(r=>this.iterate(n=>r(e(n))))}some(e){let r=!1;return this.iterate(n=>(r=e(n),!r)),r}findFirst(e){let r;return this.iterate(n=>e(n)?(r=n,!1):!0),r}findLast(e){let r;return this.iterate(n=>(e(n)&&(r=n),!0)),r}findLastMaxBy(e){let r,n=!0;return this.iterate(o=>((n||qq.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};Vn.CallbackIterable=qjt;var jjt=class t{static{a(this,"Permutation")}constructor(e){this._indexMap=e}static createSortPermutation(e,r){let n=Array.from(e.keys()).sort((o,s)=>r(e[o],e[s]));return new t(n)}apply(e){return e.map((r,n)=>e[this._indexMap[n]])}inverse(){let e=this._indexMap.slice();for(let r=0;r({element:n,ok:await e(n,o)})))).find(n=>n.ok)?.element}a(XVo,"findAsync");function eWo(t){return t.reduce((e,r)=>e+r,0)}a(eWo,"sum");function tWo(t,e){return t.reduce((r,n)=>r+e(n),0)}a(tWo,"sumBy")});var $jt=I(eF=>{"use strict";p();var H1n;Object.defineProperty(eF,"__esModule",{value:!0});eF.SetWithKey=void 0;eF.groupBy=iWo;eF.groupByMap=oWo;eF.diffSets=sWo;eF.diffMaps=aWo;eF.intersection=cWo;function iWo(t,e){let r=Object.create(null);for(let n of t){let o=e(n),s=r[o];s||(s=r[o]=[]),s.push(n)}return r}a(iWo,"groupBy");function oWo(t,e){let r=new Map;for(let n of t){let o=e(n),s=r.get(o);s||(s=[],r.set(o,s)),s.push(n)}return r}a(oWo,"groupByMap");function sWo(t,e){let r=[],n=[];for(let o of t)e.has(o)||r.push(o);for(let o of e)t.has(o)||n.push(o);return{removed:r,added:n}}a(sWo,"diffSets");function aWo(t,e){let r=[],n=[];for(let[o,s]of t)e.has(o)||r.push(s);for(let[o,s]of e)t.has(o)||n.push(s);return{removed:r,added:n}}a(aWo,"diffMaps");function cWo(t,e){let r=new Set;for(let n of e)t.has(n)&&r.add(n);return r}a(cWo,"intersection");var Gjt=class{static{a(this,"SetWithKey")}static{H1n=Symbol.toStringTag}constructor(e,r){this.toKey=r,this._map=new Map,this[H1n]="SetWithKey";for(let n of e)this.add(n)}get size(){return this._map.size}add(e){let r=this.toKey(e);return this._map.set(r,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,r){this._map.forEach(n=>e.call(r,n,n,this))}[Symbol.iterator](){return this.values()}};eF.SetWithKey=Gjt});var Wjt=I(Vjt=>{"use strict";p();Object.defineProperty(Vjt,"__esModule",{value:!0});Vjt.createSingleCallFunction=lWo;function lWo(t,e){let r=this,n=!1,o;return function(){if(n)return o;if(n=!0,e)try{o=t.apply(r,arguments)}finally{e()}else o=t.apply(r,arguments);return o}}a(lWo,"createSingleCallFunction")});var r2=I(Gd=>{"use strict";p();var G1n,$1n,V1n;Object.defineProperty(Gd,"__esModule",{value:!0});Gd.NKeyMap=Gd.SetMap=Gd.BidirectionalMap=Gd.CounterSet=Gd.MRUCache=Gd.LRUCache=Gd.LinkedMap=Gd.ResourceSet=Gd.ResourceMap=void 0;Gd.getOrSet=uWo;Gd.mapToString=dWo;Gd.setToString=fWo;Gd.mapsStrictEqualIgnoreOrder=hWo;function uWo(t,e,r){let n=t.get(e);return n===void 0&&(n=r,t.set(e,n)),n}a(uWo,"getOrSet");function dWo(t){let e=[];return t.forEach((r,n)=>{e.push(`${n} => ${r}`)}),`Map(${t.size}) {${e.join(", ")}}`}a(dWo,"mapToString");function fWo(t){let e=[];return t.forEach(r=>{e.push(r)}),`Set(${t.size}) {${e.join(", ")}}`}a(fWo,"setToString");var zjt=class{static{a(this,"ResourceMapEntry")}constructor(e,r){this.uri=e,this.value=r}};function pWo(t){return Array.isArray(t)}a(pWo,"isEntries");var gwe=class t{static{a(this,"ResourceMap")}static{this.defaultToKey=e=>e.toString()}constructor(e,r){if(this[G1n]="ResourceMap",e instanceof t)this.map=new Map(e.map),this.toKey=r??t.defaultToKey;else if(pWo(e)){this.map=new Map,this.toKey=r??t.defaultToKey;for(let[n,o]of e)this.set(n,o)}else this.map=new Map,this.toKey=e??t.defaultToKey}set(e,r){return this.map.set(this.toKey(e),new zjt(e,r)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,r){typeof r<"u"&&(e=e.bind(r));for(let[n,o]of this.map)e(o.value,o.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(G1n=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};Gd.ResourceMap=gwe;var Yjt=class{static{a(this,"ResourceSet")}constructor(e,r){this[$1n]="ResourceSet",!e||typeof e=="function"?this._map=new gwe(e):(this._map=new gwe(r),e.forEach(this.add,this))}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,r){this._map.forEach((n,o)=>e.call(r,o,o,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[($1n=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};Gd.ResourceSet=Yjt;var eZe=class{static{a(this,"LinkedMap")}constructor(){this[V1n]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=0){let n=this._map.get(e);if(n)return r!==0&&this.touch(n,r),n.value}set(e,r,n=0){let o=this._map.get(e);if(o)o.value=r,n!==0&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.key,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}values(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.value,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}entries(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:[n.key,n.value],done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}[(V1n=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._tail,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.previous,n--;this._tail=r,this._size=n,r&&(r.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==1&&r!==2)){if(r===1){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===2){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Gd.LinkedMap=eZe;var tZe=class extends eZe{static{a(this,"Cache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=2){return super.get(e,r)}peek(e){return super.get(e,0)}set(e,r){return super.set(e,r,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},Kjt=class extends tZe{static{a(this,"LRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimOld(e)}set(e,r){return super.set(e,r),this.checkTrim(),this}};Gd.LRUCache=Kjt;var Jjt=class extends tZe{static{a(this,"MRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimNew(e)}set(e,r){return this._limit<=this.size&&!this.has(e)&&this.trim(Math.round(this._limit*this._ratio)-1),super.set(e,r),this}};Gd.MRUCache=Jjt;var Zjt=class{static{a(this,"CounterSet")}constructor(){this.map=new Map}add(e){return this.map.set(e,(this.map.get(e)||0)+1),this}delete(e){let r=this.map.get(e)||0;return r===0?!1:(r--,r===0?this.map.delete(e):this.map.set(e,r),!0)}has(e){return this.map.has(e)}};Gd.CounterSet=Zjt;var Xjt=class{static{a(this,"BidirectionalMap")}constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(let[r,n]of e)this.set(r,n)}clear(){this._m1.clear(),this._m2.clear()}set(e,r){this._m1.set(e,r),this._m2.set(r,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){let r=this._m1.get(e);return r===void 0?!1:(this._m1.delete(e),this._m2.delete(r),!0)}forEach(e,r){this._m1.forEach((n,o)=>{e.call(r,n,o,this)})}keys(){return this._m1.keys()}values(){return this._m1.values()}};Gd.BidirectionalMap=Xjt;var eHt=class{static{a(this,"SetMap")}constructor(){this.map=new Map}add(e,r){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(r)}delete(e,r){let n=this.map.get(e);n&&(n.delete(r),n.size===0&&this.map.delete(e))}forEach(e,r){let n=this.map.get(e);n&&n.forEach(r)}get(e){let r=this.map.get(e);return r||new Set}};Gd.SetMap=eHt;function hWo(t,e){if(t===e)return!0;if(t.size!==e.size)return!1;for(let[r,n]of t)if(!e.has(r)||e.get(r)!==n)return!1;for(let[r]of e)if(!t.has(r))return!1;return!0}a(hWo,"mapsStrictEqualIgnoreOrder");var tHt=class{static{a(this,"NKeyMap")}constructor(){this._data=new Map}set(e,...r){let n=this._data;for(let o=0;o{let o="";for(let[s,c]of r)o+=`${" ".repeat(n)}${s}: `,c instanceof Map?o+=` `+e(c,n+1):o+=`${c} -`;return o},"printMap");return e(this._data,0)}};Ud.NKeyMap=ljt});var rd=I(W3=>{"use strict";p();Object.defineProperty(W3,"__esModule",{value:!0});W3.ok=u$o;W3.assertNever=d$o;W3.softAssertNever=f$o;W3.assert=p$o;W3.softAssert=h$o;W3.assertFn=m$o;W3.checkAdjacentItems=g$o;var Zxe=Rs();function u$o(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}a(u$o,"ok");function d$o(t,e="Unreachable"){throw new Error(e)}a(d$o,"assertNever");function f$o(t){}a(f$o,"softAssertNever");function p$o(t,e="unexpected state"){if(!t)throw typeof e=="string"?new Zxe.BugIndicatingError(`Assertion Failed: ${e}`):e}a(p$o,"assert");function h$o(t,e="Soft Assertion Failed"){t||(0,Zxe.onUnexpectedError)(new Zxe.BugIndicatingError(e))}a(h$o,"softAssert");function m$o(t){if(!t()){debugger;t(),(0,Zxe.onUnexpectedError)(new Zxe.BugIndicatingError("Assertion Failed"))}}a(m$o,"assertFn");function g$o(t,e){let r=0;for(;r{"use strict";p();Object.defineProperty(Tl,"__esModule",{value:!0});Tl.isOneOf=void 0;Tl.isString=ujt;Tl.isStringArray=y$o;Tl.isArrayOf=Abn;Tl.isObject=ybn;Tl.isTypedArray=E$o;Tl.isNumber=_$o;Tl.isIterable=v$o;Tl.isAsyncIterable=C$o;Tl.isBoolean=b$o;Tl.isUndefined=Ebn;Tl.isDefined=S$o;Tl.isUndefinedOrNull=wJe;Tl.assertType=T$o;Tl.assertReturnsDefined=I$o;Tl.assertDefined=x$o;Tl.assertReturnsAllDefined=w$o;Tl.typeCheck=k$o;Tl.isEmptyObject=D$o;Tl.isFunction=djt;Tl.areFunctions=N$o;Tl.validateConstraints=M$o;Tl.validateConstraint=_bn;Tl.upcast=O$o;Tl.hasKey=L$o;var A$o=rd();function ujt(t){return typeof t=="string"}a(ujt,"isString");function y$o(t){return Abn(t,ujt)}a(y$o,"isStringArray");function Abn(t,e){return Array.isArray(t)&&t.every(e)}a(Abn,"isArrayOf");function ybn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(ybn,"isObject");function E$o(t){let e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}a(E$o,"isTypedArray");function _$o(t){return typeof t=="number"&&!isNaN(t)}a(_$o,"isNumber");function v$o(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(v$o,"isIterable");function C$o(t){return!!t&&typeof t[Symbol.asyncIterator]=="function"}a(C$o,"isAsyncIterable");function b$o(t){return t===!0||t===!1}a(b$o,"isBoolean");function Ebn(t){return typeof t>"u"}a(Ebn,"isUndefined");function S$o(t){return!wJe(t)}a(S$o,"isDefined");function wJe(t){return Ebn(t)||t===null}a(wJe,"isUndefinedOrNull");function T$o(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}a(T$o,"assertType");function I$o(t){return(0,A$o.assert)(t!=null,"Argument is `undefined` or `null`."),t}a(I$o,"assertReturnsDefined");function x$o(t,e){if(t==null)throw typeof e=="string"?new Error(e):e}a(x$o,"assertDefined");function w$o(...t){let e=[];for(let r=0;re.includes(t),"isOneOf");Tl.isOneOf=R$o;function k$o(t){}a(k$o,"typeCheck");var P$o=Object.prototype.hasOwnProperty;function D$o(t){if(!ybn(t))return!1;for(let e in t)if(P$o.call(t,e))return!1;return!0}a(D$o,"isEmptyObject");function djt(t){return typeof t=="function"}a(djt,"isFunction");function N$o(...t){return t.length>0&&t.every(djt)}a(N$o,"areFunctions");function M$o(t,e){let r=Math.min(t.length,e.length);for(let n=0;n{"use strict";p();Object.defineProperty(RJe,"__esModule",{value:!0});RJe.Iterable=void 0;var B$o=KS(),vbn;(function(t){function e(x){return!!x&&typeof x=="object"&&typeof x[Symbol.iterator]=="function"}a(e,"is"),t.is=e;let r=Object.freeze([]);function n(){return r}a(n,"empty"),t.empty=n;function*o(x){yield x}a(o,"single"),t.single=o;function s(x){return e(x)?x:o(x)}a(s,"wrap"),t.wrap=s;function c(x){return x??r}a(c,"from"),t.from=c;function*l(x){for(let P=x.length-1;P>=0;P--)yield x[P]}a(l,"reverse"),t.reverse=l;function u(x){return!x||x[Symbol.iterator]().next().done===!0}a(u,"isEmpty"),t.isEmpty=u;function d(x){return x[Symbol.iterator]().next().value}a(d,"first"),t.first=d;function f(x,P){let D=0;for(let N of x)if(P(N,D++))return!0;return!1}a(f,"some"),t.some=f;function h(x,P){let D=0;for(let N of x)if(!P(N,D++))return!1;return!0}a(h,"every"),t.every=h;function m(x,P){for(let D of x)if(P(D))return D}a(m,"find"),t.find=m;function*g(x,P){for(let D of x)P(D)&&(yield D)}a(g,"filter"),t.filter=g;function*A(x,P){let D=0;for(let N of x)yield P(N,D++)}a(A,"map"),t.map=A;function*y(x,P){let D=0;for(let N of x)yield*P(N,D++)}a(y,"flatMap"),t.flatMap=y;function*E(...x){for(let P of x)(0,B$o.isIterable)(P)?yield*P:yield P}a(E,"concat"),t.concat=E;function _(x,P,D){let N=D;for(let L of x)N=P(N,L);return N}a(_,"reduce"),t.reduce=_;function v(x){let P=0;for(let D of x)P++;return P}a(v,"length"),t.length=v;function*b(x,P,D=x.length){for(P<-x.length&&(P=0),P<0&&(P+=x.length),D<0?D+=x.length:D>x.length&&(D=x.length);P{"use strict";p();Object.defineProperty(hs,"__esModule",{value:!0});hs.DisposableResourceMap=hs.DisposableSet=hs.DisposableMap=hs.ImmortalReference=hs.AsyncReferenceCollection=hs.ReferenceCollection=hs.RefCountedDisposable=hs.MandatoryMutableDisposable=hs.MutableDisposable=hs.Disposable=hs.DisposableStore=hs.DisposableTracker=hs.GCBasedDisposableTracker=void 0;hs.setDisposableTracker=Tbn;hs.trackDisposable=KK;hs.markAsDisposed=JK;hs.markAsSingleton=H$o;hs.isDisposable=Ibn;hs.dispose=ewe;hs.disposeIfDisposable=G$o;hs.combinedDisposable=$$o;hs.toDisposable=bjt;hs.disposeOnReturn=V$o;hs.thenIfNotDisposed=W$o;hs.thenRegisterOrDispose=z$o;var Cbn=Sl(),F$o=Xqt(),Sbn=zP(),U$o=tjt(),Q$o=fjt(),bbn=Rs(),q$o=!1,YK=null,pjt=class{static{a(this,"GCBasedDisposableTracker")}constructor(){this._registry=new FinalizationRegistry(e=>{console.warn(`[LEAKED DISPOSABLE] ${e}`)})}trackDisposable(e){let r=new Error("CREATED via:").stack;this._registry.register(e,r,e)}setParent(e,r){r?this._registry.unregister(e):this.trackDisposable(e)}markAsDisposed(e){this._registry.unregister(e)}markAsSingleton(e){this._registry.unregister(e)}};hs.GCBasedDisposableTracker=pjt;var hjt=class t{static{a(this,"DisposableTracker")}constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(e){let r=this.livingDisposables.get(e);return r||(r={parent:null,source:null,isSingleton:!1,value:e,idx:t.idx++},this.livingDisposables.set(e,r)),r}trackDisposable(e){let r=this.getDisposableData(e);r.source||(r.source=new Error().stack)}setParent(e,r){let n=this.getDisposableData(e);n.parent=r}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,r){let n=r.get(e);if(n)return n;let o=e.parent?this.getRootParent(this.getDisposableData(e.parent),r):e;return r.set(e,o),o}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,n])=>n.source!==null&&!this.getRootParent(n,e).isSingleton).flatMap(([n])=>n)}computeLeakingDisposables(e=10,r){let n;if(r)n=r;else{let u=new Map,d=[...this.livingDisposables.values()].filter(h=>h.source!==null&&!this.getRootParent(h,u).isSingleton);if(d.length===0)return;let f=new Set(d.map(h=>h.value));if(n=d.filter(h=>!(h.parent&&f.has(h.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function o(u){function d(h,m){for(;h.length>0&&m.some(g=>typeof g=="string"?g===h[0]:h[0].match(g));)h.shift()}a(d,"removePrefix");let f=u.source.split(` -`).map(h=>h.trim().replace("at ","")).filter(h=>h!=="");return d(f,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),f.reverse()}a(o,"getStackTracePath");let s=new Sbn.SetMap;for(let u of n){let d=o(u);for(let f=0;f<=d.length;f++)s.add(d.slice(0,f).join(` -`),u)}n.sort((0,Cbn.compareBy)(u=>u.idx,Cbn.numberComparator));let c="",l=0;for(let u of n.slice(0,e)){l++;let d=o(u),f=[];for(let h=0;h{"use strict";p();Object.defineProperty(tF,"__esModule",{value:!0});tF.ok=mWo;tF.assertNever=gWo;tF.softAssertNever=AWo;tF.assert=yWo;tF.softAssert=EWo;tF.assertFn=_Wo;tF.checkAdjacentItems=vWo;var Awe=Rs();function mWo(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}a(mWo,"ok");function gWo(t,e="Unreachable"){throw new Error(e)}a(gWo,"assertNever");function AWo(t){}a(AWo,"softAssertNever");function yWo(t,e="unexpected state"){if(!t)throw typeof e=="string"?new Awe.BugIndicatingError(`Assertion Failed: ${e}`):e}a(yWo,"assert");function EWo(t,e="Soft Assertion Failed"){t||(0,Awe.onUnexpectedError)(new Awe.BugIndicatingError(e))}a(EWo,"softAssert");function _Wo(t){if(!t()){debugger;t(),(0,Awe.onUnexpectedError)(new Awe.BugIndicatingError("Assertion Failed"))}}a(_Wo,"assertFn");function vWo(t,e){let r=0;for(;r{"use strict";p();Object.defineProperty(Tl,"__esModule",{value:!0});Tl.isOneOf=void 0;Tl.isString=rHt;Tl.isStringArray=bWo;Tl.isArrayOf=W1n;Tl.isObject=z1n;Tl.isTypedArray=SWo;Tl.isNumber=TWo;Tl.isIterable=IWo;Tl.isAsyncIterable=xWo;Tl.isBoolean=wWo;Tl.isUndefined=Y1n;Tl.isDefined=RWo;Tl.isUndefinedOrNull=rZe;Tl.assertType=kWo;Tl.assertReturnsDefined=PWo;Tl.assertDefined=DWo;Tl.assertReturnsAllDefined=NWo;Tl.typeCheck=OWo;Tl.isEmptyObject=BWo;Tl.isFunction=nHt;Tl.areFunctions=FWo;Tl.validateConstraints=UWo;Tl.validateConstraint=K1n;Tl.upcast=QWo;Tl.hasKey=qWo;var CWo=sd();function rHt(t){return typeof t=="string"}a(rHt,"isString");function bWo(t){return W1n(t,rHt)}a(bWo,"isStringArray");function W1n(t,e){return Array.isArray(t)&&t.every(e)}a(W1n,"isArrayOf");function z1n(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(z1n,"isObject");function SWo(t){let e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}a(SWo,"isTypedArray");function TWo(t){return typeof t=="number"&&!isNaN(t)}a(TWo,"isNumber");function IWo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(IWo,"isIterable");function xWo(t){return!!t&&typeof t[Symbol.asyncIterator]=="function"}a(xWo,"isAsyncIterable");function wWo(t){return t===!0||t===!1}a(wWo,"isBoolean");function Y1n(t){return typeof t>"u"}a(Y1n,"isUndefined");function RWo(t){return!rZe(t)}a(RWo,"isDefined");function rZe(t){return Y1n(t)||t===null}a(rZe,"isUndefinedOrNull");function kWo(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}a(kWo,"assertType");function PWo(t){return(0,CWo.assert)(t!=null,"Argument is `undefined` or `null`."),t}a(PWo,"assertReturnsDefined");function DWo(t,e){if(t==null)throw typeof e=="string"?new Error(e):e}a(DWo,"assertDefined");function NWo(...t){let e=[];for(let r=0;re.includes(t),"isOneOf");Tl.isOneOf=MWo;function OWo(t){}a(OWo,"typeCheck");var LWo=Object.prototype.hasOwnProperty;function BWo(t){if(!z1n(t))return!1;for(let e in t)if(LWo.call(t,e))return!1;return!0}a(BWo,"isEmptyObject");function nHt(t){return typeof t=="function"}a(nHt,"isFunction");function FWo(...t){return t.length>0&&t.every(nHt)}a(FWo,"areFunctions");function UWo(t,e){let r=Math.min(t.length,e.length);for(let n=0;n{"use strict";p();Object.defineProperty(nZe,"__esModule",{value:!0});nZe.Iterable=void 0;var jWo=nT(),J1n;(function(t){function e(x){return!!x&&typeof x=="object"&&typeof x[Symbol.iterator]=="function"}a(e,"is"),t.is=e;let r=Object.freeze([]);function n(){return r}a(n,"empty"),t.empty=n;function*o(x){yield x}a(o,"single"),t.single=o;function s(x){return e(x)?x:o(x)}a(s,"wrap"),t.wrap=s;function c(x){return x??r}a(c,"from"),t.from=c;function*l(x){for(let P=x.length-1;P>=0;P--)yield x[P]}a(l,"reverse"),t.reverse=l;function u(x){return!x||x[Symbol.iterator]().next().done===!0}a(u,"isEmpty"),t.isEmpty=u;function d(x){return x[Symbol.iterator]().next().value}a(d,"first"),t.first=d;function f(x,P){let D=0;for(let N of x)if(P(N,D++))return!0;return!1}a(f,"some"),t.some=f;function h(x,P){let D=0;for(let N of x)if(!P(N,D++))return!1;return!0}a(h,"every"),t.every=h;function m(x,P){for(let D of x)if(P(D))return D}a(m,"find"),t.find=m;function*g(x,P){for(let D of x)P(D)&&(yield D)}a(g,"filter"),t.filter=g;function*A(x,P){let D=0;for(let N of x)yield P(N,D++)}a(A,"map"),t.map=A;function*y(x,P){let D=0;for(let N of x)yield*P(N,D++)}a(y,"flatMap"),t.flatMap=y;function*E(...x){for(let P of x)(0,jWo.isIterable)(P)?yield*P:yield P}a(E,"concat"),t.concat=E;function _(x,P,D){let N=D;for(let L of x)N=P(N,L);return N}a(_,"reduce"),t.reduce=_;function v(x){let P=0;for(let D of x)P++;return P}a(v,"length"),t.length=v;function*b(x,P,D=x.length){for(P<-x.length&&(P=0),P<0&&(P+=x.length),D<0?D+=x.length:D>x.length&&(D=x.length);P{"use strict";p();Object.defineProperty(ds,"__esModule",{value:!0});ds.DisposableResourceMap=ds.DisposableSet=ds.DisposableMap=ds.ImmortalReference=ds.AsyncReferenceCollection=ds.ReferenceCollection=ds.RefCountedDisposable=ds.MandatoryMutableDisposable=ds.MutableDisposable=ds.Disposable=ds.DisposableStore=ds.DisposableTracker=ds.GCBasedDisposableTracker=void 0;ds.setDisposableTracker=tSn;ds.trackDisposable=sJ;ds.markAsDisposed=aJ;ds.markAsSingleton=zWo;ds.isDisposable=rSn;ds.dispose=Ewe;ds.disposeIfDisposable=YWo;ds.combinedDisposable=KWo;ds.toDisposable=mHt;ds.disposeOnReturn=JWo;ds.thenIfNotDisposed=ZWo;ds.thenRegisterOrDispose=XWo;var Z1n=Sl(),HWo=$jt(),eSn=r2(),GWo=Wjt(),$Wo=iHt(),X1n=Rs(),VWo=!1,oJ=null,oHt=class{static{a(this,"GCBasedDisposableTracker")}constructor(){this._registry=new FinalizationRegistry(e=>{console.warn(`[LEAKED DISPOSABLE] ${e}`)})}trackDisposable(e){let r=new Error("CREATED via:").stack;this._registry.register(e,r,e)}setParent(e,r){r?this._registry.unregister(e):this.trackDisposable(e)}markAsDisposed(e){this._registry.unregister(e)}markAsSingleton(e){this._registry.unregister(e)}};ds.GCBasedDisposableTracker=oHt;var sHt=class t{static{a(this,"DisposableTracker")}constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(e){let r=this.livingDisposables.get(e);return r||(r={parent:null,source:null,isSingleton:!1,value:e,idx:t.idx++},this.livingDisposables.set(e,r)),r}trackDisposable(e){let r=this.getDisposableData(e);r.source||(r.source=new Error().stack)}setParent(e,r){let n=this.getDisposableData(e);n.parent=r}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,r){let n=r.get(e);if(n)return n;let o=e.parent?this.getRootParent(this.getDisposableData(e.parent),r):e;return r.set(e,o),o}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,n])=>n.source!==null&&!this.getRootParent(n,e).isSingleton).flatMap(([n])=>n)}computeLeakingDisposables(e=10,r){let n;if(r)n=r;else{let u=new Map,d=[...this.livingDisposables.values()].filter(h=>h.source!==null&&!this.getRootParent(h,u).isSingleton);if(d.length===0)return;let f=new Set(d.map(h=>h.value));if(n=d.filter(h=>!(h.parent&&f.has(h.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function o(u){function d(h,m){for(;h.length>0&&m.some(g=>typeof g=="string"?g===h[0]:h[0].match(g));)h.shift()}a(d,"removePrefix");let f=u.source.split(` +`).map(h=>h.trim().replace("at ","")).filter(h=>h!=="");return d(f,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),f.reverse()}a(o,"getStackTracePath");let s=new eSn.SetMap;for(let u of n){let d=o(u);for(let f=0;f<=d.length;f++)s.add(d.slice(0,f).join(` +`),u)}n.sort((0,Z1n.compareBy)(u=>u.idx,Z1n.numberComparator));let c="",l=0;for(let u of n.slice(0,e)){l++;let d=o(u),f=[];for(let h=0;ho(E)[h]),E=>E);delete y[d[h]];for(let[E,_]of Object.entries(y))_&&f.unshift(` - stacktraces of ${_.length} other leaks continue with ${E}`);f.unshift(m)}c+=` +`)),y=(0,HWo.groupBy)([...A].map(E=>o(E)[h]),E=>E);delete y[d[h]];for(let[E,_]of Object.entries(y))_&&f.unshift(` - stacktraces of ${_.length} other leaks continue with ${E}`);f.unshift(m)}c+=` ==================== Leaking disposable ${l}/${n.length}: ${u.value.constructor.name} ==================== @@ -100,129 +100,129 @@ ${f.join(` ... and ${n.length-e} more leaking disposables -`),{leaks:n,details:c}}};hs.DisposableTracker=hjt;function Tbn(t){YK=t}a(Tbn,"setDisposableTracker");if(q$o){let t="__is_disposable_tracked__";Tbn(new class{trackDisposable(e){let r=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[t]||console.log(r)},3e3)}setParent(e,r){if(e&&e!==_ue.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==_ue.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function KK(t){return YK?.trackDisposable(t),t}a(KK,"trackDisposable");function JK(t){YK?.markAsDisposed(t)}a(JK,"markAsDisposed");function z3(t,e){YK?.setParent(t,e)}a(z3,"setParentOfDisposable");function j$o(t,e){if(YK)for(let r of t)YK.setParent(r,e)}a(j$o,"setParentOfDisposables");function H$o(t){return YK?.markAsSingleton(t),t}a(H$o,"markAsSingleton");function Ibn(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}a(Ibn,"isDisposable");function ewe(t){if(Q$o.Iterable.is(t)){let e=[];for(let r of t)if(r)try{r.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}a(ewe,"dispose");function G$o(t){for(let e of t)Ibn(e)&&e.dispose();return[]}a(G$o,"disposeIfDisposable");function $$o(...t){let e=bjt(()=>ewe(t));return j$o(t,e),e}a($$o,"combinedDisposable");var mjt=class{static{a(this,"FunctionDisposable")}constructor(e){this._isDisposed=!1,this._fn=e,KK(this)}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,JK(this),this._fn()}}};function bjt(t){return new mjt(t)}a(bjt,"toDisposable");var Xxe=class t{static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,KK(this)}dispose(){this._isDisposed||(JK(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ewe(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===_ue.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return z3(e,this),this._isDisposed?t.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.delete(e)&&z3(e,null)}assertNotDisposed(){this._isDisposed&&(0,bbn.onUnexpectedError)(new bbn.BugIndicatingError("Object disposed"))}};hs.DisposableStore=Xxe;var _ue=class{static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new Xxe,KK(this),z3(this._store,this)}dispose(){JK(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};hs.Disposable=_ue;var kJe=class{static{a(this,"MutableDisposable")}constructor(){this._isDisposed=!1,KK(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&z3(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,JK(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&z3(e,null),e}};hs.MutableDisposable=kJe;var gjt=class{static{a(this,"MandatoryMutableDisposable")}constructor(e){this._disposable=new kJe,this._isDisposed=!1,this._disposable.value=e}get value(){return this._disposable.value}set value(e){this._isDisposed||e===this._disposable.value||(this._disposable.value=e)}dispose(){this._isDisposed=!0,this._disposable.dispose()}};hs.MandatoryMutableDisposable=gjt;var Ajt=class{static{a(this,"RefCountedDisposable")}constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}};hs.RefCountedDisposable=Ajt;var yjt=class{static{a(this,"ReferenceCollection")}constructor(){this.references=new Map}acquire(e,...r){let n=this.references.get(e);n||(n={counter:0,object:this.createReferencedObject(e,...r)},this.references.set(e,n));let{object:o}=n,s=(0,U$o.createSingleCallFunction)(()=>{--n.counter===0&&(this.destroyReferencedObject(e,n.object),this.references.delete(e))});return n.counter++,{object:o,dispose:s}}};hs.ReferenceCollection=yjt;var Ejt=class{static{a(this,"AsyncReferenceCollection")}constructor(e){this.referenceCollection=e}async acquire(e,...r){let n=this.referenceCollection.acquire(e,...r);try{return{object:await n.object,dispose:a(()=>n.dispose(),"dispose")}}catch(o){throw n.dispose(),o}}};hs.AsyncReferenceCollection=Ejt;var _jt=class{static{a(this,"ImmortalReference")}constructor(e){this.object=e}dispose(){}};hs.ImmortalReference=_jt;function V$o(t){let e=new Xxe;try{t(e)}finally{e.dispose()}}a(V$o,"disposeOnReturn");var PJe=class{static{a(this,"DisposableMap")}constructor(e=new Map){this._isDisposed=!1,this._store=e,KK(this)}dispose(){JK(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{ewe(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}get(e){return this._store.get(e)}set(e,r,n=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),n||this._store.get(e)?.dispose(),this._store.set(e,r),z3(r,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let r=this._store.get(e);return r&&z3(r,null),this._store.delete(e),r}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};hs.DisposableMap=PJe;var vjt=class{static{a(this,"DisposableSet")}constructor(e=new Set){this._isDisposed=!1,this._store=e,KK(this)}dispose(){JK(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{ewe(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}add(e){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableSet that has already been disposed of. The added object will be leaked!").stack),this._store.add(e),z3(e,this)}deleteAndDispose(e){this._store.delete(e)&&e.dispose()}deleteAndLeak(e){if(this._store.delete(e))return z3(e,null),e}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};hs.DisposableSet=vjt;function W$o(t,e){let r=!1;return t.then(n=>{r||e(n)}),bjt(()=>{r=!0})}a(W$o,"thenIfNotDisposed");function z$o(t,e){return t.then(r=>(e.isDisposed?r.dispose():e.add(r),r))}a(z$o,"thenRegisterOrDispose");var Cjt=class extends PJe{static{a(this,"DisposableResourceMap")}constructor(){super(new Sbn.ResourceMap)}};hs.DisposableResourceMap=Cjt});var vue=I(DJe=>{"use strict";p();Object.defineProperty(DJe,"__esModule",{value:!0});DJe.LinkedList=void 0;var yu=class t{static{a(this,"Node")}static{this.Undefined=new t(void 0)}constructor(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}},Sjt=class{static{a(this,"LinkedList")}constructor(){this._first=yu.Undefined,this._last=yu.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===yu.Undefined}clear(){let e=this._first;for(;e!==yu.Undefined;){let r=e.next;e.prev=yu.Undefined,e.next=yu.Undefined,e=r}this._first=yu.Undefined,this._last=yu.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,r){let n=new yu(e);if(this._first===yu.Undefined)this._first=n,this._last=n;else if(r){let s=this._last;this._last=n,n.prev=s,s.next=n}else{let s=this._first;this._first=n,n.next=s,s.prev=n}this._size+=1;let o=!1;return()=>{o||(o=!0,this._remove(n))}}shift(){if(this._first!==yu.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==yu.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==yu.Undefined)return this._last.element}_remove(e){if(e.prev!==yu.Undefined&&e.next!==yu.Undefined){let r=e.prev;r.next=e.next,e.next.prev=r}else e.prev===yu.Undefined&&e.next===yu.Undefined?(this._first=yu.Undefined,this._last=yu.Undefined):e.next===yu.Undefined?(this._last=this._last.prev,this._last.next=yu.Undefined):e.prev===yu.Undefined&&(this._first=this._first.next,this._first.prev=yu.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==yu.Undefined;)yield e.element,e=e.next}};DJe.LinkedList=Sjt});var kbn=I(Cue=>{"use strict";p();Object.defineProperty(Cue,"__esModule",{value:!0});Cue.getNLSMessages=xbn;Cue.getNLSLanguage=wbn;Cue.localize=K$o;Cue.localize2=J$o;function xbn(){return globalThis._VSCODE_NLS_MESSAGES}a(xbn,"getNLSMessages");function wbn(){return globalThis._VSCODE_NLS_LANGUAGE}a(wbn,"getNLSLanguage");var Y$o=wbn()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function NJe(t,e){let r;return e.length===0?r=t:r=t.replace(/\{(\d+)\}/g,(n,o)=>{let s=o[0],c=e[s],l=n;return typeof c=="string"?l=c:(typeof c=="number"||typeof c=="boolean"||c===void 0||c===null)&&(l=String(c)),l}),Y$o&&(r="\uFF3B"+r.replace(/[aouei]/g,"$&$&")+"\uFF3D"),r}a(NJe,"_format");function K$o(t,e,...r){return NJe(typeof t=="number"?Rbn(t,e):e,r)}a(K$o,"localize");function Rbn(t,e){let r=xbn()?.[t];if(typeof r!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return r}a(Rbn,"lookupMessage");function J$o(t,e,...r){let n;typeof t=="number"?n=Rbn(t,e):n=e;let o=NJe(n,r);return{value:o,original:e===n?o:NJe(e,r)}}a(J$o,"localize2")});var Rq=I(pr=>{"use strict";p();var Z$o=pr&&pr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),X$o=pr&&pr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),eVo=pr&&pr.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=0,iwe=Y3.indexOf("Macintosh")>=0,xjt=(Y3.indexOf("Macintosh")>=0||Y3.indexOf("iPad")>=0||Y3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,rwe=Y3.indexOf("Linux")>=0,Fbn=Y3?.indexOf("Mobi")>=0,Ijt=!0,MJe=tVo.getNLSLanguage()||pr.LANGUAGE_DEFAULT,twe=navigator.language.toLowerCase(),Tjt=twe):console.error("Unable to resolve platform.");function nVo(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(nVo,"PlatformToString");var OJe=0;iwe?OJe=1:nwe?OJe=3:rwe&&(OJe=2);pr.isWindows=nwe;pr.isMacintosh=iwe;pr.isLinux=rwe;pr.isLinuxSnap=Mbn;pr.isNative=Obn;pr.isElectron=Lbn;pr.isWeb=Ijt;pr.isWebWorker=Ijt&&typeof K3.importScripts=="function";pr.webWorkerOrigin=pr.isWebWorker?K3.origin:void 0;pr.isIOS=xjt;pr.isMobile=Fbn;pr.isCI=Bbn;pr.platform=OJe;pr.userAgent=Y3;pr.language=MJe;var Pbn;(function(t){function e(){return pr.language}a(e,"value"),t.value=e;function r(){return pr.language.length===2?pr.language==="en":pr.language.length>=3?pr.language[0]==="e"&&pr.language[1]==="n"&&pr.language[2]==="-":!1}a(r,"isDefaultVariant"),t.isDefaultVariant=r;function n(){return pr.language==="en"}a(n,"isDefault"),t.isDefault=n})(Pbn||(pr.Language=Pbn={}));pr.locale=twe;pr.platformLocale=Tjt;pr.translationsConfigFile=Ubn;pr.setTimeout0IsFaster=typeof K3.postMessage=="function"&&!K3.importScripts;pr.setTimeout0=(()=>{if(pr.setTimeout0IsFaster){let t=[];K3.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),K3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();pr.OS=iwe||xjt?2:nwe?1:3;var Dbn=!0,Nbn=!1;function iVo(){if(!Nbn){Nbn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,Dbn=new Uint16Array(t.buffer)[0]===513}return Dbn}a(iVo,"isLittleEndian");pr.isChrome=!!(pr.userAgent&&pr.userAgent.indexOf("Chrome")>=0);pr.isFirefox=!!(pr.userAgent&&pr.userAgent.indexOf("Firefox")>=0);pr.isSafari=!!(!pr.isChrome&&pr.userAgent&&pr.userAgent.indexOf("Safari")>=0);pr.isEdge=!!(pr.userAgent&&pr.userAgent.indexOf("Edg/")>=0);pr.isAndroid=!!(pr.userAgent&&pr.userAgent.indexOf("Android")>=0);function oVo(t){return parseFloat(t)>=25}a(oVo,"isTahoeOrNewer")});var owe=I(BO=>{"use strict";p();Object.defineProperty(BO,"__esModule",{value:!0});BO.arch=BO.platform=BO.env=BO.cwd=void 0;var qbn=Rq(),ZK,wjt=globalThis.vscode;if(typeof wjt<"u"&&typeof wjt.process<"u"){let t=wjt.process;ZK={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?ZK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:ZK={get platform(){return qbn.isWindows?"win32":qbn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};BO.cwd=ZK.cwd;BO.env=ZK.env;BO.platform=ZK.platform;BO.arch=ZK.arch});var FO=I(LJe=>{"use strict";p();Object.defineProperty(LJe,"__esModule",{value:!0});LJe.StopWatch=void 0;var sVo=globalThis.performance.now.bind(globalThis.performance),Rjt=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=e===!1?Date.now:sVo,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}};LJe.StopWatch=Rjt});var Ic=I(Ga=>{"use strict";p();Object.defineProperty(Ga,"__esModule",{value:!0});Ga.ValueWithChangeEvent=Ga.Relay=Ga.EventBufferer=Ga.DynamicListEventMultiplexer=Ga.EventMultiplexer=Ga.MicrotaskEmitter=Ga.DebounceEmitter=Ga.PauseableEmitter=Ga.AsyncEmitter=Ga.createEventDeliveryQueue=Ga.Emitter=Ga.ListenerRefusalError=Ga.ListenerLeakError=Ga.EventProfiling=Ga.Event=void 0;Ga.setGlobalLeakWarningThreshold=pVo;Ga.trackSetChanges=AVo;var aVo=Xqt(),swe=Rs(),cVo=tjt(),WC=Ro(),Vbn=vue(),lVo=owe(),uVo=FO(),jbn=!1,dVo=!1,fVo=100,Hbn=6e4;function Gbn(){return!!lVo.env.VSCODE_DEV}a(Gbn,"_isBufferLeakWarningEnabled");var BJe;(function(t){t.None=()=>WC.Disposable.None;function e(M){if(dVo){let{onDidAddListener:O}=M,j=Sue.create(),Q=0;M.onDidAddListener=()=>{++Q===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),j.print()),O?.()}}}a(e,"_addLeakageTraceLogic");function r(M,O,j){return g(M,()=>{},0,void 0,O??!0,void 0,j)}a(r,"defer"),t.defer=r;function n(M){return(O,j=null,Q)=>{let U=!1,Y;return Y=M(W=>{if(!U)return Y?Y.dispose():U=!0,O.call(j,W)},null,Q),U&&Y.dispose(),Y}}a(n,"once"),t.once=n;function o(M,O){return t.once(t.filter(M,O))}a(o,"onceIf"),t.onceIf=o;function s(M,O,j){return h((Q,U=null,Y)=>M(W=>Q.call(U,O(W)),null,Y),j)}a(s,"map"),t.map=s;function c(M,O,j){return h((Q,U=null,Y)=>M(W=>{O(W),Q.call(U,W)},null,Y),j)}a(c,"forEach"),t.forEach=c;function l(M,O,j){return h((Q,U=null,Y)=>M(W=>O(W)&&Q.call(U,W),null,Y),j)}a(l,"filter"),t.filter=l;function u(M){return M}a(u,"signal"),t.signal=u;function d(...M){return(O,j=null,Q)=>{let U=(0,WC.combinedDisposable)(...M.map(Y=>Y(W=>O.call(j,W))));return m(U,Q)}}a(d,"any"),t.any=d;function f(M,O,j,Q){let U=j;return s(M,Y=>(U=O(U,Y),U),Q)}a(f,"reduce"),t.reduce=f;function h(M,O){let j,Q={onWillAddFirstListener(){j=M(U.fire,U)},onDidRemoveLastListener(){j?.dispose()}};O||e(Q);let U=new dE(Q);return O?.add(U),U.event}a(h,"snapshot");function m(M,O){return O instanceof Array?O.push(M):O&&O.add(M),M}a(m,"addAndReturnDisposable");function g(M,O,j=100,Q=!1,U=!1,Y,W){let V,z,ie,H=0,re,le={leakWarningThreshold:Y,onWillAddFirstListener(){V=M(ge=>{H++,z=O(z,ge),Q&&!ie&&(Le.fire(z),z=void 0),re=a(()=>{let Ue=z;z=void 0,ie=void 0,(!Q||H>1)&&Le.fire(Ue),H=0},"doFire"),typeof j=="number"?(ie&&clearTimeout(ie),ie=setTimeout(re,j)):ie===void 0&&(ie=null,queueMicrotask(re))})},onWillRemoveListener(){U&&H>0&&re?.()},onDidRemoveLastListener(){re=void 0,V.dispose()}};W||e(le);let Le=new dE(le);return W?.add(Le),Le.event}a(g,"debounce"),t.debounce=g;function A(M,O=0,j,Q){return t.debounce(M,(U,Y)=>U?(U.push(Y),U):[Y],O,void 0,j??!0,void 0,Q)}a(A,"accumulate"),t.accumulate=A;function y(M,O,j=100,Q=!0,U=!0,Y,W){let V,z,ie,H=0,re={leakWarningThreshold:Y,onWillAddFirstListener(){V=M(Le=>{H++,z=O(z,Le),ie===void 0&&(Q&&(le.fire(z),z=void 0,H=0),typeof j=="number"?ie=setTimeout(()=>{U&&H>0&&le.fire(z),z=void 0,ie=void 0,H=0},j):(ie=0,queueMicrotask(()=>{U&&H>0&&le.fire(z),z=void 0,ie=void 0,H=0})))})},onDidRemoveLastListener(){V.dispose()}};W||e(re);let le=new dE(re);return W?.add(le),le.event}a(y,"throttle"),t.throttle=y;function E(M,O=(Q,U)=>Q===U,j){let Q=!0,U;return l(M,Y=>{let W=Q||!O(Y,U);return Q=!1,U=Y,W},j)}a(E,"latch"),t.latch=E;function _(M,O,j){return[t.filter(M,O,j),t.filter(M,Q=>!O(Q),j)]}a(_,"split"),t.split=_;function v(M,O,j=!1,Q=[],U){let Y=Q.slice(),W;Gbn()&&(W={stack:Sue.create(),timerId:setTimeout(()=>{Y&&Y.length>0&&W&&!W.warned&&(W.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${Y.length} events buffered for ${Hbn/1e3}s without being consumed. Buffered here:`),W.stack.print())},Hbn),warned:!1},U&&U.add((0,WC.toDisposable)(()=>clearTimeout(W.timerId))));let V=a(()=>{W&&clearTimeout(W.timerId)},"clearLeakWarningTimer"),z=M(re=>{Y?(Y.push(re),Gbn()&&W&&!W.warned&&Y.length>=fVo&&(W.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${Y.length} events buffered without being consumed. Buffered here:`),W.stack.print())):H.fire(re)});U&&U.add(z);let ie=a(()=>{Y?.forEach(re=>H.fire(re)),Y=null,V()},"flush"),H=new dE({onWillAddFirstListener(){z||(z=M(re=>H.fire(re)),U&&U.add(z))},onDidAddFirstListener(){Y&&(j?setTimeout(ie):ie())},onDidRemoveLastListener(){z&&z.dispose(),z=null,V()}});return U&&U.add(H),H.event}a(v,"buffer"),t.buffer=v;function b(M,O){return a((Q,U,Y)=>{let W=O(new w);return M(function(V){let z=W.evaluate(V);z!==T&&Q.call(U,z)},void 0,Y)},"fn")}a(b,"chain"),t.chain=b;let T=Symbol("HaltChainable");class w{static{a(this,"ChainableSynthesis")}constructor(){this.steps=[]}map(O){return this.steps.push(O),this}forEach(O){return this.steps.push(j=>(O(j),j)),this}filter(O){return this.steps.push(j=>O(j)?j:T),this}reduce(O,j){let Q=j;return this.steps.push(U=>(Q=O(Q,U),Q)),this}latch(O=(j,Q)=>j===Q){let j=!0,Q;return this.steps.push(U=>{let Y=j||!O(U,Q);return j=!1,Q=U,Y?U:T}),this}evaluate(O){for(let j of this.steps)if(O=j(O),O===T)break;return O}}function R(M,O,j=Q=>Q){let Q=a((...V)=>W.fire(j(...V)),"fn"),U=a(()=>M.on(O,Q),"onFirstListenerAdd"),Y=a(()=>M.removeListener(O,Q),"onLastListenerRemove"),W=new dE({onWillAddFirstListener:U,onDidRemoveLastListener:Y});return W.event}a(R,"fromNodeEventEmitter"),t.fromNodeEventEmitter=R;function x(M,O,j=Q=>Q){let Q=a((...V)=>W.fire(j(...V)),"fn"),U=a(()=>M.addEventListener(O,Q),"onFirstListenerAdd"),Y=a(()=>M.removeEventListener(O,Q),"onLastListenerRemove"),W=new dE({onWillAddFirstListener:U,onDidRemoveLastListener:Y});return W.event}a(x,"fromDOMEventEmitter"),t.fromDOMEventEmitter=x;function P(M,O){let j,Q,U=new Promise(Y=>{Q=n(M)(Y),Ujt(Q,O),j=a(()=>{$bn(Q,O)},"cancelRef")});return U.cancel=j,O&&U.finally(()=>$bn(Q,O)),U}a(P,"toPromise"),t.toPromise=P;function D(M,O){return M(j=>O.fire(j))}a(D,"forward"),t.forward=D;function N(M,O,j){return O(j),M(Q=>O(Q))}a(N,"runAndSubscribe"),t.runAndSubscribe=N;class L{static{a(this,"EmitterObserver")}constructor(O,j){this._observable=O,this._counter=0,this._hasChanged=!1;let Q={onWillAddFirstListener:a(()=>{O.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{O.removeObserver(this)},"onDidRemoveLastListener")};j||e(Q),this.emitter=new dE(Q),j&&j.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,j){this._hasChanged=!0}endUpdate(O){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(M,O){return new L(M,O).emitter.event}a(B,"fromObservable"),t.fromObservable=B;function q(M){return(O,j,Q)=>{let U=0,Y=!1,W={beginUpdate(){U++},endUpdate(){U--,U===0&&(M.reportChanges(),Y&&(Y=!1,O.call(j)))},handlePossibleChange(){},handleChange(){Y=!0}};M.addObserver(W),M.reportChanges();let V={dispose(){M.removeObserver(W)}};return Ujt(V,Q),V}}a(q,"fromObservableLight"),t.fromObservableLight=q})(BJe||(Ga.Event=BJe={}));var FJe=class t{static{a(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${t._idPool++}`,t.all.add(this)}start(e){this._stopWatch=new uVo.StopWatch,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};Ga.EventProfiling=FJe;var awe=-1;function pVo(t){let e=awe;return awe=t,{dispose(){awe=e}}}a(pVo,"setGlobalLeakWarningThreshold");var kjt=class t{static{a(this,"LeakageMonitor")}static{this._idPool=1}constructor(e,r,n=(t._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=r,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,r){let n=this.threshold;if(n<=0||r.3?"dominated":"popular",f=new cwe(d,u,s,r,l);this._errorHandler(f)}return()=>{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[n,o]of this._stacks)(!e||r{e[t]||console.log(r)},3e3)}setParent(e,r){if(e&&e!==Pue.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==Pue.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function sJ(t){return oJ?.trackDisposable(t),t}a(sJ,"trackDisposable");function aJ(t){oJ?.markAsDisposed(t)}a(aJ,"markAsDisposed");function rF(t,e){oJ?.setParent(t,e)}a(rF,"setParentOfDisposable");function WWo(t,e){if(oJ)for(let r of t)oJ.setParent(r,e)}a(WWo,"setParentOfDisposables");function zWo(t){return oJ?.markAsSingleton(t),t}a(zWo,"markAsSingleton");function rSn(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}a(rSn,"isDisposable");function Ewe(t){if($Wo.Iterable.is(t)){let e=[];for(let r of t)if(r)try{r.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}a(Ewe,"dispose");function YWo(t){for(let e of t)rSn(e)&&e.dispose();return[]}a(YWo,"disposeIfDisposable");function KWo(...t){let e=mHt(()=>Ewe(t));return WWo(t,e),e}a(KWo,"combinedDisposable");var aHt=class{static{a(this,"FunctionDisposable")}constructor(e){this._isDisposed=!1,this._fn=e,sJ(this)}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,aJ(this),this._fn()}}};function mHt(t){return new aHt(t)}a(mHt,"toDisposable");var ywe=class t{static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,sJ(this)}dispose(){this._isDisposed||(aJ(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Ewe(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===Pue.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return rF(e,this),this._isDisposed?t.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.delete(e)&&rF(e,null)}assertNotDisposed(){this._isDisposed&&(0,X1n.onUnexpectedError)(new X1n.BugIndicatingError("Object disposed"))}};ds.DisposableStore=ywe;var Pue=class{static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new ywe,sJ(this),rF(this._store,this)}dispose(){aJ(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};ds.Disposable=Pue;var iZe=class{static{a(this,"MutableDisposable")}constructor(){this._isDisposed=!1,sJ(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&rF(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,aJ(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&rF(e,null),e}};ds.MutableDisposable=iZe;var cHt=class{static{a(this,"MandatoryMutableDisposable")}constructor(e){this._disposable=new iZe,this._isDisposed=!1,this._disposable.value=e}get value(){return this._disposable.value}set value(e){this._isDisposed||e===this._disposable.value||(this._disposable.value=e)}dispose(){this._isDisposed=!0,this._disposable.dispose()}};ds.MandatoryMutableDisposable=cHt;var lHt=class{static{a(this,"RefCountedDisposable")}constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}};ds.RefCountedDisposable=lHt;var uHt=class{static{a(this,"ReferenceCollection")}constructor(){this.references=new Map}acquire(e,...r){let n=this.references.get(e);n||(n={counter:0,object:this.createReferencedObject(e,...r)},this.references.set(e,n));let{object:o}=n,s=(0,GWo.createSingleCallFunction)(()=>{--n.counter===0&&(this.destroyReferencedObject(e,n.object),this.references.delete(e))});return n.counter++,{object:o,dispose:s}}};ds.ReferenceCollection=uHt;var dHt=class{static{a(this,"AsyncReferenceCollection")}constructor(e){this.referenceCollection=e}async acquire(e,...r){let n=this.referenceCollection.acquire(e,...r);try{return{object:await n.object,dispose:a(()=>n.dispose(),"dispose")}}catch(o){throw n.dispose(),o}}};ds.AsyncReferenceCollection=dHt;var fHt=class{static{a(this,"ImmortalReference")}constructor(e){this.object=e}dispose(){}};ds.ImmortalReference=fHt;function JWo(t){let e=new ywe;try{t(e)}finally{e.dispose()}}a(JWo,"disposeOnReturn");var oZe=class{static{a(this,"DisposableMap")}constructor(e=new Map){this._isDisposed=!1,this._store=e,sJ(this)}dispose(){aJ(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Ewe(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}get(e){return this._store.get(e)}set(e,r,n=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),n||this._store.get(e)?.dispose(),this._store.set(e,r),rF(r,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let r=this._store.get(e);return r&&rF(r,null),this._store.delete(e),r}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};ds.DisposableMap=oZe;var pHt=class{static{a(this,"DisposableSet")}constructor(e=new Set){this._isDisposed=!1,this._store=e,sJ(this)}dispose(){aJ(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Ewe(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}add(e){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableSet that has already been disposed of. The added object will be leaked!").stack),this._store.add(e),rF(e,this)}deleteAndDispose(e){this._store.delete(e)&&e.dispose()}deleteAndLeak(e){if(this._store.delete(e))return rF(e,null),e}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};ds.DisposableSet=pHt;function ZWo(t,e){let r=!1;return t.then(n=>{r||e(n)}),mHt(()=>{r=!0})}a(ZWo,"thenIfNotDisposed");function XWo(t,e){return t.then(r=>(e.isDisposed?r.dispose():e.add(r),r))}a(XWo,"thenRegisterOrDispose");var hHt=class extends oZe{static{a(this,"DisposableResourceMap")}constructor(){super(new eSn.ResourceMap)}};ds.DisposableResourceMap=hHt});var Due=I(sZe=>{"use strict";p();Object.defineProperty(sZe,"__esModule",{value:!0});sZe.LinkedList=void 0;var _u=class t{static{a(this,"Node")}static{this.Undefined=new t(void 0)}constructor(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}},gHt=class{static{a(this,"LinkedList")}constructor(){this._first=_u.Undefined,this._last=_u.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===_u.Undefined}clear(){let e=this._first;for(;e!==_u.Undefined;){let r=e.next;e.prev=_u.Undefined,e.next=_u.Undefined,e=r}this._first=_u.Undefined,this._last=_u.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,r){let n=new _u(e);if(this._first===_u.Undefined)this._first=n,this._last=n;else if(r){let s=this._last;this._last=n,n.prev=s,s.next=n}else{let s=this._first;this._first=n,n.next=s,s.prev=n}this._size+=1;let o=!1;return()=>{o||(o=!0,this._remove(n))}}shift(){if(this._first!==_u.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==_u.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==_u.Undefined)return this._last.element}_remove(e){if(e.prev!==_u.Undefined&&e.next!==_u.Undefined){let r=e.prev;r.next=e.next,e.next.prev=r}else e.prev===_u.Undefined&&e.next===_u.Undefined?(this._first=_u.Undefined,this._last=_u.Undefined):e.next===_u.Undefined?(this._last=this._last.prev,this._last.next=_u.Undefined):e.prev===_u.Undefined&&(this._first=this._first.next,this._first.prev=_u.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==_u.Undefined;)yield e.element,e=e.next}};sZe.LinkedList=gHt});var sSn=I(Nue=>{"use strict";p();Object.defineProperty(Nue,"__esModule",{value:!0});Nue.getNLSMessages=nSn;Nue.getNLSLanguage=iSn;Nue.localize=tzo;Nue.localize2=rzo;function nSn(){return globalThis._VSCODE_NLS_MESSAGES}a(nSn,"getNLSMessages");function iSn(){return globalThis._VSCODE_NLS_LANGUAGE}a(iSn,"getNLSLanguage");var ezo=iSn()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function aZe(t,e){let r;return e.length===0?r=t:r=t.replace(/\{(\d+)\}/g,(n,o)=>{let s=o[0],c=e[s],l=n;return typeof c=="string"?l=c:(typeof c=="number"||typeof c=="boolean"||c===void 0||c===null)&&(l=String(c)),l}),ezo&&(r="\uFF3B"+r.replace(/[aouei]/g,"$&$&")+"\uFF3D"),r}a(aZe,"_format");function tzo(t,e,...r){return aZe(typeof t=="number"?oSn(t,e):e,r)}a(tzo,"localize");function oSn(t,e){let r=nSn()?.[t];if(typeof r!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return r}a(oSn,"lookupMessage");function rzo(t,e,...r){let n;typeof t=="number"?n=oSn(t,e):n=e;let o=aZe(n,r);return{value:o,original:e===n?o:aZe(e,r)}}a(rzo,"localize2")});var jq=I(pr=>{"use strict";p();var nzo=pr&&pr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),izo=pr&&pr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ozo=pr&&pr.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=0,bwe=nF.indexOf("Macintosh")>=0,EHt=(nF.indexOf("Macintosh")>=0||nF.indexOf("iPad")>=0||nF.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,vwe=nF.indexOf("Linux")>=0,hSn=nF?.indexOf("Mobi")>=0,yHt=!0,cZe=szo.getNLSLanguage()||pr.LANGUAGE_DEFAULT,_we=navigator.language.toLowerCase(),AHt=_we):console.error("Unable to resolve platform.");function czo(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(czo,"PlatformToString");var lZe=0;bwe?lZe=1:Cwe?lZe=3:vwe&&(lZe=2);pr.isWindows=Cwe;pr.isMacintosh=bwe;pr.isLinux=vwe;pr.isLinuxSnap=uSn;pr.isNative=dSn;pr.isElectron=fSn;pr.isWeb=yHt;pr.isWebWorker=yHt&&typeof iF.importScripts=="function";pr.webWorkerOrigin=pr.isWebWorker?iF.origin:void 0;pr.isIOS=EHt;pr.isMobile=hSn;pr.isCI=pSn;pr.platform=lZe;pr.userAgent=nF;pr.language=cZe;var aSn;(function(t){function e(){return pr.language}a(e,"value"),t.value=e;function r(){return pr.language.length===2?pr.language==="en":pr.language.length>=3?pr.language[0]==="e"&&pr.language[1]==="n"&&pr.language[2]==="-":!1}a(r,"isDefaultVariant"),t.isDefaultVariant=r;function n(){return pr.language==="en"}a(n,"isDefault"),t.isDefault=n})(aSn||(pr.Language=aSn={}));pr.locale=_we;pr.platformLocale=AHt;pr.translationsConfigFile=mSn;pr.setTimeout0IsFaster=typeof iF.postMessage=="function"&&!iF.importScripts;pr.setTimeout0=(()=>{if(pr.setTimeout0IsFaster){let t=[];iF.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),iF.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();pr.OS=bwe||EHt?2:Cwe?1:3;var cSn=!0,lSn=!1;function lzo(){if(!lSn){lSn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,cSn=new Uint16Array(t.buffer)[0]===513}return cSn}a(lzo,"isLittleEndian");pr.isChrome=!!(pr.userAgent&&pr.userAgent.indexOf("Chrome")>=0);pr.isFirefox=!!(pr.userAgent&&pr.userAgent.indexOf("Firefox")>=0);pr.isSafari=!!(!pr.isChrome&&pr.userAgent&&pr.userAgent.indexOf("Safari")>=0);pr.isEdge=!!(pr.userAgent&&pr.userAgent.indexOf("Edg/")>=0);pr.isAndroid=!!(pr.userAgent&&pr.userAgent.indexOf("Android")>=0);function uzo(t){return parseFloat(t)>=25}a(uzo,"isTahoeOrNewer")});var Swe=I(HO=>{"use strict";p();Object.defineProperty(HO,"__esModule",{value:!0});HO.arch=HO.platform=HO.env=HO.cwd=void 0;var ASn=jq(),cJ,_Ht=globalThis.vscode;if(typeof _Ht<"u"&&typeof _Ht.process<"u"){let t=_Ht.process;cJ={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?cJ={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:cJ={get platform(){return ASn.isWindows?"win32":ASn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};HO.cwd=cJ.cwd;HO.env=cJ.env;HO.platform=cJ.platform;HO.arch=cJ.arch});var GO=I(uZe=>{"use strict";p();Object.defineProperty(uZe,"__esModule",{value:!0});uZe.StopWatch=void 0;var dzo=globalThis.performance.now.bind(globalThis.performance),vHt=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=e===!1?Date.now:dzo,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}};uZe.StopWatch=vHt});var Rc=I(Wa=>{"use strict";p();Object.defineProperty(Wa,"__esModule",{value:!0});Wa.ValueWithChangeEvent=Wa.Relay=Wa.EventBufferer=Wa.DynamicListEventMultiplexer=Wa.EventMultiplexer=Wa.MicrotaskEmitter=Wa.DebounceEmitter=Wa.PauseableEmitter=Wa.AsyncEmitter=Wa.createEventDeliveryQueue=Wa.Emitter=Wa.ListenerRefusalError=Wa.ListenerLeakError=Wa.EventProfiling=Wa.Event=void 0;Wa.setGlobalLeakWarningThreshold=yzo;Wa.trackSetChanges=Czo;var fzo=$jt(),Twe=Rs(),pzo=Wjt(),KC=Ro(),CSn=Due(),hzo=Swe(),mzo=GO(),ySn=!1,gzo=!1,Azo=100,ESn=6e4;function _Sn(){return!!hzo.env.VSCODE_DEV}a(_Sn,"_isBufferLeakWarningEnabled");var dZe;(function(t){t.None=()=>KC.Disposable.None;function e(M){if(gzo){let{onDidAddListener:O}=M,U=Oue.create(),q=0;M.onDidAddListener=()=>{++q===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),U.print()),O?.()}}}a(e,"_addLeakageTraceLogic");function r(M,O,U){return g(M,()=>{},0,void 0,O??!0,void 0,U)}a(r,"defer"),t.defer=r;function n(M){return(O,U=null,q)=>{let Q=!1,Y;return Y=M(W=>{if(!Q)return Y?Y.dispose():Q=!0,O.call(U,W)},null,q),Q&&Y.dispose(),Y}}a(n,"once"),t.once=n;function o(M,O){return t.once(t.filter(M,O))}a(o,"onceIf"),t.onceIf=o;function s(M,O,U){return h((q,Q=null,Y)=>M(W=>q.call(Q,O(W)),null,Y),U)}a(s,"map"),t.map=s;function c(M,O,U){return h((q,Q=null,Y)=>M(W=>{O(W),q.call(Q,W)},null,Y),U)}a(c,"forEach"),t.forEach=c;function l(M,O,U){return h((q,Q=null,Y)=>M(W=>O(W)&&q.call(Q,W),null,Y),U)}a(l,"filter"),t.filter=l;function u(M){return M}a(u,"signal"),t.signal=u;function d(...M){return(O,U=null,q)=>{let Q=(0,KC.combinedDisposable)(...M.map(Y=>Y(W=>O.call(U,W))));return m(Q,q)}}a(d,"any"),t.any=d;function f(M,O,U,q){let Q=U;return s(M,Y=>(Q=O(Q,Y),Q),q)}a(f,"reduce"),t.reduce=f;function h(M,O){let U,q={onWillAddFirstListener(){U=M(Q.fire,Q)},onDidRemoveLastListener(){U?.dispose()}};O||e(q);let Q=new gE(q);return O?.add(Q),Q.event}a(h,"snapshot");function m(M,O){return O instanceof Array?O.push(M):O&&O.add(M),M}a(m,"addAndReturnDisposable");function g(M,O,U=100,q=!1,Q=!1,Y,W){let V,z,ie,H=0,te,le={leakWarningThreshold:Y,onWillAddFirstListener(){V=M(ge=>{H++,z=O(z,ge),q&&!ie&&(Le.fire(z),z=void 0),te=a(()=>{let Oe=z;z=void 0,ie=void 0,(!q||H>1)&&Le.fire(Oe),H=0},"doFire"),typeof U=="number"?(ie&&clearTimeout(ie),ie=setTimeout(te,U)):ie===void 0&&(ie=null,queueMicrotask(te))})},onWillRemoveListener(){Q&&H>0&&te?.()},onDidRemoveLastListener(){te=void 0,V.dispose()}};W||e(le);let Le=new gE(le);return W?.add(Le),Le.event}a(g,"debounce"),t.debounce=g;function A(M,O=0,U,q){return t.debounce(M,(Q,Y)=>Q?(Q.push(Y),Q):[Y],O,void 0,U??!0,void 0,q)}a(A,"accumulate"),t.accumulate=A;function y(M,O,U=100,q=!0,Q=!0,Y,W){let V,z,ie,H=0,te={leakWarningThreshold:Y,onWillAddFirstListener(){V=M(Le=>{H++,z=O(z,Le),ie===void 0&&(q&&(le.fire(z),z=void 0,H=0),typeof U=="number"?ie=setTimeout(()=>{Q&&H>0&&le.fire(z),z=void 0,ie=void 0,H=0},U):(ie=0,queueMicrotask(()=>{Q&&H>0&&le.fire(z),z=void 0,ie=void 0,H=0})))})},onDidRemoveLastListener(){V.dispose()}};W||e(te);let le=new gE(te);return W?.add(le),le.event}a(y,"throttle"),t.throttle=y;function E(M,O=(q,Q)=>q===Q,U){let q=!0,Q;return l(M,Y=>{let W=q||!O(Y,Q);return q=!1,Q=Y,W},U)}a(E,"latch"),t.latch=E;function _(M,O,U){return[t.filter(M,O,U),t.filter(M,q=>!O(q),U)]}a(_,"split"),t.split=_;function v(M,O,U=!1,q=[],Q){let Y=q.slice(),W;_Sn()&&(W={stack:Oue.create(),timerId:setTimeout(()=>{Y&&Y.length>0&&W&&!W.warned&&(W.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${Y.length} events buffered for ${ESn/1e3}s without being consumed. Buffered here:`),W.stack.print())},ESn),warned:!1},Q&&Q.add((0,KC.toDisposable)(()=>clearTimeout(W.timerId))));let V=a(()=>{W&&clearTimeout(W.timerId)},"clearLeakWarningTimer"),z=M(te=>{Y?(Y.push(te),_Sn()&&W&&!W.warned&&Y.length>=Azo&&(W.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${Y.length} events buffered without being consumed. Buffered here:`),W.stack.print())):H.fire(te)});Q&&Q.add(z);let ie=a(()=>{Y?.forEach(te=>H.fire(te)),Y=null,V()},"flush"),H=new gE({onWillAddFirstListener(){z||(z=M(te=>H.fire(te)),Q&&Q.add(z))},onDidAddFirstListener(){Y&&(U?setTimeout(ie):ie())},onDidRemoveLastListener(){z&&z.dispose(),z=null,V()}});return Q&&Q.add(H),H.event}a(v,"buffer"),t.buffer=v;function b(M,O){return a((q,Q,Y)=>{let W=O(new w);return M(function(V){let z=W.evaluate(V);z!==T&&q.call(Q,z)},void 0,Y)},"fn")}a(b,"chain"),t.chain=b;let T=Symbol("HaltChainable");class w{static{a(this,"ChainableSynthesis")}constructor(){this.steps=[]}map(O){return this.steps.push(O),this}forEach(O){return this.steps.push(U=>(O(U),U)),this}filter(O){return this.steps.push(U=>O(U)?U:T),this}reduce(O,U){let q=U;return this.steps.push(Q=>(q=O(q,Q),q)),this}latch(O=(U,q)=>U===q){let U=!0,q;return this.steps.push(Q=>{let Y=U||!O(Q,q);return U=!1,q=Q,Y?Q:T}),this}evaluate(O){for(let U of this.steps)if(O=U(O),O===T)break;return O}}function R(M,O,U=q=>q){let q=a((...V)=>W.fire(U(...V)),"fn"),Q=a(()=>M.on(O,q),"onFirstListenerAdd"),Y=a(()=>M.removeListener(O,q),"onLastListenerRemove"),W=new gE({onWillAddFirstListener:Q,onDidRemoveLastListener:Y});return W.event}a(R,"fromNodeEventEmitter"),t.fromNodeEventEmitter=R;function x(M,O,U=q=>q){let q=a((...V)=>W.fire(U(...V)),"fn"),Q=a(()=>M.addEventListener(O,q),"onFirstListenerAdd"),Y=a(()=>M.removeEventListener(O,q),"onLastListenerRemove"),W=new gE({onWillAddFirstListener:Q,onDidRemoveLastListener:Y});return W.event}a(x,"fromDOMEventEmitter"),t.fromDOMEventEmitter=x;function P(M,O){let U,q,Q=new Promise(Y=>{q=n(M)(Y),PHt(q,O),U=a(()=>{vSn(q,O)},"cancelRef")});return Q.cancel=U,O&&Q.finally(()=>vSn(q,O)),Q}a(P,"toPromise"),t.toPromise=P;function D(M,O){return M(U=>O.fire(U))}a(D,"forward"),t.forward=D;function N(M,O,U){return O(U),M(q=>O(q))}a(N,"runAndSubscribe"),t.runAndSubscribe=N;class L{static{a(this,"EmitterObserver")}constructor(O,U){this._observable=O,this._counter=0,this._hasChanged=!1;let q={onWillAddFirstListener:a(()=>{O.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{O.removeObserver(this)},"onDidRemoveLastListener")};U||e(q),this.emitter=new gE(q),U&&U.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,U){this._hasChanged=!0}endUpdate(O){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(M,O){return new L(M,O).emitter.event}a(B,"fromObservable"),t.fromObservable=B;function j(M){return(O,U,q)=>{let Q=0,Y=!1,W={beginUpdate(){Q++},endUpdate(){Q--,Q===0&&(M.reportChanges(),Y&&(Y=!1,O.call(U)))},handlePossibleChange(){},handleChange(){Y=!0}};M.addObserver(W),M.reportChanges();let V={dispose(){M.removeObserver(W)}};return PHt(V,q),V}}a(j,"fromObservableLight"),t.fromObservableLight=j})(dZe||(Wa.Event=dZe={}));var fZe=class t{static{a(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${t._idPool++}`,t.all.add(this)}start(e){this._stopWatch=new mzo.StopWatch,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};Wa.EventProfiling=fZe;var Iwe=-1;function yzo(t){let e=Iwe;return Iwe=t,{dispose(){Iwe=e}}}a(yzo,"setGlobalLeakWarningThreshold");var CHt=class t{static{a(this,"LeakageMonitor")}static{this._idPool=1}constructor(e,r,n=(t._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=r,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,r){let n=this.threshold;if(n<=0||r.3?"dominated":"popular",f=new xwe(d,u,s,r,l);this._errorHandler(f)}return()=>{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[n,o]of this._stacks)(!e||r{if(t instanceof bue)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new kjt(e?.onListenerError??swe.onUnexpectedError,this._options?.leakWarningThreshold??awe,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new FJe(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(jbn){let e=this._listeners;queueMicrotask(()=>{Wbn(e,r=>r.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,r,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let d=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=d[1]/this._size>.3?"dominated":"popular",h=new UJe(f,`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||swe.onUnexpectedError)(h),WC.Disposable.None}if(this._disposed)return WC.Disposable.None;r&&(e=e.bind(r));let o=new bue(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Sue.create(),s=this._leakageMon.check(o.stack,this._size+1)),jbn&&(o.stack=c??Sue.create()),this._listeners?this._listeners instanceof bue?(this._deliveryQueue??=new QJe,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let l=(0,WC.toDisposable)(()=>{s?.(),this._removeListener(o)});return Ujt(l,n),l},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,n=r.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[n]=void 0;let o=this._deliveryQueue.current===this;if(this._size*mVo<=r.length){let s=0;for(let c=0;c0}};Ga.Emitter=dE;var gVo=a(()=>new QJe,"createEventDeliveryQueue");Ga.createEventDeliveryQueue=gVo;var QJe=class{static{a(this,"EventDeliveryQueuePrivate")}constructor(){this.i=-1,this.end=0}enqueue(e,r,n){this.i=0,this.end=n,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Pjt=class extends dE{static{a(this,"AsyncEmitter")}async fireAsync(e,r,n){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new Vbn.LinkedList),Wbn(this._listeners,o=>this._asyncDeliveryQueue.push([o.value,e]));this._asyncDeliveryQueue.size>0&&!r.isCancellationRequested;){let[o,s]=this._asyncDeliveryQueue.shift(),c=[],l={...s,token:r,waitUntil:a(u=>{if(Object.isFrozen(c))throw new Error("waitUntil can NOT be called asynchronous");n&&(u=n(u,o)),c.push(u)},"waitUntil")};try{o(l)}catch(u){(0,swe.onUnexpectedError)(u);continue}Object.freeze(c),await Promise.allSettled(c).then(u=>{for(let d of u)d.status==="rejected"&&(0,swe.onUnexpectedError)(d.reason)})}}};Ga.AsyncEmitter=Pjt;var qJe=class extends dE{static{a(this,"PauseableEmitter")}get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new Vbn.LinkedList,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){let e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}};Ga.PauseableEmitter=qJe;var Djt=class extends qJe{static{a(this,"DebounceEmitter")}constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}};Ga.DebounceEmitter=Djt;var Njt=class extends dE{static{a(this,"MicrotaskEmitter")}constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(r=>super.fire(r)),this._queuedEvents=[]}))}};Ga.MicrotaskEmitter=Njt;var jJe=class{static{a(this,"EventMultiplexer")}constructor(){this.hasListeners=!1,this.events=[],this.emitter=new dE({onWillAddFirstListener:a(()=>this.onFirstListenerAdd(),"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>this.onLastListenerRemove(),"onDidRemoveLastListener")})}get event(){return this.emitter.event}add(e){let r={event:e,listener:null};this.events.push(r),this.hasListeners&&this.hook(r);let n=a(()=>{this.hasListeners&&this.unhook(r);let o=this.events.indexOf(r);this.events.splice(o,1)},"dispose");return(0,WC.toDisposable)((0,cVo.createSingleCallFunction)(n))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(r=>this.emitter.fire(r))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){this.emitter.dispose();for(let e of this.events)e.listener?.dispose();this.events=[]}};Ga.EventMultiplexer=jJe;var Mjt=class{static{a(this,"DynamicListEventMultiplexer")}constructor(e,r,n,o){this._store=new WC.DisposableStore;let s=this._store.add(new jJe),c=this._store.add(new WC.DisposableMap);function l(u){c.set(u,s.add(o(u)))}a(l,"addItem");for(let u of e)l(u);this._store.add(r(u=>{l(u)})),this._store.add(n(u=>{c.deleteAndDispose(u)})),this.event=s.event}dispose(){this._store.dispose()}};Ga.DynamicListEventMultiplexer=Mjt;var Ojt=class{static{a(this,"EventBufferer")}constructor(){this.data=[]}wrapEvent(e,r,n){return(o,s,c)=>e(l=>{let u=this.data[this.data.length-1];if(!r){u?u.buffers.push(()=>o.call(s,l)):o.call(s,l);return}let d=u;if(!d){o.call(s,r(n,l));return}d.items??=[],d.items.push(l),d.buffers.length===0&&u.buffers.push(()=>{d.reducedResult??=n?d.items.reduce(r,n):d.items.reduce(r),o.call(s,d.reducedResult)})},void 0,c)}bufferEvents(e){let r={buffers:new Array};this.data.push(r);let n=e();return this.data.pop(),r.buffers.forEach(o=>o()),n}};Ga.EventBufferer=Ojt;var Ljt=class{static{a(this,"Relay")}constructor(){this.listening=!1,this.inputEvent=BJe.None,this.inputEventListener=WC.Disposable.None,this.emitter=new dE({onDidAddFirstListener:a(()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},"onDidAddFirstListener"),onDidRemoveLastListener:a(()=>{this.listening=!1,this.inputEventListener.dispose()},"onDidRemoveLastListener")}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}};Ga.Relay=Ljt;var Bjt=class{static{a(this,"ValueWithChangeEvent")}static const(e){return new Fjt(e)}constructor(e){this._value=e,this._onDidChange=new dE,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};Ga.ValueWithChangeEvent=Bjt;var Fjt=class{static{a(this,"ConstValueWithChangeEvent")}constructor(e){this.value=e,this.onDidChange=BJe.None}};function AVo(t,e,r){let n=new WC.DisposableMap,o=new Set(t());for(let c of o)n.set(c,r(c));let s=new WC.DisposableStore;return s.add(e(()=>{let c=t(),l=(0,aVo.diffSets)(o,c);for(let u of l.removed)n.deleteAndDispose(u);for(let u of l.added)n.set(u,r(u));o=new Set(c)})),s.add(n),s}a(AVo,"trackSetChanges");function Ujt(t,e){e instanceof WC.DisposableStore?e.add(t):Array.isArray(e)&&e.push(t)}a(Ujt,"addToDisposables");function $bn(t,e){if(e instanceof WC.DisposableStore)e.delete(t);else if(Array.isArray(e)){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}t.dispose()}a($bn,"disposeAndRemove")});var YP=I(J3=>{"use strict";p();Object.defineProperty(J3,"__esModule",{value:!0});J3.CancellationTokenPool=J3.CancellationTokenSource=J3.CancellationToken=void 0;J3.cancelOnDispose=EVo;var zbn=Ic(),yVo=Ro(),Ybn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),HJe;(function(t){function e(r){return r===t.None||r===t.Cancelled||r instanceof Tue?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}a(e,"isCancellationToken"),t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:zbn.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ybn})})(HJe||(J3.CancellationToken=HJe={}));var Tue=class{static{a(this,"MutableToken")}constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Ybn:(this._emitter||(this._emitter=new zbn.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},lwe=class{static{a(this,"CancellationTokenSource")}constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Tue),this._token}cancel(){this._token?this._token instanceof Tue&&this._token.cancel():this._token=HJe.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof Tue&&this._token.dispose():this._token=HJe.None}};J3.CancellationTokenSource=lwe;function EVo(t){let e=new lwe;return t.add({dispose(){e.cancel()}}),e.token}a(EVo,"cancelOnDispose");var Qjt=class{static{a(this,"CancellationTokenPool")}constructor(){this._source=new lwe,this._listeners=new yVo.DisposableStore,this._total=0,this._cancelled=0,this._isDone=!1}get token(){return this._source.token}add(e){if(this._isDone)return;if(this._total++,e.isCancellationRequested){this._cancelled++,this._check();return}let r=e.onCancellationRequested(()=>{r.dispose(),this._cancelled++,this._check()});this._listeners.add(r)}_check(){!this._isDone&&this._total>0&&this._total===this._cancelled&&(this._isDone=!0,this._listeners.dispose(),this._source.cancel())}dispose(){this._listeners.dispose(),this._source.dispose()}};J3.CancellationTokenPool=Qjt});var NA=I(Jr=>{"use strict";p();var _Vo=Jr&&Jr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vVo=Jr&&Jr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),CVo=Jr&&Jr.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=bVo&&t<=TVo||t>=SVo&&t<=IVo}a(X3,"isWindowsDeviceRoot");function $Je(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===XK&&l!==-1?++l:l=-1}return o}a($Je,"normalizeString");function RVo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(RVo,"formatExt");function Kbn(t,e){wVo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${RVo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(Kbn,"_format");Jr.win32={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],cp(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=Iue.cwd():(s=Iue.env[`=${e}`]||Iue.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===zC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)Ko(f)&&(l=1,d=!0);else if(Ko(f))if(d=!0,Ko(s.charCodeAt(1))){let h=2,m=h;for(;h2&&Ko(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=$Je(r,!n,"\\",Ko),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){cp(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return qjt(s)?"\\":t;if(Ko(s))if(o=!0,Ko(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Ko(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&Ko(t.charCodeAt(e-1))&&(c+="\\"),!o&&n===void 0&&t.includes(":")){if(c.length>=2&&X3(c.charCodeAt(0))&&c.charCodeAt(1)===Z3)return`.\\${c}`;let l=t.indexOf(":");do if(l===e-1||Ko(t.charCodeAt(l+1)))return`.\\${c}`;while((l=t.indexOf(":",l+1))!==-1)}return n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){cp(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return Ko(r)||e>2&&X3(r)&&t.charCodeAt(1)===Z3&&Ko(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&Ko(r.charCodeAt(0))){++o;let s=r.length;s>1&&Ko(r.charCodeAt(1))&&(++o,s>2&&(Ko(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return Jr.win32.normalize(e)},relative(t,e){if(cp(t,"from"),cp(e,"to"),t===e)return"";let r=Jr.win32.resolve(t),n=Jr.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";if(r.length!==t.length||n.length!==e.length){let A=r.split("\\"),y=n.split("\\");A[A.length-1]===""&&A.pop(),y[y.length-1]===""&&y.pop();let E=A.length,_=y.length,v=E<_?E:_,b;for(b=0;bv?y.slice(b).join("\\"):E>v?"..\\".repeat(E-1-b)+"..":"":"..\\".repeat(E-b)+y.slice(b).join("\\")}let o=0;for(;oo&&t.charCodeAt(s-1)===zC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===zC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===zC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===zC?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===zC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===zC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Jr.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===zC){if(e.charCodeAt(1)===zC){let r=e.charCodeAt(2);if(r!==xVo&&r!==XK)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(X3(e.charCodeAt(0))&&e.charCodeAt(1)===Z3&&e.charCodeAt(2)===zC)return`\\\\?\\${e}`;return e},dirname(t){cp(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return Ko(o)?t:".";if(Ko(o)){if(r=n=1,Ko(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Ko(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(Ko(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&cp(e,"suffix"),cp(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&X3(t.charCodeAt(0))&&t.charCodeAt(1)===Z3&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(Ko(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(Ko(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){cp(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===Z3&&X3(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(Ko(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===XK?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:Kbn.bind(null,"\\"),parse(t){cp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return Ko(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(Ko(o)){if(n=1,Ko(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),Ko(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===XK?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null};var kVo=(()=>{if(YC){let t=/\\/g;return()=>{let e=Iue.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>Iue.cwd()})();Jr.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=0&&!r;n--){let o=t[n];cp(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===_g)}if(!r){let n=kVo();e=`${n}/${e}`,r=n.charCodeAt(0)===_g}return e=$Je(e,!r,"/",qjt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(cp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===_g,r=t.charCodeAt(t.length-1)===_g;return t=$Je(t,!e,"/",qjt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return cp(t,"path"),t.length>0&&t.charCodeAt(0)===_g},join(...t){if(t.length===0)return".";let e=[];for(let r=0;r0&&e.push(n)}return e.length===0?".":Jr.posix.normalize(e.join("/"))},relative(t,e){if(cp(t,"from"),cp(e,"to"),t===e||(t=Jr.posix.resolve(t),e=Jr.posix.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===_g)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===_g?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===_g)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(cp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===_g,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===_g){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&cp(e,"suffix"),cp(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===_g){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===_g){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){cp(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t[c];if(l==="/"){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l==="."?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:Kbn.bind(null,"/"),parse(t){cp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===_g,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===_g){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===XK?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Jr.posix.win32=Jr.win32.win32=Jr.win32;Jr.posix.posix=Jr.win32.posix=Jr.posix;Jr.normalize=YC?Jr.win32.normalize:Jr.posix.normalize;Jr.isAbsolute=YC?Jr.win32.isAbsolute:Jr.posix.isAbsolute;Jr.join=YC?Jr.win32.join:Jr.posix.join;Jr.resolve=YC?Jr.win32.resolve:Jr.posix.resolve;Jr.relative=YC?Jr.win32.relative:Jr.posix.relative;Jr.dirname=YC?Jr.win32.dirname:Jr.posix.dirname;Jr.basename=YC?Jr.win32.basename:Jr.posix.basename;Jr.extname=YC?Jr.win32.extname:Jr.posix.extname;Jr.format=YC?Jr.win32.format:Jr.posix.format;Jr.parse=YC?Jr.win32.parse:Jr.posix.parse;Jr.toNamespacedPath=YC?Jr.win32.toNamespacedPath:Jr.posix.toNamespacedPath;Jr.sep=YC?Jr.win32.sep:Jr.posix.sep;Jr.delimiter=YC?Jr.win32.delimiter:Jr.posix.delimiter});var WJe=I(KP=>{"use strict";p();Object.defineProperty(KP,"__esModule",{value:!0});KP.WeakCachedFunction=KP.CachedFunction=KP.LRUCachedFunction=KP.Cache=void 0;KP.identity=VJe;var PVo=YP(),jjt=class{static{a(this,"Cache")}constructor(e){this.task=e,this.result=null}get(){if(this.result)return this.result;let e=new PVo.CancellationTokenSource,r=this.task(e.token);return this.result={promise:r,dispose:a(()=>{this.result=null,e.cancel(),e.dispose()},"dispose")},this.result}};KP.Cache=jjt;function VJe(t){return t}a(VJe,"identity");var Hjt=class{static{a(this,"LRUCachedFunction")}constructor(e,r){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=VJe):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);return this.lastArgKey!==r&&(this.lastArgKey=r,this.lastCache=this._fn(e)),this.lastCache}};KP.LRUCachedFunction=Hjt;var Gjt=class{static{a(this,"CachedFunction")}get cachedValues(){return this._map}constructor(e,r){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=VJe):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);if(this._map2.has(r))return this._map2.get(r);let n=this._fn(e);return this._map.set(e,n),this._map2.set(r,n),n}};KP.CachedFunction=Gjt;var $jt=class{static{a(this,"WeakCachedFunction")}constructor(e,r){this._map=new WeakMap,typeof e=="function"?(this._fn=e,this._computeKey=VJe):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);if(this._map.has(r))return this._map.get(r);let n=this._fn(e);return this._map.set(r,n),n}};KP.WeakCachedFunction=$jt});var eF=I(zJe=>{"use strict";p();Object.defineProperty(zJe,"__esModule",{value:!0});zJe.Lazy=void 0;var kq;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Running=1]="Running",t[t.Completed=2]="Completed"})(kq||(kq={}));var Vjt=class{static{a(this,"Lazy")}constructor(e){this.executor=e,this._state=kq.Uninitialized}get hasValue(){return this._state===kq.Completed}get value(){if(this._state===kq.Uninitialized){this._state=kq.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=kq.Completed}}else if(this._state===kq.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};zJe.Lazy=Vjt});var em=I(kr=>{"use strict";p();Object.defineProperty(kr,"__esModule",{value:!0});kr.Ellipsis=kr.InvisibleCharacters=kr.AmbiguousCharacters=kr.noBreakWhitespace=kr.UTF8_BOM_CHARACTER=kr.UNUSUAL_LINE_TERMINATORS=kr.GraphemeIterator=kr.CodePointIterator=void 0;kr.isFalsyOrWhitespace=NVo;kr.format=OVo;kr.format2=BVo;kr.htmlAttributeEncodeValue=FVo;kr.escape=UVo;kr.escapeRegExpCharacters=Xbn;kr.count=QVo;kr.truncate=qVo;kr.truncateMiddle=jVo;kr.trim=HVo;kr.ltrim=e1n;kr.rtrim=t1n;kr.convertSimple2RegExpPattern=GVo;kr.createRegExp=$Vo;kr.regExpLeadsToEndlessLoop=VVo;kr.joinStrings=WVo;kr.splitLines=zVo;kr.splitLinesIncludeSeparators=YVo;kr.indexOfPattern=KVo;kr.firstNonWhitespaceIndex=r1n;kr.getLeadingWhitespace=JVo;kr.lastNonWhitespaceIndex=ZVo;kr.getIndentationLength=XVo;kr.replaceAsync=eWo;kr.compare=tWo;kr.compareSubstring=n1n;kr.compareIgnoreCase=rWo;kr.compareSubstringIgnoreCase=dwe;kr.isAsciiDigit=nWo;kr.isLowerAsciiLetter=zjt;kr.isUpperAsciiLetter=iWo;kr.equalsIgnoreCase=i1n;kr.equals=oWo;kr.startsWithIgnoreCase=sWo;kr.endsWithIgnoreCase=aWo;kr.commonPrefixLength=cWo;kr.commonSuffixLength=lWo;kr.isHighSurrogate=Jjt;kr.isLowSurrogate=YJe;kr.computeCodePoint=Zjt;kr.getNextCodePoint=o1n;kr.nextCharLength=s1n;kr.prevCharLength=a1n;kr.getCharContainingOffset=dWo;kr.charCount=fWo;kr.containsRTL=hWo;kr.isBasicASCII=gWo;kr.containsUnusualLineTerminators=AWo;kr.isFullWidthCharacter=yWo;kr.isEmojiImprecise=c1n;kr.lcut=EWo;kr.rcut=_Wo;kr.forAnsiStringParts=SWo;kr.removeAnsiEscapeCodes=u1n;kr.removeAnsiEscapeCodesFromPrompt=IWo;kr.startsWithUTF8BOM=d1n;kr.stripUTF8BOM=xWo;kr.fuzzyContains=wWo;kr.containsUppercaseCharacter=RWo;kr.uppercaseFirstLetter=kWo;kr.getNLines=PWo;kr.singleLetterHash=DWo;kr.getGraphemeBreakType=NWo;kr.getLeftDeleteOffset=OWo;kr.multibyteAwareBtoa=UWo;var DVo=WJe(),Jbn=eF();function NVo(t){return!t||typeof t!="string"?!0:t.trim().length===0}a(NVo,"isFalsyOrWhitespace");var MVo=/{(\d+)}/g;function OVo(t,...e){return e.length===0?t:t.replace(MVo,function(r,n){let o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?r:e[o]})}a(OVo,"format");var LVo=/{([^}]+)}/g;function BVo(t,e){return Object.keys(e).length===0?t:t.replace(LVo,(r,n)=>e[n]??r)}a(BVo,"format2");function FVo(t){return t.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}a(FVo,"htmlAttributeEncodeValue");function UVo(t){return t.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}a(UVo,"escape");function Xbn(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(Xbn,"escapeRegExpCharacters");function QVo(t,e){let r=0,n=t.indexOf(e);for(;n!==-1;)r++,n=t.indexOf(e,n+e.length);return r}a(QVo,"count");function qVo(t,e,r=kr.Ellipsis){return t.length<=e?t:`${t.substr(0,e)}${r}`}a(qVo,"truncate");function jVo(t,e,r=kr.Ellipsis){if(t.length<=e)return t;let n=Math.ceil(e/2)-r.length/2,o=Math.floor(e/2)-r.length/2;return`${t.substr(0,n)}${r}${t.substr(t.length-o)}`}a(jVo,"truncateMiddle");function HVo(t,e=" "){let r=e1n(t,e);return t1n(r,e)}a(HVo,"trim");function e1n(t,e){if(!t||!e)return t;let r=e.length,n=0;if(r===1){let o=e.charCodeAt(0);for(;n0&&t.charCodeAt(s-1)===c;)s--;return t.substring(0,s)}let o=n;for(;o>0&&t.endsWith(e,o);)o-=r;return t.substring(0,o)}a(t1n,"rtrim");function GVo(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}a(GVo,"convertSimple2RegExpPattern");function $Vo(t,e,r={}){if(!t)throw new Error("Cannot create regex from empty string");e||(t=Xbn(t)),r.wholeWord&&(/\B/.test(t.charAt(0))||(t="\\b"+t),/\B/.test(t.charAt(t.length-1))||(t=t+"\\b"));let n="";return r.global&&(n+="g"),r.matchCase||(n+="i"),r.multiline&&(n+="m"),r.unicode&&(n+="u"),new RegExp(t,n)}a($Vo,"createRegExp");function VVo(t){return t.source==="^"||t.source==="^$"||t.source==="$"||t.source==="^\\s*$"?!1:!!(t.exec("")&&t.lastIndex===0)}a(VVo,"regExpLeadsToEndlessLoop");function WVo(t,e){return t.filter(r=>r!=null&&r!==!1).join(e)}a(WVo,"joinStrings");function zVo(t){return t.split(/\r\n|\r|\n/)}a(zVo,"splitLines");function YVo(t){let e=[],r=t.split(/(\r\n|\r|\n)/);for(let n=0;n=0;r--){let n=t.charCodeAt(r);if(n!==32&&n!==9)return r}return-1}a(ZVo,"lastNonWhitespaceIndex");function XVo(t){let e=r1n(t);return e===-1?t.length:e}a(XVo,"getIndentationLength");function eWo(t,e,r){let n=[],o=0;for(let s of t.matchAll(e)){if(n.push(t.slice(o,s.index)),s.index===void 0)throw new Error("match.index should be defined");o=s.index+s[0].length,n.push(r(s[0],...s.slice(1),s.index,t,s.groups))}return n.push(t.slice(o)),Promise.all(n).then(s=>s.join(""))}a(eWo,"replaceAsync");function tWo(t,e){return te?1:0}a(tWo,"compare");function n1n(t,e,r=0,n=t.length,o=0,s=e.length){for(;rd)return 1}let c=n-r,l=s-o;return cl?1:0}a(n1n,"compareSubstring");function rWo(t,e){return dwe(t,e,0,t.length,0,e.length)}a(rWo,"compareIgnoreCase");function dwe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return n1n(t.toLowerCase(),e.toLowerCase(),r,n,o,s);zjt(u)&&(u-=32),zjt(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(dwe,"compareSubstringIgnoreCase");function nWo(t){return t>=48&&t<=57}a(nWo,"isAsciiDigit");function zjt(t){return t>=97&&t<=122}a(zjt,"isLowerAsciiLetter");function iWo(t){return t>=65&&t<=90}a(iWo,"isUpperAsciiLetter");function i1n(t,e){return t.length===e.length&&dwe(t,e)===0}a(i1n,"equalsIgnoreCase");function oWo(t,e,r){return t===e||!!r&&t!==void 0&&e!==void 0&&i1n(t,e)}a(oWo,"equals");function sWo(t,e){let r=e.length;return r<=t.length&&dwe(t,e,0,r)===0}a(sWo,"startsWithIgnoreCase");function aWo(t,e){let r=t.length,n=r-e.length;return n>=0&&dwe(t,e,n,r)===0}a(aWo,"endsWithIgnoreCase");function cWo(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n1){let n=t.charCodeAt(e-2);if(Jjt(n))return Zjt(n,r)}return r}a(uWo,"getPrevCodePoint");var xue=class{static{a(this,"CodePointIterator")}get offset(){return this._offset}constructor(e,r=0){this._str=e,this._len=e.length,this._offset=r}setOffset(e){this._offset=e}prevCodePoint(){let e=uWo(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=o1n(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}};kr.CodePointIterator=xue;var wue=class{static{a(this,"GraphemeIterator")}get offset(){return this._iterator.offset}constructor(e,r=0){this._iterator=new xue(e,r)}nextGraphemeLength(){let e=uwe.getInstance(),r=this._iterator,n=r.offset,o=e.getGraphemeBreakType(r.nextCodePoint());for(;!r.eol();){let s=r.offset,c=e.getGraphemeBreakType(r.nextCodePoint());if(Zbn(o,c)){r.setOffset(s);break}o=c}return r.offset-n}prevGraphemeLength(){let e=uwe.getInstance(),r=this._iterator,n=r.offset,o=e.getGraphemeBreakType(r.prevCodePoint());for(;r.offset>0;){let s=r.offset,c=e.getGraphemeBreakType(r.prevCodePoint());if(Zbn(c,o)){r.setOffset(s);break}o=c}return n-r.offset}eol(){return this._iterator.eol()}};kr.GraphemeIterator=wue;function s1n(t,e){return new wue(t,e).nextGraphemeLength()}a(s1n,"nextCharLength");function a1n(t,e){return new wue(t,e).prevGraphemeLength()}a(a1n,"prevCharLength");function dWo(t,e){e>0&&YJe(t.charCodeAt(e))&&e--;let r=e+s1n(t,e);return[r-a1n(t,r),r]}a(dWo,"getCharContainingOffset");function fWo(t){let e=new wue(t),r=0;for(;!e.eol();)r++,e.nextGraphemeLength();return r}a(fWo,"charCount");var Wjt;function pWo(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}a(pWo,"makeContainsRtl");function hWo(t){return Wjt||(Wjt=pWo()),Wjt.test(t)}a(hWo,"containsRTL");var mWo=/^[\t\n\r\x20-\x7E]*$/;function gWo(t){return mWo.test(t)}a(gWo,"isBasicASCII");kr.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function AWo(t){return kr.UNUSUAL_LINE_TERMINATORS.test(t)}a(AWo,"containsUnusualLineTerminators");function yWo(t){return t>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374||t>=65504&&t<=65510}a(yWo,"isFullWidthCharacter");function c1n(t){return t>=127462&&t<=127487||t===8986||t===8987||t===9200||t===9203||t>=9728&&t<=10175||t===11088||t===11093||t>=127744&&t<=128591||t>=128640&&t<=128764||t>=128992&&t<=129008||t>=129280&&t<=129535||t>=129648&&t<=129782}a(c1n,"isEmojiImprecise");function EWo(t,e,r=""){let n=t.trimStart();if(n.lengthe){c=!0;break}s=o.lastIndex,o.lastIndex+=1}if(!c)return n;if(s===0)return r;let l=n.substring(0,s).trimEnd();return l.length!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/,CWo=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,bWo=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,l1n=new RegExp("(?:"+[vWo.source,CWo.source,bWo.source].join("|")+")","g");function*SWo(t){let e=0;for(let r of t.matchAll(l1n))e!==r.index&&(yield{isCode:!1,str:t.substring(e,r.index)}),yield{isCode:!0,str:r[0]},e=r.index+r[0].length;e!==t.length&&(yield{isCode:!1,str:t.substring(e)})}a(SWo,"forAnsiStringParts");function u1n(t){return t&&(t=t.replace(l1n,"")),t}a(u1n,"removeAnsiEscapeCodes");var TWo=/\\\[.*?\\\]/g;function IWo(t){return u1n(t).replace(TWo,"")}a(IWo,"removeAnsiEscapeCodesFromPrompt");kr.UTF8_BOM_CHARACTER="\uFEFF";function d1n(t){return!!(t&&t.length>0&&t.charCodeAt(0)===65279)}a(d1n,"startsWithUTF8BOM");function xWo(t){return d1n(t)?t.substr(1):t}a(xWo,"stripUTF8BOM");function wWo(t,e){if(!t||!e||t.length0&&r>=0);return r===-1?t:(t[r-1]==="\r"&&r--,t.substr(0,r))}a(PWo,"getNLines");function DWo(t){return t=t%52,t<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}a(DWo,"singleLetterHash");function NWo(t){return uwe.getInstance().getGraphemeBreakType(t)}a(NWo,"getGraphemeBreakType");function Zbn(t,e){return t===0?e!==5&&e!==7:t===2&&e===3?!1:t===4||t===2||t===3||e===4||e===2||e===3?!0:!(t===8&&(e===8||e===9||e===11||e===12)||(t===11||t===9)&&(e===9||e===10)||(t===12||t===10)&&e===10||e===5||e===13||e===7||t===1||t===13&&e===14||t===6&&e===6)}a(Zbn,"breakBetweenGraphemeBreakType");var uwe=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=MWo()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let r=this._data,n=r.length/3,o=1;for(;o<=n;)if(er[3*o+1])o=2*o+1;else return r[3*o+2];return 0}};function MWo(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}a(MWo,"getGraphemeBreakRawData");function OWo(t,e){if(t===0)return 0;let r=LWo(t,e);if(r!==void 0)return r;let n=new xue(e,t);return n.prevCodePoint(),n.offset}a(OWo,"getLeftDeleteOffset");function LWo(t,e){let r=new xue(e,t),n=r.prevCodePoint();for(;BWo(n)||n===65039||n===8419;){if(r.offset===0)return;n=r.prevCodePoint()}if(!c1n(n))return;let o=r.offset;return o>0&&r.prevCodePoint()===8205&&(o=r.offset),o}a(LWo,"getOffsetBeforeLastEmojiComponent");function BWo(t){return 127995<=t&&t<=127999}a(BWo,"isEmojiModifier");kr.noBreakWhitespace="\xA0";var Yjt=class t{static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new Jbn.Lazy(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'))}static{this.cache=new DVo.LRUCachedFunction(e=>{let r=e.split(",");function n(h){let m=new Map;for(let g=0;g!h.startsWith("_")&&Object.hasOwn(c,h));l.length===0&&(l=["_default"]);let u;for(let h of l){let m=n(c[h]);u=s(u,m)}let d=n(c._common),f=o(d,u);return new t(f)})}static getInstance(e){return t.cache.get(Array.from(e).join(","))}static{this._locales=new Jbn.Lazy(()=>Object.keys(t.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return t._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let r=0;r{"use strict";p();Object.defineProperty(d0,"__esModule",{value:!0});d0.isPathSeparator=tF;d0.toSlashes=f1n;d0.toPosixPath=qWo;d0.getRoot=jWo;d0.isUNC=HWo;d0.isValidBasename=WWo;d0.isEqual=zWo;d0.isEqualOrParent=YWo;d0.isWindowsDriveLetter=Xjt;d0.sanitizeFilePath=KWo;d0.removeTrailingPathSeparator=p1n;d0.isRootOrDriveLetter=JWo;d0.hasDriveLetter=eHt;d0.getDriveLetter=ZWo;d0.indexOfPath=XWo;d0.parseLineAndColumnAware=ezo;d0.randomPath=nzo;var u0=NA(),Pq=Rq(),KJe=em(),QWo=KS();function tF(t){return t===47||t===92}a(tF,"isPathSeparator");function f1n(t){return t.replace(/[\\/]/g,u0.posix.sep)}a(f1n,"toSlashes");function qWo(t){return t.indexOf("/")===-1&&(t=f1n(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}a(qWo,"toPosixPath");function jWo(t,e=u0.posix.sep){if(!t)return"";let r=t.length,n=t.charCodeAt(0);if(tF(n)){if(tF(t.charCodeAt(1))&&!tF(t.charCodeAt(2))){let s=3,c=s;for(;s\|]/g,$Wo=/[/]/g,VWo=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function WWo(t,e=Pq.isWindows){let r=e?GWo:$Wo;return!(!t||t.length===0||/^\s+$/.test(t)||(r.lastIndex=0,r.test(t))||e&&VWo.test(t)||t==="."||t===".."||e&&t[t.length-1]==="."||e&&t.length!==t.trim().length||t.length>255)}a(WWo,"isValidBasename");function zWo(t,e,r){let n=t===e;return!r||n?n:!t||!e?!1:(0,KJe.equalsIgnoreCase)(t,e)}a(zWo,"isEqual");function YWo(t,e,r,n=!1){let o=n?u0.posix.sep:u0.sep;if(t===e)return!0;if(!t||!e||((t.indexOf("..")>=0||e.indexOf("..")>=0)&&(t=n?u0.posix.normalize(t):(0,u0.normalize)(t),e=n?u0.posix.normalize(e):(0,u0.normalize)(e)),e.length>t.length))return!1;if(r){if(!(0,KJe.startsWithIgnoreCase)(t,e))return!1;if(e.length===t.length)return!0;let c=e.length;return e.charAt(e.length-1)===o&&c--,t.charAt(c)===o}return e.charAt(e.length-1)!==o&&(e+=o),t.indexOf(e)===0}a(YWo,"isEqualOrParent");function Xjt(t){return t>=65&&t<=90||t>=97&&t<=122}a(Xjt,"isWindowsDriveLetter");function KWo(t,e){return Pq.isWindows&&t.endsWith(":")&&(t+=u0.sep),(0,u0.isAbsolute)(t)||(t=(0,u0.join)(e,t)),t=(0,u0.normalize)(t),p1n(t)}a(KWo,"sanitizeFilePath");function p1n(t){return Pq.isWindows?(t=(0,KJe.rtrim)(t,u0.sep),t.endsWith(":")&&(t+=u0.sep)):(t=(0,KJe.rtrim)(t,u0.sep),t||(t=u0.sep)),t}a(p1n,"removeTrailingPathSeparator");function JWo(t){let e=(0,u0.normalize)(t);return Pq.isWindows?t.length>3?!1:eHt(e)&&(t.length===2||e.charCodeAt(2)===92):e===u0.posix.sep}a(JWo,"isRootOrDriveLetter");function eHt(t,e=Pq.isWindows){return e?Xjt(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}a(eHt,"hasDriveLetter");function ZWo(t,e=Pq.isWindows){return eHt(t,e)?t[0]:void 0}a(ZWo,"getDriveLetter");function XWo(t,e,r){return e.length>t.length?-1:t===e?0:(r&&(t=t.toLowerCase(),e=e.toLowerCase()),t.indexOf(e))}a(XWo,"indexOfPath");function ezo(t){let e=t.split(":"),r,n,o;for(let s of e){let c=Number(s);(0,QWo.isNumber)(c)?n===void 0?n=c:o===void 0&&(o=c):r=r?[r,s].join(":"):s}if(!r)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:r,line:n!==void 0?n:void 0,column:o!==void 0?o:n!==void 0?1:void 0}}a(ezo,"parseLineAndColumnAware");var tzo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",rzo="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function nzo(t,e,r=8){let n="";for(let s=0;s{"use strict";p();var izo=iw&&iw.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ozo=iw&&iw.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),szo=iw&&iw.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0?` Found '${r[0][0]}' at index ${r[0].index} (${r.length} total)`:"";throw new Error(`[UriError]: Scheme contains illegal characters.${n} (len:${t.scheme.length})`)}if(t.path){if(t.authority){if(!czo.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(lzo.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(uzo,"_validateUri");function dzo(t,e){return!t&&!e?"file":t}a(dzo,"_schemeFix");function fzo(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==JP&&(e=JP+e):e=JP;break}return e}a(fzo,"_referenceResolution");var Gl="",JP="/",pzo=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,XJe=class t{static{a(this,"URI")}static isUri(e){return e instanceof t?!0:!e||typeof e!="object"?!1:typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function"}constructor(e,r,n,o,s,c=!1){typeof e=="object"?(this.scheme=e.scheme||Gl,this.authority=e.authority||Gl,this.path=e.path||Gl,this.query=e.query||Gl,this.fragment=e.fragment||Gl):(this.scheme=dzo(e,c),this.authority=r||Gl,this.path=fzo(this.scheme,n||Gl),this.query=o||Gl,this.fragment=s||Gl,uzo(this,c))}get fsPath(){return eZe(this,!1)}with(e){if(!e)return this;let{scheme:r,authority:n,path:o,query:s,fragment:c}=e;return r===void 0?r=this.scheme:r===null&&(r=Gl),n===void 0?n=this.authority:n===null&&(n=Gl),o===void 0?o=this.path:o===null&&(o=Gl),s===void 0?s=this.query:s===null&&(s=Gl),c===void 0?c=this.fragment:c===null&&(c=Gl),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new Dq(r,n,o,s,c)}static parse(e,r=!1){let n=pzo.exec(e);return n?new Dq(n[2]||Gl,JJe(n[4]||Gl),JJe(n[5]||Gl),JJe(n[7]||Gl),JJe(n[9]||Gl),r):new Dq(Gl,Gl,Gl,Gl,Gl)}static file(e){let r=Gl;if(ZJe.isWindows&&(e=e.replace(/\\/g,JP)),e[0]===JP&&e[1]===JP){let n=e.indexOf(JP,2);n===-1?(r=e.substring(2),e=JP):(r=e.substring(2,n),e=e.substring(n)||JP)}return new Dq("file",r,e,Gl,Gl)}static from(e,r){return new Dq(e.scheme,e.authority,e.path,e.query,e.fragment,r)}static joinPath(e,...r){if(!e.path)throw new Error(`[UriError]: cannot call joinPath on URI without path: ${e.toString()}`);let n;return ZJe.isWindows&&e.scheme==="file"?n=t.file(h1n.win32.join(eZe(e,!0),...r)).path:n=h1n.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return rHt(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new Dq(e);return r._formatted=e.external??null,r._fsPath=e._sep===A1n?e.fsPath??null:null,r}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};iw.URI=XJe;function hzo(t){return!t||typeof t!="object"?!1:typeof t.scheme=="string"&&(typeof t.authority=="string"||typeof t.authority>"u")&&(typeof t.path=="string"||typeof t.path>"u")&&(typeof t.query=="string"||typeof t.query>"u")&&(typeof t.fragment=="string"||typeof t.fragment>"u")}a(hzo,"isUriComponents");var A1n=ZJe.isWindows?1:void 0,Dq=class extends XJe{static{a(this,"Uri")}constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=eZe(this,!1)),this._fsPath}toString(e=!1){return e?rHt(this,!0):(this._formatted||(this._formatted=rHt(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=A1n),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},y1n={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function m1n(t,e,r){let n,o=-1;for(let s=0;s=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===45||c===46||c===95||c===126||e&&c===47||r&&c===91||r&&c===93||r&&c===58)o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n!==void 0&&(n+=t.charAt(s));else{n===void 0&&(n=t.substr(0,s));let l=y1n[c];l!==void 0?(o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n+=l):o===-1&&(o=s)}}return o!==-1&&(n+=encodeURIComponent(t.substring(o))),n!==void 0?n:t}a(m1n,"encodeURIComponentFast");function mzo(t){let e;for(let r=0;r1&&t.scheme==="file"?r=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?r=t.path.substr(1):r=t.path[1].toLowerCase()+t.path.substr(2):r=t.path,ZJe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(eZe,"uriToFsPath");function rHt(t,e){let r=e?mzo:m1n,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=JP,n+=JP),s){let d=s.indexOf("@");if(d!==-1){let f=s.substr(0,d);s=s.substr(d+1),d=f.lastIndexOf(":"),d===-1?n+=r(f,!1,!1):(n+=r(f.substr(0,d),!1,!1),n+=":",n+=r(f.substr(d+1),!1,!0)),n+="@"}s=s.toLowerCase(),d=s.lastIndexOf(":"),d===-1?n+=r(s,!1,!0):(n+=r(s.substr(0,d),!1,!0),n+=s.substr(d))}if(c){if(c.length>=3&&c.charCodeAt(0)===47&&c.charCodeAt(2)===58){let d=c.charCodeAt(1);d>=65&&d<=90&&(c=`/${String.fromCharCode(d+32)}:${c.substr(3)}`)}else if(c.length>=2&&c.charCodeAt(1)===58){let d=c.charCodeAt(0);d>=65&&d<=90&&(c=`${String.fromCharCode(d+32)}:${c.substr(2)}`)}n+=r(c,!0,!1)}return l&&(n+="?",n+=r(l,!1,!1)),u&&(n+="#",n+=e?u:m1n(u,!1,!1)),n}a(rHt,"_asFormatted");function E1n(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+E1n(t.substr(3)):t}}a(E1n,"decodeURIComponentGraceful");var g1n=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function JJe(t){return t.match(g1n)?t.replace(g1n,e=>E1n(e)):t}a(JJe,"percentDecode")});var tJ=I(ms=>{"use strict";p();var gzo=ms&&ms.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Azo=ms&&ms.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),aHt=ms&&ms.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oC1n(t,r))}a(Ezo,"matchesSomeScheme");ms.connectionTokenCookieName="vscode-tkn";ms.connectionTokenQueryName="tkn";var oHt=class{static{a(this,"RemoteAuthoritiesImpl")}constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}setDelegate(e){this._delegate=e}setServerRootPath(e,r){this._serverRootPath=iHt.posix.join(r??"/",b1n(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return iHt.posix.join(this._serverRootPath,UO.vscodeRemoteResource)}set(e,r,n){this._hosts[e]=r,this._ports[e]=n}setConnectionToken(e,r){this._connectionTokens[e]=r}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(l){return yzo.onUnexpectedExternalError(l),e}let r=e.authority,n=this._hosts[r];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);let o=this._ports[r],s=this._connectionTokens[r],c=`path=${encodeURIComponent(e.path)}`;return typeof s=="string"&&(c+=`&${ms.connectionTokenQueryName}=${encodeURIComponent(s)}`),eJ.URI.from({scheme:nHt.isWeb?this._preferredWebSchema:UO.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:c})}};ms.RemoteAuthorities=new oHt;function b1n(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}a(b1n,"getServerProductSegment");ms.builtinExtensionsPath="vs/../../extensions";ms.nodeModulesPath="vs/../../node_modules";ms.nodeModulesAsarPath="vs/../../node_modules.asar";ms.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";ms.VSCODE_AUTHORITY="vscode-app";var sHt=class t{static{a(this,"FileAccessImpl")}static{this.FALLBACK_AUTHORITY=ms.VSCODE_AUTHORITY}asBrowserUri(e){let r=this.toUri(e);return this.uriToBrowserUri(r)}uriToBrowserUri(e){return e.scheme===UO.vscodeRemote?ms.RemoteAuthorities.rewrite(e):e.scheme===UO.file&&(nHt.isNative||nHt.webWorkerOrigin===`${UO.vscodeFileResource}://${t.FALLBACK_AUTHORITY}`)?e.with({scheme:UO.vscodeFileResource,authority:e.authority||t.FALLBACK_AUTHORITY,query:null,fragment:null}):e}asFileUri(e){let r=this.toUri(e);return this.uriToFileUri(r)}uriToFileUri(e){return e.scheme===UO.vscodeFileResource?e.with({scheme:UO.file,authority:e.authority!==t.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(eJ.URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let r=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(r))return eJ.URI.joinPath(eJ.URI.parse(r,!0),e);let n=iHt.join(r,e);return eJ.URI.file(n)}throw new Error("Cannot determine URI for module id!")}};ms.FileAccess=new sHt;ms.CacheControlheaders=Object.freeze({"Cache-Control":"no-cache, no-store"});ms.DocumentPolicyheaders=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});var v1n;(function(t){let e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);t.CoopAndCoep=Object.freeze(e.get("3"));let r="vscode-coi";function n(s){let c;typeof s=="string"?c=new URL(s).searchParams:s instanceof URL?c=s.searchParams:eJ.URI.isUri(s)&&(c=new URL(s.toString(!0)).searchParams);let l=c?.get(r);if(l)return e.get(l)}a(n,"getHeadersFromQuery"),t.getHeadersFromQuery=n;function o(s,c,l){if(!globalThis.crossOriginIsolated)return;let u=c&&l?"3":l?"2":"1";s instanceof URLSearchParams?s.set(r,u):s[r]=u}a(o,"addSearchParam"),t.addSearchParam=o})(v1n||(ms.COI=v1n={}))});var ZP=I(yr=>{"use strict";p();var _zo=yr&&yr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vzo=yr&&yr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),I1n=yr&&yr.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oRue.getRoot(n).length&&n[n.length-1]===r}else{let n=e.path;return n.length>1&&n.charCodeAt(n.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,r=Y_.sep){return(0,yr.hasTrailingPathSeparator)(e,r)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,r=Y_.sep){let n=!1;if(e.scheme===Nq.Schemas.file){let o=QO(e);n=o!==void 0&&o.length===Rue.getRoot(o).length&&o[o.length-1]===r}else{r="/";let o=e.path;n=o.length===1&&o.charCodeAt(o.length-1)===47}return!n&&!(0,yr.hasTrailingPathSeparator)(e,r)?e.with({path:e.path+"/"}):e}};yr.ExtUri=kue;yr.extUri=new kue(()=>!1);yr.extUriBiasedIgnorePathCase=new kue(t=>t.scheme===Nq.Schemas.file?!x1n.isLinux:!0);yr.extUriIgnorePathCase=new kue(t=>!0);yr.isEqual=yr.extUri.isEqual.bind(yr.extUri);yr.isEqualOrParent=yr.extUri.isEqualOrParent.bind(yr.extUri);yr.getComparisonKey=yr.extUri.getComparisonKey.bind(yr.extUri);yr.basenameOrAuthority=yr.extUri.basenameOrAuthority.bind(yr.extUri);yr.basename=yr.extUri.basename.bind(yr.extUri);yr.extname=yr.extUri.extname.bind(yr.extUri);yr.dirname=yr.extUri.dirname.bind(yr.extUri);yr.joinPath=yr.extUri.joinPath.bind(yr.extUri);yr.normalizePath=yr.extUri.normalizePath.bind(yr.extUri);yr.relativePath=yr.extUri.relativePath.bind(yr.extUri);yr.resolvePath=yr.extUri.resolvePath.bind(yr.extUri);yr.isAbsolutePath=yr.extUri.isAbsolutePath.bind(yr.extUri);yr.isEqualAuthority=yr.extUri.isEqualAuthority.bind(yr.extUri);yr.hasTrailingPathSeparator=yr.extUri.hasTrailingPathSeparator.bind(yr.extUri);yr.removeTrailingPathSeparator=yr.extUri.removeTrailingPathSeparator.bind(yr.extUri);yr.addTrailingPathSeparator=yr.extUri.addTrailingPathSeparator.bind(yr.extUri);function Czo(t,e){let r=[];for(let n=0;nc===n?!1:(0,yr.isEqualOrParent)(o,e(s)))||r.push(t[n])}return r}a(Czo,"distinctParents");var T1n;(function(t){t.META_DATA_LABEL="label",t.META_DATA_DESCRIPTION="description",t.META_DATA_SIZE="size",t.META_DATA_MIME="mime";function e(r){let n=new Map;r.path.substring(r.path.indexOf(";")+1,r.path.lastIndexOf(";")).split(";").forEach(c=>{let[l,u]=c.split(":");l&&u&&n.set(l,u)});let s=r.path.substring(0,r.path.indexOf(";"));return s&&n.set(t.META_DATA_MIME,s),n}a(e,"parseMetaData"),t.parseMetaData=e})(T1n||(yr.DataUri=T1n={}));function bzo(t,e,r){if(e){let n=t.path;return n&&n[0]!==Y_.posix.sep&&(n=Y_.posix.sep+n),t.with({scheme:r,authority:e,path:n})}return t.with({scheme:r})}a(bzo,"toLocalResource")});var w1n=I(tZe=>{"use strict";p();Object.defineProperty(tZe,"__esModule",{value:!0});tZe.MicrotaskDelay=void 0;tZe.MicrotaskDelay=Symbol("MicrotaskDelay")});var nl=I(Kt=>{"use strict";p();Object.defineProperty(Kt,"__esModule",{value:!0});Kt.AsyncReader=Kt.AsyncReaderEndOfStream=Kt.CancelableAsyncIterableProducer=Kt.AsyncIterableProducer=Kt.AsyncIterableSource=Kt.AsyncIterableObject=Kt.LazyStatefulPromise=Kt.StatefulPromise=Kt.Promises=Kt.DeferredPromise=Kt.IntervalCounter=Kt.TaskSequentializer=Kt.GlobalIdleValue=Kt.AbstractIdleValue=Kt._runWhenIdle=Kt.runWhenGlobalIdle=Kt.ThrottledWorker=Kt.RunOnceWorker=Kt.ProcessTimeRunOnceScheduler=Kt.RunOnceScheduler=Kt.IntervalTimer=Kt.TimeoutTimer=Kt.TaskQueue=Kt.ResourceQueue=Kt.LimitedQueue=Kt.Queue=Kt.Limiter=Kt.AutoOpenBarrier=Kt.Barrier=Kt.ThrottledDelayer=Kt.Delayer=Kt.SequencerByKey=Kt.Sequencer=Kt.Throttler=void 0;Kt.isThenable=P1n;Kt.createCancelablePromise=D1n;Kt.raceCancellation=N1n;Kt.raceCancellationError=xzo;Kt.rejectIfNotCanceled=wzo;Kt.notCancellablePromise=Rzo;Kt.raceCancellablePromises=kzo;Kt.raceTimeout=M1n;Kt.asPromise=Pzo;Kt.promiseWithResolvers=O1n;Kt.timeout=xHt;Kt.disposableTimeout=Mzo;Kt.sequence=Ozo;Kt.first=Lzo;Kt.firstParallel=Bzo;Kt.installFakeRunWhenIdle=Fzo;Kt.retry=Uzo;Kt.createCancelableAsyncIterableProducer=Qzo;Kt.cancellableIterable=qzo;Kt.createTimeout=jzo;var IHt=YP(),K_=Rs(),pwe=Ic(),Mq=Ro(),R1n=ZP(),Szo=Rq(),Tzo=w1n(),Izo=eF();function P1n(t){return!!t&&typeof t.then=="function"}a(P1n,"isThenable");function D1n(t){let e=new IHt.CancellationTokenSource,r=t(e.token),n=!1,o=new Promise((s,c)=>{let l=e.token.onCancellationRequested(()=>{n=!0,l.dispose(),c(new K_.CancellationError)});Promise.resolve(r).then(u=>{l.dispose(),e.dispose(),n?(0,Mq.isDisposable)(u)&&u.dispose():s(u)},u=>{l.dispose(),e.dispose(),c(u)})});return new class{cancel(){e.cancel(),e.dispose()}then(s,c){return o.then(s,c)}catch(s){return this.then(void 0,s)}finally(s){return o.finally(s)}}}a(D1n,"createCancelablePromise");function N1n(t,e,r){return new Promise((n,o)=>{let s=e.onCancellationRequested(()=>{s.dispose(),n(r)});t.then(n,o).finally(()=>s.dispose())})}a(N1n,"raceCancellation");function xzo(t,e){return new Promise((r,n)=>{let o=e.onCancellationRequested(()=>{o.dispose(),n(new K_.CancellationError)});t.then(r,n).finally(()=>o.dispose())})}a(xzo,"raceCancellationError");function wzo(t){if(!(0,K_.isCancellationError)(t))return Promise.reject(t)}a(wzo,"rejectIfNotCanceled");function Rzo(t){return new Promise((e,r)=>{t.then(e,r)})}a(Rzo,"notCancellablePromise");function kzo(t){let e=-1,r=t.map((o,s)=>o.then(c=>(e=s,c))),n=Promise.race(r);return n.cancel=()=>{t.forEach((o,s)=>{s!==e&&o.cancel&&o.cancel()})},n.finally(()=>{n.cancel()}),n}a(kzo,"raceCancellablePromises");function M1n(t,e,r){let n,o=setTimeout(()=>{n?.(void 0),r?.()},e);return Promise.race([t.finally(()=>clearTimeout(o)),new Promise(s=>n=s)])}a(M1n,"raceTimeout");function Pzo(t){return new Promise((e,r)=>{let n=t();P1n(n)?n.then(e,r):e(n)})}a(Pzo,"asPromise");function O1n(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(O1n,"promiseWithResolvers");var rZe=class{static{a(this,"Throttler")}constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new IHt.CancellationTokenSource}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){let r=a(()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;let n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n},"onComplete");this.queuedPromise=new Promise(n=>{this.activePromise.then(r,r).then(n)})}return new Promise((r,n)=>{this.queuedPromise.then(r,n)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((r,n)=>{this.activePromise.then(o=>{this.activePromise=null,r(o)},o=>{this.activePromise=null,n(o)})})}dispose(){this.cancellationTokenSource.cancel()}};Kt.Throttler=rZe;var cHt=class{static{a(this,"Sequencer")}constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}};Kt.Sequencer=cHt;var lHt=class{static{a(this,"SequencerByKey")}constructor(){this.promiseMap=new Map}queue(e,r){let o=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(r).finally(()=>{this.promiseMap.get(e)===o&&this.promiseMap.delete(e)});return this.promiseMap.set(e,o),o}peek(e){return this.promiseMap.get(e)||void 0}keys(){return this.promiseMap.keys()}};Kt.SequencerByKey=lHt;var Dzo=a((t,e)=>{let r=!0,n=setTimeout(()=>{r=!1,e()},t);return{isTriggered:a(()=>r,"isTriggered"),dispose:a(()=>{clearTimeout(n),r=!1},"dispose")}},"timeoutDeferred"),Nzo=a(t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:a(()=>e,"isTriggered"),dispose:a(()=>{e=!1},"dispose")}},"microtaskDeferred"),nZe=class{static{a(this,"Delayer")}constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,r=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((o,s)=>{this.doResolve=o,this.doReject=s}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){let o=this.task;return this.task=null,o()}}));let n=a(()=>{this.deferred=null,this.doResolve?.(null)},"fn");return this.deferred=r===Tzo.MicrotaskDelay?Nzo(n):Dzo(r,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new K_.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};Kt.Delayer=nZe;var uHt=class{static{a(this,"ThrottledDelayer")}constructor(e){this.delayer=new nZe(e),this.throttler=new rZe}trigger(e,r){return this.delayer.trigger(()=>this.throttler.queue(e),r)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}};Kt.ThrottledDelayer=uHt;var iZe=class{static{a(this,"Barrier")}constructor(){this._isOpen=!1,this._promise=new Promise((e,r)=>{this._completePromise=e})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}};Kt.Barrier=iZe;var dHt=class extends iZe{static{a(this,"AutoOpenBarrier")}constructor(e){super(),this._timeout=setTimeout(()=>this.open(),e)}open(){clearTimeout(this._timeout),super.open()}};Kt.AutoOpenBarrier=dHt;function xHt(t,e){return e?new Promise((r,n)=>{let o=setTimeout(()=>{s.dispose(),r()},t),s=e.onCancellationRequested(()=>{clearTimeout(o),s.dispose(),n(new K_.CancellationError)})}):D1n(r=>xHt(t,r))}a(xHt,"timeout");function Mzo(t,e=0,r){let n=setTimeout(()=>{t(),r&&o.dispose()},e),o=(0,Mq.toDisposable)(()=>{clearTimeout(n),r?.delete(o)});return r?.add(o),o}a(Mzo,"disposableTimeout");function Ozo(t){let e=[],r=0,n=t.length;function o(){return r!!n,r=null){let n=0,o=t.length,s=a(()=>{if(n>=o)return Promise.resolve(r);let c=t[n++];return Promise.resolve(c()).then(u=>e(u)?Promise.resolve(u):s())},"loop");return s()}a(Lzo,"first");function Bzo(t,e=n=>!!n,r=null){if(t.length===0)return Promise.resolve(r);let n=t.length,o=a(()=>{n=-1;for(let s of t)s.cancel?.()},"finish");return new Promise((s,c)=>{for(let l of t)l.then(u=>{--n>=0&&e(u)?(o(),s(u)):n===0&&s(r)}).catch(u=>{--n>=0&&(o(),c(u))})})}a(Bzo,"firstParallel");var oZe=class{static{a(this,"Limiter")}constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new pwe.Emitter}whenIdle(){return this.size>0?pwe.Event.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(e){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise((r,n)=>{this.outstandingPromises.push({factory:e,c:r,e:n}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.consumed(),()=>this.consumed())}}consumed(){this._isDisposed||(this.runningPromises--,--this._size===0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}};Kt.Limiter=oZe;var sZe=class extends oZe{static{a(this,"Queue")}constructor(){super(1)}};Kt.Queue=sZe;var fHt=class{static{a(this,"LimitedQueue")}constructor(){this.sequentializer=new cZe,this.tasks=0}queue(e){return this.sequentializer.isRunning()?this.sequentializer.queue(()=>this.sequentializer.run(this.tasks++,e())):this.sequentializer.run(this.tasks++,e())}};Kt.LimitedQueue=fHt;var pHt=class{static{a(this,"ResourceQueue")}constructor(){this.queues=new Map,this.drainers=new Set,this.drainListeners=void 0,this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;let e=new rF;return this.drainers.add(e),e.p}isDrained(){for(let[,e]of this.queues)if(e.size>0)return!1;return!0}queueSize(e,r=R1n.extUri){let n=r.getComparisonKey(e);return this.queues.get(n)?.size??0}queueFor(e,r,n=R1n.extUri){let o=n.getComparisonKey(e),s=this.queues.get(o);if(!s){s=new sZe;let c=this.drainListenerCount++,l=pwe.Event.once(s.onDrained)(()=>{s?.dispose(),this.queues.delete(o),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(c),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new Mq.DisposableMap),this.drainListeners.set(c,l),this.queues.set(o,s)}return s.queue(r)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(let e of this.drainers)e.complete();this.drainers.clear()}dispose(){for(let[,e]of this.queues)e.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}};Kt.ResourceQueue=pHt;var hHt=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new rF;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new rF;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!0}),this._runIfNotRunning(),r.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;let e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new K_.BugIndicatingError;this._runningTask=e.task;try{let r=await e.task();e.deferred.complete(r)}catch(r){e.deferred.error(r)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){let e=this._pendingTasks;this._pendingTasks=[];for(let r of e)r.setUndefinedWhenCleared?r.deferred.complete(void 0):r.deferred.error(new K_.CancellationError)}};Kt.TaskQueue=hHt;var mHt=class{static{a(this,"TimeoutTimer")}constructor(e,r){this._isDisposed=!1,this._token=void 0,typeof e=="function"&&typeof r=="number"&&this.setIfNotSet(e,r)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==void 0&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(e,r){if(this._isDisposed)throw new K_.BugIndicatingError("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=void 0,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new K_.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},r))}};Kt.TimeoutTimer=mHt;var gHt=class{static{a(this,"IntervalTimer")}constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,r,n=globalThis){if(this.isDisposed)throw new K_.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let o=n.setInterval(()=>{e()},r);this.disposable=(0,Mq.toDisposable)(()=>{n.clearInterval(o),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};Kt.IntervalTimer=gHt;var hwe=class{static{a(this,"RunOnceScheduler")}constructor(e,r){this.timeoutToken=void 0,this.runner=e,this.timeout=r,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==void 0}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}};Kt.RunOnceScheduler=hwe;var AHt=class{static{a(this,"ProcessTimeRunOnceScheduler")}constructor(e,r){r%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${r}ms is not a multiple of 1000ms.`),this.runner=e,this.timeout=r,this.counter=0,this.intervalToken=void 0,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=void 0)}schedule(e=this.timeout){e%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${e}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(e/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return this.intervalToken!==void 0}onInterval(){this.counter--,!(this.counter>0)&&(clearInterval(this.intervalToken),this.intervalToken=void 0,this.runner?.())}};Kt.ProcessTimeRunOnceScheduler=AHt;var yHt=class extends hwe{static{a(this,"RunOnceWorker")}constructor(e,r){super(e,r),this.units=[]}work(e){this.units.push(e),this.isScheduled()||this.schedule()}doRun(){let e=this.units;this.units=[],this.runner?.(e)}dispose(){this.units=[],super.dispose()}};Kt.RunOnceWorker=yHt;var EHt=class extends Mq.Disposable{static{a(this,"ThrottledWorker")}constructor(e,r){super(),this.options=e,this.handler=r,this.pendingWork=[],this.throttler=this._register(new Mq.MutableDisposable),this.disposed=!1,this.lastExecutionTime=0}get pending(){return this.pendingWork.length}work(e){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+e.length>this.options.maxBufferedWork)return!1}else if(this.pending+e.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}for(let n of e)this.pendingWork.push(n);let r=Date.now()-this.lastExecutionTime;return!this.throttler.value&&(!this.options.waitThrottleDelayBetweenWorkUnits||r>=this.options.throttleDelay)?this.doWork():!this.throttler.value&&this.options.waitThrottleDelayBetweenWorkUnits&&this.scheduleThrottler(Math.max(this.options.throttleDelay-r,0)),!0}doWork(){this.lastExecutionTime=Date.now(),this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&this.scheduleThrottler()}scheduleThrottler(e=this.options.throttleDelay){this.throttler.value=new hwe(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};Kt.ThrottledWorker=EHt;(function(){let t=globalThis;typeof t.requestIdleCallback!="function"||typeof t.cancelIdleCallback!="function"?Kt._runWhenIdle=(e,r,n)=>{(0,Szo.setTimeout0)(()=>{if(o)return;let s=Date.now()+15;r(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let o=!1;return{dispose(){o||(o=!0)}}}:Kt._runWhenIdle=(e,r,n)=>{let o=e.requestIdleCallback(r,typeof n=="number"?{timeout:n}:void 0),s=!1;return{dispose(){s||(s=!0,e.cancelIdleCallback(o))}}},Kt.runWhenGlobalIdle=(e,r)=>(0,Kt._runWhenIdle)(globalThis,e,r)})();function Fzo(t){let e=Kt._runWhenIdle,r=Kt.runWhenGlobalIdle;return Kt._runWhenIdle=t,Kt.runWhenGlobalIdle=(n,o)=>t(globalThis,n,o),(0,Mq.toDisposable)(()=>{Kt._runWhenIdle=e,Kt.runWhenGlobalIdle=r})}a(Fzo,"installFakeRunWhenIdle");var aZe=class{static{a(this,"AbstractIdleValue")}constructor(e,r){this._didRun=!1,this._executor=()=>{try{this._value=r()}catch(n){this._error=n}finally{this._didRun=!0}},this._handle=(0,Kt._runWhenIdle)(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}};Kt.AbstractIdleValue=aZe;var _Ht=class extends aZe{static{a(this,"GlobalIdleValue")}constructor(e){super(globalThis,e)}};Kt.GlobalIdleValue=_Ht;async function Uzo(t,e,r){let n;for(let o=0;on?.(),"cancel"),promise:r},r.then(()=>this.doneRunning(e),()=>this.doneRunning(e)),r}doneRunning(e){this._running&&e===this._running.taskId&&(this._running=void 0,this.runQueued())}runQueued(){if(this._queued){let e=this._queued;this._queued=void 0,e.run().then(e.promiseResolve,e.promiseReject)}}queue(e){if(this._queued)this._queued.run=e;else{let{promise:r,resolve:n,reject:o}=O1n();this._queued={run:e,promise:r,promiseResolve:n,promiseReject:o}}return this._queued.promise}hasQueued(){return!!this._queued}async join(){return this._queued?.promise??this._running?.promise}};Kt.TaskSequentializer=cZe;var vHt=class{static{a(this,"IntervalCounter")}constructor(e,r=()=>Date.now()){this.interval=e,this.nowFn=r,this.lastIncrementTime=0,this.value=0}increment(){let e=this.nowFn();return e-this.lastIncrementTime>this.interval&&(this.lastIncrementTime=e,this.value=0),this.value++,this.value}};Kt.IntervalCounter=vHt;var rF=class t{static{a(this,"DeferredPromise")}static fromPromise(e){let r=new t;return r.settleWith(e),r}get isRejected(){return this.outcome?.outcome===1}get isResolved(){return this.outcome?.outcome===0}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===0?this.outcome?.value:void 0}constructor(){this.p=new Promise((e,r)=>{this.completeCallback=e,this.errorCallback=r})}complete(e){return this.isSettled?Promise.resolve():new Promise(r=>{this.completeCallback(e),this.outcome={outcome:0,value:e},r()})}error(e){return this.isSettled?Promise.resolve():new Promise(r=>{this.errorCallback(e),this.outcome={outcome:1,value:e},r()})}settleWith(e){return e.then(r=>this.complete(r),r=>this.error(r))}cancel(){return this.error(new K_.CancellationError)}};Kt.DeferredPromise=rF;var k1n;(function(t){async function e(n){let o,s=await Promise.all(n.map(c=>c.then(l=>l,l=>{o||(o=l)})));if(typeof o<"u")throw o;return s}a(e,"settled"),t.settled=e;function r(n){return new Promise(async(o,s)=>{try{await n(o,s)}catch(c){s(c)}})}a(r,"withAsyncBody"),t.withAsyncBody=r})(k1n||(Kt.Promises=k1n={}));var lZe=class{static{a(this,"StatefulPromise")}get value(){return this._value}get error(){return this._error}get isResolved(){return this._isResolved}constructor(e){this._value=void 0,this._error=void 0,this._isResolved=!1,this.promise=e.then(r=>(this._value=r,this._isResolved=!0,r),r=>{throw this._error=r,this._isResolved=!0,r})}requireValue(){if(!this._isResolved)throw new K_.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}};Kt.StatefulPromise=lZe;var CHt=class{static{a(this,"LazyStatefulPromise")}constructor(e){this._compute=e,this._promise=new Izo.Lazy(()=>new lZe(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}};Kt.LazyStatefulPromise=CHt;var uZe=class t{static{a(this,"AsyncIterableObject")}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new pwe.Emitter,queueMicrotask(async()=>{let n={emitOne:a(o=>this.emitOne(o),"emitOne"),emitMany:a(o=>this.emitMany(o),"emitMany"),reject:a(o=>this.reject(o),"reject")};try{await Promise.resolve(e(n)),this.resolve()}catch(o){this.reject(o)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:a(async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0}),"return")}}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}map(e){return t.map(this,e)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static async toPromise(e){let r=[];for await(let n of e)r.push(n);return r}toPromise(){return t.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Kt.AsyncIterableObject=uZe;function Qzo(t){let e=new IHt.CancellationTokenSource,r=t(e.token);return new fZe(e,async n=>{let o=e.token.onCancellationRequested(()=>{o.dispose(),e.dispose(),n.reject(new K_.CancellationError)});try{for await(let s of r){if(e.token.isCancellationRequested)return;n.emitOne(s)}o.dispose(),e.dispose()}catch(s){o.dispose(),e.dispose(),n.reject(s)}})}a(Qzo,"createCancelableAsyncIterableProducer");var bHt=class{static{a(this,"AsyncIterableSource")}constructor(e){this._deferred=new rF,this._asyncIterable=new uZe(o=>{if(r){o.reject(r);return}return n&&o.emitMany(n),this._errorFn=s=>o.reject(s),this._emitOneFn=s=>o.emitOne(s),this._emitManyFn=s=>o.emitMany(s),this._deferred.p},e);let r,n;this._errorFn=o=>{r||(r=o)},this._emitOneFn=o=>{n||(n=[]),n.push(o)},this._emitManyFn=o=>{n?o.forEach(s=>n.push(s)):n=o.slice()}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(e){this._errorFn(e),this._deferred.complete()}emitOne(e){this._emitOneFn(e)}emitMany(e){this._emitManyFn(e)}};Kt.AsyncIterableSource=bHt;function qzo(t,e){let r=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t;return{async next(){return e.isCancellationRequested?{done:!0,value:void 0}:await N1n(r.next(),e)||{done:!0,value:void 0}},throw:r.throw?.bind(r),return:r.return?.bind(r),[Symbol.asyncIterator](){return this}}}a(qzo,"cancellableIterable");var SHt=class{static{a(this,"ProducerConsumer")}constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){let r=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(r,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(let r of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(r,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new K_.BugIndicatingError("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,r){r.ok?e.complete(r.value):e.error(r.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){let e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{let e=new rF;return this._unsatisfiedConsumers.push(e),e.p}}},dZe=class t{static{a(this,"AsyncIterableProducer")}constructor(e,r){this._onReturn=r,this._producerConsumer=new SHt,this._iterator={next:a(()=>this._producerConsumer.consume(),"next"),return:a(()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),"return"),throw:a(async n=>(this._finishError(n),{done:!0,value:void 0}),"throw")},queueMicrotask(async()=>{let n=e({emitOne:a(o=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:o}}),"emitOne"),emitMany:a(o=>{for(let s of o)this._producerConsumer.produce({ok:!0,value:{done:!1,value:s}})},"emitMany"),reject:a(o=>this._finishError(o),"reject")});if(!this._producerConsumer.hasFinalValue)try{await n,this._finishOk()}catch(o){this._finishError(o)}})}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}static tee(e){let r,n,o=new rF,s=a(async()=>{if(!(!r||!n))try{for await(let u of e)r.emitOne(u),n.emitOne(u)}catch(u){r.reject(u),n.reject(u)}finally{o.complete()}},"start"),c=new t(async u=>(r=u,s(),o.p)),l=new t(async u=>(n=u,s(),o.p));return[c,l]}map(e){return t.map(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};Kt.AsyncIterableProducer=dZe;var fZe=class extends dZe{static{a(this,"CancelableAsyncIterableProducer")}constructor(e,r){super(r),this._source=e}cancel(){this._source.cancel()}};Kt.CancelableAsyncIterableProducer=fZe;Kt.AsyncReaderEndOfStream=Symbol("AsyncReaderEndOfStream");var THt=class{static{a(this,"AsyncReader")}get endOfStream(){return this._buffer.length===0&&this._atEnd}constructor(e){this._source=e,this._buffer=[],this._atEnd=!1}async read(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?Kt.AsyncReaderEndOfStream:this._buffer.shift()}async readWhile(e,r){do{let n=await this.peek();if(n===Kt.AsyncReaderEndOfStream||!e(n))break;await this.read(),await r(n)}while(!0)}readBufferedOrThrow(){let e=this.peekBufferedOrThrow();return this._buffer.shift(),e}async consumeToEnd(){for(;!this.endOfStream;)await this.read()}async peek(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?Kt.AsyncReaderEndOfStream:this._buffer[0]}peekBufferedOrThrow(){if(this._buffer.length===0){if(this._atEnd)return Kt.AsyncReaderEndOfStream;throw new K_.BugIndicatingError("No buffered elements")}return this._buffer[0]}async peekTimeout(e){if(this._buffer.length===0&&!this._atEnd&&await M1n(this._extendBuffer(),e),this._atEnd)return Kt.AsyncReaderEndOfStream;if(this._buffer.length!==0)return this._buffer[0]}_extendBuffer(){return this._atEnd?Promise.resolve():(this._extendBufferPromise||(this._extendBufferPromise=(async()=>{let{value:e,done:r}=await this._source.next();this._extendBufferPromise=void 0,r?this._atEnd=!0:this._buffer.push(e)})()),this._extendBufferPromise)}};Kt.AsyncReader=THt;function jzo(t,e){let r=setTimeout(e,t);return(0,Mq.toDisposable)(()=>clearTimeout(r))}a(jzo,"createTimeout")});var H1n=I(JS=>{"use strict";p();var Wzo=JS&&JS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(JS,"__esModule",{value:!0});var zzo=require("fs"),Yzo=Wzo(EP()),Due=Yzo.default("@kwsites/file-exists");function Kzo(t,e,r){Due("checking %s",t);try{let n=zzo.statSync(t);return n.isFile()&&e?(Due("[OK] path represents a file"),!0):n.isDirectory()&&r?(Due("[OK] path represents a directory"),!0):(Due("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return Due("[FAIL] path is not accessible: %o",n),!1;throw Due("[FATAL] %o",n),n}}a(Kzo,"check");function Jzo(t,e=JS.READABLE){return Kzo(t,(e&JS.FILE)>0,(e&JS.FOLDER)>0)}a(Jzo,"exists");JS.exists=Jzo;JS.FILE=1;JS.FOLDER=2;JS.READABLE=JS.FILE+JS.FOLDER});var G1n=I(yZe=>{"use strict";p();function Zzo(t){for(var e in t)yZe.hasOwnProperty(e)||(yZe[e]=t[e])}a(Zzo,"__export");Object.defineProperty(yZe,"__esModule",{value:!0});Zzo(H1n())});var V1n=I((k0d,$1n)=>{p();var Oue=1e3,Lue=Oue*60,Bue=Lue*60,rJ=Bue*24,Xzo=rJ*7,eYo=rJ*365.25;$1n.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return tYo(t);if(r==="number"&&isFinite(t))return e.long?nYo(t):rYo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function tYo(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*eYo;case"weeks":case"week":case"w":return r*Xzo;case"days":case"day":case"d":return r*rJ;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Bue;case"minutes":case"minute":case"mins":case"min":case"m":return r*Lue;case"seconds":case"second":case"secs":case"sec":case"s":return r*Oue;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(tYo,"parse");function rYo(t){var e=Math.abs(t);return e>=rJ?Math.round(t/rJ)+"d":e>=Bue?Math.round(t/Bue)+"h":e>=Lue?Math.round(t/Lue)+"m":e>=Oue?Math.round(t/Oue)+"s":t+"ms"}a(rYo,"fmtShort");function nYo(t){var e=Math.abs(t);return e>=rJ?EZe(t,e,rJ,"day"):e>=Bue?EZe(t,e,Bue,"hour"):e>=Lue?EZe(t,e,Lue,"minute"):e>=Oue?EZe(t,e,Oue,"second"):t+" ms"}a(nYo,"fmtLong");function EZe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(EZe,"plural")});var PHt=I((N0d,W1n)=>{p();function iYo(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=V1n(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let P=r.formatters[x];if(typeof P=="function"){let D=E[T];R=P.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,E),(_.log||r.log).apply(_,E)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(E=>{m=E},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h=(typeof f=="string"?f:"").trim().replace(" ",",").split(",").filter(Boolean);for(let m of h)m[0]==="-"?r.skips.push(m.slice(1)):r.names.push(m)}a(o,"enable");function s(f,h){let m=0,g=0,A=-1,y=0;for(;m"-"+h)].join(",");return r.enable(""),f}a(c,"disable");function l(f){for(let h of r.skips)if(s(f,h))return!1;for(let h of r.names)if(s(f,h))return!0;return!1}a(l,"enabled");function u(f){return f instanceof Error?f.stack||f.message:f}a(u,"coerce");function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return a(d,"destroy"),r.enable(r.load()),r}a(iYo,"setup");W1n.exports=iYo});var z1n=I((ZS,_Ze)=>{p();ZS.formatArgs=sYo;ZS.save=aYo;ZS.load=cYo;ZS.useColors=oYo;ZS.storage=lYo();ZS.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();ZS.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function oYo(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(oYo,"useColors");function sYo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+_Ze.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(sYo,"formatArgs");ZS.log=console.debug||console.log||(()=>{});function aYo(t){try{t?ZS.storage.setItem("debug",t):ZS.storage.removeItem("debug")}catch{}}a(aYo,"save");function cYo(){let t;try{t=ZS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(cYo,"load");function lYo(){try{return localStorage}catch{}}a(lYo,"localstorage");_Ze.exports=PHt()(ZS);var{formatters:uYo}=_Ze.exports;uYo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var K1n=I((vg,CZe)=>{p();var dYo=require("tty"),vZe=require("util");vg.init=yYo;vg.log=mYo;vg.formatArgs=pYo;vg.save=gYo;vg.load=AYo;vg.useColors=fYo;vg.destroy=vZe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");vg.colors=[6,2,3,4,5,1];try{let t=LGe();t&&(t.stderr||t).level>=2&&(vg.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}vg.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function fYo(){return"colors"in vg.inspectOpts?!!vg.inspectOpts.colors:dYo.isatty(process.stderr.fd)}a(fYo,"useColors");function pYo(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` +`))}},xwe=class t extends Error{static{a(this,"ListenerLeakError")}constructor(e,r,n,o,s){super(s?`[${s}] potential listener LEAK detected, ${e}`:`potential listener LEAK detected, ${e}`),this.name="ListenerLeakError",this.kind=e,this.listenerCount=o,this.details=r,this.stack=n}static is(e){return e instanceof t||e instanceof Error&&typeof e.kind=="string"&&typeof e.listenerCount=="number"}};Wa.ListenerLeakError=xwe;var pZe=class extends xwe{static{a(this,"ListenerRefusalError")}constructor(e,r,n,o,s){super(e,r,n,o,s),this.name="ListenerRefusalError"}};Wa.ListenerRefusalError=pZe;var Ezo=0,Mue=class{static{a(this,"UniqueContainer")}constructor(e){this.value=e,this.id=Ezo++}},_zo=2,bSn=a((t,e)=>{if(t instanceof Mue)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new CHt(e?.onListenerError??Twe.onUnexpectedError,this._options?.leakWarningThreshold??Iwe,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new fZe(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(ySn){let e=this._listeners;queueMicrotask(()=>{bSn(e,r=>r.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,r,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let d=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=d[1]/this._size>.3?"dominated":"popular",h=new pZe(f,`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||Twe.onUnexpectedError)(h),KC.Disposable.None}if(this._disposed)return KC.Disposable.None;r&&(e=e.bind(r));let o=new Mue(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Oue.create(),s=this._leakageMon.check(o.stack,this._size+1)),ySn&&(o.stack=c??Oue.create()),this._listeners?this._listeners instanceof Mue?(this._deliveryQueue??=new hZe,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let l=(0,KC.toDisposable)(()=>{s?.(),this._removeListener(o)});return PHt(l,n),l},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,n=r.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[n]=void 0;let o=this._deliveryQueue.current===this;if(this._size*_zo<=r.length){let s=0;for(let c=0;c0}};Wa.Emitter=gE;var vzo=a(()=>new hZe,"createEventDeliveryQueue");Wa.createEventDeliveryQueue=vzo;var hZe=class{static{a(this,"EventDeliveryQueuePrivate")}constructor(){this.i=-1,this.end=0}enqueue(e,r,n){this.i=0,this.end=n,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},bHt=class extends gE{static{a(this,"AsyncEmitter")}async fireAsync(e,r,n){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new CSn.LinkedList),bSn(this._listeners,o=>this._asyncDeliveryQueue.push([o.value,e]));this._asyncDeliveryQueue.size>0&&!r.isCancellationRequested;){let[o,s]=this._asyncDeliveryQueue.shift(),c=[],l={...s,token:r,waitUntil:a(u=>{if(Object.isFrozen(c))throw new Error("waitUntil can NOT be called asynchronous");n&&(u=n(u,o)),c.push(u)},"waitUntil")};try{o(l)}catch(u){(0,Twe.onUnexpectedError)(u);continue}Object.freeze(c),await Promise.allSettled(c).then(u=>{for(let d of u)d.status==="rejected"&&(0,Twe.onUnexpectedError)(d.reason)})}}};Wa.AsyncEmitter=bHt;var mZe=class extends gE{static{a(this,"PauseableEmitter")}get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new CSn.LinkedList,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){let e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}};Wa.PauseableEmitter=mZe;var SHt=class extends mZe{static{a(this,"DebounceEmitter")}constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}};Wa.DebounceEmitter=SHt;var THt=class extends gE{static{a(this,"MicrotaskEmitter")}constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(r=>super.fire(r)),this._queuedEvents=[]}))}};Wa.MicrotaskEmitter=THt;var gZe=class{static{a(this,"EventMultiplexer")}constructor(){this.hasListeners=!1,this.events=[],this.emitter=new gE({onWillAddFirstListener:a(()=>this.onFirstListenerAdd(),"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>this.onLastListenerRemove(),"onDidRemoveLastListener")})}get event(){return this.emitter.event}add(e){let r={event:e,listener:null};this.events.push(r),this.hasListeners&&this.hook(r);let n=a(()=>{this.hasListeners&&this.unhook(r);let o=this.events.indexOf(r);this.events.splice(o,1)},"dispose");return(0,KC.toDisposable)((0,pzo.createSingleCallFunction)(n))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(r=>this.emitter.fire(r))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){this.emitter.dispose();for(let e of this.events)e.listener?.dispose();this.events=[]}};Wa.EventMultiplexer=gZe;var IHt=class{static{a(this,"DynamicListEventMultiplexer")}constructor(e,r,n,o){this._store=new KC.DisposableStore;let s=this._store.add(new gZe),c=this._store.add(new KC.DisposableMap);function l(u){c.set(u,s.add(o(u)))}a(l,"addItem");for(let u of e)l(u);this._store.add(r(u=>{l(u)})),this._store.add(n(u=>{c.deleteAndDispose(u)})),this.event=s.event}dispose(){this._store.dispose()}};Wa.DynamicListEventMultiplexer=IHt;var xHt=class{static{a(this,"EventBufferer")}constructor(){this.data=[]}wrapEvent(e,r,n){return(o,s,c)=>e(l=>{let u=this.data[this.data.length-1];if(!r){u?u.buffers.push(()=>o.call(s,l)):o.call(s,l);return}let d=u;if(!d){o.call(s,r(n,l));return}d.items??=[],d.items.push(l),d.buffers.length===0&&u.buffers.push(()=>{d.reducedResult??=n?d.items.reduce(r,n):d.items.reduce(r),o.call(s,d.reducedResult)})},void 0,c)}bufferEvents(e){let r={buffers:new Array};this.data.push(r);let n=e();return this.data.pop(),r.buffers.forEach(o=>o()),n}};Wa.EventBufferer=xHt;var wHt=class{static{a(this,"Relay")}constructor(){this.listening=!1,this.inputEvent=dZe.None,this.inputEventListener=KC.Disposable.None,this.emitter=new gE({onDidAddFirstListener:a(()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},"onDidAddFirstListener"),onDidRemoveLastListener:a(()=>{this.listening=!1,this.inputEventListener.dispose()},"onDidRemoveLastListener")}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}};Wa.Relay=wHt;var RHt=class{static{a(this,"ValueWithChangeEvent")}static const(e){return new kHt(e)}constructor(e){this._value=e,this._onDidChange=new gE,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};Wa.ValueWithChangeEvent=RHt;var kHt=class{static{a(this,"ConstValueWithChangeEvent")}constructor(e){this.value=e,this.onDidChange=dZe.None}};function Czo(t,e,r){let n=new KC.DisposableMap,o=new Set(t());for(let c of o)n.set(c,r(c));let s=new KC.DisposableStore;return s.add(e(()=>{let c=t(),l=(0,fzo.diffSets)(o,c);for(let u of l.removed)n.deleteAndDispose(u);for(let u of l.added)n.set(u,r(u));o=new Set(c)})),s.add(n),s}a(Czo,"trackSetChanges");function PHt(t,e){e instanceof KC.DisposableStore?e.add(t):Array.isArray(e)&&e.push(t)}a(PHt,"addToDisposables");function vSn(t,e){if(e instanceof KC.DisposableStore)e.delete(t);else if(Array.isArray(e)){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}t.dispose()}a(vSn,"disposeAndRemove")});var n2=I(oF=>{"use strict";p();Object.defineProperty(oF,"__esModule",{value:!0});oF.CancellationTokenPool=oF.CancellationTokenSource=oF.CancellationToken=void 0;oF.cancelOnDispose=Szo;var SSn=Rc(),bzo=Ro(),TSn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),AZe;(function(t){function e(r){return r===t.None||r===t.Cancelled||r instanceof Lue?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}a(e,"isCancellationToken"),t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:SSn.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:TSn})})(AZe||(oF.CancellationToken=AZe={}));var Lue=class{static{a(this,"MutableToken")}constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?TSn:(this._emitter||(this._emitter=new SSn.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},wwe=class{static{a(this,"CancellationTokenSource")}constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Lue),this._token}cancel(){this._token?this._token instanceof Lue&&this._token.cancel():this._token=AZe.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof Lue&&this._token.dispose():this._token=AZe.None}};oF.CancellationTokenSource=wwe;function Szo(t){let e=new wwe;return t.add({dispose(){e.cancel()}}),e.token}a(Szo,"cancelOnDispose");var DHt=class{static{a(this,"CancellationTokenPool")}constructor(){this._source=new wwe,this._listeners=new bzo.DisposableStore,this._total=0,this._cancelled=0,this._isDone=!1}get token(){return this._source.token}add(e){if(this._isDone)return;if(this._total++,e.isCancellationRequested){this._cancelled++,this._check();return}let r=e.onCancellationRequested(()=>{r.dispose(),this._cancelled++,this._check()});this._listeners.add(r)}_check(){!this._isDone&&this._total>0&&this._total===this._cancelled&&(this._isDone=!0,this._listeners.dispose(),this._source.cancel())}dispose(){this._listeners.dispose(),this._source.dispose()}};oF.CancellationTokenPool=DHt});var LA=I(Jr=>{"use strict";p();var Tzo=Jr&&Jr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Izo=Jr&&Jr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xzo=Jr&&Jr.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=wzo&&t<=kzo||t>=Rzo&&t<=Pzo}a(aF,"isWindowsDeviceRoot");function EZe(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===lJ&&l!==-1?++l:l=-1}return o}a(EZe,"normalizeString");function Mzo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(Mzo,"formatExt");function ISn(t,e){Nzo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${Mzo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(ISn,"_format");Jr.win32={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],dp(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=Bue.cwd():(s=Bue.env[`=${e}`]||Bue.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===JC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)Ko(f)&&(l=1,d=!0);else if(Ko(f))if(d=!0,Ko(s.charCodeAt(1))){let h=2,m=h;for(;h2&&Ko(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=EZe(r,!n,"\\",Ko),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){dp(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return NHt(s)?"\\":t;if(Ko(s))if(o=!0,Ko(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Ko(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&Ko(t.charCodeAt(e-1))&&(c+="\\"),!o&&n===void 0&&t.includes(":")){if(c.length>=2&&aF(c.charCodeAt(0))&&c.charCodeAt(1)===sF)return`.\\${c}`;let l=t.indexOf(":");do if(l===e-1||Ko(t.charCodeAt(l+1)))return`.\\${c}`;while((l=t.indexOf(":",l+1))!==-1)}return n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){dp(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return Ko(r)||e>2&&aF(r)&&t.charCodeAt(1)===sF&&Ko(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&Ko(r.charCodeAt(0))){++o;let s=r.length;s>1&&Ko(r.charCodeAt(1))&&(++o,s>2&&(Ko(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return Jr.win32.normalize(e)},relative(t,e){if(dp(t,"from"),dp(e,"to"),t===e)return"";let r=Jr.win32.resolve(t),n=Jr.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";if(r.length!==t.length||n.length!==e.length){let A=r.split("\\"),y=n.split("\\");A[A.length-1]===""&&A.pop(),y[y.length-1]===""&&y.pop();let E=A.length,_=y.length,v=E<_?E:_,b;for(b=0;bv?y.slice(b).join("\\"):E>v?"..\\".repeat(E-1-b)+"..":"":"..\\".repeat(E-b)+y.slice(b).join("\\")}let o=0;for(;oo&&t.charCodeAt(s-1)===JC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===JC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===JC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===JC?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===JC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===JC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Jr.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===JC){if(e.charCodeAt(1)===JC){let r=e.charCodeAt(2);if(r!==Dzo&&r!==lJ)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(aF(e.charCodeAt(0))&&e.charCodeAt(1)===sF&&e.charCodeAt(2)===JC)return`\\\\?\\${e}`;return e},dirname(t){dp(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return Ko(o)?t:".";if(Ko(o)){if(r=n=1,Ko(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Ko(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(Ko(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&dp(e,"suffix"),dp(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&aF(t.charCodeAt(0))&&t.charCodeAt(1)===sF&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(Ko(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(Ko(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){dp(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===sF&&aF(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(Ko(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===lJ?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:ISn.bind(null,"\\"),parse(t){dp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return Ko(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(Ko(o)){if(n=1,Ko(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),Ko(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===lJ?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null};var Ozo=(()=>{if(ZC){let t=/\\/g;return()=>{let e=Bue.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>Bue.cwd()})();Jr.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=0&&!r;n--){let o=t[n];dp(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===Sg)}if(!r){let n=Ozo();e=`${n}/${e}`,r=n.charCodeAt(0)===Sg}return e=EZe(e,!r,"/",NHt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(dp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Sg,r=t.charCodeAt(t.length-1)===Sg;return t=EZe(t,!e,"/",NHt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return dp(t,"path"),t.length>0&&t.charCodeAt(0)===Sg},join(...t){if(t.length===0)return".";let e=[];for(let r=0;r0&&e.push(n)}return e.length===0?".":Jr.posix.normalize(e.join("/"))},relative(t,e){if(dp(t,"from"),dp(e,"to"),t===e||(t=Jr.posix.resolve(t),e=Jr.posix.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===Sg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===Sg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===Sg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(dp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Sg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===Sg){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&dp(e,"suffix"),dp(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===Sg){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===Sg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){dp(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t[c];if(l==="/"){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l==="."?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:ISn.bind(null,"/"),parse(t){dp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===Sg,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===Sg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===lJ?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Jr.posix.win32=Jr.win32.win32=Jr.win32;Jr.posix.posix=Jr.win32.posix=Jr.posix;Jr.normalize=ZC?Jr.win32.normalize:Jr.posix.normalize;Jr.isAbsolute=ZC?Jr.win32.isAbsolute:Jr.posix.isAbsolute;Jr.join=ZC?Jr.win32.join:Jr.posix.join;Jr.resolve=ZC?Jr.win32.resolve:Jr.posix.resolve;Jr.relative=ZC?Jr.win32.relative:Jr.posix.relative;Jr.dirname=ZC?Jr.win32.dirname:Jr.posix.dirname;Jr.basename=ZC?Jr.win32.basename:Jr.posix.basename;Jr.extname=ZC?Jr.win32.extname:Jr.posix.extname;Jr.format=ZC?Jr.win32.format:Jr.posix.format;Jr.parse=ZC?Jr.win32.parse:Jr.posix.parse;Jr.toNamespacedPath=ZC?Jr.win32.toNamespacedPath:Jr.posix.toNamespacedPath;Jr.sep=ZC?Jr.win32.sep:Jr.posix.sep;Jr.delimiter=ZC?Jr.win32.delimiter:Jr.posix.delimiter});var vZe=I(i2=>{"use strict";p();Object.defineProperty(i2,"__esModule",{value:!0});i2.WeakCachedFunction=i2.CachedFunction=i2.LRUCachedFunction=i2.Cache=void 0;i2.identity=_Ze;var Lzo=n2(),MHt=class{static{a(this,"Cache")}constructor(e){this.task=e,this.result=null}get(){if(this.result)return this.result;let e=new Lzo.CancellationTokenSource,r=this.task(e.token);return this.result={promise:r,dispose:a(()=>{this.result=null,e.cancel(),e.dispose()},"dispose")},this.result}};i2.Cache=MHt;function _Ze(t){return t}a(_Ze,"identity");var OHt=class{static{a(this,"LRUCachedFunction")}constructor(e,r){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=_Ze):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);return this.lastArgKey!==r&&(this.lastArgKey=r,this.lastCache=this._fn(e)),this.lastCache}};i2.LRUCachedFunction=OHt;var LHt=class{static{a(this,"CachedFunction")}get cachedValues(){return this._map}constructor(e,r){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=_Ze):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);if(this._map2.has(r))return this._map2.get(r);let n=this._fn(e);return this._map.set(e,n),this._map2.set(r,n),n}};i2.CachedFunction=LHt;var BHt=class{static{a(this,"WeakCachedFunction")}constructor(e,r){this._map=new WeakMap,typeof e=="function"?(this._fn=e,this._computeKey=_Ze):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);if(this._map.has(r))return this._map.get(r);let n=this._fn(e);return this._map.set(r,n),n}};i2.WeakCachedFunction=BHt});var cF=I(CZe=>{"use strict";p();Object.defineProperty(CZe,"__esModule",{value:!0});CZe.Lazy=void 0;var Hq;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Running=1]="Running",t[t.Completed=2]="Completed"})(Hq||(Hq={}));var FHt=class{static{a(this,"Lazy")}constructor(e){this.executor=e,this._state=Hq.Uninitialized}get hasValue(){return this._state===Hq.Completed}get value(){if(this._state===Hq.Uninitialized){this._state=Hq.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=Hq.Completed}}else if(this._state===Hq.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};CZe.Lazy=FHt});var om=I(Rr=>{"use strict";p();Object.defineProperty(Rr,"__esModule",{value:!0});Rr.Ellipsis=Rr.InvisibleCharacters=Rr.AmbiguousCharacters=Rr.noBreakWhitespace=Rr.UTF8_BOM_CHARACTER=Rr.UNUSUAL_LINE_TERMINATORS=Rr.GraphemeIterator=Rr.CodePointIterator=void 0;Rr.isFalsyOrWhitespace=Fzo;Rr.format=Qzo;Rr.format2=jzo;Rr.htmlAttributeEncodeValue=Hzo;Rr.escape=Gzo;Rr.escapeRegExpCharacters=RSn;Rr.count=$zo;Rr.truncate=Vzo;Rr.truncateMiddle=Wzo;Rr.trim=zzo;Rr.ltrim=kSn;Rr.rtrim=PSn;Rr.convertSimple2RegExpPattern=Yzo;Rr.createRegExp=Kzo;Rr.regExpLeadsToEndlessLoop=Jzo;Rr.joinStrings=Zzo;Rr.splitLines=Xzo;Rr.splitLinesIncludeSeparators=eYo;Rr.indexOfPattern=tYo;Rr.firstNonWhitespaceIndex=DSn;Rr.getLeadingWhitespace=rYo;Rr.lastNonWhitespaceIndex=nYo;Rr.getIndentationLength=iYo;Rr.replaceAsync=oYo;Rr.compare=sYo;Rr.compareSubstring=NSn;Rr.compareIgnoreCase=aYo;Rr.compareSubstringIgnoreCase=kwe;Rr.isAsciiDigit=cYo;Rr.isLowerAsciiLetter=QHt;Rr.isUpperAsciiLetter=lYo;Rr.equalsIgnoreCase=MSn;Rr.equals=uYo;Rr.startsWithIgnoreCase=dYo;Rr.endsWithIgnoreCase=fYo;Rr.commonPrefixLength=pYo;Rr.commonSuffixLength=hYo;Rr.isHighSurrogate=HHt;Rr.isLowSurrogate=bZe;Rr.computeCodePoint=GHt;Rr.getNextCodePoint=OSn;Rr.nextCharLength=LSn;Rr.prevCharLength=BSn;Rr.getCharContainingOffset=gYo;Rr.charCount=AYo;Rr.containsRTL=EYo;Rr.isBasicASCII=vYo;Rr.containsUnusualLineTerminators=CYo;Rr.isFullWidthCharacter=bYo;Rr.isEmojiImprecise=FSn;Rr.lcut=SYo;Rr.rcut=TYo;Rr.forAnsiStringParts=RYo;Rr.removeAnsiEscapeCodes=QSn;Rr.removeAnsiEscapeCodesFromPrompt=PYo;Rr.startsWithUTF8BOM=qSn;Rr.stripUTF8BOM=DYo;Rr.fuzzyContains=NYo;Rr.containsUppercaseCharacter=MYo;Rr.uppercaseFirstLetter=OYo;Rr.getNLines=LYo;Rr.singleLetterHash=BYo;Rr.getGraphemeBreakType=FYo;Rr.getLeftDeleteOffset=QYo;Rr.multibyteAwareBtoa=GYo;var Bzo=vZe(),xSn=cF();function Fzo(t){return!t||typeof t!="string"?!0:t.trim().length===0}a(Fzo,"isFalsyOrWhitespace");var Uzo=/{(\d+)}/g;function Qzo(t,...e){return e.length===0?t:t.replace(Uzo,function(r,n){let o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?r:e[o]})}a(Qzo,"format");var qzo=/{([^}]+)}/g;function jzo(t,e){return Object.keys(e).length===0?t:t.replace(qzo,(r,n)=>e[n]??r)}a(jzo,"format2");function Hzo(t){return t.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}a(Hzo,"htmlAttributeEncodeValue");function Gzo(t){return t.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}a(Gzo,"escape");function RSn(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(RSn,"escapeRegExpCharacters");function $zo(t,e){let r=0,n=t.indexOf(e);for(;n!==-1;)r++,n=t.indexOf(e,n+e.length);return r}a($zo,"count");function Vzo(t,e,r=Rr.Ellipsis){return t.length<=e?t:`${t.substr(0,e)}${r}`}a(Vzo,"truncate");function Wzo(t,e,r=Rr.Ellipsis){if(t.length<=e)return t;let n=Math.ceil(e/2)-r.length/2,o=Math.floor(e/2)-r.length/2;return`${t.substr(0,n)}${r}${t.substr(t.length-o)}`}a(Wzo,"truncateMiddle");function zzo(t,e=" "){let r=kSn(t,e);return PSn(r,e)}a(zzo,"trim");function kSn(t,e){if(!t||!e)return t;let r=e.length,n=0;if(r===1){let o=e.charCodeAt(0);for(;n0&&t.charCodeAt(s-1)===c;)s--;return t.substring(0,s)}let o=n;for(;o>0&&t.endsWith(e,o);)o-=r;return t.substring(0,o)}a(PSn,"rtrim");function Yzo(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}a(Yzo,"convertSimple2RegExpPattern");function Kzo(t,e,r={}){if(!t)throw new Error("Cannot create regex from empty string");e||(t=RSn(t)),r.wholeWord&&(/\B/.test(t.charAt(0))||(t="\\b"+t),/\B/.test(t.charAt(t.length-1))||(t=t+"\\b"));let n="";return r.global&&(n+="g"),r.matchCase||(n+="i"),r.multiline&&(n+="m"),r.unicode&&(n+="u"),new RegExp(t,n)}a(Kzo,"createRegExp");function Jzo(t){return t.source==="^"||t.source==="^$"||t.source==="$"||t.source==="^\\s*$"?!1:!!(t.exec("")&&t.lastIndex===0)}a(Jzo,"regExpLeadsToEndlessLoop");function Zzo(t,e){return t.filter(r=>r!=null&&r!==!1).join(e)}a(Zzo,"joinStrings");function Xzo(t){return t.split(/\r\n|\r|\n/)}a(Xzo,"splitLines");function eYo(t){let e=[],r=t.split(/(\r\n|\r|\n)/);for(let n=0;n=0;r--){let n=t.charCodeAt(r);if(n!==32&&n!==9)return r}return-1}a(nYo,"lastNonWhitespaceIndex");function iYo(t){let e=DSn(t);return e===-1?t.length:e}a(iYo,"getIndentationLength");function oYo(t,e,r){let n=[],o=0;for(let s of t.matchAll(e)){if(n.push(t.slice(o,s.index)),s.index===void 0)throw new Error("match.index should be defined");o=s.index+s[0].length,n.push(r(s[0],...s.slice(1),s.index,t,s.groups))}return n.push(t.slice(o)),Promise.all(n).then(s=>s.join(""))}a(oYo,"replaceAsync");function sYo(t,e){return te?1:0}a(sYo,"compare");function NSn(t,e,r=0,n=t.length,o=0,s=e.length){for(;rd)return 1}let c=n-r,l=s-o;return cl?1:0}a(NSn,"compareSubstring");function aYo(t,e){return kwe(t,e,0,t.length,0,e.length)}a(aYo,"compareIgnoreCase");function kwe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return NSn(t.toLowerCase(),e.toLowerCase(),r,n,o,s);QHt(u)&&(u-=32),QHt(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(kwe,"compareSubstringIgnoreCase");function cYo(t){return t>=48&&t<=57}a(cYo,"isAsciiDigit");function QHt(t){return t>=97&&t<=122}a(QHt,"isLowerAsciiLetter");function lYo(t){return t>=65&&t<=90}a(lYo,"isUpperAsciiLetter");function MSn(t,e){return t.length===e.length&&kwe(t,e)===0}a(MSn,"equalsIgnoreCase");function uYo(t,e,r){return t===e||!!r&&t!==void 0&&e!==void 0&&MSn(t,e)}a(uYo,"equals");function dYo(t,e){let r=e.length;return r<=t.length&&kwe(t,e,0,r)===0}a(dYo,"startsWithIgnoreCase");function fYo(t,e){let r=t.length,n=r-e.length;return n>=0&&kwe(t,e,n,r)===0}a(fYo,"endsWithIgnoreCase");function pYo(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n1){let n=t.charCodeAt(e-2);if(HHt(n))return GHt(n,r)}return r}a(mYo,"getPrevCodePoint");var Fue=class{static{a(this,"CodePointIterator")}get offset(){return this._offset}constructor(e,r=0){this._str=e,this._len=e.length,this._offset=r}setOffset(e){this._offset=e}prevCodePoint(){let e=mYo(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=OSn(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}};Rr.CodePointIterator=Fue;var Uue=class{static{a(this,"GraphemeIterator")}get offset(){return this._iterator.offset}constructor(e,r=0){this._iterator=new Fue(e,r)}nextGraphemeLength(){let e=Rwe.getInstance(),r=this._iterator,n=r.offset,o=e.getGraphemeBreakType(r.nextCodePoint());for(;!r.eol();){let s=r.offset,c=e.getGraphemeBreakType(r.nextCodePoint());if(wSn(o,c)){r.setOffset(s);break}o=c}return r.offset-n}prevGraphemeLength(){let e=Rwe.getInstance(),r=this._iterator,n=r.offset,o=e.getGraphemeBreakType(r.prevCodePoint());for(;r.offset>0;){let s=r.offset,c=e.getGraphemeBreakType(r.prevCodePoint());if(wSn(c,o)){r.setOffset(s);break}o=c}return n-r.offset}eol(){return this._iterator.eol()}};Rr.GraphemeIterator=Uue;function LSn(t,e){return new Uue(t,e).nextGraphemeLength()}a(LSn,"nextCharLength");function BSn(t,e){return new Uue(t,e).prevGraphemeLength()}a(BSn,"prevCharLength");function gYo(t,e){e>0&&bZe(t.charCodeAt(e))&&e--;let r=e+LSn(t,e);return[r-BSn(t,r),r]}a(gYo,"getCharContainingOffset");function AYo(t){let e=new Uue(t),r=0;for(;!e.eol();)r++,e.nextGraphemeLength();return r}a(AYo,"charCount");var UHt;function yYo(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}a(yYo,"makeContainsRtl");function EYo(t){return UHt||(UHt=yYo()),UHt.test(t)}a(EYo,"containsRTL");var _Yo=/^[\t\n\r\x20-\x7E]*$/;function vYo(t){return _Yo.test(t)}a(vYo,"isBasicASCII");Rr.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function CYo(t){return Rr.UNUSUAL_LINE_TERMINATORS.test(t)}a(CYo,"containsUnusualLineTerminators");function bYo(t){return t>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374||t>=65504&&t<=65510}a(bYo,"isFullWidthCharacter");function FSn(t){return t>=127462&&t<=127487||t===8986||t===8987||t===9200||t===9203||t>=9728&&t<=10175||t===11088||t===11093||t>=127744&&t<=128591||t>=128640&&t<=128764||t>=128992&&t<=129008||t>=129280&&t<=129535||t>=129648&&t<=129782}a(FSn,"isEmojiImprecise");function SYo(t,e,r=""){let n=t.trimStart();if(n.lengthe){c=!0;break}s=o.lastIndex,o.lastIndex+=1}if(!c)return n;if(s===0)return r;let l=n.substring(0,s).trimEnd();return l.length!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/,xYo=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,wYo=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,USn=new RegExp("(?:"+[IYo.source,xYo.source,wYo.source].join("|")+")","g");function*RYo(t){let e=0;for(let r of t.matchAll(USn))e!==r.index&&(yield{isCode:!1,str:t.substring(e,r.index)}),yield{isCode:!0,str:r[0]},e=r.index+r[0].length;e!==t.length&&(yield{isCode:!1,str:t.substring(e)})}a(RYo,"forAnsiStringParts");function QSn(t){return t&&(t=t.replace(USn,"")),t}a(QSn,"removeAnsiEscapeCodes");var kYo=/\\\[.*?\\\]/g;function PYo(t){return QSn(t).replace(kYo,"")}a(PYo,"removeAnsiEscapeCodesFromPrompt");Rr.UTF8_BOM_CHARACTER="\uFEFF";function qSn(t){return!!(t&&t.length>0&&t.charCodeAt(0)===65279)}a(qSn,"startsWithUTF8BOM");function DYo(t){return qSn(t)?t.substr(1):t}a(DYo,"stripUTF8BOM");function NYo(t,e){if(!t||!e||t.length0&&r>=0);return r===-1?t:(t[r-1]==="\r"&&r--,t.substr(0,r))}a(LYo,"getNLines");function BYo(t){return t=t%52,t<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}a(BYo,"singleLetterHash");function FYo(t){return Rwe.getInstance().getGraphemeBreakType(t)}a(FYo,"getGraphemeBreakType");function wSn(t,e){return t===0?e!==5&&e!==7:t===2&&e===3?!1:t===4||t===2||t===3||e===4||e===2||e===3?!0:!(t===8&&(e===8||e===9||e===11||e===12)||(t===11||t===9)&&(e===9||e===10)||(t===12||t===10)&&e===10||e===5||e===13||e===7||t===1||t===13&&e===14||t===6&&e===6)}a(wSn,"breakBetweenGraphemeBreakType");var Rwe=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=UYo()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let r=this._data,n=r.length/3,o=1;for(;o<=n;)if(er[3*o+1])o=2*o+1;else return r[3*o+2];return 0}};function UYo(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}a(UYo,"getGraphemeBreakRawData");function QYo(t,e){if(t===0)return 0;let r=qYo(t,e);if(r!==void 0)return r;let n=new Fue(e,t);return n.prevCodePoint(),n.offset}a(QYo,"getLeftDeleteOffset");function qYo(t,e){let r=new Fue(e,t),n=r.prevCodePoint();for(;jYo(n)||n===65039||n===8419;){if(r.offset===0)return;n=r.prevCodePoint()}if(!FSn(n))return;let o=r.offset;return o>0&&r.prevCodePoint()===8205&&(o=r.offset),o}a(qYo,"getOffsetBeforeLastEmojiComponent");function jYo(t){return 127995<=t&&t<=127999}a(jYo,"isEmojiModifier");Rr.noBreakWhitespace="\xA0";var qHt=class t{static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new xSn.Lazy(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'))}static{this.cache=new Bzo.LRUCachedFunction(e=>{let r=e.split(",");function n(h){let m=new Map;for(let g=0;g!h.startsWith("_")&&Object.hasOwn(c,h));l.length===0&&(l=["_default"]);let u;for(let h of l){let m=n(c[h]);u=s(u,m)}let d=n(c._common),f=o(d,u);return new t(f)})}static getInstance(e){return t.cache.get(Array.from(e).join(","))}static{this._locales=new xSn.Lazy(()=>Object.keys(t.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return t._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let r=0;r{"use strict";p();Object.defineProperty(h0,"__esModule",{value:!0});h0.isPathSeparator=lF;h0.toSlashes=jSn;h0.toPosixPath=VYo;h0.getRoot=WYo;h0.isUNC=zYo;h0.isValidBasename=ZYo;h0.isEqual=XYo;h0.isEqualOrParent=eKo;h0.isWindowsDriveLetter=$Ht;h0.sanitizeFilePath=tKo;h0.removeTrailingPathSeparator=HSn;h0.isRootOrDriveLetter=rKo;h0.hasDriveLetter=VHt;h0.getDriveLetter=nKo;h0.indexOfPath=iKo;h0.parseLineAndColumnAware=oKo;h0.randomPath=cKo;var p0=LA(),Gq=jq(),SZe=om(),$Yo=nT();function lF(t){return t===47||t===92}a(lF,"isPathSeparator");function jSn(t){return t.replace(/[\\/]/g,p0.posix.sep)}a(jSn,"toSlashes");function VYo(t){return t.indexOf("/")===-1&&(t=jSn(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}a(VYo,"toPosixPath");function WYo(t,e=p0.posix.sep){if(!t)return"";let r=t.length,n=t.charCodeAt(0);if(lF(n)){if(lF(t.charCodeAt(1))&&!lF(t.charCodeAt(2))){let s=3,c=s;for(;s\|]/g,KYo=/[/]/g,JYo=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function ZYo(t,e=Gq.isWindows){let r=e?YYo:KYo;return!(!t||t.length===0||/^\s+$/.test(t)||(r.lastIndex=0,r.test(t))||e&&JYo.test(t)||t==="."||t===".."||e&&t[t.length-1]==="."||e&&t.length!==t.trim().length||t.length>255)}a(ZYo,"isValidBasename");function XYo(t,e,r){let n=t===e;return!r||n?n:!t||!e?!1:(0,SZe.equalsIgnoreCase)(t,e)}a(XYo,"isEqual");function eKo(t,e,r,n=!1){let o=n?p0.posix.sep:p0.sep;if(t===e)return!0;if(!t||!e||((t.indexOf("..")>=0||e.indexOf("..")>=0)&&(t=n?p0.posix.normalize(t):(0,p0.normalize)(t),e=n?p0.posix.normalize(e):(0,p0.normalize)(e)),e.length>t.length))return!1;if(r){if(!(0,SZe.startsWithIgnoreCase)(t,e))return!1;if(e.length===t.length)return!0;let c=e.length;return e.charAt(e.length-1)===o&&c--,t.charAt(c)===o}return e.charAt(e.length-1)!==o&&(e+=o),t.indexOf(e)===0}a(eKo,"isEqualOrParent");function $Ht(t){return t>=65&&t<=90||t>=97&&t<=122}a($Ht,"isWindowsDriveLetter");function tKo(t,e){return Gq.isWindows&&t.endsWith(":")&&(t+=p0.sep),(0,p0.isAbsolute)(t)||(t=(0,p0.join)(e,t)),t=(0,p0.normalize)(t),HSn(t)}a(tKo,"sanitizeFilePath");function HSn(t){return Gq.isWindows?(t=(0,SZe.rtrim)(t,p0.sep),t.endsWith(":")&&(t+=p0.sep)):(t=(0,SZe.rtrim)(t,p0.sep),t||(t=p0.sep)),t}a(HSn,"removeTrailingPathSeparator");function rKo(t){let e=(0,p0.normalize)(t);return Gq.isWindows?t.length>3?!1:VHt(e)&&(t.length===2||e.charCodeAt(2)===92):e===p0.posix.sep}a(rKo,"isRootOrDriveLetter");function VHt(t,e=Gq.isWindows){return e?$Ht(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}a(VHt,"hasDriveLetter");function nKo(t,e=Gq.isWindows){return VHt(t,e)?t[0]:void 0}a(nKo,"getDriveLetter");function iKo(t,e,r){return e.length>t.length?-1:t===e?0:(r&&(t=t.toLowerCase(),e=e.toLowerCase()),t.indexOf(e))}a(iKo,"indexOfPath");function oKo(t){let e=t.split(":"),r,n,o;for(let s of e){let c=Number(s);(0,$Yo.isNumber)(c)?n===void 0?n=c:o===void 0&&(o=c):r=r?[r,s].join(":"):s}if(!r)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:r,line:n!==void 0?n:void 0,column:o!==void 0?o:n!==void 0?1:void 0}}a(oKo,"parseLineAndColumnAware");var sKo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",aKo="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function cKo(t,e,r=8){let n="";for(let s=0;s{"use strict";p();var lKo=fw&&fw.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uKo=fw&&fw.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),dKo=fw&&fw.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0?` Found '${r[0][0]}' at index ${r[0].index} (${r.length} total)`:"";throw new Error(`[UriError]: Scheme contains illegal characters.${n} (len:${t.scheme.length})`)}if(t.path){if(t.authority){if(!pKo.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(hKo.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(mKo,"_validateUri");function gKo(t,e){return!t&&!e?"file":t}a(gKo,"_schemeFix");function AKo(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==o2&&(e=o2+e):e=o2;break}return e}a(AKo,"_referenceResolution");var Vl="",o2="/",yKo=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,xZe=class t{static{a(this,"URI")}static isUri(e){return e instanceof t?!0:!e||typeof e!="object"?!1:typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function"}constructor(e,r,n,o,s,c=!1){typeof e=="object"?(this.scheme=e.scheme||Vl,this.authority=e.authority||Vl,this.path=e.path||Vl,this.query=e.query||Vl,this.fragment=e.fragment||Vl):(this.scheme=gKo(e,c),this.authority=r||Vl,this.path=AKo(this.scheme,n||Vl),this.query=o||Vl,this.fragment=s||Vl,mKo(this,c))}get fsPath(){return wZe(this,!1)}with(e){if(!e)return this;let{scheme:r,authority:n,path:o,query:s,fragment:c}=e;return r===void 0?r=this.scheme:r===null&&(r=Vl),n===void 0?n=this.authority:n===null&&(n=Vl),o===void 0?o=this.path:o===null&&(o=Vl),s===void 0?s=this.query:s===null&&(s=Vl),c===void 0?c=this.fragment:c===null&&(c=Vl),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new $q(r,n,o,s,c)}static parse(e,r=!1){let n=yKo.exec(e);return n?new $q(n[2]||Vl,TZe(n[4]||Vl),TZe(n[5]||Vl),TZe(n[7]||Vl),TZe(n[9]||Vl),r):new $q(Vl,Vl,Vl,Vl,Vl)}static file(e){let r=Vl;if(IZe.isWindows&&(e=e.replace(/\\/g,o2)),e[0]===o2&&e[1]===o2){let n=e.indexOf(o2,2);n===-1?(r=e.substring(2),e=o2):(r=e.substring(2,n),e=e.substring(n)||o2)}return new $q("file",r,e,Vl,Vl)}static from(e,r){return new $q(e.scheme,e.authority,e.path,e.query,e.fragment,r)}static joinPath(e,...r){if(!e.path)throw new Error(`[UriError]: cannot call joinPath on URI without path: ${e.toString()}`);let n;return IZe.isWindows&&e.scheme==="file"?n=t.file(GSn.win32.join(wZe(e,!0),...r)).path:n=GSn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return zHt(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new $q(e);return r._formatted=e.external??null,r._fsPath=e._sep===WSn?e.fsPath??null:null,r}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};fw.URI=xZe;function EKo(t){return!t||typeof t!="object"?!1:typeof t.scheme=="string"&&(typeof t.authority=="string"||typeof t.authority>"u")&&(typeof t.path=="string"||typeof t.path>"u")&&(typeof t.query=="string"||typeof t.query>"u")&&(typeof t.fragment=="string"||typeof t.fragment>"u")}a(EKo,"isUriComponents");var WSn=IZe.isWindows?1:void 0,$q=class extends xZe{static{a(this,"Uri")}constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=wZe(this,!1)),this._fsPath}toString(e=!1){return e?zHt(this,!0):(this._formatted||(this._formatted=zHt(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=WSn),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},zSn={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function $Sn(t,e,r){let n,o=-1;for(let s=0;s=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===45||c===46||c===95||c===126||e&&c===47||r&&c===91||r&&c===93||r&&c===58)o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n!==void 0&&(n+=t.charAt(s));else{n===void 0&&(n=t.substr(0,s));let l=zSn[c];l!==void 0?(o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n+=l):o===-1&&(o=s)}}return o!==-1&&(n+=encodeURIComponent(t.substring(o))),n!==void 0?n:t}a($Sn,"encodeURIComponentFast");function _Ko(t){let e;for(let r=0;r1&&t.scheme==="file"?r=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?r=t.path.substr(1):r=t.path[1].toLowerCase()+t.path.substr(2):r=t.path,IZe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(wZe,"uriToFsPath");function zHt(t,e){let r=e?_Ko:$Sn,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=o2,n+=o2),s){let d=s.indexOf("@");if(d!==-1){let f=s.substr(0,d);s=s.substr(d+1),d=f.lastIndexOf(":"),d===-1?n+=r(f,!1,!1):(n+=r(f.substr(0,d),!1,!1),n+=":",n+=r(f.substr(d+1),!1,!0)),n+="@"}s=s.toLowerCase(),d=s.lastIndexOf(":"),d===-1?n+=r(s,!1,!0):(n+=r(s.substr(0,d),!1,!0),n+=s.substr(d))}if(c){if(c.length>=3&&c.charCodeAt(0)===47&&c.charCodeAt(2)===58){let d=c.charCodeAt(1);d>=65&&d<=90&&(c=`/${String.fromCharCode(d+32)}:${c.substr(3)}`)}else if(c.length>=2&&c.charCodeAt(1)===58){let d=c.charCodeAt(0);d>=65&&d<=90&&(c=`${String.fromCharCode(d+32)}:${c.substr(2)}`)}n+=r(c,!0,!1)}return l&&(n+="?",n+=r(l,!1,!1)),u&&(n+="#",n+=e?u:$Sn(u,!1,!1)),n}a(zHt,"_asFormatted");function YSn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+YSn(t.substr(3)):t}}a(YSn,"decodeURIComponentGraceful");var VSn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function TZe(t){return t.match(VSn)?t.replace(VSn,e=>YSn(e)):t}a(TZe,"percentDecode")});var dJ=I(ps=>{"use strict";p();var vKo=ps&&ps.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),CKo=ps&&ps.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),XHt=ps&&ps.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oZSn(t,r))}a(SKo,"matchesSomeScheme");ps.connectionTokenCookieName="vscode-tkn";ps.connectionTokenQueryName="tkn";var JHt=class{static{a(this,"RemoteAuthoritiesImpl")}constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}setDelegate(e){this._delegate=e}setServerRootPath(e,r){this._serverRootPath=KHt.posix.join(r??"/",XSn(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return KHt.posix.join(this._serverRootPath,$O.vscodeRemoteResource)}set(e,r,n){this._hosts[e]=r,this._ports[e]=n}setConnectionToken(e,r){this._connectionTokens[e]=r}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(l){return bKo.onUnexpectedExternalError(l),e}let r=e.authority,n=this._hosts[r];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);let o=this._ports[r],s=this._connectionTokens[r],c=`path=${encodeURIComponent(e.path)}`;return typeof s=="string"&&(c+=`&${ps.connectionTokenQueryName}=${encodeURIComponent(s)}`),uJ.URI.from({scheme:YHt.isWeb?this._preferredWebSchema:$O.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:c})}};ps.RemoteAuthorities=new JHt;function XSn(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}a(XSn,"getServerProductSegment");ps.builtinExtensionsPath="vs/../../extensions";ps.nodeModulesPath="vs/../../node_modules";ps.nodeModulesAsarPath="vs/../../node_modules.asar";ps.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";ps.VSCODE_AUTHORITY="vscode-app";var ZHt=class t{static{a(this,"FileAccessImpl")}static{this.FALLBACK_AUTHORITY=ps.VSCODE_AUTHORITY}asBrowserUri(e){let r=this.toUri(e);return this.uriToBrowserUri(r)}uriToBrowserUri(e){return e.scheme===$O.vscodeRemote?ps.RemoteAuthorities.rewrite(e):e.scheme===$O.file&&(YHt.isNative||YHt.webWorkerOrigin===`${$O.vscodeFileResource}://${t.FALLBACK_AUTHORITY}`)?e.with({scheme:$O.vscodeFileResource,authority:e.authority||t.FALLBACK_AUTHORITY,query:null,fragment:null}):e}asFileUri(e){let r=this.toUri(e);return this.uriToFileUri(r)}uriToFileUri(e){return e.scheme===$O.vscodeFileResource?e.with({scheme:$O.file,authority:e.authority!==t.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(uJ.URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let r=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(r))return uJ.URI.joinPath(uJ.URI.parse(r,!0),e);let n=KHt.join(r,e);return uJ.URI.file(n)}throw new Error("Cannot determine URI for module id!")}};ps.FileAccess=new ZHt;ps.CacheControlheaders=Object.freeze({"Cache-Control":"no-cache, no-store"});ps.DocumentPolicyheaders=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});var JSn;(function(t){let e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);t.CoopAndCoep=Object.freeze(e.get("3"));let r="vscode-coi";function n(s){let c;typeof s=="string"?c=new URL(s).searchParams:s instanceof URL?c=s.searchParams:uJ.URI.isUri(s)&&(c=new URL(s.toString(!0)).searchParams);let l=c?.get(r);if(l)return e.get(l)}a(n,"getHeadersFromQuery"),t.getHeadersFromQuery=n;function o(s,c,l){if(!globalThis.crossOriginIsolated)return;let u=c&&l?"3":l?"2":"1";s instanceof URLSearchParams?s.set(r,u):s[r]=u}a(o,"addSearchParam"),t.addSearchParam=o})(JSn||(ps.COI=JSn={}))});var s2=I(yr=>{"use strict";p();var TKo=yr&&yr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),IKo=yr&&yr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),rTn=yr&&yr.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oQue.getRoot(n).length&&n[n.length-1]===r}else{let n=e.path;return n.length>1&&n.charCodeAt(n.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,r=X_.sep){return(0,yr.hasTrailingPathSeparator)(e,r)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,r=X_.sep){let n=!1;if(e.scheme===Vq.Schemas.file){let o=VO(e);n=o!==void 0&&o.length===Que.getRoot(o).length&&o[o.length-1]===r}else{r="/";let o=e.path;n=o.length===1&&o.charCodeAt(o.length-1)===47}return!n&&!(0,yr.hasTrailingPathSeparator)(e,r)?e.with({path:e.path+"/"}):e}};yr.ExtUri=que;yr.extUri=new que(()=>!1);yr.extUriBiasedIgnorePathCase=new que(t=>t.scheme===Vq.Schemas.file?!nTn.isLinux:!0);yr.extUriIgnorePathCase=new que(t=>!0);yr.isEqual=yr.extUri.isEqual.bind(yr.extUri);yr.isEqualOrParent=yr.extUri.isEqualOrParent.bind(yr.extUri);yr.getComparisonKey=yr.extUri.getComparisonKey.bind(yr.extUri);yr.basenameOrAuthority=yr.extUri.basenameOrAuthority.bind(yr.extUri);yr.basename=yr.extUri.basename.bind(yr.extUri);yr.extname=yr.extUri.extname.bind(yr.extUri);yr.dirname=yr.extUri.dirname.bind(yr.extUri);yr.joinPath=yr.extUri.joinPath.bind(yr.extUri);yr.normalizePath=yr.extUri.normalizePath.bind(yr.extUri);yr.relativePath=yr.extUri.relativePath.bind(yr.extUri);yr.resolvePath=yr.extUri.resolvePath.bind(yr.extUri);yr.isAbsolutePath=yr.extUri.isAbsolutePath.bind(yr.extUri);yr.isEqualAuthority=yr.extUri.isEqualAuthority.bind(yr.extUri);yr.hasTrailingPathSeparator=yr.extUri.hasTrailingPathSeparator.bind(yr.extUri);yr.removeTrailingPathSeparator=yr.extUri.removeTrailingPathSeparator.bind(yr.extUri);yr.addTrailingPathSeparator=yr.extUri.addTrailingPathSeparator.bind(yr.extUri);function xKo(t,e){let r=[];for(let n=0;nc===n?!1:(0,yr.isEqualOrParent)(o,e(s)))||r.push(t[n])}return r}a(xKo,"distinctParents");var tTn;(function(t){t.META_DATA_LABEL="label",t.META_DATA_DESCRIPTION="description",t.META_DATA_SIZE="size",t.META_DATA_MIME="mime";function e(r){let n=new Map;r.path.substring(r.path.indexOf(";")+1,r.path.lastIndexOf(";")).split(";").forEach(c=>{let[l,u]=c.split(":");l&&u&&n.set(l,u)});let s=r.path.substring(0,r.path.indexOf(";"));return s&&n.set(t.META_DATA_MIME,s),n}a(e,"parseMetaData"),t.parseMetaData=e})(tTn||(yr.DataUri=tTn={}));function wKo(t,e,r){if(e){let n=t.path;return n&&n[0]!==X_.posix.sep&&(n=X_.posix.sep+n),t.with({scheme:r,authority:e,path:n})}return t.with({scheme:r})}a(wKo,"toLocalResource")});var iTn=I(RZe=>{"use strict";p();Object.defineProperty(RZe,"__esModule",{value:!0});RZe.MicrotaskDelay=void 0;RZe.MicrotaskDelay=Symbol("MicrotaskDelay")});var nl=I(Yt=>{"use strict";p();Object.defineProperty(Yt,"__esModule",{value:!0});Yt.AsyncReader=Yt.AsyncReaderEndOfStream=Yt.CancelableAsyncIterableProducer=Yt.AsyncIterableProducer=Yt.AsyncIterableSource=Yt.AsyncIterableObject=Yt.LazyStatefulPromise=Yt.StatefulPromise=Yt.Promises=Yt.DeferredPromise=Yt.IntervalCounter=Yt.TaskSequentializer=Yt.GlobalIdleValue=Yt.AbstractIdleValue=Yt._runWhenIdle=Yt.runWhenGlobalIdle=Yt.ThrottledWorker=Yt.RunOnceWorker=Yt.ProcessTimeRunOnceScheduler=Yt.RunOnceScheduler=Yt.IntervalTimer=Yt.TimeoutTimer=Yt.TaskQueue=Yt.ResourceQueue=Yt.LimitedQueue=Yt.Queue=Yt.Limiter=Yt.AutoOpenBarrier=Yt.Barrier=Yt.ThrottledDelayer=Yt.Delayer=Yt.SequencerByKey=Yt.Sequencer=Yt.Throttler=void 0;Yt.isThenable=aTn;Yt.createCancelablePromise=cTn;Yt.raceCancellation=lTn;Yt.raceCancellationError=DKo;Yt.rejectIfNotCanceled=NKo;Yt.notCancellablePromise=MKo;Yt.raceCancellablePromises=OKo;Yt.raceTimeout=uTn;Yt.asPromise=LKo;Yt.promiseWithResolvers=dTn;Yt.timeout=EGt;Yt.disposableTimeout=UKo;Yt.sequence=QKo;Yt.first=qKo;Yt.firstParallel=jKo;Yt.installFakeRunWhenIdle=HKo;Yt.retry=GKo;Yt.createCancelableAsyncIterableProducer=$Ko;Yt.cancellableIterable=VKo;Yt.createTimeout=WKo;var yGt=n2(),ev=Rs(),Dwe=Rc(),Wq=Ro(),oTn=s2(),RKo=jq(),kKo=iTn(),PKo=cF();function aTn(t){return!!t&&typeof t.then=="function"}a(aTn,"isThenable");function cTn(t){let e=new yGt.CancellationTokenSource,r=t(e.token),n=!1,o=new Promise((s,c)=>{let l=e.token.onCancellationRequested(()=>{n=!0,l.dispose(),c(new ev.CancellationError)});Promise.resolve(r).then(u=>{l.dispose(),e.dispose(),n?(0,Wq.isDisposable)(u)&&u.dispose():s(u)},u=>{l.dispose(),e.dispose(),c(u)})});return new class{cancel(){e.cancel(),e.dispose()}then(s,c){return o.then(s,c)}catch(s){return this.then(void 0,s)}finally(s){return o.finally(s)}}}a(cTn,"createCancelablePromise");function lTn(t,e,r){return new Promise((n,o)=>{let s=e.onCancellationRequested(()=>{s.dispose(),n(r)});t.then(n,o).finally(()=>s.dispose())})}a(lTn,"raceCancellation");function DKo(t,e){return new Promise((r,n)=>{let o=e.onCancellationRequested(()=>{o.dispose(),n(new ev.CancellationError)});t.then(r,n).finally(()=>o.dispose())})}a(DKo,"raceCancellationError");function NKo(t){if(!(0,ev.isCancellationError)(t))return Promise.reject(t)}a(NKo,"rejectIfNotCanceled");function MKo(t){return new Promise((e,r)=>{t.then(e,r)})}a(MKo,"notCancellablePromise");function OKo(t){let e=-1,r=t.map((o,s)=>o.then(c=>(e=s,c))),n=Promise.race(r);return n.cancel=()=>{t.forEach((o,s)=>{s!==e&&o.cancel&&o.cancel()})},n.finally(()=>{n.cancel()}),n}a(OKo,"raceCancellablePromises");function uTn(t,e,r){let n,o=setTimeout(()=>{n?.(void 0),r?.()},e);return Promise.race([t.finally(()=>clearTimeout(o)),new Promise(s=>n=s)])}a(uTn,"raceTimeout");function LKo(t){return new Promise((e,r)=>{let n=t();aTn(n)?n.then(e,r):e(n)})}a(LKo,"asPromise");function dTn(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(dTn,"promiseWithResolvers");var kZe=class{static{a(this,"Throttler")}constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new yGt.CancellationTokenSource}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){let r=a(()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;let n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n},"onComplete");this.queuedPromise=new Promise(n=>{this.activePromise.then(r,r).then(n)})}return new Promise((r,n)=>{this.queuedPromise.then(r,n)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((r,n)=>{this.activePromise.then(o=>{this.activePromise=null,r(o)},o=>{this.activePromise=null,n(o)})})}dispose(){this.cancellationTokenSource.cancel()}};Yt.Throttler=kZe;var eGt=class{static{a(this,"Sequencer")}constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}};Yt.Sequencer=eGt;var tGt=class{static{a(this,"SequencerByKey")}constructor(){this.promiseMap=new Map}queue(e,r){let o=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(r).finally(()=>{this.promiseMap.get(e)===o&&this.promiseMap.delete(e)});return this.promiseMap.set(e,o),o}peek(e){return this.promiseMap.get(e)||void 0}keys(){return this.promiseMap.keys()}};Yt.SequencerByKey=tGt;var BKo=a((t,e)=>{let r=!0,n=setTimeout(()=>{r=!1,e()},t);return{isTriggered:a(()=>r,"isTriggered"),dispose:a(()=>{clearTimeout(n),r=!1},"dispose")}},"timeoutDeferred"),FKo=a(t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:a(()=>e,"isTriggered"),dispose:a(()=>{e=!1},"dispose")}},"microtaskDeferred"),PZe=class{static{a(this,"Delayer")}constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,r=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((o,s)=>{this.doResolve=o,this.doReject=s}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){let o=this.task;return this.task=null,o()}}));let n=a(()=>{this.deferred=null,this.doResolve?.(null)},"fn");return this.deferred=r===kKo.MicrotaskDelay?FKo(n):BKo(r,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new ev.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};Yt.Delayer=PZe;var rGt=class{static{a(this,"ThrottledDelayer")}constructor(e){this.delayer=new PZe(e),this.throttler=new kZe}trigger(e,r){return this.delayer.trigger(()=>this.throttler.queue(e),r)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}};Yt.ThrottledDelayer=rGt;var DZe=class{static{a(this,"Barrier")}constructor(){this._isOpen=!1,this._promise=new Promise((e,r)=>{this._completePromise=e})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}};Yt.Barrier=DZe;var nGt=class extends DZe{static{a(this,"AutoOpenBarrier")}constructor(e){super(),this._timeout=setTimeout(()=>this.open(),e)}open(){clearTimeout(this._timeout),super.open()}};Yt.AutoOpenBarrier=nGt;function EGt(t,e){return e?new Promise((r,n)=>{let o=setTimeout(()=>{s.dispose(),r()},t),s=e.onCancellationRequested(()=>{clearTimeout(o),s.dispose(),n(new ev.CancellationError)})}):cTn(r=>EGt(t,r))}a(EGt,"timeout");function UKo(t,e=0,r){let n=setTimeout(()=>{t(),r&&o.dispose()},e),o=(0,Wq.toDisposable)(()=>{clearTimeout(n),r?.delete(o)});return r?.add(o),o}a(UKo,"disposableTimeout");function QKo(t){let e=[],r=0,n=t.length;function o(){return r!!n,r=null){let n=0,o=t.length,s=a(()=>{if(n>=o)return Promise.resolve(r);let c=t[n++];return Promise.resolve(c()).then(u=>e(u)?Promise.resolve(u):s())},"loop");return s()}a(qKo,"first");function jKo(t,e=n=>!!n,r=null){if(t.length===0)return Promise.resolve(r);let n=t.length,o=a(()=>{n=-1;for(let s of t)s.cancel?.()},"finish");return new Promise((s,c)=>{for(let l of t)l.then(u=>{--n>=0&&e(u)?(o(),s(u)):n===0&&s(r)}).catch(u=>{--n>=0&&(o(),c(u))})})}a(jKo,"firstParallel");var NZe=class{static{a(this,"Limiter")}constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new Dwe.Emitter}whenIdle(){return this.size>0?Dwe.Event.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(e){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise((r,n)=>{this.outstandingPromises.push({factory:e,c:r,e:n}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.consumed(),()=>this.consumed())}}consumed(){this._isDisposed||(this.runningPromises--,--this._size===0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}};Yt.Limiter=NZe;var MZe=class extends NZe{static{a(this,"Queue")}constructor(){super(1)}};Yt.Queue=MZe;var iGt=class{static{a(this,"LimitedQueue")}constructor(){this.sequentializer=new LZe,this.tasks=0}queue(e){return this.sequentializer.isRunning()?this.sequentializer.queue(()=>this.sequentializer.run(this.tasks++,e())):this.sequentializer.run(this.tasks++,e())}};Yt.LimitedQueue=iGt;var oGt=class{static{a(this,"ResourceQueue")}constructor(){this.queues=new Map,this.drainers=new Set,this.drainListeners=void 0,this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;let e=new uF;return this.drainers.add(e),e.p}isDrained(){for(let[,e]of this.queues)if(e.size>0)return!1;return!0}queueSize(e,r=oTn.extUri){let n=r.getComparisonKey(e);return this.queues.get(n)?.size??0}queueFor(e,r,n=oTn.extUri){let o=n.getComparisonKey(e),s=this.queues.get(o);if(!s){s=new MZe;let c=this.drainListenerCount++,l=Dwe.Event.once(s.onDrained)(()=>{s?.dispose(),this.queues.delete(o),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(c),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new Wq.DisposableMap),this.drainListeners.set(c,l),this.queues.set(o,s)}return s.queue(r)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(let e of this.drainers)e.complete();this.drainers.clear()}dispose(){for(let[,e]of this.queues)e.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}};Yt.ResourceQueue=oGt;var sGt=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new uF;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new uF;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!0}),this._runIfNotRunning(),r.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;let e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new ev.BugIndicatingError;this._runningTask=e.task;try{let r=await e.task();e.deferred.complete(r)}catch(r){e.deferred.error(r)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){let e=this._pendingTasks;this._pendingTasks=[];for(let r of e)r.setUndefinedWhenCleared?r.deferred.complete(void 0):r.deferred.error(new ev.CancellationError)}};Yt.TaskQueue=sGt;var aGt=class{static{a(this,"TimeoutTimer")}constructor(e,r){this._isDisposed=!1,this._token=void 0,typeof e=="function"&&typeof r=="number"&&this.setIfNotSet(e,r)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==void 0&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(e,r){if(this._isDisposed)throw new ev.BugIndicatingError("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=void 0,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new ev.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},r))}};Yt.TimeoutTimer=aGt;var cGt=class{static{a(this,"IntervalTimer")}constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,r,n=globalThis){if(this.isDisposed)throw new ev.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let o=n.setInterval(()=>{e()},r);this.disposable=(0,Wq.toDisposable)(()=>{n.clearInterval(o),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};Yt.IntervalTimer=cGt;var Nwe=class{static{a(this,"RunOnceScheduler")}constructor(e,r){this.timeoutToken=void 0,this.runner=e,this.timeout=r,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==void 0}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}};Yt.RunOnceScheduler=Nwe;var lGt=class{static{a(this,"ProcessTimeRunOnceScheduler")}constructor(e,r){r%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${r}ms is not a multiple of 1000ms.`),this.runner=e,this.timeout=r,this.counter=0,this.intervalToken=void 0,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=void 0)}schedule(e=this.timeout){e%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${e}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(e/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return this.intervalToken!==void 0}onInterval(){this.counter--,!(this.counter>0)&&(clearInterval(this.intervalToken),this.intervalToken=void 0,this.runner?.())}};Yt.ProcessTimeRunOnceScheduler=lGt;var uGt=class extends Nwe{static{a(this,"RunOnceWorker")}constructor(e,r){super(e,r),this.units=[]}work(e){this.units.push(e),this.isScheduled()||this.schedule()}doRun(){let e=this.units;this.units=[],this.runner?.(e)}dispose(){this.units=[],super.dispose()}};Yt.RunOnceWorker=uGt;var dGt=class extends Wq.Disposable{static{a(this,"ThrottledWorker")}constructor(e,r){super(),this.options=e,this.handler=r,this.pendingWork=[],this.throttler=this._register(new Wq.MutableDisposable),this.disposed=!1,this.lastExecutionTime=0}get pending(){return this.pendingWork.length}work(e){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+e.length>this.options.maxBufferedWork)return!1}else if(this.pending+e.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}for(let n of e)this.pendingWork.push(n);let r=Date.now()-this.lastExecutionTime;return!this.throttler.value&&(!this.options.waitThrottleDelayBetweenWorkUnits||r>=this.options.throttleDelay)?this.doWork():!this.throttler.value&&this.options.waitThrottleDelayBetweenWorkUnits&&this.scheduleThrottler(Math.max(this.options.throttleDelay-r,0)),!0}doWork(){this.lastExecutionTime=Date.now(),this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&this.scheduleThrottler()}scheduleThrottler(e=this.options.throttleDelay){this.throttler.value=new Nwe(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};Yt.ThrottledWorker=dGt;(function(){let t=globalThis;typeof t.requestIdleCallback!="function"||typeof t.cancelIdleCallback!="function"?Yt._runWhenIdle=(e,r,n)=>{(0,RKo.setTimeout0)(()=>{if(o)return;let s=Date.now()+15;r(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let o=!1;return{dispose(){o||(o=!0)}}}:Yt._runWhenIdle=(e,r,n)=>{let o=e.requestIdleCallback(r,typeof n=="number"?{timeout:n}:void 0),s=!1;return{dispose(){s||(s=!0,e.cancelIdleCallback(o))}}},Yt.runWhenGlobalIdle=(e,r)=>(0,Yt._runWhenIdle)(globalThis,e,r)})();function HKo(t){let e=Yt._runWhenIdle,r=Yt.runWhenGlobalIdle;return Yt._runWhenIdle=t,Yt.runWhenGlobalIdle=(n,o)=>t(globalThis,n,o),(0,Wq.toDisposable)(()=>{Yt._runWhenIdle=e,Yt.runWhenGlobalIdle=r})}a(HKo,"installFakeRunWhenIdle");var OZe=class{static{a(this,"AbstractIdleValue")}constructor(e,r){this._didRun=!1,this._executor=()=>{try{this._value=r()}catch(n){this._error=n}finally{this._didRun=!0}},this._handle=(0,Yt._runWhenIdle)(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}};Yt.AbstractIdleValue=OZe;var fGt=class extends OZe{static{a(this,"GlobalIdleValue")}constructor(e){super(globalThis,e)}};Yt.GlobalIdleValue=fGt;async function GKo(t,e,r){let n;for(let o=0;on?.(),"cancel"),promise:r},r.then(()=>this.doneRunning(e),()=>this.doneRunning(e)),r}doneRunning(e){this._running&&e===this._running.taskId&&(this._running=void 0,this.runQueued())}runQueued(){if(this._queued){let e=this._queued;this._queued=void 0,e.run().then(e.promiseResolve,e.promiseReject)}}queue(e){if(this._queued)this._queued.run=e;else{let{promise:r,resolve:n,reject:o}=dTn();this._queued={run:e,promise:r,promiseResolve:n,promiseReject:o}}return this._queued.promise}hasQueued(){return!!this._queued}async join(){return this._queued?.promise??this._running?.promise}};Yt.TaskSequentializer=LZe;var pGt=class{static{a(this,"IntervalCounter")}constructor(e,r=()=>Date.now()){this.interval=e,this.nowFn=r,this.lastIncrementTime=0,this.value=0}increment(){let e=this.nowFn();return e-this.lastIncrementTime>this.interval&&(this.lastIncrementTime=e,this.value=0),this.value++,this.value}};Yt.IntervalCounter=pGt;var uF=class t{static{a(this,"DeferredPromise")}static fromPromise(e){let r=new t;return r.settleWith(e),r}get isRejected(){return this.outcome?.outcome===1}get isResolved(){return this.outcome?.outcome===0}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===0?this.outcome?.value:void 0}constructor(){this.p=new Promise((e,r)=>{this.completeCallback=e,this.errorCallback=r})}complete(e){return this.isSettled?Promise.resolve():new Promise(r=>{this.completeCallback(e),this.outcome={outcome:0,value:e},r()})}error(e){return this.isSettled?Promise.resolve():new Promise(r=>{this.errorCallback(e),this.outcome={outcome:1,value:e},r()})}settleWith(e){return e.then(r=>this.complete(r),r=>this.error(r))}cancel(){return this.error(new ev.CancellationError)}};Yt.DeferredPromise=uF;var sTn;(function(t){async function e(n){let o,s=await Promise.all(n.map(c=>c.then(l=>l,l=>{o||(o=l)})));if(typeof o<"u")throw o;return s}a(e,"settled"),t.settled=e;function r(n){return new Promise(async(o,s)=>{try{await n(o,s)}catch(c){s(c)}})}a(r,"withAsyncBody"),t.withAsyncBody=r})(sTn||(Yt.Promises=sTn={}));var BZe=class{static{a(this,"StatefulPromise")}get value(){return this._value}get error(){return this._error}get isResolved(){return this._isResolved}constructor(e){this._value=void 0,this._error=void 0,this._isResolved=!1,this.promise=e.then(r=>(this._value=r,this._isResolved=!0,r),r=>{throw this._error=r,this._isResolved=!0,r})}requireValue(){if(!this._isResolved)throw new ev.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}};Yt.StatefulPromise=BZe;var hGt=class{static{a(this,"LazyStatefulPromise")}constructor(e){this._compute=e,this._promise=new PKo.Lazy(()=>new BZe(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}};Yt.LazyStatefulPromise=hGt;var FZe=class t{static{a(this,"AsyncIterableObject")}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Dwe.Emitter,queueMicrotask(async()=>{let n={emitOne:a(o=>this.emitOne(o),"emitOne"),emitMany:a(o=>this.emitMany(o),"emitMany"),reject:a(o=>this.reject(o),"reject")};try{await Promise.resolve(e(n)),this.resolve()}catch(o){this.reject(o)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:a(async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0}),"return")}}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}map(e){return t.map(this,e)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static async toPromise(e){let r=[];for await(let n of e)r.push(n);return r}toPromise(){return t.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Yt.AsyncIterableObject=FZe;function $Ko(t){let e=new yGt.CancellationTokenSource,r=t(e.token);return new QZe(e,async n=>{let o=e.token.onCancellationRequested(()=>{o.dispose(),e.dispose(),n.reject(new ev.CancellationError)});try{for await(let s of r){if(e.token.isCancellationRequested)return;n.emitOne(s)}o.dispose(),e.dispose()}catch(s){o.dispose(),e.dispose(),n.reject(s)}})}a($Ko,"createCancelableAsyncIterableProducer");var mGt=class{static{a(this,"AsyncIterableSource")}constructor(e){this._deferred=new uF,this._asyncIterable=new FZe(o=>{if(r){o.reject(r);return}return n&&o.emitMany(n),this._errorFn=s=>o.reject(s),this._emitOneFn=s=>o.emitOne(s),this._emitManyFn=s=>o.emitMany(s),this._deferred.p},e);let r,n;this._errorFn=o=>{r||(r=o)},this._emitOneFn=o=>{n||(n=[]),n.push(o)},this._emitManyFn=o=>{n?o.forEach(s=>n.push(s)):n=o.slice()}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(e){this._errorFn(e),this._deferred.complete()}emitOne(e){this._emitOneFn(e)}emitMany(e){this._emitManyFn(e)}};Yt.AsyncIterableSource=mGt;function VKo(t,e){let r=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t;return{async next(){return e.isCancellationRequested?{done:!0,value:void 0}:await lTn(r.next(),e)||{done:!0,value:void 0}},throw:r.throw?.bind(r),return:r.return?.bind(r),[Symbol.asyncIterator](){return this}}}a(VKo,"cancellableIterable");var gGt=class{static{a(this,"ProducerConsumer")}constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){let r=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(r,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(let r of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(r,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new ev.BugIndicatingError("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,r){r.ok?e.complete(r.value):e.error(r.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){let e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{let e=new uF;return this._unsatisfiedConsumers.push(e),e.p}}},UZe=class t{static{a(this,"AsyncIterableProducer")}constructor(e,r){this._onReturn=r,this._producerConsumer=new gGt,this._iterator={next:a(()=>this._producerConsumer.consume(),"next"),return:a(()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),"return"),throw:a(async n=>(this._finishError(n),{done:!0,value:void 0}),"throw")},queueMicrotask(async()=>{let n=e({emitOne:a(o=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:o}}),"emitOne"),emitMany:a(o=>{for(let s of o)this._producerConsumer.produce({ok:!0,value:{done:!1,value:s}})},"emitMany"),reject:a(o=>this._finishError(o),"reject")});if(!this._producerConsumer.hasFinalValue)try{await n,this._finishOk()}catch(o){this._finishError(o)}})}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}static tee(e){let r,n,o=new uF,s=a(async()=>{if(!(!r||!n))try{for await(let u of e)r.emitOne(u),n.emitOne(u)}catch(u){r.reject(u),n.reject(u)}finally{o.complete()}},"start"),c=new t(async u=>(r=u,s(),o.p)),l=new t(async u=>(n=u,s(),o.p));return[c,l]}map(e){return t.map(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};Yt.AsyncIterableProducer=UZe;var QZe=class extends UZe{static{a(this,"CancelableAsyncIterableProducer")}constructor(e,r){super(r),this._source=e}cancel(){this._source.cancel()}};Yt.CancelableAsyncIterableProducer=QZe;Yt.AsyncReaderEndOfStream=Symbol("AsyncReaderEndOfStream");var AGt=class{static{a(this,"AsyncReader")}get endOfStream(){return this._buffer.length===0&&this._atEnd}constructor(e){this._source=e,this._buffer=[],this._atEnd=!1}async read(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?Yt.AsyncReaderEndOfStream:this._buffer.shift()}async readWhile(e,r){do{let n=await this.peek();if(n===Yt.AsyncReaderEndOfStream||!e(n))break;await this.read(),await r(n)}while(!0)}readBufferedOrThrow(){let e=this.peekBufferedOrThrow();return this._buffer.shift(),e}async consumeToEnd(){for(;!this.endOfStream;)await this.read()}async peek(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?Yt.AsyncReaderEndOfStream:this._buffer[0]}peekBufferedOrThrow(){if(this._buffer.length===0){if(this._atEnd)return Yt.AsyncReaderEndOfStream;throw new ev.BugIndicatingError("No buffered elements")}return this._buffer[0]}async peekTimeout(e){if(this._buffer.length===0&&!this._atEnd&&await uTn(this._extendBuffer(),e),this._atEnd)return Yt.AsyncReaderEndOfStream;if(this._buffer.length!==0)return this._buffer[0]}_extendBuffer(){return this._atEnd?Promise.resolve():(this._extendBufferPromise||(this._extendBufferPromise=(async()=>{let{value:e,done:r}=await this._source.next();this._extendBufferPromise=void 0,r?this._atEnd=!0:this._buffer.push(e)})()),this._extendBufferPromise)}};Yt.AsyncReader=AGt;function WKo(t,e){let r=setTimeout(e,t);return(0,Wq.toDisposable)(()=>clearTimeout(r))}a(WKo,"createTimeout")});var ETn=I(iT=>{"use strict";p();var ZKo=iT&&iT.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(iT,"__esModule",{value:!0});var XKo=require("fs"),eJo=ZKo(wP()),Hue=eJo.default("@kwsites/file-exists");function tJo(t,e,r){Hue("checking %s",t);try{let n=XKo.statSync(t);return n.isFile()&&e?(Hue("[OK] path represents a file"),!0):n.isDirectory()&&r?(Hue("[OK] path represents a directory"),!0):(Hue("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return Hue("[FAIL] path is not accessible: %o",n),!1;throw Hue("[FATAL] %o",n),n}}a(tJo,"check");function rJo(t,e=iT.READABLE){return tJo(t,(e&iT.FILE)>0,(e&iT.FOLDER)>0)}a(rJo,"exists");iT.exists=rJo;iT.FILE=1;iT.FOLDER=2;iT.READABLE=iT.FILE+iT.FOLDER});var _Tn=I(VZe=>{"use strict";p();function nJo(t){for(var e in t)VZe.hasOwnProperty(e)||(VZe[e]=t[e])}a(nJo,"__export");Object.defineProperty(VZe,"__esModule",{value:!0});nJo(ETn())});var CTn=I((Pyd,vTn)=>{p();var Vue=1e3,Wue=Vue*60,zue=Wue*60,fJ=zue*24,iJo=fJ*7,oJo=fJ*365.25;vTn.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return sJo(t);if(r==="number"&&isFinite(t))return e.long?cJo(t):aJo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function sJo(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*oJo;case"weeks":case"week":case"w":return r*iJo;case"days":case"day":case"d":return r*fJ;case"hours":case"hour":case"hrs":case"hr":case"h":return r*zue;case"minutes":case"minute":case"mins":case"min":case"m":return r*Wue;case"seconds":case"second":case"secs":case"sec":case"s":return r*Vue;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(sJo,"parse");function aJo(t){var e=Math.abs(t);return e>=fJ?Math.round(t/fJ)+"d":e>=zue?Math.round(t/zue)+"h":e>=Wue?Math.round(t/Wue)+"m":e>=Vue?Math.round(t/Vue)+"s":t+"ms"}a(aJo,"fmtShort");function cJo(t){var e=Math.abs(t);return e>=fJ?WZe(t,e,fJ,"day"):e>=zue?WZe(t,e,zue,"hour"):e>=Wue?WZe(t,e,Wue,"minute"):e>=Vue?WZe(t,e,Vue,"second"):t+" ms"}a(cJo,"fmtLong");function WZe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(WZe,"plural")});var bGt=I((Myd,bTn)=>{p();function lJo(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=CTn(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let P=r.formatters[x];if(typeof P=="function"){let D=E[T];R=P.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,E),(_.log||r.log).apply(_,E)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(E=>{m=E},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h=(typeof f=="string"?f:"").trim().replace(" ",",").split(",").filter(Boolean);for(let m of h)m[0]==="-"?r.skips.push(m.slice(1)):r.names.push(m)}a(o,"enable");function s(f,h){let m=0,g=0,A=-1,y=0;for(;m"-"+h)].join(",");return r.enable(""),f}a(c,"disable");function l(f){for(let h of r.skips)if(s(f,h))return!1;for(let h of r.names)if(s(f,h))return!0;return!1}a(l,"enabled");function u(f){return f instanceof Error?f.stack||f.message:f}a(u,"coerce");function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return a(d,"destroy"),r.enable(r.load()),r}a(lJo,"setup");bTn.exports=lJo});var STn=I((oT,zZe)=>{p();oT.formatArgs=dJo;oT.save=fJo;oT.load=pJo;oT.useColors=uJo;oT.storage=hJo();oT.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();oT.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function uJo(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(uJo,"useColors");function dJo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+zZe.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(dJo,"formatArgs");oT.log=console.debug||console.log||(()=>{});function fJo(t){try{t?oT.storage.setItem("debug",t):oT.storage.removeItem("debug")}catch{}}a(fJo,"save");function pJo(){let t;try{t=oT.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(pJo,"load");function hJo(){try{return localStorage}catch{}}a(hJo,"localstorage");zZe.exports=bGt()(oT);var{formatters:mJo}=zZe.exports;mJo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var ITn=I((Tg,KZe)=>{p();var gJo=require("tty"),YZe=require("util");Tg.init=bJo;Tg.log=_Jo;Tg.formatArgs=yJo;Tg.save=vJo;Tg.load=CJo;Tg.useColors=AJo;Tg.destroy=YZe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Tg.colors=[6,2,3,4,5,1];try{let t=c$e();t&&(t.stderr||t).level>=2&&(Tg.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Tg.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function AJo(){return"colors"in Tg.inspectOpts?!!Tg.inspectOpts.colors:gJo.isatty(process.stderr.fd)}a(AJo,"useColors");function yJo(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` `).join(` -`+s),t.push(o+"m+"+CZe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=hYo()+e+" "+t[0]}a(pYo,"formatArgs");function hYo(){return vg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(hYo,"getDate");function mYo(...t){return process.stderr.write(vZe.formatWithOptions(vg.inspectOpts,...t)+` -`)}a(mYo,"log");function gYo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(gYo,"save");function AYo(){return process.env.DEBUG}a(AYo,"load");function yYo(t){t.inspectOpts={};let e=Object.keys(vg.inspectOpts);for(let r=0;re.trim()).join(" ")};Y1n.O=function(t){return this.inspectOpts.colors=this.useColors,vZe.inspect(t,this.inspectOpts)}});var J1n=I((Q0d,DHt)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?DHt.exports=z1n():DHt.exports=K1n()});var MHt=I(nJ=>{"use strict";p();Object.defineProperty(nJ,"__esModule",{value:!0});nJ.createDeferred=nJ.deferred=void 0;function NHt(){let t,e,r="pending";return{promise:new Promise((o,s)=>{t=o,e=s}),done(o){r==="pending"&&(r="resolved",t(o))},fail(o){r==="pending"&&(r="rejected",e(o))},get fulfilled(){return r!=="pending"},get status(){return r}}}a(NHt,"deferred");nJ.deferred=NHt;nJ.createDeferred=NHt;nJ.default=NHt});var zZe=I(eT=>{"use strict";p();Object.defineProperty(eT,"__esModule",{value:!0});eT.deepClone=XIn;eT.deepFreeze=nXo;eT.cloneAndChange=iXo;eT.mixin=txn;eT.equals=xwe;eT.safeStringify=oXo;eT.stableStringify=sXo;eT.distinct=aXo;eT.getCaseInsensitive=cXo;eT.filter=lXo;eT.mapValues=uXo;var Fq=KS();function XIn(t){if(!t||typeof t!="object"||t instanceof RegExp)return t;let e=Array.isArray(t)?[]:{};return Object.entries(t).forEach(([r,n])=>{e[r]=n&&typeof n=="object"?XIn(n):n}),e}a(XIn,"deepClone");function nXo(t){if(!t||typeof t!="object")return t;let e=[t];for(;e.length>0;){let r=e.shift();Object.freeze(r);for(let n in r)if(exn.call(r,n)){let o=r[n];typeof o=="object"&&!Object.isFrozen(o)&&!(0,Fq.isTypedArray)(o)&&e.push(o)}}return t}a(nXo,"deepFreeze");var exn=Object.prototype.hasOwnProperty;function iXo(t,e){return OGt(t,e,new Set)}a(iXo,"cloneAndChange");function OGt(t,e,r){if((0,Fq.isUndefinedOrNull)(t))return t;let n=e(t);if(typeof n<"u")return n;if(Array.isArray(t)){let o=[];for(let s of t)o.push(OGt(s,e,r));return o}if((0,Fq.isObject)(t)){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let o={};for(let s in t)exn.call(t,s)&&(o[s]=OGt(t[s],e,r));return r.delete(t),o}return t}a(OGt,"_cloneAndChange");function txn(t,e,r=!0){return(0,Fq.isObject)(t)?((0,Fq.isObject)(e)&&Object.keys(e).forEach(n=>{n in t?r&&((0,Fq.isObject)(t[n])&&(0,Fq.isObject)(e[n])?txn(t[n],e[n],r):t[n]=e[n]):t[n]=e[n]}),t):e}a(txn,"mixin");function xwe(t,e){if(t===e)return!0;if(t==null||e===null||e===void 0||typeof t!=typeof e||typeof t!="object"||Array.isArray(t)!==Array.isArray(e))return!1;let r,n;if(Array.isArray(t)){if(t.length!==e.length)return!1;for(r=0;r{if((0,Fq.isObject)(n)||Array.isArray(n)){if(e.has(n))return"[Circular]";e.add(n)}return typeof n=="bigint"?`[BigInt ${n.toString()}]`:n})}a(oXo,"safeStringify");function sXo(t){if(t===void 0)return"undefined";try{return LGt(t,new WeakSet)}catch{return""}}a(sXo,"stableStringify");function LGt(t,e){if(t===null||typeof t!="object")return JSON.stringify(t)??"null";if(e.has(t))return'"[Circular]"';if(e.add(t),Array.isArray(t))return"["+t.map(o=>LGt(o,e)).join(",")+"]";let r=Object.keys(t).sort(),n=[];for(let o of r){let s=t[o];s!==void 0&&n.push(JSON.stringify(o)+":"+LGt(s,e))}return"{"+n.join(",")+"}"}a(LGt,"_stableStringify");function aXo(t,e){let r=Object.create(null);return!t||!e||Object.keys(e).forEach(o=>{let s=t[o],c=e[o];xwe(s,c)||(r[o]=c)}),r}a(aXo,"distinct");function cXo(t,e){let r=e.toLowerCase(),n=Object.keys(t).find(o=>o.toLowerCase()===r);return n?t[n]:t[e]}a(cXo,"getCaseInsensitive");function lXo(t,e){let r=Object.create(null);for(let[n,o]of Object.entries(t))e(n,o)&&(r[n]=o);return r}a(lXo,"filter");function uXo(t,e){let r={};for(let[n,o]of Object.entries(t))r[n]=e(o,n);return r}a(uXo,"mapValues")});var X_=I(YZe=>{"use strict";p();Object.defineProperty(YZe,"__esModule",{value:!0});YZe.ErrorUtils=void 0;var dXo=zZe(),rxn;(function(t){function e(n){return n instanceof Error?n:typeof n=="string"?new Error(n):new Error(`An unexpected error occurred: ${(0,dXo.safeStringify)(n)}`)}a(e,"fromUnknown"),t.fromUnknown=e;function r(n){return n.stack?n.stack:n.message}a(r,"toString"),t.toString=r})(rxn||(YZe.ErrorUtils=rxn={}))});var uw=I(KZe=>{"use strict";p();Object.defineProperty(KZe,"__esModule",{value:!0});KZe.Result=void 0;var BGt=X_(),nxn;(function(t){function e(c){return new FGt(c)}a(e,"ok"),t.ok=e;function r(c){return new UGt(c)}a(r,"error"),t.error=r;function n(c){return t.error(new Error(c))}a(n,"fromString"),t.fromString=n;function o(c){try{return t.ok(c())}catch(l){return t.error(BGt.ErrorUtils.fromUnknown(l))}}a(o,"tryWith"),t.tryWith=o;async function s(c){try{return t.ok(await c())}catch(l){return t.error(BGt.ErrorUtils.fromUnknown(l))}}a(s,"tryWithAsync"),t.tryWithAsync=s})(nxn||(KZe.Result=nxn={}));var FGt=class t{static{a(this,"ResultOk")}constructor(e){this.val=e}map(e){return new t(e(this.val))}mapError(e){return this}flatMap(e){return e(this.val)}unwrap(){return this.val}unwrapOr(e){return this.val}isOk(){return!0}isError(){return!1}},UGt=class t{static{a(this,"ResultError")}constructor(e){this.err=e}map(e){return this}mapError(e){return new t(e(this.err))}flatMap(e){return this}unwrap(){throw this.err instanceof Error?this.err:BGt.ErrorUtils.fromUnknown(this.err)}unwrapOr(e){return e}isOk(){return!1}isError(){return!0}}});var jd=I((rZd,u2n)=>{p();u2n.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent")}});var Ec=I((iZd,O2n)=>{"use strict";p();var d2n=Symbol.for("undici.error.UND_ERR"),Hd=class extends Error{static{a(this,"UndiciError")}constructor(e){super(e),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&e[d2n]===!0}[d2n]=!0},f2n=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),NZt=class extends Hd{static{a(this,"ConnectTimeoutError")}constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[f2n]===!0}[f2n]=!0},p2n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),MZt=class extends Hd{static{a(this,"HeadersTimeoutError")}constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[p2n]===!0}[p2n]=!0},h2n=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),OZt=class extends Hd{static{a(this,"HeadersOverflowError")}constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&e[h2n]===!0}[h2n]=!0},m2n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),LZt=class extends Hd{static{a(this,"BodyTimeoutError")}constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[m2n]===!0}[m2n]=!0},g2n=Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"),BZt=class extends Hd{static{a(this,"ResponseStatusCodeError")}constructor(e,r,n,o){super(e),this.name="ResponseStatusCodeError",this.message=e||"Response Status Code Error",this.code="UND_ERR_RESPONSE_STATUS_CODE",this.body=o,this.status=r,this.statusCode=r,this.headers=n}static[Symbol.hasInstance](e){return e&&e[g2n]===!0}[g2n]=!0},A2n=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),FZt=class extends Hd{static{a(this,"InvalidArgumentError")}constructor(e){super(e),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](e){return e&&e[A2n]===!0}[A2n]=!0},y2n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),UZt=class extends Hd{static{a(this,"InvalidReturnValueError")}constructor(e){super(e),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](e){return e&&e[y2n]===!0}[y2n]=!0},E2n=Symbol.for("undici.error.UND_ERR_ABORT"),Lrt=class extends Hd{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError",this.message=e||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](e){return e&&e[E2n]===!0}[E2n]=!0},_2n=Symbol.for("undici.error.UND_ERR_ABORTED"),QZt=class extends Lrt{static{a(this,"RequestAbortedError")}constructor(e){super(e),this.name="AbortError",this.message=e||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](e){return e&&e[_2n]===!0}[_2n]=!0},v2n=Symbol.for("undici.error.UND_ERR_INFO"),qZt=class extends Hd{static{a(this,"InformationalError")}constructor(e){super(e),this.name="InformationalError",this.message=e||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](e){return e&&e[v2n]===!0}[v2n]=!0},C2n=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),jZt=class extends Hd{static{a(this,"RequestContentLengthMismatchError")}constructor(e){super(e),this.name="RequestContentLengthMismatchError",this.message=e||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[C2n]===!0}[C2n]=!0},b2n=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),HZt=class extends Hd{static{a(this,"ResponseContentLengthMismatchError")}constructor(e){super(e),this.name="ResponseContentLengthMismatchError",this.message=e||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[b2n]===!0}[b2n]=!0},S2n=Symbol.for("undici.error.UND_ERR_DESTROYED"),GZt=class extends Hd{static{a(this,"ClientDestroyedError")}constructor(e){super(e),this.name="ClientDestroyedError",this.message=e||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](e){return e&&e[S2n]===!0}[S2n]=!0},T2n=Symbol.for("undici.error.UND_ERR_CLOSED"),$Zt=class extends Hd{static{a(this,"ClientClosedError")}constructor(e){super(e),this.name="ClientClosedError",this.message=e||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](e){return e&&e[T2n]===!0}[T2n]=!0},I2n=Symbol.for("undici.error.UND_ERR_SOCKET"),VZt=class extends Hd{static{a(this,"SocketError")}constructor(e,r){super(e),this.name="SocketError",this.message=e||"Socket error",this.code="UND_ERR_SOCKET",this.socket=r}static[Symbol.hasInstance](e){return e&&e[I2n]===!0}[I2n]=!0},x2n=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),WZt=class extends Hd{static{a(this,"NotSupportedError")}constructor(e){super(e),this.name="NotSupportedError",this.message=e||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](e){return e&&e[x2n]===!0}[x2n]=!0},w2n=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),zZt=class extends Hd{static{a(this,"BalancedPoolMissingUpstreamError")}constructor(e){super(e),this.name="MissingUpstreamError",this.message=e||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](e){return e&&e[w2n]===!0}[w2n]=!0},R2n=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),YZt=class extends Error{static{a(this,"HTTPParserError")}constructor(e,r,n){super(e),this.name="HTTPParserError",this.code=r?`HPE_${r}`:void 0,this.data=n?n.toString():void 0}static[Symbol.hasInstance](e){return e&&e[R2n]===!0}[R2n]=!0},k2n=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),KZt=class extends Hd{static{a(this,"ResponseExceededMaxSizeError")}constructor(e){super(e),this.name="ResponseExceededMaxSizeError",this.message=e||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](e){return e&&e[k2n]===!0}[k2n]=!0},P2n=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),JZt=class extends Hd{static{a(this,"RequestRetryError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="RequestRetryError",this.message=e||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[P2n]===!0}[P2n]=!0},D2n=Symbol.for("undici.error.UND_ERR_RESPONSE"),ZZt=class extends Hd{static{a(this,"ResponseError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="ResponseError",this.message=e||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[D2n]===!0}[D2n]=!0},N2n=Symbol.for("undici.error.UND_ERR_PRX_TLS"),XZt=class extends Hd{static{a(this,"SecureProxyConnectionError")}constructor(e,r,n){super(r,{cause:e,...n??{}}),this.name="SecureProxyConnectionError",this.message=r||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=e}static[Symbol.hasInstance](e){return e&&e[N2n]===!0}[N2n]=!0},M2n=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),eXt=class extends Hd{static{a(this,"MessageSizeExceededError")}constructor(e){super(e),this.name="MessageSizeExceededError",this.message=e||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](e){return e&&e[M2n]===!0}get[M2n](){return!0}};O2n.exports={AbortError:Lrt,HTTPParserError:YZt,UndiciError:Hd,HeadersTimeoutError:MZt,HeadersOverflowError:OZt,BodyTimeoutError:LZt,RequestContentLengthMismatchError:jZt,ConnectTimeoutError:NZt,ResponseStatusCodeError:BZt,InvalidArgumentError:FZt,InvalidReturnValueError:UZt,RequestAbortedError:QZt,ClientDestroyedError:GZt,ClientClosedError:$Zt,InformationalError:qZt,SocketError:VZt,NotSupportedError:WZt,ResponseContentLengthMismatchError:HZt,BalancedPoolMissingUpstreamError:zZt,ResponseExceededMaxSizeError:KZt,RequestRetryError:JZt,ResponseError:ZZt,SecureProxyConnectionError:XZt,MessageSizeExceededError:eXt}});var Frt=I((aZd,L2n)=>{"use strict";p();var Brt={},tXt=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"];for(let t=0;t{"use strict";p();var{wellknownHeaderNames:B2n,headerNameLowerCasedRecord:Dls}=Frt(),rXt=class t{static{a(this,"TstNode")}value=null;left=null;middle=null;right=null;code;constructor(e,r,n){if(n===void 0||n>=e.length)throw new TypeError("Unreachable");if((this.code=e.charCodeAt(n))>127)throw new TypeError("key must be ascii string");e.length!==++n?this.middle=new t(e,r,n):this.value=r}add(e,r){let n=e.length;if(n===0)throw new TypeError("Unreachable");let o=0,s=this;for(;;){let c=e.charCodeAt(o);if(c>127)throw new TypeError("key must be ascii string");if(s.code===c)if(n===++o){s.value=r;break}else if(s.middle!==null)s=s.middle;else{s.middle=new t(e,r,o);break}else if(s.code=65&&(s|=32);o!==null;){if(s===o.code){if(r===++n)return o;o=o.middle;break}o=o.code{"use strict";p();var KRe=require("node:assert"),{kDestroyed:j2n,kBodyUsed:Gde,kListeners:nXt,kBody:q2n}=jd(),{IncomingMessage:Nls}=require("node:http"),jrt=require("node:stream"),Mls=require("node:net"),{Blob:Ols}=require("node:buffer"),Lls=require("node:util"),{stringify:Bls}=require("node:querystring"),{EventEmitter:Fls}=require("node:events"),{InvalidArgumentError:xg}=Ec(),{headerNameLowerCasedRecord:Uls}=Frt(),{tree:H2n}=Q2n(),[Qls,qls]=process.versions.node.split(".").map(t=>Number(t)),qrt=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[q2n]=e,this[Gde]=!1}async*[Symbol.asyncIterator](){KRe(!this[Gde],"disturbed"),this[Gde]=!0,yield*this[q2n]}};function jls(t){return Hrt(t)?(z2n(t)===0&&t.on("data",function(){KRe(!1)}),typeof t.readableDidRead!="boolean"&&(t[Gde]=!1,Fls.prototype.on.call(t,"data",function(){this[Gde]=!0})),t):t&&typeof t.pipeTo=="function"?new qrt(t):t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&W2n(t)?new qrt(t):t}a(jls,"wrapRequestBody");function Hls(){}a(Hls,"nop");function Hrt(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Hrt,"isStream");function G2n(t){if(t===null)return!1;if(t instanceof Ols)return!0;if(typeof t!="object")return!1;{let e=t[Symbol.toStringTag];return(e==="Blob"||e==="File")&&("stream"in t&&typeof t.stream=="function"||"arrayBuffer"in t&&typeof t.arrayBuffer=="function")}}a(G2n,"isBlobLike");function Gls(t,e){if(t.includes("?")||t.includes("#"))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=Bls(e);return r&&(t+="?"+r),t}a(Gls,"buildURL");function $2n(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a($2n,"isValidPort");function Qrt(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(Qrt,"isHttpOrHttpsPrefixed");function V2n(t){if(typeof t=="string"){if(t=new URL(t),!Qrt(t.origin||t.protocol))throw new xg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new xg("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&$2n(t.port)===!1)throw new xg("Invalid URL: port must be a valid integer or a string representation of an integer.");if(t.path!=null&&typeof t.path!="string")throw new xg("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new xg("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new xg("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new xg("Invalid URL origin: the origin must be a string or null/undefined.");if(!Qrt(t.origin||t.protocol))throw new xg("Invalid URL protocol: the URL must start with `http:` or `https:`.");let e=t.port!=null?t.port:t.protocol==="https:"?443:80,r=t.origin!=null?t.origin:`${t.protocol||""}//${t.hostname||""}:${e}`,n=t.path!=null?t.path:`${t.pathname||""}${t.search||""}`;return r[r.length-1]==="/"&&(r=r.slice(0,r.length-1)),n&&n[0]!=="/"&&(n=`/${n}`),new URL(`${r}${n}`)}if(!Qrt(t.origin||t.protocol))throw new xg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(V2n,"parseURL");function $ls(t){if(t=V2n(t),t.pathname!=="/"||t.search||t.hash)throw new xg("invalid url");return t}a($ls,"parseOrigin");function Vls(t){if(t[0]==="["){let r=t.indexOf("]");return KRe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(Vls,"getHostname");function Wls(t){if(!t)return null;KRe(typeof t=="string");let e=Vls(t);return Mls.isIP(e)?"":e}a(Wls,"getServerName");function zls(t){return JSON.parse(JSON.stringify(t))}a(zls,"deepClone");function Yls(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(Yls,"isAsyncIterable");function W2n(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(W2n,"isIterable");function z2n(t){if(t==null)return 0;if(Hrt(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(G2n(t))return t.size!=null?t.size:null;if(J2n(t))return t.byteLength}return null}a(z2n,"bodyLength");function Y2n(t){return t&&!!(t.destroyed||t[j2n]||jrt.isDestroyed?.(t))}a(Y2n,"isDestroyed");function Kls(t,e){t==null||!Hrt(t)||Y2n(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===Nls&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[j2n]=!0))}a(Kls,"destroy");var Jls=/timeout=(\d+)/;function Zls(t){let e=t.toString().match(Jls);return e?parseInt(e[1],10)*1e3:null}a(Zls,"parseKeepAliveTimeout");function K2n(t){return typeof t=="string"?Uls[t]??t.toLowerCase():H2n.lookup(t)??t.toString("latin1").toLowerCase()}a(K2n,"headerNameToString");function Xls(t){return H2n.lookup(t)??t.toString("latin1").toLowerCase()}a(Xls,"bufferToLowerCasedHeaderName");function eus(t,e){e===void 0&&(e={});for(let r=0;rc.toString("utf8")):s.toString("utf8")}}return"content-length"in e&&"content-disposition"in e&&(e["content-disposition"]=Buffer.from(e["content-disposition"]).toString("latin1")),e}a(eus,"parseHeaders");function tus(t){let e=t.length,r=new Array(e),n=!1,o=-1,s,c,l=0;for(let u=0;u{r.close(),r.byobRequest?.respond(0)});else{let s=Buffer.isBuffer(o)?o:Buffer.from(o);s.byteLength&&r.enqueue(new Uint8Array(s))}return r.desiredSize>0},async cancel(r){await e.return()},type:"bytes"})}a(aus,"ReadableStreamFrom");function cus(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}a(cus,"isFormDataLike");function lus(t,e){return"addEventListener"in t?(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)):(t.addListener("abort",e),()=>t.removeListener("abort",e))}a(lus,"addAbortListener");var uus=typeof String.prototype.toWellFormed=="function",dus=typeof String.prototype.isWellFormed=="function";function Z2n(t){return uus?`${t}`.toWellFormed():Lls.toUSVString(t)}a(Z2n,"toUSVString");function fus(t){return dus?`${t}`.isWellFormed():Z2n(t)===`${t}`}a(fus,"isUSVString");function X2n(t){switch(t){case 34:case 40:case 41:case 44:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 123:case 125:return!1;default:return t>=33&&t<=126}}a(X2n,"isTokenCharCode");function pus(t){if(t.length===0)return!1;for(let e=0;e{"use strict";p();var Fc=require("node:diagnostics_channel"),sXt=require("node:util"),Grt=sXt.debuglog("undici"),oXt=sXt.debuglog("fetch"),QJ=sXt.debuglog("websocket"),nDn=!1,_us={beforeConnect:Fc.channel("undici:client:beforeConnect"),connected:Fc.channel("undici:client:connected"),connectError:Fc.channel("undici:client:connectError"),sendHeaders:Fc.channel("undici:client:sendHeaders"),create:Fc.channel("undici:request:create"),bodySent:Fc.channel("undici:request:bodySent"),headers:Fc.channel("undici:request:headers"),trailers:Fc.channel("undici:request:trailers"),error:Fc.channel("undici:request:error"),open:Fc.channel("undici:websocket:open"),close:Fc.channel("undici:websocket:close"),socketError:Fc.channel("undici:websocket:socket_error"),ping:Fc.channel("undici:websocket:ping"),pong:Fc.channel("undici:websocket:pong")};if(Grt.enabled||oXt.enabled){let t=oXt.enabled?oXt:Grt;Fc.channel("undici:client:beforeConnect").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s using %s%s",`${s}${o?`:${o}`:""}`,n,r)}),Fc.channel("undici:client:connected").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s using %s%s",`${s}${o?`:${o}`:""}`,n,r)}),Fc.channel("undici:client:connectError").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s using %s%s errored - %s",`${s}${o?`:${o}`:""}`,n,r,c.message)}),Fc.channel("undici:client:sendHeaders").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s/%s",r,o,n)}),Fc.channel("undici:request:headers").subscribe(e=>{let{request:{method:r,path:n,origin:o},response:{statusCode:s}}=e;t("received response to %s %s/%s - HTTP %d",r,o,n,s)}),Fc.channel("undici:request:trailers").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s/%s",r,o,n)}),Fc.channel("undici:request:error").subscribe(e=>{let{request:{method:r,path:n,origin:o},error:s}=e;t("request to %s %s/%s errored - %s",r,o,n,s.message)}),nDn=!0}if(QJ.enabled){if(!nDn){let t=Grt.enabled?Grt:QJ;Fc.channel("undici:client:beforeConnect").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),Fc.channel("undici:client:connected").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),Fc.channel("undici:client:connectError").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s%s using %s%s errored - %s",s,o?`:${o}`:"",n,r,c.message)}),Fc.channel("undici:client:sendHeaders").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s/%s",r,o,n)})}Fc.channel("undici:websocket:open").subscribe(t=>{let{address:{address:e,port:r}}=t;QJ("connection opened %s%s",e,r?`:${r}`:"")}),Fc.channel("undici:websocket:close").subscribe(t=>{let{websocket:e,code:r,reason:n}=t;QJ("closed connection to %s - %s %s",e.url,r,n)}),Fc.channel("undici:websocket:socket_error").subscribe(t=>{QJ("connection errored - %s",t.message)}),Fc.channel("undici:websocket:ping").subscribe(t=>{QJ("ping received")}),Fc.channel("undici:websocket:pong").subscribe(t=>{QJ("pong received")})}iDn.exports={channels:_us}});var cDn=I((AZd,aDn)=>{"use strict";p();var{InvalidArgumentError:Su,NotSupportedError:vus}=Ec(),TF=require("node:assert"),{isValidHTTPToken:sDn,isValidHeaderValue:aXt,isStream:Cus,destroy:bus,isBuffer:Sus,isFormDataLike:Tus,isIterable:Ius,isBlobLike:xus,buildURL:wus,validateHandler:Rus,getServerName:kus,normalizedMethodRecords:Pus}=qs(),{channels:c5}=$de(),{headerNameLowerCasedRecord:oDn}=Frt(),Dus=/[^\u0021-\u00ff]/,_w=Symbol("handler"),cXt=class{static{a(this,"Request")}constructor(e,{path:r,method:n,body:o,headers:s,query:c,idempotent:l,blocking:u,upgrade:d,headersTimeout:f,bodyTimeout:h,reset:m,throwOnError:g,expectContinue:A,servername:y},E){if(typeof r!="string")throw new Su("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Su("path must be an absolute URL or start with a slash");if(Dus.test(r))throw new Su("invalid request path");if(typeof n!="string")throw new Su("method must be a string");if(Pus[n]===void 0&&!sDn(n))throw new Su("invalid request method");if(d&&typeof d!="string")throw new Su("upgrade must be a string");if(d&&!aXt(d))throw new Su("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Su("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Su("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Su("invalid reset");if(A!=null&&typeof A!="boolean")throw new Su("invalid expectContinue");if(this.headersTimeout=f,this.bodyTimeout=h,this.throwOnError=g===!0,this.method=n,this.abort=null,o==null)this.body=null;else if(Cus(o)){this.body=o;let _=this.body._readableState;(!_||!_.autoDestroy)&&(this.endHandler=a(function(){bus(this)},"autoDestroy"),this.body.on("end",this.endHandler)),this.errorHandler=v=>{this.abort?this.abort(v):this.error=v},this.body.on("error",this.errorHandler)}else if(Sus(o))this.body=o.byteLength?o:null;else if(ArrayBuffer.isView(o))this.body=o.buffer.byteLength?Buffer.from(o.buffer,o.byteOffset,o.byteLength):null;else if(o instanceof ArrayBuffer)this.body=o.byteLength?Buffer.from(o):null;else if(typeof o=="string")this.body=o.length?Buffer.from(o):null;else if(Tus(o)||Ius(o)||xus(o))this.body=o;else throw new Su("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=d||null,this.path=c?wus(r,c):r,this.origin=e,this.idempotent=l??(n==="HEAD"||n==="GET"),this.blocking=u??!1,this.reset=m??null,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=A??!1,Array.isArray(s)){if(s.length%2!==0)throw new Su("headers array must be even");for(let _=0;_{"use strict";p();var Nus=require("node:events"),Vrt=class extends Nus{static{a(this,"Dispatcher")}dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}compose(...e){let r=Array.isArray(e[0])?e[0]:e,n=this.dispatch.bind(this);for(let o of r)if(o!=null){if(typeof o!="function")throw new TypeError(`invalid interceptor, expected function received ${typeof o}`);if(n=o(n),n==null||typeof n!="function"||n.length!==2)throw new TypeError("invalid interceptor")}return new lXt(this,n)}},lXt=class extends Vrt{static{a(this,"ComposedDispatcher")}#e=null;#t=null;constructor(e,r){super(),this.#e=e,this.#t=r}dispatch(...e){this.#t(...e)}close(...e){return this.#e.close(...e)}destroy(...e){return this.#e.destroy(...e)}};lDn.exports=Vrt});var Yde=I((bZd,uDn)=>{"use strict";p();var Mus=JRe(),{ClientDestroyedError:uXt,ClientClosedError:Ous,InvalidArgumentError:Vde}=Ec(),{kDestroy:Lus,kClose:Bus,kClosed:ZRe,kDestroyed:Wde,kDispatch:dXt,kInterceptors:qJ}=jd(),IF=Symbol("onDestroyed"),zde=Symbol("onClosed"),Wrt=Symbol("Intercepted Dispatch"),fXt=class extends Mus{static{a(this,"DispatcherBase")}constructor(){super(),this[Wde]=!1,this[IF]=null,this[ZRe]=!1,this[zde]=[]}get destroyed(){return this[Wde]}get closed(){return this[ZRe]}get interceptors(){return this[qJ]}set interceptors(e){if(e){for(let r=e.length-1;r>=0;r--)if(typeof this[qJ][r]!="function")throw new Vde("interceptor must be an function")}this[qJ]=e}close(e){if(e===void 0)return new Promise((n,o)=>{this.close((s,c)=>s?o(s):n(c))});if(typeof e!="function")throw new Vde("invalid callback");if(this[Wde]){queueMicrotask(()=>e(new uXt,null));return}if(this[ZRe]){this[zde]?this[zde].push(e):queueMicrotask(()=>e(null,null));return}this[ZRe]=!0,this[zde].push(e);let r=a(()=>{let n=this[zde];this[zde]=null;for(let o=0;othis.destroy()).then(()=>{queueMicrotask(r)})}destroy(e,r){if(typeof e=="function"&&(r=e,e=null),r===void 0)return new Promise((o,s)=>{this.destroy(e,(c,l)=>c?s(c):o(l))});if(typeof r!="function")throw new Vde("invalid callback");if(this[Wde]){this[IF]?this[IF].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new uXt),this[Wde]=!0,this[IF]=this[IF]||[],this[IF].push(r);let n=a(()=>{let o=this[IF];this[IF]=null;for(let s=0;s{queueMicrotask(n)})}[Wrt](e,r){if(!this[qJ]||this[qJ].length===0)return this[Wrt]=this[dXt],this[dXt](e,r);let n=this[dXt].bind(this);for(let o=this[qJ].length-1;o>=0;o--)n=this[qJ][o](n);return this[Wrt]=n,n(e,r)}dispatch(e,r){if(!r||typeof r!="object")throw new Vde("handler must be an object");try{if(!e||typeof e!="object")throw new Vde("opts must be an object.");if(this[Wde]||this[IF])throw new uXt;if(this[ZRe])throw new Ous;return this[Wrt](e,r)}catch(n){if(typeof r.onError!="function")throw new Vde("invalid onError method");return r.onError(n),!1}}};uDn.exports=fXt});var EXt=I((IZd,hDn)=>{"use strict";p();var Kde=0,pXt=1e3,hXt=(pXt>>1)-1,xF,mXt=Symbol("kFastTimer"),wF=[],gXt=-2,AXt=-1,fDn=0,dDn=1;function yXt(){Kde+=hXt;let t=0,e=wF.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=AXt,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===AXt?(r._state=gXt,--e!==0&&(wF[t]=wF[e])):++t}wF.length=e,wF.length!==0&&pDn()}a(yXt,"onTick");function pDn(){xF?xF.refresh():(clearTimeout(xF),xF=setTimeout(yXt,hXt),xF.unref&&xF.unref())}a(pDn,"refreshTimeout");var zrt=class{static{a(this,"FastTimer")}[mXt]=!0;_state=gXt;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===gXt&&wF.push(this),(!xF||wF.length===1)&&pDn(),this._state=fDn}clear(){this._state=AXt,this._idleStart=-1}};hDn.exports={setTimeout(t,e,r){return e<=pXt?setTimeout(t,e,r):new zrt(t,e,r)},clearTimeout(t){t[mXt]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new zrt(t,e,r)},clearFastTimeout(t){t.clear()},now(){return Kde},tick(t=0){Kde+=t-pXt+1,yXt(),yXt()},reset(){Kde=0,wF.length=0,clearTimeout(xF),xF=null},kFastTimer:mXt}});var XRe=I((PZd,EDn)=>{"use strict";p();var Fus=require("node:net"),mDn=require("node:assert"),yDn=qs(),{InvalidArgumentError:Uus,ConnectTimeoutError:Qus}=Ec(),Yrt=EXt();function gDn(){}a(gDn,"noop");var _Xt,vXt;global.FinalizationRegistry&&!(process.env.NODE_V8_COVERAGE||process.env.UNDICI_NO_FG)?vXt=class{static{a(this,"WeakSessionCache")}constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new global.FinalizationRegistry(r=>{if(this._sessionCache.size=this._maxCachedSessions){let{value:n}=this._sessionCache.keys().next();this._sessionCache.delete(n)}this._sessionCache.set(e,r)}}};function qus({allowH2:t,maxCachedSessions:e,socketPath:r,timeout:n,session:o,...s}){if(e!=null&&(!Number.isInteger(e)||e<0))throw new Uus("maxCachedSessions must be a positive integer or zero");let c={path:r,...s},l=new vXt(e??100);return n=n??1e4,t=t??!1,a(function({hostname:d,host:f,protocol:h,port:m,servername:g,localAddress:A,httpSocket:y},E){let _;if(h==="https:"){_Xt||(_Xt=require("node:tls")),g=g||c.servername||yDn.getServerName(f)||null;let b=g||d;mDn(b);let T=o||l.get(b)||null;m=m||443,_=_Xt.connect({highWaterMark:16384,...c,servername:g,session:T,localAddress:A,ALPNProtocols:t?["http/1.1","h2"]:["http/1.1"],socket:y,port:m,host:d}),_.on("session",function(w){l.set(b,w)})}else mDn(!y,"httpSocket can only be sent on TLS update"),m=m||80,_=Fus.connect({highWaterMark:64*1024,...c,localAddress:A,port:m,host:d});if(c.keepAlive==null||c.keepAlive){let b=c.keepAliveInitialDelay===void 0?6e4:c.keepAliveInitialDelay;_.setKeepAlive(!0,b)}let v=jus(new WeakRef(_),{timeout:n,hostname:d,port:m});return _.setNoDelay(!0).once(h==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(v),E){let b=E;E=null,b(null,this)}}).on("error",function(b){if(queueMicrotask(v),E){let T=E;E=null,T(b)}}),_},"connect")}a(qus,"buildConnector");var jus=process.platform==="win32"?(t,e)=>{if(!e.timeout)return gDn;let r=null,n=null,o=Yrt.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>ADn(t.deref(),e))})},e.timeout);return()=>{Yrt.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return gDn;let r=null,n=Yrt.setFastTimeout(()=>{r=setImmediate(()=>{ADn(t.deref(),e)})},e.timeout);return()=>{Yrt.clearFastTimeout(n),clearImmediate(r)}};function ADn(t,e){if(t==null)return;let r="Connect Timeout Error";Array.isArray(t.autoSelectFamilyAttemptedAddresses)?r+=` (attempted addresses: ${t.autoSelectFamilyAttemptedAddresses.join(", ")},`:r+=` (attempted address: ${e.hostname}:${e.port},`,r+=` timeout: ${e.timeout}ms)`,yDn.destroy(t,new Qus(r))}a(ADn,"onConnectTimeout");EDn.exports=qus});var _Dn=I(Krt=>{"use strict";p();Object.defineProperty(Krt,"__esModule",{value:!0});Krt.enumToMap=void 0;function Hus(t){let e={};return Object.keys(t).forEach(r=>{let n=t[r];typeof n=="number"&&(e[r]=n)}),e}a(Hus,"enumToMap");Krt.enumToMap=Hus});var vDn=I(Pr=>{"use strict";p();Object.defineProperty(Pr,"__esModule",{value:!0});Pr.SPECIAL_HEADERS=Pr.HEADER_STATE=Pr.MINOR=Pr.MAJOR=Pr.CONNECTION_TOKEN_CHARS=Pr.HEADER_CHARS=Pr.TOKEN=Pr.STRICT_TOKEN=Pr.HEX=Pr.URL_CHAR=Pr.STRICT_URL_CHAR=Pr.USERINFO_CHARS=Pr.MARK=Pr.ALPHANUM=Pr.NUM=Pr.HEX_MAP=Pr.NUM_MAP=Pr.ALPHA=Pr.FINISH=Pr.H_METHOD_MAP=Pr.METHOD_MAP=Pr.METHODS_RTSP=Pr.METHODS_ICE=Pr.METHODS_HTTP=Pr.METHODS=Pr.LENIENT_FLAGS=Pr.FLAGS=Pr.TYPE=Pr.ERROR=void 0;var Gus=_Dn(),$us;(function(t){t[t.OK=0]="OK",t[t.INTERNAL=1]="INTERNAL",t[t.STRICT=2]="STRICT",t[t.LF_EXPECTED=3]="LF_EXPECTED",t[t.UNEXPECTED_CONTENT_LENGTH=4]="UNEXPECTED_CONTENT_LENGTH",t[t.CLOSED_CONNECTION=5]="CLOSED_CONNECTION",t[t.INVALID_METHOD=6]="INVALID_METHOD",t[t.INVALID_URL=7]="INVALID_URL",t[t.INVALID_CONSTANT=8]="INVALID_CONSTANT",t[t.INVALID_VERSION=9]="INVALID_VERSION",t[t.INVALID_HEADER_TOKEN=10]="INVALID_HEADER_TOKEN",t[t.INVALID_CONTENT_LENGTH=11]="INVALID_CONTENT_LENGTH",t[t.INVALID_CHUNK_SIZE=12]="INVALID_CHUNK_SIZE",t[t.INVALID_STATUS=13]="INVALID_STATUS",t[t.INVALID_EOF_STATE=14]="INVALID_EOF_STATE",t[t.INVALID_TRANSFER_ENCODING=15]="INVALID_TRANSFER_ENCODING",t[t.CB_MESSAGE_BEGIN=16]="CB_MESSAGE_BEGIN",t[t.CB_HEADERS_COMPLETE=17]="CB_HEADERS_COMPLETE",t[t.CB_MESSAGE_COMPLETE=18]="CB_MESSAGE_COMPLETE",t[t.CB_CHUNK_HEADER=19]="CB_CHUNK_HEADER",t[t.CB_CHUNK_COMPLETE=20]="CB_CHUNK_COMPLETE",t[t.PAUSED=21]="PAUSED",t[t.PAUSED_UPGRADE=22]="PAUSED_UPGRADE",t[t.PAUSED_H2_UPGRADE=23]="PAUSED_H2_UPGRADE",t[t.USER=24]="USER"})($us=Pr.ERROR||(Pr.ERROR={}));var Vus;(function(t){t[t.BOTH=0]="BOTH",t[t.REQUEST=1]="REQUEST",t[t.RESPONSE=2]="RESPONSE"})(Vus=Pr.TYPE||(Pr.TYPE={}));var Wus;(function(t){t[t.CONNECTION_KEEP_ALIVE=1]="CONNECTION_KEEP_ALIVE",t[t.CONNECTION_CLOSE=2]="CONNECTION_CLOSE",t[t.CONNECTION_UPGRADE=4]="CONNECTION_UPGRADE",t[t.CHUNKED=8]="CHUNKED",t[t.UPGRADE=16]="UPGRADE",t[t.CONTENT_LENGTH=32]="CONTENT_LENGTH",t[t.SKIPBODY=64]="SKIPBODY",t[t.TRAILING=128]="TRAILING",t[t.TRANSFER_ENCODING=512]="TRANSFER_ENCODING"})(Wus=Pr.FLAGS||(Pr.FLAGS={}));var zus;(function(t){t[t.HEADERS=1]="HEADERS",t[t.CHUNKED_LENGTH=2]="CHUNKED_LENGTH",t[t.KEEP_ALIVE=4]="KEEP_ALIVE"})(zus=Pr.LENIENT_FLAGS||(Pr.LENIENT_FLAGS={}));var Mi;(function(t){t[t.DELETE=0]="DELETE",t[t.GET=1]="GET",t[t.HEAD=2]="HEAD",t[t.POST=3]="POST",t[t.PUT=4]="PUT",t[t.CONNECT=5]="CONNECT",t[t.OPTIONS=6]="OPTIONS",t[t.TRACE=7]="TRACE",t[t.COPY=8]="COPY",t[t.LOCK=9]="LOCK",t[t.MKCOL=10]="MKCOL",t[t.MOVE=11]="MOVE",t[t.PROPFIND=12]="PROPFIND",t[t.PROPPATCH=13]="PROPPATCH",t[t.SEARCH=14]="SEARCH",t[t.UNLOCK=15]="UNLOCK",t[t.BIND=16]="BIND",t[t.REBIND=17]="REBIND",t[t.UNBIND=18]="UNBIND",t[t.ACL=19]="ACL",t[t.REPORT=20]="REPORT",t[t.MKACTIVITY=21]="MKACTIVITY",t[t.CHECKOUT=22]="CHECKOUT",t[t.MERGE=23]="MERGE",t[t["M-SEARCH"]=24]="M-SEARCH",t[t.NOTIFY=25]="NOTIFY",t[t.SUBSCRIBE=26]="SUBSCRIBE",t[t.UNSUBSCRIBE=27]="UNSUBSCRIBE",t[t.PATCH=28]="PATCH",t[t.PURGE=29]="PURGE",t[t.MKCALENDAR=30]="MKCALENDAR",t[t.LINK=31]="LINK",t[t.UNLINK=32]="UNLINK",t[t.SOURCE=33]="SOURCE",t[t.PRI=34]="PRI",t[t.DESCRIBE=35]="DESCRIBE",t[t.ANNOUNCE=36]="ANNOUNCE",t[t.SETUP=37]="SETUP",t[t.PLAY=38]="PLAY",t[t.PAUSE=39]="PAUSE",t[t.TEARDOWN=40]="TEARDOWN",t[t.GET_PARAMETER=41]="GET_PARAMETER",t[t.SET_PARAMETER=42]="SET_PARAMETER",t[t.REDIRECT=43]="REDIRECT",t[t.RECORD=44]="RECORD",t[t.FLUSH=45]="FLUSH"})(Mi=Pr.METHODS||(Pr.METHODS={}));Pr.METHODS_HTTP=[Mi.DELETE,Mi.GET,Mi.HEAD,Mi.POST,Mi.PUT,Mi.CONNECT,Mi.OPTIONS,Mi.TRACE,Mi.COPY,Mi.LOCK,Mi.MKCOL,Mi.MOVE,Mi.PROPFIND,Mi.PROPPATCH,Mi.SEARCH,Mi.UNLOCK,Mi.BIND,Mi.REBIND,Mi.UNBIND,Mi.ACL,Mi.REPORT,Mi.MKACTIVITY,Mi.CHECKOUT,Mi.MERGE,Mi["M-SEARCH"],Mi.NOTIFY,Mi.SUBSCRIBE,Mi.UNSUBSCRIBE,Mi.PATCH,Mi.PURGE,Mi.MKCALENDAR,Mi.LINK,Mi.UNLINK,Mi.PRI,Mi.SOURCE];Pr.METHODS_ICE=[Mi.SOURCE];Pr.METHODS_RTSP=[Mi.OPTIONS,Mi.DESCRIBE,Mi.ANNOUNCE,Mi.SETUP,Mi.PLAY,Mi.PAUSE,Mi.TEARDOWN,Mi.GET_PARAMETER,Mi.SET_PARAMETER,Mi.REDIRECT,Mi.RECORD,Mi.FLUSH,Mi.GET,Mi.POST];Pr.METHOD_MAP=Gus.enumToMap(Mi);Pr.H_METHOD_MAP={};Object.keys(Pr.METHOD_MAP).forEach(t=>{/^H/.test(t)&&(Pr.H_METHOD_MAP[t]=Pr.METHOD_MAP[t])});var Yus;(function(t){t[t.SAFE=0]="SAFE",t[t.SAFE_WITH_CB=1]="SAFE_WITH_CB",t[t.UNSAFE=2]="UNSAFE"})(Yus=Pr.FINISH||(Pr.FINISH={}));Pr.ALPHA=[];for(let t=65;t<=90;t++)Pr.ALPHA.push(String.fromCharCode(t)),Pr.ALPHA.push(String.fromCharCode(t+32));Pr.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};Pr.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};Pr.NUM=["0","1","2","3","4","5","6","7","8","9"];Pr.ALPHANUM=Pr.ALPHA.concat(Pr.NUM);Pr.MARK=["-","_",".","!","~","*","'","(",")"];Pr.USERINFO_CHARS=Pr.ALPHANUM.concat(Pr.MARK).concat(["%",";",":","&","=","+","$",","]);Pr.STRICT_URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(Pr.ALPHANUM);Pr.URL_CHAR=Pr.STRICT_URL_CHAR.concat([" ","\f"]);for(let t=128;t<=255;t++)Pr.URL_CHAR.push(t);Pr.HEX=Pr.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);Pr.STRICT_TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(Pr.ALPHANUM);Pr.TOKEN=Pr.STRICT_TOKEN.concat([" "]);Pr.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&Pr.HEADER_CHARS.push(t);Pr.CONNECTION_TOKEN_CHARS=Pr.HEADER_CHARS.filter(t=>t!==44);Pr.MAJOR=Pr.NUM_MAP;Pr.MINOR=Pr.MAJOR;var Jde;(function(t){t[t.GENERAL=0]="GENERAL",t[t.CONNECTION=1]="CONNECTION",t[t.CONTENT_LENGTH=2]="CONTENT_LENGTH",t[t.TRANSFER_ENCODING=3]="TRANSFER_ENCODING",t[t.UPGRADE=4]="UPGRADE",t[t.CONNECTION_KEEP_ALIVE=5]="CONNECTION_KEEP_ALIVE",t[t.CONNECTION_CLOSE=6]="CONNECTION_CLOSE",t[t.CONNECTION_UPGRADE=7]="CONNECTION_UPGRADE",t[t.TRANSFER_ENCODING_CHUNKED=8]="TRANSFER_ENCODING_CHUNKED"})(Jde=Pr.HEADER_STATE||(Pr.HEADER_STATE={}));Pr.SPECIAL_HEADERS={connection:Jde.CONNECTION,"content-length":Jde.CONTENT_LENGTH,"proxy-connection":Jde.CONNECTION,"transfer-encoding":Jde.TRANSFER_ENCODING,upgrade:Jde.UPGRADE}});var CXt=I((UZd,CDn)=>{"use strict";p();var{Buffer:Kus}=require("node:buffer");CDn.exports=Kus.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK07MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtXACAAQRhqQgA3AwAgAEIANwMAIABBOGpCADcDACAAQTBqQgA3AwAgAEEoakIANwMAIABBIGpCADcDACAAQRBqQgA3AwAgAEEIakIANwMAIABB3QE2AhwLBgAgABAyC5otAQt/IwBBEGsiCiQAQaTQACgCACIJRQRAQeTTACgCACIFRQRAQfDTAEJ/NwIAQejTAEKAgISAgIDAADcCAEHk0wAgCkEIakFwcUHYqtWqBXMiBTYCAEH40wBBADYCAEHI0wBBADYCAAtBzNMAQYDUBDYCAEGc0ABBgNQENgIAQbDQACAFNgIAQazQAEF/NgIAQdDTAEGArAM2AgADQCABQcjQAGogAUG80ABqIgI2AgAgAiABQbTQAGoiAzYCACABQcDQAGogAzYCACABQdDQAGogAUHE0ABqIgM2AgAgAyACNgIAIAFB2NAAaiABQczQAGoiAjYCACACIAM2AgAgAUHU0ABqIAI2AgAgAUEgaiIBQYACRw0AC0GM1ARBwasDNgIAQajQAEH00wAoAgA2AgBBmNAAQcCrAzYCAEGk0ABBiNQENgIAQcz/B0E4NgIAQYjUBCEJCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFNBEBBjNAAKAIAIgZBECAAQRNqQXBxIABBC0kbIgRBA3YiAHYiAUEDcQRAAkAgAUEBcSAAckEBcyICQQN0IgBBtNAAaiIBIABBvNAAaigCACIAKAIIIgNGBEBBjNAAIAZBfiACd3E2AgAMAQsgASADNgIIIAMgATYCDAsgAEEIaiEBIAAgAkEDdCICQQNyNgIEIAAgAmoiACAAKAIEQQFyNgIEDBELQZTQACgCACIIIARPDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxaCIAQQN0IgJBtNAAaiIBIAJBvNAAaigCACICKAIIIgNGBEBBjNAAIAZBfiAAd3EiBjYCAAwBCyABIAM2AgggAyABNgIMCyACIARBA3I2AgQgAEEDdCIAIARrIQUgACACaiAFNgIAIAIgBGoiBCAFQQFyNgIEIAgEQCAIQXhxQbTQAGohAEGg0AAoAgAhAwJ/QQEgCEEDdnQiASAGcUUEQEGM0AAgASAGcjYCACAADAELIAAoAggLIgEgAzYCDCAAIAM2AgggAyAANgIMIAMgATYCCAsgAkEIaiEBQaDQACAENgIAQZTQACAFNgIADBELQZDQACgCACILRQ0BIAtoQQJ0QbzSAGooAgAiACgCBEF4cSAEayEFIAAhAgNAAkAgAigCECIBRQRAIAJBFGooAgAiAUUNAQsgASgCBEF4cSAEayIDIAVJIQIgAyAFIAIbIQUgASAAIAIbIQAgASECDAELCyAAKAIYIQkgACgCDCIDIABHBEBBnNAAKAIAGiADIAAoAggiATYCCCABIAM2AgwMEAsgAEEUaiICKAIAIgFFBEAgACgCECIBRQ0DIABBEGohAgsDQCACIQcgASIDQRRqIgIoAgAiAQ0AIANBEGohAiADKAIQIgENAAsgB0EANgIADA8LQX8hBCAAQb9/Sw0AIABBE2oiAUFwcSEEQZDQACgCACIIRQ0AQQAgBGshBQJAAkACQAJ/QQAgBEGAAkkNABpBHyAEQf///wdLDQAaIARBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmoLIgZBAnRBvNIAaigCACICRQRAQQAhAUEAIQMMAQtBACEBIARBGSAGQQF2a0EAIAZBH0cbdCEAQQAhAwNAAkAgAigCBEF4cSAEayIHIAVPDQAgAiEDIAciBQ0AQQAhBSACIQEMAwsgASACQRRqKAIAIgcgByACIABBHXZBBHFqQRBqKAIAIgJGGyABIAcbIQEgAEEBdCEAIAINAAsLIAEgA3JFBEBBACEDQQIgBnQiAEEAIABrciAIcSIARQ0DIABoQQJ0QbzSAGooAgAhAQsgAUUNAQsDQCABKAIEQXhxIARrIgIgBUkhACACIAUgABshBSABIAMgABshAyABKAIQIgAEfyAABSABQRRqKAIACyIBDQALCyADRQ0AIAVBlNAAKAIAIARrTw0AIAMoAhghByADIAMoAgwiAEcEQEGc0AAoAgAaIAAgAygCCCIBNgIIIAEgADYCDAwOCyADQRRqIgIoAgAiAUUEQCADKAIQIgFFDQMgA0EQaiECCwNAIAIhBiABIgBBFGoiAigCACIBDQAgAEEQaiECIAAoAhAiAQ0ACyAGQQA2AgAMDQtBlNAAKAIAIgMgBE8EQEGg0AAoAgAhAQJAIAMgBGsiAkEQTwRAIAEgBGoiACACQQFyNgIEIAEgA2ogAjYCACABIARBA3I2AgQMAQsgASADQQNyNgIEIAEgA2oiACAAKAIEQQFyNgIEQQAhAEEAIQILQZTQACACNgIAQaDQACAANgIAIAFBCGohAQwPC0GY0AAoAgAiAyAESwRAIAQgCWoiACADIARrIgFBAXI2AgRBpNAAIAA2AgBBmNAAIAE2AgAgCSAEQQNyNgIEIAlBCGohAQwPC0EAIQEgBAJ/QeTTACgCAARAQezTACgCAAwBC0Hw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBDGpBcHFB2KrVqgVzNgIAQfjTAEEANgIAQcjTAEEANgIAQYCABAsiACAEQccAaiIFaiIGQQAgAGsiB3EiAk8EQEH80wBBMDYCAAwPCwJAQcTTACgCACIBRQ0AQbzTACgCACIIIAJqIQAgACABTSAAIAhLcQ0AQQAhAUH80wBBMDYCAAwPC0HI0wAtAABBBHENBAJAAkAgCQRAQczTACEBA0AgASgCACIAIAlNBEAgACABKAIEaiAJSw0DCyABKAIIIgENAAsLQQAQMyIAQX9GDQUgAiEGQejTACgCACIBQQFrIgMgAHEEQCACIABrIAAgA2pBACABa3FqIQYLIAQgBk8NBSAGQf7///8HSw0FQcTTACgCACIDBEBBvNMAKAIAIgcgBmohASABIAdNDQYgASADSw0GCyAGEDMiASAARw0BDAcLIAYgA2sgB3EiBkH+////B0sNBCAGEDMhACAAIAEoAgAgASgCBGpGDQMgACEBCwJAIAYgBEHIAGpPDQAgAUF/Rg0AQezTACgCACIAIAUgBmtqQQAgAGtxIgBB/v///wdLBEAgASEADAcLIAAQM0F/RwRAIAAgBmohBiABIQAMBwtBACAGaxAzGgwECyABIgBBf0cNBQwDC0EAIQMMDAtBACEADAoLIABBf0cNAgtByNMAQcjTACgCAEEEcjYCAAsgAkH+////B0sNASACEDMhAEEAEDMhASAAQX9GDQEgAUF/Rg0BIAAgAU8NASABIABrIgYgBEE4ak0NAQtBvNMAQbzTACgCACAGaiIBNgIAQcDTACgCACABSQRAQcDTACABNgIACwJAAkACQEGk0AAoAgAiAgRAQczTACEBA0AgACABKAIAIgMgASgCBCIFakYNAiABKAIIIgENAAsMAgtBnNAAKAIAIgFBAEcgACABT3FFBEBBnNAAIAA2AgALQQAhAUHQ0wAgBjYCAEHM0wAgADYCAEGs0ABBfzYCAEGw0ABB5NMAKAIANgIAQdjTAEEANgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBeCAAa0EPcSIBIABqIgIgBkE4ayIDIAFrIgFBAXI2AgRBqNAAQfTTACgCADYCAEGY0AAgATYCAEGk0AAgAjYCACAAIANqQTg2AgQMAgsgACACTQ0AIAIgA0kNACABKAIMQQhxDQBBeCACa0EPcSIAIAJqIgNBmNAAKAIAIAZqIgcgAGsiAEEBcjYCBCABIAUgBmo2AgRBqNAAQfTTACgCADYCAEGY0AAgADYCAEGk0AAgAzYCACACIAdqQTg2AgQMAQsgAEGc0AAoAgBJBEBBnNAAIAA2AgALIAAgBmohA0HM0wAhAQJAAkACQANAIAMgASgCAEcEQCABKAIIIgENAQwCCwsgAS0ADEEIcUUNAQtBzNMAIQEDQCABKAIAIgMgAk0EQCADIAEoAgRqIgUgAksNAwsgASgCCCEBDAALAAsgASAANgIAIAEgASgCBCAGajYCBCAAQXggAGtBD3FqIgkgBEEDcjYCBCADQXggA2tBD3FqIgYgBCAJaiIEayEBIAIgBkYEQEGk0AAgBDYCAEGY0ABBmNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEDAgLQaDQACgCACAGRgRAQaDQACAENgIAQZTQAEGU0AAoAgAgAWoiADYCACAEIABBAXI2AgQgACAEaiAANgIADAgLIAYoAgQiBUEDcUEBRw0GIAVBeHEhCCAFQf8BTQRAIAVBA3YhAyAGKAIIIgAgBigCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBwsgAiAANgIIIAAgAjYCDAwGCyAGKAIYIQcgBiAGKAIMIgBHBEAgACAGKAIIIgI2AgggAiAANgIMDAULIAZBFGoiAigCACIFRQRAIAYoAhAiBUUNBCAGQRBqIQILA0AgAiEDIAUiAEEUaiICKAIAIgUNACAAQRBqIQIgACgCECIFDQALIANBADYCAAwEC0F4IABrQQ9xIgEgAGoiByAGQThrIgMgAWsiAUEBcjYCBCAAIANqQTg2AgQgAiAFQTcgBWtBD3FqQT9rIgMgAyACQRBqSRsiA0EjNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAc2AgAgA0EQakHU0wApAgA3AgAgA0HM0wApAgA3AghB1NMAIANBCGo2AgBB0NMAIAY2AgBBzNMAIAA2AgBB2NMAQQA2AgAgA0EkaiEBA0AgAUEHNgIAIAUgAUEEaiIBSw0ACyACIANGDQAgAyADKAIEQX5xNgIEIAMgAyACayIFNgIAIAIgBUEBcjYCBCAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIDcUUEQEGM0AAgASADcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEGQ0AAoAgAiA0EBIAF0IgZxRQRAIAAgAjYCAEGQ0AAgAyAGcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQMCQANAIAMiACgCBEF4cSAFRg0BIAFBHXYhAyABQQF0IQEgACADQQRxakEQaiIGKAIAIgMNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAtBmNAAKAIAIgEgBE0NAEGk0AAoAgAiACAEaiICIAEgBGsiAUEBcjYCBEGY0AAgATYCAEGk0AAgAjYCACAAIARBA3I2AgQgAEEIaiEBDAgLQQAhAUH80wBBMDYCAAwHC0EAIQALIAdFDQACQCAGKAIcIgJBAnRBvNIAaiIDKAIAIAZGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAdBEEEUIAcoAhAgBkYbaiAANgIAIABFDQELIAAgBzYCGCAGKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAGQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAIaiEBIAYgCGoiBigCBCEFCyAGIAVBfnE2AgQgASAEaiABNgIAIAQgAUEBcjYCBCABQf8BTQRAIAFBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASABQQN2dCIBcUUEQEGM0AAgASACcjYCACAADAELIAAoAggLIgEgBDYCDCAAIAQ2AgggBCAANgIMIAQgATYCCAwBC0EfIQUgAUH///8HTQRAIAFBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohBQsgBCAFNgIcIARCADcCECAFQQJ0QbzSAGohAEGQ0AAoAgAiAkEBIAV0IgNxRQRAIAAgBDYCAEGQ0AAgAiADcjYCACAEIAA2AhggBCAENgIIIAQgBDYCDAwBCyABQRkgBUEBdmtBACAFQR9HG3QhBSAAKAIAIQACQANAIAAiAigCBEF4cSABRg0BIAVBHXYhACAFQQF0IQUgAiAAQQRxakEQaiIDKAIAIgANAAsgAyAENgIAIAQgAjYCGCAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgCUEIaiEBDAILAkAgB0UNAAJAIAMoAhwiAUECdEG80gBqIgIoAgAgA0YEQCACIAA2AgAgAA0BQZDQACAIQX4gAXdxIgg2AgAMAgsgB0EQQRQgBygCECADRhtqIAA2AgAgAEUNAQsgACAHNgIYIAMoAhAiAQRAIAAgATYCECABIAA2AhgLIANBFGooAgAiAUUNACAAQRRqIAE2AgAgASAANgIYCwJAIAVBD00EQCADIAQgBWoiAEEDcjYCBCAAIANqIgAgACgCBEEBcjYCBAwBCyADIARqIgIgBUEBcjYCBCADIARBA3I2AgQgAiAFaiAFNgIAIAVB/wFNBEAgBUF4cUG00ABqIQACf0GM0AAoAgAiAUEBIAVBA3Z0IgVxRQRAQYzQACABIAVyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRBvNIAaiEAQQEgAXQiBCAIcUUEQCAAIAI2AgBBkNAAIAQgCHI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEEAkADQCAEIgAoAgRBeHEgBUYNASABQR12IQQgAUEBdCEBIAAgBEEEcWpBEGoiBigCACIEDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLIANBCGohAQwBCwJAIAlFDQACQCAAKAIcIgFBAnRBvNIAaiICKAIAIABGBEAgAiADNgIAIAMNAUGQ0AAgC0F+IAF3cTYCAAwCCyAJQRBBFCAJKAIQIABGG2ogAzYCACADRQ0BCyADIAk2AhggACgCECIBBEAgAyABNgIQIAEgAzYCGAsgAEEUaigCACIBRQ0AIANBFGogATYCACABIAM2AhgLAkAgBUEPTQRAIAAgBCAFaiIBQQNyNgIEIAAgAWoiASABKAIEQQFyNgIEDAELIAAgBGoiByAFQQFyNgIEIAAgBEEDcjYCBCAFIAdqIAU2AgAgCARAIAhBeHFBtNAAaiEBQaDQACgCACEDAn9BASAIQQN2dCICIAZxRQRAQYzQACACIAZyNgIAIAEMAQsgASgCCAsiAiADNgIMIAEgAzYCCCADIAE2AgwgAyACNgIIC0Gg0AAgBzYCAEGU0AAgBTYCAAsgAEEIaiEBCyAKQRBqJAAgAQtDACAARQRAPwBBEHQPCwJAIABB//8DcQ0AIABBAEgNACAAQRB2QAAiAEF/RgRAQfzTAEEwNgIAQX8PCyAAQRB0DwsACwvcPyIAQYAICwkBAAAAAgAAAAMAQZQICwUEAAAABQBBpAgLCQYAAAAHAAAACABB3AgLii1JbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AFJlc3BvbnNlIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zAFVzZXIgY2FsbGJhY2sgZXJyb3IAYG9uX3Jlc2V0YCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfaGVhZGVyYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9iZWdpbmAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3N0YXR1c19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3ZlcnNpb25fY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl91cmxfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXRob2RfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfZmllbGRfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fbmFtZWAgY2FsbGJhY2sgZXJyb3IAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzZXJ2ZXIASW52YWxpZCBoZWFkZXIgdmFsdWUgY2hhcgBJbnZhbGlkIGhlYWRlciBmaWVsZCBjaGFyAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdmVyc2lvbgBJbnZhbGlkIG1pbm9yIHZlcnNpb24ASW52YWxpZCBtYWpvciB2ZXJzaW9uAEV4cGVjdGVkIHNwYWNlIGFmdGVyIHZlcnNpb24ARXhwZWN0ZWQgQ1JMRiBhZnRlciB2ZXJzaW9uAEludmFsaWQgSFRUUCB2ZXJzaW9uAEludmFsaWQgaGVhZGVyIHRva2VuAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdXJsAEludmFsaWQgY2hhcmFjdGVycyBpbiB1cmwAVW5leHBlY3RlZCBzdGFydCBjaGFyIGluIHVybABEb3VibGUgQCBpbiB1cmwARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgARHVwbGljYXRlIENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhciBpbiB1cmwgcGF0aABDb250ZW50LUxlbmd0aCBjYW4ndCBiZSBwcmVzZW50IHdpdGggVHJhbnNmZXItRW5jb2RpbmcASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgc2l6ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl92YWx1ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlZCB2YWx1ZQBQYXVzZWQgYnkgb25faGVhZGVyc19jb21wbGV0ZQBJbnZhbGlkIEVPRiBzdGF0ZQBvbl9yZXNldCBwYXVzZQBvbl9jaHVua19oZWFkZXIgcGF1c2UAb25fbWVzc2FnZV9iZWdpbiBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fdmFsdWUgcGF1c2UAb25fc3RhdHVzX2NvbXBsZXRlIHBhdXNlAG9uX3ZlcnNpb25fY29tcGxldGUgcGF1c2UAb25fdXJsX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXNzYWdlX2NvbXBsZXRlIHBhdXNlAG9uX21ldGhvZF9jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfZmllbGRfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUgcGF1c2UAVW5leHBlY3RlZCBzcGFjZSBhZnRlciBzdGFydCBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAFBhdXNlIG9uIENPTk5FQ1QvVXBncmFkZQBQYXVzZSBvbiBQUkkvVXBncmFkZQBFeHBlY3RlZCBIVFRQLzIgQ29ubmVjdGlvbiBQcmVmYWNlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fbWV0aG9kAEV4cGVjdGVkIHNwYWNlIGFmdGVyIG1ldGhvZABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl9maWVsZABQYXVzZWQASW52YWxpZCB3b3JkIGVuY291bnRlcmVkAEludmFsaWQgbWV0aG9kIGVuY291bnRlcmVkAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2NoZW1hAFJlcXVlc3QgaGFzIGludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYABTV0lUQ0hfUFJPWFkAVVNFX1BST1hZAE1LQUNUSVZJVFkAVU5QUk9DRVNTQUJMRV9FTlRJVFkAQ09QWQBNT1ZFRF9QRVJNQU5FTlRMWQBUT09fRUFSTFkATk9USUZZAEZBSUxFRF9ERVBFTkRFTkNZAEJBRF9HQVRFV0FZAFBMQVkAUFVUAENIRUNLT1VUAEdBVEVXQVlfVElNRU9VVABSRVFVRVNUX1RJTUVPVVQATkVUV09SS19DT05ORUNUX1RJTUVPVVQAQ09OTkVDVElPTl9USU1FT1VUAExPR0lOX1RJTUVPVVQATkVUV09SS19SRUFEX1RJTUVPVVQAUE9TVABNSVNESVJFQ1RFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX0xPQURfQkFMQU5DRURfUkVRVUVTVABCQURfUkVRVUVTVABIVFRQX1JFUVVFU1RfU0VOVF9UT19IVFRQU19QT1JUAFJFUE9SVABJTV9BX1RFQVBPVABSRVNFVF9DT05URU5UAE5PX0NPTlRFTlQAUEFSVElBTF9DT05URU5UAEhQRV9JTlZBTElEX0NPTlNUQU5UAEhQRV9DQl9SRVNFVABHRVQASFBFX1NUUklDVABDT05GTElDVABURU1QT1JBUllfUkVESVJFQ1QAUEVSTUFORU5UX1JFRElSRUNUAENPTk5FQ1QATVVMVElfU1RBVFVTAEhQRV9JTlZBTElEX1NUQVRVUwBUT09fTUFOWV9SRVFVRVNUUwBFQVJMWV9ISU5UUwBVTkFWQUlMQUJMRV9GT1JfTEVHQUxfUkVBU09OUwBPUFRJT05TAFNXSVRDSElOR19QUk9UT0NPTFMAVkFSSUFOVF9BTFNPX05FR09USUFURVMATVVMVElQTEVfQ0hPSUNFUwBJTlRFUk5BTF9TRVJWRVJfRVJST1IAV0VCX1NFUlZFUl9VTktOT1dOX0VSUk9SAFJBSUxHVU5fRVJST1IASURFTlRJVFlfUFJPVklERVJfQVVUSEVOVElDQVRJT05fRVJST1IAU1NMX0NFUlRJRklDQVRFX0VSUk9SAElOVkFMSURfWF9GT1JXQVJERURfRk9SAFNFVF9QQVJBTUVURVIAR0VUX1BBUkFNRVRFUgBIUEVfVVNFUgBTRUVfT1RIRVIASFBFX0NCX0NIVU5LX0hFQURFUgBNS0NBTEVOREFSAFNFVFVQAFdFQl9TRVJWRVJfSVNfRE9XTgBURUFSRE9XTgBIUEVfQ0xPU0VEX0NPTk5FQ1RJT04ASEVVUklTVElDX0VYUElSQVRJT04ARElTQ09OTkVDVEVEX09QRVJBVElPTgBOT05fQVVUSE9SSVRBVElWRV9JTkZPUk1BVElPTgBIUEVfSU5WQUxJRF9WRVJTSU9OAEhQRV9DQl9NRVNTQUdFX0JFR0lOAFNJVEVfSVNfRlJPWkVOAEhQRV9JTlZBTElEX0hFQURFUl9UT0tFTgBJTlZBTElEX1RPS0VOAEZPUkJJRERFTgBFTkhBTkNFX1lPVVJfQ0FMTQBIUEVfSU5WQUxJRF9VUkwAQkxPQ0tFRF9CWV9QQVJFTlRBTF9DT05UUk9MAE1LQ09MAEFDTABIUEVfSU5URVJOQUwAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRV9VTk9GRklDSUFMAEhQRV9PSwBVTkxJTksAVU5MT0NLAFBSSQBSRVRSWV9XSVRIAEhQRV9JTlZBTElEX0NPTlRFTlRfTEVOR1RIAEhQRV9VTkVYUEVDVEVEX0NPTlRFTlRfTEVOR1RIAEZMVVNIAFBST1BQQVRDSABNLVNFQVJDSABVUklfVE9PX0xPTkcAUFJPQ0VTU0lORwBNSVNDRUxMQU5FT1VTX1BFUlNJU1RFTlRfV0FSTklORwBNSVNDRUxMQU5FT1VTX1dBUk5JTkcASFBFX0lOVkFMSURfVFJBTlNGRVJfRU5DT0RJTkcARXhwZWN0ZWQgQ1JMRgBIUEVfSU5WQUxJRF9DSFVOS19TSVpFAE1PVkUAQ09OVElOVUUASFBFX0NCX1NUQVRVU19DT01QTEVURQBIUEVfQ0JfSEVBREVSU19DT01QTEVURQBIUEVfQ0JfVkVSU0lPTl9DT01QTEVURQBIUEVfQ0JfVVJMX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8AAF4TAAAmEwAAMBAAAPAXAACdEwAAFRIAADkXAADwEgAAChAAAHUSAACtEgAAghMAAE8UAAB/EAAAoBUAACMUAACJEgAAixQAAE0VAADUEQAAzxQAABAYAADJFgAA3BYAAMERAADgFwAAuxQAAHQUAAB8FQAA5RQAAAgXAAAfEAAAZRUAAKMUAAAoFQAAAhUAAJkVAAAsEAAAixkAAE8PAADUDgAAahAAAM4QAAACFwAAiQ4AAG4TAAAcEwAAZhQAAFYXAADBEwAAzRMAAGwTAABoFwAAZhcAAF8XAAAiEwAAzg8AAGkOAADYDgAAYxYAAMsTAACqDgAAKBcAACYXAADFEwAAXRYAAOgRAABnEwAAZRMAAPIWAABzEwAAHRcAAPkWAADzEQAAzw4AAM4VAAAMEgAAsxEAAKURAABhEAAAMhcAALsTAEH5NQsBAQBBkDYL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB/TcLAQEAQZE4C14CAwICAgICAAACAgACAgACAgICAgICAgICAAQAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEH9OQsBAQBBkToLXgIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAQfA7Cw1sb3NlZWVwLWFsaXZlAEGJPAsBAQBBoDwL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBiT4LAQEAQaA+C+cBAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAEGwwAALXwEBAAEBAQEBAAABAQABAQABAQEBAQEBAQEBAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAEGQwgALIWVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgBBwMIACy1yYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AQfnCAAsFAQIAAQMAQZDDAAvgAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH5xAALBQECAAEDAEGQxQAL4AEEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cYACwQBAAABAEGRxwAL3wEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH6yAALBAEAAAIAQZDJAAtfAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv","base64")});var SDn=I((qZd,bDn)=>{"use strict";p();var{Buffer:Jus}=require("node:buffer");bDn.exports=Jus.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK77MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtzACAAQRBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAA/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQTBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQSBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQd0BNgIcCwYAIAAQMguaLQELfyMAQRBrIgokAEGk0AAoAgAiCUUEQEHk0wAoAgAiBUUEQEHw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBCGpBcHFB2KrVqgVzIgU2AgBB+NMAQQA2AgBByNMAQQA2AgALQczTAEGA1AQ2AgBBnNAAQYDUBDYCAEGw0AAgBTYCAEGs0ABBfzYCAEHQ0wBBgKwDNgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBjNQEQcGrAzYCAEGo0ABB9NMAKAIANgIAQZjQAEHAqwM2AgBBpNAAQYjUBDYCAEHM/wdBODYCAEGI1AQhCQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQewBTQRAQYzQACgCACIGQRAgAEETakFwcSAAQQtJGyIEQQN2IgB2IgFBA3EEQAJAIAFBAXEgAHJBAXMiAkEDdCIAQbTQAGoiASAAQbzQAGooAgAiACgCCCIDRgRAQYzQACAGQX4gAndxNgIADAELIAEgAzYCCCADIAE2AgwLIABBCGohASAAIAJBA3QiAkEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwRC0GU0AAoAgAiCCAETw0BIAEEQAJAQQIgAHQiAkEAIAJrciABIAB0cWgiAEEDdCICQbTQAGoiASACQbzQAGooAgAiAigCCCIDRgRAQYzQACAGQX4gAHdxIgY2AgAMAQsgASADNgIIIAMgATYCDAsgAiAEQQNyNgIEIABBA3QiACAEayEFIAAgAmogBTYCACACIARqIgQgBUEBcjYCBCAIBEAgCEF4cUG00ABqIQBBoNAAKAIAIQMCf0EBIAhBA3Z0IgEgBnFFBEBBjNAAIAEgBnI2AgAgAAwBCyAAKAIICyIBIAM2AgwgACADNgIIIAMgADYCDCADIAE2AggLIAJBCGohAUGg0AAgBDYCAEGU0AAgBTYCAAwRC0GQ0AAoAgAiC0UNASALaEECdEG80gBqKAIAIgAoAgRBeHEgBGshBSAAIQIDQAJAIAIoAhAiAUUEQCACQRRqKAIAIgFFDQELIAEoAgRBeHEgBGsiAyAFSSECIAMgBSACGyEFIAEgACACGyEAIAEhAgwBCwsgACgCGCEJIAAoAgwiAyAARwRAQZzQACgCABogAyAAKAIIIgE2AgggASADNgIMDBALIABBFGoiAigCACIBRQRAIAAoAhAiAUUNAyAAQRBqIQILA0AgAiEHIAEiA0EUaiICKAIAIgENACADQRBqIQIgAygCECIBDQALIAdBADYCAAwPC0F/IQQgAEG/f0sNACAAQRNqIgFBcHEhBEGQ0AAoAgAiCEUNAEEAIARrIQUCQAJAAkACf0EAIARBgAJJDQAaQR8gBEH///8HSw0AGiAEQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qCyIGQQJ0QbzSAGooAgAiAkUEQEEAIQFBACEDDAELQQAhASAEQRkgBkEBdmtBACAGQR9HG3QhAEEAIQMDQAJAIAIoAgRBeHEgBGsiByAFTw0AIAIhAyAHIgUNAEEAIQUgAiEBDAMLIAEgAkEUaigCACIHIAcgAiAAQR12QQRxakEQaigCACICRhsgASAHGyEBIABBAXQhACACDQALCyABIANyRQRAQQAhA0ECIAZ0IgBBACAAa3IgCHEiAEUNAyAAaEECdEG80gBqKAIAIQELIAFFDQELA0AgASgCBEF4cSAEayICIAVJIQAgAiAFIAAbIQUgASADIAAbIQMgASgCECIABH8gAAUgAUEUaigCAAsiAQ0ACwsgA0UNACAFQZTQACgCACAEa08NACADKAIYIQcgAyADKAIMIgBHBEBBnNAAKAIAGiAAIAMoAggiATYCCCABIAA2AgwMDgsgA0EUaiICKAIAIgFFBEAgAygCECIBRQ0DIANBEGohAgsDQCACIQYgASIAQRRqIgIoAgAiAQ0AIABBEGohAiAAKAIQIgENAAsgBkEANgIADA0LQZTQACgCACIDIARPBEBBoNAAKAIAIQECQCADIARrIgJBEE8EQCABIARqIgAgAkEBcjYCBCABIANqIAI2AgAgASAEQQNyNgIEDAELIAEgA0EDcjYCBCABIANqIgAgACgCBEEBcjYCBEEAIQBBACECC0GU0AAgAjYCAEGg0AAgADYCACABQQhqIQEMDwtBmNAAKAIAIgMgBEsEQCAEIAlqIgAgAyAEayIBQQFyNgIEQaTQACAANgIAQZjQACABNgIAIAkgBEEDcjYCBCAJQQhqIQEMDwtBACEBIAQCf0Hk0wAoAgAEQEHs0wAoAgAMAQtB8NMAQn83AgBB6NMAQoCAhICAgMAANwIAQeTTACAKQQxqQXBxQdiq1aoFczYCAEH40wBBADYCAEHI0wBBADYCAEGAgAQLIgAgBEHHAGoiBWoiBkEAIABrIgdxIgJPBEBB/NMAQTA2AgAMDwsCQEHE0wAoAgAiAUUNAEG80wAoAgAiCCACaiEAIAAgAU0gACAIS3ENAEEAIQFB/NMAQTA2AgAMDwtByNMALQAAQQRxDQQCQAJAIAkEQEHM0wAhAQNAIAEoAgAiACAJTQRAIAAgASgCBGogCUsNAwsgASgCCCIBDQALC0EAEDMiAEF/Rg0FIAIhBkHo0wAoAgAiAUEBayIDIABxBEAgAiAAayAAIANqQQAgAWtxaiEGCyAEIAZPDQUgBkH+////B0sNBUHE0wAoAgAiAwRAQbzTACgCACIHIAZqIQEgASAHTQ0GIAEgA0sNBgsgBhAzIgEgAEcNAQwHCyAGIANrIAdxIgZB/v///wdLDQQgBhAzIQAgACABKAIAIAEoAgRqRg0DIAAhAQsCQCAGIARByABqTw0AIAFBf0YNAEHs0wAoAgAiACAFIAZrakEAIABrcSIAQf7///8HSwRAIAEhAAwHCyAAEDNBf0cEQCAAIAZqIQYgASEADAcLQQAgBmsQMxoMBAsgASIAQX9HDQUMAwtBACEDDAwLQQAhAAwKCyAAQX9HDQILQcjTAEHI0wAoAgBBBHI2AgALIAJB/v///wdLDQEgAhAzIQBBABAzIQEgAEF/Rg0BIAFBf0YNASAAIAFPDQEgASAAayIGIARBOGpNDQELQbzTAEG80wAoAgAgBmoiATYCAEHA0wAoAgAgAUkEQEHA0wAgATYCAAsCQAJAAkBBpNAAKAIAIgIEQEHM0wAhAQNAIAAgASgCACIDIAEoAgQiBWpGDQIgASgCCCIBDQALDAILQZzQACgCACIBQQBHIAAgAU9xRQRAQZzQACAANgIAC0EAIQFB0NMAIAY2AgBBzNMAIAA2AgBBrNAAQX82AgBBsNAAQeTTACgCADYCAEHY0wBBADYCAANAIAFByNAAaiABQbzQAGoiAjYCACACIAFBtNAAaiIDNgIAIAFBwNAAaiADNgIAIAFB0NAAaiABQcTQAGoiAzYCACADIAI2AgAgAUHY0ABqIAFBzNAAaiICNgIAIAIgAzYCACABQdTQAGogAjYCACABQSBqIgFBgAJHDQALQXggAGtBD3EiASAAaiICIAZBOGsiAyABayIBQQFyNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAI2AgAgACADakE4NgIEDAILIAAgAk0NACACIANJDQAgASgCDEEIcQ0AQXggAmtBD3EiACACaiIDQZjQACgCACAGaiIHIABrIgBBAXI2AgQgASAFIAZqNgIEQajQAEH00wAoAgA2AgBBmNAAIAA2AgBBpNAAIAM2AgAgAiAHakE4NgIEDAELIABBnNAAKAIASQRAQZzQACAANgIACyAAIAZqIQNBzNMAIQECQAJAAkADQCADIAEoAgBHBEAgASgCCCIBDQEMAgsLIAEtAAxBCHFFDQELQczTACEBA0AgASgCACIDIAJNBEAgAyABKAIEaiIFIAJLDQMLIAEoAgghAQwACwALIAEgADYCACABIAEoAgQgBmo2AgQgAEF4IABrQQ9xaiIJIARBA3I2AgQgA0F4IANrQQ9xaiIGIAQgCWoiBGshASACIAZGBEBBpNAAIAQ2AgBBmNAAQZjQACgCACABaiIANgIAIAQgAEEBcjYCBAwIC0Gg0AAoAgAgBkYEQEGg0AAgBDYCAEGU0ABBlNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEIAAgBGogADYCAAwICyAGKAIEIgVBA3FBAUcNBiAFQXhxIQggBUH/AU0EQCAFQQN2IQMgBigCCCIAIAYoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAcLIAIgADYCCCAAIAI2AgwMBgsgBigCGCEHIAYgBigCDCIARwRAIAAgBigCCCICNgIIIAIgADYCDAwFCyAGQRRqIgIoAgAiBUUEQCAGKAIQIgVFDQQgBkEQaiECCwNAIAIhAyAFIgBBFGoiAigCACIFDQAgAEEQaiECIAAoAhAiBQ0ACyADQQA2AgAMBAtBeCAAa0EPcSIBIABqIgcgBkE4ayIDIAFrIgFBAXI2AgQgACADakE4NgIEIAIgBUE3IAVrQQ9xakE/ayIDIAMgAkEQakkbIgNBIzYCBEGo0ABB9NMAKAIANgIAQZjQACABNgIAQaTQACAHNgIAIANBEGpB1NMAKQIANwIAIANBzNMAKQIANwIIQdTTACADQQhqNgIAQdDTACAGNgIAQczTACAANgIAQdjTAEEANgIAIANBJGohAQNAIAFBBzYCACAFIAFBBGoiAUsNAAsgAiADRg0AIAMgAygCBEF+cTYCBCADIAMgAmsiBTYCACACIAVBAXI2AgQgBUH/AU0EQCAFQXhxQbTQAGohAAJ/QYzQACgCACIBQQEgBUEDdnQiA3FFBEBBjNAAIAEgA3I2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEG80gBqIQBBkNAAKAIAIgNBASABdCIGcUUEQCAAIAI2AgBBkNAAIAMgBnI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEDAkADQCADIgAoAgRBeHEgBUYNASABQR12IQMgAUEBdCEBIAAgA0EEcWpBEGoiBigCACIDDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLQZjQACgCACIBIARNDQBBpNAAKAIAIgAgBGoiAiABIARrIgFBAXI2AgRBmNAAIAE2AgBBpNAAIAI2AgAgACAEQQNyNgIEIABBCGohAQwIC0EAIQFB/NMAQTA2AgAMBwtBACEACyAHRQ0AAkAgBigCHCICQQJ0QbzSAGoiAygCACAGRgRAIAMgADYCACAADQFBkNAAQZDQACgCAEF+IAJ3cTYCAAwCCyAHQRBBFCAHKAIQIAZGG2ogADYCACAARQ0BCyAAIAc2AhggBigCECICBEAgACACNgIQIAIgADYCGAsgBkEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgCGohASAGIAhqIgYoAgQhBQsgBiAFQX5xNgIEIAEgBGogATYCACAEIAFBAXI2AgQgAUH/AU0EQCABQXhxQbTQAGohAAJ/QYzQACgCACICQQEgAUEDdnQiAXFFBEBBjNAAIAEgAnI2AgAgAAwBCyAAKAIICyIBIAQ2AgwgACAENgIIIAQgADYCDCAEIAE2AggMAQtBHyEFIAFB////B00EQCABQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qIQULIAQgBTYCHCAEQgA3AhAgBUECdEG80gBqIQBBkNAAKAIAIgJBASAFdCIDcUUEQCAAIAQ2AgBBkNAAIAIgA3I2AgAgBCAANgIYIAQgBDYCCCAEIAQ2AgwMAQsgAUEZIAVBAXZrQQAgBUEfRxt0IQUgACgCACEAAkADQCAAIgIoAgRBeHEgAUYNASAFQR12IQAgBUEBdCEFIAIgAEEEcWpBEGoiAygCACIADQALIAMgBDYCACAEIAI2AhggBCAENgIMIAQgBDYCCAwBCyACKAIIIgAgBDYCDCACIAQ2AgggBEEANgIYIAQgAjYCDCAEIAA2AggLIAlBCGohAQwCCwJAIAdFDQACQCADKAIcIgFBAnRBvNIAaiICKAIAIANGBEAgAiAANgIAIAANAUGQ0AAgCEF+IAF3cSIINgIADAILIAdBEEEUIAcoAhAgA0YbaiAANgIAIABFDQELIAAgBzYCGCADKAIQIgEEQCAAIAE2AhAgASAANgIYCyADQRRqKAIAIgFFDQAgAEEUaiABNgIAIAEgADYCGAsCQCAFQQ9NBEAgAyAEIAVqIgBBA3I2AgQgACADaiIAIAAoAgRBAXI2AgQMAQsgAyAEaiICIAVBAXI2AgQgAyAEQQNyNgIEIAIgBWogBTYCACAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIFcUUEQEGM0AAgASAFcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEEBIAF0IgQgCHFFBEAgACACNgIAQZDQACAEIAhyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhBAJAA0AgBCIAKAIEQXhxIAVGDQEgAUEddiEEIAFBAXQhASAAIARBBHFqQRBqIgYoAgAiBA0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIICyADQQhqIQEMAQsCQCAJRQ0AAkAgACgCHCIBQQJ0QbzSAGoiAigCACAARgRAIAIgAzYCACADDQFBkNAAIAtBfiABd3E2AgAMAgsgCUEQQRQgCSgCECAARhtqIAM2AgAgA0UNAQsgAyAJNgIYIAAoAhAiAQRAIAMgATYCECABIAM2AhgLIABBFGooAgAiAUUNACADQRRqIAE2AgAgASADNgIYCwJAIAVBD00EQCAAIAQgBWoiAUEDcjYCBCAAIAFqIgEgASgCBEEBcjYCBAwBCyAAIARqIgcgBUEBcjYCBCAAIARBA3I2AgQgBSAHaiAFNgIAIAgEQCAIQXhxQbTQAGohAUGg0AAoAgAhAwJ/QQEgCEEDdnQiAiAGcUUEQEGM0AAgAiAGcjYCACABDAELIAEoAggLIgIgAzYCDCABIAM2AgggAyABNgIMIAMgAjYCCAtBoNAAIAc2AgBBlNAAIAU2AgALIABBCGohAQsgCkEQaiQAIAELQwAgAEUEQD8AQRB0DwsCQCAAQf//A3ENACAAQQBIDQAgAEEQdkAAIgBBf0YEQEH80wBBMDYCAEF/DwsgAEEQdA8LAAsL3D8iAEGACAsJAQAAAAIAAAADAEGUCAsFBAAAAAUAQaQICwkGAAAABwAAAAgAQdwIC4otSW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwBB+TULAQEAQZA2C+ABAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQf03CwEBAEGROAteAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgBB/TkLAQEAQZE6C14CAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEHwOwsNbG9zZWVlcC1hbGl2ZQBBiTwLAQEAQaA8C+ABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQYk+CwEBAEGgPgvnAQEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZABBsMAAC18BAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBBkMIACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQcDCAAstcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQoNClNNDQoNClRUUC9DRS9UU1AvAEH5wgALBQECAAEDAEGQwwAL4AEEAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cQACwUBAgABAwBBkMUAC+ABBAEBBQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQfnGAAsEAQAAAQBBkccAC98BAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+sgACwQBAAACAEGQyQALXwMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==","base64")});var eke=I((HZd,DDn)=>{"use strict";p();var TDn=["GET","HEAD","POST"],Zus=new Set(TDn),Xus=[101,204,205,304],IDn=[301,302,303,307,308],eds=new Set(IDn),xDn=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"],tds=new Set(xDn),wDn=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],rds=new Set(wDn),nds=["follow","manual","error"],RDn=["GET","HEAD","OPTIONS","TRACE"],ids=new Set(RDn),ods=["navigate","same-origin","no-cors","cors"],sds=["omit","same-origin","include"],ads=["default","no-store","reload","no-cache","force-cache","only-if-cached"],cds=["content-encoding","content-language","content-location","content-type","content-length"],lds=["half"],kDn=["CONNECT","TRACE","TRACK"],uds=new Set(kDn),PDn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],dds=new Set(PDn);DDn.exports={subresource:PDn,forbiddenMethods:kDn,requestBodyHeader:cds,referrerPolicy:wDn,requestRedirect:nds,requestMode:ods,requestCredentials:sds,requestCache:ads,redirectStatus:IDn,corsSafeListedMethods:TDn,nullBodyStatus:Xus,safeMethods:RDn,badPorts:xDn,requestDuplex:lds,subresourceSet:dds,badPortsSet:tds,redirectStatusSet:eds,corsSafeListedMethodsSet:Zus,safeMethodsSet:ids,forbiddenMethodsSet:uds,referrerPolicySet:rds}});var SXt=I(($Zd,NDn)=>{"use strict";p();var bXt=Symbol.for("undici.globalOrigin.1");function fds(){return globalThis[bXt]}a(fds,"getGlobalOrigin");function pds(t){if(t===void 0){Object.defineProperty(globalThis,bXt,{value:void 0,writable:!0,enumerable:!1,configurable:!1});return}let e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new TypeError(`Only http & https urls are allowed, received ${e.protocol}`);Object.defineProperty(globalThis,bXt,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(pds,"setGlobalOrigin");NDn.exports={getGlobalOrigin:fds,setGlobalOrigin:pds}});var nb=I((zZd,QDn)=>{"use strict";p();var Zrt=require("node:assert"),hds=new TextEncoder,tke=/^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/,mds=/[\u000A\u000D\u0009\u0020]/,gds=/[\u0009\u000A\u000C\u000D\u0020]/g,Ads=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function yds(t){Zrt(t.protocol==="data:");let e=LDn(t,!0);e=e.slice(5);let r={position:0},n=Zde(",",e,r),o=n.length;if(n=Sds(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=BDn(s);if(/;(\u0020){0,}base64$/i.test(n)){let u=UDn(c);if(c=_ds(u),c==="failure")return"failure";n=n.slice(0,-6),n=n.replace(/(\u0020)+$/,""),n=n.slice(0,-1)}n.startsWith(";")&&(n="text/plain"+n);let l=TXt(n);return l==="failure"&&(l=TXt("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(yds,"dataURLProcessor");function LDn(t,e=!1){if(!e)return t.href;let r=t.href,n=t.hash.length,o=n===0?r:r.substring(0,r.length-n);return!n&&r.endsWith("#")?o.slice(0,-1):o}a(LDn,"URLSerializer");function Xrt(t,e,r){let n="";for(;r.position=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(MDn,"isHexCharByte");function ODn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(ODn,"hexByteToNumber");function Eds(t){let e=t.length,r=new Uint8Array(e),n=0;for(let o=0;ot.length)return"failure";e.position++;let n=Zde(";",t,e);if(n=Jrt(n,!1,!0),n.length===0||!tke.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionmds.test(d),t,e);let l=Xrt(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.positiont.length)break;let u=null;if(t[e.position]==='"')u=FDn(t,e,!0),Zde(";",t,e);else if(u=Zde(";",t,e),u=Jrt(u,!1,!0),u.length===0)continue;l.length!==0&&tke.test(l)&&(u.length===0||Ads.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(TXt,"parseMIMEType");function _ds(t){t=t.replace(gds,"");let e=t.length;if(e%4===0&&t.charCodeAt(e-1)===61&&(--e,t.charCodeAt(e-1)===61&&--e),e%4===1||/[^+/0-9A-Za-z]/.test(t.length===e?t:t.substring(0,e)))return"failure";let r=Buffer.from(t,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}a(_ds,"forgivingBase64");function FDn(t,e,r){let n=e.position,o="";for(Zrt(t[e.position]==='"'),e.position++;o+=Xrt(c=>c!=='"'&&c!=="\\",t,e),!(e.position>=t.length);){let s=t[e.position];if(e.position++,s==="\\"){if(e.position>=t.length){o+="\\";break}o+=t[e.position],e.position++}else{Zrt(s==='"');break}}return r?o:t.slice(n,e.position)}a(FDn,"collectAnHTTPQuotedString");function vds(t){Zrt(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",tke.test(s)||(s=s.replace(/(\\|")/g,"\\$1"),s='"'+s,s+='"'),n+=s;return n}a(vds,"serializeAMimeType");function Cds(t){return t===13||t===10||t===9||t===32}a(Cds,"isHTTPWhiteSpace");function Jrt(t,e=!0,r=!0){return IXt(t,e,r,Cds)}a(Jrt,"removeHTTPWhitespace");function bds(t){return t===13||t===10||t===9||t===12||t===32}a(bds,"isASCIIWhitespace");function Sds(t,e=!0,r=!0){return IXt(t,e,r,bds)}a(Sds,"removeASCIIWhitespace");function IXt(t,e,r,n){let o=0,s=t.length-1;if(e)for(;o0&&n(t.charCodeAt(s));)s--;return o===0&&s===t.length-1?t:t.slice(o,s+1)}a(IXt,"removeChars");function UDn(t){let e=t.length;if(65535>e)return String.fromCharCode.apply(null,t);let r="",n=0,o=65535;for(;ne&&(o=e-n),r+=String.fromCharCode.apply(null,t.subarray(n,n+=o));return r}a(UDn,"isomorphicDecode");function Tds(t){switch(t.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return t.subtype.endsWith("+json")?"application/json":t.subtype.endsWith("+xml")?"application/xml":""}a(Tds,"minimizeSupportedMimeType");QDn.exports={dataURLProcessor:yds,URLSerializer:LDn,collectASequenceOfCodePoints:Xrt,collectASequenceOfCodePointsFast:Zde,stringPercentDecode:BDn,parseMIMEType:TXt,collectAnHTTPQuotedString:FDn,serializeAMimeType:vds,removeChars:IXt,removeHTTPWhitespace:Jrt,minimizeSupportedMimeType:Tds,HTTP_TOKEN_CODEPOINTS:tke,isomorphicDecode:UDn}});var qA=I((JZd,qDn)=>{"use strict";p();var{types:l5,inspect:Ids}=require("node:util"),{markAsUncloneable:xds}=require("node:worker_threads"),{toUSVString:wds}=qs(),Er={};Er.converters={};Er.util={};Er.errors={};Er.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};Er.errors.conversionFailed=function(t){let e=t.types.length===1?"":" one of",r=`${t.argument} could not be converted to${e}: ${t.types.join(", ")}.`;return Er.errors.exception({header:t.prefix,message:r})};Er.errors.invalidArgument=function(t){return Er.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};Er.brandCheck=function(t,e,r){if(r?.strict!==!1){if(!(t instanceof e)){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}else if(t?.[Symbol.toStringTag]!==e.prototype[Symbol.toStringTag]){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}};Er.argumentLengthCheck=function({length:t},e,r){if(t{});Er.util.ConvertToInt=function(t,e,r,n){let o,s;e===64?(o=Math.pow(2,53)-1,r==="unsigned"?s=0:s=Math.pow(-2,53)+1):r==="unsigned"?(s=0,o=Math.pow(2,e)-1):(s=Math.pow(-2,e)-1,o=Math.pow(2,e-1)-1);let c=Number(t);if(c===0&&(c=0),n?.enforceRange===!0){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw Er.errors.exception({header:"Integer conversion",message:`Could not convert ${Er.util.Stringify(t)} to an integer.`});if(c=Er.util.IntegerPart(c),co)throw Er.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&&n?.clamp===!0?(c=Math.min(Math.max(c,s),o),Math.floor(c)%2===0?c=Math.floor(c):c=Math.ceil(c),c):Number.isNaN(c)||c===0&&Object.is(0,c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY?0:(c=Er.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e)-1?c-Math.pow(2,e):c)};Er.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};Er.util.Stringify=function(t){switch(Er.util.Type(t)){case"Symbol":return`Symbol(${t.description})`;case"Object":return Ids(t);case"String":return`"${t}"`;default:return`${t}`}};Er.sequenceConverter=function(t){return(e,r,n,o)=>{if(Er.util.Type(e)!=="Object")throw Er.errors.exception({header:r,message:`${n} (${Er.util.Stringify(e)}) is not iterable.`});let s=typeof o=="function"?o():e?.[Symbol.iterator]?.(),c=[],l=0;if(s===void 0||typeof s.next!="function")throw Er.errors.exception({header:r,message:`${n} is not iterable.`});for(;;){let{done:u,value:d}=s.next();if(u)break;c.push(t(d,r,`${n}[${l++}]`))}return c}};Er.recordConverter=function(t,e){return(r,n,o)=>{if(Er.util.Type(r)!=="Object")throw Er.errors.exception({header:n,message:`${o} ("${Er.util.Type(r)}") is not an Object.`});let s={};if(!l5.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=t(u,n,o),f=e(r[u],n,o);s[d]=f}return s}let c=Reflect.ownKeys(r);for(let l of c)if(Reflect.getOwnPropertyDescriptor(r,l)?.enumerable){let d=t(l,n,o),f=e(r[l],n,o);s[d]=f}return s}};Er.interfaceConverter=function(t){return(e,r,n,o)=>{if(o?.strict!==!1&&!(e instanceof t))throw Er.errors.exception({header:r,message:`Expected ${n} ("${Er.util.Stringify(e)}") to be an instance of ${t.name}.`});return e}};Er.dictionaryConverter=function(t){return(e,r,n)=>{let o=Er.util.Type(e),s={};if(o==="Null"||o==="Undefined")return s;if(o!=="Object")throw Er.errors.exception({header:r,message:`Expected ${e} to be one of: Null, Undefined, Object.`});for(let c of t){let{key:l,defaultValue:u,required:d,converter:f}=c;if(d===!0&&!Object.hasOwn(e,l))throw Er.errors.exception({header:r,message:`Missing required key "${l}".`});let h=e[l],m=Object.hasOwn(c,"defaultValue");if(m&&h!==null&&(h??=u()),d||m||h!==void 0){if(h=f(h,r,`${n}.${l}`),c.allowedValues&&!c.allowedValues.includes(h))throw Er.errors.exception({header:r,message:`${h} is not an accepted type. Expected one of ${c.allowedValues.join(", ")}.`});s[l]=h}}return s}};Er.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};Er.converters.DOMString=function(t,e,r,n){if(t===null&&n?.legacyNullToEmptyString)return"";if(typeof t=="symbol")throw Er.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};Er.converters.ByteString=function(t,e,r){let n=Er.converters.DOMString(t,e,r);for(let o=0;o255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${o} has a value of ${n.charCodeAt(o)} which is greater than 255.`);return n};Er.converters.USVString=wds;Er.converters.boolean=function(t){return!!t};Er.converters.any=function(t){return t};Er.converters["long long"]=function(t,e,r){return Er.util.ConvertToInt(t,64,"signed",void 0,e,r)};Er.converters["unsigned long long"]=function(t,e,r){return Er.util.ConvertToInt(t,64,"unsigned",void 0,e,r)};Er.converters["unsigned long"]=function(t,e,r){return Er.util.ConvertToInt(t,32,"unsigned",void 0,e,r)};Er.converters["unsigned short"]=function(t,e,r,n){return Er.util.ConvertToInt(t,16,"unsigned",n,e,r)};Er.converters.ArrayBuffer=function(t,e,r,n){if(Er.util.Type(t)!=="Object"||!l5.isAnyArrayBuffer(t))throw Er.errors.conversionFailed({prefix:e,argument:`${r} ("${Er.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(n?.allowShared===!1&&l5.isSharedArrayBuffer(t))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.resizable||t.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.TypedArray=function(t,e,r,n,o){if(Er.util.Type(t)!=="Object"||!l5.isTypedArray(t)||t.constructor.name!==e.name)throw Er.errors.conversionFailed({prefix:r,argument:`${n} ("${Er.util.Stringify(t)}")`,types:[e.name]});if(o?.allowShared===!1&&l5.isSharedArrayBuffer(t.buffer))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.DataView=function(t,e,r,n){if(Er.util.Type(t)!=="Object"||!l5.isDataView(t))throw Er.errors.exception({header:e,message:`${r} is not a DataView.`});if(n?.allowShared===!1&&l5.isSharedArrayBuffer(t.buffer))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.BufferSource=function(t,e,r,n){if(l5.isAnyArrayBuffer(t))return Er.converters.ArrayBuffer(t,e,r,{...n,allowShared:!1});if(l5.isTypedArray(t))return Er.converters.TypedArray(t,t.constructor,e,r,{...n,allowShared:!1});if(l5.isDataView(t))return Er.converters.DataView(t,e,r,{...n,allowShared:!1});throw Er.errors.conversionFailed({prefix:e,argument:`${r} ("${Er.util.Stringify(t)}")`,types:["BufferSource"]})};Er.converters["sequence"]=Er.sequenceConverter(Er.converters.ByteString);Er.converters["sequence>"]=Er.sequenceConverter(Er.converters["sequence"]);Er.converters["record"]=Er.recordConverter(Er.converters.ByteString,Er.converters.ByteString);qDn.exports={webidl:Er}});var sT=I((XZd,tNn)=>{"use strict";p();var{Transform:Rds}=require("node:stream"),jDn=require("node:zlib"),{redirectStatusSet:kds,referrerPolicySet:Pds,badPortsSet:Dds}=eke(),{getGlobalOrigin:HDn}=SXt(),{collectASequenceOfCodePoints:jJ,collectAnHTTPQuotedString:Nds,removeChars:Mds,parseMIMEType:Ods}=nb(),{performance:Lds}=require("node:perf_hooks"),{isBlobLike:Bds,ReadableStreamFrom:Fds,isValidHTTPToken:GDn,normalizedMethodRecordsBase:Uds}=qs(),HJ=require("node:assert"),{isUint8Array:Qds}=require("node:util/types"),{webidl:rke}=qA(),$Dn=[],tnt;try{tnt=require("node:crypto");let t=["sha256","sha384","sha512"];$Dn=tnt.getHashes().filter(e=>t.includes(e))}catch{}function VDn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(VDn,"responseURL");function qds(t,e){if(!kds.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&zDn(r)&&(WDn(r)||(r=jds(r)),r=new URL(r,VDn(t))),r&&!r.hash&&(r.hash=e),r}a(qds,"responseLocationURL");function WDn(t){for(let e=0;e126||r<32)return!1}return!0}a(WDn,"isValidEncodedURL");function jds(t){return Buffer.from(t,"binary").toString("utf8")}a(jds,"normalizeBinaryStringToUtf8");function ike(t){return t.urlList[t.urlList.length-1]}a(ike,"requestCurrentURL");function Hds(t){let e=ike(t);return XDn(e)&&Dds.has(e.port)?"blocked":"allowed"}a(Hds,"requestBadPort");function Gds(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(Gds,"isErrorLike");function $ds(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a($ds,"isValidReasonPhrase");var Vds=GDn;function zDn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` -`)||t.includes("\r")||t.includes("\0"))===!1}a(zDn,"isValidHeaderValue");function Wds(t,e){let{headersList:r}=e,n=(r.get("referrer-policy",!0)??"").split(","),o="";if(n.length>0)for(let s=n.length;s!==0;s--){let c=n[s-1].trim();if(Pds.has(c)){o=c;break}}o!==""&&(t.referrerPolicy=o)}a(Wds,"setRequestReferrerPolicyOnRedirect");function zds(){return"allowed"}a(zds,"crossOriginResourcePolicyCheck");function Yds(){return"success"}a(Yds,"corsCheck");function Kds(){return"success"}a(Kds,"TAOCheck");function Jds(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(Jds,"appendFetchMetadata");function Zds(t){let e=t.origin;if(!(e==="client"||e===void 0)){if(t.responseTainting==="cors"||t.mode==="websocket")t.headersList.append("origin",e,!0);else if(t.method!=="GET"&&t.method!=="HEAD"){switch(t.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":t.origin&&wXt(t.origin)&&!wXt(ike(t))&&(e=null);break;case"same-origin":rnt(t,ike(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(Zds,"appendRequestOriginHeader");function Xde(t,e){return t}a(Xde,"coarsenTime");function Xds(t,e,r){return!t?.startTime||t.startTime4096&&(n=o);let s=rnt(t,n),c=nke(n)&&!nke(t.url);switch(e){case"origin":return o??xXt(r,!0);case"unsafe-url":return n;case"same-origin":return s?o:"no-referrer";case"origin-when-cross-origin":return s?n:o;case"strict-origin-when-cross-origin":{let l=ike(t);return rnt(n,l)?n:nke(n)&&!nke(l)?"no-referrer":o}default:return c?"no-referrer":o}}a(nfs,"determineRequestsReferrer");function xXt(t,e){return HJ(t instanceof URL),t=new URL(t),t.protocol==="file:"||t.protocol==="about:"||t.protocol==="blank:"?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}a(xXt,"stripURLForReferrer");function nke(t){if(!(t instanceof URL))return!1;if(t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="file:")return!0;return e(t.origin);function e(r){if(r==null||r==="null")return!1;let n=new URL(r);return!!(n.protocol==="https:"||n.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(n.hostname)||n.hostname==="localhost"||n.hostname.includes("localhost.")||n.hostname.endsWith(".localhost"))}}a(nke,"isURLPotentiallyTrustworthy");function ifs(t,e){if(tnt===void 0)return!0;let r=KDn(e);if(r==="no metadata"||r.length===0)return!0;let n=sfs(r),o=afs(r,n);for(let s of o){let c=s.algo,l=s.hash,u=tnt.createHash(c).update(t).digest("base64");if(u[u.length-1]==="="&&(u[u.length-2]==="="?u=u.slice(0,-2):u=u.slice(0,-1)),cfs(u,l))return!0}return!1}a(ifs,"bytesMatch");var ofs=/(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function KDn(t){let e=[],r=!0;for(let n of t.split(" ")){r=!1;let o=ofs.exec(n);if(o===null||o.groups===void 0||o.groups.algo===void 0)continue;let s=o.groups.algo.toLowerCase();$Dn.includes(s)&&e.push(o.groups)}return r===!0?"no metadata":e}a(KDn,"parseMetadata");function sfs(t){let e=t[0].algo;if(e[3]==="5")return e;for(let r=1;r{t=n,e=o}),resolve:t,reject:e}}a(ufs,"createDeferredPromise");function dfs(t){return t.controller.state==="aborted"}a(dfs,"isAborted");function ffs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(ffs,"isCancelled");function pfs(t){return Uds[t.toLowerCase()]??t}a(pfs,"normalizeMethod");function hfs(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return HJ(typeof e=="string"),e}a(hfs,"serializeJavascriptValueToJSONString");var mfs=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function JDn(t,e,r=0,n=1){class o{static{a(this,"FastIterableIterator")}#e;#t;#r;constructor(c,l){this.#e=c,this.#t=l,this.#r=0}next(){if(typeof this!="object"||this===null||!(#e in this))throw new TypeError(`'next' called on an object that does not implement interface ${t} Iterator.`);let c=this.#r,l=this.#e[e],u=l.length;if(c>=u)return{value:void 0,done:!0};let{[r]:d,[n]:f}=l[c];this.#r=c+1;let h;switch(this.#t){case"key":h=d;break;case"value":h=f;break;case"key+value":h=[d,f];break}return{value:h,done:!1}}}return delete o.prototype.constructor,Object.setPrototypeOf(o.prototype,mfs),Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${t} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(s,c){return new o(s,c)}}a(JDn,"createIterator");function gfs(t,e,r,n=0,o=1){let s=JDn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return rke.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return rke.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return rke.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(rke.brandCheck(this,e),rke.argumentLengthCheck(arguments,1,`${t}.forEach`),typeof u!="function")throw new TypeError(`Failed to execute 'forEach' on '${t}': parameter 1 is not of type 'Function'.`);for(let{0:f,1:h}of s(this,"key+value"))u.call(d,h,f,this)},"forEach")}};return Object.defineProperties(e.prototype,{...c,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:c.entries.value}})}a(gfs,"iteratorMixin");async function Afs(t,e,r){let n=e,o=r,s;try{s=t.stream.getReader()}catch(c){o(c);return}try{n(await ZDn(s))}catch(c){o(c)}}a(Afs,"fullyReadBody");function yfs(t){return t instanceof ReadableStream||t[Symbol.toStringTag]==="ReadableStream"&&typeof t.tee=="function"}a(yfs,"isReadableStreamLike");function Efs(t){try{t.close(),t.byobRequest?.respond(0)}catch(e){if(!e.message.includes("Controller is already closed")&&!e.message.includes("ReadableStream is already closed"))throw e}}a(Efs,"readableStreamClose");var _fs=/[^\x00-\xFF]/;function ent(t){return HJ(!_fs.test(t)),t}a(ent,"isomorphicEncode");async function ZDn(t){let e=[],r=0;for(;;){let{done:n,value:o}=await t.read();if(n)return Buffer.concat(e,r);if(!Qds(o))throw new TypeError("Received non-Uint8Array chunk");e.push(o),r+=o.length}}a(ZDn,"readAllBytes");function vfs(t){HJ("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(vfs,"urlIsLocal");function wXt(t){return typeof t=="string"&&t[5]===":"&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&t[4]==="s"||t.protocol==="https:"}a(wXt,"urlHasHttpsScheme");function XDn(t){HJ("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(XDn,"urlIsHttpHttpsScheme");function Cfs(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&jJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&jJ(u=>u===" "||u===" ",r,n);let o=jJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&jJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&jJ(u=>u===" "||u===" ",r,n);let c=jJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),l=c.length?Number(c):null;return n.positionl?"failure":{rangeStartValue:s,rangeEndValue:l}}a(Cfs,"simpleRangeHeaderValue");function bfs(t,e,r){let n="bytes ";return n+=ent(`${t}`),n+="-",n+=ent(`${e}`),n+="/",n+=ent(`${r}`),n}a(bfs,"buildContentRange");var RXt=class extends Rds{static{a(this,"InflateStream")}#e;constructor(e){super(),this.#e=e}_transform(e,r,n){if(!this._inflateStream){if(e.length===0){n();return}this._inflateStream=(e[0]&15)===8?jDn.createInflate(this.#e):jDn.createInflateRaw(this.#e),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",o=>this.destroy(o))}this._inflateStream.write(e,r,n)}_final(e){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),e()}};function Sfs(t){return new RXt(t)}a(Sfs,"createInflate");function Tfs(t){let e=null,r=null,n=null,o=eNn("content-type",t);if(o===null)return"failure";for(let s of o){let c=Ods(s);c==="failure"||c.essence==="*/*"||(n=c,n.essence!==r?(e=null,n.parameters.has("charset")&&(e=n.parameters.get("charset")),r=n.essence):!n.parameters.has("charset")&&e!==null&&n.parameters.set("charset",e))}return n??"failure"}a(Tfs,"extractMimeType");function Ifs(t){let e=t,r={position:0},n=[],o="";for(;r.positions!=='"'&&s!==",",e,r),r.positions===9||s===32),n.push(o),o=""}return n}a(Ifs,"gettingDecodingSplitting");function eNn(t,e){let r=e.get(t,!0);return r===null?null:Ifs(r)}a(eNn,"getDecodeSplit");var xfs=new TextDecoder;function wfs(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),xfs.decode(t))}a(wfs,"utf8DecodeBytes");var kXt=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return HDn()}get origin(){return this.baseUrl?.origin}policyContainer=YDn()},PXt=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new kXt},Rfs=new PXt;tNn.exports={isAborted:dfs,isCancelled:ffs,isValidEncodedURL:WDn,createDeferredPromise:ufs,ReadableStreamFrom:Fds,tryUpgradeRequestToAPotentiallyTrustworthyURL:lfs,clampAndCoarsenConnectionTimingInfo:Xds,coarsenedSharedCurrentTime:efs,determineRequestsReferrer:nfs,makePolicyContainer:YDn,clonePolicyContainer:rfs,appendFetchMetadata:Jds,appendRequestOriginHeader:Zds,TAOCheck:Kds,corsCheck:Yds,crossOriginResourcePolicyCheck:zds,createOpaqueTimingInfo:tfs,setRequestReferrerPolicyOnRedirect:Wds,isValidHTTPToken:GDn,requestBadPort:Hds,requestCurrentURL:ike,responseURL:VDn,responseLocationURL:qds,isBlobLike:Bds,isURLPotentiallyTrustworthy:nke,isValidReasonPhrase:$ds,sameOrigin:rnt,normalizeMethod:pfs,serializeJavascriptValueToJSONString:hfs,iteratorMixin:gfs,createIterator:JDn,isValidHeaderName:Vds,isValidHeaderValue:zDn,isErrorLike:Gds,fullyReadBody:Afs,bytesMatch:ifs,isReadableStreamLike:yfs,readableStreamClose:Efs,isomorphicEncode:ent,urlIsLocal:vfs,urlHasHttpsScheme:wXt,urlIsHttpHttpsScheme:XDn,readAllBytes:ZDn,simpleRangeHeaderValue:Cfs,buildContentRange:bfs,parseMetadata:KDn,createInflate:Sfs,extractMimeType:Tfs,getDecodeSplit:eNn,utf8DecodeBytes:wfs,environmentSettingsObject:Rfs}});var oj=I((rXd,rNn)=>{"use strict";p();rNn.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kDispatcher:Symbol("dispatcher")}});var NXt=I((iXd,nNn)=>{"use strict";p();var{Blob:kfs,File:Pfs}=require("node:buffer"),{kState:RF}=oj(),{webidl:u5}=qA(),DXt=class t{static{a(this,"FileLike")}constructor(e,r,n={}){let o=r,s=n.type,c=n.lastModified??Date.now();this[RF]={blobLike:e,name:o,type:s,lastModified:c}}stream(...e){return u5.brandCheck(this,t),this[RF].blobLike.stream(...e)}arrayBuffer(...e){return u5.brandCheck(this,t),this[RF].blobLike.arrayBuffer(...e)}slice(...e){return u5.brandCheck(this,t),this[RF].blobLike.slice(...e)}text(...e){return u5.brandCheck(this,t),this[RF].blobLike.text(...e)}get size(){return u5.brandCheck(this,t),this[RF].blobLike.size}get type(){return u5.brandCheck(this,t),this[RF].blobLike.type}get name(){return u5.brandCheck(this,t),this[RF].name}get lastModified(){return u5.brandCheck(this,t),this[RF].lastModified}get[Symbol.toStringTag](){return"File"}};u5.converters.Blob=u5.interfaceConverter(kfs);function Dfs(t){return t instanceof Pfs||t&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&t[Symbol.toStringTag]==="File"}a(Dfs,"isFileLike");nNn.exports={FileLike:DXt,isFileLike:Dfs}});var ske=I((aXd,cNn)=>{"use strict";p();var{isBlobLike:nnt,iteratorMixin:Nfs}=sT(),{kState:nv}=oj(),{kEnumerableProperty:efe}=qs(),{FileLike:iNn,isFileLike:Mfs}=NXt(),{webidl:Tu}=qA(),{File:aNn}=require("node:buffer"),oNn=require("node:util"),sNn=globalThis.File??aNn,oke=class t{static{a(this,"FormData")}constructor(e){if(Tu.util.markAsUncloneable(this),e!==void 0)throw Tu.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[nv]=[]}append(e,r,n=void 0){Tu.brandCheck(this,t);let o="FormData.append";if(Tu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!nnt(r))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");e=Tu.converters.USVString(e,o,"name"),r=nnt(r)?Tu.converters.Blob(r,o,"value",{strict:!1}):Tu.converters.USVString(r,o,"value"),n=arguments.length===3?Tu.converters.USVString(n,o,"filename"):void 0;let s=MXt(e,r,n);this[nv].push(s)}delete(e){Tu.brandCheck(this,t);let r="FormData.delete";Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name"),this[nv]=this[nv].filter(n=>n.name!==e)}get(e){Tu.brandCheck(this,t);let r="FormData.get";Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name");let n=this[nv].findIndex(o=>o.name===e);return n===-1?null:this[nv][n].value}getAll(e){Tu.brandCheck(this,t);let r="FormData.getAll";return Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name"),this[nv].filter(n=>n.name===e).map(n=>n.value)}has(e){Tu.brandCheck(this,t);let r="FormData.has";return Tu.argumentLengthCheck(arguments,1,r),e=Tu.converters.USVString(e,r,"name"),this[nv].findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Tu.brandCheck(this,t);let o="FormData.set";if(Tu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!nnt(r))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");e=Tu.converters.USVString(e,o,"name"),r=nnt(r)?Tu.converters.Blob(r,o,"name",{strict:!1}):Tu.converters.USVString(r,o,"name"),n=arguments.length===3?Tu.converters.USVString(n,o,"name"):void 0;let s=MXt(e,r,n),c=this[nv].findIndex(l=>l.name===e);c!==-1?this[nv]=[...this[nv].slice(0,c),s,...this[nv].slice(c+1).filter(l=>l.name!==e)]:this[nv].push(s)}[oNn.inspect.custom](e,r){let n=this[nv].reduce((s,c)=>(s[c.name]?Array.isArray(s[c.name])?s[c.name].push(c.value):s[c.name]=[s[c.name],c.value]:s[c.name]=c.value,s),{__proto__:null});r.depth??=e,r.colors??=!0;let o=oNn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}};Nfs("FormData",oke,nv,"name","value");Object.defineProperties(oke.prototype,{append:efe,delete:efe,get:efe,getAll:efe,has:efe,set:efe,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function MXt(t,e,r){if(typeof e!="string"){if(Mfs(e)||(e=e instanceof Blob?new sNn([e],"blob",{type:e.type}):new iNn(e,"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=e instanceof aNn?new sNn([e],r,n):new iNn(e,r,n)}}return{name:t,value:e}}a(MXt,"makeEntry");cNn.exports={FormData:oke,makeEntry:MXt}});var hNn=I((uXd,pNn)=>{"use strict";p();var{isUSVString:lNn,bufferToLowerCasedHeaderName:Ofs}=qs(),{utf8DecodeBytes:Lfs}=sT(),{HTTP_TOKEN_CODEPOINTS:Bfs,isomorphicDecode:uNn}=nb(),{isFileLike:Ffs}=NXt(),{makeEntry:Ufs}=ske(),int=require("node:assert"),{File:Qfs}=require("node:buffer"),qfs=globalThis.File??Qfs,jfs=Buffer.from('form-data; name="'),dNn=Buffer.from("; filename"),Hfs=Buffer.from("--"),Gfs=Buffer.from(`--\r -`);function $fs(t){for(let e=0;e70)return!1;for(let r=0;r=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||n===39||n===45||n===95))return!1}return!0}a(Vfs,"validateBoundary");function Wfs(t,e){int(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)return"failure";let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0};for(;t[s.position]===13&&t[s.position+1]===10;)s.position+=2;let c=t.length;for(;t[c-1]===10&&t[c-2]===13;)c-=2;for(c!==t.length&&(t=t.subarray(0,c));;){if(t.subarray(s.position,s.position+n.length).equals(n))s.position+=n.length;else return"failure";if(s.position===t.length-2&&ont(t,Hfs,s)||s.position===t.length-4&&ont(t,Gfs,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let l=zfs(t,s);if(l==="failure")return"failure";let{name:u,filename:d,contentType:f,encoding:h}=l;s.position+=2;let m;{let A=t.indexOf(n.subarray(2),s.position);if(A===-1)return"failure";m=t.subarray(s.position,A-4),s.position+=m.length,h==="base64"&&(m=Buffer.from(m.toString(),"base64"))}if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let g;d!==null?(f??="text/plain",$fs(f)||(f=""),g=new qfs([m],d,{type:f})):g=Lfs(Buffer.from(m)),int(lNn(u)),int(typeof g=="string"&&lNn(g)||Ffs(g)),o.push(Ufs(u,g,d))}}a(Wfs,"multipartFormDataParser");function zfs(t,e){let r=null,n=null,o=null,s=null;for(;;){if(t[e.position]===13&&t[e.position+1]===10)return r===null?"failure":{name:r,filename:n,contentType:o,encoding:s};let c=tfe(l=>l!==10&&l!==13&&l!==58,t,e);if(c=OXt(c,!0,!0,l=>l===9||l===32),!Bfs.test(c.toString())||t[e.position]!==58)return"failure";switch(e.position++,tfe(l=>l===32||l===9,t,e),Ofs(c)){case"content-disposition":{if(r=n=null,!ont(t,jfs,e)||(e.position+=17,r=fNn(t,e),r===null))return"failure";if(ont(t,dNn,e)){let l=e.position+dNn.length;if(t[l]===42&&(e.position+=1,l+=1),t[l]!==61||t[l+1]!==34||(e.position+=12,n=fNn(t,e),n===null))return"failure"}break}case"content-type":{let l=tfe(u=>u!==10&&u!==13,t,e);l=OXt(l,!1,!0,u=>u===9||u===32),o=uNn(l);break}case"content-transfer-encoding":{let l=tfe(u=>u!==10&&u!==13,t,e);l=OXt(l,!1,!0,u=>u===9||u===32),s=uNn(l);break}default:tfe(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13&&t[e.position+1]!==10)return"failure";e.position+=2}}a(zfs,"parseMultipartFormDataHeaders");function fNn(t,e){int(t[e.position-1]===34);let r=tfe(n=>n!==10&&n!==13&&n!==34,t,e);return t[e.position]!==34?null:(e.position++,r=new TextDecoder().decode(r).replace(/%0A/ig,` -`).replace(/%0D/ig,"\r").replace(/%22/g,'"'),r)}a(fNn,"parseMultipartFormDataName");function tfe(t,e,r){let n=r.position;for(;n0&&n(t[s]);)s--;return o===0&&s===t.length-1?t:t.subarray(o,s+1)}a(OXt,"removeChars");function ont(t,e,r){if(t.length{"use strict";p();var ake=qs(),{ReadableStreamFrom:Yfs,isBlobLike:mNn,isReadableStreamLike:Kfs,readableStreamClose:Jfs,createDeferredPromise:Zfs,fullyReadBody:Xfs,extractMimeType:eps,utf8DecodeBytes:yNn}=sT(),{FormData:gNn}=ske(),{kState:nfe}=oj(),{webidl:tps}=qA(),{Blob:rps}=require("node:buffer"),LXt=require("node:assert"),{isErrored:ENn,isDisturbed:nps}=require("node:stream"),{isArrayBuffer:ips}=require("node:util/types"),{serializeAMimeType:ops}=nb(),{multipartFormDataParser:sps}=hNn(),BXt;try{let t=require("node:crypto");BXt=a(e=>t.randomInt(0,e),"random")}catch{BXt=a(t=>Math.floor(Math.random(t)),"random")}var snt=new TextEncoder;function aps(){}a(aps,"noop");var _Nn=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,vNn;_Nn&&(vNn=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!nps(e)&&!ENn(e)&&e.cancel("Response object has been garbage collected").catch(aps)}));function CNn(t,e=!1){let r=null;t instanceof ReadableStream?r=t:mNn(t)?r=t.stream():r=new ReadableStream({async pull(u){let d=typeof o=="string"?snt.encode(o):o;d.byteLength&&u.enqueue(d),queueMicrotask(()=>Jfs(u))},start(){},type:"bytes"}),LXt(Kfs(r));let n=null,o=null,s=null,c=null;if(typeof t=="string")o=t,c="text/plain;charset=UTF-8";else if(t instanceof URLSearchParams)o=t.toString(),c="application/x-www-form-urlencoded;charset=UTF-8";else if(ips(t))o=new Uint8Array(t.slice());else if(ArrayBuffer.isView(t))o=new Uint8Array(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength));else if(ake.isFormDataLike(t)){let u=`----formdata-undici-0${`${BXt(1e11)}`.padStart(11,"0")}`,d=`--${u}\r +`+s),t.push(o+"m+"+KZe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=EJo()+e+" "+t[0]}a(yJo,"formatArgs");function EJo(){return Tg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(EJo,"getDate");function _Jo(...t){return process.stderr.write(YZe.formatWithOptions(Tg.inspectOpts,...t)+` +`)}a(_Jo,"log");function vJo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(vJo,"save");function CJo(){return process.env.DEBUG}a(CJo,"load");function bJo(t){t.inspectOpts={};let e=Object.keys(Tg.inspectOpts);for(let r=0;re.trim()).join(" ")};TTn.O=function(t){return this.inspectOpts.colors=this.useColors,YZe.inspect(t,this.inspectOpts)}});var xTn=I((qyd,SGt)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?SGt.exports=STn():SGt.exports=ITn()});var IGt=I(pJ=>{"use strict";p();Object.defineProperty(pJ,"__esModule",{value:!0});pJ.createDeferred=pJ.deferred=void 0;function TGt(){let t,e,r="pending";return{promise:new Promise((o,s)=>{t=o,e=s}),done(o){r==="pending"&&(r="resolved",t(o))},fail(o){r==="pending"&&(r="rejected",e(o))},get fulfilled(){return r!=="pending"},get status(){return r}}}a(TGt,"deferred");pJ.deferred=TGt;pJ.createDeferred=TGt;pJ.default=TGt});var CXe=I(aT=>{"use strict";p();Object.defineProperty(aT,"__esModule",{value:!0});aT.deepClone=Rwn;aT.deepFreeze=cts;aT.cloneAndChange=lts;aT.mixin=Pwn;aT.equals=Vwe;aT.safeStringify=uts;aT.stableStringify=dts;aT.distinct=fts;aT.getCaseInsensitive=pts;aT.filter=hts;aT.mapValues=mts;var Jq=nT();function Rwn(t){if(!t||typeof t!="object"||t instanceof RegExp)return t;let e=Array.isArray(t)?[]:{};return Object.entries(t).forEach(([r,n])=>{e[r]=n&&typeof n=="object"?Rwn(n):n}),e}a(Rwn,"deepClone");function cts(t){if(!t||typeof t!="object")return t;let e=[t];for(;e.length>0;){let r=e.shift();Object.freeze(r);for(let n in r)if(kwn.call(r,n)){let o=r[n];typeof o=="object"&&!Object.isFrozen(o)&&!(0,Jq.isTypedArray)(o)&&e.push(o)}}return t}a(cts,"deepFreeze");var kwn=Object.prototype.hasOwnProperty;function lts(t,e){return x$t(t,e,new Set)}a(lts,"cloneAndChange");function x$t(t,e,r){if((0,Jq.isUndefinedOrNull)(t))return t;let n=e(t);if(typeof n<"u")return n;if(Array.isArray(t)){let o=[];for(let s of t)o.push(x$t(s,e,r));return o}if((0,Jq.isObject)(t)){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let o={};for(let s in t)kwn.call(t,s)&&(o[s]=x$t(t[s],e,r));return r.delete(t),o}return t}a(x$t,"_cloneAndChange");function Pwn(t,e,r=!0){return(0,Jq.isObject)(t)?((0,Jq.isObject)(e)&&Object.keys(e).forEach(n=>{n in t?r&&((0,Jq.isObject)(t[n])&&(0,Jq.isObject)(e[n])?Pwn(t[n],e[n],r):t[n]=e[n]):t[n]=e[n]}),t):e}a(Pwn,"mixin");function Vwe(t,e){if(t===e)return!0;if(t==null||e===null||e===void 0||typeof t!=typeof e||typeof t!="object"||Array.isArray(t)!==Array.isArray(e))return!1;let r,n;if(Array.isArray(t)){if(t.length!==e.length)return!1;for(r=0;r{if((0,Jq.isObject)(n)||Array.isArray(n)){if(e.has(n))return"[Circular]";e.add(n)}return typeof n=="bigint"?`[BigInt ${n.toString()}]`:n})}a(uts,"safeStringify");function dts(t){if(t===void 0)return"undefined";try{return w$t(t,new WeakSet)}catch{return""}}a(dts,"stableStringify");function w$t(t,e){if(t===null||typeof t!="object")return JSON.stringify(t)??"null";if(e.has(t))return'"[Circular]"';if(e.add(t),Array.isArray(t))return"["+t.map(o=>w$t(o,e)).join(",")+"]";let r=Object.keys(t).sort(),n=[];for(let o of r){let s=t[o];s!==void 0&&n.push(JSON.stringify(o)+":"+w$t(s,e))}return"{"+n.join(",")+"}"}a(w$t,"_stableStringify");function fts(t,e){let r=Object.create(null);return!t||!e||Object.keys(e).forEach(o=>{let s=t[o],c=e[o];Vwe(s,c)||(r[o]=c)}),r}a(fts,"distinct");function pts(t,e){let r=e.toLowerCase(),n=Object.keys(t).find(o=>o.toLowerCase()===r);return n?t[n]:t[e]}a(pts,"getCaseInsensitive");function hts(t,e){let r=Object.create(null);for(let[n,o]of Object.entries(t))e(n,o)&&(r[n]=o);return r}a(hts,"filter");function mts(t,e){let r={};for(let[n,o]of Object.entries(t))r[n]=e(o,n);return r}a(mts,"mapValues")});var nv=I(bXe=>{"use strict";p();Object.defineProperty(bXe,"__esModule",{value:!0});bXe.ErrorUtils=void 0;var gts=CXe(),Dwn;(function(t){function e(n){return n instanceof Error?n:typeof n=="string"?new Error(n):new Error(`An unexpected error occurred: ${(0,gts.safeStringify)(n)}`)}a(e,"fromUnknown"),t.fromUnknown=e;function r(n){return n.stack?n.stack:n.message}a(r,"toString"),t.toString=r})(Dwn||(bXe.ErrorUtils=Dwn={}))});var yw=I(SXe=>{"use strict";p();Object.defineProperty(SXe,"__esModule",{value:!0});SXe.Result=void 0;var R$t=nv(),Nwn;(function(t){function e(c){return new k$t(c)}a(e,"ok"),t.ok=e;function r(c){return new P$t(c)}a(r,"error"),t.error=r;function n(c){return t.error(new Error(c))}a(n,"fromString"),t.fromString=n;function o(c){try{return t.ok(c())}catch(l){return t.error(R$t.ErrorUtils.fromUnknown(l))}}a(o,"tryWith"),t.tryWith=o;async function s(c){try{return t.ok(await c())}catch(l){return t.error(R$t.ErrorUtils.fromUnknown(l))}}a(s,"tryWithAsync"),t.tryWithAsync=s})(Nwn||(SXe.Result=Nwn={}));var k$t=class t{static{a(this,"ResultOk")}constructor(e){this.val=e}map(e){return new t(e(this.val))}mapError(e){return this}flatMap(e){return e(this.val)}unwrap(){return this.val}unwrapOr(e){return this.val}isOk(){return!0}isError(){return!1}},P$t=class t{static{a(this,"ResultError")}constructor(e){this.err=e}map(e){return this}mapError(e){return new t(e(this.err))}flatMap(e){return this}unwrap(){throw this.err instanceof Error?this.err:R$t.ErrorUtils.fromUnknown(this.err)}unwrapOr(e){return e}isOk(){return!1}isError(){return!0}}});var Wd=I((mtf,VDn)=>{p();VDn.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent")}});var _c=I((Atf,ANn)=>{"use strict";p();var WDn=Symbol.for("undici.error.UND_ERR"),zd=class extends Error{static{a(this,"UndiciError")}constructor(e){super(e),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&e[WDn]===!0}[WDn]=!0},zDn=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),TXt=class extends zd{static{a(this,"ConnectTimeoutError")}constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[zDn]===!0}[zDn]=!0},YDn=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),IXt=class extends zd{static{a(this,"HeadersTimeoutError")}constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[YDn]===!0}[YDn]=!0},KDn=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),xXt=class extends zd{static{a(this,"HeadersOverflowError")}constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&e[KDn]===!0}[KDn]=!0},JDn=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),wXt=class extends zd{static{a(this,"BodyTimeoutError")}constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[JDn]===!0}[JDn]=!0},ZDn=Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"),RXt=class extends zd{static{a(this,"ResponseStatusCodeError")}constructor(e,r,n,o){super(e),this.name="ResponseStatusCodeError",this.message=e||"Response Status Code Error",this.code="UND_ERR_RESPONSE_STATUS_CODE",this.body=o,this.status=r,this.statusCode=r,this.headers=n}static[Symbol.hasInstance](e){return e&&e[ZDn]===!0}[ZDn]=!0},XDn=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),kXt=class extends zd{static{a(this,"InvalidArgumentError")}constructor(e){super(e),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](e){return e&&e[XDn]===!0}[XDn]=!0},eNn=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),PXt=class extends zd{static{a(this,"InvalidReturnValueError")}constructor(e){super(e),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](e){return e&&e[eNn]===!0}[eNn]=!0},tNn=Symbol.for("undici.error.UND_ERR_ABORT"),unt=class extends zd{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError",this.message=e||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](e){return e&&e[tNn]===!0}[tNn]=!0},rNn=Symbol.for("undici.error.UND_ERR_ABORTED"),DXt=class extends unt{static{a(this,"RequestAbortedError")}constructor(e){super(e),this.name="AbortError",this.message=e||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](e){return e&&e[rNn]===!0}[rNn]=!0},nNn=Symbol.for("undici.error.UND_ERR_INFO"),NXt=class extends zd{static{a(this,"InformationalError")}constructor(e){super(e),this.name="InformationalError",this.message=e||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](e){return e&&e[nNn]===!0}[nNn]=!0},iNn=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),MXt=class extends zd{static{a(this,"RequestContentLengthMismatchError")}constructor(e){super(e),this.name="RequestContentLengthMismatchError",this.message=e||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[iNn]===!0}[iNn]=!0},oNn=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),OXt=class extends zd{static{a(this,"ResponseContentLengthMismatchError")}constructor(e){super(e),this.name="ResponseContentLengthMismatchError",this.message=e||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[oNn]===!0}[oNn]=!0},sNn=Symbol.for("undici.error.UND_ERR_DESTROYED"),LXt=class extends zd{static{a(this,"ClientDestroyedError")}constructor(e){super(e),this.name="ClientDestroyedError",this.message=e||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](e){return e&&e[sNn]===!0}[sNn]=!0},aNn=Symbol.for("undici.error.UND_ERR_CLOSED"),BXt=class extends zd{static{a(this,"ClientClosedError")}constructor(e){super(e),this.name="ClientClosedError",this.message=e||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](e){return e&&e[aNn]===!0}[aNn]=!0},cNn=Symbol.for("undici.error.UND_ERR_SOCKET"),FXt=class extends zd{static{a(this,"SocketError")}constructor(e,r){super(e),this.name="SocketError",this.message=e||"Socket error",this.code="UND_ERR_SOCKET",this.socket=r}static[Symbol.hasInstance](e){return e&&e[cNn]===!0}[cNn]=!0},lNn=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),UXt=class extends zd{static{a(this,"NotSupportedError")}constructor(e){super(e),this.name="NotSupportedError",this.message=e||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](e){return e&&e[lNn]===!0}[lNn]=!0},uNn=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),QXt=class extends zd{static{a(this,"BalancedPoolMissingUpstreamError")}constructor(e){super(e),this.name="MissingUpstreamError",this.message=e||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](e){return e&&e[uNn]===!0}[uNn]=!0},dNn=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),qXt=class extends Error{static{a(this,"HTTPParserError")}constructor(e,r,n){super(e),this.name="HTTPParserError",this.code=r?`HPE_${r}`:void 0,this.data=n?n.toString():void 0}static[Symbol.hasInstance](e){return e&&e[dNn]===!0}[dNn]=!0},fNn=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),jXt=class extends zd{static{a(this,"ResponseExceededMaxSizeError")}constructor(e){super(e),this.name="ResponseExceededMaxSizeError",this.message=e||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](e){return e&&e[fNn]===!0}[fNn]=!0},pNn=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),HXt=class extends zd{static{a(this,"RequestRetryError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="RequestRetryError",this.message=e||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[pNn]===!0}[pNn]=!0},hNn=Symbol.for("undici.error.UND_ERR_RESPONSE"),GXt=class extends zd{static{a(this,"ResponseError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="ResponseError",this.message=e||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[hNn]===!0}[hNn]=!0},mNn=Symbol.for("undici.error.UND_ERR_PRX_TLS"),$Xt=class extends zd{static{a(this,"SecureProxyConnectionError")}constructor(e,r,n){super(r,{cause:e,...n??{}}),this.name="SecureProxyConnectionError",this.message=r||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=e}static[Symbol.hasInstance](e){return e&&e[mNn]===!0}[mNn]=!0},gNn=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),VXt=class extends zd{static{a(this,"MessageSizeExceededError")}constructor(e){super(e),this.name="MessageSizeExceededError",this.message=e||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](e){return e&&e[gNn]===!0}get[gNn](){return!0}};ANn.exports={AbortError:unt,HTTPParserError:qXt,UndiciError:zd,HeadersTimeoutError:IXt,HeadersOverflowError:xXt,BodyTimeoutError:wXt,RequestContentLengthMismatchError:MXt,ConnectTimeoutError:TXt,ResponseStatusCodeError:RXt,InvalidArgumentError:kXt,InvalidReturnValueError:PXt,RequestAbortedError:DXt,ClientDestroyedError:LXt,ClientClosedError:BXt,InformationalError:NXt,SocketError:FXt,NotSupportedError:UXt,ResponseContentLengthMismatchError:OXt,BalancedPoolMissingUpstreamError:QXt,ResponseExceededMaxSizeError:jXt,RequestRetryError:HXt,ResponseError:GXt,SecureProxyConnectionError:$Xt,MessageSizeExceededError:VXt}});var fnt=I((_tf,yNn)=>{"use strict";p();var dnt={},WXt=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"];for(let t=0;t{"use strict";p();var{wellknownHeaderNames:ENn,headerNameLowerCasedRecord:Qds}=fnt(),zXt=class t{static{a(this,"TstNode")}value=null;left=null;middle=null;right=null;code;constructor(e,r,n){if(n===void 0||n>=e.length)throw new TypeError("Unreachable");if((this.code=e.charCodeAt(n))>127)throw new TypeError("key must be ascii string");e.length!==++n?this.middle=new t(e,r,n):this.value=r}add(e,r){let n=e.length;if(n===0)throw new TypeError("Unreachable");let o=0,s=this;for(;;){let c=e.charCodeAt(o);if(c>127)throw new TypeError("key must be ascii string");if(s.code===c)if(n===++o){s.value=r;break}else if(s.middle!==null)s=s.middle;else{s.middle=new t(e,r,o);break}else if(s.code=65&&(s|=32);o!==null;){if(s===o.code){if(r===++n)return o;o=o.middle;break}o=o.code{"use strict";p();var gke=require("node:assert"),{kDestroyed:SNn,kBodyUsed:ofe,kListeners:YXt,kBody:bNn}=Wd(),{IncomingMessage:qds}=require("node:http"),gnt=require("node:stream"),jds=require("node:net"),{Blob:Hds}=require("node:buffer"),Gds=require("node:util"),{stringify:$ds}=require("node:querystring"),{EventEmitter:Vds}=require("node:events"),{InvalidArgumentError:Pg}=_c(),{headerNameLowerCasedRecord:Wds}=fnt(),{tree:TNn}=CNn(),[zds,Yds]=process.versions.node.split(".").map(t=>Number(t)),mnt=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[bNn]=e,this[ofe]=!1}async*[Symbol.asyncIterator](){gke(!this[ofe],"disturbed"),this[ofe]=!0,yield*this[bNn]}};function Kds(t){return Ant(t)?(kNn(t)===0&&t.on("data",function(){gke(!1)}),typeof t.readableDidRead!="boolean"&&(t[ofe]=!1,Vds.prototype.on.call(t,"data",function(){this[ofe]=!0})),t):t&&typeof t.pipeTo=="function"?new mnt(t):t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&RNn(t)?new mnt(t):t}a(Kds,"wrapRequestBody");function Jds(){}a(Jds,"nop");function Ant(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Ant,"isStream");function INn(t){if(t===null)return!1;if(t instanceof Hds)return!0;if(typeof t!="object")return!1;{let e=t[Symbol.toStringTag];return(e==="Blob"||e==="File")&&("stream"in t&&typeof t.stream=="function"||"arrayBuffer"in t&&typeof t.arrayBuffer=="function")}}a(INn,"isBlobLike");function Zds(t,e){if(t.includes("?")||t.includes("#"))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=$ds(e);return r&&(t+="?"+r),t}a(Zds,"buildURL");function xNn(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(xNn,"isValidPort");function hnt(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(hnt,"isHttpOrHttpsPrefixed");function wNn(t){if(typeof t=="string"){if(t=new URL(t),!hnt(t.origin||t.protocol))throw new Pg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new Pg("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&xNn(t.port)===!1)throw new Pg("Invalid URL: port must be a valid integer or a string representation of an integer.");if(t.path!=null&&typeof t.path!="string")throw new Pg("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new Pg("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new Pg("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new Pg("Invalid URL origin: the origin must be a string or null/undefined.");if(!hnt(t.origin||t.protocol))throw new Pg("Invalid URL protocol: the URL must start with `http:` or `https:`.");let e=t.port!=null?t.port:t.protocol==="https:"?443:80,r=t.origin!=null?t.origin:`${t.protocol||""}//${t.hostname||""}:${e}`,n=t.path!=null?t.path:`${t.pathname||""}${t.search||""}`;return r[r.length-1]==="/"&&(r=r.slice(0,r.length-1)),n&&n[0]!=="/"&&(n=`/${n}`),new URL(`${r}${n}`)}if(!hnt(t.origin||t.protocol))throw new Pg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(wNn,"parseURL");function Xds(t){if(t=wNn(t),t.pathname!=="/"||t.search||t.hash)throw new Pg("invalid url");return t}a(Xds,"parseOrigin");function efs(t){if(t[0]==="["){let r=t.indexOf("]");return gke(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(efs,"getHostname");function tfs(t){if(!t)return null;gke(typeof t=="string");let e=efs(t);return jds.isIP(e)?"":e}a(tfs,"getServerName");function rfs(t){return JSON.parse(JSON.stringify(t))}a(rfs,"deepClone");function nfs(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(nfs,"isAsyncIterable");function RNn(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(RNn,"isIterable");function kNn(t){if(t==null)return 0;if(Ant(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(INn(t))return t.size!=null?t.size:null;if(NNn(t))return t.byteLength}return null}a(kNn,"bodyLength");function PNn(t){return t&&!!(t.destroyed||t[SNn]||gnt.isDestroyed?.(t))}a(PNn,"isDestroyed");function ifs(t,e){t==null||!Ant(t)||PNn(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===qds&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[SNn]=!0))}a(ifs,"destroy");var ofs=/timeout=(\d+)/;function sfs(t){let e=t.toString().match(ofs);return e?parseInt(e[1],10)*1e3:null}a(sfs,"parseKeepAliveTimeout");function DNn(t){return typeof t=="string"?Wds[t]??t.toLowerCase():TNn.lookup(t)??t.toString("latin1").toLowerCase()}a(DNn,"headerNameToString");function afs(t){return TNn.lookup(t)??t.toString("latin1").toLowerCase()}a(afs,"bufferToLowerCasedHeaderName");function cfs(t,e){e===void 0&&(e={});for(let r=0;rc.toString("utf8")):s.toString("utf8")}}return"content-length"in e&&"content-disposition"in e&&(e["content-disposition"]=Buffer.from(e["content-disposition"]).toString("latin1")),e}a(cfs,"parseHeaders");function lfs(t){let e=t.length,r=new Array(e),n=!1,o=-1,s,c,l=0;for(let u=0;u{r.close(),r.byobRequest?.respond(0)});else{let s=Buffer.isBuffer(o)?o:Buffer.from(o);s.byteLength&&r.enqueue(new Uint8Array(s))}return r.desiredSize>0},async cancel(r){await e.return()},type:"bytes"})}a(mfs,"ReadableStreamFrom");function gfs(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}a(gfs,"isFormDataLike");function Afs(t,e){return"addEventListener"in t?(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)):(t.addListener("abort",e),()=>t.removeListener("abort",e))}a(Afs,"addAbortListener");var yfs=typeof String.prototype.toWellFormed=="function",Efs=typeof String.prototype.isWellFormed=="function";function MNn(t){return yfs?`${t}`.toWellFormed():Gds.toUSVString(t)}a(MNn,"toUSVString");function _fs(t){return Efs?`${t}`.isWellFormed():MNn(t)===`${t}`}a(_fs,"isUSVString");function ONn(t){switch(t){case 34:case 40:case 41:case 44:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 123:case 125:return!1;default:return t>=33&&t<=126}}a(ONn,"isTokenCharCode");function vfs(t){if(t.length===0)return!1;for(let e=0;e{"use strict";p();var jc=require("node:diagnostics_channel"),ZXt=require("node:util"),ynt=ZXt.debuglog("undici"),JXt=ZXt.debuglog("fetch"),KJ=ZXt.debuglog("websocket"),UNn=!1,wfs={beforeConnect:jc.channel("undici:client:beforeConnect"),connected:jc.channel("undici:client:connected"),connectError:jc.channel("undici:client:connectError"),sendHeaders:jc.channel("undici:client:sendHeaders"),create:jc.channel("undici:request:create"),bodySent:jc.channel("undici:request:bodySent"),headers:jc.channel("undici:request:headers"),trailers:jc.channel("undici:request:trailers"),error:jc.channel("undici:request:error"),open:jc.channel("undici:websocket:open"),close:jc.channel("undici:websocket:close"),socketError:jc.channel("undici:websocket:socket_error"),ping:jc.channel("undici:websocket:ping"),pong:jc.channel("undici:websocket:pong")};if(ynt.enabled||JXt.enabled){let t=JXt.enabled?JXt:ynt;jc.channel("undici:client:beforeConnect").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s using %s%s",`${s}${o?`:${o}`:""}`,n,r)}),jc.channel("undici:client:connected").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s using %s%s",`${s}${o?`:${o}`:""}`,n,r)}),jc.channel("undici:client:connectError").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s using %s%s errored - %s",`${s}${o?`:${o}`:""}`,n,r,c.message)}),jc.channel("undici:client:sendHeaders").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s/%s",r,o,n)}),jc.channel("undici:request:headers").subscribe(e=>{let{request:{method:r,path:n,origin:o},response:{statusCode:s}}=e;t("received response to %s %s/%s - HTTP %d",r,o,n,s)}),jc.channel("undici:request:trailers").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s/%s",r,o,n)}),jc.channel("undici:request:error").subscribe(e=>{let{request:{method:r,path:n,origin:o},error:s}=e;t("request to %s %s/%s errored - %s",r,o,n,s.message)}),UNn=!0}if(KJ.enabled){if(!UNn){let t=ynt.enabled?ynt:KJ;jc.channel("undici:client:beforeConnect").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),jc.channel("undici:client:connected").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),jc.channel("undici:client:connectError").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s%s using %s%s errored - %s",s,o?`:${o}`:"",n,r,c.message)}),jc.channel("undici:client:sendHeaders").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s/%s",r,o,n)})}jc.channel("undici:websocket:open").subscribe(t=>{let{address:{address:e,port:r}}=t;KJ("connection opened %s%s",e,r?`:${r}`:"")}),jc.channel("undici:websocket:close").subscribe(t=>{let{websocket:e,code:r,reason:n}=t;KJ("closed connection to %s - %s %s",e.url,r,n)}),jc.channel("undici:websocket:socket_error").subscribe(t=>{KJ("connection errored - %s",t.message)}),jc.channel("undici:websocket:ping").subscribe(t=>{KJ("ping received")}),jc.channel("undici:websocket:pong").subscribe(t=>{KJ("pong received")})}QNn.exports={channels:wfs}});var GNn=I((ktf,HNn)=>{"use strict";p();var{InvalidArgumentError:Iu,NotSupportedError:Rfs}=_c(),MF=require("node:assert"),{isValidHTTPToken:jNn,isValidHeaderValue:XXt,isStream:kfs,destroy:Pfs,isBuffer:Dfs,isFormDataLike:Nfs,isIterable:Mfs,isBlobLike:Ofs,buildURL:Lfs,validateHandler:Bfs,getServerName:Ffs,normalizedMethodRecords:Ufs}=js(),{channels:h5}=sfe(),{headerNameLowerCasedRecord:qNn}=fnt(),Qfs=/[^\u0021-\u00ff]/,ww=Symbol("handler"),eer=class{static{a(this,"Request")}constructor(e,{path:r,method:n,body:o,headers:s,query:c,idempotent:l,blocking:u,upgrade:d,headersTimeout:f,bodyTimeout:h,reset:m,throwOnError:g,expectContinue:A,servername:y},E){if(typeof r!="string")throw new Iu("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Iu("path must be an absolute URL or start with a slash");if(Qfs.test(r))throw new Iu("invalid request path");if(typeof n!="string")throw new Iu("method must be a string");if(Ufs[n]===void 0&&!jNn(n))throw new Iu("invalid request method");if(d&&typeof d!="string")throw new Iu("upgrade must be a string");if(d&&!XXt(d))throw new Iu("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Iu("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Iu("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Iu("invalid reset");if(A!=null&&typeof A!="boolean")throw new Iu("invalid expectContinue");if(this.headersTimeout=f,this.bodyTimeout=h,this.throwOnError=g===!0,this.method=n,this.abort=null,o==null)this.body=null;else if(kfs(o)){this.body=o;let _=this.body._readableState;(!_||!_.autoDestroy)&&(this.endHandler=a(function(){Pfs(this)},"autoDestroy"),this.body.on("end",this.endHandler)),this.errorHandler=v=>{this.abort?this.abort(v):this.error=v},this.body.on("error",this.errorHandler)}else if(Dfs(o))this.body=o.byteLength?o:null;else if(ArrayBuffer.isView(o))this.body=o.buffer.byteLength?Buffer.from(o.buffer,o.byteOffset,o.byteLength):null;else if(o instanceof ArrayBuffer)this.body=o.byteLength?Buffer.from(o):null;else if(typeof o=="string")this.body=o.length?Buffer.from(o):null;else if(Nfs(o)||Mfs(o)||Ofs(o))this.body=o;else throw new Iu("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=d||null,this.path=c?Lfs(r,c):r,this.origin=e,this.idempotent=l??(n==="HEAD"||n==="GET"),this.blocking=u??!1,this.reset=m??null,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=A??!1,Array.isArray(s)){if(s.length%2!==0)throw new Iu("headers array must be even");for(let _=0;_{"use strict";p();var qfs=require("node:events"),_nt=class extends qfs{static{a(this,"Dispatcher")}dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}compose(...e){let r=Array.isArray(e[0])?e[0]:e,n=this.dispatch.bind(this);for(let o of r)if(o!=null){if(typeof o!="function")throw new TypeError(`invalid interceptor, expected function received ${typeof o}`);if(n=o(n),n==null||typeof n!="function"||n.length!==2)throw new TypeError("invalid interceptor")}return new ter(this,n)}},ter=class extends _nt{static{a(this,"ComposedDispatcher")}#e=null;#t=null;constructor(e,r){super(),this.#e=e,this.#t=r}dispatch(...e){this.#t(...e)}close(...e){return this.#e.close(...e)}destroy(...e){return this.#e.destroy(...e)}};$Nn.exports=_nt});var ufe=I((Ltf,VNn)=>{"use strict";p();var jfs=Ake(),{ClientDestroyedError:rer,ClientClosedError:Hfs,InvalidArgumentError:afe}=_c(),{kDestroy:Gfs,kClose:$fs,kClosed:yke,kDestroyed:cfe,kDispatch:ner,kInterceptors:JJ}=Wd(),OF=Symbol("onDestroyed"),lfe=Symbol("onClosed"),vnt=Symbol("Intercepted Dispatch"),ier=class extends jfs{static{a(this,"DispatcherBase")}constructor(){super(),this[cfe]=!1,this[OF]=null,this[yke]=!1,this[lfe]=[]}get destroyed(){return this[cfe]}get closed(){return this[yke]}get interceptors(){return this[JJ]}set interceptors(e){if(e){for(let r=e.length-1;r>=0;r--)if(typeof this[JJ][r]!="function")throw new afe("interceptor must be an function")}this[JJ]=e}close(e){if(e===void 0)return new Promise((n,o)=>{this.close((s,c)=>s?o(s):n(c))});if(typeof e!="function")throw new afe("invalid callback");if(this[cfe]){queueMicrotask(()=>e(new rer,null));return}if(this[yke]){this[lfe]?this[lfe].push(e):queueMicrotask(()=>e(null,null));return}this[yke]=!0,this[lfe].push(e);let r=a(()=>{let n=this[lfe];this[lfe]=null;for(let o=0;othis.destroy()).then(()=>{queueMicrotask(r)})}destroy(e,r){if(typeof e=="function"&&(r=e,e=null),r===void 0)return new Promise((o,s)=>{this.destroy(e,(c,l)=>c?s(c):o(l))});if(typeof r!="function")throw new afe("invalid callback");if(this[cfe]){this[OF]?this[OF].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new rer),this[cfe]=!0,this[OF]=this[OF]||[],this[OF].push(r);let n=a(()=>{let o=this[OF];this[OF]=null;for(let s=0;s{queueMicrotask(n)})}[vnt](e,r){if(!this[JJ]||this[JJ].length===0)return this[vnt]=this[ner],this[ner](e,r);let n=this[ner].bind(this);for(let o=this[JJ].length-1;o>=0;o--)n=this[JJ][o](n);return this[vnt]=n,n(e,r)}dispatch(e,r){if(!r||typeof r!="object")throw new afe("handler must be an object");try{if(!e||typeof e!="object")throw new afe("opts must be an object.");if(this[cfe]||this[OF])throw new rer;if(this[yke])throw new Hfs;return this[vnt](e,r)}catch(n){if(typeof r.onError!="function")throw new afe("invalid onError method");return r.onError(n),!1}}};VNn.exports=ier});var der=I((Utf,KNn)=>{"use strict";p();var dfe=0,oer=1e3,ser=(oer>>1)-1,LF,aer=Symbol("kFastTimer"),BF=[],cer=-2,ler=-1,zNn=0,WNn=1;function uer(){dfe+=ser;let t=0,e=BF.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=ler,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===ler?(r._state=cer,--e!==0&&(BF[t]=BF[e])):++t}BF.length=e,BF.length!==0&&YNn()}a(uer,"onTick");function YNn(){LF?LF.refresh():(clearTimeout(LF),LF=setTimeout(uer,ser),LF.unref&&LF.unref())}a(YNn,"refreshTimeout");var Cnt=class{static{a(this,"FastTimer")}[aer]=!0;_state=cer;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===cer&&BF.push(this),(!LF||BF.length===1)&&YNn(),this._state=zNn}clear(){this._state=ler,this._idleStart=-1}};KNn.exports={setTimeout(t,e,r){return e<=oer?setTimeout(t,e,r):new Cnt(t,e,r)},clearTimeout(t){t[aer]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new Cnt(t,e,r)},clearFastTimeout(t){t.clear()},now(){return dfe},tick(t=0){dfe+=t-oer+1,uer(),uer()},reset(){dfe=0,BF.length=0,clearTimeout(LF),LF=null},kFastTimer:aer}});var Eke=I((Gtf,tMn)=>{"use strict";p();var Vfs=require("node:net"),JNn=require("node:assert"),eMn=js(),{InvalidArgumentError:Wfs,ConnectTimeoutError:zfs}=_c(),bnt=der();function ZNn(){}a(ZNn,"noop");var fer,per;global.FinalizationRegistry&&!(process.env.NODE_V8_COVERAGE||process.env.UNDICI_NO_FG)?per=class{static{a(this,"WeakSessionCache")}constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new global.FinalizationRegistry(r=>{if(this._sessionCache.size=this._maxCachedSessions){let{value:n}=this._sessionCache.keys().next();this._sessionCache.delete(n)}this._sessionCache.set(e,r)}}};function Yfs({allowH2:t,maxCachedSessions:e,socketPath:r,timeout:n,session:o,...s}){if(e!=null&&(!Number.isInteger(e)||e<0))throw new Wfs("maxCachedSessions must be a positive integer or zero");let c={path:r,...s},l=new per(e??100);return n=n??1e4,t=t??!1,a(function({hostname:d,host:f,protocol:h,port:m,servername:g,localAddress:A,httpSocket:y},E){let _;if(h==="https:"){fer||(fer=require("node:tls")),g=g||c.servername||eMn.getServerName(f)||null;let b=g||d;JNn(b);let T=o||l.get(b)||null;m=m||443,_=fer.connect({highWaterMark:16384,...c,servername:g,session:T,localAddress:A,ALPNProtocols:t?["http/1.1","h2"]:["http/1.1"],socket:y,port:m,host:d}),_.on("session",function(w){l.set(b,w)})}else JNn(!y,"httpSocket can only be sent on TLS update"),m=m||80,_=Vfs.connect({highWaterMark:64*1024,...c,localAddress:A,port:m,host:d});if(c.keepAlive==null||c.keepAlive){let b=c.keepAliveInitialDelay===void 0?6e4:c.keepAliveInitialDelay;_.setKeepAlive(!0,b)}let v=Kfs(new WeakRef(_),{timeout:n,hostname:d,port:m});return _.setNoDelay(!0).once(h==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(v),E){let b=E;E=null,b(null,this)}}).on("error",function(b){if(queueMicrotask(v),E){let T=E;E=null,T(b)}}),_},"connect")}a(Yfs,"buildConnector");var Kfs=process.platform==="win32"?(t,e)=>{if(!e.timeout)return ZNn;let r=null,n=null,o=bnt.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>XNn(t.deref(),e))})},e.timeout);return()=>{bnt.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return ZNn;let r=null,n=bnt.setFastTimeout(()=>{r=setImmediate(()=>{XNn(t.deref(),e)})},e.timeout);return()=>{bnt.clearFastTimeout(n),clearImmediate(r)}};function XNn(t,e){if(t==null)return;let r="Connect Timeout Error";Array.isArray(t.autoSelectFamilyAttemptedAddresses)?r+=` (attempted addresses: ${t.autoSelectFamilyAttemptedAddresses.join(", ")},`:r+=` (attempted address: ${e.hostname}:${e.port},`,r+=` timeout: ${e.timeout}ms)`,eMn.destroy(t,new zfs(r))}a(XNn,"onConnectTimeout");tMn.exports=Yfs});var rMn=I(Snt=>{"use strict";p();Object.defineProperty(Snt,"__esModule",{value:!0});Snt.enumToMap=void 0;function Jfs(t){let e={};return Object.keys(t).forEach(r=>{let n=t[r];typeof n=="number"&&(e[r]=n)}),e}a(Jfs,"enumToMap");Snt.enumToMap=Jfs});var nMn=I(kr=>{"use strict";p();Object.defineProperty(kr,"__esModule",{value:!0});kr.SPECIAL_HEADERS=kr.HEADER_STATE=kr.MINOR=kr.MAJOR=kr.CONNECTION_TOKEN_CHARS=kr.HEADER_CHARS=kr.TOKEN=kr.STRICT_TOKEN=kr.HEX=kr.URL_CHAR=kr.STRICT_URL_CHAR=kr.USERINFO_CHARS=kr.MARK=kr.ALPHANUM=kr.NUM=kr.HEX_MAP=kr.NUM_MAP=kr.ALPHA=kr.FINISH=kr.H_METHOD_MAP=kr.METHOD_MAP=kr.METHODS_RTSP=kr.METHODS_ICE=kr.METHODS_HTTP=kr.METHODS=kr.LENIENT_FLAGS=kr.FLAGS=kr.TYPE=kr.ERROR=void 0;var Zfs=rMn(),Xfs;(function(t){t[t.OK=0]="OK",t[t.INTERNAL=1]="INTERNAL",t[t.STRICT=2]="STRICT",t[t.LF_EXPECTED=3]="LF_EXPECTED",t[t.UNEXPECTED_CONTENT_LENGTH=4]="UNEXPECTED_CONTENT_LENGTH",t[t.CLOSED_CONNECTION=5]="CLOSED_CONNECTION",t[t.INVALID_METHOD=6]="INVALID_METHOD",t[t.INVALID_URL=7]="INVALID_URL",t[t.INVALID_CONSTANT=8]="INVALID_CONSTANT",t[t.INVALID_VERSION=9]="INVALID_VERSION",t[t.INVALID_HEADER_TOKEN=10]="INVALID_HEADER_TOKEN",t[t.INVALID_CONTENT_LENGTH=11]="INVALID_CONTENT_LENGTH",t[t.INVALID_CHUNK_SIZE=12]="INVALID_CHUNK_SIZE",t[t.INVALID_STATUS=13]="INVALID_STATUS",t[t.INVALID_EOF_STATE=14]="INVALID_EOF_STATE",t[t.INVALID_TRANSFER_ENCODING=15]="INVALID_TRANSFER_ENCODING",t[t.CB_MESSAGE_BEGIN=16]="CB_MESSAGE_BEGIN",t[t.CB_HEADERS_COMPLETE=17]="CB_HEADERS_COMPLETE",t[t.CB_MESSAGE_COMPLETE=18]="CB_MESSAGE_COMPLETE",t[t.CB_CHUNK_HEADER=19]="CB_CHUNK_HEADER",t[t.CB_CHUNK_COMPLETE=20]="CB_CHUNK_COMPLETE",t[t.PAUSED=21]="PAUSED",t[t.PAUSED_UPGRADE=22]="PAUSED_UPGRADE",t[t.PAUSED_H2_UPGRADE=23]="PAUSED_H2_UPGRADE",t[t.USER=24]="USER"})(Xfs=kr.ERROR||(kr.ERROR={}));var eps;(function(t){t[t.BOTH=0]="BOTH",t[t.REQUEST=1]="REQUEST",t[t.RESPONSE=2]="RESPONSE"})(eps=kr.TYPE||(kr.TYPE={}));var tps;(function(t){t[t.CONNECTION_KEEP_ALIVE=1]="CONNECTION_KEEP_ALIVE",t[t.CONNECTION_CLOSE=2]="CONNECTION_CLOSE",t[t.CONNECTION_UPGRADE=4]="CONNECTION_UPGRADE",t[t.CHUNKED=8]="CHUNKED",t[t.UPGRADE=16]="UPGRADE",t[t.CONTENT_LENGTH=32]="CONTENT_LENGTH",t[t.SKIPBODY=64]="SKIPBODY",t[t.TRAILING=128]="TRAILING",t[t.TRANSFER_ENCODING=512]="TRANSFER_ENCODING"})(tps=kr.FLAGS||(kr.FLAGS={}));var rps;(function(t){t[t.HEADERS=1]="HEADERS",t[t.CHUNKED_LENGTH=2]="CHUNKED_LENGTH",t[t.KEEP_ALIVE=4]="KEEP_ALIVE"})(rps=kr.LENIENT_FLAGS||(kr.LENIENT_FLAGS={}));var Ni;(function(t){t[t.DELETE=0]="DELETE",t[t.GET=1]="GET",t[t.HEAD=2]="HEAD",t[t.POST=3]="POST",t[t.PUT=4]="PUT",t[t.CONNECT=5]="CONNECT",t[t.OPTIONS=6]="OPTIONS",t[t.TRACE=7]="TRACE",t[t.COPY=8]="COPY",t[t.LOCK=9]="LOCK",t[t.MKCOL=10]="MKCOL",t[t.MOVE=11]="MOVE",t[t.PROPFIND=12]="PROPFIND",t[t.PROPPATCH=13]="PROPPATCH",t[t.SEARCH=14]="SEARCH",t[t.UNLOCK=15]="UNLOCK",t[t.BIND=16]="BIND",t[t.REBIND=17]="REBIND",t[t.UNBIND=18]="UNBIND",t[t.ACL=19]="ACL",t[t.REPORT=20]="REPORT",t[t.MKACTIVITY=21]="MKACTIVITY",t[t.CHECKOUT=22]="CHECKOUT",t[t.MERGE=23]="MERGE",t[t["M-SEARCH"]=24]="M-SEARCH",t[t.NOTIFY=25]="NOTIFY",t[t.SUBSCRIBE=26]="SUBSCRIBE",t[t.UNSUBSCRIBE=27]="UNSUBSCRIBE",t[t.PATCH=28]="PATCH",t[t.PURGE=29]="PURGE",t[t.MKCALENDAR=30]="MKCALENDAR",t[t.LINK=31]="LINK",t[t.UNLINK=32]="UNLINK",t[t.SOURCE=33]="SOURCE",t[t.PRI=34]="PRI",t[t.DESCRIBE=35]="DESCRIBE",t[t.ANNOUNCE=36]="ANNOUNCE",t[t.SETUP=37]="SETUP",t[t.PLAY=38]="PLAY",t[t.PAUSE=39]="PAUSE",t[t.TEARDOWN=40]="TEARDOWN",t[t.GET_PARAMETER=41]="GET_PARAMETER",t[t.SET_PARAMETER=42]="SET_PARAMETER",t[t.REDIRECT=43]="REDIRECT",t[t.RECORD=44]="RECORD",t[t.FLUSH=45]="FLUSH"})(Ni=kr.METHODS||(kr.METHODS={}));kr.METHODS_HTTP=[Ni.DELETE,Ni.GET,Ni.HEAD,Ni.POST,Ni.PUT,Ni.CONNECT,Ni.OPTIONS,Ni.TRACE,Ni.COPY,Ni.LOCK,Ni.MKCOL,Ni.MOVE,Ni.PROPFIND,Ni.PROPPATCH,Ni.SEARCH,Ni.UNLOCK,Ni.BIND,Ni.REBIND,Ni.UNBIND,Ni.ACL,Ni.REPORT,Ni.MKACTIVITY,Ni.CHECKOUT,Ni.MERGE,Ni["M-SEARCH"],Ni.NOTIFY,Ni.SUBSCRIBE,Ni.UNSUBSCRIBE,Ni.PATCH,Ni.PURGE,Ni.MKCALENDAR,Ni.LINK,Ni.UNLINK,Ni.PRI,Ni.SOURCE];kr.METHODS_ICE=[Ni.SOURCE];kr.METHODS_RTSP=[Ni.OPTIONS,Ni.DESCRIBE,Ni.ANNOUNCE,Ni.SETUP,Ni.PLAY,Ni.PAUSE,Ni.TEARDOWN,Ni.GET_PARAMETER,Ni.SET_PARAMETER,Ni.REDIRECT,Ni.RECORD,Ni.FLUSH,Ni.GET,Ni.POST];kr.METHOD_MAP=Zfs.enumToMap(Ni);kr.H_METHOD_MAP={};Object.keys(kr.METHOD_MAP).forEach(t=>{/^H/.test(t)&&(kr.H_METHOD_MAP[t]=kr.METHOD_MAP[t])});var nps;(function(t){t[t.SAFE=0]="SAFE",t[t.SAFE_WITH_CB=1]="SAFE_WITH_CB",t[t.UNSAFE=2]="UNSAFE"})(nps=kr.FINISH||(kr.FINISH={}));kr.ALPHA=[];for(let t=65;t<=90;t++)kr.ALPHA.push(String.fromCharCode(t)),kr.ALPHA.push(String.fromCharCode(t+32));kr.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};kr.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};kr.NUM=["0","1","2","3","4","5","6","7","8","9"];kr.ALPHANUM=kr.ALPHA.concat(kr.NUM);kr.MARK=["-","_",".","!","~","*","'","(",")"];kr.USERINFO_CHARS=kr.ALPHANUM.concat(kr.MARK).concat(["%",";",":","&","=","+","$",","]);kr.STRICT_URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(kr.ALPHANUM);kr.URL_CHAR=kr.STRICT_URL_CHAR.concat([" ","\f"]);for(let t=128;t<=255;t++)kr.URL_CHAR.push(t);kr.HEX=kr.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);kr.STRICT_TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(kr.ALPHANUM);kr.TOKEN=kr.STRICT_TOKEN.concat([" "]);kr.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&kr.HEADER_CHARS.push(t);kr.CONNECTION_TOKEN_CHARS=kr.HEADER_CHARS.filter(t=>t!==44);kr.MAJOR=kr.NUM_MAP;kr.MINOR=kr.MAJOR;var ffe;(function(t){t[t.GENERAL=0]="GENERAL",t[t.CONNECTION=1]="CONNECTION",t[t.CONTENT_LENGTH=2]="CONTENT_LENGTH",t[t.TRANSFER_ENCODING=3]="TRANSFER_ENCODING",t[t.UPGRADE=4]="UPGRADE",t[t.CONNECTION_KEEP_ALIVE=5]="CONNECTION_KEEP_ALIVE",t[t.CONNECTION_CLOSE=6]="CONNECTION_CLOSE",t[t.CONNECTION_UPGRADE=7]="CONNECTION_UPGRADE",t[t.TRANSFER_ENCODING_CHUNKED=8]="TRANSFER_ENCODING_CHUNKED"})(ffe=kr.HEADER_STATE||(kr.HEADER_STATE={}));kr.SPECIAL_HEADERS={connection:ffe.CONNECTION,"content-length":ffe.CONTENT_LENGTH,"proxy-connection":ffe.CONNECTION,"transfer-encoding":ffe.TRANSFER_ENCODING,upgrade:ffe.UPGRADE}});var her=I((Ztf,iMn)=>{"use strict";p();var{Buffer:ips}=require("node:buffer");iMn.exports=ips.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK07MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtXACAAQRhqQgA3AwAgAEIANwMAIABBOGpCADcDACAAQTBqQgA3AwAgAEEoakIANwMAIABBIGpCADcDACAAQRBqQgA3AwAgAEEIakIANwMAIABB3QE2AhwLBgAgABAyC5otAQt/IwBBEGsiCiQAQaTQACgCACIJRQRAQeTTACgCACIFRQRAQfDTAEJ/NwIAQejTAEKAgISAgIDAADcCAEHk0wAgCkEIakFwcUHYqtWqBXMiBTYCAEH40wBBADYCAEHI0wBBADYCAAtBzNMAQYDUBDYCAEGc0ABBgNQENgIAQbDQACAFNgIAQazQAEF/NgIAQdDTAEGArAM2AgADQCABQcjQAGogAUG80ABqIgI2AgAgAiABQbTQAGoiAzYCACABQcDQAGogAzYCACABQdDQAGogAUHE0ABqIgM2AgAgAyACNgIAIAFB2NAAaiABQczQAGoiAjYCACACIAM2AgAgAUHU0ABqIAI2AgAgAUEgaiIBQYACRw0AC0GM1ARBwasDNgIAQajQAEH00wAoAgA2AgBBmNAAQcCrAzYCAEGk0ABBiNQENgIAQcz/B0E4NgIAQYjUBCEJCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFNBEBBjNAAKAIAIgZBECAAQRNqQXBxIABBC0kbIgRBA3YiAHYiAUEDcQRAAkAgAUEBcSAAckEBcyICQQN0IgBBtNAAaiIBIABBvNAAaigCACIAKAIIIgNGBEBBjNAAIAZBfiACd3E2AgAMAQsgASADNgIIIAMgATYCDAsgAEEIaiEBIAAgAkEDdCICQQNyNgIEIAAgAmoiACAAKAIEQQFyNgIEDBELQZTQACgCACIIIARPDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxaCIAQQN0IgJBtNAAaiIBIAJBvNAAaigCACICKAIIIgNGBEBBjNAAIAZBfiAAd3EiBjYCAAwBCyABIAM2AgggAyABNgIMCyACIARBA3I2AgQgAEEDdCIAIARrIQUgACACaiAFNgIAIAIgBGoiBCAFQQFyNgIEIAgEQCAIQXhxQbTQAGohAEGg0AAoAgAhAwJ/QQEgCEEDdnQiASAGcUUEQEGM0AAgASAGcjYCACAADAELIAAoAggLIgEgAzYCDCAAIAM2AgggAyAANgIMIAMgATYCCAsgAkEIaiEBQaDQACAENgIAQZTQACAFNgIADBELQZDQACgCACILRQ0BIAtoQQJ0QbzSAGooAgAiACgCBEF4cSAEayEFIAAhAgNAAkAgAigCECIBRQRAIAJBFGooAgAiAUUNAQsgASgCBEF4cSAEayIDIAVJIQIgAyAFIAIbIQUgASAAIAIbIQAgASECDAELCyAAKAIYIQkgACgCDCIDIABHBEBBnNAAKAIAGiADIAAoAggiATYCCCABIAM2AgwMEAsgAEEUaiICKAIAIgFFBEAgACgCECIBRQ0DIABBEGohAgsDQCACIQcgASIDQRRqIgIoAgAiAQ0AIANBEGohAiADKAIQIgENAAsgB0EANgIADA8LQX8hBCAAQb9/Sw0AIABBE2oiAUFwcSEEQZDQACgCACIIRQ0AQQAgBGshBQJAAkACQAJ/QQAgBEGAAkkNABpBHyAEQf///wdLDQAaIARBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmoLIgZBAnRBvNIAaigCACICRQRAQQAhAUEAIQMMAQtBACEBIARBGSAGQQF2a0EAIAZBH0cbdCEAQQAhAwNAAkAgAigCBEF4cSAEayIHIAVPDQAgAiEDIAciBQ0AQQAhBSACIQEMAwsgASACQRRqKAIAIgcgByACIABBHXZBBHFqQRBqKAIAIgJGGyABIAcbIQEgAEEBdCEAIAINAAsLIAEgA3JFBEBBACEDQQIgBnQiAEEAIABrciAIcSIARQ0DIABoQQJ0QbzSAGooAgAhAQsgAUUNAQsDQCABKAIEQXhxIARrIgIgBUkhACACIAUgABshBSABIAMgABshAyABKAIQIgAEfyAABSABQRRqKAIACyIBDQALCyADRQ0AIAVBlNAAKAIAIARrTw0AIAMoAhghByADIAMoAgwiAEcEQEGc0AAoAgAaIAAgAygCCCIBNgIIIAEgADYCDAwOCyADQRRqIgIoAgAiAUUEQCADKAIQIgFFDQMgA0EQaiECCwNAIAIhBiABIgBBFGoiAigCACIBDQAgAEEQaiECIAAoAhAiAQ0ACyAGQQA2AgAMDQtBlNAAKAIAIgMgBE8EQEGg0AAoAgAhAQJAIAMgBGsiAkEQTwRAIAEgBGoiACACQQFyNgIEIAEgA2ogAjYCACABIARBA3I2AgQMAQsgASADQQNyNgIEIAEgA2oiACAAKAIEQQFyNgIEQQAhAEEAIQILQZTQACACNgIAQaDQACAANgIAIAFBCGohAQwPC0GY0AAoAgAiAyAESwRAIAQgCWoiACADIARrIgFBAXI2AgRBpNAAIAA2AgBBmNAAIAE2AgAgCSAEQQNyNgIEIAlBCGohAQwPC0EAIQEgBAJ/QeTTACgCAARAQezTACgCAAwBC0Hw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBDGpBcHFB2KrVqgVzNgIAQfjTAEEANgIAQcjTAEEANgIAQYCABAsiACAEQccAaiIFaiIGQQAgAGsiB3EiAk8EQEH80wBBMDYCAAwPCwJAQcTTACgCACIBRQ0AQbzTACgCACIIIAJqIQAgACABTSAAIAhLcQ0AQQAhAUH80wBBMDYCAAwPC0HI0wAtAABBBHENBAJAAkAgCQRAQczTACEBA0AgASgCACIAIAlNBEAgACABKAIEaiAJSw0DCyABKAIIIgENAAsLQQAQMyIAQX9GDQUgAiEGQejTACgCACIBQQFrIgMgAHEEQCACIABrIAAgA2pBACABa3FqIQYLIAQgBk8NBSAGQf7///8HSw0FQcTTACgCACIDBEBBvNMAKAIAIgcgBmohASABIAdNDQYgASADSw0GCyAGEDMiASAARw0BDAcLIAYgA2sgB3EiBkH+////B0sNBCAGEDMhACAAIAEoAgAgASgCBGpGDQMgACEBCwJAIAYgBEHIAGpPDQAgAUF/Rg0AQezTACgCACIAIAUgBmtqQQAgAGtxIgBB/v///wdLBEAgASEADAcLIAAQM0F/RwRAIAAgBmohBiABIQAMBwtBACAGaxAzGgwECyABIgBBf0cNBQwDC0EAIQMMDAtBACEADAoLIABBf0cNAgtByNMAQcjTACgCAEEEcjYCAAsgAkH+////B0sNASACEDMhAEEAEDMhASAAQX9GDQEgAUF/Rg0BIAAgAU8NASABIABrIgYgBEE4ak0NAQtBvNMAQbzTACgCACAGaiIBNgIAQcDTACgCACABSQRAQcDTACABNgIACwJAAkACQEGk0AAoAgAiAgRAQczTACEBA0AgACABKAIAIgMgASgCBCIFakYNAiABKAIIIgENAAsMAgtBnNAAKAIAIgFBAEcgACABT3FFBEBBnNAAIAA2AgALQQAhAUHQ0wAgBjYCAEHM0wAgADYCAEGs0ABBfzYCAEGw0ABB5NMAKAIANgIAQdjTAEEANgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBeCAAa0EPcSIBIABqIgIgBkE4ayIDIAFrIgFBAXI2AgRBqNAAQfTTACgCADYCAEGY0AAgATYCAEGk0AAgAjYCACAAIANqQTg2AgQMAgsgACACTQ0AIAIgA0kNACABKAIMQQhxDQBBeCACa0EPcSIAIAJqIgNBmNAAKAIAIAZqIgcgAGsiAEEBcjYCBCABIAUgBmo2AgRBqNAAQfTTACgCADYCAEGY0AAgADYCAEGk0AAgAzYCACACIAdqQTg2AgQMAQsgAEGc0AAoAgBJBEBBnNAAIAA2AgALIAAgBmohA0HM0wAhAQJAAkACQANAIAMgASgCAEcEQCABKAIIIgENAQwCCwsgAS0ADEEIcUUNAQtBzNMAIQEDQCABKAIAIgMgAk0EQCADIAEoAgRqIgUgAksNAwsgASgCCCEBDAALAAsgASAANgIAIAEgASgCBCAGajYCBCAAQXggAGtBD3FqIgkgBEEDcjYCBCADQXggA2tBD3FqIgYgBCAJaiIEayEBIAIgBkYEQEGk0AAgBDYCAEGY0ABBmNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEDAgLQaDQACgCACAGRgRAQaDQACAENgIAQZTQAEGU0AAoAgAgAWoiADYCACAEIABBAXI2AgQgACAEaiAANgIADAgLIAYoAgQiBUEDcUEBRw0GIAVBeHEhCCAFQf8BTQRAIAVBA3YhAyAGKAIIIgAgBigCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBwsgAiAANgIIIAAgAjYCDAwGCyAGKAIYIQcgBiAGKAIMIgBHBEAgACAGKAIIIgI2AgggAiAANgIMDAULIAZBFGoiAigCACIFRQRAIAYoAhAiBUUNBCAGQRBqIQILA0AgAiEDIAUiAEEUaiICKAIAIgUNACAAQRBqIQIgACgCECIFDQALIANBADYCAAwEC0F4IABrQQ9xIgEgAGoiByAGQThrIgMgAWsiAUEBcjYCBCAAIANqQTg2AgQgAiAFQTcgBWtBD3FqQT9rIgMgAyACQRBqSRsiA0EjNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAc2AgAgA0EQakHU0wApAgA3AgAgA0HM0wApAgA3AghB1NMAIANBCGo2AgBB0NMAIAY2AgBBzNMAIAA2AgBB2NMAQQA2AgAgA0EkaiEBA0AgAUEHNgIAIAUgAUEEaiIBSw0ACyACIANGDQAgAyADKAIEQX5xNgIEIAMgAyACayIFNgIAIAIgBUEBcjYCBCAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIDcUUEQEGM0AAgASADcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEGQ0AAoAgAiA0EBIAF0IgZxRQRAIAAgAjYCAEGQ0AAgAyAGcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQMCQANAIAMiACgCBEF4cSAFRg0BIAFBHXYhAyABQQF0IQEgACADQQRxakEQaiIGKAIAIgMNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAtBmNAAKAIAIgEgBE0NAEGk0AAoAgAiACAEaiICIAEgBGsiAUEBcjYCBEGY0AAgATYCAEGk0AAgAjYCACAAIARBA3I2AgQgAEEIaiEBDAgLQQAhAUH80wBBMDYCAAwHC0EAIQALIAdFDQACQCAGKAIcIgJBAnRBvNIAaiIDKAIAIAZGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAdBEEEUIAcoAhAgBkYbaiAANgIAIABFDQELIAAgBzYCGCAGKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAGQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAIaiEBIAYgCGoiBigCBCEFCyAGIAVBfnE2AgQgASAEaiABNgIAIAQgAUEBcjYCBCABQf8BTQRAIAFBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASABQQN2dCIBcUUEQEGM0AAgASACcjYCACAADAELIAAoAggLIgEgBDYCDCAAIAQ2AgggBCAANgIMIAQgATYCCAwBC0EfIQUgAUH///8HTQRAIAFBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohBQsgBCAFNgIcIARCADcCECAFQQJ0QbzSAGohAEGQ0AAoAgAiAkEBIAV0IgNxRQRAIAAgBDYCAEGQ0AAgAiADcjYCACAEIAA2AhggBCAENgIIIAQgBDYCDAwBCyABQRkgBUEBdmtBACAFQR9HG3QhBSAAKAIAIQACQANAIAAiAigCBEF4cSABRg0BIAVBHXYhACAFQQF0IQUgAiAAQQRxakEQaiIDKAIAIgANAAsgAyAENgIAIAQgAjYCGCAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgCUEIaiEBDAILAkAgB0UNAAJAIAMoAhwiAUECdEG80gBqIgIoAgAgA0YEQCACIAA2AgAgAA0BQZDQACAIQX4gAXdxIgg2AgAMAgsgB0EQQRQgBygCECADRhtqIAA2AgAgAEUNAQsgACAHNgIYIAMoAhAiAQRAIAAgATYCECABIAA2AhgLIANBFGooAgAiAUUNACAAQRRqIAE2AgAgASAANgIYCwJAIAVBD00EQCADIAQgBWoiAEEDcjYCBCAAIANqIgAgACgCBEEBcjYCBAwBCyADIARqIgIgBUEBcjYCBCADIARBA3I2AgQgAiAFaiAFNgIAIAVB/wFNBEAgBUF4cUG00ABqIQACf0GM0AAoAgAiAUEBIAVBA3Z0IgVxRQRAQYzQACABIAVyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRBvNIAaiEAQQEgAXQiBCAIcUUEQCAAIAI2AgBBkNAAIAQgCHI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEEAkADQCAEIgAoAgRBeHEgBUYNASABQR12IQQgAUEBdCEBIAAgBEEEcWpBEGoiBigCACIEDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLIANBCGohAQwBCwJAIAlFDQACQCAAKAIcIgFBAnRBvNIAaiICKAIAIABGBEAgAiADNgIAIAMNAUGQ0AAgC0F+IAF3cTYCAAwCCyAJQRBBFCAJKAIQIABGG2ogAzYCACADRQ0BCyADIAk2AhggACgCECIBBEAgAyABNgIQIAEgAzYCGAsgAEEUaigCACIBRQ0AIANBFGogATYCACABIAM2AhgLAkAgBUEPTQRAIAAgBCAFaiIBQQNyNgIEIAAgAWoiASABKAIEQQFyNgIEDAELIAAgBGoiByAFQQFyNgIEIAAgBEEDcjYCBCAFIAdqIAU2AgAgCARAIAhBeHFBtNAAaiEBQaDQACgCACEDAn9BASAIQQN2dCICIAZxRQRAQYzQACACIAZyNgIAIAEMAQsgASgCCAsiAiADNgIMIAEgAzYCCCADIAE2AgwgAyACNgIIC0Gg0AAgBzYCAEGU0AAgBTYCAAsgAEEIaiEBCyAKQRBqJAAgAQtDACAARQRAPwBBEHQPCwJAIABB//8DcQ0AIABBAEgNACAAQRB2QAAiAEF/RgRAQfzTAEEwNgIAQX8PCyAAQRB0DwsACwvcPyIAQYAICwkBAAAAAgAAAAMAQZQICwUEAAAABQBBpAgLCQYAAAAHAAAACABB3AgLii1JbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AFJlc3BvbnNlIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zAFVzZXIgY2FsbGJhY2sgZXJyb3IAYG9uX3Jlc2V0YCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfaGVhZGVyYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9iZWdpbmAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3N0YXR1c19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3ZlcnNpb25fY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl91cmxfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXRob2RfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfZmllbGRfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fbmFtZWAgY2FsbGJhY2sgZXJyb3IAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzZXJ2ZXIASW52YWxpZCBoZWFkZXIgdmFsdWUgY2hhcgBJbnZhbGlkIGhlYWRlciBmaWVsZCBjaGFyAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdmVyc2lvbgBJbnZhbGlkIG1pbm9yIHZlcnNpb24ASW52YWxpZCBtYWpvciB2ZXJzaW9uAEV4cGVjdGVkIHNwYWNlIGFmdGVyIHZlcnNpb24ARXhwZWN0ZWQgQ1JMRiBhZnRlciB2ZXJzaW9uAEludmFsaWQgSFRUUCB2ZXJzaW9uAEludmFsaWQgaGVhZGVyIHRva2VuAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdXJsAEludmFsaWQgY2hhcmFjdGVycyBpbiB1cmwAVW5leHBlY3RlZCBzdGFydCBjaGFyIGluIHVybABEb3VibGUgQCBpbiB1cmwARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgARHVwbGljYXRlIENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhciBpbiB1cmwgcGF0aABDb250ZW50LUxlbmd0aCBjYW4ndCBiZSBwcmVzZW50IHdpdGggVHJhbnNmZXItRW5jb2RpbmcASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgc2l6ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl92YWx1ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlZCB2YWx1ZQBQYXVzZWQgYnkgb25faGVhZGVyc19jb21wbGV0ZQBJbnZhbGlkIEVPRiBzdGF0ZQBvbl9yZXNldCBwYXVzZQBvbl9jaHVua19oZWFkZXIgcGF1c2UAb25fbWVzc2FnZV9iZWdpbiBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fdmFsdWUgcGF1c2UAb25fc3RhdHVzX2NvbXBsZXRlIHBhdXNlAG9uX3ZlcnNpb25fY29tcGxldGUgcGF1c2UAb25fdXJsX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXNzYWdlX2NvbXBsZXRlIHBhdXNlAG9uX21ldGhvZF9jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfZmllbGRfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUgcGF1c2UAVW5leHBlY3RlZCBzcGFjZSBhZnRlciBzdGFydCBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAFBhdXNlIG9uIENPTk5FQ1QvVXBncmFkZQBQYXVzZSBvbiBQUkkvVXBncmFkZQBFeHBlY3RlZCBIVFRQLzIgQ29ubmVjdGlvbiBQcmVmYWNlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fbWV0aG9kAEV4cGVjdGVkIHNwYWNlIGFmdGVyIG1ldGhvZABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl9maWVsZABQYXVzZWQASW52YWxpZCB3b3JkIGVuY291bnRlcmVkAEludmFsaWQgbWV0aG9kIGVuY291bnRlcmVkAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2NoZW1hAFJlcXVlc3QgaGFzIGludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYABTV0lUQ0hfUFJPWFkAVVNFX1BST1hZAE1LQUNUSVZJVFkAVU5QUk9DRVNTQUJMRV9FTlRJVFkAQ09QWQBNT1ZFRF9QRVJNQU5FTlRMWQBUT09fRUFSTFkATk9USUZZAEZBSUxFRF9ERVBFTkRFTkNZAEJBRF9HQVRFV0FZAFBMQVkAUFVUAENIRUNLT1VUAEdBVEVXQVlfVElNRU9VVABSRVFVRVNUX1RJTUVPVVQATkVUV09SS19DT05ORUNUX1RJTUVPVVQAQ09OTkVDVElPTl9USU1FT1VUAExPR0lOX1RJTUVPVVQATkVUV09SS19SRUFEX1RJTUVPVVQAUE9TVABNSVNESVJFQ1RFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX0xPQURfQkFMQU5DRURfUkVRVUVTVABCQURfUkVRVUVTVABIVFRQX1JFUVVFU1RfU0VOVF9UT19IVFRQU19QT1JUAFJFUE9SVABJTV9BX1RFQVBPVABSRVNFVF9DT05URU5UAE5PX0NPTlRFTlQAUEFSVElBTF9DT05URU5UAEhQRV9JTlZBTElEX0NPTlNUQU5UAEhQRV9DQl9SRVNFVABHRVQASFBFX1NUUklDVABDT05GTElDVABURU1QT1JBUllfUkVESVJFQ1QAUEVSTUFORU5UX1JFRElSRUNUAENPTk5FQ1QATVVMVElfU1RBVFVTAEhQRV9JTlZBTElEX1NUQVRVUwBUT09fTUFOWV9SRVFVRVNUUwBFQVJMWV9ISU5UUwBVTkFWQUlMQUJMRV9GT1JfTEVHQUxfUkVBU09OUwBPUFRJT05TAFNXSVRDSElOR19QUk9UT0NPTFMAVkFSSUFOVF9BTFNPX05FR09USUFURVMATVVMVElQTEVfQ0hPSUNFUwBJTlRFUk5BTF9TRVJWRVJfRVJST1IAV0VCX1NFUlZFUl9VTktOT1dOX0VSUk9SAFJBSUxHVU5fRVJST1IASURFTlRJVFlfUFJPVklERVJfQVVUSEVOVElDQVRJT05fRVJST1IAU1NMX0NFUlRJRklDQVRFX0VSUk9SAElOVkFMSURfWF9GT1JXQVJERURfRk9SAFNFVF9QQVJBTUVURVIAR0VUX1BBUkFNRVRFUgBIUEVfVVNFUgBTRUVfT1RIRVIASFBFX0NCX0NIVU5LX0hFQURFUgBNS0NBTEVOREFSAFNFVFVQAFdFQl9TRVJWRVJfSVNfRE9XTgBURUFSRE9XTgBIUEVfQ0xPU0VEX0NPTk5FQ1RJT04ASEVVUklTVElDX0VYUElSQVRJT04ARElTQ09OTkVDVEVEX09QRVJBVElPTgBOT05fQVVUSE9SSVRBVElWRV9JTkZPUk1BVElPTgBIUEVfSU5WQUxJRF9WRVJTSU9OAEhQRV9DQl9NRVNTQUdFX0JFR0lOAFNJVEVfSVNfRlJPWkVOAEhQRV9JTlZBTElEX0hFQURFUl9UT0tFTgBJTlZBTElEX1RPS0VOAEZPUkJJRERFTgBFTkhBTkNFX1lPVVJfQ0FMTQBIUEVfSU5WQUxJRF9VUkwAQkxPQ0tFRF9CWV9QQVJFTlRBTF9DT05UUk9MAE1LQ09MAEFDTABIUEVfSU5URVJOQUwAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRV9VTk9GRklDSUFMAEhQRV9PSwBVTkxJTksAVU5MT0NLAFBSSQBSRVRSWV9XSVRIAEhQRV9JTlZBTElEX0NPTlRFTlRfTEVOR1RIAEhQRV9VTkVYUEVDVEVEX0NPTlRFTlRfTEVOR1RIAEZMVVNIAFBST1BQQVRDSABNLVNFQVJDSABVUklfVE9PX0xPTkcAUFJPQ0VTU0lORwBNSVNDRUxMQU5FT1VTX1BFUlNJU1RFTlRfV0FSTklORwBNSVNDRUxMQU5FT1VTX1dBUk5JTkcASFBFX0lOVkFMSURfVFJBTlNGRVJfRU5DT0RJTkcARXhwZWN0ZWQgQ1JMRgBIUEVfSU5WQUxJRF9DSFVOS19TSVpFAE1PVkUAQ09OVElOVUUASFBFX0NCX1NUQVRVU19DT01QTEVURQBIUEVfQ0JfSEVBREVSU19DT01QTEVURQBIUEVfQ0JfVkVSU0lPTl9DT01QTEVURQBIUEVfQ0JfVVJMX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8AAF4TAAAmEwAAMBAAAPAXAACdEwAAFRIAADkXAADwEgAAChAAAHUSAACtEgAAghMAAE8UAAB/EAAAoBUAACMUAACJEgAAixQAAE0VAADUEQAAzxQAABAYAADJFgAA3BYAAMERAADgFwAAuxQAAHQUAAB8FQAA5RQAAAgXAAAfEAAAZRUAAKMUAAAoFQAAAhUAAJkVAAAsEAAAixkAAE8PAADUDgAAahAAAM4QAAACFwAAiQ4AAG4TAAAcEwAAZhQAAFYXAADBEwAAzRMAAGwTAABoFwAAZhcAAF8XAAAiEwAAzg8AAGkOAADYDgAAYxYAAMsTAACqDgAAKBcAACYXAADFEwAAXRYAAOgRAABnEwAAZRMAAPIWAABzEwAAHRcAAPkWAADzEQAAzw4AAM4VAAAMEgAAsxEAAKURAABhEAAAMhcAALsTAEH5NQsBAQBBkDYL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB/TcLAQEAQZE4C14CAwICAgICAAACAgACAgACAgICAgICAgICAAQAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEH9OQsBAQBBkToLXgIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAQfA7Cw1sb3NlZWVwLWFsaXZlAEGJPAsBAQBBoDwL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBiT4LAQEAQaA+C+cBAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAEGwwAALXwEBAAEBAQEBAAABAQABAQABAQEBAQEBAQEBAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAEGQwgALIWVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgBBwMIACy1yYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AQfnCAAsFAQIAAQMAQZDDAAvgAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH5xAALBQECAAEDAEGQxQAL4AEEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cYACwQBAAABAEGRxwAL3wEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH6yAALBAEAAAIAQZDJAAtfAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv","base64")});var sMn=I((erf,oMn)=>{"use strict";p();var{Buffer:ops}=require("node:buffer");oMn.exports=ops.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK77MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtzACAAQRBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAA/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQTBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQSBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQd0BNgIcCwYAIAAQMguaLQELfyMAQRBrIgokAEGk0AAoAgAiCUUEQEHk0wAoAgAiBUUEQEHw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBCGpBcHFB2KrVqgVzIgU2AgBB+NMAQQA2AgBByNMAQQA2AgALQczTAEGA1AQ2AgBBnNAAQYDUBDYCAEGw0AAgBTYCAEGs0ABBfzYCAEHQ0wBBgKwDNgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBjNQEQcGrAzYCAEGo0ABB9NMAKAIANgIAQZjQAEHAqwM2AgBBpNAAQYjUBDYCAEHM/wdBODYCAEGI1AQhCQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQewBTQRAQYzQACgCACIGQRAgAEETakFwcSAAQQtJGyIEQQN2IgB2IgFBA3EEQAJAIAFBAXEgAHJBAXMiAkEDdCIAQbTQAGoiASAAQbzQAGooAgAiACgCCCIDRgRAQYzQACAGQX4gAndxNgIADAELIAEgAzYCCCADIAE2AgwLIABBCGohASAAIAJBA3QiAkEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwRC0GU0AAoAgAiCCAETw0BIAEEQAJAQQIgAHQiAkEAIAJrciABIAB0cWgiAEEDdCICQbTQAGoiASACQbzQAGooAgAiAigCCCIDRgRAQYzQACAGQX4gAHdxIgY2AgAMAQsgASADNgIIIAMgATYCDAsgAiAEQQNyNgIEIABBA3QiACAEayEFIAAgAmogBTYCACACIARqIgQgBUEBcjYCBCAIBEAgCEF4cUG00ABqIQBBoNAAKAIAIQMCf0EBIAhBA3Z0IgEgBnFFBEBBjNAAIAEgBnI2AgAgAAwBCyAAKAIICyIBIAM2AgwgACADNgIIIAMgADYCDCADIAE2AggLIAJBCGohAUGg0AAgBDYCAEGU0AAgBTYCAAwRC0GQ0AAoAgAiC0UNASALaEECdEG80gBqKAIAIgAoAgRBeHEgBGshBSAAIQIDQAJAIAIoAhAiAUUEQCACQRRqKAIAIgFFDQELIAEoAgRBeHEgBGsiAyAFSSECIAMgBSACGyEFIAEgACACGyEAIAEhAgwBCwsgACgCGCEJIAAoAgwiAyAARwRAQZzQACgCABogAyAAKAIIIgE2AgggASADNgIMDBALIABBFGoiAigCACIBRQRAIAAoAhAiAUUNAyAAQRBqIQILA0AgAiEHIAEiA0EUaiICKAIAIgENACADQRBqIQIgAygCECIBDQALIAdBADYCAAwPC0F/IQQgAEG/f0sNACAAQRNqIgFBcHEhBEGQ0AAoAgAiCEUNAEEAIARrIQUCQAJAAkACf0EAIARBgAJJDQAaQR8gBEH///8HSw0AGiAEQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qCyIGQQJ0QbzSAGooAgAiAkUEQEEAIQFBACEDDAELQQAhASAEQRkgBkEBdmtBACAGQR9HG3QhAEEAIQMDQAJAIAIoAgRBeHEgBGsiByAFTw0AIAIhAyAHIgUNAEEAIQUgAiEBDAMLIAEgAkEUaigCACIHIAcgAiAAQR12QQRxakEQaigCACICRhsgASAHGyEBIABBAXQhACACDQALCyABIANyRQRAQQAhA0ECIAZ0IgBBACAAa3IgCHEiAEUNAyAAaEECdEG80gBqKAIAIQELIAFFDQELA0AgASgCBEF4cSAEayICIAVJIQAgAiAFIAAbIQUgASADIAAbIQMgASgCECIABH8gAAUgAUEUaigCAAsiAQ0ACwsgA0UNACAFQZTQACgCACAEa08NACADKAIYIQcgAyADKAIMIgBHBEBBnNAAKAIAGiAAIAMoAggiATYCCCABIAA2AgwMDgsgA0EUaiICKAIAIgFFBEAgAygCECIBRQ0DIANBEGohAgsDQCACIQYgASIAQRRqIgIoAgAiAQ0AIABBEGohAiAAKAIQIgENAAsgBkEANgIADA0LQZTQACgCACIDIARPBEBBoNAAKAIAIQECQCADIARrIgJBEE8EQCABIARqIgAgAkEBcjYCBCABIANqIAI2AgAgASAEQQNyNgIEDAELIAEgA0EDcjYCBCABIANqIgAgACgCBEEBcjYCBEEAIQBBACECC0GU0AAgAjYCAEGg0AAgADYCACABQQhqIQEMDwtBmNAAKAIAIgMgBEsEQCAEIAlqIgAgAyAEayIBQQFyNgIEQaTQACAANgIAQZjQACABNgIAIAkgBEEDcjYCBCAJQQhqIQEMDwtBACEBIAQCf0Hk0wAoAgAEQEHs0wAoAgAMAQtB8NMAQn83AgBB6NMAQoCAhICAgMAANwIAQeTTACAKQQxqQXBxQdiq1aoFczYCAEH40wBBADYCAEHI0wBBADYCAEGAgAQLIgAgBEHHAGoiBWoiBkEAIABrIgdxIgJPBEBB/NMAQTA2AgAMDwsCQEHE0wAoAgAiAUUNAEG80wAoAgAiCCACaiEAIAAgAU0gACAIS3ENAEEAIQFB/NMAQTA2AgAMDwtByNMALQAAQQRxDQQCQAJAIAkEQEHM0wAhAQNAIAEoAgAiACAJTQRAIAAgASgCBGogCUsNAwsgASgCCCIBDQALC0EAEDMiAEF/Rg0FIAIhBkHo0wAoAgAiAUEBayIDIABxBEAgAiAAayAAIANqQQAgAWtxaiEGCyAEIAZPDQUgBkH+////B0sNBUHE0wAoAgAiAwRAQbzTACgCACIHIAZqIQEgASAHTQ0GIAEgA0sNBgsgBhAzIgEgAEcNAQwHCyAGIANrIAdxIgZB/v///wdLDQQgBhAzIQAgACABKAIAIAEoAgRqRg0DIAAhAQsCQCAGIARByABqTw0AIAFBf0YNAEHs0wAoAgAiACAFIAZrakEAIABrcSIAQf7///8HSwRAIAEhAAwHCyAAEDNBf0cEQCAAIAZqIQYgASEADAcLQQAgBmsQMxoMBAsgASIAQX9HDQUMAwtBACEDDAwLQQAhAAwKCyAAQX9HDQILQcjTAEHI0wAoAgBBBHI2AgALIAJB/v///wdLDQEgAhAzIQBBABAzIQEgAEF/Rg0BIAFBf0YNASAAIAFPDQEgASAAayIGIARBOGpNDQELQbzTAEG80wAoAgAgBmoiATYCAEHA0wAoAgAgAUkEQEHA0wAgATYCAAsCQAJAAkBBpNAAKAIAIgIEQEHM0wAhAQNAIAAgASgCACIDIAEoAgQiBWpGDQIgASgCCCIBDQALDAILQZzQACgCACIBQQBHIAAgAU9xRQRAQZzQACAANgIAC0EAIQFB0NMAIAY2AgBBzNMAIAA2AgBBrNAAQX82AgBBsNAAQeTTACgCADYCAEHY0wBBADYCAANAIAFByNAAaiABQbzQAGoiAjYCACACIAFBtNAAaiIDNgIAIAFBwNAAaiADNgIAIAFB0NAAaiABQcTQAGoiAzYCACADIAI2AgAgAUHY0ABqIAFBzNAAaiICNgIAIAIgAzYCACABQdTQAGogAjYCACABQSBqIgFBgAJHDQALQXggAGtBD3EiASAAaiICIAZBOGsiAyABayIBQQFyNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAI2AgAgACADakE4NgIEDAILIAAgAk0NACACIANJDQAgASgCDEEIcQ0AQXggAmtBD3EiACACaiIDQZjQACgCACAGaiIHIABrIgBBAXI2AgQgASAFIAZqNgIEQajQAEH00wAoAgA2AgBBmNAAIAA2AgBBpNAAIAM2AgAgAiAHakE4NgIEDAELIABBnNAAKAIASQRAQZzQACAANgIACyAAIAZqIQNBzNMAIQECQAJAAkADQCADIAEoAgBHBEAgASgCCCIBDQEMAgsLIAEtAAxBCHFFDQELQczTACEBA0AgASgCACIDIAJNBEAgAyABKAIEaiIFIAJLDQMLIAEoAgghAQwACwALIAEgADYCACABIAEoAgQgBmo2AgQgAEF4IABrQQ9xaiIJIARBA3I2AgQgA0F4IANrQQ9xaiIGIAQgCWoiBGshASACIAZGBEBBpNAAIAQ2AgBBmNAAQZjQACgCACABaiIANgIAIAQgAEEBcjYCBAwIC0Gg0AAoAgAgBkYEQEGg0AAgBDYCAEGU0ABBlNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEIAAgBGogADYCAAwICyAGKAIEIgVBA3FBAUcNBiAFQXhxIQggBUH/AU0EQCAFQQN2IQMgBigCCCIAIAYoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAcLIAIgADYCCCAAIAI2AgwMBgsgBigCGCEHIAYgBigCDCIARwRAIAAgBigCCCICNgIIIAIgADYCDAwFCyAGQRRqIgIoAgAiBUUEQCAGKAIQIgVFDQQgBkEQaiECCwNAIAIhAyAFIgBBFGoiAigCACIFDQAgAEEQaiECIAAoAhAiBQ0ACyADQQA2AgAMBAtBeCAAa0EPcSIBIABqIgcgBkE4ayIDIAFrIgFBAXI2AgQgACADakE4NgIEIAIgBUE3IAVrQQ9xakE/ayIDIAMgAkEQakkbIgNBIzYCBEGo0ABB9NMAKAIANgIAQZjQACABNgIAQaTQACAHNgIAIANBEGpB1NMAKQIANwIAIANBzNMAKQIANwIIQdTTACADQQhqNgIAQdDTACAGNgIAQczTACAANgIAQdjTAEEANgIAIANBJGohAQNAIAFBBzYCACAFIAFBBGoiAUsNAAsgAiADRg0AIAMgAygCBEF+cTYCBCADIAMgAmsiBTYCACACIAVBAXI2AgQgBUH/AU0EQCAFQXhxQbTQAGohAAJ/QYzQACgCACIBQQEgBUEDdnQiA3FFBEBBjNAAIAEgA3I2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEG80gBqIQBBkNAAKAIAIgNBASABdCIGcUUEQCAAIAI2AgBBkNAAIAMgBnI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEDAkADQCADIgAoAgRBeHEgBUYNASABQR12IQMgAUEBdCEBIAAgA0EEcWpBEGoiBigCACIDDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLQZjQACgCACIBIARNDQBBpNAAKAIAIgAgBGoiAiABIARrIgFBAXI2AgRBmNAAIAE2AgBBpNAAIAI2AgAgACAEQQNyNgIEIABBCGohAQwIC0EAIQFB/NMAQTA2AgAMBwtBACEACyAHRQ0AAkAgBigCHCICQQJ0QbzSAGoiAygCACAGRgRAIAMgADYCACAADQFBkNAAQZDQACgCAEF+IAJ3cTYCAAwCCyAHQRBBFCAHKAIQIAZGG2ogADYCACAARQ0BCyAAIAc2AhggBigCECICBEAgACACNgIQIAIgADYCGAsgBkEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgCGohASAGIAhqIgYoAgQhBQsgBiAFQX5xNgIEIAEgBGogATYCACAEIAFBAXI2AgQgAUH/AU0EQCABQXhxQbTQAGohAAJ/QYzQACgCACICQQEgAUEDdnQiAXFFBEBBjNAAIAEgAnI2AgAgAAwBCyAAKAIICyIBIAQ2AgwgACAENgIIIAQgADYCDCAEIAE2AggMAQtBHyEFIAFB////B00EQCABQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qIQULIAQgBTYCHCAEQgA3AhAgBUECdEG80gBqIQBBkNAAKAIAIgJBASAFdCIDcUUEQCAAIAQ2AgBBkNAAIAIgA3I2AgAgBCAANgIYIAQgBDYCCCAEIAQ2AgwMAQsgAUEZIAVBAXZrQQAgBUEfRxt0IQUgACgCACEAAkADQCAAIgIoAgRBeHEgAUYNASAFQR12IQAgBUEBdCEFIAIgAEEEcWpBEGoiAygCACIADQALIAMgBDYCACAEIAI2AhggBCAENgIMIAQgBDYCCAwBCyACKAIIIgAgBDYCDCACIAQ2AgggBEEANgIYIAQgAjYCDCAEIAA2AggLIAlBCGohAQwCCwJAIAdFDQACQCADKAIcIgFBAnRBvNIAaiICKAIAIANGBEAgAiAANgIAIAANAUGQ0AAgCEF+IAF3cSIINgIADAILIAdBEEEUIAcoAhAgA0YbaiAANgIAIABFDQELIAAgBzYCGCADKAIQIgEEQCAAIAE2AhAgASAANgIYCyADQRRqKAIAIgFFDQAgAEEUaiABNgIAIAEgADYCGAsCQCAFQQ9NBEAgAyAEIAVqIgBBA3I2AgQgACADaiIAIAAoAgRBAXI2AgQMAQsgAyAEaiICIAVBAXI2AgQgAyAEQQNyNgIEIAIgBWogBTYCACAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIFcUUEQEGM0AAgASAFcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEEBIAF0IgQgCHFFBEAgACACNgIAQZDQACAEIAhyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhBAJAA0AgBCIAKAIEQXhxIAVGDQEgAUEddiEEIAFBAXQhASAAIARBBHFqQRBqIgYoAgAiBA0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIICyADQQhqIQEMAQsCQCAJRQ0AAkAgACgCHCIBQQJ0QbzSAGoiAigCACAARgRAIAIgAzYCACADDQFBkNAAIAtBfiABd3E2AgAMAgsgCUEQQRQgCSgCECAARhtqIAM2AgAgA0UNAQsgAyAJNgIYIAAoAhAiAQRAIAMgATYCECABIAM2AhgLIABBFGooAgAiAUUNACADQRRqIAE2AgAgASADNgIYCwJAIAVBD00EQCAAIAQgBWoiAUEDcjYCBCAAIAFqIgEgASgCBEEBcjYCBAwBCyAAIARqIgcgBUEBcjYCBCAAIARBA3I2AgQgBSAHaiAFNgIAIAgEQCAIQXhxQbTQAGohAUGg0AAoAgAhAwJ/QQEgCEEDdnQiAiAGcUUEQEGM0AAgAiAGcjYCACABDAELIAEoAggLIgIgAzYCDCABIAM2AgggAyABNgIMIAMgAjYCCAtBoNAAIAc2AgBBlNAAIAU2AgALIABBCGohAQsgCkEQaiQAIAELQwAgAEUEQD8AQRB0DwsCQCAAQf//A3ENACAAQQBIDQAgAEEQdkAAIgBBf0YEQEH80wBBMDYCAEF/DwsgAEEQdA8LAAsL3D8iAEGACAsJAQAAAAIAAAADAEGUCAsFBAAAAAUAQaQICwkGAAAABwAAAAgAQdwIC4otSW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwBB+TULAQEAQZA2C+ABAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQf03CwEBAEGROAteAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgBB/TkLAQEAQZE6C14CAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEHwOwsNbG9zZWVlcC1hbGl2ZQBBiTwLAQEAQaA8C+ABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQYk+CwEBAEGgPgvnAQEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZABBsMAAC18BAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBBkMIACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQcDCAAstcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQoNClNNDQoNClRUUC9DRS9UU1AvAEH5wgALBQECAAEDAEGQwwAL4AEEAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cQACwUBAgABAwBBkMUAC+ABBAEBBQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQfnGAAsEAQAAAQBBkccAC98BAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+sgACwQBAAACAEGQyQALXwMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==","base64")});var _ke=I((rrf,hMn)=>{"use strict";p();var aMn=["GET","HEAD","POST"],sps=new Set(aMn),aps=[101,204,205,304],cMn=[301,302,303,307,308],cps=new Set(cMn),lMn=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"],lps=new Set(lMn),uMn=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],ups=new Set(uMn),dps=["follow","manual","error"],dMn=["GET","HEAD","OPTIONS","TRACE"],fps=new Set(dMn),pps=["navigate","same-origin","no-cors","cors"],hps=["omit","same-origin","include"],mps=["default","no-store","reload","no-cache","force-cache","only-if-cached"],gps=["content-encoding","content-language","content-location","content-type","content-length"],Aps=["half"],fMn=["CONNECT","TRACE","TRACK"],yps=new Set(fMn),pMn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],Eps=new Set(pMn);hMn.exports={subresource:pMn,forbiddenMethods:fMn,requestBodyHeader:gps,referrerPolicy:uMn,requestRedirect:dps,requestMode:pps,requestCredentials:hps,requestCache:mps,redirectStatus:cMn,corsSafeListedMethods:aMn,nullBodyStatus:aps,safeMethods:dMn,badPorts:lMn,requestDuplex:Aps,subresourceSet:Eps,badPortsSet:lps,redirectStatusSet:cps,corsSafeListedMethodsSet:sps,safeMethodsSet:fps,forbiddenMethodsSet:yps,referrerPolicySet:ups}});var ger=I((irf,mMn)=>{"use strict";p();var mer=Symbol.for("undici.globalOrigin.1");function _ps(){return globalThis[mer]}a(_ps,"getGlobalOrigin");function vps(t){if(t===void 0){Object.defineProperty(globalThis,mer,{value:void 0,writable:!0,enumerable:!1,configurable:!1});return}let e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new TypeError(`Only http & https urls are allowed, received ${e.protocol}`);Object.defineProperty(globalThis,mer,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(vps,"setGlobalOrigin");mMn.exports={getGlobalOrigin:_ps,setGlobalOrigin:vps}});var sb=I((arf,CMn)=>{"use strict";p();var Int=require("node:assert"),Cps=new TextEncoder,vke=/^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/,bps=/[\u000A\u000D\u0009\u0020]/,Sps=/[\u0009\u000A\u000C\u000D\u0020]/g,Tps=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function Ips(t){Int(t.protocol==="data:");let e=yMn(t,!0);e=e.slice(5);let r={position:0},n=pfe(",",e,r),o=n.length;if(n=Dps(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=EMn(s);if(/;(\u0020){0,}base64$/i.test(n)){let u=vMn(c);if(c=wps(u),c==="failure")return"failure";n=n.slice(0,-6),n=n.replace(/(\u0020)+$/,""),n=n.slice(0,-1)}n.startsWith(";")&&(n="text/plain"+n);let l=Aer(n);return l==="failure"&&(l=Aer("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(Ips,"dataURLProcessor");function yMn(t,e=!1){if(!e)return t.href;let r=t.href,n=t.hash.length,o=n===0?r:r.substring(0,r.length-n);return!n&&r.endsWith("#")?o.slice(0,-1):o}a(yMn,"URLSerializer");function xnt(t,e,r){let n="";for(;r.position=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(gMn,"isHexCharByte");function AMn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(AMn,"hexByteToNumber");function xps(t){let e=t.length,r=new Uint8Array(e),n=0;for(let o=0;ot.length)return"failure";e.position++;let n=pfe(";",t,e);if(n=Tnt(n,!1,!0),n.length===0||!vke.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionbps.test(d),t,e);let l=xnt(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.positiont.length)break;let u=null;if(t[e.position]==='"')u=_Mn(t,e,!0),pfe(";",t,e);else if(u=pfe(";",t,e),u=Tnt(u,!1,!0),u.length===0)continue;l.length!==0&&vke.test(l)&&(u.length===0||Tps.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(Aer,"parseMIMEType");function wps(t){t=t.replace(Sps,"");let e=t.length;if(e%4===0&&t.charCodeAt(e-1)===61&&(--e,t.charCodeAt(e-1)===61&&--e),e%4===1||/[^+/0-9A-Za-z]/.test(t.length===e?t:t.substring(0,e)))return"failure";let r=Buffer.from(t,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}a(wps,"forgivingBase64");function _Mn(t,e,r){let n=e.position,o="";for(Int(t[e.position]==='"'),e.position++;o+=xnt(c=>c!=='"'&&c!=="\\",t,e),!(e.position>=t.length);){let s=t[e.position];if(e.position++,s==="\\"){if(e.position>=t.length){o+="\\";break}o+=t[e.position],e.position++}else{Int(s==='"');break}}return r?o:t.slice(n,e.position)}a(_Mn,"collectAnHTTPQuotedString");function Rps(t){Int(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",vke.test(s)||(s=s.replace(/(\\|")/g,"\\$1"),s='"'+s,s+='"'),n+=s;return n}a(Rps,"serializeAMimeType");function kps(t){return t===13||t===10||t===9||t===32}a(kps,"isHTTPWhiteSpace");function Tnt(t,e=!0,r=!0){return yer(t,e,r,kps)}a(Tnt,"removeHTTPWhitespace");function Pps(t){return t===13||t===10||t===9||t===12||t===32}a(Pps,"isASCIIWhitespace");function Dps(t,e=!0,r=!0){return yer(t,e,r,Pps)}a(Dps,"removeASCIIWhitespace");function yer(t,e,r,n){let o=0,s=t.length-1;if(e)for(;o0&&n(t.charCodeAt(s));)s--;return o===0&&s===t.length-1?t:t.slice(o,s+1)}a(yer,"removeChars");function vMn(t){let e=t.length;if(65535>e)return String.fromCharCode.apply(null,t);let r="",n=0,o=65535;for(;ne&&(o=e-n),r+=String.fromCharCode.apply(null,t.subarray(n,n+=o));return r}a(vMn,"isomorphicDecode");function Nps(t){switch(t.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return t.subtype.endsWith("+json")?"application/json":t.subtype.endsWith("+xml")?"application/xml":""}a(Nps,"minimizeSupportedMimeType");CMn.exports={dataURLProcessor:Ips,URLSerializer:yMn,collectASequenceOfCodePoints:xnt,collectASequenceOfCodePointsFast:pfe,stringPercentDecode:EMn,parseMIMEType:Aer,collectAnHTTPQuotedString:_Mn,serializeAMimeType:Rps,removeChars:yer,removeHTTPWhitespace:Tnt,minimizeSupportedMimeType:Nps,HTTP_TOKEN_CODEPOINTS:vke,isomorphicDecode:vMn}});var GA=I((urf,bMn)=>{"use strict";p();var{types:m5,inspect:Mps}=require("node:util"),{markAsUncloneable:Ops}=require("node:worker_threads"),{toUSVString:Lps}=js(),Er={};Er.converters={};Er.util={};Er.errors={};Er.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};Er.errors.conversionFailed=function(t){let e=t.types.length===1?"":" one of",r=`${t.argument} could not be converted to${e}: ${t.types.join(", ")}.`;return Er.errors.exception({header:t.prefix,message:r})};Er.errors.invalidArgument=function(t){return Er.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};Er.brandCheck=function(t,e,r){if(r?.strict!==!1){if(!(t instanceof e)){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}else if(t?.[Symbol.toStringTag]!==e.prototype[Symbol.toStringTag]){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}};Er.argumentLengthCheck=function({length:t},e,r){if(t{});Er.util.ConvertToInt=function(t,e,r,n){let o,s;e===64?(o=Math.pow(2,53)-1,r==="unsigned"?s=0:s=Math.pow(-2,53)+1):r==="unsigned"?(s=0,o=Math.pow(2,e)-1):(s=Math.pow(-2,e)-1,o=Math.pow(2,e-1)-1);let c=Number(t);if(c===0&&(c=0),n?.enforceRange===!0){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw Er.errors.exception({header:"Integer conversion",message:`Could not convert ${Er.util.Stringify(t)} to an integer.`});if(c=Er.util.IntegerPart(c),co)throw Er.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&&n?.clamp===!0?(c=Math.min(Math.max(c,s),o),Math.floor(c)%2===0?c=Math.floor(c):c=Math.ceil(c),c):Number.isNaN(c)||c===0&&Object.is(0,c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY?0:(c=Er.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e)-1?c-Math.pow(2,e):c)};Er.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};Er.util.Stringify=function(t){switch(Er.util.Type(t)){case"Symbol":return`Symbol(${t.description})`;case"Object":return Mps(t);case"String":return`"${t}"`;default:return`${t}`}};Er.sequenceConverter=function(t){return(e,r,n,o)=>{if(Er.util.Type(e)!=="Object")throw Er.errors.exception({header:r,message:`${n} (${Er.util.Stringify(e)}) is not iterable.`});let s=typeof o=="function"?o():e?.[Symbol.iterator]?.(),c=[],l=0;if(s===void 0||typeof s.next!="function")throw Er.errors.exception({header:r,message:`${n} is not iterable.`});for(;;){let{done:u,value:d}=s.next();if(u)break;c.push(t(d,r,`${n}[${l++}]`))}return c}};Er.recordConverter=function(t,e){return(r,n,o)=>{if(Er.util.Type(r)!=="Object")throw Er.errors.exception({header:n,message:`${o} ("${Er.util.Type(r)}") is not an Object.`});let s={};if(!m5.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=t(u,n,o),f=e(r[u],n,o);s[d]=f}return s}let c=Reflect.ownKeys(r);for(let l of c)if(Reflect.getOwnPropertyDescriptor(r,l)?.enumerable){let d=t(l,n,o),f=e(r[l],n,o);s[d]=f}return s}};Er.interfaceConverter=function(t){return(e,r,n,o)=>{if(o?.strict!==!1&&!(e instanceof t))throw Er.errors.exception({header:r,message:`Expected ${n} ("${Er.util.Stringify(e)}") to be an instance of ${t.name}.`});return e}};Er.dictionaryConverter=function(t){return(e,r,n)=>{let o=Er.util.Type(e),s={};if(o==="Null"||o==="Undefined")return s;if(o!=="Object")throw Er.errors.exception({header:r,message:`Expected ${e} to be one of: Null, Undefined, Object.`});for(let c of t){let{key:l,defaultValue:u,required:d,converter:f}=c;if(d===!0&&!Object.hasOwn(e,l))throw Er.errors.exception({header:r,message:`Missing required key "${l}".`});let h=e[l],m=Object.hasOwn(c,"defaultValue");if(m&&h!==null&&(h??=u()),d||m||h!==void 0){if(h=f(h,r,`${n}.${l}`),c.allowedValues&&!c.allowedValues.includes(h))throw Er.errors.exception({header:r,message:`${h} is not an accepted type. Expected one of ${c.allowedValues.join(", ")}.`});s[l]=h}}return s}};Er.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};Er.converters.DOMString=function(t,e,r,n){if(t===null&&n?.legacyNullToEmptyString)return"";if(typeof t=="symbol")throw Er.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};Er.converters.ByteString=function(t,e,r){let n=Er.converters.DOMString(t,e,r);for(let o=0;o255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${o} has a value of ${n.charCodeAt(o)} which is greater than 255.`);return n};Er.converters.USVString=Lps;Er.converters.boolean=function(t){return!!t};Er.converters.any=function(t){return t};Er.converters["long long"]=function(t,e,r){return Er.util.ConvertToInt(t,64,"signed",void 0,e,r)};Er.converters["unsigned long long"]=function(t,e,r){return Er.util.ConvertToInt(t,64,"unsigned",void 0,e,r)};Er.converters["unsigned long"]=function(t,e,r){return Er.util.ConvertToInt(t,32,"unsigned",void 0,e,r)};Er.converters["unsigned short"]=function(t,e,r,n){return Er.util.ConvertToInt(t,16,"unsigned",n,e,r)};Er.converters.ArrayBuffer=function(t,e,r,n){if(Er.util.Type(t)!=="Object"||!m5.isAnyArrayBuffer(t))throw Er.errors.conversionFailed({prefix:e,argument:`${r} ("${Er.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(n?.allowShared===!1&&m5.isSharedArrayBuffer(t))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.resizable||t.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.TypedArray=function(t,e,r,n,o){if(Er.util.Type(t)!=="Object"||!m5.isTypedArray(t)||t.constructor.name!==e.name)throw Er.errors.conversionFailed({prefix:r,argument:`${n} ("${Er.util.Stringify(t)}")`,types:[e.name]});if(o?.allowShared===!1&&m5.isSharedArrayBuffer(t.buffer))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.DataView=function(t,e,r,n){if(Er.util.Type(t)!=="Object"||!m5.isDataView(t))throw Er.errors.exception({header:e,message:`${r} is not a DataView.`});if(n?.allowShared===!1&&m5.isSharedArrayBuffer(t.buffer))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.BufferSource=function(t,e,r,n){if(m5.isAnyArrayBuffer(t))return Er.converters.ArrayBuffer(t,e,r,{...n,allowShared:!1});if(m5.isTypedArray(t))return Er.converters.TypedArray(t,t.constructor,e,r,{...n,allowShared:!1});if(m5.isDataView(t))return Er.converters.DataView(t,e,r,{...n,allowShared:!1});throw Er.errors.conversionFailed({prefix:e,argument:`${r} ("${Er.util.Stringify(t)}")`,types:["BufferSource"]})};Er.converters["sequence"]=Er.sequenceConverter(Er.converters.ByteString);Er.converters["sequence>"]=Er.sequenceConverter(Er.converters["sequence"]);Er.converters["record"]=Er.recordConverter(Er.converters.ByteString,Er.converters.ByteString);bMn.exports={webidl:Er}});var pT=I((frf,BMn)=>{"use strict";p();var{Transform:Bps}=require("node:stream"),SMn=require("node:zlib"),{redirectStatusSet:Fps,referrerPolicySet:Ups,badPortsSet:Qps}=_ke(),{getGlobalOrigin:TMn}=ger(),{collectASequenceOfCodePoints:ZJ,collectAnHTTPQuotedString:qps,removeChars:jps,parseMIMEType:Hps}=sb(),{performance:Gps}=require("node:perf_hooks"),{isBlobLike:$ps,ReadableStreamFrom:Vps,isValidHTTPToken:IMn,normalizedMethodRecordsBase:Wps}=js(),XJ=require("node:assert"),{isUint8Array:zps}=require("node:util/types"),{webidl:Cke}=GA(),xMn=[],Rnt;try{Rnt=require("node:crypto");let t=["sha256","sha384","sha512"];xMn=Rnt.getHashes().filter(e=>t.includes(e))}catch{}function wMn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(wMn,"responseURL");function Yps(t,e){if(!Fps.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&kMn(r)&&(RMn(r)||(r=Kps(r)),r=new URL(r,wMn(t))),r&&!r.hash&&(r.hash=e),r}a(Yps,"responseLocationURL");function RMn(t){for(let e=0;e126||r<32)return!1}return!0}a(RMn,"isValidEncodedURL");function Kps(t){return Buffer.from(t,"binary").toString("utf8")}a(Kps,"normalizeBinaryStringToUtf8");function Ske(t){return t.urlList[t.urlList.length-1]}a(Ske,"requestCurrentURL");function Jps(t){let e=Ske(t);return OMn(e)&&Qps.has(e.port)?"blocked":"allowed"}a(Jps,"requestBadPort");function Zps(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(Zps,"isErrorLike");function Xps(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(Xps,"isValidReasonPhrase");var ehs=IMn;function kMn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` +`)||t.includes("\r")||t.includes("\0"))===!1}a(kMn,"isValidHeaderValue");function ths(t,e){let{headersList:r}=e,n=(r.get("referrer-policy",!0)??"").split(","),o="";if(n.length>0)for(let s=n.length;s!==0;s--){let c=n[s-1].trim();if(Ups.has(c)){o=c;break}}o!==""&&(t.referrerPolicy=o)}a(ths,"setRequestReferrerPolicyOnRedirect");function rhs(){return"allowed"}a(rhs,"crossOriginResourcePolicyCheck");function nhs(){return"success"}a(nhs,"corsCheck");function ihs(){return"success"}a(ihs,"TAOCheck");function ohs(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(ohs,"appendFetchMetadata");function shs(t){let e=t.origin;if(!(e==="client"||e===void 0)){if(t.responseTainting==="cors"||t.mode==="websocket")t.headersList.append("origin",e,!0);else if(t.method!=="GET"&&t.method!=="HEAD"){switch(t.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":t.origin&&_er(t.origin)&&!_er(Ske(t))&&(e=null);break;case"same-origin":knt(t,Ske(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(shs,"appendRequestOriginHeader");function hfe(t,e){return t}a(hfe,"coarsenTime");function ahs(t,e,r){return!t?.startTime||t.startTime4096&&(n=o);let s=knt(t,n),c=bke(n)&&!bke(t.url);switch(e){case"origin":return o??Eer(r,!0);case"unsafe-url":return n;case"same-origin":return s?o:"no-referrer";case"origin-when-cross-origin":return s?n:o;case"strict-origin-when-cross-origin":{let l=Ske(t);return knt(n,l)?n:bke(n)&&!bke(l)?"no-referrer":o}default:return c?"no-referrer":o}}a(dhs,"determineRequestsReferrer");function Eer(t,e){return XJ(t instanceof URL),t=new URL(t),t.protocol==="file:"||t.protocol==="about:"||t.protocol==="blank:"?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}a(Eer,"stripURLForReferrer");function bke(t){if(!(t instanceof URL))return!1;if(t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="file:")return!0;return e(t.origin);function e(r){if(r==null||r==="null")return!1;let n=new URL(r);return!!(n.protocol==="https:"||n.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(n.hostname)||n.hostname==="localhost"||n.hostname.includes("localhost.")||n.hostname.endsWith(".localhost"))}}a(bke,"isURLPotentiallyTrustworthy");function fhs(t,e){if(Rnt===void 0)return!0;let r=DMn(e);if(r==="no metadata"||r.length===0)return!0;let n=hhs(r),o=mhs(r,n);for(let s of o){let c=s.algo,l=s.hash,u=Rnt.createHash(c).update(t).digest("base64");if(u[u.length-1]==="="&&(u[u.length-2]==="="?u=u.slice(0,-2):u=u.slice(0,-1)),ghs(u,l))return!0}return!1}a(fhs,"bytesMatch");var phs=/(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function DMn(t){let e=[],r=!0;for(let n of t.split(" ")){r=!1;let o=phs.exec(n);if(o===null||o.groups===void 0||o.groups.algo===void 0)continue;let s=o.groups.algo.toLowerCase();xMn.includes(s)&&e.push(o.groups)}return r===!0?"no metadata":e}a(DMn,"parseMetadata");function hhs(t){let e=t[0].algo;if(e[3]==="5")return e;for(let r=1;r{t=n,e=o}),resolve:t,reject:e}}a(yhs,"createDeferredPromise");function Ehs(t){return t.controller.state==="aborted"}a(Ehs,"isAborted");function _hs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(_hs,"isCancelled");function vhs(t){return Wps[t.toLowerCase()]??t}a(vhs,"normalizeMethod");function Chs(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return XJ(typeof e=="string"),e}a(Chs,"serializeJavascriptValueToJSONString");var bhs=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function NMn(t,e,r=0,n=1){class o{static{a(this,"FastIterableIterator")}#e;#t;#r;constructor(c,l){this.#e=c,this.#t=l,this.#r=0}next(){if(typeof this!="object"||this===null||!(#e in this))throw new TypeError(`'next' called on an object that does not implement interface ${t} Iterator.`);let c=this.#r,l=this.#e[e],u=l.length;if(c>=u)return{value:void 0,done:!0};let{[r]:d,[n]:f}=l[c];this.#r=c+1;let h;switch(this.#t){case"key":h=d;break;case"value":h=f;break;case"key+value":h=[d,f];break}return{value:h,done:!1}}}return delete o.prototype.constructor,Object.setPrototypeOf(o.prototype,bhs),Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${t} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(s,c){return new o(s,c)}}a(NMn,"createIterator");function Shs(t,e,r,n=0,o=1){let s=NMn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Cke.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Cke.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Cke.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(Cke.brandCheck(this,e),Cke.argumentLengthCheck(arguments,1,`${t}.forEach`),typeof u!="function")throw new TypeError(`Failed to execute 'forEach' on '${t}': parameter 1 is not of type 'Function'.`);for(let{0:f,1:h}of s(this,"key+value"))u.call(d,h,f,this)},"forEach")}};return Object.defineProperties(e.prototype,{...c,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:c.entries.value}})}a(Shs,"iteratorMixin");async function Ths(t,e,r){let n=e,o=r,s;try{s=t.stream.getReader()}catch(c){o(c);return}try{n(await MMn(s))}catch(c){o(c)}}a(Ths,"fullyReadBody");function Ihs(t){return t instanceof ReadableStream||t[Symbol.toStringTag]==="ReadableStream"&&typeof t.tee=="function"}a(Ihs,"isReadableStreamLike");function xhs(t){try{t.close(),t.byobRequest?.respond(0)}catch(e){if(!e.message.includes("Controller is already closed")&&!e.message.includes("ReadableStream is already closed"))throw e}}a(xhs,"readableStreamClose");var whs=/[^\x00-\xFF]/;function wnt(t){return XJ(!whs.test(t)),t}a(wnt,"isomorphicEncode");async function MMn(t){let e=[],r=0;for(;;){let{done:n,value:o}=await t.read();if(n)return Buffer.concat(e,r);if(!zps(o))throw new TypeError("Received non-Uint8Array chunk");e.push(o),r+=o.length}}a(MMn,"readAllBytes");function Rhs(t){XJ("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(Rhs,"urlIsLocal");function _er(t){return typeof t=="string"&&t[5]===":"&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&t[4]==="s"||t.protocol==="https:"}a(_er,"urlHasHttpsScheme");function OMn(t){XJ("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(OMn,"urlIsHttpHttpsScheme");function khs(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&ZJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&ZJ(u=>u===" "||u===" ",r,n);let o=ZJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&ZJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&ZJ(u=>u===" "||u===" ",r,n);let c=ZJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),l=c.length?Number(c):null;return n.positionl?"failure":{rangeStartValue:s,rangeEndValue:l}}a(khs,"simpleRangeHeaderValue");function Phs(t,e,r){let n="bytes ";return n+=wnt(`${t}`),n+="-",n+=wnt(`${e}`),n+="/",n+=wnt(`${r}`),n}a(Phs,"buildContentRange");var ver=class extends Bps{static{a(this,"InflateStream")}#e;constructor(e){super(),this.#e=e}_transform(e,r,n){if(!this._inflateStream){if(e.length===0){n();return}this._inflateStream=(e[0]&15)===8?SMn.createInflate(this.#e):SMn.createInflateRaw(this.#e),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",o=>this.destroy(o))}this._inflateStream.write(e,r,n)}_final(e){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),e()}};function Dhs(t){return new ver(t)}a(Dhs,"createInflate");function Nhs(t){let e=null,r=null,n=null,o=LMn("content-type",t);if(o===null)return"failure";for(let s of o){let c=Hps(s);c==="failure"||c.essence==="*/*"||(n=c,n.essence!==r?(e=null,n.parameters.has("charset")&&(e=n.parameters.get("charset")),r=n.essence):!n.parameters.has("charset")&&e!==null&&n.parameters.set("charset",e))}return n??"failure"}a(Nhs,"extractMimeType");function Mhs(t){let e=t,r={position:0},n=[],o="";for(;r.positions!=='"'&&s!==",",e,r),r.positions===9||s===32),n.push(o),o=""}return n}a(Mhs,"gettingDecodingSplitting");function LMn(t,e){let r=e.get(t,!0);return r===null?null:Mhs(r)}a(LMn,"getDecodeSplit");var Ohs=new TextDecoder;function Lhs(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),Ohs.decode(t))}a(Lhs,"utf8DecodeBytes");var Cer=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return TMn()}get origin(){return this.baseUrl?.origin}policyContainer=PMn()},ber=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new Cer},Bhs=new ber;BMn.exports={isAborted:Ehs,isCancelled:_hs,isValidEncodedURL:RMn,createDeferredPromise:yhs,ReadableStreamFrom:Vps,tryUpgradeRequestToAPotentiallyTrustworthyURL:Ahs,clampAndCoarsenConnectionTimingInfo:ahs,coarsenedSharedCurrentTime:chs,determineRequestsReferrer:dhs,makePolicyContainer:PMn,clonePolicyContainer:uhs,appendFetchMetadata:ohs,appendRequestOriginHeader:shs,TAOCheck:ihs,corsCheck:nhs,crossOriginResourcePolicyCheck:rhs,createOpaqueTimingInfo:lhs,setRequestReferrerPolicyOnRedirect:ths,isValidHTTPToken:IMn,requestBadPort:Jps,requestCurrentURL:Ske,responseURL:wMn,responseLocationURL:Yps,isBlobLike:$ps,isURLPotentiallyTrustworthy:bke,isValidReasonPhrase:Xps,sameOrigin:knt,normalizeMethod:vhs,serializeJavascriptValueToJSONString:Chs,iteratorMixin:Shs,createIterator:NMn,isValidHeaderName:ehs,isValidHeaderValue:kMn,isErrorLike:Zps,fullyReadBody:Ths,bytesMatch:fhs,isReadableStreamLike:Ihs,readableStreamClose:xhs,isomorphicEncode:wnt,urlIsLocal:Rhs,urlHasHttpsScheme:_er,urlIsHttpHttpsScheme:OMn,readAllBytes:MMn,simpleRangeHeaderValue:khs,buildContentRange:Phs,parseMetadata:DMn,createInflate:Dhs,extractMimeType:Nhs,getDecodeSplit:LMn,utf8DecodeBytes:Lhs,environmentSettingsObject:Bhs}});var Ej=I((mrf,FMn)=>{"use strict";p();FMn.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kDispatcher:Symbol("dispatcher")}});var Ter=I((Arf,UMn)=>{"use strict";p();var{Blob:Fhs,File:Uhs}=require("node:buffer"),{kState:FF}=Ej(),{webidl:g5}=GA(),Ser=class t{static{a(this,"FileLike")}constructor(e,r,n={}){let o=r,s=n.type,c=n.lastModified??Date.now();this[FF]={blobLike:e,name:o,type:s,lastModified:c}}stream(...e){return g5.brandCheck(this,t),this[FF].blobLike.stream(...e)}arrayBuffer(...e){return g5.brandCheck(this,t),this[FF].blobLike.arrayBuffer(...e)}slice(...e){return g5.brandCheck(this,t),this[FF].blobLike.slice(...e)}text(...e){return g5.brandCheck(this,t),this[FF].blobLike.text(...e)}get size(){return g5.brandCheck(this,t),this[FF].blobLike.size}get type(){return g5.brandCheck(this,t),this[FF].blobLike.type}get name(){return g5.brandCheck(this,t),this[FF].name}get lastModified(){return g5.brandCheck(this,t),this[FF].lastModified}get[Symbol.toStringTag](){return"File"}};g5.converters.Blob=g5.interfaceConverter(Fhs);function Qhs(t){return t instanceof Uhs||t&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&t[Symbol.toStringTag]==="File"}a(Qhs,"isFileLike");UMn.exports={FileLike:Ser,isFileLike:Qhs}});var Ike=I((_rf,GMn)=>{"use strict";p();var{isBlobLike:Pnt,iteratorMixin:qhs}=pT(),{kState:av}=Ej(),{kEnumerableProperty:mfe}=js(),{FileLike:QMn,isFileLike:jhs}=Ter(),{webidl:xu}=GA(),{File:HMn}=require("node:buffer"),qMn=require("node:util"),jMn=globalThis.File??HMn,Tke=class t{static{a(this,"FormData")}constructor(e){if(xu.util.markAsUncloneable(this),e!==void 0)throw xu.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[av]=[]}append(e,r,n=void 0){xu.brandCheck(this,t);let o="FormData.append";if(xu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!Pnt(r))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");e=xu.converters.USVString(e,o,"name"),r=Pnt(r)?xu.converters.Blob(r,o,"value",{strict:!1}):xu.converters.USVString(r,o,"value"),n=arguments.length===3?xu.converters.USVString(n,o,"filename"):void 0;let s=Ier(e,r,n);this[av].push(s)}delete(e){xu.brandCheck(this,t);let r="FormData.delete";xu.argumentLengthCheck(arguments,1,r),e=xu.converters.USVString(e,r,"name"),this[av]=this[av].filter(n=>n.name!==e)}get(e){xu.brandCheck(this,t);let r="FormData.get";xu.argumentLengthCheck(arguments,1,r),e=xu.converters.USVString(e,r,"name");let n=this[av].findIndex(o=>o.name===e);return n===-1?null:this[av][n].value}getAll(e){xu.brandCheck(this,t);let r="FormData.getAll";return xu.argumentLengthCheck(arguments,1,r),e=xu.converters.USVString(e,r,"name"),this[av].filter(n=>n.name===e).map(n=>n.value)}has(e){xu.brandCheck(this,t);let r="FormData.has";return xu.argumentLengthCheck(arguments,1,r),e=xu.converters.USVString(e,r,"name"),this[av].findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){xu.brandCheck(this,t);let o="FormData.set";if(xu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!Pnt(r))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");e=xu.converters.USVString(e,o,"name"),r=Pnt(r)?xu.converters.Blob(r,o,"name",{strict:!1}):xu.converters.USVString(r,o,"name"),n=arguments.length===3?xu.converters.USVString(n,o,"name"):void 0;let s=Ier(e,r,n),c=this[av].findIndex(l=>l.name===e);c!==-1?this[av]=[...this[av].slice(0,c),s,...this[av].slice(c+1).filter(l=>l.name!==e)]:this[av].push(s)}[qMn.inspect.custom](e,r){let n=this[av].reduce((s,c)=>(s[c.name]?Array.isArray(s[c.name])?s[c.name].push(c.value):s[c.name]=[s[c.name],c.value]:s[c.name]=c.value,s),{__proto__:null});r.depth??=e,r.colors??=!0;let o=qMn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}};qhs("FormData",Tke,av,"name","value");Object.defineProperties(Tke.prototype,{append:mfe,delete:mfe,get:mfe,getAll:mfe,has:mfe,set:mfe,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function Ier(t,e,r){if(typeof e!="string"){if(jhs(e)||(e=e instanceof Blob?new jMn([e],"blob",{type:e.type}):new QMn(e,"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=e instanceof HMn?new jMn([e],r,n):new QMn(e,r,n)}}return{name:t,value:e}}a(Ier,"makeEntry");GMn.exports={FormData:Tke,makeEntry:Ier}});var KMn=I((brf,YMn)=>{"use strict";p();var{isUSVString:$Mn,bufferToLowerCasedHeaderName:Hhs}=js(),{utf8DecodeBytes:Ghs}=pT(),{HTTP_TOKEN_CODEPOINTS:$hs,isomorphicDecode:VMn}=sb(),{isFileLike:Vhs}=Ter(),{makeEntry:Whs}=Ike(),Dnt=require("node:assert"),{File:zhs}=require("node:buffer"),Yhs=globalThis.File??zhs,Khs=Buffer.from('form-data; name="'),WMn=Buffer.from("; filename"),Jhs=Buffer.from("--"),Zhs=Buffer.from(`--\r +`);function Xhs(t){for(let e=0;e70)return!1;for(let r=0;r=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||n===39||n===45||n===95))return!1}return!0}a(ems,"validateBoundary");function tms(t,e){Dnt(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)return"failure";let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0};for(;t[s.position]===13&&t[s.position+1]===10;)s.position+=2;let c=t.length;for(;t[c-1]===10&&t[c-2]===13;)c-=2;for(c!==t.length&&(t=t.subarray(0,c));;){if(t.subarray(s.position,s.position+n.length).equals(n))s.position+=n.length;else return"failure";if(s.position===t.length-2&&Nnt(t,Jhs,s)||s.position===t.length-4&&Nnt(t,Zhs,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let l=rms(t,s);if(l==="failure")return"failure";let{name:u,filename:d,contentType:f,encoding:h}=l;s.position+=2;let m;{let A=t.indexOf(n.subarray(2),s.position);if(A===-1)return"failure";m=t.subarray(s.position,A-4),s.position+=m.length,h==="base64"&&(m=Buffer.from(m.toString(),"base64"))}if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let g;d!==null?(f??="text/plain",Xhs(f)||(f=""),g=new Yhs([m],d,{type:f})):g=Ghs(Buffer.from(m)),Dnt($Mn(u)),Dnt(typeof g=="string"&&$Mn(g)||Vhs(g)),o.push(Whs(u,g,d))}}a(tms,"multipartFormDataParser");function rms(t,e){let r=null,n=null,o=null,s=null;for(;;){if(t[e.position]===13&&t[e.position+1]===10)return r===null?"failure":{name:r,filename:n,contentType:o,encoding:s};let c=gfe(l=>l!==10&&l!==13&&l!==58,t,e);if(c=xer(c,!0,!0,l=>l===9||l===32),!$hs.test(c.toString())||t[e.position]!==58)return"failure";switch(e.position++,gfe(l=>l===32||l===9,t,e),Hhs(c)){case"content-disposition":{if(r=n=null,!Nnt(t,Khs,e)||(e.position+=17,r=zMn(t,e),r===null))return"failure";if(Nnt(t,WMn,e)){let l=e.position+WMn.length;if(t[l]===42&&(e.position+=1,l+=1),t[l]!==61||t[l+1]!==34||(e.position+=12,n=zMn(t,e),n===null))return"failure"}break}case"content-type":{let l=gfe(u=>u!==10&&u!==13,t,e);l=xer(l,!1,!0,u=>u===9||u===32),o=VMn(l);break}case"content-transfer-encoding":{let l=gfe(u=>u!==10&&u!==13,t,e);l=xer(l,!1,!0,u=>u===9||u===32),s=VMn(l);break}default:gfe(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13&&t[e.position+1]!==10)return"failure";e.position+=2}}a(rms,"parseMultipartFormDataHeaders");function zMn(t,e){Dnt(t[e.position-1]===34);let r=gfe(n=>n!==10&&n!==13&&n!==34,t,e);return t[e.position]!==34?null:(e.position++,r=new TextDecoder().decode(r).replace(/%0A/ig,` +`).replace(/%0D/ig,"\r").replace(/%22/g,'"'),r)}a(zMn,"parseMultipartFormDataName");function gfe(t,e,r){let n=r.position;for(;n0&&n(t[s]);)s--;return o===0&&s===t.length-1?t:t.subarray(o,s+1)}a(xer,"removeChars");function Nnt(t,e,r){if(t.length{"use strict";p();var xke=js(),{ReadableStreamFrom:nms,isBlobLike:JMn,isReadableStreamLike:ims,readableStreamClose:oms,createDeferredPromise:sms,fullyReadBody:ams,extractMimeType:cms,utf8DecodeBytes:eOn}=pT(),{FormData:ZMn}=Ike(),{kState:yfe}=Ej(),{webidl:lms}=GA(),{Blob:ums}=require("node:buffer"),wer=require("node:assert"),{isErrored:tOn,isDisturbed:dms}=require("node:stream"),{isArrayBuffer:fms}=require("node:util/types"),{serializeAMimeType:pms}=sb(),{multipartFormDataParser:hms}=KMn(),Rer;try{let t=require("node:crypto");Rer=a(e=>t.randomInt(0,e),"random")}catch{Rer=a(t=>Math.floor(Math.random(t)),"random")}var Mnt=new TextEncoder;function mms(){}a(mms,"noop");var rOn=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,nOn;rOn&&(nOn=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!dms(e)&&!tOn(e)&&e.cancel("Response object has been garbage collected").catch(mms)}));function iOn(t,e=!1){let r=null;t instanceof ReadableStream?r=t:JMn(t)?r=t.stream():r=new ReadableStream({async pull(u){let d=typeof o=="string"?Mnt.encode(o):o;d.byteLength&&u.enqueue(d),queueMicrotask(()=>oms(u))},start(){},type:"bytes"}),wer(ims(r));let n=null,o=null,s=null,c=null;if(typeof t=="string")o=t,c="text/plain;charset=UTF-8";else if(t instanceof URLSearchParams)o=t.toString(),c="application/x-www-form-urlencoded;charset=UTF-8";else if(fms(t))o=new Uint8Array(t.slice());else if(ArrayBuffer.isView(t))o=new Uint8Array(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength));else if(xke.isFormDataLike(t)){let u=`----formdata-undici-0${`${Rer(1e11)}`.padStart(11,"0")}`,d=`--${u}\r Content-Disposition: form-data`;let f=a(E=>E.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"escape"),h=a(E=>E.replace(/\r?\n|\r/g,`\r -`),"normalizeLinefeeds"),m=[],g=new Uint8Array([13,10]);s=0;let A=!1;for(let[E,_]of t)if(typeof _=="string"){let v=snt.encode(d+`; name="${f(h(E))}"\r +`),"normalizeLinefeeds"),m=[],g=new Uint8Array([13,10]);s=0;let A=!1;for(let[E,_]of t)if(typeof _=="string"){let v=Mnt.encode(d+`; name="${f(h(E))}"\r \r ${h(_)}\r -`);m.push(v),s+=v.byteLength}else{let v=snt.encode(`${d}; name="${f(h(E))}"`+(_.name?`; filename="${f(_.name)}"`:"")+`\r +`);m.push(v),s+=v.byteLength}else{let v=Mnt.encode(`${d}; name="${f(h(E))}"`+(_.name?`; filename="${f(_.name)}"`:"")+`\r Content-Type: ${_.type||"application/octet-stream"}\r \r -`);m.push(v,_,g),typeof _.size=="number"?s+=v.byteLength+_.size+g.byteLength:A=!0}let y=snt.encode(`--${u}--\r -`);m.push(y),s+=y.byteLength,A&&(s=null),o=t,n=a(async function*(){for(let E of m)E.stream?yield*E.stream():yield E},"action"),c=`multipart/form-data; boundary=${u}`}else if(mNn(t))o=t,s=t.size,t.type&&(c=t.type);else if(typeof t[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(ake.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=t instanceof ReadableStream?t:Yfs(t)}if((typeof o=="string"||ake.isBuffer(o))&&(s=Buffer.byteLength(o)),n!=null){let u;r=new ReadableStream({async start(){u=n(t)[Symbol.asyncIterator]()},async pull(d){let{value:f,done:h}=await u.next();if(h)queueMicrotask(()=>{d.close(),d.byobRequest?.respond(0)});else if(!ENn(r)){let m=new Uint8Array(f);m.byteLength&&d.enqueue(m)}return d.desiredSize>0},async cancel(d){await u.return()},type:"bytes"})}return[{stream:r,source:o,length:s},c]}a(CNn,"extractBody");function cps(t,e=!1){return t instanceof ReadableStream&&(LXt(!ake.isDisturbed(t),"The body has already been consumed."),LXt(!t.locked,"The stream is locked.")),CNn(t,e)}a(cps,"safelyExtractBody");function lps(t,e){let[r,n]=e.stream.tee();return e.stream=r,{stream:n,length:e.length,source:e.source}}a(lps,"cloneBody");function ups(t){if(t.aborted)throw new DOMException("The operation was aborted.","AbortError")}a(ups,"throwIfAborted");function dps(t){return{blob(){return rfe(this,r=>{let n=ANn(this);return n===null?n="":n&&(n=ops(n)),new rps([r],{type:n})},t)},arrayBuffer(){return rfe(this,r=>new Uint8Array(r).buffer,t)},text(){return rfe(this,yNn,t)},json(){return rfe(this,pps,t)},formData(){return rfe(this,r=>{let n=ANn(this);if(n!==null)switch(n.essence){case"multipart/form-data":{let o=sps(r,n);if(o==="failure")throw new TypeError("Failed to parse body as FormData.");let s=new gNn;return s[nfe]=o,s}case"application/x-www-form-urlencoded":{let o=new URLSearchParams(r.toString()),s=new gNn;for(let[c,l]of o)s.append(c,l);return s}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t)},bytes(){return rfe(this,r=>new Uint8Array(r),t)}}}a(dps,"bodyMixinMethods");function fps(t){Object.assign(t.prototype,dps(t))}a(fps,"mixinBody");async function rfe(t,e,r){if(tps.brandCheck(t,r),bNn(t))throw new TypeError("Body is unusable: Body has already been read");ups(t[nfe]);let n=Zfs(),o=a(c=>n.reject(c),"errorSteps"),s=a(c=>{try{n.resolve(e(c))}catch(l){o(l)}},"successSteps");return t[nfe].body==null?(s(Buffer.allocUnsafe(0)),n.promise):(await Xfs(t[nfe].body,s,o),n.promise)}a(rfe,"consumeBody");function bNn(t){let e=t[nfe].body;return e!=null&&(e.stream.locked||ake.isDisturbed(e.stream))}a(bNn,"bodyUnusable");function pps(t){return JSON.parse(yNn(t))}a(pps,"parseJSONFromBytes");function ANn(t){let e=t[nfe].headersList,r=eps(e);return r==="failure"?null:r}a(ANn,"bodyMimeType");SNn.exports={extractBody:CNn,safelyExtractBody:cps,cloneBody:lps,mixinBody:fps,streamRegistry:vNn,hasFinalizationRegistry:_Nn,bodyUnusable:bNn}});var ONn=I((gXd,MNn)=>{"use strict";p();var Hi=require("node:assert"),Ao=qs(),{channels:TNn}=$de(),FXt=EXt(),{RequestContentLengthMismatchError:GJ,ResponseContentLengthMismatchError:hps,RequestAbortedError:PNn,HeadersTimeoutError:mps,HeadersOverflowError:gps,SocketError:fnt,InformationalError:ofe,BodyTimeoutError:Aps,HTTPParserError:yps,ResponseExceededMaxSizeError:Eps}=Ec(),{kUrl:DNn,kReset:ib,kClient:jXt,kParser:dp,kBlocking:uke,kRunning:yE,kPending:_ps,kSize:INn,kWriting:aj,kQueue:u2,kNoRef:cke,kKeepAliveDefaultTimeout:vps,kHostHeader:Cps,kPendingIdx:bps,kRunningIdx:vw,kError:Cw,kPipelining:unt,kSocket:sfe,kKeepAliveTimeoutValue:pnt,kMaxHeadersSize:UXt,kKeepAliveMaxTimeout:Sps,kKeepAliveTimeoutThreshold:Tps,kHeadersTimeout:Ips,kBodyTimeout:xps,kStrictContentLength:HXt,kMaxRequests:xNn,kCounter:wps,kMaxResponseSize:Rps,kOnError:kps,kResume:sj,kHTTPContext:NNn}=jd(),d5=vDn(),Pps=Buffer.alloc(0),ant=Buffer[Symbol.species],cnt=Ao.addListener,Dps=Ao.removeAllListeners,QXt;async function Nps(){let t=process.env.JEST_WORKER_ID?CXt():void 0,e;try{e=await WebAssembly.compile(SDn())}catch{e=await WebAssembly.compile(t||CXt())}return await WebAssembly.instantiate(e,{env:{wasm_on_url:a((r,n,o)=>0,"wasm_on_url"),wasm_on_status:a((r,n,o)=>{Hi(A0.ptr===r);let s=n-p5+f5.byteOffset;return A0.onStatus(new ant(f5.buffer,s,o))||0},"wasm_on_status"),wasm_on_message_begin:a(r=>(Hi(A0.ptr===r),A0.onMessageBegin()||0),"wasm_on_message_begin"),wasm_on_header_field:a((r,n,o)=>{Hi(A0.ptr===r);let s=n-p5+f5.byteOffset;return A0.onHeaderField(new ant(f5.buffer,s,o))||0},"wasm_on_header_field"),wasm_on_header_value:a((r,n,o)=>{Hi(A0.ptr===r);let s=n-p5+f5.byteOffset;return A0.onHeaderValue(new ant(f5.buffer,s,o))||0},"wasm_on_header_value"),wasm_on_headers_complete:a((r,n,o,s)=>(Hi(A0.ptr===r),A0.onHeadersComplete(n,!!o,!!s)||0),"wasm_on_headers_complete"),wasm_on_body:a((r,n,o)=>{Hi(A0.ptr===r);let s=n-p5+f5.byteOffset;return A0.onBody(new ant(f5.buffer,s,o))||0},"wasm_on_body"),wasm_on_message_complete:a(r=>(Hi(A0.ptr===r),A0.onMessageComplete()||0),"wasm_on_message_complete")}})}a(Nps,"lazyllhttp");var qXt=null,GXt=Nps();GXt.catch();var A0=null,f5=null,lnt=0,p5=null,Mps=0,lke=1,afe=2|lke,dnt=4|lke,$Xt=8|Mps,VXt=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){Hi(Number.isFinite(e[UXt])&&e[UXt]>0),this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(d5.TYPE.RESPONSE),this.client=e,this.socket=r,this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.statusCode=null,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[UXt],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[Rps]}setTimeout(e,r){e!==this.timeoutValue||r&lke^this.timeoutType&lke?(this.timeout&&(FXt.clearTimeout(this.timeout),this.timeout=null),e&&(r&lke?this.timeout=FXt.setFastTimeout(wNn,e,new WeakRef(this)):(this.timeout=setTimeout(wNn,e,new WeakRef(this)),this.timeout.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=r}resume(){this.socket.destroyed||!this.paused||(Hi(this.ptr!=null),Hi(A0==null),this.llhttp.llhttp_resume(this.ptr),Hi(this.timeoutType===dnt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||Pps),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Hi(this.ptr!=null),Hi(A0==null),Hi(!this.paused);let{socket:r,llhttp:n}=this;e.length>lnt&&(p5&&n.free(p5),lnt=Math.ceil(e.length/4096)*4096,p5=n.malloc(lnt)),new Uint8Array(n.memory.buffer,p5,lnt).set(e);try{let o;try{f5=e,A0=this,o=n.llhttp_execute(this.ptr,p5,e.length)}catch(c){throw c}finally{A0=null,f5=null}let s=n.llhttp_get_error_pos(this.ptr)-p5;if(o===d5.ERROR.PAUSED_UPGRADE)this.onUpgrade(e.slice(s));else if(o===d5.ERROR.PAUSED)this.paused=!0,r.unshift(e.slice(s));else if(o!==d5.ERROR.OK){let c=n.llhttp_get_error_reason(this.ptr),l="";if(c){let u=new Uint8Array(n.memory.buffer,c).indexOf(0);l="Response does not match the HTTP/1.1 protocol ("+Buffer.from(n.memory.buffer,c,u).toString()+")"}throw new yps(l,d5.ERROR[o],e.slice(s))}}catch(o){Ao.destroy(r,o)}}destroy(){Hi(this.ptr!=null),Hi(A0==null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&FXt.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){this.statusText=e.toString()}onMessageBegin(){let{socket:e,client:r}=this;if(e.destroyed)return-1;let n=r[u2][r[vw]];if(!n)return-1;n.onResponseStarted()}onHeaderField(e){let r=this.headers.length;(r&1)===0?this.headers.push(e):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]),this.trackHeader(e.length)}onHeaderValue(e){let r=this.headers.length;(r&1)===1?(this.headers.push(e),r+=1):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]);let n=this.headers[r-2];if(n.length===10){let o=Ao.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&Ao.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());this.trackHeader(e.length)}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&Ao.destroy(this.socket,new gps)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Hi(r),Hi(n[sfe]===o),Hi(!o.destroyed),Hi(!this.paused),Hi((s.length&1)===0);let l=n[u2][n[vw]];Hi(l),Hi(l.upgrade||l.method==="CONNECT"),this.statusCode=null,this.statusText="",this.shouldKeepAlive=null,this.headers=[],this.headersSize=0,o.unshift(e),o[dp].destroy(),o[dp]=null,o[jXt]=null,o[Cw]=null,Dps(o),n[sfe]=null,n[NNn]=null,n[u2][n[vw]++]=null,n.emit("disconnect",n[DNn],[n],new ofe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ao.destroy(o,u)}n[sj]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;let u=o[u2][o[vw]];if(!u)return-1;if(Hi(!this.upgrade),Hi(this.statusCode<200),e===100)return Ao.destroy(s,new fnt("bad response",Ao.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ao.destroy(s,new fnt("bad upgrade",Ao.getSocketInfo(s))),-1;if(Hi(this.timeoutType===afe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[ib]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[xps];this.setTimeout(f,dnt)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Hi(o[yE]===1),this.upgrade=!0,2;if(r)return Hi(o[yE]===1),this.upgrade=!0,2;if(Hi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[unt]){let f=this.keepAlive?Ao.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[Tps],o[Sps]);h<=0?s[ib]=!0:o[pnt]=h}else o[pnt]=o[vps]}else s[ib]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[uke]&&(s[uke]=!1,o[sj]()),d?d5.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[u2][r[vw]];if(Hi(c),Hi(this.timeoutType===dnt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Hi(o>=200),s>-1&&this.bytesRead+e.length>s)return Ao.destroy(n,new Eps),-1;if(this.bytesRead+=e.length,c.onData(e)===!1)return d5.ERROR.PAUSED}onMessageComplete(){let{client:e,socket:r,statusCode:n,upgrade:o,headers:s,contentLength:c,bytesRead:l,shouldKeepAlive:u}=this;if(r.destroyed&&(!n||u))return-1;if(o)return;Hi(n>=100),Hi((this.headers.length&1)===0);let d=e[u2][e[vw]];if(Hi(d),this.statusCode=null,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,!(n<200)){if(d.method!=="HEAD"&&c&&l!==parseInt(c,10))return Ao.destroy(r,new hps),-1;if(d.onComplete(s),e[u2][e[vw]++]=null,r[aj])return Hi(e[yE]===0),Ao.destroy(r,new ofe("reset")),d5.ERROR.PAUSED;if(u){if(r[ib]&&e[yE]===0)return Ao.destroy(r,new ofe("reset")),d5.ERROR.PAUSED;e[unt]==null||e[unt]===1?setImmediate(()=>e[sj]()):e[sj]()}else return Ao.destroy(r,new ofe("reset")),d5.ERROR.PAUSED}}};function wNn(t){let{socket:e,timeoutType:r,client:n,paused:o}=t.deref();r===afe?(!e[aj]||e.writableNeedDrain||n[yE]>1)&&(Hi(!o,"cannot be paused while waiting for headers"),Ao.destroy(e,new mps)):r===dnt?o||Ao.destroy(e,new Aps):r===$Xt&&(Hi(n[yE]===0&&n[pnt]),Ao.destroy(e,new ofe("socket idle timeout")))}a(wNn,"onParserTimeout");async function Ops(t,e){t[sfe]=e,qXt||(qXt=await GXt,GXt=null),e[cke]=!1,e[aj]=!1,e[ib]=!1,e[uke]=!1,e[dp]=new VXt(t,e,qXt),cnt(e,"error",function(n){Hi(n.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let o=this[dp];if(n.code==="ECONNRESET"&&o.statusCode&&!o.shouldKeepAlive){o.onMessageComplete();return}this[Cw]=n,this[jXt][kps](n)}),cnt(e,"readable",function(){let n=this[dp];n&&n.readMore()}),cnt(e,"end",function(){let n=this[dp];if(n.statusCode&&!n.shouldKeepAlive){n.onMessageComplete();return}Ao.destroy(this,new fnt("other side closed",Ao.getSocketInfo(this)))}),cnt(e,"close",function(){let n=this[jXt],o=this[dp];o&&(!this[Cw]&&o.statusCode&&!o.shouldKeepAlive&&o.onMessageComplete(),this[dp].destroy(),this[dp]=null);let s=this[Cw]||new fnt("closed",Ao.getSocketInfo(this));if(n[sfe]=null,n[NNn]=null,n.destroyed){Hi(n[_ps]===0);let c=n[u2].splice(n[vw]);for(let l=0;l0&&s.code!=="UND_ERR_INFO"){let c=n[u2][n[vw]];n[u2][n[vw]++]=null,Ao.errorRequest(n,c,s)}n[bps]=n[vw],Hi(n[yE]===0),n.emit("disconnect",n[DNn],[n],s),n[sj]()});let r=!1;return e.on("close",()=>{r=!0}),{version:"h1",defaultPipelining:1,write(...n){return Fps(t,...n)},resume(){Lps(t)},destroy(n,o){r?queueMicrotask(o):e.destroy(n).on("close",o)},get destroyed(){return e.destroyed},busy(n){return!!(e[aj]||e[ib]||e[uke]||n&&(t[yE]>0&&!n.idempotent||t[yE]>0&&(n.upgrade||n.method==="CONNECT")||t[yE]>0&&Ao.bodyLength(n.body)!==0&&(Ao.isStream(n.body)||Ao.isAsyncIterable(n.body)||Ao.isFormDataLike(n.body))))}}}a(Ops,"connectH1");function Lps(t){let e=t[sfe];if(e&&!e.destroyed){if(t[INn]===0?!e[cke]&&e.unref&&(e.unref(),e[cke]=!0):e[cke]&&e.ref&&(e.ref(),e[cke]=!1),t[INn]===0)e[dp].timeoutType!==$Xt&&e[dp].setTimeout(t[pnt],$Xt);else if(t[yE]>0&&e[dp].statusCode<200&&e[dp].timeoutType!==afe){let r=t[u2][t[vw]],n=r.headersTimeout!=null?r.headersTimeout:t[Ips];e[dp].setTimeout(n,afe)}}}a(Lps,"resumeH1");function Bps(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(Bps,"shouldSendContentLength");function Fps(t,e){let{method:r,path:n,host:o,upgrade:s,blocking:c,reset:l}=e,{body:u,headers:d,contentLength:f}=e,h=r==="PUT"||r==="POST"||r==="PATCH"||r==="QUERY"||r==="PROPFIND"||r==="PROPPATCH";if(Ao.isFormDataLike(u)){QXt||(QXt=ife().extractBody);let[E,_]=QXt(u);e.contentType==null&&d.push("content-type",_),u=E.stream,f=E.length}else Ao.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=Ao.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),Bps(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[HXt])return Ao.errorRequest(t,e,new GJ),!1;process.emitWarning(new GJ)}let g=t[sfe],A=a(E=>{e.aborted||e.completed||(Ao.errorRequest(t,e,E||new PNn),Ao.destroy(u),Ao.destroy(g,new ofe("aborted")))},"abort");try{e.onConnect(A)}catch(E){Ao.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[ib]=!0),(s||r==="CONNECT")&&(g[ib]=!0),l!=null&&(g[ib]=l),t[xNn]&&g[wps]++>=t[xNn]&&(g[ib]=!0),c&&(g[uke]=!0);let y=`${r} ${n} HTTP/1.1\r +`);m.push(v,_,g),typeof _.size=="number"?s+=v.byteLength+_.size+g.byteLength:A=!0}let y=Mnt.encode(`--${u}--\r +`);m.push(y),s+=y.byteLength,A&&(s=null),o=t,n=a(async function*(){for(let E of m)E.stream?yield*E.stream():yield E},"action"),c=`multipart/form-data; boundary=${u}`}else if(JMn(t))o=t,s=t.size,t.type&&(c=t.type);else if(typeof t[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(xke.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=t instanceof ReadableStream?t:nms(t)}if((typeof o=="string"||xke.isBuffer(o))&&(s=Buffer.byteLength(o)),n!=null){let u;r=new ReadableStream({async start(){u=n(t)[Symbol.asyncIterator]()},async pull(d){let{value:f,done:h}=await u.next();if(h)queueMicrotask(()=>{d.close(),d.byobRequest?.respond(0)});else if(!tOn(r)){let m=new Uint8Array(f);m.byteLength&&d.enqueue(m)}return d.desiredSize>0},async cancel(d){await u.return()},type:"bytes"})}return[{stream:r,source:o,length:s},c]}a(iOn,"extractBody");function gms(t,e=!1){return t instanceof ReadableStream&&(wer(!xke.isDisturbed(t),"The body has already been consumed."),wer(!t.locked,"The stream is locked.")),iOn(t,e)}a(gms,"safelyExtractBody");function Ams(t,e){let[r,n]=e.stream.tee();return e.stream=r,{stream:n,length:e.length,source:e.source}}a(Ams,"cloneBody");function yms(t){if(t.aborted)throw new DOMException("The operation was aborted.","AbortError")}a(yms,"throwIfAborted");function Ems(t){return{blob(){return Afe(this,r=>{let n=XMn(this);return n===null?n="":n&&(n=pms(n)),new ums([r],{type:n})},t)},arrayBuffer(){return Afe(this,r=>new Uint8Array(r).buffer,t)},text(){return Afe(this,eOn,t)},json(){return Afe(this,vms,t)},formData(){return Afe(this,r=>{let n=XMn(this);if(n!==null)switch(n.essence){case"multipart/form-data":{let o=hms(r,n);if(o==="failure")throw new TypeError("Failed to parse body as FormData.");let s=new ZMn;return s[yfe]=o,s}case"application/x-www-form-urlencoded":{let o=new URLSearchParams(r.toString()),s=new ZMn;for(let[c,l]of o)s.append(c,l);return s}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t)},bytes(){return Afe(this,r=>new Uint8Array(r),t)}}}a(Ems,"bodyMixinMethods");function _ms(t){Object.assign(t.prototype,Ems(t))}a(_ms,"mixinBody");async function Afe(t,e,r){if(lms.brandCheck(t,r),oOn(t))throw new TypeError("Body is unusable: Body has already been read");yms(t[yfe]);let n=sms(),o=a(c=>n.reject(c),"errorSteps"),s=a(c=>{try{n.resolve(e(c))}catch(l){o(l)}},"successSteps");return t[yfe].body==null?(s(Buffer.allocUnsafe(0)),n.promise):(await ams(t[yfe].body,s,o),n.promise)}a(Afe,"consumeBody");function oOn(t){let e=t[yfe].body;return e!=null&&(e.stream.locked||xke.isDisturbed(e.stream))}a(oOn,"bodyUnusable");function vms(t){return JSON.parse(eOn(t))}a(vms,"parseJSONFromBytes");function XMn(t){let e=t[yfe].headersList,r=cms(e);return r==="failure"?null:r}a(XMn,"bodyMimeType");sOn.exports={extractBody:iOn,safelyExtractBody:gms,cloneBody:Ams,mixinBody:_ms,streamRegistry:nOn,hasFinalizationRegistry:rOn,bodyUnusable:oOn}});var AOn=I((Rrf,gOn)=>{"use strict";p();var ji=require("node:assert"),Ao=js(),{channels:aOn}=sfe(),ker=der(),{RequestContentLengthMismatchError:eZ,ResponseContentLengthMismatchError:Cms,RequestAbortedError:pOn,HeadersTimeoutError:bms,HeadersOverflowError:Sms,SocketError:Qnt,InformationalError:_fe,BodyTimeoutError:Tms,HTTPParserError:Ims,ResponseExceededMaxSizeError:xms}=_c(),{kUrl:hOn,kReset:ab,kClient:Mer,kParser:hp,kBlocking:kke,kRunning:bE,kPending:wms,kSize:cOn,kWriting:vj,kQueue:y2,kNoRef:wke,kKeepAliveDefaultTimeout:Rms,kHostHeader:kms,kPendingIdx:Pms,kRunningIdx:Rw,kError:kw,kPipelining:Fnt,kSocket:vfe,kKeepAliveTimeoutValue:qnt,kMaxHeadersSize:Per,kKeepAliveMaxTimeout:Dms,kKeepAliveTimeoutThreshold:Nms,kHeadersTimeout:Mms,kBodyTimeout:Oms,kStrictContentLength:Oer,kMaxRequests:lOn,kCounter:Lms,kMaxResponseSize:Bms,kOnError:Fms,kResume:_j,kHTTPContext:mOn}=Wd(),A5=nMn(),Ums=Buffer.alloc(0),Ont=Buffer[Symbol.species],Lnt=Ao.addListener,Qms=Ao.removeAllListeners,Der;async function qms(){let t=process.env.JEST_WORKER_ID?her():void 0,e;try{e=await WebAssembly.compile(sMn())}catch{e=await WebAssembly.compile(t||her())}return await WebAssembly.instantiate(e,{env:{wasm_on_url:a((r,n,o)=>0,"wasm_on_url"),wasm_on_status:a((r,n,o)=>{ji(_0.ptr===r);let s=n-E5+y5.byteOffset;return _0.onStatus(new Ont(y5.buffer,s,o))||0},"wasm_on_status"),wasm_on_message_begin:a(r=>(ji(_0.ptr===r),_0.onMessageBegin()||0),"wasm_on_message_begin"),wasm_on_header_field:a((r,n,o)=>{ji(_0.ptr===r);let s=n-E5+y5.byteOffset;return _0.onHeaderField(new Ont(y5.buffer,s,o))||0},"wasm_on_header_field"),wasm_on_header_value:a((r,n,o)=>{ji(_0.ptr===r);let s=n-E5+y5.byteOffset;return _0.onHeaderValue(new Ont(y5.buffer,s,o))||0},"wasm_on_header_value"),wasm_on_headers_complete:a((r,n,o,s)=>(ji(_0.ptr===r),_0.onHeadersComplete(n,!!o,!!s)||0),"wasm_on_headers_complete"),wasm_on_body:a((r,n,o)=>{ji(_0.ptr===r);let s=n-E5+y5.byteOffset;return _0.onBody(new Ont(y5.buffer,s,o))||0},"wasm_on_body"),wasm_on_message_complete:a(r=>(ji(_0.ptr===r),_0.onMessageComplete()||0),"wasm_on_message_complete")}})}a(qms,"lazyllhttp");var Ner=null,Ler=qms();Ler.catch();var _0=null,y5=null,Bnt=0,E5=null,jms=0,Rke=1,Cfe=2|Rke,Unt=4|Rke,Ber=8|jms,Fer=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){ji(Number.isFinite(e[Per])&&e[Per]>0),this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(A5.TYPE.RESPONSE),this.client=e,this.socket=r,this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.statusCode=null,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[Per],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[Bms]}setTimeout(e,r){e!==this.timeoutValue||r&Rke^this.timeoutType&Rke?(this.timeout&&(ker.clearTimeout(this.timeout),this.timeout=null),e&&(r&Rke?this.timeout=ker.setFastTimeout(uOn,e,new WeakRef(this)):(this.timeout=setTimeout(uOn,e,new WeakRef(this)),this.timeout.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=r}resume(){this.socket.destroyed||!this.paused||(ji(this.ptr!=null),ji(_0==null),this.llhttp.llhttp_resume(this.ptr),ji(this.timeoutType===Unt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||Ums),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){ji(this.ptr!=null),ji(_0==null),ji(!this.paused);let{socket:r,llhttp:n}=this;e.length>Bnt&&(E5&&n.free(E5),Bnt=Math.ceil(e.length/4096)*4096,E5=n.malloc(Bnt)),new Uint8Array(n.memory.buffer,E5,Bnt).set(e);try{let o;try{y5=e,_0=this,o=n.llhttp_execute(this.ptr,E5,e.length)}catch(c){throw c}finally{_0=null,y5=null}let s=n.llhttp_get_error_pos(this.ptr)-E5;if(o===A5.ERROR.PAUSED_UPGRADE)this.onUpgrade(e.slice(s));else if(o===A5.ERROR.PAUSED)this.paused=!0,r.unshift(e.slice(s));else if(o!==A5.ERROR.OK){let c=n.llhttp_get_error_reason(this.ptr),l="";if(c){let u=new Uint8Array(n.memory.buffer,c).indexOf(0);l="Response does not match the HTTP/1.1 protocol ("+Buffer.from(n.memory.buffer,c,u).toString()+")"}throw new Ims(l,A5.ERROR[o],e.slice(s))}}catch(o){Ao.destroy(r,o)}}destroy(){ji(this.ptr!=null),ji(_0==null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&ker.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){this.statusText=e.toString()}onMessageBegin(){let{socket:e,client:r}=this;if(e.destroyed)return-1;let n=r[y2][r[Rw]];if(!n)return-1;n.onResponseStarted()}onHeaderField(e){let r=this.headers.length;(r&1)===0?this.headers.push(e):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]),this.trackHeader(e.length)}onHeaderValue(e){let r=this.headers.length;(r&1)===1?(this.headers.push(e),r+=1):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]);let n=this.headers[r-2];if(n.length===10){let o=Ao.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&Ao.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());this.trackHeader(e.length)}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&Ao.destroy(this.socket,new Sms)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;ji(r),ji(n[vfe]===o),ji(!o.destroyed),ji(!this.paused),ji((s.length&1)===0);let l=n[y2][n[Rw]];ji(l),ji(l.upgrade||l.method==="CONNECT"),this.statusCode=null,this.statusText="",this.shouldKeepAlive=null,this.headers=[],this.headersSize=0,o.unshift(e),o[hp].destroy(),o[hp]=null,o[Mer]=null,o[kw]=null,Qms(o),n[vfe]=null,n[mOn]=null,n[y2][n[Rw]++]=null,n.emit("disconnect",n[hOn],[n],new _fe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ao.destroy(o,u)}n[_j]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;let u=o[y2][o[Rw]];if(!u)return-1;if(ji(!this.upgrade),ji(this.statusCode<200),e===100)return Ao.destroy(s,new Qnt("bad response",Ao.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ao.destroy(s,new Qnt("bad upgrade",Ao.getSocketInfo(s))),-1;if(ji(this.timeoutType===Cfe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[ab]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[Oms];this.setTimeout(f,Unt)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return ji(o[bE]===1),this.upgrade=!0,2;if(r)return ji(o[bE]===1),this.upgrade=!0,2;if(ji((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[Fnt]){let f=this.keepAlive?Ao.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[Nms],o[Dms]);h<=0?s[ab]=!0:o[qnt]=h}else o[qnt]=o[Rms]}else s[ab]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[kke]&&(s[kke]=!1,o[_j]()),d?A5.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[y2][r[Rw]];if(ji(c),ji(this.timeoutType===Unt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),ji(o>=200),s>-1&&this.bytesRead+e.length>s)return Ao.destroy(n,new xms),-1;if(this.bytesRead+=e.length,c.onData(e)===!1)return A5.ERROR.PAUSED}onMessageComplete(){let{client:e,socket:r,statusCode:n,upgrade:o,headers:s,contentLength:c,bytesRead:l,shouldKeepAlive:u}=this;if(r.destroyed&&(!n||u))return-1;if(o)return;ji(n>=100),ji((this.headers.length&1)===0);let d=e[y2][e[Rw]];if(ji(d),this.statusCode=null,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,!(n<200)){if(d.method!=="HEAD"&&c&&l!==parseInt(c,10))return Ao.destroy(r,new Cms),-1;if(d.onComplete(s),e[y2][e[Rw]++]=null,r[vj])return ji(e[bE]===0),Ao.destroy(r,new _fe("reset")),A5.ERROR.PAUSED;if(u){if(r[ab]&&e[bE]===0)return Ao.destroy(r,new _fe("reset")),A5.ERROR.PAUSED;e[Fnt]==null||e[Fnt]===1?setImmediate(()=>e[_j]()):e[_j]()}else return Ao.destroy(r,new _fe("reset")),A5.ERROR.PAUSED}}};function uOn(t){let{socket:e,timeoutType:r,client:n,paused:o}=t.deref();r===Cfe?(!e[vj]||e.writableNeedDrain||n[bE]>1)&&(ji(!o,"cannot be paused while waiting for headers"),Ao.destroy(e,new bms)):r===Unt?o||Ao.destroy(e,new Tms):r===Ber&&(ji(n[bE]===0&&n[qnt]),Ao.destroy(e,new _fe("socket idle timeout")))}a(uOn,"onParserTimeout");async function Hms(t,e){t[vfe]=e,Ner||(Ner=await Ler,Ler=null),e[wke]=!1,e[vj]=!1,e[ab]=!1,e[kke]=!1,e[hp]=new Fer(t,e,Ner),Lnt(e,"error",function(n){ji(n.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let o=this[hp];if(n.code==="ECONNRESET"&&o.statusCode&&!o.shouldKeepAlive){o.onMessageComplete();return}this[kw]=n,this[Mer][Fms](n)}),Lnt(e,"readable",function(){let n=this[hp];n&&n.readMore()}),Lnt(e,"end",function(){let n=this[hp];if(n.statusCode&&!n.shouldKeepAlive){n.onMessageComplete();return}Ao.destroy(this,new Qnt("other side closed",Ao.getSocketInfo(this)))}),Lnt(e,"close",function(){let n=this[Mer],o=this[hp];o&&(!this[kw]&&o.statusCode&&!o.shouldKeepAlive&&o.onMessageComplete(),this[hp].destroy(),this[hp]=null);let s=this[kw]||new Qnt("closed",Ao.getSocketInfo(this));if(n[vfe]=null,n[mOn]=null,n.destroyed){ji(n[wms]===0);let c=n[y2].splice(n[Rw]);for(let l=0;l0&&s.code!=="UND_ERR_INFO"){let c=n[y2][n[Rw]];n[y2][n[Rw]++]=null,Ao.errorRequest(n,c,s)}n[Pms]=n[Rw],ji(n[bE]===0),n.emit("disconnect",n[hOn],[n],s),n[_j]()});let r=!1;return e.on("close",()=>{r=!0}),{version:"h1",defaultPipelining:1,write(...n){return Vms(t,...n)},resume(){Gms(t)},destroy(n,o){r?queueMicrotask(o):e.destroy(n).on("close",o)},get destroyed(){return e.destroyed},busy(n){return!!(e[vj]||e[ab]||e[kke]||n&&(t[bE]>0&&!n.idempotent||t[bE]>0&&(n.upgrade||n.method==="CONNECT")||t[bE]>0&&Ao.bodyLength(n.body)!==0&&(Ao.isStream(n.body)||Ao.isAsyncIterable(n.body)||Ao.isFormDataLike(n.body))))}}}a(Hms,"connectH1");function Gms(t){let e=t[vfe];if(e&&!e.destroyed){if(t[cOn]===0?!e[wke]&&e.unref&&(e.unref(),e[wke]=!0):e[wke]&&e.ref&&(e.ref(),e[wke]=!1),t[cOn]===0)e[hp].timeoutType!==Ber&&e[hp].setTimeout(t[qnt],Ber);else if(t[bE]>0&&e[hp].statusCode<200&&e[hp].timeoutType!==Cfe){let r=t[y2][t[Rw]],n=r.headersTimeout!=null?r.headersTimeout:t[Mms];e[hp].setTimeout(n,Cfe)}}}a(Gms,"resumeH1");function $ms(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a($ms,"shouldSendContentLength");function Vms(t,e){let{method:r,path:n,host:o,upgrade:s,blocking:c,reset:l}=e,{body:u,headers:d,contentLength:f}=e,h=r==="PUT"||r==="POST"||r==="PATCH"||r==="QUERY"||r==="PROPFIND"||r==="PROPPATCH";if(Ao.isFormDataLike(u)){Der||(Der=Efe().extractBody);let[E,_]=Der(u);e.contentType==null&&d.push("content-type",_),u=E.stream,f=E.length}else Ao.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=Ao.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),$ms(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[Oer])return Ao.errorRequest(t,e,new eZ),!1;process.emitWarning(new eZ)}let g=t[vfe],A=a(E=>{e.aborted||e.completed||(Ao.errorRequest(t,e,E||new pOn),Ao.destroy(u),Ao.destroy(g,new _fe("aborted")))},"abort");try{e.onConnect(A)}catch(E){Ao.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[ab]=!0),(s||r==="CONNECT")&&(g[ab]=!0),l!=null&&(g[ab]=l),t[lOn]&&g[Lms]++>=t[lOn]&&(g[ab]=!0),c&&(g[kke]=!0);let y=`${r} ${n} HTTP/1.1\r `;if(typeof o=="string"?y+=`host: ${o}\r -`:y+=t[Cps],s?y+=`connection: upgrade\r +`:y+=t[kms],s?y+=`connection: upgrade\r upgrade: ${s}\r -`:t[unt]&&!g[ib]?y+=`connection: keep-alive\r +`:t[Fnt]&&!g[ab]?y+=`connection: keep-alive\r `:y+=`connection: close\r `,Array.isArray(d))for(let E=0;E{e.removeListener("error",g)}),!u){let A=new PNn;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Hi(o.destroyed||o[aj]&&r[yE]<=1),o.off("drain",h).off("error",g),e.removeListener("data",f).removeListener("end",g).removeListener("close",m),!A)try{d.end()}catch(y){A=y}d.destroy(A),A&&(A.code!=="UND_ERR_INFO"||A.message!=="reset")?Ao.destroy(e,A):Ao.destroy(e)}},"onFinished");e.on("data",f).on("end",g).on("error",g).on("close",m),e.resume&&e.resume(),o.on("drain",h).on("error",g),e.errorEmitted??e.errored?setImmediate(()=>g(e.errored)):(e.endEmitted??e.readableEnded)&&setImmediate(()=>g(null)),(e.closeEmitted??e.closed)&&setImmediate(m)}a(Ups,"writeStream");function RNn(t,e,r,n,o,s,c,l){try{e?Ao.isBuffer(e)&&(Hi(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r +`}return aOn.sendHeaders.hasSubscribers&&aOn.sendHeaders.publish({request:e,headers:y,socket:g}),!u||m===0?dOn(A,null,t,e,g,f,y,h):Ao.isBuffer(u)?dOn(A,u,t,e,g,f,y,h):Ao.isBlobLike(u)?typeof u.stream=="function"?fOn(A,u.stream(),t,e,g,f,y,h):zms(A,u,t,e,g,f,y,h):Ao.isStream(u)?Wms(A,u,t,e,g,f,y,h):Ao.isIterable(u)?fOn(A,u,t,e,g,f,y,h):ji(!1),!0}a(Vms,"writeH1");function Wms(t,e,r,n,o,s,c,l){ji(s!==0||r[bE]===0,"stream body cannot be pipelined");let u=!1,d=new jnt({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c}),f=a(function(A){if(!u)try{!d.write(A)&&this.pause&&this.pause()}catch(y){Ao.destroy(this,y)}},"onData"),h=a(function(){u||e.resume&&e.resume()},"onDrain"),m=a(function(){if(queueMicrotask(()=>{e.removeListener("error",g)}),!u){let A=new pOn;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,ji(o.destroyed||o[vj]&&r[bE]<=1),o.off("drain",h).off("error",g),e.removeListener("data",f).removeListener("end",g).removeListener("close",m),!A)try{d.end()}catch(y){A=y}d.destroy(A),A&&(A.code!=="UND_ERR_INFO"||A.message!=="reset")?Ao.destroy(e,A):Ao.destroy(e)}},"onFinished");e.on("data",f).on("end",g).on("error",g).on("close",m),e.resume&&e.resume(),o.on("drain",h).on("error",g),e.errorEmitted??e.errored?setImmediate(()=>g(e.errored)):(e.endEmitted??e.readableEnded)&&setImmediate(()=>g(null)),(e.closeEmitted??e.closed)&&setImmediate(m)}a(Wms,"writeStream");function dOn(t,e,r,n,o,s,c,l){try{e?Ao.isBuffer(e)&&(ji(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r \r -`,"latin1"),o.write(e),o.uncork(),n.onBodySent(e),!l&&n.reset!==!1&&(o[ib]=!0)):s===0?o.write(`${c}content-length: 0\r +`,"latin1"),o.write(e),o.uncork(),n.onBodySent(e),!l&&n.reset!==!1&&(o[ab]=!0)):s===0?o.write(`${c}content-length: 0\r \r -`,"latin1"):(Hi(s===null,"no body must not have content length"),o.write(`${c}\r -`,"latin1")),n.onRequestSent(),r[sj]()}catch(u){t(u)}}a(RNn,"writeBuffer");async function Qps(t,e,r,n,o,s,c,l){Hi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new GJ;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\r +`,"latin1"):(ji(s===null,"no body must not have content length"),o.write(`${c}\r +`,"latin1")),n.onRequestSent(),r[_j]()}catch(u){t(u)}}a(dOn,"writeBuffer");async function zms(t,e,r,n,o,s,c,l){ji(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new eZ;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\r \r -`,"latin1"),o.write(u),o.uncork(),n.onBodySent(u),n.onRequestSent(),!l&&n.reset!==!1&&(o[ib]=!0),r[sj]()}catch(u){t(u)}}a(Qps,"writeBlob");async function kNn(t,e,r,n,o,s,c,l){Hi(s!==0||r[yE]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let m=u;u=null,m()}}a(d,"onDrain");let f=a(()=>new Promise((m,g)=>{Hi(u===null),o[Cw]?g(o[Cw]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new hnt({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[Cw])throw o[Cw];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(kNn,"writeIterable");var hnt=class{static{a(this,"AsyncWriter")}constructor({abort:e,socket:r,request:n,contentLength:o,client:s,expectsPayload:c,header:l}){this.socket=r,this.request=n,this.contentLength=o,this.client=s,this.bytesWritten=0,this.expectsPayload=c,this.header=l,this.abort=e,r[aj]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[Cw])throw r[Cw];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[HXt])throw new GJ;process.emitWarning(new GJ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[ib]=!0),o===null?r.write(`${u}transfer-encoding: chunked\r +`,"latin1"),o.write(u),o.uncork(),n.onBodySent(u),n.onRequestSent(),!l&&n.reset!==!1&&(o[ab]=!0),r[_j]()}catch(u){t(u)}}a(zms,"writeBlob");async function fOn(t,e,r,n,o,s,c,l){ji(s!==0||r[bE]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let m=u;u=null,m()}}a(d,"onDrain");let f=a(()=>new Promise((m,g)=>{ji(u===null),o[kw]?g(o[kw]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new jnt({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[kw])throw o[kw];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(fOn,"writeIterable");var jnt=class{static{a(this,"AsyncWriter")}constructor({abort:e,socket:r,request:n,contentLength:o,client:s,expectsPayload:c,header:l}){this.socket=r,this.request=n,this.contentLength=o,this.client=s,this.bytesWritten=0,this.expectsPayload=c,this.header=l,this.abort=e,r[vj]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[kw])throw r[kw];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[Oer])throw new eZ;process.emitWarning(new eZ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[ab]=!0),o===null?r.write(`${u}transfer-encoding: chunked\r `,"latin1"):r.write(`${u}content-length: ${o}\r \r `,"latin1")),o===null&&r.write(`\r ${d.toString(16)}\r -`,"latin1"),this.bytesWritten+=d;let f=r.write(e);return r.uncork(),n.onBodySent(e),f||r[dp].timeout&&r[dp].timeoutType===afe&&r[dp].timeout.refresh&&r[dp].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[aj]=!1,e[Cw])throw e[Cw];if(!e.destroyed){if(o===0?s?e.write(`${c}content-length: 0\r +`,"latin1"),this.bytesWritten+=d;let f=r.write(e);return r.uncork(),n.onBodySent(e),f||r[hp].timeout&&r[hp].timeoutType===Cfe&&r[hp].timeout.refresh&&r[hp].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[vj]=!1,e[kw])throw e[kw];if(!e.destroyed){if(o===0?s?e.write(`${c}content-length: 0\r \r `,"latin1"):e.write(`${c}\r `,"latin1"):r===null&&e.write(`\r 0\r \r -`,"latin1"),r!==null&&o!==r){if(n[HXt])throw new GJ;process.emitWarning(new GJ)}e[dp].timeout&&e[dp].timeoutType===afe&&e[dp].timeout.refresh&&e[dp].timeout.refresh(),n[sj]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[aj]=!1,e&&(Hi(n[yE]<=1,"pipeline should only contain this request"),o(e))}};MNn.exports=Ops});var HNn=I((EXd,jNn)=>{"use strict";p();var bw=require("node:assert"),{pipeline:qps}=require("node:stream"),fa=qs(),{RequestContentLengthMismatchError:WXt,RequestAbortedError:LNn,SocketError:dke,InformationalError:zXt}=Ec(),{kUrl:mnt,kReset:Ant,kClient:cfe,kRunning:ynt,kPending:jps,kQueue:cj,kPendingIdx:YXt,kRunningIdx:d2,kError:p2,kSocket:wg,kStrictContentLength:Hps,kOnError:KXt,kMaxConcurrentStreams:qNn,kHTTP2Session:f2,kResume:lj,kSize:Gps,kHTTPContext:$ps}=jd(),kF=Symbol("open streams"),BNn,FNn=!1,gnt;try{gnt=require("node:http2")}catch{gnt={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:Vps,HTTP2_HEADER_METHOD:Wps,HTTP2_HEADER_PATH:zps,HTTP2_HEADER_SCHEME:Yps,HTTP2_HEADER_CONTENT_LENGTH:Kps,HTTP2_HEADER_EXPECT:Jps,HTTP2_HEADER_STATUS:Zps}}=gnt;function Xps(t){let e=[];for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.push(Buffer.from(r),Buffer.from(o));else e.push(Buffer.from(r),Buffer.from(n));return e}a(Xps,"parseH2Headers");async function ehs(t,e){t[wg]=e,FNn||(FNn=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let r=gnt.connect(t[mnt],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[qNn]});r[kF]=0,r[cfe]=t,r[wg]=e,fa.addListener(r,"error",rhs),fa.addListener(r,"frameError",nhs),fa.addListener(r,"end",ihs),fa.addListener(r,"goaway",ohs),fa.addListener(r,"close",function(){let{[cfe]:o}=this,{[wg]:s}=o,c=this[wg][p2]||this[p2]||new dke("closed",fa.getSocketInfo(s));if(o[f2]=null,o.destroyed){bw(o[jps]===0);let l=o[cj].splice(o[d2]);for(let u=0;u{n=!0}),{version:"h2",defaultPipelining:1/0,write(...o){return ahs(t,...o)},resume(){ths(t)},destroy(o,s){n?queueMicrotask(s):e.destroy(o).on("close",s)},get destroyed(){return e.destroyed},busy(){return!1}}}a(ehs,"connectH2");function ths(t){let e=t[wg];e?.destroyed===!1&&(t[Gps]===0&&t[qNn]===0?(e.unref(),t[f2].unref()):(e.ref(),t[f2].ref()))}a(ths,"resumeH2");function rhs(t){bw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[wg][p2]=t,this[cfe][KXt](t)}a(rhs,"onHttp2SessionError");function nhs(t,e,r){if(r===0){let n=new zXt(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[wg][p2]=n,this[cfe][KXt](n)}}a(nhs,"onHttp2FrameError");function ihs(){let t=new dke("other side closed",fa.getSocketInfo(this[wg]));this.destroy(t),fa.destroy(this[wg],t)}a(ihs,"onHttp2SessionEnd");function ohs(t){let e=this[p2]||new dke(`HTTP/2: "GOAWAY" frame received with code ${t}`,fa.getSocketInfo(this)),r=this[cfe];if(r[wg]=null,r[$ps]=null,this[f2]!=null&&(this[f2].destroy(e),this[f2]=null),fa.destroy(this[wg],e),r[d2]{e.aborted||e.completed||(T=T||new LNn,fa.errorRequest(t,e,T),m!=null&&fa.destroy(m,T),fa.destroy(f,T),t[cj][t[d2]++]=null,t[lj]())},"abort");try{e.onConnect(y)}catch(T){fa.errorRequest(t,e,T)}if(e.aborted)return!1;if(n==="CONNECT")return r.ref(),m=r.request(h,{endStream:!1,signal:u}),m.id&&!m.pending?(e.onUpgrade(null,null,m),++r[kF],t[cj][t[d2]++]=null):m.once("ready",()=>{e.onUpgrade(null,null,m),++r[kF],t[cj][t[d2]++]=null}),m.once("close",()=>{r[kF]-=1,r[kF]===0&&r.unref()}),!0;h[zps]=o,h[Yps]="https";let E=n==="PUT"||n==="POST"||n==="PATCH";f&&typeof f.read=="function"&&f.read(0);let _=fa.bodyLength(f);if(fa.isFormDataLike(f)){BNn??=ife().extractBody;let[T,w]=BNn(f);h["content-type"]=w,f=T.stream,_=T.length}if(_==null&&(_=e.contentLength),(_===0||!E)&&(_=null),shs(n)&&_>0&&e.contentLength!=null&&e.contentLength!==_){if(t[Hps])return fa.errorRequest(t,e,new WXt),!1;process.emitWarning(new WXt)}_!=null&&(bw(f,"no body must not have content length"),h[Kps]=`${_}`),r.ref();let v=n==="GET"||n==="HEAD"||f===null;return l?(h[Jps]="100-continue",m=r.request(h,{endStream:v,signal:u}),m.once("continue",b)):(m=r.request(h,{endStream:v,signal:u}),b()),++r[kF],m.once("response",T=>{let{[Zps]:w,...R}=T;if(e.onResponseStarted(),e.aborted){let x=new LNn;fa.errorRequest(t,e,x),fa.destroy(m,x);return}e.onHeaders(Number(w),Xps(R),m.resume.bind(m),"")===!1&&m.pause(),m.on("data",x=>{e.onData(x)===!1&&m.pause()})}),m.once("end",()=>{(m.state?.state==null||m.state.state<6)&&e.onComplete([]),r[kF]===0&&r.unref(),y(new zXt("HTTP/2: stream half-closed (remote)")),t[cj][t[d2]++]=null,t[YXt]=t[d2],t[lj]()}),m.once("close",()=>{r[kF]-=1,r[kF]===0&&r.unref()}),m.once("error",function(T){y(T)}),m.once("frameError",(T,w)=>{y(new zXt(`HTTP/2: "frameError" received - type ${T}, code ${w}`))}),!0;function b(){!f||_===0?UNn(y,m,null,t,e,t[wg],_,E):fa.isBuffer(f)?UNn(y,m,f,t,e,t[wg],_,E):fa.isBlobLike(f)?typeof f.stream=="function"?QNn(y,m,f.stream(),t,e,t[wg],_,E):lhs(y,m,f,t,e,t[wg],_,E):fa.isStream(f)?chs(y,t[wg],E,m,f,t,e,_):fa.isIterable(f)?QNn(y,m,f,t,e,t[wg],_,E):bw(!1)}a(b,"writeBodyH2")}a(ahs,"writeH2");function UNn(t,e,r,n,o,s,c,l){try{r!=null&&fa.isBuffer(r)&&(bw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[Ant]=!0),o.onRequestSent(),n[lj]()}catch(u){t(u)}}a(UNn,"writeBuffer");function chs(t,e,r,n,o,s,c,l){bw(l!==0||s[ynt]===0,"stream body cannot be pipelined");let u=qps(o,n,f=>{f?(fa.destroy(u,f),t(f)):(fa.removeAllListeners(u),c.onRequestSent(),r||(e[Ant]=!0),s[lj]())});fa.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(chs,"writeStream");async function lhs(t,e,r,n,o,s,c,l){bw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new WXt;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[Ant]=!0),n[lj]()}catch(u){t(u)}}a(lhs,"writeBlob");async function QNn(t,e,r,n,o,s,c,l){bw(c!==0||n[ynt]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let h=u;u=null,h()}}a(d,"onDrain");let f=a(()=>new Promise((h,m)=>{bw(u===null),s[p2]?m(s[p2]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[p2])throw s[p2];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[Ant]=!0),n[lj]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(QNn,"writeIterable");jNn.exports=ehs});var _nt=I((CXd,VNn)=>{"use strict";p();var h5=qs(),{kBodyUsed:fke}=jd(),ZXt=require("node:assert"),{InvalidArgumentError:uhs}=Ec(),dhs=require("node:events"),fhs=[300,301,302,303,307,308],GNn=Symbol("body"),Ent=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[GNn]=e,this[fke]=!1}async*[Symbol.asyncIterator](){ZXt(!this[fke],"disturbed"),this[fke]=!0,yield*this[GNn]}},JXt=class{static{a(this,"RedirectHandler")}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new uhs("maxRedirections must be a positive number");h5.validateHandler(o,n.method,n.upgrade),this.dispatch=e,this.location=null,this.abort=null,this.opts={...n,maxRedirections:0},this.maxRedirections=r,this.handler=o,this.history=[],this.redirectionLimitReached=!1,h5.isStream(this.opts.body)?(h5.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){ZXt(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[fke]=!1,dhs.prototype.on.call(this.opts.body,"data",function(){this[fke]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Ent(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&h5.isIterable(this.opts.body)&&(this.opts.body=new Ent(this.opts.body))}onConnect(e){this.abort=e,this.handler.onConnect(e,{history:this.history})}onUpgrade(e,r,n){this.handler.onUpgrade(e,r,n)}onError(e){this.handler.onError(e)}onHeaders(e,r,n,o){if(this.location=this.history.length>=this.maxRedirections||h5.isDisturbed(this.opts.body)?null:phs(e,r),this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections){this.request&&this.request.abort(new Error("max redirects")),this.redirectionLimitReached=!0,this.abort(new Error("max redirects"));return}if(this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location)return this.handler.onHeaders(e,r,n,o);let{origin:s,pathname:c,search:l}=h5.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c;this.opts.headers=hhs(this.opts.headers,e===303,this.opts.origin!==s),this.opts.path=u,this.opts.origin=s,this.opts.maxRedirections=0,this.opts.query=null,e===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",this.opts.body=null)}onData(e){if(!this.location)return this.handler.onData(e)}onComplete(e){this.location?(this.location=null,this.abort=null,this.dispatch(this.opts,this)):this.handler.onComplete(e)}onBodySent(e){this.handler.onBodySent&&this.handler.onBodySent(e)}};function phs(t,e){if(fhs.indexOf(t)===-1)return null;for(let r=0;r{"use strict";p();var mhs=_nt();function ghs({maxRedirections:t}){return e=>a(function(n,o){let{maxRedirections:s=t}=n;if(!s)return e(n,o);let c=new mhs(e,s,n,o);return n={...n,maxRedirections:0},e(n,c)},"Intercept")}a(ghs,"createRedirectInterceptor");WNn.exports=ghs});var dfe=I((wXd,nMn)=>{"use strict";p();var PF=require("node:assert"),XNn=require("node:net"),Ahs=require("node:http"),$J=qs(),{channels:lfe}=$de(),yhs=cDn(),Ehs=Yde(),{InvalidArgumentError:sh,InformationalError:_hs,ClientDestroyedError:vhs}=Ec(),Chs=XRe(),{kUrl:m5,kServerName:uj,kClient:bhs,kBusy:XXt,kConnect:Shs,kResuming:VJ,kRunning:Ake,kPending:yke,kSize:gke,kQueue:h2,kConnected:Ths,kConnecting:ufe,kNeedDrain:fj,kKeepAliveDefaultTimeout:zNn,kHostHeader:Ihs,kPendingIdx:m2,kRunningIdx:DF,kError:xhs,kPipelining:Cnt,kKeepAliveTimeoutValue:whs,kMaxHeadersSize:Rhs,kKeepAliveMaxTimeout:khs,kKeepAliveTimeoutThreshold:Phs,kHeadersTimeout:Dhs,kBodyTimeout:Nhs,kStrictContentLength:Mhs,kConnector:pke,kMaxRedirections:Ohs,kMaxRequests:eer,kCounter:Lhs,kClose:Bhs,kDestroy:Fhs,kDispatch:Uhs,kInterceptors:YNn,kLocalAddress:hke,kMaxResponseSize:Qhs,kOnError:qhs,kHTTPContext:ah,kMaxConcurrentStreams:jhs,kResume:mke}=jd(),Hhs=ONn(),Ghs=HNn(),KNn=!1,dj=Symbol("kClosedResolve"),JNn=a(()=>{},"noop");function eMn(t){return t[Cnt]??t[ah]?.defaultPipelining??1}a(eMn,"getPipelining");var ter=class extends Ehs{static{a(this,"Client")}constructor(e,{interceptors:r,maxHeaderSize:n,headersTimeout:o,socketTimeout:s,requestTimeout:c,connectTimeout:l,bodyTimeout:u,idleTimeout:d,keepAlive:f,keepAliveTimeout:h,maxKeepAliveTimeout:m,keepAliveMaxTimeout:g,keepAliveTimeoutThreshold:A,socketPath:y,pipelining:E,tls:_,strictContentLength:v,maxCachedSessions:b,maxRedirections:T,connect:w,maxRequestsPerClient:R,localAddress:x,maxResponseSize:P,autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N,maxConcurrentStreams:L,allowH2:B}={}){if(super(),f!==void 0)throw new sh("unsupported keepAlive, use pipelining=0 instead");if(s!==void 0)throw new sh("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(c!==void 0)throw new sh("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(d!==void 0)throw new sh("unsupported idleTimeout, use keepAliveTimeout instead");if(m!==void 0)throw new sh("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(n!=null&&!Number.isFinite(n))throw new sh("invalid maxHeaderSize");if(y!=null&&typeof y!="string")throw new sh("invalid socketPath");if(l!=null&&(!Number.isFinite(l)||l<0))throw new sh("invalid connectTimeout");if(h!=null&&(!Number.isFinite(h)||h<=0))throw new sh("invalid keepAliveTimeout");if(g!=null&&(!Number.isFinite(g)||g<=0))throw new sh("invalid keepAliveMaxTimeout");if(A!=null&&!Number.isFinite(A))throw new sh("invalid keepAliveTimeoutThreshold");if(o!=null&&(!Number.isInteger(o)||o<0))throw new sh("headersTimeout must be a positive integer or zero");if(u!=null&&(!Number.isInteger(u)||u<0))throw new sh("bodyTimeout must be a positive integer or zero");if(w!=null&&typeof w!="function"&&typeof w!="object")throw new sh("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new sh("maxRedirections must be a positive number");if(R!=null&&(!Number.isInteger(R)||R<0))throw new sh("maxRequestsPerClient must be a positive number");if(x!=null&&(typeof x!="string"||XNn.isIP(x)===0))throw new sh("localAddress must be valid string IP address");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new sh("maxResponseSize must be a positive number");if(N!=null&&(!Number.isInteger(N)||N<-1))throw new sh("autoSelectFamilyAttemptTimeout must be a positive number");if(B!=null&&typeof B!="boolean")throw new sh("allowH2 must be a valid boolean value");if(L!=null&&(typeof L!="number"||L<1))throw new sh("maxConcurrentStreams must be a positive integer, greater than 0");typeof w!="function"&&(w=Chs({..._,maxCachedSessions:b,allowH2:B,socketPath:y,timeout:l,...D?{autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N}:void 0,...w})),r?.Client&&Array.isArray(r.Client)?(this[YNn]=r.Client,KNn||(KNn=!0,process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.",{code:"UNDICI-CLIENT-INTERCEPTOR-DEPRECATED"}))):this[YNn]=[$hs({maxRedirections:T})],this[m5]=$J.parseOrigin(e),this[pke]=w,this[Cnt]=E??1,this[Rhs]=n||Ahs.maxHeaderSize,this[zNn]=h??4e3,this[khs]=g??6e5,this[Phs]=A??2e3,this[whs]=this[zNn],this[uj]=null,this[hke]=x??null,this[VJ]=0,this[fj]=0,this[Ihs]=`host: ${this[m5].hostname}${this[m5].port?`:${this[m5].port}`:""}\r -`,this[Nhs]=u??3e5,this[Dhs]=o??3e5,this[Mhs]=v??!0,this[Ohs]=T,this[eer]=R,this[dj]=null,this[Qhs]=P>-1?P:-1,this[jhs]=L??100,this[ah]=null,this[h2]=[],this[DF]=0,this[m2]=0,this[mke]=q=>rer(this,q),this[qhs]=q=>tMn(this,q)}get pipelining(){return this[Cnt]}set pipelining(e){this[Cnt]=e,this[mke](!0)}get[yke](){return this[h2].length-this[m2]}get[Ake](){return this[m2]-this[DF]}get[gke](){return this[h2].length-this[DF]}get[Ths](){return!!this[ah]&&!this[ufe]&&!this[ah].destroyed}get[XXt](){return!!(this[ah]?.busy(null)||this[gke]>=(eMn(this)||1)||this[yke]>0)}[Shs](e){rMn(this),this.once("connect",e)}[Uhs](e,r){let n=e.origin||this[m5].origin,o=new yhs(n,e,r);return this[h2].push(o),this[VJ]||($J.bodyLength(o.body)==null&&$J.isIterable(o.body)?(this[VJ]=1,queueMicrotask(()=>rer(this))):this[mke](!0)),this[VJ]&&this[fj]!==2&&this[XXt]&&(this[fj]=2),this[fj]<2}async[Bhs](){return new Promise(e=>{this[gke]?this[dj]=e:e(null)})}async[Fhs](e){return new Promise(r=>{let n=this[h2].splice(this[m2]);for(let s=0;s{this[dj]&&(this[dj](),this[dj]=null),r(null)},"callback");this[ah]?(this[ah].destroy(e,o),this[ah]=null):queueMicrotask(o),this[mke]()})}},$hs=vnt();function tMn(t,e){if(t[Ake]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){PF(t[m2]===t[DF]);let r=t[h2].splice(t[DF]);for(let n=0;n{t[pke]({host:e,hostname:r,protocol:n,port:o,servername:t[uj],localAddress:t[hke]},(u,d)=>{u?l(u):c(d)})});if(t.destroyed){$J.destroy(s.on("error",JNn),new vhs);return}PF(s);try{t[ah]=s.alpnProtocol==="h2"?await Ghs(t,s):await Hhs(t,s)}catch(c){throw s.destroy().on("error",JNn),c}t[ufe]=!1,s[Lhs]=0,s[eer]=t[eer],s[bhs]=t,s[xhs]=null,lfe.connected.hasSubscribers&&lfe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[ah]?.version,servername:t[uj],localAddress:t[hke]},connector:t[pke],socket:s}),t.emit("connect",t[m5],[t])}catch(s){if(t.destroyed)return;if(t[ufe]=!1,lfe.connectError.hasSubscribers&&lfe.connectError.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[ah]?.version,servername:t[uj],localAddress:t[hke]},connector:t[pke],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(PF(t[Ake]===0);t[yke]>0&&t[h2][t[m2]].servername===t[uj];){let c=t[h2][t[m2]++];$J.errorRequest(t,c,s)}else tMn(t,s);t.emit("connectionError",t[m5],[t],s)}t[mke]()}a(rMn,"connect");function ZNn(t){t[fj]=0,t.emit("drain",t[m5],[t])}a(ZNn,"emitDrain");function rer(t,e){t[VJ]!==2&&(t[VJ]=2,Vhs(t,e),t[VJ]=0,t[DF]>256&&(t[h2].splice(0,t[DF]),t[m2]-=t[DF],t[DF]=0))}a(rer,"resume");function Vhs(t,e){for(;;){if(t.destroyed){PF(t[yke]===0);return}if(t[dj]&&!t[gke]){t[dj](),t[dj]=null;return}if(t[ah]&&t[ah].resume(),t[XXt])t[fj]=2;else if(t[fj]===2){e?(t[fj]=1,queueMicrotask(()=>ZNn(t))):ZNn(t);continue}if(t[yke]===0||t[Ake]>=(eMn(t)||1))return;let r=t[h2][t[m2]];if(t[m5].protocol==="https:"&&t[uj]!==r.servername){if(t[Ake]>0)return;t[uj]=r.servername,t[ah]?.destroy(new _hs("servername changed"),()=>{t[ah]=null,rer(t)})}if(t[ufe])return;if(!t[ah]){rMn(t);return}if(t[ah].destroyed||t[ah].busy(r))return;!r.aborted&&t[ah].write(r)?t[m2]++:t[h2].splice(t[m2],1)}}a(Vhs,"_resume");nMn.exports=ter});var ner=I((DXd,iMn)=>{"use strict";p();var bnt=class{static{a(this,"FixedCircularBuffer")}constructor(){this.bottom=0,this.top=0,this.list=new Array(2048),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};iMn.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new bnt}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new bnt),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),r}}});var sMn=I((OXd,oMn)=>{p();var{kFree:Whs,kConnected:zhs,kPending:Yhs,kQueued:Khs,kRunning:Jhs,kSize:Zhs}=jd(),WJ=Symbol("pool"),ier=class{static{a(this,"PoolStats")}constructor(e){this[WJ]=e}get connected(){return this[WJ][zhs]}get free(){return this[WJ][Whs]}get pending(){return this[WJ][Yhs]}get queued(){return this[WJ][Khs]}get running(){return this[WJ][Jhs]}get size(){return this[WJ][Zhs]}};oMn.exports=ier});var uer=I((FXd,gMn)=>{"use strict";p();var Xhs=Yde(),ems=ner(),{kConnected:oer,kSize:aMn,kRunning:cMn,kPending:lMn,kQueued:Eke,kBusy:tms,kFree:rms,kUrl:nms,kClose:ims,kDestroy:oms,kDispatch:sms}=jd(),ams=sMn(),ob=Symbol("clients"),iv=Symbol("needDrain"),_ke=Symbol("queue"),ser=Symbol("closed resolve"),aer=Symbol("onDrain"),uMn=Symbol("onConnect"),dMn=Symbol("onDisconnect"),fMn=Symbol("onConnectionError"),cer=Symbol("get dispatcher"),hMn=Symbol("add client"),mMn=Symbol("remove client"),pMn=Symbol("stats"),ler=class extends Xhs{static{a(this,"PoolBase")}constructor(){super(),this[_ke]=new ems,this[ob]=[],this[Eke]=0;let e=this;this[aer]=a(function(n,o){let s=e[_ke],c=!1;for(;!c;){let l=s.shift();if(!l)break;e[Eke]--,c=!this.dispatch(l.opts,l.handler)}this[iv]=c,!this[iv]&&e[iv]&&(e[iv]=!1,e.emit("drain",n,[e,...o])),e[ser]&&s.isEmpty()&&Promise.all(e[ob].map(l=>l.close())).then(e[ser])},"onDrain"),this[uMn]=(r,n)=>{e.emit("connect",r,[e,...n])},this[dMn]=(r,n,o)=>{e.emit("disconnect",r,[e,...n],o)},this[fMn]=(r,n,o)=>{e.emit("connectionError",r,[e,...n],o)},this[pMn]=new ams(this)}get[tms](){return this[iv]}get[oer](){return this[ob].filter(e=>e[oer]).length}get[rms](){return this[ob].filter(e=>e[oer]&&!e[iv]).length}get[lMn](){let e=this[Eke];for(let{[lMn]:r}of this[ob])e+=r;return e}get[cMn](){let e=0;for(let{[cMn]:r}of this[ob])e+=r;return e}get[aMn](){let e=this[Eke];for(let{[aMn]:r}of this[ob])e+=r;return e}get stats(){return this[pMn]}async[ims](){this[_ke].isEmpty()?await Promise.all(this[ob].map(e=>e.close())):await new Promise(e=>{this[ser]=e})}async[oms](e){for(;;){let r=this[_ke].shift();if(!r)break;r.handler.onError(e)}await Promise.all(this[ob].map(r=>r.destroy(e)))}[sms](e,r){let n=this[cer]();return n?n.dispatch(e,r)||(n[iv]=!0,this[iv]=!this[cer]()):(this[iv]=!0,this[_ke].push({opts:e,handler:r}),this[Eke]++),!this[iv]}[hMn](e){return e.on("drain",this[aer]).on("connect",this[uMn]).on("disconnect",this[dMn]).on("connectionError",this[fMn]),this[ob].push(e),this[iv]&&queueMicrotask(()=>{this[iv]&&this[aer](e[nms],[this,e])}),this}[mMn](e){e.close(()=>{let r=this[ob].indexOf(e);r!==-1&&this[ob].splice(r,1)}),this[iv]=this[ob].some(r=>!r[iv]&&r.closed!==!0&&r.destroyed!==!0)}};gMn.exports={PoolBase:ler,kClients:ob,kNeedDrain:iv,kAddClient:hMn,kRemoveClient:mMn,kGetDispatcher:cer}});var ffe=I((qXd,_Mn)=>{"use strict";p();var{PoolBase:cms,kClients:Snt,kNeedDrain:lms,kAddClient:ums,kGetDispatcher:dms}=uer(),fms=dfe(),{InvalidArgumentError:der}=Ec(),AMn=qs(),{kUrl:yMn,kInterceptors:pms}=jd(),hms=XRe(),fer=Symbol("options"),per=Symbol("connections"),EMn=Symbol("factory");function mms(t,e){return new fms(t,e)}a(mms,"defaultFactory");var her=class extends cms{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=mms,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,...m}={}){if(super(),r!=null&&(!Number.isFinite(r)||r<0))throw new der("invalid connections");if(typeof n!="function")throw new der("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new der("connect must be a function or an object");typeof o!="function"&&(o=hms({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...d?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),this[pms]=m.interceptors?.Pool&&Array.isArray(m.interceptors.Pool)?m.interceptors.Pool:[],this[per]=r||null,this[yMn]=AMn.parseOrigin(e),this[fer]={...AMn.deepClone(m),connect:o,allowH2:h},this[fer].interceptors=m.interceptors?{...m.interceptors}:void 0,this[EMn]=n,this.on("connectionError",(g,A,y)=>{for(let E of A){let _=this[Snt].indexOf(E);_!==-1&&this[Snt].splice(_,1)}})}[dms](){for(let e of this[Snt])if(!e[lms])return e;if(!this[per]||this[Snt].length{"use strict";p();var{BalancedPoolMissingUpstreamError:gms,InvalidArgumentError:Ams}=Ec(),{PoolBase:yms,kClients:EE,kNeedDrain:vke,kAddClient:Ems,kRemoveClient:_ms,kGetDispatcher:vms}=uer(),Cms=ffe(),{kUrl:mer,kInterceptors:bms}=jd(),{parseOrigin:vMn}=qs(),CMn=Symbol("factory"),Tnt=Symbol("options"),bMn=Symbol("kGreatestCommonDivisor"),zJ=Symbol("kCurrentWeight"),YJ=Symbol("kIndex"),Sw=Symbol("kWeight"),Int=Symbol("kMaxWeightPerServer"),xnt=Symbol("kErrorPenalty");function Sms(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(Sms,"getGreatestCommonDivisor");function Tms(t,e){return new Cms(t,e)}a(Tms,"defaultFactory");var ger=class extends yms{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=Tms,...n}={}){if(super(),this[Tnt]=n,this[YJ]=-1,this[zJ]=0,this[Int]=this[Tnt].maxWeightPerServer||100,this[xnt]=this[Tnt].errorPenalty||15,Array.isArray(e)||(e=[e]),typeof r!="function")throw new Ams("factory must be a function.");this[bms]=n.interceptors?.BalancedPool&&Array.isArray(n.interceptors.BalancedPool)?n.interceptors.BalancedPool:[],this[CMn]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=vMn(e).origin;if(this[EE].find(o=>o[mer].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[CMn](r,Object.assign({},this[Tnt]));this[Ems](n),n.on("connect",()=>{n[Sw]=Math.min(this[Int],n[Sw]+this[xnt])}),n.on("connectionError",()=>{n[Sw]=Math.max(1,n[Sw]-this[xnt]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[Sw]=Math.max(1,n[Sw]-this[xnt]),this._updateBalancedPoolStats())});for(let o of this[EE])o[Sw]=this[Int];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[mer].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[_ms](n),this}get upstreams(){return this[EE].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[mer].origin)}[vms](){if(this[EE].length===0)throw new gms;if(!this[EE].find(s=>!s[vke]&&s.closed!==!0&&s.destroyed!==!0)||this[EE].map(s=>s[vke]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[EE].findIndex(s=>!s[vke]);for(;n++this[EE][o][Sw]&&!s[vke]&&(o=this[YJ]),this[YJ]===0&&(this[zJ]=this[zJ]-this[bMn],this[zJ]<=0&&(this[zJ]=this[Int])),s[Sw]>=this[zJ]&&!s[vke])return s}return this[zJ]=this[EE][o][Sw],this[YJ]=o,this[EE][o]}};SMn.exports=ger});var pfe=I((WXd,DMn)=>{"use strict";p();var{InvalidArgumentError:wnt}=Ec(),{kClients:pj,kRunning:IMn,kClose:Ims,kDestroy:xms,kDispatch:wms,kInterceptors:Rms}=jd(),kms=Yde(),Pms=ffe(),Dms=dfe(),Nms=qs(),Mms=vnt(),xMn=Symbol("onConnect"),wMn=Symbol("onDisconnect"),RMn=Symbol("onConnectionError"),Oms=Symbol("maxRedirections"),kMn=Symbol("onDrain"),PMn=Symbol("factory"),Aer=Symbol("options");function Lms(t,e){return e&&e.connections===1?new Dms(t,e):new Pms(t,e)}a(Lms,"defaultFactory");var yer=class extends kms{static{a(this,"Agent")}constructor({factory:e=Lms,maxRedirections:r=0,connect:n,...o}={}){if(super(),typeof e!="function")throw new wnt("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new wnt("connect must be a function or an object");if(!Number.isInteger(r)||r<0)throw new wnt("maxRedirections must be a positive number");n&&typeof n!="function"&&(n={...n}),this[Rms]=o.interceptors?.Agent&&Array.isArray(o.interceptors.Agent)?o.interceptors.Agent:[Mms({maxRedirections:r})],this[Aer]={...Nms.deepClone(o),connect:n},this[Aer].interceptors=o.interceptors?{...o.interceptors}:void 0,this[Oms]=r,this[PMn]=e,this[pj]=new Map,this[kMn]=(s,c)=>{this.emit("drain",s,[this,...c])},this[xMn]=(s,c)=>{this.emit("connect",s,[this,...c])},this[wMn]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[RMn]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[IMn](){let e=0;for(let r of this[pj].values())e+=r[IMn];return e}[wms](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new wnt("opts.origin must be a non-empty string or URL.");let o=this[pj].get(n);return o||(o=this[PMn](e.origin,this[Aer]).on("drain",this[kMn]).on("connect",this[xMn]).on("disconnect",this[wMn]).on("connectionError",this[RMn]),this[pj].set(n,o)),o.dispatch(e,r)}async[Ims](){let e=[];for(let r of this[pj].values())e.push(r.close());this[pj].clear(),await Promise.all(e)}async[xms](e){let r=[];for(let n of this[pj].values())r.push(n.destroy(e));this[pj].clear(),await Promise.all(r)}};DMn.exports=yer});var ber=I((KXd,HMn)=>{"use strict";p();var{kProxy:Eer,kClose:FMn,kDestroy:UMn,kDispatch:NMn,kInterceptors:Bms}=jd(),{URL:KJ}=require("node:url"),Fms=pfe(),QMn=ffe(),qMn=Yde(),{InvalidArgumentError:hfe,RequestAbortedError:Ums,SecureProxyConnectionError:Qms}=Ec(),MMn=XRe(),jMn=dfe(),Rnt=Symbol("proxy agent"),knt=Symbol("proxy client"),hj=Symbol("proxy headers"),_er=Symbol("request tls settings"),OMn=Symbol("proxy tls settings"),LMn=Symbol("connect endpoint function"),BMn=Symbol("tunnel proxy");function qms(t){return t==="https:"?443:80}a(qms,"defaultProtocolPort");function jms(t,e){return new QMn(t,e)}a(jms,"defaultFactory");var Hms=a(()=>{},"noop");function Gms(t,e){return e.connections===1?new jMn(t,e):new QMn(t,e)}a(Gms,"defaultAgentFactory");var ver=class extends qMn{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(super(),!e)throw new hfe("Proxy URL is mandatory");this[hj]=r,o?this.#e=o(e,{connect:n}):this.#e=new jMn(e,{connect:n})}[NMn](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new hfe("Proxy Authentication Required (407)"));return}n&&n.call(this,l,u,d)};let{origin:o,path:s="/",headers:c={}}=e;if(e.path=o+s,!("host"in c)&&!("Host"in c)){let{host:l}=new KJ(o);c.host=l}return e.headers={...this[hj],...c},this.#e[NMn](e,r)}async[FMn](){return this.#e.close()}async[UMn](e){return this.#e.destroy(e)}},Cer=class extends qMn{static{a(this,"ProxyAgent")}constructor(e){if(super(),!e||typeof e=="object"&&!(e instanceof KJ)&&!e.uri)throw new hfe("Proxy uri is mandatory");let{clientFactory:r=jms}=e;if(typeof r!="function")throw new hfe("Proxy opts.clientFactory must be a function.");let{proxyTunnel:n=!0}=e,o=this.#e(e),{href:s,origin:c,port:l,protocol:u,username:d,password:f,hostname:h}=o;if(this[Eer]={uri:s,protocol:u},this[Bms]=e.interceptors?.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],this[_er]=e.requestTls,this[OMn]=e.proxyTls,this[hj]=e.headers||{},this[BMn]=n,e.auth&&e.token)throw new hfe("opts.auth cannot be used in combination with opts.token");e.auth?this[hj]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[hj]["proxy-authorization"]=e.token:d&&f&&(this[hj]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=MMn({...e.proxyTls});this[LMn]=MMn({...e.requestTls});let g=e.factory||Gms,A=a((y,E)=>{let{protocol:_}=new KJ(y);return!this[BMn]&&_==="http:"&&this[Eer].protocol==="http:"?new ver(this[Eer].uri,{headers:this[hj],connect:m,factory:g}):g(y,E)},"factory");this[knt]=r(o,{connect:m}),this[Rnt]=new Fms({...e,factory:A,connect:a(async(y,E)=>{let _=y.host;y.port||(_+=`:${qms(y.protocol)}`);try{let{socket:v,statusCode:b}=await this[knt].connect({origin:c,port:l,path:_,signal:y.signal,headers:{...this[hj],host:y.host},servername:this[OMn]?.servername||h});if(b!==200&&(v.on("error",Hms).destroy(),E(new Ums(`Proxy response (${b}) !== 200 when HTTP Tunneling`))),y.protocol!=="https:"){E(null,v);return}let T;this[_er]?T=this[_er].servername:T=y.servername,this[LMn]({...y,servername:T,httpSocket:v},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new Qms(v)):E(v)}},"connect")})}dispatch(e,r){let n=$ms(e.headers);if(Vms(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new KJ(e.origin);n.host=o}return this[Rnt].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new KJ(e):e instanceof KJ?e:new KJ(e.uri)}async[FMn](){await this[Rnt].close(),await this[knt].close()}async[UMn](){await this[Rnt].destroy(),await this[knt].destroy()}};function $ms(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new hfe("Proxy-Authorization should be sent in ProxyAgent constructor")}a(Vms,"throwIfProxyAuthIsSent");HMn.exports=Cer});var YMn=I((XXd,zMn)=>{"use strict";p();var Wms=Yde(),{kClose:zms,kDestroy:Yms,kClosed:GMn,kDestroyed:$Mn,kDispatch:Kms,kNoProxyAgent:Cke,kHttpProxyAgent:mj,kHttpsProxyAgent:JJ}=jd(),VMn=ber(),Jms=pfe(),Zms={"http:":80,"https:":443},WMn=!1,Ser=class extends Wms{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e,WMn||(WMn=!0,process.emitWarning("EnvHttpProxyAgent is experimental, expect them to change at any time.",{code:"UNDICI-EHPA"}));let{httpProxy:r,httpsProxy:n,noProxy:o,...s}=e;this[Cke]=new Jms(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[mj]=new VMn({...s,uri:c}):this[mj]=this[Cke];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[JJ]=new VMn({...s,uri:l}):this[JJ]=this[mj],this.#o()}[Kms](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}async[zms](){await this[Cke].close(),this[mj][GMn]||await this[mj].close(),this[JJ][GMn]||await this[JJ].close()}async[Yms](e){await this[Cke].destroy(e),this[mj][$Mn]||await this[mj].destroy(e),this[JJ][$Mn]||await this[JJ].destroy(e)}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||Zms[r]||0,this.#i(n,o)?r==="https:"?this[JJ]:this[mj]:this[Cke]}#i(e,r){if(this.#s&&this.#o(),this.#t.length===0)return!0;if(this.#e==="*")return!1;for(let n=0;n{"use strict";p();var mfe=require("node:assert"),{kRetryHandlerDefaultRetry:KMn}=jd(),{RequestRetryError:bke}=Ec(),{isDisturbed:JMn,parseHeaders:Xms,parseRangeHeader:ZMn,wrapRequestBody:e0s}=qs();function t0s(t){let e=Date.now();return new Date(t).getTime()-e}a(t0s,"calculateRetryAfterHeader");var Ter=class t{static{a(this,"RetryHandler")}constructor(e,r){let{retryOptions:n,...o}=e,{retry:s,maxRetries:c,maxTimeout:l,minTimeout:u,timeoutFactor:d,methods:f,errorCodes:h,retryAfter:m,statusCodes:g}=n??{};this.dispatch=r.dispatch,this.handler=r.handler,this.opts={...o,body:e0s(e.body)},this.abort=null,this.aborted=!1,this.retryOpts={retry:s??t[KMn],retryAfter:m??!0,maxTimeout:l??30*1e3,minTimeout:u??500,timeoutFactor:d??2,maxRetries:c??5,methods:f??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:g??[500,502,503,504,429],errorCodes:h??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.start=0,this.end=null,this.etag=null,this.resume=null,this.handler.onConnect(A=>{this.aborted=!0,this.abort?this.abort(A):this.reason=A})}onRequestSent(){this.handler.onRequestSent&&this.handler.onRequestSent()}onUpgrade(e,r,n){this.handler.onUpgrade&&this.handler.onUpgrade(e,r,n)}onConnect(e){this.aborted?e(this.reason):this.abort=e}onBodySent(e){if(this.handler.onBodySent)return this.handler.onBodySent(e)}static[KMn](e,{state:r,opts:n},o){let{statusCode:s,code:c,headers:l}=e,{method:u,retryOptions:d}=n,{maxRetries:f,minTimeout:h,maxTimeout:m,timeoutFactor:g,statusCodes:A,errorCodes:y,methods:E}=d,{counter:_}=r;if(c&&c!=="UND_ERR_REQ_RETRY"&&!y.includes(c)){o(e);return}if(Array.isArray(E)&&!E.includes(u)){o(e);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){o(e);return}if(_>f){o(e);return}let v=l?.["retry-after"];v&&(v=Number(v),v=Number.isNaN(v)?t0s(v):v*1e3);let b=v>0?Math.min(v,m):Math.min(h*g**(_-1),m);setTimeout(()=>o(null),b)}onHeaders(e,r,n,o){let s=Xms(r);if(this.retryCount+=1,e>=300)return this.retryOpts.statusCodes.includes(e)===!1?this.handler.onHeaders(e,r,n,o):(this.abort(new bke("Request failed",e,{headers:s,data:{count:this.retryCount}})),!1);if(this.resume!=null){if(this.resume=null,e!==206&&(this.start>0||e!==200))return this.abort(new bke("server does not support the range header and the payload was partially consumed",e,{headers:s,data:{count:this.retryCount}})),!1;let l=ZMn(s["content-range"]);if(!l)return this.abort(new bke("Content-Range mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;if(this.etag!=null&&this.etag!==s.etag)return this.abort(new bke("ETag mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;let{start:u,size:d,end:f=d-1}=l;return mfe(this.start===u,"content-range mismatch"),mfe(this.end==null||this.end===f,"content-range mismatch"),this.resume=n,!0}if(this.end==null){if(e===206){let l=ZMn(s["content-range"]);if(l==null)return this.handler.onHeaders(e,r,n,o);let{start:u,size:d,end:f=d-1}=l;mfe(u!=null&&Number.isFinite(u),"content-range mismatch"),mfe(f!=null&&Number.isFinite(f),"invalid content-length"),this.start=u,this.end=f}if(this.end==null){let l=s["content-length"];this.end=l!=null?Number(l)-1:null}return mfe(Number.isFinite(this.start)),mfe(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=n,this.etag=s.etag!=null?s.etag:null,this.etag!=null&&this.etag.startsWith("W/")&&(this.etag=null),this.handler.onHeaders(e,r,n,o)}let c=new bke("Request failed",e,{headers:s,data:{count:this.retryCount}});return this.abort(c),!1}onData(e){return this.start+=e.length,this.handler.onData(e)}onComplete(e){return this.retryCount=0,this.handler.onComplete(e)}onError(e){if(this.aborted||JMn(this.opts.body))return this.handler.onError(e);this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(e,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},r.bind(this));function r(n){if(n!=null||this.aborted||JMn(this.opts.body))return this.handler.onError(n);if(this.start!==0){let o={range:`bytes=${this.start}-${this.end??""}`};this.etag!=null&&(o["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...o}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(o){this.handler.onError(o)}}a(r,"onRetry")}};XMn.exports=Ter});var tOn=I((oef,eOn)=>{"use strict";p();var r0s=JRe(),n0s=Pnt(),Ier=class extends r0s{static{a(this,"RetryAgent")}#e=null;#t=null;constructor(e,r={}){super(r),this.#e=e,this.#t=r}dispatch(e,r){let n=new n0s({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:r});return this.#e.dispatch(e,n)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}};eOn.exports=Ier});var Der=I((cef,uOn)=>{"use strict";p();var sOn=require("node:assert"),{Readable:i0s}=require("node:stream"),{RequestAbortedError:aOn,NotSupportedError:o0s,InvalidArgumentError:s0s,AbortError:xer}=Ec(),cOn=qs(),{ReadableStreamFrom:a0s}=qs(),aT=Symbol("kConsume"),Ske=Symbol("kReading"),gj=Symbol("kBody"),rOn=Symbol("kAbort"),lOn=Symbol("kContentType"),nOn=Symbol("kContentLength"),c0s=a(()=>{},"noop"),wer=class extends i0s{static{a(this,"BodyReadable")}constructor({resume:e,abort:r,contentType:n="",contentLength:o,highWaterMark:s=64*1024}){super({autoDestroy:!0,read:e,highWaterMark:s}),this._readableState.dataEmitted=!1,this[rOn]=r,this[aT]=null,this[gj]=null,this[lOn]=n,this[nOn]=o,this[Ske]=!1}destroy(e){return!e&&!this._readableState.endEmitted&&(e=new aOn),e&&this[rOn](),super.destroy(e)}_destroy(e,r){this[Ske]?r(e):setImmediate(()=>{r(e)})}on(e,...r){return(e==="data"||e==="readable")&&(this[Ske]=!0),super.on(e,...r)}addListener(e,...r){return this.on(e,...r)}off(e,...r){let n=super.off(e,...r);return(e==="data"||e==="readable")&&(this[Ske]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,...r){return this.off(e,...r)}push(e){return this[aT]&&e!==null?(ker(this[aT],e),this[Ske]?super.push(e):!0):super.push(e)}async text(){return Tke(this,"text")}async json(){return Tke(this,"json")}async blob(){return Tke(this,"blob")}async bytes(){return Tke(this,"bytes")}async arrayBuffer(){return Tke(this,"arrayBuffer")}async formData(){throw new o0s}get bodyUsed(){return cOn.isDisturbed(this)}get body(){return this[gj]||(this[gj]=a0s(this),this[aT]&&(this[gj].getReader(),sOn(this[gj].locked))),this[gj]}async dump(e){let r=Number.isFinite(e?.limit)?e.limit:131072,n=e?.signal;if(n!=null&&(typeof n!="object"||!("aborted"in n)))throw new s0s("signal must be an AbortSignal");return n?.throwIfAborted(),this._readableState.closeEmitted?null:await new Promise((o,s)=>{this[nOn]>r&&this.destroy(new xer);let c=a(()=>{this.destroy(n.reason??new xer)},"onAbort");n?.addEventListener("abort",c),this.on("close",function(){n?.removeEventListener("abort",c),n?.aborted?s(n.reason??new xer):o(null)}).on("error",c0s).on("data",function(l){r-=l.length,r<=0&&this.destroy()}).resume()})}};function l0s(t){return t[gj]&&t[gj].locked===!0||t[aT]}a(l0s,"isLocked");function u0s(t){return cOn.isDisturbed(t)||l0s(t)}a(u0s,"isUnusable");async function Tke(t,e){return sOn(!t[aT]),new Promise((r,n)=>{if(u0s(t)){let o=t._readableState;o.destroyed&&o.closeEmitted===!1?t.on("error",s=>{n(s)}).on("close",()=>{n(new TypeError("unusable"))}):n(o.errored??new TypeError("unusable"))}else queueMicrotask(()=>{t[aT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){Per(this[aT],o)}).on("close",function(){this[aT].body!==null&&Per(this[aT],new aOn)}),d0s(t[aT])})})}a(Tke,"consume");function d0s(t){if(t.body===null)return;let{_readableState:e}=t.stream;if(e.bufferIndex){let r=e.bufferIndex,n=e.buffer.length;for(let o=r;o2&&r[0]===239&&r[1]===187&&r[2]===191?3:0;return r.utf8Slice(o,n)}a(Rer,"chunksDecode");function iOn(t,e){if(t.length===0||e===0)return new Uint8Array(0);if(t.length===1)return new Uint8Array(t[0]);let r=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer),n=0;for(let o=0;o{p();var f0s=require("node:assert"),{ResponseStatusCodeError:dOn}=Ec(),{chunksDecode:fOn}=Der(),p0s=128*1024;async function h0s({callback:t,body:e,contentType:r,statusCode:n,statusMessage:o,headers:s}){f0s(e);let c=[],l=0;try{for await(let h of e)if(c.push(h),l+=h.length,l>p0s){c=[],l=0;break}}catch{c=[],l=0}let u=`Response status code ${n}${o?`: ${o}`:""}`;if(n===204||!r||!l){queueMicrotask(()=>t(new dOn(u,n,s)));return}let d=Error.stackTraceLimit;Error.stackTraceLimit=0;let f;try{pOn(r)?f=JSON.parse(fOn(c,l)):hOn(r)&&(f=fOn(c,l))}catch{}finally{Error.stackTraceLimit=d}queueMicrotask(()=>t(new dOn(u,n,s,f)))}a(h0s,"getResolveErrorBodyCallback");var pOn=a(t=>t.length>15&&t[11]==="/"&&t[0]==="a"&&t[1]==="p"&&t[2]==="p"&&t[3]==="l"&&t[4]==="i"&&t[5]==="c"&&t[6]==="a"&&t[7]==="t"&&t[8]==="i"&&t[9]==="o"&&t[10]==="n"&&t[12]==="j"&&t[13]==="s"&&t[14]==="o"&&t[15]==="n","isContentTypeApplicationJson"),hOn=a(t=>t.length>4&&t[4]==="/"&&t[0]==="t"&&t[1]==="e"&&t[2]==="x"&&t[3]==="t","isContentTypeText");mOn.exports={getResolveErrorBodyCallback:h0s,isContentTypeApplicationJson:pOn,isContentTypeText:hOn}});var yOn=I((hef,Mer)=>{"use strict";p();var m0s=require("node:assert"),{Readable:g0s}=Der(),{InvalidArgumentError:gfe,RequestAbortedError:gOn}=Ec(),cT=qs(),{getResolveErrorBodyCallback:A0s}=Ner(),{AsyncResource:y0s}=require("node:async_hooks"),Dnt=class extends y0s{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new gfe("invalid opts");let{signal:n,method:o,opaque:s,body:c,onInfo:l,responseHeaders:u,throwOnError:d,highWaterMark:f}=e;try{if(typeof r!="function")throw new gfe("invalid callback");if(f&&(typeof f!="number"||f<0))throw new gfe("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new gfe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new gfe("invalid method");if(l&&typeof l!="function")throw new gfe("invalid onInfo callback");super("UNDICI_REQUEST")}catch(h){throw cT.isStream(c)&&cT.destroy(c.on("error",cT.nop),h),h}this.method=o,this.responseHeaders=u||null,this.opaque=s||null,this.callback=r,this.res=null,this.abort=null,this.body=c,this.trailers={},this.context=null,this.onInfo=l||null,this.throwOnError=d,this.highWaterMark=f,this.signal=n,this.reason=null,this.removeAbortListener=null,cT.isStream(c)&&c.on("error",h=>{this.onError(h)}),this.signal&&(this.signal.aborted?this.reason=this.signal.reason??new gOn:this.removeAbortListener=cT.addAbortListener(this.signal,()=>{this.reason=this.signal.reason??new gOn,this.res?cT.destroy(this.res.on("error",cT.nop),this.reason):this.abort&&this.abort(this.reason),this.removeAbortListener&&(this.res?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}))}onConnect(e,r){if(this.reason){e(this.reason);return}m0s(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{callback:s,opaque:c,abort:l,context:u,responseHeaders:d,highWaterMark:f}=this,h=d==="raw"?cT.parseRawHeaders(r):cT.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?cT.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new g0s({resume:n,abort:l,contentType:g,contentLength:this.method!=="HEAD"&&A?Number(A):null,highWaterMark:f});this.removeAbortListener&&y.on("close",this.removeAbortListener),this.callback=null,this.res=y,s!==null&&(this.throwOnError&&e>=400?this.runInAsyncScope(A0s,null,{callback:s,body:y,contentType:g,statusCode:e,statusMessage:o,headers:h}):this.runInAsyncScope(s,null,null,{statusCode:e,headers:h,trailers:this.trailers,opaque:c,body:y,context:u}))}onData(e){return this.res.push(e)}onComplete(e){cT.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:r,callback:n,body:o,opaque:s}=this;n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:s})})),r&&(this.res=null,queueMicrotask(()=>{cT.destroy(r,e)})),o&&(this.body=null,cT.destroy(o,e)),this.removeAbortListener&&(r?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}};function AOn(t,e){if(e===void 0)return new Promise((r,n)=>{AOn.call(this,t,(o,s)=>o?n(o):r(s))});try{this.dispatch(t,new Dnt(t,e))}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(AOn,"request");Mer.exports=AOn;Mer.exports.RequestHandler=Dnt});var Ike=I((Aef,vOn)=>{p();var{addAbortListener:E0s}=qs(),{RequestAbortedError:_0s}=Ec(),Afe=Symbol("kListener"),g5=Symbol("kSignal");function EOn(t){t.abort?t.abort(t[g5]?.reason):t.reason=t[g5]?.reason??new _0s,_On(t)}a(EOn,"abort");function v0s(t,e){if(t.reason=null,t[g5]=null,t[Afe]=null,!!e){if(e.aborted){EOn(t);return}t[g5]=e,t[Afe]=()=>{EOn(t)},E0s(t[g5],t[Afe])}}a(v0s,"addSignal");function _On(t){t[g5]&&("removeEventListener"in t[g5]?t[g5].removeEventListener("abort",t[Afe]):t[g5].removeListener("abort",t[Afe]),t[g5]=null,t[Afe]=null)}a(_On,"removeSignal");vOn.exports={addSignal:v0s,removeSignal:_On}});var TOn=I((_ef,SOn)=>{"use strict";p();var C0s=require("node:assert"),{finished:b0s,PassThrough:S0s}=require("node:stream"),{InvalidArgumentError:yfe,InvalidReturnValueError:T0s}=Ec(),g2=qs(),{getResolveErrorBodyCallback:I0s}=Ner(),{AsyncResource:x0s}=require("node:async_hooks"),{addSignal:w0s,removeSignal:COn}=Ike(),Oer=class extends x0s{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new yfe("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d,throwOnError:f}=e;try{if(typeof n!="function")throw new yfe("invalid callback");if(typeof r!="function")throw new yfe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new yfe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new yfe("invalid method");if(u&&typeof u!="function")throw new yfe("invalid onInfo callback");super("UNDICI_STREAM")}catch(h){throw g2.isStream(l)&&g2.destroy(l.on("error",g2.nop),h),h}this.responseHeaders=d||null,this.opaque=c||null,this.factory=r,this.callback=n,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=l,this.onInfo=u||null,this.throwOnError=f||!1,g2.isStream(l)&&l.on("error",h=>{this.onError(h)}),w0s(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}C0s(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{factory:s,opaque:c,context:l,callback:u,responseHeaders:d}=this,f=d==="raw"?g2.parseRawHeaders(r):g2.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:f});return}this.factory=null;let h;if(this.throwOnError&&e>=400){let A=(d==="raw"?g2.parseHeaders(r):f)["content-type"];h=new S0s,this.callback=null,this.runInAsyncScope(I0s,null,{callback:u,body:h,contentType:A,statusCode:e,statusMessage:o,headers:f})}else{if(s===null)return;if(h=this.runInAsyncScope(s,null,{statusCode:e,headers:f,opaque:c,context:l}),!h||typeof h.write!="function"||typeof h.end!="function"||typeof h.on!="function")throw new T0s("expected Writable");b0s(h,{readable:!1},g=>{let{callback:A,res:y,opaque:E,trailers:_,abort:v}=this;this.res=null,(g||!y.readable)&&g2.destroy(y,g),this.callback=null,this.runInAsyncScope(A,null,g||null,{opaque:E,trailers:_}),g&&v()})}return h.on("drain",n),this.res=h,(h.writableNeedDrain!==void 0?h.writableNeedDrain:h._writableState?.needDrain)!==!0}onData(e){let{res:r}=this;return r?r.write(e):!0}onComplete(e){let{res:r}=this;COn(this),r&&(this.trailers=g2.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;COn(this),this.factory=null,r?(this.res=null,g2.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,g2.destroy(s,e))}};function bOn(t,e,r){if(r===void 0)return new Promise((n,o)=>{bOn.call(this,t,e,(s,c)=>s?o(s):n(c))});try{this.dispatch(t,new Oer(t,e,r))}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(bOn,"stream");SOn.exports=bOn});var ROn=I((bef,wOn)=>{"use strict";p();var{Readable:xOn,Duplex:R0s,PassThrough:k0s}=require("node:stream"),{InvalidArgumentError:xke,InvalidReturnValueError:P0s,RequestAbortedError:Ler}=Ec(),Tw=qs(),{AsyncResource:D0s}=require("node:async_hooks"),{addSignal:N0s,removeSignal:M0s}=Ike(),IOn=require("node:assert"),Efe=Symbol("resume"),Ber=class extends xOn{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[Efe]=null}_read(){let{[Efe]:e}=this;e&&(this[Efe]=null,e())}_destroy(e,r){this._read(),r(e)}},Fer=class extends xOn{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[Efe]=e}_read(){this[Efe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new Ler),r(e)}},Uer=class extends D0s{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new xke("invalid opts");if(typeof r!="function")throw new xke("invalid handler");let{signal:n,method:o,opaque:s,onInfo:c,responseHeaders:l}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new xke("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new xke("invalid method");if(c&&typeof c!="function")throw new xke("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=s||null,this.responseHeaders=l||null,this.handler=r,this.abort=null,this.context=null,this.onInfo=c||null,this.req=new Ber().on("error",Tw.nop),this.ret=new R0s({readableObjectMode:e.objectMode,autoDestroy:!0,read:a(()=>{let{body:u}=this;u?.resume&&u.resume()},"read"),write:a((u,d,f)=>{let{req:h}=this;h.push(u,d)||h._readableState.destroyed?f():h[Efe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new Ler),A&&u&&A(),Tw.destroy(f,u),Tw.destroy(h,u),Tw.destroy(m,u),M0s(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,N0s(this,n)}onConnect(e,r){let{ret:n,res:o}=this;if(this.reason){e(this.reason);return}IOn(!o,"pipeline cannot be retried"),IOn(!n.destroyed),this.abort=e,this.context=r}onHeaders(e,r,n){let{opaque:o,handler:s,context:c}=this;if(e<200){if(this.onInfo){let u=this.responseHeaders==="raw"?Tw.parseRawHeaders(r):Tw.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new Fer(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?Tw.parseRawHeaders(r):Tw.parseHeaders(r);l=this.runInAsyncScope(s,null,{statusCode:e,headers:u,opaque:o,body:this.res,context:c})}catch(u){throw this.res.on("error",Tw.nop),u}if(!l||typeof l.on!="function")throw new P0s("expected Readable");l.on("data",u=>{let{ret:d,body:f}=this;!d.push(u)&&f.pause&&f.pause()}).on("error",u=>{let{ret:d}=this;Tw.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||Tw.destroy(u,new Ler)}),this.body=l}onData(e){let{res:r}=this;return r.push(e)}onComplete(e){let{res:r}=this;r.push(null)}onError(e){let{ret:r}=this;this.handler=null,Tw.destroy(r,e)}};function O0s(t,e){try{let r=new Uer(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new k0s().destroy(r)}}a(O0s,"pipeline");wOn.exports=O0s});var OOn=I((Ief,MOn)=>{"use strict";p();var{InvalidArgumentError:Qer,SocketError:L0s}=Ec(),{AsyncResource:B0s}=require("node:async_hooks"),kOn=qs(),{addSignal:F0s,removeSignal:POn}=Ike(),DOn=require("node:assert"),qer=class extends B0s{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Qer("invalid opts");if(typeof r!="function")throw new Qer("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Qer("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=s||null,this.opaque=o||null,this.callback=r,this.abort=null,this.context=null,F0s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}DOn(this.callback),this.abort=e,this.context=null}onHeaders(){throw new L0s("bad upgrade",null)}onUpgrade(e,r,n){DOn(e===101);let{callback:o,opaque:s,context:c}=this;POn(this),this.callback=null;let l=this.responseHeaders==="raw"?kOn.parseRawHeaders(r):kOn.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;POn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function NOn(t,e){if(e===void 0)return new Promise((r,n)=>{NOn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new qer(t,e);this.dispatch({...t,method:t.method||"GET",upgrade:t.protocol||"Websocket"},r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(NOn,"upgrade");MOn.exports=NOn});var QOn=I((Ref,UOn)=>{"use strict";p();var U0s=require("node:assert"),{AsyncResource:Q0s}=require("node:async_hooks"),{InvalidArgumentError:jer,SocketError:q0s}=Ec(),LOn=qs(),{addSignal:j0s,removeSignal:BOn}=Ike(),Her=class extends Q0s{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new jer("invalid opts");if(typeof r!="function")throw new jer("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new jer("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,j0s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}U0s(this.callback),this.abort=e,this.context=r}onHeaders(){throw new q0s("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;BOn(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?LOn.parseRawHeaders(r):LOn.parseHeaders(r)),this.runInAsyncScope(o,null,null,{statusCode:e,headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;BOn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function FOn(t,e){if(e===void 0)return new Promise((r,n)=>{FOn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Her(t,e);this.dispatch({...t,method:"CONNECT"},r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(FOn,"connect");UOn.exports=FOn});var qOn=I((Def,_fe)=>{"use strict";p();_fe.exports.request=yOn();_fe.exports.stream=TOn();_fe.exports.pipeline=ROn();_fe.exports.upgrade=OOn();_fe.exports.connect=QOn()});var $er=I((Mef,HOn)=>{"use strict";p();var{UndiciError:H0s}=Ec(),jOn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),Ger=class t extends H0s{static{a(this,"MockNotMatchedError")}constructor(e){super(e),Error.captureStackTrace(this,t),this.name="MockNotMatchedError",this.message=e||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](e){return e&&e[jOn]===!0}[jOn]=!0};HOn.exports={MockNotMatchedError:Ger}});var vfe=I((Bef,GOn)=>{"use strict";p();GOn.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected")}});var wke=I((Uef,t5n)=>{"use strict";p();var{MockNotMatchedError:ZJ}=$er(),{kDispatches:Nnt,kMockAgent:G0s,kOriginalDispatch:$0s,kOrigin:V0s,kGetNetConnect:W0s}=vfe(),{buildURL:z0s}=qs(),{STATUS_CODES:Y0s}=require("node:http"),{types:{isPromise:K0s}}=require("node:util");function NF(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(NF,"matchValue");function VOn(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(VOn,"lowerCaseEntries");function WOn(t,e){if(Array.isArray(t)){for(let r=0;r"u")return!0;if(typeof e!="object"||typeof t.headers!="object")return!1;for(let[r,n]of Object.entries(t.headers)){let o=WOn(e,r);if(!NF(n,o))return!1}return!0}a(zOn,"matchHeaders");function $On(t){if(typeof t!="string")return t;let e=t.split("?");if(e.length!==2)return t;let r=new URLSearchParams(e.pop());return r.sort(),[...e,r.toString()].join("?")}a($On,"safeUrl");function J0s(t,{path:e,method:r,body:n,headers:o}){let s=NF(t.path,e),c=NF(t.method,r),l=typeof t.body<"u"?NF(t.body,n):!0,u=zOn(t,o);return s&&c&&l&&u}a(J0s,"matchKey");function YOn(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t.toString()}a(YOn,"getResponseData");function KOn(t,e){let r=e.query?z0s(e.path,e.query):e.path,n=typeof r=="string"?$On(r):r,o=t.filter(({consumed:s})=>!s).filter(({path:s})=>NF($On(s),n));if(o.length===0)throw new ZJ(`Mock dispatch not matched for path '${n}'`);if(o=o.filter(({method:s})=>NF(s,e.method)),o.length===0)throw new ZJ(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(o=o.filter(({body:s})=>typeof s<"u"?NF(s,e.body):!0),o.length===0)throw new ZJ(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(o=o.filter(s=>zOn(s,e.headers)),o.length===0){let s=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new ZJ(`Mock dispatch not matched for headers '${s}' on path '${n}'`)}return o[0]}a(KOn,"getMockDispatch");function Z0s(t,e,r){let n={timesInvoked:0,times:1,persist:!1,consumed:!1},o=typeof r=="function"?{callback:r}:{...r},s={...n,...e,pending:!0,data:{error:null,...o}};return t.push(s),s}a(Z0s,"addMockDispatch");function Ver(t,e){let r=t.findIndex(n=>n.consumed?J0s(n,e):!1);r!==-1&&t.splice(r,1)}a(Ver,"deleteMockDispatch");function JOn(t){let{path:e,method:r,body:n,headers:o,query:s}=t;return{path:e,method:r,body:n,headers:o,query:s}}a(JOn,"buildKey");function Wer(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?setTimeout(()=>{g(this[Nnt])},d):g(this[Nnt]);function g(y,E=s){let _=Array.isArray(t.headers)?zer(t.headers):t.headers,v=typeof E=="function"?E({...t,headers:_}):E;if(K0s(v)){v.then(R=>g(y,R));return}let b=YOn(v),T=Wer(c),w=Wer(l);e.onConnect?.(R=>e.onError(R),null),e.onHeaders?.(o,T,A,ZOn(o)),e.onData?.(Buffer.from(b)),e.onComplete?.(w),Ver(y,r)}a(g,"handleReply");function A(){}return a(A,"resume"),!0}a(XOn,"mockDispatch");function egs(){let t=this[G0s],e=this[V0s],r=this[$0s];return a(function(o,s){if(t.isMockActive)try{XOn.call(this,o,s)}catch(c){if(c instanceof ZJ){let l=t[W0s]();if(l===!1)throw new ZJ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)`);if(e5n(l,e))r.call(this,o,s);else throw new ZJ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect is not enabled for this origin)`)}else throw c}else r.call(this,o,s)},"dispatch")}a(egs,"buildMockDispatch");function e5n(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>NF(n,r.host)))}a(e5n,"checkNetConnect");function tgs(t){if(t){let{agent:e,...r}=t;return r}}a(tgs,"buildMockOptions");t5n.exports={getResponseData:YOn,getMockDispatch:KOn,addMockDispatch:Z0s,deleteMockDispatch:Ver,buildKey:JOn,generateKeyValues:Wer,matchValue:NF,getResponse:X0s,getStatusText:ZOn,mockDispatch:XOn,buildMockDispatch:egs,checkNetConnect:e5n,buildMockOptions:tgs,getHeaderByName:WOn,buildHeadersFromArray:zer}});var ttr=I((jef,etr)=>{"use strict";p();var{getResponseData:rgs,buildKey:ngs,addMockDispatch:Yer}=wke(),{kDispatches:Mnt,kDispatchKey:Ont,kDefaultHeaders:Ker,kDefaultTrailers:Jer,kContentLength:Zer,kMockDispatch:Lnt}=vfe(),{InvalidArgumentError:A5}=Ec(),{buildURL:igs}=qs(),Cfe=class{static{a(this,"MockScope")}constructor(e){this[Lnt]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new A5("waitInMs must be a valid integer > 0");return this[Lnt].delay=e,this}persist(){return this[Lnt].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new A5("repeatTimes must be a valid integer > 0");return this[Lnt].times=e,this}},Xer=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new A5("opts must be an object");if(typeof e.path>"u")throw new A5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=igs(e.path,e.query);else{let n=new URL(e.path,"data://");e.path=n.pathname+n.search}typeof e.method=="string"&&(e.method=e.method.toUpperCase()),this[Ont]=ngs(e),this[Mnt]=r,this[Ker]={},this[Jer]={},this[Zer]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=rgs(r),s=this[Zer]?{"content-length":o.length}:{},c={...this[Ker],...s,...n.headers},l={...this[Jer],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new A5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new A5("responseOptions must be an object")}reply(e){if(typeof e=="function"){let s=a(l=>{let u=e(l);if(typeof u!="object"||u===null)throw new A5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=Yer(this[Mnt],this[Ont],s);return new Cfe(c)}let r={statusCode:e,data:arguments[1]===void 0?"":arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(r);let n=this.createMockScopeDispatchData(r),o=Yer(this[Mnt],this[Ont],n);return new Cfe(o)}replyWithError(e){if(typeof e>"u")throw new A5("error must be defined");let r=Yer(this[Mnt],this[Ont],{error:e});return new Cfe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new A5("headers must be defined");return this[Ker]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new A5("trailers must be defined");return this[Jer]=e,this}replyContentLength(){return this[Zer]=!0,this}};etr.exports.MockInterceptor=Xer;etr.exports.MockScope=Cfe});var itr=I(($ef,c5n)=>{"use strict";p();var{promisify:ogs}=require("node:util"),sgs=dfe(),{buildMockDispatch:ags}=wke(),{kDispatches:r5n,kMockAgent:n5n,kClose:i5n,kOriginalClose:o5n,kOrigin:s5n,kOriginalDispatch:cgs,kConnected:rtr}=vfe(),{MockInterceptor:lgs}=ttr(),a5n=jd(),{InvalidArgumentError:ugs}=Ec(),ntr=class extends sgs{static{a(this,"MockClient")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new ugs("Argument opts.agent must implement Agent");this[n5n]=r.agent,this[s5n]=e,this[r5n]=[],this[rtr]=1,this[cgs]=this.dispatch,this[o5n]=this.close.bind(this),this.dispatch=ags.call(this),this.close=this[i5n]}get[a5n.kConnected](){return this[rtr]}intercept(e){return new lgs(e,this[r5n])}async[i5n](){await ogs(this[o5n])(),this[rtr]=0,this[n5n][a5n.kClients].delete(this[s5n])}};c5n.exports=ntr});var atr=I((zef,m5n)=>{"use strict";p();var{promisify:dgs}=require("node:util"),fgs=ffe(),{buildMockDispatch:pgs}=wke(),{kDispatches:l5n,kMockAgent:u5n,kClose:d5n,kOriginalClose:f5n,kOrigin:p5n,kOriginalDispatch:hgs,kConnected:otr}=vfe(),{MockInterceptor:mgs}=ttr(),h5n=jd(),{InvalidArgumentError:ggs}=Ec(),str=class extends fgs{static{a(this,"MockPool")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new ggs("Argument opts.agent must implement Agent");this[u5n]=r.agent,this[p5n]=e,this[l5n]=[],this[otr]=1,this[hgs]=this.dispatch,this[f5n]=this.close.bind(this),this.dispatch=pgs.call(this),this.close=this[d5n]}get[h5n.kConnected](){return this[otr]}intercept(e){return new mgs(e,this[l5n])}async[d5n](){await dgs(this[f5n])(),this[otr]=0,this[u5n][h5n.kClients].delete(this[p5n])}};m5n.exports=str});var A5n=I((Zef,g5n)=>{"use strict";p();var Ags={pronoun:"it",is:"is",was:"was",this:"this"},ygs={pronoun:"they",is:"are",was:"were",this:"these"};g5n.exports=class{static{a(this,"Pluralizer")}constructor(e,r){this.singular=e,this.plural=r}pluralize(e){let r=e===1,n=r?Ags:ygs,o=r?this.singular:this.plural;return{...n,count:e,noun:o}}}});var E5n=I((rtf,y5n)=>{"use strict";p();var{Transform:Egs}=require("node:stream"),{Console:_gs}=require("node:console"),vgs=process.versions.icu?"\u2705":"Y ",Cgs=process.versions.icu?"\u274C":"N ";y5n.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new Egs({transform(r,n,o){o(null,r)}}),this.logger=new _gs({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let r=e.map(({method:n,path:o,data:{statusCode:s},persist:c,times:l,timesInvoked:u,origin:d})=>({Method:n,Origin:d,Path:o,"Status code":s,Persistent:c?vgs:Cgs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var b5n=I((otf,C5n)=>{"use strict";p();var{kClients:XJ}=jd(),bgs=pfe(),{kAgent:ctr,kMockAgentSet:Bnt,kMockAgentGet:_5n,kDispatches:ltr,kIsMockActive:Fnt,kNetConnect:eZ,kGetNetConnect:Sgs,kOptions:Unt,kFactory:Qnt}=vfe(),Tgs=itr(),Igs=atr(),{matchValue:xgs,buildMockOptions:wgs}=wke(),{InvalidArgumentError:v5n,UndiciError:Rgs}=Ec(),kgs=JRe(),Pgs=A5n(),Dgs=E5n(),utr=class extends kgs{static{a(this,"MockAgent")}constructor(e){if(super(e),this[eZ]=!0,this[Fnt]=!0,e?.agent&&typeof e.agent.dispatch!="function")throw new v5n("Argument opts.agent must implement Agent");let r=e?.agent?e.agent:new bgs(e);this[ctr]=r,this[XJ]=r[XJ],this[Unt]=wgs(e)}get(e){let r=this[_5n](e);return r||(r=this[Qnt](e),this[Bnt](e,r)),r}dispatch(e,r){return this.get(e.origin),this[ctr].dispatch(e,r)}async close(){await this[ctr].close(),this[XJ].clear()}deactivate(){this[Fnt]=!1}activate(){this[Fnt]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[eZ])?this[eZ].push(e):this[eZ]=[e];else if(typeof e>"u")this[eZ]=!0;else throw new v5n("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[eZ]=!1}get isMockActive(){return this[Fnt]}[Bnt](e,r){this[XJ].set(e,r)}[Qnt](e){let r=Object.assign({agent:this},this[Unt]);return this[Unt]&&this[Unt].connections===1?new Tgs(e,r):new Igs(e,r)}[_5n](e){let r=this[XJ].get(e);if(r)return r;if(typeof e!="string"){let n=this[Qnt]("http://localhost:9999");return this[Bnt](e,n),n}for(let[n,o]of Array.from(this[XJ]))if(o&&typeof n!="string"&&xgs(n,e)){let s=this[Qnt](e);return this[Bnt](e,s),s[ltr]=o[ltr],s}}[Sgs](){return this[eZ]}pendingInterceptors(){let e=this[XJ];return Array.from(e.entries()).flatMap(([r,n])=>n[ltr].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new Dgs}={}){let r=this.pendingInterceptors();if(r.length===0)return;let n=new Pgs("interceptor","interceptors").pluralize(r.length);throw new Rgs(` +`,"latin1"),r!==null&&o!==r){if(n[Oer])throw new eZ;process.emitWarning(new eZ)}e[hp].timeout&&e[hp].timeoutType===Cfe&&e[hp].timeout.refresh&&e[hp].timeout.refresh(),n[_j]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[vj]=!1,e&&(ji(n[bE]<=1,"pipeline should only contain this request"),o(e))}};gOn.exports=Hms});var TOn=I((Drf,SOn)=>{"use strict";p();var Pw=require("node:assert"),{pipeline:Yms}=require("node:stream"),fa=js(),{RequestContentLengthMismatchError:Uer,RequestAbortedError:yOn,SocketError:Pke,InformationalError:Qer}=_c(),{kUrl:Hnt,kReset:$nt,kClient:bfe,kRunning:Vnt,kPending:Kms,kQueue:Cj,kPendingIdx:qer,kRunningIdx:E2,kError:v2,kSocket:Dg,kStrictContentLength:Jms,kOnError:jer,kMaxConcurrentStreams:bOn,kHTTP2Session:_2,kResume:bj,kSize:Zms,kHTTPContext:Xms}=Wd(),UF=Symbol("open streams"),EOn,_On=!1,Gnt;try{Gnt=require("node:http2")}catch{Gnt={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:e0s,HTTP2_HEADER_METHOD:t0s,HTTP2_HEADER_PATH:r0s,HTTP2_HEADER_SCHEME:n0s,HTTP2_HEADER_CONTENT_LENGTH:i0s,HTTP2_HEADER_EXPECT:o0s,HTTP2_HEADER_STATUS:s0s}}=Gnt;function a0s(t){let e=[];for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.push(Buffer.from(r),Buffer.from(o));else e.push(Buffer.from(r),Buffer.from(n));return e}a(a0s,"parseH2Headers");async function c0s(t,e){t[Dg]=e,_On||(_On=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let r=Gnt.connect(t[Hnt],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[bOn]});r[UF]=0,r[bfe]=t,r[Dg]=e,fa.addListener(r,"error",u0s),fa.addListener(r,"frameError",d0s),fa.addListener(r,"end",f0s),fa.addListener(r,"goaway",p0s),fa.addListener(r,"close",function(){let{[bfe]:o}=this,{[Dg]:s}=o,c=this[Dg][v2]||this[v2]||new Pke("closed",fa.getSocketInfo(s));if(o[_2]=null,o.destroyed){Pw(o[Kms]===0);let l=o[Cj].splice(o[E2]);for(let u=0;u{n=!0}),{version:"h2",defaultPipelining:1/0,write(...o){return m0s(t,...o)},resume(){l0s(t)},destroy(o,s){n?queueMicrotask(s):e.destroy(o).on("close",s)},get destroyed(){return e.destroyed},busy(){return!1}}}a(c0s,"connectH2");function l0s(t){let e=t[Dg];e?.destroyed===!1&&(t[Zms]===0&&t[bOn]===0?(e.unref(),t[_2].unref()):(e.ref(),t[_2].ref()))}a(l0s,"resumeH2");function u0s(t){Pw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[Dg][v2]=t,this[bfe][jer](t)}a(u0s,"onHttp2SessionError");function d0s(t,e,r){if(r===0){let n=new Qer(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[Dg][v2]=n,this[bfe][jer](n)}}a(d0s,"onHttp2FrameError");function f0s(){let t=new Pke("other side closed",fa.getSocketInfo(this[Dg]));this.destroy(t),fa.destroy(this[Dg],t)}a(f0s,"onHttp2SessionEnd");function p0s(t){let e=this[v2]||new Pke(`HTTP/2: "GOAWAY" frame received with code ${t}`,fa.getSocketInfo(this)),r=this[bfe];if(r[Dg]=null,r[Xms]=null,this[_2]!=null&&(this[_2].destroy(e),this[_2]=null),fa.destroy(this[Dg],e),r[E2]{e.aborted||e.completed||(T=T||new yOn,fa.errorRequest(t,e,T),m!=null&&fa.destroy(m,T),fa.destroy(f,T),t[Cj][t[E2]++]=null,t[bj]())},"abort");try{e.onConnect(y)}catch(T){fa.errorRequest(t,e,T)}if(e.aborted)return!1;if(n==="CONNECT")return r.ref(),m=r.request(h,{endStream:!1,signal:u}),m.id&&!m.pending?(e.onUpgrade(null,null,m),++r[UF],t[Cj][t[E2]++]=null):m.once("ready",()=>{e.onUpgrade(null,null,m),++r[UF],t[Cj][t[E2]++]=null}),m.once("close",()=>{r[UF]-=1,r[UF]===0&&r.unref()}),!0;h[r0s]=o,h[n0s]="https";let E=n==="PUT"||n==="POST"||n==="PATCH";f&&typeof f.read=="function"&&f.read(0);let _=fa.bodyLength(f);if(fa.isFormDataLike(f)){EOn??=Efe().extractBody;let[T,w]=EOn(f);h["content-type"]=w,f=T.stream,_=T.length}if(_==null&&(_=e.contentLength),(_===0||!E)&&(_=null),h0s(n)&&_>0&&e.contentLength!=null&&e.contentLength!==_){if(t[Jms])return fa.errorRequest(t,e,new Uer),!1;process.emitWarning(new Uer)}_!=null&&(Pw(f,"no body must not have content length"),h[i0s]=`${_}`),r.ref();let v=n==="GET"||n==="HEAD"||f===null;return l?(h[o0s]="100-continue",m=r.request(h,{endStream:v,signal:u}),m.once("continue",b)):(m=r.request(h,{endStream:v,signal:u}),b()),++r[UF],m.once("response",T=>{let{[s0s]:w,...R}=T;if(e.onResponseStarted(),e.aborted){let x=new yOn;fa.errorRequest(t,e,x),fa.destroy(m,x);return}e.onHeaders(Number(w),a0s(R),m.resume.bind(m),"")===!1&&m.pause(),m.on("data",x=>{e.onData(x)===!1&&m.pause()})}),m.once("end",()=>{(m.state?.state==null||m.state.state<6)&&e.onComplete([]),r[UF]===0&&r.unref(),y(new Qer("HTTP/2: stream half-closed (remote)")),t[Cj][t[E2]++]=null,t[qer]=t[E2],t[bj]()}),m.once("close",()=>{r[UF]-=1,r[UF]===0&&r.unref()}),m.once("error",function(T){y(T)}),m.once("frameError",(T,w)=>{y(new Qer(`HTTP/2: "frameError" received - type ${T}, code ${w}`))}),!0;function b(){!f||_===0?vOn(y,m,null,t,e,t[Dg],_,E):fa.isBuffer(f)?vOn(y,m,f,t,e,t[Dg],_,E):fa.isBlobLike(f)?typeof f.stream=="function"?COn(y,m,f.stream(),t,e,t[Dg],_,E):A0s(y,m,f,t,e,t[Dg],_,E):fa.isStream(f)?g0s(y,t[Dg],E,m,f,t,e,_):fa.isIterable(f)?COn(y,m,f,t,e,t[Dg],_,E):Pw(!1)}a(b,"writeBodyH2")}a(m0s,"writeH2");function vOn(t,e,r,n,o,s,c,l){try{r!=null&&fa.isBuffer(r)&&(Pw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[$nt]=!0),o.onRequestSent(),n[bj]()}catch(u){t(u)}}a(vOn,"writeBuffer");function g0s(t,e,r,n,o,s,c,l){Pw(l!==0||s[Vnt]===0,"stream body cannot be pipelined");let u=Yms(o,n,f=>{f?(fa.destroy(u,f),t(f)):(fa.removeAllListeners(u),c.onRequestSent(),r||(e[$nt]=!0),s[bj]())});fa.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(g0s,"writeStream");async function A0s(t,e,r,n,o,s,c,l){Pw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new Uer;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[$nt]=!0),n[bj]()}catch(u){t(u)}}a(A0s,"writeBlob");async function COn(t,e,r,n,o,s,c,l){Pw(c!==0||n[Vnt]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let h=u;u=null,h()}}a(d,"onDrain");let f=a(()=>new Promise((h,m)=>{Pw(u===null),s[v2]?m(s[v2]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[v2])throw s[v2];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[$nt]=!0),n[bj]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(COn,"writeIterable");SOn.exports=c0s});var znt=I((Orf,wOn)=>{"use strict";p();var _5=js(),{kBodyUsed:Dke}=Wd(),Ger=require("node:assert"),{InvalidArgumentError:y0s}=_c(),E0s=require("node:events"),_0s=[300,301,302,303,307,308],IOn=Symbol("body"),Wnt=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[IOn]=e,this[Dke]=!1}async*[Symbol.asyncIterator](){Ger(!this[Dke],"disturbed"),this[Dke]=!0,yield*this[IOn]}},Her=class{static{a(this,"RedirectHandler")}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new y0s("maxRedirections must be a positive number");_5.validateHandler(o,n.method,n.upgrade),this.dispatch=e,this.location=null,this.abort=null,this.opts={...n,maxRedirections:0},this.maxRedirections=r,this.handler=o,this.history=[],this.redirectionLimitReached=!1,_5.isStream(this.opts.body)?(_5.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){Ger(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[Dke]=!1,E0s.prototype.on.call(this.opts.body,"data",function(){this[Dke]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Wnt(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&_5.isIterable(this.opts.body)&&(this.opts.body=new Wnt(this.opts.body))}onConnect(e){this.abort=e,this.handler.onConnect(e,{history:this.history})}onUpgrade(e,r,n){this.handler.onUpgrade(e,r,n)}onError(e){this.handler.onError(e)}onHeaders(e,r,n,o){if(this.location=this.history.length>=this.maxRedirections||_5.isDisturbed(this.opts.body)?null:v0s(e,r),this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections){this.request&&this.request.abort(new Error("max redirects")),this.redirectionLimitReached=!0,this.abort(new Error("max redirects"));return}if(this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location)return this.handler.onHeaders(e,r,n,o);let{origin:s,pathname:c,search:l}=_5.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c;this.opts.headers=C0s(this.opts.headers,e===303,this.opts.origin!==s),this.opts.path=u,this.opts.origin=s,this.opts.maxRedirections=0,this.opts.query=null,e===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",this.opts.body=null)}onData(e){if(!this.location)return this.handler.onData(e)}onComplete(e){this.location?(this.location=null,this.abort=null,this.dispatch(this.opts,this)):this.handler.onComplete(e)}onBodySent(e){this.handler.onBodySent&&this.handler.onBodySent(e)}};function v0s(t,e){if(_0s.indexOf(t)===-1)return null;for(let r=0;r{"use strict";p();var b0s=znt();function S0s({maxRedirections:t}){return e=>a(function(n,o){let{maxRedirections:s=t}=n;if(!s)return e(n,o);let c=new b0s(e,s,n,o);return n={...n,maxRedirections:0},e(n,c)},"Intercept")}a(S0s,"createRedirectInterceptor");ROn.exports=S0s});var Ife=I((qrf,UOn)=>{"use strict";p();var QF=require("node:assert"),OOn=require("node:net"),T0s=require("node:http"),tZ=js(),{channels:Sfe}=sfe(),I0s=GNn(),x0s=ufe(),{InvalidArgumentError:lh,InformationalError:w0s,ClientDestroyedError:R0s}=_c(),k0s=Eke(),{kUrl:v5,kServerName:Sj,kClient:P0s,kBusy:$er,kConnect:D0s,kResuming:rZ,kRunning:Bke,kPending:Fke,kSize:Lke,kQueue:C2,kConnected:N0s,kConnecting:Tfe,kNeedDrain:Ij,kKeepAliveDefaultTimeout:kOn,kHostHeader:M0s,kPendingIdx:b2,kRunningIdx:qF,kError:O0s,kPipelining:Knt,kKeepAliveTimeoutValue:L0s,kMaxHeadersSize:B0s,kKeepAliveMaxTimeout:F0s,kKeepAliveTimeoutThreshold:U0s,kHeadersTimeout:Q0s,kBodyTimeout:q0s,kStrictContentLength:j0s,kConnector:Nke,kMaxRedirections:H0s,kMaxRequests:Ver,kCounter:G0s,kClose:$0s,kDestroy:V0s,kDispatch:W0s,kInterceptors:POn,kLocalAddress:Mke,kMaxResponseSize:z0s,kOnError:Y0s,kHTTPContext:uh,kMaxConcurrentStreams:K0s,kResume:Oke}=Wd(),J0s=AOn(),Z0s=TOn(),DOn=!1,Tj=Symbol("kClosedResolve"),NOn=a(()=>{},"noop");function LOn(t){return t[Knt]??t[uh]?.defaultPipelining??1}a(LOn,"getPipelining");var Wer=class extends x0s{static{a(this,"Client")}constructor(e,{interceptors:r,maxHeaderSize:n,headersTimeout:o,socketTimeout:s,requestTimeout:c,connectTimeout:l,bodyTimeout:u,idleTimeout:d,keepAlive:f,keepAliveTimeout:h,maxKeepAliveTimeout:m,keepAliveMaxTimeout:g,keepAliveTimeoutThreshold:A,socketPath:y,pipelining:E,tls:_,strictContentLength:v,maxCachedSessions:b,maxRedirections:T,connect:w,maxRequestsPerClient:R,localAddress:x,maxResponseSize:P,autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N,maxConcurrentStreams:L,allowH2:B}={}){if(super(),f!==void 0)throw new lh("unsupported keepAlive, use pipelining=0 instead");if(s!==void 0)throw new lh("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(c!==void 0)throw new lh("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(d!==void 0)throw new lh("unsupported idleTimeout, use keepAliveTimeout instead");if(m!==void 0)throw new lh("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(n!=null&&!Number.isFinite(n))throw new lh("invalid maxHeaderSize");if(y!=null&&typeof y!="string")throw new lh("invalid socketPath");if(l!=null&&(!Number.isFinite(l)||l<0))throw new lh("invalid connectTimeout");if(h!=null&&(!Number.isFinite(h)||h<=0))throw new lh("invalid keepAliveTimeout");if(g!=null&&(!Number.isFinite(g)||g<=0))throw new lh("invalid keepAliveMaxTimeout");if(A!=null&&!Number.isFinite(A))throw new lh("invalid keepAliveTimeoutThreshold");if(o!=null&&(!Number.isInteger(o)||o<0))throw new lh("headersTimeout must be a positive integer or zero");if(u!=null&&(!Number.isInteger(u)||u<0))throw new lh("bodyTimeout must be a positive integer or zero");if(w!=null&&typeof w!="function"&&typeof w!="object")throw new lh("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new lh("maxRedirections must be a positive number");if(R!=null&&(!Number.isInteger(R)||R<0))throw new lh("maxRequestsPerClient must be a positive number");if(x!=null&&(typeof x!="string"||OOn.isIP(x)===0))throw new lh("localAddress must be valid string IP address");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new lh("maxResponseSize must be a positive number");if(N!=null&&(!Number.isInteger(N)||N<-1))throw new lh("autoSelectFamilyAttemptTimeout must be a positive number");if(B!=null&&typeof B!="boolean")throw new lh("allowH2 must be a valid boolean value");if(L!=null&&(typeof L!="number"||L<1))throw new lh("maxConcurrentStreams must be a positive integer, greater than 0");typeof w!="function"&&(w=k0s({..._,maxCachedSessions:b,allowH2:B,socketPath:y,timeout:l,...D?{autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N}:void 0,...w})),r?.Client&&Array.isArray(r.Client)?(this[POn]=r.Client,DOn||(DOn=!0,process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.",{code:"UNDICI-CLIENT-INTERCEPTOR-DEPRECATED"}))):this[POn]=[X0s({maxRedirections:T})],this[v5]=tZ.parseOrigin(e),this[Nke]=w,this[Knt]=E??1,this[B0s]=n||T0s.maxHeaderSize,this[kOn]=h??4e3,this[F0s]=g??6e5,this[U0s]=A??2e3,this[L0s]=this[kOn],this[Sj]=null,this[Mke]=x??null,this[rZ]=0,this[Ij]=0,this[M0s]=`host: ${this[v5].hostname}${this[v5].port?`:${this[v5].port}`:""}\r +`,this[q0s]=u??3e5,this[Q0s]=o??3e5,this[j0s]=v??!0,this[H0s]=T,this[Ver]=R,this[Tj]=null,this[z0s]=P>-1?P:-1,this[K0s]=L??100,this[uh]=null,this[C2]=[],this[qF]=0,this[b2]=0,this[Oke]=j=>zer(this,j),this[Y0s]=j=>BOn(this,j)}get pipelining(){return this[Knt]}set pipelining(e){this[Knt]=e,this[Oke](!0)}get[Fke](){return this[C2].length-this[b2]}get[Bke](){return this[b2]-this[qF]}get[Lke](){return this[C2].length-this[qF]}get[N0s](){return!!this[uh]&&!this[Tfe]&&!this[uh].destroyed}get[$er](){return!!(this[uh]?.busy(null)||this[Lke]>=(LOn(this)||1)||this[Fke]>0)}[D0s](e){FOn(this),this.once("connect",e)}[W0s](e,r){let n=e.origin||this[v5].origin,o=new I0s(n,e,r);return this[C2].push(o),this[rZ]||(tZ.bodyLength(o.body)==null&&tZ.isIterable(o.body)?(this[rZ]=1,queueMicrotask(()=>zer(this))):this[Oke](!0)),this[rZ]&&this[Ij]!==2&&this[$er]&&(this[Ij]=2),this[Ij]<2}async[$0s](){return new Promise(e=>{this[Lke]?this[Tj]=e:e(null)})}async[V0s](e){return new Promise(r=>{let n=this[C2].splice(this[b2]);for(let s=0;s{this[Tj]&&(this[Tj](),this[Tj]=null),r(null)},"callback");this[uh]?(this[uh].destroy(e,o),this[uh]=null):queueMicrotask(o),this[Oke]()})}},X0s=Ynt();function BOn(t,e){if(t[Bke]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){QF(t[b2]===t[qF]);let r=t[C2].splice(t[qF]);for(let n=0;n{t[Nke]({host:e,hostname:r,protocol:n,port:o,servername:t[Sj],localAddress:t[Mke]},(u,d)=>{u?l(u):c(d)})});if(t.destroyed){tZ.destroy(s.on("error",NOn),new R0s);return}QF(s);try{t[uh]=s.alpnProtocol==="h2"?await Z0s(t,s):await J0s(t,s)}catch(c){throw s.destroy().on("error",NOn),c}t[Tfe]=!1,s[G0s]=0,s[Ver]=t[Ver],s[P0s]=t,s[O0s]=null,Sfe.connected.hasSubscribers&&Sfe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[uh]?.version,servername:t[Sj],localAddress:t[Mke]},connector:t[Nke],socket:s}),t.emit("connect",t[v5],[t])}catch(s){if(t.destroyed)return;if(t[Tfe]=!1,Sfe.connectError.hasSubscribers&&Sfe.connectError.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[uh]?.version,servername:t[Sj],localAddress:t[Mke]},connector:t[Nke],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(QF(t[Bke]===0);t[Fke]>0&&t[C2][t[b2]].servername===t[Sj];){let c=t[C2][t[b2]++];tZ.errorRequest(t,c,s)}else BOn(t,s);t.emit("connectionError",t[v5],[t],s)}t[Oke]()}a(FOn,"connect");function MOn(t){t[Ij]=0,t.emit("drain",t[v5],[t])}a(MOn,"emitDrain");function zer(t,e){t[rZ]!==2&&(t[rZ]=2,egs(t,e),t[rZ]=0,t[qF]>256&&(t[C2].splice(0,t[qF]),t[b2]-=t[qF],t[qF]=0))}a(zer,"resume");function egs(t,e){for(;;){if(t.destroyed){QF(t[Fke]===0);return}if(t[Tj]&&!t[Lke]){t[Tj](),t[Tj]=null;return}if(t[uh]&&t[uh].resume(),t[$er])t[Ij]=2;else if(t[Ij]===2){e?(t[Ij]=1,queueMicrotask(()=>MOn(t))):MOn(t);continue}if(t[Fke]===0||t[Bke]>=(LOn(t)||1))return;let r=t[C2][t[b2]];if(t[v5].protocol==="https:"&&t[Sj]!==r.servername){if(t[Bke]>0)return;t[Sj]=r.servername,t[uh]?.destroy(new w0s("servername changed"),()=>{t[uh]=null,zer(t)})}if(t[Tfe])return;if(!t[uh]){FOn(t);return}if(t[uh].destroyed||t[uh].busy(r))return;!r.aborted&&t[uh].write(r)?t[b2]++:t[C2].splice(t[b2],1)}}a(egs,"_resume");UOn.exports=Wer});var Yer=I(($rf,QOn)=>{"use strict";p();var Jnt=class{static{a(this,"FixedCircularBuffer")}constructor(){this.bottom=0,this.top=0,this.list=new Array(2048),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};QOn.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new Jnt}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Jnt),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),r}}});var jOn=I((zrf,qOn)=>{p();var{kFree:tgs,kConnected:rgs,kPending:ngs,kQueued:igs,kRunning:ogs,kSize:sgs}=Wd(),nZ=Symbol("pool"),Ker=class{static{a(this,"PoolStats")}constructor(e){this[nZ]=e}get connected(){return this[nZ][rgs]}get free(){return this[nZ][tgs]}get pending(){return this[nZ][ngs]}get queued(){return this[nZ][igs]}get running(){return this[nZ][ogs]}get size(){return this[nZ][sgs]}};qOn.exports=Ker});var rtr=I((Jrf,ZOn)=>{"use strict";p();var ags=ufe(),cgs=Yer(),{kConnected:Jer,kSize:HOn,kRunning:GOn,kPending:$On,kQueued:Uke,kBusy:lgs,kFree:ugs,kUrl:dgs,kClose:fgs,kDestroy:pgs,kDispatch:hgs}=Wd(),mgs=jOn(),cb=Symbol("clients"),cv=Symbol("needDrain"),Qke=Symbol("queue"),Zer=Symbol("closed resolve"),Xer=Symbol("onDrain"),VOn=Symbol("onConnect"),WOn=Symbol("onDisconnect"),zOn=Symbol("onConnectionError"),etr=Symbol("get dispatcher"),KOn=Symbol("add client"),JOn=Symbol("remove client"),YOn=Symbol("stats"),ttr=class extends ags{static{a(this,"PoolBase")}constructor(){super(),this[Qke]=new cgs,this[cb]=[],this[Uke]=0;let e=this;this[Xer]=a(function(n,o){let s=e[Qke],c=!1;for(;!c;){let l=s.shift();if(!l)break;e[Uke]--,c=!this.dispatch(l.opts,l.handler)}this[cv]=c,!this[cv]&&e[cv]&&(e[cv]=!1,e.emit("drain",n,[e,...o])),e[Zer]&&s.isEmpty()&&Promise.all(e[cb].map(l=>l.close())).then(e[Zer])},"onDrain"),this[VOn]=(r,n)=>{e.emit("connect",r,[e,...n])},this[WOn]=(r,n,o)=>{e.emit("disconnect",r,[e,...n],o)},this[zOn]=(r,n,o)=>{e.emit("connectionError",r,[e,...n],o)},this[YOn]=new mgs(this)}get[lgs](){return this[cv]}get[Jer](){return this[cb].filter(e=>e[Jer]).length}get[ugs](){return this[cb].filter(e=>e[Jer]&&!e[cv]).length}get[$On](){let e=this[Uke];for(let{[$On]:r}of this[cb])e+=r;return e}get[GOn](){let e=0;for(let{[GOn]:r}of this[cb])e+=r;return e}get[HOn](){let e=this[Uke];for(let{[HOn]:r}of this[cb])e+=r;return e}get stats(){return this[YOn]}async[fgs](){this[Qke].isEmpty()?await Promise.all(this[cb].map(e=>e.close())):await new Promise(e=>{this[Zer]=e})}async[pgs](e){for(;;){let r=this[Qke].shift();if(!r)break;r.handler.onError(e)}await Promise.all(this[cb].map(r=>r.destroy(e)))}[hgs](e,r){let n=this[etr]();return n?n.dispatch(e,r)||(n[cv]=!0,this[cv]=!this[etr]()):(this[cv]=!0,this[Qke].push({opts:e,handler:r}),this[Uke]++),!this[cv]}[KOn](e){return e.on("drain",this[Xer]).on("connect",this[VOn]).on("disconnect",this[WOn]).on("connectionError",this[zOn]),this[cb].push(e),this[cv]&&queueMicrotask(()=>{this[cv]&&this[Xer](e[dgs],[this,e])}),this}[JOn](e){e.close(()=>{let r=this[cb].indexOf(e);r!==-1&&this[cb].splice(r,1)}),this[cv]=this[cb].some(r=>!r[cv]&&r.closed!==!0&&r.destroyed!==!0)}};ZOn.exports={PoolBase:ttr,kClients:cb,kNeedDrain:cv,kAddClient:KOn,kRemoveClient:JOn,kGetDispatcher:etr}});var xfe=I((enf,r5n)=>{"use strict";p();var{PoolBase:ggs,kClients:Znt,kNeedDrain:Ags,kAddClient:ygs,kGetDispatcher:Egs}=rtr(),_gs=Ife(),{InvalidArgumentError:ntr}=_c(),XOn=js(),{kUrl:e5n,kInterceptors:vgs}=Wd(),Cgs=Eke(),itr=Symbol("options"),otr=Symbol("connections"),t5n=Symbol("factory");function bgs(t,e){return new _gs(t,e)}a(bgs,"defaultFactory");var str=class extends ggs{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=bgs,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,...m}={}){if(super(),r!=null&&(!Number.isFinite(r)||r<0))throw new ntr("invalid connections");if(typeof n!="function")throw new ntr("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new ntr("connect must be a function or an object");typeof o!="function"&&(o=Cgs({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...d?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),this[vgs]=m.interceptors?.Pool&&Array.isArray(m.interceptors.Pool)?m.interceptors.Pool:[],this[otr]=r||null,this[e5n]=XOn.parseOrigin(e),this[itr]={...XOn.deepClone(m),connect:o,allowH2:h},this[itr].interceptors=m.interceptors?{...m.interceptors}:void 0,this[t5n]=n,this.on("connectionError",(g,A,y)=>{for(let E of A){let _=this[Znt].indexOf(E);_!==-1&&this[Znt].splice(_,1)}})}[Egs](){for(let e of this[Znt])if(!e[Ags])return e;if(!this[otr]||this[Znt].length{"use strict";p();var{BalancedPoolMissingUpstreamError:Sgs,InvalidArgumentError:Tgs}=_c(),{PoolBase:Igs,kClients:SE,kNeedDrain:qke,kAddClient:xgs,kRemoveClient:wgs,kGetDispatcher:Rgs}=rtr(),kgs=xfe(),{kUrl:atr,kInterceptors:Pgs}=Wd(),{parseOrigin:n5n}=js(),i5n=Symbol("factory"),Xnt=Symbol("options"),o5n=Symbol("kGreatestCommonDivisor"),iZ=Symbol("kCurrentWeight"),oZ=Symbol("kIndex"),Dw=Symbol("kWeight"),eit=Symbol("kMaxWeightPerServer"),tit=Symbol("kErrorPenalty");function Dgs(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(Dgs,"getGreatestCommonDivisor");function Ngs(t,e){return new kgs(t,e)}a(Ngs,"defaultFactory");var ctr=class extends Igs{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=Ngs,...n}={}){if(super(),this[Xnt]=n,this[oZ]=-1,this[iZ]=0,this[eit]=this[Xnt].maxWeightPerServer||100,this[tit]=this[Xnt].errorPenalty||15,Array.isArray(e)||(e=[e]),typeof r!="function")throw new Tgs("factory must be a function.");this[Pgs]=n.interceptors?.BalancedPool&&Array.isArray(n.interceptors.BalancedPool)?n.interceptors.BalancedPool:[],this[i5n]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=n5n(e).origin;if(this[SE].find(o=>o[atr].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[i5n](r,Object.assign({},this[Xnt]));this[xgs](n),n.on("connect",()=>{n[Dw]=Math.min(this[eit],n[Dw]+this[tit])}),n.on("connectionError",()=>{n[Dw]=Math.max(1,n[Dw]-this[tit]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[Dw]=Math.max(1,n[Dw]-this[tit]),this._updateBalancedPoolStats())});for(let o of this[SE])o[Dw]=this[eit];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[atr].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[wgs](n),this}get upstreams(){return this[SE].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[atr].origin)}[Rgs](){if(this[SE].length===0)throw new Sgs;if(!this[SE].find(s=>!s[qke]&&s.closed!==!0&&s.destroyed!==!0)||this[SE].map(s=>s[qke]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[SE].findIndex(s=>!s[qke]);for(;n++this[SE][o][Dw]&&!s[qke]&&(o=this[oZ]),this[oZ]===0&&(this[iZ]=this[iZ]-this[o5n],this[iZ]<=0&&(this[iZ]=this[eit])),s[Dw]>=this[iZ]&&!s[qke])return s}return this[iZ]=this[SE][o][Dw],this[oZ]=o,this[SE][o]}};s5n.exports=ctr});var wfe=I((snf,h5n)=>{"use strict";p();var{InvalidArgumentError:rit}=_c(),{kClients:xj,kRunning:c5n,kClose:Mgs,kDestroy:Ogs,kDispatch:Lgs,kInterceptors:Bgs}=Wd(),Fgs=ufe(),Ugs=xfe(),Qgs=Ife(),qgs=js(),jgs=Ynt(),l5n=Symbol("onConnect"),u5n=Symbol("onDisconnect"),d5n=Symbol("onConnectionError"),Hgs=Symbol("maxRedirections"),f5n=Symbol("onDrain"),p5n=Symbol("factory"),ltr=Symbol("options");function Ggs(t,e){return e&&e.connections===1?new Qgs(t,e):new Ugs(t,e)}a(Ggs,"defaultFactory");var utr=class extends Fgs{static{a(this,"Agent")}constructor({factory:e=Ggs,maxRedirections:r=0,connect:n,...o}={}){if(super(),typeof e!="function")throw new rit("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new rit("connect must be a function or an object");if(!Number.isInteger(r)||r<0)throw new rit("maxRedirections must be a positive number");n&&typeof n!="function"&&(n={...n}),this[Bgs]=o.interceptors?.Agent&&Array.isArray(o.interceptors.Agent)?o.interceptors.Agent:[jgs({maxRedirections:r})],this[ltr]={...qgs.deepClone(o),connect:n},this[ltr].interceptors=o.interceptors?{...o.interceptors}:void 0,this[Hgs]=r,this[p5n]=e,this[xj]=new Map,this[f5n]=(s,c)=>{this.emit("drain",s,[this,...c])},this[l5n]=(s,c)=>{this.emit("connect",s,[this,...c])},this[u5n]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[d5n]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[c5n](){let e=0;for(let r of this[xj].values())e+=r[c5n];return e}[Lgs](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new rit("opts.origin must be a non-empty string or URL.");let o=this[xj].get(n);return o||(o=this[p5n](e.origin,this[ltr]).on("drain",this[f5n]).on("connect",this[l5n]).on("disconnect",this[u5n]).on("connectionError",this[d5n]),this[xj].set(n,o)),o.dispatch(e,r)}async[Mgs](){let e=[];for(let r of this[xj].values())e.push(r.close());this[xj].clear(),await Promise.all(e)}async[Ogs](e){let r=[];for(let n of this[xj].values())r.push(n.destroy(e));this[xj].clear(),await Promise.all(r)}};h5n.exports=utr});var mtr=I((lnf,T5n)=>{"use strict";p();var{kProxy:dtr,kClose:_5n,kDestroy:v5n,kDispatch:m5n,kInterceptors:$gs}=Wd(),{URL:sZ}=require("node:url"),Vgs=wfe(),C5n=xfe(),b5n=ufe(),{InvalidArgumentError:Rfe,RequestAbortedError:Wgs,SecureProxyConnectionError:zgs}=_c(),g5n=Eke(),S5n=Ife(),nit=Symbol("proxy agent"),iit=Symbol("proxy client"),wj=Symbol("proxy headers"),ftr=Symbol("request tls settings"),A5n=Symbol("proxy tls settings"),y5n=Symbol("connect endpoint function"),E5n=Symbol("tunnel proxy");function Ygs(t){return t==="https:"?443:80}a(Ygs,"defaultProtocolPort");function Kgs(t,e){return new C5n(t,e)}a(Kgs,"defaultFactory");var Jgs=a(()=>{},"noop");function Zgs(t,e){return e.connections===1?new S5n(t,e):new C5n(t,e)}a(Zgs,"defaultAgentFactory");var ptr=class extends b5n{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(super(),!e)throw new Rfe("Proxy URL is mandatory");this[wj]=r,o?this.#e=o(e,{connect:n}):this.#e=new S5n(e,{connect:n})}[m5n](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new Rfe("Proxy Authentication Required (407)"));return}n&&n.call(this,l,u,d)};let{origin:o,path:s="/",headers:c={}}=e;if(e.path=o+s,!("host"in c)&&!("Host"in c)){let{host:l}=new sZ(o);c.host=l}return e.headers={...this[wj],...c},this.#e[m5n](e,r)}async[_5n](){return this.#e.close()}async[v5n](e){return this.#e.destroy(e)}},htr=class extends b5n{static{a(this,"ProxyAgent")}constructor(e){if(super(),!e||typeof e=="object"&&!(e instanceof sZ)&&!e.uri)throw new Rfe("Proxy uri is mandatory");let{clientFactory:r=Kgs}=e;if(typeof r!="function")throw new Rfe("Proxy opts.clientFactory must be a function.");let{proxyTunnel:n=!0}=e,o=this.#e(e),{href:s,origin:c,port:l,protocol:u,username:d,password:f,hostname:h}=o;if(this[dtr]={uri:s,protocol:u},this[$gs]=e.interceptors?.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],this[ftr]=e.requestTls,this[A5n]=e.proxyTls,this[wj]=e.headers||{},this[E5n]=n,e.auth&&e.token)throw new Rfe("opts.auth cannot be used in combination with opts.token");e.auth?this[wj]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[wj]["proxy-authorization"]=e.token:d&&f&&(this[wj]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=g5n({...e.proxyTls});this[y5n]=g5n({...e.requestTls});let g=e.factory||Zgs,A=a((y,E)=>{let{protocol:_}=new sZ(y);return!this[E5n]&&_==="http:"&&this[dtr].protocol==="http:"?new ptr(this[dtr].uri,{headers:this[wj],connect:m,factory:g}):g(y,E)},"factory");this[iit]=r(o,{connect:m}),this[nit]=new Vgs({...e,factory:A,connect:a(async(y,E)=>{let _=y.host;y.port||(_+=`:${Ygs(y.protocol)}`);try{let{socket:v,statusCode:b}=await this[iit].connect({origin:c,port:l,path:_,signal:y.signal,headers:{...this[wj],host:y.host},servername:this[A5n]?.servername||h});if(b!==200&&(v.on("error",Jgs).destroy(),E(new Wgs(`Proxy response (${b}) !== 200 when HTTP Tunneling`))),y.protocol!=="https:"){E(null,v);return}let T;this[ftr]?T=this[ftr].servername:T=y.servername,this[y5n]({...y,servername:T,httpSocket:v},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new zgs(v)):E(v)}},"connect")})}dispatch(e,r){let n=Xgs(e.headers);if(eAs(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new sZ(e.origin);n.host=o}return this[nit].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new sZ(e):e instanceof sZ?e:new sZ(e.uri)}async[_5n](){await this[nit].close(),await this[iit].close()}async[v5n](){await this[nit].destroy(),await this[iit].destroy()}};function Xgs(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new Rfe("Proxy-Authorization should be sent in ProxyAgent constructor")}a(eAs,"throwIfProxyAuthIsSent");T5n.exports=htr});var P5n=I((fnf,k5n)=>{"use strict";p();var tAs=ufe(),{kClose:rAs,kDestroy:nAs,kClosed:I5n,kDestroyed:x5n,kDispatch:iAs,kNoProxyAgent:jke,kHttpProxyAgent:Rj,kHttpsProxyAgent:aZ}=Wd(),w5n=mtr(),oAs=wfe(),sAs={"http:":80,"https:":443},R5n=!1,gtr=class extends tAs{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e,R5n||(R5n=!0,process.emitWarning("EnvHttpProxyAgent is experimental, expect them to change at any time.",{code:"UNDICI-EHPA"}));let{httpProxy:r,httpsProxy:n,noProxy:o,...s}=e;this[jke]=new oAs(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[Rj]=new w5n({...s,uri:c}):this[Rj]=this[jke];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[aZ]=new w5n({...s,uri:l}):this[aZ]=this[Rj],this.#o()}[iAs](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}async[rAs](){await this[jke].close(),this[Rj][I5n]||await this[Rj].close(),this[aZ][I5n]||await this[aZ].close()}async[nAs](e){await this[jke].destroy(e),this[Rj][x5n]||await this[Rj].destroy(e),this[aZ][x5n]||await this[aZ].destroy(e)}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||sAs[r]||0,this.#i(n,o)?r==="https:"?this[aZ]:this[Rj]:this[jke]}#i(e,r){if(this.#s&&this.#o(),this.#t.length===0)return!0;if(this.#e==="*")return!1;for(let n=0;n{"use strict";p();var kfe=require("node:assert"),{kRetryHandlerDefaultRetry:D5n}=Wd(),{RequestRetryError:Hke}=_c(),{isDisturbed:N5n,parseHeaders:aAs,parseRangeHeader:M5n,wrapRequestBody:cAs}=js();function lAs(t){let e=Date.now();return new Date(t).getTime()-e}a(lAs,"calculateRetryAfterHeader");var Atr=class t{static{a(this,"RetryHandler")}constructor(e,r){let{retryOptions:n,...o}=e,{retry:s,maxRetries:c,maxTimeout:l,minTimeout:u,timeoutFactor:d,methods:f,errorCodes:h,retryAfter:m,statusCodes:g}=n??{};this.dispatch=r.dispatch,this.handler=r.handler,this.opts={...o,body:cAs(e.body)},this.abort=null,this.aborted=!1,this.retryOpts={retry:s??t[D5n],retryAfter:m??!0,maxTimeout:l??30*1e3,minTimeout:u??500,timeoutFactor:d??2,maxRetries:c??5,methods:f??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:g??[500,502,503,504,429],errorCodes:h??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.start=0,this.end=null,this.etag=null,this.resume=null,this.handler.onConnect(A=>{this.aborted=!0,this.abort?this.abort(A):this.reason=A})}onRequestSent(){this.handler.onRequestSent&&this.handler.onRequestSent()}onUpgrade(e,r,n){this.handler.onUpgrade&&this.handler.onUpgrade(e,r,n)}onConnect(e){this.aborted?e(this.reason):this.abort=e}onBodySent(e){if(this.handler.onBodySent)return this.handler.onBodySent(e)}static[D5n](e,{state:r,opts:n},o){let{statusCode:s,code:c,headers:l}=e,{method:u,retryOptions:d}=n,{maxRetries:f,minTimeout:h,maxTimeout:m,timeoutFactor:g,statusCodes:A,errorCodes:y,methods:E}=d,{counter:_}=r;if(c&&c!=="UND_ERR_REQ_RETRY"&&!y.includes(c)){o(e);return}if(Array.isArray(E)&&!E.includes(u)){o(e);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){o(e);return}if(_>f){o(e);return}let v=l?.["retry-after"];v&&(v=Number(v),v=Number.isNaN(v)?lAs(v):v*1e3);let b=v>0?Math.min(v,m):Math.min(h*g**(_-1),m);setTimeout(()=>o(null),b)}onHeaders(e,r,n,o){let s=aAs(r);if(this.retryCount+=1,e>=300)return this.retryOpts.statusCodes.includes(e)===!1?this.handler.onHeaders(e,r,n,o):(this.abort(new Hke("Request failed",e,{headers:s,data:{count:this.retryCount}})),!1);if(this.resume!=null){if(this.resume=null,e!==206&&(this.start>0||e!==200))return this.abort(new Hke("server does not support the range header and the payload was partially consumed",e,{headers:s,data:{count:this.retryCount}})),!1;let l=M5n(s["content-range"]);if(!l)return this.abort(new Hke("Content-Range mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;if(this.etag!=null&&this.etag!==s.etag)return this.abort(new Hke("ETag mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;let{start:u,size:d,end:f=d-1}=l;return kfe(this.start===u,"content-range mismatch"),kfe(this.end==null||this.end===f,"content-range mismatch"),this.resume=n,!0}if(this.end==null){if(e===206){let l=M5n(s["content-range"]);if(l==null)return this.handler.onHeaders(e,r,n,o);let{start:u,size:d,end:f=d-1}=l;kfe(u!=null&&Number.isFinite(u),"content-range mismatch"),kfe(f!=null&&Number.isFinite(f),"invalid content-length"),this.start=u,this.end=f}if(this.end==null){let l=s["content-length"];this.end=l!=null?Number(l)-1:null}return kfe(Number.isFinite(this.start)),kfe(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=n,this.etag=s.etag!=null?s.etag:null,this.etag!=null&&this.etag.startsWith("W/")&&(this.etag=null),this.handler.onHeaders(e,r,n,o)}let c=new Hke("Request failed",e,{headers:s,data:{count:this.retryCount}});return this.abort(c),!1}onData(e){return this.start+=e.length,this.handler.onData(e)}onComplete(e){return this.retryCount=0,this.handler.onComplete(e)}onError(e){if(this.aborted||N5n(this.opts.body))return this.handler.onError(e);this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(e,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},r.bind(this));function r(n){if(n!=null||this.aborted||N5n(this.opts.body))return this.handler.onError(n);if(this.start!==0){let o={range:`bytes=${this.start}-${this.end??""}`};this.etag!=null&&(o["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...o}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(o){this.handler.onError(o)}}a(r,"onRetry")}};O5n.exports=Atr});var B5n=I((ynf,L5n)=>{"use strict";p();var uAs=Ake(),dAs=oit(),ytr=class extends uAs{static{a(this,"RetryAgent")}#e=null;#t=null;constructor(e,r={}){super(r),this.#e=e,this.#t=r}dispatch(e,r){let n=new dAs({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:r});return this.#e.dispatch(e,n)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}};L5n.exports=ytr});var Str=I((vnf,V5n)=>{"use strict";p();var j5n=require("node:assert"),{Readable:fAs}=require("node:stream"),{RequestAbortedError:H5n,NotSupportedError:pAs,InvalidArgumentError:hAs,AbortError:Etr}=_c(),G5n=js(),{ReadableStreamFrom:mAs}=js(),hT=Symbol("kConsume"),Gke=Symbol("kReading"),kj=Symbol("kBody"),F5n=Symbol("kAbort"),$5n=Symbol("kContentType"),U5n=Symbol("kContentLength"),gAs=a(()=>{},"noop"),_tr=class extends fAs{static{a(this,"BodyReadable")}constructor({resume:e,abort:r,contentType:n="",contentLength:o,highWaterMark:s=64*1024}){super({autoDestroy:!0,read:e,highWaterMark:s}),this._readableState.dataEmitted=!1,this[F5n]=r,this[hT]=null,this[kj]=null,this[$5n]=n,this[U5n]=o,this[Gke]=!1}destroy(e){return!e&&!this._readableState.endEmitted&&(e=new H5n),e&&this[F5n](),super.destroy(e)}_destroy(e,r){this[Gke]?r(e):setImmediate(()=>{r(e)})}on(e,...r){return(e==="data"||e==="readable")&&(this[Gke]=!0),super.on(e,...r)}addListener(e,...r){return this.on(e,...r)}off(e,...r){let n=super.off(e,...r);return(e==="data"||e==="readable")&&(this[Gke]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,...r){return this.off(e,...r)}push(e){return this[hT]&&e!==null?(Ctr(this[hT],e),this[Gke]?super.push(e):!0):super.push(e)}async text(){return $ke(this,"text")}async json(){return $ke(this,"json")}async blob(){return $ke(this,"blob")}async bytes(){return $ke(this,"bytes")}async arrayBuffer(){return $ke(this,"arrayBuffer")}async formData(){throw new pAs}get bodyUsed(){return G5n.isDisturbed(this)}get body(){return this[kj]||(this[kj]=mAs(this),this[hT]&&(this[kj].getReader(),j5n(this[kj].locked))),this[kj]}async dump(e){let r=Number.isFinite(e?.limit)?e.limit:131072,n=e?.signal;if(n!=null&&(typeof n!="object"||!("aborted"in n)))throw new hAs("signal must be an AbortSignal");return n?.throwIfAborted(),this._readableState.closeEmitted?null:await new Promise((o,s)=>{this[U5n]>r&&this.destroy(new Etr);let c=a(()=>{this.destroy(n.reason??new Etr)},"onAbort");n?.addEventListener("abort",c),this.on("close",function(){n?.removeEventListener("abort",c),n?.aborted?s(n.reason??new Etr):o(null)}).on("error",gAs).on("data",function(l){r-=l.length,r<=0&&this.destroy()}).resume()})}};function AAs(t){return t[kj]&&t[kj].locked===!0||t[hT]}a(AAs,"isLocked");function yAs(t){return G5n.isDisturbed(t)||AAs(t)}a(yAs,"isUnusable");async function $ke(t,e){return j5n(!t[hT]),new Promise((r,n)=>{if(yAs(t)){let o=t._readableState;o.destroyed&&o.closeEmitted===!1?t.on("error",s=>{n(s)}).on("close",()=>{n(new TypeError("unusable"))}):n(o.errored??new TypeError("unusable"))}else queueMicrotask(()=>{t[hT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){btr(this[hT],o)}).on("close",function(){this[hT].body!==null&&btr(this[hT],new H5n)}),EAs(t[hT])})})}a($ke,"consume");function EAs(t){if(t.body===null)return;let{_readableState:e}=t.stream;if(e.bufferIndex){let r=e.bufferIndex,n=e.buffer.length;for(let o=r;o2&&r[0]===239&&r[1]===187&&r[2]===191?3:0;return r.utf8Slice(o,n)}a(vtr,"chunksDecode");function Q5n(t,e){if(t.length===0||e===0)return new Uint8Array(0);if(t.length===1)return new Uint8Array(t[0]);let r=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer),n=0;for(let o=0;o{p();var _As=require("node:assert"),{ResponseStatusCodeError:W5n}=_c(),{chunksDecode:z5n}=Str(),vAs=128*1024;async function CAs({callback:t,body:e,contentType:r,statusCode:n,statusMessage:o,headers:s}){_As(e);let c=[],l=0;try{for await(let h of e)if(c.push(h),l+=h.length,l>vAs){c=[],l=0;break}}catch{c=[],l=0}let u=`Response status code ${n}${o?`: ${o}`:""}`;if(n===204||!r||!l){queueMicrotask(()=>t(new W5n(u,n,s)));return}let d=Error.stackTraceLimit;Error.stackTraceLimit=0;let f;try{Y5n(r)?f=JSON.parse(z5n(c,l)):K5n(r)&&(f=z5n(c,l))}catch{}finally{Error.stackTraceLimit=d}queueMicrotask(()=>t(new W5n(u,n,s,f)))}a(CAs,"getResolveErrorBodyCallback");var Y5n=a(t=>t.length>15&&t[11]==="/"&&t[0]==="a"&&t[1]==="p"&&t[2]==="p"&&t[3]==="l"&&t[4]==="i"&&t[5]==="c"&&t[6]==="a"&&t[7]==="t"&&t[8]==="i"&&t[9]==="o"&&t[10]==="n"&&t[12]==="j"&&t[13]==="s"&&t[14]==="o"&&t[15]==="n","isContentTypeApplicationJson"),K5n=a(t=>t.length>4&&t[4]==="/"&&t[0]==="t"&&t[1]==="e"&&t[2]==="x"&&t[3]==="t","isContentTypeText");J5n.exports={getResolveErrorBodyCallback:CAs,isContentTypeApplicationJson:Y5n,isContentTypeText:K5n}});var e4n=I((xnf,Itr)=>{"use strict";p();var bAs=require("node:assert"),{Readable:SAs}=Str(),{InvalidArgumentError:Pfe,RequestAbortedError:Z5n}=_c(),mT=js(),{getResolveErrorBodyCallback:TAs}=Ttr(),{AsyncResource:IAs}=require("node:async_hooks"),sit=class extends IAs{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Pfe("invalid opts");let{signal:n,method:o,opaque:s,body:c,onInfo:l,responseHeaders:u,throwOnError:d,highWaterMark:f}=e;try{if(typeof r!="function")throw new Pfe("invalid callback");if(f&&(typeof f!="number"||f<0))throw new Pfe("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Pfe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Pfe("invalid method");if(l&&typeof l!="function")throw new Pfe("invalid onInfo callback");super("UNDICI_REQUEST")}catch(h){throw mT.isStream(c)&&mT.destroy(c.on("error",mT.nop),h),h}this.method=o,this.responseHeaders=u||null,this.opaque=s||null,this.callback=r,this.res=null,this.abort=null,this.body=c,this.trailers={},this.context=null,this.onInfo=l||null,this.throwOnError=d,this.highWaterMark=f,this.signal=n,this.reason=null,this.removeAbortListener=null,mT.isStream(c)&&c.on("error",h=>{this.onError(h)}),this.signal&&(this.signal.aborted?this.reason=this.signal.reason??new Z5n:this.removeAbortListener=mT.addAbortListener(this.signal,()=>{this.reason=this.signal.reason??new Z5n,this.res?mT.destroy(this.res.on("error",mT.nop),this.reason):this.abort&&this.abort(this.reason),this.removeAbortListener&&(this.res?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}))}onConnect(e,r){if(this.reason){e(this.reason);return}bAs(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{callback:s,opaque:c,abort:l,context:u,responseHeaders:d,highWaterMark:f}=this,h=d==="raw"?mT.parseRawHeaders(r):mT.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?mT.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new SAs({resume:n,abort:l,contentType:g,contentLength:this.method!=="HEAD"&&A?Number(A):null,highWaterMark:f});this.removeAbortListener&&y.on("close",this.removeAbortListener),this.callback=null,this.res=y,s!==null&&(this.throwOnError&&e>=400?this.runInAsyncScope(TAs,null,{callback:s,body:y,contentType:g,statusCode:e,statusMessage:o,headers:h}):this.runInAsyncScope(s,null,null,{statusCode:e,headers:h,trailers:this.trailers,opaque:c,body:y,context:u}))}onData(e){return this.res.push(e)}onComplete(e){mT.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:r,callback:n,body:o,opaque:s}=this;n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:s})})),r&&(this.res=null,queueMicrotask(()=>{mT.destroy(r,e)})),o&&(this.body=null,mT.destroy(o,e)),this.removeAbortListener&&(r?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}};function X5n(t,e){if(e===void 0)return new Promise((r,n)=>{X5n.call(this,t,(o,s)=>o?n(o):r(s))});try{this.dispatch(t,new sit(t,e))}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(X5n,"request");Itr.exports=X5n;Itr.exports.RequestHandler=sit});var Vke=I((knf,n4n)=>{p();var{addAbortListener:xAs}=js(),{RequestAbortedError:wAs}=_c(),Dfe=Symbol("kListener"),C5=Symbol("kSignal");function t4n(t){t.abort?t.abort(t[C5]?.reason):t.reason=t[C5]?.reason??new wAs,r4n(t)}a(t4n,"abort");function RAs(t,e){if(t.reason=null,t[C5]=null,t[Dfe]=null,!!e){if(e.aborted){t4n(t);return}t[C5]=e,t[Dfe]=()=>{t4n(t)},xAs(t[C5],t[Dfe])}}a(RAs,"addSignal");function r4n(t){t[C5]&&("removeEventListener"in t[C5]?t[C5].removeEventListener("abort",t[Dfe]):t[C5].removeListener("abort",t[Dfe]),t[C5]=null,t[Dfe]=null)}a(r4n,"removeSignal");n4n.exports={addSignal:RAs,removeSignal:r4n}});var a4n=I((Nnf,s4n)=>{"use strict";p();var kAs=require("node:assert"),{finished:PAs,PassThrough:DAs}=require("node:stream"),{InvalidArgumentError:Nfe,InvalidReturnValueError:NAs}=_c(),S2=js(),{getResolveErrorBodyCallback:MAs}=Ttr(),{AsyncResource:OAs}=require("node:async_hooks"),{addSignal:LAs,removeSignal:i4n}=Vke(),xtr=class extends OAs{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new Nfe("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d,throwOnError:f}=e;try{if(typeof n!="function")throw new Nfe("invalid callback");if(typeof r!="function")throw new Nfe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new Nfe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new Nfe("invalid method");if(u&&typeof u!="function")throw new Nfe("invalid onInfo callback");super("UNDICI_STREAM")}catch(h){throw S2.isStream(l)&&S2.destroy(l.on("error",S2.nop),h),h}this.responseHeaders=d||null,this.opaque=c||null,this.factory=r,this.callback=n,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=l,this.onInfo=u||null,this.throwOnError=f||!1,S2.isStream(l)&&l.on("error",h=>{this.onError(h)}),LAs(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}kAs(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{factory:s,opaque:c,context:l,callback:u,responseHeaders:d}=this,f=d==="raw"?S2.parseRawHeaders(r):S2.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:f});return}this.factory=null;let h;if(this.throwOnError&&e>=400){let A=(d==="raw"?S2.parseHeaders(r):f)["content-type"];h=new DAs,this.callback=null,this.runInAsyncScope(MAs,null,{callback:u,body:h,contentType:A,statusCode:e,statusMessage:o,headers:f})}else{if(s===null)return;if(h=this.runInAsyncScope(s,null,{statusCode:e,headers:f,opaque:c,context:l}),!h||typeof h.write!="function"||typeof h.end!="function"||typeof h.on!="function")throw new NAs("expected Writable");PAs(h,{readable:!1},g=>{let{callback:A,res:y,opaque:E,trailers:_,abort:v}=this;this.res=null,(g||!y.readable)&&S2.destroy(y,g),this.callback=null,this.runInAsyncScope(A,null,g||null,{opaque:E,trailers:_}),g&&v()})}return h.on("drain",n),this.res=h,(h.writableNeedDrain!==void 0?h.writableNeedDrain:h._writableState?.needDrain)!==!0}onData(e){let{res:r}=this;return r?r.write(e):!0}onComplete(e){let{res:r}=this;i4n(this),r&&(this.trailers=S2.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;i4n(this),this.factory=null,r?(this.res=null,S2.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,S2.destroy(s,e))}};function o4n(t,e,r){if(r===void 0)return new Promise((n,o)=>{o4n.call(this,t,e,(s,c)=>s?o(s):n(c))});try{this.dispatch(t,new xtr(t,e,r))}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(o4n,"stream");s4n.exports=o4n});var d4n=I((Lnf,u4n)=>{"use strict";p();var{Readable:l4n,Duplex:BAs,PassThrough:FAs}=require("node:stream"),{InvalidArgumentError:Wke,InvalidReturnValueError:UAs,RequestAbortedError:wtr}=_c(),Nw=js(),{AsyncResource:QAs}=require("node:async_hooks"),{addSignal:qAs,removeSignal:jAs}=Vke(),c4n=require("node:assert"),Mfe=Symbol("resume"),Rtr=class extends l4n{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[Mfe]=null}_read(){let{[Mfe]:e}=this;e&&(this[Mfe]=null,e())}_destroy(e,r){this._read(),r(e)}},ktr=class extends l4n{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[Mfe]=e}_read(){this[Mfe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new wtr),r(e)}},Ptr=class extends QAs{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Wke("invalid opts");if(typeof r!="function")throw new Wke("invalid handler");let{signal:n,method:o,opaque:s,onInfo:c,responseHeaders:l}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Wke("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Wke("invalid method");if(c&&typeof c!="function")throw new Wke("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=s||null,this.responseHeaders=l||null,this.handler=r,this.abort=null,this.context=null,this.onInfo=c||null,this.req=new Rtr().on("error",Nw.nop),this.ret=new BAs({readableObjectMode:e.objectMode,autoDestroy:!0,read:a(()=>{let{body:u}=this;u?.resume&&u.resume()},"read"),write:a((u,d,f)=>{let{req:h}=this;h.push(u,d)||h._readableState.destroyed?f():h[Mfe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new wtr),A&&u&&A(),Nw.destroy(f,u),Nw.destroy(h,u),Nw.destroy(m,u),jAs(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,qAs(this,n)}onConnect(e,r){let{ret:n,res:o}=this;if(this.reason){e(this.reason);return}c4n(!o,"pipeline cannot be retried"),c4n(!n.destroyed),this.abort=e,this.context=r}onHeaders(e,r,n){let{opaque:o,handler:s,context:c}=this;if(e<200){if(this.onInfo){let u=this.responseHeaders==="raw"?Nw.parseRawHeaders(r):Nw.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new ktr(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?Nw.parseRawHeaders(r):Nw.parseHeaders(r);l=this.runInAsyncScope(s,null,{statusCode:e,headers:u,opaque:o,body:this.res,context:c})}catch(u){throw this.res.on("error",Nw.nop),u}if(!l||typeof l.on!="function")throw new UAs("expected Readable");l.on("data",u=>{let{ret:d,body:f}=this;!d.push(u)&&f.pause&&f.pause()}).on("error",u=>{let{ret:d}=this;Nw.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||Nw.destroy(u,new wtr)}),this.body=l}onData(e){let{res:r}=this;return r.push(e)}onComplete(e){let{res:r}=this;r.push(null)}onError(e){let{ret:r}=this;this.handler=null,Nw.destroy(r,e)}};function HAs(t,e){try{let r=new Ptr(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new FAs().destroy(r)}}a(HAs,"pipeline");u4n.exports=HAs});var A4n=I((Unf,g4n)=>{"use strict";p();var{InvalidArgumentError:Dtr,SocketError:GAs}=_c(),{AsyncResource:$As}=require("node:async_hooks"),f4n=js(),{addSignal:VAs,removeSignal:p4n}=Vke(),h4n=require("node:assert"),Ntr=class extends $As{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Dtr("invalid opts");if(typeof r!="function")throw new Dtr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Dtr("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=s||null,this.opaque=o||null,this.callback=r,this.abort=null,this.context=null,VAs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}h4n(this.callback),this.abort=e,this.context=null}onHeaders(){throw new GAs("bad upgrade",null)}onUpgrade(e,r,n){h4n(e===101);let{callback:o,opaque:s,context:c}=this;p4n(this),this.callback=null;let l=this.responseHeaders==="raw"?f4n.parseRawHeaders(r):f4n.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;p4n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function m4n(t,e){if(e===void 0)return new Promise((r,n)=>{m4n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Ntr(t,e);this.dispatch({...t,method:t.method||"GET",upgrade:t.protocol||"Websocket"},r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(m4n,"upgrade");g4n.exports=m4n});var C4n=I((jnf,v4n)=>{"use strict";p();var WAs=require("node:assert"),{AsyncResource:zAs}=require("node:async_hooks"),{InvalidArgumentError:Mtr,SocketError:YAs}=_c(),y4n=js(),{addSignal:KAs,removeSignal:E4n}=Vke(),Otr=class extends zAs{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Mtr("invalid opts");if(typeof r!="function")throw new Mtr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Mtr("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,KAs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}WAs(this.callback),this.abort=e,this.context=r}onHeaders(){throw new YAs("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;E4n(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?y4n.parseRawHeaders(r):y4n.parseHeaders(r)),this.runInAsyncScope(o,null,null,{statusCode:e,headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;E4n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function _4n(t,e){if(e===void 0)return new Promise((r,n)=>{_4n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Otr(t,e);this.dispatch({...t,method:"CONNECT"},r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(_4n,"connect");v4n.exports=_4n});var b4n=I(($nf,Ofe)=>{"use strict";p();Ofe.exports.request=e4n();Ofe.exports.stream=a4n();Ofe.exports.pipeline=d4n();Ofe.exports.upgrade=A4n();Ofe.exports.connect=C4n()});var Btr=I((Wnf,T4n)=>{"use strict";p();var{UndiciError:JAs}=_c(),S4n=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),Ltr=class t extends JAs{static{a(this,"MockNotMatchedError")}constructor(e){super(e),Error.captureStackTrace(this,t),this.name="MockNotMatchedError",this.message=e||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](e){return e&&e[S4n]===!0}[S4n]=!0};T4n.exports={MockNotMatchedError:Ltr}});var Lfe=I((Knf,I4n)=>{"use strict";p();I4n.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected")}});var zke=I((Znf,B4n)=>{"use strict";p();var{MockNotMatchedError:cZ}=Btr(),{kDispatches:ait,kMockAgent:ZAs,kOriginalDispatch:XAs,kOrigin:eys,kGetNetConnect:tys}=Lfe(),{buildURL:rys}=js(),{STATUS_CODES:nys}=require("node:http"),{types:{isPromise:iys}}=require("node:util");function jF(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(jF,"matchValue");function w4n(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(w4n,"lowerCaseEntries");function R4n(t,e){if(Array.isArray(t)){for(let r=0;r"u")return!0;if(typeof e!="object"||typeof t.headers!="object")return!1;for(let[r,n]of Object.entries(t.headers)){let o=R4n(e,r);if(!jF(n,o))return!1}return!0}a(k4n,"matchHeaders");function x4n(t){if(typeof t!="string")return t;let e=t.split("?");if(e.length!==2)return t;let r=new URLSearchParams(e.pop());return r.sort(),[...e,r.toString()].join("?")}a(x4n,"safeUrl");function oys(t,{path:e,method:r,body:n,headers:o}){let s=jF(t.path,e),c=jF(t.method,r),l=typeof t.body<"u"?jF(t.body,n):!0,u=k4n(t,o);return s&&c&&l&&u}a(oys,"matchKey");function P4n(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t.toString()}a(P4n,"getResponseData");function D4n(t,e){let r=e.query?rys(e.path,e.query):e.path,n=typeof r=="string"?x4n(r):r,o=t.filter(({consumed:s})=>!s).filter(({path:s})=>jF(x4n(s),n));if(o.length===0)throw new cZ(`Mock dispatch not matched for path '${n}'`);if(o=o.filter(({method:s})=>jF(s,e.method)),o.length===0)throw new cZ(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(o=o.filter(({body:s})=>typeof s<"u"?jF(s,e.body):!0),o.length===0)throw new cZ(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(o=o.filter(s=>k4n(s,e.headers)),o.length===0){let s=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new cZ(`Mock dispatch not matched for headers '${s}' on path '${n}'`)}return o[0]}a(D4n,"getMockDispatch");function sys(t,e,r){let n={timesInvoked:0,times:1,persist:!1,consumed:!1},o=typeof r=="function"?{callback:r}:{...r},s={...n,...e,pending:!0,data:{error:null,...o}};return t.push(s),s}a(sys,"addMockDispatch");function Ftr(t,e){let r=t.findIndex(n=>n.consumed?oys(n,e):!1);r!==-1&&t.splice(r,1)}a(Ftr,"deleteMockDispatch");function N4n(t){let{path:e,method:r,body:n,headers:o,query:s}=t;return{path:e,method:r,body:n,headers:o,query:s}}a(N4n,"buildKey");function Utr(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?setTimeout(()=>{g(this[ait])},d):g(this[ait]);function g(y,E=s){let _=Array.isArray(t.headers)?Qtr(t.headers):t.headers,v=typeof E=="function"?E({...t,headers:_}):E;if(iys(v)){v.then(R=>g(y,R));return}let b=P4n(v),T=Utr(c),w=Utr(l);e.onConnect?.(R=>e.onError(R),null),e.onHeaders?.(o,T,A,M4n(o)),e.onData?.(Buffer.from(b)),e.onComplete?.(w),Ftr(y,r)}a(g,"handleReply");function A(){}return a(A,"resume"),!0}a(O4n,"mockDispatch");function cys(){let t=this[ZAs],e=this[eys],r=this[XAs];return a(function(o,s){if(t.isMockActive)try{O4n.call(this,o,s)}catch(c){if(c instanceof cZ){let l=t[tys]();if(l===!1)throw new cZ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)`);if(L4n(l,e))r.call(this,o,s);else throw new cZ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect is not enabled for this origin)`)}else throw c}else r.call(this,o,s)},"dispatch")}a(cys,"buildMockDispatch");function L4n(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>jF(n,r.host)))}a(L4n,"checkNetConnect");function lys(t){if(t){let{agent:e,...r}=t;return r}}a(lys,"buildMockOptions");B4n.exports={getResponseData:P4n,getMockDispatch:D4n,addMockDispatch:sys,deleteMockDispatch:Ftr,buildKey:N4n,generateKeyValues:Utr,matchValue:jF,getResponse:ays,getStatusText:M4n,mockDispatch:O4n,buildMockDispatch:cys,checkNetConnect:L4n,buildMockOptions:lys,getHeaderByName:R4n,buildHeadersFromArray:Qtr}});var Wtr=I((tif,Vtr)=>{"use strict";p();var{getResponseData:uys,buildKey:dys,addMockDispatch:qtr}=zke(),{kDispatches:cit,kDispatchKey:lit,kDefaultHeaders:jtr,kDefaultTrailers:Htr,kContentLength:Gtr,kMockDispatch:uit}=Lfe(),{InvalidArgumentError:b5}=_c(),{buildURL:fys}=js(),Bfe=class{static{a(this,"MockScope")}constructor(e){this[uit]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new b5("waitInMs must be a valid integer > 0");return this[uit].delay=e,this}persist(){return this[uit].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new b5("repeatTimes must be a valid integer > 0");return this[uit].times=e,this}},$tr=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new b5("opts must be an object");if(typeof e.path>"u")throw new b5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=fys(e.path,e.query);else{let n=new URL(e.path,"data://");e.path=n.pathname+n.search}typeof e.method=="string"&&(e.method=e.method.toUpperCase()),this[lit]=dys(e),this[cit]=r,this[jtr]={},this[Htr]={},this[Gtr]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=uys(r),s=this[Gtr]?{"content-length":o.length}:{},c={...this[jtr],...s,...n.headers},l={...this[Htr],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new b5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new b5("responseOptions must be an object")}reply(e){if(typeof e=="function"){let s=a(l=>{let u=e(l);if(typeof u!="object"||u===null)throw new b5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=qtr(this[cit],this[lit],s);return new Bfe(c)}let r={statusCode:e,data:arguments[1]===void 0?"":arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(r);let n=this.createMockScopeDispatchData(r),o=qtr(this[cit],this[lit],n);return new Bfe(o)}replyWithError(e){if(typeof e>"u")throw new b5("error must be defined");let r=qtr(this[cit],this[lit],{error:e});return new Bfe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new b5("headers must be defined");return this[jtr]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new b5("trailers must be defined");return this[Htr]=e,this}replyContentLength(){return this[Gtr]=!0,this}};Vtr.exports.MockInterceptor=$tr;Vtr.exports.MockScope=Bfe});var Ktr=I((iif,G4n)=>{"use strict";p();var{promisify:pys}=require("node:util"),hys=Ife(),{buildMockDispatch:mys}=zke(),{kDispatches:F4n,kMockAgent:U4n,kClose:Q4n,kOriginalClose:q4n,kOrigin:j4n,kOriginalDispatch:gys,kConnected:ztr}=Lfe(),{MockInterceptor:Ays}=Wtr(),H4n=Wd(),{InvalidArgumentError:yys}=_c(),Ytr=class extends hys{static{a(this,"MockClient")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new yys("Argument opts.agent must implement Agent");this[U4n]=r.agent,this[j4n]=e,this[F4n]=[],this[ztr]=1,this[gys]=this.dispatch,this[q4n]=this.close.bind(this),this.dispatch=mys.call(this),this.close=this[Q4n]}get[H4n.kConnected](){return this[ztr]}intercept(e){return new Ays(e,this[F4n])}async[Q4n](){await pys(this[q4n])(),this[ztr]=0,this[U4n][H4n.kClients].delete(this[j4n])}};G4n.exports=Ytr});var Xtr=I((aif,J4n)=>{"use strict";p();var{promisify:Eys}=require("node:util"),_ys=xfe(),{buildMockDispatch:vys}=zke(),{kDispatches:$4n,kMockAgent:V4n,kClose:W4n,kOriginalClose:z4n,kOrigin:Y4n,kOriginalDispatch:Cys,kConnected:Jtr}=Lfe(),{MockInterceptor:bys}=Wtr(),K4n=Wd(),{InvalidArgumentError:Sys}=_c(),Ztr=class extends _ys{static{a(this,"MockPool")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new Sys("Argument opts.agent must implement Agent");this[V4n]=r.agent,this[Y4n]=e,this[$4n]=[],this[Jtr]=1,this[Cys]=this.dispatch,this[z4n]=this.close.bind(this),this.dispatch=vys.call(this),this.close=this[W4n]}get[K4n.kConnected](){return this[Jtr]}intercept(e){return new bys(e,this[$4n])}async[W4n](){await Eys(this[z4n])(),this[Jtr]=0,this[V4n][K4n.kClients].delete(this[Y4n])}};J4n.exports=Ztr});var X4n=I((dif,Z4n)=>{"use strict";p();var Tys={pronoun:"it",is:"is",was:"was",this:"this"},Iys={pronoun:"they",is:"are",was:"were",this:"these"};Z4n.exports=class{static{a(this,"Pluralizer")}constructor(e,r){this.singular=e,this.plural=r}pluralize(e){let r=e===1,n=r?Tys:Iys,o=r?this.singular:this.plural;return{...n,count:e,noun:o}}}});var tLn=I((mif,eLn)=>{"use strict";p();var{Transform:xys}=require("node:stream"),{Console:wys}=require("node:console"),Rys=process.versions.icu?"\u2705":"Y ",kys=process.versions.icu?"\u274C":"N ";eLn.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new xys({transform(r,n,o){o(null,r)}}),this.logger=new wys({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let r=e.map(({method:n,path:o,data:{statusCode:s},persist:c,times:l,timesInvoked:u,origin:d})=>({Method:n,Origin:d,Path:o,"Status code":s,Persistent:c?Rys:kys,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var oLn=I((yif,iLn)=>{"use strict";p();var{kClients:lZ}=Wd(),Pys=wfe(),{kAgent:trr,kMockAgentSet:dit,kMockAgentGet:rLn,kDispatches:rrr,kIsMockActive:fit,kNetConnect:uZ,kGetNetConnect:Dys,kOptions:pit,kFactory:hit}=Lfe(),Nys=Ktr(),Mys=Xtr(),{matchValue:Oys,buildMockOptions:Lys}=zke(),{InvalidArgumentError:nLn,UndiciError:Bys}=_c(),Fys=Ake(),Uys=X4n(),Qys=tLn(),nrr=class extends Fys{static{a(this,"MockAgent")}constructor(e){if(super(e),this[uZ]=!0,this[fit]=!0,e?.agent&&typeof e.agent.dispatch!="function")throw new nLn("Argument opts.agent must implement Agent");let r=e?.agent?e.agent:new Pys(e);this[trr]=r,this[lZ]=r[lZ],this[pit]=Lys(e)}get(e){let r=this[rLn](e);return r||(r=this[hit](e),this[dit](e,r)),r}dispatch(e,r){return this.get(e.origin),this[trr].dispatch(e,r)}async close(){await this[trr].close(),this[lZ].clear()}deactivate(){this[fit]=!1}activate(){this[fit]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[uZ])?this[uZ].push(e):this[uZ]=[e];else if(typeof e>"u")this[uZ]=!0;else throw new nLn("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[uZ]=!1}get isMockActive(){return this[fit]}[dit](e,r){this[lZ].set(e,r)}[hit](e){let r=Object.assign({agent:this},this[pit]);return this[pit]&&this[pit].connections===1?new Nys(e,r):new Mys(e,r)}[rLn](e){let r=this[lZ].get(e);if(r)return r;if(typeof e!="string"){let n=this[hit]("http://localhost:9999");return this[dit](e,n),n}for(let[n,o]of Array.from(this[lZ]))if(o&&typeof n!="string"&&Oys(n,e)){let s=this[hit](e);return this[dit](e,s),s[rrr]=o[rrr],s}}[Dys](){return this[uZ]}pendingInterceptors(){let e=this[lZ];return Array.from(e.entries()).flatMap(([r,n])=>n[rrr].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new Qys}={}){let r=this.pendingInterceptors();if(r.length===0)return;let n=new Uys("interceptor","interceptors").pluralize(r.length);throw new Bys(` ${n.count} ${n.noun} ${n.is} pending: ${e.format(r)} -`.trim())}};C5n.exports=utr});var qnt=I((ctf,x5n)=>{"use strict";p();var S5n=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:Ngs}=Ec(),Mgs=pfe();I5n()===void 0&&T5n(new Mgs);function T5n(t){if(!t||typeof t.dispatch!="function")throw new Ngs("Argument agent must implement Agent");Object.defineProperty(globalThis,S5n,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(T5n,"setGlobalDispatcher");function I5n(){return globalThis[S5n]}a(I5n,"getGlobalDispatcher");x5n.exports={setGlobalDispatcher:T5n,getGlobalDispatcher:I5n}});var jnt=I((ftf,w5n)=>{"use strict";p();w5n.exports=class{static{a(this,"DecoratorHandler")}#e;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=e}onConnect(...e){return this.#e.onConnect?.(...e)}onError(...e){return this.#e.onError?.(...e)}onUpgrade(...e){return this.#e.onUpgrade?.(...e)}onResponseStarted(...e){return this.#e.onResponseStarted?.(...e)}onHeaders(...e){return this.#e.onHeaders?.(...e)}onData(...e){return this.#e.onData?.(...e)}onComplete(...e){return this.#e.onComplete?.(...e)}onBodySent(...e){return this.#e.onBodySent?.(...e)}}});var k5n=I((mtf,R5n)=>{"use strict";p();var Ogs=_nt();R5n.exports=t=>{let e=t?.maxRedirections;return r=>a(function(o,s){let{maxRedirections:c=e,...l}=o;if(!c)return r(o,s);let u=new Ogs(r,c,o,s);return r(l,u)},"redirectInterceptor")}});var D5n=I((ytf,P5n)=>{"use strict";p();var Lgs=Pnt();P5n.exports=t=>e=>a(function(n,o){return e(n,new Lgs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var M5n=I((vtf,N5n)=>{"use strict";p();var Bgs=qs(),{InvalidArgumentError:Fgs,RequestAbortedError:Ugs}=Ec(),Qgs=jnt(),dtr=class extends Qgs{static{a(this,"DumpHandler")}#e=1024*1024;#t=null;#r=!1;#n=!1;#i=0;#o=null;#s=null;constructor({maxSize:e},r){if(super(r),e!=null&&(!Number.isFinite(e)||e<1))throw new Fgs("maxSize must be a number greater than 0");this.#e=e??this.#e,this.#s=r}onConnect(e){this.#t=e,this.#s.onConnect(this.#a.bind(this))}#a(e){this.#n=!0,this.#o=e}onHeaders(e,r,n,o){let c=Bgs.parseHeaders(r)["content-length"];if(c!=null&&c>this.#e)throw new Ugs(`Response size (${c}) larger than maxSize (${this.#e})`);return this.#n?!0:this.#s.onHeaders(e,r,n,o)}onError(e){this.#r||(e=this.#o??e,this.#s.onError(e))}onData(e){return this.#i=this.#i+e.length,this.#i>=this.#e&&(this.#r=!0,this.#n?this.#s.onError(this.#o):this.#s.onComplete([])),!0}onComplete(e){if(!this.#r){if(this.#n){this.#s.onError(this.reason);return}this.#s.onComplete(e)}}};function qgs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new dtr({maxSize:s},o);return e(n,c)},"Intercept")}a(qgs,"createDumpInterceptor");N5n.exports=qgs});var B5n=I((Stf,L5n)=>{"use strict";p();var{isIP:jgs}=require("node:net"),{lookup:Hgs}=require("node:dns"),Ggs=jnt(),{InvalidArgumentError:bfe,InformationalError:$gs}=Ec(),O5n=Math.pow(2,31)-1,ftr=class{static{a(this,"DNSInstance")}#e=0;#t=0;#r=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#n,this.pick=e.pick??this.#i}get full(){return this.#r.size===this.#t}runLookup(e,r,n){let o=this.#r.get(e.hostname);if(o==null&&this.full){n(null,e.origin);return}let s={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...r.dns,maxTTL:this.#e,maxItems:this.#t};if(o==null)this.lookup(e,s,(c,l)=>{if(c||l==null||l.length===0){n(c??new $gs("No DNS entries found"));return}this.setRecords(e,l);let u=this.#r.get(e.hostname),d=this.pick(e,u,s.affinity),f;typeof d.port=="number"?f=`:${d.port}`:e.port!==""?f=`:${e.port}`:f="",n(null,`${e.protocol}//${d.family===6?`[${d.address}]`:d.address}${f}`)});else{let c=this.pick(e,o,s.affinity);if(c==null){this.#r.delete(e.hostname),this.runLookup(e,r,n);return}let l;typeof c.port=="number"?l=`:${c.port}`:e.port!==""?l=`:${e.port}`:l="",n(null,`${e.protocol}//${c.family===6?`[${c.address}]`:c.address}${l}`)}}#n(e,r,n){Hgs(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(o,s)=>{if(o)return n(o);let c=new Map;for(let l of s)c.set(`${l.address}:${l.family}`,l);n(null,c.values())})}#i(e,r,n){let o=null,{records:s,offset:c}=r,l;if(this.dualStack?(n==null&&(c==null||c===O5n?(r.offset=0,n=4):(r.offset++,n=(r.offset&1)===1?6:4)),s[n]!=null&&s[n].ips.length>0?l=s[n]:l=s[n===4?6:4]):l=s[n],l==null||l.ips.length===0)return o;l.offset==null||l.offset===O5n?l.offset=0:l.offset++;let u=l.offset%l.ips.length;return o=l.ips[u]??null,o==null?o:Date.now()-o.timestamp>o.ttl?(l.ips.splice(u,1),this.pick(e,r,n)):o}setRecords(e,r){let n=Date.now(),o={records:{4:null,6:null}};for(let s of r){s.timestamp=n,typeof s.ttl=="number"?s.ttl=Math.min(s.ttl,this.#e):s.ttl=this.#e;let c=o.records[s.family]??{ips:[]};c.ips.push(s),o.records[s.family]=c}this.#r.set(e.hostname,o)}getHandler(e,r){return new ptr(this,e,r)}},ptr=class extends Ggs{static{a(this,"DNSDispatchHandler")}#e=null;#t=null;#r=null;#n=null;#i=null;constructor(e,{origin:r,handler:n,dispatch:o},s){super(n),this.#i=r,this.#n=n,this.#t={...s},this.#e=e,this.#r=o}onError(e){switch(e.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){this.#e.runLookup(this.#i,this.#t,(r,n)=>{if(r)return this.#n.onError(r);let o={...this.#t,origin:n};this.#r(o,this)});return}this.#n.onError(e);return}case"ENOTFOUND":this.#e.deleteRecord(this.#i);default:this.#n.onError(e);break}}};L5n.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new bfe("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new bfe("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new bfe("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new bfe("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new bfe("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new bfe("Invalid pick. Must be a function");let e=t?.dualStack??!0,r;e?r=t?.affinity??null:r=t?.affinity??4;let n={maxTTL:t?.maxTTL??1e4,lookup:t?.lookup??null,pick:t?.pick??null,dualStack:e,affinity:r,maxItems:t?.maxItems??1/0},o=new ftr(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return jgs(d.hostname)!==0?s(l,u):(o.runLookup(d,l,(f,h)=>{if(f)return u.onError(f);let m=null;m={...l,servername:d.hostname,origin:h,headers:{host:d.hostname,...l.headers}},s(m,o.getHandler({origin:d,dispatch:s,handler:u},l))}),!0)},"dnsInterceptor")}});var tZ=I((xtf,G5n)=>{"use strict";p();var{kConstruct:Vgs}=jd(),{kEnumerableProperty:Sfe}=qs(),{iteratorMixin:Wgs,isValidHeaderName:Rke,isValidHeaderValue:U5n}=sT(),{webidl:$a}=qA(),htr=require("node:assert"),Hnt=require("node:util"),sm=Symbol("headers map"),lT=Symbol("headers map sorted");function F5n(t){return t===10||t===13||t===9||t===32}a(F5n,"isHTTPWhiteSpaceCharCode");function Q5n(t){let e=0,r=t.length;for(;r>e&&F5n(t.charCodeAt(r-1));)--r;for(;r>e&&F5n(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(Q5n,"headerValueNormalize");function q5n(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(q5n,"fill");function mtr(t,e,r){if(r=Q5n(r),Rke(e)){if(!U5n(r))throw $a.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw $a.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(H5n(t)==="immutable")throw new TypeError("immutable");return gtr(t).append(e,r,!1)}a(mtr,"appendHeader");function j5n(t,e){return t[0]>1),r[d][0]<=f[0]?u=d+1:l=d;if(s!==d){for(c=s;c>u;)r[c]=r[--c];r[u]=f}}if(!n.next().done)throw new TypeError("Unreachable");return r}else{let n=0;for(let{0:o,1:{value:s}}of this[sm])r[n++]=[o,s],htr(s!==null);return r.sort(j5n)}}},A2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){$a.util.markAsUncloneable(this),e!==Vgs&&(this.#t=new Gnt,this.#e="none",e!==void 0&&(e=$a.converters.HeadersInit(e,"Headers contructor","init"),q5n(this,e)))}append(e,r){$a.brandCheck(this,t),$a.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=$a.converters.ByteString(e,n,"name"),r=$a.converters.ByteString(r,n,"value"),mtr(this,e,r)}delete(e){if($a.brandCheck(this,t),$a.argumentLengthCheck(arguments,1,"Headers.delete"),e=$a.converters.ByteString(e,"Headers.delete","name"),!Rke(e))throw $a.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){$a.brandCheck(this,t),$a.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=$a.converters.ByteString(e,r,"name"),!Rke(e))throw $a.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){$a.brandCheck(this,t),$a.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=$a.converters.ByteString(e,r,"name"),!Rke(e))throw $a.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){$a.brandCheck(this,t),$a.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=$a.converters.ByteString(e,n,"name"),r=$a.converters.ByteString(r,n,"value"),r=Q5n(r),Rke(e)){if(!U5n(r))throw $a.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw $a.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){$a.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}get[lT](){if(this.#t[lT])return this.#t[lT];let e=[],r=this.#t.toSortedArray(),n=this.#t.cookies;if(n===null||n.length===1)return this.#t[lT]=r;for(let o=0;o>"](t,e,r,n.bind(t)):$a.converters["record"](t,e,r)}throw $a.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};G5n.exports={fill:q5n,compareHeaderName:j5n,Headers:A2,HeadersList:Gnt,getHeadersGuard:H5n,setHeadersGuard:zgs,setHeadersList:Ygs,getHeadersList:gtr}});var Pke=I((ktf,r4n)=>{"use strict";p();var{Headers:K5n,HeadersList:$5n,fill:Kgs,getHeadersGuard:Jgs,setHeadersGuard:J5n,setHeadersList:Z5n}=tZ(),{extractBody:V5n,cloneBody:Zgs,mixinBody:Xgs,hasFinalizationRegistry:X5n,streamRegistry:e4n,bodyUnusable:eAs}=ife(),Atr=qs(),W5n=require("node:util"),{kEnumerableProperty:uT}=Atr,{isValidReasonPhrase:tAs,isCancelled:rAs,isAborted:nAs,isBlobLike:iAs,serializeJavascriptValueToJSONString:oAs,isErrorLike:sAs,isomorphicEncode:aAs,environmentSettingsObject:cAs}=sT(),{redirectStatusSet:lAs,nullBodyStatus:uAs}=eke(),{kState:Gd,kHeaders:MF}=oj(),{webidl:ss}=qA(),{FormData:dAs}=ske(),{URLSerializer:z5n}=nb(),{kConstruct:Vnt}=jd(),ytr=require("node:assert"),{types:fAs}=require("node:util"),pAs=new TextEncoder("utf-8"),rZ=class t{static{a(this,"Response")}static error(){return kke(Wnt(),"immutable")}static json(e,r={}){ss.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=ss.converters.ResponseInit(r));let n=pAs.encode(oAs(e)),o=V5n(n),s=kke(Tfe({}),"response");return Y5n(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){ss.argumentLengthCheck(arguments,1,"Response.redirect"),e=ss.converters.USVString(e),r=ss.converters["unsigned short"](r);let n;try{n=new URL(e,cAs.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!lAs.has(r))throw new RangeError(`Invalid status code ${r}`);let o=kke(Tfe({}),"immutable");o[Gd].status=r;let s=aAs(z5n(n));return o[Gd].headersList.append("location",s,!0),o}constructor(e=null,r={}){if(ss.util.markAsUncloneable(this),e===Vnt)return;e!==null&&(e=ss.converters.BodyInit(e)),r=ss.converters.ResponseInit(r),this[Gd]=Tfe({}),this[MF]=new K5n(Vnt),J5n(this[MF],"response"),Z5n(this[MF],this[Gd].headersList);let n=null;if(e!=null){let[o,s]=V5n(e);n={body:o,type:s}}Y5n(this,r,n)}get type(){return ss.brandCheck(this,t),this[Gd].type}get url(){ss.brandCheck(this,t);let e=this[Gd].urlList,r=e[e.length-1]??null;return r===null?"":z5n(r,!0)}get redirected(){return ss.brandCheck(this,t),this[Gd].urlList.length>1}get status(){return ss.brandCheck(this,t),this[Gd].status}get ok(){return ss.brandCheck(this,t),this[Gd].status>=200&&this[Gd].status<=299}get statusText(){return ss.brandCheck(this,t),this[Gd].statusText}get headers(){return ss.brandCheck(this,t),this[MF]}get body(){return ss.brandCheck(this,t),this[Gd].body?this[Gd].body.stream:null}get bodyUsed(){return ss.brandCheck(this,t),!!this[Gd].body&&Atr.isDisturbed(this[Gd].body.stream)}clone(){if(ss.brandCheck(this,t),eAs(this))throw ss.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=Etr(this[Gd]);return X5n&&this[Gd].body?.stream&&e4n.register(this,new WeakRef(this[Gd].body.stream)),kke(e,Jgs(this[MF]))}[W5n.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${W5n.formatWithOptions(r,n)}`}};Xgs(rZ);Object.defineProperties(rZ.prototype,{type:uT,url:uT,status:uT,ok:uT,redirected:uT,statusText:uT,headers:uT,clone:uT,body:uT,bodyUsed:uT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(rZ,{json:uT,redirect:uT,error:uT});function Etr(t){if(t.internalResponse)return t4n(Etr(t.internalResponse),t.type);let e=Tfe({...t,body:null});return t.body!=null&&(e.body=Zgs(e,t.body)),e}a(Etr,"cloneResponse");function Tfe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new $5n(t?.headersList):new $5n,urlList:t?.urlList?[...t.urlList]:[]}}a(Tfe,"makeResponse");function Wnt(t){let e=sAs(t);return Tfe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(Wnt,"makeNetworkError");function hAs(t){return t.type==="error"&&t.status===0}a(hAs,"isNetworkError");function $nt(t,e){return e={internalResponse:t,...e},new Proxy(t,{get(r,n){return n in e?e[n]:r[n]},set(r,n,o){return ytr(!(n in e)),r[n]=o,!0}})}a($nt,"makeFilteredResponse");function t4n(t,e){if(e==="basic")return $nt(t,{type:"basic",headersList:t.headersList});if(e==="cors")return $nt(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return $nt(t,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return $nt(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});ytr(!1)}a(t4n,"filterResponse");function mAs(t,e=null){return ytr(rAs(t)),nAs(t)?Wnt(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):Wnt(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(mAs,"makeAppropriateNetworkError");function Y5n(t,e,r){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!tAs(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(t[Gd].status=e.status),"statusText"in e&&e.statusText!=null&&(t[Gd].statusText=e.statusText),"headers"in e&&e.headers!=null&&Kgs(t[MF],e.headers),r){if(uAs.includes(t.status))throw ss.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});t[Gd].body=r.body,r.type!=null&&!t[Gd].headersList.contains("content-type",!0)&&t[Gd].headersList.append("content-type",r.type,!0)}}a(Y5n,"initializeResponse");function kke(t,e){let r=new rZ(Vnt);return r[Gd]=t,r[MF]=new K5n(Vnt),Z5n(r[MF],t.headersList),J5n(r[MF],e),X5n&&t.body?.stream&&e4n.register(r,new WeakRef(t.body.stream)),r}a(kke,"fromInnerResponse");ss.converters.ReadableStream=ss.interfaceConverter(ReadableStream);ss.converters.FormData=ss.interfaceConverter(dAs);ss.converters.URLSearchParams=ss.interfaceConverter(URLSearchParams);ss.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?ss.converters.USVString(t,e,r):iAs(t)?ss.converters.Blob(t,e,r,{strict:!1}):ArrayBuffer.isView(t)||fAs.isArrayBuffer(t)?ss.converters.BufferSource(t,e,r):Atr.isFormDataLike(t)?ss.converters.FormData(t,e,r,{strict:!1}):t instanceof URLSearchParams?ss.converters.URLSearchParams(t,e,r):ss.converters.DOMString(t,e,r)};ss.converters.BodyInit=function(t,e,r){return t instanceof ReadableStream?ss.converters.ReadableStream(t,e,r):t?.[Symbol.asyncIterator]?t:ss.converters.XMLHttpRequestBodyInit(t,e,r)};ss.converters.ResponseInit=ss.dictionaryConverter([{key:"status",converter:ss.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:ss.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:ss.converters.HeadersInit}]);r4n.exports={isNetworkError:hAs,makeNetworkError:Wnt,makeResponse:Tfe,makeAppropriateNetworkError:mAs,filterResponse:t4n,Response:rZ,cloneResponse:Etr,fromInnerResponse:kke}});var s4n=I((Ntf,o4n)=>{"use strict";p();var{kConnected:n4n,kSize:i4n}=jd(),_tr=class{static{a(this,"CompatWeakRef")}constructor(e){this.value=e}deref(){return this.value[n4n]===0&&this.value[i4n]===0?void 0:this.value}},vtr=class{static{a(this,"CompatFinalizer")}constructor(e){this.finalizer=e}register(e,r){e.on&&e.on("disconnect",()=>{e[n4n]===0&&e[i4n]===0&&this.finalizer(r)})}unregister(e){}};o4n.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith("v18")?(process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"),{WeakRef:_tr,FinalizationRegistry:vtr}):{WeakRef,FinalizationRegistry}}});var Ife=I((Ltf,v4n)=>{"use strict";p();var{extractBody:gAs,mixinBody:AAs,cloneBody:yAs,bodyUnusable:a4n}=ife(),{Headers:g4n,fill:EAs,HeadersList:Jnt,setHeadersGuard:btr,getHeadersGuard:_As,setHeadersList:A4n,getHeadersList:c4n}=tZ(),{FinalizationRegistry:vAs}=s4n()(),Ynt=qs(),l4n=require("node:util"),{isValidHTTPToken:CAs,sameOrigin:u4n,environmentSettingsObject:znt}=sT(),{forbiddenMethodsSet:bAs,corsSafeListedMethodsSet:SAs,referrerPolicy:TAs,requestRedirect:IAs,requestMode:xAs,requestCredentials:wAs,requestCache:RAs,requestDuplex:kAs}=eke(),{kEnumerableProperty:am,normalizedMethodRecordsBase:PAs,normalizedMethodRecords:DAs}=Ynt,{kHeaders:dT,kSignal:Knt,kState:sd,kDispatcher:Ctr}=oj(),{webidl:Gi}=qA(),{URLSerializer:NAs}=nb(),{kConstruct:Znt}=jd(),MAs=require("node:assert"),{getMaxListeners:d4n,setMaxListeners:f4n,getEventListeners:OAs,defaultMaxListeners:p4n}=require("node:events"),LAs=Symbol("abortController"),y4n=new vAs(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Xnt=new WeakMap;function h4n(t){return e;function e(){let r=t.deref();if(r!==void 0){y4n.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Xnt.get(r.signal);if(n!==void 0){if(n.size!==0){for(let o of n){let s=o.deref();s!==void 0&&s.abort(this.reason)}n.clear()}Xnt.delete(r.signal)}}}}a(h4n,"buildAbort");var m4n=!1,Aj=class t{static{a(this,"Request")}constructor(e,r={}){if(Gi.util.markAsUncloneable(this),e===Znt)return;let n="Request constructor";Gi.argumentLengthCheck(arguments,1,n),e=Gi.converters.RequestInfo(e,n,"input"),r=Gi.converters.RequestInit(r,n,"init");let o=null,s=null,c=znt.settingsObject.baseUrl,l=null;if(typeof e=="string"){this[Ctr]=r.dispatcher;let _;try{_=new URL(e,c)}catch(v){throw new TypeError("Failed to parse URL from "+e,{cause:v})}if(_.username||_.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);o=eit({urlList:[_]}),s="cors"}else this[Ctr]=r.dispatcher||e[Ctr],MAs(e instanceof t),o=e[sd],l=e[Knt];let u=znt.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&u4n(o.window,u)&&(d=o.window),r.window!=null)throw new TypeError(`'window' option '${d}' must be null`);"window"in r&&(d="no-window"),o=eit({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:znt.settingsObject,window:d,priority:o.priority,origin:o.origin,referrer:o.referrer,referrerPolicy:o.referrerPolicy,mode:o.mode,credentials:o.credentials,cache:o.cache,redirect:o.redirect,integrity:o.integrity,keepalive:o.keepalive,reloadNavigation:o.reloadNavigation,historyNavigation:o.historyNavigation,urlList:[...o.urlList]});let f=Object.keys(r).length!==0;if(f&&(o.mode==="navigate"&&(o.mode="same-origin"),o.reloadNavigation=!1,o.historyNavigation=!1,o.origin="client",o.referrer="client",o.referrerPolicy="",o.url=o.urlList[o.urlList.length-1],o.urlList=[o.url]),r.referrer!==void 0){let _=r.referrer;if(_==="")o.referrer="no-referrer";else{let v;try{v=new URL(_,c)}catch(b){throw new TypeError(`Referrer "${_}" is not a valid URL.`,{cause:b})}v.protocol==="about:"&&v.hostname==="client"||u&&!u4n(v,znt.settingsObject.baseUrl)?o.referrer="client":o.referrer=v}}r.referrerPolicy!==void 0&&(o.referrerPolicy=r.referrerPolicy);let h;if(r.mode!==void 0?h=r.mode:h=s,h==="navigate")throw Gi.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(h!=null&&(o.mode=h),r.credentials!==void 0&&(o.credentials=r.credentials),r.cache!==void 0&&(o.cache=r.cache),o.cache==="only-if-cached"&&o.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(r.redirect!==void 0&&(o.redirect=r.redirect),r.integrity!=null&&(o.integrity=String(r.integrity)),r.keepalive!==void 0&&(o.keepalive=!!r.keepalive),r.method!==void 0){let _=r.method,v=DAs[_];if(v!==void 0)o.method=v;else{if(!CAs(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(bAs.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=PAs[b]??_,o.method=_}!m4n&&o.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),m4n=!0)}r.signal!==void 0&&(l=r.signal),this[sd]=o;let m=new AbortController;if(this[Knt]=m.signal,l!=null){if(!l||typeof l.aborted!="boolean"||typeof l.addEventListener!="function")throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.");if(l.aborted)m.abort(l.reason);else{this[LAs]=m;let _=new WeakRef(m),v=h4n(_);try{(typeof d4n=="function"&&d4n(l)===p4n||OAs(l,"abort").length>=p4n)&&f4n(1500,l)}catch{}Ynt.addAbortListener(l,v),y4n.register(m,{signal:l,abort:v},v)}}if(this[dT]=new g4n(Znt),A4n(this[dT],o.headersList),btr(this[dT],"request"),h==="no-cors"){if(!SAs.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);btr(this[dT],"request-no-cors")}if(f){let _=c4n(this[dT]),v=r.headers!==void 0?r.headers:new Jnt(_);if(_.clear(),v instanceof Jnt){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else EAs(this[dT],v)}let g=e instanceof t?e[sd].body:null;if((r.body!=null||g!=null)&&(o.method==="GET"||o.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let A=null;if(r.body!=null){let[_,v]=gAs(r.body,o.keepalive);A=_,v&&!c4n(this[dT]).contains("content-type",!0)&&this[dT].append("content-type",v)}let y=A??g;if(y!=null&&y.source==null){if(A!=null&&r.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(o.mode!=="same-origin"&&o.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');o.useCORSPreflightFlag=!0}let E=y;if(A==null&&g!=null){if(a4n(e))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let _=new TransformStream;g.stream.pipeThrough(_),E={source:g.source,length:g.length,stream:_.readable}}this[sd].body=E}get method(){return Gi.brandCheck(this,t),this[sd].method}get url(){return Gi.brandCheck(this,t),NAs(this[sd].url)}get headers(){return Gi.brandCheck(this,t),this[dT]}get destination(){return Gi.brandCheck(this,t),this[sd].destination}get referrer(){return Gi.brandCheck(this,t),this[sd].referrer==="no-referrer"?"":this[sd].referrer==="client"?"about:client":this[sd].referrer.toString()}get referrerPolicy(){return Gi.brandCheck(this,t),this[sd].referrerPolicy}get mode(){return Gi.brandCheck(this,t),this[sd].mode}get credentials(){return this[sd].credentials}get cache(){return Gi.brandCheck(this,t),this[sd].cache}get redirect(){return Gi.brandCheck(this,t),this[sd].redirect}get integrity(){return Gi.brandCheck(this,t),this[sd].integrity}get keepalive(){return Gi.brandCheck(this,t),this[sd].keepalive}get isReloadNavigation(){return Gi.brandCheck(this,t),this[sd].reloadNavigation}get isHistoryNavigation(){return Gi.brandCheck(this,t),this[sd].historyNavigation}get signal(){return Gi.brandCheck(this,t),this[Knt]}get body(){return Gi.brandCheck(this,t),this[sd].body?this[sd].body.stream:null}get bodyUsed(){return Gi.brandCheck(this,t),!!this[sd].body&&Ynt.isDisturbed(this[sd].body.stream)}get duplex(){return Gi.brandCheck(this,t),"half"}clone(){if(Gi.brandCheck(this,t),a4n(this))throw new TypeError("unusable");let e=E4n(this[sd]),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Xnt.get(this.signal);n===void 0&&(n=new Set,Xnt.set(this.signal,n));let o=new WeakRef(r);n.add(o),Ynt.addAbortListener(r.signal,h4n(o))}return _4n(e,r.signal,_As(this[dT]))}[l4n.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${l4n.formatWithOptions(r,n)}`}};AAs(Aj);function eit(t){return{method:t.method??"GET",localURLsOnly:t.localURLsOnly??!1,unsafeRequest:t.unsafeRequest??!1,body:t.body??null,client:t.client??null,reservedClient:t.reservedClient??null,replacesClientId:t.replacesClientId??"",window:t.window??"client",keepalive:t.keepalive??!1,serviceWorkers:t.serviceWorkers??"all",initiator:t.initiator??"",destination:t.destination??"",priority:t.priority??null,origin:t.origin??"client",policyContainer:t.policyContainer??"client",referrer:t.referrer??"client",referrerPolicy:t.referrerPolicy??"",mode:t.mode??"no-cors",useCORSPreflightFlag:t.useCORSPreflightFlag??!1,credentials:t.credentials??"same-origin",useCredentials:t.useCredentials??!1,cache:t.cache??"default",redirect:t.redirect??"follow",integrity:t.integrity??"",cryptoGraphicsNonceMetadata:t.cryptoGraphicsNonceMetadata??"",parserMetadata:t.parserMetadata??"",reloadNavigation:t.reloadNavigation??!1,historyNavigation:t.historyNavigation??!1,userActivation:t.userActivation??!1,taintedOrigin:t.taintedOrigin??!1,redirectCount:t.redirectCount??0,responseTainting:t.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:t.preventNoCacheCacheControlHeaderModification??!1,done:t.done??!1,timingAllowFailed:t.timingAllowFailed??!1,urlList:t.urlList,url:t.urlList[0],headersList:t.headersList?new Jnt(t.headersList):new Jnt}}a(eit,"makeRequest");function E4n(t){let e=eit({...t,body:null});return t.body!=null&&(e.body=yAs(e,t.body)),e}a(E4n,"cloneRequest");function _4n(t,e,r){let n=new Aj(Znt);return n[sd]=t,n[Knt]=e,n[dT]=new g4n(Znt),A4n(n[dT],t.headersList),btr(n[dT],r),n}a(_4n,"fromInnerRequest");Object.defineProperties(Aj.prototype,{method:am,url:am,headers:am,redirect:am,clone:am,signal:am,duplex:am,destination:am,body:am,bodyUsed:am,isHistoryNavigation:am,isReloadNavigation:am,keepalive:am,integrity:am,cache:am,credentials:am,attribute:am,referrerPolicy:am,referrer:am,mode:am,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Gi.converters.Request=Gi.interfaceConverter(Aj);Gi.converters.RequestInfo=function(t,e,r){return typeof t=="string"?Gi.converters.USVString(t,e,r):t instanceof Aj?Gi.converters.Request(t,e,r):Gi.converters.USVString(t,e,r)};Gi.converters.AbortSignal=Gi.interfaceConverter(AbortSignal);Gi.converters.RequestInit=Gi.dictionaryConverter([{key:"method",converter:Gi.converters.ByteString},{key:"headers",converter:Gi.converters.HeadersInit},{key:"body",converter:Gi.nullableConverter(Gi.converters.BodyInit)},{key:"referrer",converter:Gi.converters.USVString},{key:"referrerPolicy",converter:Gi.converters.DOMString,allowedValues:TAs},{key:"mode",converter:Gi.converters.DOMString,allowedValues:xAs},{key:"credentials",converter:Gi.converters.DOMString,allowedValues:wAs},{key:"cache",converter:Gi.converters.DOMString,allowedValues:RAs},{key:"redirect",converter:Gi.converters.DOMString,allowedValues:IAs},{key:"integrity",converter:Gi.converters.DOMString},{key:"keepalive",converter:Gi.converters.boolean},{key:"signal",converter:Gi.nullableConverter(t=>Gi.converters.AbortSignal(t,"RequestInit","signal",{strict:!1}))},{key:"window",converter:Gi.converters.any},{key:"duplex",converter:Gi.converters.DOMString,allowedValues:kAs},{key:"dispatcher",converter:Gi.converters.any}]);v4n.exports={Request:Aj,makeRequest:eit,fromInnerRequest:_4n,cloneRequest:E4n}});var Nke=I((Utf,L4n)=>{"use strict";p();var{makeNetworkError:sl,makeAppropriateNetworkError:tit,filterResponse:Str,makeResponse:rit,fromInnerResponse:BAs}=Pke(),{HeadersList:C4n}=tZ(),{Request:FAs,cloneRequest:UAs}=Ife(),yj=require("node:zlib"),{bytesMatch:QAs,makePolicyContainer:qAs,clonePolicyContainer:jAs,requestBadPort:HAs,TAOCheck:GAs,appendRequestOriginHeader:$As,responseLocationURL:VAs,requestCurrentURL:y5,setRequestReferrerPolicyOnRedirect:WAs,tryUpgradeRequestToAPotentiallyTrustworthyURL:zAs,createOpaqueTimingInfo:Rtr,appendFetchMetadata:YAs,corsCheck:KAs,crossOriginResourcePolicyCheck:JAs,determineRequestsReferrer:ZAs,coarsenedSharedCurrentTime:Dke,createDeferredPromise:XAs,isBlobLike:eys,sameOrigin:wtr,isCancelled:nZ,isAborted:b4n,isErrorLike:tys,fullyReadBody:rys,readableStreamClose:nys,isomorphicEncode:nit,urlIsLocal:iys,urlIsHttpHttpsScheme:ktr,urlHasHttpsScheme:oys,clampAndCoarsenConnectionTimingInfo:sys,simpleRangeHeaderValue:ays,buildContentRange:cys,createInflate:lys,extractMimeType:uys}=sT(),{kState:x4n,kDispatcher:dys}=oj(),iZ=require("node:assert"),{safelyExtractBody:Ptr,extractBody:S4n}=ife(),{redirectStatusSet:w4n,nullBodyStatus:R4n,safeMethodsSet:fys,requestBodyHeader:pys,subresourceSet:hys}=eke(),mys=require("node:events"),{Readable:gys,pipeline:Ays,finished:yys}=require("node:stream"),{addAbortListener:Eys,isErrored:_ys,isReadable:iit,bufferToLowerCasedHeaderName:T4n}=qs(),{dataURLProcessor:vys,serializeAMimeType:Cys,minimizeSupportedMimeType:bys}=nb(),{getGlobalDispatcher:Sys}=qnt(),{webidl:Tys}=qA(),{STATUS_CODES:Iys}=require("node:http"),xys=["GET","HEAD"],wys=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",Ttr,oit=class extends mys{static{a(this,"Fetch")}constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function Rys(t){k4n(t,"fetch")}a(Rys,"handleFetchDone");function kys(t,e=void 0){Tys.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=XAs(),n;try{n=new FAs(t,e)}catch(f){return r.reject(f),r.promise}let o=n[x4n];if(n.signal.aborted)return Itr(r,o,null,n.signal.reason),r.promise;o.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(o.serviceWorkers="none");let c=null,l=!1,u=null;return Eys(n.signal,()=>{l=!0,iZ(u!=null),u.abort(n.signal.reason);let f=c?.deref();Itr(r,o,f,n.signal.reason)}),u=D4n({request:o,processResponseEndOfBody:Rys,processResponse:a(f=>{if(!l){if(f.aborted){Itr(r,o,c,u.serializedAbortReason);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(BAs(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:n[dys]}),r.promise}a(kys,"fetch");function k4n(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;ktr(r)&&n!==null&&(t.timingAllowPassed||(n=Rtr({startTime:n.startTime}),o=""),n.endTime=Dke(),t.timingInfo=n,P4n(n,r.href,e,globalThis,o))}a(k4n,"finalizeAndReportTiming");var P4n=performance.markResourceTiming;function Itr(t,e,r,n){if(t&&t.reject(n),e.body!=null&&iit(e.body?.stream)&&e.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s}),r==null)return;let o=r[x4n];o.body!=null&&iit(o.body?.stream)&&o.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s})}a(Itr,"abortFetch");function D4n({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=Sys()}){iZ(l);let u=null,d=!1;t.client!=null&&(u=t.client.globalObject,d=t.client.crossOriginIsolatedCapability);let f=Dke(d),h=Rtr({startTime:f}),m={controller:new oit(l),request:t,timingInfo:h,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:u,crossOriginIsolatedCapability:d};return iZ(!t.body||t.body.stream),t.window==="client"&&(t.window=t.client?.globalObject?.constructor?.name==="Window"?t.client:"no-window"),t.origin==="client"&&(t.origin=t.client.origin),t.policyContainer==="client"&&(t.client!=null?t.policyContainer=jAs(t.client.policyContainer):t.policyContainer=qAs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,hys.has(t.destination),N4n(m).catch(g=>{m.controller.terminate(g)}),m.controller}a(D4n,"fetching");async function N4n(t,e=!1){let r=t.request,n=null;if(r.localURLsOnly&&!iys(y5(r))&&(n=sl("local URLs only")),zAs(r),HAs(r)==="blocked"&&(n=sl("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=ZAs(r)),n===null&&(n=await(async()=>{let s=y5(r);return wtr(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",await I4n(t)):r.mode==="same-origin"?sl('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?sl('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",await I4n(t)):ktr(y5(r))?(r.responseTainting="cors",await M4n(t)):sl("URL scheme must be a HTTP(S) scheme")})()),e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=Str(n,"basic"):r.responseTainting==="cors"?n=Str(n,"cors"):r.responseTainting==="opaque"?n=Str(n,"opaque"):iZ(!1));let o=n.status===0?n:n.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(n.timingAllowPassed=!0),n.type==="opaque"&&o.status===206&&o.rangeRequested&&!r.headers.contains("range",!0)&&(n=o=sl()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||R4n.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>xtr(t,sl(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!QAs(l,r.integrity)){s("integrity mismatch");return}n.body=Ptr(l)[0],xtr(t,n)},"processBody");await rys(n.body,c,s)}else xtr(t,n)}a(N4n,"mainFetch");function I4n(t){if(nZ(t)&&t.request.redirectCount===0)return Promise.resolve(tit(t));let{request:e}=t,{protocol:r}=y5(e);switch(r){case"about:":return Promise.resolve(sl("about scheme is not supported"));case"blob:":{Ttr||(Ttr=require("node:buffer").resolveObjectURL);let n=y5(e);if(n.search.length!==0)return Promise.resolve(sl("NetworkError when attempting to fetch resource."));let o=Ttr(n.toString());if(e.method!=="GET"||!eys(o))return Promise.resolve(sl("invalid method"));let s=rit(),c=o.size,l=nit(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=ays(d,!0);if(f==="failure")return Promise.resolve(sl("failed to fetch the data URL"));let{rangeStartValue:h,rangeEndValue:m}=f;if(h===null)h=c-m,m=h+m-1;else{if(h>=c)return Promise.resolve(sl("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m,u),A=S4n(g);s.body=A[0];let y=nit(`${g.size}`),E=cys(h,m,c);s.status=206,s.statusText="Partial Content",s.headersList.set("content-length",y,!0),s.headersList.set("content-type",u,!0),s.headersList.set("content-range",E,!0)}else{let d=S4n(o);s.statusText="OK",s.body=d[0],s.headersList.set("content-length",l,!0),s.headersList.set("content-type",u,!0)}return Promise.resolve(s)}case"data:":{let n=y5(e),o=vys(n);if(o==="failure")return Promise.resolve(sl("failed to fetch the data URL"));let s=Cys(o.mimeType);return Promise.resolve(rit({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:Ptr(o.body)[0]}))}case"file:":return Promise.resolve(sl("not implemented... yet..."));case"http:":case"https:":return M4n(t).catch(n=>sl(n));default:return Promise.resolve(sl("unknown scheme"))}}a(I4n,"schemeFetch");function Pys(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(Pys,"finalizeResponse");function xtr(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(t.request.url.protocol!=="https:")return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=Rtr(r),l="");let d=0;if(t.request.mode!=="navigator"||!e.hasCrossOriginRedirects){d=e.status;let f=uys(e.headersList);f!=="failure"&&(u.contentType=bys(f))}t.request.initiatorType!=null&&P4n(r,t.request.url.href,t.request.initiatorType,globalThis,l,u,d)};let c=a(()=>{t.request.done=!0,t.processResponseEndOfBody!=null&&queueMicrotask(()=>t.processResponseEndOfBody(e)),t.request.initiatorType!=null&&t.controller.reportTimingSteps()},"processResponseEndOfBodyTask");queueMicrotask(()=>c())},"processResponseEndOfBody");t.processResponse!=null&&queueMicrotask(()=>{t.processResponse(e),t.processResponse=null});let o=e.type==="error"?e:e.internalResponse??e;o.body==null?n():yys(o.body.stream,()=>{n()})}a(xtr,"fetchFinale");async function M4n(t){let e=t.request,r=null,n=null,o=t.timingInfo;if(e.serviceWorkers,r===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),n=r=await O4n(t),e.responseTainting==="cors"&&KAs(e,r)==="failure")return sl("cors failure");GAs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&JAs(e.origin,e.client,e.destination,n)==="blocked"?sl("blocked"):(w4n.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=sl("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await Dys(t,r):iZ(!1)),r.timingInfo=o,r)}a(M4n,"httpFetch");function Dys(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=VAs(n,y5(r).hash),o==null)return e}catch(c){return Promise.resolve(sl(c))}if(!ktr(o))return Promise.resolve(sl("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(sl("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!wtr(r,o))return Promise.resolve(sl('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(sl('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(sl());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!xys.includes(r.method)){r.method="GET",r.body=null;for(let c of pys)r.headersList.delete(c)}wtr(y5(r),o)||(r.headersList.delete("authorization",!0),r.headersList.delete("proxy-authorization",!0),r.headersList.delete("cookie",!0),r.headersList.delete("host",!0)),r.body!=null&&(iZ(r.body.source!=null),r.body=Ptr(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=Dke(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),WAs(r,n),N4n(t,!0)}a(Dys,"httpRedirectFetch");async function O4n(t,e=!1,r=!1){let n=t.request,o=null,s=null,c=null,l=null,u=!1;n.window==="no-window"&&n.redirect==="error"?(o=t,s=n):(s=UAs(n),o={...t},o.request=s);let d=n.credentials==="include"||n.credentials==="same-origin"&&n.responseTainting==="basic",f=s.body?s.body.length:null,h=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(h="0"),f!=null&&(h=nit(`${f}`)),h!=null&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",nit(s.referrer.href),!0),$As(s),YAs(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",wys),s.cache==="default"&&(s.headersList.contains("if-modified-since",!0)||s.headersList.contains("if-none-match",!0)||s.headersList.contains("if-unmodified-since",!0)||s.headersList.contains("if-match",!0)||s.headersList.contains("if-range",!0))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control",!0)&&s.headersList.append("cache-control","max-age=0",!0),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma",!0)||s.headersList.append("pragma","no-cache",!0),s.headersList.contains("cache-control",!0)||s.headersList.append("cache-control","no-cache",!0)),s.headersList.contains("range",!0)&&s.headersList.append("accept-encoding","identity",!0),s.headersList.contains("accept-encoding",!0)||(oys(y5(s))?s.headersList.append("accept-encoding","br, gzip, deflate",!0):s.headersList.append("accept-encoding","gzip, deflate",!0)),s.headersList.delete("host",!0),l==null&&(s.cache="no-store"),s.cache!=="no-store"&&s.cache,c==null){if(s.cache==="only-if-cached")return sl("only if cached");let m=await Nys(o,d,r);!fys.has(s.method)&&m.status>=200&&m.status<=399,u&&m.status,c==null&&(c=m)}if(c.urlList=[...s.urlList],s.headersList.contains("range",!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=d,c.status===407)return n.window==="no-window"?sl():nZ(t)?tit(t):sl("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(nZ(t))return tit(t);t.controller.connection.destroy(),c=await O4n(t,e,!0)}return c}a(O4n,"httpNetworkOrCacheFetch");async function Nys(t,e=!1,r=!1){iZ(!t.controller.connection||t.controller.connection.destroyed),t.controller.connection={abort:null,destroyed:!1,destroy(A,y=!0){this.destroyed||(this.destroyed=!0,y&&this.abort?.(A??new DOMException("The operation was aborted.","AbortError")))}};let n=t.request,o=null,s=t.timingInfo;null==null&&(n.cache="no-store");let l=r?"yes":"no";n.mode;let u=null;if(n.body==null&&t.processRequestEndOfBody)queueMicrotask(()=>t.processRequestEndOfBody());else if(n.body!=null){let A=a(async function*(_){nZ(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{nZ(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{nZ(t)||(_.name==="AbortError"?t.controller.abort():t.controller.terminate(_))},"processBodyError");u=(async function*(){try{for await(let _ of n.body.stream)yield*A(_);y()}catch(_){E(_)}})()}try{let{body:A,status:y,statusText:E,headersList:_,socket:v}=await g({body:u});if(v)o=rit({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=rit({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),tit(t,A)):sl(A)}let d=a(async()=>{await t.controller.resume()},"pullAlgorithm"),f=a(A=>{nZ(t)||t.controller.abort(A)},"cancelAlgorithm"),h=new ReadableStream({async start(A){t.controller.controller=A},async pull(A){await d(A)},async cancel(A){await f(A)},type:"bytes"});o.body={stream:h,source:null,length:null},t.controller.onAborted=m,t.controller.on("terminated",m),t.controller.resume=async()=>{for(;;){let A,y;try{let{done:_,value:v}=await t.controller.next();if(b4n(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){nys(t.controller.controller),Pys(t,o);return}if(s.decodedBodySize+=A?.byteLength??0,y){t.controller.terminate(A);return}let E=new Uint8Array(A);if(E.byteLength&&t.controller.controller.enqueue(E),_ys(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){b4n(t)?(o.aborted=!0,iit(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):iit(h)&&t.controller.controller.error(new TypeError("terminated",{cause:tys(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=y5(n),E=t.controller.dispatcher;return new Promise((_,v)=>E.dispatch({path:y.pathname+y.search,origin:y.origin,method:n.method,body:E.isMockActive?n.body&&(n.body.source||n.body.stream):A,headers:n.headersList.entries,maxRedirections:0,upgrade:n.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(b){let{connection:T}=t.controller;s.finalConnectionTimingInfo=sys(void 0,s.postRedirectStartTime,t.crossOriginIsolatedCapability),T.destroyed?b(new DOMException("The operation was aborted.","AbortError")):(t.controller.on("terminated",b),this.abort=T.abort=b),s.finalNetworkRequestStartTime=Dke(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=Dke(t.crossOriginIsolatedCapability)},onHeaders(b,T,w,R){if(b<200)return;let x="",P=new C4n;for(let B=0;BM)return v(new Error(`too many content-encodings in response: ${q.length}, maximum allowed is ${M}`)),!0;for(let O=q.length-1;O>=0;--O){let j=q[O].trim();if(j==="x-gzip"||j==="gzip")D.push(yj.createGunzip({flush:yj.constants.Z_SYNC_FLUSH,finishFlush:yj.constants.Z_SYNC_FLUSH}));else if(j==="deflate")D.push(lys({flush:yj.constants.Z_SYNC_FLUSH,finishFlush:yj.constants.Z_SYNC_FLUSH}));else if(j==="br")D.push(yj.createBrotliDecompress({flush:yj.constants.BROTLI_OPERATION_FLUSH,finishFlush:yj.constants.BROTLI_OPERATION_FLUSH}));else{D.length=0;break}}}let L=this.onError.bind(this);return _({status:b,statusText:R,headersList:P,body:D.length?Ays(this.body,...D,B=>{B&&this.onError(B)}).on("error",L):this.body.on("error",L)}),!0},onData(b){if(t.controller.dump)return;let T=b;return s.encodedBodySize+=T.byteLength,this.body.push(T)},onComplete(){this.abort&&t.controller.off("terminated",this.abort),t.controller.onAborted&&t.controller.off("terminated",t.controller.onAborted),t.controller.ended=!0,this.body.push(null)},onError(b){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(b),t.controller.terminate(b),v(b)},onUpgrade(b,T,w){if(b!==101)return;let R=new C4n;for(let x=0;x{"use strict";p();B4n.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}});var U4n=I((Gtf,F4n)=>{"use strict";p();var{webidl:fT}=qA(),sit=Symbol("ProgressEvent state"),Ntr=class t extends Event{static{a(this,"ProgressEvent")}constructor(e,r={}){e=fT.converters.DOMString(e,"ProgressEvent constructor","type"),r=fT.converters.ProgressEventInit(r??{}),super(e,r),this[sit]={lengthComputable:r.lengthComputable,loaded:r.loaded,total:r.total}}get lengthComputable(){return fT.brandCheck(this,t),this[sit].lengthComputable}get loaded(){return fT.brandCheck(this,t),this[sit].loaded}get total(){return fT.brandCheck(this,t),this[sit].total}};fT.converters.ProgressEventInit=fT.dictionaryConverter([{key:"lengthComputable",converter:fT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"loaded",converter:fT.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"total",converter:fT.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"bubbles",converter:fT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:fT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:fT.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}]);F4n.exports={ProgressEvent:Ntr}});var q4n=I((Wtf,Q4n)=>{"use strict";p();function Mys(t){if(!t)return"failure";switch(t.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}a(Mys,"getEncoding");Q4n.exports={getEncoding:Mys}});var Y4n=I((Ktf,z4n)=>{"use strict";p();var{kState:xfe,kError:Mtr,kResult:j4n,kAborted:Mke,kLastProgressEventFired:Otr}=Dtr(),{ProgressEvent:Oys}=U4n(),{getEncoding:H4n}=q4n(),{serializeAMimeType:Lys,parseMIMEType:G4n}=nb(),{types:Bys}=require("node:util"),{StringDecoder:$4n}=require("string_decoder"),{btoa:V4n}=require("node:buffer"),Fys={enumerable:!0,writable:!1,configurable:!1};function Uys(t,e,r,n){if(t[xfe]==="loading")throw new DOMException("Invalid state","InvalidStateError");t[xfe]="loading",t[j4n]=null,t[Mtr]=null;let s=e.stream().getReader(),c=[],l=s.read(),u=!0;(async()=>{for(;!t[Mke];)try{let{done:d,value:f}=await l;if(u&&!t[Mke]&&queueMicrotask(()=>{Ej("loadstart",t)}),u=!1,!d&&Bys.isUint8Array(f))c.push(f),(t[Otr]===void 0||Date.now()-t[Otr]>=50)&&!t[Mke]&&(t[Otr]=Date.now(),queueMicrotask(()=>{Ej("progress",t)})),l=s.read();else if(d){queueMicrotask(()=>{t[xfe]="done";try{let h=Qys(c,r,e.type,n);if(t[Mke])return;t[j4n]=h,Ej("load",t)}catch(h){t[Mtr]=h,Ej("error",t)}t[xfe]!=="loading"&&Ej("loadend",t)});break}}catch(d){if(t[Mke])return;queueMicrotask(()=>{t[xfe]="done",t[Mtr]=d,Ej("error",t),t[xfe]!=="loading"&&Ej("loadend",t)});break}})()}a(Uys,"readOperation");function Ej(t,e){let r=new Oys(t,{bubbles:!1,cancelable:!1});e.dispatchEvent(r)}a(Ej,"fireAProgressEvent");function Qys(t,e,r,n){switch(e){case"DataURL":{let o="data:",s=G4n(r||"application/octet-stream");s!=="failure"&&(o+=Lys(s)),o+=";base64,";let c=new $4n("latin1");for(let l of t)o+=V4n(c.write(l));return o+=V4n(c.end()),o}case"Text":{let o="failure";if(n&&(o=H4n(n)),o==="failure"&&r){let s=G4n(r);s!=="failure"&&(o=H4n(s.parameters.get("charset")))}return o==="failure"&&(o="UTF-8"),qys(t,o)}case"ArrayBuffer":return W4n(t).buffer;case"BinaryString":{let o="",s=new $4n("latin1");for(let c of t)o+=s.write(c);return o+=s.end(),o}}}a(Qys,"packageData");function qys(t,e){let r=W4n(t),n=jys(r),o=0;n!==null&&(e=n,o=n==="UTF-8"?3:2);let s=r.slice(o);return new TextDecoder(e).decode(s)}a(qys,"decode");function jys(t){let[e,r,n]=t;return e===239&&r===187&&n===191?"UTF-8":e===254&&r===255?"UTF-16BE":e===255&&r===254?"UTF-16LE":null}a(jys,"BOMSniffing");function W4n(t){let e=t.reduce((n,o)=>n+o.byteLength,0),r=0;return t.reduce((n,o)=>(n.set(o,r),r+=o.byteLength,n),new Uint8Array(e))}a(W4n,"combineByteSequences");z4n.exports={staticPropertyDescriptors:Fys,readOperation:Uys,fireAProgressEvent:Ej}});var X4n=I((Xtf,Z4n)=>{"use strict";p();var{staticPropertyDescriptors:wfe,readOperation:ait,fireAProgressEvent:K4n}=Y4n(),{kState:oZ,kError:J4n,kResult:cit,kEvents:wc,kAborted:Hys}=Dtr(),{webidl:wl}=qA(),{kEnumerableProperty:sb}=qs(),y2=class t extends EventTarget{static{a(this,"FileReader")}constructor(){super(),this[oZ]="empty",this[cit]=null,this[J4n]=null,this[wc]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsArrayBuffer"),e=wl.converters.Blob(e,{strict:!1}),ait(this,e,"ArrayBuffer")}readAsBinaryString(e){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsBinaryString"),e=wl.converters.Blob(e,{strict:!1}),ait(this,e,"BinaryString")}readAsText(e,r=void 0){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsText"),e=wl.converters.Blob(e,{strict:!1}),r!==void 0&&(r=wl.converters.DOMString(r,"FileReader.readAsText","encoding")),ait(this,e,"Text",r)}readAsDataURL(e){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsDataURL"),e=wl.converters.Blob(e,{strict:!1}),ait(this,e,"DataURL")}abort(){if(this[oZ]==="empty"||this[oZ]==="done"){this[cit]=null;return}this[oZ]==="loading"&&(this[oZ]="done",this[cit]=null),this[Hys]=!0,K4n("abort",this),this[oZ]!=="loading"&&K4n("loadend",this)}get readyState(){switch(wl.brandCheck(this,t),this[oZ]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return wl.brandCheck(this,t),this[cit]}get error(){return wl.brandCheck(this,t),this[J4n]}get onloadend(){return wl.brandCheck(this,t),this[wc].loadend}set onloadend(e){wl.brandCheck(this,t),this[wc].loadend&&this.removeEventListener("loadend",this[wc].loadend),typeof e=="function"?(this[wc].loadend=e,this.addEventListener("loadend",e)):this[wc].loadend=null}get onerror(){return wl.brandCheck(this,t),this[wc].error}set onerror(e){wl.brandCheck(this,t),this[wc].error&&this.removeEventListener("error",this[wc].error),typeof e=="function"?(this[wc].error=e,this.addEventListener("error",e)):this[wc].error=null}get onloadstart(){return wl.brandCheck(this,t),this[wc].loadstart}set onloadstart(e){wl.brandCheck(this,t),this[wc].loadstart&&this.removeEventListener("loadstart",this[wc].loadstart),typeof e=="function"?(this[wc].loadstart=e,this.addEventListener("loadstart",e)):this[wc].loadstart=null}get onprogress(){return wl.brandCheck(this,t),this[wc].progress}set onprogress(e){wl.brandCheck(this,t),this[wc].progress&&this.removeEventListener("progress",this[wc].progress),typeof e=="function"?(this[wc].progress=e,this.addEventListener("progress",e)):this[wc].progress=null}get onload(){return wl.brandCheck(this,t),this[wc].load}set onload(e){wl.brandCheck(this,t),this[wc].load&&this.removeEventListener("load",this[wc].load),typeof e=="function"?(this[wc].load=e,this.addEventListener("load",e)):this[wc].load=null}get onabort(){return wl.brandCheck(this,t),this[wc].abort}set onabort(e){wl.brandCheck(this,t),this[wc].abort&&this.removeEventListener("abort",this[wc].abort),typeof e=="function"?(this[wc].abort=e,this.addEventListener("abort",e)):this[wc].abort=null}};y2.EMPTY=y2.prototype.EMPTY=0;y2.LOADING=y2.prototype.LOADING=1;y2.DONE=y2.prototype.DONE=2;Object.defineProperties(y2.prototype,{EMPTY:wfe,LOADING:wfe,DONE:wfe,readAsArrayBuffer:sb,readAsBinaryString:sb,readAsText:sb,readAsDataURL:sb,abort:sb,readyState:sb,result:sb,error:sb,onloadstart:sb,onprogress:sb,onload:sb,onabort:sb,onerror:sb,onloadend:sb,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(y2,{EMPTY:wfe,LOADING:wfe,DONE:wfe});Z4n.exports={FileReader:y2}});var lit=I((rrf,eLn)=>{"use strict";p();eLn.exports={kConstruct:jd().kConstruct}});var nLn=I((irf,rLn)=>{"use strict";p();var Gys=require("node:assert"),{URLSerializer:tLn}=nb(),{isValidHeaderName:$ys}=sT();function Vys(t,e,r=!1){let n=tLn(t,r),o=tLn(e,r);return n===o}a(Vys,"urlEquals");function Wys(t){Gys(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),$ys(r)&&e.push(r);return e}a(Wys,"getFieldValues");rLn.exports={urlEquals:Vys,getFieldValues:Wys}});var sLn=I((arf,oLn)=>{"use strict";p();var{kConstruct:zys}=lit(),{urlEquals:Yys,getFieldValues:Ltr}=nLn(),{kEnumerableProperty:sZ,isDisturbed:Kys}=qs(),{webidl:vi}=qA(),{Response:Jys,cloneResponse:Zys,fromInnerResponse:Xys}=Pke(),{Request:OF,fromInnerRequest:eEs}=Ife(),{kState:E2}=oj(),{fetching:tEs}=Nke(),{urlIsHttpHttpsScheme:uit,createDeferredPromise:Rfe,readAllBytes:rEs}=sT(),Btr=require("node:assert"),dit=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==zys&&vi.illegalConstructor(),vi.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){vi.brandCheck(this,t);let n="Cache.match";vi.argumentLengthCheck(arguments,1,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.converters.CacheQueryOptions(r,n,"options");let o=this.#i(e,r,1);if(o.length!==0)return o[0]}async matchAll(e=void 0,r={}){vi.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=vi.converters.RequestInfo(e,n,"request")),r=vi.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){vi.brandCheck(this,t);let r="Cache.add";vi.argumentLengthCheck(arguments,1,r),e=vi.converters.RequestInfo(e,r,"request");let n=[e];return await this.addAll(n)}async addAll(e){vi.brandCheck(this,t);let r="Cache.addAll";vi.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw vi.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=vi.converters.RequestInfo(m),typeof m=="string")continue;let g=m[E2];if(!uit(g.url)||g.method!=="GET")throw vi.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=new OF(m)[E2];if(!uit(g.url))throw vi.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Rfe();s.push(tEs({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(vi.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=Ltr(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(vi.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let v of s)v.abort();return}}},processResponseEndOfBody(y){if(y.aborted){A.reject(new DOMException("aborted","AbortError"));return}A.resolve(y)}})),n.push(A.promise)}let l=await Promise.all(n),u=[],d=0;for(let m of l){let g={type:"put",request:o[d],response:m};u.push(g),d++}let f=Rfe(),h=null;try{this.#t(u)}catch(m){h=m}return queueMicrotask(()=>{h===null?f.resolve(void 0):f.reject(h)}),f.promise}async put(e,r){vi.brandCheck(this,t);let n="Cache.put";vi.argumentLengthCheck(arguments,2,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.converters.Response(r,n,"response");let o=null;if(e instanceof OF?o=e[E2]:o=new OF(e)[E2],!uit(o.url)||o.method!=="GET")throw vi.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=r[E2];if(s.status===206)throw vi.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=Ltr(s.headersList.get("vary"));for(let A of g)if(A==="*")throw vi.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(Kys(s.body.stream)||s.body.stream.locked))throw vi.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=Zys(s),l=Rfe();if(s.body!=null){let A=s.body.stream.getReader();rEs(A).then(l.resolve,l.reject)}else l.resolve(void 0);let u=[],d={type:"put",request:o,response:c};u.push(d);let f=await l.promise;c.body!=null&&(c.body.source=f);let h=Rfe(),m=null;try{this.#t(u)}catch(g){m=g}return queueMicrotask(()=>{m===null?h.resolve():h.reject(m)}),h.promise}async delete(e,r={}){vi.brandCheck(this,t);let n="Cache.delete";vi.argumentLengthCheck(arguments,1,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e instanceof OF){if(o=e[E2],o.method!=="GET"&&!r.ignoreMethod)return!1}else Btr(typeof e=="string"),o=new OF(e)[E2];let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Rfe(),u=null,d;try{d=this.#t(s)}catch(f){u=f}return queueMicrotask(()=>{u===null?l.resolve(!!d?.length):l.reject(u)}),l.promise}async keys(e=void 0,r={}){vi.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=vi.converters.RequestInfo(e,n,"request")),r=vi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(e instanceof OF){if(o=e[E2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new OF(e)[E2]);let s=Rfe(),c=[];if(e===void 0)for(let l of this.#e)c.push(l[0]);else{let l=this.#r(o,r);for(let u of l)c.push(u[0])}return queueMicrotask(()=>{let l=[];for(let u of c){let d=eEs(u,new AbortController().signal,"immutable");l.push(d)}s.resolve(Object.freeze(l))}),s.promise}#t(e){let r=this.#e,n=[...r],o=[],s=[];try{for(let c of e){if(c.type!=="delete"&&c.type!=="put")throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#r(c.request,c.options,o).length)throw new DOMException("???","InvalidStateError");let l;if(c.type==="delete"){if(l=this.#r(c.request,c.options),l.length===0)return[];for(let u of l){let d=r.indexOf(u);Btr(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!uit(u.url))throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});l=this.#r(c.request);for(let d of l){let f=r.indexOf(d);Btr(f!==-1),r.splice(f,1)}r.push([c.request,c.response]),o.push([c.request,c.response])}s.push([c.request,c.response])}return s}catch(c){throw this.#e.length=0,this.#e=n,c}}#r(e,r,n){let o=[],s=n??this.#e;for(let c of s){let[l,u]=c;this.#n(e,l,u,r)&&o.push(c)}return o}#n(e,r,n=null,o){let s=new URL(e.url),c=new URL(r.url);if(o?.ignoreSearch&&(c.search="",s.search=""),!Yys(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=Ltr(n.headersList.get("vary"));for(let u of l){if(u==="*")return!1;let d=r.headersList.get(u),f=e.headersList.get(u);if(d!==f)return!1}return!0}#i(e,r,n=1/0){let o=null;if(e!==void 0)if(e instanceof OF){if(o=e[E2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new OF(e)[E2]);let s=[];if(e===void 0)for(let l of this.#e)s.push(l[1]);else{let l=this.#r(o,r);for(let u of l)s.push(u[1])}let c=[];for(let l of s){let u=Xys(l,"immutable");if(c.push(u.clone()),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(dit.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:sZ,matchAll:sZ,add:sZ,addAll:sZ,put:sZ,delete:sZ,keys:sZ});var iLn=[{key:"ignoreSearch",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];vi.converters.CacheQueryOptions=vi.dictionaryConverter(iLn);vi.converters.MultiCacheQueryOptions=vi.dictionaryConverter([...iLn,{key:"cacheName",converter:vi.converters.DOMString}]);vi.converters.Response=vi.interfaceConverter(Jys);vi.converters["sequence"]=vi.sequenceConverter(vi.converters.RequestInfo);oLn.exports={Cache:dit}});var cLn=I((urf,aLn)=>{"use strict";p();var{kConstruct:Oke}=lit(),{Cache:fit}=sLn(),{webidl:_E}=qA(),{kEnumerableProperty:Lke}=qs(),pit=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==Oke&&_E.illegalConstructor(),_E.util.markAsUncloneable(this)}async match(e,r={}){if(_E.brandCheck(this,t),_E.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=_E.converters.RequestInfo(e),r=_E.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new fit(Oke,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new fit(Oke,n).match(e,r);if(s!==void 0)return s}}async has(e){_E.brandCheck(this,t);let r="CacheStorage.has";return _E.argumentLengthCheck(arguments,1,r),e=_E.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){_E.brandCheck(this,t);let r="CacheStorage.open";if(_E.argumentLengthCheck(arguments,1,r),e=_E.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new fit(Oke,o)}let n=[];return this.#e.set(e,n),new fit(Oke,n)}async delete(e){_E.brandCheck(this,t);let r="CacheStorage.delete";return _E.argumentLengthCheck(arguments,1,r),e=_E.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return _E.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(pit.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:Lke,has:Lke,open:Lke,delete:Lke,keys:Lke});aLn.exports={CacheStorage:pit}});var uLn=I((prf,lLn)=>{"use strict";p();lLn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var Ftr=I((mrf,mLn)=>{"use strict";p();function nEs(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(nEs,"isCTLExcludingHtab");function dLn(t){for(let e=0;e126||r===34||r===40||r===41||r===60||r===62||r===64||r===44||r===59||r===58||r===92||r===47||r===91||r===93||r===63||r===61||r===123||r===125)throw new Error("Invalid cookie name")}}a(dLn,"validateCookieName");function fLn(t){let e=t.length,r=0;if(t[0]==='"'){if(e===1||t[e-1]!=='"')throw new Error("Invalid cookie value");--e,++r}for(;r126||n===34||n===44||n===59||n===92)throw new Error("Invalid cookie value")}}a(fLn,"validateCookieValue");function pLn(t){for(let e=0;ee.toString().padStart(2,"0"));function hLn(t){return typeof t=="number"&&(t=new Date(t)),`${oEs[t.getUTCDay()]}, ${hit[t.getUTCDate()]} ${sEs[t.getUTCMonth()]} ${t.getUTCFullYear()} ${hit[t.getUTCHours()]}:${hit[t.getUTCMinutes()]}:${hit[t.getUTCSeconds()]} GMT`}a(hLn,"toIMFDate");function aEs(t){if(t<0)throw new Error("Invalid cookie max-age")}a(aEs,"validateCookieMaxAge");function cEs(t){if(t.name.length===0)return null;dLn(t.name),fLn(t.value);let e=[`${t.name}=${t.value}`];t.name.startsWith("__Secure-")&&(t.secure=!0),t.name.startsWith("__Host-")&&(t.secure=!0,t.domain=null,t.path="/"),t.secure&&e.push("Secure"),t.httpOnly&&e.push("HttpOnly"),typeof t.maxAge=="number"&&(aEs(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(iEs(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(pLn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${hLn(t.expires)}`),t.sameSite&&e.push(`SameSite=${t.sameSite}`);for(let r of t.unparsed){if(!r.includes("="))throw new Error("Invalid unparsed");let[n,...o]=r.split("=");e.push(`${n.trim()}=${o.join("=")}`)}return e.join("; ")}a(cEs,"stringify");mLn.exports={isCTLExcludingHtab:nEs,validateCookieName:dLn,validateCookiePath:pLn,validateCookieValue:fLn,toIMFDate:hLn,stringify:cEs}});var ALn=I((yrf,gLn)=>{"use strict";p();var{maxNameValuePairSize:lEs,maxAttributeValueSize:uEs}=uLn(),{isCTLExcludingHtab:dEs}=Ftr(),{collectASequenceOfCodePointsFast:mit}=nb(),fEs=require("node:assert");function pEs(t){if(dEs(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=mit(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=mit("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>lEs?null:{name:n,value:o,...kfe(r)}}a(pEs,"parseSetCookie");function kfe(t,e={}){if(t.length===0)return e;fEs(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=mit(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=mit("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>uEs)return kfe(t,e);let s=n.toLowerCase();if(s==="expires"){let c=new Date(o);e.expires=c}else if(s==="max-age"){let c=o.charCodeAt(0);if((c<48||c>57)&&o[0]!=="-"||!/^\d+$/.test(o))return kfe(t,e);let l=Number(o);e.maxAge=l}else if(s==="domain"){let c=o;c[0]==="."&&(c=c.slice(1)),c=c.toLowerCase(),e.domain=c}else if(s==="path"){let c="";o.length===0||o[0]!=="/"?c="/":c=o,e.path=c}else if(s==="secure")e.secure=!0;else if(s==="httponly")e.httpOnly=!0;else if(s==="samesite"){let c="Default",l=o.toLowerCase();l.includes("none")&&(c="None"),l.includes("strict")&&(c="Strict"),l.includes("lax")&&(c="Lax"),e.sameSite=c}else e.unparsed??=[],e.unparsed.push(`${n}=${o}`);return kfe(t,e)}a(kfe,"parseUnparsedAttributes");gLn.exports={parseSetCookie:pEs,parseUnparsedAttributes:kfe}});var _Ln=I((vrf,ELn)=>{"use strict";p();var{parseSetCookie:hEs}=ALn(),{stringify:mEs}=Ftr(),{webidl:pa}=qA(),{Headers:git}=tZ();function gEs(t){pa.argumentLengthCheck(arguments,1,"getCookies"),pa.brandCheck(t,git,{strict:!1});let e=t.get("cookie"),r={};if(!e)return r;for(let n of e.split(";")){let[o,...s]=n.split("=");r[o.trim()]=s.join("=")}return r}a(gEs,"getCookies");function AEs(t,e,r){pa.brandCheck(t,git,{strict:!1});let n="deleteCookie";pa.argumentLengthCheck(arguments,2,n),e=pa.converters.DOMString(e,n,"name"),r=pa.converters.DeleteCookieAttributes(r),yLn(t,{name:e,value:"",expires:new Date(0),...r})}a(AEs,"deleteCookie");function yEs(t){pa.argumentLengthCheck(arguments,1,"getSetCookies"),pa.brandCheck(t,git,{strict:!1});let e=t.getSetCookie();return e?e.map(r=>hEs(r)):[]}a(yEs,"getSetCookies");function yLn(t,e){pa.argumentLengthCheck(arguments,2,"setCookie"),pa.brandCheck(t,git,{strict:!1}),e=pa.converters.Cookie(e);let r=mEs(e);r&&t.append("Set-Cookie",r)}a(yLn,"setCookie");pa.converters.DeleteCookieAttributes=pa.dictionaryConverter([{converter:pa.nullableConverter(pa.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);pa.converters.Cookie=pa.dictionaryConverter([{converter:pa.converters.DOMString,key:"name"},{converter:pa.converters.DOMString,key:"value"},{converter:pa.nullableConverter(t=>typeof t=="number"?pa.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:pa.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:pa.sequenceConverter(pa.converters.DOMString),key:"unparsed",defaultValue:a(()=>new Array(0),"defaultValue")}]);ELn.exports={getCookies:gEs,deleteCookie:AEs,getSetCookies:yEs,setCookie:yLn}});var Dfe=I((Srf,CLn)=>{"use strict";p();var{webidl:hi}=qA(),{kEnumerableProperty:ab}=qs(),{kConstruct:vLn}=jd(),{MessagePort:EEs}=require("node:worker_threads"),Pfe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===vLn){super(arguments[1],arguments[2]),hi.util.markAsUncloneable(this);return}let n="MessageEvent constructor";hi.argumentLengthCheck(arguments,1,n),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,hi.util.markAsUncloneable(this)}get data(){return hi.brandCheck(this,t),this.#e.data}get origin(){return hi.brandCheck(this,t),this.#e.origin}get lastEventId(){return hi.brandCheck(this,t),this.#e.lastEventId}get source(){return hi.brandCheck(this,t),this.#e.source}get ports(){return hi.brandCheck(this,t),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,r=!1,n=!1,o=null,s="",c="",l=null,u=[]){return hi.brandCheck(this,t),hi.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new t(e,{bubbles:r,cancelable:n,data:o,origin:s,lastEventId:c,source:l,ports:u})}static createFastMessageEvent(e,r){let n=new t(vLn,e,r);return n.#e=r,n.#e.data??=null,n.#e.origin??="",n.#e.lastEventId??="",n.#e.source??=null,n.#e.ports??=[],n}},{createFastMessageEvent:_Es}=Pfe;delete Pfe.createFastMessageEvent;var Ait=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";hi.argumentLengthCheck(arguments,1,n),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.CloseEventInit(r),super(e,r),this.#e=r,hi.util.markAsUncloneable(this)}get wasClean(){return hi.brandCheck(this,t),this.#e.wasClean}get code(){return hi.brandCheck(this,t),this.#e.code}get reason(){return hi.brandCheck(this,t),this.#e.reason}},yit=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";hi.argumentLengthCheck(arguments,1,n),super(e,r),hi.util.markAsUncloneable(this),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return hi.brandCheck(this,t),this.#e.message}get filename(){return hi.brandCheck(this,t),this.#e.filename}get lineno(){return hi.brandCheck(this,t),this.#e.lineno}get colno(){return hi.brandCheck(this,t),this.#e.colno}get error(){return hi.brandCheck(this,t),this.#e.error}};Object.defineProperties(Pfe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:ab,origin:ab,lastEventId:ab,source:ab,ports:ab,initMessageEvent:ab});Object.defineProperties(Ait.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:ab,code:ab,wasClean:ab});Object.defineProperties(yit.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:ab,filename:ab,lineno:ab,colno:ab,error:ab});hi.converters.MessagePort=hi.interfaceConverter(EEs);hi.converters["sequence"]=hi.sequenceConverter(hi.converters.MessagePort);var Utr=[{key:"bubbles",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];hi.converters.MessageEventInit=hi.dictionaryConverter([...Utr,{key:"data",converter:hi.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:hi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:hi.nullableConverter(hi.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:hi.converters["sequence"],defaultValue:a(()=>new Array(0),"defaultValue")}]);hi.converters.CloseEventInit=hi.dictionaryConverter([...Utr,{key:"wasClean",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:hi.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);hi.converters.ErrorEventInit=hi.dictionaryConverter([...Utr,{key:"message",converter:hi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:hi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:hi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:hi.converters.any}]);CLn.exports={MessageEvent:Pfe,CloseEvent:Ait,ErrorEvent:yit,createFastMessageEvent:_Es}});var aZ=I((xrf,bLn)=>{"use strict";p();var vEs="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",CEs={enumerable:!0,writable:!1,configurable:!1},bEs={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},SEs={NOT_SENT:0,PROCESSING:1,SENT:2},TEs={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},IEs=2**16-1,xEs={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},wEs=Buffer.allocUnsafe(0),REs={string:1,typedArray:2,arrayBuffer:3,blob:4};bLn.exports={uid:vEs,sentCloseFrameState:SEs,staticPropertyDescriptors:CEs,states:bEs,opcodes:TEs,maxUnsigned16Bit:IEs,parserStates:xEs,emptyBuffer:wEs,sendHints:REs}});var Bke=I((Rrf,SLn)=>{"use strict";p();SLn.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}});var Qke=I((Prf,NLn)=>{"use strict";p();var{kReadyState:Fke,kController:kEs,kResponse:PEs,kBinaryType:DEs,kWebSocketURL:NEs}=Bke(),{states:Uke,opcodes:_j}=aZ(),{ErrorEvent:MEs,createFastMessageEvent:OEs}=Dfe(),{isUtf8:LEs}=require("node:buffer"),{collectASequenceOfCodePointsFast:BEs,removeHTTPWhitespace:TLn}=nb();function FEs(t){return t[Fke]===Uke.CONNECTING}a(FEs,"isConnecting");function UEs(t){return t[Fke]===Uke.OPEN}a(UEs,"isEstablished");function QEs(t){return t[Fke]===Uke.CLOSING}a(QEs,"isClosing");function qEs(t){return t[Fke]===Uke.CLOSED}a(qEs,"isClosed");function Qtr(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(Qtr,"fireEvent");function jEs(t,e,r){if(t[Fke]!==Uke.OPEN)return;let n;if(e===_j.TEXT)try{n=DLn(r)}catch{xLn(t,"Received invalid UTF-8 in text frame.");return}else e===_j.BINARY&&(t[DEs]==="blob"?n=new Blob([r]):n=HEs(r));Qtr("message",t,OEs,{origin:t[NEs].origin,data:n})}a(jEs,"websocketMessageReceived");function HEs(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}a(HEs,"toArrayBuffer");function GEs(t){if(t.length===0)return!1;for(let e=0;e126||r===34||r===40||r===41||r===44||r===47||r===58||r===59||r===60||r===61||r===62||r===63||r===64||r===91||r===92||r===93||r===123||r===125)return!1}return!0}a(GEs,"isValidSubprotocol");function $Es(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a($Es,"isValidStatusCode");function xLn(t,e){let{[kEs]:r,[PEs]:n}=t;r.abort(),n?.socket&&!n.socket.destroyed&&n.socket.destroy(),e&&Qtr("error",t,(o,s)=>new MEs(o,s),{error:new Error(e),message:e})}a(xLn,"failWebsocketConnection");function wLn(t){return t===_j.CLOSE||t===_j.PING||t===_j.PONG}a(wLn,"isControlFrame");function RLn(t){return t===_j.CONTINUATION}a(RLn,"isContinuationFrame");function kLn(t){return t===_j.TEXT||t===_j.BINARY}a(kLn,"isTextBinaryFrame");function VEs(t){return kLn(t)||RLn(t)||wLn(t)}a(VEs,"isValidOpcode");function WEs(t){let e={position:0},r=new Map;for(;e.position57)return!1}let e=Number.parseInt(t,10);return e>=8&&e<=15}a(zEs,"isValidClientWindowBits");var PLn=typeof process.versions.icu=="string",ILn=PLn?new TextDecoder("utf-8",{fatal:!0}):void 0,DLn=PLn?ILn.decode.bind(ILn):function(t){if(LEs(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")};NLn.exports={isConnecting:FEs,isEstablished:UEs,isClosing:QEs,isClosed:qEs,fireEvent:Qtr,isValidSubprotocol:GEs,isValidStatusCode:$Es,failWebsocketConnection:xLn,websocketMessageReceived:jEs,utf8Decode:DLn,isControlFrame:wLn,isContinuationFrame:RLn,isTextBinaryFrame:kLn,isValidOpcode:VEs,parseExtensions:WEs,isValidClientWindowBits:zEs}});var _it=I((Mrf,MLn)=>{"use strict";p();var{maxUnsigned16Bit:YEs}=aZ(),Eit=16386,qtr,qke=null,Nfe=Eit;try{qtr=require("node:crypto")}catch{qtr={randomFillSync:a(function(e,r,n){for(let o=0;oYEs?(c+=8,s=127):o>125&&(c+=2,s=126);let l=Buffer.allocUnsafe(o+c);l[0]=l[1]=0,l[0]|=128,l[0]=(l[0]&240)+e;l[c-4]=n[0],l[c-3]=n[1],l[c-2]=n[2],l[c-1]=n[3],l[1]=s,s===126?l.writeUInt16BE(o,2):s===127&&(l[2]=l[3]=0,l.writeUIntBE(o,4,6)),l[1]|=128;for(let u=0;u{"use strict";p();var{uid:JEs,states:jke,sentCloseFrameState:vit,emptyBuffer:ZEs,opcodes:XEs}=aZ(),{kReadyState:Hke,kSentClose:Cit,kByteParser:LLn,kReceivedClose:OLn,kResponse:BLn}=Bke(),{fireEvent:e_s,failWebsocketConnection:vj,isClosing:t_s,isClosed:r_s,isEstablished:n_s,parseExtensions:i_s}=Qke(),{channels:Mfe}=$de(),{CloseEvent:o_s}=Dfe(),{makeRequest:s_s}=Ife(),{fetching:a_s}=Nke(),{Headers:c_s,getHeadersList:l_s}=tZ(),{getDecodeSplit:u_s}=sT(),{WebsocketFrameSend:d_s}=_it(),Htr;try{Htr=require("node:crypto")}catch{}function f_s(t,e,r,n,o,s){let c=t;c.protocol=t.protocol==="ws:"?"http:":"https:";let l=s_s({urlList:[c],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(s.headers){let h=l_s(new c_s(s.headers));l.headersList=h}let u=Htr.randomBytes(16).toString("base64");l.headersList.append("sec-websocket-key",u),l.headersList.append("sec-websocket-version","13");for(let h of e)l.headersList.append("sec-websocket-protocol",h);return l.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits"),a_s({request:l,useParallelQueue:!0,dispatcher:s.dispatcher,processResponse(h){if(h.type==="error"||h.status!==101){vj(n,"Received network error or non-101 status code.");return}if(e.length!==0&&!h.headersList.get("Sec-WebSocket-Protocol")){vj(n,"Server did not respond with sent protocols.");return}if(h.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){vj(n,'Server did not set Upgrade header to "websocket".');return}if(h.headersList.get("Connection")?.toLowerCase()!=="upgrade"){vj(n,'Server did not set Connection header to "upgrade".');return}let m=h.headersList.get("Sec-WebSocket-Accept"),g=Htr.createHash("sha1").update(u+JEs).digest("base64");if(m!==g){vj(n,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let A=h.headersList.get("Sec-WebSocket-Extensions"),y;if(A!==null&&(y=i_s(A),!y.has("permessage-deflate"))){vj(n,"Sec-WebSocket-Extensions header does not match.");return}let E=h.headersList.get("Sec-WebSocket-Protocol");if(E!==null&&!u_s("sec-websocket-protocol",l.headersList).includes(E)){vj(n,"Protocol was not set in the opening handshake.");return}h.socket.on("data",FLn),h.socket.on("close",ULn),h.socket.on("error",QLn),Mfe.open.hasSubscribers&&Mfe.open.publish({address:h.socket.address(),protocol:E,extensions:A}),o(h,y)}})}a(f_s,"establishWebSocketConnection");function p_s(t,e,r,n){if(!(t_s(t)||r_s(t)))if(!n_s(t))vj(t,"Connection was closed before it was established."),t[Hke]=jke.CLOSING;else if(t[Cit]===vit.NOT_SENT){t[Cit]=vit.PROCESSING;let o=new d_s;e!==void 0&&r===void 0?(o.frameData=Buffer.allocUnsafe(2),o.frameData.writeUInt16BE(e,0)):e!==void 0&&r!==void 0?(o.frameData=Buffer.allocUnsafe(2+n),o.frameData.writeUInt16BE(e,0),o.frameData.write(r,2,"utf-8")):o.frameData=ZEs,t[BLn].socket.write(o.createFrame(XEs.CLOSE)),t[Cit]=vit.SENT,t[Hke]=jke.CLOSING}else t[Hke]=jke.CLOSING}a(p_s,"closeWebSocketConnection");function FLn(t){this.ws[LLn].write(t)||this.pause()}a(FLn,"onSocketData");function ULn(){let{ws:t}=this,{[BLn]:e}=t;e.socket.off("data",FLn),e.socket.off("close",ULn),e.socket.off("error",QLn);let r=t[Cit]===vit.SENT&&t[OLn],n=1005,o="",s=t[LLn].closingInfo;s&&!s.error?(n=s.code??1005,o=s.reason):t[OLn]||(n=1006),t[Hke]=jke.CLOSED,e_s("close",t,(c,l)=>new o_s(c,l),{wasClean:r,code:n,reason:o}),Mfe.close.hasSubscribers&&Mfe.close.publish({websocket:t,code:n,reason:o})}a(ULn,"onSocketClose");function QLn(t){let{ws:e}=this;e[Hke]=jke.CLOSING,Mfe.socketError.hasSubscribers&&Mfe.socketError.publish(t),this.destroy()}a(QLn,"onSocketError");qLn.exports={establishWebSocketConnection:f_s,closeWebSocketConnection:p_s}});var GLn=I((Qrf,HLn)=>{"use strict";p();var{createInflateRaw:h_s,Z_DEFAULT_WINDOWBITS:m_s}=require("node:zlib"),{isValidClientWindowBits:g_s}=Qke(),{MessageSizeExceededError:jLn}=Ec(),A_s=Buffer.from([0,0,255,255]),bit=Symbol("kBuffer"),Gke=Symbol("kLength"),y_s=4*1024*1024,$tr=class{static{a(this,"PerMessageDeflate")}#e;#t={};#r=!1;#n=null;constructor(e){this.#t.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=e.get("server_max_window_bits")}decompress(e,r,n){if(this.#r){n(new jLn);return}if(!this.#e){let o=m_s;if(this.#t.serverMaxWindowBits){if(!g_s(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=h_s({windowBits:o})}catch(s){n(s);return}this.#e[bit]=[],this.#e[Gke]=0,this.#e.on("data",s=>{if(!this.#r){if(this.#e[Gke]+=s.length,this.#e[Gke]>y_s){if(this.#r=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#n){let c=this.#n;this.#n=null,c(new jLn)}return}this.#e[bit].push(s)}}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#n=n,this.#e.write(e),r&&this.#e.write(A_s),this.#e.flush(()=>{if(this.#r||!this.#e)return;let o=Buffer.concat(this.#e[bit],this.#e[Gke]);this.#e[bit].length=0,this.#e[Gke]=0,this.#n=null,n(null,o)})}};HLn.exports={PerMessageDeflate:$tr}});var eBn=I((Hrf,XLn)=>{"use strict";p();var{Writable:E_s}=require("node:stream"),__s=require("node:assert"),{parserStates:cb,opcodes:Ofe,states:v_s,emptyBuffer:$Ln,sentCloseFrameState:VLn}=aZ(),{kReadyState:C_s,kSentClose:WLn,kResponse:zLn,kReceivedClose:YLn}=Bke(),{channels:Sit}=$de(),{isValidStatusCode:b_s,isValidOpcode:S_s,failWebsocketConnection:pT,websocketMessageReceived:KLn,utf8Decode:T_s,isControlFrame:JLn,isTextBinaryFrame:Vtr,isContinuationFrame:I_s}=Qke(),{WebsocketFrameSend:ZLn}=_it(),{closeWebSocketConnection:x_s}=Gtr(),{PerMessageDeflate:w_s}=GLn(),Wtr=class extends E_s{static{a(this,"ByteParser")}#e=[];#t=0;#r=!1;#n=cb.INFO;#i={};#o=[];#s;constructor(e,r){super(),this.ws=e,this.#s=r??new Map,this.#s.has("permessage-deflate")&&this.#s.set("permessage-deflate",new w_s(r))}_write(e,r,n){this.#e.push(e),this.#t+=e.length,this.#r=!0,this.run(n)}run(e){for(;this.#r;)if(this.#n===cb.INFO){if(this.#t<2)return e();let r=this.consume(2),n=(r[0]&128)!==0,o=r[0]&15,s=(r[1]&128)===128,c=!n&&o!==Ofe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!S_s(o))return pT(this.ws,"Invalid opcode received"),e();if(s)return pT(this.ws,"Frame cannot be masked"),e();if(u!==0&&!this.#s.has("permessage-deflate")){pT(this.ws,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){pT(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!Vtr(o)){pT(this.ws,"Invalid frame type was fragmented.");return}if(Vtr(o)&&this.#o.length>0){pT(this.ws,"Expected continuation frame");return}if(this.#i.fragmented&&c){pT(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&JLn(o)){pT(this.ws,"Control frame either too large or fragmented");return}if(I_s(o)&&this.#o.length===0&&!this.#i.compressed){pT(this.ws,"Unexpected continuation frame");return}l<=125?(this.#i.payloadLength=l,this.#n=cb.READ_DATA):l===126?this.#n=cb.PAYLOADLENGTH_16:l===127&&(this.#n=cb.PAYLOADLENGTH_64),Vtr(o)&&(this.#i.binaryType=o,this.#i.compressed=u!==0),this.#i.opcode=o,this.#i.masked=s,this.#i.fin=n,this.#i.fragmented=c}else if(this.#n===cb.PAYLOADLENGTH_16){if(this.#t<2)return e();let r=this.consume(2);this.#i.payloadLength=r.readUInt16BE(0),this.#n=cb.READ_DATA}else if(this.#n===cb.PAYLOADLENGTH_64){if(this.#t<8)return e();let r=this.consume(8),n=r.readUInt32BE(0),o=r.readUInt32BE(4);if(n!==0||o>2**31-1){pT(this.ws,"Received payload length > 2^31 bytes.");return}this.#i.payloadLength=o,this.#n=cb.READ_DATA}else if(this.#n===cb.READ_DATA){if(this.#t{if(n){pT(this.ws,n.message);return}if(this.#o.push(o),!this.#i.fin){this.#n=cb.INFO,this.#r=!0,this.run(e);return}KLn(this.ws,this.#i.binaryType,Buffer.concat(this.#o)),this.#r=!0,this.#n=cb.INFO,this.#o.length=0,this.run(e)}),this.#r=!1;break}else{if(this.#o.push(r),!this.#i.fragmented&&this.#i.fin){let n=Buffer.concat(this.#o);KLn(this.ws,this.#i.binaryType,n),this.#o.length=0}this.#n=cb.INFO}}}consume(e){if(e>this.#t)throw new Error("Called consume() before buffers satiated.");if(e===0)return $Ln;if(this.#e[0].length===e)return this.#t-=this.#e[0].length,this.#e.shift();let r=Buffer.allocUnsafe(e),n=0;for(;n!==e;){let o=this.#e[0],{length:s}=o;if(s+n===e){r.set(this.#e.shift(),n);break}else if(s+n>e){r.set(o.subarray(0,e-n),n),this.#e[0]=o.subarray(e-n);break}else r.set(this.#e.shift(),n),n+=o.length}return this.#t-=e,r}parseCloseBody(e){__s(e.length!==1);let r;if(e.length>=2&&(r=e.readUInt16BE(0)),r!==void 0&&!b_s(r))return{code:1002,reason:"Invalid status code",error:!0};let n=e.subarray(2);n[0]===239&&n[1]===187&&n[2]===191&&(n=n.subarray(3));try{n=T_s(n)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:r,reason:n,error:!1}}parseControlFrame(e){let{opcode:r,payloadLength:n}=this.#i;if(r===Ofe.CLOSE){if(n===1)return pT(this.ws,"Received close frame with a 1-byte body."),!1;if(this.#i.closeInfo=this.parseCloseBody(e),this.#i.closeInfo.error){let{code:o,reason:s}=this.#i.closeInfo;return x_s(this.ws,o,s,s.length),pT(this.ws,s),!1}if(this.ws[WLn]!==VLn.SENT){let o=$Ln;this.#i.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#i.closeInfo.code,0));let s=new ZLn(o);this.ws[zLn].socket.write(s.createFrame(Ofe.CLOSE),c=>{c||(this.ws[WLn]=VLn.SENT)})}return this.ws[C_s]=v_s.CLOSING,this.ws[YLn]=!0,!1}else if(r===Ofe.PING){if(!this.ws[YLn]){let o=new ZLn(e);this.ws[zLn].socket.write(o.createFrame(Ofe.PONG)),Sit.ping.hasSubscribers&&Sit.ping.publish({payload:e})}}else r===Ofe.PONG&&Sit.pong.hasSubscribers&&Sit.pong.publish({payload:e});return!0}get closingInfo(){return this.#i.closeInfo}};XLn.exports={ByteParser:Wtr}});var oBn=I((Vrf,iBn)=>{"use strict";p();var{WebsocketFrameSend:R_s}=_it(),{opcodes:tBn,sendHints:Lfe}=aZ(),k_s=ner(),rBn=Buffer[Symbol.species],ztr=class{static{a(this,"SendQueue")}#e=new k_s;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==Lfe.blob){let s=nBn(e,n);if(!this.#t)this.#r.write(s,r);else{let c={promise:null,callback:r,frame:s};this.#e.push(c)}return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=nBn(s,n)}),callback:r,frame:null};this.#e.push(o),this.#t||this.#n()}async#n(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let r=e.shift();r.promise!==null&&await r.promise,this.#r.write(r.frame,r.callback),r.callback=r.frame=null}this.#t=!1}};function nBn(t,e){return new R_s(P_s(t,e)).createFrame(e===Lfe.string?tBn.TEXT:tBn.BINARY)}a(nBn,"createFrame");function P_s(t,e){switch(e){case Lfe.string:return Buffer.from(t);case Lfe.arrayBuffer:case Lfe.blob:return new rBn(t);case Lfe.typedArray:return new rBn(t.buffer,t.byteOffset,t.byteLength)}}a(P_s,"toBuffer");iBn.exports={SendQueue:ztr}});var hBn=I((Yrf,pBn)=>{"use strict";p();var{webidl:so}=qA(),{URLSerializer:D_s}=nb(),{environmentSettingsObject:sBn}=sT(),{staticPropertyDescriptors:Cj,states:$ke,sentCloseFrameState:N_s,sendHints:Tit}=aZ(),{kWebSocketURL:aBn,kReadyState:Ytr,kController:M_s,kBinaryType:Iit,kResponse:cBn,kSentClose:O_s,kByteParser:L_s}=Bke(),{isConnecting:B_s,isEstablished:F_s,isClosing:U_s,isValidSubprotocol:Q_s,fireEvent:lBn}=Qke(),{establishWebSocketConnection:q_s,closeWebSocketConnection:uBn}=Gtr(),{ByteParser:j_s}=eBn(),{kEnumerableProperty:Iw,isBlobLike:dBn}=qs(),{getGlobalDispatcher:H_s}=qnt(),{types:fBn}=require("node:util"),{ErrorEvent:G_s,CloseEvent:$_s}=Dfe(),{SendQueue:V_s}=oBn(),hT=class t extends EventTarget{static{a(this,"WebSocket")}#e={open:null,error:null,close:null,message:null};#t=0;#r="";#n="";#i;constructor(e,r=[]){super(),so.util.markAsUncloneable(this);let n="WebSocket constructor";so.argumentLengthCheck(arguments,1,n);let o=so.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=so.converters.USVString(e,n,"url"),r=o.protocols;let s=sBn.settingsObject.baseUrl,c;try{c=new URL(e,s)}catch(u){throw new DOMException(u,"SyntaxError")}if(c.protocol==="http:"?c.protocol="ws:":c.protocol==="https:"&&(c.protocol="wss:"),c.protocol!=="ws:"&&c.protocol!=="wss:")throw new DOMException(`Expected a ws: or wss: protocol, got ${c.protocol}`,"SyntaxError");if(c.hash||c.href.endsWith("#"))throw new DOMException("Got fragment","SyntaxError");if(typeof r=="string"&&(r=[r]),r.length!==new Set(r.map(u=>u.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(r.length>0&&!r.every(u=>Q_s(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[aBn]=new URL(c.href);let l=sBn.settingsObject;this[M_s]=q_s(c,r,l,this,(u,d)=>this.#o(u,d),o),this[Ytr]=t.CONNECTING,this[O_s]=N_s.NOT_SENT,this[Iit]="blob"}close(e=void 0,r=void 0){so.brandCheck(this,t);let n="WebSocket.close";if(e!==void 0&&(e=so.converters["unsigned short"](e,n,"code",{clamp:!0})),r!==void 0&&(r=so.converters.USVString(r,n,"reason")),e!==void 0&&e!==1e3&&(e<3e3||e>4999))throw new DOMException("invalid code","InvalidAccessError");let o=0;if(r!==void 0&&(o=Buffer.byteLength(r),o>123))throw new DOMException(`Reason must be less than 123 bytes; received ${o}`,"SyntaxError");uBn(this,e,r,o)}send(e){so.brandCheck(this,t);let r="WebSocket.send";if(so.argumentLengthCheck(arguments,1,r),e=so.converters.WebSocketSendData(e,r,"data"),B_s(this))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!F_s(this)||U_s(this)))if(typeof e=="string"){let n=Buffer.byteLength(e);this.#t+=n,this.#i.add(e,()=>{this.#t-=n},Tit.string)}else fBn.isArrayBuffer(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Tit.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Tit.typedArray)):dBn(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},Tit.blob))}get readyState(){return so.brandCheck(this,t),this[Ytr]}get bufferedAmount(){return so.brandCheck(this,t),this.#t}get url(){return so.brandCheck(this,t),D_s(this[aBn])}get extensions(){return so.brandCheck(this,t),this.#n}get protocol(){return so.brandCheck(this,t),this.#r}get onopen(){return so.brandCheck(this,t),this.#e.open}set onopen(e){so.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onerror(){return so.brandCheck(this,t),this.#e.error}set onerror(e){so.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}get onclose(){return so.brandCheck(this,t),this.#e.close}set onclose(e){so.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close),typeof e=="function"?(this.#e.close=e,this.addEventListener("close",e)):this.#e.close=null}get onmessage(){return so.brandCheck(this,t),this.#e.message}set onmessage(e){so.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get binaryType(){return so.brandCheck(this,t),this[Iit]}set binaryType(e){so.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this[Iit]="blob":this[Iit]=e}#o(e,r){this[cBn]=e;let n=new j_s(this,r);n.on("drain",W_s),n.on("error",z_s.bind(this)),e.socket.ws=this,this[L_s]=n,this.#i=new V_s(e.socket),this[Ytr]=$ke.OPEN;let o=e.headersList.get("sec-websocket-extensions");o!==null&&(this.#n=o);let s=e.headersList.get("sec-websocket-protocol");s!==null&&(this.#r=s),lBn("open",this)}};hT.CONNECTING=hT.prototype.CONNECTING=$ke.CONNECTING;hT.OPEN=hT.prototype.OPEN=$ke.OPEN;hT.CLOSING=hT.prototype.CLOSING=$ke.CLOSING;hT.CLOSED=hT.prototype.CLOSED=$ke.CLOSED;Object.defineProperties(hT.prototype,{CONNECTING:Cj,OPEN:Cj,CLOSING:Cj,CLOSED:Cj,url:Iw,readyState:Iw,bufferedAmount:Iw,onopen:Iw,onerror:Iw,onclose:Iw,close:Iw,onmessage:Iw,binaryType:Iw,send:Iw,extensions:Iw,protocol:Iw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(hT,{CONNECTING:Cj,OPEN:Cj,CLOSING:Cj,CLOSED:Cj});so.converters["sequence"]=so.sequenceConverter(so.converters.DOMString);so.converters["DOMString or sequence"]=function(t,e,r){return so.util.Type(t)==="Object"&&Symbol.iterator in t?so.converters["sequence"](t):so.converters.DOMString(t,e,r)};so.converters.WebSocketInit=so.dictionaryConverter([{key:"protocols",converter:so.converters["DOMString or sequence"],defaultValue:a(()=>new Array(0),"defaultValue")},{key:"dispatcher",converter:so.converters.any,defaultValue:a(()=>H_s(),"defaultValue")},{key:"headers",converter:so.nullableConverter(so.converters.HeadersInit)}]);so.converters["DOMString or sequence or WebSocketInit"]=function(t){return so.util.Type(t)==="Object"&&!(Symbol.iterator in t)?so.converters.WebSocketInit(t):{protocols:so.converters["DOMString or sequence"](t)}};so.converters.WebSocketSendData=function(t){if(so.util.Type(t)==="Object"){if(dBn(t))return so.converters.Blob(t,{strict:!1});if(ArrayBuffer.isView(t)||fBn.isArrayBuffer(t))return so.converters.BufferSource(t)}return so.converters.USVString(t)};function W_s(){this.ws[cBn].socket.resume()}a(W_s,"onParserDrain");function z_s(t){let e,r;t instanceof $_s?(e=t.reason,r=t.code):e=t.message,lBn("error",this,()=>new G_s("error",{error:t,message:e})),uBn(this,r)}a(z_s,"onParserError");pBn.exports={WebSocket:hT}});var Ktr=I((Zrf,mBn)=>{"use strict";p();function Y_s(t){return t.indexOf("\0")===-1}a(Y_s,"isValidLastEventId");function K_s(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(K_s,"isASCIINumber");function J_s(t){return new Promise(e=>{setTimeout(e,t).unref()})}a(J_s,"delay");mBn.exports={isValidLastEventId:Y_s,isASCIINumber:K_s,delay:J_s}});var EBn=I((tnf,yBn)=>{"use strict";p();var{Transform:Z_s}=require("node:stream"),{isASCIINumber:gBn,isValidLastEventId:ABn}=Ktr(),LF=[239,187,191],Jtr=10,xit=13,X_s=58,evs=32,Ztr=class extends Z_s{static{a(this,"EventSourceStream")}state=null;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,r,n){if(e.length===0){n();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===LF[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===LF[0]&&this.buffer[1]===LF[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===LF[0]&&this.buffer[1]===LF[1]&&this.buffer[2]===LF[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===LF[0]&&this.buffer[1]===LF[1]&&this.buffer[2]===LF[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&gBn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&ABn(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};yBn.exports={EventSourceStream:Ztr}});var xBn=I((inf,IBn)=>{"use strict";p();var{pipeline:tvs}=require("node:stream"),{fetching:rvs}=Nke(),{makeRequest:nvs}=Ife(),{webidl:BF}=qA(),{EventSourceStream:ivs}=EBn(),{parseMIMEType:ovs}=nb(),{createFastMessageEvent:svs}=Dfe(),{isNetworkError:_Bn}=Pke(),{delay:avs}=Ktr(),{kEnumerableProperty:cZ}=qs(),{environmentSettingsObject:vBn}=sT(),CBn=!1,bBn=3e3,Vke=0,SBn=1,Wke=2,cvs="anonymous",lvs="use-credentials",Bfe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t=null;#r=!1;#n=Vke;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),BF.util.markAsUncloneable(this);let n="EventSource constructor";BF.argumentLengthCheck(arguments,1,n),CBn||(CBn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=BF.converters.USVString(e,n,"url"),r=BF.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.dispatcher,this.#a={lastEventId:"",reconnectionTime:bBn};let o=vBn,s;try{s=new URL(e,o.settingsObject.baseUrl),this.#a.origin=s.origin}catch(u){throw new DOMException(u,"SyntaxError")}this.#t=s.href;let c=cvs;r.withCredentials&&(c=lvs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=vBn.settingsObject,l.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],l.cache="no-store",l.initiator="other",l.urlList=[new URL(this.#t)],this.#i=nvs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===Wke)return;this.#n=Vke;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{_Bn(n)&&(this.dispatchEvent(new Event("error")),this.close()),this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(_Bn(n))if(n.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#u();return}let o=n.headersList.get("content-type",!0),s=o!==null?ovs(o):"failure",c=s!=="failure"&&s.essence==="text/event-stream";if(n.status!==200||c===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#n=SBn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new ivs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(svs(u.type,u.options))},"push")});tvs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=rvs(e)}async#u(){this.#n!==Wke&&(this.#n=Vke,this.dispatchEvent(new Event("error")),await avs(this.#a.reconnectionTime),this.#n===Vke&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){BF.brandCheck(this,t),this.#n!==Wke&&(this.#n=Wke,this.#o.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}},TBn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:Vke,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:SBn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:Wke,writable:!1}};Object.defineProperties(Bfe,TBn);Object.defineProperties(Bfe.prototype,TBn);Object.defineProperties(Bfe.prototype,{close:cZ,onerror:cZ,onmessage:cZ,onopen:cZ,readyState:cZ,url:cZ,withCredentials:cZ});BF.converters.EventSourceInitDict=BF.dictionaryConverter([{key:"withCredentials",converter:BF.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:BF.converters.any}]);IBn.exports={EventSource:Bfe,defaultReconnectionTime:bBn}});var PBn=I((anf,Ki)=>{"use strict";p();var uvs=dfe(),wBn=JRe(),dvs=ffe(),fvs=TMn(),pvs=pfe(),hvs=ber(),mvs=YMn(),gvs=tOn(),RBn=Ec(),Rit=qs(),{InvalidArgumentError:wit}=RBn,Ffe=qOn(),Avs=XRe(),yvs=itr(),Evs=b5n(),_vs=atr(),vvs=$er(),Cvs=Pnt(),{getGlobalDispatcher:kBn,setGlobalDispatcher:bvs}=qnt(),Svs=jnt(),Tvs=_nt(),Ivs=vnt();Object.assign(wBn.prototype,Ffe);Ki.exports.Dispatcher=wBn;Ki.exports.Client=uvs;Ki.exports.Pool=dvs;Ki.exports.BalancedPool=fvs;Ki.exports.Agent=pvs;Ki.exports.ProxyAgent=hvs;Ki.exports.EnvHttpProxyAgent=mvs;Ki.exports.RetryAgent=gvs;Ki.exports.RetryHandler=Cvs;Ki.exports.DecoratorHandler=Svs;Ki.exports.RedirectHandler=Tvs;Ki.exports.createRedirectInterceptor=Ivs;Ki.exports.interceptors={redirect:k5n(),retry:D5n(),dump:M5n(),dns:B5n()};Ki.exports.buildConnector=Avs;Ki.exports.errors=RBn;Ki.exports.util={parseHeaders:Rit.parseHeaders,headerNameToString:Rit.headerNameToString};function zke(t){return(e,r,n)=>{if(typeof r=="function"&&(n=r,r=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new wit("invalid url");if(r!=null&&typeof r!="object")throw new wit("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new wit("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(Rit.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=Rit.parseURL(e);let{agent:o,dispatcher:s=kBn()}=r;if(o)throw new wit("unsupported opts.agent. Did you mean opts.client?");return t.call(s,{...r,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:r.method||(r.body?"PUT":"GET")},n)}}a(zke,"makeDispatcher");Ki.exports.setGlobalDispatcher=bvs;Ki.exports.getGlobalDispatcher=kBn;var xvs=Nke().fetch;Ki.exports.fetch=a(async function(e,r=void 0){try{return await xvs(e,r)}catch(n){throw n&&typeof n=="object"&&Error.captureStackTrace(n),n}},"fetch");Ki.exports.Headers=tZ().Headers;Ki.exports.Response=Pke().Response;Ki.exports.Request=Ife().Request;Ki.exports.FormData=ske().FormData;Ki.exports.File=globalThis.File??require("node:buffer").File;Ki.exports.FileReader=X4n().FileReader;var{setGlobalOrigin:wvs,getGlobalOrigin:Rvs}=SXt();Ki.exports.setGlobalOrigin=wvs;Ki.exports.getGlobalOrigin=Rvs;var{CacheStorage:kvs}=cLn(),{kConstruct:Pvs}=lit();Ki.exports.caches=new kvs(Pvs);var{deleteCookie:Dvs,getCookies:Nvs,getSetCookies:Mvs,setCookie:Ovs}=_Ln();Ki.exports.deleteCookie=Dvs;Ki.exports.getCookies=Nvs;Ki.exports.getSetCookies=Mvs;Ki.exports.setCookie=Ovs;var{parseMIMEType:Lvs,serializeAMimeType:Bvs}=nb();Ki.exports.parseMIMEType=Lvs;Ki.exports.serializeAMimeType=Bvs;var{CloseEvent:Fvs,ErrorEvent:Uvs,MessageEvent:Qvs}=Dfe();Ki.exports.WebSocket=hBn().WebSocket;Ki.exports.CloseEvent=Fvs;Ki.exports.ErrorEvent=Uvs;Ki.exports.MessageEvent=Qvs;Ki.exports.request=zke(Ffe.request);Ki.exports.stream=zke(Ffe.stream);Ki.exports.pipeline=zke(Ffe.pipeline);Ki.exports.connect=zke(Ffe.connect);Ki.exports.upgrade=zke(Ffe.upgrade);Ki.exports.MockClient=yvs;Ki.exports.MockPool=_vs;Ki.exports.MockAgent=Evs;Ki.exports.mockErrors=vvs;var{EventSource:qvs}=xBn();Ki.exports.EventSource=qvs});var As=I((unf,DBn)=>{p();DBn.exports={options:{usePureJavaScript:!1}}});var OBn=I((fnf,MBn)=>{p();var Xtr={};MBn.exports=Xtr;var NBn={};Xtr.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=jvs(t,e);else{var o=0,s=e.length,c=e.charAt(0),l=[0];for(o=0;o0;)l.push(d%s),d=d/s|0}for(o=0;t[o]===0&&o=0;--o)n+=e[l[o]]}if(r){var f=new RegExp(".{1,"+r+"}","g");n=n.match(f).join(`\r -`)}return n};Xtr.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=NBn[e];if(!r){r=NBn[e]=[];for(var n=0;n>=8;for(;d>0;)c.push(d&255),d>>=8}for(var f=0;t[f]===s&&f0;)s.push(l%n),l=l/n|0}var u="";for(r=0;t.at(r)===0&&r=0;--r)u+=e[s[r]];return u}a(jvs,"_encodeWithByteBuffer")});var ac=I((mnf,UBn)=>{p();var LBn=As(),BBn=OBn(),nt=UBn.exports=LBn.util=LBn.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){nt.nextTick=process.nextTick,typeof setImmediate=="function"?nt.setImmediate=setImmediate:nt.setImmediate=nt.nextTick;return}if(typeof setImmediate=="function"){nt.setImmediate=function(){return setImmediate.apply(void 0,arguments)},nt.nextTick=function(l){return setImmediate(l)};return}if(nt.setImmediate=function(l){setTimeout(l,0)},typeof window<"u"&&typeof window.postMessage=="function"){let l=function(u){if(u.source===window&&u.data===t){u.stopPropagation();var d=e.slice();e.length=0,d.forEach(function(f){f()})}};var c=l;a(l,"handler");var t="forge.setImmediate",e=[];nt.setImmediate=function(u){e.push(u),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",l,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,o=document.createElement("div"),e=[];new MutationObserver(function(){var u=e.slice();e.length=0,u.forEach(function(d){d()})}).observe(o,{attributes:!0});var s=nt.setImmediate;nt.setImmediate=function(u){Date.now()-r>15?(r=Date.now(),s(u)):(e.push(u),e.length===1&&o.setAttribute("a",n=!n))}}nt.nextTick=nt.setImmediate})();nt.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;nt.globalScope=(function(){return nt.isNodejs?global:typeof self>"u"?window:self})();nt.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};nt.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};nt.isArrayBufferView=function(t){return t&&nt.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function Yke(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}a(Yke,"_checkBitsParam");nt.ByteBuffer=trr;function trr(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(nt.isArrayBuffer(t)||nt.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;rHvs&&(this.data.substr(0,1),this._constructedStringLength=0)};nt.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};nt.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};nt.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};nt.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};nt.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};nt.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(nt.encodeUtf8(t))};nt.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};nt.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};nt.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};nt.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};nt.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};nt.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};nt.ByteStringBuffer.prototype.putInt=function(t,e){Yke(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};nt.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};nt.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};nt.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};nt.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};nt.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};nt.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};nt.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};nt.ByteStringBuffer.prototype.copy=function(){var t=nt.createBuffer(this.data);return t.read=this.read,t};nt.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};nt.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};nt.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};nt.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};nt.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};nt.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};nt.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};nt.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};nt.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};nt.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};nt.DataBuffer.prototype.putInt=function(t,e){Yke(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};nt.DataBuffer.prototype.putSignedInt=function(t,e){return Yke(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};nt.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};nt.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};nt.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};nt.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};nt.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};nt.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};nt.DataBuffer.prototype.copy=function(){return new nt.DataBuffer(this)};nt.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};nt.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};nt.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};nt.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};nt.xorBytes=function(t,e,r){for(var n="",o="",s="",c=0,l=0;r>0;--r,++c)o=t.charCodeAt(c)^e.charCodeAt(c),l>=10&&(n+=s,s="",l=0),s+=String.fromCharCode(o),++l;return n+=s,n};nt.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var bj="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Sj=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],FBn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";nt.encode64=function(t,e){for(var r="",n="",o,s,c,l=0;l>2),r+=bj.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=bj.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":bj.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};nt.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,o,s,c=0;c>4),o!==64&&(e+=String.fromCharCode((n&15)<<4|o>>2),s!==64&&(e+=String.fromCharCode((o&3)<<6|s)));return e};nt.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};nt.decodeUtf8=function(t){return decodeURIComponent(escape(t))};nt.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:BBn.encode,decode:BBn.decode}};nt.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};nt.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var o=r,s=0;s>2),r+=bj.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=bj.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":bj.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};nt.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var o,s,c,l,u=0,d=r;u>4,c!==64&&(n[d++]=(s&15)<<4|c>>2,l!==64&&(n[d++]=(c&3)<<6|l));return e?d-r:n.subarray(0,d)};nt.binary.base58.encode=function(t,e){return nt.binary.baseN.encode(t,FBn,e)};nt.binary.base58.decode=function(t,e){return nt.binary.baseN.decode(t,FBn,e)};nt.text={utf8:{},utf16:{}};nt.text.utf8.encode=function(t,e,r){t=nt.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var o=r,s=0;s"u"&&(r=["web","flash"]);var o,s=!1,c=null;for(var l in r){o=r[l];try{if(o==="flash"||o==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),s=o==="flash"}(o==="web"||o==="both")&&(e[0]=localStorage,n=t.apply(this,e),s=!0)}catch(u){c=u}if(s)break}if(!s)throw c;return n},"_callStorageFunction");nt.setItem=function(t,e,r,n,o){kit($vs,arguments,o)};nt.getItem=function(t,e,r,n){return kit(Vvs,arguments,n)};nt.removeItem=function(t,e,r,n){kit(Wvs,arguments,n)};nt.clearItems=function(t,e,r){kit(zvs,arguments,r)};nt.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};nt.format=function(t){for(var e=/%./g,r,n,o=0,s=[],c=0;r=e.exec(t);){n=t.substring(c,e.lastIndex-2),n.length>0&&s.push(n),c=e.lastIndex;var l=r[0][1];switch(l){case"s":case"o":o");break;case"%":s.push("%");break;default:s.push("<%"+l+"?>")}}return s.push(t.substring(c)),s.join("")};nt.formatNumber=function(t,e,r,n){var o=t,s=isNaN(e=Math.abs(e))?2:e,c=r===void 0?",":r,l=n===void 0?".":n,u=o<0?"-":"",d=parseInt(o=Math.abs(+o||0).toFixed(s),10)+"",f=d.length>3?d.length%3:0;return u+(f?d.substr(0,f)+l:"")+d.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+l)+(s?c+Math.abs(o-d).toFixed(s).slice(2):"")};nt.formatSize=function(t){return t>=1073741824?t=nt.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=nt.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=nt.formatNumber(t/1024,0)+" KiB":t=nt.formatNumber(t,0)+" bytes",t};nt.bytesFromIP=function(t){return t.indexOf(".")!==-1?nt.bytesFromIPv4(t):t.indexOf(":")!==-1?nt.bytesFromIPv6(t):null};nt.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=nt.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1))}e.push(s)}if(r.length>0){var u=r[n];u.end-u.start>0&&(e.splice(u.start,u.end-u.start+1,""),u.start===0&&e.unshift(""),u.end===7&&e.push(""))}return e.join(":")};nt.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in nt&&!t.update)return e(null,nt.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return nt.cores=navigator.hardwareConcurrency,e(null,nt.cores);if(typeof Worker>"u")return nt.cores=1,e(null,nt.cores);if(typeof Blob>"u")return nt.cores=2,e(null,nt.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(c){for(var l=Date.now(),u=l+4;Date.now()g.st&&f.stf.st&&g.st{p();var Rg=As();ac();QBn.exports=Rg.cipher=Rg.cipher||{};Rg.cipher.algorithms=Rg.cipher.algorithms||{};Rg.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Rg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Rg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};Rg.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Rg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Rg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};Rg.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),Rg.cipher.algorithms[t]=e};Rg.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in Rg.cipher.algorithms?Rg.cipher.algorithms[t]:null};var irr=Rg.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};irr.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=Rg.util.createBuffer(),this.output=t.output||Rg.util.createBuffer(),this.mode.start(e)};irr.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};irr.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var srr=I((_nf,qBn)=>{p();var kg=As();ac();kg.cipher=kg.cipher||{};var Xs=qBn.exports=kg.cipher.modes=kg.cipher.modes||{};Xs.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Xs.ecb.prototype.start=function(t){};Xs.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};Xs.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Xs.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=Dit(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};Xs.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};Xs.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=kg.util.createBuffer(),this._partialBytes=0};Xs.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Dit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Xs.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Xs.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=kg.util.createBuffer(),this._partialBytes=0};Xs.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Dit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Xs.ofb.prototype.decrypt=Xs.ofb.prototype.encrypt;Xs.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=kg.util.createBuffer(),this._partialBytes=0};Xs.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=Dit(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}Nit(this._inBlock)};Xs.ctr.prototype.decrypt=Xs.ctr.prototype.encrypt;Xs.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=kg.util.createBuffer(),this._partialBytes=0,this._R=3774873600};Xs.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=kg.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=kg.util.createBuffer(t.additionalData):r=kg.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=kg.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(orr(n*8)))}this._inBlock=this._j0.slice(0),Nit(this._inBlock),this._partialBytes=0,r=kg.util.createBuffer(r),this._aDataLength=orr(r.length()*8);var o=r.length()%this.blockSize;for(o&&r.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};Xs.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),Nit(this._inBlock)};Xs.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Nit(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var o=0;o0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};Xs.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,o=t[n]>>>(7-r%8)*4&15,s=this._m[r][o];e[0]^=s[0],e[1]^=s[1],e[2]^=s[2],e[3]^=s[3]}return e};Xs.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};Xs.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,o=16*r,s=new Array(o),c=0;c>>1,o=new Array(r);o[n]=t.slice(0);for(var s=n>>>1;s>0;)this.pow(o[2*s],o[s]=[]),s>>=1;for(s=2;s4){var r=t;t=kg.util.createBuffer();for(var n=0;n{p();var Iu=As();Pit();srr();ac();$Bn.exports=Iu.aes=Iu.aes||{};Iu.aes.startEncrypting=function(t,e,r,n){var o=Mit({key:t,output:r,decrypt:!1,mode:n});return o.start(e),o};Iu.aes.createEncryptionCipher=function(t,e){return Mit({key:t,output:null,decrypt:!1,mode:e})};Iu.aes.startDecrypting=function(t,e,r,n){var o=Mit({key:t,output:r,decrypt:!0,mode:n});return o.start(e),o};Iu.aes.createDecryptionCipher=function(t,e){return Mit({key:t,output:null,decrypt:!0,mode:e})};Iu.aes.Algorithm=function(t,e){lrr||HBn();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:a(function(n,o){return crr(r._w,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return crr(r._w,n,o,!0)},"decrypt")}}),r._init=!1};Iu.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=Iu.util.createBuffer(e);else if(Iu.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=Iu.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^l&255^99,ov[r]=l,arr[l]=r,u=t[l],o=t[r],s=t[o],c=t[s],d=u<<24^l<<16^l<<8^(l^u),f=(o^s^c)<<24^(r^c)<<16^(r^s^c)<<8^(r^o^c);for(var h=0;h<4;++h)lZ[h][r]=d,_2[h][l]=f,d=d<<24|d>>>8,f=f<<24|f>>>8;r===0?r=n=1:(r=o^t[t[t[o^c]]],n^=t[t[n]])}}a(HBn,"initialize");function GBn(t,e){for(var r=t.slice(0),n,o=1,s=r.length,c=s+6+1,l=Ufe*c,u=s;u>>16&255]<<24^ov[n>>>8&255]<<16^ov[n&255]<<8^ov[n>>>24]^jBn[o]<<24,o++):s>6&&u%s===4&&(n=ov[n>>>24]<<24^ov[n>>>16&255]<<16^ov[n>>>8&255]<<8^ov[n&255]),r[u]=r[u-s]^n;if(e){var d,f=_2[0],h=_2[1],m=_2[2],g=_2[3],A=r.slice(0);l=r.length;for(var u=0,y=l-Ufe;u>>24]]^h[ov[d>>>16&255]]^m[ov[d>>>8&255]]^g[ov[d&255]];r=A}return r}a(GBn,"_expandKey");function crr(t,e,r,n){var o=t.length/4-1,s,c,l,u,d;n?(s=_2[0],c=_2[1],l=_2[2],u=_2[3],d=arr):(s=lZ[0],c=lZ[1],l=lZ[2],u=lZ[3],d=ov);var f,h,m,g,A,y,E;f=e[0]^t[0],h=e[n?3:1]^t[1],m=e[2]^t[2],g=e[n?1:3]^t[3];for(var _=3,v=1;v>>24]^c[h>>>16&255]^l[m>>>8&255]^u[g&255]^t[++_],y=s[h>>>24]^c[m>>>16&255]^l[g>>>8&255]^u[f&255]^t[++_],E=s[m>>>24]^c[g>>>16&255]^l[f>>>8&255]^u[h&255]^t[++_],g=s[g>>>24]^c[f>>>16&255]^l[h>>>8&255]^u[m&255]^t[++_],f=A,h=y,m=E;r[0]=d[f>>>24]<<24^d[h>>>16&255]<<16^d[m>>>8&255]<<8^d[g&255]^t[++_],r[n?3:1]=d[h>>>24]<<24^d[m>>>16&255]<<16^d[g>>>8&255]<<8^d[f&255]^t[++_],r[2]=d[m>>>24]<<24^d[g>>>16&255]<<16^d[f>>>8&255]<<8^d[h&255]^t[++_],r[n?1:3]=d[g>>>24]<<24^d[f>>>16&255]<<16^d[h>>>8&255]<<8^d[m&255]^t[++_]}a(crr,"_updateBlock");function Mit(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=Iu.cipher.createDecipher(r,t.key):n=Iu.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof Iu.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(Mit,"_createCipher")});var Ij=I((Inf,VBn)=>{p();var Kke=As();Kke.pki=Kke.pki||{};var urr=VBn.exports=Kke.pki.oids=Kke.oids=Kke.oids||{};function ir(t,e){urr[t]=e,urr[e]=t}a(ir,"_IN");function Uc(t,e){urr[t]=e}a(Uc,"_I_");ir("1.2.840.113549.1.1.1","rsaEncryption");ir("1.2.840.113549.1.1.4","md5WithRSAEncryption");ir("1.2.840.113549.1.1.5","sha1WithRSAEncryption");ir("1.2.840.113549.1.1.7","RSAES-OAEP");ir("1.2.840.113549.1.1.8","mgf1");ir("1.2.840.113549.1.1.9","pSpecified");ir("1.2.840.113549.1.1.10","RSASSA-PSS");ir("1.2.840.113549.1.1.11","sha256WithRSAEncryption");ir("1.2.840.113549.1.1.12","sha384WithRSAEncryption");ir("1.2.840.113549.1.1.13","sha512WithRSAEncryption");ir("1.3.101.112","EdDSA25519");ir("1.2.840.10040.4.3","dsa-with-sha1");ir("1.3.14.3.2.7","desCBC");ir("1.3.14.3.2.26","sha1");ir("1.3.14.3.2.29","sha1WithRSASignature");ir("2.16.840.1.101.3.4.2.1","sha256");ir("2.16.840.1.101.3.4.2.2","sha384");ir("2.16.840.1.101.3.4.2.3","sha512");ir("2.16.840.1.101.3.4.2.4","sha224");ir("2.16.840.1.101.3.4.2.5","sha512-224");ir("2.16.840.1.101.3.4.2.6","sha512-256");ir("1.2.840.113549.2.2","md2");ir("1.2.840.113549.2.5","md5");ir("1.2.840.113549.1.7.1","data");ir("1.2.840.113549.1.7.2","signedData");ir("1.2.840.113549.1.7.3","envelopedData");ir("1.2.840.113549.1.7.4","signedAndEnvelopedData");ir("1.2.840.113549.1.7.5","digestedData");ir("1.2.840.113549.1.7.6","encryptedData");ir("1.2.840.113549.1.9.1","emailAddress");ir("1.2.840.113549.1.9.2","unstructuredName");ir("1.2.840.113549.1.9.3","contentType");ir("1.2.840.113549.1.9.4","messageDigest");ir("1.2.840.113549.1.9.5","signingTime");ir("1.2.840.113549.1.9.6","counterSignature");ir("1.2.840.113549.1.9.7","challengePassword");ir("1.2.840.113549.1.9.8","unstructuredAddress");ir("1.2.840.113549.1.9.14","extensionRequest");ir("1.2.840.113549.1.9.20","friendlyName");ir("1.2.840.113549.1.9.21","localKeyId");ir("1.2.840.113549.1.9.22.1","x509Certificate");ir("1.2.840.113549.1.12.10.1.1","keyBag");ir("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");ir("1.2.840.113549.1.12.10.1.3","certBag");ir("1.2.840.113549.1.12.10.1.4","crlBag");ir("1.2.840.113549.1.12.10.1.5","secretBag");ir("1.2.840.113549.1.12.10.1.6","safeContentsBag");ir("1.2.840.113549.1.5.13","pkcs5PBES2");ir("1.2.840.113549.1.5.12","pkcs5PBKDF2");ir("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");ir("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");ir("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");ir("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");ir("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");ir("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");ir("1.2.840.113549.2.7","hmacWithSHA1");ir("1.2.840.113549.2.8","hmacWithSHA224");ir("1.2.840.113549.2.9","hmacWithSHA256");ir("1.2.840.113549.2.10","hmacWithSHA384");ir("1.2.840.113549.2.11","hmacWithSHA512");ir("1.2.840.113549.3.7","des-EDE3-CBC");ir("2.16.840.1.101.3.4.1.2","aes128-CBC");ir("2.16.840.1.101.3.4.1.22","aes192-CBC");ir("2.16.840.1.101.3.4.1.42","aes256-CBC");ir("2.5.4.3","commonName");ir("2.5.4.4","surname");ir("2.5.4.5","serialNumber");ir("2.5.4.6","countryName");ir("2.5.4.7","localityName");ir("2.5.4.8","stateOrProvinceName");ir("2.5.4.9","streetAddress");ir("2.5.4.10","organizationName");ir("2.5.4.11","organizationalUnitName");ir("2.5.4.12","title");ir("2.5.4.13","description");ir("2.5.4.15","businessCategory");ir("2.5.4.17","postalCode");ir("2.5.4.42","givenName");ir("2.5.4.65","pseudonym");ir("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");ir("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");ir("2.16.840.1.113730.1.1","nsCertType");ir("2.16.840.1.113730.1.13","nsComment");Uc("2.5.29.1","authorityKeyIdentifier");Uc("2.5.29.2","keyAttributes");Uc("2.5.29.3","certificatePolicies");Uc("2.5.29.4","keyUsageRestriction");Uc("2.5.29.5","policyMapping");Uc("2.5.29.6","subtreesConstraint");Uc("2.5.29.7","subjectAltName");Uc("2.5.29.8","issuerAltName");Uc("2.5.29.9","subjectDirectoryAttributes");Uc("2.5.29.10","basicConstraints");Uc("2.5.29.11","nameConstraints");Uc("2.5.29.12","policyConstraints");Uc("2.5.29.13","basicConstraints");ir("2.5.29.14","subjectKeyIdentifier");ir("2.5.29.15","keyUsage");Uc("2.5.29.16","privateKeyUsagePeriod");ir("2.5.29.17","subjectAltName");ir("2.5.29.18","issuerAltName");ir("2.5.29.19","basicConstraints");Uc("2.5.29.20","cRLNumber");Uc("2.5.29.21","cRLReason");Uc("2.5.29.22","expirationDate");Uc("2.5.29.23","instructionCode");Uc("2.5.29.24","invalidityDate");Uc("2.5.29.25","cRLDistributionPoints");Uc("2.5.29.26","issuingDistributionPoint");Uc("2.5.29.27","deltaCRLIndicator");Uc("2.5.29.28","issuingDistributionPoint");Uc("2.5.29.29","certificateIssuer");Uc("2.5.29.30","nameConstraints");ir("2.5.29.31","cRLDistributionPoints");ir("2.5.29.32","certificatePolicies");Uc("2.5.29.33","policyMappings");Uc("2.5.29.34","policyConstraints");ir("2.5.29.35","authorityKeyIdentifier");Uc("2.5.29.36","policyConstraints");ir("2.5.29.37","extKeyUsage");Uc("2.5.29.46","freshestCRL");Uc("2.5.29.54","inhibitAnyPolicy");ir("1.3.6.1.4.1.11129.2.4.2","timestampList");ir("1.3.6.1.5.5.7.1.1","authorityInfoAccess");ir("1.3.6.1.5.5.7.3.1","serverAuth");ir("1.3.6.1.5.5.7.3.2","clientAuth");ir("1.3.6.1.5.5.7.3.3","codeSigning");ir("1.3.6.1.5.5.7.3.4","emailProtection");ir("1.3.6.1.5.5.7.3.8","timeStamping")});var v2=I((Rnf,zBn)=>{p();var ad=As();ac();Ij();var rn=zBn.exports=ad.asn1=ad.asn1||{};rn.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};rn.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};rn.maxDepth=256;rn.create=function(t,e,r,n,o){if(ad.util.isArray(n)){for(var s=[],c=0;ce){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}a(Jke,"_checkBufferLength");var Yvs=a(function(t,e){var r=t.getByte();if(e--,r!==128){var n,o=r&128;if(!o)n=r;else{var s=r&127;Jke(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}},"_getValueLength");rn.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),"maxDepth"in e||(e.maxDepth=rn.maxDepth),typeof t=="string"&&(t=ad.util.createBuffer(t));var r=t.length(),n=Oit(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var o=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw o.byteCount=r,o.remaining=t.length(),o}return n};function Oit(t,e,r,n){if(r>=n.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var o;Jke(t,e,2);var s=t.getByte();e--;var c=s&192,l=s&31;o=t.length();var u=Yvs(t,e);if(e-=o-t.length(),u!==void 0&&u>e){if(n.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=t.length(),d.remaining=e,d.requested=u,d}u=e}var f,h,m=(s&32)===32;if(m)if(f=[],u===void 0)for(;;){if(Jke(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}o=t.length(),f.push(Oit(t,e,r+1,n)),e-=o-t.length()}else for(;u>0;)o=t.length(),f.push(Oit(t,u,r+1,n)),e-=o-t.length(),u-=o-t.length();if(f===void 0&&c===rn.Class.UNIVERSAL&&l===rn.Type.BITSTRING&&(h=t.bytes(u)),f===void 0&&n.decodeBitStrings&&c===rn.Class.UNIVERSAL&&l===rn.Type.BITSTRING&&u>1){var g=t.read,A=e,y=0;if(l===rn.Type.BITSTRING&&(Jke(t,e,1),y=t.getByte(),e--),y===0)try{o=t.length();var E={strict:!0,decodeBitStrings:!0},_=Oit(t,e,r+1,E),v=o-t.length();e-=v,l==rn.Type.BITSTRING&&v++;var b=_.tagClass;v===u&&(b===rn.Class.UNIVERSAL||b===rn.Class.CONTEXT_SPECIFIC)&&(f=[_])}catch{}f===void 0&&(t.read=g,e=A)}if(f===void 0){if(u===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");u=e}if(l===rn.Type.BMPSTRING)for(f="";u>0;u-=2)Jke(t,e,2),f+=String.fromCharCode(t.getInt16()),e-=2;else f=t.getBytes(u),e-=u}var T=h===void 0?null:{bitStringContents:h};return rn.create(c,l,m,f,T)}a(Oit,"_fromDer");rn.toDer=function(t){var e=ad.util.createBuffer(),r=t.tagClass|t.type,n=ad.util.createBuffer(),o=!1;if("bitStringContents"in t&&(o=!0,t.original&&(o=rn.equals(t,t.original))),o)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var s=0;s1&&(t.value.charCodeAt(0)===0&&(t.value.charCodeAt(1)&128)===0||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var c=n.length(),l="";do l+=String.fromCharCode(c&255),c=c>>>8;while(c>0);e.putByte(l.length|128);for(var s=l.length-1;s>=0;--s)e.putByte(l.charCodeAt(s))}return e.putBuffer(n),e};rn.oidToDer=function(t){var e=t.split("."),r=ad.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,o,s,c,l=2;l4294967295)throw new Error("OID value too large; max is 32-bits.");do c=s&127,s=s>>>7,n||(c|=128),o.push(c),n=!1;while(s>0);for(var u=o.length-1;u>=0;--u)r.putByte(o[u])}return r};rn.derToOid=function(t){var e;typeof t=="string"&&(t=ad.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;){if(n>70368744177663)throw new Error("OID value too large; max is 53-bits.");r=t.getByte(),n=n*128,r&128?n+=r&127:(e+="."+(n+r),n=0)}return e};rn.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,o=parseInt(t.substr(4,2),10),s=parseInt(t.substr(6,2),10),c=parseInt(t.substr(8,2),10),l=0;if(t.length>11){var u=t.charAt(10),d=10;u!=="+"&&u!=="-"&&(l=parseInt(t.substr(10,2),10),d+=2)}if(e.setUTCFullYear(r,n,o),e.setUTCHours(s,c,l,0),d&&(u=t.charAt(d),u==="+"||u==="-")){var f=parseInt(t.substr(d+1,2),10),h=parseInt(t.substr(d+4,2),10),m=f*60+h;m*=6e4,u==="+"?e.setTime(+e-m):e.setTime(+e+m)}return e};rn.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,o=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),c=parseInt(t.substr(10,2),10),l=parseInt(t.substr(12,2),10),u=0,d=0,f=!1;t.charAt(t.length-1)==="Z"&&(f=!0);var h=t.length-5,m=t.charAt(h);if(m==="+"||m==="-"){var g=parseInt(t.substr(h+1,2),10),A=parseInt(t.substr(h+4,2),10);d=g*60+A,d*=6e4,m==="+"&&(d*=-1),f=!0}return t.charAt(14)==="."&&(u=parseFloat(t.substr(14),10)*1e3),f?(e.setUTCFullYear(r,n,o),e.setUTCHours(s,c,l,u),e.setTime(+e+d)):(e.setFullYear(r,n,o),e.setHours(s,c,l,u)),e};rn.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};rn.derToInteger=function(t){typeof t=="string"&&(t=ad.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};rn.validate=function(t,e,r,n){var o=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(o=!0,e.value&&ad.util.isArray(e.value))for(var s=0,c=0;o&&c0&&(n+=` +`.trim())}};iLn.exports=nrr});var mit=I((vif,lLn)=>{"use strict";p();var sLn=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:qys}=_c(),jys=wfe();cLn()===void 0&&aLn(new jys);function aLn(t){if(!t||typeof t.dispatch!="function")throw new qys("Argument agent must implement Agent");Object.defineProperty(globalThis,sLn,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(aLn,"setGlobalDispatcher");function cLn(){return globalThis[sLn]}a(cLn,"getGlobalDispatcher");lLn.exports={setGlobalDispatcher:aLn,getGlobalDispatcher:cLn}});var git=I((Tif,uLn)=>{"use strict";p();uLn.exports=class{static{a(this,"DecoratorHandler")}#e;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=e}onConnect(...e){return this.#e.onConnect?.(...e)}onError(...e){return this.#e.onError?.(...e)}onUpgrade(...e){return this.#e.onUpgrade?.(...e)}onResponseStarted(...e){return this.#e.onResponseStarted?.(...e)}onHeaders(...e){return this.#e.onHeaders?.(...e)}onData(...e){return this.#e.onData?.(...e)}onComplete(...e){return this.#e.onComplete?.(...e)}onBodySent(...e){return this.#e.onBodySent?.(...e)}}});var fLn=I((wif,dLn)=>{"use strict";p();var Hys=znt();dLn.exports=t=>{let e=t?.maxRedirections;return r=>a(function(o,s){let{maxRedirections:c=e,...l}=o;if(!c)return r(o,s);let u=new Hys(r,c,o,s);return r(l,u)},"redirectInterceptor")}});var hLn=I((Pif,pLn)=>{"use strict";p();var Gys=oit();pLn.exports=t=>e=>a(function(n,o){return e(n,new Gys({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var gLn=I((Mif,mLn)=>{"use strict";p();var $ys=js(),{InvalidArgumentError:Vys,RequestAbortedError:Wys}=_c(),zys=git(),irr=class extends zys{static{a(this,"DumpHandler")}#e=1024*1024;#t=null;#r=!1;#n=!1;#i=0;#o=null;#s=null;constructor({maxSize:e},r){if(super(r),e!=null&&(!Number.isFinite(e)||e<1))throw new Vys("maxSize must be a number greater than 0");this.#e=e??this.#e,this.#s=r}onConnect(e){this.#t=e,this.#s.onConnect(this.#a.bind(this))}#a(e){this.#n=!0,this.#o=e}onHeaders(e,r,n,o){let c=$ys.parseHeaders(r)["content-length"];if(c!=null&&c>this.#e)throw new Wys(`Response size (${c}) larger than maxSize (${this.#e})`);return this.#n?!0:this.#s.onHeaders(e,r,n,o)}onError(e){this.#r||(e=this.#o??e,this.#s.onError(e))}onData(e){return this.#i=this.#i+e.length,this.#i>=this.#e&&(this.#r=!0,this.#n?this.#s.onError(this.#o):this.#s.onComplete([])),!0}onComplete(e){if(!this.#r){if(this.#n){this.#s.onError(this.reason);return}this.#s.onComplete(e)}}};function Yys({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new irr({maxSize:s},o);return e(n,c)},"Intercept")}a(Yys,"createDumpInterceptor");mLn.exports=Yys});var ELn=I((Bif,yLn)=>{"use strict";p();var{isIP:Kys}=require("node:net"),{lookup:Jys}=require("node:dns"),Zys=git(),{InvalidArgumentError:Ffe,InformationalError:Xys}=_c(),ALn=Math.pow(2,31)-1,orr=class{static{a(this,"DNSInstance")}#e=0;#t=0;#r=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#n,this.pick=e.pick??this.#i}get full(){return this.#r.size===this.#t}runLookup(e,r,n){let o=this.#r.get(e.hostname);if(o==null&&this.full){n(null,e.origin);return}let s={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...r.dns,maxTTL:this.#e,maxItems:this.#t};if(o==null)this.lookup(e,s,(c,l)=>{if(c||l==null||l.length===0){n(c??new Xys("No DNS entries found"));return}this.setRecords(e,l);let u=this.#r.get(e.hostname),d=this.pick(e,u,s.affinity),f;typeof d.port=="number"?f=`:${d.port}`:e.port!==""?f=`:${e.port}`:f="",n(null,`${e.protocol}//${d.family===6?`[${d.address}]`:d.address}${f}`)});else{let c=this.pick(e,o,s.affinity);if(c==null){this.#r.delete(e.hostname),this.runLookup(e,r,n);return}let l;typeof c.port=="number"?l=`:${c.port}`:e.port!==""?l=`:${e.port}`:l="",n(null,`${e.protocol}//${c.family===6?`[${c.address}]`:c.address}${l}`)}}#n(e,r,n){Jys(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(o,s)=>{if(o)return n(o);let c=new Map;for(let l of s)c.set(`${l.address}:${l.family}`,l);n(null,c.values())})}#i(e,r,n){let o=null,{records:s,offset:c}=r,l;if(this.dualStack?(n==null&&(c==null||c===ALn?(r.offset=0,n=4):(r.offset++,n=(r.offset&1)===1?6:4)),s[n]!=null&&s[n].ips.length>0?l=s[n]:l=s[n===4?6:4]):l=s[n],l==null||l.ips.length===0)return o;l.offset==null||l.offset===ALn?l.offset=0:l.offset++;let u=l.offset%l.ips.length;return o=l.ips[u]??null,o==null?o:Date.now()-o.timestamp>o.ttl?(l.ips.splice(u,1),this.pick(e,r,n)):o}setRecords(e,r){let n=Date.now(),o={records:{4:null,6:null}};for(let s of r){s.timestamp=n,typeof s.ttl=="number"?s.ttl=Math.min(s.ttl,this.#e):s.ttl=this.#e;let c=o.records[s.family]??{ips:[]};c.ips.push(s),o.records[s.family]=c}this.#r.set(e.hostname,o)}getHandler(e,r){return new srr(this,e,r)}},srr=class extends Zys{static{a(this,"DNSDispatchHandler")}#e=null;#t=null;#r=null;#n=null;#i=null;constructor(e,{origin:r,handler:n,dispatch:o},s){super(n),this.#i=r,this.#n=n,this.#t={...s},this.#e=e,this.#r=o}onError(e){switch(e.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){this.#e.runLookup(this.#i,this.#t,(r,n)=>{if(r)return this.#n.onError(r);let o={...this.#t,origin:n};this.#r(o,this)});return}this.#n.onError(e);return}case"ENOTFOUND":this.#e.deleteRecord(this.#i);default:this.#n.onError(e);break}}};yLn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new Ffe("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new Ffe("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new Ffe("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new Ffe("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new Ffe("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new Ffe("Invalid pick. Must be a function");let e=t?.dualStack??!0,r;e?r=t?.affinity??null:r=t?.affinity??4;let n={maxTTL:t?.maxTTL??1e4,lookup:t?.lookup??null,pick:t?.pick??null,dualStack:e,affinity:r,maxItems:t?.maxItems??1/0},o=new orr(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return Kys(d.hostname)!==0?s(l,u):(o.runLookup(d,l,(f,h)=>{if(f)return u.onError(f);let m=null;m={...l,servername:d.hostname,origin:h,headers:{host:d.hostname,...l.headers}},s(m,o.getHandler({origin:d,dispatch:s,handler:u},l))}),!0)},"dnsInterceptor")}});var dZ=I((Qif,ILn)=>{"use strict";p();var{kConstruct:eEs}=Wd(),{kEnumerableProperty:Ufe}=js(),{iteratorMixin:tEs,isValidHeaderName:Yke,isValidHeaderValue:vLn}=pT(),{webidl:za}=GA(),arr=require("node:assert"),Ait=require("node:util"),dm=Symbol("headers map"),gT=Symbol("headers map sorted");function _Ln(t){return t===10||t===13||t===9||t===32}a(_Ln,"isHTTPWhiteSpaceCharCode");function CLn(t){let e=0,r=t.length;for(;r>e&&_Ln(t.charCodeAt(r-1));)--r;for(;r>e&&_Ln(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(CLn,"headerValueNormalize");function bLn(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(bLn,"fill");function crr(t,e,r){if(r=CLn(r),Yke(e)){if(!vLn(r))throw za.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw za.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(TLn(t)==="immutable")throw new TypeError("immutable");return lrr(t).append(e,r,!1)}a(crr,"appendHeader");function SLn(t,e){return t[0]>1),r[d][0]<=f[0]?u=d+1:l=d;if(s!==d){for(c=s;c>u;)r[c]=r[--c];r[u]=f}}if(!n.next().done)throw new TypeError("Unreachable");return r}else{let n=0;for(let{0:o,1:{value:s}}of this[dm])r[n++]=[o,s],arr(s!==null);return r.sort(SLn)}}},T2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){za.util.markAsUncloneable(this),e!==eEs&&(this.#t=new yit,this.#e="none",e!==void 0&&(e=za.converters.HeadersInit(e,"Headers contructor","init"),bLn(this,e)))}append(e,r){za.brandCheck(this,t),za.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=za.converters.ByteString(e,n,"name"),r=za.converters.ByteString(r,n,"value"),crr(this,e,r)}delete(e){if(za.brandCheck(this,t),za.argumentLengthCheck(arguments,1,"Headers.delete"),e=za.converters.ByteString(e,"Headers.delete","name"),!Yke(e))throw za.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){za.brandCheck(this,t),za.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=za.converters.ByteString(e,r,"name"),!Yke(e))throw za.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){za.brandCheck(this,t),za.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=za.converters.ByteString(e,r,"name"),!Yke(e))throw za.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){za.brandCheck(this,t),za.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=za.converters.ByteString(e,n,"name"),r=za.converters.ByteString(r,n,"value"),r=CLn(r),Yke(e)){if(!vLn(r))throw za.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw za.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){za.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}get[gT](){if(this.#t[gT])return this.#t[gT];let e=[],r=this.#t.toSortedArray(),n=this.#t.cookies;if(n===null||n.length===1)return this.#t[gT]=r;for(let o=0;o>"](t,e,r,n.bind(t)):za.converters["record"](t,e,r)}throw za.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};ILn.exports={fill:bLn,compareHeaderName:SLn,Headers:T2,HeadersList:yit,getHeadersGuard:TLn,setHeadersGuard:rEs,setHeadersList:nEs,getHeadersList:lrr}});var Jke=I((Hif,FLn)=>{"use strict";p();var{Headers:DLn,HeadersList:xLn,fill:iEs,getHeadersGuard:oEs,setHeadersGuard:NLn,setHeadersList:MLn}=dZ(),{extractBody:wLn,cloneBody:sEs,mixinBody:aEs,hasFinalizationRegistry:OLn,streamRegistry:LLn,bodyUnusable:cEs}=Efe(),urr=js(),RLn=require("node:util"),{kEnumerableProperty:AT}=urr,{isValidReasonPhrase:lEs,isCancelled:uEs,isAborted:dEs,isBlobLike:fEs,serializeJavascriptValueToJSONString:pEs,isErrorLike:hEs,isomorphicEncode:mEs,environmentSettingsObject:gEs}=pT(),{redirectStatusSet:AEs,nullBodyStatus:yEs}=_ke(),{kState:Yd,kHeaders:HF}=Ej(),{webidl:os}=GA(),{FormData:EEs}=Ike(),{URLSerializer:kLn}=sb(),{kConstruct:_it}=Wd(),drr=require("node:assert"),{types:_Es}=require("node:util"),vEs=new TextEncoder("utf-8"),fZ=class t{static{a(this,"Response")}static error(){return Kke(vit(),"immutable")}static json(e,r={}){os.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=os.converters.ResponseInit(r));let n=vEs.encode(pEs(e)),o=wLn(n),s=Kke(Qfe({}),"response");return PLn(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){os.argumentLengthCheck(arguments,1,"Response.redirect"),e=os.converters.USVString(e),r=os.converters["unsigned short"](r);let n;try{n=new URL(e,gEs.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!AEs.has(r))throw new RangeError(`Invalid status code ${r}`);let o=Kke(Qfe({}),"immutable");o[Yd].status=r;let s=mEs(kLn(n));return o[Yd].headersList.append("location",s,!0),o}constructor(e=null,r={}){if(os.util.markAsUncloneable(this),e===_it)return;e!==null&&(e=os.converters.BodyInit(e)),r=os.converters.ResponseInit(r),this[Yd]=Qfe({}),this[HF]=new DLn(_it),NLn(this[HF],"response"),MLn(this[HF],this[Yd].headersList);let n=null;if(e!=null){let[o,s]=wLn(e);n={body:o,type:s}}PLn(this,r,n)}get type(){return os.brandCheck(this,t),this[Yd].type}get url(){os.brandCheck(this,t);let e=this[Yd].urlList,r=e[e.length-1]??null;return r===null?"":kLn(r,!0)}get redirected(){return os.brandCheck(this,t),this[Yd].urlList.length>1}get status(){return os.brandCheck(this,t),this[Yd].status}get ok(){return os.brandCheck(this,t),this[Yd].status>=200&&this[Yd].status<=299}get statusText(){return os.brandCheck(this,t),this[Yd].statusText}get headers(){return os.brandCheck(this,t),this[HF]}get body(){return os.brandCheck(this,t),this[Yd].body?this[Yd].body.stream:null}get bodyUsed(){return os.brandCheck(this,t),!!this[Yd].body&&urr.isDisturbed(this[Yd].body.stream)}clone(){if(os.brandCheck(this,t),cEs(this))throw os.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=frr(this[Yd]);return OLn&&this[Yd].body?.stream&&LLn.register(this,new WeakRef(this[Yd].body.stream)),Kke(e,oEs(this[HF]))}[RLn.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${RLn.formatWithOptions(r,n)}`}};aEs(fZ);Object.defineProperties(fZ.prototype,{type:AT,url:AT,status:AT,ok:AT,redirected:AT,statusText:AT,headers:AT,clone:AT,body:AT,bodyUsed:AT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(fZ,{json:AT,redirect:AT,error:AT});function frr(t){if(t.internalResponse)return BLn(frr(t.internalResponse),t.type);let e=Qfe({...t,body:null});return t.body!=null&&(e.body=sEs(e,t.body)),e}a(frr,"cloneResponse");function Qfe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new xLn(t?.headersList):new xLn,urlList:t?.urlList?[...t.urlList]:[]}}a(Qfe,"makeResponse");function vit(t){let e=hEs(t);return Qfe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(vit,"makeNetworkError");function CEs(t){return t.type==="error"&&t.status===0}a(CEs,"isNetworkError");function Eit(t,e){return e={internalResponse:t,...e},new Proxy(t,{get(r,n){return n in e?e[n]:r[n]},set(r,n,o){return drr(!(n in e)),r[n]=o,!0}})}a(Eit,"makeFilteredResponse");function BLn(t,e){if(e==="basic")return Eit(t,{type:"basic",headersList:t.headersList});if(e==="cors")return Eit(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return Eit(t,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return Eit(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});drr(!1)}a(BLn,"filterResponse");function bEs(t,e=null){return drr(uEs(t)),dEs(t)?vit(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):vit(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(bEs,"makeAppropriateNetworkError");function PLn(t,e,r){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!lEs(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(t[Yd].status=e.status),"statusText"in e&&e.statusText!=null&&(t[Yd].statusText=e.statusText),"headers"in e&&e.headers!=null&&iEs(t[HF],e.headers),r){if(yEs.includes(t.status))throw os.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});t[Yd].body=r.body,r.type!=null&&!t[Yd].headersList.contains("content-type",!0)&&t[Yd].headersList.append("content-type",r.type,!0)}}a(PLn,"initializeResponse");function Kke(t,e){let r=new fZ(_it);return r[Yd]=t,r[HF]=new DLn(_it),MLn(r[HF],t.headersList),NLn(r[HF],e),OLn&&t.body?.stream&&LLn.register(r,new WeakRef(t.body.stream)),r}a(Kke,"fromInnerResponse");os.converters.ReadableStream=os.interfaceConverter(ReadableStream);os.converters.FormData=os.interfaceConverter(EEs);os.converters.URLSearchParams=os.interfaceConverter(URLSearchParams);os.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?os.converters.USVString(t,e,r):fEs(t)?os.converters.Blob(t,e,r,{strict:!1}):ArrayBuffer.isView(t)||_Es.isArrayBuffer(t)?os.converters.BufferSource(t,e,r):urr.isFormDataLike(t)?os.converters.FormData(t,e,r,{strict:!1}):t instanceof URLSearchParams?os.converters.URLSearchParams(t,e,r):os.converters.DOMString(t,e,r)};os.converters.BodyInit=function(t,e,r){return t instanceof ReadableStream?os.converters.ReadableStream(t,e,r):t?.[Symbol.asyncIterator]?t:os.converters.XMLHttpRequestBodyInit(t,e,r)};os.converters.ResponseInit=os.dictionaryConverter([{key:"status",converter:os.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:os.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:os.converters.HeadersInit}]);FLn.exports={isNetworkError:CEs,makeNetworkError:vit,makeResponse:Qfe,makeAppropriateNetworkError:bEs,filterResponse:BLn,Response:fZ,cloneResponse:frr,fromInnerResponse:Kke}});var jLn=I((Vif,qLn)=>{"use strict";p();var{kConnected:ULn,kSize:QLn}=Wd(),prr=class{static{a(this,"CompatWeakRef")}constructor(e){this.value=e}deref(){return this.value[ULn]===0&&this.value[QLn]===0?void 0:this.value}},hrr=class{static{a(this,"CompatFinalizer")}constructor(e){this.finalizer=e}register(e,r){e.on&&e.on("disconnect",()=>{e[ULn]===0&&e[QLn]===0&&this.finalizer(r)})}unregister(e){}};qLn.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith("v18")?(process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"),{WeakRef:prr,FinalizationRegistry:hrr}):{WeakRef,FinalizationRegistry}}});var qfe=I((Yif,nBn)=>{"use strict";p();var{extractBody:SEs,mixinBody:TEs,cloneBody:IEs,bodyUnusable:HLn}=Efe(),{Headers:ZLn,fill:xEs,HeadersList:Tit,setHeadersGuard:grr,getHeadersGuard:wEs,setHeadersList:XLn,getHeadersList:GLn}=dZ(),{FinalizationRegistry:REs}=jLn()(),bit=js(),$Ln=require("node:util"),{isValidHTTPToken:kEs,sameOrigin:VLn,environmentSettingsObject:Cit}=pT(),{forbiddenMethodsSet:PEs,corsSafeListedMethodsSet:DEs,referrerPolicy:NEs,requestRedirect:MEs,requestMode:OEs,requestCredentials:LEs,requestCache:BEs,requestDuplex:FEs}=_ke(),{kEnumerableProperty:fm,normalizedMethodRecordsBase:UEs,normalizedMethodRecords:QEs}=bit,{kHeaders:yT,kSignal:Sit,kState:ud,kDispatcher:mrr}=Ej(),{webidl:Hi}=GA(),{URLSerializer:qEs}=sb(),{kConstruct:Iit}=Wd(),jEs=require("node:assert"),{getMaxListeners:WLn,setMaxListeners:zLn,getEventListeners:HEs,defaultMaxListeners:YLn}=require("node:events"),GEs=Symbol("abortController"),eBn=new REs(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),xit=new WeakMap;function KLn(t){return e;function e(){let r=t.deref();if(r!==void 0){eBn.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=xit.get(r.signal);if(n!==void 0){if(n.size!==0){for(let o of n){let s=o.deref();s!==void 0&&s.abort(this.reason)}n.clear()}xit.delete(r.signal)}}}}a(KLn,"buildAbort");var JLn=!1,Pj=class t{static{a(this,"Request")}constructor(e,r={}){if(Hi.util.markAsUncloneable(this),e===Iit)return;let n="Request constructor";Hi.argumentLengthCheck(arguments,1,n),e=Hi.converters.RequestInfo(e,n,"input"),r=Hi.converters.RequestInit(r,n,"init");let o=null,s=null,c=Cit.settingsObject.baseUrl,l=null;if(typeof e=="string"){this[mrr]=r.dispatcher;let _;try{_=new URL(e,c)}catch(v){throw new TypeError("Failed to parse URL from "+e,{cause:v})}if(_.username||_.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);o=wit({urlList:[_]}),s="cors"}else this[mrr]=r.dispatcher||e[mrr],jEs(e instanceof t),o=e[ud],l=e[Sit];let u=Cit.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&VLn(o.window,u)&&(d=o.window),r.window!=null)throw new TypeError(`'window' option '${d}' must be null`);"window"in r&&(d="no-window"),o=wit({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:Cit.settingsObject,window:d,priority:o.priority,origin:o.origin,referrer:o.referrer,referrerPolicy:o.referrerPolicy,mode:o.mode,credentials:o.credentials,cache:o.cache,redirect:o.redirect,integrity:o.integrity,keepalive:o.keepalive,reloadNavigation:o.reloadNavigation,historyNavigation:o.historyNavigation,urlList:[...o.urlList]});let f=Object.keys(r).length!==0;if(f&&(o.mode==="navigate"&&(o.mode="same-origin"),o.reloadNavigation=!1,o.historyNavigation=!1,o.origin="client",o.referrer="client",o.referrerPolicy="",o.url=o.urlList[o.urlList.length-1],o.urlList=[o.url]),r.referrer!==void 0){let _=r.referrer;if(_==="")o.referrer="no-referrer";else{let v;try{v=new URL(_,c)}catch(b){throw new TypeError(`Referrer "${_}" is not a valid URL.`,{cause:b})}v.protocol==="about:"&&v.hostname==="client"||u&&!VLn(v,Cit.settingsObject.baseUrl)?o.referrer="client":o.referrer=v}}r.referrerPolicy!==void 0&&(o.referrerPolicy=r.referrerPolicy);let h;if(r.mode!==void 0?h=r.mode:h=s,h==="navigate")throw Hi.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(h!=null&&(o.mode=h),r.credentials!==void 0&&(o.credentials=r.credentials),r.cache!==void 0&&(o.cache=r.cache),o.cache==="only-if-cached"&&o.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(r.redirect!==void 0&&(o.redirect=r.redirect),r.integrity!=null&&(o.integrity=String(r.integrity)),r.keepalive!==void 0&&(o.keepalive=!!r.keepalive),r.method!==void 0){let _=r.method,v=QEs[_];if(v!==void 0)o.method=v;else{if(!kEs(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(PEs.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=UEs[b]??_,o.method=_}!JLn&&o.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),JLn=!0)}r.signal!==void 0&&(l=r.signal),this[ud]=o;let m=new AbortController;if(this[Sit]=m.signal,l!=null){if(!l||typeof l.aborted!="boolean"||typeof l.addEventListener!="function")throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.");if(l.aborted)m.abort(l.reason);else{this[GEs]=m;let _=new WeakRef(m),v=KLn(_);try{(typeof WLn=="function"&&WLn(l)===YLn||HEs(l,"abort").length>=YLn)&&zLn(1500,l)}catch{}bit.addAbortListener(l,v),eBn.register(m,{signal:l,abort:v},v)}}if(this[yT]=new ZLn(Iit),XLn(this[yT],o.headersList),grr(this[yT],"request"),h==="no-cors"){if(!DEs.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);grr(this[yT],"request-no-cors")}if(f){let _=GLn(this[yT]),v=r.headers!==void 0?r.headers:new Tit(_);if(_.clear(),v instanceof Tit){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else xEs(this[yT],v)}let g=e instanceof t?e[ud].body:null;if((r.body!=null||g!=null)&&(o.method==="GET"||o.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let A=null;if(r.body!=null){let[_,v]=SEs(r.body,o.keepalive);A=_,v&&!GLn(this[yT]).contains("content-type",!0)&&this[yT].append("content-type",v)}let y=A??g;if(y!=null&&y.source==null){if(A!=null&&r.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(o.mode!=="same-origin"&&o.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');o.useCORSPreflightFlag=!0}let E=y;if(A==null&&g!=null){if(HLn(e))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let _=new TransformStream;g.stream.pipeThrough(_),E={source:g.source,length:g.length,stream:_.readable}}this[ud].body=E}get method(){return Hi.brandCheck(this,t),this[ud].method}get url(){return Hi.brandCheck(this,t),qEs(this[ud].url)}get headers(){return Hi.brandCheck(this,t),this[yT]}get destination(){return Hi.brandCheck(this,t),this[ud].destination}get referrer(){return Hi.brandCheck(this,t),this[ud].referrer==="no-referrer"?"":this[ud].referrer==="client"?"about:client":this[ud].referrer.toString()}get referrerPolicy(){return Hi.brandCheck(this,t),this[ud].referrerPolicy}get mode(){return Hi.brandCheck(this,t),this[ud].mode}get credentials(){return this[ud].credentials}get cache(){return Hi.brandCheck(this,t),this[ud].cache}get redirect(){return Hi.brandCheck(this,t),this[ud].redirect}get integrity(){return Hi.brandCheck(this,t),this[ud].integrity}get keepalive(){return Hi.brandCheck(this,t),this[ud].keepalive}get isReloadNavigation(){return Hi.brandCheck(this,t),this[ud].reloadNavigation}get isHistoryNavigation(){return Hi.brandCheck(this,t),this[ud].historyNavigation}get signal(){return Hi.brandCheck(this,t),this[Sit]}get body(){return Hi.brandCheck(this,t),this[ud].body?this[ud].body.stream:null}get bodyUsed(){return Hi.brandCheck(this,t),!!this[ud].body&&bit.isDisturbed(this[ud].body.stream)}get duplex(){return Hi.brandCheck(this,t),"half"}clone(){if(Hi.brandCheck(this,t),HLn(this))throw new TypeError("unusable");let e=tBn(this[ud]),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=xit.get(this.signal);n===void 0&&(n=new Set,xit.set(this.signal,n));let o=new WeakRef(r);n.add(o),bit.addAbortListener(r.signal,KLn(o))}return rBn(e,r.signal,wEs(this[yT]))}[$Ln.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${$Ln.formatWithOptions(r,n)}`}};TEs(Pj);function wit(t){return{method:t.method??"GET",localURLsOnly:t.localURLsOnly??!1,unsafeRequest:t.unsafeRequest??!1,body:t.body??null,client:t.client??null,reservedClient:t.reservedClient??null,replacesClientId:t.replacesClientId??"",window:t.window??"client",keepalive:t.keepalive??!1,serviceWorkers:t.serviceWorkers??"all",initiator:t.initiator??"",destination:t.destination??"",priority:t.priority??null,origin:t.origin??"client",policyContainer:t.policyContainer??"client",referrer:t.referrer??"client",referrerPolicy:t.referrerPolicy??"",mode:t.mode??"no-cors",useCORSPreflightFlag:t.useCORSPreflightFlag??!1,credentials:t.credentials??"same-origin",useCredentials:t.useCredentials??!1,cache:t.cache??"default",redirect:t.redirect??"follow",integrity:t.integrity??"",cryptoGraphicsNonceMetadata:t.cryptoGraphicsNonceMetadata??"",parserMetadata:t.parserMetadata??"",reloadNavigation:t.reloadNavigation??!1,historyNavigation:t.historyNavigation??!1,userActivation:t.userActivation??!1,taintedOrigin:t.taintedOrigin??!1,redirectCount:t.redirectCount??0,responseTainting:t.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:t.preventNoCacheCacheControlHeaderModification??!1,done:t.done??!1,timingAllowFailed:t.timingAllowFailed??!1,urlList:t.urlList,url:t.urlList[0],headersList:t.headersList?new Tit(t.headersList):new Tit}}a(wit,"makeRequest");function tBn(t){let e=wit({...t,body:null});return t.body!=null&&(e.body=IEs(e,t.body)),e}a(tBn,"cloneRequest");function rBn(t,e,r){let n=new Pj(Iit);return n[ud]=t,n[Sit]=e,n[yT]=new ZLn(Iit),XLn(n[yT],t.headersList),grr(n[yT],r),n}a(rBn,"fromInnerRequest");Object.defineProperties(Pj.prototype,{method:fm,url:fm,headers:fm,redirect:fm,clone:fm,signal:fm,duplex:fm,destination:fm,body:fm,bodyUsed:fm,isHistoryNavigation:fm,isReloadNavigation:fm,keepalive:fm,integrity:fm,cache:fm,credentials:fm,attribute:fm,referrerPolicy:fm,referrer:fm,mode:fm,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Hi.converters.Request=Hi.interfaceConverter(Pj);Hi.converters.RequestInfo=function(t,e,r){return typeof t=="string"?Hi.converters.USVString(t,e,r):t instanceof Pj?Hi.converters.Request(t,e,r):Hi.converters.USVString(t,e,r)};Hi.converters.AbortSignal=Hi.interfaceConverter(AbortSignal);Hi.converters.RequestInit=Hi.dictionaryConverter([{key:"method",converter:Hi.converters.ByteString},{key:"headers",converter:Hi.converters.HeadersInit},{key:"body",converter:Hi.nullableConverter(Hi.converters.BodyInit)},{key:"referrer",converter:Hi.converters.USVString},{key:"referrerPolicy",converter:Hi.converters.DOMString,allowedValues:NEs},{key:"mode",converter:Hi.converters.DOMString,allowedValues:OEs},{key:"credentials",converter:Hi.converters.DOMString,allowedValues:LEs},{key:"cache",converter:Hi.converters.DOMString,allowedValues:BEs},{key:"redirect",converter:Hi.converters.DOMString,allowedValues:MEs},{key:"integrity",converter:Hi.converters.DOMString},{key:"keepalive",converter:Hi.converters.boolean},{key:"signal",converter:Hi.nullableConverter(t=>Hi.converters.AbortSignal(t,"RequestInit","signal",{strict:!1}))},{key:"window",converter:Hi.converters.any},{key:"duplex",converter:Hi.converters.DOMString,allowedValues:FEs},{key:"dispatcher",converter:Hi.converters.any}]);nBn.exports={Request:Pj,makeRequest:wit,fromInnerRequest:rBn,cloneRequest:tBn}});var Xke=I((Zif,yBn)=>{"use strict";p();var{makeNetworkError:sl,makeAppropriateNetworkError:Rit,filterResponse:Arr,makeResponse:kit,fromInnerResponse:$Es}=Jke(),{HeadersList:iBn}=dZ(),{Request:VEs,cloneRequest:WEs}=qfe(),Dj=require("node:zlib"),{bytesMatch:zEs,makePolicyContainer:YEs,clonePolicyContainer:KEs,requestBadPort:JEs,TAOCheck:ZEs,appendRequestOriginHeader:XEs,responseLocationURL:e_s,requestCurrentURL:S5,setRequestReferrerPolicyOnRedirect:t_s,tryUpgradeRequestToAPotentiallyTrustworthyURL:r_s,createOpaqueTimingInfo:Crr,appendFetchMetadata:n_s,corsCheck:i_s,crossOriginResourcePolicyCheck:o_s,determineRequestsReferrer:s_s,coarsenedSharedCurrentTime:Zke,createDeferredPromise:a_s,isBlobLike:c_s,sameOrigin:vrr,isCancelled:pZ,isAborted:oBn,isErrorLike:l_s,fullyReadBody:u_s,readableStreamClose:d_s,isomorphicEncode:Pit,urlIsLocal:f_s,urlIsHttpHttpsScheme:brr,urlHasHttpsScheme:p_s,clampAndCoarsenConnectionTimingInfo:h_s,simpleRangeHeaderValue:m_s,buildContentRange:g_s,createInflate:A_s,extractMimeType:y_s}=pT(),{kState:lBn,kDispatcher:E_s}=Ej(),hZ=require("node:assert"),{safelyExtractBody:Srr,extractBody:sBn}=Efe(),{redirectStatusSet:uBn,nullBodyStatus:dBn,safeMethodsSet:__s,requestBodyHeader:v_s,subresourceSet:C_s}=_ke(),b_s=require("node:events"),{Readable:S_s,pipeline:T_s,finished:I_s}=require("node:stream"),{addAbortListener:x_s,isErrored:w_s,isReadable:Dit,bufferToLowerCasedHeaderName:aBn}=js(),{dataURLProcessor:R_s,serializeAMimeType:k_s,minimizeSupportedMimeType:P_s}=sb(),{getGlobalDispatcher:D_s}=mit(),{webidl:N_s}=GA(),{STATUS_CODES:M_s}=require("node:http"),O_s=["GET","HEAD"],L_s=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",yrr,Nit=class extends b_s{static{a(this,"Fetch")}constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function B_s(t){fBn(t,"fetch")}a(B_s,"handleFetchDone");function F_s(t,e=void 0){N_s.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=a_s(),n;try{n=new VEs(t,e)}catch(f){return r.reject(f),r.promise}let o=n[lBn];if(n.signal.aborted)return Err(r,o,null,n.signal.reason),r.promise;o.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(o.serviceWorkers="none");let c=null,l=!1,u=null;return x_s(n.signal,()=>{l=!0,hZ(u!=null),u.abort(n.signal.reason);let f=c?.deref();Err(r,o,f,n.signal.reason)}),u=hBn({request:o,processResponseEndOfBody:B_s,processResponse:a(f=>{if(!l){if(f.aborted){Err(r,o,c,u.serializedAbortReason);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef($Es(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:n[E_s]}),r.promise}a(F_s,"fetch");function fBn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;brr(r)&&n!==null&&(t.timingAllowPassed||(n=Crr({startTime:n.startTime}),o=""),n.endTime=Zke(),t.timingInfo=n,pBn(n,r.href,e,globalThis,o))}a(fBn,"finalizeAndReportTiming");var pBn=performance.markResourceTiming;function Err(t,e,r,n){if(t&&t.reject(n),e.body!=null&&Dit(e.body?.stream)&&e.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s}),r==null)return;let o=r[lBn];o.body!=null&&Dit(o.body?.stream)&&o.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s})}a(Err,"abortFetch");function hBn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=D_s()}){hZ(l);let u=null,d=!1;t.client!=null&&(u=t.client.globalObject,d=t.client.crossOriginIsolatedCapability);let f=Zke(d),h=Crr({startTime:f}),m={controller:new Nit(l),request:t,timingInfo:h,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:u,crossOriginIsolatedCapability:d};return hZ(!t.body||t.body.stream),t.window==="client"&&(t.window=t.client?.globalObject?.constructor?.name==="Window"?t.client:"no-window"),t.origin==="client"&&(t.origin=t.client.origin),t.policyContainer==="client"&&(t.client!=null?t.policyContainer=KEs(t.client.policyContainer):t.policyContainer=YEs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,C_s.has(t.destination),mBn(m).catch(g=>{m.controller.terminate(g)}),m.controller}a(hBn,"fetching");async function mBn(t,e=!1){let r=t.request,n=null;if(r.localURLsOnly&&!f_s(S5(r))&&(n=sl("local URLs only")),r_s(r),JEs(r)==="blocked"&&(n=sl("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=s_s(r)),n===null&&(n=await(async()=>{let s=S5(r);return vrr(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",await cBn(t)):r.mode==="same-origin"?sl('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?sl('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",await cBn(t)):brr(S5(r))?(r.responseTainting="cors",await gBn(t)):sl("URL scheme must be a HTTP(S) scheme")})()),e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=Arr(n,"basic"):r.responseTainting==="cors"?n=Arr(n,"cors"):r.responseTainting==="opaque"?n=Arr(n,"opaque"):hZ(!1));let o=n.status===0?n:n.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(n.timingAllowPassed=!0),n.type==="opaque"&&o.status===206&&o.rangeRequested&&!r.headers.contains("range",!0)&&(n=o=sl()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||dBn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>_rr(t,sl(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!zEs(l,r.integrity)){s("integrity mismatch");return}n.body=Srr(l)[0],_rr(t,n)},"processBody");await u_s(n.body,c,s)}else _rr(t,n)}a(mBn,"mainFetch");function cBn(t){if(pZ(t)&&t.request.redirectCount===0)return Promise.resolve(Rit(t));let{request:e}=t,{protocol:r}=S5(e);switch(r){case"about:":return Promise.resolve(sl("about scheme is not supported"));case"blob:":{yrr||(yrr=require("node:buffer").resolveObjectURL);let n=S5(e);if(n.search.length!==0)return Promise.resolve(sl("NetworkError when attempting to fetch resource."));let o=yrr(n.toString());if(e.method!=="GET"||!c_s(o))return Promise.resolve(sl("invalid method"));let s=kit(),c=o.size,l=Pit(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=m_s(d,!0);if(f==="failure")return Promise.resolve(sl("failed to fetch the data URL"));let{rangeStartValue:h,rangeEndValue:m}=f;if(h===null)h=c-m,m=h+m-1;else{if(h>=c)return Promise.resolve(sl("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m,u),A=sBn(g);s.body=A[0];let y=Pit(`${g.size}`),E=g_s(h,m,c);s.status=206,s.statusText="Partial Content",s.headersList.set("content-length",y,!0),s.headersList.set("content-type",u,!0),s.headersList.set("content-range",E,!0)}else{let d=sBn(o);s.statusText="OK",s.body=d[0],s.headersList.set("content-length",l,!0),s.headersList.set("content-type",u,!0)}return Promise.resolve(s)}case"data:":{let n=S5(e),o=R_s(n);if(o==="failure")return Promise.resolve(sl("failed to fetch the data URL"));let s=k_s(o.mimeType);return Promise.resolve(kit({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:Srr(o.body)[0]}))}case"file:":return Promise.resolve(sl("not implemented... yet..."));case"http:":case"https:":return gBn(t).catch(n=>sl(n));default:return Promise.resolve(sl("unknown scheme"))}}a(cBn,"schemeFetch");function U_s(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(U_s,"finalizeResponse");function _rr(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(t.request.url.protocol!=="https:")return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=Crr(r),l="");let d=0;if(t.request.mode!=="navigator"||!e.hasCrossOriginRedirects){d=e.status;let f=y_s(e.headersList);f!=="failure"&&(u.contentType=P_s(f))}t.request.initiatorType!=null&&pBn(r,t.request.url.href,t.request.initiatorType,globalThis,l,u,d)};let c=a(()=>{t.request.done=!0,t.processResponseEndOfBody!=null&&queueMicrotask(()=>t.processResponseEndOfBody(e)),t.request.initiatorType!=null&&t.controller.reportTimingSteps()},"processResponseEndOfBodyTask");queueMicrotask(()=>c())},"processResponseEndOfBody");t.processResponse!=null&&queueMicrotask(()=>{t.processResponse(e),t.processResponse=null});let o=e.type==="error"?e:e.internalResponse??e;o.body==null?n():I_s(o.body.stream,()=>{n()})}a(_rr,"fetchFinale");async function gBn(t){let e=t.request,r=null,n=null,o=t.timingInfo;if(e.serviceWorkers,r===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),n=r=await ABn(t),e.responseTainting==="cors"&&i_s(e,r)==="failure")return sl("cors failure");ZEs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&o_s(e.origin,e.client,e.destination,n)==="blocked"?sl("blocked"):(uBn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=sl("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await Q_s(t,r):hZ(!1)),r.timingInfo=o,r)}a(gBn,"httpFetch");function Q_s(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=e_s(n,S5(r).hash),o==null)return e}catch(c){return Promise.resolve(sl(c))}if(!brr(o))return Promise.resolve(sl("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(sl("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!vrr(r,o))return Promise.resolve(sl('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(sl('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(sl());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!O_s.includes(r.method)){r.method="GET",r.body=null;for(let c of v_s)r.headersList.delete(c)}vrr(S5(r),o)||(r.headersList.delete("authorization",!0),r.headersList.delete("proxy-authorization",!0),r.headersList.delete("cookie",!0),r.headersList.delete("host",!0)),r.body!=null&&(hZ(r.body.source!=null),r.body=Srr(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=Zke(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),t_s(r,n),mBn(t,!0)}a(Q_s,"httpRedirectFetch");async function ABn(t,e=!1,r=!1){let n=t.request,o=null,s=null,c=null,l=null,u=!1;n.window==="no-window"&&n.redirect==="error"?(o=t,s=n):(s=WEs(n),o={...t},o.request=s);let d=n.credentials==="include"||n.credentials==="same-origin"&&n.responseTainting==="basic",f=s.body?s.body.length:null,h=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(h="0"),f!=null&&(h=Pit(`${f}`)),h!=null&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",Pit(s.referrer.href),!0),XEs(s),n_s(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",L_s),s.cache==="default"&&(s.headersList.contains("if-modified-since",!0)||s.headersList.contains("if-none-match",!0)||s.headersList.contains("if-unmodified-since",!0)||s.headersList.contains("if-match",!0)||s.headersList.contains("if-range",!0))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control",!0)&&s.headersList.append("cache-control","max-age=0",!0),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma",!0)||s.headersList.append("pragma","no-cache",!0),s.headersList.contains("cache-control",!0)||s.headersList.append("cache-control","no-cache",!0)),s.headersList.contains("range",!0)&&s.headersList.append("accept-encoding","identity",!0),s.headersList.contains("accept-encoding",!0)||(p_s(S5(s))?s.headersList.append("accept-encoding","br, gzip, deflate",!0):s.headersList.append("accept-encoding","gzip, deflate",!0)),s.headersList.delete("host",!0),l==null&&(s.cache="no-store"),s.cache!=="no-store"&&s.cache,c==null){if(s.cache==="only-if-cached")return sl("only if cached");let m=await q_s(o,d,r);!__s.has(s.method)&&m.status>=200&&m.status<=399,u&&m.status,c==null&&(c=m)}if(c.urlList=[...s.urlList],s.headersList.contains("range",!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=d,c.status===407)return n.window==="no-window"?sl():pZ(t)?Rit(t):sl("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(pZ(t))return Rit(t);t.controller.connection.destroy(),c=await ABn(t,e,!0)}return c}a(ABn,"httpNetworkOrCacheFetch");async function q_s(t,e=!1,r=!1){hZ(!t.controller.connection||t.controller.connection.destroyed),t.controller.connection={abort:null,destroyed:!1,destroy(A,y=!0){this.destroyed||(this.destroyed=!0,y&&this.abort?.(A??new DOMException("The operation was aborted.","AbortError")))}};let n=t.request,o=null,s=t.timingInfo;null==null&&(n.cache="no-store");let l=r?"yes":"no";n.mode;let u=null;if(n.body==null&&t.processRequestEndOfBody)queueMicrotask(()=>t.processRequestEndOfBody());else if(n.body!=null){let A=a(async function*(_){pZ(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{pZ(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{pZ(t)||(_.name==="AbortError"?t.controller.abort():t.controller.terminate(_))},"processBodyError");u=(async function*(){try{for await(let _ of n.body.stream)yield*A(_);y()}catch(_){E(_)}})()}try{let{body:A,status:y,statusText:E,headersList:_,socket:v}=await g({body:u});if(v)o=kit({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=kit({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),Rit(t,A)):sl(A)}let d=a(async()=>{await t.controller.resume()},"pullAlgorithm"),f=a(A=>{pZ(t)||t.controller.abort(A)},"cancelAlgorithm"),h=new ReadableStream({async start(A){t.controller.controller=A},async pull(A){await d(A)},async cancel(A){await f(A)},type:"bytes"});o.body={stream:h,source:null,length:null},t.controller.onAborted=m,t.controller.on("terminated",m),t.controller.resume=async()=>{for(;;){let A,y;try{let{done:_,value:v}=await t.controller.next();if(oBn(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){d_s(t.controller.controller),U_s(t,o);return}if(s.decodedBodySize+=A?.byteLength??0,y){t.controller.terminate(A);return}let E=new Uint8Array(A);if(E.byteLength&&t.controller.controller.enqueue(E),w_s(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){oBn(t)?(o.aborted=!0,Dit(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):Dit(h)&&t.controller.controller.error(new TypeError("terminated",{cause:l_s(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=S5(n),E=t.controller.dispatcher;return new Promise((_,v)=>E.dispatch({path:y.pathname+y.search,origin:y.origin,method:n.method,body:E.isMockActive?n.body&&(n.body.source||n.body.stream):A,headers:n.headersList.entries,maxRedirections:0,upgrade:n.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(b){let{connection:T}=t.controller;s.finalConnectionTimingInfo=h_s(void 0,s.postRedirectStartTime,t.crossOriginIsolatedCapability),T.destroyed?b(new DOMException("The operation was aborted.","AbortError")):(t.controller.on("terminated",b),this.abort=T.abort=b),s.finalNetworkRequestStartTime=Zke(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=Zke(t.crossOriginIsolatedCapability)},onHeaders(b,T,w,R){if(b<200)return;let x="",P=new iBn;for(let B=0;BM)return v(new Error(`too many content-encodings in response: ${j.length}, maximum allowed is ${M}`)),!0;for(let O=j.length-1;O>=0;--O){let U=j[O].trim();if(U==="x-gzip"||U==="gzip")D.push(Dj.createGunzip({flush:Dj.constants.Z_SYNC_FLUSH,finishFlush:Dj.constants.Z_SYNC_FLUSH}));else if(U==="deflate")D.push(A_s({flush:Dj.constants.Z_SYNC_FLUSH,finishFlush:Dj.constants.Z_SYNC_FLUSH}));else if(U==="br")D.push(Dj.createBrotliDecompress({flush:Dj.constants.BROTLI_OPERATION_FLUSH,finishFlush:Dj.constants.BROTLI_OPERATION_FLUSH}));else{D.length=0;break}}}let L=this.onError.bind(this);return _({status:b,statusText:R,headersList:P,body:D.length?T_s(this.body,...D,B=>{B&&this.onError(B)}).on("error",L):this.body.on("error",L)}),!0},onData(b){if(t.controller.dump)return;let T=b;return s.encodedBodySize+=T.byteLength,this.body.push(T)},onComplete(){this.abort&&t.controller.off("terminated",this.abort),t.controller.onAborted&&t.controller.off("terminated",t.controller.onAborted),t.controller.ended=!0,this.body.push(null)},onError(b){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(b),t.controller.terminate(b),v(b)},onUpgrade(b,T,w){if(b!==101)return;let R=new iBn;for(let x=0;x{"use strict";p();EBn.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}});var vBn=I((nof,_Bn)=>{"use strict";p();var{webidl:ET}=GA(),Mit=Symbol("ProgressEvent state"),Irr=class t extends Event{static{a(this,"ProgressEvent")}constructor(e,r={}){e=ET.converters.DOMString(e,"ProgressEvent constructor","type"),r=ET.converters.ProgressEventInit(r??{}),super(e,r),this[Mit]={lengthComputable:r.lengthComputable,loaded:r.loaded,total:r.total}}get lengthComputable(){return ET.brandCheck(this,t),this[Mit].lengthComputable}get loaded(){return ET.brandCheck(this,t),this[Mit].loaded}get total(){return ET.brandCheck(this,t),this[Mit].total}};ET.converters.ProgressEventInit=ET.dictionaryConverter([{key:"lengthComputable",converter:ET.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"loaded",converter:ET.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"total",converter:ET.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"bubbles",converter:ET.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:ET.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:ET.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}]);_Bn.exports={ProgressEvent:Irr}});var bBn=I((sof,CBn)=>{"use strict";p();function j_s(t){if(!t)return"failure";switch(t.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}a(j_s,"getEncoding");CBn.exports={getEncoding:j_s}});var PBn=I((lof,kBn)=>{"use strict";p();var{kState:jfe,kError:xrr,kResult:SBn,kAborted:ePe,kLastProgressEventFired:wrr}=Trr(),{ProgressEvent:H_s}=vBn(),{getEncoding:TBn}=bBn(),{serializeAMimeType:G_s,parseMIMEType:IBn}=sb(),{types:$_s}=require("node:util"),{StringDecoder:xBn}=require("string_decoder"),{btoa:wBn}=require("node:buffer"),V_s={enumerable:!0,writable:!1,configurable:!1};function W_s(t,e,r,n){if(t[jfe]==="loading")throw new DOMException("Invalid state","InvalidStateError");t[jfe]="loading",t[SBn]=null,t[xrr]=null;let s=e.stream().getReader(),c=[],l=s.read(),u=!0;(async()=>{for(;!t[ePe];)try{let{done:d,value:f}=await l;if(u&&!t[ePe]&&queueMicrotask(()=>{Nj("loadstart",t)}),u=!1,!d&&$_s.isUint8Array(f))c.push(f),(t[wrr]===void 0||Date.now()-t[wrr]>=50)&&!t[ePe]&&(t[wrr]=Date.now(),queueMicrotask(()=>{Nj("progress",t)})),l=s.read();else if(d){queueMicrotask(()=>{t[jfe]="done";try{let h=z_s(c,r,e.type,n);if(t[ePe])return;t[SBn]=h,Nj("load",t)}catch(h){t[xrr]=h,Nj("error",t)}t[jfe]!=="loading"&&Nj("loadend",t)});break}}catch(d){if(t[ePe])return;queueMicrotask(()=>{t[jfe]="done",t[xrr]=d,Nj("error",t),t[jfe]!=="loading"&&Nj("loadend",t)});break}})()}a(W_s,"readOperation");function Nj(t,e){let r=new H_s(t,{bubbles:!1,cancelable:!1});e.dispatchEvent(r)}a(Nj,"fireAProgressEvent");function z_s(t,e,r,n){switch(e){case"DataURL":{let o="data:",s=IBn(r||"application/octet-stream");s!=="failure"&&(o+=G_s(s)),o+=";base64,";let c=new xBn("latin1");for(let l of t)o+=wBn(c.write(l));return o+=wBn(c.end()),o}case"Text":{let o="failure";if(n&&(o=TBn(n)),o==="failure"&&r){let s=IBn(r);s!=="failure"&&(o=TBn(s.parameters.get("charset")))}return o==="failure"&&(o="UTF-8"),Y_s(t,o)}case"ArrayBuffer":return RBn(t).buffer;case"BinaryString":{let o="",s=new xBn("latin1");for(let c of t)o+=s.write(c);return o+=s.end(),o}}}a(z_s,"packageData");function Y_s(t,e){let r=RBn(t),n=K_s(r),o=0;n!==null&&(e=n,o=n==="UTF-8"?3:2);let s=r.slice(o);return new TextDecoder(e).decode(s)}a(Y_s,"decode");function K_s(t){let[e,r,n]=t;return e===239&&r===187&&n===191?"UTF-8":e===254&&r===255?"UTF-16BE":e===255&&r===254?"UTF-16LE":null}a(K_s,"BOMSniffing");function RBn(t){let e=t.reduce((n,o)=>n+o.byteLength,0),r=0;return t.reduce((n,o)=>(n.set(o,r),r+=o.byteLength,n),new Uint8Array(e))}a(RBn,"combineByteSequences");kBn.exports={staticPropertyDescriptors:V_s,readOperation:W_s,fireAProgressEvent:Nj}});var OBn=I((fof,MBn)=>{"use strict";p();var{staticPropertyDescriptors:Hfe,readOperation:Oit,fireAProgressEvent:DBn}=PBn(),{kState:mZ,kError:NBn,kResult:Lit,kEvents:Pc,kAborted:J_s}=Trr(),{webidl:wl}=GA(),{kEnumerableProperty:lb}=js(),I2=class t extends EventTarget{static{a(this,"FileReader")}constructor(){super(),this[mZ]="empty",this[Lit]=null,this[NBn]=null,this[Pc]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsArrayBuffer"),e=wl.converters.Blob(e,{strict:!1}),Oit(this,e,"ArrayBuffer")}readAsBinaryString(e){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsBinaryString"),e=wl.converters.Blob(e,{strict:!1}),Oit(this,e,"BinaryString")}readAsText(e,r=void 0){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsText"),e=wl.converters.Blob(e,{strict:!1}),r!==void 0&&(r=wl.converters.DOMString(r,"FileReader.readAsText","encoding")),Oit(this,e,"Text",r)}readAsDataURL(e){wl.brandCheck(this,t),wl.argumentLengthCheck(arguments,1,"FileReader.readAsDataURL"),e=wl.converters.Blob(e,{strict:!1}),Oit(this,e,"DataURL")}abort(){if(this[mZ]==="empty"||this[mZ]==="done"){this[Lit]=null;return}this[mZ]==="loading"&&(this[mZ]="done",this[Lit]=null),this[J_s]=!0,DBn("abort",this),this[mZ]!=="loading"&&DBn("loadend",this)}get readyState(){switch(wl.brandCheck(this,t),this[mZ]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return wl.brandCheck(this,t),this[Lit]}get error(){return wl.brandCheck(this,t),this[NBn]}get onloadend(){return wl.brandCheck(this,t),this[Pc].loadend}set onloadend(e){wl.brandCheck(this,t),this[Pc].loadend&&this.removeEventListener("loadend",this[Pc].loadend),typeof e=="function"?(this[Pc].loadend=e,this.addEventListener("loadend",e)):this[Pc].loadend=null}get onerror(){return wl.brandCheck(this,t),this[Pc].error}set onerror(e){wl.brandCheck(this,t),this[Pc].error&&this.removeEventListener("error",this[Pc].error),typeof e=="function"?(this[Pc].error=e,this.addEventListener("error",e)):this[Pc].error=null}get onloadstart(){return wl.brandCheck(this,t),this[Pc].loadstart}set onloadstart(e){wl.brandCheck(this,t),this[Pc].loadstart&&this.removeEventListener("loadstart",this[Pc].loadstart),typeof e=="function"?(this[Pc].loadstart=e,this.addEventListener("loadstart",e)):this[Pc].loadstart=null}get onprogress(){return wl.brandCheck(this,t),this[Pc].progress}set onprogress(e){wl.brandCheck(this,t),this[Pc].progress&&this.removeEventListener("progress",this[Pc].progress),typeof e=="function"?(this[Pc].progress=e,this.addEventListener("progress",e)):this[Pc].progress=null}get onload(){return wl.brandCheck(this,t),this[Pc].load}set onload(e){wl.brandCheck(this,t),this[Pc].load&&this.removeEventListener("load",this[Pc].load),typeof e=="function"?(this[Pc].load=e,this.addEventListener("load",e)):this[Pc].load=null}get onabort(){return wl.brandCheck(this,t),this[Pc].abort}set onabort(e){wl.brandCheck(this,t),this[Pc].abort&&this.removeEventListener("abort",this[Pc].abort),typeof e=="function"?(this[Pc].abort=e,this.addEventListener("abort",e)):this[Pc].abort=null}};I2.EMPTY=I2.prototype.EMPTY=0;I2.LOADING=I2.prototype.LOADING=1;I2.DONE=I2.prototype.DONE=2;Object.defineProperties(I2.prototype,{EMPTY:Hfe,LOADING:Hfe,DONE:Hfe,readAsArrayBuffer:lb,readAsBinaryString:lb,readAsText:lb,readAsDataURL:lb,abort:lb,readyState:lb,result:lb,error:lb,onloadstart:lb,onprogress:lb,onload:lb,onabort:lb,onerror:lb,onloadend:lb,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(I2,{EMPTY:Hfe,LOADING:Hfe,DONE:Hfe});MBn.exports={FileReader:I2}});var Bit=I((mof,LBn)=>{"use strict";p();LBn.exports={kConstruct:Wd().kConstruct}});var UBn=I((Aof,FBn)=>{"use strict";p();var Z_s=require("node:assert"),{URLSerializer:BBn}=sb(),{isValidHeaderName:X_s}=pT();function evs(t,e,r=!1){let n=BBn(t,r),o=BBn(e,r);return n===o}a(evs,"urlEquals");function tvs(t){Z_s(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),X_s(r)&&e.push(r);return e}a(tvs,"getFieldValues");FBn.exports={urlEquals:evs,getFieldValues:tvs}});var jBn=I((_of,qBn)=>{"use strict";p();var{kConstruct:rvs}=Bit(),{urlEquals:nvs,getFieldValues:Rrr}=UBn(),{kEnumerableProperty:gZ,isDisturbed:ivs}=js(),{webidl:vi}=GA(),{Response:ovs,cloneResponse:svs,fromInnerResponse:avs}=Jke(),{Request:GF,fromInnerRequest:cvs}=qfe(),{kState:x2}=Ej(),{fetching:lvs}=Xke(),{urlIsHttpHttpsScheme:Fit,createDeferredPromise:Gfe,readAllBytes:uvs}=pT(),krr=require("node:assert"),Uit=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==rvs&&vi.illegalConstructor(),vi.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){vi.brandCheck(this,t);let n="Cache.match";vi.argumentLengthCheck(arguments,1,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.converters.CacheQueryOptions(r,n,"options");let o=this.#i(e,r,1);if(o.length!==0)return o[0]}async matchAll(e=void 0,r={}){vi.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=vi.converters.RequestInfo(e,n,"request")),r=vi.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){vi.brandCheck(this,t);let r="Cache.add";vi.argumentLengthCheck(arguments,1,r),e=vi.converters.RequestInfo(e,r,"request");let n=[e];return await this.addAll(n)}async addAll(e){vi.brandCheck(this,t);let r="Cache.addAll";vi.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw vi.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=vi.converters.RequestInfo(m),typeof m=="string")continue;let g=m[x2];if(!Fit(g.url)||g.method!=="GET")throw vi.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=new GF(m)[x2];if(!Fit(g.url))throw vi.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Gfe();s.push(lvs({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(vi.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=Rrr(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(vi.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let v of s)v.abort();return}}},processResponseEndOfBody(y){if(y.aborted){A.reject(new DOMException("aborted","AbortError"));return}A.resolve(y)}})),n.push(A.promise)}let l=await Promise.all(n),u=[],d=0;for(let m of l){let g={type:"put",request:o[d],response:m};u.push(g),d++}let f=Gfe(),h=null;try{this.#t(u)}catch(m){h=m}return queueMicrotask(()=>{h===null?f.resolve(void 0):f.reject(h)}),f.promise}async put(e,r){vi.brandCheck(this,t);let n="Cache.put";vi.argumentLengthCheck(arguments,2,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.converters.Response(r,n,"response");let o=null;if(e instanceof GF?o=e[x2]:o=new GF(e)[x2],!Fit(o.url)||o.method!=="GET")throw vi.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=r[x2];if(s.status===206)throw vi.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=Rrr(s.headersList.get("vary"));for(let A of g)if(A==="*")throw vi.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(ivs(s.body.stream)||s.body.stream.locked))throw vi.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=svs(s),l=Gfe();if(s.body!=null){let A=s.body.stream.getReader();uvs(A).then(l.resolve,l.reject)}else l.resolve(void 0);let u=[],d={type:"put",request:o,response:c};u.push(d);let f=await l.promise;c.body!=null&&(c.body.source=f);let h=Gfe(),m=null;try{this.#t(u)}catch(g){m=g}return queueMicrotask(()=>{m===null?h.resolve():h.reject(m)}),h.promise}async delete(e,r={}){vi.brandCheck(this,t);let n="Cache.delete";vi.argumentLengthCheck(arguments,1,n),e=vi.converters.RequestInfo(e,n,"request"),r=vi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e instanceof GF){if(o=e[x2],o.method!=="GET"&&!r.ignoreMethod)return!1}else krr(typeof e=="string"),o=new GF(e)[x2];let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Gfe(),u=null,d;try{d=this.#t(s)}catch(f){u=f}return queueMicrotask(()=>{u===null?l.resolve(!!d?.length):l.reject(u)}),l.promise}async keys(e=void 0,r={}){vi.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=vi.converters.RequestInfo(e,n,"request")),r=vi.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(e instanceof GF){if(o=e[x2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new GF(e)[x2]);let s=Gfe(),c=[];if(e===void 0)for(let l of this.#e)c.push(l[0]);else{let l=this.#r(o,r);for(let u of l)c.push(u[0])}return queueMicrotask(()=>{let l=[];for(let u of c){let d=cvs(u,new AbortController().signal,"immutable");l.push(d)}s.resolve(Object.freeze(l))}),s.promise}#t(e){let r=this.#e,n=[...r],o=[],s=[];try{for(let c of e){if(c.type!=="delete"&&c.type!=="put")throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#r(c.request,c.options,o).length)throw new DOMException("???","InvalidStateError");let l;if(c.type==="delete"){if(l=this.#r(c.request,c.options),l.length===0)return[];for(let u of l){let d=r.indexOf(u);krr(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!Fit(u.url))throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw vi.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});l=this.#r(c.request);for(let d of l){let f=r.indexOf(d);krr(f!==-1),r.splice(f,1)}r.push([c.request,c.response]),o.push([c.request,c.response])}s.push([c.request,c.response])}return s}catch(c){throw this.#e.length=0,this.#e=n,c}}#r(e,r,n){let o=[],s=n??this.#e;for(let c of s){let[l,u]=c;this.#n(e,l,u,r)&&o.push(c)}return o}#n(e,r,n=null,o){let s=new URL(e.url),c=new URL(r.url);if(o?.ignoreSearch&&(c.search="",s.search=""),!nvs(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=Rrr(n.headersList.get("vary"));for(let u of l){if(u==="*")return!1;let d=r.headersList.get(u),f=e.headersList.get(u);if(d!==f)return!1}return!0}#i(e,r,n=1/0){let o=null;if(e!==void 0)if(e instanceof GF){if(o=e[x2],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new GF(e)[x2]);let s=[];if(e===void 0)for(let l of this.#e)s.push(l[1]);else{let l=this.#r(o,r);for(let u of l)s.push(u[1])}let c=[];for(let l of s){let u=avs(l,"immutable");if(c.push(u.clone()),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(Uit.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:gZ,matchAll:gZ,add:gZ,addAll:gZ,put:gZ,delete:gZ,keys:gZ});var QBn=[{key:"ignoreSearch",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:vi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];vi.converters.CacheQueryOptions=vi.dictionaryConverter(QBn);vi.converters.MultiCacheQueryOptions=vi.dictionaryConverter([...QBn,{key:"cacheName",converter:vi.converters.DOMString}]);vi.converters.Response=vi.interfaceConverter(ovs);vi.converters["sequence"]=vi.sequenceConverter(vi.converters.RequestInfo);qBn.exports={Cache:Uit}});var GBn=I((bof,HBn)=>{"use strict";p();var{kConstruct:tPe}=Bit(),{Cache:Qit}=jBn(),{webidl:TE}=GA(),{kEnumerableProperty:rPe}=js(),qit=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==tPe&&TE.illegalConstructor(),TE.util.markAsUncloneable(this)}async match(e,r={}){if(TE.brandCheck(this,t),TE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=TE.converters.RequestInfo(e),r=TE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new Qit(tPe,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new Qit(tPe,n).match(e,r);if(s!==void 0)return s}}async has(e){TE.brandCheck(this,t);let r="CacheStorage.has";return TE.argumentLengthCheck(arguments,1,r),e=TE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){TE.brandCheck(this,t);let r="CacheStorage.open";if(TE.argumentLengthCheck(arguments,1,r),e=TE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new Qit(tPe,o)}let n=[];return this.#e.set(e,n),new Qit(tPe,n)}async delete(e){TE.brandCheck(this,t);let r="CacheStorage.delete";return TE.argumentLengthCheck(arguments,1,r),e=TE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return TE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(qit.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:rPe,has:rPe,open:rPe,delete:rPe,keys:rPe});HBn.exports={CacheStorage:qit}});var VBn=I((Iof,$Bn)=>{"use strict";p();$Bn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var Prr=I((wof,JBn)=>{"use strict";p();function dvs(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(dvs,"isCTLExcludingHtab");function WBn(t){for(let e=0;e126||r===34||r===40||r===41||r===60||r===62||r===64||r===44||r===59||r===58||r===92||r===47||r===91||r===93||r===63||r===61||r===123||r===125)throw new Error("Invalid cookie name")}}a(WBn,"validateCookieName");function zBn(t){let e=t.length,r=0;if(t[0]==='"'){if(e===1||t[e-1]!=='"')throw new Error("Invalid cookie value");--e,++r}for(;r126||n===34||n===44||n===59||n===92)throw new Error("Invalid cookie value")}}a(zBn,"validateCookieValue");function YBn(t){for(let e=0;ee.toString().padStart(2,"0"));function KBn(t){return typeof t=="number"&&(t=new Date(t)),`${pvs[t.getUTCDay()]}, ${jit[t.getUTCDate()]} ${hvs[t.getUTCMonth()]} ${t.getUTCFullYear()} ${jit[t.getUTCHours()]}:${jit[t.getUTCMinutes()]}:${jit[t.getUTCSeconds()]} GMT`}a(KBn,"toIMFDate");function mvs(t){if(t<0)throw new Error("Invalid cookie max-age")}a(mvs,"validateCookieMaxAge");function gvs(t){if(t.name.length===0)return null;WBn(t.name),zBn(t.value);let e=[`${t.name}=${t.value}`];t.name.startsWith("__Secure-")&&(t.secure=!0),t.name.startsWith("__Host-")&&(t.secure=!0,t.domain=null,t.path="/"),t.secure&&e.push("Secure"),t.httpOnly&&e.push("HttpOnly"),typeof t.maxAge=="number"&&(mvs(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(fvs(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(YBn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${KBn(t.expires)}`),t.sameSite&&e.push(`SameSite=${t.sameSite}`);for(let r of t.unparsed){if(!r.includes("="))throw new Error("Invalid unparsed");let[n,...o]=r.split("=");e.push(`${n.trim()}=${o.join("=")}`)}return e.join("; ")}a(gvs,"stringify");JBn.exports={isCTLExcludingHtab:dvs,validateCookieName:WBn,validateCookiePath:YBn,validateCookieValue:zBn,toIMFDate:KBn,stringify:gvs}});var XBn=I((Pof,ZBn)=>{"use strict";p();var{maxNameValuePairSize:Avs,maxAttributeValueSize:yvs}=VBn(),{isCTLExcludingHtab:Evs}=Prr(),{collectASequenceOfCodePointsFast:Hit}=sb(),_vs=require("node:assert");function vvs(t){if(Evs(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=Hit(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=Hit("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>Avs?null:{name:n,value:o,...$fe(r)}}a(vvs,"parseSetCookie");function $fe(t,e={}){if(t.length===0)return e;_vs(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=Hit(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=Hit("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>yvs)return $fe(t,e);let s=n.toLowerCase();if(s==="expires"){let c=new Date(o);e.expires=c}else if(s==="max-age"){let c=o.charCodeAt(0);if((c<48||c>57)&&o[0]!=="-"||!/^\d+$/.test(o))return $fe(t,e);let l=Number(o);e.maxAge=l}else if(s==="domain"){let c=o;c[0]==="."&&(c=c.slice(1)),c=c.toLowerCase(),e.domain=c}else if(s==="path"){let c="";o.length===0||o[0]!=="/"?c="/":c=o,e.path=c}else if(s==="secure")e.secure=!0;else if(s==="httponly")e.httpOnly=!0;else if(s==="samesite"){let c="Default",l=o.toLowerCase();l.includes("none")&&(c="None"),l.includes("strict")&&(c="Strict"),l.includes("lax")&&(c="Lax"),e.sameSite=c}else e.unparsed??=[],e.unparsed.push(`${n}=${o}`);return $fe(t,e)}a($fe,"parseUnparsedAttributes");ZBn.exports={parseSetCookie:vvs,parseUnparsedAttributes:$fe}});var r3n=I((Mof,t3n)=>{"use strict";p();var{parseSetCookie:Cvs}=XBn(),{stringify:bvs}=Prr(),{webidl:pa}=GA(),{Headers:Git}=dZ();function Svs(t){pa.argumentLengthCheck(arguments,1,"getCookies"),pa.brandCheck(t,Git,{strict:!1});let e=t.get("cookie"),r={};if(!e)return r;for(let n of e.split(";")){let[o,...s]=n.split("=");r[o.trim()]=s.join("=")}return r}a(Svs,"getCookies");function Tvs(t,e,r){pa.brandCheck(t,Git,{strict:!1});let n="deleteCookie";pa.argumentLengthCheck(arguments,2,n),e=pa.converters.DOMString(e,n,"name"),r=pa.converters.DeleteCookieAttributes(r),e3n(t,{name:e,value:"",expires:new Date(0),...r})}a(Tvs,"deleteCookie");function Ivs(t){pa.argumentLengthCheck(arguments,1,"getSetCookies"),pa.brandCheck(t,Git,{strict:!1});let e=t.getSetCookie();return e?e.map(r=>Cvs(r)):[]}a(Ivs,"getSetCookies");function e3n(t,e){pa.argumentLengthCheck(arguments,2,"setCookie"),pa.brandCheck(t,Git,{strict:!1}),e=pa.converters.Cookie(e);let r=bvs(e);r&&t.append("Set-Cookie",r)}a(e3n,"setCookie");pa.converters.DeleteCookieAttributes=pa.dictionaryConverter([{converter:pa.nullableConverter(pa.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);pa.converters.Cookie=pa.dictionaryConverter([{converter:pa.converters.DOMString,key:"name"},{converter:pa.converters.DOMString,key:"value"},{converter:pa.nullableConverter(t=>typeof t=="number"?pa.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:pa.nullableConverter(pa.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:pa.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:pa.sequenceConverter(pa.converters.DOMString),key:"unparsed",defaultValue:a(()=>new Array(0),"defaultValue")}]);t3n.exports={getCookies:Svs,deleteCookie:Tvs,getSetCookies:Ivs,setCookie:e3n}});var Wfe=I((Bof,i3n)=>{"use strict";p();var{webidl:hi}=GA(),{kEnumerableProperty:ub}=js(),{kConstruct:n3n}=Wd(),{MessagePort:xvs}=require("node:worker_threads"),Vfe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===n3n){super(arguments[1],arguments[2]),hi.util.markAsUncloneable(this);return}let n="MessageEvent constructor";hi.argumentLengthCheck(arguments,1,n),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,hi.util.markAsUncloneable(this)}get data(){return hi.brandCheck(this,t),this.#e.data}get origin(){return hi.brandCheck(this,t),this.#e.origin}get lastEventId(){return hi.brandCheck(this,t),this.#e.lastEventId}get source(){return hi.brandCheck(this,t),this.#e.source}get ports(){return hi.brandCheck(this,t),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,r=!1,n=!1,o=null,s="",c="",l=null,u=[]){return hi.brandCheck(this,t),hi.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new t(e,{bubbles:r,cancelable:n,data:o,origin:s,lastEventId:c,source:l,ports:u})}static createFastMessageEvent(e,r){let n=new t(n3n,e,r);return n.#e=r,n.#e.data??=null,n.#e.origin??="",n.#e.lastEventId??="",n.#e.source??=null,n.#e.ports??=[],n}},{createFastMessageEvent:wvs}=Vfe;delete Vfe.createFastMessageEvent;var $it=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";hi.argumentLengthCheck(arguments,1,n),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.CloseEventInit(r),super(e,r),this.#e=r,hi.util.markAsUncloneable(this)}get wasClean(){return hi.brandCheck(this,t),this.#e.wasClean}get code(){return hi.brandCheck(this,t),this.#e.code}get reason(){return hi.brandCheck(this,t),this.#e.reason}},Vit=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";hi.argumentLengthCheck(arguments,1,n),super(e,r),hi.util.markAsUncloneable(this),e=hi.converters.DOMString(e,n,"type"),r=hi.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return hi.brandCheck(this,t),this.#e.message}get filename(){return hi.brandCheck(this,t),this.#e.filename}get lineno(){return hi.brandCheck(this,t),this.#e.lineno}get colno(){return hi.brandCheck(this,t),this.#e.colno}get error(){return hi.brandCheck(this,t),this.#e.error}};Object.defineProperties(Vfe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:ub,origin:ub,lastEventId:ub,source:ub,ports:ub,initMessageEvent:ub});Object.defineProperties($it.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:ub,code:ub,wasClean:ub});Object.defineProperties(Vit.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:ub,filename:ub,lineno:ub,colno:ub,error:ub});hi.converters.MessagePort=hi.interfaceConverter(xvs);hi.converters["sequence"]=hi.sequenceConverter(hi.converters.MessagePort);var Drr=[{key:"bubbles",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];hi.converters.MessageEventInit=hi.dictionaryConverter([...Drr,{key:"data",converter:hi.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:hi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:hi.nullableConverter(hi.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:hi.converters["sequence"],defaultValue:a(()=>new Array(0),"defaultValue")}]);hi.converters.CloseEventInit=hi.dictionaryConverter([...Drr,{key:"wasClean",converter:hi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:hi.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);hi.converters.ErrorEventInit=hi.dictionaryConverter([...Drr,{key:"message",converter:hi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:hi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:hi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:hi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:hi.converters.any}]);i3n.exports={MessageEvent:Vfe,CloseEvent:$it,ErrorEvent:Vit,createFastMessageEvent:wvs}});var AZ=I((Qof,o3n)=>{"use strict";p();var Rvs="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kvs={enumerable:!0,writable:!1,configurable:!1},Pvs={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},Dvs={NOT_SENT:0,PROCESSING:1,SENT:2},Nvs={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},Mvs=2**16-1,Ovs={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},Lvs=Buffer.allocUnsafe(0),Bvs={string:1,typedArray:2,arrayBuffer:3,blob:4};o3n.exports={uid:Rvs,sentCloseFrameState:Dvs,staticPropertyDescriptors:kvs,states:Pvs,opcodes:Nvs,maxUnsigned16Bit:Mvs,parserStates:Ovs,emptyBuffer:Lvs,sendHints:Bvs}});var nPe=I((jof,s3n)=>{"use strict";p();s3n.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}});var sPe=I((Gof,m3n)=>{"use strict";p();var{kReadyState:iPe,kController:Fvs,kResponse:Uvs,kBinaryType:Qvs,kWebSocketURL:qvs}=nPe(),{states:oPe,opcodes:Mj}=AZ(),{ErrorEvent:jvs,createFastMessageEvent:Hvs}=Wfe(),{isUtf8:Gvs}=require("node:buffer"),{collectASequenceOfCodePointsFast:$vs,removeHTTPWhitespace:a3n}=sb();function Vvs(t){return t[iPe]===oPe.CONNECTING}a(Vvs,"isConnecting");function Wvs(t){return t[iPe]===oPe.OPEN}a(Wvs,"isEstablished");function zvs(t){return t[iPe]===oPe.CLOSING}a(zvs,"isClosing");function Yvs(t){return t[iPe]===oPe.CLOSED}a(Yvs,"isClosed");function Nrr(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(Nrr,"fireEvent");function Kvs(t,e,r){if(t[iPe]!==oPe.OPEN)return;let n;if(e===Mj.TEXT)try{n=h3n(r)}catch{l3n(t,"Received invalid UTF-8 in text frame.");return}else e===Mj.BINARY&&(t[Qvs]==="blob"?n=new Blob([r]):n=Jvs(r));Nrr("message",t,Hvs,{origin:t[qvs].origin,data:n})}a(Kvs,"websocketMessageReceived");function Jvs(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}a(Jvs,"toArrayBuffer");function Zvs(t){if(t.length===0)return!1;for(let e=0;e126||r===34||r===40||r===41||r===44||r===47||r===58||r===59||r===60||r===61||r===62||r===63||r===64||r===91||r===92||r===93||r===123||r===125)return!1}return!0}a(Zvs,"isValidSubprotocol");function Xvs(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(Xvs,"isValidStatusCode");function l3n(t,e){let{[Fvs]:r,[Uvs]:n}=t;r.abort(),n?.socket&&!n.socket.destroyed&&n.socket.destroy(),e&&Nrr("error",t,(o,s)=>new jvs(o,s),{error:new Error(e),message:e})}a(l3n,"failWebsocketConnection");function u3n(t){return t===Mj.CLOSE||t===Mj.PING||t===Mj.PONG}a(u3n,"isControlFrame");function d3n(t){return t===Mj.CONTINUATION}a(d3n,"isContinuationFrame");function f3n(t){return t===Mj.TEXT||t===Mj.BINARY}a(f3n,"isTextBinaryFrame");function eCs(t){return f3n(t)||d3n(t)||u3n(t)}a(eCs,"isValidOpcode");function tCs(t){let e={position:0},r=new Map;for(;e.position57)return!1}let e=Number.parseInt(t,10);return e>=8&&e<=15}a(rCs,"isValidClientWindowBits");var p3n=typeof process.versions.icu=="string",c3n=p3n?new TextDecoder("utf-8",{fatal:!0}):void 0,h3n=p3n?c3n.decode.bind(c3n):function(t){if(Gvs(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")};m3n.exports={isConnecting:Vvs,isEstablished:Wvs,isClosing:zvs,isClosed:Yvs,fireEvent:Nrr,isValidSubprotocol:Zvs,isValidStatusCode:Xvs,failWebsocketConnection:l3n,websocketMessageReceived:Kvs,utf8Decode:h3n,isControlFrame:u3n,isContinuationFrame:d3n,isTextBinaryFrame:f3n,isValidOpcode:eCs,parseExtensions:tCs,isValidClientWindowBits:rCs}});var zit=I((Wof,g3n)=>{"use strict";p();var{maxUnsigned16Bit:nCs}=AZ(),Wit=16386,Mrr,aPe=null,zfe=Wit;try{Mrr=require("node:crypto")}catch{Mrr={randomFillSync:a(function(e,r,n){for(let o=0;onCs?(c+=8,s=127):o>125&&(c+=2,s=126);let l=Buffer.allocUnsafe(o+c);l[0]=l[1]=0,l[0]|=128,l[0]=(l[0]&240)+e;l[c-4]=n[0],l[c-3]=n[1],l[c-2]=n[2],l[c-1]=n[3],l[1]=s,s===126?l.writeUInt16BE(o,2):s===127&&(l[2]=l[3]=0,l.writeUIntBE(o,4,6)),l[1]|=128;for(let u=0;u{"use strict";p();var{uid:oCs,states:cPe,sentCloseFrameState:Yit,emptyBuffer:sCs,opcodes:aCs}=AZ(),{kReadyState:lPe,kSentClose:Kit,kByteParser:y3n,kReceivedClose:A3n,kResponse:E3n}=nPe(),{fireEvent:cCs,failWebsocketConnection:Oj,isClosing:lCs,isClosed:uCs,isEstablished:dCs,parseExtensions:fCs}=sPe(),{channels:Yfe}=sfe(),{CloseEvent:pCs}=Wfe(),{makeRequest:hCs}=qfe(),{fetching:mCs}=Xke(),{Headers:gCs,getHeadersList:ACs}=dZ(),{getDecodeSplit:yCs}=pT(),{WebsocketFrameSend:ECs}=zit(),Lrr;try{Lrr=require("node:crypto")}catch{}function _Cs(t,e,r,n,o,s){let c=t;c.protocol=t.protocol==="ws:"?"http:":"https:";let l=hCs({urlList:[c],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(s.headers){let h=ACs(new gCs(s.headers));l.headersList=h}let u=Lrr.randomBytes(16).toString("base64");l.headersList.append("sec-websocket-key",u),l.headersList.append("sec-websocket-version","13");for(let h of e)l.headersList.append("sec-websocket-protocol",h);return l.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits"),mCs({request:l,useParallelQueue:!0,dispatcher:s.dispatcher,processResponse(h){if(h.type==="error"||h.status!==101){Oj(n,"Received network error or non-101 status code.");return}if(e.length!==0&&!h.headersList.get("Sec-WebSocket-Protocol")){Oj(n,"Server did not respond with sent protocols.");return}if(h.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){Oj(n,'Server did not set Upgrade header to "websocket".');return}if(h.headersList.get("Connection")?.toLowerCase()!=="upgrade"){Oj(n,'Server did not set Connection header to "upgrade".');return}let m=h.headersList.get("Sec-WebSocket-Accept"),g=Lrr.createHash("sha1").update(u+oCs).digest("base64");if(m!==g){Oj(n,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let A=h.headersList.get("Sec-WebSocket-Extensions"),y;if(A!==null&&(y=fCs(A),!y.has("permessage-deflate"))){Oj(n,"Sec-WebSocket-Extensions header does not match.");return}let E=h.headersList.get("Sec-WebSocket-Protocol");if(E!==null&&!yCs("sec-websocket-protocol",l.headersList).includes(E)){Oj(n,"Protocol was not set in the opening handshake.");return}h.socket.on("data",_3n),h.socket.on("close",v3n),h.socket.on("error",C3n),Yfe.open.hasSubscribers&&Yfe.open.publish({address:h.socket.address(),protocol:E,extensions:A}),o(h,y)}})}a(_Cs,"establishWebSocketConnection");function vCs(t,e,r,n){if(!(lCs(t)||uCs(t)))if(!dCs(t))Oj(t,"Connection was closed before it was established."),t[lPe]=cPe.CLOSING;else if(t[Kit]===Yit.NOT_SENT){t[Kit]=Yit.PROCESSING;let o=new ECs;e!==void 0&&r===void 0?(o.frameData=Buffer.allocUnsafe(2),o.frameData.writeUInt16BE(e,0)):e!==void 0&&r!==void 0?(o.frameData=Buffer.allocUnsafe(2+n),o.frameData.writeUInt16BE(e,0),o.frameData.write(r,2,"utf-8")):o.frameData=sCs,t[E3n].socket.write(o.createFrame(aCs.CLOSE)),t[Kit]=Yit.SENT,t[lPe]=cPe.CLOSING}else t[lPe]=cPe.CLOSING}a(vCs,"closeWebSocketConnection");function _3n(t){this.ws[y3n].write(t)||this.pause()}a(_3n,"onSocketData");function v3n(){let{ws:t}=this,{[E3n]:e}=t;e.socket.off("data",_3n),e.socket.off("close",v3n),e.socket.off("error",C3n);let r=t[Kit]===Yit.SENT&&t[A3n],n=1005,o="",s=t[y3n].closingInfo;s&&!s.error?(n=s.code??1005,o=s.reason):t[A3n]||(n=1006),t[lPe]=cPe.CLOSED,cCs("close",t,(c,l)=>new pCs(c,l),{wasClean:r,code:n,reason:o}),Yfe.close.hasSubscribers&&Yfe.close.publish({websocket:t,code:n,reason:o})}a(v3n,"onSocketClose");function C3n(t){let{ws:e}=this;e[lPe]=cPe.CLOSING,Yfe.socketError.hasSubscribers&&Yfe.socketError.publish(t),this.destroy()}a(C3n,"onSocketError");b3n.exports={establishWebSocketConnection:_Cs,closeWebSocketConnection:vCs}});var I3n=I((Xof,T3n)=>{"use strict";p();var{createInflateRaw:CCs,Z_DEFAULT_WINDOWBITS:bCs}=require("node:zlib"),{isValidClientWindowBits:SCs}=sPe(),{MessageSizeExceededError:S3n}=_c(),TCs=Buffer.from([0,0,255,255]),Jit=Symbol("kBuffer"),uPe=Symbol("kLength"),ICs=4*1024*1024,Frr=class{static{a(this,"PerMessageDeflate")}#e;#t={};#r=!1;#n=null;constructor(e){this.#t.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=e.get("server_max_window_bits")}decompress(e,r,n){if(this.#r){n(new S3n);return}if(!this.#e){let o=bCs;if(this.#t.serverMaxWindowBits){if(!SCs(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=CCs({windowBits:o})}catch(s){n(s);return}this.#e[Jit]=[],this.#e[uPe]=0,this.#e.on("data",s=>{if(!this.#r){if(this.#e[uPe]+=s.length,this.#e[uPe]>ICs){if(this.#r=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#n){let c=this.#n;this.#n=null,c(new S3n)}return}this.#e[Jit].push(s)}}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#n=n,this.#e.write(e),r&&this.#e.write(TCs),this.#e.flush(()=>{if(this.#r||!this.#e)return;let o=Buffer.concat(this.#e[Jit],this.#e[uPe]);this.#e[Jit].length=0,this.#e[uPe]=0,this.#n=null,n(null,o)})}};T3n.exports={PerMessageDeflate:Frr}});var L3n=I((rsf,O3n)=>{"use strict";p();var{Writable:xCs}=require("node:stream"),wCs=require("node:assert"),{parserStates:db,opcodes:Kfe,states:RCs,emptyBuffer:x3n,sentCloseFrameState:w3n}=AZ(),{kReadyState:kCs,kSentClose:R3n,kResponse:k3n,kReceivedClose:P3n}=nPe(),{channels:Zit}=sfe(),{isValidStatusCode:PCs,isValidOpcode:DCs,failWebsocketConnection:_T,websocketMessageReceived:D3n,utf8Decode:NCs,isControlFrame:N3n,isTextBinaryFrame:Urr,isContinuationFrame:MCs}=sPe(),{WebsocketFrameSend:M3n}=zit(),{closeWebSocketConnection:OCs}=Brr(),{PerMessageDeflate:LCs}=I3n(),Qrr=class extends xCs{static{a(this,"ByteParser")}#e=[];#t=0;#r=!1;#n=db.INFO;#i={};#o=[];#s;constructor(e,r){super(),this.ws=e,this.#s=r??new Map,this.#s.has("permessage-deflate")&&this.#s.set("permessage-deflate",new LCs(r))}_write(e,r,n){this.#e.push(e),this.#t+=e.length,this.#r=!0,this.run(n)}run(e){for(;this.#r;)if(this.#n===db.INFO){if(this.#t<2)return e();let r=this.consume(2),n=(r[0]&128)!==0,o=r[0]&15,s=(r[1]&128)===128,c=!n&&o!==Kfe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!DCs(o))return _T(this.ws,"Invalid opcode received"),e();if(s)return _T(this.ws,"Frame cannot be masked"),e();if(u!==0&&!this.#s.has("permessage-deflate")){_T(this.ws,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){_T(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!Urr(o)){_T(this.ws,"Invalid frame type was fragmented.");return}if(Urr(o)&&this.#o.length>0){_T(this.ws,"Expected continuation frame");return}if(this.#i.fragmented&&c){_T(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&N3n(o)){_T(this.ws,"Control frame either too large or fragmented");return}if(MCs(o)&&this.#o.length===0&&!this.#i.compressed){_T(this.ws,"Unexpected continuation frame");return}l<=125?(this.#i.payloadLength=l,this.#n=db.READ_DATA):l===126?this.#n=db.PAYLOADLENGTH_16:l===127&&(this.#n=db.PAYLOADLENGTH_64),Urr(o)&&(this.#i.binaryType=o,this.#i.compressed=u!==0),this.#i.opcode=o,this.#i.masked=s,this.#i.fin=n,this.#i.fragmented=c}else if(this.#n===db.PAYLOADLENGTH_16){if(this.#t<2)return e();let r=this.consume(2);this.#i.payloadLength=r.readUInt16BE(0),this.#n=db.READ_DATA}else if(this.#n===db.PAYLOADLENGTH_64){if(this.#t<8)return e();let r=this.consume(8),n=r.readUInt32BE(0),o=r.readUInt32BE(4);if(n!==0||o>2**31-1){_T(this.ws,"Received payload length > 2^31 bytes.");return}this.#i.payloadLength=o,this.#n=db.READ_DATA}else if(this.#n===db.READ_DATA){if(this.#t{if(n){_T(this.ws,n.message);return}if(this.#o.push(o),!this.#i.fin){this.#n=db.INFO,this.#r=!0,this.run(e);return}D3n(this.ws,this.#i.binaryType,Buffer.concat(this.#o)),this.#r=!0,this.#n=db.INFO,this.#o.length=0,this.run(e)}),this.#r=!1;break}else{if(this.#o.push(r),!this.#i.fragmented&&this.#i.fin){let n=Buffer.concat(this.#o);D3n(this.ws,this.#i.binaryType,n),this.#o.length=0}this.#n=db.INFO}}}consume(e){if(e>this.#t)throw new Error("Called consume() before buffers satiated.");if(e===0)return x3n;if(this.#e[0].length===e)return this.#t-=this.#e[0].length,this.#e.shift();let r=Buffer.allocUnsafe(e),n=0;for(;n!==e;){let o=this.#e[0],{length:s}=o;if(s+n===e){r.set(this.#e.shift(),n);break}else if(s+n>e){r.set(o.subarray(0,e-n),n),this.#e[0]=o.subarray(e-n);break}else r.set(this.#e.shift(),n),n+=o.length}return this.#t-=e,r}parseCloseBody(e){wCs(e.length!==1);let r;if(e.length>=2&&(r=e.readUInt16BE(0)),r!==void 0&&!PCs(r))return{code:1002,reason:"Invalid status code",error:!0};let n=e.subarray(2);n[0]===239&&n[1]===187&&n[2]===191&&(n=n.subarray(3));try{n=NCs(n)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:r,reason:n,error:!1}}parseControlFrame(e){let{opcode:r,payloadLength:n}=this.#i;if(r===Kfe.CLOSE){if(n===1)return _T(this.ws,"Received close frame with a 1-byte body."),!1;if(this.#i.closeInfo=this.parseCloseBody(e),this.#i.closeInfo.error){let{code:o,reason:s}=this.#i.closeInfo;return OCs(this.ws,o,s,s.length),_T(this.ws,s),!1}if(this.ws[R3n]!==w3n.SENT){let o=x3n;this.#i.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#i.closeInfo.code,0));let s=new M3n(o);this.ws[k3n].socket.write(s.createFrame(Kfe.CLOSE),c=>{c||(this.ws[R3n]=w3n.SENT)})}return this.ws[kCs]=RCs.CLOSING,this.ws[P3n]=!0,!1}else if(r===Kfe.PING){if(!this.ws[P3n]){let o=new M3n(e);this.ws[k3n].socket.write(o.createFrame(Kfe.PONG)),Zit.ping.hasSubscribers&&Zit.ping.publish({payload:e})}}else r===Kfe.PONG&&Zit.pong.hasSubscribers&&Zit.pong.publish({payload:e});return!0}get closingInfo(){return this.#i.closeInfo}};O3n.exports={ByteParser:Qrr}});var q3n=I((osf,Q3n)=>{"use strict";p();var{WebsocketFrameSend:BCs}=zit(),{opcodes:B3n,sendHints:Jfe}=AZ(),FCs=Yer(),F3n=Buffer[Symbol.species],qrr=class{static{a(this,"SendQueue")}#e=new FCs;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==Jfe.blob){let s=U3n(e,n);if(!this.#t)this.#r.write(s,r);else{let c={promise:null,callback:r,frame:s};this.#e.push(c)}return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=U3n(s,n)}),callback:r,frame:null};this.#e.push(o),this.#t||this.#n()}async#n(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let r=e.shift();r.promise!==null&&await r.promise,this.#r.write(r.frame,r.callback),r.callback=r.frame=null}this.#t=!1}};function U3n(t,e){return new BCs(UCs(t,e)).createFrame(e===Jfe.string?B3n.TEXT:B3n.BINARY)}a(U3n,"createFrame");function UCs(t,e){switch(e){case Jfe.string:return Buffer.from(t);case Jfe.arrayBuffer:case Jfe.blob:return new F3n(t);case Jfe.typedArray:return new F3n(t.buffer,t.byteOffset,t.byteLength)}}a(UCs,"toBuffer");Q3n.exports={SendQueue:qrr}});var K3n=I((csf,Y3n)=>{"use strict";p();var{webidl:oo}=GA(),{URLSerializer:QCs}=sb(),{environmentSettingsObject:j3n}=pT(),{staticPropertyDescriptors:Lj,states:dPe,sentCloseFrameState:qCs,sendHints:Xit}=AZ(),{kWebSocketURL:H3n,kReadyState:jrr,kController:jCs,kBinaryType:eot,kResponse:G3n,kSentClose:HCs,kByteParser:GCs}=nPe(),{isConnecting:$Cs,isEstablished:VCs,isClosing:WCs,isValidSubprotocol:zCs,fireEvent:$3n}=sPe(),{establishWebSocketConnection:YCs,closeWebSocketConnection:V3n}=Brr(),{ByteParser:KCs}=L3n(),{kEnumerableProperty:Mw,isBlobLike:W3n}=js(),{getGlobalDispatcher:JCs}=mit(),{types:z3n}=require("node:util"),{ErrorEvent:ZCs,CloseEvent:XCs}=Wfe(),{SendQueue:ebs}=q3n(),vT=class t extends EventTarget{static{a(this,"WebSocket")}#e={open:null,error:null,close:null,message:null};#t=0;#r="";#n="";#i;constructor(e,r=[]){super(),oo.util.markAsUncloneable(this);let n="WebSocket constructor";oo.argumentLengthCheck(arguments,1,n);let o=oo.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=oo.converters.USVString(e,n,"url"),r=o.protocols;let s=j3n.settingsObject.baseUrl,c;try{c=new URL(e,s)}catch(u){throw new DOMException(u,"SyntaxError")}if(c.protocol==="http:"?c.protocol="ws:":c.protocol==="https:"&&(c.protocol="wss:"),c.protocol!=="ws:"&&c.protocol!=="wss:")throw new DOMException(`Expected a ws: or wss: protocol, got ${c.protocol}`,"SyntaxError");if(c.hash||c.href.endsWith("#"))throw new DOMException("Got fragment","SyntaxError");if(typeof r=="string"&&(r=[r]),r.length!==new Set(r.map(u=>u.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(r.length>0&&!r.every(u=>zCs(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[H3n]=new URL(c.href);let l=j3n.settingsObject;this[jCs]=YCs(c,r,l,this,(u,d)=>this.#o(u,d),o),this[jrr]=t.CONNECTING,this[HCs]=qCs.NOT_SENT,this[eot]="blob"}close(e=void 0,r=void 0){oo.brandCheck(this,t);let n="WebSocket.close";if(e!==void 0&&(e=oo.converters["unsigned short"](e,n,"code",{clamp:!0})),r!==void 0&&(r=oo.converters.USVString(r,n,"reason")),e!==void 0&&e!==1e3&&(e<3e3||e>4999))throw new DOMException("invalid code","InvalidAccessError");let o=0;if(r!==void 0&&(o=Buffer.byteLength(r),o>123))throw new DOMException(`Reason must be less than 123 bytes; received ${o}`,"SyntaxError");V3n(this,e,r,o)}send(e){oo.brandCheck(this,t);let r="WebSocket.send";if(oo.argumentLengthCheck(arguments,1,r),e=oo.converters.WebSocketSendData(e,r,"data"),$Cs(this))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!VCs(this)||WCs(this)))if(typeof e=="string"){let n=Buffer.byteLength(e);this.#t+=n,this.#i.add(e,()=>{this.#t-=n},Xit.string)}else z3n.isArrayBuffer(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Xit.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Xit.typedArray)):W3n(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},Xit.blob))}get readyState(){return oo.brandCheck(this,t),this[jrr]}get bufferedAmount(){return oo.brandCheck(this,t),this.#t}get url(){return oo.brandCheck(this,t),QCs(this[H3n])}get extensions(){return oo.brandCheck(this,t),this.#n}get protocol(){return oo.brandCheck(this,t),this.#r}get onopen(){return oo.brandCheck(this,t),this.#e.open}set onopen(e){oo.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onerror(){return oo.brandCheck(this,t),this.#e.error}set onerror(e){oo.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}get onclose(){return oo.brandCheck(this,t),this.#e.close}set onclose(e){oo.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close),typeof e=="function"?(this.#e.close=e,this.addEventListener("close",e)):this.#e.close=null}get onmessage(){return oo.brandCheck(this,t),this.#e.message}set onmessage(e){oo.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get binaryType(){return oo.brandCheck(this,t),this[eot]}set binaryType(e){oo.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this[eot]="blob":this[eot]=e}#o(e,r){this[G3n]=e;let n=new KCs(this,r);n.on("drain",tbs),n.on("error",rbs.bind(this)),e.socket.ws=this,this[GCs]=n,this.#i=new ebs(e.socket),this[jrr]=dPe.OPEN;let o=e.headersList.get("sec-websocket-extensions");o!==null&&(this.#n=o);let s=e.headersList.get("sec-websocket-protocol");s!==null&&(this.#r=s),$3n("open",this)}};vT.CONNECTING=vT.prototype.CONNECTING=dPe.CONNECTING;vT.OPEN=vT.prototype.OPEN=dPe.OPEN;vT.CLOSING=vT.prototype.CLOSING=dPe.CLOSING;vT.CLOSED=vT.prototype.CLOSED=dPe.CLOSED;Object.defineProperties(vT.prototype,{CONNECTING:Lj,OPEN:Lj,CLOSING:Lj,CLOSED:Lj,url:Mw,readyState:Mw,bufferedAmount:Mw,onopen:Mw,onerror:Mw,onclose:Mw,close:Mw,onmessage:Mw,binaryType:Mw,send:Mw,extensions:Mw,protocol:Mw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(vT,{CONNECTING:Lj,OPEN:Lj,CLOSING:Lj,CLOSED:Lj});oo.converters["sequence"]=oo.sequenceConverter(oo.converters.DOMString);oo.converters["DOMString or sequence"]=function(t,e,r){return oo.util.Type(t)==="Object"&&Symbol.iterator in t?oo.converters["sequence"](t):oo.converters.DOMString(t,e,r)};oo.converters.WebSocketInit=oo.dictionaryConverter([{key:"protocols",converter:oo.converters["DOMString or sequence"],defaultValue:a(()=>new Array(0),"defaultValue")},{key:"dispatcher",converter:oo.converters.any,defaultValue:a(()=>JCs(),"defaultValue")},{key:"headers",converter:oo.nullableConverter(oo.converters.HeadersInit)}]);oo.converters["DOMString or sequence or WebSocketInit"]=function(t){return oo.util.Type(t)==="Object"&&!(Symbol.iterator in t)?oo.converters.WebSocketInit(t):{protocols:oo.converters["DOMString or sequence"](t)}};oo.converters.WebSocketSendData=function(t){if(oo.util.Type(t)==="Object"){if(W3n(t))return oo.converters.Blob(t,{strict:!1});if(ArrayBuffer.isView(t)||z3n.isArrayBuffer(t))return oo.converters.BufferSource(t)}return oo.converters.USVString(t)};function tbs(){this.ws[G3n].socket.resume()}a(tbs,"onParserDrain");function rbs(t){let e,r;t instanceof XCs?(e=t.reason,r=t.code):e=t.message,$3n("error",this,()=>new ZCs("error",{error:t,message:e})),V3n(this,r)}a(rbs,"onParserError");Y3n.exports={WebSocket:vT}});var Hrr=I((dsf,J3n)=>{"use strict";p();function nbs(t){return t.indexOf("\0")===-1}a(nbs,"isValidLastEventId");function ibs(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(ibs,"isASCIINumber");function obs(t){return new Promise(e=>{setTimeout(e,t).unref()})}a(obs,"delay");J3n.exports={isValidLastEventId:nbs,isASCIINumber:ibs,delay:obs}});var tFn=I((hsf,eFn)=>{"use strict";p();var{Transform:sbs}=require("node:stream"),{isASCIINumber:Z3n,isValidLastEventId:X3n}=Hrr(),$F=[239,187,191],Grr=10,tot=13,abs=58,cbs=32,$rr=class extends sbs{static{a(this,"EventSourceStream")}state=null;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,r,n){if(e.length===0){n();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===$F[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===$F[0]&&this.buffer[1]===$F[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===$F[0]&&this.buffer[1]===$F[1]&&this.buffer[2]===$F[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===$F[0]&&this.buffer[1]===$F[1]&&this.buffer[2]===$F[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&Z3n(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&X3n(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};eFn.exports={EventSourceStream:$rr}});var lFn=I((Asf,cFn)=>{"use strict";p();var{pipeline:lbs}=require("node:stream"),{fetching:ubs}=Xke(),{makeRequest:dbs}=qfe(),{webidl:VF}=GA(),{EventSourceStream:fbs}=tFn(),{parseMIMEType:pbs}=sb(),{createFastMessageEvent:hbs}=Wfe(),{isNetworkError:rFn}=Jke(),{delay:mbs}=Hrr(),{kEnumerableProperty:yZ}=js(),{environmentSettingsObject:nFn}=pT(),iFn=!1,oFn=3e3,fPe=0,sFn=1,pPe=2,gbs="anonymous",Abs="use-credentials",Zfe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t=null;#r=!1;#n=fPe;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),VF.util.markAsUncloneable(this);let n="EventSource constructor";VF.argumentLengthCheck(arguments,1,n),iFn||(iFn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=VF.converters.USVString(e,n,"url"),r=VF.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.dispatcher,this.#a={lastEventId:"",reconnectionTime:oFn};let o=nFn,s;try{s=new URL(e,o.settingsObject.baseUrl),this.#a.origin=s.origin}catch(u){throw new DOMException(u,"SyntaxError")}this.#t=s.href;let c=gbs;r.withCredentials&&(c=Abs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=nFn.settingsObject,l.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],l.cache="no-store",l.initiator="other",l.urlList=[new URL(this.#t)],this.#i=dbs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===pPe)return;this.#n=fPe;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{rFn(n)&&(this.dispatchEvent(new Event("error")),this.close()),this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(rFn(n))if(n.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#u();return}let o=n.headersList.get("content-type",!0),s=o!==null?pbs(o):"failure",c=s!=="failure"&&s.essence==="text/event-stream";if(n.status!==200||c===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#n=sFn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new fbs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(hbs(u.type,u.options))},"push")});lbs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=ubs(e)}async#u(){this.#n!==pPe&&(this.#n=fPe,this.dispatchEvent(new Event("error")),await mbs(this.#a.reconnectionTime),this.#n===fPe&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){VF.brandCheck(this,t),this.#n!==pPe&&(this.#n=pPe,this.#o.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}},aFn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:fPe,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:sFn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:pPe,writable:!1}};Object.defineProperties(Zfe,aFn);Object.defineProperties(Zfe.prototype,aFn);Object.defineProperties(Zfe.prototype,{close:yZ,onerror:yZ,onmessage:yZ,onopen:yZ,readyState:yZ,url:yZ,withCredentials:yZ});VF.converters.EventSourceInitDict=VF.dictionaryConverter([{key:"withCredentials",converter:VF.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:VF.converters.any}]);cFn.exports={EventSource:Zfe,defaultReconnectionTime:oFn}});var pFn=I((_sf,Yi)=>{"use strict";p();var ybs=Ife(),uFn=Ake(),Ebs=xfe(),_bs=a5n(),vbs=wfe(),Cbs=mtr(),bbs=P5n(),Sbs=B5n(),dFn=_c(),not=js(),{InvalidArgumentError:rot}=dFn,Xfe=b4n(),Tbs=Eke(),Ibs=Ktr(),xbs=oLn(),wbs=Xtr(),Rbs=Btr(),kbs=oit(),{getGlobalDispatcher:fFn,setGlobalDispatcher:Pbs}=mit(),Dbs=git(),Nbs=znt(),Mbs=Ynt();Object.assign(uFn.prototype,Xfe);Yi.exports.Dispatcher=uFn;Yi.exports.Client=ybs;Yi.exports.Pool=Ebs;Yi.exports.BalancedPool=_bs;Yi.exports.Agent=vbs;Yi.exports.ProxyAgent=Cbs;Yi.exports.EnvHttpProxyAgent=bbs;Yi.exports.RetryAgent=Sbs;Yi.exports.RetryHandler=kbs;Yi.exports.DecoratorHandler=Dbs;Yi.exports.RedirectHandler=Nbs;Yi.exports.createRedirectInterceptor=Mbs;Yi.exports.interceptors={redirect:fLn(),retry:hLn(),dump:gLn(),dns:ELn()};Yi.exports.buildConnector=Tbs;Yi.exports.errors=dFn;Yi.exports.util={parseHeaders:not.parseHeaders,headerNameToString:not.headerNameToString};function hPe(t){return(e,r,n)=>{if(typeof r=="function"&&(n=r,r=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new rot("invalid url");if(r!=null&&typeof r!="object")throw new rot("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new rot("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(not.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=not.parseURL(e);let{agent:o,dispatcher:s=fFn()}=r;if(o)throw new rot("unsupported opts.agent. Did you mean opts.client?");return t.call(s,{...r,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:r.method||(r.body?"PUT":"GET")},n)}}a(hPe,"makeDispatcher");Yi.exports.setGlobalDispatcher=Pbs;Yi.exports.getGlobalDispatcher=fFn;var Obs=Xke().fetch;Yi.exports.fetch=a(async function(e,r=void 0){try{return await Obs(e,r)}catch(n){throw n&&typeof n=="object"&&Error.captureStackTrace(n),n}},"fetch");Yi.exports.Headers=dZ().Headers;Yi.exports.Response=Jke().Response;Yi.exports.Request=qfe().Request;Yi.exports.FormData=Ike().FormData;Yi.exports.File=globalThis.File??require("node:buffer").File;Yi.exports.FileReader=OBn().FileReader;var{setGlobalOrigin:Lbs,getGlobalOrigin:Bbs}=ger();Yi.exports.setGlobalOrigin=Lbs;Yi.exports.getGlobalOrigin=Bbs;var{CacheStorage:Fbs}=GBn(),{kConstruct:Ubs}=Bit();Yi.exports.caches=new Fbs(Ubs);var{deleteCookie:Qbs,getCookies:qbs,getSetCookies:jbs,setCookie:Hbs}=r3n();Yi.exports.deleteCookie=Qbs;Yi.exports.getCookies=qbs;Yi.exports.getSetCookies=jbs;Yi.exports.setCookie=Hbs;var{parseMIMEType:Gbs,serializeAMimeType:$bs}=sb();Yi.exports.parseMIMEType=Gbs;Yi.exports.serializeAMimeType=$bs;var{CloseEvent:Vbs,ErrorEvent:Wbs,MessageEvent:zbs}=Wfe();Yi.exports.WebSocket=K3n().WebSocket;Yi.exports.CloseEvent=Vbs;Yi.exports.ErrorEvent=Wbs;Yi.exports.MessageEvent=zbs;Yi.exports.request=hPe(Xfe.request);Yi.exports.stream=hPe(Xfe.stream);Yi.exports.pipeline=hPe(Xfe.pipeline);Yi.exports.connect=hPe(Xfe.connect);Yi.exports.upgrade=hPe(Xfe.upgrade);Yi.exports.MockClient=Ibs;Yi.exports.MockPool=wbs;Yi.exports.MockAgent=xbs;Yi.exports.mockErrors=Rbs;var{EventSource:Ybs}=lFn();Yi.exports.EventSource=Ybs});var ms=I((bsf,hFn)=>{p();hFn.exports={options:{usePureJavaScript:!1}}});var AFn=I((Tsf,gFn)=>{p();var Vrr={};gFn.exports=Vrr;var mFn={};Vrr.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=Kbs(t,e);else{var o=0,s=e.length,c=e.charAt(0),l=[0];for(o=0;o0;)l.push(d%s),d=d/s|0}for(o=0;t[o]===0&&o=0;--o)n+=e[l[o]]}if(r){var f=new RegExp(".{1,"+r+"}","g");n=n.match(f).join(`\r +`)}return n};Vrr.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=mFn[e];if(!r){r=mFn[e]=[];for(var n=0;n>=8;for(;d>0;)c.push(d&255),d>>=8}for(var f=0;t[f]===s&&f0;)s.push(l%n),l=l/n|0}var u="";for(r=0;t.at(r)===0&&r=0;--r)u+=e[s[r]];return u}a(Kbs,"_encodeWithByteBuffer")});var uc=I((wsf,vFn)=>{p();var yFn=ms(),EFn=AFn(),nt=vFn.exports=yFn.util=yFn.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){nt.nextTick=process.nextTick,typeof setImmediate=="function"?nt.setImmediate=setImmediate:nt.setImmediate=nt.nextTick;return}if(typeof setImmediate=="function"){nt.setImmediate=function(){return setImmediate.apply(void 0,arguments)},nt.nextTick=function(l){return setImmediate(l)};return}if(nt.setImmediate=function(l){setTimeout(l,0)},typeof window<"u"&&typeof window.postMessage=="function"){let l=function(u){if(u.source===window&&u.data===t){u.stopPropagation();var d=e.slice();e.length=0,d.forEach(function(f){f()})}};var c=l;a(l,"handler");var t="forge.setImmediate",e=[];nt.setImmediate=function(u){e.push(u),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",l,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,o=document.createElement("div"),e=[];new MutationObserver(function(){var u=e.slice();e.length=0,u.forEach(function(d){d()})}).observe(o,{attributes:!0});var s=nt.setImmediate;nt.setImmediate=function(u){Date.now()-r>15?(r=Date.now(),s(u)):(e.push(u),e.length===1&&o.setAttribute("a",n=!n))}}nt.nextTick=nt.setImmediate})();nt.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;nt.globalScope=(function(){return nt.isNodejs?global:typeof self>"u"?window:self})();nt.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};nt.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};nt.isArrayBufferView=function(t){return t&&nt.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function mPe(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}a(mPe,"_checkBitsParam");nt.ByteBuffer=Wrr;function Wrr(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(nt.isArrayBuffer(t)||nt.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;rJbs&&(this.data.substr(0,1),this._constructedStringLength=0)};nt.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};nt.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};nt.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};nt.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};nt.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};nt.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(nt.encodeUtf8(t))};nt.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};nt.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};nt.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};nt.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};nt.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};nt.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};nt.ByteStringBuffer.prototype.putInt=function(t,e){mPe(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};nt.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};nt.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};nt.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};nt.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};nt.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};nt.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};nt.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};nt.ByteStringBuffer.prototype.copy=function(){var t=nt.createBuffer(this.data);return t.read=this.read,t};nt.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};nt.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};nt.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};nt.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};nt.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};nt.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};nt.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};nt.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};nt.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};nt.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};nt.DataBuffer.prototype.putInt=function(t,e){mPe(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};nt.DataBuffer.prototype.putSignedInt=function(t,e){return mPe(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};nt.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};nt.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};nt.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};nt.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};nt.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};nt.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};nt.DataBuffer.prototype.copy=function(){return new nt.DataBuffer(this)};nt.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};nt.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};nt.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};nt.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};nt.xorBytes=function(t,e,r){for(var n="",o="",s="",c=0,l=0;r>0;--r,++c)o=t.charCodeAt(c)^e.charCodeAt(c),l>=10&&(n+=s,s="",l=0),s+=String.fromCharCode(o),++l;return n+=s,n};nt.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var Bj="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Fj=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],_Fn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";nt.encode64=function(t,e){for(var r="",n="",o,s,c,l=0;l>2),r+=Bj.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=Bj.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":Bj.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r +`,r=r.substr(e));return n+=r,n};nt.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,o,s,c=0;c>4),o!==64&&(e+=String.fromCharCode((n&15)<<4|o>>2),s!==64&&(e+=String.fromCharCode((o&3)<<6|s)));return e};nt.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};nt.decodeUtf8=function(t){return decodeURIComponent(escape(t))};nt.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:EFn.encode,decode:EFn.decode}};nt.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};nt.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var o=r,s=0;s>2),r+=Bj.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=Bj.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":Bj.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r +`,r=r.substr(e));return n+=r,n};nt.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var o,s,c,l,u=0,d=r;u>4,c!==64&&(n[d++]=(s&15)<<4|c>>2,l!==64&&(n[d++]=(c&3)<<6|l));return e?d-r:n.subarray(0,d)};nt.binary.base58.encode=function(t,e){return nt.binary.baseN.encode(t,_Fn,e)};nt.binary.base58.decode=function(t,e){return nt.binary.baseN.decode(t,_Fn,e)};nt.text={utf8:{},utf16:{}};nt.text.utf8.encode=function(t,e,r){t=nt.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var o=r,s=0;s"u"&&(r=["web","flash"]);var o,s=!1,c=null;for(var l in r){o=r[l];try{if(o==="flash"||o==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),s=o==="flash"}(o==="web"||o==="both")&&(e[0]=localStorage,n=t.apply(this,e),s=!0)}catch(u){c=u}if(s)break}if(!s)throw c;return n},"_callStorageFunction");nt.setItem=function(t,e,r,n,o){iot(Xbs,arguments,o)};nt.getItem=function(t,e,r,n){return iot(e1s,arguments,n)};nt.removeItem=function(t,e,r,n){iot(t1s,arguments,n)};nt.clearItems=function(t,e,r){iot(r1s,arguments,r)};nt.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};nt.format=function(t){for(var e=/%./g,r,n,o=0,s=[],c=0;r=e.exec(t);){n=t.substring(c,e.lastIndex-2),n.length>0&&s.push(n),c=e.lastIndex;var l=r[0][1];switch(l){case"s":case"o":o");break;case"%":s.push("%");break;default:s.push("<%"+l+"?>")}}return s.push(t.substring(c)),s.join("")};nt.formatNumber=function(t,e,r,n){var o=t,s=isNaN(e=Math.abs(e))?2:e,c=r===void 0?",":r,l=n===void 0?".":n,u=o<0?"-":"",d=parseInt(o=Math.abs(+o||0).toFixed(s),10)+"",f=d.length>3?d.length%3:0;return u+(f?d.substr(0,f)+l:"")+d.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+l)+(s?c+Math.abs(o-d).toFixed(s).slice(2):"")};nt.formatSize=function(t){return t>=1073741824?t=nt.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=nt.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=nt.formatNumber(t/1024,0)+" KiB":t=nt.formatNumber(t,0)+" bytes",t};nt.bytesFromIP=function(t){return t.indexOf(".")!==-1?nt.bytesFromIPv4(t):t.indexOf(":")!==-1?nt.bytesFromIPv6(t):null};nt.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=nt.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1))}e.push(s)}if(r.length>0){var u=r[n];u.end-u.start>0&&(e.splice(u.start,u.end-u.start+1,""),u.start===0&&e.unshift(""),u.end===7&&e.push(""))}return e.join(":")};nt.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in nt&&!t.update)return e(null,nt.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return nt.cores=navigator.hardwareConcurrency,e(null,nt.cores);if(typeof Worker>"u")return nt.cores=1,e(null,nt.cores);if(typeof Blob>"u")return nt.cores=2,e(null,nt.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(c){for(var l=Date.now(),u=l+4;Date.now()g.st&&f.stf.st&&g.st{p();var Ng=ms();uc();CFn.exports=Ng.cipher=Ng.cipher||{};Ng.cipher.algorithms=Ng.cipher.algorithms||{};Ng.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Ng.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Ng.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};Ng.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=Ng.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new Ng.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};Ng.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),Ng.cipher.algorithms[t]=e};Ng.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in Ng.cipher.algorithms?Ng.cipher.algorithms[t]:null};var Krr=Ng.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};Krr.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=Ng.util.createBuffer(),this.output=t.output||Ng.util.createBuffer(),this.mode.start(e)};Krr.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Krr.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var Zrr=I((Nsf,bFn)=>{p();var Mg=ms();uc();Mg.cipher=Mg.cipher||{};var Xs=bFn.exports=Mg.cipher.modes=Mg.cipher.modes||{};Xs.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Xs.ecb.prototype.start=function(t){};Xs.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};Xs.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Xs.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=sot(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};Xs.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};Xs.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Mg.util.createBuffer(),this._partialBytes=0};Xs.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=sot(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Xs.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Xs.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Mg.util.createBuffer(),this._partialBytes=0};Xs.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=sot(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Xs.ofb.prototype.decrypt=Xs.ofb.prototype.encrypt;Xs.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Mg.util.createBuffer(),this._partialBytes=0};Xs.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=sot(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xs.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}aot(this._inBlock)};Xs.ctr.prototype.decrypt=Xs.ctr.prototype.encrypt;Xs.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Mg.util.createBuffer(),this._partialBytes=0,this._R=3774873600};Xs.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=Mg.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=Mg.util.createBuffer(t.additionalData):r=Mg.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=Mg.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(Jrr(n*8)))}this._inBlock=this._j0.slice(0),aot(this._inBlock),this._partialBytes=0,r=Mg.util.createBuffer(r),this._aDataLength=Jrr(r.length()*8);var o=r.length()%this.blockSize;for(o&&r.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};Xs.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),aot(this._inBlock)};Xs.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),aot(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var o=0;o0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};Xs.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,o=t[n]>>>(7-r%8)*4&15,s=this._m[r][o];e[0]^=s[0],e[1]^=s[1],e[2]^=s[2],e[3]^=s[3]}return e};Xs.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};Xs.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,o=16*r,s=new Array(o),c=0;c>>1,o=new Array(r);o[n]=t.slice(0);for(var s=n>>>1;s>0;)this.pow(o[2*s],o[s]=[]),s>>=1;for(s=2;s4){var r=t;t=Mg.util.createBuffer();for(var n=0;n{p();var wu=ms();oot();Zrr();uc();xFn.exports=wu.aes=wu.aes||{};wu.aes.startEncrypting=function(t,e,r,n){var o=cot({key:t,output:r,decrypt:!1,mode:n});return o.start(e),o};wu.aes.createEncryptionCipher=function(t,e){return cot({key:t,output:null,decrypt:!1,mode:e})};wu.aes.startDecrypting=function(t,e,r,n){var o=cot({key:t,output:r,decrypt:!0,mode:n});return o.start(e),o};wu.aes.createDecryptionCipher=function(t,e){return cot({key:t,output:null,decrypt:!0,mode:e})};wu.aes.Algorithm=function(t,e){tnr||TFn();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:a(function(n,o){return enr(r._w,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return enr(r._w,n,o,!0)},"decrypt")}}),r._init=!1};wu.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=wu.util.createBuffer(e);else if(wu.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=wu.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^l&255^99,lv[r]=l,Xrr[l]=r,u=t[l],o=t[r],s=t[o],c=t[s],d=u<<24^l<<16^l<<8^(l^u),f=(o^s^c)<<24^(r^c)<<16^(r^s^c)<<8^(r^o^c);for(var h=0;h<4;++h)EZ[h][r]=d,w2[h][l]=f,d=d<<24|d>>>8,f=f<<24|f>>>8;r===0?r=n=1:(r=o^t[t[t[o^c]]],n^=t[t[n]])}}a(TFn,"initialize");function IFn(t,e){for(var r=t.slice(0),n,o=1,s=r.length,c=s+6+1,l=epe*c,u=s;u>>16&255]<<24^lv[n>>>8&255]<<16^lv[n&255]<<8^lv[n>>>24]^SFn[o]<<24,o++):s>6&&u%s===4&&(n=lv[n>>>24]<<24^lv[n>>>16&255]<<16^lv[n>>>8&255]<<8^lv[n&255]),r[u]=r[u-s]^n;if(e){var d,f=w2[0],h=w2[1],m=w2[2],g=w2[3],A=r.slice(0);l=r.length;for(var u=0,y=l-epe;u>>24]]^h[lv[d>>>16&255]]^m[lv[d>>>8&255]]^g[lv[d&255]];r=A}return r}a(IFn,"_expandKey");function enr(t,e,r,n){var o=t.length/4-1,s,c,l,u,d;n?(s=w2[0],c=w2[1],l=w2[2],u=w2[3],d=Xrr):(s=EZ[0],c=EZ[1],l=EZ[2],u=EZ[3],d=lv);var f,h,m,g,A,y,E;f=e[0]^t[0],h=e[n?3:1]^t[1],m=e[2]^t[2],g=e[n?1:3]^t[3];for(var _=3,v=1;v>>24]^c[h>>>16&255]^l[m>>>8&255]^u[g&255]^t[++_],y=s[h>>>24]^c[m>>>16&255]^l[g>>>8&255]^u[f&255]^t[++_],E=s[m>>>24]^c[g>>>16&255]^l[f>>>8&255]^u[h&255]^t[++_],g=s[g>>>24]^c[f>>>16&255]^l[h>>>8&255]^u[m&255]^t[++_],f=A,h=y,m=E;r[0]=d[f>>>24]<<24^d[h>>>16&255]<<16^d[m>>>8&255]<<8^d[g&255]^t[++_],r[n?3:1]=d[h>>>24]<<24^d[m>>>16&255]<<16^d[g>>>8&255]<<8^d[f&255]^t[++_],r[2]=d[m>>>24]<<24^d[g>>>16&255]<<16^d[f>>>8&255]<<8^d[h&255]^t[++_],r[n?1:3]=d[g>>>24]<<24^d[f>>>16&255]<<16^d[h>>>8&255]<<8^d[m&255]^t[++_]}a(enr,"_updateBlock");function cot(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=wu.cipher.createDecipher(r,t.key):n=wu.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof wu.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(cot,"_createCipher")});var Qj=I((Usf,wFn)=>{p();var gPe=ms();gPe.pki=gPe.pki||{};var rnr=wFn.exports=gPe.pki.oids=gPe.oids=gPe.oids||{};function ir(t,e){rnr[t]=e,rnr[e]=t}a(ir,"_IN");function Hc(t,e){rnr[t]=e}a(Hc,"_I_");ir("1.2.840.113549.1.1.1","rsaEncryption");ir("1.2.840.113549.1.1.4","md5WithRSAEncryption");ir("1.2.840.113549.1.1.5","sha1WithRSAEncryption");ir("1.2.840.113549.1.1.7","RSAES-OAEP");ir("1.2.840.113549.1.1.8","mgf1");ir("1.2.840.113549.1.1.9","pSpecified");ir("1.2.840.113549.1.1.10","RSASSA-PSS");ir("1.2.840.113549.1.1.11","sha256WithRSAEncryption");ir("1.2.840.113549.1.1.12","sha384WithRSAEncryption");ir("1.2.840.113549.1.1.13","sha512WithRSAEncryption");ir("1.3.101.112","EdDSA25519");ir("1.2.840.10040.4.3","dsa-with-sha1");ir("1.3.14.3.2.7","desCBC");ir("1.3.14.3.2.26","sha1");ir("1.3.14.3.2.29","sha1WithRSASignature");ir("2.16.840.1.101.3.4.2.1","sha256");ir("2.16.840.1.101.3.4.2.2","sha384");ir("2.16.840.1.101.3.4.2.3","sha512");ir("2.16.840.1.101.3.4.2.4","sha224");ir("2.16.840.1.101.3.4.2.5","sha512-224");ir("2.16.840.1.101.3.4.2.6","sha512-256");ir("1.2.840.113549.2.2","md2");ir("1.2.840.113549.2.5","md5");ir("1.2.840.113549.1.7.1","data");ir("1.2.840.113549.1.7.2","signedData");ir("1.2.840.113549.1.7.3","envelopedData");ir("1.2.840.113549.1.7.4","signedAndEnvelopedData");ir("1.2.840.113549.1.7.5","digestedData");ir("1.2.840.113549.1.7.6","encryptedData");ir("1.2.840.113549.1.9.1","emailAddress");ir("1.2.840.113549.1.9.2","unstructuredName");ir("1.2.840.113549.1.9.3","contentType");ir("1.2.840.113549.1.9.4","messageDigest");ir("1.2.840.113549.1.9.5","signingTime");ir("1.2.840.113549.1.9.6","counterSignature");ir("1.2.840.113549.1.9.7","challengePassword");ir("1.2.840.113549.1.9.8","unstructuredAddress");ir("1.2.840.113549.1.9.14","extensionRequest");ir("1.2.840.113549.1.9.20","friendlyName");ir("1.2.840.113549.1.9.21","localKeyId");ir("1.2.840.113549.1.9.22.1","x509Certificate");ir("1.2.840.113549.1.12.10.1.1","keyBag");ir("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");ir("1.2.840.113549.1.12.10.1.3","certBag");ir("1.2.840.113549.1.12.10.1.4","crlBag");ir("1.2.840.113549.1.12.10.1.5","secretBag");ir("1.2.840.113549.1.12.10.1.6","safeContentsBag");ir("1.2.840.113549.1.5.13","pkcs5PBES2");ir("1.2.840.113549.1.5.12","pkcs5PBKDF2");ir("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");ir("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");ir("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");ir("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");ir("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");ir("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");ir("1.2.840.113549.2.7","hmacWithSHA1");ir("1.2.840.113549.2.8","hmacWithSHA224");ir("1.2.840.113549.2.9","hmacWithSHA256");ir("1.2.840.113549.2.10","hmacWithSHA384");ir("1.2.840.113549.2.11","hmacWithSHA512");ir("1.2.840.113549.3.7","des-EDE3-CBC");ir("2.16.840.1.101.3.4.1.2","aes128-CBC");ir("2.16.840.1.101.3.4.1.22","aes192-CBC");ir("2.16.840.1.101.3.4.1.42","aes256-CBC");ir("2.5.4.3","commonName");ir("2.5.4.4","surname");ir("2.5.4.5","serialNumber");ir("2.5.4.6","countryName");ir("2.5.4.7","localityName");ir("2.5.4.8","stateOrProvinceName");ir("2.5.4.9","streetAddress");ir("2.5.4.10","organizationName");ir("2.5.4.11","organizationalUnitName");ir("2.5.4.12","title");ir("2.5.4.13","description");ir("2.5.4.15","businessCategory");ir("2.5.4.17","postalCode");ir("2.5.4.42","givenName");ir("2.5.4.65","pseudonym");ir("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");ir("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");ir("2.16.840.1.113730.1.1","nsCertType");ir("2.16.840.1.113730.1.13","nsComment");Hc("2.5.29.1","authorityKeyIdentifier");Hc("2.5.29.2","keyAttributes");Hc("2.5.29.3","certificatePolicies");Hc("2.5.29.4","keyUsageRestriction");Hc("2.5.29.5","policyMapping");Hc("2.5.29.6","subtreesConstraint");Hc("2.5.29.7","subjectAltName");Hc("2.5.29.8","issuerAltName");Hc("2.5.29.9","subjectDirectoryAttributes");Hc("2.5.29.10","basicConstraints");Hc("2.5.29.11","nameConstraints");Hc("2.5.29.12","policyConstraints");Hc("2.5.29.13","basicConstraints");ir("2.5.29.14","subjectKeyIdentifier");ir("2.5.29.15","keyUsage");Hc("2.5.29.16","privateKeyUsagePeriod");ir("2.5.29.17","subjectAltName");ir("2.5.29.18","issuerAltName");ir("2.5.29.19","basicConstraints");Hc("2.5.29.20","cRLNumber");Hc("2.5.29.21","cRLReason");Hc("2.5.29.22","expirationDate");Hc("2.5.29.23","instructionCode");Hc("2.5.29.24","invalidityDate");Hc("2.5.29.25","cRLDistributionPoints");Hc("2.5.29.26","issuingDistributionPoint");Hc("2.5.29.27","deltaCRLIndicator");Hc("2.5.29.28","issuingDistributionPoint");Hc("2.5.29.29","certificateIssuer");Hc("2.5.29.30","nameConstraints");ir("2.5.29.31","cRLDistributionPoints");ir("2.5.29.32","certificatePolicies");Hc("2.5.29.33","policyMappings");Hc("2.5.29.34","policyConstraints");ir("2.5.29.35","authorityKeyIdentifier");Hc("2.5.29.36","policyConstraints");ir("2.5.29.37","extKeyUsage");Hc("2.5.29.46","freshestCRL");Hc("2.5.29.54","inhibitAnyPolicy");ir("1.3.6.1.4.1.11129.2.4.2","timestampList");ir("1.3.6.1.5.5.7.1.1","authorityInfoAccess");ir("1.3.6.1.5.5.7.3.1","serverAuth");ir("1.3.6.1.5.5.7.3.2","clientAuth");ir("1.3.6.1.5.5.7.3.3","codeSigning");ir("1.3.6.1.5.5.7.3.4","emailProtection");ir("1.3.6.1.5.5.7.3.8","timeStamping")});var R2=I((jsf,kFn)=>{p();var dd=ms();uc();Qj();var rn=kFn.exports=dd.asn1=dd.asn1||{};rn.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};rn.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};rn.maxDepth=256;rn.create=function(t,e,r,n,o){if(dd.util.isArray(n)){for(var s=[],c=0;ce){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}a(APe,"_checkBufferLength");var n1s=a(function(t,e){var r=t.getByte();if(e--,r!==128){var n,o=r&128;if(!o)n=r;else{var s=r&127;APe(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}},"_getValueLength");rn.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),"maxDepth"in e||(e.maxDepth=rn.maxDepth),typeof t=="string"&&(t=dd.util.createBuffer(t));var r=t.length(),n=lot(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var o=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw o.byteCount=r,o.remaining=t.length(),o}return n};function lot(t,e,r,n){if(r>=n.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var o;APe(t,e,2);var s=t.getByte();e--;var c=s&192,l=s&31;o=t.length();var u=n1s(t,e);if(e-=o-t.length(),u!==void 0&&u>e){if(n.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=t.length(),d.remaining=e,d.requested=u,d}u=e}var f,h,m=(s&32)===32;if(m)if(f=[],u===void 0)for(;;){if(APe(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}o=t.length(),f.push(lot(t,e,r+1,n)),e-=o-t.length()}else for(;u>0;)o=t.length(),f.push(lot(t,u,r+1,n)),e-=o-t.length(),u-=o-t.length();if(f===void 0&&c===rn.Class.UNIVERSAL&&l===rn.Type.BITSTRING&&(h=t.bytes(u)),f===void 0&&n.decodeBitStrings&&c===rn.Class.UNIVERSAL&&l===rn.Type.BITSTRING&&u>1){var g=t.read,A=e,y=0;if(l===rn.Type.BITSTRING&&(APe(t,e,1),y=t.getByte(),e--),y===0)try{o=t.length();var E={strict:!0,decodeBitStrings:!0},_=lot(t,e,r+1,E),v=o-t.length();e-=v,l==rn.Type.BITSTRING&&v++;var b=_.tagClass;v===u&&(b===rn.Class.UNIVERSAL||b===rn.Class.CONTEXT_SPECIFIC)&&(f=[_])}catch{}f===void 0&&(t.read=g,e=A)}if(f===void 0){if(u===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");u=e}if(l===rn.Type.BMPSTRING)for(f="";u>0;u-=2)APe(t,e,2),f+=String.fromCharCode(t.getInt16()),e-=2;else f=t.getBytes(u),e-=u}var T=h===void 0?null:{bitStringContents:h};return rn.create(c,l,m,f,T)}a(lot,"_fromDer");rn.toDer=function(t){var e=dd.util.createBuffer(),r=t.tagClass|t.type,n=dd.util.createBuffer(),o=!1;if("bitStringContents"in t&&(o=!0,t.original&&(o=rn.equals(t,t.original))),o)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var s=0;s1&&(t.value.charCodeAt(0)===0&&(t.value.charCodeAt(1)&128)===0||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var c=n.length(),l="";do l+=String.fromCharCode(c&255),c=c>>>8;while(c>0);e.putByte(l.length|128);for(var s=l.length-1;s>=0;--s)e.putByte(l.charCodeAt(s))}return e.putBuffer(n),e};rn.oidToDer=function(t){var e=t.split("."),r=dd.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,o,s,c,l=2;l4294967295)throw new Error("OID value too large; max is 32-bits.");do c=s&127,s=s>>>7,n||(c|=128),o.push(c),n=!1;while(s>0);for(var u=o.length-1;u>=0;--u)r.putByte(o[u])}return r};rn.derToOid=function(t){var e;typeof t=="string"&&(t=dd.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;){if(n>70368744177663)throw new Error("OID value too large; max is 53-bits.");r=t.getByte(),n=n*128,r&128?n+=r&127:(e+="."+(n+r),n=0)}return e};rn.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,o=parseInt(t.substr(4,2),10),s=parseInt(t.substr(6,2),10),c=parseInt(t.substr(8,2),10),l=0;if(t.length>11){var u=t.charAt(10),d=10;u!=="+"&&u!=="-"&&(l=parseInt(t.substr(10,2),10),d+=2)}if(e.setUTCFullYear(r,n,o),e.setUTCHours(s,c,l,0),d&&(u=t.charAt(d),u==="+"||u==="-")){var f=parseInt(t.substr(d+1,2),10),h=parseInt(t.substr(d+4,2),10),m=f*60+h;m*=6e4,u==="+"?e.setTime(+e-m):e.setTime(+e+m)}return e};rn.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,o=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),c=parseInt(t.substr(10,2),10),l=parseInt(t.substr(12,2),10),u=0,d=0,f=!1;t.charAt(t.length-1)==="Z"&&(f=!0);var h=t.length-5,m=t.charAt(h);if(m==="+"||m==="-"){var g=parseInt(t.substr(h+1,2),10),A=parseInt(t.substr(h+4,2),10);d=g*60+A,d*=6e4,m==="+"&&(d*=-1),f=!0}return t.charAt(14)==="."&&(u=parseFloat(t.substr(14),10)*1e3),f?(e.setUTCFullYear(r,n,o),e.setUTCHours(s,c,l,u),e.setTime(+e+d)):(e.setFullYear(r,n,o),e.setHours(s,c,l,u)),e};rn.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};rn.derToInteger=function(t){typeof t=="string"&&(t=dd.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};rn.validate=function(t,e,r,n){var o=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(o=!0,e.value&&dd.util.isArray(e.value))for(var s=0,c=0;o&&c0&&(n+=` `);for(var o="",s=0;s1?n+="0x"+ad.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var d=t.value.charCodeAt(0);d==1?n+=" (1 unused bit shown)":d>1&&(n+=" ("+d+" unused bits shown)")}}else if(t.type===rn.Type.OCTETSTRING)WBn.test(t.value)||(n+="("+t.value+") "),n+="0x"+ad.util.bytesToHex(t.value);else if(t.type===rn.Type.UTF8)try{n+=ad.util.decodeUtf8(t.value)}catch(f){if(f.message==="URI malformed")n+="0x"+ad.util.bytesToHex(t.value)+" (malformed UTF8)";else throw f}else t.type===rn.Type.PRINTABLESTRING||t.type===rn.Type.IA5String?n+=t.value:WBn.test(t.value)?n+="0x"+ad.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var E5=I((Dnf,YBn)=>{p();var Lit=As();YBn.exports=Lit.md=Lit.md||{};Lit.md.algorithms=Lit.md.algorithms||{}});var qfe=I((Mnf,KBn)=>{p();var FF=As();E5();ac();var Kvs=KBn.exports=FF.hmac=FF.hmac||{};Kvs.create=function(){var t=null,e=null,r=null,n=null,o={};return o.start=function(s,c){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in FF.md.algorithms)e=FF.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else e=s;if(c===null)c=t;else{if(typeof c=="string")c=FF.util.createBuffer(c);else if(FF.util.isArray(c)){var l=c;c=FF.util.createBuffer();for(var u=0;ue.blockLength&&(e.start(),e.update(c.bytes()),c=e.digest()),r=FF.util.createBuffer(),n=FF.util.createBuffer(),d=c.length();for(var u=0;u{p();var _5=As();E5();ac();var ZBn=e3n.exports=_5.md5=_5.md5||{};_5.md.md5=_5.md.algorithms.md5=ZBn;ZBn.create=function(){XBn||Jvs();var t=null,e=_5.util.createBuffer(),r=new Array(16),n={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),JBn(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=_5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(drr.substr(0,n.blockLength-c));for(var l,u=0,d=n.fullMessageLength.length-1;d>=0;--d)l=n.fullMessageLength[d]*8+u,u=l/4294967296>>>0,o.putInt32Le(l>>>0);var f={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3};JBn(f,r,o);var h=_5.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},n};var drr=null,Bit=null,Zke=null,jfe=null,XBn=!1;function Jvs(){drr="\x80",drr+=_5.util.fillString("\0",64),Bit=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],Zke=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],jfe=new Array(64);for(var t=0;t<64;++t)jfe[t]=Math.floor(Math.abs(Math.sin(t+1))*4294967296);XBn=!0}a(Jvs,"_init");function JBn(t,e,r){for(var n,o,s,c,l,u,d,f,h=r.length();h>=64;){for(o=t.h0,s=t.h1,c=t.h2,l=t.h3,f=0;f<16;++f)e[f]=r.getInt32Le(),u=l^s&(c^l),n=o+u+jfe[f]+e[f],d=Zke[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<32;++f)u=c^l&(s^c),n=o+u+jfe[f]+e[Bit[f]],d=Zke[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<48;++f)u=s^c^l,n=o+u+jfe[f]+e[Bit[f]],d=Zke[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<64;++f)u=c^(s|~l),n=o+u+jfe[f]+e[Bit[f]],d=Zke[f],o=l,l=c,c=s,s+=n<>>32-d;t.h0=t.h0+o|0,t.h1=t.h1+s|0,t.h2=t.h2+c|0,t.h3=t.h3+l|0,h-=64}}a(JBn,"_update")});var uZ=I((Unf,r3n)=>{p();var Qit=As();ac();var t3n=r3n.exports=Qit.pem=Qit.pem||{};t3n.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r -`,n;if(t.procType&&(n={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]},r+=Uit(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=Uit(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=Uit(n)),t.headers)for(var o=0;o1?n+="0x"+dd.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var d=t.value.charCodeAt(0);d==1?n+=" (1 unused bit shown)":d>1&&(n+=" ("+d+" unused bits shown)")}}else if(t.type===rn.Type.OCTETSTRING)RFn.test(t.value)||(n+="("+t.value+") "),n+="0x"+dd.util.bytesToHex(t.value);else if(t.type===rn.Type.UTF8)try{n+=dd.util.decodeUtf8(t.value)}catch(f){if(f.message==="URI malformed")n+="0x"+dd.util.bytesToHex(t.value)+" (malformed UTF8)";else throw f}else t.type===rn.Type.PRINTABLESTRING||t.type===rn.Type.IA5String?n+=t.value:RFn.test(t.value)?n+="0x"+dd.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var T5=I(($sf,PFn)=>{p();var uot=ms();PFn.exports=uot.md=uot.md||{};uot.md.algorithms=uot.md.algorithms||{}});var rpe=I((Wsf,DFn)=>{p();var WF=ms();T5();uc();var i1s=DFn.exports=WF.hmac=WF.hmac||{};i1s.create=function(){var t=null,e=null,r=null,n=null,o={};return o.start=function(s,c){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in WF.md.algorithms)e=WF.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else e=s;if(c===null)c=t;else{if(typeof c=="string")c=WF.util.createBuffer(c);else if(WF.util.isArray(c)){var l=c;c=WF.util.createBuffer();for(var u=0;ue.blockLength&&(e.start(),e.update(c.bytes()),c=e.digest()),r=WF.util.createBuffer(),n=WF.util.createBuffer(),d=c.length();for(var u=0;u{p();var I5=ms();T5();uc();var MFn=LFn.exports=I5.md5=I5.md5||{};I5.md.md5=I5.md.algorithms.md5=MFn;MFn.create=function(){OFn||o1s();var t=null,e=I5.util.createBuffer(),r=new Array(16),n={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),NFn(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=I5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(nnr.substr(0,n.blockLength-c));for(var l,u=0,d=n.fullMessageLength.length-1;d>=0;--d)l=n.fullMessageLength[d]*8+u,u=l/4294967296>>>0,o.putInt32Le(l>>>0);var f={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3};NFn(f,r,o);var h=I5.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},n};var nnr=null,dot=null,yPe=null,npe=null,OFn=!1;function o1s(){nnr="\x80",nnr+=I5.util.fillString("\0",64),dot=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],yPe=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],npe=new Array(64);for(var t=0;t<64;++t)npe[t]=Math.floor(Math.abs(Math.sin(t+1))*4294967296);OFn=!0}a(o1s,"_init");function NFn(t,e,r){for(var n,o,s,c,l,u,d,f,h=r.length();h>=64;){for(o=t.h0,s=t.h1,c=t.h2,l=t.h3,f=0;f<16;++f)e[f]=r.getInt32Le(),u=l^s&(c^l),n=o+u+npe[f]+e[f],d=yPe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<32;++f)u=c^l&(s^c),n=o+u+npe[f]+e[dot[f]],d=yPe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<48;++f)u=s^c^l,n=o+u+npe[f]+e[dot[f]],d=yPe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<64;++f)u=c^(s|~l),n=o+u+npe[f]+e[dot[f]],d=yPe[f],o=l,l=c,c=s,s+=n<>>32-d;t.h0=t.h0+o|0,t.h1=t.h1+s|0,t.h2=t.h2+c|0,t.h3=t.h3+l|0,h-=64}}a(NFn,"_update")});var _Z=I((Zsf,FFn)=>{p();var hot=ms();uc();var BFn=FFn.exports=hot.pem=hot.pem||{};BFn.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r +`,n;if(t.procType&&(n={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]},r+=pot(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=pot(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=pot(n)),t.headers)for(var o=0;o65&&c!==-1){var l=e[c];l===","?(++c,e=e.substr(0,c)+`\r `+e.substr(c)):e=e.substr(0,c)+`\r -`+l+e.substr(c+1),s=o-c-1,c=-1,++o}else(e[o]===" "||e[o]===" "||e[o]===",")&&(c=o);return e}a(Uit,"foldHeader");function Zvs(t){return t.replace(/^\s+/,"")}a(Zvs,"ltrim")});var Xke=I((jnf,i3n)=>{p();var $d=As();Pit();srr();ac();i3n.exports=$d.des=$d.des||{};$d.des.startEncrypting=function(t,e,r,n){var o=qit({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};$d.des.createEncryptionCipher=function(t,e){return qit({key:t,output:null,decrypt:!1,mode:e})};$d.des.startDecrypting=function(t,e,r,n){var o=qit({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};$d.des.createDecryptionCipher=function(t,e){return qit({key:t,output:null,decrypt:!0,mode:e})};$d.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:a(function(n,o){return n3n(r._keys,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return n3n(r._keys,n,o,!0)},"decrypt")}}),r._init=!1};$d.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=$d.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=aCs(e),this._init=!0}};v5("DES-ECB",$d.cipher.modes.ecb);v5("DES-CBC",$d.cipher.modes.cbc);v5("DES-CFB",$d.cipher.modes.cfb);v5("DES-OFB",$d.cipher.modes.ofb);v5("DES-CTR",$d.cipher.modes.ctr);v5("3DES-ECB",$d.cipher.modes.ecb);v5("3DES-CBC",$d.cipher.modes.cbc);v5("3DES-CFB",$d.cipher.modes.cfb);v5("3DES-OFB",$d.cipher.modes.ofb);v5("3DES-CTR",$d.cipher.modes.ctr);function v5(t,e){var r=a(function(){return new $d.des.Algorithm(t,e)},"factory");$d.cipher.registerAlgorithm(t,r)}a(v5,"registerAlgorithm");var Xvs=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],eCs=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],tCs=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],rCs=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],nCs=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],iCs=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],oCs=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],sCs=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function aCs(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],o=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],c=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],l=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],d=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],m=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],A=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=t.length()>8?3:1,E=[],_=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,b,T=0;T>>4^R)&252645135,R^=b,w^=b<<4,b=(R>>>-16^w)&65535,w^=b,R^=b<<-16,b=(w>>>2^R)&858993459,R^=b,w^=b<<2,b=(R>>>-16^w)&65535,w^=b,R^=b<<-16,b=(w>>>1^R)&1431655765,R^=b,w^=b<<1,b=(R>>>8^w)&16711935,w^=b,R^=b<<8,b=(w>>>1^R)&1431655765,R^=b,w^=b<<1,b=w<<8|R>>>20&240,w=R<<24|R<<8&16711680|R>>>8&65280|R>>>24&240,R=b;for(var x=0;x<_.length;++x){_[x]?(w=w<<2|w>>>26,R=R<<2|R>>>26):(w=w<<1|w>>>27,R=R<<1|R>>>27),w&=-15,R&=-15;var P=e[w>>>28]|r[w>>>24&15]|n[w>>>20&15]|o[w>>>16&15]|s[w>>>12&15]|c[w>>>8&15]|l[w>>>4&15],D=u[R>>>28]|d[R>>>24&15]|f[R>>>20&15]|h[R>>>16&15]|m[R>>>12&15]|g[R>>>8&15]|A[R>>>4&15];b=(D>>>16^P)&65535,E[v++]=P^b,E[v++]=D^b<<16}}return E}a(aCs,"_createKeys");function n3n(t,e,r,n){var o=t.length===32?3:9,s;o===3?s=n?[30,-2,-2]:[0,32,2]:s=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var c,l=e[0],u=e[1];c=(l>>>4^u)&252645135,u^=c,l^=c<<4,c=(l>>>16^u)&65535,u^=c,l^=c<<16,c=(u>>>2^l)&858993459,l^=c,u^=c<<2,c=(u>>>8^l)&16711935,l^=c,u^=c<<8,c=(l>>>1^u)&1431655765,u^=c,l^=c<<1,l=l<<1|l>>>31,u=u<<1|u>>>31;for(var d=0;d>>4|u<<28)^t[m+1];c=l,l=u,u=c^(eCs[g>>>24&63]|rCs[g>>>16&63]|iCs[g>>>8&63]|sCs[g&63]|Xvs[A>>>24&63]|tCs[A>>>16&63]|nCs[A>>>8&63]|oCs[A&63])}c=l,l=u,u=c}l=l>>>1|l<<31,u=u>>>1|u<<31,c=(l>>>1^u)&1431655765,u^=c,l^=c<<1,c=(u>>>8^l)&16711935,l^=c,u^=c<<8,c=(u>>>2^l)&858993459,l^=c,u^=c<<2,c=(l>>>16^u)&65535,u^=c,l^=c<<16,c=(l>>>4^u)&252645135,u^=c,l^=c<<4,r[0]=l,r[1]=u}a(n3n,"_updateBlock");function qit(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=$d.cipher.createDecipher(r,t.key):n=$d.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof $d.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(qit,"_createCipher")});var jit=I(($nf,o3n)=>{p();var sv=As();qfe();E5();ac();var cCs=sv.pkcs5=sv.pkcs5||{},UF;sv.util.isNodejs&&!sv.options.usePureJavaScript&&(UF=require("crypto"));o3n.exports=sv.pbkdf2=cCs.pbkdf2=function(t,e,r,n,o,s){if(typeof o=="function"&&(s=o,o=null),sv.util.isNodejs&&!sv.options.usePureJavaScript&&UF.pbkdf2&&(o===null||typeof o!="object")&&(UF.pbkdf2Sync.length>4||!o||o==="sha1"))return typeof o!="string"&&(o="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?UF.pbkdf2Sync.length===4?UF.pbkdf2(t,e,r,n,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):UF.pbkdf2(t,e,r,n,o,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):UF.pbkdf2Sync.length===4?UF.pbkdf2Sync(t,e,r,n).toString("binary"):UF.pbkdf2Sync(t,e,r,n,o).toString("binary");if((typeof o>"u"||o===null)&&(o="sha1"),typeof o=="string"){if(!(o in sv.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=sv.md[o].create()}var c=o.digestLength;if(n>4294967295*c){var l=new Error("Derived key is too long.");if(s)return s(l);throw l}var u=Math.ceil(n/c),d=n-(u-1)*c,f=sv.hmac.create();f.start(o,t);var h="",m,g,A;if(!s){for(var y=1;y<=u;++y){f.start(null,null),f.update(e),f.update(sv.util.int32ToBytes(y)),m=A=f.digest().getBytes();for(var E=2;E<=r;++E)f.start(null,null),f.update(A),g=f.digest().getBytes(),m=sv.util.xorBytes(m,g,c),A=g;h+=yu)return s(null,h);f.start(null,null),f.update(e),f.update(sv.util.int32ToBytes(y)),m=A=f.digest().getBytes(),E=2,v()}a(_,"outer");function v(){if(E<=r)return f.start(null,null),f.update(A),g=f.digest().getBytes(),m=sv.util.xorBytes(m,g,c),A=g,++E,sv.util.setImmediate(v);h+=y{p();var C5=As();E5();ac();var a3n=u3n.exports=C5.sha256=C5.sha256||{};C5.md.sha256=C5.md.algorithms.sha256=a3n;a3n.create=function(){c3n||lCs();var t=null,e=C5.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),s3n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=C5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(frr.substr(0,n.blockLength-c));for(var l,u,d=n.fullMessageLength[0]*8,f=0;f>>0,d+=u,o.putInt32(d>>>0),d=l>>>0;o.putInt32(d);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};s3n(h,r,o);var m=C5.util.createBuffer();return m.putInt32(h.h0),m.putInt32(h.h1),m.putInt32(h.h2),m.putInt32(h.h3),m.putInt32(h.h4),m.putInt32(h.h5),m.putInt32(h.h6),m.putInt32(h.h7),m},n};var frr=null,c3n=!1,l3n=null;function lCs(){frr="\x80",frr+=C5.util.fillString("\0",64),l3n=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],c3n=!0}a(lCs,"_init");function s3n(t,e,r){for(var n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v=r.length();v>=64;){for(d=0;d<16;++d)e[d]=r.getInt32();for(;d<64;++d)n=e[d-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,o=e[d-15],o=(o>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,e[d]=n+e[d-7]+o+e[d-16]|0;for(f=t.h0,h=t.h1,m=t.h2,g=t.h3,A=t.h4,y=t.h5,E=t.h6,_=t.h7,d=0;d<64;++d)c=(A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7),l=E^A&(y^E),s=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),u=f&h|m&(f^h),n=_+c+l+l3n[d]+e[d],o=s+u,_=E,E=y,y=A,A=g+n>>>0,g=m,m=h,h=f,f=n+o>>>0;t.h0=t.h0+f|0,t.h1=t.h1+h|0,t.h2=t.h2+m|0,t.h3=t.h3+g|0,t.h4=t.h4+A|0,t.h5=t.h5+y|0,t.h6=t.h6+E|0,t.h7=t.h7+_|0,v-=64}}a(s3n,"_update")});var hrr=I((Jnf,d3n)=>{p();var b5=As();ac();var Hit=null;b5.util.isNodejs&&!b5.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Hit=require("crypto"));var uCs=d3n.exports=b5.prng=b5.prng||{};uCs.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),o=0;o<32;++o)n[o]=r.create();e.pools=n,e.pool=0,e.generate=function(d,f){if(!f)return e.generateSync(d);var h=e.plugin.cipher,m=e.plugin.increment,g=e.plugin.formatKey,A=e.plugin.formatSeed,y=b5.util.createBuffer();e.key=null,E();function E(_){if(_)return f(_);if(y.length()>=d)return f(null,y.getBytes(d));if(e.generated>1048575&&(e.key=null),e.key===null)return b5.util.nextTick(function(){s(E)});var v=h(e.key,e.seed);e.generated+=v.length,y.putBytes(v),e.key=g(h(e.key,m(e.seed))),e.seed=A(h(e.key,e.seed)),b5.util.setImmediate(E)}a(E,"generate")},e.generateSync=function(d){var f=e.plugin.cipher,h=e.plugin.increment,m=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var A=b5.util.createBuffer();A.length()1048575&&(e.key=null),e.key===null&&c();var y=f(e.key,e.seed);e.generated+=y.length,A.putBytes(y),e.key=m(f(e.key,h(e.seed))),e.seed=g(f(e.key,e.seed))}return A.getBytes(d)};function s(d){if(e.pools[0].messageLength>=32)return l(),d();var f=32-e.pools[0].messageLength<<5;e.seedFile(f,function(h,m){if(h)return d(h);e.collect(m),l(),d()})}a(s,"_reseed");function c(){if(e.pools[0].messageLength>=32)return l();var d=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(d)),l()}a(c,"_reseedSync");function l(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var d=e.plugin.md.create();d.update(e.keyBytes);for(var f=1,h=0;h<32;++h)e.reseeds%f===0&&(d.update(e.pools[h].digest().getBytes()),e.pools[h].start()),f=f<<1;e.keyBytes=d.digest().getBytes(),d.start(),d.update(e.keyBytes);var m=d.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(m),e.generated=0}a(l,"_seed");function u(d){var f=null,h=b5.util.globalScope,m=h.crypto||h.msCrypto;m&&m.getRandomValues&&(f=a(function(w){return m.getRandomValues(w)},"getRandomValues"));var g=b5.util.createBuffer();if(f)for(;g.length()>16),v+=(_&32767)<<16,v+=_>>15,v=(v&2147483647)+(v>>31),T=v&4294967295;for(var E=0;E<3;++E)b=T>>>(E<<3),b^=Math.floor(Math.random()*256),g.putByte(b&255)}return g.getBytes(d)}return a(u,"defaultSeedFile"),Hit?(e.seedFile=function(d,f){Hit.randomBytes(d,function(h,m){if(h)return f(h);f(null,m.toString())})},e.seedFileSync=function(d){return Hit.randomBytes(d).toString()}):(e.seedFile=function(d,f){try{f(null,u(d))}catch(h){f(h)}},e.seedFileSync=u),e.collect=function(d){for(var f=d.length,h=0;h>m&255);e.collect(h)},e.registerWorker=function(d){if(d===self)e.seedFile=function(h,m){function g(A){var y=A.data;y.forge&&y.forge.prng&&(self.removeEventListener("message",g),m(y.forge.prng.err,y.forge.prng.bytes))}a(g,"listener"),self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:h}}})};else{var f=a(function(h){var m=h.data;m.forge&&m.forge.prng&&e.seedFile(m.forge.prng.needed,function(g,A){d.postMessage({forge:{prng:{err:g,bytes:A}}})})},"listener");d.addEventListener("message",f)}},e}});var xw=I((eif,mrr)=>{p();var Pg=As();Tj();prr();hrr();ac();(function(){if(Pg.random&&Pg.random.getBytes){mrr.exports=Pg.random;return}(function(t){var e={},r=new Array(4),n=Pg.util.createBuffer();e.formatKey=function(h){var m=Pg.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),Pg.aes._expandKey(h,!1)},e.formatSeed=function(h){var m=Pg.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),h},e.cipher=function(h,m){return Pg.aes._updateBlock(h,m,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=Pg.md.sha256;function o(){var h=Pg.prng.create(e);return h.getBytes=function(m,g){return h.generate(m,g)},h.getBytesSync=function(m){return h.generate(m)},h}a(o,"spawnPrng");var s=o(),c=null,l=Pg.util.globalScope,u=l.crypto||l.msCrypto;if(u&&u.getRandomValues&&(c=a(function(h){return u.getRandomValues(h)},"getRandomValues")),Pg.options.usePureJavaScript||!Pg.util.isNodejs&&!c){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var d="";for(var f in navigator)try{typeof navigator[f]=="string"&&(d+=navigator[f])}catch{}s.collect(d),d=null}t&&(t().mousemove(function(h){s.collectInt(h.clientX,16),s.collectInt(h.clientY,16)}),t().keypress(function(h){s.collectInt(h.charCode,8)}))}if(!Pg.random)Pg.random=s;else for(var f in s)Pg.random[f]=s[f];Pg.random.createInstance=o,mrr.exports=Pg.random})(typeof jQuery<"u"?jQuery:null)})()});var Arr=I((nif,h3n)=>{p();var lb=As();ac();var grr=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],f3n=[1,2,3,5],dCs=a(function(t,e){return t<>16-e},"rol"),fCs=a(function(t,e){return(t&65535)>>e|t<<16-e&65535},"ror");h3n.exports=lb.rc2=lb.rc2||{};lb.rc2.expandKey=function(t,e){typeof t=="string"&&(t=lb.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),o=e,s=Math.ceil(o/8),c=255>>(o&7),l;for(l=n;l<128;l++)r.putByte(grr[r.at(l-1)+r.at(l-n)&255]);for(r.setAt(128-s,grr[r.at(128-s)&c]),l=127-s;l>=0;l--)r.setAt(l,grr[r.at(l+1)^r.at(l+s)]);return r};var p3n=a(function(t,e,r){var n=!1,o=null,s=null,c=null,l,u,d,f,h=[];for(t=lb.rc2.expandKey(t,e),d=0;d<64;d++)h.push(t.getInt16Le());r?(l=a(function(A){for(d=0;d<4;d++)A[d]+=h[f]+(A[(d+3)%4]&A[(d+2)%4])+(~A[(d+3)%4]&A[(d+1)%4]),A[d]=dCs(A[d],f3n[d]),f++},"mixRound"),u=a(function(A){for(d=0;d<4;d++)A[d]+=h[A[(d+3)%4]&63]},"mashRound")):(l=a(function(A){for(d=3;d>=0;d--)A[d]=fCs(A[d],f3n[d]),A[d]-=h[f]+(A[(d+3)%4]&A[(d+2)%4])+(~A[(d+3)%4]&A[(d+1)%4]),f--},"mixRound"),u=a(function(A){for(d=3;d>=0;d--)A[d]-=h[A[(d+3)%4]&63]},"mashRound"));var m=a(function(A){var y=[];for(d=0;d<4;d++){var E=o.getInt16Le();c!==null&&(r?E^=c.getInt16Le():c.putInt16Le(E)),y.push(E&65535)}f=r?0:63;for(var _=0;_=8;)m([[5,l],[1,u],[6,l],[1,u],[5,l]])},"update"),finish:a(function(A){var y=!0;if(r)if(A)y=A(8,o,!r);else{var E=o.length()===8?8:8-o.length();o.fillWithByte(E,E)}if(y&&(n=!0,g.update()),!r&&(y=o.length()===0,y))if(A)y=A(8,s,!r);else{var _=s.length(),v=s.at(_-1);v>_?y=!1:s.truncate(v)}return y},"finish")},g},"createCipher");lb.rc2.startEncrypting=function(t,e,r){var n=lb.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};lb.rc2.createEncryptionCipher=function(t,e){return p3n(t,e,!0)};lb.rc2.startDecrypting=function(t,e,r){var n=lb.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};lb.rc2.createDecryptionCipher=function(t,e){return p3n(t,e,!1)}});var tPe=I((sif,C3n)=>{p();var yrr=As();C3n.exports=yrr.jsbn=yrr.jsbn||{};var QF,pCs=0xdeadbeefcafe,m3n=(pCs&16777215)==15715070;function zt(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}a(zt,"BigInteger");yrr.jsbn.BigInteger=zt;function Va(){return new zt(null)}a(Va,"nbi");function hCs(t,e,r,n,o,s){for(;--s>=0;){var c=e*this.data[t++]+r.data[n]+o;o=Math.floor(c/67108864),r.data[n++]=c&67108863}return o}a(hCs,"am1");function mCs(t,e,r,n,o,s){for(var c=e&32767,l=e>>15;--s>=0;){var u=this.data[t]&32767,d=this.data[t++]>>15,f=l*u+d*c;u=c*u+((f&32767)<<15)+r.data[n]+(o&1073741823),o=(u>>>30)+(f>>>15)+l*d+(o>>>30),r.data[n++]=u&1073741823}return o}a(mCs,"am2");function g3n(t,e,r,n,o,s){for(var c=e&16383,l=e>>14;--s>=0;){var u=this.data[t]&16383,d=this.data[t++]>>14,f=l*u+d*c;u=c*u+((f&16383)<<14)+r.data[n]+o,o=(u>>28)+(f>>14)+l*d,r.data[n++]=u&268435455}return o}a(g3n,"am3");typeof navigator>"u"?(zt.prototype.am=g3n,QF=28):m3n&&navigator.appName=="Microsoft Internet Explorer"?(zt.prototype.am=mCs,QF=30):m3n&&navigator.appName!="Netscape"?(zt.prototype.am=hCs,QF=26):(zt.prototype.am=g3n,QF=28);zt.prototype.DB=QF;zt.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}a(ACs,"bnpCopyTo");function yCs(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}a(yCs,"bnpFromInt");function xj(t){var e=Va();return e.fromInt(t),e}a(xj,"nbv");function ECs(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,o=!1,s=0;--n>=0;){var c=r==8?t[n]&255:y3n(t,n);if(c<0){t.charAt(n)=="-"&&(o=!0);continue}o=!1,s==0?this.data[this.t++]=c:s+r>this.DB?(this.data[this.t-1]|=(c&(1<>this.DB-s):this.data[this.t-1]|=c<=this.DB&&(s-=this.DB)}r==8&&(t[0]&128)!=0&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}a(_Cs,"bnpClamp");function vCs(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(l>l)>0&&(o=!0,s=A3n(n));c>=0;)l>(l+=this.DB-e)):(n=this.data[c]>>(l-=e)&r,l<=0&&(l+=this.DB,--c)),n>0&&(o=!0),o&&(s+=A3n(n));return o?s:"0"}a(vCs,"bnToString");function CCs(){var t=Va();return zt.ZERO.subTo(this,t),t}a(CCs,"bnNegate");function bCs(){return this.s<0?this.negate():this}a(bCs,"bnAbs");function SCs(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}a(SCs,"bnCompareTo");function $it(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}a($it,"nbits");function TCs(){return this.t<=0?0:this.DB*(this.t-1)+$it(this.data[this.t-1]^this.s&this.DM)}a(TCs,"bnBitLength");function ICs(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}a(ICs,"bnpDLShiftTo");function xCs(t,e){for(var r=t;r=0;--l)e.data[l+s+1]=this.data[l]>>n|c,c=(this.data[l]&o)<=0;--l)e.data[l]=0;e.data[s]=c,e.t=this.t+s+1,e.s=this.s,e.clamp()}a(wCs,"bnpLShiftTo");function RCs(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,o=this.DB-n,s=(1<>n;for(var c=r+1;c>n;n>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}a(kCs,"bnpSubTo");function PCs(t,e){var r=this.abs(),n=t.abs(),o=r.t;for(e.t=o+n.t;--o>=0;)e.data[o]=0;for(o=0;o=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}a(DCs,"bnpSquareTo");function NCs(t,e,r){var n=t.abs();if(!(n.t<=0)){var o=this.abs();if(o.t0?(n.lShiftTo(u,s),o.lShiftTo(u,r)):(n.copyTo(s),o.copyTo(r));var d=s.t,f=s.data[d-1];if(f!=0){var h=f*(1<1?s.data[d-2]>>this.F2:0),m=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(_,r)),zt.ONE.dlShiftTo(d,_),_.subTo(s,s);s.t=0;){var v=r.data[--y]==f?this.DM:Math.floor(r.data[y]*m+(r.data[y-1]+A)*g);if((r.data[y]+=s.am(0,v,r,E,0,d))0&&r.rShiftTo(u,r),c<0&&zt.ZERO.subTo(r,r)}}}a(NCs,"bnpDivRemTo");function MCs(t){var e=Va();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(zt.ZERO)>0&&t.subTo(e,e),e}a(MCs,"bnMod");function dZ(t){this.m=t}a(dZ,"Classic");function OCs(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}a(OCs,"cConvert");function LCs(t){return t}a(LCs,"cRevert");function BCs(t){t.divRemTo(this.m,null,t)}a(BCs,"cReduce");function FCs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(FCs,"cMulTo");function UCs(t,e){t.squareTo(e),this.reduce(e)}a(UCs,"cSqrTo");dZ.prototype.convert=OCs;dZ.prototype.revert=LCs;dZ.prototype.reduce=BCs;dZ.prototype.mulTo=FCs;dZ.prototype.sqrTo=UCs;function QCs(){if(this.t<1)return 0;var t=this.data[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}a(QCs,"bnpInvDigit");function fZ(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}a(qCs,"montConvert");function jCs(t){var e=Va();return t.copyTo(e),this.reduce(e),e}a(jCs,"montRevert");function HCs(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}a(HCs,"montReduce");function GCs(t,e){t.squareTo(e),this.reduce(e)}a(GCs,"montSqrTo");function $Cs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a($Cs,"montMulTo");fZ.prototype.convert=qCs;fZ.prototype.revert=jCs;fZ.prototype.reduce=HCs;fZ.prototype.mulTo=$Cs;fZ.prototype.sqrTo=GCs;function VCs(){return(this.t>0?this.data[0]&1:this.s)==0}a(VCs,"bnpIsEven");function WCs(t,e){if(t>4294967295||t<1)return zt.ONE;var r=Va(),n=Va(),o=e.convert(this),s=$it(t)-1;for(o.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,o,r);else{var c=r;r=n,n=c}return e.revert(r)}a(WCs,"bnpExp");function zCs(t,e){var r;return t<256||e.isEven()?r=new dZ(e):r=new fZ(e),this.exp(t,r)}a(zCs,"bnModPowInt");zt.prototype.copyTo=ACs;zt.prototype.fromInt=yCs;zt.prototype.fromString=ECs;zt.prototype.clamp=_Cs;zt.prototype.dlShiftTo=ICs;zt.prototype.drShiftTo=xCs;zt.prototype.lShiftTo=wCs;zt.prototype.rShiftTo=RCs;zt.prototype.subTo=kCs;zt.prototype.multiplyTo=PCs;zt.prototype.squareTo=DCs;zt.prototype.divRemTo=NCs;zt.prototype.invDigit=QCs;zt.prototype.isEven=VCs;zt.prototype.exp=WCs;zt.prototype.toString=vCs;zt.prototype.negate=CCs;zt.prototype.abs=bCs;zt.prototype.compareTo=SCs;zt.prototype.bitLength=TCs;zt.prototype.mod=MCs;zt.prototype.modPowInt=zCs;zt.ZERO=xj(0);zt.ONE=xj(1);function YCs(){var t=Va();return this.copyTo(t),t}a(YCs,"bnClone");function KCs(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}a(JCs,"bnByteValue");function ZCs(){return this.t==0?this.s:this.data[0]<<16>>16}a(ZCs,"bnShortValue");function XCs(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}a(XCs,"bnpChunkSize");function ebs(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}a(ebs,"bnSigNum");function tbs(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=xj(r),o=Va(),s=Va(),c="";for(this.divRemTo(n,o,s);o.signum()>0;)c=(r+s.intValue()).toString(t).substr(1)+c,o.divRemTo(n,o,s);return s.intValue().toString(t)+c}a(tbs,"bnpToRadix");function rbs(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),o=!1,s=0,c=0,l=0;l=r&&(this.dMultiply(n),this.dAddOffset(c,0),s=0,c=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(c,0)),o&&zt.ZERO.subTo(this,this)}a(rbs,"bnpFromRadix");function nbs(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(zt.ONE.shiftLeft(t-1),_rr,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(zt.ONE.shiftLeft(t-1),this);else{var n=new Array,o=t&7;n.length=(t>>3)+1,e.nextBytes(n),o>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[o++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),(n&128)!=0&&(n|=-256),o==0&&(this.s&128)!=(n&128)&&++o,(o>0||n!=this.s)&&(e[o++]=n);return e}a(ibs,"bnToByteArray");function obs(t){return this.compareTo(t)==0}a(obs,"bnEquals");function sbs(t){return this.compareTo(t)<0?this:t}a(sbs,"bnMin");function abs(t){return this.compareTo(t)>0?this:t}a(abs,"bnMax");function cbs(t,e,r){var n,o,s=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),(t&255)==0&&(t>>=8,e+=8),(t&15)==0&&(t>>=4,e+=4),(t&3)==0&&(t>>=2,e+=2),(t&1)==0&&++e,e}a(Abs,"lbit");function ybs(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}a(Ibs,"bnpAddTo");function xbs(t){var e=Va();return this.addTo(t,e),e}a(xbs,"bnAdd");function wbs(t){var e=Va();return this.subTo(t,e),e}a(wbs,"bnSubtract");function Rbs(t){var e=Va();return this.multiplyTo(t,e),e}a(Rbs,"bnMultiply");function kbs(){var t=Va();return this.squareTo(t),t}a(kbs,"bnSquare");function Pbs(t){var e=Va();return this.divRemTo(t,e,null),e}a(Pbs,"bnDivide");function Dbs(t){var e=Va();return this.divRemTo(t,null,e),e}a(Dbs,"bnRemainder");function Nbs(t){var e=Va(),r=Va();return this.divRemTo(t,e,r),new Array(e,r)}a(Nbs,"bnDivideAndRemainder");function Mbs(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}a(Mbs,"bnpDMultiply");function Obs(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}a(Obs,"bnpDAddOffset");function ePe(){}a(ePe,"NullExp");function v3n(t){return t}a(v3n,"nNop");function Lbs(t,e,r){t.multiplyTo(e,r)}a(Lbs,"nMulTo");function Bbs(t,e){t.squareTo(e)}a(Bbs,"nSqrTo");ePe.prototype.convert=v3n;ePe.prototype.revert=v3n;ePe.prototype.mulTo=Lbs;ePe.prototype.sqrTo=Bbs;function Fbs(t){return this.exp(t,new ePe)}a(Fbs,"bnPow");function Ubs(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var o;for(o=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=Va();return t.copyTo(e),this.reduce(e),e}a(qbs,"barrettConvert");function jbs(t){return t}a(jbs,"barrettRevert");function Hbs(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}a(Hbs,"barrettReduce");function Gbs(t,e){t.squareTo(e),this.reduce(e)}a(Gbs,"barrettSqrTo");function $bs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a($bs,"barrettMulTo");Gfe.prototype.convert=qbs;Gfe.prototype.revert=jbs;Gfe.prototype.reduce=Hbs;Gfe.prototype.mulTo=$bs;Gfe.prototype.sqrTo=Gbs;function Vbs(t,e){var r=t.bitLength(),n,o=xj(1),s;if(r<=0)return o;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new dZ(e):e.isEven()?s=new Gfe(e):s=new fZ(e);var c=new Array,l=3,u=n-1,d=(1<1){var f=Va();for(s.sqrTo(c[1],f);l<=d;)c[l]=Va(),s.mulTo(f,c[l-2],c[l]),l+=2}var h=t.t-1,m,g=!0,A=Va(),y;for(r=$it(t.data[h])-1;h>=0;){for(r>=u?m=t.data[h]>>r-u&d:(m=(t.data[h]&(1<0&&(m|=t.data[h-1]>>this.DB+r-u)),l=n;(m&1)==0;)m>>=1,--l;if((r-=l)<0&&(r+=this.DB,--h),g)c[m].copyTo(o),g=!1;else{for(;l>1;)s.sqrTo(o,A),s.sqrTo(A,o),l-=2;l>0?s.sqrTo(o,A):(y=o,o=A,A=y),s.mulTo(A,c[m],o)}for(;h>=0&&(t.data[h]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(o=e.getLowestSetBit())>0&&e.rShiftTo(o,e),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}a(Wbs,"bnGCD");function zbs(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}a(zbs,"bnpModInt");function Ybs(t){if(this.signum()==0)return zt.ZERO;var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return zt.ZERO;for(var r=t.clone(),n=this.clone(),o=xj(1),s=xj(0),c=xj(0),l=xj(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!o.isEven()||!s.isEven())&&(o.addTo(this,o),s.subTo(t,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!c.isEven()||!l.isEven())&&(c.addTo(this,c),l.subTo(t,l)),c.rShiftTo(1,c)):l.isEven()||l.subTo(t,l),l.rShiftTo(1,l);r.compareTo(n)>=0?(r.subTo(n,r),e&&o.subTo(c,o),s.subTo(l,s)):(n.subTo(r,n),e&&c.subTo(o,c),l.subTo(s,l))}if(n.compareTo(zt.ONE)!=0)return zt.ZERO;if(l.compareTo(t)>=0)return l.subtract(t);if(l.signum()<0)l.addTo(t,l);else return l;return l.signum()<0?l.add(t):l}a(Ybs,"bnModInverse");var C2=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Kbs=(1<<26)/C2[C2.length-1];function Jbs(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=C2[C2.length-1]){for(e=0;e=0);var l=s.modPow(n,this);if(l.compareTo(zt.ONE)!=0&&l.compareTo(e)!=0){for(var u=1;u++{p();var S5=As();E5();ac();var S3n=I3n.exports=S5.sha1=S5.sha1||{};S5.md.sha1=S5.md.algorithms.sha1=S3n;S3n.create=function(){T3n||e1s();var t=null,e=S5.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),b3n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=S5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(vrr.substr(0,n.blockLength-c));for(var l,u,d=n.fullMessageLength[0]*8,f=0;f>>0,d+=u,o.putInt32(d>>>0),d=l>>>0;o.putInt32(d);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};b3n(h,r,o);var m=S5.util.createBuffer();return m.putInt32(h.h0),m.putInt32(h.h1),m.putInt32(h.h2),m.putInt32(h.h3),m.putInt32(h.h4),m},n};var vrr=null,T3n=!1;function e1s(){vrr="\x80",vrr+=S5.util.fillString("\0",64),T3n=!0}a(e1s,"_init");function b3n(t,e,r){for(var n,o,s,c,l,u,d,f,h=r.length();h>=64;){for(o=t.h0,s=t.h1,c=t.h2,l=t.h3,u=t.h4,f=0;f<16;++f)n=r.getInt32(),e[f]=n,d=l^s&(c^l),n=(o<<5|o>>>27)+d+u+1518500249+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<20;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,d=l^s&(c^l),n=(o<<5|o>>>27)+d+u+1518500249+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<32;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+1859775393+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<40;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+1859775393+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<60;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s&c|l&(s^c),n=(o<<5|o>>>27)+d+u+2400959708+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<80;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+3395469782+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;t.h0=t.h0+o|0,t.h1=t.h1+s|0,t.h2=t.h2+c|0,t.h3=t.h3+l|0,t.h4=t.h4+u|0,h-=64}}a(b3n,"_update")});var Crr=I((fif,w3n)=>{p();var T5=As();ac();xw();$fe();var x3n=w3n.exports=T5.pkcs1=T5.pkcs1||{};x3n.encode_rsa_oaep=function(t,e,r){var n,o,s,c;typeof r=="string"?(n=r,o=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,o=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),s?s.start():s=T5.md.sha1.create(),c||(c=s);var l=Math.ceil(t.n.bitLength()/8),u=l-2*s.digestLength-2;if(e.length>u){var d=new Error("RSAES-OAEP input message length is too long.");throw d.length=e.length,d.maxLength=u,d}n||(n=""),s.update(n,"raw");for(var f=s.digest(),h="",m=u-e.length,g=0;g>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+c),n+=r.digest().getBytes()}return n.substring(0,e)}a(Vit,"rsa_mgf1")});var Srr=I((mif,brr)=>{p();var wj=As();ac();tPe();xw();(function(){if(wj.prime){brr.exports=wj.prime;return}var t=brr.exports=wj.prime=wj.prime||{},e=wj.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var o=a(function(h,m){return h|m},"op_or");t.generateProbablePrime=function(h,m,g){typeof m=="function"&&(g=m,m={}),m=m||{};var A=m.algorithm||"PRIMEINC";typeof A=="string"&&(A={name:A}),A.options=A.options||{};var y=m.prng||wj.random,E={nextBytes:a(function(_){for(var v=y.getBytesSync(_.length),b=0;b<_.length;++b)_[b]=v.charCodeAt(b)},"nextBytes")};if(A.name==="PRIMEINC")return s(h,E,A.options,g);throw new Error("Invalid prime generation algorithm: "+A.name)};function s(h,m,g,A){return"workers"in g?u(h,m,g,A):c(h,m,g,A)}a(s,"primeincFindPrime");function c(h,m,g,A){var y=d(h,m),E=0,_=f(y.bitLength());"millerRabinTests"in g&&(_=g.millerRabinTests);var v=10;"maxBlockTime"in g&&(v=g.maxBlockTime),l(y,h,m,E,_,v,A)}a(c,"primeincFindPrimeWithoutWorkers");function l(h,m,g,A,y,E,_){var v=+new Date;do{if(h.bitLength()>m&&(h=d(m,g)),h.isProbablePrime(y))return _(null,h);h.dAddOffset(r[A++%8],0)}while(E<0||+new Date-v"u")return c(h,m,g,A);var y=d(h,m),E=g.workers,_=g.workLoad||100,v=_*30/8,b=g.workerScript||"forge/prime.worker.js";if(E===-1)return wj.util.estimateCores(function(w,R){w&&(R=2),E=R-1,T()});T();function T(){E=Math.max(1,E);for(var w=[],R=0;Rh&&(y=d(h,m));var q=y.toString(16);N.target.postMessage({hex:q,workLoad:_}),y.dAddOffset(v,0)}}a(D,"workerMessage")}a(T,"generate")}a(u,"primeincFindPrimeWithWorkers");function d(h,m){var g=new e(h,m),A=h-1;return g.testBit(A)||g.bitwiseTo(e.ONE.shiftLeft(A),o,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}a(d,"generateRandom");function f(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}a(f,"getMillerRabinTests")})()});var rPe=I((yif,O3n)=>{p();var Ci=As();v2();tPe();Ij();Crr();Srr();xw();ac();typeof Wa>"u"&&(Wa=Ci.jsbn.BigInteger);var Wa,Trr=Ci.util.isNodejs?require("crypto"):null,pt=Ci.asn1,Rw=Ci.util;Ci.pki=Ci.pki||{};O3n.exports=Ci.pki.rsa=Ci.rsa=Ci.rsa||{};var qo=Ci.pki,t1s=[6,4,2,4,2,4,6,2],r1s={name:"PrivateKeyInfo",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},n1s={name:"RSAPrivateKey",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},i1s={name:"RSAPublicKey",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},o1s=Ci.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:pt.Class.UNIVERSAL,type:pt.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},s1s={name:"DigestInfo",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:pt.Class.UNIVERSAL,type:pt.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},a1s=a(function(t){var e;if(t.algorithm in qo.oids)e=qo.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=pt.oidToDer(e).getBytes(),o=pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[]),s=pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[]);s.value.push(pt.create(pt.Class.UNIVERSAL,pt.Type.OID,!1,n)),s.value.push(pt.create(pt.Class.UNIVERSAL,pt.Type.NULL,!1,""));var c=pt.create(pt.Class.UNIVERSAL,pt.Type.OCTETSTRING,!1,t.digest().getBytes());return o.value.push(s),o.value.push(c),pt.toDer(o).getBytes()},"emsaPkcs1v15encode"),N3n=a(function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(Wa.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(Wa.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new Wa(Ci.util.bytesToHex(Ci.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(Wa.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var o=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);o.compareTo(s)<0;)o=o.add(e.p);var c=o.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return c=c.multiply(n.modInverse(e.n)).mod(e.n),c},"_modPow");qo.rsa.encrypt=function(t,e,r){var n=r,o,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,o=M3n(t,e,r)):(o=Ci.util.createBuffer(),o.putBytes(t));for(var c=new Wa(o.toHex(),16),l=N3n(c,e,n),u=l.toString(16),d=Ci.util.createBuffer(),f=s-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(Ci.util.hexToBytes(u)),d.getBytes()};qo.rsa.decrypt=function(t,e,r,n){var o=Math.ceil(e.n.bitLength()/8);if(t.length!==o){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=o,s}var c=new Wa(Ci.util.createBuffer(t).toHex(),16);if(c.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=N3n(c,e,r),u=l.toString(16),d=Ci.util.createBuffer(),f=o-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(Ci.util.hexToBytes(u)),n!==!1?Wit(d.getBytes(),e,r):d.getBytes()};qo.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||Ci.random,o={nextBytes:a(function(l){for(var u=n.getBytesSync(l.length),d=0;d>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},c.e.fromInt(c.eInt);else throw new Error("Invalid key generation algorithm: "+s);return c};qo.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new Wa(null);r.fromInt(30);for(var n=0,o=a(function(h,m){return h|m},"op_or"),s=+new Date,c,l=0;t.keys===null&&(e<=0||lu?t.pqState=0:t.num.isProbablePrime(l1s(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(t1s[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(Wa.ONE).gcd(t.e).compareTo(Wa.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(Wa.ONE),t.q1=t.q.subtract(Wa.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(Wa.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var f=t.e.modInverse(t.phi);t.keys={privateKey:qo.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:qo.rsa.setPublicKey(t.n,t.e)}}c=+new Date,l+=c-s,s=c}return t.keys!==null};qo.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!Ci.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(R3n("generateKeyPair"))return Trr.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(l,u,d){if(l)return n(l);n(null,{privateKey:qo.privateKeyFromPem(d),publicKey:qo.publicKeyFromPem(u)})});if(k3n("generateKey")&&k3n("exportKey"))return Rw.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:D3n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(l){return Rw.globalScope.crypto.subtle.exportKey("pkcs8",l.privateKey)}).then(void 0,function(l){n(l)}).then(function(l){if(l){var u=qo.privateKeyFromAsn1(pt.fromDer(Ci.util.createBuffer(l)));n(null,{privateKey:u,publicKey:qo.setRsaPublicKey(u.n,u.e)})}});if(P3n("generateKey")&&P3n("exportKey")){var o=Rw.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:D3n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);o.oncomplete=function(l){var u=l.target.result,d=Rw.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);d.oncomplete=function(f){var h=f.target.result,m=qo.privateKeyFromAsn1(pt.fromDer(Ci.util.createBuffer(h)));n(null,{privateKey:m,publicKey:qo.setRsaPublicKey(m.n,m.e)})},d.onerror=function(f){n(f)}},o.onerror=function(l){n(l)};return}}else if(R3n("generateKeyPairSync")){var s=Trr.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:qo.privateKeyFromPem(s.privateKey),publicKey:qo.publicKeyFromPem(s.publicKey)}}}var c=qo.rsa.createKeyPairGenerationState(t,e,r);if(!n)return qo.rsa.stepKeyPairGenerationState(c,0),c.keys;c1s(c,r,n)};qo.setRsaPublicKey=qo.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,o,s){if(typeof o=="string"?o=o.toUpperCase():o===void 0&&(o="RSAES-PKCS1-V1_5"),o==="RSAES-PKCS1-V1_5")o={encode:a(function(l,u,d){return M3n(l,u,2).getBytes()},"encode")};else if(o==="RSA-OAEP"||o==="RSAES-OAEP")o={encode:a(function(l,u){return Ci.pkcs1.encode_rsa_oaep(u,l,s)},"encode")};else if(["RAW","NONE","NULL",null].indexOf(o)!==-1)o={encode:a(function(l){return l},"encode")};else if(typeof o=="string")throw new Error('Unsupported encryption scheme: "'+o+'".');var c=o.encode(n,r,!0);return qo.rsa.encrypt(c,r,!0)},r.verify=function(n,o,s,c){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),c===void 0&&(c={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in c||(c._parseAllDigestBytes=!0),"_skipPaddingChecks"in c||(c._skipPaddingChecks=!1),s==="RSASSA-PKCS1-V1_5"?s={verify:a(function(u,d){d=Wit(d,r,!0,void 0,c);var f=pt.fromDer(d,{parseAllBytes:c._parseAllDigestBytes}),h={},m=[];if(!pt.validate(f,s1s,h,m)||f.value.length!==2){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=m,g}var A=pt.derToOid(h.algorithmIdentifier);if(!(A===Ci.oids.md2||A===Ci.oids.md5||A===Ci.oids.sha1||A===Ci.oids.sha224||A===Ci.oids.sha256||A===Ci.oids.sha384||A===Ci.oids.sha512||A===Ci.oids["sha512-224"]||A===Ci.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=A,g}if((A===Ci.oids.md2||A===Ci.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return u===h.digest},"verify")}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:a(function(u,d){return d=Wit(d,r,!0,void 0,c),u===d},"verify")});var l=qo.rsa.decrypt(o,r,!0,!1);return s.verify(n,l,r.n.bitLength())},r};qo.setRsaPrivateKey=qo.rsa.setPrivateKey=function(t,e,r,n,o,s,c,l){var u={n:t,e,d:r,p:n,q:o,dP:s,dQ:c,qInv:l};return u.decrypt=function(d,f,h){typeof f=="string"?f=f.toUpperCase():f===void 0&&(f="RSAES-PKCS1-V1_5");var m=qo.rsa.decrypt(d,u,!1,!1);if(f==="RSAES-PKCS1-V1_5")f={decode:Wit};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:a(function(g,A){return Ci.pkcs1.decode_rsa_oaep(A,g,h)},"decode")};else if(["RAW","NONE","NULL",null].indexOf(f)!==-1)f={decode:a(function(g){return g},"decode")};else throw new Error('Unsupported encryption scheme: "'+f+'".');return f.decode(m,u,!1)},u.sign=function(d,f){var h=!1;typeof f=="string"&&(f=f.toUpperCase()),f===void 0||f==="RSASSA-PKCS1-V1_5"?(f={encode:a1s},h=1):(f==="NONE"||f==="NULL"||f===null)&&(f={encode:a(function(){return d},"encode")},h=1);var m=f.encode(d,u.n.bitLength());return qo.rsa.encrypt(m,u,h)},u};qo.wrapRsaPrivateKey=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,pt.integerToDer(0).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.OID,!1,pt.oidToDer(qo.oids.rsaEncryption).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.NULL,!1,"")]),pt.create(pt.Class.UNIVERSAL,pt.Type.OCTETSTRING,!1,pt.toDer(t).getBytes())])};qo.privateKeyFromAsn1=function(t){var e={},r=[];if(pt.validate(t,r1s,e,r)&&(t=pt.fromDer(Ci.util.createBuffer(e.privateKey))),e={},r=[],!pt.validate(t,n1s,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var o,s,c,l,u,d,f,h;return o=Ci.util.createBuffer(e.privateKeyModulus).toHex(),s=Ci.util.createBuffer(e.privateKeyPublicExponent).toHex(),c=Ci.util.createBuffer(e.privateKeyPrivateExponent).toHex(),l=Ci.util.createBuffer(e.privateKeyPrime1).toHex(),u=Ci.util.createBuffer(e.privateKeyPrime2).toHex(),d=Ci.util.createBuffer(e.privateKeyExponent1).toHex(),f=Ci.util.createBuffer(e.privateKeyExponent2).toHex(),h=Ci.util.createBuffer(e.privateKeyCoefficient).toHex(),qo.setRsaPrivateKey(new Wa(o,16),new Wa(s,16),new Wa(c,16),new Wa(l,16),new Wa(u,16),new Wa(d,16),new Wa(f,16),new Wa(h,16))};qo.privateKeyToAsn1=qo.privateKeyToRSAPrivateKey=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,pt.integerToDer(0).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.n)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.e)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.d)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.p)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.q)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.dP)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.dQ)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.qInv))])};qo.publicKeyFromAsn1=function(t){var e={},r=[];if(pt.validate(t,o1s,e,r)){var n=pt.derToOid(e.publicKeyOid);if(n!==qo.oids.rsaEncryption){var o=new Error("Cannot read public key. Unknown OID.");throw o.oid=n,o}t=e.rsaPublicKey}if(r=[],!pt.validate(t,i1s,e,r)){var o=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw o.errors=r,o}var s=Ci.util.createBuffer(e.publicKeyModulus).toHex(),c=Ci.util.createBuffer(e.publicKeyExponent).toHex();return qo.setRsaPublicKey(new Wa(s,16),new Wa(c,16))};qo.publicKeyToAsn1=qo.publicKeyToSubjectPublicKeyInfo=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.OID,!1,pt.oidToDer(qo.oids.rsaEncryption).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.NULL,!1,"")]),pt.create(pt.Class.UNIVERSAL,pt.Type.BITSTRING,!1,[qo.publicKeyToRSAPublicKey(t)])])};qo.publicKeyToRSAPublicKey=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.n)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,I5(t.e))])};function M3n(t,e,r){var n=Ci.util.createBuffer(),o=Math.ceil(e.n.bitLength()/8);if(t.length>o-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=o-11,s}n.putByte(0),n.putByte(r);var c=o-3-t.length,l;if(r===0||r===1){l=r===0?0:255;for(var u=0;u0;){for(var d=0,f=Ci.random.getBytes(c),u=0;u"u")throw new Error("Encryption block is invalid.");var d=0;if(u===0){d=s-3-n;for(var f=0;f1;){if(c.getByte()!==255){--c.read;break}++d}if(d<8&&!(o&&o._skipPaddingChecks))throw new Error("Encryption block is invalid.")}else if(u===2){for(d=0;c.length()>1;){if(c.getByte()===0){--c.read;break}++d}if(d<8&&!(o&&o._skipPaddingChecks))throw new Error("Encryption block is invalid.")}var h=c.getByte();if(h!==0||d!==s-3-c.length())throw new Error("Encryption block is invalid.");return c.getBytes()}a(Wit,"_decodePkcs1_v1_5");function c1s(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),o();function o(){s(t.pBits,function(l,u){if(l)return r(l);if(t.p=u,t.q!==null)return c(l,t.q);s(t.qBits,c)})}a(o,"generate");function s(l,u){Ci.prime.generateProbablePrime(l,n,u)}a(s,"getPrime");function c(l,u){if(l)return r(l);if(t.q=u,t.p.compareTo(t.q)<0){var d=t.p;t.p=t.q,t.q=d}if(t.p.subtract(Wa.ONE).gcd(t.e).compareTo(Wa.ONE)!==0){t.p=null,o();return}if(t.q.subtract(Wa.ONE).gcd(t.e).compareTo(Wa.ONE)!==0){t.q=null,s(t.qBits,c);return}if(t.p1=t.p.subtract(Wa.ONE),t.q1=t.q.subtract(Wa.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(Wa.ONE)!==0){t.p=t.q=null,o();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,c);return}var f=t.e.modInverse(t.phi);t.keys={privateKey:qo.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:qo.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}a(c,"finish")}a(c1s,"_generateKeyPair");function I5(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=Ci.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&(r.charCodeAt(1)&128)===0||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}a(I5,"_bnToBytes");function l1s(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}a(l1s,"_getMillerRabinTests");function R3n(t){return Ci.util.isNodejs&&typeof Trr[t]=="function"}a(R3n,"_detectNodeCrypto");function k3n(t){return typeof Rw.globalScope<"u"&&typeof Rw.globalScope.crypto=="object"&&typeof Rw.globalScope.crypto.subtle=="object"&&typeof Rw.globalScope.crypto.subtle[t]=="function"}a(k3n,"_detectSubtleCrypto");function P3n(t){return typeof Rw.globalScope<"u"&&typeof Rw.globalScope.msCrypto=="object"&&typeof Rw.globalScope.msCrypto.subtle=="object"&&typeof Rw.globalScope.msCrypto.subtle[t]=="function"}a(P3n,"_detectSubtleMsCrypto");function D3n(t){for(var e=Ci.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{p();var _n=As();Tj();v2();Xke();E5();Ij();jit();uZ();xw();Arr();rPe();ac();typeof L3n>"u"&&(L3n=_n.jsbn.BigInteger);var L3n,Nt=_n.asn1,as=_n.pki=_n.pki||{};Q3n.exports=as.pbe=_n.pbe=_n.pbe||{};var pZ=as.oids,u1s={name:"EncryptedPrivateKeyInfo",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},d1s={name:"PBES2Algorithms",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},f1s={name:"pkcs-12PbeParams",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:Nt.Class.UNIVERSAL,type:Nt.Type.INTEGER,constructed:!1,capture:"iterations"}]};as.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=_n.random.getBytesSync(r.saltSize),o=r.count,s=Nt.integerToDer(o),c,l,u;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var d,f,h;switch(r.algorithm){case"aes128":c=16,d=16,f=pZ["aes128-CBC"],h=_n.aes.createEncryptionCipher;break;case"aes192":c=24,d=16,f=pZ["aes192-CBC"],h=_n.aes.createEncryptionCipher;break;case"aes256":c=32,d=16,f=pZ["aes256-CBC"],h=_n.aes.createEncryptionCipher;break;case"des":c=8,d=8,f=pZ.desCBC,h=_n.des.createEncryptionCipher;break;default:var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=r.algorithm,m}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),A=U3n(g),y=_n.pkcs5.pbkdf2(e,n,o,c,A),E=_n.random.getBytesSync(d),_=h(y);_.start(E),_.update(Nt.toDer(t)),_.finish(),u=_.output.getBytes();var v=p1s(n,s,c,g);l=Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(pZ.pkcs5PBES2).getBytes()),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(pZ.pkcs5PBKDF2).getBytes()),v]),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(f).getBytes()),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OCTETSTRING,!1,E)])])])}else if(r.algorithm==="3des"){c=24;var b=new _n.util.ByteBuffer(n),y=as.pbe.generatePkcs12Key(e,b,1,o,c),E=as.pbe.generatePkcs12Key(e,b,2,o,c),_=_n.des.createEncryptionCipher(y);_.start(E),_.update(Nt.toDer(t)),_.finish(),u=_.output.getBytes(),l=Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OID,!1,Nt.oidToDer(pZ["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OCTETSTRING,!1,n),Nt.create(Nt.Class.UNIVERSAL,Nt.Type.INTEGER,!1,s.getBytes())])])}else{var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=r.algorithm,m}var T=Nt.create(Nt.Class.UNIVERSAL,Nt.Type.SEQUENCE,!0,[l,Nt.create(Nt.Class.UNIVERSAL,Nt.Type.OCTETSTRING,!1,u)]);return T};as.decryptPrivateKeyInfo=function(t,e){var r=null,n={},o=[];if(!Nt.validate(t,u1s,n,o)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}var c=Nt.derToOid(n.encryptionOid),l=as.pbe.getCipher(c,n.encryptionParams,e),u=_n.util.createBuffer(n.encryptedData);return l.update(u),l.finish()&&(r=Nt.fromDer(l.output)),r};as.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:Nt.toDer(t).getBytes()};return _n.pem.encode(r,{maxline:e})};as.encryptedPrivateKeyFromPem=function(t){var e=_n.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return Nt.fromDer(e.body)};as.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=as.wrapRsaPrivateKey(as.privateKeyToAsn1(t));return n=as.encryptPrivateKeyInfo(n,e,r),as.encryptedPrivateKeyToPem(n)}var o,s,c,l;switch(r.algorithm){case"aes128":o="AES-128-CBC",c=16,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",c=24,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",c=32,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",c=24,s=_n.random.getBytesSync(8),l=_n.des.createEncryptionCipher;break;case"des":o="DES-CBC",c=8,s=_n.random.getBytesSync(8),l=_n.des.createEncryptionCipher;break;default:var u=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw u.algorithm=r.algorithm,u}var d=_n.pbe.opensslDeriveBytes(e,s.substr(0,8),c),f=l(d);f.start(s),f.update(Nt.toDer(as.privateKeyToAsn1(t))),f.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:_n.util.bytesToHex(s).toUpperCase()},body:f.output.getBytes()};return _n.pem.encode(h)};as.decryptRsaPrivateKey=function(t,e){var r=null,n=_n.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var o=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw o.headerType=o,o}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,c;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,c=_n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,c=_n.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,c=_n.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,c=_n.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,c=_n.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,c=a(function(h){return _n.rc2.createDecryptionCipher(h,40)},"cipherFn");break;case"RC2-64-CBC":s=8,c=a(function(h){return _n.rc2.createDecryptionCipher(h,64)},"cipherFn");break;case"RC2-128-CBC":s=16,c=a(function(h){return _n.rc2.createDecryptionCipher(h,128)},"cipherFn");break;default:var o=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw o.algorithm=n.dekInfo.algorithm,o}var l=_n.util.hexToBytes(n.dekInfo.parameters),u=_n.pbe.opensslDeriveBytes(e,l.substr(0,8),s),d=c(u);if(d.start(l),d.update(_n.util.createBuffer(n.body)),d.finish())r=d.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=as.decryptPrivateKeyInfo(Nt.fromDer(r),e):r=Nt.fromDer(r),r!==null&&(r=as.privateKeyFromAsn1(r)),r};as.pbe.generatePkcs12Key=function(t,e,r,n,o,s){var c,l;if(typeof s>"u"||s===null){if(!("sha1"in _n.md))throw new Error('"sha1" hash algorithm unavailable.');s=_n.md.sha1.create()}var u=s.digestLength,d=s.blockLength,f=new _n.util.ByteBuffer,h=new _n.util.ByteBuffer;if(t!=null){for(l=0;l=0;l--)B=B>>8,B+=P.at(l)+L.at(l),L.setAt(l,B&255);N.putBuffer(L)}b=N,f.putBuffer(R)}return f.truncate(f.length()-o),f};as.pbe.getCipher=function(t,e,r){switch(t){case as.oids.pkcs5PBES2:return as.pbe.getCipherForPBES2(t,e,r);case as.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case as.oids["pbewithSHAAnd40BitRC2-CBC"]:return as.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};as.pbe.getCipherForPBES2=function(t,e,r){var n={},o=[];if(!Nt.validate(e,d1s,n,o)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}if(t=Nt.derToOid(n.kdfOid),t!==as.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=Nt.derToOid(n.encOid),t!==as.oids["aes128-CBC"]&&t!==as.oids["aes192-CBC"]&&t!==as.oids["aes256-CBC"]&&t!==as.oids["des-EDE3-CBC"]&&t!==as.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var c=n.kdfSalt,l=_n.util.createBuffer(n.kdfIterationCount);l=l.getInt(l.length()<<3);var u,d;switch(as.oids[t]){case"aes128-CBC":u=16,d=_n.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,d=_n.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,d=_n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,d=_n.des.createDecryptionCipher;break;case"desCBC":u=8,d=_n.des.createDecryptionCipher;break}var f=F3n(n.prfOid),h=_n.pkcs5.pbkdf2(r,c,l,u,f),m=n.encIv,g=d(h);return g.start(m),g};as.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},o=[];if(!Nt.validate(e,f1s,n,o)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}var c=_n.util.createBuffer(n.salt),l=_n.util.createBuffer(n.iterations);l=l.getInt(l.length()<<3);var u,d,f;switch(t){case as.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,d=8,f=_n.des.startDecrypting;break;case as.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,d=8,f=a(function(y,E){var _=_n.rc2.createDecryptionCipher(y,40);return _.start(E,null),_},"cipherFn");break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var h=F3n(n.prfOid),m=as.pbe.generatePkcs12Key(r,c,1,l,u,h);h.start();var g=as.pbe.generatePkcs12Key(r,c,2,l,d,h);return f(m,g)};as.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in _n.md))throw new Error('"md5" hash algorithm unavailable.');n=_n.md.md5.create()}e===null&&(e="");for(var o=[B3n(n,t+e)],s=16,c=1;s{p();var Vfe=As();v2();ac();var fn=Vfe.asn1,Wfe=H3n.exports=Vfe.pkcs7asn1=Vfe.pkcs7asn1||{};Vfe.pkcs7=Vfe.pkcs7||{};Vfe.pkcs7.asn1=Wfe;var q3n={name:"ContentInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Wfe.contentInfoValidator=q3n;var j3n={name:"EncryptedContentInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Wfe.envelopedDataValidator={name:"EnvelopedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(j3n)};Wfe.encryptedDataValidator={name:"EncryptedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"}].concat(j3n)};var h1s={name:"SignerInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:fn.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Wfe.signedDataValidator={name:"SignedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},q3n,{name:"SignedData.Certificates",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:fn.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,capture:"signerInfos",optional:!0,value:[h1s]}]};Wfe.recipientInfoValidator={name:"RecipientInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var wrr=I((Iif,G3n)=>{p();var hZ=As();ac();hZ.mgf=hZ.mgf||{};var m1s=G3n.exports=hZ.mgf.mgf1=hZ.mgf1=hZ.mgf1||{};m1s.create=function(t){var e={generate:a(function(r,n){for(var o=new hZ.util.ByteBuffer,s=Math.ceil(n/t.digestLength),c=0;c{p();var zit=As();wrr();$3n.exports=zit.mgf=zit.mgf||{};zit.mgf.mgf1=zit.mgf1});var Yit=I((Pif,W3n)=>{p();var mZ=As();xw();ac();var g1s=W3n.exports=mZ.pss=mZ.pss||{};g1s.create=function(t){arguments.length===3&&(t={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var e=t.md,r=t.mgf,n=e.digestLength,o=t.salt||null;typeof o=="string"&&(o=mZ.util.createBuffer(o));var s;if("saltLength"in t)s=t.saltLength;else if(o!==null)s=o.length();else throw new Error("Salt length not specified or specific salt not given.");if(o!==null&&o.length()!==s)throw new Error("Given salt length does not match length of given salt.");var c=t.prng||mZ.random,l={};return l.encode=function(u,d){var f,h=d-1,m=Math.ceil(h/8),g=u.digest().getBytes();if(m>8*m-h&255;return w=String.fromCharCode(w.charCodeAt(0)&~R)+w.substr(1),w+E+"\xBC"},l.verify=function(u,d,f){var h,m=f-1,g=Math.ceil(m/8);if(d=d.substr(-g),g>8*g-m&255;if((y.charCodeAt(0)&_)!==0)throw new Error("Bits beyond keysize not zero as expected.");var v=r.generate(E,A),b="";for(h=0;h{p();var bi=As();Tj();v2();Xke();E5();V3n();Ij();uZ();Yit();rPe();ac();var Ae=bi.asn1,Dr=Z3n.exports=bi.pki=bi.pki||{},za=Dr.oids,fp={};fp.CN=za.commonName;fp.commonName="CN";fp.C=za.countryName;fp.countryName="C";fp.L=za.localityName;fp.localityName="L";fp.ST=za.stateOrProvinceName;fp.stateOrProvinceName="ST";fp.O=za.organizationName;fp.organizationName="O";fp.OU=za.organizationalUnitName;fp.organizationalUnitName="OU";fp.E=za.emailAddress;fp.emailAddress="E";var Y3n=bi.pki.rsa.publicKeyValidator,A1s={name:"Certificate",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},Y3n,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},y1s={name:"rsapss",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},E1s={name:"CertificationRequestInfo",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},Y3n,{name:"CertificationRequestInfo.attributes",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SET,constructed:!0}]}]}]},_1s={name:"CertificationRequest",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[E1s,{name:"CertificationRequest.signatureAlgorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};Dr.RDNAttributesAsArray=function(t,e){for(var r=[],n,o,s,c=0;c2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(u.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=u[0],c.validity.notAfter=u[1],c.tbsCertificate=r.tbsCertificate,e){c.md=Jit({signatureOid:c.signatureOid,type:"certificate"});var d=Ae.toDer(c.tbsCertificate);c.md.update(d.getBytes())}var f=bi.md.sha1.create(),h=Ae.toDer(r.certIssuer);f.update(h.getBytes()),c.issuer.getField=function(A){return Rj(c.issuer,A)},c.issuer.addField=function(A){kw([A]),c.issuer.attributes.push(A)},c.issuer.attributes=Dr.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=f.digest().toHex();var m=bi.md.sha1.create(),g=Ae.toDer(r.certSubject);return m.update(g.getBytes()),c.subject.getField=function(A){return Rj(c.subject,A)},c.subject.addField=function(A){kw([A]),c.subject.attributes.push(A)},c.subject.attributes=Dr.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=m.digest().toHex(),r.certExtensions?c.extensions=Dr.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=Dr.publicKeyFromAsn1(r.subjectPublicKeyInfo),c};Dr.certificateExtensionsFromAsn1=function(t){for(var e=[],r=0;r1&&(n=r.value.charCodeAt(1),o=r.value.length>2?r.value.charCodeAt(2):0),e.digitalSignature=(n&128)===128,e.nonRepudiation=(n&64)===64,e.keyEncipherment=(n&32)===32,e.dataEncipherment=(n&16)===16,e.keyAgreement=(n&8)===8,e.keyCertSign=(n&4)===4,e.cRLSign=(n&2)===2,e.encipherOnly=(n&1)===1,e.decipherOnly=(o&128)===128}else if(e.name==="basicConstraints"){var r=Ae.fromDer(e.value);r.value.length>0&&r.value[0].type===Ae.Type.BOOLEAN?e.cA=r.value[0].value.charCodeAt(0)!==0:e.cA=!1;var s=null;r.value.length>0&&r.value[0].type===Ae.Type.INTEGER?s=r.value[0].value:r.value.length>1&&(s=r.value[1].value),s!==null&&(e.pathLenConstraint=Ae.derToInteger(s))}else if(e.name==="extKeyUsage")for(var r=Ae.fromDer(e.value),c=0;c1&&(n=r.value.charCodeAt(1)),e.client=(n&128)===128,e.server=(n&64)===64,e.email=(n&32)===32,e.objsign=(n&16)===16,e.reserved=(n&8)===8,e.sslCA=(n&4)===4,e.emailCA=(n&2)===2,e.objCA=(n&1)===1}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.altNames=[];for(var u,r=Ae.fromDer(e.value),d=0;d"u"&&(e.type&&e.type in Dr.oids?e.name=Dr.oids[e.type]:e.shortName&&e.shortName in fp&&(e.name=Dr.oids[fp[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in Dr.oids)e.type=Dr.oids[e.name];else{var n=new Error("Attribute type not specified.");throw n.attribute=e,n}if(typeof e.shortName>"u"&&e.name&&e.name in fp&&(e.shortName=fp[e.name]),e.type===za.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=Ae.Type.SEQUENCE,!e.value&&e.extensions)){e.value=[];for(var o=0;o"u"){var n=new Error("Attribute value not specified.");throw n.attribute=e,n}}}a(kw,"_fillMissingFields");function J3n(t,e){if(e=e||{},typeof t.name>"u"&&t.id&&t.id in Dr.oids&&(t.name=Dr.oids[t.id]),typeof t.id>"u")if(t.name&&t.name in Dr.oids)t.id=Dr.oids[t.name];else{var r=new Error("Extension ID not specified.");throw r.extension=t,r}if(typeof t.value<"u")return t;if(t.name==="keyUsage"){var n=0,o=0,s=0;t.digitalSignature&&(o|=128,n=7),t.nonRepudiation&&(o|=64,n=6),t.keyEncipherment&&(o|=32,n=5),t.dataEncipherment&&(o|=16,n=4),t.keyAgreement&&(o|=8,n=3),t.keyCertSign&&(o|=4,n=2),t.cRLSign&&(o|=2,n=1),t.encipherOnly&&(o|=1,n=0),t.decipherOnly&&(s|=128,n=7);var c=String.fromCharCode(n);s!==0?c+=String.fromCharCode(o)+String.fromCharCode(s):o!==0&&(c+=String.fromCharCode(o)),t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,c)}else if(t.name==="basicConstraints")t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]),t.cA&&t.value.value.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in t&&t.value.value.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(t.pathLenConstraint).getBytes()));else if(t.name==="extKeyUsage"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);var l=t.value.value;for(var u in t)t[u]===!0&&(u in za?l.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(za[u]).getBytes())):u.indexOf(".")!==-1&&l.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(u).getBytes())))}else if(t.name==="nsCertType"){var n=0,o=0;t.client&&(o|=128,n=7),t.server&&(o|=64,n=6),t.email&&(o|=32,n=5),t.objsign&&(o|=16,n=4),t.reserved&&(o|=8,n=3),t.sslCA&&(o|=4,n=2),t.emailCA&&(o|=2,n=1),t.objCA&&(o|=1,n=0);var c=String.fromCharCode(n);o!==0&&(c+=String.fromCharCode(o)),t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,c)}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);for(var d,f=0;f128)throw new Error('Invalid "nsComment" content.');t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.IA5STRING,!1,t.comment)}else if(t.name==="subjectKeyIdentifier"&&e.cert){var h=e.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=h.toHex(),t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OCTETSTRING,!1,h.getBytes())}else if(t.name==="authorityKeyIdentifier"&&e.cert){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);var l=t.value.value;if(t.keyIdentifier){var m=t.keyIdentifier===!0?e.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!1,m))}if(t.authorityCertIssuer){var g=[Ae.create(Ae.Class.CONTEXT_SPECIFIC,4,!0,[zfe(t.authorityCertIssuer===!0?e.cert.issuer:t.authorityCertIssuer)])];l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,1,!0,g))}if(t.serialNumber){var A=bi.util.hexToBytes(t.serialNumber===!0?e.cert.serialNumber:t.serialNumber);l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,2,!1,A))}}else if(t.name==="cRLDistributionPoints"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);for(var l=t.value.value,y=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]),E=Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!0,[]),d,f=0;f"u"){var r=new Error("Extension value not specified.");throw r.extension=t,r}return t}a(J3n,"_fillMissingExtensionFields");function Rrr(t,e){if(t===za["RSASSA-PSS"]){var r=[];return e.hash.algorithmOid!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.hash.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")])])),e.mgf.algorithmOid!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,1,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.mgf.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.mgf.hash.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")])])])),e.saltLength!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,2,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(e.saltLength).getBytes())])),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,r)}else return Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")}a(Rrr,"_signatureParametersToAsn1");function v1s(t){var e=Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!0,[]);if(t.attributes.length===0)return e;for(var r=t.attributes,n=0;n=C1s&&t0&&n.value.push(Dr.certificateExtensionsToAsn1(t.extensions)),n};Dr.getCertificationRequestInfo=function(t){var e=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(t.version).getBytes()),zfe(t.subject),Dr.publicKeyToAsn1(t.publicKey),v1s(t)]);return e};Dr.distinguishedNameToAsn1=function(t){return zfe(t)};Dr.certificateToAsn1=function(t){var e=t.tbsCertificate||Dr.getTBSCertificate(t);return Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[e,Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(t.signatureOid).getBytes()),Rrr(t.signatureOid,t.signatureParameters)]),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,"\0"+t.signature)])};Dr.certificateExtensionsToAsn1=function(t){var e=Ae.create(Ae.Class.CONTEXT_SPECIFIC,3,!0,[]),r=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);e.value.push(r);for(var n=0;n"u"&&(o=new Date);var s=!0,c=null,l=0;do{var u=e.shift(),d=null,f=!1;if(o&&(ou.validity.notAfter)&&(c={message:"Certificate is not valid yet or has expired.",error:Dr.certificateError.certificate_expired,notBefore:u.validity.notBefore,notAfter:u.validity.notAfter,now:o}),c===null){if(d=e[0]||t.getIssuer(u),d===null&&u.isIssuer(u)&&(f=!0,d=u),d){var h=d;bi.util.isArray(h)||(h=[h]);for(var m=!1;!m&&h.length>0;){d=h.shift();try{m=d.verify(u)}catch{}}m||(c={message:"Certificate signature is invalid.",error:Dr.certificateError.bad_certificate})}c===null&&(!d||f)&&!t.hasCertificate(u)&&(c={message:"Certificate is not trusted.",error:Dr.certificateError.unknown_ca})}if(c===null&&d&&!u.isIssuer(d)&&(c={message:"Certificate issuer is invalid.",error:Dr.certificateError.bad_certificate}),c===null)for(var g={keyUsage:!0,basicConstraints:!0},A=0;c===null&&AE.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:Dr.certificateError.bad_certificate})}}var b=c===null?!0:c.error,T=r.verify?r.verify(b,l,n):b;if(T===!0)c=null;else throw b===!0&&(c={message:"The application rejected the certificate.",error:Dr.certificateError.bad_certificate}),(T||T===0)&&(typeof T=="object"&&!bi.util.isArray(T)?(T.message&&(c.message=T.message),T.error&&(c.error=T.error)):typeof T=="string"&&(c.error=T)),c;s=!1,++l}while(e.length>0);return!0}});var Prr=I((Lif,eFn)=>{p();var xu=As();v2();qfe();Ij();xrr();Irr();xw();rPe();$fe();ac();Zit();var Ke=xu.asn1,ea=xu.pki,iPe=eFn.exports=xu.pkcs12=xu.pkcs12||{},X3n={name:"ContentInfo",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Ke.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},S1s={name:"PFX",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.INTEGER,constructed:!1,capture:"version"},X3n,{name:"PFX.macData",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:Ke.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},T1s={name:"SafeBag",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:Ke.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},I1s={name:"Attribute",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SET,constructed:!0,capture:"values"}]},x1s={name:"CertBag",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:Ke.Class.UNIVERSAL,type:Ke.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:Ke.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:Ke.Class.UNIVERSAL,type:Ke.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function nPe(t,e,r,n){for(var o=[],s=0;s=0&&o.push(l)}}return o}a(nPe,"_getBagsByAttribute");iPe.pkcs12FromAsn1=function(t,e,r){typeof e=="string"?(r=e,e=!0):e===void 0&&(e=!0);var n={},o=[];if(!Ke.validate(t,S1s,n,o)){var s=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw s.errors=s,s}var c={version:n.version.charCodeAt(0),safeContents:[],getBags:a(function(E){var _={},v;return"localKeyId"in E?v=E.localKeyId:"localKeyIdHex"in E&&(v=xu.util.hexToBytes(E.localKeyIdHex)),v===void 0&&!("friendlyName"in E)&&"bagType"in E&&(_[E.bagType]=nPe(c.safeContents,null,null,E.bagType)),v!==void 0&&(_.localKeyId=nPe(c.safeContents,"localKeyId",v,E.bagType)),"friendlyName"in E&&(_.friendlyName=nPe(c.safeContents,"friendlyName",E.friendlyName,E.bagType)),_},"getBags"),getBagsByFriendlyName:a(function(E,_){return nPe(c.safeContents,"friendlyName",E,_)},"getBagsByFriendlyName"),getBagsByLocalKeyId:a(function(E,_){return nPe(c.safeContents,"localKeyId",E,_)},"getBagsByLocalKeyId")};if(n.version.charCodeAt(0)!==3){var s=new Error("PKCS#12 PFX of version other than 3 not supported.");throw s.version=n.version.charCodeAt(0),s}if(Ke.derToOid(n.contentType)!==ea.oids.data){var s=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw s.oid=Ke.derToOid(n.contentType),s}var l=n.content.value[0];if(l.tagClass!==Ke.Class.UNIVERSAL||l.type!==Ke.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(l=krr(l),n.mac){var u=null,d=0,f=Ke.derToOid(n.macAlgorithm);switch(f){case ea.oids.sha1:u=xu.md.sha1.create(),d=20;break;case ea.oids.sha256:u=xu.md.sha256.create(),d=32;break;case ea.oids.sha384:u=xu.md.sha384.create(),d=48;break;case ea.oids.sha512:u=xu.md.sha512.create(),d=64;break;case ea.oids.md5:u=xu.md.md5.create(),d=16;break}if(u===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var h=new xu.util.ByteBuffer(n.macSalt),m="macIterations"in n?parseInt(xu.util.bytesToHex(n.macIterations),16):1,g=iPe.generateKey(r,h,3,m,d,u),A=xu.hmac.create();A.start(u,g),A.update(l.value);var y=A.getMac();if(y.getBytes()!==n.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(t.value)&&t.value.length>2)throw new Error("Invalid PKCS#12. macData field present but MAC was not validated.");return w1s(c,l.value,e,r),c};function krr(t){if(t.composed||t.constructed){for(var e=xu.util.createBuffer(),r=0;r0&&(s=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SET,!0,u));var d=[],f=[];e!==null&&(xu.util.isArray(e)?f=e:f=[e]);for(var h=[],m=0;m0){var E=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,h),_=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.data).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,Ke.toDer(E).getBytes())])]);d.push(_)}var v=null;if(t!==null){var b=ea.wrapRsaPrivateKey(ea.privateKeyToAsn1(t));r===null?v=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.keyBag).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[b]),s]):v=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.pkcs8ShroudedKeyBag).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[ea.encryptPrivateKeyInfo(b,r,n)]),s]);var T=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[v]),w=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.data).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,Ke.toDer(T).getBytes())])]);d.push(w)}var R=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,d),x;if(n.useMac){var l=xu.md.sha1.create(),P=new xu.util.ByteBuffer(xu.random.getBytes(n.saltSize)),D=n.count,t=iPe.generateKey(r,P,3,D,20),N=xu.hmac.create();N.start(l,t),N.update(Ke.toDer(R).getBytes());var L=N.getMac();x=Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.sha1).getBytes()),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.NULL,!1,"")]),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,L.getBytes())]),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,P.getBytes()),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.INTEGER,!1,Ke.integerToDer(D).getBytes())])}return Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.INTEGER,!1,Ke.integerToDer(3).getBytes()),Ke.create(Ke.Class.UNIVERSAL,Ke.Type.SEQUENCE,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OID,!1,Ke.oidToDer(ea.oids.data).getBytes()),Ke.create(Ke.Class.CONTEXT_SPECIFIC,0,!0,[Ke.create(Ke.Class.UNIVERSAL,Ke.Type.OCTETSTRING,!1,Ke.toDer(R).getBytes())])]),x])};iPe.generateKey=xu.pbe.generatePkcs12Key});var Nrr=I((Uif,tFn)=>{p();var kj=As();v2();Ij();Irr();uZ();jit();Prr();Yit();rPe();ac();Zit();var Drr=kj.asn1,Yfe=tFn.exports=kj.pki=kj.pki||{};Yfe.pemToDer=function(t){var e=kj.pem.decode(t)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return kj.util.createBuffer(e.body)};Yfe.privateKeyFromPem=function(t){var e=kj.pem.decode(t)[0];if(e.type!=="PRIVATE KEY"&&e.type!=="RSA PRIVATE KEY"){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var n=Drr.fromDer(e.body);return Yfe.privateKeyFromAsn1(n)};Yfe.privateKeyToPem=function(t,e){var r={type:"RSA PRIVATE KEY",body:Drr.toDer(Yfe.privateKeyToAsn1(t)).getBytes()};return kj.pem.encode(r,{maxline:e})};Yfe.privateKeyInfoToPem=function(t,e){var r={type:"PRIVATE KEY",body:Drr.toDer(t).getBytes()};return kj.pem.encode(r,{maxline:e})}});var Urr=I((qif,lFn)=>{p();var Jt=As();v2();qfe();Fit();uZ();Nrr();xw();$fe();ac();var rot=a(function(t,e,r,n){var o=Jt.util.createBuffer(),s=t.length>>1,c=s+(t.length&1),l=t.substr(0,c),u=t.substr(s,c),d=Jt.util.createBuffer(),f=Jt.hmac.create();r=e+r;var h=Math.ceil(n/16),m=Math.ceil(n/20);f.start("MD5",l);var g=Jt.util.createBuffer();d.putBytes(r);for(var A=0;A0&&(_e.queue(t,_e.createAlert(t,{level:_e.Alert.Level.warning,description:_e.Alert.Description.no_renegotiation})),_e.flush(t)),t.process()};_e.parseHelloMessage=function(t,e,r){var n=null,o=t.entity===_e.ConnectionEnd.client;if(r<38)t.error(t,{message:o?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});else{var s=e.fragment,c=s.length();if(n={version:{major:s.getByte(),minor:s.getByte()},random:Jt.util.createBuffer(s.getBytes(32)),session_id:mT(s,1),extensions:[]},o?(n.cipher_suite=s.getBytes(2),n.compression_method=s.getByte()):(n.cipher_suites=mT(s,2),n.compression_methods=mT(s,1)),c=r-(c-s.length()),c>0){for(var l=mT(s,2);l.length()>0;)n.extensions.push({type:[l.getByte(),l.getByte()],data:mT(l,2)});if(!o)for(var u=0;u0;){var h=f.getByte();if(h!==0)break;t.session.extensions.server_name.serverNameList.push(mT(f,2).getBytes())}}}if(t.session.version&&(n.version.major!==t.session.version.major||n.version.minor!==t.session.version.minor))return t.error(t,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.protocol_version}});if(o)t.session.cipherSuite=_e.getCipherSuite(n.cipher_suite);else for(var m=Jt.util.createBuffer(n.cipher_suites.bytes());m.length()>0&&(t.session.cipherSuite=_e.getCipherSuite(m.getBytes(2)),t.session.cipherSuite===null););if(t.session.cipherSuite===null)return t.error(t,{message:"No cipher suites in common.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.handshake_failure},cipherSuite:Jt.util.bytesToHex(n.cipher_suite)});o?t.session.compressionMethod=n.compression_method:t.session.compressionMethod=_e.CompressionMethod.none}return n};_e.createSecurityParameters=function(t,e){var r=t.entity===_e.ConnectionEnd.client,n=e.random.bytes(),o=r?t.session.sp.client_random:n,s=r?n:_e.createRandom().getBytes();t.session.sp={entity:t.entity,prf_algorithm:_e.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:t.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:o,server_random:s}};_e.handleServerHello=function(t,e,r){var n=_e.parseHelloMessage(t,e,r);if(!t.fail){if(n.version.minor<=t.version.minor)t.version.minor=n.version.minor;else return t.error(t,{message:"Incompatible TLS version.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.protocol_version}});t.session.version=t.version;var o=n.session_id.bytes();o.length>0&&o===t.session.id?(t.expect=iFn,t.session.resuming=!0,t.session.sp.server_random=n.random.bytes()):(t.expect=L1s,t.session.resuming=!1,_e.createSecurityParameters(t,n)),t.session.id=o,t.process()}};_e.handleClientHello=function(t,e,r){var n=_e.parseHelloMessage(t,e,r);if(!t.fail){var o=n.session_id.bytes(),s=null;if(t.sessionCache&&(s=t.sessionCache.getSession(o),s===null?o="":(s.version.major!==n.version.major||s.version.minor>n.version.minor)&&(s=null,o="")),o.length===0&&(o=Jt.random.getBytes(32)),t.session.id=o,t.session.clientHelloVersion=n.version,t.session.sp={},s)t.version=t.session.version=s.version,t.session.sp=s.sp;else{for(var c,l=1;l<_e.SupportedVersions.length&&(c=_e.SupportedVersions[l],!(c.minor<=n.version.minor));++l);t.version={major:c.major,minor:c.minor},t.session.version=t.version}s!==null?(t.expect=Brr,t.session.resuming=!0,t.session.sp.client_random=n.random.bytes()):(t.expect=t.verifyClient!==!1?H1s:Lrr,t.session.resuming=!1,_e.createSecurityParameters(t,n)),t.open=!0,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerHello(t)})),t.session.resuming?(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),t.state.pending=_e.createConnectionState(t),t.state.current.write=t.state.pending.write,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createFinished(t)}))):(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificate(t)})),t.fail||(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerKeyExchange(t)})),t.verifyClient!==!1&&_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificateRequest(t)})),_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerHelloDone(t)})))),_e.flush(t),t.process()}};_e.handleCertificate=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_list:mT(n,3)},s,c,l=[];try{for(;o.certificate_list.length()>0;)s=mT(o.certificate_list,3),c=Jt.asn1.fromDer(s),s=Jt.pki.certificateFromAsn1(c,!0),l.push(s)}catch(d){return t.error(t,{message:"Could not parse certificate list.",cause:d,send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.bad_certificate}})}var u=t.entity===_e.ConnectionEnd.client;(u||t.verifyClient===!0)&&l.length===0?t.error(t,{message:u?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}}):l.length===0?t.expect=u?rFn:Lrr:(u?t.session.serverCertificate=l[0]:t.session.clientCertificate=l[0],_e.verifyCertificateChain(t,l)&&(t.expect=u?rFn:Lrr)),t.process()};_e.handleServerKeyExchange=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.unsupported_certificate}});t.expect=B1s,t.process()};_e.handleClientKeyExchange=function(t,e,r){if(r<48)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.unsupported_certificate}});var n=e.fragment,o={enc_pre_master_secret:mT(n,2).getBytes()},s=null;if(t.getPrivateKey)try{s=t.getPrivateKey(t,t.session.serverCertificate),s=Jt.pki.privateKeyFromPem(s)}catch(u){t.error(t,{message:"Could not get private key.",cause:u,send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}})}if(s===null)return t.error(t,{message:"No private key set.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}});try{var c=t.session.sp;c.pre_master_secret=s.decrypt(o.enc_pre_master_secret);var l=t.session.clientHelloVersion;if(l.major!==c.pre_master_secret.charCodeAt(0)||l.minor!==c.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{c.pre_master_secret=Jt.random.getBytes(48)}t.expect=Brr,t.session.clientCertificate!==null&&(t.expect=G1s),t.process()};_e.handleCertificateRequest=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_types:mT(n,1),certificate_authorities:mT(n,2)};t.session.certificateRequest=o,t.expect=F1s,t.process()};_e.handleCertificateVerify=function(t,e,r){if(r<2)return t.error(t,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s={signature:mT(n,2).getBytes()},c=Jt.util.createBuffer();c.putBuffer(t.session.md5.digest()),c.putBuffer(t.session.sha1.digest()),c=c.getBytes();try{var l=t.session.clientCertificate;if(!l.publicKey.verify(c,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");t.session.md5.update(o),t.session.sha1.update(o)}catch{return t.error(t,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.handshake_failure}})}t.expect=Brr,t.process()};_e.handleServerHelloDone=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.record_overflow}});if(t.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.insufficient_security}},o=0,s=t.verify(t,n.alert.description,o,[]);if(s!==!0)return(s||s===0)&&(typeof s=="object"&&!Jt.util.isArray(s)?(s.message&&(n.message=s.message),s.alert&&(n.alert.description=s.alert)):typeof s=="number"&&(n.alert.description=s)),t.error(t,n)}t.session.certificateRequest!==null&&(e=_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificate(t)}),_e.queue(t,e)),e=_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createClientKeyExchange(t)}),_e.queue(t,e),t.expect=q1s;var c=a(function(l,u){l.session.certificateRequest!==null&&l.session.clientCertificate!==null&&_e.queue(l,_e.createRecord(l,{type:_e.ContentType.handshake,data:_e.createCertificateVerify(l,u)})),_e.queue(l,_e.createRecord(l,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),l.state.pending=_e.createConnectionState(l),l.state.current.write=l.state.pending.write,_e.queue(l,_e.createRecord(l,{type:_e.ContentType.handshake,data:_e.createFinished(l)})),l.expect=iFn,_e.flush(l),l.process()},"callback");if(t.session.certificateRequest===null||t.session.clientCertificate===null)return c(t,null);_e.getClientSignature(t,c)};_e.handleChangeCipherSpec=function(t,e){if(e.fragment.getByte()!==1)return t.error(t,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var r=t.entity===_e.ConnectionEnd.client;(t.session.resuming&&r||!t.session.resuming&&!r)&&(t.state.pending=_e.createConnectionState(t)),t.state.current.read=t.state.pending.read,(!t.session.resuming&&r||t.session.resuming&&!r)&&(t.state.pending=null),t.expect=r?U1s:$1s,t.process()};_e.handleFinished=function(t,e,r){var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s=e.fragment.getBytes();n=Jt.util.createBuffer(),n.putBuffer(t.session.md5.digest()),n.putBuffer(t.session.sha1.digest());var c=t.entity===_e.ConnectionEnd.client,l=c?"server finished":"client finished",u=t.session.sp,d=12,f=rot;if(n=f(u.master_secret,l,n.getBytes(),d),n.getBytes()!==s)return t.error(t,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.decrypt_error}});t.session.md5.update(o),t.session.sha1.update(o),(t.session.resuming&&c||!t.session.resuming&&!c)&&(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),t.state.current.write=t.state.pending.write,t.state.pending=null,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createFinished(t)}))),t.expect=c?Q1s:V1s,t.handshaking=!1,++t.handshakes,t.peerCertificate=c?t.session.serverCertificate:t.session.clientCertificate,_e.flush(t),t.isConnected=!0,t.connected(t),t.process()};_e.handleAlert=function(t,e){var r=e.fragment,n={level:r.getByte(),description:r.getByte()},o;switch(n.description){case _e.Alert.Description.close_notify:o="Connection closed.";break;case _e.Alert.Description.unexpected_message:o="Unexpected message.";break;case _e.Alert.Description.bad_record_mac:o="Bad record MAC.";break;case _e.Alert.Description.decryption_failed:o="Decryption failed.";break;case _e.Alert.Description.record_overflow:o="Record overflow.";break;case _e.Alert.Description.decompression_failure:o="Decompression failed.";break;case _e.Alert.Description.handshake_failure:o="Handshake failure.";break;case _e.Alert.Description.bad_certificate:o="Bad certificate.";break;case _e.Alert.Description.unsupported_certificate:o="Unsupported certificate.";break;case _e.Alert.Description.certificate_revoked:o="Certificate revoked.";break;case _e.Alert.Description.certificate_expired:o="Certificate expired.";break;case _e.Alert.Description.certificate_unknown:o="Certificate unknown.";break;case _e.Alert.Description.illegal_parameter:o="Illegal parameter.";break;case _e.Alert.Description.unknown_ca:o="Unknown certificate authority.";break;case _e.Alert.Description.access_denied:o="Access denied.";break;case _e.Alert.Description.decode_error:o="Decode error.";break;case _e.Alert.Description.decrypt_error:o="Decrypt error.";break;case _e.Alert.Description.export_restriction:o="Export restriction.";break;case _e.Alert.Description.protocol_version:o="Unsupported protocol version.";break;case _e.Alert.Description.insufficient_security:o="Insufficient security.";break;case _e.Alert.Description.internal_error:o="Internal error.";break;case _e.Alert.Description.user_canceled:o="User canceled.";break;case _e.Alert.Description.no_renegotiation:o="Renegotiation not supported.";break;default:o="Unknown error.";break}if(n.description===_e.Alert.Description.close_notify)return t.close();t.error(t,{message:o,send:!1,origin:t.entity===_e.ConnectionEnd.client?"server":"client",alert:n}),t.process()};_e.handleHandshake=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt24();if(o>r.length())return t.fragmented=e,e.fragment=Jt.util.createBuffer(),r.read-=4,t.process();t.fragmented=null,r.read-=4;var s=r.bytes(o+4);r.read+=4,n in tot[t.entity][t.expect]?(t.entity===_e.ConnectionEnd.server&&!t.open&&!t.fail&&(t.handshaking=!0,t.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:Jt.md.md5.create(),sha1:Jt.md.sha1.create()}),n!==_e.HandshakeType.hello_request&&n!==_e.HandshakeType.certificate_verify&&n!==_e.HandshakeType.finished&&(t.session.md5.update(s),t.session.sha1.update(s)),tot[t.entity][t.expect][n](t,e,o)):_e.handleUnexpected(t,e)};_e.handleApplicationData=function(t,e){t.data.putBuffer(e.fragment),t.dataReady(t),t.process()};_e.handleHeartbeat=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt16(),s=r.getBytes(o);if(n===_e.HeartbeatMessageType.heartbeat_request){if(t.handshaking||o>s.length)return t.process();_e.queue(t,_e.createRecord(t,{type:_e.ContentType.heartbeat,data:_e.createHeartbeat(_e.HeartbeatMessageType.heartbeat_response,s)})),_e.flush(t)}else if(n===_e.HeartbeatMessageType.heartbeat_response){if(s!==t.expectedHeartbeatPayload)return t.process();t.heartbeatReceived&&t.heartbeatReceived(t,Jt.util.createBuffer(s))}t.process()};var O1s=0,L1s=1,rFn=2,B1s=3,F1s=4,iFn=5,U1s=6,Q1s=7,q1s=8,j1s=0,H1s=1,Lrr=2,G1s=3,Brr=4,$1s=5,V1s=6,Ee=_e.handleUnexpected,oFn=_e.handleChangeCipherSpec,jA=_e.handleAlert,av=_e.handleHandshake,sFn=_e.handleApplicationData,HA=_e.handleHeartbeat,Frr=[];Frr[_e.ConnectionEnd.client]=[[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[oFn,jA,Ee,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,sFn,HA],[Ee,jA,av,Ee,HA]];Frr[_e.ConnectionEnd.server]=[[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,Ee,HA],[oFn,jA,Ee,Ee,HA],[Ee,jA,av,Ee,HA],[Ee,jA,av,sFn,HA],[Ee,jA,av,Ee,HA]];var Pj=_e.handleHelloRequest,W1s=_e.handleServerHello,aFn=_e.handleCertificate,nFn=_e.handleServerKeyExchange,Mrr=_e.handleCertificateRequest,Xit=_e.handleServerHelloDone,cFn=_e.handleFinished,tot=[];tot[_e.ConnectionEnd.client]=[[Ee,Ee,W1s,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,aFn,nFn,Mrr,Xit,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,nFn,Mrr,Xit,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Mrr,Xit,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Xit,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,cFn],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Pj,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee]];var z1s=_e.handleClientHello,Y1s=_e.handleClientKeyExchange,K1s=_e.handleCertificateVerify;tot[_e.ConnectionEnd.server]=[[Ee,z1s,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,aFn,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Y1s,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,K1s,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,cFn],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee]];_e.generateKeys=function(t,e){var r=rot,n=e.client_random+e.server_random;t.session.resuming||(e.master_secret=r(e.pre_master_secret,"master secret",n,48).bytes(),e.pre_master_secret=null),n=e.server_random+e.client_random;var o=2*e.mac_key_length+2*e.enc_key_length,s=t.version.major===_e.Versions.TLS_1_0.major&&t.version.minor===_e.Versions.TLS_1_0.minor;s&&(o+=2*e.fixed_iv_length);var c=r(e.master_secret,"key expansion",n,o),l={client_write_MAC_key:c.getBytes(e.mac_key_length),server_write_MAC_key:c.getBytes(e.mac_key_length),client_write_key:c.getBytes(e.enc_key_length),server_write_key:c.getBytes(e.enc_key_length)};return s&&(l.client_write_IV=c.getBytes(e.fixed_iv_length),l.server_write_IV=c.getBytes(e.fixed_iv_length)),l};_e.createConnectionState=function(t){var e=t.entity===_e.ConnectionEnd.client,r=a(function(){var s={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:a(function(c){return!0},"cipherFunction"),compressionState:null,compressFunction:a(function(c){return!0},"compressFunction"),updateSequenceNumber:a(function(){s.sequenceNumber[1]===4294967295?(s.sequenceNumber[1]=0,++s.sequenceNumber[0]):++s.sequenceNumber[1]},"updateSequenceNumber")};return s},"createMode"),n={read:r(),write:r()};if(n.read.update=function(s,c){return n.read.cipherFunction(c,n.read)?n.read.compressFunction(s,c,n.read)||s.error(s,{message:"Could not decompress record.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.decompression_failure}}):s.error(s,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.bad_record_mac}}),!s.fail},n.write.update=function(s,c){return n.write.compressFunction(s,c,n.write)?n.write.cipherFunction(c,n.write)||s.error(s,{message:"Could not encrypt record.",send:!1,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}):s.error(s,{message:"Could not compress record.",send:!1,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}),!s.fail},t.session){var o=t.session.sp;switch(t.session.cipherSuite.initSecurityParameters(o),o.keys=_e.generateKeys(t,o),n.read.macKey=e?o.keys.server_write_MAC_key:o.keys.client_write_MAC_key,n.write.macKey=e?o.keys.client_write_MAC_key:o.keys.server_write_MAC_key,t.session.cipherSuite.initConnectionState(n,t,o),o.compression_algorithm){case _e.CompressionMethod.none:break;case _e.CompressionMethod.deflate:n.read.compressFunction=M1s,n.write.compressFunction=N1s;break;default:throw new Error("Unsupported compression algorithm.")}}return n};_e.createRandom=function(){var t=new Date,e=+t+t.getTimezoneOffset()*6e4,r=Jt.util.createBuffer();return r.putInt32(e),r.putBytes(Jt.random.getBytes(28)),r};_e.createRecord=function(t,e){if(!e.data)return null;var r={type:e.type,version:{major:t.version.major,minor:t.version.minor},length:e.data.length(),fragment:e.data};return r};_e.createAlert=function(t,e){var r=Jt.util.createBuffer();return r.putByte(e.level),r.putByte(e.description),_e.createRecord(t,{type:_e.ContentType.alert,data:r})};_e.createClientHello=function(t){t.session.clientHelloVersion={major:t.version.major,minor:t.version.minor};for(var e=Jt.util.createBuffer(),r=0;r0&&(h+=2);var m=t.session.id,g=m.length+1+2+4+28+2+o+1+c+h,A=Jt.util.createBuffer();return A.putByte(_e.HandshakeType.client_hello),A.putInt24(g),A.putByte(t.version.major),A.putByte(t.version.minor),A.putBytes(t.session.sp.client_random),Pw(A,1,Jt.util.createBuffer(m)),Pw(A,2,e),Pw(A,1,s),h>0&&Pw(A,2,l),A};_e.createServerHello=function(t){var e=t.session.id,r=e.length+1+2+4+28+2+1,n=Jt.util.createBuffer();return n.putByte(_e.HandshakeType.server_hello),n.putInt24(r),n.putByte(t.version.major),n.putByte(t.version.minor),n.putBytes(t.session.sp.server_random),Pw(n,1,Jt.util.createBuffer(e)),n.putByte(t.session.cipherSuite.id[0]),n.putByte(t.session.cipherSuite.id[1]),n.putByte(t.session.compressionMethod),n};_e.createCertificate=function(t){var e=t.entity===_e.ConnectionEnd.client,r=null;if(t.getCertificate){var n;e?n=t.session.certificateRequest:n=t.session.extensions.server_name.serverNameList,r=t.getCertificate(t,n)}var o=Jt.util.createBuffer();if(r!==null)try{Jt.util.isArray(r)||(r=[r]);for(var s=null,c=0;c0&&(r.putByte(_e.HandshakeType.server_key_exchange),r.putInt24(e)),r};_e.getClientSignature=function(t,e){var r=Jt.util.createBuffer();r.putBuffer(t.session.md5.digest()),r.putBuffer(t.session.sha1.digest()),r=r.getBytes(),t.getSignature=t.getSignature||function(n,o,s){var c=null;if(n.getPrivateKey)try{c=n.getPrivateKey(n,n.session.clientCertificate),c=Jt.pki.privateKeyFromPem(c)}catch(l){n.error(n,{message:"Could not get private key.",cause:l,send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}})}c===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}):o=c.sign(o,null),s(n,o)},t.getSignature(t,r,e)};_e.createCertificateVerify=function(t,e){var r=e.length+2,n=Jt.util.createBuffer();return n.putByte(_e.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(e.length),n.putBytes(e),n};_e.createCertificateRequest=function(t){var e=Jt.util.createBuffer();e.putByte(1);var r=Jt.util.createBuffer();for(var n in t.caStore.certs){var o=t.caStore.certs[n],s=Jt.pki.distinguishedNameToAsn1(o.subject),c=Jt.asn1.toDer(s);r.putInt16(c.length()),r.putBuffer(c)}var l=1+e.length()+2+r.length(),u=Jt.util.createBuffer();return u.putByte(_e.HandshakeType.certificate_request),u.putInt24(l),Pw(u,1,e),Pw(u,2,r),u};_e.createServerHelloDone=function(t){var e=Jt.util.createBuffer();return e.putByte(_e.HandshakeType.server_hello_done),e.putInt24(0),e};_e.createChangeCipherSpec=function(){var t=Jt.util.createBuffer();return t.putByte(1),t};_e.createFinished=function(t){var e=Jt.util.createBuffer();e.putBuffer(t.session.md5.digest()),e.putBuffer(t.session.sha1.digest());var r=t.entity===_e.ConnectionEnd.client,n=t.session.sp,o=12,s=rot,c=r?"client finished":"server finished";e=s(n.master_secret,c,e.getBytes(),o);var l=Jt.util.createBuffer();return l.putByte(_e.HandshakeType.finished),l.putInt24(e.length()),l.putBuffer(e),l};_e.createHeartbeat=function(t,e,r){typeof r>"u"&&(r=e.length);var n=Jt.util.createBuffer();n.putByte(t),n.putInt16(r),n.putBytes(e);var o=n.length(),s=Math.max(16,o-r-3);return n.putBytes(Jt.random.getBytes(s)),n};_e.queue=function(t,e){if(e&&!(e.fragment.length()===0&&(e.type===_e.ContentType.handshake||e.type===_e.ContentType.alert||e.type===_e.ContentType.change_cipher_spec))){if(e.type===_e.ContentType.handshake){var r=e.fragment.bytes();t.session.md5.update(r),t.session.sha1.update(r),r=null}var n;if(e.fragment.length()<=_e.MaxFragment)n=[e];else{n=[];for(var o=e.fragment.bytes();o.length>_e.MaxFragment;)n.push(_e.createRecord(t,{type:e.type,data:Jt.util.createBuffer(o.slice(0,_e.MaxFragment))})),o=o.slice(_e.MaxFragment);o.length>0&&n.push(_e.createRecord(t,{type:e.type,data:Jt.util.createBuffer(o)}))}for(var s=0;s0&&(c=r.order[0]),c!==null&&c in r.cache){s=r.cache[c],delete r.cache[c];for(var l in r.order)if(r.order[l]===c){r.order.splice(l,1);break}}return s},r.setSession=function(o,s){if(r.order.length===r.capacity){var c=r.order.shift();delete r.cache[c]}var c=Jt.util.bytesToHex(o);r.order.push(c),r.cache[c]=s}}return r};_e.createConnection=function(t){var e=null;t.caStore?Jt.util.isArray(t.caStore)?e=Jt.pki.createCaStore(t.caStore):e=t.caStore:e=Jt.pki.createCaStore();var r=t.cipherSuites||null;if(r===null){r=[];for(var n in _e.CipherSuites)r.push(_e.CipherSuites[n])}var o=t.server?_e.ConnectionEnd.server:_e.ConnectionEnd.client,s=t.sessionCache?_e.createSessionCache(t.sessionCache):null,c={version:{major:_e.Version.major,minor:_e.Version.minor},entity:o,sessionId:t.sessionId,caStore:e,sessionCache:s,cipherSuites:r,connected:t.connected,virtualHost:t.virtualHost||null,verifyClient:t.verifyClient||!1,verify:t.verify||function(f,h,m,g){return h},verifyOptions:t.verifyOptions||{},getCertificate:t.getCertificate||null,getPrivateKey:t.getPrivateKey||null,getSignature:t.getSignature||null,input:Jt.util.createBuffer(),tlsData:Jt.util.createBuffer(),data:Jt.util.createBuffer(),tlsDataReady:t.tlsDataReady,dataReady:t.dataReady,heartbeatReceived:t.heartbeatReceived,closed:t.closed,error:a(function(f,h){h.origin=h.origin||(f.entity===_e.ConnectionEnd.client?"client":"server"),h.send&&(_e.queue(f,_e.createAlert(f,h.alert)),_e.flush(f));var m=h.fatal!==!1;m&&(f.fail=!0),t.error(f,h),m&&f.close(!1)},"error"),deflate:t.deflate||null,inflate:t.inflate||null};c.reset=function(f){c.version={major:_e.Version.major,minor:_e.Version.minor},c.record=null,c.session=null,c.peerCertificate=null,c.state={pending:null,current:null},c.expect=c.entity===_e.ConnectionEnd.client?O1s:j1s,c.fragmented=null,c.records=[],c.open=!1,c.handshakes=0,c.handshaking=!1,c.isConnected=!1,c.fail=!(f||typeof f>"u"),c.input.clear(),c.tlsData.clear(),c.data.clear(),c.state.current=_e.createConnectionState(c)},c.reset();var l=a(function(f,h){var m=h.type-_e.ContentType.change_cipher_spec,g=Frr[f.entity][f.expect];m in g?g[m](f,h):_e.handleUnexpected(f,h)},"_update"),u=a(function(f){var h=0,m=f.input,g=m.length();if(g<5)h=5-g;else{f.record={type:m.getByte(),version:{major:m.getByte(),minor:m.getByte()},length:m.getInt16(),fragment:Jt.util.createBuffer(),ready:!1};var A=f.record.version.major===f.version.major;A&&f.session&&f.session.version&&(A=f.record.version.minor===f.version.minor),A||f.error(f,{message:"Incompatible TLS version.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.protocol_version}})}return h},"_readRecordHeader"),d=a(function(f){var h=0,m=f.input,g=m.length();if(g0&&(c.sessionCache&&(h=c.sessionCache.getSession(f)),h===null&&(f="")),f.length===0&&c.sessionCache&&(h=c.sessionCache.getSession(),h!==null&&(f=h.id)),c.session={id:f,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:Jt.md.md5.create(),sha1:Jt.md.sha1.create()},h&&(c.version=h.version,c.session.sp=h.sp),c.session.sp.client_random=_e.createRandom().getBytes(),c.open=!0,_e.queue(c,_e.createRecord(c,{type:_e.ContentType.handshake,data:_e.createClientHello(c)})),_e.flush(c)}},c.process=function(f){var h=0;return f&&c.input.putBytes(f),c.fail||(c.record!==null&&c.record.ready&&c.record.fragment.isEmpty()&&(c.record=null),c.record===null&&(h=u(c)),!c.fail&&c.record!==null&&!c.record.ready&&(h=d(c)),!c.fail&&c.record!==null&&c.record.ready&&l(c,c.record)),h},c.prepare=function(f){return _e.queue(c,_e.createRecord(c,{type:_e.ContentType.application_data,data:Jt.util.createBuffer(f)})),_e.flush(c)},c.prepareHeartbeatRequest=function(f,h){return f instanceof Jt.util.ByteBuffer&&(f=f.bytes()),typeof h>"u"&&(h=f.length),c.expectedHeartbeatPayload=f,_e.queue(c,_e.createRecord(c,{type:_e.ContentType.heartbeat,data:_e.createHeartbeat(_e.HeartbeatMessageType.heartbeat_request,f,h)})),_e.flush(c)},c.close=function(f){if(!c.fail&&c.sessionCache&&c.session){var h={id:c.session.id,version:c.session.version,sp:c.session.sp};h.sp.keys=null,c.sessionCache.setSession(h.id,h)}c.open&&(c.open=!1,c.input.clear(),(c.isConnected||c.handshaking)&&(c.isConnected=c.handshaking=!1,_e.queue(c,_e.createAlert(c,{level:_e.Alert.Level.warning,description:_e.Alert.Description.close_notify})),_e.flush(c)),c.closed(c)),c.reset(f)},c};lFn.exports=Jt.tls=Jt.tls||{};for(eot in _e)typeof _e[eot]!="function"&&(Jt.tls[eot]=_e[eot]);var eot;Jt.tls.prf_tls1=rot;Jt.tls.hmac_sha1=D1s;Jt.tls.createSessionCache=_e.createSessionCache;Jt.tls.createConnection=_e.createConnection});var fFn=I((Gif,dFn)=>{p();var Dj=As();Tj();Urr();var Dw=dFn.exports=Dj.tls;Dw.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:a(function(t){t.bulk_cipher_algorithm=Dw.BulkCipherAlgorithm.aes,t.cipher_type=Dw.CipherType.block,t.enc_key_length=16,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=Dw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:uFn};Dw.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:a(function(t){t.bulk_cipher_algorithm=Dw.BulkCipherAlgorithm.aes,t.cipher_type=Dw.CipherType.block,t.enc_key_length=32,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=Dw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:uFn};function uFn(t,e,r){var n=e.entity===Dj.tls.ConnectionEnd.client;t.read.cipherState={init:!1,cipher:Dj.cipher.createDecipher("AES-CBC",n?r.keys.server_write_key:r.keys.client_write_key),iv:n?r.keys.server_write_IV:r.keys.client_write_IV},t.write.cipherState={init:!1,cipher:Dj.cipher.createCipher("AES-CBC",n?r.keys.client_write_key:r.keys.server_write_key),iv:n?r.keys.client_write_IV:r.keys.server_write_IV},t.read.cipherFunction=tSs,t.write.cipherFunction=Z1s,t.read.macLength=t.write.macLength=r.mac_length,t.read.macFunction=t.write.macFunction=Dw.hmac_sha1}a(uFn,"initConnectionState");function Z1s(t,e){var r=!1,n=e.macFunction(e.macKey,e.sequenceNumber,t);t.fragment.putBytes(n),e.updateSequenceNumber();var o;t.version.minor===Dw.Versions.TLS_1_0.minor?o=e.cipherState.init?null:e.cipherState.iv:o=Dj.random.getBytesSync(16),e.cipherState.init=!0;var s=e.cipherState.cipher;return s.start({iv:o}),t.version.minor>=Dw.Versions.TLS_1_1.minor&&s.output.putBytes(o),s.update(t.fragment),s.finish(X1s)&&(t.fragment=s.output,t.length=t.fragment.length(),r=!0),r}a(Z1s,"encrypt_aes_cbc_sha1");function X1s(t,e,r){if(!r){var n=t-e.length()%t;e.fillWithByte(n-1,n)}return!0}a(X1s,"encrypt_aes_cbc_sha1_padding");function eSs(t,e,r){var n=!0;if(r){for(var o=e.length(),s=e.last(),c=o-1-s;c=s?(t.fragment=o.output.getBytes(l-s),c=o.output.getBytes(s)):t.fragment=o.output.getBytes(),t.fragment=Dj.util.createBuffer(t.fragment),t.length=t.fragment.length();var u=e.macFunction(e.macKey,e.sequenceNumber,t);return e.updateSequenceNumber(),r=rSs(e.macKey,c,u)&&r,r}a(tSs,"decrypt_aes_cbc_sha1");function rSs(t,e,r){var n=Dj.hmac.create();return n.start("SHA1",t),n.update(e),e=n.digest().getBytes(),n.start(null,null),n.update(r),r=n.digest().getBytes(),e===r}a(rSs,"compareMacs")});var jrr=I((Wif,gFn)=>{p();var cd=As();E5();ac();var oPe=gFn.exports=cd.sha512=cd.sha512||{};cd.md.sha512=cd.md.algorithms.sha512=oPe;var hFn=cd.sha384=cd.sha512.sha384=cd.sha512.sha384||{};hFn.create=function(){return oPe.create("SHA-384")};cd.md.sha384=cd.md.algorithms.sha384=hFn;cd.sha512.sha256=cd.sha512.sha256||{create:a(function(){return oPe.create("SHA-512/256")},"create")};cd.md["sha512/256"]=cd.md.algorithms["sha512/256"]=cd.sha512.sha256;cd.sha512.sha224=cd.sha512.sha224||{create:a(function(){return oPe.create("SHA-512/224")},"create")};cd.md["sha512/224"]=cd.md.algorithms["sha512/224"]=cd.sha512.sha224;oPe.create=function(t){if(mFn||nSs(),typeof t>"u"&&(t="SHA-512"),!(t in gZ))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=gZ[t],r=null,n=cd.util.createBuffer(),o=new Array(80),s=0;s<80;++s)o[s]=new Array(2);var c=64;switch(t){case"SHA-384":c=48;break;case"SHA-512/256":c=32;break;case"SHA-512/224":c=28;break}var l={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:c,messageLength:0,fullMessageLength:null,messageLengthSize:16};return l.start=function(){l.messageLength=0,l.fullMessageLength=l.messageLength128=[];for(var u=l.messageLengthSize/4,d=0;d>>0,f>>>0];for(var h=l.fullMessageLength.length-1;h>=0;--h)l.fullMessageLength[h]+=f[1],f[1]=f[0]+(l.fullMessageLength[h]/4294967296>>>0),l.fullMessageLength[h]=l.fullMessageLength[h]>>>0,f[0]=f[1]/4294967296>>>0;return n.putBytes(u),pFn(r,o,n),(n.read>2048||n.length()===0)&&n.compact(),l},l.digest=function(){var u=cd.util.createBuffer();u.putBytes(n.bytes());var d=l.fullMessageLength[l.fullMessageLength.length-1]+l.messageLengthSize,f=d&l.blockLength-1;u.putBytes(Qrr.substr(0,l.blockLength-f));for(var h,m,g=l.fullMessageLength[0]*8,A=0;A>>0,g+=m,u.putInt32(g>>>0),g=h>>>0;u.putInt32(g);for(var y=new Array(r.length),A=0;A=128;){for(O=0;O<16;++O)e[O][0]=r.getInt32()>>>0,e[O][1]=r.getInt32()>>>0;for(;O<80;++O)U=e[O-2],j=U[0],Q=U[1],n=((j>>>19|Q<<13)^(Q>>>29|j<<3)^j>>>6)>>>0,o=((j<<13|Q>>>19)^(Q<<3|j>>>29)^(j<<26|Q>>>6))>>>0,W=e[O-15],j=W[0],Q=W[1],s=((j>>>1|Q<<31)^(j>>>8|Q<<24)^j>>>7)>>>0,c=((j<<31|Q>>>1)^(j<<24|Q>>>8)^(j<<25|Q>>>7))>>>0,Y=e[O-7],V=e[O-16],Q=o+Y[1]+c+V[1],e[O][0]=n+Y[0]+s+V[0]+(Q/4294967296>>>0)>>>0,e[O][1]=Q>>>0;for(y=t[0][0],E=t[0][1],_=t[1][0],v=t[1][1],b=t[2][0],T=t[2][1],w=t[3][0],R=t[3][1],x=t[4][0],P=t[4][1],D=t[5][0],N=t[5][1],L=t[6][0],B=t[6][1],q=t[7][0],M=t[7][1],O=0;O<80;++O)d=((x>>>14|P<<18)^(x>>>18|P<<14)^(P>>>9|x<<23))>>>0,f=((x<<18|P>>>14)^(x<<14|P>>>18)^(P<<23|x>>>9))>>>0,h=(L^x&(D^L))>>>0,m=(B^P&(N^B))>>>0,l=((y>>>28|E<<4)^(E>>>2|y<<30)^(E>>>7|y<<25))>>>0,u=((y<<4|E>>>28)^(E<<30|y>>>2)^(E<<25|y>>>7))>>>0,g=(y&_|b&(y^_))>>>0,A=(E&v|T&(E^v))>>>0,Q=M+f+m+qrr[O][1]+e[O][1],n=q+d+h+qrr[O][0]+e[O][0]+(Q/4294967296>>>0)>>>0,o=Q>>>0,Q=u+A,s=l+g+(Q/4294967296>>>0)>>>0,c=Q>>>0,q=L,M=B,L=D,B=N,D=x,N=P,Q=R+o,x=w+n+(Q/4294967296>>>0)>>>0,P=Q>>>0,w=b,R=T,b=_,T=v,_=y,v=E,Q=o+c,y=n+s+(Q/4294967296>>>0)>>>0,E=Q>>>0;Q=t[0][1]+E,t[0][0]=t[0][0]+y+(Q/4294967296>>>0)>>>0,t[0][1]=Q>>>0,Q=t[1][1]+v,t[1][0]=t[1][0]+_+(Q/4294967296>>>0)>>>0,t[1][1]=Q>>>0,Q=t[2][1]+T,t[2][0]=t[2][0]+b+(Q/4294967296>>>0)>>>0,t[2][1]=Q>>>0,Q=t[3][1]+R,t[3][0]=t[3][0]+w+(Q/4294967296>>>0)>>>0,t[3][1]=Q>>>0,Q=t[4][1]+P,t[4][0]=t[4][0]+x+(Q/4294967296>>>0)>>>0,t[4][1]=Q>>>0,Q=t[5][1]+N,t[5][0]=t[5][0]+D+(Q/4294967296>>>0)>>>0,t[5][1]=Q>>>0,Q=t[6][1]+B,t[6][0]=t[6][0]+L+(Q/4294967296>>>0)>>>0,t[6][1]=Q>>>0,Q=t[7][1]+M,t[7][0]=t[7][0]+q+(Q/4294967296>>>0)>>>0,t[7][1]=Q>>>0,z-=128}}a(pFn,"_update")});var AFn=I(Hrr=>{p();var iSs=As();v2();var Dg=iSs.asn1;Hrr.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};Hrr.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Dg.Class.UNIVERSAL,type:Dg.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var kFn=I((Zif,RFn)=>{p();var GA=As();tPe();xw();jrr();ac();var bFn=AFn(),oSs=bFn.publicKeyValidator,sSs=bFn.privateKeyValidator;typeof yFn>"u"&&(yFn=GA.jsbn.BigInteger);var yFn,$rr=GA.util.ByteBuffer,ub=typeof Buffer>"u"?Uint8Array:Buffer;GA.pki=GA.pki||{};RFn.exports=GA.pki.ed25519=GA.ed25519=GA.ed25519||{};var ta=GA.ed25519;ta.constants={};ta.constants.PUBLIC_KEY_BYTE_LENGTH=32;ta.constants.PRIVATE_KEY_BYTE_LENGTH=64;ta.constants.SEED_BYTE_LENGTH=32;ta.constants.SIGN_BYTE_LENGTH=64;ta.constants.HASH_BYTE_LENGTH=64;ta.generateKeyPair=function(t){t=t||{};var e=t.seed;if(e===void 0)e=GA.random.getBytesSync(ta.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==ta.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+ta.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(e instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');e=qF({message:e,encoding:"binary"});for(var r=new ub(ta.constants.PUBLIC_KEY_BYTE_LENGTH),n=new ub(ta.constants.PRIVATE_KEY_BYTE_LENGTH),o=0;o<32;++o)n[o]=e[o];return uSs(r,n),{publicKey:r,privateKey:n}};ta.privateKeyFromAsn1=function(t){var e={},r=[],n=GA.asn1.validate(t,sSs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=GA.asn1.derToOid(e.privateKeyOid),c=GA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.privateKey,u=qF({message:GA.asn1.fromDer(l).value,encoding:"binary"});return{privateKeyBytes:u}};ta.publicKeyFromAsn1=function(t){var e={},r=[],n=GA.asn1.validate(t,oSs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=GA.asn1.derToOid(e.publicKeyOid),c=GA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.ed25519PublicKey;if(l.length!==ta.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return qF({message:l,encoding:"binary"})};ta.publicKeyFromPrivateKey=function(t){t=t||{};var e=qF({message:t.privateKey,encoding:"binary"});if(e.length!==ta.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+ta.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new ub(ta.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n=0};function qF(t){var e=t.message;if(e instanceof Uint8Array||e instanceof ub)return e;var r=t.encoding;if(e===void 0)if(t.md)e=t.md.digest().getBytes(),r="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof e=="string"&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof e=="string"){if(typeof Buffer<"u")return Buffer.from(e,r);e=new $rr(e,r)}else if(!(e instanceof $rr))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new ub(e.length()),o=0;o=0;--r){if(t[e+r]sPe[r])return!1}return!1}a(pSs,"_isCanonicalSignatureScalar");function SFn(t,e){var r,n,o,s;for(n=63;n>=32;--n){for(r=0,o=n-32,s=n-12;o>8,e[o]-=r*256;e[o]+=r,e[n]=0}for(r=0,o=0;o<32;++o)e[o]+=r-(e[31]>>4)*sPe[o],r=e[o]>>8,e[o]&=255;for(o=0;o<32;++o)e[o]-=r*sPe[o];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=e[n]&255}a(SFn,"modL");function Wrr(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;SFn(t,e)}a(Wrr,"reduce");function zrr(t,e){var r=$i(),n=$i(),o=$i(),s=$i(),c=$i(),l=$i(),u=$i(),d=$i(),f=$i();Jfe(r,t[1],t[0]),Jfe(f,e[1],e[0]),Wl(r,r,f),Kfe(n,t[0],t[1]),Kfe(f,e[0],e[1]),Wl(n,n,f),Wl(o,t[3],e[3]),Wl(o,o,cSs),Wl(s,t[2],e[2]),Kfe(s,s,s),Jfe(c,n,r),Jfe(l,s,o),Kfe(u,s,o),Kfe(d,n,r),Wl(t[0],c,l),Wl(t[1],d,u),Wl(t[2],u,l),Wl(t[3],c,d)}a(zrr,"add");function vFn(t,e,r){for(var n=0;n<4;++n)wFn(t[n],e[n],r)}a(vFn,"cswap");function Yrr(t,e){var r=$i(),n=$i(),o=$i();ySs(o,e[2]),Wl(r,e[0],o),Wl(n,e[1],o),iot(t,n),t[31]^=IFn(r)<<7}a(Yrr,"pack");function iot(t,e){var r,n,o,s=$i(),c=$i();for(r=0;r<16;++r)c[r]=e[r];for(Grr(c),Grr(c),Grr(c),n=0;n<2;++n){for(s[0]=c[0]-65517,r=1;r<15;++r)s[r]=c[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=c[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,wFn(c,s,1-o)}for(r=0;r<16;r++)t[2*r]=c[r]&255,t[2*r+1]=c[r]>>8}a(iot,"pack25519");function hSs(t,e){var r=$i(),n=$i(),o=$i(),s=$i(),c=$i(),l=$i(),u=$i();return Nj(t[2],not),mSs(t[1],e),AZ(o,t[1]),Wl(s,o,aSs),Jfe(o,o,t[2]),Kfe(s,t[2],s),AZ(c,s),AZ(l,c),Wl(u,l,c),Wl(r,u,o),Wl(r,r,s),gSs(r,r),Wl(r,r,o),Wl(r,r,s),Wl(r,r,s),Wl(t[0],r,s),AZ(n,t[0]),Wl(n,n,s),CFn(n,o)&&Wl(t[0],t[0],lSs),AZ(n,t[0]),Wl(n,n,s),CFn(n,o)?-1:(IFn(t[0])===e[31]>>7&&Jfe(t[0],Vrr,t[0]),Wl(t[3],t[0],t[1]),0)}a(hSs,"unpackneg");function mSs(t,e){var r;for(r=0;r<16;++r)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}a(mSs,"unpack25519");function gSs(t,e){var r=$i(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=250;n>=0;--n)AZ(r,r),n!==1&&Wl(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(gSs,"pow2523");function CFn(t,e){var r=new ub(32),n=new ub(32);return iot(r,t),iot(n,e),TFn(r,0,n,0)}a(CFn,"neq25519");function TFn(t,e,r,n){return ASs(t,e,r,n,32)}a(TFn,"crypto_verify_32");function ASs(t,e,r,n,o){var s,c=0;for(s=0;s>>8)-1}a(ASs,"vn");function IFn(t){var e=new ub(32);return iot(e,t),e[0]&1}a(IFn,"par25519");function xFn(t,e,r){var n,o;for(Nj(t[0],Vrr),Nj(t[1],not),Nj(t[2],not),Nj(t[3],Vrr),o=255;o>=0;--o)n=r[o/8|0]>>(o&7)&1,vFn(t,e,n),zrr(e,t),zrr(t,t),vFn(t,e,n)}a(xFn,"scalarmult");function Krr(t,e){var r=[$i(),$i(),$i(),$i()];Nj(r[0],EFn),Nj(r[1],_Fn),Nj(r[2],not),Wl(r[3],EFn,_Fn),xFn(t,r,e)}a(Krr,"scalarbase");function Nj(t,e){var r;for(r=0;r<16;r++)t[r]=e[r]|0}a(Nj,"set25519");function ySs(t,e){var r=$i(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=253;n>=0;--n)AZ(r,r),n!==2&&n!==4&&Wl(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(ySs,"inv25519");function Grr(t){var e,r,n=1;for(e=0;e<16;++e)r=t[e]+n+65535,n=Math.floor(r/65536),t[e]=r-n*65536;t[0]+=n-1+37*(n-1)}a(Grr,"car25519");function wFn(t,e,r){for(var n,o=~(r-1),s=0;s<16;++s)n=o&(t[s]^e[s]),t[s]^=n,e[s]^=n}a(wFn,"sel25519");function $i(t){var e,r=new Float64Array(16);if(t)for(e=0;e{p();var gT=As();ac();xw();tPe();NFn.exports=gT.kem=gT.kem||{};var PFn=gT.jsbn.BigInteger;gT.kem.rsa={};gT.kem.rsa.create=function(t,e){e=e||{};var r=e.prng||gT.random,n={};return n.encrypt=function(o,s){var c=Math.ceil(o.n.bitLength()/8),l;do l=new PFn(gT.util.bytesToHex(r.getBytesSync(c)),16).mod(o.n);while(l.compareTo(PFn.ONE)<=0);l=gT.util.hexToBytes(l.toString(16));var u=c-l.length;u>0&&(l=gT.util.fillString("\0",u)+l);var d=o.encrypt(l,"NONE"),f=t.generate(l,s);return{encapsulation:d,key:f}},n.decrypt=function(o,s,c){var l=o.decrypt(s,"NONE");return t.generate(l,c)},n};gT.kem.kdf1=function(t,e){DFn(this,t,0,e||t.digestLength)};gT.kem.kdf2=function(t,e){DFn(this,t,1,e||t.digestLength)};function DFn(t,e,r,n){t.generate=function(o,s){for(var c=new gT.util.ByteBuffer,l=Math.ceil(s/n)+r,u=new gT.util.ByteBuffer,d=r;d{p();var ha=As();ac();BFn.exports=ha.log=ha.log||{};ha.log.levels=["none","error","warning","info","debug","verbose","max"];var oot={},Xrr=[],lPe=null;ha.log.LEVEL_LOCKED=2;ha.log.NO_LEVEL_CHECK=4;ha.log.INTERPOLATE=8;for(x5=0;x5"u"||e?t.flags|=ha.log.LEVEL_LOCKED:t.flags&=~ha.log.LEVEL_LOCKED};ha.log.addLogger=function(t){Xrr.push(t)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(OFn={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},uPe=a(function(t,e){ha.log.prepareStandard(e);var r=OFn[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),r.apply(console,n)},"f"),Zfe=ha.log.makeLogger(uPe)):(uPe=a(function(e,r){ha.log.prepareStandardFull(r),console.log(r.standardFull)},"f"),Zfe=ha.log.makeLogger(uPe)),ha.log.setLevel(Zfe,"debug"),ha.log.addLogger(Zfe),lPe=Zfe):console={log:a(function(){},"log")};var Zfe,OFn,uPe;lPe!==null&&typeof window<"u"&&window.location&&(cPe=new URL(window.location.href).searchParams,cPe.has("console.level")&&ha.log.setLevel(lPe,cPe.get("console.level").slice(-1)[0]),cPe.has("console.lock")&&(LFn=cPe.get("console.lock").slice(-1)[0],LFn=="true"&&ha.log.lock(lPe)));var cPe,LFn;ha.log.consoleLogger=lPe});var QFn=I((aof,UFn)=>{p();UFn.exports=E5();Fit();$fe();prr();jrr()});var HFn=I((lof,jFn)=>{p();var Xr=As();Tj();v2();Xke();Ij();uZ();xrr();xw();ac();Zit();var Xe=Xr.asn1,cv=jFn.exports=Xr.pkcs7=Xr.pkcs7||{};cv.messageFromPem=function(t){var e=Xr.pem.decode(t)[0];if(e.type!=="PKCS7"){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var n=Xe.fromDer(e.body);return cv.messageFromAsn1(n)};cv.messageToPem=function(t,e){var r={type:"PKCS7",body:Xe.toDer(t.toAsn1()).getBytes()};return Xr.pem.encode(r,{maxline:e})};cv.messageFromAsn1=function(t){var e={},r=[];if(!Xe.validate(t,cv.asn1.contentInfoValidator,e,r)){var n=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw n.errors=r,n}var o=Xe.derToOid(e.contentType),s;switch(o){case Xr.pki.oids.envelopedData:s=cv.createEnvelopedData();break;case Xr.pki.oids.encryptedData:s=cv.createEncryptedData();break;case Xr.pki.oids.signedData:s=cv.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+o+" is not (yet) supported.")}return s.fromAsn1(e.content.value[0]),s};cv.createSignedData=function(){var t=null;return t={type:Xr.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:a(function(n){if(tnr(t,n,cv.asn1.signedDataValidator),t.certificates=[],t.crls=[],t.digestAlgorithmIdentifiers=[],t.contentInfo=null,t.signerInfos=[],t.rawCapture.certificates)for(var o=t.rawCapture.certificates.value,s=0;s0&&c.value[0].value.push(Xe.create(Xe.Class.CONTEXT_SPECIFIC,0,!0,n)),s.length>0&&c.value[0].value.push(Xe.create(Xe.Class.CONTEXT_SPECIFIC,1,!0,s)),c.value[0].value.push(Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SET,!0,t.signerInfos)),Xe.create(Xe.Class.UNIVERSAL,Xe.Type.SEQUENCE,!0,[Xe.create(Xe.Class.UNIVERSAL,Xe.Type.OID,!1,Xe.oidToDer(t.type).getBytes()),c])},"toAsn1"),addSigner:a(function(n){var o=n.issuer,s=n.serialNumber;if(n.certificate){var c=n.certificate;typeof c=="string"&&(c=Xr.pki.certificateFromPem(c)),o=c.issuer.attributes,s=c.serialNumber}var l=n.key;if(!l)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof l=="string"&&(l=Xr.pki.privateKeyFromPem(l));var u=n.digestAlgorithm||Xr.pki.oids.sha1;switch(u){case Xr.pki.oids.sha1:case Xr.pki.oids.sha256:case Xr.pki.oids.sha384:case Xr.pki.oids.sha512:case Xr.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+u)}var d=n.authenticatedAttributes||[];if(d.length>0){for(var f=!1,h=!1,m=0;m0){for(var r=Xe.create(Xe.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n=r&&o{p();var cm=As();Tj();qfe();Fit();$fe();ac();var aot=GFn.exports=cm.ssh=cm.ssh||{};aot.privateKeyToPutty=function(t,e,r){r=r||"",e=e||"";var n="ssh-rsa",o=e===""?"none":"aes256-cbc",s="PuTTY-User-Key-File-2: "+n+`\r +`+l+e.substr(c+1),s=o-c-1,c=-1,++o}else(e[o]===" "||e[o]===" "||e[o]===",")&&(c=o);return e}a(pot,"foldHeader");function s1s(t){return t.replace(/^\s+/,"")}a(s1s,"ltrim")});var EPe=I((taf,QFn)=>{p();var Kd=ms();oot();Zrr();uc();QFn.exports=Kd.des=Kd.des||{};Kd.des.startEncrypting=function(t,e,r,n){var o=mot({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};Kd.des.createEncryptionCipher=function(t,e){return mot({key:t,output:null,decrypt:!1,mode:e})};Kd.des.startDecrypting=function(t,e,r,n){var o=mot({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};Kd.des.createDecryptionCipher=function(t,e){return mot({key:t,output:null,decrypt:!0,mode:e})};Kd.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:a(function(n,o){return UFn(r._keys,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return UFn(r._keys,n,o,!0)},"decrypt")}}),r._init=!1};Kd.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=Kd.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=m1s(e),this._init=!0}};x5("DES-ECB",Kd.cipher.modes.ecb);x5("DES-CBC",Kd.cipher.modes.cbc);x5("DES-CFB",Kd.cipher.modes.cfb);x5("DES-OFB",Kd.cipher.modes.ofb);x5("DES-CTR",Kd.cipher.modes.ctr);x5("3DES-ECB",Kd.cipher.modes.ecb);x5("3DES-CBC",Kd.cipher.modes.cbc);x5("3DES-CFB",Kd.cipher.modes.cfb);x5("3DES-OFB",Kd.cipher.modes.ofb);x5("3DES-CTR",Kd.cipher.modes.ctr);function x5(t,e){var r=a(function(){return new Kd.des.Algorithm(t,e)},"factory");Kd.cipher.registerAlgorithm(t,r)}a(x5,"registerAlgorithm");var a1s=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],c1s=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],l1s=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u1s=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],d1s=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],f1s=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],p1s=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],h1s=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function m1s(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],o=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],c=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],l=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],d=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],m=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],A=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=t.length()>8?3:1,E=[],_=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,b,T=0;T>>4^R)&252645135,R^=b,w^=b<<4,b=(R>>>-16^w)&65535,w^=b,R^=b<<-16,b=(w>>>2^R)&858993459,R^=b,w^=b<<2,b=(R>>>-16^w)&65535,w^=b,R^=b<<-16,b=(w>>>1^R)&1431655765,R^=b,w^=b<<1,b=(R>>>8^w)&16711935,w^=b,R^=b<<8,b=(w>>>1^R)&1431655765,R^=b,w^=b<<1,b=w<<8|R>>>20&240,w=R<<24|R<<8&16711680|R>>>8&65280|R>>>24&240,R=b;for(var x=0;x<_.length;++x){_[x]?(w=w<<2|w>>>26,R=R<<2|R>>>26):(w=w<<1|w>>>27,R=R<<1|R>>>27),w&=-15,R&=-15;var P=e[w>>>28]|r[w>>>24&15]|n[w>>>20&15]|o[w>>>16&15]|s[w>>>12&15]|c[w>>>8&15]|l[w>>>4&15],D=u[R>>>28]|d[R>>>24&15]|f[R>>>20&15]|h[R>>>16&15]|m[R>>>12&15]|g[R>>>8&15]|A[R>>>4&15];b=(D>>>16^P)&65535,E[v++]=P^b,E[v++]=D^b<<16}}return E}a(m1s,"_createKeys");function UFn(t,e,r,n){var o=t.length===32?3:9,s;o===3?s=n?[30,-2,-2]:[0,32,2]:s=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var c,l=e[0],u=e[1];c=(l>>>4^u)&252645135,u^=c,l^=c<<4,c=(l>>>16^u)&65535,u^=c,l^=c<<16,c=(u>>>2^l)&858993459,l^=c,u^=c<<2,c=(u>>>8^l)&16711935,l^=c,u^=c<<8,c=(l>>>1^u)&1431655765,u^=c,l^=c<<1,l=l<<1|l>>>31,u=u<<1|u>>>31;for(var d=0;d>>4|u<<28)^t[m+1];c=l,l=u,u=c^(c1s[g>>>24&63]|u1s[g>>>16&63]|f1s[g>>>8&63]|h1s[g&63]|a1s[A>>>24&63]|l1s[A>>>16&63]|d1s[A>>>8&63]|p1s[A&63])}c=l,l=u,u=c}l=l>>>1|l<<31,u=u>>>1|u<<31,c=(l>>>1^u)&1431655765,u^=c,l^=c<<1,c=(u>>>8^l)&16711935,l^=c,u^=c<<8,c=(u>>>2^l)&858993459,l^=c,u^=c<<2,c=(l>>>16^u)&65535,u^=c,l^=c<<16,c=(l>>>4^u)&252645135,u^=c,l^=c<<4,r[0]=l,r[1]=u}a(UFn,"_updateBlock");function mot(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=Kd.cipher.createDecipher(r,t.key):n=Kd.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof Kd.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(mot,"_createCipher")});var got=I((iaf,qFn)=>{p();var uv=ms();rpe();T5();uc();var g1s=uv.pkcs5=uv.pkcs5||{},zF;uv.util.isNodejs&&!uv.options.usePureJavaScript&&(zF=require("crypto"));qFn.exports=uv.pbkdf2=g1s.pbkdf2=function(t,e,r,n,o,s){if(typeof o=="function"&&(s=o,o=null),uv.util.isNodejs&&!uv.options.usePureJavaScript&&zF.pbkdf2&&(o===null||typeof o!="object")&&(zF.pbkdf2Sync.length>4||!o||o==="sha1"))return typeof o!="string"&&(o="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?zF.pbkdf2Sync.length===4?zF.pbkdf2(t,e,r,n,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):zF.pbkdf2(t,e,r,n,o,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):zF.pbkdf2Sync.length===4?zF.pbkdf2Sync(t,e,r,n).toString("binary"):zF.pbkdf2Sync(t,e,r,n,o).toString("binary");if((typeof o>"u"||o===null)&&(o="sha1"),typeof o=="string"){if(!(o in uv.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=uv.md[o].create()}var c=o.digestLength;if(n>4294967295*c){var l=new Error("Derived key is too long.");if(s)return s(l);throw l}var u=Math.ceil(n/c),d=n-(u-1)*c,f=uv.hmac.create();f.start(o,t);var h="",m,g,A;if(!s){for(var y=1;y<=u;++y){f.start(null,null),f.update(e),f.update(uv.util.int32ToBytes(y)),m=A=f.digest().getBytes();for(var E=2;E<=r;++E)f.start(null,null),f.update(A),g=f.digest().getBytes(),m=uv.util.xorBytes(m,g,c),A=g;h+=yu)return s(null,h);f.start(null,null),f.update(e),f.update(uv.util.int32ToBytes(y)),m=A=f.digest().getBytes(),E=2,v()}a(_,"outer");function v(){if(E<=r)return f.start(null,null),f.update(A),g=f.digest().getBytes(),m=uv.util.xorBytes(m,g,c),A=g,++E,uv.util.setImmediate(v);h+=y{p();var w5=ms();T5();uc();var HFn=VFn.exports=w5.sha256=w5.sha256||{};w5.md.sha256=w5.md.algorithms.sha256=HFn;HFn.create=function(){GFn||A1s();var t=null,e=w5.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),jFn(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=w5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(inr.substr(0,n.blockLength-c));for(var l,u,d=n.fullMessageLength[0]*8,f=0;f>>0,d+=u,o.putInt32(d>>>0),d=l>>>0;o.putInt32(d);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};jFn(h,r,o);var m=w5.util.createBuffer();return m.putInt32(h.h0),m.putInt32(h.h1),m.putInt32(h.h2),m.putInt32(h.h3),m.putInt32(h.h4),m.putInt32(h.h5),m.putInt32(h.h6),m.putInt32(h.h7),m},n};var inr=null,GFn=!1,$Fn=null;function A1s(){inr="\x80",inr+=w5.util.fillString("\0",64),$Fn=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],GFn=!0}a(A1s,"_init");function jFn(t,e,r){for(var n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v=r.length();v>=64;){for(d=0;d<16;++d)e[d]=r.getInt32();for(;d<64;++d)n=e[d-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,o=e[d-15],o=(o>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,e[d]=n+e[d-7]+o+e[d-16]|0;for(f=t.h0,h=t.h1,m=t.h2,g=t.h3,A=t.h4,y=t.h5,E=t.h6,_=t.h7,d=0;d<64;++d)c=(A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7),l=E^A&(y^E),s=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),u=f&h|m&(f^h),n=_+c+l+$Fn[d]+e[d],o=s+u,_=E,E=y,y=A,A=g+n>>>0,g=m,m=h,h=f,f=n+o>>>0;t.h0=t.h0+f|0,t.h1=t.h1+h|0,t.h2=t.h2+m|0,t.h3=t.h3+g|0,t.h4=t.h4+A|0,t.h5=t.h5+y|0,t.h6=t.h6+E|0,t.h7=t.h7+_|0,v-=64}}a(jFn,"_update")});var snr=I((uaf,WFn)=>{p();var R5=ms();uc();var Aot=null;R5.util.isNodejs&&!R5.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Aot=require("crypto"));var y1s=WFn.exports=R5.prng=R5.prng||{};y1s.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),o=0;o<32;++o)n[o]=r.create();e.pools=n,e.pool=0,e.generate=function(d,f){if(!f)return e.generateSync(d);var h=e.plugin.cipher,m=e.plugin.increment,g=e.plugin.formatKey,A=e.plugin.formatSeed,y=R5.util.createBuffer();e.key=null,E();function E(_){if(_)return f(_);if(y.length()>=d)return f(null,y.getBytes(d));if(e.generated>1048575&&(e.key=null),e.key===null)return R5.util.nextTick(function(){s(E)});var v=h(e.key,e.seed);e.generated+=v.length,y.putBytes(v),e.key=g(h(e.key,m(e.seed))),e.seed=A(h(e.key,e.seed)),R5.util.setImmediate(E)}a(E,"generate")},e.generateSync=function(d){var f=e.plugin.cipher,h=e.plugin.increment,m=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var A=R5.util.createBuffer();A.length()1048575&&(e.key=null),e.key===null&&c();var y=f(e.key,e.seed);e.generated+=y.length,A.putBytes(y),e.key=m(f(e.key,h(e.seed))),e.seed=g(f(e.key,e.seed))}return A.getBytes(d)};function s(d){if(e.pools[0].messageLength>=32)return l(),d();var f=32-e.pools[0].messageLength<<5;e.seedFile(f,function(h,m){if(h)return d(h);e.collect(m),l(),d()})}a(s,"_reseed");function c(){if(e.pools[0].messageLength>=32)return l();var d=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(d)),l()}a(c,"_reseedSync");function l(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var d=e.plugin.md.create();d.update(e.keyBytes);for(var f=1,h=0;h<32;++h)e.reseeds%f===0&&(d.update(e.pools[h].digest().getBytes()),e.pools[h].start()),f=f<<1;e.keyBytes=d.digest().getBytes(),d.start(),d.update(e.keyBytes);var m=d.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(m),e.generated=0}a(l,"_seed");function u(d){var f=null,h=R5.util.globalScope,m=h.crypto||h.msCrypto;m&&m.getRandomValues&&(f=a(function(w){return m.getRandomValues(w)},"getRandomValues"));var g=R5.util.createBuffer();if(f)for(;g.length()>16),v+=(_&32767)<<16,v+=_>>15,v=(v&2147483647)+(v>>31),T=v&4294967295;for(var E=0;E<3;++E)b=T>>>(E<<3),b^=Math.floor(Math.random()*256),g.putByte(b&255)}return g.getBytes(d)}return a(u,"defaultSeedFile"),Aot?(e.seedFile=function(d,f){Aot.randomBytes(d,function(h,m){if(h)return f(h);f(null,m.toString())})},e.seedFileSync=function(d){return Aot.randomBytes(d).toString()}):(e.seedFile=function(d,f){try{f(null,u(d))}catch(h){f(h)}},e.seedFileSync=u),e.collect=function(d){for(var f=d.length,h=0;h>m&255);e.collect(h)},e.registerWorker=function(d){if(d===self)e.seedFile=function(h,m){function g(A){var y=A.data;y.forge&&y.forge.prng&&(self.removeEventListener("message",g),m(y.forge.prng.err,y.forge.prng.bytes))}a(g,"listener"),self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:h}}})};else{var f=a(function(h){var m=h.data;m.forge&&m.forge.prng&&e.seedFile(m.forge.prng.needed,function(g,A){d.postMessage({forge:{prng:{err:g,bytes:A}}})})},"listener");d.addEventListener("message",f)}},e}});var Ow=I((paf,anr)=>{p();var Og=ms();Uj();onr();snr();uc();(function(){if(Og.random&&Og.random.getBytes){anr.exports=Og.random;return}(function(t){var e={},r=new Array(4),n=Og.util.createBuffer();e.formatKey=function(h){var m=Og.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),Og.aes._expandKey(h,!1)},e.formatSeed=function(h){var m=Og.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),h},e.cipher=function(h,m){return Og.aes._updateBlock(h,m,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=Og.md.sha256;function o(){var h=Og.prng.create(e);return h.getBytes=function(m,g){return h.generate(m,g)},h.getBytesSync=function(m){return h.generate(m)},h}a(o,"spawnPrng");var s=o(),c=null,l=Og.util.globalScope,u=l.crypto||l.msCrypto;if(u&&u.getRandomValues&&(c=a(function(h){return u.getRandomValues(h)},"getRandomValues")),Og.options.usePureJavaScript||!Og.util.isNodejs&&!c){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var d="";for(var f in navigator)try{typeof navigator[f]=="string"&&(d+=navigator[f])}catch{}s.collect(d),d=null}t&&(t().mousemove(function(h){s.collectInt(h.clientX,16),s.collectInt(h.clientY,16)}),t().keypress(function(h){s.collectInt(h.charCode,8)}))}if(!Og.random)Og.random=s;else for(var f in s)Og.random[f]=s[f];Og.random.createInstance=o,anr.exports=Og.random})(typeof jQuery<"u"?jQuery:null)})()});var lnr=I((gaf,KFn)=>{p();var fb=ms();uc();var cnr=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],zFn=[1,2,3,5],E1s=a(function(t,e){return t<>16-e},"rol"),_1s=a(function(t,e){return(t&65535)>>e|t<<16-e&65535},"ror");KFn.exports=fb.rc2=fb.rc2||{};fb.rc2.expandKey=function(t,e){typeof t=="string"&&(t=fb.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),o=e,s=Math.ceil(o/8),c=255>>(o&7),l;for(l=n;l<128;l++)r.putByte(cnr[r.at(l-1)+r.at(l-n)&255]);for(r.setAt(128-s,cnr[r.at(128-s)&c]),l=127-s;l>=0;l--)r.setAt(l,cnr[r.at(l+1)^r.at(l+s)]);return r};var YFn=a(function(t,e,r){var n=!1,o=null,s=null,c=null,l,u,d,f,h=[];for(t=fb.rc2.expandKey(t,e),d=0;d<64;d++)h.push(t.getInt16Le());r?(l=a(function(A){for(d=0;d<4;d++)A[d]+=h[f]+(A[(d+3)%4]&A[(d+2)%4])+(~A[(d+3)%4]&A[(d+1)%4]),A[d]=E1s(A[d],zFn[d]),f++},"mixRound"),u=a(function(A){for(d=0;d<4;d++)A[d]+=h[A[(d+3)%4]&63]},"mashRound")):(l=a(function(A){for(d=3;d>=0;d--)A[d]=_1s(A[d],zFn[d]),A[d]-=h[f]+(A[(d+3)%4]&A[(d+2)%4])+(~A[(d+3)%4]&A[(d+1)%4]),f--},"mixRound"),u=a(function(A){for(d=3;d>=0;d--)A[d]-=h[A[(d+3)%4]&63]},"mashRound"));var m=a(function(A){var y=[];for(d=0;d<4;d++){var E=o.getInt16Le();c!==null&&(r?E^=c.getInt16Le():c.putInt16Le(E)),y.push(E&65535)}f=r?0:63;for(var _=0;_=8;)m([[5,l],[1,u],[6,l],[1,u],[5,l]])},"update"),finish:a(function(A){var y=!0;if(r)if(A)y=A(8,o,!r);else{var E=o.length()===8?8:8-o.length();o.fillWithByte(E,E)}if(y&&(n=!0,g.update()),!r&&(y=o.length()===0,y))if(A)y=A(8,s,!r);else{var _=s.length(),v=s.at(_-1);v>_?y=!1:s.truncate(v)}return y},"finish")},g},"createCipher");fb.rc2.startEncrypting=function(t,e,r){var n=fb.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};fb.rc2.createEncryptionCipher=function(t,e){return YFn(t,e,!0)};fb.rc2.startDecrypting=function(t,e,r){var n=fb.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};fb.rc2.createDecryptionCipher=function(t,e){return YFn(t,e,!1)}});var vPe=I((Eaf,i8n)=>{p();var unr=ms();i8n.exports=unr.jsbn=unr.jsbn||{};var YF,v1s=0xdeadbeefcafe,JFn=(v1s&16777215)==15715070;function Wt(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}a(Wt,"BigInteger");unr.jsbn.BigInteger=Wt;function Ya(){return new Wt(null)}a(Ya,"nbi");function C1s(t,e,r,n,o,s){for(;--s>=0;){var c=e*this.data[t++]+r.data[n]+o;o=Math.floor(c/67108864),r.data[n++]=c&67108863}return o}a(C1s,"am1");function b1s(t,e,r,n,o,s){for(var c=e&32767,l=e>>15;--s>=0;){var u=this.data[t]&32767,d=this.data[t++]>>15,f=l*u+d*c;u=c*u+((f&32767)<<15)+r.data[n]+(o&1073741823),o=(u>>>30)+(f>>>15)+l*d+(o>>>30),r.data[n++]=u&1073741823}return o}a(b1s,"am2");function ZFn(t,e,r,n,o,s){for(var c=e&16383,l=e>>14;--s>=0;){var u=this.data[t]&16383,d=this.data[t++]>>14,f=l*u+d*c;u=c*u+((f&16383)<<14)+r.data[n]+o,o=(u>>28)+(f>>14)+l*d,r.data[n++]=u&268435455}return o}a(ZFn,"am3");typeof navigator>"u"?(Wt.prototype.am=ZFn,YF=28):JFn&&navigator.appName=="Microsoft Internet Explorer"?(Wt.prototype.am=b1s,YF=30):JFn&&navigator.appName!="Netscape"?(Wt.prototype.am=C1s,YF=26):(Wt.prototype.am=ZFn,YF=28);Wt.prototype.DB=YF;Wt.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}a(T1s,"bnpCopyTo");function I1s(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}a(I1s,"bnpFromInt");function qj(t){var e=Ya();return e.fromInt(t),e}a(qj,"nbv");function x1s(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,o=!1,s=0;--n>=0;){var c=r==8?t[n]&255:e8n(t,n);if(c<0){t.charAt(n)=="-"&&(o=!0);continue}o=!1,s==0?this.data[this.t++]=c:s+r>this.DB?(this.data[this.t-1]|=(c&(1<>this.DB-s):this.data[this.t-1]|=c<=this.DB&&(s-=this.DB)}r==8&&(t[0]&128)!=0&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}a(w1s,"bnpClamp");function R1s(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(l>l)>0&&(o=!0,s=XFn(n));c>=0;)l>(l+=this.DB-e)):(n=this.data[c]>>(l-=e)&r,l<=0&&(l+=this.DB,--c)),n>0&&(o=!0),o&&(s+=XFn(n));return o?s:"0"}a(R1s,"bnToString");function k1s(){var t=Ya();return Wt.ZERO.subTo(this,t),t}a(k1s,"bnNegate");function P1s(){return this.s<0?this.negate():this}a(P1s,"bnAbs");function D1s(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}a(D1s,"bnCompareTo");function Eot(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}a(Eot,"nbits");function N1s(){return this.t<=0?0:this.DB*(this.t-1)+Eot(this.data[this.t-1]^this.s&this.DM)}a(N1s,"bnBitLength");function M1s(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}a(M1s,"bnpDLShiftTo");function O1s(t,e){for(var r=t;r=0;--l)e.data[l+s+1]=this.data[l]>>n|c,c=(this.data[l]&o)<=0;--l)e.data[l]=0;e.data[s]=c,e.t=this.t+s+1,e.s=this.s,e.clamp()}a(L1s,"bnpLShiftTo");function B1s(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,o=this.DB-n,s=(1<>n;for(var c=r+1;c>n;n>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}a(F1s,"bnpSubTo");function U1s(t,e){var r=this.abs(),n=t.abs(),o=r.t;for(e.t=o+n.t;--o>=0;)e.data[o]=0;for(o=0;o=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}a(Q1s,"bnpSquareTo");function q1s(t,e,r){var n=t.abs();if(!(n.t<=0)){var o=this.abs();if(o.t0?(n.lShiftTo(u,s),o.lShiftTo(u,r)):(n.copyTo(s),o.copyTo(r));var d=s.t,f=s.data[d-1];if(f!=0){var h=f*(1<1?s.data[d-2]>>this.F2:0),m=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(_,r)),Wt.ONE.dlShiftTo(d,_),_.subTo(s,s);s.t=0;){var v=r.data[--y]==f?this.DM:Math.floor(r.data[y]*m+(r.data[y-1]+A)*g);if((r.data[y]+=s.am(0,v,r,E,0,d))0&&r.rShiftTo(u,r),c<0&&Wt.ZERO.subTo(r,r)}}}a(q1s,"bnpDivRemTo");function j1s(t){var e=Ya();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(Wt.ZERO)>0&&t.subTo(e,e),e}a(j1s,"bnMod");function vZ(t){this.m=t}a(vZ,"Classic");function H1s(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}a(H1s,"cConvert");function G1s(t){return t}a(G1s,"cRevert");function $1s(t){t.divRemTo(this.m,null,t)}a($1s,"cReduce");function V1s(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(V1s,"cMulTo");function W1s(t,e){t.squareTo(e),this.reduce(e)}a(W1s,"cSqrTo");vZ.prototype.convert=H1s;vZ.prototype.revert=G1s;vZ.prototype.reduce=$1s;vZ.prototype.mulTo=V1s;vZ.prototype.sqrTo=W1s;function z1s(){if(this.t<1)return 0;var t=this.data[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}a(z1s,"bnpInvDigit");function CZ(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}a(Y1s,"montConvert");function K1s(t){var e=Ya();return t.copyTo(e),this.reduce(e),e}a(K1s,"montRevert");function J1s(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}a(J1s,"montReduce");function Z1s(t,e){t.squareTo(e),this.reduce(e)}a(Z1s,"montSqrTo");function X1s(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(X1s,"montMulTo");CZ.prototype.convert=Y1s;CZ.prototype.revert=K1s;CZ.prototype.reduce=J1s;CZ.prototype.mulTo=X1s;CZ.prototype.sqrTo=Z1s;function eSs(){return(this.t>0?this.data[0]&1:this.s)==0}a(eSs,"bnpIsEven");function tSs(t,e){if(t>4294967295||t<1)return Wt.ONE;var r=Ya(),n=Ya(),o=e.convert(this),s=Eot(t)-1;for(o.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,o,r);else{var c=r;r=n,n=c}return e.revert(r)}a(tSs,"bnpExp");function rSs(t,e){var r;return t<256||e.isEven()?r=new vZ(e):r=new CZ(e),this.exp(t,r)}a(rSs,"bnModPowInt");Wt.prototype.copyTo=T1s;Wt.prototype.fromInt=I1s;Wt.prototype.fromString=x1s;Wt.prototype.clamp=w1s;Wt.prototype.dlShiftTo=M1s;Wt.prototype.drShiftTo=O1s;Wt.prototype.lShiftTo=L1s;Wt.prototype.rShiftTo=B1s;Wt.prototype.subTo=F1s;Wt.prototype.multiplyTo=U1s;Wt.prototype.squareTo=Q1s;Wt.prototype.divRemTo=q1s;Wt.prototype.invDigit=z1s;Wt.prototype.isEven=eSs;Wt.prototype.exp=tSs;Wt.prototype.toString=R1s;Wt.prototype.negate=k1s;Wt.prototype.abs=P1s;Wt.prototype.compareTo=D1s;Wt.prototype.bitLength=N1s;Wt.prototype.mod=j1s;Wt.prototype.modPowInt=rSs;Wt.ZERO=qj(0);Wt.ONE=qj(1);function nSs(){var t=Ya();return this.copyTo(t),t}a(nSs,"bnClone");function iSs(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}a(oSs,"bnByteValue");function sSs(){return this.t==0?this.s:this.data[0]<<16>>16}a(sSs,"bnShortValue");function aSs(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}a(aSs,"bnpChunkSize");function cSs(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}a(cSs,"bnSigNum");function lSs(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=qj(r),o=Ya(),s=Ya(),c="";for(this.divRemTo(n,o,s);o.signum()>0;)c=(r+s.intValue()).toString(t).substr(1)+c,o.divRemTo(n,o,s);return s.intValue().toString(t)+c}a(lSs,"bnpToRadix");function uSs(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),o=!1,s=0,c=0,l=0;l=r&&(this.dMultiply(n),this.dAddOffset(c,0),s=0,c=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(c,0)),o&&Wt.ZERO.subTo(this,this)}a(uSs,"bnpFromRadix");function dSs(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(Wt.ONE.shiftLeft(t-1),fnr,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(Wt.ONE.shiftLeft(t-1),this);else{var n=new Array,o=t&7;n.length=(t>>3)+1,e.nextBytes(n),o>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[o++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),(n&128)!=0&&(n|=-256),o==0&&(this.s&128)!=(n&128)&&++o,(o>0||n!=this.s)&&(e[o++]=n);return e}a(fSs,"bnToByteArray");function pSs(t){return this.compareTo(t)==0}a(pSs,"bnEquals");function hSs(t){return this.compareTo(t)<0?this:t}a(hSs,"bnMin");function mSs(t){return this.compareTo(t)>0?this:t}a(mSs,"bnMax");function gSs(t,e,r){var n,o,s=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),(t&255)==0&&(t>>=8,e+=8),(t&15)==0&&(t>>=4,e+=4),(t&3)==0&&(t>>=2,e+=2),(t&1)==0&&++e,e}a(TSs,"lbit");function ISs(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}a(MSs,"bnpAddTo");function OSs(t){var e=Ya();return this.addTo(t,e),e}a(OSs,"bnAdd");function LSs(t){var e=Ya();return this.subTo(t,e),e}a(LSs,"bnSubtract");function BSs(t){var e=Ya();return this.multiplyTo(t,e),e}a(BSs,"bnMultiply");function FSs(){var t=Ya();return this.squareTo(t),t}a(FSs,"bnSquare");function USs(t){var e=Ya();return this.divRemTo(t,e,null),e}a(USs,"bnDivide");function QSs(t){var e=Ya();return this.divRemTo(t,null,e),e}a(QSs,"bnRemainder");function qSs(t){var e=Ya(),r=Ya();return this.divRemTo(t,e,r),new Array(e,r)}a(qSs,"bnDivideAndRemainder");function jSs(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}a(jSs,"bnpDMultiply");function HSs(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}a(HSs,"bnpDAddOffset");function _Pe(){}a(_Pe,"NullExp");function n8n(t){return t}a(n8n,"nNop");function GSs(t,e,r){t.multiplyTo(e,r)}a(GSs,"nMulTo");function $Ss(t,e){t.squareTo(e)}a($Ss,"nSqrTo");_Pe.prototype.convert=n8n;_Pe.prototype.revert=n8n;_Pe.prototype.mulTo=GSs;_Pe.prototype.sqrTo=$Ss;function VSs(t){return this.exp(t,new _Pe)}a(VSs,"bnPow");function WSs(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var o;for(o=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=Ya();return t.copyTo(e),this.reduce(e),e}a(YSs,"barrettConvert");function KSs(t){return t}a(KSs,"barrettRevert");function JSs(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}a(JSs,"barrettReduce");function ZSs(t,e){t.squareTo(e),this.reduce(e)}a(ZSs,"barrettSqrTo");function XSs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(XSs,"barrettMulTo");ope.prototype.convert=YSs;ope.prototype.revert=KSs;ope.prototype.reduce=JSs;ope.prototype.mulTo=XSs;ope.prototype.sqrTo=ZSs;function eTs(t,e){var r=t.bitLength(),n,o=qj(1),s;if(r<=0)return o;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new vZ(e):e.isEven()?s=new ope(e):s=new CZ(e);var c=new Array,l=3,u=n-1,d=(1<1){var f=Ya();for(s.sqrTo(c[1],f);l<=d;)c[l]=Ya(),s.mulTo(f,c[l-2],c[l]),l+=2}var h=t.t-1,m,g=!0,A=Ya(),y;for(r=Eot(t.data[h])-1;h>=0;){for(r>=u?m=t.data[h]>>r-u&d:(m=(t.data[h]&(1<0&&(m|=t.data[h-1]>>this.DB+r-u)),l=n;(m&1)==0;)m>>=1,--l;if((r-=l)<0&&(r+=this.DB,--h),g)c[m].copyTo(o),g=!1;else{for(;l>1;)s.sqrTo(o,A),s.sqrTo(A,o),l-=2;l>0?s.sqrTo(o,A):(y=o,o=A,A=y),s.mulTo(A,c[m],o)}for(;h>=0&&(t.data[h]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(o=e.getLowestSetBit())>0&&e.rShiftTo(o,e),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}a(tTs,"bnGCD");function rTs(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}a(rTs,"bnpModInt");function nTs(t){if(this.signum()==0)return Wt.ZERO;var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return Wt.ZERO;for(var r=t.clone(),n=this.clone(),o=qj(1),s=qj(0),c=qj(0),l=qj(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!o.isEven()||!s.isEven())&&(o.addTo(this,o),s.subTo(t,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!c.isEven()||!l.isEven())&&(c.addTo(this,c),l.subTo(t,l)),c.rShiftTo(1,c)):l.isEven()||l.subTo(t,l),l.rShiftTo(1,l);r.compareTo(n)>=0?(r.subTo(n,r),e&&o.subTo(c,o),s.subTo(l,s)):(n.subTo(r,n),e&&c.subTo(o,c),l.subTo(s,l))}if(n.compareTo(Wt.ONE)!=0)return Wt.ZERO;if(l.compareTo(t)>=0)return l.subtract(t);if(l.signum()<0)l.addTo(t,l);else return l;return l.signum()<0?l.add(t):l}a(nTs,"bnModInverse");var k2=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],iTs=(1<<26)/k2[k2.length-1];function oTs(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=k2[k2.length-1]){for(e=0;e=0);var l=s.modPow(n,this);if(l.compareTo(Wt.ONE)!=0&&l.compareTo(e)!=0){for(var u=1;u++{p();var k5=ms();T5();uc();var s8n=c8n.exports=k5.sha1=k5.sha1||{};k5.md.sha1=k5.md.algorithms.sha1=s8n;s8n.create=function(){a8n||cTs();var t=null,e=k5.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),o8n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=k5.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(pnr.substr(0,n.blockLength-c));for(var l,u,d=n.fullMessageLength[0]*8,f=0;f>>0,d+=u,o.putInt32(d>>>0),d=l>>>0;o.putInt32(d);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};o8n(h,r,o);var m=k5.util.createBuffer();return m.putInt32(h.h0),m.putInt32(h.h1),m.putInt32(h.h2),m.putInt32(h.h3),m.putInt32(h.h4),m},n};var pnr=null,a8n=!1;function cTs(){pnr="\x80",pnr+=k5.util.fillString("\0",64),a8n=!0}a(cTs,"_init");function o8n(t,e,r){for(var n,o,s,c,l,u,d,f,h=r.length();h>=64;){for(o=t.h0,s=t.h1,c=t.h2,l=t.h3,u=t.h4,f=0;f<16;++f)n=r.getInt32(),e[f]=n,d=l^s&(c^l),n=(o<<5|o>>>27)+d+u+1518500249+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<20;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,d=l^s&(c^l),n=(o<<5|o>>>27)+d+u+1518500249+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<32;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+1859775393+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<40;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+1859775393+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<60;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s&c|l&(s^c),n=(o<<5|o>>>27)+d+u+2400959708+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<80;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+3395469782+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;t.h0=t.h0+o|0,t.h1=t.h1+s|0,t.h2=t.h2+c|0,t.h3=t.h3+l|0,t.h4=t.h4+u|0,h-=64}}a(o8n,"_update")});var hnr=I((Taf,u8n)=>{p();var P5=ms();uc();Ow();spe();var l8n=u8n.exports=P5.pkcs1=P5.pkcs1||{};l8n.encode_rsa_oaep=function(t,e,r){var n,o,s,c;typeof r=="string"?(n=r,o=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,o=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),s?s.start():s=P5.md.sha1.create(),c||(c=s);var l=Math.ceil(t.n.bitLength()/8),u=l-2*s.digestLength-2;if(e.length>u){var d=new Error("RSAES-OAEP input message length is too long.");throw d.length=e.length,d.maxLength=u,d}n||(n=""),s.update(n,"raw");for(var f=s.digest(),h="",m=u-e.length,g=0;g>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+c),n+=r.digest().getBytes()}return n.substring(0,e)}a(_ot,"rsa_mgf1")});var gnr=I((waf,mnr)=>{p();var jj=ms();uc();vPe();Ow();(function(){if(jj.prime){mnr.exports=jj.prime;return}var t=mnr.exports=jj.prime=jj.prime||{},e=jj.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var o=a(function(h,m){return h|m},"op_or");t.generateProbablePrime=function(h,m,g){typeof m=="function"&&(g=m,m={}),m=m||{};var A=m.algorithm||"PRIMEINC";typeof A=="string"&&(A={name:A}),A.options=A.options||{};var y=m.prng||jj.random,E={nextBytes:a(function(_){for(var v=y.getBytesSync(_.length),b=0;b<_.length;++b)_[b]=v.charCodeAt(b)},"nextBytes")};if(A.name==="PRIMEINC")return s(h,E,A.options,g);throw new Error("Invalid prime generation algorithm: "+A.name)};function s(h,m,g,A){return"workers"in g?u(h,m,g,A):c(h,m,g,A)}a(s,"primeincFindPrime");function c(h,m,g,A){var y=d(h,m),E=0,_=f(y.bitLength());"millerRabinTests"in g&&(_=g.millerRabinTests);var v=10;"maxBlockTime"in g&&(v=g.maxBlockTime),l(y,h,m,E,_,v,A)}a(c,"primeincFindPrimeWithoutWorkers");function l(h,m,g,A,y,E,_){var v=+new Date;do{if(h.bitLength()>m&&(h=d(m,g)),h.isProbablePrime(y))return _(null,h);h.dAddOffset(r[A++%8],0)}while(E<0||+new Date-v"u")return c(h,m,g,A);var y=d(h,m),E=g.workers,_=g.workLoad||100,v=_*30/8,b=g.workerScript||"forge/prime.worker.js";if(E===-1)return jj.util.estimateCores(function(w,R){w&&(R=2),E=R-1,T()});T();function T(){E=Math.max(1,E);for(var w=[],R=0;Rh&&(y=d(h,m));var j=y.toString(16);N.target.postMessage({hex:j,workLoad:_}),y.dAddOffset(v,0)}}a(D,"workerMessage")}a(T,"generate")}a(u,"primeincFindPrimeWithWorkers");function d(h,m){var g=new e(h,m),A=h-1;return g.testBit(A)||g.bitwiseTo(e.ONE.shiftLeft(A),o,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}a(d,"generateRandom");function f(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}a(f,"getMillerRabinTests")})()});var CPe=I((Paf,A8n)=>{p();var Ci=ms();R2();vPe();Qj();hnr();gnr();Ow();uc();typeof Ka>"u"&&(Ka=Ci.jsbn.BigInteger);var Ka,Anr=Ci.util.isNodejs?require("crypto"):null,ht=Ci.asn1,Bw=Ci.util;Ci.pki=Ci.pki||{};A8n.exports=Ci.pki.rsa=Ci.rsa=Ci.rsa||{};var qo=Ci.pki,lTs=[6,4,2,4,2,4,6,2],uTs={name:"PrivateKeyInfo",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ht.Class.UNIVERSAL,type:ht.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:ht.Class.UNIVERSAL,type:ht.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},dTs={name:"RSAPrivateKey",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},fTs={name:"RSAPublicKey",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:ht.Class.UNIVERSAL,type:ht.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},pTs=Ci.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ht.Class.UNIVERSAL,type:ht.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:ht.Class.UNIVERSAL,type:ht.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},hTs={name:"DigestInfo",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:ht.Class.UNIVERSAL,type:ht.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:ht.Class.UNIVERSAL,type:ht.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:ht.Class.UNIVERSAL,type:ht.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:ht.Class.UNIVERSAL,type:ht.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},mTs=a(function(t){var e;if(t.algorithm in qo.oids)e=qo.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=ht.oidToDer(e).getBytes(),o=ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[]),s=ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[]);s.value.push(ht.create(ht.Class.UNIVERSAL,ht.Type.OID,!1,n)),s.value.push(ht.create(ht.Class.UNIVERSAL,ht.Type.NULL,!1,""));var c=ht.create(ht.Class.UNIVERSAL,ht.Type.OCTETSTRING,!1,t.digest().getBytes());return o.value.push(s),o.value.push(c),ht.toDer(o).getBytes()},"emsaPkcs1v15encode"),m8n=a(function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(Ka.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(Ka.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new Ka(Ci.util.bytesToHex(Ci.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(Ka.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var o=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);o.compareTo(s)<0;)o=o.add(e.p);var c=o.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return c=c.multiply(n.modInverse(e.n)).mod(e.n),c},"_modPow");qo.rsa.encrypt=function(t,e,r){var n=r,o,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,o=g8n(t,e,r)):(o=Ci.util.createBuffer(),o.putBytes(t));for(var c=new Ka(o.toHex(),16),l=m8n(c,e,n),u=l.toString(16),d=Ci.util.createBuffer(),f=s-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(Ci.util.hexToBytes(u)),d.getBytes()};qo.rsa.decrypt=function(t,e,r,n){var o=Math.ceil(e.n.bitLength()/8);if(t.length!==o){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=o,s}var c=new Ka(Ci.util.createBuffer(t).toHex(),16);if(c.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=m8n(c,e,r),u=l.toString(16),d=Ci.util.createBuffer(),f=o-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(Ci.util.hexToBytes(u)),n!==!1?vot(d.getBytes(),e,r):d.getBytes()};qo.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||Ci.random,o={nextBytes:a(function(l){for(var u=n.getBytesSync(l.length),d=0;d>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},c.e.fromInt(c.eInt);else throw new Error("Invalid key generation algorithm: "+s);return c};qo.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new Ka(null);r.fromInt(30);for(var n=0,o=a(function(h,m){return h|m},"op_or"),s=+new Date,c,l=0;t.keys===null&&(e<=0||lu?t.pqState=0:t.num.isProbablePrime(ATs(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(lTs[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(Ka.ONE).gcd(t.e).compareTo(Ka.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(Ka.ONE),t.q1=t.q.subtract(Ka.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(Ka.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var f=t.e.modInverse(t.phi);t.keys={privateKey:qo.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:qo.rsa.setPublicKey(t.n,t.e)}}c=+new Date,l+=c-s,s=c}return t.keys!==null};qo.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!Ci.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(d8n("generateKeyPair"))return Anr.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(l,u,d){if(l)return n(l);n(null,{privateKey:qo.privateKeyFromPem(d),publicKey:qo.publicKeyFromPem(u)})});if(f8n("generateKey")&&f8n("exportKey"))return Bw.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:h8n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(l){return Bw.globalScope.crypto.subtle.exportKey("pkcs8",l.privateKey)}).then(void 0,function(l){n(l)}).then(function(l){if(l){var u=qo.privateKeyFromAsn1(ht.fromDer(Ci.util.createBuffer(l)));n(null,{privateKey:u,publicKey:qo.setRsaPublicKey(u.n,u.e)})}});if(p8n("generateKey")&&p8n("exportKey")){var o=Bw.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:h8n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);o.oncomplete=function(l){var u=l.target.result,d=Bw.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);d.oncomplete=function(f){var h=f.target.result,m=qo.privateKeyFromAsn1(ht.fromDer(Ci.util.createBuffer(h)));n(null,{privateKey:m,publicKey:qo.setRsaPublicKey(m.n,m.e)})},d.onerror=function(f){n(f)}},o.onerror=function(l){n(l)};return}}else if(d8n("generateKeyPairSync")){var s=Anr.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:qo.privateKeyFromPem(s.privateKey),publicKey:qo.publicKeyFromPem(s.publicKey)}}}var c=qo.rsa.createKeyPairGenerationState(t,e,r);if(!n)return qo.rsa.stepKeyPairGenerationState(c,0),c.keys;gTs(c,r,n)};qo.setRsaPublicKey=qo.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,o,s){if(typeof o=="string"?o=o.toUpperCase():o===void 0&&(o="RSAES-PKCS1-V1_5"),o==="RSAES-PKCS1-V1_5")o={encode:a(function(l,u,d){return g8n(l,u,2).getBytes()},"encode")};else if(o==="RSA-OAEP"||o==="RSAES-OAEP")o={encode:a(function(l,u){return Ci.pkcs1.encode_rsa_oaep(u,l,s)},"encode")};else if(["RAW","NONE","NULL",null].indexOf(o)!==-1)o={encode:a(function(l){return l},"encode")};else if(typeof o=="string")throw new Error('Unsupported encryption scheme: "'+o+'".');var c=o.encode(n,r,!0);return qo.rsa.encrypt(c,r,!0)},r.verify=function(n,o,s,c){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),c===void 0&&(c={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in c||(c._parseAllDigestBytes=!0),"_skipPaddingChecks"in c||(c._skipPaddingChecks=!1),s==="RSASSA-PKCS1-V1_5"?s={verify:a(function(u,d){d=vot(d,r,!0,void 0,c);var f=ht.fromDer(d,{parseAllBytes:c._parseAllDigestBytes}),h={},m=[];if(!ht.validate(f,hTs,h,m)||f.value.length!==2){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=m,g}var A=ht.derToOid(h.algorithmIdentifier);if(!(A===Ci.oids.md2||A===Ci.oids.md5||A===Ci.oids.sha1||A===Ci.oids.sha224||A===Ci.oids.sha256||A===Ci.oids.sha384||A===Ci.oids.sha512||A===Ci.oids["sha512-224"]||A===Ci.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=A,g}if((A===Ci.oids.md2||A===Ci.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return u===h.digest},"verify")}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:a(function(u,d){return d=vot(d,r,!0,void 0,c),u===d},"verify")});var l=qo.rsa.decrypt(o,r,!0,!1);return s.verify(n,l,r.n.bitLength())},r};qo.setRsaPrivateKey=qo.rsa.setPrivateKey=function(t,e,r,n,o,s,c,l){var u={n:t,e,d:r,p:n,q:o,dP:s,dQ:c,qInv:l};return u.decrypt=function(d,f,h){typeof f=="string"?f=f.toUpperCase():f===void 0&&(f="RSAES-PKCS1-V1_5");var m=qo.rsa.decrypt(d,u,!1,!1);if(f==="RSAES-PKCS1-V1_5")f={decode:vot};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:a(function(g,A){return Ci.pkcs1.decode_rsa_oaep(A,g,h)},"decode")};else if(["RAW","NONE","NULL",null].indexOf(f)!==-1)f={decode:a(function(g){return g},"decode")};else throw new Error('Unsupported encryption scheme: "'+f+'".');return f.decode(m,u,!1)},u.sign=function(d,f){var h=!1;typeof f=="string"&&(f=f.toUpperCase()),f===void 0||f==="RSASSA-PKCS1-V1_5"?(f={encode:mTs},h=1):(f==="NONE"||f==="NULL"||f===null)&&(f={encode:a(function(){return d},"encode")},h=1);var m=f.encode(d,u.n.bitLength());return qo.rsa.encrypt(m,u,h)},u};qo.wrapRsaPrivateKey=function(t){return ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,ht.integerToDer(0).getBytes()),ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.OID,!1,ht.oidToDer(qo.oids.rsaEncryption).getBytes()),ht.create(ht.Class.UNIVERSAL,ht.Type.NULL,!1,"")]),ht.create(ht.Class.UNIVERSAL,ht.Type.OCTETSTRING,!1,ht.toDer(t).getBytes())])};qo.privateKeyFromAsn1=function(t){var e={},r=[];if(ht.validate(t,uTs,e,r)&&(t=ht.fromDer(Ci.util.createBuffer(e.privateKey))),e={},r=[],!ht.validate(t,dTs,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var o,s,c,l,u,d,f,h;return o=Ci.util.createBuffer(e.privateKeyModulus).toHex(),s=Ci.util.createBuffer(e.privateKeyPublicExponent).toHex(),c=Ci.util.createBuffer(e.privateKeyPrivateExponent).toHex(),l=Ci.util.createBuffer(e.privateKeyPrime1).toHex(),u=Ci.util.createBuffer(e.privateKeyPrime2).toHex(),d=Ci.util.createBuffer(e.privateKeyExponent1).toHex(),f=Ci.util.createBuffer(e.privateKeyExponent2).toHex(),h=Ci.util.createBuffer(e.privateKeyCoefficient).toHex(),qo.setRsaPrivateKey(new Ka(o,16),new Ka(s,16),new Ka(c,16),new Ka(l,16),new Ka(u,16),new Ka(d,16),new Ka(f,16),new Ka(h,16))};qo.privateKeyToAsn1=qo.privateKeyToRSAPrivateKey=function(t){return ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,ht.integerToDer(0).getBytes()),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,D5(t.n)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,D5(t.e)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,D5(t.d)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,D5(t.p)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,D5(t.q)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,D5(t.dP)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,D5(t.dQ)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,D5(t.qInv))])};qo.publicKeyFromAsn1=function(t){var e={},r=[];if(ht.validate(t,pTs,e,r)){var n=ht.derToOid(e.publicKeyOid);if(n!==qo.oids.rsaEncryption){var o=new Error("Cannot read public key. Unknown OID.");throw o.oid=n,o}t=e.rsaPublicKey}if(r=[],!ht.validate(t,fTs,e,r)){var o=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw o.errors=r,o}var s=Ci.util.createBuffer(e.publicKeyModulus).toHex(),c=Ci.util.createBuffer(e.publicKeyExponent).toHex();return qo.setRsaPublicKey(new Ka(s,16),new Ka(c,16))};qo.publicKeyToAsn1=qo.publicKeyToSubjectPublicKeyInfo=function(t){return ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.OID,!1,ht.oidToDer(qo.oids.rsaEncryption).getBytes()),ht.create(ht.Class.UNIVERSAL,ht.Type.NULL,!1,"")]),ht.create(ht.Class.UNIVERSAL,ht.Type.BITSTRING,!1,[qo.publicKeyToRSAPublicKey(t)])])};qo.publicKeyToRSAPublicKey=function(t){return ht.create(ht.Class.UNIVERSAL,ht.Type.SEQUENCE,!0,[ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,D5(t.n)),ht.create(ht.Class.UNIVERSAL,ht.Type.INTEGER,!1,D5(t.e))])};function g8n(t,e,r){var n=Ci.util.createBuffer(),o=Math.ceil(e.n.bitLength()/8);if(t.length>o-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=o-11,s}n.putByte(0),n.putByte(r);var c=o-3-t.length,l;if(r===0||r===1){l=r===0?0:255;for(var u=0;u0;){for(var d=0,f=Ci.random.getBytes(c),u=0;u"u")throw new Error("Encryption block is invalid.");var d=0;if(u===0){d=s-3-n;for(var f=0;f1;){if(c.getByte()!==255){--c.read;break}++d}if(d<8&&!(o&&o._skipPaddingChecks))throw new Error("Encryption block is invalid.")}else if(u===2){for(d=0;c.length()>1;){if(c.getByte()===0){--c.read;break}++d}if(d<8&&!(o&&o._skipPaddingChecks))throw new Error("Encryption block is invalid.")}var h=c.getByte();if(h!==0||d!==s-3-c.length())throw new Error("Encryption block is invalid.");return c.getBytes()}a(vot,"_decodePkcs1_v1_5");function gTs(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),o();function o(){s(t.pBits,function(l,u){if(l)return r(l);if(t.p=u,t.q!==null)return c(l,t.q);s(t.qBits,c)})}a(o,"generate");function s(l,u){Ci.prime.generateProbablePrime(l,n,u)}a(s,"getPrime");function c(l,u){if(l)return r(l);if(t.q=u,t.p.compareTo(t.q)<0){var d=t.p;t.p=t.q,t.q=d}if(t.p.subtract(Ka.ONE).gcd(t.e).compareTo(Ka.ONE)!==0){t.p=null,o();return}if(t.q.subtract(Ka.ONE).gcd(t.e).compareTo(Ka.ONE)!==0){t.q=null,s(t.qBits,c);return}if(t.p1=t.p.subtract(Ka.ONE),t.q1=t.q.subtract(Ka.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(Ka.ONE)!==0){t.p=t.q=null,o();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,c);return}var f=t.e.modInverse(t.phi);t.keys={privateKey:qo.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:qo.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}a(c,"finish")}a(gTs,"_generateKeyPair");function D5(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=Ci.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&(r.charCodeAt(1)&128)===0||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}a(D5,"_bnToBytes");function ATs(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}a(ATs,"_getMillerRabinTests");function d8n(t){return Ci.util.isNodejs&&typeof Anr[t]=="function"}a(d8n,"_detectNodeCrypto");function f8n(t){return typeof Bw.globalScope<"u"&&typeof Bw.globalScope.crypto=="object"&&typeof Bw.globalScope.crypto.subtle=="object"&&typeof Bw.globalScope.crypto.subtle[t]=="function"}a(f8n,"_detectSubtleCrypto");function p8n(t){return typeof Bw.globalScope<"u"&&typeof Bw.globalScope.msCrypto=="object"&&typeof Bw.globalScope.msCrypto.subtle=="object"&&typeof Bw.globalScope.msCrypto.subtle[t]=="function"}a(p8n,"_detectSubtleMsCrypto");function h8n(t){for(var e=Ci.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{p();var _n=ms();Uj();R2();EPe();T5();Qj();got();_Z();Ow();lnr();CPe();uc();typeof y8n>"u"&&(y8n=_n.jsbn.BigInteger);var y8n,Mt=_n.asn1,ss=_n.pki=_n.pki||{};C8n.exports=ss.pbe=_n.pbe=_n.pbe||{};var bZ=ss.oids,yTs={name:"EncryptedPrivateKeyInfo",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},ETs={name:"PBES2Algorithms",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},_Ts={name:"pkcs-12PbeParams",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:Mt.Class.UNIVERSAL,type:Mt.Type.INTEGER,constructed:!1,capture:"iterations"}]};ss.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=_n.random.getBytesSync(r.saltSize),o=r.count,s=Mt.integerToDer(o),c,l,u;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var d,f,h;switch(r.algorithm){case"aes128":c=16,d=16,f=bZ["aes128-CBC"],h=_n.aes.createEncryptionCipher;break;case"aes192":c=24,d=16,f=bZ["aes192-CBC"],h=_n.aes.createEncryptionCipher;break;case"aes256":c=32,d=16,f=bZ["aes256-CBC"],h=_n.aes.createEncryptionCipher;break;case"des":c=8,d=8,f=bZ.desCBC,h=_n.des.createEncryptionCipher;break;default:var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=r.algorithm,m}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),A=v8n(g),y=_n.pkcs5.pbkdf2(e,n,o,c,A),E=_n.random.getBytesSync(d),_=h(y);_.start(E),_.update(Mt.toDer(t)),_.finish(),u=_.output.getBytes();var v=vTs(n,s,c,g);l=Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OID,!1,Mt.oidToDer(bZ.pkcs5PBES2).getBytes()),Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OID,!1,Mt.oidToDer(bZ.pkcs5PBKDF2).getBytes()),v]),Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OID,!1,Mt.oidToDer(f).getBytes()),Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OCTETSTRING,!1,E)])])])}else if(r.algorithm==="3des"){c=24;var b=new _n.util.ByteBuffer(n),y=ss.pbe.generatePkcs12Key(e,b,1,o,c),E=ss.pbe.generatePkcs12Key(e,b,2,o,c),_=_n.des.createEncryptionCipher(y);_.start(E),_.update(Mt.toDer(t)),_.finish(),u=_.output.getBytes(),l=Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OID,!1,Mt.oidToDer(bZ["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OCTETSTRING,!1,n),Mt.create(Mt.Class.UNIVERSAL,Mt.Type.INTEGER,!1,s.getBytes())])])}else{var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=r.algorithm,m}var T=Mt.create(Mt.Class.UNIVERSAL,Mt.Type.SEQUENCE,!0,[l,Mt.create(Mt.Class.UNIVERSAL,Mt.Type.OCTETSTRING,!1,u)]);return T};ss.decryptPrivateKeyInfo=function(t,e){var r=null,n={},o=[];if(!Mt.validate(t,yTs,n,o)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}var c=Mt.derToOid(n.encryptionOid),l=ss.pbe.getCipher(c,n.encryptionParams,e),u=_n.util.createBuffer(n.encryptedData);return l.update(u),l.finish()&&(r=Mt.fromDer(l.output)),r};ss.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:Mt.toDer(t).getBytes()};return _n.pem.encode(r,{maxline:e})};ss.encryptedPrivateKeyFromPem=function(t){var e=_n.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return Mt.fromDer(e.body)};ss.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=ss.wrapRsaPrivateKey(ss.privateKeyToAsn1(t));return n=ss.encryptPrivateKeyInfo(n,e,r),ss.encryptedPrivateKeyToPem(n)}var o,s,c,l;switch(r.algorithm){case"aes128":o="AES-128-CBC",c=16,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",c=24,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",c=32,s=_n.random.getBytesSync(16),l=_n.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",c=24,s=_n.random.getBytesSync(8),l=_n.des.createEncryptionCipher;break;case"des":o="DES-CBC",c=8,s=_n.random.getBytesSync(8),l=_n.des.createEncryptionCipher;break;default:var u=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw u.algorithm=r.algorithm,u}var d=_n.pbe.opensslDeriveBytes(e,s.substr(0,8),c),f=l(d);f.start(s),f.update(Mt.toDer(ss.privateKeyToAsn1(t))),f.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:_n.util.bytesToHex(s).toUpperCase()},body:f.output.getBytes()};return _n.pem.encode(h)};ss.decryptRsaPrivateKey=function(t,e){var r=null,n=_n.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var o=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw o.headerType=o,o}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,c;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,c=_n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,c=_n.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,c=_n.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,c=_n.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,c=_n.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,c=a(function(h){return _n.rc2.createDecryptionCipher(h,40)},"cipherFn");break;case"RC2-64-CBC":s=8,c=a(function(h){return _n.rc2.createDecryptionCipher(h,64)},"cipherFn");break;case"RC2-128-CBC":s=16,c=a(function(h){return _n.rc2.createDecryptionCipher(h,128)},"cipherFn");break;default:var o=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw o.algorithm=n.dekInfo.algorithm,o}var l=_n.util.hexToBytes(n.dekInfo.parameters),u=_n.pbe.opensslDeriveBytes(e,l.substr(0,8),s),d=c(u);if(d.start(l),d.update(_n.util.createBuffer(n.body)),d.finish())r=d.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=ss.decryptPrivateKeyInfo(Mt.fromDer(r),e):r=Mt.fromDer(r),r!==null&&(r=ss.privateKeyFromAsn1(r)),r};ss.pbe.generatePkcs12Key=function(t,e,r,n,o,s){var c,l;if(typeof s>"u"||s===null){if(!("sha1"in _n.md))throw new Error('"sha1" hash algorithm unavailable.');s=_n.md.sha1.create()}var u=s.digestLength,d=s.blockLength,f=new _n.util.ByteBuffer,h=new _n.util.ByteBuffer;if(t!=null){for(l=0;l=0;l--)B=B>>8,B+=P.at(l)+L.at(l),L.setAt(l,B&255);N.putBuffer(L)}b=N,f.putBuffer(R)}return f.truncate(f.length()-o),f};ss.pbe.getCipher=function(t,e,r){switch(t){case ss.oids.pkcs5PBES2:return ss.pbe.getCipherForPBES2(t,e,r);case ss.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case ss.oids["pbewithSHAAnd40BitRC2-CBC"]:return ss.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};ss.pbe.getCipherForPBES2=function(t,e,r){var n={},o=[];if(!Mt.validate(e,ETs,n,o)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}if(t=Mt.derToOid(n.kdfOid),t!==ss.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=Mt.derToOid(n.encOid),t!==ss.oids["aes128-CBC"]&&t!==ss.oids["aes192-CBC"]&&t!==ss.oids["aes256-CBC"]&&t!==ss.oids["des-EDE3-CBC"]&&t!==ss.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var c=n.kdfSalt,l=_n.util.createBuffer(n.kdfIterationCount);l=l.getInt(l.length()<<3);var u,d;switch(ss.oids[t]){case"aes128-CBC":u=16,d=_n.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,d=_n.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,d=_n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,d=_n.des.createDecryptionCipher;break;case"desCBC":u=8,d=_n.des.createDecryptionCipher;break}var f=_8n(n.prfOid),h=_n.pkcs5.pbkdf2(r,c,l,u,f),m=n.encIv,g=d(h);return g.start(m),g};ss.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},o=[];if(!Mt.validate(e,_Ts,n,o)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}var c=_n.util.createBuffer(n.salt),l=_n.util.createBuffer(n.iterations);l=l.getInt(l.length()<<3);var u,d,f;switch(t){case ss.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,d=8,f=_n.des.startDecrypting;break;case ss.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,d=8,f=a(function(y,E){var _=_n.rc2.createDecryptionCipher(y,40);return _.start(E,null),_},"cipherFn");break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var h=_8n(n.prfOid),m=ss.pbe.generatePkcs12Key(r,c,1,l,u,h);h.start();var g=ss.pbe.generatePkcs12Key(r,c,2,l,d,h);return f(m,g)};ss.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in _n.md))throw new Error('"md5" hash algorithm unavailable.');n=_n.md.md5.create()}e===null&&(e="");for(var o=[E8n(n,t+e)],s=16,c=1;s{p();var ape=ms();R2();uc();var fn=ape.asn1,cpe=T8n.exports=ape.pkcs7asn1=ape.pkcs7asn1||{};ape.pkcs7=ape.pkcs7||{};ape.pkcs7.asn1=cpe;var b8n={name:"ContentInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};cpe.contentInfoValidator=b8n;var S8n={name:"EncryptedContentInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};cpe.envelopedDataValidator={name:"EnvelopedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(S8n)};cpe.encryptedDataValidator={name:"EncryptedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"}].concat(S8n)};var CTs={name:"SignerInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:fn.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};cpe.signedDataValidator={name:"SignedData",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},b8n,{name:"SignedData.Certificates",tagClass:fn.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:fn.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SET,capture:"signerInfos",optional:!0,value:[CTs]}]};cpe.recipientInfoValidator={name:"RecipientInfo",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:fn.Class.UNIVERSAL,type:fn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:fn.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:fn.Class.UNIVERSAL,type:fn.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var _nr=I((Uaf,I8n)=>{p();var SZ=ms();uc();SZ.mgf=SZ.mgf||{};var bTs=I8n.exports=SZ.mgf.mgf1=SZ.mgf1=SZ.mgf1||{};bTs.create=function(t){var e={generate:a(function(r,n){for(var o=new SZ.util.ByteBuffer,s=Math.ceil(n/t.digestLength),c=0;c{p();var Cot=ms();_nr();x8n.exports=Cot.mgf=Cot.mgf||{};Cot.mgf.mgf1=Cot.mgf1});var bot=I((Gaf,R8n)=>{p();var TZ=ms();Ow();uc();var STs=R8n.exports=TZ.pss=TZ.pss||{};STs.create=function(t){arguments.length===3&&(t={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var e=t.md,r=t.mgf,n=e.digestLength,o=t.salt||null;typeof o=="string"&&(o=TZ.util.createBuffer(o));var s;if("saltLength"in t)s=t.saltLength;else if(o!==null)s=o.length();else throw new Error("Salt length not specified or specific salt not given.");if(o!==null&&o.length()!==s)throw new Error("Given salt length does not match length of given salt.");var c=t.prng||TZ.random,l={};return l.encode=function(u,d){var f,h=d-1,m=Math.ceil(h/8),g=u.digest().getBytes();if(m>8*m-h&255;return w=String.fromCharCode(w.charCodeAt(0)&~R)+w.substr(1),w+E+"\xBC"},l.verify=function(u,d,f){var h,m=f-1,g=Math.ceil(m/8);if(d=d.substr(-g),g>8*g-m&255;if((y.charCodeAt(0)&_)!==0)throw new Error("Bits beyond keysize not zero as expected.");var v=r.generate(E,A),b="";for(h=0;h{p();var bi=ms();Uj();R2();EPe();T5();w8n();Qj();_Z();bot();CPe();uc();var Ae=bi.asn1,Dr=M8n.exports=bi.pki=bi.pki||{},Ja=Dr.oids,mp={};mp.CN=Ja.commonName;mp.commonName="CN";mp.C=Ja.countryName;mp.countryName="C";mp.L=Ja.localityName;mp.localityName="L";mp.ST=Ja.stateOrProvinceName;mp.stateOrProvinceName="ST";mp.O=Ja.organizationName;mp.organizationName="O";mp.OU=Ja.organizationalUnitName;mp.organizationalUnitName="OU";mp.E=Ja.emailAddress;mp.emailAddress="E";var P8n=bi.pki.rsa.publicKeyValidator,TTs={name:"Certificate",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},P8n,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},ITs={name:"rsapss",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},xTs={name:"CertificationRequestInfo",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},P8n,{name:"CertificationRequestInfo.attributes",tagClass:Ae.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SET,constructed:!0}]}]}]},wTs={name:"CertificationRequest",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[xTs,{name:"CertificationRequest.signatureAlgorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:Ae.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:Ae.Class.UNIVERSAL,type:Ae.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};Dr.RDNAttributesAsArray=function(t,e){for(var r=[],n,o,s,c=0;c2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(u.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=u[0],c.validity.notAfter=u[1],c.tbsCertificate=r.tbsCertificate,e){c.md=Tot({signatureOid:c.signatureOid,type:"certificate"});var d=Ae.toDer(c.tbsCertificate);c.md.update(d.getBytes())}var f=bi.md.sha1.create(),h=Ae.toDer(r.certIssuer);f.update(h.getBytes()),c.issuer.getField=function(A){return Hj(c.issuer,A)},c.issuer.addField=function(A){Fw([A]),c.issuer.attributes.push(A)},c.issuer.attributes=Dr.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=f.digest().toHex();var m=bi.md.sha1.create(),g=Ae.toDer(r.certSubject);return m.update(g.getBytes()),c.subject.getField=function(A){return Hj(c.subject,A)},c.subject.addField=function(A){Fw([A]),c.subject.attributes.push(A)},c.subject.attributes=Dr.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=m.digest().toHex(),r.certExtensions?c.extensions=Dr.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=Dr.publicKeyFromAsn1(r.subjectPublicKeyInfo),c};Dr.certificateExtensionsFromAsn1=function(t){for(var e=[],r=0;r1&&(n=r.value.charCodeAt(1),o=r.value.length>2?r.value.charCodeAt(2):0),e.digitalSignature=(n&128)===128,e.nonRepudiation=(n&64)===64,e.keyEncipherment=(n&32)===32,e.dataEncipherment=(n&16)===16,e.keyAgreement=(n&8)===8,e.keyCertSign=(n&4)===4,e.cRLSign=(n&2)===2,e.encipherOnly=(n&1)===1,e.decipherOnly=(o&128)===128}else if(e.name==="basicConstraints"){var r=Ae.fromDer(e.value);r.value.length>0&&r.value[0].type===Ae.Type.BOOLEAN?e.cA=r.value[0].value.charCodeAt(0)!==0:e.cA=!1;var s=null;r.value.length>0&&r.value[0].type===Ae.Type.INTEGER?s=r.value[0].value:r.value.length>1&&(s=r.value[1].value),s!==null&&(e.pathLenConstraint=Ae.derToInteger(s))}else if(e.name==="extKeyUsage")for(var r=Ae.fromDer(e.value),c=0;c1&&(n=r.value.charCodeAt(1)),e.client=(n&128)===128,e.server=(n&64)===64,e.email=(n&32)===32,e.objsign=(n&16)===16,e.reserved=(n&8)===8,e.sslCA=(n&4)===4,e.emailCA=(n&2)===2,e.objCA=(n&1)===1}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.altNames=[];for(var u,r=Ae.fromDer(e.value),d=0;d"u"&&(e.type&&e.type in Dr.oids?e.name=Dr.oids[e.type]:e.shortName&&e.shortName in mp&&(e.name=Dr.oids[mp[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in Dr.oids)e.type=Dr.oids[e.name];else{var n=new Error("Attribute type not specified.");throw n.attribute=e,n}if(typeof e.shortName>"u"&&e.name&&e.name in mp&&(e.shortName=mp[e.name]),e.type===Ja.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=Ae.Type.SEQUENCE,!e.value&&e.extensions)){e.value=[];for(var o=0;o"u"){var n=new Error("Attribute value not specified.");throw n.attribute=e,n}}}a(Fw,"_fillMissingFields");function N8n(t,e){if(e=e||{},typeof t.name>"u"&&t.id&&t.id in Dr.oids&&(t.name=Dr.oids[t.id]),typeof t.id>"u")if(t.name&&t.name in Dr.oids)t.id=Dr.oids[t.name];else{var r=new Error("Extension ID not specified.");throw r.extension=t,r}if(typeof t.value<"u")return t;if(t.name==="keyUsage"){var n=0,o=0,s=0;t.digitalSignature&&(o|=128,n=7),t.nonRepudiation&&(o|=64,n=6),t.keyEncipherment&&(o|=32,n=5),t.dataEncipherment&&(o|=16,n=4),t.keyAgreement&&(o|=8,n=3),t.keyCertSign&&(o|=4,n=2),t.cRLSign&&(o|=2,n=1),t.encipherOnly&&(o|=1,n=0),t.decipherOnly&&(s|=128,n=7);var c=String.fromCharCode(n);s!==0?c+=String.fromCharCode(o)+String.fromCharCode(s):o!==0&&(c+=String.fromCharCode(o)),t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,c)}else if(t.name==="basicConstraints")t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]),t.cA&&t.value.value.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in t&&t.value.value.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(t.pathLenConstraint).getBytes()));else if(t.name==="extKeyUsage"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);var l=t.value.value;for(var u in t)t[u]===!0&&(u in Ja?l.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(Ja[u]).getBytes())):u.indexOf(".")!==-1&&l.push(Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(u).getBytes())))}else if(t.name==="nsCertType"){var n=0,o=0;t.client&&(o|=128,n=7),t.server&&(o|=64,n=6),t.email&&(o|=32,n=5),t.objsign&&(o|=16,n=4),t.reserved&&(o|=8,n=3),t.sslCA&&(o|=4,n=2),t.emailCA&&(o|=2,n=1),t.objCA&&(o|=1,n=0);var c=String.fromCharCode(n);o!==0&&(c+=String.fromCharCode(o)),t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,c)}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);for(var d,f=0;f128)throw new Error('Invalid "nsComment" content.');t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.IA5STRING,!1,t.comment)}else if(t.name==="subjectKeyIdentifier"&&e.cert){var h=e.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=h.toHex(),t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OCTETSTRING,!1,h.getBytes())}else if(t.name==="authorityKeyIdentifier"&&e.cert){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);var l=t.value.value;if(t.keyIdentifier){var m=t.keyIdentifier===!0?e.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!1,m))}if(t.authorityCertIssuer){var g=[Ae.create(Ae.Class.CONTEXT_SPECIFIC,4,!0,[lpe(t.authorityCertIssuer===!0?e.cert.issuer:t.authorityCertIssuer)])];l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,1,!0,g))}if(t.serialNumber){var A=bi.util.hexToBytes(t.serialNumber===!0?e.cert.serialNumber:t.serialNumber);l.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,2,!1,A))}}else if(t.name==="cRLDistributionPoints"){t.value=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);for(var l=t.value.value,y=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]),E=Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!0,[]),d,f=0;f"u"){var r=new Error("Extension value not specified.");throw r.extension=t,r}return t}a(N8n,"_fillMissingExtensionFields");function vnr(t,e){if(t===Ja["RSASSA-PSS"]){var r=[];return e.hash.algorithmOid!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.hash.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")])])),e.mgf.algorithmOid!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,1,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.mgf.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(e.mgf.hash.algorithmOid).getBytes()),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")])])])),e.saltLength!==void 0&&r.push(Ae.create(Ae.Class.CONTEXT_SPECIFIC,2,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(e.saltLength).getBytes())])),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,r)}else return Ae.create(Ae.Class.UNIVERSAL,Ae.Type.NULL,!1,"")}a(vnr,"_signatureParametersToAsn1");function RTs(t){var e=Ae.create(Ae.Class.CONTEXT_SPECIFIC,0,!0,[]);if(t.attributes.length===0)return e;for(var r=t.attributes,n=0;n=kTs&&t0&&n.value.push(Dr.certificateExtensionsToAsn1(t.extensions)),n};Dr.getCertificationRequestInfo=function(t){var e=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.INTEGER,!1,Ae.integerToDer(t.version).getBytes()),lpe(t.subject),Dr.publicKeyToAsn1(t.publicKey),RTs(t)]);return e};Dr.distinguishedNameToAsn1=function(t){return lpe(t)};Dr.certificateToAsn1=function(t){var e=t.tbsCertificate||Dr.getTBSCertificate(t);return Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[e,Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[Ae.create(Ae.Class.UNIVERSAL,Ae.Type.OID,!1,Ae.oidToDer(t.signatureOid).getBytes()),vnr(t.signatureOid,t.signatureParameters)]),Ae.create(Ae.Class.UNIVERSAL,Ae.Type.BITSTRING,!1,"\0"+t.signature)])};Dr.certificateExtensionsToAsn1=function(t){var e=Ae.create(Ae.Class.CONTEXT_SPECIFIC,3,!0,[]),r=Ae.create(Ae.Class.UNIVERSAL,Ae.Type.SEQUENCE,!0,[]);e.value.push(r);for(var n=0;n"u"&&(o=new Date);var s=!0,c=null,l=0;do{var u=e.shift(),d=null,f=!1;if(o&&(ou.validity.notAfter)&&(c={message:"Certificate is not valid yet or has expired.",error:Dr.certificateError.certificate_expired,notBefore:u.validity.notBefore,notAfter:u.validity.notAfter,now:o}),c===null){if(d=e[0]||t.getIssuer(u),d===null&&u.isIssuer(u)&&(f=!0,d=u),d){var h=d;bi.util.isArray(h)||(h=[h]);for(var m=!1;!m&&h.length>0;){d=h.shift();try{m=d.verify(u)}catch{}}m||(c={message:"Certificate signature is invalid.",error:Dr.certificateError.bad_certificate})}c===null&&(!d||f)&&!t.hasCertificate(u)&&(c={message:"Certificate is not trusted.",error:Dr.certificateError.unknown_ca})}if(c===null&&d&&!u.isIssuer(d)&&(c={message:"Certificate issuer is invalid.",error:Dr.certificateError.bad_certificate}),c===null)for(var g={keyUsage:!0,basicConstraints:!0},A=0;c===null&&AE.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:Dr.certificateError.bad_certificate})}}var b=c===null?!0:c.error,T=r.verify?r.verify(b,l,n):b;if(T===!0)c=null;else throw b===!0&&(c={message:"The application rejected the certificate.",error:Dr.certificateError.bad_certificate}),(T||T===0)&&(typeof T=="object"&&!bi.util.isArray(T)?(T.message&&(c.message=T.message),T.error&&(c.error=T.error)):typeof T=="string"&&(c.error=T)),c;s=!1,++l}while(e.length>0);return!0}});var bnr=I((Yaf,L8n)=>{p();var Ru=ms();R2();rpe();Qj();Enr();ynr();Ow();CPe();spe();uc();Iot();var Je=Ru.asn1,ea=Ru.pki,SPe=L8n.exports=Ru.pkcs12=Ru.pkcs12||{},O8n={name:"ContentInfo",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Je.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},DTs={name:"PFX",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:Je.Class.UNIVERSAL,type:Je.Type.INTEGER,constructed:!1,capture:"version"},O8n,{name:"PFX.macData",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:Je.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:Je.Class.UNIVERSAL,type:Je.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},NTs={name:"SafeBag",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:Je.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},MTs={name:"Attribute",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SET,constructed:!0,capture:"values"}]},OTs={name:"CertBag",tagClass:Je.Class.UNIVERSAL,type:Je.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:Je.Class.UNIVERSAL,type:Je.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:Je.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:Je.Class.UNIVERSAL,type:Je.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function bPe(t,e,r,n){for(var o=[],s=0;s=0&&o.push(l)}}return o}a(bPe,"_getBagsByAttribute");SPe.pkcs12FromAsn1=function(t,e,r){typeof e=="string"?(r=e,e=!0):e===void 0&&(e=!0);var n={},o=[];if(!Je.validate(t,DTs,n,o)){var s=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw s.errors=s,s}var c={version:n.version.charCodeAt(0),safeContents:[],getBags:a(function(E){var _={},v;return"localKeyId"in E?v=E.localKeyId:"localKeyIdHex"in E&&(v=Ru.util.hexToBytes(E.localKeyIdHex)),v===void 0&&!("friendlyName"in E)&&"bagType"in E&&(_[E.bagType]=bPe(c.safeContents,null,null,E.bagType)),v!==void 0&&(_.localKeyId=bPe(c.safeContents,"localKeyId",v,E.bagType)),"friendlyName"in E&&(_.friendlyName=bPe(c.safeContents,"friendlyName",E.friendlyName,E.bagType)),_},"getBags"),getBagsByFriendlyName:a(function(E,_){return bPe(c.safeContents,"friendlyName",E,_)},"getBagsByFriendlyName"),getBagsByLocalKeyId:a(function(E,_){return bPe(c.safeContents,"localKeyId",E,_)},"getBagsByLocalKeyId")};if(n.version.charCodeAt(0)!==3){var s=new Error("PKCS#12 PFX of version other than 3 not supported.");throw s.version=n.version.charCodeAt(0),s}if(Je.derToOid(n.contentType)!==ea.oids.data){var s=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw s.oid=Je.derToOid(n.contentType),s}var l=n.content.value[0];if(l.tagClass!==Je.Class.UNIVERSAL||l.type!==Je.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(l=Cnr(l),n.mac){var u=null,d=0,f=Je.derToOid(n.macAlgorithm);switch(f){case ea.oids.sha1:u=Ru.md.sha1.create(),d=20;break;case ea.oids.sha256:u=Ru.md.sha256.create(),d=32;break;case ea.oids.sha384:u=Ru.md.sha384.create(),d=48;break;case ea.oids.sha512:u=Ru.md.sha512.create(),d=64;break;case ea.oids.md5:u=Ru.md.md5.create(),d=16;break}if(u===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var h=new Ru.util.ByteBuffer(n.macSalt),m="macIterations"in n?parseInt(Ru.util.bytesToHex(n.macIterations),16):1,g=SPe.generateKey(r,h,3,m,d,u),A=Ru.hmac.create();A.start(u,g),A.update(l.value);var y=A.getMac();if(y.getBytes()!==n.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(t.value)&&t.value.length>2)throw new Error("Invalid PKCS#12. macData field present but MAC was not validated.");return LTs(c,l.value,e,r),c};function Cnr(t){if(t.composed||t.constructed){for(var e=Ru.util.createBuffer(),r=0;r0&&(s=Je.create(Je.Class.UNIVERSAL,Je.Type.SET,!0,u));var d=[],f=[];e!==null&&(Ru.util.isArray(e)?f=e:f=[e]);for(var h=[],m=0;m0){var E=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,h),_=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(ea.oids.data).getBytes()),Je.create(Je.Class.CONTEXT_SPECIFIC,0,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OCTETSTRING,!1,Je.toDer(E).getBytes())])]);d.push(_)}var v=null;if(t!==null){var b=ea.wrapRsaPrivateKey(ea.privateKeyToAsn1(t));r===null?v=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(ea.oids.keyBag).getBytes()),Je.create(Je.Class.CONTEXT_SPECIFIC,0,!0,[b]),s]):v=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(ea.oids.pkcs8ShroudedKeyBag).getBytes()),Je.create(Je.Class.CONTEXT_SPECIFIC,0,!0,[ea.encryptPrivateKeyInfo(b,r,n)]),s]);var T=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[v]),w=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(ea.oids.data).getBytes()),Je.create(Je.Class.CONTEXT_SPECIFIC,0,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OCTETSTRING,!1,Je.toDer(T).getBytes())])]);d.push(w)}var R=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,d),x;if(n.useMac){var l=Ru.md.sha1.create(),P=new Ru.util.ByteBuffer(Ru.random.getBytes(n.saltSize)),D=n.count,t=SPe.generateKey(r,P,3,D,20),N=Ru.hmac.create();N.start(l,t),N.update(Je.toDer(R).getBytes());var L=N.getMac();x=Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(ea.oids.sha1).getBytes()),Je.create(Je.Class.UNIVERSAL,Je.Type.NULL,!1,"")]),Je.create(Je.Class.UNIVERSAL,Je.Type.OCTETSTRING,!1,L.getBytes())]),Je.create(Je.Class.UNIVERSAL,Je.Type.OCTETSTRING,!1,P.getBytes()),Je.create(Je.Class.UNIVERSAL,Je.Type.INTEGER,!1,Je.integerToDer(D).getBytes())])}return Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.INTEGER,!1,Je.integerToDer(3).getBytes()),Je.create(Je.Class.UNIVERSAL,Je.Type.SEQUENCE,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OID,!1,Je.oidToDer(ea.oids.data).getBytes()),Je.create(Je.Class.CONTEXT_SPECIFIC,0,!0,[Je.create(Je.Class.UNIVERSAL,Je.Type.OCTETSTRING,!1,Je.toDer(R).getBytes())])]),x])};SPe.generateKey=Ru.pbe.generatePkcs12Key});var Tnr=I((Zaf,B8n)=>{p();var Gj=ms();R2();Qj();ynr();_Z();got();bnr();bot();CPe();uc();Iot();var Snr=Gj.asn1,upe=B8n.exports=Gj.pki=Gj.pki||{};upe.pemToDer=function(t){var e=Gj.pem.decode(t)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return Gj.util.createBuffer(e.body)};upe.privateKeyFromPem=function(t){var e=Gj.pem.decode(t)[0];if(e.type!=="PRIVATE KEY"&&e.type!=="RSA PRIVATE KEY"){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var n=Snr.fromDer(e.body);return upe.privateKeyFromAsn1(n)};upe.privateKeyToPem=function(t,e){var r={type:"RSA PRIVATE KEY",body:Snr.toDer(upe.privateKeyToAsn1(t)).getBytes()};return Gj.pem.encode(r,{maxline:e})};upe.privateKeyInfoToPem=function(t,e){var r={type:"PRIVATE KEY",body:Snr.toDer(t).getBytes()};return Gj.pem.encode(r,{maxline:e})}});var Pnr=I((ecf,$8n)=>{p();var Kt=ms();R2();rpe();fot();_Z();Tnr();Ow();spe();uc();var kot=a(function(t,e,r,n){var o=Kt.util.createBuffer(),s=t.length>>1,c=s+(t.length&1),l=t.substr(0,c),u=t.substr(s,c),d=Kt.util.createBuffer(),f=Kt.hmac.create();r=e+r;var h=Math.ceil(n/16),m=Math.ceil(n/20);f.start("MD5",l);var g=Kt.util.createBuffer();d.putBytes(r);for(var A=0;A0&&(_e.queue(t,_e.createAlert(t,{level:_e.Alert.Level.warning,description:_e.Alert.Description.no_renegotiation})),_e.flush(t)),t.process()};_e.parseHelloMessage=function(t,e,r){var n=null,o=t.entity===_e.ConnectionEnd.client;if(r<38)t.error(t,{message:o?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});else{var s=e.fragment,c=s.length();if(n={version:{major:s.getByte(),minor:s.getByte()},random:Kt.util.createBuffer(s.getBytes(32)),session_id:CT(s,1),extensions:[]},o?(n.cipher_suite=s.getBytes(2),n.compression_method=s.getByte()):(n.cipher_suites=CT(s,2),n.compression_methods=CT(s,1)),c=r-(c-s.length()),c>0){for(var l=CT(s,2);l.length()>0;)n.extensions.push({type:[l.getByte(),l.getByte()],data:CT(l,2)});if(!o)for(var u=0;u0;){var h=f.getByte();if(h!==0)break;t.session.extensions.server_name.serverNameList.push(CT(f,2).getBytes())}}}if(t.session.version&&(n.version.major!==t.session.version.major||n.version.minor!==t.session.version.minor))return t.error(t,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.protocol_version}});if(o)t.session.cipherSuite=_e.getCipherSuite(n.cipher_suite);else for(var m=Kt.util.createBuffer(n.cipher_suites.bytes());m.length()>0&&(t.session.cipherSuite=_e.getCipherSuite(m.getBytes(2)),t.session.cipherSuite===null););if(t.session.cipherSuite===null)return t.error(t,{message:"No cipher suites in common.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.handshake_failure},cipherSuite:Kt.util.bytesToHex(n.cipher_suite)});o?t.session.compressionMethod=n.compression_method:t.session.compressionMethod=_e.CompressionMethod.none}return n};_e.createSecurityParameters=function(t,e){var r=t.entity===_e.ConnectionEnd.client,n=e.random.bytes(),o=r?t.session.sp.client_random:n,s=r?n:_e.createRandom().getBytes();t.session.sp={entity:t.entity,prf_algorithm:_e.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:t.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:o,server_random:s}};_e.handleServerHello=function(t,e,r){var n=_e.parseHelloMessage(t,e,r);if(!t.fail){if(n.version.minor<=t.version.minor)t.version.minor=n.version.minor;else return t.error(t,{message:"Incompatible TLS version.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.protocol_version}});t.session.version=t.version;var o=n.session_id.bytes();o.length>0&&o===t.session.id?(t.expect=Q8n,t.session.resuming=!0,t.session.sp.server_random=n.random.bytes()):(t.expect=GTs,t.session.resuming=!1,_e.createSecurityParameters(t,n)),t.session.id=o,t.process()}};_e.handleClientHello=function(t,e,r){var n=_e.parseHelloMessage(t,e,r);if(!t.fail){var o=n.session_id.bytes(),s=null;if(t.sessionCache&&(s=t.sessionCache.getSession(o),s===null?o="":(s.version.major!==n.version.major||s.version.minor>n.version.minor)&&(s=null,o="")),o.length===0&&(o=Kt.random.getBytes(32)),t.session.id=o,t.session.clientHelloVersion=n.version,t.session.sp={},s)t.version=t.session.version=s.version,t.session.sp=s.sp;else{for(var c,l=1;l<_e.SupportedVersions.length&&(c=_e.SupportedVersions[l],!(c.minor<=n.version.minor));++l);t.version={major:c.major,minor:c.minor},t.session.version=t.version}s!==null?(t.expect=Rnr,t.session.resuming=!0,t.session.sp.client_random=n.random.bytes()):(t.expect=t.verifyClient!==!1?JTs:wnr,t.session.resuming=!1,_e.createSecurityParameters(t,n)),t.open=!0,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerHello(t)})),t.session.resuming?(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),t.state.pending=_e.createConnectionState(t),t.state.current.write=t.state.pending.write,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createFinished(t)}))):(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificate(t)})),t.fail||(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerKeyExchange(t)})),t.verifyClient!==!1&&_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificateRequest(t)})),_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createServerHelloDone(t)})))),_e.flush(t),t.process()}};_e.handleCertificate=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_list:CT(n,3)},s,c,l=[];try{for(;o.certificate_list.length()>0;)s=CT(o.certificate_list,3),c=Kt.asn1.fromDer(s),s=Kt.pki.certificateFromAsn1(c,!0),l.push(s)}catch(d){return t.error(t,{message:"Could not parse certificate list.",cause:d,send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.bad_certificate}})}var u=t.entity===_e.ConnectionEnd.client;(u||t.verifyClient===!0)&&l.length===0?t.error(t,{message:u?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}}):l.length===0?t.expect=u?F8n:wnr:(u?t.session.serverCertificate=l[0]:t.session.clientCertificate=l[0],_e.verifyCertificateChain(t,l)&&(t.expect=u?F8n:wnr)),t.process()};_e.handleServerKeyExchange=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.unsupported_certificate}});t.expect=$Ts,t.process()};_e.handleClientKeyExchange=function(t,e,r){if(r<48)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.unsupported_certificate}});var n=e.fragment,o={enc_pre_master_secret:CT(n,2).getBytes()},s=null;if(t.getPrivateKey)try{s=t.getPrivateKey(t,t.session.serverCertificate),s=Kt.pki.privateKeyFromPem(s)}catch(u){t.error(t,{message:"Could not get private key.",cause:u,send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}})}if(s===null)return t.error(t,{message:"No private key set.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}});try{var c=t.session.sp;c.pre_master_secret=s.decrypt(o.enc_pre_master_secret);var l=t.session.clientHelloVersion;if(l.major!==c.pre_master_secret.charCodeAt(0)||l.minor!==c.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{c.pre_master_secret=Kt.random.getBytes(48)}t.expect=Rnr,t.session.clientCertificate!==null&&(t.expect=ZTs),t.process()};_e.handleCertificateRequest=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_types:CT(n,1),certificate_authorities:CT(n,2)};t.session.certificateRequest=o,t.expect=VTs,t.process()};_e.handleCertificateVerify=function(t,e,r){if(r<2)return t.error(t,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s={signature:CT(n,2).getBytes()},c=Kt.util.createBuffer();c.putBuffer(t.session.md5.digest()),c.putBuffer(t.session.sha1.digest()),c=c.getBytes();try{var l=t.session.clientCertificate;if(!l.publicKey.verify(c,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");t.session.md5.update(o),t.session.sha1.update(o)}catch{return t.error(t,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.handshake_failure}})}t.expect=Rnr,t.process()};_e.handleServerHelloDone=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.record_overflow}});if(t.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.insufficient_security}},o=0,s=t.verify(t,n.alert.description,o,[]);if(s!==!0)return(s||s===0)&&(typeof s=="object"&&!Kt.util.isArray(s)?(s.message&&(n.message=s.message),s.alert&&(n.alert.description=s.alert)):typeof s=="number"&&(n.alert.description=s)),t.error(t,n)}t.session.certificateRequest!==null&&(e=_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createCertificate(t)}),_e.queue(t,e)),e=_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createClientKeyExchange(t)}),_e.queue(t,e),t.expect=YTs;var c=a(function(l,u){l.session.certificateRequest!==null&&l.session.clientCertificate!==null&&_e.queue(l,_e.createRecord(l,{type:_e.ContentType.handshake,data:_e.createCertificateVerify(l,u)})),_e.queue(l,_e.createRecord(l,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),l.state.pending=_e.createConnectionState(l),l.state.current.write=l.state.pending.write,_e.queue(l,_e.createRecord(l,{type:_e.ContentType.handshake,data:_e.createFinished(l)})),l.expect=Q8n,_e.flush(l),l.process()},"callback");if(t.session.certificateRequest===null||t.session.clientCertificate===null)return c(t,null);_e.getClientSignature(t,c)};_e.handleChangeCipherSpec=function(t,e){if(e.fragment.getByte()!==1)return t.error(t,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.illegal_parameter}});var r=t.entity===_e.ConnectionEnd.client;(t.session.resuming&&r||!t.session.resuming&&!r)&&(t.state.pending=_e.createConnectionState(t)),t.state.current.read=t.state.pending.read,(!t.session.resuming&&r||t.session.resuming&&!r)&&(t.state.pending=null),t.expect=r?WTs:XTs,t.process()};_e.handleFinished=function(t,e,r){var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s=e.fragment.getBytes();n=Kt.util.createBuffer(),n.putBuffer(t.session.md5.digest()),n.putBuffer(t.session.sha1.digest());var c=t.entity===_e.ConnectionEnd.client,l=c?"server finished":"client finished",u=t.session.sp,d=12,f=kot;if(n=f(u.master_secret,l,n.getBytes(),d),n.getBytes()!==s)return t.error(t,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.decrypt_error}});t.session.md5.update(o),t.session.sha1.update(o),(t.session.resuming&&c||!t.session.resuming&&!c)&&(_e.queue(t,_e.createRecord(t,{type:_e.ContentType.change_cipher_spec,data:_e.createChangeCipherSpec()})),t.state.current.write=t.state.pending.write,t.state.pending=null,_e.queue(t,_e.createRecord(t,{type:_e.ContentType.handshake,data:_e.createFinished(t)}))),t.expect=c?zTs:eIs,t.handshaking=!1,++t.handshakes,t.peerCertificate=c?t.session.serverCertificate:t.session.clientCertificate,_e.flush(t),t.isConnected=!0,t.connected(t),t.process()};_e.handleAlert=function(t,e){var r=e.fragment,n={level:r.getByte(),description:r.getByte()},o;switch(n.description){case _e.Alert.Description.close_notify:o="Connection closed.";break;case _e.Alert.Description.unexpected_message:o="Unexpected message.";break;case _e.Alert.Description.bad_record_mac:o="Bad record MAC.";break;case _e.Alert.Description.decryption_failed:o="Decryption failed.";break;case _e.Alert.Description.record_overflow:o="Record overflow.";break;case _e.Alert.Description.decompression_failure:o="Decompression failed.";break;case _e.Alert.Description.handshake_failure:o="Handshake failure.";break;case _e.Alert.Description.bad_certificate:o="Bad certificate.";break;case _e.Alert.Description.unsupported_certificate:o="Unsupported certificate.";break;case _e.Alert.Description.certificate_revoked:o="Certificate revoked.";break;case _e.Alert.Description.certificate_expired:o="Certificate expired.";break;case _e.Alert.Description.certificate_unknown:o="Certificate unknown.";break;case _e.Alert.Description.illegal_parameter:o="Illegal parameter.";break;case _e.Alert.Description.unknown_ca:o="Unknown certificate authority.";break;case _e.Alert.Description.access_denied:o="Access denied.";break;case _e.Alert.Description.decode_error:o="Decode error.";break;case _e.Alert.Description.decrypt_error:o="Decrypt error.";break;case _e.Alert.Description.export_restriction:o="Export restriction.";break;case _e.Alert.Description.protocol_version:o="Unsupported protocol version.";break;case _e.Alert.Description.insufficient_security:o="Insufficient security.";break;case _e.Alert.Description.internal_error:o="Internal error.";break;case _e.Alert.Description.user_canceled:o="User canceled.";break;case _e.Alert.Description.no_renegotiation:o="Renegotiation not supported.";break;default:o="Unknown error.";break}if(n.description===_e.Alert.Description.close_notify)return t.close();t.error(t,{message:o,send:!1,origin:t.entity===_e.ConnectionEnd.client?"server":"client",alert:n}),t.process()};_e.handleHandshake=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt24();if(o>r.length())return t.fragmented=e,e.fragment=Kt.util.createBuffer(),r.read-=4,t.process();t.fragmented=null,r.read-=4;var s=r.bytes(o+4);r.read+=4,n in Rot[t.entity][t.expect]?(t.entity===_e.ConnectionEnd.server&&!t.open&&!t.fail&&(t.handshaking=!0,t.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:Kt.md.md5.create(),sha1:Kt.md.sha1.create()}),n!==_e.HandshakeType.hello_request&&n!==_e.HandshakeType.certificate_verify&&n!==_e.HandshakeType.finished&&(t.session.md5.update(s),t.session.sha1.update(s)),Rot[t.entity][t.expect][n](t,e,o)):_e.handleUnexpected(t,e)};_e.handleApplicationData=function(t,e){t.data.putBuffer(e.fragment),t.dataReady(t),t.process()};_e.handleHeartbeat=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt16(),s=r.getBytes(o);if(n===_e.HeartbeatMessageType.heartbeat_request){if(t.handshaking||o>s.length)return t.process();_e.queue(t,_e.createRecord(t,{type:_e.ContentType.heartbeat,data:_e.createHeartbeat(_e.HeartbeatMessageType.heartbeat_response,s)})),_e.flush(t)}else if(n===_e.HeartbeatMessageType.heartbeat_response){if(s!==t.expectedHeartbeatPayload)return t.process();t.heartbeatReceived&&t.heartbeatReceived(t,Kt.util.createBuffer(s))}t.process()};var HTs=0,GTs=1,F8n=2,$Ts=3,VTs=4,Q8n=5,WTs=6,zTs=7,YTs=8,KTs=0,JTs=1,wnr=2,ZTs=3,Rnr=4,XTs=5,eIs=6,Ee=_e.handleUnexpected,q8n=_e.handleChangeCipherSpec,$A=_e.handleAlert,dv=_e.handleHandshake,j8n=_e.handleApplicationData,VA=_e.handleHeartbeat,knr=[];knr[_e.ConnectionEnd.client]=[[Ee,$A,dv,Ee,VA],[Ee,$A,dv,Ee,VA],[Ee,$A,dv,Ee,VA],[Ee,$A,dv,Ee,VA],[Ee,$A,dv,Ee,VA],[q8n,$A,Ee,Ee,VA],[Ee,$A,dv,Ee,VA],[Ee,$A,dv,j8n,VA],[Ee,$A,dv,Ee,VA]];knr[_e.ConnectionEnd.server]=[[Ee,$A,dv,Ee,VA],[Ee,$A,dv,Ee,VA],[Ee,$A,dv,Ee,VA],[Ee,$A,dv,Ee,VA],[q8n,$A,Ee,Ee,VA],[Ee,$A,dv,Ee,VA],[Ee,$A,dv,j8n,VA],[Ee,$A,dv,Ee,VA]];var $j=_e.handleHelloRequest,tIs=_e.handleServerHello,H8n=_e.handleCertificate,U8n=_e.handleServerKeyExchange,Inr=_e.handleCertificateRequest,xot=_e.handleServerHelloDone,G8n=_e.handleFinished,Rot=[];Rot[_e.ConnectionEnd.client]=[[Ee,Ee,tIs,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[$j,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,H8n,U8n,Inr,xot,Ee,Ee,Ee,Ee,Ee,Ee],[$j,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,U8n,Inr,xot,Ee,Ee,Ee,Ee,Ee,Ee],[$j,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Inr,xot,Ee,Ee,Ee,Ee,Ee,Ee],[$j,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,xot,Ee,Ee,Ee,Ee,Ee,Ee],[$j,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[$j,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,G8n],[$j,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[$j,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee]];var rIs=_e.handleClientHello,nIs=_e.handleClientKeyExchange,iIs=_e.handleCertificateVerify;Rot[_e.ConnectionEnd.server]=[[Ee,rIs,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,H8n,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,nIs,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,iIs,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,G8n],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee],[Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee,Ee]];_e.generateKeys=function(t,e){var r=kot,n=e.client_random+e.server_random;t.session.resuming||(e.master_secret=r(e.pre_master_secret,"master secret",n,48).bytes(),e.pre_master_secret=null),n=e.server_random+e.client_random;var o=2*e.mac_key_length+2*e.enc_key_length,s=t.version.major===_e.Versions.TLS_1_0.major&&t.version.minor===_e.Versions.TLS_1_0.minor;s&&(o+=2*e.fixed_iv_length);var c=r(e.master_secret,"key expansion",n,o),l={client_write_MAC_key:c.getBytes(e.mac_key_length),server_write_MAC_key:c.getBytes(e.mac_key_length),client_write_key:c.getBytes(e.enc_key_length),server_write_key:c.getBytes(e.enc_key_length)};return s&&(l.client_write_IV=c.getBytes(e.fixed_iv_length),l.server_write_IV=c.getBytes(e.fixed_iv_length)),l};_e.createConnectionState=function(t){var e=t.entity===_e.ConnectionEnd.client,r=a(function(){var s={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:a(function(c){return!0},"cipherFunction"),compressionState:null,compressFunction:a(function(c){return!0},"compressFunction"),updateSequenceNumber:a(function(){s.sequenceNumber[1]===4294967295?(s.sequenceNumber[1]=0,++s.sequenceNumber[0]):++s.sequenceNumber[1]},"updateSequenceNumber")};return s},"createMode"),n={read:r(),write:r()};if(n.read.update=function(s,c){return n.read.cipherFunction(c,n.read)?n.read.compressFunction(s,c,n.read)||s.error(s,{message:"Could not decompress record.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.decompression_failure}}):s.error(s,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.bad_record_mac}}),!s.fail},n.write.update=function(s,c){return n.write.compressFunction(s,c,n.write)?n.write.cipherFunction(c,n.write)||s.error(s,{message:"Could not encrypt record.",send:!1,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}):s.error(s,{message:"Could not compress record.",send:!1,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}),!s.fail},t.session){var o=t.session.sp;switch(t.session.cipherSuite.initSecurityParameters(o),o.keys=_e.generateKeys(t,o),n.read.macKey=e?o.keys.server_write_MAC_key:o.keys.client_write_MAC_key,n.write.macKey=e?o.keys.client_write_MAC_key:o.keys.server_write_MAC_key,t.session.cipherSuite.initConnectionState(n,t,o),o.compression_algorithm){case _e.CompressionMethod.none:break;case _e.CompressionMethod.deflate:n.read.compressFunction=jTs,n.write.compressFunction=qTs;break;default:throw new Error("Unsupported compression algorithm.")}}return n};_e.createRandom=function(){var t=new Date,e=+t+t.getTimezoneOffset()*6e4,r=Kt.util.createBuffer();return r.putInt32(e),r.putBytes(Kt.random.getBytes(28)),r};_e.createRecord=function(t,e){if(!e.data)return null;var r={type:e.type,version:{major:t.version.major,minor:t.version.minor},length:e.data.length(),fragment:e.data};return r};_e.createAlert=function(t,e){var r=Kt.util.createBuffer();return r.putByte(e.level),r.putByte(e.description),_e.createRecord(t,{type:_e.ContentType.alert,data:r})};_e.createClientHello=function(t){t.session.clientHelloVersion={major:t.version.major,minor:t.version.minor};for(var e=Kt.util.createBuffer(),r=0;r0&&(h+=2);var m=t.session.id,g=m.length+1+2+4+28+2+o+1+c+h,A=Kt.util.createBuffer();return A.putByte(_e.HandshakeType.client_hello),A.putInt24(g),A.putByte(t.version.major),A.putByte(t.version.minor),A.putBytes(t.session.sp.client_random),Uw(A,1,Kt.util.createBuffer(m)),Uw(A,2,e),Uw(A,1,s),h>0&&Uw(A,2,l),A};_e.createServerHello=function(t){var e=t.session.id,r=e.length+1+2+4+28+2+1,n=Kt.util.createBuffer();return n.putByte(_e.HandshakeType.server_hello),n.putInt24(r),n.putByte(t.version.major),n.putByte(t.version.minor),n.putBytes(t.session.sp.server_random),Uw(n,1,Kt.util.createBuffer(e)),n.putByte(t.session.cipherSuite.id[0]),n.putByte(t.session.cipherSuite.id[1]),n.putByte(t.session.compressionMethod),n};_e.createCertificate=function(t){var e=t.entity===_e.ConnectionEnd.client,r=null;if(t.getCertificate){var n;e?n=t.session.certificateRequest:n=t.session.extensions.server_name.serverNameList,r=t.getCertificate(t,n)}var o=Kt.util.createBuffer();if(r!==null)try{Kt.util.isArray(r)||(r=[r]);for(var s=null,c=0;c0&&(r.putByte(_e.HandshakeType.server_key_exchange),r.putInt24(e)),r};_e.getClientSignature=function(t,e){var r=Kt.util.createBuffer();r.putBuffer(t.session.md5.digest()),r.putBuffer(t.session.sha1.digest()),r=r.getBytes(),t.getSignature=t.getSignature||function(n,o,s){var c=null;if(n.getPrivateKey)try{c=n.getPrivateKey(n,n.session.clientCertificate),c=Kt.pki.privateKeyFromPem(c)}catch(l){n.error(n,{message:"Could not get private key.",cause:l,send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}})}c===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.internal_error}}):o=c.sign(o,null),s(n,o)},t.getSignature(t,r,e)};_e.createCertificateVerify=function(t,e){var r=e.length+2,n=Kt.util.createBuffer();return n.putByte(_e.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(e.length),n.putBytes(e),n};_e.createCertificateRequest=function(t){var e=Kt.util.createBuffer();e.putByte(1);var r=Kt.util.createBuffer();for(var n in t.caStore.certs){var o=t.caStore.certs[n],s=Kt.pki.distinguishedNameToAsn1(o.subject),c=Kt.asn1.toDer(s);r.putInt16(c.length()),r.putBuffer(c)}var l=1+e.length()+2+r.length(),u=Kt.util.createBuffer();return u.putByte(_e.HandshakeType.certificate_request),u.putInt24(l),Uw(u,1,e),Uw(u,2,r),u};_e.createServerHelloDone=function(t){var e=Kt.util.createBuffer();return e.putByte(_e.HandshakeType.server_hello_done),e.putInt24(0),e};_e.createChangeCipherSpec=function(){var t=Kt.util.createBuffer();return t.putByte(1),t};_e.createFinished=function(t){var e=Kt.util.createBuffer();e.putBuffer(t.session.md5.digest()),e.putBuffer(t.session.sha1.digest());var r=t.entity===_e.ConnectionEnd.client,n=t.session.sp,o=12,s=kot,c=r?"client finished":"server finished";e=s(n.master_secret,c,e.getBytes(),o);var l=Kt.util.createBuffer();return l.putByte(_e.HandshakeType.finished),l.putInt24(e.length()),l.putBuffer(e),l};_e.createHeartbeat=function(t,e,r){typeof r>"u"&&(r=e.length);var n=Kt.util.createBuffer();n.putByte(t),n.putInt16(r),n.putBytes(e);var o=n.length(),s=Math.max(16,o-r-3);return n.putBytes(Kt.random.getBytes(s)),n};_e.queue=function(t,e){if(e&&!(e.fragment.length()===0&&(e.type===_e.ContentType.handshake||e.type===_e.ContentType.alert||e.type===_e.ContentType.change_cipher_spec))){if(e.type===_e.ContentType.handshake){var r=e.fragment.bytes();t.session.md5.update(r),t.session.sha1.update(r),r=null}var n;if(e.fragment.length()<=_e.MaxFragment)n=[e];else{n=[];for(var o=e.fragment.bytes();o.length>_e.MaxFragment;)n.push(_e.createRecord(t,{type:e.type,data:Kt.util.createBuffer(o.slice(0,_e.MaxFragment))})),o=o.slice(_e.MaxFragment);o.length>0&&n.push(_e.createRecord(t,{type:e.type,data:Kt.util.createBuffer(o)}))}for(var s=0;s0&&(c=r.order[0]),c!==null&&c in r.cache){s=r.cache[c],delete r.cache[c];for(var l in r.order)if(r.order[l]===c){r.order.splice(l,1);break}}return s},r.setSession=function(o,s){if(r.order.length===r.capacity){var c=r.order.shift();delete r.cache[c]}var c=Kt.util.bytesToHex(o);r.order.push(c),r.cache[c]=s}}return r};_e.createConnection=function(t){var e=null;t.caStore?Kt.util.isArray(t.caStore)?e=Kt.pki.createCaStore(t.caStore):e=t.caStore:e=Kt.pki.createCaStore();var r=t.cipherSuites||null;if(r===null){r=[];for(var n in _e.CipherSuites)r.push(_e.CipherSuites[n])}var o=t.server?_e.ConnectionEnd.server:_e.ConnectionEnd.client,s=t.sessionCache?_e.createSessionCache(t.sessionCache):null,c={version:{major:_e.Version.major,minor:_e.Version.minor},entity:o,sessionId:t.sessionId,caStore:e,sessionCache:s,cipherSuites:r,connected:t.connected,virtualHost:t.virtualHost||null,verifyClient:t.verifyClient||!1,verify:t.verify||function(f,h,m,g){return h},verifyOptions:t.verifyOptions||{},getCertificate:t.getCertificate||null,getPrivateKey:t.getPrivateKey||null,getSignature:t.getSignature||null,input:Kt.util.createBuffer(),tlsData:Kt.util.createBuffer(),data:Kt.util.createBuffer(),tlsDataReady:t.tlsDataReady,dataReady:t.dataReady,heartbeatReceived:t.heartbeatReceived,closed:t.closed,error:a(function(f,h){h.origin=h.origin||(f.entity===_e.ConnectionEnd.client?"client":"server"),h.send&&(_e.queue(f,_e.createAlert(f,h.alert)),_e.flush(f));var m=h.fatal!==!1;m&&(f.fail=!0),t.error(f,h),m&&f.close(!1)},"error"),deflate:t.deflate||null,inflate:t.inflate||null};c.reset=function(f){c.version={major:_e.Version.major,minor:_e.Version.minor},c.record=null,c.session=null,c.peerCertificate=null,c.state={pending:null,current:null},c.expect=c.entity===_e.ConnectionEnd.client?HTs:KTs,c.fragmented=null,c.records=[],c.open=!1,c.handshakes=0,c.handshaking=!1,c.isConnected=!1,c.fail=!(f||typeof f>"u"),c.input.clear(),c.tlsData.clear(),c.data.clear(),c.state.current=_e.createConnectionState(c)},c.reset();var l=a(function(f,h){var m=h.type-_e.ContentType.change_cipher_spec,g=knr[f.entity][f.expect];m in g?g[m](f,h):_e.handleUnexpected(f,h)},"_update"),u=a(function(f){var h=0,m=f.input,g=m.length();if(g<5)h=5-g;else{f.record={type:m.getByte(),version:{major:m.getByte(),minor:m.getByte()},length:m.getInt16(),fragment:Kt.util.createBuffer(),ready:!1};var A=f.record.version.major===f.version.major;A&&f.session&&f.session.version&&(A=f.record.version.minor===f.version.minor),A||f.error(f,{message:"Incompatible TLS version.",send:!0,alert:{level:_e.Alert.Level.fatal,description:_e.Alert.Description.protocol_version}})}return h},"_readRecordHeader"),d=a(function(f){var h=0,m=f.input,g=m.length();if(g0&&(c.sessionCache&&(h=c.sessionCache.getSession(f)),h===null&&(f="")),f.length===0&&c.sessionCache&&(h=c.sessionCache.getSession(),h!==null&&(f=h.id)),c.session={id:f,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:Kt.md.md5.create(),sha1:Kt.md.sha1.create()},h&&(c.version=h.version,c.session.sp=h.sp),c.session.sp.client_random=_e.createRandom().getBytes(),c.open=!0,_e.queue(c,_e.createRecord(c,{type:_e.ContentType.handshake,data:_e.createClientHello(c)})),_e.flush(c)}},c.process=function(f){var h=0;return f&&c.input.putBytes(f),c.fail||(c.record!==null&&c.record.ready&&c.record.fragment.isEmpty()&&(c.record=null),c.record===null&&(h=u(c)),!c.fail&&c.record!==null&&!c.record.ready&&(h=d(c)),!c.fail&&c.record!==null&&c.record.ready&&l(c,c.record)),h},c.prepare=function(f){return _e.queue(c,_e.createRecord(c,{type:_e.ContentType.application_data,data:Kt.util.createBuffer(f)})),_e.flush(c)},c.prepareHeartbeatRequest=function(f,h){return f instanceof Kt.util.ByteBuffer&&(f=f.bytes()),typeof h>"u"&&(h=f.length),c.expectedHeartbeatPayload=f,_e.queue(c,_e.createRecord(c,{type:_e.ContentType.heartbeat,data:_e.createHeartbeat(_e.HeartbeatMessageType.heartbeat_request,f,h)})),_e.flush(c)},c.close=function(f){if(!c.fail&&c.sessionCache&&c.session){var h={id:c.session.id,version:c.session.version,sp:c.session.sp};h.sp.keys=null,c.sessionCache.setSession(h.id,h)}c.open&&(c.open=!1,c.input.clear(),(c.isConnected||c.handshaking)&&(c.isConnected=c.handshaking=!1,_e.queue(c,_e.createAlert(c,{level:_e.Alert.Level.warning,description:_e.Alert.Description.close_notify})),_e.flush(c)),c.closed(c)),c.reset(f)},c};$8n.exports=Kt.tls=Kt.tls||{};for(wot in _e)typeof _e[wot]!="function"&&(Kt.tls[wot]=_e[wot]);var wot;Kt.tls.prf_tls1=kot;Kt.tls.hmac_sha1=QTs;Kt.tls.createSessionCache=_e.createSessionCache;Kt.tls.createConnection=_e.createConnection});var z8n=I((ncf,W8n)=>{p();var Vj=ms();Uj();Pnr();var Qw=W8n.exports=Vj.tls;Qw.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:a(function(t){t.bulk_cipher_algorithm=Qw.BulkCipherAlgorithm.aes,t.cipher_type=Qw.CipherType.block,t.enc_key_length=16,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=Qw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:V8n};Qw.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:a(function(t){t.bulk_cipher_algorithm=Qw.BulkCipherAlgorithm.aes,t.cipher_type=Qw.CipherType.block,t.enc_key_length=32,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=Qw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:V8n};function V8n(t,e,r){var n=e.entity===Vj.tls.ConnectionEnd.client;t.read.cipherState={init:!1,cipher:Vj.cipher.createDecipher("AES-CBC",n?r.keys.server_write_key:r.keys.client_write_key),iv:n?r.keys.server_write_IV:r.keys.client_write_IV},t.write.cipherState={init:!1,cipher:Vj.cipher.createCipher("AES-CBC",n?r.keys.client_write_key:r.keys.server_write_key),iv:n?r.keys.client_write_IV:r.keys.server_write_IV},t.read.cipherFunction=lIs,t.write.cipherFunction=sIs,t.read.macLength=t.write.macLength=r.mac_length,t.read.macFunction=t.write.macFunction=Qw.hmac_sha1}a(V8n,"initConnectionState");function sIs(t,e){var r=!1,n=e.macFunction(e.macKey,e.sequenceNumber,t);t.fragment.putBytes(n),e.updateSequenceNumber();var o;t.version.minor===Qw.Versions.TLS_1_0.minor?o=e.cipherState.init?null:e.cipherState.iv:o=Vj.random.getBytesSync(16),e.cipherState.init=!0;var s=e.cipherState.cipher;return s.start({iv:o}),t.version.minor>=Qw.Versions.TLS_1_1.minor&&s.output.putBytes(o),s.update(t.fragment),s.finish(aIs)&&(t.fragment=s.output,t.length=t.fragment.length(),r=!0),r}a(sIs,"encrypt_aes_cbc_sha1");function aIs(t,e,r){if(!r){var n=t-e.length()%t;e.fillWithByte(n-1,n)}return!0}a(aIs,"encrypt_aes_cbc_sha1_padding");function cIs(t,e,r){var n=!0;if(r){for(var o=e.length(),s=e.last(),c=o-1-s;c=s?(t.fragment=o.output.getBytes(l-s),c=o.output.getBytes(s)):t.fragment=o.output.getBytes(),t.fragment=Vj.util.createBuffer(t.fragment),t.length=t.fragment.length();var u=e.macFunction(e.macKey,e.sequenceNumber,t);return e.updateSequenceNumber(),r=uIs(e.macKey,c,u)&&r,r}a(lIs,"decrypt_aes_cbc_sha1");function uIs(t,e,r){var n=Vj.hmac.create();return n.start("SHA1",t),n.update(e),e=n.digest().getBytes(),n.start(null,null),n.update(r),r=n.digest().getBytes(),e===r}a(uIs,"compareMacs")});var Mnr=I((scf,Z8n)=>{p();var fd=ms();T5();uc();var TPe=Z8n.exports=fd.sha512=fd.sha512||{};fd.md.sha512=fd.md.algorithms.sha512=TPe;var K8n=fd.sha384=fd.sha512.sha384=fd.sha512.sha384||{};K8n.create=function(){return TPe.create("SHA-384")};fd.md.sha384=fd.md.algorithms.sha384=K8n;fd.sha512.sha256=fd.sha512.sha256||{create:a(function(){return TPe.create("SHA-512/256")},"create")};fd.md["sha512/256"]=fd.md.algorithms["sha512/256"]=fd.sha512.sha256;fd.sha512.sha224=fd.sha512.sha224||{create:a(function(){return TPe.create("SHA-512/224")},"create")};fd.md["sha512/224"]=fd.md.algorithms["sha512/224"]=fd.sha512.sha224;TPe.create=function(t){if(J8n||dIs(),typeof t>"u"&&(t="SHA-512"),!(t in IZ))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=IZ[t],r=null,n=fd.util.createBuffer(),o=new Array(80),s=0;s<80;++s)o[s]=new Array(2);var c=64;switch(t){case"SHA-384":c=48;break;case"SHA-512/256":c=32;break;case"SHA-512/224":c=28;break}var l={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:c,messageLength:0,fullMessageLength:null,messageLengthSize:16};return l.start=function(){l.messageLength=0,l.fullMessageLength=l.messageLength128=[];for(var u=l.messageLengthSize/4,d=0;d>>0,f>>>0];for(var h=l.fullMessageLength.length-1;h>=0;--h)l.fullMessageLength[h]+=f[1],f[1]=f[0]+(l.fullMessageLength[h]/4294967296>>>0),l.fullMessageLength[h]=l.fullMessageLength[h]>>>0,f[0]=f[1]/4294967296>>>0;return n.putBytes(u),Y8n(r,o,n),(n.read>2048||n.length()===0)&&n.compact(),l},l.digest=function(){var u=fd.util.createBuffer();u.putBytes(n.bytes());var d=l.fullMessageLength[l.fullMessageLength.length-1]+l.messageLengthSize,f=d&l.blockLength-1;u.putBytes(Dnr.substr(0,l.blockLength-f));for(var h,m,g=l.fullMessageLength[0]*8,A=0;A>>0,g+=m,u.putInt32(g>>>0),g=h>>>0;u.putInt32(g);for(var y=new Array(r.length),A=0;A=128;){for(O=0;O<16;++O)e[O][0]=r.getInt32()>>>0,e[O][1]=r.getInt32()>>>0;for(;O<80;++O)Q=e[O-2],U=Q[0],q=Q[1],n=((U>>>19|q<<13)^(q>>>29|U<<3)^U>>>6)>>>0,o=((U<<13|q>>>19)^(q<<3|U>>>29)^(U<<26|q>>>6))>>>0,W=e[O-15],U=W[0],q=W[1],s=((U>>>1|q<<31)^(U>>>8|q<<24)^U>>>7)>>>0,c=((U<<31|q>>>1)^(U<<24|q>>>8)^(U<<25|q>>>7))>>>0,Y=e[O-7],V=e[O-16],q=o+Y[1]+c+V[1],e[O][0]=n+Y[0]+s+V[0]+(q/4294967296>>>0)>>>0,e[O][1]=q>>>0;for(y=t[0][0],E=t[0][1],_=t[1][0],v=t[1][1],b=t[2][0],T=t[2][1],w=t[3][0],R=t[3][1],x=t[4][0],P=t[4][1],D=t[5][0],N=t[5][1],L=t[6][0],B=t[6][1],j=t[7][0],M=t[7][1],O=0;O<80;++O)d=((x>>>14|P<<18)^(x>>>18|P<<14)^(P>>>9|x<<23))>>>0,f=((x<<18|P>>>14)^(x<<14|P>>>18)^(P<<23|x>>>9))>>>0,h=(L^x&(D^L))>>>0,m=(B^P&(N^B))>>>0,l=((y>>>28|E<<4)^(E>>>2|y<<30)^(E>>>7|y<<25))>>>0,u=((y<<4|E>>>28)^(E<<30|y>>>2)^(E<<25|y>>>7))>>>0,g=(y&_|b&(y^_))>>>0,A=(E&v|T&(E^v))>>>0,q=M+f+m+Nnr[O][1]+e[O][1],n=j+d+h+Nnr[O][0]+e[O][0]+(q/4294967296>>>0)>>>0,o=q>>>0,q=u+A,s=l+g+(q/4294967296>>>0)>>>0,c=q>>>0,j=L,M=B,L=D,B=N,D=x,N=P,q=R+o,x=w+n+(q/4294967296>>>0)>>>0,P=q>>>0,w=b,R=T,b=_,T=v,_=y,v=E,q=o+c,y=n+s+(q/4294967296>>>0)>>>0,E=q>>>0;q=t[0][1]+E,t[0][0]=t[0][0]+y+(q/4294967296>>>0)>>>0,t[0][1]=q>>>0,q=t[1][1]+v,t[1][0]=t[1][0]+_+(q/4294967296>>>0)>>>0,t[1][1]=q>>>0,q=t[2][1]+T,t[2][0]=t[2][0]+b+(q/4294967296>>>0)>>>0,t[2][1]=q>>>0,q=t[3][1]+R,t[3][0]=t[3][0]+w+(q/4294967296>>>0)>>>0,t[3][1]=q>>>0,q=t[4][1]+P,t[4][0]=t[4][0]+x+(q/4294967296>>>0)>>>0,t[4][1]=q>>>0,q=t[5][1]+N,t[5][0]=t[5][0]+D+(q/4294967296>>>0)>>>0,t[5][1]=q>>>0,q=t[6][1]+B,t[6][0]=t[6][0]+L+(q/4294967296>>>0)>>>0,t[6][1]=q>>>0,q=t[7][1]+M,t[7][0]=t[7][0]+j+(q/4294967296>>>0)>>>0,t[7][1]=q>>>0,z-=128}}a(Y8n,"_update")});var X8n=I(Onr=>{p();var fIs=ms();R2();var Lg=fIs.asn1;Onr.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Lg.Class.UNIVERSAL,type:Lg.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Lg.Class.UNIVERSAL,type:Lg.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Lg.Class.UNIVERSAL,type:Lg.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Lg.Class.UNIVERSAL,type:Lg.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Lg.Class.UNIVERSAL,type:Lg.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};Onr.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Lg.Class.UNIVERSAL,type:Lg.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Lg.Class.UNIVERSAL,type:Lg.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Lg.Class.UNIVERSAL,type:Lg.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Lg.Class.UNIVERSAL,type:Lg.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var f6n=I((dcf,d6n)=>{p();var WA=ms();vPe();Ow();Mnr();uc();var o6n=X8n(),pIs=o6n.publicKeyValidator,hIs=o6n.privateKeyValidator;typeof e6n>"u"&&(e6n=WA.jsbn.BigInteger);var e6n,Bnr=WA.util.ByteBuffer,pb=typeof Buffer>"u"?Uint8Array:Buffer;WA.pki=WA.pki||{};d6n.exports=WA.pki.ed25519=WA.ed25519=WA.ed25519||{};var ta=WA.ed25519;ta.constants={};ta.constants.PUBLIC_KEY_BYTE_LENGTH=32;ta.constants.PRIVATE_KEY_BYTE_LENGTH=64;ta.constants.SEED_BYTE_LENGTH=32;ta.constants.SIGN_BYTE_LENGTH=64;ta.constants.HASH_BYTE_LENGTH=64;ta.generateKeyPair=function(t){t=t||{};var e=t.seed;if(e===void 0)e=WA.random.getBytesSync(ta.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==ta.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+ta.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(e instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');e=KF({message:e,encoding:"binary"});for(var r=new pb(ta.constants.PUBLIC_KEY_BYTE_LENGTH),n=new pb(ta.constants.PRIVATE_KEY_BYTE_LENGTH),o=0;o<32;++o)n[o]=e[o];return yIs(r,n),{publicKey:r,privateKey:n}};ta.privateKeyFromAsn1=function(t){var e={},r=[],n=WA.asn1.validate(t,hIs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=WA.asn1.derToOid(e.privateKeyOid),c=WA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.privateKey,u=KF({message:WA.asn1.fromDer(l).value,encoding:"binary"});return{privateKeyBytes:u}};ta.publicKeyFromAsn1=function(t){var e={},r=[],n=WA.asn1.validate(t,pIs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=WA.asn1.derToOid(e.publicKeyOid),c=WA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.ed25519PublicKey;if(l.length!==ta.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return KF({message:l,encoding:"binary"})};ta.publicKeyFromPrivateKey=function(t){t=t||{};var e=KF({message:t.privateKey,encoding:"binary"});if(e.length!==ta.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+ta.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new pb(ta.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n=0};function KF(t){var e=t.message;if(e instanceof Uint8Array||e instanceof pb)return e;var r=t.encoding;if(e===void 0)if(t.md)e=t.md.digest().getBytes(),r="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof e=="string"&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof e=="string"){if(typeof Buffer<"u")return Buffer.from(e,r);e=new Bnr(e,r)}else if(!(e instanceof Bnr))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new pb(e.length()),o=0;o=0;--r){if(t[e+r]IPe[r])return!1}return!1}a(vIs,"_isCanonicalSignatureScalar");function s6n(t,e){var r,n,o,s;for(n=63;n>=32;--n){for(r=0,o=n-32,s=n-12;o>8,e[o]-=r*256;e[o]+=r,e[n]=0}for(r=0,o=0;o<32;++o)e[o]+=r-(e[31]>>4)*IPe[o],r=e[o]>>8,e[o]&=255;for(o=0;o<32;++o)e[o]-=r*IPe[o];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=e[n]&255}a(s6n,"modL");function Unr(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;s6n(t,e)}a(Unr,"reduce");function Qnr(t,e){var r=Gi(),n=Gi(),o=Gi(),s=Gi(),c=Gi(),l=Gi(),u=Gi(),d=Gi(),f=Gi();fpe(r,t[1],t[0]),fpe(f,e[1],e[0]),Yl(r,r,f),dpe(n,t[0],t[1]),dpe(f,e[0],e[1]),Yl(n,n,f),Yl(o,t[3],e[3]),Yl(o,o,gIs),Yl(s,t[2],e[2]),dpe(s,s,s),fpe(c,n,r),fpe(l,s,o),dpe(u,s,o),dpe(d,n,r),Yl(t[0],c,l),Yl(t[1],d,u),Yl(t[2],u,l),Yl(t[3],c,d)}a(Qnr,"add");function n6n(t,e,r){for(var n=0;n<4;++n)u6n(t[n],e[n],r)}a(n6n,"cswap");function qnr(t,e){var r=Gi(),n=Gi(),o=Gi();IIs(o,e[2]),Yl(r,e[0],o),Yl(n,e[1],o),Dot(t,n),t[31]^=c6n(r)<<7}a(qnr,"pack");function Dot(t,e){var r,n,o,s=Gi(),c=Gi();for(r=0;r<16;++r)c[r]=e[r];for(Lnr(c),Lnr(c),Lnr(c),n=0;n<2;++n){for(s[0]=c[0]-65517,r=1;r<15;++r)s[r]=c[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=c[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,u6n(c,s,1-o)}for(r=0;r<16;r++)t[2*r]=c[r]&255,t[2*r+1]=c[r]>>8}a(Dot,"pack25519");function CIs(t,e){var r=Gi(),n=Gi(),o=Gi(),s=Gi(),c=Gi(),l=Gi(),u=Gi();return Wj(t[2],Pot),bIs(t[1],e),xZ(o,t[1]),Yl(s,o,mIs),fpe(o,o,t[2]),dpe(s,t[2],s),xZ(c,s),xZ(l,c),Yl(u,l,c),Yl(r,u,o),Yl(r,r,s),SIs(r,r),Yl(r,r,o),Yl(r,r,s),Yl(r,r,s),Yl(t[0],r,s),xZ(n,t[0]),Yl(n,n,s),i6n(n,o)&&Yl(t[0],t[0],AIs),xZ(n,t[0]),Yl(n,n,s),i6n(n,o)?-1:(c6n(t[0])===e[31]>>7&&fpe(t[0],Fnr,t[0]),Yl(t[3],t[0],t[1]),0)}a(CIs,"unpackneg");function bIs(t,e){var r;for(r=0;r<16;++r)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}a(bIs,"unpack25519");function SIs(t,e){var r=Gi(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=250;n>=0;--n)xZ(r,r),n!==1&&Yl(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(SIs,"pow2523");function i6n(t,e){var r=new pb(32),n=new pb(32);return Dot(r,t),Dot(n,e),a6n(r,0,n,0)}a(i6n,"neq25519");function a6n(t,e,r,n){return TIs(t,e,r,n,32)}a(a6n,"crypto_verify_32");function TIs(t,e,r,n,o){var s,c=0;for(s=0;s>>8)-1}a(TIs,"vn");function c6n(t){var e=new pb(32);return Dot(e,t),e[0]&1}a(c6n,"par25519");function l6n(t,e,r){var n,o;for(Wj(t[0],Fnr),Wj(t[1],Pot),Wj(t[2],Pot),Wj(t[3],Fnr),o=255;o>=0;--o)n=r[o/8|0]>>(o&7)&1,n6n(t,e,n),Qnr(e,t),Qnr(t,t),n6n(t,e,n)}a(l6n,"scalarmult");function jnr(t,e){var r=[Gi(),Gi(),Gi(),Gi()];Wj(r[0],t6n),Wj(r[1],r6n),Wj(r[2],Pot),Yl(r[3],t6n,r6n),l6n(t,r,e)}a(jnr,"scalarbase");function Wj(t,e){var r;for(r=0;r<16;r++)t[r]=e[r]|0}a(Wj,"set25519");function IIs(t,e){var r=Gi(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=253;n>=0;--n)xZ(r,r),n!==2&&n!==4&&Yl(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(IIs,"inv25519");function Lnr(t){var e,r,n=1;for(e=0;e<16;++e)r=t[e]+n+65535,n=Math.floor(r/65536),t[e]=r-n*65536;t[0]+=n-1+37*(n-1)}a(Lnr,"car25519");function u6n(t,e,r){for(var n,o=~(r-1),s=0;s<16;++s)n=o&(t[s]^e[s]),t[s]^=n,e[s]^=n}a(u6n,"sel25519");function Gi(t){var e,r=new Float64Array(16);if(t)for(e=0;e{p();var bT=ms();uc();Ow();vPe();m6n.exports=bT.kem=bT.kem||{};var p6n=bT.jsbn.BigInteger;bT.kem.rsa={};bT.kem.rsa.create=function(t,e){e=e||{};var r=e.prng||bT.random,n={};return n.encrypt=function(o,s){var c=Math.ceil(o.n.bitLength()/8),l;do l=new p6n(bT.util.bytesToHex(r.getBytesSync(c)),16).mod(o.n);while(l.compareTo(p6n.ONE)<=0);l=bT.util.hexToBytes(l.toString(16));var u=c-l.length;u>0&&(l=bT.util.fillString("\0",u)+l);var d=o.encrypt(l,"NONE"),f=t.generate(l,s);return{encapsulation:d,key:f}},n.decrypt=function(o,s,c){var l=o.decrypt(s,"NONE");return t.generate(l,c)},n};bT.kem.kdf1=function(t,e){h6n(this,t,0,e||t.digestLength)};bT.kem.kdf2=function(t,e){h6n(this,t,1,e||t.digestLength)};function h6n(t,e,r,n){t.generate=function(o,s){for(var c=new bT.util.ByteBuffer,l=Math.ceil(s/n)+r,u=new bT.util.ByteBuffer,d=r;d{p();var ha=ms();uc();E6n.exports=ha.log=ha.log||{};ha.log.levels=["none","error","warning","info","debug","verbose","max"];var Not={},$nr=[],RPe=null;ha.log.LEVEL_LOCKED=2;ha.log.NO_LEVEL_CHECK=4;ha.log.INTERPOLATE=8;for(N5=0;N5"u"||e?t.flags|=ha.log.LEVEL_LOCKED:t.flags&=~ha.log.LEVEL_LOCKED};ha.log.addLogger=function(t){$nr.push(t)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(A6n={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},kPe=a(function(t,e){ha.log.prepareStandard(e);var r=A6n[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),r.apply(console,n)},"f"),ppe=ha.log.makeLogger(kPe)):(kPe=a(function(e,r){ha.log.prepareStandardFull(r),console.log(r.standardFull)},"f"),ppe=ha.log.makeLogger(kPe)),ha.log.setLevel(ppe,"debug"),ha.log.addLogger(ppe),RPe=ppe):console={log:a(function(){},"log")};var ppe,A6n,kPe;RPe!==null&&typeof window<"u"&&window.location&&(wPe=new URL(window.location.href).searchParams,wPe.has("console.level")&&ha.log.setLevel(RPe,wPe.get("console.level").slice(-1)[0]),wPe.has("console.lock")&&(y6n=wPe.get("console.lock").slice(-1)[0],y6n=="true"&&ha.log.lock(RPe)));var wPe,y6n;ha.log.consoleLogger=RPe});var C6n=I((_cf,v6n)=>{p();v6n.exports=T5();fot();spe();onr();Mnr()});var T6n=I((Ccf,S6n)=>{p();var Xr=ms();Uj();R2();EPe();Qj();_Z();Enr();Ow();uc();Iot();var et=Xr.asn1,fv=S6n.exports=Xr.pkcs7=Xr.pkcs7||{};fv.messageFromPem=function(t){var e=Xr.pem.decode(t)[0];if(e.type!=="PKCS7"){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var n=et.fromDer(e.body);return fv.messageFromAsn1(n)};fv.messageToPem=function(t,e){var r={type:"PKCS7",body:et.toDer(t.toAsn1()).getBytes()};return Xr.pem.encode(r,{maxline:e})};fv.messageFromAsn1=function(t){var e={},r=[];if(!et.validate(t,fv.asn1.contentInfoValidator,e,r)){var n=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw n.errors=r,n}var o=et.derToOid(e.contentType),s;switch(o){case Xr.pki.oids.envelopedData:s=fv.createEnvelopedData();break;case Xr.pki.oids.encryptedData:s=fv.createEncryptedData();break;case Xr.pki.oids.signedData:s=fv.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+o+" is not (yet) supported.")}return s.fromAsn1(e.content.value[0]),s};fv.createSignedData=function(){var t=null;return t={type:Xr.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:a(function(n){if(Wnr(t,n,fv.asn1.signedDataValidator),t.certificates=[],t.crls=[],t.digestAlgorithmIdentifiers=[],t.contentInfo=null,t.signerInfos=[],t.rawCapture.certificates)for(var o=t.rawCapture.certificates.value,s=0;s0&&c.value[0].value.push(et.create(et.Class.CONTEXT_SPECIFIC,0,!0,n)),s.length>0&&c.value[0].value.push(et.create(et.Class.CONTEXT_SPECIFIC,1,!0,s)),c.value[0].value.push(et.create(et.Class.UNIVERSAL,et.Type.SET,!0,t.signerInfos)),et.create(et.Class.UNIVERSAL,et.Type.SEQUENCE,!0,[et.create(et.Class.UNIVERSAL,et.Type.OID,!1,et.oidToDer(t.type).getBytes()),c])},"toAsn1"),addSigner:a(function(n){var o=n.issuer,s=n.serialNumber;if(n.certificate){var c=n.certificate;typeof c=="string"&&(c=Xr.pki.certificateFromPem(c)),o=c.issuer.attributes,s=c.serialNumber}var l=n.key;if(!l)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof l=="string"&&(l=Xr.pki.privateKeyFromPem(l));var u=n.digestAlgorithm||Xr.pki.oids.sha1;switch(u){case Xr.pki.oids.sha1:case Xr.pki.oids.sha256:case Xr.pki.oids.sha384:case Xr.pki.oids.sha512:case Xr.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+u)}var d=n.authenticatedAttributes||[];if(d.length>0){for(var f=!1,h=!1,m=0;m0){for(var r=et.create(et.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n=r&&o{p();var pm=ms();Uj();rpe();fot();spe();uc();var Oot=I6n.exports=pm.ssh=pm.ssh||{};Oot.privateKeyToPutty=function(t,e,r){r=r||"",e=e||"";var n="ssh-rsa",o=e===""?"none":"aes256-cbc",s="PuTTY-User-Key-File-2: "+n+`\r `;s+="Encryption: "+o+`\r `,s+="Comment: "+r+`\r -`;var c=cm.util.createBuffer();Xfe(c,n),w5(c,t.e),w5(c,t.n);var l=cm.util.encode64(c.bytes(),64),u=Math.floor(l.length/66)+1;s+="Public-Lines: "+u+`\r -`,s+=l;var d=cm.util.createBuffer();w5(d,t.d),w5(d,t.p),w5(d,t.q),w5(d,t.qInv);var f;if(!e)f=cm.util.encode64(d.bytes(),64);else{var h=d.length()+16-1;h-=h%16;var m=sot(d.bytes());m.truncate(m.length()-h+d.length()),d.putBuffer(m);var g=cm.util.createBuffer();g.putBuffer(sot("\0\0\0\0",e)),g.putBuffer(sot("\0\0\0",e));var A=cm.aes.createEncryptionCipher(g.truncate(8),"CBC");A.start(cm.util.createBuffer().fillWithByte(0,16)),A.update(d.copy()),A.finish();var y=A.output;y.truncate(16),f=cm.util.encode64(y.bytes(),64)}u=Math.floor(f.length/66)+1,s+=`\r +`;var c=pm.util.createBuffer();hpe(c,n),M5(c,t.e),M5(c,t.n);var l=pm.util.encode64(c.bytes(),64),u=Math.floor(l.length/66)+1;s+="Public-Lines: "+u+`\r +`,s+=l;var d=pm.util.createBuffer();M5(d,t.d),M5(d,t.p),M5(d,t.q),M5(d,t.qInv);var f;if(!e)f=pm.util.encode64(d.bytes(),64);else{var h=d.length()+16-1;h-=h%16;var m=Mot(d.bytes());m.truncate(m.length()-h+d.length()),d.putBuffer(m);var g=pm.util.createBuffer();g.putBuffer(Mot("\0\0\0\0",e)),g.putBuffer(Mot("\0\0\0",e));var A=pm.aes.createEncryptionCipher(g.truncate(8),"CBC");A.start(pm.util.createBuffer().fillWithByte(0,16)),A.update(d.copy()),A.finish();var y=A.output;y.truncate(16),f=pm.util.encode64(y.bytes(),64)}u=Math.floor(f.length/66)+1,s+=`\r Private-Lines: `+u+`\r -`,s+=f;var E=sot("putty-private-key-file-mac-key",e),_=cm.util.createBuffer();Xfe(_,n),Xfe(_,o),Xfe(_,r),_.putInt32(c.length()),_.putBuffer(c),_.putInt32(d.length()),_.putBuffer(d);var v=cm.hmac.create();return v.start("sha1",E),v.update(_.bytes()),s+=`\r +`,s+=f;var E=Mot("putty-private-key-file-mac-key",e),_=pm.util.createBuffer();hpe(_,n),hpe(_,o),hpe(_,r),_.putInt32(c.length()),_.putBuffer(c),_.putInt32(d.length()),_.putBuffer(d);var v=pm.hmac.create();return v.start("sha1",E),v.update(_.bytes()),s+=`\r Private-MAC: `+v.digest().toHex()+`\r -`,s};aot.publicKeyToOpenSSH=function(t,e){var r="ssh-rsa";e=e||"";var n=cm.util.createBuffer();return Xfe(n,r),w5(n,t.e),w5(n,t.n),r+" "+cm.util.encode64(n.bytes())+" "+e};aot.privateKeyToOpenSSH=function(t,e){return e?cm.pki.encryptRsaPrivateKey(t,e,{legacy:!0,algorithm:"aes128"}):cm.pki.privateKeyToPem(t)};aot.getPublicKeyFingerprint=function(t,e){e=e||{};var r=e.md||cm.md.md5.create(),n="ssh-rsa",o=cm.util.createBuffer();Xfe(o,n),w5(o,t.e),w5(o,t.n),r.start(),r.update(o.getBytes());var s=r.digest();if(e.encoding==="hex"){var c=s.toHex();return e.delimiter?c.match(/.{2}/g).join(e.delimiter):c}else{if(e.encoding==="binary")return s.getBytes();if(e.encoding)throw new Error('Unknown encoding "'+e.encoding+'".')}return s};function w5(t,e){var r=e.toString(16);r[0]>="8"&&(r="00"+r);var n=cm.util.hexToBytes(r);t.putInt32(n.length),t.putBytes(n)}a(w5,"_addBigIntegerToBuffer");function Xfe(t,e){t.putInt32(e.length),t.putString(e)}a(Xfe,"_addStringToBuffer");function sot(){for(var t=cm.md.sha1.create(),e=arguments.length,r=0;r{p();VFn.exports=As();Tj();fFn();v2();Pit();Xke();kFn();qfe();MFn();FFn();QFn();wrr();jit();uZ();Crr();Prr();HFn();Nrr();Srr();hrr();Yit();xw();Arr();$Fn();Urr();ac()});var KFn=I(yZ=>{"use strict";p();Object.defineProperty(yZ,"__esModule",{value:!0});yZ.convert=yZ.Format=void 0;var dPe=WFn(),Mj;(function(t){t.der="der",t.pem="pem",t.txt="txt",t.asn1="asn1",t.x509="x509",t.fingerprint="fingerprint"})(Mj=yZ.Format||(yZ.Format={}));function zFn(t){var e=dPe.pki.pemToDer(t),r=dPe.asn1,n=r.fromDer(e.data.toString("binary")).value[0].value,o=n[0],s=o.tagClass===r.Class.CONTEXT_SPECIFIC&&o.type===0&&o.constructed,c=n.slice(s);return{serial:c[0],issuer:c[2],valid:c[3],subject:c[4]}}a(zFn,"myASN");function ISs(t){var e=zFn(t),r=e.subject.value.map(function(o){return o.value[0].value[1].value}).join("/"),n=e.valid.value.map(function(o){return o.value}).join(" - ");return["Subject ".concat(r),"Valid ".concat(n),String(t)].join(` -`)}a(ISs,"txtFormat");function YFn(t,e){switch(e){case Mj.der:return dPe.pki.pemToDer(t);case Mj.pem:return t;case Mj.txt:return ISs(t);case Mj.asn1:return zFn(t);case Mj.fingerprint:var r=dPe.md.sha1.create(),n=YFn(t,Mj.der);return r.update(n.getBytes()),r.digest().toHex();case Mj.x509:return dPe.pki.certificateFromPem(t);default:throw new Error("unknown format ".concat(e))}}a(YFn,"convert");yZ.convert=YFn});var r8n=I(db=>{"use strict";p();var Oj=db&&db.__assign||function(){return Oj=Object.assign||function(t){for(var e,r=1,n=arguments.length;r"u"&&(s.ca=e),r.call(this,s)},"newAgent");return n.prototype=r.prototype,n})(rnr.Agent),(0,ZFn.setGlobalDispatcher)(new ZFn.Agent({connect:{ca:e}}))}},"addToGlobalAgent");db.addToGlobalAgent=wSs});var n8n=I((bof,nnr)=>{p();function RSs(){let{X509Certificate:t}=require("crypto"),{join:e}=require("path");var r=typeof __webpack_require__=="function"?__non_webpack_require__:require;let n=process.arch==="arm64"?"crypt32-arm64.node":"crypt32.node",o=r(e(__dirname,n)),s=[],c=new o.Crypt32;try{let l;for(;l=c.next();){let u=new t(l);s.push(u.toString())}}finally{c.done()}return Array.from(new Set(s))}a(RSs,"all");process.platform!=="win32"?nnr.exports.all=()=>[]:nnr.exports.all=RSs});var al=I((kof,l8n)=>{"use strict";p();l8n.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kHTTP2InitialWindowSize:Symbol("http2 initial window size"),kHTTP2ConnectionWindowSize:Symbol("http2 connection window size"),kEnableConnectProtocol:Symbol("http2session connect protocol"),kRemoteSettings:Symbol("http2session remote settings"),kHTTP2Stream:Symbol("http2session client stream"),kPingInterval:Symbol("ping interval"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent"),kSocks5ProxyAgent:Symbol("socks5 proxy agent")}});var ynr=I((Dof,p8n)=>{"use strict";p();var tpe=0,fnr=1e3,pnr=(fnr>>1)-1,Lj,hnr=Symbol("kFastTimer"),HF=[],mnr=-2,gnr=-1,d8n=0,u8n=1;function Anr(){tpe+=pnr;let t=0,e=HF.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=gnr,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===gnr?(r._state=mnr,--e!==0&&(HF[t]=HF[e])):++t}HF.length=e,HF.length!==0&&f8n()}a(Anr,"onTick");function f8n(){Lj?.refresh?Lj.refresh():(clearTimeout(Lj),Lj=setTimeout(Anr,pnr),Lj?.unref())}a(f8n,"refreshTimeout");var pot=class{static{a(this,"FastTimer")}[hnr]=!0;_state=mnr;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===mnr&&HF.push(this),(!Lj||HF.length===1)&&f8n(),this._state=d8n}clear(){this._state=gnr,this._idleStart=-1}};p8n.exports={setTimeout(t,e,r){return e<=fnr?setTimeout(t,e,r):new pot(t,e,r)},clearTimeout(t){t[hnr]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new pot(t,e,r)},clearFastTimeout(t){t.clear()},now(){return tpe},tick(t=0){tpe+=t-fnr+1,Anr(),Anr()},reset(){tpe=0,HF.length=0,clearTimeout(Lj),Lj=null},kFastTimer:hnr}});var ao=I((Oof,F8n)=>{"use strict";p();var h8n=Symbol.for("undici.error.UND_ERR"),ld=class extends Error{static{a(this,"UndiciError")}constructor(e,r){super(e,r),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&e[h8n]===!0}get[h8n](){return!0}},m8n=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),Enr=class extends ld{static{a(this,"ConnectTimeoutError")}constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[m8n]===!0}get[m8n](){return!0}},g8n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),_nr=class extends ld{static{a(this,"HeadersTimeoutError")}constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[g8n]===!0}get[g8n](){return!0}},A8n=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),vnr=class extends ld{static{a(this,"HeadersOverflowError")}constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&e[A8n]===!0}get[A8n](){return!0}},y8n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),Cnr=class extends ld{static{a(this,"BodyTimeoutError")}constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[y8n]===!0}get[y8n](){return!0}},E8n=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),bnr=class extends ld{static{a(this,"InvalidArgumentError")}constructor(e){super(e),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](e){return e&&e[E8n]===!0}get[E8n](){return!0}},_8n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),Snr=class extends ld{static{a(this,"InvalidReturnValueError")}constructor(e){super(e),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](e){return e&&e[_8n]===!0}get[_8n](){return!0}},v8n=Symbol.for("undici.error.UND_ERR_ABORT"),hot=class extends ld{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError",this.message=e||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](e){return e&&e[v8n]===!0}get[v8n](){return!0}},C8n=Symbol.for("undici.error.UND_ERR_ABORTED"),Tnr=class extends hot{static{a(this,"RequestAbortedError")}constructor(e){super(e),this.name="AbortError",this.message=e||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](e){return e&&e[C8n]===!0}get[C8n](){return!0}},b8n=Symbol.for("undici.error.UND_ERR_INFO"),Inr=class extends ld{static{a(this,"InformationalError")}constructor(e){super(e),this.name="InformationalError",this.message=e||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](e){return e&&e[b8n]===!0}get[b8n](){return!0}},S8n=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),xnr=class extends ld{static{a(this,"RequestContentLengthMismatchError")}constructor(e){super(e),this.name="RequestContentLengthMismatchError",this.message=e||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[S8n]===!0}get[S8n](){return!0}},T8n=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),wnr=class extends ld{static{a(this,"ResponseContentLengthMismatchError")}constructor(e){super(e),this.name="ResponseContentLengthMismatchError",this.message=e||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[T8n]===!0}get[T8n](){return!0}},I8n=Symbol.for("undici.error.UND_ERR_DESTROYED"),Rnr=class extends ld{static{a(this,"ClientDestroyedError")}constructor(e){super(e),this.name="ClientDestroyedError",this.message=e||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](e){return e&&e[I8n]===!0}get[I8n](){return!0}},x8n=Symbol.for("undici.error.UND_ERR_CLOSED"),knr=class extends ld{static{a(this,"ClientClosedError")}constructor(e){super(e),this.name="ClientClosedError",this.message=e||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](e){return e&&e[x8n]===!0}get[x8n](){return!0}},w8n=Symbol.for("undici.error.UND_ERR_SOCKET"),Pnr=class extends ld{static{a(this,"SocketError")}constructor(e,r){super(e),this.name="SocketError",this.message=e||"Socket error",this.code="UND_ERR_SOCKET",this.socket=r}static[Symbol.hasInstance](e){return e&&e[w8n]===!0}get[w8n](){return!0}},R8n=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),Dnr=class extends ld{static{a(this,"NotSupportedError")}constructor(e){super(e),this.name="NotSupportedError",this.message=e||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](e){return e&&e[R8n]===!0}get[R8n](){return!0}},k8n=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),Nnr=class extends ld{static{a(this,"BalancedPoolMissingUpstreamError")}constructor(e){super(e),this.name="MissingUpstreamError",this.message=e||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](e){return e&&e[k8n]===!0}get[k8n](){return!0}},P8n=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),Mnr=class extends Error{static{a(this,"HTTPParserError")}constructor(e,r,n){super(e),this.name="HTTPParserError",this.code=r?`HPE_${r}`:void 0,this.data=n?n.toString():void 0}static[Symbol.hasInstance](e){return e&&e[P8n]===!0}get[P8n](){return!0}},D8n=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),Onr=class extends ld{static{a(this,"ResponseExceededMaxSizeError")}constructor(e){super(e),this.name="ResponseExceededMaxSizeError",this.message=e||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](e){return e&&e[D8n]===!0}get[D8n](){return!0}},N8n=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),Lnr=class extends ld{static{a(this,"RequestRetryError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="RequestRetryError",this.message=e||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[N8n]===!0}get[N8n](){return!0}},M8n=Symbol.for("undici.error.UND_ERR_RESPONSE"),Bnr=class extends ld{static{a(this,"ResponseError")}constructor(e,r,{headers:n,body:o}){super(e),this.name="ResponseError",this.message=e||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=r,this.body=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[M8n]===!0}get[M8n](){return!0}},O8n=Symbol.for("undici.error.UND_ERR_PRX_TLS"),Fnr=class extends ld{static{a(this,"SecureProxyConnectionError")}constructor(e,r,n={}){super(r,{cause:e,...n}),this.name="SecureProxyConnectionError",this.message=r||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=e}static[Symbol.hasInstance](e){return e&&e[O8n]===!0}get[O8n](){return!0}},L8n=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED"),Unr=class extends ld{static{a(this,"MaxOriginsReachedError")}constructor(e){super(e),this.name="MaxOriginsReachedError",this.message=e||"Maximum allowed origins reached",this.code="UND_ERR_MAX_ORIGINS_REACHED"}static[Symbol.hasInstance](e){return e&&e[L8n]===!0}get[L8n](){return!0}},Qnr=class extends ld{static{a(this,"Socks5ProxyError")}constructor(e,r){super(e),this.name="Socks5ProxyError",this.message=e||"SOCKS5 proxy error",this.code=r||"UND_ERR_SOCKS5"}},B8n=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),qnr=class extends ld{static{a(this,"MessageSizeExceededError")}constructor(e){super(e),this.name="MessageSizeExceededError",this.message=e||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](e){return e&&e[B8n]===!0}get[B8n](){return!0}};F8n.exports={AbortError:hot,HTTPParserError:Mnr,UndiciError:ld,HeadersTimeoutError:_nr,HeadersOverflowError:vnr,BodyTimeoutError:Cnr,RequestContentLengthMismatchError:xnr,ConnectTimeoutError:Enr,InvalidArgumentError:bnr,InvalidReturnValueError:Snr,RequestAbortedError:Tnr,ClientDestroyedError:Rnr,ClientClosedError:knr,InformationalError:Inr,SocketError:Pnr,NotSupportedError:Dnr,ResponseContentLengthMismatchError:wnr,BalancedPoolMissingUpstreamError:Nnr,ResponseExceededMaxSizeError:Onr,RequestRetryError:Lnr,ResponseError:Bnr,SecureProxyConnectionError:Fnr,MaxOriginsReachedError:Unr,Socks5ProxyError:Qnr,MessageSizeExceededError:qnr}});var got=I((Fof,Q8n)=>{"use strict";p();var jnr=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"],mot={};Object.setPrototypeOf(mot,null);var U8n={};Object.setPrototypeOf(U8n,null);function PSs(t){let e=U8n[t];return e===void 0&&(e=Buffer.from(t)),e}a(PSs,"getHeaderNameAsBuffer");for(let t=0;t{"use strict";p();var{wellknownHeaderNames:q8n,headerNameLowerCasedRecord:DSs}=got(),Hnr=class t{static{a(this,"TstNode")}value=null;left=null;middle=null;right=null;code;constructor(e,r,n){if(n===void 0||n>=e.length)throw new TypeError("Unreachable");if((this.code=e.charCodeAt(n))>127)throw new TypeError("key must be ascii string");e.length!==++n?this.middle=new t(e,r,n):this.value=r}add(e,r){let n=e.length;if(n===0)throw new TypeError("Unreachable");let o=0,s=this;for(;;){let c=e.charCodeAt(o);if(c>127)throw new TypeError("key must be ascii string");if(s.code===c)if(n===++o){s.value=r;break}else if(s.middle!==null)s=s.middle;else{s.middle=new t(e,r,o);break}else if(s.code=65&&(s|=32);o!==null;){if(s===o.code){if(r===++n)return o;o=o.middle;break}o=o.code{"use strict";p();var fPe=require("node:assert"),{kDestroyed:z8n,kBodyUsed:rpe,kListeners:Eot,kBody:$8n}=al(),{IncomingMessage:NSs}=require("node:http"),Y8n=require("node:stream"),MSs=require("node:net"),{stringify:OSs}=require("node:querystring"),{EventEmitter:LSs}=require("node:events"),yot=ynr(),{InvalidArgumentError:Ng,ConnectTimeoutError:BSs}=ao(),{headerNameLowerCasedRecord:FSs}=got(),{tree:K8n}=G8n(),[USs,QSs]=process.versions.node.split(".",2).map(t=>Number(t)),vot=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[$8n]=e,this[rpe]=!1}async*[Symbol.asyncIterator](){fPe(!this[rpe],"disturbed"),this[rpe]=!0,yield*this[$8n]}};function V8n(){}a(V8n,"noop");function qSs(t){return Cot(t)?(r6n(t)===0&&t.on("data",function(){fPe(!1)}),typeof t.readableDidRead!="boolean"&&(t[rpe]=!1,LSs.prototype.on.call(t,"data",function(){this[rpe]=!0})),t):t&&typeof t.pipeTo=="function"?new vot(t):t&&a6n(t)?t:t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&t6n(t)?new vot(t):t}a(qSs,"wrapRequestBody");function Cot(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Cot,"isStream");function J8n(t){if(t===null)return!1;if(t instanceof Blob)return!0;if(typeof t!="object")return!1;{let e=t[Symbol.toStringTag];return(e==="Blob"||e==="File")&&("stream"in t&&typeof t.stream=="function"||"arrayBuffer"in t&&typeof t.arrayBuffer=="function")}}a(J8n,"isBlobLike");function Z8n(t){return t.includes("?")||t.includes("#")}a(Z8n,"pathHasQueryOrFragment");function jSs(t,e){if(Z8n(t))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=OSs(e);return r&&(t+="?"+r),t}a(jSs,"serializePathWithQuery");function X8n(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(X8n,"isValidPort");function _ot(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(_ot,"isHttpOrHttpsPrefixed");function e6n(t){if(typeof t=="string"){if(t=new URL(t),!_ot(t.origin||t.protocol))throw new Ng("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new Ng("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&X8n(t.port)===!1)throw new Ng("Invalid URL: port must be a valid integer or a string representation of an integer.");if(t.path!=null&&typeof t.path!="string")throw new Ng("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new Ng("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new Ng("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new Ng("Invalid URL origin: the origin must be a string or null/undefined.");if(!_ot(t.origin||t.protocol))throw new Ng("Invalid URL protocol: the URL must start with `http:` or `https:`.");let e=t.port!=null?t.port:t.protocol==="https:"?443:80,r=t.origin!=null?t.origin:`${t.protocol||""}//${t.hostname||""}:${e}`,n=t.path!=null?t.path:`${t.pathname||""}${t.search||""}`;return r[r.length-1]==="/"&&(r=r.slice(0,r.length-1)),n&&n[0]!=="/"&&(n=`/${n}`),new URL(`${r}${n}`)}if(!_ot(t.origin||t.protocol))throw new Ng("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(e6n,"parseURL");function HSs(t){if(t=e6n(t),t.pathname!=="/"||t.search||t.hash)throw new Ng("invalid url");return t}a(HSs,"parseOrigin");function GSs(t){if(t[0]==="["){let r=t.indexOf("]");return fPe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(GSs,"getHostname");function $Ss(t){if(!t)return null;fPe(typeof t=="string");let e=GSs(t);return MSs.isIP(e)?"":e}a($Ss,"getServerName");function VSs(t){return JSON.parse(JSON.stringify(t))}a(VSs,"deepClone");function WSs(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(WSs,"isAsyncIterable");function t6n(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(t6n,"isIterable");function zSs(t){let e=Object.getPrototypeOf(t);return Object.prototype.hasOwnProperty.call(t,Symbol.iterator)||e!=null&&e!==Object.prototype&&typeof t[Symbol.iterator]=="function"}a(zSs,"hasSafeIterator");function r6n(t){if(t==null)return 0;if(Cot(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(J8n(t))return t.size!=null?t.size:null;if(s6n(t))return t.byteLength}return null}a(r6n,"bodyLength");function n6n(t){return t&&!!(t.destroyed||t[z8n]||Y8n.isDestroyed?.(t))}a(n6n,"isDestroyed");function i6n(t,e){t==null||!Cot(t)||n6n(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===NSs&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[z8n]=!0))}a(i6n,"destroy");var YSs=/timeout=(\d+)/;function KSs(t){let e=t.match(YSs);return e?parseInt(e[1],10)*1e3:null}a(KSs,"parseKeepAliveTimeout");function o6n(t){return typeof t=="string"?FSs[t]??t.toLowerCase():K8n.lookup(t)??t.toString("latin1").toLowerCase()}a(o6n,"headerNameToString");function JSs(t){return K8n.lookup(t)??t.toString("latin1").toLowerCase()}a(JSs,"bufferToLowerCasedHeaderName");function ZSs(t,e){e===void 0&&(e={});for(let r=0;rc.toString("latin1")):t[r+1].toString("latin1");n==="__proto__"?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s}else{let s=typeof t[r+1]=="string"?t[r+1]:Array.isArray(t[r+1])?t[r+1].map(c=>c.toString("latin1")):t[r+1].toString("latin1");e[n]=s}}return e}a(ZSs,"parseHeaders");function XSs(t){let e=t.length,r=new Array(e),n,o;for(let s=0;sBuffer.from(e))}a(eTs,"encodeRawHeaders");function s6n(t){return t instanceof Uint8Array||Buffer.isBuffer(t)}a(s6n,"isBuffer");function tTs(t,e,r){if(!t||typeof t!="object")throw new Ng("handler must be an object");if(typeof t.onRequestStart!="function"){if(typeof t.onConnect!="function")throw new Ng("invalid onConnect method");if(typeof t.onError!="function")throw new Ng("invalid onError method");if(typeof t.onBodySent!="function"&&t.onBodySent!==void 0)throw new Ng("invalid onBodySent method");if(r||e==="CONNECT"){if(typeof t.onUpgrade!="function")throw new Ng("invalid onUpgrade method")}else{if(typeof t.onHeaders!="function")throw new Ng("invalid onHeaders method");if(typeof t.onData!="function")throw new Ng("invalid onData method");if(typeof t.onComplete!="function")throw new Ng("invalid onComplete method")}}}a(tTs,"assertRequestHandler");function rTs(t){return!!(t&&(Y8n.isDisturbed(t)||t[rpe]))}a(rTs,"isDisturbed");function nTs(t){return{localAddress:t.localAddress,localPort:t.localPort,remoteAddress:t.remoteAddress,remotePort:t.remotePort,remoteFamily:t.remoteFamily,timeout:t.timeout,bytesWritten:t.bytesWritten,bytesRead:t.bytesRead}}a(nTs,"getSocketInfo");function iTs(t){let e;return new ReadableStream({start(){e=t[Symbol.asyncIterator]()},pull(r){return e.next().then(({done:n,value:o})=>{if(n)return queueMicrotask(()=>{r.close(),r.byobRequest?.respond(0)});{let s=Buffer.isBuffer(o)?o:Buffer.from(o);return s.byteLength?r.enqueue(new Uint8Array(s)):this.pull(r)}})},cancel(){return e.return()},type:"bytes"})}a(iTs,"ReadableStreamFrom");function a6n(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}a(a6n,"isFormDataLike");function oTs(t,e){return"addEventListener"in t?(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)):(t.once("abort",e),()=>t.removeListener("abort",e))}a(oTs,"addAbortListener");var c6n=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function sTs(t){return c6n[t]===1}a(sTs,"isTokenCharCode");var aTs=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;function cTs(t){if(t.length>=12)return aTs.test(t);if(t.length===0)return!1;for(let e=0;e{if(!e.timeout)return V8n;let r=null,n=null,o=yot.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>W8n(t.deref(),e))})},e.timeout);return()=>{yot.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return V8n;let r=null,n=yot.setFastTimeout(()=>{r=setImmediate(()=>{W8n(t.deref(),e)})},e.timeout);return()=>{yot.clearFastTimeout(n),clearImmediate(r)}};function W8n(t,e){if(t==null)return;let r="Connect Timeout Error";Array.isArray(t.autoSelectFamilyAttemptedAddresses)?r+=` (attempted addresses: ${t.autoSelectFamilyAttemptedAddresses.join(", ")},`:r+=` (attempted address: ${e.hostname}:${e.port},`,r+=` timeout: ${e.timeout}ms)`,i6n(t,new BSs(r))}a(W8n,"onConnectTimeout");function ATs(t){if(t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p")switch(t[4]){case":":return"http:";case"s":if(t[5]===":")return"https:"}return t.slice(0,t.indexOf(":")+1)}a(ATs,"getProtocolFromUrlString");var l6n=Object.create(null);l6n.enumerable=!0;var Gnr={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"},u6n={...Gnr,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(Gnr,null);Object.setPrototypeOf(u6n,null);d6n.exports={kEnumerableProperty:l6n,isDisturbed:rTs,isBlobLike:J8n,parseOrigin:HSs,parseURL:e6n,getServerName:$Ss,isStream:Cot,isIterable:t6n,hasSafeIterator:zSs,isAsyncIterable:WSs,isDestroyed:n6n,headerNameToString:o6n,bufferToLowerCasedHeaderName:JSs,addListener:pTs,removeAllListeners:hTs,errorRequest:mTs,parseRawHeaders:XSs,encodeRawHeaders:eTs,parseHeaders:ZSs,parseKeepAliveTimeout:KSs,destroy:i6n,bodyLength:r6n,deepClone:VSs,ReadableStreamFrom:iTs,isBuffer:s6n,assertRequestHandler:tTs,getSocketInfo:nTs,isFormDataLike:a6n,pathHasQueryOrFragment:Z8n,serializePathWithQuery:jSs,addAbortListener:oTs,isValidHTTPToken:cTs,isValidHeaderValue:uTs,isTokenCharCode:sTs,parseRangeHeader:fTs,normalizedMethodRecordsBase:Gnr,normalizedMethodRecords:u6n,isValidPort:X8n,isHttpOrHttpsPrefixed:_ot,nodeMajor:USs,nodeMinor:QSs,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:qSs,setupConnectTimeout:gTs,getProtocolFromUrlString:ATs}});var Wnr=I((Wof,g6n)=>{"use strict";p();var{kConnected:f6n,kPending:p6n,kRunning:h6n,kSize:m6n,kFree:yTs,kQueued:ETs}=al(),$nr=class{static{a(this,"ClientStats")}constructor(e){this.connected=e[f6n],this.pending=e[p6n],this.running=e[h6n],this.size=e[m6n]}},Vnr=class{static{a(this,"PoolStats")}constructor(e){this.connected=e[f6n],this.free=e[yTs],this.pending=e[p6n],this.queued=e[ETs],this.running=e[h6n],this.size=e[m6n]}};g6n.exports={ClientStats:$nr,PoolStats:Vnr}});var Bj=I((Kof,y6n)=>{"use strict";p();var cl=require("node:diagnostics_channel"),Jnr=require("node:util"),EZ=Jnr.debuglog("undici"),pPe=Jnr.debuglog("fetch"),bot=Jnr.debuglog("websocket"),AT={beforeConnect:cl.channel("undici:client:beforeConnect"),connected:cl.channel("undici:client:connected"),connectError:cl.channel("undici:client:connectError"),sendHeaders:cl.channel("undici:client:sendHeaders"),create:cl.channel("undici:request:create"),bodySent:cl.channel("undici:request:bodySent"),bodyChunkSent:cl.channel("undici:request:bodyChunkSent"),bodyChunkReceived:cl.channel("undici:request:bodyChunkReceived"),headers:cl.channel("undici:request:headers"),trailers:cl.channel("undici:request:trailers"),error:cl.channel("undici:request:error"),open:cl.channel("undici:websocket:open"),close:cl.channel("undici:websocket:close"),socketError:cl.channel("undici:websocket:socket_error"),ping:cl.channel("undici:websocket:ping"),pong:cl.channel("undici:websocket:pong"),proxyConnected:cl.channel("undici:proxy:connected")},znr=!1;function A6n(t=EZ){if(!znr){if(AT.beforeConnect.hasSubscribers||AT.connected.hasSubscribers||AT.connectError.hasSubscribers||AT.sendHeaders.hasSubscribers){znr=!0;return}znr=!0,cl.subscribe("undici:client:beforeConnect",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),cl.subscribe("undici:client:connected",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),cl.subscribe("undici:client:connectError",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s%s using %s%s errored - %s",s,o?`:${o}`:"",n,r,c.message)}),cl.subscribe("undici:client:sendHeaders",e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s%s",r,o,n)})}}a(A6n,"trackClientEvents");var Ynr=!1;function _Ts(t=EZ){if(!Ynr){if(AT.headers.hasSubscribers||AT.trailers.hasSubscribers||AT.error.hasSubscribers){Ynr=!0;return}Ynr=!0,cl.subscribe("undici:request:headers",e=>{let{request:{method:r,path:n,origin:o},response:{statusCode:s}}=e;t("received response to %s %s%s - HTTP %d",r,o,n,s)}),cl.subscribe("undici:request:trailers",e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s%s",r,o,n)}),cl.subscribe("undici:request:error",e=>{let{request:{method:r,path:n,origin:o},error:s}=e;t("request to %s %s%s errored - %s",r,o,n,s.message)})}}a(_Ts,"trackRequestEvents");var Knr=!1;function vTs(t=bot){if(!Knr){if(AT.open.hasSubscribers||AT.close.hasSubscribers||AT.socketError.hasSubscribers||AT.ping.hasSubscribers||AT.pong.hasSubscribers){Knr=!0;return}Knr=!0,cl.subscribe("undici:websocket:open",e=>{if(e.address!=null){let{address:r,port:n}=e.address;t("connection opened %s%s",r,n?`:${n}`:"")}else t("connection opened")}),cl.subscribe("undici:websocket:close",e=>{let{websocket:r,code:n,reason:o}=e;t("closed connection to %s - %s %s",r.url,n,o)}),cl.subscribe("undici:websocket:socket_error",e=>{t("connection errored - %s",e.message)}),cl.subscribe("undici:websocket:ping",e=>{t("ping received")}),cl.subscribe("undici:websocket:pong",e=>{t("pong received")})}}a(vTs,"trackWebSocketEvents");(EZ.enabled||pPe.enabled)&&(A6n(pPe.enabled?pPe:EZ),_Ts(pPe.enabled?pPe:EZ));bot.enabled&&(A6n(EZ.enabled?EZ:bot),vTs(bot));y6n.exports={channels:AT}});var v6n=I((Xof,_6n)=>{"use strict";p();var{InvalidArgumentError:Qc,NotSupportedError:CTs}=ao(),R5=require("node:assert"),{isValidHTTPToken:Znr,isValidHeaderValue:Xnr,isStream:bTs,destroy:STs,isBuffer:TTs,isFormDataLike:ITs,isIterable:xTs,hasSafeIterator:wTs,isBlobLike:RTs,serializePathWithQuery:kTs,assertRequestHandler:PTs,getServerName:DTs,normalizedMethodRecords:NTs,getProtocolFromUrlString:MTs}=Po(),{channels:fb}=Bj(),{headerNameLowerCasedRecord:E6n}=got(),OTs=/[^\u0021-\u00ff]/;function LTs(t){if(typeof t!="string"||t.length===0)return!1;for(let e=0;e57)return!1}return!0}a(LTs,"isValidContentLengthHeaderValue");var Nw=Symbol("handler"),eir=class{static{a(this,"Request")}constructor(e,{path:r,method:n,body:o,headers:s,query:c,idempotent:l,blocking:u,upgrade:d,headersTimeout:f,bodyTimeout:h,reset:m,expectContinue:g,servername:A,throwOnError:y,maxRedirections:E,typeOfService:_},v){if(typeof r!="string")throw new Qc("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Qc("path must be an absolute URL or start with a slash");if(OTs.test(r))throw new Qc("invalid request path");if(typeof n!="string")throw new Qc("method must be a string");if(NTs[n]===void 0&&!Znr(n))throw new Qc("invalid request method");if(d&&typeof d!="string")throw new Qc("upgrade must be a string");if(d&&!Xnr(d))throw new Qc("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Qc("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Qc("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Qc("invalid reset");if(g!=null&&typeof g!="boolean")throw new Qc("invalid expectContinue");if(y!=null)throw new Qc("invalid throwOnError");if(E!=null&&E!==0)throw new Qc("maxRedirections is not supported, use the redirect interceptor");if(_!=null&&(!Number.isInteger(_)||_<0||_>255))throw new Qc("typeOfService must be an integer between 0 and 255");if(this.headersTimeout=f,this.bodyTimeout=h,this.method=n,this.typeOfService=_??0,this.abort=null,o==null)this.body=null;else if(bTs(o)){this.body=o;let b=this.body._readableState;(!b||!b.autoDestroy)&&(this.endHandler=a(function(){STs(this)},"autoDestroy"),this.body.on("end",this.endHandler)),this.errorHandler=T=>{this.abort?this.abort(T):this.error=T},this.body.on("error",this.errorHandler)}else if(TTs(o))this.body=o.byteLength?o:null;else if(ArrayBuffer.isView(o))this.body=o.buffer.byteLength?Buffer.from(o.buffer,o.byteOffset,o.byteLength):null;else if(o instanceof ArrayBuffer)this.body=o.byteLength?Buffer.from(o):null;else if(typeof o=="string")this.body=o.length?Buffer.from(o):null;else if(ITs(o)||xTs(o)||RTs(o))this.body=o;else throw new Qc("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=d||null,this.path=c?kTs(r,c):r,this.origin=e,this.protocol=MTs(e),this.idempotent=l??(n==="HEAD"||n==="GET"),this.blocking=u??this.method!=="HEAD",this.reset=m??null,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=g??!1,Array.isArray(s)){if(s.length%2!==0)throw new Qc("headers array must be even");for(let b=0;b{"use strict";p();var{InvalidArgumentError:BTs}=ao();b6n.exports=class C6n{static{a(this,"WrapHandler")}#e;constructor(e){this.#e=e}static wrap(e){return e.onRequestStart?e:new C6n(e)}onConnect(e,r){return this.#e.onConnect?.(e,r)}onResponseStarted(){return this.#e.onResponseStarted?.()}onHeaders(e,r,n,o){return this.#e.onHeaders?.(e,r,n,o)}onUpgrade(e,r,n){return this.#e.onUpgrade?.(e,r,n)}onData(e){return this.#e.onData?.(e)}onComplete(e){return this.#e.onComplete?.(e)}onError(e){if(!this.#e.onError)throw e;return this.#e.onError?.(e)}onRequestStart(e,r){this.#e.onConnect?.(n=>e.abort(n),r)}onRequestUpgrade(e,r,n,o){let s=[];for(let[c,l]of Object.entries(n))s.push(Buffer.from(c,"latin1"),tir(l));this.#e.onUpgrade?.(r,s,o)}onResponseStart(e,r,n,o){let s=[];for(let[c,l]of Object.entries(n))s.push(Buffer.from(c,"latin1"),tir(l));this.#e.onHeaders?.(r,s,()=>e.resume(),o)===!1&&e.pause()}onResponseData(e,r){this.#e.onData?.(r)===!1&&e.pause()}onResponseEnd(e,r){let n=[];for(let[o,s]of Object.entries(r))n.push(Buffer.from(o,"latin1"),tir(s));this.#e.onComplete?.(n)}onResponseError(e,r){if(!this.#e.onError)throw new BTs("invalid onError method");this.#e.onError?.(r)}};function tir(t){return Array.isArray(t)?t.map(e=>Buffer.from(e,"latin1")):Buffer.from(t,"latin1")}a(tir,"toRawHeaderValue")});var mPe=I((osf,S6n)=>{"use strict";p();var FTs=require("node:events"),UTs=hPe(),QTs=a(t=>(e,r)=>t(e,UTs.wrap(r)),"wrapInterceptor"),rir=class extends FTs{static{a(this,"Dispatcher")}dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}compose(...e){let r=Array.isArray(e[0])?e[0]:e,n=this.dispatch.bind(this);for(let o of r)if(o!=null){if(typeof o!="function")throw new TypeError(`invalid interceptor, expected function received ${typeof o}`);if(n=o(n),n=QTs(n),n==null||typeof n!="function"||n.length!==2)throw new TypeError("invalid interceptor")}return new Proxy(this,{get:a((o,s)=>s==="dispatch"?n:o[s],"get")})}};S6n.exports=rir});var x6n=I((csf,I6n)=>{"use strict";p();var{parseHeaders:nir}=Po(),{InvalidArgumentError:qTs}=ao(),iir=Symbol("resume"),oir=class{static{a(this,"UnwrapController")}#e=!1;#t=null;#r=!1;#n;[iir]=null;rawHeaders=null;rawTrailers=null;constructor(e){this.#n=e}pause(){this.#e=!0}resume(){this.#e&&(this.#e=!1,this[iir]?.())}abort(e){this.#r||(this.#r=!0,this.#t=e,this.#n(e))}get aborted(){return this.#r}get reason(){return this.#t}get paused(){return this.#e}};I6n.exports=class T6n{static{a(this,"UnwrapHandler")}#e;#t;constructor(e){this.#e=e}static unwrap(e){return e.onRequestStart?new T6n(e):e}onConnect(e,r){this.#t=new oir(e),this.#e.onRequestStart?.(this.#t,r)}onResponseStarted(){return this.#e.onResponseStarted?.()}onUpgrade(e,r,n){this.#t.rawHeaders=r,this.#e.onRequestUpgrade?.(this.#t,e,nir(r),n)}onHeaders(e,r,n,o){return this.#t[iir]=n,this.#t.rawHeaders=r,this.#e.onResponseStart?.(this.#t,e,nir(r),o),!this.#t.paused}onData(e){return this.#e.onResponseData?.(this.#t,e),!this.#t.paused}onComplete(e){this.#t.rawTrailers=e,this.#e.onResponseEnd?.(this.#t,nir(e))}onError(e){if(!this.#e.onResponseError)throw new qTs("invalid onError method");this.#e.onResponseError?.(this.#t,e)}}});var vZ=I((dsf,w6n)=>{"use strict";p();var jTs=mPe(),HTs=x6n(),{ClientDestroyedError:sir,ClientClosedError:GTs,InvalidArgumentError:Tot}=ao(),{kDestroy:$Ts,kClose:VTs,kClosed:gPe,kDestroyed:npe,kDispatch:WTs}=al(),Fj=Symbol("onDestroyed"),_Z=Symbol("onClosed"),air=Symbol("webSocketOptions"),cir=class extends jTs{static{a(this,"DispatcherBase")}[npe]=!1;[Fj]=null;[gPe]=!1;[_Z]=null;constructor(e){super(),this[air]=e?.webSocket??{}}get webSocketOptions(){return{maxFragments:this[air].maxFragments??131072,maxPayloadSize:this[air].maxPayloadSize??128*1024*1024}}get destroyed(){return this[npe]}get closed(){return this[gPe]}close(e){if(e===void 0)return new Promise((n,o)=>{this.close((s,c)=>s?o(s):n(c))});if(typeof e!="function")throw new Tot("invalid callback");if(this[npe]){let n=new sir;queueMicrotask(()=>e(n,null));return}if(this[gPe]){this[_Z]?this[_Z].push(e):queueMicrotask(()=>e(null,null));return}this[gPe]=!0,this[_Z]??=[],this[_Z].push(e);let r=a(()=>{let n=this[_Z];this[_Z]=null;for(let o=0;othis.destroy()).then(()=>queueMicrotask(r))}destroy(e,r){if(typeof e=="function"&&(r=e,e=null),r===void 0)return new Promise((o,s)=>{this.destroy(e,(c,l)=>c?s(c):o(l))});if(typeof r!="function")throw new Tot("invalid callback");if(this[npe]){this[Fj]?this[Fj].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new sir),this[npe]=!0,this[Fj]??=[],this[Fj].push(r);let n=a(()=>{let o=this[Fj];this[Fj]=null;for(let s=0;squeueMicrotask(n))}dispatch(e,r){if(!r||typeof r!="object")throw new Tot("handler must be an object");r=HTs.unwrap(r);try{if(!e||typeof e!="object")throw new Tot("opts must be an object.");if(this[npe]||this[Fj])throw new sir;if(this[gPe])throw new GTs;return this[WTs](e,r)}catch(n){if(typeof r.onError!="function")throw n;return r.onError(n),!1}}};w6n.exports=cir});var CZ=I((msf,P6n)=>{"use strict";p();var zTs=require("node:net"),R6n=require("node:assert"),k6n=Po(),{InvalidArgumentError:YTs}=ao(),lir,KTs=class{static{a(this,"WeakSessionCache")}constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new FinalizationRegistry(r=>{if(this._sessionCache.size=this._maxCachedSessions){for(let[o,s]of this._sessionCache)if(s.deref()===void 0){this._sessionCache.delete(o);return}let n=this._sessionCache.keys().next();n.done||this._sessionCache.delete(n.value)}this._sessionCache.set(e,new WeakRef(r)),this._sessionRegistry.register(r,e)}}};function JTs({allowH2:t,useH2c:e,maxCachedSessions:r,socketPath:n,timeout:o,session:s,...c}){if(r!=null&&(!Number.isInteger(r)||r<0))throw new YTs("maxCachedSessions must be a positive integer or zero");let l={path:n,...c},u=new KTs(r??100);return o=o??1e4,t=t??!1,a(function({hostname:f,host:h,protocol:m,port:g,servername:A,localAddress:y,httpSocket:E},_){let v;if(m==="https:"){lir||(lir=require("node:tls")),A=A||l.servername||k6n.getServerName(h)||null;let T=A||f;R6n(T);let w=s||u.get(T)||null;g=g||443,v=lir.connect({highWaterMark:16384,...l,servername:A,session:w,localAddress:y,ALPNProtocols:t?["http/1.1","h2"]:["http/1.1"],socket:E,port:g,host:f}),v.on("session",function(R){u.set(T,R)})}else R6n(!E,"httpSocket can only be sent on TLS update"),g=g||80,v=zTs.connect({highWaterMark:64*1024,...l,localAddress:y,port:g,host:f}),e===!0&&(v.alpnProtocol="h2");if(l.keepAlive==null||l.keepAlive){let T=l.keepAliveInitialDelay===void 0?6e4:l.keepAliveInitialDelay;v.setKeepAlive(!0,T)}let b=k6n.setupConnectTimeout(new WeakRef(v),{timeout:o,hostname:f,port:g});return v.setNoDelay(!0).once(m==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(b),_){let T=_;_=null,T(null,this)}}).on("error",function(T){if(queueMicrotask(b),_){let w=_;_=null,w(T)}}),v},"connect")}a(JTs,"buildConnector");P6n.exports=JTs});var D6n=I(uir=>{"use strict";p();Object.defineProperty(uir,"__esModule",{value:!0});uir.enumToMap=ZTs;function ZTs(t,e=[],r=[]){let n=(e?.length??0)===0,o=(r?.length??0)===0;return Object.fromEntries(Object.entries(t).filter(([,s])=>typeof s=="number"&&(n||e.includes(s))&&(o||!r.includes(s))))}a(ZTs,"enumToMap")});var N6n=I(je=>{"use strict";p();Object.defineProperty(je,"__esModule",{value:!0});je.SPECIAL_HEADERS=je.MINOR=je.MAJOR=je.HTAB_SP_VCHAR_OBS_TEXT=je.QUOTED_STRING=je.CONNECTION_TOKEN_CHARS=je.HEADER_CHARS=je.TOKEN=je.HEX=je.URL_CHAR=je.USERINFO_CHARS=je.MARK=je.ALPHANUM=je.NUM=je.HEX_MAP=je.NUM_MAP=je.ALPHA=je.STATUSES_HTTP=je.H_METHOD_MAP=je.METHOD_MAP=je.METHODS_RTSP=je.METHODS_ICE=je.METHODS_HTTP=je.HEADER_STATE=je.FINISH=je.STATUSES=je.METHODS=je.LENIENT_FLAGS=je.FLAGS=je.TYPE=je.ERROR=void 0;var XTs=D6n();je.ERROR={OK:0,INTERNAL:1,STRICT:2,CR_EXPECTED:25,LF_EXPECTED:3,UNEXPECTED_CONTENT_LENGTH:4,UNEXPECTED_SPACE:30,CLOSED_CONNECTION:5,INVALID_METHOD:6,INVALID_URL:7,INVALID_CONSTANT:8,INVALID_VERSION:9,INVALID_HEADER_TOKEN:10,INVALID_CONTENT_LENGTH:11,INVALID_CHUNK_SIZE:12,INVALID_STATUS:13,INVALID_EOF_STATE:14,INVALID_TRANSFER_ENCODING:15,CB_MESSAGE_BEGIN:16,CB_HEADERS_COMPLETE:17,CB_MESSAGE_COMPLETE:18,CB_CHUNK_HEADER:19,CB_CHUNK_COMPLETE:20,PAUSED:21,PAUSED_UPGRADE:22,PAUSED_H2_UPGRADE:23,USER:24,CB_URL_COMPLETE:26,CB_STATUS_COMPLETE:27,CB_METHOD_COMPLETE:32,CB_VERSION_COMPLETE:33,CB_HEADER_FIELD_COMPLETE:28,CB_HEADER_VALUE_COMPLETE:29,CB_CHUNK_EXTENSION_NAME_COMPLETE:34,CB_CHUNK_EXTENSION_VALUE_COMPLETE:35,CB_RESET:31,CB_PROTOCOL_COMPLETE:38};je.TYPE={BOTH:0,REQUEST:1,RESPONSE:2};je.FLAGS={CONNECTION_KEEP_ALIVE:1,CONNECTION_CLOSE:2,CONNECTION_UPGRADE:4,CHUNKED:8,UPGRADE:16,CONTENT_LENGTH:32,SKIPBODY:64,TRAILING:128,TRANSFER_ENCODING:512};je.LENIENT_FLAGS={HEADERS:1,CHUNKED_LENGTH:2,KEEP_ALIVE:4,TRANSFER_ENCODING:8,VERSION:16,DATA_AFTER_CLOSE:32,OPTIONAL_LF_AFTER_CR:64,OPTIONAL_CRLF_AFTER_CHUNK:128,OPTIONAL_CR_BEFORE_LF:256,SPACES_AFTER_CHUNK_SIZE:512};je.METHODS={DELETE:0,GET:1,HEAD:2,POST:3,PUT:4,CONNECT:5,OPTIONS:6,TRACE:7,COPY:8,LOCK:9,MKCOL:10,MOVE:11,PROPFIND:12,PROPPATCH:13,SEARCH:14,UNLOCK:15,BIND:16,REBIND:17,UNBIND:18,ACL:19,REPORT:20,MKACTIVITY:21,CHECKOUT:22,MERGE:23,"M-SEARCH":24,NOTIFY:25,SUBSCRIBE:26,UNSUBSCRIBE:27,PATCH:28,PURGE:29,MKCALENDAR:30,LINK:31,UNLINK:32,SOURCE:33,PRI:34,DESCRIBE:35,ANNOUNCE:36,SETUP:37,PLAY:38,PAUSE:39,TEARDOWN:40,GET_PARAMETER:41,SET_PARAMETER:42,REDIRECT:43,RECORD:44,FLUSH:45,QUERY:46};je.STATUSES={CONTINUE:100,SWITCHING_PROTOCOLS:101,PROCESSING:102,EARLY_HINTS:103,RESPONSE_IS_STALE:110,REVALIDATION_FAILED:111,DISCONNECTED_OPERATION:112,HEURISTIC_EXPIRATION:113,MISCELLANEOUS_WARNING:199,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTI_STATUS:207,ALREADY_REPORTED:208,TRANSFORMATION_APPLIED:214,IM_USED:226,MISCELLANEOUS_PERSISTENT_WARNING:299,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,SWITCH_PROXY:306,TEMPORARY_REDIRECT:307,PERMANENT_REDIRECT:308,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,IM_A_TEAPOT:418,PAGE_EXPIRED:419,ENHANCE_YOUR_CALM:420,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL:430,REQUEST_HEADER_FIELDS_TOO_LARGE:431,LOGIN_TIMEOUT:440,NO_RESPONSE:444,RETRY_WITH:449,BLOCKED_BY_PARENTAL_CONTROL:450,UNAVAILABLE_FOR_LEGAL_REASONS:451,CLIENT_CLOSED_LOAD_BALANCED_REQUEST:460,INVALID_X_FORWARDED_FOR:463,REQUEST_HEADER_TOO_LARGE:494,SSL_CERTIFICATE_ERROR:495,SSL_CERTIFICATE_REQUIRED:496,HTTP_REQUEST_SENT_TO_HTTPS_PORT:497,INVALID_TOKEN:498,CLIENT_CLOSED_REQUEST:499,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,BANDWIDTH_LIMIT_EXCEEDED:509,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511,WEB_SERVER_UNKNOWN_ERROR:520,WEB_SERVER_IS_DOWN:521,CONNECTION_TIMEOUT:522,ORIGIN_IS_UNREACHABLE:523,TIMEOUT_OCCURED:524,SSL_HANDSHAKE_FAILED:525,INVALID_SSL_CERTIFICATE:526,RAILGUN_ERROR:527,SITE_IS_OVERLOADED:529,SITE_IS_FROZEN:530,IDENTITY_PROVIDER_AUTHENTICATION_ERROR:561,NETWORK_READ_TIMEOUT:598,NETWORK_CONNECT_TIMEOUT:599};je.FINISH={SAFE:0,SAFE_WITH_CB:1,UNSAFE:2};je.HEADER_STATE={GENERAL:0,CONNECTION:1,CONTENT_LENGTH:2,TRANSFER_ENCODING:3,UPGRADE:4,CONNECTION_KEEP_ALIVE:5,CONNECTION_CLOSE:6,CONNECTION_UPGRADE:7,TRANSFER_ENCODING_CHUNKED:8};je.METHODS_HTTP=[je.METHODS.DELETE,je.METHODS.GET,je.METHODS.HEAD,je.METHODS.POST,je.METHODS.PUT,je.METHODS.CONNECT,je.METHODS.OPTIONS,je.METHODS.TRACE,je.METHODS.COPY,je.METHODS.LOCK,je.METHODS.MKCOL,je.METHODS.MOVE,je.METHODS.PROPFIND,je.METHODS.PROPPATCH,je.METHODS.SEARCH,je.METHODS.UNLOCK,je.METHODS.BIND,je.METHODS.REBIND,je.METHODS.UNBIND,je.METHODS.ACL,je.METHODS.REPORT,je.METHODS.MKACTIVITY,je.METHODS.CHECKOUT,je.METHODS.MERGE,je.METHODS["M-SEARCH"],je.METHODS.NOTIFY,je.METHODS.SUBSCRIBE,je.METHODS.UNSUBSCRIBE,je.METHODS.PATCH,je.METHODS.PURGE,je.METHODS.MKCALENDAR,je.METHODS.LINK,je.METHODS.UNLINK,je.METHODS.PRI,je.METHODS.SOURCE,je.METHODS.QUERY];je.METHODS_ICE=[je.METHODS.SOURCE];je.METHODS_RTSP=[je.METHODS.OPTIONS,je.METHODS.DESCRIBE,je.METHODS.ANNOUNCE,je.METHODS.SETUP,je.METHODS.PLAY,je.METHODS.PAUSE,je.METHODS.TEARDOWN,je.METHODS.GET_PARAMETER,je.METHODS.SET_PARAMETER,je.METHODS.REDIRECT,je.METHODS.RECORD,je.METHODS.FLUSH,je.METHODS.GET,je.METHODS.POST];je.METHOD_MAP=(0,XTs.enumToMap)(je.METHODS);je.H_METHOD_MAP=Object.fromEntries(Object.entries(je.METHODS).filter(([t])=>t.startsWith("H")));je.STATUSES_HTTP=[je.STATUSES.CONTINUE,je.STATUSES.SWITCHING_PROTOCOLS,je.STATUSES.PROCESSING,je.STATUSES.EARLY_HINTS,je.STATUSES.RESPONSE_IS_STALE,je.STATUSES.REVALIDATION_FAILED,je.STATUSES.DISCONNECTED_OPERATION,je.STATUSES.HEURISTIC_EXPIRATION,je.STATUSES.MISCELLANEOUS_WARNING,je.STATUSES.OK,je.STATUSES.CREATED,je.STATUSES.ACCEPTED,je.STATUSES.NON_AUTHORITATIVE_INFORMATION,je.STATUSES.NO_CONTENT,je.STATUSES.RESET_CONTENT,je.STATUSES.PARTIAL_CONTENT,je.STATUSES.MULTI_STATUS,je.STATUSES.ALREADY_REPORTED,je.STATUSES.TRANSFORMATION_APPLIED,je.STATUSES.IM_USED,je.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,je.STATUSES.MULTIPLE_CHOICES,je.STATUSES.MOVED_PERMANENTLY,je.STATUSES.FOUND,je.STATUSES.SEE_OTHER,je.STATUSES.NOT_MODIFIED,je.STATUSES.USE_PROXY,je.STATUSES.SWITCH_PROXY,je.STATUSES.TEMPORARY_REDIRECT,je.STATUSES.PERMANENT_REDIRECT,je.STATUSES.BAD_REQUEST,je.STATUSES.UNAUTHORIZED,je.STATUSES.PAYMENT_REQUIRED,je.STATUSES.FORBIDDEN,je.STATUSES.NOT_FOUND,je.STATUSES.METHOD_NOT_ALLOWED,je.STATUSES.NOT_ACCEPTABLE,je.STATUSES.PROXY_AUTHENTICATION_REQUIRED,je.STATUSES.REQUEST_TIMEOUT,je.STATUSES.CONFLICT,je.STATUSES.GONE,je.STATUSES.LENGTH_REQUIRED,je.STATUSES.PRECONDITION_FAILED,je.STATUSES.PAYLOAD_TOO_LARGE,je.STATUSES.URI_TOO_LONG,je.STATUSES.UNSUPPORTED_MEDIA_TYPE,je.STATUSES.RANGE_NOT_SATISFIABLE,je.STATUSES.EXPECTATION_FAILED,je.STATUSES.IM_A_TEAPOT,je.STATUSES.PAGE_EXPIRED,je.STATUSES.ENHANCE_YOUR_CALM,je.STATUSES.MISDIRECTED_REQUEST,je.STATUSES.UNPROCESSABLE_ENTITY,je.STATUSES.LOCKED,je.STATUSES.FAILED_DEPENDENCY,je.STATUSES.TOO_EARLY,je.STATUSES.UPGRADE_REQUIRED,je.STATUSES.PRECONDITION_REQUIRED,je.STATUSES.TOO_MANY_REQUESTS,je.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,je.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,je.STATUSES.LOGIN_TIMEOUT,je.STATUSES.NO_RESPONSE,je.STATUSES.RETRY_WITH,je.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,je.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,je.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,je.STATUSES.INVALID_X_FORWARDED_FOR,je.STATUSES.REQUEST_HEADER_TOO_LARGE,je.STATUSES.SSL_CERTIFICATE_ERROR,je.STATUSES.SSL_CERTIFICATE_REQUIRED,je.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,je.STATUSES.INVALID_TOKEN,je.STATUSES.CLIENT_CLOSED_REQUEST,je.STATUSES.INTERNAL_SERVER_ERROR,je.STATUSES.NOT_IMPLEMENTED,je.STATUSES.BAD_GATEWAY,je.STATUSES.SERVICE_UNAVAILABLE,je.STATUSES.GATEWAY_TIMEOUT,je.STATUSES.HTTP_VERSION_NOT_SUPPORTED,je.STATUSES.VARIANT_ALSO_NEGOTIATES,je.STATUSES.INSUFFICIENT_STORAGE,je.STATUSES.LOOP_DETECTED,je.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,je.STATUSES.NOT_EXTENDED,je.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,je.STATUSES.WEB_SERVER_UNKNOWN_ERROR,je.STATUSES.WEB_SERVER_IS_DOWN,je.STATUSES.CONNECTION_TIMEOUT,je.STATUSES.ORIGIN_IS_UNREACHABLE,je.STATUSES.TIMEOUT_OCCURED,je.STATUSES.SSL_HANDSHAKE_FAILED,je.STATUSES.INVALID_SSL_CERTIFICATE,je.STATUSES.RAILGUN_ERROR,je.STATUSES.SITE_IS_OVERLOADED,je.STATUSES.SITE_IS_FROZEN,je.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,je.STATUSES.NETWORK_READ_TIMEOUT,je.STATUSES.NETWORK_CONNECT_TIMEOUT];je.ALPHA=[];for(let t=65;t<=90;t++)je.ALPHA.push(String.fromCharCode(t)),je.ALPHA.push(String.fromCharCode(t+32));je.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};je.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};je.NUM=["0","1","2","3","4","5","6","7","8","9"];je.ALPHANUM=je.ALPHA.concat(je.NUM);je.MARK=["-","_",".","!","~","*","'","(",")"];je.USERINFO_CHARS=je.ALPHANUM.concat(je.MARK).concat(["%",";",":","&","=","+","$",","]);je.URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(je.ALPHANUM);je.HEX=je.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);je.TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(je.ALPHANUM);je.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&je.HEADER_CHARS.push(t);je.CONNECTION_TOKEN_CHARS=je.HEADER_CHARS.filter(t=>t!==44);je.QUOTED_STRING=[" "," "];for(let t=33;t<=255;t++)t!==34&&t!==92&&je.QUOTED_STRING.push(t);je.HTAB_SP_VCHAR_OBS_TEXT=[" "," "];for(let t=33;t<=126;t++)je.HTAB_SP_VCHAR_OBS_TEXT.push(t);for(let t=128;t<=255;t++)je.HTAB_SP_VCHAR_OBS_TEXT.push(t);je.MAJOR=je.NUM_MAP;je.MINOR=je.MAJOR;je.SPECIAL_HEADERS={connection:je.HEADER_STATE.CONNECTION,"content-length":je.HEADER_STATE.CONTENT_LENGTH,"proxy-connection":je.HEADER_STATE.CONNECTION,"transfer-encoding":je.HEADER_STATE.TRANSFER_ENCODING,upgrade:je.HEADER_STATE.UPGRADE};je.default={ERROR:je.ERROR,TYPE:je.TYPE,FLAGS:je.FLAGS,LENIENT_FLAGS:je.LENIENT_FLAGS,METHODS:je.METHODS,STATUSES:je.STATUSES,FINISH:je.FINISH,HEADER_STATE:je.HEADER_STATE,ALPHA:je.ALPHA,NUM_MAP:je.NUM_MAP,HEX_MAP:je.HEX_MAP,NUM:je.NUM,ALPHANUM:je.ALPHANUM,MARK:je.MARK,USERINFO_CHARS:je.USERINFO_CHARS,URL_CHAR:je.URL_CHAR,HEX:je.HEX,TOKEN:je.TOKEN,HEADER_CHARS:je.HEADER_CHARS,CONNECTION_TOKEN_CHARS:je.CONNECTION_TOKEN_CHARS,QUOTED_STRING:je.QUOTED_STRING,HTAB_SP_VCHAR_OBS_TEXT:je.HTAB_SP_VCHAR_OBS_TEXT,MAJOR:je.MAJOR,MINOR:je.MINOR,SPECIAL_HEADERS:je.SPECIAL_HEADERS,METHODS_HTTP:je.METHODS_HTTP,METHODS_ICE:je.METHODS_ICE,METHODS_RTSP:je.METHODS_RTSP,METHOD_MAP:je.METHOD_MAP,H_METHOD_MAP:je.H_METHOD_MAP,STATUSES_HTTP:je.STATUSES_HTTP}});var fir=I((bsf,M6n)=>{"use strict";p();var{Buffer:eIs}=require("node:buffer"),tIs="AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCq/ZAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgL5YUCAgd/A34gASACaiEEAkAgACIDKAIMIgANACADKAIEBEAgAyABNgIECyMAQRBrIgkkAAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAygCHCICQQJrDvwBAfkBAgMEBQYHCAkKCwwNDg8QERL4ARP3ARQV9gEWF/UBGBkaGxwdHh8g/QH7ASH0ASIjJCUmJygpKivzASwtLi8wMTLyAfEBMzTwAe8BNTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5P+gFQUVJT7gHtAVTsAVXrAVZXWFla6gFbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHpAegBzwHnAdAB5gHRAdIB0wHUAeUB1QHWAdcB2AHZAdoB2wHcAd0B3gHfAeAB4QHiAeMBAPwBC0EADOMBC0EODOIBC0ENDOEBC0EPDOABC0EQDN8BC0ETDN4BC0EUDN0BC0EVDNwBC0EWDNsBC0EXDNoBC0EYDNkBC0EZDNgBC0EaDNcBC0EbDNYBC0EcDNUBC0EdDNQBC0EeDNMBC0EfDNIBC0EgDNEBC0EhDNABC0EIDM8BC0EiDM4BC0EkDM0BC0EjDMwBC0EHDMsBC0ElDMoBC0EmDMkBC0EnDMgBC0EoDMcBC0ESDMYBC0ERDMUBC0EpDMQBC0EqDMMBC0ErDMIBC0EsDMEBC0HeAQzAAQtBLgy/AQtBLwy+AQtBMAy9AQtBMQy8AQtBMgy7AQtBMwy6AQtBNAy5AQtB3wEMuAELQTUMtwELQTkMtgELQQwMtQELQTYMtAELQTcMswELQTgMsgELQT4MsQELQToMsAELQeABDK8BC0ELDK4BC0E/DK0BC0E7DKwBC0EKDKsBC0E8DKoBC0E9DKkBC0HhAQyoAQtBwQAMpwELQcAADKYBC0HCAAylAQtBCQykAQtBLQyjAQtBwwAMogELQcQADKEBC0HFAAygAQtBxgAMnwELQccADJ4BC0HIAAydAQtByQAMnAELQcoADJsBC0HLAAyaAQtBzAAMmQELQc0ADJgBC0HOAAyXAQtBzwAMlgELQdAADJUBC0HRAAyUAQtB0gAMkwELQdMADJIBC0HVAAyRAQtB1AAMkAELQdYADI8BC0HXAAyOAQtB2AAMjQELQdkADIwBC0HaAAyLAQtB2wAMigELQdwADIkBC0HdAAyIAQtB3gAMhwELQd8ADIYBC0HgAAyFAQtB4QAMhAELQeIADIMBC0HjAAyCAQtB5AAMgQELQeUADIABC0HiAQx/C0HmAAx+C0HnAAx9C0EGDHwLQegADHsLQQUMegtB6QAMeQtBBAx4C0HqAAx3C0HrAAx2C0HsAAx1C0HtAAx0C0EDDHMLQe4ADHILQe8ADHELQfAADHALQfIADG8LQfEADG4LQfMADG0LQfQADGwLQfUADGsLQfYADGoLQQIMaQtB9wAMaAtB+AAMZwtB+QAMZgtB+gAMZQtB+wAMZAtB/AAMYwtB/QAMYgtB/gAMYQtB/wAMYAtBgAEMXwtBgQEMXgtBggEMXQtBgwEMXAtBhAEMWwtBhQEMWgtBhgEMWQtBhwEMWAtBiAEMVwtBiQEMVgtBigEMVQtBiwEMVAtBjAEMUwtBjQEMUgtBjgEMUQtBjwEMUAtBkAEMTwtBkQEMTgtBkgEMTQtBkwEMTAtBlAEMSwtBlQEMSgtBlgEMSQtBlwEMSAtBmAEMRwtBmQEMRgtBmgEMRQtBmwEMRAtBnAEMQwtBnQEMQgtBngEMQQtBnwEMQAtBoAEMPwtBoQEMPgtBogEMPQtBowEMPAtBpAEMOwtBpQEMOgtBpgEMOQtBpwEMOAtBqAEMNwtBqQEMNgtBqgEMNQtBqwEMNAtBrAEMMwtBrQEMMgtBrgEMMQtBrwEMMAtBsAEMLwtBsQEMLgtBsgEMLQtBswEMLAtBtAEMKwtBtQEMKgtBtgEMKQtBtwEMKAtBuAEMJwtBuQEMJgtBugEMJQtBuwEMJAtBvAEMIwtBvQEMIgtBvgEMIQtBvwEMIAtBwAEMHwtBwQEMHgtBwgEMHQtBAQwcC0HDAQwbC0HEAQwaC0HFAQwZC0HGAQwYC0HHAQwXC0HIAQwWC0HJAQwVC0HKAQwUC0HLAQwTC0HMAQwSC0HNAQwRC0HOAQwQC0HPAQwPC0HQAQwOC0HRAQwNC0HSAQwMC0HTAQwLC0HUAQwKC0HVAQwJC0HWAQwIC0HjAQwHC0HXAQwGC0HYAQwFC0HZAQwEC0HaAQwDC0HbAQwCC0HdAQwBC0HcAQshAgNAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJ/AkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAg7jAQABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEjJCUnKCmeA5sDmgORA4oDgwOAA/0C+wL4AvIC8QLvAu0C6ALnAuYC5QLkAtwC2wLaAtkC2ALXAtYC1QLPAs4CzALLAsoCyQLIAscCxgLEAsMCvgK8AroCuQK4ArcCtgK1ArQCswKyArECsAKuAq0CqQKoAqcCpgKlAqQCowKiAqECoAKfApgCkAKMAosCigKBAv4B/QH8AfsB+gH5AfgB9wH1AfMB8AHrAekB6AHnAeYB5QHkAeMB4gHhAeAB3wHeAd0B3AHaAdkB2AHXAdYB1QHUAdMB0gHRAdABzwHOAc0BzAHLAcoByQHIAccBxgHFAcQBwwHCAcEBwAG/Ab4BvQG8AbsBugG5AbgBtwG2AbUBtAGzAbIBsQGwAa8BrgGtAawBqwGqAakBqAGnAaYBpQGkAaMBogGfAZ4BmQGYAZcBlgGVAZQBkwGSAZEBkAGPAY0BjAGHAYYBhQGEAYMBggF9fHt6eXZ1dFBRUlNUVQsgASAERw1yQf0BIQIMvgMLIAEgBEcNmAFB2wEhAgy9AwsgASAERw3xAUGOASECDLwDCyABIARHDfwBQYQBIQIMuwMLIAEgBEcNigJB/wAhAgy6AwsgASAERw2RAkH9ACECDLkDCyABIARHDZQCQfsAIQIMuAMLIAEgBEcNHkEeIQIMtwMLIAEgBEcNGUEYIQIMtgMLIAEgBEcNygJBzQAhAgy1AwsgASAERw3VAkHGACECDLQDCyABIARHDdYCQcMAIQIMswMLIAEgBEcN3AJBOCECDLIDCyADLQAwQQFGDa0DDIkDC0EAIQACQAJAAkAgAy0AKkUNACADLQArRQ0AIAMvATIiAkECcUUNAQwCCyADLwEyIgJBAXFFDQELQQEhACADLQAoQQFGDQAgAy8BNCIGQeQAa0HkAEkNACAGQcwBRg0AIAZBsAJGDQAgAkHAAHENAEEAIQAgAkGIBHFBgARGDQAgAkEocUEARyEACyADQQA7ATIgA0EAOgAxAkAgAEUEQCADQQA6ADEgAy0ALkEEcQ0BDLEDCyADQgA3AyALIANBADoAMSADQQE6ADYMSAtBACEAAkAgAygCOCICRQ0AIAIoAjAiAkUNACADIAIRAAAhAAsgAEUNSCAAQRVHDWIgA0EENgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMrwMLIAEgBEYEQEEGIQIMrwMLIAEtAABBCkcNGSABQQFqIQEMGgsgA0IANwMgQRIhAgyUAwsgASAERw2KA0EjIQIMrAMLIAEgBEYEQEEHIQIMrAMLAkACQCABLQAAQQprDgQBGBgAGAsgAUEBaiEBQRAhAgyTAwsgAUEBaiEBIANBL2otAABBAXENF0EAIQIgA0EANgIcIAMgATYCFCADQZkgNgIQIANBGTYCDAyrAwsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFoNGEEIIQIMqgMLIAEgBEcEQCADQQk2AgggAyABNgIEQRQhAgyRAwtBCSECDKkDCyADKQMgUA2uAgxDCyABIARGBEBBCyECDKgDCyABLQAAQQpHDRYgAUEBaiEBDBcLIANBL2otAABBAXFFDRkMJgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0ZDEILQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGgwkC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRsMMgsgA0Evai0AAEEBcUUNHAwiC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADRwMQgtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0dDCALIAEgBEYEQEETIQIMoAMLAkAgAS0AACIAQQprDgQfIyMAIgsgAUEBaiEBDB8LQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIgxCCyABIARGBEBBFiECDJ4DCyABLQAAQcDBAGotAABBAUcNIwyDAwsCQANAIAEtAABBsDtqLQAAIgBBAUcEQAJAIABBAmsOAgMAJwsgAUEBaiEBQSEhAgyGAwsgBCABQQFqIgFHDQALQRghAgydAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAFBAWoiARA0IgANIQxBC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADSMMKgsgASAERgRAQRwhAgybAwsgA0EKNgIIIAMgATYCBEEAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADSVBJCECDIEDCyABIARHBEADQCABLQAAQbA9ai0AACIAQQNHBEAgAEEBaw4FGBomggMlJgsgBCABQQFqIgFHDQALQRshAgyaAwtBGyECDJkDCwNAIAEtAABBsD9qLQAAIgBBA0cEQCAAQQFrDgUPEScTJicLIAQgAUEBaiIBRw0AC0EeIQIMmAMLIAEgBEcEQCADQQs2AgggAyABNgIEQQchAgz/AgtBHyECDJcDCyABIARGBEBBICECDJcDCwJAIAEtAABBDWsOFC4/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8APwtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQMlgMLIANBL2ohAgNAIAEgBEYEQEEhIQIMlwMLAkACQAJAIAEtAAAiAEEJaw4YAgApKQEpKSkpKSkpKSkpKSkpKSkpKSkCJwsgAUEBaiEBIANBL2otAABBAXFFDQoMGAsgAUEBaiEBDBcLIAFBAWohASACLQAAQQJxDQALQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDJUDCyADLQAuQYABcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUN5gIgAEEVRgRAIANBJDYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDJQDC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAyTAwtBACECIANBADYCHCADIAE2AhQgA0G+IDYCECADQQI2AgwMkgMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABIAynaiIBEDIiAEUNKyADQQc2AhwgAyABNgIUIAMgADYCDAyRAwsgAy0ALkHAAHFFDQELQQAhAAJAIAMoAjgiAkUNACACKAJYIgJFDQAgAyACEQAAIQALIABFDSsgAEEVRgRAIANBCjYCHCADIAE2AhQgA0HrGTYCECADQRU2AgxBACECDJADC0EAIQIgA0EANgIcIAMgATYCFCADQZMMNgIQIANBEzYCDAyPAwtBACECIANBADYCHCADIAE2AhQgA0GCFTYCECADQQI2AgwMjgMLQQAhAiADQQA2AhwgAyABNgIUIANB3RQ2AhAgA0EZNgIMDI0DC0EAIQIgA0EANgIcIAMgATYCFCADQeYdNgIQIANBGTYCDAyMAwsgAEEVRg09QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIsDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFDSggA0ENNgIcIAMgATYCFCADIAA2AgwMigMLIABBFUYNOkEAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAyJAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwoCyADQQ42AhwgAyAANgIMIAMgAUEBajYCFAyIAwsgAEEVRg03QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIcDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCcLIANBDzYCHCADIAA2AgwgAyABQQFqNgIUDIYDC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAyFAwsgAEEVRg0zQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIQDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFDSUgA0ERNgIcIAMgATYCFCADIAA2AgwMgwMLIABBFUYNMEEAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAyCAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwlCyADQRI2AhwgAyAANgIMIAMgAUEBajYCFAyBAwsgA0Evai0AAEEBcUUNAQtBFyECDOYCC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAz+AgsgAEE7Rw0AIAFBAWohAQwMC0EAIQIgA0EANgIcIAMgATYCFCADQZIYNgIQIANBAjYCDAz8AgsgAEEVRg0oQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDPsCCyADQRQ2AhwgAyABNgIUIAMgADYCDAz6AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQz1AgsgA0EVNgIcIAMgADYCDCADIAFBAWo2AhQM+QILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM8wILIANBFzYCHCADIAA2AgwgAyABQQFqNgIUDPgCCyAAQRVGDSNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM9wILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEMHQsgA0EZNgIcIAMgADYCDCADIAFBAWo2AhQM9gILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM7wILIANBGjYCHCADIAA2AgwgAyABQQFqNgIUDPUCCyAAQRVGDR9BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwM9AILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwbCyADQRw2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8wILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQzrAgsgA0EdNgIcIAMgADYCDCADIAFBAWo2AhRBACECDPICCyAAQTtHDQEgAUEBaiEBC0EmIQIM1wILQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDO8CCyABIARHBEADQCABLQAAQSBHDYQCIAQgAUEBaiIBRw0AC0EsIQIM7wILQSwhAgzuAgsgASAERgRAQTQhAgzuAgsCQAJAA0ACQCABLQAAQQprDgQCAAADAAsgBCABQQFqIgFHDQALQTQhAgzvAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDZ8CIANBMjYCHCADIAE2AhQgAyAANgIMQQAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDJ8CCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM7QILIAEgBEcEQAJAA0AgAS0AAEEwayIAQf8BcUEKTwRAQTohAgzXAgsgAykDICILQpmz5syZs+bMGVYNASADIAtCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAMgCiALfDcDICAEIAFBAWoiAUcNAAtBwAAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgAUEBaiIBEDEiAA0XDOICC0HAACECDOwCCyABIARGBEBByQAhAgzsAgsCQANAAkAgAS0AAEEJaw4YAAKiAqICqQKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogIAogILIAQgAUEBaiIBRw0AC0HJACECDOwCCyABQQFqIQEgA0Evai0AAEEBcQ2lAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgzrAgsgASAERwRAA0AgAS0AAEEgRw0VIAQgAUEBaiIBRw0AC0H4ACECDOsCC0H4ACECDOoCCyADQQI6ACgMOAtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQM6AILQQAhAgzOAgtBDSECDM0CC0ETIQIMzAILQRUhAgzLAgtBFiECDMoCC0EYIQIMyQILQRkhAgzIAgtBGiECDMcCC0EbIQIMxgILQRwhAgzFAgtBHSECDMQCC0EeIQIMwwILQR8hAgzCAgtBICECDMECC0EiIQIMwAILQSMhAgy/AgtBJSECDL4CC0HlACECDL0CCyADQT02AhwgAyABNgIUIAMgADYCDEEAIQIM1QILIANBGzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDNQCCyADQSA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzTAgsgA0ETNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0gILIANBCzYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNECCyADQRA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzQAgsgA0EgNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzwILIANBCzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM4CCyADQQw2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzNAgtBACECIANBADYCHCADIAE2AhQgA0HdDjYCECADQRI2AgwMzAILAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB/QEhAgzMAgsCQAJAIAMtADZBAUcNAEEAIQACQCADKAI4IgJFDQAgAigCYCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUcNASADQfwBNgIcIAMgATYCFCADQdwZNgIQIANBFTYCDEEAIQIMzQILQdwBIQIMswILIANBADYCHCADIAE2AhQgA0H5CzYCECADQR82AgxBACECDMsCCwJAAkAgAy0AKEEBaw4CBAEAC0HbASECDLICC0HUASECDLECCyADQQI6ADFBACEAAkAgAygCOCICRQ0AIAIoAgAiAkUNACADIAIRAAAhAAsgAEUEQEHdASECDLECCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQbQMNgIQIANBEDYCDEEAIQIMygILIANB+wE2AhwgAyABNgIUIANBgRo2AhAgA0EVNgIMQQAhAgzJAgsgASAERgRAQfoBIQIMyQILIAEtAABByABGDQEgA0EBOgAoC0HAASECDK4CC0HaASECDK0CCyABIARHBEAgA0EMNgIIIAMgATYCBEHZASECDK0CC0H5ASECDMUCCyABIARGBEBB+AEhAgzFAgsgAS0AAEHIAEcNBCABQQFqIQFB2AEhAgyrAgsgASAERgRAQfcBIQIMxAILAkACQCABLQAAQcUAaw4QAAUFBQUFBQUFBQUFBQUFAQULIAFBAWohAUHWASECDKsCCyABQQFqIQFB1wEhAgyqAgtB9gEhAiABIARGDcICIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbrVAGotAABHDQMgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMMCCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIARQRAQeMBIQIMqgILIANB9QE2AhwgAyABNgIUIAMgADYCDEEAIQIMwgILQfQBIQIgASAERg3BAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEG41QBqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzCAgsgA0GBBDsBKCADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIADQMMAgsgA0EANgIAC0EAIQIgA0EANgIcIAMgATYCFCADQeUfNgIQIANBCDYCDAy/AgtB1QEhAgylAgsgA0HzATYCHCADIAE2AhQgAyAANgIMQQAhAgy9AgtBACEAAkAgAygCOCICRQ0AIAIoAkAiAkUNACADIAIRAAAhAAsgAEUNbiAAQRVHBEAgA0EANgIcIAMgATYCFCADQYIPNgIQIANBIDYCDEEAIQIMvQILIANBjwE2AhwgAyABNgIUIANB7Bs2AhAgA0EVNgIMQQAhAgy8AgsgASAERwRAIANBDTYCCCADIAE2AgRB0wEhAgyjAgtB8gEhAgy7AgsgASAERgRAQfEBIQIMuwILAkACQAJAIAEtAABByABrDgsAAQgICAgICAgIAggLIAFBAWohAUHQASECDKMCCyABQQFqIQFB0QEhAgyiAgsgAUEBaiEBQdIBIQIMoQILQfABIQIgASAERg25AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBtdUAai0AAEcNBCAAQQJGDQMgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuQILQe8BIQIgASAERg24AiADKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABBs9UAai0AAEcNAyAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuAILQe4BIQIgASAERg23AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMtwILIAMoAgQhACADQgA3AwAgAyAAIAVBAWoiARArIgBFDQIgA0HsATYCHCADIAE2AhQgAyAANgIMQQAhAgy2AgsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNnAIgA0HtATYCHCADIAE2AhQgAyAANgIMQQAhAgy0AgtBzwEhAgyaAgtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDLQCC0HOASECDJoCCyADQesBNgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMsgILIAEgBEYEQEHrASECDLICCyABLQAAQS9GBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GyODYCECADQQg2AgxBACECDLECC0HNASECDJcCCyABIARHBEAgA0EONgIIIAMgATYCBEHMASECDJcCC0HqASECDK8CCyABIARGBEBB6QEhAgyvAgsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFBywEhAgyWAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZcCIANB6AE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAEgBEYEQEHnASECDK4CCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5gE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILQcoBIQIMlAILIAEgBEYEQEHlASECDK0CC0EAIQBBASEFQQEhB0EAIQICQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQCABLQAAQTBrDgoKCQABAgMEBQYICwtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshAkEAIQVBACEHDAILQQkhAkEBIQBBACEFQQAhBwwBC0EAIQVBASECCyADIAI6ACsgAUEBaiEBAkACQCADLQAuQRBxDQACQAJAAkAgAy0AKg4DAQACBAsgB0UNAwwCCyAADQEMAgsgBUUNAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDQIgA0HiATYCHCADIAE2AhQgAyAANgIMQQAhAgyvAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZoCIANB4wE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ2YAiADQeQBNgIcIAMgATYCFCADIAA2AgwMrQILQckBIQIMkwILQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgytAgtByAEhAgyTAgsgA0HhATYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDKsCCyABIARGBEBB4QEhAgyrAgsCQCABLQAAQSBGBEAgA0EAOwE0IAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBmRE2AhAgA0EJNgIMQQAhAgyrAgtBxwEhAgyRAgsgASAERgRAQeABIQIMqgILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyrAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqgILQcYBIQIMkAILIAEgBEYEQEHfASECDKkCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqgILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKkCC0HFASECDI8CCyABIARGBEBB3gEhAgyoAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKkCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyoAgtBxAEhAgyOAgsgASAERgRAQd0BIQIMpwILAkACQAJAAkAgAS0AAEEKaw4XAgMDAAMDAwMDAwMDAwMDAwMDAwMDAwEDCyABQQFqDAULIAFBAWohAUHDASECDI8CCyABQQFqIQEgA0Evai0AAEEBcQ0IIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKcCCyADQQA2AhwgAyABNgIUIANBjQs2AhAgA0ENNgIMQQAhAgymAgsgASAERwRAIANBDzYCCCADIAE2AgRBASECDI0CC0HcASECDKUCCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtB2wEhAgymAgsgAygCBCEAIANBADYCBCADIAAgARAtIgBFBEAgAUEBaiEBDAQLIANB2gE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMpQILIAMoAgQhACADQQA2AgQgAyAAIAEQLSIADQEgAUEBagshAUHBASECDIoCCyADQdkBNgIcIAMgADYCDCADIAFBAWo2AhRBACECDKICC0HCASECDIgCCyADQS9qLQAAQQFxDQEgA0EANgIcIAMgATYCFCADQeQcNgIQIANBGTYCDEEAIQIMoAILIAEgBEYEQEHZASECDKACCwJAAkACQCABLQAAQQprDgQBAgIAAgsgAUEBaiEBDAILIAFBAWohAQwBCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAjwiAkUNACADIAIRAAAhAAsgAEUNoAEgAEEVRgRAIANB2QA2AhwgAyABNgIUIANBtxo2AhAgA0EVNgIMQQAhAgyfAgsgA0EANgIcIAMgATYCFCADQYANNgIQIANBGzYCDEEAIQIMngILIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDJ0CCyABIARHBEAgA0EMNgIIIAMgATYCBEG/ASECDIQCC0HYASECDJwCCyABIARGBEBB1wEhAgycAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBwQBrDhUAAQIDWgQFBlpaWgcICQoLDA0ODxBaCyABQQFqIQFB+wAhAgySAgsgAUEBaiEBQfwAIQIMkQILIAFBAWohAUGBASECDJACCyABQQFqIQFBhQEhAgyPAgsgAUEBaiEBQYYBIQIMjgILIAFBAWohAUGJASECDI0CCyABQQFqIQFBigEhAgyMAgsgAUEBaiEBQY0BIQIMiwILIAFBAWohAUGWASECDIoCCyABQQFqIQFBlwEhAgyJAgsgAUEBaiEBQZgBIQIMiAILIAFBAWohAUGlASECDIcCCyABQQFqIQFBpgEhAgyGAgsgAUEBaiEBQawBIQIMhQILIAFBAWohAUG0ASECDIQCCyABQQFqIQFBtwEhAgyDAgsgAUEBaiEBQb4BIQIMggILIAEgBEYEQEHWASECDJsCCyABLQAAQc4ARw1IIAFBAWohAUG9ASECDIECCyABIARGBEBB1QEhAgyaAgsCQAJAAkAgAS0AAEHCAGsOEgBKSkpKSkpKSkoBSkpKSkpKAkoLIAFBAWohAUG4ASECDIICCyABQQFqIQFBuwEhAgyBAgsgAUEBaiEBQbwBIQIMgAILQdQBIQIgASAERg2YAiADKAIAIgAgBCABa2ohBSABIABrQQdqIQYCQANAIAEtAAAgAEGo1QBqLQAARw1FIABBB0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAgsgA0EANgIAIAZBAWohAUEbDEULIAEgBEYEQEHTASECDJgCCwJAAkAgAS0AAEHJAGsOBwBHR0dHRwFHCyABQQFqIQFBuQEhAgz/AQsgAUEBaiEBQboBIQIM/gELQdIBIQIgASAERg2WAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw1DIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyXAgsgA0EANgIAIAZBAWohAUEPDEMLQdEBIQIgASAERg2VAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw1CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyWAgsgA0EANgIAIAZBAWohAUEgDEILQdABIQIgASAERg2UAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw1BIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyVAgsgA0EANgIAIAZBAWohAUESDEELIAEgBEYEQEHPASECDJQCCwJAAkAgAS0AAEHFAGsODgBDQ0NDQ0NDQ0NDQ0MBQwsgAUEBaiEBQbUBIQIM+wELIAFBAWohAUG2ASECDPoBC0HOASECIAEgBEYNkgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBntUAai0AAEcNPyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkwILIANBADYCACAGQQFqIQFBBww/C0HNASECIAEgBEYNkQIgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBmNUAai0AAEcNPiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkgILIANBADYCACAGQQFqIQFBKAw+CyABIARGBEBBzAEhAgyRAgsCQAJAAkAgAS0AAEHFAGsOEQBBQUFBQUFBQUEBQUFBQUECQQsgAUEBaiEBQbEBIQIM+QELIAFBAWohAUGyASECDPgBCyABQQFqIQFBswEhAgz3AQtBywEhAiABIARGDY8CIAMoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQZHVAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJACCyADQQA2AgAgBkEBaiEBQRoMPAtBygEhAiABIARGDY4CIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQY3VAGotAABHDTsgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADI8CCyADQQA2AgAgBkEBaiEBQSEMOwsgASAERgRAQckBIQIMjgILAkACQCABLQAAQcEAaw4UAD09PT09PT09PT09PT09PT09PQE9CyABQQFqIQFBrQEhAgz1AQsgAUEBaiEBQbABIQIM9AELIAEgBEYEQEHIASECDI0CCwJAAkAgAS0AAEHVAGsOCwA8PDw8PDw8PDwBPAsgAUEBaiEBQa4BIQIM9AELIAFBAWohAUGvASECDPMBC0HHASECIAEgBEYNiwIgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNOCAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjAILIANBADYCACAGQQFqIQFBKgw4CyABIARGBEBBxgEhAgyLAgsgAS0AAEHQAEcNOCABQQFqIQFBJQw3C0HFASECIAEgBEYNiQIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBgdUAai0AAEcNNiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMigILIANBADYCACAGQQFqIQFBDgw2CyABIARGBEBBxAEhAgyJAgsgAS0AAEHFAEcNNiABQQFqIQFBqwEhAgzvAQsgASAERgRAQcMBIQIMiAILAkACQAJAAkAgAS0AAEHCAGsODwABAjk5OTk5OTk5OTk5AzkLIAFBAWohAUGnASECDPEBCyABQQFqIQFBqAEhAgzwAQsgAUEBaiEBQakBIQIM7wELIAFBAWohAUGqASECDO4BC0HCASECIAEgBEYNhgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB/tQAai0AAEcNMyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhwILIANBADYCACAGQQFqIQFBFAwzC0HBASECIAEgBEYNhQIgAygCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABB+dQAai0AAEcNMiAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhgILIANBADYCACAGQQFqIQFBKwwyC0HAASECIAEgBEYNhAIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB9tQAai0AAEcNMSAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhQILIANBADYCACAGQQFqIQFBLAwxC0G/ASECIAEgBEYNgwIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNMCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhAILIANBADYCACAGQQFqIQFBEQwwC0G+ASECIAEgBEYNggIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB8tQAai0AAEcNLyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgwILIANBADYCACAGQQFqIQFBLgwvCyABIARGBEBBvQEhAgyCAgsCQAJAAkACQAJAIAEtAABBwQBrDhUANDQ0NDQ0NDQ0NAE0NAI0NAM0NAQ0CyABQQFqIQFBmwEhAgzsAQsgAUEBaiEBQZwBIQIM6wELIAFBAWohAUGdASECDOoBCyABQQFqIQFBogEhAgzpAQsgAUEBaiEBQaQBIQIM6AELIAEgBEYEQEG8ASECDIECCwJAAkAgAS0AAEHSAGsOAwAwATALIAFBAWohAUGjASECDOgBCyABQQFqIQFBBAwtC0G7ASECIAEgBEYN/wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8NQAai0AAEcNLCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgAILIANBADYCACAGQQFqIQFBHQwsCyABIARGBEBBugEhAgz/AQsCQAJAIAEtAABByQBrDgcBLi4uLi4ALgsgAUEBaiEBQaEBIQIM5gELIAFBAWohAUEiDCsLIAEgBEYEQEG5ASECDP4BCyABLQAAQdAARw0rIAFBAWohAUGgASECDOQBCyABIARGBEBBuAEhAgz9AQsCQAJAIAEtAABBxgBrDgsALCwsLCwsLCwsASwLIAFBAWohAUGeASECDOQBCyABQQFqIQFBnwEhAgzjAQtBtwEhAiABIARGDfsBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQezUAGotAABHDSggAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPwBCyADQQA2AgAgBkEBaiEBQQ0MKAtBtgEhAiABIARGDfoBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDScgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPsBCyADQQA2AgAgBkEBaiEBQQwMJwtBtQEhAiABIARGDfkBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQerUAGotAABHDSYgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPoBCyADQQA2AgAgBkEBaiEBQQMMJgtBtAEhAiABIARGDfgBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQejUAGotAABHDSUgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPkBCyADQQA2AgAgBkEBaiEBQSYMJQsgASAERgRAQbMBIQIM+AELAkACQCABLQAAQdQAaw4CAAEnCyABQQFqIQFBmQEhAgzfAQsgAUEBaiEBQZoBIQIM3gELQbIBIQIgASAERg32ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHm1ABqLQAARw0jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz3AQsgA0EANgIAIAZBAWohAUEnDCMLQbEBIQIgASAERg31ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHk1ABqLQAARw0iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz2AQsgA0EANgIAIAZBAWohAUEcDCILQbABIQIgASAERg30ASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHe1ABqLQAARw0hIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz1AQsgA0EANgIAIAZBAWohAUEGDCELQa8BIQIgASAERg3zASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHZ1ABqLQAARw0gIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz0AQsgA0EANgIAIAZBAWohAUEZDCALIAEgBEYEQEGuASECDPMBCwJAAkACQAJAIAEtAABBLWsOIwAkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJAEkJCQkJAIkJCQDJAsgAUEBaiEBQY4BIQIM3AELIAFBAWohAUGPASECDNsBCyABQQFqIQFBlAEhAgzaAQsgAUEBaiEBQZUBIQIM2QELQa0BIQIgASAERg3xASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHX1ABqLQAARw0eIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzyAQsgA0EANgIAIAZBAWohAUELDB4LIAEgBEYEQEGsASECDPEBCwJAAkAgAS0AAEHBAGsOAwAgASALIAFBAWohAUGQASECDNgBCyABQQFqIQFBkwEhAgzXAQsgASAERgRAQasBIQIM8AELAkACQCABLQAAQcEAaw4PAB8fHx8fHx8fHx8fHx8BHwsgAUEBaiEBQZEBIQIM1wELIAFBAWohAUGSASECDNYBCyABIARGBEBBqgEhAgzvAQsgAS0AAEHMAEcNHCABQQFqIQFBCgwbC0GpASECIAEgBEYN7QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABB0dQAai0AAEcNGiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7gELIANBADYCACAGQQFqIQFBHgwaC0GoASECIAEgBEYN7AEgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBytQAai0AAEcNGSAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7QELIANBADYCACAGQQFqIQFBFQwZC0GnASECIAEgBEYN6wEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBx9QAai0AAEcNGCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7AELIANBADYCACAGQQFqIQFBFwwYC0GmASECIAEgBEYN6gEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBwdQAai0AAEcNFyAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6wELIANBADYCACAGQQFqIQFBGAwXCyABIARGBEBBpQEhAgzqAQsCQAJAIAEtAABByQBrDgcAGRkZGRkBGQsgAUEBaiEBQYsBIQIM0QELIAFBAWohAUGMASECDNABC0GkASECIAEgBEYN6AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBptUAai0AAEcNFSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6QELIANBADYCACAGQQFqIQFBCQwVC0GjASECIAEgBEYN5wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBpNUAai0AAEcNFCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6AELIANBADYCACAGQQFqIQFBHwwUC0GiASECIAEgBEYN5gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBvtQAai0AAEcNEyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5wELIANBADYCACAGQQFqIQFBAgwTC0GhASECIAEgBEYN5QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGA0AgAS0AACAAQbzUAGotAABHDREgAEEBRg0CIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADOUBCyABIARGBEBBoAEhAgzlAQtBASABLQAAQd8ARw0RGiABQQFqIQFBhwEhAgzLAQsgA0EANgIAIAZBAWohAUGIASECDMoBC0GfASECIAEgBEYN4gEgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNDyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4wELIANBADYCACAGQQFqIQFBKQwPC0GeASECIAEgBEYN4QEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBuNQAai0AAEcNDiAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4gELIANBADYCACAGQQFqIQFBLQwOCyABIARGBEBBnQEhAgzhAQsgAS0AAEHFAEcNDiABQQFqIQFBhAEhAgzHAQsgASAERgRAQZwBIQIM4AELAkACQCABLQAAQcwAaw4IAA8PDw8PDwEPCyABQQFqIQFBggEhAgzHAQsgAUEBaiEBQYMBIQIMxgELQZsBIQIgASAERg3eASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEGz1ABqLQAARw0LIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzfAQsgA0EANgIAIAZBAWohAUEjDAsLQZoBIQIgASAERg3dASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGw1ABqLQAARw0KIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzeAQsgA0EANgIAIAZBAWohAUEADAoLIAEgBEYEQEGZASECDN0BCwJAAkAgAS0AAEHIAGsOCAAMDAwMDAwBDAsgAUEBaiEBQf0AIQIMxAELIAFBAWohAUGAASECDMMBCyABIARGBEBBmAEhAgzcAQsCQAJAIAEtAABBzgBrDgMACwELCyABQQFqIQFB/gAhAgzDAQsgAUEBaiEBQf8AIQIMwgELIAEgBEYEQEGXASECDNsBCyABLQAAQdkARw0IIAFBAWohAUEIDAcLQZYBIQIgASAERg3ZASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEGs1ABqLQAARw0GIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzaAQsgA0EANgIAIAZBAWohAUEFDAYLQZUBIQIgASAERg3YASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGm1ABqLQAARw0FIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzZAQsgA0EANgIAIAZBAWohAUEWDAULQZQBIQIgASAERg3XASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0EIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzYAQsgA0EANgIAIAZBAWohAUEQDAQLIAEgBEYEQEGTASECDNcBCwJAAkAgAS0AAEHDAGsODAAGBgYGBgYGBgYGAQYLIAFBAWohAUH5ACECDL4BCyABQQFqIQFB+gAhAgy9AQtBkgEhAiABIARGDdUBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQaDUAGotAABHDQIgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNYBCyADQQA2AgAgBkEBaiEBQSQMAgsgA0EANgIADAILIAEgBEYEQEGRASECDNQBCyABLQAAQcwARw0BIAFBAWohAUETCzoAKSADKAIEIQAgA0EANgIEIAMgACABEC4iAA0CDAELQQAhAiADQQA2AhwgAyABNgIUIANB/h82AhAgA0EGNgIMDNEBC0H4ACECDLcBCyADQZABNgIcIAMgATYCFCADIAA2AgxBACECDM8BC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUYNASADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgzOAQtB9wAhAgy0AQsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDMwBCyABIARGBEBBjwEhAgzMAQsCQCABLQAAQSBGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GbHzYCECADQQY2AgxBACECDMwBC0ECIQIMsgELA0AgAS0AAEEgRw0CIAQgAUEBaiIBRw0AC0GOASECDMoBCyABIARGBEBBjQEhAgzKAQsCQCABLQAAQQlrDgRKAABKAAtB9QAhAgywAQsgAy0AKUEFRgRAQfYAIQIMsAELQfQAIQIMrwELIAEgBEYEQEGMASECDMgBCyADQRA2AgggAyABNgIEDAoLIAEgBEYEQEGLASECDMcBCwJAIAEtAABBCWsOBEcAAEcAC0HzACECDK0BCyABIARHBEAgA0EQNgIIIAMgATYCBEHxACECDK0BC0GKASECDMUBCwJAIAEgBEcEQANAIAEtAABBoNAAai0AACIAQQNHBEACQCAAQQFrDgJJAAQLQfAAIQIMrwELIAQgAUEBaiIBRw0AC0GIASECDMYBC0GIASECDMUBCyADQQA2AhwgAyABNgIUIANB2yA2AhAgA0EHNgIMQQAhAgzEAQsgASAERgRAQYkBIQIMxAELAkACQAJAIAEtAABBoNIAai0AAEEBaw4DRgIAAQtB8gAhAgysAQsgA0EANgIcIAMgATYCFCADQbQSNgIQIANBBzYCDEEAIQIMxAELQeoAIQIMqgELIAEgBEcEQCABQQFqIQFB7wAhAgyqAQtBhwEhAgzCAQsgBCABIgBGBEBBhgEhAgzCAQsgAC0AACIBQS9GBEAgAEEBaiEBQe4AIQIMqQELIAFBCWsiAkEXSw0BIAAhAUEBIAJ0QZuAgARxDUEMAQsgBCABIgBGBEBBhQEhAgzBAQsgAC0AAEEvRw0AIABBAWohAQwDC0EAIQIgA0EANgIcIAMgADYCFCADQdsgNgIQIANBBzYCDAy/AQsCQAJAAkACQAJAA0AgAS0AAEGgzgBqLQAAIgBBBUcEQAJAAkAgAEEBaw4IRwUGBwgABAEIC0HrACECDK0BCyABQQFqIQFB7QAhAgysAQsgBCABQQFqIgFHDQALQYQBIQIMwwELIAFBAWoMFAsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgzBAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgzAAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy/AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMvgELIAEgBEYEQEGDASECDL4BCwJAIAEtAABBoM4Aai0AAEEBaw4IPgQFBgAIAgMHCyABQQFqIQELQQMhAgyjAQsgAUEBagwNC0EAIQIgA0EANgIcIANB0RI2AhAgA0EHNgIMIAMgAUEBajYCFAy6AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgy5AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgy4AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy3AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMtgELQewAIQIMnAELIAEgBEYEQEGCASECDLUBCyABQQFqDAILIAEgBEYEQEGBASECDLQBCyABQQFqDAELIAEgBEYNASABQQFqCyEBQQQhAgyYAQtBgAEhAgywAQsDQCABLQAAQaDMAGotAAAiAEECRwRAIABBAUcEQEHpACECDJkBCwwxCyAEIAFBAWoiAUcNAAtB/wAhAgyvAQsgASAERgRAQf4AIQIMrwELAkAgAS0AAEEJaw43LwMGLwQGBgYGBgYGBgYGBgYGBgYGBgYFBgYCBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGAAYLIAFBAWoLIQFBBSECDJQBCyABQQFqDAYLIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIANBADYCHCADIAE2AhQgA0GNFDYCECADQQc2AgxBACECDKgBCwJAAkACQAJAA0AgAS0AAEGgygBqLQAAIgBBBUcEQAJAIABBAWsOBi4DBAUGAAYLQegAIQIMlAELIAQgAUEBaiIBRw0AC0H9ACECDKsBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQdsANgIcIAMgATYCFCADIAA2AgxBACECDKoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDKkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQfoANgIcIAMgATYCFCADIAA2AgxBACECDKgBCyADQQA2AhwgAyABNgIUIANB5Ag2AhAgA0EHNgIMQQAhAgynAQsgASAERg0BIAFBAWoLIQFBBiECDIwBC0H8ACECDKQBCwJAAkACQAJAA0AgAS0AAEGgyABqLQAAIgBBBUcEQCAAQQFrDgQpAgMEBQsgBCABQQFqIgFHDQALQfsAIQIMpwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMpgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMpQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMpAELIANBADYCHCADIAE2AhQgA0G8CjYCECADQQc2AgxBACECDKMBC0HPACECDIkBC0HRACECDIgBC0HnACECDIcBCyABIARGBEBB+gAhAgygAQsCQCABLQAAQQlrDgQgAAAgAAsgAUEBaiEBQeYAIQIMhgELIAEgBEYEQEH5ACECDJ8BCwJAIAEtAABBCWsOBB8AAB8AC0EAIQACQCADKAI4IgJFDQAgAigCOCICRQ0AIAMgAhEAACEACyAARQRAQeIBIQIMhgELIABBFUcEQCADQQA2AhwgAyABNgIUIANByQ02AhAgA0EaNgIMQQAhAgyfAQsgA0H4ADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDJ4BCyABIARHBEAgA0ENNgIIIAMgATYCBEHkACECDIUBC0H3ACECDJ0BCyABIARGBEBB9gAhAgydAQsCQAJAAkAgAS0AAEHIAGsOCwABCwsLCwsLCwsCCwsgAUEBaiEBQd0AIQIMhQELIAFBAWohAUHgACECDIQBCyABQQFqIQFB4wAhAgyDAQtB9QAhAiABIARGDZsBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbXVAGotAABHDQggAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJwBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIABEAgA0H0ADYCHCADIAE2AhQgAyAANgIMQQAhAgycAQtB4gAhAgyCAQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJwBC0HhACECDIIBCyADQfMANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMmgELIAMtACkiAEEja0ELSQ0JAkAgAEEGSw0AQQEgAHRBygBxRQ0ADAoLQQAhAiADQQA2AhwgAyABNgIUIANB7Qk2AhAgA0EINgIMDJkBC0HyACECIAEgBEYNmAEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBs9UAai0AAEcNBSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMmQELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfEANgIcIAMgATYCFCADIAA2AgxBACECDJkBC0HfACECDH8LQQAhAAJAIAMoAjgiAkUNACACKAI0IgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANB6g02AhAgA0EmNgIMQQAhAgyZAQtB3gAhAgx/CyADQfAANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMlwELIAMtAClBIUYNBiADQQA2AhwgAyABNgIUIANBkQo2AhAgA0EINgIMQQAhAgyWAQtB7wAhAiABIARGDZUBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDVAGotAABHDQIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIARQ0CIANB7QA2AhwgAyABNgIUIAMgADYCDEEAIQIMlQELIANBADYCAAsgAygCBCEAIANBADYCBCADIAAgARArIgBFDYABIANB7gA2AhwgAyABNgIUIAMgADYCDEEAIQIMkwELQdwAIQIMeQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJMBC0HbACECDHkLIANB7AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyRAQsgAy0AKSIAQSNJDQAgAEEuRg0AIANBADYCHCADIAE2AhQgA0HJCTYCECADQQg2AgxBACECDJABC0HaACECDHYLIAEgBEYEQEHrACECDI8BCwJAIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMjwELQdkAIQIMdQsgASAERwRAIANBDjYCCCADIAE2AgRB2AAhAgx1C0HqACECDI0BCyABIARGBEBB6QAhAgyNAQsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFB1wAhAgx0CyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeiADQegANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyABIARGBEBB5wAhAgyMAQsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELQdYAIQIMcgsgASAERgRAQeUAIQIMiwELQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIANgIcIAMgATYCFCADIAA2AgxBACECDI0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNfSADQeMANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeyADQeQANgIcIAMgATYCFCADIAA2AgwMiwELQdQAIQIMcQsgAy0AKUEiRg2GAUHTACECDHALQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALIABFBEBB1QAhAgxwCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQaQNNgIQIANBITYCDEEAIQIMiQELIANB4QA2AhwgAyABNgIUIANB0Bo2AhAgA0EVNgIMQQAhAgyIAQsgASAERgRAQeAAIQIMiAELAkACQAJAAkACQCABLQAAQQprDgQBBAQABAsgAUEBaiEBDAELIAFBAWohASADQS9qLQAAQQFxRQ0BC0HSACECDHALIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIgBCyADQQA2AhwgAyABNgIUIANBthE2AhAgA0EJNgIMQQAhAgyHAQsgASAERgRAQd8AIQIMhwELIAEtAABBCkYEQCABQQFqIQEMCQsgAy0ALkHAAHENCCADQQA2AhwgAyABNgIUIANBthE2AhAgA0ECNgIMQQAhAgyGAQsgASAERgRAQd0AIQIMhgELIAEtAAAiAkENRgRAIAFBAWohAUHQACECDG0LIAEhACACQQlrDgQFAQEFAQsgBCABIgBGBEBB3AAhAgyFAQsgAC0AAEEKRw0AIABBAWoMAgtBACECIANBADYCHCADIAA2AhQgA0HKLTYCECADQQc2AgwMgwELIAEgBEYEQEHbACECDIMBCwJAIAEtAABBCWsOBAMAAAMACyABQQFqCyEBQc4AIQIMaAsgASAERgRAQdoAIQIMgQELIAEtAABBCWsOBAABAQABC0EAIQIgA0EANgIcIANBmhI2AhAgA0EHNgIMIAMgAUEBajYCFAx/CyADQYASOwEqQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2QA2AhwgAyABNgIUIANB6ho2AhAgA0EVNgIMQQAhAgx+C0HNACECDGQLIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDHwLIAEgBEYEQEHZACECDHwLIAEtAABBIEcNPSABQQFqIQEgAy0ALkEBcQ09IANBADYCHCADIAE2AhQgA0HCHDYCECADQR42AgxBACECDHsLIAEgBEYEQEHYACECDHsLAkACQAJAAkACQCABLQAAIgBBCmsOBAIDAwABCyABQQFqIQFBLCECDGULIABBOkcNASADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgx9CyABQQFqIQEgA0Evai0AAEEBcUUNcyADLQAyQYABcUUEQCADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALAkACQCAADhZNTEsBAQEBAQEBAQEBAQEBAQEBAQEAAQsgA0EpNgIcIAMgATYCFCADQawZNgIQIANBFTYCDEEAIQIMfgsgA0EANgIcIAMgATYCFCADQeULNgIQIANBETYCDEEAIQIMfQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUNWSAAQRVHDQEgA0EFNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMfAtBywAhAgxiC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAx6CyADIAMvATJBgAFyOwEyDDsLIAEgBEcEQCADQRE2AgggAyABNgIEQcoAIQIMYAtB1wAhAgx4CyABIARGBEBB1gAhAgx4CwJAAkACQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQeMAaw4TAEBAQEBAQEBAQEBAQAFAQEACA0ALIAFBAWohAUHGACECDGELIAFBAWohAUHHACECDGALIAFBAWohAUHIACECDF8LIAFBAWohAUHJACECDF4LQdUAIQIgBCABIgBGDXYgBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0IQQQgAUEFRg0KGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx2C0HUACECIAQgASIARg11IAQgAWsgAygCACIBaiEGIAAgAWtBD2ohBwNAIAFBgMgAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNB0EDIAFBD0YNCRogAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdQtB0wAhAiAEIAEiAEYNdCAEIAFrIAMoAgAiAWohBiAAIAFrQQ5qIQcDQCABQeLHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQYgAUEORg0HIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHQLQdIAIQIgBCABIgBGDXMgBCABayADKAIAIgFqIQUgACABa0EBaiEGA0AgAUHgxwBqLQAAIAAtAAAiB0EgciAHIAdBwQBrQf8BcUEaSRtB/wFxRw0FIAFBAUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBTYCAAxzCyABIARGBEBB0QAhAgxzCwJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB7gBrDgcAOTk5OTkBOQsgAUEBaiEBQcMAIQIMWgsgAUEBaiEBQcQAIQIMWQsgA0EANgIAIAZBAWohAUHFACECDFgLQdAAIQIgBCABIgBGDXAgBCABayADKAIAIgFqIQYgACABa0EJaiEHA0AgAUHWxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0CQQIgAUEJRg0EGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxwC0HPACECIAQgASIARg1vIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwNAIAFB0McAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQVGDQIgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMbwsgACEBIANBADYCAAwzC0EBCzoALCADQQA2AgAgB0EBaiEBC0EtIQIMUgsCQANAIAEtAABB0MUAai0AAEEBRw0BIAQgAUEBaiIBRw0AC0HNACECDGsLQcIAIQIMUQsgASAERgRAQcwAIQIMagsgAS0AAEE6RgRAIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0zIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMagsgA0EANgIcIAMgATYCFCADQecRNgIQIANBCjYCDEEAIQIMaQsCQAJAIAMtACxBAmsOAgABJwsgA0Ezai0AAEECcUUNJiADLQAuQQJxDSYgA0EANgIcIAMgATYCFCADQaYUNgIQIANBCzYCDEEAIQIMaQsgAy0AMkEgcUUNJSADLQAuQQJxDSUgA0EANgIcIAMgATYCFCADQb0TNgIQIANBDzYCDEEAIQIMaAtBACEAAkAgAygCOCICRQ0AIAIoAkgiAkUNACADIAIRAAAhAAsgAEUEQEHBACECDE8LIABBFUcEQCADQQA2AhwgAyABNgIUIANBpg82AhAgA0EcNgIMQQAhAgxoCyADQcoANgIcIAMgATYCFCADQYUcNgIQIANBFTYCDEEAIQIMZwsgASAERwRAA0AgAS0AAEHAwQBqLQAAQQFHDRcgBCABQQFqIgFHDQALQcQAIQIMZwtBxAAhAgxmCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUE2IQIMUgsgAUEBaiEBQTchAgxRCyABQQFqIQFBOCECDFALDBULIAQgAUEBaiIBRw0AC0E8IQIMZgtBPCECDGULIAEgBEYEQEHIACECDGULIANBEjYCCCADIAE2AgQCQAJAAkACQAJAIAMtACxBAWsOBBQAAQIJCyADLQAyQSBxDQNB4AEhAgxPCwJAIAMvATIiAEEIcUUNACADLQAoQQFHDQAgAy0ALkEIcUUNAgsgAyAAQff7A3FBgARyOwEyDAsLIAMgAy8BMkEQcjsBMgwECyADQQA2AgQgAyABIAEQMSIABEAgA0HBADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxmCyABQQFqIQEMWAsgA0EANgIcIAMgATYCFCADQfQTNgIQIANBBDYCDEEAIQIMZAtBxwAhAiABIARGDWMgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCAAQcDFAGotAAAgAS0AAEEgckcNASAAQQZGDUogAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMZAsgA0EANgIADAULAkAgASAERwRAA0AgAS0AAEHAwwBqLQAAIgBBAUcEQCAAQQJHDQMgAUEBaiEBDAULIAQgAUEBaiIBRw0AC0HFACECDGQLQcUAIQIMYwsLIANBADoALAwBC0ELIQIMRwtBPyECDEYLAkACQANAIAEtAAAiAEEgRwRAAkAgAEEKaw4EAwUFAwALIABBLEYNAwwECyAEIAFBAWoiAUcNAAtBxgAhAgxgCyADQQg6ACwMDgsgAy0AKEEBRw0CIAMtAC5BCHENAiADKAIEIQAgA0EANgIEIAMgACABEDEiAARAIANBwgA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMXwsgAUEBaiEBDFALQTshAgxECwJAA0AgAS0AACIAQSBHIABBCUdxDQEgBCABQQFqIgFHDQALQcMAIQIMXQsLQTwhAgxCCwJAAkAgASAERwRAA0AgAS0AACIAQSBHBEAgAEEKaw4EAwQEAwQLIAQgAUEBaiIBRw0AC0E/IQIMXQtBPyECDFwLIAMgAy8BMkEgcjsBMgwKCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNTiADQT42AhwgAyABNgIUIAMgADYCDEEAIQIMWgsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkYNAwwMCyAEIAFBAWoiAUcNAAtBNyECDFsLQTchAgxaCyABQQFqIQEMBAtBOyECIAQgASIARg1YIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwJAA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEMPwsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMWQsgA0EANgIAIAAhAQwFC0E6IQIgBCABIgBGDVcgBCABayADKAIAIgFqIQYgACABa0EIaiEHAkADQCABQbTBAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEIRgRAQQUhAQw+CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxYCyADQQA2AgAgACEBDAQLQTkhAiAEIAEiAEYNViAEIAFrIAMoAgAiAWohBiAAIAFrQQNqIQcCQANAIAFBsMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQNGBEBBBiEBDD0LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFcLIANBADYCACAAIQEMAwsCQANAIAEtAAAiAEEgRwRAIABBCmsOBAcEBAcCCyAEIAFBAWoiAUcNAAtBOCECDFYLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCADLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIANBAToALCADIAMvATIgAXI7ATIgACEBDAELIAMgAy8BMkEIcjsBMiAAIQELQT4hAgw7CyADQQA6ACwLQTkhAgw5CyABIARGBEBBNiECDFILAkACQAJAAkACQCABLQAAQQprDgQAAgIBAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDQIgA0EzNgIcIAMgATYCFCADIAA2AgxBACECDFULIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQRAIAFBAWohAQwGCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMVAsgAy0ALkEBcQRAQd8BIQIMOwsgAygCBCEAIANBADYCBCADIAAgARAxIgANAQxJC0E0IQIMOQsgA0E1NgIcIAMgATYCFCADIAA2AgxBACECDFELQTUhAgw3CyADQS9qLQAAQQFxDQAgA0EANgIcIAMgATYCFCADQesWNgIQIANBGTYCDEEAIQIMTwtBMyECDDULIAEgBEYEQEEyIQIMTgsCQCABLQAAQQpGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GSFzYCECADQQM2AgxBACECDE4LQTIhAgw0CyABIARGBEBBMSECDE0LAkAgAS0AACIAQQlGDQAgAEEgRg0AQQEhAgJAIAMtACxBBWsOBAYEBQANCyADIAMvATJBCHI7ATIMDAsgAy0ALkEBcUUNASADLQAsQQhHDQAgA0EAOgAsC0E9IQIMMgsgA0EANgIcIAMgATYCFCADQcIWNgIQIANBCjYCDEEAIQIMSgtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgwGCyABIARGBEBBMCECDEcLIAEtAABBCkYEQCABQQFqIQEMAQsgAy0ALkEBcQ0AIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDEYLQTAhAgwsCyABQQFqIQFBMSECDCsLIAEgBEYEQEEvIQIMRAsgAS0AACIAQQlHIABBIEdxRQRAIAFBAWohASADLQAuQQFxDQEgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDEEAIQIMRAtBASECAkACQAJAAkACQAJAIAMtACxBAmsOBwUEBAMBAgAECyADIAMvATJBCHI7ATIMAwtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgtBLyECDCsLIANBADYCHCADIAE2AhQgA0GEEzYCECADQQs2AgxBACECDEMLQeEBIQIMKQsgASAERgRAQS4hAgxCCyADQQA2AgQgA0ESNgIIIAMgASABEDEiAA0BC0EuIQIMJwsgA0EtNgIcIAMgATYCFCADIAA2AgxBACECDD8LQQAhAAJAIAMoAjgiAkUNACACKAJMIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2AA2AhwgAyABNgIUIANBsxs2AhAgA0EVNgIMQQAhAgw+C0HMACECDCQLIANBADYCHCADIAE2AhQgA0GzDjYCECADQR02AgxBACECDDwLIAEgBEYEQEHOACECDDwLIAEtAAAiAEEgRg0CIABBOkYNAQsgA0EAOgAsQQkhAgwhCyADKAIEIQAgA0EANgIEIAMgACABEDAiAA0BDAILIAMtAC5BAXEEQEHeASECDCALIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0CIANBKjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgw4CyADQcsANgIcIAMgADYCDCADIAFBAWo2AhRBACECDDcLIAFBAWohAUHAACECDB0LIAFBAWohAQwsCyABIARGBEBBKyECDDULAkAgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQcAAcUUNBgsgAy0AMkGAAXEEQEEAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ0SIABBFUYEQCADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgw2CyADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMQQAhAgw1CyADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyADQQE6ADALIAIgAi8BAEHAAHI7AQALQSshAgwYCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgwwCyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgwvCyADQQA2AhwgAyABNgIUIANBpQs2AhAgA0ECNgIMQQAhAgwuC0EBIQcgAy8BMiIFQQhxRQRAIAMpAyBCAFIhBwsCQCADLQAwBEBBASEAIAMtAClBBUYNASAFQcAAcUUgB3FFDQELAkAgAy0AKCICQQJGBEBBASEAIAMvATQiBkHlAEYNAkEAIQAgBUHAAHENAiAGQeQARg0CIAZB5gBrQQJJDQIgBkHMAUYNAiAGQbACRg0CDAELQQAhACAFQcAAcQ0BC0ECIQAgBUEIcQ0AIAVBgARxBEACQCACQQFHDQAgAy0ALkEKcQ0AQQUhAAwCC0EEIQAMAQsgBUEgcUUEQCADEDZBAEdBAnQhAAwBC0EAQQMgAykDIFAbIQALIABBAWsOBQIABwEDBAtBESECDBMLIANBAToAMQwpC0EAIQICQCADKAI4IgBFDQAgACgCMCIARQ0AIAMgABEAACECCyACRQ0mIAJBFUYEQCADQQM2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwrC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAwqCyADQQA2AhwgAyABNgIUIANB+SA2AhAgA0EPNgIMQQAhAgwpC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAADQELQQ4hAgwOCyAAQRVGBEAgA0ECNgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMJwsgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDEEAIQIMJgtBKiECDAwLIAEgBEcEQCADQQk2AgggAyABNgIEQSkhAgwMC0EmIQIMJAsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFQEQEElIQIMJAsgAygCBCEAIANBADYCBCADIAAgASAMp2oiARAyIgBFDQAgA0EFNgIcIAMgATYCFCADIAA2AgxBACECDCMLQQ8hAgwJC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FxYAAQIDBAUGBxQUFBQUFBQICQoLDA0UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFA4PEBESExQLQgIhCgwWC0IDIQoMFQtCBCEKDBQLQgUhCgwTC0IGIQoMEgtCByEKDBELQgghCgwQC0IJIQoMDwtCCiEKDA4LQgshCgwNC0IMIQoMDAtCDSEKDAsLQg4hCgwKC0IPIQoMCQtCCiEKDAgLQgshCgwHC0IMIQoMBgtCDSEKDAULQg4hCgwEC0IPIQoMAwsgA0EANgIcIAMgATYCFCADQZ8VNgIQIANBDDYCDEEAIQIMIQsgASAERgRAQSIhAgwhC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsONxUUAAECAwQFBgcWFhYWFhYWCAkKCwwNFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYODxAREhMWC0ICIQoMFAtCAyEKDBMLQgQhCgwSC0IFIQoMEQtCBiEKDBALQgchCgwPC0IIIQoMDgtCCSEKDA0LQgohCgwMC0ILIQoMCwtCDCEKDAoLQg0hCgwJC0IOIQoMCAtCDyEKDAcLQgohCgwGC0ILIQoMBQtCDCEKDAQLQg0hCgwDC0IOIQoMAgtCDyEKDAELQgEhCgsgAUEBaiEBIAMpAyAiC0L//////////w9YBEAgAyALQgSGIAqENwMgDAILIANBADYCHCADIAE2AhQgA0G1CTYCECADQQw2AgxBACECDB4LQSchAgwEC0EoIQIMAwsgAyABOgAsIANBADYCACAHQQFqIQFBDCECDAILIANBADYCACAGQQFqIQFBCiECDAELIAFBAWohAUEIIQIMAAsAC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwXC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwWC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwVC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwUC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwTC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwSC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwRC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwQC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwPC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwOC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwNC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwMC0EAIQIgA0EANgIcIAMgATYCFCADQZkTNgIQIANBCzYCDAwLC0EAIQIgA0EANgIcIAMgATYCFCADQZ0JNgIQIANBCzYCDAwKC0EAIQIgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDAwJC0EAIQIgA0EANgIcIAMgATYCFCADQbEQNgIQIANBCjYCDAwIC0EAIQIgA0EANgIcIAMgATYCFCADQbsdNgIQIANBAjYCDAwHC0EAIQIgA0EANgIcIAMgATYCFCADQZYWNgIQIANBAjYCDAwGC0EAIQIgA0EANgIcIAMgATYCFCADQfkYNgIQIANBAjYCDAwFC0EAIQIgA0EANgIcIAMgATYCFCADQcQYNgIQIANBAjYCDAwECyADQQI2AhwgAyABNgIUIANBqR42AhAgA0EWNgIMQQAhAgwDC0HeACECIAEgBEYNAiAJQQhqIQcgAygCACEFAkACQCABIARHBEAgBUGWyABqIQggBCAFaiABayEGIAVBf3NBCmoiBSABaiEAA0AgAS0AACAILQAARwRAQQIhCAwDCyAFRQRAQQAhCCAAIQEMAwsgBUEBayEFIAhBAWohCCAEIAFBAWoiAUcNAAsgBiEFIAQhAQsgB0EBNgIAIAMgBTYCAAwBCyADQQA2AgAgByAINgIACyAHIAE2AgQgCSgCDCEAAkACQCAJKAIIQQFrDgIEAQALIANBADYCHCADQcIeNgIQIANBFzYCDCADIABBAWo2AhRBACECDAMLIANBADYCHCADIAA2AhQgA0HXHjYCECADQQk2AgxBACECDAILIAEgBEYEQEEoIQIMAgsgA0EJNgIIIAMgATYCBEEnIQIMAQsgASAERgRAQQEhAgwBCwNAAkACQAJAIAEtAABBCmsOBAABAQABCyABQQFqIQEMAQsgAUEBaiEBIAMtAC5BIHENAEEAIQIgA0EANgIcIAMgATYCFCADQaEhNgIQIANBBTYCDAwCC0EBIQIgASAERw0ACwsgCUEQaiQAIAJFBEAgAygCDCEADAELIAMgAjYCHEEAIQAgAygCBCIBRQ0AIAMgASAEIAMoAggRAQAiAUUNACADIAQ2AhQgAyABNgIMIAEhAAsgAAu+AgECfyAAQQA6AAAgAEHkAGoiAUEBa0EAOgAAIABBADoAAiAAQQA6AAEgAUEDa0EAOgAAIAFBAmtBADoAACAAQQA6AAMgAUEEa0EAOgAAQQAgAGtBA3EiASAAaiIAQQA2AgBB5AAgAWtBfHEiAiAAaiIBQQRrQQA2AgACQCACQQlJDQAgAEEANgIIIABBADYCBCABQQhrQQA2AgAgAUEMa0EANgIAIAJBGUkNACAAQQA2AhggAEEANgIUIABBADYCECAAQQA2AgwgAUEQa0EANgIAIAFBFGtBADYCACABQRhrQQA2AgAgAUEca0EANgIAIAIgAEEEcUEYciICayIBQSBJDQAgACACaiEAA0AgAEIANwMYIABCADcDECAAQgA3AwggAEIANwMAIABBIGohACABQSBrIgFBH0sNAAsLC1YBAX8CQCAAKAIMDQACQAJAAkACQCAALQAxDgMBAAMCCyAAKAI4IgFFDQAgASgCMCIBRQ0AIAAgAREAACIBDQMLQQAPCwALIABByhk2AhBBDiEBCyABCxoAIAAoAgxFBEAgAEHeHzYCECAAQRU2AgwLCxQAIAAoAgxBFUYEQCAAQQA2AgwLCxQAIAAoAgxBFkYEQCAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsrAAJAIABBJ08NAEL//////wkgAK2IQgGDUA0AIABBAnRB0DhqKAIADwsACxcAIABBL08EQAALIABBAnRB7DlqKAIAC78JAQF/QfQtIQECQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQeQAaw70A2NiAAFhYWFhYWECAwQFYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQYHCAkKCwwNDg9hYWFhYRBhYWFhYWFhYWFhYRFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWESExQVFhcYGRobYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1NmE3ODk6YWFhYWFhYWE7YWFhPGFhYWE9Pj9hYWFhYWFhYUBhYUFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFCQ0RFRkdISUpLTE1OT1BRUlNhYWFhYWFhYVRVVldYWVpbYVxdYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhXmFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYV9gYQtB6iwPC0GYJg8LQe0xDwtBoDcPC0HJKQ8LQbQpDwtBli0PC0HrKw8LQaI1DwtB2zQPC0HgKQ8LQeMkDwtB1SQPC0HuJA8LQeYlDwtByjQPC0HQNw8LQao1DwtB9SwPC0H2Jg8LQYIiDwtB8jMPC0G+KA8LQec3DwtBzSEPC0HAIQ8LQbglDwtByyUPC0GWJA8LQY80DwtBzTUPC0HdKg8LQe4zDwtBnDQPC0GeMQ8LQfQ1DwtB5SIPC0GvJQ8LQZkxDwtBsjYPC0H5Ng8LQcQyDwtB3SwPC0GCMQ8LQcExDwtBjTcPC0HJJA8LQew2DwtB5yoPC0HIIw8LQeIhDwtByTcPC0GlIg8LQZQiDwtB2zYPC0HeNQ8LQYYmDwtBvCsPC0GLMg8LQaAjDwtB9jAPC0GALA8LQYkrDwtBpCYPC0HyIw8LQYEoDwtBqzIPC0HrJw8LQcI2DwtBoiQPC0HPKg8LQdwjDwtBhycPC0HkNA8LQbciDwtBrTEPC0HVIg8LQa80DwtB3iYPC0HWMg8LQfQ0DwtBgTgPC0H0Nw8LQZI2DwtBnScPC0GCKQ8LQY0jDwtB1zEPC0G9NQ8LQbQ3DwtB2DAPC0G2Jw8LQZo4DwtBpyoPC0HEJw8LQa4jDwtB9SIPCwALQcomIQELIAELFwAgACAALwEuQf7/A3EgAUEAR3I7AS4LGgAgACAALwEuQf3/A3EgAUEAR0EBdHI7AS4LGgAgACAALwEuQfv/A3EgAUEAR0ECdHI7AS4LGgAgACAALwEuQff/A3EgAUEAR0EDdHI7AS4LGgAgACAALwEuQe//A3EgAUEAR0EEdHI7AS4LGgAgACAALwEuQd//A3EgAUEAR0EFdHI7AS4LGgAgACAALwEuQb//A3EgAUEAR0EGdHI7AS4LGgAgACAALwEuQf/+A3EgAUEAR0EHdHI7AS4LGgAgACAALwEuQf/9A3EgAUEAR0EIdHI7AS4LGgAgACAALwEuQf/7A3EgAUEAR0EJdHI7AS4LPgECfwJAIAAoAjgiA0UNACADKAIEIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHhEjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIIIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH8ETYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIMIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHsCjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIQIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH6HjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIUIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHLEDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIYIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG3HzYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIcIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG/FTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIsIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH+CDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIgIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEGMHTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIkIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHmFTYCEEEYIQQLIAQLOAAgAAJ/IAAvATJBFHFBFEYEQEEBIAAtAChBAUYNARogAC8BNEHlAEYMAQsgAC0AKUEFRgs6ADALWQECfwJAIAAtAChBAUYNACAALwE0IgFB5ABrQeQASQ0AIAFBzAFGDQAgAUGwAkYNACAALwEyIgBBwABxDQBBASECIABBiARxQYAERg0AIABBKHFFIQILIAILjAEBAn8CQAJAAkAgAC0AKkUNACAALQArRQ0AIAAvATIiAUECcUUNAQwCCyAALwEyIgFBAXFFDQELQQEhAiAALQAoQQFGDQAgAC8BNCIAQeQAa0HkAEkNACAAQcwBRg0AIABBsAJGDQAgAUHAAHENAEEAIQIgAUGIBHFBgARGDQAgAUEocUEARyECCyACC1cAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==",dir;Object.defineProperty(M6n,"exports",{get:a(()=>dir||(dir=eIs.from(tIs,"base64")),"get")})});var L6n=I((Isf,O6n)=>{"use strict";p();var{Buffer:rIs}=require("node:buffer"),nIs="AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCuzaAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgLhocCAwd/A34BeyABIAJqIQQCQCAAIgMoAgwiAA0AIAMoAgQEQCADIAE2AgQLIwBBEGsiCSQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADKAIcIgJBAmsO/AEB+QECAwQFBgcICQoLDA0ODxAREvgBE/cBFBX2ARYX9QEYGRobHB0eHyD9AfsBIfQBIiMkJSYnKCkqK/MBLC0uLzAxMvIB8QEzNPAB7wE1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk/6AVBRUlPuAe0BVOwBVesBVldYWVrqAVtcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHOAekB6AHPAecB0AHmAdEB0gHTAdQB5QHVAdYB1wHYAdkB2gHbAdwB3QHeAd8B4AHhAeIB4wEA/AELQQAM4wELQQ4M4gELQQ0M4QELQQ8M4AELQRAM3wELQRMM3gELQRQM3QELQRUM3AELQRYM2wELQRcM2gELQRgM2QELQRkM2AELQRoM1wELQRsM1gELQRwM1QELQR0M1AELQR4M0wELQR8M0gELQSAM0QELQSEM0AELQQgMzwELQSIMzgELQSQMzQELQSMMzAELQQcMywELQSUMygELQSYMyQELQScMyAELQSgMxwELQRIMxgELQREMxQELQSkMxAELQSoMwwELQSsMwgELQSwMwQELQd4BDMABC0EuDL8BC0EvDL4BC0EwDL0BC0ExDLwBC0EyDLsBC0EzDLoBC0E0DLkBC0HfAQy4AQtBNQy3AQtBOQy2AQtBDAy1AQtBNgy0AQtBNwyzAQtBOAyyAQtBPgyxAQtBOgywAQtB4AEMrwELQQsMrgELQT8MrQELQTsMrAELQQoMqwELQTwMqgELQT0MqQELQeEBDKgBC0HBAAynAQtBwAAMpgELQcIADKUBC0EJDKQBC0EtDKMBC0HDAAyiAQtBxAAMoQELQcUADKABC0HGAAyfAQtBxwAMngELQcgADJ0BC0HJAAycAQtBygAMmwELQcsADJoBC0HMAAyZAQtBzQAMmAELQc4ADJcBC0HPAAyWAQtB0AAMlQELQdEADJQBC0HSAAyTAQtB0wAMkgELQdUADJEBC0HUAAyQAQtB1gAMjwELQdcADI4BC0HYAAyNAQtB2QAMjAELQdoADIsBC0HbAAyKAQtB3AAMiQELQd0ADIgBC0HeAAyHAQtB3wAMhgELQeAADIUBC0HhAAyEAQtB4gAMgwELQeMADIIBC0HkAAyBAQtB5QAMgAELQeIBDH8LQeYADH4LQecADH0LQQYMfAtB6AAMewtBBQx6C0HpAAx5C0EEDHgLQeoADHcLQesADHYLQewADHULQe0ADHQLQQMMcwtB7gAMcgtB7wAMcQtB8AAMcAtB8gAMbwtB8QAMbgtB8wAMbQtB9AAMbAtB9QAMawtB9gAMagtBAgxpC0H3AAxoC0H4AAxnC0H5AAxmC0H6AAxlC0H7AAxkC0H8AAxjC0H9AAxiC0H+AAxhC0H/AAxgC0GAAQxfC0GBAQxeC0GCAQxdC0GDAQxcC0GEAQxbC0GFAQxaC0GGAQxZC0GHAQxYC0GIAQxXC0GJAQxWC0GKAQxVC0GLAQxUC0GMAQxTC0GNAQxSC0GOAQxRC0GPAQxQC0GQAQxPC0GRAQxOC0GSAQxNC0GTAQxMC0GUAQxLC0GVAQxKC0GWAQxJC0GXAQxIC0GYAQxHC0GZAQxGC0GaAQxFC0GbAQxEC0GcAQxDC0GdAQxCC0GeAQxBC0GfAQxAC0GgAQw/C0GhAQw+C0GiAQw9C0GjAQw8C0GkAQw7C0GlAQw6C0GmAQw5C0GnAQw4C0GoAQw3C0GpAQw2C0GqAQw1C0GrAQw0C0GsAQwzC0GtAQwyC0GuAQwxC0GvAQwwC0GwAQwvC0GxAQwuC0GyAQwtC0GzAQwsC0G0AQwrC0G1AQwqC0G2AQwpC0G3AQwoC0G4AQwnC0G5AQwmC0G6AQwlC0G7AQwkC0G8AQwjC0G9AQwiC0G+AQwhC0G/AQwgC0HAAQwfC0HBAQweC0HCAQwdC0EBDBwLQcMBDBsLQcQBDBoLQcUBDBkLQcYBDBgLQccBDBcLQcgBDBYLQckBDBULQcoBDBQLQcsBDBMLQcwBDBILQc0BDBELQc4BDBALQc8BDA8LQdABDA4LQdEBDA0LQdIBDAwLQdMBDAsLQdQBDAoLQdUBDAkLQdYBDAgLQeMBDAcLQdcBDAYLQdgBDAULQdkBDAQLQdoBDAMLQdsBDAILQd0BDAELQdwBCyECA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAn8CQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAwJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCACDuMBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISMkJScoKZ4DmwOaA5EDigODA4AD/QL7AvgC8gLxAu8C7QLoAucC5gLlAuQC3ALbAtoC2QLYAtcC1gLVAs8CzgLMAssCygLJAsgCxwLGAsQCwwK+ArwCugK5ArgCtwK2ArUCtAKzArICsQKwAq4CrQKpAqgCpwKmAqUCpAKjAqICoQKgAp8CmAKQAowCiwKKAoEC/gH9AfwB+wH6AfkB+AH3AfUB8wHwAesB6QHoAecB5gHlAeQB4wHiAeEB4AHfAd4B3QHcAdoB2QHYAdcB1gHVAdQB0wHSAdEB0AHPAc4BzQHMAcsBygHJAcgBxwHGAcUBxAHDAcIBwQHAAb8BvgG9AbwBuwG6AbkBuAG3AbYBtQG0AbMBsgGxAbABrwGuAa0BrAGrAaoBqQGoAacBpgGlAaQBowGiAZ8BngGZAZgBlwGWAZUBlAGTAZIBkQGQAY8BjQGMAYcBhgGFAYQBgwGCAX18e3p5dnV0UFFSU1RVCyABIARHDXJB/QEhAgy+AwsgASAERw2YAUHbASECDL0DCyABIARHDfEBQY4BIQIMvAMLIAEgBEcN/AFBhAEhAgy7AwsgASAERw2KAkH/ACECDLoDCyABIARHDZECQf0AIQIMuQMLIAEgBEcNlAJB+wAhAgy4AwsgASAERw0eQR4hAgy3AwsgASAERw0ZQRghAgy2AwsgASAERw3KAkHNACECDLUDCyABIARHDdUCQcYAIQIMtAMLIAEgBEcN1gJBwwAhAgyzAwsgASAERw3cAkE4IQIMsgMLIAMtADBBAUYNrQMMiQMLQQAhAAJAAkACQCADLQAqRQ0AIAMtACtFDQAgAy8BMiICQQJxRQ0BDAILIAMvATIiAkEBcUUNAQtBASEAIAMtAChBAUYNACADLwE0IgZB5ABrQeQASQ0AIAZBzAFGDQAgBkGwAkYNACACQcAAcQ0AQQAhACACQYgEcUGABEYNACACQShxQQBHIQALIANBADsBMiADQQA6ADECQCAARQRAIANBADoAMSADLQAuQQRxDQEMsQMLIANCADcDIAsgA0EAOgAxIANBAToANgxIC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAARQ1IIABBFUcNYiADQQQ2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgyvAwsgASAERgRAQQYhAgyvAwsgAS0AAEEKRw0ZIAFBAWohAQwaCyADQgA3AyBBEiECDJQDCyABIARHDYoDQSMhAgysAwsgASAERgRAQQchAgysAwsCQAJAIAEtAABBCmsOBAEYGAAYCyABQQFqIQFBECECDJMDCyABQQFqIQEgA0Evai0AAEEBcQ0XQQAhAiADQQA2AhwgAyABNgIUIANBmSA2AhAgA0EZNgIMDKsDCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMWg0YQQghAgyqAwsgASAERwRAIANBCTYCCCADIAE2AgRBFCECDJEDC0EJIQIMqQMLIAMpAyBQDa4CDEMLIAEgBEYEQEELIQIMqAMLIAEtAABBCkcNFiABQQFqIQEMFwsgA0Evai0AAEEBcUUNGQwmC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRkMQgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0aDCQLQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGwwyCyADQS9qLQAAQQFxRQ0cDCILQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANHAxCC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADR0MIAsgASAERgRAQRMhAgygAwsCQCABLQAAIgBBCmsOBB8jIwAiCyABQQFqIQEMHwtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0iDEILIAEgBEYEQEEWIQIMngMLIAEtAABBwMEAai0AAEEBRw0jDIMDCwJAA0AgAS0AAEGwO2otAAAiAEEBRwRAAkAgAEECaw4CAwAnCyABQQFqIQFBISECDIYDCyAEIAFBAWoiAUcNAAtBGCECDJ0DCyADKAIEIQBBACECIANBADYCBCADIAAgAUEBaiIBEDQiAA0hDEELQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIwwqCyABIARGBEBBHCECDJsDCyADQQo2AgggAyABNgIEQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANJUEkIQIMgQMLIAEgBEcEQANAIAEtAABBsD1qLQAAIgBBA0cEQCAAQQFrDgUYGiaCAyUmCyAEIAFBAWoiAUcNAAtBGyECDJoDC0EbIQIMmQMLA0AgAS0AAEGwP2otAAAiAEEDRwRAIABBAWsOBQ8RJxMmJwsgBCABQQFqIgFHDQALQR4hAgyYAwsgASAERwRAIANBCzYCCCADIAE2AgRBByECDP8CC0EfIQIMlwMLIAEgBEYEQEEgIQIMlwMLAkAgAS0AAEENaw4ULj8/Pz8/Pz8/Pz8/Pz8/Pz8/PwA/C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAyWAwsgA0EvaiECA0AgASAERgRAQSEhAgyXAwsCQAJAAkAgAS0AACIAQQlrDhgCACkpASkpKSkpKSkpKSkpKSkpKSkpKQInCyABQQFqIQEgA0Evai0AAEEBcUUNCgwYCyABQQFqIQEMFwsgAUEBaiEBIAItAABBAnENAAtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwMlQMLIAMtAC5BgAFxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ3mAiAAQRVGBEAgA0EkNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMlAMLQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDJMDC0EAIQIgA0EANgIcIAMgATYCFCADQb4gNgIQIANBAjYCDAySAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEgDKdqIgEQMiIARQ0rIANBBzYCHCADIAE2AhQgAyAANgIMDJEDCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlgiAkUNACADIAIRAAAhAAsgAEUNKyAAQRVGBEAgA0EKNgIcIAMgATYCFCADQesZNgIQIANBFTYCDEEAIQIMkAMLQQAhAiADQQA2AhwgAyABNgIUIANBkww2AhAgA0ETNgIMDI8DC0EAIQIgA0EANgIcIAMgATYCFCADQYIVNgIQIANBAjYCDAyOAwtBACECIANBADYCHCADIAE2AhQgA0HdFDYCECADQRk2AgwMjQMLQQAhAiADQQA2AhwgAyABNgIUIANB5h02AhAgA0EZNgIMDIwDCyAAQRVGDT1BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMiwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUNKCADQQ02AhwgAyABNgIUIAMgADYCDAyKAwsgAEEVRg06QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIkDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCgLIANBDjYCHCADIAA2AgwgAyABQQFqNgIUDIgDCyAAQRVGDTdBACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMhwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUEQCABQQFqIQEMJwsgA0EPNgIcIAMgADYCDCADIAFBAWo2AhQMhgMLQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDIUDCyAAQRVGDTNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwMhAMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUNJSADQRE2AhwgAyABNgIUIAMgADYCDAyDAwsgAEEVRg0wQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIIDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDCULIANBEjYCHCADIAA2AgwgAyABQQFqNgIUDIEDCyADQS9qLQAAQQFxRQ0BC0EXIQIM5gILQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDP4CCyAAQTtHDQAgAUEBaiEBDAwLQQAhAiADQQA2AhwgAyABNgIUIANBkhg2AhAgA0ECNgIMDPwCCyAAQRVGDShBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM+wILIANBFDYCHCADIAE2AhQgAyAANgIMDPoCCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDPUCCyADQRU2AhwgAyAANgIMIAMgAUEBajYCFAz5AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzzAgsgA0EXNgIcIAMgADYCDCADIAFBAWo2AhQM+AILIABBFUYNI0EAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAz3AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwdCyADQRk2AhwgAyAANgIMIAMgAUEBajYCFAz2AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzvAgsgA0EaNgIcIAMgADYCDCADIAFBAWo2AhQM9QILIABBFUYNH0EAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAz0AgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDBsLIANBHDYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgzzAgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDOsCCyADQR02AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8gILIABBO0cNASABQQFqIQELQSYhAgzXAgtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwM7wILIAEgBEcEQANAIAEtAABBIEcNhAIgBCABQQFqIgFHDQALQSwhAgzvAgtBLCECDO4CCyABIARGBEBBNCECDO4CCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtBNCECDO8CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNnwIgA0EyNgIcIAMgATYCFCADIAA2AgxBACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUEQCABQQFqIQEMnwILIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgztAgsgASAERwRAAkADQCABLQAAQTBrIgBB/wFxQQpPBEBBOiECDNcCCyADKQMgIgtCmbPmzJmz5swZVg0BIAMgC0IKfiIKNwMgIAogAK1C/wGDIgtCf4VWDQEgAyAKIAt8NwMgIAQgAUEBaiIBRw0AC0HAACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABQQFqIgEQMSIADRcM4gILQcAAIQIM7AILIAEgBEYEQEHJACECDOwCCwJAA0ACQCABLQAAQQlrDhgAAqICogKpAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAgCiAgsgBCABQQFqIgFHDQALQckAIQIM7AILIAFBAWohASADQS9qLQAAQQFxDaUCIANBADYCHCADIAE2AhQgA0GXEDYCECADQQo2AgxBACECDOsCCyABIARHBEADQCABLQAAQSBHDRUgBCABQQFqIgFHDQALQfgAIQIM6wILQfgAIQIM6gILIANBAjoAKAw4C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAzoAgtBACECDM4CC0ENIQIMzQILQRMhAgzMAgtBFSECDMsCC0EWIQIMygILQRghAgzJAgtBGSECDMgCC0EaIQIMxwILQRshAgzGAgtBHCECDMUCC0EdIQIMxAILQR4hAgzDAgtBHyECDMICC0EgIQIMwQILQSIhAgzAAgtBIyECDL8CC0ElIQIMvgILQeUAIQIMvQILIANBPTYCHCADIAE2AhQgAyAANgIMQQAhAgzVAgsgA0EbNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIM1AILIANBIDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNMCCyADQRM2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzSAgsgA0ELNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0QILIANBEDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNACCyADQSA2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzPAgsgA0ELNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzgILIANBDDYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM0CC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAzMAgsCQANAAkAgAS0AAEEKaw4EAAICAAILIAQgAUEBaiIBRw0AC0H9ASECDMwCCwJAAkAgAy0ANkEBRw0AQQAhAAJAIAMoAjgiAkUNACACKAJgIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB/AE2AhwgAyABNgIUIANB3Bk2AhAgA0EVNgIMQQAhAgzNAgtB3AEhAgyzAgsgA0EANgIcIAMgATYCFCADQfkLNgIQIANBHzYCDEEAIQIMywILAkACQCADLQAoQQFrDgIEAQALQdsBIQIMsgILQdQBIQIMsQILIANBAjoAMUEAIQACQCADKAI4IgJFDQAgAigCACICRQ0AIAMgAhEAACEACyAARQRAQd0BIQIMsQILIABBFUcEQCADQQA2AhwgAyABNgIUIANBtAw2AhAgA0EQNgIMQQAhAgzKAgsgA0H7ATYCHCADIAE2AhQgA0GBGjYCECADQRU2AgxBACECDMkCCyABIARGBEBB+gEhAgzJAgsgAS0AAEHIAEYNASADQQE6ACgLQcABIQIMrgILQdoBIQIMrQILIAEgBEcEQCADQQw2AgggAyABNgIEQdkBIQIMrQILQfkBIQIMxQILIAEgBEYEQEH4ASECDMUCCyABLQAAQcgARw0EIAFBAWohAUHYASECDKsCCyABIARGBEBB9wEhAgzEAgsCQAJAIAEtAABBxQBrDhAABQUFBQUFBQUFBQUFBQUBBQsgAUEBaiEBQdYBIQIMqwILIAFBAWohAUHXASECDKoCC0H2ASECIAEgBEYNwgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABButUAai0AAEcNAyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMwwILIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgBFBEBB4wEhAgyqAgsgA0H1ATYCHCADIAE2AhQgAyAANgIMQQAhAgzCAgtB9AEhAiABIARGDcECIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjVAGotAABHDQIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMICCyADQYEEOwEoIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgANAwwCCyADQQA2AgALQQAhAiADQQA2AhwgAyABNgIUIANB5R82AhAgA0EINgIMDL8CC0HVASECDKUCCyADQfMBNgIcIAMgATYCFCADIAA2AgxBACECDL0CC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ1uIABBFUcEQCADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgy9AgsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDLwCCyABIARHBEAgA0ENNgIIIAMgATYCBEHTASECDKMCC0HyASECDLsCCyABIARGBEBB8QEhAgy7AgsCQAJAAkAgAS0AAEHIAGsOCwABCAgICAgICAgCCAsgAUEBaiEBQdABIQIMowILIAFBAWohAUHRASECDKICCyABQQFqIQFB0gEhAgyhAgtB8AEhAiABIARGDbkCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEG11QBqLQAARw0EIABBAkYNAyAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy5AgtB7wEhAiABIARGDbgCIAMoAgAiACAEIAFraiEGIAEgAGtBAWohBQNAIAEtAAAgAEGz1QBqLQAARw0DIABBAUYNAiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy4AgtB7gEhAiABIARGDbcCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEGw1QBqLQAARw0CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy3AgsgAygCBCEAIANCADcDACADIAAgBUEBaiIBECsiAEUNAiADQewBNgIcIAMgATYCFCADIAA2AgxBACECDLYCCyADQQA2AgALIAMoAgQhACADQQA2AgQgAyAAIAEQKyIARQ2cAiADQe0BNgIcIAMgATYCFCADIAA2AgxBACECDLQCC0HPASECDJoCC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMtAILQc4BIQIMmgILIANB6wE2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyyAgsgASAERgRAQesBIQIMsgILIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMsQILQc0BIQIMlwILIAEgBEcEQCADQQ42AgggAyABNgIEQcwBIQIMlwILQeoBIQIMrwILIAEgBEYEQEHpASECDK8CCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHLASECDJYCCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNlwIgA0HoATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgASAERgRAQecBIQIMrgILAkAgAS0AAEEuRgRAIAFBAWohAQwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmAIgA0HmATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgtBygEhAgyUAgsgASAERgRAQeUBIQIMrQILQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIBNgIcIAMgATYCFCADIAA2AgxBACECDK8CCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmgIgA0HjATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5AE2AhwgAyABNgIUIAMgADYCDAytAgtByQEhAgyTAgtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GkDTYCECADQSE2AgxBACECDK0CC0HIASECDJMCCyADQeEBNgIcIAMgATYCFCADQdAaNgIQIANBFTYCDEEAIQIMqwILIAEgBEYEQEHhASECDKsCCwJAIAEtAABBIEYEQCADQQA7ATQgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GZETYCECADQQk2AgxBACECDKsCC0HHASECDJECCyABIARGBEBB4AEhAgyqAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKsCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyqAgtBxgEhAgyQAgsgASAERgRAQd8BIQIMqQILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyqAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqQILQcUBIQIMjwILIAEgBEYEQEHeASECDKgCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqQILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKgCC0HEASECDI4CCyABIARGBEBB3QEhAgynAgsCQAJAAkACQCABLQAAQQprDhcCAwMAAwMDAwMDAwMDAwMDAwMDAwMDAQMLIAFBAWoMBQsgAUEBaiEBQcMBIQIMjwILIAFBAWohASADQS9qLQAAQQFxDQggA0EANgIcIAMgATYCFCADQY0LNgIQIANBDTYCDEEAIQIMpwILIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKYCCyABIARHBEAgA0EPNgIIIAMgATYCBEEBIQIMjQILQdwBIQIMpQILAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0HbASECDKYCCyADKAIEIQAgA0EANgIEIAMgACABEC0iAEUEQCABQQFqIQEMBAsgA0HaATYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgylAgsgAygCBCEAIANBADYCBCADIAAgARAtIgANASABQQFqCyEBQcEBIQIMigILIANB2QE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMogILQcIBIQIMiAILIANBL2otAABBAXENASADQQA2AhwgAyABNgIUIANB5Bw2AhAgA0EZNgIMQQAhAgygAgsgASAERgRAQdkBIQIMoAILAkACQAJAIAEtAABBCmsOBAECAgACCyABQQFqIQEMAgsgAUEBaiEBDAELIAMtAC5BwABxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCPCICRQ0AIAMgAhEAACEACyAARQ2gASAAQRVGBEAgA0HZADYCHCADIAE2AhQgA0G3GjYCECADQRU2AgxBACECDJ8CCyADQQA2AhwgAyABNgIUIANBgA02AhAgA0EbNgIMQQAhAgyeAgsgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMnQILIAEgBEcEQCADQQw2AgggAyABNgIEQb8BIQIMhAILQdgBIQIMnAILIAEgBEYEQEHXASECDJwCCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEHBAGsOFQABAgNaBAUGWlpaBwgJCgsMDQ4PEFoLIAFBAWohAUH7ACECDJICCyABQQFqIQFB/AAhAgyRAgsgAUEBaiEBQYEBIQIMkAILIAFBAWohAUGFASECDI8CCyABQQFqIQFBhgEhAgyOAgsgAUEBaiEBQYkBIQIMjQILIAFBAWohAUGKASECDIwCCyABQQFqIQFBjQEhAgyLAgsgAUEBaiEBQZYBIQIMigILIAFBAWohAUGXASECDIkCCyABQQFqIQFBmAEhAgyIAgsgAUEBaiEBQaUBIQIMhwILIAFBAWohAUGmASECDIYCCyABQQFqIQFBrAEhAgyFAgsgAUEBaiEBQbQBIQIMhAILIAFBAWohAUG3ASECDIMCCyABQQFqIQFBvgEhAgyCAgsgASAERgRAQdYBIQIMmwILIAEtAABBzgBHDUggAUEBaiEBQb0BIQIMgQILIAEgBEYEQEHVASECDJoCCwJAAkACQCABLQAAQcIAaw4SAEpKSkpKSkpKSgFKSkpKSkoCSgsgAUEBaiEBQbgBIQIMggILIAFBAWohAUG7ASECDIECCyABQQFqIQFBvAEhAgyAAgtB1AEhAiABIARGDZgCIAMoAgAiACAEIAFraiEFIAEgAGtBB2ohBgJAA0AgAS0AACAAQajVAGotAABHDUUgAEEHRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJkCCyADQQA2AgAgBkEBaiEBQRsMRQsgASAERgRAQdMBIQIMmAILAkACQCABLQAAQckAaw4HAEdHR0dHAUcLIAFBAWohAUG5ASECDP8BCyABQQFqIQFBugEhAgz+AQtB0gEhAiABIARGDZYCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQabVAGotAABHDUMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJcCCyADQQA2AgAgBkEBaiEBQQ8MQwtB0QEhAiABIARGDZUCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQaTVAGotAABHDUIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYCCyADQQA2AgAgBkEBaiEBQSAMQgtB0AEhAiABIARGDZQCIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDUEgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJUCCyADQQA2AgAgBkEBaiEBQRIMQQsgASAERgRAQc8BIQIMlAILAkACQCABLQAAQcUAaw4OAENDQ0NDQ0NDQ0NDQwFDCyABQQFqIQFBtQEhAgz7AQsgAUEBaiEBQbYBIQIM+gELQc4BIQIgASAERg2SAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGe1QBqLQAARw0/IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyTAgsgA0EANgIAIAZBAWohAUEHDD8LQc0BIQIgASAERg2RAiADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGY1QBqLQAARw0+IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAySAgsgA0EANgIAIAZBAWohAUEoDD4LIAEgBEYEQEHMASECDJECCwJAAkACQCABLQAAQcUAaw4RAEFBQUFBQUFBQQFBQUFBQQJBCyABQQFqIQFBsQEhAgz5AQsgAUEBaiEBQbIBIQIM+AELIAFBAWohAUGzASECDPcBC0HLASECIAEgBEYNjwIgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBkdUAai0AAEcNPCAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkAILIANBADYCACAGQQFqIQFBGgw8C0HKASECIAEgBEYNjgIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBjdUAai0AAEcNOyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjwILIANBADYCACAGQQFqIQFBIQw7CyABIARGBEBByQEhAgyOAgsCQAJAIAEtAABBwQBrDhQAPT09PT09PT09PT09PT09PT09AT0LIAFBAWohAUGtASECDPUBCyABQQFqIQFBsAEhAgz0AQsgASAERgRAQcgBIQIMjQILAkACQCABLQAAQdUAaw4LADw8PDw8PDw8PAE8CyABQQFqIQFBrgEhAgz0AQsgAUEBaiEBQa8BIQIM8wELQccBIQIgASAERg2LAiADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw04IABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyMAgsgA0EANgIAIAZBAWohAUEqDDgLIAEgBEYEQEHGASECDIsCCyABLQAAQdAARw04IAFBAWohAUElDDcLQcUBIQIgASAERg2JAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGB1QBqLQAARw02IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyKAgsgA0EANgIAIAZBAWohAUEODDYLIAEgBEYEQEHEASECDIkCCyABLQAAQcUARw02IAFBAWohAUGrASECDO8BCyABIARGBEBBwwEhAgyIAgsCQAJAAkACQCABLQAAQcIAaw4PAAECOTk5OTk5OTk5OTkDOQsgAUEBaiEBQacBIQIM8QELIAFBAWohAUGoASECDPABCyABQQFqIQFBqQEhAgzvAQsgAUEBaiEBQaoBIQIM7gELQcIBIQIgASAERg2GAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH+1ABqLQAARw0zIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyHAgsgA0EANgIAIAZBAWohAUEUDDMLQcEBIQIgASAERg2FAiADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEH51ABqLQAARw0yIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyGAgsgA0EANgIAIAZBAWohAUErDDILQcABIQIgASAERg2EAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH21ABqLQAARw0xIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyFAgsgA0EANgIAIAZBAWohAUEsDDELQb8BIQIgASAERg2DAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0wIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyEAgsgA0EANgIAIAZBAWohAUERDDALQb4BIQIgASAERg2CAiADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEHy1ABqLQAARw0vIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyDAgsgA0EANgIAIAZBAWohAUEuDC8LIAEgBEYEQEG9ASECDIICCwJAAkACQAJAAkAgAS0AAEHBAGsOFQA0NDQ0NDQ0NDQ0ATQ0AjQ0AzQ0BDQLIAFBAWohAUGbASECDOwBCyABQQFqIQFBnAEhAgzrAQsgAUEBaiEBQZ0BIQIM6gELIAFBAWohAUGiASECDOkBCyABQQFqIQFBpAEhAgzoAQsgASAERgRAQbwBIQIMgQILAkACQCABLQAAQdIAaw4DADABMAsgAUEBaiEBQaMBIQIM6AELIAFBAWohAUEEDC0LQbsBIQIgASAERg3/ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHw1ABqLQAARw0sIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyAAgsgA0EANgIAIAZBAWohAUEdDCwLIAEgBEYEQEG6ASECDP8BCwJAAkAgAS0AAEHJAGsOBwEuLi4uLgAuCyABQQFqIQFBoQEhAgzmAQsgAUEBaiEBQSIMKwsgASAERgRAQbkBIQIM/gELIAEtAABB0ABHDSsgAUEBaiEBQaABIQIM5AELIAEgBEYEQEG4ASECDP0BCwJAAkAgAS0AAEHGAGsOCwAsLCwsLCwsLCwBLAsgAUEBaiEBQZ4BIQIM5AELIAFBAWohAUGfASECDOMBC0G3ASECIAEgBEYN+wEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB7NQAai0AAEcNKCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM/AELIANBADYCACAGQQFqIQFBDQwoC0G2ASECIAEgBEYN+gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNJyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+wELIANBADYCACAGQQFqIQFBDAwnC0G1ASECIAEgBEYN+QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6tQAai0AAEcNJiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+gELIANBADYCACAGQQFqIQFBAwwmC0G0ASECIAEgBEYN+AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6NQAai0AAEcNJSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+QELIANBADYCACAGQQFqIQFBJgwlCyABIARGBEBBswEhAgz4AQsCQAJAIAEtAABB1ABrDgIAAScLIAFBAWohAUGZASECDN8BCyABQQFqIQFBmgEhAgzeAQtBsgEhAiABIARGDfYBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQebUAGotAABHDSMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPcBCyADQQA2AgAgBkEBaiEBQScMIwtBsQEhAiABIARGDfUBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQeTUAGotAABHDSIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPYBCyADQQA2AgAgBkEBaiEBQRwMIgtBsAEhAiABIARGDfQBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQd7UAGotAABHDSEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPUBCyADQQA2AgAgBkEBaiEBQQYMIQtBrwEhAiABIARGDfMBIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQdnUAGotAABHDSAgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPQBCyADQQA2AgAgBkEBaiEBQRkMIAsgASAERgRAQa4BIQIM8wELAkACQAJAAkAgAS0AAEEtaw4jACQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkASQkJCQkAiQkJAMkCyABQQFqIQFBjgEhAgzcAQsgAUEBaiEBQY8BIQIM2wELIAFBAWohAUGUASECDNoBCyABQQFqIQFBlQEhAgzZAQtBrQEhAiABIARGDfEBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQdfUAGotAABHDR4gAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPIBCyADQQA2AgAgBkEBaiEBQQsMHgsgASAERgRAQawBIQIM8QELAkACQCABLQAAQcEAaw4DACABIAsgAUEBaiEBQZABIQIM2AELIAFBAWohAUGTASECDNcBCyABIARGBEBBqwEhAgzwAQsCQAJAIAEtAABBwQBrDg8AHx8fHx8fHx8fHx8fHwEfCyABQQFqIQFBkQEhAgzXAQsgAUEBaiEBQZIBIQIM1gELIAEgBEYEQEGqASECDO8BCyABLQAAQcwARw0cIAFBAWohAUEKDBsLQakBIQIgASAERg3tASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHR1ABqLQAARw0aIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzuAQsgA0EANgIAIAZBAWohAUEeDBoLQagBIQIgASAERg3sASADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEHK1ABqLQAARw0ZIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAztAQsgA0EANgIAIAZBAWohAUEVDBkLQacBIQIgASAERg3rASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHH1ABqLQAARw0YIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzsAQsgA0EANgIAIAZBAWohAUEXDBgLQaYBIQIgASAERg3qASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHB1ABqLQAARw0XIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzrAQsgA0EANgIAIAZBAWohAUEYDBcLIAEgBEYEQEGlASECDOoBCwJAAkAgAS0AAEHJAGsOBwAZGRkZGQEZCyABQQFqIQFBiwEhAgzRAQsgAUEBaiEBQYwBIQIM0AELQaQBIQIgASAERg3oASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw0VIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzpAQsgA0EANgIAIAZBAWohAUEJDBULQaMBIQIgASAERg3nASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw0UIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzoAQsgA0EANgIAIAZBAWohAUEfDBQLQaIBIQIgASAERg3mASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEG+1ABqLQAARw0TIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAznAQsgA0EANgIAIAZBAWohAUECDBMLQaEBIQIgASAERg3lASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYDQCABLQAAIABBvNQAai0AAEcNESAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5QELIAEgBEYEQEGgASECDOUBC0EBIAEtAABB3wBHDREaIAFBAWohAUGHASECDMsBCyADQQA2AgAgBkEBaiEBQYgBIQIMygELQZ8BIQIgASAERg3iASADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw0PIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzjAQsgA0EANgIAIAZBAWohAUEpDA8LQZ4BIQIgASAERg3hASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEG41ABqLQAARw0OIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAziAQsgA0EANgIAIAZBAWohAUEtDA4LIAEgBEYEQEGdASECDOEBCyABLQAAQcUARw0OIAFBAWohAUGEASECDMcBCyABIARGBEBBnAEhAgzgAQsCQAJAIAEtAABBzABrDggADw8PDw8PAQ8LIAFBAWohAUGCASECDMcBCyABQQFqIQFBgwEhAgzGAQtBmwEhAiABIARGDd4BIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQbPUAGotAABHDQsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN8BCyADQQA2AgAgBkEBaiEBQSMMCwtBmgEhAiABIARGDd0BIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDUAGotAABHDQogAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN4BCyADQQA2AgAgBkEBaiEBQQAMCgsgASAERgRAQZkBIQIM3QELAkACQCABLQAAQcgAaw4IAAwMDAwMDAEMCyABQQFqIQFB/QAhAgzEAQsgAUEBaiEBQYABIQIMwwELIAEgBEYEQEGYASECDNwBCwJAAkAgAS0AAEHOAGsOAwALAQsLIAFBAWohAUH+ACECDMMBCyABQQFqIQFB/wAhAgzCAQsgASAERgRAQZcBIQIM2wELIAEtAABB2QBHDQggAUEBaiEBQQgMBwtBlgEhAiABIARGDdkBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQazUAGotAABHDQYgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNoBCyADQQA2AgAgBkEBaiEBQQUMBgtBlQEhAiABIARGDdgBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQabUAGotAABHDQUgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNkBCyADQQA2AgAgBkEBaiEBQRYMBQtBlAEhAiABIARGDdcBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDQQgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNgBCyADQQA2AgAgBkEBaiEBQRAMBAsgASAERgRAQZMBIQIM1wELAkACQCABLQAAQcMAaw4MAAYGBgYGBgYGBgYBBgsgAUEBaiEBQfkAIQIMvgELIAFBAWohAUH6ACECDL0BC0GSASECIAEgBEYN1QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBoNQAai0AAEcNAiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM1gELIANBADYCACAGQQFqIQFBJAwCCyADQQA2AgAMAgsgASAERgRAQZEBIQIM1AELIAEtAABBzABHDQEgAUEBaiEBQRMLOgApIAMoAgQhACADQQA2AgQgAyAAIAEQLiIADQIMAQtBACECIANBADYCHCADIAE2AhQgA0H+HzYCECADQQY2AgwM0QELQfgAIQIMtwELIANBkAE2AhwgAyABNgIUIAMgADYCDEEAIQIMzwELQQAhAAJAIAMoAjgiAkUNACACKAJAIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GCDzYCECADQSA2AgxBACECDM4BC0H3ACECDLQBCyADQY8BNgIcIAMgATYCFCADQewbNgIQIANBFTYCDEEAIQIMzAELIAEgBEYEQEGPASECDMwBCwJAIAEtAABBIEYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZsfNgIQIANBBjYCDEEAIQIMzAELQQIhAgyyAQsDQCABLQAAQSBHDQIgBCABQQFqIgFHDQALQY4BIQIMygELIAEgBEYEQEGNASECDMoBCwJAIAEtAABBCWsOBEoAAEoAC0H1ACECDLABCyADLQApQQVGBEBB9gAhAgywAQtB9AAhAgyvAQsgASAERgRAQYwBIQIMyAELIANBEDYCCCADIAE2AgQMCgsgASAERgRAQYsBIQIMxwELAkAgAS0AAEEJaw4ERwAARwALQfMAIQIMrQELIAEgBEcEQCADQRA2AgggAyABNgIEQfEAIQIMrQELQYoBIQIMxQELAkAgASAERwRAA0AgAS0AAEGg0ABqLQAAIgBBA0cEQAJAIABBAWsOAkkABAtB8AAhAgyvAQsgBCABQQFqIgFHDQALQYgBIQIMxgELQYgBIQIMxQELIANBADYCHCADIAE2AhQgA0HbIDYCECADQQc2AgxBACECDMQBCyABIARGBEBBiQEhAgzEAQsCQAJAAkAgAS0AAEGg0gBqLQAAQQFrDgNGAgABC0HyACECDKwBCyADQQA2AhwgAyABNgIUIANBtBI2AhAgA0EHNgIMQQAhAgzEAQtB6gAhAgyqAQsgASAERwRAIAFBAWohAUHvACECDKoBC0GHASECDMIBCyAEIAEiAEYEQEGGASECDMIBCyAALQAAIgFBL0YEQCAAQQFqIQFB7gAhAgypAQsgAUEJayICQRdLDQEgACEBQQEgAnRBm4CABHENQQwBCyAEIAEiAEYEQEGFASECDMEBCyAALQAAQS9HDQAgAEEBaiEBDAMLQQAhAiADQQA2AhwgAyAANgIUIANB2yA2AhAgA0EHNgIMDL8BCwJAAkACQAJAAkADQCABLQAAQaDOAGotAAAiAEEFRwRAAkACQCAAQQFrDghHBQYHCAAEAQgLQesAIQIMrQELIAFBAWohAUHtACECDKwBCyAEIAFBAWoiAUcNAAtBhAEhAgzDAQsgAUEBagwUCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDMEBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDMABCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDL8BCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy+AQsgASAERgRAQYMBIQIMvgELAkAgAS0AAEGgzgBqLQAAQQFrDgg+BAUGAAgCAwcLIAFBAWohAQtBAyECDKMBCyABQQFqDA0LQQAhAiADQQA2AhwgA0HREjYCECADQQc2AgwgAyABQQFqNgIUDLoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDLkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDLgBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDLcBCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy2AQtB7AAhAgycAQsgASAERgRAQYIBIQIMtQELIAFBAWoMAgsgASAERgRAQYEBIQIMtAELIAFBAWoMAQsgASAERg0BIAFBAWoLIQFBBCECDJgBC0GAASECDLABCwNAIAEtAABBoMwAai0AACIAQQJHBEAgAEEBRwRAQekAIQIMmQELDDELIAQgAUEBaiIBRw0AC0H/ACECDK8BCyABIARGBEBB/gAhAgyvAQsCQCABLQAAQQlrDjcvAwYvBAYGBgYGBgYGBgYGBgYGBgYGBgUGBgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYABgsgAUEBagshAUEFIQIMlAELIAFBAWoMBgsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgyrAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgyqAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgypAQsgA0EANgIcIAMgATYCFCADQY0UNgIQIANBBzYCDEEAIQIMqAELAkACQAJAAkADQCABLQAAQaDKAGotAAAiAEEFRwRAAkAgAEEBaw4GLgMEBQYABgtB6AAhAgyUAQsgBCABQQFqIgFHDQALQf0AIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqAELIANBADYCHCADIAE2AhQgA0HkCDYCECADQQc2AgxBACECDKcBCyABIARGDQEgAUEBagshAUEGIQIMjAELQfwAIQIMpAELAkACQAJAAkADQCABLQAAQaDIAGotAAAiAEEFRwRAIABBAWsOBCkCAwQFCyAEIAFBAWoiAUcNAAtB+wAhAgynAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgymAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgylAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgykAQsgA0EANgIcIAMgATYCFCADQbwKNgIQIANBBzYCDEEAIQIMowELQc8AIQIMiQELQdEAIQIMiAELQecAIQIMhwELIAEgBEYEQEH6ACECDKABCwJAIAEtAABBCWsOBCAAACAACyABQQFqIQFB5gAhAgyGAQsgASAERgRAQfkAIQIMnwELAkAgAS0AAEEJaw4EHwAAHwALQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFBEBB4gEhAgyGAQsgAEEVRwRAIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDJ8BCyADQfgANgIcIAMgATYCFCADQeoaNgIQIANBFTYCDEEAIQIMngELIAEgBEcEQCADQQ02AgggAyABNgIEQeQAIQIMhQELQfcAIQIMnQELIAEgBEYEQEH2ACECDJ0BCwJAAkACQCABLQAAQcgAaw4LAAELCwsLCwsLCwILCyABQQFqIQFB3QAhAgyFAQsgAUEBaiEBQeAAIQIMhAELIAFBAWohAUHjACECDIMBC0H1ACECIAEgBEYNmwEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBtdUAai0AAEcNCCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMnAELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfQANgIcIAMgATYCFCADIAA2AgxBACECDJwBC0HiACECDIIBC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMnAELQeEAIQIMggELIANB8wA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyaAQsgAy0AKSIAQSNrQQtJDQkCQCAAQQZLDQBBASAAdEHKAHFFDQAMCgtBACECIANBADYCHCADIAE2AhQgA0HtCTYCECADQQg2AgwMmQELQfIAIQIgASAERg2YASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGz1QBqLQAARw0FIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAQsgAygCBCEAIANCADcDACADIAAgBkEBaiIBECsiAARAIANB8QA2AhwgAyABNgIUIAMgADYCDEEAIQIMmQELQd8AIQIMfwtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJkBC0HeACECDH8LIANB8AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyXAQsgAy0AKUEhRg0GIANBADYCHCADIAE2AhQgA0GRCjYCECADQQg2AgxBACECDJYBC0HvACECIAEgBEYNlQEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMlgELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgBFDQIgA0HtADYCHCADIAE2AhQgAyAANgIMQQAhAgyVAQsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNgAEgA0HuADYCHCADIAE2AhQgAyAANgIMQQAhAgyTAQtB3AAhAgx5C0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMkwELQdsAIQIMeQsgA0HsADYCHCADIAE2AhQgA0GAGzYCECADQRU2AgxBACECDJEBCyADLQApIgBBI0kNACAAQS5GDQAgA0EANgIcIAMgATYCFCADQckJNgIQIANBCDYCDEEAIQIMkAELQdoAIQIMdgsgASAERgRAQesAIQIMjwELAkAgAS0AAEEvRgRAIAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMQQAhAgyPAQtB2QAhAgx1CyABIARHBEAgA0EONgIIIAMgATYCBEHYACECDHULQeoAIQIMjQELIAEgBEYEQEHpACECDI0BCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHXACECDHQLIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ16IANB6AA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAEgBEYEQEHnACECDIwBCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDXsgA0HmADYCHCADIAE2AhQgAyAANgIMQQAhAgyMAQtB1gAhAgxyCyABIARGBEBB5QAhAgyLAQtBACEAQQEhBUEBIQdBACECAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkAgAS0AAEEwaw4KCgkAAQIDBAUGCAsLQQIMBgtBAwwFC0EEDAQLQQUMAwtBBgwCC0EHDAELQQgLIQJBACEFQQAhBwwCC0EJIQJBASEAQQAhBUEAIQcMAQtBACEFQQEhAgsgAyACOgArIAFBAWohAQJAAkAgAy0ALkEQcQ0AAkACQAJAIAMtACoOAwEAAgQLIAdFDQMMAgsgAA0BDAILIAVFDQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ0CIANB4gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ19IANB4wA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5AA2AhwgAyABNgIUIAMgADYCDAyLAQtB1AAhAgxxCyADLQApQSJGDYYBQdMAIQIMcAtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsgAEUEQEHVACECDHALIABBFUcEQCADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgyJAQsgA0HhADYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDIgBCyABIARGBEBB4AAhAgyIAQsCQAJAAkACQAJAIAEtAABBCmsOBAEEBAAECyABQQFqIQEMAQsgAUEBaiEBIANBL2otAABBAXFFDQELQdIAIQIMcAsgA0EANgIcIAMgATYCFCADQbYRNgIQIANBCTYCDEEAIQIMiAELIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIcBCyABIARGBEBB3wAhAgyHAQsgAS0AAEEKRgRAIAFBAWohAQwJCyADLQAuQcAAcQ0IIANBADYCHCADIAE2AhQgA0G2ETYCECADQQI2AgxBACECDIYBCyABIARGBEBB3QAhAgyGAQsgAS0AACICQQ1GBEAgAUEBaiEBQdAAIQIMbQsgASEAIAJBCWsOBAUBAQUBCyAEIAEiAEYEQEHcACECDIUBCyAALQAAQQpHDQAgAEEBagwCC0EAIQIgA0EANgIcIAMgADYCFCADQcotNgIQIANBBzYCDAyDAQsgASAERgRAQdsAIQIMgwELAkAgAS0AAEEJaw4EAwAAAwALIAFBAWoLIQFBzgAhAgxoCyABIARGBEBB2gAhAgyBAQsgAS0AAEEJaw4EAAEBAAELQQAhAiADQQA2AhwgA0GaEjYCECADQQc2AgwgAyABQQFqNgIUDH8LIANBgBI7ASpBACEAAkAgAygCOCICRQ0AIAIoAjgiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HZADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDH4LQc0AIQIMZAsgA0EANgIcIAMgATYCFCADQckNNgIQIANBGjYCDEEAIQIMfAsgASAERgRAQdkAIQIMfAsgAS0AAEEgRw09IAFBAWohASADLQAuQQFxDT0gA0EANgIcIAMgATYCFCADQcIcNgIQIANBHjYCDEEAIQIMewsgASAERgRAQdgAIQIMewsCQAJAAkACQAJAIAEtAAAiAEEKaw4EAgMDAAELIAFBAWohAUEsIQIMZQsgAEE6Rw0BIANBADYCHCADIAE2AhQgA0HnETYCECADQQo2AgxBACECDH0LIAFBAWohASADQS9qLQAAQQFxRQ1zIAMtADJBgAFxRQRAIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsCQAJAIAAOFk1MSwEBAQEBAQEBAQEBAQEBAQEBAQABCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgx+CyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgx9C0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ1ZIABBFUcNASADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgx8C0HLACECDGILQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDHoLIAMgAy8BMkGAAXI7ATIMOwsgASAERwRAIANBETYCCCADIAE2AgRBygAhAgxgC0HXACECDHgLIAEgBEYEQEHWACECDHgLAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAQEBAQEBAQEBAQEBAAUBAQAIDQAsgAUEBaiEBQcYAIQIMYQsgAUEBaiEBQccAIQIMYAsgAUEBaiEBQcgAIQIMXwsgAUEBaiEBQckAIQIMXgtB1QAhAiAEIAEiAEYNdiAEIAFrIAMoAgAiAWohBiAAIAFrQQVqIQcDQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQhBBCABQQVGDQoaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHYLQdQAIQIgBCABIgBGDXUgBCABayADKAIAIgFqIQYgACABa0EPaiEHA0AgAUGAyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0HQQMgAUEPRg0JGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx1C0HTACECIAQgASIARg10IAQgAWsgAygCACIBaiEGIAAgAWtBDmohBwNAIAFB4scAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNBiABQQ5GDQcgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdAtB0gAhAiAEIAEiAEYNcyAEIAFrIAMoAgAiAWohBSAAIAFrQQFqIQYDQCABQeDHAGotAAAgAC0AACIHQSByIAcgB0HBAGtB/wFxQRpJG0H/AXFHDQUgAUEBRg0CIAFBAWohASAEIABBAWoiAEcNAAsgAyAFNgIADHMLIAEgBEYEQEHRACECDHMLAkACQCABLQAAIgBBIHIgACAAQcEAa0H/AXFBGkkbQf8BcUHuAGsOBwA5OTk5OQE5CyABQQFqIQFBwwAhAgxaCyABQQFqIQFBxAAhAgxZCyADQQA2AgAgBkEBaiEBQcUAIQIMWAtB0AAhAiAEIAEiAEYNcCAEIAFrIAMoAgAiAWohBiAAIAFrQQlqIQcDQCABQdbHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQJBAiABQQlGDQQaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHALQc8AIQIgBCABIgBGDW8gBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUHQxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxvCyAAIQEgA0EANgIADDMLQQELOgAsIANBADYCACAHQQFqIQELQS0hAgxSCwJAA0AgAS0AAEHQxQBqLQAAQQFHDQEgBCABQQFqIgFHDQALQc0AIQIMawtBwgAhAgxRCyABIARGBEBBzAAhAgxqCyABLQAAQTpGBEAgAygCBCEAIANBADYCBCADIAAgARAwIgBFDTMgA0HLADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxqCyADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgxpCwJAAkAgAy0ALEECaw4CAAEnCyADQTNqLQAAQQJxRQ0mIAMtAC5BAnENJiADQQA2AhwgAyABNgIUIANBphQ2AhAgA0ELNgIMQQAhAgxpCyADLQAyQSBxRQ0lIAMtAC5BAnENJSADQQA2AhwgAyABNgIUIANBvRM2AhAgA0EPNgIMQQAhAgxoC0EAIQACQCADKAI4IgJFDQAgAigCSCICRQ0AIAMgAhEAACEACyAARQRAQcEAIQIMTwsgAEEVRwRAIANBADYCHCADIAE2AhQgA0GmDzYCECADQRw2AgxBACECDGgLIANBygA2AhwgAyABNgIUIANBhRw2AhAgA0EVNgIMQQAhAgxnCyABIARHBEAgASECA0AgBCACIgFrQRBOBEAgAUEQaiEC/Qz/////////////////////IAH9AAAAIg1BB/1sIA39DODg4ODg4ODg4ODg4ODg4OD9bv0MX19fX19fX19fX19fX19fX/0mIA39DAkJCQkJCQkJCQkJCQkJCQn9I/1Q/VL9ZEF/c2giAEEQRg0BIAAgAWohAQwYCyABIARGBEBBxAAhAgxpCyABLQAAQcDBAGotAABBAUcNFyAEIAFBAWoiAkcNAAtBxAAhAgxnC0HEACECDGYLIAEgBEcEQANAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXEiAEEJRg0AIABBIEYNAAJAAkACQAJAIABB4wBrDhMAAwMDAwMDAwEDAwMDAwMDAwMCAwsgAUEBaiEBQTYhAgxSCyABQQFqIQFBNyECDFELIAFBAWohAUE4IQIMUAsMFQsgBCABQQFqIgFHDQALQTwhAgxmC0E8IQIMZQsgASAERgRAQcgAIQIMZQsgA0ESNgIIIAMgATYCBAJAAkACQAJAAkAgAy0ALEEBaw4EFAABAgkLIAMtADJBIHENA0HgASECDE8LAkAgAy8BMiIAQQhxRQ0AIAMtAChBAUcNACADLQAuQQhxRQ0CCyADIABB9/sDcUGABHI7ATIMCwsgAyADLwEyQRByOwEyDAQLIANBADYCBCADIAEgARAxIgAEQCADQcEANgIcIAMgADYCDCADIAFBAWo2AhRBACECDGYLIAFBAWohAQxYCyADQQA2AhwgAyABNgIUIANB9BM2AhAgA0EENgIMQQAhAgxkC0HHACECIAEgBEYNYyADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIABBwMUAai0AACABLQAAQSByRw0BIABBBkYNSiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAxkCyADQQA2AgAMBQsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkcNAyABQQFqIQEMBQsgBCABQQFqIgFHDQALQcUAIQIMZAtBxQAhAgxjCwsgA0EAOgAsDAELQQshAgxHC0E/IQIMRgsCQAJAA0AgAS0AACIAQSBHBEACQCAAQQprDgQDBQUDAAsgAEEsRg0DDAQLIAQgAUEBaiIBRw0AC0HGACECDGALIANBCDoALAwOCyADLQAoQQFHDQIgAy0ALkEIcQ0CIAMoAgQhACADQQA2AgQgAyAAIAEQMSIABEAgA0HCADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxfCyABQQFqIQEMUAtBOyECDEQLAkADQCABLQAAIgBBIEcgAEEJR3ENASAEIAFBAWoiAUcNAAtBwwAhAgxdCwtBPCECDEILAkACQCABIARHBEADQCABLQAAIgBBIEcEQCAAQQprDgQDBAQDBAsgBCABQQFqIgFHDQALQT8hAgxdC0E/IQIMXAsgAyADLwEyQSByOwEyDAoLIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQ1OIANBPjYCHCADIAE2AhQgAyAANgIMQQAhAgxaCwJAIAEgBEcEQANAIAEtAABBwMMAai0AACIAQQFHBEAgAEECRg0DDAwLIAQgAUEBaiIBRw0AC0E3IQIMWwtBNyECDFoLIAFBAWohAQwEC0E7IQIgBCABIgBGDVggBCABayADKAIAIgFqIQYgACABa0EFaiEHAkADQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEFRgRAQQchAQw/CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxZCyADQQA2AgAgACEBDAULQTohAiAEIAEiAEYNVyAEIAFrIAMoAgAiAWohBiAAIAFrQQhqIQcCQANAIAFBtMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQhGBEBBBSEBDD4LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFgLIANBADYCACAAIQEMBAtBOSECIAQgASIARg1WIAQgAWsgAygCACIBaiEGIAAgAWtBA2ohBwJAA0AgAUGwwQBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBA0YEQEEGIQEMPQsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMVwsgA0EANgIAIAAhAQwDCwJAA0AgAS0AACIAQSBHBEAgAEEKaw4EBwQEBwILIAQgAUEBaiIBRw0AC0E4IQIMVgsgAEEsRw0BIAFBAWohAEEBIQECQAJAAkACQAJAIAMtACxBBWsOBAMBAgQACyAAIQEMBAtBAiEBDAELQQQhAQsgA0EBOgAsIAMgAy8BMiABcjsBMiAAIQEMAQsgAyADLwEyQQhyOwEyIAAhAQtBPiECDDsLIANBADoALAtBOSECDDkLIAEgBEYEQEE2IQIMUgsCQAJAAkACQAJAIAEtAABBCmsOBAACAgECCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNAiADQTM2AhwgAyABNgIUIAMgADYCDEEAIQIMVQsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDAYLIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxUCyADLQAuQQFxBEBB3wEhAgw7CyADKAIEIQAgA0EANgIEIAMgACABEDEiAA0BDEkLQTQhAgw5CyADQTU2AhwgAyABNgIUIAMgADYCDEEAIQIMUQtBNSECDDcLIANBL2otAABBAXENACADQQA2AhwgAyABNgIUIANB6xY2AhAgA0EZNgIMQQAhAgxPC0EzIQIMNQsgASAERgRAQTIhAgxOCwJAIAEtAABBCkYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZIXNgIQIANBAzYCDEEAIQIMTgtBMiECDDQLIAEgBEYEQEExIQIMTQsCQCABLQAAIgBBCUYNACAAQSBGDQBBASECAkAgAy0ALEEFaw4EBgQFAA0LIAMgAy8BMkEIcjsBMgwMCyADLQAuQQFxRQ0BIAMtACxBCEcNACADQQA6ACwLQT0hAgwyCyADQQA2AhwgAyABNgIUIANBwhY2AhAgA0EKNgIMQQAhAgxKC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyDAYLIAEgBEYEQEEwIQIMRwsgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQQFxDQAgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMRgtBMCECDCwLIAFBAWohAUExIQIMKwsgASAERgRAQS8hAgxECyABLQAAIgBBCUcgAEEgR3FFBEAgAUEBaiEBIAMtAC5BAXENASADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgxEC0EBIQICQAJAAkACQAJAAkAgAy0ALEECaw4HBQQEAwECAAQLIAMgAy8BMkEIcjsBMgwDC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyC0EvIQIMKwsgA0EANgIcIAMgATYCFCADQYQTNgIQIANBCzYCDEEAIQIMQwtB4QEhAgwpCyABIARGBEBBLiECDEILIANBADYCBCADQRI2AgggAyABIAEQMSIADQELQS4hAgwnCyADQS02AhwgAyABNgIUIAMgADYCDEEAIQIMPwtBACEAAkAgAygCOCICRQ0AIAIoAkwiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HYADYCHCADIAE2AhQgA0GzGzYCECADQRU2AgxBACECDD4LQcwAIQIMJAsgA0EANgIcIAMgATYCFCADQbMONgIQIANBHTYCDEEAIQIMPAsgASAERgRAQc4AIQIMPAsgAS0AACIAQSBGDQIgAEE6Rg0BCyADQQA6ACxBCSECDCELIAMoAgQhACADQQA2AgQgAyAAIAEQMCIADQEMAgsgAy0ALkEBcQRAQd4BIQIMIAsgAygCBCEAIANBADYCBCADIAAgARAwIgBFDQIgA0EqNgIcIAMgADYCDCADIAFBAWo2AhRBACECDDgLIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMNwsgAUEBaiEBQcAAIQIMHQsgAUEBaiEBDCwLIAEgBEYEQEErIQIMNQsCQCABLQAAQQpGBEAgAUEBaiEBDAELIAMtAC5BwABxRQ0GCyADLQAyQYABcQRAQQAhAAJAIAMoAjgiAkUNACACKAJcIgJFDQAgAyACEQAAIQALIABFDRIgAEEVRgRAIANBBTYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDDYLIANBADYCHCADIAE2AhQgA0GQDjYCECADQRQ2AgxBACECDDULIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsgAA4WAgEABAQEBAQEBAQEBAQEBAQEBAQEAwQLIANBAToAMAsgAiACLwEAQcAAcjsBAAtBKyECDBgLIANBKTYCHCADIAE2AhQgA0GsGTYCECADQRU2AgxBACECDDALIANBADYCHCADIAE2AhQgA0HlCzYCECADQRE2AgxBACECDC8LIANBADYCHCADIAE2AhQgA0GlCzYCECADQQI2AgxBACECDC4LQQEhByADLwEyIgVBCHFFBEAgAykDIEIAUiEHCwJAIAMtADAEQEEBIQAgAy0AKUEFRg0BIAVBwABxRSAHcUUNAQsCQCADLQAoIgJBAkYEQEEBIQAgAy8BNCIGQeUARg0CQQAhACAFQcAAcQ0CIAZB5ABGDQIgBkHmAGtBAkkNAiAGQcwBRg0CIAZBsAJGDQIMAQtBACEAIAVBwABxDQELQQIhACAFQQhxDQAgBUGABHEEQAJAIAJBAUcNACADLQAuQQpxDQBBBSEADAILQQQhAAwBCyAFQSBxRQRAIAMQNkEAR0ECdCEADAELQQBBAyADKQMgUBshAAsgAEEBaw4FAgAHAQMEC0ERIQIMEwsgA0EBOgAxDCkLQQAhAgJAIAMoAjgiAEUNACAAKAIwIgBFDQAgAyAAEQAAIQILIAJFDSYgAkEVRgRAIANBAzYCHCADIAE2AhQgA0HSGzYCECADQRU2AgxBACECDCsLQQAhAiADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMDCoLIANBADYCHCADIAE2AhQgA0H5IDYCECADQQ82AgxBACECDCkLQQAhAAJAIAMoAjgiAkUNACACKAIwIgJFDQAgAyACEQAAIQALIAANAQtBDiECDA4LIABBFUYEQCADQQI2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwnCyADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMQQAhAgwmC0EqIQIMDAsgASAERwRAIANBCTYCCCADIAE2AgRBKSECDAwLQSYhAgwkCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMVARAQSUhAgwkCyADKAIEIQAgA0EANgIEIAMgACABIAynaiIBEDIiAEUNACADQQU2AhwgAyABNgIUIAMgADYCDEEAIQIMIwtBDyECDAkLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQTBrDjcXFgABAgMEBQYHFBQUFBQUFAgJCgsMDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUDg8QERITFAtCAiEKDBYLQgMhCgwVC0IEIQoMFAtCBSEKDBMLQgYhCgwSC0IHIQoMEQtCCCEKDBALQgkhCgwPC0IKIQoMDgtCCyEKDA0LQgwhCgwMC0INIQoMCwtCDiEKDAoLQg8hCgwJC0IKIQoMCAtCCyEKDAcLQgwhCgwGC0INIQoMBQtCDiEKDAQLQg8hCgwDCyADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMQQAhAgwhCyABIARGBEBBIiECDCELQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FRQAAQIDBAUGBxYWFhYWFhYICQoLDA0WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFg4PEBESExYLQgIhCgwUC0IDIQoMEwtCBCEKDBILQgUhCgwRC0IGIQoMEAtCByEKDA8LQgghCgwOC0IJIQoMDQtCCiEKDAwLQgshCgwLC0IMIQoMCgtCDSEKDAkLQg4hCgwIC0IPIQoMBwtCCiEKDAYLQgshCgwFC0IMIQoMBAtCDSEKDAMLQg4hCgwCC0IPIQoMAQtCASEKCyABQQFqIQEgAykDICILQv//////////D1gEQCADIAtCBIYgCoQ3AyAMAgsgA0EANgIcIAMgATYCFCADQbUJNgIQIANBDDYCDEEAIQIMHgtBJyECDAQLQSghAgwDCyADIAE6ACwgA0EANgIAIAdBAWohAUEMIQIMAgsgA0EANgIAIAZBAWohAUEKIQIMAQsgAUEBaiEBQQghAgwACwALQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBcLQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBYLQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBULQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDBQLQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDBMLQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBILQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBELQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBALQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDA8LQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDA4LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDA0LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDAwLQQAhAiADQQA2AhwgAyABNgIUIANBmRM2AhAgA0ELNgIMDAsLQQAhAiADQQA2AhwgAyABNgIUIANBnQk2AhAgA0ELNgIMDAoLQQAhAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMDAkLQQAhAiADQQA2AhwgAyABNgIUIANBsRA2AhAgA0EKNgIMDAgLQQAhAiADQQA2AhwgAyABNgIUIANBux02AhAgA0ECNgIMDAcLQQAhAiADQQA2AhwgAyABNgIUIANBlhY2AhAgA0ECNgIMDAYLQQAhAiADQQA2AhwgAyABNgIUIANB+Rg2AhAgA0ECNgIMDAULQQAhAiADQQA2AhwgAyABNgIUIANBxBg2AhAgA0ECNgIMDAQLIANBAjYCHCADIAE2AhQgA0GpHjYCECADQRY2AgxBACECDAMLQd4AIQIgASAERg0CIAlBCGohByADKAIAIQUCQAJAIAEgBEcEQCAFQZbIAGohCCAEIAVqIAFrIQYgBUF/c0EKaiIFIAFqIQADQCABLQAAIAgtAABHBEBBAiEIDAMLIAVFBEBBACEIIAAhAQwDCyAFQQFrIQUgCEEBaiEIIAQgAUEBaiIBRw0ACyAGIQUgBCEBCyAHQQE2AgAgAyAFNgIADAELIANBADYCACAHIAg2AgALIAcgATYCBCAJKAIMIQACQAJAIAkoAghBAWsOAgQBAAsgA0EANgIcIANBwh42AhAgA0EXNgIMIAMgAEEBajYCFEEAIQIMAwsgA0EANgIcIAMgADYCFCADQdceNgIQIANBCTYCDEEAIQIMAgsgASAERgRAQSghAgwCCyADQQk2AgggAyABNgIEQSchAgwBCyABIARGBEBBASECDAELA0ACQAJAAkAgAS0AAEEKaw4EAAEBAAELIAFBAWohAQwBCyABQQFqIQEgAy0ALkEgcQ0AQQAhAiADQQA2AhwgAyABNgIUIANBoSE2AhAgA0EFNgIMDAILQQEhAiABIARHDQALCyAJQRBqJAAgAkUEQCADKAIMIQAMAQsgAyACNgIcQQAhACADKAIEIgFFDQAgAyABIAQgAygCCBEBACIBRQ0AIAMgBDYCFCADIAE2AgwgASEACyAAC74CAQJ/IABBADoAACAAQeQAaiIBQQFrQQA6AAAgAEEAOgACIABBADoAASABQQNrQQA6AAAgAUECa0EAOgAAIABBADoAAyABQQRrQQA6AABBACAAa0EDcSIBIABqIgBBADYCAEHkACABa0F8cSICIABqIgFBBGtBADYCAAJAIAJBCUkNACAAQQA2AgggAEEANgIEIAFBCGtBADYCACABQQxrQQA2AgAgAkEZSQ0AIABBADYCGCAAQQA2AhQgAEEANgIQIABBADYCDCABQRBrQQA2AgAgAUEUa0EANgIAIAFBGGtBADYCACABQRxrQQA2AgAgAiAAQQRxQRhyIgJrIgFBIEkNACAAIAJqIQADQCAAQgA3AxggAEIANwMQIABCADcDCCAAQgA3AwAgAEEgaiEAIAFBIGsiAUEfSw0ACwsLVgEBfwJAIAAoAgwNAAJAAkACQAJAIAAtADEOAwEAAwILIAAoAjgiAUUNACABKAIwIgFFDQAgACABEQAAIgENAwtBAA8LAAsgAEHKGTYCEEEOIQELIAELGgAgACgCDEUEQCAAQd4fNgIQIABBFTYCDAsLFAAgACgCDEEVRgRAIABBADYCDAsLFAAgACgCDEEWRgRAIABBADYCDAsLBwAgACgCDAsHACAAKAIQCwkAIAAgATYCEAsHACAAKAIUCysAAkAgAEEnTw0AQv//////CSAArYhCAYNQDQAgAEECdEHQOGooAgAPCwALFwAgAEEvTwRAAAsgAEECdEHsOWooAgALvwkBAX9B9C0hAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HqLA8LQZgmDwtB7TEPC0GgNw8LQckpDwtBtCkPC0GWLQ8LQesrDwtBojUPC0HbNA8LQeApDwtB4yQPC0HVJA8LQe4kDwtB5iUPC0HKNA8LQdA3DwtBqjUPC0H1LA8LQfYmDwtBgiIPC0HyMw8LQb4oDwtB5zcPC0HNIQ8LQcAhDwtBuCUPC0HLJQ8LQZYkDwtBjzQPC0HNNQ8LQd0qDwtB7jMPC0GcNA8LQZ4xDwtB9DUPC0HlIg8LQa8lDwtBmTEPC0GyNg8LQfk2DwtBxDIPC0HdLA8LQYIxDwtBwTEPC0GNNw8LQckkDwtB7DYPC0HnKg8LQcgjDwtB4iEPC0HJNw8LQaUiDwtBlCIPC0HbNg8LQd41DwtBhiYPC0G8Kw8LQYsyDwtBoCMPC0H2MA8LQYAsDwtBiSsPC0GkJg8LQfIjDwtBgSgPC0GrMg8LQesnDwtBwjYPC0GiJA8LQc8qDwtB3CMPC0GHJw8LQeQ0DwtBtyIPC0GtMQ8LQdUiDwtBrzQPC0HeJg8LQdYyDwtB9DQPC0GBOA8LQfQ3DwtBkjYPC0GdJw8LQYIpDwtBjSMPC0HXMQ8LQb01DwtBtDcPC0HYMA8LQbYnDwtBmjgPC0GnKg8LQcQnDwtBriMPC0H1Ig8LAAtByiYhAQsgAQsXACAAIAAvAS5B/v8DcSABQQBHcjsBLgsaACAAIAAvAS5B/f8DcSABQQBHQQF0cjsBLgsaACAAIAAvAS5B+/8DcSABQQBHQQJ0cjsBLgsaACAAIAAvAS5B9/8DcSABQQBHQQN0cjsBLgsaACAAIAAvAS5B7/8DcSABQQBHQQR0cjsBLgsaACAAIAAvAS5B3/8DcSABQQBHQQV0cjsBLgsaACAAIAAvAS5Bv/8DcSABQQBHQQZ0cjsBLgsaACAAIAAvAS5B//4DcSABQQBHQQd0cjsBLgsaACAAIAAvAS5B//0DcSABQQBHQQh0cjsBLgsaACAAIAAvAS5B//sDcSABQQBHQQl0cjsBLgs+AQJ/AkAgACgCOCIDRQ0AIAMoAgQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeESNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAggiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfwRNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAgwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQewKNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfoeNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQcsQNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhgiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQbcfNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQb8VNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQf4INgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQYwdNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeYVNgIQQRghBAsgBAs4ACAAAn8gAC8BMkEUcUEURgRAQQEgAC0AKEEBRg0BGiAALwE0QeUARgwBCyAALQApQQVGCzoAMAtZAQJ/AkAgAC0AKEEBRg0AIAAvATQiAUHkAGtB5ABJDQAgAUHMAUYNACABQbACRg0AIAAvATIiAEHAAHENAEEBIQIgAEGIBHFBgARGDQAgAEEocUUhAgsgAguMAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQAgAC8BMiIBQQJxRQ0BDAILIAAvATIiAUEBcUUNAQtBASECIAAtAChBAUYNACAALwE0IgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNACABQcAAcQ0AQQAhAiABQYgEcUGABEYNACABQShxQQBHIQILIAILcwAgAEEQav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAP0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEwav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEgav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==",pir;Object.defineProperty(O6n,"exports",{get:a(()=>pir||(pir=rIs.from(nIs,"base64")),"get")})});var APe=I((Rsf,G6n)=>{"use strict";p();var B6n=["GET","HEAD","POST"],iIs=new Set(B6n),oIs=[101,204,205,304],F6n=[301,302,303,307,308],sIs=new Set(F6n),U6n=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"],aIs=new Set(U6n),Q6n=["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],cIs=["",...Q6n],lIs=new Set(Q6n),uIs=["follow","manual","error"],q6n=["GET","HEAD","OPTIONS","TRACE"],dIs=new Set(q6n),fIs=["navigate","same-origin","no-cors","cors"],pIs=["omit","same-origin","include"],hIs=["default","no-store","reload","no-cache","force-cache","only-if-cached"],mIs=["content-encoding","content-language","content-location","content-type","content-length"],gIs=["half"],j6n=["CONNECT","TRACE","TRACK"],AIs=new Set(j6n),H6n=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],yIs=new Set(H6n);G6n.exports={subresource:H6n,forbiddenMethods:j6n,requestBodyHeader:mIs,referrerPolicy:cIs,requestRedirect:uIs,requestMode:fIs,requestCredentials:pIs,requestCache:hIs,redirectStatus:F6n,corsSafeListedMethods:B6n,nullBodyStatus:oIs,safeMethods:q6n,badPorts:U6n,requestDuplex:gIs,subresourceSet:yIs,badPortsSet:aIs,redirectStatusSet:sIs,corsSafeListedMethodsSet:iIs,safeMethodsSet:dIs,forbiddenMethodsSet:AIs,referrerPolicyTokens:lIs}});var mir=I((Psf,$6n)=>{"use strict";p();var hir=Symbol.for("undici.globalOrigin.1");function EIs(){return globalThis[hir]}a(EIs,"getGlobalOrigin");function _Is(t){if(t===void 0){Object.defineProperty(globalThis,hir,{value:void 0,writable:!0,enumerable:!1,configurable:!1});return}let e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new TypeError(`Only http & https urls are allowed, received ${e.protocol}`);Object.defineProperty(globalThis,hir,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(_Is,"setGlobalOrigin");$6n.exports={getGlobalOrigin:EIs,setGlobalOrigin:_Is}});var Iot=I((Msf,V6n)=>{"use strict";p();var vIs=new TextDecoder;function CIs(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),vIs.decode(t))}a(CIs,"utf8DecodeBytes");V6n.exports={utf8DecodeBytes:CIs}});var GF=I((Bsf,K6n)=>{"use strict";p();var W6n=require("node:assert"),{utf8DecodeBytes:bIs}=Iot();function SIs(t,e,r){let n="";for(;r.positione)return String.fromCharCode.apply(null,t);let r="",n=0,o=65535;for(;ne&&(o=e-n),r+=String.fromCharCode.apply(null,t.subarray(n,n+=o));return r}a(wIs,"isomorphicDecode");var RIs=/[^\x00-\xFF]/;function kIs(t){return W6n(!RIs.test(t)),t}a(kIs,"isomorphicEncode");function PIs(t){return JSON.parse(bIs(t))}a(PIs,"parseJSONFromBytes");function DIs(t,e=!0,r=!0){return Y6n(t,e,r,z6n)}a(DIs,"removeASCIIWhitespace");function Y6n(t,e,r,n){let o=0,s=t.length-1;if(e)for(;o0&&n(t.charCodeAt(s));)s--;return o===0&&s===t.length-1?t:t.slice(o,s+1)}a(Y6n,"removeChars");function NIs(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return W6n(typeof e=="string"),e}a(NIs,"serializeJavascriptValueToJSONString");K6n.exports={collectASequenceOfCodePoints:SIs,collectASequenceOfCodePointsFast:TIs,forgivingBase64:xIs,isASCIIWhitespace:z6n,isomorphicDecode:wIs,isomorphicEncode:kIs,parseJSONFromBytes:PIs,removeASCIIWhitespace:DIs,removeChars:Y6n,serializeJavascriptValueToJSONString:NIs}});var Mw=I((Qsf,r9n)=>{"use strict";p();var wot=require("node:assert"),{forgivingBase64:MIs,collectASequenceOfCodePoints:gir,collectASequenceOfCodePointsFast:yPe,isomorphicDecode:OIs,removeASCIIWhitespace:LIs,removeChars:BIs}=GF(),FIs=new TextEncoder,EPe=/^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u,UIs=/[\u000A\u000D\u0009\u0020]/u,QIs=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;function qIs(t){wot(t.protocol==="data:");let e=X6n(t,!0);e=e.slice(5);let r={position:0},n=yPe(",",e,r),o=n.length;if(n=LIs(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=e9n(s);if(/;(?:\u0020*)base64$/ui.test(n)){let u=OIs(c);if(c=MIs(u),c==="failure")return"failure";n=n.slice(0,-6),n=n.replace(/(\u0020+)$/u,""),n=n.slice(0,-1)}n.startsWith(";")&&(n="text/plain"+n);let l=Air(n);return l==="failure"&&(l=Air("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(qIs,"dataURLProcessor");function X6n(t,e=!1){if(!e)return t.href;let r=t.href,n=t.hash.length,o=n===0?r:r.substring(0,r.length-n);return!n&&r.endsWith("#")?o.slice(0,-1):o}a(X6n,"URLSerializer");function e9n(t){let e=FIs.encode(t);return jIs(e)}a(e9n,"stringPercentDecode");function J6n(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(J6n,"isHexCharByte");function Z6n(t){return t>=48&&t<=57?t-48:(t&223)-55}a(Z6n,"hexByteToNumber");function jIs(t){let e=t.length,r=new Uint8Array(e),n=0,o=0;for(;o=t.length)return"failure";e.position++;let n=yPe(";",t,e);if(n=xot(n,!1,!0),n.length===0||!EPe.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionUIs.test(d),t,e);let l=gir(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.position=t.length)break;let u=null;if(t[e.position]==='"')u=t9n(t,e,!0),yPe(";",t,e);else if(u=yPe(";",t,e),u=xot(u,!1,!0),u.length===0)continue;l.length!==0&&EPe.test(l)&&(u.length===0||QIs.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(Air,"parseMIMEType");function t9n(t,e,r=!1){let n=e.position,o="";for(wot(t[e.position]==='"'),e.position++;o+=gir(c=>c!=='"'&&c!=="\\",t,e),!(e.position>=t.length);){let s=t[e.position];if(e.position++,s==="\\"){if(e.position>=t.length){o+="\\";break}o+=t[e.position],e.position++}else{wot(s==='"');break}}return r?o:t.slice(n,e.position)}a(t9n,"collectAnHTTPQuotedString");function HIs(t){wot(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",EPe.test(s)||(s=s.replace(/[\\"]/ug,"\\$&"),s='"'+s,s+='"'),n+=s;return n}a(HIs,"serializeAMimeType");function GIs(t){return t===13||t===10||t===9||t===32}a(GIs,"isHTTPWhiteSpace");function xot(t,e=!0,r=!0){return BIs(t,e,r,GIs)}a(xot,"removeHTTPWhitespace");function $Is(t){switch(t.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return t.subtype.endsWith("+json")?"application/json":t.subtype.endsWith("+xml")?"application/xml":""}a($Is,"minimizeSupportedMimeType");r9n.exports={dataURLProcessor:qIs,URLSerializer:X6n,stringPercentDecode:e9n,parseMIMEType:Air,collectAnHTTPQuotedString:t9n,serializeAMimeType:HIs,removeHTTPWhitespace:xot,minimizeSupportedMimeType:$Is,HTTP_TOKEN_CODEPOINTS:EPe}});var $F=I((Hsf,Eir)=>{"use strict";p();var n9n={__proto__:null,"node:crypto":a(()=>require("node:crypto"),"node:crypto"),"node:sqlite":a(()=>require("node:sqlite"),"node:sqlite"),"node:worker_threads":a(()=>require("node:worker_threads"),"node:worker_threads"),"node:zlib":a(()=>require("node:zlib"),"node:zlib")};function VIs(t){try{return n9n[t](),!0}catch(e){if(e.code!=="ERR_UNKNOWN_BUILTIN_MODULE"&&e.code!=="ERR_NO_CRYPTO")throw e;return!1}}a(VIs,"detectRuntimeFeatureByNodeModule");function WIs(t,e){return typeof n9n[t]()[e]<"u"}a(WIs,"detectRuntimeFeatureByExportedProperty");var i9n=["markAsUncloneable","zstd"],zIs={markAsUncloneable:["node:worker_threads","markAsUncloneable"],zstd:["node:zlib","createZstdDecompress"]},o9n=["crypto","sqlite"],YIs=[...o9n,...i9n];function KIs(t){if(o9n.includes(t))return VIs(`node:${t}`);if(i9n.includes(t)){let[e,r]=zIs[t];return WIs(e,r)}throw new TypeError(`unknown feature: ${t}`)}a(KIs,"detectRuntimeFeature");var yir=class{static{a(this,"RuntimeFeatures")}#e=new Map;clear(){this.#e.clear()}has(e){return this.#e.get(e)??this.#t(e)}set(e,r){if(YIs.includes(e)===!1)throw new TypeError(`unknown feature: ${e}`);this.#e.set(e,r)}#t(e){let r=KIs(e);return this.#e.set(e,r),r}},s9n=new yir;Eir.exports.runtimeFeatures=s9n;Eir.exports.default=s9n});var $A=I((Vsf,c9n)=>{"use strict";p();var JIs=require("node:assert"),{types:hp,inspect:ZIs}=require("node:util"),{runtimeFeatures:XIs}=$F(),_ir=1,vir=2,Rot=3,kot=4,Cir=5,Pot=6,bir=7,yT=8,a9n=Function.call.bind(Function.prototype[Symbol.hasInstance]),ut={converters:{},util:{},errors:{},is:{}};ut.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};ut.errors.conversionFailed=function(t){let e=t.types.length===1?"":" one of",r=`${t.argument} could not be converted to${e}: ${t.types.join(", ")}.`;return ut.errors.exception({header:t.prefix,message:r})};ut.errors.invalidArgument=function(t){return ut.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};ut.brandCheck=function(t,e){if(!a9n(e,t)){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}};ut.brandCheckMultiple=function(t){let e=t.map(r=>ut.util.MakeTypeAssertion(r));return r=>{if(e.every(n=>!n(r))){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}};ut.argumentLengthCheck=function({length:t},e,r){if(ta9n(t,e)};ut.util.Type=function(t){switch(typeof t){case"undefined":return _ir;case"boolean":return vir;case"string":return Rot;case"symbol":return kot;case"number":return Cir;case"bigint":return Pot;case"function":case"object":return t===null?bir:yT}};ut.util.Types={UNDEFINED:_ir,BOOLEAN:vir,STRING:Rot,SYMBOL:kot,NUMBER:Cir,BIGINT:Pot,NULL:bir,OBJECT:yT};ut.util.TypeValueToString=function(t){switch(ut.util.Type(t)){case _ir:return"Undefined";case vir:return"Boolean";case Rot:return"String";case kot:return"Symbol";case Cir:return"Number";case Pot:return"BigInt";case bir:return"Null";case yT:return"Object"}};ut.util.markAsUncloneable=XIs.has("markAsUncloneable")?require("node:worker_threads").markAsUncloneable:()=>{};ut.util.ConvertToInt=function(t,e,r,n){let o,s;e===64?(o=Math.pow(2,53)-1,r==="unsigned"?s=0:s=Math.pow(-2,53)+1):r==="unsigned"?(s=0,o=Math.pow(2,e)-1):(s=-Math.pow(2,e-1),o=Math.pow(2,e-1)-1);let c=Number(t);if(c===0&&(c=0),ut.util.HasFlag(n,ut.attributes.EnforceRange)){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw ut.errors.exception({header:"Integer conversion",message:`Could not convert ${ut.util.Stringify(t)} to an integer.`});if(c=ut.util.IntegerPart(c),co)throw ut.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&&ut.util.HasFlag(n,ut.attributes.Clamp)?(c=Math.min(Math.max(c,s),o),Math.floor(c)%2===0?c=Math.floor(c):c=Math.ceil(c),c):Number.isNaN(c)||c===0&&Object.is(0,c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY?0:(c=ut.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e-1)?c-Math.pow(2,e):c)};ut.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};ut.util.Stringify=function(t){switch(ut.util.Type(t)){case kot:return`Symbol(${t.description})`;case yT:return ZIs(t);case Rot:return`"${t}"`;case Pot:return`${t}n`;default:return`${t}`}};ut.util.IsResizableArrayBuffer=function(t){if(hp.isArrayBuffer(t))return t.resizable;if(hp.isSharedArrayBuffer(t))return t.growable;throw ut.errors.exception({header:"IsResizableArrayBuffer",message:`"${ut.util.Stringify(t)}" is not an array buffer.`})};ut.util.HasFlag=function(t,e){return typeof t=="number"&&(t&e)===e};ut.sequenceConverter=function(t){return(e,r,n,o)=>{if(ut.util.Type(e)!==yT)throw ut.errors.exception({header:r,message:`${n} (${ut.util.Stringify(e)}) is not iterable.`});let s=typeof o=="function"?o():e?.[Symbol.iterator]?.(),c=[],l=0;if(s===void 0||typeof s.next!="function")throw ut.errors.exception({header:r,message:`${n} is not iterable.`});for(;;){let{done:u,value:d}=s.next();if(u)break;c.push(t(d,r,`${n}[${l++}]`))}return c}};ut.recordConverter=function(t,e){return(r,n,o)=>{if(ut.util.Type(r)!==yT)throw ut.errors.exception({header:n,message:`${o} ("${ut.util.TypeValueToString(r)}") is not an Object.`});let s={};if(!hp.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=ut.util.Stringify(u),f=t(u,n,`Key ${d} in ${o}`),h=e(r[u],n,`${o}[${d}]`);s[f]=h}return s}let c=Reflect.ownKeys(r);for(let l of c)if(Reflect.getOwnPropertyDescriptor(r,l)?.enumerable){let d=t(l,n,o),f=e(r[l],n,o);s[d]=f}return s}};ut.interfaceConverter=function(t,e){return(r,n,o)=>{if(!t(r))throw ut.errors.exception({header:n,message:`Expected ${o} ("${ut.util.Stringify(r)}") to be an instance of ${e}.`});return r}};ut.dictionaryConverter=function(t){return t.sort((e,r)=>(e.key>r.key)-(e.key{let o={};if(e!=null&&ut.util.Type(e)!==yT)throw ut.errors.exception({header:r,message:`Expected ${e} to be one of: Null, Undefined, Object.`});for(let s of t){let{key:c,defaultValue:l,required:u,converter:d}=s;if(u===!0&&(e==null||!Object.hasOwn(e,c)))throw ut.errors.exception({header:r,message:`Missing required key "${c}".`});let f=e?.[c],h=l!==void 0;if(h&&f===void 0&&(f=l()),u||h||f!==void 0){if(f=d(f,r,`${n}.${c}`),s.allowedValues&&!s.allowedValues.includes(f))throw ut.errors.exception({header:r,message:`${f} is not an accepted type. Expected one of ${s.allowedValues.join(", ")}.`});o[c]=f}}return o}};ut.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};ut.is.USVString=function(t){return typeof t=="string"&&t.isWellFormed()};ut.is.ReadableStream=ut.util.MakeTypeAssertion(ReadableStream);ut.is.Blob=ut.util.MakeTypeAssertion(Blob);ut.is.URLSearchParams=ut.util.MakeTypeAssertion(URLSearchParams);ut.is.File=ut.util.MakeTypeAssertion(File);ut.is.URL=ut.util.MakeTypeAssertion(URL);ut.is.AbortSignal=ut.util.MakeTypeAssertion(AbortSignal);ut.is.MessagePort=ut.util.MakeTypeAssertion(MessagePort);ut.is.BufferSource=function(t){return hp.isArrayBuffer(t)||ArrayBuffer.isView(t)&&hp.isArrayBuffer(t.buffer)};ut.util.getCopyOfBytesHeldByBufferSource=function(t){let e=t,r=e,n=0,o=0;if(hp.isTypedArray(e)||hp.isDataView(e)?(r=e.buffer,n=e.byteOffset,o=e.byteLength):(JIs(hp.isAnyArrayBuffer(e)),o=e.byteLength),r.detached)return new Uint8Array(0);let s=new Uint8Array(o),c=new Uint8Array(r,n,o);return s.set(c),s};ut.converters.DOMString=function(t,e,r,n){if(t===null&&ut.util.HasFlag(n,ut.attributes.LegacyNullToEmptyString))return"";if(typeof t=="symbol")throw ut.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};ut.converters.ByteString=function(t,e,r){if(typeof t=="symbol")throw ut.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a ByteString.`});let n=String(t);for(let o=0;o255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${o} has a value of ${n.charCodeAt(o)} which is greater than 255.`);return n};ut.converters.USVString=function(t){return typeof t=="string"?t.toWellFormed():`${t}`.toWellFormed()};ut.converters.boolean=function(t){return!!t};ut.converters.any=function(t){return t};ut.converters["long long"]=function(t,e,r){return ut.util.ConvertToInt(t,64,"signed",0,e,r)};ut.converters["unsigned long long"]=function(t,e,r){return ut.util.ConvertToInt(t,64,"unsigned",0,e,r)};ut.converters["unsigned long"]=function(t,e,r){return ut.util.ConvertToInt(t,32,"unsigned",0,e,r)};ut.converters["unsigned short"]=function(t,e,r,n){return ut.util.ConvertToInt(t,16,"unsigned",n,e,r)};ut.converters.ArrayBuffer=function(t,e,r,n){if(ut.util.Type(t)!==yT||!hp.isArrayBuffer(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t))throw ut.errors.exception({header:e,message:`${r} cannot be a resizable ArrayBuffer.`});return t};ut.converters.SharedArrayBuffer=function(t,e,r,n){if(ut.util.Type(t)!==yT||!hp.isSharedArrayBuffer(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["SharedArrayBuffer"]});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t))throw ut.errors.exception({header:e,message:`${r} cannot be a resizable SharedArrayBuffer.`});return t};ut.converters.TypedArray=function(t,e,r,n,o){if(ut.util.Type(t)!==yT||!hp.isTypedArray(t)||t.constructor.name!==e.name)throw ut.errors.conversionFailed({prefix:r,argument:`${n} ("${ut.util.Stringify(t)}")`,types:[e.name]});if(!ut.util.HasFlag(o,ut.attributes.AllowShared)&&hp.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:r,message:`${n} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(o,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:r,message:`${n} cannot be a view on a resizable array buffer.`});return t};ut.converters.DataView=function(t,e,r,n){if(ut.util.Type(t)!==yT||!hp.isDataView(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["DataView"]});if(!ut.util.HasFlag(n,ut.attributes.AllowShared)&&hp.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};ut.converters.ArrayBufferView=function(t,e,r,n){if(ut.util.Type(t)!==yT||!hp.isArrayBufferView(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBufferView"]});if(!ut.util.HasFlag(n,ut.attributes.AllowShared)&&hp.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};ut.converters.BufferSource=function(t,e,r,n){if(hp.isArrayBuffer(t))return ut.converters.ArrayBuffer(t,e,r,n);if(hp.isArrayBufferView(t))return n&=~ut.attributes.AllowShared,ut.converters.ArrayBufferView(t,e,r,n);throw hp.isSharedArrayBuffer(t)?ut.errors.exception({header:e,message:`${r} cannot be a SharedArrayBuffer.`}):ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer","ArrayBufferView"]})};ut.converters.AllowSharedBufferSource=function(t,e,r,n){if(hp.isArrayBuffer(t))return ut.converters.ArrayBuffer(t,e,r,n);if(hp.isSharedArrayBuffer(t))return ut.converters.SharedArrayBuffer(t,e,r,n);if(hp.isArrayBufferView(t))return n|=ut.attributes.AllowShared,ut.converters.ArrayBufferView(t,e,r,n);throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer","SharedArrayBuffer","ArrayBufferView"]})};ut.converters["sequence"]=ut.sequenceConverter(ut.converters.ByteString);ut.converters["sequence>"]=ut.sequenceConverter(ut.converters["sequence"]);ut.converters["record"]=ut.recordConverter(ut.converters.ByteString,ut.converters.ByteString);ut.converters.Blob=ut.interfaceConverter(ut.is.Blob,"Blob");ut.converters.AbortSignal=ut.interfaceConverter(ut.is.AbortSignal,"AbortSignal");ut.converters.EventHandlerNonNull=function(t){return ut.util.Type(t)!==yT?null:typeof t=="function"?t:()=>{}};ut.attributes={Clamp:1,EnforceRange:2,AllowShared:4,AllowResizable:8,LegacyNullToEmptyString:16};c9n.exports={webidl:ut}});var ET=I((zsf,C9n)=>{"use strict";p();var{Transform:exs}=require("node:stream"),l9n=require("node:zlib"),{redirectStatusSet:txs,referrerPolicyTokens:rxs,badPortsSet:nxs}=APe(),{getGlobalOrigin:u9n}=mir(),{collectAnHTTPQuotedString:ixs,parseMIMEType:oxs}=Mw(),{performance:sxs}=require("node:perf_hooks"),{ReadableStreamFrom:axs,isValidHTTPToken:d9n,normalizedMethodRecordsBase:cxs}=Po(),vPe=require("node:assert"),{isUint8Array:lxs}=require("node:util/types"),{webidl:Uj}=$A(),{isomorphicEncode:Sir,collectASequenceOfCodePoints:bZ,removeChars:uxs}=GF();function f9n(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(f9n,"responseURL");function dxs(t,e){if(!txs.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&h9n(r)&&(p9n(r)||(r=fxs(r)),r=new URL(r,f9n(t))),r&&!r.hash&&(r.hash=e),r}a(dxs,"responseLocationURL");function p9n(t){for(let e=0;e126||r<32)return!1}return!0}a(p9n,"isValidEncodedURL");function fxs(t){return Buffer.from(t,"binary").toString("utf8")}a(fxs,"normalizeBinaryStringToUtf8");function TZ(t){return t.urlList[t.urlList.length-1]}a(TZ,"requestCurrentURL");function pxs(t){let e=TZ(t);return _9n(e)&&nxs.has(e.port)?"blocked":"allowed"}a(pxs,"requestBadPort");function hxs(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(hxs,"isErrorLike");function mxs(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(mxs,"isValidReasonPhrase");var gxs=d9n;function h9n(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` -`)||t.includes("\r")||t.includes("\0"))===!1}a(h9n,"isValidHeaderValue");function Axs(t){let e=(t.headersList.get("referrer-policy",!0)??"").split(","),r="";if(e.length)for(let n=e.length;n!==0;n--){let o=e[n-1].trim();if(rxs.has(o)){r=o;break}}return r}a(Axs,"parseReferrerPolicy");function yxs(t,e){let r=Axs(e);r!==""&&(t.referrerPolicy=r)}a(yxs,"setRequestReferrerPolicyOnRedirect");function Exs(){return"allowed"}a(Exs,"crossOriginResourcePolicyCheck");function _xs(){return"success"}a(_xs,"corsCheck");function vxs(){return"success"}a(vxs,"TAOCheck");function Cxs(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(Cxs,"appendFetchMetadata");function bxs(t){let e=t.origin;if(!(e==="client"||e===void 0)){if(t.responseTainting==="cors"||t.mode==="websocket")t.headersList.append("origin",e,!0);else if(t.method!=="GET"&&t.method!=="HEAD"){switch(t.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":t.origin&&Iir(t.origin)&&!Iir(TZ(t))&&(e=null);break;case"same-origin":_Pe(t,TZ(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(bxs,"appendRequestOriginHeader");function ipe(t,e){return t}a(ipe,"coarsenTime");function Sxs(t,e,r){return!t?.startTime||t.startTime4096&&(n=o),e){case"no-referrer":return"no-referrer";case"origin":return o??Tir(r,!0);case"unsafe-url":return n;case"strict-origin":{let s=TZ(t);return SZ(n)&&!SZ(s)?"no-referrer":o}case"strict-origin-when-cross-origin":{let s=TZ(t);return _Pe(n,s)?n:SZ(n)&&!SZ(s)?"no-referrer":o}case"same-origin":return _Pe(t,n)?n:"no-referrer";case"origin-when-cross-origin":return _Pe(t,n)?n:o;case"no-referrer-when-downgrade":{let s=TZ(t);return SZ(n)&&!SZ(s)?"no-referrer":n}}}a(wxs,"determineRequestsReferrer");function Tir(t,e=!1){return vPe(Uj.is.URL(t)),t=new URL(t),E9n(t)?"no-referrer":(t.username="",t.password="",t.hash="",e===!0&&(t.pathname="",t.search=""),t)}a(Tir,"stripURLForReferrer");var Rxs=RegExp.prototype.test.bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/),kxs=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function g9n(t){return t.includes(":")?(t[0]==="["&&t[t.length-1]==="]"&&(t=t.slice(1,-1)),kxs(t)):Rxs(t)}a(g9n,"isOriginIPPotentiallyTrustworthy");function Pxs(t){return t==null||t==="null"?!1:(t=new URL(t),!!(t.protocol==="https:"||t.protocol==="wss:"||g9n(t.hostname)||t.hostname==="localhost"||t.hostname==="localhost."||t.hostname.endsWith(".localhost")||t.hostname.endsWith(".localhost.")||t.protocol==="file:"))}a(Pxs,"isOriginPotentiallyTrustworthy");function SZ(t){return Uj.is.URL(t)?t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="blob:"?!0:Pxs(t.origin):!1}a(SZ,"isURLPotentiallyTrustworthy");function Dxs(t){}a(Dxs,"tryUpgradeRequestToAPotentiallyTrustworthyURL");function _Pe(t,e){return t.origin===e.origin&&t.origin==="null"||t.protocol===e.protocol&&t.hostname===e.hostname&&t.port===e.port}a(_Pe,"sameOrigin");function Nxs(t){return t.controller.state==="aborted"}a(Nxs,"isAborted");function Mxs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(Mxs,"isCancelled");function Oxs(t){return cxs[t.toLowerCase()]??t}a(Oxs,"normalizeMethod");var Lxs=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function A9n(t,e,r=0,n=1){class o{static{a(this,"FastIterableIterator")}#e;#t;#r;constructor(c,l){this.#e=c,this.#t=l,this.#r=0}next(){if(typeof this!="object"||this===null||!(#e in this))throw new TypeError(`'next' called on an object that does not implement interface ${t} Iterator.`);let c=this.#r,l=e(this.#e),u=l.length;if(c>=u)return{value:void 0,done:!0};let{[r]:d,[n]:f}=l[c];this.#r=c+1;let h;switch(this.#t){case"key":h=d;break;case"value":h=f;break;case"key+value":h=[d,f];break}return{value:h,done:!1}}}return delete o.prototype.constructor,Object.setPrototypeOf(o.prototype,Lxs),Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${t} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(s,c){return new o(s,c)}}a(A9n,"createIterator");function Bxs(t,e,r,n=0,o=1){let s=A9n(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Uj.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Uj.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Uj.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(Uj.brandCheck(this,e),Uj.argumentLengthCheck(arguments,1,`${t}.forEach`),typeof u!="function")throw new TypeError(`Failed to execute 'forEach' on '${t}': parameter 1 is not of type 'Function'.`);for(let{0:f,1:h}of s(this,"key+value"))u.call(d,h,f,this)},"forEach")}};return Object.defineProperties(e.prototype,{...c,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:c.entries.value}})}a(Bxs,"iteratorMixin");function Fxs(t,e,r){let n=e,o=r;try{let s=t.stream.getReader();y9n(s,n,o)}catch(s){o(s)}}a(Fxs,"fullyReadBody");function Uxs(t){try{t.close(),t.byobRequest?.respond(0)}catch(e){if(!e.message.includes("Controller is already closed")&&!e.message.includes("ReadableStream is already closed"))throw e}}a(Uxs,"readableStreamClose");async function y9n(t,e,r){try{let n=[],o=0;do{let{done:s,value:c}=await t.read();if(s){e(Buffer.concat(n,o));return}if(!lxs(c)){r(new TypeError("Received non-Uint8Array chunk"));return}n.push(c),o+=c.length}while(!0)}catch(n){r(n)}}a(y9n,"readAllBytes");function E9n(t){vPe("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(E9n,"urlIsLocal");function Iir(t){return typeof t=="string"&&t[5]===":"&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&t[4]==="s"||t.protocol==="https:"}a(Iir,"urlHasHttpsScheme");function _9n(t){vPe("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(_9n,"urlIsHttpHttpsScheme");function Qxs(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&bZ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&bZ(u=>u===" "||u===" ",r,n);let o=bZ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&bZ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&bZ(u=>u===" "||u===" ",r,n);let c=bZ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),l=c.length?Number(c):null;return n.positionl?"failure":{rangeStartValue:s,rangeEndValue:l}}a(Qxs,"simpleRangeHeaderValue");function qxs(t,e,r){let n="bytes ";return n+=Sir(`${t}`),n+="-",n+=Sir(`${e}`),n+="/",n+=Sir(`${r}`),n}a(qxs,"buildContentRange");var xir=class extends exs{static{a(this,"InflateStream")}#e;constructor(e){super(),this.#e=e}_transform(e,r,n){if(!this._inflateStream){if(e.length===0){n();return}this._inflateStream=(e[0]&15)===8?l9n.createInflate(this.#e):l9n.createInflateRaw(this.#e),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",o=>this.destroy(o))}this._inflateStream.write(e,r,n)}_final(e){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),e()}};function jxs(t){return new xir(t)}a(jxs,"createInflate");function Hxs(t){let e=null,r=null,n=null,o=v9n("content-type",t);if(o===null)return"failure";for(let s of o){let c=oxs(s);c==="failure"||c.essence==="*/*"||(n=c,n.essence!==r?(e=null,n.parameters.has("charset")&&(e=n.parameters.get("charset")),r=n.essence):!n.parameters.has("charset")&&e!==null&&n.parameters.set("charset",e))}return n??"failure"}a(Hxs,"extractMimeType");function Gxs(t){let e=t,r={position:0},n=[],o="";for(;r.positions!=='"'&&s!==",",e,r),r.positions===9||s===32),n.push(o),o=""}return n}a(Gxs,"gettingDecodingSplitting");function v9n(t,e){let r=e.get(t,!0);return r===null?null:Gxs(r)}a(v9n,"getDecodeSplit");function $xs(t){return!1}a($xs,"hasAuthenticationEntry");function Vxs(t){return!!(t.username||t.password)}a(Vxs,"includesCredentials");function Wxs(t){return t!=null&&t!=="client"&&t!=="no-traversable"}a(Wxs,"isTraversableNavigable");var wir=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return u9n()}get origin(){return this.baseUrl?.origin}policyContainer=m9n()},Rir=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new wir},zxs=new Rir;C9n.exports={isAborted:Nxs,isCancelled:Mxs,isValidEncodedURL:p9n,ReadableStreamFrom:axs,tryUpgradeRequestToAPotentiallyTrustworthyURL:Dxs,clampAndCoarsenConnectionTimingInfo:Sxs,coarsenedSharedCurrentTime:Txs,determineRequestsReferrer:wxs,makePolicyContainer:m9n,clonePolicyContainer:xxs,appendFetchMetadata:Cxs,appendRequestOriginHeader:bxs,TAOCheck:vxs,corsCheck:_xs,crossOriginResourcePolicyCheck:Exs,createOpaqueTimingInfo:Ixs,setRequestReferrerPolicyOnRedirect:yxs,isValidHTTPToken:d9n,requestBadPort:pxs,requestCurrentURL:TZ,responseURL:f9n,responseLocationURL:dxs,isURLPotentiallyTrustworthy:SZ,isValidReasonPhrase:mxs,sameOrigin:_Pe,normalizeMethod:Oxs,iteratorMixin:Bxs,createIterator:A9n,isValidHeaderName:gxs,isValidHeaderValue:h9n,isErrorLike:hxs,fullyReadBody:Fxs,readableStreamClose:Uxs,urlIsLocal:E9n,urlHasHttpsScheme:Iir,urlIsHttpHttpsScheme:_9n,readAllBytes:y9n,simpleRangeHeaderValue:Qxs,buildContentRange:qxs,createInflate:jxs,extractMimeType:Hxs,getDecodeSplit:v9n,environmentSettingsObject:zxs,isOriginIPPotentiallyTrustworthy:g9n,hasAuthenticationEntry:$xs,includesCredentials:Vxs,isTraversableNavigable:Wxs}});var Dot=I((Jsf,S9n)=>{"use strict";p();var{iteratorMixin:Yxs}=ET(),{kEnumerableProperty:ope}=Po(),{webidl:Rc}=$A(),b9n=require("node:util"),VF=class t{static{a(this,"FormData")}#e=[];constructor(e=void 0){if(Rc.util.markAsUncloneable(this),e!==void 0)throw Rc.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(e,r,n=void 0){Rc.brandCheck(this,t);let o="FormData.append";Rc.argumentLengthCheck(arguments,2,o),e=Rc.converters.USVString(e),arguments.length===3||Rc.is.Blob(r)?(r=Rc.converters.Blob(r,o,"value"),n!==void 0&&(n=Rc.converters.USVString(n))):r=Rc.converters.USVString(r);let s=kir(e,r,n);this.#e.push(s)}delete(e){Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.delete"),e=Rc.converters.USVString(e),this.#e=this.#e.filter(n=>n.name!==e)}get(e){Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.get"),e=Rc.converters.USVString(e);let n=this.#e.findIndex(o=>o.name===e);return n===-1?null:this.#e[n].value}getAll(e){return Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.getAll"),e=Rc.converters.USVString(e),this.#e.filter(n=>n.name===e).map(n=>n.value)}has(e){return Rc.brandCheck(this,t),Rc.argumentLengthCheck(arguments,1,"FormData.has"),e=Rc.converters.USVString(e),this.#e.findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Rc.brandCheck(this,t);let o="FormData.set";Rc.argumentLengthCheck(arguments,2,o),e=Rc.converters.USVString(e),arguments.length===3||Rc.is.Blob(r)?(r=Rc.converters.Blob(r,o,"value"),n!==void 0&&(n=Rc.converters.USVString(n))):r=Rc.converters.USVString(r);let s=kir(e,r,n),c=this.#e.findIndex(l=>l.name===e);c!==-1?this.#e=[...this.#e.slice(0,c),s,...this.#e.slice(c+1).filter(l=>l.name!==e)]:this.#e.push(s)}[b9n.inspect.custom](e,r){let n=this.#e.reduce((s,c)=>(s[c.name]?Array.isArray(s[c.name])?s[c.name].push(c.value):s[c.name]=[s[c.name],c.value]:s[c.name]=c.value,s),{__proto__:null});r.depth??=e,r.colors??=!0;let o=b9n.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}static getFormDataState(e){return e.#e}static setFormDataState(e,r){e.#e=r}},{getFormDataState:Kxs,setFormDataState:Jxs}=VF;Reflect.deleteProperty(VF,"getFormDataState");Reflect.deleteProperty(VF,"setFormDataState");Yxs("FormData",VF,Kxs,"name","value");Object.defineProperties(VF.prototype,{append:ope,delete:ope,get:ope,getAll:ope,has:ope,set:ope,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function kir(t,e,r){if(typeof e!="string"){if(Rc.is.File(e)||(e=new File([e],"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=new File([e],r,n)}}return{name:t,value:e}}a(kir,"makeEntry");Rc.is.FormData=Rc.util.MakeTypeAssertion(VF);S9n.exports={FormData:VF,makeEntry:kir,setFormDataState:Jxs}});var x9n=I((eaf,I9n)=>{"use strict";p();var{bufferToLowerCasedHeaderName:Zxs}=Po(),{HTTP_TOKEN_CODEPOINTS:Xxs}=Mw(),{makeEntry:ews}=Dot(),{webidl:Pir}=$A(),Dir=require("node:assert"),{isomorphicDecode:T9n}=GF(),tws=Buffer.from("--"),Nir=new TextDecoder,rws=new TextDecoder("utf-8",{ignoreBOM:!0});function nws(t){for(let e=0;e70)return!1;for(let r=0;r=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||n===39||n===45||n===95))return!1}return!0}a(iws,"validateBoundary");function ows(t,e){Dir(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)throw pb("missing boundary in content-type header");let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0},c=t.indexOf(n);if(c===-1)throw pb("no boundary found in multipart body");for(s.position=c;;){if(t.subarray(s.position,s.position+n.length).equals(n))s.position+=n.length;else throw pb("expected a value starting with -- and the boundary");if(cws(t,tws,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)throw pb("expected CRLF");s.position+=2;let l=aws(t,s),{name:u,filename:d,contentType:f,encoding:h}=l;s.position+=2;let m;{let A=t.indexOf(n.subarray(2),s.position);if(A===-1)throw pb("expected boundary after body");m=t.subarray(s.position,A-4),s.position+=m.length,h==="base64"&&(m=Buffer.from(m.toString(),"base64"))}if(t[s.position]!==13||t[s.position+1]!==10)throw pb("expected CRLF");s.position+=2;let g;d!==null?(f??="text/plain",nws(f)||(f=""),g=new File([m],d,{type:f})):g=rws.decode(Buffer.from(m)),Dir(Pir.is.USVString(u)),Dir(typeof g=="string"&&Pir.is.USVString(g)||Pir.is.File(g)),o.push(ews(u,g,d))}}a(ows,"multipartFormDataParser");function sws(t,e){t[e.position]===59&&e.position++,Ow(c=>c===32||c===9,t,e);let r=Ow(c=>Oir(c)&&c!==61&&c!==42,t,e);if(r.length===0)return null;let n=r.toString("ascii").toLowerCase(),o=t[e.position]===42;if(o&&e.position++,t[e.position]!==61)return null;e.position++,Ow(c=>c===32||c===9,t,e);let s;if(o){let c=Ow(l=>l!==32&&l!==13&&l!==10&&l!==59,t,e);if(c[0]!==117&&c[0]!==85||c[1]!==116&&c[1]!==84||c[2]!==102&&c[2]!==70||c[3]!==45||c[4]!==56)throw pb("unknown encoding, expected utf-8''");s=decodeURIComponent(Nir.decode(c.subarray(7)))}else if(t[e.position]===34){e.position++;let c=Ow(l=>l!==10&&l!==13&&l!==34,t,e);if(t[e.position]!==34)throw pb("Closing quote not found");e.position++,s=Nir.decode(c).replace(/%0A/ig,` -`).replace(/%0D/ig,"\r").replace(/%22/g,'"')}else{let c=Ow(l=>Oir(l)&&l!==59,t,e);s=Nir.decode(c)}return{name:n,value:s,extended:o}}a(sws,"parseContentDispositionAttribute");function aws(t,e){let r=null,n=null,o=null,s=null;for(;;){if(t[e.position]===13&&t[e.position+1]===10){if(r===null)throw pb("header name is null");return{name:r,filename:n,contentType:o,encoding:s}}let c=Ow(l=>l!==10&&l!==13&&l!==58,t,e);if(c=Mir(c,!0,!0,l=>l===9||l===32),!Xxs.test(c.toString()))throw pb("header name does not match the field-name token production");if(t[e.position]!==58)throw pb("expected :");switch(e.position++,Ow(l=>l===32||l===9,t,e),Zxs(c)){case"content-disposition":{r=n=null;let l=!1;if(Ow(d=>Oir(d),t,e).toString("ascii").toLowerCase()!=="form-data")throw pb("expected form-data for content-disposition header");for(;e.positionu!==10&&u!==13,t,e);l=Mir(l,!1,!0,u=>u===9||u===32),o=T9n(l);break}case"content-transfer-encoding":{let l=Ow(u=>u!==10&&u!==13,t,e);l=Mir(l,!1,!0,u=>u===9||u===32),s=T9n(l);break}default:Ow(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13||t[e.position+1]!==10)throw pb("expected CRLF");e.position+=2}}a(aws,"parseMultipartFormDataHeaders");function Ow(t,e,r){let n=r.position;for(;n0&&n(t[s]);)s--;return o===0&&s===t.length-1?t:t.subarray(o,s+1)}a(Mir,"removeChars");function cws(t,e,r){if(t.length{"use strict";p();function dws(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(dws,"createDeferredPromise");w9n.exports={createDeferredPromise:dws}});var ape=I((saf,N9n)=>{"use strict";p();var Fir=Po(),{ReadableStreamFrom:fws,readableStreamClose:pws,fullyReadBody:hws,extractMimeType:mws}=ET(),{FormData:R9n,setFormDataState:gws}=Dot(),{webidl:b2}=$A(),Lir=require("node:assert"),{isErrored:Bir,isDisturbed:Aws}=require("node:stream"),{isUint8Array:yws}=require("node:util/types"),{serializeAMimeType:Ews}=Mw(),{multipartFormDataParser:_ws}=x9n(),{createDeferredPromise:vws}=CPe(),{parseJSONFromBytes:Cws}=GF(),{utf8DecodeBytes:bws}=Iot(),{runtimeFeatures:Sws}=$F(),Tws=Sws.has("crypto")?require("node:crypto").randomInt:t=>Math.floor(Math.random()*t),Not=new TextEncoder;function Iws(){}a(Iws,"noop");var xws=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!Aws(e)&&!Bir(e)&&e.cancel("Response object has been garbage collected").catch(Iws)});function P9n(t,e=!1){let r=null,n=null;b2.is.ReadableStream(t)?r=t:b2.is.Blob(t)?r=t.stream():r=new ReadableStream({pull(){},start(d){n=d},cancel(){},type:"bytes"}),Lir(b2.is.ReadableStream(r));let o=null,s=null,c=null,l=null;if(typeof t=="string")s=t,l="text/plain;charset=UTF-8";else if(b2.is.URLSearchParams(t))s=t.toString(),l="application/x-www-form-urlencoded;charset=UTF-8";else if(b2.is.BufferSource(t))s=b2.util.getCopyOfBytesHeldByBufferSource(t);else if(b2.is.FormData(t)){let d=`----formdata-undici-0${`${Tws(1e11)}`.padStart(11,"0")}`,f=`--${d}\r +`,s};Oot.publicKeyToOpenSSH=function(t,e){var r="ssh-rsa";e=e||"";var n=pm.util.createBuffer();return hpe(n,r),M5(n,t.e),M5(n,t.n),r+" "+pm.util.encode64(n.bytes())+" "+e};Oot.privateKeyToOpenSSH=function(t,e){return e?pm.pki.encryptRsaPrivateKey(t,e,{legacy:!0,algorithm:"aes128"}):pm.pki.privateKeyToPem(t)};Oot.getPublicKeyFingerprint=function(t,e){e=e||{};var r=e.md||pm.md.md5.create(),n="ssh-rsa",o=pm.util.createBuffer();hpe(o,n),M5(o,t.e),M5(o,t.n),r.start(),r.update(o.getBytes());var s=r.digest();if(e.encoding==="hex"){var c=s.toHex();return e.delimiter?c.match(/.{2}/g).join(e.delimiter):c}else{if(e.encoding==="binary")return s.getBytes();if(e.encoding)throw new Error('Unknown encoding "'+e.encoding+'".')}return s};function M5(t,e){var r=e.toString(16);r[0]>="8"&&(r="00"+r);var n=pm.util.hexToBytes(r);t.putInt32(n.length),t.putBytes(n)}a(M5,"_addBigIntegerToBuffer");function hpe(t,e){t.putInt32(e.length),t.putString(e)}a(hpe,"_addStringToBuffer");function Mot(){for(var t=pm.md.sha1.create(),e=arguments.length,r=0;r{p();w6n.exports=ms();Uj();z8n();R2();oot();EPe();f6n();rpe();g6n();_6n();C6n();_nr();got();_Z();hnr();bnr();T6n();Tnr();gnr();snr();bot();Ow();lnr();x6n();Pnr();uc()});var D6n=I(wZ=>{"use strict";p();Object.defineProperty(wZ,"__esModule",{value:!0});wZ.convert=wZ.Format=void 0;var PPe=R6n(),zj;(function(t){t.der="der",t.pem="pem",t.txt="txt",t.asn1="asn1",t.x509="x509",t.fingerprint="fingerprint"})(zj=wZ.Format||(wZ.Format={}));function k6n(t){var e=PPe.pki.pemToDer(t),r=PPe.asn1,n=r.fromDer(e.data.toString("binary")).value[0].value,o=n[0],s=o.tagClass===r.Class.CONTEXT_SPECIFIC&&o.type===0&&o.constructed,c=n.slice(s);return{serial:c[0],issuer:c[2],valid:c[3],subject:c[4]}}a(k6n,"myASN");function MIs(t){var e=k6n(t),r=e.subject.value.map(function(o){return o.value[0].value[1].value}).join("/"),n=e.valid.value.map(function(o){return o.value}).join(" - ");return["Subject ".concat(r),"Valid ".concat(n),String(t)].join(` +`)}a(MIs,"txtFormat");function P6n(t,e){switch(e){case zj.der:return PPe.pki.pemToDer(t);case zj.pem:return t;case zj.txt:return MIs(t);case zj.asn1:return k6n(t);case zj.fingerprint:var r=PPe.md.sha1.create(),n=P6n(t,zj.der);return r.update(n.getBytes()),r.digest().toHex();case zj.x509:return PPe.pki.certificateFromPem(t);default:throw new Error("unknown format ".concat(e))}}a(P6n,"convert");wZ.convert=P6n});var F6n=I(hb=>{"use strict";p();var Yj=hb&&hb.__assign||function(){return Yj=Object.assign||function(t){for(var e,r=1,n=arguments.length;r"u"&&(s.ca=e),r.call(this,s)},"newAgent");return n.prototype=r.prototype,n})(znr.Agent),(0,M6n.setGlobalDispatcher)(new M6n.Agent({connect:{ca:e}}))}},"addToGlobalAgent");hb.addToGlobalAgent=LIs});var U6n=I((Lcf,Ynr)=>{p();function BIs(){let{X509Certificate:t}=require("crypto"),{join:e}=require("path");var r=typeof __webpack_require__=="function"?__non_webpack_require__:require;let n=process.arch==="arm64"?"crypt32-arm64.node":"crypt32.node",o=r(e(__dirname,n)),s=[],c=new o.Crypt32;try{let l;for(;l=c.next();){let u=new t(l);s.push(u.toString())}}finally{c.done()}return Array.from(new Set(s))}a(BIs,"all");process.platform!=="win32"?Ynr.exports.all=()=>[]:Ynr.exports.all=BIs});var al=I((Hcf,$6n)=>{"use strict";p();$6n.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kHTTP2InitialWindowSize:Symbol("http2 initial window size"),kHTTP2ConnectionWindowSize:Symbol("http2 connection window size"),kEnableConnectProtocol:Symbol("http2session connect protocol"),kRemoteSettings:Symbol("http2session remote settings"),kHTTP2Stream:Symbol("http2session client stream"),kPingInterval:Symbol("ping interval"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent"),kSocks5ProxyAgent:Symbol("socks5 proxy agent")}});var uir=I(($cf,Y6n)=>{"use strict";p();var gpe=0,iir=1e3,oir=(iir>>1)-1,Kj,sir=Symbol("kFastTimer"),ZF=[],air=-2,cir=-1,W6n=0,V6n=1;function lir(){gpe+=oir;let t=0,e=ZF.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=cir,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===cir?(r._state=air,--e!==0&&(ZF[t]=ZF[e])):++t}ZF.length=e,ZF.length!==0&&z6n()}a(lir,"onTick");function z6n(){Kj?.refresh?Kj.refresh():(clearTimeout(Kj),Kj=setTimeout(lir,oir),Kj?.unref())}a(z6n,"refreshTimeout");var qot=class{static{a(this,"FastTimer")}[sir]=!0;_state=air;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===air&&ZF.push(this),(!Kj||ZF.length===1)&&z6n(),this._state=W6n}clear(){this._state=cir,this._idleStart=-1}};Y6n.exports={setTimeout(t,e,r){return e<=iir?setTimeout(t,e,r):new qot(t,e,r)},clearTimeout(t){t[sir]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new qot(t,e,r)},clearFastTimeout(t){t.clear()},now(){return gpe},tick(t=0){gpe+=t-iir+1,lir(),lir()},reset(){gpe=0,ZF.length=0,clearTimeout(Kj),Kj=null},kFastTimer:sir}});var so=I((zcf,_9n)=>{"use strict";p();var K6n=Symbol.for("undici.error.UND_ERR"),pd=class extends Error{static{a(this,"UndiciError")}constructor(e,r){super(e,r),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&e[K6n]===!0}get[K6n](){return!0}},J6n=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),dir=class extends pd{static{a(this,"ConnectTimeoutError")}constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[J6n]===!0}get[J6n](){return!0}},Z6n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),fir=class extends pd{static{a(this,"HeadersTimeoutError")}constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[Z6n]===!0}get[Z6n](){return!0}},X6n=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),pir=class extends pd{static{a(this,"HeadersOverflowError")}constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&e[X6n]===!0}get[X6n](){return!0}},e9n=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),hir=class extends pd{static{a(this,"BodyTimeoutError")}constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[e9n]===!0}get[e9n](){return!0}},t9n=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),mir=class extends pd{static{a(this,"InvalidArgumentError")}constructor(e){super(e),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](e){return e&&e[t9n]===!0}get[t9n](){return!0}},r9n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),gir=class extends pd{static{a(this,"InvalidReturnValueError")}constructor(e){super(e),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](e){return e&&e[r9n]===!0}get[r9n](){return!0}},n9n=Symbol.for("undici.error.UND_ERR_ABORT"),jot=class extends pd{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError",this.message=e||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](e){return e&&e[n9n]===!0}get[n9n](){return!0}},i9n=Symbol.for("undici.error.UND_ERR_ABORTED"),Air=class extends jot{static{a(this,"RequestAbortedError")}constructor(e){super(e),this.name="AbortError",this.message=e||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](e){return e&&e[i9n]===!0}get[i9n](){return!0}},o9n=Symbol.for("undici.error.UND_ERR_INFO"),yir=class extends pd{static{a(this,"InformationalError")}constructor(e){super(e),this.name="InformationalError",this.message=e||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](e){return e&&e[o9n]===!0}get[o9n](){return!0}},s9n=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),Eir=class extends pd{static{a(this,"RequestContentLengthMismatchError")}constructor(e){super(e),this.name="RequestContentLengthMismatchError",this.message=e||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[s9n]===!0}get[s9n](){return!0}},a9n=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),_ir=class extends pd{static{a(this,"ResponseContentLengthMismatchError")}constructor(e){super(e),this.name="ResponseContentLengthMismatchError",this.message=e||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[a9n]===!0}get[a9n](){return!0}},c9n=Symbol.for("undici.error.UND_ERR_DESTROYED"),vir=class extends pd{static{a(this,"ClientDestroyedError")}constructor(e){super(e),this.name="ClientDestroyedError",this.message=e||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](e){return e&&e[c9n]===!0}get[c9n](){return!0}},l9n=Symbol.for("undici.error.UND_ERR_CLOSED"),Cir=class extends pd{static{a(this,"ClientClosedError")}constructor(e){super(e),this.name="ClientClosedError",this.message=e||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](e){return e&&e[l9n]===!0}get[l9n](){return!0}},u9n=Symbol.for("undici.error.UND_ERR_SOCKET"),bir=class extends pd{static{a(this,"SocketError")}constructor(e,r){super(e),this.name="SocketError",this.message=e||"Socket error",this.code="UND_ERR_SOCKET",this.socket=r}static[Symbol.hasInstance](e){return e&&e[u9n]===!0}get[u9n](){return!0}},d9n=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),Sir=class extends pd{static{a(this,"NotSupportedError")}constructor(e){super(e),this.name="NotSupportedError",this.message=e||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](e){return e&&e[d9n]===!0}get[d9n](){return!0}},f9n=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),Tir=class extends pd{static{a(this,"BalancedPoolMissingUpstreamError")}constructor(e){super(e),this.name="MissingUpstreamError",this.message=e||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](e){return e&&e[f9n]===!0}get[f9n](){return!0}},p9n=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),Iir=class extends Error{static{a(this,"HTTPParserError")}constructor(e,r,n){super(e),this.name="HTTPParserError",this.code=r?`HPE_${r}`:void 0,this.data=n?n.toString():void 0}static[Symbol.hasInstance](e){return e&&e[p9n]===!0}get[p9n](){return!0}},h9n=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),xir=class extends pd{static{a(this,"ResponseExceededMaxSizeError")}constructor(e){super(e),this.name="ResponseExceededMaxSizeError",this.message=e||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](e){return e&&e[h9n]===!0}get[h9n](){return!0}},m9n=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),wir=class extends pd{static{a(this,"RequestRetryError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="RequestRetryError",this.message=e||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[m9n]===!0}get[m9n](){return!0}},g9n=Symbol.for("undici.error.UND_ERR_RESPONSE"),Rir=class extends pd{static{a(this,"ResponseError")}constructor(e,r,{headers:n,body:o}){super(e),this.name="ResponseError",this.message=e||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=r,this.body=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[g9n]===!0}get[g9n](){return!0}},A9n=Symbol.for("undici.error.UND_ERR_PRX_TLS"),kir=class extends pd{static{a(this,"SecureProxyConnectionError")}constructor(e,r,n={}){super(r,{cause:e,...n}),this.name="SecureProxyConnectionError",this.message=r||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=e}static[Symbol.hasInstance](e){return e&&e[A9n]===!0}get[A9n](){return!0}},y9n=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED"),Pir=class extends pd{static{a(this,"MaxOriginsReachedError")}constructor(e){super(e),this.name="MaxOriginsReachedError",this.message=e||"Maximum allowed origins reached",this.code="UND_ERR_MAX_ORIGINS_REACHED"}static[Symbol.hasInstance](e){return e&&e[y9n]===!0}get[y9n](){return!0}},Dir=class extends pd{static{a(this,"Socks5ProxyError")}constructor(e,r){super(e),this.name="Socks5ProxyError",this.message=e||"SOCKS5 proxy error",this.code=r||"UND_ERR_SOCKS5"}},E9n=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),Nir=class extends pd{static{a(this,"MessageSizeExceededError")}constructor(e){super(e),this.name="MessageSizeExceededError",this.message=e||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](e){return e&&e[E9n]===!0}get[E9n](){return!0}};_9n.exports={AbortError:jot,HTTPParserError:Iir,UndiciError:pd,HeadersTimeoutError:fir,HeadersOverflowError:pir,BodyTimeoutError:hir,RequestContentLengthMismatchError:Eir,ConnectTimeoutError:dir,InvalidArgumentError:mir,InvalidReturnValueError:gir,RequestAbortedError:Air,ClientDestroyedError:vir,ClientClosedError:Cir,InformationalError:yir,SocketError:bir,NotSupportedError:Sir,ResponseContentLengthMismatchError:_ir,BalancedPoolMissingUpstreamError:Tir,ResponseExceededMaxSizeError:xir,RequestRetryError:wir,ResponseError:Rir,SecureProxyConnectionError:kir,MaxOriginsReachedError:Pir,Socks5ProxyError:Dir,MessageSizeExceededError:Nir}});var Got=I((Jcf,C9n)=>{"use strict";p();var Mir=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"],Hot={};Object.setPrototypeOf(Hot,null);var v9n={};Object.setPrototypeOf(v9n,null);function UIs(t){let e=v9n[t];return e===void 0&&(e=Buffer.from(t)),e}a(UIs,"getHeaderNameAsBuffer");for(let t=0;t{"use strict";p();var{wellknownHeaderNames:b9n,headerNameLowerCasedRecord:QIs}=Got(),Oir=class t{static{a(this,"TstNode")}value=null;left=null;middle=null;right=null;code;constructor(e,r,n){if(n===void 0||n>=e.length)throw new TypeError("Unreachable");if((this.code=e.charCodeAt(n))>127)throw new TypeError("key must be ascii string");e.length!==++n?this.middle=new t(e,r,n):this.value=r}add(e,r){let n=e.length;if(n===0)throw new TypeError("Unreachable");let o=0,s=this;for(;;){let c=e.charCodeAt(o);if(c>127)throw new TypeError("key must be ascii string");if(s.code===c)if(n===++o){s.value=r;break}else if(s.middle!==null)s=s.middle;else{s.middle=new t(e,r,o);break}else if(s.code=65&&(s|=32);o!==null;){if(s===o.code){if(r===++n)return o;o=o.middle;break}o=o.code{"use strict";p();var DPe=require("node:assert"),{kDestroyed:k9n,kBodyUsed:Ape,kListeners:Wot,kBody:x9n}=al(),{IncomingMessage:qIs}=require("node:http"),P9n=require("node:stream"),jIs=require("node:net"),{stringify:HIs}=require("node:querystring"),{EventEmitter:GIs}=require("node:events"),Vot=uir(),{InvalidArgumentError:Bg,ConnectTimeoutError:$Is}=so(),{headerNameLowerCasedRecord:VIs}=Got(),{tree:D9n}=I9n(),[WIs,zIs]=process.versions.node.split(".",2).map(t=>Number(t)),Yot=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[x9n]=e,this[Ape]=!1}async*[Symbol.asyncIterator](){DPe(!this[Ape],"disturbed"),this[Ape]=!0,yield*this[x9n]}};function w9n(){}a(w9n,"noop");function YIs(t){return Kot(t)?(F9n(t)===0&&t.on("data",function(){DPe(!1)}),typeof t.readableDidRead!="boolean"&&(t[Ape]=!1,GIs.prototype.on.call(t,"data",function(){this[Ape]=!0})),t):t&&typeof t.pipeTo=="function"?new Yot(t):t&&H9n(t)?t:t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&B9n(t)?new Yot(t):t}a(YIs,"wrapRequestBody");function Kot(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Kot,"isStream");function N9n(t){if(t===null)return!1;if(t instanceof Blob)return!0;if(typeof t!="object")return!1;{let e=t[Symbol.toStringTag];return(e==="Blob"||e==="File")&&("stream"in t&&typeof t.stream=="function"||"arrayBuffer"in t&&typeof t.arrayBuffer=="function")}}a(N9n,"isBlobLike");function M9n(t){return t.includes("?")||t.includes("#")}a(M9n,"pathHasQueryOrFragment");function KIs(t,e){if(M9n(t))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=HIs(e);return r&&(t+="?"+r),t}a(KIs,"serializePathWithQuery");function O9n(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(O9n,"isValidPort");function zot(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(zot,"isHttpOrHttpsPrefixed");function L9n(t){if(typeof t=="string"){if(t=new URL(t),!zot(t.origin||t.protocol))throw new Bg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new Bg("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&O9n(t.port)===!1)throw new Bg("Invalid URL: port must be a valid integer or a string representation of an integer.");if(t.path!=null&&typeof t.path!="string")throw new Bg("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new Bg("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new Bg("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new Bg("Invalid URL origin: the origin must be a string or null/undefined.");if(!zot(t.origin||t.protocol))throw new Bg("Invalid URL protocol: the URL must start with `http:` or `https:`.");let e=t.port!=null?t.port:t.protocol==="https:"?443:80,r=t.origin!=null?t.origin:`${t.protocol||""}//${t.hostname||""}:${e}`,n=t.path!=null?t.path:`${t.pathname||""}${t.search||""}`;return r[r.length-1]==="/"&&(r=r.slice(0,r.length-1)),n&&n[0]!=="/"&&(n=`/${n}`),new URL(`${r}${n}`)}if(!zot(t.origin||t.protocol))throw new Bg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(L9n,"parseURL");function JIs(t){if(t=L9n(t),t.pathname!=="/"||t.search||t.hash)throw new Bg("invalid url");return t}a(JIs,"parseOrigin");function ZIs(t){if(t[0]==="["){let r=t.indexOf("]");return DPe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(ZIs,"getHostname");function XIs(t){if(!t)return null;DPe(typeof t=="string");let e=ZIs(t);return jIs.isIP(e)?"":e}a(XIs,"getServerName");function exs(t){return JSON.parse(JSON.stringify(t))}a(exs,"deepClone");function txs(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(txs,"isAsyncIterable");function B9n(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(B9n,"isIterable");function rxs(t){let e=Object.getPrototypeOf(t);return Object.prototype.hasOwnProperty.call(t,Symbol.iterator)||e!=null&&e!==Object.prototype&&typeof t[Symbol.iterator]=="function"}a(rxs,"hasSafeIterator");function F9n(t){if(t==null)return 0;if(Kot(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(N9n(t))return t.size!=null?t.size:null;if(j9n(t))return t.byteLength}return null}a(F9n,"bodyLength");function U9n(t){return t&&!!(t.destroyed||t[k9n]||P9n.isDestroyed?.(t))}a(U9n,"isDestroyed");function Q9n(t,e){t==null||!Kot(t)||U9n(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===qIs&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[k9n]=!0))}a(Q9n,"destroy");var nxs=/timeout=(\d+)/;function ixs(t){let e=t.match(nxs);return e?parseInt(e[1],10)*1e3:null}a(ixs,"parseKeepAliveTimeout");function q9n(t){return typeof t=="string"?VIs[t]??t.toLowerCase():D9n.lookup(t)??t.toString("latin1").toLowerCase()}a(q9n,"headerNameToString");function oxs(t){return D9n.lookup(t)??t.toString("latin1").toLowerCase()}a(oxs,"bufferToLowerCasedHeaderName");function sxs(t,e){e===void 0&&(e={});for(let r=0;rc.toString("latin1")):t[r+1].toString("latin1");n==="__proto__"?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s}else{let s=typeof t[r+1]=="string"?t[r+1]:Array.isArray(t[r+1])?t[r+1].map(c=>c.toString("latin1")):t[r+1].toString("latin1");e[n]=s}}return e}a(sxs,"parseHeaders");function axs(t){let e=t.length,r=new Array(e),n,o;for(let s=0;sBuffer.from(e))}a(cxs,"encodeRawHeaders");function j9n(t){return t instanceof Uint8Array||Buffer.isBuffer(t)}a(j9n,"isBuffer");function lxs(t,e,r){if(!t||typeof t!="object")throw new Bg("handler must be an object");if(typeof t.onRequestStart!="function"){if(typeof t.onConnect!="function")throw new Bg("invalid onConnect method");if(typeof t.onError!="function")throw new Bg("invalid onError method");if(typeof t.onBodySent!="function"&&t.onBodySent!==void 0)throw new Bg("invalid onBodySent method");if(r||e==="CONNECT"){if(typeof t.onUpgrade!="function")throw new Bg("invalid onUpgrade method")}else{if(typeof t.onHeaders!="function")throw new Bg("invalid onHeaders method");if(typeof t.onData!="function")throw new Bg("invalid onData method");if(typeof t.onComplete!="function")throw new Bg("invalid onComplete method")}}}a(lxs,"assertRequestHandler");function uxs(t){return!!(t&&(P9n.isDisturbed(t)||t[Ape]))}a(uxs,"isDisturbed");function dxs(t){return{localAddress:t.localAddress,localPort:t.localPort,remoteAddress:t.remoteAddress,remotePort:t.remotePort,remoteFamily:t.remoteFamily,timeout:t.timeout,bytesWritten:t.bytesWritten,bytesRead:t.bytesRead}}a(dxs,"getSocketInfo");function fxs(t){let e;return new ReadableStream({start(){e=t[Symbol.asyncIterator]()},pull(r){return e.next().then(({done:n,value:o})=>{if(n)return queueMicrotask(()=>{r.close(),r.byobRequest?.respond(0)});{let s=Buffer.isBuffer(o)?o:Buffer.from(o);return s.byteLength?r.enqueue(new Uint8Array(s)):this.pull(r)}})},cancel(){return e.return()},type:"bytes"})}a(fxs,"ReadableStreamFrom");function H9n(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}a(H9n,"isFormDataLike");function pxs(t,e){return"addEventListener"in t?(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)):(t.once("abort",e),()=>t.removeListener("abort",e))}a(pxs,"addAbortListener");var G9n=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function hxs(t){return G9n[t]===1}a(hxs,"isTokenCharCode");var mxs=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;function gxs(t){if(t.length>=12)return mxs.test(t);if(t.length===0)return!1;for(let e=0;e{if(!e.timeout)return w9n;let r=null,n=null,o=Vot.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>R9n(t.deref(),e))})},e.timeout);return()=>{Vot.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return w9n;let r=null,n=Vot.setFastTimeout(()=>{r=setImmediate(()=>{R9n(t.deref(),e)})},e.timeout);return()=>{Vot.clearFastTimeout(n),clearImmediate(r)}};function R9n(t,e){if(t==null)return;let r="Connect Timeout Error";Array.isArray(t.autoSelectFamilyAttemptedAddresses)?r+=` (attempted addresses: ${t.autoSelectFamilyAttemptedAddresses.join(", ")},`:r+=` (attempted address: ${e.hostname}:${e.port},`,r+=` timeout: ${e.timeout}ms)`,Q9n(t,new $Is(r))}a(R9n,"onConnectTimeout");function Txs(t){if(t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p")switch(t[4]){case":":return"http:";case"s":if(t[5]===":")return"https:"}return t.slice(0,t.indexOf(":")+1)}a(Txs,"getProtocolFromUrlString");var $9n=Object.create(null);$9n.enumerable=!0;var Lir={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"},V9n={...Lir,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(Lir,null);Object.setPrototypeOf(V9n,null);W9n.exports={kEnumerableProperty:$9n,isDisturbed:uxs,isBlobLike:N9n,parseOrigin:JIs,parseURL:L9n,getServerName:XIs,isStream:Kot,isIterable:B9n,hasSafeIterator:rxs,isAsyncIterable:txs,isDestroyed:U9n,headerNameToString:q9n,bufferToLowerCasedHeaderName:oxs,addListener:vxs,removeAllListeners:Cxs,errorRequest:bxs,parseRawHeaders:axs,encodeRawHeaders:cxs,parseHeaders:sxs,parseKeepAliveTimeout:ixs,destroy:Q9n,bodyLength:F9n,deepClone:exs,ReadableStreamFrom:fxs,isBuffer:j9n,assertRequestHandler:lxs,getSocketInfo:dxs,isFormDataLike:H9n,pathHasQueryOrFragment:M9n,serializePathWithQuery:KIs,addAbortListener:pxs,isValidHTTPToken:gxs,isValidHeaderValue:yxs,isTokenCharCode:hxs,parseRangeHeader:_xs,normalizedMethodRecordsBase:Lir,normalizedMethodRecords:V9n,isValidPort:O9n,isHttpOrHttpsPrefixed:zot,nodeMajor:WIs,nodeMinor:zIs,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:YIs,setupConnectTimeout:Sxs,getProtocolFromUrlString:Txs}});var Uir=I((slf,Z9n)=>{"use strict";p();var{kConnected:z9n,kPending:Y9n,kRunning:K9n,kSize:J9n,kFree:Ixs,kQueued:xxs}=al(),Bir=class{static{a(this,"ClientStats")}constructor(e){this.connected=e[z9n],this.pending=e[Y9n],this.running=e[K9n],this.size=e[J9n]}},Fir=class{static{a(this,"PoolStats")}constructor(e){this.connected=e[z9n],this.free=e[Ixs],this.pending=e[Y9n],this.queued=e[xxs],this.running=e[K9n],this.size=e[J9n]}};Z9n.exports={ClientStats:Bir,PoolStats:Fir}});var Jj=I((llf,eUn)=>{"use strict";p();var cl=require("node:diagnostics_channel"),Hir=require("node:util"),RZ=Hir.debuglog("undici"),NPe=Hir.debuglog("fetch"),Jot=Hir.debuglog("websocket"),ST={beforeConnect:cl.channel("undici:client:beforeConnect"),connected:cl.channel("undici:client:connected"),connectError:cl.channel("undici:client:connectError"),sendHeaders:cl.channel("undici:client:sendHeaders"),create:cl.channel("undici:request:create"),bodySent:cl.channel("undici:request:bodySent"),bodyChunkSent:cl.channel("undici:request:bodyChunkSent"),bodyChunkReceived:cl.channel("undici:request:bodyChunkReceived"),headers:cl.channel("undici:request:headers"),trailers:cl.channel("undici:request:trailers"),error:cl.channel("undici:request:error"),open:cl.channel("undici:websocket:open"),close:cl.channel("undici:websocket:close"),socketError:cl.channel("undici:websocket:socket_error"),ping:cl.channel("undici:websocket:ping"),pong:cl.channel("undici:websocket:pong"),proxyConnected:cl.channel("undici:proxy:connected")},Qir=!1;function X9n(t=RZ){if(!Qir){if(ST.beforeConnect.hasSubscribers||ST.connected.hasSubscribers||ST.connectError.hasSubscribers||ST.sendHeaders.hasSubscribers){Qir=!0;return}Qir=!0,cl.subscribe("undici:client:beforeConnect",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),cl.subscribe("undici:client:connected",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),cl.subscribe("undici:client:connectError",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s%s using %s%s errored - %s",s,o?`:${o}`:"",n,r,c.message)}),cl.subscribe("undici:client:sendHeaders",e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s%s",r,o,n)})}}a(X9n,"trackClientEvents");var qir=!1;function wxs(t=RZ){if(!qir){if(ST.headers.hasSubscribers||ST.trailers.hasSubscribers||ST.error.hasSubscribers){qir=!0;return}qir=!0,cl.subscribe("undici:request:headers",e=>{let{request:{method:r,path:n,origin:o},response:{statusCode:s}}=e;t("received response to %s %s%s - HTTP %d",r,o,n,s)}),cl.subscribe("undici:request:trailers",e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s%s",r,o,n)}),cl.subscribe("undici:request:error",e=>{let{request:{method:r,path:n,origin:o},error:s}=e;t("request to %s %s%s errored - %s",r,o,n,s.message)})}}a(wxs,"trackRequestEvents");var jir=!1;function Rxs(t=Jot){if(!jir){if(ST.open.hasSubscribers||ST.close.hasSubscribers||ST.socketError.hasSubscribers||ST.ping.hasSubscribers||ST.pong.hasSubscribers){jir=!0;return}jir=!0,cl.subscribe("undici:websocket:open",e=>{if(e.address!=null){let{address:r,port:n}=e.address;t("connection opened %s%s",r,n?`:${n}`:"")}else t("connection opened")}),cl.subscribe("undici:websocket:close",e=>{let{websocket:r,code:n,reason:o}=e;t("closed connection to %s - %s %s",r.url,n,o)}),cl.subscribe("undici:websocket:socket_error",e=>{t("connection errored - %s",e.message)}),cl.subscribe("undici:websocket:ping",e=>{t("ping received")}),cl.subscribe("undici:websocket:pong",e=>{t("pong received")})}}a(Rxs,"trackWebSocketEvents");(RZ.enabled||NPe.enabled)&&(X9n(NPe.enabled?NPe:RZ),wxs(NPe.enabled?NPe:RZ));Jot.enabled&&(X9n(RZ.enabled?RZ:Jot),Rxs(Jot));eUn.exports={channels:ST}});var nUn=I((flf,rUn)=>{"use strict";p();var{InvalidArgumentError:Gc,NotSupportedError:kxs}=so(),O5=require("node:assert"),{isValidHTTPToken:Gir,isValidHeaderValue:$ir,isStream:Pxs,destroy:Dxs,isBuffer:Nxs,isFormDataLike:Mxs,isIterable:Oxs,hasSafeIterator:Lxs,isBlobLike:Bxs,serializePathWithQuery:Fxs,assertRequestHandler:Uxs,getServerName:Qxs,normalizedMethodRecords:qxs,getProtocolFromUrlString:jxs}=Po(),{channels:mb}=Jj(),{headerNameLowerCasedRecord:tUn}=Got(),Hxs=/[^\u0021-\u00ff]/;function Gxs(t){if(typeof t!="string"||t.length===0)return!1;for(let e=0;e57)return!1}return!0}a(Gxs,"isValidContentLengthHeaderValue");var qw=Symbol("handler"),Vir=class{static{a(this,"Request")}constructor(e,{path:r,method:n,body:o,headers:s,query:c,idempotent:l,blocking:u,upgrade:d,headersTimeout:f,bodyTimeout:h,reset:m,expectContinue:g,servername:A,throwOnError:y,maxRedirections:E,typeOfService:_},v){if(typeof r!="string")throw new Gc("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Gc("path must be an absolute URL or start with a slash");if(Hxs.test(r))throw new Gc("invalid request path");if(typeof n!="string")throw new Gc("method must be a string");if(qxs[n]===void 0&&!Gir(n))throw new Gc("invalid request method");if(d&&typeof d!="string")throw new Gc("upgrade must be a string");if(d&&!$ir(d))throw new Gc("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Gc("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Gc("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Gc("invalid reset");if(g!=null&&typeof g!="boolean")throw new Gc("invalid expectContinue");if(y!=null)throw new Gc("invalid throwOnError");if(E!=null&&E!==0)throw new Gc("maxRedirections is not supported, use the redirect interceptor");if(_!=null&&(!Number.isInteger(_)||_<0||_>255))throw new Gc("typeOfService must be an integer between 0 and 255");if(this.headersTimeout=f,this.bodyTimeout=h,this.method=n,this.typeOfService=_??0,this.abort=null,o==null)this.body=null;else if(Pxs(o)){this.body=o;let b=this.body._readableState;(!b||!b.autoDestroy)&&(this.endHandler=a(function(){Dxs(this)},"autoDestroy"),this.body.on("end",this.endHandler)),this.errorHandler=T=>{this.abort?this.abort(T):this.error=T},this.body.on("error",this.errorHandler)}else if(Nxs(o))this.body=o.byteLength?o:null;else if(ArrayBuffer.isView(o))this.body=o.buffer.byteLength?Buffer.from(o.buffer,o.byteOffset,o.byteLength):null;else if(o instanceof ArrayBuffer)this.body=o.byteLength?Buffer.from(o):null;else if(typeof o=="string")this.body=o.length?Buffer.from(o):null;else if(Mxs(o)||Oxs(o)||Bxs(o))this.body=o;else throw new Gc("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=d||null,this.path=c?Fxs(r,c):r,this.origin=e,this.protocol=jxs(e),this.idempotent=l??(n==="HEAD"||n==="GET"),this.blocking=u??this.method!=="HEAD",this.reset=m??null,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=g??!1,Array.isArray(s)){if(s.length%2!==0)throw new Gc("headers array must be even");for(let b=0;b{"use strict";p();var{InvalidArgumentError:$xs}=so();oUn.exports=class iUn{static{a(this,"WrapHandler")}#e;constructor(e){this.#e=e}static wrap(e){return e.onRequestStart?e:new iUn(e)}onConnect(e,r){return this.#e.onConnect?.(e,r)}onResponseStarted(){return this.#e.onResponseStarted?.()}onHeaders(e,r,n,o){return this.#e.onHeaders?.(e,r,n,o)}onUpgrade(e,r,n){return this.#e.onUpgrade?.(e,r,n)}onData(e){return this.#e.onData?.(e)}onComplete(e){return this.#e.onComplete?.(e)}onError(e){if(!this.#e.onError)throw e;return this.#e.onError?.(e)}onRequestStart(e,r){this.#e.onConnect?.(n=>e.abort(n),r)}onRequestUpgrade(e,r,n,o){let s=[];for(let[c,l]of Object.entries(n))s.push(Buffer.from(c,"latin1"),Wir(l));this.#e.onUpgrade?.(r,s,o)}onResponseStart(e,r,n,o){let s=[];for(let[c,l]of Object.entries(n))s.push(Buffer.from(c,"latin1"),Wir(l));this.#e.onHeaders?.(r,s,()=>e.resume(),o)===!1&&e.pause()}onResponseData(e,r){this.#e.onData?.(r)===!1&&e.pause()}onResponseEnd(e,r){let n=[];for(let[o,s]of Object.entries(r))n.push(Buffer.from(o,"latin1"),Wir(s));this.#e.onComplete?.(n)}onResponseError(e,r){if(!this.#e.onError)throw new $xs("invalid onError method");this.#e.onError?.(r)}};function Wir(t){return Array.isArray(t)?t.map(e=>Buffer.from(e,"latin1")):Buffer.from(t,"latin1")}a(Wir,"toRawHeaderValue")});var OPe=I((ylf,sUn)=>{"use strict";p();var Vxs=require("node:events"),Wxs=MPe(),zxs=a(t=>(e,r)=>t(e,Wxs.wrap(r)),"wrapInterceptor"),zir=class extends Vxs{static{a(this,"Dispatcher")}dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}compose(...e){let r=Array.isArray(e[0])?e[0]:e,n=this.dispatch.bind(this);for(let o of r)if(o!=null){if(typeof o!="function")throw new TypeError(`invalid interceptor, expected function received ${typeof o}`);if(n=o(n),n=zxs(n),n==null||typeof n!="function"||n.length!==2)throw new TypeError("invalid interceptor")}return new Proxy(this,{get:a((o,s)=>s==="dispatch"?n:o[s],"get")})}};sUn.exports=zir});var lUn=I((vlf,cUn)=>{"use strict";p();var{parseHeaders:Yir}=Po(),{InvalidArgumentError:Yxs}=so(),Kir=Symbol("resume"),Jir=class{static{a(this,"UnwrapController")}#e=!1;#t=null;#r=!1;#n;[Kir]=null;rawHeaders=null;rawTrailers=null;constructor(e){this.#n=e}pause(){this.#e=!0}resume(){this.#e&&(this.#e=!1,this[Kir]?.())}abort(e){this.#r||(this.#r=!0,this.#t=e,this.#n(e))}get aborted(){return this.#r}get reason(){return this.#t}get paused(){return this.#e}};cUn.exports=class aUn{static{a(this,"UnwrapHandler")}#e;#t;constructor(e){this.#e=e}static unwrap(e){return e.onRequestStart?new aUn(e):e}onConnect(e,r){this.#t=new Jir(e),this.#e.onRequestStart?.(this.#t,r)}onResponseStarted(){return this.#e.onResponseStarted?.()}onUpgrade(e,r,n){this.#t.rawHeaders=r,this.#e.onRequestUpgrade?.(this.#t,e,Yir(r),n)}onHeaders(e,r,n,o){return this.#t[Kir]=n,this.#t.rawHeaders=r,this.#e.onResponseStart?.(this.#t,e,Yir(r),o),!this.#t.paused}onData(e){return this.#e.onResponseData?.(this.#t,e),!this.#t.paused}onComplete(e){this.#t.rawTrailers=e,this.#e.onResponseEnd?.(this.#t,Yir(e))}onError(e){if(!this.#e.onResponseError)throw new Yxs("invalid onError method");this.#e.onResponseError?.(this.#t,e)}}});var PZ=I((Slf,uUn)=>{"use strict";p();var Kxs=OPe(),Jxs=lUn(),{ClientDestroyedError:Zir,ClientClosedError:Zxs,InvalidArgumentError:Xot}=so(),{kDestroy:Xxs,kClose:ews,kClosed:LPe,kDestroyed:ype,kDispatch:tws}=al(),Zj=Symbol("onDestroyed"),kZ=Symbol("onClosed"),Xir=Symbol("webSocketOptions"),eor=class extends Kxs{static{a(this,"DispatcherBase")}[ype]=!1;[Zj]=null;[LPe]=!1;[kZ]=null;constructor(e){super(),this[Xir]=e?.webSocket??{}}get webSocketOptions(){return{maxFragments:this[Xir].maxFragments??131072,maxPayloadSize:this[Xir].maxPayloadSize??128*1024*1024}}get destroyed(){return this[ype]}get closed(){return this[LPe]}close(e){if(e===void 0)return new Promise((n,o)=>{this.close((s,c)=>s?o(s):n(c))});if(typeof e!="function")throw new Xot("invalid callback");if(this[ype]){let n=new Zir;queueMicrotask(()=>e(n,null));return}if(this[LPe]){this[kZ]?this[kZ].push(e):queueMicrotask(()=>e(null,null));return}this[LPe]=!0,this[kZ]??=[],this[kZ].push(e);let r=a(()=>{let n=this[kZ];this[kZ]=null;for(let o=0;othis.destroy()).then(()=>queueMicrotask(r))}destroy(e,r){if(typeof e=="function"&&(r=e,e=null),r===void 0)return new Promise((o,s)=>{this.destroy(e,(c,l)=>c?s(c):o(l))});if(typeof r!="function")throw new Xot("invalid callback");if(this[ype]){this[Zj]?this[Zj].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new Zir),this[ype]=!0,this[Zj]??=[],this[Zj].push(r);let n=a(()=>{let o=this[Zj];this[Zj]=null;for(let s=0;squeueMicrotask(n))}dispatch(e,r){if(!r||typeof r!="object")throw new Xot("handler must be an object");r=Jxs.unwrap(r);try{if(!e||typeof e!="object")throw new Xot("opts must be an object.");if(this[ype]||this[Zj])throw new Zir;if(this[LPe])throw new Zxs;return this[tws](e,r)}catch(n){if(typeof r.onError!="function")throw n;return r.onError(n),!1}}};uUn.exports=eor});var DZ=I((wlf,pUn)=>{"use strict";p();var rws=require("node:net"),dUn=require("node:assert"),fUn=Po(),{InvalidArgumentError:nws}=so(),tor,iws=class{static{a(this,"WeakSessionCache")}constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new FinalizationRegistry(r=>{if(this._sessionCache.size=this._maxCachedSessions){for(let[o,s]of this._sessionCache)if(s.deref()===void 0){this._sessionCache.delete(o);return}let n=this._sessionCache.keys().next();n.done||this._sessionCache.delete(n.value)}this._sessionCache.set(e,new WeakRef(r)),this._sessionRegistry.register(r,e)}}};function ows({allowH2:t,useH2c:e,maxCachedSessions:r,socketPath:n,timeout:o,session:s,...c}){if(r!=null&&(!Number.isInteger(r)||r<0))throw new nws("maxCachedSessions must be a positive integer or zero");let l={path:n,...c},u=new iws(r??100);return o=o??1e4,t=t??!1,a(function({hostname:f,host:h,protocol:m,port:g,servername:A,localAddress:y,httpSocket:E},_){let v;if(m==="https:"){tor||(tor=require("node:tls")),A=A||l.servername||fUn.getServerName(h)||null;let T=A||f;dUn(T);let w=s||u.get(T)||null;g=g||443,v=tor.connect({highWaterMark:16384,...l,servername:A,session:w,localAddress:y,ALPNProtocols:t?["http/1.1","h2"]:["http/1.1"],socket:E,port:g,host:f}),v.on("session",function(R){u.set(T,R)})}else dUn(!E,"httpSocket can only be sent on TLS update"),g=g||80,v=rws.connect({highWaterMark:64*1024,...l,localAddress:y,port:g,host:f}),e===!0&&(v.alpnProtocol="h2");if(l.keepAlive==null||l.keepAlive){let T=l.keepAliveInitialDelay===void 0?6e4:l.keepAliveInitialDelay;v.setKeepAlive(!0,T)}let b=fUn.setupConnectTimeout(new WeakRef(v),{timeout:o,hostname:f,port:g});return v.setNoDelay(!0).once(m==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(b),_){let T=_;_=null,T(null,this)}}).on("error",function(T){if(queueMicrotask(b),_){let w=_;_=null,w(T)}}),v},"connect")}a(ows,"buildConnector");pUn.exports=ows});var hUn=I(ror=>{"use strict";p();Object.defineProperty(ror,"__esModule",{value:!0});ror.enumToMap=sws;function sws(t,e=[],r=[]){let n=(e?.length??0)===0,o=(r?.length??0)===0;return Object.fromEntries(Object.entries(t).filter(([,s])=>typeof s=="number"&&(n||e.includes(s))&&(o||!r.includes(s))))}a(sws,"enumToMap")});var mUn=I(He=>{"use strict";p();Object.defineProperty(He,"__esModule",{value:!0});He.SPECIAL_HEADERS=He.MINOR=He.MAJOR=He.HTAB_SP_VCHAR_OBS_TEXT=He.QUOTED_STRING=He.CONNECTION_TOKEN_CHARS=He.HEADER_CHARS=He.TOKEN=He.HEX=He.URL_CHAR=He.USERINFO_CHARS=He.MARK=He.ALPHANUM=He.NUM=He.HEX_MAP=He.NUM_MAP=He.ALPHA=He.STATUSES_HTTP=He.H_METHOD_MAP=He.METHOD_MAP=He.METHODS_RTSP=He.METHODS_ICE=He.METHODS_HTTP=He.HEADER_STATE=He.FINISH=He.STATUSES=He.METHODS=He.LENIENT_FLAGS=He.FLAGS=He.TYPE=He.ERROR=void 0;var aws=hUn();He.ERROR={OK:0,INTERNAL:1,STRICT:2,CR_EXPECTED:25,LF_EXPECTED:3,UNEXPECTED_CONTENT_LENGTH:4,UNEXPECTED_SPACE:30,CLOSED_CONNECTION:5,INVALID_METHOD:6,INVALID_URL:7,INVALID_CONSTANT:8,INVALID_VERSION:9,INVALID_HEADER_TOKEN:10,INVALID_CONTENT_LENGTH:11,INVALID_CHUNK_SIZE:12,INVALID_STATUS:13,INVALID_EOF_STATE:14,INVALID_TRANSFER_ENCODING:15,CB_MESSAGE_BEGIN:16,CB_HEADERS_COMPLETE:17,CB_MESSAGE_COMPLETE:18,CB_CHUNK_HEADER:19,CB_CHUNK_COMPLETE:20,PAUSED:21,PAUSED_UPGRADE:22,PAUSED_H2_UPGRADE:23,USER:24,CB_URL_COMPLETE:26,CB_STATUS_COMPLETE:27,CB_METHOD_COMPLETE:32,CB_VERSION_COMPLETE:33,CB_HEADER_FIELD_COMPLETE:28,CB_HEADER_VALUE_COMPLETE:29,CB_CHUNK_EXTENSION_NAME_COMPLETE:34,CB_CHUNK_EXTENSION_VALUE_COMPLETE:35,CB_RESET:31,CB_PROTOCOL_COMPLETE:38};He.TYPE={BOTH:0,REQUEST:1,RESPONSE:2};He.FLAGS={CONNECTION_KEEP_ALIVE:1,CONNECTION_CLOSE:2,CONNECTION_UPGRADE:4,CHUNKED:8,UPGRADE:16,CONTENT_LENGTH:32,SKIPBODY:64,TRAILING:128,TRANSFER_ENCODING:512};He.LENIENT_FLAGS={HEADERS:1,CHUNKED_LENGTH:2,KEEP_ALIVE:4,TRANSFER_ENCODING:8,VERSION:16,DATA_AFTER_CLOSE:32,OPTIONAL_LF_AFTER_CR:64,OPTIONAL_CRLF_AFTER_CHUNK:128,OPTIONAL_CR_BEFORE_LF:256,SPACES_AFTER_CHUNK_SIZE:512};He.METHODS={DELETE:0,GET:1,HEAD:2,POST:3,PUT:4,CONNECT:5,OPTIONS:6,TRACE:7,COPY:8,LOCK:9,MKCOL:10,MOVE:11,PROPFIND:12,PROPPATCH:13,SEARCH:14,UNLOCK:15,BIND:16,REBIND:17,UNBIND:18,ACL:19,REPORT:20,MKACTIVITY:21,CHECKOUT:22,MERGE:23,"M-SEARCH":24,NOTIFY:25,SUBSCRIBE:26,UNSUBSCRIBE:27,PATCH:28,PURGE:29,MKCALENDAR:30,LINK:31,UNLINK:32,SOURCE:33,PRI:34,DESCRIBE:35,ANNOUNCE:36,SETUP:37,PLAY:38,PAUSE:39,TEARDOWN:40,GET_PARAMETER:41,SET_PARAMETER:42,REDIRECT:43,RECORD:44,FLUSH:45,QUERY:46};He.STATUSES={CONTINUE:100,SWITCHING_PROTOCOLS:101,PROCESSING:102,EARLY_HINTS:103,RESPONSE_IS_STALE:110,REVALIDATION_FAILED:111,DISCONNECTED_OPERATION:112,HEURISTIC_EXPIRATION:113,MISCELLANEOUS_WARNING:199,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTI_STATUS:207,ALREADY_REPORTED:208,TRANSFORMATION_APPLIED:214,IM_USED:226,MISCELLANEOUS_PERSISTENT_WARNING:299,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,SWITCH_PROXY:306,TEMPORARY_REDIRECT:307,PERMANENT_REDIRECT:308,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,IM_A_TEAPOT:418,PAGE_EXPIRED:419,ENHANCE_YOUR_CALM:420,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL:430,REQUEST_HEADER_FIELDS_TOO_LARGE:431,LOGIN_TIMEOUT:440,NO_RESPONSE:444,RETRY_WITH:449,BLOCKED_BY_PARENTAL_CONTROL:450,UNAVAILABLE_FOR_LEGAL_REASONS:451,CLIENT_CLOSED_LOAD_BALANCED_REQUEST:460,INVALID_X_FORWARDED_FOR:463,REQUEST_HEADER_TOO_LARGE:494,SSL_CERTIFICATE_ERROR:495,SSL_CERTIFICATE_REQUIRED:496,HTTP_REQUEST_SENT_TO_HTTPS_PORT:497,INVALID_TOKEN:498,CLIENT_CLOSED_REQUEST:499,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,BANDWIDTH_LIMIT_EXCEEDED:509,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511,WEB_SERVER_UNKNOWN_ERROR:520,WEB_SERVER_IS_DOWN:521,CONNECTION_TIMEOUT:522,ORIGIN_IS_UNREACHABLE:523,TIMEOUT_OCCURED:524,SSL_HANDSHAKE_FAILED:525,INVALID_SSL_CERTIFICATE:526,RAILGUN_ERROR:527,SITE_IS_OVERLOADED:529,SITE_IS_FROZEN:530,IDENTITY_PROVIDER_AUTHENTICATION_ERROR:561,NETWORK_READ_TIMEOUT:598,NETWORK_CONNECT_TIMEOUT:599};He.FINISH={SAFE:0,SAFE_WITH_CB:1,UNSAFE:2};He.HEADER_STATE={GENERAL:0,CONNECTION:1,CONTENT_LENGTH:2,TRANSFER_ENCODING:3,UPGRADE:4,CONNECTION_KEEP_ALIVE:5,CONNECTION_CLOSE:6,CONNECTION_UPGRADE:7,TRANSFER_ENCODING_CHUNKED:8};He.METHODS_HTTP=[He.METHODS.DELETE,He.METHODS.GET,He.METHODS.HEAD,He.METHODS.POST,He.METHODS.PUT,He.METHODS.CONNECT,He.METHODS.OPTIONS,He.METHODS.TRACE,He.METHODS.COPY,He.METHODS.LOCK,He.METHODS.MKCOL,He.METHODS.MOVE,He.METHODS.PROPFIND,He.METHODS.PROPPATCH,He.METHODS.SEARCH,He.METHODS.UNLOCK,He.METHODS.BIND,He.METHODS.REBIND,He.METHODS.UNBIND,He.METHODS.ACL,He.METHODS.REPORT,He.METHODS.MKACTIVITY,He.METHODS.CHECKOUT,He.METHODS.MERGE,He.METHODS["M-SEARCH"],He.METHODS.NOTIFY,He.METHODS.SUBSCRIBE,He.METHODS.UNSUBSCRIBE,He.METHODS.PATCH,He.METHODS.PURGE,He.METHODS.MKCALENDAR,He.METHODS.LINK,He.METHODS.UNLINK,He.METHODS.PRI,He.METHODS.SOURCE,He.METHODS.QUERY];He.METHODS_ICE=[He.METHODS.SOURCE];He.METHODS_RTSP=[He.METHODS.OPTIONS,He.METHODS.DESCRIBE,He.METHODS.ANNOUNCE,He.METHODS.SETUP,He.METHODS.PLAY,He.METHODS.PAUSE,He.METHODS.TEARDOWN,He.METHODS.GET_PARAMETER,He.METHODS.SET_PARAMETER,He.METHODS.REDIRECT,He.METHODS.RECORD,He.METHODS.FLUSH,He.METHODS.GET,He.METHODS.POST];He.METHOD_MAP=(0,aws.enumToMap)(He.METHODS);He.H_METHOD_MAP=Object.fromEntries(Object.entries(He.METHODS).filter(([t])=>t.startsWith("H")));He.STATUSES_HTTP=[He.STATUSES.CONTINUE,He.STATUSES.SWITCHING_PROTOCOLS,He.STATUSES.PROCESSING,He.STATUSES.EARLY_HINTS,He.STATUSES.RESPONSE_IS_STALE,He.STATUSES.REVALIDATION_FAILED,He.STATUSES.DISCONNECTED_OPERATION,He.STATUSES.HEURISTIC_EXPIRATION,He.STATUSES.MISCELLANEOUS_WARNING,He.STATUSES.OK,He.STATUSES.CREATED,He.STATUSES.ACCEPTED,He.STATUSES.NON_AUTHORITATIVE_INFORMATION,He.STATUSES.NO_CONTENT,He.STATUSES.RESET_CONTENT,He.STATUSES.PARTIAL_CONTENT,He.STATUSES.MULTI_STATUS,He.STATUSES.ALREADY_REPORTED,He.STATUSES.TRANSFORMATION_APPLIED,He.STATUSES.IM_USED,He.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,He.STATUSES.MULTIPLE_CHOICES,He.STATUSES.MOVED_PERMANENTLY,He.STATUSES.FOUND,He.STATUSES.SEE_OTHER,He.STATUSES.NOT_MODIFIED,He.STATUSES.USE_PROXY,He.STATUSES.SWITCH_PROXY,He.STATUSES.TEMPORARY_REDIRECT,He.STATUSES.PERMANENT_REDIRECT,He.STATUSES.BAD_REQUEST,He.STATUSES.UNAUTHORIZED,He.STATUSES.PAYMENT_REQUIRED,He.STATUSES.FORBIDDEN,He.STATUSES.NOT_FOUND,He.STATUSES.METHOD_NOT_ALLOWED,He.STATUSES.NOT_ACCEPTABLE,He.STATUSES.PROXY_AUTHENTICATION_REQUIRED,He.STATUSES.REQUEST_TIMEOUT,He.STATUSES.CONFLICT,He.STATUSES.GONE,He.STATUSES.LENGTH_REQUIRED,He.STATUSES.PRECONDITION_FAILED,He.STATUSES.PAYLOAD_TOO_LARGE,He.STATUSES.URI_TOO_LONG,He.STATUSES.UNSUPPORTED_MEDIA_TYPE,He.STATUSES.RANGE_NOT_SATISFIABLE,He.STATUSES.EXPECTATION_FAILED,He.STATUSES.IM_A_TEAPOT,He.STATUSES.PAGE_EXPIRED,He.STATUSES.ENHANCE_YOUR_CALM,He.STATUSES.MISDIRECTED_REQUEST,He.STATUSES.UNPROCESSABLE_ENTITY,He.STATUSES.LOCKED,He.STATUSES.FAILED_DEPENDENCY,He.STATUSES.TOO_EARLY,He.STATUSES.UPGRADE_REQUIRED,He.STATUSES.PRECONDITION_REQUIRED,He.STATUSES.TOO_MANY_REQUESTS,He.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,He.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,He.STATUSES.LOGIN_TIMEOUT,He.STATUSES.NO_RESPONSE,He.STATUSES.RETRY_WITH,He.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,He.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,He.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,He.STATUSES.INVALID_X_FORWARDED_FOR,He.STATUSES.REQUEST_HEADER_TOO_LARGE,He.STATUSES.SSL_CERTIFICATE_ERROR,He.STATUSES.SSL_CERTIFICATE_REQUIRED,He.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,He.STATUSES.INVALID_TOKEN,He.STATUSES.CLIENT_CLOSED_REQUEST,He.STATUSES.INTERNAL_SERVER_ERROR,He.STATUSES.NOT_IMPLEMENTED,He.STATUSES.BAD_GATEWAY,He.STATUSES.SERVICE_UNAVAILABLE,He.STATUSES.GATEWAY_TIMEOUT,He.STATUSES.HTTP_VERSION_NOT_SUPPORTED,He.STATUSES.VARIANT_ALSO_NEGOTIATES,He.STATUSES.INSUFFICIENT_STORAGE,He.STATUSES.LOOP_DETECTED,He.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,He.STATUSES.NOT_EXTENDED,He.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,He.STATUSES.WEB_SERVER_UNKNOWN_ERROR,He.STATUSES.WEB_SERVER_IS_DOWN,He.STATUSES.CONNECTION_TIMEOUT,He.STATUSES.ORIGIN_IS_UNREACHABLE,He.STATUSES.TIMEOUT_OCCURED,He.STATUSES.SSL_HANDSHAKE_FAILED,He.STATUSES.INVALID_SSL_CERTIFICATE,He.STATUSES.RAILGUN_ERROR,He.STATUSES.SITE_IS_OVERLOADED,He.STATUSES.SITE_IS_FROZEN,He.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,He.STATUSES.NETWORK_READ_TIMEOUT,He.STATUSES.NETWORK_CONNECT_TIMEOUT];He.ALPHA=[];for(let t=65;t<=90;t++)He.ALPHA.push(String.fromCharCode(t)),He.ALPHA.push(String.fromCharCode(t+32));He.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};He.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};He.NUM=["0","1","2","3","4","5","6","7","8","9"];He.ALPHANUM=He.ALPHA.concat(He.NUM);He.MARK=["-","_",".","!","~","*","'","(",")"];He.USERINFO_CHARS=He.ALPHANUM.concat(He.MARK).concat(["%",";",":","&","=","+","$",","]);He.URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(He.ALPHANUM);He.HEX=He.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);He.TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(He.ALPHANUM);He.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&He.HEADER_CHARS.push(t);He.CONNECTION_TOKEN_CHARS=He.HEADER_CHARS.filter(t=>t!==44);He.QUOTED_STRING=[" "," "];for(let t=33;t<=255;t++)t!==34&&t!==92&&He.QUOTED_STRING.push(t);He.HTAB_SP_VCHAR_OBS_TEXT=[" "," "];for(let t=33;t<=126;t++)He.HTAB_SP_VCHAR_OBS_TEXT.push(t);for(let t=128;t<=255;t++)He.HTAB_SP_VCHAR_OBS_TEXT.push(t);He.MAJOR=He.NUM_MAP;He.MINOR=He.MAJOR;He.SPECIAL_HEADERS={connection:He.HEADER_STATE.CONNECTION,"content-length":He.HEADER_STATE.CONTENT_LENGTH,"proxy-connection":He.HEADER_STATE.CONNECTION,"transfer-encoding":He.HEADER_STATE.TRANSFER_ENCODING,upgrade:He.HEADER_STATE.UPGRADE};He.default={ERROR:He.ERROR,TYPE:He.TYPE,FLAGS:He.FLAGS,LENIENT_FLAGS:He.LENIENT_FLAGS,METHODS:He.METHODS,STATUSES:He.STATUSES,FINISH:He.FINISH,HEADER_STATE:He.HEADER_STATE,ALPHA:He.ALPHA,NUM_MAP:He.NUM_MAP,HEX_MAP:He.HEX_MAP,NUM:He.NUM,ALPHANUM:He.ALPHANUM,MARK:He.MARK,USERINFO_CHARS:He.USERINFO_CHARS,URL_CHAR:He.URL_CHAR,HEX:He.HEX,TOKEN:He.TOKEN,HEADER_CHARS:He.HEADER_CHARS,CONNECTION_TOKEN_CHARS:He.CONNECTION_TOKEN_CHARS,QUOTED_STRING:He.QUOTED_STRING,HTAB_SP_VCHAR_OBS_TEXT:He.HTAB_SP_VCHAR_OBS_TEXT,MAJOR:He.MAJOR,MINOR:He.MINOR,SPECIAL_HEADERS:He.SPECIAL_HEADERS,METHODS_HTTP:He.METHODS_HTTP,METHODS_ICE:He.METHODS_ICE,METHODS_RTSP:He.METHODS_RTSP,METHOD_MAP:He.METHOD_MAP,H_METHOD_MAP:He.H_METHOD_MAP,STATUSES_HTTP:He.STATUSES_HTTP}});var ior=I((Llf,gUn)=>{"use strict";p();var{Buffer:cws}=require("node:buffer"),lws="AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCq/ZAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgL5YUCAgd/A34gASACaiEEAkAgACIDKAIMIgANACADKAIEBEAgAyABNgIECyMAQRBrIgkkAAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAygCHCICQQJrDvwBAfkBAgMEBQYHCAkKCwwNDg8QERL4ARP3ARQV9gEWF/UBGBkaGxwdHh8g/QH7ASH0ASIjJCUmJygpKivzASwtLi8wMTLyAfEBMzTwAe8BNTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5P+gFQUVJT7gHtAVTsAVXrAVZXWFla6gFbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHpAegBzwHnAdAB5gHRAdIB0wHUAeUB1QHWAdcB2AHZAdoB2wHcAd0B3gHfAeAB4QHiAeMBAPwBC0EADOMBC0EODOIBC0ENDOEBC0EPDOABC0EQDN8BC0ETDN4BC0EUDN0BC0EVDNwBC0EWDNsBC0EXDNoBC0EYDNkBC0EZDNgBC0EaDNcBC0EbDNYBC0EcDNUBC0EdDNQBC0EeDNMBC0EfDNIBC0EgDNEBC0EhDNABC0EIDM8BC0EiDM4BC0EkDM0BC0EjDMwBC0EHDMsBC0ElDMoBC0EmDMkBC0EnDMgBC0EoDMcBC0ESDMYBC0ERDMUBC0EpDMQBC0EqDMMBC0ErDMIBC0EsDMEBC0HeAQzAAQtBLgy/AQtBLwy+AQtBMAy9AQtBMQy8AQtBMgy7AQtBMwy6AQtBNAy5AQtB3wEMuAELQTUMtwELQTkMtgELQQwMtQELQTYMtAELQTcMswELQTgMsgELQT4MsQELQToMsAELQeABDK8BC0ELDK4BC0E/DK0BC0E7DKwBC0EKDKsBC0E8DKoBC0E9DKkBC0HhAQyoAQtBwQAMpwELQcAADKYBC0HCAAylAQtBCQykAQtBLQyjAQtBwwAMogELQcQADKEBC0HFAAygAQtBxgAMnwELQccADJ4BC0HIAAydAQtByQAMnAELQcoADJsBC0HLAAyaAQtBzAAMmQELQc0ADJgBC0HOAAyXAQtBzwAMlgELQdAADJUBC0HRAAyUAQtB0gAMkwELQdMADJIBC0HVAAyRAQtB1AAMkAELQdYADI8BC0HXAAyOAQtB2AAMjQELQdkADIwBC0HaAAyLAQtB2wAMigELQdwADIkBC0HdAAyIAQtB3gAMhwELQd8ADIYBC0HgAAyFAQtB4QAMhAELQeIADIMBC0HjAAyCAQtB5AAMgQELQeUADIABC0HiAQx/C0HmAAx+C0HnAAx9C0EGDHwLQegADHsLQQUMegtB6QAMeQtBBAx4C0HqAAx3C0HrAAx2C0HsAAx1C0HtAAx0C0EDDHMLQe4ADHILQe8ADHELQfAADHALQfIADG8LQfEADG4LQfMADG0LQfQADGwLQfUADGsLQfYADGoLQQIMaQtB9wAMaAtB+AAMZwtB+QAMZgtB+gAMZQtB+wAMZAtB/AAMYwtB/QAMYgtB/gAMYQtB/wAMYAtBgAEMXwtBgQEMXgtBggEMXQtBgwEMXAtBhAEMWwtBhQEMWgtBhgEMWQtBhwEMWAtBiAEMVwtBiQEMVgtBigEMVQtBiwEMVAtBjAEMUwtBjQEMUgtBjgEMUQtBjwEMUAtBkAEMTwtBkQEMTgtBkgEMTQtBkwEMTAtBlAEMSwtBlQEMSgtBlgEMSQtBlwEMSAtBmAEMRwtBmQEMRgtBmgEMRQtBmwEMRAtBnAEMQwtBnQEMQgtBngEMQQtBnwEMQAtBoAEMPwtBoQEMPgtBogEMPQtBowEMPAtBpAEMOwtBpQEMOgtBpgEMOQtBpwEMOAtBqAEMNwtBqQEMNgtBqgEMNQtBqwEMNAtBrAEMMwtBrQEMMgtBrgEMMQtBrwEMMAtBsAEMLwtBsQEMLgtBsgEMLQtBswEMLAtBtAEMKwtBtQEMKgtBtgEMKQtBtwEMKAtBuAEMJwtBuQEMJgtBugEMJQtBuwEMJAtBvAEMIwtBvQEMIgtBvgEMIQtBvwEMIAtBwAEMHwtBwQEMHgtBwgEMHQtBAQwcC0HDAQwbC0HEAQwaC0HFAQwZC0HGAQwYC0HHAQwXC0HIAQwWC0HJAQwVC0HKAQwUC0HLAQwTC0HMAQwSC0HNAQwRC0HOAQwQC0HPAQwPC0HQAQwOC0HRAQwNC0HSAQwMC0HTAQwLC0HUAQwKC0HVAQwJC0HWAQwIC0HjAQwHC0HXAQwGC0HYAQwFC0HZAQwEC0HaAQwDC0HbAQwCC0HdAQwBC0HcAQshAgNAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJ/AkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAg7jAQABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEjJCUnKCmeA5sDmgORA4oDgwOAA/0C+wL4AvIC8QLvAu0C6ALnAuYC5QLkAtwC2wLaAtkC2ALXAtYC1QLPAs4CzALLAsoCyQLIAscCxgLEAsMCvgK8AroCuQK4ArcCtgK1ArQCswKyArECsAKuAq0CqQKoAqcCpgKlAqQCowKiAqECoAKfApgCkAKMAosCigKBAv4B/QH8AfsB+gH5AfgB9wH1AfMB8AHrAekB6AHnAeYB5QHkAeMB4gHhAeAB3wHeAd0B3AHaAdkB2AHXAdYB1QHUAdMB0gHRAdABzwHOAc0BzAHLAcoByQHIAccBxgHFAcQBwwHCAcEBwAG/Ab4BvQG8AbsBugG5AbgBtwG2AbUBtAGzAbIBsQGwAa8BrgGtAawBqwGqAakBqAGnAaYBpQGkAaMBogGfAZ4BmQGYAZcBlgGVAZQBkwGSAZEBkAGPAY0BjAGHAYYBhQGEAYMBggF9fHt6eXZ1dFBRUlNUVQsgASAERw1yQf0BIQIMvgMLIAEgBEcNmAFB2wEhAgy9AwsgASAERw3xAUGOASECDLwDCyABIARHDfwBQYQBIQIMuwMLIAEgBEcNigJB/wAhAgy6AwsgASAERw2RAkH9ACECDLkDCyABIARHDZQCQfsAIQIMuAMLIAEgBEcNHkEeIQIMtwMLIAEgBEcNGUEYIQIMtgMLIAEgBEcNygJBzQAhAgy1AwsgASAERw3VAkHGACECDLQDCyABIARHDdYCQcMAIQIMswMLIAEgBEcN3AJBOCECDLIDCyADLQAwQQFGDa0DDIkDC0EAIQACQAJAAkAgAy0AKkUNACADLQArRQ0AIAMvATIiAkECcUUNAQwCCyADLwEyIgJBAXFFDQELQQEhACADLQAoQQFGDQAgAy8BNCIGQeQAa0HkAEkNACAGQcwBRg0AIAZBsAJGDQAgAkHAAHENAEEAIQAgAkGIBHFBgARGDQAgAkEocUEARyEACyADQQA7ATIgA0EAOgAxAkAgAEUEQCADQQA6ADEgAy0ALkEEcQ0BDLEDCyADQgA3AyALIANBADoAMSADQQE6ADYMSAtBACEAAkAgAygCOCICRQ0AIAIoAjAiAkUNACADIAIRAAAhAAsgAEUNSCAAQRVHDWIgA0EENgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMrwMLIAEgBEYEQEEGIQIMrwMLIAEtAABBCkcNGSABQQFqIQEMGgsgA0IANwMgQRIhAgyUAwsgASAERw2KA0EjIQIMrAMLIAEgBEYEQEEHIQIMrAMLAkACQCABLQAAQQprDgQBGBgAGAsgAUEBaiEBQRAhAgyTAwsgAUEBaiEBIANBL2otAABBAXENF0EAIQIgA0EANgIcIAMgATYCFCADQZkgNgIQIANBGTYCDAyrAwsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFoNGEEIIQIMqgMLIAEgBEcEQCADQQk2AgggAyABNgIEQRQhAgyRAwtBCSECDKkDCyADKQMgUA2uAgxDCyABIARGBEBBCyECDKgDCyABLQAAQQpHDRYgAUEBaiEBDBcLIANBL2otAABBAXFFDRkMJgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0ZDEILQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGgwkC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRsMMgsgA0Evai0AAEEBcUUNHAwiC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADRwMQgtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0dDCALIAEgBEYEQEETIQIMoAMLAkAgAS0AACIAQQprDgQfIyMAIgsgAUEBaiEBDB8LQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIgxCCyABIARGBEBBFiECDJ4DCyABLQAAQcDBAGotAABBAUcNIwyDAwsCQANAIAEtAABBsDtqLQAAIgBBAUcEQAJAIABBAmsOAgMAJwsgAUEBaiEBQSEhAgyGAwsgBCABQQFqIgFHDQALQRghAgydAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAFBAWoiARA0IgANIQxBC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADSMMKgsgASAERgRAQRwhAgybAwsgA0EKNgIIIAMgATYCBEEAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADSVBJCECDIEDCyABIARHBEADQCABLQAAQbA9ai0AACIAQQNHBEAgAEEBaw4FGBomggMlJgsgBCABQQFqIgFHDQALQRshAgyaAwtBGyECDJkDCwNAIAEtAABBsD9qLQAAIgBBA0cEQCAAQQFrDgUPEScTJicLIAQgAUEBaiIBRw0AC0EeIQIMmAMLIAEgBEcEQCADQQs2AgggAyABNgIEQQchAgz/AgtBHyECDJcDCyABIARGBEBBICECDJcDCwJAIAEtAABBDWsOFC4/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8APwtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQMlgMLIANBL2ohAgNAIAEgBEYEQEEhIQIMlwMLAkACQAJAIAEtAAAiAEEJaw4YAgApKQEpKSkpKSkpKSkpKSkpKSkpKSkCJwsgAUEBaiEBIANBL2otAABBAXFFDQoMGAsgAUEBaiEBDBcLIAFBAWohASACLQAAQQJxDQALQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDJUDCyADLQAuQYABcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUN5gIgAEEVRgRAIANBJDYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDJQDC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAyTAwtBACECIANBADYCHCADIAE2AhQgA0G+IDYCECADQQI2AgwMkgMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABIAynaiIBEDIiAEUNKyADQQc2AhwgAyABNgIUIAMgADYCDAyRAwsgAy0ALkHAAHFFDQELQQAhAAJAIAMoAjgiAkUNACACKAJYIgJFDQAgAyACEQAAIQALIABFDSsgAEEVRgRAIANBCjYCHCADIAE2AhQgA0HrGTYCECADQRU2AgxBACECDJADC0EAIQIgA0EANgIcIAMgATYCFCADQZMMNgIQIANBEzYCDAyPAwtBACECIANBADYCHCADIAE2AhQgA0GCFTYCECADQQI2AgwMjgMLQQAhAiADQQA2AhwgAyABNgIUIANB3RQ2AhAgA0EZNgIMDI0DC0EAIQIgA0EANgIcIAMgATYCFCADQeYdNgIQIANBGTYCDAyMAwsgAEEVRg09QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIsDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFDSggA0ENNgIcIAMgATYCFCADIAA2AgwMigMLIABBFUYNOkEAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAyJAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwoCyADQQ42AhwgAyAANgIMIAMgAUEBajYCFAyIAwsgAEEVRg03QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIcDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCcLIANBDzYCHCADIAA2AgwgAyABQQFqNgIUDIYDC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAyFAwsgAEEVRg0zQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIQDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFDSUgA0ERNgIcIAMgATYCFCADIAA2AgwMgwMLIABBFUYNMEEAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAyCAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwlCyADQRI2AhwgAyAANgIMIAMgAUEBajYCFAyBAwsgA0Evai0AAEEBcUUNAQtBFyECDOYCC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAz+AgsgAEE7Rw0AIAFBAWohAQwMC0EAIQIgA0EANgIcIAMgATYCFCADQZIYNgIQIANBAjYCDAz8AgsgAEEVRg0oQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDPsCCyADQRQ2AhwgAyABNgIUIAMgADYCDAz6AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQz1AgsgA0EVNgIcIAMgADYCDCADIAFBAWo2AhQM+QILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM8wILIANBFzYCHCADIAA2AgwgAyABQQFqNgIUDPgCCyAAQRVGDSNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM9wILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEMHQsgA0EZNgIcIAMgADYCDCADIAFBAWo2AhQM9gILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM7wILIANBGjYCHCADIAA2AgwgAyABQQFqNgIUDPUCCyAAQRVGDR9BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwM9AILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwbCyADQRw2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8wILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQzrAgsgA0EdNgIcIAMgADYCDCADIAFBAWo2AhRBACECDPICCyAAQTtHDQEgAUEBaiEBC0EmIQIM1wILQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDO8CCyABIARHBEADQCABLQAAQSBHDYQCIAQgAUEBaiIBRw0AC0EsIQIM7wILQSwhAgzuAgsgASAERgRAQTQhAgzuAgsCQAJAA0ACQCABLQAAQQprDgQCAAADAAsgBCABQQFqIgFHDQALQTQhAgzvAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDZ8CIANBMjYCHCADIAE2AhQgAyAANgIMQQAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDJ8CCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM7QILIAEgBEcEQAJAA0AgAS0AAEEwayIAQf8BcUEKTwRAQTohAgzXAgsgAykDICILQpmz5syZs+bMGVYNASADIAtCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAMgCiALfDcDICAEIAFBAWoiAUcNAAtBwAAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgAUEBaiIBEDEiAA0XDOICC0HAACECDOwCCyABIARGBEBByQAhAgzsAgsCQANAAkAgAS0AAEEJaw4YAAKiAqICqQKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogIAogILIAQgAUEBaiIBRw0AC0HJACECDOwCCyABQQFqIQEgA0Evai0AAEEBcQ2lAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgzrAgsgASAERwRAA0AgAS0AAEEgRw0VIAQgAUEBaiIBRw0AC0H4ACECDOsCC0H4ACECDOoCCyADQQI6ACgMOAtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQM6AILQQAhAgzOAgtBDSECDM0CC0ETIQIMzAILQRUhAgzLAgtBFiECDMoCC0EYIQIMyQILQRkhAgzIAgtBGiECDMcCC0EbIQIMxgILQRwhAgzFAgtBHSECDMQCC0EeIQIMwwILQR8hAgzCAgtBICECDMECC0EiIQIMwAILQSMhAgy/AgtBJSECDL4CC0HlACECDL0CCyADQT02AhwgAyABNgIUIAMgADYCDEEAIQIM1QILIANBGzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDNQCCyADQSA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzTAgsgA0ETNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0gILIANBCzYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNECCyADQRA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzQAgsgA0EgNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzwILIANBCzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM4CCyADQQw2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzNAgtBACECIANBADYCHCADIAE2AhQgA0HdDjYCECADQRI2AgwMzAILAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB/QEhAgzMAgsCQAJAIAMtADZBAUcNAEEAIQACQCADKAI4IgJFDQAgAigCYCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUcNASADQfwBNgIcIAMgATYCFCADQdwZNgIQIANBFTYCDEEAIQIMzQILQdwBIQIMswILIANBADYCHCADIAE2AhQgA0H5CzYCECADQR82AgxBACECDMsCCwJAAkAgAy0AKEEBaw4CBAEAC0HbASECDLICC0HUASECDLECCyADQQI6ADFBACEAAkAgAygCOCICRQ0AIAIoAgAiAkUNACADIAIRAAAhAAsgAEUEQEHdASECDLECCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQbQMNgIQIANBEDYCDEEAIQIMygILIANB+wE2AhwgAyABNgIUIANBgRo2AhAgA0EVNgIMQQAhAgzJAgsgASAERgRAQfoBIQIMyQILIAEtAABByABGDQEgA0EBOgAoC0HAASECDK4CC0HaASECDK0CCyABIARHBEAgA0EMNgIIIAMgATYCBEHZASECDK0CC0H5ASECDMUCCyABIARGBEBB+AEhAgzFAgsgAS0AAEHIAEcNBCABQQFqIQFB2AEhAgyrAgsgASAERgRAQfcBIQIMxAILAkACQCABLQAAQcUAaw4QAAUFBQUFBQUFBQUFBQUFAQULIAFBAWohAUHWASECDKsCCyABQQFqIQFB1wEhAgyqAgtB9gEhAiABIARGDcICIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbrVAGotAABHDQMgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMMCCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIARQRAQeMBIQIMqgILIANB9QE2AhwgAyABNgIUIAMgADYCDEEAIQIMwgILQfQBIQIgASAERg3BAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEG41QBqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzCAgsgA0GBBDsBKCADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIADQMMAgsgA0EANgIAC0EAIQIgA0EANgIcIAMgATYCFCADQeUfNgIQIANBCDYCDAy/AgtB1QEhAgylAgsgA0HzATYCHCADIAE2AhQgAyAANgIMQQAhAgy9AgtBACEAAkAgAygCOCICRQ0AIAIoAkAiAkUNACADIAIRAAAhAAsgAEUNbiAAQRVHBEAgA0EANgIcIAMgATYCFCADQYIPNgIQIANBIDYCDEEAIQIMvQILIANBjwE2AhwgAyABNgIUIANB7Bs2AhAgA0EVNgIMQQAhAgy8AgsgASAERwRAIANBDTYCCCADIAE2AgRB0wEhAgyjAgtB8gEhAgy7AgsgASAERgRAQfEBIQIMuwILAkACQAJAIAEtAABByABrDgsAAQgICAgICAgIAggLIAFBAWohAUHQASECDKMCCyABQQFqIQFB0QEhAgyiAgsgAUEBaiEBQdIBIQIMoQILQfABIQIgASAERg25AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBtdUAai0AAEcNBCAAQQJGDQMgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuQILQe8BIQIgASAERg24AiADKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABBs9UAai0AAEcNAyAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuAILQe4BIQIgASAERg23AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMtwILIAMoAgQhACADQgA3AwAgAyAAIAVBAWoiARArIgBFDQIgA0HsATYCHCADIAE2AhQgAyAANgIMQQAhAgy2AgsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNnAIgA0HtATYCHCADIAE2AhQgAyAANgIMQQAhAgy0AgtBzwEhAgyaAgtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDLQCC0HOASECDJoCCyADQesBNgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMsgILIAEgBEYEQEHrASECDLICCyABLQAAQS9GBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GyODYCECADQQg2AgxBACECDLECC0HNASECDJcCCyABIARHBEAgA0EONgIIIAMgATYCBEHMASECDJcCC0HqASECDK8CCyABIARGBEBB6QEhAgyvAgsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFBywEhAgyWAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZcCIANB6AE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAEgBEYEQEHnASECDK4CCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5gE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILQcoBIQIMlAILIAEgBEYEQEHlASECDK0CC0EAIQBBASEFQQEhB0EAIQICQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQCABLQAAQTBrDgoKCQABAgMEBQYICwtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshAkEAIQVBACEHDAILQQkhAkEBIQBBACEFQQAhBwwBC0EAIQVBASECCyADIAI6ACsgAUEBaiEBAkACQCADLQAuQRBxDQACQAJAAkAgAy0AKg4DAQACBAsgB0UNAwwCCyAADQEMAgsgBUUNAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDQIgA0HiATYCHCADIAE2AhQgAyAANgIMQQAhAgyvAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZoCIANB4wE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ2YAiADQeQBNgIcIAMgATYCFCADIAA2AgwMrQILQckBIQIMkwILQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgytAgtByAEhAgyTAgsgA0HhATYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDKsCCyABIARGBEBB4QEhAgyrAgsCQCABLQAAQSBGBEAgA0EAOwE0IAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBmRE2AhAgA0EJNgIMQQAhAgyrAgtBxwEhAgyRAgsgASAERgRAQeABIQIMqgILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyrAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqgILQcYBIQIMkAILIAEgBEYEQEHfASECDKkCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqgILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKkCC0HFASECDI8CCyABIARGBEBB3gEhAgyoAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKkCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyoAgtBxAEhAgyOAgsgASAERgRAQd0BIQIMpwILAkACQAJAAkAgAS0AAEEKaw4XAgMDAAMDAwMDAwMDAwMDAwMDAwMDAwEDCyABQQFqDAULIAFBAWohAUHDASECDI8CCyABQQFqIQEgA0Evai0AAEEBcQ0IIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKcCCyADQQA2AhwgAyABNgIUIANBjQs2AhAgA0ENNgIMQQAhAgymAgsgASAERwRAIANBDzYCCCADIAE2AgRBASECDI0CC0HcASECDKUCCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtB2wEhAgymAgsgAygCBCEAIANBADYCBCADIAAgARAtIgBFBEAgAUEBaiEBDAQLIANB2gE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMpQILIAMoAgQhACADQQA2AgQgAyAAIAEQLSIADQEgAUEBagshAUHBASECDIoCCyADQdkBNgIcIAMgADYCDCADIAFBAWo2AhRBACECDKICC0HCASECDIgCCyADQS9qLQAAQQFxDQEgA0EANgIcIAMgATYCFCADQeQcNgIQIANBGTYCDEEAIQIMoAILIAEgBEYEQEHZASECDKACCwJAAkACQCABLQAAQQprDgQBAgIAAgsgAUEBaiEBDAILIAFBAWohAQwBCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAjwiAkUNACADIAIRAAAhAAsgAEUNoAEgAEEVRgRAIANB2QA2AhwgAyABNgIUIANBtxo2AhAgA0EVNgIMQQAhAgyfAgsgA0EANgIcIAMgATYCFCADQYANNgIQIANBGzYCDEEAIQIMngILIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDJ0CCyABIARHBEAgA0EMNgIIIAMgATYCBEG/ASECDIQCC0HYASECDJwCCyABIARGBEBB1wEhAgycAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBwQBrDhUAAQIDWgQFBlpaWgcICQoLDA0ODxBaCyABQQFqIQFB+wAhAgySAgsgAUEBaiEBQfwAIQIMkQILIAFBAWohAUGBASECDJACCyABQQFqIQFBhQEhAgyPAgsgAUEBaiEBQYYBIQIMjgILIAFBAWohAUGJASECDI0CCyABQQFqIQFBigEhAgyMAgsgAUEBaiEBQY0BIQIMiwILIAFBAWohAUGWASECDIoCCyABQQFqIQFBlwEhAgyJAgsgAUEBaiEBQZgBIQIMiAILIAFBAWohAUGlASECDIcCCyABQQFqIQFBpgEhAgyGAgsgAUEBaiEBQawBIQIMhQILIAFBAWohAUG0ASECDIQCCyABQQFqIQFBtwEhAgyDAgsgAUEBaiEBQb4BIQIMggILIAEgBEYEQEHWASECDJsCCyABLQAAQc4ARw1IIAFBAWohAUG9ASECDIECCyABIARGBEBB1QEhAgyaAgsCQAJAAkAgAS0AAEHCAGsOEgBKSkpKSkpKSkoBSkpKSkpKAkoLIAFBAWohAUG4ASECDIICCyABQQFqIQFBuwEhAgyBAgsgAUEBaiEBQbwBIQIMgAILQdQBIQIgASAERg2YAiADKAIAIgAgBCABa2ohBSABIABrQQdqIQYCQANAIAEtAAAgAEGo1QBqLQAARw1FIABBB0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAgsgA0EANgIAIAZBAWohAUEbDEULIAEgBEYEQEHTASECDJgCCwJAAkAgAS0AAEHJAGsOBwBHR0dHRwFHCyABQQFqIQFBuQEhAgz/AQsgAUEBaiEBQboBIQIM/gELQdIBIQIgASAERg2WAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw1DIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyXAgsgA0EANgIAIAZBAWohAUEPDEMLQdEBIQIgASAERg2VAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw1CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyWAgsgA0EANgIAIAZBAWohAUEgDEILQdABIQIgASAERg2UAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw1BIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyVAgsgA0EANgIAIAZBAWohAUESDEELIAEgBEYEQEHPASECDJQCCwJAAkAgAS0AAEHFAGsODgBDQ0NDQ0NDQ0NDQ0MBQwsgAUEBaiEBQbUBIQIM+wELIAFBAWohAUG2ASECDPoBC0HOASECIAEgBEYNkgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBntUAai0AAEcNPyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkwILIANBADYCACAGQQFqIQFBBww/C0HNASECIAEgBEYNkQIgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBmNUAai0AAEcNPiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkgILIANBADYCACAGQQFqIQFBKAw+CyABIARGBEBBzAEhAgyRAgsCQAJAAkAgAS0AAEHFAGsOEQBBQUFBQUFBQUEBQUFBQUECQQsgAUEBaiEBQbEBIQIM+QELIAFBAWohAUGyASECDPgBCyABQQFqIQFBswEhAgz3AQtBywEhAiABIARGDY8CIAMoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQZHVAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJACCyADQQA2AgAgBkEBaiEBQRoMPAtBygEhAiABIARGDY4CIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQY3VAGotAABHDTsgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADI8CCyADQQA2AgAgBkEBaiEBQSEMOwsgASAERgRAQckBIQIMjgILAkACQCABLQAAQcEAaw4UAD09PT09PT09PT09PT09PT09PQE9CyABQQFqIQFBrQEhAgz1AQsgAUEBaiEBQbABIQIM9AELIAEgBEYEQEHIASECDI0CCwJAAkAgAS0AAEHVAGsOCwA8PDw8PDw8PDwBPAsgAUEBaiEBQa4BIQIM9AELIAFBAWohAUGvASECDPMBC0HHASECIAEgBEYNiwIgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNOCAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjAILIANBADYCACAGQQFqIQFBKgw4CyABIARGBEBBxgEhAgyLAgsgAS0AAEHQAEcNOCABQQFqIQFBJQw3C0HFASECIAEgBEYNiQIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBgdUAai0AAEcNNiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMigILIANBADYCACAGQQFqIQFBDgw2CyABIARGBEBBxAEhAgyJAgsgAS0AAEHFAEcNNiABQQFqIQFBqwEhAgzvAQsgASAERgRAQcMBIQIMiAILAkACQAJAAkAgAS0AAEHCAGsODwABAjk5OTk5OTk5OTk5AzkLIAFBAWohAUGnASECDPEBCyABQQFqIQFBqAEhAgzwAQsgAUEBaiEBQakBIQIM7wELIAFBAWohAUGqASECDO4BC0HCASECIAEgBEYNhgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB/tQAai0AAEcNMyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhwILIANBADYCACAGQQFqIQFBFAwzC0HBASECIAEgBEYNhQIgAygCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABB+dQAai0AAEcNMiAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhgILIANBADYCACAGQQFqIQFBKwwyC0HAASECIAEgBEYNhAIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB9tQAai0AAEcNMSAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhQILIANBADYCACAGQQFqIQFBLAwxC0G/ASECIAEgBEYNgwIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNMCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhAILIANBADYCACAGQQFqIQFBEQwwC0G+ASECIAEgBEYNggIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB8tQAai0AAEcNLyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgwILIANBADYCACAGQQFqIQFBLgwvCyABIARGBEBBvQEhAgyCAgsCQAJAAkACQAJAIAEtAABBwQBrDhUANDQ0NDQ0NDQ0NAE0NAI0NAM0NAQ0CyABQQFqIQFBmwEhAgzsAQsgAUEBaiEBQZwBIQIM6wELIAFBAWohAUGdASECDOoBCyABQQFqIQFBogEhAgzpAQsgAUEBaiEBQaQBIQIM6AELIAEgBEYEQEG8ASECDIECCwJAAkAgAS0AAEHSAGsOAwAwATALIAFBAWohAUGjASECDOgBCyABQQFqIQFBBAwtC0G7ASECIAEgBEYN/wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8NQAai0AAEcNLCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgAILIANBADYCACAGQQFqIQFBHQwsCyABIARGBEBBugEhAgz/AQsCQAJAIAEtAABByQBrDgcBLi4uLi4ALgsgAUEBaiEBQaEBIQIM5gELIAFBAWohAUEiDCsLIAEgBEYEQEG5ASECDP4BCyABLQAAQdAARw0rIAFBAWohAUGgASECDOQBCyABIARGBEBBuAEhAgz9AQsCQAJAIAEtAABBxgBrDgsALCwsLCwsLCwsASwLIAFBAWohAUGeASECDOQBCyABQQFqIQFBnwEhAgzjAQtBtwEhAiABIARGDfsBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQezUAGotAABHDSggAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPwBCyADQQA2AgAgBkEBaiEBQQ0MKAtBtgEhAiABIARGDfoBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDScgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPsBCyADQQA2AgAgBkEBaiEBQQwMJwtBtQEhAiABIARGDfkBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQerUAGotAABHDSYgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPoBCyADQQA2AgAgBkEBaiEBQQMMJgtBtAEhAiABIARGDfgBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQejUAGotAABHDSUgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPkBCyADQQA2AgAgBkEBaiEBQSYMJQsgASAERgRAQbMBIQIM+AELAkACQCABLQAAQdQAaw4CAAEnCyABQQFqIQFBmQEhAgzfAQsgAUEBaiEBQZoBIQIM3gELQbIBIQIgASAERg32ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHm1ABqLQAARw0jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz3AQsgA0EANgIAIAZBAWohAUEnDCMLQbEBIQIgASAERg31ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHk1ABqLQAARw0iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz2AQsgA0EANgIAIAZBAWohAUEcDCILQbABIQIgASAERg30ASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHe1ABqLQAARw0hIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz1AQsgA0EANgIAIAZBAWohAUEGDCELQa8BIQIgASAERg3zASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHZ1ABqLQAARw0gIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz0AQsgA0EANgIAIAZBAWohAUEZDCALIAEgBEYEQEGuASECDPMBCwJAAkACQAJAIAEtAABBLWsOIwAkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJAEkJCQkJAIkJCQDJAsgAUEBaiEBQY4BIQIM3AELIAFBAWohAUGPASECDNsBCyABQQFqIQFBlAEhAgzaAQsgAUEBaiEBQZUBIQIM2QELQa0BIQIgASAERg3xASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHX1ABqLQAARw0eIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzyAQsgA0EANgIAIAZBAWohAUELDB4LIAEgBEYEQEGsASECDPEBCwJAAkAgAS0AAEHBAGsOAwAgASALIAFBAWohAUGQASECDNgBCyABQQFqIQFBkwEhAgzXAQsgASAERgRAQasBIQIM8AELAkACQCABLQAAQcEAaw4PAB8fHx8fHx8fHx8fHx8BHwsgAUEBaiEBQZEBIQIM1wELIAFBAWohAUGSASECDNYBCyABIARGBEBBqgEhAgzvAQsgAS0AAEHMAEcNHCABQQFqIQFBCgwbC0GpASECIAEgBEYN7QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABB0dQAai0AAEcNGiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7gELIANBADYCACAGQQFqIQFBHgwaC0GoASECIAEgBEYN7AEgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBytQAai0AAEcNGSAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7QELIANBADYCACAGQQFqIQFBFQwZC0GnASECIAEgBEYN6wEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBx9QAai0AAEcNGCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7AELIANBADYCACAGQQFqIQFBFwwYC0GmASECIAEgBEYN6gEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBwdQAai0AAEcNFyAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6wELIANBADYCACAGQQFqIQFBGAwXCyABIARGBEBBpQEhAgzqAQsCQAJAIAEtAABByQBrDgcAGRkZGRkBGQsgAUEBaiEBQYsBIQIM0QELIAFBAWohAUGMASECDNABC0GkASECIAEgBEYN6AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBptUAai0AAEcNFSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6QELIANBADYCACAGQQFqIQFBCQwVC0GjASECIAEgBEYN5wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBpNUAai0AAEcNFCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6AELIANBADYCACAGQQFqIQFBHwwUC0GiASECIAEgBEYN5gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBvtQAai0AAEcNEyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5wELIANBADYCACAGQQFqIQFBAgwTC0GhASECIAEgBEYN5QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGA0AgAS0AACAAQbzUAGotAABHDREgAEEBRg0CIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADOUBCyABIARGBEBBoAEhAgzlAQtBASABLQAAQd8ARw0RGiABQQFqIQFBhwEhAgzLAQsgA0EANgIAIAZBAWohAUGIASECDMoBC0GfASECIAEgBEYN4gEgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNDyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4wELIANBADYCACAGQQFqIQFBKQwPC0GeASECIAEgBEYN4QEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBuNQAai0AAEcNDiAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4gELIANBADYCACAGQQFqIQFBLQwOCyABIARGBEBBnQEhAgzhAQsgAS0AAEHFAEcNDiABQQFqIQFBhAEhAgzHAQsgASAERgRAQZwBIQIM4AELAkACQCABLQAAQcwAaw4IAA8PDw8PDwEPCyABQQFqIQFBggEhAgzHAQsgAUEBaiEBQYMBIQIMxgELQZsBIQIgASAERg3eASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEGz1ABqLQAARw0LIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzfAQsgA0EANgIAIAZBAWohAUEjDAsLQZoBIQIgASAERg3dASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGw1ABqLQAARw0KIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzeAQsgA0EANgIAIAZBAWohAUEADAoLIAEgBEYEQEGZASECDN0BCwJAAkAgAS0AAEHIAGsOCAAMDAwMDAwBDAsgAUEBaiEBQf0AIQIMxAELIAFBAWohAUGAASECDMMBCyABIARGBEBBmAEhAgzcAQsCQAJAIAEtAABBzgBrDgMACwELCyABQQFqIQFB/gAhAgzDAQsgAUEBaiEBQf8AIQIMwgELIAEgBEYEQEGXASECDNsBCyABLQAAQdkARw0IIAFBAWohAUEIDAcLQZYBIQIgASAERg3ZASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEGs1ABqLQAARw0GIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzaAQsgA0EANgIAIAZBAWohAUEFDAYLQZUBIQIgASAERg3YASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGm1ABqLQAARw0FIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzZAQsgA0EANgIAIAZBAWohAUEWDAULQZQBIQIgASAERg3XASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0EIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzYAQsgA0EANgIAIAZBAWohAUEQDAQLIAEgBEYEQEGTASECDNcBCwJAAkAgAS0AAEHDAGsODAAGBgYGBgYGBgYGAQYLIAFBAWohAUH5ACECDL4BCyABQQFqIQFB+gAhAgy9AQtBkgEhAiABIARGDdUBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQaDUAGotAABHDQIgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNYBCyADQQA2AgAgBkEBaiEBQSQMAgsgA0EANgIADAILIAEgBEYEQEGRASECDNQBCyABLQAAQcwARw0BIAFBAWohAUETCzoAKSADKAIEIQAgA0EANgIEIAMgACABEC4iAA0CDAELQQAhAiADQQA2AhwgAyABNgIUIANB/h82AhAgA0EGNgIMDNEBC0H4ACECDLcBCyADQZABNgIcIAMgATYCFCADIAA2AgxBACECDM8BC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUYNASADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgzOAQtB9wAhAgy0AQsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDMwBCyABIARGBEBBjwEhAgzMAQsCQCABLQAAQSBGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GbHzYCECADQQY2AgxBACECDMwBC0ECIQIMsgELA0AgAS0AAEEgRw0CIAQgAUEBaiIBRw0AC0GOASECDMoBCyABIARGBEBBjQEhAgzKAQsCQCABLQAAQQlrDgRKAABKAAtB9QAhAgywAQsgAy0AKUEFRgRAQfYAIQIMsAELQfQAIQIMrwELIAEgBEYEQEGMASECDMgBCyADQRA2AgggAyABNgIEDAoLIAEgBEYEQEGLASECDMcBCwJAIAEtAABBCWsOBEcAAEcAC0HzACECDK0BCyABIARHBEAgA0EQNgIIIAMgATYCBEHxACECDK0BC0GKASECDMUBCwJAIAEgBEcEQANAIAEtAABBoNAAai0AACIAQQNHBEACQCAAQQFrDgJJAAQLQfAAIQIMrwELIAQgAUEBaiIBRw0AC0GIASECDMYBC0GIASECDMUBCyADQQA2AhwgAyABNgIUIANB2yA2AhAgA0EHNgIMQQAhAgzEAQsgASAERgRAQYkBIQIMxAELAkACQAJAIAEtAABBoNIAai0AAEEBaw4DRgIAAQtB8gAhAgysAQsgA0EANgIcIAMgATYCFCADQbQSNgIQIANBBzYCDEEAIQIMxAELQeoAIQIMqgELIAEgBEcEQCABQQFqIQFB7wAhAgyqAQtBhwEhAgzCAQsgBCABIgBGBEBBhgEhAgzCAQsgAC0AACIBQS9GBEAgAEEBaiEBQe4AIQIMqQELIAFBCWsiAkEXSw0BIAAhAUEBIAJ0QZuAgARxDUEMAQsgBCABIgBGBEBBhQEhAgzBAQsgAC0AAEEvRw0AIABBAWohAQwDC0EAIQIgA0EANgIcIAMgADYCFCADQdsgNgIQIANBBzYCDAy/AQsCQAJAAkACQAJAA0AgAS0AAEGgzgBqLQAAIgBBBUcEQAJAAkAgAEEBaw4IRwUGBwgABAEIC0HrACECDK0BCyABQQFqIQFB7QAhAgysAQsgBCABQQFqIgFHDQALQYQBIQIMwwELIAFBAWoMFAsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgzBAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgzAAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy/AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMvgELIAEgBEYEQEGDASECDL4BCwJAIAEtAABBoM4Aai0AAEEBaw4IPgQFBgAIAgMHCyABQQFqIQELQQMhAgyjAQsgAUEBagwNC0EAIQIgA0EANgIcIANB0RI2AhAgA0EHNgIMIAMgAUEBajYCFAy6AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgy5AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgy4AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy3AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMtgELQewAIQIMnAELIAEgBEYEQEGCASECDLUBCyABQQFqDAILIAEgBEYEQEGBASECDLQBCyABQQFqDAELIAEgBEYNASABQQFqCyEBQQQhAgyYAQtBgAEhAgywAQsDQCABLQAAQaDMAGotAAAiAEECRwRAIABBAUcEQEHpACECDJkBCwwxCyAEIAFBAWoiAUcNAAtB/wAhAgyvAQsgASAERgRAQf4AIQIMrwELAkAgAS0AAEEJaw43LwMGLwQGBgYGBgYGBgYGBgYGBgYGBgYFBgYCBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGAAYLIAFBAWoLIQFBBSECDJQBCyABQQFqDAYLIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIANBADYCHCADIAE2AhQgA0GNFDYCECADQQc2AgxBACECDKgBCwJAAkACQAJAA0AgAS0AAEGgygBqLQAAIgBBBUcEQAJAIABBAWsOBi4DBAUGAAYLQegAIQIMlAELIAQgAUEBaiIBRw0AC0H9ACECDKsBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQdsANgIcIAMgATYCFCADIAA2AgxBACECDKoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDKkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQfoANgIcIAMgATYCFCADIAA2AgxBACECDKgBCyADQQA2AhwgAyABNgIUIANB5Ag2AhAgA0EHNgIMQQAhAgynAQsgASAERg0BIAFBAWoLIQFBBiECDIwBC0H8ACECDKQBCwJAAkACQAJAA0AgAS0AAEGgyABqLQAAIgBBBUcEQCAAQQFrDgQpAgMEBQsgBCABQQFqIgFHDQALQfsAIQIMpwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMpgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMpQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMpAELIANBADYCHCADIAE2AhQgA0G8CjYCECADQQc2AgxBACECDKMBC0HPACECDIkBC0HRACECDIgBC0HnACECDIcBCyABIARGBEBB+gAhAgygAQsCQCABLQAAQQlrDgQgAAAgAAsgAUEBaiEBQeYAIQIMhgELIAEgBEYEQEH5ACECDJ8BCwJAIAEtAABBCWsOBB8AAB8AC0EAIQACQCADKAI4IgJFDQAgAigCOCICRQ0AIAMgAhEAACEACyAARQRAQeIBIQIMhgELIABBFUcEQCADQQA2AhwgAyABNgIUIANByQ02AhAgA0EaNgIMQQAhAgyfAQsgA0H4ADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDJ4BCyABIARHBEAgA0ENNgIIIAMgATYCBEHkACECDIUBC0H3ACECDJ0BCyABIARGBEBB9gAhAgydAQsCQAJAAkAgAS0AAEHIAGsOCwABCwsLCwsLCwsCCwsgAUEBaiEBQd0AIQIMhQELIAFBAWohAUHgACECDIQBCyABQQFqIQFB4wAhAgyDAQtB9QAhAiABIARGDZsBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbXVAGotAABHDQggAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJwBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIABEAgA0H0ADYCHCADIAE2AhQgAyAANgIMQQAhAgycAQtB4gAhAgyCAQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJwBC0HhACECDIIBCyADQfMANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMmgELIAMtACkiAEEja0ELSQ0JAkAgAEEGSw0AQQEgAHRBygBxRQ0ADAoLQQAhAiADQQA2AhwgAyABNgIUIANB7Qk2AhAgA0EINgIMDJkBC0HyACECIAEgBEYNmAEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBs9UAai0AAEcNBSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMmQELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfEANgIcIAMgATYCFCADIAA2AgxBACECDJkBC0HfACECDH8LQQAhAAJAIAMoAjgiAkUNACACKAI0IgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANB6g02AhAgA0EmNgIMQQAhAgyZAQtB3gAhAgx/CyADQfAANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMlwELIAMtAClBIUYNBiADQQA2AhwgAyABNgIUIANBkQo2AhAgA0EINgIMQQAhAgyWAQtB7wAhAiABIARGDZUBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDVAGotAABHDQIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIARQ0CIANB7QA2AhwgAyABNgIUIAMgADYCDEEAIQIMlQELIANBADYCAAsgAygCBCEAIANBADYCBCADIAAgARArIgBFDYABIANB7gA2AhwgAyABNgIUIAMgADYCDEEAIQIMkwELQdwAIQIMeQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJMBC0HbACECDHkLIANB7AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyRAQsgAy0AKSIAQSNJDQAgAEEuRg0AIANBADYCHCADIAE2AhQgA0HJCTYCECADQQg2AgxBACECDJABC0HaACECDHYLIAEgBEYEQEHrACECDI8BCwJAIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMjwELQdkAIQIMdQsgASAERwRAIANBDjYCCCADIAE2AgRB2AAhAgx1C0HqACECDI0BCyABIARGBEBB6QAhAgyNAQsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFB1wAhAgx0CyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeiADQegANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyABIARGBEBB5wAhAgyMAQsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELQdYAIQIMcgsgASAERgRAQeUAIQIMiwELQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIANgIcIAMgATYCFCADIAA2AgxBACECDI0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNfSADQeMANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeyADQeQANgIcIAMgATYCFCADIAA2AgwMiwELQdQAIQIMcQsgAy0AKUEiRg2GAUHTACECDHALQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALIABFBEBB1QAhAgxwCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQaQNNgIQIANBITYCDEEAIQIMiQELIANB4QA2AhwgAyABNgIUIANB0Bo2AhAgA0EVNgIMQQAhAgyIAQsgASAERgRAQeAAIQIMiAELAkACQAJAAkACQCABLQAAQQprDgQBBAQABAsgAUEBaiEBDAELIAFBAWohASADQS9qLQAAQQFxRQ0BC0HSACECDHALIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIgBCyADQQA2AhwgAyABNgIUIANBthE2AhAgA0EJNgIMQQAhAgyHAQsgASAERgRAQd8AIQIMhwELIAEtAABBCkYEQCABQQFqIQEMCQsgAy0ALkHAAHENCCADQQA2AhwgAyABNgIUIANBthE2AhAgA0ECNgIMQQAhAgyGAQsgASAERgRAQd0AIQIMhgELIAEtAAAiAkENRgRAIAFBAWohAUHQACECDG0LIAEhACACQQlrDgQFAQEFAQsgBCABIgBGBEBB3AAhAgyFAQsgAC0AAEEKRw0AIABBAWoMAgtBACECIANBADYCHCADIAA2AhQgA0HKLTYCECADQQc2AgwMgwELIAEgBEYEQEHbACECDIMBCwJAIAEtAABBCWsOBAMAAAMACyABQQFqCyEBQc4AIQIMaAsgASAERgRAQdoAIQIMgQELIAEtAABBCWsOBAABAQABC0EAIQIgA0EANgIcIANBmhI2AhAgA0EHNgIMIAMgAUEBajYCFAx/CyADQYASOwEqQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2QA2AhwgAyABNgIUIANB6ho2AhAgA0EVNgIMQQAhAgx+C0HNACECDGQLIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDHwLIAEgBEYEQEHZACECDHwLIAEtAABBIEcNPSABQQFqIQEgAy0ALkEBcQ09IANBADYCHCADIAE2AhQgA0HCHDYCECADQR42AgxBACECDHsLIAEgBEYEQEHYACECDHsLAkACQAJAAkACQCABLQAAIgBBCmsOBAIDAwABCyABQQFqIQFBLCECDGULIABBOkcNASADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgx9CyABQQFqIQEgA0Evai0AAEEBcUUNcyADLQAyQYABcUUEQCADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALAkACQCAADhZNTEsBAQEBAQEBAQEBAQEBAQEBAQEAAQsgA0EpNgIcIAMgATYCFCADQawZNgIQIANBFTYCDEEAIQIMfgsgA0EANgIcIAMgATYCFCADQeULNgIQIANBETYCDEEAIQIMfQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUNWSAAQRVHDQEgA0EFNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMfAtBywAhAgxiC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAx6CyADIAMvATJBgAFyOwEyDDsLIAEgBEcEQCADQRE2AgggAyABNgIEQcoAIQIMYAtB1wAhAgx4CyABIARGBEBB1gAhAgx4CwJAAkACQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQeMAaw4TAEBAQEBAQEBAQEBAQAFAQEACA0ALIAFBAWohAUHGACECDGELIAFBAWohAUHHACECDGALIAFBAWohAUHIACECDF8LIAFBAWohAUHJACECDF4LQdUAIQIgBCABIgBGDXYgBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0IQQQgAUEFRg0KGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx2C0HUACECIAQgASIARg11IAQgAWsgAygCACIBaiEGIAAgAWtBD2ohBwNAIAFBgMgAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNB0EDIAFBD0YNCRogAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdQtB0wAhAiAEIAEiAEYNdCAEIAFrIAMoAgAiAWohBiAAIAFrQQ5qIQcDQCABQeLHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQYgAUEORg0HIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHQLQdIAIQIgBCABIgBGDXMgBCABayADKAIAIgFqIQUgACABa0EBaiEGA0AgAUHgxwBqLQAAIAAtAAAiB0EgciAHIAdBwQBrQf8BcUEaSRtB/wFxRw0FIAFBAUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBTYCAAxzCyABIARGBEBB0QAhAgxzCwJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB7gBrDgcAOTk5OTkBOQsgAUEBaiEBQcMAIQIMWgsgAUEBaiEBQcQAIQIMWQsgA0EANgIAIAZBAWohAUHFACECDFgLQdAAIQIgBCABIgBGDXAgBCABayADKAIAIgFqIQYgACABa0EJaiEHA0AgAUHWxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0CQQIgAUEJRg0EGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxwC0HPACECIAQgASIARg1vIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwNAIAFB0McAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQVGDQIgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMbwsgACEBIANBADYCAAwzC0EBCzoALCADQQA2AgAgB0EBaiEBC0EtIQIMUgsCQANAIAEtAABB0MUAai0AAEEBRw0BIAQgAUEBaiIBRw0AC0HNACECDGsLQcIAIQIMUQsgASAERgRAQcwAIQIMagsgAS0AAEE6RgRAIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0zIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMagsgA0EANgIcIAMgATYCFCADQecRNgIQIANBCjYCDEEAIQIMaQsCQAJAIAMtACxBAmsOAgABJwsgA0Ezai0AAEECcUUNJiADLQAuQQJxDSYgA0EANgIcIAMgATYCFCADQaYUNgIQIANBCzYCDEEAIQIMaQsgAy0AMkEgcUUNJSADLQAuQQJxDSUgA0EANgIcIAMgATYCFCADQb0TNgIQIANBDzYCDEEAIQIMaAtBACEAAkAgAygCOCICRQ0AIAIoAkgiAkUNACADIAIRAAAhAAsgAEUEQEHBACECDE8LIABBFUcEQCADQQA2AhwgAyABNgIUIANBpg82AhAgA0EcNgIMQQAhAgxoCyADQcoANgIcIAMgATYCFCADQYUcNgIQIANBFTYCDEEAIQIMZwsgASAERwRAA0AgAS0AAEHAwQBqLQAAQQFHDRcgBCABQQFqIgFHDQALQcQAIQIMZwtBxAAhAgxmCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUE2IQIMUgsgAUEBaiEBQTchAgxRCyABQQFqIQFBOCECDFALDBULIAQgAUEBaiIBRw0AC0E8IQIMZgtBPCECDGULIAEgBEYEQEHIACECDGULIANBEjYCCCADIAE2AgQCQAJAAkACQAJAIAMtACxBAWsOBBQAAQIJCyADLQAyQSBxDQNB4AEhAgxPCwJAIAMvATIiAEEIcUUNACADLQAoQQFHDQAgAy0ALkEIcUUNAgsgAyAAQff7A3FBgARyOwEyDAsLIAMgAy8BMkEQcjsBMgwECyADQQA2AgQgAyABIAEQMSIABEAgA0HBADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxmCyABQQFqIQEMWAsgA0EANgIcIAMgATYCFCADQfQTNgIQIANBBDYCDEEAIQIMZAtBxwAhAiABIARGDWMgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCAAQcDFAGotAAAgAS0AAEEgckcNASAAQQZGDUogAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMZAsgA0EANgIADAULAkAgASAERwRAA0AgAS0AAEHAwwBqLQAAIgBBAUcEQCAAQQJHDQMgAUEBaiEBDAULIAQgAUEBaiIBRw0AC0HFACECDGQLQcUAIQIMYwsLIANBADoALAwBC0ELIQIMRwtBPyECDEYLAkACQANAIAEtAAAiAEEgRwRAAkAgAEEKaw4EAwUFAwALIABBLEYNAwwECyAEIAFBAWoiAUcNAAtBxgAhAgxgCyADQQg6ACwMDgsgAy0AKEEBRw0CIAMtAC5BCHENAiADKAIEIQAgA0EANgIEIAMgACABEDEiAARAIANBwgA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMXwsgAUEBaiEBDFALQTshAgxECwJAA0AgAS0AACIAQSBHIABBCUdxDQEgBCABQQFqIgFHDQALQcMAIQIMXQsLQTwhAgxCCwJAAkAgASAERwRAA0AgAS0AACIAQSBHBEAgAEEKaw4EAwQEAwQLIAQgAUEBaiIBRw0AC0E/IQIMXQtBPyECDFwLIAMgAy8BMkEgcjsBMgwKCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNTiADQT42AhwgAyABNgIUIAMgADYCDEEAIQIMWgsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkYNAwwMCyAEIAFBAWoiAUcNAAtBNyECDFsLQTchAgxaCyABQQFqIQEMBAtBOyECIAQgASIARg1YIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwJAA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEMPwsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMWQsgA0EANgIAIAAhAQwFC0E6IQIgBCABIgBGDVcgBCABayADKAIAIgFqIQYgACABa0EIaiEHAkADQCABQbTBAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEIRgRAQQUhAQw+CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxYCyADQQA2AgAgACEBDAQLQTkhAiAEIAEiAEYNViAEIAFrIAMoAgAiAWohBiAAIAFrQQNqIQcCQANAIAFBsMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQNGBEBBBiEBDD0LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFcLIANBADYCACAAIQEMAwsCQANAIAEtAAAiAEEgRwRAIABBCmsOBAcEBAcCCyAEIAFBAWoiAUcNAAtBOCECDFYLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCADLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIANBAToALCADIAMvATIgAXI7ATIgACEBDAELIAMgAy8BMkEIcjsBMiAAIQELQT4hAgw7CyADQQA6ACwLQTkhAgw5CyABIARGBEBBNiECDFILAkACQAJAAkACQCABLQAAQQprDgQAAgIBAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDQIgA0EzNgIcIAMgATYCFCADIAA2AgxBACECDFULIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQRAIAFBAWohAQwGCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMVAsgAy0ALkEBcQRAQd8BIQIMOwsgAygCBCEAIANBADYCBCADIAAgARAxIgANAQxJC0E0IQIMOQsgA0E1NgIcIAMgATYCFCADIAA2AgxBACECDFELQTUhAgw3CyADQS9qLQAAQQFxDQAgA0EANgIcIAMgATYCFCADQesWNgIQIANBGTYCDEEAIQIMTwtBMyECDDULIAEgBEYEQEEyIQIMTgsCQCABLQAAQQpGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GSFzYCECADQQM2AgxBACECDE4LQTIhAgw0CyABIARGBEBBMSECDE0LAkAgAS0AACIAQQlGDQAgAEEgRg0AQQEhAgJAIAMtACxBBWsOBAYEBQANCyADIAMvATJBCHI7ATIMDAsgAy0ALkEBcUUNASADLQAsQQhHDQAgA0EAOgAsC0E9IQIMMgsgA0EANgIcIAMgATYCFCADQcIWNgIQIANBCjYCDEEAIQIMSgtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgwGCyABIARGBEBBMCECDEcLIAEtAABBCkYEQCABQQFqIQEMAQsgAy0ALkEBcQ0AIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDEYLQTAhAgwsCyABQQFqIQFBMSECDCsLIAEgBEYEQEEvIQIMRAsgAS0AACIAQQlHIABBIEdxRQRAIAFBAWohASADLQAuQQFxDQEgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDEEAIQIMRAtBASECAkACQAJAAkACQAJAIAMtACxBAmsOBwUEBAMBAgAECyADIAMvATJBCHI7ATIMAwtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgtBLyECDCsLIANBADYCHCADIAE2AhQgA0GEEzYCECADQQs2AgxBACECDEMLQeEBIQIMKQsgASAERgRAQS4hAgxCCyADQQA2AgQgA0ESNgIIIAMgASABEDEiAA0BC0EuIQIMJwsgA0EtNgIcIAMgATYCFCADIAA2AgxBACECDD8LQQAhAAJAIAMoAjgiAkUNACACKAJMIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2AA2AhwgAyABNgIUIANBsxs2AhAgA0EVNgIMQQAhAgw+C0HMACECDCQLIANBADYCHCADIAE2AhQgA0GzDjYCECADQR02AgxBACECDDwLIAEgBEYEQEHOACECDDwLIAEtAAAiAEEgRg0CIABBOkYNAQsgA0EAOgAsQQkhAgwhCyADKAIEIQAgA0EANgIEIAMgACABEDAiAA0BDAILIAMtAC5BAXEEQEHeASECDCALIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0CIANBKjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgw4CyADQcsANgIcIAMgADYCDCADIAFBAWo2AhRBACECDDcLIAFBAWohAUHAACECDB0LIAFBAWohAQwsCyABIARGBEBBKyECDDULAkAgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQcAAcUUNBgsgAy0AMkGAAXEEQEEAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ0SIABBFUYEQCADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgw2CyADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMQQAhAgw1CyADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyADQQE6ADALIAIgAi8BAEHAAHI7AQALQSshAgwYCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgwwCyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgwvCyADQQA2AhwgAyABNgIUIANBpQs2AhAgA0ECNgIMQQAhAgwuC0EBIQcgAy8BMiIFQQhxRQRAIAMpAyBCAFIhBwsCQCADLQAwBEBBASEAIAMtAClBBUYNASAFQcAAcUUgB3FFDQELAkAgAy0AKCICQQJGBEBBASEAIAMvATQiBkHlAEYNAkEAIQAgBUHAAHENAiAGQeQARg0CIAZB5gBrQQJJDQIgBkHMAUYNAiAGQbACRg0CDAELQQAhACAFQcAAcQ0BC0ECIQAgBUEIcQ0AIAVBgARxBEACQCACQQFHDQAgAy0ALkEKcQ0AQQUhAAwCC0EEIQAMAQsgBUEgcUUEQCADEDZBAEdBAnQhAAwBC0EAQQMgAykDIFAbIQALIABBAWsOBQIABwEDBAtBESECDBMLIANBAToAMQwpC0EAIQICQCADKAI4IgBFDQAgACgCMCIARQ0AIAMgABEAACECCyACRQ0mIAJBFUYEQCADQQM2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwrC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAwqCyADQQA2AhwgAyABNgIUIANB+SA2AhAgA0EPNgIMQQAhAgwpC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAADQELQQ4hAgwOCyAAQRVGBEAgA0ECNgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMJwsgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDEEAIQIMJgtBKiECDAwLIAEgBEcEQCADQQk2AgggAyABNgIEQSkhAgwMC0EmIQIMJAsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFQEQEElIQIMJAsgAygCBCEAIANBADYCBCADIAAgASAMp2oiARAyIgBFDQAgA0EFNgIcIAMgATYCFCADIAA2AgxBACECDCMLQQ8hAgwJC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FxYAAQIDBAUGBxQUFBQUFBQICQoLDA0UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFA4PEBESExQLQgIhCgwWC0IDIQoMFQtCBCEKDBQLQgUhCgwTC0IGIQoMEgtCByEKDBELQgghCgwQC0IJIQoMDwtCCiEKDA4LQgshCgwNC0IMIQoMDAtCDSEKDAsLQg4hCgwKC0IPIQoMCQtCCiEKDAgLQgshCgwHC0IMIQoMBgtCDSEKDAULQg4hCgwEC0IPIQoMAwsgA0EANgIcIAMgATYCFCADQZ8VNgIQIANBDDYCDEEAIQIMIQsgASAERgRAQSIhAgwhC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsONxUUAAECAwQFBgcWFhYWFhYWCAkKCwwNFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYODxAREhMWC0ICIQoMFAtCAyEKDBMLQgQhCgwSC0IFIQoMEQtCBiEKDBALQgchCgwPC0IIIQoMDgtCCSEKDA0LQgohCgwMC0ILIQoMCwtCDCEKDAoLQg0hCgwJC0IOIQoMCAtCDyEKDAcLQgohCgwGC0ILIQoMBQtCDCEKDAQLQg0hCgwDC0IOIQoMAgtCDyEKDAELQgEhCgsgAUEBaiEBIAMpAyAiC0L//////////w9YBEAgAyALQgSGIAqENwMgDAILIANBADYCHCADIAE2AhQgA0G1CTYCECADQQw2AgxBACECDB4LQSchAgwEC0EoIQIMAwsgAyABOgAsIANBADYCACAHQQFqIQFBDCECDAILIANBADYCACAGQQFqIQFBCiECDAELIAFBAWohAUEIIQIMAAsAC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwXC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwWC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwVC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwUC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwTC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwSC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwRC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwQC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwPC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwOC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwNC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwMC0EAIQIgA0EANgIcIAMgATYCFCADQZkTNgIQIANBCzYCDAwLC0EAIQIgA0EANgIcIAMgATYCFCADQZ0JNgIQIANBCzYCDAwKC0EAIQIgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDAwJC0EAIQIgA0EANgIcIAMgATYCFCADQbEQNgIQIANBCjYCDAwIC0EAIQIgA0EANgIcIAMgATYCFCADQbsdNgIQIANBAjYCDAwHC0EAIQIgA0EANgIcIAMgATYCFCADQZYWNgIQIANBAjYCDAwGC0EAIQIgA0EANgIcIAMgATYCFCADQfkYNgIQIANBAjYCDAwFC0EAIQIgA0EANgIcIAMgATYCFCADQcQYNgIQIANBAjYCDAwECyADQQI2AhwgAyABNgIUIANBqR42AhAgA0EWNgIMQQAhAgwDC0HeACECIAEgBEYNAiAJQQhqIQcgAygCACEFAkACQCABIARHBEAgBUGWyABqIQggBCAFaiABayEGIAVBf3NBCmoiBSABaiEAA0AgAS0AACAILQAARwRAQQIhCAwDCyAFRQRAQQAhCCAAIQEMAwsgBUEBayEFIAhBAWohCCAEIAFBAWoiAUcNAAsgBiEFIAQhAQsgB0EBNgIAIAMgBTYCAAwBCyADQQA2AgAgByAINgIACyAHIAE2AgQgCSgCDCEAAkACQCAJKAIIQQFrDgIEAQALIANBADYCHCADQcIeNgIQIANBFzYCDCADIABBAWo2AhRBACECDAMLIANBADYCHCADIAA2AhQgA0HXHjYCECADQQk2AgxBACECDAILIAEgBEYEQEEoIQIMAgsgA0EJNgIIIAMgATYCBEEnIQIMAQsgASAERgRAQQEhAgwBCwNAAkACQAJAIAEtAABBCmsOBAABAQABCyABQQFqIQEMAQsgAUEBaiEBIAMtAC5BIHENAEEAIQIgA0EANgIcIAMgATYCFCADQaEhNgIQIANBBTYCDAwCC0EBIQIgASAERw0ACwsgCUEQaiQAIAJFBEAgAygCDCEADAELIAMgAjYCHEEAIQAgAygCBCIBRQ0AIAMgASAEIAMoAggRAQAiAUUNACADIAQ2AhQgAyABNgIMIAEhAAsgAAu+AgECfyAAQQA6AAAgAEHkAGoiAUEBa0EAOgAAIABBADoAAiAAQQA6AAEgAUEDa0EAOgAAIAFBAmtBADoAACAAQQA6AAMgAUEEa0EAOgAAQQAgAGtBA3EiASAAaiIAQQA2AgBB5AAgAWtBfHEiAiAAaiIBQQRrQQA2AgACQCACQQlJDQAgAEEANgIIIABBADYCBCABQQhrQQA2AgAgAUEMa0EANgIAIAJBGUkNACAAQQA2AhggAEEANgIUIABBADYCECAAQQA2AgwgAUEQa0EANgIAIAFBFGtBADYCACABQRhrQQA2AgAgAUEca0EANgIAIAIgAEEEcUEYciICayIBQSBJDQAgACACaiEAA0AgAEIANwMYIABCADcDECAAQgA3AwggAEIANwMAIABBIGohACABQSBrIgFBH0sNAAsLC1YBAX8CQCAAKAIMDQACQAJAAkACQCAALQAxDgMBAAMCCyAAKAI4IgFFDQAgASgCMCIBRQ0AIAAgAREAACIBDQMLQQAPCwALIABByhk2AhBBDiEBCyABCxoAIAAoAgxFBEAgAEHeHzYCECAAQRU2AgwLCxQAIAAoAgxBFUYEQCAAQQA2AgwLCxQAIAAoAgxBFkYEQCAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsrAAJAIABBJ08NAEL//////wkgAK2IQgGDUA0AIABBAnRB0DhqKAIADwsACxcAIABBL08EQAALIABBAnRB7DlqKAIAC78JAQF/QfQtIQECQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQeQAaw70A2NiAAFhYWFhYWECAwQFYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQYHCAkKCwwNDg9hYWFhYRBhYWFhYWFhYWFhYRFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWESExQVFhcYGRobYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1NmE3ODk6YWFhYWFhYWE7YWFhPGFhYWE9Pj9hYWFhYWFhYUBhYUFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFCQ0RFRkdISUpLTE1OT1BRUlNhYWFhYWFhYVRVVldYWVpbYVxdYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhXmFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYV9gYQtB6iwPC0GYJg8LQe0xDwtBoDcPC0HJKQ8LQbQpDwtBli0PC0HrKw8LQaI1DwtB2zQPC0HgKQ8LQeMkDwtB1SQPC0HuJA8LQeYlDwtByjQPC0HQNw8LQao1DwtB9SwPC0H2Jg8LQYIiDwtB8jMPC0G+KA8LQec3DwtBzSEPC0HAIQ8LQbglDwtByyUPC0GWJA8LQY80DwtBzTUPC0HdKg8LQe4zDwtBnDQPC0GeMQ8LQfQ1DwtB5SIPC0GvJQ8LQZkxDwtBsjYPC0H5Ng8LQcQyDwtB3SwPC0GCMQ8LQcExDwtBjTcPC0HJJA8LQew2DwtB5yoPC0HIIw8LQeIhDwtByTcPC0GlIg8LQZQiDwtB2zYPC0HeNQ8LQYYmDwtBvCsPC0GLMg8LQaAjDwtB9jAPC0GALA8LQYkrDwtBpCYPC0HyIw8LQYEoDwtBqzIPC0HrJw8LQcI2DwtBoiQPC0HPKg8LQdwjDwtBhycPC0HkNA8LQbciDwtBrTEPC0HVIg8LQa80DwtB3iYPC0HWMg8LQfQ0DwtBgTgPC0H0Nw8LQZI2DwtBnScPC0GCKQ8LQY0jDwtB1zEPC0G9NQ8LQbQ3DwtB2DAPC0G2Jw8LQZo4DwtBpyoPC0HEJw8LQa4jDwtB9SIPCwALQcomIQELIAELFwAgACAALwEuQf7/A3EgAUEAR3I7AS4LGgAgACAALwEuQf3/A3EgAUEAR0EBdHI7AS4LGgAgACAALwEuQfv/A3EgAUEAR0ECdHI7AS4LGgAgACAALwEuQff/A3EgAUEAR0EDdHI7AS4LGgAgACAALwEuQe//A3EgAUEAR0EEdHI7AS4LGgAgACAALwEuQd//A3EgAUEAR0EFdHI7AS4LGgAgACAALwEuQb//A3EgAUEAR0EGdHI7AS4LGgAgACAALwEuQf/+A3EgAUEAR0EHdHI7AS4LGgAgACAALwEuQf/9A3EgAUEAR0EIdHI7AS4LGgAgACAALwEuQf/7A3EgAUEAR0EJdHI7AS4LPgECfwJAIAAoAjgiA0UNACADKAIEIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHhEjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIIIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH8ETYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIMIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHsCjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIQIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH6HjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIUIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHLEDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIYIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG3HzYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIcIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG/FTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIsIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH+CDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIgIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEGMHTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIkIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHmFTYCEEEYIQQLIAQLOAAgAAJ/IAAvATJBFHFBFEYEQEEBIAAtAChBAUYNARogAC8BNEHlAEYMAQsgAC0AKUEFRgs6ADALWQECfwJAIAAtAChBAUYNACAALwE0IgFB5ABrQeQASQ0AIAFBzAFGDQAgAUGwAkYNACAALwEyIgBBwABxDQBBASECIABBiARxQYAERg0AIABBKHFFIQILIAILjAEBAn8CQAJAAkAgAC0AKkUNACAALQArRQ0AIAAvATIiAUECcUUNAQwCCyAALwEyIgFBAXFFDQELQQEhAiAALQAoQQFGDQAgAC8BNCIAQeQAa0HkAEkNACAAQcwBRg0AIABBsAJGDQAgAUHAAHENAEEAIQIgAUGIBHFBgARGDQAgAUEocUEARyECCyACC1cAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==",nor;Object.defineProperty(gUn,"exports",{get:a(()=>nor||(nor=cws.from(lws,"base64")),"get")})});var yUn=I((Ulf,AUn)=>{"use strict";p();var{Buffer:uws}=require("node:buffer"),dws="AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCuzaAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgLhocCAwd/A34BeyABIAJqIQQCQCAAIgMoAgwiAA0AIAMoAgQEQCADIAE2AgQLIwBBEGsiCSQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADKAIcIgJBAmsO/AEB+QECAwQFBgcICQoLDA0ODxAREvgBE/cBFBX2ARYX9QEYGRobHB0eHyD9AfsBIfQBIiMkJSYnKCkqK/MBLC0uLzAxMvIB8QEzNPAB7wE1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk/6AVBRUlPuAe0BVOwBVesBVldYWVrqAVtcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHOAekB6AHPAecB0AHmAdEB0gHTAdQB5QHVAdYB1wHYAdkB2gHbAdwB3QHeAd8B4AHhAeIB4wEA/AELQQAM4wELQQ4M4gELQQ0M4QELQQ8M4AELQRAM3wELQRMM3gELQRQM3QELQRUM3AELQRYM2wELQRcM2gELQRgM2QELQRkM2AELQRoM1wELQRsM1gELQRwM1QELQR0M1AELQR4M0wELQR8M0gELQSAM0QELQSEM0AELQQgMzwELQSIMzgELQSQMzQELQSMMzAELQQcMywELQSUMygELQSYMyQELQScMyAELQSgMxwELQRIMxgELQREMxQELQSkMxAELQSoMwwELQSsMwgELQSwMwQELQd4BDMABC0EuDL8BC0EvDL4BC0EwDL0BC0ExDLwBC0EyDLsBC0EzDLoBC0E0DLkBC0HfAQy4AQtBNQy3AQtBOQy2AQtBDAy1AQtBNgy0AQtBNwyzAQtBOAyyAQtBPgyxAQtBOgywAQtB4AEMrwELQQsMrgELQT8MrQELQTsMrAELQQoMqwELQTwMqgELQT0MqQELQeEBDKgBC0HBAAynAQtBwAAMpgELQcIADKUBC0EJDKQBC0EtDKMBC0HDAAyiAQtBxAAMoQELQcUADKABC0HGAAyfAQtBxwAMngELQcgADJ0BC0HJAAycAQtBygAMmwELQcsADJoBC0HMAAyZAQtBzQAMmAELQc4ADJcBC0HPAAyWAQtB0AAMlQELQdEADJQBC0HSAAyTAQtB0wAMkgELQdUADJEBC0HUAAyQAQtB1gAMjwELQdcADI4BC0HYAAyNAQtB2QAMjAELQdoADIsBC0HbAAyKAQtB3AAMiQELQd0ADIgBC0HeAAyHAQtB3wAMhgELQeAADIUBC0HhAAyEAQtB4gAMgwELQeMADIIBC0HkAAyBAQtB5QAMgAELQeIBDH8LQeYADH4LQecADH0LQQYMfAtB6AAMewtBBQx6C0HpAAx5C0EEDHgLQeoADHcLQesADHYLQewADHULQe0ADHQLQQMMcwtB7gAMcgtB7wAMcQtB8AAMcAtB8gAMbwtB8QAMbgtB8wAMbQtB9AAMbAtB9QAMawtB9gAMagtBAgxpC0H3AAxoC0H4AAxnC0H5AAxmC0H6AAxlC0H7AAxkC0H8AAxjC0H9AAxiC0H+AAxhC0H/AAxgC0GAAQxfC0GBAQxeC0GCAQxdC0GDAQxcC0GEAQxbC0GFAQxaC0GGAQxZC0GHAQxYC0GIAQxXC0GJAQxWC0GKAQxVC0GLAQxUC0GMAQxTC0GNAQxSC0GOAQxRC0GPAQxQC0GQAQxPC0GRAQxOC0GSAQxNC0GTAQxMC0GUAQxLC0GVAQxKC0GWAQxJC0GXAQxIC0GYAQxHC0GZAQxGC0GaAQxFC0GbAQxEC0GcAQxDC0GdAQxCC0GeAQxBC0GfAQxAC0GgAQw/C0GhAQw+C0GiAQw9C0GjAQw8C0GkAQw7C0GlAQw6C0GmAQw5C0GnAQw4C0GoAQw3C0GpAQw2C0GqAQw1C0GrAQw0C0GsAQwzC0GtAQwyC0GuAQwxC0GvAQwwC0GwAQwvC0GxAQwuC0GyAQwtC0GzAQwsC0G0AQwrC0G1AQwqC0G2AQwpC0G3AQwoC0G4AQwnC0G5AQwmC0G6AQwlC0G7AQwkC0G8AQwjC0G9AQwiC0G+AQwhC0G/AQwgC0HAAQwfC0HBAQweC0HCAQwdC0EBDBwLQcMBDBsLQcQBDBoLQcUBDBkLQcYBDBgLQccBDBcLQcgBDBYLQckBDBULQcoBDBQLQcsBDBMLQcwBDBILQc0BDBELQc4BDBALQc8BDA8LQdABDA4LQdEBDA0LQdIBDAwLQdMBDAsLQdQBDAoLQdUBDAkLQdYBDAgLQeMBDAcLQdcBDAYLQdgBDAULQdkBDAQLQdoBDAMLQdsBDAILQd0BDAELQdwBCyECA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAn8CQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAwJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCACDuMBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISMkJScoKZ4DmwOaA5EDigODA4AD/QL7AvgC8gLxAu8C7QLoAucC5gLlAuQC3ALbAtoC2QLYAtcC1gLVAs8CzgLMAssCygLJAsgCxwLGAsQCwwK+ArwCugK5ArgCtwK2ArUCtAKzArICsQKwAq4CrQKpAqgCpwKmAqUCpAKjAqICoQKgAp8CmAKQAowCiwKKAoEC/gH9AfwB+wH6AfkB+AH3AfUB8wHwAesB6QHoAecB5gHlAeQB4wHiAeEB4AHfAd4B3QHcAdoB2QHYAdcB1gHVAdQB0wHSAdEB0AHPAc4BzQHMAcsBygHJAcgBxwHGAcUBxAHDAcIBwQHAAb8BvgG9AbwBuwG6AbkBuAG3AbYBtQG0AbMBsgGxAbABrwGuAa0BrAGrAaoBqQGoAacBpgGlAaQBowGiAZ8BngGZAZgBlwGWAZUBlAGTAZIBkQGQAY8BjQGMAYcBhgGFAYQBgwGCAX18e3p5dnV0UFFSU1RVCyABIARHDXJB/QEhAgy+AwsgASAERw2YAUHbASECDL0DCyABIARHDfEBQY4BIQIMvAMLIAEgBEcN/AFBhAEhAgy7AwsgASAERw2KAkH/ACECDLoDCyABIARHDZECQf0AIQIMuQMLIAEgBEcNlAJB+wAhAgy4AwsgASAERw0eQR4hAgy3AwsgASAERw0ZQRghAgy2AwsgASAERw3KAkHNACECDLUDCyABIARHDdUCQcYAIQIMtAMLIAEgBEcN1gJBwwAhAgyzAwsgASAERw3cAkE4IQIMsgMLIAMtADBBAUYNrQMMiQMLQQAhAAJAAkACQCADLQAqRQ0AIAMtACtFDQAgAy8BMiICQQJxRQ0BDAILIAMvATIiAkEBcUUNAQtBASEAIAMtAChBAUYNACADLwE0IgZB5ABrQeQASQ0AIAZBzAFGDQAgBkGwAkYNACACQcAAcQ0AQQAhACACQYgEcUGABEYNACACQShxQQBHIQALIANBADsBMiADQQA6ADECQCAARQRAIANBADoAMSADLQAuQQRxDQEMsQMLIANCADcDIAsgA0EAOgAxIANBAToANgxIC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAARQ1IIABBFUcNYiADQQQ2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgyvAwsgASAERgRAQQYhAgyvAwsgAS0AAEEKRw0ZIAFBAWohAQwaCyADQgA3AyBBEiECDJQDCyABIARHDYoDQSMhAgysAwsgASAERgRAQQchAgysAwsCQAJAIAEtAABBCmsOBAEYGAAYCyABQQFqIQFBECECDJMDCyABQQFqIQEgA0Evai0AAEEBcQ0XQQAhAiADQQA2AhwgAyABNgIUIANBmSA2AhAgA0EZNgIMDKsDCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMWg0YQQghAgyqAwsgASAERwRAIANBCTYCCCADIAE2AgRBFCECDJEDC0EJIQIMqQMLIAMpAyBQDa4CDEMLIAEgBEYEQEELIQIMqAMLIAEtAABBCkcNFiABQQFqIQEMFwsgA0Evai0AAEEBcUUNGQwmC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRkMQgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0aDCQLQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGwwyCyADQS9qLQAAQQFxRQ0cDCILQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANHAxCC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADR0MIAsgASAERgRAQRMhAgygAwsCQCABLQAAIgBBCmsOBB8jIwAiCyABQQFqIQEMHwtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0iDEILIAEgBEYEQEEWIQIMngMLIAEtAABBwMEAai0AAEEBRw0jDIMDCwJAA0AgAS0AAEGwO2otAAAiAEEBRwRAAkAgAEECaw4CAwAnCyABQQFqIQFBISECDIYDCyAEIAFBAWoiAUcNAAtBGCECDJ0DCyADKAIEIQBBACECIANBADYCBCADIAAgAUEBaiIBEDQiAA0hDEELQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIwwqCyABIARGBEBBHCECDJsDCyADQQo2AgggAyABNgIEQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANJUEkIQIMgQMLIAEgBEcEQANAIAEtAABBsD1qLQAAIgBBA0cEQCAAQQFrDgUYGiaCAyUmCyAEIAFBAWoiAUcNAAtBGyECDJoDC0EbIQIMmQMLA0AgAS0AAEGwP2otAAAiAEEDRwRAIABBAWsOBQ8RJxMmJwsgBCABQQFqIgFHDQALQR4hAgyYAwsgASAERwRAIANBCzYCCCADIAE2AgRBByECDP8CC0EfIQIMlwMLIAEgBEYEQEEgIQIMlwMLAkAgAS0AAEENaw4ULj8/Pz8/Pz8/Pz8/Pz8/Pz8/PwA/C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAyWAwsgA0EvaiECA0AgASAERgRAQSEhAgyXAwsCQAJAAkAgAS0AACIAQQlrDhgCACkpASkpKSkpKSkpKSkpKSkpKSkpKQInCyABQQFqIQEgA0Evai0AAEEBcUUNCgwYCyABQQFqIQEMFwsgAUEBaiEBIAItAABBAnENAAtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwMlQMLIAMtAC5BgAFxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ3mAiAAQRVGBEAgA0EkNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMlAMLQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDJMDC0EAIQIgA0EANgIcIAMgATYCFCADQb4gNgIQIANBAjYCDAySAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEgDKdqIgEQMiIARQ0rIANBBzYCHCADIAE2AhQgAyAANgIMDJEDCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlgiAkUNACADIAIRAAAhAAsgAEUNKyAAQRVGBEAgA0EKNgIcIAMgATYCFCADQesZNgIQIANBFTYCDEEAIQIMkAMLQQAhAiADQQA2AhwgAyABNgIUIANBkww2AhAgA0ETNgIMDI8DC0EAIQIgA0EANgIcIAMgATYCFCADQYIVNgIQIANBAjYCDAyOAwtBACECIANBADYCHCADIAE2AhQgA0HdFDYCECADQRk2AgwMjQMLQQAhAiADQQA2AhwgAyABNgIUIANB5h02AhAgA0EZNgIMDIwDCyAAQRVGDT1BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMiwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUNKCADQQ02AhwgAyABNgIUIAMgADYCDAyKAwsgAEEVRg06QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIkDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCgLIANBDjYCHCADIAA2AgwgAyABQQFqNgIUDIgDCyAAQRVGDTdBACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMhwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUEQCABQQFqIQEMJwsgA0EPNgIcIAMgADYCDCADIAFBAWo2AhQMhgMLQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDIUDCyAAQRVGDTNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwMhAMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUNJSADQRE2AhwgAyABNgIUIAMgADYCDAyDAwsgAEEVRg0wQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIIDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDCULIANBEjYCHCADIAA2AgwgAyABQQFqNgIUDIEDCyADQS9qLQAAQQFxRQ0BC0EXIQIM5gILQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDP4CCyAAQTtHDQAgAUEBaiEBDAwLQQAhAiADQQA2AhwgAyABNgIUIANBkhg2AhAgA0ECNgIMDPwCCyAAQRVGDShBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM+wILIANBFDYCHCADIAE2AhQgAyAANgIMDPoCCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDPUCCyADQRU2AhwgAyAANgIMIAMgAUEBajYCFAz5AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzzAgsgA0EXNgIcIAMgADYCDCADIAFBAWo2AhQM+AILIABBFUYNI0EAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAz3AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwdCyADQRk2AhwgAyAANgIMIAMgAUEBajYCFAz2AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzvAgsgA0EaNgIcIAMgADYCDCADIAFBAWo2AhQM9QILIABBFUYNH0EAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAz0AgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDBsLIANBHDYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgzzAgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDOsCCyADQR02AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8gILIABBO0cNASABQQFqIQELQSYhAgzXAgtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwM7wILIAEgBEcEQANAIAEtAABBIEcNhAIgBCABQQFqIgFHDQALQSwhAgzvAgtBLCECDO4CCyABIARGBEBBNCECDO4CCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtBNCECDO8CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNnwIgA0EyNgIcIAMgATYCFCADIAA2AgxBACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUEQCABQQFqIQEMnwILIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgztAgsgASAERwRAAkADQCABLQAAQTBrIgBB/wFxQQpPBEBBOiECDNcCCyADKQMgIgtCmbPmzJmz5swZVg0BIAMgC0IKfiIKNwMgIAogAK1C/wGDIgtCf4VWDQEgAyAKIAt8NwMgIAQgAUEBaiIBRw0AC0HAACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABQQFqIgEQMSIADRcM4gILQcAAIQIM7AILIAEgBEYEQEHJACECDOwCCwJAA0ACQCABLQAAQQlrDhgAAqICogKpAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAgCiAgsgBCABQQFqIgFHDQALQckAIQIM7AILIAFBAWohASADQS9qLQAAQQFxDaUCIANBADYCHCADIAE2AhQgA0GXEDYCECADQQo2AgxBACECDOsCCyABIARHBEADQCABLQAAQSBHDRUgBCABQQFqIgFHDQALQfgAIQIM6wILQfgAIQIM6gILIANBAjoAKAw4C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAzoAgtBACECDM4CC0ENIQIMzQILQRMhAgzMAgtBFSECDMsCC0EWIQIMygILQRghAgzJAgtBGSECDMgCC0EaIQIMxwILQRshAgzGAgtBHCECDMUCC0EdIQIMxAILQR4hAgzDAgtBHyECDMICC0EgIQIMwQILQSIhAgzAAgtBIyECDL8CC0ElIQIMvgILQeUAIQIMvQILIANBPTYCHCADIAE2AhQgAyAANgIMQQAhAgzVAgsgA0EbNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIM1AILIANBIDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNMCCyADQRM2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzSAgsgA0ELNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0QILIANBEDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNACCyADQSA2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzPAgsgA0ELNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzgILIANBDDYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM0CC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAzMAgsCQANAAkAgAS0AAEEKaw4EAAICAAILIAQgAUEBaiIBRw0AC0H9ASECDMwCCwJAAkAgAy0ANkEBRw0AQQAhAAJAIAMoAjgiAkUNACACKAJgIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB/AE2AhwgAyABNgIUIANB3Bk2AhAgA0EVNgIMQQAhAgzNAgtB3AEhAgyzAgsgA0EANgIcIAMgATYCFCADQfkLNgIQIANBHzYCDEEAIQIMywILAkACQCADLQAoQQFrDgIEAQALQdsBIQIMsgILQdQBIQIMsQILIANBAjoAMUEAIQACQCADKAI4IgJFDQAgAigCACICRQ0AIAMgAhEAACEACyAARQRAQd0BIQIMsQILIABBFUcEQCADQQA2AhwgAyABNgIUIANBtAw2AhAgA0EQNgIMQQAhAgzKAgsgA0H7ATYCHCADIAE2AhQgA0GBGjYCECADQRU2AgxBACECDMkCCyABIARGBEBB+gEhAgzJAgsgAS0AAEHIAEYNASADQQE6ACgLQcABIQIMrgILQdoBIQIMrQILIAEgBEcEQCADQQw2AgggAyABNgIEQdkBIQIMrQILQfkBIQIMxQILIAEgBEYEQEH4ASECDMUCCyABLQAAQcgARw0EIAFBAWohAUHYASECDKsCCyABIARGBEBB9wEhAgzEAgsCQAJAIAEtAABBxQBrDhAABQUFBQUFBQUFBQUFBQUBBQsgAUEBaiEBQdYBIQIMqwILIAFBAWohAUHXASECDKoCC0H2ASECIAEgBEYNwgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABButUAai0AAEcNAyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMwwILIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgBFBEBB4wEhAgyqAgsgA0H1ATYCHCADIAE2AhQgAyAANgIMQQAhAgzCAgtB9AEhAiABIARGDcECIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjVAGotAABHDQIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMICCyADQYEEOwEoIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgANAwwCCyADQQA2AgALQQAhAiADQQA2AhwgAyABNgIUIANB5R82AhAgA0EINgIMDL8CC0HVASECDKUCCyADQfMBNgIcIAMgATYCFCADIAA2AgxBACECDL0CC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ1uIABBFUcEQCADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgy9AgsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDLwCCyABIARHBEAgA0ENNgIIIAMgATYCBEHTASECDKMCC0HyASECDLsCCyABIARGBEBB8QEhAgy7AgsCQAJAAkAgAS0AAEHIAGsOCwABCAgICAgICAgCCAsgAUEBaiEBQdABIQIMowILIAFBAWohAUHRASECDKICCyABQQFqIQFB0gEhAgyhAgtB8AEhAiABIARGDbkCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEG11QBqLQAARw0EIABBAkYNAyAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy5AgtB7wEhAiABIARGDbgCIAMoAgAiACAEIAFraiEGIAEgAGtBAWohBQNAIAEtAAAgAEGz1QBqLQAARw0DIABBAUYNAiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy4AgtB7gEhAiABIARGDbcCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEGw1QBqLQAARw0CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy3AgsgAygCBCEAIANCADcDACADIAAgBUEBaiIBECsiAEUNAiADQewBNgIcIAMgATYCFCADIAA2AgxBACECDLYCCyADQQA2AgALIAMoAgQhACADQQA2AgQgAyAAIAEQKyIARQ2cAiADQe0BNgIcIAMgATYCFCADIAA2AgxBACECDLQCC0HPASECDJoCC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMtAILQc4BIQIMmgILIANB6wE2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyyAgsgASAERgRAQesBIQIMsgILIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMsQILQc0BIQIMlwILIAEgBEcEQCADQQ42AgggAyABNgIEQcwBIQIMlwILQeoBIQIMrwILIAEgBEYEQEHpASECDK8CCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHLASECDJYCCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNlwIgA0HoATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgASAERgRAQecBIQIMrgILAkAgAS0AAEEuRgRAIAFBAWohAQwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmAIgA0HmATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgtBygEhAgyUAgsgASAERgRAQeUBIQIMrQILQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIBNgIcIAMgATYCFCADIAA2AgxBACECDK8CCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmgIgA0HjATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5AE2AhwgAyABNgIUIAMgADYCDAytAgtByQEhAgyTAgtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GkDTYCECADQSE2AgxBACECDK0CC0HIASECDJMCCyADQeEBNgIcIAMgATYCFCADQdAaNgIQIANBFTYCDEEAIQIMqwILIAEgBEYEQEHhASECDKsCCwJAIAEtAABBIEYEQCADQQA7ATQgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GZETYCECADQQk2AgxBACECDKsCC0HHASECDJECCyABIARGBEBB4AEhAgyqAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKsCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyqAgtBxgEhAgyQAgsgASAERgRAQd8BIQIMqQILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyqAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqQILQcUBIQIMjwILIAEgBEYEQEHeASECDKgCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqQILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKgCC0HEASECDI4CCyABIARGBEBB3QEhAgynAgsCQAJAAkACQCABLQAAQQprDhcCAwMAAwMDAwMDAwMDAwMDAwMDAwMDAQMLIAFBAWoMBQsgAUEBaiEBQcMBIQIMjwILIAFBAWohASADQS9qLQAAQQFxDQggA0EANgIcIAMgATYCFCADQY0LNgIQIANBDTYCDEEAIQIMpwILIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKYCCyABIARHBEAgA0EPNgIIIAMgATYCBEEBIQIMjQILQdwBIQIMpQILAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0HbASECDKYCCyADKAIEIQAgA0EANgIEIAMgACABEC0iAEUEQCABQQFqIQEMBAsgA0HaATYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgylAgsgAygCBCEAIANBADYCBCADIAAgARAtIgANASABQQFqCyEBQcEBIQIMigILIANB2QE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMogILQcIBIQIMiAILIANBL2otAABBAXENASADQQA2AhwgAyABNgIUIANB5Bw2AhAgA0EZNgIMQQAhAgygAgsgASAERgRAQdkBIQIMoAILAkACQAJAIAEtAABBCmsOBAECAgACCyABQQFqIQEMAgsgAUEBaiEBDAELIAMtAC5BwABxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCPCICRQ0AIAMgAhEAACEACyAARQ2gASAAQRVGBEAgA0HZADYCHCADIAE2AhQgA0G3GjYCECADQRU2AgxBACECDJ8CCyADQQA2AhwgAyABNgIUIANBgA02AhAgA0EbNgIMQQAhAgyeAgsgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMnQILIAEgBEcEQCADQQw2AgggAyABNgIEQb8BIQIMhAILQdgBIQIMnAILIAEgBEYEQEHXASECDJwCCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEHBAGsOFQABAgNaBAUGWlpaBwgJCgsMDQ4PEFoLIAFBAWohAUH7ACECDJICCyABQQFqIQFB/AAhAgyRAgsgAUEBaiEBQYEBIQIMkAILIAFBAWohAUGFASECDI8CCyABQQFqIQFBhgEhAgyOAgsgAUEBaiEBQYkBIQIMjQILIAFBAWohAUGKASECDIwCCyABQQFqIQFBjQEhAgyLAgsgAUEBaiEBQZYBIQIMigILIAFBAWohAUGXASECDIkCCyABQQFqIQFBmAEhAgyIAgsgAUEBaiEBQaUBIQIMhwILIAFBAWohAUGmASECDIYCCyABQQFqIQFBrAEhAgyFAgsgAUEBaiEBQbQBIQIMhAILIAFBAWohAUG3ASECDIMCCyABQQFqIQFBvgEhAgyCAgsgASAERgRAQdYBIQIMmwILIAEtAABBzgBHDUggAUEBaiEBQb0BIQIMgQILIAEgBEYEQEHVASECDJoCCwJAAkACQCABLQAAQcIAaw4SAEpKSkpKSkpKSgFKSkpKSkoCSgsgAUEBaiEBQbgBIQIMggILIAFBAWohAUG7ASECDIECCyABQQFqIQFBvAEhAgyAAgtB1AEhAiABIARGDZgCIAMoAgAiACAEIAFraiEFIAEgAGtBB2ohBgJAA0AgAS0AACAAQajVAGotAABHDUUgAEEHRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJkCCyADQQA2AgAgBkEBaiEBQRsMRQsgASAERgRAQdMBIQIMmAILAkACQCABLQAAQckAaw4HAEdHR0dHAUcLIAFBAWohAUG5ASECDP8BCyABQQFqIQFBugEhAgz+AQtB0gEhAiABIARGDZYCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQabVAGotAABHDUMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJcCCyADQQA2AgAgBkEBaiEBQQ8MQwtB0QEhAiABIARGDZUCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQaTVAGotAABHDUIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYCCyADQQA2AgAgBkEBaiEBQSAMQgtB0AEhAiABIARGDZQCIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDUEgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJUCCyADQQA2AgAgBkEBaiEBQRIMQQsgASAERgRAQc8BIQIMlAILAkACQCABLQAAQcUAaw4OAENDQ0NDQ0NDQ0NDQwFDCyABQQFqIQFBtQEhAgz7AQsgAUEBaiEBQbYBIQIM+gELQc4BIQIgASAERg2SAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGe1QBqLQAARw0/IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyTAgsgA0EANgIAIAZBAWohAUEHDD8LQc0BIQIgASAERg2RAiADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGY1QBqLQAARw0+IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAySAgsgA0EANgIAIAZBAWohAUEoDD4LIAEgBEYEQEHMASECDJECCwJAAkACQCABLQAAQcUAaw4RAEFBQUFBQUFBQQFBQUFBQQJBCyABQQFqIQFBsQEhAgz5AQsgAUEBaiEBQbIBIQIM+AELIAFBAWohAUGzASECDPcBC0HLASECIAEgBEYNjwIgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBkdUAai0AAEcNPCAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkAILIANBADYCACAGQQFqIQFBGgw8C0HKASECIAEgBEYNjgIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBjdUAai0AAEcNOyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjwILIANBADYCACAGQQFqIQFBIQw7CyABIARGBEBByQEhAgyOAgsCQAJAIAEtAABBwQBrDhQAPT09PT09PT09PT09PT09PT09AT0LIAFBAWohAUGtASECDPUBCyABQQFqIQFBsAEhAgz0AQsgASAERgRAQcgBIQIMjQILAkACQCABLQAAQdUAaw4LADw8PDw8PDw8PAE8CyABQQFqIQFBrgEhAgz0AQsgAUEBaiEBQa8BIQIM8wELQccBIQIgASAERg2LAiADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw04IABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyMAgsgA0EANgIAIAZBAWohAUEqDDgLIAEgBEYEQEHGASECDIsCCyABLQAAQdAARw04IAFBAWohAUElDDcLQcUBIQIgASAERg2JAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGB1QBqLQAARw02IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyKAgsgA0EANgIAIAZBAWohAUEODDYLIAEgBEYEQEHEASECDIkCCyABLQAAQcUARw02IAFBAWohAUGrASECDO8BCyABIARGBEBBwwEhAgyIAgsCQAJAAkACQCABLQAAQcIAaw4PAAECOTk5OTk5OTk5OTkDOQsgAUEBaiEBQacBIQIM8QELIAFBAWohAUGoASECDPABCyABQQFqIQFBqQEhAgzvAQsgAUEBaiEBQaoBIQIM7gELQcIBIQIgASAERg2GAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH+1ABqLQAARw0zIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyHAgsgA0EANgIAIAZBAWohAUEUDDMLQcEBIQIgASAERg2FAiADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEH51ABqLQAARw0yIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyGAgsgA0EANgIAIAZBAWohAUErDDILQcABIQIgASAERg2EAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH21ABqLQAARw0xIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyFAgsgA0EANgIAIAZBAWohAUEsDDELQb8BIQIgASAERg2DAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0wIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyEAgsgA0EANgIAIAZBAWohAUERDDALQb4BIQIgASAERg2CAiADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEHy1ABqLQAARw0vIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyDAgsgA0EANgIAIAZBAWohAUEuDC8LIAEgBEYEQEG9ASECDIICCwJAAkACQAJAAkAgAS0AAEHBAGsOFQA0NDQ0NDQ0NDQ0ATQ0AjQ0AzQ0BDQLIAFBAWohAUGbASECDOwBCyABQQFqIQFBnAEhAgzrAQsgAUEBaiEBQZ0BIQIM6gELIAFBAWohAUGiASECDOkBCyABQQFqIQFBpAEhAgzoAQsgASAERgRAQbwBIQIMgQILAkACQCABLQAAQdIAaw4DADABMAsgAUEBaiEBQaMBIQIM6AELIAFBAWohAUEEDC0LQbsBIQIgASAERg3/ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHw1ABqLQAARw0sIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyAAgsgA0EANgIAIAZBAWohAUEdDCwLIAEgBEYEQEG6ASECDP8BCwJAAkAgAS0AAEHJAGsOBwEuLi4uLgAuCyABQQFqIQFBoQEhAgzmAQsgAUEBaiEBQSIMKwsgASAERgRAQbkBIQIM/gELIAEtAABB0ABHDSsgAUEBaiEBQaABIQIM5AELIAEgBEYEQEG4ASECDP0BCwJAAkAgAS0AAEHGAGsOCwAsLCwsLCwsLCwBLAsgAUEBaiEBQZ4BIQIM5AELIAFBAWohAUGfASECDOMBC0G3ASECIAEgBEYN+wEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB7NQAai0AAEcNKCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM/AELIANBADYCACAGQQFqIQFBDQwoC0G2ASECIAEgBEYN+gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNJyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+wELIANBADYCACAGQQFqIQFBDAwnC0G1ASECIAEgBEYN+QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6tQAai0AAEcNJiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+gELIANBADYCACAGQQFqIQFBAwwmC0G0ASECIAEgBEYN+AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6NQAai0AAEcNJSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+QELIANBADYCACAGQQFqIQFBJgwlCyABIARGBEBBswEhAgz4AQsCQAJAIAEtAABB1ABrDgIAAScLIAFBAWohAUGZASECDN8BCyABQQFqIQFBmgEhAgzeAQtBsgEhAiABIARGDfYBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQebUAGotAABHDSMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPcBCyADQQA2AgAgBkEBaiEBQScMIwtBsQEhAiABIARGDfUBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQeTUAGotAABHDSIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPYBCyADQQA2AgAgBkEBaiEBQRwMIgtBsAEhAiABIARGDfQBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQd7UAGotAABHDSEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPUBCyADQQA2AgAgBkEBaiEBQQYMIQtBrwEhAiABIARGDfMBIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQdnUAGotAABHDSAgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPQBCyADQQA2AgAgBkEBaiEBQRkMIAsgASAERgRAQa4BIQIM8wELAkACQAJAAkAgAS0AAEEtaw4jACQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkASQkJCQkAiQkJAMkCyABQQFqIQFBjgEhAgzcAQsgAUEBaiEBQY8BIQIM2wELIAFBAWohAUGUASECDNoBCyABQQFqIQFBlQEhAgzZAQtBrQEhAiABIARGDfEBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQdfUAGotAABHDR4gAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPIBCyADQQA2AgAgBkEBaiEBQQsMHgsgASAERgRAQawBIQIM8QELAkACQCABLQAAQcEAaw4DACABIAsgAUEBaiEBQZABIQIM2AELIAFBAWohAUGTASECDNcBCyABIARGBEBBqwEhAgzwAQsCQAJAIAEtAABBwQBrDg8AHx8fHx8fHx8fHx8fHwEfCyABQQFqIQFBkQEhAgzXAQsgAUEBaiEBQZIBIQIM1gELIAEgBEYEQEGqASECDO8BCyABLQAAQcwARw0cIAFBAWohAUEKDBsLQakBIQIgASAERg3tASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHR1ABqLQAARw0aIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzuAQsgA0EANgIAIAZBAWohAUEeDBoLQagBIQIgASAERg3sASADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEHK1ABqLQAARw0ZIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAztAQsgA0EANgIAIAZBAWohAUEVDBkLQacBIQIgASAERg3rASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHH1ABqLQAARw0YIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzsAQsgA0EANgIAIAZBAWohAUEXDBgLQaYBIQIgASAERg3qASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHB1ABqLQAARw0XIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzrAQsgA0EANgIAIAZBAWohAUEYDBcLIAEgBEYEQEGlASECDOoBCwJAAkAgAS0AAEHJAGsOBwAZGRkZGQEZCyABQQFqIQFBiwEhAgzRAQsgAUEBaiEBQYwBIQIM0AELQaQBIQIgASAERg3oASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw0VIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzpAQsgA0EANgIAIAZBAWohAUEJDBULQaMBIQIgASAERg3nASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw0UIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzoAQsgA0EANgIAIAZBAWohAUEfDBQLQaIBIQIgASAERg3mASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEG+1ABqLQAARw0TIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAznAQsgA0EANgIAIAZBAWohAUECDBMLQaEBIQIgASAERg3lASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYDQCABLQAAIABBvNQAai0AAEcNESAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5QELIAEgBEYEQEGgASECDOUBC0EBIAEtAABB3wBHDREaIAFBAWohAUGHASECDMsBCyADQQA2AgAgBkEBaiEBQYgBIQIMygELQZ8BIQIgASAERg3iASADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw0PIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzjAQsgA0EANgIAIAZBAWohAUEpDA8LQZ4BIQIgASAERg3hASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEG41ABqLQAARw0OIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAziAQsgA0EANgIAIAZBAWohAUEtDA4LIAEgBEYEQEGdASECDOEBCyABLQAAQcUARw0OIAFBAWohAUGEASECDMcBCyABIARGBEBBnAEhAgzgAQsCQAJAIAEtAABBzABrDggADw8PDw8PAQ8LIAFBAWohAUGCASECDMcBCyABQQFqIQFBgwEhAgzGAQtBmwEhAiABIARGDd4BIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQbPUAGotAABHDQsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN8BCyADQQA2AgAgBkEBaiEBQSMMCwtBmgEhAiABIARGDd0BIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDUAGotAABHDQogAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN4BCyADQQA2AgAgBkEBaiEBQQAMCgsgASAERgRAQZkBIQIM3QELAkACQCABLQAAQcgAaw4IAAwMDAwMDAEMCyABQQFqIQFB/QAhAgzEAQsgAUEBaiEBQYABIQIMwwELIAEgBEYEQEGYASECDNwBCwJAAkAgAS0AAEHOAGsOAwALAQsLIAFBAWohAUH+ACECDMMBCyABQQFqIQFB/wAhAgzCAQsgASAERgRAQZcBIQIM2wELIAEtAABB2QBHDQggAUEBaiEBQQgMBwtBlgEhAiABIARGDdkBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQazUAGotAABHDQYgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNoBCyADQQA2AgAgBkEBaiEBQQUMBgtBlQEhAiABIARGDdgBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQabUAGotAABHDQUgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNkBCyADQQA2AgAgBkEBaiEBQRYMBQtBlAEhAiABIARGDdcBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDQQgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNgBCyADQQA2AgAgBkEBaiEBQRAMBAsgASAERgRAQZMBIQIM1wELAkACQCABLQAAQcMAaw4MAAYGBgYGBgYGBgYBBgsgAUEBaiEBQfkAIQIMvgELIAFBAWohAUH6ACECDL0BC0GSASECIAEgBEYN1QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBoNQAai0AAEcNAiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM1gELIANBADYCACAGQQFqIQFBJAwCCyADQQA2AgAMAgsgASAERgRAQZEBIQIM1AELIAEtAABBzABHDQEgAUEBaiEBQRMLOgApIAMoAgQhACADQQA2AgQgAyAAIAEQLiIADQIMAQtBACECIANBADYCHCADIAE2AhQgA0H+HzYCECADQQY2AgwM0QELQfgAIQIMtwELIANBkAE2AhwgAyABNgIUIAMgADYCDEEAIQIMzwELQQAhAAJAIAMoAjgiAkUNACACKAJAIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GCDzYCECADQSA2AgxBACECDM4BC0H3ACECDLQBCyADQY8BNgIcIAMgATYCFCADQewbNgIQIANBFTYCDEEAIQIMzAELIAEgBEYEQEGPASECDMwBCwJAIAEtAABBIEYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZsfNgIQIANBBjYCDEEAIQIMzAELQQIhAgyyAQsDQCABLQAAQSBHDQIgBCABQQFqIgFHDQALQY4BIQIMygELIAEgBEYEQEGNASECDMoBCwJAIAEtAABBCWsOBEoAAEoAC0H1ACECDLABCyADLQApQQVGBEBB9gAhAgywAQtB9AAhAgyvAQsgASAERgRAQYwBIQIMyAELIANBEDYCCCADIAE2AgQMCgsgASAERgRAQYsBIQIMxwELAkAgAS0AAEEJaw4ERwAARwALQfMAIQIMrQELIAEgBEcEQCADQRA2AgggAyABNgIEQfEAIQIMrQELQYoBIQIMxQELAkAgASAERwRAA0AgAS0AAEGg0ABqLQAAIgBBA0cEQAJAIABBAWsOAkkABAtB8AAhAgyvAQsgBCABQQFqIgFHDQALQYgBIQIMxgELQYgBIQIMxQELIANBADYCHCADIAE2AhQgA0HbIDYCECADQQc2AgxBACECDMQBCyABIARGBEBBiQEhAgzEAQsCQAJAAkAgAS0AAEGg0gBqLQAAQQFrDgNGAgABC0HyACECDKwBCyADQQA2AhwgAyABNgIUIANBtBI2AhAgA0EHNgIMQQAhAgzEAQtB6gAhAgyqAQsgASAERwRAIAFBAWohAUHvACECDKoBC0GHASECDMIBCyAEIAEiAEYEQEGGASECDMIBCyAALQAAIgFBL0YEQCAAQQFqIQFB7gAhAgypAQsgAUEJayICQRdLDQEgACEBQQEgAnRBm4CABHENQQwBCyAEIAEiAEYEQEGFASECDMEBCyAALQAAQS9HDQAgAEEBaiEBDAMLQQAhAiADQQA2AhwgAyAANgIUIANB2yA2AhAgA0EHNgIMDL8BCwJAAkACQAJAAkADQCABLQAAQaDOAGotAAAiAEEFRwRAAkACQCAAQQFrDghHBQYHCAAEAQgLQesAIQIMrQELIAFBAWohAUHtACECDKwBCyAEIAFBAWoiAUcNAAtBhAEhAgzDAQsgAUEBagwUCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDMEBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDMABCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDL8BCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy+AQsgASAERgRAQYMBIQIMvgELAkAgAS0AAEGgzgBqLQAAQQFrDgg+BAUGAAgCAwcLIAFBAWohAQtBAyECDKMBCyABQQFqDA0LQQAhAiADQQA2AhwgA0HREjYCECADQQc2AgwgAyABQQFqNgIUDLoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDLkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDLgBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDLcBCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy2AQtB7AAhAgycAQsgASAERgRAQYIBIQIMtQELIAFBAWoMAgsgASAERgRAQYEBIQIMtAELIAFBAWoMAQsgASAERg0BIAFBAWoLIQFBBCECDJgBC0GAASECDLABCwNAIAEtAABBoMwAai0AACIAQQJHBEAgAEEBRwRAQekAIQIMmQELDDELIAQgAUEBaiIBRw0AC0H/ACECDK8BCyABIARGBEBB/gAhAgyvAQsCQCABLQAAQQlrDjcvAwYvBAYGBgYGBgYGBgYGBgYGBgYGBgUGBgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYABgsgAUEBagshAUEFIQIMlAELIAFBAWoMBgsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgyrAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgyqAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgypAQsgA0EANgIcIAMgATYCFCADQY0UNgIQIANBBzYCDEEAIQIMqAELAkACQAJAAkADQCABLQAAQaDKAGotAAAiAEEFRwRAAkAgAEEBaw4GLgMEBQYABgtB6AAhAgyUAQsgBCABQQFqIgFHDQALQf0AIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqAELIANBADYCHCADIAE2AhQgA0HkCDYCECADQQc2AgxBACECDKcBCyABIARGDQEgAUEBagshAUEGIQIMjAELQfwAIQIMpAELAkACQAJAAkADQCABLQAAQaDIAGotAAAiAEEFRwRAIABBAWsOBCkCAwQFCyAEIAFBAWoiAUcNAAtB+wAhAgynAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgymAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgylAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgykAQsgA0EANgIcIAMgATYCFCADQbwKNgIQIANBBzYCDEEAIQIMowELQc8AIQIMiQELQdEAIQIMiAELQecAIQIMhwELIAEgBEYEQEH6ACECDKABCwJAIAEtAABBCWsOBCAAACAACyABQQFqIQFB5gAhAgyGAQsgASAERgRAQfkAIQIMnwELAkAgAS0AAEEJaw4EHwAAHwALQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFBEBB4gEhAgyGAQsgAEEVRwRAIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDJ8BCyADQfgANgIcIAMgATYCFCADQeoaNgIQIANBFTYCDEEAIQIMngELIAEgBEcEQCADQQ02AgggAyABNgIEQeQAIQIMhQELQfcAIQIMnQELIAEgBEYEQEH2ACECDJ0BCwJAAkACQCABLQAAQcgAaw4LAAELCwsLCwsLCwILCyABQQFqIQFB3QAhAgyFAQsgAUEBaiEBQeAAIQIMhAELIAFBAWohAUHjACECDIMBC0H1ACECIAEgBEYNmwEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBtdUAai0AAEcNCCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMnAELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfQANgIcIAMgATYCFCADIAA2AgxBACECDJwBC0HiACECDIIBC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMnAELQeEAIQIMggELIANB8wA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyaAQsgAy0AKSIAQSNrQQtJDQkCQCAAQQZLDQBBASAAdEHKAHFFDQAMCgtBACECIANBADYCHCADIAE2AhQgA0HtCTYCECADQQg2AgwMmQELQfIAIQIgASAERg2YASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGz1QBqLQAARw0FIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAQsgAygCBCEAIANCADcDACADIAAgBkEBaiIBECsiAARAIANB8QA2AhwgAyABNgIUIAMgADYCDEEAIQIMmQELQd8AIQIMfwtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJkBC0HeACECDH8LIANB8AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyXAQsgAy0AKUEhRg0GIANBADYCHCADIAE2AhQgA0GRCjYCECADQQg2AgxBACECDJYBC0HvACECIAEgBEYNlQEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMlgELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgBFDQIgA0HtADYCHCADIAE2AhQgAyAANgIMQQAhAgyVAQsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNgAEgA0HuADYCHCADIAE2AhQgAyAANgIMQQAhAgyTAQtB3AAhAgx5C0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMkwELQdsAIQIMeQsgA0HsADYCHCADIAE2AhQgA0GAGzYCECADQRU2AgxBACECDJEBCyADLQApIgBBI0kNACAAQS5GDQAgA0EANgIcIAMgATYCFCADQckJNgIQIANBCDYCDEEAIQIMkAELQdoAIQIMdgsgASAERgRAQesAIQIMjwELAkAgAS0AAEEvRgRAIAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMQQAhAgyPAQtB2QAhAgx1CyABIARHBEAgA0EONgIIIAMgATYCBEHYACECDHULQeoAIQIMjQELIAEgBEYEQEHpACECDI0BCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHXACECDHQLIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ16IANB6AA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAEgBEYEQEHnACECDIwBCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDXsgA0HmADYCHCADIAE2AhQgAyAANgIMQQAhAgyMAQtB1gAhAgxyCyABIARGBEBB5QAhAgyLAQtBACEAQQEhBUEBIQdBACECAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkAgAS0AAEEwaw4KCgkAAQIDBAUGCAsLQQIMBgtBAwwFC0EEDAQLQQUMAwtBBgwCC0EHDAELQQgLIQJBACEFQQAhBwwCC0EJIQJBASEAQQAhBUEAIQcMAQtBACEFQQEhAgsgAyACOgArIAFBAWohAQJAAkAgAy0ALkEQcQ0AAkACQAJAIAMtACoOAwEAAgQLIAdFDQMMAgsgAA0BDAILIAVFDQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ0CIANB4gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ19IANB4wA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5AA2AhwgAyABNgIUIAMgADYCDAyLAQtB1AAhAgxxCyADLQApQSJGDYYBQdMAIQIMcAtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsgAEUEQEHVACECDHALIABBFUcEQCADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgyJAQsgA0HhADYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDIgBCyABIARGBEBB4AAhAgyIAQsCQAJAAkACQAJAIAEtAABBCmsOBAEEBAAECyABQQFqIQEMAQsgAUEBaiEBIANBL2otAABBAXFFDQELQdIAIQIMcAsgA0EANgIcIAMgATYCFCADQbYRNgIQIANBCTYCDEEAIQIMiAELIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIcBCyABIARGBEBB3wAhAgyHAQsgAS0AAEEKRgRAIAFBAWohAQwJCyADLQAuQcAAcQ0IIANBADYCHCADIAE2AhQgA0G2ETYCECADQQI2AgxBACECDIYBCyABIARGBEBB3QAhAgyGAQsgAS0AACICQQ1GBEAgAUEBaiEBQdAAIQIMbQsgASEAIAJBCWsOBAUBAQUBCyAEIAEiAEYEQEHcACECDIUBCyAALQAAQQpHDQAgAEEBagwCC0EAIQIgA0EANgIcIAMgADYCFCADQcotNgIQIANBBzYCDAyDAQsgASAERgRAQdsAIQIMgwELAkAgAS0AAEEJaw4EAwAAAwALIAFBAWoLIQFBzgAhAgxoCyABIARGBEBB2gAhAgyBAQsgAS0AAEEJaw4EAAEBAAELQQAhAiADQQA2AhwgA0GaEjYCECADQQc2AgwgAyABQQFqNgIUDH8LIANBgBI7ASpBACEAAkAgAygCOCICRQ0AIAIoAjgiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HZADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDH4LQc0AIQIMZAsgA0EANgIcIAMgATYCFCADQckNNgIQIANBGjYCDEEAIQIMfAsgASAERgRAQdkAIQIMfAsgAS0AAEEgRw09IAFBAWohASADLQAuQQFxDT0gA0EANgIcIAMgATYCFCADQcIcNgIQIANBHjYCDEEAIQIMewsgASAERgRAQdgAIQIMewsCQAJAAkACQAJAIAEtAAAiAEEKaw4EAgMDAAELIAFBAWohAUEsIQIMZQsgAEE6Rw0BIANBADYCHCADIAE2AhQgA0HnETYCECADQQo2AgxBACECDH0LIAFBAWohASADQS9qLQAAQQFxRQ1zIAMtADJBgAFxRQRAIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsCQAJAIAAOFk1MSwEBAQEBAQEBAQEBAQEBAQEBAQABCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgx+CyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgx9C0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ1ZIABBFUcNASADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgx8C0HLACECDGILQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDHoLIAMgAy8BMkGAAXI7ATIMOwsgASAERwRAIANBETYCCCADIAE2AgRBygAhAgxgC0HXACECDHgLIAEgBEYEQEHWACECDHgLAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAQEBAQEBAQEBAQEBAAUBAQAIDQAsgAUEBaiEBQcYAIQIMYQsgAUEBaiEBQccAIQIMYAsgAUEBaiEBQcgAIQIMXwsgAUEBaiEBQckAIQIMXgtB1QAhAiAEIAEiAEYNdiAEIAFrIAMoAgAiAWohBiAAIAFrQQVqIQcDQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQhBBCABQQVGDQoaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHYLQdQAIQIgBCABIgBGDXUgBCABayADKAIAIgFqIQYgACABa0EPaiEHA0AgAUGAyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0HQQMgAUEPRg0JGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx1C0HTACECIAQgASIARg10IAQgAWsgAygCACIBaiEGIAAgAWtBDmohBwNAIAFB4scAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNBiABQQ5GDQcgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdAtB0gAhAiAEIAEiAEYNcyAEIAFrIAMoAgAiAWohBSAAIAFrQQFqIQYDQCABQeDHAGotAAAgAC0AACIHQSByIAcgB0HBAGtB/wFxQRpJG0H/AXFHDQUgAUEBRg0CIAFBAWohASAEIABBAWoiAEcNAAsgAyAFNgIADHMLIAEgBEYEQEHRACECDHMLAkACQCABLQAAIgBBIHIgACAAQcEAa0H/AXFBGkkbQf8BcUHuAGsOBwA5OTk5OQE5CyABQQFqIQFBwwAhAgxaCyABQQFqIQFBxAAhAgxZCyADQQA2AgAgBkEBaiEBQcUAIQIMWAtB0AAhAiAEIAEiAEYNcCAEIAFrIAMoAgAiAWohBiAAIAFrQQlqIQcDQCABQdbHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQJBAiABQQlGDQQaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHALQc8AIQIgBCABIgBGDW8gBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUHQxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxvCyAAIQEgA0EANgIADDMLQQELOgAsIANBADYCACAHQQFqIQELQS0hAgxSCwJAA0AgAS0AAEHQxQBqLQAAQQFHDQEgBCABQQFqIgFHDQALQc0AIQIMawtBwgAhAgxRCyABIARGBEBBzAAhAgxqCyABLQAAQTpGBEAgAygCBCEAIANBADYCBCADIAAgARAwIgBFDTMgA0HLADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxqCyADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgxpCwJAAkAgAy0ALEECaw4CAAEnCyADQTNqLQAAQQJxRQ0mIAMtAC5BAnENJiADQQA2AhwgAyABNgIUIANBphQ2AhAgA0ELNgIMQQAhAgxpCyADLQAyQSBxRQ0lIAMtAC5BAnENJSADQQA2AhwgAyABNgIUIANBvRM2AhAgA0EPNgIMQQAhAgxoC0EAIQACQCADKAI4IgJFDQAgAigCSCICRQ0AIAMgAhEAACEACyAARQRAQcEAIQIMTwsgAEEVRwRAIANBADYCHCADIAE2AhQgA0GmDzYCECADQRw2AgxBACECDGgLIANBygA2AhwgAyABNgIUIANBhRw2AhAgA0EVNgIMQQAhAgxnCyABIARHBEAgASECA0AgBCACIgFrQRBOBEAgAUEQaiEC/Qz/////////////////////IAH9AAAAIg1BB/1sIA39DODg4ODg4ODg4ODg4ODg4OD9bv0MX19fX19fX19fX19fX19fX/0mIA39DAkJCQkJCQkJCQkJCQkJCQn9I/1Q/VL9ZEF/c2giAEEQRg0BIAAgAWohAQwYCyABIARGBEBBxAAhAgxpCyABLQAAQcDBAGotAABBAUcNFyAEIAFBAWoiAkcNAAtBxAAhAgxnC0HEACECDGYLIAEgBEcEQANAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXEiAEEJRg0AIABBIEYNAAJAAkACQAJAIABB4wBrDhMAAwMDAwMDAwEDAwMDAwMDAwMCAwsgAUEBaiEBQTYhAgxSCyABQQFqIQFBNyECDFELIAFBAWohAUE4IQIMUAsMFQsgBCABQQFqIgFHDQALQTwhAgxmC0E8IQIMZQsgASAERgRAQcgAIQIMZQsgA0ESNgIIIAMgATYCBAJAAkACQAJAAkAgAy0ALEEBaw4EFAABAgkLIAMtADJBIHENA0HgASECDE8LAkAgAy8BMiIAQQhxRQ0AIAMtAChBAUcNACADLQAuQQhxRQ0CCyADIABB9/sDcUGABHI7ATIMCwsgAyADLwEyQRByOwEyDAQLIANBADYCBCADIAEgARAxIgAEQCADQcEANgIcIAMgADYCDCADIAFBAWo2AhRBACECDGYLIAFBAWohAQxYCyADQQA2AhwgAyABNgIUIANB9BM2AhAgA0EENgIMQQAhAgxkC0HHACECIAEgBEYNYyADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIABBwMUAai0AACABLQAAQSByRw0BIABBBkYNSiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAxkCyADQQA2AgAMBQsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkcNAyABQQFqIQEMBQsgBCABQQFqIgFHDQALQcUAIQIMZAtBxQAhAgxjCwsgA0EAOgAsDAELQQshAgxHC0E/IQIMRgsCQAJAA0AgAS0AACIAQSBHBEACQCAAQQprDgQDBQUDAAsgAEEsRg0DDAQLIAQgAUEBaiIBRw0AC0HGACECDGALIANBCDoALAwOCyADLQAoQQFHDQIgAy0ALkEIcQ0CIAMoAgQhACADQQA2AgQgAyAAIAEQMSIABEAgA0HCADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxfCyABQQFqIQEMUAtBOyECDEQLAkADQCABLQAAIgBBIEcgAEEJR3ENASAEIAFBAWoiAUcNAAtBwwAhAgxdCwtBPCECDEILAkACQCABIARHBEADQCABLQAAIgBBIEcEQCAAQQprDgQDBAQDBAsgBCABQQFqIgFHDQALQT8hAgxdC0E/IQIMXAsgAyADLwEyQSByOwEyDAoLIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQ1OIANBPjYCHCADIAE2AhQgAyAANgIMQQAhAgxaCwJAIAEgBEcEQANAIAEtAABBwMMAai0AACIAQQFHBEAgAEECRg0DDAwLIAQgAUEBaiIBRw0AC0E3IQIMWwtBNyECDFoLIAFBAWohAQwEC0E7IQIgBCABIgBGDVggBCABayADKAIAIgFqIQYgACABa0EFaiEHAkADQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEFRgRAQQchAQw/CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxZCyADQQA2AgAgACEBDAULQTohAiAEIAEiAEYNVyAEIAFrIAMoAgAiAWohBiAAIAFrQQhqIQcCQANAIAFBtMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQhGBEBBBSEBDD4LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFgLIANBADYCACAAIQEMBAtBOSECIAQgASIARg1WIAQgAWsgAygCACIBaiEGIAAgAWtBA2ohBwJAA0AgAUGwwQBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBA0YEQEEGIQEMPQsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMVwsgA0EANgIAIAAhAQwDCwJAA0AgAS0AACIAQSBHBEAgAEEKaw4EBwQEBwILIAQgAUEBaiIBRw0AC0E4IQIMVgsgAEEsRw0BIAFBAWohAEEBIQECQAJAAkACQAJAIAMtACxBBWsOBAMBAgQACyAAIQEMBAtBAiEBDAELQQQhAQsgA0EBOgAsIAMgAy8BMiABcjsBMiAAIQEMAQsgAyADLwEyQQhyOwEyIAAhAQtBPiECDDsLIANBADoALAtBOSECDDkLIAEgBEYEQEE2IQIMUgsCQAJAAkACQAJAIAEtAABBCmsOBAACAgECCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNAiADQTM2AhwgAyABNgIUIAMgADYCDEEAIQIMVQsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDAYLIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxUCyADLQAuQQFxBEBB3wEhAgw7CyADKAIEIQAgA0EANgIEIAMgACABEDEiAA0BDEkLQTQhAgw5CyADQTU2AhwgAyABNgIUIAMgADYCDEEAIQIMUQtBNSECDDcLIANBL2otAABBAXENACADQQA2AhwgAyABNgIUIANB6xY2AhAgA0EZNgIMQQAhAgxPC0EzIQIMNQsgASAERgRAQTIhAgxOCwJAIAEtAABBCkYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZIXNgIQIANBAzYCDEEAIQIMTgtBMiECDDQLIAEgBEYEQEExIQIMTQsCQCABLQAAIgBBCUYNACAAQSBGDQBBASECAkAgAy0ALEEFaw4EBgQFAA0LIAMgAy8BMkEIcjsBMgwMCyADLQAuQQFxRQ0BIAMtACxBCEcNACADQQA6ACwLQT0hAgwyCyADQQA2AhwgAyABNgIUIANBwhY2AhAgA0EKNgIMQQAhAgxKC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyDAYLIAEgBEYEQEEwIQIMRwsgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQQFxDQAgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMRgtBMCECDCwLIAFBAWohAUExIQIMKwsgASAERgRAQS8hAgxECyABLQAAIgBBCUcgAEEgR3FFBEAgAUEBaiEBIAMtAC5BAXENASADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgxEC0EBIQICQAJAAkACQAJAAkAgAy0ALEECaw4HBQQEAwECAAQLIAMgAy8BMkEIcjsBMgwDC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyC0EvIQIMKwsgA0EANgIcIAMgATYCFCADQYQTNgIQIANBCzYCDEEAIQIMQwtB4QEhAgwpCyABIARGBEBBLiECDEILIANBADYCBCADQRI2AgggAyABIAEQMSIADQELQS4hAgwnCyADQS02AhwgAyABNgIUIAMgADYCDEEAIQIMPwtBACEAAkAgAygCOCICRQ0AIAIoAkwiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HYADYCHCADIAE2AhQgA0GzGzYCECADQRU2AgxBACECDD4LQcwAIQIMJAsgA0EANgIcIAMgATYCFCADQbMONgIQIANBHTYCDEEAIQIMPAsgASAERgRAQc4AIQIMPAsgAS0AACIAQSBGDQIgAEE6Rg0BCyADQQA6ACxBCSECDCELIAMoAgQhACADQQA2AgQgAyAAIAEQMCIADQEMAgsgAy0ALkEBcQRAQd4BIQIMIAsgAygCBCEAIANBADYCBCADIAAgARAwIgBFDQIgA0EqNgIcIAMgADYCDCADIAFBAWo2AhRBACECDDgLIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMNwsgAUEBaiEBQcAAIQIMHQsgAUEBaiEBDCwLIAEgBEYEQEErIQIMNQsCQCABLQAAQQpGBEAgAUEBaiEBDAELIAMtAC5BwABxRQ0GCyADLQAyQYABcQRAQQAhAAJAIAMoAjgiAkUNACACKAJcIgJFDQAgAyACEQAAIQALIABFDRIgAEEVRgRAIANBBTYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDDYLIANBADYCHCADIAE2AhQgA0GQDjYCECADQRQ2AgxBACECDDULIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsgAA4WAgEABAQEBAQEBAQEBAQEBAQEBAQEAwQLIANBAToAMAsgAiACLwEAQcAAcjsBAAtBKyECDBgLIANBKTYCHCADIAE2AhQgA0GsGTYCECADQRU2AgxBACECDDALIANBADYCHCADIAE2AhQgA0HlCzYCECADQRE2AgxBACECDC8LIANBADYCHCADIAE2AhQgA0GlCzYCECADQQI2AgxBACECDC4LQQEhByADLwEyIgVBCHFFBEAgAykDIEIAUiEHCwJAIAMtADAEQEEBIQAgAy0AKUEFRg0BIAVBwABxRSAHcUUNAQsCQCADLQAoIgJBAkYEQEEBIQAgAy8BNCIGQeUARg0CQQAhACAFQcAAcQ0CIAZB5ABGDQIgBkHmAGtBAkkNAiAGQcwBRg0CIAZBsAJGDQIMAQtBACEAIAVBwABxDQELQQIhACAFQQhxDQAgBUGABHEEQAJAIAJBAUcNACADLQAuQQpxDQBBBSEADAILQQQhAAwBCyAFQSBxRQRAIAMQNkEAR0ECdCEADAELQQBBAyADKQMgUBshAAsgAEEBaw4FAgAHAQMEC0ERIQIMEwsgA0EBOgAxDCkLQQAhAgJAIAMoAjgiAEUNACAAKAIwIgBFDQAgAyAAEQAAIQILIAJFDSYgAkEVRgRAIANBAzYCHCADIAE2AhQgA0HSGzYCECADQRU2AgxBACECDCsLQQAhAiADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMDCoLIANBADYCHCADIAE2AhQgA0H5IDYCECADQQ82AgxBACECDCkLQQAhAAJAIAMoAjgiAkUNACACKAIwIgJFDQAgAyACEQAAIQALIAANAQtBDiECDA4LIABBFUYEQCADQQI2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwnCyADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMQQAhAgwmC0EqIQIMDAsgASAERwRAIANBCTYCCCADIAE2AgRBKSECDAwLQSYhAgwkCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMVARAQSUhAgwkCyADKAIEIQAgA0EANgIEIAMgACABIAynaiIBEDIiAEUNACADQQU2AhwgAyABNgIUIAMgADYCDEEAIQIMIwtBDyECDAkLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQTBrDjcXFgABAgMEBQYHFBQUFBQUFAgJCgsMDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUDg8QERITFAtCAiEKDBYLQgMhCgwVC0IEIQoMFAtCBSEKDBMLQgYhCgwSC0IHIQoMEQtCCCEKDBALQgkhCgwPC0IKIQoMDgtCCyEKDA0LQgwhCgwMC0INIQoMCwtCDiEKDAoLQg8hCgwJC0IKIQoMCAtCCyEKDAcLQgwhCgwGC0INIQoMBQtCDiEKDAQLQg8hCgwDCyADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMQQAhAgwhCyABIARGBEBBIiECDCELQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FRQAAQIDBAUGBxYWFhYWFhYICQoLDA0WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFg4PEBESExYLQgIhCgwUC0IDIQoMEwtCBCEKDBILQgUhCgwRC0IGIQoMEAtCByEKDA8LQgghCgwOC0IJIQoMDQtCCiEKDAwLQgshCgwLC0IMIQoMCgtCDSEKDAkLQg4hCgwIC0IPIQoMBwtCCiEKDAYLQgshCgwFC0IMIQoMBAtCDSEKDAMLQg4hCgwCC0IPIQoMAQtCASEKCyABQQFqIQEgAykDICILQv//////////D1gEQCADIAtCBIYgCoQ3AyAMAgsgA0EANgIcIAMgATYCFCADQbUJNgIQIANBDDYCDEEAIQIMHgtBJyECDAQLQSghAgwDCyADIAE6ACwgA0EANgIAIAdBAWohAUEMIQIMAgsgA0EANgIAIAZBAWohAUEKIQIMAQsgAUEBaiEBQQghAgwACwALQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBcLQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBYLQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBULQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDBQLQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDBMLQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBILQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBELQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBALQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDA8LQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDA4LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDA0LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDAwLQQAhAiADQQA2AhwgAyABNgIUIANBmRM2AhAgA0ELNgIMDAsLQQAhAiADQQA2AhwgAyABNgIUIANBnQk2AhAgA0ELNgIMDAoLQQAhAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMDAkLQQAhAiADQQA2AhwgAyABNgIUIANBsRA2AhAgA0EKNgIMDAgLQQAhAiADQQA2AhwgAyABNgIUIANBux02AhAgA0ECNgIMDAcLQQAhAiADQQA2AhwgAyABNgIUIANBlhY2AhAgA0ECNgIMDAYLQQAhAiADQQA2AhwgAyABNgIUIANB+Rg2AhAgA0ECNgIMDAULQQAhAiADQQA2AhwgAyABNgIUIANBxBg2AhAgA0ECNgIMDAQLIANBAjYCHCADIAE2AhQgA0GpHjYCECADQRY2AgxBACECDAMLQd4AIQIgASAERg0CIAlBCGohByADKAIAIQUCQAJAIAEgBEcEQCAFQZbIAGohCCAEIAVqIAFrIQYgBUF/c0EKaiIFIAFqIQADQCABLQAAIAgtAABHBEBBAiEIDAMLIAVFBEBBACEIIAAhAQwDCyAFQQFrIQUgCEEBaiEIIAQgAUEBaiIBRw0ACyAGIQUgBCEBCyAHQQE2AgAgAyAFNgIADAELIANBADYCACAHIAg2AgALIAcgATYCBCAJKAIMIQACQAJAIAkoAghBAWsOAgQBAAsgA0EANgIcIANBwh42AhAgA0EXNgIMIAMgAEEBajYCFEEAIQIMAwsgA0EANgIcIAMgADYCFCADQdceNgIQIANBCTYCDEEAIQIMAgsgASAERgRAQSghAgwCCyADQQk2AgggAyABNgIEQSchAgwBCyABIARGBEBBASECDAELA0ACQAJAAkAgAS0AAEEKaw4EAAEBAAELIAFBAWohAQwBCyABQQFqIQEgAy0ALkEgcQ0AQQAhAiADQQA2AhwgAyABNgIUIANBoSE2AhAgA0EFNgIMDAILQQEhAiABIARHDQALCyAJQRBqJAAgAkUEQCADKAIMIQAMAQsgAyACNgIcQQAhACADKAIEIgFFDQAgAyABIAQgAygCCBEBACIBRQ0AIAMgBDYCFCADIAE2AgwgASEACyAAC74CAQJ/IABBADoAACAAQeQAaiIBQQFrQQA6AAAgAEEAOgACIABBADoAASABQQNrQQA6AAAgAUECa0EAOgAAIABBADoAAyABQQRrQQA6AABBACAAa0EDcSIBIABqIgBBADYCAEHkACABa0F8cSICIABqIgFBBGtBADYCAAJAIAJBCUkNACAAQQA2AgggAEEANgIEIAFBCGtBADYCACABQQxrQQA2AgAgAkEZSQ0AIABBADYCGCAAQQA2AhQgAEEANgIQIABBADYCDCABQRBrQQA2AgAgAUEUa0EANgIAIAFBGGtBADYCACABQRxrQQA2AgAgAiAAQQRxQRhyIgJrIgFBIEkNACAAIAJqIQADQCAAQgA3AxggAEIANwMQIABCADcDCCAAQgA3AwAgAEEgaiEAIAFBIGsiAUEfSw0ACwsLVgEBfwJAIAAoAgwNAAJAAkACQAJAIAAtADEOAwEAAwILIAAoAjgiAUUNACABKAIwIgFFDQAgACABEQAAIgENAwtBAA8LAAsgAEHKGTYCEEEOIQELIAELGgAgACgCDEUEQCAAQd4fNgIQIABBFTYCDAsLFAAgACgCDEEVRgRAIABBADYCDAsLFAAgACgCDEEWRgRAIABBADYCDAsLBwAgACgCDAsHACAAKAIQCwkAIAAgATYCEAsHACAAKAIUCysAAkAgAEEnTw0AQv//////CSAArYhCAYNQDQAgAEECdEHQOGooAgAPCwALFwAgAEEvTwRAAAsgAEECdEHsOWooAgALvwkBAX9B9C0hAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HqLA8LQZgmDwtB7TEPC0GgNw8LQckpDwtBtCkPC0GWLQ8LQesrDwtBojUPC0HbNA8LQeApDwtB4yQPC0HVJA8LQe4kDwtB5iUPC0HKNA8LQdA3DwtBqjUPC0H1LA8LQfYmDwtBgiIPC0HyMw8LQb4oDwtB5zcPC0HNIQ8LQcAhDwtBuCUPC0HLJQ8LQZYkDwtBjzQPC0HNNQ8LQd0qDwtB7jMPC0GcNA8LQZ4xDwtB9DUPC0HlIg8LQa8lDwtBmTEPC0GyNg8LQfk2DwtBxDIPC0HdLA8LQYIxDwtBwTEPC0GNNw8LQckkDwtB7DYPC0HnKg8LQcgjDwtB4iEPC0HJNw8LQaUiDwtBlCIPC0HbNg8LQd41DwtBhiYPC0G8Kw8LQYsyDwtBoCMPC0H2MA8LQYAsDwtBiSsPC0GkJg8LQfIjDwtBgSgPC0GrMg8LQesnDwtBwjYPC0GiJA8LQc8qDwtB3CMPC0GHJw8LQeQ0DwtBtyIPC0GtMQ8LQdUiDwtBrzQPC0HeJg8LQdYyDwtB9DQPC0GBOA8LQfQ3DwtBkjYPC0GdJw8LQYIpDwtBjSMPC0HXMQ8LQb01DwtBtDcPC0HYMA8LQbYnDwtBmjgPC0GnKg8LQcQnDwtBriMPC0H1Ig8LAAtByiYhAQsgAQsXACAAIAAvAS5B/v8DcSABQQBHcjsBLgsaACAAIAAvAS5B/f8DcSABQQBHQQF0cjsBLgsaACAAIAAvAS5B+/8DcSABQQBHQQJ0cjsBLgsaACAAIAAvAS5B9/8DcSABQQBHQQN0cjsBLgsaACAAIAAvAS5B7/8DcSABQQBHQQR0cjsBLgsaACAAIAAvAS5B3/8DcSABQQBHQQV0cjsBLgsaACAAIAAvAS5Bv/8DcSABQQBHQQZ0cjsBLgsaACAAIAAvAS5B//4DcSABQQBHQQd0cjsBLgsaACAAIAAvAS5B//0DcSABQQBHQQh0cjsBLgsaACAAIAAvAS5B//sDcSABQQBHQQl0cjsBLgs+AQJ/AkAgACgCOCIDRQ0AIAMoAgQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeESNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAggiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfwRNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAgwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQewKNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfoeNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQcsQNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhgiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQbcfNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQb8VNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQf4INgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQYwdNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeYVNgIQQRghBAsgBAs4ACAAAn8gAC8BMkEUcUEURgRAQQEgAC0AKEEBRg0BGiAALwE0QeUARgwBCyAALQApQQVGCzoAMAtZAQJ/AkAgAC0AKEEBRg0AIAAvATQiAUHkAGtB5ABJDQAgAUHMAUYNACABQbACRg0AIAAvATIiAEHAAHENAEEBIQIgAEGIBHFBgARGDQAgAEEocUUhAgsgAguMAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQAgAC8BMiIBQQJxRQ0BDAILIAAvATIiAUEBcUUNAQtBASECIAAtAChBAUYNACAALwE0IgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNACABQcAAcQ0AQQAhAiABQYgEcUGABEYNACABQShxQQBHIQILIAILcwAgAEEQav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAP0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEwav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEgav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==",oor;Object.defineProperty(AUn,"exports",{get:a(()=>oor||(oor=uws.from(dws,"base64")),"get")})});var BPe=I((jlf,IUn)=>{"use strict";p();var EUn=["GET","HEAD","POST"],fws=new Set(EUn),pws=[101,204,205,304],_Un=[301,302,303,307,308],hws=new Set(_Un),vUn=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"],mws=new Set(vUn),CUn=["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],gws=["",...CUn],Aws=new Set(CUn),yws=["follow","manual","error"],bUn=["GET","HEAD","OPTIONS","TRACE"],Ews=new Set(bUn),_ws=["navigate","same-origin","no-cors","cors"],vws=["omit","same-origin","include"],Cws=["default","no-store","reload","no-cache","force-cache","only-if-cached"],bws=["content-encoding","content-language","content-location","content-type","content-length"],Sws=["half"],SUn=["CONNECT","TRACE","TRACK"],Tws=new Set(SUn),TUn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],Iws=new Set(TUn);IUn.exports={subresource:TUn,forbiddenMethods:SUn,requestBodyHeader:bws,referrerPolicy:gws,requestRedirect:yws,requestMode:_ws,requestCredentials:vws,requestCache:Cws,redirectStatus:_Un,corsSafeListedMethods:EUn,nullBodyStatus:pws,safeMethods:bUn,badPorts:vUn,requestDuplex:Sws,subresourceSet:Iws,badPortsSet:mws,redirectStatusSet:hws,corsSafeListedMethodsSet:fws,safeMethodsSet:Ews,forbiddenMethodsSet:Tws,referrerPolicyTokens:Aws}});var aor=I((Glf,xUn)=>{"use strict";p();var sor=Symbol.for("undici.globalOrigin.1");function xws(){return globalThis[sor]}a(xws,"getGlobalOrigin");function wws(t){if(t===void 0){Object.defineProperty(globalThis,sor,{value:void 0,writable:!0,enumerable:!1,configurable:!1});return}let e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new TypeError(`Only http & https urls are allowed, received ${e.protocol}`);Object.defineProperty(globalThis,sor,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(wws,"setGlobalOrigin");xUn.exports={getGlobalOrigin:xws,setGlobalOrigin:wws}});var est=I((Wlf,wUn)=>{"use strict";p();var Rws=new TextDecoder;function kws(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),Rws.decode(t))}a(kws,"utf8DecodeBytes");wUn.exports={utf8DecodeBytes:kws}});var XF=I((Klf,DUn)=>{"use strict";p();var RUn=require("node:assert"),{utf8DecodeBytes:Pws}=est();function Dws(t,e,r){let n="";for(;r.positione)return String.fromCharCode.apply(null,t);let r="",n=0,o=65535;for(;ne&&(o=e-n),r+=String.fromCharCode.apply(null,t.subarray(n,n+=o));return r}a(Lws,"isomorphicDecode");var Bws=/[^\x00-\xFF]/;function Fws(t){return RUn(!Bws.test(t)),t}a(Fws,"isomorphicEncode");function Uws(t){return JSON.parse(Pws(t))}a(Uws,"parseJSONFromBytes");function Qws(t,e=!0,r=!0){return PUn(t,e,r,kUn)}a(Qws,"removeASCIIWhitespace");function PUn(t,e,r,n){let o=0,s=t.length-1;if(e)for(;o0&&n(t.charCodeAt(s));)s--;return o===0&&s===t.length-1?t:t.slice(o,s+1)}a(PUn,"removeChars");function qws(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return RUn(typeof e=="string"),e}a(qws,"serializeJavascriptValueToJSONString");DUn.exports={collectASequenceOfCodePoints:Dws,collectASequenceOfCodePointsFast:Nws,forgivingBase64:Ows,isASCIIWhitespace:kUn,isomorphicDecode:Lws,isomorphicEncode:Fws,parseJSONFromBytes:Uws,removeASCIIWhitespace:Qws,removeChars:PUn,serializeJavascriptValueToJSONString:qws}});var jw=I((Xlf,FUn)=>{"use strict";p();var rst=require("node:assert"),{forgivingBase64:jws,collectASequenceOfCodePoints:cor,collectASequenceOfCodePointsFast:FPe,isomorphicDecode:Hws,removeASCIIWhitespace:Gws,removeChars:$ws}=XF(),Vws=new TextEncoder,UPe=/^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u,Wws=/[\u000A\u000D\u0009\u0020]/u,zws=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;function Yws(t){rst(t.protocol==="data:");let e=OUn(t,!0);e=e.slice(5);let r={position:0},n=FPe(",",e,r),o=n.length;if(n=Gws(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=LUn(s);if(/;(?:\u0020*)base64$/ui.test(n)){let u=Hws(c);if(c=jws(u),c==="failure")return"failure";n=n.slice(0,-6),n=n.replace(/(\u0020+)$/u,""),n=n.slice(0,-1)}n.startsWith(";")&&(n="text/plain"+n);let l=lor(n);return l==="failure"&&(l=lor("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(Yws,"dataURLProcessor");function OUn(t,e=!1){if(!e)return t.href;let r=t.href,n=t.hash.length,o=n===0?r:r.substring(0,r.length-n);return!n&&r.endsWith("#")?o.slice(0,-1):o}a(OUn,"URLSerializer");function LUn(t){let e=Vws.encode(t);return Kws(e)}a(LUn,"stringPercentDecode");function NUn(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(NUn,"isHexCharByte");function MUn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(MUn,"hexByteToNumber");function Kws(t){let e=t.length,r=new Uint8Array(e),n=0,o=0;for(;o=t.length)return"failure";e.position++;let n=FPe(";",t,e);if(n=tst(n,!1,!0),n.length===0||!UPe.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionWws.test(d),t,e);let l=cor(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.position=t.length)break;let u=null;if(t[e.position]==='"')u=BUn(t,e,!0),FPe(";",t,e);else if(u=FPe(";",t,e),u=tst(u,!1,!0),u.length===0)continue;l.length!==0&&UPe.test(l)&&(u.length===0||zws.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(lor,"parseMIMEType");function BUn(t,e,r=!1){let n=e.position,o="";for(rst(t[e.position]==='"'),e.position++;o+=cor(c=>c!=='"'&&c!=="\\",t,e),!(e.position>=t.length);){let s=t[e.position];if(e.position++,s==="\\"){if(e.position>=t.length){o+="\\";break}o+=t[e.position],e.position++}else{rst(s==='"');break}}return r?o:t.slice(n,e.position)}a(BUn,"collectAnHTTPQuotedString");function Jws(t){rst(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",UPe.test(s)||(s=s.replace(/[\\"]/ug,"\\$&"),s='"'+s,s+='"'),n+=s;return n}a(Jws,"serializeAMimeType");function Zws(t){return t===13||t===10||t===9||t===32}a(Zws,"isHTTPWhiteSpace");function tst(t,e=!0,r=!0){return $ws(t,e,r,Zws)}a(tst,"removeHTTPWhitespace");function Xws(t){switch(t.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return t.subtype.endsWith("+json")?"application/json":t.subtype.endsWith("+xml")?"application/xml":""}a(Xws,"minimizeSupportedMimeType");FUn.exports={dataURLProcessor:Yws,URLSerializer:OUn,stringPercentDecode:LUn,parseMIMEType:lor,collectAnHTTPQuotedString:BUn,serializeAMimeType:Jws,removeHTTPWhitespace:tst,minimizeSupportedMimeType:Xws,HTTP_TOKEN_CODEPOINTS:UPe}});var e8=I((ruf,dor)=>{"use strict";p();var UUn={__proto__:null,"node:crypto":a(()=>require("node:crypto"),"node:crypto"),"node:sqlite":a(()=>require("node:sqlite"),"node:sqlite"),"node:worker_threads":a(()=>require("node:worker_threads"),"node:worker_threads"),"node:zlib":a(()=>require("node:zlib"),"node:zlib")};function eRs(t){try{return UUn[t](),!0}catch(e){if(e.code!=="ERR_UNKNOWN_BUILTIN_MODULE"&&e.code!=="ERR_NO_CRYPTO")throw e;return!1}}a(eRs,"detectRuntimeFeatureByNodeModule");function tRs(t,e){return typeof UUn[t]()[e]<"u"}a(tRs,"detectRuntimeFeatureByExportedProperty");var QUn=["markAsUncloneable","zstd"],rRs={markAsUncloneable:["node:worker_threads","markAsUncloneable"],zstd:["node:zlib","createZstdDecompress"]},qUn=["crypto","sqlite"],nRs=[...qUn,...QUn];function iRs(t){if(qUn.includes(t))return eRs(`node:${t}`);if(QUn.includes(t)){let[e,r]=rRs[t];return tRs(e,r)}throw new TypeError(`unknown feature: ${t}`)}a(iRs,"detectRuntimeFeature");var uor=class{static{a(this,"RuntimeFeatures")}#e=new Map;clear(){this.#e.clear()}has(e){return this.#e.get(e)??this.#t(e)}set(e,r){if(nRs.includes(e)===!1)throw new TypeError(`unknown feature: ${e}`);this.#e.set(e,r)}#t(e){let r=iRs(e);return this.#e.set(e,r),r}},jUn=new uor;dor.exports.runtimeFeatures=jUn;dor.exports.default=jUn});var zA=I((ouf,GUn)=>{"use strict";p();var oRs=require("node:assert"),{types:Ap,inspect:sRs}=require("node:util"),{runtimeFeatures:aRs}=e8(),por=1,hor=2,nst=3,ist=4,mor=5,ost=6,gor=7,TT=8,HUn=Function.call.bind(Function.prototype[Symbol.hasInstance]),ut={converters:{},util:{},errors:{},is:{}};ut.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};ut.errors.conversionFailed=function(t){let e=t.types.length===1?"":" one of",r=`${t.argument} could not be converted to${e}: ${t.types.join(", ")}.`;return ut.errors.exception({header:t.prefix,message:r})};ut.errors.invalidArgument=function(t){return ut.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};ut.brandCheck=function(t,e){if(!HUn(e,t)){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}};ut.brandCheckMultiple=function(t){let e=t.map(r=>ut.util.MakeTypeAssertion(r));return r=>{if(e.every(n=>!n(r))){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}};ut.argumentLengthCheck=function({length:t},e,r){if(tHUn(t,e)};ut.util.Type=function(t){switch(typeof t){case"undefined":return por;case"boolean":return hor;case"string":return nst;case"symbol":return ist;case"number":return mor;case"bigint":return ost;case"function":case"object":return t===null?gor:TT}};ut.util.Types={UNDEFINED:por,BOOLEAN:hor,STRING:nst,SYMBOL:ist,NUMBER:mor,BIGINT:ost,NULL:gor,OBJECT:TT};ut.util.TypeValueToString=function(t){switch(ut.util.Type(t)){case por:return"Undefined";case hor:return"Boolean";case nst:return"String";case ist:return"Symbol";case mor:return"Number";case ost:return"BigInt";case gor:return"Null";case TT:return"Object"}};ut.util.markAsUncloneable=aRs.has("markAsUncloneable")?require("node:worker_threads").markAsUncloneable:()=>{};ut.util.ConvertToInt=function(t,e,r,n){let o,s;e===64?(o=Math.pow(2,53)-1,r==="unsigned"?s=0:s=Math.pow(-2,53)+1):r==="unsigned"?(s=0,o=Math.pow(2,e)-1):(s=-Math.pow(2,e-1),o=Math.pow(2,e-1)-1);let c=Number(t);if(c===0&&(c=0),ut.util.HasFlag(n,ut.attributes.EnforceRange)){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw ut.errors.exception({header:"Integer conversion",message:`Could not convert ${ut.util.Stringify(t)} to an integer.`});if(c=ut.util.IntegerPart(c),co)throw ut.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&&ut.util.HasFlag(n,ut.attributes.Clamp)?(c=Math.min(Math.max(c,s),o),Math.floor(c)%2===0?c=Math.floor(c):c=Math.ceil(c),c):Number.isNaN(c)||c===0&&Object.is(0,c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY?0:(c=ut.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e-1)?c-Math.pow(2,e):c)};ut.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};ut.util.Stringify=function(t){switch(ut.util.Type(t)){case ist:return`Symbol(${t.description})`;case TT:return sRs(t);case nst:return`"${t}"`;case ost:return`${t}n`;default:return`${t}`}};ut.util.IsResizableArrayBuffer=function(t){if(Ap.isArrayBuffer(t))return t.resizable;if(Ap.isSharedArrayBuffer(t))return t.growable;throw ut.errors.exception({header:"IsResizableArrayBuffer",message:`"${ut.util.Stringify(t)}" is not an array buffer.`})};ut.util.HasFlag=function(t,e){return typeof t=="number"&&(t&e)===e};ut.sequenceConverter=function(t){return(e,r,n,o)=>{if(ut.util.Type(e)!==TT)throw ut.errors.exception({header:r,message:`${n} (${ut.util.Stringify(e)}) is not iterable.`});let s=typeof o=="function"?o():e?.[Symbol.iterator]?.(),c=[],l=0;if(s===void 0||typeof s.next!="function")throw ut.errors.exception({header:r,message:`${n} is not iterable.`});for(;;){let{done:u,value:d}=s.next();if(u)break;c.push(t(d,r,`${n}[${l++}]`))}return c}};ut.recordConverter=function(t,e){return(r,n,o)=>{if(ut.util.Type(r)!==TT)throw ut.errors.exception({header:n,message:`${o} ("${ut.util.TypeValueToString(r)}") is not an Object.`});let s={};if(!Ap.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=ut.util.Stringify(u),f=t(u,n,`Key ${d} in ${o}`),h=e(r[u],n,`${o}[${d}]`);s[f]=h}return s}let c=Reflect.ownKeys(r);for(let l of c)if(Reflect.getOwnPropertyDescriptor(r,l)?.enumerable){let d=t(l,n,o),f=e(r[l],n,o);s[d]=f}return s}};ut.interfaceConverter=function(t,e){return(r,n,o)=>{if(!t(r))throw ut.errors.exception({header:n,message:`Expected ${o} ("${ut.util.Stringify(r)}") to be an instance of ${e}.`});return r}};ut.dictionaryConverter=function(t){return t.sort((e,r)=>(e.key>r.key)-(e.key{let o={};if(e!=null&&ut.util.Type(e)!==TT)throw ut.errors.exception({header:r,message:`Expected ${e} to be one of: Null, Undefined, Object.`});for(let s of t){let{key:c,defaultValue:l,required:u,converter:d}=s;if(u===!0&&(e==null||!Object.hasOwn(e,c)))throw ut.errors.exception({header:r,message:`Missing required key "${c}".`});let f=e?.[c],h=l!==void 0;if(h&&f===void 0&&(f=l()),u||h||f!==void 0){if(f=d(f,r,`${n}.${c}`),s.allowedValues&&!s.allowedValues.includes(f))throw ut.errors.exception({header:r,message:`${f} is not an accepted type. Expected one of ${s.allowedValues.join(", ")}.`});o[c]=f}}return o}};ut.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};ut.is.USVString=function(t){return typeof t=="string"&&t.isWellFormed()};ut.is.ReadableStream=ut.util.MakeTypeAssertion(ReadableStream);ut.is.Blob=ut.util.MakeTypeAssertion(Blob);ut.is.URLSearchParams=ut.util.MakeTypeAssertion(URLSearchParams);ut.is.File=ut.util.MakeTypeAssertion(File);ut.is.URL=ut.util.MakeTypeAssertion(URL);ut.is.AbortSignal=ut.util.MakeTypeAssertion(AbortSignal);ut.is.MessagePort=ut.util.MakeTypeAssertion(MessagePort);ut.is.BufferSource=function(t){return Ap.isArrayBuffer(t)||ArrayBuffer.isView(t)&&Ap.isArrayBuffer(t.buffer)};ut.util.getCopyOfBytesHeldByBufferSource=function(t){let e=t,r=e,n=0,o=0;if(Ap.isTypedArray(e)||Ap.isDataView(e)?(r=e.buffer,n=e.byteOffset,o=e.byteLength):(oRs(Ap.isAnyArrayBuffer(e)),o=e.byteLength),r.detached)return new Uint8Array(0);let s=new Uint8Array(o),c=new Uint8Array(r,n,o);return s.set(c),s};ut.converters.DOMString=function(t,e,r,n){if(t===null&&ut.util.HasFlag(n,ut.attributes.LegacyNullToEmptyString))return"";if(typeof t=="symbol")throw ut.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};ut.converters.ByteString=function(t,e,r){if(typeof t=="symbol")throw ut.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a ByteString.`});let n=String(t);for(let o=0;o255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${o} has a value of ${n.charCodeAt(o)} which is greater than 255.`);return n};ut.converters.USVString=function(t){return typeof t=="string"?t.toWellFormed():`${t}`.toWellFormed()};ut.converters.boolean=function(t){return!!t};ut.converters.any=function(t){return t};ut.converters["long long"]=function(t,e,r){return ut.util.ConvertToInt(t,64,"signed",0,e,r)};ut.converters["unsigned long long"]=function(t,e,r){return ut.util.ConvertToInt(t,64,"unsigned",0,e,r)};ut.converters["unsigned long"]=function(t,e,r){return ut.util.ConvertToInt(t,32,"unsigned",0,e,r)};ut.converters["unsigned short"]=function(t,e,r,n){return ut.util.ConvertToInt(t,16,"unsigned",n,e,r)};ut.converters.ArrayBuffer=function(t,e,r,n){if(ut.util.Type(t)!==TT||!Ap.isArrayBuffer(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t))throw ut.errors.exception({header:e,message:`${r} cannot be a resizable ArrayBuffer.`});return t};ut.converters.SharedArrayBuffer=function(t,e,r,n){if(ut.util.Type(t)!==TT||!Ap.isSharedArrayBuffer(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["SharedArrayBuffer"]});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t))throw ut.errors.exception({header:e,message:`${r} cannot be a resizable SharedArrayBuffer.`});return t};ut.converters.TypedArray=function(t,e,r,n,o){if(ut.util.Type(t)!==TT||!Ap.isTypedArray(t)||t.constructor.name!==e.name)throw ut.errors.conversionFailed({prefix:r,argument:`${n} ("${ut.util.Stringify(t)}")`,types:[e.name]});if(!ut.util.HasFlag(o,ut.attributes.AllowShared)&&Ap.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:r,message:`${n} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(o,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:r,message:`${n} cannot be a view on a resizable array buffer.`});return t};ut.converters.DataView=function(t,e,r,n){if(ut.util.Type(t)!==TT||!Ap.isDataView(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["DataView"]});if(!ut.util.HasFlag(n,ut.attributes.AllowShared)&&Ap.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};ut.converters.ArrayBufferView=function(t,e,r,n){if(ut.util.Type(t)!==TT||!Ap.isArrayBufferView(t))throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBufferView"]});if(!ut.util.HasFlag(n,ut.attributes.AllowShared)&&Ap.isSharedArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!ut.util.HasFlag(n,ut.attributes.AllowResizable)&&ut.util.IsResizableArrayBuffer(t.buffer))throw ut.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};ut.converters.BufferSource=function(t,e,r,n){if(Ap.isArrayBuffer(t))return ut.converters.ArrayBuffer(t,e,r,n);if(Ap.isArrayBufferView(t))return n&=~ut.attributes.AllowShared,ut.converters.ArrayBufferView(t,e,r,n);throw Ap.isSharedArrayBuffer(t)?ut.errors.exception({header:e,message:`${r} cannot be a SharedArrayBuffer.`}):ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer","ArrayBufferView"]})};ut.converters.AllowSharedBufferSource=function(t,e,r,n){if(Ap.isArrayBuffer(t))return ut.converters.ArrayBuffer(t,e,r,n);if(Ap.isSharedArrayBuffer(t))return ut.converters.SharedArrayBuffer(t,e,r,n);if(Ap.isArrayBufferView(t))return n|=ut.attributes.AllowShared,ut.converters.ArrayBufferView(t,e,r,n);throw ut.errors.conversionFailed({prefix:e,argument:`${r} ("${ut.util.Stringify(t)}")`,types:["ArrayBuffer","SharedArrayBuffer","ArrayBufferView"]})};ut.converters["sequence"]=ut.sequenceConverter(ut.converters.ByteString);ut.converters["sequence>"]=ut.sequenceConverter(ut.converters["sequence"]);ut.converters["record"]=ut.recordConverter(ut.converters.ByteString,ut.converters.ByteString);ut.converters.Blob=ut.interfaceConverter(ut.is.Blob,"Blob");ut.converters.AbortSignal=ut.interfaceConverter(ut.is.AbortSignal,"AbortSignal");ut.converters.EventHandlerNonNull=function(t){return ut.util.Type(t)!==TT?null:typeof t=="function"?t:()=>{}};ut.attributes={Clamp:1,EnforceRange:2,AllowShared:4,AllowResizable:8,LegacyNullToEmptyString:16};GUn.exports={webidl:ut}});var IT=I((auf,i7n)=>{"use strict";p();var{Transform:cRs}=require("node:stream"),$Un=require("node:zlib"),{redirectStatusSet:lRs,referrerPolicyTokens:uRs,badPortsSet:dRs}=BPe(),{getGlobalOrigin:VUn}=aor(),{collectAnHTTPQuotedString:fRs,parseMIMEType:pRs}=jw(),{performance:hRs}=require("node:perf_hooks"),{ReadableStreamFrom:mRs,isValidHTTPToken:WUn,normalizedMethodRecordsBase:gRs}=Po(),qPe=require("node:assert"),{isUint8Array:ARs}=require("node:util/types"),{webidl:Xj}=zA(),{isomorphicEncode:Aor,collectASequenceOfCodePoints:NZ,removeChars:yRs}=XF();function zUn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(zUn,"responseURL");function ERs(t,e){if(!lRs.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&KUn(r)&&(YUn(r)||(r=_Rs(r)),r=new URL(r,zUn(t))),r&&!r.hash&&(r.hash=e),r}a(ERs,"responseLocationURL");function YUn(t){for(let e=0;e126||r<32)return!1}return!0}a(YUn,"isValidEncodedURL");function _Rs(t){return Buffer.from(t,"binary").toString("utf8")}a(_Rs,"normalizeBinaryStringToUtf8");function OZ(t){return t.urlList[t.urlList.length-1]}a(OZ,"requestCurrentURL");function vRs(t){let e=OZ(t);return r7n(e)&&dRs.has(e.port)?"blocked":"allowed"}a(vRs,"requestBadPort");function CRs(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(CRs,"isErrorLike");function bRs(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(bRs,"isValidReasonPhrase");var SRs=WUn;function KUn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` +`)||t.includes("\r")||t.includes("\0"))===!1}a(KUn,"isValidHeaderValue");function TRs(t){let e=(t.headersList.get("referrer-policy",!0)??"").split(","),r="";if(e.length)for(let n=e.length;n!==0;n--){let o=e[n-1].trim();if(uRs.has(o)){r=o;break}}return r}a(TRs,"parseReferrerPolicy");function IRs(t,e){let r=TRs(e);r!==""&&(t.referrerPolicy=r)}a(IRs,"setRequestReferrerPolicyOnRedirect");function xRs(){return"allowed"}a(xRs,"crossOriginResourcePolicyCheck");function wRs(){return"success"}a(wRs,"corsCheck");function RRs(){return"success"}a(RRs,"TAOCheck");function kRs(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(kRs,"appendFetchMetadata");function PRs(t){let e=t.origin;if(!(e==="client"||e===void 0)){if(t.responseTainting==="cors"||t.mode==="websocket")t.headersList.append("origin",e,!0);else if(t.method!=="GET"&&t.method!=="HEAD"){switch(t.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":t.origin&&Eor(t.origin)&&!Eor(OZ(t))&&(e=null);break;case"same-origin":QPe(t,OZ(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(PRs,"appendRequestOriginHeader");function Epe(t,e){return t}a(Epe,"coarsenTime");function DRs(t,e,r){return!t?.startTime||t.startTime4096&&(n=o),e){case"no-referrer":return"no-referrer";case"origin":return o??yor(r,!0);case"unsafe-url":return n;case"strict-origin":{let s=OZ(t);return MZ(n)&&!MZ(s)?"no-referrer":o}case"strict-origin-when-cross-origin":{let s=OZ(t);return QPe(n,s)?n:MZ(n)&&!MZ(s)?"no-referrer":o}case"same-origin":return QPe(t,n)?n:"no-referrer";case"origin-when-cross-origin":return QPe(t,n)?n:o;case"no-referrer-when-downgrade":{let s=OZ(t);return MZ(n)&&!MZ(s)?"no-referrer":n}}}a(LRs,"determineRequestsReferrer");function yor(t,e=!1){return qPe(Xj.is.URL(t)),t=new URL(t),t7n(t)?"no-referrer":(t.username="",t.password="",t.hash="",e===!0&&(t.pathname="",t.search=""),t)}a(yor,"stripURLForReferrer");var BRs=RegExp.prototype.test.bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/),FRs=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function ZUn(t){return t.includes(":")?(t[0]==="["&&t[t.length-1]==="]"&&(t=t.slice(1,-1)),FRs(t)):BRs(t)}a(ZUn,"isOriginIPPotentiallyTrustworthy");function URs(t){return t==null||t==="null"?!1:(t=new URL(t),!!(t.protocol==="https:"||t.protocol==="wss:"||ZUn(t.hostname)||t.hostname==="localhost"||t.hostname==="localhost."||t.hostname.endsWith(".localhost")||t.hostname.endsWith(".localhost.")||t.protocol==="file:"))}a(URs,"isOriginPotentiallyTrustworthy");function MZ(t){return Xj.is.URL(t)?t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="blob:"?!0:URs(t.origin):!1}a(MZ,"isURLPotentiallyTrustworthy");function QRs(t){}a(QRs,"tryUpgradeRequestToAPotentiallyTrustworthyURL");function QPe(t,e){return t.origin===e.origin&&t.origin==="null"||t.protocol===e.protocol&&t.hostname===e.hostname&&t.port===e.port}a(QPe,"sameOrigin");function qRs(t){return t.controller.state==="aborted"}a(qRs,"isAborted");function jRs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(jRs,"isCancelled");function HRs(t){return gRs[t.toLowerCase()]??t}a(HRs,"normalizeMethod");var GRs=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function XUn(t,e,r=0,n=1){class o{static{a(this,"FastIterableIterator")}#e;#t;#r;constructor(c,l){this.#e=c,this.#t=l,this.#r=0}next(){if(typeof this!="object"||this===null||!(#e in this))throw new TypeError(`'next' called on an object that does not implement interface ${t} Iterator.`);let c=this.#r,l=e(this.#e),u=l.length;if(c>=u)return{value:void 0,done:!0};let{[r]:d,[n]:f}=l[c];this.#r=c+1;let h;switch(this.#t){case"key":h=d;break;case"value":h=f;break;case"key+value":h=[d,f];break}return{value:h,done:!1}}}return delete o.prototype.constructor,Object.setPrototypeOf(o.prototype,GRs),Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${t} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(s,c){return new o(s,c)}}a(XUn,"createIterator");function $Rs(t,e,r,n=0,o=1){let s=XUn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Xj.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Xj.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Xj.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(Xj.brandCheck(this,e),Xj.argumentLengthCheck(arguments,1,`${t}.forEach`),typeof u!="function")throw new TypeError(`Failed to execute 'forEach' on '${t}': parameter 1 is not of type 'Function'.`);for(let{0:f,1:h}of s(this,"key+value"))u.call(d,h,f,this)},"forEach")}};return Object.defineProperties(e.prototype,{...c,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:c.entries.value}})}a($Rs,"iteratorMixin");function VRs(t,e,r){let n=e,o=r;try{let s=t.stream.getReader();e7n(s,n,o)}catch(s){o(s)}}a(VRs,"fullyReadBody");function WRs(t){try{t.close(),t.byobRequest?.respond(0)}catch(e){if(!e.message.includes("Controller is already closed")&&!e.message.includes("ReadableStream is already closed"))throw e}}a(WRs,"readableStreamClose");async function e7n(t,e,r){try{let n=[],o=0;do{let{done:s,value:c}=await t.read();if(s){e(Buffer.concat(n,o));return}if(!ARs(c)){r(new TypeError("Received non-Uint8Array chunk"));return}n.push(c),o+=c.length}while(!0)}catch(n){r(n)}}a(e7n,"readAllBytes");function t7n(t){qPe("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(t7n,"urlIsLocal");function Eor(t){return typeof t=="string"&&t[5]===":"&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&t[4]==="s"||t.protocol==="https:"}a(Eor,"urlHasHttpsScheme");function r7n(t){qPe("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(r7n,"urlIsHttpHttpsScheme");function zRs(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&NZ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&NZ(u=>u===" "||u===" ",r,n);let o=NZ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&NZ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&NZ(u=>u===" "||u===" ",r,n);let c=NZ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),l=c.length?Number(c):null;return n.positionl?"failure":{rangeStartValue:s,rangeEndValue:l}}a(zRs,"simpleRangeHeaderValue");function YRs(t,e,r){let n="bytes ";return n+=Aor(`${t}`),n+="-",n+=Aor(`${e}`),n+="/",n+=Aor(`${r}`),n}a(YRs,"buildContentRange");var _or=class extends cRs{static{a(this,"InflateStream")}#e;constructor(e){super(),this.#e=e}_transform(e,r,n){if(!this._inflateStream){if(e.length===0){n();return}this._inflateStream=(e[0]&15)===8?$Un.createInflate(this.#e):$Un.createInflateRaw(this.#e),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",o=>this.destroy(o))}this._inflateStream.write(e,r,n)}_final(e){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),e()}};function KRs(t){return new _or(t)}a(KRs,"createInflate");function JRs(t){let e=null,r=null,n=null,o=n7n("content-type",t);if(o===null)return"failure";for(let s of o){let c=pRs(s);c==="failure"||c.essence==="*/*"||(n=c,n.essence!==r?(e=null,n.parameters.has("charset")&&(e=n.parameters.get("charset")),r=n.essence):!n.parameters.has("charset")&&e!==null&&n.parameters.set("charset",e))}return n??"failure"}a(JRs,"extractMimeType");function ZRs(t){let e=t,r={position:0},n=[],o="";for(;r.positions!=='"'&&s!==",",e,r),r.positions===9||s===32),n.push(o),o=""}return n}a(ZRs,"gettingDecodingSplitting");function n7n(t,e){let r=e.get(t,!0);return r===null?null:ZRs(r)}a(n7n,"getDecodeSplit");function XRs(t){return!1}a(XRs,"hasAuthenticationEntry");function eks(t){return!!(t.username||t.password)}a(eks,"includesCredentials");function tks(t){return t!=null&&t!=="client"&&t!=="no-traversable"}a(tks,"isTraversableNavigable");var vor=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return VUn()}get origin(){return this.baseUrl?.origin}policyContainer=JUn()},Cor=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new vor},rks=new Cor;i7n.exports={isAborted:qRs,isCancelled:jRs,isValidEncodedURL:YUn,ReadableStreamFrom:mRs,tryUpgradeRequestToAPotentiallyTrustworthyURL:QRs,clampAndCoarsenConnectionTimingInfo:DRs,coarsenedSharedCurrentTime:NRs,determineRequestsReferrer:LRs,makePolicyContainer:JUn,clonePolicyContainer:ORs,appendFetchMetadata:kRs,appendRequestOriginHeader:PRs,TAOCheck:RRs,corsCheck:wRs,crossOriginResourcePolicyCheck:xRs,createOpaqueTimingInfo:MRs,setRequestReferrerPolicyOnRedirect:IRs,isValidHTTPToken:WUn,requestBadPort:vRs,requestCurrentURL:OZ,responseURL:zUn,responseLocationURL:ERs,isURLPotentiallyTrustworthy:MZ,isValidReasonPhrase:bRs,sameOrigin:QPe,normalizeMethod:HRs,iteratorMixin:$Rs,createIterator:XUn,isValidHeaderName:SRs,isValidHeaderValue:KUn,isErrorLike:CRs,fullyReadBody:VRs,readableStreamClose:WRs,urlIsLocal:t7n,urlHasHttpsScheme:Eor,urlIsHttpHttpsScheme:r7n,readAllBytes:e7n,simpleRangeHeaderValue:zRs,buildContentRange:YRs,createInflate:KRs,extractMimeType:JRs,getDecodeSplit:n7n,environmentSettingsObject:rks,isOriginIPPotentiallyTrustworthy:ZUn,hasAuthenticationEntry:XRs,includesCredentials:eks,isTraversableNavigable:tks}});var sst=I((uuf,s7n)=>{"use strict";p();var{iteratorMixin:nks}=IT(),{kEnumerableProperty:_pe}=Po(),{webidl:Dc}=zA(),o7n=require("node:util"),t8=class t{static{a(this,"FormData")}#e=[];constructor(e=void 0){if(Dc.util.markAsUncloneable(this),e!==void 0)throw Dc.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(e,r,n=void 0){Dc.brandCheck(this,t);let o="FormData.append";Dc.argumentLengthCheck(arguments,2,o),e=Dc.converters.USVString(e),arguments.length===3||Dc.is.Blob(r)?(r=Dc.converters.Blob(r,o,"value"),n!==void 0&&(n=Dc.converters.USVString(n))):r=Dc.converters.USVString(r);let s=bor(e,r,n);this.#e.push(s)}delete(e){Dc.brandCheck(this,t),Dc.argumentLengthCheck(arguments,1,"FormData.delete"),e=Dc.converters.USVString(e),this.#e=this.#e.filter(n=>n.name!==e)}get(e){Dc.brandCheck(this,t),Dc.argumentLengthCheck(arguments,1,"FormData.get"),e=Dc.converters.USVString(e);let n=this.#e.findIndex(o=>o.name===e);return n===-1?null:this.#e[n].value}getAll(e){return Dc.brandCheck(this,t),Dc.argumentLengthCheck(arguments,1,"FormData.getAll"),e=Dc.converters.USVString(e),this.#e.filter(n=>n.name===e).map(n=>n.value)}has(e){return Dc.brandCheck(this,t),Dc.argumentLengthCheck(arguments,1,"FormData.has"),e=Dc.converters.USVString(e),this.#e.findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Dc.brandCheck(this,t);let o="FormData.set";Dc.argumentLengthCheck(arguments,2,o),e=Dc.converters.USVString(e),arguments.length===3||Dc.is.Blob(r)?(r=Dc.converters.Blob(r,o,"value"),n!==void 0&&(n=Dc.converters.USVString(n))):r=Dc.converters.USVString(r);let s=bor(e,r,n),c=this.#e.findIndex(l=>l.name===e);c!==-1?this.#e=[...this.#e.slice(0,c),s,...this.#e.slice(c+1).filter(l=>l.name!==e)]:this.#e.push(s)}[o7n.inspect.custom](e,r){let n=this.#e.reduce((s,c)=>(s[c.name]?Array.isArray(s[c.name])?s[c.name].push(c.value):s[c.name]=[s[c.name],c.value]:s[c.name]=c.value,s),{__proto__:null});r.depth??=e,r.colors??=!0;let o=o7n.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}static getFormDataState(e){return e.#e}static setFormDataState(e,r){e.#e=r}},{getFormDataState:iks,setFormDataState:oks}=t8;Reflect.deleteProperty(t8,"getFormDataState");Reflect.deleteProperty(t8,"setFormDataState");nks("FormData",t8,iks,"name","value");Object.defineProperties(t8.prototype,{append:_pe,delete:_pe,get:_pe,getAll:_pe,has:_pe,set:_pe,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function bor(t,e,r){if(typeof e!="string"){if(Dc.is.File(e)||(e=new File([e],"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=new File([e],r,n)}}return{name:t,value:e}}a(bor,"makeEntry");Dc.is.FormData=Dc.util.MakeTypeAssertion(t8);s7n.exports={FormData:t8,makeEntry:bor,setFormDataState:oks}});var l7n=I((puf,c7n)=>{"use strict";p();var{bufferToLowerCasedHeaderName:sks}=Po(),{HTTP_TOKEN_CODEPOINTS:aks}=jw(),{makeEntry:cks}=sst(),{webidl:Sor}=zA(),Tor=require("node:assert"),{isomorphicDecode:a7n}=XF(),lks=Buffer.from("--"),Ior=new TextDecoder,uks=new TextDecoder("utf-8",{ignoreBOM:!0});function dks(t){for(let e=0;e70)return!1;for(let r=0;r=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||n===39||n===45||n===95))return!1}return!0}a(fks,"validateBoundary");function pks(t,e){Tor(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)throw gb("missing boundary in content-type header");let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0},c=t.indexOf(n);if(c===-1)throw gb("no boundary found in multipart body");for(s.position=c;;){if(t.subarray(s.position,s.position+n.length).equals(n))s.position+=n.length;else throw gb("expected a value starting with -- and the boundary");if(gks(t,lks,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)throw gb("expected CRLF");s.position+=2;let l=mks(t,s),{name:u,filename:d,contentType:f,encoding:h}=l;s.position+=2;let m;{let A=t.indexOf(n.subarray(2),s.position);if(A===-1)throw gb("expected boundary after body");m=t.subarray(s.position,A-4),s.position+=m.length,h==="base64"&&(m=Buffer.from(m.toString(),"base64"))}if(t[s.position]!==13||t[s.position+1]!==10)throw gb("expected CRLF");s.position+=2;let g;d!==null?(f??="text/plain",dks(f)||(f=""),g=new File([m],d,{type:f})):g=uks.decode(Buffer.from(m)),Tor(Sor.is.USVString(u)),Tor(typeof g=="string"&&Sor.is.USVString(g)||Sor.is.File(g)),o.push(cks(u,g,d))}}a(pks,"multipartFormDataParser");function hks(t,e){t[e.position]===59&&e.position++,Hw(c=>c===32||c===9,t,e);let r=Hw(c=>wor(c)&&c!==61&&c!==42,t,e);if(r.length===0)return null;let n=r.toString("ascii").toLowerCase(),o=t[e.position]===42;if(o&&e.position++,t[e.position]!==61)return null;e.position++,Hw(c=>c===32||c===9,t,e);let s;if(o){let c=Hw(l=>l!==32&&l!==13&&l!==10&&l!==59,t,e);if(c[0]!==117&&c[0]!==85||c[1]!==116&&c[1]!==84||c[2]!==102&&c[2]!==70||c[3]!==45||c[4]!==56)throw gb("unknown encoding, expected utf-8''");s=decodeURIComponent(Ior.decode(c.subarray(7)))}else if(t[e.position]===34){e.position++;let c=Hw(l=>l!==10&&l!==13&&l!==34,t,e);if(t[e.position]!==34)throw gb("Closing quote not found");e.position++,s=Ior.decode(c).replace(/%0A/ig,` +`).replace(/%0D/ig,"\r").replace(/%22/g,'"')}else{let c=Hw(l=>wor(l)&&l!==59,t,e);s=Ior.decode(c)}return{name:n,value:s,extended:o}}a(hks,"parseContentDispositionAttribute");function mks(t,e){let r=null,n=null,o=null,s=null;for(;;){if(t[e.position]===13&&t[e.position+1]===10){if(r===null)throw gb("header name is null");return{name:r,filename:n,contentType:o,encoding:s}}let c=Hw(l=>l!==10&&l!==13&&l!==58,t,e);if(c=xor(c,!0,!0,l=>l===9||l===32),!aks.test(c.toString()))throw gb("header name does not match the field-name token production");if(t[e.position]!==58)throw gb("expected :");switch(e.position++,Hw(l=>l===32||l===9,t,e),sks(c)){case"content-disposition":{r=n=null;let l=!1;if(Hw(d=>wor(d),t,e).toString("ascii").toLowerCase()!=="form-data")throw gb("expected form-data for content-disposition header");for(;e.positionu!==10&&u!==13,t,e);l=xor(l,!1,!0,u=>u===9||u===32),o=a7n(l);break}case"content-transfer-encoding":{let l=Hw(u=>u!==10&&u!==13,t,e);l=xor(l,!1,!0,u=>u===9||u===32),s=a7n(l);break}default:Hw(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13||t[e.position+1]!==10)throw gb("expected CRLF");e.position+=2}}a(mks,"parseMultipartFormDataHeaders");function Hw(t,e,r){let n=r.position;for(;n0&&n(t[s]);)s--;return o===0&&s===t.length-1?t:t.subarray(o,s+1)}a(xor,"removeChars");function gks(t,e,r){if(t.length{"use strict";p();function Eks(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(Eks,"createDeferredPromise");u7n.exports={createDeferredPromise:Eks}});var Cpe=I((Euf,m7n)=>{"use strict";p();var Por=Po(),{ReadableStreamFrom:_ks,readableStreamClose:vks,fullyReadBody:Cks,extractMimeType:bks}=IT(),{FormData:d7n,setFormDataState:Sks}=sst(),{webidl:P2}=zA(),Ror=require("node:assert"),{isErrored:kor,isDisturbed:Tks}=require("node:stream"),{isUint8Array:Iks}=require("node:util/types"),{serializeAMimeType:xks}=jw(),{multipartFormDataParser:wks}=l7n(),{createDeferredPromise:Rks}=jPe(),{parseJSONFromBytes:kks}=XF(),{utf8DecodeBytes:Pks}=est(),{runtimeFeatures:Dks}=e8(),Nks=Dks.has("crypto")?require("node:crypto").randomInt:t=>Math.floor(Math.random()*t),ast=new TextEncoder;function Mks(){}a(Mks,"noop");var Oks=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!Tks(e)&&!kor(e)&&e.cancel("Response object has been garbage collected").catch(Mks)});function p7n(t,e=!1){let r=null,n=null;P2.is.ReadableStream(t)?r=t:P2.is.Blob(t)?r=t.stream():r=new ReadableStream({pull(){},start(d){n=d},cancel(){},type:"bytes"}),Ror(P2.is.ReadableStream(r));let o=null,s=null,c=null,l=null;if(typeof t=="string")s=t,l="text/plain;charset=UTF-8";else if(P2.is.URLSearchParams(t))s=t.toString(),l="application/x-www-form-urlencoded;charset=UTF-8";else if(P2.is.BufferSource(t))s=P2.util.getCopyOfBytesHeldByBufferSource(t);else if(P2.is.FormData(t)){let d=`----formdata-undici-0${`${Nks(1e11)}`.padStart(11,"0")}`,f=`--${d}\r Content-Disposition: form-data`;let h=a(_=>_.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"formdataEscape"),m=a(_=>_.replace(/\r?\n|\r/g,`\r -`),"normalizeLinefeeds"),g=[],A=new Uint8Array([13,10]);c=0;let y=!1;for(let[_,v]of t)if(typeof v=="string"){let b=Not.encode(f+`; name="${h(m(_))}"\r +`),"normalizeLinefeeds"),g=[],A=new Uint8Array([13,10]);c=0;let y=!1;for(let[_,v]of t)if(typeof v=="string"){let b=ast.encode(f+`; name="${h(m(_))}"\r \r ${m(v)}\r -`);g.push(b),c+=b.byteLength}else{let b=Not.encode(`${f}; name="${h(m(_))}"`+(v.name?`; filename="${h(v.name)}"`:"")+`\r +`);g.push(b),c+=b.byteLength}else{let b=ast.encode(`${f}; name="${h(m(_))}"`+(v.name?`; filename="${h(v.name)}"`:"")+`\r Content-Type: ${v.type||"application/octet-stream"}\r \r -`);g.push(b,v,A),typeof v.size=="number"?c+=b.byteLength+v.size+A.byteLength:y=!0}let E=Not.encode(`--${d}--\r -`);g.push(E),c+=E.byteLength,y&&(c=null),s=t,o=a(async function*(){for(let _ of g)_.stream?yield*_.stream():yield _},"action"),l=`multipart/form-data; boundary=${d}`}else if(b2.is.Blob(t))s=t,c=t.size,t.type&&(l=t.type);else if(typeof t[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(Fir.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=b2.is.ReadableStream(t)?t:fws(t)}return(typeof s=="string"||yws(s))&&(o=a(()=>(c=typeof s=="string"?Buffer.byteLength(s):s.length,s),"action")),o!=null&&(async()=>{let d=o(),f=d?.[Symbol.asyncIterator]?.();if(f)for await(let h of f){if(Bir(r))break;h.length&&n.enqueue(new Uint8Array(h))}else d?.length&&!Bir(r)&&n.enqueue(typeof d=="string"?Not.encode(d):new Uint8Array(d));queueMicrotask(()=>pws(n))})(),[{stream:r,source:s,length:c},l]}a(P9n,"extractBody");function wws(t,e=!1){return b2.is.ReadableStream(t)&&(Lir(!Fir.isDisturbed(t),"The body has already been consumed."),Lir(!t.locked,"The stream is locked.")),P9n(t,e)}a(wws,"safelyExtractBody");function Rws(t){let{0:e,1:r}=t.stream.tee();return t.stream=e,{stream:r,length:t.length,source:t.source}}a(Rws,"cloneBody");function kws(t,e){return{blob(){return spe(this,n=>{let o=k9n(e(this));return o===null?o="":o&&(o=Ews(o)),new Blob([n],{type:o})},t,e)},arrayBuffer(){return spe(this,n=>new Uint8Array(n).buffer,t,e)},text(){return spe(this,bws,t,e)},json(){return spe(this,Cws,t,e)},formData(){return spe(this,n=>{let o=k9n(e(this));if(o!==null)switch(o.essence){case"multipart/form-data":{let s=_ws(n,o),c=new R9n;return gws(c,s),c}case"application/x-www-form-urlencoded":{let s=new URLSearchParams(n.toString()),c=new R9n;for(let[l,u]of s)c.append(l,u);return c}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t,e)},bytes(){return spe(this,n=>new Uint8Array(n),t,e)}}}a(kws,"bodyMixinMethods");function Pws(t,e){Object.assign(t.prototype,kws(t,e))}a(Pws,"mixinBody");function spe(t,e,r,n){try{b2.brandCheck(t,r)}catch(l){return Promise.reject(l)}if(t=n(t),D9n(t))return Promise.reject(new TypeError("Body is unusable: Body has already been read"));let o=vws(),s=o.reject,c=a(l=>{try{o.resolve(e(l))}catch(u){s(u)}},"successSteps");return t.body==null?(c(Buffer.allocUnsafe(0)),o.promise):(hws(t.body,c,s),o.promise)}a(spe,"consumeBody");function D9n(t){let e=t.body;return e!=null&&(e.stream.locked||Fir.isDisturbed(e.stream))}a(D9n,"bodyUnusable");function k9n(t){let e=t.headersList,r=mws(e);return r==="failure"?null:r}a(k9n,"bodyMimeType");N9n.exports={extractBody:P9n,safelyExtractBody:wws,cloneBody:Rws,mixinBody:Pws,streamRegistry:xws,bodyUnusable:D9n}});var z9n=I((laf,W9n)=>{"use strict";p();var Oi=require("node:assert"),Ti=Po(),{channels:M9n}=Bj(),Uir=ynr(),{RequestContentLengthMismatchError:IZ,ResponseContentLengthMismatchError:O9n,RequestAbortedError:H9n,HeadersTimeoutError:Dws,HeadersOverflowError:Nws,SocketError:xZ,InformationalError:cpe,BodyTimeoutError:Mws,HTTPParserError:Ows,ResponseExceededMaxSizeError:Lws}=ao(),{kUrl:G9n,kReset:hb,kClient:Fot,kParser:ud,kBlocking:TPe,kRunning:lm,kPending:Vir,kSize:L9n,kWriting:Qj,kQueue:S2,kNoRef:bPe,kKeepAliveDefaultTimeout:Bws,kHostHeader:Fws,kPendingIdx:Uws,kRunningIdx:Lw,kError:lv,kPipelining:Lot,kSocket:RZ,kKeepAliveTimeoutValue:Uot,kMaxHeadersSize:Qws,kKeepAliveMaxTimeout:qws,kKeepAliveTimeoutThreshold:jws,kHeadersTimeout:Hws,kBodyTimeout:Gws,kStrictContentLength:jir,kMaxRequests:B9n,kCounter:$ws,kMaxResponseSize:Vws,kOnError:F9n,kResume:WF,kHTTPContext:$9n,kClosed:Hir}=al(),_T=N6n(),U9n=Buffer.alloc(0),Mot=Buffer[Symbol.species],Wws=Ti.removeAllListeners,kZ=Symbol("kIdleSocketValidation"),wZ=Symbol("kIdleSocketValidationTimeout"),Wir=Symbol("kSocketUsed"),Qir;function zws(){let t=process.env.JEST_WORKER_ID?fir():void 0,e,r=process.arch!=="ppc64";if(process.env.UNDICI_NO_WASM_SIMD==="1"?r=!1:process.env.UNDICI_NO_WASM_SIMD==="0"&&(r=!0),r)try{e=new WebAssembly.Module(L6n())}catch{}return e||(e=new WebAssembly.Module(t||fir())),new WebAssembly.Instance(e,{env:{wasm_on_url:a((n,o,s)=>0,"wasm_on_url"),wasm_on_status:a((n,o,s)=>{Oi(mp.ptr===n);let c=o-P5+k5.byteOffset;return mp.onStatus(new Mot(k5.buffer,c,s))},"wasm_on_status"),wasm_on_message_begin:a(n=>(Oi(mp.ptr===n),mp.onMessageBegin()),"wasm_on_message_begin"),wasm_on_header_field:a((n,o,s)=>{Oi(mp.ptr===n);let c=o-P5+k5.byteOffset;return mp.onHeaderField(new Mot(k5.buffer,c,s))},"wasm_on_header_field"),wasm_on_header_value:a((n,o,s)=>{Oi(mp.ptr===n);let c=o-P5+k5.byteOffset;return mp.onHeaderValue(new Mot(k5.buffer,c,s))},"wasm_on_header_value"),wasm_on_headers_complete:a((n,o,s,c)=>(Oi(mp.ptr===n),mp.onHeadersComplete(o,s===1,c===1)),"wasm_on_headers_complete"),wasm_on_body:a((n,o,s)=>{Oi(mp.ptr===n);let c=o-P5+k5.byteOffset;return mp.onBody(new Mot(k5.buffer,c,s))},"wasm_on_body"),wasm_on_message_complete:a(n=>(Oi(mp.ptr===n),mp.onMessageComplete()),"wasm_on_message_complete")}})}a(zws,"lazyllhttp");var qir=null,mp=null,k5=null,Oot=0,P5=null,Yws=0,SPe=1,lpe=2|SPe,Bot=4|SPe,Gir=8|Yws,$ir=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(_T.TYPE.RESPONSE),this.client=e,this.socket=r,this.timeout=null,this.timeoutWeakRef=new WeakRef(this),this.timeoutValue=null,this.timeoutType=null,this.statusCode=0,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[Qws],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[Vws]}setTimeout(e,r){e!==this.timeoutValue||r&SPe^this.timeoutType&SPe?(this.timeout&&(Uir.clearTimeout(this.timeout),this.timeout=null),e&&(r&SPe?this.timeout=Uir.setFastTimeout(Q9n,e,this.timeoutWeakRef):(this.timeout=setTimeout(Q9n,e,this.timeoutWeakRef),this.timeout?.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=r}resume(){this.socket.destroyed||!this.paused||(Oi(this.ptr!=null),Oi(mp===null),this.llhttp.llhttp_resume(this.ptr),Oi(this.timeoutType===Bot),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||U9n),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Oi(mp===null),Oi(this.ptr!=null),Oi(!this.paused);let{socket:r,llhttp:n}=this;e.length>Oot&&(P5&&n.free(P5),Oot=Math.ceil(e.length/4096)*4096,P5=n.malloc(Oot)),new Uint8Array(n.memory.buffer,P5,Oot).set(e);try{let o;try{k5=e,mp=this,o=n.llhttp_execute(this.ptr,P5,e.length)}finally{mp=null,k5=null}if(o!==_T.ERROR.OK){let s=e.subarray(n.llhttp_get_error_pos(this.ptr)-P5);if(o===_T.ERROR.PAUSED_UPGRADE)this.onUpgrade(s);else if(o===_T.ERROR.PAUSED)this.paused=!0,r.unshift(s);else throw this.createError(o,s)}}catch(o){Ti.destroy(r,o)}}finish(){Oi(mp===null),Oi(this.ptr!=null),Oi(!this.paused);let{llhttp:e}=this,r;try{mp=this,r=e.llhttp_finish(this.ptr)}finally{mp=null}return r===_T.ERROR.OK?null:r===_T.ERROR.PAUSED||r===_T.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(r,U9n)}createError(e,r){let{llhttp:n,contentLength:o,bytesRead:s}=this;if(o&&s!==parseInt(o,10))return new O9n;let c=n.llhttp_get_error_reason(this.ptr),l="";if(c){let u=new Uint8Array(n.memory.buffer,c).indexOf(0);l="Response does not match the HTTP/1.1 protocol ("+Buffer.from(n.memory.buffer,c,u).toString()+")"}return new Ows(l,_T.ERROR[e],r)}destroy(){Oi(mp===null),Oi(this.ptr!=null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&Uir.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){return this.statusText=e.toString(),0}onMessageBegin(){let{socket:e,client:r}=this;if(e.destroyed)return-1;if(r[lm]===0)return Ti.destroy(e,new xZ("bad response",Ti.getSocketInfo(e))),-1;let n=r[S2][r[Lw]];return n?(n.onResponseStarted(),0):-1}onHeaderField(e){let r=this.headers.length;return(r&1)===0?this.headers.push(e):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]),this.trackHeader(e.length),0}onHeaderValue(e){let r=this.headers.length;(r&1)===1?(this.headers.push(e),r+=1):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]);let n=this.headers[r-2];if(n.length===10){let o=Ti.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&Ti.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());return this.trackHeader(e.length),0}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&Ti.destroy(this.socket,new Nws)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Oi(r),Oi(n[RZ]===o),Oi(!o.destroyed),Oi(!this.paused),Oi((s.length&1)===0);let l=n[S2][n[Lw]];Oi(l),Oi(l.upgrade||l.method==="CONNECT"),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,o.unshift(e),o[ud].destroy(),o[ud]=null,o[Fot]=null,o[lv]=null,Wws(o),n[RZ]=null,n[$9n]=null,n[S2][n[Lw]++]=null,n.emit("disconnect",n[G9n],[n],new cpe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ti.destroy(o,u)}n[WF]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;if(o[lm]===0)return Ti.destroy(s,new xZ("bad response",Ti.getSocketInfo(s))),-1;let u=o[S2][o[Lw]];if(!u)return-1;if(Oi(!this.upgrade),Oi(this.statusCode<200),e===100)return Ti.destroy(s,new xZ("bad response",Ti.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ti.destroy(s,new xZ("bad upgrade",Ti.getSocketInfo(s))),-1;if(Oi(this.timeoutType===lpe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[hb]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[Gws];this.setTimeout(f,Bot)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Oi(o[lm]===1),this.upgrade=!0,2;if(r)return Oi(o[lm]===1),this.upgrade=!0,2;if(Oi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[Lot]){let f=this.keepAlive?Ti.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[jws],o[qws]);h<=0?s[hb]=!0:o[Uot]=h}else o[Uot]=o[Bws]}else s[hb]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[TPe]&&(s[TPe]=!1,o[WF]()),d?_T.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[S2][r[Lw]];return Oi(c),Oi(this.timeoutType===Bot),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Oi(o>=200),s>-1&&this.bytesRead+e.length>s?(Ti.destroy(n,new Lws),-1):(this.bytesRead+=e.length,c.onData(e)===!1?_T.ERROR.PAUSED:0)}onMessageComplete(){let{client:e,socket:r,statusCode:n,upgrade:o,headers:s,contentLength:c,bytesRead:l,shouldKeepAlive:u}=this;if(r.destroyed&&(!n||u))return-1;if(o)return 0;Oi(n>=100),Oi((this.headers.length&1)===0);let d=e[S2][e[Lw]];if(Oi(d),this.statusCode=0,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,n<200)return 0;if(d.method!=="HEAD"&&c&&l!==parseInt(c,10))return Ti.destroy(r,new O9n),-1;if(d.onComplete(s),e[S2][e[Lw]++]=null,r[Wir]=e[Vir]===0,r[Qj])return Oi(e[lm]===0),Ti.destroy(r,new cpe("reset")),_T.ERROR.PAUSED;if(u){if(r[hb]&&e[lm]===0)return Ti.destroy(r,new cpe("reset")),_T.ERROR.PAUSED;e[Lot]==null||e[Lot]===1?setImmediate(e[WF]):e[WF]()}else return Ti.destroy(r,new cpe("reset")),_T.ERROR.PAUSED;return 0}};function Q9n(t){let e=t.deref();if(!e)return;let{socket:r,timeoutType:n,client:o,paused:s}=e;n===lpe?(!r[Qj]||r.writableNeedDrain||o[lm]>1)&&(Oi(!s,"cannot be paused while waiting for headers"),Ti.destroy(r,new Dws)):n===Bot?s||Ti.destroy(r,new Mws):n===Gir&&(Oi(o[lm]===0&&o[Uot]),Ti.destroy(r,new cpe("socket idle timeout")))}a(Q9n,"onParserTimeout");function Kws(t,e){if(t[RZ]=e,qir||(qir=zws()),e.errored)throw e.errored;if(e.destroyed)throw new xZ("destroyed");return e[bPe]=!1,e[Qj]=!1,e[hb]=!1,e[TPe]=!1,e[kZ]=0,e[wZ]=null,e[Wir]=!1,e[ud]=new $ir(t,e,qir),Ti.addListener(e,"error",Jws),Ti.addListener(e,"readable",Zws),Ti.addListener(e,"end",Xws),Ti.addListener(e,"close",eRs),e[Hir]=!1,e.on("close",tRs),{version:"h1",defaultPipelining:1,write(r){return oRs(t,r)},resume(){nRs(t)},destroy(r,n){e[Hir]?queueMicrotask(n):(e.on("close",n),e.destroy(r))},get destroyed(){return e.destroyed},busy(r){return!!(e[Qj]||e[hb]||e[TPe]||e[kZ]===1||r&&(t[lm]>0&&!r.idempotent||t[lm]>0&&(r.upgrade||r.method==="CONNECT")||t[lm]>0&&Ti.bodyLength(r.body)!==0&&(Ti.isStream(r.body)||Ti.isAsyncIterable(r.body)||Ti.isFormDataLike(r.body))))}}}a(Kws,"connectH1");function Jws(t){Oi(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let e=this[ud];if(t.code==="ECONNRESET"&&e.statusCode&&!e.shouldKeepAlive){let r=e.finish();r&&(this[lv]=r,this[Fot][F9n](r));return}this[lv]=t,this[Fot][F9n](t)}a(Jws,"onHttpSocketError");function Zws(){this[ud]?.readMore()}a(Zws,"onHttpSocketReadable");function Xws(){let t=this[ud];if(t.statusCode&&!t.shouldKeepAlive){let e=t.finish();e&&Ti.destroy(this,e);return}Ti.destroy(this,new xZ("other side closed",Ti.getSocketInfo(this)))}a(Xws,"onHttpSocketEnd");function eRs(){let t=this[ud];V9n(this),t&&(!this[lv]&&t.statusCode&&!t.shouldKeepAlive&&(this[lv]=t.finish()||this[lv]),this[ud].destroy(),this[ud]=null);let e=this[lv]||new xZ("closed",Ti.getSocketInfo(this)),r=this[Fot];if(r[RZ]=null,r[$9n]=null,r.destroyed){Oi(r[Vir]===0);let n=r[S2].splice(r[Lw]);for(let o=0;o0&&e.code!=="UND_ERR_INFO"){let n=r[S2][r[Lw]];r[S2][r[Lw]++]=null,Ti.errorRequest(r,n,e)}r[Uws]=r[Lw],Oi(r[lm]===0),r.emit("disconnect",r[G9n],[r],e),r[WF]()}a(eRs,"onHttpSocketClose");function tRs(){this[Hir]=!0}a(tRs,"onSocketClose");function V9n(t){t[wZ]&&(clearTimeout(t[wZ]),t[wZ]=null),t[kZ]=0}a(V9n,"clearIdleSocketValidation");function rRs(t,e){e[kZ]=1,e[wZ]=setTimeout(()=>{e[wZ]=null,e[kZ]=2,t[RZ]===e&&!e.destroyed&&t[WF]()},0),e[wZ].unref?.()}a(rRs,"scheduleIdleSocketValidation");function nRs(t){let e=t[RZ];if(e&&!e.destroyed){if(t[L9n]===0?!e[bPe]&&e.unref&&(e.unref(),e[bPe]=!0):e[bPe]&&e.ref&&(e.ref(),e[bPe]=!1),t[lm]===0&&t[Vir]>0&&e[Wir]){if(e[kZ]===0)return rRs(t,e),e[ud].readMore(),e.destroyed,void 0;if(e[kZ]===1)return e[ud].readMore(),e.destroyed,void 0}if(t[lm]===0&&(e[ud].readMore(),e.destroyed))return;if(t[L9n]===0)e[ud].timeoutType!==Gir&&e[ud].setTimeout(t[Uot],Gir);else if(t[lm]>0&&e[ud].statusCode<200&&e[ud].timeoutType!==lpe){let r=t[S2][t[Lw]],n=r.headersTimeout!=null?r.headersTimeout:t[Hws];e[ud].setTimeout(n,lpe)}}}a(nRs,"resumeH1");function iRs(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(iRs,"shouldSendContentLength");function oRs(t,e){let{method:r,path:n,host:o,upgrade:s,blocking:c,reset:l}=e,{body:u,headers:d,contentLength:f}=e,h=r==="PUT"||r==="POST"||r==="PATCH"||r==="QUERY"||r==="PROPFIND"||r==="PROPPATCH";if(Ti.isFormDataLike(u)){Qir||(Qir=ape().extractBody);let[E,_]=Qir(u);e.contentType==null&&d.push("content-type",_),u=E.stream,f=E.length}else Ti.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=Ti.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),iRs(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[jir])return Ti.errorRequest(t,e,new IZ),!1;process.emitWarning(new IZ)}let g=t[RZ];V9n(g);let A=a(E=>{e.aborted||e.completed||(Ti.errorRequest(t,e,E||new H9n),Ti.destroy(u),Ti.destroy(g,new cpe("aborted")))},"abort");try{e.onConnect(A)}catch(E){Ti.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[hb]=!0),(s||r==="CONNECT")&&(g[hb]=!0),l!=null&&(g[hb]=l),t[B9n]&&g[$ws]++>=t[B9n]&&(g[hb]=!0),c&&(g[TPe]=!0),g.setTypeOfService&&g.setTypeOfService(e.typeOfService);let y=`${r} ${n} HTTP/1.1\r +`);g.push(b,v,A),typeof v.size=="number"?c+=b.byteLength+v.size+A.byteLength:y=!0}let E=ast.encode(`--${d}--\r +`);g.push(E),c+=E.byteLength,y&&(c=null),s=t,o=a(async function*(){for(let _ of g)_.stream?yield*_.stream():yield _},"action"),l=`multipart/form-data; boundary=${d}`}else if(P2.is.Blob(t))s=t,c=t.size,t.type&&(l=t.type);else if(typeof t[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(Por.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=P2.is.ReadableStream(t)?t:_ks(t)}return(typeof s=="string"||Iks(s))&&(o=a(()=>(c=typeof s=="string"?Buffer.byteLength(s):s.length,s),"action")),o!=null&&(async()=>{let d=o(),f=d?.[Symbol.asyncIterator]?.();if(f)for await(let h of f){if(kor(r))break;h.length&&n.enqueue(new Uint8Array(h))}else d?.length&&!kor(r)&&n.enqueue(typeof d=="string"?ast.encode(d):new Uint8Array(d));queueMicrotask(()=>vks(n))})(),[{stream:r,source:s,length:c},l]}a(p7n,"extractBody");function Lks(t,e=!1){return P2.is.ReadableStream(t)&&(Ror(!Por.isDisturbed(t),"The body has already been consumed."),Ror(!t.locked,"The stream is locked.")),p7n(t,e)}a(Lks,"safelyExtractBody");function Bks(t){let{0:e,1:r}=t.stream.tee();return t.stream=e,{stream:r,length:t.length,source:t.source}}a(Bks,"cloneBody");function Fks(t,e){return{blob(){return vpe(this,n=>{let o=f7n(e(this));return o===null?o="":o&&(o=xks(o)),new Blob([n],{type:o})},t,e)},arrayBuffer(){return vpe(this,n=>new Uint8Array(n).buffer,t,e)},text(){return vpe(this,Pks,t,e)},json(){return vpe(this,kks,t,e)},formData(){return vpe(this,n=>{let o=f7n(e(this));if(o!==null)switch(o.essence){case"multipart/form-data":{let s=wks(n,o),c=new d7n;return Sks(c,s),c}case"application/x-www-form-urlencoded":{let s=new URLSearchParams(n.toString()),c=new d7n;for(let[l,u]of s)c.append(l,u);return c}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t,e)},bytes(){return vpe(this,n=>new Uint8Array(n),t,e)}}}a(Fks,"bodyMixinMethods");function Uks(t,e){Object.assign(t.prototype,Fks(t,e))}a(Uks,"mixinBody");function vpe(t,e,r,n){try{P2.brandCheck(t,r)}catch(l){return Promise.reject(l)}if(t=n(t),h7n(t))return Promise.reject(new TypeError("Body is unusable: Body has already been read"));let o=Rks(),s=o.reject,c=a(l=>{try{o.resolve(e(l))}catch(u){s(u)}},"successSteps");return t.body==null?(c(Buffer.allocUnsafe(0)),o.promise):(Cks(t.body,c,s),o.promise)}a(vpe,"consumeBody");function h7n(t){let e=t.body;return e!=null&&(e.stream.locked||Por.isDisturbed(e.stream))}a(h7n,"bodyUnusable");function f7n(t){let e=t.headersList,r=bks(e);return r==="failure"?null:r}a(f7n,"bodyMimeType");m7n.exports={extractBody:p7n,safelyExtractBody:Lks,cloneBody:Bks,mixinBody:Uks,streamRegistry:Oks,bodyUnusable:h7n}});var k7n=I((Cuf,R7n)=>{"use strict";p();var Mi=require("node:assert"),Ti=Po(),{channels:g7n}=Jj(),Dor=uir(),{RequestContentLengthMismatchError:LZ,ResponseContentLengthMismatchError:A7n,RequestAbortedError:T7n,HeadersTimeoutError:Qks,HeadersOverflowError:qks,SocketError:BZ,InformationalError:bpe,BodyTimeoutError:jks,HTTPParserError:Hks,ResponseExceededMaxSizeError:Gks}=so(),{kUrl:I7n,kReset:Ab,kClient:fst,kParser:hd,kBlocking:$Pe,kRunning:hm,kPending:Uor,kSize:y7n,kWriting:eH,kQueue:D2,kNoRef:HPe,kKeepAliveDefaultTimeout:$ks,kHostHeader:Vks,kPendingIdx:Wks,kRunningIdx:Gw,kError:pv,kPipelining:ust,kSocket:UZ,kKeepAliveTimeoutValue:pst,kMaxHeadersSize:zks,kKeepAliveMaxTimeout:Yks,kKeepAliveTimeoutThreshold:Kks,kHeadersTimeout:Jks,kBodyTimeout:Zks,kStrictContentLength:Oor,kMaxRequests:E7n,kCounter:Xks,kMaxResponseSize:ePs,kOnError:_7n,kResume:r8,kHTTPContext:x7n,kClosed:Lor}=al(),xT=mUn(),v7n=Buffer.alloc(0),cst=Buffer[Symbol.species],tPs=Ti.removeAllListeners,QZ=Symbol("kIdleSocketValidation"),FZ=Symbol("kIdleSocketValidationTimeout"),Qor=Symbol("kSocketUsed"),Nor;function rPs(){let t=process.env.JEST_WORKER_ID?ior():void 0,e,r=process.arch!=="ppc64";if(process.env.UNDICI_NO_WASM_SIMD==="1"?r=!1:process.env.UNDICI_NO_WASM_SIMD==="0"&&(r=!0),r)try{e=new WebAssembly.Module(yUn())}catch{}return e||(e=new WebAssembly.Module(t||ior())),new WebAssembly.Instance(e,{env:{wasm_on_url:a((n,o,s)=>0,"wasm_on_url"),wasm_on_status:a((n,o,s)=>{Mi(yp.ptr===n);let c=o-B5+L5.byteOffset;return yp.onStatus(new cst(L5.buffer,c,s))},"wasm_on_status"),wasm_on_message_begin:a(n=>(Mi(yp.ptr===n),yp.onMessageBegin()),"wasm_on_message_begin"),wasm_on_header_field:a((n,o,s)=>{Mi(yp.ptr===n);let c=o-B5+L5.byteOffset;return yp.onHeaderField(new cst(L5.buffer,c,s))},"wasm_on_header_field"),wasm_on_header_value:a((n,o,s)=>{Mi(yp.ptr===n);let c=o-B5+L5.byteOffset;return yp.onHeaderValue(new cst(L5.buffer,c,s))},"wasm_on_header_value"),wasm_on_headers_complete:a((n,o,s,c)=>(Mi(yp.ptr===n),yp.onHeadersComplete(o,s===1,c===1)),"wasm_on_headers_complete"),wasm_on_body:a((n,o,s)=>{Mi(yp.ptr===n);let c=o-B5+L5.byteOffset;return yp.onBody(new cst(L5.buffer,c,s))},"wasm_on_body"),wasm_on_message_complete:a(n=>(Mi(yp.ptr===n),yp.onMessageComplete()),"wasm_on_message_complete")}})}a(rPs,"lazyllhttp");var Mor=null,yp=null,L5=null,lst=0,B5=null,nPs=0,GPe=1,Spe=2|GPe,dst=4|GPe,Bor=8|nPs,For=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(xT.TYPE.RESPONSE),this.client=e,this.socket=r,this.timeout=null,this.timeoutWeakRef=new WeakRef(this),this.timeoutValue=null,this.timeoutType=null,this.statusCode=0,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[zks],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[ePs]}setTimeout(e,r){e!==this.timeoutValue||r&GPe^this.timeoutType&GPe?(this.timeout&&(Dor.clearTimeout(this.timeout),this.timeout=null),e&&(r&GPe?this.timeout=Dor.setFastTimeout(C7n,e,this.timeoutWeakRef):(this.timeout=setTimeout(C7n,e,this.timeoutWeakRef),this.timeout?.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=r}resume(){this.socket.destroyed||!this.paused||(Mi(this.ptr!=null),Mi(yp===null),this.llhttp.llhttp_resume(this.ptr),Mi(this.timeoutType===dst),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||v7n),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Mi(yp===null),Mi(this.ptr!=null),Mi(!this.paused);let{socket:r,llhttp:n}=this;e.length>lst&&(B5&&n.free(B5),lst=Math.ceil(e.length/4096)*4096,B5=n.malloc(lst)),new Uint8Array(n.memory.buffer,B5,lst).set(e);try{let o;try{L5=e,yp=this,o=n.llhttp_execute(this.ptr,B5,e.length)}finally{yp=null,L5=null}if(o!==xT.ERROR.OK){let s=e.subarray(n.llhttp_get_error_pos(this.ptr)-B5);if(o===xT.ERROR.PAUSED_UPGRADE)this.onUpgrade(s);else if(o===xT.ERROR.PAUSED)this.paused=!0,r.unshift(s);else throw this.createError(o,s)}}catch(o){Ti.destroy(r,o)}}finish(){Mi(yp===null),Mi(this.ptr!=null),Mi(!this.paused);let{llhttp:e}=this,r;try{yp=this,r=e.llhttp_finish(this.ptr)}finally{yp=null}return r===xT.ERROR.OK?null:r===xT.ERROR.PAUSED||r===xT.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(r,v7n)}createError(e,r){let{llhttp:n,contentLength:o,bytesRead:s}=this;if(o&&s!==parseInt(o,10))return new A7n;let c=n.llhttp_get_error_reason(this.ptr),l="";if(c){let u=new Uint8Array(n.memory.buffer,c).indexOf(0);l="Response does not match the HTTP/1.1 protocol ("+Buffer.from(n.memory.buffer,c,u).toString()+")"}return new Hks(l,xT.ERROR[e],r)}destroy(){Mi(yp===null),Mi(this.ptr!=null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&Dor.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){return this.statusText=e.toString(),0}onMessageBegin(){let{socket:e,client:r}=this;if(e.destroyed)return-1;if(r[hm]===0)return Ti.destroy(e,new BZ("bad response",Ti.getSocketInfo(e))),-1;let n=r[D2][r[Gw]];return n?(n.onResponseStarted(),0):-1}onHeaderField(e){let r=this.headers.length;return(r&1)===0?this.headers.push(e):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]),this.trackHeader(e.length),0}onHeaderValue(e){let r=this.headers.length;(r&1)===1?(this.headers.push(e),r+=1):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]);let n=this.headers[r-2];if(n.length===10){let o=Ti.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&Ti.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());return this.trackHeader(e.length),0}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&Ti.destroy(this.socket,new qks)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Mi(r),Mi(n[UZ]===o),Mi(!o.destroyed),Mi(!this.paused),Mi((s.length&1)===0);let l=n[D2][n[Gw]];Mi(l),Mi(l.upgrade||l.method==="CONNECT"),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,o.unshift(e),o[hd].destroy(),o[hd]=null,o[fst]=null,o[pv]=null,tPs(o),n[UZ]=null,n[x7n]=null,n[D2][n[Gw]++]=null,n.emit("disconnect",n[I7n],[n],new bpe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ti.destroy(o,u)}n[r8]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;if(o[hm]===0)return Ti.destroy(s,new BZ("bad response",Ti.getSocketInfo(s))),-1;let u=o[D2][o[Gw]];if(!u)return-1;if(Mi(!this.upgrade),Mi(this.statusCode<200),e===100)return Ti.destroy(s,new BZ("bad response",Ti.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ti.destroy(s,new BZ("bad upgrade",Ti.getSocketInfo(s))),-1;if(Mi(this.timeoutType===Spe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[Ab]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[Zks];this.setTimeout(f,dst)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Mi(o[hm]===1),this.upgrade=!0,2;if(r)return Mi(o[hm]===1),this.upgrade=!0,2;if(Mi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[ust]){let f=this.keepAlive?Ti.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[Kks],o[Yks]);h<=0?s[Ab]=!0:o[pst]=h}else o[pst]=o[$ks]}else s[Ab]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[$Pe]&&(s[$Pe]=!1,o[r8]()),d?xT.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[D2][r[Gw]];return Mi(c),Mi(this.timeoutType===dst),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Mi(o>=200),s>-1&&this.bytesRead+e.length>s?(Ti.destroy(n,new Gks),-1):(this.bytesRead+=e.length,c.onData(e)===!1?xT.ERROR.PAUSED:0)}onMessageComplete(){let{client:e,socket:r,statusCode:n,upgrade:o,headers:s,contentLength:c,bytesRead:l,shouldKeepAlive:u}=this;if(r.destroyed&&(!n||u))return-1;if(o)return 0;Mi(n>=100),Mi((this.headers.length&1)===0);let d=e[D2][e[Gw]];if(Mi(d),this.statusCode=0,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,n<200)return 0;if(d.method!=="HEAD"&&c&&l!==parseInt(c,10))return Ti.destroy(r,new A7n),-1;if(d.onComplete(s),e[D2][e[Gw]++]=null,r[Qor]=e[Uor]===0,r[eH])return Mi(e[hm]===0),Ti.destroy(r,new bpe("reset")),xT.ERROR.PAUSED;if(u){if(r[Ab]&&e[hm]===0)return Ti.destroy(r,new bpe("reset")),xT.ERROR.PAUSED;e[ust]==null||e[ust]===1?setImmediate(e[r8]):e[r8]()}else return Ti.destroy(r,new bpe("reset")),xT.ERROR.PAUSED;return 0}};function C7n(t){let e=t.deref();if(!e)return;let{socket:r,timeoutType:n,client:o,paused:s}=e;n===Spe?(!r[eH]||r.writableNeedDrain||o[hm]>1)&&(Mi(!s,"cannot be paused while waiting for headers"),Ti.destroy(r,new Qks)):n===dst?s||Ti.destroy(r,new jks):n===Bor&&(Mi(o[hm]===0&&o[pst]),Ti.destroy(r,new bpe("socket idle timeout")))}a(C7n,"onParserTimeout");function iPs(t,e){if(t[UZ]=e,Mor||(Mor=rPs()),e.errored)throw e.errored;if(e.destroyed)throw new BZ("destroyed");return e[HPe]=!1,e[eH]=!1,e[Ab]=!1,e[$Pe]=!1,e[QZ]=0,e[FZ]=null,e[Qor]=!1,e[hd]=new For(t,e,Mor),Ti.addListener(e,"error",oPs),Ti.addListener(e,"readable",sPs),Ti.addListener(e,"end",aPs),Ti.addListener(e,"close",cPs),e[Lor]=!1,e.on("close",lPs),{version:"h1",defaultPipelining:1,write(r){return pPs(t,r)},resume(){dPs(t)},destroy(r,n){e[Lor]?queueMicrotask(n):(e.on("close",n),e.destroy(r))},get destroyed(){return e.destroyed},busy(r){return!!(e[eH]||e[Ab]||e[$Pe]||e[QZ]===1||r&&(t[hm]>0&&!r.idempotent||t[hm]>0&&(r.upgrade||r.method==="CONNECT")||t[hm]>0&&Ti.bodyLength(r.body)!==0&&(Ti.isStream(r.body)||Ti.isAsyncIterable(r.body)||Ti.isFormDataLike(r.body))))}}}a(iPs,"connectH1");function oPs(t){Mi(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let e=this[hd];if(t.code==="ECONNRESET"&&e.statusCode&&!e.shouldKeepAlive){let r=e.finish();r&&(this[pv]=r,this[fst][_7n](r));return}this[pv]=t,this[fst][_7n](t)}a(oPs,"onHttpSocketError");function sPs(){this[hd]?.readMore()}a(sPs,"onHttpSocketReadable");function aPs(){let t=this[hd];if(t.statusCode&&!t.shouldKeepAlive){let e=t.finish();e&&Ti.destroy(this,e);return}Ti.destroy(this,new BZ("other side closed",Ti.getSocketInfo(this)))}a(aPs,"onHttpSocketEnd");function cPs(){let t=this[hd];w7n(this),t&&(!this[pv]&&t.statusCode&&!t.shouldKeepAlive&&(this[pv]=t.finish()||this[pv]),this[hd].destroy(),this[hd]=null);let e=this[pv]||new BZ("closed",Ti.getSocketInfo(this)),r=this[fst];if(r[UZ]=null,r[x7n]=null,r.destroyed){Mi(r[Uor]===0);let n=r[D2].splice(r[Gw]);for(let o=0;o0&&e.code!=="UND_ERR_INFO"){let n=r[D2][r[Gw]];r[D2][r[Gw]++]=null,Ti.errorRequest(r,n,e)}r[Wks]=r[Gw],Mi(r[hm]===0),r.emit("disconnect",r[I7n],[r],e),r[r8]()}a(cPs,"onHttpSocketClose");function lPs(){this[Lor]=!0}a(lPs,"onSocketClose");function w7n(t){t[FZ]&&(clearTimeout(t[FZ]),t[FZ]=null),t[QZ]=0}a(w7n,"clearIdleSocketValidation");function uPs(t,e){e[QZ]=1,e[FZ]=setTimeout(()=>{e[FZ]=null,e[QZ]=2,t[UZ]===e&&!e.destroyed&&t[r8]()},0),e[FZ].unref?.()}a(uPs,"scheduleIdleSocketValidation");function dPs(t){let e=t[UZ];if(e&&!e.destroyed){if(t[y7n]===0?!e[HPe]&&e.unref&&(e.unref(),e[HPe]=!0):e[HPe]&&e.ref&&(e.ref(),e[HPe]=!1),t[hm]===0&&t[Uor]>0&&e[Qor]){if(e[QZ]===0)return uPs(t,e),e[hd].readMore(),e.destroyed,void 0;if(e[QZ]===1)return e[hd].readMore(),e.destroyed,void 0}if(t[hm]===0&&(e[hd].readMore(),e.destroyed))return;if(t[y7n]===0)e[hd].timeoutType!==Bor&&e[hd].setTimeout(t[pst],Bor);else if(t[hm]>0&&e[hd].statusCode<200&&e[hd].timeoutType!==Spe){let r=t[D2][t[Gw]],n=r.headersTimeout!=null?r.headersTimeout:t[Jks];e[hd].setTimeout(n,Spe)}}}a(dPs,"resumeH1");function fPs(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(fPs,"shouldSendContentLength");function pPs(t,e){let{method:r,path:n,host:o,upgrade:s,blocking:c,reset:l}=e,{body:u,headers:d,contentLength:f}=e,h=r==="PUT"||r==="POST"||r==="PATCH"||r==="QUERY"||r==="PROPFIND"||r==="PROPPATCH";if(Ti.isFormDataLike(u)){Nor||(Nor=Cpe().extractBody);let[E,_]=Nor(u);e.contentType==null&&d.push("content-type",_),u=E.stream,f=E.length}else Ti.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=Ti.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),fPs(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[Oor])return Ti.errorRequest(t,e,new LZ),!1;process.emitWarning(new LZ)}let g=t[UZ];w7n(g);let A=a(E=>{e.aborted||e.completed||(Ti.errorRequest(t,e,E||new T7n),Ti.destroy(u),Ti.destroy(g,new bpe("aborted")))},"abort");try{e.onConnect(A)}catch(E){Ti.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[Ab]=!0),(s||r==="CONNECT")&&(g[Ab]=!0),l!=null&&(g[Ab]=l),t[E7n]&&g[Xks]++>=t[E7n]&&(g[Ab]=!0),c&&(g[$Pe]=!0),g.setTypeOfService&&g.setTypeOfService(e.typeOfService);let y=`${r} ${n} HTTP/1.1\r `;if(typeof o=="string"?y+=`host: ${o}\r -`:y+=t[Fws],s?y+=`connection: upgrade\r +`:y+=t[Vks],s?y+=`connection: upgrade\r upgrade: ${s}\r -`:t[Lot]&&!g[hb]?y+=`connection: keep-alive\r +`:t[ust]&&!g[Ab]?y+=`connection: keep-alive\r `:y+=`connection: close\r `,Array.isArray(d))for(let E=0;E{e.removeListener("error",g)}),!u){let A=new H9n;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Oi(o.destroyed||o[Qj]&&r[lm]<=1),o.off("drain",h).off("error",g),e.removeListener("data",f).removeListener("end",g).removeListener("close",m),!A)try{d.end()}catch(y){A=y}d.destroy(A),A&&(A.code!=="UND_ERR_INFO"||A.message!=="reset")?Ti.destroy(e,A):Ti.destroy(e)}},"onFinished");e.on("data",f).on("end",g).on("error",g).on("close",m),e.resume&&e.resume(),o.on("drain",h).on("error",g),e.errorEmitted??e.errored?setImmediate(g,e.errored):(e.endEmitted??e.readableEnded)&&setImmediate(g,null),(e.closeEmitted??e.closed)&&setImmediate(m)}a(sRs,"writeStream");function q9n(t,e,r,n,o,s,c,l){try{e?Ti.isBuffer(e)&&(Oi(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r +`}return g7n.sendHeaders.hasSubscribers&&g7n.sendHeaders.publish({request:e,headers:y,socket:g}),!u||m===0?b7n(A,null,t,e,g,f,y,h):Ti.isBuffer(u)?b7n(A,u,t,e,g,f,y,h):Ti.isBlobLike(u)?typeof u.stream=="function"?S7n(A,u.stream(),t,e,g,f,y,h):mPs(A,u,t,e,g,f,y,h):Ti.isStream(u)?hPs(A,u,t,e,g,f,y,h):Ti.isIterable(u)?S7n(A,u,t,e,g,f,y,h):Mi(!1),!0}a(pPs,"writeH1");function hPs(t,e,r,n,o,s,c,l){Mi(s!==0||r[hm]===0,"stream body cannot be pipelined");let u=!1,d=new hst({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c}),f=a(function(A){if(!u)try{!d.write(A)&&this.pause&&this.pause()}catch(y){Ti.destroy(this,y)}},"onData"),h=a(function(){u||e.resume&&e.resume()},"onDrain"),m=a(function(){if(queueMicrotask(()=>{e.removeListener("error",g)}),!u){let A=new T7n;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Mi(o.destroyed||o[eH]&&r[hm]<=1),o.off("drain",h).off("error",g),e.removeListener("data",f).removeListener("end",g).removeListener("close",m),!A)try{d.end()}catch(y){A=y}d.destroy(A),A&&(A.code!=="UND_ERR_INFO"||A.message!=="reset")?Ti.destroy(e,A):Ti.destroy(e)}},"onFinished");e.on("data",f).on("end",g).on("error",g).on("close",m),e.resume&&e.resume(),o.on("drain",h).on("error",g),e.errorEmitted??e.errored?setImmediate(g,e.errored):(e.endEmitted??e.readableEnded)&&setImmediate(g,null),(e.closeEmitted??e.closed)&&setImmediate(m)}a(hPs,"writeStream");function b7n(t,e,r,n,o,s,c,l){try{e?Ti.isBuffer(e)&&(Mi(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r \r -`,"latin1"),o.write(e),o.uncork(),n.onBodySent(e),!l&&n.reset!==!1&&(o[hb]=!0)):s===0?o.write(`${c}content-length: 0\r +`,"latin1"),o.write(e),o.uncork(),n.onBodySent(e),!l&&n.reset!==!1&&(o[Ab]=!0)):s===0?o.write(`${c}content-length: 0\r \r -`,"latin1"):(Oi(s===null,"no body must not have content length"),o.write(`${c}\r -`,"latin1")),n.onRequestSent(),r[WF]()}catch(u){t(u)}}a(q9n,"writeBuffer");async function aRs(t,e,r,n,o,s,c,l){Oi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new IZ;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\r +`,"latin1"):(Mi(s===null,"no body must not have content length"),o.write(`${c}\r +`,"latin1")),n.onRequestSent(),r[r8]()}catch(u){t(u)}}a(b7n,"writeBuffer");async function mPs(t,e,r,n,o,s,c,l){Mi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new LZ;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\r \r -`,"latin1"),o.write(u),o.uncork(),n.onBodySent(u),n.onRequestSent(),!l&&n.reset!==!1&&(o[hb]=!0),r[WF]()}catch(u){t(u)}}a(aRs,"writeBlob");async function j9n(t,e,r,n,o,s,c,l){Oi(s!==0||r[lm]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let m=u;u=null,m()}}a(d,"onDrain");let f=a(()=>new Promise((m,g)=>{Oi(u===null),o[lv]?g(o[lv]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new Qot({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[lv])throw o[lv];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(j9n,"writeIterable");var Qot=class{static{a(this,"AsyncWriter")}constructor({abort:e,socket:r,request:n,contentLength:o,client:s,expectsPayload:c,header:l}){this.socket=r,this.request=n,this.contentLength=o,this.client=s,this.bytesWritten=0,this.expectsPayload=c,this.header=l,this.abort=e,r[Qj]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[lv])throw r[lv];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[jir])throw new IZ;process.emitWarning(new IZ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[hb]=!0),o===null?r.write(`${u}transfer-encoding: chunked\r +`,"latin1"),o.write(u),o.uncork(),n.onBodySent(u),n.onRequestSent(),!l&&n.reset!==!1&&(o[Ab]=!0),r[r8]()}catch(u){t(u)}}a(mPs,"writeBlob");async function S7n(t,e,r,n,o,s,c,l){Mi(s!==0||r[hm]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let m=u;u=null,m()}}a(d,"onDrain");let f=a(()=>new Promise((m,g)=>{Mi(u===null),o[pv]?g(o[pv]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new hst({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[pv])throw o[pv];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(S7n,"writeIterable");var hst=class{static{a(this,"AsyncWriter")}constructor({abort:e,socket:r,request:n,contentLength:o,client:s,expectsPayload:c,header:l}){this.socket=r,this.request=n,this.contentLength=o,this.client=s,this.bytesWritten=0,this.expectsPayload=c,this.header=l,this.abort=e,r[eH]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[pv])throw r[pv];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[Oor])throw new LZ;process.emitWarning(new LZ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[Ab]=!0),o===null?r.write(`${u}transfer-encoding: chunked\r `,"latin1"):r.write(`${u}content-length: ${o}\r \r `,"latin1")),o===null&&r.write(`\r ${d.toString(16)}\r -`,"latin1"),this.bytesWritten+=d;let f=r.write(e);return r.uncork(),n.onBodySent(e),f||r[ud].timeout&&r[ud].timeoutType===lpe&&r[ud].timeout.refresh&&r[ud].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[Qj]=!1,e[lv])throw e[lv];if(!e.destroyed){if(o===0?s?e.write(`${c}content-length: 0\r +`,"latin1"),this.bytesWritten+=d;let f=r.write(e);return r.uncork(),n.onBodySent(e),f||r[hd].timeout&&r[hd].timeoutType===Spe&&r[hd].timeout.refresh&&r[hd].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[eH]=!1,e[pv])throw e[pv];if(!e.destroyed){if(o===0?s?e.write(`${c}content-length: 0\r \r `,"latin1"):e.write(`${c}\r `,"latin1"):r===null&&e.write(`\r 0\r \r -`,"latin1"),r!==null&&o!==r){if(n[jir])throw new IZ;process.emitWarning(new IZ)}e[ud].timeout&&e[ud].timeoutType===lpe&&e[ud].timeout.refresh&&e[ud].timeout.refresh(),n[WF]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[Qj]=!1,e&&(Oi(n[lm]<=1,"pipeline should only contain this request"),o(e))}};W9n.exports=Kws});var nUn=I((faf,rUn)=>{"use strict";p();var Fw=require("node:assert"),{pipeline:cRs}=require("node:stream"),ys=Po(),{RequestContentLengthMismatchError:Jir,RequestAbortedError:lRs,SocketError:RPe,InformationalError:qj,InvalidArgumentError:uRs}=ao(),{kUrl:wPe,kReset:Got,kClient:vT,kRunning:kPe,kPending:dRs,kQueue:jj,kPendingIdx:Xir,kRunningIdx:T2,kError:CT,kSocket:xf,kStrictContentLength:fRs,kOnError:upe,kMaxConcurrentStreams:jot,kPingInterval:Y9n,kHTTP2Session:zF,kHTTP2InitialWindowSize:pRs,kHTTP2ConnectionWindowSize:hRs,kResume:D5,kSize:mRs,kHTTPContext:eor,kClosed:Zir,kBodyTimeout:gRs,kEnableConnectProtocol:IPe,kRemoteSettings:xPe,kHTTP2Stream:qot,kHTTP2SessionState:tor}=al(),{channels:K9n}=Bj(),Bw=Symbol("open streams"),J9n,Hot;try{Hot=require("node:http2")}catch{Hot={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:ARs,HTTP2_HEADER_METHOD:Z9n,HTTP2_HEADER_PATH:X9n,HTTP2_HEADER_SCHEME:zir,HTTP2_HEADER_CONTENT_LENGTH:yRs,HTTP2_HEADER_EXPECT:ERs,HTTP2_HEADER_STATUS:Yir,HTTP2_HEADER_PROTOCOL:_Rs,NGHTTP2_REFUSED_STREAM:vRs,NGHTTP2_CANCEL:CRs}}=Hot;function Kir(t){let e=[];for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.push(Buffer.from(r),Buffer.from(o));else e.push(Buffer.from(r),Buffer.from(n));return e}a(Kir,"parseH2Headers");function bRs(t,e){t[xf]=e;let r=t[pRs],n=t[hRs],o=Hot.connect(t[wPe],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[jot],settings:{enablePush:!1,...r!=null?{initialWindowSize:r}:null}});return t[xf]=e,o[Bw]=0,o[vT]=t,o[xf]=e,o[tor]={ping:{interval:t[Y9n]===0?null:setInterval(xRs,t[Y9n],o).unref()}},o[IPe]=!1,o[xPe]=!1,n&&ys.addListener(o,"connect",TRs.bind(o,n)),ys.addListener(o,"error",wRs),ys.addListener(o,"frameError",RRs),ys.addListener(o,"end",kRs),ys.addListener(o,"goaway",PRs),ys.addListener(o,"close",DRs),ys.addListener(o,"remoteSettings",IRs),o.unref(),t[zF]=o,e[zF]=o,ys.addListener(e,"error",MRs),ys.addListener(e,"end",ORs),ys.addListener(e,"close",NRs),e[Zir]=!1,e.on("close",LRs),{version:"h2",defaultPipelining:1/0,write(s){return FRs(t,s)},resume(){SRs(t)},destroy(s,c){e[Zir]?queueMicrotask(c):e.destroy(s).on("close",c)},get destroyed(){return e.destroyed},busy(s){if(s!=null)if(t[kPe]>0){if(s.idempotent===!1||(s.upgrade==="websocket"||s.method==="CONNECT")&&o[xPe]===!1||ys.bodyLength(s.body)!==0&&(ys.isStream(s.body)||ys.isAsyncIterable(s.body)||ys.isFormDataLike(s.body)))return!0}else return(s.upgrade==="websocket"||s.method==="CONNECT")&&o[xPe]===!1;return!1}}}a(bRs,"connectH2");function SRs(t){let e=t[xf];e?.destroyed===!1&&(t[mRs]===0||t[jot]===0?(e.unref(),t[zF].unref()):(e.ref(),t[zF].ref()))}a(SRs,"resumeH2");function TRs(t){try{typeof this.setLocalWindowSize=="function"&&this.setLocalWindowSize(t)}catch{}}a(TRs,"applyConnectionWindowSize");function IRs(t){if(this[vT][jot]=t.maxConcurrentStreams??this[vT][jot],this[xPe]===!0&&this[IPe]===!0&&t.enableConnectProtocol===!1){let e=new qj("HTTP/2: Server disabled extended CONNECT protocol against RFC-8441");this[xf][CT]=e,this[vT][upe](e);return}this[IPe]=t.enableConnectProtocol??this[IPe],this[xPe]=!0,this[vT][D5]()}a(IRs,"onHttp2RemoteSettings");function xRs(t){let e=t[tor];if((t.closed||t.destroyed)&&e.ping.interval!=null){clearInterval(e.ping.interval),e.ping.interval=null;return}t.ping(r.bind(t));function r(n,o){let s=this[vT],c=this[vT];if(n!=null){let l=new qj(`HTTP/2: "PING" errored - type ${n.message}`);c[CT]=l,s[upe](l)}else s.emit("ping",o)}a(r,"onPing")}a(xRs,"onHttp2SendPing");function wRs(t){Fw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[xf][CT]=t,this[vT][upe](t)}a(wRs,"onHttp2SessionError");function RRs(t,e,r){if(r===0){let n=new qj(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[xf][CT]=n,this[vT][upe](n)}}a(RRs,"onHttp2FrameError");function kRs(){let t=new RPe("other side closed",ys.getSocketInfo(this[xf]));this.destroy(t),ys.destroy(this[xf],t)}a(kRs,"onHttp2SessionEnd");function PRs(t){let e=this[CT]||new RPe(`HTTP/2: "GOAWAY" frame received with code ${t}`,ys.getSocketInfo(this[xf])),r=this[vT];if(r[xf]=null,r[eor]=null,this.close(),this[zF]=null,ys.destroy(this[xf],e),r[T2]{e.aborted||e.completed||(x=x||new lRs,ys.errorRequest(t,e,x),A!=null&&(A.removeAllListeners("data"),A.close(),t[upe](x),t[D5]()),ys.destroy(m,x))},"abort");try{e.onConnect(_)}catch(x){ys.errorRequest(t,e,x)}if(e.aborted)return!1;if(l||o==="CONNECT")return n.ref(),l==="websocket"?n[IPe]===!1?(ys.errorRequest(t,e,new qj("HTTP/2: Extended CONNECT protocol not supported by server")),n.unref(),!1):(g[Z9n]="CONNECT",g[_Rs]="websocket",g[X9n]=s,f==="ws:"||f==="wss:"?g[zir]=f==="ws:"?"http":"https":g[zir]=f==="http:"?"http":"https",A=n.request(g,{endStream:!1,signal:d}),A[qot]=!0,A.once("response",(x,P)=>{let{[Yir]:D,...N}=x;e.onUpgrade(D,Kir(N),A),++n[Bw],t[jj][t[T2]++]=null}),A.on("error",()=>{(A.rstCode===vRs||A.rstCode===CRs)&&_(new qj(`HTTP/2: "stream error" received - code ${A.rstCode}`))}),A.once("close",()=>{n[Bw]-=1,n[Bw]===0&&n.unref()}),A.setTimeout(r),!0):(A=n.request(g,{endStream:!1,signal:d}),A[qot]=!0,A.on("response",x=>{let{[Yir]:P,...D}=x;e.onUpgrade(P,Kir(D),A),++n[Bw],t[jj][t[T2]++]=null}),A.once("close",()=>{n[Bw]-=1,n[Bw]===0&&n.unref()}),A.setTimeout(r),!0);g[X9n]=s,g[zir]=f==="http:"?"http":"https";let v=o==="PUT"||o==="POST"||o==="PATCH";m&&typeof m.read=="function"&&m.read(0);let b=ys.bodyLength(m);if(ys.isFormDataLike(m)){J9n??=ape().extractBody;let[x,P]=J9n(m);g["content-type"]=P,m=x.stream,b=x.length}if(b==null&&(b=e.contentLength),v||(b=null),BRs(o)&&b>0&&e.contentLength!=null&&e.contentLength!==b){if(t[fRs])return ys.errorRequest(t,e,new Jir),!1;process.emitWarning(new Jir)}if(b!=null&&(Fw(m||b===0,"no body must not have content length"),g[yRs]=`${b}`),n.ref(),K9n.sendHeaders.hasSubscribers){let x="";for(let P in g)x+=`${P}: ${g[P]}\r -`;K9n.sendHeaders.publish({request:e,headers:x,socket:n[xf]})}let T=o==="GET"||o==="HEAD"||m===null;u?(g[ERs]="100-continue",A=n.request(g,{endStream:T,signal:d}),A[qot]=!0,A.once("continue",R)):(A=n.request(g,{endStream:T,signal:d}),A[qot]=!0,R()),++n[Bw],A.setTimeout(r);let w=!1;return A.once("response",x=>{let{[Yir]:P,...D}=x;if(e.onResponseStarted(),w=!0,e.aborted){A.removeAllListeners("data");return}e.onHeaders(Number(P),Kir(D),A.resume.bind(A),"")===!1&&A.pause(),A.on("data",N=>{e.aborted||e.completed||e.onData(N)===!1&&A.pause()})}),A.once("end",()=>{A.removeAllListeners("data"),w?(!e.aborted&&!e.completed&&e.onComplete({}),t[jj][t[T2]++]=null,t[D5]()):(_(new qj("HTTP/2: stream half-closed (remote)")),t[jj][t[T2]++]=null,t[Xir]=t[T2],t[D5]())}),A.once("close",()=>{A.removeAllListeners("data"),n[Bw]-=1,n[Bw]===0&&n.unref()}),A.once("error",function(x){A.removeAllListeners("data"),_(x)}),A.once("frameError",(x,P)=>{A.removeAllListeners("data"),_(new qj(`HTTP/2: "frameError" received - type ${x}, code ${P}`))}),A.on("aborted",()=>{A.removeAllListeners("data")}),A.on("timeout",()=>{let x=new qj(`HTTP/2: "stream timeout after ${r}"`);A.removeAllListeners("data"),n[Bw]-=1,n[Bw]===0&&n.unref(),_(x)}),A.once("trailers",x=>{e.aborted||e.completed||(A.removeAllListeners("data"),e.onComplete(x))}),!0;function R(){!m||b===0?eUn(_,A,null,t,e,t[xf],b,v):ys.isBuffer(m)?eUn(_,A,m,t,e,t[xf],b,v):ys.isBlobLike(m)?typeof m.stream=="function"?tUn(_,A,m.stream(),t,e,t[xf],b,v):QRs(_,A,m,t,e,t[xf],b,v):ys.isStream(m)?URs(_,t[xf],v,A,m,t,e,b):ys.isIterable(m)?tUn(_,A,m,t,e,t[xf],b,v):Fw(!1)}a(R,"writeBodyH2")}a(FRs,"writeH2");function eUn(t,e,r,n,o,s,c,l){try{r!=null&&ys.isBuffer(r)&&(Fw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[Got]=!0),o.onRequestSent(),n[D5]()}catch(u){t(u)}}a(eUn,"writeBuffer");function URs(t,e,r,n,o,s,c,l){Fw(l!==0||s[kPe]===0,"stream body cannot be pipelined");let u=cRs(o,n,f=>{f?(ys.destroy(u,f),t(f)):(ys.removeAllListeners(u),c.onRequestSent(),r||(e[Got]=!0),s[D5]())});ys.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(URs,"writeStream");async function QRs(t,e,r,n,o,s,c,l){Fw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new Jir;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[Got]=!0),n[D5]()}catch(u){t(u)}}a(QRs,"writeBlob");async function tUn(t,e,r,n,o,s,c,l){Fw(c!==0||n[kPe]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let h=u;u=null,h()}}a(d,"onDrain");let f=a(()=>new Promise((h,m)=>{Fw(u===null),s[CT]?m(s[CT]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[CT])throw s[CT];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[Got]=!0),n[D5]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(tUn,"writeIterable");rUn.exports=bRs});var Vj=I((maf,dUn)=>{"use strict";p();var YF=require("node:assert"),aUn=require("node:net"),PPe=require("node:http"),PZ=Po(),{ClientStats:qRs}=Wnr(),{channels:dpe}=Bj(),jRs=v6n(),HRs=vZ(),{InvalidArgumentError:dd,InformationalError:GRs,ClientDestroyedError:$Rs}=ao(),VRs=CZ(),{kUrl:N5,kServerName:$j,kClient:WRs,kBusy:nor,kConnect:zRs,kResuming:DZ,kRunning:OPe,kPending:LPe,kSize:DPe,kQueue:I2,kConnected:YRs,kConnecting:fpe,kNeedDrain:Gj,kKeepAliveDefaultTimeout:iUn,kHostHeader:KRs,kPendingIdx:x2,kRunningIdx:JF,kError:JRs,kPipelining:$ot,kKeepAliveTimeoutValue:ZRs,kMaxHeadersSize:XRs,kKeepAliveMaxTimeout:eks,kKeepAliveTimeoutThreshold:tks,kHeadersTimeout:rks,kBodyTimeout:nks,kStrictContentLength:iks,kConnector:NPe,kMaxRequests:ior,kCounter:oks,kClose:sks,kDestroy:aks,kDispatch:cks,kLocalAddress:MPe,kMaxResponseSize:lks,kOnError:uks,kHTTPContext:ch,kMaxConcurrentStreams:dks,kHTTP2InitialWindowSize:fks,kHTTP2ConnectionWindowSize:pks,kResume:KF,kPingInterval:hks}=al(),mks=z9n(),gks=nUn(),Hj=Symbol("kClosedResolve"),Aks=PPe&&PPe.maxHeaderSize&&Number.isInteger(PPe.maxHeaderSize)&&PPe.maxHeaderSize>0?()=>PPe.maxHeaderSize:()=>{throw new dd("http module not available or http.maxHeaderSize invalid")},oUn=a(()=>{},"noop");function cUn(t){return t[$ot]??t[ch]?.defaultPipelining??1}a(cUn,"getPipelining");var oor=class extends HRs{static{a(this,"Client")}constructor(e,{maxHeaderSize:r,headersTimeout:n,socketTimeout:o,requestTimeout:s,connectTimeout:c,bodyTimeout:l,idleTimeout:u,keepAlive:d,keepAliveTimeout:f,maxKeepAliveTimeout:h,keepAliveMaxTimeout:m,keepAliveTimeoutThreshold:g,socketPath:A,pipelining:y,tls:E,strictContentLength:_,maxCachedSessions:v,connect:b,maxRequestsPerClient:T,localAddress:w,maxResponseSize:R,autoSelectFamily:x,autoSelectFamilyAttemptTimeout:P,maxConcurrentStreams:D,allowH2:N,useH2c:L,initialWindowSize:B,connectionWindowSize:q,pingInterval:M,webSocket:O}={}){if(d!==void 0)throw new dd("unsupported keepAlive, use pipelining=0 instead");if(o!==void 0)throw new dd("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(s!==void 0)throw new dd("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(u!==void 0)throw new dd("unsupported idleTimeout, use keepAliveTimeout instead");if(h!==void 0)throw new dd("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(r!=null){if(!Number.isInteger(r)||r<1)throw new dd("invalid maxHeaderSize")}else r=Aks();if(A!=null&&typeof A!="string")throw new dd("invalid socketPath");if(c!=null&&(!Number.isFinite(c)||c<0))throw new dd("invalid connectTimeout");if(f!=null&&(!Number.isFinite(f)||f<=0))throw new dd("invalid keepAliveTimeout");if(m!=null&&(!Number.isFinite(m)||m<=0))throw new dd("invalid keepAliveMaxTimeout");if(g!=null&&!Number.isFinite(g))throw new dd("invalid keepAliveTimeoutThreshold");if(n!=null&&(!Number.isInteger(n)||n<0))throw new dd("headersTimeout must be a positive integer or zero");if(l!=null&&(!Number.isInteger(l)||l<0))throw new dd("bodyTimeout must be a positive integer or zero");if(b!=null&&typeof b!="function"&&typeof b!="object")throw new dd("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new dd("maxRequestsPerClient must be a positive number");if(w!=null&&(typeof w!="string"||aUn.isIP(w)===0))throw new dd("localAddress must be valid string IP address");if(R!=null&&(!Number.isInteger(R)||R<-1))throw new dd("maxResponseSize must be a positive number");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new dd("autoSelectFamilyAttemptTimeout must be a positive number");if(N!=null&&typeof N!="boolean")throw new dd("allowH2 must be a valid boolean value");if(D!=null&&(typeof D!="number"||D<1))throw new dd("maxConcurrentStreams must be a positive integer, greater than 0");if(L!=null&&typeof L!="boolean")throw new dd("useH2c must be a valid boolean value");if(B!=null&&(!Number.isInteger(B)||B<1))throw new dd("initialWindowSize must be a positive integer, greater than 0");if(q!=null&&(!Number.isInteger(q)||q<1))throw new dd("connectionWindowSize must be a positive integer, greater than 0");if(M!=null&&(typeof M!="number"||!Number.isInteger(M)||M<0))throw new dd("pingInterval must be a positive integer, greater or equal to 0");if(super({webSocket:O}),typeof b!="function")b=VRs({...E,maxCachedSessions:v,allowH2:N,useH2c:L,socketPath:A,timeout:c,...typeof x=="boolean"?{autoSelectFamily:x,autoSelectFamilyAttemptTimeout:P}:void 0,...b});else{let j=b;b=a((Q,U)=>j({...Q,...A!=null?{socketPath:A}:null,...N!=null?{allowH2:N}:null},U),"connect")}this[N5]=PZ.parseOrigin(e),this[NPe]=b,this[$ot]=y??1,this[XRs]=r,this[iUn]=f??4e3,this[eks]=m??6e5,this[tks]=g??2e3,this[ZRs]=this[iUn],this[$j]=null,this[MPe]=w??null,this[DZ]=0,this[Gj]=0,this[KRs]=`host: ${this[N5].hostname}${this[N5].port?`:${this[N5].port}`:""}\r -`,this[nks]=l??3e5,this[rks]=n??3e5,this[iks]=_??!0,this[ior]=T,this[Hj]=null,this[lks]=R>-1?R:-1,this[ch]=null,this[dks]=D??100,this[fks]=B??262144,this[pks]=q??524288,this[hks]=M??6e4,this[I2]=[],this[JF]=0,this[x2]=0,this[KF]=j=>sor(this,j),this[uks]=j=>lUn(this,j)}get pipelining(){return this[$ot]}set pipelining(e){this[$ot]=e,this[KF](!0)}get stats(){return new qRs(this)}get[LPe](){return this[I2].length-this[x2]}get[OPe](){return this[x2]-this[JF]}get[DPe](){return this[I2].length-this[JF]}get[YRs](){return!!this[ch]&&!this[fpe]&&!this[ch].destroyed}get[nor](){return!!(this[ch]?.busy(null)||this[DPe]>=(cUn(this)||1)||this[LPe]>0)}[zRs](e){uUn(this),this.once("connect",e)}[cks](e,r){let n=new jRs(this[N5].origin,e,r);return this[I2].push(n),this[DZ]||(PZ.bodyLength(n.body)==null&&PZ.isIterable(n.body)?(this[DZ]=1,queueMicrotask(()=>sor(this))):this[KF](!0)),this[DZ]&&this[Gj]!==2&&this[nor]&&(this[Gj]=2),this[Gj]<2}[sks](){return new Promise(e=>{this[DPe]?this[Hj]=e:e(null)})}[aks](e){return new Promise(r=>{let n=this[I2].splice(this[x2]);for(let s=0;s{this[Hj]&&(this[Hj](),this[Hj]=null),r(null)},"callback");this[ch]?(this[ch].destroy(e,o),this[ch]=null):queueMicrotask(o),this[KF]()})}};function lUn(t,e){if(t[OPe]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){YF(t[x2]===t[JF]);let r=t[I2].splice(t[JF]);for(let n=0;n{if(s){ror(t,s,{host:e,hostname:r,protocol:n,port:o}),t[KF]();return}if(t.destroyed){PZ.destroy(c.on("error",oUn),new $Rs),t[KF]();return}YF(c);try{t[ch]=c.alpnProtocol==="h2"?gks(t,c):mks(t,c)}catch(l){c.destroy().on("error",oUn),ror(t,l,{host:e,hostname:r,protocol:n,port:o}),t[KF]();return}t[fpe]=!1,c[oks]=0,c[ior]=t[ior],c[WRs]=t,c[JRs]=null,dpe.connected.hasSubscribers&&dpe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[ch]?.version,servername:t[$j],localAddress:t[MPe]},connector:t[NPe],socket:c}),t.emit("connect",t[N5],[t]),t[KF]()})}catch(s){ror(t,s,{host:e,hostname:r,protocol:n,port:o}),t[KF]()}}a(uUn,"connect");function ror(t,e,{host:r,hostname:n,protocol:o,port:s}){if(!t.destroyed){if(t[fpe]=!1,dpe.connectError.hasSubscribers&&dpe.connectError.publish({connectParams:{host:r,hostname:n,protocol:o,port:s,version:t[ch]?.version,servername:t[$j],localAddress:t[MPe]},connector:t[NPe],error:e}),e.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(YF(t[OPe]===0);t[LPe]>0&&t[I2][t[x2]].servername===t[$j];){let c=t[I2][t[x2]++];PZ.errorRequest(t,c,e)}else lUn(t,e);t.emit("connectionError",t[N5],[t],e)}}a(ror,"handleConnectError");function sUn(t){t[Gj]=0,t.emit("drain",t[N5],[t])}a(sUn,"emitDrain");function sor(t,e){t[DZ]!==2&&(t[DZ]=2,yks(t,e),t[DZ]=0,t[JF]>256&&(t[I2].splice(0,t[JF]),t[x2]-=t[JF],t[JF]=0))}a(sor,"resume");function yks(t,e){for(;;){if(t.destroyed){YF(t[LPe]===0);return}if(t[Hj]&&!t[DPe]){t[Hj](),t[Hj]=null;return}if(t[ch]&&t[ch].resume(),t[nor])t[Gj]=2;else if(t[Gj]===2){e?(t[Gj]=1,queueMicrotask(()=>sUn(t))):sUn(t);continue}if(t[LPe]===0||t[OPe]>=(cUn(t)||1))return;let r=t[I2][t[x2]];if(r===null)return;if(t[N5].protocol==="https:"&&t[$j]!==r.servername){if(t[OPe]>0)return;t[$j]=r.servername,t[ch]?.destroy(new GRs("servername changed"),()=>{t[ch]=null,sor(t)})}if(t[fpe])return;if(!t[ch]){uUn(t);return}if(t[ch].destroyed||t[ch].busy(r))return;!r.aborted&&t[ch].write(r)?t[x2]++:t[I2].splice(t[x2],1)}}a(yks,"_resume");dUn.exports=oor});var aor=I((Eaf,fUn)=>{"use strict";p();var Vot=class{static{a(this,"FixedCircularBuffer")}bottom=0;top=0;list=new Array(2048).fill(void 0);next=null;isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};fUn.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new Vot}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Vot),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next,e.next=null),r}}});var Wot=I((Caf,vUn)=>{"use strict";p();var{PoolStats:Eks}=Wnr(),_ks=vZ(),vks=aor(),{kConnected:cor,kSize:pUn,kRunning:hUn,kPending:mUn,kQueued:BPe,kBusy:Cks,kFree:bks,kUrl:Sks,kClose:Tks,kDestroy:Iks,kDispatch:xks}=al(),Mg=Symbol("clients"),uv=Symbol("needDrain"),FPe=Symbol("queue"),lor=Symbol("closed resolve"),uor=Symbol("onDrain"),gUn=Symbol("onConnect"),AUn=Symbol("onDisconnect"),yUn=Symbol("onConnectionError"),dor=Symbol("get dispatcher"),EUn=Symbol("add client"),_Un=Symbol("remove client"),por=class extends _ks{static{a(this,"PoolBase")}[FPe]=new vks;[BPe]=0;[Mg]=[];[uv]=!1;[uor](e,r,n){let o=this[FPe],s=!1;for(;!s;){let c=o.shift();if(!c)break;this[BPe]--,s=!e.dispatch(c.opts,c.handler)}if(e[uv]=s,!s&&this[uv]&&(this[uv]=!1,this.emit("drain",r,[this,...n])),this[lor]&&o.isEmpty()){let c=[];for(let l=0;l{this.emit("connect",e,[this,...r])};[AUn]=(e,r,n)=>{this.emit("disconnect",e,[this,...r],n)};[yUn]=(e,r,n)=>{this.emit("connectionError",e,[this,...r],n)};get[Cks](){return this[uv]}get[cor](){let e=0;for(let{[cor]:r}of this[Mg])e+=r;return e}get[bks](){let e=0;for(let{[cor]:r,[uv]:n}of this[Mg])e+=r&&!n;return e}get[mUn](){let e=this[BPe];for(let{[mUn]:r}of this[Mg])e+=r;return e}get[hUn](){let e=0;for(let{[hUn]:r}of this[Mg])e+=r;return e}get[pUn](){let e=this[BPe];for(let{[pUn]:r}of this[Mg])e+=r;return e}get stats(){return new Eks(this)}[Tks](){if(this[FPe].isEmpty()){let e=[];for(let r=0;r{this[lor]=e})}[Iks](e){for(;;){let n=this[FPe].shift();if(!n)break;n.handler.onError(e)}let r=new Array(this[Mg].length);for(let n=0;n{this[uv]&&this[uor](e,e[Sks],[e,this])}),this}[_Un](e){e.close(()=>{let r=this[Mg].indexOf(e);r!==-1&&this[Mg].splice(r,1)}),this[uv]=this[Mg].some(r=>!r[uv]&&r.closed!==!0&&r.destroyed!==!0)}};vUn.exports={PoolBase:por,kClients:Mg,kNeedDrain:uv,kAddClient:EUn,kRemoveClient:_Un,kGetDispatcher:dor}});var NZ=I((Taf,TUn)=>{"use strict";p();var{PoolBase:wks,kClients:zot,kNeedDrain:Rks,kAddClient:kks,kGetDispatcher:Pks,kRemoveClient:Dks}=Wot(),Nks=Vj(),{InvalidArgumentError:hor}=ao(),CUn=Po(),{kUrl:bUn}=al(),Mks=CZ(),Yot=Symbol("options"),mor=Symbol("connections"),SUn=Symbol("factory");function Oks(t,e){return new Nks(t,e)}a(Oks,"defaultFactory");var gor=class extends wks{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=Oks,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,clientTtl:m,...g}={}){if(r!=null&&(!Number.isFinite(r)||r<0))throw new hor("invalid connections");if(typeof n!="function")throw new hor("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new hor("connect must be a function or an object");typeof o!="function"&&(o=Mks({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(g),this[mor]=r||null,this[bUn]=CUn.parseOrigin(e),this[Yot]={...CUn.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[Yot].interceptors=g.interceptors?{...g.interceptors}:void 0,this[SUn]=n,this.on("connect",(A,y)=>{if(m!=null&&m>0)for(let E of y)Object.assign(E,{ttl:Date.now()})}),this.on("connectionError",(A,y,E)=>{for(let _ of y){let v=this[zot].indexOf(_);v!==-1&&this[zot].splice(v,1)}})}[Pks](){let e=this[Yot].clientTtl;for(let r of this[zot])if(e!=null&&e>0&&r.ttl&&Date.now()-r.ttl>e)this[Dks](r);else if(!r[Rks])return r;if(!this[mor]||this[zot].length{"use strict";p();var{BalancedPoolMissingUpstreamError:Lks,InvalidArgumentError:Bks}=ao(),{PoolBase:Fks,kClients:VA,kNeedDrain:UPe,kAddClient:Uks,kRemoveClient:Qks,kGetDispatcher:qks}=Wot(),jks=NZ(),{kUrl:Kot}=al(),Jot=Po(),IUn=Symbol("factory"),QPe=Symbol("options"),xUn=Symbol("kGreatestCommonDivisor"),MZ=Symbol("kCurrentWeight"),OZ=Symbol("kIndex"),Uw=Symbol("kWeight"),Zot=Symbol("kMaxWeightPerServer"),Xot=Symbol("kErrorPenalty");function Hks(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(Hks,"getGreatestCommonDivisor");function Gks(t,e){return new jks(t,e)}a(Gks,"defaultFactory");var Aor=class extends Fks{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=Gks,...n}={}){if(typeof r!="function")throw new Bks("factory must be a function.");super(n),this[QPe]={...Jot.deepClone(n)},this[QPe].interceptors=n.interceptors?{...n.interceptors}:void 0,this[OZ]=-1,this[MZ]=0,this[Zot]=this[QPe].maxWeightPerServer||100,this[Xot]=this[QPe].errorPenalty||15,Array.isArray(e)||(e=[e]),this[IUn]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=Jot.parseOrigin(e).origin;if(this[VA].find(o=>o[Kot].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[IUn](r,this[QPe]);this[Uks](n),n.on("connect",()=>{n[Uw]=Math.min(this[Zot],n[Uw]+this[Xot])}),n.on("connectionError",()=>{n[Uw]=Math.max(1,n[Uw]-this[Xot]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[Uw]=Math.max(1,n[Uw]-this[Xot]),this._updateBalancedPoolStats())});for(let o of this[VA])o[Uw]=this[Zot];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[Kot].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[Qks](n),this}getUpstream(e){let r=Jot.parseOrigin(e).origin;return this[VA].find(n=>n[Kot].origin===r&&n.closed!==!0&&n.destroyed!==!0)}get upstreams(){return this[VA].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[Kot].origin)}[qks](){if(this[VA].length===0)throw new Lks;if(!this[VA].find(s=>!s[UPe]&&s.closed!==!0&&s.destroyed!==!0)||this[VA].map(s=>s[UPe]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[VA].findIndex(s=>!s[UPe]);for(;n++this[VA][o][Uw]&&!s[UPe]&&(o=this[OZ]),this[OZ]===0&&(this[MZ]=this[MZ]-this[xUn],this[MZ]<=0&&(this[MZ]=this[Zot])),s[Uw]>=this[MZ]&&!s[UPe])return s}return this[MZ]=this[VA][o][Uw],this[OZ]=o,this[VA][o]}};wUn.exports=Aor});var NUn=I((Paf,DUn)=>{"use strict";p();var{PoolBase:$ks,kClients:est,kNeedDrain:Vks,kAddClient:kUn,kGetDispatcher:Wks,kRemoveClient:zks}=Wot(),Yks=Vj(),{InvalidArgumentError:yor}=ao(),PUn=Po(),{kUrl:Eor}=al(),Kks=CZ(),qPe=Symbol("options"),_or=Symbol("connections"),vor=Symbol("factory"),tst=Symbol("index");function Jks(t,e){return new Yks(t,e)}a(Jks,"defaultFactory");var Cor=class extends $ks{static{a(this,"RoundRobinPool")}constructor(e,{connections:r,factory:n=Jks,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,clientTtl:m,...g}={}){if(r!=null&&(!Number.isFinite(r)||r<0))throw new yor("invalid connections");if(typeof n!="function")throw new yor("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new yor("connect must be a function or an object");typeof o!="function"&&(o=Kks({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(),this[_or]=r||null,this[Eor]=PUn.parseOrigin(e),this[qPe]={...PUn.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[qPe].interceptors=g.interceptors?{...g.interceptors}:void 0,this[vor]=n,this[tst]=-1,this.on("connect",(A,y)=>{if(m!=null&&m>0)for(let E of y)Object.assign(E,{ttl:Date.now()})}),this.on("connectionError",(A,y,E)=>{for(let _ of y){let v=this[est].indexOf(_);v!==-1&&this[est].splice(v,1)}})}[Wks](){let e=this[qPe].clientTtl,r=this[est].length;if(r===0){let o=this[vor](this[Eor],this[qPe]);return this[kUn](o),o}let n=0;for(;n0&&o.ttl&&Date.now()-o.ttl>e){this[zks](o),n++;continue}if(!o[Vks])return o;n++}if(!this[_or]||r{"use strict";p();var{InvalidArgumentError:rst,MaxOriginsReachedError:Zks}=ao(),{kClients:Qw,kRunning:MUn,kClose:Xks,kDestroy:ePs,kDispatch:tPs,kUrl:rPs}=al(),nPs=vZ(),iPs=NZ(),oPs=Vj(),sPs=Po(),OUn=Symbol("onConnect"),LUn=Symbol("onDisconnect"),BUn=Symbol("onConnectionError"),FUn=Symbol("onDrain"),UUn=Symbol("factory"),bor=Symbol("options"),jPe=Symbol("origins");function aPs(t,e){return e&&e.connections===1?new oPs(t,e):new iPs(t,e)}a(aPs,"defaultFactory");var Sor=class extends nPs{static{a(this,"Agent")}constructor({factory:e=aPs,maxOrigins:r=1/0,connect:n,...o}={}){if(typeof e!="function")throw new rst("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new rst("connect must be a function or an object");if(typeof r!="number"||Number.isNaN(r)||r<=0)throw new rst("maxOrigins must be a number greater than 0");super(o),n&&typeof n!="function"&&(n={...n}),this[bor]={...sPs.deepClone(o),maxOrigins:r,connect:n},this[UUn]=e,this[Qw]=new Map,this[jPe]=new Set,this[FUn]=(s,c)=>{this.emit("drain",s,[this,...c])},this[OUn]=(s,c)=>{this.emit("connect",s,[this,...c])},this[LUn]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[BUn]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[MUn](){let e=0;for(let{dispatcher:r}of this[Qw].values())e+=r[MUn];return e}[tPs](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new rst("opts.origin must be a non-empty string or URL.");if(this[jPe].size>=this[bor].maxOrigins&&!this[jPe].has(n))throw new Zks;let o=this[Qw].get(n),s=o&&o.dispatcher;if(!s){let c=a(l=>{let u=this[Qw].get(n);u&&(l&&(u.count-=1),u.count<=0&&(this[Qw].delete(n),u.dispatcher.destroyed||u.dispatcher.close()),this[jPe].delete(n))},"closeClientIfUnused");s=this[UUn](e.origin,this[bor]).on("drain",this[FUn]).on("connect",(l,u)=>{let d=this[Qw].get(n);d&&(d.count+=1),this[OUn](l,u)}).on("disconnect",(l,u,d)=>{c(!0),this[LUn](l,u,d)}).on("connectionError",(l,u,d)=>{c(!1),this[BUn](l,u,d)}),this[Qw].set(n,{count:0,dispatcher:s}),this[jPe].add(n)}return s.dispatch(e,r)}[Xks](){let e=[];for(let{dispatcher:r}of this[Qw].values())e.push(r.close());return this[Qw].clear(),Promise.all(e)}[ePs](e){let r=[];for(let{dispatcher:n}of this[Qw].values())r.push(n.destroy(e));return this[Qw].clear(),Promise.all(r)}get stats(){let e={};for(let{dispatcher:r}of this[Qw].values())r.stats&&(e[r[rPs].origin]=r.stats);return e}};QUn.exports=Sor});var HUn=I((Baf,jUn)=>{"use strict";p();var{Buffer:zj}=require("node:buffer"),Tor=require("node:net"),{InvalidArgumentError:Wj}=ao();function cPs(t){if(Tor.isIPv4(t)){let r=t.split(".").map(Number);return{type:1,buffer:zj.from(r)}}if(Tor.isIPv6(t))return{type:4,buffer:qUn(t)};let e=zj.from(t,"utf8");if(e.length>255)throw new Wj("Domain name too long (max 255 bytes)");return{type:3,buffer:zj.concat([zj.from([e.length]),e])}}a(cPs,"parseAddress");function qUn(t){let e=zj.alloc(16),r=t;if(t.includes(".")){let o=t.lastIndexOf(":"),s=t.slice(o+1);if(Tor.isIPv4(s)){let c=s.split(".").map(Number),l=(c[0]<<8|c[1]).toString(16),u=(c[2]<<8|c[3]).toString(16);r=`${t.slice(0,o)}:${l}:${u}`}}let n=r.indexOf("::");if(n!==-1){let o=r.slice(0,n),s=r.slice(n+2),c=o===""?[]:o.split(":"),l=s===""?[]:s.split(":"),u=0;for(let d of c)e.writeUInt16BE(parseInt(d,16),u),u+=2;u=16-l.length*2;for(let d of l)e.writeUInt16BE(parseInt(d,16),u),u+=2}else{let o=r.split(":");for(let s=0;s{"use strict";p();var{EventEmitter:fPs}=require("node:events"),{Buffer:BZ}=require("node:buffer"),{InvalidArgumentError:ppe,Socks5ProxyError:Yj}=ao(),{debuglog:pPs}=require("node:util"),{parseAddress:hPs}=HUn(),ZF=pPs("undici:socks5"),GUn=BZ.alloc(0),nst=5,hpe={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},$Un={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},FZ={IPV4:1,DOMAIN:3,IPV6:4},M5={SUCCEEDED:0,GENERAL_FAILURE:1,CONNECTION_NOT_ALLOWED:2,NETWORK_UNREACHABLE:3,HOST_UNREACHABLE:4,CONNECTION_REFUSED:5,TTL_EXPIRED:6,COMMAND_NOT_SUPPORTED:7,ADDRESS_TYPE_NOT_SUPPORTED:8},vE={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",AUTHENTICATED:"authenticated",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"},Ior=class extends fPs{static{a(this,"Socks5Client")}constructor(e,r={}){if(super(),!e)throw new ppe("socket is required");this.socket=e,this.options=r,this.state=vE.INITIAL,this.buffer=GUn,this.onSocketData=this.onData.bind(this),this.onSocketError=this.onError.bind(this),this.onSocketClose=this.onClose.bind(this),this.authMethods=[],r.username&&r.password&&this.authMethods.push(hpe.USERNAME_PASSWORD),this.authMethods.push(hpe.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(e){ZF("received data",e.length,"bytes in state",this.state),this.buffer=BZ.concat([this.buffer,e]);try{switch(this.state){case vE.HANDSHAKING:this.handleHandshakeResponse();break;case vE.AUTHENTICATING:this.handleAuthResponse();break;case vE.CONNECTING:this.handleConnectResponse();break}}catch(r){this.onError(r)}}onError(e){ZF("socket error",e),this.state=vE.ERROR,this.emit("error",e),this.destroy()}onClose(){ZF("socket closed"),this.state=vE.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}markAuthenticated(){this.state=vE.AUTHENTICATED,this.emit("authenticated")}handshake(){if(this.state!==vE.INITIAL)throw new ppe("Handshake already started");ZF("starting handshake with",this.authMethods.length,"auth methods"),this.state=vE.HANDSHAKING;let e=BZ.alloc(2+this.authMethods.length);e[0]=nst,e[1]=this.authMethods.length,this.authMethods.forEach((r,n)=>{e[2+n]=r}),this.socket.write(e)}handleHandshakeResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],r=this.buffer[1];if(e!==nst)throw new Yj(`Invalid SOCKS version: ${e}`,"UND_ERR_SOCKS5_VERSION");if(r===hpe.NO_ACCEPTABLE)throw new Yj("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),ZF("server selected auth method",r),r===hpe.NO_AUTH)this.markAuthenticated();else if(r===hpe.USERNAME_PASSWORD)this.state=vE.AUTHENTICATING,this.sendAuthRequest();else throw new Yj(`Unsupported authentication method: ${r}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:e,password:r}=this.options;if(!e||!r)throw new ppe("Username and password required for authentication");ZF("sending username/password auth");let n=BZ.from(e),o=BZ.from(r);if(n.length>255||o.length>255)throw new ppe("Username or password too long");let s=BZ.alloc(3+n.length+o.length);s[0]=1,s[1]=n.length,n.copy(s,2),s[2+n.length]=o.length,o.copy(s,3+n.length),this.socket.write(s)}handleAuthResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],r=this.buffer[1];if(e!==1)throw new Yj(`Invalid auth sub-negotiation version: ${e}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(r!==0)throw new Yj("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),ZF("authentication successful"),this.markAuthenticated()}connect(e,r){if(this.state===vE.CONNECTING||this.state===vE.CONNECTED)throw new ppe("Connection already in progress");if(this.state!==vE.AUTHENTICATED)throw new ppe("Client must be authenticated before CONNECT");ZF("connecting to",e,r),this.state=vE.CONNECTING;let n=this.buildConnectRequest($Un.CONNECT,e,r);this.socket.write(n)}buildConnectRequest(e,r,n){let{type:o,buffer:s}=hPs(r),c=BZ.alloc(4+s.length+2);return c[0]=nst,c[1]=e,c[2]=0,c[3]=o,s.copy(c,4),c.writeUInt16BE(n,4+s.length),c}handleConnectResponse(){if(this.buffer.length<4)return;let e=this.buffer[0],r=this.buffer[1],n=this.buffer[3];if(e!==nst)throw new Yj(`Invalid SOCKS version in reply: ${e}`,"UND_ERR_SOCKS5_REPLY_VERSION");let o=4;if(n===FZ.IPV4)o+=6;else if(n===FZ.DOMAIN){if(this.buffer.length<5)return;o+=1+this.buffer[4]+2}else if(n===FZ.IPV6)o+=18;else throw new Yj(`Invalid address type in reply: ${n}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length{"use strict";p();var{URL:zUn}=require("node:url"),xor,mPs=vZ(),{InvalidArgumentError:YUn}=ao(),{Socks5Client:gPs,STATES:APs}=WUn(),{kDispatch:KUn,kClose:yPs,kDestroy:EPs}=al(),_Ps=NZ(),vPs=CZ(),{debuglog:CPs}=require("node:util"),Kj=CPs("undici:socks5-proxy"),wor=Symbol("proxy url"),bPs=Symbol("proxy headers"),JUn=Symbol("proxy auth"),ZUn=Symbol("proxy protocol"),UZ=Symbol("pools"),XUn=Symbol("connector"),Ror=Symbol("request tls settings"),e7n=!1,kor=class extends mPs{static{a(this,"Socks5ProxyAgent")}constructor(e,r={}){if(super(),e7n||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),e7n=!0),!e)throw new YUn("Proxy URL is mandatory");let n=typeof e=="string"?new zUn(e):e;if(n.protocol!=="socks5:"&&n.protocol!=="socks:")throw new YUn("Proxy URL must use socks5:// or socks:// protocol");this[wor]=n,this[bPs]=r.headers||{},this[ZUn]=r.proxyTls?"https:":"http:",this[Ror]=r.requestTls,this[JUn]={username:r.username||(n.username?decodeURIComponent(n.username):null),password:r.password||(n.password?decodeURIComponent(n.password):null)},this[XUn]=r.connect||vPs({...r.proxyTls,servername:r.proxyTls?.servername||n.hostname}),this[UZ]=new Map}async createSocks5Connection(e,r){let n=this[wor].hostname,o=parseInt(this[wor].port)||1080;Kj("creating SOCKS5 connection to",n,o);let s=await new Promise((l,u)=>{this[XUn]({hostname:n,host:n,port:o,protocol:this[ZUn]},(d,f)=>{d?u(d):l(f)})}),c=new gPs(s,this[JUn]);return c.on("error",l=>{Kj("SOCKS5 error:",l),s.destroy()}),await c.handshake(),await new Promise((l,u)=>{let d=setTimeout(()=>{u(new Error("SOCKS5 authentication timeout"))},5e3),f=a(()=>{clearTimeout(d),c.removeListener("error",h),l()},"onAuthenticated"),h=a(m=>{clearTimeout(d),c.removeListener("authenticated",f),u(m)},"onError");c.state===APs.AUTHENTICATED?(clearTimeout(d),l()):(c.once("authenticated",f),c.once("error",h))}),await c.connect(e,r),await new Promise((l,u)=>{let d=setTimeout(()=>{u(new Error("SOCKS5 connection timeout"))},5e3),f=a(m=>{Kj("SOCKS5 tunnel established to",e,r,"via",m),clearTimeout(d),c.removeListener("error",h),l()},"onConnected"),h=a(m=>{clearTimeout(d),c.removeListener("connected",f),u(m)},"onError");c.once("connected",f),c.once("error",h)}),s}[KUn](e,r){let{origin:n}=e;Kj("dispatching request to",n,"via SOCKS5");try{let o=String(n),s=this[UZ].get(o);return(!s||s.destroyed||s.closed)&&(s=new _Ps(n,{pipelining:e.pipelining,connections:e.connections,connect:a(async(c,l)=>{try{let u=new zUn(n),d=u.hostname,f=parseInt(u.port)||(u.protocol==="https:"?443:80);Kj("establishing SOCKS5 connection to",d,f);let h=await this.createSocks5Connection(d,f),m=h;u.protocol==="https:"&&(xor||(xor=require("node:tls")),Kj("upgrading to TLS"),m=xor.connect({...this[Ror],socket:h,servername:this[Ror]?.servername||d}),await new Promise((g,A)=>{m.once("secureConnect",g),m.once("error",A)})),l(null,m)}catch(u){Kj("SOCKS5 connection error:",u),l(u)}},"connect")}),this[UZ].set(o,s)),s[KUn](e,r)}catch(o){if(Kj("dispatch error:",o),typeof r.onResponseError=="function")return r.onResponseError(null,o),!1;if(typeof r.onError=="function")return r.onError(o),!1;throw o}}async[yPs](){let e=[];for(let r of this[UZ].values())e.push(r.close());this[UZ].clear(),await Promise.all(e)}async[EPs](e){let r=[];for(let n of this[UZ].values())r.push(n.destroy(e));this[UZ].clear(),await Promise.all(r)}};t7n.exports=kor});var Oor=I((Vaf,p7n)=>{"use strict";p();var{kProxy:mpe,kClose:c7n,kDestroy:l7n,kDispatch:r7n}=al(),SPs=LZ(),u7n=NZ(),d7n=vZ(),{InvalidArgumentError:QZ,RequestAbortedError:TPs,SecureProxyConnectionError:IPs}=ao(),n7n=CZ(),f7n=Vj(),{channels:i7n}=Bj(),xPs=Por(),ist=Symbol("proxy agent"),Jj=Symbol("proxy client"),XF=Symbol("proxy headers"),Dor=Symbol("request tls settings"),o7n=Symbol("proxy tls settings"),s7n=Symbol("connect endpoint function"),a7n=Symbol("tunnel proxy");function wPs(t){return t==="https:"?443:80}a(wPs,"defaultProtocolPort");function RPs(t,e){return new u7n(t,e)}a(RPs,"defaultFactory");var kPs=a(()=>{},"noop");function PPs(t,e){return e.connections===1?new f7n(t,e):new u7n(t,e)}a(PPs,"defaultAgentFactory");var Nor=class extends d7n{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(!e)throw new QZ("Proxy URL is mandatory");super(),this[XF]=r,o?this.#e=o(e,{connect:n}):this.#e=new f7n(e,{connect:n})}[r7n](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new QZ("Proxy Authentication Required (407)"));return}n&&n.call(this,l,u,d)};let{origin:o,path:s="/",headers:c={}}=e;if(e.path=o+s,!("host"in c)&&!("Host"in c)){let{host:l}=new URL(o);c.host=l}return e.headers={...this[XF],...c},this.#e[r7n](e,r)}[c7n](){return this.#e.close()}[l7n](e){return this.#e.destroy(e)}},Mor=class extends d7n{static{a(this,"ProxyAgent")}constructor(e){if(!e||typeof e=="object"&&!(e instanceof URL)&&!e.uri)throw new QZ("Proxy uri is mandatory");let{clientFactory:r=RPs}=e;if(typeof r!="function")throw new QZ("Proxy opts.clientFactory must be a function.");let{proxyTunnel:n=!0}=e;super();let o=this.#e(e),{href:s,origin:c,port:l,protocol:u,username:d,password:f,hostname:h}=o;if(this[mpe]={uri:s,protocol:u},this[Dor]=e.requestTls,this[o7n]=e.proxyTls,this[XF]=e.headers||{},this[a7n]=n,e.auth&&e.token)throw new QZ("opts.auth cannot be used in combination with opts.token");e.auth?this[XF]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[XF]["proxy-authorization"]=e.token:d&&f&&(this[XF]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=n7n({...e.proxyTls});this[s7n]=n7n({...e.requestTls});let g=e.factory||PPs,A=a((y,E)=>{let{protocol:_}=new URL(y);return this[mpe].protocol==="socks5:"||this[mpe].protocol==="socks:"?new xPs(this[mpe].uri,{headers:this[XF],connect:m,factory:g,username:e.username||d,password:e.password||f,proxyTls:e.proxyTls,requestTls:e.requestTls}):!this[a7n]&&_==="http:"&&this[mpe].protocol==="http:"?new Nor(this[mpe].uri,{headers:this[XF],connect:m,factory:g}):g(y,E)},"factory");u==="socks5:"||u==="socks:"?this[Jj]=null:this[Jj]=r(o,{connect:m}),this[ist]=new SPs({...e,factory:A,connect:a(async(y,E)=>{if(!this[Jj]){E(new QZ("Cannot establish tunnel connection without a proxy client"));return}let _=y.host;y.port||(_+=`:${wPs(y.protocol)}`);try{let v={origin:c,port:l,path:_,signal:y.signal,headers:{...this[XF],host:y.host,...y.connections==null||y.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[o7n]?.servername||h},{socket:b,statusCode:T}=await this[Jj].connect(v);if(T!==200){b.on("error",kPs).destroy(),E(new TPs(`Proxy response (${T}) !== 200 when HTTP Tunneling`));return}if(i7n.proxyConnected.hasSubscribers&&i7n.proxyConnected.publish({socket:b,connectParams:v}),y.protocol!=="https:"){E(null,b);return}let w;this[Dor]?w=this[Dor].servername:w=y.servername,this[s7n]({...y,servername:w,httpSocket:b},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new IPs(v)):E(v)}},"connect")})}dispatch(e,r){let n=DPs(e.headers);if(NPs(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new URL(e.origin);n.host=o}return this[ist].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new URL(e):e instanceof URL?e:new URL(e.uri)}[c7n](){let e=[this[ist].close()];return this[Jj]&&e.push(this[Jj].close()),Promise.all(e)}[l7n](){let e=[this[ist].destroy()];return this[Jj]&&e.push(this[Jj].destroy()),Promise.all(e)}};function DPs(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new QZ("Proxy-Authorization should be sent in ProxyAgent constructor")}a(NPs,"throwIfProxyAuthIsSent");p7n.exports=Mor});var y7n=I((Yaf,A7n)=>{"use strict";p();var MPs=vZ(),{kClose:OPs,kDestroy:LPs,kClosed:h7n,kDestroyed:m7n,kDispatch:BPs,kNoProxyAgent:HPe,kHttpProxyAgent:Zj,kHttpsProxyAgent:qZ}=al(),g7n=Oor(),FPs=LZ(),UPs={"http:":80,"https:":443},Lor=class extends MPs{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e;let{httpProxy:r,httpsProxy:n,noProxy:o,...s}=e;this[HPe]=new FPs(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[Zj]=new g7n({...s,uri:c}):this[Zj]=this[HPe];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[qZ]=new g7n({...s,uri:l}):this[qZ]=this[Zj],this.#o()}[BPs](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}[OPs](){return Promise.all([this[HPe].close(),!this[Zj][h7n]&&this[Zj].close(),!this[qZ][h7n]&&this[qZ].close()])}[LPs](e){return Promise.all([this[HPe].destroy(e),!this[Zj][m7n]&&this[Zj].destroy(e),!this[qZ][m7n]&&this[qZ].destroy(e)])}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||UPs[r]||0,this.#i(n,o)?r==="https:"?this[qZ]:this[Zj]:this[HPe]}#i(e,r){if(this.#s&&this.#o(),this.#t.length===0)return!0;if(this.#e==="*")return!1;for(let n=0;n{"use strict";p();var gpe=require("node:assert"),{kRetryHandlerDefaultRetry:E7n}=al(),{RequestRetryError:GPe}=ao(),QPs=hPe(),{isDisturbed:_7n,parseRangeHeader:v7n,wrapRequestBody:qPs}=Po();function jPs(t){let e=new Date(t).getTime();return isNaN(e)?0:e-Date.now()}a(jPs,"calculateRetryAfterHeader");var Bor=class t{static{a(this,"RetryHandler")}constructor(e,{dispatch:r,handler:n}){let{retryOptions:o,...s}=e,{retry:c,maxRetries:l,maxTimeout:u,minTimeout:d,timeoutFactor:f,methods:h,errorCodes:m,retryAfter:g,statusCodes:A,throwOnError:y}=o??{};this.error=null,this.dispatch=r,this.handler=QPs.wrap(n),this.opts={...s,body:qPs(e.body)},this.retryOpts={throwOnError:y??!0,retry:c??t[E7n],retryAfter:g??!0,maxTimeout:u??30*1e3,minTimeout:d??500,timeoutFactor:f??2,maxRetries:l??5,methods:h??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:A??[500,502,503,504,429],errorCodes:m??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.headersSent=!1,this.start=0,this.end=null,this.etag=null}onResponseStartWithRetry(e,r,n,o,s){if(this.retryOpts.throwOnError){this.retryOpts.statusCodes.includes(r)===!1?(this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o)):this.error=s;return}if(_7n(this.opts.body)){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o);return}function c(l){if(l){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o),e.resume();return}this.error=s,e.resume()}a(c,"shouldRetry"),e.pause(),this.retryOpts.retry(s,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},c.bind(this))}onRequestStart(e,r){this.headersSent||this.handler.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.handler.onRequestUpgrade?.(e,r,n,o)}static[E7n](e,{state:r,opts:n},o){let{statusCode:s,code:c,headers:l}=e,{method:u,retryOptions:d}=n,{maxRetries:f,minTimeout:h,maxTimeout:m,timeoutFactor:g,statusCodes:A,errorCodes:y,methods:E}=d,{counter:_}=r;if(c&&c!=="UND_ERR_REQ_RETRY"&&!y.includes(c)){o(e);return}if(Array.isArray(E)&&!E.includes(u)){o(e);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){o(e);return}if(_>f){o(e);return}let v=l?.["retry-after"];v&&(v=Number(v),v=Number.isNaN(v)?jPs(l["retry-after"]):v*1e3);let b=v>0?Math.min(v,m):Math.min(h*g**(_-1),m);setTimeout(()=>o(null),b)}onResponseStart(e,r,n,o){if(this.error=null,this.retryCount+=1,r>=300){let s=new GPe("Request failed",r,{headers:n,data:{count:this.retryCount}});this.onResponseStartWithRetry(e,r,n,o,s);return}if(this.headersSent){if(r!==206&&(this.start>0||r!==200))throw new GPe("server does not support the range header and the payload was partially consumed",r,{headers:n,data:{count:this.retryCount}});let s=v7n(n["content-range"]);if(!s)throw new GPe("Content-Range mismatch",r,{headers:n,data:{count:this.retryCount}});if(this.etag!=null&&this.etag!==n.etag)throw new GPe("ETag mismatch",r,{headers:n,data:{count:this.retryCount}});let{start:c,size:l,end:u=l?l-1:null}=s;gpe(this.start===c,"content-range mismatch"),gpe(this.end==null||this.end===u,"content-range mismatch");return}if(this.end==null){if(r===206){let s=v7n(n["content-range"]);if(s==null){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o);return}let{start:c,size:l,end:u=l?l-1:null}=s;gpe(c!=null&&Number.isFinite(c),"content-range mismatch"),gpe(u!=null&&Number.isFinite(u),"invalid content-length"),this.start=c,this.end=u}if(this.end==null){let s=n["content-length"];this.end=s!=null?Number(s)-1:null}gpe(Number.isFinite(this.start)),gpe(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=!0,this.etag=n.etag!=null?n.etag:null,this.etag!=null&&this.etag[0]==="W"&&this.etag[1]==="/"&&(this.etag=null),this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o)}else throw new GPe("Request failed",r,{headers:n,data:{count:this.retryCount}})}onResponseData(e,r){this.error||(this.start+=r.length,this.handler.onResponseData?.(e,r))}onResponseEnd(e,r){if(this.error&&this.retryOpts.throwOnError)throw this.error;if(!this.error)return this.retryCount=0,this.handler.onResponseEnd?.(e,r);this.retry(e)}retry(e){if(this.start!==0){let r={range:`bytes=${this.start}-${this.end??""}`};this.etag!=null&&(r["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...r}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(r){this.handler.onResponseError?.(e,r)}}onResponseError(e,r){if(e?.aborted||_7n(this.opts.body)){this.handler.onResponseError?.(e,r);return}function n(o){if(!o){this.retry(e);return}this.handler?.onResponseError?.(e,o)}a(n,"shouldRetry"),this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(r,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},n.bind(this))}};C7n.exports=Bor});var S7n=I((tcf,b7n)=>{"use strict";p();var HPs=mPe(),GPs=ost(),For=class extends HPs{static{a(this,"RetryAgent")}#e=null;#t=null;constructor(e,r={}){super(r),this.#e=e,this.#t=r}dispatch(e,r){let n=new GPs({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:r});return this.#e.dispatch(e,n)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}};b7n.exports=For});var x7n=I((icf,I7n)=>{"use strict";p();var{InvalidArgumentError:T7n}=ao(),$Ps=Vj(),Uor=class extends $Ps{static{a(this,"H2CClient")}constructor(e,r){if(typeof e=="string"&&(e=new URL(e)),e.protocol!=="http:")throw new T7n("h2c-client: Only h2c protocol is supported");let{maxConcurrentStreams:n,pipelining:o,...s}=r??{},c=100,l=100;if(n!=null&&Number.isInteger(n)&&n>0&&(c=n),o!=null&&Number.isInteger(o)&&o>0&&(l=o),l>c)throw new T7n("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(e,{...s,maxConcurrentStreams:c,pipelining:l,allowH2:!0,useH2c:!0})}};I7n.exports=Uor});var L7n=I((acf,O7n)=>{"use strict";p();var P7n=require("node:assert"),{Readable:VPs}=require("node:stream"),{RequestAbortedError:D7n,NotSupportedError:WPs,InvalidArgumentError:zPs,AbortError:sst}=ao(),N7n=Po(),{ReadableStreamFrom:YPs}=Po(),bT=Symbol("kConsume"),ast=Symbol("kReading"),jZ=Symbol("kBody"),w7n=Symbol("kAbort"),M7n=Symbol("kContentType"),Qor=Symbol("kContentLength"),qor=Symbol("kUsed"),cst=Symbol("kBytesRead"),KPs=a(()=>{},"noop"),jor=class extends VPs{static{a(this,"BodyReadable")}constructor({resume:e,abort:r,contentType:n="",contentLength:o,highWaterMark:s=64*1024}){super({autoDestroy:!0,read:e,highWaterMark:s}),this._readableState.dataEmitted=!1,this[w7n]=r,this[bT]=null,this[cst]=0,this[jZ]=null,this[qor]=!1,this[M7n]=n,this[Qor]=Number.isFinite(o)?o:null,this[ast]=!1}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new D7n),e&&this[w7n](),this[qor]?r(e):setImmediate(r,e)}on(e,r){return(e==="data"||e==="readable")&&(this[ast]=!0,this[qor]=!0),super.on(e,r)}addListener(e,r){return this.on(e,r)}off(e,r){let n=super.off(e,r);return(e==="data"||e==="readable")&&(this[ast]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,r){return this.off(e,r)}push(e){return e&&(this[cst]+=e.length,this[bT])?(Gor(this[bT],e),this[ast]?super.push(e):!0):super.push(e)}text(){return $Pe(this,"text")}json(){return $Pe(this,"json")}blob(){return $Pe(this,"blob")}bytes(){return $Pe(this,"bytes")}arrayBuffer(){return $Pe(this,"arrayBuffer")}async formData(){throw new WPs}get bodyUsed(){return N7n.isDisturbed(this)}get body(){return this[jZ]||(this[jZ]=YPs(this),this[bT]&&(this[jZ].getReader(),P7n(this[jZ].locked))),this[jZ]}dump(e){let r=e?.signal;if(r!=null&&(typeof r!="object"||!("aborted"in r)))return Promise.reject(new zPs("signal must be an AbortSignal"));let n=e?.limit&&Number.isFinite(e.limit)?e.limit:128*1024;return r?.aborted?Promise.reject(r.reason??new sst):this._readableState.closeEmitted?Promise.resolve(null):new Promise((o,s)=>{if((this[Qor]&&this[Qor]>n||this[cst]>n)&&this.destroy(new sst),r){let c=a(()=>{this.destroy(r.reason??new sst)},"onAbort");r.addEventListener("abort",c),this.on("close",function(){r.removeEventListener("abort",c),r.aborted?s(r.reason??new sst):o(null)})}else this.on("close",o);this.on("error",KPs).on("data",()=>{this[cst]>n&&this.destroy()}).resume()})}setEncoding(e){return Buffer.isEncoding(e)&&(this._readableState.encoding=e),this}};function JPs(t){return t[jZ]?.locked===!0||t[bT]!==null}a(JPs,"isLocked");function ZPs(t){return N7n.isDisturbed(t)||JPs(t)}a(ZPs,"isUnusable");function $Pe(t,e){return P7n(!t[bT]),new Promise((r,n)=>{if(ZPs(t)){let o=t._readableState;o.destroyed&&o.closeEmitted===!1?t.on("error",n).on("close",()=>{n(new TypeError("unusable"))}):n(o.errored??new TypeError("unusable"))}else queueMicrotask(()=>{t[bT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){$or(this[bT],o)}).on("close",function(){this[bT].body!==null&&$or(this[bT],new D7n)}),XPs(t[bT])})})}a($Pe,"consume");function XPs(t){if(t.body===null)return;let{_readableState:e}=t.stream;if(e.bufferIndex){let r=e.bufferIndex,n=e.buffer.length;for(let o=r;o2&&n[0]===239&&n[1]===187&&n[2]===191?3:0;return!r||r==="utf8"||r==="utf-8"?n.utf8Slice(s,o):n.subarray(s,o).toString(r)}a(Hor,"chunksDecode");function R7n(t,e){if(t.length===0||e===0)return new Uint8Array(0);if(t.length===1)return new Uint8Array(t[0]);let r=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer),n=0;for(let o=0;o{"use strict";p();var e2s=require("node:assert"),{AsyncResource:t2s}=require("node:async_hooks"),{Readable:r2s}=L7n(),{InvalidArgumentError:Ape,RequestAbortedError:B7n}=ao(),qw=Po();function VPe(){}a(VPe,"noop");var lst=class extends t2s{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Ape("invalid opts");let{signal:n,method:o,opaque:s,body:c,onInfo:l,responseHeaders:u,highWaterMark:d}=e;try{if(typeof r!="function")throw new Ape("invalid callback");if(d!=null&&(!Number.isFinite(d)||d<0))throw new Ape("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Ape("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Ape("invalid method");if(l&&typeof l!="function")throw new Ape("invalid onInfo callback");super("UNDICI_REQUEST")}catch(f){throw qw.isStream(c)&&qw.destroy(c.on("error",VPe),f),f}this.method=o,this.responseHeaders=u||null,this.opaque=s||null,this.callback=r,this.res=null,this.abort=null,this.body=c,this.trailers={},this.context=null,this.onInfo=l||null,this.highWaterMark=d,this.reason=null,this.removeAbortListener=null,n?.aborted?this.reason=n.reason??new B7n:n&&(this.removeAbortListener=qw.addAbortListener(n,()=>{this.reason=n.reason??new B7n,this.res?qw.destroy(this.res.on("error",VPe),this.reason):this.abort&&this.abort(this.reason)}))}onConnect(e,r){if(this.reason){e(this.reason);return}e2s(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{callback:s,opaque:c,abort:l,context:u,responseHeaders:d,highWaterMark:f}=this,h=d==="raw"?qw.parseRawHeaders(r):qw.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?qw.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new r2s({resume:n,abort:l,contentType:g,contentLength:this.method!=="HEAD"&&A?Number(A):null,highWaterMark:f});if(this.removeAbortListener&&(y.on("close",this.removeAbortListener),this.removeAbortListener=null),this.callback=null,this.res=y,s!==null)try{this.runInAsyncScope(s,null,null,{statusCode:e,statusText:o,headers:h,trailers:this.trailers,opaque:c,body:y,context:u})}catch(E){this.res=null,qw.destroy(y.on("error",VPe),E),queueMicrotask(()=>{throw E})}}onData(e){return this.res.push(e)}onComplete(e){qw.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:r,callback:n,body:o,opaque:s}=this;n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:s})})),r&&(this.res=null,queueMicrotask(()=>{qw.destroy(r.on("error",VPe),e)})),o&&(this.body=null,qw.isStream(o)&&(o.on("error",VPe),qw.destroy(o,e))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}};function F7n(t,e){if(e===void 0)return new Promise((r,n)=>{F7n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new lst(t,e);this.dispatch(t,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(F7n,"request");Vor.exports=F7n;Vor.exports.RequestHandler=lst});var WPe=I((pcf,j7n)=>{"use strict";p();var{addAbortListener:n2s}=Po(),{RequestAbortedError:i2s}=ao(),ype=Symbol("kListener"),O5=Symbol("kSignal");function Q7n(t){t.abort?t.abort(t[O5]?.reason):t.reason=t[O5]?.reason??new i2s,q7n(t)}a(Q7n,"abort");function o2s(t,e){if(t.reason=null,t[O5]=null,t[ype]=null,!!e){if(e.aborted){Q7n(t);return}t[O5]=e,t[ype]=()=>{Q7n(t)},n2s(t[O5],t[ype])}}a(o2s,"addSignal");function q7n(t){t[O5]&&("removeEventListener"in t[O5]?t[O5].removeEventListener("abort",t[ype]):t[O5].removeListener("abort",t[ype]),t[O5]=null,t[ype]=null)}a(q7n,"removeSignal");j7n.exports={addSignal:o2s,removeSignal:q7n}});var V7n=I((gcf,$7n)=>{"use strict";p();var s2s=require("node:assert"),{finished:a2s}=require("node:stream"),{AsyncResource:c2s}=require("node:async_hooks"),{InvalidArgumentError:Epe,InvalidReturnValueError:l2s}=ao(),e8=Po(),{addSignal:u2s,removeSignal:H7n}=WPe();function d2s(){}a(d2s,"noop");var Wor=class extends c2s{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new Epe("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d}=e;try{if(typeof n!="function")throw new Epe("invalid callback");if(typeof r!="function")throw new Epe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new Epe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new Epe("invalid method");if(u&&typeof u!="function")throw new Epe("invalid onInfo callback");super("UNDICI_STREAM")}catch(f){throw e8.isStream(l)&&e8.destroy(l.on("error",d2s),f),f}this.responseHeaders=d||null,this.opaque=c||null,this.factory=r,this.callback=n,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=l,this.onInfo=u||null,e8.isStream(l)&&l.on("error",f=>{this.onError(f)}),u2s(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}s2s(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{factory:s,opaque:c,context:l,responseHeaders:u}=this,d=u==="raw"?e8.parseRawHeaders(r):e8.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:d});return}if(this.factory=null,s===null)return;let f=this.runInAsyncScope(s,null,{statusCode:e,headers:d,opaque:c,context:l});if(!f||typeof f.write!="function"||typeof f.end!="function"||typeof f.on!="function")throw new l2s("expected Writable");return a2s(f,{readable:!1},m=>{let{callback:g,res:A,opaque:y,trailers:E,abort:_}=this;this.res=null,(m||!A?.readable)&&e8.destroy(A,m),this.callback=null,this.runInAsyncScope(g,null,m||null,{opaque:y,trailers:E}),m&&_()}),f.on("drain",n),this.res=f,(f.writableNeedDrain!==void 0?f.writableNeedDrain:f._writableState?.needDrain)!==!0}onData(e){let{res:r}=this;return r?r.write(e):!0}onComplete(e){let{res:r}=this;H7n(this),r&&(this.trailers=e8.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;H7n(this),this.factory=null,r?(this.res=null,e8.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,e8.destroy(s,e))}};function G7n(t,e,r){if(r===void 0)return new Promise((n,o)=>{G7n.call(this,t,e,(s,c)=>s?o(s):n(c))});try{let n=new Wor(t,e,r);this.dispatch(t,n)}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(G7n,"stream");$7n.exports=G7n});var K7n=I((Ecf,Y7n)=>{"use strict";p();var{Readable:z7n,Duplex:f2s,PassThrough:p2s}=require("node:stream"),h2s=require("node:assert"),{AsyncResource:m2s}=require("node:async_hooks"),{InvalidArgumentError:zPe,InvalidReturnValueError:g2s,RequestAbortedError:zor}=ao(),L5=Po(),{addSignal:A2s,removeSignal:y2s}=WPe();function W7n(){}a(W7n,"noop");var _pe=Symbol("resume"),Yor=class extends z7n{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[_pe]=null}_read(){let{[_pe]:e}=this;e&&(this[_pe]=null,e())}_destroy(e,r){this._read(),r(e)}},Kor=class extends z7n{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[_pe]=e}_read(){this[_pe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new zor),r(e)}},Jor=class extends m2s{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new zPe("invalid opts");if(typeof r!="function")throw new zPe("invalid handler");let{signal:n,method:o,opaque:s,onInfo:c,responseHeaders:l}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new zPe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new zPe("invalid method");if(c&&typeof c!="function")throw new zPe("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=s||null,this.responseHeaders=l||null,this.handler=r,this.abort=null,this.context=null,this.onInfo=c||null,this.req=new Yor().on("error",W7n),this.ret=new f2s({readableObjectMode:e.objectMode,autoDestroy:!0,read:a(()=>{let{body:u}=this;u?.resume&&u.resume()},"read"),write:a((u,d,f)=>{let{req:h}=this;h.push(u,d)||h._readableState.destroyed?f():h[_pe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new zor),A&&u&&A(),L5.destroy(f,u),L5.destroy(h,u),L5.destroy(m,u),y2s(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,A2s(this,n)}onConnect(e,r){let{res:n}=this;if(this.reason){e(this.reason);return}h2s(!n,"pipeline cannot be retried"),this.abort=e,this.context=r}onHeaders(e,r,n){let{opaque:o,handler:s,context:c}=this;if(e<200){if(this.onInfo){let u=this.responseHeaders==="raw"?L5.parseRawHeaders(r):L5.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new Kor(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?L5.parseRawHeaders(r):L5.parseHeaders(r);l=this.runInAsyncScope(s,null,{statusCode:e,headers:u,opaque:o,body:this.res,context:c})}catch(u){throw this.res.on("error",W7n),u}if(!l||typeof l.on!="function")throw new g2s("expected Readable");l.on("data",u=>{let{ret:d,body:f}=this;!d.push(u)&&f.pause&&f.pause()}).on("error",u=>{let{ret:d}=this;L5.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||L5.destroy(u,new zor)}),this.body=l}onData(e){let{res:r}=this;return r.push(e)}onComplete(e){let{res:r}=this;r.push(null)}onError(e){let{ret:r}=this;this.handler=null,L5.destroy(r,e)}};function E2s(t,e){try{let r=new Jor(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new p2s().destroy(r)}}a(E2s,"pipeline");Y7n.exports=E2s});var rQn=I((Ccf,tQn)=>{"use strict";p();var{InvalidArgumentError:Zor,SocketError:_2s}=ao(),{AsyncResource:v2s}=require("node:async_hooks"),J7n=require("node:assert"),Z7n=Po(),{kHTTP2Stream:C2s}=al(),{addSignal:b2s,removeSignal:X7n}=WPe(),Xor=class extends v2s{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Zor("invalid opts");if(typeof r!="function")throw new Zor("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Zor("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=s||null,this.opaque=o||null,this.callback=r,this.abort=null,this.context=null,b2s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}J7n(this.callback),this.abort=e,this.context=null}onHeaders(){throw new _2s("bad upgrade",null)}onUpgrade(e,r,n){J7n(n[C2s]===!0?e===200:e===101);let{callback:o,opaque:s,context:c}=this;X7n(this),this.callback=null;let l=this.responseHeaders==="raw"?Z7n.parseRawHeaders(r):Z7n.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;X7n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function eQn(t,e){if(e===void 0)return new Promise((r,n)=>{eQn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Xor(t,e),n={...t,method:t.method||"GET",upgrade:t.protocol||"Websocket"};this.dispatch(n,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(eQn,"upgrade");tQn.exports=eQn});var aQn=I((Tcf,sQn)=>{"use strict";p();var S2s=require("node:assert"),{AsyncResource:T2s}=require("node:async_hooks"),{InvalidArgumentError:esr,SocketError:I2s}=ao(),nQn=Po(),{addSignal:x2s,removeSignal:iQn}=WPe(),tsr=class extends T2s{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new esr("invalid opts");if(typeof r!="function")throw new esr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new esr("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,x2s(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}S2s(this.callback),this.abort=e,this.context=r}onHeaders(){throw new I2s("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;iQn(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?nQn.parseRawHeaders(r):nQn.parseHeaders(r)),this.runInAsyncScope(o,null,null,{statusCode:e,headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;iQn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function oQn(t,e){if(e===void 0)return new Promise((r,n)=>{oQn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new tsr(t,e),n={...t,method:"CONNECT"};this.dispatch(n,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(oQn,"connect");sQn.exports=oQn});var cQn=I((wcf,vpe)=>{"use strict";p();vpe.exports.request=U7n();vpe.exports.stream=V7n();vpe.exports.pipeline=K7n();vpe.exports.upgrade=rQn();vpe.exports.connect=aQn()});var nsr=I((kcf,uQn)=>{"use strict";p();var{UndiciError:w2s}=ao(),lQn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),rsr=class extends w2s{static{a(this,"MockNotMatchedError")}constructor(e){super(e),this.name="MockNotMatchedError",this.message=e||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](e){return e&&e[lQn]===!0}get[lQn](){return!0}};uQn.exports={MockNotMatchedError:rsr}});var HZ=I((Ncf,dQn)=>{"use strict";p();dQn.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOriginalDispatch:Symbol("original dispatch"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected"),kIgnoreTrailingSlash:Symbol("ignore trailing slash"),kMockAgentMockCallHistoryInstance:Symbol("mock agent mock call history name"),kMockAgentRegisterCallHistory:Symbol("mock agent register mock call history"),kMockAgentAddCallHistoryLog:Symbol("mock agent add call history log"),kMockAgentIsCallHistoryEnabled:Symbol("mock agent is call history enabled"),kMockAgentAcceptsNonStandardSearchParameters:Symbol("mock agent accepts non standard search parameters"),kMockCallHistoryAddLog:Symbol("mock call history add log"),kTotalDispatchCount:Symbol("total dispatch count")}});var YPe=I((Ocf,CQn)=>{"use strict";p();var{MockNotMatchedError:Cpe}=nsr(),{kDispatches:GZ,kMockAgent:R2s,kOriginalDispatch:k2s,kOrigin:P2s,kGetNetConnect:D2s,kTotalDispatchCount:ssr}=HZ(),{serializePathWithQuery:N2s}=Po(),{STATUS_CODES:M2s}=require("node:http"),{types:{isPromise:O2s}}=require("node:util"),{InvalidArgumentError:isr}=ao();function B5(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(B5,"matchValue");function pQn(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(pQn,"lowerCaseEntries");function hQn(t,e){if(Array.isArray(t)){for(let r=0;r"u")return!0;if(typeof e!="object"||typeof t.headers!="object")return!1;for(let[r,n]of Object.entries(t.headers)){let o=hQn(e,r);if(!B5(n,o))return!1}return!0}a(mQn,"matchHeaders");function L2s(t){if(typeof t!="string")return t;let e=new URLSearchParams(t),r=new URLSearchParams;for(let[n,o]of e.entries()){if(n=n.replace("[]",""),/^(['"]).*\1$/.test(o)){r.append(n,o);continue}if(o.includes(",")){let c=o.split(",");for(let l of c)r.append(n,l);continue}r.append(n,o)}return r}a(L2s,"normalizeSearchParams");function osr(t){if(typeof t!="string")return t;let e=t.split("?",3);if(e.length!==2)return t;let r=new URLSearchParams(e.pop());return r.sort(),[...e,r.toString()].join("?")}a(osr,"safeUrl");function B2s(t,{path:e,method:r,body:n,headers:o}){let s=B5(t.path,e),c=B5(t.method,r),l=typeof t.body<"u"?B5(t.body,n):!0,u=mQn(t,o);return s&&c&&l&&u}a(B2s,"matchKey");function gQn(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t?t.toString():""}a(gQn,"getResponseData");function AQn(t,e){let r=e.query?N2s(e.path,e.query):e.path,n=typeof r=="string"?osr(r):r,o=fQn(n),s=t.filter(({consumed:c})=>!c).filter(({path:c,ignoreTrailingSlash:l})=>l?B5(fQn(osr(c)),o):B5(osr(c),n));if(s.length===0)throw new Cpe(`Mock dispatch not matched for path '${n}'`);if(s=s.filter(({method:c})=>B5(c,e.method)),s.length===0)throw new Cpe(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(s=s.filter(({body:c})=>typeof c<"u"?B5(c,e.body):!0),s.length===0)throw new Cpe(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(s=s.filter(c=>mQn(c,e.headers)),s.length===0){let c=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new Cpe(`Mock dispatch not matched for headers '${c}' on path '${n}'`)}return s[0]}a(AQn,"getMockDispatch");function F2s(t,e,r,n){let o={timesInvoked:0,times:1,persist:!1,consumed:!1,...n},s=typeof r=="function"?{callback:r}:{...r},c={...o,...e,pending:!0,data:{error:null,...s}};return t.push(c),t[ssr]=(t[ssr]||0)+1,c}a(F2s,"addMockDispatch");function asr(t,e){let r=t.findIndex(n=>n.consumed?B2s(n,e):!1);r!==-1&&t.splice(r,1)}a(asr,"deleteMockDispatch");function fQn(t){for(;t.endsWith("/");)t=t.slice(0,-1);return t.length===0&&(t="/"),t}a(fQn,"removeTrailingSlash");function yQn(t){let{path:e,method:r,body:n,headers:o,query:s}=t;return{path:e,method:r,body:n,headers:o,query:s}}a(yQn,"buildKey");function csr(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?A=setTimeout(()=>{A=null,E(this[GZ])},d):E(this[GZ]);function E(v,b=s){if(g)return;let T=Array.isArray(t.headers)?lsr(t.headers):t.headers,w=typeof b=="function"?b({...t,headers:T}):b;if(O2s(w))return w.then(D=>E(v,D));if(g)return;let R=gQn(w),x=csr(c),P=csr(l);e.onHeaders?.(o,x,_,EQn(o)),e.onData?.(Buffer.from(R)),e.onComplete?.(P),asr(v,r)}a(E,"handleReply");function _(){}return a(_,"resume"),!0}a(_Qn,"mockDispatch");function Q2s(){let t=this[R2s],e=this[P2s],r=this[k2s];return a(function(o,s){if(t.isMockActive)try{_Qn.call(this,o,s)}catch(c){if(c.code==="UND_MOCK_ERR_MOCK_NOT_MATCHED"){let l=t[D2s](),u=this[GZ][ssr]||this[GZ].length,f=`, ${this[GZ].filter(({consumed:h})=>!h).length} interceptor(s) remaining out of ${u} defined`;if(l===!1)throw new Cpe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)${f}`);if(vQn(l,e))r.call(this,o,s);else throw new Cpe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect is not enabled for this origin)${f}`)}else throw c}else r.call(this,o,s)},"dispatch")}a(Q2s,"buildMockDispatch");function vQn(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>B5(n,r.host)))}a(vQn,"checkNetConnect");function q2s(t){return typeof t!="string"&&!(t instanceof URL)?t:t instanceof URL?t.origin:t.toLowerCase()}a(q2s,"normalizeOrigin");function j2s(t){let{agent:e,...r}=t;if("enableCallHistory"in r&&typeof r.enableCallHistory!="boolean")throw new isr("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in r&&typeof r.acceptNonStandardSearchParameters!="boolean")throw new isr("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in r&&typeof r.ignoreTrailingSlash!="boolean")throw new isr("options.ignoreTrailingSlash must to be a boolean");return r}a(j2s,"buildAndValidateMockOptions");CQn.exports={getResponseData:gQn,getMockDispatch:AQn,addMockDispatch:F2s,deleteMockDispatch:asr,buildKey:yQn,generateKeyValues:csr,matchValue:B5,getResponse:U2s,getStatusText:EQn,mockDispatch:_Qn,buildMockDispatch:Q2s,checkNetConnect:vQn,buildAndValidateMockOptions:j2s,getHeaderByName:hQn,buildHeadersFromArray:lsr,normalizeSearchParams:L2s,normalizeOrigin:q2s}});var gsr=I((Fcf,msr)=>{"use strict";p();var{getResponseData:H2s,buildKey:G2s,addMockDispatch:usr}=YPe(),{kDispatches:ust,kDispatchKey:dst,kDefaultHeaders:dsr,kDefaultTrailers:fsr,kContentLength:psr,kMockDispatch:fst,kIgnoreTrailingSlash:pst}=HZ(),{InvalidArgumentError:F5}=ao(),{serializePathWithQuery:$2s}=Po(),bpe=class{static{a(this,"MockScope")}constructor(e){this[fst]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new F5("waitInMs must be a valid integer > 0");return this[fst].delay=e,this}persist(){return this[fst].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new F5("repeatTimes must be a valid integer > 0");return this[fst].times=e,this}},hsr=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new F5("opts must be an object");if(typeof e.path>"u")throw new F5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=$2s(e.path,e.query);else{let n=new URL(e.path,"data://");e.path=n.pathname+n.search}typeof e.method=="string"&&(e.method=e.method.toUpperCase()),this[dst]=G2s(e),this[ust]=r,this[pst]=e.ignoreTrailingSlash??!1,this[dsr]={},this[fsr]={},this[psr]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=H2s(r),s=this[psr]?{"content-length":o.length}:{},c={...this[dsr],...s,...n.headers},l={...this[fsr],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new F5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new F5("responseOptions must be an object")}reply(e){if(typeof e=="function"){let s=a(l=>{let u=e(l);if(typeof u!="object"||u===null)throw new F5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=usr(this[ust],this[dst],s,{ignoreTrailingSlash:this[pst]});return new bpe(c)}let r={statusCode:e,data:arguments[1]===void 0?"":arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(r);let n=this.createMockScopeDispatchData(r),o=usr(this[ust],this[dst],n,{ignoreTrailingSlash:this[pst]});return new bpe(o)}replyWithError(e){if(typeof e>"u")throw new F5("error must be defined");let r=usr(this[ust],this[dst],{error:e},{ignoreTrailingSlash:this[pst]});return new bpe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new F5("headers must be defined");return this[dsr]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new F5("trailers must be defined");return this[fsr]=e,this}replyContentLength(){return this[psr]=!0,this}};msr.exports.MockInterceptor=hsr;msr.exports.MockScope=bpe});var _sr=I((qcf,RQn)=>{"use strict";p();var{promisify:V2s}=require("node:util"),W2s=Vj(),{buildMockDispatch:z2s}=YPe(),{kDispatches:Asr,kMockAgent:bQn,kClose:SQn,kOriginalClose:TQn,kOrigin:IQn,kOriginalDispatch:Y2s,kConnected:ysr,kIgnoreTrailingSlash:xQn}=HZ(),{MockInterceptor:K2s}=gsr(),wQn=al(),{InvalidArgumentError:J2s}=ao(),Esr=class extends W2s{static{a(this,"MockClient")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new J2s("Argument opts.agent must implement Agent");super(e,r),this[bQn]=r.agent,this[IQn]=e,this[xQn]=r.ignoreTrailingSlash??!1,this[Asr]=[],this[ysr]=1,this[Y2s]=this.dispatch,this[TQn]=this.close.bind(this),this.dispatch=z2s.call(this),this.close=this[SQn]}get[wQn.kConnected](){return this[ysr]}intercept(e){return new K2s(e&&{ignoreTrailingSlash:this[xQn],...e},this[Asr])}cleanMocks(){this[Asr]=[]}async[SQn](){await V2s(this[TQn])(),this[ysr]=0,this[bQn][wQn.kClients].delete(this[IQn])}};RQn.exports=Esr});var bsr=I((Gcf,Csr)=>{"use strict";p();var{kMockCallHistoryAddLog:Z2s}=HZ(),{InvalidArgumentError:tH}=ao();function Xj(t,e,r,n,o){switch(e.operator){case"OR":return n.push(...r(t,o)),n;case"AND":return r(t,n);default:throw new tH("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}a(Xj,"handleFilterCallsWithOptions");function X2s(t={}){let e={};if("operator"in t){if(typeof t.operator!="string"||t.operator.toUpperCase()!=="OR"&&t.operator.toUpperCase()!=="AND")throw new tH("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...e,operator:t.operator.toUpperCase()}}return e}a(X2s,"buildAndValidateFilterCallsOptions");function eH(t){return(e,r)=>{if(typeof e=="string"||e==null)return r.filter(n=>n[t]===e);if(e instanceof RegExp)return r.filter(n=>e.test(n[t]));throw new tH(`${t} parameter should be one of string, regexp, undefined or null`)}}a(eH,"makeFilterCalls");function eDs(t){try{let e=new URL(t.path,t.origin);return e.search.length!==0||(e.search=new URLSearchParams(t.query).toString()),e}catch(e){throw new tH("An error occurred when computing MockCallHistoryLog.url",{cause:e})}}a(eDs,"computeUrlWithMaybeSearchParameters");var hst=class{static{a(this,"MockCallHistoryLog")}constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;let r=eDs(e);this.fullUrl=r.toString(),this.origin=r.origin,this.path=r.pathname,this.searchParams=Object.fromEntries(r.searchParams),this.protocol=r.protocol,this.host=r.host,this.port=r.port,this.hash=r.hash}toMap(){return new Map([["protocol",this.protocol],["host",this.host],["port",this.port],["origin",this.origin],["path",this.path],["hash",this.hash],["searchParams",this.searchParams],["fullUrl",this.fullUrl],["method",this.method],["body",this.body],["headers",this.headers]])}toString(){let e={betweenKeyValueSeparator:"->",betweenPairSeparator:"|"},r="";return this.toMap().forEach((n,o)=>{(typeof n=="string"||n===void 0||n===null)&&(r=`${r}${o}${e.betweenKeyValueSeparator}${n}${e.betweenPairSeparator}`),(typeof n=="object"&&n!==null||Array.isArray(n))&&(r=`${r}${o}${e.betweenKeyValueSeparator}${JSON.stringify(n)}${e.betweenPairSeparator}`)}),r.slice(0,-1)}},vsr=class{static{a(this,"MockCallHistory")}logs=[];calls(){return this.logs}firstCall(){return this.logs.at(0)}lastCall(){return this.logs.at(-1)}nthCall(e){if(typeof e!="number")throw new tH("nthCall must be called with a number");if(!Number.isInteger(e))throw new tH("nthCall must be called with an integer");if(Math.sign(e)!==1)throw new tH("nthCall must be called with a positive value. use firstCall or lastCall instead");return this.logs.at(e-1)}filterCalls(e,r){if(this.logs.length===0)return this.logs;if(typeof e=="function")return this.logs.filter(e);if(e instanceof RegExp)return this.logs.filter(n=>e.test(n.toString()));if(typeof e=="object"&&e!==null){if(Object.keys(e).length===0)return this.logs;let n={operator:"OR",...X2s(r)},o=n.operator==="AND"?this.logs:[];return"protocol"in e&&(o=Xj(e.protocol,n,this.filterCallsByProtocol,o,this.logs)),"host"in e&&(o=Xj(e.host,n,this.filterCallsByHost,o,this.logs)),"port"in e&&(o=Xj(e.port,n,this.filterCallsByPort,o,this.logs)),"origin"in e&&(o=Xj(e.origin,n,this.filterCallsByOrigin,o,this.logs)),"path"in e&&(o=Xj(e.path,n,this.filterCallsByPath,o,this.logs)),"hash"in e&&(o=Xj(e.hash,n,this.filterCallsByHash,o,this.logs)),"fullUrl"in e&&(o=Xj(e.fullUrl,n,this.filterCallsByFullUrl,o,this.logs)),"method"in e&&(o=Xj(e.method,n,this.filterCallsByMethod,o,this.logs)),[...new Set(o)]}throw new tH("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=eH.call(this,"protocol");filterCallsByHost=eH.call(this,"host");filterCallsByPort=eH.call(this,"port");filterCallsByOrigin=eH.call(this,"origin");filterCallsByPath=eH.call(this,"path");filterCallsByHash=eH.call(this,"hash");filterCallsByFullUrl=eH.call(this,"fullUrl");filterCallsByMethod=eH.call(this,"method");clear(){this.logs=[]}[Z2s](e){let r=new hst(e);return this.logs.push(r),r}*[Symbol.iterator](){for(let e of this.calls())yield e}};Csr.exports.MockCallHistory=vsr;Csr.exports.MockCallHistoryLog=hst});var xsr=I((Wcf,LQn)=>{"use strict";p();var{promisify:tDs}=require("node:util"),rDs=NZ(),{buildMockDispatch:nDs}=YPe(),{kDispatches:Ssr,kMockAgent:kQn,kClose:PQn,kOriginalClose:DQn,kOrigin:NQn,kOriginalDispatch:iDs,kConnected:Tsr,kIgnoreTrailingSlash:MQn}=HZ(),{MockInterceptor:oDs}=gsr(),OQn=al(),{InvalidArgumentError:sDs}=ao(),Isr=class extends rDs{static{a(this,"MockPool")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new sDs("Argument opts.agent must implement Agent");super(e,r),this[kQn]=r.agent,this[NQn]=e,this[MQn]=r.ignoreTrailingSlash??!1,this[Ssr]=[],this[Tsr]=1,this[iDs]=this.dispatch,this[DQn]=this.close.bind(this),this.dispatch=nDs.call(this),this.close=this[PQn]}get[OQn.kConnected](){return this[Tsr]}intercept(e){return new oDs(e&&{ignoreTrailingSlash:this[MQn],...e},this[Ssr])}cleanMocks(){this[Ssr]=[]}async[PQn](){await tDs(this[DQn])(),this[Tsr]=0,this[kQn][OQn.kClients].delete(this[NQn])}};LQn.exports=Isr});var FQn=I((Jcf,BQn)=>{"use strict";p();var{Transform:aDs}=require("node:stream"),{Console:cDs}=require("node:console"),lDs=process.versions.icu?"\u2705":"Y ",uDs=process.versions.icu?"\u274C":"N ";BQn.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new aDs({transform(r,n,o){o(null,r)}}),this.logger=new cDs({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let r=e.map(({method:n,path:o,data:{statusCode:s},persist:c,times:l,timesInvoked:u,origin:d})=>({Method:n,Origin:d,Path:o,"Status code":s,Persistent:c?lDs:uDs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var Dsr=I((elf,$Qn)=>{"use strict";p();var{kClients:$Z}=al(),dDs=LZ(),{kAgent:wsr,kMockAgentSet:mst,kMockAgentGet:UQn,kDispatches:Rsr,kIsMockActive:gst,kNetConnect:VZ,kGetNetConnect:fDs,kOptions:Ast,kFactory:yst,kMockAgentRegisterCallHistory:ksr,kMockAgentIsCallHistoryEnabled:KPe,kMockAgentAddCallHistoryLog:QQn,kMockAgentMockCallHistoryInstance:Spe,kMockAgentAcceptsNonStandardSearchParameters:qQn,kMockCallHistoryAddLog:pDs,kIgnoreTrailingSlash:jQn}=HZ(),hDs=_sr(),mDs=xsr(),{matchValue:gDs,normalizeSearchParams:ADs,buildAndValidateMockOptions:yDs,normalizeOrigin:HQn}=YPe(),{InvalidArgumentError:GQn,UndiciError:EDs}=ao(),_Ds=mPe(),vDs=FQn(),{MockCallHistory:CDs}=bsr(),Psr=class extends _Ds{static{a(this,"MockAgent")}constructor(e={}){super(e);let r=yDs(e);if(this[VZ]=!0,this[gst]=!0,this[KPe]=r.enableCallHistory??!1,this[qQn]=r.acceptNonStandardSearchParameters??!1,this[jQn]=r.ignoreTrailingSlash??!1,e?.agent&&typeof e.agent.dispatch!="function")throw new GQn("Argument opts.agent must implement Agent");let n=e?.agent?e.agent:new dDs(e);this[wsr]=n,this[$Z]=n[$Z],this[Ast]=r,this[KPe]&&this[ksr]()}get(e){let r=HQn(e),n=this[jQn]?r.replace(/\/$/,""):r,o=this[UQn](n);return o||(o=this[yst](n),this[mst](n,o)),o}dispatch(e,r){e.origin=HQn(e.origin),this.get(e.origin),this[QQn](e);let n=this[qQn],o={...e};if(n&&o.path){let[s,c]=o.path.split("?"),l=ADs(c,n);o.path=`${s}?${l}`}return this[wsr].dispatch(o,r)}async close(){this.clearCallHistory(),await this[wsr].close(),this[$Z].clear()}deactivate(){this[gst]=!1}activate(){this[gst]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[VZ])?this[VZ].push(e):this[VZ]=[e];else if(typeof e>"u")this[VZ]=!0;else throw new GQn("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[VZ]=!1}enableCallHistory(){return this[KPe]=!0,this}disableCallHistory(){return this[KPe]=!1,this}getCallHistory(){return this[Spe]}clearCallHistory(){this[Spe]!==void 0&&this[Spe].clear()}get isMockActive(){return this[gst]}[ksr](){this[Spe]===void 0&&(this[Spe]=new CDs)}[QQn](e){this[KPe]&&(this[ksr](),this[Spe][pDs](e))}[mst](e,r){this[$Z].set(e,{count:0,dispatcher:r})}[yst](e){let r=Object.assign({agent:this},this[Ast]);return this[Ast]&&this[Ast].connections===1?new hDs(e,r):new mDs(e,r)}[UQn](e){let r=this[$Z].get(e);if(r?.dispatcher)return r.dispatcher;if(typeof e!="string"){let n=this[yst]("http://localhost:9999");return this[mst](e,n),n}for(let[n,o]of Array.from(this[$Z]))if(o&&typeof n!="string"&&gDs(n,e)){let s=this[yst](e);return this[mst](e,s),s[Rsr]=o.dispatcher[Rsr],s}}[fDs](){return this[VZ]}pendingInterceptors(){let e=this[$Z];return Array.from(e.entries()).flatMap(([r,n])=>n.dispatcher[Rsr].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new vDs}={}){let r=this.pendingInterceptors();if(r.length!==0)throw new EDs(r.length===1?`1 interceptor is pending: +`,"latin1"),r!==null&&o!==r){if(n[Oor])throw new LZ;process.emitWarning(new LZ)}e[hd].timeout&&e[hd].timeoutType===Spe&&e[hd].timeout.refresh&&e[hd].timeout.refresh(),n[r8]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[eH]=!1,e&&(Mi(n[hm]<=1,"pipeline should only contain this request"),o(e))}};R7n.exports=iPs});var U7n=I((Tuf,F7n)=>{"use strict";p();var Vw=require("node:assert"),{pipeline:gPs}=require("node:stream"),gs=Po(),{RequestContentLengthMismatchError:Gor,RequestAbortedError:APs,SocketError:YPe,InformationalError:tH,InvalidArgumentError:yPs}=so(),{kUrl:zPe,kReset:yst,kClient:wT,kRunning:KPe,kPending:EPs,kQueue:rH,kPendingIdx:Vor,kRunningIdx:N2,kError:RT,kSocket:Df,kStrictContentLength:_Ps,kOnError:Tpe,kMaxConcurrentStreams:gst,kPingInterval:P7n,kHTTP2Session:n8,kHTTP2InitialWindowSize:vPs,kHTTP2ConnectionWindowSize:CPs,kResume:F5,kSize:bPs,kHTTPContext:Wor,kClosed:$or,kBodyTimeout:SPs,kEnableConnectProtocol:VPe,kRemoteSettings:WPe,kHTTP2Stream:mst,kHTTP2SessionState:zor}=al(),{channels:D7n}=Jj(),$w=Symbol("open streams"),N7n,Ast;try{Ast=require("node:http2")}catch{Ast={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:TPs,HTTP2_HEADER_METHOD:M7n,HTTP2_HEADER_PATH:O7n,HTTP2_HEADER_SCHEME:qor,HTTP2_HEADER_CONTENT_LENGTH:IPs,HTTP2_HEADER_EXPECT:xPs,HTTP2_HEADER_STATUS:jor,HTTP2_HEADER_PROTOCOL:wPs,NGHTTP2_REFUSED_STREAM:RPs,NGHTTP2_CANCEL:kPs}}=Ast;function Hor(t){let e=[];for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.push(Buffer.from(r),Buffer.from(o));else e.push(Buffer.from(r),Buffer.from(n));return e}a(Hor,"parseH2Headers");function PPs(t,e){t[Df]=e;let r=t[vPs],n=t[CPs],o=Ast.connect(t[zPe],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[gst],settings:{enablePush:!1,...r!=null?{initialWindowSize:r}:null}});return t[Df]=e,o[$w]=0,o[wT]=t,o[Df]=e,o[zor]={ping:{interval:t[P7n]===0?null:setInterval(OPs,t[P7n],o).unref()}},o[VPe]=!1,o[WPe]=!1,n&&gs.addListener(o,"connect",NPs.bind(o,n)),gs.addListener(o,"error",LPs),gs.addListener(o,"frameError",BPs),gs.addListener(o,"end",FPs),gs.addListener(o,"goaway",UPs),gs.addListener(o,"close",QPs),gs.addListener(o,"remoteSettings",MPs),o.unref(),t[n8]=o,e[n8]=o,gs.addListener(e,"error",jPs),gs.addListener(e,"end",HPs),gs.addListener(e,"close",qPs),e[$or]=!1,e.on("close",GPs),{version:"h2",defaultPipelining:1/0,write(s){return VPs(t,s)},resume(){DPs(t)},destroy(s,c){e[$or]?queueMicrotask(c):e.destroy(s).on("close",c)},get destroyed(){return e.destroyed},busy(s){if(s!=null)if(t[KPe]>0){if(s.idempotent===!1||(s.upgrade==="websocket"||s.method==="CONNECT")&&o[WPe]===!1||gs.bodyLength(s.body)!==0&&(gs.isStream(s.body)||gs.isAsyncIterable(s.body)||gs.isFormDataLike(s.body)))return!0}else return(s.upgrade==="websocket"||s.method==="CONNECT")&&o[WPe]===!1;return!1}}}a(PPs,"connectH2");function DPs(t){let e=t[Df];e?.destroyed===!1&&(t[bPs]===0||t[gst]===0?(e.unref(),t[n8].unref()):(e.ref(),t[n8].ref()))}a(DPs,"resumeH2");function NPs(t){try{typeof this.setLocalWindowSize=="function"&&this.setLocalWindowSize(t)}catch{}}a(NPs,"applyConnectionWindowSize");function MPs(t){if(this[wT][gst]=t.maxConcurrentStreams??this[wT][gst],this[WPe]===!0&&this[VPe]===!0&&t.enableConnectProtocol===!1){let e=new tH("HTTP/2: Server disabled extended CONNECT protocol against RFC-8441");this[Df][RT]=e,this[wT][Tpe](e);return}this[VPe]=t.enableConnectProtocol??this[VPe],this[WPe]=!0,this[wT][F5]()}a(MPs,"onHttp2RemoteSettings");function OPs(t){let e=t[zor];if((t.closed||t.destroyed)&&e.ping.interval!=null){clearInterval(e.ping.interval),e.ping.interval=null;return}t.ping(r.bind(t));function r(n,o){let s=this[wT],c=this[wT];if(n!=null){let l=new tH(`HTTP/2: "PING" errored - type ${n.message}`);c[RT]=l,s[Tpe](l)}else s.emit("ping",o)}a(r,"onPing")}a(OPs,"onHttp2SendPing");function LPs(t){Vw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[Df][RT]=t,this[wT][Tpe](t)}a(LPs,"onHttp2SessionError");function BPs(t,e,r){if(r===0){let n=new tH(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[Df][RT]=n,this[wT][Tpe](n)}}a(BPs,"onHttp2FrameError");function FPs(){let t=new YPe("other side closed",gs.getSocketInfo(this[Df]));this.destroy(t),gs.destroy(this[Df],t)}a(FPs,"onHttp2SessionEnd");function UPs(t){let e=this[RT]||new YPe(`HTTP/2: "GOAWAY" frame received with code ${t}`,gs.getSocketInfo(this[Df])),r=this[wT];if(r[Df]=null,r[Wor]=null,this.close(),this[n8]=null,gs.destroy(this[Df],e),r[N2]{e.aborted||e.completed||(x=x||new APs,gs.errorRequest(t,e,x),A!=null&&(A.removeAllListeners("data"),A.close(),t[Tpe](x),t[F5]()),gs.destroy(m,x))},"abort");try{e.onConnect(_)}catch(x){gs.errorRequest(t,e,x)}if(e.aborted)return!1;if(l||o==="CONNECT")return n.ref(),l==="websocket"?n[VPe]===!1?(gs.errorRequest(t,e,new tH("HTTP/2: Extended CONNECT protocol not supported by server")),n.unref(),!1):(g[M7n]="CONNECT",g[wPs]="websocket",g[O7n]=s,f==="ws:"||f==="wss:"?g[qor]=f==="ws:"?"http":"https":g[qor]=f==="http:"?"http":"https",A=n.request(g,{endStream:!1,signal:d}),A[mst]=!0,A.once("response",(x,P)=>{let{[jor]:D,...N}=x;e.onUpgrade(D,Hor(N),A),++n[$w],t[rH][t[N2]++]=null}),A.on("error",()=>{(A.rstCode===RPs||A.rstCode===kPs)&&_(new tH(`HTTP/2: "stream error" received - code ${A.rstCode}`))}),A.once("close",()=>{n[$w]-=1,n[$w]===0&&n.unref()}),A.setTimeout(r),!0):(A=n.request(g,{endStream:!1,signal:d}),A[mst]=!0,A.on("response",x=>{let{[jor]:P,...D}=x;e.onUpgrade(P,Hor(D),A),++n[$w],t[rH][t[N2]++]=null}),A.once("close",()=>{n[$w]-=1,n[$w]===0&&n.unref()}),A.setTimeout(r),!0);g[O7n]=s,g[qor]=f==="http:"?"http":"https";let v=o==="PUT"||o==="POST"||o==="PATCH";m&&typeof m.read=="function"&&m.read(0);let b=gs.bodyLength(m);if(gs.isFormDataLike(m)){N7n??=Cpe().extractBody;let[x,P]=N7n(m);g["content-type"]=P,m=x.stream,b=x.length}if(b==null&&(b=e.contentLength),v||(b=null),$Ps(o)&&b>0&&e.contentLength!=null&&e.contentLength!==b){if(t[_Ps])return gs.errorRequest(t,e,new Gor),!1;process.emitWarning(new Gor)}if(b!=null&&(Vw(m||b===0,"no body must not have content length"),g[IPs]=`${b}`),n.ref(),D7n.sendHeaders.hasSubscribers){let x="";for(let P in g)x+=`${P}: ${g[P]}\r +`;D7n.sendHeaders.publish({request:e,headers:x,socket:n[Df]})}let T=o==="GET"||o==="HEAD"||m===null;u?(g[xPs]="100-continue",A=n.request(g,{endStream:T,signal:d}),A[mst]=!0,A.once("continue",R)):(A=n.request(g,{endStream:T,signal:d}),A[mst]=!0,R()),++n[$w],A.setTimeout(r);let w=!1;return A.once("response",x=>{let{[jor]:P,...D}=x;if(e.onResponseStarted(),w=!0,e.aborted){A.removeAllListeners("data");return}e.onHeaders(Number(P),Hor(D),A.resume.bind(A),"")===!1&&A.pause(),A.on("data",N=>{e.aborted||e.completed||e.onData(N)===!1&&A.pause()})}),A.once("end",()=>{A.removeAllListeners("data"),w?(!e.aborted&&!e.completed&&e.onComplete({}),t[rH][t[N2]++]=null,t[F5]()):(_(new tH("HTTP/2: stream half-closed (remote)")),t[rH][t[N2]++]=null,t[Vor]=t[N2],t[F5]())}),A.once("close",()=>{A.removeAllListeners("data"),n[$w]-=1,n[$w]===0&&n.unref()}),A.once("error",function(x){A.removeAllListeners("data"),_(x)}),A.once("frameError",(x,P)=>{A.removeAllListeners("data"),_(new tH(`HTTP/2: "frameError" received - type ${x}, code ${P}`))}),A.on("aborted",()=>{A.removeAllListeners("data")}),A.on("timeout",()=>{let x=new tH(`HTTP/2: "stream timeout after ${r}"`);A.removeAllListeners("data"),n[$w]-=1,n[$w]===0&&n.unref(),_(x)}),A.once("trailers",x=>{e.aborted||e.completed||(A.removeAllListeners("data"),e.onComplete(x))}),!0;function R(){!m||b===0?L7n(_,A,null,t,e,t[Df],b,v):gs.isBuffer(m)?L7n(_,A,m,t,e,t[Df],b,v):gs.isBlobLike(m)?typeof m.stream=="function"?B7n(_,A,m.stream(),t,e,t[Df],b,v):zPs(_,A,m,t,e,t[Df],b,v):gs.isStream(m)?WPs(_,t[Df],v,A,m,t,e,b):gs.isIterable(m)?B7n(_,A,m,t,e,t[Df],b,v):Vw(!1)}a(R,"writeBodyH2")}a(VPs,"writeH2");function L7n(t,e,r,n,o,s,c,l){try{r!=null&&gs.isBuffer(r)&&(Vw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[yst]=!0),o.onRequestSent(),n[F5]()}catch(u){t(u)}}a(L7n,"writeBuffer");function WPs(t,e,r,n,o,s,c,l){Vw(l!==0||s[KPe]===0,"stream body cannot be pipelined");let u=gPs(o,n,f=>{f?(gs.destroy(u,f),t(f)):(gs.removeAllListeners(u),c.onRequestSent(),r||(e[yst]=!0),s[F5]())});gs.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(WPs,"writeStream");async function zPs(t,e,r,n,o,s,c,l){Vw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new Gor;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[yst]=!0),n[F5]()}catch(u){t(u)}}a(zPs,"writeBlob");async function B7n(t,e,r,n,o,s,c,l){Vw(c!==0||n[KPe]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let h=u;u=null,h()}}a(d,"onDrain");let f=a(()=>new Promise((h,m)=>{Vw(u===null),s[RT]?m(s[RT]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[RT])throw s[RT];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[yst]=!0),n[F5]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(B7n,"writeIterable");F7n.exports=PPs});var sH=I((wuf,W7n)=>{"use strict";p();var i8=require("node:assert"),H7n=require("node:net"),JPe=require("node:http"),qZ=Po(),{ClientStats:YPs}=Uir(),{channels:Ipe}=Jj(),KPs=nUn(),JPs=PZ(),{InvalidArgumentError:md,InformationalError:ZPs,ClientDestroyedError:XPs}=so(),e2s=DZ(),{kUrl:U5,kServerName:oH,kClient:t2s,kBusy:Kor,kConnect:r2s,kResuming:jZ,kRunning:t2e,kPending:r2e,kSize:ZPe,kQueue:M2,kConnected:n2s,kConnecting:xpe,kNeedDrain:iH,kKeepAliveDefaultTimeout:Q7n,kHostHeader:i2s,kPendingIdx:O2,kRunningIdx:s8,kError:o2s,kPipelining:Est,kKeepAliveTimeoutValue:s2s,kMaxHeadersSize:a2s,kKeepAliveMaxTimeout:c2s,kKeepAliveTimeoutThreshold:l2s,kHeadersTimeout:u2s,kBodyTimeout:d2s,kStrictContentLength:f2s,kConnector:XPe,kMaxRequests:Jor,kCounter:p2s,kClose:h2s,kDestroy:m2s,kDispatch:g2s,kLocalAddress:e2e,kMaxResponseSize:A2s,kOnError:y2s,kHTTPContext:dh,kMaxConcurrentStreams:E2s,kHTTP2InitialWindowSize:_2s,kHTTP2ConnectionWindowSize:v2s,kResume:o8,kPingInterval:C2s}=al(),b2s=k7n(),S2s=U7n(),nH=Symbol("kClosedResolve"),T2s=JPe&&JPe.maxHeaderSize&&Number.isInteger(JPe.maxHeaderSize)&&JPe.maxHeaderSize>0?()=>JPe.maxHeaderSize:()=>{throw new md("http module not available or http.maxHeaderSize invalid")},q7n=a(()=>{},"noop");function G7n(t){return t[Est]??t[dh]?.defaultPipelining??1}a(G7n,"getPipelining");var Zor=class extends JPs{static{a(this,"Client")}constructor(e,{maxHeaderSize:r,headersTimeout:n,socketTimeout:o,requestTimeout:s,connectTimeout:c,bodyTimeout:l,idleTimeout:u,keepAlive:d,keepAliveTimeout:f,maxKeepAliveTimeout:h,keepAliveMaxTimeout:m,keepAliveTimeoutThreshold:g,socketPath:A,pipelining:y,tls:E,strictContentLength:_,maxCachedSessions:v,connect:b,maxRequestsPerClient:T,localAddress:w,maxResponseSize:R,autoSelectFamily:x,autoSelectFamilyAttemptTimeout:P,maxConcurrentStreams:D,allowH2:N,useH2c:L,initialWindowSize:B,connectionWindowSize:j,pingInterval:M,webSocket:O}={}){if(d!==void 0)throw new md("unsupported keepAlive, use pipelining=0 instead");if(o!==void 0)throw new md("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(s!==void 0)throw new md("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(u!==void 0)throw new md("unsupported idleTimeout, use keepAliveTimeout instead");if(h!==void 0)throw new md("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(r!=null){if(!Number.isInteger(r)||r<1)throw new md("invalid maxHeaderSize")}else r=T2s();if(A!=null&&typeof A!="string")throw new md("invalid socketPath");if(c!=null&&(!Number.isFinite(c)||c<0))throw new md("invalid connectTimeout");if(f!=null&&(!Number.isFinite(f)||f<=0))throw new md("invalid keepAliveTimeout");if(m!=null&&(!Number.isFinite(m)||m<=0))throw new md("invalid keepAliveMaxTimeout");if(g!=null&&!Number.isFinite(g))throw new md("invalid keepAliveTimeoutThreshold");if(n!=null&&(!Number.isInteger(n)||n<0))throw new md("headersTimeout must be a positive integer or zero");if(l!=null&&(!Number.isInteger(l)||l<0))throw new md("bodyTimeout must be a positive integer or zero");if(b!=null&&typeof b!="function"&&typeof b!="object")throw new md("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new md("maxRequestsPerClient must be a positive number");if(w!=null&&(typeof w!="string"||H7n.isIP(w)===0))throw new md("localAddress must be valid string IP address");if(R!=null&&(!Number.isInteger(R)||R<-1))throw new md("maxResponseSize must be a positive number");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new md("autoSelectFamilyAttemptTimeout must be a positive number");if(N!=null&&typeof N!="boolean")throw new md("allowH2 must be a valid boolean value");if(D!=null&&(typeof D!="number"||D<1))throw new md("maxConcurrentStreams must be a positive integer, greater than 0");if(L!=null&&typeof L!="boolean")throw new md("useH2c must be a valid boolean value");if(B!=null&&(!Number.isInteger(B)||B<1))throw new md("initialWindowSize must be a positive integer, greater than 0");if(j!=null&&(!Number.isInteger(j)||j<1))throw new md("connectionWindowSize must be a positive integer, greater than 0");if(M!=null&&(typeof M!="number"||!Number.isInteger(M)||M<0))throw new md("pingInterval must be a positive integer, greater or equal to 0");if(super({webSocket:O}),typeof b!="function")b=e2s({...E,maxCachedSessions:v,allowH2:N,useH2c:L,socketPath:A,timeout:c,...typeof x=="boolean"?{autoSelectFamily:x,autoSelectFamilyAttemptTimeout:P}:void 0,...b});else{let U=b;b=a((q,Q)=>U({...q,...A!=null?{socketPath:A}:null,...N!=null?{allowH2:N}:null},Q),"connect")}this[U5]=qZ.parseOrigin(e),this[XPe]=b,this[Est]=y??1,this[a2s]=r,this[Q7n]=f??4e3,this[c2s]=m??6e5,this[l2s]=g??2e3,this[s2s]=this[Q7n],this[oH]=null,this[e2e]=w??null,this[jZ]=0,this[iH]=0,this[i2s]=`host: ${this[U5].hostname}${this[U5].port?`:${this[U5].port}`:""}\r +`,this[d2s]=l??3e5,this[u2s]=n??3e5,this[f2s]=_??!0,this[Jor]=T,this[nH]=null,this[A2s]=R>-1?R:-1,this[dh]=null,this[E2s]=D??100,this[_2s]=B??262144,this[v2s]=j??524288,this[C2s]=M??6e4,this[M2]=[],this[s8]=0,this[O2]=0,this[o8]=U=>Xor(this,U),this[y2s]=U=>$7n(this,U)}get pipelining(){return this[Est]}set pipelining(e){this[Est]=e,this[o8](!0)}get stats(){return new YPs(this)}get[r2e](){return this[M2].length-this[O2]}get[t2e](){return this[O2]-this[s8]}get[ZPe](){return this[M2].length-this[s8]}get[n2s](){return!!this[dh]&&!this[xpe]&&!this[dh].destroyed}get[Kor](){return!!(this[dh]?.busy(null)||this[ZPe]>=(G7n(this)||1)||this[r2e]>0)}[r2s](e){V7n(this),this.once("connect",e)}[g2s](e,r){let n=new KPs(this[U5].origin,e,r);return this[M2].push(n),this[jZ]||(qZ.bodyLength(n.body)==null&&qZ.isIterable(n.body)?(this[jZ]=1,queueMicrotask(()=>Xor(this))):this[o8](!0)),this[jZ]&&this[iH]!==2&&this[Kor]&&(this[iH]=2),this[iH]<2}[h2s](){return new Promise(e=>{this[ZPe]?this[nH]=e:e(null)})}[m2s](e){return new Promise(r=>{let n=this[M2].splice(this[O2]);for(let s=0;s{this[nH]&&(this[nH](),this[nH]=null),r(null)},"callback");this[dh]?(this[dh].destroy(e,o),this[dh]=null):queueMicrotask(o),this[o8]()})}};function $7n(t,e){if(t[t2e]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){i8(t[O2]===t[s8]);let r=t[M2].splice(t[s8]);for(let n=0;n{if(s){Yor(t,s,{host:e,hostname:r,protocol:n,port:o}),t[o8]();return}if(t.destroyed){qZ.destroy(c.on("error",q7n),new XPs),t[o8]();return}i8(c);try{t[dh]=c.alpnProtocol==="h2"?S2s(t,c):b2s(t,c)}catch(l){c.destroy().on("error",q7n),Yor(t,l,{host:e,hostname:r,protocol:n,port:o}),t[o8]();return}t[xpe]=!1,c[p2s]=0,c[Jor]=t[Jor],c[t2s]=t,c[o2s]=null,Ipe.connected.hasSubscribers&&Ipe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[dh]?.version,servername:t[oH],localAddress:t[e2e]},connector:t[XPe],socket:c}),t.emit("connect",t[U5],[t]),t[o8]()})}catch(s){Yor(t,s,{host:e,hostname:r,protocol:n,port:o}),t[o8]()}}a(V7n,"connect");function Yor(t,e,{host:r,hostname:n,protocol:o,port:s}){if(!t.destroyed){if(t[xpe]=!1,Ipe.connectError.hasSubscribers&&Ipe.connectError.publish({connectParams:{host:r,hostname:n,protocol:o,port:s,version:t[dh]?.version,servername:t[oH],localAddress:t[e2e]},connector:t[XPe],error:e}),e.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(i8(t[t2e]===0);t[r2e]>0&&t[M2][t[O2]].servername===t[oH];){let c=t[M2][t[O2]++];qZ.errorRequest(t,c,e)}else $7n(t,e);t.emit("connectionError",t[U5],[t],e)}}a(Yor,"handleConnectError");function j7n(t){t[iH]=0,t.emit("drain",t[U5],[t])}a(j7n,"emitDrain");function Xor(t,e){t[jZ]!==2&&(t[jZ]=2,I2s(t,e),t[jZ]=0,t[s8]>256&&(t[M2].splice(0,t[s8]),t[O2]-=t[s8],t[s8]=0))}a(Xor,"resume");function I2s(t,e){for(;;){if(t.destroyed){i8(t[r2e]===0);return}if(t[nH]&&!t[ZPe]){t[nH](),t[nH]=null;return}if(t[dh]&&t[dh].resume(),t[Kor])t[iH]=2;else if(t[iH]===2){e?(t[iH]=1,queueMicrotask(()=>j7n(t))):j7n(t);continue}if(t[r2e]===0||t[t2e]>=(G7n(t)||1))return;let r=t[M2][t[O2]];if(r===null)return;if(t[U5].protocol==="https:"&&t[oH]!==r.servername){if(t[t2e]>0)return;t[oH]=r.servername,t[dh]?.destroy(new ZPs("servername changed"),()=>{t[dh]=null,Xor(t)})}if(t[xpe])return;if(!t[dh]){V7n(t);return}if(t[dh].destroyed||t[dh].busy(r))return;!r.aborted&&t[dh].write(r)?t[O2]++:t[M2].splice(t[O2],1)}}a(I2s,"_resume");W7n.exports=Zor});var esr=I((Duf,z7n)=>{"use strict";p();var _st=class{static{a(this,"FixedCircularBuffer")}bottom=0;top=0;list=new Array(2048).fill(void 0);next=null;isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};z7n.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new _st}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new _st),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next,e.next=null),r}}});var vst=I((Ouf,nQn)=>{"use strict";p();var{PoolStats:x2s}=Uir(),w2s=PZ(),R2s=esr(),{kConnected:tsr,kSize:Y7n,kRunning:K7n,kPending:J7n,kQueued:n2e,kBusy:k2s,kFree:P2s,kUrl:D2s,kClose:N2s,kDestroy:M2s,kDispatch:O2s}=al(),Fg=Symbol("clients"),hv=Symbol("needDrain"),i2e=Symbol("queue"),rsr=Symbol("closed resolve"),nsr=Symbol("onDrain"),Z7n=Symbol("onConnect"),X7n=Symbol("onDisconnect"),eQn=Symbol("onConnectionError"),isr=Symbol("get dispatcher"),tQn=Symbol("add client"),rQn=Symbol("remove client"),osr=class extends w2s{static{a(this,"PoolBase")}[i2e]=new R2s;[n2e]=0;[Fg]=[];[hv]=!1;[nsr](e,r,n){let o=this[i2e],s=!1;for(;!s;){let c=o.shift();if(!c)break;this[n2e]--,s=!e.dispatch(c.opts,c.handler)}if(e[hv]=s,!s&&this[hv]&&(this[hv]=!1,this.emit("drain",r,[this,...n])),this[rsr]&&o.isEmpty()){let c=[];for(let l=0;l{this.emit("connect",e,[this,...r])};[X7n]=(e,r,n)=>{this.emit("disconnect",e,[this,...r],n)};[eQn]=(e,r,n)=>{this.emit("connectionError",e,[this,...r],n)};get[k2s](){return this[hv]}get[tsr](){let e=0;for(let{[tsr]:r}of this[Fg])e+=r;return e}get[P2s](){let e=0;for(let{[tsr]:r,[hv]:n}of this[Fg])e+=r&&!n;return e}get[J7n](){let e=this[n2e];for(let{[J7n]:r}of this[Fg])e+=r;return e}get[K7n](){let e=0;for(let{[K7n]:r}of this[Fg])e+=r;return e}get[Y7n](){let e=this[n2e];for(let{[Y7n]:r}of this[Fg])e+=r;return e}get stats(){return new x2s(this)}[N2s](){if(this[i2e].isEmpty()){let e=[];for(let r=0;r{this[rsr]=e})}[M2s](e){for(;;){let n=this[i2e].shift();if(!n)break;n.handler.onError(e)}let r=new Array(this[Fg].length);for(let n=0;n{this[hv]&&this[nsr](e,e[D2s],[e,this])}),this}[rQn](e){e.close(()=>{let r=this[Fg].indexOf(e);r!==-1&&this[Fg].splice(r,1)}),this[hv]=this[Fg].some(r=>!r[hv]&&r.closed!==!0&&r.destroyed!==!0)}};nQn.exports={PoolBase:osr,kClients:Fg,kNeedDrain:hv,kAddClient:tQn,kRemoveClient:rQn,kGetDispatcher:isr}});var HZ=I((Fuf,aQn)=>{"use strict";p();var{PoolBase:L2s,kClients:Cst,kNeedDrain:B2s,kAddClient:F2s,kGetDispatcher:U2s,kRemoveClient:Q2s}=vst(),q2s=sH(),{InvalidArgumentError:ssr}=so(),iQn=Po(),{kUrl:oQn}=al(),j2s=DZ(),bst=Symbol("options"),asr=Symbol("connections"),sQn=Symbol("factory");function H2s(t,e){return new q2s(t,e)}a(H2s,"defaultFactory");var csr=class extends L2s{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=H2s,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,clientTtl:m,...g}={}){if(r!=null&&(!Number.isFinite(r)||r<0))throw new ssr("invalid connections");if(typeof n!="function")throw new ssr("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new ssr("connect must be a function or an object");typeof o!="function"&&(o=j2s({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(g),this[asr]=r||null,this[oQn]=iQn.parseOrigin(e),this[bst]={...iQn.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[bst].interceptors=g.interceptors?{...g.interceptors}:void 0,this[sQn]=n,this.on("connect",(A,y)=>{if(m!=null&&m>0)for(let E of y)Object.assign(E,{ttl:Date.now()})}),this.on("connectionError",(A,y,E)=>{for(let _ of y){let v=this[Cst].indexOf(_);v!==-1&&this[Cst].splice(v,1)}})}[U2s](){let e=this[bst].clientTtl;for(let r of this[Cst])if(e!=null&&e>0&&r.ttl&&Date.now()-r.ttl>e)this[Q2s](r);else if(!r[B2s])return r;if(!this[asr]||this[Cst].length{"use strict";p();var{BalancedPoolMissingUpstreamError:G2s,InvalidArgumentError:$2s}=so(),{PoolBase:V2s,kClients:YA,kNeedDrain:o2e,kAddClient:W2s,kRemoveClient:z2s,kGetDispatcher:Y2s}=vst(),K2s=HZ(),{kUrl:Sst}=al(),Tst=Po(),cQn=Symbol("factory"),s2e=Symbol("options"),lQn=Symbol("kGreatestCommonDivisor"),GZ=Symbol("kCurrentWeight"),$Z=Symbol("kIndex"),Ww=Symbol("kWeight"),Ist=Symbol("kMaxWeightPerServer"),xst=Symbol("kErrorPenalty");function J2s(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(J2s,"getGreatestCommonDivisor");function Z2s(t,e){return new K2s(t,e)}a(Z2s,"defaultFactory");var lsr=class extends V2s{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=Z2s,...n}={}){if(typeof r!="function")throw new $2s("factory must be a function.");super(n),this[s2e]={...Tst.deepClone(n)},this[s2e].interceptors=n.interceptors?{...n.interceptors}:void 0,this[$Z]=-1,this[GZ]=0,this[Ist]=this[s2e].maxWeightPerServer||100,this[xst]=this[s2e].errorPenalty||15,Array.isArray(e)||(e=[e]),this[cQn]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=Tst.parseOrigin(e).origin;if(this[YA].find(o=>o[Sst].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[cQn](r,this[s2e]);this[W2s](n),n.on("connect",()=>{n[Ww]=Math.min(this[Ist],n[Ww]+this[xst])}),n.on("connectionError",()=>{n[Ww]=Math.max(1,n[Ww]-this[xst]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[Ww]=Math.max(1,n[Ww]-this[xst]),this._updateBalancedPoolStats())});for(let o of this[YA])o[Ww]=this[Ist];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[Sst].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[z2s](n),this}getUpstream(e){let r=Tst.parseOrigin(e).origin;return this[YA].find(n=>n[Sst].origin===r&&n.closed!==!0&&n.destroyed!==!0)}get upstreams(){return this[YA].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[Sst].origin)}[Y2s](){if(this[YA].length===0)throw new G2s;if(!this[YA].find(s=>!s[o2e]&&s.closed!==!0&&s.destroyed!==!0)||this[YA].map(s=>s[o2e]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[YA].findIndex(s=>!s[o2e]);for(;n++this[YA][o][Ww]&&!s[o2e]&&(o=this[$Z]),this[$Z]===0&&(this[GZ]=this[GZ]-this[lQn],this[GZ]<=0&&(this[GZ]=this[Ist])),s[Ww]>=this[GZ]&&!s[o2e])return s}return this[GZ]=this[YA][o][Ww],this[$Z]=o,this[YA][o]}};uQn.exports=lsr});var mQn=I((Guf,hQn)=>{"use strict";p();var{PoolBase:X2s,kClients:wst,kNeedDrain:eDs,kAddClient:fQn,kGetDispatcher:tDs,kRemoveClient:rDs}=vst(),nDs=sH(),{InvalidArgumentError:usr}=so(),pQn=Po(),{kUrl:dsr}=al(),iDs=DZ(),a2e=Symbol("options"),fsr=Symbol("connections"),psr=Symbol("factory"),Rst=Symbol("index");function oDs(t,e){return new nDs(t,e)}a(oDs,"defaultFactory");var hsr=class extends X2s{static{a(this,"RoundRobinPool")}constructor(e,{connections:r,factory:n=oDs,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,clientTtl:m,...g}={}){if(r!=null&&(!Number.isFinite(r)||r<0))throw new usr("invalid connections");if(typeof n!="function")throw new usr("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new usr("connect must be a function or an object");typeof o!="function"&&(o=iDs({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(),this[fsr]=r||null,this[dsr]=pQn.parseOrigin(e),this[a2e]={...pQn.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[a2e].interceptors=g.interceptors?{...g.interceptors}:void 0,this[psr]=n,this[Rst]=-1,this.on("connect",(A,y)=>{if(m!=null&&m>0)for(let E of y)Object.assign(E,{ttl:Date.now()})}),this.on("connectionError",(A,y,E)=>{for(let _ of y){let v=this[wst].indexOf(_);v!==-1&&this[wst].splice(v,1)}})}[tDs](){let e=this[a2e].clientTtl,r=this[wst].length;if(r===0){let o=this[psr](this[dsr],this[a2e]);return this[fQn](o),o}let n=0;for(;n0&&o.ttl&&Date.now()-o.ttl>e){this[rDs](o),n++;continue}if(!o[eDs])return o;n++}if(!this[fsr]||r{"use strict";p();var{InvalidArgumentError:kst,MaxOriginsReachedError:sDs}=so(),{kClients:zw,kRunning:gQn,kClose:aDs,kDestroy:cDs,kDispatch:lDs,kUrl:uDs}=al(),dDs=PZ(),fDs=HZ(),pDs=sH(),hDs=Po(),AQn=Symbol("onConnect"),yQn=Symbol("onDisconnect"),EQn=Symbol("onConnectionError"),_Qn=Symbol("onDrain"),vQn=Symbol("factory"),msr=Symbol("options"),c2e=Symbol("origins");function mDs(t,e){return e&&e.connections===1?new pDs(t,e):new fDs(t,e)}a(mDs,"defaultFactory");var gsr=class extends dDs{static{a(this,"Agent")}constructor({factory:e=mDs,maxOrigins:r=1/0,connect:n,...o}={}){if(typeof e!="function")throw new kst("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new kst("connect must be a function or an object");if(typeof r!="number"||Number.isNaN(r)||r<=0)throw new kst("maxOrigins must be a number greater than 0");super(o),n&&typeof n!="function"&&(n={...n}),this[msr]={...hDs.deepClone(o),maxOrigins:r,connect:n},this[vQn]=e,this[zw]=new Map,this[c2e]=new Set,this[_Qn]=(s,c)=>{this.emit("drain",s,[this,...c])},this[AQn]=(s,c)=>{this.emit("connect",s,[this,...c])},this[yQn]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[EQn]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[gQn](){let e=0;for(let{dispatcher:r}of this[zw].values())e+=r[gQn];return e}[lDs](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new kst("opts.origin must be a non-empty string or URL.");if(this[c2e].size>=this[msr].maxOrigins&&!this[c2e].has(n))throw new sDs;let o=this[zw].get(n),s=o&&o.dispatcher;if(!s){let c=a(l=>{let u=this[zw].get(n);u&&(l&&(u.count-=1),u.count<=0&&(this[zw].delete(n),u.dispatcher.destroyed||u.dispatcher.close()),this[c2e].delete(n))},"closeClientIfUnused");s=this[vQn](e.origin,this[msr]).on("drain",this[_Qn]).on("connect",(l,u)=>{let d=this[zw].get(n);d&&(d.count+=1),this[AQn](l,u)}).on("disconnect",(l,u,d)=>{c(!0),this[yQn](l,u,d)}).on("connectionError",(l,u,d)=>{c(!1),this[EQn](l,u,d)}),this[zw].set(n,{count:0,dispatcher:s}),this[c2e].add(n)}return s.dispatch(e,r)}[aDs](){let e=[];for(let{dispatcher:r}of this[zw].values())e.push(r.close());return this[zw].clear(),Promise.all(e)}[cDs](e){let r=[];for(let{dispatcher:n}of this[zw].values())r.push(n.destroy(e));return this[zw].clear(),Promise.all(r)}get stats(){let e={};for(let{dispatcher:r}of this[zw].values())r.stats&&(e[r[uDs].origin]=r.stats);return e}};CQn.exports=gsr});var TQn=I((Kuf,SQn)=>{"use strict";p();var{Buffer:cH}=require("node:buffer"),Asr=require("node:net"),{InvalidArgumentError:aH}=so();function gDs(t){if(Asr.isIPv4(t)){let r=t.split(".").map(Number);return{type:1,buffer:cH.from(r)}}if(Asr.isIPv6(t))return{type:4,buffer:bQn(t)};let e=cH.from(t,"utf8");if(e.length>255)throw new aH("Domain name too long (max 255 bytes)");return{type:3,buffer:cH.concat([cH.from([e.length]),e])}}a(gDs,"parseAddress");function bQn(t){let e=cH.alloc(16),r=t;if(t.includes(".")){let o=t.lastIndexOf(":"),s=t.slice(o+1);if(Asr.isIPv4(s)){let c=s.split(".").map(Number),l=(c[0]<<8|c[1]).toString(16),u=(c[2]<<8|c[3]).toString(16);r=`${t.slice(0,o)}:${l}:${u}`}}let n=r.indexOf("::");if(n!==-1){let o=r.slice(0,n),s=r.slice(n+2),c=o===""?[]:o.split(":"),l=s===""?[]:s.split(":"),u=0;for(let d of c)e.writeUInt16BE(parseInt(d,16),u),u+=2;u=16-l.length*2;for(let d of l)e.writeUInt16BE(parseInt(d,16),u),u+=2}else{let o=r.split(":");for(let s=0;s{"use strict";p();var{EventEmitter:_Ds}=require("node:events"),{Buffer:WZ}=require("node:buffer"),{InvalidArgumentError:wpe,Socks5ProxyError:lH}=so(),{debuglog:vDs}=require("node:util"),{parseAddress:CDs}=TQn(),a8=vDs("undici:socks5"),IQn=WZ.alloc(0),Pst=5,Rpe={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},xQn={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},zZ={IPV4:1,DOMAIN:3,IPV6:4},Q5={SUCCEEDED:0,GENERAL_FAILURE:1,CONNECTION_NOT_ALLOWED:2,NETWORK_UNREACHABLE:3,HOST_UNREACHABLE:4,CONNECTION_REFUSED:5,TTL_EXPIRED:6,COMMAND_NOT_SUPPORTED:7,ADDRESS_TYPE_NOT_SUPPORTED:8},IE={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",AUTHENTICATED:"authenticated",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"},ysr=class extends _Ds{static{a(this,"Socks5Client")}constructor(e,r={}){if(super(),!e)throw new wpe("socket is required");this.socket=e,this.options=r,this.state=IE.INITIAL,this.buffer=IQn,this.onSocketData=this.onData.bind(this),this.onSocketError=this.onError.bind(this),this.onSocketClose=this.onClose.bind(this),this.authMethods=[],r.username&&r.password&&this.authMethods.push(Rpe.USERNAME_PASSWORD),this.authMethods.push(Rpe.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(e){a8("received data",e.length,"bytes in state",this.state),this.buffer=WZ.concat([this.buffer,e]);try{switch(this.state){case IE.HANDSHAKING:this.handleHandshakeResponse();break;case IE.AUTHENTICATING:this.handleAuthResponse();break;case IE.CONNECTING:this.handleConnectResponse();break}}catch(r){this.onError(r)}}onError(e){a8("socket error",e),this.state=IE.ERROR,this.emit("error",e),this.destroy()}onClose(){a8("socket closed"),this.state=IE.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}markAuthenticated(){this.state=IE.AUTHENTICATED,this.emit("authenticated")}handshake(){if(this.state!==IE.INITIAL)throw new wpe("Handshake already started");a8("starting handshake with",this.authMethods.length,"auth methods"),this.state=IE.HANDSHAKING;let e=WZ.alloc(2+this.authMethods.length);e[0]=Pst,e[1]=this.authMethods.length,this.authMethods.forEach((r,n)=>{e[2+n]=r}),this.socket.write(e)}handleHandshakeResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],r=this.buffer[1];if(e!==Pst)throw new lH(`Invalid SOCKS version: ${e}`,"UND_ERR_SOCKS5_VERSION");if(r===Rpe.NO_ACCEPTABLE)throw new lH("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),a8("server selected auth method",r),r===Rpe.NO_AUTH)this.markAuthenticated();else if(r===Rpe.USERNAME_PASSWORD)this.state=IE.AUTHENTICATING,this.sendAuthRequest();else throw new lH(`Unsupported authentication method: ${r}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:e,password:r}=this.options;if(!e||!r)throw new wpe("Username and password required for authentication");a8("sending username/password auth");let n=WZ.from(e),o=WZ.from(r);if(n.length>255||o.length>255)throw new wpe("Username or password too long");let s=WZ.alloc(3+n.length+o.length);s[0]=1,s[1]=n.length,n.copy(s,2),s[2+n.length]=o.length,o.copy(s,3+n.length),this.socket.write(s)}handleAuthResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],r=this.buffer[1];if(e!==1)throw new lH(`Invalid auth sub-negotiation version: ${e}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(r!==0)throw new lH("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),a8("authentication successful"),this.markAuthenticated()}connect(e,r){if(this.state===IE.CONNECTING||this.state===IE.CONNECTED)throw new wpe("Connection already in progress");if(this.state!==IE.AUTHENTICATED)throw new wpe("Client must be authenticated before CONNECT");a8("connecting to",e,r),this.state=IE.CONNECTING;let n=this.buildConnectRequest(xQn.CONNECT,e,r);this.socket.write(n)}buildConnectRequest(e,r,n){let{type:o,buffer:s}=CDs(r),c=WZ.alloc(4+s.length+2);return c[0]=Pst,c[1]=e,c[2]=0,c[3]=o,s.copy(c,4),c.writeUInt16BE(n,4+s.length),c}handleConnectResponse(){if(this.buffer.length<4)return;let e=this.buffer[0],r=this.buffer[1],n=this.buffer[3];if(e!==Pst)throw new lH(`Invalid SOCKS version in reply: ${e}`,"UND_ERR_SOCKS5_REPLY_VERSION");let o=4;if(n===zZ.IPV4)o+=6;else if(n===zZ.DOMAIN){if(this.buffer.length<5)return;o+=1+this.buffer[4]+2}else if(n===zZ.IPV6)o+=18;else throw new lH(`Invalid address type in reply: ${n}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length{"use strict";p();var{URL:kQn}=require("node:url"),Esr,bDs=PZ(),{InvalidArgumentError:PQn}=so(),{Socks5Client:SDs,STATES:TDs}=RQn(),{kDispatch:DQn,kClose:IDs,kDestroy:xDs}=al(),wDs=HZ(),RDs=DZ(),{debuglog:kDs}=require("node:util"),uH=kDs("undici:socks5-proxy"),_sr=Symbol("proxy url"),PDs=Symbol("proxy headers"),NQn=Symbol("proxy auth"),MQn=Symbol("proxy protocol"),YZ=Symbol("pools"),OQn=Symbol("connector"),vsr=Symbol("request tls settings"),LQn=!1,Csr=class extends bDs{static{a(this,"Socks5ProxyAgent")}constructor(e,r={}){if(super(),LQn||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),LQn=!0),!e)throw new PQn("Proxy URL is mandatory");let n=typeof e=="string"?new kQn(e):e;if(n.protocol!=="socks5:"&&n.protocol!=="socks:")throw new PQn("Proxy URL must use socks5:// or socks:// protocol");this[_sr]=n,this[PDs]=r.headers||{},this[MQn]=r.proxyTls?"https:":"http:",this[vsr]=r.requestTls,this[NQn]={username:r.username||(n.username?decodeURIComponent(n.username):null),password:r.password||(n.password?decodeURIComponent(n.password):null)},this[OQn]=r.connect||RDs({...r.proxyTls,servername:r.proxyTls?.servername||n.hostname}),this[YZ]=new Map}async createSocks5Connection(e,r){let n=this[_sr].hostname,o=parseInt(this[_sr].port)||1080;uH("creating SOCKS5 connection to",n,o);let s=await new Promise((l,u)=>{this[OQn]({hostname:n,host:n,port:o,protocol:this[MQn]},(d,f)=>{d?u(d):l(f)})}),c=new SDs(s,this[NQn]);return c.on("error",l=>{uH("SOCKS5 error:",l),s.destroy()}),await c.handshake(),await new Promise((l,u)=>{let d=setTimeout(()=>{u(new Error("SOCKS5 authentication timeout"))},5e3),f=a(()=>{clearTimeout(d),c.removeListener("error",h),l()},"onAuthenticated"),h=a(m=>{clearTimeout(d),c.removeListener("authenticated",f),u(m)},"onError");c.state===TDs.AUTHENTICATED?(clearTimeout(d),l()):(c.once("authenticated",f),c.once("error",h))}),await c.connect(e,r),await new Promise((l,u)=>{let d=setTimeout(()=>{u(new Error("SOCKS5 connection timeout"))},5e3),f=a(m=>{uH("SOCKS5 tunnel established to",e,r,"via",m),clearTimeout(d),c.removeListener("error",h),l()},"onConnected"),h=a(m=>{clearTimeout(d),c.removeListener("connected",f),u(m)},"onError");c.once("connected",f),c.once("error",h)}),s}[DQn](e,r){let{origin:n}=e;uH("dispatching request to",n,"via SOCKS5");try{let o=String(n),s=this[YZ].get(o);return(!s||s.destroyed||s.closed)&&(s=new wDs(n,{pipelining:e.pipelining,connections:e.connections,connect:a(async(c,l)=>{try{let u=new kQn(n),d=u.hostname,f=parseInt(u.port)||(u.protocol==="https:"?443:80);uH("establishing SOCKS5 connection to",d,f);let h=await this.createSocks5Connection(d,f),m=h;u.protocol==="https:"&&(Esr||(Esr=require("node:tls")),uH("upgrading to TLS"),m=Esr.connect({...this[vsr],socket:h,servername:this[vsr]?.servername||d}),await new Promise((g,A)=>{m.once("secureConnect",g),m.once("error",A)})),l(null,m)}catch(u){uH("SOCKS5 connection error:",u),l(u)}},"connect")}),this[YZ].set(o,s)),s[DQn](e,r)}catch(o){if(uH("dispatch error:",o),typeof r.onResponseError=="function")return r.onResponseError(null,o),!1;if(typeof r.onError=="function")return r.onError(o),!1;throw o}}async[IDs](){let e=[];for(let r of this[YZ].values())e.push(r.close());this[YZ].clear(),await Promise.all(e)}async[xDs](e){let r=[];for(let n of this[YZ].values())r.push(n.destroy(e));this[YZ].clear(),await Promise.all(r)}};BQn.exports=Csr});var xsr=I((odf,YQn)=>{"use strict";p();var{kProxy:kpe,kClose:GQn,kDestroy:$Qn,kDispatch:FQn}=al(),DDs=VZ(),VQn=HZ(),WQn=PZ(),{InvalidArgumentError:KZ,RequestAbortedError:NDs,SecureProxyConnectionError:MDs}=so(),UQn=DZ(),zQn=sH(),{channels:QQn}=Jj(),ODs=bsr(),Dst=Symbol("proxy agent"),dH=Symbol("proxy client"),c8=Symbol("proxy headers"),Ssr=Symbol("request tls settings"),qQn=Symbol("proxy tls settings"),jQn=Symbol("connect endpoint function"),HQn=Symbol("tunnel proxy");function LDs(t){return t==="https:"?443:80}a(LDs,"defaultProtocolPort");function BDs(t,e){return new VQn(t,e)}a(BDs,"defaultFactory");var FDs=a(()=>{},"noop");function UDs(t,e){return e.connections===1?new zQn(t,e):new VQn(t,e)}a(UDs,"defaultAgentFactory");var Tsr=class extends WQn{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(!e)throw new KZ("Proxy URL is mandatory");super(),this[c8]=r,o?this.#e=o(e,{connect:n}):this.#e=new zQn(e,{connect:n})}[FQn](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new KZ("Proxy Authentication Required (407)"));return}n&&n.call(this,l,u,d)};let{origin:o,path:s="/",headers:c={}}=e;if(e.path=o+s,!("host"in c)&&!("Host"in c)){let{host:l}=new URL(o);c.host=l}return e.headers={...this[c8],...c},this.#e[FQn](e,r)}[GQn](){return this.#e.close()}[$Qn](e){return this.#e.destroy(e)}},Isr=class extends WQn{static{a(this,"ProxyAgent")}constructor(e){if(!e||typeof e=="object"&&!(e instanceof URL)&&!e.uri)throw new KZ("Proxy uri is mandatory");let{clientFactory:r=BDs}=e;if(typeof r!="function")throw new KZ("Proxy opts.clientFactory must be a function.");let{proxyTunnel:n=!0}=e;super();let o=this.#e(e),{href:s,origin:c,port:l,protocol:u,username:d,password:f,hostname:h}=o;if(this[kpe]={uri:s,protocol:u},this[Ssr]=e.requestTls,this[qQn]=e.proxyTls,this[c8]=e.headers||{},this[HQn]=n,e.auth&&e.token)throw new KZ("opts.auth cannot be used in combination with opts.token");e.auth?this[c8]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[c8]["proxy-authorization"]=e.token:d&&f&&(this[c8]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=UQn({...e.proxyTls});this[jQn]=UQn({...e.requestTls});let g=e.factory||UDs,A=a((y,E)=>{let{protocol:_}=new URL(y);return this[kpe].protocol==="socks5:"||this[kpe].protocol==="socks:"?new ODs(this[kpe].uri,{headers:this[c8],connect:m,factory:g,username:e.username||d,password:e.password||f,proxyTls:e.proxyTls,requestTls:e.requestTls}):!this[HQn]&&_==="http:"&&this[kpe].protocol==="http:"?new Tsr(this[kpe].uri,{headers:this[c8],connect:m,factory:g}):g(y,E)},"factory");u==="socks5:"||u==="socks:"?this[dH]=null:this[dH]=r(o,{connect:m}),this[Dst]=new DDs({...e,factory:A,connect:a(async(y,E)=>{if(!this[dH]){E(new KZ("Cannot establish tunnel connection without a proxy client"));return}let _=y.host;y.port||(_+=`:${LDs(y.protocol)}`);try{let v={origin:c,port:l,path:_,signal:y.signal,headers:{...this[c8],host:y.host,...y.connections==null||y.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[qQn]?.servername||h},{socket:b,statusCode:T}=await this[dH].connect(v);if(T!==200){b.on("error",FDs).destroy(),E(new NDs(`Proxy response (${T}) !== 200 when HTTP Tunneling`));return}if(QQn.proxyConnected.hasSubscribers&&QQn.proxyConnected.publish({socket:b,connectParams:v}),y.protocol!=="https:"){E(null,b);return}let w;this[Ssr]?w=this[Ssr].servername:w=y.servername,this[jQn]({...y,servername:w,httpSocket:b},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new MDs(v)):E(v)}},"connect")})}dispatch(e,r){let n=QDs(e.headers);if(qDs(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new URL(e.origin);n.host=o}return this[Dst].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new URL(e):e instanceof URL?e:new URL(e.uri)}[GQn](){let e=[this[Dst].close()];return this[dH]&&e.push(this[dH].close()),Promise.all(e)}[$Qn](){let e=[this[Dst].destroy()];return this[dH]&&e.push(this[dH].destroy()),Promise.all(e)}};function QDs(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new KZ("Proxy-Authorization should be sent in ProxyAgent constructor")}a(qDs,"throwIfProxyAuthIsSent");YQn.exports=Isr});var eqn=I((cdf,XQn)=>{"use strict";p();var jDs=PZ(),{kClose:HDs,kDestroy:GDs,kClosed:KQn,kDestroyed:JQn,kDispatch:$Ds,kNoProxyAgent:l2e,kHttpProxyAgent:fH,kHttpsProxyAgent:JZ}=al(),ZQn=xsr(),VDs=VZ(),WDs={"http:":80,"https:":443},wsr=class extends jDs{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e;let{httpProxy:r,httpsProxy:n,noProxy:o,...s}=e;this[l2e]=new VDs(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[fH]=new ZQn({...s,uri:c}):this[fH]=this[l2e];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[JZ]=new ZQn({...s,uri:l}):this[JZ]=this[fH],this.#o()}[$Ds](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}[HDs](){return Promise.all([this[l2e].close(),!this[fH][KQn]&&this[fH].close(),!this[JZ][KQn]&&this[JZ].close()])}[GDs](e){return Promise.all([this[l2e].destroy(e),!this[fH][JQn]&&this[fH].destroy(e),!this[JZ][JQn]&&this[JZ].destroy(e)])}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||WDs[r]||0,this.#i(n,o)?r==="https:"?this[JZ]:this[fH]:this[l2e]}#i(e,r){if(this.#s&&this.#o(),this.#t.length===0)return!0;if(this.#e==="*")return!1;for(let n=0;n{"use strict";p();var Ppe=require("node:assert"),{kRetryHandlerDefaultRetry:tqn}=al(),{RequestRetryError:u2e}=so(),zDs=MPe(),{isDisturbed:rqn,parseRangeHeader:nqn,wrapRequestBody:YDs}=Po();function KDs(t){let e=new Date(t).getTime();return isNaN(e)?0:e-Date.now()}a(KDs,"calculateRetryAfterHeader");var Rsr=class t{static{a(this,"RetryHandler")}constructor(e,{dispatch:r,handler:n}){let{retryOptions:o,...s}=e,{retry:c,maxRetries:l,maxTimeout:u,minTimeout:d,timeoutFactor:f,methods:h,errorCodes:m,retryAfter:g,statusCodes:A,throwOnError:y}=o??{};this.error=null,this.dispatch=r,this.handler=zDs.wrap(n),this.opts={...s,body:YDs(e.body)},this.retryOpts={throwOnError:y??!0,retry:c??t[tqn],retryAfter:g??!0,maxTimeout:u??30*1e3,minTimeout:d??500,timeoutFactor:f??2,maxRetries:l??5,methods:h??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:A??[500,502,503,504,429],errorCodes:m??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.headersSent=!1,this.start=0,this.end=null,this.etag=null}onResponseStartWithRetry(e,r,n,o,s){if(this.retryOpts.throwOnError){this.retryOpts.statusCodes.includes(r)===!1?(this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o)):this.error=s;return}if(rqn(this.opts.body)){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o);return}function c(l){if(l){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o),e.resume();return}this.error=s,e.resume()}a(c,"shouldRetry"),e.pause(),this.retryOpts.retry(s,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},c.bind(this))}onRequestStart(e,r){this.headersSent||this.handler.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.handler.onRequestUpgrade?.(e,r,n,o)}static[tqn](e,{state:r,opts:n},o){let{statusCode:s,code:c,headers:l}=e,{method:u,retryOptions:d}=n,{maxRetries:f,minTimeout:h,maxTimeout:m,timeoutFactor:g,statusCodes:A,errorCodes:y,methods:E}=d,{counter:_}=r;if(c&&c!=="UND_ERR_REQ_RETRY"&&!y.includes(c)){o(e);return}if(Array.isArray(E)&&!E.includes(u)){o(e);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){o(e);return}if(_>f){o(e);return}let v=l?.["retry-after"];v&&(v=Number(v),v=Number.isNaN(v)?KDs(l["retry-after"]):v*1e3);let b=v>0?Math.min(v,m):Math.min(h*g**(_-1),m);setTimeout(()=>o(null),b)}onResponseStart(e,r,n,o){if(this.error=null,this.retryCount+=1,r>=300){let s=new u2e("Request failed",r,{headers:n,data:{count:this.retryCount}});this.onResponseStartWithRetry(e,r,n,o,s);return}if(this.headersSent){if(r!==206&&(this.start>0||r!==200))throw new u2e("server does not support the range header and the payload was partially consumed",r,{headers:n,data:{count:this.retryCount}});let s=nqn(n["content-range"]);if(!s)throw new u2e("Content-Range mismatch",r,{headers:n,data:{count:this.retryCount}});if(this.etag!=null&&this.etag!==n.etag)throw new u2e("ETag mismatch",r,{headers:n,data:{count:this.retryCount}});let{start:c,size:l,end:u=l?l-1:null}=s;Ppe(this.start===c,"content-range mismatch"),Ppe(this.end==null||this.end===u,"content-range mismatch");return}if(this.end==null){if(r===206){let s=nqn(n["content-range"]);if(s==null){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o);return}let{start:c,size:l,end:u=l?l-1:null}=s;Ppe(c!=null&&Number.isFinite(c),"content-range mismatch"),Ppe(u!=null&&Number.isFinite(u),"invalid content-length"),this.start=c,this.end=u}if(this.end==null){let s=n["content-length"];this.end=s!=null?Number(s)-1:null}Ppe(Number.isFinite(this.start)),Ppe(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=!0,this.etag=n.etag!=null?n.etag:null,this.etag!=null&&this.etag[0]==="W"&&this.etag[1]==="/"&&(this.etag=null),this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o)}else throw new u2e("Request failed",r,{headers:n,data:{count:this.retryCount}})}onResponseData(e,r){this.error||(this.start+=r.length,this.handler.onResponseData?.(e,r))}onResponseEnd(e,r){if(this.error&&this.retryOpts.throwOnError)throw this.error;if(!this.error)return this.retryCount=0,this.handler.onResponseEnd?.(e,r);this.retry(e)}retry(e){if(this.start!==0){let r={range:`bytes=${this.start}-${this.end??""}`};this.etag!=null&&(r["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...r}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(r){this.handler.onResponseError?.(e,r)}}onResponseError(e,r){if(e?.aborted||rqn(this.opts.body)){this.handler.onResponseError?.(e,r);return}function n(o){if(!o){this.retry(e);return}this.handler?.onResponseError?.(e,o)}a(n,"shouldRetry"),this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(r,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},n.bind(this))}};iqn.exports=Rsr});var sqn=I((hdf,oqn)=>{"use strict";p();var JDs=OPe(),ZDs=Nst(),ksr=class extends JDs{static{a(this,"RetryAgent")}#e=null;#t=null;constructor(e,r={}){super(r),this.#e=e,this.#t=r}dispatch(e,r){let n=new ZDs({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:r});return this.#e.dispatch(e,n)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}};oqn.exports=ksr});var lqn=I((Adf,cqn)=>{"use strict";p();var{InvalidArgumentError:aqn}=so(),XDs=sH(),Psr=class extends XDs{static{a(this,"H2CClient")}constructor(e,r){if(typeof e=="string"&&(e=new URL(e)),e.protocol!=="http:")throw new aqn("h2c-client: Only h2c protocol is supported");let{maxConcurrentStreams:n,pipelining:o,...s}=r??{},c=100,l=100;if(n!=null&&Number.isInteger(n)&&n>0&&(c=n),o!=null&&Number.isInteger(o)&&o>0&&(l=o),l>c)throw new aqn("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(e,{...s,maxConcurrentStreams:c,pipelining:l,allowH2:!0,useH2c:!0})}};cqn.exports=Psr});var yqn=I((_df,Aqn)=>{"use strict";p();var pqn=require("node:assert"),{Readable:eNs}=require("node:stream"),{RequestAbortedError:hqn,NotSupportedError:tNs,InvalidArgumentError:rNs,AbortError:Mst}=so(),mqn=Po(),{ReadableStreamFrom:nNs}=Po(),kT=Symbol("kConsume"),Ost=Symbol("kReading"),ZZ=Symbol("kBody"),uqn=Symbol("kAbort"),gqn=Symbol("kContentType"),Dsr=Symbol("kContentLength"),Nsr=Symbol("kUsed"),Lst=Symbol("kBytesRead"),iNs=a(()=>{},"noop"),Msr=class extends eNs{static{a(this,"BodyReadable")}constructor({resume:e,abort:r,contentType:n="",contentLength:o,highWaterMark:s=64*1024}){super({autoDestroy:!0,read:e,highWaterMark:s}),this._readableState.dataEmitted=!1,this[uqn]=r,this[kT]=null,this[Lst]=0,this[ZZ]=null,this[Nsr]=!1,this[gqn]=n,this[Dsr]=Number.isFinite(o)?o:null,this[Ost]=!1}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new hqn),e&&this[uqn](),this[Nsr]?r(e):setImmediate(r,e)}on(e,r){return(e==="data"||e==="readable")&&(this[Ost]=!0,this[Nsr]=!0),super.on(e,r)}addListener(e,r){return this.on(e,r)}off(e,r){let n=super.off(e,r);return(e==="data"||e==="readable")&&(this[Ost]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,r){return this.off(e,r)}push(e){return e&&(this[Lst]+=e.length,this[kT])?(Lsr(this[kT],e),this[Ost]?super.push(e):!0):super.push(e)}text(){return d2e(this,"text")}json(){return d2e(this,"json")}blob(){return d2e(this,"blob")}bytes(){return d2e(this,"bytes")}arrayBuffer(){return d2e(this,"arrayBuffer")}async formData(){throw new tNs}get bodyUsed(){return mqn.isDisturbed(this)}get body(){return this[ZZ]||(this[ZZ]=nNs(this),this[kT]&&(this[ZZ].getReader(),pqn(this[ZZ].locked))),this[ZZ]}dump(e){let r=e?.signal;if(r!=null&&(typeof r!="object"||!("aborted"in r)))return Promise.reject(new rNs("signal must be an AbortSignal"));let n=e?.limit&&Number.isFinite(e.limit)?e.limit:128*1024;return r?.aborted?Promise.reject(r.reason??new Mst):this._readableState.closeEmitted?Promise.resolve(null):new Promise((o,s)=>{if((this[Dsr]&&this[Dsr]>n||this[Lst]>n)&&this.destroy(new Mst),r){let c=a(()=>{this.destroy(r.reason??new Mst)},"onAbort");r.addEventListener("abort",c),this.on("close",function(){r.removeEventListener("abort",c),r.aborted?s(r.reason??new Mst):o(null)})}else this.on("close",o);this.on("error",iNs).on("data",()=>{this[Lst]>n&&this.destroy()}).resume()})}setEncoding(e){return Buffer.isEncoding(e)&&(this._readableState.encoding=e),this}};function oNs(t){return t[ZZ]?.locked===!0||t[kT]!==null}a(oNs,"isLocked");function sNs(t){return mqn.isDisturbed(t)||oNs(t)}a(sNs,"isUnusable");function d2e(t,e){return pqn(!t[kT]),new Promise((r,n)=>{if(sNs(t)){let o=t._readableState;o.destroyed&&o.closeEmitted===!1?t.on("error",n).on("close",()=>{n(new TypeError("unusable"))}):n(o.errored??new TypeError("unusable"))}else queueMicrotask(()=>{t[kT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){Bsr(this[kT],o)}).on("close",function(){this[kT].body!==null&&Bsr(this[kT],new hqn)}),aNs(t[kT])})})}a(d2e,"consume");function aNs(t){if(t.body===null)return;let{_readableState:e}=t.stream;if(e.bufferIndex){let r=e.bufferIndex,n=e.buffer.length;for(let o=r;o2&&n[0]===239&&n[1]===187&&n[2]===191?3:0;return!r||r==="utf8"||r==="utf-8"?n.utf8Slice(s,o):n.subarray(s,o).toString(r)}a(Osr,"chunksDecode");function dqn(t,e){if(t.length===0||e===0)return new Uint8Array(0);if(t.length===1)return new Uint8Array(t[0]);let r=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer),n=0;for(let o=0;o{"use strict";p();var cNs=require("node:assert"),{AsyncResource:lNs}=require("node:async_hooks"),{Readable:uNs}=yqn(),{InvalidArgumentError:Dpe,RequestAbortedError:Eqn}=so(),Yw=Po();function f2e(){}a(f2e,"noop");var Bst=class extends lNs{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Dpe("invalid opts");let{signal:n,method:o,opaque:s,body:c,onInfo:l,responseHeaders:u,highWaterMark:d}=e;try{if(typeof r!="function")throw new Dpe("invalid callback");if(d!=null&&(!Number.isFinite(d)||d<0))throw new Dpe("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Dpe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Dpe("invalid method");if(l&&typeof l!="function")throw new Dpe("invalid onInfo callback");super("UNDICI_REQUEST")}catch(f){throw Yw.isStream(c)&&Yw.destroy(c.on("error",f2e),f),f}this.method=o,this.responseHeaders=u||null,this.opaque=s||null,this.callback=r,this.res=null,this.abort=null,this.body=c,this.trailers={},this.context=null,this.onInfo=l||null,this.highWaterMark=d,this.reason=null,this.removeAbortListener=null,n?.aborted?this.reason=n.reason??new Eqn:n&&(this.removeAbortListener=Yw.addAbortListener(n,()=>{this.reason=n.reason??new Eqn,this.res?Yw.destroy(this.res.on("error",f2e),this.reason):this.abort&&this.abort(this.reason)}))}onConnect(e,r){if(this.reason){e(this.reason);return}cNs(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{callback:s,opaque:c,abort:l,context:u,responseHeaders:d,highWaterMark:f}=this,h=d==="raw"?Yw.parseRawHeaders(r):Yw.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?Yw.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new uNs({resume:n,abort:l,contentType:g,contentLength:this.method!=="HEAD"&&A?Number(A):null,highWaterMark:f});if(this.removeAbortListener&&(y.on("close",this.removeAbortListener),this.removeAbortListener=null),this.callback=null,this.res=y,s!==null)try{this.runInAsyncScope(s,null,null,{statusCode:e,statusText:o,headers:h,trailers:this.trailers,opaque:c,body:y,context:u})}catch(E){this.res=null,Yw.destroy(y.on("error",f2e),E),queueMicrotask(()=>{throw E})}}onData(e){return this.res.push(e)}onComplete(e){Yw.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:r,callback:n,body:o,opaque:s}=this;n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:s})})),r&&(this.res=null,queueMicrotask(()=>{Yw.destroy(r.on("error",f2e),e)})),o&&(this.body=null,Yw.isStream(o)&&(o.on("error",f2e),Yw.destroy(o,e))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}};function _qn(t,e){if(e===void 0)return new Promise((r,n)=>{_qn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Bst(t,e);this.dispatch(t,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(_qn,"request");Fsr.exports=_qn;Fsr.exports.RequestHandler=Bst});var p2e=I((Idf,Sqn)=>{"use strict";p();var{addAbortListener:dNs}=Po(),{RequestAbortedError:fNs}=so(),Npe=Symbol("kListener"),q5=Symbol("kSignal");function Cqn(t){t.abort?t.abort(t[q5]?.reason):t.reason=t[q5]?.reason??new fNs,bqn(t)}a(Cqn,"abort");function pNs(t,e){if(t.reason=null,t[q5]=null,t[Npe]=null,!!e){if(e.aborted){Cqn(t);return}t[q5]=e,t[Npe]=()=>{Cqn(t)},dNs(t[q5],t[Npe])}}a(pNs,"addSignal");function bqn(t){t[q5]&&("removeEventListener"in t[q5]?t[q5].removeEventListener("abort",t[Npe]):t[q5].removeListener("abort",t[Npe]),t[q5]=null,t[Npe]=null)}a(bqn,"removeSignal");Sqn.exports={addSignal:pNs,removeSignal:bqn}});var wqn=I((Rdf,xqn)=>{"use strict";p();var hNs=require("node:assert"),{finished:mNs}=require("node:stream"),{AsyncResource:gNs}=require("node:async_hooks"),{InvalidArgumentError:Mpe,InvalidReturnValueError:ANs}=so(),l8=Po(),{addSignal:yNs,removeSignal:Tqn}=p2e();function ENs(){}a(ENs,"noop");var Usr=class extends gNs{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new Mpe("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d}=e;try{if(typeof n!="function")throw new Mpe("invalid callback");if(typeof r!="function")throw new Mpe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new Mpe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new Mpe("invalid method");if(u&&typeof u!="function")throw new Mpe("invalid onInfo callback");super("UNDICI_STREAM")}catch(f){throw l8.isStream(l)&&l8.destroy(l.on("error",ENs),f),f}this.responseHeaders=d||null,this.opaque=c||null,this.factory=r,this.callback=n,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=l,this.onInfo=u||null,l8.isStream(l)&&l.on("error",f=>{this.onError(f)}),yNs(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}hNs(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{factory:s,opaque:c,context:l,responseHeaders:u}=this,d=u==="raw"?l8.parseRawHeaders(r):l8.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:d});return}if(this.factory=null,s===null)return;let f=this.runInAsyncScope(s,null,{statusCode:e,headers:d,opaque:c,context:l});if(!f||typeof f.write!="function"||typeof f.end!="function"||typeof f.on!="function")throw new ANs("expected Writable");return mNs(f,{readable:!1},m=>{let{callback:g,res:A,opaque:y,trailers:E,abort:_}=this;this.res=null,(m||!A?.readable)&&l8.destroy(A,m),this.callback=null,this.runInAsyncScope(g,null,m||null,{opaque:y,trailers:E}),m&&_()}),f.on("drain",n),this.res=f,(f.writableNeedDrain!==void 0?f.writableNeedDrain:f._writableState?.needDrain)!==!0}onData(e){let{res:r}=this;return r?r.write(e):!0}onComplete(e){let{res:r}=this;Tqn(this),r&&(this.trailers=l8.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;Tqn(this),this.factory=null,r?(this.res=null,l8.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,l8.destroy(s,e))}};function Iqn(t,e,r){if(r===void 0)return new Promise((n,o)=>{Iqn.call(this,t,e,(s,c)=>s?o(s):n(c))});try{let n=new Usr(t,e,r);this.dispatch(t,n)}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(Iqn,"stream");xqn.exports=Iqn});var Dqn=I((Ddf,Pqn)=>{"use strict";p();var{Readable:kqn,Duplex:_Ns,PassThrough:vNs}=require("node:stream"),CNs=require("node:assert"),{AsyncResource:bNs}=require("node:async_hooks"),{InvalidArgumentError:h2e,InvalidReturnValueError:SNs,RequestAbortedError:Qsr}=so(),j5=Po(),{addSignal:TNs,removeSignal:INs}=p2e();function Rqn(){}a(Rqn,"noop");var Ope=Symbol("resume"),qsr=class extends kqn{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[Ope]=null}_read(){let{[Ope]:e}=this;e&&(this[Ope]=null,e())}_destroy(e,r){this._read(),r(e)}},jsr=class extends kqn{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[Ope]=e}_read(){this[Ope]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new Qsr),r(e)}},Hsr=class extends bNs{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new h2e("invalid opts");if(typeof r!="function")throw new h2e("invalid handler");let{signal:n,method:o,opaque:s,onInfo:c,responseHeaders:l}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new h2e("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new h2e("invalid method");if(c&&typeof c!="function")throw new h2e("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=s||null,this.responseHeaders=l||null,this.handler=r,this.abort=null,this.context=null,this.onInfo=c||null,this.req=new qsr().on("error",Rqn),this.ret=new _Ns({readableObjectMode:e.objectMode,autoDestroy:!0,read:a(()=>{let{body:u}=this;u?.resume&&u.resume()},"read"),write:a((u,d,f)=>{let{req:h}=this;h.push(u,d)||h._readableState.destroyed?f():h[Ope]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new Qsr),A&&u&&A(),j5.destroy(f,u),j5.destroy(h,u),j5.destroy(m,u),INs(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,TNs(this,n)}onConnect(e,r){let{res:n}=this;if(this.reason){e(this.reason);return}CNs(!n,"pipeline cannot be retried"),this.abort=e,this.context=r}onHeaders(e,r,n){let{opaque:o,handler:s,context:c}=this;if(e<200){if(this.onInfo){let u=this.responseHeaders==="raw"?j5.parseRawHeaders(r):j5.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new jsr(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?j5.parseRawHeaders(r):j5.parseHeaders(r);l=this.runInAsyncScope(s,null,{statusCode:e,headers:u,opaque:o,body:this.res,context:c})}catch(u){throw this.res.on("error",Rqn),u}if(!l||typeof l.on!="function")throw new SNs("expected Readable");l.on("data",u=>{let{ret:d,body:f}=this;!d.push(u)&&f.pause&&f.pause()}).on("error",u=>{let{ret:d}=this;j5.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||j5.destroy(u,new Qsr)}),this.body=l}onData(e){let{res:r}=this;return r.push(e)}onComplete(e){let{res:r}=this;r.push(null)}onError(e){let{ret:r}=this;this.handler=null,j5.destroy(r,e)}};function xNs(t,e){try{let r=new Hsr(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new vNs().destroy(r)}}a(xNs,"pipeline");Pqn.exports=xNs});var Fqn=I((Odf,Bqn)=>{"use strict";p();var{InvalidArgumentError:Gsr,SocketError:wNs}=so(),{AsyncResource:RNs}=require("node:async_hooks"),Nqn=require("node:assert"),Mqn=Po(),{kHTTP2Stream:kNs}=al(),{addSignal:PNs,removeSignal:Oqn}=p2e(),$sr=class extends RNs{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Gsr("invalid opts");if(typeof r!="function")throw new Gsr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Gsr("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=s||null,this.opaque=o||null,this.callback=r,this.abort=null,this.context=null,PNs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}Nqn(this.callback),this.abort=e,this.context=null}onHeaders(){throw new wNs("bad upgrade",null)}onUpgrade(e,r,n){Nqn(n[kNs]===!0?e===200:e===101);let{callback:o,opaque:s,context:c}=this;Oqn(this),this.callback=null;let l=this.responseHeaders==="raw"?Mqn.parseRawHeaders(r):Mqn.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;Oqn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function Lqn(t,e){if(e===void 0)return new Promise((r,n)=>{Lqn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new $sr(t,e),n={...t,method:t.method||"GET",upgrade:t.protocol||"Websocket"};this.dispatch(n,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(Lqn,"upgrade");Bqn.exports=Lqn});var Hqn=I((Fdf,jqn)=>{"use strict";p();var DNs=require("node:assert"),{AsyncResource:NNs}=require("node:async_hooks"),{InvalidArgumentError:Vsr,SocketError:MNs}=so(),Uqn=Po(),{addSignal:ONs,removeSignal:Qqn}=p2e(),Wsr=class extends NNs{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Vsr("invalid opts");if(typeof r!="function")throw new Vsr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Vsr("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,ONs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}DNs(this.callback),this.abort=e,this.context=r}onHeaders(){throw new MNs("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;Qqn(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?Uqn.parseRawHeaders(r):Uqn.parseHeaders(r)),this.runInAsyncScope(o,null,null,{statusCode:e,headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;Qqn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function qqn(t,e){if(e===void 0)return new Promise((r,n)=>{qqn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Wsr(t,e),n={...t,method:"CONNECT"};this.dispatch(n,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(qqn,"connect");jqn.exports=qqn});var Gqn=I((qdf,Lpe)=>{"use strict";p();Lpe.exports.request=vqn();Lpe.exports.stream=wqn();Lpe.exports.pipeline=Dqn();Lpe.exports.upgrade=Fqn();Lpe.exports.connect=Hqn()});var Ysr=I((Hdf,Vqn)=>{"use strict";p();var{UndiciError:LNs}=so(),$qn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),zsr=class extends LNs{static{a(this,"MockNotMatchedError")}constructor(e){super(e),this.name="MockNotMatchedError",this.message=e||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](e){return e&&e[$qn]===!0}get[$qn](){return!0}};Vqn.exports={MockNotMatchedError:zsr}});var XZ=I((Vdf,Wqn)=>{"use strict";p();Wqn.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOriginalDispatch:Symbol("original dispatch"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected"),kIgnoreTrailingSlash:Symbol("ignore trailing slash"),kMockAgentMockCallHistoryInstance:Symbol("mock agent mock call history name"),kMockAgentRegisterCallHistory:Symbol("mock agent register mock call history"),kMockAgentAddCallHistoryLog:Symbol("mock agent add call history log"),kMockAgentIsCallHistoryEnabled:Symbol("mock agent is call history enabled"),kMockAgentAcceptsNonStandardSearchParameters:Symbol("mock agent accepts non standard search parameters"),kMockCallHistoryAddLog:Symbol("mock call history add log"),kTotalDispatchCount:Symbol("total dispatch count")}});var m2e=I((zdf,ijn)=>{"use strict";p();var{MockNotMatchedError:Bpe}=Ysr(),{kDispatches:eX,kMockAgent:BNs,kOriginalDispatch:FNs,kOrigin:UNs,kGetNetConnect:QNs,kTotalDispatchCount:Zsr}=XZ(),{serializePathWithQuery:qNs}=Po(),{STATUS_CODES:jNs}=require("node:http"),{types:{isPromise:HNs}}=require("node:util"),{InvalidArgumentError:Ksr}=so();function H5(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(H5,"matchValue");function Yqn(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(Yqn,"lowerCaseEntries");function Kqn(t,e){if(Array.isArray(t)){for(let r=0;r"u")return!0;if(typeof e!="object"||typeof t.headers!="object")return!1;for(let[r,n]of Object.entries(t.headers)){let o=Kqn(e,r);if(!H5(n,o))return!1}return!0}a(Jqn,"matchHeaders");function GNs(t){if(typeof t!="string")return t;let e=new URLSearchParams(t),r=new URLSearchParams;for(let[n,o]of e.entries()){if(n=n.replace("[]",""),/^(['"]).*\1$/.test(o)){r.append(n,o);continue}if(o.includes(",")){let c=o.split(",");for(let l of c)r.append(n,l);continue}r.append(n,o)}return r}a(GNs,"normalizeSearchParams");function Jsr(t){if(typeof t!="string")return t;let e=t.split("?",3);if(e.length!==2)return t;let r=new URLSearchParams(e.pop());return r.sort(),[...e,r.toString()].join("?")}a(Jsr,"safeUrl");function $Ns(t,{path:e,method:r,body:n,headers:o}){let s=H5(t.path,e),c=H5(t.method,r),l=typeof t.body<"u"?H5(t.body,n):!0,u=Jqn(t,o);return s&&c&&l&&u}a($Ns,"matchKey");function Zqn(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t?t.toString():""}a(Zqn,"getResponseData");function Xqn(t,e){let r=e.query?qNs(e.path,e.query):e.path,n=typeof r=="string"?Jsr(r):r,o=zqn(n),s=t.filter(({consumed:c})=>!c).filter(({path:c,ignoreTrailingSlash:l})=>l?H5(zqn(Jsr(c)),o):H5(Jsr(c),n));if(s.length===0)throw new Bpe(`Mock dispatch not matched for path '${n}'`);if(s=s.filter(({method:c})=>H5(c,e.method)),s.length===0)throw new Bpe(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(s=s.filter(({body:c})=>typeof c<"u"?H5(c,e.body):!0),s.length===0)throw new Bpe(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(s=s.filter(c=>Jqn(c,e.headers)),s.length===0){let c=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new Bpe(`Mock dispatch not matched for headers '${c}' on path '${n}'`)}return s[0]}a(Xqn,"getMockDispatch");function VNs(t,e,r,n){let o={timesInvoked:0,times:1,persist:!1,consumed:!1,...n},s=typeof r=="function"?{callback:r}:{...r},c={...o,...e,pending:!0,data:{error:null,...s}};return t.push(c),t[Zsr]=(t[Zsr]||0)+1,c}a(VNs,"addMockDispatch");function Xsr(t,e){let r=t.findIndex(n=>n.consumed?$Ns(n,e):!1);r!==-1&&t.splice(r,1)}a(Xsr,"deleteMockDispatch");function zqn(t){for(;t.endsWith("/");)t=t.slice(0,-1);return t.length===0&&(t="/"),t}a(zqn,"removeTrailingSlash");function ejn(t){let{path:e,method:r,body:n,headers:o,query:s}=t;return{path:e,method:r,body:n,headers:o,query:s}}a(ejn,"buildKey");function ear(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?A=setTimeout(()=>{A=null,E(this[eX])},d):E(this[eX]);function E(v,b=s){if(g)return;let T=Array.isArray(t.headers)?tar(t.headers):t.headers,w=typeof b=="function"?b({...t,headers:T}):b;if(HNs(w))return w.then(D=>E(v,D));if(g)return;let R=Zqn(w),x=ear(c),P=ear(l);e.onHeaders?.(o,x,_,tjn(o)),e.onData?.(Buffer.from(R)),e.onComplete?.(P),Xsr(v,r)}a(E,"handleReply");function _(){}return a(_,"resume"),!0}a(rjn,"mockDispatch");function zNs(){let t=this[BNs],e=this[UNs],r=this[FNs];return a(function(o,s){if(t.isMockActive)try{rjn.call(this,o,s)}catch(c){if(c.code==="UND_MOCK_ERR_MOCK_NOT_MATCHED"){let l=t[QNs](),u=this[eX][Zsr]||this[eX].length,f=`, ${this[eX].filter(({consumed:h})=>!h).length} interceptor(s) remaining out of ${u} defined`;if(l===!1)throw new Bpe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)${f}`);if(njn(l,e))r.call(this,o,s);else throw new Bpe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect is not enabled for this origin)${f}`)}else throw c}else r.call(this,o,s)},"dispatch")}a(zNs,"buildMockDispatch");function njn(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>H5(n,r.host)))}a(njn,"checkNetConnect");function YNs(t){return typeof t!="string"&&!(t instanceof URL)?t:t instanceof URL?t.origin:t.toLowerCase()}a(YNs,"normalizeOrigin");function KNs(t){let{agent:e,...r}=t;if("enableCallHistory"in r&&typeof r.enableCallHistory!="boolean")throw new Ksr("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in r&&typeof r.acceptNonStandardSearchParameters!="boolean")throw new Ksr("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in r&&typeof r.ignoreTrailingSlash!="boolean")throw new Ksr("options.ignoreTrailingSlash must to be a boolean");return r}a(KNs,"buildAndValidateMockOptions");ijn.exports={getResponseData:Zqn,getMockDispatch:Xqn,addMockDispatch:VNs,deleteMockDispatch:Xsr,buildKey:ejn,generateKeyValues:ear,matchValue:H5,getResponse:WNs,getStatusText:tjn,mockDispatch:rjn,buildMockDispatch:zNs,checkNetConnect:njn,buildAndValidateMockOptions:KNs,getHeaderByName:Kqn,buildHeadersFromArray:tar,normalizeSearchParams:GNs,normalizeOrigin:YNs}});var car=I((Jdf,aar)=>{"use strict";p();var{getResponseData:JNs,buildKey:ZNs,addMockDispatch:rar}=m2e(),{kDispatches:Fst,kDispatchKey:Ust,kDefaultHeaders:nar,kDefaultTrailers:iar,kContentLength:oar,kMockDispatch:Qst,kIgnoreTrailingSlash:qst}=XZ(),{InvalidArgumentError:G5}=so(),{serializePathWithQuery:XNs}=Po(),Fpe=class{static{a(this,"MockScope")}constructor(e){this[Qst]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new G5("waitInMs must be a valid integer > 0");return this[Qst].delay=e,this}persist(){return this[Qst].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new G5("repeatTimes must be a valid integer > 0");return this[Qst].times=e,this}},sar=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new G5("opts must be an object");if(typeof e.path>"u")throw new G5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=XNs(e.path,e.query);else{let n=new URL(e.path,"data://");e.path=n.pathname+n.search}typeof e.method=="string"&&(e.method=e.method.toUpperCase()),this[Ust]=ZNs(e),this[Fst]=r,this[qst]=e.ignoreTrailingSlash??!1,this[nar]={},this[iar]={},this[oar]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=JNs(r),s=this[oar]?{"content-length":o.length}:{},c={...this[nar],...s,...n.headers},l={...this[iar],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new G5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new G5("responseOptions must be an object")}reply(e){if(typeof e=="function"){let s=a(l=>{let u=e(l);if(typeof u!="object"||u===null)throw new G5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=rar(this[Fst],this[Ust],s,{ignoreTrailingSlash:this[qst]});return new Fpe(c)}let r={statusCode:e,data:arguments[1]===void 0?"":arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(r);let n=this.createMockScopeDispatchData(r),o=rar(this[Fst],this[Ust],n,{ignoreTrailingSlash:this[qst]});return new Fpe(o)}replyWithError(e){if(typeof e>"u")throw new G5("error must be defined");let r=rar(this[Fst],this[Ust],{error:e},{ignoreTrailingSlash:this[qst]});return new Fpe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new G5("headers must be defined");return this[nar]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new G5("trailers must be defined");return this[iar]=e,this}replyContentLength(){return this[oar]=!0,this}};aar.exports.MockInterceptor=sar;aar.exports.MockScope=Fpe});var far=I((eff,djn)=>{"use strict";p();var{promisify:eMs}=require("node:util"),tMs=sH(),{buildMockDispatch:rMs}=m2e(),{kDispatches:lar,kMockAgent:ojn,kClose:sjn,kOriginalClose:ajn,kOrigin:cjn,kOriginalDispatch:nMs,kConnected:uar,kIgnoreTrailingSlash:ljn}=XZ(),{MockInterceptor:iMs}=car(),ujn=al(),{InvalidArgumentError:oMs}=so(),dar=class extends tMs{static{a(this,"MockClient")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new oMs("Argument opts.agent must implement Agent");super(e,r),this[ojn]=r.agent,this[cjn]=e,this[ljn]=r.ignoreTrailingSlash??!1,this[lar]=[],this[uar]=1,this[nMs]=this.dispatch,this[ajn]=this.close.bind(this),this.dispatch=rMs.call(this),this.close=this[sjn]}get[ujn.kConnected](){return this[uar]}intercept(e){return new iMs(e&&{ignoreTrailingSlash:this[ljn],...e},this[lar])}cleanMocks(){this[lar]=[]}async[sjn](){await eMs(this[ajn])(),this[uar]=0,this[ojn][ujn.kClients].delete(this[cjn])}};djn.exports=dar});var mar=I((nff,har)=>{"use strict";p();var{kMockCallHistoryAddLog:sMs}=XZ(),{InvalidArgumentError:mH}=so();function pH(t,e,r,n,o){switch(e.operator){case"OR":return n.push(...r(t,o)),n;case"AND":return r(t,n);default:throw new mH("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}a(pH,"handleFilterCallsWithOptions");function aMs(t={}){let e={};if("operator"in t){if(typeof t.operator!="string"||t.operator.toUpperCase()!=="OR"&&t.operator.toUpperCase()!=="AND")throw new mH("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...e,operator:t.operator.toUpperCase()}}return e}a(aMs,"buildAndValidateFilterCallsOptions");function hH(t){return(e,r)=>{if(typeof e=="string"||e==null)return r.filter(n=>n[t]===e);if(e instanceof RegExp)return r.filter(n=>e.test(n[t]));throw new mH(`${t} parameter should be one of string, regexp, undefined or null`)}}a(hH,"makeFilterCalls");function cMs(t){try{let e=new URL(t.path,t.origin);return e.search.length!==0||(e.search=new URLSearchParams(t.query).toString()),e}catch(e){throw new mH("An error occurred when computing MockCallHistoryLog.url",{cause:e})}}a(cMs,"computeUrlWithMaybeSearchParameters");var jst=class{static{a(this,"MockCallHistoryLog")}constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;let r=cMs(e);this.fullUrl=r.toString(),this.origin=r.origin,this.path=r.pathname,this.searchParams=Object.fromEntries(r.searchParams),this.protocol=r.protocol,this.host=r.host,this.port=r.port,this.hash=r.hash}toMap(){return new Map([["protocol",this.protocol],["host",this.host],["port",this.port],["origin",this.origin],["path",this.path],["hash",this.hash],["searchParams",this.searchParams],["fullUrl",this.fullUrl],["method",this.method],["body",this.body],["headers",this.headers]])}toString(){let e={betweenKeyValueSeparator:"->",betweenPairSeparator:"|"},r="";return this.toMap().forEach((n,o)=>{(typeof n=="string"||n===void 0||n===null)&&(r=`${r}${o}${e.betweenKeyValueSeparator}${n}${e.betweenPairSeparator}`),(typeof n=="object"&&n!==null||Array.isArray(n))&&(r=`${r}${o}${e.betweenKeyValueSeparator}${JSON.stringify(n)}${e.betweenPairSeparator}`)}),r.slice(0,-1)}},par=class{static{a(this,"MockCallHistory")}logs=[];calls(){return this.logs}firstCall(){return this.logs.at(0)}lastCall(){return this.logs.at(-1)}nthCall(e){if(typeof e!="number")throw new mH("nthCall must be called with a number");if(!Number.isInteger(e))throw new mH("nthCall must be called with an integer");if(Math.sign(e)!==1)throw new mH("nthCall must be called with a positive value. use firstCall or lastCall instead");return this.logs.at(e-1)}filterCalls(e,r){if(this.logs.length===0)return this.logs;if(typeof e=="function")return this.logs.filter(e);if(e instanceof RegExp)return this.logs.filter(n=>e.test(n.toString()));if(typeof e=="object"&&e!==null){if(Object.keys(e).length===0)return this.logs;let n={operator:"OR",...aMs(r)},o=n.operator==="AND"?this.logs:[];return"protocol"in e&&(o=pH(e.protocol,n,this.filterCallsByProtocol,o,this.logs)),"host"in e&&(o=pH(e.host,n,this.filterCallsByHost,o,this.logs)),"port"in e&&(o=pH(e.port,n,this.filterCallsByPort,o,this.logs)),"origin"in e&&(o=pH(e.origin,n,this.filterCallsByOrigin,o,this.logs)),"path"in e&&(o=pH(e.path,n,this.filterCallsByPath,o,this.logs)),"hash"in e&&(o=pH(e.hash,n,this.filterCallsByHash,o,this.logs)),"fullUrl"in e&&(o=pH(e.fullUrl,n,this.filterCallsByFullUrl,o,this.logs)),"method"in e&&(o=pH(e.method,n,this.filterCallsByMethod,o,this.logs)),[...new Set(o)]}throw new mH("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=hH.call(this,"protocol");filterCallsByHost=hH.call(this,"host");filterCallsByPort=hH.call(this,"port");filterCallsByOrigin=hH.call(this,"origin");filterCallsByPath=hH.call(this,"path");filterCallsByHash=hH.call(this,"hash");filterCallsByFullUrl=hH.call(this,"fullUrl");filterCallsByMethod=hH.call(this,"method");clear(){this.logs=[]}[sMs](e){let r=new jst(e);return this.logs.push(r),r}*[Symbol.iterator](){for(let e of this.calls())yield e}};har.exports.MockCallHistory=par;har.exports.MockCallHistoryLog=jst});var Ear=I((sff,yjn)=>{"use strict";p();var{promisify:lMs}=require("node:util"),uMs=HZ(),{buildMockDispatch:dMs}=m2e(),{kDispatches:gar,kMockAgent:fjn,kClose:pjn,kOriginalClose:hjn,kOrigin:mjn,kOriginalDispatch:fMs,kConnected:Aar,kIgnoreTrailingSlash:gjn}=XZ(),{MockInterceptor:pMs}=car(),Ajn=al(),{InvalidArgumentError:hMs}=so(),yar=class extends uMs{static{a(this,"MockPool")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new hMs("Argument opts.agent must implement Agent");super(e,r),this[fjn]=r.agent,this[mjn]=e,this[gjn]=r.ignoreTrailingSlash??!1,this[gar]=[],this[Aar]=1,this[fMs]=this.dispatch,this[hjn]=this.close.bind(this),this.dispatch=dMs.call(this),this.close=this[pjn]}get[Ajn.kConnected](){return this[Aar]}intercept(e){return new pMs(e&&{ignoreTrailingSlash:this[gjn],...e},this[gar])}cleanMocks(){this[gar]=[]}async[pjn](){await lMs(this[hjn])(),this[Aar]=0,this[fjn][Ajn.kClients].delete(this[mjn])}};yjn.exports=yar});var _jn=I((uff,Ejn)=>{"use strict";p();var{Transform:mMs}=require("node:stream"),{Console:gMs}=require("node:console"),AMs=process.versions.icu?"\u2705":"Y ",yMs=process.versions.icu?"\u274C":"N ";Ejn.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new mMs({transform(r,n,o){o(null,r)}}),this.logger=new gMs({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let r=e.map(({method:n,path:o,data:{statusCode:s},persist:c,times:l,timesInvoked:u,origin:d})=>({Method:n,Origin:d,Path:o,"Status code":s,Persistent:c?AMs:yMs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var Tar=I((pff,xjn)=>{"use strict";p();var{kClients:tX}=al(),EMs=VZ(),{kAgent:_ar,kMockAgentSet:Hst,kMockAgentGet:vjn,kDispatches:Car,kIsMockActive:Gst,kNetConnect:rX,kGetNetConnect:_Ms,kOptions:$st,kFactory:Vst,kMockAgentRegisterCallHistory:bar,kMockAgentIsCallHistoryEnabled:g2e,kMockAgentAddCallHistoryLog:Cjn,kMockAgentMockCallHistoryInstance:Upe,kMockAgentAcceptsNonStandardSearchParameters:bjn,kMockCallHistoryAddLog:vMs,kIgnoreTrailingSlash:Sjn}=XZ(),CMs=far(),bMs=Ear(),{matchValue:SMs,normalizeSearchParams:TMs,buildAndValidateMockOptions:IMs,normalizeOrigin:Tjn}=m2e(),{InvalidArgumentError:Ijn,UndiciError:xMs}=so(),wMs=OPe(),RMs=_jn(),{MockCallHistory:kMs}=mar(),Sar=class extends wMs{static{a(this,"MockAgent")}constructor(e={}){super(e);let r=IMs(e);if(this[rX]=!0,this[Gst]=!0,this[g2e]=r.enableCallHistory??!1,this[bjn]=r.acceptNonStandardSearchParameters??!1,this[Sjn]=r.ignoreTrailingSlash??!1,e?.agent&&typeof e.agent.dispatch!="function")throw new Ijn("Argument opts.agent must implement Agent");let n=e?.agent?e.agent:new EMs(e);this[_ar]=n,this[tX]=n[tX],this[$st]=r,this[g2e]&&this[bar]()}get(e){let r=Tjn(e),n=this[Sjn]?r.replace(/\/$/,""):r,o=this[vjn](n);return o||(o=this[Vst](n),this[Hst](n,o)),o}dispatch(e,r){e.origin=Tjn(e.origin),this.get(e.origin),this[Cjn](e);let n=this[bjn],o={...e};if(n&&o.path){let[s,c]=o.path.split("?"),l=TMs(c,n);o.path=`${s}?${l}`}return this[_ar].dispatch(o,r)}async close(){this.clearCallHistory(),await this[_ar].close(),this[tX].clear()}deactivate(){this[Gst]=!1}activate(){this[Gst]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[rX])?this[rX].push(e):this[rX]=[e];else if(typeof e>"u")this[rX]=!0;else throw new Ijn("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[rX]=!1}enableCallHistory(){return this[g2e]=!0,this}disableCallHistory(){return this[g2e]=!1,this}getCallHistory(){return this[Upe]}clearCallHistory(){this[Upe]!==void 0&&this[Upe].clear()}get isMockActive(){return this[Gst]}[bar](){this[Upe]===void 0&&(this[Upe]=new kMs)}[Cjn](e){this[g2e]&&(this[bar](),this[Upe][vMs](e))}[Hst](e,r){this[tX].set(e,{count:0,dispatcher:r})}[Vst](e){let r=Object.assign({agent:this},this[$st]);return this[$st]&&this[$st].connections===1?new CMs(e,r):new bMs(e,r)}[vjn](e){let r=this[tX].get(e);if(r?.dispatcher)return r.dispatcher;if(typeof e!="string"){let n=this[Vst]("http://localhost:9999");return this[Hst](e,n),n}for(let[n,o]of Array.from(this[tX]))if(o&&typeof n!="string"&&SMs(n,e)){let s=this[Vst](e);return this[Hst](e,s),s[Car]=o.dispatcher[Car],s}}[_Ms](){return this[rX]}pendingInterceptors(){let e=this[tX];return Array.from(e.entries()).flatMap(([r,n])=>n.dispatcher[Car].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new RMs}={}){let r=this.pendingInterceptors();if(r.length!==0)throw new xMs(r.length===1?`1 interceptor is pending: ${e.format(r)}`.trim():`${r.length} interceptors are pending: -${e.format(r)}`.trim())}};$Qn.exports=Psr});var Nsr=I((nlf,YQn)=>{"use strict";p();var{InvalidArgumentError:bDs}=ao(),{runtimeFeatures:SDs}=$F();function TDs(t={}){let{ignoreHeaders:e=[],excludeHeaders:r=[],matchHeaders:n=[],caseSensitive:o=!1}=t;return{ignore:new Set(e.map(s=>o?s:s.toLowerCase())),exclude:new Set(r.map(s=>o?s:s.toLowerCase())),match:new Set(n.map(s=>o?s:s.toLowerCase()))}}a(TDs,"createHeaderFilters");var VQn=SDs.has("crypto")?require("node:crypto"):null,IDs=VQn?.hash?t=>VQn.hash("sha256",t,"base64url"):t=>Buffer.from(t).toString("base64url");function zQn(t){return Array.isArray(t)&&(t.length&1)===0}a(zQn,"isUndiciHeaders");function xDs(t=[]){return t.length===0?()=>!1:a(function(r){let n;for(let o of t)if(typeof o=="string"){if(n||(n=r.toLowerCase()),n.includes(o.toLowerCase()))return!0}else if(o instanceof RegExp&&o.test(r))return!0;return!1},"isUrlExcluded")}a(xDs,"isUrlExcludedFactory");function wDs(t){let e={};if(!t)return e;if(zQn(t)){for(let r=0;r{"use strict";p();var{writeFile:kDs,readFile:PDs,mkdir:DDs}=require("node:fs/promises"),{dirname:NDs,resolve:KQn}=require("node:path"),{setTimeout:MDs,clearTimeout:JQn}=require("node:timers"),{InvalidArgumentError:ZQn,UndiciError:ODs}=ao(),{hashId:LDs,isUrlExcludedFactory:BDs,normalizeHeaders:XQn,createHeaderFilters:eqn}=Nsr();function JPe(t,e,r={}){let n=new URL(t.path,t.origin),o=t._normalizedHeaders||XQn(t.headers);return t._normalizedHeaders||(t._normalizedHeaders=o),{method:t.method||"GET",url:r.matchQuery!==!1?n.toString():`${n.origin}${n.pathname}`,headers:tqn(o,e,r),body:r.matchBody!==!1&&t.body?String(t.body):""}}a(JPe,"formatRequestKey");function tqn(t,e,r={}){if(!t||typeof t!="object")return{};let{caseSensitive:n=!1}=r,o={},{ignore:s,exclude:c,match:l}=e;for(let[u,d]of Object.entries(t)){let f=n?u:u.toLowerCase();c.has(f)||s.has(f)||l.size!==0&&!l.has(f)||(o[f]=d)}return o}a(tqn,"filterHeadersForMatching");function rqn(t,e,r={}){if(!t||typeof t!="object")return{};let{caseSensitive:n=!1}=r,o={},{exclude:s}=e;for(let[c,l]of Object.entries(t)){let u=n?c:c.toLowerCase();s.has(u)||(o[u]=l)}return o}a(rqn,"filterHeadersForStorage");function ZPe(t){let e=[t.method,t.url];if(t.headers&&typeof t.headers=="object"){let n=Object.keys(t.headers).sort();for(let o of n){let s=Array.isArray(t.headers[o])?t.headers[o]:[t.headers[o]];e.push(o);for(let c of s.sort())e.push(String(c))}}e.push(t.body);let r=e.join("|");return LDs(r)}a(ZPe,"createRequestHash");var Msr=class{static{a(this,"SnapshotRecorder")}#e;#t;#r=new Map;#n;#i=1/0;#o=!1;#s;constructor(e={}){this.#n=e.snapshotPath,this.#i=e.maxSnapshots||1/0,this.#o=e.autoFlush||!1,this.flushInterval=e.flushInterval||3e4,this._flushTimer=null,this.matchOptions={matchHeaders:e.matchHeaders||[],ignoreHeaders:e.ignoreHeaders||[],excludeHeaders:e.excludeHeaders||[],matchBody:e.matchBody!==!1,matchQuery:e.matchQuery!==!1,caseSensitive:e.caseSensitive||!1},this.#s=eqn(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#t=BDs(e.excludeUrls),this.#o&&this.#n&&this.#a()}async record(e,r){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let n=JPe(e,this.#s,this.matchOptions),o=ZPe(n),s=XQn(r.headers),c={statusCode:r.statusCode,headers:rqn(s,this.#s,this.matchOptions),body:Buffer.isBuffer(r.body)?r.body.toString("base64"):Buffer.from(String(r.body||"")).toString("base64"),trailers:r.trailers};if(this.#r.size>=this.#i&&!this.#r.has(o)){let u=this.#r.keys().next().value;this.#r.delete(u)}let l=this.#r.get(o);l&&l.responses?(l.responses.push(c),l.timestamp=new Date().toISOString()):this.#r.set(o,{request:n,responses:[c],callCount:0,timestamp:new Date().toISOString()}),this.#o&&this.#n&&this.#u()}isUrlExcluded(e){let r=new URL(e.path,e.origin).toString();return this.#t(r)}findSnapshot(e){if(!this.shouldPlayback(e)||this.isUrlExcluded(e))return;let r=JPe(e,this.#s,this.matchOptions),n=ZPe(r),o=this.#r.get(n);if(!o)return;let s=o.callCount||0,c=Math.min(s,o.responses.length-1);return o.callCount=s+1,{...o,response:o.responses[c]}}async loadSnapshots(e){let r=e||this.#n;if(!r)throw new ZQn("Snapshot path is required");try{let n=await PDs(KQn(r),"utf8"),o=JSON.parse(n);if(Array.isArray(o)){this.#r.clear();for(let{hash:s,snapshot:c}of o)this.#r.set(s,c)}else this.#r=new Map(Object.entries(o))}catch(n){if(n.code==="ENOENT")this.#r.clear();else throw new ODs(`Failed to load snapshots from ${r}`,{cause:n})}}async saveSnapshots(e){let r=e||this.#n;if(!r)throw new ZQn("Snapshot path is required");let n=KQn(r);await DDs(NDs(n),{recursive:!0});let o=Array.from(this.#r.entries()).map(([s,c])=>({hash:s,snapshot:c}));await kDs(n,JSON.stringify(o,null,2),{flush:!0})}clear(){this.#r.clear()}getSnapshots(){return Array.from(this.#r.values())}size(){return this.#r.size}resetCallCounts(){for(let e of this.#r.values())e.callCount=0}deleteSnapshot(e){let r=JPe(e,this.#s,this.matchOptions),n=ZPe(r);return this.#r.delete(n)}getSnapshotInfo(e){let r=JPe(e,this.#s,this.matchOptions),n=ZPe(r),o=this.#r.get(n);return o?{hash:n,request:o.request,responseCount:o.responses?o.responses.length:o.response?1:0,callCount:o.callCount||0,timestamp:o.timestamp}:null}replaceSnapshots(e){if(this.#r.clear(),Array.isArray(e))for(let{hash:r,snapshot:n}of e)this.#r.set(r,n);else e&&typeof e=="object"&&(this.#r=new Map(Object.entries(e)))}#a(){return this.#u()}#c(){this.#e&&(JQn(this.#e),this.saveSnapshots().catch(()=>{}),this.#e=null)}#u(){this.#e=MDs(()=>{this.saveSnapshots().catch(()=>{}),this.#o?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#c(),this.#e&&(JQn(this.#e),this.#e=null)}async close(){this.#n&&this.#r.size!==0&&await this.saveSnapshots(),this.destroy()}};nqn.exports={SnapshotRecorder:Msr,formatRequestKey:JPe,createRequestHash:ZPe,filterHeadersForMatching:tqn,filterHeadersForStorage:rqn,createHeaderFilters:eqn}});var aqn=I((llf,sqn)=>{"use strict";p();var FDs=LZ(),UDs=Dsr(),{SnapshotRecorder:QDs}=iqn(),qDs=hPe(),{InvalidArgumentError:jDs,UndiciError:HDs}=ao(),{validateSnapshotMode:GDs}=Nsr(),mb=Symbol("kSnapshotRecorder"),U5=Symbol("kSnapshotMode"),XPe=Symbol("kSnapshotPath"),Osr=Symbol("kSnapshotLoaded"),Est=Symbol("kRealAgent"),oqn=!1,Lsr=class extends UDs{static{a(this,"SnapshotAgent")}constructor(e={}){oqn||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),oqn=!0);let{mode:r="record",snapshotPath:n=null,...o}=e;if(super(o),GDs(r),(r==="playback"||r==="update")&&!n)throw new jDs(`snapshotPath is required when mode is '${r}'`);this[U5]=r,this[XPe]=n,this[mb]=new QDs({snapshotPath:this[XPe],mode:this[U5],maxSnapshots:e.maxSnapshots,autoFlush:e.autoFlush,flushInterval:e.flushInterval,matchHeaders:e.matchHeaders,ignoreHeaders:e.ignoreHeaders,excludeHeaders:e.excludeHeaders,matchBody:e.matchBody,matchQuery:e.matchQuery,caseSensitive:e.caseSensitive,shouldRecord:e.shouldRecord,shouldPlayback:e.shouldPlayback,excludeUrls:e.excludeUrls}),this[Osr]=!1,(this[U5]==="record"||this[U5]==="update"||this[U5]==="playback"&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[Est]=new FDs(e)),(this[U5]==="playback"||this[U5]==="update")&&this[XPe]&&this.loadSnapshots().catch(()=>{})}dispatch(e,r){r=qDs.wrap(r);let n=this[U5];if(this[mb].isUrlExcluded(e))return this[Est].dispatch(e,r);if(n==="playback"||n==="update"){if(!this[Osr])return this.#e(e,r);let o=this[mb].findSnapshot(e);if(o)return this.#r(o,r);if(n==="update")return this.#t(e,r);{let s=new HDs(`No snapshot found for ${e.method||"GET"} ${e.path}`);if(r.onError){r.onError(s);return}throw s}}else if(n==="record")return this.#t(e,r)}async#e(e,r){return await this.loadSnapshots(),this.dispatch(e,r)}#t(e,r){let n={statusCode:null,headers:{},trailers:{},body:[]},o=this,s={onRequestStart(l,u){return r.onRequestStart(l,{...u,history:this.history})},onRequestUpgrade(l,u,d,f){return r.onRequestUpgrade(l,u,d,f)},onResponseStart(l,u,d,f){return n.statusCode=u,n.headers=d,r.onResponseStart(l,u,d,f)},onResponseData(l,u){return n.body.push(u),r.onResponseData(l,u)},onResponseEnd(l,u){n.trailers=u;let d=Buffer.concat(n.body);o[mb].record(e,{statusCode:n.statusCode,headers:n.headers,body:d,trailers:n.trailers}).then(()=>r.onResponseEnd(l,u)).catch(f=>r.onResponseError(l,f))}};return this[Est].dispatch(e,s)}#r(e,r){try{let{response:n}=e,o={pause(){},resume(){},abort(c){this.aborted=!0,this.reason=c},aborted:!1,paused:!1};r.onRequestStart(o),r.onResponseStart(o,n.statusCode,n.headers);let s=Buffer.from(n.body,"base64");r.onResponseData(o,s),r.onResponseEnd(o,n.trailers)}catch(n){r.onError?.(n)}}async loadSnapshots(e){await this[mb].loadSnapshots(e||this[XPe]),this[Osr]=!0,this[U5]==="playback"&&this.#n()}async saveSnapshots(e){return this[mb].saveSnapshots(e||this[XPe])}#n(){for(let e of this[mb].getSnapshots()){let{request:r,responses:n,response:o}=e,s=new URL(r.url),c=this.get(s.origin),l=n?n[0]:o;l&&c.intercept({path:s.pathname+s.search,method:r.method,headers:r.headers,body:r.body}).reply(l.statusCode,l.body,{headers:l.headers,trailers:l.trailers}).persist()}}getRecorder(){return this[mb]}getMode(){return this[U5]}clearSnapshots(){this[mb].clear()}resetCallCounts(){this[mb].resetCallCounts()}deleteSnapshot(e){return this[mb].deleteSnapshot(e)}getSnapshotInfo(e){return this[mb].getSnapshotInfo(e)}replaceSnapshots(e){this[mb].replaceSnapshots(e)}async close(){await this[mb].close(),await this[Est]?.close(),await super.close()}};sqn.exports=Lsr});var _st=I((flf,dqn)=>{"use strict";p();var $Ds=Symbol.for("undici.globalDispatcher.2"),cqn=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:VDs}=ao(),WDs=LZ();uqn()===void 0&&lqn(new WDs);function lqn(t){if(!t||typeof t.dispatch!="function")throw new VDs("Argument agent must implement Agent");Object.defineProperty(globalThis,$Ds,{value:t,writable:!0,enumerable:!1,configurable:!1}),Object.defineProperty(globalThis,cqn,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(lqn,"setGlobalDispatcher");function uqn(){return globalThis[cqn]}a(uqn,"getGlobalDispatcher");var zDs=["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"];dqn.exports={setGlobalDispatcher:lqn,getGlobalDispatcher:uqn,installedExports:zDs}});var Tpe=I((glf,fqn)=>{"use strict";p();var t8=require("node:assert"),YDs=hPe();fqn.exports=class{static{a(this,"DecoratorHandler")}#e;#t=!1;#r=!1;#n=!1;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=YDs.wrap(e)}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return t8(!this.#t),t8(!this.#r),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return t8(!this.#t),t8(!this.#r),t8(!this.#n),this.#n=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return t8(!this.#t),t8(!this.#r),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return t8(!this.#t),t8(!this.#r),this.#t=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#r=!0,this.#e.onResponseError?.(...e)}onBodySent(){}}});var Qsr=I((Elf,gqn)=>{"use strict";p();var gb=Po(),{kBodyUsed:e2e}=al(),Usr=require("node:assert"),{InvalidArgumentError:Bsr}=ao(),KDs=require("node:events"),JDs=[300,301,302,303,307,308],pqn=Symbol("body"),hqn=a(()=>{},"noop"),vst=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[pqn]=e,this[e2e]=!1}async*[Symbol.asyncIterator](){Usr(!this[e2e],"disturbed"),this[e2e]=!0,yield*this[pqn]}},Fsr=class t{static{a(this,"RedirectHandler")}static buildDispatch(e,r){if(r!=null&&(!Number.isInteger(r)||r<0))throw new Bsr("maxRedirections must be a positive number");let n=e.dispatch.bind(e);return(o,s)=>n(o,new t(n,r,o,s))}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new Bsr("maxRedirections must be a positive number");this.dispatch=e,this.location=null;let{maxRedirections:s,...c}=n;this.opts=c,this.maxRedirections=r,this.handler=o,this.history=[],gb.isStream(this.opts.body)?(gb.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){Usr(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[e2e]=!1,KDs.prototype.on.call(this.opts.body,"data",function(){this[e2e]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new vst(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&gb.isIterable(this.opts.body)&&!gb.isFormDataLike(this.opts.body)&&(this.opts.body=new vst(this.opts.body))}onRequestStart(e,r){this.handler.onRequestStart?.(e,{...r,history:this.history})}onRequestUpgrade(e,r,n,o){this.handler.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){if(this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections)throw new Error("max redirects");if((r===301||r===302)&&this.opts.method==="POST"&&(this.opts.method="GET",gb.isStream(this.opts.body)&&gb.destroy(this.opts.body.on("error",hqn)),this.opts.body=null),r===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",gb.isStream(this.opts.body)&&gb.destroy(this.opts.body.on("error",hqn)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||gb.isDisturbed(this.opts.body)||JDs.indexOf(r)===-1?null:n.location,this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location){this.handler.onResponseStart?.(e,r,n,o);return}let{origin:s,pathname:c,search:l}=gb.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c,d=`${s}${u}`;for(let f of this.history)if(f.toString()===d)throw new Bsr(`Redirect loop detected. Cannot redirect to ${s}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);this.opts.headers=ZDs(this.opts.headers,r===303,this.opts.origin!==s),this.opts.path=u,this.opts.origin=s,this.opts.query=null}onResponseData(e,r){this.location||this.handler.onResponseData?.(e,r)}onResponseEnd(e,r){this.location?this.dispatch(this.opts,this):this.handler.onResponseEnd(e,r)}onResponseError(e,r){this.handler.onResponseError?.(e,r)}};function mqn(t,e,r){if(t.length===4)return gb.headerNameToString(t)==="host";if(e&&gb.headerNameToString(t).startsWith("content-"))return!0;if(r&&(t.length===13||t.length===6||t.length===19)){let n=gb.headerNameToString(t);return n==="authorization"||n==="cookie"||n==="proxy-authorization"}return!1}a(mqn,"shouldRemoveHeader");function ZDs(t,e,r){let n=[];if(Array.isArray(t))for(let o=0;o{"use strict";p();var XDs=Qsr();function eNs({maxRedirections:t}={}){return e=>a(function(n,o){let{maxRedirections:s=t,...c}=n;if(s==null||s===0)return e(n,o);let l={...c},u=new XDs(e,s,l,o);return e(l,u)},"Intercept")}a(eNs,"createRedirectInterceptor");Aqn.exports=eNs});var _qn=I((Tlf,Eqn)=>{"use strict";p();var tNs=Tpe(),{ResponseError:rNs}=ao(),qsr=class extends tNs{static{a(this,"ResponseErrorHandler")}#e;#t;#r;#n;#i;constructor(e,{handler:r}){super(r)}#o(e){return(this.#t??"").indexOf(e)===0}onRequestStart(e,r){return this.#e=0,this.#t=null,this.#r=null,this.#n=null,this.#i="",super.onRequestStart(e,r)}onResponseStart(e,r,n,o){if(this.#e=r,this.#n=n,this.#t=n["content-type"],this.#e<400)return super.onResponseStart(e,r,n,o);(this.#o("application/json")||this.#o("text/plain"))&&(this.#r=new TextDecoder("utf-8"))}onResponseData(e,r){if(this.#e<400)return super.onResponseData(e,r);this.#i+=this.#r?.decode(r,{stream:!0})??""}onResponseEnd(e,r){if(this.#e>=400){if(this.#i+=this.#r?.decode(void 0,{stream:!1})??"",this.#o("application/json"))try{this.#i=JSON.parse(this.#i)}catch{}let n,o=Error.stackTraceLimit;Error.stackTraceLimit=0;try{n=new rNs("Response Error",this.#e,{body:this.#i,headers:this.#n})}finally{Error.stackTraceLimit=o}super.onResponseError(e,n)}else super.onResponseEnd(e,r)}onResponseError(e,r){super.onResponseError(e,r)}};Eqn.exports=()=>t=>a(function(r,n){return t(r,new qsr(r,{handler:n}))},"Intercept")});var Cqn=I((wlf,vqn)=>{"use strict";p();var nNs=ost();vqn.exports=t=>e=>a(function(n,o){return e(n,new nNs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var Sqn=I((Plf,bqn)=>{"use strict";p();var{InvalidArgumentError:iNs,RequestAbortedError:oNs}=ao(),sNs=Tpe(),jsr=class extends sNs{static{a(this,"DumpHandler")}#e=1024*1024;#t=!1;#r=0;#n=null;aborted=!1;reason=!1;constructor({maxSize:e,signal:r},n){if(e!=null&&(!Number.isFinite(e)||e<1))throw new iNs("maxSize must be a number greater than 0");super(n),this.#e=e??this.#e}#i(e){this.aborted=!0,this.reason=e}onRequestStart(e,r){return e.abort=this.#i.bind(this),this.#n=e,super.onRequestStart(e,r)}onResponseStart(e,r,n,o){let s=n["content-length"];if(s!=null&&s>this.#e)throw new oNs(`Response size (${s}) larger than maxSize (${this.#e})`);return this.aborted===!0?!0:super.onResponseStart(e,r,n,o)}onResponseError(e,r){this.#t||(r=this.#n?.reason??r,super.onResponseError(e,r))}onResponseData(e,r){return this.#r=this.#r+r.length,this.#r>=this.#e&&(this.#t=!0,this.aborted===!0?super.onResponseError(e,this.reason):super.onResponseEnd(e,{})),!0}onResponseEnd(e,r){if(!this.#t){if(this.#n.aborted===!0){super.onResponseError(e,this.reason);return}super.onResponseEnd(e,r)}}};function aNs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new jsr({maxSize:s,signal:n.signal},o);return e(n,c)},"Intercept")}a(aNs,"createDumpInterceptor");bqn.exports=aNs});var wqn=I((Mlf,xqn)=>{"use strict";p();var{isIP:cNs}=require("node:net"),{lookup:lNs}=require("node:dns"),uNs=Tpe(),{InvalidArgumentError:WZ,InformationalError:dNs}=ao(),Hsr=Math.pow(2,31)-1;function fNs(t){let e=Object.getPrototypeOf(t);return Object.prototype.hasOwnProperty.call(t,Symbol.iterator)||e!=null&&e!==Object.prototype&&typeof t[Symbol.iterator]=="function"}a(fNs,"hasSafeIterator");function Tqn(t){return typeof t=="string"&&t.toLowerCase()==="host"}a(Tqn,"isHostHeader");function pNs(t){if(t==null)return null;if(Array.isArray(t)){if(t.length===0||!Array.isArray(t[0]))return t;let e=[];for(let r of t)Array.isArray(r)&&r.length===2?e.push(r[0],r[1]):e.push(r);return e}if(typeof t=="object"&&fNs(t)){let e=[];for(let r of t)Array.isArray(r)&&r.length===2?e.push(r[0],r[1]):e.push(r);return e}return t}a(pNs,"normalizeHeaders");function hNs(t){if(t==null)return!1;if(Array.isArray(t)){if(t.length===0)return!1;for(let e=0;e=this.#e}},$sr=class{static{a(this,"DNSInstance")}#e=0;#t=0;dualStack=!0;affinity=null;lookup=null;pick=null;storage=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#r,this.pick=e.pick??this.#n,this.storage=e.storage??new Gsr(e)}runLookup(e,r,n){let o=this.storage.get(e.hostname);if(o==null&&this.storage.full()){n(null,e);return}let s={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...r.dns,maxTTL:this.#e,maxItems:this.#t};if(o==null)this.lookup(e,s,(c,l)=>{if(c||l==null||l.length===0){n(c??new dNs("No DNS entries found"));return}this.setRecords(e,l);let u=this.storage.get(e.hostname),d=this.pick(e,u,s.affinity),f;typeof d.port=="number"?f=`:${d.port}`:e.port!==""?f=`:${e.port}`:f="",n(null,new URL(`${e.protocol}//${d.family===6?`[${d.address}]`:d.address}${f}`))});else{let c=this.pick(e,o,s.affinity);if(c==null){this.storage.delete(e.hostname),this.runLookup(e,r,n);return}let l;typeof c.port=="number"?l=`:${c.port}`:e.port!==""?l=`:${e.port}`:l="",n(null,new URL(`${e.protocol}//${c.family===6?`[${c.address}]`:c.address}${l}`))}}#r(e,r,n){lNs(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(o,s)=>{if(o)return n(o);let c=new Map;for(let l of s)c.set(`${l.address}:${l.family}`,l);n(null,c.values())})}#n(e,r,n){let o=null,{records:s,offset:c}=r,l;if(this.dualStack?(n==null&&(c==null||c===Hsr?(r.offset=0,n=4):(r.offset++,n=(r.offset&1)===1?6:4)),s[n]!=null&&s[n].ips.length>0?l=s[n]:l=s[n===4?6:4]):l=s[n],l==null||l.ips.length===0)return o;l.offset==null||l.offset===Hsr?l.offset=0:l.offset++;let u=l.offset%l.ips.length;return o=l.ips[u]??null,o==null?o:Date.now()-o.timestamp>o.ttl?(l.ips.splice(u,1),this.pick(e,r,n)):o}pickFamily(e,r){let n=this.storage.get(e.hostname)?.records;if(!n)return null;let o=n[r];if(!o)return null;o.offset==null||o.offset===Hsr?o.offset=0:o.offset++;let s=o.offset%o.ips.length,c=o.ips[s]??null;return c==null||Date.now()-c.timestamp>c.ttl&&o.ips.splice(s,1),c}setRecords(e,r){let n=Date.now(),o={records:{4:null,6:null}},s=this.#e;for(let c of r){c.timestamp=n,typeof c.ttl=="number"?(c.ttl=Math.min(c.ttl,this.#e),s=Math.min(s,c.ttl)):c.ttl=this.#e;let l=o.records[c.family]??{ips:[]};l.ips.push(c),o.records[c.family]=l}this.storage.set(e.hostname,o,{ttl:s})}deleteRecords(e){this.storage.delete(e.hostname)}getHandler(e,r){return new Vsr(this,e,r)}},Vsr=class extends uNs{static{a(this,"DNSDispatchHandler")}#e=null;#t=null;#r=null;#n=null;#i=null;#o=null;#s=!0;constructor(e,{origin:r,handler:n,dispatch:o,newOrigin:s},c){super(n),this.#n=r,this.#o=s,this.#t={...c},this.#e=e,this.#r=o}onResponseError(e,r){switch(r.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){if(!this.#s){super.onResponseError(e,r);return}this.#s=!1;let n=this.#o.hostname[0]==="["?4:6,o=this.#e.pickFamily(this.#n,n);if(o==null){super.onResponseError(e,r);return}let s;typeof o.port=="number"?s=`:${o.port}`:this.#n.port!==""?s=`:${this.#n.port}`:s="";let c={...this.#t,origin:`${this.#n.protocol}//${o.family===6?`[${o.address}]`:o.address}${s}`,headers:Iqn(this.#n.host,this.#t.headers)};this.#r(c,this);return}super.onResponseError(e,r);break}case"ENOTFOUND":this.#e.deleteRecords(this.#n),super.onResponseError(e,r);break;default:super.onResponseError(e,r);break}}};xqn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new WZ("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new WZ("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new WZ("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new WZ("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new WZ("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new WZ("Invalid pick. Must be a function");if(t?.storage!=null&&(typeof t?.storage?.get!="function"||typeof t?.storage?.set!="function"||typeof t?.storage?.full!="function"||typeof t?.storage?.delete!="function"))throw new WZ("Invalid storage. Must be a object with methods: { get, set, full, delete }");let e=t?.dualStack??!0,r;e?r=t?.affinity??null:r=t?.affinity??4;let n={maxTTL:t?.maxTTL??1e4,lookup:t?.lookup??null,pick:t?.pick??null,dualStack:e,affinity:r,maxItems:t?.maxItems??1/0,storage:t?.storage},o=new $sr(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return cNs(d.hostname)!==0?s(l,u):(o.runLookup(d,l,(f,h)=>{if(f)return u.onResponseError(null,f);let m={...l,servername:d.hostname,origin:h.origin,headers:Iqn(d.host,l.headers)};s(m,o.getHandler({origin:d,dispatch:s,handler:u,newOrigin:h},l))}),!0)},"dnsInterceptor")}});var Ipe=I((Blf,kqn)=>{"use strict";p();var{safeHTTPMethods:Rqn,pathHasQueryOrFragment:mNs,hasSafeIterator:gNs}=Po(),{serializePathWithQuery:ANs}=Po();function yNs(t){if(!t.origin)throw new Error("opts.origin is undefined");let e=t.path||"/";return t.query&&!mNs(e)&&(e=ANs(e,t.query)),{origin:t.origin.toString(),method:t.method,path:e,headers:t.headers}}a(yNs,"makeCacheKey");function ENs(t){let e;if(t.headers==null)e={};else if(typeof t.headers=="object")if(e={},gNs(t.headers))for(let r of t.headers){if(!Array.isArray(r))throw new Error("opts.headers is not a valid header map");let[n,o]=r;if(typeof n!="string"||typeof o!="string")throw new Error("opts.headers is not a valid header map");e[n.toLowerCase()]=o}else for(let r of Object.keys(t.headers))e[r.toLowerCase()]=t.headers[r];else throw new Error("opts.headers is not an object");return e}a(ENs,"normalizeHeaders");function _Ns(t){if(typeof t!="object")throw new TypeError(`expected key to be object, got ${typeof t}`);for(let e of["origin","method","path"])if(typeof t[e]!="string")throw new TypeError(`expected key.${e} to be string, got ${typeof t[e]}`);if(t.headers!==void 0&&typeof t.headers!="object")throw new TypeError(`expected headers to be object, got ${typeof t}`)}a(_Ns,"assertCacheKey");function vNs(t){if(typeof t!="object")throw new TypeError(`expected value to be object, got ${typeof t}`);for(let e of["statusCode","cachedAt","staleAt","deleteAt"])if(typeof t[e]!="number")throw new TypeError(`expected value.${e} to be number, got ${typeof t[e]}`);if(typeof t.statusMessage!="string")throw new TypeError(`expected value.statusMessage to be string, got ${typeof t.statusMessage}`);if(t.headers!=null&&typeof t.headers!="object")throw new TypeError(`expected value.rawHeaders to be object, got ${typeof t.headers}`);if(t.vary!==void 0&&typeof t.vary!="object")throw new TypeError(`expected value.vary to be object, got ${typeof t.vary}`);if(t.etag!==void 0&&typeof t.etag!="string")throw new TypeError(`expected value.etag to be string, got ${typeof t.etag}`)}a(vNs,"assertCacheValue");function CNs(t){let e={},r;if(Array.isArray(t)){r=[];for(let n of t)r.push(...n.split(","))}else r=t.split(",");for(let n=0;n=2&&l[0]==='"'&&l[l.length-1]==='"'&&(l=l.substring(1,l.length-1));let u=parseInt(l,10);if(u!==u||c==="max-age"&&c in e&&e[c]>=u)continue;e[c]=u;break}case"private":case"no-cache":if(l){if(l[0]==='"'){let u=[l.substring(1)],d=l[l.length-1]==='"';if(!d)for(let f=n+1;f{"use strict";p();function wNs(t){switch(t[3]){case",":return RNs(t);case" ":return kNs(t);default:return PNs(t)}}a(wNs,"parseHttpDate");function RNs(t){if(t.length!==29||t[4]!==" "||t[7]!==" "||t[11]!==" "||t[16]!==" "||t[19]!==":"||t[22]!==":"||t[25]!==" "||t[26]!=="G"||t[27]!=="M"||t[28]!=="T")return;let e=-1;if(t[0]==="S"&&t[1]==="u"&&t[2]==="n")e=0;else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n")e=1;else if(t[0]==="T"&&t[1]==="u"&&t[2]==="e")e=2;else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d")e=3;else if(t[0]==="T"&&t[1]==="h"&&t[2]==="u")e=4;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i")e=5;else if(t[0]==="S"&&t[1]==="a"&&t[2]==="t")e=6;else return;let r=0;if(t[5]==="0"){let g=t.charCodeAt(6);if(g<49||g>57)return;r=g-48}else{let g=t.charCodeAt(5);if(g<49||g>51)return;let A=t.charCodeAt(6);if(A<48||A>57)return;r=(g-48)*10+(A-48)}let n=-1;if(t[8]==="J"&&t[9]==="a"&&t[10]==="n")n=0;else if(t[8]==="F"&&t[9]==="e"&&t[10]==="b")n=1;else if(t[8]==="M"&&t[9]==="a")if(t[10]==="r")n=2;else if(t[10]==="y")n=4;else return;else if(t[8]==="J")if(t[9]==="a"&&t[10]==="n")n=0;else if(t[9]==="u")if(t[10]==="n")n=5;else if(t[10]==="l")n=6;else return;else return;else if(t[8]==="A")if(t[9]==="p"&&t[10]==="r")n=3;else if(t[9]==="u"&&t[10]==="g")n=7;else return;else if(t[8]==="S"&&t[9]==="e"&&t[10]==="p")n=8;else if(t[8]==="O"&&t[9]==="c"&&t[10]==="t")n=9;else if(t[8]==="N"&&t[9]==="o"&&t[10]==="v")n=10;else if(t[8]==="D"&&t[9]==="e"&&t[10]==="c")n=11;else return;let o=t.charCodeAt(12);if(o<48||o>57)return;let s=t.charCodeAt(13);if(s<48||s>57)return;let c=t.charCodeAt(14);if(c<48||c>57)return;let l=t.charCodeAt(15);if(l<48||l>57)return;let u=(o-48)*1e3+(s-48)*100+(c-48)*10+(l-48),d=0;if(t[17]==="0"){let g=t.charCodeAt(18);if(g<48||g>57)return;d=g-48}else{let g=t.charCodeAt(17);if(g<48||g>50)return;let A=t.charCodeAt(18);if(A<48||A>57||g===50&&A>51)return;d=(g-48)*10+(A-48)}let f=0;if(t[20]==="0"){let g=t.charCodeAt(21);if(g<48||g>57)return;f=g-48}else{let g=t.charCodeAt(20);if(g<48||g>53)return;let A=t.charCodeAt(21);if(A<48||A>57)return;f=(g-48)*10+(A-48)}let h=0;if(t[23]==="0"){let g=t.charCodeAt(24);if(g<48||g>57)return;h=g-48}else{let g=t.charCodeAt(23);if(g<48||g>53)return;let A=t.charCodeAt(24);if(A<48||A>57)return;h=(g-48)*10+(A-48)}let m=new Date(Date.UTC(u,n,r,d,f,h));return m.getUTCDay()===e?m:void 0}a(RNs,"parseImfDate");function kNs(t){if(t.length!==24||t[7]!==" "||t[10]!==" "||t[19]!==" ")return;let e=-1;if(t[0]==="S"&&t[1]==="u"&&t[2]==="n")e=0;else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n")e=1;else if(t[0]==="T"&&t[1]==="u"&&t[2]==="e")e=2;else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d")e=3;else if(t[0]==="T"&&t[1]==="h"&&t[2]==="u")e=4;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i")e=5;else if(t[0]==="S"&&t[1]==="a"&&t[2]==="t")e=6;else return;let r=-1;if(t[4]==="J"&&t[5]==="a"&&t[6]==="n")r=0;else if(t[4]==="F"&&t[5]==="e"&&t[6]==="b")r=1;else if(t[4]==="M"&&t[5]==="a")if(t[6]==="r")r=2;else if(t[6]==="y")r=4;else return;else if(t[4]==="J")if(t[5]==="a"&&t[6]==="n")r=0;else if(t[5]==="u")if(t[6]==="n")r=5;else if(t[6]==="l")r=6;else return;else return;else if(t[4]==="A")if(t[5]==="p"&&t[6]==="r")r=3;else if(t[5]==="u"&&t[6]==="g")r=7;else return;else if(t[4]==="S"&&t[5]==="e"&&t[6]==="p")r=8;else if(t[4]==="O"&&t[5]==="c"&&t[6]==="t")r=9;else if(t[4]==="N"&&t[5]==="o"&&t[6]==="v")r=10;else if(t[4]==="D"&&t[5]==="e"&&t[6]==="c")r=11;else return;let n=0;if(t[8]===" "){let g=t.charCodeAt(9);if(g<49||g>57)return;n=g-48}else{let g=t.charCodeAt(8);if(g<49||g>51)return;let A=t.charCodeAt(9);if(A<48||A>57)return;n=(g-48)*10+(A-48)}let o=0;if(t[11]==="0"){let g=t.charCodeAt(12);if(g<48||g>57)return;o=g-48}else{let g=t.charCodeAt(11);if(g<48||g>50)return;let A=t.charCodeAt(12);if(A<48||A>57||g===50&&A>51)return;o=(g-48)*10+(A-48)}let s=0;if(t[14]==="0"){let g=t.charCodeAt(15);if(g<48||g>57)return;s=g-48}else{let g=t.charCodeAt(14);if(g<48||g>53)return;let A=t.charCodeAt(15);if(A<48||A>57)return;s=(g-48)*10+(A-48)}let c=0;if(t[17]==="0"){let g=t.charCodeAt(18);if(g<48||g>57)return;c=g-48}else{let g=t.charCodeAt(17);if(g<48||g>53)return;let A=t.charCodeAt(18);if(A<48||A>57)return;c=(g-48)*10+(A-48)}let l=t.charCodeAt(20);if(l<48||l>57)return;let u=t.charCodeAt(21);if(u<48||u>57)return;let d=t.charCodeAt(22);if(d<48||d>57)return;let f=t.charCodeAt(23);if(f<48||f>57)return;let h=(l-48)*1e3+(u-48)*100+(d-48)*10+(f-48),m=new Date(Date.UTC(h,r,n,o,s,c));return m.getUTCDay()===e?m:void 0}a(kNs,"parseAscTimeDate");function PNs(t){let e=-1,r=-1;if(t[0]==="S")t[1]==="u"&&t[2]==="n"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y"?(r=0,e=6):t[1]==="a"&&t[2]==="t"&&t[3]==="u"&&t[4]==="r"&&t[5]==="d"&&t[6]==="a"&&t[7]==="y"&&(r=6,e=8);else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y")r=1,e=6;else if(t[0]==="T")t[1]==="u"&&t[2]==="e"&&t[3]==="s"&&t[4]==="d"&&t[5]==="a"&&t[6]==="y"?(r=2,e=7):t[1]==="h"&&t[2]==="u"&&t[3]==="r"&&t[4]==="s"&&t[5]==="d"&&t[6]==="a"&&t[7]==="y"&&(r=4,e=8);else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d"&&t[3]==="n"&&t[4]==="e"&&t[5]==="s"&&t[6]==="d"&&t[7]==="a"&&t[8]==="y")r=3,e=9;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y")r=5,e=6;else return;if(t[e]!==","||t.length-e-1!==23||t[e+1]!==" "||t[e+4]!=="-"||t[e+8]!=="-"||t[e+11]!==" "||t[e+14]!==":"||t[e+17]!==":"||t[e+20]!==" "||t[e+21]!=="G"||t[e+22]!=="M"||t[e+23]!=="T")return;let n=0;if(t[e+2]==="0"){let m=t.charCodeAt(e+3);if(m<49||m>57)return;n=m-48}else{let m=t.charCodeAt(e+2);if(m<49||m>51)return;let g=t.charCodeAt(e+3);if(g<48||g>57)return;n=(m-48)*10+(g-48)}let o=-1;if(t[e+5]==="J"&&t[e+6]==="a"&&t[e+7]==="n")o=0;else if(t[e+5]==="F"&&t[e+6]==="e"&&t[e+7]==="b")o=1;else if(t[e+5]==="M"&&t[e+6]==="a"&&t[e+7]==="r")o=2;else if(t[e+5]==="A"&&t[e+6]==="p"&&t[e+7]==="r")o=3;else if(t[e+5]==="M"&&t[e+6]==="a"&&t[e+7]==="y")o=4;else if(t[e+5]==="J"&&t[e+6]==="u"&&t[e+7]==="n")o=5;else if(t[e+5]==="J"&&t[e+6]==="u"&&t[e+7]==="l")o=6;else if(t[e+5]==="A"&&t[e+6]==="u"&&t[e+7]==="g")o=7;else if(t[e+5]==="S"&&t[e+6]==="e"&&t[e+7]==="p")o=8;else if(t[e+5]==="O"&&t[e+6]==="c"&&t[e+7]==="t")o=9;else if(t[e+5]==="N"&&t[e+6]==="o"&&t[e+7]==="v")o=10;else if(t[e+5]==="D"&&t[e+6]==="e"&&t[e+7]==="c")o=11;else return;let s=t.charCodeAt(e+9);if(s<48||s>57)return;let c=t.charCodeAt(e+10);if(c<48||c>57)return;let l=(s-48)*10+(c-48);l+=l<70?2e3:1900;let u=0;if(t[e+12]==="0"){let m=t.charCodeAt(e+13);if(m<48||m>57)return;u=m-48}else{let m=t.charCodeAt(e+12);if(m<48||m>50)return;let g=t.charCodeAt(e+13);if(g<48||g>57||m===50&&g>51)return;u=(m-48)*10+(g-48)}let d=0;if(t[e+15]==="0"){let m=t.charCodeAt(e+16);if(m<48||m>57)return;d=m-48}else{let m=t.charCodeAt(e+15);if(m<48||m>53)return;let g=t.charCodeAt(e+16);if(g<48||g>57)return;d=(m-48)*10+(g-48)}let f=0;if(t[e+18]==="0"){let m=t.charCodeAt(e+19);if(m<48||m>57)return;f=m-48}else{let m=t.charCodeAt(e+18);if(m<48||m>53)return;let g=t.charCodeAt(e+19);if(g<48||g>57)return;f=(m-48)*10+(g-48)}let h=new Date(Date.UTC(l,o,n,u,d,f));return h.getUTCDay()===r?h:void 0}a(PNs,"parseRfc850Date");Pqn.exports={parseHttpDate:wNs}});var Lqn=I((Hlf,Oqn)=>{"use strict";p();var DNs=Po(),{parseCacheControlHeader:NNs,parseVaryHeader:MNs,isEtagUsable:ONs}=Ipe(),{parseHttpDate:Nqn}=Dqn();function LNs(){}a(LNs,"noop");var Mqn=[200,203,204,206,300,301,308,404,405,410,414,501],BNs=[206],FNs=2147483647e3,Wsr=class{static{a(this,"CacheHandler")}#e;#t;#r;#n;#i;#o;constructor({store:e,type:r,cacheByDefault:n},o,s){this.#n=e,this.#t=r,this.#r=n,this.#e=o,this.#i=s}onRequestStart(e,r){this.#o?.destroy(),this.#o=void 0,this.#i.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.#i.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){let s=a(()=>this.#i.onResponseStart?.(e,r,n,o),"downstreamOnHeaders"),c=this;if(!DNs.safeHTTPMethods.includes(this.#e.method)&&r>=200&&r<=399){try{this.#n.delete(this.#e)?.catch?.(LNs)}catch{}return s()}let l=n["cache-control"],u=n["last-modified"]&&Mqn.includes(r);if(!l&&!n.expires&&!u&&!this.#r)return s();let d=l?NNs(l):{};if(!UNs(this.#t,r,n,d,this.#e.headers))return s();let f=Date.now(),h=n.age?QNs(n.age):void 0;if(h&&h>=FNs)return s();let m=typeof n.date=="string"?Nqn(n.date):void 0,g=qNs(this.#t,f,h,n,m,d)??this.#r;if(g===void 0||h&&h>g)return s();let A=m?m.getTime():f,y=g+A;if(f>=y)return s();let E;if(this.#e.headers&&n.vary&&(E=MNs(n.vary,this.#e.headers),!E))return s();let _=jNs(A,d,y),v=HNs(n,d),b={statusCode:r,statusMessage:o,headers:v,vary:E,cacheControlDirectives:d,cachedAt:h?f-h:f,staleAt:y,deleteAt:_};if(r===304){let T=a(R=>{if(!R)return s();if(b.statusCode=R.statusCode,b.statusMessage=R.statusMessage,b.etag=R.etag,b.headers={...R.headers,...v},s(),this.#o=this.#n.createWriteStream(this.#e,b),!(!this.#o||!R?.body))if(typeof R.body.values=="function"){let x=R.body.values(),P=a(()=>{for(let D of x){let N=this.#o.write(D)===!1;if(this.#i.onResponseData?.(e,D),N)break}},"streamCachedBody");this.#o.on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("drain",()=>{P()}).on("close",function(){c.#o===this&&(c.#o=void 0)}),P()}else typeof R.body.on=="function"&&(R.body.on("data",x=>{this.#o.write(x),this.#i.onResponseData?.(e,x)}).on("end",()=>{this.#o.end()}).on("error",()=>{this.#o=void 0,this.#n.delete(this.#e)}),this.#o.on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("close",function(){c.#o===this&&(c.#o=void 0)}))},"handle304"),w=this.#n.get(this.#e);w&&typeof w.then=="function"?w.then(T):T(w)}else{if(typeof n.etag=="string"&&ONs(n.etag)&&(b.etag=n.etag),this.#o=this.#n.createWriteStream(this.#e,b),!this.#o)return s();this.#o.on("drain",()=>e.resume()).on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("close",function(){c.#o===this&&(c.#o=void 0),e.resume()}),s()}}onResponseData(e,r){this.#o?.write(r)===!1&&e.pause(),this.#i.onResponseData?.(e,r)}onResponseEnd(e,r){this.#o?.end(),this.#i.onResponseEnd?.(e,r)}onResponseError(e,r){this.#o?.destroy(r),this.#o=void 0,this.#i.onResponseError?.(e,r)}};function UNs(t,e,r,n,o){return!(e<200||BNs.includes(e)||!Mqn.includes(e)&&!r.expires&&!n.public&&n["max-age"]===void 0&&!(n.private&&t==="private")&&!(n["s-maxage"]!==void 0&&t==="shared")||n["no-store"]||t==="shared"&&n.private===!0||r.vary?.includes("*")||o?.authorization&&(!n.public&&!n["s-maxage"]&&!n["must-revalidate"]||typeof o.authorization!="string"||Array.isArray(n["no-cache"])&&n["no-cache"].includes("authorization")||Array.isArray(n.private)&&n.private.includes("authorization")))}a(UNs,"canCacheResponse");function QNs(t){let e=parseInt(Array.isArray(t)?t[0]:t);return isNaN(e)?void 0:e*1e3}a(QNs,"getAge");function qNs(t,e,r,n,o,s){if(t==="shared"){let l=s["s-maxage"];if(l!==void 0)return l>0?l*1e3:void 0}let c=s["max-age"];if(c!==void 0)return c>0?c*1e3:void 0;if(typeof n.expires=="string"){let l=Nqn(n.expires);if(l)return e>=l.getTime()||o&&(o>=l||r!==void 0&&r>l-o)?void 0:l.getTime()-e}if(typeof n["last-modified"]=="string"){let l=new Date(n["last-modified"]);if(GNs(l))return l.getTime()>=e?void 0:(e-l.getTime())*.1}if(s.immutable)return 31536e3}a(qNs,"determineStaleAt");function jNs(t,e,r){let n=-1/0,o=-1/0,s=-1/0;if(e["stale-while-revalidate"]&&(n=r+e["stale-while-revalidate"]*1e3),e["stale-if-error"]&&(o=r+e["stale-if-error"]*1e3),e.immutable&&n===-1/0&&o===-1/0&&(s=t+31536e6),n===-1/0&&o===-1/0&&s===-1/0){let c=r-t;return r+c}return Math.max(r,n,o,s)}a(jNs,"determineDeleteAt");function HNs(t,e){let r=["connection","proxy-authenticate","proxy-authentication-info","proxy-authorization","proxy-connection","te","transfer-encoding","upgrade","age"];t.connection&&(Array.isArray(t.connection)?r.push(...t.connection.map(o=>o.trim())):r.push(...t.connection.split(",").map(o=>o.trim()))),Array.isArray(e["no-cache"])&&r.push(...e["no-cache"]),Array.isArray(e.private)&&r.push(...e.private);let n;for(let o of r)t[o]&&(n??={...t},delete n[o]);return n??t}a(HNs,"stripNecessaryHeaders");function GNs(t){return t instanceof Date&&Number.isFinite(t.valueOf())}a(GNs,"isValidDate");Oqn.exports=Wsr});var Ysr=I((Vlf,Uqn)=>{"use strict";p();var{Writable:$Ns}=require("node:stream"),{EventEmitter:VNs}=require("node:events"),{assertCacheKey:Bqn,assertCacheValue:WNs}=Ipe(),zsr=class extends VNs{static{a(this,"MemoryCacheStore")}#e=1024;#t=104857600;#r=5242880;#n=0;#i=0;#o=new Map;#s=!1;constructor(e){if(super(),e){if(typeof e!="object")throw new TypeError("MemoryCacheStore options must be an object");if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("MemoryCacheStore options.maxCount must be a non-negative integer");this.#e=e.maxCount}if(e.maxSize!==void 0){if(typeof e.maxSize!="number"||!Number.isInteger(e.maxSize)||e.maxSize<0)throw new TypeError("MemoryCacheStore options.maxSize must be a non-negative integer");this.#t=e.maxSize}if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("MemoryCacheStore options.maxEntrySize must be a non-negative integer");this.#r=e.maxEntrySize}}}get size(){return this.#n}isFull(){return this.#n>=this.#t||this.#i>=this.#e}get(e){Bqn(e);let r=`${e.origin}:${e.path}`,n=Date.now(),o=this.#o.get(r),s=o?Fqn(e,o,n):null;return s==null?void 0:{statusMessage:s.statusMessage,statusCode:s.statusCode,headers:s.headers,body:s.body,vary:s.vary?s.vary:void 0,etag:s.etag,cacheControlDirectives:s.cacheControlDirectives,cachedAt:s.cachedAt,staleAt:s.staleAt,deleteAt:s.deleteAt}}createWriteStream(e,r){Bqn(e),WNs(r);let n=`${e.origin}:${e.path}`,o=this,s={...e,...r,body:[],size:0};return new $Ns({write(c,l,u){typeof c=="string"&&(c=Buffer.from(c,l)),s.size+=c.byteLength,s.size>=o.#r?this.destroy():s.body.push(c),u(null)},final(c){let l=o.#o.get(n);l||(l=[],o.#o.set(n,l));let u=Fqn(e,l,Date.now());if(u){let d=l.indexOf(u);l.splice(d,1,s),o.#n-=u.size}else l.push(s),o.#i+=1;if(o.#n+=s.size,o.#n>o.#t||o.#i>o.#e){o.#s||(o.emit("maxSizeExceeded",{size:o.#n,maxSize:o.#t,count:o.#i,maxCount:o.#e}),o.#s=!0);for(let[d,f]of o.#o){for(let h of f.splice(0,f.length/2))o.#n-=h.size,o.#i-=1;f.length===0&&o.#o.delete(d)}o.#nn.deleteAt>r&&n.method===t.method&&(n.vary==null||Object.keys(n.vary).every(o=>n.vary[o]===null?t.headers[o]===void 0:n.vary[o]===t.headers[o])))}a(Fqn,"findEntry");Uqn.exports=zsr});var qqn=I((Ylf,Qqn)=>{"use strict";p();var zNs=require("node:assert"),Ksr=class{static{a(this,"CacheRevalidationHandler")}#e=!1;#t;#r;#n;#i;constructor(e,r,n){if(typeof e!="function")throw new TypeError("callback must be a function");this.#t=e,this.#r=r,this.#i=n}onRequestStart(e,r){this.#e=!1,this.#n=r}onRequestUpgrade(e,r,n,o){this.#r.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){if(zNs(this.#t!=null),this.#e=r===304||this.#i&&r>=500&&r<=504,this.#t(this.#e,this.#n),this.#t=null,this.#e)return!0;this.#r.onRequestStart?.(e,this.#n),this.#r.onResponseStart?.(e,r,n,o)}onResponseData(e,r){if(!this.#e)return this.#r.onResponseData?.(e,r)}onResponseEnd(e,r){this.#e||this.#r.onResponseEnd?.(e,r)}onResponseError(e,r){if(!this.#e)if(this.#t&&(this.#t(!1),this.#t=null),typeof this.#r.onResponseError=="function")this.#r.onResponseError(e,r);else throw r}};Qqn.exports=Ksr});var $qn=I((Zlf,Gqn)=>{"use strict";p();var jqn=require("node:assert"),{Readable:YNs}=require("node:stream"),xpe=Po(),t2e=Lqn(),KNs=Ysr(),JNs=qqn(),{assertCacheStore:ZNs,assertCacheMethods:XNs,makeCacheKey:eMs,normalizeHeaders:tMs,parseCacheControlHeader:rMs}=Ipe(),{AbortError:nMs}=ao();function iMs(t,e){if(t!==void 0){if(!Array.isArray(t))throw new TypeError(`expected ${e} to be an array or undefined, got ${typeof t}`);for(let r=0;r{},"nop");function oMs(t,e,{headers:r={}}){return!!(e?.["no-cache"]||t.cacheControlDirectives?.["no-cache"]&&!Array.isArray(t.cacheControlDirectives["no-cache"])||r["if-modified-since"]||r["if-none-match"])}a(oMs,"needsRevalidation");function sMs(t,e){let r=Date.now();if(r>t.staleAt){if(e?.["max-stale"]){let n=t.staleAt+e["max-stale"]*1e3;return r>n}return!0}if(e?.["min-fresh"]){let n=t.staleAt-r,o=e["min-fresh"]*1e3;return n<=o}return!1}a(sMs,"isStale");function aMs(t){let e=t.cacheControlDirectives?.["stale-while-revalidate"];if(!e)return!1;let r=Date.now(),n=t.staleAt+e*1e3;return r<=n}a(aMs,"withinStaleWhileRevalidateWindow");function cMs(t,e,r,n,o,s){if(s?.["only-if-cached"]){let c=!1;try{if(typeof n.onConnect=="function"&&(n.onConnect(()=>{c=!0}),c)||typeof n.onHeaders=="function"&&(n.onHeaders(504,[],Zsr,"Gateway Timeout"),c))return;typeof n.onComplete=="function"&&n.onComplete([])}catch(l){typeof n.onError=="function"&&n.onError(l)}return!0}return t(o,new t2e(e,r,n))}a(cMs,"handleUncachedResponse");function Jsr(t,e,r,n,o,s){let c=xpe.isStream(r.body)?r.body:YNs.from(r.body??[]);jqn(!c.destroyed,"stream should not be destroyed"),jqn(!c.readableDidRead,"stream should not be readableDidRead");let l={resume(){c.resume()},pause(){c.pause()},get paused(){return c.isPaused()},get aborted(){return c.destroyed},get reason(){return c.errored},abort(d){c.destroy(d??new nMs)}};if(c.on("error",function(d){if(!this.readableEnded)if(typeof t.onResponseError=="function")t.onResponseError(l,d);else throw d}).on("close",function(){this.errored||t.onResponseEnd?.(l,{})}),t.onRequestStart?.(l,o),c.destroyed)return;let u={...r.headers,age:String(n)};s&&(u.warning='110 - "response is stale"'),t.onResponseStart?.(l,r.statusCode,u,r.statusMessage),e.method==="HEAD"?c.destroy():c.on("data",function(d){t.onResponseData?.(l,d)})}a(Jsr,"sendCachedValue");function Hqn(t,e,r,n,o,s,c){if(!c)return cMs(t,e,r,n,o,s);let l=Date.now();if(l>c.deleteAt)return t(o,new t2e(e,r,n));let u=Math.round((l-c.cachedAt)/1e3);if(s?.["max-age"]&&u>=s["max-age"])return t(o,n);let d=sMs(c,s),f=oMs(c,s,o);if(d||f){if(xpe.isStream(o.body)&&xpe.bodyLength(o.body)!==0)return t(o,new t2e(e,r,n));if(!f&&aMs(c))return Jsr(n,o,c,u,null,!0),queueMicrotask(()=>{let A={...o.headers,"if-modified-since":new Date(c.cachedAt).toUTCString()};if(c.etag&&(A["if-none-match"]=c.etag),c.vary)for(let y in c.vary)c.vary[y]!=null&&(A[y]=c.vary[y]);t({...o,headers:A},new t2e(e,r,{onRequestStart(){},onRequestUpgrade(){},onResponseStart(){},onResponseData(){},onResponseEnd(){},onResponseError(){}}))}),!0;let h=!1,m=c.cacheControlDirectives["stale-if-error"]??s?.["stale-if-error"];m&&(h=l{A?Jsr(n,o,c,u,y,d):xpe.isStream(c.body)&&c.body.on("error",Zsr).destroy()},new t2e(e,r,n),h))}xpe.isStream(o.body)&&o.body.on("error",Zsr).destroy(),Jsr(n,o,c,u,null,!1)}a(Hqn,"handleResult");Gqn.exports=(t={})=>{let{store:e=new KNs,methods:r=["GET"],cacheByDefault:n=void 0,type:o="shared",origins:s=void 0}=t;if(typeof t!="object"||t===null)throw new TypeError(`expected type of opts to be an Object, got ${t===null?"null":typeof t}`);if(ZNs(e,"opts.store"),XNs(r,"opts.methods"),iMs(s,"opts.origins"),typeof n<"u"&&typeof n!="number")throw new TypeError(`expected opts.cacheByDefault to be number or undefined, got ${typeof n}`);if(typeof o<"u"&&o!=="shared"&&o!=="private")throw new TypeError(`expected opts.type to be shared, private, or undefined, got ${typeof o}`);let c={store:e,methods:r,cacheByDefault:n,type:o},l=xpe.safeHTTPMethods.filter(u=>r.includes(u)===!1);return u=>(d,f)=>{if(!d.origin||l.includes(d.method))return u(d,f);if(s!==void 0){let A=d.origin.toString().toLowerCase(),y=!1;for(let E=0;EHqn(u,c,m,f,d,h,A)):Hqn(u,c,m,f,d,h,g)}}});var Kqn=I((tuf,Yqn)=>{"use strict";p();var{createInflate:Xsr,createGunzip:Vqn,createBrotliDecompress:lMs,createZstdDecompress:uMs}=require("node:zlib"),{pipeline:dMs}=require("node:stream"),fMs=Tpe(),{runtimeFeatures:pMs}=$F(),Wqn={gzip:Vqn,"x-gzip":Vqn,br:lMs,deflate:Xsr,compress:Xsr,"x-compress":Xsr,...pMs.has("zstd")?{zstd:uMs}:{}},hMs=[204,304],zqn=!1,ear=class extends fMs{static{a(this,"DecompressHandler")}#e=[];#t;#r;constructor(e,{skipStatusCodes:r=hMs,skipErrorResponses:n=!0}={}){super(e),this.#t=r,this.#r=n}#n(e,r){return!!(!e||r<200||this.#t.includes(r)||this.#r&&r>=400)}#i(e){let r=e.split(","),n=5;if(r.length>n)throw new Error(`too many content-encodings in response: ${r.length}, maximum allowed is ${n}`);let o=[];for(let s=r.length-1;s>=0;s--){let c=r[s].trim();if(c){if(!Wqn[c])return o.length=0,o;o.push(Wqn[c]())}}return o}#o(e,r){e.on("readable",()=>{let n;for(;(n=e.read())!==null&&super.onResponseData(r,n)!==!1;);}),e.on("error",n=>{super.onResponseError(r,n)})}#s(e){let r=this.#e[0];this.#o(r,e),r.on("end",()=>{super.onResponseEnd(e,{})})}#a(e){let r=this.#e[this.#e.length-1];this.#o(r,e),dMs(this.#e,n=>{if(n){super.onResponseError(e,n);return}super.onResponseEnd(e,{})})}#c(){this.#e.length=0}onResponseStart(e,r,n,o){let s=n["content-encoding"];if(this.#n(s,r))return super.onResponseStart(e,r,n,o);let c=this.#i(s.toLowerCase());if(c.length===0)return this.#c(),super.onResponseStart(e,r,n,o);this.#e=c;let{"content-encoding":l,"content-length":u,...d}=n;return this.#e.length===1?this.#s(e):this.#a(e),super.onResponseStart(e,r,d,o)}onResponseData(e,r){if(this.#e.length>0){this.#e[0].write(r);return}super.onResponseData(e,r)}onResponseEnd(e,r){if(this.#e.length>0){this.#e[0].end(),this.#c();return}super.onResponseEnd(e,r)}onResponseError(e,r){if(this.#e.length>0){for(let n of this.#e)n.destroy(r);this.#c()}super.onResponseError(e,r)}};function mMs(t={}){return zqn||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),zqn=!0),e=>(r,n)=>{let o=new ear(n,t);return e(r,o)}}a(mMs,"createDecompressInterceptor");Yqn.exports=mMs});var Xqn=I((iuf,Zqn)=>{"use strict";p();var{RequestAbortedError:gMs}=ao(),Jqn=5*1024*1024,tar=class{static{a(this,"DeduplicationHandler")}#e;#t=[];#r=Jqn;#n=0;#i={};#o="";#s=!1;#a=!1;#c=!1;#u=!1;#l=null;#p=null;constructor(e,r,n=Jqn){this.#e=e,this.#p=r,this.#r=n}addWaitingHandler(e){if(this.#u||this.#c)return!1;let r=this.#g(e),n=r.controller;try{if(e.onRequestStart?.(n,null),n.aborted)return r.done=!0,!0;this.#a&&e.onResponseStart?.(n,this.#n,this.#i,this.#o)}catch{return r.done=!0,!0}return n.aborted||this.#t.push(r),!0}onRequestStart(e,r){this.#l=e,this.#e.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.#e.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){this.#a=!0,this.#n=r,this.#i=n,this.#o=o,this.#e.onResponseStart?.(e,r,n,o);for(let s of this.#t){let{handler:c,controller:l}=s;if(s.done||l.aborted){s.done=!0;continue}try{c.onResponseStart?.(l,r,n,o)}catch{}l.aborted&&(s.done=!0)}this.#m()}onResponseData(e,r){if(!(this.#s||this.#u)){this.#c=!0,this.#e.onResponseData?.(e,r);for(let n of this.#t){let{handler:o,controller:s}=n;if(n.done||s.aborted){n.done=!0;continue}if(s.paused){this.#A(n,r);continue}try{o.onResponseData?.(s,r)}catch{}s.aborted&&(n.done=!0,n.bufferedChunks=[],n.bufferedBytes=0)}this.#m()}}onResponseEnd(e,r){if(!(this.#s||this.#u)){this.#u=!0,this.#e.onResponseEnd?.(e,r);for(let n of this.#t){if(n.done||n.controller.aborted){n.done=!0;continue}if(this.#h(n),n.done||n.controller.aborted){n.done=!0;continue}if(n.controller.paused&&n.bufferedChunks.length>0){n.pendingTrailers=r;continue}try{n.handler.onResponseEnd?.(n.controller,r)}catch{}n.done=!0}this.#m(),this.#p?.()}}onResponseError(e,r){if(!this.#u){this.#s=!0,this.#u=!0,this.#e.onResponseError?.(e,r);for(let n of this.#t)this.#v(n,r);this.#t=[],this.#p?.()}}#g(e){let r={handler:e,controller:null,bufferedChunks:[],bufferedBytes:0,pendingTrailers:null,done:!1},n={aborted:!1,paused:!1,reason:null};return r.controller={resume:a(()=>{if(!n.aborted){if(n.paused=!1,this.#h(r),this.#u&&r.pendingTrailers&&r.bufferedChunks.length===0&&!n.paused&&!n.aborted){try{r.handler.onResponseEnd?.(r.controller,r.pendingTrailers)}catch{}r.pendingTrailers=null,r.done=!0}this.#m()}},"resume"),pause:a(()=>{n.aborted||(n.paused=!0)},"pause"),get paused(){return n.paused},get aborted(){return n.aborted},get reason(){return n.reason},abort:a(o=>{n.aborted=!0,n.reason=o??null,r.done=!0,r.pendingTrailers=null,r.bufferedChunks=[],r.bufferedBytes=0},"abort")},r}#A(e,r){if(e.done||e.controller.aborted){e.done=!0,e.bufferedChunks=[],e.bufferedBytes=0;return}let n=Buffer.from(r);if(e.bufferedChunks.push(n),e.bufferedBytes+=n.length,e.bufferedBytes>this.#r){let o=new gMs(`Deduplicated waiting handler exceeded maxBufferSize (${this.#r} bytes) while paused`);this.#v(e,o)}}#h(e){let{handler:r,controller:n}=e;for(;!e.done&&!n.aborted&&!n.paused&&e.bufferedChunks.length>0;){let o=e.bufferedChunks.shift();e.bufferedBytes-=o.length;try{r.onResponseData?.(n,o)}catch{}if(n.aborted){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;break}}}#v(e,r){if(!e.done){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;try{e.controller.abort(r),e.handler.onResponseError?.(e.controller,r)}catch{}}}#m(){this.#t=this.#t.filter(e=>e.done===!1)}};Zqn.exports=tar});var tjn=I((auf,ejn)=>{"use strict";p();var AMs=require("node:diagnostics_channel"),yMs=Po(),EMs=Xqn(),{normalizeHeaders:_Ms,makeCacheKey:vMs,makeDeduplicationKey:CMs}=Ipe(),Cst=AMs.channel("undici:request:pending-requests");ejn.exports=(t={})=>{let{methods:e=["GET"],skipHeaderNames:r=[],excludeHeaderNames:n=[],maxBufferSize:o=5*1024*1024}=t;if(typeof t!="object"||t===null)throw new TypeError(`expected type of opts to be an Object, got ${t===null?"null":typeof t}`);if(!Array.isArray(e))throw new TypeError(`expected opts.methods to be an array, got ${typeof e}`);for(let u of e)if(!yMs.safeHTTPMethods.includes(u))throw new TypeError(`expected opts.methods to only contain safe HTTP methods, got ${u}`);if(!Array.isArray(r))throw new TypeError(`expected opts.skipHeaderNames to be an array, got ${typeof r}`);if(!Array.isArray(n))throw new TypeError(`expected opts.excludeHeaderNames to be an array, got ${typeof n}`);if(!Number.isFinite(o)||o<=0)throw new TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${o}`);let s=new Set(r.map(u=>u.toLowerCase())),c=new Set(n.map(u=>u.toLowerCase())),l=new Map;return u=>(d,f)=>{if(!d.origin||e.includes(d.method)===!1)return u(d,f);if(d={...d,headers:_Ms(d)},s.size>0){for(let y of Object.keys(d.headers))if(s.has(y.toLowerCase()))return u(d,f)}let h=vMs(d),m=CMs(h,c),g=l.get(m);if(g)return g.addWaitingHandler(f)?!0:u(d,f);let A=new EMs(f,()=>{l.delete(m),Cst.hasSubscribers&&Cst.publish({size:l.size,key:m,type:"removed"})},o);return l.set(m,A),Cst.hasSubscribers&&Cst.publish({size:l.size,key:m,type:"added"}),u(d,A)}}});var ijn=I((uuf,njn)=>{"use strict";p();var{Writable:bMs}=require("node:stream"),{assertCacheKey:rar,assertCacheValue:SMs}=Ipe(),nar,ST=3,rjn=2*1e3*1e3*1e3;njn.exports=class{static{a(this,"SqliteCacheStore")}#e=rjn;#t=1/0;#r;#n;#i;#o;#s;#a;#c;#u;constructor(e){if(e){if(typeof e!="object")throw new TypeError("SqliteCacheStore options must be an object");if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("SqliteCacheStore options.maxEntrySize must be a non-negative integer");if(e.maxEntrySize>rjn)throw new TypeError("SqliteCacheStore options.maxEntrySize must be less than 2gb");this.#e=e.maxEntrySize}if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("SqliteCacheStore options.maxCount must be a non-negative integer");this.#t=e.maxCount}}nar||(nar=require("node:sqlite").DatabaseSync),this.#r=new nar(e?.location??":memory:"),this.#r.exec(` +${e.format(r)}`.trim())}};xjn.exports=Sar});var Iar=I((gff,Pjn)=>{"use strict";p();var{InvalidArgumentError:PMs}=so(),{runtimeFeatures:DMs}=e8();function NMs(t={}){let{ignoreHeaders:e=[],excludeHeaders:r=[],matchHeaders:n=[],caseSensitive:o=!1}=t;return{ignore:new Set(e.map(s=>o?s:s.toLowerCase())),exclude:new Set(r.map(s=>o?s:s.toLowerCase())),match:new Set(n.map(s=>o?s:s.toLowerCase()))}}a(NMs,"createHeaderFilters");var wjn=DMs.has("crypto")?require("node:crypto"):null,MMs=wjn?.hash?t=>wjn.hash("sha256",t,"base64url"):t=>Buffer.from(t).toString("base64url");function kjn(t){return Array.isArray(t)&&(t.length&1)===0}a(kjn,"isUndiciHeaders");function OMs(t=[]){return t.length===0?()=>!1:a(function(r){let n;for(let o of t)if(typeof o=="string"){if(n||(n=r.toLowerCase()),n.includes(o.toLowerCase()))return!0}else if(o instanceof RegExp&&o.test(r))return!0;return!1},"isUrlExcluded")}a(OMs,"isUrlExcludedFactory");function LMs(t){let e={};if(!t)return e;if(kjn(t)){for(let r=0;r{"use strict";p();var{writeFile:FMs,readFile:UMs,mkdir:QMs}=require("node:fs/promises"),{dirname:qMs,resolve:Djn}=require("node:path"),{setTimeout:jMs,clearTimeout:Njn}=require("node:timers"),{InvalidArgumentError:Mjn,UndiciError:HMs}=so(),{hashId:GMs,isUrlExcludedFactory:$Ms,normalizeHeaders:Ojn,createHeaderFilters:Ljn}=Iar();function A2e(t,e,r={}){let n=new URL(t.path,t.origin),o=t._normalizedHeaders||Ojn(t.headers);return t._normalizedHeaders||(t._normalizedHeaders=o),{method:t.method||"GET",url:r.matchQuery!==!1?n.toString():`${n.origin}${n.pathname}`,headers:Bjn(o,e,r),body:r.matchBody!==!1&&t.body?String(t.body):""}}a(A2e,"formatRequestKey");function Bjn(t,e,r={}){if(!t||typeof t!="object")return{};let{caseSensitive:n=!1}=r,o={},{ignore:s,exclude:c,match:l}=e;for(let[u,d]of Object.entries(t)){let f=n?u:u.toLowerCase();c.has(f)||s.has(f)||l.size!==0&&!l.has(f)||(o[f]=d)}return o}a(Bjn,"filterHeadersForMatching");function Fjn(t,e,r={}){if(!t||typeof t!="object")return{};let{caseSensitive:n=!1}=r,o={},{exclude:s}=e;for(let[c,l]of Object.entries(t)){let u=n?c:c.toLowerCase();s.has(u)||(o[u]=l)}return o}a(Fjn,"filterHeadersForStorage");function y2e(t){let e=[t.method,t.url];if(t.headers&&typeof t.headers=="object"){let n=Object.keys(t.headers).sort();for(let o of n){let s=Array.isArray(t.headers[o])?t.headers[o]:[t.headers[o]];e.push(o);for(let c of s.sort())e.push(String(c))}}e.push(t.body);let r=e.join("|");return GMs(r)}a(y2e,"createRequestHash");var xar=class{static{a(this,"SnapshotRecorder")}#e;#t;#r=new Map;#n;#i=1/0;#o=!1;#s;constructor(e={}){this.#n=e.snapshotPath,this.#i=e.maxSnapshots||1/0,this.#o=e.autoFlush||!1,this.flushInterval=e.flushInterval||3e4,this._flushTimer=null,this.matchOptions={matchHeaders:e.matchHeaders||[],ignoreHeaders:e.ignoreHeaders||[],excludeHeaders:e.excludeHeaders||[],matchBody:e.matchBody!==!1,matchQuery:e.matchQuery!==!1,caseSensitive:e.caseSensitive||!1},this.#s=Ljn(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#t=$Ms(e.excludeUrls),this.#o&&this.#n&&this.#a()}async record(e,r){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let n=A2e(e,this.#s,this.matchOptions),o=y2e(n),s=Ojn(r.headers),c={statusCode:r.statusCode,headers:Fjn(s,this.#s,this.matchOptions),body:Buffer.isBuffer(r.body)?r.body.toString("base64"):Buffer.from(String(r.body||"")).toString("base64"),trailers:r.trailers};if(this.#r.size>=this.#i&&!this.#r.has(o)){let u=this.#r.keys().next().value;this.#r.delete(u)}let l=this.#r.get(o);l&&l.responses?(l.responses.push(c),l.timestamp=new Date().toISOString()):this.#r.set(o,{request:n,responses:[c],callCount:0,timestamp:new Date().toISOString()}),this.#o&&this.#n&&this.#u()}isUrlExcluded(e){let r=new URL(e.path,e.origin).toString();return this.#t(r)}findSnapshot(e){if(!this.shouldPlayback(e)||this.isUrlExcluded(e))return;let r=A2e(e,this.#s,this.matchOptions),n=y2e(r),o=this.#r.get(n);if(!o)return;let s=o.callCount||0,c=Math.min(s,o.responses.length-1);return o.callCount=s+1,{...o,response:o.responses[c]}}async loadSnapshots(e){let r=e||this.#n;if(!r)throw new Mjn("Snapshot path is required");try{let n=await UMs(Djn(r),"utf8"),o=JSON.parse(n);if(Array.isArray(o)){this.#r.clear();for(let{hash:s,snapshot:c}of o)this.#r.set(s,c)}else this.#r=new Map(Object.entries(o))}catch(n){if(n.code==="ENOENT")this.#r.clear();else throw new HMs(`Failed to load snapshots from ${r}`,{cause:n})}}async saveSnapshots(e){let r=e||this.#n;if(!r)throw new Mjn("Snapshot path is required");let n=Djn(r);await QMs(qMs(n),{recursive:!0});let o=Array.from(this.#r.entries()).map(([s,c])=>({hash:s,snapshot:c}));await FMs(n,JSON.stringify(o,null,2),{flush:!0})}clear(){this.#r.clear()}getSnapshots(){return Array.from(this.#r.values())}size(){return this.#r.size}resetCallCounts(){for(let e of this.#r.values())e.callCount=0}deleteSnapshot(e){let r=A2e(e,this.#s,this.matchOptions),n=y2e(r);return this.#r.delete(n)}getSnapshotInfo(e){let r=A2e(e,this.#s,this.matchOptions),n=y2e(r),o=this.#r.get(n);return o?{hash:n,request:o.request,responseCount:o.responses?o.responses.length:o.response?1:0,callCount:o.callCount||0,timestamp:o.timestamp}:null}replaceSnapshots(e){if(this.#r.clear(),Array.isArray(e))for(let{hash:r,snapshot:n}of e)this.#r.set(r,n);else e&&typeof e=="object"&&(this.#r=new Map(Object.entries(e)))}#a(){return this.#u()}#c(){this.#e&&(Njn(this.#e),this.saveSnapshots().catch(()=>{}),this.#e=null)}#u(){this.#e=jMs(()=>{this.saveSnapshots().catch(()=>{}),this.#o?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#c(),this.#e&&(Njn(this.#e),this.#e=null)}async close(){this.#n&&this.#r.size!==0&&await this.saveSnapshots(),this.destroy()}};Ujn.exports={SnapshotRecorder:xar,formatRequestKey:A2e,createRequestHash:y2e,filterHeadersForMatching:Bjn,filterHeadersForStorage:Fjn,createHeaderFilters:Ljn}});var Hjn=I((Cff,jjn)=>{"use strict";p();var VMs=VZ(),WMs=Tar(),{SnapshotRecorder:zMs}=Qjn(),YMs=MPe(),{InvalidArgumentError:KMs,UndiciError:JMs}=so(),{validateSnapshotMode:ZMs}=Iar(),yb=Symbol("kSnapshotRecorder"),$5=Symbol("kSnapshotMode"),E2e=Symbol("kSnapshotPath"),war=Symbol("kSnapshotLoaded"),Wst=Symbol("kRealAgent"),qjn=!1,Rar=class extends WMs{static{a(this,"SnapshotAgent")}constructor(e={}){qjn||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),qjn=!0);let{mode:r="record",snapshotPath:n=null,...o}=e;if(super(o),ZMs(r),(r==="playback"||r==="update")&&!n)throw new KMs(`snapshotPath is required when mode is '${r}'`);this[$5]=r,this[E2e]=n,this[yb]=new zMs({snapshotPath:this[E2e],mode:this[$5],maxSnapshots:e.maxSnapshots,autoFlush:e.autoFlush,flushInterval:e.flushInterval,matchHeaders:e.matchHeaders,ignoreHeaders:e.ignoreHeaders,excludeHeaders:e.excludeHeaders,matchBody:e.matchBody,matchQuery:e.matchQuery,caseSensitive:e.caseSensitive,shouldRecord:e.shouldRecord,shouldPlayback:e.shouldPlayback,excludeUrls:e.excludeUrls}),this[war]=!1,(this[$5]==="record"||this[$5]==="update"||this[$5]==="playback"&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[Wst]=new VMs(e)),(this[$5]==="playback"||this[$5]==="update")&&this[E2e]&&this.loadSnapshots().catch(()=>{})}dispatch(e,r){r=YMs.wrap(r);let n=this[$5];if(this[yb].isUrlExcluded(e))return this[Wst].dispatch(e,r);if(n==="playback"||n==="update"){if(!this[war])return this.#e(e,r);let o=this[yb].findSnapshot(e);if(o)return this.#r(o,r);if(n==="update")return this.#t(e,r);{let s=new JMs(`No snapshot found for ${e.method||"GET"} ${e.path}`);if(r.onError){r.onError(s);return}throw s}}else if(n==="record")return this.#t(e,r)}async#e(e,r){return await this.loadSnapshots(),this.dispatch(e,r)}#t(e,r){let n={statusCode:null,headers:{},trailers:{},body:[]},o=this,s={onRequestStart(l,u){return r.onRequestStart(l,{...u,history:this.history})},onRequestUpgrade(l,u,d,f){return r.onRequestUpgrade(l,u,d,f)},onResponseStart(l,u,d,f){return n.statusCode=u,n.headers=d,r.onResponseStart(l,u,d,f)},onResponseData(l,u){return n.body.push(u),r.onResponseData(l,u)},onResponseEnd(l,u){n.trailers=u;let d=Buffer.concat(n.body);o[yb].record(e,{statusCode:n.statusCode,headers:n.headers,body:d,trailers:n.trailers}).then(()=>r.onResponseEnd(l,u)).catch(f=>r.onResponseError(l,f))}};return this[Wst].dispatch(e,s)}#r(e,r){try{let{response:n}=e,o={pause(){},resume(){},abort(c){this.aborted=!0,this.reason=c},aborted:!1,paused:!1};r.onRequestStart(o),r.onResponseStart(o,n.statusCode,n.headers);let s=Buffer.from(n.body,"base64");r.onResponseData(o,s),r.onResponseEnd(o,n.trailers)}catch(n){r.onError?.(n)}}async loadSnapshots(e){await this[yb].loadSnapshots(e||this[E2e]),this[war]=!0,this[$5]==="playback"&&this.#n()}async saveSnapshots(e){return this[yb].saveSnapshots(e||this[E2e])}#n(){for(let e of this[yb].getSnapshots()){let{request:r,responses:n,response:o}=e,s=new URL(r.url),c=this.get(s.origin),l=n?n[0]:o;l&&c.intercept({path:s.pathname+s.search,method:r.method,headers:r.headers,body:r.body}).reply(l.statusCode,l.body,{headers:l.headers,trailers:l.trailers}).persist()}}getRecorder(){return this[yb]}getMode(){return this[$5]}clearSnapshots(){this[yb].clear()}resetCallCounts(){this[yb].resetCallCounts()}deleteSnapshot(e){return this[yb].deleteSnapshot(e)}getSnapshotInfo(e){return this[yb].getSnapshotInfo(e)}replaceSnapshots(e){this[yb].replaceSnapshots(e)}async close(){await this[yb].close(),await this[Wst]?.close(),await super.close()}};jjn.exports=Rar});var zst=I((Tff,Wjn)=>{"use strict";p();var XMs=Symbol.for("undici.globalDispatcher.2"),Gjn=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:eOs}=so(),tOs=VZ();Vjn()===void 0&&$jn(new tOs);function $jn(t){if(!t||typeof t.dispatch!="function")throw new eOs("Argument agent must implement Agent");Object.defineProperty(globalThis,XMs,{value:t,writable:!0,enumerable:!1,configurable:!1}),Object.defineProperty(globalThis,Gjn,{value:t,writable:!0,enumerable:!1,configurable:!1})}a($jn,"setGlobalDispatcher");function Vjn(){return globalThis[Gjn]}a(Vjn,"getGlobalDispatcher");var rOs=["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"];Wjn.exports={setGlobalDispatcher:$jn,getGlobalDispatcher:Vjn,installedExports:rOs}});var Qpe=I((Rff,zjn)=>{"use strict";p();var u8=require("node:assert"),nOs=MPe();zjn.exports=class{static{a(this,"DecoratorHandler")}#e;#t=!1;#r=!1;#n=!1;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=nOs.wrap(e)}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return u8(!this.#t),u8(!this.#r),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return u8(!this.#t),u8(!this.#r),u8(!this.#n),this.#n=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return u8(!this.#t),u8(!this.#r),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return u8(!this.#t),u8(!this.#r),this.#t=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#r=!0,this.#e.onResponseError?.(...e)}onBodySent(){}}});var Nar=I((Dff,Zjn)=>{"use strict";p();var Eb=Po(),{kBodyUsed:_2e}=al(),Dar=require("node:assert"),{InvalidArgumentError:kar}=so(),iOs=require("node:events"),oOs=[300,301,302,303,307,308],Yjn=Symbol("body"),Kjn=a(()=>{},"noop"),Yst=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[Yjn]=e,this[_2e]=!1}async*[Symbol.asyncIterator](){Dar(!this[_2e],"disturbed"),this[_2e]=!0,yield*this[Yjn]}},Par=class t{static{a(this,"RedirectHandler")}static buildDispatch(e,r){if(r!=null&&(!Number.isInteger(r)||r<0))throw new kar("maxRedirections must be a positive number");let n=e.dispatch.bind(e);return(o,s)=>n(o,new t(n,r,o,s))}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new kar("maxRedirections must be a positive number");this.dispatch=e,this.location=null;let{maxRedirections:s,...c}=n;this.opts=c,this.maxRedirections=r,this.handler=o,this.history=[],Eb.isStream(this.opts.body)?(Eb.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){Dar(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[_2e]=!1,iOs.prototype.on.call(this.opts.body,"data",function(){this[_2e]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Yst(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&Eb.isIterable(this.opts.body)&&!Eb.isFormDataLike(this.opts.body)&&(this.opts.body=new Yst(this.opts.body))}onRequestStart(e,r){this.handler.onRequestStart?.(e,{...r,history:this.history})}onRequestUpgrade(e,r,n,o){this.handler.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){if(this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections)throw new Error("max redirects");if((r===301||r===302)&&this.opts.method==="POST"&&(this.opts.method="GET",Eb.isStream(this.opts.body)&&Eb.destroy(this.opts.body.on("error",Kjn)),this.opts.body=null),r===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",Eb.isStream(this.opts.body)&&Eb.destroy(this.opts.body.on("error",Kjn)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||Eb.isDisturbed(this.opts.body)||oOs.indexOf(r)===-1?null:n.location,this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location){this.handler.onResponseStart?.(e,r,n,o);return}let{origin:s,pathname:c,search:l}=Eb.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c,d=`${s}${u}`;for(let f of this.history)if(f.toString()===d)throw new kar(`Redirect loop detected. Cannot redirect to ${s}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);this.opts.headers=sOs(this.opts.headers,r===303,this.opts.origin!==s),this.opts.path=u,this.opts.origin=s,this.opts.query=null}onResponseData(e,r){this.location||this.handler.onResponseData?.(e,r)}onResponseEnd(e,r){this.location?this.dispatch(this.opts,this):this.handler.onResponseEnd(e,r)}onResponseError(e,r){this.handler.onResponseError?.(e,r)}};function Jjn(t,e,r){if(t.length===4)return Eb.headerNameToString(t)==="host";if(e&&Eb.headerNameToString(t).startsWith("content-"))return!0;if(r&&(t.length===13||t.length===6||t.length===19)){let n=Eb.headerNameToString(t);return n==="authorization"||n==="cookie"||n==="proxy-authorization"}return!1}a(Jjn,"shouldRemoveHeader");function sOs(t,e,r){let n=[];if(Array.isArray(t))for(let o=0;o{"use strict";p();var aOs=Nar();function cOs({maxRedirections:t}={}){return e=>a(function(n,o){let{maxRedirections:s=t,...c}=n;if(s==null||s===0)return e(n,o);let l={...c},u=new aOs(e,s,l,o);return e(l,u)},"Intercept")}a(cOs,"createRedirectInterceptor");Xjn.exports=cOs});var rHn=I((Fff,tHn)=>{"use strict";p();var lOs=Qpe(),{ResponseError:uOs}=so(),Mar=class extends lOs{static{a(this,"ResponseErrorHandler")}#e;#t;#r;#n;#i;constructor(e,{handler:r}){super(r)}#o(e){return(this.#t??"").indexOf(e)===0}onRequestStart(e,r){return this.#e=0,this.#t=null,this.#r=null,this.#n=null,this.#i="",super.onRequestStart(e,r)}onResponseStart(e,r,n,o){if(this.#e=r,this.#n=n,this.#t=n["content-type"],this.#e<400)return super.onResponseStart(e,r,n,o);(this.#o("application/json")||this.#o("text/plain"))&&(this.#r=new TextDecoder("utf-8"))}onResponseData(e,r){if(this.#e<400)return super.onResponseData(e,r);this.#i+=this.#r?.decode(r,{stream:!0})??""}onResponseEnd(e,r){if(this.#e>=400){if(this.#i+=this.#r?.decode(void 0,{stream:!1})??"",this.#o("application/json"))try{this.#i=JSON.parse(this.#i)}catch{}let n,o=Error.stackTraceLimit;Error.stackTraceLimit=0;try{n=new uOs("Response Error",this.#e,{body:this.#i,headers:this.#n})}finally{Error.stackTraceLimit=o}super.onResponseError(e,n)}else super.onResponseEnd(e,r)}onResponseError(e,r){super.onResponseError(e,r)}};tHn.exports=()=>t=>a(function(r,n){return t(r,new Mar(r,{handler:n}))},"Intercept")});var iHn=I((qff,nHn)=>{"use strict";p();var dOs=Nst();nHn.exports=t=>e=>a(function(n,o){return e(n,new dOs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var sHn=I((Gff,oHn)=>{"use strict";p();var{InvalidArgumentError:fOs,RequestAbortedError:pOs}=so(),hOs=Qpe(),Oar=class extends hOs{static{a(this,"DumpHandler")}#e=1024*1024;#t=!1;#r=0;#n=null;aborted=!1;reason=!1;constructor({maxSize:e,signal:r},n){if(e!=null&&(!Number.isFinite(e)||e<1))throw new fOs("maxSize must be a number greater than 0");super(n),this.#e=e??this.#e}#i(e){this.aborted=!0,this.reason=e}onRequestStart(e,r){return e.abort=this.#i.bind(this),this.#n=e,super.onRequestStart(e,r)}onResponseStart(e,r,n,o){let s=n["content-length"];if(s!=null&&s>this.#e)throw new pOs(`Response size (${s}) larger than maxSize (${this.#e})`);return this.aborted===!0?!0:super.onResponseStart(e,r,n,o)}onResponseError(e,r){this.#t||(r=this.#n?.reason??r,super.onResponseError(e,r))}onResponseData(e,r){return this.#r=this.#r+r.length,this.#r>=this.#e&&(this.#t=!0,this.aborted===!0?super.onResponseError(e,this.reason):super.onResponseEnd(e,{})),!0}onResponseEnd(e,r){if(!this.#t){if(this.#n.aborted===!0){super.onResponseError(e,this.reason);return}super.onResponseEnd(e,r)}}};function mOs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new Oar({maxSize:s,signal:n.signal},o);return e(n,c)},"Intercept")}a(mOs,"createDumpInterceptor");oHn.exports=mOs});var uHn=I((Wff,lHn)=>{"use strict";p();var{isIP:gOs}=require("node:net"),{lookup:AOs}=require("node:dns"),yOs=Qpe(),{InvalidArgumentError:nX,InformationalError:EOs}=so(),Lar=Math.pow(2,31)-1;function _Os(t){let e=Object.getPrototypeOf(t);return Object.prototype.hasOwnProperty.call(t,Symbol.iterator)||e!=null&&e!==Object.prototype&&typeof t[Symbol.iterator]=="function"}a(_Os,"hasSafeIterator");function aHn(t){return typeof t=="string"&&t.toLowerCase()==="host"}a(aHn,"isHostHeader");function vOs(t){if(t==null)return null;if(Array.isArray(t)){if(t.length===0||!Array.isArray(t[0]))return t;let e=[];for(let r of t)Array.isArray(r)&&r.length===2?e.push(r[0],r[1]):e.push(r);return e}if(typeof t=="object"&&_Os(t)){let e=[];for(let r of t)Array.isArray(r)&&r.length===2?e.push(r[0],r[1]):e.push(r);return e}return t}a(vOs,"normalizeHeaders");function COs(t){if(t==null)return!1;if(Array.isArray(t)){if(t.length===0)return!1;for(let e=0;e=this.#e}},Far=class{static{a(this,"DNSInstance")}#e=0;#t=0;dualStack=!0;affinity=null;lookup=null;pick=null;storage=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#r,this.pick=e.pick??this.#n,this.storage=e.storage??new Bar(e)}runLookup(e,r,n){let o=this.storage.get(e.hostname);if(o==null&&this.storage.full()){n(null,e);return}let s={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...r.dns,maxTTL:this.#e,maxItems:this.#t};if(o==null)this.lookup(e,s,(c,l)=>{if(c||l==null||l.length===0){n(c??new EOs("No DNS entries found"));return}this.setRecords(e,l);let u=this.storage.get(e.hostname),d=this.pick(e,u,s.affinity),f;typeof d.port=="number"?f=`:${d.port}`:e.port!==""?f=`:${e.port}`:f="",n(null,new URL(`${e.protocol}//${d.family===6?`[${d.address}]`:d.address}${f}`))});else{let c=this.pick(e,o,s.affinity);if(c==null){this.storage.delete(e.hostname),this.runLookup(e,r,n);return}let l;typeof c.port=="number"?l=`:${c.port}`:e.port!==""?l=`:${e.port}`:l="",n(null,new URL(`${e.protocol}//${c.family===6?`[${c.address}]`:c.address}${l}`))}}#r(e,r,n){AOs(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(o,s)=>{if(o)return n(o);let c=new Map;for(let l of s)c.set(`${l.address}:${l.family}`,l);n(null,c.values())})}#n(e,r,n){let o=null,{records:s,offset:c}=r,l;if(this.dualStack?(n==null&&(c==null||c===Lar?(r.offset=0,n=4):(r.offset++,n=(r.offset&1)===1?6:4)),s[n]!=null&&s[n].ips.length>0?l=s[n]:l=s[n===4?6:4]):l=s[n],l==null||l.ips.length===0)return o;l.offset==null||l.offset===Lar?l.offset=0:l.offset++;let u=l.offset%l.ips.length;return o=l.ips[u]??null,o==null?o:Date.now()-o.timestamp>o.ttl?(l.ips.splice(u,1),this.pick(e,r,n)):o}pickFamily(e,r){let n=this.storage.get(e.hostname)?.records;if(!n)return null;let o=n[r];if(!o)return null;o.offset==null||o.offset===Lar?o.offset=0:o.offset++;let s=o.offset%o.ips.length,c=o.ips[s]??null;return c==null||Date.now()-c.timestamp>c.ttl&&o.ips.splice(s,1),c}setRecords(e,r){let n=Date.now(),o={records:{4:null,6:null}},s=this.#e;for(let c of r){c.timestamp=n,typeof c.ttl=="number"?(c.ttl=Math.min(c.ttl,this.#e),s=Math.min(s,c.ttl)):c.ttl=this.#e;let l=o.records[c.family]??{ips:[]};l.ips.push(c),o.records[c.family]=l}this.storage.set(e.hostname,o,{ttl:s})}deleteRecords(e){this.storage.delete(e.hostname)}getHandler(e,r){return new Uar(this,e,r)}},Uar=class extends yOs{static{a(this,"DNSDispatchHandler")}#e=null;#t=null;#r=null;#n=null;#i=null;#o=null;#s=!0;constructor(e,{origin:r,handler:n,dispatch:o,newOrigin:s},c){super(n),this.#n=r,this.#o=s,this.#t={...c},this.#e=e,this.#r=o}onResponseError(e,r){switch(r.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){if(!this.#s){super.onResponseError(e,r);return}this.#s=!1;let n=this.#o.hostname[0]==="["?4:6,o=this.#e.pickFamily(this.#n,n);if(o==null){super.onResponseError(e,r);return}let s;typeof o.port=="number"?s=`:${o.port}`:this.#n.port!==""?s=`:${this.#n.port}`:s="";let c={...this.#t,origin:`${this.#n.protocol}//${o.family===6?`[${o.address}]`:o.address}${s}`,headers:cHn(this.#n.host,this.#t.headers)};this.#r(c,this);return}super.onResponseError(e,r);break}case"ENOTFOUND":this.#e.deleteRecords(this.#n),super.onResponseError(e,r);break;default:super.onResponseError(e,r);break}}};lHn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new nX("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new nX("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new nX("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new nX("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new nX("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new nX("Invalid pick. Must be a function");if(t?.storage!=null&&(typeof t?.storage?.get!="function"||typeof t?.storage?.set!="function"||typeof t?.storage?.full!="function"||typeof t?.storage?.delete!="function"))throw new nX("Invalid storage. Must be a object with methods: { get, set, full, delete }");let e=t?.dualStack??!0,r;e?r=t?.affinity??null:r=t?.affinity??4;let n={maxTTL:t?.maxTTL??1e4,lookup:t?.lookup??null,pick:t?.pick??null,dualStack:e,affinity:r,maxItems:t?.maxItems??1/0,storage:t?.storage},o=new Far(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return gOs(d.hostname)!==0?s(l,u):(o.runLookup(d,l,(f,h)=>{if(f)return u.onResponseError(null,f);let m={...l,servername:d.hostname,origin:h.origin,headers:cHn(d.host,l.headers)};s(m,o.getHandler({origin:d,dispatch:s,handler:u,newOrigin:h},l))}),!0)},"dnsInterceptor")}});var qpe=I((Kff,fHn)=>{"use strict";p();var{safeHTTPMethods:dHn,pathHasQueryOrFragment:bOs,hasSafeIterator:SOs}=Po(),{serializePathWithQuery:TOs}=Po();function IOs(t){if(!t.origin)throw new Error("opts.origin is undefined");let e=t.path||"/";return t.query&&!bOs(e)&&(e=TOs(e,t.query)),{origin:t.origin.toString(),method:t.method,path:e,headers:t.headers}}a(IOs,"makeCacheKey");function xOs(t){let e;if(t.headers==null)e={};else if(typeof t.headers=="object")if(e={},SOs(t.headers))for(let r of t.headers){if(!Array.isArray(r))throw new Error("opts.headers is not a valid header map");let[n,o]=r;if(typeof n!="string"||typeof o!="string")throw new Error("opts.headers is not a valid header map");e[n.toLowerCase()]=o}else for(let r of Object.keys(t.headers))e[r.toLowerCase()]=t.headers[r];else throw new Error("opts.headers is not an object");return e}a(xOs,"normalizeHeaders");function wOs(t){if(typeof t!="object")throw new TypeError(`expected key to be object, got ${typeof t}`);for(let e of["origin","method","path"])if(typeof t[e]!="string")throw new TypeError(`expected key.${e} to be string, got ${typeof t[e]}`);if(t.headers!==void 0&&typeof t.headers!="object")throw new TypeError(`expected headers to be object, got ${typeof t}`)}a(wOs,"assertCacheKey");function ROs(t){if(typeof t!="object")throw new TypeError(`expected value to be object, got ${typeof t}`);for(let e of["statusCode","cachedAt","staleAt","deleteAt"])if(typeof t[e]!="number")throw new TypeError(`expected value.${e} to be number, got ${typeof t[e]}`);if(typeof t.statusMessage!="string")throw new TypeError(`expected value.statusMessage to be string, got ${typeof t.statusMessage}`);if(t.headers!=null&&typeof t.headers!="object")throw new TypeError(`expected value.rawHeaders to be object, got ${typeof t.headers}`);if(t.vary!==void 0&&typeof t.vary!="object")throw new TypeError(`expected value.vary to be object, got ${typeof t.vary}`);if(t.etag!==void 0&&typeof t.etag!="string")throw new TypeError(`expected value.etag to be string, got ${typeof t.etag}`)}a(ROs,"assertCacheValue");function kOs(t){let e={},r;if(Array.isArray(t)){r=[];for(let n of t)r.push(...n.split(","))}else r=t.split(",");for(let n=0;n=2&&l[0]==='"'&&l[l.length-1]==='"'&&(l=l.substring(1,l.length-1));let u=parseInt(l,10);if(u!==u||c==="max-age"&&c in e&&e[c]>=u)continue;e[c]=u;break}case"private":case"no-cache":if(l){if(l[0]==='"'){let u=[l.substring(1)],d=l[l.length-1]==='"';if(!d)for(let f=n+1;f{"use strict";p();function LOs(t){switch(t[3]){case",":return BOs(t);case" ":return FOs(t);default:return UOs(t)}}a(LOs,"parseHttpDate");function BOs(t){if(t.length!==29||t[4]!==" "||t[7]!==" "||t[11]!==" "||t[16]!==" "||t[19]!==":"||t[22]!==":"||t[25]!==" "||t[26]!=="G"||t[27]!=="M"||t[28]!=="T")return;let e=-1;if(t[0]==="S"&&t[1]==="u"&&t[2]==="n")e=0;else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n")e=1;else if(t[0]==="T"&&t[1]==="u"&&t[2]==="e")e=2;else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d")e=3;else if(t[0]==="T"&&t[1]==="h"&&t[2]==="u")e=4;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i")e=5;else if(t[0]==="S"&&t[1]==="a"&&t[2]==="t")e=6;else return;let r=0;if(t[5]==="0"){let g=t.charCodeAt(6);if(g<49||g>57)return;r=g-48}else{let g=t.charCodeAt(5);if(g<49||g>51)return;let A=t.charCodeAt(6);if(A<48||A>57)return;r=(g-48)*10+(A-48)}let n=-1;if(t[8]==="J"&&t[9]==="a"&&t[10]==="n")n=0;else if(t[8]==="F"&&t[9]==="e"&&t[10]==="b")n=1;else if(t[8]==="M"&&t[9]==="a")if(t[10]==="r")n=2;else if(t[10]==="y")n=4;else return;else if(t[8]==="J")if(t[9]==="a"&&t[10]==="n")n=0;else if(t[9]==="u")if(t[10]==="n")n=5;else if(t[10]==="l")n=6;else return;else return;else if(t[8]==="A")if(t[9]==="p"&&t[10]==="r")n=3;else if(t[9]==="u"&&t[10]==="g")n=7;else return;else if(t[8]==="S"&&t[9]==="e"&&t[10]==="p")n=8;else if(t[8]==="O"&&t[9]==="c"&&t[10]==="t")n=9;else if(t[8]==="N"&&t[9]==="o"&&t[10]==="v")n=10;else if(t[8]==="D"&&t[9]==="e"&&t[10]==="c")n=11;else return;let o=t.charCodeAt(12);if(o<48||o>57)return;let s=t.charCodeAt(13);if(s<48||s>57)return;let c=t.charCodeAt(14);if(c<48||c>57)return;let l=t.charCodeAt(15);if(l<48||l>57)return;let u=(o-48)*1e3+(s-48)*100+(c-48)*10+(l-48),d=0;if(t[17]==="0"){let g=t.charCodeAt(18);if(g<48||g>57)return;d=g-48}else{let g=t.charCodeAt(17);if(g<48||g>50)return;let A=t.charCodeAt(18);if(A<48||A>57||g===50&&A>51)return;d=(g-48)*10+(A-48)}let f=0;if(t[20]==="0"){let g=t.charCodeAt(21);if(g<48||g>57)return;f=g-48}else{let g=t.charCodeAt(20);if(g<48||g>53)return;let A=t.charCodeAt(21);if(A<48||A>57)return;f=(g-48)*10+(A-48)}let h=0;if(t[23]==="0"){let g=t.charCodeAt(24);if(g<48||g>57)return;h=g-48}else{let g=t.charCodeAt(23);if(g<48||g>53)return;let A=t.charCodeAt(24);if(A<48||A>57)return;h=(g-48)*10+(A-48)}let m=new Date(Date.UTC(u,n,r,d,f,h));return m.getUTCDay()===e?m:void 0}a(BOs,"parseImfDate");function FOs(t){if(t.length!==24||t[7]!==" "||t[10]!==" "||t[19]!==" ")return;let e=-1;if(t[0]==="S"&&t[1]==="u"&&t[2]==="n")e=0;else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n")e=1;else if(t[0]==="T"&&t[1]==="u"&&t[2]==="e")e=2;else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d")e=3;else if(t[0]==="T"&&t[1]==="h"&&t[2]==="u")e=4;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i")e=5;else if(t[0]==="S"&&t[1]==="a"&&t[2]==="t")e=6;else return;let r=-1;if(t[4]==="J"&&t[5]==="a"&&t[6]==="n")r=0;else if(t[4]==="F"&&t[5]==="e"&&t[6]==="b")r=1;else if(t[4]==="M"&&t[5]==="a")if(t[6]==="r")r=2;else if(t[6]==="y")r=4;else return;else if(t[4]==="J")if(t[5]==="a"&&t[6]==="n")r=0;else if(t[5]==="u")if(t[6]==="n")r=5;else if(t[6]==="l")r=6;else return;else return;else if(t[4]==="A")if(t[5]==="p"&&t[6]==="r")r=3;else if(t[5]==="u"&&t[6]==="g")r=7;else return;else if(t[4]==="S"&&t[5]==="e"&&t[6]==="p")r=8;else if(t[4]==="O"&&t[5]==="c"&&t[6]==="t")r=9;else if(t[4]==="N"&&t[5]==="o"&&t[6]==="v")r=10;else if(t[4]==="D"&&t[5]==="e"&&t[6]==="c")r=11;else return;let n=0;if(t[8]===" "){let g=t.charCodeAt(9);if(g<49||g>57)return;n=g-48}else{let g=t.charCodeAt(8);if(g<49||g>51)return;let A=t.charCodeAt(9);if(A<48||A>57)return;n=(g-48)*10+(A-48)}let o=0;if(t[11]==="0"){let g=t.charCodeAt(12);if(g<48||g>57)return;o=g-48}else{let g=t.charCodeAt(11);if(g<48||g>50)return;let A=t.charCodeAt(12);if(A<48||A>57||g===50&&A>51)return;o=(g-48)*10+(A-48)}let s=0;if(t[14]==="0"){let g=t.charCodeAt(15);if(g<48||g>57)return;s=g-48}else{let g=t.charCodeAt(14);if(g<48||g>53)return;let A=t.charCodeAt(15);if(A<48||A>57)return;s=(g-48)*10+(A-48)}let c=0;if(t[17]==="0"){let g=t.charCodeAt(18);if(g<48||g>57)return;c=g-48}else{let g=t.charCodeAt(17);if(g<48||g>53)return;let A=t.charCodeAt(18);if(A<48||A>57)return;c=(g-48)*10+(A-48)}let l=t.charCodeAt(20);if(l<48||l>57)return;let u=t.charCodeAt(21);if(u<48||u>57)return;let d=t.charCodeAt(22);if(d<48||d>57)return;let f=t.charCodeAt(23);if(f<48||f>57)return;let h=(l-48)*1e3+(u-48)*100+(d-48)*10+(f-48),m=new Date(Date.UTC(h,r,n,o,s,c));return m.getUTCDay()===e?m:void 0}a(FOs,"parseAscTimeDate");function UOs(t){let e=-1,r=-1;if(t[0]==="S")t[1]==="u"&&t[2]==="n"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y"?(r=0,e=6):t[1]==="a"&&t[2]==="t"&&t[3]==="u"&&t[4]==="r"&&t[5]==="d"&&t[6]==="a"&&t[7]==="y"&&(r=6,e=8);else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y")r=1,e=6;else if(t[0]==="T")t[1]==="u"&&t[2]==="e"&&t[3]==="s"&&t[4]==="d"&&t[5]==="a"&&t[6]==="y"?(r=2,e=7):t[1]==="h"&&t[2]==="u"&&t[3]==="r"&&t[4]==="s"&&t[5]==="d"&&t[6]==="a"&&t[7]==="y"&&(r=4,e=8);else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d"&&t[3]==="n"&&t[4]==="e"&&t[5]==="s"&&t[6]==="d"&&t[7]==="a"&&t[8]==="y")r=3,e=9;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y")r=5,e=6;else return;if(t[e]!==","||t.length-e-1!==23||t[e+1]!==" "||t[e+4]!=="-"||t[e+8]!=="-"||t[e+11]!==" "||t[e+14]!==":"||t[e+17]!==":"||t[e+20]!==" "||t[e+21]!=="G"||t[e+22]!=="M"||t[e+23]!=="T")return;let n=0;if(t[e+2]==="0"){let m=t.charCodeAt(e+3);if(m<49||m>57)return;n=m-48}else{let m=t.charCodeAt(e+2);if(m<49||m>51)return;let g=t.charCodeAt(e+3);if(g<48||g>57)return;n=(m-48)*10+(g-48)}let o=-1;if(t[e+5]==="J"&&t[e+6]==="a"&&t[e+7]==="n")o=0;else if(t[e+5]==="F"&&t[e+6]==="e"&&t[e+7]==="b")o=1;else if(t[e+5]==="M"&&t[e+6]==="a"&&t[e+7]==="r")o=2;else if(t[e+5]==="A"&&t[e+6]==="p"&&t[e+7]==="r")o=3;else if(t[e+5]==="M"&&t[e+6]==="a"&&t[e+7]==="y")o=4;else if(t[e+5]==="J"&&t[e+6]==="u"&&t[e+7]==="n")o=5;else if(t[e+5]==="J"&&t[e+6]==="u"&&t[e+7]==="l")o=6;else if(t[e+5]==="A"&&t[e+6]==="u"&&t[e+7]==="g")o=7;else if(t[e+5]==="S"&&t[e+6]==="e"&&t[e+7]==="p")o=8;else if(t[e+5]==="O"&&t[e+6]==="c"&&t[e+7]==="t")o=9;else if(t[e+5]==="N"&&t[e+6]==="o"&&t[e+7]==="v")o=10;else if(t[e+5]==="D"&&t[e+6]==="e"&&t[e+7]==="c")o=11;else return;let s=t.charCodeAt(e+9);if(s<48||s>57)return;let c=t.charCodeAt(e+10);if(c<48||c>57)return;let l=(s-48)*10+(c-48);l+=l<70?2e3:1900;let u=0;if(t[e+12]==="0"){let m=t.charCodeAt(e+13);if(m<48||m>57)return;u=m-48}else{let m=t.charCodeAt(e+12);if(m<48||m>50)return;let g=t.charCodeAt(e+13);if(g<48||g>57||m===50&&g>51)return;u=(m-48)*10+(g-48)}let d=0;if(t[e+15]==="0"){let m=t.charCodeAt(e+16);if(m<48||m>57)return;d=m-48}else{let m=t.charCodeAt(e+15);if(m<48||m>53)return;let g=t.charCodeAt(e+16);if(g<48||g>57)return;d=(m-48)*10+(g-48)}let f=0;if(t[e+18]==="0"){let m=t.charCodeAt(e+19);if(m<48||m>57)return;f=m-48}else{let m=t.charCodeAt(e+18);if(m<48||m>53)return;let g=t.charCodeAt(e+19);if(g<48||g>57)return;f=(m-48)*10+(g-48)}let h=new Date(Date.UTC(l,o,n,u,d,f));return h.getUTCDay()===r?h:void 0}a(UOs,"parseRfc850Date");pHn.exports={parseHttpDate:LOs}});var yHn=I((rpf,AHn)=>{"use strict";p();var QOs=Po(),{parseCacheControlHeader:qOs,parseVaryHeader:jOs,isEtagUsable:HOs}=qpe(),{parseHttpDate:mHn}=hHn();function GOs(){}a(GOs,"noop");var gHn=[200,203,204,206,300,301,308,404,405,410,414,501],$Os=[206],VOs=2147483647e3,Qar=class{static{a(this,"CacheHandler")}#e;#t;#r;#n;#i;#o;constructor({store:e,type:r,cacheByDefault:n},o,s){this.#n=e,this.#t=r,this.#r=n,this.#e=o,this.#i=s}onRequestStart(e,r){this.#o?.destroy(),this.#o=void 0,this.#i.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.#i.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){let s=a(()=>this.#i.onResponseStart?.(e,r,n,o),"downstreamOnHeaders"),c=this;if(!QOs.safeHTTPMethods.includes(this.#e.method)&&r>=200&&r<=399){try{this.#n.delete(this.#e)?.catch?.(GOs)}catch{}return s()}let l=n["cache-control"],u=n["last-modified"]&&gHn.includes(r);if(!l&&!n.expires&&!u&&!this.#r)return s();let d=l?qOs(l):{};if(!WOs(this.#t,r,n,d,this.#e.headers))return s();let f=Date.now(),h=n.age?zOs(n.age):void 0;if(h&&h>=VOs)return s();let m=typeof n.date=="string"?mHn(n.date):void 0,g=YOs(this.#t,f,h,n,m,d)??this.#r;if(g===void 0||h&&h>g)return s();let A=m?m.getTime():f,y=g+A;if(f>=y)return s();let E;if(this.#e.headers&&n.vary&&(E=jOs(n.vary,this.#e.headers),!E))return s();let _=KOs(A,d,y),v=JOs(n,d),b={statusCode:r,statusMessage:o,headers:v,vary:E,cacheControlDirectives:d,cachedAt:h?f-h:f,staleAt:y,deleteAt:_};if(r===304){let T=a(R=>{if(!R)return s();if(b.statusCode=R.statusCode,b.statusMessage=R.statusMessage,b.etag=R.etag,b.headers={...R.headers,...v},s(),this.#o=this.#n.createWriteStream(this.#e,b),!(!this.#o||!R?.body))if(typeof R.body.values=="function"){let x=R.body.values(),P=a(()=>{for(let D of x){let N=this.#o.write(D)===!1;if(this.#i.onResponseData?.(e,D),N)break}},"streamCachedBody");this.#o.on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("drain",()=>{P()}).on("close",function(){c.#o===this&&(c.#o=void 0)}),P()}else typeof R.body.on=="function"&&(R.body.on("data",x=>{this.#o.write(x),this.#i.onResponseData?.(e,x)}).on("end",()=>{this.#o.end()}).on("error",()=>{this.#o=void 0,this.#n.delete(this.#e)}),this.#o.on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("close",function(){c.#o===this&&(c.#o=void 0)}))},"handle304"),w=this.#n.get(this.#e);w&&typeof w.then=="function"?w.then(T):T(w)}else{if(typeof n.etag=="string"&&HOs(n.etag)&&(b.etag=n.etag),this.#o=this.#n.createWriteStream(this.#e,b),!this.#o)return s();this.#o.on("drain",()=>e.resume()).on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("close",function(){c.#o===this&&(c.#o=void 0),e.resume()}),s()}}onResponseData(e,r){this.#o?.write(r)===!1&&e.pause(),this.#i.onResponseData?.(e,r)}onResponseEnd(e,r){this.#o?.end(),this.#i.onResponseEnd?.(e,r)}onResponseError(e,r){this.#o?.destroy(r),this.#o=void 0,this.#i.onResponseError?.(e,r)}};function WOs(t,e,r,n,o){return!(e<200||$Os.includes(e)||!gHn.includes(e)&&!r.expires&&!n.public&&n["max-age"]===void 0&&!(n.private&&t==="private")&&!(n["s-maxage"]!==void 0&&t==="shared")||n["no-store"]||t==="shared"&&n.private===!0||r.vary?.includes("*")||o?.authorization&&(!n.public&&!n["s-maxage"]&&!n["must-revalidate"]||typeof o.authorization!="string"||Array.isArray(n["no-cache"])&&n["no-cache"].includes("authorization")||Array.isArray(n.private)&&n.private.includes("authorization")))}a(WOs,"canCacheResponse");function zOs(t){let e=parseInt(Array.isArray(t)?t[0]:t);return isNaN(e)?void 0:e*1e3}a(zOs,"getAge");function YOs(t,e,r,n,o,s){if(t==="shared"){let l=s["s-maxage"];if(l!==void 0)return l>0?l*1e3:void 0}let c=s["max-age"];if(c!==void 0)return c>0?c*1e3:void 0;if(typeof n.expires=="string"){let l=mHn(n.expires);if(l)return e>=l.getTime()||o&&(o>=l||r!==void 0&&r>l-o)?void 0:l.getTime()-e}if(typeof n["last-modified"]=="string"){let l=new Date(n["last-modified"]);if(ZOs(l))return l.getTime()>=e?void 0:(e-l.getTime())*.1}if(s.immutable)return 31536e3}a(YOs,"determineStaleAt");function KOs(t,e,r){let n=-1/0,o=-1/0,s=-1/0;if(e["stale-while-revalidate"]&&(n=r+e["stale-while-revalidate"]*1e3),e["stale-if-error"]&&(o=r+e["stale-if-error"]*1e3),e.immutable&&n===-1/0&&o===-1/0&&(s=t+31536e6),n===-1/0&&o===-1/0&&s===-1/0){let c=r-t;return r+c}return Math.max(r,n,o,s)}a(KOs,"determineDeleteAt");function JOs(t,e){let r=["connection","proxy-authenticate","proxy-authentication-info","proxy-authorization","proxy-connection","te","transfer-encoding","upgrade","age"];t.connection&&(Array.isArray(t.connection)?r.push(...t.connection.map(o=>o.trim())):r.push(...t.connection.split(",").map(o=>o.trim()))),Array.isArray(e["no-cache"])&&r.push(...e["no-cache"]),Array.isArray(e.private)&&r.push(...e.private);let n;for(let o of r)t[o]&&(n??={...t},delete n[o]);return n??t}a(JOs,"stripNecessaryHeaders");function ZOs(t){return t instanceof Date&&Number.isFinite(t.valueOf())}a(ZOs,"isValidDate");AHn.exports=Qar});var jar=I((opf,vHn)=>{"use strict";p();var{Writable:XOs}=require("node:stream"),{EventEmitter:e5s}=require("node:events"),{assertCacheKey:EHn,assertCacheValue:t5s}=qpe(),qar=class extends e5s{static{a(this,"MemoryCacheStore")}#e=1024;#t=104857600;#r=5242880;#n=0;#i=0;#o=new Map;#s=!1;constructor(e){if(super(),e){if(typeof e!="object")throw new TypeError("MemoryCacheStore options must be an object");if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("MemoryCacheStore options.maxCount must be a non-negative integer");this.#e=e.maxCount}if(e.maxSize!==void 0){if(typeof e.maxSize!="number"||!Number.isInteger(e.maxSize)||e.maxSize<0)throw new TypeError("MemoryCacheStore options.maxSize must be a non-negative integer");this.#t=e.maxSize}if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("MemoryCacheStore options.maxEntrySize must be a non-negative integer");this.#r=e.maxEntrySize}}}get size(){return this.#n}isFull(){return this.#n>=this.#t||this.#i>=this.#e}get(e){EHn(e);let r=`${e.origin}:${e.path}`,n=Date.now(),o=this.#o.get(r),s=o?_Hn(e,o,n):null;return s==null?void 0:{statusMessage:s.statusMessage,statusCode:s.statusCode,headers:s.headers,body:s.body,vary:s.vary?s.vary:void 0,etag:s.etag,cacheControlDirectives:s.cacheControlDirectives,cachedAt:s.cachedAt,staleAt:s.staleAt,deleteAt:s.deleteAt}}createWriteStream(e,r){EHn(e),t5s(r);let n=`${e.origin}:${e.path}`,o=this,s={...e,...r,body:[],size:0};return new XOs({write(c,l,u){typeof c=="string"&&(c=Buffer.from(c,l)),s.size+=c.byteLength,s.size>=o.#r?this.destroy():s.body.push(c),u(null)},final(c){let l=o.#o.get(n);l||(l=[],o.#o.set(n,l));let u=_Hn(e,l,Date.now());if(u){let d=l.indexOf(u);l.splice(d,1,s),o.#n-=u.size}else l.push(s),o.#i+=1;if(o.#n+=s.size,o.#n>o.#t||o.#i>o.#e){o.#s||(o.emit("maxSizeExceeded",{size:o.#n,maxSize:o.#t,count:o.#i,maxCount:o.#e}),o.#s=!0);for(let[d,f]of o.#o){for(let h of f.splice(0,f.length/2))o.#n-=h.size,o.#i-=1;f.length===0&&o.#o.delete(d)}o.#nn.deleteAt>r&&n.method===t.method&&(n.vary==null||Object.keys(n.vary).every(o=>n.vary[o]===null?t.headers[o]===void 0:n.vary[o]===t.headers[o])))}a(_Hn,"findEntry");vHn.exports=qar});var bHn=I((cpf,CHn)=>{"use strict";p();var r5s=require("node:assert"),Har=class{static{a(this,"CacheRevalidationHandler")}#e=!1;#t;#r;#n;#i;constructor(e,r,n){if(typeof e!="function")throw new TypeError("callback must be a function");this.#t=e,this.#r=r,this.#i=n}onRequestStart(e,r){this.#e=!1,this.#n=r}onRequestUpgrade(e,r,n,o){this.#r.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){if(r5s(this.#t!=null),this.#e=r===304||this.#i&&r>=500&&r<=504,this.#t(this.#e,this.#n),this.#t=null,this.#e)return!0;this.#r.onRequestStart?.(e,this.#n),this.#r.onResponseStart?.(e,r,n,o)}onResponseData(e,r){if(!this.#e)return this.#r.onResponseData?.(e,r)}onResponseEnd(e,r){this.#e||this.#r.onResponseEnd?.(e,r)}onResponseError(e,r){if(!this.#e)if(this.#t&&(this.#t(!1),this.#t=null),typeof this.#r.onResponseError=="function")this.#r.onResponseError(e,r);else throw r}};CHn.exports=Har});var xHn=I((dpf,IHn)=>{"use strict";p();var SHn=require("node:assert"),{Readable:n5s}=require("node:stream"),jpe=Po(),v2e=yHn(),i5s=jar(),o5s=bHn(),{assertCacheStore:s5s,assertCacheMethods:a5s,makeCacheKey:c5s,normalizeHeaders:l5s,parseCacheControlHeader:u5s}=qpe(),{AbortError:d5s}=so();function f5s(t,e){if(t!==void 0){if(!Array.isArray(t))throw new TypeError(`expected ${e} to be an array or undefined, got ${typeof t}`);for(let r=0;r{},"nop");function p5s(t,e,{headers:r={}}){return!!(e?.["no-cache"]||t.cacheControlDirectives?.["no-cache"]&&!Array.isArray(t.cacheControlDirectives["no-cache"])||r["if-modified-since"]||r["if-none-match"])}a(p5s,"needsRevalidation");function h5s(t,e){let r=Date.now();if(r>t.staleAt){if(e?.["max-stale"]){let n=t.staleAt+e["max-stale"]*1e3;return r>n}return!0}if(e?.["min-fresh"]){let n=t.staleAt-r,o=e["min-fresh"]*1e3;return n<=o}return!1}a(h5s,"isStale");function m5s(t){let e=t.cacheControlDirectives?.["stale-while-revalidate"];if(!e)return!1;let r=Date.now(),n=t.staleAt+e*1e3;return r<=n}a(m5s,"withinStaleWhileRevalidateWindow");function g5s(t,e,r,n,o,s){if(s?.["only-if-cached"]){let c=!1;try{if(typeof n.onConnect=="function"&&(n.onConnect(()=>{c=!0}),c)||typeof n.onHeaders=="function"&&(n.onHeaders(504,[],$ar,"Gateway Timeout"),c))return;typeof n.onComplete=="function"&&n.onComplete([])}catch(l){typeof n.onError=="function"&&n.onError(l)}return!0}return t(o,new v2e(e,r,n))}a(g5s,"handleUncachedResponse");function Gar(t,e,r,n,o,s){let c=jpe.isStream(r.body)?r.body:n5s.from(r.body??[]);SHn(!c.destroyed,"stream should not be destroyed"),SHn(!c.readableDidRead,"stream should not be readableDidRead");let l={resume(){c.resume()},pause(){c.pause()},get paused(){return c.isPaused()},get aborted(){return c.destroyed},get reason(){return c.errored},abort(d){c.destroy(d??new d5s)}};if(c.on("error",function(d){if(!this.readableEnded)if(typeof t.onResponseError=="function")t.onResponseError(l,d);else throw d}).on("close",function(){this.errored||t.onResponseEnd?.(l,{})}),t.onRequestStart?.(l,o),c.destroyed)return;let u={...r.headers,age:String(n)};s&&(u.warning='110 - "response is stale"'),t.onResponseStart?.(l,r.statusCode,u,r.statusMessage),e.method==="HEAD"?c.destroy():c.on("data",function(d){t.onResponseData?.(l,d)})}a(Gar,"sendCachedValue");function THn(t,e,r,n,o,s,c){if(!c)return g5s(t,e,r,n,o,s);let l=Date.now();if(l>c.deleteAt)return t(o,new v2e(e,r,n));let u=Math.round((l-c.cachedAt)/1e3);if(s?.["max-age"]&&u>=s["max-age"])return t(o,n);let d=h5s(c,s),f=p5s(c,s,o);if(d||f){if(jpe.isStream(o.body)&&jpe.bodyLength(o.body)!==0)return t(o,new v2e(e,r,n));if(!f&&m5s(c))return Gar(n,o,c,u,null,!0),queueMicrotask(()=>{let A={...o.headers,"if-modified-since":new Date(c.cachedAt).toUTCString()};if(c.etag&&(A["if-none-match"]=c.etag),c.vary)for(let y in c.vary)c.vary[y]!=null&&(A[y]=c.vary[y]);t({...o,headers:A},new v2e(e,r,{onRequestStart(){},onRequestUpgrade(){},onResponseStart(){},onResponseData(){},onResponseEnd(){},onResponseError(){}}))}),!0;let h=!1,m=c.cacheControlDirectives["stale-if-error"]??s?.["stale-if-error"];m&&(h=l{A?Gar(n,o,c,u,y,d):jpe.isStream(c.body)&&c.body.on("error",$ar).destroy()},new v2e(e,r,n),h))}jpe.isStream(o.body)&&o.body.on("error",$ar).destroy(),Gar(n,o,c,u,null,!1)}a(THn,"handleResult");IHn.exports=(t={})=>{let{store:e=new i5s,methods:r=["GET"],cacheByDefault:n=void 0,type:o="shared",origins:s=void 0}=t;if(typeof t!="object"||t===null)throw new TypeError(`expected type of opts to be an Object, got ${t===null?"null":typeof t}`);if(s5s(e,"opts.store"),a5s(r,"opts.methods"),f5s(s,"opts.origins"),typeof n<"u"&&typeof n!="number")throw new TypeError(`expected opts.cacheByDefault to be number or undefined, got ${typeof n}`);if(typeof o<"u"&&o!=="shared"&&o!=="private")throw new TypeError(`expected opts.type to be shared, private, or undefined, got ${typeof o}`);let c={store:e,methods:r,cacheByDefault:n,type:o},l=jpe.safeHTTPMethods.filter(u=>r.includes(u)===!1);return u=>(d,f)=>{if(!d.origin||l.includes(d.method))return u(d,f);if(s!==void 0){let A=d.origin.toString().toLowerCase(),y=!1;for(let E=0;ETHn(u,c,m,f,d,h,A)):THn(u,c,m,f,d,h,g)}}});var DHn=I((hpf,PHn)=>{"use strict";p();var{createInflate:Var,createGunzip:wHn,createBrotliDecompress:A5s,createZstdDecompress:y5s}=require("node:zlib"),{pipeline:E5s}=require("node:stream"),_5s=Qpe(),{runtimeFeatures:v5s}=e8(),RHn={gzip:wHn,"x-gzip":wHn,br:A5s,deflate:Var,compress:Var,"x-compress":Var,...v5s.has("zstd")?{zstd:y5s}:{}},C5s=[204,304],kHn=!1,War=class extends _5s{static{a(this,"DecompressHandler")}#e=[];#t;#r;constructor(e,{skipStatusCodes:r=C5s,skipErrorResponses:n=!0}={}){super(e),this.#t=r,this.#r=n}#n(e,r){return!!(!e||r<200||this.#t.includes(r)||this.#r&&r>=400)}#i(e){let r=e.split(","),n=5;if(r.length>n)throw new Error(`too many content-encodings in response: ${r.length}, maximum allowed is ${n}`);let o=[];for(let s=r.length-1;s>=0;s--){let c=r[s].trim();if(c){if(!RHn[c])return o.length=0,o;o.push(RHn[c]())}}return o}#o(e,r){e.on("readable",()=>{let n;for(;(n=e.read())!==null&&super.onResponseData(r,n)!==!1;);}),e.on("error",n=>{super.onResponseError(r,n)})}#s(e){let r=this.#e[0];this.#o(r,e),r.on("end",()=>{super.onResponseEnd(e,{})})}#a(e){let r=this.#e[this.#e.length-1];this.#o(r,e),E5s(this.#e,n=>{if(n){super.onResponseError(e,n);return}super.onResponseEnd(e,{})})}#c(){this.#e.length=0}onResponseStart(e,r,n,o){let s=n["content-encoding"];if(this.#n(s,r))return super.onResponseStart(e,r,n,o);let c=this.#i(s.toLowerCase());if(c.length===0)return this.#c(),super.onResponseStart(e,r,n,o);this.#e=c;let{"content-encoding":l,"content-length":u,...d}=n;return this.#e.length===1?this.#s(e):this.#a(e),super.onResponseStart(e,r,d,o)}onResponseData(e,r){if(this.#e.length>0){this.#e[0].write(r);return}super.onResponseData(e,r)}onResponseEnd(e,r){if(this.#e.length>0){this.#e[0].end(),this.#c();return}super.onResponseEnd(e,r)}onResponseError(e,r){if(this.#e.length>0){for(let n of this.#e)n.destroy(r);this.#c()}super.onResponseError(e,r)}};function b5s(t={}){return kHn||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),kHn=!0),e=>(r,n)=>{let o=new War(n,t);return e(r,o)}}a(b5s,"createDecompressInterceptor");PHn.exports=b5s});var OHn=I((Apf,MHn)=>{"use strict";p();var{RequestAbortedError:S5s}=so(),NHn=5*1024*1024,zar=class{static{a(this,"DeduplicationHandler")}#e;#t=[];#r=NHn;#n=0;#i={};#o="";#s=!1;#a=!1;#c=!1;#u=!1;#l=null;#p=null;constructor(e,r,n=NHn){this.#e=e,this.#p=r,this.#r=n}addWaitingHandler(e){if(this.#u||this.#c)return!1;let r=this.#g(e),n=r.controller;try{if(e.onRequestStart?.(n,null),n.aborted)return r.done=!0,!0;this.#a&&e.onResponseStart?.(n,this.#n,this.#i,this.#o)}catch{return r.done=!0,!0}return n.aborted||this.#t.push(r),!0}onRequestStart(e,r){this.#l=e,this.#e.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.#e.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){this.#a=!0,this.#n=r,this.#i=n,this.#o=o,this.#e.onResponseStart?.(e,r,n,o);for(let s of this.#t){let{handler:c,controller:l}=s;if(s.done||l.aborted){s.done=!0;continue}try{c.onResponseStart?.(l,r,n,o)}catch{}l.aborted&&(s.done=!0)}this.#m()}onResponseData(e,r){if(!(this.#s||this.#u)){this.#c=!0,this.#e.onResponseData?.(e,r);for(let n of this.#t){let{handler:o,controller:s}=n;if(n.done||s.aborted){n.done=!0;continue}if(s.paused){this.#A(n,r);continue}try{o.onResponseData?.(s,r)}catch{}s.aborted&&(n.done=!0,n.bufferedChunks=[],n.bufferedBytes=0)}this.#m()}}onResponseEnd(e,r){if(!(this.#s||this.#u)){this.#u=!0,this.#e.onResponseEnd?.(e,r);for(let n of this.#t){if(n.done||n.controller.aborted){n.done=!0;continue}if(this.#h(n),n.done||n.controller.aborted){n.done=!0;continue}if(n.controller.paused&&n.bufferedChunks.length>0){n.pendingTrailers=r;continue}try{n.handler.onResponseEnd?.(n.controller,r)}catch{}n.done=!0}this.#m(),this.#p?.()}}onResponseError(e,r){if(!this.#u){this.#s=!0,this.#u=!0,this.#e.onResponseError?.(e,r);for(let n of this.#t)this.#v(n,r);this.#t=[],this.#p?.()}}#g(e){let r={handler:e,controller:null,bufferedChunks:[],bufferedBytes:0,pendingTrailers:null,done:!1},n={aborted:!1,paused:!1,reason:null};return r.controller={resume:a(()=>{if(!n.aborted){if(n.paused=!1,this.#h(r),this.#u&&r.pendingTrailers&&r.bufferedChunks.length===0&&!n.paused&&!n.aborted){try{r.handler.onResponseEnd?.(r.controller,r.pendingTrailers)}catch{}r.pendingTrailers=null,r.done=!0}this.#m()}},"resume"),pause:a(()=>{n.aborted||(n.paused=!0)},"pause"),get paused(){return n.paused},get aborted(){return n.aborted},get reason(){return n.reason},abort:a(o=>{n.aborted=!0,n.reason=o??null,r.done=!0,r.pendingTrailers=null,r.bufferedChunks=[],r.bufferedBytes=0},"abort")},r}#A(e,r){if(e.done||e.controller.aborted){e.done=!0,e.bufferedChunks=[],e.bufferedBytes=0;return}let n=Buffer.from(r);if(e.bufferedChunks.push(n),e.bufferedBytes+=n.length,e.bufferedBytes>this.#r){let o=new S5s(`Deduplicated waiting handler exceeded maxBufferSize (${this.#r} bytes) while paused`);this.#v(e,o)}}#h(e){let{handler:r,controller:n}=e;for(;!e.done&&!n.aborted&&!n.paused&&e.bufferedChunks.length>0;){let o=e.bufferedChunks.shift();e.bufferedBytes-=o.length;try{r.onResponseData?.(n,o)}catch{}if(n.aborted){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;break}}}#v(e,r){if(!e.done){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;try{e.controller.abort(r),e.handler.onResponseError?.(e.controller,r)}catch{}}}#m(){this.#t=this.#t.filter(e=>e.done===!1)}};MHn.exports=zar});var BHn=I((_pf,LHn)=>{"use strict";p();var T5s=require("node:diagnostics_channel"),I5s=Po(),x5s=OHn(),{normalizeHeaders:w5s,makeCacheKey:R5s,makeDeduplicationKey:k5s}=qpe(),Kst=T5s.channel("undici:request:pending-requests");LHn.exports=(t={})=>{let{methods:e=["GET"],skipHeaderNames:r=[],excludeHeaderNames:n=[],maxBufferSize:o=5*1024*1024}=t;if(typeof t!="object"||t===null)throw new TypeError(`expected type of opts to be an Object, got ${t===null?"null":typeof t}`);if(!Array.isArray(e))throw new TypeError(`expected opts.methods to be an array, got ${typeof e}`);for(let u of e)if(!I5s.safeHTTPMethods.includes(u))throw new TypeError(`expected opts.methods to only contain safe HTTP methods, got ${u}`);if(!Array.isArray(r))throw new TypeError(`expected opts.skipHeaderNames to be an array, got ${typeof r}`);if(!Array.isArray(n))throw new TypeError(`expected opts.excludeHeaderNames to be an array, got ${typeof n}`);if(!Number.isFinite(o)||o<=0)throw new TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${o}`);let s=new Set(r.map(u=>u.toLowerCase())),c=new Set(n.map(u=>u.toLowerCase())),l=new Map;return u=>(d,f)=>{if(!d.origin||e.includes(d.method)===!1)return u(d,f);if(d={...d,headers:w5s(d)},s.size>0){for(let y of Object.keys(d.headers))if(s.has(y.toLowerCase()))return u(d,f)}let h=R5s(d),m=k5s(h,c),g=l.get(m);if(g)return g.addWaitingHandler(f)?!0:u(d,f);let A=new x5s(f,()=>{l.delete(m),Kst.hasSubscribers&&Kst.publish({size:l.size,key:m,type:"removed"})},o);return l.set(m,A),Kst.hasSubscribers&&Kst.publish({size:l.size,key:m,type:"added"}),u(d,A)}}});var QHn=I((bpf,UHn)=>{"use strict";p();var{Writable:P5s}=require("node:stream"),{assertCacheKey:Yar,assertCacheValue:D5s}=qpe(),Kar,PT=3,FHn=2*1e3*1e3*1e3;UHn.exports=class{static{a(this,"SqliteCacheStore")}#e=FHn;#t=1/0;#r;#n;#i;#o;#s;#a;#c;#u;constructor(e){if(e){if(typeof e!="object")throw new TypeError("SqliteCacheStore options must be an object");if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("SqliteCacheStore options.maxEntrySize must be a non-negative integer");if(e.maxEntrySize>FHn)throw new TypeError("SqliteCacheStore options.maxEntrySize must be less than 2gb");this.#e=e.maxEntrySize}if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("SqliteCacheStore options.maxCount must be a non-negative integer");this.#t=e.maxCount}}Kar||(Kar=require("node:sqlite").DatabaseSync),this.#r=new Kar(e?.location??":memory:"),this.#r.exec(` PRAGMA journal_mode = WAL; PRAGMA synchronous = NORMAL; PRAGMA temp_store = memory; PRAGMA optimize; - CREATE TABLE IF NOT EXISTS cacheInterceptorV${ST} ( + CREATE TABLE IF NOT EXISTS cacheInterceptorV${PT} ( -- Data specific to us id INTEGER PRIMARY KEY AUTOINCREMENT, url TEXT NOT NULL, @@ -241,8 +241,8 @@ ${e.format(r)}`.trim())}};$Qn.exports=Psr});var Nsr=I((nlf,YQn)=>{"use strict";p staleAt INTEGER NOT NULL ); - CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${ST}_getValuesQuery ON cacheInterceptorV${ST}(url, method, deleteAt); - CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${ST}_deleteByUrlQuery ON cacheInterceptorV${ST}(deleteAt); + CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${PT}_getValuesQuery ON cacheInterceptorV${PT}(url, method, deleteAt); + CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${PT}_deleteByUrlQuery ON cacheInterceptorV${PT}(deleteAt); `),this.#n=this.#r.prepare(` SELECT id, @@ -256,14 +256,14 @@ ${e.format(r)}`.trim())}};$Qn.exports=Psr});var Nsr=I((nlf,YQn)=>{"use strict";p vary, cachedAt, staleAt - FROM cacheInterceptorV${ST} + FROM cacheInterceptorV${PT} WHERE url = ? AND method = ? ORDER BY deleteAt ASC `),this.#i=this.#r.prepare(` - UPDATE cacheInterceptorV${ST} SET + UPDATE cacheInterceptorV${PT} SET body = ?, deleteAt = ?, statusCode = ?, @@ -276,7 +276,7 @@ ${e.format(r)}`.trim())}};$Qn.exports=Psr});var Nsr=I((nlf,YQn)=>{"use strict";p WHERE id = ? `),this.#o=this.#r.prepare(` - INSERT INTO cacheInterceptorV${ST} ( + INSERT INTO cacheInterceptorV${PT} ( url, method, body, @@ -290,121 +290,121 @@ ${e.format(r)}`.trim())}};$Qn.exports=Psr});var Nsr=I((nlf,YQn)=>{"use strict";p cachedAt, staleAt ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) - `),this.#a=this.#r.prepare(`DELETE FROM cacheInterceptorV${ST} WHERE url = ?`),this.#c=this.#r.prepare(`SELECT COUNT(*) AS total FROM cacheInterceptorV${ST}`),this.#s=this.#r.prepare(`DELETE FROM cacheInterceptorV${ST} WHERE deleteAt <= ?`),this.#u=this.#t===1/0?null:this.#r.prepare(` - DELETE FROM cacheInterceptorV${ST} + `),this.#a=this.#r.prepare(`DELETE FROM cacheInterceptorV${PT} WHERE url = ?`),this.#c=this.#r.prepare(`SELECT COUNT(*) AS total FROM cacheInterceptorV${PT}`),this.#s=this.#r.prepare(`DELETE FROM cacheInterceptorV${PT} WHERE deleteAt <= ?`),this.#u=this.#t===1/0?null:this.#r.prepare(` + DELETE FROM cacheInterceptorV${PT} WHERE id IN ( SELECT id - FROM cacheInterceptorV${ST} + FROM cacheInterceptorV${PT} ORDER BY cachedAt ASC LIMIT ? ) - `)}close(){this.#r.close()}get(e){rar(e);let r=this.#g(e);return r?{body:r.body?Buffer.from(r.body.buffer,r.body.byteOffset,r.body.byteLength):void 0,statusCode:r.statusCode,statusMessage:r.statusMessage,headers:r.headers?JSON.parse(r.headers):void 0,etag:r.etag?r.etag:void 0,vary:r.vary?JSON.parse(r.vary):void 0,cacheControlDirectives:r.cacheControlDirectives?JSON.parse(r.cacheControlDirectives):void 0,cachedAt:r.cachedAt,staleAt:r.staleAt,deleteAt:r.deleteAt}:void 0}set(e,r){rar(e);let n=this.#p(e),o=Array.isArray(r.body)?Buffer.concat(r.body):r.body,s=o?.byteLength;if(s&&s>this.#e)return;let c=this.#g(e,!0);c?this.#i.run(o,r.deleteAt,r.statusCode,r.statusMessage,r.headers?JSON.stringify(r.headers):null,r.etag?r.etag:null,r.cacheControlDirectives?JSON.stringify(r.cacheControlDirectives):null,r.cachedAt,r.staleAt,c.id):(this.#o.run(n,e.method,o,r.deleteAt,r.statusCode,r.statusMessage,r.headers?JSON.stringify(r.headers):null,r.etag?r.etag:null,r.cacheControlDirectives?JSON.stringify(r.cacheControlDirectives):null,r.vary?JSON.stringify(r.vary):null,r.cachedAt,r.staleAt),this.#l())}createWriteStream(e,r){rar(e),SMs(r);let n=0,o=[],s=this;return new bMs({decodeStrings:!0,write(c,l,u){n+=c.byteLength,n=u.deleteAt&&!r)continue;let d=!0;if(u.vary){let f=JSON.parse(u.vary);for(let h in f)if(!TMs(o[h],f[h])){d=!1;break}}if(d)return u}}};function TMs(t,e){return t==null&&e==null?!0:t==null&&e!=null||t!=null&&e==null?!1:Array.isArray(t)&&Array.isArray(e)?t.length!==e.length?!1:t.every((r,n)=>r===e[n]):t===e}a(TMs,"headerValueEquals")});var zZ=I((puf,djn)=>{"use strict";p();var{kConstruct:IMs}=al(),{kEnumerableProperty:wpe}=Po(),{iteratorMixin:xMs,isValidHeaderName:r2e,isValidHeaderValue:sjn}=ET(),{webidl:Pa}=$A(),iar=require("node:assert"),bst=require("node:util");function ojn(t){return t===10||t===13||t===9||t===32}a(ojn,"isHTTPWhiteSpaceCharCode");function ajn(t){let e=0,r=t.length;for(;r>e&&ojn(t.charCodeAt(r-1));)--r;for(;r>e&&ojn(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(ajn,"headerValueNormalize");function cjn(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(cjn,"fill");function oar(t,e,r){if(r=ajn(r),r2e(e)){if(!sjn(r))throw Pa.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw Pa.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(ujn(t)==="immutable")throw new TypeError("immutable");return Tst(t).append(e,r,!1)}a(oar,"appendHeader");function wMs(t){let e=Tst(t);if(!e)return[];if(e.sortedMap)return e.sortedMap;let r=[],n=e.toSortedArray(),o=e.cookies;if(o===null||o.length===1)return e.sortedMap=n;for(let s=0;s>1),r[d][0]<=f[0]?u=d+1:l=d;if(s!==d){for(c=s;c>u;)r[c]=r[--c];r[u]=f}}if(!n.next().done)throw new TypeError("Unreachable");return r}else{let n=0;for(let{0:o,1:{value:s}}of this.headersMap)r[n++]=[o,s],iar(s!==null);return r.sort(ljn)}}},w2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){Pa.util.markAsUncloneable(this),e!==IMs&&(this.#t=new Sst,this.#e="none",e!==void 0&&(e=Pa.converters.HeadersInit(e,"Headers constructor","init"),cjn(this,e)))}append(e,r){Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=Pa.converters.ByteString(e,n,"name"),r=Pa.converters.ByteString(r,n,"value"),oar(this,e,r)}delete(e){if(Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,1,"Headers.delete"),e=Pa.converters.ByteString(e,"Headers.delete","name"),!r2e(e))throw Pa.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=Pa.converters.ByteString(e,r,"name"),!r2e(e))throw Pa.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=Pa.converters.ByteString(e,r,"name"),!r2e(e))throw Pa.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=Pa.converters.ByteString(e,n,"name"),r=Pa.converters.ByteString(r,n,"value"),r=ajn(r),r2e(e)){if(!sjn(r))throw Pa.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw Pa.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){Pa.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}[bst.inspect.custom](e,r){return r.depth??=e,`Headers ${bst.formatWithOptions(r,this.#t.entries)}`}static getHeadersGuard(e){return e.#e}static setHeadersGuard(e,r){e.#e=r}static getHeadersList(e){return e.#t}static setHeadersList(e,r){e.#t=r}},{getHeadersGuard:ujn,setHeadersGuard:RMs,getHeadersList:Tst,setHeadersList:kMs}=w2;Reflect.deleteProperty(w2,"getHeadersGuard");Reflect.deleteProperty(w2,"setHeadersGuard");Reflect.deleteProperty(w2,"getHeadersList");Reflect.deleteProperty(w2,"setHeadersList");xMs("Headers",w2,wMs,0,1);Object.defineProperties(w2.prototype,{append:wpe,delete:wpe,get:wpe,has:wpe,set:wpe,getSetCookie:wpe,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[bst.inspect.custom]:{enumerable:!1}});Pa.converters.HeadersInit=function(t,e,r){if(Pa.util.Type(t)===Pa.util.Types.OBJECT){let n=Reflect.get(t,Symbol.iterator);if(!bst.types.isProxy(t)&&n===w2.prototype.entries)try{return Tst(t).entriesList}catch{}return typeof n=="function"?Pa.converters["sequence>"](t,e,r,n.bind(t)):Pa.converters["record"](t,e,r)}throw Pa.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};djn.exports={fill:cjn,compareHeaderName:ljn,Headers:w2,HeadersList:Sst,getHeadersGuard:ujn,setHeadersGuard:RMs,setHeadersList:kMs,getHeadersList:Tst}});var i2e=I((guf,bjn)=>{"use strict";p();var{Headers:Ajn,HeadersList:fjn,fill:PMs,getHeadersGuard:DMs,setHeadersGuard:yjn,setHeadersList:Ejn}=zZ(),{extractBody:pjn,cloneBody:NMs,mixinBody:MMs,streamRegistry:_jn,bodyUnusable:OMs}=ape(),vjn=Po(),hjn=require("node:util"),{kEnumerableProperty:TT}=vjn,{isValidReasonPhrase:LMs,isCancelled:BMs,isAborted:FMs,isErrorLike:UMs,environmentSettingsObject:QMs}=ET(),{redirectStatusSet:qMs,nullBodyStatus:jMs}=APe(),{webidl:ra}=$A(),{URLSerializer:mjn}=Mw(),{kConstruct:xst}=al(),sar=require("node:assert"),{isomorphicEncode:HMs,serializeJavascriptValueToJSONString:GMs}=GF(),$Ms=new TextEncoder("utf-8"),IT=class t{static{a(this,"Response")}#e;#t;static error(){return n2e(wst(),"immutable")}static json(e,r=void 0){ra.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=ra.converters.ResponseInit(r));let n=$Ms.encode(GMs(e)),o=pjn(n),s=n2e(Rpe({}),"response");return gjn(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){ra.argumentLengthCheck(arguments,1,"Response.redirect"),e=ra.converters.USVString(e),r=ra.converters["unsigned short"](r);let n;try{n=new URL(e,QMs.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!qMs.has(r))throw new RangeError(`Invalid status code ${r}`);let o=n2e(Rpe({}),"immutable");o.#t.status=r;let s=HMs(mjn(n));return o.#t.headersList.append("location",s,!0),o}constructor(e=null,r=void 0){if(ra.util.markAsUncloneable(this),e===xst)return;e!==null&&(e=ra.converters.BodyInit(e,"Response","body")),r=ra.converters.ResponseInit(r),this.#t=Rpe({}),this.#e=new Ajn(xst),yjn(this.#e,"response"),Ejn(this.#e,this.#t.headersList);let n=null;if(e!=null){let[o,s]=pjn(e);n={body:o,type:s}}gjn(this,r,n)}get type(){return ra.brandCheck(this,t),this.#t.type}get url(){ra.brandCheck(this,t);let e=this.#t.urlList,r=e[e.length-1]??null;return r===null?"":mjn(r,!0)}get redirected(){return ra.brandCheck(this,t),this.#t.urlList.length>1}get status(){return ra.brandCheck(this,t),this.#t.status}get ok(){return ra.brandCheck(this,t),this.#t.status>=200&&this.#t.status<=299}get statusText(){return ra.brandCheck(this,t),this.#t.statusText}get headers(){return ra.brandCheck(this,t),this.#e}get body(){return ra.brandCheck(this,t),this.#t.body?this.#t.body.stream:null}get bodyUsed(){return ra.brandCheck(this,t),!!this.#t.body&&vjn.isDisturbed(this.#t.body.stream)}clone(){if(ra.brandCheck(this,t),OMs(this.#t))throw ra.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=aar(this.#t);return this.#t.urlList.length!==0&&this.#t.body?.stream&&_jn.register(this,new WeakRef(this.#t.body.stream)),n2e(e,DMs(this.#e))}[hjn.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${hjn.formatWithOptions(r,n)}`}static getResponseHeaders(e){return e.#e}static setResponseHeaders(e,r){e.#e=r}static getResponseState(e){return e.#t}static setResponseState(e,r){e.#t=r}},{getResponseHeaders:VMs,setResponseHeaders:WMs,getResponseState:YZ,setResponseState:zMs}=IT;Reflect.deleteProperty(IT,"getResponseHeaders");Reflect.deleteProperty(IT,"setResponseHeaders");Reflect.deleteProperty(IT,"getResponseState");Reflect.deleteProperty(IT,"setResponseState");MMs(IT,YZ);Object.defineProperties(IT.prototype,{type:TT,url:TT,status:TT,ok:TT,redirected:TT,statusText:TT,headers:TT,clone:TT,body:TT,bodyUsed:TT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(IT,{json:TT,redirect:TT,error:TT});function aar(t){if(t.internalResponse)return Cjn(aar(t.internalResponse),t.type);let e=Rpe({...t,body:null});return t.body!=null&&(e.body=NMs(t.body)),e}a(aar,"cloneResponse");function Rpe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new fjn(t?.headersList):new fjn,urlList:t?.urlList?[...t.urlList]:[]}}a(Rpe,"makeResponse");function wst(t){let e=UMs(t);return Rpe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(wst,"makeNetworkError");function YMs(t){return t.type==="error"&&t.status===0}a(YMs,"isNetworkError");function Ist(t,e){return e={internalResponse:t,...e},new Proxy(t,{get(r,n){return n in e?e[n]:r[n]},set(r,n,o){return sar(!(n in e)),r[n]=o,!0}})}a(Ist,"makeFilteredResponse");function Cjn(t,e){if(e==="basic")return Ist(t,{type:"basic",headersList:t.headersList});if(e==="cors")return Ist(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return Ist(t,{type:"opaque",urlList:[],status:0,statusText:"",body:null});if(e==="opaqueredirect")return Ist(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});sar(!1)}a(Cjn,"filterResponse");function KMs(t,e=null){return sar(BMs(t)),FMs(t)?wst(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):wst(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(KMs,"makeAppropriateNetworkError");function gjn(t,e,r){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!LMs(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(YZ(t).status=e.status),"statusText"in e&&e.statusText!=null&&(YZ(t).statusText=e.statusText),"headers"in e&&e.headers!=null&&PMs(VMs(t),e.headers),r){if(jMs.includes(t.status))throw ra.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});YZ(t).body=r.body,r.type!=null&&!YZ(t).headersList.contains("content-type",!0)&&YZ(t).headersList.append("content-type",r.type,!0)}}a(gjn,"initializeResponse");function n2e(t,e){let r=new IT(xst);zMs(r,t);let n=new Ajn(xst);return WMs(r,n),Ejn(n,t.headersList),yjn(n,e),t.urlList.length!==0&&t.body?.stream&&_jn.register(r,new WeakRef(t.body.stream)),r}a(n2e,"fromInnerResponse");ra.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?ra.converters.USVString(t,e,r):ra.is.Blob(t)||ra.is.BufferSource(t)||ra.is.FormData(t)||ra.is.URLSearchParams(t)?t:ra.converters.DOMString(t,e,r)};ra.converters.BodyInit=function(t,e,r){return ra.is.ReadableStream(t)||t?.[Symbol.asyncIterator]?t:ra.converters.XMLHttpRequestBodyInit(t,e,r)};ra.converters.ResponseInit=ra.dictionaryConverter([{key:"status",converter:ra.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:ra.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:ra.converters.HeadersInit}]);ra.is.Response=ra.util.MakeTypeAssertion(IT);bjn.exports={isNetworkError:YMs,makeNetworkError:wst,makeResponse:Rpe,makeAppropriateNetworkError:KMs,filterResponse:Cjn,Response:IT,cloneResponse:aar,fromInnerResponse:n2e,getResponseState:YZ}});var kpe=I((Euf,Bjn)=>{"use strict";p();var{extractBody:JMs,mixinBody:ZMs,cloneBody:XMs,bodyUnusable:Sjn}=ape(),{Headers:kjn,fill:eOs,HeadersList:Pst,setHeadersGuard:car,getHeadersGuard:tOs,setHeadersList:Pjn,getHeadersList:Tjn}=zZ(),kst=Po(),Ijn=require("node:util"),{isValidHTTPToken:rOs,sameOrigin:xjn,environmentSettingsObject:Rst}=ET(),{forbiddenMethodsSet:nOs,corsSafeListedMethodsSet:iOs,referrerPolicy:oOs,requestRedirect:sOs,requestMode:aOs,requestCredentials:cOs,requestCache:lOs,requestDuplex:uOs}=APe(),{kEnumerableProperty:um,normalizedMethodRecordsBase:dOs,normalizedMethodRecords:fOs}=kst,{webidl:Li}=$A(),{URLSerializer:pOs}=Mw(),{kConstruct:Dst}=al(),hOs=require("node:assert"),{getMaxListeners:Djn,setMaxListeners:mOs,defaultMaxListeners:gOs}=require("node:events"),AOs=Symbol("abortController"),Njn=new FinalizationRegistry(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Nst=new WeakMap,lar;try{lar=Djn(new AbortController().signal)>0}catch{lar=!1}function wjn(t){return e;function e(){let r=t.deref();if(r!==void 0){Njn.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Nst.get(r.signal);if(n!==void 0){if(n.size!==0){for(let o of n){let s=o.deref();s!==void 0&&s.abort(this.reason)}n.clear()}Nst.delete(r.signal)}}}}a(wjn,"buildAbort");var Rjn=!1,Ab=class t{static{a(this,"Request")}#e;#t;#r;#n;constructor(e,r=void 0){if(Li.util.markAsUncloneable(this),e===Dst)return;Li.argumentLengthCheck(arguments,1,"Request constructor"),e=Li.converters.RequestInfo(e),r=Li.converters.RequestInit(r);let o=null,s=null,c=Rst.settingsObject.baseUrl,l=null;if(typeof e=="string"){this.#t=r.dispatcher;let _;try{_=new URL(e,c)}catch(v){throw new TypeError("Failed to parse URL from "+e,{cause:v})}if(_.username||_.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);o=Mst({urlList:[_]}),s="cors"}else hOs(Li.is.Request(e)),o=e.#n,l=e.#e,this.#t=r.dispatcher||e.#t;let u=Rst.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&xjn(o.window,u)&&(d=o.window),r.window!=null)throw new TypeError(`'window' option '${d}' must be null`);"window"in r&&(d="no-window"),o=Mst({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:Rst.settingsObject,window:d,priority:o.priority,origin:o.origin,referrer:o.referrer,referrerPolicy:o.referrerPolicy,mode:o.mode,credentials:o.credentials,cache:o.cache,redirect:o.redirect,integrity:o.integrity,keepalive:o.keepalive,reloadNavigation:o.reloadNavigation,historyNavigation:o.historyNavigation,urlList:[...o.urlList]});let f=Object.keys(r).length!==0;if(f&&(o.mode==="navigate"&&(o.mode="same-origin"),o.reloadNavigation=!1,o.historyNavigation=!1,o.origin="client",o.referrer="client",o.referrerPolicy="",o.url=o.urlList[o.urlList.length-1],o.urlList=[o.url]),r.referrer!==void 0){let _=r.referrer;if(_==="")o.referrer="no-referrer";else{let v;try{v=new URL(_,c)}catch(b){throw new TypeError(`Referrer "${_}" is not a valid URL.`,{cause:b})}v.protocol==="about:"&&v.hostname==="client"||u&&!xjn(v,Rst.settingsObject.baseUrl)?o.referrer="client":o.referrer=v}}r.referrerPolicy!==void 0&&(o.referrerPolicy=r.referrerPolicy);let h;if(r.mode!==void 0?h=r.mode:h=s,h==="navigate")throw Li.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(h!=null&&(o.mode=h),r.credentials!==void 0&&(o.credentials=r.credentials),r.cache!==void 0&&(o.cache=r.cache),o.cache==="only-if-cached"&&o.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(r.redirect!==void 0&&(o.redirect=r.redirect),r.integrity!=null&&(o.integrity=String(r.integrity)),r.keepalive!==void 0&&(o.keepalive=!!r.keepalive),r.method!==void 0){let _=r.method,v=fOs[_];if(v!==void 0)o.method=v;else{if(!rOs(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(nOs.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=dOs[b]??_,o.method=_}!Rjn&&o.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),Rjn=!0)}r.signal!==void 0&&(l=r.signal),this.#n=o;let m=new AbortController;if(this.#e=m.signal,l!=null)if(l.aborted)m.abort(l.reason);else{this[AOs]=m;let _=new WeakRef(m),v=wjn(_);lar&&Djn(l)===gOs&&mOs(1500,l),kst.addAbortListener(l,v),Njn.register(m,{signal:l,abort:v},v)}if(this.#r=new kjn(Dst),Pjn(this.#r,o.headersList),car(this.#r,"request"),h==="no-cors"){if(!iOs.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);car(this.#r,"request-no-cors")}if(f){let _=Tjn(this.#r),v=r.headers!==void 0?r.headers:new Pst(_);if(_.clear(),v instanceof Pst){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else eOs(this.#r,v)}let g=Li.is.Request(e)?e.#n.body:null;if((r.body!=null||g!=null)&&(o.method==="GET"||o.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let A=null;if(r.body!=null){let[_,v]=JMs(r.body,o.keepalive);A=_,v&&!Tjn(this.#r).contains("content-type",!0)&&this.#r.append("content-type",v,!0)}let y=A??g;if(y!=null&&y.source==null){if(A!=null&&r.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(o.mode!=="same-origin"&&o.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');o.useCORSPreflightFlag=!0}let E=y;if(A==null&&g!=null){if(Sjn(e.#n))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let _=new TransformStream;g.stream.pipeThrough(_),E={source:g.source,length:g.length,stream:_.readable}}this.#n.body=E}get method(){return Li.brandCheck(this,t),this.#n.method}get url(){return Li.brandCheck(this,t),pOs(this.#n.url)}get headers(){return Li.brandCheck(this,t),this.#r}get destination(){return Li.brandCheck(this,t),this.#n.destination}get referrer(){return Li.brandCheck(this,t),this.#n.referrer==="no-referrer"?"":this.#n.referrer==="client"?"about:client":this.#n.referrer.toString()}get referrerPolicy(){return Li.brandCheck(this,t),this.#n.referrerPolicy}get mode(){return Li.brandCheck(this,t),this.#n.mode}get credentials(){return Li.brandCheck(this,t),this.#n.credentials}get cache(){return Li.brandCheck(this,t),this.#n.cache}get redirect(){return Li.brandCheck(this,t),this.#n.redirect}get integrity(){return Li.brandCheck(this,t),this.#n.integrity}get keepalive(){return Li.brandCheck(this,t),this.#n.keepalive}get isReloadNavigation(){return Li.brandCheck(this,t),this.#n.reloadNavigation}get isHistoryNavigation(){return Li.brandCheck(this,t),this.#n.historyNavigation}get signal(){return Li.brandCheck(this,t),this.#e}get body(){return Li.brandCheck(this,t),this.#n.body?this.#n.body.stream:null}get bodyUsed(){return Li.brandCheck(this,t),!!this.#n.body&&kst.isDisturbed(this.#n.body.stream)}get duplex(){return Li.brandCheck(this,t),"half"}clone(){if(Li.brandCheck(this,t),Sjn(this.#n))throw new TypeError("unusable");let e=Ojn(this.#n),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Nst.get(this.signal);n===void 0&&(n=new Set,Nst.set(this.signal,n));let o=new WeakRef(r);n.add(o),kst.addAbortListener(r.signal,wjn(o))}return Ljn(e,this.#t,r.signal,tOs(this.#r))}[Ijn.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${Ijn.formatWithOptions(r,n)}`}static setRequestSignal(e,r){return e.#e=r,e}static getRequestDispatcher(e){return e.#t}static setRequestDispatcher(e,r){e.#t=r}static setRequestHeaders(e,r){e.#r=r}static getRequestState(e){return e.#n}static setRequestState(e,r){e.#n=r}},{setRequestSignal:yOs,getRequestDispatcher:EOs,setRequestDispatcher:_Os,setRequestHeaders:vOs,getRequestState:Mjn,setRequestState:COs}=Ab;Reflect.deleteProperty(Ab,"setRequestSignal");Reflect.deleteProperty(Ab,"getRequestDispatcher");Reflect.deleteProperty(Ab,"setRequestDispatcher");Reflect.deleteProperty(Ab,"setRequestHeaders");Reflect.deleteProperty(Ab,"getRequestState");Reflect.deleteProperty(Ab,"setRequestState");ZMs(Ab,Mjn);function Mst(t){return{method:t.method??"GET",localURLsOnly:t.localURLsOnly??!1,unsafeRequest:t.unsafeRequest??!1,body:t.body??null,client:t.client??null,reservedClient:t.reservedClient??null,replacesClientId:t.replacesClientId??"",window:t.window??"client",keepalive:t.keepalive??!1,serviceWorkers:t.serviceWorkers??"all",initiator:t.initiator??"",destination:t.destination??"",priority:t.priority??null,origin:t.origin??"client",policyContainer:t.policyContainer??"client",referrer:t.referrer??"client",referrerPolicy:t.referrerPolicy??"",mode:t.mode??"no-cors",useCORSPreflightFlag:t.useCORSPreflightFlag??!1,credentials:t.credentials??"same-origin",useCredentials:t.useCredentials??!1,cache:t.cache??"default",redirect:t.redirect??"follow",integrity:t.integrity??"",cryptoGraphicsNonceMetadata:t.cryptoGraphicsNonceMetadata??"",parserMetadata:t.parserMetadata??"",reloadNavigation:t.reloadNavigation??!1,historyNavigation:t.historyNavigation??!1,userActivation:t.userActivation??!1,taintedOrigin:t.taintedOrigin??!1,redirectCount:t.redirectCount??0,responseTainting:t.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:t.preventNoCacheCacheControlHeaderModification??!1,done:t.done??!1,timingAllowFailed:t.timingAllowFailed??!1,useURLCredentials:t.useURLCredentials??void 0,traversableForUserPrompts:t.traversableForUserPrompts??"client",urlList:t.urlList,url:t.urlList[0],headersList:t.headersList?new Pst(t.headersList):new Pst}}a(Mst,"makeRequest");function Ojn(t){let e=Mst({...t,body:null});return t.body!=null&&(e.body=XMs(t.body)),e}a(Ojn,"cloneRequest");function Ljn(t,e,r,n){let o=new Ab(Dst);COs(o,t),_Os(o,e),yOs(o,r);let s=new kjn(Dst);return vOs(o,s),Pjn(s,t.headersList),car(s,n),o}a(Ljn,"fromInnerRequest");Object.defineProperties(Ab.prototype,{method:um,url:um,headers:um,redirect:um,clone:um,signal:um,duplex:um,destination:um,body:um,bodyUsed:um,isHistoryNavigation:um,isReloadNavigation:um,keepalive:um,integrity:um,cache:um,credentials:um,attribute:um,referrerPolicy:um,referrer:um,mode:um,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Li.is.Request=Li.util.MakeTypeAssertion(Ab);Li.converters.RequestInfo=function(t){return typeof t=="string"?Li.converters.USVString(t):Li.is.Request(t)?t:Li.converters.USVString(t)};Li.converters.RequestInit=Li.dictionaryConverter([{key:"method",converter:Li.converters.ByteString},{key:"headers",converter:Li.converters.HeadersInit},{key:"body",converter:Li.nullableConverter(Li.converters.BodyInit)},{key:"referrer",converter:Li.converters.USVString},{key:"referrerPolicy",converter:Li.converters.DOMString,allowedValues:oOs},{key:"mode",converter:Li.converters.DOMString,allowedValues:aOs},{key:"credentials",converter:Li.converters.DOMString,allowedValues:cOs},{key:"cache",converter:Li.converters.DOMString,allowedValues:lOs},{key:"redirect",converter:Li.converters.DOMString,allowedValues:sOs},{key:"integrity",converter:Li.converters.DOMString},{key:"keepalive",converter:Li.converters.boolean},{key:"signal",converter:Li.nullableConverter(t=>Li.converters.AbortSignal(t,"RequestInit","signal"))},{key:"window",converter:Li.converters.any},{key:"duplex",converter:Li.converters.DOMString,allowedValues:uOs},{key:"dispatcher",converter:Li.converters.any},{key:"priority",converter:Li.converters.DOMString,allowedValues:["high","low","auto"],defaultValue:a(()=>"auto","defaultValue")}]);Bjn.exports={Request:Ab,makeRequest:Mst,fromInnerRequest:Ljn,cloneRequest:Ojn,getRequestDispatcher:EOs,getRequestState:Mjn}});var $jn=I((Cuf,Gjn)=>{"use strict";p();var bOs=require("node:assert"),{runtimeFeatures:Ujn}=$F(),KZ=new Map([["sha256",0],["sha384",1],["sha512",2]]),uar;if(Ujn.has("crypto")){uar=require("node:crypto");let t=uar.getHashes();t.length===0&&KZ.clear();for(let e of KZ.keys())t.includes(e)===!1&&KZ.delete(e)}else KZ.clear();var Fjn=Map.prototype.get.bind(KZ),dar=Map.prototype.has.bind(KZ),SOs=Ujn.has("crypto")===!1||KZ.size===0?()=>!0:(t,e)=>{let r=qjn(e);if(r.length===0)return!0;let n=Qjn(r);for(let o of n){let s=o.alg,c=o.val,l=jjn(s,t);if(Hjn(l,c))return!0}return!1};function Qjn(t){let e=[],r=null;for(let n of t){if(bOs(dar(n.alg),"Invalid SRI hash algorithm token"),e.length===0){e.push(n),r=n;continue}let o=r.alg,s=Fjn(o),c=n.alg,l=Fjn(c);ls?(r=n,e[0]=n,e.length=1):e.push(n))}return e}a(Qjn,"getStrongestMetadata");function qjn(t){let e=[];for(let r of t.split(" ")){let o=r.split("?",1)[0],s="",c=[o.slice(0,6),o.slice(7)],l=c[0];if(!dar(l))continue;c[1]&&(s=c[1]);let u={alg:l,val:s};e.push(u)}return e}a(qjn,"parseMetadata");var jjn=a((t,e)=>uar.hash(t,e,"base64"),"applyAlgorithmToBytes");function Hjn(t,e){let r=t.length;r!==0&&t[r-1]==="="&&(r-=1),r!==0&&t[r-1]==="="&&(r-=1);let n=e.length;if(n!==0&&e[n-1]==="="&&(n-=1),n!==0&&e[n-1]==="="&&(n-=1),r!==n)return!1;for(let o=0;o{"use strict";p();var{makeNetworkError:ll,makeAppropriateNetworkError:o2e,filterResponse:far,makeResponse:Ost,fromInnerResponse:TOs,getResponseState:IOs}=i2e(),{HeadersList:par}=zZ(),{Request:xOs,cloneRequest:wOs,getRequestDispatcher:ROs,getRequestState:kOs}=kpe(),R2=require("node:zlib"),{makePolicyContainer:POs,clonePolicyContainer:DOs,requestBadPort:NOs,TAOCheck:MOs,appendRequestOriginHeader:OOs,responseLocationURL:LOs,requestCurrentURL:xT,setRequestReferrerPolicyOnRedirect:BOs,tryUpgradeRequestToAPotentiallyTrustworthyURL:FOs,createOpaqueTimingInfo:Ear,appendFetchMetadata:UOs,corsCheck:QOs,crossOriginResourcePolicyCheck:qOs,determineRequestsReferrer:jOs,coarsenedSharedCurrentTime:s2e,sameOrigin:Aar,isCancelled:rH,isAborted:Vjn,isErrorLike:HOs,fullyReadBody:GOs,readableStreamClose:$Os,urlIsLocal:VOs,urlIsHttpHttpsScheme:Ust,urlHasHttpsScheme:WOs,clampAndCoarsenConnectionTimingInfo:zOs,simpleRangeHeaderValue:YOs,buildContentRange:KOs,createInflate:JOs,extractMimeType:ZOs,hasAuthenticationEntry:XOs,includesCredentials:Wjn,isTraversableNavigable:e5s}=ET(),JZ=require("node:assert"),{safelyExtractBody:Qst,extractBody:zjn}=ape(),{redirectStatusSet:Zjn,nullBodyStatus:Xjn,safeMethodsSet:t5s,requestBodyHeader:r5s,subresourceSet:n5s}=APe(),i5s=require("node:events"),{Readable:o5s,pipeline:s5s,finished:a5s,isErrored:c5s,isReadable:Lst}=require("node:stream"),{addAbortListener:l5s,bufferToLowerCasedHeaderName:Yjn}=Po(),{dataURLProcessor:u5s,serializeAMimeType:d5s,minimizeSupportedMimeType:f5s}=Mw(),{getGlobalDispatcher:p5s}=_st(),{webidl:_ar}=$A(),{STATUS_CODES:Kjn}=require("node:http"),{bytesMatch:h5s}=$jn(),{createDeferredPromise:m5s}=CPe(),{isomorphicEncode:Bst}=GF(),{runtimeFeatures:g5s}=$F(),A5s=g5s.has("zstd"),y5s=["GET","HEAD"],E5s=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",har,Fst=class extends i5s{static{a(this,"Fetch")}constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function _5s(t){eHn(t,"fetch")}a(_5s,"handleFetchDone");function v5s(t,e=void 0){_ar.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=m5s(),n;try{n=new xOs(t,e)}catch(f){return r.reject(f),r.promise}let o=kOs(n);if(n.signal.aborted)return mar(r,o,null,n.signal.reason,null),r.promise;o.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(o.serviceWorkers="none");let c=null,l=!1,u=null;return l5s(n.signal,()=>{l=!0,JZ(u!=null),u.abort(n.signal.reason);let f=c?.deref();mar(r,o,f,n.signal.reason,u.controller)}),u=rHn({request:o,processResponseEndOfBody:_5s,processResponse:a(f=>{if(!l){if(f.aborted){mar(r,o,c,u.serializedAbortReason,u.controller);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(TOs(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:ROs(n),requestObject:n}),r.promise}a(v5s,"fetch");function eHn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;Ust(r)&&n!==null&&(t.timingAllowPassed||(n=Ear({startTime:n.startTime}),o=""),n.endTime=s2e(),t.timingInfo=n,tHn(n,r.href,e,globalThis,o,"",t.status))}a(eHn,"finalizeAndReportTiming");var tHn=performance.markResourceTiming;function mar(t,e,r,n,o){if(t&&t.reject(n),e.body?.stream!=null&&Lst(e.body.stream)&&e.body.stream.cancel(n).catch(c=>{if(c.code!=="ERR_INVALID_STATE")throw c}),r==null)return;let s=IOs(r);s.body?.stream!=null&&Lst(s.body.stream)&&o.error(n)}a(mar,"abortFetch");function rHn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=p5s(),requestObject:u=null}){JZ(l);let d=null,f=!1;t.client!=null&&(d=t.client.globalObject,f=t.client.crossOriginIsolatedCapability);let h=s2e(f),m=Ear({startTime:h}),g={controller:new Fst(l),request:t,timingInfo:m,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:d,crossOriginIsolatedCapability:f,requestObject:u};return JZ(!t.body||t.body.stream),t.window==="client"&&(t.window=t.client?.globalObject?.constructor?.name==="Window"?t.client:"no-window"),t.origin==="client"&&(t.origin=t.client.origin),t.policyContainer==="client"&&(t.client!=null?t.policyContainer=DOs(t.client.policyContainer):t.policyContainer=POs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,n5s.has(t.destination),nHn(g,!1),g.controller}a(rHn,"fetching");async function nHn(t,e){try{let r=t.request,n=null;if(r.localURLsOnly&&!VOs(xT(r))&&(n=ll("local URLs only")),FOs(r),NOs(r)==="blocked"&&(n=ll("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=jOs(r)),n===null){let s=xT(r);Aar(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",n=await Jjn(t)):r.mode==="same-origin"?n=ll('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?n=ll('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",n=await Jjn(t)):Ust(xT(r))?(r.responseTainting="cors",n=await iHn(t)):n=ll("URL scheme must be a HTTP(S) scheme")}if(e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=far(n,"basic"):r.responseTainting==="cors"?n=far(n,"cors"):r.responseTainting==="opaque"?n=far(n,"opaque"):JZ(!1));let o=n.status===0?n:n.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(n.timingAllowPassed=!0),n.type==="opaque"&&o.status===206&&o.rangeRequested&&!r.headers.contains("range",!0)&&(n=o=ll()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||Xjn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>gar(t,ll(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!h5s(l,r.integrity)){s("integrity mismatch");return}n.body=Qst(l)[0],gar(t,n)},"processBody");GOs(n.body,c,s)}else gar(t,n)}catch(r){t.controller.terminate(r)}}a(nHn,"mainFetch");function Jjn(t){if(rH(t)&&t.request.redirectCount===0)return Promise.resolve(o2e(t));let{request:e}=t,{protocol:r}=xT(e);switch(r){case"about:":return Promise.resolve(ll("about scheme is not supported"));case"blob:":{har||(har=require("node:buffer").resolveObjectURL);let n=xT(e);if(n.search.length!==0)return Promise.resolve(ll("NetworkError when attempting to fetch resource."));let o=har(n.toString());if(e.method!=="GET"||!_ar.is.Blob(o))return Promise.resolve(ll("invalid method"));let s=Ost(),c=o.size,l=Bst(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=YOs(d,!0);if(f==="failure")return Promise.resolve(ll("failed to fetch the data URL"));let{rangeStartValue:h,rangeEndValue:m}=f;if(h===null)h=c-m,m=h+m-1;else{if(h>=c)return Promise.resolve(ll("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m+1,u),A=zjn(g);s.body=A[0];let y=Bst(`${g.size}`),E=KOs(h,m,c);s.status=206,s.statusText="Partial Content",s.headersList.set("content-length",y,!0),s.headersList.set("content-type",u,!0),s.headersList.set("content-range",E,!0)}else{let d=zjn(o);s.statusText="OK",s.body=d[0],s.headersList.set("content-length",l,!0),s.headersList.set("content-type",u,!0)}return Promise.resolve(s)}case"data:":{let n=xT(e),o=u5s(n);if(o==="failure")return Promise.resolve(ll("failed to fetch the data URL"));let s=d5s(o.mimeType);return Promise.resolve(Ost({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:Qst(o.body)[0]}))}case"file:":return Promise.resolve(ll("not implemented... yet..."));case"http:":case"https:":return iHn(t).catch(n=>ll(n));default:return Promise.resolve(ll("unknown scheme"))}}a(Jjn,"schemeFetch");function C5s(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(C5s,"finalizeResponse");function gar(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(!Ust(t.request.url))return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=Ear(r),l="");let d=0;if(t.request.mode!=="navigate"||!e.hasCrossOriginRedirects){d=e.status;let f=ZOs(e.headersList);f!=="failure"&&(u.contentType=f5s(f))}t.request.initiatorType!=null&&tHn(r,t.request.url.href,t.request.initiatorType,globalThis,l,u,d)};let c=a(()=>{t.request.done=!0,t.processResponseEndOfBody!=null&&queueMicrotask(()=>t.processResponseEndOfBody(e)),t.request.initiatorType!=null&&t.controller.reportTimingSteps()},"processResponseEndOfBodyTask");queueMicrotask(()=>c())},"processResponseEndOfBody");t.processResponse!=null&&queueMicrotask(()=>{t.processResponse(e),t.processResponse=null});let o=e.type==="error"?e:e.internalResponse??e;o.body==null?n():a5s(o.body.stream,()=>{n()})}a(gar,"fetchFinale");async function iHn(t){let e=t.request,r=null,n=null,o=t.timingInfo;if(e.serviceWorkers,r===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),n=r=await yar(t),e.responseTainting==="cors"&&QOs(e,r)==="failure")return ll("cors failure");MOs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&qOs(e.origin,e.client,e.destination,n)==="blocked"?ll("blocked"):(Zjn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=ll("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await b5s(t,r):JZ(!1)),r.timingInfo=o,r)}a(iHn,"httpFetch");function b5s(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=LOs(n,xT(r).hash),o==null)return e}catch(c){return Promise.resolve(ll(c))}if(!Ust(o))return Promise.resolve(ll("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(ll("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!Aar(r,o))return Promise.resolve(ll('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(ll('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(ll());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!y5s.includes(r.method)){r.method="GET",r.body=null;for(let c of r5s)r.headersList.delete(c)}Aar(xT(r),o)||(r.headersList.delete("authorization",!0),r.headersList.delete("proxy-authorization",!0),r.headersList.delete("cookie",!0),r.headersList.delete("host",!0)),r.body!=null&&(JZ(r.body.source!=null),r.body=Qst(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=s2e(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),BOs(r,n),nHn(t,!0)}a(b5s,"httpRedirectFetch");async function yar(t,e=!1,r=!1){let n=t.request,o=null,s=null,c=null,l=null,u=!1;n.window==="no-window"&&n.redirect==="error"?(o=t,s=n):(s=wOs(n),o={...t},o.request=s);let d=n.credentials==="include"||n.credentials==="same-origin"&&n.responseTainting==="basic",f=s.body?s.body.length:null,h=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(h="0"),f!=null&&(h=Bst(`${f}`)),h!=null&&!s.headersList.contains("content-length",!0)&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,_ar.is.URL(s.referrer)&&s.headersList.append("referer",Bst(s.referrer.href),!0),OOs(s),UOs(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",E5s,!0),s.cache==="default"&&(s.headersList.contains("if-modified-since",!0)||s.headersList.contains("if-none-match",!0)||s.headersList.contains("if-unmodified-since",!0)||s.headersList.contains("if-match",!0)||s.headersList.contains("if-range",!0))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control",!0)&&s.headersList.append("cache-control","max-age=0",!0),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma",!0)||s.headersList.append("pragma","no-cache",!0),s.headersList.contains("cache-control",!0)||s.headersList.append("cache-control","no-cache",!0)),s.headersList.contains("range",!0)&&s.headersList.append("accept-encoding","identity",!0),s.headersList.contains("accept-encoding",!0)||(WOs(xT(s))?s.headersList.append("accept-encoding","br, gzip, deflate",!0):s.headersList.append("accept-encoding","gzip, deflate",!0)),s.headersList.delete("host",!0),d&&!s.headersList.contains("authorization",!0)){let m=null;if(!(XOs(s)&&(s.useURLCredentials===void 0||!Wjn(xT(s))))){if(Wjn(xT(s))&&e){let{username:g,password:A}=xT(s);m=`Basic ${Buffer.from(`${g}:${A}`).toString("base64")}`}}m!==null&&s.headersList.append("Authorization",m,!1)}if(l==null&&(s.cache="no-store"),s.cache!=="no-store"&&s.cache,c==null){if(s.cache==="only-if-cached")return ll("only if cached");let m=await S5s(o,d,r);!t5s.has(s.method)&&m.status>=200&&m.status<=399,u&&m.status,c==null&&(c=m)}if(c.urlList=[...s.urlList],s.headersList.contains("range",!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=d,c.status===401&&s.responseTainting!=="cors"&&d&&(n.useURLCredentials!==void 0||e5s(n.traversableForUserPrompts))){if(n.body!=null){if(n.body.source==null)return c;n.body=Qst(n.body.source)[0]}if(n.useURLCredentials===void 0||e)return rH(t)?o2e(t):c;t.controller.connection.destroy(),c=await yar(t,!0)}if(c.status===407)return n.window==="no-window"?ll():rH(t)?o2e(t):ll("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(rH(t))return o2e(t);t.controller.connection.destroy(),c=await yar(t,e,!0)}return c}a(yar,"httpNetworkOrCacheFetch");async function S5s(t,e=!1,r=!1){JZ(!t.controller.connection||t.controller.connection.destroyed),t.controller.connection={abort:null,destroyed:!1,destroy(A,y=!0){this.destroyed||(this.destroyed=!0,y&&this.abort?.(A??new DOMException("The operation was aborted.","AbortError")))}};let n=t.request,o=null,s=t.timingInfo;null==null&&(n.cache="no-store");let l=r?"yes":"no";n.mode;let u=null;if(n.body==null&&t.processRequestEndOfBody)queueMicrotask(()=>t.processRequestEndOfBody());else if(n.body!=null){let A=a(async function*(_){rH(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{rH(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{rH(t)||(_.name==="AbortError"?t.controller.abort():t.controller.terminate(_))},"processBodyError");u=(async function*(){try{for await(let _ of n.body.stream)yield*A(_);y()}catch(_){E(_)}})()}try{let{body:A,status:y,statusText:E,headersList:_,socket:v}=await g({body:u});if(v)o=Ost({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=Ost({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),o2e(t,A)):ll(A)}let d=a(()=>t.controller.resume(),"pullAlgorithm"),f=a(A=>{rH(t)||t.controller.abort(A)},"cancelAlgorithm"),h=new ReadableStream({start(A){t.controller.controller=A},pull:d,cancel:f,type:"bytes"});o.body={stream:h,source:null,length:null},t.controller.resume||t.controller.on("terminated",m),t.controller.resume=async()=>{for(;;){let A,y;try{let{done:_,value:v}=await t.controller.next();if(Vjn(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){$Os(t.controller.controller),C5s(t,o);return}if(s.decodedBodySize+=A?.byteLength??0,y){t.controller.terminate(A);return}let E=new Uint8Array(A);if(E.byteLength&&t.controller.controller.enqueue(E),c5s(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){Vjn(t)?(o.aborted=!0,Lst(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):Lst(h)&&t.controller.controller.error(new TypeError("terminated",{cause:HOs(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=xT(n),E=t.controller.dispatcher,_=y.pathname+y.search,v=y.search.length===0&&y.href[y.href.length-y.hash.length-1]==="?";return new Promise((b,T)=>E.dispatch({path:v?`${_}?`:_,origin:y.origin,method:n.method,body:E.isMockActive?n.body&&(n.body.source||n.body.stream):A,headers:n.headersList.entries,maxRedirections:0,upgrade:n.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(w){let{connection:R}=t.controller;s.finalConnectionTimingInfo=zOs(void 0,s.postRedirectStartTime,t.crossOriginIsolatedCapability),R.destroyed?w(new DOMException("The operation was aborted.","AbortError")):(t.controller.on("terminated",w),this.abort=R.abort=w),s.finalNetworkRequestStartTime=s2e(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=s2e(t.crossOriginIsolatedCapability)},onHeaders(w,R,x,P){if(w<200)return!1;let D=new par;for(let M=0;Mj)return T(new Error(`too many content-encodings in response: ${O.length}, maximum allowed is ${j}`)),!0;for(let Q=O.length-1;Q>=0;--Q){let U=O[Q].trim();if(U==="x-gzip"||U==="gzip")B.push(R2.createGunzip({flush:R2.constants.Z_SYNC_FLUSH,finishFlush:R2.constants.Z_SYNC_FLUSH}));else if(U==="deflate")B.push(JOs({flush:R2.constants.Z_SYNC_FLUSH,finishFlush:R2.constants.Z_SYNC_FLUSH}));else if(U==="br")B.push(R2.createBrotliDecompress({flush:R2.constants.BROTLI_OPERATION_FLUSH,finishFlush:R2.constants.BROTLI_OPERATION_FLUSH}));else if(U==="zstd"&&A5s)B.push(R2.createZstdDecompress({flush:R2.constants.ZSTD_e_continue,finishFlush:R2.constants.ZSTD_e_end}));else{B.length=0;break}}}let q=this.onError.bind(this);return b({status:w,statusText:P,headersList:D,body:B.length?s5s(this.body,...B,M=>{M&&this.onError(M)}).on("error",q):this.body.on("error",q)}),!0},onData(w){if(t.controller.dump)return;let R=w;return s.encodedBodySize+=R.byteLength,this.body.push(R)},onComplete(){this.abort&&t.controller.off("terminated",this.abort),t.controller.ended=!0,this.body.push(null)},onError(w){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(w),t.controller.terminate(w),T(w)},onRequestUpgrade(w,R,x,P){if(P.session!=null&&R!==200||P.session==null&&R!==101)return!1;let D=new par;for(let[N,L]of Object.entries(x)){if(L==null)continue;let B=N.toLowerCase();if(Array.isArray(L))for(let q of L)D.append(B,String(q),!0);else D.append(B,String(L),!0)}return b({status:R,statusText:Kjn[R],headersList:D,socket:P}),!0},onUpgrade(w,R,x){if(x.session!=null&&w!==200||x.session==null&&w!==101)return!1;let P=new par;for(let D=0;D{"use strict";p();var T5s=require("node:assert"),{URLSerializer:sHn}=Mw(),{isValidHeaderName:I5s}=ET();function x5s(t,e,r=!1){let n=sHn(t,r),o=sHn(e,r);return n===o}a(x5s,"urlEquals");function w5s(t){T5s(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),I5s(r)&&e.push(r);return e}a(w5s,"getFieldValues");aHn.exports={urlEquals:x5s,getFieldValues:w5s}});var fHn=I((Puf,dHn)=>{"use strict";p();var Car=require("node:assert"),{kConstruct:R5s}=al(),{urlEquals:k5s,getFieldValues:bar}=cHn(),{kEnumerableProperty:ZZ,isDisturbed:P5s}=Po(),{webidl:Xn}=$A(),{cloneResponse:lHn,fromInnerResponse:D5s,getResponseState:N5s}=i2e(),{Request:c2e,fromInnerRequest:M5s,getRequestState:Q5}=kpe(),{fetching:O5s}=a2e(),{urlIsHttpHttpsScheme:qst,readAllBytes:L5s}=ET(),{createDeferredPromise:Ppe}=CPe(),jst=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==R5s&&Xn.illegalConstructor(),Xn.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){Xn.brandCheck(this,t);let n="Cache.match";Xn.argumentLengthCheck(arguments,1,n),e=Xn.converters.RequestInfo(e),r=Xn.converters.CacheQueryOptions(r,n,"options");let o=this.#i(e,r,1);if(o.length!==0)return o[0]}async matchAll(e=void 0,r={}){Xn.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=Xn.converters.RequestInfo(e)),r=Xn.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){Xn.brandCheck(this,t),Xn.argumentLengthCheck(arguments,1,"Cache.add"),e=Xn.converters.RequestInfo(e);let n=[e];return await this.addAll(n)}async addAll(e){Xn.brandCheck(this,t);let r="Cache.addAll";Xn.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw Xn.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=Xn.converters.RequestInfo(m),typeof m=="string")continue;let g=Q5(m);if(!qst(g.url)||g.method!=="GET")throw Xn.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=Q5(new c2e(m));if(!qst(g.url))throw Xn.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Ppe();s.push(O5s({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(Xn.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=bar(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(Xn.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let v of s)v.abort();return}}},processResponseEndOfBody(y){if(y.aborted){A.reject(new DOMException("aborted","AbortError"));return}A.resolve(y)}})),n.push(A.promise)}let l=await Promise.all(n),u=[],d=0;for(let m of l){let g={type:"put",request:o[d],response:m};u.push(g),d++}let f=Ppe(),h=null;try{this.#t(u)}catch(m){h=m}return queueMicrotask(()=>{h===null?f.resolve(void 0):f.reject(h)}),f.promise}async put(e,r){Xn.brandCheck(this,t);let n="Cache.put";Xn.argumentLengthCheck(arguments,2,n),e=Xn.converters.RequestInfo(e),r=Xn.converters.Response(r,n,"response");let o=null;if(Xn.is.Request(e)?o=Q5(e):o=Q5(new c2e(e)),!qst(o.url)||o.method!=="GET")throw Xn.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=N5s(r);if(s.status===206)throw Xn.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=bar(s.headersList.get("vary"));for(let A of g)if(A==="*")throw Xn.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(P5s(s.body.stream)||s.body.stream.locked))throw Xn.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=lHn(s),l=Ppe();if(s.body!=null){let A=s.body.stream.getReader();L5s(A,l.resolve,l.reject)}else l.resolve(void 0);let u=[],d={type:"put",request:o,response:c};u.push(d);let f=await l.promise;c.body!=null&&(c.body.source=f);let h=Ppe(),m=null;try{this.#t(u)}catch(g){m=g}return queueMicrotask(()=>{m===null?h.resolve():h.reject(m)}),h.promise}async delete(e,r={}){Xn.brandCheck(this,t);let n="Cache.delete";Xn.argumentLengthCheck(arguments,1,n),e=Xn.converters.RequestInfo(e),r=Xn.converters.CacheQueryOptions(r,n,"options");let o=null;if(Xn.is.Request(e)){if(o=Q5(e),o.method!=="GET"&&!r.ignoreMethod)return!1}else Car(typeof e=="string"),o=Q5(new c2e(e));let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Ppe(),u=null,d;try{d=this.#t(s)}catch(f){u=f}return queueMicrotask(()=>{u===null?l.resolve(!!d?.length):l.reject(u)}),l.promise}async keys(e=void 0,r={}){Xn.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=Xn.converters.RequestInfo(e)),r=Xn.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(Xn.is.Request(e)){if(o=Q5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=Q5(new c2e(e)));let s=Ppe(),c=[];if(e===void 0)for(let l of this.#e)c.push(l[0]);else{let l=this.#r(o,r);for(let u of l)c.push(u[0])}return queueMicrotask(()=>{let l=[];for(let u of c){let d=M5s(u,void 0,new AbortController().signal,"immutable");l.push(d)}s.resolve(Object.freeze(l))}),s.promise}#t(e){let r=this.#e,n=[...r],o=[],s=[];try{for(let c of e){if(c.type!=="delete"&&c.type!=="put")throw Xn.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw Xn.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#r(c.request,c.options,o).length)throw new DOMException("???","InvalidStateError");let l;if(c.type==="delete"){if(l=this.#r(c.request,c.options),l.length===0)return[];for(let u of l){let d=r.indexOf(u);Car(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw Xn.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!qst(u.url))throw Xn.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw Xn.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw Xn.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});l=this.#r(c.request);for(let d of l){let f=r.indexOf(d);Car(f!==-1),r.splice(f,1)}r.push([c.request,c.response]),o.push([c.request,c.response])}s.push([c.request,c.response])}return s}catch(c){throw this.#e.length=0,this.#e=n,c}}#r(e,r,n){let o=[],s=n??this.#e;for(let c of s){let[l,u]=c;this.#n(e,l,u,r)&&o.push(c)}return o}#n(e,r,n=null,o){let s=new URL(e.url),c=new URL(r.url);if(o?.ignoreSearch&&(c.search="",s.search=""),!k5s(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=bar(n.headersList.get("vary"));for(let u of l){if(u==="*")return!1;let d=r.headersList.get(u),f=e.headersList.get(u);if(d!==f)return!1}return!0}#i(e,r,n=1/0){let o=null;if(e!==void 0)if(Xn.is.Request(e)){if(o=Q5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=Q5(new c2e(e)));let s=[];if(e===void 0)for(let l of this.#e)s.push(l[1]);else{let l=this.#r(o,r);for(let u of l)s.push(u[1])}let c=[];for(let l of s){let u=D5s(lHn(l),"immutable");if(c.push(u),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(jst.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:ZZ,matchAll:ZZ,add:ZZ,addAll:ZZ,put:ZZ,delete:ZZ,keys:ZZ});var uHn=[{key:"ignoreSearch",converter:Xn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:Xn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:Xn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];Xn.converters.CacheQueryOptions=Xn.dictionaryConverter(uHn);Xn.converters.MultiCacheQueryOptions=Xn.dictionaryConverter([...uHn,{key:"cacheName",converter:Xn.converters.DOMString}]);Xn.converters.Response=Xn.interfaceConverter(Xn.is.Response,"Response");Xn.converters["sequence"]=Xn.sequenceConverter(Xn.converters.RequestInfo);dHn.exports={Cache:jst}});var hHn=I((Muf,pHn)=>{"use strict";p();var{Cache:Hst}=fHn(),{webidl:CE}=$A(),{kEnumerableProperty:l2e}=Po(),{kConstruct:u2e}=al(),Gst=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==u2e&&CE.illegalConstructor(),CE.util.markAsUncloneable(this)}async match(e,r={}){if(CE.brandCheck(this,t),CE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=CE.converters.RequestInfo(e),r=CE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new Hst(u2e,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new Hst(u2e,n).match(e,r);if(s!==void 0)return s}}async has(e){CE.brandCheck(this,t);let r="CacheStorage.has";return CE.argumentLengthCheck(arguments,1,r),e=CE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){CE.brandCheck(this,t);let r="CacheStorage.open";if(CE.argumentLengthCheck(arguments,1,r),e=CE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new Hst(u2e,o)}let n=[];return this.#e.set(e,n),new Hst(u2e,n)}async delete(e){CE.brandCheck(this,t);let r="CacheStorage.delete";return CE.argumentLengthCheck(arguments,1,r),e=CE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return CE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(Gst.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:l2e,has:l2e,open:l2e,delete:l2e,keys:l2e});pHn.exports={CacheStorage:Gst}});var gHn=I((Buf,mHn)=>{"use strict";p();mHn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var Sar=I((Uuf,vHn)=>{"use strict";p();function B5s(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(B5s,"isCTLExcludingHtab");function AHn(t){for(let e=0;e126||r===34||r===40||r===41||r===60||r===62||r===64||r===44||r===59||r===58||r===92||r===47||r===91||r===93||r===63||r===61||r===123||r===125)throw new Error("Invalid cookie name")}}a(AHn,"validateCookieName");function yHn(t){let e=t.length,r=0;if(t[0]==='"'){if(e===1||t[e-1]!=='"')throw new Error("Invalid cookie value");--e,++r}for(;r126||n===34||n===44||n===59||n===92)throw new Error("Invalid cookie value")}}a(yHn,"validateCookieValue");function EHn(t){for(let e=0;ee.toString().padStart(2,"0"));function _Hn(t){return typeof t=="number"&&(t=new Date(t)),`${U5s[t.getUTCDay()]}, ${$st[t.getUTCDate()]} ${Q5s[t.getUTCMonth()]} ${t.getUTCFullYear()} ${$st[t.getUTCHours()]}:${$st[t.getUTCMinutes()]}:${$st[t.getUTCSeconds()]} GMT`}a(_Hn,"toIMFDate");function q5s(t){if(t<0)throw new Error("Invalid cookie max-age")}a(q5s,"validateCookieMaxAge");function j5s(t){if(t.name.length===0)return null;AHn(t.name),yHn(t.value);let e=[`${t.name}=${t.value}`];t.name.startsWith("__Secure-")&&(t.secure=!0),t.name.startsWith("__Host-")&&(t.secure=!0,t.domain=null,t.path="/"),t.secure&&e.push("Secure"),t.httpOnly&&e.push("HttpOnly"),typeof t.maxAge=="number"&&(q5s(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(F5s(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(EHn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${_Hn(t.expires)}`),t.sameSite&&e.push(`SameSite=${t.sameSite}`);for(let r of t.unparsed){if(!r.includes("="))throw new Error("Invalid unparsed");let[n,...o]=r.split("=");e.push(`${n.trim()}=${o.join("=")}`)}return e.join("; ")}a(j5s,"stringify");vHn.exports={isCTLExcludingHtab:B5s,validateCookieName:AHn,validateCookiePath:EHn,validateCookieValue:yHn,toIMFDate:_Hn,stringify:j5s}});var bHn=I((juf,CHn)=>{"use strict";p();var{collectASequenceOfCodePointsFast:Vst}=GF(),{maxNameValuePairSize:H5s,maxAttributeValueSize:G5s}=gHn(),{isCTLExcludingHtab:$5s}=Sar(),V5s=require("node:assert");function W5s(t){if($5s(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=Vst(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=Vst("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>H5s?null:{name:n,value:o,...Dpe(r)}}a(W5s,"parseSetCookie");function Dpe(t,e={}){if(t.length===0)return e;V5s(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=Vst(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=Vst("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>G5s)return Dpe(t,e);let s=n.toLowerCase();if(s==="expires"){let c=new Date(o);e.expires=c}else if(s==="max-age"){let c=o.charCodeAt(0);if((c<48||c>57)&&o[0]!=="-"||!/^\d+$/.test(o))return Dpe(t,e);let l=Number(o);e.maxAge=l}else if(s==="domain"){let c=o;c[0]==="."&&(c=c.slice(1)),c=c.toLowerCase(),e.domain=c}else if(s==="path"){let c="";o.length===0||o[0]!=="/"?c="/":c=o,e.path=c}else if(s==="secure")e.secure=!0;else if(s==="httponly")e.httpOnly=!0;else if(s==="samesite"){let c=o.toLowerCase();c==="none"?e.sameSite="None":c==="strict"?e.sameSite="Strict":c==="lax"&&(e.sameSite="Lax")}else e.unparsed??=[],e.unparsed.push(`${n}=${o}`);return Dpe(t,e)}a(Dpe,"parseUnparsedAttributes");CHn.exports={parseSetCookie:W5s,parseUnparsedAttributes:Dpe}});var xHn=I(($uf,IHn)=>{"use strict";p();var{parseSetCookie:SHn}=bHn(),{stringify:z5s}=Sar(),{webidl:Ya}=$A(),{Headers:Y5s}=zZ(),Wst=Ya.brandCheckMultiple([Y5s,globalThis.Headers].filter(Boolean));function K5s(t){Ya.argumentLengthCheck(arguments,1,"getCookies"),Wst(t);let e=t.get("cookie"),r={};if(!e)return r;for(let n of e.split(";")){let[o,...s]=n.split("=");r[o.trim()]=s.join("=")}return r}a(K5s,"getCookies");function J5s(t,e,r){Wst(t);let n="deleteCookie";Ya.argumentLengthCheck(arguments,2,n),e=Ya.converters.DOMString(e,n,"name"),r=Ya.converters.DeleteCookieAttributes(r),THn(t,{name:e,value:"",expires:new Date(0),...r})}a(J5s,"deleteCookie");function Z5s(t){Ya.argumentLengthCheck(arguments,1,"getSetCookies"),Wst(t);let e=t.getSetCookie();return e?e.map(r=>SHn(r)):[]}a(Z5s,"getSetCookies");function X5s(t){return t=Ya.converters.DOMString(t),SHn(t)}a(X5s,"parseCookie");function THn(t,e){Ya.argumentLengthCheck(arguments,2,"setCookie"),Wst(t),e=Ya.converters.Cookie(e);let r=z5s(e);r&&t.append("set-cookie",r,!0)}a(THn,"setCookie");Ya.converters.DeleteCookieAttributes=Ya.dictionaryConverter([{converter:Ya.nullableConverter(Ya.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);Ya.converters.Cookie=Ya.dictionaryConverter([{converter:Ya.converters.DOMString,key:"name"},{converter:Ya.converters.DOMString,key:"value"},{converter:Ya.nullableConverter(t=>typeof t=="number"?Ya.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.nullableConverter(Ya.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:Ya.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:Ya.sequenceConverter(Ya.converters.DOMString),key:"unparsed",defaultValue:a(()=>[],"defaultValue")}]);IHn.exports={getCookies:K5s,deleteCookie:J5s,getSetCookies:Z5s,setCookie:THn,parseCookie:X5s}});var Kst=I((zuf,RHn)=>{"use strict";p();var{webidl:li}=$A(),{kEnumerableProperty:yb}=Po(),{kConstruct:wHn}=al(),Npe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===wHn){super(arguments[1],arguments[2]),li.util.markAsUncloneable(this);return}let n="MessageEvent constructor";li.argumentLengthCheck(arguments,1,n),e=li.converters.DOMString(e,n,"type"),r=li.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,li.util.markAsUncloneable(this)}get data(){return li.brandCheck(this,t),this.#e.data}get origin(){return li.brandCheck(this,t),this.#e.origin}get lastEventId(){return li.brandCheck(this,t),this.#e.lastEventId}get source(){return li.brandCheck(this,t),this.#e.source}get ports(){return li.brandCheck(this,t),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,r=!1,n=!1,o=null,s="",c="",l=null,u=[]){return li.brandCheck(this,t),li.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new t(e,{bubbles:r,cancelable:n,data:o,origin:s,lastEventId:c,source:l,ports:u})}static createFastMessageEvent(e,r){let n=new t(wHn,e,r);return n.#e=r,n.#e.data??=null,n.#e.origin??="",n.#e.lastEventId??="",n.#e.source??=null,n.#e.ports??=[],n}},{createFastMessageEvent:e4s}=Npe;delete Npe.createFastMessageEvent;var zst=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";li.argumentLengthCheck(arguments,1,n),e=li.converters.DOMString(e,n,"type"),r=li.converters.CloseEventInit(r),super(e,r),this.#e=r,li.util.markAsUncloneable(this)}get wasClean(){return li.brandCheck(this,t),this.#e.wasClean}get code(){return li.brandCheck(this,t),this.#e.code}get reason(){return li.brandCheck(this,t),this.#e.reason}},Yst=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";li.argumentLengthCheck(arguments,1,n),super(e,r),li.util.markAsUncloneable(this),e=li.converters.DOMString(e,n,"type"),r=li.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return li.brandCheck(this,t),this.#e.message}get filename(){return li.brandCheck(this,t),this.#e.filename}get lineno(){return li.brandCheck(this,t),this.#e.lineno}get colno(){return li.brandCheck(this,t),this.#e.colno}get error(){return li.brandCheck(this,t),this.#e.error}};Object.defineProperties(Npe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:yb,origin:yb,lastEventId:yb,source:yb,ports:yb,initMessageEvent:yb});Object.defineProperties(zst.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:yb,code:yb,wasClean:yb});Object.defineProperties(Yst.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:yb,filename:yb,lineno:yb,colno:yb,error:yb});li.converters.MessagePort=li.interfaceConverter(li.is.MessagePort,"MessagePort");li.converters["sequence"]=li.sequenceConverter(li.converters.MessagePort);var Tar=[{key:"bubbles",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];li.converters.MessageEventInit=li.dictionaryConverter([...Tar,{key:"data",converter:li.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:li.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:li.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:li.nullableConverter(li.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:li.converters["sequence"],defaultValue:a(()=>[],"defaultValue")}]);li.converters.CloseEventInit=li.dictionaryConverter([...Tar,{key:"wasClean",converter:li.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:li.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:li.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);li.converters.ErrorEventInit=li.dictionaryConverter([...Tar,{key:"message",converter:li.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:li.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:li.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:li.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:li.converters.any}]);RHn.exports={MessageEvent:Npe,CloseEvent:zst,ErrorEvent:Yst,createFastMessageEvent:e4s}});var nH=I((Juf,kHn)=>{"use strict";p();var t4s="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",r4s={enumerable:!0,writable:!1,configurable:!1},n4s={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},i4s={SENT:1,RECEIVED:2},o4s={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},s4s=65535,a4s={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},c4s=Buffer.allocUnsafe(0),l4s={text:1,typedArray:2,arrayBuffer:3,blob:4};kHn.exports={uid:t4s,sentCloseFrameState:i4s,staticPropertyDescriptors:r4s,states:n4s,opcodes:o4s,maxUnsigned16Bit:s4s,parserStates:a4s,emptyBuffer:c4s,sendHints:l4s}});var XZ=I((Xuf,OHn)=>{"use strict";p();var{states:Jst,opcodes:Mpe}=nH(),{isUtf8:u4s}=require("node:buffer"),{removeHTTPWhitespace:PHn}=Mw(),{collectASequenceOfCodePointsFast:d4s}=GF();function f4s(t){return t===Jst.CONNECTING}a(f4s,"isConnecting");function p4s(t){return t===Jst.OPEN}a(p4s,"isEstablished");function h4s(t){return t===Jst.CLOSING}a(h4s,"isClosing");function m4s(t){return t===Jst.CLOSED}a(m4s,"isClosed");function g4s(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(g4s,"fireEvent");function A4s(t,e,r){t.onMessage(e,r)}a(A4s,"websocketMessageReceived");function y4s(t){return t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}a(y4s,"toArrayBuffer");function E4s(t){if(t.length===0)return!1;for(let e=0;e126||r===34||r===40||r===41||r===44||r===47||r===58||r===59||r===60||r===61||r===62||r===63||r===64||r===91||r===92||r===93||r===123||r===125)return!1}return!0}a(E4s,"isValidSubprotocol");function _4s(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(_4s,"isValidStatusCode");function DHn(t){return t===Mpe.CLOSE||t===Mpe.PING||t===Mpe.PONG}a(DHn,"isControlFrame");function NHn(t){return t===Mpe.CONTINUATION}a(NHn,"isContinuationFrame");function MHn(t){return t===Mpe.TEXT||t===Mpe.BINARY}a(MHn,"isTextBinaryFrame");function v4s(t){return MHn(t)||NHn(t)||DHn(t)}a(v4s,"isValidOpcode");function C4s(t){let e={position:0},r=new Map;for(;e.position57)return!1}let e=Number.parseInt(t,10);return e>=8&&e<=15}a(b4s,"isValidClientWindowBits");function S4s(t,e){let r;try{r=new URL(t,e)}catch(n){throw new DOMException(n,"SyntaxError")}if(r.protocol==="http:"?r.protocol="ws:":r.protocol==="https:"&&(r.protocol="wss:"),r.protocol!=="ws:"&&r.protocol!=="wss:")throw new DOMException("expected a ws: or wss: url","SyntaxError");if(r.hash.length||r.href.endsWith("#"))throw new DOMException("hash","SyntaxError");return r}a(S4s,"getURLRecord");function T4s(t,e){if(t!==null&&t!==1e3&&(t<3e3||t>4999))throw new DOMException("invalid code","InvalidAccessError");if(e!==null){let r=Buffer.byteLength(e);if(r>123)throw new DOMException(`Reason must be less than 123 bytes; received ${r}`,"SyntaxError")}}a(T4s,"validateCloseCodeAndReason");var I4s=(()=>{if(typeof process.versions.icu=="string"){let t=new TextDecoder("utf-8",{fatal:!0});return t.decode.bind(t)}return function(t){if(u4s(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();OHn.exports={isConnecting:f4s,isEstablished:p4s,isClosing:h4s,isClosed:m4s,fireEvent:g4s,isValidSubprotocol:E4s,isValidStatusCode:_4s,websocketMessageReceived:A4s,utf8Decode:I4s,isControlFrame:DHn,isContinuationFrame:NHn,isTextBinaryFrame:MHn,isValidOpcode:v4s,parseExtensions:C4s,isValidClientWindowBits:b4s,toArrayBuffer:y4s,getURLRecord:S4s,validateCloseCodeAndReason:T4s}});var Lpe=I((rdf,BHn)=>{"use strict";p();var{runtimeFeatures:x4s}=$F(),{maxUnsigned16Bit:LHn,opcodes:w4s}=nH(),Zst=8*1024,d2e=null,Ope=Zst,R4s=x4s.has("crypto")?require("node:crypto").randomFillSync:a(function(e,r,n){for(let o=0;oLHn?(c+=8,s=127):o>125&&(c+=2,s=126);let l=Buffer.allocUnsafe(o+c);l[0]=l[1]=0,l[0]|=128,l[0]=(l[0]&240)+e;l[c-4]=n[0],l[c-3]=n[1],l[c-2]=n[2],l[c-1]=n[3],l[1]=s,s===126?l.writeUInt16BE(o,2):s===127&&(l[2]=l[3]=0,l.writeUIntBE(o,4,6)),l[1]|=128;for(let u=0;uLHn?(s+=8,o=127):n>125&&(s+=2,o=126);let c=Buffer.allocUnsafeSlow(s);return c[0]=128|w4s.TEXT,c[1]=o|128,c[s-4]=r[0],c[s-3]=r[1],c[s-2]=r[2],c[s-1]=r[3],o===126?c.writeUInt16BE(n,2):o===127&&(c[2]=c[3]=0,c.writeUIntBE(n,4,6)),[c,e]}};BHn.exports={WebsocketFrameSend:xar,generateMask:Iar}});var Xst=I((odf,HHn)=>{"use strict";p();var{uid:k4s,states:war,sentCloseFrameState:Rar,emptyBuffer:FHn,opcodes:P4s}=nH(),{parseExtensions:D4s,isClosed:N4s,isClosing:M4s,isEstablished:qHn,isConnecting:O4s,validateCloseCodeAndReason:L4s}=XZ(),{makeRequest:B4s}=kpe(),{fetching:F4s}=a2e(),{Headers:U4s,getHeadersList:Q4s}=zZ(),{getDecodeSplit:q4s}=ET(),{WebsocketFrameSend:j4s}=Lpe(),H4s=require("node:assert"),{runtimeFeatures:G4s}=$F(),UHn=G4s.has("crypto")?require("node:crypto"):null,QHn=!1;function $4s(t,e,r,n,o){let s=t;s.protocol=t.protocol==="ws:"?"http:":"https:";let c=B4s({urlList:[s],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error",useURLCredentials:!0});if(o.headers){let f=Q4s(new U4s(o.headers));c.headersList=f}let l=UHn.randomBytes(16).toString("base64");c.headersList.append("sec-websocket-key",l,!0),c.headersList.append("sec-websocket-version","13",!0);for(let f of e)c.headersList.append("sec-websocket-protocol",f,!0);return c.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits",!0),F4s({request:c,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(f){if(f.type==="error"||f.status!==101){if(f.socket?.session==null){q5(n,1002,"Received network error or non-101 status code.",f.error);return}if(f.status!==200){q5(n,1002,"Received network error or non-200 status code.",f.error);return}}if(QHn===!1&&f.socket?.session!=null&&(process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.","ExperimentalWarning"),QHn=!0),e.length!==0&&!f.headersList.get("Sec-WebSocket-Protocol")){q5(n,1002,"Server did not respond with sent protocols.");return}if(f.socket.session==null&&f.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){q5(n,1002,'Server did not set Upgrade header to "websocket".');return}if(f.socket.session==null&&f.headersList.get("Connection")?.toLowerCase()!=="upgrade"){q5(n,1002,'Server did not set Connection header to "upgrade".');return}let h=f.headersList.get("Sec-WebSocket-Accept"),m=UHn.hash("sha1",l+k4s,"base64");if(h!==m){q5(n,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let g=f.headersList.get("Sec-WebSocket-Extensions"),A;if(g!==null&&(A=D4s(g),!A.has("permessage-deflate"))){q5(n,1002,"Sec-WebSocket-Extensions header does not match.");return}let y=f.headersList.get("Sec-WebSocket-Protocol");if(y!==null&&!q4s("sec-websocket-protocol",c.headersList).includes(y)){q5(n,1002,"Protocol was not set in the opening handshake.");return}f.socket.on("data",n.onSocketData),f.socket.on("close",n.onSocketClose),f.socket.on("error",n.onSocketError),n.wasEverConnected=!0,n.onConnectionEstablished(f,A)}})}a($4s,"establishWebSocketConnection");function jHn(t,e,r,n=!1){if(e??=null,r??="",n&&L4s(e,r),!(N4s(t.readyState)||M4s(t.readyState)))if(!qHn(t.readyState))q5(t),t.readyState=war.CLOSING;else if(!t.closeState.has(Rar.SENT)&&!t.closeState.has(Rar.RECEIVED)){let o=new j4s;r.length!==0&&e===null&&(e=1e3),H4s(e===null||Number.isInteger(e)),e===null&&r.length===0?o.frameData=FHn:e!==null&&r===null?(o.frameData=Buffer.allocUnsafe(2),o.frameData.writeUInt16BE(e,0)):e!==null&&r!==null?(o.frameData=Buffer.allocUnsafe(2+Buffer.byteLength(r)),o.frameData.writeUInt16BE(e,0),o.frameData.write(r,2,"utf-8")):o.frameData=FHn,t.socket.write(o.createFrame(P4s.CLOSE)),t.closeState.add(Rar.SENT),t.readyState=war.CLOSING}else t.readyState=war.CLOSING}a(jHn,"closeWebSocketConnection");function q5(t,e,r,n){qHn(t.readyState)&&jHn(t,e,r,!1),t.controller.abort(),O4s(t.readyState)?t.onSocketClose():t.socket?.destroyed===!1&&t.socket.destroy()}a(q5,"failWebsocketConnection");HHn.exports={establishWebSocketConnection:$4s,failWebsocketConnection:q5,closeWebSocketConnection:jHn}});var $Hn=I((cdf,GHn)=>{"use strict";p();var{createInflateRaw:V4s,Z_DEFAULT_WINDOWBITS:W4s}=require("node:zlib"),{isValidClientWindowBits:z4s}=XZ(),{MessageSizeExceededError:Y4s}=ao(),K4s=Buffer.from([0,0,255,255]),eat=Symbol("kBuffer"),f2e=Symbol("kLength"),kar=class{static{a(this,"PerMessageDeflate")}#e;#t={};#r=0;constructor(e,r){this.#t.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=e.get("server_max_window_bits"),this.#r=r.maxPayloadSize}decompress(e,r,n){if(!this.#e){let o=W4s;if(this.#t.serverMaxWindowBits){if(!z4s(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=V4s({windowBits:o})}catch(s){n(s);return}this.#e[eat]=[],this.#e[f2e]=0,this.#e.on("data",s=>{if(this.#e[f2e]+=s.length,this.#r>0&&this.#e[f2e]>this.#r){n(new Y4s),this.#e.removeAllListeners(),this.#e=null;return}this.#e[eat].push(s)}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#e.write(e),r&&this.#e.write(K4s),this.#e.flush(()=>{if(!this.#e)return;let o=Buffer.concat(this.#e[eat],this.#e[f2e]);this.#e[eat].length=0,this.#e[f2e]=0,n(null,o)})}};GHn.exports={PerMessageDeflate:kar}});var Mar=I((ddf,KHn)=>{"use strict";p();var{Writable:J4s}=require("node:stream"),Z4s=require("node:assert"),{parserStates:Eb,opcodes:Bpe,states:X4s,emptyBuffer:VHn,sentCloseFrameState:p2e}=nH(),{isValidStatusCode:eLs,isValidOpcode:tLs,websocketMessageReceived:WHn,utf8Decode:rLs,isControlFrame:Par,isTextBinaryFrame:Dar,isContinuationFrame:nLs}=XZ(),{failWebsocketConnection:bE}=Xst(),{WebsocketFrameSend:zHn}=Lpe(),{PerMessageDeflate:iLs}=$Hn(),{MessageSizeExceededError:YHn}=ao(),Nar=class extends J4s{static{a(this,"ByteParser")}#e=[];#t=0;#r=0;#n=!1;#i=Eb.INFO;#o={};#s=[];#a;#c;#u;#l;constructor(e,r,n={}){super(),this.#c=e,this.#a=r??new Map,this.#u=n.maxFragments??0,this.#l=n.maxPayloadSize??0,this.#a.has("permessage-deflate")&&this.#a.set("permessage-deflate",new iLs(r,n))}_write(e,r,n){this.#e.push(e),this.#r+=e.length,this.#n=!0,this.run(n)}#p(){return this.#l>0&&!Par(this.#o.opcode)&&this.#o.payloadLength+this.#t>this.#l?(bE(this.#c,1009,"Payload size exceeds maximum allowed size"),!1):!0}run(e){for(;this.#n;)if(this.#i===Eb.INFO){if(this.#r<2)return e();let r=this.consume(2),n=(r[0]&128)!==0,o=r[0]&15,s=(r[1]&128)===128,c=!n&&o!==Bpe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!tLs(o))return bE(this.#c,1002,"Invalid opcode received"),e();if(s)return bE(this.#c,1002,"Frame cannot be masked"),e();if(u!==0&&!this.#a.has("permessage-deflate")){bE(this.#c,1002,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){bE(this.#c,1002,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!Dar(o)){bE(this.#c,1002,"Invalid frame type was fragmented.");return}if(Dar(o)&&this.#s.length>0){bE(this.#c,1002,"Expected continuation frame");return}if(this.#o.fragmented&&c){bE(this.#c,1002,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&Par(o)){bE(this.#c,1002,"Control frame either too large or fragmented");return}if(nLs(o)&&this.#s.length===0&&!this.#o.compressed){bE(this.#c,1002,"Unexpected continuation frame");return}if(l<=125){if(this.#o.payloadLength=l,this.#i=Eb.READ_DATA,!this.#p())return}else l===126?this.#i=Eb.PAYLOADLENGTH_16:l===127&&(this.#i=Eb.PAYLOADLENGTH_64);Dar(o)&&(this.#o.binaryType=o,this.#o.compressed=u!==0),this.#o.opcode=o,this.#o.masked=s,this.#o.fin=n,this.#o.fragmented=c}else if(this.#i===Eb.PAYLOADLENGTH_16){if(this.#r<2)return e();let r=this.consume(2);if(this.#o.payloadLength=r.readUInt16BE(0),this.#i=Eb.READ_DATA,!this.#p())return}else if(this.#i===Eb.PAYLOADLENGTH_64){if(this.#r<8)return e();let r=this.consume(8),n=r.readUInt32BE(0),o=r.readUInt32BE(4);if(n!==0||o>2**31-1){bE(this.#c,1009,"Received payload length > 2^31 bytes.");return}if(this.#o.payloadLength=o,this.#i=Eb.READ_DATA,!this.#p())return}else if(this.#i===Eb.READ_DATA){if(this.#r{if(n){let s=n instanceof YHn?1009:1007;bE(this.#c,s,n.message);return}if(this.writeFragments(o)){if(this.#l>0&&this.#t>this.#l){bE(this.#c,1009,new YHn().message);return}if(!this.#o.fin){this.#i=Eb.INFO,this.#n=!0,this.run(e);return}WHn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#n=!0,this.#i=Eb.INFO,this.run(e)}},this.#t),this.#n=!1;break}else{if(!this.writeFragments(r))return;!this.#o.fragmented&&this.#o.fin&&WHn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#i=Eb.INFO}}}consume(e){if(e>this.#r)throw new Error("Called consume() before buffers satiated.");if(e===0)return VHn;this.#r-=e;let r=this.#e[0];if(r.length>e)return this.#e[0]=r.subarray(e,r.length),r.subarray(0,e);if(r.length===e)return this.#e.shift();{let n=0,o=Buffer.allocUnsafeSlow(e);for(;n!==e;){let s=this.#e[0],c=s.length;if(c+n===e){o.set(this.#e.shift(),n);break}else if(c+n>e){o.set(s.subarray(0,e-n),n),this.#e[0]=s.subarray(e-n);break}else o.set(this.#e.shift(),n),n+=c}return o}}writeFragments(e){return this.#u>0&&this.#s.length===this.#u?(bE(this.#c,1008,"Too many message fragments"),!1):(this.#t+=e.length,this.#s.push(e),!0)}consumeFragments(){let e=this.#s;if(e.length===1)return this.#t=0,e.shift();let r=0,n=Buffer.allocUnsafeSlow(this.#t);for(let o=0;o=2&&(r=e.readUInt16BE(0)),r!==void 0&&!eLs(r))return{code:1002,reason:"Invalid status code",error:!0};let n=e.subarray(2);n[0]===239&&n[1]===187&&n[2]===191&&(n=n.subarray(3));try{n=rLs(n)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:r,reason:n,error:!1}}parseControlFrame(e){let{opcode:r,payloadLength:n}=this.#o;if(r===Bpe.CLOSE){if(n===1)return bE(this.#c,1002,"Received close frame with a 1-byte body."),!1;if(this.#o.closeInfo=this.parseCloseBody(e),this.#o.closeInfo.error){let{code:o,reason:s}=this.#o.closeInfo;return bE(this.#c,o,s),!1}if(!this.#c.closeState.has(p2e.SENT)&&!this.#c.closeState.has(p2e.RECEIVED)){let o=VHn;this.#o.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#o.closeInfo.code,0));let s=new zHn(o);this.#c.socket.write(s.createFrame(Bpe.CLOSE)),this.#c.closeState.add(p2e.SENT)}return this.#c.readyState=X4s.CLOSING,this.#c.closeState.add(p2e.RECEIVED),!1}else if(r===Bpe.PING){if(!this.#c.closeState.has(p2e.RECEIVED)){let o=new zHn(e);this.#c.socket.write(o.createFrame(Bpe.PONG)),this.#c.onPing(e)}}else r===Bpe.PONG&&this.#c.onPong(e);return!0}get closingInfo(){return this.#o.closeInfo}};KHn.exports={ByteParser:Nar}});var eGn=I((hdf,XHn)=>{"use strict";p();var{WebsocketFrameSend:ZHn}=Lpe(),{opcodes:JHn,sendHints:eX}=nH(),oLs=aor(),Lar=class{static{a(this,"SendQueue")}#e=new oLs;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==eX.blob){if(this.#t){let s={promise:null,callback:r,frame:Oar(e,n)};this.#e.push(s)}else if(n===eX.text){let{0:s,1:c}=ZHn.createFastTextFrame(e);this.#r.cork(),this.#r.write(s),this.#r.write(c,r),this.#r.uncork()}else this.#r.write(Oar(e,n),r);return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=Oar(s,n)}),callback:r,frame:null};this.#e.push(o),this.#t||this.#n()}async#n(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let r=e.shift();r.promise!==null&&await r.promise,this.#r.write(r.frame,r.callback),r.callback=r.frame=null}this.#t=!1}};function Oar(t,e){return new ZHn(sLs(t,e)).createFrame(e===eX.text?JHn.TEXT:JHn.BINARY)}a(Oar,"createFrame");function sLs(t,e){switch(e){case eX.text:case eX.typedArray:return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);case eX.arrayBuffer:case eX.blob:return new Uint8Array(t)}}a(sLs,"toBuffer");XHn.exports={SendQueue:Lar}});var sGn=I((Adf,oGn)=>{"use strict";p();var{isArrayBuffer:aLs}=require("node:util/types"),{webidl:mi}=$A(),{URLSerializer:cLs}=Mw(),{environmentSettingsObject:tGn}=ET(),{staticPropertyDescriptors:iH,states:r8,sentCloseFrameState:Bar,sendHints:tat,opcodes:Far}=nH(),{isConnecting:lLs,isEstablished:rGn,isClosing:nGn,isClosed:uLs,isValidSubprotocol:dLs,fireEvent:rat,utf8Decode:fLs,toArrayBuffer:pLs,getURLRecord:hLs}=XZ(),{establishWebSocketConnection:mLs,closeWebSocketConnection:gLs,failWebsocketConnection:iGn}=Xst(),{ByteParser:ALs}=Mar(),{kEnumerableProperty:jw}=Po(),{getGlobalDispatcher:yLs}=_st(),{ErrorEvent:ELs,CloseEvent:_Ls,createFastMessageEvent:vLs}=Kst(),{SendQueue:CLs}=eGn(),{WebsocketFrameSend:bLs}=Lpe(),{channels:j5}=Bj();function SLs(t){return typeof t?.address=="function"?t.address():typeof t?.session?.socket?.address=="function"?t.session.socket.address():null}a(SLs,"getSocketAddress");var dv=class t extends EventTarget{static{a(this,"WebSocket")}#e={open:null,error:null,close:null,message:null};#t=0;#r="";#n="";#i;#o={onConnectionEstablished:a((e,r)=>this.#u(e,r),"onConnectionEstablished"),onMessage:a((e,r)=>this.#l(e,r),"onMessage"),onParserError:a(e=>iGn(this.#o,null,e.message),"onParserError"),onParserDrain:a(()=>this.#p(),"onParserDrain"),onSocketData:a(e=>{this.#c.write(e)||this.#o.socket.pause()},"onSocketData"),onSocketError:a(e=>{this.#o.readyState=r8.CLOSING,j5.socketError.hasSubscribers&&j5.socketError.publish(e),this.#o.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(e=>{j5.ping.hasSubscribers&&j5.ping.publish({payload:e,websocket:this})},"onPing"),onPong:a(e=>{j5.pong.hasSubscribers&&j5.pong.publish({payload:e,websocket:this})},"onPong"),readyState:r8.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#s;#a;#c;constructor(e,r=[]){super(),mi.util.markAsUncloneable(this);let n="WebSocket constructor";mi.argumentLengthCheck(arguments,1,n);let o=mi.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=mi.converters.USVString(e),r=o.protocols;let s=tGn.settingsObject.baseUrl,c=hLs(e,s);if(typeof r=="string"&&(r=[r]),r.length!==new Set(r.map(u=>u.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(r.length>0&&!r.every(u=>dLs(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#s=new URL(c.href);let l=tGn.settingsObject;this.#o.controller=mLs(c,r,l,this.#o,o),this.#o.readyState=t.CONNECTING,this.#a="blob"}close(e=void 0,r=void 0){mi.brandCheck(this,t),e!==void 0&&(e=mi.converters["unsigned short"](e,"WebSocket.close","code",mi.attributes.Clamp)),r!==void 0&&(r=mi.converters.USVString(r)),e??=null,r??="",gLs(this.#o,e,r,!0)}send(e){mi.brandCheck(this,t);let r="WebSocket.send";if(mi.argumentLengthCheck(arguments,1,r),e=mi.converters.WebSocketSendData(e,r,"data"),lLs(this.#o.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!rGn(this.#o.readyState)||nGn(this.#o.readyState)))if(typeof e=="string"){let n=Buffer.from(e);this.#t+=n.byteLength,this.#i.add(n,()=>{this.#t-=n.byteLength},tat.text)}else aLs(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},tat.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},tat.typedArray)):mi.is.Blob(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},tat.blob))}get readyState(){return mi.brandCheck(this,t),this.#o.readyState}get bufferedAmount(){return mi.brandCheck(this,t),this.#t}get url(){return mi.brandCheck(this,t),cLs(this.#s)}get extensions(){return mi.brandCheck(this,t),this.#n}get protocol(){return mi.brandCheck(this,t),this.#r}get onopen(){return mi.brandCheck(this,t),this.#e.open}set onopen(e){mi.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onerror(){return mi.brandCheck(this,t),this.#e.error}set onerror(e){mi.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}get onclose(){return mi.brandCheck(this,t),this.#e.close}set onclose(e){mi.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("close",r),this.#e.close=e):this.#e.close=null}get onmessage(){return mi.brandCheck(this,t),this.#e.message}set onmessage(e){mi.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get binaryType(){return mi.brandCheck(this,t),this.#a}set binaryType(e){mi.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this.#a="blob":this.#a=e}#u(e,r){this.#o.socket=e.socket;let n=this.#o.controller.dispatcher?.webSocketOptions,o=n?.maxFragments,s=n?.maxPayloadSize,c=new ALs(this.#o,r,{maxFragments:o,maxPayloadSize:s});c.on("drain",()=>this.#o.onParserDrain()),c.on("error",d=>this.#o.onParserError(d)),this.#c=c,this.#i=new CLs(e.socket),this.#o.readyState=r8.OPEN;let l=e.headersList.get("sec-websocket-extensions");l!==null&&(this.#n=l);let u=e.headersList.get("sec-websocket-protocol");if(u!==null&&(this.#r=u),rat("open",this),j5.open.hasSubscribers){let d=e.headersList.entries;j5.open.publish({address:SLs(e.socket),protocol:this.#r,extensions:this.#n,websocket:this,handshakeResponse:{status:e.status,statusText:e.statusText,headers:d}})}}#l(e,r){if(this.#o.readyState!==r8.OPEN)return;let n;if(e===Far.TEXT)try{n=fLs(r)}catch{iGn(this.#o,1007,"Received invalid UTF-8 in text frame.");return}else e===Far.BINARY&&(this.#a==="blob"?n=new Blob([r]):n=pLs(r));rat("message",this,vLs,{origin:this.#s.origin,data:n})}#p(){this.#o.socket.resume()}#g(){let e=this.#o.closeState.has(Bar.SENT)&&this.#o.closeState.has(Bar.RECEIVED),r=1005,n="",o=this.#c?.closingInfo;o&&!o.error&&(r=o.code??1005,n=o.reason),this.#o.readyState=r8.CLOSED,this.#o.closeState.has(Bar.RECEIVED)||(r=1006,rat("error",this,(s,c)=>new ELs(s,c),{error:new TypeError(n)})),rat("close",this,(s,c)=>new _Ls(s,c),{wasClean:e,code:r,reason:n}),j5.close.hasSubscribers&&j5.close.publish({websocket:this,code:r,reason:n})}static ping(e,r){if(Buffer.isBuffer(r)){if(r.length>125)throw new TypeError("A PING frame cannot have a body larger than 125 bytes.")}else if(r!==void 0)throw new TypeError("Expected buffer payload");let n=e.#o.readyState;if(rGn(n)&&!nGn(n)&&!uLs(n)){let o=new bLs(r);e.#o.socket.write(o.createFrame(Far.PING))}}},{ping:TLs}=dv;Reflect.deleteProperty(dv,"ping");dv.CONNECTING=dv.prototype.CONNECTING=r8.CONNECTING;dv.OPEN=dv.prototype.OPEN=r8.OPEN;dv.CLOSING=dv.prototype.CLOSING=r8.CLOSING;dv.CLOSED=dv.prototype.CLOSED=r8.CLOSED;Object.defineProperties(dv.prototype,{CONNECTING:iH,OPEN:iH,CLOSING:iH,CLOSED:iH,url:jw,readyState:jw,bufferedAmount:jw,onopen:jw,onerror:jw,onclose:jw,close:jw,onmessage:jw,binaryType:jw,send:jw,extensions:jw,protocol:jw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(dv,{CONNECTING:iH,OPEN:iH,CLOSING:iH,CLOSED:iH});mi.converters["sequence"]=mi.sequenceConverter(mi.converters.DOMString);mi.converters["DOMString or sequence"]=function(t,e,r){return mi.util.Type(t)===mi.util.Types.OBJECT&&Symbol.iterator in t?mi.converters["sequence"](t):mi.converters.DOMString(t,e,r)};mi.converters.WebSocketInit=mi.dictionaryConverter([{key:"protocols",converter:mi.converters["DOMString or sequence"],defaultValue:a(()=>[],"defaultValue")},{key:"dispatcher",converter:mi.converters.any,defaultValue:a(()=>yLs(),"defaultValue")},{key:"headers",converter:mi.nullableConverter(mi.converters.HeadersInit)}]);mi.converters["DOMString or sequence or WebSocketInit"]=function(t){return mi.util.Type(t)===mi.util.Types.OBJECT&&!(Symbol.iterator in t)?mi.converters.WebSocketInit(t):{protocols:mi.converters["DOMString or sequence"](t)}};mi.converters.WebSocketSendData=function(t){return mi.util.Type(t)===mi.util.Types.OBJECT&&(mi.is.Blob(t)||mi.is.BufferSource(t))?t:mi.converters.USVString(t)};oGn.exports={WebSocket:dv,ping:TLs}});var Uar=I((_df,lGn)=>{"use strict";p();var{webidl:nat}=$A(),{validateCloseCodeAndReason:ILs}=XZ(),{kConstruct:aGn}=al(),{kEnumerableProperty:cGn}=Po();function xLs(){class t extends DOMException{static{a(this,"Test")}get reason(){return""}}return new t().reason!==void 0?DOMException:new Proxy(DOMException,{construct(e,r,n){let o=Reflect.construct(e,r,e);return Object.setPrototypeOf(o,n.prototype),o}})}a(xLs,"createInheritableDOMException");var tX=class t extends xLs(){static{a(this,"WebSocketError")}#e;#t;constructor(e="",r=void 0){if(e=nat.converters.DOMString(e,"WebSocketError","message"),super(e,"WebSocketError"),r===aGn)return;r!==null&&(r=nat.converters.WebSocketCloseInfo(r));let n=r.closeCode??null,o=r.reason??"";ILs(n,o),o.length!==0&&n===null&&(n=1e3),this.#e=n,this.#t=o}get closeCode(){return this.#e}get reason(){return this.#t}static createUnvalidatedWebSocketError(e,r,n){let o=new t(e,aGn);return o.#e=r,o.#t=n,o}},{createUnvalidatedWebSocketError:wLs}=tX;delete tX.createUnvalidatedWebSocketError;Object.defineProperties(tX.prototype,{closeCode:cGn,reason:cGn,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}});nat.is.WebSocketError=nat.util.MakeTypeAssertion(tX);lGn.exports={WebSocketError:tX,createUnvalidatedWebSocketError:wLs}});var hGn=I((bdf,pGn)=>{"use strict";p();var{createDeferredPromise:Qar}=CPe(),{environmentSettingsObject:uGn}=ET(),{states:Fpe,opcodes:iat,sentCloseFrameState:Upe}=nH(),{webidl:gp}=$A(),{getURLRecord:RLs,isValidSubprotocol:kLs,isEstablished:PLs,utf8Decode:DLs}=XZ(),{establishWebSocketConnection:NLs,failWebsocketConnection:qar,closeWebSocketConnection:jar}=Xst(),{channels:dGn}=Bj(),{WebsocketFrameSend:MLs}=Lpe(),{ByteParser:OLs}=Mar(),{WebSocketError:LLs,createUnvalidatedWebSocketError:BLs}=Uar(),{kEnumerableProperty:oat}=Po(),{utf8DecodeBytes:FLs}=Iot(),fGn=!1,sat=class{static{a(this,"WebSocketStream")}#e;#t;#r;#n;#i;#o;#s=!1;#a={onConnectionEstablished:a((e,r)=>this.#l(e,r),"onConnectionEstablished"),onMessage:a((e,r)=>this.#p(e,r),"onMessage"),onParserError:a(e=>qar(this.#a,null,e.message),"onParserError"),onParserDrain:a(()=>this.#a.socket.resume(),"onParserDrain"),onSocketData:a(e=>{this.#c.write(e)||this.#a.socket.pause()},"onSocketData"),onSocketError:a(e=>{this.#a.readyState=Fpe.CLOSING,dGn.socketError.hasSubscribers&&dGn.socketError.publish(e),this.#a.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(()=>{},"onPing"),onPong:a(()=>{},"onPong"),readyState:Fpe.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#c;constructor(e,r=void 0){fGn||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),fGn=!0),gp.argumentLengthCheck(arguments,1,"WebSocket"),e=gp.converters.USVString(e),r!==null&&(r=gp.converters.WebSocketStreamOptions(r));let n=uGn.settingsObject.baseUrl,o=RLs(e,n),s=r.protocols;if(s.length!==new Set(s.map(l=>l.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(s.length>0&&!s.every(l=>kLs(l)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#e=o.toString(),this.#t=Qar(),this.#r=Qar(),r.signal!=null){let l=r.signal;if(l.aborted){this.#t.reject(l.reason),this.#r.reject(l.reason);return}l.addEventListener("abort",()=>{PLs(this.#a.readyState)||(qar(this.#a),this.#a.readyState=Fpe.CLOSING,this.#t.reject(l.reason),this.#r.reject(l.reason),this.#s=!0)},{once:!0})}let c=uGn.settingsObject;this.#a.controller=NLs(o,s,c,this.#a,r)}get url(){return this.#e.toString()}get opened(){return this.#t.promise}get closed(){return this.#r.promise}close(e=void 0){e!==null&&(e=gp.converters.WebSocketCloseInfo(e));let r=e.closeCode??null,n=e.reason;jar(this.#a,r,n,!0)}#u(e){e=gp.converters.WebSocketStreamWrite(e);let r=Qar(),n=null,o=null;if(gp.is.BufferSource(e))n=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),o=iat.BINARY;else{let s;try{s=gp.converters.DOMString(e)}catch(c){return r.reject(c),r.promise}n=new TextEncoder().encode(s),o=iat.TEXT}if(!this.#a.closeState.has(Upe.SENT)&&!this.#a.closeState.has(Upe.RECEIVED)){let s=new MLs(n);this.#a.socket.write(s.createFrame(o),()=>{r.resolve(void 0)})}return r.promise}#l(e,r){this.#a.socket=e.socket;let n=this.#a.controller.dispatcher?.webSocketOptions?.maxFragments,o=this.#a.controller.dispatcher?.webSocketOptions?.maxPayloadSize,s=new OLs(this.#a,r,{maxFragments:n,maxPayloadSize:o});s.on("drain",()=>this.#a.onParserDrain()),s.on("error",f=>this.#a.onParserError(f)),this.#c=s,this.#a.readyState=Fpe.OPEN;let c=r??"",l=e.headersList.get("sec-websocket-protocol")??"",u=new ReadableStream({start:a(f=>{this.#i=f},"start"),cancel:a(f=>this.#h(f),"cancel")}),d=new WritableStream({write:a(f=>this.#u(f),"write"),close:a(()=>jar(this.#a,null,null),"close"),abort:a(f=>this.#A(f),"abort")});this.#n=u,this.#o=d,this.#t.resolve({extensions:c,protocol:l,readable:u,writable:d})}#p(e,r){if(this.#a.readyState!==Fpe.OPEN)return;let n;if(e===iat.TEXT)try{n=DLs(r)}catch{qar(this.#a,1007,"Received invalid UTF-8 in text frame.");return}else e===iat.BINARY&&(n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));this.#i.enqueue(n)}#g(){let e=this.#a.closeState.has(Upe.SENT)&&this.#a.closeState.has(Upe.RECEIVED);if(this.#a.readyState=Fpe.CLOSED,this.#s)return;this.#a.wasEverConnected||this.#t.reject(new LLs("Socket never opened"));let r=this.#c?.closingInfo,n=r?.code??1005;!this.#a.closeState.has(Upe.SENT)&&!this.#a.closeState.has(Upe.RECEIVED)&&(n=1006);let o=r?.reason==null?"":FLs(Buffer.from(r.reason));if(e)this.#i.close(),this.#o.locked||this.#o.abort(new DOMException("A closed WebSocketStream cannot be written to","InvalidStateError")),this.#r.resolve({closeCode:n,reason:o});else{let s=BLs("unclean close",n,o);this.#i?.error(s),this.#o?.abort(s),this.#r.reject(s)}}#A(e){let r=null,n="";gp.is.WebSocketError(e)&&(r=e.closeCode,n=e.reason),jar(this.#a,r,n)}#h(e){this.#A(e)}};Object.defineProperties(sat.prototype,{url:oat,opened:oat,closed:oat,close:oat,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}});gp.converters.WebSocketStreamOptions=gp.dictionaryConverter([{key:"protocols",converter:gp.sequenceConverter(gp.converters.USVString),defaultValue:a(()=>[],"defaultValue")},{key:"signal",converter:gp.nullableConverter(gp.converters.AbortSignal),defaultValue:a(()=>null,"defaultValue")}]);gp.converters.WebSocketCloseInfo=gp.dictionaryConverter([{key:"closeCode",converter:a(t=>gp.converters["unsigned short"](t,gp.attributes.EnforceRange),"converter")},{key:"reason",converter:gp.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);gp.converters.WebSocketStreamWrite=function(t){return typeof t=="string"?gp.converters.USVString(t):gp.converters.BufferSource(t)};pGn.exports={WebSocketStream:sat}});var gGn=I((Idf,mGn)=>{"use strict";p();function ULs(t){return t.indexOf("\0")===-1}a(ULs,"isValidLastEventId");function QLs(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(QLs,"isASCIINumber");mGn.exports={isValidLastEventId:ULs,isASCIINumber:QLs}});var _Gn=I((Rdf,EGn)=>{"use strict";p();var{Transform:qLs}=require("node:stream"),{isASCIINumber:AGn,isValidLastEventId:yGn}=gGn(),n8=[239,187,191],Har=10,aat=13,jLs=58,HLs=32,Gar=class extends qLs{static{a(this,"EventSourceStream")}state;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,r,n){if(e.length===0){n();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===n8[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===n8[0]&&this.buffer[1]===n8[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===n8[0]&&this.buffer[1]===n8[1]&&this.buffer[2]===n8[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===n8[0]&&this.buffer[1]===n8[1]&&this.buffer[2]===n8[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&AGn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id!==void 0&&yGn(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};EGn.exports={EventSourceStream:Gar}});var wGn=I((Ddf,xGn)=>{"use strict";p();var{pipeline:GLs}=require("node:stream"),{fetching:$Ls}=a2e(),{makeRequest:VLs}=kpe(),{webidl:fv}=$A(),{EventSourceStream:WLs}=_Gn(),{parseMIMEType:zLs}=Mw(),{createFastMessageEvent:YLs}=Kst(),{isNetworkError:vGn}=i2e(),{kEnumerableProperty:rX}=Po(),{environmentSettingsObject:CGn}=ET(),bGn=!1,SGn=3e3,h2e=0,TGn=1,m2e=2,KLs="anonymous",JLs="use-credentials",Qpe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t;#r=!1;#n=h2e;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),fv.util.markAsUncloneable(this);let n="EventSource constructor";fv.argumentLengthCheck(arguments,1,n),bGn||(bGn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=fv.converters.USVString(e),r=fv.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.node.dispatcher||r.dispatcher,this.#a={lastEventId:"",reconnectionTime:r.node.reconnectionTime};let o=CGn,s;try{s=new URL(e,o.settingsObject.baseUrl),this.#a.origin=s.origin}catch(u){throw new DOMException(u,"SyntaxError")}this.#t=s.href;let c=KLs;r.withCredentials===!0&&(c=JLs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=CGn.settingsObject,l.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],l.cache="no-store",l.initiator="other",l.urlList=[new URL(this.#t)],this.#i=VLs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===m2e)return;this.#n=h2e;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{if(!vGn(n))return this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(vGn(n))if(n.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#u();return}let o=n.headersList.get("content-type",!0),s=o!==null?zLs(o):"failure",c=s!=="failure"&&s.essence==="text/event-stream";if(n.status!==200||c===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#n=TGn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new WLs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(YLs(u.type,u.options))},"push")});GLs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=$Ls(e)}#u(){this.#n!==m2e&&(this.#n=h2e,this.dispatchEvent(new Event("error")),setTimeout(()=>{this.#n===h2e&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c())},this.#a.reconnectionTime)?.unref())}close(){fv.brandCheck(this,t),this.#n!==m2e&&(this.#n=m2e,this.#o.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open);let r=fv.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message);let r=fv.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error);let r=fv.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}},IGn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:h2e,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:TGn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:m2e,writable:!1}};Object.defineProperties(Qpe,IGn);Object.defineProperties(Qpe.prototype,IGn);Object.defineProperties(Qpe.prototype,{close:rX,onerror:rX,onmessage:rX,onopen:rX,readyState:rX,url:rX,withCredentials:rX});fv.converters.EventSourceInitDict=fv.dictionaryConverter([{key:"withCredentials",converter:fv.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:fv.converters.any},{key:"node",converter:fv.dictionaryConverter([{key:"reconnectionTime",converter:fv.converters["unsigned long"],defaultValue:a(()=>SGn,"defaultValue")},{key:"dispatcher",converter:fv.converters.any}]),defaultValue:a(()=>({}),"defaultValue")}]);xGn.exports={EventSource:Qpe,defaultReconnectionTime:SGn}});var $ar=I((Odf,vn)=>{"use strict";p();var ZLs=Vj(),kGn=mPe(),XLs=NZ(),eBs=RUn(),tBs=NUn(),rBs=LZ(),nBs=Oor(),iBs=Por(),oBs=y7n(),sBs=S7n(),aBs=x7n(),PGn=ao(),lat=Po(),{InvalidArgumentError:cat}=PGn,qpe=cQn(),cBs=CZ(),lBs=_sr(),{MockCallHistory:uBs,MockCallHistoryLog:dBs}=bsr(),fBs=Dsr(),pBs=xsr(),hBs=aqn(),mBs=nsr(),gBs=ost(),{getGlobalDispatcher:DGn,setGlobalDispatcher:ABs}=_st(),yBs=Tpe(),EBs=Qsr();Object.assign(kGn.prototype,qpe);vn.exports.Dispatcher=kGn;vn.exports.Client=ZLs;vn.exports.Pool=XLs;vn.exports.BalancedPool=eBs;vn.exports.RoundRobinPool=tBs;vn.exports.Agent=rBs;vn.exports.ProxyAgent=nBs;vn.exports.Socks5ProxyAgent=iBs;vn.exports.EnvHttpProxyAgent=oBs;vn.exports.RetryAgent=sBs;vn.exports.H2CClient=aBs;vn.exports.RetryHandler=gBs;vn.exports.DecoratorHandler=yBs;vn.exports.RedirectHandler=EBs;vn.exports.interceptors={redirect:yqn(),responseError:_qn(),retry:Cqn(),dump:Sqn(),dns:wqn(),cache:$qn(),decompress:Kqn(),deduplicate:tjn()};vn.exports.cacheStores={MemoryCacheStore:Ysr()};var _Bs=ijn();vn.exports.cacheStores.SqliteCacheStore=_Bs;vn.exports.buildConnector=cBs;vn.exports.errors=PGn;vn.exports.util={parseHeaders:lat.parseHeaders,headerNameToString:lat.headerNameToString};function g2e(t){return(e,r,n)=>{if(typeof r=="function"&&(n=r,r=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new cat("invalid url");if(r!=null&&typeof r!="object")throw new cat("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new cat("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(lat.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=lat.parseURL(e);let{agent:o,dispatcher:s=DGn()}=r;if(o)throw new cat("unsupported opts.agent. Did you mean opts.client?");return t.call(s,{...r,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:r.method||(r.body?"PUT":"GET")},n)}}a(g2e,"makeDispatcher");vn.exports.setGlobalDispatcher=ABs;vn.exports.getGlobalDispatcher=DGn;var vBs=a2e().fetch,RGn=typeof __filename<"u"?__filename:void 0;function NGn(t,e){if(!t||typeof t!="object")return;let r=typeof t.stack=="string"?t.stack:"",n=e.replace(/\\/g,"/");if(r&&(r.includes(e)||r.includes(n)))return;let o={};if(Error.captureStackTrace(o,NGn),!o.stack)return;let s=o.stack.split(` + `)}close(){this.#r.close()}get(e){Yar(e);let r=this.#g(e);return r?{body:r.body?Buffer.from(r.body.buffer,r.body.byteOffset,r.body.byteLength):void 0,statusCode:r.statusCode,statusMessage:r.statusMessage,headers:r.headers?JSON.parse(r.headers):void 0,etag:r.etag?r.etag:void 0,vary:r.vary?JSON.parse(r.vary):void 0,cacheControlDirectives:r.cacheControlDirectives?JSON.parse(r.cacheControlDirectives):void 0,cachedAt:r.cachedAt,staleAt:r.staleAt,deleteAt:r.deleteAt}:void 0}set(e,r){Yar(e);let n=this.#p(e),o=Array.isArray(r.body)?Buffer.concat(r.body):r.body,s=o?.byteLength;if(s&&s>this.#e)return;let c=this.#g(e,!0);c?this.#i.run(o,r.deleteAt,r.statusCode,r.statusMessage,r.headers?JSON.stringify(r.headers):null,r.etag?r.etag:null,r.cacheControlDirectives?JSON.stringify(r.cacheControlDirectives):null,r.cachedAt,r.staleAt,c.id):(this.#o.run(n,e.method,o,r.deleteAt,r.statusCode,r.statusMessage,r.headers?JSON.stringify(r.headers):null,r.etag?r.etag:null,r.cacheControlDirectives?JSON.stringify(r.cacheControlDirectives):null,r.vary?JSON.stringify(r.vary):null,r.cachedAt,r.staleAt),this.#l())}createWriteStream(e,r){Yar(e),D5s(r);let n=0,o=[],s=this;return new P5s({decodeStrings:!0,write(c,l,u){n+=c.byteLength,n=u.deleteAt&&!r)continue;let d=!0;if(u.vary){let f=JSON.parse(u.vary);for(let h in f)if(!N5s(o[h],f[h])){d=!1;break}}if(d)return u}}};function N5s(t,e){return t==null&&e==null?!0:t==null&&e!=null||t!=null&&e==null?!1:Array.isArray(t)&&Array.isArray(e)?t.length!==e.length?!1:t.every((r,n)=>r===e[n]):t===e}a(N5s,"headerValueEquals")});var iX=I((Ipf,WHn)=>{"use strict";p();var{kConstruct:M5s}=al(),{kEnumerableProperty:Hpe}=Po(),{iteratorMixin:O5s,isValidHeaderName:C2e,isValidHeaderValue:jHn}=IT(),{webidl:Pa}=zA(),Jar=require("node:assert"),Jst=require("node:util");function qHn(t){return t===10||t===13||t===9||t===32}a(qHn,"isHTTPWhiteSpaceCharCode");function HHn(t){let e=0,r=t.length;for(;r>e&&qHn(t.charCodeAt(r-1));)--r;for(;r>e&&qHn(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(HHn,"headerValueNormalize");function GHn(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(GHn,"fill");function Zar(t,e,r){if(r=HHn(r),C2e(e)){if(!jHn(r))throw Pa.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw Pa.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(VHn(t)==="immutable")throw new TypeError("immutable");return Xst(t).append(e,r,!1)}a(Zar,"appendHeader");function L5s(t){let e=Xst(t);if(!e)return[];if(e.sortedMap)return e.sortedMap;let r=[],n=e.toSortedArray(),o=e.cookies;if(o===null||o.length===1)return e.sortedMap=n;for(let s=0;s>1),r[d][0]<=f[0]?u=d+1:l=d;if(s!==d){for(c=s;c>u;)r[c]=r[--c];r[u]=f}}if(!n.next().done)throw new TypeError("Unreachable");return r}else{let n=0;for(let{0:o,1:{value:s}}of this.headersMap)r[n++]=[o,s],Jar(s!==null);return r.sort($Hn)}}},L2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){Pa.util.markAsUncloneable(this),e!==M5s&&(this.#t=new Zst,this.#e="none",e!==void 0&&(e=Pa.converters.HeadersInit(e,"Headers constructor","init"),GHn(this,e)))}append(e,r){Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=Pa.converters.ByteString(e,n,"name"),r=Pa.converters.ByteString(r,n,"value"),Zar(this,e,r)}delete(e){if(Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,1,"Headers.delete"),e=Pa.converters.ByteString(e,"Headers.delete","name"),!C2e(e))throw Pa.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=Pa.converters.ByteString(e,r,"name"),!C2e(e))throw Pa.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=Pa.converters.ByteString(e,r,"name"),!C2e(e))throw Pa.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){Pa.brandCheck(this,t),Pa.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=Pa.converters.ByteString(e,n,"name"),r=Pa.converters.ByteString(r,n,"value"),r=HHn(r),C2e(e)){if(!jHn(r))throw Pa.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw Pa.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){Pa.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}[Jst.inspect.custom](e,r){return r.depth??=e,`Headers ${Jst.formatWithOptions(r,this.#t.entries)}`}static getHeadersGuard(e){return e.#e}static setHeadersGuard(e,r){e.#e=r}static getHeadersList(e){return e.#t}static setHeadersList(e,r){e.#t=r}},{getHeadersGuard:VHn,setHeadersGuard:B5s,getHeadersList:Xst,setHeadersList:F5s}=L2;Reflect.deleteProperty(L2,"getHeadersGuard");Reflect.deleteProperty(L2,"setHeadersGuard");Reflect.deleteProperty(L2,"getHeadersList");Reflect.deleteProperty(L2,"setHeadersList");O5s("Headers",L2,L5s,0,1);Object.defineProperties(L2.prototype,{append:Hpe,delete:Hpe,get:Hpe,has:Hpe,set:Hpe,getSetCookie:Hpe,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[Jst.inspect.custom]:{enumerable:!1}});Pa.converters.HeadersInit=function(t,e,r){if(Pa.util.Type(t)===Pa.util.Types.OBJECT){let n=Reflect.get(t,Symbol.iterator);if(!Jst.types.isProxy(t)&&n===L2.prototype.entries)try{return Xst(t).entriesList}catch{}return typeof n=="function"?Pa.converters["sequence>"](t,e,r,n.bind(t)):Pa.converters["record"](t,e,r)}throw Pa.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};WHn.exports={fill:GHn,compareHeaderName:$Hn,Headers:L2,HeadersList:Zst,getHeadersGuard:VHn,setHeadersGuard:B5s,setHeadersList:F5s,getHeadersList:Xst}});var S2e=I((Rpf,oGn)=>{"use strict";p();var{Headers:XHn,HeadersList:zHn,fill:U5s,getHeadersGuard:Q5s,setHeadersGuard:eGn,setHeadersList:tGn}=iX(),{extractBody:YHn,cloneBody:q5s,mixinBody:j5s,streamRegistry:rGn,bodyUnusable:H5s}=Cpe(),nGn=Po(),KHn=require("node:util"),{kEnumerableProperty:DT}=nGn,{isValidReasonPhrase:G5s,isCancelled:$5s,isAborted:V5s,isErrorLike:W5s,environmentSettingsObject:z5s}=IT(),{redirectStatusSet:Y5s,nullBodyStatus:K5s}=BPe(),{webidl:ra}=zA(),{URLSerializer:JHn}=jw(),{kConstruct:tat}=al(),Xar=require("node:assert"),{isomorphicEncode:J5s,serializeJavascriptValueToJSONString:Z5s}=XF(),X5s=new TextEncoder("utf-8"),NT=class t{static{a(this,"Response")}#e;#t;static error(){return b2e(rat(),"immutable")}static json(e,r=void 0){ra.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=ra.converters.ResponseInit(r));let n=X5s.encode(Z5s(e)),o=YHn(n),s=b2e(Gpe({}),"response");return ZHn(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){ra.argumentLengthCheck(arguments,1,"Response.redirect"),e=ra.converters.USVString(e),r=ra.converters["unsigned short"](r);let n;try{n=new URL(e,z5s.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!Y5s.has(r))throw new RangeError(`Invalid status code ${r}`);let o=b2e(Gpe({}),"immutable");o.#t.status=r;let s=J5s(JHn(n));return o.#t.headersList.append("location",s,!0),o}constructor(e=null,r=void 0){if(ra.util.markAsUncloneable(this),e===tat)return;e!==null&&(e=ra.converters.BodyInit(e,"Response","body")),r=ra.converters.ResponseInit(r),this.#t=Gpe({}),this.#e=new XHn(tat),eGn(this.#e,"response"),tGn(this.#e,this.#t.headersList);let n=null;if(e!=null){let[o,s]=YHn(e);n={body:o,type:s}}ZHn(this,r,n)}get type(){return ra.brandCheck(this,t),this.#t.type}get url(){ra.brandCheck(this,t);let e=this.#t.urlList,r=e[e.length-1]??null;return r===null?"":JHn(r,!0)}get redirected(){return ra.brandCheck(this,t),this.#t.urlList.length>1}get status(){return ra.brandCheck(this,t),this.#t.status}get ok(){return ra.brandCheck(this,t),this.#t.status>=200&&this.#t.status<=299}get statusText(){return ra.brandCheck(this,t),this.#t.statusText}get headers(){return ra.brandCheck(this,t),this.#e}get body(){return ra.brandCheck(this,t),this.#t.body?this.#t.body.stream:null}get bodyUsed(){return ra.brandCheck(this,t),!!this.#t.body&&nGn.isDisturbed(this.#t.body.stream)}clone(){if(ra.brandCheck(this,t),H5s(this.#t))throw ra.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=ecr(this.#t);return this.#t.urlList.length!==0&&this.#t.body?.stream&&rGn.register(this,new WeakRef(this.#t.body.stream)),b2e(e,Q5s(this.#e))}[KHn.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${KHn.formatWithOptions(r,n)}`}static getResponseHeaders(e){return e.#e}static setResponseHeaders(e,r){e.#e=r}static getResponseState(e){return e.#t}static setResponseState(e,r){e.#t=r}},{getResponseHeaders:e4s,setResponseHeaders:t4s,getResponseState:oX,setResponseState:r4s}=NT;Reflect.deleteProperty(NT,"getResponseHeaders");Reflect.deleteProperty(NT,"setResponseHeaders");Reflect.deleteProperty(NT,"getResponseState");Reflect.deleteProperty(NT,"setResponseState");j5s(NT,oX);Object.defineProperties(NT.prototype,{type:DT,url:DT,status:DT,ok:DT,redirected:DT,statusText:DT,headers:DT,clone:DT,body:DT,bodyUsed:DT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(NT,{json:DT,redirect:DT,error:DT});function ecr(t){if(t.internalResponse)return iGn(ecr(t.internalResponse),t.type);let e=Gpe({...t,body:null});return t.body!=null&&(e.body=q5s(t.body)),e}a(ecr,"cloneResponse");function Gpe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new zHn(t?.headersList):new zHn,urlList:t?.urlList?[...t.urlList]:[]}}a(Gpe,"makeResponse");function rat(t){let e=W5s(t);return Gpe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(rat,"makeNetworkError");function n4s(t){return t.type==="error"&&t.status===0}a(n4s,"isNetworkError");function eat(t,e){return e={internalResponse:t,...e},new Proxy(t,{get(r,n){return n in e?e[n]:r[n]},set(r,n,o){return Xar(!(n in e)),r[n]=o,!0}})}a(eat,"makeFilteredResponse");function iGn(t,e){if(e==="basic")return eat(t,{type:"basic",headersList:t.headersList});if(e==="cors")return eat(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return eat(t,{type:"opaque",urlList:[],status:0,statusText:"",body:null});if(e==="opaqueredirect")return eat(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});Xar(!1)}a(iGn,"filterResponse");function i4s(t,e=null){return Xar($5s(t)),V5s(t)?rat(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):rat(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(i4s,"makeAppropriateNetworkError");function ZHn(t,e,r){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!G5s(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(oX(t).status=e.status),"statusText"in e&&e.statusText!=null&&(oX(t).statusText=e.statusText),"headers"in e&&e.headers!=null&&U5s(e4s(t),e.headers),r){if(K5s.includes(t.status))throw ra.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});oX(t).body=r.body,r.type!=null&&!oX(t).headersList.contains("content-type",!0)&&oX(t).headersList.append("content-type",r.type,!0)}}a(ZHn,"initializeResponse");function b2e(t,e){let r=new NT(tat);r4s(r,t);let n=new XHn(tat);return t4s(r,n),tGn(n,t.headersList),eGn(n,e),t.urlList.length!==0&&t.body?.stream&&rGn.register(r,new WeakRef(t.body.stream)),r}a(b2e,"fromInnerResponse");ra.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?ra.converters.USVString(t,e,r):ra.is.Blob(t)||ra.is.BufferSource(t)||ra.is.FormData(t)||ra.is.URLSearchParams(t)?t:ra.converters.DOMString(t,e,r)};ra.converters.BodyInit=function(t,e,r){return ra.is.ReadableStream(t)||t?.[Symbol.asyncIterator]?t:ra.converters.XMLHttpRequestBodyInit(t,e,r)};ra.converters.ResponseInit=ra.dictionaryConverter([{key:"status",converter:ra.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:ra.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:ra.converters.HeadersInit}]);ra.is.Response=ra.util.MakeTypeAssertion(NT);oGn.exports={isNetworkError:n4s,makeNetworkError:rat,makeResponse:Gpe,makeAppropriateNetworkError:i4s,filterResponse:iGn,Response:NT,cloneResponse:ecr,fromInnerResponse:b2e,getResponseState:oX}});var $pe=I((Dpf,EGn)=>{"use strict";p();var{extractBody:o4s,mixinBody:s4s,cloneBody:a4s,bodyUnusable:sGn}=Cpe(),{Headers:fGn,fill:c4s,HeadersList:oat,setHeadersGuard:tcr,getHeadersGuard:l4s,setHeadersList:pGn,getHeadersList:aGn}=iX(),iat=Po(),cGn=require("node:util"),{isValidHTTPToken:u4s,sameOrigin:lGn,environmentSettingsObject:nat}=IT(),{forbiddenMethodsSet:d4s,corsSafeListedMethodsSet:f4s,referrerPolicy:p4s,requestRedirect:h4s,requestMode:m4s,requestCredentials:g4s,requestCache:A4s,requestDuplex:y4s}=BPe(),{kEnumerableProperty:mm,normalizedMethodRecordsBase:E4s,normalizedMethodRecords:_4s}=iat,{webidl:Oi}=zA(),{URLSerializer:v4s}=jw(),{kConstruct:sat}=al(),C4s=require("node:assert"),{getMaxListeners:hGn,setMaxListeners:b4s,defaultMaxListeners:S4s}=require("node:events"),T4s=Symbol("abortController"),mGn=new FinalizationRegistry(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),aat=new WeakMap,rcr;try{rcr=hGn(new AbortController().signal)>0}catch{rcr=!1}function uGn(t){return e;function e(){let r=t.deref();if(r!==void 0){mGn.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=aat.get(r.signal);if(n!==void 0){if(n.size!==0){for(let o of n){let s=o.deref();s!==void 0&&s.abort(this.reason)}n.clear()}aat.delete(r.signal)}}}}a(uGn,"buildAbort");var dGn=!1,_b=class t{static{a(this,"Request")}#e;#t;#r;#n;constructor(e,r=void 0){if(Oi.util.markAsUncloneable(this),e===sat)return;Oi.argumentLengthCheck(arguments,1,"Request constructor"),e=Oi.converters.RequestInfo(e),r=Oi.converters.RequestInit(r);let o=null,s=null,c=nat.settingsObject.baseUrl,l=null;if(typeof e=="string"){this.#t=r.dispatcher;let _;try{_=new URL(e,c)}catch(v){throw new TypeError("Failed to parse URL from "+e,{cause:v})}if(_.username||_.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);o=cat({urlList:[_]}),s="cors"}else C4s(Oi.is.Request(e)),o=e.#n,l=e.#e,this.#t=r.dispatcher||e.#t;let u=nat.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&lGn(o.window,u)&&(d=o.window),r.window!=null)throw new TypeError(`'window' option '${d}' must be null`);"window"in r&&(d="no-window"),o=cat({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:nat.settingsObject,window:d,priority:o.priority,origin:o.origin,referrer:o.referrer,referrerPolicy:o.referrerPolicy,mode:o.mode,credentials:o.credentials,cache:o.cache,redirect:o.redirect,integrity:o.integrity,keepalive:o.keepalive,reloadNavigation:o.reloadNavigation,historyNavigation:o.historyNavigation,urlList:[...o.urlList]});let f=Object.keys(r).length!==0;if(f&&(o.mode==="navigate"&&(o.mode="same-origin"),o.reloadNavigation=!1,o.historyNavigation=!1,o.origin="client",o.referrer="client",o.referrerPolicy="",o.url=o.urlList[o.urlList.length-1],o.urlList=[o.url]),r.referrer!==void 0){let _=r.referrer;if(_==="")o.referrer="no-referrer";else{let v;try{v=new URL(_,c)}catch(b){throw new TypeError(`Referrer "${_}" is not a valid URL.`,{cause:b})}v.protocol==="about:"&&v.hostname==="client"||u&&!lGn(v,nat.settingsObject.baseUrl)?o.referrer="client":o.referrer=v}}r.referrerPolicy!==void 0&&(o.referrerPolicy=r.referrerPolicy);let h;if(r.mode!==void 0?h=r.mode:h=s,h==="navigate")throw Oi.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(h!=null&&(o.mode=h),r.credentials!==void 0&&(o.credentials=r.credentials),r.cache!==void 0&&(o.cache=r.cache),o.cache==="only-if-cached"&&o.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(r.redirect!==void 0&&(o.redirect=r.redirect),r.integrity!=null&&(o.integrity=String(r.integrity)),r.keepalive!==void 0&&(o.keepalive=!!r.keepalive),r.method!==void 0){let _=r.method,v=_4s[_];if(v!==void 0)o.method=v;else{if(!u4s(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(d4s.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=E4s[b]??_,o.method=_}!dGn&&o.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),dGn=!0)}r.signal!==void 0&&(l=r.signal),this.#n=o;let m=new AbortController;if(this.#e=m.signal,l!=null)if(l.aborted)m.abort(l.reason);else{this[T4s]=m;let _=new WeakRef(m),v=uGn(_);rcr&&hGn(l)===S4s&&b4s(1500,l),iat.addAbortListener(l,v),mGn.register(m,{signal:l,abort:v},v)}if(this.#r=new fGn(sat),pGn(this.#r,o.headersList),tcr(this.#r,"request"),h==="no-cors"){if(!f4s.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);tcr(this.#r,"request-no-cors")}if(f){let _=aGn(this.#r),v=r.headers!==void 0?r.headers:new oat(_);if(_.clear(),v instanceof oat){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else c4s(this.#r,v)}let g=Oi.is.Request(e)?e.#n.body:null;if((r.body!=null||g!=null)&&(o.method==="GET"||o.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let A=null;if(r.body!=null){let[_,v]=o4s(r.body,o.keepalive);A=_,v&&!aGn(this.#r).contains("content-type",!0)&&this.#r.append("content-type",v,!0)}let y=A??g;if(y!=null&&y.source==null){if(A!=null&&r.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(o.mode!=="same-origin"&&o.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');o.useCORSPreflightFlag=!0}let E=y;if(A==null&&g!=null){if(sGn(e.#n))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let _=new TransformStream;g.stream.pipeThrough(_),E={source:g.source,length:g.length,stream:_.readable}}this.#n.body=E}get method(){return Oi.brandCheck(this,t),this.#n.method}get url(){return Oi.brandCheck(this,t),v4s(this.#n.url)}get headers(){return Oi.brandCheck(this,t),this.#r}get destination(){return Oi.brandCheck(this,t),this.#n.destination}get referrer(){return Oi.brandCheck(this,t),this.#n.referrer==="no-referrer"?"":this.#n.referrer==="client"?"about:client":this.#n.referrer.toString()}get referrerPolicy(){return Oi.brandCheck(this,t),this.#n.referrerPolicy}get mode(){return Oi.brandCheck(this,t),this.#n.mode}get credentials(){return Oi.brandCheck(this,t),this.#n.credentials}get cache(){return Oi.brandCheck(this,t),this.#n.cache}get redirect(){return Oi.brandCheck(this,t),this.#n.redirect}get integrity(){return Oi.brandCheck(this,t),this.#n.integrity}get keepalive(){return Oi.brandCheck(this,t),this.#n.keepalive}get isReloadNavigation(){return Oi.brandCheck(this,t),this.#n.reloadNavigation}get isHistoryNavigation(){return Oi.brandCheck(this,t),this.#n.historyNavigation}get signal(){return Oi.brandCheck(this,t),this.#e}get body(){return Oi.brandCheck(this,t),this.#n.body?this.#n.body.stream:null}get bodyUsed(){return Oi.brandCheck(this,t),!!this.#n.body&&iat.isDisturbed(this.#n.body.stream)}get duplex(){return Oi.brandCheck(this,t),"half"}clone(){if(Oi.brandCheck(this,t),sGn(this.#n))throw new TypeError("unusable");let e=AGn(this.#n),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=aat.get(this.signal);n===void 0&&(n=new Set,aat.set(this.signal,n));let o=new WeakRef(r);n.add(o),iat.addAbortListener(r.signal,uGn(o))}return yGn(e,this.#t,r.signal,l4s(this.#r))}[cGn.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${cGn.formatWithOptions(r,n)}`}static setRequestSignal(e,r){return e.#e=r,e}static getRequestDispatcher(e){return e.#t}static setRequestDispatcher(e,r){e.#t=r}static setRequestHeaders(e,r){e.#r=r}static getRequestState(e){return e.#n}static setRequestState(e,r){e.#n=r}},{setRequestSignal:I4s,getRequestDispatcher:x4s,setRequestDispatcher:w4s,setRequestHeaders:R4s,getRequestState:gGn,setRequestState:k4s}=_b;Reflect.deleteProperty(_b,"setRequestSignal");Reflect.deleteProperty(_b,"getRequestDispatcher");Reflect.deleteProperty(_b,"setRequestDispatcher");Reflect.deleteProperty(_b,"setRequestHeaders");Reflect.deleteProperty(_b,"getRequestState");Reflect.deleteProperty(_b,"setRequestState");s4s(_b,gGn);function cat(t){return{method:t.method??"GET",localURLsOnly:t.localURLsOnly??!1,unsafeRequest:t.unsafeRequest??!1,body:t.body??null,client:t.client??null,reservedClient:t.reservedClient??null,replacesClientId:t.replacesClientId??"",window:t.window??"client",keepalive:t.keepalive??!1,serviceWorkers:t.serviceWorkers??"all",initiator:t.initiator??"",destination:t.destination??"",priority:t.priority??null,origin:t.origin??"client",policyContainer:t.policyContainer??"client",referrer:t.referrer??"client",referrerPolicy:t.referrerPolicy??"",mode:t.mode??"no-cors",useCORSPreflightFlag:t.useCORSPreflightFlag??!1,credentials:t.credentials??"same-origin",useCredentials:t.useCredentials??!1,cache:t.cache??"default",redirect:t.redirect??"follow",integrity:t.integrity??"",cryptoGraphicsNonceMetadata:t.cryptoGraphicsNonceMetadata??"",parserMetadata:t.parserMetadata??"",reloadNavigation:t.reloadNavigation??!1,historyNavigation:t.historyNavigation??!1,userActivation:t.userActivation??!1,taintedOrigin:t.taintedOrigin??!1,redirectCount:t.redirectCount??0,responseTainting:t.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:t.preventNoCacheCacheControlHeaderModification??!1,done:t.done??!1,timingAllowFailed:t.timingAllowFailed??!1,useURLCredentials:t.useURLCredentials??void 0,traversableForUserPrompts:t.traversableForUserPrompts??"client",urlList:t.urlList,url:t.urlList[0],headersList:t.headersList?new oat(t.headersList):new oat}}a(cat,"makeRequest");function AGn(t){let e=cat({...t,body:null});return t.body!=null&&(e.body=a4s(t.body)),e}a(AGn,"cloneRequest");function yGn(t,e,r,n){let o=new _b(sat);k4s(o,t),w4s(o,e),I4s(o,r);let s=new fGn(sat);return R4s(o,s),pGn(s,t.headersList),tcr(s,n),o}a(yGn,"fromInnerRequest");Object.defineProperties(_b.prototype,{method:mm,url:mm,headers:mm,redirect:mm,clone:mm,signal:mm,duplex:mm,destination:mm,body:mm,bodyUsed:mm,isHistoryNavigation:mm,isReloadNavigation:mm,keepalive:mm,integrity:mm,cache:mm,credentials:mm,attribute:mm,referrerPolicy:mm,referrer:mm,mode:mm,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Oi.is.Request=Oi.util.MakeTypeAssertion(_b);Oi.converters.RequestInfo=function(t){return typeof t=="string"?Oi.converters.USVString(t):Oi.is.Request(t)?t:Oi.converters.USVString(t)};Oi.converters.RequestInit=Oi.dictionaryConverter([{key:"method",converter:Oi.converters.ByteString},{key:"headers",converter:Oi.converters.HeadersInit},{key:"body",converter:Oi.nullableConverter(Oi.converters.BodyInit)},{key:"referrer",converter:Oi.converters.USVString},{key:"referrerPolicy",converter:Oi.converters.DOMString,allowedValues:p4s},{key:"mode",converter:Oi.converters.DOMString,allowedValues:m4s},{key:"credentials",converter:Oi.converters.DOMString,allowedValues:g4s},{key:"cache",converter:Oi.converters.DOMString,allowedValues:A4s},{key:"redirect",converter:Oi.converters.DOMString,allowedValues:h4s},{key:"integrity",converter:Oi.converters.DOMString},{key:"keepalive",converter:Oi.converters.boolean},{key:"signal",converter:Oi.nullableConverter(t=>Oi.converters.AbortSignal(t,"RequestInit","signal"))},{key:"window",converter:Oi.converters.any},{key:"duplex",converter:Oi.converters.DOMString,allowedValues:y4s},{key:"dispatcher",converter:Oi.converters.any},{key:"priority",converter:Oi.converters.DOMString,allowedValues:["high","low","auto"],defaultValue:a(()=>"auto","defaultValue")}]);EGn.exports={Request:_b,makeRequest:cat,fromInnerRequest:yGn,cloneRequest:AGn,getRequestDispatcher:x4s,getRequestState:gGn}});var xGn=I((Opf,IGn)=>{"use strict";p();var P4s=require("node:assert"),{runtimeFeatures:vGn}=e8(),sX=new Map([["sha256",0],["sha384",1],["sha512",2]]),ncr;if(vGn.has("crypto")){ncr=require("node:crypto");let t=ncr.getHashes();t.length===0&&sX.clear();for(let e of sX.keys())t.includes(e)===!1&&sX.delete(e)}else sX.clear();var _Gn=Map.prototype.get.bind(sX),icr=Map.prototype.has.bind(sX),D4s=vGn.has("crypto")===!1||sX.size===0?()=>!0:(t,e)=>{let r=bGn(e);if(r.length===0)return!0;let n=CGn(r);for(let o of n){let s=o.alg,c=o.val,l=SGn(s,t);if(TGn(l,c))return!0}return!1};function CGn(t){let e=[],r=null;for(let n of t){if(P4s(icr(n.alg),"Invalid SRI hash algorithm token"),e.length===0){e.push(n),r=n;continue}let o=r.alg,s=_Gn(o),c=n.alg,l=_Gn(c);ls?(r=n,e[0]=n,e.length=1):e.push(n))}return e}a(CGn,"getStrongestMetadata");function bGn(t){let e=[];for(let r of t.split(" ")){let o=r.split("?",1)[0],s="",c=[o.slice(0,6),o.slice(7)],l=c[0];if(!icr(l))continue;c[1]&&(s=c[1]);let u={alg:l,val:s};e.push(u)}return e}a(bGn,"parseMetadata");var SGn=a((t,e)=>ncr.hash(t,e,"base64"),"applyAlgorithmToBytes");function TGn(t,e){let r=t.length;r!==0&&t[r-1]==="="&&(r-=1),r!==0&&t[r-1]==="="&&(r-=1);let n=e.length;if(n!==0&&e[n-1]==="="&&(n-=1),n!==0&&e[n-1]==="="&&(n-=1),r!==n)return!1;for(let o=0;o{"use strict";p();var{makeNetworkError:ll,makeAppropriateNetworkError:T2e,filterResponse:ocr,makeResponse:lat,fromInnerResponse:N4s,getResponseState:M4s}=S2e(),{HeadersList:scr}=iX(),{Request:O4s,cloneRequest:L4s,getRequestDispatcher:B4s,getRequestState:F4s}=$pe(),B2=require("node:zlib"),{makePolicyContainer:U4s,clonePolicyContainer:Q4s,requestBadPort:q4s,TAOCheck:j4s,appendRequestOriginHeader:H4s,responseLocationURL:G4s,requestCurrentURL:MT,setRequestReferrerPolicyOnRedirect:$4s,tryUpgradeRequestToAPotentiallyTrustworthyURL:V4s,createOpaqueTimingInfo:fcr,appendFetchMetadata:W4s,corsCheck:z4s,crossOriginResourcePolicyCheck:Y4s,determineRequestsReferrer:K4s,coarsenedSharedCurrentTime:I2e,sameOrigin:ucr,isCancelled:gH,isAborted:wGn,isErrorLike:J4s,fullyReadBody:Z4s,readableStreamClose:X4s,urlIsLocal:eLs,urlIsHttpHttpsScheme:pat,urlHasHttpsScheme:tLs,clampAndCoarsenConnectionTimingInfo:rLs,simpleRangeHeaderValue:nLs,buildContentRange:iLs,createInflate:oLs,extractMimeType:sLs,hasAuthenticationEntry:aLs,includesCredentials:RGn,isTraversableNavigable:cLs}=IT(),aX=require("node:assert"),{safelyExtractBody:hat,extractBody:kGn}=Cpe(),{redirectStatusSet:MGn,nullBodyStatus:OGn,safeMethodsSet:lLs,requestBodyHeader:uLs,subresourceSet:dLs}=BPe(),fLs=require("node:events"),{Readable:pLs,pipeline:hLs,finished:mLs,isErrored:gLs,isReadable:uat}=require("node:stream"),{addAbortListener:ALs,bufferToLowerCasedHeaderName:PGn}=Po(),{dataURLProcessor:yLs,serializeAMimeType:ELs,minimizeSupportedMimeType:_Ls}=jw(),{getGlobalDispatcher:vLs}=zst(),{webidl:pcr}=zA(),{STATUS_CODES:DGn}=require("node:http"),{bytesMatch:CLs}=xGn(),{createDeferredPromise:bLs}=jPe(),{isomorphicEncode:dat}=XF(),{runtimeFeatures:SLs}=e8(),TLs=SLs.has("zstd"),ILs=["GET","HEAD"],xLs=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",acr,fat=class extends fLs{static{a(this,"Fetch")}constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function wLs(t){LGn(t,"fetch")}a(wLs,"handleFetchDone");function RLs(t,e=void 0){pcr.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=bLs(),n;try{n=new O4s(t,e)}catch(f){return r.reject(f),r.promise}let o=F4s(n);if(n.signal.aborted)return ccr(r,o,null,n.signal.reason,null),r.promise;o.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(o.serviceWorkers="none");let c=null,l=!1,u=null;return ALs(n.signal,()=>{l=!0,aX(u!=null),u.abort(n.signal.reason);let f=c?.deref();ccr(r,o,f,n.signal.reason,u.controller)}),u=FGn({request:o,processResponseEndOfBody:wLs,processResponse:a(f=>{if(!l){if(f.aborted){ccr(r,o,c,u.serializedAbortReason,u.controller);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(N4s(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:B4s(n),requestObject:n}),r.promise}a(RLs,"fetch");function LGn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;pat(r)&&n!==null&&(t.timingAllowPassed||(n=fcr({startTime:n.startTime}),o=""),n.endTime=I2e(),t.timingInfo=n,BGn(n,r.href,e,globalThis,o,"",t.status))}a(LGn,"finalizeAndReportTiming");var BGn=performance.markResourceTiming;function ccr(t,e,r,n,o){if(t&&t.reject(n),e.body?.stream!=null&&uat(e.body.stream)&&e.body.stream.cancel(n).catch(c=>{if(c.code!=="ERR_INVALID_STATE")throw c}),r==null)return;let s=M4s(r);s.body?.stream!=null&&uat(s.body.stream)&&o.error(n)}a(ccr,"abortFetch");function FGn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=vLs(),requestObject:u=null}){aX(l);let d=null,f=!1;t.client!=null&&(d=t.client.globalObject,f=t.client.crossOriginIsolatedCapability);let h=I2e(f),m=fcr({startTime:h}),g={controller:new fat(l),request:t,timingInfo:m,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:d,crossOriginIsolatedCapability:f,requestObject:u};return aX(!t.body||t.body.stream),t.window==="client"&&(t.window=t.client?.globalObject?.constructor?.name==="Window"?t.client:"no-window"),t.origin==="client"&&(t.origin=t.client.origin),t.policyContainer==="client"&&(t.client!=null?t.policyContainer=Q4s(t.client.policyContainer):t.policyContainer=U4s()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,dLs.has(t.destination),UGn(g,!1),g.controller}a(FGn,"fetching");async function UGn(t,e){try{let r=t.request,n=null;if(r.localURLsOnly&&!eLs(MT(r))&&(n=ll("local URLs only")),V4s(r),q4s(r)==="blocked"&&(n=ll("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=K4s(r)),n===null){let s=MT(r);ucr(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",n=await NGn(t)):r.mode==="same-origin"?n=ll('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?n=ll('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",n=await NGn(t)):pat(MT(r))?(r.responseTainting="cors",n=await QGn(t)):n=ll("URL scheme must be a HTTP(S) scheme")}if(e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=ocr(n,"basic"):r.responseTainting==="cors"?n=ocr(n,"cors"):r.responseTainting==="opaque"?n=ocr(n,"opaque"):aX(!1));let o=n.status===0?n:n.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(n.timingAllowPassed=!0),n.type==="opaque"&&o.status===206&&o.rangeRequested&&!r.headers.contains("range",!0)&&(n=o=ll()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||OGn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>lcr(t,ll(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!CLs(l,r.integrity)){s("integrity mismatch");return}n.body=hat(l)[0],lcr(t,n)},"processBody");Z4s(n.body,c,s)}else lcr(t,n)}catch(r){t.controller.terminate(r)}}a(UGn,"mainFetch");function NGn(t){if(gH(t)&&t.request.redirectCount===0)return Promise.resolve(T2e(t));let{request:e}=t,{protocol:r}=MT(e);switch(r){case"about:":return Promise.resolve(ll("about scheme is not supported"));case"blob:":{acr||(acr=require("node:buffer").resolveObjectURL);let n=MT(e);if(n.search.length!==0)return Promise.resolve(ll("NetworkError when attempting to fetch resource."));let o=acr(n.toString());if(e.method!=="GET"||!pcr.is.Blob(o))return Promise.resolve(ll("invalid method"));let s=lat(),c=o.size,l=dat(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=nLs(d,!0);if(f==="failure")return Promise.resolve(ll("failed to fetch the data URL"));let{rangeStartValue:h,rangeEndValue:m}=f;if(h===null)h=c-m,m=h+m-1;else{if(h>=c)return Promise.resolve(ll("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m+1,u),A=kGn(g);s.body=A[0];let y=dat(`${g.size}`),E=iLs(h,m,c);s.status=206,s.statusText="Partial Content",s.headersList.set("content-length",y,!0),s.headersList.set("content-type",u,!0),s.headersList.set("content-range",E,!0)}else{let d=kGn(o);s.statusText="OK",s.body=d[0],s.headersList.set("content-length",l,!0),s.headersList.set("content-type",u,!0)}return Promise.resolve(s)}case"data:":{let n=MT(e),o=yLs(n);if(o==="failure")return Promise.resolve(ll("failed to fetch the data URL"));let s=ELs(o.mimeType);return Promise.resolve(lat({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:hat(o.body)[0]}))}case"file:":return Promise.resolve(ll("not implemented... yet..."));case"http:":case"https:":return QGn(t).catch(n=>ll(n));default:return Promise.resolve(ll("unknown scheme"))}}a(NGn,"schemeFetch");function kLs(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(kLs,"finalizeResponse");function lcr(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(!pat(t.request.url))return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=fcr(r),l="");let d=0;if(t.request.mode!=="navigate"||!e.hasCrossOriginRedirects){d=e.status;let f=sLs(e.headersList);f!=="failure"&&(u.contentType=_Ls(f))}t.request.initiatorType!=null&&BGn(r,t.request.url.href,t.request.initiatorType,globalThis,l,u,d)};let c=a(()=>{t.request.done=!0,t.processResponseEndOfBody!=null&&queueMicrotask(()=>t.processResponseEndOfBody(e)),t.request.initiatorType!=null&&t.controller.reportTimingSteps()},"processResponseEndOfBodyTask");queueMicrotask(()=>c())},"processResponseEndOfBody");t.processResponse!=null&&queueMicrotask(()=>{t.processResponse(e),t.processResponse=null});let o=e.type==="error"?e:e.internalResponse??e;o.body==null?n():mLs(o.body.stream,()=>{n()})}a(lcr,"fetchFinale");async function QGn(t){let e=t.request,r=null,n=null,o=t.timingInfo;if(e.serviceWorkers,r===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),n=r=await dcr(t),e.responseTainting==="cors"&&z4s(e,r)==="failure")return ll("cors failure");j4s(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&Y4s(e.origin,e.client,e.destination,n)==="blocked"?ll("blocked"):(MGn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=ll("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await PLs(t,r):aX(!1)),r.timingInfo=o,r)}a(QGn,"httpFetch");function PLs(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=G4s(n,MT(r).hash),o==null)return e}catch(c){return Promise.resolve(ll(c))}if(!pat(o))return Promise.resolve(ll("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(ll("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!ucr(r,o))return Promise.resolve(ll('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(ll('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(ll());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!ILs.includes(r.method)){r.method="GET",r.body=null;for(let c of uLs)r.headersList.delete(c)}ucr(MT(r),o)||(r.headersList.delete("authorization",!0),r.headersList.delete("proxy-authorization",!0),r.headersList.delete("cookie",!0),r.headersList.delete("host",!0)),r.body!=null&&(aX(r.body.source!=null),r.body=hat(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=I2e(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),$4s(r,n),UGn(t,!0)}a(PLs,"httpRedirectFetch");async function dcr(t,e=!1,r=!1){let n=t.request,o=null,s=null,c=null,l=null,u=!1;n.window==="no-window"&&n.redirect==="error"?(o=t,s=n):(s=L4s(n),o={...t},o.request=s);let d=n.credentials==="include"||n.credentials==="same-origin"&&n.responseTainting==="basic",f=s.body?s.body.length:null,h=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(h="0"),f!=null&&(h=dat(`${f}`)),h!=null&&!s.headersList.contains("content-length",!0)&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,pcr.is.URL(s.referrer)&&s.headersList.append("referer",dat(s.referrer.href),!0),H4s(s),W4s(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",xLs,!0),s.cache==="default"&&(s.headersList.contains("if-modified-since",!0)||s.headersList.contains("if-none-match",!0)||s.headersList.contains("if-unmodified-since",!0)||s.headersList.contains("if-match",!0)||s.headersList.contains("if-range",!0))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control",!0)&&s.headersList.append("cache-control","max-age=0",!0),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma",!0)||s.headersList.append("pragma","no-cache",!0),s.headersList.contains("cache-control",!0)||s.headersList.append("cache-control","no-cache",!0)),s.headersList.contains("range",!0)&&s.headersList.append("accept-encoding","identity",!0),s.headersList.contains("accept-encoding",!0)||(tLs(MT(s))?s.headersList.append("accept-encoding","br, gzip, deflate",!0):s.headersList.append("accept-encoding","gzip, deflate",!0)),s.headersList.delete("host",!0),d&&!s.headersList.contains("authorization",!0)){let m=null;if(!(aLs(s)&&(s.useURLCredentials===void 0||!RGn(MT(s))))){if(RGn(MT(s))&&e){let{username:g,password:A}=MT(s);m=`Basic ${Buffer.from(`${g}:${A}`).toString("base64")}`}}m!==null&&s.headersList.append("Authorization",m,!1)}if(l==null&&(s.cache="no-store"),s.cache!=="no-store"&&s.cache,c==null){if(s.cache==="only-if-cached")return ll("only if cached");let m=await DLs(o,d,r);!lLs.has(s.method)&&m.status>=200&&m.status<=399,u&&m.status,c==null&&(c=m)}if(c.urlList=[...s.urlList],s.headersList.contains("range",!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=d,c.status===401&&s.responseTainting!=="cors"&&d&&(n.useURLCredentials!==void 0||cLs(n.traversableForUserPrompts))){if(n.body!=null){if(n.body.source==null)return c;n.body=hat(n.body.source)[0]}if(n.useURLCredentials===void 0||e)return gH(t)?T2e(t):c;t.controller.connection.destroy(),c=await dcr(t,!0)}if(c.status===407)return n.window==="no-window"?ll():gH(t)?T2e(t):ll("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(gH(t))return T2e(t);t.controller.connection.destroy(),c=await dcr(t,e,!0)}return c}a(dcr,"httpNetworkOrCacheFetch");async function DLs(t,e=!1,r=!1){aX(!t.controller.connection||t.controller.connection.destroyed),t.controller.connection={abort:null,destroyed:!1,destroy(A,y=!0){this.destroyed||(this.destroyed=!0,y&&this.abort?.(A??new DOMException("The operation was aborted.","AbortError")))}};let n=t.request,o=null,s=t.timingInfo;null==null&&(n.cache="no-store");let l=r?"yes":"no";n.mode;let u=null;if(n.body==null&&t.processRequestEndOfBody)queueMicrotask(()=>t.processRequestEndOfBody());else if(n.body!=null){let A=a(async function*(_){gH(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{gH(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{gH(t)||(_.name==="AbortError"?t.controller.abort():t.controller.terminate(_))},"processBodyError");u=(async function*(){try{for await(let _ of n.body.stream)yield*A(_);y()}catch(_){E(_)}})()}try{let{body:A,status:y,statusText:E,headersList:_,socket:v}=await g({body:u});if(v)o=lat({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=lat({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),T2e(t,A)):ll(A)}let d=a(()=>t.controller.resume(),"pullAlgorithm"),f=a(A=>{gH(t)||t.controller.abort(A)},"cancelAlgorithm"),h=new ReadableStream({start(A){t.controller.controller=A},pull:d,cancel:f,type:"bytes"});o.body={stream:h,source:null,length:null},t.controller.resume||t.controller.on("terminated",m),t.controller.resume=async()=>{for(;;){let A,y;try{let{done:_,value:v}=await t.controller.next();if(wGn(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){X4s(t.controller.controller),kLs(t,o);return}if(s.decodedBodySize+=A?.byteLength??0,y){t.controller.terminate(A);return}let E=new Uint8Array(A);if(E.byteLength&&t.controller.controller.enqueue(E),gLs(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){wGn(t)?(o.aborted=!0,uat(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):uat(h)&&t.controller.controller.error(new TypeError("terminated",{cause:J4s(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=MT(n),E=t.controller.dispatcher,_=y.pathname+y.search,v=y.search.length===0&&y.href[y.href.length-y.hash.length-1]==="?";return new Promise((b,T)=>E.dispatch({path:v?`${_}?`:_,origin:y.origin,method:n.method,body:E.isMockActive?n.body&&(n.body.source||n.body.stream):A,headers:n.headersList.entries,maxRedirections:0,upgrade:n.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(w){let{connection:R}=t.controller;s.finalConnectionTimingInfo=rLs(void 0,s.postRedirectStartTime,t.crossOriginIsolatedCapability),R.destroyed?w(new DOMException("The operation was aborted.","AbortError")):(t.controller.on("terminated",w),this.abort=R.abort=w),s.finalNetworkRequestStartTime=I2e(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=I2e(t.crossOriginIsolatedCapability)},onHeaders(w,R,x,P){if(w<200)return!1;let D=new scr;for(let M=0;MU)return T(new Error(`too many content-encodings in response: ${O.length}, maximum allowed is ${U}`)),!0;for(let q=O.length-1;q>=0;--q){let Q=O[q].trim();if(Q==="x-gzip"||Q==="gzip")B.push(B2.createGunzip({flush:B2.constants.Z_SYNC_FLUSH,finishFlush:B2.constants.Z_SYNC_FLUSH}));else if(Q==="deflate")B.push(oLs({flush:B2.constants.Z_SYNC_FLUSH,finishFlush:B2.constants.Z_SYNC_FLUSH}));else if(Q==="br")B.push(B2.createBrotliDecompress({flush:B2.constants.BROTLI_OPERATION_FLUSH,finishFlush:B2.constants.BROTLI_OPERATION_FLUSH}));else if(Q==="zstd"&&TLs)B.push(B2.createZstdDecompress({flush:B2.constants.ZSTD_e_continue,finishFlush:B2.constants.ZSTD_e_end}));else{B.length=0;break}}}let j=this.onError.bind(this);return b({status:w,statusText:P,headersList:D,body:B.length?hLs(this.body,...B,M=>{M&&this.onError(M)}).on("error",j):this.body.on("error",j)}),!0},onData(w){if(t.controller.dump)return;let R=w;return s.encodedBodySize+=R.byteLength,this.body.push(R)},onComplete(){this.abort&&t.controller.off("terminated",this.abort),t.controller.ended=!0,this.body.push(null)},onError(w){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(w),t.controller.terminate(w),T(w)},onRequestUpgrade(w,R,x,P){if(P.session!=null&&R!==200||P.session==null&&R!==101)return!1;let D=new scr;for(let[N,L]of Object.entries(x)){if(L==null)continue;let B=N.toLowerCase();if(Array.isArray(L))for(let j of L)D.append(B,String(j),!0);else D.append(B,String(L),!0)}return b({status:R,statusText:DGn[R],headersList:D,socket:P}),!0},onUpgrade(w,R,x){if(x.session!=null&&w!==200||x.session==null&&w!==101)return!1;let P=new scr;for(let D=0;D{"use strict";p();var NLs=require("node:assert"),{URLSerializer:jGn}=jw(),{isValidHeaderName:MLs}=IT();function OLs(t,e,r=!1){let n=jGn(t,r),o=jGn(e,r);return n===o}a(OLs,"urlEquals");function LLs(t){NLs(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),MLs(r)&&e.push(r);return e}a(LLs,"getFieldValues");HGn.exports={urlEquals:OLs,getFieldValues:LLs}});var zGn=I((Gpf,WGn)=>{"use strict";p();var hcr=require("node:assert"),{kConstruct:BLs}=al(),{urlEquals:FLs,getFieldValues:mcr}=GGn(),{kEnumerableProperty:cX,isDisturbed:ULs}=Po(),{webidl:Jn}=zA(),{cloneResponse:$Gn,fromInnerResponse:QLs,getResponseState:qLs}=S2e(),{Request:w2e,fromInnerRequest:jLs,getRequestState:V5}=$pe(),{fetching:HLs}=x2e(),{urlIsHttpHttpsScheme:mat,readAllBytes:GLs}=IT(),{createDeferredPromise:Vpe}=jPe(),gat=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==BLs&&Jn.illegalConstructor(),Jn.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){Jn.brandCheck(this,t);let n="Cache.match";Jn.argumentLengthCheck(arguments,1,n),e=Jn.converters.RequestInfo(e),r=Jn.converters.CacheQueryOptions(r,n,"options");let o=this.#i(e,r,1);if(o.length!==0)return o[0]}async matchAll(e=void 0,r={}){Jn.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=Jn.converters.RequestInfo(e)),r=Jn.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){Jn.brandCheck(this,t),Jn.argumentLengthCheck(arguments,1,"Cache.add"),e=Jn.converters.RequestInfo(e);let n=[e];return await this.addAll(n)}async addAll(e){Jn.brandCheck(this,t);let r="Cache.addAll";Jn.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw Jn.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=Jn.converters.RequestInfo(m),typeof m=="string")continue;let g=V5(m);if(!mat(g.url)||g.method!=="GET")throw Jn.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=V5(new w2e(m));if(!mat(g.url))throw Jn.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Vpe();s.push(HLs({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(Jn.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=mcr(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(Jn.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let v of s)v.abort();return}}},processResponseEndOfBody(y){if(y.aborted){A.reject(new DOMException("aborted","AbortError"));return}A.resolve(y)}})),n.push(A.promise)}let l=await Promise.all(n),u=[],d=0;for(let m of l){let g={type:"put",request:o[d],response:m};u.push(g),d++}let f=Vpe(),h=null;try{this.#t(u)}catch(m){h=m}return queueMicrotask(()=>{h===null?f.resolve(void 0):f.reject(h)}),f.promise}async put(e,r){Jn.brandCheck(this,t);let n="Cache.put";Jn.argumentLengthCheck(arguments,2,n),e=Jn.converters.RequestInfo(e),r=Jn.converters.Response(r,n,"response");let o=null;if(Jn.is.Request(e)?o=V5(e):o=V5(new w2e(e)),!mat(o.url)||o.method!=="GET")throw Jn.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=qLs(r);if(s.status===206)throw Jn.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=mcr(s.headersList.get("vary"));for(let A of g)if(A==="*")throw Jn.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(ULs(s.body.stream)||s.body.stream.locked))throw Jn.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=$Gn(s),l=Vpe();if(s.body!=null){let A=s.body.stream.getReader();GLs(A,l.resolve,l.reject)}else l.resolve(void 0);let u=[],d={type:"put",request:o,response:c};u.push(d);let f=await l.promise;c.body!=null&&(c.body.source=f);let h=Vpe(),m=null;try{this.#t(u)}catch(g){m=g}return queueMicrotask(()=>{m===null?h.resolve():h.reject(m)}),h.promise}async delete(e,r={}){Jn.brandCheck(this,t);let n="Cache.delete";Jn.argumentLengthCheck(arguments,1,n),e=Jn.converters.RequestInfo(e),r=Jn.converters.CacheQueryOptions(r,n,"options");let o=null;if(Jn.is.Request(e)){if(o=V5(e),o.method!=="GET"&&!r.ignoreMethod)return!1}else hcr(typeof e=="string"),o=V5(new w2e(e));let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Vpe(),u=null,d;try{d=this.#t(s)}catch(f){u=f}return queueMicrotask(()=>{u===null?l.resolve(!!d?.length):l.reject(u)}),l.promise}async keys(e=void 0,r={}){Jn.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=Jn.converters.RequestInfo(e)),r=Jn.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(Jn.is.Request(e)){if(o=V5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=V5(new w2e(e)));let s=Vpe(),c=[];if(e===void 0)for(let l of this.#e)c.push(l[0]);else{let l=this.#r(o,r);for(let u of l)c.push(u[0])}return queueMicrotask(()=>{let l=[];for(let u of c){let d=jLs(u,void 0,new AbortController().signal,"immutable");l.push(d)}s.resolve(Object.freeze(l))}),s.promise}#t(e){let r=this.#e,n=[...r],o=[],s=[];try{for(let c of e){if(c.type!=="delete"&&c.type!=="put")throw Jn.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw Jn.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#r(c.request,c.options,o).length)throw new DOMException("???","InvalidStateError");let l;if(c.type==="delete"){if(l=this.#r(c.request,c.options),l.length===0)return[];for(let u of l){let d=r.indexOf(u);hcr(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw Jn.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!mat(u.url))throw Jn.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw Jn.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw Jn.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});l=this.#r(c.request);for(let d of l){let f=r.indexOf(d);hcr(f!==-1),r.splice(f,1)}r.push([c.request,c.response]),o.push([c.request,c.response])}s.push([c.request,c.response])}return s}catch(c){throw this.#e.length=0,this.#e=n,c}}#r(e,r,n){let o=[],s=n??this.#e;for(let c of s){let[l,u]=c;this.#n(e,l,u,r)&&o.push(c)}return o}#n(e,r,n=null,o){let s=new URL(e.url),c=new URL(r.url);if(o?.ignoreSearch&&(c.search="",s.search=""),!FLs(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=mcr(n.headersList.get("vary"));for(let u of l){if(u==="*")return!1;let d=r.headersList.get(u),f=e.headersList.get(u);if(d!==f)return!1}return!0}#i(e,r,n=1/0){let o=null;if(e!==void 0)if(Jn.is.Request(e)){if(o=V5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=V5(new w2e(e)));let s=[];if(e===void 0)for(let l of this.#e)s.push(l[1]);else{let l=this.#r(o,r);for(let u of l)s.push(u[1])}let c=[];for(let l of s){let u=QLs($Gn(l),"immutable");if(c.push(u),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(gat.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:cX,matchAll:cX,add:cX,addAll:cX,put:cX,delete:cX,keys:cX});var VGn=[{key:"ignoreSearch",converter:Jn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:Jn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:Jn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];Jn.converters.CacheQueryOptions=Jn.dictionaryConverter(VGn);Jn.converters.MultiCacheQueryOptions=Jn.dictionaryConverter([...VGn,{key:"cacheName",converter:Jn.converters.DOMString}]);Jn.converters.Response=Jn.interfaceConverter(Jn.is.Response,"Response");Jn.converters["sequence"]=Jn.sequenceConverter(Jn.converters.RequestInfo);WGn.exports={Cache:gat}});var KGn=I((Wpf,YGn)=>{"use strict";p();var{Cache:Aat}=zGn(),{webidl:xE}=zA(),{kEnumerableProperty:R2e}=Po(),{kConstruct:k2e}=al(),yat=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==k2e&&xE.illegalConstructor(),xE.util.markAsUncloneable(this)}async match(e,r={}){if(xE.brandCheck(this,t),xE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=xE.converters.RequestInfo(e),r=xE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new Aat(k2e,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new Aat(k2e,n).match(e,r);if(s!==void 0)return s}}async has(e){xE.brandCheck(this,t);let r="CacheStorage.has";return xE.argumentLengthCheck(arguments,1,r),e=xE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){xE.brandCheck(this,t);let r="CacheStorage.open";if(xE.argumentLengthCheck(arguments,1,r),e=xE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new Aat(k2e,o)}let n=[];return this.#e.set(e,n),new Aat(k2e,n)}async delete(e){xE.brandCheck(this,t);let r="CacheStorage.delete";return xE.argumentLengthCheck(arguments,1,r),e=xE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return xE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(yat.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:R2e,has:R2e,open:R2e,delete:R2e,keys:R2e});YGn.exports={CacheStorage:yat}});var ZGn=I((Kpf,JGn)=>{"use strict";p();JGn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var gcr=I((Zpf,n$n)=>{"use strict";p();function $Ls(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a($Ls,"isCTLExcludingHtab");function XGn(t){for(let e=0;e126||r===34||r===40||r===41||r===60||r===62||r===64||r===44||r===59||r===58||r===92||r===47||r===91||r===93||r===63||r===61||r===123||r===125)throw new Error("Invalid cookie name")}}a(XGn,"validateCookieName");function e$n(t){let e=t.length,r=0;if(t[0]==='"'){if(e===1||t[e-1]!=='"')throw new Error("Invalid cookie value");--e,++r}for(;r126||n===34||n===44||n===59||n===92)throw new Error("Invalid cookie value")}}a(e$n,"validateCookieValue");function t$n(t){for(let e=0;ee.toString().padStart(2,"0"));function r$n(t){return typeof t=="number"&&(t=new Date(t)),`${WLs[t.getUTCDay()]}, ${Eat[t.getUTCDate()]} ${zLs[t.getUTCMonth()]} ${t.getUTCFullYear()} ${Eat[t.getUTCHours()]}:${Eat[t.getUTCMinutes()]}:${Eat[t.getUTCSeconds()]} GMT`}a(r$n,"toIMFDate");function YLs(t){if(t<0)throw new Error("Invalid cookie max-age")}a(YLs,"validateCookieMaxAge");function KLs(t){if(t.name.length===0)return null;XGn(t.name),e$n(t.value);let e=[`${t.name}=${t.value}`];t.name.startsWith("__Secure-")&&(t.secure=!0),t.name.startsWith("__Host-")&&(t.secure=!0,t.domain=null,t.path="/"),t.secure&&e.push("Secure"),t.httpOnly&&e.push("HttpOnly"),typeof t.maxAge=="number"&&(YLs(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(VLs(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(t$n(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${r$n(t.expires)}`),t.sameSite&&e.push(`SameSite=${t.sameSite}`);for(let r of t.unparsed){if(!r.includes("="))throw new Error("Invalid unparsed");let[n,...o]=r.split("=");e.push(`${n.trim()}=${o.join("=")}`)}return e.join("; ")}a(KLs,"stringify");n$n.exports={isCTLExcludingHtab:$Ls,validateCookieName:XGn,validateCookiePath:t$n,validateCookieValue:e$n,toIMFDate:r$n,stringify:KLs}});var o$n=I((thf,i$n)=>{"use strict";p();var{collectASequenceOfCodePointsFast:_at}=XF(),{maxNameValuePairSize:JLs,maxAttributeValueSize:ZLs}=ZGn(),{isCTLExcludingHtab:XLs}=gcr(),eBs=require("node:assert");function tBs(t){if(XLs(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=_at(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=_at("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>JLs?null:{name:n,value:o,...Wpe(r)}}a(tBs,"parseSetCookie");function Wpe(t,e={}){if(t.length===0)return e;eBs(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=_at(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=_at("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>ZLs)return Wpe(t,e);let s=n.toLowerCase();if(s==="expires"){let c=new Date(o);e.expires=c}else if(s==="max-age"){let c=o.charCodeAt(0);if((c<48||c>57)&&o[0]!=="-"||!/^\d+$/.test(o))return Wpe(t,e);let l=Number(o);e.maxAge=l}else if(s==="domain"){let c=o;c[0]==="."&&(c=c.slice(1)),c=c.toLowerCase(),e.domain=c}else if(s==="path"){let c="";o.length===0||o[0]!=="/"?c="/":c=o,e.path=c}else if(s==="secure")e.secure=!0;else if(s==="httponly")e.httpOnly=!0;else if(s==="samesite"){let c=o.toLowerCase();c==="none"?e.sameSite="None":c==="strict"?e.sameSite="Strict":c==="lax"&&(e.sameSite="Lax")}else e.unparsed??=[],e.unparsed.push(`${n}=${o}`);return Wpe(t,e)}a(Wpe,"parseUnparsedAttributes");i$n.exports={parseSetCookie:tBs,parseUnparsedAttributes:Wpe}});var l$n=I((ihf,c$n)=>{"use strict";p();var{parseSetCookie:s$n}=o$n(),{stringify:rBs}=gcr(),{webidl:Za}=zA(),{Headers:nBs}=iX(),vat=Za.brandCheckMultiple([nBs,globalThis.Headers].filter(Boolean));function iBs(t){Za.argumentLengthCheck(arguments,1,"getCookies"),vat(t);let e=t.get("cookie"),r={};if(!e)return r;for(let n of e.split(";")){let[o,...s]=n.split("=");r[o.trim()]=s.join("=")}return r}a(iBs,"getCookies");function oBs(t,e,r){vat(t);let n="deleteCookie";Za.argumentLengthCheck(arguments,2,n),e=Za.converters.DOMString(e,n,"name"),r=Za.converters.DeleteCookieAttributes(r),a$n(t,{name:e,value:"",expires:new Date(0),...r})}a(oBs,"deleteCookie");function sBs(t){Za.argumentLengthCheck(arguments,1,"getSetCookies"),vat(t);let e=t.getSetCookie();return e?e.map(r=>s$n(r)):[]}a(sBs,"getSetCookies");function aBs(t){return t=Za.converters.DOMString(t),s$n(t)}a(aBs,"parseCookie");function a$n(t,e){Za.argumentLengthCheck(arguments,2,"setCookie"),vat(t),e=Za.converters.Cookie(e);let r=rBs(e);r&&t.append("set-cookie",r,!0)}a(a$n,"setCookie");Za.converters.DeleteCookieAttributes=Za.dictionaryConverter([{converter:Za.nullableConverter(Za.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Za.nullableConverter(Za.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);Za.converters.Cookie=Za.dictionaryConverter([{converter:Za.converters.DOMString,key:"name"},{converter:Za.converters.DOMString,key:"value"},{converter:Za.nullableConverter(t=>typeof t=="number"?Za.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:Za.nullableConverter(Za.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:Za.nullableConverter(Za.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:Za.nullableConverter(Za.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Za.nullableConverter(Za.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:Za.nullableConverter(Za.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:Za.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:Za.sequenceConverter(Za.converters.DOMString),key:"unparsed",defaultValue:a(()=>[],"defaultValue")}]);c$n.exports={getCookies:iBs,deleteCookie:oBs,getSetCookies:sBs,setCookie:a$n,parseCookie:aBs}});var Sat=I((ahf,d$n)=>{"use strict";p();var{webidl:ci}=zA(),{kEnumerableProperty:vb}=Po(),{kConstruct:u$n}=al(),zpe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===u$n){super(arguments[1],arguments[2]),ci.util.markAsUncloneable(this);return}let n="MessageEvent constructor";ci.argumentLengthCheck(arguments,1,n),e=ci.converters.DOMString(e,n,"type"),r=ci.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,ci.util.markAsUncloneable(this)}get data(){return ci.brandCheck(this,t),this.#e.data}get origin(){return ci.brandCheck(this,t),this.#e.origin}get lastEventId(){return ci.brandCheck(this,t),this.#e.lastEventId}get source(){return ci.brandCheck(this,t),this.#e.source}get ports(){return ci.brandCheck(this,t),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,r=!1,n=!1,o=null,s="",c="",l=null,u=[]){return ci.brandCheck(this,t),ci.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new t(e,{bubbles:r,cancelable:n,data:o,origin:s,lastEventId:c,source:l,ports:u})}static createFastMessageEvent(e,r){let n=new t(u$n,e,r);return n.#e=r,n.#e.data??=null,n.#e.origin??="",n.#e.lastEventId??="",n.#e.source??=null,n.#e.ports??=[],n}},{createFastMessageEvent:cBs}=zpe;delete zpe.createFastMessageEvent;var Cat=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";ci.argumentLengthCheck(arguments,1,n),e=ci.converters.DOMString(e,n,"type"),r=ci.converters.CloseEventInit(r),super(e,r),this.#e=r,ci.util.markAsUncloneable(this)}get wasClean(){return ci.brandCheck(this,t),this.#e.wasClean}get code(){return ci.brandCheck(this,t),this.#e.code}get reason(){return ci.brandCheck(this,t),this.#e.reason}},bat=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";ci.argumentLengthCheck(arguments,1,n),super(e,r),ci.util.markAsUncloneable(this),e=ci.converters.DOMString(e,n,"type"),r=ci.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return ci.brandCheck(this,t),this.#e.message}get filename(){return ci.brandCheck(this,t),this.#e.filename}get lineno(){return ci.brandCheck(this,t),this.#e.lineno}get colno(){return ci.brandCheck(this,t),this.#e.colno}get error(){return ci.brandCheck(this,t),this.#e.error}};Object.defineProperties(zpe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:vb,origin:vb,lastEventId:vb,source:vb,ports:vb,initMessageEvent:vb});Object.defineProperties(Cat.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:vb,code:vb,wasClean:vb});Object.defineProperties(bat.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:vb,filename:vb,lineno:vb,colno:vb,error:vb});ci.converters.MessagePort=ci.interfaceConverter(ci.is.MessagePort,"MessagePort");ci.converters["sequence"]=ci.sequenceConverter(ci.converters.MessagePort);var Acr=[{key:"bubbles",converter:ci.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:ci.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:ci.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];ci.converters.MessageEventInit=ci.dictionaryConverter([...Acr,{key:"data",converter:ci.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:ci.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:ci.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:ci.nullableConverter(ci.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:ci.converters["sequence"],defaultValue:a(()=>[],"defaultValue")}]);ci.converters.CloseEventInit=ci.dictionaryConverter([...Acr,{key:"wasClean",converter:ci.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:ci.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:ci.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);ci.converters.ErrorEventInit=ci.dictionaryConverter([...Acr,{key:"message",converter:ci.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:ci.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:ci.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:ci.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:ci.converters.any}]);d$n.exports={MessageEvent:zpe,CloseEvent:Cat,ErrorEvent:bat,createFastMessageEvent:cBs}});var AH=I((uhf,f$n)=>{"use strict";p();var lBs="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",uBs={enumerable:!0,writable:!1,configurable:!1},dBs={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},fBs={SENT:1,RECEIVED:2},pBs={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},hBs=65535,mBs={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},gBs=Buffer.allocUnsafe(0),ABs={text:1,typedArray:2,arrayBuffer:3,blob:4};f$n.exports={uid:lBs,sentCloseFrameState:fBs,staticPropertyDescriptors:uBs,states:dBs,opcodes:pBs,maxUnsigned16Bit:hBs,parserStates:mBs,emptyBuffer:gBs,sendHints:ABs}});var lX=I((fhf,A$n)=>{"use strict";p();var{states:Tat,opcodes:Ype}=AH(),{isUtf8:yBs}=require("node:buffer"),{removeHTTPWhitespace:p$n}=jw(),{collectASequenceOfCodePointsFast:EBs}=XF();function _Bs(t){return t===Tat.CONNECTING}a(_Bs,"isConnecting");function vBs(t){return t===Tat.OPEN}a(vBs,"isEstablished");function CBs(t){return t===Tat.CLOSING}a(CBs,"isClosing");function bBs(t){return t===Tat.CLOSED}a(bBs,"isClosed");function SBs(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(SBs,"fireEvent");function TBs(t,e,r){t.onMessage(e,r)}a(TBs,"websocketMessageReceived");function IBs(t){return t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}a(IBs,"toArrayBuffer");function xBs(t){if(t.length===0)return!1;for(let e=0;e126||r===34||r===40||r===41||r===44||r===47||r===58||r===59||r===60||r===61||r===62||r===63||r===64||r===91||r===92||r===93||r===123||r===125)return!1}return!0}a(xBs,"isValidSubprotocol");function wBs(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(wBs,"isValidStatusCode");function h$n(t){return t===Ype.CLOSE||t===Ype.PING||t===Ype.PONG}a(h$n,"isControlFrame");function m$n(t){return t===Ype.CONTINUATION}a(m$n,"isContinuationFrame");function g$n(t){return t===Ype.TEXT||t===Ype.BINARY}a(g$n,"isTextBinaryFrame");function RBs(t){return g$n(t)||m$n(t)||h$n(t)}a(RBs,"isValidOpcode");function kBs(t){let e={position:0},r=new Map;for(;e.position57)return!1}let e=Number.parseInt(t,10);return e>=8&&e<=15}a(PBs,"isValidClientWindowBits");function DBs(t,e){let r;try{r=new URL(t,e)}catch(n){throw new DOMException(n,"SyntaxError")}if(r.protocol==="http:"?r.protocol="ws:":r.protocol==="https:"&&(r.protocol="wss:"),r.protocol!=="ws:"&&r.protocol!=="wss:")throw new DOMException("expected a ws: or wss: url","SyntaxError");if(r.hash.length||r.href.endsWith("#"))throw new DOMException("hash","SyntaxError");return r}a(DBs,"getURLRecord");function NBs(t,e){if(t!==null&&t!==1e3&&(t<3e3||t>4999))throw new DOMException("invalid code","InvalidAccessError");if(e!==null){let r=Buffer.byteLength(e);if(r>123)throw new DOMException(`Reason must be less than 123 bytes; received ${r}`,"SyntaxError")}}a(NBs,"validateCloseCodeAndReason");var MBs=(()=>{if(typeof process.versions.icu=="string"){let t=new TextDecoder("utf-8",{fatal:!0});return t.decode.bind(t)}return function(t){if(yBs(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();A$n.exports={isConnecting:_Bs,isEstablished:vBs,isClosing:CBs,isClosed:bBs,fireEvent:SBs,isValidSubprotocol:xBs,isValidStatusCode:wBs,websocketMessageReceived:TBs,utf8Decode:MBs,isControlFrame:h$n,isContinuationFrame:m$n,isTextBinaryFrame:g$n,isValidOpcode:RBs,parseExtensions:kBs,isValidClientWindowBits:PBs,toArrayBuffer:IBs,getURLRecord:DBs,validateCloseCodeAndReason:NBs}});var Jpe=I((mhf,E$n)=>{"use strict";p();var{runtimeFeatures:OBs}=e8(),{maxUnsigned16Bit:y$n,opcodes:LBs}=AH(),Iat=8*1024,P2e=null,Kpe=Iat,BBs=OBs.has("crypto")?require("node:crypto").randomFillSync:a(function(e,r,n){for(let o=0;oy$n?(c+=8,s=127):o>125&&(c+=2,s=126);let l=Buffer.allocUnsafe(o+c);l[0]=l[1]=0,l[0]|=128,l[0]=(l[0]&240)+e;l[c-4]=n[0],l[c-3]=n[1],l[c-2]=n[2],l[c-1]=n[3],l[1]=s,s===126?l.writeUInt16BE(o,2):s===127&&(l[2]=l[3]=0,l.writeUIntBE(o,4,6)),l[1]|=128;for(let u=0;uy$n?(s+=8,o=127):n>125&&(s+=2,o=126);let c=Buffer.allocUnsafeSlow(s);return c[0]=128|LBs.TEXT,c[1]=o|128,c[s-4]=r[0],c[s-3]=r[1],c[s-2]=r[2],c[s-1]=r[3],o===126?c.writeUInt16BE(n,2):o===127&&(c[2]=c[3]=0,c.writeUIntBE(n,4,6)),[c,e]}};E$n.exports={WebsocketFrameSend:Ecr,generateMask:ycr}});var xat=I((yhf,T$n)=>{"use strict";p();var{uid:FBs,states:_cr,sentCloseFrameState:vcr,emptyBuffer:_$n,opcodes:UBs}=AH(),{parseExtensions:QBs,isClosed:qBs,isClosing:jBs,isEstablished:b$n,isConnecting:HBs,validateCloseCodeAndReason:GBs}=lX(),{makeRequest:$Bs}=$pe(),{fetching:VBs}=x2e(),{Headers:WBs,getHeadersList:zBs}=iX(),{getDecodeSplit:YBs}=IT(),{WebsocketFrameSend:KBs}=Jpe(),JBs=require("node:assert"),{runtimeFeatures:ZBs}=e8(),v$n=ZBs.has("crypto")?require("node:crypto"):null,C$n=!1;function XBs(t,e,r,n,o){let s=t;s.protocol=t.protocol==="ws:"?"http:":"https:";let c=$Bs({urlList:[s],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error",useURLCredentials:!0});if(o.headers){let f=zBs(new WBs(o.headers));c.headersList=f}let l=v$n.randomBytes(16).toString("base64");c.headersList.append("sec-websocket-key",l,!0),c.headersList.append("sec-websocket-version","13",!0);for(let f of e)c.headersList.append("sec-websocket-protocol",f,!0);return c.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits",!0),VBs({request:c,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(f){if(f.type==="error"||f.status!==101){if(f.socket?.session==null){W5(n,1002,"Received network error or non-101 status code.",f.error);return}if(f.status!==200){W5(n,1002,"Received network error or non-200 status code.",f.error);return}}if(C$n===!1&&f.socket?.session!=null&&(process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.","ExperimentalWarning"),C$n=!0),e.length!==0&&!f.headersList.get("Sec-WebSocket-Protocol")){W5(n,1002,"Server did not respond with sent protocols.");return}if(f.socket.session==null&&f.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){W5(n,1002,'Server did not set Upgrade header to "websocket".');return}if(f.socket.session==null&&f.headersList.get("Connection")?.toLowerCase()!=="upgrade"){W5(n,1002,'Server did not set Connection header to "upgrade".');return}let h=f.headersList.get("Sec-WebSocket-Accept"),m=v$n.hash("sha1",l+FBs,"base64");if(h!==m){W5(n,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let g=f.headersList.get("Sec-WebSocket-Extensions"),A;if(g!==null&&(A=QBs(g),!A.has("permessage-deflate"))){W5(n,1002,"Sec-WebSocket-Extensions header does not match.");return}let y=f.headersList.get("Sec-WebSocket-Protocol");if(y!==null&&!YBs("sec-websocket-protocol",c.headersList).includes(y)){W5(n,1002,"Protocol was not set in the opening handshake.");return}f.socket.on("data",n.onSocketData),f.socket.on("close",n.onSocketClose),f.socket.on("error",n.onSocketError),n.wasEverConnected=!0,n.onConnectionEstablished(f,A)}})}a(XBs,"establishWebSocketConnection");function S$n(t,e,r,n=!1){if(e??=null,r??="",n&&GBs(e,r),!(qBs(t.readyState)||jBs(t.readyState)))if(!b$n(t.readyState))W5(t),t.readyState=_cr.CLOSING;else if(!t.closeState.has(vcr.SENT)&&!t.closeState.has(vcr.RECEIVED)){let o=new KBs;r.length!==0&&e===null&&(e=1e3),JBs(e===null||Number.isInteger(e)),e===null&&r.length===0?o.frameData=_$n:e!==null&&r===null?(o.frameData=Buffer.allocUnsafe(2),o.frameData.writeUInt16BE(e,0)):e!==null&&r!==null?(o.frameData=Buffer.allocUnsafe(2+Buffer.byteLength(r)),o.frameData.writeUInt16BE(e,0),o.frameData.write(r,2,"utf-8")):o.frameData=_$n,t.socket.write(o.createFrame(UBs.CLOSE)),t.closeState.add(vcr.SENT),t.readyState=_cr.CLOSING}else t.readyState=_cr.CLOSING}a(S$n,"closeWebSocketConnection");function W5(t,e,r,n){b$n(t.readyState)&&S$n(t,e,r,!1),t.controller.abort(),HBs(t.readyState)?t.onSocketClose():t.socket?.destroyed===!1&&t.socket.destroy()}a(W5,"failWebsocketConnection");T$n.exports={establishWebSocketConnection:XBs,failWebsocketConnection:W5,closeWebSocketConnection:S$n}});var x$n=I((vhf,I$n)=>{"use strict";p();var{createInflateRaw:e3s,Z_DEFAULT_WINDOWBITS:t3s}=require("node:zlib"),{isValidClientWindowBits:r3s}=lX(),{MessageSizeExceededError:n3s}=so(),i3s=Buffer.from([0,0,255,255]),wat=Symbol("kBuffer"),D2e=Symbol("kLength"),Ccr=class{static{a(this,"PerMessageDeflate")}#e;#t={};#r=0;constructor(e,r){this.#t.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=e.get("server_max_window_bits"),this.#r=r.maxPayloadSize}decompress(e,r,n){if(!this.#e){let o=t3s;if(this.#t.serverMaxWindowBits){if(!r3s(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=e3s({windowBits:o})}catch(s){n(s);return}this.#e[wat]=[],this.#e[D2e]=0,this.#e.on("data",s=>{if(this.#e[D2e]+=s.length,this.#r>0&&this.#e[D2e]>this.#r){n(new n3s),this.#e.removeAllListeners(),this.#e=null;return}this.#e[wat].push(s)}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#e.write(e),r&&this.#e.write(i3s),this.#e.flush(()=>{if(!this.#e)return;let o=Buffer.concat(this.#e[wat],this.#e[D2e]);this.#e[wat].length=0,this.#e[D2e]=0,n(null,o)})}};I$n.exports={PerMessageDeflate:Ccr}});var Icr=I((Shf,D$n)=>{"use strict";p();var{Writable:o3s}=require("node:stream"),s3s=require("node:assert"),{parserStates:Cb,opcodes:Zpe,states:a3s,emptyBuffer:w$n,sentCloseFrameState:N2e}=AH(),{isValidStatusCode:c3s,isValidOpcode:l3s,websocketMessageReceived:R$n,utf8Decode:u3s,isControlFrame:bcr,isTextBinaryFrame:Scr,isContinuationFrame:d3s}=lX(),{failWebsocketConnection:wE}=xat(),{WebsocketFrameSend:k$n}=Jpe(),{PerMessageDeflate:f3s}=x$n(),{MessageSizeExceededError:P$n}=so(),Tcr=class extends o3s{static{a(this,"ByteParser")}#e=[];#t=0;#r=0;#n=!1;#i=Cb.INFO;#o={};#s=[];#a;#c;#u;#l;constructor(e,r,n={}){super(),this.#c=e,this.#a=r??new Map,this.#u=n.maxFragments??0,this.#l=n.maxPayloadSize??0,this.#a.has("permessage-deflate")&&this.#a.set("permessage-deflate",new f3s(r,n))}_write(e,r,n){this.#e.push(e),this.#r+=e.length,this.#n=!0,this.run(n)}#p(){return this.#l>0&&!bcr(this.#o.opcode)&&this.#o.payloadLength+this.#t>this.#l?(wE(this.#c,1009,"Payload size exceeds maximum allowed size"),!1):!0}run(e){for(;this.#n;)if(this.#i===Cb.INFO){if(this.#r<2)return e();let r=this.consume(2),n=(r[0]&128)!==0,o=r[0]&15,s=(r[1]&128)===128,c=!n&&o!==Zpe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!l3s(o))return wE(this.#c,1002,"Invalid opcode received"),e();if(s)return wE(this.#c,1002,"Frame cannot be masked"),e();if(u!==0&&!this.#a.has("permessage-deflate")){wE(this.#c,1002,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){wE(this.#c,1002,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!Scr(o)){wE(this.#c,1002,"Invalid frame type was fragmented.");return}if(Scr(o)&&this.#s.length>0){wE(this.#c,1002,"Expected continuation frame");return}if(this.#o.fragmented&&c){wE(this.#c,1002,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&bcr(o)){wE(this.#c,1002,"Control frame either too large or fragmented");return}if(d3s(o)&&this.#s.length===0&&!this.#o.compressed){wE(this.#c,1002,"Unexpected continuation frame");return}if(l<=125){if(this.#o.payloadLength=l,this.#i=Cb.READ_DATA,!this.#p())return}else l===126?this.#i=Cb.PAYLOADLENGTH_16:l===127&&(this.#i=Cb.PAYLOADLENGTH_64);Scr(o)&&(this.#o.binaryType=o,this.#o.compressed=u!==0),this.#o.opcode=o,this.#o.masked=s,this.#o.fin=n,this.#o.fragmented=c}else if(this.#i===Cb.PAYLOADLENGTH_16){if(this.#r<2)return e();let r=this.consume(2);if(this.#o.payloadLength=r.readUInt16BE(0),this.#i=Cb.READ_DATA,!this.#p())return}else if(this.#i===Cb.PAYLOADLENGTH_64){if(this.#r<8)return e();let r=this.consume(8),n=r.readUInt32BE(0),o=r.readUInt32BE(4);if(n!==0||o>2**31-1){wE(this.#c,1009,"Received payload length > 2^31 bytes.");return}if(this.#o.payloadLength=o,this.#i=Cb.READ_DATA,!this.#p())return}else if(this.#i===Cb.READ_DATA){if(this.#r{if(n){let s=n instanceof P$n?1009:1007;wE(this.#c,s,n.message);return}if(this.writeFragments(o)){if(this.#l>0&&this.#t>this.#l){wE(this.#c,1009,new P$n().message);return}if(!this.#o.fin){this.#i=Cb.INFO,this.#n=!0,this.run(e);return}R$n(this.#c,this.#o.binaryType,this.consumeFragments()),this.#n=!0,this.#i=Cb.INFO,this.run(e)}},this.#t),this.#n=!1;break}else{if(!this.writeFragments(r))return;!this.#o.fragmented&&this.#o.fin&&R$n(this.#c,this.#o.binaryType,this.consumeFragments()),this.#i=Cb.INFO}}}consume(e){if(e>this.#r)throw new Error("Called consume() before buffers satiated.");if(e===0)return w$n;this.#r-=e;let r=this.#e[0];if(r.length>e)return this.#e[0]=r.subarray(e,r.length),r.subarray(0,e);if(r.length===e)return this.#e.shift();{let n=0,o=Buffer.allocUnsafeSlow(e);for(;n!==e;){let s=this.#e[0],c=s.length;if(c+n===e){o.set(this.#e.shift(),n);break}else if(c+n>e){o.set(s.subarray(0,e-n),n),this.#e[0]=s.subarray(e-n);break}else o.set(this.#e.shift(),n),n+=c}return o}}writeFragments(e){return this.#u>0&&this.#s.length===this.#u?(wE(this.#c,1008,"Too many message fragments"),!1):(this.#t+=e.length,this.#s.push(e),!0)}consumeFragments(){let e=this.#s;if(e.length===1)return this.#t=0,e.shift();let r=0,n=Buffer.allocUnsafeSlow(this.#t);for(let o=0;o=2&&(r=e.readUInt16BE(0)),r!==void 0&&!c3s(r))return{code:1002,reason:"Invalid status code",error:!0};let n=e.subarray(2);n[0]===239&&n[1]===187&&n[2]===191&&(n=n.subarray(3));try{n=u3s(n)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:r,reason:n,error:!1}}parseControlFrame(e){let{opcode:r,payloadLength:n}=this.#o;if(r===Zpe.CLOSE){if(n===1)return wE(this.#c,1002,"Received close frame with a 1-byte body."),!1;if(this.#o.closeInfo=this.parseCloseBody(e),this.#o.closeInfo.error){let{code:o,reason:s}=this.#o.closeInfo;return wE(this.#c,o,s),!1}if(!this.#c.closeState.has(N2e.SENT)&&!this.#c.closeState.has(N2e.RECEIVED)){let o=w$n;this.#o.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#o.closeInfo.code,0));let s=new k$n(o);this.#c.socket.write(s.createFrame(Zpe.CLOSE)),this.#c.closeState.add(N2e.SENT)}return this.#c.readyState=a3s.CLOSING,this.#c.closeState.add(N2e.RECEIVED),!1}else if(r===Zpe.PING){if(!this.#c.closeState.has(N2e.RECEIVED)){let o=new k$n(e);this.#c.socket.write(o.createFrame(Zpe.PONG)),this.#c.onPing(e)}}else r===Zpe.PONG&&this.#c.onPong(e);return!0}get closingInfo(){return this.#o.closeInfo}};D$n.exports={ByteParser:Tcr}});var L$n=I((xhf,O$n)=>{"use strict";p();var{WebsocketFrameSend:M$n}=Jpe(),{opcodes:N$n,sendHints:uX}=AH(),p3s=esr(),wcr=class{static{a(this,"SendQueue")}#e=new p3s;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==uX.blob){if(this.#t){let s={promise:null,callback:r,frame:xcr(e,n)};this.#e.push(s)}else if(n===uX.text){let{0:s,1:c}=M$n.createFastTextFrame(e);this.#r.cork(),this.#r.write(s),this.#r.write(c,r),this.#r.uncork()}else this.#r.write(xcr(e,n),r);return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=xcr(s,n)}),callback:r,frame:null};this.#e.push(o),this.#t||this.#n()}async#n(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let r=e.shift();r.promise!==null&&await r.promise,this.#r.write(r.frame,r.callback),r.callback=r.frame=null}this.#t=!1}};function xcr(t,e){return new M$n(h3s(t,e)).createFrame(e===uX.text?N$n.TEXT:N$n.BINARY)}a(xcr,"createFrame");function h3s(t,e){switch(e){case uX.text:case uX.typedArray:return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);case uX.arrayBuffer:case uX.blob:return new Uint8Array(t)}}a(h3s,"toBuffer");O$n.exports={SendQueue:wcr}});var j$n=I((khf,q$n)=>{"use strict";p();var{isArrayBuffer:m3s}=require("node:util/types"),{webidl:mi}=zA(),{URLSerializer:g3s}=jw(),{environmentSettingsObject:B$n}=IT(),{staticPropertyDescriptors:yH,states:d8,sentCloseFrameState:Rcr,sendHints:Rat,opcodes:kcr}=AH(),{isConnecting:A3s,isEstablished:F$n,isClosing:U$n,isClosed:y3s,isValidSubprotocol:E3s,fireEvent:kat,utf8Decode:_3s,toArrayBuffer:v3s,getURLRecord:C3s}=lX(),{establishWebSocketConnection:b3s,closeWebSocketConnection:S3s,failWebsocketConnection:Q$n}=xat(),{ByteParser:T3s}=Icr(),{kEnumerableProperty:Kw}=Po(),{getGlobalDispatcher:I3s}=zst(),{ErrorEvent:x3s,CloseEvent:w3s,createFastMessageEvent:R3s}=Sat(),{SendQueue:k3s}=L$n(),{WebsocketFrameSend:P3s}=Jpe(),{channels:z5}=Jj();function D3s(t){return typeof t?.address=="function"?t.address():typeof t?.session?.socket?.address=="function"?t.session.socket.address():null}a(D3s,"getSocketAddress");var mv=class t extends EventTarget{static{a(this,"WebSocket")}#e={open:null,error:null,close:null,message:null};#t=0;#r="";#n="";#i;#o={onConnectionEstablished:a((e,r)=>this.#u(e,r),"onConnectionEstablished"),onMessage:a((e,r)=>this.#l(e,r),"onMessage"),onParserError:a(e=>Q$n(this.#o,null,e.message),"onParserError"),onParserDrain:a(()=>this.#p(),"onParserDrain"),onSocketData:a(e=>{this.#c.write(e)||this.#o.socket.pause()},"onSocketData"),onSocketError:a(e=>{this.#o.readyState=d8.CLOSING,z5.socketError.hasSubscribers&&z5.socketError.publish(e),this.#o.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(e=>{z5.ping.hasSubscribers&&z5.ping.publish({payload:e,websocket:this})},"onPing"),onPong:a(e=>{z5.pong.hasSubscribers&&z5.pong.publish({payload:e,websocket:this})},"onPong"),readyState:d8.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#s;#a;#c;constructor(e,r=[]){super(),mi.util.markAsUncloneable(this);let n="WebSocket constructor";mi.argumentLengthCheck(arguments,1,n);let o=mi.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=mi.converters.USVString(e),r=o.protocols;let s=B$n.settingsObject.baseUrl,c=C3s(e,s);if(typeof r=="string"&&(r=[r]),r.length!==new Set(r.map(u=>u.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(r.length>0&&!r.every(u=>E3s(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#s=new URL(c.href);let l=B$n.settingsObject;this.#o.controller=b3s(c,r,l,this.#o,o),this.#o.readyState=t.CONNECTING,this.#a="blob"}close(e=void 0,r=void 0){mi.brandCheck(this,t),e!==void 0&&(e=mi.converters["unsigned short"](e,"WebSocket.close","code",mi.attributes.Clamp)),r!==void 0&&(r=mi.converters.USVString(r)),e??=null,r??="",S3s(this.#o,e,r,!0)}send(e){mi.brandCheck(this,t);let r="WebSocket.send";if(mi.argumentLengthCheck(arguments,1,r),e=mi.converters.WebSocketSendData(e,r,"data"),A3s(this.#o.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!F$n(this.#o.readyState)||U$n(this.#o.readyState)))if(typeof e=="string"){let n=Buffer.from(e);this.#t+=n.byteLength,this.#i.add(n,()=>{this.#t-=n.byteLength},Rat.text)}else m3s(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Rat.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Rat.typedArray)):mi.is.Blob(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},Rat.blob))}get readyState(){return mi.brandCheck(this,t),this.#o.readyState}get bufferedAmount(){return mi.brandCheck(this,t),this.#t}get url(){return mi.brandCheck(this,t),g3s(this.#s)}get extensions(){return mi.brandCheck(this,t),this.#n}get protocol(){return mi.brandCheck(this,t),this.#r}get onopen(){return mi.brandCheck(this,t),this.#e.open}set onopen(e){mi.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onerror(){return mi.brandCheck(this,t),this.#e.error}set onerror(e){mi.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}get onclose(){return mi.brandCheck(this,t),this.#e.close}set onclose(e){mi.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("close",r),this.#e.close=e):this.#e.close=null}get onmessage(){return mi.brandCheck(this,t),this.#e.message}set onmessage(e){mi.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message);let r=mi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get binaryType(){return mi.brandCheck(this,t),this.#a}set binaryType(e){mi.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this.#a="blob":this.#a=e}#u(e,r){this.#o.socket=e.socket;let n=this.#o.controller.dispatcher?.webSocketOptions,o=n?.maxFragments,s=n?.maxPayloadSize,c=new T3s(this.#o,r,{maxFragments:o,maxPayloadSize:s});c.on("drain",()=>this.#o.onParserDrain()),c.on("error",d=>this.#o.onParserError(d)),this.#c=c,this.#i=new k3s(e.socket),this.#o.readyState=d8.OPEN;let l=e.headersList.get("sec-websocket-extensions");l!==null&&(this.#n=l);let u=e.headersList.get("sec-websocket-protocol");if(u!==null&&(this.#r=u),kat("open",this),z5.open.hasSubscribers){let d=e.headersList.entries;z5.open.publish({address:D3s(e.socket),protocol:this.#r,extensions:this.#n,websocket:this,handshakeResponse:{status:e.status,statusText:e.statusText,headers:d}})}}#l(e,r){if(this.#o.readyState!==d8.OPEN)return;let n;if(e===kcr.TEXT)try{n=_3s(r)}catch{Q$n(this.#o,1007,"Received invalid UTF-8 in text frame.");return}else e===kcr.BINARY&&(this.#a==="blob"?n=new Blob([r]):n=v3s(r));kat("message",this,R3s,{origin:this.#s.origin,data:n})}#p(){this.#o.socket.resume()}#g(){let e=this.#o.closeState.has(Rcr.SENT)&&this.#o.closeState.has(Rcr.RECEIVED),r=1005,n="",o=this.#c?.closingInfo;o&&!o.error&&(r=o.code??1005,n=o.reason),this.#o.readyState=d8.CLOSED,this.#o.closeState.has(Rcr.RECEIVED)||(r=1006,kat("error",this,(s,c)=>new x3s(s,c),{error:new TypeError(n)})),kat("close",this,(s,c)=>new w3s(s,c),{wasClean:e,code:r,reason:n}),z5.close.hasSubscribers&&z5.close.publish({websocket:this,code:r,reason:n})}static ping(e,r){if(Buffer.isBuffer(r)){if(r.length>125)throw new TypeError("A PING frame cannot have a body larger than 125 bytes.")}else if(r!==void 0)throw new TypeError("Expected buffer payload");let n=e.#o.readyState;if(F$n(n)&&!U$n(n)&&!y3s(n)){let o=new P3s(r);e.#o.socket.write(o.createFrame(kcr.PING))}}},{ping:N3s}=mv;Reflect.deleteProperty(mv,"ping");mv.CONNECTING=mv.prototype.CONNECTING=d8.CONNECTING;mv.OPEN=mv.prototype.OPEN=d8.OPEN;mv.CLOSING=mv.prototype.CLOSING=d8.CLOSING;mv.CLOSED=mv.prototype.CLOSED=d8.CLOSED;Object.defineProperties(mv.prototype,{CONNECTING:yH,OPEN:yH,CLOSING:yH,CLOSED:yH,url:Kw,readyState:Kw,bufferedAmount:Kw,onopen:Kw,onerror:Kw,onclose:Kw,close:Kw,onmessage:Kw,binaryType:Kw,send:Kw,extensions:Kw,protocol:Kw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(mv,{CONNECTING:yH,OPEN:yH,CLOSING:yH,CLOSED:yH});mi.converters["sequence"]=mi.sequenceConverter(mi.converters.DOMString);mi.converters["DOMString or sequence"]=function(t,e,r){return mi.util.Type(t)===mi.util.Types.OBJECT&&Symbol.iterator in t?mi.converters["sequence"](t):mi.converters.DOMString(t,e,r)};mi.converters.WebSocketInit=mi.dictionaryConverter([{key:"protocols",converter:mi.converters["DOMString or sequence"],defaultValue:a(()=>[],"defaultValue")},{key:"dispatcher",converter:mi.converters.any,defaultValue:a(()=>I3s(),"defaultValue")},{key:"headers",converter:mi.nullableConverter(mi.converters.HeadersInit)}]);mi.converters["DOMString or sequence or WebSocketInit"]=function(t){return mi.util.Type(t)===mi.util.Types.OBJECT&&!(Symbol.iterator in t)?mi.converters.WebSocketInit(t):{protocols:mi.converters["DOMString or sequence"](t)}};mi.converters.WebSocketSendData=function(t){return mi.util.Type(t)===mi.util.Types.OBJECT&&(mi.is.Blob(t)||mi.is.BufferSource(t))?t:mi.converters.USVString(t)};q$n.exports={WebSocket:mv,ping:N3s}});var Pcr=I((Nhf,$$n)=>{"use strict";p();var{webidl:Pat}=zA(),{validateCloseCodeAndReason:M3s}=lX(),{kConstruct:H$n}=al(),{kEnumerableProperty:G$n}=Po();function O3s(){class t extends DOMException{static{a(this,"Test")}get reason(){return""}}return new t().reason!==void 0?DOMException:new Proxy(DOMException,{construct(e,r,n){let o=Reflect.construct(e,r,e);return Object.setPrototypeOf(o,n.prototype),o}})}a(O3s,"createInheritableDOMException");var dX=class t extends O3s(){static{a(this,"WebSocketError")}#e;#t;constructor(e="",r=void 0){if(e=Pat.converters.DOMString(e,"WebSocketError","message"),super(e,"WebSocketError"),r===H$n)return;r!==null&&(r=Pat.converters.WebSocketCloseInfo(r));let n=r.closeCode??null,o=r.reason??"";M3s(n,o),o.length!==0&&n===null&&(n=1e3),this.#e=n,this.#t=o}get closeCode(){return this.#e}get reason(){return this.#t}static createUnvalidatedWebSocketError(e,r,n){let o=new t(e,H$n);return o.#e=r,o.#t=n,o}},{createUnvalidatedWebSocketError:L3s}=dX;delete dX.createUnvalidatedWebSocketError;Object.defineProperties(dX.prototype,{closeCode:G$n,reason:G$n,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}});Pat.is.WebSocketError=Pat.util.MakeTypeAssertion(dX);$$n.exports={WebSocketError:dX,createUnvalidatedWebSocketError:L3s}});var K$n=I((Lhf,Y$n)=>{"use strict";p();var{createDeferredPromise:Dcr}=jPe(),{environmentSettingsObject:V$n}=IT(),{states:Xpe,opcodes:Dat,sentCloseFrameState:ehe}=AH(),{webidl:Ep}=zA(),{getURLRecord:B3s,isValidSubprotocol:F3s,isEstablished:U3s,utf8Decode:Q3s}=lX(),{establishWebSocketConnection:q3s,failWebsocketConnection:Ncr,closeWebSocketConnection:Mcr}=xat(),{channels:W$n}=Jj(),{WebsocketFrameSend:j3s}=Jpe(),{ByteParser:H3s}=Icr(),{WebSocketError:G3s,createUnvalidatedWebSocketError:$3s}=Pcr(),{kEnumerableProperty:Nat}=Po(),{utf8DecodeBytes:V3s}=est(),z$n=!1,Mat=class{static{a(this,"WebSocketStream")}#e;#t;#r;#n;#i;#o;#s=!1;#a={onConnectionEstablished:a((e,r)=>this.#l(e,r),"onConnectionEstablished"),onMessage:a((e,r)=>this.#p(e,r),"onMessage"),onParserError:a(e=>Ncr(this.#a,null,e.message),"onParserError"),onParserDrain:a(()=>this.#a.socket.resume(),"onParserDrain"),onSocketData:a(e=>{this.#c.write(e)||this.#a.socket.pause()},"onSocketData"),onSocketError:a(e=>{this.#a.readyState=Xpe.CLOSING,W$n.socketError.hasSubscribers&&W$n.socketError.publish(e),this.#a.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(()=>{},"onPing"),onPong:a(()=>{},"onPong"),readyState:Xpe.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#c;constructor(e,r=void 0){z$n||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),z$n=!0),Ep.argumentLengthCheck(arguments,1,"WebSocket"),e=Ep.converters.USVString(e),r!==null&&(r=Ep.converters.WebSocketStreamOptions(r));let n=V$n.settingsObject.baseUrl,o=B3s(e,n),s=r.protocols;if(s.length!==new Set(s.map(l=>l.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(s.length>0&&!s.every(l=>F3s(l)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#e=o.toString(),this.#t=Dcr(),this.#r=Dcr(),r.signal!=null){let l=r.signal;if(l.aborted){this.#t.reject(l.reason),this.#r.reject(l.reason);return}l.addEventListener("abort",()=>{U3s(this.#a.readyState)||(Ncr(this.#a),this.#a.readyState=Xpe.CLOSING,this.#t.reject(l.reason),this.#r.reject(l.reason),this.#s=!0)},{once:!0})}let c=V$n.settingsObject;this.#a.controller=q3s(o,s,c,this.#a,r)}get url(){return this.#e.toString()}get opened(){return this.#t.promise}get closed(){return this.#r.promise}close(e=void 0){e!==null&&(e=Ep.converters.WebSocketCloseInfo(e));let r=e.closeCode??null,n=e.reason;Mcr(this.#a,r,n,!0)}#u(e){e=Ep.converters.WebSocketStreamWrite(e);let r=Dcr(),n=null,o=null;if(Ep.is.BufferSource(e))n=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),o=Dat.BINARY;else{let s;try{s=Ep.converters.DOMString(e)}catch(c){return r.reject(c),r.promise}n=new TextEncoder().encode(s),o=Dat.TEXT}if(!this.#a.closeState.has(ehe.SENT)&&!this.#a.closeState.has(ehe.RECEIVED)){let s=new j3s(n);this.#a.socket.write(s.createFrame(o),()=>{r.resolve(void 0)})}return r.promise}#l(e,r){this.#a.socket=e.socket;let n=this.#a.controller.dispatcher?.webSocketOptions?.maxFragments,o=this.#a.controller.dispatcher?.webSocketOptions?.maxPayloadSize,s=new H3s(this.#a,r,{maxFragments:n,maxPayloadSize:o});s.on("drain",()=>this.#a.onParserDrain()),s.on("error",f=>this.#a.onParserError(f)),this.#c=s,this.#a.readyState=Xpe.OPEN;let c=r??"",l=e.headersList.get("sec-websocket-protocol")??"",u=new ReadableStream({start:a(f=>{this.#i=f},"start"),cancel:a(f=>this.#h(f),"cancel")}),d=new WritableStream({write:a(f=>this.#u(f),"write"),close:a(()=>Mcr(this.#a,null,null),"close"),abort:a(f=>this.#A(f),"abort")});this.#n=u,this.#o=d,this.#t.resolve({extensions:c,protocol:l,readable:u,writable:d})}#p(e,r){if(this.#a.readyState!==Xpe.OPEN)return;let n;if(e===Dat.TEXT)try{n=Q3s(r)}catch{Ncr(this.#a,1007,"Received invalid UTF-8 in text frame.");return}else e===Dat.BINARY&&(n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));this.#i.enqueue(n)}#g(){let e=this.#a.closeState.has(ehe.SENT)&&this.#a.closeState.has(ehe.RECEIVED);if(this.#a.readyState=Xpe.CLOSED,this.#s)return;this.#a.wasEverConnected||this.#t.reject(new G3s("Socket never opened"));let r=this.#c?.closingInfo,n=r?.code??1005;!this.#a.closeState.has(ehe.SENT)&&!this.#a.closeState.has(ehe.RECEIVED)&&(n=1006);let o=r?.reason==null?"":V3s(Buffer.from(r.reason));if(e)this.#i.close(),this.#o.locked||this.#o.abort(new DOMException("A closed WebSocketStream cannot be written to","InvalidStateError")),this.#r.resolve({closeCode:n,reason:o});else{let s=$3s("unclean close",n,o);this.#i?.error(s),this.#o?.abort(s),this.#r.reject(s)}}#A(e){let r=null,n="";Ep.is.WebSocketError(e)&&(r=e.closeCode,n=e.reason),Mcr(this.#a,r,n)}#h(e){this.#A(e)}};Object.defineProperties(Mat.prototype,{url:Nat,opened:Nat,closed:Nat,close:Nat,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}});Ep.converters.WebSocketStreamOptions=Ep.dictionaryConverter([{key:"protocols",converter:Ep.sequenceConverter(Ep.converters.USVString),defaultValue:a(()=>[],"defaultValue")},{key:"signal",converter:Ep.nullableConverter(Ep.converters.AbortSignal),defaultValue:a(()=>null,"defaultValue")}]);Ep.converters.WebSocketCloseInfo=Ep.dictionaryConverter([{key:"closeCode",converter:a(t=>Ep.converters["unsigned short"](t,Ep.attributes.EnforceRange),"converter")},{key:"reason",converter:Ep.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);Ep.converters.WebSocketStreamWrite=function(t){return typeof t=="string"?Ep.converters.USVString(t):Ep.converters.BufferSource(t)};Y$n.exports={WebSocketStream:Mat}});var Z$n=I((Uhf,J$n)=>{"use strict";p();function W3s(t){return t.indexOf("\0")===-1}a(W3s,"isValidLastEventId");function z3s(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(z3s,"isASCIINumber");J$n.exports={isValidLastEventId:W3s,isASCIINumber:z3s}});var rVn=I((jhf,tVn)=>{"use strict";p();var{Transform:Y3s}=require("node:stream"),{isASCIINumber:X$n,isValidLastEventId:eVn}=Z$n(),f8=[239,187,191],Ocr=10,Oat=13,K3s=58,J3s=32,Lcr=class extends Y3s{static{a(this,"EventSourceStream")}state;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,r,n){if(e.length===0){n();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===f8[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===f8[0]&&this.buffer[1]===f8[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===f8[0]&&this.buffer[1]===f8[1]&&this.buffer[2]===f8[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===f8[0]&&this.buffer[1]===f8[1]&&this.buffer[2]===f8[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&X$n(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id!==void 0&&eVn(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};tVn.exports={EventSourceStream:Lcr}});var uVn=I(($hf,lVn)=>{"use strict";p();var{pipeline:Z3s}=require("node:stream"),{fetching:X3s}=x2e(),{makeRequest:eFs}=$pe(),{webidl:gv}=zA(),{EventSourceStream:tFs}=rVn(),{parseMIMEType:rFs}=jw(),{createFastMessageEvent:nFs}=Sat(),{isNetworkError:nVn}=S2e(),{kEnumerableProperty:fX}=Po(),{environmentSettingsObject:iVn}=IT(),oVn=!1,sVn=3e3,M2e=0,aVn=1,O2e=2,iFs="anonymous",oFs="use-credentials",the=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t;#r=!1;#n=M2e;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),gv.util.markAsUncloneable(this);let n="EventSource constructor";gv.argumentLengthCheck(arguments,1,n),oVn||(oVn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=gv.converters.USVString(e),r=gv.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.node.dispatcher||r.dispatcher,this.#a={lastEventId:"",reconnectionTime:r.node.reconnectionTime};let o=iVn,s;try{s=new URL(e,o.settingsObject.baseUrl),this.#a.origin=s.origin}catch(u){throw new DOMException(u,"SyntaxError")}this.#t=s.href;let c=iFs;r.withCredentials===!0&&(c=oFs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=iVn.settingsObject,l.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],l.cache="no-store",l.initiator="other",l.urlList=[new URL(this.#t)],this.#i=eFs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===O2e)return;this.#n=M2e;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{if(!nVn(n))return this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(nVn(n))if(n.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#u();return}let o=n.headersList.get("content-type",!0),s=o!==null?rFs(o):"failure",c=s!=="failure"&&s.essence==="text/event-stream";if(n.status!==200||c===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#n=aVn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new tFs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(nFs(u.type,u.options))},"push")});Z3s(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=X3s(e)}#u(){this.#n!==O2e&&(this.#n=M2e,this.dispatchEvent(new Event("error")),setTimeout(()=>{this.#n===M2e&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c())},this.#a.reconnectionTime)?.unref())}close(){gv.brandCheck(this,t),this.#n!==O2e&&(this.#n=O2e,this.#o.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open);let r=gv.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message);let r=gv.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error);let r=gv.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}},cVn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:M2e,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:aVn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:O2e,writable:!1}};Object.defineProperties(the,cVn);Object.defineProperties(the.prototype,cVn);Object.defineProperties(the.prototype,{close:fX,onerror:fX,onmessage:fX,onopen:fX,readyState:fX,url:fX,withCredentials:fX});gv.converters.EventSourceInitDict=gv.dictionaryConverter([{key:"withCredentials",converter:gv.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:gv.converters.any},{key:"node",converter:gv.dictionaryConverter([{key:"reconnectionTime",converter:gv.converters["unsigned long"],defaultValue:a(()=>sVn,"defaultValue")},{key:"dispatcher",converter:gv.converters.any}]),defaultValue:a(()=>({}),"defaultValue")}]);lVn.exports={EventSource:the,defaultReconnectionTime:sVn}});var Bcr=I((zhf,vn)=>{"use strict";p();var sFs=sH(),fVn=OPe(),aFs=HZ(),cFs=dQn(),lFs=mQn(),uFs=VZ(),dFs=xsr(),fFs=bsr(),pFs=eqn(),hFs=sqn(),mFs=lqn(),pVn=so(),Bat=Po(),{InvalidArgumentError:Lat}=pVn,rhe=Gqn(),gFs=DZ(),AFs=far(),{MockCallHistory:yFs,MockCallHistoryLog:EFs}=mar(),_Fs=Tar(),vFs=Ear(),CFs=Hjn(),bFs=Ysr(),SFs=Nst(),{getGlobalDispatcher:hVn,setGlobalDispatcher:TFs}=zst(),IFs=Qpe(),xFs=Nar();Object.assign(fVn.prototype,rhe);vn.exports.Dispatcher=fVn;vn.exports.Client=sFs;vn.exports.Pool=aFs;vn.exports.BalancedPool=cFs;vn.exports.RoundRobinPool=lFs;vn.exports.Agent=uFs;vn.exports.ProxyAgent=dFs;vn.exports.Socks5ProxyAgent=fFs;vn.exports.EnvHttpProxyAgent=pFs;vn.exports.RetryAgent=hFs;vn.exports.H2CClient=mFs;vn.exports.RetryHandler=SFs;vn.exports.DecoratorHandler=IFs;vn.exports.RedirectHandler=xFs;vn.exports.interceptors={redirect:eHn(),responseError:rHn(),retry:iHn(),dump:sHn(),dns:uHn(),cache:xHn(),decompress:DHn(),deduplicate:BHn()};vn.exports.cacheStores={MemoryCacheStore:jar()};var wFs=QHn();vn.exports.cacheStores.SqliteCacheStore=wFs;vn.exports.buildConnector=gFs;vn.exports.errors=pVn;vn.exports.util={parseHeaders:Bat.parseHeaders,headerNameToString:Bat.headerNameToString};function L2e(t){return(e,r,n)=>{if(typeof r=="function"&&(n=r,r=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new Lat("invalid url");if(r!=null&&typeof r!="object")throw new Lat("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new Lat("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(Bat.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=Bat.parseURL(e);let{agent:o,dispatcher:s=hVn()}=r;if(o)throw new Lat("unsupported opts.agent. Did you mean opts.client?");return t.call(s,{...r,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:r.method||(r.body?"PUT":"GET")},n)}}a(L2e,"makeDispatcher");vn.exports.setGlobalDispatcher=TFs;vn.exports.getGlobalDispatcher=hVn;var RFs=x2e().fetch,dVn=typeof __filename<"u"?__filename:void 0;function mVn(t,e){if(!t||typeof t!="object")return;let r=typeof t.stack=="string"?t.stack:"",n=e.replace(/\\/g,"/");if(r&&(r.includes(e)||r.includes(n)))return;let o={};if(Error.captureStackTrace(o,mVn),!o.stack)return;let s=o.stack.split(` `).slice(1).join(` `);t.stack=r?`${r} -${s}`:o.stack}a(NGn,"appendFetchStackTrace");vn.exports.fetch=a(function(e,r=void 0){return vBs(e,r).catch(n=>{throw RGn?NGn(n,RGn):n&&typeof n=="object"&&Error.captureStackTrace(n,vn.exports.fetch),n})},"fetch");vn.exports.Headers=zZ().Headers;vn.exports.Response=i2e().Response;vn.exports.Request=kpe().Request;vn.exports.FormData=Dot().FormData;var{setGlobalOrigin:CBs,getGlobalOrigin:bBs}=mir();vn.exports.setGlobalOrigin=CBs;vn.exports.getGlobalOrigin=bBs;var{CacheStorage:SBs}=hHn(),{kConstruct:TBs}=al();vn.exports.caches=new SBs(TBs);var{deleteCookie:IBs,getCookies:xBs,getSetCookies:wBs,setCookie:RBs,parseCookie:kBs}=xHn();vn.exports.deleteCookie=IBs;vn.exports.getCookies=xBs;vn.exports.getSetCookies=wBs;vn.exports.setCookie=RBs;vn.exports.parseCookie=kBs;var{parseMIMEType:PBs,serializeAMimeType:DBs}=Mw();vn.exports.parseMIMEType=PBs;vn.exports.serializeAMimeType=DBs;var{CloseEvent:NBs,ErrorEvent:MBs,MessageEvent:OBs}=Kst(),{WebSocket:LBs,ping:BBs}=sGn();vn.exports.WebSocket=LBs;vn.exports.CloseEvent=NBs;vn.exports.ErrorEvent=MBs;vn.exports.MessageEvent=OBs;vn.exports.ping=BBs;vn.exports.WebSocketStream=hGn().WebSocketStream;vn.exports.WebSocketError=Uar().WebSocketError;vn.exports.request=g2e(qpe.request);vn.exports.stream=g2e(qpe.stream);vn.exports.pipeline=g2e(qpe.pipeline);vn.exports.connect=g2e(qpe.connect);vn.exports.upgrade=g2e(qpe.upgrade);vn.exports.MockClient=lBs;vn.exports.MockCallHistory=uBs;vn.exports.MockCallHistoryLog=dBs;vn.exports.MockPool=pBs;vn.exports.MockAgent=fBs;vn.exports.SnapshotAgent=hBs;vn.exports.mockErrors=mBs;var{EventSource:FBs}=wGn();vn.exports.EventSource=FBs;function UBs(){globalThis.fetch=vn.exports.fetch,globalThis.Headers=vn.exports.Headers,globalThis.Response=vn.exports.Response,globalThis.Request=vn.exports.Request,globalThis.FormData=vn.exports.FormData,globalThis.WebSocket=vn.exports.WebSocket,globalThis.CloseEvent=vn.exports.CloseEvent,globalThis.ErrorEvent=vn.exports.ErrorEvent,globalThis.MessageEvent=vn.exports.MessageEvent,globalThis.EventSource=vn.exports.EventSource}a(UBs,"install");vn.exports.install=UBs});var ZGn,XGn=ve(()=>{p();ZGn=typeof globalThis=="object"?globalThis:global});var e$n=ve(()=>{p();XGn()});var t$n=ve(()=>{p();e$n()});var i8,icr=ve(()=>{p();i8="1.9.0"});function f3s(t){var e=new Set([t]),r=new Set,n=t.match(r$n);if(!n)return function(){return!1};var o={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(o.prerelease!=null)return a(function(u){return u===t},"isExactmatch");function s(l){return r.add(l),!1}a(s,"_reject");function c(l){return e.add(l),!0}return a(c,"_accept"),a(function(u){if(e.has(u))return!0;if(r.has(u))return!1;var d=u.match(r$n);if(!d)return s(u);var f={major:+d[1],minor:+d[2],patch:+d[3],prerelease:d[4]};return f.prerelease!=null||o.major!==f.major?s(u):o.major===0?o.minor===f.minor&&o.patch<=f.patch?c(u):s(u):o.minor<=f.minor?c(u):s(u)},"isCompatible")}var r$n,n$n,i$n=ve(()=>{p();icr();r$n=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;a(f3s,"_makeCompatibilityCheck");n$n=f3s(i8)});function G5(t,e,r,n){var o;n===void 0&&(n=!1);var s=E2e[y2e]=(o=E2e[y2e])!==null&&o!==void 0?o:{version:i8};if(!n&&s[t]){var c=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(c.stack||c.message),!1}if(s.version!==i8){var c=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+i8);return r.error(c.stack||c.message),!1}return s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+i8+"."),!0}function RT(t){var e,r,n=(e=E2e[y2e])===null||e===void 0?void 0:e.version;if(!(!n||!n$n(n)))return(r=E2e[y2e])===null||r===void 0?void 0:r[t]}function $5(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+i8+".");var r=E2e[y2e];r&&delete r[t]}var p3s,y2e,E2e,iX=ve(()=>{p();t$n();icr();i$n();p3s=i8.split(".")[0],y2e=Symbol.for("opentelemetry.js.api."+p3s),E2e=ZGn;a(G5,"registerGlobal");a(RT,"getGlobal");a($5,"unregisterGlobal")});function _2e(t,e,r){var n=RT("diag");if(n)return r.unshift(e),n[t].apply(n,m3s([],h3s(r),!1))}var h3s,m3s,o$n,s$n=ve(()=>{p();iX();h3s=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},m3s=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(Da||(Da={}))});function a$n(t,e){tDa.ALL&&(t=Da.ALL),e=e||{};function r(n,o){var s=e[n];return typeof s=="function"&&t>=o?s.bind(e):function(){}}return a(r,"_filterFunc"),{error:r("error",Da.ERROR),warn:r("warn",Da.WARN),info:r("info",Da.INFO),debug:r("debug",Da.DEBUG),verbose:r("verbose",Da.VERBOSE)}}var c$n=ve(()=>{p();Aat();a(a$n,"createLogLevelDiagLogger")});var g3s,A3s,y3s,SE,oX=ve(()=>{p();s$n();c$n();Aat();iX();g3s=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},A3s=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n";f.warn("Current logger will be overwritten from "+m),h.warn("Current logger will overwrite one already registered from "+m)}return G5("diag",h,r,!0)},"setLogger");r.setLogger=n,r.disable=function(){$5(y3s,r)},r.createComponentLogger=function(o){return new o$n(o)},r.verbose=e("verbose"),r.debug=e("debug"),r.info=e("info"),r.warn=e("warn"),r.error=e("error")}return a(t,"DiagAPI"),t.instance=function(){return this._instance||(this._instance=new t),this._instance},t})()});var E3s,_3s,l$n,u$n=ve(()=>{p();E3s=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},_3s=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},l$n=(function(){function t(e){this._entries=e?new Map(e):new Map}return a(t,"BaggageImpl"),t.prototype.getEntry=function(e){var r=this._entries.get(e);if(r)return Object.assign({},r)},t.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var r=E3s(e,2),n=r[0],o=r[1];return[n,o]})},t.prototype.setEntry=function(e,r){var n=new t(this._entries);return n._entries.set(e,r),n},t.prototype.removeEntry=function(e){var r=new t(this._entries);return r._entries.delete(e),r},t.prototype.removeEntries=function(){for(var e,r,n=[],o=0;o{p();d$n=Symbol("BaggageEntryMetadata")});function p$n(t){return t===void 0&&(t={}),new l$n(new Map(Object.entries(t)))}function Hpe(t){return typeof t!="string"&&(v3s.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:d$n,toString:a(function(){return t},"toString")}}var v3s,ocr=ve(()=>{p();oX();u$n();f$n();v3s=SE.instance();a(p$n,"createBaggage");a(Hpe,"baggageEntryMetadataFromString")});function _b(t){return Symbol.for(t)}var C3s,yat,v2e=ve(()=>{p();a(_b,"createContextKey");C3s=(function(){function t(e){var r=this;r._currentContext=e?new Map(e):new Map,r.getValue=function(n){return r._currentContext.get(n)},r.setValue=function(n,o){var s=new t(r._currentContext);return s._currentContext.set(n,o),s},r.deleteValue=function(n){var o=new t(r._currentContext);return o._currentContext.delete(n),o}}return a(t,"BaseContext"),t})(),yat=new C3s});var scr,h$n,m$n=ve(()=>{p();scr=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],h$n=(function(){function t(){function e(n){return function(){for(var o=[],s=0;s{p();sX=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),b3s=(function(){function t(){}return a(t,"NoopMeter"),t.prototype.createGauge=function(e,r){return D3s},t.prototype.createHistogram=function(e,r){return N3s},t.prototype.createCounter=function(e,r){return P3s},t.prototype.createUpDownCounter=function(e,r){return M3s},t.prototype.createObservableGauge=function(e,r){return L3s},t.prototype.createObservableCounter=function(e,r){return O3s},t.prototype.createObservableUpDownCounter=function(e,r){return B3s},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),Eat=(function(){function t(){}return a(t,"NoopMetric"),t})(),S3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopCounterMetric"),e.prototype.add=function(r,n){},e})(Eat),T3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopUpDownCounterMetric"),e.prototype.add=function(r,n){},e})(Eat),I3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopGaugeMetric"),e.prototype.record=function(r,n){},e})(Eat),x3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopHistogramMetric"),e.prototype.record=function(r,n){},e})(Eat),acr=(function(){function t(){}return a(t,"NoopObservableMetric"),t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),w3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableCounterMetric"),e})(acr),R3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableGaugeMetric"),e})(acr),k3s=(function(t){sX(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableUpDownCounterMetric"),e})(acr),ccr=new b3s,P3s=new S3s,D3s=new I3s,N3s=new x3s,M3s=new T3s,O3s=new w3s,L3s=new R3s,B3s=new k3s;a(g$n,"createNoopMeter")});var _at,A$n=ve(()=>{p();(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(_at||(_at={}))});var vat,Cat,ucr=ve(()=>{p();vat={get:a(function(t,e){if(t!=null)return t[e]},"get"),keys:a(function(t){return t==null?[]:Object.keys(t)},"keys")},Cat={set:a(function(t,e,r){t!=null&&(t[e]=r)},"set")}});var F3s,U3s,y$n,E$n=ve(()=>{p();v2e();F3s=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},U3s=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();E$n();iX();oX();Q3s=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},q3s=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(wf||(wf={}))});var b2e,S2e,Gpe,bat=ve(()=>{p();fcr();b2e="0000000000000000",S2e="00000000000000000000000000000000",Gpe={traceId:S2e,spanId:b2e,traceFlags:wf.NONE}});var aH,Sat=ve(()=>{p();bat();aH=(function(){function t(e){e===void 0&&(e=Gpe),this._spanContext=e}return a(t,"NonRecordingSpan"),t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(e,r){return this},t.prototype.setAttributes=function(e){return this},t.prototype.addEvent=function(e,r){return this},t.prototype.addLink=function(e){return this},t.prototype.addLinks=function(e){return this},t.prototype.setStatus=function(e){return this},t.prototype.updateName=function(e){return this},t.prototype.end=function(e){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(e,r){},t})()});function Tat(t){return t.getValue(pcr)||void 0}function _$n(){return Tat(sH.getInstance().active())}function T2e(t,e){return t.setValue(pcr,e)}function v$n(t){return t.deleteValue(pcr)}function C$n(t,e){return T2e(t,new aH(e))}function Iat(t){var e;return(e=Tat(t))===null||e===void 0?void 0:e.spanContext()}var pcr,hcr=ve(()=>{p();v2e();Sat();C2e();pcr=_b("OpenTelemetry Context Key SPAN");a(Tat,"getSpan");a(_$n,"getActiveSpan");a(T2e,"setSpan");a(v$n,"deleteSpan");a(C$n,"setSpanContext");a(Iat,"getSpanContext")});function aX(t){return H3s.test(t)&&t!==S2e}function mcr(t){return G3s.test(t)&&t!==b2e}function vb(t){return aX(t.traceId)&&mcr(t.spanId)}function b$n(t){return new aH(t)}var H3s,G3s,xat=ve(()=>{p();bat();Sat();H3s=/^([0-9a-f]{32})$/i,G3s=/^[0-9a-f]{16}$/i;a(aX,"isValidTraceId");a(mcr,"isValidSpanId");a(vb,"isSpanContextValid");a(b$n,"wrapSpanContext")});function $3s(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var gcr,wat,Acr=ve(()=>{p();C2e();hcr();Sat();xat();gcr=sH.getInstance(),wat=(function(){function t(){}return a(t,"NoopTracer"),t.prototype.startSpan=function(e,r,n){n===void 0&&(n=gcr.active());var o=!!r?.root;if(o)return new aH;var s=n&&Iat(n);return $3s(s)&&vb(s)?new aH(s):new aH},t.prototype.startActiveSpan=function(e,r,n,o){var s,c,l;if(!(arguments.length<2)){arguments.length===2?l=r:arguments.length===3?(s=r,l=n):(s=r,c=n,l=o);var u=c??gcr.active(),d=this.startSpan(e,s,u),f=T2e(u,d);return gcr.with(f,l,void 0,d)}},t})();a($3s,"isSpanContext")});var V3s,Rat,ycr=ve(()=>{p();Acr();V3s=new wat,Rat=(function(){function t(e,r,n,o){this._provider=e,this.name=r,this.version=n,this.options=o}return a(t,"ProxyTracer"),t.prototype.startSpan=function(e,r,n){return this._getTracer().startSpan(e,r,n)},t.prototype.startActiveSpan=function(e,r,n,o){var s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)},t.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):V3s},t})()});var S$n,T$n=ve(()=>{p();Acr();S$n=(function(){function t(){}return a(t,"NoopTracerProvider"),t.prototype.getTracer=function(e,r,n){return new wat},t})()});var W3s,I2e,Ecr=ve(()=>{p();ycr();T$n();W3s=new S$n,I2e=(function(){function t(){}return a(t,"ProxyTracerProvider"),t.prototype.getTracer=function(e,r,n){var o;return(o=this.getDelegateTracer(e,r,n))!==null&&o!==void 0?o:new Rat(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:W3s},t.prototype.setDelegate=function(e){this._delegate=e},t.prototype.getDelegateTracer=function(e,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(e,r,n)},t})()});var Cb,I$n=ve(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Cb||(Cb={}))});var $pe,x$n=ve(()=>{p();(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})($pe||($pe={}))});var Vpe,w$n=ve(()=>{p();(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(Vpe||(Vpe={}))});function R$n(t){return K3s.test(t)}function k$n(t){return J3s.test(t)&&!Z3s.test(t)}var _cr,z3s,Y3s,K3s,J3s,Z3s,P$n=ve(()=>{p();_cr="[_0-9a-z-*/]",z3s="[a-z]"+_cr+"{0,255}",Y3s="[a-z0-9]"+_cr+"{0,240}@[a-z]"+_cr+"{0,13}",K3s=new RegExp("^(?:"+z3s+"|"+Y3s+")$"),J3s=/^[ -~]{0,255}[!-~]$/,Z3s=/,|=/;a(R$n,"validateKey");a(k$n,"validateValue")});var D$n,X3s,N$n,M$n,O$n,L$n=ve(()=>{p();P$n();D$n=32,X3s=512,N$n=",",M$n="=",O$n=(function(){function t(e){this._internalState=new Map,e&&this._parse(e)}return a(t,"TraceStateImpl"),t.prototype.set=function(e,r){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n},t.prototype.unset=function(e){var r=this._clone();return r._internalState.delete(e),r},t.prototype.get=function(e){return this._internalState.get(e)},t.prototype.serialize=function(){var e=this;return this._keys().reduce(function(r,n){return r.push(n+M$n+e.get(n)),r},[]).join(N$n)},t.prototype._parse=function(e){e.length>X3s||(this._internalState=e.split(N$n).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(M$n);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);R$n(c)&&k$n(l)&&r.set(c,l)}return r},new Map),this._internalState.size>D$n&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,D$n))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t})()});function B$n(t){return new O$n(t)}var F$n=ve(()=>{p();L$n();a(B$n,"createTraceState")});var Og,U$n=ve(()=>{p();C2e();Og=sH.getInstance()});var Dn,Q$n=ve(()=>{p();oX();Dn=SE.instance()});var eFs,q$n,j$n=ve(()=>{p();lcr();eFs=(function(){function t(){}return a(t,"NoopMeterProvider"),t.prototype.getMeter=function(e,r,n){return ccr},t})(),q$n=new eFs});var vcr,H$n,G$n=ve(()=>{p();j$n();iX();oX();vcr="metrics",H$n=(function(){function t(){}return a(t,"MetricsAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(e){return G5(vcr,e,SE.instance())},t.prototype.getMeterProvider=function(){return RT(vcr)||q$n},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){$5(vcr,SE.instance())},t})()});var cX,$$n=ve(()=>{p();G$n();cX=H$n.getInstance()});var V$n,W$n=ve(()=>{p();V$n=(function(){function t(){}return a(t,"NoopTextMapPropagator"),t.prototype.inject=function(e,r){},t.prototype.extract=function(e,r){return e},t.prototype.fields=function(){return[]},t})()});function bcr(t){return t.getValue(Ccr)||void 0}function z$n(){return bcr(sH.getInstance().active())}function Y$n(t,e){return t.setValue(Ccr,e)}function K$n(t){return t.deleteValue(Ccr)}var Ccr,J$n=ve(()=>{p();C2e();v2e();Ccr=_b("OpenTelemetry Baggage Key");a(bcr,"getBaggage");a(z$n,"getActiveBaggage");a(Y$n,"setBaggage");a(K$n,"deleteBaggage")});var Scr,tFs,Z$n,X$n=ve(()=>{p();iX();W$n();ucr();J$n();ocr();oX();Scr="propagation",tFs=new V$n,Z$n=(function(){function t(){this.createBaggage=p$n,this.getBaggage=bcr,this.getActiveBaggage=z$n,this.setBaggage=Y$n,this.deleteBaggage=K$n}return a(t,"PropagationAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return G5(Scr,e,SE.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=Cat),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=vat),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){$5(Scr,SE.instance())},t.prototype._getGlobalPropagator=function(){return RT(Scr)||tFs},t})()});var kT,eVn=ve(()=>{p();X$n();kT=Z$n.getInstance()});var Tcr,tVn,rVn=ve(()=>{p();iX();Ecr();xat();hcr();oX();Tcr="trace",tVn=(function(){function t(){this._proxyTracerProvider=new I2e,this.wrapSpanContext=b$n,this.isSpanContextValid=vb,this.deleteSpan=v$n,this.getSpan=Tat,this.getActiveSpan=_$n,this.getSpanContext=Iat,this.setSpan=T2e,this.setSpanContext=C$n}return a(t,"TraceAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=G5(Tcr,this._proxyTracerProvider,SE.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return RT(Tcr)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){$5(Tcr,SE.instance()),this._proxyTracerProvider=new I2e},t})()});var wu,nVn=ve(()=>{p();rVn();wu=tVn.getInstance()});var V5={};ki(V5,{DiagConsoleLogger:()=>h$n,DiagLogLevel:()=>Da,INVALID_SPANID:()=>b2e,INVALID_SPAN_CONTEXT:()=>Gpe,INVALID_TRACEID:()=>S2e,ProxyTracer:()=>Rat,ProxyTracerProvider:()=>I2e,ROOT_CONTEXT:()=>yat,SamplingDecision:()=>Cb,SpanKind:()=>$pe,SpanStatusCode:()=>Vpe,TraceFlags:()=>wf,ValueType:()=>_at,baggageEntryMetadataFromString:()=>Hpe,context:()=>Og,createContextKey:()=>_b,createNoopMeter:()=>g$n,createTraceState:()=>B$n,default:()=>rFs,defaultTextMapGetter:()=>vat,defaultTextMapSetter:()=>Cat,diag:()=>Dn,isSpanContextValid:()=>vb,isValidSpanId:()=>mcr,isValidTraceId:()=>aX,metrics:()=>cX,propagation:()=>kT,trace:()=>wu});var rFs,co=ve(()=>{p();ocr();v2e();m$n();Aat();lcr();A$n();ucr();ycr();Ecr();I$n();x$n();w$n();fcr();F$n();xat();bat();U$n();Q$n();$$n();eVn();nVn();rFs={context:Og,diag:Dn,metrics:cX,propagation:kT,trace:wu}});var eDe=I(cc=>{"use strict";p();Object.defineProperty(cc,"__esModule",{value:!0});cc.regexpCode=cc.getEsmExportName=cc.getProperty=cc.safeStringify=cc.stringify=cc.strConcat=cc.addCodeArg=cc.str=cc._=cc.nil=cc._Code=cc.Name=cc.IDENTIFIER=cc._CodeOrName=void 0;var Z2e=class{static{a(this,"_CodeOrName")}};cc._CodeOrName=Z2e;cc.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var AX=class extends Z2e{static{a(this,"Name")}constructor(e){if(super(),!cc.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};cc.Name=AX;var Ww=class extends Z2e{static{a(this,"_Code")}constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof AX&&(r[n.str]=(r[n.str]||0)+1),r),{})}};cc._Code=Ww;cc.nil=new Ww("");function qVn(t,...e){let r=[t[0]],n=0;for(;n{"use strict";p();Object.defineProperty(Sb,"__esModule",{value:!0});Sb.ValueScope=Sb.ValueScopeName=Sb.Scope=Sb.varKinds=Sb.UsedValueState=void 0;var bb=eDe(),alr=class extends Error{static{a(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Vat;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Vat||(Sb.UsedValueState=Vat={}));Sb.varKinds={const:new bb.Name("const"),let:new bb.Name("let"),var:new bb.Name("var")};var Wat=class{static{a(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof bb.Name?e:this.name(e)}name(e){return new bb.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Sb.Scope=Wat;var zat=class extends bb.Name{static{a(this,"ValueScopeName")}constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,bb._)`.${new bb.Name(r)}[${n}]`}};Sb.ValueScopeName=zat;var f6s=(0,bb._)`\n`,clr=class extends Wat{static{a(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?f6s:bb.nil}}get(){return this._scope}name(e){return new zat(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:s}=o,c=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[s];if(l){let f=l.get(c);if(f)return f}else l=this._values[s]=new Map;l.set(c,o);let u=this._scope[s]||(this._scope[s]=[]),d=u.length;return u[d]=r.ref,o.setValue(r,{property:s,itemIndex:d}),o}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,bb._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(e,r,n={},o){let s=bb.nil;for(let c in e){let l=e[c];if(!l)continue;let u=n[c]=n[c]||new Map;l.forEach(d=>{if(u.has(d))return;u.set(d,Vat.Started);let f=r(d);if(f){let h=this.opts.es5?Sb.varKinds.var:Sb.varKinds.const;s=(0,bb._)`${s}${h} ${d} = ${f};${this.opts._n}`}else if(f=o?.(d))s=(0,bb._)`${s}${f}${this.opts._n}`;else throw new alr(d);u.set(d,Vat.Completed)})}return s}};Sb.ValueScope=clr});var Es=I(Ps=>{"use strict";p();Object.defineProperty(Ps,"__esModule",{value:!0});Ps.or=Ps.and=Ps.not=Ps.CodeGen=Ps.operators=Ps.varKinds=Ps.ValueScopeName=Ps.ValueScope=Ps.Scope=Ps.Name=Ps.regexpCode=Ps.stringify=Ps.getProperty=Ps.nil=Ps.strConcat=Ps.str=Ps._=void 0;var Na=eDe(),D2=llr(),fH=eDe();Object.defineProperty(Ps,"_",{enumerable:!0,get:a(function(){return fH._},"get")});Object.defineProperty(Ps,"str",{enumerable:!0,get:a(function(){return fH.str},"get")});Object.defineProperty(Ps,"strConcat",{enumerable:!0,get:a(function(){return fH.strConcat},"get")});Object.defineProperty(Ps,"nil",{enumerable:!0,get:a(function(){return fH.nil},"get")});Object.defineProperty(Ps,"getProperty",{enumerable:!0,get:a(function(){return fH.getProperty},"get")});Object.defineProperty(Ps,"stringify",{enumerable:!0,get:a(function(){return fH.stringify},"get")});Object.defineProperty(Ps,"regexpCode",{enumerable:!0,get:a(function(){return fH.regexpCode},"get")});Object.defineProperty(Ps,"Name",{enumerable:!0,get:a(function(){return fH.Name},"get")});var Zat=llr();Object.defineProperty(Ps,"Scope",{enumerable:!0,get:a(function(){return Zat.Scope},"get")});Object.defineProperty(Ps,"ValueScope",{enumerable:!0,get:a(function(){return Zat.ValueScope},"get")});Object.defineProperty(Ps,"ValueScopeName",{enumerable:!0,get:a(function(){return Zat.ValueScopeName},"get")});Object.defineProperty(Ps,"varKinds",{enumerable:!0,get:a(function(){return Zat.varKinds},"get")});Ps.operators={GT:new Na._Code(">"),GTE:new Na._Code(">="),LT:new Na._Code("<"),LTE:new Na._Code("<="),EQ:new Na._Code("==="),NEQ:new Na._Code("!=="),NOT:new Na._Code("!"),OR:new Na._Code("||"),AND:new Na._Code("&&"),ADD:new Na._Code("+")};var d8=class{static{a(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}},ulr=class extends d8{static{a(this,"Def")}constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?D2.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Zpe(this.rhs,e,r)),this}get names(){return this.rhs instanceof Na._CodeOrName?this.rhs.names:{}}},Yat=class extends d8{static{a(this,"Assign")}constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Na.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Zpe(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Na.Name?{}:{...this.lhs.names};return Jat(e,this.rhs)}},dlr=class extends Yat{static{a(this,"AssignOp")}constructor(e,r,n,o){super(e,n,o),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},flr=class extends d8{static{a(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},plr=class extends d8{static{a(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},hlr=class extends d8{static{a(this,"Throw")}constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},mlr=class extends d8{static{a(this,"AnyCode")}constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Zpe(this.code,e,r),this}get names(){return this.code instanceof Na._CodeOrName?this.code.names:{}}},tDe=class extends d8{static{a(this,"ParentNode")}constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(e,r)||(p6s(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>_X(e,r.names),{})}},f8=class extends tDe{static{a(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}},glr=class extends tDe{static{a(this,"Root")}},Jpe=class extends f8{static{a(this,"Else")}};Jpe.kind="else";var yX=class t extends f8{static{a(this,"If")}constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Jpe(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(HVn(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Zpe(this.condition,e,r),this}get names(){let e=super.names;return Jat(e,this.condition),this.else&&_X(e,this.else.names),e}};yX.kind="if";var EX=class extends f8{static{a(this,"For")}};EX.kind="for";var Alr=class extends EX{static{a(this,"ForLoop")}constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Zpe(this.iteration,e,r),this}get names(){return _X(super.names,this.iteration.names)}},ylr=class extends EX{static{a(this,"ForRange")}constructor(e,r,n,o){super(),this.varKind=e,this.name=r,this.from=n,this.to=o}render(e){let r=e.es5?D2.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return`for(${r} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Jat(super.names,this.from);return Jat(e,this.to)}},Kat=class extends EX{static{a(this,"ForIter")}constructor(e,r,n,o){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=o}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Zpe(this.iterable,e,r),this}get names(){return _X(super.names,this.iterable.names)}},rDe=class extends f8{static{a(this,"Func")}constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};rDe.kind="func";var nDe=class extends tDe{static{a(this,"Return")}render(e){return"return "+super.render(e)}};nDe.kind="return";var Elr=class extends f8{static{a(this,"Try")}render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,o;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(o=this.finally)===null||o===void 0||o.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&_X(e,this.catch.names),this.finally&&_X(e,this.finally.names),e}},iDe=class extends f8{static{a(this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};iDe.kind="catch";var oDe=class extends f8{static{a(this,"Finally")}render(e){return"finally"+super.render(e)}};oDe.kind="finally";var _lr=class{static{a(this,"CodeGen")}constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?` -`:""},this._extScope=e,this._scope=new D2.Scope({parent:e}),this._nodes=[new glr]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,o){let s=this._scope.toName(r);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new ulr(e,s,n)),s}const(e,r,n){return this._def(D2.varKinds.const,e,r,n)}let(e,r,n){return this._def(D2.varKinds.let,e,r,n)}var(e,r,n){return this._def(D2.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Yat(e,r,n))}add(e,r){return this._leafNode(new dlr(e,Ps.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Na.nil&&this._leafNode(new mlr(e)),this}object(...e){let r=["{"];for(let[n,o]of e)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,Na.addCodeArg)(r,o));return r.push("}"),new Na._Code(r)}if(e,r,n){if(this._blockNode(new yX(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new yX(e))}else(){return this._elseNode(new Jpe)}endIf(){return this._endBlockNode(yX,Jpe)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Alr(e),r)}forRange(e,r,n,o,s=this.opts.es5?D2.varKinds.var:D2.varKinds.let){let c=this._scope.toName(e);return this._for(new ylr(s,c,r,n),()=>o(c))}forOf(e,r,n,o=D2.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let c=r instanceof Na.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Na._)`${c}.length`,l=>{this.var(s,(0,Na._)`${c}[${l}]`),n(s)})}return this._for(new Kat("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?D2.varKinds.var:D2.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Na._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Kat("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(EX)}label(e){return this._leafNode(new flr(e))}break(e){return this._leafNode(new plr(e))}return(e){let r=new nDe;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(nDe)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Elr;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new iDe(s),r(s)}return n&&(this._currNode=o.finally=new oDe,this.code(n)),this._endBlockNode(iDe,oDe)}throw(e){return this._leafNode(new hlr(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Na.nil,n,o){return this._blockNode(new rDe(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(rDe)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof yX))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};Ps.CodeGen=_lr;function _X(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}a(_X,"addNames");function Jat(t,e){return e instanceof Na._CodeOrName?_X(t,e.names):t}a(Jat,"addExprNames");function Zpe(t,e,r){if(t instanceof Na.Name)return n(t);if(!o(t))return t;return new Na._Code(t._items.reduce((s,c)=>(c instanceof Na.Name&&(c=n(c)),c instanceof Na._Code?s.push(...c._items):s.push(c),s),[]));function n(s){let c=r[s.str];return c===void 0||e[s.str]!==1?s:(delete e[s.str],c)}function o(s){return s instanceof Na._Code&&s._items.some(c=>c instanceof Na.Name&&e[c.str]===1&&r[c.str]!==void 0)}}a(Zpe,"optimizeExpr");function p6s(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}a(p6s,"subtractNames");function HVn(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Na._)`!${vlr(t)}`}a(HVn,"not");Ps.not=HVn;var h6s=GVn(Ps.operators.AND);function m6s(...t){return t.reduce(h6s)}a(m6s,"and");Ps.and=m6s;var g6s=GVn(Ps.operators.OR);function A6s(...t){return t.reduce(g6s)}a(A6s,"or");Ps.or=A6s;function GVn(t){return(e,r)=>e===Na.nil?r:r===Na.nil?e:(0,Na._)`${vlr(e)} ${t} ${vlr(r)}`}a(GVn,"mappend");function vlr(t){return t instanceof Na.Name?t:(0,Na._)`(${t})`}a(vlr,"par")});var Ka=I(js=>{"use strict";p();Object.defineProperty(js,"__esModule",{value:!0});js.checkStrictMode=js.getErrorPath=js.Type=js.useFunc=js.setEvaluated=js.evaluatedPropsToName=js.mergeEvaluated=js.eachItem=js.unescapeJsonPointer=js.escapeJsonPointer=js.escapeFragment=js.unescapeFragment=js.schemaRefOrVal=js.schemaHasRulesButRef=js.schemaHasRules=js.checkUnknownRules=js.alwaysValidSchema=js.toHash=void 0;var Yl=Es(),y6s=eDe();function E6s(t){let e={};for(let r of t)e[r]=!0;return e}a(E6s,"toHash");js.toHash=E6s;function _6s(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(WVn(t,e),!zVn(e,t.self.RULES.all))}a(_6s,"alwaysValidSchema");js.alwaysValidSchema=_6s;function WVn(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let o=n.RULES.keywords;for(let s in e)o[s]||JVn(t,`unknown keyword: "${s}"`)}a(WVn,"checkUnknownRules");js.checkUnknownRules=WVn;function zVn(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}a(zVn,"schemaHasRules");js.schemaHasRules=zVn;function v6s(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}a(v6s,"schemaHasRulesButRef");js.schemaHasRulesButRef=v6s;function C6s({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Yl._)`${r}`}return(0,Yl._)`${t}${e}${(0,Yl.getProperty)(n)}`}a(C6s,"schemaRefOrVal");js.schemaRefOrVal=C6s;function b6s(t){return YVn(decodeURIComponent(t))}a(b6s,"unescapeFragment");js.unescapeFragment=b6s;function S6s(t){return encodeURIComponent(blr(t))}a(S6s,"escapeFragment");js.escapeFragment=S6s;function blr(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}a(blr,"escapeJsonPointer");js.escapeJsonPointer=blr;function YVn(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}a(YVn,"unescapeJsonPointer");js.unescapeJsonPointer=YVn;function T6s(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}a(T6s,"eachItem");js.eachItem=T6s;function $Vn({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,c,l)=>{let u=c===void 0?s:c instanceof Yl.Name?(s instanceof Yl.Name?t(o,s,c):e(o,s,c),c):s instanceof Yl.Name?(e(o,c,s),s):r(s,c);return l===Yl.Name&&!(u instanceof Yl.Name)?n(o,u):u}}a($Vn,"makeMergeEvaluated");js.mergeEvaluated={props:$Vn({mergeNames:a((t,e,r)=>t.if((0,Yl._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Yl._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Yl._)`${r} || {}`).code((0,Yl._)`Object.assign(${r}, ${e})`))}),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Yl._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Yl._)`${r} || {}`),Slr(t,r,e))}),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:{...t,...e},"mergeValues"),resultToName:KVn}),items:$Vn({mergeNames:a((t,e,r)=>t.if((0,Yl._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Yl._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Yl._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Yl._)`${r} > ${e} ? ${r} : ${e}`)),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:Math.max(t,e),"mergeValues"),resultToName:a((t,e)=>t.var("items",e),"resultToName")})};function KVn(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Yl._)`{}`);return e!==void 0&&Slr(t,r,e),r}a(KVn,"evaluatedPropsToName");js.evaluatedPropsToName=KVn;function Slr(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Yl._)`${e}${(0,Yl.getProperty)(n)}`,!0))}a(Slr,"setEvaluated");js.setEvaluated=Slr;var VVn={};function I6s(t,e){return t.scopeValue("func",{ref:e,code:VVn[e.code]||(VVn[e.code]=new y6s._Code(e.code))})}a(I6s,"useFunc");js.useFunc=I6s;var Clr;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Clr||(js.Type=Clr={}));function x6s(t,e,r){if(t instanceof Yl.Name){let n=e===Clr.Num;return r?n?(0,Yl._)`"[" + ${t} + "]"`:(0,Yl._)`"['" + ${t} + "']"`:n?(0,Yl._)`"/" + ${t}`:(0,Yl._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Yl.getProperty)(t).toString():"/"+blr(t)}a(x6s,"getErrorPath");js.getErrorPath=x6s;function JVn(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}a(JVn,"checkStrictMode");js.checkStrictMode=JVn});var p8=I(Tlr=>{"use strict";p();Object.defineProperty(Tlr,"__esModule",{value:!0});var TE=Es(),w6s={data:new TE.Name("data"),valCxt:new TE.Name("valCxt"),instancePath:new TE.Name("instancePath"),parentData:new TE.Name("parentData"),parentDataProperty:new TE.Name("parentDataProperty"),rootData:new TE.Name("rootData"),dynamicAnchors:new TE.Name("dynamicAnchors"),vErrors:new TE.Name("vErrors"),errors:new TE.Name("errors"),this:new TE.Name("this"),self:new TE.Name("self"),scope:new TE.Name("scope"),json:new TE.Name("json"),jsonPos:new TE.Name("jsonPos"),jsonLen:new TE.Name("jsonLen"),jsonPart:new TE.Name("jsonPart")};Tlr.default=w6s});var sDe=I(IE=>{"use strict";p();Object.defineProperty(IE,"__esModule",{value:!0});IE.extendErrors=IE.resetErrorsCount=IE.reportExtraError=IE.reportError=IE.keyword$DataError=IE.keywordError=void 0;var Ja=Es(),Xat=Ka(),hv=p8();IE.keywordError={message:a(({keyword:t})=>(0,Ja.str)`must pass "${t}" keyword validation`,"message")};IE.keyword$DataError={message:a(({keyword:t,schemaType:e})=>e?(0,Ja.str)`"${t}" keyword must be ${e} ($data)`:(0,Ja.str)`"${t}" keyword is invalid ($data)`,"message")};function R6s(t,e=IE.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:c,allErrors:l}=o,u=eWn(t,e,r);n??(c||l)?ZVn(s,u):XVn(o,(0,Ja._)`[${u}]`)}a(R6s,"reportError");IE.reportError=R6s;function k6s(t,e=IE.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:c}=n,l=eWn(t,e,r);ZVn(o,l),s||c||XVn(n,hv.default.vErrors)}a(k6s,"reportExtraError");IE.reportExtraError=k6s;function P6s(t,e){t.assign(hv.default.errors,e),t.if((0,Ja._)`${hv.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Ja._)`${hv.default.vErrors}.length`,e),()=>t.assign(hv.default.vErrors,null)))}a(P6s,"resetErrorsCount");IE.resetErrorsCount=P6s;function D6s({gen:t,keyword:e,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let c=t.name("err");t.forRange("i",o,hv.default.errors,l=>{t.const(c,(0,Ja._)`${hv.default.vErrors}[${l}]`),t.if((0,Ja._)`${c}.instancePath === undefined`,()=>t.assign((0,Ja._)`${c}.instancePath`,(0,Ja.strConcat)(hv.default.instancePath,s.errorPath))),t.assign((0,Ja._)`${c}.schemaPath`,(0,Ja.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Ja._)`${c}.schema`,r),t.assign((0,Ja._)`${c}.data`,n))})}a(D6s,"extendErrors");IE.extendErrors=D6s;function ZVn(t,e){let r=t.const("err",e);t.if((0,Ja._)`${hv.default.vErrors} === null`,()=>t.assign(hv.default.vErrors,(0,Ja._)`[${r}]`),(0,Ja._)`${hv.default.vErrors}.push(${r})`),t.code((0,Ja._)`${hv.default.errors}++`)}a(ZVn,"addError");function XVn(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,Ja._)`new ${t.ValidationError}(${e})`):(r.assign((0,Ja._)`${n}.errors`,e),r.return(!1))}a(XVn,"returnErrors");var vX={keyword:new Ja.Name("keyword"),schemaPath:new Ja.Name("schemaPath"),params:new Ja.Name("params"),propertyName:new Ja.Name("propertyName"),message:new Ja.Name("message"),schema:new Ja.Name("schema"),parentSchema:new Ja.Name("parentSchema")};function eWn(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Ja._)`{}`:N6s(t,e,r)}a(eWn,"errorObjectCode");function N6s(t,e,r={}){let{gen:n,it:o}=t,s=[M6s(o,r),O6s(t,r)];return L6s(t,e,s),n.object(...s)}a(N6s,"errorObject");function M6s({errorPath:t},{instancePath:e}){let r=e?(0,Ja.str)`${t}${(0,Xat.getErrorPath)(e,Xat.Type.Str)}`:t;return[hv.default.instancePath,(0,Ja.strConcat)(hv.default.instancePath,r)]}a(M6s,"errorInstancePath");function O6s({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,Ja.str)`${e}/${t}`;return r&&(o=(0,Ja.str)`${o}${(0,Xat.getErrorPath)(r,Xat.Type.Str)}`),[vX.schemaPath,o]}a(O6s,"errorSchemaPath");function L6s(t,{params:e,message:r},n){let{keyword:o,data:s,schemaValue:c,it:l}=t,{opts:u,propertyName:d,topSchemaRef:f,schemaPath:h}=l;n.push([vX.keyword,o],[vX.params,typeof e=="function"?e(t):e||(0,Ja._)`{}`]),u.messages&&n.push([vX.message,typeof r=="function"?r(t):r]),u.verbose&&n.push([vX.schema,c],[vX.parentSchema,(0,Ja._)`${f}${h}`],[hv.default.data,s]),d&&n.push([vX.propertyName,d])}a(L6s,"extraErrorProps")});var rWn=I(Xpe=>{"use strict";p();Object.defineProperty(Xpe,"__esModule",{value:!0});Xpe.boolOrEmptySchema=Xpe.topBoolOrEmptySchema=void 0;var B6s=sDe(),F6s=Es(),U6s=p8(),Q6s={message:"boolean schema is false"};function q6s(t){let{gen:e,schema:r,validateName:n}=t;r===!1?tWn(t,!1):typeof r=="object"&&r.$async===!0?e.return(U6s.default.data):(e.assign((0,F6s._)`${n}.errors`,null),e.return(!0))}a(q6s,"topBoolOrEmptySchema");Xpe.topBoolOrEmptySchema=q6s;function j6s(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),tWn(t)):r.var(e,!0)}a(j6s,"boolOrEmptySchema");Xpe.boolOrEmptySchema=j6s;function tWn(t,e){let{gen:r,data:n}=t,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,B6s.reportError)(o,Q6s,void 0,e)}a(tWn,"falseSchemaError")});var Ilr=I(ehe=>{"use strict";p();Object.defineProperty(ehe,"__esModule",{value:!0});ehe.getRules=ehe.isJSONType=void 0;var H6s=["string","number","integer","boolean","null","object","array"],G6s=new Set(H6s);function $6s(t){return typeof t=="string"&&G6s.has(t)}a($6s,"isJSONType");ehe.isJSONType=$6s;function V6s(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}a(V6s,"getRules");ehe.getRules=V6s});var xlr=I(pH=>{"use strict";p();Object.defineProperty(pH,"__esModule",{value:!0});pH.shouldUseRule=pH.shouldUseGroup=pH.schemaHasRulesForType=void 0;function W6s({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&nWn(t,n)}a(W6s,"schemaHasRulesForType");pH.schemaHasRulesForType=W6s;function nWn(t,e){return e.rules.some(r=>iWn(t,r))}a(nWn,"shouldUseGroup");pH.shouldUseGroup=nWn;function iWn(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}a(iWn,"shouldUseRule");pH.shouldUseRule=iWn});var aDe=I(xE=>{"use strict";p();Object.defineProperty(xE,"__esModule",{value:!0});xE.reportTypeError=xE.checkDataTypes=xE.checkDataType=xE.coerceAndCheckDataType=xE.getJSONTypes=xE.getSchemaTypes=xE.DataType=void 0;var z6s=Ilr(),Y6s=xlr(),K6s=sDe(),cs=Es(),oWn=Ka(),the;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(the||(xE.DataType=the={}));function J6s(t){let e=sWn(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}a(J6s,"getSchemaTypes");xE.getSchemaTypes=J6s;function sWn(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(z6s.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}a(sWn,"getJSONTypes");xE.getJSONTypes=sWn;function Z6s(t,e){let{gen:r,data:n,opts:o}=t,s=X6s(e,o.coerceTypes),c=e.length>0&&!(s.length===0&&e.length===1&&(0,Y6s.schemaHasRulesForType)(t,e[0]));if(c){let l=Rlr(e,n,o.strictNumbers,the.Wrong);r.if(l,()=>{s.length?e9s(t,e,s):klr(t)})}return c}a(Z6s,"coerceAndCheckDataType");xE.coerceAndCheckDataType=Z6s;var aWn=new Set(["string","number","integer","boolean","null"]);function X6s(t,e){return e?t.filter(r=>aWn.has(r)||e==="array"&&r==="array"):[]}a(X6s,"coerceToTypes");function e9s(t,e,r){let{gen:n,data:o,opts:s}=t,c=n.let("dataType",(0,cs._)`typeof ${o}`),l=n.let("coerced",(0,cs._)`undefined`);s.coerceTypes==="array"&&n.if((0,cs._)`${c} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,cs._)`${o}[0]`).assign(c,(0,cs._)`typeof ${o}`).if(Rlr(e,o,s.strictNumbers),()=>n.assign(l,o))),n.if((0,cs._)`${l} !== undefined`);for(let d of r)(aWn.has(d)||d==="array"&&s.coerceTypes==="array")&&u(d);n.else(),klr(t),n.endIf(),n.if((0,cs._)`${l} !== undefined`,()=>{n.assign(o,l),t9s(t,l)});function u(d){switch(d){case"string":n.elseIf((0,cs._)`${c} == "number" || ${c} == "boolean"`).assign(l,(0,cs._)`"" + ${o}`).elseIf((0,cs._)`${o} === null`).assign(l,(0,cs._)`""`);return;case"number":n.elseIf((0,cs._)`${c} == "boolean" || ${o} === null - || (${c} == "string" && ${o} && ${o} == +${o})`).assign(l,(0,cs._)`+${o}`);return;case"integer":n.elseIf((0,cs._)`${c} === "boolean" || ${o} === null - || (${c} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(l,(0,cs._)`+${o}`);return;case"boolean":n.elseIf((0,cs._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(l,!1).elseIf((0,cs._)`${o} === "true" || ${o} === 1`).assign(l,!0);return;case"null":n.elseIf((0,cs._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(l,null);return;case"array":n.elseIf((0,cs._)`${c} === "string" || ${c} === "number" - || ${c} === "boolean" || ${o} === null`).assign(l,(0,cs._)`[${o}]`)}}a(u,"coerceSpecificType")}a(e9s,"coerceData");function t9s({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,cs._)`${e} !== undefined`,()=>t.assign((0,cs._)`${e}[${r}]`,n))}a(t9s,"assignParentData");function wlr(t,e,r,n=the.Correct){let o=n===the.Correct?cs.operators.EQ:cs.operators.NEQ,s;switch(t){case"null":return(0,cs._)`${e} ${o} null`;case"array":s=(0,cs._)`Array.isArray(${e})`;break;case"object":s=(0,cs._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=c((0,cs._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=c();break;default:return(0,cs._)`typeof ${e} ${o} ${t}`}return n===the.Correct?s:(0,cs.not)(s);function c(l=cs.nil){return(0,cs.and)((0,cs._)`typeof ${e} == "number"`,l,r?(0,cs._)`isFinite(${e})`:cs.nil)}}a(wlr,"checkDataType");xE.checkDataType=wlr;function Rlr(t,e,r,n){if(t.length===1)return wlr(t[0],e,r,n);let o,s=(0,oWn.toHash)(t);if(s.array&&s.object){let c=(0,cs._)`typeof ${e} != "object"`;o=s.null?c:(0,cs._)`!${e} || ${c}`,delete s.null,delete s.array,delete s.object}else o=cs.nil;s.number&&delete s.integer;for(let c in s)o=(0,cs.and)(o,wlr(c,e,r,n));return o}a(Rlr,"checkDataTypes");xE.checkDataTypes=Rlr;var r9s={message:a(({schema:t})=>`must be ${t}`,"message"),params:a(({schema:t,schemaValue:e})=>typeof t=="string"?(0,cs._)`{type: ${t}}`:(0,cs._)`{type: ${e}}`,"params")};function klr(t){let e=n9s(t);(0,K6s.reportError)(e,r9s)}a(klr,"reportTypeError");xE.reportTypeError=klr;function n9s(t){let{gen:e,data:r,schema:n}=t,o=(0,oWn.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}a(n9s,"getTypeErrorContext")});var lWn=I(ect=>{"use strict";p();Object.defineProperty(ect,"__esModule",{value:!0});ect.assignDefaults=void 0;var rhe=Es(),i9s=Ka();function o9s(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)cWn(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>cWn(t,s,o.default))}a(o9s,"assignDefaults");ect.assignDefaults=o9s;function cWn(t,e,r){let{gen:n,compositeRule:o,data:s,opts:c}=t;if(r===void 0)return;let l=(0,rhe._)`${s}${(0,rhe.getProperty)(e)}`;if(o){(0,i9s.checkStrictMode)(t,`default is ignored for: ${l}`);return}let u=(0,rhe._)`${l} === undefined`;c.useDefaults==="empty"&&(u=(0,rhe._)`${u} || ${l} === null || ${l} === ""`),n.if(u,(0,rhe._)`${l} = ${(0,rhe.stringify)(r)}`)}a(cWn,"assignDefault")});var zw=I(Rl=>{"use strict";p();Object.defineProperty(Rl,"__esModule",{value:!0});Rl.validateUnion=Rl.validateArray=Rl.usePattern=Rl.callValidateCode=Rl.schemaProperties=Rl.allSchemaProperties=Rl.noPropertyInData=Rl.propertyInData=Rl.isOwnProperty=Rl.hasPropFunc=Rl.reportMissingProp=Rl.checkMissingProp=Rl.checkReportMissingProp=void 0;var fd=Es(),Plr=Ka(),hH=p8(),s9s=Ka();function a9s(t,e){let{gen:r,data:n,it:o}=t;r.if(Nlr(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,fd._)`${e}`},!0),t.error()})}a(a9s,"checkReportMissingProp");Rl.checkReportMissingProp=a9s;function c9s({gen:t,data:e,it:{opts:r}},n,o){return(0,fd.or)(...n.map(s=>(0,fd.and)(Nlr(t,e,s,r.ownProperties),(0,fd._)`${o} = ${s}`)))}a(c9s,"checkMissingProp");Rl.checkMissingProp=c9s;function l9s(t,e){t.setParams({missingProperty:e},!0),t.error()}a(l9s,"reportMissingProp");Rl.reportMissingProp=l9s;function uWn(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,fd._)`Object.prototype.hasOwnProperty`})}a(uWn,"hasPropFunc");Rl.hasPropFunc=uWn;function Dlr(t,e,r){return(0,fd._)`${uWn(t)}.call(${e}, ${r})`}a(Dlr,"isOwnProperty");Rl.isOwnProperty=Dlr;function u9s(t,e,r,n){let o=(0,fd._)`${e}${(0,fd.getProperty)(r)} !== undefined`;return n?(0,fd._)`${o} && ${Dlr(t,e,r)}`:o}a(u9s,"propertyInData");Rl.propertyInData=u9s;function Nlr(t,e,r,n){let o=(0,fd._)`${e}${(0,fd.getProperty)(r)} === undefined`;return n?(0,fd.or)(o,(0,fd.not)(Dlr(t,e,r))):o}a(Nlr,"noPropertyInData");Rl.noPropertyInData=Nlr;function dWn(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}a(dWn,"allSchemaProperties");Rl.allSchemaProperties=dWn;function d9s(t,e){return dWn(e).filter(r=>!(0,Plr.alwaysValidSchema)(t,e[r]))}a(d9s,"schemaProperties");Rl.schemaProperties=d9s;function f9s({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,fd._)`${t}, ${e}, ${n}${o}`:e,h=[[hH.default.instancePath,(0,fd.strConcat)(hH.default.instancePath,s)],[hH.default.parentData,c.parentData],[hH.default.parentDataProperty,c.parentDataProperty],[hH.default.rootData,hH.default.rootData]];c.opts.dynamicRef&&h.push([hH.default.dynamicAnchors,hH.default.dynamicAnchors]);let m=(0,fd._)`${f}, ${r.object(...h)}`;return u!==fd.nil?(0,fd._)`${l}.call(${u}, ${m})`:(0,fd._)`${l}(${m})`}a(f9s,"callValidateCode");Rl.callValidateCode=f9s;var p9s=(0,fd._)`new RegExp`;function h9s({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:o}=e.code,s=o(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,fd._)`${o.code==="new RegExp"?p9s:(0,s9s.useFunc)(t,o)}(${r}, ${n})`})}a(h9s,"usePattern");Rl.usePattern=h9s;function m9s(t){let{gen:e,data:r,keyword:n,it:o}=t,s=e.name("valid");if(o.allErrors){let l=e.let("valid",!0);return c(()=>e.assign(l,!1)),l}return e.var(s,!0),c(()=>e.break()),s;function c(l){let u=e.const("len",(0,fd._)`${r}.length`);e.forRange("i",0,u,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:Plr.Type.Num},s),e.if((0,fd.not)(s),l)})}a(c,"validateItems")}a(m9s,"validateArray");Rl.validateArray=m9s;function g9s(t){let{gen:e,schema:r,keyword:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,Plr.alwaysValidSchema)(o,u))&&!o.opts.unevaluated)return;let c=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((u,d)=>{let f=t.subschema({keyword:n,schemaProp:d,compositeRule:!0},l);e.assign(c,(0,fd._)`${c} || ${l}`),t.mergeValidEvaluated(f,l)||e.if((0,fd.not)(c))})),t.result(c,()=>t.reset(),()=>t.error(!0))}a(g9s,"validateUnion");Rl.validateUnion=g9s});var hWn=I(z5=>{"use strict";p();Object.defineProperty(z5,"__esModule",{value:!0});z5.validateKeywordUsage=z5.validSchemaType=z5.funcKeywordCode=z5.macroKeywordCode=void 0;var mv=Es(),CX=p8(),A9s=zw(),y9s=sDe();function E9s(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:c}=t,l=e.macro.call(c.self,o,s,c),u=pWn(r,n,l);c.opts.validateSchema!==!1&&c.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:mv.nil,errSchemaPath:`${c.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}a(E9s,"macroKeywordCode");z5.macroKeywordCode=E9s;function _9s(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:c,$data:l,it:u}=t;C9s(u,e);let d=!l&&e.compile?e.compile.call(u.self,s,c,u):e.validate,f=pWn(n,o,d),h=n.let("valid");t.block$data(h,m),t.ok((r=e.valid)!==null&&r!==void 0?r:h);function m(){if(e.errors===!1)y(),e.modifying&&fWn(t),E(()=>t.error());else{let _=e.async?g():A();e.modifying&&fWn(t),E(()=>v9s(t,_))}}a(m,"validateKeyword");function g(){let _=n.let("ruleErrs",null);return n.try(()=>y((0,mv._)`await `),v=>n.assign(h,!1).if((0,mv._)`${v} instanceof ${u.ValidationError}`,()=>n.assign(_,(0,mv._)`${v}.errors`),()=>n.throw(v))),_}a(g,"validateAsync");function A(){let _=(0,mv._)`${f}.errors`;return n.assign(_,null),y(mv.nil),_}a(A,"validateSync");function y(_=e.async?(0,mv._)`await `:mv.nil){let v=u.opts.passContext?CX.default.this:CX.default.self,b=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,mv._)`${_}${(0,A9s.callValidateCode)(t,f,v,b)}`,e.modifying)}a(y,"assignValid");function E(_){var v;n.if((0,mv.not)((v=e.valid)!==null&&v!==void 0?v:h),_)}a(E,"reportErrs")}a(_9s,"funcKeywordCode");z5.funcKeywordCode=_9s;function fWn(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,mv._)`${n.parentData}[${n.parentDataProperty}]`))}a(fWn,"modifyData");function v9s(t,e){let{gen:r}=t;r.if((0,mv._)`Array.isArray(${e})`,()=>{r.assign(CX.default.vErrors,(0,mv._)`${CX.default.vErrors} === null ? ${e} : ${CX.default.vErrors}.concat(${e})`).assign(CX.default.errors,(0,mv._)`${CX.default.vErrors}.length`),(0,y9s.extendErrors)(t)},()=>t.error())}a(v9s,"addErrs");function C9s({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}a(C9s,"checkAsyncKeyword");function pWn(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,mv.stringify)(r)})}a(pWn,"useKeyword");function b9s(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}a(b9s,"validSchemaType");z5.validSchemaType=b9s;function S9s({schema:t,opts:e,self:r,errSchemaPath:n},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");let c=o.dependencies;if(c?.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${s}: ${c.join(",")}`);if(o.validateSchema&&!o.validateSchema(t[s])){let u=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}a(S9s,"validateKeywordUsage");z5.validateKeywordUsage=S9s});var gWn=I(mH=>{"use strict";p();Object.defineProperty(mH,"__esModule",{value:!0});mH.extendSubschemaMode=mH.extendSubschemaData=mH.getSubschema=void 0;var Y5=Es(),mWn=Ka();function T9s(t,{keyword:e,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let l=t.schema[e];return r===void 0?{schema:l,schemaPath:(0,Y5._)`${t.schemaPath}${(0,Y5.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,Y5._)`${t.schemaPath}${(0,Y5.getProperty)(e)}${(0,Y5.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,mWn.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||s===void 0||c===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}a(T9s,"getSubschema");mH.getSubschema=T9s;function I9s(t,e,{dataProp:r,dataPropType:n,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(r!==void 0){let{errorPath:d,dataPathArr:f,opts:h}=e,m=l.let("data",(0,Y5._)`${e.data}${(0,Y5.getProperty)(r)}`,!0);u(m),t.errorPath=(0,Y5.str)`${d}${(0,mWn.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,Y5._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(o!==void 0){let d=o instanceof Y5.Name?o:l.let("data",o,!0);u(d),c!==void 0&&(t.propertyName=c)}s&&(t.dataTypes=s);function u(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}a(u,"dataContextProps")}a(I9s,"extendSubschemaData");mH.extendSubschemaData=I9s;function x9s(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:s}){n!==void 0&&(t.compositeRule=n),o!==void 0&&(t.createErrors=o),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}a(x9s,"extendSubschemaMode");mH.extendSubschemaMode=x9s});var Mlr=I((pCf,AWn)=>{"use strict";p();AWn.exports=a(function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!t(e[o],r[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var c=s[o];if(!t(e[c],r[c]))return!1}return!0}return e!==e&&r!==r},"equal")});var EWn=I((gCf,yWn)=>{"use strict";p();var gH=yWn.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};tct(e,n,o,t,"",t)};gH.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};gH.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};gH.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};gH.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function tct(t,e,r,n,o,s,c,l,u,d){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,o,s,c,l,u,d);for(var f in n){var h=n[f];if(Array.isArray(h)){if(f in gH.arrayKeywords)for(var m=0;m{"use strict";p();Object.defineProperty(Tb,"__esModule",{value:!0});Tb.getSchemaRefs=Tb.resolveUrl=Tb.normalizeId=Tb._getFullPath=Tb.getFullPath=Tb.inlineRef=void 0;var R9s=Ka(),k9s=Mlr(),P9s=EWn(),D9s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function N9s(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Olr(t):e?_Wn(t)<=e:!1}a(N9s,"inlineRef");Tb.inlineRef=N9s;var M9s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Olr(t){for(let e in t){if(M9s.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Olr)||typeof r=="object"&&Olr(r))return!0}return!1}a(Olr,"hasRef");function _Wn(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!D9s.has(r)&&(typeof t[r]=="object"&&(0,R9s.eachItem)(t[r],n=>e+=_Wn(n)),e===1/0))return 1/0}return e}a(_Wn,"countKeys");function vWn(t,e="",r){r!==!1&&(e=nhe(e));let n=t.parse(e);return CWn(t,n)}a(vWn,"getFullPath");Tb.getFullPath=vWn;function CWn(t,e){return t.serialize(e).split("#")[0]+"#"}a(CWn,"_getFullPath");Tb._getFullPath=CWn;var O9s=/#\/?$/;function nhe(t){return t?t.replace(O9s,""):""}a(nhe,"normalizeId");Tb.normalizeId=nhe;function L9s(t,e,r){return r=nhe(r),t.resolve(e,r)}a(L9s,"resolveUrl");Tb.resolveUrl=L9s;var B9s=/^[a-z_][-a-z0-9._]*$/i;function F9s(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=nhe(t[r]||e),s={"":o},c=vWn(n,o,!1),l={},u=new Set;return P9s(t,{allKeys:!0},(h,m,g,A)=>{if(A===void 0)return;let y=c+m,E=s[A];typeof h[r]=="string"&&(E=_.call(this,h[r])),v.call(this,h.$anchor),v.call(this,h.$dynamicAnchor),s[m]=E;function _(b){let T=this.opts.uriResolver.resolve;if(b=nhe(E?T(E,b):b),u.has(b))throw f(b);u.add(b);let w=this.refs[b];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?d(h,w.schema,b):b!==nhe(y)&&(b[0]==="#"?(d(h,l[b],b),l[b]=h):this.refs[b]=y),b}a(_,"addRef");function v(b){if(typeof b=="string"){if(!B9s.test(b))throw new Error(`invalid anchor "${b}"`);_.call(this,`#${b}`)}}a(v,"addAnchor")}),l;function d(h,m,g){if(m!==void 0&&!k9s(h,m))throw f(g)}a(d,"checkAmbiguosRef");function f(h){return new Error(`reference "${h}" resolves to more than one schema`)}a(f,"ambiguos")}a(F9s,"getSchemaRefs");Tb.getSchemaRefs=F9s});var dDe=I(AH=>{"use strict";p();Object.defineProperty(AH,"__esModule",{value:!0});AH.getData=AH.KeywordCxt=AH.validateFunctionCode=void 0;var xWn=rWn(),bWn=aDe(),Blr=xlr(),rct=aDe(),U9s=lWn(),uDe=hWn(),Llr=gWn(),oi=Es(),po=p8(),Q9s=cDe(),h8=Ka(),lDe=sDe();function q9s(t){if(kWn(t)&&(PWn(t),RWn(t))){G9s(t);return}wWn(t,()=>(0,xWn.topBoolOrEmptySchema)(t))}a(q9s,"validateFunctionCode");AH.validateFunctionCode=q9s;function wWn({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,oi._)`${po.default.data}, ${po.default.valCxt}`,n.$async,()=>{t.code((0,oi._)`"use strict"; ${SWn(r,o)}`),H9s(t,o),t.code(s)}):t.func(e,(0,oi._)`${po.default.data}, ${j9s(o)}`,n.$async,()=>t.code(SWn(r,o)).code(s))}a(wWn,"validateFunction");function j9s(t){return(0,oi._)`{${po.default.instancePath}="", ${po.default.parentData}, ${po.default.parentDataProperty}, ${po.default.rootData}=${po.default.data}${t.dynamicRef?(0,oi._)`, ${po.default.dynamicAnchors}={}`:oi.nil}}={}`}a(j9s,"destructureValCxt");function H9s(t,e){t.if(po.default.valCxt,()=>{t.var(po.default.instancePath,(0,oi._)`${po.default.valCxt}.${po.default.instancePath}`),t.var(po.default.parentData,(0,oi._)`${po.default.valCxt}.${po.default.parentData}`),t.var(po.default.parentDataProperty,(0,oi._)`${po.default.valCxt}.${po.default.parentDataProperty}`),t.var(po.default.rootData,(0,oi._)`${po.default.valCxt}.${po.default.rootData}`),e.dynamicRef&&t.var(po.default.dynamicAnchors,(0,oi._)`${po.default.valCxt}.${po.default.dynamicAnchors}`)},()=>{t.var(po.default.instancePath,(0,oi._)`""`),t.var(po.default.parentData,(0,oi._)`undefined`),t.var(po.default.parentDataProperty,(0,oi._)`undefined`),t.var(po.default.rootData,po.default.data),e.dynamicRef&&t.var(po.default.dynamicAnchors,(0,oi._)`{}`)})}a(H9s,"destructureValCxtES5");function G9s(t){let{schema:e,opts:r,gen:n}=t;wWn(t,()=>{r.$comment&&e.$comment&&NWn(t),Y9s(t),n.let(po.default.vErrors,null),n.let(po.default.errors,0),r.unevaluated&&$9s(t),DWn(t),Z9s(t)})}a(G9s,"topSchemaObjCode");function $9s(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,oi._)`${r}.evaluated`),e.if((0,oi._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,oi._)`${t.evaluated}.props`,(0,oi._)`undefined`)),e.if((0,oi._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,oi._)`${t.evaluated}.items`,(0,oi._)`undefined`))}a($9s,"resetEvaluated");function SWn(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,oi._)`/*# sourceURL=${r} */`:oi.nil}a(SWn,"funcSourceUrl");function V9s(t,e){if(kWn(t)&&(PWn(t),RWn(t))){W9s(t,e);return}(0,xWn.boolOrEmptySchema)(t,e)}a(V9s,"subschemaCode");function RWn({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}a(RWn,"schemaCxtHasRules");function kWn(t){return typeof t.schema!="boolean"}a(kWn,"isSchemaObj");function W9s(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&NWn(t),K9s(t),J9s(t);let s=n.const("_errs",po.default.errors);DWn(t,s),n.var(e,(0,oi._)`${s} === ${po.default.errors}`)}a(W9s,"subSchemaObjCode");function PWn(t){(0,h8.checkUnknownRules)(t),z9s(t)}a(PWn,"checkKeywords");function DWn(t,e){if(t.opts.jtd)return TWn(t,[],!1,e);let r=(0,bWn.getSchemaTypes)(t.schema),n=(0,bWn.coerceAndCheckDataType)(t,r);TWn(t,r,!n,e)}a(DWn,"typeAndKeywords");function z9s(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,h8.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}a(z9s,"checkRefsAndKeywords");function Y9s(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,h8.checkStrictMode)(t,"default is ignored in the schema root")}a(Y9s,"checkNoDefault");function K9s(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Q9s.resolveUrl)(t.opts.uriResolver,t.baseId,e))}a(K9s,"updateContext");function J9s(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}a(J9s,"checkAsyncSchema");function NWn({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,oi._)`${po.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let c=(0,oi.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,oi._)`${po.default.self}.opts.$comment(${s}, ${c}, ${l}.schema)`)}}a(NWn,"commentKeyword");function Z9s(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,oi._)`${po.default.errors} === 0`,()=>e.return(po.default.data),()=>e.throw((0,oi._)`new ${o}(${po.default.vErrors})`)):(e.assign((0,oi._)`${n}.errors`,po.default.vErrors),s.unevaluated&&X9s(t),e.return((0,oi._)`${po.default.errors} === 0`))}a(Z9s,"returnResults");function X9s({gen:t,evaluated:e,props:r,items:n}){r instanceof oi.Name&&t.assign((0,oi._)`${e}.props`,r),n instanceof oi.Name&&t.assign((0,oi._)`${e}.items`,n)}a(X9s,"assignEvaluated");function TWn(t,e,r,n){let{gen:o,schema:s,data:c,allErrors:l,opts:u,self:d}=t,{RULES:f}=d;if(s.$ref&&(u.ignoreKeywordsWithRef||!(0,h8.schemaHasRulesButRef)(s,f))){o.block(()=>OWn(t,"$ref",f.all.$ref.definition));return}u.jtd||eUs(t,e),o.block(()=>{for(let m of f.rules)h(m);h(f.post)});function h(m){(0,Blr.shouldUseGroup)(s,m)&&(m.type?(o.if((0,rct.checkDataType)(m.type,c,u.strictNumbers)),IWn(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,rct.reportTypeError)(t)),o.endIf()):IWn(t,m),l||o.if((0,oi._)`${po.default.errors} === ${n||0}`))}a(h,"groupKeywords")}a(TWn,"schemaKeywords");function IWn(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,U9s.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Blr.shouldUseRule)(n,s)&&OWn(t,s.keyword,s.definition,e.type)})}a(IWn,"iterateKeywords");function eUs(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(tUs(t,e),t.opts.allowUnionTypes||rUs(t,e),nUs(t,t.dataTypes))}a(eUs,"checkStrictTypes");function tUs(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{MWn(t.dataTypes,r)||Flr(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),oUs(t,e)}}a(tUs,"checkContextTypes");function rUs(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Flr(t,"use allowUnionTypes to allow union type keyword")}a(rUs,"checkMultipleTypes");function nUs(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Blr.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(c=>iUs(e,c))&&Flr(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}a(nUs,"checkKeywordTypes");function iUs(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}a(iUs,"hasApplicableType");function MWn(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}a(MWn,"includesType");function oUs(t,e){let r=[];for(let n of t.dataTypes)MWn(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}a(oUs,"narrowSchemaTypes");function Flr(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,h8.checkStrictMode)(t,e,t.opts.strictTypes)}a(Flr,"strictTypesError");var nct=class{static{a(this,"KeywordCxt")}constructor(e,r,n){if((0,uDe.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h8.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",LWn(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,uDe.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",po.default.errors))}result(e,r,n){this.failResult((0,oi.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,oi.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,oi._)`${r} !== undefined && (${(0,oi.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?lDe.reportExtraError:lDe.reportError)(this,this.def.error,r)}$dataError(){(0,lDe.reportError)(this,this.def.$dataError||lDe.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,lDe.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=oi.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=oi.nil,r=oi.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:c}=this;n.if((0,oi.or)((0,oi._)`${o} === undefined`,r)),e!==oi.nil&&n.assign(e,!0),(s.length||c.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==oi.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,oi.or)(c(),l());function c(){if(n.length){if(!(r instanceof oi.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,oi._)`${(0,rct.checkDataTypes)(u,r,s.opts.strictNumbers,rct.DataType.Wrong)}`}return oi.nil}function l(){if(o.validateSchema){let u=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,oi._)`!${u}(${r})`}return oi.nil}}subschema(e,r){let n=(0,Llr.getSubschema)(this.it,e);(0,Llr.extendSubschemaData)(n,this.it,e),(0,Llr.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return V9s(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=h8.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=h8.mergeEvaluated.items(o,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(e,oi.Name)),!0}};AH.KeywordCxt=nct;function OWn(t,e,r,n){let o=new nct(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,uDe.funcKeywordCode)(o,r):"macro"in r?(0,uDe.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,uDe.funcKeywordCode)(o,r)}a(OWn,"keywordCode");var sUs=/^\/(?:[^~]|~0|~1)*$/,aUs=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function LWn(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return po.default.rootData;if(t[0]==="/"){if(!sUs.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=po.default.rootData}else{let d=aUs.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let f=+d[1];if(o=d[2],o==="#"){if(f>=e)throw new Error(u("property/index",f));return n[e-f]}if(f>e)throw new Error(u("data",f));if(s=r[e-f],!o)return s}let c=s,l=o.split("/");for(let d of l)d&&(s=(0,oi._)`${s}${(0,oi.getProperty)((0,h8.unescapeJsonPointer)(d))}`,c=(0,oi._)`${c} && ${s}`);return c;function u(d,f){return`Cannot access ${d} ${f} levels up, current level is ${e}`}}a(LWn,"getData");AH.getData=LWn});var ict=I(Qlr=>{"use strict";p();Object.defineProperty(Qlr,"__esModule",{value:!0});var Ulr=class extends Error{static{a(this,"ValidationError")}constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Qlr.default=Ulr});var fDe=I(Hlr=>{"use strict";p();Object.defineProperty(Hlr,"__esModule",{value:!0});var qlr=cDe(),jlr=class extends Error{static{a(this,"MissingRefError")}constructor(e,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,qlr.resolveUrl)(e,r,n),this.missingSchema=(0,qlr.normalizeId)((0,qlr.getFullPath)(e,this.missingRef))}};Hlr.default=jlr});var sct=I(Yw=>{"use strict";p();Object.defineProperty(Yw,"__esModule",{value:!0});Yw.resolveSchema=Yw.getCompilingSchema=Yw.resolveRef=Yw.compileSchema=Yw.SchemaEnv=void 0;var N2=Es(),cUs=ict(),bX=p8(),M2=cDe(),BWn=Ka(),lUs=dDe(),ihe=class{static{a(this,"SchemaEnv")}constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,M2.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Yw.SchemaEnv=ihe;function $lr(t){let e=FWn.call(this,t);if(e)return e;let r=(0,M2.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,c=new N2.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),l;t.$async&&(l=c.scopeValue("Error",{ref:cUs.default,code:(0,N2._)`require("ajv/dist/runtime/validation_error").default`}));let u=c.scopeName("validate");t.validateName=u;let d={gen:c,allErrors:this.opts.allErrors,data:bX.default.data,parentData:bX.default.parentData,parentDataProperty:bX.default.parentDataProperty,dataNames:[bX.default.data],dataPathArr:[N2.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,N2.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:N2.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,N2._)`""`,opts:this.opts,self:this},f;try{this._compilations.add(t),(0,lUs.validateFunctionCode)(d),c.optimize(this.opts.code.optimize);let h=c.toString();f=`${c.scopeRefs(bX.default.scope)}return ${h}`,this.opts.code.process&&(f=this.opts.code.process(f,t));let g=new Function(`${bX.default.self}`,`${bX.default.scope}`,f)(this,this.scope.get());if(this.scope.value(u,{ref:g}),g.errors=null,g.schema=t.schema,g.schemaEnv=t,t.$async&&(g.$async=!0),this.opts.code.source===!0&&(g.source={validateName:u,validateCode:h,scopeValues:c._values}),this.opts.unevaluated){let{props:A,items:y}=d;g.evaluated={props:A instanceof N2.Name?void 0:A,items:y instanceof N2.Name?void 0:y,dynamicProps:A instanceof N2.Name,dynamicItems:y instanceof N2.Name},g.source&&(g.source.evaluated=(0,N2.stringify)(g.evaluated))}return t.validate=g,t}catch(h){throw delete t.validate,delete t.validateName,f&&this.logger.error("Error compiling schema, function code:",f),h}finally{this._compilations.delete(t)}}a($lr,"compileSchema");Yw.compileSchema=$lr;function uUs(t,e,r){var n;r=(0,M2.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=pUs.call(this,t,r);if(s===void 0){let c=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;c&&(s=new ihe({schema:c,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=dUs.call(this,s)}a(uUs,"resolveRef");Yw.resolveRef=uUs;function dUs(t){return(0,M2.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:$lr.call(this,t)}a(dUs,"inlineOrCompile");function FWn(t){for(let e of this._compilations)if(fUs(e,t))return e}a(FWn,"getCompilingSchema");Yw.getCompilingSchema=FWn;function fUs(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}a(fUs,"sameSchemaEnv");function pUs(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||oct.call(this,t,e)}a(pUs,"resolve");function oct(t,e){let r=this.opts.uriResolver.parse(e),n=(0,M2._getFullPath)(this.opts.uriResolver,r),o=(0,M2.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return Glr.call(this,r,t);let s=(0,M2.normalizeId)(n),c=this.refs[s]||this.schemas[s];if(typeof c=="string"){let l=oct.call(this,t,c);return typeof l?.schema!="object"?void 0:Glr.call(this,r,l)}if(typeof c?.schema=="object"){if(c.validate||$lr.call(this,c),s===(0,M2.normalizeId)(e)){let{schema:l}=c,{schemaId:u}=this.opts,d=l[u];return d&&(o=(0,M2.resolveUrl)(this.opts.uriResolver,o,d)),new ihe({schema:l,schemaId:u,root:t,baseId:o})}return Glr.call(this,r,c)}}a(oct,"resolveSchema");Yw.resolveSchema=oct;var hUs=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Glr(t,{baseId:e,schema:r,root:n}){var o;if(((o=t.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let l of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,BWn.unescapeFragment)(l)];if(u===void 0)return;r=u;let d=typeof r=="object"&&r[this.opts.schemaId];!hUs.has(l)&&d&&(e=(0,M2.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,BWn.schemaHasRulesButRef)(r,this.RULES)){let l=(0,M2.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=oct.call(this,n,l)}let{schemaId:c}=this.opts;if(s=s||new ihe({schema:r,schemaId:c,root:n,baseId:e}),s.schema!==s.root.schema)return s}a(Glr,"getJsonPointer")});var UWn=I((MCf,mUs)=>{mUs.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var zlr=I((OCf,$Wn)=>{"use strict";p();var gUs=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),qWn=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),Vlr=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),jWn=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),AUs=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Wlr(t){let e="",r=0,n=0;for(n=0;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}a(Wlr,"stringArrayToHexStripped");var yUs=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function QWn(t){return t.length=0,!0}a(QWn,"consumeIsZone");function EUs(t,e,r){if(t.length){let n=Wlr(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}a(EUs,"consumeHextets");function _Us(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,c=!1,l=EUs;for(let u=0;u7){r.error=!0;break}u>0&&t[u-1]===":"&&(s=!0),n.push(":");continue}else if(d==="%"){if(!l(o,n,r))break;l=QWn}else{o.push(d);continue}}return o.length&&(l===QWn?r.zone=o.join(""):c?n.push(o.join("")):n.push(Wlr(o))),r.address=n.join(""),r}a(_Us,"getIPV6");function HWn(t){if(vUs(t,":")<2)return{host:t,isIPV6:!1};let e=_Us(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}a(HWn,"normalizeIPv6");function vUs(t,e){let r=0;for(let n=0;nbUs[n])}a(GWn,"reescapeHostDelimiters");function IUs(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n{"use strict";p();var{isUUID:kUs}=zlr(),PUs=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,DUs=["http","https","ws","wss","urn","urn:uuid"];function NUs(t){return DUs.indexOf(t)!==-1}a(NUs,"isValidSchemeName");function Ylr(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}a(Ylr,"wsIsSecure");function VWn(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}a(VWn,"httpParse");function WWn(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}a(WWn,"httpSerialize");function MUs(t){return t.secure=Ylr(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}a(MUs,"wsParse");function OUs(t){if((t.port===(Ylr(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}a(OUs,"wsSerialize");function LUs(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(PUs);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let o=`${n}:${e.nid||t.nid}`,s=Klr(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}a(LUs,"urnParse");function BUs(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),o=`${r}:${e.nid||n}`,s=Klr(o);s&&(t=s.serialize(t,e));let c=t,l=t.nss;return c.path=`${n||e.nid}:${l}`,e.skipEscape=!0,c}a(BUs,"urnSerialize");function FUs(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!kUs(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}a(FUs,"urnuuidParse");function UUs(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}a(UUs,"urnuuidSerialize");var zWn={scheme:"http",domainHost:!0,parse:VWn,serialize:WWn},QUs={scheme:"https",domainHost:zWn.domainHost,parse:VWn,serialize:WWn},act={scheme:"ws",domainHost:!0,parse:MUs,serialize:OUs},qUs={scheme:"wss",domainHost:act.domainHost,parse:act.parse,serialize:act.serialize},jUs={scheme:"urn",parse:LUs,serialize:BUs,skipNormalize:!0},HUs={scheme:"urn:uuid",parse:FUs,serialize:UUs,skipNormalize:!0},cct={http:zWn,https:QUs,ws:act,wss:qUs,urn:jUs,"urn:uuid":HUs};Object.setPrototypeOf(cct,null);function Klr(t){return t&&(cct[t]||cct[t.toLowerCase()])||void 0}a(Klr,"getSchemeHandler");YWn.exports={wsIsSecure:Ylr,SCHEMES:cct,isValidSchemeName:NUs,getSchemeHandler:Klr}});var rzn=I((qCf,lct)=>{"use strict";p();var{normalizeIPv6:GUs,removeDotSegments:pDe,recomposeAuthority:$Us,normalizePercentEncoding:VUs,normalizePathEncoding:WUs,escapePreservingEscapes:zUs,reescapeHostDelimiters:YUs,isIPv4:KUs,nonSimpleDomain:JUs}=zlr(),{SCHEMES:ZUs,getSchemeHandler:ZWn}=KWn();function XUs(t,e){return typeof t=="string"?t=i7s(t,e):typeof t=="object"&&(t=ohe(SX(t,e),e)),t}a(XUs,"normalize");function e7s(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=XWn(ohe(t,n),ohe(e,n),n,!0);return n.skipEscape=!0,SX(o,n)}a(e7s,"resolve");function XWn(t,e,r,n){let o={};return n||(t=ohe(SX(t,r),r),e=ohe(SX(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(o.scheme=e.scheme,o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=pDe(e.path||""),o.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=pDe(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=pDe(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?o.path="/"+e.path:t.path?o.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:o.path=e.path,o.path=pDe(o.path)),o.query=e.query):(o.path=t.path,e.query!==void 0?o.query=e.query:o.query=t.query),o.userinfo=t.userinfo,o.host=t.host,o.port=t.port),o.scheme=t.scheme),o.fragment=e.fragment,o}a(XWn,"resolveComponent");function t7s(t,e,r){let n=JWn(t,r),o=JWn(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}a(t7s,"equal");function SX(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),o=[],s=ZWn(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=VUs(r.path):(r.path=zUs(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let c=$Us(r);if(c!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(c),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=pDe(l)),c===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),o.push(l)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}a(SX,"serialize");var r7s=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function n7s(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}a(n7s,"getParseError");function ezn(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let c=t.match(r7s);if(c){n.scheme=c[1],n.userinfo=c[3],n.host=c[4],n.port=parseInt(c[5],10),n.path=c[6]||"",n.query=c[7],n.fragment=c[8],isNaN(n.port)&&(n.port=c[5]);let l=n7s(n,c);if(l!==void 0&&(n.error=n.error||l,o=!0),n.host)if(KUs(n.host)===!1){let f=GUs(n.host);n.host=f.host.toLowerCase(),s=f.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let u=ZWn(r.scheme||n.scheme);if(!r.unicodeSupport&&(!u||!u.unicodeSupport)&&n.host&&(r.domainHost||u&&u.domainHost)&&s===!1&&JUs(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!u||u&&!u.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=YUs(unescape(n.host),s))),n.path&&(n.path=WUs(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}u&&u.parse&&u.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}a(ezn,"parseWithStatus");function ohe(t,e){return ezn(t,e).parsed}a(ohe,"parse");function i7s(t,e){return tzn(t,e).normalized}a(i7s,"normalizeString");function tzn(t,e){let{parsed:r,malformedAuthorityOrPort:n}=ezn(t,e);return{normalized:n?t:SX(r,e),malformedAuthorityOrPort:n}}a(tzn,"normalizeStringWithStatus");function JWn(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=tzn(t,e);return n?void 0:r}if(typeof t=="object")return SX(t,e)}a(JWn,"normalizeComparableURI");var Jlr={SCHEMES:ZUs,normalize:XUs,resolve:e7s,resolveComponent:XWn,equal:t7s,serialize:SX,parse:ohe};lct.exports=Jlr;lct.exports.default=Jlr;lct.exports.fastUri=Jlr});var izn=I(Zlr=>{"use strict";p();Object.defineProperty(Zlr,"__esModule",{value:!0});var nzn=rzn();nzn.code='require("ajv/dist/runtime/uri").default';Zlr.default=nzn});var fzn=I(ZA=>{"use strict";p();Object.defineProperty(ZA,"__esModule",{value:!0});ZA.CodeGen=ZA.Name=ZA.nil=ZA.stringify=ZA.str=ZA._=ZA.KeywordCxt=void 0;var o7s=dDe();Object.defineProperty(ZA,"KeywordCxt",{enumerable:!0,get:a(function(){return o7s.KeywordCxt},"get")});var she=Es();Object.defineProperty(ZA,"_",{enumerable:!0,get:a(function(){return she._},"get")});Object.defineProperty(ZA,"str",{enumerable:!0,get:a(function(){return she.str},"get")});Object.defineProperty(ZA,"stringify",{enumerable:!0,get:a(function(){return she.stringify},"get")});Object.defineProperty(ZA,"nil",{enumerable:!0,get:a(function(){return she.nil},"get")});Object.defineProperty(ZA,"Name",{enumerable:!0,get:a(function(){return she.Name},"get")});Object.defineProperty(ZA,"CodeGen",{enumerable:!0,get:a(function(){return she.CodeGen},"get")});var s7s=ict(),lzn=fDe(),a7s=Ilr(),hDe=sct(),c7s=Es(),mDe=cDe(),uct=aDe(),eur=Ka(),ozn=UWn(),l7s=izn(),uzn=a((t,e)=>new RegExp(t,e),"defaultRegExp");uzn.code="new RegExp";var u7s=["removeAdditional","useDefaults","coerceTypes"],d7s=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),f7s={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},p7s={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},szn=200;function h7s(t){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D;let N=t.strict,L=(e=t.code)===null||e===void 0?void 0:e.optimize,B=L===!0||L===void 0?1:L||0,q=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:uzn,M=(o=t.uriResolver)!==null&&o!==void 0?o:l7s.default;return{strictSchema:(c=(s=t.strictSchema)!==null&&s!==void 0?s:N)!==null&&c!==void 0?c:!0,strictNumbers:(u=(l=t.strictNumbers)!==null&&l!==void 0?l:N)!==null&&u!==void 0?u:!0,strictTypes:(f=(d=t.strictTypes)!==null&&d!==void 0?d:N)!==null&&f!==void 0?f:"log",strictTuples:(m=(h=t.strictTuples)!==null&&h!==void 0?h:N)!==null&&m!==void 0?m:"log",strictRequired:(A=(g=t.strictRequired)!==null&&g!==void 0?g:N)!==null&&A!==void 0?A:!1,code:t.code?{...t.code,optimize:B,regExp:q}:{optimize:B,regExp:q},loopRequired:(y=t.loopRequired)!==null&&y!==void 0?y:szn,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:szn,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(v=t.messages)!==null&&v!==void 0?v:!0,inlineRefs:(b=t.inlineRefs)!==null&&b!==void 0?b:!0,schemaId:(T=t.schemaId)!==null&&T!==void 0?T:"$id",addUsedSchema:(w=t.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(R=t.validateSchema)!==null&&R!==void 0?R:!0,validateFormats:(x=t.validateFormats)!==null&&x!==void 0?x:!0,unicodeRegExp:(P=t.unicodeRegExp)!==null&&P!==void 0?P:!0,int32range:(D=t.int32range)!==null&&D!==void 0?D:!0,uriResolver:M}}a(h7s,"requiredOptions");var gDe=class{static{a(this,"Ajv")}constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...h7s(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new c7s.ValueScope({scope:{},prefixes:d7s,es5:r,lines:n}),this.logger=_7s(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a7s.getRules)(),azn.call(this,f7s,e,"NOT SUPPORTED"),azn.call(this,p7s,e,"DEPRECATED","warn"),this._metaOpts=y7s.call(this),e.formats&&g7s.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&A7s.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),m7s.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=ozn;n==="id"&&(o={...ozn},o.id=o.$id,delete o.$id),r&&e&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,e,r);async function o(f,h){await s.call(this,f.$schema);let m=this._addSchema(f,h);return m.validate||c.call(this,m)}async function s(f){f&&!this.getSchema(f)&&await o.call(this,{$ref:f},!0)}async function c(f){try{return this._compileSchemaEnv(f)}catch(h){if(!(h instanceof lzn.default))throw h;return l.call(this,h),await u.call(this,h.missingSchema),c.call(this,f)}}function l({missingSchema:f,missingRef:h}){if(this.refs[f])throw new Error(`AnySchema ${f} is loaded but ${h} cannot be resolved`)}async function u(f){let h=await d.call(this,f);this.refs[f]||await s.call(this,h.$schema),this.refs[f]||this.addSchema(h,f,r)}async function d(f){let h=this._loading[f];if(h)return h;try{return await(this._loading[f]=n(f))}finally{delete this._loading[f]}}}addSchema(e,r,n,o=this.opts.validateSchema){if(Array.isArray(e)){for(let c of e)this.addSchema(c,void 0,n,o);return this}let s;if(typeof e=="object"){let{schemaId:c}=this.opts;if(s=e[c],s!==void 0&&typeof s!="string")throw new Error(`schema ${c} must be string`)}return r=(0,mDe.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,o,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,e);if(!o&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return o}getSchema(e){let r;for(;typeof(r=czn.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new hDe.SchemaEnv({schema:{},schemaId:n});if(r=hDe.resolveSchema.call(this,o,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=czn.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,mDe.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(C7s.call(this,n,r),!r)return(0,eur.eachItem)(n,s=>Xlr.call(this,s)),this;S7s.call(this,r);let o={...r,type:(0,uct.getJSONTypes)(r.type),schemaType:(0,uct.getJSONTypes)(r.schemaType)};return(0,eur.eachItem)(n,o.type.length===0?s=>Xlr.call(this,s,o):s=>o.type.forEach(c=>Xlr.call(this,s,o,c))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let o=n.rules.findIndex(s=>s.keyword===e);o>=0&&n.rules.splice(o,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,s)=>o+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let o of r){let s=o.split("/").slice(1),c=e;for(let l of s)c=c[l];for(let l in n){let u=n[l];if(typeof u!="object")continue;let{$data:d}=u.definition,f=c[l];d&&f&&(c[l]=dzn(f))}}return e}_removeAllSchemas(e,r){for(let n in e){let o=e[n];(!r||r.test(n))&&(typeof o=="string"?delete e[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[n]))}}_addSchema(e,r,n,o=this.opts.validateSchema,s=this.opts.addUsedSchema){let c,{schemaId:l}=this.opts;if(typeof e=="object")c=e[l];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(u!==void 0)return u;n=(0,mDe.normalizeId)(c||n);let d=mDe.getSchemaRefs.call(this,e,n);return u=new hDe.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:d}),this._cache.set(u.schema,u),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),o&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):hDe.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{hDe.compileSchema.call(this,e)}finally{this.opts=r}}};gDe.ValidationError=s7s.default;gDe.MissingRefError=lzn.default;ZA.default=gDe;function azn(t,e,r,n="error"){for(let o in t){let s=o;s in e&&this.logger[n](`${r}: option ${o}. ${t[s]}`)}}a(azn,"checkOptions");function czn(t){return t=(0,mDe.normalizeId)(t),this.schemas[t]||this.refs[t]}a(czn,"getSchEnv");function m7s(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}a(m7s,"addInitialSchemas");function g7s(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}a(g7s,"addInitialFormats");function A7s(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}a(A7s,"addInitialKeywords");function y7s(){let t={...this.opts};for(let e of u7s)delete t[e];return t}a(y7s,"getMetaSchemaOptions");var E7s={log(){},warn(){},error(){}};function _7s(t){if(t===!1)return E7s;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}a(_7s,"getLogger");var v7s=/^[a-z_$][a-z0-9_$:-]*$/i;function C7s(t,e){let{RULES:r}=this;if((0,eur.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!v7s.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}a(C7s,"checkKeyword");function Xlr(t,e,r){var n;let o=e?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,c=o?s.post:s.rules.find(({type:u})=>u===r);if(c||(c={type:r,rules:[]},s.rules.push(c)),s.keywords[t]=!0,!e)return;let l={keyword:t,definition:{...e,type:(0,uct.getJSONTypes)(e.type),schemaType:(0,uct.getJSONTypes)(e.schemaType)}};e.before?b7s.call(this,c,l,e.before):c.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(u=>this.addKeyword(u))}a(Xlr,"addRule");function b7s(t,e,r){let n=t.rules.findIndex(o=>o.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}a(b7s,"addBeforeRule");function S7s(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=dzn(e)),t.validateSchema=this.compile(e,!0))}a(S7s,"keywordMetaschema");var T7s={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function dzn(t){return{anyOf:[t,T7s]}}a(dzn,"schemaOrData")});var pzn=I(tur=>{"use strict";p();Object.defineProperty(tur,"__esModule",{value:!0});var I7s={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};tur.default=I7s});var Azn=I(TX=>{"use strict";p();Object.defineProperty(TX,"__esModule",{value:!0});TX.callRef=TX.getValidate=void 0;var x7s=fDe(),hzn=zw(),Ib=Es(),ahe=p8(),mzn=sct(),dct=Ka(),w7s={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:o,schemaEnv:s,validateName:c,opts:l,self:u}=n,{root:d}=s;if((r==="#"||r==="#/")&&o===d.baseId)return h();let f=mzn.resolveRef.call(u,d,o,r);if(f===void 0)throw new x7s.default(n.opts.uriResolver,o,r);if(f instanceof mzn.SchemaEnv)return m(f);return g(f);function h(){if(s===d)return fct(t,c,s,s.$async);let A=e.scopeValue("root",{ref:d});return fct(t,(0,Ib._)`${A}.validate`,d,d.$async)}function m(A){let y=gzn(t,A);fct(t,y,A,A.$async)}function g(A){let y=e.scopeValue("schema",l.code.source===!0?{ref:A,code:(0,Ib.stringify)(A)}:{ref:A}),E=e.name("valid"),_=t.subschema({schema:A,dataTypes:[],schemaPath:Ib.nil,topSchemaRef:y,errSchemaPath:r},E);t.mergeEvaluated(_),t.ok(E)}}};function gzn(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ib._)`${r.scopeValue("wrapper",{ref:e})}.validate`}a(gzn,"getValidate");TX.getValidate=gzn;function fct(t,e,r,n){let{gen:o,it:s}=t,{allErrors:c,schemaEnv:l,opts:u}=s,d=u.passContext?ahe.default.this:Ib.nil;n?f():h();function f(){if(!l.$async)throw new Error("async schema referenced by sync schema");let A=o.let("valid");o.try(()=>{o.code((0,Ib._)`await ${(0,hzn.callValidateCode)(t,e,d)}`),g(e),c||o.assign(A,!0)},y=>{o.if((0,Ib._)`!(${y} instanceof ${s.ValidationError})`,()=>o.throw(y)),m(y),c||o.assign(A,!1)}),t.ok(A)}a(f,"callAsyncRef");function h(){t.result((0,hzn.callValidateCode)(t,e,d),()=>g(e),()=>m(e))}a(h,"callSyncRef");function m(A){let y=(0,Ib._)`${A}.errors`;o.assign(ahe.default.vErrors,(0,Ib._)`${ahe.default.vErrors} === null ? ${y} : ${ahe.default.vErrors}.concat(${y})`),o.assign(ahe.default.errors,(0,Ib._)`${ahe.default.vErrors}.length`)}a(m,"addErrorsFrom");function g(A){var y;if(!s.opts.unevaluated)return;let E=(y=r?.validate)===null||y===void 0?void 0:y.evaluated;if(s.props!==!0)if(E&&!E.dynamicProps)E.props!==void 0&&(s.props=dct.mergeEvaluated.props(o,E.props,s.props));else{let _=o.var("props",(0,Ib._)`${A}.evaluated.props`);s.props=dct.mergeEvaluated.props(o,_,s.props,Ib.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=dct.mergeEvaluated.items(o,E.items,s.items));else{let _=o.var("items",(0,Ib._)`${A}.evaluated.items`);s.items=dct.mergeEvaluated.items(o,_,s.items,Ib.Name)}}a(g,"addEvaluatedFrom")}a(fct,"callRef");TX.callRef=fct;TX.default=w7s});var yzn=I(rur=>{"use strict";p();Object.defineProperty(rur,"__esModule",{value:!0});var R7s=pzn(),k7s=Azn(),P7s=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",R7s.default,k7s.default];rur.default=P7s});var Ezn=I(nur=>{"use strict";p();Object.defineProperty(nur,"__esModule",{value:!0});var pct=Es(),yH=pct.operators,hct={maximum:{okStr:"<=",ok:yH.LTE,fail:yH.GT},minimum:{okStr:">=",ok:yH.GTE,fail:yH.LT},exclusiveMaximum:{okStr:"<",ok:yH.LT,fail:yH.GTE},exclusiveMinimum:{okStr:">",ok:yH.GT,fail:yH.LTE}},D7s={message:a(({keyword:t,schemaCode:e})=>(0,pct.str)`must be ${hct[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,pct._)`{comparison: ${hct[t].okStr}, limit: ${e}}`,"params")},N7s={keyword:Object.keys(hct),type:"number",schemaType:"number",$data:!0,error:D7s,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,pct._)`${r} ${hct[e].fail} ${n} || isNaN(${r})`)}};nur.default=N7s});var _zn=I(iur=>{"use strict";p();Object.defineProperty(iur,"__esModule",{value:!0});var ADe=Es(),M7s={message:a(({schemaCode:t})=>(0,ADe.str)`must be multiple of ${t}`,"message"),params:a(({schemaCode:t})=>(0,ADe._)`{multipleOf: ${t}}`,"params")},O7s={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:M7s,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,c=e.let("res"),l=s?(0,ADe._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${s}`:(0,ADe._)`${c} !== parseInt(${c})`;t.fail$data((0,ADe._)`(${n} === 0 || (${c} = ${r}/${n}, ${l}))`)}};iur.default=O7s});var Czn=I(our=>{"use strict";p();Object.defineProperty(our,"__esModule",{value:!0});function vzn(t){let e=t.length,r=0,n=0,o;for(;n=55296&&o<=56319&&n{"use strict";p();Object.defineProperty(sur,"__esModule",{value:!0});var IX=Es(),L7s=Ka(),B7s=Czn(),F7s={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,IX.str)`must NOT have ${r} than ${e} characters`},params:a(({schemaCode:t})=>(0,IX._)`{limit: ${t}}`,"params")},U7s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:F7s,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?IX.operators.GT:IX.operators.LT,c=o.opts.unicode===!1?(0,IX._)`${r}.length`:(0,IX._)`${(0,L7s.useFunc)(t.gen,B7s.default)}(${r})`;t.fail$data((0,IX._)`${c} ${s} ${n}`)}};sur.default=U7s});var Szn=I(aur=>{"use strict";p();Object.defineProperty(aur,"__esModule",{value:!0});var Q7s=zw(),q7s=Ka(),che=Es(),j7s={message:a(({schemaCode:t})=>(0,che.str)`must match pattern "${t}"`,"message"),params:a(({schemaCode:t})=>(0,che._)`{pattern: ${t}}`,"params")},H7s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:j7s,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:c}=t,l=c.opts.unicodeRegExp?"u":"";if(n){let{regExp:u}=c.opts.code,d=u.code==="new RegExp"?(0,che._)`new RegExp`:(0,q7s.useFunc)(e,u),f=e.let("valid");e.try(()=>e.assign(f,(0,che._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(f,!1)),t.fail$data((0,che._)`!${f}`)}else{let u=(0,Q7s.usePattern)(t,o);t.fail$data((0,che._)`!${u}.test(${r})`)}}};aur.default=H7s});var Tzn=I(cur=>{"use strict";p();Object.defineProperty(cur,"__esModule",{value:!0});var yDe=Es(),G7s={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,yDe.str)`must NOT have ${r} than ${e} properties`},params:a(({schemaCode:t})=>(0,yDe._)`{limit: ${t}}`,"params")},$7s={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:G7s,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?yDe.operators.GT:yDe.operators.LT;t.fail$data((0,yDe._)`Object.keys(${r}).length ${o} ${n}`)}};cur.default=$7s});var Izn=I(lur=>{"use strict";p();Object.defineProperty(lur,"__esModule",{value:!0});var EDe=zw(),_De=Es(),V7s=Ka(),W7s={message:a(({params:{missingProperty:t}})=>(0,_De.str)`must have required property '${t}'`,"message"),params:a(({params:{missingProperty:t}})=>(0,_De._)`{missingProperty: ${t}}`,"params")},z7s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:W7s,code(t){let{gen:e,schema:r,schemaCode:n,data:o,$data:s,it:c}=t,{opts:l}=c;if(!s&&r.length===0)return;let u=r.length>=l.loopRequired;if(c.allErrors?d():f(),l.strictRequired){let g=t.parentSchema.properties,{definedProperties:A}=t.it;for(let y of r)if(g?.[y]===void 0&&!A.has(y)){let E=c.schemaEnv.baseId+c.errSchemaPath,_=`required property "${y}" is not defined at "${E}" (strictRequired)`;(0,V7s.checkStrictMode)(c,_,c.opts.strictRequired)}}function d(){if(u||s)t.block$data(_De.nil,h);else for(let g of r)(0,EDe.checkReportMissingProp)(t,g)}a(d,"allErrorsMode");function f(){let g=e.let("missing");if(u||s){let A=e.let("valid",!0);t.block$data(A,()=>m(g,A)),t.ok(A)}else e.if((0,EDe.checkMissingProp)(t,r,g)),(0,EDe.reportMissingProp)(t,g),e.else()}a(f,"exitOnErrorMode");function h(){e.forOf("prop",n,g=>{t.setParams({missingProperty:g}),e.if((0,EDe.noPropertyInData)(e,o,g,l.ownProperties),()=>t.error())})}a(h,"loopAllRequired");function m(g,A){t.setParams({missingProperty:g}),e.forOf(g,n,()=>{e.assign(A,(0,EDe.propertyInData)(e,o,g,l.ownProperties)),e.if((0,_De.not)(A),()=>{t.error(),e.break()})},_De.nil)}a(m,"loopUntilMissing")}};lur.default=z7s});var xzn=I(uur=>{"use strict";p();Object.defineProperty(uur,"__esModule",{value:!0});var vDe=Es(),Y7s={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,vDe.str)`must NOT have ${r} than ${e} items`},params:a(({schemaCode:t})=>(0,vDe._)`{limit: ${t}}`,"params")},K7s={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Y7s,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?vDe.operators.GT:vDe.operators.LT;t.fail$data((0,vDe._)`${r}.length ${o} ${n}`)}};uur.default=K7s});var mct=I(dur=>{"use strict";p();Object.defineProperty(dur,"__esModule",{value:!0});var wzn=Mlr();wzn.code='require("ajv/dist/runtime/equal").default';dur.default=wzn});var Rzn=I(pur=>{"use strict";p();Object.defineProperty(pur,"__esModule",{value:!0});var fur=aDe(),XA=Es(),J7s=Ka(),Z7s=mct(),X7s={message:a(({params:{i:t,j:e}})=>(0,XA.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,"message"),params:a(({params:{i:t,j:e}})=>(0,XA._)`{i: ${t}, j: ${e}}`,"params")},eQs={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:X7s,code(t){let{gen:e,data:r,$data:n,schema:o,parentSchema:s,schemaCode:c,it:l}=t;if(!n&&!o)return;let u=e.let("valid"),d=s.items?(0,fur.getSchemaTypes)(s.items):[];t.block$data(u,f,(0,XA._)`${c} === false`),t.ok(u);function f(){let A=e.let("i",(0,XA._)`${r}.length`),y=e.let("j");t.setParams({i:A,j:y}),e.assign(u,!0),e.if((0,XA._)`${A} > 1`,()=>(h()?m:g)(A,y))}a(f,"validateUniqueItems");function h(){return d.length>0&&!d.some(A=>A==="object"||A==="array")}a(h,"canOptimize");function m(A,y){let E=e.name("item"),_=(0,fur.checkDataTypes)(d,E,l.opts.strictNumbers,fur.DataType.Wrong),v=e.const("indices",(0,XA._)`{}`);e.for((0,XA._)`;${A}--;`,()=>{e.let(E,(0,XA._)`${r}[${A}]`),e.if(_,(0,XA._)`continue`),d.length>1&&e.if((0,XA._)`typeof ${E} == "string"`,(0,XA._)`${E} += "_"`),e.if((0,XA._)`typeof ${v}[${E}] == "number"`,()=>{e.assign(y,(0,XA._)`${v}[${E}]`),t.error(),e.assign(u,!1).break()}).code((0,XA._)`${v}[${E}] = ${A}`)})}a(m,"loopN");function g(A,y){let E=(0,J7s.useFunc)(e,Z7s.default),_=e.name("outer");e.label(_).for((0,XA._)`;${A}--;`,()=>e.for((0,XA._)`${y} = ${A}; ${y}--;`,()=>e.if((0,XA._)`${E}(${r}[${A}], ${r}[${y}])`,()=>{t.error(),e.assign(u,!1).break(_)})))}a(g,"loopN2")}};pur.default=eQs});var kzn=I(mur=>{"use strict";p();Object.defineProperty(mur,"__esModule",{value:!0});var hur=Es(),tQs=Ka(),rQs=mct(),nQs={message:"must be equal to constant",params:a(({schemaCode:t})=>(0,hur._)`{allowedValue: ${t}}`,"params")},iQs={keyword:"const",$data:!0,error:nQs,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,hur._)`!${(0,tQs.useFunc)(e,rQs.default)}(${r}, ${o})`):t.fail((0,hur._)`${s} !== ${r}`)}};mur.default=iQs});var Pzn=I(gur=>{"use strict";p();Object.defineProperty(gur,"__esModule",{value:!0});var CDe=Es(),oQs=Ka(),sQs=mct(),aQs={message:"must be equal to one of the allowed values",params:a(({schemaCode:t})=>(0,CDe._)`{allowedValues: ${t}}`,"params")},cQs={keyword:"enum",schemaType:"array",$data:!0,error:aQs,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:c}=t;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let l=o.length>=c.opts.loopEnum,u,d=a(()=>u??(u=(0,oQs.useFunc)(e,sQs.default)),"getEql"),f;if(l||n)f=e.let("valid"),t.block$data(f,h);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let g=e.const("vSchema",s);f=(0,CDe.or)(...o.map((A,y)=>m(g,y)))}t.pass(f);function h(){e.assign(f,!1),e.forOf("v",s,g=>e.if((0,CDe._)`${d()}(${r}, ${g})`,()=>e.assign(f,!0).break()))}a(h,"loopEnum");function m(g,A){let y=o[A];return typeof y=="object"&&y!==null?(0,CDe._)`${d()}(${r}, ${g}[${A}])`:(0,CDe._)`${r} === ${y}`}a(m,"equalCode")}};gur.default=cQs});var Dzn=I(Aur=>{"use strict";p();Object.defineProperty(Aur,"__esModule",{value:!0});var lQs=Ezn(),uQs=_zn(),dQs=bzn(),fQs=Szn(),pQs=Tzn(),hQs=Izn(),mQs=xzn(),gQs=Rzn(),AQs=kzn(),yQs=Pzn(),EQs=[lQs.default,uQs.default,dQs.default,fQs.default,pQs.default,hQs.default,mQs.default,gQs.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},AQs.default,yQs.default];Aur.default=EQs});var Eur=I(bDe=>{"use strict";p();Object.defineProperty(bDe,"__esModule",{value:!0});bDe.validateAdditionalItems=void 0;var xX=Es(),yur=Ka(),_Qs={message:a(({params:{len:t}})=>(0,xX.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,xX._)`{limit: ${t}}`,"params")},vQs={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:_Qs,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,yur.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Nzn(t,n)}};function Nzn(t,e){let{gen:r,schema:n,data:o,keyword:s,it:c}=t;c.items=!0;let l=r.const("len",(0,xX._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,xX._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,yur.alwaysValidSchema)(c,n)){let d=r.var("valid",(0,xX._)`${l} <= ${e.length}`);r.if((0,xX.not)(d),()=>u(d)),t.ok(d)}function u(d){r.forRange("i",e.length,l,f=>{t.subschema({keyword:s,dataProp:f,dataPropType:yur.Type.Num},d),c.allErrors||r.if((0,xX.not)(d),()=>r.break())})}a(u,"validateItems")}a(Nzn,"validateAdditionalItems");bDe.validateAdditionalItems=Nzn;bDe.default=vQs});var _ur=I(SDe=>{"use strict";p();Object.defineProperty(SDe,"__esModule",{value:!0});SDe.validateTuple=void 0;var Mzn=Es(),gct=Ka(),CQs=zw(),bQs={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Ozn(t,"additionalItems",e);r.items=!0,!(0,gct.alwaysValidSchema)(r,e)&&t.ok((0,CQs.validateArray)(t))}};function Ozn(t,e,r=t.schema){let{gen:n,parentSchema:o,data:s,keyword:c,it:l}=t;f(o),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=gct.mergeEvaluated.items(n,r.length,l.items));let u=n.name("valid"),d=n.const("len",(0,Mzn._)`${s}.length`);r.forEach((h,m)=>{(0,gct.alwaysValidSchema)(l,h)||(n.if((0,Mzn._)`${d} > ${m}`,()=>t.subschema({keyword:c,schemaProp:m,dataProp:m},u)),t.ok(u))});function f(h){let{opts:m,errSchemaPath:g}=l,A=r.length,y=A===h.minItems&&(A===h.maxItems||h[e]===!1);if(m.strictTuples&&!y){let E=`"${c}" is ${A}-tuple, but minItems or maxItems/${e} are not specified or different at path "${g}"`;(0,gct.checkStrictMode)(l,E,m.strictTuples)}}a(f,"checkStrictTuple")}a(Ozn,"validateTuple");SDe.validateTuple=Ozn;SDe.default=bQs});var Lzn=I(vur=>{"use strict";p();Object.defineProperty(vur,"__esModule",{value:!0});var SQs=_ur(),TQs={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(t=>(0,SQs.validateTuple)(t,"items"),"code")};vur.default=TQs});var Fzn=I(Cur=>{"use strict";p();Object.defineProperty(Cur,"__esModule",{value:!0});var Bzn=Es(),IQs=Ka(),xQs=zw(),wQs=Eur(),RQs={message:a(({params:{len:t}})=>(0,Bzn.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,Bzn._)`{limit: ${t}}`,"params")},kQs={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:RQs,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,IQs.alwaysValidSchema)(n,e)&&(o?(0,wQs.validateAdditionalItems)(t,o):t.ok((0,xQs.validateArray)(t)))}};Cur.default=kQs});var Uzn=I(bur=>{"use strict";p();Object.defineProperty(bur,"__esModule",{value:!0});var Kw=Es(),Act=Ka(),PQs={message:a(({params:{min:t,max:e}})=>e===void 0?(0,Kw.str)`must contain at least ${t} valid item(s)`:(0,Kw.str)`must contain at least ${t} and no more than ${e} valid item(s)`,"message"),params:a(({params:{min:t,max:e}})=>e===void 0?(0,Kw._)`{minContains: ${t}}`:(0,Kw._)`{minContains: ${t}, maxContains: ${e}}`,"params")},DQs={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:PQs,code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t,c,l,{minContains:u,maxContains:d}=n;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=e.const("len",(0,Kw._)`${o}.length`);if(t.setParams({min:c,max:l}),l===void 0&&c===0){(0,Act.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&c>l){(0,Act.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Act.alwaysValidSchema)(s,r)){let y=(0,Kw._)`${f} >= ${c}`;l!==void 0&&(y=(0,Kw._)`${y} && ${f} <= ${l}`),t.pass(y);return}s.items=!0;let h=e.name("valid");l===void 0&&c===1?g(h,()=>e.if(h,()=>e.break())):c===0?(e.let(h,!0),l!==void 0&&e.if((0,Kw._)`${o}.length > 0`,m)):(e.let(h,!1),m()),t.result(h,()=>t.reset());function m(){let y=e.name("_valid"),E=e.let("count",0);g(y,()=>e.if(y,()=>A(E)))}a(m,"validateItemsWithCount");function g(y,E){e.forRange("i",0,f,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:Act.Type.Num,compositeRule:!0},y),E()})}a(g,"validateItems");function A(y){e.code((0,Kw._)`${y}++`),l===void 0?e.if((0,Kw._)`${y} >= ${c}`,()=>e.assign(h,!0).break()):(e.if((0,Kw._)`${y} > ${l}`,()=>e.assign(h,!1).break()),c===1?e.assign(h,!0):e.if((0,Kw._)`${y} >= ${c}`,()=>e.assign(h,!0)))}a(A,"checkLimits")}};bur.default=DQs});var jzn=I(K5=>{"use strict";p();Object.defineProperty(K5,"__esModule",{value:!0});K5.validateSchemaDeps=K5.validatePropertyDeps=K5.error=void 0;var Sur=Es(),NQs=Ka(),TDe=zw();K5.error={message:a(({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Sur.str)`must have ${n} ${r} when property ${t} is present`},"message"),params:a(({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Sur._)`{property: ${t}, - missingProperty: ${n}, - depsCount: ${e}, - deps: ${r}}`,"params")};var MQs={keyword:"dependencies",type:"object",schemaType:"object",error:K5.error,code(t){let[e,r]=OQs(t);Qzn(t,e),qzn(t,r)}};function OQs({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let o=Array.isArray(t[n])?e:r;o[n]=t[n]}return[e,r]}a(OQs,"splitDependencies");function Qzn(t,e=t.schema){let{gen:r,data:n,it:o}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let c in e){let l=e[c];if(l.length===0)continue;let u=(0,TDe.propertyInData)(r,n,c,o.opts.ownProperties);t.setParams({property:c,depsCount:l.length,deps:l.join(", ")}),o.allErrors?r.if(u,()=>{for(let d of l)(0,TDe.checkReportMissingProp)(t,d)}):(r.if((0,Sur._)`${u} && (${(0,TDe.checkMissingProp)(t,l,s)})`),(0,TDe.reportMissingProp)(t,s),r.else())}}a(Qzn,"validatePropertyDeps");K5.validatePropertyDeps=Qzn;function qzn(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,c=r.name("valid");for(let l in e)(0,NQs.alwaysValidSchema)(s,e[l])||(r.if((0,TDe.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let u=t.subschema({keyword:o,schemaProp:l},c);t.mergeValidEvaluated(u,c)},()=>r.var(c,!0)),t.ok(c))}a(qzn,"validateSchemaDeps");K5.validateSchemaDeps=qzn;K5.default=MQs});var Gzn=I(Tur=>{"use strict";p();Object.defineProperty(Tur,"__esModule",{value:!0});var Hzn=Es(),LQs=Ka(),BQs={message:"property name must be valid",params:a(({params:t})=>(0,Hzn._)`{propertyName: ${t.propertyName}}`,"params")},FQs={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:BQs,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,LQs.alwaysValidSchema)(o,r))return;let s=e.name("valid");e.forIn("key",n,c=>{t.setParams({propertyName:c}),t.subschema({keyword:"propertyNames",data:c,dataTypes:["string"],propertyName:c,compositeRule:!0},s),e.if((0,Hzn.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Tur.default=FQs});var xur=I(Iur=>{"use strict";p();Object.defineProperty(Iur,"__esModule",{value:!0});var yct=zw(),O2=Es(),UQs=p8(),Ect=Ka(),QQs={message:"must NOT have additional properties",params:a(({params:t})=>(0,O2._)`{additionalProperty: ${t.additionalProperty}}`,"params")},qQs={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:QQs,code(t){let{gen:e,schema:r,parentSchema:n,data:o,errsCount:s,it:c}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:l,opts:u}=c;if(c.props=!0,u.removeAdditional!=="all"&&(0,Ect.alwaysValidSchema)(c,r))return;let d=(0,yct.allSchemaProperties)(n.properties),f=(0,yct.allSchemaProperties)(n.patternProperties);h(),t.ok((0,O2._)`${s} === ${UQs.default.errors}`);function h(){e.forIn("key",o,E=>{!d.length&&!f.length?A(E):e.if(m(E),()=>A(E))})}a(h,"checkAdditionalProperties");function m(E){let _;if(d.length>8){let v=(0,Ect.schemaRefOrVal)(c,n.properties,"properties");_=(0,yct.isOwnProperty)(e,v,E)}else d.length?_=(0,O2.or)(...d.map(v=>(0,O2._)`${E} === ${v}`)):_=O2.nil;return f.length&&(_=(0,O2.or)(_,...f.map(v=>(0,O2._)`${(0,yct.usePattern)(t,v)}.test(${E})`))),(0,O2.not)(_)}a(m,"isAdditional");function g(E){e.code((0,O2._)`delete ${o}[${E}]`)}a(g,"deleteAdditional");function A(E){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){g(E);return}if(r===!1){t.setParams({additionalProperty:E}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,Ect.alwaysValidSchema)(c,r)){let _=e.name("valid");u.removeAdditional==="failing"?(y(E,_,!1),e.if((0,O2.not)(_),()=>{t.reset(),g(E)})):(y(E,_),l||e.if((0,O2.not)(_),()=>e.break()))}}a(A,"additionalPropertyCode");function y(E,_,v){let b={keyword:"additionalProperties",dataProp:E,dataPropType:Ect.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(b,_)}a(y,"applyAdditionalSchema")}};Iur.default=qQs});var Wzn=I(Rur=>{"use strict";p();Object.defineProperty(Rur,"__esModule",{value:!0});var jQs=dDe(),$zn=zw(),wur=Ka(),Vzn=xur(),HQs={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Vzn.default.code(new jQs.KeywordCxt(s,Vzn.default,"additionalProperties"));let c=(0,$zn.allSchemaProperties)(r);for(let h of c)s.definedProperties.add(h);s.opts.unevaluated&&c.length&&s.props!==!0&&(s.props=wur.mergeEvaluated.props(e,(0,wur.toHash)(c),s.props));let l=c.filter(h=>!(0,wur.alwaysValidSchema)(s,r[h]));if(l.length===0)return;let u=e.name("valid");for(let h of l)d(h)?f(h):(e.if((0,$zn.propertyInData)(e,o,h,s.opts.ownProperties)),f(h),s.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(h),t.ok(u);function d(h){return s.opts.useDefaults&&!s.compositeRule&&r[h].default!==void 0}a(d,"hasDefault");function f(h){t.subschema({keyword:"properties",schemaProp:h,dataProp:h},u)}a(f,"applyPropertySchema")}};Rur.default=HQs});var Jzn=I(kur=>{"use strict";p();Object.defineProperty(kur,"__esModule",{value:!0});var zzn=zw(),_ct=Es(),Yzn=Ka(),Kzn=Ka(),GQs={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:o,it:s}=t,{opts:c}=s,l=(0,zzn.allSchemaProperties)(r),u=l.filter(y=>(0,Yzn.alwaysValidSchema)(s,r[y]));if(l.length===0||u.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let d=c.strictSchema&&!c.allowMatchingProperties&&o.properties,f=e.name("valid");s.props!==!0&&!(s.props instanceof _ct.Name)&&(s.props=(0,Kzn.evaluatedPropsToName)(e,s.props));let{props:h}=s;m();function m(){for(let y of l)d&&g(y),s.allErrors?A(y):(e.var(f,!0),A(y),e.if(f))}a(m,"validatePatternProperties");function g(y){for(let E in d)new RegExp(y).test(E)&&(0,Yzn.checkStrictMode)(s,`property ${E} matches pattern ${y} (use allowMatchingProperties)`)}a(g,"checkMatchingProperties");function A(y){e.forIn("key",n,E=>{e.if((0,_ct._)`${(0,zzn.usePattern)(t,y)}.test(${E})`,()=>{let _=u.includes(y);_||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:E,dataPropType:Kzn.Type.Str},f),s.opts.unevaluated&&h!==!0?e.assign((0,_ct._)`${h}[${E}]`,!0):!_&&!s.allErrors&&e.if((0,_ct.not)(f),()=>e.break())})})}a(A,"validateProperties")}};kur.default=GQs});var Zzn=I(Pur=>{"use strict";p();Object.defineProperty(Pur,"__esModule",{value:!0});var $Qs=Ka(),VQs={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,$Qs.alwaysValidSchema)(n,r)){t.fail();return}let o=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),t.failResult(o,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Pur.default=VQs});var Xzn=I(Dur=>{"use strict";p();Object.defineProperty(Dur,"__esModule",{value:!0});var WQs=zw(),zQs={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:WQs.validateUnion,error:{message:"must match a schema in anyOf"}};Dur.default=zQs});var eYn=I(Nur=>{"use strict";p();Object.defineProperty(Nur,"__esModule",{value:!0});var vct=Es(),YQs=Ka(),KQs={message:"must match exactly one schema in oneOf",params:a(({params:t})=>(0,vct._)`{passingSchemas: ${t.passing}}`,"params")},JQs={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:KQs,code(t){let{gen:e,schema:r,parentSchema:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let s=r,c=e.let("valid",!1),l=e.let("passing",null),u=e.name("_valid");t.setParams({passing:l}),e.block(d),t.result(c,()=>t.reset(),()=>t.error(!0));function d(){s.forEach((f,h)=>{let m;(0,YQs.alwaysValidSchema)(o,f)?e.var(u,!0):m=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,vct._)`${u} && ${c}`).assign(c,!1).assign(l,(0,vct._)`[${l}, ${h}]`).else(),e.if(u,()=>{e.assign(c,!0),e.assign(l,h),m&&t.mergeEvaluated(m,vct.Name)})})}a(d,"validateOneOf")}};Nur.default=JQs});var tYn=I(Mur=>{"use strict";p();Object.defineProperty(Mur,"__esModule",{value:!0});var ZQs=Ka(),XQs={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=e.name("valid");r.forEach((s,c)=>{if((0,ZQs.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:c},o);t.ok(o),t.mergeEvaluated(l)})}};Mur.default=XQs});var iYn=I(Our=>{"use strict";p();Object.defineProperty(Our,"__esModule",{value:!0});var Cct=Es(),nYn=Ka(),eqs={message:a(({params:t})=>(0,Cct.str)`must match "${t.ifClause}" schema`,"message"),params:a(({params:t})=>(0,Cct._)`{failingKeyword: ${t.ifClause}}`,"params")},tqs={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:eqs,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,nYn.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=rYn(n,"then"),s=rYn(n,"else");if(!o&&!s)return;let c=e.let("valid",!0),l=e.name("_valid");if(u(),t.reset(),o&&s){let f=e.let("ifClause");t.setParams({ifClause:f}),e.if(l,d("then",f),d("else",f))}else o?e.if(l,d("then")):e.if((0,Cct.not)(l),d("else"));t.pass(c,()=>t.error(!0));function u(){let f=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(f)}a(u,"validateIf");function d(f,h){return()=>{let m=t.subschema({keyword:f},l);e.assign(c,l),t.mergeValidEvaluated(m,c),h?e.assign(h,(0,Cct._)`${f}`):t.setParams({ifClause:f})}}a(d,"validateClause")}};function rYn(t,e){let r=t.schema[e];return r!==void 0&&!(0,nYn.alwaysValidSchema)(t,r)}a(rYn,"hasSchema");Our.default=tqs});var oYn=I(Lur=>{"use strict";p();Object.defineProperty(Lur,"__esModule",{value:!0});var rqs=Ka(),nqs={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,rqs.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Lur.default=nqs});var sYn=I(Bur=>{"use strict";p();Object.defineProperty(Bur,"__esModule",{value:!0});var iqs=Eur(),oqs=Lzn(),sqs=_ur(),aqs=Fzn(),cqs=Uzn(),lqs=jzn(),uqs=Gzn(),dqs=xur(),fqs=Wzn(),pqs=Jzn(),hqs=Zzn(),mqs=Xzn(),gqs=eYn(),Aqs=tYn(),yqs=iYn(),Eqs=oYn();function _qs(t=!1){let e=[hqs.default,mqs.default,gqs.default,Aqs.default,yqs.default,Eqs.default,uqs.default,dqs.default,lqs.default,fqs.default,pqs.default];return t?e.push(oqs.default,aqs.default):e.push(iqs.default,sqs.default),e.push(cqs.default),e}a(_qs,"getApplicator");Bur.default=_qs});var aYn=I(Fur=>{"use strict";p();Object.defineProperty(Fur,"__esModule",{value:!0});var uh=Es(),vqs={message:a(({schemaCode:t})=>(0,uh.str)`must match format "${t}"`,"message"),params:a(({schemaCode:t})=>(0,uh._)`{format: ${t}}`,"params")},Cqs={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:vqs,code(t,e){let{gen:r,data:n,$data:o,schema:s,schemaCode:c,it:l}=t,{opts:u,errSchemaPath:d,schemaEnv:f,self:h}=l;if(!u.validateFormats)return;o?m():g();function m(){let A=r.scopeValue("formats",{ref:h.formats,code:u.code.formats}),y=r.const("fDef",(0,uh._)`${A}[${c}]`),E=r.let("fType"),_=r.let("format");r.if((0,uh._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(E,(0,uh._)`${y}.type || "string"`).assign(_,(0,uh._)`${y}.validate`),()=>r.assign(E,(0,uh._)`"string"`).assign(_,y)),t.fail$data((0,uh.or)(v(),b()));function v(){return u.strictSchema===!1?uh.nil:(0,uh._)`${c} && !${_}`}a(v,"unknownFmt");function b(){let T=f.$async?(0,uh._)`(${y}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,uh._)`${_}(${n})`,w=(0,uh._)`(typeof ${_} == "function" ? ${T} : ${_}.test(${n}))`;return(0,uh._)`${_} && ${_} !== true && ${E} === ${e} && !${w}`}a(b,"invalidFmt")}a(m,"validate$DataFormat");function g(){let A=h.formats[s];if(!A){v();return}if(A===!0)return;let[y,E,_]=b(A);y===e&&t.pass(T());function v(){if(u.strictSchema===!1){h.logger.warn(w());return}throw new Error(w());function w(){return`unknown format "${s}" ignored in schema at path "${d}"`}}a(v,"unknownFormat");function b(w){let R=w instanceof RegExp?(0,uh.regexpCode)(w):u.code.formats?(0,uh._)`${u.code.formats}${(0,uh.getProperty)(s)}`:void 0,x=r.scopeValue("formats",{key:s,ref:w,code:R});return typeof w=="object"&&!(w instanceof RegExp)?[w.type||"string",w.validate,(0,uh._)`${x}.validate`]:["string",w,x]}a(b,"getFormat");function T(){if(typeof A=="object"&&!(A instanceof RegExp)&&A.async){if(!f.$async)throw new Error("async format in sync schema");return(0,uh._)`await ${_}(${n})`}return typeof E=="function"?(0,uh._)`${_}(${n})`:(0,uh._)`${_}.test(${n})`}a(T,"validCondition")}a(g,"validateFormat")}};Fur.default=Cqs});var cYn=I(Uur=>{"use strict";p();Object.defineProperty(Uur,"__esModule",{value:!0});var bqs=aYn(),Sqs=[bqs.default];Uur.default=Sqs});var lYn=I(lhe=>{"use strict";p();Object.defineProperty(lhe,"__esModule",{value:!0});lhe.contentVocabulary=lhe.metadataVocabulary=void 0;lhe.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];lhe.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var dYn=I(Qur=>{"use strict";p();Object.defineProperty(Qur,"__esModule",{value:!0});var Tqs=yzn(),Iqs=Dzn(),xqs=sYn(),wqs=cYn(),uYn=lYn(),Rqs=[Tqs.default,Iqs.default,(0,xqs.default)(),wqs.default,uYn.metadataVocabulary,uYn.contentVocabulary];Qur.default=Rqs});var pYn=I(bct=>{"use strict";p();Object.defineProperty(bct,"__esModule",{value:!0});bct.DiscrError=void 0;var fYn;(function(t){t.Tag="tag",t.Mapping="mapping"})(fYn||(bct.DiscrError=fYn={}))});var mYn=I(jur=>{"use strict";p();Object.defineProperty(jur,"__esModule",{value:!0});var uhe=Es(),qur=pYn(),hYn=sct(),kqs=fDe(),Pqs=Ka(),Dqs={message:a(({params:{discrError:t,tagName:e}})=>t===qur.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,"message"),params:a(({params:{discrError:t,tag:e,tagName:r}})=>(0,uhe._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`,"params")},Nqs={keyword:"discriminator",type:"object",schemaType:"object",error:Dqs,code(t){let{gen:e,data:r,schema:n,parentSchema:o,it:s}=t,{oneOf:c}=o;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!c)throw new Error("discriminator: requires oneOf keyword");let u=e.let("valid",!1),d=e.const("tag",(0,uhe._)`${r}${(0,uhe.getProperty)(l)}`);e.if((0,uhe._)`typeof ${d} == "string"`,()=>f(),()=>t.error(!1,{discrError:qur.DiscrError.Tag,tag:d,tagName:l})),t.ok(u);function f(){let g=m();e.if(!1);for(let A in g)e.elseIf((0,uhe._)`${d} === ${A}`),e.assign(u,h(g[A]));e.else(),t.error(!1,{discrError:qur.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}a(f,"validateMapping");function h(g){let A=e.name("valid"),y=t.subschema({keyword:"oneOf",schemaProp:g},A);return t.mergeEvaluated(y,uhe.Name),A}a(h,"applyTagSchema");function m(){var g;let A={},y=_(o),E=!0;for(let T=0;T{Mqs.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Gur=I((pd,Hur)=>{"use strict";p();Object.defineProperty(pd,"__esModule",{value:!0});pd.MissingRefError=pd.ValidationError=pd.CodeGen=pd.Name=pd.nil=pd.stringify=pd.str=pd._=pd.KeywordCxt=pd.Ajv=void 0;var Oqs=fzn(),Lqs=dYn(),Bqs=mYn(),AYn=gYn(),Fqs=["/properties"],Sct="http://json-schema.org/draft-07/schema",dhe=class extends Oqs.default{static{a(this,"Ajv")}_addVocabularies(){super._addVocabularies(),Lqs.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Bqs.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(AYn,Fqs):AYn;this.addMetaSchema(e,Sct,!1),this.refs["http://json-schema.org/schema"]=Sct}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Sct)?Sct:void 0)}};pd.Ajv=dhe;Hur.exports=pd=dhe;Hur.exports.Ajv=dhe;Object.defineProperty(pd,"__esModule",{value:!0});pd.default=dhe;var Uqs=dDe();Object.defineProperty(pd,"KeywordCxt",{enumerable:!0,get:a(function(){return Uqs.KeywordCxt},"get")});var fhe=Es();Object.defineProperty(pd,"_",{enumerable:!0,get:a(function(){return fhe._},"get")});Object.defineProperty(pd,"str",{enumerable:!0,get:a(function(){return fhe.str},"get")});Object.defineProperty(pd,"stringify",{enumerable:!0,get:a(function(){return fhe.stringify},"get")});Object.defineProperty(pd,"nil",{enumerable:!0,get:a(function(){return fhe.nil},"get")});Object.defineProperty(pd,"Name",{enumerable:!0,get:a(function(){return fhe.Name},"get")});Object.defineProperty(pd,"CodeGen",{enumerable:!0,get:a(function(){return fhe.CodeGen},"get")});var Qqs=ict();Object.defineProperty(pd,"ValidationError",{enumerable:!0,get:a(function(){return Qqs.default},"get")});var qqs=fDe();Object.defineProperty(pd,"MissingRefError",{enumerable:!0,get:a(function(){return qqs.default},"get")})});var TYn=I(Z5=>{"use strict";p();Object.defineProperty(Z5,"__esModule",{value:!0});Z5.formatNames=Z5.fastFormats=Z5.fullFormats=void 0;function J5(t,e){return{validate:t,compare:e}}a(J5,"fmtDef");Z5.fullFormats={date:J5(vYn,zur),time:J5(Vur(!0),Yur),"date-time":J5(yYn(!0),bYn),"iso-time":J5(Vur(),CYn),"iso-date-time":J5(yYn(),SYn),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Wqs,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:ejs,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:zqs,int32:{type:"number",validate:Jqs},int64:{type:"number",validate:Zqs},float:{type:"number",validate:_Yn},double:{type:"number",validate:_Yn},password:!0,binary:!0};Z5.fastFormats={...Z5.fullFormats,date:J5(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,zur),time:J5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Yur),"date-time":J5(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,bYn),"iso-time":J5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,CYn),"iso-date-time":J5(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,SYn),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Z5.formatNames=Object.keys(Z5.fullFormats);function jqs(t){return t%4===0&&(t%100!==0||t%400===0)}a(jqs,"isLeapYear");var Hqs=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Gqs=[0,31,28,31,30,31,30,31,31,30,31,30,31];function vYn(t){let e=Hqs.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],o=+e[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&jqs(r)?29:Gqs[n])}a(vYn,"date");function zur(t,e){if(t&&e)return t>e?1:t23||f>59||t&&!l)return!1;if(o<=23&&s<=59&&c<60)return!0;let h=s-f*u,m=o-d*u-(h<0?1:0);return(m===23||m===-1)&&(h===59||h===-1)&&c<61},"time")}a(Vur,"getTime");function Yur(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}a(Yur,"compareTime");function CYn(t,e){if(!(t&&e))return;let r=$ur.exec(t),n=$ur.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t=Yqs}a(Jqs,"validateInt32");function Zqs(t){return Number.isInteger(t)}a(Zqs,"validateInt64");function _Yn(){return!0}a(_Yn,"validateNumber");var Xqs=/[^\\]\\Z/;function ejs(t){if(Xqs.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}a(ejs,"regex")});var IYn=I(phe=>{"use strict";p();Object.defineProperty(phe,"__esModule",{value:!0});phe.formatLimitDefinition=void 0;var tjs=Gur(),L2=Es(),EH=L2.operators,Tct={formatMaximum:{okStr:"<=",ok:EH.LTE,fail:EH.GT},formatMinimum:{okStr:">=",ok:EH.GTE,fail:EH.LT},formatExclusiveMaximum:{okStr:"<",ok:EH.LT,fail:EH.GTE},formatExclusiveMinimum:{okStr:">",ok:EH.GT,fail:EH.LTE}},rjs={message:a(({keyword:t,schemaCode:e})=>(0,L2.str)`should be ${Tct[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,L2._)`{comparison: ${Tct[t].okStr}, limit: ${e}}`,"params")};phe.formatLimitDefinition={keyword:Object.keys(Tct),type:"string",schemaType:"string",$data:!0,error:rjs,code(t){let{gen:e,data:r,schemaCode:n,keyword:o,it:s}=t,{opts:c,self:l}=s;if(!c.validateFormats)return;let u=new tjs.KeywordCxt(s,l.RULES.all.format.definition,"format");u.$data?d():f();function d(){let m=e.scopeValue("formats",{ref:l.formats,code:c.code.formats}),g=e.const("fmt",(0,L2._)`${m}[${u.schemaCode}]`);t.fail$data((0,L2.or)((0,L2._)`typeof ${g} != "object"`,(0,L2._)`${g} instanceof RegExp`,(0,L2._)`typeof ${g}.compare != "function"`,h(g)))}a(d,"validate$DataFormat");function f(){let m=u.schema,g=l.formats[m];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${o}": format "${m}" does not define "compare" function`);let A=e.scopeValue("formats",{key:m,ref:g,code:c.code.formats?(0,L2._)`${c.code.formats}${(0,L2.getProperty)(m)}`:void 0});t.fail$data(h(A))}a(f,"validateFormat");function h(m){return(0,L2._)`${m}.compare(${r}, ${n}) ${Tct[o].fail} 0`}a(h,"compareCode")},dependencies:["format"]};var njs=a(t=>(t.addKeyword(phe.formatLimitDefinition),t),"formatLimitPlugin");phe.default=njs});var kYn=I((IDe,RYn)=>{"use strict";p();Object.defineProperty(IDe,"__esModule",{value:!0});var hhe=TYn(),ijs=IYn(),Kur=Es(),xYn=new Kur.Name("fullFormats"),ojs=new Kur.Name("fastFormats"),Jur=a((t,e={keywords:!0})=>{if(Array.isArray(e))return wYn(t,e,hhe.fullFormats,xYn),t;let[r,n]=e.mode==="fast"?[hhe.fastFormats,ojs]:[hhe.fullFormats,xYn],o=e.formats||hhe.formatNames;return wYn(t,o,r,n),e.keywords&&(0,ijs.default)(t),t},"formatsPlugin");Jur.get=(t,e="full")=>{let n=(e==="fast"?hhe.fastFormats:hhe.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function wYn(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,Kur._)`require("ajv-formats/dist/formats").${n}`);for(let c of e)t.addFormat(c,r[c])}a(wYn,"addFormats");RYn.exports=IDe=Jur;Object.defineProperty(IDe,"__esModule",{value:!0});IDe.default=Jur});var oKn=I((bIf,iKn)=>{p();iKn.exports=nKn;nKn.sync=mjs;var tKn=require("fs");function hjs(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n{p();lKn.exports=aKn;aKn.sync=gjs;var sKn=require("fs");function aKn(t,e,r){sKn.stat(t,function(n,o){r(n,n?!1:cKn(o,e))})}a(aKn,"isexe");function gjs(t,e){return cKn(sKn.statSync(t),e)}a(gjs,"sync");function cKn(t,e){return t.isFile()&&Ajs(t,e)}a(cKn,"checkStat");function Ajs(t,e){var r=t.mode,n=t.uid,o=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),c=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),l=parseInt("100",8),u=parseInt("010",8),d=parseInt("001",8),f=l|u,h=r&d||r&u&&o===c||r&l&&n===s||r&f&&s===0;return h}a(Ajs,"checkMode")});var fKn=I((kIf,dKn)=>{p();var RIf=require("fs"),qct;process.platform==="win32"||global.TESTING_WINDOWS?qct=oKn():qct=uKn();dKn.exports=pdr;pdr.sync=yjs;function pdr(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){pdr(t,e||{},function(s,c){s?o(s):n(c)})})}qct(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}a(pdr,"isexe");function yjs(t,e){try{return qct.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}a(yjs,"sync")});var EKn=I((NIf,yKn)=>{p();var The=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",pKn=require("path"),Ejs=The?";":":",hKn=fKn(),mKn=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),gKn=a((t,e)=>{let r=e.colon||Ejs,n=t.match(/\//)||The&&t.match(/\\/)?[""]:[...The?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=The?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=The?o.split(r):[""];return The&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},"getPathInfo"),AKn=a((t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=gKn(t,e),c=[],l=a(d=>new Promise((f,h)=>{if(d===n.length)return e.all&&c.length?f(c):h(mKn(t));let m=n[d],g=/^".*"$/.test(m)?m.slice(1,-1):m,A=pKn.join(g,t),y=!g&&/^\.[\\\/]/.test(t)?t.slice(0,2)+A:A;f(u(y,d,0))}),"step"),u=a((d,f,h)=>new Promise((m,g)=>{if(h===o.length)return m(l(f+1));let A=o[h];hKn(d+A,{pathExt:s},(y,E)=>{if(!y&&E)if(e.all)c.push(d+A);else return m(d+A);return m(u(d,f,h+1))})}),"subStep");return r?l(0).then(d=>r(null,d),r):l(0)},"which"),_js=a((t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=gKn(t,e),s=[];for(let c=0;c{"use strict";p();var _Kn=a((t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey");hdr.exports=_Kn;hdr.exports.default=_Kn});var TKn=I((UIf,SKn)=>{"use strict";p();var CKn=require("path"),vjs=EKn(),Cjs=vKn();function bKn(t,e){let r=t.options.env||process.env,n=process.cwd(),o=t.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let c;try{c=vjs.sync(t.command,{path:r[Cjs({env:r})],pathExt:e?CKn.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return c&&(c=CKn.resolve(o?t.options.cwd:"",c)),c}a(bKn,"resolveCommandAttempt");function bjs(t){return bKn(t)||bKn(t,!0)}a(bjs,"resolveCommand");SKn.exports=bjs});var IKn=I((jIf,gdr)=>{"use strict";p();var mdr=/([()\][%!^"`<>&|;, *?])/g;function Sjs(t){return t=t.replace(mdr,"^$1"),t}a(Sjs,"escapeCommand");function Tjs(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(mdr,"^$1"),e&&(t=t.replace(mdr,"^$1")),t}a(Tjs,"escapeArgument");gdr.exports.command=Sjs;gdr.exports.argument=Tjs});var wKn=I(($If,xKn)=>{"use strict";p();xKn.exports=/^#!(.*)/});var kKn=I((WIf,RKn)=>{"use strict";p();var Ijs=wKn();RKn.exports=(t="")=>{let e=t.match(Ijs);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var DKn=I((YIf,PKn)=>{"use strict";p();var Adr=require("fs"),xjs=kKn();function wjs(t){let r=Buffer.alloc(150),n;try{n=Adr.openSync(t,"r"),Adr.readSync(n,r,0,150,0),Adr.closeSync(n)}catch{}return xjs(r.toString())}a(wjs,"readShebang");PKn.exports=wjs});var LKn=I((ZIf,OKn)=>{"use strict";p();var Rjs=require("path"),NKn=TKn(),MKn=IKn(),kjs=DKn(),Pjs=process.platform==="win32",Djs=/\.(?:com|exe)$/i,Njs=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Mjs(t){t.file=NKn(t);let e=t.file&&kjs(t.file);return e?(t.args.unshift(t.file),t.command=e,NKn(t)):t.file}a(Mjs,"detectShebang");function Ojs(t){if(!Pjs)return t;let e=Mjs(t),r=!Djs.test(e);if(t.options.forceShell||r){let n=Njs.test(e);t.command=Rjs.normalize(t.command),t.command=MKn.command(t.command),t.args=t.args.map(s=>MKn.argument(s,n));let o=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${o}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}a(Ojs,"parseNonShell");function Ljs(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:Ojs(n)}a(Ljs,"parse");OKn.exports=Ljs});var UKn=I((txf,FKn)=>{"use strict";p();var ydr=process.platform==="win32";function Edr(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}a(Edr,"notFoundError");function Bjs(t,e){if(!ydr)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=BKn(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}a(Bjs,"hookChildProcess");function BKn(t,e){return ydr&&t===1&&!e.file?Edr(e.original,"spawn"):null}a(BKn,"verifyENOENT");function Fjs(t,e){return ydr&&t===1&&!e.file?Edr(e.original,"spawnSync"):null}a(Fjs,"verifyENOENTSync");FKn.exports={hookChildProcess:Bjs,verifyENOENT:BKn,verifyENOENTSync:Fjs,notFoundError:Edr}});var jKn=I((ixf,Ihe)=>{"use strict";p();var QKn=require("child_process"),_dr=LKn(),vdr=UKn();function qKn(t,e,r){let n=_dr(t,e,r),o=QKn.spawn(n.command,n.args,n.options);return vdr.hookChildProcess(o,n),o}a(qKn,"spawn");function Ujs(t,e,r){let n=_dr(t,e,r),o=QKn.spawnSync(n.command,n.args,n.options);return o.error=o.error||vdr.verifyENOENTSync(o.status,n),o}a(Ujs,"spawnSync");Ihe.exports=qKn;Ihe.exports.spawn=qKn;Ihe.exports.sync=Ujs;Ihe.exports._parse=_dr;Ihe.exports._enoent=vdr});function BX(t,e=!1){let r=t.length,n=0,o="",s=0,c=16,l=0,u=0,d=0,f=0,h=0;function m(b,T){let w=0,R=0;for(;w=48&&x<=57)R=R*16+x-48;else if(x>=65&&x<=70)R=R*16+x-65+10;else if(x>=97&&x<=102)R=R*16+x-97+10;else break;n++,w++}return w=r){b+=t.substring(T,n),h=2;break}let w=t.charCodeAt(n);if(w===34){b+=t.substring(T,n),n++;break}if(w===92){if(b+=t.substring(T,n),n++,n>=r){h=2;break}switch(t.charCodeAt(n++)){case 34:b+='"';break;case 92:b+="\\";break;case 47:b+="/";break;case 98:b+="\b";break;case 102:b+="\f";break;case 110:b+=` -`;break;case 114:b+="\r";break;case 116:b+=" ";break;case 117:let x=m(4,!0);x>=0?b+=String.fromCharCode(x):h=4;break;default:h=5}T=n;continue}if(w>=0&&w<=31)if(GDe(w)){b+=t.substring(T,n),h=2;break}else h=6;n++}return b}a(y,"scanString");function E(){if(o="",h=0,s=n,u=l,f=d,n>=r)return s=r,c=17;let b=t.charCodeAt(n);if(Fdr(b)){do n++,o+=String.fromCharCode(b),b=t.charCodeAt(n);while(Fdr(b));return c=15}if(GDe(b))return n++,o+=String.fromCharCode(b),b===13&&t.charCodeAt(n)===10&&(n++,o+=` -`),l++,d=n,c=14;switch(b){case 123:return n++,c=1;case 125:return n++,c=2;case 91:return n++,c=3;case 93:return n++,c=4;case 58:return n++,c=6;case 44:return n++,c=5;case 34:return n++,o=y(),c=10;case 47:let T=n-1;if(t.charCodeAt(n+1)===47){for(n+=2;n=12&&b<=15);return b}return a(v,"scanNextNonTrivia"),{setPosition:g,getPosition:a(()=>n,"getPosition"),scan:e?v:E,getToken:a(()=>c,"getToken"),getTokenValue:a(()=>o,"getTokenValue"),getTokenOffset:a(()=>s,"getTokenOffset"),getTokenLength:a(()=>n-s,"getTokenLength"),getTokenStartLine:a(()=>u,"getTokenStartLine"),getTokenStartCharacter:a(()=>s-f,"getTokenStartCharacter"),getTokenError:a(()=>h,"getTokenError")}}function Fdr(t){return t===32||t===9}function GDe(t){return t===10||t===13}function khe(t){return t>=48&&t<=57}var _Jn,rlt=ve(()=>{"use strict";p();a(BX,"createScanner");a(Fdr,"isWhiteSpace");a(GDe,"isLineBreak");a(khe,"isDigit");(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(_Jn||(_Jn={}))});var BT,Phe,Udr,vJn,CJn=ve(()=>{p();BT=new Array(20).fill(0).map((t,e)=>" ".repeat(e)),Phe=200,Udr={" ":{"\n":new Array(Phe).fill(0).map((t,e)=>` -`+" ".repeat(e)),"\r":new Array(Phe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(Phe).fill(0).map((t,e)=>`\r -`+" ".repeat(e))}," ":{"\n":new Array(Phe).fill(0).map((t,e)=>` -`+" ".repeat(e)),"\r":new Array(Phe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(Phe).fill(0).map((t,e)=>`\r -`+" ".repeat(e))}},vJn=[` +${s}`:o.stack}a(mVn,"appendFetchStackTrace");vn.exports.fetch=a(function(e,r=void 0){return RFs(e,r).catch(n=>{throw dVn?mVn(n,dVn):n&&typeof n=="object"&&Error.captureStackTrace(n,vn.exports.fetch),n})},"fetch");vn.exports.Headers=iX().Headers;vn.exports.Response=S2e().Response;vn.exports.Request=$pe().Request;vn.exports.FormData=sst().FormData;var{setGlobalOrigin:kFs,getGlobalOrigin:PFs}=aor();vn.exports.setGlobalOrigin=kFs;vn.exports.getGlobalOrigin=PFs;var{CacheStorage:DFs}=KGn(),{kConstruct:NFs}=al();vn.exports.caches=new DFs(NFs);var{deleteCookie:MFs,getCookies:OFs,getSetCookies:LFs,setCookie:BFs,parseCookie:FFs}=l$n();vn.exports.deleteCookie=MFs;vn.exports.getCookies=OFs;vn.exports.getSetCookies=LFs;vn.exports.setCookie=BFs;vn.exports.parseCookie=FFs;var{parseMIMEType:UFs,serializeAMimeType:QFs}=jw();vn.exports.parseMIMEType=UFs;vn.exports.serializeAMimeType=QFs;var{CloseEvent:qFs,ErrorEvent:jFs,MessageEvent:HFs}=Sat(),{WebSocket:GFs,ping:$Fs}=j$n();vn.exports.WebSocket=GFs;vn.exports.CloseEvent=qFs;vn.exports.ErrorEvent=jFs;vn.exports.MessageEvent=HFs;vn.exports.ping=$Fs;vn.exports.WebSocketStream=K$n().WebSocketStream;vn.exports.WebSocketError=Pcr().WebSocketError;vn.exports.request=L2e(rhe.request);vn.exports.stream=L2e(rhe.stream);vn.exports.pipeline=L2e(rhe.pipeline);vn.exports.connect=L2e(rhe.connect);vn.exports.upgrade=L2e(rhe.upgrade);vn.exports.MockClient=AFs;vn.exports.MockCallHistory=yFs;vn.exports.MockCallHistoryLog=EFs;vn.exports.MockPool=vFs;vn.exports.MockAgent=_Fs;vn.exports.SnapshotAgent=CFs;vn.exports.mockErrors=bFs;var{EventSource:VFs}=uVn();vn.exports.EventSource=VFs;function WFs(){globalThis.fetch=vn.exports.fetch,globalThis.Headers=vn.exports.Headers,globalThis.Response=vn.exports.Response,globalThis.Request=vn.exports.Request,globalThis.FormData=vn.exports.FormData,globalThis.WebSocket=vn.exports.WebSocket,globalThis.CloseEvent=vn.exports.CloseEvent,globalThis.ErrorEvent=vn.exports.ErrorEvent,globalThis.MessageEvent=vn.exports.MessageEvent,globalThis.EventSource=vn.exports.EventSource}a(WFs,"install");vn.exports.install=WFs});var AVn=I((nmf,Hcr)=>{p();Hcr.exports=function(t){return gVn(KFs(t),t)};Hcr.exports.array=gVn;function gVn(t,e){var r=t.length,n=new Array(r),o={},s=r,c=JFs(e),l=ZFs(t);for(e.forEach(function(d){if(!l.has(d[0])||!l.has(d[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)o[s]||u(t[s],s,new Set);return n;function u(d,f,h){if(h.has(d)){var m;try{m=", node was:"+JSON.stringify(d)}catch{m=""}throw new Error("Cyclic dependency"+m)}if(!l.has(d))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(d));if(!o[f]){o[f]=!0;var g=c.get(d)||new Set;if(g=Array.from(g),f=g.length){h.add(d);do{var A=g[--f];u(A,l.get(A),h)}while(f);h.delete(d)}n[--r]=d}}}a(gVn,"toposort");function KFs(t){for(var e=new Set,r=0,n=t.length;r=48&&x<=57)R=R*16+x-48;else if(x>=65&&x<=70)R=R*16+x-65+10;else if(x>=97&&x<=102)R=R*16+x-97+10;else break;n++,w++}return w=r){b+=t.substring(T,n),h=2;break}let w=t.charCodeAt(n);if(w===34){b+=t.substring(T,n),n++;break}if(w===92){if(b+=t.substring(T,n),n++,n>=r){h=2;break}switch(t.charCodeAt(n++)){case 34:b+='"';break;case 92:b+="\\";break;case 47:b+="/";break;case 98:b+="\b";break;case 102:b+="\f";break;case 110:b+=` +`;break;case 114:b+="\r";break;case 116:b+=" ";break;case 117:let x=m(4,!0);x>=0?b+=String.fromCharCode(x):h=4;break;default:h=5}T=n;continue}if(w>=0&&w<=31)if(V2e(w)){b+=t.substring(T,n),h=2;break}else h=6;n++}return b}a(y,"scanString");function E(){if(o="",h=0,s=n,u=l,f=d,n>=r)return s=r,c=17;let b=t.charCodeAt(n);if(clr(b)){do n++,o+=String.fromCharCode(b),b=t.charCodeAt(n);while(clr(b));return c=15}if(V2e(b))return n++,o+=String.fromCharCode(b),b===13&&t.charCodeAt(n)===10&&(n++,o+=` +`),l++,d=n,c=14;switch(b){case 123:return n++,c=1;case 125:return n++,c=2;case 91:return n++,c=3;case 93:return n++,c=4;case 58:return n++,c=6;case 44:return n++,c=5;case 34:return n++,o=y(),c=10;case 47:let T=n-1;if(t.charCodeAt(n+1)===47){for(n+=2;n=12&&b<=15);return b}return a(v,"scanNextNonTrivia"),{setPosition:g,getPosition:a(()=>n,"getPosition"),scan:e?v:E,getToken:a(()=>c,"getToken"),getTokenValue:a(()=>o,"getTokenValue"),getTokenOffset:a(()=>s,"getTokenOffset"),getTokenLength:a(()=>n-s,"getTokenLength"),getTokenStartLine:a(()=>u,"getTokenStartLine"),getTokenStartCharacter:a(()=>s-f,"getTokenStartCharacter"),getTokenError:a(()=>h,"getTokenError")}}function clr(t){return t===32||t===9}function V2e(t){return t===10||t===13}function she(t){return t>=48&&t<=57}var nWn,tct=Se(()=>{"use strict";p();a(yX,"createScanner");a(clr,"isWhiteSpace");a(V2e,"isLineBreak");a(she,"isDigit");(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(nWn||(nWn={}))});var UT,ahe,llr,iWn,oWn=Se(()=>{p();UT=new Array(20).fill(0).map((t,e)=>" ".repeat(e)),ahe=200,llr={" ":{"\n":new Array(ahe).fill(0).map((t,e)=>` +`+" ".repeat(e)),"\r":new Array(ahe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(ahe).fill(0).map((t,e)=>`\r +`+" ".repeat(e))}," ":{"\n":new Array(ahe).fill(0).map((t,e)=>` +`+" ".repeat(e)),"\r":new Array(ahe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(ahe).fill(0).map((t,e)=>`\r +`+" ".repeat(e))}},iWn=[` `,"\r",`\r -`]});function nlt(t,e,r){let n,o,s,c,l;if(e){for(c=e.offset,l=c+e.length,s=c;s>0&&!$De(t,s-1);)s--;let w=l;for(;w1)return Dhe(u,f)+Dhe(m,n+h);let w=m.length*(n+h);return!d||w>Udr[g][u].length?u+Dhe(m,n+h):w<=0?u:Udr[g][u][w]}a(E,"newLinesAndIndent");function _(){let w=A.scan();for(f=0;w===15||w===14;)w===14&&r.keepLines?f+=1:w===14&&(f=1),w=A.scan();return y=w===16||A.getTokenError()!==0,w}a(_,"scanNext");let v=[];function b(w,R,x){!y&&(!e||Rc)&&t.substring(R,x)!==w&&v.push({offset:R,length:x-R,content:w})}a(b,"addEdit");let T=_();if(r.keepLines&&f>0&&b(Dhe(u,f),0,0),T!==17){let w=A.getTokenOffset()+s,R=m.length*n<20&&r.insertSpaces?BT[m.length*n]:Dhe(m,n);b(R,s,w)}for(;T!==17;){let w=A.getTokenOffset()+A.getTokenLength()+s,R=_(),x="",P=!1;for(;f===0&&(R===12||R===13);){let N=A.getTokenOffset()+s;b(BT[1],w,N),w=A.getTokenOffset()+A.getTokenLength()+s,P=R===12,x=P?E():"",R=_()}if(R===2)T!==1&&h--,r.keepLines&&f>0||!r.keepLines&&T!==1?x=E():r.keepLines&&(x=BT[1]);else if(R===4)T!==3&&h--,r.keepLines&&f>0||!r.keepLines&&T!==3?x=E():r.keepLines&&(x=BT[1]);else{switch(T){case 3:case 1:h++,r.keepLines&&f>0||!r.keepLines?x=E():x=BT[1];break;case 5:r.keepLines&&f>0||!r.keepLines?x=E():x=BT[1];break;case 12:x=E();break;case 13:f>0?x=E():P||(x=BT[1]);break;case 6:r.keepLines&&f>0?x=E():P||(x=BT[1]);break;case 10:r.keepLines&&f>0?x=E():R===6&&!P&&(x="");break;case 7:case 8:case 9:case 11:case 2:case 4:r.keepLines&&f>0?x=E():(R===12||R===13)&&!P?x=BT[1]:R!==5&&R!==17&&(y=!0);break;case 16:y=!0;break}f>0&&(R===12||R===13)&&(x=E())}R===17&&(r.keepLines&&f>0?x=E():x=r.insertFinalNewline?u:"");let D=A.getTokenOffset()+s;b(x,w,D),T=R}return v}function Dhe(t,e){let r="";for(let n=0;n0&&!W2e(t,s-1);)s--;let w=l;for(;w1)return che(u,f)+che(m,n+h);let w=m.length*(n+h);return!d||w>llr[g][u].length?u+che(m,n+h):w<=0?u:llr[g][u][w]}a(E,"newLinesAndIndent");function _(){let w=A.scan();for(f=0;w===15||w===14;)w===14&&r.keepLines?f+=1:w===14&&(f=1),w=A.scan();return y=w===16||A.getTokenError()!==0,w}a(_,"scanNext");let v=[];function b(w,R,x){!y&&(!e||Rc)&&t.substring(R,x)!==w&&v.push({offset:R,length:x-R,content:w})}a(b,"addEdit");let T=_();if(r.keepLines&&f>0&&b(che(u,f),0,0),T!==17){let w=A.getTokenOffset()+s,R=m.length*n<20&&r.insertSpaces?UT[m.length*n]:che(m,n);b(R,s,w)}for(;T!==17;){let w=A.getTokenOffset()+A.getTokenLength()+s,R=_(),x="",P=!1;for(;f===0&&(R===12||R===13);){let N=A.getTokenOffset()+s;b(UT[1],w,N),w=A.getTokenOffset()+A.getTokenLength()+s,P=R===12,x=P?E():"",R=_()}if(R===2)T!==1&&h--,r.keepLines&&f>0||!r.keepLines&&T!==1?x=E():r.keepLines&&(x=UT[1]);else if(R===4)T!==3&&h--,r.keepLines&&f>0||!r.keepLines&&T!==3?x=E():r.keepLines&&(x=UT[1]);else{switch(T){case 3:case 1:h++,r.keepLines&&f>0||!r.keepLines?x=E():x=UT[1];break;case 5:r.keepLines&&f>0||!r.keepLines?x=E():x=UT[1];break;case 12:x=E();break;case 13:f>0?x=E():P||(x=UT[1]);break;case 6:r.keepLines&&f>0?x=E():P||(x=UT[1]);break;case 10:r.keepLines&&f>0?x=E():R===6&&!P&&(x="");break;case 7:case 8:case 9:case 11:case 2:case 4:r.keepLines&&f>0?x=E():(R===12||R===13)&&!P?x=UT[1]:R!==5&&R!==17&&(y=!0);break;case 16:y=!0;break}f>0&&(R===12||R===13)&&(x=E())}R===17&&(r.keepLines&&f>0?x=E():x=r.insertFinalNewline?u:"");let D=A.getTokenOffset()+s;b(x,w,D),T=R}return v}function che(t,e){let r="";for(let n=0;n{"use strict";p();rlt();CJn();a(nlt,"format");a(Dhe,"repeat");a(UHs,"computeIndentLevel");a(QHs,"getEOL");a($De,"isEOL")});function bJn(t,e){let r=[],n=new Object,o,s={value:{},offset:0,length:0,type:"object",parent:void 0},c=!1;function l(u,d,f,h){s.value=u,s.offset=d,s.length=f,s.type=h,s.colonOffset=void 0,o=s}a(l,"setPreviousNode");try{zDe(t,{onObjectBegin:a((u,d)=>{if(e<=u)throw n;o=void 0,c=e>u,r.push("")},"onObjectBegin"),onObjectProperty:a((u,d,f)=>{if(e{if(e<=u)throw n;o=void 0,r.pop()},"onObjectEnd"),onArrayBegin:a((u,d)=>{if(e<=u)throw n;o=void 0,r.push(0)},"onArrayBegin"),onArrayEnd:a((u,d)=>{if(e<=u)throw n;o=void 0,r.pop()},"onArrayEnd"),onLiteralValue:a((u,d,f)=>{if(e{if(e<=d)throw n;if(u===":"&&o&&o.type==="property")o.colonOffset=d,c=!1,o=void 0;else if(u===","){let h=r[r.length-1];typeof h=="number"?r[r.length-1]=h+1:(c=!0,r[r.length-1]=""),o=void 0}},"onSeparator")})}catch(u){if(u!==n)throw u}return{path:r,previousNode:o,isAtPropertyKey:c,matches:a(u=>{let d=0;for(let f=0;d{let u={};c(u),s.push(o),o=u,n=null},"onObjectBegin"),onObjectProperty:a(u=>{n=u},"onObjectProperty"),onObjectEnd:a(()=>{o=s.pop()},"onObjectEnd"),onArrayBegin:a(()=>{let u=[];c(u),s.push(o),o=u,n=null},"onArrayBegin"),onArrayEnd:a(()=>{o=s.pop()},"onArrayEnd"),onLiteralValue:c,onError:a((u,d,f)=>{e.push({error:u,offset:d,length:f})},"onError")},r),o[0]}function olt(t,e=[],r=VDe.DEFAULT){let n={type:"array",offset:-1,length:-1,children:[],parent:void 0};function o(u){n.type==="property"&&(n.length=u-n.offset,n=n.parent)}a(o,"ensurePropertyComplete");function s(u){return n.children.push(u),u}a(s,"onValue"),zDe(t,{onObjectBegin:a(u=>{n=s({type:"object",offset:u,length:-1,parent:n,children:[]})},"onObjectBegin"),onObjectProperty:a((u,d,f)=>{n=s({type:"property",offset:d,length:-1,parent:n,children:[]}),n.children.push({type:"string",value:u,offset:d,length:f,parent:n})},"onObjectProperty"),onObjectEnd:a((u,d)=>{o(u+d),n.length=u+d-n.offset,n=n.parent,o(u+d)},"onObjectEnd"),onArrayBegin:a((u,d)=>{n=s({type:"array",offset:u,length:-1,parent:n,children:[]})},"onArrayBegin"),onArrayEnd:a((u,d)=>{n.length=u+d-n.offset,n=n.parent,o(u+d)},"onArrayEnd"),onLiteralValue:a((u,d,f)=>{s({type:IJn(u),offset:d,length:f,parent:n,value:u}),o(d+f)},"onLiteralValue"),onSeparator:a((u,d,f)=>{n.type==="property"&&(u===":"?n.colonOffset=d:u===","&&o(d))},"onSeparator"),onError:a((u,d,f)=>{e.push({error:u,offset:d,length:f})},"onError")},r);let l=n.children[0];return l&&delete l.parent,l}function WDe(t,e){if(!t)return;let r=t;for(let n of e)if(typeof n=="string"){if(r.type!=="object"||!Array.isArray(r.children))return;let o=!1;for(let s of r.children)if(Array.isArray(s.children)&&s.children[0].value===n&&s.children.length===2){r=s.children[1],o=!0;break}if(!o)return}else{let o=n;if(r.type!=="array"||o<0||!Array.isArray(r.children)||o>=r.children.length)return;r=r.children[o]}return r}function qdr(t){if(!t.parent||!t.parent.children)return[];let e=qdr(t.parent);if(t.parent.type==="property"){let r=t.parent.children[0].value;e.push(r)}else if(t.parent.type==="array"){let r=t.parent.children.indexOf(t);r!==-1&&e.push(r)}return e}function ilt(t){switch(t.type){case"array":return t.children.map(ilt);case"object":let e=Object.create(null);for(let r of t.children){let n=r.children[1];n&&(e[r.children[0].value]=ilt(n))}return e;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function jHs(t,e,r=!1){return e>=t.offset&&es===0&&M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}a(c,"toNoArgVisit");function l(M){return M?O=>s===0&&M(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}a(l,"toOneArgVisit");function u(M){return M?O=>s===0&&M(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice()):()=>!0}a(u,"toOneArgVisitWithPath");function d(M){return M?()=>{s>0?s++:M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice())===!1&&(s=1)}:()=>!0}a(d,"toBeginVisit");function f(M){return M?()=>{s>0&&s--,s===0&&M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}a(f,"toEndVisit");let h=d(e.onObjectBegin),m=u(e.onObjectProperty),g=f(e.onObjectEnd),A=d(e.onArrayBegin),y=f(e.onArrayEnd),E=u(e.onLiteralValue),_=l(e.onSeparator),v=c(e.onComment),b=l(e.onError),T=r&&r.disallowComments,w=r&&r.allowTrailingComma;function R(){for(;;){let M=n.scan();switch(n.getTokenError()){case 4:x(14);break;case 5:x(15);break;case 3:x(13);break;case 1:T||x(11);break;case 2:x(12);break;case 6:x(16);break}switch(M){case 12:case 13:T?x(10):v();break;case 16:x(1);break;case 15:case 14:break;default:return M}}}a(R,"scanNext");function x(M,O=[],j=[]){if(b(M),O.length+j.length>0){let Q=n.getToken();for(;Q!==17;){if(O.indexOf(Q)!==-1){R();break}else if(j.indexOf(Q)!==-1)break;Q=R()}}}a(x,"handleError");function P(M){let O=n.getTokenValue();return M?E(O):(m(O),o.push(O)),R(),!0}a(P,"parseString");function D(){switch(n.getToken()){case 11:let M=n.getTokenValue(),O=Number(M);isNaN(O)&&(x(2),O=0),E(O);break;case 7:E(null);break;case 8:E(!0);break;case 9:E(!1);break;default:return!1}return R(),!0}a(D,"parseLiteral");function N(){return n.getToken()!==10?(x(3,[],[2,5]),!1):(P(!1),n.getToken()===6?(_(":"),R(),q()||x(4,[],[2,5])):x(5,[],[2,5]),o.pop(),!0)}a(N,"parseProperty");function L(){h(),R();let M=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(M||x(4,[],[]),_(","),R(),n.getToken()===2&&w)break}else M&&x(6,[],[]);N()||x(4,[],[2,5]),M=!0}return g(),n.getToken()!==2?x(7,[2],[]):R(),!0}a(L,"parseObject");function B(){A(),R();let M=!0,O=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(O||x(4,[],[]),_(","),R(),n.getToken()===4&&w)break}else O&&x(6,[],[]);M?(o.push(0),M=!1):o[o.length-1]++,q()||x(4,[],[4,5]),O=!0}return y(),M||o.pop(),n.getToken()!==4?x(8,[4],[]):R(),!0}a(B,"parseArray");function q(){switch(n.getToken()){case 3:return B();case 1:return L();case 10:return P(!0);default:return D()}}return a(q,"parseValue"),R(),n.getToken()===17?r.allowEmptyContent?!0:(x(4,[],[]),!1):q()?(n.getToken()!==17&&x(9,[],[]),!0):(x(4,[],[]),!1)}function TJn(t,e){let r=BX(t),n=[],o,s=0,c;do switch(c=r.getPosition(),o=r.scan(),o){case 12:case 13:case 17:s!==c&&n.push(t.substring(s,c)),e!==void 0&&n.push(r.getTokenValue().replace(/[^\r\n]/g,e)),s=r.getPosition();break}while(o!==17);return n.join("")}function IJn(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(t){if(Array.isArray(t))return"array"}else return"null";return"object"}default:return"null"}}var VDe,Hdr=ve(()=>{"use strict";p();rlt();(function(t){t.DEFAULT={allowTrailingComma:!1}})(VDe||(VDe={}));a(bJn,"getLocation");a(SJn,"parse");a(olt,"parseTree");a(WDe,"findNodeAtLocation");a(qdr,"getNodePath");a(ilt,"getNodeValue");a(jHs,"contains");a(jdr,"findNodeAtOffset");a(zDe,"visit");a(TJn,"stripComments");a(IJn,"getNodeType")});function xJn(t,e,r,n){let o=e.slice(),c=olt(t,[]),l,u;for(;o.length>0&&(u=o.pop(),l=WDe(c,o),l===void 0&&r!==void 0);)typeof u=="string"?r={[u]:r}:r=[r];if(l)if(l.type==="object"&&typeof u=="string"&&Array.isArray(l.children)){let d=WDe(l,[u]);if(d!==void 0)if(r===void 0){if(!d.parent)throw new Error("Malformed AST");let f=l.children.indexOf(d.parent),h,m=d.parent.offset+d.parent.length;if(f>0){let g=l.children[f-1];h=g.offset+g.length}else h=l.offset+1,l.children.length>1&&(m=l.children[1].offset);return FX(t,{offset:h,length:m-h,content:""},n)}else return FX(t,{offset:d.offset,length:d.length,content:JSON.stringify(r)},n);else{if(r===void 0)return[];let f=`${JSON.stringify(u)}: ${JSON.stringify(r)}`,h=n.getInsertionIndex?n.getInsertionIndex(l.children.map(g=>g.children[0].value)):l.children.length,m;if(h>0){let g=l.children[h-1];m={offset:g.offset+g.length,length:0,content:","+f}}else l.children.length===0?m={offset:l.offset+1,length:0,content:f}:m={offset:l.offset+1,length:0,content:f+","};return FX(t,m,n)}}else if(l.type==="array"&&typeof u=="number"&&Array.isArray(l.children)){let d=u;if(d===-1){let f=`${JSON.stringify(r)}`,h;if(l.children.length===0)h={offset:l.offset+1,length:0,content:f};else{let m=l.children[l.children.length-1];h={offset:m.offset+m.length,length:0,content:","+f}}return FX(t,h,n)}else if(r===void 0&&l.children.length>=0){let f=u,h=l.children[f],m;if(l.children.length===1)m={offset:l.offset+1,length:l.length-2,content:""};else if(l.children.length-1===f){let g=l.children[f-1],A=g.offset+g.length,y=l.offset+l.length;m={offset:A,length:y-2-A,content:""}}else m={offset:h.offset,length:l.children[f+1].offset-h.offset,content:""};return FX(t,m,n)}else if(r!==void 0){let f,h=`${JSON.stringify(r)}`;if(!n.isArrayInsertion&&l.children.length>u){let m=l.children[u];f={offset:m.offset,length:m.length,content:h}}else if(l.children.length===0||u===0)f={offset:l.offset+1,length:0,content:l.children.length===0?h:h+","};else{let m=u>l.children.length?l.children.length:u,g=l.children[m-1];f={offset:g.offset+g.length,length:0,content:","+h}}return FX(t,f,n)}else throw new Error(`Can not ${r===void 0?"remove":n.isArrayInsertion?"insert":"modify"} Array index ${d} as length is not sufficient`)}else throw new Error(`Can not add ${typeof u!="number"?"index":"property"} to parent of type ${l.type}`);else{if(r===void 0)throw new Error("Can not delete in empty document");return FX(t,{offset:c?c.offset:0,length:c?c.length:0,content:JSON.stringify(r)},n)}}function FX(t,e,r){if(!r.formattingOptions)return[e];let n=slt(t,e),o=e.offset,s=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;o>0&&!$De(n,o-1);)o--;for(;s=0;u--){let d=c[u];n=slt(n,d),o=Math.min(o,d.offset),s=Math.max(s,d.offset+d.length),s+=d.content.length-d.length}let l=t.length-(n.length-s)-o;return[{offset:o,length:l,content:n.substring(o,s)}]}function slt(t,e){return t.substring(0,e.offset)+e.content+t.substring(e.offset+e.length)}var wJn=ve(()=>{"use strict";p();Qdr();Hdr();a(xJn,"setProperty");a(FX,"withFormatting");a(slt,"applyEdit")});var RJn={};ki(RJn,{ParseErrorCode:()=>Vdr,ScanError:()=>Gdr,SyntaxKind:()=>$dr,applyEdits:()=>nGs,createScanner:()=>$Hs,findNodeAtLocation:()=>zHs,findNodeAtOffset:()=>YHs,format:()=>tGs,getLocation:()=>VHs,getNodePath:()=>KHs,getNodeValue:()=>JHs,modify:()=>rGs,parse:()=>Wdr,parseTree:()=>WHs,printParseErrorCode:()=>eGs,stripComments:()=>XHs,visit:()=>ZHs});function eGs(t){switch(t){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return""}function tGs(t,e,r){return nlt(t,e,r)}function rGs(t,e,r,n){return xJn(t,e,r,n)}function nGs(t,e){let r=e.slice(0).sort((o,s)=>{let c=o.offset-s.offset;return c===0?o.length-s.length:c}),n=t.length;for(let o=r.length-1;o>=0;o--){let s=r[o];if(s.offset+s.length<=n)t=slt(t,s);else throw new Error("Overlapping edit");n=s.offset}return t}var $Hs,Gdr,$dr,VHs,Wdr,WHs,zHs,YHs,KHs,JHs,ZHs,XHs,Vdr,zdr=ve(()=>{"use strict";p();Qdr();wJn();rlt();Hdr();$Hs=BX;(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(Gdr||(Gdr={}));(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})($dr||($dr={}));VHs=bJn,Wdr=SJn,WHs=olt,zHs=WDe,YHs=jdr,KHs=qdr,JHs=ilt,ZHs=zDe,XHs=TJn;(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(Vdr||(Vdr={}));a(eGs,"printParseErrorCode");a(tGs,"format");a(rGs,"modify");a(nGs,"applyEdits")});var UT=I(YX=>{"use strict";p();Object.defineProperty(YX,"__esModule",{value:!0});YX.DebugNameData=void 0;YX.getDebugName=Eei;YX.getClassName=_ei;YX.getFunctionName=vei;var tpr=class{static{a(this,"DebugNameData")}constructor(e,r,n){this.owner=e,this.debugNameSource=r,this.referenceFn=n}getDebugName(e){return Eei(e,this)}};YX.DebugNameData=tpr;var gei=new Map,rpr=new WeakMap;function Eei(t,e){let r=rpr.get(t);if(r)return r;let n=DWs(t,e);if(n){let o=gei.get(n)??0;o++,gei.set(n,o);let s=o===1?n:`${n}#${o}`;return rpr.set(t,s),s}}a(Eei,"getDebugName");function DWs(t,e){let r=rpr.get(t);if(r)return r;let n=e.owner?MWs(e.owner)+".":"",o,s=e.debugNameSource;if(s!==void 0)if(typeof s=="function"){if(o=s(),o!==void 0)return n+o}else return n+s;let c=e.referenceFn;if(c!==void 0&&(o=vei(c),o!==void 0))return n+o;if(e.owner!==void 0){let l=NWs(e.owner,t);if(l!==void 0)return n+l}}a(DWs,"computeDebugName");function NWs(t,e){for(let r in t)if(t[r]===e)return r}a(NWs,"findKey");var Aei=new Map,yei=new WeakMap;function MWs(t){let e=yei.get(t);if(e)return e;let r=_ei(t)??"Object",n=Aei.get(r)??0;n++,Aei.set(r,n);let o=n===1?r:`${r}#${n}`;return yei.set(t,o),o}a(MWs,"formatOwner");function _ei(t){let e=t.constructor;if(e)return e.name==="Object"?void 0:e.name}a(_ei,"getClassName");function vei(t){let e=t.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(n?n[1]:void 0)?.trim()}a(vei,"getFunctionName")});var Mei=I(_p=>{"use strict";p();var OWs=_p&&_p.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),LWs=_p&&_p.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),BWs=_p&&_p.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot===e}a(Tei,"strictEqualsC");function Iei(t,e,r){return Sei.equals(t,e,r??fut)}a(Iei,"arrayEquals");function xei(t){return(e,r)=>Sei.equals(e,r,t??fut)}a(xei,"arrayEqualsC");function mNe(t,e){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0;rmNe(t,e)}a(wei,"structuralEqualsC");function FWs(t){return JSON.stringify(npr(t))}a(FWs,"getStructuralKey");var UWs=0,Cei=new WeakMap;function npr(t){if(Array.isArray(t))return t.map(npr);if(t&&typeof t=="object")if(Object.getPrototypeOf(t)===Object.prototype){let e=t,r=Object.create(null);for(let n of Object.keys(e).sort())r[n]=npr(e[n]);return r}else{let e=Cei.get(t);return e===void 0&&(e=UWs++,Cei.set(t,e)),e+"----2b76a038c20c4bcc"}return t}a(npr,"toNormalizedJsonStructure");function Rei(t,e){return JSON.stringify(t)===JSON.stringify(e)}a(Rei,"jsonStringifyEquals");function kei(){return(t,e)=>JSON.stringify(t)===JSON.stringify(e)}a(kei,"jsonStringifyEqualsC");function Pei(){return(t,e)=>t.equals(e)}a(Pei,"thisEqualsC");function Dei(t,e,r){return t==null||e===void 0||e===null?e===t:r(t,e)}a(Dei,"equalsIfDefined");function Nei(t){return(e,r)=>e==null||r===void 0||r===null?r===e:t(e,r)}a(Nei,"equalsIfDefinedC");var bei;(function(t){t.strict=fut,t.strictC=Tei,t.array=Iei,t.arrayC=xei,t.structural=mNe,t.structuralC=wei,t.jsonStringify=Rei,t.jsonStringifyC=kei,t.thisC=Pei,t.ifDefined=Dei,t.ifDefinedC=Nei})(bei||(_p.equals=bei={}))});var gv=I(vp=>{"use strict";p();Object.defineProperty(vp,"__esModule",{value:!0});vp.trackDisposable=vp.toDisposable=vp.markAsDisposed=vp.DisposableStore=vp.Event=vp.onUnexpectedError=vp.onBugIndicatingError=vp.BugIndicatingError=vp.strictEquals=vp.assertFn=void 0;var QWs=rd();Object.defineProperty(vp,"assertFn",{enumerable:!0,get:a(function(){return QWs.assertFn},"get")});var qWs=Mei();Object.defineProperty(vp,"strictEquals",{enumerable:!0,get:a(function(){return qWs.strictEquals},"get")});var ipr=Rs();Object.defineProperty(vp,"BugIndicatingError",{enumerable:!0,get:a(function(){return ipr.BugIndicatingError},"get")});Object.defineProperty(vp,"onBugIndicatingError",{enumerable:!0,get:a(function(){return ipr.onBugIndicatingError},"get")});Object.defineProperty(vp,"onUnexpectedError",{enumerable:!0,get:a(function(){return ipr.onUnexpectedError},"get")});var jWs=Ic();Object.defineProperty(vp,"Event",{enumerable:!0,get:a(function(){return jWs.Event},"get")});var put=Ro();Object.defineProperty(vp,"DisposableStore",{enumerable:!0,get:a(function(){return put.DisposableStore},"get")});Object.defineProperty(vp,"markAsDisposed",{enumerable:!0,get:a(function(){return put.markAsDisposed},"get")});Object.defineProperty(vp,"toDisposable",{enumerable:!0,get:a(function(){return put.toDisposable},"get")});Object.defineProperty(vp,"trackDisposable",{enumerable:!0,get:a(function(){return put.trackDisposable},"get")})});var Oei=I(opr=>{"use strict";p();Object.defineProperty(opr,"__esModule",{value:!0});opr.handleBugIndicatingErrorRecovery=GWs;var HWs=gv();function GWs(t){let e=new Error("BugIndicatingErrorRecovery: "+t);(0,HWs.onUnexpectedError)(e),console.error("recovered from an error that indicates a bug",e)}a(GWs,"handleBugIndicatingErrorRecovery")});var o4=I(cme=>{"use strict";p();Object.defineProperty(cme,"__esModule",{value:!0});cme.addLogger=$Ws;cme.getLogger=VWs;cme.setLogObservableFn=WWs;cme.logObservable=zWs;var KX;function $Ws(t){KX?KX instanceof hut?KX.loggers.push(t):KX=new hut([KX,t]):KX=t}a($Ws,"addLogger");function VWs(){return KX}a(VWs,"getLogger");var spr;function WWs(t){spr=t}a(WWs,"setLogObservableFn");function zWs(t){spr&&spr(t)}a(zWs,"logObservable");var hut=class{static{a(this,"ComposedLogger")}constructor(e){this.loggers=e}handleObservableCreated(e,r){for(let n of this.loggers)n.handleObservableCreated(e,r)}handleOnListenerCountChanged(e,r){for(let n of this.loggers)n.handleOnListenerCountChanged(e,r)}handleObservableUpdated(e,r){for(let n of this.loggers)n.handleObservableUpdated(e,r)}handleAutorunCreated(e,r){for(let n of this.loggers)n.handleAutorunCreated(e,r)}handleAutorunDisposed(e){for(let r of this.loggers)r.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,r,n){for(let o of this.loggers)o.handleAutorunDependencyChanged(e,r,n)}handleAutorunStarted(e){for(let r of this.loggers)r.handleAutorunStarted(e)}handleAutorunFinished(e){for(let r of this.loggers)r.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,r,n){for(let o of this.loggers)o.handleDerivedDependencyChanged(e,r,n)}handleDerivedCleared(e){for(let r of this.loggers)r.handleDerivedCleared(e)}handleBeginTransaction(e){for(let r of this.loggers)r.handleBeginTransaction(e)}handleEndTransaction(e){for(let r of this.loggers)r.handleEndTransaction(e)}}});var _8=I(DH=>{"use strict";p();Object.defineProperty(DH,"__esModule",{value:!0});DH.TransactionImpl=void 0;DH.transaction=apr;DH.globalTransaction=KWs;DH.asyncTransaction=JWs;DH.subtransaction=ZWs;var Lei=Oei(),YWs=UT(),Bei=o4();function apr(t,e){let r=new lme(t,e);try{t(r)}finally{r.finish()}}a(apr,"transaction");var mut;function KWs(t){if(mut)t(mut);else{let e=new lme(t,void 0);mut=e;try{t(e)}finally{e.finish(),mut=void 0}}}a(KWs,"globalTransaction");async function JWs(t,e){let r=new lme(t,e);try{await t(r)}finally{r.finish()}}a(JWs,"asyncTransaction");function ZWs(t,e,r){t?e(t):apr(e,r)}a(ZWs,"subtransaction");var lme=class{static{a(this,"TransactionImpl")}constructor(e,r){this._fn=e,this._getDebugName=r,this._updatingObservers=[],(0,Bei.getLogger)()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():(0,YWs.getFunctionName)(this._fn)}updateObserver(e,r){if(!this._updatingObservers){(0,Lei.handleBugIndicatingErrorRecovery)("Transaction already finished!"),apr(n=>{n.updateObserver(e,r)});return}this._updatingObservers.push({observer:e,observable:r}),e.beginUpdate(r)}finish(){let e=this._updatingObservers;if(!e){(0,Lei.handleBugIndicatingErrorRecovery)("transaction.finish() has already been called!");return}for(let r=0;r{"use strict";p();Object.defineProperty(gut,"__esModule",{value:!0});gut.DebugLocation=void 0;var Fei;(function(t){let e=!1;function r(){e=!0}a(r,"enable"),t.enable=r;function n(){if(!e)return;let o=Error,s=o.stackTraceLimit;o.stackTraceLimit=3;let c=new Error().stack;return o.stackTraceLimit=s,cpr.fromStack(c,2)}a(n,"ofCaller"),t.ofCaller=n})(Fei||(gut.DebugLocation=Fei={}));var cpr=class t{static{a(this,"DebugLocationImpl")}static fromStack(e,r){let n=e.split(` -`),o=XWs(n[r+1]);if(o)return new t(o.fileName,o.line,o.column,o.id)}constructor(e,r,n,o){this.fileName=e,this.line=r,this.column=n,this.id=o}};function XWs(t){let e=t.match(/\((.*):(\d+):(\d+)\)/);if(e)return{fileName:e[1],line:parseInt(e[2]),column:parseInt(e[3]),id:t};let r=t.match(/at ([^\(\)]*):(\d+):(\d+)/);if(r)return{fileName:r[1],line:parseInt(r[2]),column:parseInt(r[3]),id:t}}a(XWs,"parseLine")});var H2=I(s4=>{"use strict";p();Object.defineProperty(s4,"__esModule",{value:!0});s4.BaseObservable=s4.ConvenientObservable=void 0;s4._setDerivedOpts=tzs;s4._setRecomputeInitiallyAndOnChange=rzs;s4._setKeepObserved=nzs;s4._setDebugGetObservableGraph=izs;var Uei=QT(),ezs=UT(),ume=o4(),lpr;function tzs(t){lpr=t}a(tzs,"_setDerivedOpts");var Qei;function rzs(t){Qei=t}a(rzs,"_setRecomputeInitiallyAndOnChange");var qei;function nzs(t){qei=t}a(nzs,"_setKeepObserved");var upr;function izs(t){upr=t}a(izs,"_setDebugGetObservableGraph");var Aut=class{static{a(this,"ConvenientObservable")}get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,r,n=Uei.DebugLocation.ofCaller()){let o=r===void 0?void 0:e,s=r===void 0?e:r;return lpr({owner:o,debugName:a(()=>{let c=(0,ezs.getFunctionName)(s);if(c!==void 0)return c;let u=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(u)return`${this.debugName}.${u[2]}`;if(!o)return`${this.debugName} (mapped)`},"debugName"),debugReferenceFn:s},c=>s(this.read(c),c),n)}flatten(){return lpr({owner:void 0,debugName:a(()=>`${this.debugName} (flattened)`,"debugName")},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,r){return e.add(Qei(this,r)),this}keepObserved(e){return e.add(qei(this)),this}get debugValue(){return this.get()}get debug(){return new dpr(this)}};s4.ConvenientObservable=Aut;var dpr=class{static{a(this,"DebugHelper")}constructor(e){this.observable=e}getDependencyGraph(){return upr(this.observable,{type:"dependencies"})}getObserverGraph(){return upr(this.observable,{type:"observers"})}},fpr=class extends Aut{static{a(this,"BaseObservable")}constructor(e){super(),this._observers=new Set,(0,ume.getLogger)()?.handleObservableCreated(this,e)}addObserver(e){let r=this._observers.size;this._observers.add(e),r===0&&this.onFirstObserverAdded(),r!==this._observers.size&&(0,ume.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let r=this._observers.delete(e);r&&this._observers.size===0&&this.onLastObserverRemoved(),r&&(0,ume.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!(0,ume.getLogger)();return(0,ume.logObservable)(this),e||(0,ume.getLogger)()?.handleObservableCreated(this,Uei.DebugLocation.ofCaller()),this}debugGetObservers(){return this._observers}};s4.BaseObservable=fpr});var v8=I(NH=>{"use strict";p();Object.defineProperty(NH,"__esModule",{value:!0});NH.DisposableObservableValue=NH.ObservableValue=void 0;NH.observableValue=azs;NH.disposableObservableValue=czs;var ozs=_8(),szs=H2(),Hei=gv(),yut=UT(),jei=o4(),Gei=QT();function azs(t,e,r=Gei.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new yut.DebugNameData(void 0,t,void 0):n=new yut.DebugNameData(t,void 0,void 0),new gNe(n,e,Hei.strictEquals,r)}a(azs,"observableValue");var gNe=class extends szs.BaseObservable{static{a(this,"ObservableValue")}get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,r,n,o){super(o),this._debugNameData=e,this._equalityComparator=n,this._value=r,(0,jei.getLogger)()?.handleObservableUpdated(this,{hadValue:!1,newValue:r,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,r,n){if(n===void 0&&this._equalityComparator(this._value,e))return;let o;r||(r=o=new ozs.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{let s=this._value;this._setValue(e),(0,jei.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:e,change:n,didChange:!0,hadValue:!0});for(let c of this._observers)r.updateObserver(c,this),c.handleChange(this,n)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}};NH.ObservableValue=gNe;function czs(t,e,r=Gei.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new yut.DebugNameData(void 0,t,void 0):n=new yut.DebugNameData(t,void 0,void 0),new Eut(n,e,Hei.strictEquals,r)}a(czs,"disposableObservableValue");var Eut=class extends gNe{static{a(this,"DisposableObservableValue")}_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}};NH.DisposableObservableValue=Eut});var Vei=I(_ut=>{"use strict";p();Object.defineProperty(_ut,"__esModule",{value:!0});_ut.LazyObservableValue=void 0;var lzs=_8(),$ei=o4(),uzs=H2(),ppr=class extends uzs.BaseObservable{static{a(this,"LazyObservableValue")}get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,r,n,o){super(o),this._debugNameData=e,this._equalityComparator=n,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=r}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(let e of this._deltas){(0,$ei.getLogger)()?.handleObservableUpdated(this,{change:e,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(let r of this._observers)r.handleChange(this,e)}this._deltas.length=0}else{(0,$ei.getLogger)()?.handleObservableUpdated(this,{change:void 0,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(let e of this._observers)e.handleChange(this,void 0)}}_beginUpdate(){if(this._updateCounter++,this._updateCounter===1)for(let e of this._observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){this._update();let e=[...this._observers];for(let r of e)r.endUpdate(this)}}addObserver(e){let r=!this._observers.has(e)&&this._updateCounter>0;super.addObserver(e),r&&e.beginUpdate(this)}removeObserver(e){let r=this._observers.has(e)&&this._updateCounter>0;super.removeObserver(e),r&&e.endUpdate(this)}set(e,r,n){if(n===void 0&&this._equalityComparator(this._value,e))return;let o;r||(r=o=new lzs.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{if(this._isUpToDate=!1,this._setValue(e),n!==void 0&&this._deltas.push(n),r.updateObserver({beginUpdate:a(()=>this._beginUpdate(),"beginUpdate"),endUpdate:a(()=>this._endUpdate(),"endUpdate"),handleChange:a((s,c)=>{},"handleChange"),handlePossibleChange:a(s=>{},"handlePossibleChange")},this),this._updateCounter>1)for(let s of this._observers)s.handlePossibleChange(this)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}};_ut.LazyObservableValue=ppr});var vut=I(hpr=>{"use strict";p();Object.defineProperty(hpr,"__esModule",{value:!0});hpr.observableValueOpts=hzs;var Wei=UT(),zei=gv(),dzs=v8(),fzs=Vei(),pzs=QT();function hzs(t,e,r=pzs.DebugLocation.ofCaller()){return t.lazy?new fzs.LazyObservableValue(new Wei.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??zei.strictEquals,r):new dzs.ObservableValue(new Wei.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??zei.strictEquals,r)}a(hzs,"observableValueOpts")});var but=I(Cut=>{"use strict";p();Object.defineProperty(Cut,"__esModule",{value:!0});Cut.AutorunObserver=void 0;var tR=gv(),ANe=o4();function mzs(t){switch(t){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(mzs,"autorunStateToString");var mpr=class{static{a(this,"AutorunObserver")}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,r,n,o){this._debugNameData=e,this._runFn=r,this._changeTracker=n,this._state=2,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._iteration=0,this._store=void 0,this._delayedStore=void 0,this._changeSummary=this._changeTracker?.createChangeSummary(void 0),(0,ANe.getLogger)()?.handleAutorunCreated(this,o),this._run(),(0,tR.trackDisposable)(this)}dispose(){if(!this._disposed){this._disposed=!0;for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),(0,ANe.getLogger)()?.handleAutorunDisposed(this),(0,tR.markAsDisposed)(this)}}_run(){let e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){(0,ANe.getLogger)()?.handleAutorunStarted(this);let r=this._changeSummary,n=this._delayedStore;n!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,r),this._changeSummary=this._changeTracker.createChangeSummary(r)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,r)}catch(o){(0,tR.onBugIndicatingError)(o)}finally{this._isRunning=!1,n!==void 0&&n.dispose()}}}finally{this._disposed||(0,ANe.getLogger)()?.handleAutorunFinished(this);for(let r of this._dependenciesToBeRemoved)r.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){this._state===3&&(this._checkIterations(),this._state=1),this._updateCount++}endUpdate(e){try{if(this._updateCount===1){this._iteration=1;do{if(this._checkIterations())return;if(this._state===1){this._state=3;for(let r of this._dependencies)if(r.reportChanges(),this._state===2)break}this._iteration++,this._state!==3&&this._run()}while(this._state!==3)}}finally{this._updateCount--}(0,tR.assertFn)(()=>this._updateCount>=0)}handlePossibleChange(e){this._state===3&&this._isDependency(e)&&(this._checkIterations(),this._state=1)}handleChange(e,r){if(this._isDependency(e)){(0,ANe.getLogger)()?.handleAutorunDependencyChanged(this,e,r);try{(!this._changeTracker||this._changeTracker.handleChange({changedObservable:e,change:r,didChange:a(o=>o===e,"didChange")},this._changeSummary))&&(this._checkIterations(),this._state=2)}catch(n){(0,tR.onBugIndicatingError)(n)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new tR.BugIndicatingError("The reader object cannot be used outside its compute function!")}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);let r=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),r}get store(){if(this._ensureNoRunning(),this._disposed)throw new tR.BugIndicatingError("Cannot access store after dispose");return this._store===void 0&&(this._store=new tR.DisposableStore),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new tR.BugIndicatingError("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new tR.DisposableStore),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:mzs(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}_checkIterations(){return this._iteration>100?((0,tR.onBugIndicatingError)(new tR.BugIndicatingError(`Autorun '${this.debugName}' is stuck in an infinite update loop.`)),!0):!1}};Cut.AutorunObserver=mpr});var JX=I(rR=>{"use strict";p();Object.defineProperty(rR,"__esModule",{value:!0});rR.autorun=ypr;rR.autorunOpts=yNe;rR.autorunHandleChanges=Yei;rR.autorunWithStoreHandleChanges=yzs;rR.autorunWithStore=Ezs;rR.autorunDelta=_zs;rR.autorunIterableDelta=vzs;rR.autorunPerKeyedItem=Czs;rR.autorunSelfDisposable=bzs;rR.registerAutorunSelfDisposable=Szs;var dme=gv(),gpr=UT(),Apr=but(),fme=QT(),gzs=v8(),Azs=_8();function ypr(t,e=fme.DebugLocation.ofCaller()){return new Apr.AutorunObserver(new gpr.DebugNameData(void 0,void 0,t),t,void 0,e)}a(ypr,"autorun");function yNe(t,e,r=fme.DebugLocation.ofCaller()){return new Apr.AutorunObserver(new gpr.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,void 0,r)}a(yNe,"autorunOpts");function Yei(t,e,r=fme.DebugLocation.ofCaller()){return new Apr.AutorunObserver(new gpr.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,t.changeTracker,r)}a(Yei,"autorunHandleChanges");function yzs(t,e){let r=new dme.DisposableStore,n=Yei({owner:t.owner,debugName:t.debugName,debugReferenceFn:t.debugReferenceFn??e,changeTracker:t.changeTracker},(o,s)=>{r.clear(),e(o,s,r)});return(0,dme.toDisposable)(()=>{n.dispose(),r.dispose()})}a(yzs,"autorunWithStoreHandleChanges");function Ezs(t){let e=new dme.DisposableStore,r=yNe({owner:void 0,debugName:void 0,debugReferenceFn:t},n=>{e.clear(),t(n,e)});return(0,dme.toDisposable)(()=>{r.dispose(),e.dispose()})}a(Ezs,"autorunWithStore");function _zs(t,e){let r;return yNe({debugReferenceFn:e},n=>{let o=t.read(n),s=r;r=o,e({lastValue:s,newValue:o})})}a(_zs,"autorunDelta");function vzs(t,e,r=n=>n){let n=new Map;return yNe({debugReferenceFn:t},o=>{let s=new Map,c=new Map(n);for(let l of t(o)){let u=r(l);n.has(u)?c.delete(u):(s.set(u,l),n.set(u,l))}for(let l of c.keys())n.delete(l);(s.size||c.size)&&e({addedValues:[...s.values()],removedValues:[...c.values()]})})}a(vzs,"autorunIterableDelta");function Czs(t,e,r,n=fme.DebugLocation.ofCaller()){let o=new Map,s=yNe({debugReferenceFn:r},c=>{let l=t.read(c),u=new Set,d=[];(0,Azs.transaction)(f=>{for(let h of l){let m=e(h);u.add(m);let g=o.get(m);if(g)g.value.set(h,f);else{let A=new dme.DisposableStore,E={value:(0,gzs.observableValue)("keyedItem",h),store:A};o.set(m,E),d.push({key:m,cell:E})}}for(let[h,m]of o)u.has(h)||(m.store.dispose(),o.delete(h))});for(let{key:f,cell:h}of d)r(f,h.value,h.store)},n);return(0,dme.toDisposable)(()=>{s.dispose();for(let c of o.values())c.store.dispose();o.clear()})}a(Czs,"autorunPerKeyedItem");function bzs(t,e=fme.DebugLocation.ofCaller()){let r,n=!1;return r=ypr(o=>{t({delayedStore:o.delayedStore,store:o.store,readObservable:o.readObservable.bind(o),dispose:a(()=>{r?.dispose(),n=!0},"dispose")})},e),n&&r.dispose(),r}a(bzs,"autorunSelfDisposable");function Szs(t,e,r=fme.DebugLocation.ofCaller()){let n,o=!1;n=ypr(s=>{e({delayedStore:s.delayedStore,store:s.store,readObservable:s.readObservable.bind(s),dispose:a(()=>{n?t.delete(n):o=!0},"dispose")})},r),o?n.dispose():t.add(n)}a(Szs,"registerAutorunSelfDisposable")});var hme=I(pme=>{"use strict";p();Object.defineProperty(pme,"__esModule",{value:!0});pme.DerivedWithSetter=pme.Derived=void 0;var Tzs=H2(),ZX=gv(),Epr=o4();function Izs(t){switch(t){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(Izs,"derivedStateToString");var Sut=class extends Tzs.BaseObservable{static{a(this,"Derived")}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,r,n,o=void 0,s,c){super(c),this._debugNameData=e,this._computeFn=r,this._changeTracker=n,this._handleLastObserverRemoved=o,this._equalityComparator=s,this._state=0,this._value=void 0,this._updateCount=0,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._changeSummary=void 0,this._isUpdating=!1,this._isComputing=!1,this._didReportChange=!1,this._isInBeforeUpdate=!1,this._isReaderValid=!1,this._store=void 0,this._delayedStore=void 0,this._removedObserverToCallEndUpdateOn=null,this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}onLastObserverRemoved(){this._state=0,this._value=void 0,(0,Epr.getLogger)()?.handleDerivedCleared(this);for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._delayedStore!==void 0&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._isComputing,this._observers.size===0){let r;try{this._isReaderValid=!0;let n;this._changeTracker&&(n=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,n)),r=this._computeFn(this,n)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),r}else{do{if(this._state===1){for(let r of this._dependencies)if(r.reportChanges(),this._state===2)break}this._state===1&&(this._state=3),this._state!==3&&this._recompute()}while(this._state!==3);return this._value}}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;let r=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=r;try{let n=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,n),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(n));let o=this._state!==0,s=this._value;this._state=3;let c=this._delayedStore;c!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,n)}finally{this._isReaderValid=!1;for(let l of this._dependenciesToBeRemoved)l.removeObserver(this);this._dependenciesToBeRemoved.clear(),c!==void 0&&c.dispose()}e=this._didReportChange||o&&!this._equalityComparator(s,this._value),(0,Epr.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:o})}catch(n){(0,ZX.onBugIndicatingError)(n)}if(this._isComputing=!1,!this._didReportChange&&e)for(let n of this._observers)n.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new ZX.BugIndicatingError("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{let r=this._updateCount===1;if(this._state===3&&(this._state=1,!r))for(let n of this._observers)n.handlePossibleChange(this);if(r)for(let n of this._observers)n.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,this._updateCount===0){let r=[...this._observers];for(let n of r)n.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){let n=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(let o of n)o.endUpdate(this)}}(0,ZX.assertFn)(()=>this._updateCount>=0)}handlePossibleChange(e){if(this._state===3&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=1;for(let r of this._observers)r.handlePossibleChange(this)}}handleChange(e,r){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){(0,Epr.getLogger)()?.handleDerivedDependencyChanged(this,e,r);let n=!1;try{n=this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:r,didChange:a(s=>s===e,"didChange")},this._changeSummary):!0}catch(s){(0,ZX.onBugIndicatingError)(s)}let o=this._state===3;if(n&&(this._state===1||o)&&(this._state=2,o))for(let s of this._observers)s.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new ZX.BugIndicatingError("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);let r=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),r}reportChange(e){this._ensureReaderValid(),this._didReportChange=!0;for(let r of this._observers)r.handleChange(this,e)}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new ZX.DisposableStore),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new ZX.DisposableStore),this._delayedStore}addObserver(e){let r=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),r&&(this._removedObserverToCallEndUpdateOn?.delete(e)||e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:Izs(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this.beginUpdate(this);try{this._isComputing?this._state=2:this._recompute()}finally{this.endUpdate(this)}}setValue(e,r,n){this._value=e;let o=this._observers;r.updateObserver(this,this);for(let s of o)s.handleChange(this,n)}};pme.Derived=Sut;var _pr=class extends Sut{static{a(this,"DerivedWithSetter")}constructor(e,r,n,o=void 0,s,c,l){super(e,r,n,o,s,l),this.set=c}};pme.DerivedWithSetter=_pr});var Tut=I(MH=>{"use strict";p();Object.defineProperty(MH,"__esModule",{value:!0});MH.derived=wzs;MH.derivedWithSetter=Rzs;MH.derivedOpts=Kei;MH.derivedHandleChanges=kzs;MH.derivedWithStore=Pzs;MH.derivedDisposable=Dzs;var a4=gv(),mme=QT(),eee=UT(),xzs=H2(),tee=hme();function wzs(t,e,r=mme.DebugLocation.ofCaller()){return e!==void 0?new tee.Derived(new eee.DebugNameData(t,void 0,e),e,void 0,void 0,a4.strictEquals,r):new tee.Derived(new eee.DebugNameData(void 0,void 0,t),t,void 0,void 0,a4.strictEquals,r)}a(wzs,"derived");function Rzs(t,e,r,n=mme.DebugLocation.ofCaller()){return new tee.DerivedWithSetter(new eee.DebugNameData(t,void 0,e),e,void 0,void 0,a4.strictEquals,r,n)}a(Rzs,"derivedWithSetter");function Kei(t,e,r=mme.DebugLocation.ofCaller()){return new tee.Derived(new eee.DebugNameData(t.owner,t.debugName,t.debugReferenceFn),e,void 0,t.onLastObserverRemoved,t.equalsFn??a4.strictEquals,r)}a(Kei,"derivedOpts");(0,xzs._setDerivedOpts)(Kei);function kzs(t,e,r=mme.DebugLocation.ofCaller()){return new tee.Derived(new eee.DebugNameData(t.owner,t.debugName,void 0),e,t.changeTracker,void 0,t.equalityComparer??a4.strictEquals,r)}a(kzs,"derivedHandleChanges");function Pzs(t,e,r=mme.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s=new a4.DisposableStore;return new tee.Derived(new eee.DebugNameData(o,void 0,n),c=>(s.isDisposed?s=new a4.DisposableStore:s.clear(),n(c,s)),void 0,()=>s.dispose(),a4.strictEquals,r)}a(Pzs,"derivedWithStore");function Dzs(t,e,r=mme.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s;return new tee.Derived(new eee.DebugNameData(o,void 0,n),c=>{s?s.clear():s=new a4.DisposableStore;let l=n(c);return l&&s.add(l),l},void 0,()=>{s&&(s.dispose(),s=void 0)},a4.strictEquals,r)}a(Dzs,"derivedDisposable")});var Xei=I(nR=>{"use strict";p();Object.defineProperty(nR,"__esModule",{value:!0});nR.ObservableLazyPromise=nR.ObservableResolvedPromise=nR.PromiseResult=nR.ObservablePromise=nR.ObservableLazy=void 0;var Nzs=JX(),Jei=_8(),Zei=Tut(),Iut=v8(),xut=class{static{a(this,"ObservableLazy")}get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=(0,Iut.observableValue)(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}};nR.ObservableLazy=xut;var wut=class t{static{a(this,"ObservablePromise")}static fromFn(e){return new t(e())}static resolved(e){return new t(Promise.resolve(e))}constructor(e){this._value=(0,Iut.observableValue)(this,void 0),this.promiseResult=this._value,this.resolvedValue=(0,Zei.derived)(this,r=>{let n=this.promiseResult.read(r);if(n)return n.getDataOrThrow()}),this.promise=e.then(r=>((0,Jei.transaction)(n=>{this._value.set(new ENe(r,void 0),n)}),r),r=>{throw(0,Jei.transaction)(n=>{this._value.set(new ENe(void 0,r),n)}),r})}};nR.ObservablePromise=wut;var ENe=class{static{a(this,"PromiseResult")}constructor(e,r){this.data=e,this.error=r}getDataOrThrow(){if(this.error)throw this.error;return this.data}};nR.PromiseResult=ENe;var vpr=class{static{a(this,"ObservableResolvedPromise")}constructor(e,r,n){this._isResolving=(0,Iut.observableValue)(this,!1),this.isResolving=this._isResolving,this._lastResolved=(0,Iut.observableValue)(this,r),this.lastResolved=this._lastResolved,n.add((0,Nzs.autorun)(o=>{let s=e.read(o);this._runningPromise=s;let c=s.promiseResult.read(o);c?s===this._runningPromise&&(this._isResolving.set(!1,void 0),this._lastResolved.set(c.getDataOrThrow(),void 0)):this._isResolving.set(!0,void 0)}))}};nR.ObservableResolvedPromise=vpr;var Cpr=class{static{a(this,"ObservableLazyPromise")}constructor(e){this._computePromise=e,this._lazyValue=new xut(()=>new wut(this._computePromise())),this.cachedPromiseResult=(0,Zei.derived)(this,r=>this._lazyValue.cachedValue.read(r)?.promiseResult.read(r))}getPromise(){return this._lazyValue.getValue().promise}};nR.ObservableLazyPromise=Cpr});var Spr=I(c4=>{"use strict";p();Object.defineProperty(c4,"__esModule",{value:!0});c4.cancelOnDispose=c4.CancellationTokenSource=c4.CancellationToken=c4.CancellationError=void 0;var Mzs=Rs();Object.defineProperty(c4,"CancellationError",{enumerable:!0,get:a(function(){return Mzs.CancellationError},"get")});var bpr=YP();Object.defineProperty(c4,"CancellationToken",{enumerable:!0,get:a(function(){return bpr.CancellationToken},"get")});Object.defineProperty(c4,"CancellationTokenSource",{enumerable:!0,get:a(function(){return bpr.CancellationTokenSource},"get")});Object.defineProperty(c4,"cancelOnDispose",{enumerable:!0,get:a(function(){return bpr.cancelOnDispose},"get")})});var eti=I(Rut=>{"use strict";p();Object.defineProperty(Rut,"__esModule",{value:!0});Rut.waitForState=Qzs;Rut.derivedWithCancellationToken=qzs;var Ozs=UT(),Tpr=Spr(),Lzs=gv(),Bzs=JX(),Fzs=hme(),Uzs=QT();function Qzs(t,e,r,n){return e||(e=a(o=>o!=null,"predicate")),new Promise((o,s)=>{let c=!0,l=!1,u=t.map(f=>({isFinished:e(f),error:r?r(f):!1,state:f})),d=(0,Bzs.autorun)(f=>{let{isFinished:h,error:m,state:g}=u.read(f);(h||m)&&(c?l=!0:d.dispose(),m?s(m===!0?g:m):o(g))});if(n){let f=n.onCancellationRequested(()=>{d.dispose(),f.dispose(),s(new Tpr.CancellationError)});if(n.isCancellationRequested){d.dispose(),f.dispose(),s(new Tpr.CancellationError);return}}c=!1,l&&d.dispose()})}a(Qzs,"waitForState");function qzs(t,e){let r,n;e===void 0?(r=t,n=void 0):(n=t,r=e);let o;return new Fzs.Derived(new Ozs.DebugNameData(n,void 0,r),s=>(o&&o.dispose(!0),o=new Tpr.CancellationTokenSource,r(s,o.token)),void 0,()=>o?.dispose(),Lzs.strictEquals,Uzs.DebugLocation.ofCaller())}a(qzs,"derivedWithCancellationToken")});var OH=I(ree=>{"use strict";p();Object.defineProperty(ree,"__esModule",{value:!0});ree.FromEventObservable=void 0;ree.observableFromEvent=Ipr;ree.observableFromEventOpts=Gzs;var jzs=_8(),rti=gv(),nti=UT(),tti=o4(),Hzs=H2(),iti=QT();function Ipr(...t){let e,r,n,o;return t.length===2?[r,n]=t:[e,r,n,o]=t,new G2(new nti.DebugNameData(e,void 0,n),r,n,()=>G2.globalTransaction,rti.strictEquals,o??iti.DebugLocation.ofCaller())}a(Ipr,"observableFromEvent");function Gzs(t,e,r,n=iti.DebugLocation.ofCaller()){return new G2(new nti.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??r),e,r,()=>t.getTransaction?.()??G2.globalTransaction,t.equalsFn??rti.strictEquals,n)}a(Gzs,"observableFromEventOpts");var G2=class extends Hzs.BaseObservable{static{a(this,"FromEventObservable")}constructor(e,r,n,o,s,c){super(c),this._debugNameData=e,this.event=r,this._getValue=n,this._getTransaction=o,this._equalityComparator=s,this._hasValue=!1,this.handleEvent=l=>{let u=this._getValue(l),d=this._value,f=!this._hasValue||!this._equalityComparator(d,u),h=!1;f&&(this._value=u,this._hasValue&&(h=!0,(0,jzs.subtransaction)(this._getTransaction(),m=>{(0,tti.getLogger)()?.handleObservableUpdated(this,{oldValue:d,newValue:u,change:void 0,didChange:f,hadValue:this._hasValue});for(let g of this._observers)m.updateObserver(g,this),g.handleChange(this,void 0)},()=>{let m=this.getDebugName();return"Event fired"+(m?`: ${m}`:"")})),this._hasValue=!0),h||(0,tti.getLogger)()?.handleObservableUpdated(this,{oldValue:d,newValue:u,change:void 0,didChange:f,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){let e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}debugGetState(){return{value:this._value,hasValue:this._hasValue}}};ree.FromEventObservable=G2;(function(t){t.Observer=G2;function e(r,n){let o=!1;G2.globalTransaction===void 0&&(G2.globalTransaction=r,o=!0);try{n()}finally{o&&(G2.globalTransaction=void 0)}}a(e,"batchEventsGlobally"),t.batchEventsGlobally=e})(Ipr||(ree.observableFromEvent=Ipr={}))});var wpr=I(xpr=>{"use strict";p();Object.defineProperty(xpr,"__esModule",{value:!0});xpr.observableSignal=Yzs;var $zs=_8(),Vzs=UT(),Wzs=H2(),zzs=QT();function Yzs(t,e=zzs.DebugLocation.ofCaller()){return typeof t=="string"?new kut(t,void 0,e):new kut(void 0,t,e)}a(Yzs,"observableSignal");var kut=class extends Wzs.BaseObservable{static{a(this,"ObservableSignal")}get debugName(){return new Vzs.DebugNameData(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}constructor(e,r,n){super(n),this._debugName=e,this._owner=r}trigger(e,r){if(!e){(0,$zs.transaction)(n=>{this.trigger(n,r)},()=>`Trigger signal ${this.debugName}`);return}for(let n of this._observers)e.updateObserver(n,this),n.handleChange(this,r)}get(){}}});var Dut=I(RE=>{"use strict";p();Object.defineProperty(RE,"__esModule",{value:!0});RE.KeepAliveObserver=void 0;RE.observableFromPromise=Kzs;RE.signalFromObservable=Jzs;RE.debouncedObservable=Zzs;RE.throttledObservable=Xzs;RE.debouncedObservable2=eYs;RE.wasEventTriggeredRecently=tYs;RE.keepObserved=uti;RE.recomputeInitiallyAndOnChange=dti;RE.derivedObservableWithCache=rYs;RE.derivedObservableWithWritableCache=nYs;RE.mapObservableArrayCached=iYs;RE.isObservable=oYs;var oti=JX(),sti=v8(),Rpr=gv(),vNe=Tut(),ati=OH(),cti=wpr(),lti=H2(),kpr=QT();function Kzs(t){let e=(0,sti.observableValue)("promiseValue",{});return t.then(r=>{e.set({value:r},void 0)}),e}a(Kzs,"observableFromPromise");function Jzs(t,e){return(0,vNe.derivedOpts)({owner:t,equalsFn:a(()=>!1,"equalsFn")},r=>{e.read(r)})}a(Jzs,"signalFromObservable");function Zzs(t,e,r=kpr.DebugLocation.ofCaller()){let n=!1,o,s;return(0,ati.observableFromEvent)(void 0,c=>{let l=(0,oti.autorun)(u=>{let d=t.read(u);if(!n)n=!0,o=d;else{s&&clearTimeout(s);let f=typeof e=="number"?e:e(o,d);if(f===0){o=d,c();return}s=setTimeout(()=>{o=d,c()},f)}});return{dispose(){l.dispose(),n=!1,o=void 0}}},()=>n?o:t.get(),r)}a(Zzs,"debouncedObservable");function Xzs(t,e,r=kpr.DebugLocation.ofCaller()){let n=!1,o,s;return(0,ati.observableFromEvent)(void 0,c=>{let l=(0,oti.autorun)(u=>{let d=t.read(u);n?s||(s=setTimeout(()=>{s=void 0,o=t.read(void 0),c()},e)):(n=!0,o=d)});return{dispose(){l.dispose(),s&&(clearTimeout(s),s=void 0),n=!1,o=void 0}}},()=>n?o:t.get(),r)}a(Xzs,"throttledObservable");function eYs(t,e,r=kpr.DebugLocation.ofCaller()){let n=(0,cti.observableSignal)("handleTimeout"),o,s;return(0,vNe.derivedOpts)({owner:void 0,onLastObserverRemoved:a(()=>{o=void 0},"onLastObserverRemoved")},l=>{let u=t.read(l);if(n.read(l),u!==o){let d=typeof e=="number"?e:e(o,u);if(d===0)return o=u,u;s&&clearTimeout(s),s=setTimeout(()=>{o=u,n.trigger(void 0)},d)}return o},r)}a(eYs,"debouncedObservable2");function tYs(t,e,r){let n=(0,sti.observableValue)("triggeredRecently",!1),o;return r.add(t(()=>{n.set(!0,void 0),o&&clearTimeout(o),o=setTimeout(()=>{n.set(!1,void 0)},e)})),n}a(tYs,"wasEventTriggeredRecently");function uti(t){let e=new _Ne(!1,void 0);return t.addObserver(e),(0,Rpr.toDisposable)(()=>{t.removeObserver(e)})}a(uti,"keepObserved");(0,lti._setKeepObserved)(uti);function dti(t,e){let r=new _Ne(!0,e);t.addObserver(r);try{r.beginUpdate(t)}finally{r.endUpdate(t)}return(0,Rpr.toDisposable)(()=>{t.removeObserver(r)})}a(dti,"recomputeInitiallyAndOnChange");(0,lti._setRecomputeInitiallyAndOnChange)(dti);var _Ne=class{static{a(this,"KeepAliveObserver")}constructor(e,r){this._forceRecompute=e,this._handleValue=r,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter===1&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,r){}};RE.KeepAliveObserver=_Ne;function rYs(t,e){let r;return(0,vNe.derivedOpts)({owner:t,debugReferenceFn:e},o=>(r=e(o,r),r))}a(rYs,"derivedObservableWithCache");function nYs(t,e){let r,n=(0,cti.observableSignal)("derivedObservableWithWritableCache"),o=(0,vNe.derived)(t,s=>(n.read(s),r=e(s,r),r));return Object.assign(o,{clearCache:a(s=>{r=void 0,n.trigger(s)},"clearCache"),setCache:a((s,c)=>{r=s,n.trigger(c)},"setCache")})}a(nYs,"derivedObservableWithWritableCache");function iYs(t,e,r,n){let o=new Put(r,n);return(0,vNe.derivedOpts)({debugReferenceFn:r,owner:t,onLastObserverRemoved:a(()=>{o.dispose(),o=new Put(r)},"onLastObserverRemoved")},c=>{let l=e.read(c);return o.setItems(l),o.getItems()})}a(iYs,"mapObservableArrayCached");var Put=class{static{a(this,"ArrayMap")}constructor(e,r){this._map=e,this._keySelector=r,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){let r=[],n=new Set(this._cache.keys());for(let o of e){let s=this._keySelector?this._keySelector(o):o,c=this._cache.get(s);if(c)n.delete(s);else{let l=new Rpr.DisposableStore;c={out:this._map(o,l),store:l},this._cache.set(s,c)}r.push(c.out)}for(let o of n)this._cache.get(o).store.dispose(),this._cache.delete(o);this._items=r}getItems(){return this._items}};function oYs(t){return!!t&&t.read!==void 0&&t.reportChanges!==void 0}a(oYs,"isObservable")});var pti=I(Nut=>{"use strict";p();Object.defineProperty(Nut,"__esModule",{value:!0});Nut.recordChanges=sYs;Nut.recordChangesLazy=aYs;var fti=gv();function sYs(t){return{createChangeSummary:a(e=>({changes:[]}),"createChangeSummary"),handleChange(e,r){for(let n in t)e.didChange(t[n])&&r.changes.push({key:n,change:e.change});return!0},beforeUpdate(e,r){for(let n in t){if(n==="changes")throw new fti.BugIndicatingError('property name "changes" is reserved for change tracking');r[n]=t[n].read(e)}}}}a(sYs,"recordChanges");function aYs(t){let e;return{createChangeSummary:a(r=>({changes:[]}),"createChangeSummary"),handleChange(r,n){e||(e=t());for(let o in e)r.didChange(e[o])&&n.changes.push({key:o,change:r.change});return!0},beforeUpdate(r,n){e||(e=t());for(let o in e){if(o==="changes")throw new fti.BugIndicatingError('property name "changes" is reserved for change tracking');n[o]=e[o].read(r)}}}}a(aYs,"recordChangesLazy")});var hti=I(Dpr=>{"use strict";p();Object.defineProperty(Dpr,"__esModule",{value:!0});Dpr.constObservable=lYs;var cYs=H2();function lYs(t){return new Ppr(t)}a(lYs,"constObservable");var Ppr=class extends cYs.ConvenientObservable{static{a(this,"ConstObservable")}constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}log(){return this}toString(){return`Const: ${this.value}`}}});var mti=I(Mpr=>{"use strict";p();Object.defineProperty(Mpr,"__esModule",{value:!0});Mpr.observableSignalFromEvent=hYs;var uYs=_8(),dYs=UT(),fYs=H2(),pYs=QT();function hYs(t,e,r=pYs.DebugLocation.ofCaller()){return new Npr(typeof t=="string"?t:new dYs.DebugNameData(t,void 0,void 0),e,r)}a(hYs,"observableSignalFromEvent");var Npr=class extends fYs.BaseObservable{static{a(this,"FromEventObservableSignal")}constructor(e,r,n){super(n),this.event=r,this.handleEvent=()=>{(0,uYs.transaction)(o=>{for(let s of this._observers)o.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)},this.debugName=typeof e=="string"?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}});var gti=I(CNe=>{"use strict";p();Object.defineProperty(CNe,"__esModule",{value:!0});CNe.ValueWithChangeEventFromObservable=void 0;CNe.observableFromValueWithChangeEvent=AYs;var mYs=gv(),gYs=OH(),Mut=class{static{a(this,"ValueWithChangeEventFromObservable")}constructor(e){this.observable=e}get onDidChange(){return mYs.Event.fromObservableLight(this.observable)}get value(){return this.observable.get()}};CNe.ValueWithChangeEventFromObservable=Mut;function AYs(t,e){return e instanceof Mut?e.observable:(0,gYs.observableFromEvent)(t,e.onDidChange,()=>e.value)}a(AYs,"observableFromValueWithChangeEvent")});var Eti=I(bNe=>{"use strict";p();Object.defineProperty(bNe,"__esModule",{value:!0});bNe.runOnChange=Ati;bNe.runOnChangeWithStore=yti;bNe.runOnChangeWithCancellationToken=vYs;var yYs=Spr(),EYs=gv(),_Ys=JX();function Ati(t,e){let r,n=!0;return(0,_Ys.autorunWithStoreHandleChanges)({changeTracker:{createChangeSummary:a(()=>({deltas:[],didChange:!1}),"createChangeSummary"),handleChange:a((o,s)=>{if(o.didChange(t)){let c=o.change;c!==void 0&&s.deltas.push(c),s.didChange=!0}return!0},"handleChange")}},(o,s)=>{let c=t.read(o),l=r;s.didChange&&(r=c,e(c,l,s.deltas)),n&&(n=!1,r=c)})}a(Ati,"runOnChange");function yti(t,e){let r=new EYs.DisposableStore,n=Ati(t,(o,s,c)=>{r.clear(),e(o,s,c,r)});return{dispose(){n.dispose(),r.dispose()}}}a(yti,"runOnChangeWithStore");function vYs(t,e){return yti(t,(r,n,o,s)=>{e(r,n,o,(0,yYs.cancelOnDispose)(s))})}a(vYs,"runOnChangeWithCancellationToken")});var Cti=I(Out=>{"use strict";p();Object.defineProperty(Out,"__esModule",{value:!0});Out.latestChangedValue=TYs;Out.derivedConstOnceDefined=IYs;var _ti=gv(),vti=UT(),CYs=OH(),bYs=JX(),SYs=Dut();function TYs(t,e){if(e.length===0)throw new _ti.BugIndicatingError;let r=!1,n,o=(0,CYs.observableFromEvent)(t,s=>{let c=new _ti.DisposableStore;for(let l of e)c.add((0,bYs.autorunOpts)({debugName:a(()=>(0,vti.getDebugName)(o,new vti.DebugNameData(t,void 0,void 0))+".updateLastChangedValue","debugName")},u=>{r=!0,n=l.read(u),s()}));return c.add({dispose(){r=!1,n=void 0}}),c},()=>r?n:e[e.length-1].get());return o}a(TYs,"latestChangedValue");function IYs(t,e){return(0,SYs.derivedObservableWithCache)(t,(r,n)=>n??e(r))}a(IYs,"derivedConstOnceDefined")});var bti=I(Lut=>{"use strict";p();Object.defineProperty(Lut,"__esModule",{value:!0});Lut.ObservableSet=void 0;var xYs=vut(),Opr=class{static{a(this,"ObservableSet")}constructor(){this._data=new Set,this._obs=(0,xYs.observableValueOpts)({equalsFn:a(()=>!1,"equalsFn")},this),this.observable=this._obs}get size(){return this._data.size}has(e){return this._data.has(e)}add(e,r){return this._data.has(e)||(this._data.add(e),this._obs.set(this,r)),this}delete(e,r){let n=this._data.delete(e);return n&&this._obs.set(this,r),n}clear(e){this._data.size>0&&(this._data.clear(),this._obs.set(this,e))}forEach(e,r){this._data.forEach((n,o,s)=>{e.call(r,n,o,this)})}*entries(){for(let e of this._data)yield[e,e]}*keys(){yield*this._data.keys()}*values(){yield*this._data.values()}[Symbol.iterator](){return this.values()}get[Symbol.toStringTag](){return"ObservableSet"}};Lut.ObservableSet=Opr});var Sti=I(But=>{"use strict";p();Object.defineProperty(But,"__esModule",{value:!0});But.ObservableMap=void 0;var wYs=vut(),Lpr=class{static{a(this,"ObservableMap")}constructor(){this._data=new Map,this._obs=(0,wYs.observableValueOpts)({equalsFn:a(()=>!1,"equalsFn")},this),this.observable=this._obs}get size(){return this._data.size}has(e){return this._data.has(e)}get(e){return this._data.get(e)}set(e,r,n){let o=this._data.has(e),s=this._data.get(e);return(!o||s!==r)&&(this._data.set(e,r),this._obs.set(this,n)),this}delete(e,r){let n=this._data.delete(e);return n&&this._obs.set(this,r),n}clear(e){this._data.size>0&&(this._data.clear(),this._obs.set(this,e))}forEach(e,r){this._data.forEach((n,o,s)=>{e.call(r,n,o,this)})}*entries(){yield*this._data.entries()}*keys(){yield*this._data.keys()}*values(){yield*this._data.values()}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return"ObservableMap"}};But.ObservableMap=Lpr});var Qut=I(Eme=>{"use strict";p();Object.defineProperty(Eme,"__esModule",{value:!0});Eme.ConsoleObservableLogger=void 0;Eme.logObservableToConsole=PYs;Eme.formatValue=yme;var RYs=o4(),kYs=UT(),Tti=hme(),Fut;function PYs(t){Fut||(Fut=new Uut,(0,RYs.addLogger)(Fut)),Fut.addFilteredObj(t)}a(PYs,"logObservableToConsole");var Uut=class{static{a(this,"ConsoleObservableLogger")}constructor(){this.indentation=0,this.changedObservablesSets=new WeakMap}addFilteredObj(e){this._filteredObjects||(this._filteredObjects=new Set),this._filteredObjects.add(e)}_isIncluded(e){return this._filteredObjects?.has(e)??!0}textToConsoleArgs(e){return DYs([gme(OYs("| ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[gme(" "),iR(yme(e.oldValue,70),{color:"red",strikeThrough:!0}),gme(" "),iR(yme(e.newValue,60),{color:"green"})]:[gme(" (unchanged)")]:[gme(" "),iR(yme(e.newValue,60),{color:"green"}),gme(" (initial)")]}handleObservableCreated(e){if(e instanceof Tti.Derived){let r=e;if(this.changedObservablesSets.set(r,new Set),!1){let o=[];r.__debugUpdating=o;let s=r.beginUpdate;r.beginUpdate=l=>(o.push(l),s.apply(r,[l]));let c=r.endUpdate;r.endUpdate=l=>{let u=o.indexOf(l);return u===-1&&console.error("endUpdate called without beginUpdate",r.debugName,l.debugName),o.splice(u,1),c.apply(r,[l])}}}}handleOnListenerCountChanged(e,r){}handleObservableUpdated(e,r){if(this._isIncluded(e)){if(e instanceof Tti.Derived){this._handleDerivedRecomputed(e,r);return}console.log(...this.textToConsoleArgs([Ame("observable value changed"),iR(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r)]))}}formatChanges(e){if(e.size!==0)return iR(" (changed deps: "+[...e].map(r=>r.debugName).join(", ")+")",{color:"gray"})}handleDerivedDependencyChanged(e,r,n){this._isIncluded(e)&&this.changedObservablesSets.get(e)?.add(r)}_handleDerivedRecomputed(e,r){if(!this._isIncluded(e))return;let n=this.changedObservablesSets.get(e);n&&(console.log(...this.textToConsoleArgs([Ame("derived recomputed"),iR(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r),this.formatChanges(n),{data:[{fn:e._debugNameData.referenceFn??e._computeFn}]}])),n.clear())}handleDerivedCleared(e){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Ame("derived cleared"),iR(e.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(e,r){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Ame("observable from event triggered"),iR(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r),{data:[{fn:e._getValue}]}]))}handleAutorunCreated(e){this._isIncluded(e)&&this.changedObservablesSets.set(e,new Set)}handleAutorunDisposed(e){}handleAutorunDependencyChanged(e,r,n){this._isIncluded(e)&&this.changedObservablesSets.get(e).add(r)}handleAutorunStarted(e){let r=this.changedObservablesSets.get(e);r&&(this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Ame("autorun"),iR(e.debugName,{color:"BlueViolet"}),this.formatChanges(r),{data:[{fn:e._debugNameData.referenceFn??e._runFn}]}])),r.clear(),this.indentation++)}handleAutorunFinished(e){this.indentation--}handleBeginTransaction(e){let r=e.getDebugName();r===void 0&&(r=""),this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Ame("transaction"),iR(r,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}};Eme.ConsoleObservableLogger=Uut;function DYs(t){let e=new Array,r=[],n="";function o(c){if("length"in c)for(let l of c)l&&o(l);else"text"in c?(n+=`%c${c.text}`,e.push(c.style),c.data&&r.push(...c.data)):"data"in c&&r.push(...c.data)}a(o,"process"),o(t);let s=[n,...e];return s.push(...r),s}a(DYs,"consoleTextToArgs");function gme(t){return iR(t,{color:"black"})}a(gme,"normalText");function Ame(t){return iR(LYs(`${t}: `,10),{color:"black",bold:!0})}a(Ame,"formatKind");function iR(t,e={color:"black"}){function r(o){return Object.entries(o).reduce((s,[c,l])=>`${s}${c}:${l};`,"")}a(r,"objToCss");let n={color:e.color};return e.strikeThrough&&(n["text-decoration"]="line-through"),e.bold&&(n["font-weight"]="bold"),{text:t,style:r(n)}}a(iR,"styled");function yme(t,e){switch(typeof t){case"number":return""+t;case"string":return t.length+2<=e?`"${t}"`:`"${t.substr(0,e-7)}"+...`;case"boolean":return t?"true":"false";case"undefined":return"undefined";case"object":return t===null?"null":Array.isArray(t)?NYs(t,e):MYs(t,e);case"symbol":return t.toString();case"function":return`[[Function${t.name?" "+t.name:""}]]`;default:return""+t}}a(yme,"formatValue");function NYs(t,e){let r="[ ",n=!0;for(let o of t){if(n||(r+=", "),r.length-5>e){r+="...";break}n=!1,r+=`${yme(o,e-r.length)}`}return r+=" ]",r}a(NYs,"formatArray");function MYs(t,e){if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString){let s=t.toString();return s.length<=e?s:s.substring(0,e-3)+"..."}let r=(0,kYs.getClassName)(t),n=r?r+"(":"{ ",o=!0;for(let[s,c]of Object.entries(t)){if(o||(n+=", "),n.length-5>e){n+="...";break}o=!1,n+=`${s}: ${yme(c,e-n.length)}`}return n+=r?")":" }",n}a(MYs,"formatObject");function OYs(t,e){let r="";for(let n=1;n<=e;n++)r+=t;return r}a(OYs,"repeat");function LYs(t,e){for(;t.length{"use strict";p();Object.defineProperty(qut,"__esModule",{value:!0});qut.SimpleTypedRpcConnection=void 0;var Bpr=class t{static{a(this,"SimpleTypedRpcConnection")}static createHost(e,r){return new t(e,r)}static createClient(e,r){return new t(e,r)}constructor(e,r){this._channelFactory=e,this._getHandler=r,this._channel=this._channelFactory({handleNotification:a(s=>{let c=s,l=this._getHandler().notifications[c[0]];if(!l)throw new Error(`Unknown notification "${c[0]}"!`);l(...c[1])},"handleNotification"),handleRequest:a(s=>{let c=s;try{return{type:"result",value:this._getHandler().requests[c[0]](...c[1])}}catch(l){return{type:"error",value:l}}},"handleRequest")});let n=new Proxy({},{get:a((s,c)=>async(...l)=>{let u=await this._channel.sendRequest([c,l]);if(u.type==="error")throw u.value;return u.value},"get")}),o=new Proxy({},{get:a((s,c)=>(...l)=>{this._channel.sendNotification([c,l])},"get")});this.api={notifications:o,requests:n}}};qut.SimpleTypedRpcConnection=Bpr});var xti=I(Fpr=>{"use strict";p();Object.defineProperty(Fpr,"__esModule",{value:!0});Fpr.registerDebugChannel=FYs;var BYs=Iti();function FYs(t,e){let r=globalThis,n=[],o,{channel:s,handler:c}=UYs({sendNotification:a(u=>{o?o.sendNotification(u):n.push(u)},"sendNotification")}),l;return(r.$$debugValueEditor_debugChannels??(r.$$debugValueEditor_debugChannels={}))[t]=u=>{l=e(),o=u;for(let d of n)u.sendNotification(d);return n=[],c},BYs.SimpleTypedRpcConnection.createClient(s,()=>{if(!l)throw new Error("Not supported");return l})}a(FYs,"registerDebugChannel");function UYs(t){let e;return{channel:a(n=>(e=n,{sendNotification:a(o=>{t.sendNotification(o)},"sendNotification"),sendRequest:a(o=>{throw new Error("not supported")},"sendRequest")}),"channel"),handler:{handleRequest:a(n=>n.type==="notification"?e?.handleNotification(n.data):e?.handleRequest(n.data),"handleRequest")}}}a(UYs,"createChannelFactoryFromDebugChannel")});var kti=I(LH=>{"use strict";p();Object.defineProperty(LH,"__esModule",{value:!0});LH.Throttler=LH.Debouncer=void 0;LH.deepAssign=wti;LH.deepAssignDeleteNulls=Rti;var Upr=class{static{a(this,"Debouncer")}constructor(){this._timeout=void 0}debounce(e,r){this._timeout!==void 0&&clearTimeout(this._timeout),this._timeout=setTimeout(()=>{this._timeout=void 0,e()},r)}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}};LH.Debouncer=Upr;var Qpr=class{static{a(this,"Throttler")}constructor(){this._timeout=void 0}throttle(e,r){this._timeout===void 0&&(this._timeout=setTimeout(()=>{this._timeout=void 0,e()},r))}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}};LH.Throttler=Qpr;function wti(t,e){for(let r in e)t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?wti(t[r],e[r]):t[r]=e[r]}a(wti,"deepAssign");function Rti(t,e){for(let r in e)e[r]===null?delete t[r]:t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?Rti(t[r],e[r]):t[r]=e[r]}a(Rti,"deepAssignDeleteNulls")});var Nti=I(Hut=>{"use strict";p();Object.defineProperty(Hut,"__esModule",{value:!0});Hut.DevToolsLogger=void 0;var Pti=but(),jut=Qut(),QYs=xti(),qpr=kti(),SNe=KS(),qYs=OH(),nee=Rs(),iee=hme(),Dti=v8(),jYs=QT(),jpr=class t{static{a(this,"DevToolsLogger")}static{this._instance=void 0}static getInstance(){return t._instance===void 0&&(t._instance=new t),t._instance}getTransactionState(){let e=[],r=[...this._activeTransactions];if(r.length===0)return;let n=r.flatMap(s=>s.debugGetUpdatingObservers()??[]).map(s=>s.observer),o=new Set;for(;n.length>0;){let s=n.shift();if(o.has(s))continue;o.add(s);let c=this._getInfo(s,l=>{o.has(l)||n.push(l)});c&&e.push(c)}return{names:r.map(s=>s.getDebugName()??"tx"),affected:e}}_getObservableInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,nee.onUnexpectedError)(new nee.BugIndicatingError("No info found"));return}return r}_getAutorunInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,nee.onUnexpectedError)(new nee.BugIndicatingError("No info found"));return}return r}_getInfo(e,r){if(e instanceof iee.Derived){let n=[...e.debugGetObservers()];for(let u of n)r(u);let o=this._getObservableInfo(e);if(!o)return;let s=e.debugGetState(),c={name:e.debugName,instanceId:o.instanceId,updateCount:s.updateCount},l=[...o.changedObservables].map(u=>this._instanceInfos.get(u)?.instanceId).filter(SNe.isDefined);if(s.isComputing)return{...c,type:"observable/derived",state:"updating",changedDependencies:l,initialComputation:!1};switch(s.state){case 0:return{...c,type:"observable/derived",state:"noValue"};case 3:return{...c,type:"observable/derived",state:"upToDate"};case 2:return{...c,type:"observable/derived",state:"stale",changedDependencies:l};case 1:return{...c,type:"observable/derived",state:"possiblyStale"}}}else if(e instanceof Pti.AutorunObserver){let n=this._getAutorunInfo(e);if(!n)return;let o={name:e.debugName,instanceId:n.instanceId,updateCount:n.updateCount},s=[...n.changedObservables].map(c=>this._instanceInfos.get(c).instanceId);if(e.debugGetState().isRunning)return{...o,type:"autorun",state:"updating",changedDependencies:s};switch(e.debugGetState().state){case 3:return{...o,type:"autorun",state:"upToDate"};case 2:return{...o,type:"autorun",state:"stale",changedDependencies:s};case 1:return{...o,type:"autorun",state:"possiblyStale"}}}}_formatObservable(e){let r=this._getObservableInfo(e);if(r)return{name:e.debugName,instanceId:r.instanceId}}_formatObserver(e){if(e instanceof iee.Derived)return{name:e.toString(),instanceId:this._getObservableInfo(e)?.instanceId};let r=this._getAutorunInfo(e);if(r)return{name:e.toString(),instanceId:r.instanceId}}constructor(){this._declarationId=0,this._instanceId=0,this._declarations=new Map,this._instanceInfos=new WeakMap,this._aliveInstances=new Map,this._activeTransactions=new Set,this._channel=(0,QYs.registerDebugChannel)("observableDevTools",()=>({notifications:{setDeclarationIdFilter:a(e=>{},"setDeclarationIdFilter"),logObservableValue:a(e=>{console.log("logObservableValue",e)},"logObservableValue"),flushUpdates:a(()=>{this._flushUpdates()},"flushUpdates"),resetUpdates:a(()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)},"resetUpdates")},requests:{getDeclarations:a(()=>{let e={};for(let r of this._declarations.values())e[r.id]=r;return{decls:e}},"getDeclarations"),getSummarizedInstances:a(()=>null,"getSummarizedInstances"),getObservableValueInfo:a(e=>({observers:[...this._aliveInstances.get(e).debugGetObservers()].map(n=>this._formatObserver(n)).filter(SNe.isDefined)}),"getObservableValueInfo"),getDerivedInfo:a(e=>{let r=this._aliveInstances.get(e);return{dependencies:[...r.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(SNe.isDefined),observers:[...r.debugGetObservers()].map(n=>this._formatObserver(n)).filter(SNe.isDefined)}},"getDerivedInfo"),getAutorunInfo:a(e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(SNe.isDefined)}),"getAutorunInfo"),getTransactionState:a(()=>this.getTransactionState(),"getTransactionState"),setValue:a((e,r)=>{let n=this._aliveInstances.get(e);if(n instanceof iee.Derived)n.debugSetValue(r);else if(n instanceof Dti.ObservableValue)n.debugSetValue(r);else if(n instanceof qYs.FromEventObservable)n.debugSetValue(r);else throw new nee.BugIndicatingError("Observable is not supported");let o=[...n.debugGetObservers()];for(let s of o)s.beginUpdate(n);for(let s of o)s.handleChange(n,void 0);for(let s of o)s.endUpdate(n)},"setValue"),getValue:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof iee.Derived)return(0,jut.formatValue)(r.debugGetState().value,200);if(r instanceof Dti.ObservableValue)return(0,jut.formatValue)(r.debugGetState().value,200)},"getValue"),logValue:a(e=>{let r=this._aliveInstances.get(e);if(r&&"get"in r)console.log("Logged Value:",r.get());else throw new nee.BugIndicatingError("Observable is not supported")},"logValue"),rerun:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof iee.Derived)r.debugRecompute();else if(r instanceof Pti.AutorunObserver)r.debugRerun();else throw new nee.BugIndicatingError("Observable is not supported")},"rerun")}})),this._pendingChanges=null,this._changeThrottler=new qpr.Throttler,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},jYs.DebugLocation.enable()}_handleChange(e){(0,qpr.deepAssignDeleteNulls)(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:(0,qpr.deepAssign)(this._pendingChanges,e),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(e,r){if(!r)return-1;let n=this._declarations.get(r.id);return n===void 0&&(n={id:this._declarationId++,type:e,url:r.fileName,line:r.line,column:r.column},this._declarations.set(r.id,n),this._handleChange({decls:{[n.id]:n}})),n.id}handleObservableCreated(e,r){let o={declarationId:this._getDeclarationId("observable/value",r),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,o)}handleOnListenerCountChanged(e,r){let n=this._getObservableInfo(e);if(n){if(n.listenerCount===0&&r>0){let o=e instanceof iee.Derived?"observable/derived":"observable/value";this._aliveInstances.set(n.instanceId,e),this._handleChange({instances:{[n.instanceId]:{instanceId:n.instanceId,declarationId:n.declarationId,formattedValue:n.lastValue,type:o,name:e.debugName}}})}else n.listenerCount>0&&r===0&&(this._handleChange({instances:{[n.instanceId]:null}}),this._aliveInstances.delete(n.instanceId));n.listenerCount=r}}handleObservableUpdated(e,r){if(e instanceof iee.Derived){this._handleDerivedRecomputed(e,r);return}let n=this._getObservableInfo(e);n&&r.didChange&&(n.lastValue=(0,jut.formatValue)(r.newValue,30),n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:n.lastValue}}}))}handleAutorunCreated(e,r){let o={declarationId:this._getDeclarationId("autorun",r),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,o),this._aliveInstances.set(o.instanceId,e),o&&this._handleChange({instances:{[o.instanceId]:{instanceId:o.instanceId,declarationId:o.declarationId,runCount:0,type:"autorun",name:e.debugName}}})}handleAutorunDisposed(e){let r=this._getAutorunInfo(e);r&&(this._handleChange({instances:{[r.instanceId]:null}}),this._instanceInfos.delete(e),this._aliveInstances.delete(r.instanceId))}handleAutorunDependencyChanged(e,r,n){let o=this._getAutorunInfo(e);o&&o.changedObservables.add(r)}handleAutorunStarted(e){}handleAutorunFinished(e){let r=this._getAutorunInfo(e);r&&(r.changedObservables.clear(),r.updateCount++,this._handleChange({instances:{[r.instanceId]:{runCount:r.updateCount}}}))}handleDerivedDependencyChanged(e,r,n){let o=this._getObservableInfo(e);o&&o.changedObservables.add(r)}_handleDerivedRecomputed(e,r){let n=this._getObservableInfo(e);if(!n)return;let o=(0,jut.formatValue)(r.newValue,30);n.updateCount++,n.changedObservables.clear(),n.lastValue=o,n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:o,recomputationCount:n.updateCount}}})}handleDerivedCleared(e){let r=this._getObservableInfo(e);r&&(r.lastValue=void 0,r.changedObservables.clear(),r.listenerCount>0&&this._handleChange({instances:{[r.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(e){this._activeTransactions.add(e)}handleEndTransaction(e){this._activeTransactions.delete(e)}};Hut.DevToolsLogger=jpr});var Bti=I(Hpr=>{"use strict";p();Object.defineProperty(Hpr,"__esModule",{value:!0});Hpr.debugGetObservableGraph=WYs;var HYs=hme(),GYs=OH(),$Ys=v8(),VYs=but(),Mti=Qut();function WYs(t,e){let r=e?.debugNamePostProcessor??(s=>s),n=oee.from(t,r);if(!n)return"";let o=new Set;return e.type==="observers"?Lti(n,0,o,e).trim():Oti(n,0,o,e).trim()}a(WYs,"debugGetObservableGraph");function Oti(t,e,r,n){let o=" ".repeat(e),s=[];if(r.has(t.sourceObj))return s.push(`${o}* ${t.type} ${t.name} (already listed)`),s.join(` -`);if(r.add(t.sourceObj),s.push(`${o}* ${t.type} ${t.name}:`),s.push(`${o} value: ${(0,Mti.formatValue)(t.value,50)}`),s.push(`${o} state: ${t.state}`),t.dependencies.length>0){s.push(`${o} dependencies:`);for(let l of t.dependencies){let u=oee.from(l,n.debugNamePostProcessor??(d=>d))??oee.unknown(l);s.push(Oti(u,e+1,r,n))}}return s.join(` -`)}a(Oti,"formatObservableInfoWithDependencies");function Lti(t,e,r,n){let o=" ".repeat(e),s=[];if(r.has(t.sourceObj))return s.push(`${o}* ${t.type} ${t.name} (already listed)`),s.join(` -`);if(r.add(t.sourceObj),s.push(`${o}* ${t.type} ${t.name}:`),s.push(`${o} value: ${(0,Mti.formatValue)(t.value,50)}`),s.push(`${o} state: ${t.state}`),t.observers.length>0){s.push(`${o} observers:`);for(let l of t.observers){let u=oee.from(l,n.debugNamePostProcessor??(d=>d))??oee.unknown(l);s.push(Lti(u,e+1,r,n))}}return s.join(` -`)}a(Lti,"formatObservableInfoWithObservers");var oee=class t{static{a(this,"Info")}static from(e,r){if(e instanceof VYs.AutorunObserver){let n=e.debugGetState();return new t(e,r(e.debugName),"autorun",void 0,n.stateStr,Array.from(n.dependencies),[])}else if(e instanceof HYs.Derived){let n=e.debugGetState();return new t(e,r(e.debugName),"derived",n.value,n.stateStr,Array.from(n.dependencies),Array.from(e.debugGetObservers()))}else if(e instanceof $Ys.ObservableValue){let n=e.debugGetState();return new t(e,r(e.debugName),"observableValue",n.value,"upToDate",[],Array.from(e.debugGetObservers()))}else if(e instanceof GYs.FromEventObservable){let n=e.debugGetState();return new t(e,r(e.debugName),"fromEvent",n.value,n.hasValue?"upToDate":"initial",[],Array.from(e.debugGetObservers()))}}static unknown(e){return new t(e,"(unknown)","unknown",void 0,"unknown",[],[])}constructor(e,r,n,o,s,c,l){this.sourceObj=e,this.name=r,this.type=n,this.value=o,this.state=s,this.dependencies=c,this.observers=l}}});var C8=I(Ut=>{"use strict";p();Object.defineProperty(Ut,"__esModule",{value:!0});Ut.ValueWithChangeEventFromObservable=Ut.observableFromValueWithChangeEvent=Ut.TransactionImpl=Ut.transaction=Ut.subtransaction=Ut.globalTransaction=Ut.asyncTransaction=Ut.observableSignalFromEvent=Ut.observableFromEventOpts=Ut.observableSignal=Ut.constObservable=Ut.recordChangesLazy=Ut.recordChanges=Ut.isObservable=Ut.wasEventTriggeredRecently=Ut.throttledObservable=Ut.signalFromObservable=Ut.recomputeInitiallyAndOnChange=Ut.observableFromPromise=Ut.mapObservableArrayCached=Ut.keepObserved=Ut.derivedObservableWithWritableCache=Ut.derivedObservableWithCache=Ut.debouncedObservable2=Ut.debouncedObservable=Ut.waitForState=Ut.derivedWithCancellationToken=Ut.PromiseResult=Ut.ObservableResolvedPromise=Ut.ObservablePromise=Ut.ObservableLazyPromise=Ut.ObservableLazy=Ut.derivedWithStore=Ut.derivedWithSetter=Ut.derivedOpts=Ut.derivedHandleChanges=Ut.derivedDisposable=Ut.derived=Ut.disposableObservableValue=Ut.registerAutorunSelfDisposable=Ut.autorunSelfDisposable=Ut.autorunPerKeyedItem=Ut.autorunIterableDelta=Ut.autorunWithStoreHandleChanges=Ut.autorunWithStore=Ut.autorunOpts=Ut.autorunHandleChanges=Ut.autorunDelta=Ut.autorun=Ut.observableValueOpts=void 0;Ut.DebugLocation=Ut.ObservableMap=Ut.ObservableSet=Ut.observableValue=Ut.observableFromEvent=Ut.latestChangedValue=Ut.derivedConstOnceDefined=Ut.runOnChangeWithStore=Ut.runOnChangeWithCancellationToken=Ut.runOnChange=void 0;var zYs=vut();Object.defineProperty(Ut,"observableValueOpts",{enumerable:!0,get:a(function(){return zYs.observableValueOpts},"get")});var l4=JX();Object.defineProperty(Ut,"autorun",{enumerable:!0,get:a(function(){return l4.autorun},"get")});Object.defineProperty(Ut,"autorunDelta",{enumerable:!0,get:a(function(){return l4.autorunDelta},"get")});Object.defineProperty(Ut,"autorunHandleChanges",{enumerable:!0,get:a(function(){return l4.autorunHandleChanges},"get")});Object.defineProperty(Ut,"autorunOpts",{enumerable:!0,get:a(function(){return l4.autorunOpts},"get")});Object.defineProperty(Ut,"autorunWithStore",{enumerable:!0,get:a(function(){return l4.autorunWithStore},"get")});Object.defineProperty(Ut,"autorunWithStoreHandleChanges",{enumerable:!0,get:a(function(){return l4.autorunWithStoreHandleChanges},"get")});Object.defineProperty(Ut,"autorunIterableDelta",{enumerable:!0,get:a(function(){return l4.autorunIterableDelta},"get")});Object.defineProperty(Ut,"autorunPerKeyedItem",{enumerable:!0,get:a(function(){return l4.autorunPerKeyedItem},"get")});Object.defineProperty(Ut,"autorunSelfDisposable",{enumerable:!0,get:a(function(){return l4.autorunSelfDisposable},"get")});Object.defineProperty(Ut,"registerAutorunSelfDisposable",{enumerable:!0,get:a(function(){return l4.registerAutorunSelfDisposable},"get")});var YYs=v8();Object.defineProperty(Ut,"disposableObservableValue",{enumerable:!0,get:a(function(){return YYs.disposableObservableValue},"get")});var _me=Tut();Object.defineProperty(Ut,"derived",{enumerable:!0,get:a(function(){return _me.derived},"get")});Object.defineProperty(Ut,"derivedDisposable",{enumerable:!0,get:a(function(){return _me.derivedDisposable},"get")});Object.defineProperty(Ut,"derivedHandleChanges",{enumerable:!0,get:a(function(){return _me.derivedHandleChanges},"get")});Object.defineProperty(Ut,"derivedOpts",{enumerable:!0,get:a(function(){return _me.derivedOpts},"get")});Object.defineProperty(Ut,"derivedWithSetter",{enumerable:!0,get:a(function(){return _me.derivedWithSetter},"get")});Object.defineProperty(Ut,"derivedWithStore",{enumerable:!0,get:a(function(){return _me.derivedWithStore},"get")});var TNe=Xei();Object.defineProperty(Ut,"ObservableLazy",{enumerable:!0,get:a(function(){return TNe.ObservableLazy},"get")});Object.defineProperty(Ut,"ObservableLazyPromise",{enumerable:!0,get:a(function(){return TNe.ObservableLazyPromise},"get")});Object.defineProperty(Ut,"ObservablePromise",{enumerable:!0,get:a(function(){return TNe.ObservablePromise},"get")});Object.defineProperty(Ut,"ObservableResolvedPromise",{enumerable:!0,get:a(function(){return TNe.ObservableResolvedPromise},"get")});Object.defineProperty(Ut,"PromiseResult",{enumerable:!0,get:a(function(){return TNe.PromiseResult},"get")});var Uti=eti();Object.defineProperty(Ut,"derivedWithCancellationToken",{enumerable:!0,get:a(function(){return Uti.derivedWithCancellationToken},"get")});Object.defineProperty(Ut,"waitForState",{enumerable:!0,get:a(function(){return Uti.waitForState},"get")});var oR=Dut();Object.defineProperty(Ut,"debouncedObservable",{enumerable:!0,get:a(function(){return oR.debouncedObservable},"get")});Object.defineProperty(Ut,"debouncedObservable2",{enumerable:!0,get:a(function(){return oR.debouncedObservable2},"get")});Object.defineProperty(Ut,"derivedObservableWithCache",{enumerable:!0,get:a(function(){return oR.derivedObservableWithCache},"get")});Object.defineProperty(Ut,"derivedObservableWithWritableCache",{enumerable:!0,get:a(function(){return oR.derivedObservableWithWritableCache},"get")});Object.defineProperty(Ut,"keepObserved",{enumerable:!0,get:a(function(){return oR.keepObserved},"get")});Object.defineProperty(Ut,"mapObservableArrayCached",{enumerable:!0,get:a(function(){return oR.mapObservableArrayCached},"get")});Object.defineProperty(Ut,"observableFromPromise",{enumerable:!0,get:a(function(){return oR.observableFromPromise},"get")});Object.defineProperty(Ut,"recomputeInitiallyAndOnChange",{enumerable:!0,get:a(function(){return oR.recomputeInitiallyAndOnChange},"get")});Object.defineProperty(Ut,"signalFromObservable",{enumerable:!0,get:a(function(){return oR.signalFromObservable},"get")});Object.defineProperty(Ut,"throttledObservable",{enumerable:!0,get:a(function(){return oR.throttledObservable},"get")});Object.defineProperty(Ut,"wasEventTriggeredRecently",{enumerable:!0,get:a(function(){return oR.wasEventTriggeredRecently},"get")});Object.defineProperty(Ut,"isObservable",{enumerable:!0,get:a(function(){return oR.isObservable},"get")});var Qti=pti();Object.defineProperty(Ut,"recordChanges",{enumerable:!0,get:a(function(){return Qti.recordChanges},"get")});Object.defineProperty(Ut,"recordChangesLazy",{enumerable:!0,get:a(function(){return Qti.recordChangesLazy},"get")});var KYs=hti();Object.defineProperty(Ut,"constObservable",{enumerable:!0,get:a(function(){return KYs.constObservable},"get")});var JYs=wpr();Object.defineProperty(Ut,"observableSignal",{enumerable:!0,get:a(function(){return JYs.observableSignal},"get")});var ZYs=OH();Object.defineProperty(Ut,"observableFromEventOpts",{enumerable:!0,get:a(function(){return ZYs.observableFromEventOpts},"get")});var XYs=mti();Object.defineProperty(Ut,"observableSignalFromEvent",{enumerable:!0,get:a(function(){return XYs.observableSignalFromEvent},"get")});var INe=_8();Object.defineProperty(Ut,"asyncTransaction",{enumerable:!0,get:a(function(){return INe.asyncTransaction},"get")});Object.defineProperty(Ut,"globalTransaction",{enumerable:!0,get:a(function(){return INe.globalTransaction},"get")});Object.defineProperty(Ut,"subtransaction",{enumerable:!0,get:a(function(){return INe.subtransaction},"get")});Object.defineProperty(Ut,"transaction",{enumerable:!0,get:a(function(){return INe.transaction},"get")});Object.defineProperty(Ut,"TransactionImpl",{enumerable:!0,get:a(function(){return INe.TransactionImpl},"get")});var qti=gti();Object.defineProperty(Ut,"observableFromValueWithChangeEvent",{enumerable:!0,get:a(function(){return qti.observableFromValueWithChangeEvent},"get")});Object.defineProperty(Ut,"ValueWithChangeEventFromObservable",{enumerable:!0,get:a(function(){return qti.ValueWithChangeEventFromObservable},"get")});var Gpr=Eti();Object.defineProperty(Ut,"runOnChange",{enumerable:!0,get:a(function(){return Gpr.runOnChange},"get")});Object.defineProperty(Ut,"runOnChangeWithCancellationToken",{enumerable:!0,get:a(function(){return Gpr.runOnChangeWithCancellationToken},"get")});Object.defineProperty(Ut,"runOnChangeWithStore",{enumerable:!0,get:a(function(){return Gpr.runOnChangeWithStore},"get")});var jti=Cti();Object.defineProperty(Ut,"derivedConstOnceDefined",{enumerable:!0,get:a(function(){return jti.derivedConstOnceDefined},"get")});Object.defineProperty(Ut,"latestChangedValue",{enumerable:!0,get:a(function(){return jti.latestChangedValue},"get")});var eKs=OH();Object.defineProperty(Ut,"observableFromEvent",{enumerable:!0,get:a(function(){return eKs.observableFromEvent},"get")});var tKs=v8();Object.defineProperty(Ut,"observableValue",{enumerable:!0,get:a(function(){return tKs.observableValue},"get")});var rKs=bti();Object.defineProperty(Ut,"ObservableSet",{enumerable:!0,get:a(function(){return rKs.ObservableSet},"get")});var nKs=Sti();Object.defineProperty(Ut,"ObservableMap",{enumerable:!0,get:a(function(){return nKs.ObservableMap},"get")});var iKs=QT();Object.defineProperty(Ut,"DebugLocation",{enumerable:!0,get:a(function(){return iKs.DebugLocation},"get")});var $pr=o4(),Hti=Qut(),oKs=Nti(),Fti=owe(),sKs=H2(),aKs=Bti();(0,sKs._setDebugGetObservableGraph)(aKs.debugGetObservableGraph);(0,$pr.setLogObservableFn)(Hti.logObservableToConsole);var cKs=!1;cKs&&(0,$pr.addLogger)(new Hti.ConsoleObservableLogger);Fti.env&&Fti.env.VSCODE_DEV_DEBUG_OBSERVABLES&&(0,$pr.addLogger)(oKs.DevToolsLogger.getInstance())});var hd=I(vme=>{"use strict";p();Object.defineProperty(vme,"__esModule",{value:!0});vme.OffsetRangeSet=vme.OffsetRange=void 0;var Gut=Rs(),$ut=class t{static{a(this,"OffsetRange")}static fromTo(e,r){return new t(e,r)}static equals(e,r){return e.start===r.start&&e.endExclusive===r.endExclusive}static addRange(e,r){let n=0;for(;nr))return new t(e,r)}static ofLength(e){return new t(0,e)}static ofStartAndLength(e,r){return new t(e,e+r)}static emptyAt(e){return new t(e,e)}constructor(e,r){if(this.start=e,this.endExclusive=r,e>r)throw new Gut.BugIndicatingError(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new t(this.start+e,this.endExclusive+e)}deltaStart(e){return new t(this.start+e,this.endExclusive)}deltaEnd(e){return new t(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Gut.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Gut.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){let r=[];for(let n=this.start;ne.toString()).join(", ")}intersectsStrict(e){let r=0;for(;re+r.length,0)}};vme.OffsetRangeSet=Vpr});var $2=I(Sme=>{"use strict";p();Object.defineProperty(Sme,"__esModule",{value:!0});Sme.LineRangeSet=Sme.LineRange=void 0;var Gti=Rs(),lKs=hd(),$ti=eh(),Cme=xq(),Vti=Sl(),bme=class t{static{a(this,"LineRange")}static ofLength(e,r){return new t(e,e+r)}static fromRange(e){return new t(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new t(e.startLineNumber,e.endLineNumber+1)}static{this.compareByStart=(0,Vti.compareBy)(e=>e.startLineNumber,Vti.numberComparator)}static subtract(e,r){return r?e.startLineNumberr)throw new Gti.BugIndicatingError(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=(0,Cme.findLastIdxMonotonous)(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)this._normalizedRanges.splice(r,0,e);else if(r===n-1){let o=this._normalizedRanges[r];this._normalizedRanges[r]=o.join(e)}else{let o=this._normalizedRanges[r].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(r,n-r,o)}}contains(e){let r=(0,Cme.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=(0,Cme.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;let r=[],n=0,o=0,s=null;for(;n=c.startLineNumber?s=new bme(s.startLineNumber,Math.max(s.endLineNumberExclusive,c.endLineNumberExclusive)):(r.push(s),s=c)}return s!==null&&r.push(s),new t(r)}subtractFrom(e){let r=(0,Cme.findFirstIdxMonotonousOrArrLen)(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=(0,Cme.findLastIdxMonotonous)(this._normalizedRanges,c=>c.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)return new t([e]);let o=[],s=e.startLineNumber;for(let c=r;cs&&o.push(new bme(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};Sme.LineRangeSet=xNe});var Tme=I(Wut=>{"use strict";p();Object.defineProperty(Wut,"__esModule",{value:!0});Wut.TextLength=void 0;var uKs=$2(),Wti=q_(),Vut=eh(),Wpr=class t{static{a(this,"TextLength")}static{this.zero=new t(0,0)}static lengthDiffNonNegative(e,r){return r.isLessThan(e)?t.zero:e.lineCount===r.lineCount?new t(0,r.columnCount-e.columnCount):new t(r.lineCount-e.lineCount,r.columnCount)}static betweenPositions(e,r){return e.lineNumber===r.lineNumber?new t(0,r.column-e.column):new t(r.lineNumber-e.lineNumber,r.column-1)}static fromPosition(e){return new t(e.lineNumber-1,e.column-1)}static ofRange(e){return t.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let r=0,n=0;for(let o of e)o===` -`?(r++,n=0):n++;return new t(r,n)}static ofSubstr(e,r){return t.ofText(r.substring(e))}static sum(e,r){return e.reduce((n,o)=>n.add(r(o)),t.zero)}constructor(e,r){this.lineCount=e,this.columnCount=r}isZero(){return this.lineCount===0&&this.columnCount===0}isLessThan(e){return this.lineCount!==e.lineCount?this.lineCounte.lineCount:this.columnCount>e.columnCount}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}equals(e){return this.lineCount===e.lineCount&&this.columnCount===e.columnCount}compare(e){return this.lineCount!==e.lineCount?this.lineCount-e.lineCount:this.columnCount-e.columnCount}add(e){return e.lineCount===0?new t(this.lineCount,this.columnCount+e.columnCount):new t(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new Vut.Range(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Vut.Range(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Vut.Range(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return uKs.LineRange.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new Wti.Position(e.lineNumber,e.column+this.columnCount):new Wti.Position(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return Vut.Range.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};Wut.TextLength=Wpr});var Yut=I(see=>{"use strict";p();Object.defineProperty(see,"__esModule",{value:!0});see.PositionOffsetTransformer=see.PositionOffsetTransformerBase=void 0;see._setPositionOffsetTransformerDependencies=hKs;var dKs=xq(),fKs=hd(),wNe=q_(),pKs=eh(),zut=class{static{a(this,"PositionOffsetTransformerBase")}getOffsetRange(e){return new fKs.OffsetRange(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return pKs.Range.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringEdit(e){let r=e.replacements.map(n=>this.getStringReplacement(n));return new b8.deps.StringEdit(r)}getStringReplacement(e){return new b8.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new b8.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){let r=e.replacements.map(n=>this.getTextReplacement(n));return new b8.deps.TextEdit(r)}};see.PositionOffsetTransformerBase=zut;var b8=class{static{a(this,"Deps")}static{this._deps=void 0}static get deps(){if(!this._deps)throw new Error("Dependencies not set. Call _setDependencies first.");return this._deps}};function hKs(t){b8._deps=t}a(hKs,"_setPositionOffsetTransformerDependencies");var zpr=class extends zut{static{a(this,"PositionOffsetTransformer")}constructor(e){super(),this.text=e}get lineStartOffsetByLineIdx(){return this._lineStartOffsetByLineIdx||this._computeLineOffsets(),this._lineStartOffsetByLineIdx}get lineEndOffsetByLineIdx(){return this._lineEndOffsetByLineIdx||this._computeLineOffsets(),this._lineEndOffsetByLineIdx}_computeLineOffsets(){this._lineStartOffsetByLineIdx=[],this._lineEndOffsetByLineIdx=[],this._lineStartOffsetByLineIdx.push(0);for(let e=0;e0&&this.text.charAt(e-1)==="\r"?this._lineEndOffsetByLineIdx.push(e-1):this._lineEndOffsetByLineIdx.push(e));this._lineEndOffsetByLineIdx.push(this.text.length)}getOffset(e){let r=this._validatePosition(e);return this.lineStartOffsetByLineIdx[r.lineNumber-1]+r.column-1}_validatePosition(e){if(e.lineNumber<1)return new wNe.Position(1,1);let r=this.textLength.lineCount+1;if(e.lineNumber>r){let o=this.getLineLength(r);return new wNe.Position(r,o+1)}if(e.column<1)return new wNe.Position(e.lineNumber,1);let n=this.getLineLength(e.lineNumber);return e.column-1>n?new wNe.Position(e.lineNumber,n+1):e}getPosition(e){let r=(0,dKs.findLastIdxMonotonous)(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new wNe.Position(n,o)}getTextLength(e){return b8.deps.TextLength.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new b8.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};see.PositionOffsetTransformer=zpr});var qT=I(u4=>{"use strict";p();Object.defineProperty(u4,"__esModule",{value:!0});u4.StringText=u4.ArrayText=u4.LineBasedText=u4.AbstractText=void 0;var mKs=rd(),gKs=em(),AKs=q_(),zti=eh(),yKs=Tme(),Yti=Yut(),RNe=class{static{a(this,"AbstractText")}constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new AKs.Position(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getValueOfOffsetRange(e){return this.getValueOfRange(this.getTransformer().getRange(e))}getLineLength(e){return this.getValueOfRange(new zti.Range(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new Yti.PositionOffsetTransformer(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new zti.Range(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return(0,gKs.splitLines)(e)}getLinesOfRange(e){return e.mapToLineArray(r=>this.getLineAt(r))}equals(e){return this===e?!0:this.getValue()===e.getValue()}};u4.AbstractText=RNe;var Kut=class extends RNe{static{a(this,"LineBasedText")}constructor(e,r){(0,mKs.assert)(r>=1),super(),this._getLineContent=e,this._lineCount=r}getValueOfRange(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);let r=this._getLineContent(e.startLineNumber).substring(e.startColumn-1);for(let n=e.startLineNumber+1;n{"use strict";p();tct();oWn();a(rct,"format");a(che,"repeat");a(u6s,"computeIndentLevel");a(d6s,"getEOL");a(W2e,"isEOL")});function sWn(t,e){let r=[],n=new Object,o,s={value:{},offset:0,length:0,type:"object",parent:void 0},c=!1;function l(u,d,f,h){s.value=u,s.offset=d,s.length=f,s.type=h,s.colonOffset=void 0,o=s}a(l,"setPreviousNode");try{K2e(t,{onObjectBegin:a((u,d)=>{if(e<=u)throw n;o=void 0,c=e>u,r.push("")},"onObjectBegin"),onObjectProperty:a((u,d,f)=>{if(e{if(e<=u)throw n;o=void 0,r.pop()},"onObjectEnd"),onArrayBegin:a((u,d)=>{if(e<=u)throw n;o=void 0,r.push(0)},"onArrayBegin"),onArrayEnd:a((u,d)=>{if(e<=u)throw n;o=void 0,r.pop()},"onArrayEnd"),onLiteralValue:a((u,d,f)=>{if(e{if(e<=d)throw n;if(u===":"&&o&&o.type==="property")o.colonOffset=d,c=!1,o=void 0;else if(u===","){let h=r[r.length-1];typeof h=="number"?r[r.length-1]=h+1:(c=!0,r[r.length-1]=""),o=void 0}},"onSeparator")})}catch(u){if(u!==n)throw u}return{path:r,previousNode:o,isAtPropertyKey:c,matches:a(u=>{let d=0;for(let f=0;d{let u={};c(u),s.push(o),o=u,n=null},"onObjectBegin"),onObjectProperty:a(u=>{n=u},"onObjectProperty"),onObjectEnd:a(()=>{o=s.pop()},"onObjectEnd"),onArrayBegin:a(()=>{let u=[];c(u),s.push(o),o=u,n=null},"onArrayBegin"),onArrayEnd:a(()=>{o=s.pop()},"onArrayEnd"),onLiteralValue:c,onError:a((u,d,f)=>{e.push({error:u,offset:d,length:f})},"onError")},r),o[0]}function ict(t,e=[],r=z2e.DEFAULT){let n={type:"array",offset:-1,length:-1,children:[],parent:void 0};function o(u){n.type==="property"&&(n.length=u-n.offset,n=n.parent)}a(o,"ensurePropertyComplete");function s(u){return n.children.push(u),u}a(s,"onValue"),K2e(t,{onObjectBegin:a(u=>{n=s({type:"object",offset:u,length:-1,parent:n,children:[]})},"onObjectBegin"),onObjectProperty:a((u,d,f)=>{n=s({type:"property",offset:d,length:-1,parent:n,children:[]}),n.children.push({type:"string",value:u,offset:d,length:f,parent:n})},"onObjectProperty"),onObjectEnd:a((u,d)=>{o(u+d),n.length=u+d-n.offset,n=n.parent,o(u+d)},"onObjectEnd"),onArrayBegin:a((u,d)=>{n=s({type:"array",offset:u,length:-1,parent:n,children:[]})},"onArrayBegin"),onArrayEnd:a((u,d)=>{n.length=u+d-n.offset,n=n.parent,o(u+d)},"onArrayEnd"),onLiteralValue:a((u,d,f)=>{s({type:lWn(u),offset:d,length:f,parent:n,value:u}),o(d+f)},"onLiteralValue"),onSeparator:a((u,d,f)=>{n.type==="property"&&(u===":"?n.colonOffset=d:u===","&&o(d))},"onSeparator"),onError:a((u,d,f)=>{e.push({error:u,offset:d,length:f})},"onError")},r);let l=n.children[0];return l&&delete l.parent,l}function Y2e(t,e){if(!t)return;let r=t;for(let n of e)if(typeof n=="string"){if(r.type!=="object"||!Array.isArray(r.children))return;let o=!1;for(let s of r.children)if(Array.isArray(s.children)&&s.children[0].value===n&&s.children.length===2){r=s.children[1],o=!0;break}if(!o)return}else{let o=n;if(r.type!=="array"||o<0||!Array.isArray(r.children)||o>=r.children.length)return;r=r.children[o]}return r}function dlr(t){if(!t.parent||!t.parent.children)return[];let e=dlr(t.parent);if(t.parent.type==="property"){let r=t.parent.children[0].value;e.push(r)}else if(t.parent.type==="array"){let r=t.parent.children.indexOf(t);r!==-1&&e.push(r)}return e}function nct(t){switch(t.type){case"array":return t.children.map(nct);case"object":let e=Object.create(null);for(let r of t.children){let n=r.children[1];n&&(e[r.children[0].value]=nct(n))}return e;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function p6s(t,e,r=!1){return e>=t.offset&&es===0&&M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}a(c,"toNoArgVisit");function l(M){return M?O=>s===0&&M(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}a(l,"toOneArgVisit");function u(M){return M?O=>s===0&&M(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice()):()=>!0}a(u,"toOneArgVisitWithPath");function d(M){return M?()=>{s>0?s++:M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice())===!1&&(s=1)}:()=>!0}a(d,"toBeginVisit");function f(M){return M?()=>{s>0&&s--,s===0&&M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}a(f,"toEndVisit");let h=d(e.onObjectBegin),m=u(e.onObjectProperty),g=f(e.onObjectEnd),A=d(e.onArrayBegin),y=f(e.onArrayEnd),E=u(e.onLiteralValue),_=l(e.onSeparator),v=c(e.onComment),b=l(e.onError),T=r&&r.disallowComments,w=r&&r.allowTrailingComma;function R(){for(;;){let M=n.scan();switch(n.getTokenError()){case 4:x(14);break;case 5:x(15);break;case 3:x(13);break;case 1:T||x(11);break;case 2:x(12);break;case 6:x(16);break}switch(M){case 12:case 13:T?x(10):v();break;case 16:x(1);break;case 15:case 14:break;default:return M}}}a(R,"scanNext");function x(M,O=[],U=[]){if(b(M),O.length+U.length>0){let q=n.getToken();for(;q!==17;){if(O.indexOf(q)!==-1){R();break}else if(U.indexOf(q)!==-1)break;q=R()}}}a(x,"handleError");function P(M){let O=n.getTokenValue();return M?E(O):(m(O),o.push(O)),R(),!0}a(P,"parseString");function D(){switch(n.getToken()){case 11:let M=n.getTokenValue(),O=Number(M);isNaN(O)&&(x(2),O=0),E(O);break;case 7:E(null);break;case 8:E(!0);break;case 9:E(!1);break;default:return!1}return R(),!0}a(D,"parseLiteral");function N(){return n.getToken()!==10?(x(3,[],[2,5]),!1):(P(!1),n.getToken()===6?(_(":"),R(),j()||x(4,[],[2,5])):x(5,[],[2,5]),o.pop(),!0)}a(N,"parseProperty");function L(){h(),R();let M=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(M||x(4,[],[]),_(","),R(),n.getToken()===2&&w)break}else M&&x(6,[],[]);N()||x(4,[],[2,5]),M=!0}return g(),n.getToken()!==2?x(7,[2],[]):R(),!0}a(L,"parseObject");function B(){A(),R();let M=!0,O=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(O||x(4,[],[]),_(","),R(),n.getToken()===4&&w)break}else O&&x(6,[],[]);M?(o.push(0),M=!1):o[o.length-1]++,j()||x(4,[],[4,5]),O=!0}return y(),M||o.pop(),n.getToken()!==4?x(8,[4],[]):R(),!0}a(B,"parseArray");function j(){switch(n.getToken()){case 3:return B();case 1:return L();case 10:return P(!0);default:return D()}}return a(j,"parseValue"),R(),n.getToken()===17?r.allowEmptyContent?!0:(x(4,[],[]),!1):j()?(n.getToken()!==17&&x(9,[],[]),!0):(x(4,[],[]),!1)}function cWn(t,e){let r=yX(t),n=[],o,s=0,c;do switch(c=r.getPosition(),o=r.scan(),o){case 12:case 13:case 17:s!==c&&n.push(t.substring(s,c)),e!==void 0&&n.push(r.getTokenValue().replace(/[^\r\n]/g,e)),s=r.getPosition();break}while(o!==17);return n.join("")}function lWn(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(t){if(Array.isArray(t))return"array"}else return"null";return"object"}default:return"null"}}var z2e,plr=Se(()=>{"use strict";p();tct();(function(t){t.DEFAULT={allowTrailingComma:!1}})(z2e||(z2e={}));a(sWn,"getLocation");a(aWn,"parse");a(ict,"parseTree");a(Y2e,"findNodeAtLocation");a(dlr,"getNodePath");a(nct,"getNodeValue");a(p6s,"contains");a(flr,"findNodeAtOffset");a(K2e,"visit");a(cWn,"stripComments");a(lWn,"getNodeType")});function uWn(t,e,r,n){let o=e.slice(),c=ict(t,[]),l,u;for(;o.length>0&&(u=o.pop(),l=Y2e(c,o),l===void 0&&r!==void 0);)typeof u=="string"?r={[u]:r}:r=[r];if(l)if(l.type==="object"&&typeof u=="string"&&Array.isArray(l.children)){let d=Y2e(l,[u]);if(d!==void 0)if(r===void 0){if(!d.parent)throw new Error("Malformed AST");let f=l.children.indexOf(d.parent),h,m=d.parent.offset+d.parent.length;if(f>0){let g=l.children[f-1];h=g.offset+g.length}else h=l.offset+1,l.children.length>1&&(m=l.children[1].offset);return EX(t,{offset:h,length:m-h,content:""},n)}else return EX(t,{offset:d.offset,length:d.length,content:JSON.stringify(r)},n);else{if(r===void 0)return[];let f=`${JSON.stringify(u)}: ${JSON.stringify(r)}`,h=n.getInsertionIndex?n.getInsertionIndex(l.children.map(g=>g.children[0].value)):l.children.length,m;if(h>0){let g=l.children[h-1];m={offset:g.offset+g.length,length:0,content:","+f}}else l.children.length===0?m={offset:l.offset+1,length:0,content:f}:m={offset:l.offset+1,length:0,content:f+","};return EX(t,m,n)}}else if(l.type==="array"&&typeof u=="number"&&Array.isArray(l.children)){let d=u;if(d===-1){let f=`${JSON.stringify(r)}`,h;if(l.children.length===0)h={offset:l.offset+1,length:0,content:f};else{let m=l.children[l.children.length-1];h={offset:m.offset+m.length,length:0,content:","+f}}return EX(t,h,n)}else if(r===void 0&&l.children.length>=0){let f=u,h=l.children[f],m;if(l.children.length===1)m={offset:l.offset+1,length:l.length-2,content:""};else if(l.children.length-1===f){let g=l.children[f-1],A=g.offset+g.length,y=l.offset+l.length;m={offset:A,length:y-2-A,content:""}}else m={offset:h.offset,length:l.children[f+1].offset-h.offset,content:""};return EX(t,m,n)}else if(r!==void 0){let f,h=`${JSON.stringify(r)}`;if(!n.isArrayInsertion&&l.children.length>u){let m=l.children[u];f={offset:m.offset,length:m.length,content:h}}else if(l.children.length===0||u===0)f={offset:l.offset+1,length:0,content:l.children.length===0?h:h+","};else{let m=u>l.children.length?l.children.length:u,g=l.children[m-1];f={offset:g.offset+g.length,length:0,content:","+h}}return EX(t,f,n)}else throw new Error(`Can not ${r===void 0?"remove":n.isArrayInsertion?"insert":"modify"} Array index ${d} as length is not sufficient`)}else throw new Error(`Can not add ${typeof u!="number"?"index":"property"} to parent of type ${l.type}`);else{if(r===void 0)throw new Error("Can not delete in empty document");return EX(t,{offset:c?c.offset:0,length:c?c.length:0,content:JSON.stringify(r)},n)}}function EX(t,e,r){if(!r.formattingOptions)return[e];let n=oct(t,e),o=e.offset,s=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;o>0&&!W2e(n,o-1);)o--;for(;s=0;u--){let d=c[u];n=oct(n,d),o=Math.min(o,d.offset),s=Math.max(s,d.offset+d.length),s+=d.content.length-d.length}let l=t.length-(n.length-s)-o;return[{offset:o,length:l,content:n.substring(o,s)}]}function oct(t,e){return t.substring(0,e.offset)+e.content+t.substring(e.offset+e.length)}var dWn=Se(()=>{"use strict";p();ulr();plr();a(uWn,"setProperty");a(EX,"withFormatting");a(oct,"applyEdit")});var fWn={};Ri(fWn,{ParseErrorCode:()=>glr,ScanError:()=>hlr,SyntaxKind:()=>mlr,applyEdits:()=>w6s,createScanner:()=>g6s,findNodeAtLocation:()=>E6s,findNodeAtOffset:()=>_6s,format:()=>I6s,getLocation:()=>A6s,getNodePath:()=>v6s,getNodeValue:()=>C6s,modify:()=>x6s,parse:()=>Alr,parseTree:()=>y6s,printParseErrorCode:()=>T6s,stripComments:()=>S6s,visit:()=>b6s});function T6s(t){switch(t){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return""}function I6s(t,e,r){return rct(t,e,r)}function x6s(t,e,r,n){return uWn(t,e,r,n)}function w6s(t,e){let r=e.slice(0).sort((o,s)=>{let c=o.offset-s.offset;return c===0?o.length-s.length:c}),n=t.length;for(let o=r.length-1;o>=0;o--){let s=r[o];if(s.offset+s.length<=n)t=oct(t,s);else throw new Error("Overlapping edit");n=s.offset}return t}var g6s,hlr,mlr,A6s,Alr,y6s,E6s,_6s,v6s,C6s,b6s,S6s,glr,ylr=Se(()=>{"use strict";p();ulr();dWn();tct();plr();g6s=yX;(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(hlr||(hlr={}));(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(mlr||(mlr={}));A6s=sWn,Alr=aWn,y6s=ict,E6s=Y2e,_6s=flr,v6s=dlr,C6s=nct,b6s=K2e,S6s=cWn;(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(glr||(glr={}));a(T6s,"printParseErrorCode");a(I6s,"format");a(x6s,"modify");a(w6s,"applyEdits")});var RDe=I(fc=>{"use strict";p();Object.defineProperty(fc,"__esModule",{value:!0});fc.regexpCode=fc.getEsmExportName=fc.getProperty=fc.safeStringify=fc.stringify=fc.strConcat=fc.addCodeArg=fc.str=fc._=fc.nil=fc._Code=fc.Name=fc.IDENTIFIER=fc._CodeOrName=void 0;var xDe=class{static{a(this,"_CodeOrName")}};fc._CodeOrName=xDe;fc.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var NX=class extends xDe{static{a(this,"Name")}constructor(e){if(super(),!fc.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};fc.Name=NX;var nR=class extends xDe{static{a(this,"_Code")}constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof NX&&(r[n.str]=(r[n.str]||0)+1),r),{})}};fc._Code=nR;fc.nil=new nR("");function Qzn(t,...e){let r=[t[0]],n=0;for(;n{"use strict";p();Object.defineProperty(Tb,"__esModule",{value:!0});Tb.ValueScope=Tb.ValueScopeName=Tb.Scope=Tb.varKinds=Tb.UsedValueState=void 0;var Sb=RDe(),Aur=class extends Error{static{a(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Lct;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Lct||(Tb.UsedValueState=Lct={}));Tb.varKinds={const:new Sb.Name("const"),let:new Sb.Name("let"),var:new Sb.Name("var")};var Bct=class{static{a(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Sb.Name?e:this.name(e)}name(e){return new Sb.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Tb.Scope=Bct;var Fct=class extends Sb.Name{static{a(this,"ValueScopeName")}constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Sb._)`.${new Sb.Name(r)}[${n}]`}};Tb.ValueScopeName=Fct;var iQs=(0,Sb._)`\n`,yur=class extends Bct{static{a(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?iQs:Sb.nil}}get(){return this._scope}name(e){return new Fct(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:s}=o,c=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[s];if(l){let f=l.get(c);if(f)return f}else l=this._values[s]=new Map;l.set(c,o);let u=this._scope[s]||(this._scope[s]=[]),d=u.length;return u[d]=r.ref,o.setValue(r,{property:s,itemIndex:d}),o}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Sb._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(e,r,n={},o){let s=Sb.nil;for(let c in e){let l=e[c];if(!l)continue;let u=n[c]=n[c]||new Map;l.forEach(d=>{if(u.has(d))return;u.set(d,Lct.Started);let f=r(d);if(f){let h=this.opts.es5?Tb.varKinds.var:Tb.varKinds.const;s=(0,Sb._)`${s}${h} ${d} = ${f};${this.opts._n}`}else if(f=o?.(d))s=(0,Sb._)`${s}${f}${this.opts._n}`;else throw new Aur(d);u.set(d,Lct.Completed)})}return s}};Tb.ValueScope=yur});var As=I(Ps=>{"use strict";p();Object.defineProperty(Ps,"__esModule",{value:!0});Ps.or=Ps.and=Ps.not=Ps.CodeGen=Ps.operators=Ps.varKinds=Ps.ValueScopeName=Ps.ValueScope=Ps.Scope=Ps.Name=Ps.regexpCode=Ps.stringify=Ps.getProperty=Ps.nil=Ps.strConcat=Ps.str=Ps._=void 0;var Da=RDe(),Q2=Eur(),xH=RDe();Object.defineProperty(Ps,"_",{enumerable:!0,get:a(function(){return xH._},"get")});Object.defineProperty(Ps,"str",{enumerable:!0,get:a(function(){return xH.str},"get")});Object.defineProperty(Ps,"strConcat",{enumerable:!0,get:a(function(){return xH.strConcat},"get")});Object.defineProperty(Ps,"nil",{enumerable:!0,get:a(function(){return xH.nil},"get")});Object.defineProperty(Ps,"getProperty",{enumerable:!0,get:a(function(){return xH.getProperty},"get")});Object.defineProperty(Ps,"stringify",{enumerable:!0,get:a(function(){return xH.stringify},"get")});Object.defineProperty(Ps,"regexpCode",{enumerable:!0,get:a(function(){return xH.regexpCode},"get")});Object.defineProperty(Ps,"Name",{enumerable:!0,get:a(function(){return xH.Name},"get")});var jct=Eur();Object.defineProperty(Ps,"Scope",{enumerable:!0,get:a(function(){return jct.Scope},"get")});Object.defineProperty(Ps,"ValueScope",{enumerable:!0,get:a(function(){return jct.ValueScope},"get")});Object.defineProperty(Ps,"ValueScopeName",{enumerable:!0,get:a(function(){return jct.ValueScopeName},"get")});Object.defineProperty(Ps,"varKinds",{enumerable:!0,get:a(function(){return jct.varKinds},"get")});Ps.operators={GT:new Da._Code(">"),GTE:new Da._Code(">="),LT:new Da._Code("<"),LTE:new Da._Code("<="),EQ:new Da._Code("==="),NEQ:new Da._Code("!=="),NOT:new Da._Code("!"),OR:new Da._Code("||"),AND:new Da._Code("&&"),ADD:new Da._Code("+")};var E8=class{static{a(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}},_ur=class extends E8{static{a(this,"Def")}constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Q2.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Ihe(this.rhs,e,r)),this}get names(){return this.rhs instanceof Da._CodeOrName?this.rhs.names:{}}},Uct=class extends E8{static{a(this,"Assign")}constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Da.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Ihe(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Da.Name?{}:{...this.lhs.names};return qct(e,this.rhs)}},vur=class extends Uct{static{a(this,"AssignOp")}constructor(e,r,n,o){super(e,n,o),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Cur=class extends E8{static{a(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},bur=class extends E8{static{a(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Sur=class extends E8{static{a(this,"Throw")}constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Tur=class extends E8{static{a(this,"AnyCode")}constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Ihe(this.code,e,r),this}get names(){return this.code instanceof Da._CodeOrName?this.code.names:{}}},kDe=class extends E8{static{a(this,"ParentNode")}constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(e,r)||(oQs(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>LX(e,r.names),{})}},_8=class extends kDe{static{a(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Iur=class extends kDe{static{a(this,"Root")}},The=class extends _8{static{a(this,"Else")}};The.kind="else";var MX=class t extends _8{static{a(this,"If")}constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new The(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(jzn(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Ihe(this.condition,e,r),this}get names(){let e=super.names;return qct(e,this.condition),this.else&&LX(e,this.else.names),e}};MX.kind="if";var OX=class extends _8{static{a(this,"For")}};OX.kind="for";var xur=class extends OX{static{a(this,"ForLoop")}constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Ihe(this.iteration,e,r),this}get names(){return LX(super.names,this.iteration.names)}},wur=class extends OX{static{a(this,"ForRange")}constructor(e,r,n,o){super(),this.varKind=e,this.name=r,this.from=n,this.to=o}render(e){let r=e.es5?Q2.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return`for(${r} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=qct(super.names,this.from);return qct(e,this.to)}},Qct=class extends OX{static{a(this,"ForIter")}constructor(e,r,n,o){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=o}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Ihe(this.iterable,e,r),this}get names(){return LX(super.names,this.iterable.names)}},PDe=class extends _8{static{a(this,"Func")}constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};PDe.kind="func";var DDe=class extends kDe{static{a(this,"Return")}render(e){return"return "+super.render(e)}};DDe.kind="return";var Rur=class extends _8{static{a(this,"Try")}render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,o;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(o=this.finally)===null||o===void 0||o.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&LX(e,this.catch.names),this.finally&&LX(e,this.finally.names),e}},NDe=class extends _8{static{a(this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};NDe.kind="catch";var MDe=class extends _8{static{a(this,"Finally")}render(e){return"finally"+super.render(e)}};MDe.kind="finally";var kur=class{static{a(this,"CodeGen")}constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?` +`:""},this._extScope=e,this._scope=new Q2.Scope({parent:e}),this._nodes=[new Iur]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,o){let s=this._scope.toName(r);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new _ur(e,s,n)),s}const(e,r,n){return this._def(Q2.varKinds.const,e,r,n)}let(e,r,n){return this._def(Q2.varKinds.let,e,r,n)}var(e,r,n){return this._def(Q2.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Uct(e,r,n))}add(e,r){return this._leafNode(new vur(e,Ps.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Da.nil&&this._leafNode(new Tur(e)),this}object(...e){let r=["{"];for(let[n,o]of e)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,Da.addCodeArg)(r,o));return r.push("}"),new Da._Code(r)}if(e,r,n){if(this._blockNode(new MX(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new MX(e))}else(){return this._elseNode(new The)}endIf(){return this._endBlockNode(MX,The)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new xur(e),r)}forRange(e,r,n,o,s=this.opts.es5?Q2.varKinds.var:Q2.varKinds.let){let c=this._scope.toName(e);return this._for(new wur(s,c,r,n),()=>o(c))}forOf(e,r,n,o=Q2.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let c=r instanceof Da.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Da._)`${c}.length`,l=>{this.var(s,(0,Da._)`${c}[${l}]`),n(s)})}return this._for(new Qct("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?Q2.varKinds.var:Q2.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Da._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Qct("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(OX)}label(e){return this._leafNode(new Cur(e))}break(e){return this._leafNode(new bur(e))}return(e){let r=new DDe;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(DDe)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Rur;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new NDe(s),r(s)}return n&&(this._currNode=o.finally=new MDe,this.code(n)),this._endBlockNode(NDe,MDe)}throw(e){return this._leafNode(new Sur(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Da.nil,n,o){return this._blockNode(new PDe(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(PDe)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof MX))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};Ps.CodeGen=kur;function LX(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}a(LX,"addNames");function qct(t,e){return e instanceof Da._CodeOrName?LX(t,e.names):t}a(qct,"addExprNames");function Ihe(t,e,r){if(t instanceof Da.Name)return n(t);if(!o(t))return t;return new Da._Code(t._items.reduce((s,c)=>(c instanceof Da.Name&&(c=n(c)),c instanceof Da._Code?s.push(...c._items):s.push(c),s),[]));function n(s){let c=r[s.str];return c===void 0||e[s.str]!==1?s:(delete e[s.str],c)}function o(s){return s instanceof Da._Code&&s._items.some(c=>c instanceof Da.Name&&e[c.str]===1&&r[c.str]!==void 0)}}a(Ihe,"optimizeExpr");function oQs(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}a(oQs,"subtractNames");function jzn(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Da._)`!${Pur(t)}`}a(jzn,"not");Ps.not=jzn;var sQs=Hzn(Ps.operators.AND);function aQs(...t){return t.reduce(sQs)}a(aQs,"and");Ps.and=aQs;var cQs=Hzn(Ps.operators.OR);function lQs(...t){return t.reduce(cQs)}a(lQs,"or");Ps.or=lQs;function Hzn(t){return(e,r)=>e===Da.nil?r:r===Da.nil?e:(0,Da._)`${Pur(e)} ${t} ${Pur(r)}`}a(Hzn,"mappend");function Pur(t){return t instanceof Da.Name?t:(0,Da._)`(${t})`}a(Pur,"par")});var Xa=I(Hs=>{"use strict";p();Object.defineProperty(Hs,"__esModule",{value:!0});Hs.checkStrictMode=Hs.getErrorPath=Hs.Type=Hs.useFunc=Hs.setEvaluated=Hs.evaluatedPropsToName=Hs.mergeEvaluated=Hs.eachItem=Hs.unescapeJsonPointer=Hs.escapeJsonPointer=Hs.escapeFragment=Hs.unescapeFragment=Hs.schemaRefOrVal=Hs.schemaHasRulesButRef=Hs.schemaHasRules=Hs.checkUnknownRules=Hs.alwaysValidSchema=Hs.toHash=void 0;var Kl=As(),uQs=RDe();function dQs(t){let e={};for(let r of t)e[r]=!0;return e}a(dQs,"toHash");Hs.toHash=dQs;function fQs(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Vzn(t,e),!Wzn(e,t.self.RULES.all))}a(fQs,"alwaysValidSchema");Hs.alwaysValidSchema=fQs;function Vzn(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let o=n.RULES.keywords;for(let s in e)o[s]||Kzn(t,`unknown keyword: "${s}"`)}a(Vzn,"checkUnknownRules");Hs.checkUnknownRules=Vzn;function Wzn(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}a(Wzn,"schemaHasRules");Hs.schemaHasRules=Wzn;function pQs(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}a(pQs,"schemaHasRulesButRef");Hs.schemaHasRulesButRef=pQs;function hQs({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Kl._)`${r}`}return(0,Kl._)`${t}${e}${(0,Kl.getProperty)(n)}`}a(hQs,"schemaRefOrVal");Hs.schemaRefOrVal=hQs;function mQs(t){return zzn(decodeURIComponent(t))}a(mQs,"unescapeFragment");Hs.unescapeFragment=mQs;function gQs(t){return encodeURIComponent(Nur(t))}a(gQs,"escapeFragment");Hs.escapeFragment=gQs;function Nur(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}a(Nur,"escapeJsonPointer");Hs.escapeJsonPointer=Nur;function zzn(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}a(zzn,"unescapeJsonPointer");Hs.unescapeJsonPointer=zzn;function AQs(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}a(AQs,"eachItem");Hs.eachItem=AQs;function Gzn({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,c,l)=>{let u=c===void 0?s:c instanceof Kl.Name?(s instanceof Kl.Name?t(o,s,c):e(o,s,c),c):s instanceof Kl.Name?(e(o,c,s),s):r(s,c);return l===Kl.Name&&!(u instanceof Kl.Name)?n(o,u):u}}a(Gzn,"makeMergeEvaluated");Hs.mergeEvaluated={props:Gzn({mergeNames:a((t,e,r)=>t.if((0,Kl._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Kl._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Kl._)`${r} || {}`).code((0,Kl._)`Object.assign(${r}, ${e})`))}),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Kl._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Kl._)`${r} || {}`),Mur(t,r,e))}),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:{...t,...e},"mergeValues"),resultToName:Yzn}),items:Gzn({mergeNames:a((t,e,r)=>t.if((0,Kl._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Kl._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Kl._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Kl._)`${r} > ${e} ? ${r} : ${e}`)),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:Math.max(t,e),"mergeValues"),resultToName:a((t,e)=>t.var("items",e),"resultToName")})};function Yzn(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Kl._)`{}`);return e!==void 0&&Mur(t,r,e),r}a(Yzn,"evaluatedPropsToName");Hs.evaluatedPropsToName=Yzn;function Mur(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Kl._)`${e}${(0,Kl.getProperty)(n)}`,!0))}a(Mur,"setEvaluated");Hs.setEvaluated=Mur;var $zn={};function yQs(t,e){return t.scopeValue("func",{ref:e,code:$zn[e.code]||($zn[e.code]=new uQs._Code(e.code))})}a(yQs,"useFunc");Hs.useFunc=yQs;var Dur;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Dur||(Hs.Type=Dur={}));function EQs(t,e,r){if(t instanceof Kl.Name){let n=e===Dur.Num;return r?n?(0,Kl._)`"[" + ${t} + "]"`:(0,Kl._)`"['" + ${t} + "']"`:n?(0,Kl._)`"/" + ${t}`:(0,Kl._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Kl.getProperty)(t).toString():"/"+Nur(t)}a(EQs,"getErrorPath");Hs.getErrorPath=EQs;function Kzn(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}a(Kzn,"checkStrictMode");Hs.checkStrictMode=Kzn});var v8=I(Our=>{"use strict";p();Object.defineProperty(Our,"__esModule",{value:!0});var kE=As(),_Qs={data:new kE.Name("data"),valCxt:new kE.Name("valCxt"),instancePath:new kE.Name("instancePath"),parentData:new kE.Name("parentData"),parentDataProperty:new kE.Name("parentDataProperty"),rootData:new kE.Name("rootData"),dynamicAnchors:new kE.Name("dynamicAnchors"),vErrors:new kE.Name("vErrors"),errors:new kE.Name("errors"),this:new kE.Name("this"),self:new kE.Name("self"),scope:new kE.Name("scope"),json:new kE.Name("json"),jsonPos:new kE.Name("jsonPos"),jsonLen:new kE.Name("jsonLen"),jsonPart:new kE.Name("jsonPart")};Our.default=_Qs});var ODe=I(PE=>{"use strict";p();Object.defineProperty(PE,"__esModule",{value:!0});PE.extendErrors=PE.resetErrorsCount=PE.reportExtraError=PE.reportError=PE.keyword$DataError=PE.keywordError=void 0;var ec=As(),Hct=Xa(),Av=v8();PE.keywordError={message:a(({keyword:t})=>(0,ec.str)`must pass "${t}" keyword validation`,"message")};PE.keyword$DataError={message:a(({keyword:t,schemaType:e})=>e?(0,ec.str)`"${t}" keyword must be ${e} ($data)`:(0,ec.str)`"${t}" keyword is invalid ($data)`,"message")};function vQs(t,e=PE.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:c,allErrors:l}=o,u=Xzn(t,e,r);n??(c||l)?Jzn(s,u):Zzn(o,(0,ec._)`[${u}]`)}a(vQs,"reportError");PE.reportError=vQs;function CQs(t,e=PE.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:c}=n,l=Xzn(t,e,r);Jzn(o,l),s||c||Zzn(n,Av.default.vErrors)}a(CQs,"reportExtraError");PE.reportExtraError=CQs;function bQs(t,e){t.assign(Av.default.errors,e),t.if((0,ec._)`${Av.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ec._)`${Av.default.vErrors}.length`,e),()=>t.assign(Av.default.vErrors,null)))}a(bQs,"resetErrorsCount");PE.resetErrorsCount=bQs;function SQs({gen:t,keyword:e,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let c=t.name("err");t.forRange("i",o,Av.default.errors,l=>{t.const(c,(0,ec._)`${Av.default.vErrors}[${l}]`),t.if((0,ec._)`${c}.instancePath === undefined`,()=>t.assign((0,ec._)`${c}.instancePath`,(0,ec.strConcat)(Av.default.instancePath,s.errorPath))),t.assign((0,ec._)`${c}.schemaPath`,(0,ec.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,ec._)`${c}.schema`,r),t.assign((0,ec._)`${c}.data`,n))})}a(SQs,"extendErrors");PE.extendErrors=SQs;function Jzn(t,e){let r=t.const("err",e);t.if((0,ec._)`${Av.default.vErrors} === null`,()=>t.assign(Av.default.vErrors,(0,ec._)`[${r}]`),(0,ec._)`${Av.default.vErrors}.push(${r})`),t.code((0,ec._)`${Av.default.errors}++`)}a(Jzn,"addError");function Zzn(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,ec._)`new ${t.ValidationError}(${e})`):(r.assign((0,ec._)`${n}.errors`,e),r.return(!1))}a(Zzn,"returnErrors");var BX={keyword:new ec.Name("keyword"),schemaPath:new ec.Name("schemaPath"),params:new ec.Name("params"),propertyName:new ec.Name("propertyName"),message:new ec.Name("message"),schema:new ec.Name("schema"),parentSchema:new ec.Name("parentSchema")};function Xzn(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,ec._)`{}`:TQs(t,e,r)}a(Xzn,"errorObjectCode");function TQs(t,e,r={}){let{gen:n,it:o}=t,s=[IQs(o,r),xQs(t,r)];return wQs(t,e,s),n.object(...s)}a(TQs,"errorObject");function IQs({errorPath:t},{instancePath:e}){let r=e?(0,ec.str)`${t}${(0,Hct.getErrorPath)(e,Hct.Type.Str)}`:t;return[Av.default.instancePath,(0,ec.strConcat)(Av.default.instancePath,r)]}a(IQs,"errorInstancePath");function xQs({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,ec.str)`${e}/${t}`;return r&&(o=(0,ec.str)`${o}${(0,Hct.getErrorPath)(r,Hct.Type.Str)}`),[BX.schemaPath,o]}a(xQs,"errorSchemaPath");function wQs(t,{params:e,message:r},n){let{keyword:o,data:s,schemaValue:c,it:l}=t,{opts:u,propertyName:d,topSchemaRef:f,schemaPath:h}=l;n.push([BX.keyword,o],[BX.params,typeof e=="function"?e(t):e||(0,ec._)`{}`]),u.messages&&n.push([BX.message,typeof r=="function"?r(t):r]),u.verbose&&n.push([BX.schema,c],[BX.parentSchema,(0,ec._)`${f}${h}`],[Av.default.data,s]),d&&n.push([BX.propertyName,d])}a(wQs,"extraErrorProps")});var tYn=I(xhe=>{"use strict";p();Object.defineProperty(xhe,"__esModule",{value:!0});xhe.boolOrEmptySchema=xhe.topBoolOrEmptySchema=void 0;var RQs=ODe(),kQs=As(),PQs=v8(),DQs={message:"boolean schema is false"};function NQs(t){let{gen:e,schema:r,validateName:n}=t;r===!1?eYn(t,!1):typeof r=="object"&&r.$async===!0?e.return(PQs.default.data):(e.assign((0,kQs._)`${n}.errors`,null),e.return(!0))}a(NQs,"topBoolOrEmptySchema");xhe.topBoolOrEmptySchema=NQs;function MQs(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),eYn(t)):r.var(e,!0)}a(MQs,"boolOrEmptySchema");xhe.boolOrEmptySchema=MQs;function eYn(t,e){let{gen:r,data:n}=t,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,RQs.reportError)(o,DQs,void 0,e)}a(eYn,"falseSchemaError")});var Lur=I(whe=>{"use strict";p();Object.defineProperty(whe,"__esModule",{value:!0});whe.getRules=whe.isJSONType=void 0;var OQs=["string","number","integer","boolean","null","object","array"],LQs=new Set(OQs);function BQs(t){return typeof t=="string"&&LQs.has(t)}a(BQs,"isJSONType");whe.isJSONType=BQs;function FQs(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}a(FQs,"getRules");whe.getRules=FQs});var Bur=I(wH=>{"use strict";p();Object.defineProperty(wH,"__esModule",{value:!0});wH.shouldUseRule=wH.shouldUseGroup=wH.schemaHasRulesForType=void 0;function UQs({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&rYn(t,n)}a(UQs,"schemaHasRulesForType");wH.schemaHasRulesForType=UQs;function rYn(t,e){return e.rules.some(r=>nYn(t,r))}a(rYn,"shouldUseGroup");wH.shouldUseGroup=rYn;function nYn(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}a(nYn,"shouldUseRule");wH.shouldUseRule=nYn});var LDe=I(DE=>{"use strict";p();Object.defineProperty(DE,"__esModule",{value:!0});DE.reportTypeError=DE.checkDataTypes=DE.checkDataType=DE.coerceAndCheckDataType=DE.getJSONTypes=DE.getSchemaTypes=DE.DataType=void 0;var QQs=Lur(),qQs=Bur(),jQs=ODe(),as=As(),iYn=Xa(),Rhe;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Rhe||(DE.DataType=Rhe={}));function HQs(t){let e=oYn(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}a(HQs,"getSchemaTypes");DE.getSchemaTypes=HQs;function oYn(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(QQs.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}a(oYn,"getJSONTypes");DE.getJSONTypes=oYn;function GQs(t,e){let{gen:r,data:n,opts:o}=t,s=$Qs(e,o.coerceTypes),c=e.length>0&&!(s.length===0&&e.length===1&&(0,qQs.schemaHasRulesForType)(t,e[0]));if(c){let l=Uur(e,n,o.strictNumbers,Rhe.Wrong);r.if(l,()=>{s.length?VQs(t,e,s):Qur(t)})}return c}a(GQs,"coerceAndCheckDataType");DE.coerceAndCheckDataType=GQs;var sYn=new Set(["string","number","integer","boolean","null"]);function $Qs(t,e){return e?t.filter(r=>sYn.has(r)||e==="array"&&r==="array"):[]}a($Qs,"coerceToTypes");function VQs(t,e,r){let{gen:n,data:o,opts:s}=t,c=n.let("dataType",(0,as._)`typeof ${o}`),l=n.let("coerced",(0,as._)`undefined`);s.coerceTypes==="array"&&n.if((0,as._)`${c} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,as._)`${o}[0]`).assign(c,(0,as._)`typeof ${o}`).if(Uur(e,o,s.strictNumbers),()=>n.assign(l,o))),n.if((0,as._)`${l} !== undefined`);for(let d of r)(sYn.has(d)||d==="array"&&s.coerceTypes==="array")&&u(d);n.else(),Qur(t),n.endIf(),n.if((0,as._)`${l} !== undefined`,()=>{n.assign(o,l),WQs(t,l)});function u(d){switch(d){case"string":n.elseIf((0,as._)`${c} == "number" || ${c} == "boolean"`).assign(l,(0,as._)`"" + ${o}`).elseIf((0,as._)`${o} === null`).assign(l,(0,as._)`""`);return;case"number":n.elseIf((0,as._)`${c} == "boolean" || ${o} === null + || (${c} == "string" && ${o} && ${o} == +${o})`).assign(l,(0,as._)`+${o}`);return;case"integer":n.elseIf((0,as._)`${c} === "boolean" || ${o} === null + || (${c} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(l,(0,as._)`+${o}`);return;case"boolean":n.elseIf((0,as._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(l,!1).elseIf((0,as._)`${o} === "true" || ${o} === 1`).assign(l,!0);return;case"null":n.elseIf((0,as._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(l,null);return;case"array":n.elseIf((0,as._)`${c} === "string" || ${c} === "number" + || ${c} === "boolean" || ${o} === null`).assign(l,(0,as._)`[${o}]`)}}a(u,"coerceSpecificType")}a(VQs,"coerceData");function WQs({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,as._)`${e} !== undefined`,()=>t.assign((0,as._)`${e}[${r}]`,n))}a(WQs,"assignParentData");function Fur(t,e,r,n=Rhe.Correct){let o=n===Rhe.Correct?as.operators.EQ:as.operators.NEQ,s;switch(t){case"null":return(0,as._)`${e} ${o} null`;case"array":s=(0,as._)`Array.isArray(${e})`;break;case"object":s=(0,as._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=c((0,as._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=c();break;default:return(0,as._)`typeof ${e} ${o} ${t}`}return n===Rhe.Correct?s:(0,as.not)(s);function c(l=as.nil){return(0,as.and)((0,as._)`typeof ${e} == "number"`,l,r?(0,as._)`isFinite(${e})`:as.nil)}}a(Fur,"checkDataType");DE.checkDataType=Fur;function Uur(t,e,r,n){if(t.length===1)return Fur(t[0],e,r,n);let o,s=(0,iYn.toHash)(t);if(s.array&&s.object){let c=(0,as._)`typeof ${e} != "object"`;o=s.null?c:(0,as._)`!${e} || ${c}`,delete s.null,delete s.array,delete s.object}else o=as.nil;s.number&&delete s.integer;for(let c in s)o=(0,as.and)(o,Fur(c,e,r,n));return o}a(Uur,"checkDataTypes");DE.checkDataTypes=Uur;var zQs={message:a(({schema:t})=>`must be ${t}`,"message"),params:a(({schema:t,schemaValue:e})=>typeof t=="string"?(0,as._)`{type: ${t}}`:(0,as._)`{type: ${e}}`,"params")};function Qur(t){let e=YQs(t);(0,jQs.reportError)(e,zQs)}a(Qur,"reportTypeError");DE.reportTypeError=Qur;function YQs(t){let{gen:e,data:r,schema:n}=t,o=(0,iYn.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}a(YQs,"getTypeErrorContext")});var cYn=I(Gct=>{"use strict";p();Object.defineProperty(Gct,"__esModule",{value:!0});Gct.assignDefaults=void 0;var khe=As(),KQs=Xa();function JQs(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)aYn(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>aYn(t,s,o.default))}a(JQs,"assignDefaults");Gct.assignDefaults=JQs;function aYn(t,e,r){let{gen:n,compositeRule:o,data:s,opts:c}=t;if(r===void 0)return;let l=(0,khe._)`${s}${(0,khe.getProperty)(e)}`;if(o){(0,KQs.checkStrictMode)(t,`default is ignored for: ${l}`);return}let u=(0,khe._)`${l} === undefined`;c.useDefaults==="empty"&&(u=(0,khe._)`${u} || ${l} === null || ${l} === ""`),n.if(u,(0,khe._)`${l} = ${(0,khe.stringify)(r)}`)}a(aYn,"assignDefault")});var iR=I(Rl=>{"use strict";p();Object.defineProperty(Rl,"__esModule",{value:!0});Rl.validateUnion=Rl.validateArray=Rl.usePattern=Rl.callValidateCode=Rl.schemaProperties=Rl.allSchemaProperties=Rl.noPropertyInData=Rl.propertyInData=Rl.isOwnProperty=Rl.hasPropFunc=Rl.reportMissingProp=Rl.checkMissingProp=Rl.checkReportMissingProp=void 0;var gd=As(),qur=Xa(),RH=v8(),ZQs=Xa();function XQs(t,e){let{gen:r,data:n,it:o}=t;r.if(Hur(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,gd._)`${e}`},!0),t.error()})}a(XQs,"checkReportMissingProp");Rl.checkReportMissingProp=XQs;function eqs({gen:t,data:e,it:{opts:r}},n,o){return(0,gd.or)(...n.map(s=>(0,gd.and)(Hur(t,e,s,r.ownProperties),(0,gd._)`${o} = ${s}`)))}a(eqs,"checkMissingProp");Rl.checkMissingProp=eqs;function tqs(t,e){t.setParams({missingProperty:e},!0),t.error()}a(tqs,"reportMissingProp");Rl.reportMissingProp=tqs;function lYn(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,gd._)`Object.prototype.hasOwnProperty`})}a(lYn,"hasPropFunc");Rl.hasPropFunc=lYn;function jur(t,e,r){return(0,gd._)`${lYn(t)}.call(${e}, ${r})`}a(jur,"isOwnProperty");Rl.isOwnProperty=jur;function rqs(t,e,r,n){let o=(0,gd._)`${e}${(0,gd.getProperty)(r)} !== undefined`;return n?(0,gd._)`${o} && ${jur(t,e,r)}`:o}a(rqs,"propertyInData");Rl.propertyInData=rqs;function Hur(t,e,r,n){let o=(0,gd._)`${e}${(0,gd.getProperty)(r)} === undefined`;return n?(0,gd.or)(o,(0,gd.not)(jur(t,e,r))):o}a(Hur,"noPropertyInData");Rl.noPropertyInData=Hur;function uYn(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}a(uYn,"allSchemaProperties");Rl.allSchemaProperties=uYn;function nqs(t,e){return uYn(e).filter(r=>!(0,qur.alwaysValidSchema)(t,e[r]))}a(nqs,"schemaProperties");Rl.schemaProperties=nqs;function iqs({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,gd._)`${t}, ${e}, ${n}${o}`:e,h=[[RH.default.instancePath,(0,gd.strConcat)(RH.default.instancePath,s)],[RH.default.parentData,c.parentData],[RH.default.parentDataProperty,c.parentDataProperty],[RH.default.rootData,RH.default.rootData]];c.opts.dynamicRef&&h.push([RH.default.dynamicAnchors,RH.default.dynamicAnchors]);let m=(0,gd._)`${f}, ${r.object(...h)}`;return u!==gd.nil?(0,gd._)`${l}.call(${u}, ${m})`:(0,gd._)`${l}(${m})`}a(iqs,"callValidateCode");Rl.callValidateCode=iqs;var oqs=(0,gd._)`new RegExp`;function sqs({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:o}=e.code,s=o(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,gd._)`${o.code==="new RegExp"?oqs:(0,ZQs.useFunc)(t,o)}(${r}, ${n})`})}a(sqs,"usePattern");Rl.usePattern=sqs;function aqs(t){let{gen:e,data:r,keyword:n,it:o}=t,s=e.name("valid");if(o.allErrors){let l=e.let("valid",!0);return c(()=>e.assign(l,!1)),l}return e.var(s,!0),c(()=>e.break()),s;function c(l){let u=e.const("len",(0,gd._)`${r}.length`);e.forRange("i",0,u,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:qur.Type.Num},s),e.if((0,gd.not)(s),l)})}a(c,"validateItems")}a(aqs,"validateArray");Rl.validateArray=aqs;function cqs(t){let{gen:e,schema:r,keyword:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,qur.alwaysValidSchema)(o,u))&&!o.opts.unevaluated)return;let c=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((u,d)=>{let f=t.subschema({keyword:n,schemaProp:d,compositeRule:!0},l);e.assign(c,(0,gd._)`${c} || ${l}`),t.mergeValidEvaluated(f,l)||e.if((0,gd.not)(c))})),t.result(c,()=>t.reset(),()=>t.error(!0))}a(cqs,"validateUnion");Rl.validateUnion=cqs});var pYn=I(K5=>{"use strict";p();Object.defineProperty(K5,"__esModule",{value:!0});K5.validateKeywordUsage=K5.validSchemaType=K5.funcKeywordCode=K5.macroKeywordCode=void 0;var yv=As(),FX=v8(),lqs=iR(),uqs=ODe();function dqs(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:c}=t,l=e.macro.call(c.self,o,s,c),u=fYn(r,n,l);c.opts.validateSchema!==!1&&c.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:yv.nil,errSchemaPath:`${c.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}a(dqs,"macroKeywordCode");K5.macroKeywordCode=dqs;function fqs(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:c,$data:l,it:u}=t;hqs(u,e);let d=!l&&e.compile?e.compile.call(u.self,s,c,u):e.validate,f=fYn(n,o,d),h=n.let("valid");t.block$data(h,m),t.ok((r=e.valid)!==null&&r!==void 0?r:h);function m(){if(e.errors===!1)y(),e.modifying&&dYn(t),E(()=>t.error());else{let _=e.async?g():A();e.modifying&&dYn(t),E(()=>pqs(t,_))}}a(m,"validateKeyword");function g(){let _=n.let("ruleErrs",null);return n.try(()=>y((0,yv._)`await `),v=>n.assign(h,!1).if((0,yv._)`${v} instanceof ${u.ValidationError}`,()=>n.assign(_,(0,yv._)`${v}.errors`),()=>n.throw(v))),_}a(g,"validateAsync");function A(){let _=(0,yv._)`${f}.errors`;return n.assign(_,null),y(yv.nil),_}a(A,"validateSync");function y(_=e.async?(0,yv._)`await `:yv.nil){let v=u.opts.passContext?FX.default.this:FX.default.self,b=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,yv._)`${_}${(0,lqs.callValidateCode)(t,f,v,b)}`,e.modifying)}a(y,"assignValid");function E(_){var v;n.if((0,yv.not)((v=e.valid)!==null&&v!==void 0?v:h),_)}a(E,"reportErrs")}a(fqs,"funcKeywordCode");K5.funcKeywordCode=fqs;function dYn(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,yv._)`${n.parentData}[${n.parentDataProperty}]`))}a(dYn,"modifyData");function pqs(t,e){let{gen:r}=t;r.if((0,yv._)`Array.isArray(${e})`,()=>{r.assign(FX.default.vErrors,(0,yv._)`${FX.default.vErrors} === null ? ${e} : ${FX.default.vErrors}.concat(${e})`).assign(FX.default.errors,(0,yv._)`${FX.default.vErrors}.length`),(0,uqs.extendErrors)(t)},()=>t.error())}a(pqs,"addErrs");function hqs({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}a(hqs,"checkAsyncKeyword");function fYn(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,yv.stringify)(r)})}a(fYn,"useKeyword");function mqs(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}a(mqs,"validSchemaType");K5.validSchemaType=mqs;function gqs({schema:t,opts:e,self:r,errSchemaPath:n},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");let c=o.dependencies;if(c?.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${s}: ${c.join(",")}`);if(o.validateSchema&&!o.validateSchema(t[s])){let u=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}a(gqs,"validateKeywordUsage");K5.validateKeywordUsage=gqs});var mYn=I(kH=>{"use strict";p();Object.defineProperty(kH,"__esModule",{value:!0});kH.extendSubschemaMode=kH.extendSubschemaData=kH.getSubschema=void 0;var J5=As(),hYn=Xa();function Aqs(t,{keyword:e,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let l=t.schema[e];return r===void 0?{schema:l,schemaPath:(0,J5._)`${t.schemaPath}${(0,J5.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,J5._)`${t.schemaPath}${(0,J5.getProperty)(e)}${(0,J5.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,hYn.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||s===void 0||c===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}a(Aqs,"getSubschema");kH.getSubschema=Aqs;function yqs(t,e,{dataProp:r,dataPropType:n,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(r!==void 0){let{errorPath:d,dataPathArr:f,opts:h}=e,m=l.let("data",(0,J5._)`${e.data}${(0,J5.getProperty)(r)}`,!0);u(m),t.errorPath=(0,J5.str)`${d}${(0,hYn.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,J5._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(o!==void 0){let d=o instanceof J5.Name?o:l.let("data",o,!0);u(d),c!==void 0&&(t.propertyName=c)}s&&(t.dataTypes=s);function u(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}a(u,"dataContextProps")}a(yqs,"extendSubschemaData");kH.extendSubschemaData=yqs;function Eqs(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:s}){n!==void 0&&(t.compositeRule=n),o!==void 0&&(t.createErrors=o),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}a(Eqs,"extendSubschemaMode");kH.extendSubschemaMode=Eqs});var Gur=I((cIf,gYn)=>{"use strict";p();gYn.exports=a(function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!t(e[o],r[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var c=s[o];if(!t(e[c],r[c]))return!1}return!0}return e!==e&&r!==r},"equal")});var yYn=I((dIf,AYn)=>{"use strict";p();var PH=AYn.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};$ct(e,n,o,t,"",t)};PH.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};PH.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};PH.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};PH.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function $ct(t,e,r,n,o,s,c,l,u,d){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,o,s,c,l,u,d);for(var f in n){var h=n[f];if(Array.isArray(h)){if(f in PH.arrayKeywords)for(var m=0;m{"use strict";p();Object.defineProperty(Ib,"__esModule",{value:!0});Ib.getSchemaRefs=Ib.resolveUrl=Ib.normalizeId=Ib._getFullPath=Ib.getFullPath=Ib.inlineRef=void 0;var vqs=Xa(),Cqs=Gur(),bqs=yYn(),Sqs=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Tqs(t,e=!0){return typeof t=="boolean"?!0:e===!0?!$ur(t):e?EYn(t)<=e:!1}a(Tqs,"inlineRef");Ib.inlineRef=Tqs;var Iqs=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function $ur(t){for(let e in t){if(Iqs.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some($ur)||typeof r=="object"&&$ur(r))return!0}return!1}a($ur,"hasRef");function EYn(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!Sqs.has(r)&&(typeof t[r]=="object"&&(0,vqs.eachItem)(t[r],n=>e+=EYn(n)),e===1/0))return 1/0}return e}a(EYn,"countKeys");function _Yn(t,e="",r){r!==!1&&(e=Phe(e));let n=t.parse(e);return vYn(t,n)}a(_Yn,"getFullPath");Ib.getFullPath=_Yn;function vYn(t,e){return t.serialize(e).split("#")[0]+"#"}a(vYn,"_getFullPath");Ib._getFullPath=vYn;var xqs=/#\/?$/;function Phe(t){return t?t.replace(xqs,""):""}a(Phe,"normalizeId");Ib.normalizeId=Phe;function wqs(t,e,r){return r=Phe(r),t.resolve(e,r)}a(wqs,"resolveUrl");Ib.resolveUrl=wqs;var Rqs=/^[a-z_][-a-z0-9._]*$/i;function kqs(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Phe(t[r]||e),s={"":o},c=_Yn(n,o,!1),l={},u=new Set;return bqs(t,{allKeys:!0},(h,m,g,A)=>{if(A===void 0)return;let y=c+m,E=s[A];typeof h[r]=="string"&&(E=_.call(this,h[r])),v.call(this,h.$anchor),v.call(this,h.$dynamicAnchor),s[m]=E;function _(b){let T=this.opts.uriResolver.resolve;if(b=Phe(E?T(E,b):b),u.has(b))throw f(b);u.add(b);let w=this.refs[b];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?d(h,w.schema,b):b!==Phe(y)&&(b[0]==="#"?(d(h,l[b],b),l[b]=h):this.refs[b]=y),b}a(_,"addRef");function v(b){if(typeof b=="string"){if(!Rqs.test(b))throw new Error(`invalid anchor "${b}"`);_.call(this,`#${b}`)}}a(v,"addAnchor")}),l;function d(h,m,g){if(m!==void 0&&!Cqs(h,m))throw f(g)}a(d,"checkAmbiguosRef");function f(h){return new Error(`reference "${h}" resolves to more than one schema`)}a(f,"ambiguos")}a(kqs,"getSchemaRefs");Ib.getSchemaRefs=kqs});var QDe=I(DH=>{"use strict";p();Object.defineProperty(DH,"__esModule",{value:!0});DH.getData=DH.KeywordCxt=DH.validateFunctionCode=void 0;var IYn=tYn(),CYn=LDe(),Wur=Bur(),Vct=LDe(),Pqs=cYn(),UDe=pYn(),Vur=mYn(),ii=As(),uo=v8(),Dqs=BDe(),C8=Xa(),FDe=ODe();function Nqs(t){if(RYn(t)&&(kYn(t),wYn(t))){Lqs(t);return}xYn(t,()=>(0,IYn.topBoolOrEmptySchema)(t))}a(Nqs,"validateFunctionCode");DH.validateFunctionCode=Nqs;function xYn({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,ii._)`${uo.default.data}, ${uo.default.valCxt}`,n.$async,()=>{t.code((0,ii._)`"use strict"; ${bYn(r,o)}`),Oqs(t,o),t.code(s)}):t.func(e,(0,ii._)`${uo.default.data}, ${Mqs(o)}`,n.$async,()=>t.code(bYn(r,o)).code(s))}a(xYn,"validateFunction");function Mqs(t){return(0,ii._)`{${uo.default.instancePath}="", ${uo.default.parentData}, ${uo.default.parentDataProperty}, ${uo.default.rootData}=${uo.default.data}${t.dynamicRef?(0,ii._)`, ${uo.default.dynamicAnchors}={}`:ii.nil}}={}`}a(Mqs,"destructureValCxt");function Oqs(t,e){t.if(uo.default.valCxt,()=>{t.var(uo.default.instancePath,(0,ii._)`${uo.default.valCxt}.${uo.default.instancePath}`),t.var(uo.default.parentData,(0,ii._)`${uo.default.valCxt}.${uo.default.parentData}`),t.var(uo.default.parentDataProperty,(0,ii._)`${uo.default.valCxt}.${uo.default.parentDataProperty}`),t.var(uo.default.rootData,(0,ii._)`${uo.default.valCxt}.${uo.default.rootData}`),e.dynamicRef&&t.var(uo.default.dynamicAnchors,(0,ii._)`${uo.default.valCxt}.${uo.default.dynamicAnchors}`)},()=>{t.var(uo.default.instancePath,(0,ii._)`""`),t.var(uo.default.parentData,(0,ii._)`undefined`),t.var(uo.default.parentDataProperty,(0,ii._)`undefined`),t.var(uo.default.rootData,uo.default.data),e.dynamicRef&&t.var(uo.default.dynamicAnchors,(0,ii._)`{}`)})}a(Oqs,"destructureValCxtES5");function Lqs(t){let{schema:e,opts:r,gen:n}=t;xYn(t,()=>{r.$comment&&e.$comment&&DYn(t),qqs(t),n.let(uo.default.vErrors,null),n.let(uo.default.errors,0),r.unevaluated&&Bqs(t),PYn(t),Gqs(t)})}a(Lqs,"topSchemaObjCode");function Bqs(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ii._)`${r}.evaluated`),e.if((0,ii._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ii._)`${t.evaluated}.props`,(0,ii._)`undefined`)),e.if((0,ii._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ii._)`${t.evaluated}.items`,(0,ii._)`undefined`))}a(Bqs,"resetEvaluated");function bYn(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ii._)`/*# sourceURL=${r} */`:ii.nil}a(bYn,"funcSourceUrl");function Fqs(t,e){if(RYn(t)&&(kYn(t),wYn(t))){Uqs(t,e);return}(0,IYn.boolOrEmptySchema)(t,e)}a(Fqs,"subschemaCode");function wYn({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}a(wYn,"schemaCxtHasRules");function RYn(t){return typeof t.schema!="boolean"}a(RYn,"isSchemaObj");function Uqs(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&DYn(t),jqs(t),Hqs(t);let s=n.const("_errs",uo.default.errors);PYn(t,s),n.var(e,(0,ii._)`${s} === ${uo.default.errors}`)}a(Uqs,"subSchemaObjCode");function kYn(t){(0,C8.checkUnknownRules)(t),Qqs(t)}a(kYn,"checkKeywords");function PYn(t,e){if(t.opts.jtd)return SYn(t,[],!1,e);let r=(0,CYn.getSchemaTypes)(t.schema),n=(0,CYn.coerceAndCheckDataType)(t,r);SYn(t,r,!n,e)}a(PYn,"typeAndKeywords");function Qqs(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,C8.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}a(Qqs,"checkRefsAndKeywords");function qqs(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,C8.checkStrictMode)(t,"default is ignored in the schema root")}a(qqs,"checkNoDefault");function jqs(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Dqs.resolveUrl)(t.opts.uriResolver,t.baseId,e))}a(jqs,"updateContext");function Hqs(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}a(Hqs,"checkAsyncSchema");function DYn({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,ii._)`${uo.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let c=(0,ii.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,ii._)`${uo.default.self}.opts.$comment(${s}, ${c}, ${l}.schema)`)}}a(DYn,"commentKeyword");function Gqs(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,ii._)`${uo.default.errors} === 0`,()=>e.return(uo.default.data),()=>e.throw((0,ii._)`new ${o}(${uo.default.vErrors})`)):(e.assign((0,ii._)`${n}.errors`,uo.default.vErrors),s.unevaluated&&$qs(t),e.return((0,ii._)`${uo.default.errors} === 0`))}a(Gqs,"returnResults");function $qs({gen:t,evaluated:e,props:r,items:n}){r instanceof ii.Name&&t.assign((0,ii._)`${e}.props`,r),n instanceof ii.Name&&t.assign((0,ii._)`${e}.items`,n)}a($qs,"assignEvaluated");function SYn(t,e,r,n){let{gen:o,schema:s,data:c,allErrors:l,opts:u,self:d}=t,{RULES:f}=d;if(s.$ref&&(u.ignoreKeywordsWithRef||!(0,C8.schemaHasRulesButRef)(s,f))){o.block(()=>MYn(t,"$ref",f.all.$ref.definition));return}u.jtd||Vqs(t,e),o.block(()=>{for(let m of f.rules)h(m);h(f.post)});function h(m){(0,Wur.shouldUseGroup)(s,m)&&(m.type?(o.if((0,Vct.checkDataType)(m.type,c,u.strictNumbers)),TYn(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,Vct.reportTypeError)(t)),o.endIf()):TYn(t,m),l||o.if((0,ii._)`${uo.default.errors} === ${n||0}`))}a(h,"groupKeywords")}a(SYn,"schemaKeywords");function TYn(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,Pqs.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Wur.shouldUseRule)(n,s)&&MYn(t,s.keyword,s.definition,e.type)})}a(TYn,"iterateKeywords");function Vqs(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Wqs(t,e),t.opts.allowUnionTypes||zqs(t,e),Yqs(t,t.dataTypes))}a(Vqs,"checkStrictTypes");function Wqs(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{NYn(t.dataTypes,r)||zur(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),Jqs(t,e)}}a(Wqs,"checkContextTypes");function zqs(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&zur(t,"use allowUnionTypes to allow union type keyword")}a(zqs,"checkMultipleTypes");function Yqs(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Wur.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(c=>Kqs(e,c))&&zur(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}a(Yqs,"checkKeywordTypes");function Kqs(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}a(Kqs,"hasApplicableType");function NYn(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}a(NYn,"includesType");function Jqs(t,e){let r=[];for(let n of t.dataTypes)NYn(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}a(Jqs,"narrowSchemaTypes");function zur(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,C8.checkStrictMode)(t,e,t.opts.strictTypes)}a(zur,"strictTypesError");var Wct=class{static{a(this,"KeywordCxt")}constructor(e,r,n){if((0,UDe.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,C8.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",OYn(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,UDe.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",uo.default.errors))}result(e,r,n){this.failResult((0,ii.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,ii.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,ii._)`${r} !== undefined && (${(0,ii.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?FDe.reportExtraError:FDe.reportError)(this,this.def.error,r)}$dataError(){(0,FDe.reportError)(this,this.def.$dataError||FDe.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,FDe.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=ii.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=ii.nil,r=ii.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:c}=this;n.if((0,ii.or)((0,ii._)`${o} === undefined`,r)),e!==ii.nil&&n.assign(e,!0),(s.length||c.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==ii.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,ii.or)(c(),l());function c(){if(n.length){if(!(r instanceof ii.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,ii._)`${(0,Vct.checkDataTypes)(u,r,s.opts.strictNumbers,Vct.DataType.Wrong)}`}return ii.nil}function l(){if(o.validateSchema){let u=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,ii._)`!${u}(${r})`}return ii.nil}}subschema(e,r){let n=(0,Vur.getSubschema)(this.it,e);(0,Vur.extendSubschemaData)(n,this.it,e),(0,Vur.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return Fqs(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=C8.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=C8.mergeEvaluated.items(o,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(e,ii.Name)),!0}};DH.KeywordCxt=Wct;function MYn(t,e,r,n){let o=new Wct(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,UDe.funcKeywordCode)(o,r):"macro"in r?(0,UDe.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,UDe.funcKeywordCode)(o,r)}a(MYn,"keywordCode");var Zqs=/^\/(?:[^~]|~0|~1)*$/,Xqs=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function OYn(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return uo.default.rootData;if(t[0]==="/"){if(!Zqs.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=uo.default.rootData}else{let d=Xqs.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let f=+d[1];if(o=d[2],o==="#"){if(f>=e)throw new Error(u("property/index",f));return n[e-f]}if(f>e)throw new Error(u("data",f));if(s=r[e-f],!o)return s}let c=s,l=o.split("/");for(let d of l)d&&(s=(0,ii._)`${s}${(0,ii.getProperty)((0,C8.unescapeJsonPointer)(d))}`,c=(0,ii._)`${c} && ${s}`);return c;function u(d,f){return`Cannot access ${d} ${f} levels up, current level is ${e}`}}a(OYn,"getData");DH.getData=OYn});var zct=I(Kur=>{"use strict";p();Object.defineProperty(Kur,"__esModule",{value:!0});var Yur=class extends Error{static{a(this,"ValidationError")}constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Kur.default=Yur});var qDe=I(Xur=>{"use strict";p();Object.defineProperty(Xur,"__esModule",{value:!0});var Jur=BDe(),Zur=class extends Error{static{a(this,"MissingRefError")}constructor(e,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Jur.resolveUrl)(e,r,n),this.missingSchema=(0,Jur.normalizeId)((0,Jur.getFullPath)(e,this.missingRef))}};Xur.default=Zur});var Kct=I(oR=>{"use strict";p();Object.defineProperty(oR,"__esModule",{value:!0});oR.resolveSchema=oR.getCompilingSchema=oR.resolveRef=oR.compileSchema=oR.SchemaEnv=void 0;var q2=As(),ejs=zct(),UX=v8(),j2=BDe(),LYn=Xa(),tjs=QDe(),Dhe=class{static{a(this,"SchemaEnv")}constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,j2.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};oR.SchemaEnv=Dhe;function tdr(t){let e=BYn.call(this,t);if(e)return e;let r=(0,j2.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,c=new q2.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),l;t.$async&&(l=c.scopeValue("Error",{ref:ejs.default,code:(0,q2._)`require("ajv/dist/runtime/validation_error").default`}));let u=c.scopeName("validate");t.validateName=u;let d={gen:c,allErrors:this.opts.allErrors,data:UX.default.data,parentData:UX.default.parentData,parentDataProperty:UX.default.parentDataProperty,dataNames:[UX.default.data],dataPathArr:[q2.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,q2.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:q2.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,q2._)`""`,opts:this.opts,self:this},f;try{this._compilations.add(t),(0,tjs.validateFunctionCode)(d),c.optimize(this.opts.code.optimize);let h=c.toString();f=`${c.scopeRefs(UX.default.scope)}return ${h}`,this.opts.code.process&&(f=this.opts.code.process(f,t));let g=new Function(`${UX.default.self}`,`${UX.default.scope}`,f)(this,this.scope.get());if(this.scope.value(u,{ref:g}),g.errors=null,g.schema=t.schema,g.schemaEnv=t,t.$async&&(g.$async=!0),this.opts.code.source===!0&&(g.source={validateName:u,validateCode:h,scopeValues:c._values}),this.opts.unevaluated){let{props:A,items:y}=d;g.evaluated={props:A instanceof q2.Name?void 0:A,items:y instanceof q2.Name?void 0:y,dynamicProps:A instanceof q2.Name,dynamicItems:y instanceof q2.Name},g.source&&(g.source.evaluated=(0,q2.stringify)(g.evaluated))}return t.validate=g,t}catch(h){throw delete t.validate,delete t.validateName,f&&this.logger.error("Error compiling schema, function code:",f),h}finally{this._compilations.delete(t)}}a(tdr,"compileSchema");oR.compileSchema=tdr;function rjs(t,e,r){var n;r=(0,j2.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=ojs.call(this,t,r);if(s===void 0){let c=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;c&&(s=new Dhe({schema:c,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=njs.call(this,s)}a(rjs,"resolveRef");oR.resolveRef=rjs;function njs(t){return(0,j2.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:tdr.call(this,t)}a(njs,"inlineOrCompile");function BYn(t){for(let e of this._compilations)if(ijs(e,t))return e}a(BYn,"getCompilingSchema");oR.getCompilingSchema=BYn;function ijs(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}a(ijs,"sameSchemaEnv");function ojs(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Yct.call(this,t,e)}a(ojs,"resolve");function Yct(t,e){let r=this.opts.uriResolver.parse(e),n=(0,j2._getFullPath)(this.opts.uriResolver,r),o=(0,j2.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return edr.call(this,r,t);let s=(0,j2.normalizeId)(n),c=this.refs[s]||this.schemas[s];if(typeof c=="string"){let l=Yct.call(this,t,c);return typeof l?.schema!="object"?void 0:edr.call(this,r,l)}if(typeof c?.schema=="object"){if(c.validate||tdr.call(this,c),s===(0,j2.normalizeId)(e)){let{schema:l}=c,{schemaId:u}=this.opts,d=l[u];return d&&(o=(0,j2.resolveUrl)(this.opts.uriResolver,o,d)),new Dhe({schema:l,schemaId:u,root:t,baseId:o})}return edr.call(this,r,c)}}a(Yct,"resolveSchema");oR.resolveSchema=Yct;var sjs=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function edr(t,{baseId:e,schema:r,root:n}){var o;if(((o=t.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let l of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,LYn.unescapeFragment)(l)];if(u===void 0)return;r=u;let d=typeof r=="object"&&r[this.opts.schemaId];!sjs.has(l)&&d&&(e=(0,j2.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,LYn.schemaHasRulesButRef)(r,this.RULES)){let l=(0,j2.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Yct.call(this,n,l)}let{schemaId:c}=this.opts;if(s=s||new Dhe({schema:r,schemaId:c,root:n,baseId:e}),s.schema!==s.root.schema)return s}a(edr,"getJsonPointer")});var FYn=I((RIf,ajs)=>{ajs.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var idr=I((kIf,GYn)=>{"use strict";p();var cjs=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),QYn=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),rdr=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),qYn=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),ljs=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function ndr(t){let e="",r=0,n=0;for(n=0;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}a(ndr,"stringArrayToHexStripped");var ujs=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function UYn(t){return t.length=0,!0}a(UYn,"consumeIsZone");function djs(t,e,r){if(t.length){let n=ndr(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}a(djs,"consumeHextets");function fjs(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,c=!1,l=djs;for(let u=0;u7){r.error=!0;break}u>0&&t[u-1]===":"&&(s=!0),n.push(":");continue}else if(d==="%"){if(!l(o,n,r))break;l=UYn}else{o.push(d);continue}}return o.length&&(l===UYn?r.zone=o.join(""):c?n.push(o.join("")):n.push(ndr(o))),r.address=n.join(""),r}a(fjs,"getIPV6");function jYn(t){if(pjs(t,":")<2)return{host:t,isIPV6:!1};let e=fjs(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}a(jYn,"normalizeIPv6");function pjs(t,e){let r=0;for(let n=0;nmjs[n])}a(HYn,"reescapeHostDelimiters");function yjs(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n{"use strict";p();var{isUUID:Cjs}=idr(),bjs=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Sjs=["http","https","ws","wss","urn","urn:uuid"];function Tjs(t){return Sjs.indexOf(t)!==-1}a(Tjs,"isValidSchemeName");function odr(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}a(odr,"wsIsSecure");function $Yn(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}a($Yn,"httpParse");function VYn(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}a(VYn,"httpSerialize");function Ijs(t){return t.secure=odr(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}a(Ijs,"wsParse");function xjs(t){if((t.port===(odr(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}a(xjs,"wsSerialize");function wjs(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(bjs);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let o=`${n}:${e.nid||t.nid}`,s=sdr(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}a(wjs,"urnParse");function Rjs(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),o=`${r}:${e.nid||n}`,s=sdr(o);s&&(t=s.serialize(t,e));let c=t,l=t.nss;return c.path=`${n||e.nid}:${l}`,e.skipEscape=!0,c}a(Rjs,"urnSerialize");function kjs(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!Cjs(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}a(kjs,"urnuuidParse");function Pjs(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}a(Pjs,"urnuuidSerialize");var WYn={scheme:"http",domainHost:!0,parse:$Yn,serialize:VYn},Djs={scheme:"https",domainHost:WYn.domainHost,parse:$Yn,serialize:VYn},Jct={scheme:"ws",domainHost:!0,parse:Ijs,serialize:xjs},Njs={scheme:"wss",domainHost:Jct.domainHost,parse:Jct.parse,serialize:Jct.serialize},Mjs={scheme:"urn",parse:wjs,serialize:Rjs,skipNormalize:!0},Ojs={scheme:"urn:uuid",parse:kjs,serialize:Pjs,skipNormalize:!0},Zct={http:WYn,https:Djs,ws:Jct,wss:Njs,urn:Mjs,"urn:uuid":Ojs};Object.setPrototypeOf(Zct,null);function sdr(t){return t&&(Zct[t]||Zct[t.toLowerCase()])||void 0}a(sdr,"getSchemeHandler");zYn.exports={wsIsSecure:odr,SCHEMES:Zct,isValidSchemeName:Tjs,getSchemeHandler:sdr}});var tKn=I((LIf,Xct)=>{"use strict";p();var{normalizeIPv6:Ljs,removeDotSegments:jDe,recomposeAuthority:Bjs,normalizePercentEncoding:Fjs,normalizePathEncoding:Ujs,escapePreservingEscapes:Qjs,reescapeHostDelimiters:qjs,isIPv4:jjs,nonSimpleDomain:Hjs}=idr(),{SCHEMES:Gjs,getSchemeHandler:JYn}=YYn();function $js(t,e){return typeof t=="string"?t=Kjs(t,e):typeof t=="object"&&(t=Nhe(QX(t,e),e)),t}a($js,"normalize");function Vjs(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=ZYn(Nhe(t,n),Nhe(e,n),n,!0);return n.skipEscape=!0,QX(o,n)}a(Vjs,"resolve");function ZYn(t,e,r,n){let o={};return n||(t=Nhe(QX(t,r),r),e=Nhe(QX(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(o.scheme=e.scheme,o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=jDe(e.path||""),o.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=jDe(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=jDe(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?o.path="/"+e.path:t.path?o.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:o.path=e.path,o.path=jDe(o.path)),o.query=e.query):(o.path=t.path,e.query!==void 0?o.query=e.query:o.query=t.query),o.userinfo=t.userinfo,o.host=t.host,o.port=t.port),o.scheme=t.scheme),o.fragment=e.fragment,o}a(ZYn,"resolveComponent");function Wjs(t,e,r){let n=KYn(t,r),o=KYn(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}a(Wjs,"equal");function QX(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),o=[],s=JYn(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=Fjs(r.path):(r.path=Qjs(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let c=Bjs(r);if(c!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(c),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=jDe(l)),c===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),o.push(l)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}a(QX,"serialize");var zjs=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Yjs(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}a(Yjs,"getParseError");function XYn(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let c=t.match(zjs);if(c){n.scheme=c[1],n.userinfo=c[3],n.host=c[4],n.port=parseInt(c[5],10),n.path=c[6]||"",n.query=c[7],n.fragment=c[8],isNaN(n.port)&&(n.port=c[5]);let l=Yjs(n,c);if(l!==void 0&&(n.error=n.error||l,o=!0),n.host)if(jjs(n.host)===!1){let f=Ljs(n.host);n.host=f.host.toLowerCase(),s=f.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let u=JYn(r.scheme||n.scheme);if(!r.unicodeSupport&&(!u||!u.unicodeSupport)&&n.host&&(r.domainHost||u&&u.domainHost)&&s===!1&&Hjs(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!u||u&&!u.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=qjs(unescape(n.host),s))),n.path&&(n.path=Ujs(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}u&&u.parse&&u.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}a(XYn,"parseWithStatus");function Nhe(t,e){return XYn(t,e).parsed}a(Nhe,"parse");function Kjs(t,e){return eKn(t,e).normalized}a(Kjs,"normalizeString");function eKn(t,e){let{parsed:r,malformedAuthorityOrPort:n}=XYn(t,e);return{normalized:n?t:QX(r,e),malformedAuthorityOrPort:n}}a(eKn,"normalizeStringWithStatus");function KYn(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=eKn(t,e);return n?void 0:r}if(typeof t=="object")return QX(t,e)}a(KYn,"normalizeComparableURI");var adr={SCHEMES:Gjs,normalize:$js,resolve:Vjs,resolveComponent:ZYn,equal:Wjs,serialize:QX,parse:Nhe};Xct.exports=adr;Xct.exports.default=adr;Xct.exports.fastUri=adr});var nKn=I(cdr=>{"use strict";p();Object.defineProperty(cdr,"__esModule",{value:!0});var rKn=tKn();rKn.code='require("ajv/dist/runtime/uri").default';cdr.default=rKn});var dKn=I(ty=>{"use strict";p();Object.defineProperty(ty,"__esModule",{value:!0});ty.CodeGen=ty.Name=ty.nil=ty.stringify=ty.str=ty._=ty.KeywordCxt=void 0;var Jjs=QDe();Object.defineProperty(ty,"KeywordCxt",{enumerable:!0,get:a(function(){return Jjs.KeywordCxt},"get")});var Mhe=As();Object.defineProperty(ty,"_",{enumerable:!0,get:a(function(){return Mhe._},"get")});Object.defineProperty(ty,"str",{enumerable:!0,get:a(function(){return Mhe.str},"get")});Object.defineProperty(ty,"stringify",{enumerable:!0,get:a(function(){return Mhe.stringify},"get")});Object.defineProperty(ty,"nil",{enumerable:!0,get:a(function(){return Mhe.nil},"get")});Object.defineProperty(ty,"Name",{enumerable:!0,get:a(function(){return Mhe.Name},"get")});Object.defineProperty(ty,"CodeGen",{enumerable:!0,get:a(function(){return Mhe.CodeGen},"get")});var Zjs=zct(),cKn=qDe(),Xjs=Lur(),HDe=Kct(),eHs=As(),GDe=BDe(),elt=LDe(),udr=Xa(),iKn=FYn(),tHs=nKn(),lKn=a((t,e)=>new RegExp(t,e),"defaultRegExp");lKn.code="new RegExp";var rHs=["removeAdditional","useDefaults","coerceTypes"],nHs=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),iHs={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},oHs={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},oKn=200;function sHs(t){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D;let N=t.strict,L=(e=t.code)===null||e===void 0?void 0:e.optimize,B=L===!0||L===void 0?1:L||0,j=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:lKn,M=(o=t.uriResolver)!==null&&o!==void 0?o:tHs.default;return{strictSchema:(c=(s=t.strictSchema)!==null&&s!==void 0?s:N)!==null&&c!==void 0?c:!0,strictNumbers:(u=(l=t.strictNumbers)!==null&&l!==void 0?l:N)!==null&&u!==void 0?u:!0,strictTypes:(f=(d=t.strictTypes)!==null&&d!==void 0?d:N)!==null&&f!==void 0?f:"log",strictTuples:(m=(h=t.strictTuples)!==null&&h!==void 0?h:N)!==null&&m!==void 0?m:"log",strictRequired:(A=(g=t.strictRequired)!==null&&g!==void 0?g:N)!==null&&A!==void 0?A:!1,code:t.code?{...t.code,optimize:B,regExp:j}:{optimize:B,regExp:j},loopRequired:(y=t.loopRequired)!==null&&y!==void 0?y:oKn,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:oKn,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(v=t.messages)!==null&&v!==void 0?v:!0,inlineRefs:(b=t.inlineRefs)!==null&&b!==void 0?b:!0,schemaId:(T=t.schemaId)!==null&&T!==void 0?T:"$id",addUsedSchema:(w=t.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(R=t.validateSchema)!==null&&R!==void 0?R:!0,validateFormats:(x=t.validateFormats)!==null&&x!==void 0?x:!0,unicodeRegExp:(P=t.unicodeRegExp)!==null&&P!==void 0?P:!0,int32range:(D=t.int32range)!==null&&D!==void 0?D:!0,uriResolver:M}}a(sHs,"requiredOptions");var $De=class{static{a(this,"Ajv")}constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...sHs(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new eHs.ValueScope({scope:{},prefixes:nHs,es5:r,lines:n}),this.logger=fHs(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,Xjs.getRules)(),sKn.call(this,iHs,e,"NOT SUPPORTED"),sKn.call(this,oHs,e,"DEPRECATED","warn"),this._metaOpts=uHs.call(this),e.formats&&cHs.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&lHs.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),aHs.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=iKn;n==="id"&&(o={...iKn},o.id=o.$id,delete o.$id),r&&e&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,e,r);async function o(f,h){await s.call(this,f.$schema);let m=this._addSchema(f,h);return m.validate||c.call(this,m)}async function s(f){f&&!this.getSchema(f)&&await o.call(this,{$ref:f},!0)}async function c(f){try{return this._compileSchemaEnv(f)}catch(h){if(!(h instanceof cKn.default))throw h;return l.call(this,h),await u.call(this,h.missingSchema),c.call(this,f)}}function l({missingSchema:f,missingRef:h}){if(this.refs[f])throw new Error(`AnySchema ${f} is loaded but ${h} cannot be resolved`)}async function u(f){let h=await d.call(this,f);this.refs[f]||await s.call(this,h.$schema),this.refs[f]||this.addSchema(h,f,r)}async function d(f){let h=this._loading[f];if(h)return h;try{return await(this._loading[f]=n(f))}finally{delete this._loading[f]}}}addSchema(e,r,n,o=this.opts.validateSchema){if(Array.isArray(e)){for(let c of e)this.addSchema(c,void 0,n,o);return this}let s;if(typeof e=="object"){let{schemaId:c}=this.opts;if(s=e[c],s!==void 0&&typeof s!="string")throw new Error(`schema ${c} must be string`)}return r=(0,GDe.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,o,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,e);if(!o&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return o}getSchema(e){let r;for(;typeof(r=aKn.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new HDe.SchemaEnv({schema:{},schemaId:n});if(r=HDe.resolveSchema.call(this,o,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=aKn.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,GDe.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(hHs.call(this,n,r),!r)return(0,udr.eachItem)(n,s=>ldr.call(this,s)),this;gHs.call(this,r);let o={...r,type:(0,elt.getJSONTypes)(r.type),schemaType:(0,elt.getJSONTypes)(r.schemaType)};return(0,udr.eachItem)(n,o.type.length===0?s=>ldr.call(this,s,o):s=>o.type.forEach(c=>ldr.call(this,s,o,c))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let o=n.rules.findIndex(s=>s.keyword===e);o>=0&&n.rules.splice(o,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,s)=>o+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let o of r){let s=o.split("/").slice(1),c=e;for(let l of s)c=c[l];for(let l in n){let u=n[l];if(typeof u!="object")continue;let{$data:d}=u.definition,f=c[l];d&&f&&(c[l]=uKn(f))}}return e}_removeAllSchemas(e,r){for(let n in e){let o=e[n];(!r||r.test(n))&&(typeof o=="string"?delete e[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[n]))}}_addSchema(e,r,n,o=this.opts.validateSchema,s=this.opts.addUsedSchema){let c,{schemaId:l}=this.opts;if(typeof e=="object")c=e[l];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(u!==void 0)return u;n=(0,GDe.normalizeId)(c||n);let d=GDe.getSchemaRefs.call(this,e,n);return u=new HDe.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:d}),this._cache.set(u.schema,u),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),o&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):HDe.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{HDe.compileSchema.call(this,e)}finally{this.opts=r}}};$De.ValidationError=Zjs.default;$De.MissingRefError=cKn.default;ty.default=$De;function sKn(t,e,r,n="error"){for(let o in t){let s=o;s in e&&this.logger[n](`${r}: option ${o}. ${t[s]}`)}}a(sKn,"checkOptions");function aKn(t){return t=(0,GDe.normalizeId)(t),this.schemas[t]||this.refs[t]}a(aKn,"getSchEnv");function aHs(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}a(aHs,"addInitialSchemas");function cHs(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}a(cHs,"addInitialFormats");function lHs(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}a(lHs,"addInitialKeywords");function uHs(){let t={...this.opts};for(let e of rHs)delete t[e];return t}a(uHs,"getMetaSchemaOptions");var dHs={log(){},warn(){},error(){}};function fHs(t){if(t===!1)return dHs;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}a(fHs,"getLogger");var pHs=/^[a-z_$][a-z0-9_$:-]*$/i;function hHs(t,e){let{RULES:r}=this;if((0,udr.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!pHs.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}a(hHs,"checkKeyword");function ldr(t,e,r){var n;let o=e?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,c=o?s.post:s.rules.find(({type:u})=>u===r);if(c||(c={type:r,rules:[]},s.rules.push(c)),s.keywords[t]=!0,!e)return;let l={keyword:t,definition:{...e,type:(0,elt.getJSONTypes)(e.type),schemaType:(0,elt.getJSONTypes)(e.schemaType)}};e.before?mHs.call(this,c,l,e.before):c.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(u=>this.addKeyword(u))}a(ldr,"addRule");function mHs(t,e,r){let n=t.rules.findIndex(o=>o.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}a(mHs,"addBeforeRule");function gHs(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=uKn(e)),t.validateSchema=this.compile(e,!0))}a(gHs,"keywordMetaschema");var AHs={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function uKn(t){return{anyOf:[t,AHs]}}a(uKn,"schemaOrData")});var fKn=I(ddr=>{"use strict";p();Object.defineProperty(ddr,"__esModule",{value:!0});var yHs={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ddr.default=yHs});var gKn=I(qX=>{"use strict";p();Object.defineProperty(qX,"__esModule",{value:!0});qX.callRef=qX.getValidate=void 0;var EHs=qDe(),pKn=iR(),xb=As(),Ohe=v8(),hKn=Kct(),tlt=Xa(),_Hs={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:o,schemaEnv:s,validateName:c,opts:l,self:u}=n,{root:d}=s;if((r==="#"||r==="#/")&&o===d.baseId)return h();let f=hKn.resolveRef.call(u,d,o,r);if(f===void 0)throw new EHs.default(n.opts.uriResolver,o,r);if(f instanceof hKn.SchemaEnv)return m(f);return g(f);function h(){if(s===d)return rlt(t,c,s,s.$async);let A=e.scopeValue("root",{ref:d});return rlt(t,(0,xb._)`${A}.validate`,d,d.$async)}function m(A){let y=mKn(t,A);rlt(t,y,A,A.$async)}function g(A){let y=e.scopeValue("schema",l.code.source===!0?{ref:A,code:(0,xb.stringify)(A)}:{ref:A}),E=e.name("valid"),_=t.subschema({schema:A,dataTypes:[],schemaPath:xb.nil,topSchemaRef:y,errSchemaPath:r},E);t.mergeEvaluated(_),t.ok(E)}}};function mKn(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,xb._)`${r.scopeValue("wrapper",{ref:e})}.validate`}a(mKn,"getValidate");qX.getValidate=mKn;function rlt(t,e,r,n){let{gen:o,it:s}=t,{allErrors:c,schemaEnv:l,opts:u}=s,d=u.passContext?Ohe.default.this:xb.nil;n?f():h();function f(){if(!l.$async)throw new Error("async schema referenced by sync schema");let A=o.let("valid");o.try(()=>{o.code((0,xb._)`await ${(0,pKn.callValidateCode)(t,e,d)}`),g(e),c||o.assign(A,!0)},y=>{o.if((0,xb._)`!(${y} instanceof ${s.ValidationError})`,()=>o.throw(y)),m(y),c||o.assign(A,!1)}),t.ok(A)}a(f,"callAsyncRef");function h(){t.result((0,pKn.callValidateCode)(t,e,d),()=>g(e),()=>m(e))}a(h,"callSyncRef");function m(A){let y=(0,xb._)`${A}.errors`;o.assign(Ohe.default.vErrors,(0,xb._)`${Ohe.default.vErrors} === null ? ${y} : ${Ohe.default.vErrors}.concat(${y})`),o.assign(Ohe.default.errors,(0,xb._)`${Ohe.default.vErrors}.length`)}a(m,"addErrorsFrom");function g(A){var y;if(!s.opts.unevaluated)return;let E=(y=r?.validate)===null||y===void 0?void 0:y.evaluated;if(s.props!==!0)if(E&&!E.dynamicProps)E.props!==void 0&&(s.props=tlt.mergeEvaluated.props(o,E.props,s.props));else{let _=o.var("props",(0,xb._)`${A}.evaluated.props`);s.props=tlt.mergeEvaluated.props(o,_,s.props,xb.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=tlt.mergeEvaluated.items(o,E.items,s.items));else{let _=o.var("items",(0,xb._)`${A}.evaluated.items`);s.items=tlt.mergeEvaluated.items(o,_,s.items,xb.Name)}}a(g,"addEvaluatedFrom")}a(rlt,"callRef");qX.callRef=rlt;qX.default=_Hs});var AKn=I(fdr=>{"use strict";p();Object.defineProperty(fdr,"__esModule",{value:!0});var vHs=fKn(),CHs=gKn(),bHs=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",vHs.default,CHs.default];fdr.default=bHs});var yKn=I(pdr=>{"use strict";p();Object.defineProperty(pdr,"__esModule",{value:!0});var nlt=As(),NH=nlt.operators,ilt={maximum:{okStr:"<=",ok:NH.LTE,fail:NH.GT},minimum:{okStr:">=",ok:NH.GTE,fail:NH.LT},exclusiveMaximum:{okStr:"<",ok:NH.LT,fail:NH.GTE},exclusiveMinimum:{okStr:">",ok:NH.GT,fail:NH.LTE}},SHs={message:a(({keyword:t,schemaCode:e})=>(0,nlt.str)`must be ${ilt[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,nlt._)`{comparison: ${ilt[t].okStr}, limit: ${e}}`,"params")},THs={keyword:Object.keys(ilt),type:"number",schemaType:"number",$data:!0,error:SHs,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,nlt._)`${r} ${ilt[e].fail} ${n} || isNaN(${r})`)}};pdr.default=THs});var EKn=I(hdr=>{"use strict";p();Object.defineProperty(hdr,"__esModule",{value:!0});var VDe=As(),IHs={message:a(({schemaCode:t})=>(0,VDe.str)`must be multiple of ${t}`,"message"),params:a(({schemaCode:t})=>(0,VDe._)`{multipleOf: ${t}}`,"params")},xHs={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:IHs,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,c=e.let("res"),l=s?(0,VDe._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${s}`:(0,VDe._)`${c} !== parseInt(${c})`;t.fail$data((0,VDe._)`(${n} === 0 || (${c} = ${r}/${n}, ${l}))`)}};hdr.default=xHs});var vKn=I(mdr=>{"use strict";p();Object.defineProperty(mdr,"__esModule",{value:!0});function _Kn(t){let e=t.length,r=0,n=0,o;for(;n=55296&&o<=56319&&n{"use strict";p();Object.defineProperty(gdr,"__esModule",{value:!0});var jX=As(),wHs=Xa(),RHs=vKn(),kHs={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,jX.str)`must NOT have ${r} than ${e} characters`},params:a(({schemaCode:t})=>(0,jX._)`{limit: ${t}}`,"params")},PHs={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:kHs,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?jX.operators.GT:jX.operators.LT,c=o.opts.unicode===!1?(0,jX._)`${r}.length`:(0,jX._)`${(0,wHs.useFunc)(t.gen,RHs.default)}(${r})`;t.fail$data((0,jX._)`${c} ${s} ${n}`)}};gdr.default=PHs});var bKn=I(Adr=>{"use strict";p();Object.defineProperty(Adr,"__esModule",{value:!0});var DHs=iR(),NHs=Xa(),Lhe=As(),MHs={message:a(({schemaCode:t})=>(0,Lhe.str)`must match pattern "${t}"`,"message"),params:a(({schemaCode:t})=>(0,Lhe._)`{pattern: ${t}}`,"params")},OHs={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:MHs,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:c}=t,l=c.opts.unicodeRegExp?"u":"";if(n){let{regExp:u}=c.opts.code,d=u.code==="new RegExp"?(0,Lhe._)`new RegExp`:(0,NHs.useFunc)(e,u),f=e.let("valid");e.try(()=>e.assign(f,(0,Lhe._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(f,!1)),t.fail$data((0,Lhe._)`!${f}`)}else{let u=(0,DHs.usePattern)(t,o);t.fail$data((0,Lhe._)`!${u}.test(${r})`)}}};Adr.default=OHs});var SKn=I(ydr=>{"use strict";p();Object.defineProperty(ydr,"__esModule",{value:!0});var WDe=As(),LHs={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,WDe.str)`must NOT have ${r} than ${e} properties`},params:a(({schemaCode:t})=>(0,WDe._)`{limit: ${t}}`,"params")},BHs={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:LHs,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?WDe.operators.GT:WDe.operators.LT;t.fail$data((0,WDe._)`Object.keys(${r}).length ${o} ${n}`)}};ydr.default=BHs});var TKn=I(Edr=>{"use strict";p();Object.defineProperty(Edr,"__esModule",{value:!0});var zDe=iR(),YDe=As(),FHs=Xa(),UHs={message:a(({params:{missingProperty:t}})=>(0,YDe.str)`must have required property '${t}'`,"message"),params:a(({params:{missingProperty:t}})=>(0,YDe._)`{missingProperty: ${t}}`,"params")},QHs={keyword:"required",type:"object",schemaType:"array",$data:!0,error:UHs,code(t){let{gen:e,schema:r,schemaCode:n,data:o,$data:s,it:c}=t,{opts:l}=c;if(!s&&r.length===0)return;let u=r.length>=l.loopRequired;if(c.allErrors?d():f(),l.strictRequired){let g=t.parentSchema.properties,{definedProperties:A}=t.it;for(let y of r)if(g?.[y]===void 0&&!A.has(y)){let E=c.schemaEnv.baseId+c.errSchemaPath,_=`required property "${y}" is not defined at "${E}" (strictRequired)`;(0,FHs.checkStrictMode)(c,_,c.opts.strictRequired)}}function d(){if(u||s)t.block$data(YDe.nil,h);else for(let g of r)(0,zDe.checkReportMissingProp)(t,g)}a(d,"allErrorsMode");function f(){let g=e.let("missing");if(u||s){let A=e.let("valid",!0);t.block$data(A,()=>m(g,A)),t.ok(A)}else e.if((0,zDe.checkMissingProp)(t,r,g)),(0,zDe.reportMissingProp)(t,g),e.else()}a(f,"exitOnErrorMode");function h(){e.forOf("prop",n,g=>{t.setParams({missingProperty:g}),e.if((0,zDe.noPropertyInData)(e,o,g,l.ownProperties),()=>t.error())})}a(h,"loopAllRequired");function m(g,A){t.setParams({missingProperty:g}),e.forOf(g,n,()=>{e.assign(A,(0,zDe.propertyInData)(e,o,g,l.ownProperties)),e.if((0,YDe.not)(A),()=>{t.error(),e.break()})},YDe.nil)}a(m,"loopUntilMissing")}};Edr.default=QHs});var IKn=I(_dr=>{"use strict";p();Object.defineProperty(_dr,"__esModule",{value:!0});var KDe=As(),qHs={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,KDe.str)`must NOT have ${r} than ${e} items`},params:a(({schemaCode:t})=>(0,KDe._)`{limit: ${t}}`,"params")},jHs={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:qHs,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?KDe.operators.GT:KDe.operators.LT;t.fail$data((0,KDe._)`${r}.length ${o} ${n}`)}};_dr.default=jHs});var olt=I(vdr=>{"use strict";p();Object.defineProperty(vdr,"__esModule",{value:!0});var xKn=Gur();xKn.code='require("ajv/dist/runtime/equal").default';vdr.default=xKn});var wKn=I(bdr=>{"use strict";p();Object.defineProperty(bdr,"__esModule",{value:!0});var Cdr=LDe(),ry=As(),HHs=Xa(),GHs=olt(),$Hs={message:a(({params:{i:t,j:e}})=>(0,ry.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,"message"),params:a(({params:{i:t,j:e}})=>(0,ry._)`{i: ${t}, j: ${e}}`,"params")},VHs={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:$Hs,code(t){let{gen:e,data:r,$data:n,schema:o,parentSchema:s,schemaCode:c,it:l}=t;if(!n&&!o)return;let u=e.let("valid"),d=s.items?(0,Cdr.getSchemaTypes)(s.items):[];t.block$data(u,f,(0,ry._)`${c} === false`),t.ok(u);function f(){let A=e.let("i",(0,ry._)`${r}.length`),y=e.let("j");t.setParams({i:A,j:y}),e.assign(u,!0),e.if((0,ry._)`${A} > 1`,()=>(h()?m:g)(A,y))}a(f,"validateUniqueItems");function h(){return d.length>0&&!d.some(A=>A==="object"||A==="array")}a(h,"canOptimize");function m(A,y){let E=e.name("item"),_=(0,Cdr.checkDataTypes)(d,E,l.opts.strictNumbers,Cdr.DataType.Wrong),v=e.const("indices",(0,ry._)`{}`);e.for((0,ry._)`;${A}--;`,()=>{e.let(E,(0,ry._)`${r}[${A}]`),e.if(_,(0,ry._)`continue`),d.length>1&&e.if((0,ry._)`typeof ${E} == "string"`,(0,ry._)`${E} += "_"`),e.if((0,ry._)`typeof ${v}[${E}] == "number"`,()=>{e.assign(y,(0,ry._)`${v}[${E}]`),t.error(),e.assign(u,!1).break()}).code((0,ry._)`${v}[${E}] = ${A}`)})}a(m,"loopN");function g(A,y){let E=(0,HHs.useFunc)(e,GHs.default),_=e.name("outer");e.label(_).for((0,ry._)`;${A}--;`,()=>e.for((0,ry._)`${y} = ${A}; ${y}--;`,()=>e.if((0,ry._)`${E}(${r}[${A}], ${r}[${y}])`,()=>{t.error(),e.assign(u,!1).break(_)})))}a(g,"loopN2")}};bdr.default=VHs});var RKn=I(Tdr=>{"use strict";p();Object.defineProperty(Tdr,"__esModule",{value:!0});var Sdr=As(),WHs=Xa(),zHs=olt(),YHs={message:"must be equal to constant",params:a(({schemaCode:t})=>(0,Sdr._)`{allowedValue: ${t}}`,"params")},KHs={keyword:"const",$data:!0,error:YHs,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,Sdr._)`!${(0,WHs.useFunc)(e,zHs.default)}(${r}, ${o})`):t.fail((0,Sdr._)`${s} !== ${r}`)}};Tdr.default=KHs});var kKn=I(Idr=>{"use strict";p();Object.defineProperty(Idr,"__esModule",{value:!0});var JDe=As(),JHs=Xa(),ZHs=olt(),XHs={message:"must be equal to one of the allowed values",params:a(({schemaCode:t})=>(0,JDe._)`{allowedValues: ${t}}`,"params")},eGs={keyword:"enum",schemaType:"array",$data:!0,error:XHs,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:c}=t;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let l=o.length>=c.opts.loopEnum,u,d=a(()=>u??(u=(0,JHs.useFunc)(e,ZHs.default)),"getEql"),f;if(l||n)f=e.let("valid"),t.block$data(f,h);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let g=e.const("vSchema",s);f=(0,JDe.or)(...o.map((A,y)=>m(g,y)))}t.pass(f);function h(){e.assign(f,!1),e.forOf("v",s,g=>e.if((0,JDe._)`${d()}(${r}, ${g})`,()=>e.assign(f,!0).break()))}a(h,"loopEnum");function m(g,A){let y=o[A];return typeof y=="object"&&y!==null?(0,JDe._)`${d()}(${r}, ${g}[${A}])`:(0,JDe._)`${r} === ${y}`}a(m,"equalCode")}};Idr.default=eGs});var PKn=I(xdr=>{"use strict";p();Object.defineProperty(xdr,"__esModule",{value:!0});var tGs=yKn(),rGs=EKn(),nGs=CKn(),iGs=bKn(),oGs=SKn(),sGs=TKn(),aGs=IKn(),cGs=wKn(),lGs=RKn(),uGs=kKn(),dGs=[tGs.default,rGs.default,nGs.default,iGs.default,oGs.default,sGs.default,aGs.default,cGs.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},lGs.default,uGs.default];xdr.default=dGs});var Rdr=I(ZDe=>{"use strict";p();Object.defineProperty(ZDe,"__esModule",{value:!0});ZDe.validateAdditionalItems=void 0;var HX=As(),wdr=Xa(),fGs={message:a(({params:{len:t}})=>(0,HX.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,HX._)`{limit: ${t}}`,"params")},pGs={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:fGs,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,wdr.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}DKn(t,n)}};function DKn(t,e){let{gen:r,schema:n,data:o,keyword:s,it:c}=t;c.items=!0;let l=r.const("len",(0,HX._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,HX._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,wdr.alwaysValidSchema)(c,n)){let d=r.var("valid",(0,HX._)`${l} <= ${e.length}`);r.if((0,HX.not)(d),()=>u(d)),t.ok(d)}function u(d){r.forRange("i",e.length,l,f=>{t.subschema({keyword:s,dataProp:f,dataPropType:wdr.Type.Num},d),c.allErrors||r.if((0,HX.not)(d),()=>r.break())})}a(u,"validateItems")}a(DKn,"validateAdditionalItems");ZDe.validateAdditionalItems=DKn;ZDe.default=pGs});var kdr=I(XDe=>{"use strict";p();Object.defineProperty(XDe,"__esModule",{value:!0});XDe.validateTuple=void 0;var NKn=As(),slt=Xa(),hGs=iR(),mGs={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return MKn(t,"additionalItems",e);r.items=!0,!(0,slt.alwaysValidSchema)(r,e)&&t.ok((0,hGs.validateArray)(t))}};function MKn(t,e,r=t.schema){let{gen:n,parentSchema:o,data:s,keyword:c,it:l}=t;f(o),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=slt.mergeEvaluated.items(n,r.length,l.items));let u=n.name("valid"),d=n.const("len",(0,NKn._)`${s}.length`);r.forEach((h,m)=>{(0,slt.alwaysValidSchema)(l,h)||(n.if((0,NKn._)`${d} > ${m}`,()=>t.subschema({keyword:c,schemaProp:m,dataProp:m},u)),t.ok(u))});function f(h){let{opts:m,errSchemaPath:g}=l,A=r.length,y=A===h.minItems&&(A===h.maxItems||h[e]===!1);if(m.strictTuples&&!y){let E=`"${c}" is ${A}-tuple, but minItems or maxItems/${e} are not specified or different at path "${g}"`;(0,slt.checkStrictMode)(l,E,m.strictTuples)}}a(f,"checkStrictTuple")}a(MKn,"validateTuple");XDe.validateTuple=MKn;XDe.default=mGs});var OKn=I(Pdr=>{"use strict";p();Object.defineProperty(Pdr,"__esModule",{value:!0});var gGs=kdr(),AGs={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(t=>(0,gGs.validateTuple)(t,"items"),"code")};Pdr.default=AGs});var BKn=I(Ddr=>{"use strict";p();Object.defineProperty(Ddr,"__esModule",{value:!0});var LKn=As(),yGs=Xa(),EGs=iR(),_Gs=Rdr(),vGs={message:a(({params:{len:t}})=>(0,LKn.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,LKn._)`{limit: ${t}}`,"params")},CGs={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:vGs,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,yGs.alwaysValidSchema)(n,e)&&(o?(0,_Gs.validateAdditionalItems)(t,o):t.ok((0,EGs.validateArray)(t)))}};Ddr.default=CGs});var FKn=I(Ndr=>{"use strict";p();Object.defineProperty(Ndr,"__esModule",{value:!0});var sR=As(),alt=Xa(),bGs={message:a(({params:{min:t,max:e}})=>e===void 0?(0,sR.str)`must contain at least ${t} valid item(s)`:(0,sR.str)`must contain at least ${t} and no more than ${e} valid item(s)`,"message"),params:a(({params:{min:t,max:e}})=>e===void 0?(0,sR._)`{minContains: ${t}}`:(0,sR._)`{minContains: ${t}, maxContains: ${e}}`,"params")},SGs={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:bGs,code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t,c,l,{minContains:u,maxContains:d}=n;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=e.const("len",(0,sR._)`${o}.length`);if(t.setParams({min:c,max:l}),l===void 0&&c===0){(0,alt.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&c>l){(0,alt.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,alt.alwaysValidSchema)(s,r)){let y=(0,sR._)`${f} >= ${c}`;l!==void 0&&(y=(0,sR._)`${y} && ${f} <= ${l}`),t.pass(y);return}s.items=!0;let h=e.name("valid");l===void 0&&c===1?g(h,()=>e.if(h,()=>e.break())):c===0?(e.let(h,!0),l!==void 0&&e.if((0,sR._)`${o}.length > 0`,m)):(e.let(h,!1),m()),t.result(h,()=>t.reset());function m(){let y=e.name("_valid"),E=e.let("count",0);g(y,()=>e.if(y,()=>A(E)))}a(m,"validateItemsWithCount");function g(y,E){e.forRange("i",0,f,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:alt.Type.Num,compositeRule:!0},y),E()})}a(g,"validateItems");function A(y){e.code((0,sR._)`${y}++`),l===void 0?e.if((0,sR._)`${y} >= ${c}`,()=>e.assign(h,!0).break()):(e.if((0,sR._)`${y} > ${l}`,()=>e.assign(h,!1).break()),c===1?e.assign(h,!0):e.if((0,sR._)`${y} >= ${c}`,()=>e.assign(h,!0)))}a(A,"checkLimits")}};Ndr.default=SGs});var qKn=I(Z5=>{"use strict";p();Object.defineProperty(Z5,"__esModule",{value:!0});Z5.validateSchemaDeps=Z5.validatePropertyDeps=Z5.error=void 0;var Mdr=As(),TGs=Xa(),eNe=iR();Z5.error={message:a(({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Mdr.str)`must have ${n} ${r} when property ${t} is present`},"message"),params:a(({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Mdr._)`{property: ${t}, + missingProperty: ${n}, + depsCount: ${e}, + deps: ${r}}`,"params")};var IGs={keyword:"dependencies",type:"object",schemaType:"object",error:Z5.error,code(t){let[e,r]=xGs(t);UKn(t,e),QKn(t,r)}};function xGs({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let o=Array.isArray(t[n])?e:r;o[n]=t[n]}return[e,r]}a(xGs,"splitDependencies");function UKn(t,e=t.schema){let{gen:r,data:n,it:o}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let c in e){let l=e[c];if(l.length===0)continue;let u=(0,eNe.propertyInData)(r,n,c,o.opts.ownProperties);t.setParams({property:c,depsCount:l.length,deps:l.join(", ")}),o.allErrors?r.if(u,()=>{for(let d of l)(0,eNe.checkReportMissingProp)(t,d)}):(r.if((0,Mdr._)`${u} && (${(0,eNe.checkMissingProp)(t,l,s)})`),(0,eNe.reportMissingProp)(t,s),r.else())}}a(UKn,"validatePropertyDeps");Z5.validatePropertyDeps=UKn;function QKn(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,c=r.name("valid");for(let l in e)(0,TGs.alwaysValidSchema)(s,e[l])||(r.if((0,eNe.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let u=t.subschema({keyword:o,schemaProp:l},c);t.mergeValidEvaluated(u,c)},()=>r.var(c,!0)),t.ok(c))}a(QKn,"validateSchemaDeps");Z5.validateSchemaDeps=QKn;Z5.default=IGs});var HKn=I(Odr=>{"use strict";p();Object.defineProperty(Odr,"__esModule",{value:!0});var jKn=As(),wGs=Xa(),RGs={message:"property name must be valid",params:a(({params:t})=>(0,jKn._)`{propertyName: ${t.propertyName}}`,"params")},kGs={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:RGs,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,wGs.alwaysValidSchema)(o,r))return;let s=e.name("valid");e.forIn("key",n,c=>{t.setParams({propertyName:c}),t.subschema({keyword:"propertyNames",data:c,dataTypes:["string"],propertyName:c,compositeRule:!0},s),e.if((0,jKn.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Odr.default=kGs});var Bdr=I(Ldr=>{"use strict";p();Object.defineProperty(Ldr,"__esModule",{value:!0});var clt=iR(),H2=As(),PGs=v8(),llt=Xa(),DGs={message:"must NOT have additional properties",params:a(({params:t})=>(0,H2._)`{additionalProperty: ${t.additionalProperty}}`,"params")},NGs={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:DGs,code(t){let{gen:e,schema:r,parentSchema:n,data:o,errsCount:s,it:c}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:l,opts:u}=c;if(c.props=!0,u.removeAdditional!=="all"&&(0,llt.alwaysValidSchema)(c,r))return;let d=(0,clt.allSchemaProperties)(n.properties),f=(0,clt.allSchemaProperties)(n.patternProperties);h(),t.ok((0,H2._)`${s} === ${PGs.default.errors}`);function h(){e.forIn("key",o,E=>{!d.length&&!f.length?A(E):e.if(m(E),()=>A(E))})}a(h,"checkAdditionalProperties");function m(E){let _;if(d.length>8){let v=(0,llt.schemaRefOrVal)(c,n.properties,"properties");_=(0,clt.isOwnProperty)(e,v,E)}else d.length?_=(0,H2.or)(...d.map(v=>(0,H2._)`${E} === ${v}`)):_=H2.nil;return f.length&&(_=(0,H2.or)(_,...f.map(v=>(0,H2._)`${(0,clt.usePattern)(t,v)}.test(${E})`))),(0,H2.not)(_)}a(m,"isAdditional");function g(E){e.code((0,H2._)`delete ${o}[${E}]`)}a(g,"deleteAdditional");function A(E){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){g(E);return}if(r===!1){t.setParams({additionalProperty:E}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,llt.alwaysValidSchema)(c,r)){let _=e.name("valid");u.removeAdditional==="failing"?(y(E,_,!1),e.if((0,H2.not)(_),()=>{t.reset(),g(E)})):(y(E,_),l||e.if((0,H2.not)(_),()=>e.break()))}}a(A,"additionalPropertyCode");function y(E,_,v){let b={keyword:"additionalProperties",dataProp:E,dataPropType:llt.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(b,_)}a(y,"applyAdditionalSchema")}};Ldr.default=NGs});var VKn=I(Udr=>{"use strict";p();Object.defineProperty(Udr,"__esModule",{value:!0});var MGs=QDe(),GKn=iR(),Fdr=Xa(),$Kn=Bdr(),OGs={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&$Kn.default.code(new MGs.KeywordCxt(s,$Kn.default,"additionalProperties"));let c=(0,GKn.allSchemaProperties)(r);for(let h of c)s.definedProperties.add(h);s.opts.unevaluated&&c.length&&s.props!==!0&&(s.props=Fdr.mergeEvaluated.props(e,(0,Fdr.toHash)(c),s.props));let l=c.filter(h=>!(0,Fdr.alwaysValidSchema)(s,r[h]));if(l.length===0)return;let u=e.name("valid");for(let h of l)d(h)?f(h):(e.if((0,GKn.propertyInData)(e,o,h,s.opts.ownProperties)),f(h),s.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(h),t.ok(u);function d(h){return s.opts.useDefaults&&!s.compositeRule&&r[h].default!==void 0}a(d,"hasDefault");function f(h){t.subschema({keyword:"properties",schemaProp:h,dataProp:h},u)}a(f,"applyPropertySchema")}};Udr.default=OGs});var KKn=I(Qdr=>{"use strict";p();Object.defineProperty(Qdr,"__esModule",{value:!0});var WKn=iR(),ult=As(),zKn=Xa(),YKn=Xa(),LGs={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:o,it:s}=t,{opts:c}=s,l=(0,WKn.allSchemaProperties)(r),u=l.filter(y=>(0,zKn.alwaysValidSchema)(s,r[y]));if(l.length===0||u.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let d=c.strictSchema&&!c.allowMatchingProperties&&o.properties,f=e.name("valid");s.props!==!0&&!(s.props instanceof ult.Name)&&(s.props=(0,YKn.evaluatedPropsToName)(e,s.props));let{props:h}=s;m();function m(){for(let y of l)d&&g(y),s.allErrors?A(y):(e.var(f,!0),A(y),e.if(f))}a(m,"validatePatternProperties");function g(y){for(let E in d)new RegExp(y).test(E)&&(0,zKn.checkStrictMode)(s,`property ${E} matches pattern ${y} (use allowMatchingProperties)`)}a(g,"checkMatchingProperties");function A(y){e.forIn("key",n,E=>{e.if((0,ult._)`${(0,WKn.usePattern)(t,y)}.test(${E})`,()=>{let _=u.includes(y);_||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:E,dataPropType:YKn.Type.Str},f),s.opts.unevaluated&&h!==!0?e.assign((0,ult._)`${h}[${E}]`,!0):!_&&!s.allErrors&&e.if((0,ult.not)(f),()=>e.break())})})}a(A,"validateProperties")}};Qdr.default=LGs});var JKn=I(qdr=>{"use strict";p();Object.defineProperty(qdr,"__esModule",{value:!0});var BGs=Xa(),FGs={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,BGs.alwaysValidSchema)(n,r)){t.fail();return}let o=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),t.failResult(o,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};qdr.default=FGs});var ZKn=I(jdr=>{"use strict";p();Object.defineProperty(jdr,"__esModule",{value:!0});var UGs=iR(),QGs={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:UGs.validateUnion,error:{message:"must match a schema in anyOf"}};jdr.default=QGs});var XKn=I(Hdr=>{"use strict";p();Object.defineProperty(Hdr,"__esModule",{value:!0});var dlt=As(),qGs=Xa(),jGs={message:"must match exactly one schema in oneOf",params:a(({params:t})=>(0,dlt._)`{passingSchemas: ${t.passing}}`,"params")},HGs={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:jGs,code(t){let{gen:e,schema:r,parentSchema:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let s=r,c=e.let("valid",!1),l=e.let("passing",null),u=e.name("_valid");t.setParams({passing:l}),e.block(d),t.result(c,()=>t.reset(),()=>t.error(!0));function d(){s.forEach((f,h)=>{let m;(0,qGs.alwaysValidSchema)(o,f)?e.var(u,!0):m=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,dlt._)`${u} && ${c}`).assign(c,!1).assign(l,(0,dlt._)`[${l}, ${h}]`).else(),e.if(u,()=>{e.assign(c,!0),e.assign(l,h),m&&t.mergeEvaluated(m,dlt.Name)})})}a(d,"validateOneOf")}};Hdr.default=HGs});var eJn=I(Gdr=>{"use strict";p();Object.defineProperty(Gdr,"__esModule",{value:!0});var GGs=Xa(),$Gs={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=e.name("valid");r.forEach((s,c)=>{if((0,GGs.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:c},o);t.ok(o),t.mergeEvaluated(l)})}};Gdr.default=$Gs});var nJn=I($dr=>{"use strict";p();Object.defineProperty($dr,"__esModule",{value:!0});var flt=As(),rJn=Xa(),VGs={message:a(({params:t})=>(0,flt.str)`must match "${t.ifClause}" schema`,"message"),params:a(({params:t})=>(0,flt._)`{failingKeyword: ${t.ifClause}}`,"params")},WGs={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:VGs,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,rJn.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=tJn(n,"then"),s=tJn(n,"else");if(!o&&!s)return;let c=e.let("valid",!0),l=e.name("_valid");if(u(),t.reset(),o&&s){let f=e.let("ifClause");t.setParams({ifClause:f}),e.if(l,d("then",f),d("else",f))}else o?e.if(l,d("then")):e.if((0,flt.not)(l),d("else"));t.pass(c,()=>t.error(!0));function u(){let f=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(f)}a(u,"validateIf");function d(f,h){return()=>{let m=t.subschema({keyword:f},l);e.assign(c,l),t.mergeValidEvaluated(m,c),h?e.assign(h,(0,flt._)`${f}`):t.setParams({ifClause:f})}}a(d,"validateClause")}};function tJn(t,e){let r=t.schema[e];return r!==void 0&&!(0,rJn.alwaysValidSchema)(t,r)}a(tJn,"hasSchema");$dr.default=WGs});var iJn=I(Vdr=>{"use strict";p();Object.defineProperty(Vdr,"__esModule",{value:!0});var zGs=Xa(),YGs={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,zGs.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Vdr.default=YGs});var oJn=I(Wdr=>{"use strict";p();Object.defineProperty(Wdr,"__esModule",{value:!0});var KGs=Rdr(),JGs=OKn(),ZGs=kdr(),XGs=BKn(),e$s=FKn(),t$s=qKn(),r$s=HKn(),n$s=Bdr(),i$s=VKn(),o$s=KKn(),s$s=JKn(),a$s=ZKn(),c$s=XKn(),l$s=eJn(),u$s=nJn(),d$s=iJn();function f$s(t=!1){let e=[s$s.default,a$s.default,c$s.default,l$s.default,u$s.default,d$s.default,r$s.default,n$s.default,t$s.default,i$s.default,o$s.default];return t?e.push(JGs.default,XGs.default):e.push(KGs.default,ZGs.default),e.push(e$s.default),e}a(f$s,"getApplicator");Wdr.default=f$s});var sJn=I(zdr=>{"use strict";p();Object.defineProperty(zdr,"__esModule",{value:!0});var ph=As(),p$s={message:a(({schemaCode:t})=>(0,ph.str)`must match format "${t}"`,"message"),params:a(({schemaCode:t})=>(0,ph._)`{format: ${t}}`,"params")},h$s={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:p$s,code(t,e){let{gen:r,data:n,$data:o,schema:s,schemaCode:c,it:l}=t,{opts:u,errSchemaPath:d,schemaEnv:f,self:h}=l;if(!u.validateFormats)return;o?m():g();function m(){let A=r.scopeValue("formats",{ref:h.formats,code:u.code.formats}),y=r.const("fDef",(0,ph._)`${A}[${c}]`),E=r.let("fType"),_=r.let("format");r.if((0,ph._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(E,(0,ph._)`${y}.type || "string"`).assign(_,(0,ph._)`${y}.validate`),()=>r.assign(E,(0,ph._)`"string"`).assign(_,y)),t.fail$data((0,ph.or)(v(),b()));function v(){return u.strictSchema===!1?ph.nil:(0,ph._)`${c} && !${_}`}a(v,"unknownFmt");function b(){let T=f.$async?(0,ph._)`(${y}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,ph._)`${_}(${n})`,w=(0,ph._)`(typeof ${_} == "function" ? ${T} : ${_}.test(${n}))`;return(0,ph._)`${_} && ${_} !== true && ${E} === ${e} && !${w}`}a(b,"invalidFmt")}a(m,"validate$DataFormat");function g(){let A=h.formats[s];if(!A){v();return}if(A===!0)return;let[y,E,_]=b(A);y===e&&t.pass(T());function v(){if(u.strictSchema===!1){h.logger.warn(w());return}throw new Error(w());function w(){return`unknown format "${s}" ignored in schema at path "${d}"`}}a(v,"unknownFormat");function b(w){let R=w instanceof RegExp?(0,ph.regexpCode)(w):u.code.formats?(0,ph._)`${u.code.formats}${(0,ph.getProperty)(s)}`:void 0,x=r.scopeValue("formats",{key:s,ref:w,code:R});return typeof w=="object"&&!(w instanceof RegExp)?[w.type||"string",w.validate,(0,ph._)`${x}.validate`]:["string",w,x]}a(b,"getFormat");function T(){if(typeof A=="object"&&!(A instanceof RegExp)&&A.async){if(!f.$async)throw new Error("async format in sync schema");return(0,ph._)`await ${_}(${n})`}return typeof E=="function"?(0,ph._)`${_}(${n})`:(0,ph._)`${_}.test(${n})`}a(T,"validCondition")}a(g,"validateFormat")}};zdr.default=h$s});var aJn=I(Ydr=>{"use strict";p();Object.defineProperty(Ydr,"__esModule",{value:!0});var m$s=sJn(),g$s=[m$s.default];Ydr.default=g$s});var cJn=I(Bhe=>{"use strict";p();Object.defineProperty(Bhe,"__esModule",{value:!0});Bhe.contentVocabulary=Bhe.metadataVocabulary=void 0;Bhe.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Bhe.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var uJn=I(Kdr=>{"use strict";p();Object.defineProperty(Kdr,"__esModule",{value:!0});var A$s=AKn(),y$s=PKn(),E$s=oJn(),_$s=aJn(),lJn=cJn(),v$s=[A$s.default,y$s.default,(0,E$s.default)(),_$s.default,lJn.metadataVocabulary,lJn.contentVocabulary];Kdr.default=v$s});var fJn=I(plt=>{"use strict";p();Object.defineProperty(plt,"__esModule",{value:!0});plt.DiscrError=void 0;var dJn;(function(t){t.Tag="tag",t.Mapping="mapping"})(dJn||(plt.DiscrError=dJn={}))});var hJn=I(Zdr=>{"use strict";p();Object.defineProperty(Zdr,"__esModule",{value:!0});var Fhe=As(),Jdr=fJn(),pJn=Kct(),C$s=qDe(),b$s=Xa(),S$s={message:a(({params:{discrError:t,tagName:e}})=>t===Jdr.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,"message"),params:a(({params:{discrError:t,tag:e,tagName:r}})=>(0,Fhe._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`,"params")},T$s={keyword:"discriminator",type:"object",schemaType:"object",error:S$s,code(t){let{gen:e,data:r,schema:n,parentSchema:o,it:s}=t,{oneOf:c}=o;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!c)throw new Error("discriminator: requires oneOf keyword");let u=e.let("valid",!1),d=e.const("tag",(0,Fhe._)`${r}${(0,Fhe.getProperty)(l)}`);e.if((0,Fhe._)`typeof ${d} == "string"`,()=>f(),()=>t.error(!1,{discrError:Jdr.DiscrError.Tag,tag:d,tagName:l})),t.ok(u);function f(){let g=m();e.if(!1);for(let A in g)e.elseIf((0,Fhe._)`${d} === ${A}`),e.assign(u,h(g[A]));e.else(),t.error(!1,{discrError:Jdr.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}a(f,"validateMapping");function h(g){let A=e.name("valid"),y=t.subschema({keyword:"oneOf",schemaProp:g},A);return t.mergeEvaluated(y,Fhe.Name),A}a(h,"applyTagSchema");function m(){var g;let A={},y=_(o),E=!0;for(let T=0;T{I$s.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var efr=I((Ad,Xdr)=>{"use strict";p();Object.defineProperty(Ad,"__esModule",{value:!0});Ad.MissingRefError=Ad.ValidationError=Ad.CodeGen=Ad.Name=Ad.nil=Ad.stringify=Ad.str=Ad._=Ad.KeywordCxt=Ad.Ajv=void 0;var x$s=dKn(),w$s=uJn(),R$s=hJn(),gJn=mJn(),k$s=["/properties"],hlt="http://json-schema.org/draft-07/schema",Uhe=class extends x$s.default{static{a(this,"Ajv")}_addVocabularies(){super._addVocabularies(),w$s.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(R$s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(gJn,k$s):gJn;this.addMetaSchema(e,hlt,!1),this.refs["http://json-schema.org/schema"]=hlt}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(hlt)?hlt:void 0)}};Ad.Ajv=Uhe;Xdr.exports=Ad=Uhe;Xdr.exports.Ajv=Uhe;Object.defineProperty(Ad,"__esModule",{value:!0});Ad.default=Uhe;var P$s=QDe();Object.defineProperty(Ad,"KeywordCxt",{enumerable:!0,get:a(function(){return P$s.KeywordCxt},"get")});var Qhe=As();Object.defineProperty(Ad,"_",{enumerable:!0,get:a(function(){return Qhe._},"get")});Object.defineProperty(Ad,"str",{enumerable:!0,get:a(function(){return Qhe.str},"get")});Object.defineProperty(Ad,"stringify",{enumerable:!0,get:a(function(){return Qhe.stringify},"get")});Object.defineProperty(Ad,"nil",{enumerable:!0,get:a(function(){return Qhe.nil},"get")});Object.defineProperty(Ad,"Name",{enumerable:!0,get:a(function(){return Qhe.Name},"get")});Object.defineProperty(Ad,"CodeGen",{enumerable:!0,get:a(function(){return Qhe.CodeGen},"get")});var D$s=zct();Object.defineProperty(Ad,"ValidationError",{enumerable:!0,get:a(function(){return D$s.default},"get")});var N$s=qDe();Object.defineProperty(Ad,"MissingRefError",{enumerable:!0,get:a(function(){return N$s.default},"get")})});var SJn=I(e4=>{"use strict";p();Object.defineProperty(e4,"__esModule",{value:!0});e4.formatNames=e4.fastFormats=e4.fullFormats=void 0;function X5(t,e){return{validate:t,compare:e}}a(X5,"fmtDef");e4.fullFormats={date:X5(_Jn,ifr),time:X5(rfr(!0),ofr),"date-time":X5(AJn(!0),CJn),"iso-time":X5(rfr(),vJn),"iso-date-time":X5(AJn(),bJn),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:U$s,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:V$s,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:Q$s,int32:{type:"number",validate:H$s},int64:{type:"number",validate:G$s},float:{type:"number",validate:EJn},double:{type:"number",validate:EJn},password:!0,binary:!0};e4.fastFormats={...e4.fullFormats,date:X5(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,ifr),time:X5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,ofr),"date-time":X5(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,CJn),"iso-time":X5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,vJn),"iso-date-time":X5(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,bJn),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};e4.formatNames=Object.keys(e4.fullFormats);function M$s(t){return t%4===0&&(t%100!==0||t%400===0)}a(M$s,"isLeapYear");var O$s=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,L$s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function _Jn(t){let e=O$s.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],o=+e[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&M$s(r)?29:L$s[n])}a(_Jn,"date");function ifr(t,e){if(t&&e)return t>e?1:t23||f>59||t&&!l)return!1;if(o<=23&&s<=59&&c<60)return!0;let h=s-f*u,m=o-d*u-(h<0?1:0);return(m===23||m===-1)&&(h===59||h===-1)&&c<61},"time")}a(rfr,"getTime");function ofr(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}a(ofr,"compareTime");function vJn(t,e){if(!(t&&e))return;let r=tfr.exec(t),n=tfr.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t=q$s}a(H$s,"validateInt32");function G$s(t){return Number.isInteger(t)}a(G$s,"validateInt64");function EJn(){return!0}a(EJn,"validateNumber");var $$s=/[^\\]\\Z/;function V$s(t){if($$s.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}a(V$s,"regex")});var TJn=I(qhe=>{"use strict";p();Object.defineProperty(qhe,"__esModule",{value:!0});qhe.formatLimitDefinition=void 0;var W$s=efr(),G2=As(),MH=G2.operators,mlt={formatMaximum:{okStr:"<=",ok:MH.LTE,fail:MH.GT},formatMinimum:{okStr:">=",ok:MH.GTE,fail:MH.LT},formatExclusiveMaximum:{okStr:"<",ok:MH.LT,fail:MH.GTE},formatExclusiveMinimum:{okStr:">",ok:MH.GT,fail:MH.LTE}},z$s={message:a(({keyword:t,schemaCode:e})=>(0,G2.str)`should be ${mlt[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,G2._)`{comparison: ${mlt[t].okStr}, limit: ${e}}`,"params")};qhe.formatLimitDefinition={keyword:Object.keys(mlt),type:"string",schemaType:"string",$data:!0,error:z$s,code(t){let{gen:e,data:r,schemaCode:n,keyword:o,it:s}=t,{opts:c,self:l}=s;if(!c.validateFormats)return;let u=new W$s.KeywordCxt(s,l.RULES.all.format.definition,"format");u.$data?d():f();function d(){let m=e.scopeValue("formats",{ref:l.formats,code:c.code.formats}),g=e.const("fmt",(0,G2._)`${m}[${u.schemaCode}]`);t.fail$data((0,G2.or)((0,G2._)`typeof ${g} != "object"`,(0,G2._)`${g} instanceof RegExp`,(0,G2._)`typeof ${g}.compare != "function"`,h(g)))}a(d,"validate$DataFormat");function f(){let m=u.schema,g=l.formats[m];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${o}": format "${m}" does not define "compare" function`);let A=e.scopeValue("formats",{key:m,ref:g,code:c.code.formats?(0,G2._)`${c.code.formats}${(0,G2.getProperty)(m)}`:void 0});t.fail$data(h(A))}a(f,"validateFormat");function h(m){return(0,G2._)`${m}.compare(${r}, ${n}) ${mlt[o].fail} 0`}a(h,"compareCode")},dependencies:["format"]};var Y$s=a(t=>(t.addKeyword(qhe.formatLimitDefinition),t),"formatLimitPlugin");qhe.default=Y$s});var RJn=I((tNe,wJn)=>{"use strict";p();Object.defineProperty(tNe,"__esModule",{value:!0});var jhe=SJn(),K$s=TJn(),sfr=As(),IJn=new sfr.Name("fullFormats"),J$s=new sfr.Name("fastFormats"),afr=a((t,e={keywords:!0})=>{if(Array.isArray(e))return xJn(t,e,jhe.fullFormats,IJn),t;let[r,n]=e.mode==="fast"?[jhe.fastFormats,J$s]:[jhe.fullFormats,IJn],o=e.formats||jhe.formatNames;return xJn(t,o,r,n),e.keywords&&(0,K$s.default)(t),t},"formatsPlugin");afr.get=(t,e="full")=>{let n=(e==="fast"?jhe.fastFormats:jhe.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function xJn(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,sfr._)`require("ajv-formats/dist/formats").${n}`);for(let c of e)t.addFormat(c,r[c])}a(xJn,"addFormats");wJn.exports=tNe=afr;Object.defineProperty(tNe,"__esModule",{value:!0});tNe.default=afr});var sZn=I((CPf,oZn)=>{p();oZn.exports=iZn;iZn.sync=AVs;var rZn=require("fs");function gVs(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n{p();uZn.exports=cZn;cZn.sync=yVs;var aZn=require("fs");function cZn(t,e,r){aZn.stat(t,function(n,o){r(n,n?!1:lZn(o,e))})}a(cZn,"isexe");function yVs(t,e){return lZn(aZn.statSync(t),e)}a(yVs,"sync");function lZn(t,e){return t.isFile()&&EVs(t,e)}a(lZn,"checkStat");function EVs(t,e){var r=t.mode,n=t.uid,o=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),c=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),l=parseInt("100",8),u=parseInt("010",8),d=parseInt("001",8),f=l|u,h=r&d||r&u&&o===c||r&l&&n===s||r&f&&s===0;return h}a(EVs,"checkMode")});var pZn=I((RPf,fZn)=>{p();var wPf=require("fs"),Plt;process.platform==="win32"||global.TESTING_WINDOWS?Plt=sZn():Plt=dZn();fZn.exports=Tfr;Tfr.sync=_Vs;function Tfr(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){Tfr(t,e||{},function(s,c){s?o(s):n(c)})})}Plt(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}a(Tfr,"isexe");function _Vs(t,e){try{return Plt.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}a(_Vs,"sync")});var _Zn=I((DPf,EZn)=>{p();var Xhe=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",hZn=require("path"),vVs=Xhe?";":":",mZn=pZn(),gZn=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),AZn=a((t,e)=>{let r=e.colon||vVs,n=t.match(/\//)||Xhe&&t.match(/\\/)?[""]:[...Xhe?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=Xhe?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Xhe?o.split(r):[""];return Xhe&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},"getPathInfo"),yZn=a((t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=AZn(t,e),c=[],l=a(d=>new Promise((f,h)=>{if(d===n.length)return e.all&&c.length?f(c):h(gZn(t));let m=n[d],g=/^".*"$/.test(m)?m.slice(1,-1):m,A=hZn.join(g,t),y=!g&&/^\.[\\\/]/.test(t)?t.slice(0,2)+A:A;f(u(y,d,0))}),"step"),u=a((d,f,h)=>new Promise((m,g)=>{if(h===o.length)return m(l(f+1));let A=o[h];mZn(d+A,{pathExt:s},(y,E)=>{if(!y&&E)if(e.all)c.push(d+A);else return m(d+A);return m(u(d,f,h+1))})}),"subStep");return r?l(0).then(d=>r(null,d),r):l(0)},"which"),CVs=a((t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=AZn(t,e),s=[];for(let c=0;c{"use strict";p();var vZn=a((t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey");Ifr.exports=vZn;Ifr.exports.default=vZn});var IZn=I((FPf,TZn)=>{"use strict";p();var bZn=require("path"),bVs=_Zn(),SVs=CZn();function SZn(t,e){let r=t.options.env||process.env,n=process.cwd(),o=t.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let c;try{c=bVs.sync(t.command,{path:r[SVs({env:r})],pathExt:e?bZn.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return c&&(c=bZn.resolve(o?t.options.cwd:"",c)),c}a(SZn,"resolveCommandAttempt");function TVs(t){return SZn(t)||SZn(t,!0)}a(TVs,"resolveCommand");TZn.exports=TVs});var xZn=I((qPf,wfr)=>{"use strict";p();var xfr=/([()\][%!^"`<>&|;, *?])/g;function IVs(t){return t=t.replace(xfr,"^$1"),t}a(IVs,"escapeCommand");function xVs(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(xfr,"^$1"),e&&(t=t.replace(xfr,"^$1")),t}a(xVs,"escapeArgument");wfr.exports.command=IVs;wfr.exports.argument=xVs});var RZn=I((GPf,wZn)=>{"use strict";p();wZn.exports=/^#!(.*)/});var PZn=I((VPf,kZn)=>{"use strict";p();var wVs=RZn();kZn.exports=(t="")=>{let e=t.match(wVs);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var NZn=I((zPf,DZn)=>{"use strict";p();var Rfr=require("fs"),RVs=PZn();function kVs(t){let r=Buffer.alloc(150),n;try{n=Rfr.openSync(t,"r"),Rfr.readSync(n,r,0,150,0),Rfr.closeSync(n)}catch{}return RVs(r.toString())}a(kVs,"readShebang");DZn.exports=kVs});var BZn=I((JPf,LZn)=>{"use strict";p();var PVs=require("path"),MZn=IZn(),OZn=xZn(),DVs=NZn(),NVs=process.platform==="win32",MVs=/\.(?:com|exe)$/i,OVs=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function LVs(t){t.file=MZn(t);let e=t.file&&DVs(t.file);return e?(t.args.unshift(t.file),t.command=e,MZn(t)):t.file}a(LVs,"detectShebang");function BVs(t){if(!NVs)return t;let e=LVs(t),r=!MVs.test(e);if(t.options.forceShell||r){let n=OVs.test(e);t.command=PVs.normalize(t.command),t.command=OZn.command(t.command),t.args=t.args.map(s=>OZn.argument(s,n));let o=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${o}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}a(BVs,"parseNonShell");function FVs(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:BVs(n)}a(FVs,"parse");LZn.exports=FVs});var QZn=I((e2f,UZn)=>{"use strict";p();var kfr=process.platform==="win32";function Pfr(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}a(Pfr,"notFoundError");function UVs(t,e){if(!kfr)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=FZn(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}a(UVs,"hookChildProcess");function FZn(t,e){return kfr&&t===1&&!e.file?Pfr(e.original,"spawn"):null}a(FZn,"verifyENOENT");function QVs(t,e){return kfr&&t===1&&!e.file?Pfr(e.original,"spawnSync"):null}a(QVs,"verifyENOENTSync");UZn.exports={hookChildProcess:UVs,verifyENOENT:FZn,verifyENOENTSync:QVs,notFoundError:Pfr}});var HZn=I((n2f,eme)=>{"use strict";p();var qZn=require("child_process"),Dfr=BZn(),Nfr=QZn();function jZn(t,e,r){let n=Dfr(t,e,r),o=qZn.spawn(n.command,n.args,n.options);return Nfr.hookChildProcess(o,n),o}a(jZn,"spawn");function qVs(t,e,r){let n=Dfr(t,e,r),o=qZn.spawnSync(n.command,n.args,n.options);return o.error=o.error||Nfr.verifyENOENTSync(o.status,n),o}a(qVs,"spawnSync");eme.exports=jZn;eme.exports.spawn=jZn;eme.exports.sync=qVs;eme.exports._parse=Dfr;eme.exports._enoent=Nfr});var HT=I(eee=>{"use strict";p();Object.defineProperty(eee,"__esModule",{value:!0});eee.DebugNameData=void 0;eee.getDebugName=oti;eee.getClassName=sti;eee.getFunctionName=ati;var Ipr=class{static{a(this,"DebugNameData")}constructor(e,r,n){this.owner=e,this.debugNameSource=r,this.referenceFn=n}getDebugName(e){return oti(e,this)}};eee.DebugNameData=Ipr;var rti=new Map,xpr=new WeakMap;function oti(t,e){let r=xpr.get(t);if(r)return r;let n=dYs(t,e);if(n){let o=rti.get(n)??0;o++,rti.set(n,o);let s=o===1?n:`${n}#${o}`;return xpr.set(t,s),s}}a(oti,"getDebugName");function dYs(t,e){let r=xpr.get(t);if(r)return r;let n=e.owner?pYs(e.owner)+".":"",o,s=e.debugNameSource;if(s!==void 0)if(typeof s=="function"){if(o=s(),o!==void 0)return n+o}else return n+s;let c=e.referenceFn;if(c!==void 0&&(o=ati(c),o!==void 0))return n+o;if(e.owner!==void 0){let l=fYs(e.owner,t);if(l!==void 0)return n+l}}a(dYs,"computeDebugName");function fYs(t,e){for(let r in t)if(t[r]===e)return r}a(fYs,"findKey");var nti=new Map,iti=new WeakMap;function pYs(t){let e=iti.get(t);if(e)return e;let r=sti(t)??"Object",n=nti.get(r)??0;n++,nti.set(r,n);let o=n===1?r:`${r}#${n}`;return iti.set(t,o),o}a(pYs,"formatOwner");function sti(t){let e=t.constructor;if(e)return e.name==="Object"?void 0:e.name}a(sti,"getClassName");function ati(t){let e=t.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(n?n[1]:void 0)?.trim()}a(ati,"getFunctionName")});var _ti=I(bp=>{"use strict";p();var hYs=bp&&bp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mYs=bp&&bp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),gYs=bp&&bp.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot===e}a(dti,"strictEqualsC");function fti(t,e,r){return uti.equals(t,e,r??Tut)}a(fti,"arrayEquals");function pti(t){return(e,r)=>uti.equals(e,r,t??Tut)}a(pti,"arrayEqualsC");function RNe(t,e){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0;rRNe(t,e)}a(hti,"structuralEqualsC");function AYs(t){return JSON.stringify(wpr(t))}a(AYs,"getStructuralKey");var yYs=0,cti=new WeakMap;function wpr(t){if(Array.isArray(t))return t.map(wpr);if(t&&typeof t=="object")if(Object.getPrototypeOf(t)===Object.prototype){let e=t,r=Object.create(null);for(let n of Object.keys(e).sort())r[n]=wpr(e[n]);return r}else{let e=cti.get(t);return e===void 0&&(e=yYs++,cti.set(t,e)),e+"----2b76a038c20c4bcc"}return t}a(wpr,"toNormalizedJsonStructure");function mti(t,e){return JSON.stringify(t)===JSON.stringify(e)}a(mti,"jsonStringifyEquals");function gti(){return(t,e)=>JSON.stringify(t)===JSON.stringify(e)}a(gti,"jsonStringifyEqualsC");function Ati(){return(t,e)=>t.equals(e)}a(Ati,"thisEqualsC");function yti(t,e,r){return t==null||e===void 0||e===null?e===t:r(t,e)}a(yti,"equalsIfDefined");function Eti(t){return(e,r)=>e==null||r===void 0||r===null?r===e:t(e,r)}a(Eti,"equalsIfDefinedC");var lti;(function(t){t.strict=Tut,t.strictC=dti,t.array=fti,t.arrayC=pti,t.structural=RNe,t.structuralC=hti,t.jsonStringify=mti,t.jsonStringifyC=gti,t.thisC=Ati,t.ifDefined=yti,t.ifDefinedC=Eti})(lti||(bp.equals=lti={}))});var Ev=I(Sp=>{"use strict";p();Object.defineProperty(Sp,"__esModule",{value:!0});Sp.trackDisposable=Sp.toDisposable=Sp.markAsDisposed=Sp.DisposableStore=Sp.Event=Sp.onUnexpectedError=Sp.onBugIndicatingError=Sp.BugIndicatingError=Sp.strictEquals=Sp.assertFn=void 0;var EYs=sd();Object.defineProperty(Sp,"assertFn",{enumerable:!0,get:a(function(){return EYs.assertFn},"get")});var _Ys=_ti();Object.defineProperty(Sp,"strictEquals",{enumerable:!0,get:a(function(){return _Ys.strictEquals},"get")});var Rpr=Rs();Object.defineProperty(Sp,"BugIndicatingError",{enumerable:!0,get:a(function(){return Rpr.BugIndicatingError},"get")});Object.defineProperty(Sp,"onBugIndicatingError",{enumerable:!0,get:a(function(){return Rpr.onBugIndicatingError},"get")});Object.defineProperty(Sp,"onUnexpectedError",{enumerable:!0,get:a(function(){return Rpr.onUnexpectedError},"get")});var vYs=Rc();Object.defineProperty(Sp,"Event",{enumerable:!0,get:a(function(){return vYs.Event},"get")});var Iut=Ro();Object.defineProperty(Sp,"DisposableStore",{enumerable:!0,get:a(function(){return Iut.DisposableStore},"get")});Object.defineProperty(Sp,"markAsDisposed",{enumerable:!0,get:a(function(){return Iut.markAsDisposed},"get")});Object.defineProperty(Sp,"toDisposable",{enumerable:!0,get:a(function(){return Iut.toDisposable},"get")});Object.defineProperty(Sp,"trackDisposable",{enumerable:!0,get:a(function(){return Iut.trackDisposable},"get")})});var vti=I(kpr=>{"use strict";p();Object.defineProperty(kpr,"__esModule",{value:!0});kpr.handleBugIndicatingErrorRecovery=bYs;var CYs=Ev();function bYs(t){let e=new Error("BugIndicatingErrorRecovery: "+t);(0,CYs.onUnexpectedError)(e),console.error("recovered from an error that indicates a bug",e)}a(bYs,"handleBugIndicatingErrorRecovery")});var a4=I(_me=>{"use strict";p();Object.defineProperty(_me,"__esModule",{value:!0});_me.addLogger=SYs;_me.getLogger=TYs;_me.setLogObservableFn=IYs;_me.logObservable=xYs;var tee;function SYs(t){tee?tee instanceof xut?tee.loggers.push(t):tee=new xut([tee,t]):tee=t}a(SYs,"addLogger");function TYs(){return tee}a(TYs,"getLogger");var Ppr;function IYs(t){Ppr=t}a(IYs,"setLogObservableFn");function xYs(t){Ppr&&Ppr(t)}a(xYs,"logObservable");var xut=class{static{a(this,"ComposedLogger")}constructor(e){this.loggers=e}handleObservableCreated(e,r){for(let n of this.loggers)n.handleObservableCreated(e,r)}handleOnListenerCountChanged(e,r){for(let n of this.loggers)n.handleOnListenerCountChanged(e,r)}handleObservableUpdated(e,r){for(let n of this.loggers)n.handleObservableUpdated(e,r)}handleAutorunCreated(e,r){for(let n of this.loggers)n.handleAutorunCreated(e,r)}handleAutorunDisposed(e){for(let r of this.loggers)r.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,r,n){for(let o of this.loggers)o.handleAutorunDependencyChanged(e,r,n)}handleAutorunStarted(e){for(let r of this.loggers)r.handleAutorunStarted(e)}handleAutorunFinished(e){for(let r of this.loggers)r.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,r,n){for(let o of this.loggers)o.handleDerivedDependencyChanged(e,r,n)}handleDerivedCleared(e){for(let r of this.loggers)r.handleDerivedCleared(e)}handleBeginTransaction(e){for(let r of this.loggers)r.handleBeginTransaction(e)}handleEndTransaction(e){for(let r of this.loggers)r.handleEndTransaction(e)}}});var k8=I(HH=>{"use strict";p();Object.defineProperty(HH,"__esModule",{value:!0});HH.TransactionImpl=void 0;HH.transaction=Dpr;HH.globalTransaction=RYs;HH.asyncTransaction=kYs;HH.subtransaction=PYs;var Cti=vti(),wYs=HT(),bti=a4();function Dpr(t,e){let r=new vme(t,e);try{t(r)}finally{r.finish()}}a(Dpr,"transaction");var wut;function RYs(t){if(wut)t(wut);else{let e=new vme(t,void 0);wut=e;try{t(e)}finally{e.finish(),wut=void 0}}}a(RYs,"globalTransaction");async function kYs(t,e){let r=new vme(t,e);try{await t(r)}finally{r.finish()}}a(kYs,"asyncTransaction");function PYs(t,e,r){t?e(t):Dpr(e,r)}a(PYs,"subtransaction");var vme=class{static{a(this,"TransactionImpl")}constructor(e,r){this._fn=e,this._getDebugName=r,this._updatingObservers=[],(0,bti.getLogger)()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():(0,wYs.getFunctionName)(this._fn)}updateObserver(e,r){if(!this._updatingObservers){(0,Cti.handleBugIndicatingErrorRecovery)("Transaction already finished!"),Dpr(n=>{n.updateObserver(e,r)});return}this._updatingObservers.push({observer:e,observable:r}),e.beginUpdate(r)}finish(){let e=this._updatingObservers;if(!e){(0,Cti.handleBugIndicatingErrorRecovery)("transaction.finish() has already been called!");return}for(let r=0;r{"use strict";p();Object.defineProperty(Rut,"__esModule",{value:!0});Rut.DebugLocation=void 0;var Sti;(function(t){let e=!1;function r(){e=!0}a(r,"enable"),t.enable=r;function n(){if(!e)return;let o=Error,s=o.stackTraceLimit;o.stackTraceLimit=3;let c=new Error().stack;return o.stackTraceLimit=s,Npr.fromStack(c,2)}a(n,"ofCaller"),t.ofCaller=n})(Sti||(Rut.DebugLocation=Sti={}));var Npr=class t{static{a(this,"DebugLocationImpl")}static fromStack(e,r){let n=e.split(` +`),o=DYs(n[r+1]);if(o)return new t(o.fileName,o.line,o.column,o.id)}constructor(e,r,n,o){this.fileName=e,this.line=r,this.column=n,this.id=o}};function DYs(t){let e=t.match(/\((.*):(\d+):(\d+)\)/);if(e)return{fileName:e[1],line:parseInt(e[2]),column:parseInt(e[3]),id:t};let r=t.match(/at ([^\(\)]*):(\d+):(\d+)/);if(r)return{fileName:r[1],line:parseInt(r[2]),column:parseInt(r[3]),id:t}}a(DYs,"parseLine")});var J2=I(c4=>{"use strict";p();Object.defineProperty(c4,"__esModule",{value:!0});c4.BaseObservable=c4.ConvenientObservable=void 0;c4._setDerivedOpts=MYs;c4._setRecomputeInitiallyAndOnChange=OYs;c4._setKeepObserved=LYs;c4._setDebugGetObservableGraph=BYs;var Tti=GT(),NYs=HT(),Cme=a4(),Mpr;function MYs(t){Mpr=t}a(MYs,"_setDerivedOpts");var Iti;function OYs(t){Iti=t}a(OYs,"_setRecomputeInitiallyAndOnChange");var xti;function LYs(t){xti=t}a(LYs,"_setKeepObserved");var Opr;function BYs(t){Opr=t}a(BYs,"_setDebugGetObservableGraph");var kut=class{static{a(this,"ConvenientObservable")}get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,r,n=Tti.DebugLocation.ofCaller()){let o=r===void 0?void 0:e,s=r===void 0?e:r;return Mpr({owner:o,debugName:a(()=>{let c=(0,NYs.getFunctionName)(s);if(c!==void 0)return c;let u=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(u)return`${this.debugName}.${u[2]}`;if(!o)return`${this.debugName} (mapped)`},"debugName"),debugReferenceFn:s},c=>s(this.read(c),c),n)}flatten(){return Mpr({owner:void 0,debugName:a(()=>`${this.debugName} (flattened)`,"debugName")},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,r){return e.add(Iti(this,r)),this}keepObserved(e){return e.add(xti(this)),this}get debugValue(){return this.get()}get debug(){return new Lpr(this)}};c4.ConvenientObservable=kut;var Lpr=class{static{a(this,"DebugHelper")}constructor(e){this.observable=e}getDependencyGraph(){return Opr(this.observable,{type:"dependencies"})}getObserverGraph(){return Opr(this.observable,{type:"observers"})}},Bpr=class extends kut{static{a(this,"BaseObservable")}constructor(e){super(),this._observers=new Set,(0,Cme.getLogger)()?.handleObservableCreated(this,e)}addObserver(e){let r=this._observers.size;this._observers.add(e),r===0&&this.onFirstObserverAdded(),r!==this._observers.size&&(0,Cme.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let r=this._observers.delete(e);r&&this._observers.size===0&&this.onLastObserverRemoved(),r&&(0,Cme.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!(0,Cme.getLogger)();return(0,Cme.logObservable)(this),e||(0,Cme.getLogger)()?.handleObservableCreated(this,Tti.DebugLocation.ofCaller()),this}debugGetObservers(){return this._observers}};c4.BaseObservable=Bpr});var P8=I(GH=>{"use strict";p();Object.defineProperty(GH,"__esModule",{value:!0});GH.DisposableObservableValue=GH.ObservableValue=void 0;GH.observableValue=QYs;GH.disposableObservableValue=qYs;var FYs=k8(),UYs=J2(),Rti=Ev(),Put=HT(),wti=a4(),kti=GT();function QYs(t,e,r=kti.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new Put.DebugNameData(void 0,t,void 0):n=new Put.DebugNameData(t,void 0,void 0),new kNe(n,e,Rti.strictEquals,r)}a(QYs,"observableValue");var kNe=class extends UYs.BaseObservable{static{a(this,"ObservableValue")}get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,r,n,o){super(o),this._debugNameData=e,this._equalityComparator=n,this._value=r,(0,wti.getLogger)()?.handleObservableUpdated(this,{hadValue:!1,newValue:r,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,r,n){if(n===void 0&&this._equalityComparator(this._value,e))return;let o;r||(r=o=new FYs.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{let s=this._value;this._setValue(e),(0,wti.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:e,change:n,didChange:!0,hadValue:!0});for(let c of this._observers)r.updateObserver(c,this),c.handleChange(this,n)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}};GH.ObservableValue=kNe;function qYs(t,e,r=kti.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new Put.DebugNameData(void 0,t,void 0):n=new Put.DebugNameData(t,void 0,void 0),new Dut(n,e,Rti.strictEquals,r)}a(qYs,"disposableObservableValue");var Dut=class extends kNe{static{a(this,"DisposableObservableValue")}_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}};GH.DisposableObservableValue=Dut});var Dti=I(Nut=>{"use strict";p();Object.defineProperty(Nut,"__esModule",{value:!0});Nut.LazyObservableValue=void 0;var jYs=k8(),Pti=a4(),HYs=J2(),Fpr=class extends HYs.BaseObservable{static{a(this,"LazyObservableValue")}get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,r,n,o){super(o),this._debugNameData=e,this._equalityComparator=n,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=r}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(let e of this._deltas){(0,Pti.getLogger)()?.handleObservableUpdated(this,{change:e,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(let r of this._observers)r.handleChange(this,e)}this._deltas.length=0}else{(0,Pti.getLogger)()?.handleObservableUpdated(this,{change:void 0,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(let e of this._observers)e.handleChange(this,void 0)}}_beginUpdate(){if(this._updateCounter++,this._updateCounter===1)for(let e of this._observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){this._update();let e=[...this._observers];for(let r of e)r.endUpdate(this)}}addObserver(e){let r=!this._observers.has(e)&&this._updateCounter>0;super.addObserver(e),r&&e.beginUpdate(this)}removeObserver(e){let r=this._observers.has(e)&&this._updateCounter>0;super.removeObserver(e),r&&e.endUpdate(this)}set(e,r,n){if(n===void 0&&this._equalityComparator(this._value,e))return;let o;r||(r=o=new jYs.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{if(this._isUpToDate=!1,this._setValue(e),n!==void 0&&this._deltas.push(n),r.updateObserver({beginUpdate:a(()=>this._beginUpdate(),"beginUpdate"),endUpdate:a(()=>this._endUpdate(),"endUpdate"),handleChange:a((s,c)=>{},"handleChange"),handlePossibleChange:a(s=>{},"handlePossibleChange")},this),this._updateCounter>1)for(let s of this._observers)s.handlePossibleChange(this)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}};Nut.LazyObservableValue=Fpr});var Mut=I(Upr=>{"use strict";p();Object.defineProperty(Upr,"__esModule",{value:!0});Upr.observableValueOpts=WYs;var Nti=HT(),Mti=Ev(),GYs=P8(),$Ys=Dti(),VYs=GT();function WYs(t,e,r=VYs.DebugLocation.ofCaller()){return t.lazy?new $Ys.LazyObservableValue(new Nti.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??Mti.strictEquals,r):new GYs.ObservableValue(new Nti.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??Mti.strictEquals,r)}a(WYs,"observableValueOpts")});var Lut=I(Out=>{"use strict";p();Object.defineProperty(Out,"__esModule",{value:!0});Out.AutorunObserver=void 0;var uR=Ev(),PNe=a4();function zYs(t){switch(t){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(zYs,"autorunStateToString");var Qpr=class{static{a(this,"AutorunObserver")}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,r,n,o){this._debugNameData=e,this._runFn=r,this._changeTracker=n,this._state=2,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._iteration=0,this._store=void 0,this._delayedStore=void 0,this._changeSummary=this._changeTracker?.createChangeSummary(void 0),(0,PNe.getLogger)()?.handleAutorunCreated(this,o),this._run(),(0,uR.trackDisposable)(this)}dispose(){if(!this._disposed){this._disposed=!0;for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),(0,PNe.getLogger)()?.handleAutorunDisposed(this),(0,uR.markAsDisposed)(this)}}_run(){let e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){(0,PNe.getLogger)()?.handleAutorunStarted(this);let r=this._changeSummary,n=this._delayedStore;n!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,r),this._changeSummary=this._changeTracker.createChangeSummary(r)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,r)}catch(o){(0,uR.onBugIndicatingError)(o)}finally{this._isRunning=!1,n!==void 0&&n.dispose()}}}finally{this._disposed||(0,PNe.getLogger)()?.handleAutorunFinished(this);for(let r of this._dependenciesToBeRemoved)r.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){this._state===3&&(this._checkIterations(),this._state=1),this._updateCount++}endUpdate(e){try{if(this._updateCount===1){this._iteration=1;do{if(this._checkIterations())return;if(this._state===1){this._state=3;for(let r of this._dependencies)if(r.reportChanges(),this._state===2)break}this._iteration++,this._state!==3&&this._run()}while(this._state!==3)}}finally{this._updateCount--}(0,uR.assertFn)(()=>this._updateCount>=0)}handlePossibleChange(e){this._state===3&&this._isDependency(e)&&(this._checkIterations(),this._state=1)}handleChange(e,r){if(this._isDependency(e)){(0,PNe.getLogger)()?.handleAutorunDependencyChanged(this,e,r);try{(!this._changeTracker||this._changeTracker.handleChange({changedObservable:e,change:r,didChange:a(o=>o===e,"didChange")},this._changeSummary))&&(this._checkIterations(),this._state=2)}catch(n){(0,uR.onBugIndicatingError)(n)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new uR.BugIndicatingError("The reader object cannot be used outside its compute function!")}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);let r=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),r}get store(){if(this._ensureNoRunning(),this._disposed)throw new uR.BugIndicatingError("Cannot access store after dispose");return this._store===void 0&&(this._store=new uR.DisposableStore),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new uR.BugIndicatingError("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new uR.DisposableStore),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:zYs(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}_checkIterations(){return this._iteration>100?((0,uR.onBugIndicatingError)(new uR.BugIndicatingError(`Autorun '${this.debugName}' is stuck in an infinite update loop.`)),!0):!1}};Out.AutorunObserver=Qpr});var ree=I(dR=>{"use strict";p();Object.defineProperty(dR,"__esModule",{value:!0});dR.autorun=Hpr;dR.autorunOpts=DNe;dR.autorunHandleChanges=Oti;dR.autorunWithStoreHandleChanges=JYs;dR.autorunWithStore=ZYs;dR.autorunDelta=XYs;dR.autorunIterableDelta=eKs;dR.autorunPerKeyedItem=tKs;dR.autorunSelfDisposable=rKs;dR.registerAutorunSelfDisposable=nKs;var bme=Ev(),qpr=HT(),jpr=Lut(),Sme=GT(),YYs=P8(),KYs=k8();function Hpr(t,e=Sme.DebugLocation.ofCaller()){return new jpr.AutorunObserver(new qpr.DebugNameData(void 0,void 0,t),t,void 0,e)}a(Hpr,"autorun");function DNe(t,e,r=Sme.DebugLocation.ofCaller()){return new jpr.AutorunObserver(new qpr.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,void 0,r)}a(DNe,"autorunOpts");function Oti(t,e,r=Sme.DebugLocation.ofCaller()){return new jpr.AutorunObserver(new qpr.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,t.changeTracker,r)}a(Oti,"autorunHandleChanges");function JYs(t,e){let r=new bme.DisposableStore,n=Oti({owner:t.owner,debugName:t.debugName,debugReferenceFn:t.debugReferenceFn??e,changeTracker:t.changeTracker},(o,s)=>{r.clear(),e(o,s,r)});return(0,bme.toDisposable)(()=>{n.dispose(),r.dispose()})}a(JYs,"autorunWithStoreHandleChanges");function ZYs(t){let e=new bme.DisposableStore,r=DNe({owner:void 0,debugName:void 0,debugReferenceFn:t},n=>{e.clear(),t(n,e)});return(0,bme.toDisposable)(()=>{r.dispose(),e.dispose()})}a(ZYs,"autorunWithStore");function XYs(t,e){let r;return DNe({debugReferenceFn:e},n=>{let o=t.read(n),s=r;r=o,e({lastValue:s,newValue:o})})}a(XYs,"autorunDelta");function eKs(t,e,r=n=>n){let n=new Map;return DNe({debugReferenceFn:t},o=>{let s=new Map,c=new Map(n);for(let l of t(o)){let u=r(l);n.has(u)?c.delete(u):(s.set(u,l),n.set(u,l))}for(let l of c.keys())n.delete(l);(s.size||c.size)&&e({addedValues:[...s.values()],removedValues:[...c.values()]})})}a(eKs,"autorunIterableDelta");function tKs(t,e,r,n=Sme.DebugLocation.ofCaller()){let o=new Map,s=DNe({debugReferenceFn:r},c=>{let l=t.read(c),u=new Set,d=[];(0,KYs.transaction)(f=>{for(let h of l){let m=e(h);u.add(m);let g=o.get(m);if(g)g.value.set(h,f);else{let A=new bme.DisposableStore,E={value:(0,YYs.observableValue)("keyedItem",h),store:A};o.set(m,E),d.push({key:m,cell:E})}}for(let[h,m]of o)u.has(h)||(m.store.dispose(),o.delete(h))});for(let{key:f,cell:h}of d)r(f,h.value,h.store)},n);return(0,bme.toDisposable)(()=>{s.dispose();for(let c of o.values())c.store.dispose();o.clear()})}a(tKs,"autorunPerKeyedItem");function rKs(t,e=Sme.DebugLocation.ofCaller()){let r,n=!1;return r=Hpr(o=>{t({delayedStore:o.delayedStore,store:o.store,readObservable:o.readObservable.bind(o),dispose:a(()=>{r?.dispose(),n=!0},"dispose")})},e),n&&r.dispose(),r}a(rKs,"autorunSelfDisposable");function nKs(t,e,r=Sme.DebugLocation.ofCaller()){let n,o=!1;n=Hpr(s=>{e({delayedStore:s.delayedStore,store:s.store,readObservable:s.readObservable.bind(s),dispose:a(()=>{n?t.delete(n):o=!0},"dispose")})},r),o?n.dispose():t.add(n)}a(nKs,"registerAutorunSelfDisposable")});var Ime=I(Tme=>{"use strict";p();Object.defineProperty(Tme,"__esModule",{value:!0});Tme.DerivedWithSetter=Tme.Derived=void 0;var iKs=J2(),nee=Ev(),Gpr=a4();function oKs(t){switch(t){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(oKs,"derivedStateToString");var But=class extends iKs.BaseObservable{static{a(this,"Derived")}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,r,n,o=void 0,s,c){super(c),this._debugNameData=e,this._computeFn=r,this._changeTracker=n,this._handleLastObserverRemoved=o,this._equalityComparator=s,this._state=0,this._value=void 0,this._updateCount=0,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._changeSummary=void 0,this._isUpdating=!1,this._isComputing=!1,this._didReportChange=!1,this._isInBeforeUpdate=!1,this._isReaderValid=!1,this._store=void 0,this._delayedStore=void 0,this._removedObserverToCallEndUpdateOn=null,this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}onLastObserverRemoved(){this._state=0,this._value=void 0,(0,Gpr.getLogger)()?.handleDerivedCleared(this);for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._delayedStore!==void 0&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._isComputing,this._observers.size===0){let r;try{this._isReaderValid=!0;let n;this._changeTracker&&(n=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,n)),r=this._computeFn(this,n)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),r}else{do{if(this._state===1){for(let r of this._dependencies)if(r.reportChanges(),this._state===2)break}this._state===1&&(this._state=3),this._state!==3&&this._recompute()}while(this._state!==3);return this._value}}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;let r=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=r;try{let n=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,n),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(n));let o=this._state!==0,s=this._value;this._state=3;let c=this._delayedStore;c!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,n)}finally{this._isReaderValid=!1;for(let l of this._dependenciesToBeRemoved)l.removeObserver(this);this._dependenciesToBeRemoved.clear(),c!==void 0&&c.dispose()}e=this._didReportChange||o&&!this._equalityComparator(s,this._value),(0,Gpr.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:o})}catch(n){(0,nee.onBugIndicatingError)(n)}if(this._isComputing=!1,!this._didReportChange&&e)for(let n of this._observers)n.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new nee.BugIndicatingError("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{let r=this._updateCount===1;if(this._state===3&&(this._state=1,!r))for(let n of this._observers)n.handlePossibleChange(this);if(r)for(let n of this._observers)n.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,this._updateCount===0){let r=[...this._observers];for(let n of r)n.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){let n=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(let o of n)o.endUpdate(this)}}(0,nee.assertFn)(()=>this._updateCount>=0)}handlePossibleChange(e){if(this._state===3&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=1;for(let r of this._observers)r.handlePossibleChange(this)}}handleChange(e,r){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){(0,Gpr.getLogger)()?.handleDerivedDependencyChanged(this,e,r);let n=!1;try{n=this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:r,didChange:a(s=>s===e,"didChange")},this._changeSummary):!0}catch(s){(0,nee.onBugIndicatingError)(s)}let o=this._state===3;if(n&&(this._state===1||o)&&(this._state=2,o))for(let s of this._observers)s.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new nee.BugIndicatingError("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);let r=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),r}reportChange(e){this._ensureReaderValid(),this._didReportChange=!0;for(let r of this._observers)r.handleChange(this,e)}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new nee.DisposableStore),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new nee.DisposableStore),this._delayedStore}addObserver(e){let r=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),r&&(this._removedObserverToCallEndUpdateOn?.delete(e)||e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:oKs(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this.beginUpdate(this);try{this._isComputing?this._state=2:this._recompute()}finally{this.endUpdate(this)}}setValue(e,r,n){this._value=e;let o=this._observers;r.updateObserver(this,this);for(let s of o)s.handleChange(this,n)}};Tme.Derived=But;var $pr=class extends But{static{a(this,"DerivedWithSetter")}constructor(e,r,n,o=void 0,s,c,l){super(e,r,n,o,s,l),this.set=c}};Tme.DerivedWithSetter=$pr});var Fut=I($H=>{"use strict";p();Object.defineProperty($H,"__esModule",{value:!0});$H.derived=aKs;$H.derivedWithSetter=cKs;$H.derivedOpts=Lti;$H.derivedHandleChanges=lKs;$H.derivedWithStore=uKs;$H.derivedDisposable=dKs;var l4=Ev(),xme=GT(),iee=HT(),sKs=J2(),oee=Ime();function aKs(t,e,r=xme.DebugLocation.ofCaller()){return e!==void 0?new oee.Derived(new iee.DebugNameData(t,void 0,e),e,void 0,void 0,l4.strictEquals,r):new oee.Derived(new iee.DebugNameData(void 0,void 0,t),t,void 0,void 0,l4.strictEquals,r)}a(aKs,"derived");function cKs(t,e,r,n=xme.DebugLocation.ofCaller()){return new oee.DerivedWithSetter(new iee.DebugNameData(t,void 0,e),e,void 0,void 0,l4.strictEquals,r,n)}a(cKs,"derivedWithSetter");function Lti(t,e,r=xme.DebugLocation.ofCaller()){return new oee.Derived(new iee.DebugNameData(t.owner,t.debugName,t.debugReferenceFn),e,void 0,t.onLastObserverRemoved,t.equalsFn??l4.strictEquals,r)}a(Lti,"derivedOpts");(0,sKs._setDerivedOpts)(Lti);function lKs(t,e,r=xme.DebugLocation.ofCaller()){return new oee.Derived(new iee.DebugNameData(t.owner,t.debugName,void 0),e,t.changeTracker,void 0,t.equalityComparer??l4.strictEquals,r)}a(lKs,"derivedHandleChanges");function uKs(t,e,r=xme.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s=new l4.DisposableStore;return new oee.Derived(new iee.DebugNameData(o,void 0,n),c=>(s.isDisposed?s=new l4.DisposableStore:s.clear(),n(c,s)),void 0,()=>s.dispose(),l4.strictEquals,r)}a(uKs,"derivedWithStore");function dKs(t,e,r=xme.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s;return new oee.Derived(new iee.DebugNameData(o,void 0,n),c=>{s?s.clear():s=new l4.DisposableStore;let l=n(c);return l&&s.add(l),l},void 0,()=>{s&&(s.dispose(),s=void 0)},l4.strictEquals,r)}a(dKs,"derivedDisposable")});var Uti=I(fR=>{"use strict";p();Object.defineProperty(fR,"__esModule",{value:!0});fR.ObservableLazyPromise=fR.ObservableResolvedPromise=fR.PromiseResult=fR.ObservablePromise=fR.ObservableLazy=void 0;var fKs=ree(),Bti=k8(),Fti=Fut(),Uut=P8(),Qut=class{static{a(this,"ObservableLazy")}get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=(0,Uut.observableValue)(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}};fR.ObservableLazy=Qut;var qut=class t{static{a(this,"ObservablePromise")}static fromFn(e){return new t(e())}static resolved(e){return new t(Promise.resolve(e))}constructor(e){this._value=(0,Uut.observableValue)(this,void 0),this.promiseResult=this._value,this.resolvedValue=(0,Fti.derived)(this,r=>{let n=this.promiseResult.read(r);if(n)return n.getDataOrThrow()}),this.promise=e.then(r=>((0,Bti.transaction)(n=>{this._value.set(new NNe(r,void 0),n)}),r),r=>{throw(0,Bti.transaction)(n=>{this._value.set(new NNe(void 0,r),n)}),r})}};fR.ObservablePromise=qut;var NNe=class{static{a(this,"PromiseResult")}constructor(e,r){this.data=e,this.error=r}getDataOrThrow(){if(this.error)throw this.error;return this.data}};fR.PromiseResult=NNe;var Vpr=class{static{a(this,"ObservableResolvedPromise")}constructor(e,r,n){this._isResolving=(0,Uut.observableValue)(this,!1),this.isResolving=this._isResolving,this._lastResolved=(0,Uut.observableValue)(this,r),this.lastResolved=this._lastResolved,n.add((0,fKs.autorun)(o=>{let s=e.read(o);this._runningPromise=s;let c=s.promiseResult.read(o);c?s===this._runningPromise&&(this._isResolving.set(!1,void 0),this._lastResolved.set(c.getDataOrThrow(),void 0)):this._isResolving.set(!0,void 0)}))}};fR.ObservableResolvedPromise=Vpr;var Wpr=class{static{a(this,"ObservableLazyPromise")}constructor(e){this._computePromise=e,this._lazyValue=new Qut(()=>new qut(this._computePromise())),this.cachedPromiseResult=(0,Fti.derived)(this,r=>this._lazyValue.cachedValue.read(r)?.promiseResult.read(r))}getPromise(){return this._lazyValue.getValue().promise}};fR.ObservableLazyPromise=Wpr});var Ypr=I(u4=>{"use strict";p();Object.defineProperty(u4,"__esModule",{value:!0});u4.cancelOnDispose=u4.CancellationTokenSource=u4.CancellationToken=u4.CancellationError=void 0;var pKs=Rs();Object.defineProperty(u4,"CancellationError",{enumerable:!0,get:a(function(){return pKs.CancellationError},"get")});var zpr=n2();Object.defineProperty(u4,"CancellationToken",{enumerable:!0,get:a(function(){return zpr.CancellationToken},"get")});Object.defineProperty(u4,"CancellationTokenSource",{enumerable:!0,get:a(function(){return zpr.CancellationTokenSource},"get")});Object.defineProperty(u4,"cancelOnDispose",{enumerable:!0,get:a(function(){return zpr.cancelOnDispose},"get")})});var Qti=I(jut=>{"use strict";p();Object.defineProperty(jut,"__esModule",{value:!0});jut.waitForState=EKs;jut.derivedWithCancellationToken=_Ks;var hKs=HT(),Kpr=Ypr(),mKs=Ev(),gKs=ree(),AKs=Ime(),yKs=GT();function EKs(t,e,r,n){return e||(e=a(o=>o!=null,"predicate")),new Promise((o,s)=>{let c=!0,l=!1,u=t.map(f=>({isFinished:e(f),error:r?r(f):!1,state:f})),d=(0,gKs.autorun)(f=>{let{isFinished:h,error:m,state:g}=u.read(f);(h||m)&&(c?l=!0:d.dispose(),m?s(m===!0?g:m):o(g))});if(n){let f=n.onCancellationRequested(()=>{d.dispose(),f.dispose(),s(new Kpr.CancellationError)});if(n.isCancellationRequested){d.dispose(),f.dispose(),s(new Kpr.CancellationError);return}}c=!1,l&&d.dispose()})}a(EKs,"waitForState");function _Ks(t,e){let r,n;e===void 0?(r=t,n=void 0):(n=t,r=e);let o;return new AKs.Derived(new hKs.DebugNameData(n,void 0,r),s=>(o&&o.dispose(!0),o=new Kpr.CancellationTokenSource,r(s,o.token)),void 0,()=>o?.dispose(),mKs.strictEquals,yKs.DebugLocation.ofCaller())}a(_Ks,"derivedWithCancellationToken")});var VH=I(see=>{"use strict";p();Object.defineProperty(see,"__esModule",{value:!0});see.FromEventObservable=void 0;see.observableFromEvent=Jpr;see.observableFromEventOpts=bKs;var vKs=k8(),jti=Ev(),Hti=HT(),qti=a4(),CKs=J2(),Gti=GT();function Jpr(...t){let e,r,n,o;return t.length===2?[r,n]=t:[e,r,n,o]=t,new Z2(new Hti.DebugNameData(e,void 0,n),r,n,()=>Z2.globalTransaction,jti.strictEquals,o??Gti.DebugLocation.ofCaller())}a(Jpr,"observableFromEvent");function bKs(t,e,r,n=Gti.DebugLocation.ofCaller()){return new Z2(new Hti.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??r),e,r,()=>t.getTransaction?.()??Z2.globalTransaction,t.equalsFn??jti.strictEquals,n)}a(bKs,"observableFromEventOpts");var Z2=class extends CKs.BaseObservable{static{a(this,"FromEventObservable")}constructor(e,r,n,o,s,c){super(c),this._debugNameData=e,this.event=r,this._getValue=n,this._getTransaction=o,this._equalityComparator=s,this._hasValue=!1,this.handleEvent=l=>{let u=this._getValue(l),d=this._value,f=!this._hasValue||!this._equalityComparator(d,u),h=!1;f&&(this._value=u,this._hasValue&&(h=!0,(0,vKs.subtransaction)(this._getTransaction(),m=>{(0,qti.getLogger)()?.handleObservableUpdated(this,{oldValue:d,newValue:u,change:void 0,didChange:f,hadValue:this._hasValue});for(let g of this._observers)m.updateObserver(g,this),g.handleChange(this,void 0)},()=>{let m=this.getDebugName();return"Event fired"+(m?`: ${m}`:"")})),this._hasValue=!0),h||(0,qti.getLogger)()?.handleObservableUpdated(this,{oldValue:d,newValue:u,change:void 0,didChange:f,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){let e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}debugGetState(){return{value:this._value,hasValue:this._hasValue}}};see.FromEventObservable=Z2;(function(t){t.Observer=Z2;function e(r,n){let o=!1;Z2.globalTransaction===void 0&&(Z2.globalTransaction=r,o=!0);try{n()}finally{o&&(Z2.globalTransaction=void 0)}}a(e,"batchEventsGlobally"),t.batchEventsGlobally=e})(Jpr||(see.observableFromEvent=Jpr={}))});var Xpr=I(Zpr=>{"use strict";p();Object.defineProperty(Zpr,"__esModule",{value:!0});Zpr.observableSignal=wKs;var SKs=k8(),TKs=HT(),IKs=J2(),xKs=GT();function wKs(t,e=xKs.DebugLocation.ofCaller()){return typeof t=="string"?new Hut(t,void 0,e):new Hut(void 0,t,e)}a(wKs,"observableSignal");var Hut=class extends IKs.BaseObservable{static{a(this,"ObservableSignal")}get debugName(){return new TKs.DebugNameData(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}constructor(e,r,n){super(n),this._debugName=e,this._owner=r}trigger(e,r){if(!e){(0,SKs.transaction)(n=>{this.trigger(n,r)},()=>`Trigger signal ${this.debugName}`);return}for(let n of this._observers)e.updateObserver(n,this),n.handleChange(this,r)}get(){}}});var $ut=I(NE=>{"use strict";p();Object.defineProperty(NE,"__esModule",{value:!0});NE.KeepAliveObserver=void 0;NE.observableFromPromise=RKs;NE.signalFromObservable=kKs;NE.debouncedObservable=PKs;NE.throttledObservable=DKs;NE.debouncedObservable2=NKs;NE.wasEventTriggeredRecently=MKs;NE.keepObserved=Kti;NE.recomputeInitiallyAndOnChange=Jti;NE.derivedObservableWithCache=OKs;NE.derivedObservableWithWritableCache=LKs;NE.mapObservableArrayCached=BKs;NE.isObservable=FKs;var $ti=ree(),Vti=P8(),ehr=Ev(),ONe=Fut(),Wti=VH(),zti=Xpr(),Yti=J2(),thr=GT();function RKs(t){let e=(0,Vti.observableValue)("promiseValue",{});return t.then(r=>{e.set({value:r},void 0)}),e}a(RKs,"observableFromPromise");function kKs(t,e){return(0,ONe.derivedOpts)({owner:t,equalsFn:a(()=>!1,"equalsFn")},r=>{e.read(r)})}a(kKs,"signalFromObservable");function PKs(t,e,r=thr.DebugLocation.ofCaller()){let n=!1,o,s;return(0,Wti.observableFromEvent)(void 0,c=>{let l=(0,$ti.autorun)(u=>{let d=t.read(u);if(!n)n=!0,o=d;else{s&&clearTimeout(s);let f=typeof e=="number"?e:e(o,d);if(f===0){o=d,c();return}s=setTimeout(()=>{o=d,c()},f)}});return{dispose(){l.dispose(),n=!1,o=void 0}}},()=>n?o:t.get(),r)}a(PKs,"debouncedObservable");function DKs(t,e,r=thr.DebugLocation.ofCaller()){let n=!1,o,s;return(0,Wti.observableFromEvent)(void 0,c=>{let l=(0,$ti.autorun)(u=>{let d=t.read(u);n?s||(s=setTimeout(()=>{s=void 0,o=t.read(void 0),c()},e)):(n=!0,o=d)});return{dispose(){l.dispose(),s&&(clearTimeout(s),s=void 0),n=!1,o=void 0}}},()=>n?o:t.get(),r)}a(DKs,"throttledObservable");function NKs(t,e,r=thr.DebugLocation.ofCaller()){let n=(0,zti.observableSignal)("handleTimeout"),o,s;return(0,ONe.derivedOpts)({owner:void 0,onLastObserverRemoved:a(()=>{o=void 0},"onLastObserverRemoved")},l=>{let u=t.read(l);if(n.read(l),u!==o){let d=typeof e=="number"?e:e(o,u);if(d===0)return o=u,u;s&&clearTimeout(s),s=setTimeout(()=>{o=u,n.trigger(void 0)},d)}return o},r)}a(NKs,"debouncedObservable2");function MKs(t,e,r){let n=(0,Vti.observableValue)("triggeredRecently",!1),o;return r.add(t(()=>{n.set(!0,void 0),o&&clearTimeout(o),o=setTimeout(()=>{n.set(!1,void 0)},e)})),n}a(MKs,"wasEventTriggeredRecently");function Kti(t){let e=new MNe(!1,void 0);return t.addObserver(e),(0,ehr.toDisposable)(()=>{t.removeObserver(e)})}a(Kti,"keepObserved");(0,Yti._setKeepObserved)(Kti);function Jti(t,e){let r=new MNe(!0,e);t.addObserver(r);try{r.beginUpdate(t)}finally{r.endUpdate(t)}return(0,ehr.toDisposable)(()=>{t.removeObserver(r)})}a(Jti,"recomputeInitiallyAndOnChange");(0,Yti._setRecomputeInitiallyAndOnChange)(Jti);var MNe=class{static{a(this,"KeepAliveObserver")}constructor(e,r){this._forceRecompute=e,this._handleValue=r,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter===1&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,r){}};NE.KeepAliveObserver=MNe;function OKs(t,e){let r;return(0,ONe.derivedOpts)({owner:t,debugReferenceFn:e},o=>(r=e(o,r),r))}a(OKs,"derivedObservableWithCache");function LKs(t,e){let r,n=(0,zti.observableSignal)("derivedObservableWithWritableCache"),o=(0,ONe.derived)(t,s=>(n.read(s),r=e(s,r),r));return Object.assign(o,{clearCache:a(s=>{r=void 0,n.trigger(s)},"clearCache"),setCache:a((s,c)=>{r=s,n.trigger(c)},"setCache")})}a(LKs,"derivedObservableWithWritableCache");function BKs(t,e,r,n){let o=new Gut(r,n);return(0,ONe.derivedOpts)({debugReferenceFn:r,owner:t,onLastObserverRemoved:a(()=>{o.dispose(),o=new Gut(r)},"onLastObserverRemoved")},c=>{let l=e.read(c);return o.setItems(l),o.getItems()})}a(BKs,"mapObservableArrayCached");var Gut=class{static{a(this,"ArrayMap")}constructor(e,r){this._map=e,this._keySelector=r,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){let r=[],n=new Set(this._cache.keys());for(let o of e){let s=this._keySelector?this._keySelector(o):o,c=this._cache.get(s);if(c)n.delete(s);else{let l=new ehr.DisposableStore;c={out:this._map(o,l),store:l},this._cache.set(s,c)}r.push(c.out)}for(let o of n)this._cache.get(o).store.dispose(),this._cache.delete(o);this._items=r}getItems(){return this._items}};function FKs(t){return!!t&&t.read!==void 0&&t.reportChanges!==void 0}a(FKs,"isObservable")});var Xti=I(Vut=>{"use strict";p();Object.defineProperty(Vut,"__esModule",{value:!0});Vut.recordChanges=UKs;Vut.recordChangesLazy=QKs;var Zti=Ev();function UKs(t){return{createChangeSummary:a(e=>({changes:[]}),"createChangeSummary"),handleChange(e,r){for(let n in t)e.didChange(t[n])&&r.changes.push({key:n,change:e.change});return!0},beforeUpdate(e,r){for(let n in t){if(n==="changes")throw new Zti.BugIndicatingError('property name "changes" is reserved for change tracking');r[n]=t[n].read(e)}}}}a(UKs,"recordChanges");function QKs(t){let e;return{createChangeSummary:a(r=>({changes:[]}),"createChangeSummary"),handleChange(r,n){e||(e=t());for(let o in e)r.didChange(e[o])&&n.changes.push({key:o,change:r.change});return!0},beforeUpdate(r,n){e||(e=t());for(let o in e){if(o==="changes")throw new Zti.BugIndicatingError('property name "changes" is reserved for change tracking');n[o]=e[o].read(r)}}}}a(QKs,"recordChangesLazy")});var eri=I(nhr=>{"use strict";p();Object.defineProperty(nhr,"__esModule",{value:!0});nhr.constObservable=jKs;var qKs=J2();function jKs(t){return new rhr(t)}a(jKs,"constObservable");var rhr=class extends qKs.ConvenientObservable{static{a(this,"ConstObservable")}constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}log(){return this}toString(){return`Const: ${this.value}`}}});var tri=I(ohr=>{"use strict";p();Object.defineProperty(ohr,"__esModule",{value:!0});ohr.observableSignalFromEvent=WKs;var HKs=k8(),GKs=HT(),$Ks=J2(),VKs=GT();function WKs(t,e,r=VKs.DebugLocation.ofCaller()){return new ihr(typeof t=="string"?t:new GKs.DebugNameData(t,void 0,void 0),e,r)}a(WKs,"observableSignalFromEvent");var ihr=class extends $Ks.BaseObservable{static{a(this,"FromEventObservableSignal")}constructor(e,r,n){super(n),this.event=r,this.handleEvent=()=>{(0,HKs.transaction)(o=>{for(let s of this._observers)o.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)},this.debugName=typeof e=="string"?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}});var rri=I(LNe=>{"use strict";p();Object.defineProperty(LNe,"__esModule",{value:!0});LNe.ValueWithChangeEventFromObservable=void 0;LNe.observableFromValueWithChangeEvent=KKs;var zKs=Ev(),YKs=VH(),Wut=class{static{a(this,"ValueWithChangeEventFromObservable")}constructor(e){this.observable=e}get onDidChange(){return zKs.Event.fromObservableLight(this.observable)}get value(){return this.observable.get()}};LNe.ValueWithChangeEventFromObservable=Wut;function KKs(t,e){return e instanceof Wut?e.observable:(0,YKs.observableFromEvent)(t,e.onDidChange,()=>e.value)}a(KKs,"observableFromValueWithChangeEvent")});var ori=I(BNe=>{"use strict";p();Object.defineProperty(BNe,"__esModule",{value:!0});BNe.runOnChange=nri;BNe.runOnChangeWithStore=iri;BNe.runOnChangeWithCancellationToken=eJs;var JKs=Ypr(),ZKs=Ev(),XKs=ree();function nri(t,e){let r,n=!0;return(0,XKs.autorunWithStoreHandleChanges)({changeTracker:{createChangeSummary:a(()=>({deltas:[],didChange:!1}),"createChangeSummary"),handleChange:a((o,s)=>{if(o.didChange(t)){let c=o.change;c!==void 0&&s.deltas.push(c),s.didChange=!0}return!0},"handleChange")}},(o,s)=>{let c=t.read(o),l=r;s.didChange&&(r=c,e(c,l,s.deltas)),n&&(n=!1,r=c)})}a(nri,"runOnChange");function iri(t,e){let r=new ZKs.DisposableStore,n=nri(t,(o,s,c)=>{r.clear(),e(o,s,c,r)});return{dispose(){n.dispose(),r.dispose()}}}a(iri,"runOnChangeWithStore");function eJs(t,e){return iri(t,(r,n,o,s)=>{e(r,n,o,(0,JKs.cancelOnDispose)(s))})}a(eJs,"runOnChangeWithCancellationToken")});var cri=I(zut=>{"use strict";p();Object.defineProperty(zut,"__esModule",{value:!0});zut.latestChangedValue=iJs;zut.derivedConstOnceDefined=oJs;var sri=Ev(),ari=HT(),tJs=VH(),rJs=ree(),nJs=$ut();function iJs(t,e){if(e.length===0)throw new sri.BugIndicatingError;let r=!1,n,o=(0,tJs.observableFromEvent)(t,s=>{let c=new sri.DisposableStore;for(let l of e)c.add((0,rJs.autorunOpts)({debugName:a(()=>(0,ari.getDebugName)(o,new ari.DebugNameData(t,void 0,void 0))+".updateLastChangedValue","debugName")},u=>{r=!0,n=l.read(u),s()}));return c.add({dispose(){r=!1,n=void 0}}),c},()=>r?n:e[e.length-1].get());return o}a(iJs,"latestChangedValue");function oJs(t,e){return(0,nJs.derivedObservableWithCache)(t,(r,n)=>n??e(r))}a(oJs,"derivedConstOnceDefined")});var lri=I(Yut=>{"use strict";p();Object.defineProperty(Yut,"__esModule",{value:!0});Yut.ObservableSet=void 0;var sJs=Mut(),shr=class{static{a(this,"ObservableSet")}constructor(){this._data=new Set,this._obs=(0,sJs.observableValueOpts)({equalsFn:a(()=>!1,"equalsFn")},this),this.observable=this._obs}get size(){return this._data.size}has(e){return this._data.has(e)}add(e,r){return this._data.has(e)||(this._data.add(e),this._obs.set(this,r)),this}delete(e,r){let n=this._data.delete(e);return n&&this._obs.set(this,r),n}clear(e){this._data.size>0&&(this._data.clear(),this._obs.set(this,e))}forEach(e,r){this._data.forEach((n,o,s)=>{e.call(r,n,o,this)})}*entries(){for(let e of this._data)yield[e,e]}*keys(){yield*this._data.keys()}*values(){yield*this._data.values()}[Symbol.iterator](){return this.values()}get[Symbol.toStringTag](){return"ObservableSet"}};Yut.ObservableSet=shr});var uri=I(Kut=>{"use strict";p();Object.defineProperty(Kut,"__esModule",{value:!0});Kut.ObservableMap=void 0;var aJs=Mut(),ahr=class{static{a(this,"ObservableMap")}constructor(){this._data=new Map,this._obs=(0,aJs.observableValueOpts)({equalsFn:a(()=>!1,"equalsFn")},this),this.observable=this._obs}get size(){return this._data.size}has(e){return this._data.has(e)}get(e){return this._data.get(e)}set(e,r,n){let o=this._data.has(e),s=this._data.get(e);return(!o||s!==r)&&(this._data.set(e,r),this._obs.set(this,n)),this}delete(e,r){let n=this._data.delete(e);return n&&this._obs.set(this,r),n}clear(e){this._data.size>0&&(this._data.clear(),this._obs.set(this,e))}forEach(e,r){this._data.forEach((n,o,s)=>{e.call(r,n,o,this)})}*entries(){yield*this._data.entries()}*keys(){yield*this._data.keys()}*values(){yield*this._data.values()}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return"ObservableMap"}};Kut.ObservableMap=ahr});var Xut=I(Pme=>{"use strict";p();Object.defineProperty(Pme,"__esModule",{value:!0});Pme.ConsoleObservableLogger=void 0;Pme.logObservableToConsole=uJs;Pme.formatValue=kme;var cJs=a4(),lJs=HT(),dri=Ime(),Jut;function uJs(t){Jut||(Jut=new Zut,(0,cJs.addLogger)(Jut)),Jut.addFilteredObj(t)}a(uJs,"logObservableToConsole");var Zut=class{static{a(this,"ConsoleObservableLogger")}constructor(){this.indentation=0,this.changedObservablesSets=new WeakMap}addFilteredObj(e){this._filteredObjects||(this._filteredObjects=new Set),this._filteredObjects.add(e)}_isIncluded(e){return this._filteredObjects?.has(e)??!0}textToConsoleArgs(e){return dJs([wme(hJs("| ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[wme(" "),pR(kme(e.oldValue,70),{color:"red",strikeThrough:!0}),wme(" "),pR(kme(e.newValue,60),{color:"green"})]:[wme(" (unchanged)")]:[wme(" "),pR(kme(e.newValue,60),{color:"green"}),wme(" (initial)")]}handleObservableCreated(e){if(e instanceof dri.Derived){let r=e;if(this.changedObservablesSets.set(r,new Set),!1){let o=[];r.__debugUpdating=o;let s=r.beginUpdate;r.beginUpdate=l=>(o.push(l),s.apply(r,[l]));let c=r.endUpdate;r.endUpdate=l=>{let u=o.indexOf(l);return u===-1&&console.error("endUpdate called without beginUpdate",r.debugName,l.debugName),o.splice(u,1),c.apply(r,[l])}}}}handleOnListenerCountChanged(e,r){}handleObservableUpdated(e,r){if(this._isIncluded(e)){if(e instanceof dri.Derived){this._handleDerivedRecomputed(e,r);return}console.log(...this.textToConsoleArgs([Rme("observable value changed"),pR(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r)]))}}formatChanges(e){if(e.size!==0)return pR(" (changed deps: "+[...e].map(r=>r.debugName).join(", ")+")",{color:"gray"})}handleDerivedDependencyChanged(e,r,n){this._isIncluded(e)&&this.changedObservablesSets.get(e)?.add(r)}_handleDerivedRecomputed(e,r){if(!this._isIncluded(e))return;let n=this.changedObservablesSets.get(e);n&&(console.log(...this.textToConsoleArgs([Rme("derived recomputed"),pR(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r),this.formatChanges(n),{data:[{fn:e._debugNameData.referenceFn??e._computeFn}]}])),n.clear())}handleDerivedCleared(e){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Rme("derived cleared"),pR(e.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(e,r){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Rme("observable from event triggered"),pR(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r),{data:[{fn:e._getValue}]}]))}handleAutorunCreated(e){this._isIncluded(e)&&this.changedObservablesSets.set(e,new Set)}handleAutorunDisposed(e){}handleAutorunDependencyChanged(e,r,n){this._isIncluded(e)&&this.changedObservablesSets.get(e).add(r)}handleAutorunStarted(e){let r=this.changedObservablesSets.get(e);r&&(this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Rme("autorun"),pR(e.debugName,{color:"BlueViolet"}),this.formatChanges(r),{data:[{fn:e._debugNameData.referenceFn??e._runFn}]}])),r.clear(),this.indentation++)}handleAutorunFinished(e){this.indentation--}handleBeginTransaction(e){let r=e.getDebugName();r===void 0&&(r=""),this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Rme("transaction"),pR(r,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}};Pme.ConsoleObservableLogger=Zut;function dJs(t){let e=new Array,r=[],n="";function o(c){if("length"in c)for(let l of c)l&&o(l);else"text"in c?(n+=`%c${c.text}`,e.push(c.style),c.data&&r.push(...c.data)):"data"in c&&r.push(...c.data)}a(o,"process"),o(t);let s=[n,...e];return s.push(...r),s}a(dJs,"consoleTextToArgs");function wme(t){return pR(t,{color:"black"})}a(wme,"normalText");function Rme(t){return pR(mJs(`${t}: `,10),{color:"black",bold:!0})}a(Rme,"formatKind");function pR(t,e={color:"black"}){function r(o){return Object.entries(o).reduce((s,[c,l])=>`${s}${c}:${l};`,"")}a(r,"objToCss");let n={color:e.color};return e.strikeThrough&&(n["text-decoration"]="line-through"),e.bold&&(n["font-weight"]="bold"),{text:t,style:r(n)}}a(pR,"styled");function kme(t,e){switch(typeof t){case"number":return""+t;case"string":return t.length+2<=e?`"${t}"`:`"${t.substr(0,e-7)}"+...`;case"boolean":return t?"true":"false";case"undefined":return"undefined";case"object":return t===null?"null":Array.isArray(t)?fJs(t,e):pJs(t,e);case"symbol":return t.toString();case"function":return`[[Function${t.name?" "+t.name:""}]]`;default:return""+t}}a(kme,"formatValue");function fJs(t,e){let r="[ ",n=!0;for(let o of t){if(n||(r+=", "),r.length-5>e){r+="...";break}n=!1,r+=`${kme(o,e-r.length)}`}return r+=" ]",r}a(fJs,"formatArray");function pJs(t,e){if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString){let s=t.toString();return s.length<=e?s:s.substring(0,e-3)+"..."}let r=(0,lJs.getClassName)(t),n=r?r+"(":"{ ",o=!0;for(let[s,c]of Object.entries(t)){if(o||(n+=", "),n.length-5>e){n+="...";break}o=!1,n+=`${s}: ${kme(c,e-n.length)}`}return n+=r?")":" }",n}a(pJs,"formatObject");function hJs(t,e){let r="";for(let n=1;n<=e;n++)r+=t;return r}a(hJs,"repeat");function mJs(t,e){for(;t.length{"use strict";p();Object.defineProperty(edt,"__esModule",{value:!0});edt.SimpleTypedRpcConnection=void 0;var chr=class t{static{a(this,"SimpleTypedRpcConnection")}static createHost(e,r){return new t(e,r)}static createClient(e,r){return new t(e,r)}constructor(e,r){this._channelFactory=e,this._getHandler=r,this._channel=this._channelFactory({handleNotification:a(s=>{let c=s,l=this._getHandler().notifications[c[0]];if(!l)throw new Error(`Unknown notification "${c[0]}"!`);l(...c[1])},"handleNotification"),handleRequest:a(s=>{let c=s;try{return{type:"result",value:this._getHandler().requests[c[0]](...c[1])}}catch(l){return{type:"error",value:l}}},"handleRequest")});let n=new Proxy({},{get:a((s,c)=>async(...l)=>{let u=await this._channel.sendRequest([c,l]);if(u.type==="error")throw u.value;return u.value},"get")}),o=new Proxy({},{get:a((s,c)=>(...l)=>{this._channel.sendNotification([c,l])},"get")});this.api={notifications:o,requests:n}}};edt.SimpleTypedRpcConnection=chr});var pri=I(lhr=>{"use strict";p();Object.defineProperty(lhr,"__esModule",{value:!0});lhr.registerDebugChannel=AJs;var gJs=fri();function AJs(t,e){let r=globalThis,n=[],o,{channel:s,handler:c}=yJs({sendNotification:a(u=>{o?o.sendNotification(u):n.push(u)},"sendNotification")}),l;return(r.$$debugValueEditor_debugChannels??(r.$$debugValueEditor_debugChannels={}))[t]=u=>{l=e(),o=u;for(let d of n)u.sendNotification(d);return n=[],c},gJs.SimpleTypedRpcConnection.createClient(s,()=>{if(!l)throw new Error("Not supported");return l})}a(AJs,"registerDebugChannel");function yJs(t){let e;return{channel:a(n=>(e=n,{sendNotification:a(o=>{t.sendNotification(o)},"sendNotification"),sendRequest:a(o=>{throw new Error("not supported")},"sendRequest")}),"channel"),handler:{handleRequest:a(n=>n.type==="notification"?e?.handleNotification(n.data):e?.handleRequest(n.data),"handleRequest")}}}a(yJs,"createChannelFactoryFromDebugChannel")});var gri=I(WH=>{"use strict";p();Object.defineProperty(WH,"__esModule",{value:!0});WH.Throttler=WH.Debouncer=void 0;WH.deepAssign=hri;WH.deepAssignDeleteNulls=mri;var uhr=class{static{a(this,"Debouncer")}constructor(){this._timeout=void 0}debounce(e,r){this._timeout!==void 0&&clearTimeout(this._timeout),this._timeout=setTimeout(()=>{this._timeout=void 0,e()},r)}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}};WH.Debouncer=uhr;var dhr=class{static{a(this,"Throttler")}constructor(){this._timeout=void 0}throttle(e,r){this._timeout===void 0&&(this._timeout=setTimeout(()=>{this._timeout=void 0,e()},r))}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}};WH.Throttler=dhr;function hri(t,e){for(let r in e)t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?hri(t[r],e[r]):t[r]=e[r]}a(hri,"deepAssign");function mri(t,e){for(let r in e)e[r]===null?delete t[r]:t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?mri(t[r],e[r]):t[r]=e[r]}a(mri,"deepAssignDeleteNulls")});var Eri=I(rdt=>{"use strict";p();Object.defineProperty(rdt,"__esModule",{value:!0});rdt.DevToolsLogger=void 0;var Ari=Lut(),tdt=Xut(),EJs=pri(),fhr=gri(),FNe=nT(),_Js=VH(),aee=Rs(),cee=Ime(),yri=P8(),vJs=GT(),phr=class t{static{a(this,"DevToolsLogger")}static{this._instance=void 0}static getInstance(){return t._instance===void 0&&(t._instance=new t),t._instance}getTransactionState(){let e=[],r=[...this._activeTransactions];if(r.length===0)return;let n=r.flatMap(s=>s.debugGetUpdatingObservers()??[]).map(s=>s.observer),o=new Set;for(;n.length>0;){let s=n.shift();if(o.has(s))continue;o.add(s);let c=this._getInfo(s,l=>{o.has(l)||n.push(l)});c&&e.push(c)}return{names:r.map(s=>s.getDebugName()??"tx"),affected:e}}_getObservableInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,aee.onUnexpectedError)(new aee.BugIndicatingError("No info found"));return}return r}_getAutorunInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,aee.onUnexpectedError)(new aee.BugIndicatingError("No info found"));return}return r}_getInfo(e,r){if(e instanceof cee.Derived){let n=[...e.debugGetObservers()];for(let u of n)r(u);let o=this._getObservableInfo(e);if(!o)return;let s=e.debugGetState(),c={name:e.debugName,instanceId:o.instanceId,updateCount:s.updateCount},l=[...o.changedObservables].map(u=>this._instanceInfos.get(u)?.instanceId).filter(FNe.isDefined);if(s.isComputing)return{...c,type:"observable/derived",state:"updating",changedDependencies:l,initialComputation:!1};switch(s.state){case 0:return{...c,type:"observable/derived",state:"noValue"};case 3:return{...c,type:"observable/derived",state:"upToDate"};case 2:return{...c,type:"observable/derived",state:"stale",changedDependencies:l};case 1:return{...c,type:"observable/derived",state:"possiblyStale"}}}else if(e instanceof Ari.AutorunObserver){let n=this._getAutorunInfo(e);if(!n)return;let o={name:e.debugName,instanceId:n.instanceId,updateCount:n.updateCount},s=[...n.changedObservables].map(c=>this._instanceInfos.get(c).instanceId);if(e.debugGetState().isRunning)return{...o,type:"autorun",state:"updating",changedDependencies:s};switch(e.debugGetState().state){case 3:return{...o,type:"autorun",state:"upToDate"};case 2:return{...o,type:"autorun",state:"stale",changedDependencies:s};case 1:return{...o,type:"autorun",state:"possiblyStale"}}}}_formatObservable(e){let r=this._getObservableInfo(e);if(r)return{name:e.debugName,instanceId:r.instanceId}}_formatObserver(e){if(e instanceof cee.Derived)return{name:e.toString(),instanceId:this._getObservableInfo(e)?.instanceId};let r=this._getAutorunInfo(e);if(r)return{name:e.toString(),instanceId:r.instanceId}}constructor(){this._declarationId=0,this._instanceId=0,this._declarations=new Map,this._instanceInfos=new WeakMap,this._aliveInstances=new Map,this._activeTransactions=new Set,this._channel=(0,EJs.registerDebugChannel)("observableDevTools",()=>({notifications:{setDeclarationIdFilter:a(e=>{},"setDeclarationIdFilter"),logObservableValue:a(e=>{console.log("logObservableValue",e)},"logObservableValue"),flushUpdates:a(()=>{this._flushUpdates()},"flushUpdates"),resetUpdates:a(()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)},"resetUpdates")},requests:{getDeclarations:a(()=>{let e={};for(let r of this._declarations.values())e[r.id]=r;return{decls:e}},"getDeclarations"),getSummarizedInstances:a(()=>null,"getSummarizedInstances"),getObservableValueInfo:a(e=>({observers:[...this._aliveInstances.get(e).debugGetObservers()].map(n=>this._formatObserver(n)).filter(FNe.isDefined)}),"getObservableValueInfo"),getDerivedInfo:a(e=>{let r=this._aliveInstances.get(e);return{dependencies:[...r.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(FNe.isDefined),observers:[...r.debugGetObservers()].map(n=>this._formatObserver(n)).filter(FNe.isDefined)}},"getDerivedInfo"),getAutorunInfo:a(e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(FNe.isDefined)}),"getAutorunInfo"),getTransactionState:a(()=>this.getTransactionState(),"getTransactionState"),setValue:a((e,r)=>{let n=this._aliveInstances.get(e);if(n instanceof cee.Derived)n.debugSetValue(r);else if(n instanceof yri.ObservableValue)n.debugSetValue(r);else if(n instanceof _Js.FromEventObservable)n.debugSetValue(r);else throw new aee.BugIndicatingError("Observable is not supported");let o=[...n.debugGetObservers()];for(let s of o)s.beginUpdate(n);for(let s of o)s.handleChange(n,void 0);for(let s of o)s.endUpdate(n)},"setValue"),getValue:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof cee.Derived)return(0,tdt.formatValue)(r.debugGetState().value,200);if(r instanceof yri.ObservableValue)return(0,tdt.formatValue)(r.debugGetState().value,200)},"getValue"),logValue:a(e=>{let r=this._aliveInstances.get(e);if(r&&"get"in r)console.log("Logged Value:",r.get());else throw new aee.BugIndicatingError("Observable is not supported")},"logValue"),rerun:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof cee.Derived)r.debugRecompute();else if(r instanceof Ari.AutorunObserver)r.debugRerun();else throw new aee.BugIndicatingError("Observable is not supported")},"rerun")}})),this._pendingChanges=null,this._changeThrottler=new fhr.Throttler,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},vJs.DebugLocation.enable()}_handleChange(e){(0,fhr.deepAssignDeleteNulls)(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:(0,fhr.deepAssign)(this._pendingChanges,e),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(e,r){if(!r)return-1;let n=this._declarations.get(r.id);return n===void 0&&(n={id:this._declarationId++,type:e,url:r.fileName,line:r.line,column:r.column},this._declarations.set(r.id,n),this._handleChange({decls:{[n.id]:n}})),n.id}handleObservableCreated(e,r){let o={declarationId:this._getDeclarationId("observable/value",r),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,o)}handleOnListenerCountChanged(e,r){let n=this._getObservableInfo(e);if(n){if(n.listenerCount===0&&r>0){let o=e instanceof cee.Derived?"observable/derived":"observable/value";this._aliveInstances.set(n.instanceId,e),this._handleChange({instances:{[n.instanceId]:{instanceId:n.instanceId,declarationId:n.declarationId,formattedValue:n.lastValue,type:o,name:e.debugName}}})}else n.listenerCount>0&&r===0&&(this._handleChange({instances:{[n.instanceId]:null}}),this._aliveInstances.delete(n.instanceId));n.listenerCount=r}}handleObservableUpdated(e,r){if(e instanceof cee.Derived){this._handleDerivedRecomputed(e,r);return}let n=this._getObservableInfo(e);n&&r.didChange&&(n.lastValue=(0,tdt.formatValue)(r.newValue,30),n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:n.lastValue}}}))}handleAutorunCreated(e,r){let o={declarationId:this._getDeclarationId("autorun",r),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,o),this._aliveInstances.set(o.instanceId,e),o&&this._handleChange({instances:{[o.instanceId]:{instanceId:o.instanceId,declarationId:o.declarationId,runCount:0,type:"autorun",name:e.debugName}}})}handleAutorunDisposed(e){let r=this._getAutorunInfo(e);r&&(this._handleChange({instances:{[r.instanceId]:null}}),this._instanceInfos.delete(e),this._aliveInstances.delete(r.instanceId))}handleAutorunDependencyChanged(e,r,n){let o=this._getAutorunInfo(e);o&&o.changedObservables.add(r)}handleAutorunStarted(e){}handleAutorunFinished(e){let r=this._getAutorunInfo(e);r&&(r.changedObservables.clear(),r.updateCount++,this._handleChange({instances:{[r.instanceId]:{runCount:r.updateCount}}}))}handleDerivedDependencyChanged(e,r,n){let o=this._getObservableInfo(e);o&&o.changedObservables.add(r)}_handleDerivedRecomputed(e,r){let n=this._getObservableInfo(e);if(!n)return;let o=(0,tdt.formatValue)(r.newValue,30);n.updateCount++,n.changedObservables.clear(),n.lastValue=o,n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:o,recomputationCount:n.updateCount}}})}handleDerivedCleared(e){let r=this._getObservableInfo(e);r&&(r.lastValue=void 0,r.changedObservables.clear(),r.listenerCount>0&&this._handleChange({instances:{[r.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(e){this._activeTransactions.add(e)}handleEndTransaction(e){this._activeTransactions.delete(e)}};rdt.DevToolsLogger=phr});var bri=I(hhr=>{"use strict";p();Object.defineProperty(hhr,"__esModule",{value:!0});hhr.debugGetObservableGraph=IJs;var CJs=Ime(),bJs=VH(),SJs=P8(),TJs=Lut(),_ri=Xut();function IJs(t,e){let r=e?.debugNamePostProcessor??(s=>s),n=lee.from(t,r);if(!n)return"";let o=new Set;return e.type==="observers"?Cri(n,0,o,e).trim():vri(n,0,o,e).trim()}a(IJs,"debugGetObservableGraph");function vri(t,e,r,n){let o=" ".repeat(e),s=[];if(r.has(t.sourceObj))return s.push(`${o}* ${t.type} ${t.name} (already listed)`),s.join(` +`);if(r.add(t.sourceObj),s.push(`${o}* ${t.type} ${t.name}:`),s.push(`${o} value: ${(0,_ri.formatValue)(t.value,50)}`),s.push(`${o} state: ${t.state}`),t.dependencies.length>0){s.push(`${o} dependencies:`);for(let l of t.dependencies){let u=lee.from(l,n.debugNamePostProcessor??(d=>d))??lee.unknown(l);s.push(vri(u,e+1,r,n))}}return s.join(` +`)}a(vri,"formatObservableInfoWithDependencies");function Cri(t,e,r,n){let o=" ".repeat(e),s=[];if(r.has(t.sourceObj))return s.push(`${o}* ${t.type} ${t.name} (already listed)`),s.join(` +`);if(r.add(t.sourceObj),s.push(`${o}* ${t.type} ${t.name}:`),s.push(`${o} value: ${(0,_ri.formatValue)(t.value,50)}`),s.push(`${o} state: ${t.state}`),t.observers.length>0){s.push(`${o} observers:`);for(let l of t.observers){let u=lee.from(l,n.debugNamePostProcessor??(d=>d))??lee.unknown(l);s.push(Cri(u,e+1,r,n))}}return s.join(` +`)}a(Cri,"formatObservableInfoWithObservers");var lee=class t{static{a(this,"Info")}static from(e,r){if(e instanceof TJs.AutorunObserver){let n=e.debugGetState();return new t(e,r(e.debugName),"autorun",void 0,n.stateStr,Array.from(n.dependencies),[])}else if(e instanceof CJs.Derived){let n=e.debugGetState();return new t(e,r(e.debugName),"derived",n.value,n.stateStr,Array.from(n.dependencies),Array.from(e.debugGetObservers()))}else if(e instanceof SJs.ObservableValue){let n=e.debugGetState();return new t(e,r(e.debugName),"observableValue",n.value,"upToDate",[],Array.from(e.debugGetObservers()))}else if(e instanceof bJs.FromEventObservable){let n=e.debugGetState();return new t(e,r(e.debugName),"fromEvent",n.value,n.hasValue?"upToDate":"initial",[],Array.from(e.debugGetObservers()))}}static unknown(e){return new t(e,"(unknown)","unknown",void 0,"unknown",[],[])}constructor(e,r,n,o,s,c,l){this.sourceObj=e,this.name=r,this.type=n,this.value=o,this.state=s,this.dependencies=c,this.observers=l}}});var D8=I(Ut=>{"use strict";p();Object.defineProperty(Ut,"__esModule",{value:!0});Ut.ValueWithChangeEventFromObservable=Ut.observableFromValueWithChangeEvent=Ut.TransactionImpl=Ut.transaction=Ut.subtransaction=Ut.globalTransaction=Ut.asyncTransaction=Ut.observableSignalFromEvent=Ut.observableFromEventOpts=Ut.observableSignal=Ut.constObservable=Ut.recordChangesLazy=Ut.recordChanges=Ut.isObservable=Ut.wasEventTriggeredRecently=Ut.throttledObservable=Ut.signalFromObservable=Ut.recomputeInitiallyAndOnChange=Ut.observableFromPromise=Ut.mapObservableArrayCached=Ut.keepObserved=Ut.derivedObservableWithWritableCache=Ut.derivedObservableWithCache=Ut.debouncedObservable2=Ut.debouncedObservable=Ut.waitForState=Ut.derivedWithCancellationToken=Ut.PromiseResult=Ut.ObservableResolvedPromise=Ut.ObservablePromise=Ut.ObservableLazyPromise=Ut.ObservableLazy=Ut.derivedWithStore=Ut.derivedWithSetter=Ut.derivedOpts=Ut.derivedHandleChanges=Ut.derivedDisposable=Ut.derived=Ut.disposableObservableValue=Ut.registerAutorunSelfDisposable=Ut.autorunSelfDisposable=Ut.autorunPerKeyedItem=Ut.autorunIterableDelta=Ut.autorunWithStoreHandleChanges=Ut.autorunWithStore=Ut.autorunOpts=Ut.autorunHandleChanges=Ut.autorunDelta=Ut.autorun=Ut.observableValueOpts=void 0;Ut.DebugLocation=Ut.ObservableMap=Ut.ObservableSet=Ut.observableValue=Ut.observableFromEvent=Ut.latestChangedValue=Ut.derivedConstOnceDefined=Ut.runOnChangeWithStore=Ut.runOnChangeWithCancellationToken=Ut.runOnChange=void 0;var xJs=Mut();Object.defineProperty(Ut,"observableValueOpts",{enumerable:!0,get:a(function(){return xJs.observableValueOpts},"get")});var d4=ree();Object.defineProperty(Ut,"autorun",{enumerable:!0,get:a(function(){return d4.autorun},"get")});Object.defineProperty(Ut,"autorunDelta",{enumerable:!0,get:a(function(){return d4.autorunDelta},"get")});Object.defineProperty(Ut,"autorunHandleChanges",{enumerable:!0,get:a(function(){return d4.autorunHandleChanges},"get")});Object.defineProperty(Ut,"autorunOpts",{enumerable:!0,get:a(function(){return d4.autorunOpts},"get")});Object.defineProperty(Ut,"autorunWithStore",{enumerable:!0,get:a(function(){return d4.autorunWithStore},"get")});Object.defineProperty(Ut,"autorunWithStoreHandleChanges",{enumerable:!0,get:a(function(){return d4.autorunWithStoreHandleChanges},"get")});Object.defineProperty(Ut,"autorunIterableDelta",{enumerable:!0,get:a(function(){return d4.autorunIterableDelta},"get")});Object.defineProperty(Ut,"autorunPerKeyedItem",{enumerable:!0,get:a(function(){return d4.autorunPerKeyedItem},"get")});Object.defineProperty(Ut,"autorunSelfDisposable",{enumerable:!0,get:a(function(){return d4.autorunSelfDisposable},"get")});Object.defineProperty(Ut,"registerAutorunSelfDisposable",{enumerable:!0,get:a(function(){return d4.registerAutorunSelfDisposable},"get")});var wJs=P8();Object.defineProperty(Ut,"disposableObservableValue",{enumerable:!0,get:a(function(){return wJs.disposableObservableValue},"get")});var Dme=Fut();Object.defineProperty(Ut,"derived",{enumerable:!0,get:a(function(){return Dme.derived},"get")});Object.defineProperty(Ut,"derivedDisposable",{enumerable:!0,get:a(function(){return Dme.derivedDisposable},"get")});Object.defineProperty(Ut,"derivedHandleChanges",{enumerable:!0,get:a(function(){return Dme.derivedHandleChanges},"get")});Object.defineProperty(Ut,"derivedOpts",{enumerable:!0,get:a(function(){return Dme.derivedOpts},"get")});Object.defineProperty(Ut,"derivedWithSetter",{enumerable:!0,get:a(function(){return Dme.derivedWithSetter},"get")});Object.defineProperty(Ut,"derivedWithStore",{enumerable:!0,get:a(function(){return Dme.derivedWithStore},"get")});var UNe=Uti();Object.defineProperty(Ut,"ObservableLazy",{enumerable:!0,get:a(function(){return UNe.ObservableLazy},"get")});Object.defineProperty(Ut,"ObservableLazyPromise",{enumerable:!0,get:a(function(){return UNe.ObservableLazyPromise},"get")});Object.defineProperty(Ut,"ObservablePromise",{enumerable:!0,get:a(function(){return UNe.ObservablePromise},"get")});Object.defineProperty(Ut,"ObservableResolvedPromise",{enumerable:!0,get:a(function(){return UNe.ObservableResolvedPromise},"get")});Object.defineProperty(Ut,"PromiseResult",{enumerable:!0,get:a(function(){return UNe.PromiseResult},"get")});var Tri=Qti();Object.defineProperty(Ut,"derivedWithCancellationToken",{enumerable:!0,get:a(function(){return Tri.derivedWithCancellationToken},"get")});Object.defineProperty(Ut,"waitForState",{enumerable:!0,get:a(function(){return Tri.waitForState},"get")});var hR=$ut();Object.defineProperty(Ut,"debouncedObservable",{enumerable:!0,get:a(function(){return hR.debouncedObservable},"get")});Object.defineProperty(Ut,"debouncedObservable2",{enumerable:!0,get:a(function(){return hR.debouncedObservable2},"get")});Object.defineProperty(Ut,"derivedObservableWithCache",{enumerable:!0,get:a(function(){return hR.derivedObservableWithCache},"get")});Object.defineProperty(Ut,"derivedObservableWithWritableCache",{enumerable:!0,get:a(function(){return hR.derivedObservableWithWritableCache},"get")});Object.defineProperty(Ut,"keepObserved",{enumerable:!0,get:a(function(){return hR.keepObserved},"get")});Object.defineProperty(Ut,"mapObservableArrayCached",{enumerable:!0,get:a(function(){return hR.mapObservableArrayCached},"get")});Object.defineProperty(Ut,"observableFromPromise",{enumerable:!0,get:a(function(){return hR.observableFromPromise},"get")});Object.defineProperty(Ut,"recomputeInitiallyAndOnChange",{enumerable:!0,get:a(function(){return hR.recomputeInitiallyAndOnChange},"get")});Object.defineProperty(Ut,"signalFromObservable",{enumerable:!0,get:a(function(){return hR.signalFromObservable},"get")});Object.defineProperty(Ut,"throttledObservable",{enumerable:!0,get:a(function(){return hR.throttledObservable},"get")});Object.defineProperty(Ut,"wasEventTriggeredRecently",{enumerable:!0,get:a(function(){return hR.wasEventTriggeredRecently},"get")});Object.defineProperty(Ut,"isObservable",{enumerable:!0,get:a(function(){return hR.isObservable},"get")});var Iri=Xti();Object.defineProperty(Ut,"recordChanges",{enumerable:!0,get:a(function(){return Iri.recordChanges},"get")});Object.defineProperty(Ut,"recordChangesLazy",{enumerable:!0,get:a(function(){return Iri.recordChangesLazy},"get")});var RJs=eri();Object.defineProperty(Ut,"constObservable",{enumerable:!0,get:a(function(){return RJs.constObservable},"get")});var kJs=Xpr();Object.defineProperty(Ut,"observableSignal",{enumerable:!0,get:a(function(){return kJs.observableSignal},"get")});var PJs=VH();Object.defineProperty(Ut,"observableFromEventOpts",{enumerable:!0,get:a(function(){return PJs.observableFromEventOpts},"get")});var DJs=tri();Object.defineProperty(Ut,"observableSignalFromEvent",{enumerable:!0,get:a(function(){return DJs.observableSignalFromEvent},"get")});var QNe=k8();Object.defineProperty(Ut,"asyncTransaction",{enumerable:!0,get:a(function(){return QNe.asyncTransaction},"get")});Object.defineProperty(Ut,"globalTransaction",{enumerable:!0,get:a(function(){return QNe.globalTransaction},"get")});Object.defineProperty(Ut,"subtransaction",{enumerable:!0,get:a(function(){return QNe.subtransaction},"get")});Object.defineProperty(Ut,"transaction",{enumerable:!0,get:a(function(){return QNe.transaction},"get")});Object.defineProperty(Ut,"TransactionImpl",{enumerable:!0,get:a(function(){return QNe.TransactionImpl},"get")});var xri=rri();Object.defineProperty(Ut,"observableFromValueWithChangeEvent",{enumerable:!0,get:a(function(){return xri.observableFromValueWithChangeEvent},"get")});Object.defineProperty(Ut,"ValueWithChangeEventFromObservable",{enumerable:!0,get:a(function(){return xri.ValueWithChangeEventFromObservable},"get")});var mhr=ori();Object.defineProperty(Ut,"runOnChange",{enumerable:!0,get:a(function(){return mhr.runOnChange},"get")});Object.defineProperty(Ut,"runOnChangeWithCancellationToken",{enumerable:!0,get:a(function(){return mhr.runOnChangeWithCancellationToken},"get")});Object.defineProperty(Ut,"runOnChangeWithStore",{enumerable:!0,get:a(function(){return mhr.runOnChangeWithStore},"get")});var wri=cri();Object.defineProperty(Ut,"derivedConstOnceDefined",{enumerable:!0,get:a(function(){return wri.derivedConstOnceDefined},"get")});Object.defineProperty(Ut,"latestChangedValue",{enumerable:!0,get:a(function(){return wri.latestChangedValue},"get")});var NJs=VH();Object.defineProperty(Ut,"observableFromEvent",{enumerable:!0,get:a(function(){return NJs.observableFromEvent},"get")});var MJs=P8();Object.defineProperty(Ut,"observableValue",{enumerable:!0,get:a(function(){return MJs.observableValue},"get")});var OJs=lri();Object.defineProperty(Ut,"ObservableSet",{enumerable:!0,get:a(function(){return OJs.ObservableSet},"get")});var LJs=uri();Object.defineProperty(Ut,"ObservableMap",{enumerable:!0,get:a(function(){return LJs.ObservableMap},"get")});var BJs=GT();Object.defineProperty(Ut,"DebugLocation",{enumerable:!0,get:a(function(){return BJs.DebugLocation},"get")});var ghr=a4(),Rri=Xut(),FJs=Eri(),Sri=Swe(),UJs=J2(),QJs=bri();(0,UJs._setDebugGetObservableGraph)(QJs.debugGetObservableGraph);(0,ghr.setLogObservableFn)(Rri.logObservableToConsole);var qJs=!1;qJs&&(0,ghr.addLogger)(new Rri.ConsoleObservableLogger);Sri.env&&Sri.env.VSCODE_DEV_DEBUG_OBSERVABLES&&(0,ghr.addLogger)(FJs.DevToolsLogger.getInstance())});var Ed=I(Nme=>{"use strict";p();Object.defineProperty(Nme,"__esModule",{value:!0});Nme.OffsetRangeSet=Nme.OffsetRange=void 0;var ndt=Rs(),idt=class t{static{a(this,"OffsetRange")}static fromTo(e,r){return new t(e,r)}static equals(e,r){return e.start===r.start&&e.endExclusive===r.endExclusive}static addRange(e,r){let n=0;for(;nr))return new t(e,r)}static ofLength(e){return new t(0,e)}static ofStartAndLength(e,r){return new t(e,e+r)}static emptyAt(e){return new t(e,e)}constructor(e,r){if(this.start=e,this.endExclusive=r,e>r)throw new ndt.BugIndicatingError(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new t(this.start+e,this.endExclusive+e)}deltaStart(e){return new t(this.start+e,this.endExclusive)}deltaEnd(e){return new t(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new ndt.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new ndt.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){let r=[];for(let n=this.start;ne.toString()).join(", ")}intersectsStrict(e){let r=0;for(;re+r.length,0)}};Nme.OffsetRangeSet=Ahr});var X2=I(Lme=>{"use strict";p();Object.defineProperty(Lme,"__esModule",{value:!0});Lme.LineRangeSet=Lme.LineRange=void 0;var kri=Rs(),jJs=Ed(),Pri=nh(),Mme=Qq(),Dri=Sl(),Ome=class t{static{a(this,"LineRange")}static ofLength(e,r){return new t(e,e+r)}static fromRange(e){return new t(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new t(e.startLineNumber,e.endLineNumber+1)}static{this.compareByStart=(0,Dri.compareBy)(e=>e.startLineNumber,Dri.numberComparator)}static subtract(e,r){return r?e.startLineNumberr)throw new kri.BugIndicatingError(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=(0,Mme.findLastIdxMonotonous)(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)this._normalizedRanges.splice(r,0,e);else if(r===n-1){let o=this._normalizedRanges[r];this._normalizedRanges[r]=o.join(e)}else{let o=this._normalizedRanges[r].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(r,n-r,o)}}contains(e){let r=(0,Mme.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=(0,Mme.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;let r=[],n=0,o=0,s=null;for(;n=c.startLineNumber?s=new Ome(s.startLineNumber,Math.max(s.endLineNumberExclusive,c.endLineNumberExclusive)):(r.push(s),s=c)}return s!==null&&r.push(s),new t(r)}subtractFrom(e){let r=(0,Mme.findFirstIdxMonotonousOrArrLen)(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=(0,Mme.findLastIdxMonotonous)(this._normalizedRanges,c=>c.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)return new t([e]);let o=[],s=e.startLineNumber;for(let c=r;cs&&o.push(new Ome(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};Lme.LineRangeSet=qNe});var Bme=I(sdt=>{"use strict";p();Object.defineProperty(sdt,"__esModule",{value:!0});sdt.TextLength=void 0;var HJs=X2(),Nri=$_(),odt=nh(),yhr=class t{static{a(this,"TextLength")}static{this.zero=new t(0,0)}static lengthDiffNonNegative(e,r){return r.isLessThan(e)?t.zero:e.lineCount===r.lineCount?new t(0,r.columnCount-e.columnCount):new t(r.lineCount-e.lineCount,r.columnCount)}static betweenPositions(e,r){return e.lineNumber===r.lineNumber?new t(0,r.column-e.column):new t(r.lineNumber-e.lineNumber,r.column-1)}static fromPosition(e){return new t(e.lineNumber-1,e.column-1)}static ofRange(e){return t.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let r=0,n=0;for(let o of e)o===` +`?(r++,n=0):n++;return new t(r,n)}static ofSubstr(e,r){return t.ofText(r.substring(e))}static sum(e,r){return e.reduce((n,o)=>n.add(r(o)),t.zero)}constructor(e,r){this.lineCount=e,this.columnCount=r}isZero(){return this.lineCount===0&&this.columnCount===0}isLessThan(e){return this.lineCount!==e.lineCount?this.lineCounte.lineCount:this.columnCount>e.columnCount}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}equals(e){return this.lineCount===e.lineCount&&this.columnCount===e.columnCount}compare(e){return this.lineCount!==e.lineCount?this.lineCount-e.lineCount:this.columnCount-e.columnCount}add(e){return e.lineCount===0?new t(this.lineCount,this.columnCount+e.columnCount):new t(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new odt.Range(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new odt.Range(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new odt.Range(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return HJs.LineRange.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new Nri.Position(e.lineNumber,e.column+this.columnCount):new Nri.Position(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return odt.Range.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};sdt.TextLength=yhr});var cdt=I(uee=>{"use strict";p();Object.defineProperty(uee,"__esModule",{value:!0});uee.PositionOffsetTransformer=uee.PositionOffsetTransformerBase=void 0;uee._setPositionOffsetTransformerDependencies=WJs;var GJs=Qq(),$Js=Ed(),jNe=$_(),VJs=nh(),adt=class{static{a(this,"PositionOffsetTransformerBase")}getOffsetRange(e){return new $Js.OffsetRange(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return VJs.Range.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringEdit(e){let r=e.replacements.map(n=>this.getStringReplacement(n));return new N8.deps.StringEdit(r)}getStringReplacement(e){return new N8.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new N8.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){let r=e.replacements.map(n=>this.getTextReplacement(n));return new N8.deps.TextEdit(r)}};uee.PositionOffsetTransformerBase=adt;var N8=class{static{a(this,"Deps")}static{this._deps=void 0}static get deps(){if(!this._deps)throw new Error("Dependencies not set. Call _setDependencies first.");return this._deps}};function WJs(t){N8._deps=t}a(WJs,"_setPositionOffsetTransformerDependencies");var Ehr=class extends adt{static{a(this,"PositionOffsetTransformer")}constructor(e){super(),this.text=e}get lineStartOffsetByLineIdx(){return this._lineStartOffsetByLineIdx||this._computeLineOffsets(),this._lineStartOffsetByLineIdx}get lineEndOffsetByLineIdx(){return this._lineEndOffsetByLineIdx||this._computeLineOffsets(),this._lineEndOffsetByLineIdx}_computeLineOffsets(){this._lineStartOffsetByLineIdx=[],this._lineEndOffsetByLineIdx=[],this._lineStartOffsetByLineIdx.push(0);for(let e=0;e0&&this.text.charAt(e-1)==="\r"?this._lineEndOffsetByLineIdx.push(e-1):this._lineEndOffsetByLineIdx.push(e));this._lineEndOffsetByLineIdx.push(this.text.length)}getOffset(e){let r=this._validatePosition(e);return this.lineStartOffsetByLineIdx[r.lineNumber-1]+r.column-1}_validatePosition(e){if(e.lineNumber<1)return new jNe.Position(1,1);let r=this.textLength.lineCount+1;if(e.lineNumber>r){let o=this.getLineLength(r);return new jNe.Position(r,o+1)}if(e.column<1)return new jNe.Position(e.lineNumber,1);let n=this.getLineLength(e.lineNumber);return e.column-1>n?new jNe.Position(e.lineNumber,n+1):e}getPosition(e){let r=(0,GJs.findLastIdxMonotonous)(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new jNe.Position(n,o)}getTextLength(e){return N8.deps.TextLength.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new N8.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};uee.PositionOffsetTransformer=Ehr});var $T=I(f4=>{"use strict";p();Object.defineProperty(f4,"__esModule",{value:!0});f4.StringText=f4.ArrayText=f4.LineBasedText=f4.AbstractText=void 0;var zJs=sd(),YJs=om(),KJs=$_(),Mri=nh(),JJs=Bme(),Ori=cdt(),HNe=class{static{a(this,"AbstractText")}constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new KJs.Position(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getValueOfOffsetRange(e){return this.getValueOfRange(this.getTransformer().getRange(e))}getLineLength(e){return this.getValueOfRange(new Mri.Range(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new Ori.PositionOffsetTransformer(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new Mri.Range(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return(0,YJs.splitLines)(e)}getLinesOfRange(e){return e.mapToLineArray(r=>this.getLineAt(r))}equals(e){return this===e?!0:this.getValue()===e.getValue()}};f4.AbstractText=HNe;var ldt=class extends HNe{static{a(this,"LineBasedText")}constructor(e,r){(0,zJs.assert)(r>=1),super(),this._getLineContent=e,this._lineCount=r}getValueOfRange(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);let r=this._getLineContent(e.startLineNumber).substring(e.startColumn-1);for(let n=e.startLineNumber+1;ne[r-1],e.length)}};u4.ArrayText=Ypr;var Kpr=class extends RNe{static{a(this,"StringText")}constructor(e){super(),this.value=e,this._t=new Yti.PositionOffsetTransformer(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}getTransformer(){return this._t}};u4.StringText=Kpr});var Jti=I(d4=>{"use strict";p();Object.defineProperty(d4,"__esModule",{value:!0});d4.AnnotationReplacement=d4.Edit=d4.BaseReplacement=d4.BaseEdit=void 0;var EKs=Sl(),Kti=Rs(),sR=hd(),Jut=class{static{a(this,"BaseEdit")}constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new Kti.BugIndicatingError(`Edits must be disjoint and sorted. Found ${n} after ${r}`);r=n.replaceRange.endExclusive}}equals(e){if(this.replacements.length!==e.replacements.length)return!1;for(let r=0;rr.toString()).join(", ")}]`}normalize(){let e=[],r;for(let n of this.replacements)if(!(n.getNewLength()===0&&n.replaceRange.length===0)){if(r&&r.replaceRange.endExclusive===n.replaceRange.start){let o=r.tryJoinTouching(n);if(o){r=o;continue}}r&&e.push(r),r=n}return r&&e.push(r),this._createNew(e)}compose(e){let r=this.normalize(),n=e.normalize();if(r.isEmpty())return n;if(n.isEmpty())return r;let o=[...r.replacements],s=[],c=0;for(let l of n.replacements){for(;;){let h=o[0];if(!h||h.replaceRange.start+c+h.getNewLength()>=l.replaceRange.start)break;o.shift(),s.push(h),c+=h.getNewLength()-h.replaceRange.length}let u=c,d,f;for(;;){let h=o[0];if(!h||h.replaceRange.start+c>l.replaceRange.endExclusive)break;d||(d=h),f=h,o.shift(),c+=h.getNewLength()-h.replaceRange.length}if(!d)s.push(l.delta(-c));else{let h=Math.min(d.replaceRange.start,l.replaceRange.start-u),m=l.replaceRange.start-(d.replaceRange.start+u);if(m>0){let E=d.slice(sR.OffsetRange.emptyAt(h),new sR.OffsetRange(0,m));s.push(E)}if(!f)throw new Kti.BugIndicatingError("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(sR.OffsetRange.ofStartAndLength(f.replaceRange.endExclusive,0),new sR.OffsetRange(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new sR.OffsetRange(h,l.replaceRange.endExclusive-c),y=l.slice(A,new sR.OffsetRange(0,l.getNewLength()));s.push(y)}}for(;;){let l=o.shift();if(!l)break;s.push(l)}return this._createNew(s).normalize()}decomposeSplit(e){let r=[],n=[],o=0;for(let s of this.replacements)e(s)?(r.push(s),o+=s.getNewLength()-s.replaceRange.length):n.push(s.slice(s.replaceRange.delta(o),new sR.OffsetRange(0,s.getNewLength())));return{e1:this._createNew(r),e2:this._createNew(n)}}getNewRanges(){let e=[],r=0;for(let n of this.replacements)e.push(sR.OffsetRange.ofStartAndLength(n.replaceRange.start+r,n.getNewLength())),r+=n.getLengthDelta();return e}getJoinedReplaceRange(){if(this.replacements.length!==0)return this.replacements[0].replaceRange.join(this.replacements.at(-1).replaceRange)}isEmpty(){return this.replacements.length===0}getLengthDelta(){return(0,EKs.sumBy)(this.replacements,e=>e.getLengthDelta())}getNewDataLength(e){return e+this.getLengthDelta()}applyToOffset(e){let r=0;for(let n of this.replacements)if(n.replaceRange.start<=e){if(e ${this.getNewLength()} }`}get isEmpty(){return this.getNewLength()===0&&this.replaceRange.length===0}getRangeAfterReplace(){return new sR.OffsetRange(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}};d4.BaseReplacement=Zut;var Jpr=class t extends Jut{static{a(this,"Edit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}_createNew(e){return new t(e)}};d4.Edit=Jpr;var Zpr=class t extends Zut{static{a(this,"AnnotationReplacement")}constructor(e,r,n){super(e),this.newLength=r,this.annotation=n}equals(e){return this.replaceRange.equals(e.replaceRange)&&this.newLength===e.newLength&&this.annotation===e.annotation}getNewLength(){return this.newLength}tryJoinTouching(e){if(this.annotation===e.annotation)return new t(this.replaceRange.joinRightTouching(e.replaceRange),this.newLength+e.newLength,this.annotation)}slice(e,r){return new t(e,r?r.length:this.newLength,this.annotation)}};d4.AnnotationReplacement=Zpr});var kE=I(ny=>{"use strict";p();Object.defineProperty(ny,"__esModule",{value:!0});ny.AnnotatedStringReplacement=ny.AnnotatedStringEdit=ny.VoidEditData=ny.StringReplacement=ny.StringEdit=ny.BaseStringReplacement=ny.BaseStringEdit=void 0;ny.applyEditsToRanges=vKs;var Xut=em(),V2=hd(),_Ks=qT(),Xti=Jti(),kNe=class extends Xti.BaseEdit{static{a(this,"BaseStringEdit")}get TReplacement(){throw new Error("TReplacement is not defined for BaseStringEdit")}static composeOrUndefined(e){if(e.length===0)return;let r=e[0];for(let n=1;n" ".repeat(l-c)),o=r.tryRebase(n);if(!o)return;let s=e.tryRebase(o);if(s)return{e1:o,e2:s}}apply(e){let r=[],n=0;for(let o of this.replacements)r.push(e.substring(n,o.replaceRange.start)),r.push(o.newText),n=o.replaceRange.endExclusive;return r.push(e.substring(n)),r.join("")}inverseOnSlice(e){let r=[],n=0;for(let o of this.replacements)r.push(Av.replace(V2.OffsetRange.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new f4(r)}inverse(e){return this.inverseOnSlice((r,n)=>e.substring(r,n))}rebaseSkipConflicting(e){return this._tryRebase(e,!1)}tryRebase(e){return this._tryRebase(e,!0)}_tryRebase(e,r){let n=[],o=0,s=0,c=0;for(;se.toJson())}isNeutralOn(e){return this.replacements.every(r=>r.isNeutralOn(e))}removeCommonSuffixPrefix(e){let r=[];for(let n of this.replacements){let o=n.removeCommonSuffixPrefix(e);o.isEmpty||r.push(o)}return new f4(r)}normalizeEOL(e){return new f4(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=Av.replace(V2.OffsetRange.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?f4.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new _Ks.StringText(this.apply(e.value))}mapData(e){return new edt(this.replacements.map(r=>new aee(r.replaceRange,r.newText,e(r))))}};ny.BaseStringEdit=kNe;var PNe=class extends Xti.BaseReplacement{static{a(this,"BaseStringReplacement")}constructor(e,r){super(e),this.newText=r}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(e){return e.substring(0,this.replaceRange.start)+this.newText+e.substring(this.replaceRange.endExclusive)}isNeutralOn(e){return this.newText===e.substring(this.replaceRange.start,this.replaceRange.endExclusive)}removeCommonSuffixPrefix(e){let r=e.substring(this.replaceRange.start,this.replaceRange.endExclusive),n=(0,Xut.commonPrefixLength)(r,this.newText),o=Math.min(r.length-n,this.newText.length-n,(0,Xut.commonSuffixLength)(r,this.newText)),s=new V2.OffsetRange(this.replaceRange.start+n,this.replaceRange.endExclusive-o),c=this.newText.substring(n,this.newText.length-o);return new Av(s,c)}normalizeEOL(e){let r=this.newText.replace(/\r\n|\n/g,e);return new Av(this.replaceRange,r)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){let r=this.replaceRange.substring(e),n=(0,Xut.commonPrefixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaStart(n),new V2.OffsetRange(n,this.newText.length))}removeCommonSuffix(e){let r=this.replaceRange.substring(e),n=(0,Xut.commonSuffixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaEnd(-n),new V2.OffsetRange(0,this.newText.length-n))}toEdit(){return new f4([this])}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}};ny.BaseStringReplacement=PNe;var f4=class t extends kNe{static{a(this,"StringEdit")}static parse(e){let r=[],n=/\[(\d+),\s*(\d+)\)\s*->\s*"([^"]*)"/g,o;for(;(o=n.exec(e))!==null;){let s=parseInt(o[1],10),c=parseInt(o[2],10),l=o[3].replace(/\\n/g,` -`).replace(/\\r/g,"\r").replace(/\\\\/g,"\\");r.push(new Av(new V2.OffsetRange(s,c),l))}return new t(r)}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r){return new t([new Av(e,r)])}static insert(e,r){return new t([new Av(V2.OffsetRange.emptyAt(e),r)])}static delete(e){return new t([new Av(e,"")])}static fromJson(e){return new t(e.map(Av.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;n=o.replaceRange.start)break;t.shift(),r.push(c.delta(n))}let s=[];for(;;){let c=t[0];if(!c||!c.intersectsOrTouches(o.replaceRange))break;t.shift(),s.push(c)}for(let c=s.length-1;c>=0;c--){let l=s[c],u=l.intersect(o.replaceRange).length;l=l.deltaEnd(-u+(c===0?o.newText.length:0));let d=l.start-o.replaceRange.start;d>0&&(l=l.delta(-d)),c!==0&&(l=l.delta(o.newText.length)),l=l.delta(-(o.newText.length-o.replaceRange.length)),t.unshift(l)}n+=o.newText.length-o.replaceRange.length}for(;;){let o=t[0];if(!o)break;t.shift(),r.push(o.delta(n))}return r}a(vKs,"applyEditsToRanges");var Xpr=class{static{a(this,"VoidEditData")}join(e){return this}};ny.VoidEditData=Xpr;var edt=class t extends kNe{static{a(this,"AnnotatedStringEdit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r,n){return new t([new aee(e,r,n)])}static insert(e,r,n){return new t([new aee(V2.OffsetRange.emptyAt(e),r,n)])}static delete(e,r){return new t([new aee(e,"",r)])}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;n{"use strict";p();Object.defineProperty(tdt,"__esModule",{value:!0});tdt.LanguageId=void 0;var eri;(function(t){t.PlainText="plaintext";function e(r){return r}a(e,"create"),t.create=e})(eri||(tdt.LanguageId=eri={}))});var rri=I(BH=>{"use strict";p();Object.defineProperty(BH,"__esModule",{value:!0});BH.EditReasons=BH.TextModelEditReason=BH.EditReason=void 0;var ehr=class t{static{a(this,"EditReason")}static create(e){return e?new t(e):t.unknown}constructor(e){this.metadata=e}static{this.unknown=new t({source:"unknown",name:void 0})}toKey(e){return new DNe(this.metadata,tri).toKey(e)}};BH.EditReason=ehr;var tri=Symbol("TextModelEditReason"),DNe=class{static{a(this,"TextModelEditReason")}constructor(e,r){this.metadata=e}toString(){return`${this.metadata.source}`}getType(){let e=this.metadata;switch(e.source){case"cursor":return e.kind;case"inlineCompletionAccept":return e.source+(e.$nes?":nes":"");case"unknown":return e.name||"unknown";default:return e.source}}toKey(e){let r=this.metadata;return Object.entries(r).filter(([o,s])=>(o.match(/\$/g)||[]).length<=e&&s!==void 0&&s!==null&&s!=="").map(([o,s])=>`${o}:${s}`).join("-")}};BH.TextModelEditReason=DNe;function aR(t){return new DNe(t,tri)}a(aR,"createEditReason");BH.EditReasons={unknown(t){return aR({source:"unknown",name:t.name})},chatApplyEdits(t){return aR({source:"Chat.applyEdits",$modelId:t.modelId})},inlineCompletionAccept(t){return aR({source:"inlineCompletionAccept",$nes:t.nes,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineCompletionPartialAccept(t){return aR({source:"inlineCompletionPartialAccept",type:t.type,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineChatApplyEdit(t){return aR({source:"inlineChat.applyEdits",$modelId:t.modelId})},reloadFromDisk:a(()=>aR({source:"reloadFromDisk"}),"reloadFromDisk"),cursor(t){return aR({source:"cursor",kind:t.kind,detailedSource:t.detailedSource})},setValue:a(()=>aR({source:"setValue"}),"setValue"),eolChange:a(()=>aR({source:"eolChange"}),"eolChange"),applyEdits:a(()=>aR({source:"applyEdits"}),"applyEdits"),snippet:a(()=>aR({source:"snippet"}),"snippet"),suggest:a(t=>aR({source:"suggest",$extensionId:t.extensionId}),"suggest")}});var cee=I(p4=>{"use strict";p();Object.defineProperty(p4,"__esModule",{value:!0});p4.MutableObservableDocument=p4.MutableObservableWorkspace=p4.StringEditWithReason=p4.ObservableWorkspace=void 0;var bKs=rd(),nri=Ro(),yv=C8(),ori=kE(),SKs=hd(),TKs=qT(),IKs=rdt(),iri=rri(),ndt=class{static{a(this,"ObservableWorkspace")}constructor(){this._version=0,this.onDidOpenDocumentChange=(0,yv.derivedHandleChanges)({owner:this,changeTracker:{createChangeSummary:a(()=>({didChange:!1}),"createChangeSummary"),handleChange:a((e,r)=>(e.didChange(this.openDocuments)||(r.didChange=!0),!0),"handleChange")}},(e,r)=>{let n=this.openDocuments.read(e);for(let o of n)o.value.read(e);return r.didChange&&this._version++,this._version}),this.lastActiveDocument=(0,yv.derivedWithStore)((e,r)=>{let n=(0,yv.observableValue)("lastActiveDocument",void 0);return r.add((0,yv.autorunWithStore)((o,s)=>{let c=this.openDocuments.read(o);for(let l of c)s.add((0,yv.runOnChange)(l.value,()=>{n.set(l,void 0)}))})),n}).flatten()}getFirstOpenDocument(){return this.openDocuments.get()[0]}getDocument(e){return this.openDocuments.get().find(r=>r.id===e)}};p4.ObservableWorkspace=ndt;var Ime=class extends ori.StringEdit{static{a(this,"StringEditWithReason")}constructor(e,r){super(e),this.reason=r}};p4.StringEditWithReason=Ime;var thr=class extends ndt{static{a(this,"MutableObservableWorkspace")}constructor(){super(...arguments),this._openDocuments=(0,yv.observableValue)(this,[]),this.openDocuments=this._openDocuments,this._documents=new Map}addDocument(e,r=void 0){(0,bKs.assert)(!this._documents.has(e.id));let n=new idt(e.id,new TKs.StringText(e.initialValue??""),[],e.languageId??IKs.LanguageId.PlainText,()=>{this._documents.delete(e.id);let o=this._openDocuments.get(),s=o.filter(c=>c.id!==n.id);s.length!==o.length&&this._openDocuments.set(s,r,{added:[],removed:[n]})},e.initialVersionId??0,e.workspaceRoot);return this._documents.set(e.id,n),this._openDocuments.set([...this._openDocuments.get(),n],r,{added:[n],removed:[]}),n}getDocument(e){return this._documents.get(e)}clear(){this._openDocuments.set([],void 0,{added:[],removed:this._openDocuments.get()});for(let e of this._documents.values())e.dispose();this._documents.clear()}getWorkspaceRoot(e){return this._documents.get(e)?.workspaceRoot}};p4.MutableObservableWorkspace=thr;var idt=class extends nri.Disposable{static{a(this,"MutableObservableDocument")}get value(){return this._value}get selection(){return this._selection}get primarySelectionLine(){return this._primarySelectionLine}get visibleRanges(){return this._visibleRanges}get languageId(){return this._languageId}get version(){return this._version}get diagnostics(){return this._diagnostics}constructor(e,r,n,o,s,c,l){super(),this.id=e,this.workspaceRoot=l,this._value=(0,yv.observableValue)(this,r),this._selection=(0,yv.observableValue)(this,n),this._primarySelectionLine=(0,yv.observableValue)(this,void 0),this._visibleRanges=(0,yv.observableValue)(this,[]),this._languageId=(0,yv.observableValue)(this,o),this._version=(0,yv.observableValue)(this,c),this._diagnostics=(0,yv.observableValue)(this,[]),this._register((0,nri.toDisposable)(s))}setSelection(e,r=void 0,n){this._selection.set(e,r),this._primarySelectionLine.set(n,r)}setVisibleRange(e,r=void 0){this._visibleRanges.set(e,r)}applyEdit(e,r=void 0,n=void 0){let o=e.applyOnText(this.value.get()),s=e instanceof Ime?e:new Ime(e.replacements,iri.EditReason.unknown);(0,yv.subtransaction)(r,c=>{this._value.set(o,c,s),this._version.set(n??this._version.get()+1,c)})}updateSelection(e,r=void 0,n){this._selection.set(e,r),this._primarySelectionLine.set(n,r)}setValue(e,r=void 0,n=void 0){let o=iri.EditReason.unknown,s=new Ime([ori.StringReplacement.replace(new SKs.OffsetRange(0,this.value.get().value.length),e.value)],o);(0,yv.subtransaction)(r,c=>{this._value.set(e,c,s),this._version.set(n??this._version.get()+1,c)})}updateDiagnostics(e,r=void 0){this._diagnostics.set(e,r)}};p4.MutableObservableDocument=idt});var W2=I(lee=>{"use strict";p();var xKs=lee&&lee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wKs=lee&&lee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xKs(e,t,r)};Object.defineProperty(lee,"__esModule",{value:!0});wKs(C8(),lee)});var h4=I(rhr=>{"use strict";p();Object.defineProperty(rhr,"__esModule",{value:!0});rhr.autorunWithChanges=kKs;var RKs=W2();function kKs(t,e,r){let n=new Map(Object.entries(e).map(([s,c])=>[c,s])),o=new Map(Object.keys(e).map(s=>[s,void 0]));return(0,RKs.autorunHandleChanges)({owner:t,changeTracker:{createChangeSummary:a(()=>({}),"createChangeSummary"),handleChange:a((s,c)=>{let l=n.get(s.changedObservable);return c[l]===void 0&&(c[l]={value:void 0,changes:[]}),c[l].changes.push(s.change),!0},"handleChange")}},(s,c)=>{for(let[l,u]of Object.entries(e)){let d=u.read(s);c[l]===void 0&&(c[l]={value:d,changes:[],previous:o.get(l)}),c[l].value=d,c[l].previous=o.get(l)===void 0?void 0:o.get(l),o.set(l,d)}r(c)})}a(kKs,"autorunWithChanges")});var Za=I(oy=>{"use strict";p();var Phr=Symbol.for("yaml.alias"),hni=Symbol.for("yaml.document"),$dt=Symbol.for("yaml.map"),mni=Symbol.for("yaml.pair"),Dhr=Symbol.for("yaml.scalar"),Vdt=Symbol.for("yaml.seq"),x8=Symbol.for("yaml.node.type"),dZs=a(t=>!!t&&typeof t=="object"&&t[x8]===Phr,"isAlias"),fZs=a(t=>!!t&&typeof t=="object"&&t[x8]===hni,"isDocument"),pZs=a(t=>!!t&&typeof t=="object"&&t[x8]===$dt,"isMap"),hZs=a(t=>!!t&&typeof t=="object"&&t[x8]===mni,"isPair"),gni=a(t=>!!t&&typeof t=="object"&&t[x8]===Dhr,"isScalar"),mZs=a(t=>!!t&&typeof t=="object"&&t[x8]===Vdt,"isSeq");function Ani(t){if(t&&typeof t=="object")switch(t[x8]){case $dt:case Vdt:return!0}return!1}a(Ani,"isCollection");function gZs(t){if(t&&typeof t=="object")switch(t[x8]){case Phr:case $dt:case Dhr:case Vdt:return!0}return!1}a(gZs,"isNode");var AZs=a(t=>(gni(t)||Ani(t))&&!!t.anchor,"hasAnchor");oy.ALIAS=Phr;oy.DOC=hni;oy.MAP=$dt;oy.NODE_TYPE=x8;oy.PAIR=mni;oy.SCALAR=Dhr;oy.SEQ=Vdt;oy.hasAnchor=AZs;oy.isAlias=dZs;oy.isCollection=Ani;oy.isDocument=fZs;oy.isMap=pZs;oy.isNode=gZs;oy.isPair=hZs;oy.isScalar=gni;oy.isSeq=mZs});var HNe=I(Nhr=>{"use strict";p();var C0=Za(),Lb=Symbol("break visit"),yni=Symbol("skip children"),y4=Symbol("remove node");function Wdt(t,e){let r=Eni(e);C0.isDocument(t)?Nme(null,t.contents,r,Object.freeze([t]))===y4&&(t.contents=null):Nme(null,t,r,Object.freeze([]))}a(Wdt,"visit");Wdt.BREAK=Lb;Wdt.SKIP=yni;Wdt.REMOVE=y4;function Nme(t,e,r,n){let o=_ni(t,e,r,n);if(C0.isNode(o)||C0.isPair(o))return vni(t,n,o),Nme(t,o,r,n);if(typeof o!="symbol"){if(C0.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s{"use strict";p();var Cni=Za(),yZs=HNe(),EZs={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_Zs=a(t=>t.replace(/[!,[\]{}]/g,e=>EZs[e]),"escapeTagName"),GNe=class t{static{a(this,"Directives")}constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),o=n.shift();switch(o){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,c]=n;return this.tags[s]=c,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let c=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,c),!1}}default:return r(0,`Unknown directive ${o}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let c=e.slice(2,-1);return c==="!"||c==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),c)}let[,n,o]=e.match(/^(.*!)([^!]*)$/s);o||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(o)}catch(c){return r(String(c)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+_Zs(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),o;if(e&&n.length>0&&Cni.isNode(e.contents)){let s={};yZs.visit(e.contents,(c,l)=>{Cni.isNode(l)&&l.tag&&(s[l.tag]=!0)}),o=Object.keys(s)}else o=[];for(let[s,c]of n)s==="!!"&&c==="tag:yaml.org,2002:"||(!e||o.some(l=>l.startsWith(c)))&&r.push(`%TAG ${s} ${c}`);return r.join(` -`)}};GNe.defaultYaml={explicit:!1,version:"1.2"};GNe.defaultTags={"!!":"tag:yaml.org,2002:"};bni.Directives=GNe});var Ydt=I($Ne=>{"use strict";p();var Sni=Za(),vZs=HNe();function CZs(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}a(CZs,"anchorIsValid");function Tni(t){let e=new Set;return vZs.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}a(Tni,"anchorNames");function Ini(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}a(Ini,"findNewAnchor");function bZs(t,e){let r=[],n=new Map,o=null;return{onAnchor:a(s=>{r.push(s),o??(o=Tni(t));let c=Ini(e,o);return o.add(c),c},"onAnchor"),setAnchors:a(()=>{for(let s of r){let c=n.get(s);if(typeof c=="object"&&c.anchor&&(Sni.isScalar(c.node)||Sni.isCollection(c.node)))c.node.anchor=c.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},"setAnchors"),sourceObjects:n}}a(bZs,"createNodeAnchors");$Ne.anchorIsValid=CZs;$Ne.anchorNames=Tni;$Ne.createNodeAnchors=bZs;$Ne.findNewAnchor=Ini});var Ohr=I(xni=>{"use strict";p();function VNe(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let o=0,s=n.length;o{"use strict";p();var SZs=Za();function wni(t,e,r){if(Array.isArray(t))return t.map((n,o)=>wni(n,String(o),r));if(t&&typeof t.toJSON=="function"){if(!r||!SZs.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let o=t.toJSON(e,r);return r.onCreate&&r.onCreate(o),o}return typeof t=="bigint"&&!r?.keep?Number(t):t}a(wni,"toJS");Rni.toJS=wni});var Kdt=I(Pni=>{"use strict";p();var TZs=Ohr(),kni=Za(),IZs=qH(),Lhr=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,kni.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:o,reviver:s}={}){if(!kni.isDocument(e))throw new TypeError("A document argument is required");let c={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=IZs.toJS(this,"",c);if(typeof o=="function")for(let{count:u,res:d}of c.anchors.values())o(d,u);return typeof s=="function"?TZs.applyReviver(s,{"":l},"",l):l}};Pni.NodeBase=Lhr});var WNe=I(Dni=>{"use strict";p();var xZs=Ydt(),wZs=HNe(),Ome=Za(),RZs=Kdt(),kZs=qH(),Bhr=class extends RZs.NodeBase{static{a(this,"Alias")}constructor(e){super(Ome.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],wZs.visit(e,{Node:a((s,c)=>{(Ome.isAlias(c)||Ome.hasAnchor(c))&&n.push(c)},"Node")}),r&&(r.aliasResolveCache=n));let o;for(let s of n){if(s===this)break;s.anchor===this.source&&(o=s)}return o}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:o,maxAliasCount:s}=r,c=this.resolve(o,r);if(!c){let u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(u)}let l=n.get(c);if(l||(kZs.toJS(c,null,r),l=n.get(c)),l?.res===void 0){let u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=Jdt(o,c,n)),l.count*l.aliasCount>s)){let u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}return l.res}toString(e,r,n){let o=`*${this.source}`;if(e){if(xZs.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${o} `}return o}};function Jdt(t,e,r){if(Ome.isAlias(e)){let n=e.resolve(t),o=r&&n&&r.get(n);return o?o.count*o.aliasCount:0}else if(Ome.isCollection(e)){let n=0;for(let o of e.items){let s=Jdt(t,o,r);s>n&&(n=s)}return n}else if(Ome.isPair(e)){let n=Jdt(t,e.key,r),o=Jdt(t,e.value,r);return Math.max(n,o)}return 1}a(Jdt,"getAliasCount");Dni.Alias=Bhr});var mm=I(Fhr=>{"use strict";p();var PZs=Za(),DZs=Kdt(),NZs=qH(),MZs=a(t=>!t||typeof t!="function"&&typeof t!="object","isScalarValue"),jH=class extends DZs.NodeBase{static{a(this,"Scalar")}constructor(e){super(PZs.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:NZs.toJS(this.value,e,r)}toString(){return String(this.value)}};jH.BLOCK_FOLDED="BLOCK_FOLDED";jH.BLOCK_LITERAL="BLOCK_LITERAL";jH.PLAIN="PLAIN";jH.QUOTE_DOUBLE="QUOTE_DOUBLE";jH.QUOTE_SINGLE="QUOTE_SINGLE";Fhr.Scalar=jH;Fhr.isScalarValue=MZs});var zNe=I(Mni=>{"use strict";p();var OZs=WNe(),mee=Za(),Nni=mm(),LZs="tag:yaml.org,2002:";function BZs(t,e,r){if(e){let n=r.filter(s=>s.tag===e),o=n.find(s=>!s.format)??n[0];if(!o)throw new Error(`Tag ${e} not found`);return o}return r.find(n=>n.identify?.(t)&&!n.format)}a(BZs,"findTagObject");function FZs(t,e,r){if(mee.isDocument(t)&&(t=t.contents),mee.isNode(t))return t;if(mee.isPair(t)){let h=r.schema[mee.MAP].createNode?.(r.schema,null,r);return h.items.push(t),h}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:o,onTagObj:s,schema:c,sourceObjects:l}=r,u;if(n&&t&&typeof t=="object"){if(u=l.get(t),u)return u.anchor??(u.anchor=o(t)),new OZs.Alias(u.anchor);u={anchor:null,node:null},l.set(t,u)}e?.startsWith("!!")&&(e=LZs+e.slice(2));let d=BZs(t,e,c.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new Nni.Scalar(t);return u&&(u.node=h),h}d=t instanceof Map?c[mee.MAP]:Symbol.iterator in Object(t)?c[mee.SEQ]:c[mee.MAP]}s&&(s(d),delete r.onTagObj);let f=d?.createNode?d.createNode(r.schema,t,r):typeof d?.nodeClass?.from=="function"?d.nodeClass.from(r.schema,t,r):new Nni.Scalar(t);return e?f.tag=e:d.default||(f.tag=d.tag),u&&(u.node=f),f}a(FZs,"createNode");Mni.createNode=FZs});var Xdt=I(Zdt=>{"use strict";p();var UZs=zNe(),E4=Za(),QZs=Kdt();function Uhr(t,e,r){let n=r;for(let o=e.length-1;o>=0;--o){let s=e[o];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let c=[];c[s]=n,n=c}else n=new Map([[s,n]])}return UZs.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:a(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:t,sourceObjects:new Map})}a(Uhr,"collectionFromPath");var Oni=a(t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,"isEmptyPath"),Qhr=class extends QZs.NodeBase{static{a(this,"Collection")}constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>E4.isNode(n)||E4.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(Oni(e))this.add(r);else{let[n,...o]=e,s=this.get(n,!0);if(E4.isCollection(s))s.addIn(o,r);else if(s===void 0&&this.schema)this.set(n,Uhr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let o=this.get(r,!0);if(E4.isCollection(o))return o.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...o]=e,s=this.get(n,!0);return o.length===0?!r&&E4.isScalar(s)?s.value:s:E4.isCollection(s)?s.getIn(o,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!E4.isPair(r))return!1;let n=r.value;return n==null||e&&E4.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let o=this.get(r,!0);return E4.isCollection(o)?o.hasIn(n):!1}setIn(e,r){let[n,...o]=e;if(o.length===0)this.set(n,r);else{let s=this.get(n,!0);if(E4.isCollection(s))s.setIn(o,r);else if(s===void 0&&this.schema)this.set(n,Uhr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}};Zdt.Collection=Qhr;Zdt.collectionFromPath=Uhr;Zdt.isEmptyPath=Oni});var YNe=I(eft=>{"use strict";p();var qZs=a(t=>t.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function qhr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}a(qhr,"indentComment");var jZs=a((t,e,r)=>t.endsWith(` -`)?qhr(r,e):r.includes(` +`+this._getLineContent(e.endLineNumber).substring(0,e.endColumn-1),r}getLineLength(e){return this._getLineContent(e).length}get length(){let e=this._getLineContent(this._lineCount);return new JJs.TextLength(this._lineCount-1,e.length)}};f4.LineBasedText=ldt;var _hr=class extends ldt{static{a(this,"ArrayText")}constructor(e){super(r=>e[r-1],e.length)}};f4.ArrayText=_hr;var vhr=class extends HNe{static{a(this,"StringText")}constructor(e){super(),this.value=e,this._t=new Ori.PositionOffsetTransformer(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}getTransformer(){return this._t}};f4.StringText=vhr});var Bri=I(p4=>{"use strict";p();Object.defineProperty(p4,"__esModule",{value:!0});p4.AnnotationReplacement=p4.Edit=p4.BaseReplacement=p4.BaseEdit=void 0;var ZJs=Sl(),Lri=Rs(),mR=Ed(),udt=class{static{a(this,"BaseEdit")}constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new Lri.BugIndicatingError(`Edits must be disjoint and sorted. Found ${n} after ${r}`);r=n.replaceRange.endExclusive}}equals(e){if(this.replacements.length!==e.replacements.length)return!1;for(let r=0;rr.toString()).join(", ")}]`}normalize(){let e=[],r;for(let n of this.replacements)if(!(n.getNewLength()===0&&n.replaceRange.length===0)){if(r&&r.replaceRange.endExclusive===n.replaceRange.start){let o=r.tryJoinTouching(n);if(o){r=o;continue}}r&&e.push(r),r=n}return r&&e.push(r),this._createNew(e)}compose(e){let r=this.normalize(),n=e.normalize();if(r.isEmpty())return n;if(n.isEmpty())return r;let o=[...r.replacements],s=[],c=0;for(let l of n.replacements){for(;;){let h=o[0];if(!h||h.replaceRange.start+c+h.getNewLength()>=l.replaceRange.start)break;o.shift(),s.push(h),c+=h.getNewLength()-h.replaceRange.length}let u=c,d,f;for(;;){let h=o[0];if(!h||h.replaceRange.start+c>l.replaceRange.endExclusive)break;d||(d=h),f=h,o.shift(),c+=h.getNewLength()-h.replaceRange.length}if(!d)s.push(l.delta(-c));else{let h=Math.min(d.replaceRange.start,l.replaceRange.start-u),m=l.replaceRange.start-(d.replaceRange.start+u);if(m>0){let E=d.slice(mR.OffsetRange.emptyAt(h),new mR.OffsetRange(0,m));s.push(E)}if(!f)throw new Lri.BugIndicatingError("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(mR.OffsetRange.ofStartAndLength(f.replaceRange.endExclusive,0),new mR.OffsetRange(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new mR.OffsetRange(h,l.replaceRange.endExclusive-c),y=l.slice(A,new mR.OffsetRange(0,l.getNewLength()));s.push(y)}}for(;;){let l=o.shift();if(!l)break;s.push(l)}return this._createNew(s).normalize()}decomposeSplit(e){let r=[],n=[],o=0;for(let s of this.replacements)e(s)?(r.push(s),o+=s.getNewLength()-s.replaceRange.length):n.push(s.slice(s.replaceRange.delta(o),new mR.OffsetRange(0,s.getNewLength())));return{e1:this._createNew(r),e2:this._createNew(n)}}getNewRanges(){let e=[],r=0;for(let n of this.replacements)e.push(mR.OffsetRange.ofStartAndLength(n.replaceRange.start+r,n.getNewLength())),r+=n.getLengthDelta();return e}getJoinedReplaceRange(){if(this.replacements.length!==0)return this.replacements[0].replaceRange.join(this.replacements.at(-1).replaceRange)}isEmpty(){return this.replacements.length===0}getLengthDelta(){return(0,ZJs.sumBy)(this.replacements,e=>e.getLengthDelta())}getNewDataLength(e){return e+this.getLengthDelta()}applyToOffset(e){let r=0;for(let n of this.replacements)if(n.replaceRange.start<=e){if(e ${this.getNewLength()} }`}get isEmpty(){return this.getNewLength()===0&&this.replaceRange.length===0}getRangeAfterReplace(){return new mR.OffsetRange(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}};p4.BaseReplacement=ddt;var Chr=class t extends udt{static{a(this,"Edit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}_createNew(e){return new t(e)}};p4.Edit=Chr;var bhr=class t extends ddt{static{a(this,"AnnotationReplacement")}constructor(e,r,n){super(e),this.newLength=r,this.annotation=n}equals(e){return this.replaceRange.equals(e.replaceRange)&&this.newLength===e.newLength&&this.annotation===e.annotation}getNewLength(){return this.newLength}tryJoinTouching(e){if(this.annotation===e.annotation)return new t(this.replaceRange.joinRightTouching(e.replaceRange),this.newLength+e.newLength,this.annotation)}slice(e,r){return new t(e,r?r.length:this.newLength,this.annotation)}};p4.AnnotationReplacement=bhr});var ME=I(ay=>{"use strict";p();Object.defineProperty(ay,"__esModule",{value:!0});ay.AnnotatedStringReplacement=ay.AnnotatedStringEdit=ay.VoidEditData=ay.StringReplacement=ay.StringEdit=ay.BaseStringReplacement=ay.BaseStringEdit=void 0;ay.applyEditsToRanges=eZs;var fdt=om(),eD=Ed(),XJs=$T(),Uri=Bri(),GNe=class extends Uri.BaseEdit{static{a(this,"BaseStringEdit")}get TReplacement(){throw new Error("TReplacement is not defined for BaseStringEdit")}static composeOrUndefined(e){if(e.length===0)return;let r=e[0];for(let n=1;n" ".repeat(l-c)),o=r.tryRebase(n);if(!o)return;let s=e.tryRebase(o);if(s)return{e1:o,e2:s}}apply(e){let r=[],n=0;for(let o of this.replacements)r.push(e.substring(n,o.replaceRange.start)),r.push(o.newText),n=o.replaceRange.endExclusive;return r.push(e.substring(n)),r.join("")}inverseOnSlice(e){let r=[],n=0;for(let o of this.replacements)r.push(_v.replace(eD.OffsetRange.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new h4(r)}inverse(e){return this.inverseOnSlice((r,n)=>e.substring(r,n))}rebaseSkipConflicting(e){return this._tryRebase(e,!1)}tryRebase(e){return this._tryRebase(e,!0)}_tryRebase(e,r){let n=[],o=0,s=0,c=0;for(;se.toJson())}isNeutralOn(e){return this.replacements.every(r=>r.isNeutralOn(e))}removeCommonSuffixPrefix(e){let r=[];for(let n of this.replacements){let o=n.removeCommonSuffixPrefix(e);o.isEmpty||r.push(o)}return new h4(r)}normalizeEOL(e){return new h4(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=_v.replace(eD.OffsetRange.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?h4.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new XJs.StringText(this.apply(e.value))}mapData(e){return new pdt(this.replacements.map(r=>new dee(r.replaceRange,r.newText,e(r))))}};ay.BaseStringEdit=GNe;var $Ne=class extends Uri.BaseReplacement{static{a(this,"BaseStringReplacement")}constructor(e,r){super(e),this.newText=r}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(e){return e.substring(0,this.replaceRange.start)+this.newText+e.substring(this.replaceRange.endExclusive)}isNeutralOn(e){return this.newText===e.substring(this.replaceRange.start,this.replaceRange.endExclusive)}removeCommonSuffixPrefix(e){let r=e.substring(this.replaceRange.start,this.replaceRange.endExclusive),n=(0,fdt.commonPrefixLength)(r,this.newText),o=Math.min(r.length-n,this.newText.length-n,(0,fdt.commonSuffixLength)(r,this.newText)),s=new eD.OffsetRange(this.replaceRange.start+n,this.replaceRange.endExclusive-o),c=this.newText.substring(n,this.newText.length-o);return new _v(s,c)}normalizeEOL(e){let r=this.newText.replace(/\r\n|\n/g,e);return new _v(this.replaceRange,r)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){let r=this.replaceRange.substring(e),n=(0,fdt.commonPrefixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaStart(n),new eD.OffsetRange(n,this.newText.length))}removeCommonSuffix(e){let r=this.replaceRange.substring(e),n=(0,fdt.commonSuffixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaEnd(-n),new eD.OffsetRange(0,this.newText.length-n))}toEdit(){return new h4([this])}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}};ay.BaseStringReplacement=$Ne;var h4=class t extends GNe{static{a(this,"StringEdit")}static parse(e){let r=[],n=/\[(\d+),\s*(\d+)\)\s*->\s*"([^"]*)"/g,o;for(;(o=n.exec(e))!==null;){let s=parseInt(o[1],10),c=parseInt(o[2],10),l=o[3].replace(/\\n/g,` +`).replace(/\\r/g,"\r").replace(/\\\\/g,"\\");r.push(new _v(new eD.OffsetRange(s,c),l))}return new t(r)}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r){return new t([new _v(e,r)])}static insert(e,r){return new t([new _v(eD.OffsetRange.emptyAt(e),r)])}static delete(e){return new t([new _v(e,"")])}static fromJson(e){return new t(e.map(_v.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;n=o.replaceRange.start)break;t.shift(),r.push(c.delta(n))}let s=[];for(;;){let c=t[0];if(!c||!c.intersectsOrTouches(o.replaceRange))break;t.shift(),s.push(c)}for(let c=s.length-1;c>=0;c--){let l=s[c],u=l.intersect(o.replaceRange).length;l=l.deltaEnd(-u+(c===0?o.newText.length:0));let d=l.start-o.replaceRange.start;d>0&&(l=l.delta(-d)),c!==0&&(l=l.delta(o.newText.length)),l=l.delta(-(o.newText.length-o.replaceRange.length)),t.unshift(l)}n+=o.newText.length-o.replaceRange.length}for(;;){let o=t[0];if(!o)break;t.shift(),r.push(o.delta(n))}return r}a(eZs,"applyEditsToRanges");var Shr=class{static{a(this,"VoidEditData")}join(e){return this}};ay.VoidEditData=Shr;var pdt=class t extends GNe{static{a(this,"AnnotatedStringEdit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r,n){return new t([new dee(e,r,n)])}static insert(e,r,n){return new t([new dee(eD.OffsetRange.emptyAt(e),r,n)])}static delete(e,r){return new t([new dee(e,"",r)])}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;n{"use strict";p();Object.defineProperty(hdt,"__esModule",{value:!0});hdt.LanguageId=void 0;var Qri;(function(t){t.PlainText="plaintext";function e(r){return r}a(e,"create"),t.create=e})(Qri||(hdt.LanguageId=Qri={}))});var jri=I(zH=>{"use strict";p();Object.defineProperty(zH,"__esModule",{value:!0});zH.EditReasons=zH.TextModelEditReason=zH.EditReason=void 0;var Thr=class t{static{a(this,"EditReason")}static create(e){return e?new t(e):t.unknown}constructor(e){this.metadata=e}static{this.unknown=new t({source:"unknown",name:void 0})}toKey(e){return new VNe(this.metadata,qri).toKey(e)}};zH.EditReason=Thr;var qri=Symbol("TextModelEditReason"),VNe=class{static{a(this,"TextModelEditReason")}constructor(e,r){this.metadata=e}toString(){return`${this.metadata.source}`}getType(){let e=this.metadata;switch(e.source){case"cursor":return e.kind;case"inlineCompletionAccept":return e.source+(e.$nes?":nes":"");case"unknown":return e.name||"unknown";default:return e.source}}toKey(e){let r=this.metadata;return Object.entries(r).filter(([o,s])=>(o.match(/\$/g)||[]).length<=e&&s!==void 0&&s!==null&&s!=="").map(([o,s])=>`${o}:${s}`).join("-")}};zH.TextModelEditReason=VNe;function gR(t){return new VNe(t,qri)}a(gR,"createEditReason");zH.EditReasons={unknown(t){return gR({source:"unknown",name:t.name})},chatApplyEdits(t){return gR({source:"Chat.applyEdits",$modelId:t.modelId})},inlineCompletionAccept(t){return gR({source:"inlineCompletionAccept",$nes:t.nes,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineCompletionPartialAccept(t){return gR({source:"inlineCompletionPartialAccept",type:t.type,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineChatApplyEdit(t){return gR({source:"inlineChat.applyEdits",$modelId:t.modelId})},reloadFromDisk:a(()=>gR({source:"reloadFromDisk"}),"reloadFromDisk"),cursor(t){return gR({source:"cursor",kind:t.kind,detailedSource:t.detailedSource})},setValue:a(()=>gR({source:"setValue"}),"setValue"),eolChange:a(()=>gR({source:"eolChange"}),"eolChange"),applyEdits:a(()=>gR({source:"applyEdits"}),"applyEdits"),snippet:a(()=>gR({source:"snippet"}),"snippet"),suggest:a(t=>gR({source:"suggest",$extensionId:t.extensionId}),"suggest")}});var fee=I(m4=>{"use strict";p();Object.defineProperty(m4,"__esModule",{value:!0});m4.MutableObservableDocument=m4.MutableObservableWorkspace=m4.StringEditWithReason=m4.ObservableWorkspace=void 0;var rZs=sd(),Hri=Ro(),vv=D8(),$ri=ME(),nZs=Ed(),iZs=$T(),oZs=mdt(),Gri=jri(),gdt=class{static{a(this,"ObservableWorkspace")}constructor(){this._version=0,this.onDidOpenDocumentChange=(0,vv.derivedHandleChanges)({owner:this,changeTracker:{createChangeSummary:a(()=>({didChange:!1}),"createChangeSummary"),handleChange:a((e,r)=>(e.didChange(this.openDocuments)||(r.didChange=!0),!0),"handleChange")}},(e,r)=>{let n=this.openDocuments.read(e);for(let o of n)o.value.read(e);return r.didChange&&this._version++,this._version}),this.lastActiveDocument=(0,vv.derivedWithStore)((e,r)=>{let n=(0,vv.observableValue)("lastActiveDocument",void 0);return r.add((0,vv.autorunWithStore)((o,s)=>{let c=this.openDocuments.read(o);for(let l of c)s.add((0,vv.runOnChange)(l.value,()=>{n.set(l,void 0)}))})),n}).flatten()}getFirstOpenDocument(){return this.openDocuments.get()[0]}getDocument(e){return this.openDocuments.get().find(r=>r.id===e)}};m4.ObservableWorkspace=gdt;var Fme=class extends $ri.StringEdit{static{a(this,"StringEditWithReason")}constructor(e,r){super(e),this.reason=r}};m4.StringEditWithReason=Fme;var Ihr=class extends gdt{static{a(this,"MutableObservableWorkspace")}constructor(){super(...arguments),this._openDocuments=(0,vv.observableValue)(this,[]),this.openDocuments=this._openDocuments,this._documents=new Map}addDocument(e,r=void 0){(0,rZs.assert)(!this._documents.has(e.id));let n=new Adt(e.id,new iZs.StringText(e.initialValue??""),[],e.languageId??oZs.LanguageId.PlainText,()=>{this._documents.delete(e.id);let o=this._openDocuments.get(),s=o.filter(c=>c.id!==n.id);s.length!==o.length&&this._openDocuments.set(s,r,{added:[],removed:[n]})},e.initialVersionId??0,e.workspaceRoot);return this._documents.set(e.id,n),this._openDocuments.set([...this._openDocuments.get(),n],r,{added:[n],removed:[]}),n}getDocument(e){return this._documents.get(e)}clear(){this._openDocuments.set([],void 0,{added:[],removed:this._openDocuments.get()});for(let e of this._documents.values())e.dispose();this._documents.clear()}getWorkspaceRoot(e){return this._documents.get(e)?.workspaceRoot}};m4.MutableObservableWorkspace=Ihr;var Adt=class extends Hri.Disposable{static{a(this,"MutableObservableDocument")}get value(){return this._value}get selection(){return this._selection}get primarySelectionLine(){return this._primarySelectionLine}get visibleRanges(){return this._visibleRanges}get languageId(){return this._languageId}get version(){return this._version}get diagnostics(){return this._diagnostics}constructor(e,r,n,o,s,c,l){super(),this.id=e,this.workspaceRoot=l,this._value=(0,vv.observableValue)(this,r),this._selection=(0,vv.observableValue)(this,n),this._primarySelectionLine=(0,vv.observableValue)(this,void 0),this._visibleRanges=(0,vv.observableValue)(this,[]),this._languageId=(0,vv.observableValue)(this,o),this._version=(0,vv.observableValue)(this,c),this._diagnostics=(0,vv.observableValue)(this,[]),this._register((0,Hri.toDisposable)(s))}setSelection(e,r=void 0,n){this._selection.set(e,r),this._primarySelectionLine.set(n,r)}setVisibleRange(e,r=void 0){this._visibleRanges.set(e,r)}applyEdit(e,r=void 0,n=void 0){let o=e.applyOnText(this.value.get()),s=e instanceof Fme?e:new Fme(e.replacements,Gri.EditReason.unknown);(0,vv.subtransaction)(r,c=>{this._value.set(o,c,s),this._version.set(n??this._version.get()+1,c)})}updateSelection(e,r=void 0,n){this._selection.set(e,r),this._primarySelectionLine.set(n,r)}setValue(e,r=void 0,n=void 0){let o=Gri.EditReason.unknown,s=new Fme([$ri.StringReplacement.replace(new nZs.OffsetRange(0,this.value.get().value.length),e.value)],o);(0,vv.subtransaction)(r,c=>{this._value.set(e,c,s),this._version.set(n??this._version.get()+1,c)})}updateDiagnostics(e,r=void 0){this._diagnostics.set(e,r)}};m4.MutableObservableDocument=Adt});var tD=I(pee=>{"use strict";p();var sZs=pee&&pee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aZs=pee&&pee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sZs(e,t,r)};Object.defineProperty(pee,"__esModule",{value:!0});aZs(D8(),pee)});var g4=I(xhr=>{"use strict";p();Object.defineProperty(xhr,"__esModule",{value:!0});xhr.autorunWithChanges=lZs;var cZs=tD();function lZs(t,e,r){let n=new Map(Object.entries(e).map(([s,c])=>[c,s])),o=new Map(Object.keys(e).map(s=>[s,void 0]));return(0,cZs.autorunHandleChanges)({owner:t,changeTracker:{createChangeSummary:a(()=>({}),"createChangeSummary"),handleChange:a((s,c)=>{let l=n.get(s.changedObservable);return c[l]===void 0&&(c[l]={value:void 0,changes:[]}),c[l].changes.push(s.change),!0},"handleChange")}},(s,c)=>{for(let[l,u]of Object.entries(e)){let d=u.read(s);c[l]===void 0&&(c[l]={value:d,changes:[],previous:o.get(l)}),c[l].value=d,c[l].previous=o.get(l)===void 0?void 0:o.get(l),o.set(l,d)}r(c)})}a(lZs,"autorunWithChanges")});var tc=I(ly=>{"use strict";p();var rmr=Symbol.for("yaml.alias"),eii=Symbol.for("yaml.document"),ift=Symbol.for("yaml.map"),tii=Symbol.for("yaml.pair"),nmr=Symbol.for("yaml.scalar"),oft=Symbol.for("yaml.seq"),B8=Symbol.for("yaml.node.type"),GXs=a(t=>!!t&&typeof t=="object"&&t[B8]===rmr,"isAlias"),$Xs=a(t=>!!t&&typeof t=="object"&&t[B8]===eii,"isDocument"),VXs=a(t=>!!t&&typeof t=="object"&&t[B8]===ift,"isMap"),WXs=a(t=>!!t&&typeof t=="object"&&t[B8]===tii,"isPair"),rii=a(t=>!!t&&typeof t=="object"&&t[B8]===nmr,"isScalar"),zXs=a(t=>!!t&&typeof t=="object"&&t[B8]===oft,"isSeq");function nii(t){if(t&&typeof t=="object")switch(t[B8]){case ift:case oft:return!0}return!1}a(nii,"isCollection");function YXs(t){if(t&&typeof t=="object")switch(t[B8]){case rmr:case ift:case nmr:case oft:return!0}return!1}a(YXs,"isNode");var KXs=a(t=>(rii(t)||nii(t))&&!!t.anchor,"hasAnchor");ly.ALIAS=rmr;ly.DOC=eii;ly.MAP=ift;ly.NODE_TYPE=B8;ly.PAIR=tii;ly.SCALAR=nmr;ly.SEQ=oft;ly.hasAnchor=KXs;ly.isAlias=GXs;ly.isCollection=nii;ly.isDocument=$Xs;ly.isMap=VXs;ly.isNode=YXs;ly.isPair=WXs;ly.isScalar=rii;ly.isSeq=zXs});var nMe=I(imr=>{"use strict";p();var S0=tc(),Lb=Symbol("break visit"),iii=Symbol("skip children"),_4=Symbol("remove node");function sft(t,e){let r=oii(e);S0.isDocument(t)?$me(null,t.contents,r,Object.freeze([t]))===_4&&(t.contents=null):$me(null,t,r,Object.freeze([]))}a(sft,"visit");sft.BREAK=Lb;sft.SKIP=iii;sft.REMOVE=_4;function $me(t,e,r,n){let o=sii(t,e,r,n);if(S0.isNode(o)||S0.isPair(o))return aii(t,n,o),$me(t,o,r,n);if(typeof o!="symbol"){if(S0.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s{"use strict";p();var cii=tc(),JXs=nMe(),ZXs={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},XXs=a(t=>t.replace(/[!,[\]{}]/g,e=>ZXs[e]),"escapeTagName"),iMe=class t{static{a(this,"Directives")}constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),o=n.shift();switch(o){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,c]=n;return this.tags[s]=c,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let c=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,c),!1}}default:return r(0,`Unknown directive ${o}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let c=e.slice(2,-1);return c==="!"||c==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),c)}let[,n,o]=e.match(/^(.*!)([^!]*)$/s);o||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(o)}catch(c){return r(String(c)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+XXs(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),o;if(e&&n.length>0&&cii.isNode(e.contents)){let s={};JXs.visit(e.contents,(c,l)=>{cii.isNode(l)&&l.tag&&(s[l.tag]=!0)}),o=Object.keys(s)}else o=[];for(let[s,c]of n)s==="!!"&&c==="tag:yaml.org,2002:"||(!e||o.some(l=>l.startsWith(c)))&&r.push(`%TAG ${s} ${c}`);return r.join(` +`)}};iMe.defaultYaml={explicit:!1,version:"1.2"};iMe.defaultTags={"!!":"tag:yaml.org,2002:"};lii.Directives=iMe});var cft=I(oMe=>{"use strict";p();var uii=tc(),eea=nMe();function tea(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}a(tea,"anchorIsValid");function dii(t){let e=new Set;return eea.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}a(dii,"anchorNames");function fii(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}a(fii,"findNewAnchor");function rea(t,e){let r=[],n=new Map,o=null;return{onAnchor:a(s=>{r.push(s),o??(o=dii(t));let c=fii(e,o);return o.add(c),c},"onAnchor"),setAnchors:a(()=>{for(let s of r){let c=n.get(s);if(typeof c=="object"&&c.anchor&&(uii.isScalar(c.node)||uii.isCollection(c.node)))c.node.anchor=c.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},"setAnchors"),sourceObjects:n}}a(rea,"createNodeAnchors");oMe.anchorIsValid=tea;oMe.anchorNames=dii;oMe.createNodeAnchors=rea;oMe.findNewAnchor=fii});var smr=I(pii=>{"use strict";p();function sMe(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let o=0,s=n.length;o{"use strict";p();var nea=tc();function hii(t,e,r){if(Array.isArray(t))return t.map((n,o)=>hii(n,String(o),r));if(t&&typeof t.toJSON=="function"){if(!r||!nea.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let o=t.toJSON(e,r);return r.onCreate&&r.onCreate(o),o}return typeof t=="bigint"&&!r?.keep?Number(t):t}a(hii,"toJS");mii.toJS=hii});var lft=I(Aii=>{"use strict";p();var iea=smr(),gii=tc(),oea=ZH(),amr=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,gii.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:o,reviver:s}={}){if(!gii.isDocument(e))throw new TypeError("A document argument is required");let c={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=oea.toJS(this,"",c);if(typeof o=="function")for(let{count:u,res:d}of c.anchors.values())o(d,u);return typeof s=="function"?iea.applyReviver(s,{"":l},"",l):l}};Aii.NodeBase=amr});var aMe=I(yii=>{"use strict";p();var sea=cft(),aea=nMe(),Wme=tc(),cea=lft(),lea=ZH(),cmr=class extends cea.NodeBase{static{a(this,"Alias")}constructor(e){super(Wme.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],aea.visit(e,{Node:a((s,c)=>{(Wme.isAlias(c)||Wme.hasAnchor(c))&&n.push(c)},"Node")}),r&&(r.aliasResolveCache=n));let o;for(let s of n){if(s===this)break;s.anchor===this.source&&(o=s)}return o}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:o,maxAliasCount:s}=r,c=this.resolve(o,r);if(!c){let u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(u)}let l=n.get(c);if(l||(lea.toJS(c,null,r),l=n.get(c)),l?.res===void 0){let u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=uft(o,c,n)),l.count*l.aliasCount>s)){let u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}return l.res}toString(e,r,n){let o=`*${this.source}`;if(e){if(sea.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${o} `}return o}};function uft(t,e,r){if(Wme.isAlias(e)){let n=e.resolve(t),o=r&&n&&r.get(n);return o?o.count*o.aliasCount:0}else if(Wme.isCollection(e)){let n=0;for(let o of e.items){let s=uft(t,o,r);s>n&&(n=s)}return n}else if(Wme.isPair(e)){let n=uft(t,e.key,r),o=uft(t,e.value,r);return Math.max(n,o)}return 1}a(uft,"getAliasCount");yii.Alias=cmr});var _m=I(lmr=>{"use strict";p();var uea=tc(),dea=lft(),fea=ZH(),pea=a(t=>!t||typeof t!="function"&&typeof t!="object","isScalarValue"),XH=class extends dea.NodeBase{static{a(this,"Scalar")}constructor(e){super(uea.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:fea.toJS(this.value,e,r)}toString(){return String(this.value)}};XH.BLOCK_FOLDED="BLOCK_FOLDED";XH.BLOCK_LITERAL="BLOCK_LITERAL";XH.PLAIN="PLAIN";XH.QUOTE_DOUBLE="QUOTE_DOUBLE";XH.QUOTE_SINGLE="QUOTE_SINGLE";lmr.Scalar=XH;lmr.isScalarValue=pea});var cMe=I(_ii=>{"use strict";p();var hea=aMe(),Eee=tc(),Eii=_m(),mea="tag:yaml.org,2002:";function gea(t,e,r){if(e){let n=r.filter(s=>s.tag===e),o=n.find(s=>!s.format)??n[0];if(!o)throw new Error(`Tag ${e} not found`);return o}return r.find(n=>n.identify?.(t)&&!n.format)}a(gea,"findTagObject");function Aea(t,e,r){if(Eee.isDocument(t)&&(t=t.contents),Eee.isNode(t))return t;if(Eee.isPair(t)){let h=r.schema[Eee.MAP].createNode?.(r.schema,null,r);return h.items.push(t),h}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:o,onTagObj:s,schema:c,sourceObjects:l}=r,u;if(n&&t&&typeof t=="object"){if(u=l.get(t),u)return u.anchor??(u.anchor=o(t)),new hea.Alias(u.anchor);u={anchor:null,node:null},l.set(t,u)}e?.startsWith("!!")&&(e=mea+e.slice(2));let d=gea(t,e,c.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new Eii.Scalar(t);return u&&(u.node=h),h}d=t instanceof Map?c[Eee.MAP]:Symbol.iterator in Object(t)?c[Eee.SEQ]:c[Eee.MAP]}s&&(s(d),delete r.onTagObj);let f=d?.createNode?d.createNode(r.schema,t,r):typeof d?.nodeClass?.from=="function"?d.nodeClass.from(r.schema,t,r):new Eii.Scalar(t);return e?f.tag=e:d.default||(f.tag=d.tag),u&&(u.node=f),f}a(Aea,"createNode");_ii.createNode=Aea});var fft=I(dft=>{"use strict";p();var yea=cMe(),v4=tc(),Eea=lft();function umr(t,e,r){let n=r;for(let o=e.length-1;o>=0;--o){let s=e[o];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let c=[];c[s]=n,n=c}else n=new Map([[s,n]])}return yea.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:a(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:t,sourceObjects:new Map})}a(umr,"collectionFromPath");var vii=a(t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,"isEmptyPath"),dmr=class extends Eea.NodeBase{static{a(this,"Collection")}constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>v4.isNode(n)||v4.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(vii(e))this.add(r);else{let[n,...o]=e,s=this.get(n,!0);if(v4.isCollection(s))s.addIn(o,r);else if(s===void 0&&this.schema)this.set(n,umr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let o=this.get(r,!0);if(v4.isCollection(o))return o.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...o]=e,s=this.get(n,!0);return o.length===0?!r&&v4.isScalar(s)?s.value:s:v4.isCollection(s)?s.getIn(o,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!v4.isPair(r))return!1;let n=r.value;return n==null||e&&v4.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let o=this.get(r,!0);return v4.isCollection(o)?o.hasIn(n):!1}setIn(e,r){let[n,...o]=e;if(o.length===0)this.set(n,r);else{let s=this.get(n,!0);if(v4.isCollection(s))s.setIn(o,r);else if(s===void 0&&this.schema)this.set(n,umr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}};dft.Collection=dmr;dft.collectionFromPath=umr;dft.isEmptyPath=vii});var lMe=I(pft=>{"use strict";p();var _ea=a(t=>t.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function fmr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}a(fmr,"indentComment");var vea=a((t,e,r)=>t.endsWith(` +`)?fmr(r,e):r.includes(` `)?` -`+qhr(r,e):(t.endsWith(" ")?"":" ")+r,"lineComment");eft.indentComment=qhr;eft.lineComment=jZs;eft.stringifyComment=qZs});var Bni=I(KNe=>{"use strict";p();var HZs="flow",jhr="block",tft="quoted";function GZs(t,e,r="flow",{indentAtStart:n,lineWidth:o=80,minContentWidth:s=20,onFold:c,onOverflow:l}={}){if(!o||o<0)return t;oo-Math.max(2,s)?d.push(0):h=o-n);let m,g,A=!1,y=-1,E=-1,_=-1;r===jhr&&(y=Lni(t,y,e.length),y!==-1&&(h=y+u));for(let b;b=t[y+=1];){if(r===tft&&b==="\\"){switch(E=y,t[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}_=y}if(b===` -`)r===jhr&&(y=Lni(t,y,e.length)),h=y+e.length+u,m=void 0;else{if(b===" "&&g&&g!==" "&&g!==` +`+fmr(r,e):(t.endsWith(" ")?"":" ")+r,"lineComment");pft.indentComment=fmr;pft.lineComment=vea;pft.stringifyComment=_ea});var bii=I(uMe=>{"use strict";p();var Cea="flow",pmr="block",hft="quoted";function bea(t,e,r="flow",{indentAtStart:n,lineWidth:o=80,minContentWidth:s=20,onFold:c,onOverflow:l}={}){if(!o||o<0)return t;oo-Math.max(2,s)?d.push(0):h=o-n);let m,g,A=!1,y=-1,E=-1,_=-1;r===pmr&&(y=Cii(t,y,e.length),y!==-1&&(h=y+u));for(let b;b=t[y+=1];){if(r===hft&&b==="\\"){switch(E=y,t[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}_=y}if(b===` +`)r===pmr&&(y=Cii(t,y,e.length)),h=y+e.length+u,m=void 0;else{if(b===" "&&g&&g!==" "&&g!==` `&&g!==" "){let T=t[y+1];T&&T!==" "&&T!==` -`&&T!==" "&&(m=y)}if(y>=h)if(m)d.push(m),h=m+u,m=void 0;else if(r===tft){for(;g===" "||g===" ";)g=b,b=t[y+=1],A=!0;let T=y>_+1?y-2:E-1;if(f[T])return t;d.push(T),f[T]=!0,h=T+u,m=void 0}else A=!0}g=b}if(A&&l&&l(),d.length===0)return t;c&&c();let v=t.slice(0,d[0]);for(let b=0;b{"use strict";p();var J2=mm(),HH=Bni(),nft=a((t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),"getFoldOptions"),ift=a(t=>/^(%|---|\.\.\.)/m.test(t),"containsDocumentMarker");function $Zs(t,e,r){if(!e||e<0)return!1;let n=e-r,o=t.length;if(o<=n)return!1;for(let s=0,c=0;sn)return!0;if(c=s+1,o-c<=n)return!1}return!0}a($Zs,"lineLengthOverLimit");function JNe(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,o=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(ift(t)?" ":""),c="",l=0;for(let u=0,d=r[u];d;d=r[++u])if(d===" "&&r[u+1]==="\\"&&r[u+2]==="n"&&(c+=r.slice(l,u)+"\\ ",u+=1,l=u,d="\\"),d==="\\")switch(r[u+1]){case"u":{c+=r.slice(l,u);let f=r.substr(u+2,4);switch(f){case"0000":c+="\\0";break;case"0007":c+="\\a";break;case"000b":c+="\\v";break;case"001b":c+="\\e";break;case"0085":c+="\\N";break;case"00a0":c+="\\_";break;case"2028":c+="\\L";break;case"2029":c+="\\P";break;default:f.substr(0,2)==="00"?c+="\\x"+f.substr(2):c+=r.substr(u,6)}u+=5,l=u+1}break;case"n":if(n||r[u+2]==='"'||r.length=h)if(m)d.push(m),h=m+u,m=void 0;else if(r===hft){for(;g===" "||g===" ";)g=b,b=t[y+=1],A=!0;let T=y>_+1?y-2:E-1;if(f[T])return t;d.push(T),f[T]=!0,h=T+u,m=void 0}else A=!0}g=b}if(A&&l&&l(),d.length===0)return t;c&&c();let v=t.slice(0,d[0]);for(let b=0;b{"use strict";p();var oD=_m(),eG=bii(),gft=a((t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),"getFoldOptions"),Aft=a(t=>/^(%|---|\.\.\.)/m.test(t),"containsDocumentMarker");function Sea(t,e,r){if(!e||e<0)return!1;let n=e-r,o=t.length;if(o<=n)return!1;for(let s=0,c=0;sn)return!0;if(c=s+1,o-c<=n)return!1}return!0}a(Sea,"lineLengthOverLimit");function dMe(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,o=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Aft(t)?" ":""),c="",l=0;for(let u=0,d=r[u];d;d=r[++u])if(d===" "&&r[u+1]==="\\"&&r[u+2]==="n"&&(c+=r.slice(l,u)+"\\ ",u+=1,l=u,d="\\"),d==="\\")switch(r[u+1]){case"u":{c+=r.slice(l,u);let f=r.substr(u+2,4);switch(f){case"0000":c+="\\0";break;case"0007":c+="\\a";break;case"000b":c+="\\v";break;case"001b":c+="\\e";break;case"0085":c+="\\N";break;case"00a0":c+="\\_";break;case"2028":c+="\\L";break;case"2029":c+="\\P";break;default:f.substr(0,2)==="00"?c+="\\x"+f.substr(2):c+=r.substr(u,6)}u+=5,l=u+1}break;case"n":if(n||r[u+2]==='"'||r.length `;let h,m;for(m=r.length;m>0;--m){let w=r[m-1];if(w!==` `&&w!==" "&&w!==" ")break}let g=r.substring(m),A=g.indexOf(` `);A===-1?h="-":r===g||A!==g.length-1?(h="+",s&&s()):h="",g&&(r=r.slice(0,-g.length),g[g.length-1]===` -`&&(g=g.slice(0,-1)),g=g.replace(Ghr,`$&${d}`));let y=!1,E,_=-1;for(E=0;E{R=!0});let P=HH.foldFlowLines(`${v}${w}${g}`,d,HH.FOLD_BLOCK,x);if(!R)return`>${T} +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),R=!1,x=gft(n,!0);c!=="folded"&&e!==oD.Scalar.BLOCK_FOLDED&&(x.onOverflow=()=>{R=!0});let P=eG.foldFlowLines(`${v}${w}${g}`,d,eG.FOLD_BLOCK,x);if(!R)return`>${T} ${d}${P}`}return r=r.replace(/\n+/g,`$&${d}`),`|${T} -${d}${v}${r}${g}`}a(rft,"blockString");function VZs(t,e,r,n){let{type:o,value:s}=t,{actualString:c,implicitKey:l,indent:u,indentStep:d,inFlow:f}=e;if(l&&s.includes(` -`)||f&&/[[\]{},]/.test(s))return Lme(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||f||!s.includes(` -`)?Lme(s,e):rft(t,e,r,n);if(!l&&!f&&o!==J2.Scalar.PLAIN&&s.includes(` -`))return rft(t,e,r,n);if(ift(s)){if(u==="")return e.forceBlockIndent=!0,rft(t,e,r,n);if(l&&u===d)return Lme(s,e)}let h=s.replace(/\n+/g,`$& -${u}`);if(c){let m=a(y=>y.default&&y.tag!=="tag:yaml.org,2002:str"&&y.test?.test(h),"test"),{compat:g,tags:A}=e.doc.schema;if(A.some(m)||g?.some(m))return Lme(s,e)}return l?h:HH.foldFlowLines(h,u,HH.FOLD_FLOW,nft(e,!1))}a(VZs,"plainString");function WZs(t,e,r,n){let{implicitKey:o,inFlow:s}=e,c=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:l}=t;l!==J2.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(l=J2.Scalar.QUOTE_DOUBLE);let u=a(f=>{switch(f){case J2.Scalar.BLOCK_FOLDED:case J2.Scalar.BLOCK_LITERAL:return o||s?Lme(c.value,e):rft(c,e,r,n);case J2.Scalar.QUOTE_DOUBLE:return JNe(c.value,e);case J2.Scalar.QUOTE_SINGLE:return Hhr(c.value,e);case J2.Scalar.PLAIN:return VZs(c,e,r,n);default:return null}},"_stringify"),d=u(l);if(d===null){let{defaultKeyType:f,defaultStringType:h}=e.options,m=o&&f||h;if(d=u(m),d===null)throw new Error(`Unsupported default string type ${m}`)}return d}a(WZs,"stringifyString");Fni.stringifyString=WZs});var XNe=I($hr=>{"use strict";p();var zZs=Ydt(),GH=Za(),YZs=YNe(),KZs=ZNe();function JZs(t,e){let r=Object.assign({blockQuote:!0,commentString:YZs.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}a(JZs,"createStringifyContext");function ZZs(t,e){if(e.tag){let o=t.filter(s=>s.tag===e.tag);if(o.length>0)return o.find(s=>s.format===e.format)??o[0]}let r,n;if(GH.isScalar(e)){n=e.value;let o=t.filter(s=>s.identify?.(n));if(o.length>1){let s=o.filter(c=>c.test);s.length>0&&(o=s)}r=o.find(s=>s.format===e.format)??o.find(s=>!s.format)}else n=e,r=t.find(o=>o.nodeClass&&n instanceof o.nodeClass);if(!r){let o=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${o} value`)}return r}a(ZZs,"getTagObject");function XZs(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let o=[],s=(GH.isScalar(t)||GH.isCollection(t))&&t.anchor;s&&zZs.anchorIsValid(s)&&(r.add(s),o.push(`&${s}`));let c=t.tag??(e.default?null:e.tag);return c&&o.push(n.directives.tagString(c)),o.join(" ")}a(XZs,"stringifyProps");function eXs(t,e,r,n){if(GH.isPair(t))return t.toString(e,r,n);if(GH.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let o,s=GH.isNode(t)?t:e.doc.createNode(t,{onTagObj:a(u=>o=u,"onTagObj")});o??(o=ZZs(e.doc.schema.tags,s));let c=XZs(s,o,e);c.length>0&&(e.indentAtStart=(e.indentAtStart??0)+c.length+1);let l=typeof o.stringify=="function"?o.stringify(s,e,r,n):GH.isScalar(s)?KZs.stringifyString(s,e,r,n):s.toString(e,r,n);return c?GH.isScalar(s)||l[0]==="{"||l[0]==="["?`${c} ${l}`:`${c} -${e.indent}${l}`:l}a(eXs,"stringify");$hr.createStringifyContext=JZs;$hr.stringify=eXs});var jni=I(qni=>{"use strict";p();var w8=Za(),Uni=mm(),Qni=XNe(),eMe=YNe();function tXs({key:t,value:e},r,n,o){let{allNullValues:s,doc:c,indent:l,indentStep:u,options:{commentString:d,indentSeq:f,simpleKeys:h}}=r,m=w8.isNode(t)&&t.comment||null;if(h){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(w8.isCollection(t)||!w8.isNode(t)&&typeof t=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let g=!h&&(!t||m&&e==null&&!r.inFlow||w8.isCollection(t)||(w8.isScalar(t)?t.type===Uni.Scalar.BLOCK_FOLDED||t.type===Uni.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!g&&(h||!s),indent:l+u});let A=!1,y=!1,E=Qni.stringify(t,r,()=>A=!0,()=>y=!0);if(!g&&!r.inFlow&&E.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(r.inFlow){if(s||e==null)return A&&n&&n(),E===""?"?":g?`? ${E}`:E}else if(s&&!h||e==null&&g)return E=`? ${E}`,m&&!A?E+=eMe.lineComment(E,r.indent,d(m)):y&&o&&o(),E;A&&(m=null),g?(m&&(E+=eMe.lineComment(E,r.indent,d(m))),E=`? ${E} -${l}:`):(E=`${E}:`,m&&(E+=eMe.lineComment(E,r.indent,d(m))));let _,v,b;w8.isNode(e)?(_=!!e.spaceBefore,v=e.commentBefore,b=e.comment):(_=!1,v=null,b=null,e&&typeof e=="object"&&(e=c.createNode(e))),r.implicitKey=!1,!g&&!m&&w8.isScalar(e)&&(r.indentAtStart=E.length+1),y=!1,!f&&u.length>=2&&!r.inFlow&&!g&&w8.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let T=!1,w=Qni.stringify(e,r,()=>T=!0,()=>y=!0),R=" ";if(m||_||v){if(R=_?` +${d}${v}${r}${g}`}a(mft,"blockString");function Tea(t,e,r,n){let{type:o,value:s}=t,{actualString:c,implicitKey:l,indent:u,indentStep:d,inFlow:f}=e;if(l&&s.includes(` +`)||f&&/[[\]{},]/.test(s))return zme(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||f||!s.includes(` +`)?zme(s,e):mft(t,e,r,n);if(!l&&!f&&o!==oD.Scalar.PLAIN&&s.includes(` +`))return mft(t,e,r,n);if(Aft(s)){if(u==="")return e.forceBlockIndent=!0,mft(t,e,r,n);if(l&&u===d)return zme(s,e)}let h=s.replace(/\n+/g,`$& +${u}`);if(c){let m=a(y=>y.default&&y.tag!=="tag:yaml.org,2002:str"&&y.test?.test(h),"test"),{compat:g,tags:A}=e.doc.schema;if(A.some(m)||g?.some(m))return zme(s,e)}return l?h:eG.foldFlowLines(h,u,eG.FOLD_FLOW,gft(e,!1))}a(Tea,"plainString");function Iea(t,e,r,n){let{implicitKey:o,inFlow:s}=e,c=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:l}=t;l!==oD.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(l=oD.Scalar.QUOTE_DOUBLE);let u=a(f=>{switch(f){case oD.Scalar.BLOCK_FOLDED:case oD.Scalar.BLOCK_LITERAL:return o||s?zme(c.value,e):mft(c,e,r,n);case oD.Scalar.QUOTE_DOUBLE:return dMe(c.value,e);case oD.Scalar.QUOTE_SINGLE:return hmr(c.value,e);case oD.Scalar.PLAIN:return Tea(c,e,r,n);default:return null}},"_stringify"),d=u(l);if(d===null){let{defaultKeyType:f,defaultStringType:h}=e.options,m=o&&f||h;if(d=u(m),d===null)throw new Error(`Unsupported default string type ${m}`)}return d}a(Iea,"stringifyString");Sii.stringifyString=Iea});var pMe=I(gmr=>{"use strict";p();var xea=cft(),tG=tc(),wea=lMe(),Rea=fMe();function kea(t,e){let r=Object.assign({blockQuote:!0,commentString:wea.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}a(kea,"createStringifyContext");function Pea(t,e){if(e.tag){let o=t.filter(s=>s.tag===e.tag);if(o.length>0)return o.find(s=>s.format===e.format)??o[0]}let r,n;if(tG.isScalar(e)){n=e.value;let o=t.filter(s=>s.identify?.(n));if(o.length>1){let s=o.filter(c=>c.test);s.length>0&&(o=s)}r=o.find(s=>s.format===e.format)??o.find(s=>!s.format)}else n=e,r=t.find(o=>o.nodeClass&&n instanceof o.nodeClass);if(!r){let o=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${o} value`)}return r}a(Pea,"getTagObject");function Dea(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let o=[],s=(tG.isScalar(t)||tG.isCollection(t))&&t.anchor;s&&xea.anchorIsValid(s)&&(r.add(s),o.push(`&${s}`));let c=t.tag??(e.default?null:e.tag);return c&&o.push(n.directives.tagString(c)),o.join(" ")}a(Dea,"stringifyProps");function Nea(t,e,r,n){if(tG.isPair(t))return t.toString(e,r,n);if(tG.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let o,s=tG.isNode(t)?t:e.doc.createNode(t,{onTagObj:a(u=>o=u,"onTagObj")});o??(o=Pea(e.doc.schema.tags,s));let c=Dea(s,o,e);c.length>0&&(e.indentAtStart=(e.indentAtStart??0)+c.length+1);let l=typeof o.stringify=="function"?o.stringify(s,e,r,n):tG.isScalar(s)?Rea.stringifyString(s,e,r,n):s.toString(e,r,n);return c?tG.isScalar(s)||l[0]==="{"||l[0]==="["?`${c} ${l}`:`${c} +${e.indent}${l}`:l}a(Nea,"stringify");gmr.createStringifyContext=kea;gmr.stringify=Nea});var wii=I(xii=>{"use strict";p();var F8=tc(),Tii=_m(),Iii=pMe(),hMe=lMe();function Mea({key:t,value:e},r,n,o){let{allNullValues:s,doc:c,indent:l,indentStep:u,options:{commentString:d,indentSeq:f,simpleKeys:h}}=r,m=F8.isNode(t)&&t.comment||null;if(h){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(F8.isCollection(t)||!F8.isNode(t)&&typeof t=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let g=!h&&(!t||m&&e==null&&!r.inFlow||F8.isCollection(t)||(F8.isScalar(t)?t.type===Tii.Scalar.BLOCK_FOLDED||t.type===Tii.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!g&&(h||!s),indent:l+u});let A=!1,y=!1,E=Iii.stringify(t,r,()=>A=!0,()=>y=!0);if(!g&&!r.inFlow&&E.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(r.inFlow){if(s||e==null)return A&&n&&n(),E===""?"?":g?`? ${E}`:E}else if(s&&!h||e==null&&g)return E=`? ${E}`,m&&!A?E+=hMe.lineComment(E,r.indent,d(m)):y&&o&&o(),E;A&&(m=null),g?(m&&(E+=hMe.lineComment(E,r.indent,d(m))),E=`? ${E} +${l}:`):(E=`${E}:`,m&&(E+=hMe.lineComment(E,r.indent,d(m))));let _,v,b;F8.isNode(e)?(_=!!e.spaceBefore,v=e.commentBefore,b=e.comment):(_=!1,v=null,b=null,e&&typeof e=="object"&&(e=c.createNode(e))),r.implicitKey=!1,!g&&!m&&F8.isScalar(e)&&(r.indentAtStart=E.length+1),y=!1,!f&&u.length>=2&&!r.inFlow&&!g&&F8.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let T=!1,w=Iii.stringify(e,r,()=>T=!0,()=>y=!0),R=" ";if(m||_||v){if(R=_?` `:"",v){let x=d(v);R+=` -${eMe.indentComment(x,r.indent)}`}w===""&&!r.inFlow?R===` +${hMe.indentComment(x,r.indent)}`}w===""&&!r.inFlow?R===` `&&b&&(R=` `):R+=` -${r.indent}`}else if(!g&&w8.isCollection(e)){let x=w[0],P=w.indexOf(` +${r.indent}`}else if(!g&&F8.isCollection(e)){let x=w[0],P=w.indexOf(` `),D=P!==-1,N=r.inFlow??e.flow??e.items.length===0;if(D||!N){let L=!1;if(D&&(x==="&"||x==="!")){let B=w.indexOf(" ");x==="&"&&B!==-1&&B{"use strict";p();var Hni=require("process");function rXs(t,...e){t==="debug"&&console.log(...e)}a(rXs,"debug");function nXs(t,e){(t==="debug"||t==="warn")&&(typeof Hni.emitWarning=="function"?Hni.emitWarning(e):console.warn(e))}a(nXs,"warn");Vhr.debug=rXs;Vhr.warn=nXs});var cft=I(aft=>{"use strict";p();var tMe=Za(),Gni=mm(),oft="<<",sft={identify:a(t=>t===oft||typeof t=="symbol"&&t.description===oft,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:a(()=>Object.assign(new Gni.Scalar(Symbol(oft)),{addToJSMap:$ni}),"resolve"),stringify:a(()=>oft,"stringify")},iXs=a((t,e)=>(sft.identify(e)||tMe.isScalar(e)&&(!e.type||e.type===Gni.Scalar.PLAIN)&&sft.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===sft.tag&&r.default),"isMergeKey");function $ni(t,e,r){if(r=t&&tMe.isAlias(r)?r.resolve(t.doc):r,tMe.isSeq(r))for(let n of r.items)zhr(t,e,n);else if(Array.isArray(r))for(let n of r)zhr(t,e,n);else zhr(t,e,r)}a($ni,"addMergeToJSMap");function zhr(t,e,r){let n=t&&tMe.isAlias(r)?r.resolve(t.doc):r;if(!tMe.isMap(n))throw new Error("Merge sources must be maps or map aliases");let o=n.toJSON(null,t,Map);for(let[s,c]of o)e instanceof Map?e.has(s)||e.set(s,c):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:c,writable:!0,enumerable:!0,configurable:!0});return e}a(zhr,"mergeValue");aft.addMergeToJSMap=$ni;aft.isMergeKey=iXs;aft.merge=sft});var Khr=I(zni=>{"use strict";p();var oXs=Whr(),Vni=cft(),sXs=XNe(),Wni=Za(),Yhr=qH();function aXs(t,e,{key:r,value:n}){if(Wni.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(Vni.isMergeKey(t,r))Vni.addMergeToJSMap(t,e,n);else{let o=Yhr.toJS(r,"",t);if(e instanceof Map)e.set(o,Yhr.toJS(n,o,t));else if(e instanceof Set)e.add(o);else{let s=cXs(r,o,t),c=Yhr.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:c,writable:!0,enumerable:!0,configurable:!0}):e[s]=c}}return e}a(aXs,"addPairToJSMap");function cXs(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(Wni.isNode(t)&&r?.doc){let n=sXs.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let o=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(o);s.length>40&&(s=s.substring(0,36)+'..."'),oXs.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return o}return JSON.stringify(e)}a(cXs,"stringifyKey");zni.addPairToJSMap=aXs});var $H=I(Jhr=>{"use strict";p();var Yni=zNe(),lXs=jni(),uXs=Khr(),lft=Za();function dXs(t,e,r){let n=Yni.createNode(t,void 0,r),o=Yni.createNode(e,void 0,r);return new uft(n,o)}a(dXs,"createPair");var uft=class t{static{a(this,"Pair")}constructor(e,r=null){Object.defineProperty(this,lft.NODE_TYPE,{value:lft.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return lft.isNode(r)&&(r=r.clone(e)),lft.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return uXs.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?lXs.stringifyPair(this,e,r,n):JSON.stringify(this)}};Jhr.Pair=uft;Jhr.createPair=dXs});var Zhr=I(Jni=>{"use strict";p();var gee=Za(),Kni=XNe(),dft=YNe();function fXs(t,e,r){return(e.inFlow??t.flow?hXs:pXs)(t,e,r)}a(fXs,"stringifyCollection");function pXs({comment:t,items:e},r,{blockItemPrefix:n,flowChars:o,itemIndent:s,onChompKeep:c,onComment:l}){let{indent:u,options:{commentString:d}}=r,f=Object.assign({},r,{indent:s,type:null}),h=!1,m=[];for(let A=0;AE=null,()=>h=!0);E&&(_+=dft.lineComment(_,s,d(E))),h&&E&&(h=!1),m.push(n+_)}let g;if(m.length===0)g=o.start+o.end;else{g=m[0];for(let A=1;A{"use strict";p();var Rii=require("process");function Oea(t,...e){t==="debug"&&console.log(...e)}a(Oea,"debug");function Lea(t,e){(t==="debug"||t==="warn")&&(typeof Rii.emitWarning=="function"?Rii.emitWarning(e):console.warn(e))}a(Lea,"warn");Amr.debug=Oea;Amr.warn=Lea});var vft=I(_ft=>{"use strict";p();var mMe=tc(),kii=_m(),yft="<<",Eft={identify:a(t=>t===yft||typeof t=="symbol"&&t.description===yft,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:a(()=>Object.assign(new kii.Scalar(Symbol(yft)),{addToJSMap:Pii}),"resolve"),stringify:a(()=>yft,"stringify")},Bea=a((t,e)=>(Eft.identify(e)||mMe.isScalar(e)&&(!e.type||e.type===kii.Scalar.PLAIN)&&Eft.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Eft.tag&&r.default),"isMergeKey");function Pii(t,e,r){if(r=t&&mMe.isAlias(r)?r.resolve(t.doc):r,mMe.isSeq(r))for(let n of r.items)Emr(t,e,n);else if(Array.isArray(r))for(let n of r)Emr(t,e,n);else Emr(t,e,r)}a(Pii,"addMergeToJSMap");function Emr(t,e,r){let n=t&&mMe.isAlias(r)?r.resolve(t.doc):r;if(!mMe.isMap(n))throw new Error("Merge sources must be maps or map aliases");let o=n.toJSON(null,t,Map);for(let[s,c]of o)e instanceof Map?e.has(s)||e.set(s,c):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:c,writable:!0,enumerable:!0,configurable:!0});return e}a(Emr,"mergeValue");_ft.addMergeToJSMap=Pii;_ft.isMergeKey=Bea;_ft.merge=Eft});var vmr=I(Mii=>{"use strict";p();var Fea=ymr(),Dii=vft(),Uea=pMe(),Nii=tc(),_mr=ZH();function Qea(t,e,{key:r,value:n}){if(Nii.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(Dii.isMergeKey(t,r))Dii.addMergeToJSMap(t,e,n);else{let o=_mr.toJS(r,"",t);if(e instanceof Map)e.set(o,_mr.toJS(n,o,t));else if(e instanceof Set)e.add(o);else{let s=qea(r,o,t),c=_mr.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:c,writable:!0,enumerable:!0,configurable:!0}):e[s]=c}}return e}a(Qea,"addPairToJSMap");function qea(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(Nii.isNode(t)&&r?.doc){let n=Uea.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let o=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(o);s.length>40&&(s=s.substring(0,36)+'..."'),Fea.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return o}return JSON.stringify(e)}a(qea,"stringifyKey");Mii.addPairToJSMap=Qea});var rG=I(Cmr=>{"use strict";p();var Oii=cMe(),jea=wii(),Hea=vmr(),Cft=tc();function Gea(t,e,r){let n=Oii.createNode(t,void 0,r),o=Oii.createNode(e,void 0,r);return new bft(n,o)}a(Gea,"createPair");var bft=class t{static{a(this,"Pair")}constructor(e,r=null){Object.defineProperty(this,Cft.NODE_TYPE,{value:Cft.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Cft.isNode(r)&&(r=r.clone(e)),Cft.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return Hea.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?jea.stringifyPair(this,e,r,n):JSON.stringify(this)}};Cmr.Pair=bft;Cmr.createPair=Gea});var bmr=I(Bii=>{"use strict";p();var _ee=tc(),Lii=pMe(),Sft=lMe();function $ea(t,e,r){return(e.inFlow??t.flow?Wea:Vea)(t,e,r)}a($ea,"stringifyCollection");function Vea({comment:t,items:e},r,{blockItemPrefix:n,flowChars:o,itemIndent:s,onChompKeep:c,onComment:l}){let{indent:u,options:{commentString:d}}=r,f=Object.assign({},r,{indent:s,type:null}),h=!1,m=[];for(let A=0;AE=null,()=>h=!0);E&&(_+=Sft.lineComment(_,s,d(E))),h&&E&&(h=!1),m.push(n+_)}let g;if(m.length===0)g=o.start+o.end;else{g=m[0];for(let A=1;AE=null);d||(d=h.length>f||_.includes(` -`)),A0&&(d||(d=h.reduce((v,b)=>v+b.length+2,2)+(_.length+2)>e.options.lineWidth)),d&&(_+=",")),E&&(_+=dft.lineComment(_,n,l(E))),h.push(_),f=h.length}let{start:m,end:g}=r;if(h.length===0)return m+g;if(!d){let A=h.reduce((y,E)=>y+E.length+2,2);d=e.options.lineWidth>0&&A>e.options.lineWidth}if(d){let A=m;for(let y of h)A+=y?` +`+Sft.indentComment(d(t),u),l&&l()):h&&c&&c(),g}a(Vea,"stringifyBlockCollection");function Wea({items:t},e,{flowChars:r,itemIndent:n}){let{indent:o,indentStep:s,flowCollectionPadding:c,options:{commentString:l}}=e;n+=s;let u=Object.assign({},e,{indent:n,inFlow:!0,type:null}),d=!1,f=0,h=[];for(let A=0;AE=null);d||(d=h.length>f||_.includes(` +`)),A0&&(d||(d=h.reduce((v,b)=>v+b.length+2,2)+(_.length+2)>e.options.lineWidth)),d&&(_+=",")),E&&(_+=Sft.lineComment(_,n,l(E))),h.push(_),f=h.length}let{start:m,end:g}=r;if(h.length===0)return m+g;if(!d){let A=h.reduce((y,E)=>y+E.length+2,2);d=e.options.lineWidth>0&&A>e.options.lineWidth}if(d){let A=m;for(let y of h)A+=y?` ${s}${o}${y}`:` `;return`${A} -${o}${g}`}else return`${m}${c}${h.join(" ")}${c}${g}`}a(hXs,"stringifyFlowCollection");function fft({indent:t,options:{commentString:e}},r,n,o){if(n&&o&&(n=n.replace(/^\n+/,"")),n){let s=dft.indentComment(e(n),t);r.push(s.trimStart())}}a(fft,"addCommentBefore");Jni.stringifyCollection=fXs});var WH=I(emr=>{"use strict";p();var mXs=Zhr(),gXs=Khr(),AXs=Xdt(),VH=Za(),pft=$H(),yXs=mm();function rMe(t,e){let r=VH.isScalar(e)?e.value:e;for(let n of t)if(VH.isPair(n)&&(n.key===e||n.key===r||VH.isScalar(n.key)&&n.key.value===r))return n}a(rMe,"findPair");var Xhr=class extends AXs.Collection{static{a(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(VH.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:o,replacer:s}=n,c=new this(e),l=a((u,d)=>{if(typeof s=="function")d=s.call(r,u,d);else if(Array.isArray(s)&&!s.includes(u))return;(d!==void 0||o)&&c.items.push(pft.createPair(u,d,n))},"add");if(r instanceof Map)for(let[u,d]of r)l(u,d);else if(r&&typeof r=="object")for(let u of Object.keys(r))l(u,r[u]);return typeof e.sortMapEntries=="function"&&c.items.sort(e.sortMapEntries),c}add(e,r){let n;VH.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new pft.Pair(e,e?.value):n=new pft.Pair(e.key,e.value);let o=rMe(this.items,n.key),s=this.schema?.sortMapEntries;if(o){if(!r)throw new Error(`Key ${n.key} already set`);VH.isScalar(o.value)&&yXs.isScalarValue(n.value)?o.value.value=n.value:o.value=n.value}else if(s){let c=this.items.findIndex(l=>s(n,l)<0);c===-1?this.items.push(n):this.items.splice(c,0,n)}else this.items.push(n)}delete(e){let r=rMe(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let o=rMe(this.items,e)?.value;return(!r&&VH.isScalar(o)?o.value:o)??void 0}has(e){return!!rMe(this.items,e)}set(e,r){this.add(new pft.Pair(e,r),!0)}toJSON(e,r,n){let o=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(o);for(let s of this.items)gXs.addPairToJSMap(r,o,s);return o}toString(e,r,n){if(!e)return JSON.stringify(this);for(let o of this.items)if(!VH.isPair(o))throw new Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),mXs.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};emr.YAMLMap=Xhr;emr.findPair=rMe});var Bme=I(Xni=>{"use strict";p();var EXs=Za(),Zni=WH(),_Xs={collection:"map",default:!0,nodeClass:Zni.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return EXs.isMap(t)||e("Expected a mapping for this tag"),t},createNode:a((t,e,r)=>Zni.YAMLMap.from(t,e,r),"createNode")};Xni.map=_Xs});var zH=I(eii=>{"use strict";p();var vXs=zNe(),CXs=Zhr(),bXs=Xdt(),mft=Za(),SXs=mm(),TXs=qH(),tmr=class extends bXs.Collection{static{a(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(mft.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=hft(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=hft(e);if(typeof n!="number")return;let o=this.items[n];return!r&&mft.isScalar(o)?o.value:o}has(e){let r=hft(e);return typeof r=="number"&&r=0?e:null}a(hft,"asItemIndex");eii.YAMLSeq=tmr});var Fme=I(rii=>{"use strict";p();var IXs=Za(),tii=zH(),xXs={collection:"seq",default:!0,nodeClass:tii.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return IXs.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:a((t,e,r)=>tii.YAMLSeq.from(t,e,r),"createNode")};rii.seq=xXs});var nMe=I(nii=>{"use strict";p();var wXs=ZNe(),RXs={identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),wXs.stringifyString(t,e,r,n)}};nii.string=RXs});var gft=I(sii=>{"use strict";p();var iii=mm(),oii={identify:a(t=>t==null,"identify"),createNode:a(()=>new iii.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:a(()=>new iii.Scalar(null),"resolve"),stringify:a(({source:t},e)=>typeof t=="string"&&oii.test.test(t)?t:e.options.nullStr,"stringify")};sii.nullTag=oii});var rmr=I(cii=>{"use strict";p();var kXs=mm(),aii={identify:a(t=>typeof t=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:a(t=>new kXs.Scalar(t[0]==="t"||t[0]==="T"),"resolve"),stringify({source:t,value:e},r){if(t&&aii.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};cii.boolTag=aii});var Ume=I(lii=>{"use strict";p();function PXs({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let o=typeof n=="number"?n:Number(n);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let s=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let c=s.indexOf(".");c<0&&(c=s.length,s+=".");let l=e-(s.length-c-1);for(;l-- >0;)s+="0"}return s}a(PXs,"stringifyNumber");lii.stringifyNumber=PXs});var imr=I(Aft=>{"use strict";p();var DXs=mm(),nmr=Ume(),NXs={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:nmr.stringifyNumber},MXs={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:a(t=>parseFloat(t),"resolve"),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():nmr.stringifyNumber(t)}},OXs={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new DXs.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:nmr.stringifyNumber};Aft.float=OXs;Aft.floatExp=MXs;Aft.floatNaN=NXs});var smr=I(Eft=>{"use strict";p();var uii=Ume(),yft=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify"),omr=a((t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r),"intResolve");function dii(t,e,r){let{value:n}=t;return yft(n)&&n>=0?r+n.toString(e):uii.stringifyNumber(t)}a(dii,"intStringify");var LXs={identify:a(t=>yft(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:a((t,e,r)=>omr(t,2,8,r),"resolve"),stringify:a(t=>dii(t,8,"0o"),"stringify")},BXs={identify:yft,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:a((t,e,r)=>omr(t,0,10,r),"resolve"),stringify:uii.stringifyNumber},FXs={identify:a(t=>yft(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:a((t,e,r)=>omr(t,2,16,r),"resolve"),stringify:a(t=>dii(t,16,"0x"),"stringify")};Eft.int=BXs;Eft.intHex=FXs;Eft.intOct=LXs});var pii=I(fii=>{"use strict";p();var UXs=Bme(),QXs=gft(),qXs=Fme(),jXs=nMe(),HXs=rmr(),amr=imr(),cmr=smr(),GXs=[UXs.map,qXs.seq,jXs.string,QXs.nullTag,HXs.boolTag,cmr.intOct,cmr.int,cmr.intHex,amr.floatNaN,amr.floatExp,amr.float];fii.schema=GXs});var gii=I(mii=>{"use strict";p();var $Xs=mm(),VXs=Bme(),WXs=Fme();function hii(t){return typeof t=="bigint"||Number.isInteger(t)}a(hii,"intIdentify");var _ft=a(({value:t})=>JSON.stringify(t),"stringifyJSON"),zXs=[{identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify:_ft},{identify:a(t=>t==null,"identify"),createNode:a(()=>new $Xs.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:a(()=>null,"resolve"),stringify:_ft},{identify:a(t=>typeof t=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:a(t=>t==="true","resolve"),stringify:_ft},{identify:hii,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:a((t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),"resolve"),stringify:a(({value:t})=>hii(t)?t.toString():JSON.stringify(t),"stringify")},{identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:a(t=>parseFloat(t),"resolve"),stringify:_ft}],YXs={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},KXs=[VXs.map,WXs.seq].concat(zXs,YXs);mii.schema=KXs});var umr=I(Aii=>{"use strict";p();var iMe=require("buffer"),lmr=mm(),JXs=ZNe(),ZXs={identify:a(t=>t instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof iMe.Buffer=="function")return iMe.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let o=0;o{"use strict";p();var vft=Za(),dmr=$H(),XXs=mm(),eea=zH();function yii(t,e){if(vft.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let o=n.items[0]||new dmr.Pair(new XXs.Scalar(null));if(n.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${n.commentBefore} +${o}${g}`}else return`${m}${c}${h.join(" ")}${c}${g}`}a(Wea,"stringifyFlowCollection");function Tft({indent:t,options:{commentString:e}},r,n,o){if(n&&o&&(n=n.replace(/^\n+/,"")),n){let s=Sft.indentComment(e(n),t);r.push(s.trimStart())}}a(Tft,"addCommentBefore");Bii.stringifyCollection=$ea});var iG=I(Tmr=>{"use strict";p();var zea=bmr(),Yea=vmr(),Kea=fft(),nG=tc(),Ift=rG(),Jea=_m();function gMe(t,e){let r=nG.isScalar(e)?e.value:e;for(let n of t)if(nG.isPair(n)&&(n.key===e||n.key===r||nG.isScalar(n.key)&&n.key.value===r))return n}a(gMe,"findPair");var Smr=class extends Kea.Collection{static{a(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(nG.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:o,replacer:s}=n,c=new this(e),l=a((u,d)=>{if(typeof s=="function")d=s.call(r,u,d);else if(Array.isArray(s)&&!s.includes(u))return;(d!==void 0||o)&&c.items.push(Ift.createPair(u,d,n))},"add");if(r instanceof Map)for(let[u,d]of r)l(u,d);else if(r&&typeof r=="object")for(let u of Object.keys(r))l(u,r[u]);return typeof e.sortMapEntries=="function"&&c.items.sort(e.sortMapEntries),c}add(e,r){let n;nG.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Ift.Pair(e,e?.value):n=new Ift.Pair(e.key,e.value);let o=gMe(this.items,n.key),s=this.schema?.sortMapEntries;if(o){if(!r)throw new Error(`Key ${n.key} already set`);nG.isScalar(o.value)&&Jea.isScalarValue(n.value)?o.value.value=n.value:o.value=n.value}else if(s){let c=this.items.findIndex(l=>s(n,l)<0);c===-1?this.items.push(n):this.items.splice(c,0,n)}else this.items.push(n)}delete(e){let r=gMe(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let o=gMe(this.items,e)?.value;return(!r&&nG.isScalar(o)?o.value:o)??void 0}has(e){return!!gMe(this.items,e)}set(e,r){this.add(new Ift.Pair(e,r),!0)}toJSON(e,r,n){let o=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(o);for(let s of this.items)Yea.addPairToJSMap(r,o,s);return o}toString(e,r,n){if(!e)return JSON.stringify(this);for(let o of this.items)if(!nG.isPair(o))throw new Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),zea.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};Tmr.YAMLMap=Smr;Tmr.findPair=gMe});var Yme=I(Uii=>{"use strict";p();var Zea=tc(),Fii=iG(),Xea={collection:"map",default:!0,nodeClass:Fii.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Zea.isMap(t)||e("Expected a mapping for this tag"),t},createNode:a((t,e,r)=>Fii.YAMLMap.from(t,e,r),"createNode")};Uii.map=Xea});var oG=I(Qii=>{"use strict";p();var eta=cMe(),tta=bmr(),rta=fft(),wft=tc(),nta=_m(),ita=ZH(),Imr=class extends rta.Collection{static{a(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(wft.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=xft(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=xft(e);if(typeof n!="number")return;let o=this.items[n];return!r&&wft.isScalar(o)?o.value:o}has(e){let r=xft(e);return typeof r=="number"&&r=0?e:null}a(xft,"asItemIndex");Qii.YAMLSeq=Imr});var Kme=I(jii=>{"use strict";p();var ota=tc(),qii=oG(),sta={collection:"seq",default:!0,nodeClass:qii.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return ota.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:a((t,e,r)=>qii.YAMLSeq.from(t,e,r),"createNode")};jii.seq=sta});var AMe=I(Hii=>{"use strict";p();var ata=fMe(),cta={identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),ata.stringifyString(t,e,r,n)}};Hii.string=cta});var Rft=I(Vii=>{"use strict";p();var Gii=_m(),$ii={identify:a(t=>t==null,"identify"),createNode:a(()=>new Gii.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:a(()=>new Gii.Scalar(null),"resolve"),stringify:a(({source:t},e)=>typeof t=="string"&&$ii.test.test(t)?t:e.options.nullStr,"stringify")};Vii.nullTag=$ii});var xmr=I(zii=>{"use strict";p();var lta=_m(),Wii={identify:a(t=>typeof t=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:a(t=>new lta.Scalar(t[0]==="t"||t[0]==="T"),"resolve"),stringify({source:t,value:e},r){if(t&&Wii.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};zii.boolTag=Wii});var Jme=I(Yii=>{"use strict";p();function uta({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let o=typeof n=="number"?n:Number(n);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let s=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let c=s.indexOf(".");c<0&&(c=s.length,s+=".");let l=e-(s.length-c-1);for(;l-- >0;)s+="0"}return s}a(uta,"stringifyNumber");Yii.stringifyNumber=uta});var Rmr=I(kft=>{"use strict";p();var dta=_m(),wmr=Jme(),fta={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:wmr.stringifyNumber},pta={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:a(t=>parseFloat(t),"resolve"),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():wmr.stringifyNumber(t)}},hta={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new dta.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:wmr.stringifyNumber};kft.float=hta;kft.floatExp=pta;kft.floatNaN=fta});var Pmr=I(Dft=>{"use strict";p();var Kii=Jme(),Pft=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify"),kmr=a((t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r),"intResolve");function Jii(t,e,r){let{value:n}=t;return Pft(n)&&n>=0?r+n.toString(e):Kii.stringifyNumber(t)}a(Jii,"intStringify");var mta={identify:a(t=>Pft(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:a((t,e,r)=>kmr(t,2,8,r),"resolve"),stringify:a(t=>Jii(t,8,"0o"),"stringify")},gta={identify:Pft,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:a((t,e,r)=>kmr(t,0,10,r),"resolve"),stringify:Kii.stringifyNumber},Ata={identify:a(t=>Pft(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:a((t,e,r)=>kmr(t,2,16,r),"resolve"),stringify:a(t=>Jii(t,16,"0x"),"stringify")};Dft.int=gta;Dft.intHex=Ata;Dft.intOct=mta});var Xii=I(Zii=>{"use strict";p();var yta=Yme(),Eta=Rft(),_ta=Kme(),vta=AMe(),Cta=xmr(),Dmr=Rmr(),Nmr=Pmr(),bta=[yta.map,_ta.seq,vta.string,Eta.nullTag,Cta.boolTag,Nmr.intOct,Nmr.int,Nmr.intHex,Dmr.floatNaN,Dmr.floatExp,Dmr.float];Zii.schema=bta});var roi=I(toi=>{"use strict";p();var Sta=_m(),Tta=Yme(),Ita=Kme();function eoi(t){return typeof t=="bigint"||Number.isInteger(t)}a(eoi,"intIdentify");var Nft=a(({value:t})=>JSON.stringify(t),"stringifyJSON"),xta=[{identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify:Nft},{identify:a(t=>t==null,"identify"),createNode:a(()=>new Sta.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:a(()=>null,"resolve"),stringify:Nft},{identify:a(t=>typeof t=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:a(t=>t==="true","resolve"),stringify:Nft},{identify:eoi,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:a((t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),"resolve"),stringify:a(({value:t})=>eoi(t)?t.toString():JSON.stringify(t),"stringify")},{identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:a(t=>parseFloat(t),"resolve"),stringify:Nft}],wta={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Rta=[Tta.map,Ita.seq].concat(xta,wta);toi.schema=Rta});var Omr=I(noi=>{"use strict";p();var yMe=require("buffer"),Mmr=_m(),kta=fMe(),Pta={identify:a(t=>t instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof yMe.Buffer=="function")return yMe.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let o=0;o{"use strict";p();var Mft=tc(),Lmr=rG(),Dta=_m(),Nta=oG();function ioi(t,e){if(Mft.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let o=n.items[0]||new Lmr.Pair(new Dta.Scalar(null));if(n.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${n.commentBefore} ${o.key.commentBefore}`:n.commentBefore),n.comment){let s=o.value??o.key;s.comment=s.comment?`${n.comment} -${s.comment}`:n.comment}n=o}t.items[r]=vft.isPair(n)?n:new dmr.Pair(n)}}else e("Expected a sequence for this tag");return t}a(yii,"resolvePairs");function Eii(t,e,r){let{replacer:n}=r,o=new eea.YAMLSeq(t);o.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let c of e){typeof n=="function"&&(c=n.call(e,String(s++),c));let l,u;if(Array.isArray(c))if(c.length===2)l=c[0],u=c[1];else throw new TypeError(`Expected [key, value] tuple: ${c}`);else if(c&&c instanceof Object){let d=Object.keys(c);if(d.length===1)l=d[0],u=c[l];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else l=c;o.items.push(dmr.createPair(l,u,r))}return o}a(Eii,"createPairs");var tea={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:yii,createNode:Eii};Cft.createPairs=Eii;Cft.pairs=tea;Cft.resolvePairs=yii});var hmr=I(pmr=>{"use strict";p();var _ii=Za(),fmr=qH(),oMe=WH(),rea=zH(),vii=bft(),Aee=class t extends rea.YAMLSeq{static{a(this,"YAMLOMap")}constructor(){super(),this.add=oMe.YAMLMap.prototype.add.bind(this),this.delete=oMe.YAMLMap.prototype.delete.bind(this),this.get=oMe.YAMLMap.prototype.get.bind(this),this.has=oMe.YAMLMap.prototype.has.bind(this),this.set=oMe.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let o of this.items){let s,c;if(_ii.isPair(o)?(s=fmr.toJS(o.key,"",r),c=fmr.toJS(o.value,s,r)):s=fmr.toJS(o,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,c)}return n}static from(e,r,n){let o=vii.createPairs(e,r,n),s=new this;return s.items=o.items,s}};Aee.tag="tag:yaml.org,2002:omap";var nea={collection:"seq",identify:a(t=>t instanceof Map,"identify"),nodeClass:Aee,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=vii.resolvePairs(t,e),n=[];for(let{key:o}of r.items)_ii.isScalar(o)&&(n.includes(o.value)?e(`Ordered maps must not include duplicate keys: ${o.value}`):n.push(o.value));return Object.assign(new Aee,r)},createNode:a((t,e,r)=>Aee.from(t,e,r),"createNode")};pmr.YAMLOMap=Aee;pmr.omap=nea});var Iii=I(mmr=>{"use strict";p();var Cii=mm();function bii({value:t,source:e},r){return e&&(t?Sii:Tii).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}a(bii,"boolStringify");var Sii={identify:a(t=>t===!0,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:a(()=>new Cii.Scalar(!0),"resolve"),stringify:bii},Tii={identify:a(t=>t===!1,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:a(()=>new Cii.Scalar(!1),"resolve"),stringify:bii};mmr.falseTag=Tii;mmr.trueTag=Sii});var xii=I(Sft=>{"use strict";p();var iea=mm(),gmr=Ume(),oea={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:gmr.stringifyNumber},sea={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:a(t=>parseFloat(t.replace(/_/g,"")),"resolve"),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():gmr.stringifyNumber(t)}},aea={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new iea.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:gmr.stringifyNumber};Sft.float=aea;Sft.floatExp=sea;Sft.floatNaN=oea});var Rii=I(aMe=>{"use strict";p();var wii=Ume(),sMe=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify");function Tft(t,e,r,{intAsBigInt:n}){let o=t[0];if((o==="-"||o==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let c=BigInt(t);return o==="-"?BigInt(-1)*c:c}let s=parseInt(t,r);return o==="-"?-1*s:s}a(Tft,"intResolve");function Amr(t,e,r){let{value:n}=t;if(sMe(n)){let o=n.toString(e);return n<0?"-"+r+o.substr(1):r+o}return wii.stringifyNumber(t)}a(Amr,"intStringify");var cea={identify:sMe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:a((t,e,r)=>Tft(t,2,2,r),"resolve"),stringify:a(t=>Amr(t,2,"0b"),"stringify")},lea={identify:sMe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:a((t,e,r)=>Tft(t,1,8,r),"resolve"),stringify:a(t=>Amr(t,8,"0"),"stringify")},uea={identify:sMe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:a((t,e,r)=>Tft(t,0,10,r),"resolve"),stringify:wii.stringifyNumber},dea={identify:sMe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:a((t,e,r)=>Tft(t,2,16,r),"resolve"),stringify:a(t=>Amr(t,16,"0x"),"stringify")};aMe.int=uea;aMe.intBin=cea;aMe.intHex=dea;aMe.intOct=lea});var Emr=I(ymr=>{"use strict";p();var wft=Za(),Ift=$H(),xft=WH(),yee=class t extends xft.YAMLMap{static{a(this,"YAMLSet")}constructor(e){super(e),this.tag=t.tag}add(e){let r;wft.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Ift.Pair(e.key,null):r=new Ift.Pair(e,null),xft.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=xft.findPair(this.items,e);return!r&&wft.isPair(n)?wft.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=xft.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Ift.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:o}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let c of r)typeof o=="function"&&(c=o.call(r,c,c)),s.items.push(Ift.createPair(c,null,n));return s}};yee.tag="tag:yaml.org,2002:set";var fea={collection:"map",identify:a(t=>t instanceof Set,"identify"),nodeClass:yee,default:!1,tag:"tag:yaml.org,2002:set",createNode:a((t,e,r)=>yee.from(t,e,r),"createNode"),resolve(t,e){if(wft.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new yee,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};ymr.YAMLSet=yee;ymr.set=fea});var vmr=I(Rft=>{"use strict";p();var pea=Ume();function _mr(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,o=a(c=>e?BigInt(c):Number(c),"num"),s=n.replace(/_/g,"").split(":").reduce((c,l)=>c*o(60)+o(l),o(0));return r==="-"?o(-1)*s:s}a(_mr,"parseSexagesimal");function kii(t){let{value:e}=t,r=a(c=>c,"num");if(typeof e=="bigint")r=a(c=>BigInt(c),"num");else if(isNaN(e)||!isFinite(e))return pea.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let o=r(60),s=[e%o];return e<60?s.unshift(0):(e=(e-s[0])/o,s.unshift(e%o),e>=60&&(e=(e-s[0])/o,s.unshift(e))),n+s.map(c=>String(c).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}a(kii,"stringifySexagesimal");var hea={identify:a(t=>typeof t=="bigint"||Number.isInteger(t),"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:a((t,e,{intAsBigInt:r})=>_mr(t,r),"resolve"),stringify:kii},mea={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:a(t=>_mr(t,!1),"resolve"),stringify:kii},Pii={identify:a(t=>t instanceof Date,"identify"),default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(Pii.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,o,s,c,l]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0,d=Date.UTC(r,n-1,o,s||0,c||0,l||0,u),f=e[8];if(f&&f!=="Z"){let h=_mr(f,!1);Math.abs(h)<30&&(h*=60),d-=6e4*h}return new Date(d)},stringify:a(({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??"","stringify")};Rft.floatTime=mea;Rft.intTime=hea;Rft.timestamp=Pii});var Mii=I(Nii=>{"use strict";p();var gea=Bme(),Aea=gft(),yea=Fme(),Eea=nMe(),_ea=umr(),Dii=Iii(),Cmr=xii(),kft=Rii(),vea=cft(),Cea=hmr(),bea=bft(),Sea=Emr(),bmr=vmr(),Tea=[gea.map,yea.seq,Eea.string,Aea.nullTag,Dii.trueTag,Dii.falseTag,kft.intBin,kft.intOct,kft.int,kft.intHex,Cmr.floatNaN,Cmr.floatExp,Cmr.float,_ea.binary,vea.merge,Cea.omap,bea.pairs,Sea.set,bmr.intTime,bmr.floatTime,bmr.timestamp];Nii.schema=Tea});var Gii=I(Imr=>{"use strict";p();var Fii=Bme(),Iea=gft(),Uii=Fme(),xea=nMe(),wea=rmr(),Smr=imr(),Tmr=smr(),Rea=pii(),kea=gii(),Qii=umr(),cMe=cft(),qii=hmr(),jii=bft(),Oii=Mii(),Hii=Emr(),Pft=vmr(),Lii=new Map([["core",Rea.schema],["failsafe",[Fii.map,Uii.seq,xea.string]],["json",kea.schema],["yaml11",Oii.schema],["yaml-1.1",Oii.schema]]),Bii={binary:Qii.binary,bool:wea.boolTag,float:Smr.float,floatExp:Smr.floatExp,floatNaN:Smr.floatNaN,floatTime:Pft.floatTime,int:Tmr.int,intHex:Tmr.intHex,intOct:Tmr.intOct,intTime:Pft.intTime,map:Fii.map,merge:cMe.merge,null:Iea.nullTag,omap:qii.omap,pairs:jii.pairs,seq:Uii.seq,set:Hii.set,timestamp:Pft.timestamp},Pea={"tag:yaml.org,2002:binary":Qii.binary,"tag:yaml.org,2002:merge":cMe.merge,"tag:yaml.org,2002:omap":qii.omap,"tag:yaml.org,2002:pairs":jii.pairs,"tag:yaml.org,2002:set":Hii.set,"tag:yaml.org,2002:timestamp":Pft.timestamp};function Dea(t,e,r){let n=Lii.get(e);if(n&&!t)return r&&!n.includes(cMe.merge)?n.concat(cMe.merge):n.slice();let o=n;if(!o)if(Array.isArray(t))o=[];else{let s=Array.from(Lii.keys()).filter(c=>c!=="yaml11").map(c=>JSON.stringify(c)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)o=o.concat(s);else typeof t=="function"&&(o=t(o.slice()));return r&&(o=o.concat(cMe.merge)),o.reduce((s,c)=>{let l=typeof c=="string"?Bii[c]:c;if(!l){let u=JSON.stringify(c),d=Object.keys(Bii).map(f=>JSON.stringify(f)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${d}`)}return s.includes(l)||s.push(l),s},[])}a(Dea,"getTags");Imr.coreKnownTags=Pea;Imr.getTags=Dea});var Rmr=I($ii=>{"use strict";p();var xmr=Za(),Nea=Bme(),Mea=Fme(),Oea=nMe(),Dft=Gii(),Lea=a((t,e)=>t.keye.key?1:0,"sortMapEntriesByKey"),wmr=class t{static{a(this,"Schema")}constructor({compat:e,customTags:r,merge:n,resolveKnownTags:o,schema:s,sortMapEntries:c,toStringDefaults:l}){this.compat=Array.isArray(e)?Dft.getTags(e,"compat"):e?Dft.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=o?Dft.coreKnownTags:{},this.tags=Dft.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,xmr.MAP,{value:Nea.map}),Object.defineProperty(this,xmr.SCALAR,{value:Oea.string}),Object.defineProperty(this,xmr.SEQ,{value:Mea.seq}),this.sortMapEntries=typeof c=="function"?c:c===!0?Lea:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};$ii.Schema=wmr});var Wii=I(Vii=>{"use strict";p();var Bea=Za(),kmr=XNe(),lMe=YNe();function Fea(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let u=t.directives.toString(t);u?(r.push(u),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let o=kmr.createStringifyContext(t,e),{commentString:s}=o.options;if(t.commentBefore){r.length!==1&&r.unshift("");let u=s(t.commentBefore);r.unshift(lMe.indentComment(u,""))}let c=!1,l=null;if(t.contents){if(Bea.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let f=s(t.contents.commentBefore);r.push(lMe.indentComment(f,""))}o.forceBlockIndent=!!t.comment,l=t.contents.comment}let u=l?void 0:()=>c=!0,d=kmr.stringify(t.contents,o,()=>l=null,u);l&&(d+=lMe.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(kmr.stringify(t.contents,o));if(t.directives?.docEnd)if(t.comment){let u=s(t.comment);u.includes(` -`)?(r.push("..."),r.push(lMe.indentComment(u,""))):r.push(`... ${u}`)}else r.push("...");else{let u=t.comment;u&&c&&(u=u.replace(/^\n+/,"")),u&&((!c||l)&&r[r.length-1]!==""&&r.push(""),r.push(lMe.indentComment(s(u),"")))}return r.join(` +${s.comment}`:n.comment}n=o}t.items[r]=Mft.isPair(n)?n:new Lmr.Pair(n)}}else e("Expected a sequence for this tag");return t}a(ioi,"resolvePairs");function ooi(t,e,r){let{replacer:n}=r,o=new Nta.YAMLSeq(t);o.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let c of e){typeof n=="function"&&(c=n.call(e,String(s++),c));let l,u;if(Array.isArray(c))if(c.length===2)l=c[0],u=c[1];else throw new TypeError(`Expected [key, value] tuple: ${c}`);else if(c&&c instanceof Object){let d=Object.keys(c);if(d.length===1)l=d[0],u=c[l];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else l=c;o.items.push(Lmr.createPair(l,u,r))}return o}a(ooi,"createPairs");var Mta={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ioi,createNode:ooi};Oft.createPairs=ooi;Oft.pairs=Mta;Oft.resolvePairs=ioi});var Umr=I(Fmr=>{"use strict";p();var soi=tc(),Bmr=ZH(),EMe=iG(),Ota=oG(),aoi=Lft(),vee=class t extends Ota.YAMLSeq{static{a(this,"YAMLOMap")}constructor(){super(),this.add=EMe.YAMLMap.prototype.add.bind(this),this.delete=EMe.YAMLMap.prototype.delete.bind(this),this.get=EMe.YAMLMap.prototype.get.bind(this),this.has=EMe.YAMLMap.prototype.has.bind(this),this.set=EMe.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let o of this.items){let s,c;if(soi.isPair(o)?(s=Bmr.toJS(o.key,"",r),c=Bmr.toJS(o.value,s,r)):s=Bmr.toJS(o,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,c)}return n}static from(e,r,n){let o=aoi.createPairs(e,r,n),s=new this;return s.items=o.items,s}};vee.tag="tag:yaml.org,2002:omap";var Lta={collection:"seq",identify:a(t=>t instanceof Map,"identify"),nodeClass:vee,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=aoi.resolvePairs(t,e),n=[];for(let{key:o}of r.items)soi.isScalar(o)&&(n.includes(o.value)?e(`Ordered maps must not include duplicate keys: ${o.value}`):n.push(o.value));return Object.assign(new vee,r)},createNode:a((t,e,r)=>vee.from(t,e,r),"createNode")};Fmr.YAMLOMap=vee;Fmr.omap=Lta});var foi=I(Qmr=>{"use strict";p();var coi=_m();function loi({value:t,source:e},r){return e&&(t?uoi:doi).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}a(loi,"boolStringify");var uoi={identify:a(t=>t===!0,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:a(()=>new coi.Scalar(!0),"resolve"),stringify:loi},doi={identify:a(t=>t===!1,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:a(()=>new coi.Scalar(!1),"resolve"),stringify:loi};Qmr.falseTag=doi;Qmr.trueTag=uoi});var poi=I(Bft=>{"use strict";p();var Bta=_m(),qmr=Jme(),Fta={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:qmr.stringifyNumber},Uta={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:a(t=>parseFloat(t.replace(/_/g,"")),"resolve"),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():qmr.stringifyNumber(t)}},Qta={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Bta.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:qmr.stringifyNumber};Bft.float=Qta;Bft.floatExp=Uta;Bft.floatNaN=Fta});var moi=I(vMe=>{"use strict";p();var hoi=Jme(),_Me=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify");function Fft(t,e,r,{intAsBigInt:n}){let o=t[0];if((o==="-"||o==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let c=BigInt(t);return o==="-"?BigInt(-1)*c:c}let s=parseInt(t,r);return o==="-"?-1*s:s}a(Fft,"intResolve");function jmr(t,e,r){let{value:n}=t;if(_Me(n)){let o=n.toString(e);return n<0?"-"+r+o.substr(1):r+o}return hoi.stringifyNumber(t)}a(jmr,"intStringify");var qta={identify:_Me,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:a((t,e,r)=>Fft(t,2,2,r),"resolve"),stringify:a(t=>jmr(t,2,"0b"),"stringify")},jta={identify:_Me,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:a((t,e,r)=>Fft(t,1,8,r),"resolve"),stringify:a(t=>jmr(t,8,"0"),"stringify")},Hta={identify:_Me,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:a((t,e,r)=>Fft(t,0,10,r),"resolve"),stringify:hoi.stringifyNumber},Gta={identify:_Me,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:a((t,e,r)=>Fft(t,2,16,r),"resolve"),stringify:a(t=>jmr(t,16,"0x"),"stringify")};vMe.int=Hta;vMe.intBin=qta;vMe.intHex=Gta;vMe.intOct=jta});var Gmr=I(Hmr=>{"use strict";p();var qft=tc(),Uft=rG(),Qft=iG(),Cee=class t extends Qft.YAMLMap{static{a(this,"YAMLSet")}constructor(e){super(e),this.tag=t.tag}add(e){let r;qft.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Uft.Pair(e.key,null):r=new Uft.Pair(e,null),Qft.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Qft.findPair(this.items,e);return!r&&qft.isPair(n)?qft.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Qft.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Uft.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:o}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let c of r)typeof o=="function"&&(c=o.call(r,c,c)),s.items.push(Uft.createPair(c,null,n));return s}};Cee.tag="tag:yaml.org,2002:set";var $ta={collection:"map",identify:a(t=>t instanceof Set,"identify"),nodeClass:Cee,default:!1,tag:"tag:yaml.org,2002:set",createNode:a((t,e,r)=>Cee.from(t,e,r),"createNode"),resolve(t,e){if(qft.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Cee,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Hmr.YAMLSet=Cee;Hmr.set=$ta});var Vmr=I(jft=>{"use strict";p();var Vta=Jme();function $mr(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,o=a(c=>e?BigInt(c):Number(c),"num"),s=n.replace(/_/g,"").split(":").reduce((c,l)=>c*o(60)+o(l),o(0));return r==="-"?o(-1)*s:s}a($mr,"parseSexagesimal");function goi(t){let{value:e}=t,r=a(c=>c,"num");if(typeof e=="bigint")r=a(c=>BigInt(c),"num");else if(isNaN(e)||!isFinite(e))return Vta.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let o=r(60),s=[e%o];return e<60?s.unshift(0):(e=(e-s[0])/o,s.unshift(e%o),e>=60&&(e=(e-s[0])/o,s.unshift(e))),n+s.map(c=>String(c).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}a(goi,"stringifySexagesimal");var Wta={identify:a(t=>typeof t=="bigint"||Number.isInteger(t),"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:a((t,e,{intAsBigInt:r})=>$mr(t,r),"resolve"),stringify:goi},zta={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:a(t=>$mr(t,!1),"resolve"),stringify:goi},Aoi={identify:a(t=>t instanceof Date,"identify"),default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(Aoi.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,o,s,c,l]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0,d=Date.UTC(r,n-1,o,s||0,c||0,l||0,u),f=e[8];if(f&&f!=="Z"){let h=$mr(f,!1);Math.abs(h)<30&&(h*=60),d-=6e4*h}return new Date(d)},stringify:a(({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??"","stringify")};jft.floatTime=zta;jft.intTime=Wta;jft.timestamp=Aoi});var _oi=I(Eoi=>{"use strict";p();var Yta=Yme(),Kta=Rft(),Jta=Kme(),Zta=AMe(),Xta=Omr(),yoi=foi(),Wmr=poi(),Hft=moi(),era=vft(),tra=Umr(),rra=Lft(),nra=Gmr(),zmr=Vmr(),ira=[Yta.map,Jta.seq,Zta.string,Kta.nullTag,yoi.trueTag,yoi.falseTag,Hft.intBin,Hft.intOct,Hft.int,Hft.intHex,Wmr.floatNaN,Wmr.floatExp,Wmr.float,Xta.binary,era.merge,tra.omap,rra.pairs,nra.set,zmr.intTime,zmr.floatTime,zmr.timestamp];Eoi.schema=ira});var koi=I(Jmr=>{"use strict";p();var Soi=Yme(),ora=Rft(),Toi=Kme(),sra=AMe(),ara=xmr(),Ymr=Rmr(),Kmr=Pmr(),cra=Xii(),lra=roi(),Ioi=Omr(),CMe=vft(),xoi=Umr(),woi=Lft(),voi=_oi(),Roi=Gmr(),Gft=Vmr(),Coi=new Map([["core",cra.schema],["failsafe",[Soi.map,Toi.seq,sra.string]],["json",lra.schema],["yaml11",voi.schema],["yaml-1.1",voi.schema]]),boi={binary:Ioi.binary,bool:ara.boolTag,float:Ymr.float,floatExp:Ymr.floatExp,floatNaN:Ymr.floatNaN,floatTime:Gft.floatTime,int:Kmr.int,intHex:Kmr.intHex,intOct:Kmr.intOct,intTime:Gft.intTime,map:Soi.map,merge:CMe.merge,null:ora.nullTag,omap:xoi.omap,pairs:woi.pairs,seq:Toi.seq,set:Roi.set,timestamp:Gft.timestamp},ura={"tag:yaml.org,2002:binary":Ioi.binary,"tag:yaml.org,2002:merge":CMe.merge,"tag:yaml.org,2002:omap":xoi.omap,"tag:yaml.org,2002:pairs":woi.pairs,"tag:yaml.org,2002:set":Roi.set,"tag:yaml.org,2002:timestamp":Gft.timestamp};function dra(t,e,r){let n=Coi.get(e);if(n&&!t)return r&&!n.includes(CMe.merge)?n.concat(CMe.merge):n.slice();let o=n;if(!o)if(Array.isArray(t))o=[];else{let s=Array.from(Coi.keys()).filter(c=>c!=="yaml11").map(c=>JSON.stringify(c)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)o=o.concat(s);else typeof t=="function"&&(o=t(o.slice()));return r&&(o=o.concat(CMe.merge)),o.reduce((s,c)=>{let l=typeof c=="string"?boi[c]:c;if(!l){let u=JSON.stringify(c),d=Object.keys(boi).map(f=>JSON.stringify(f)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${d}`)}return s.includes(l)||s.push(l),s},[])}a(dra,"getTags");Jmr.coreKnownTags=ura;Jmr.getTags=dra});var e0r=I(Poi=>{"use strict";p();var Zmr=tc(),fra=Yme(),pra=Kme(),hra=AMe(),$ft=koi(),mra=a((t,e)=>t.keye.key?1:0,"sortMapEntriesByKey"),Xmr=class t{static{a(this,"Schema")}constructor({compat:e,customTags:r,merge:n,resolveKnownTags:o,schema:s,sortMapEntries:c,toStringDefaults:l}){this.compat=Array.isArray(e)?$ft.getTags(e,"compat"):e?$ft.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=o?$ft.coreKnownTags:{},this.tags=$ft.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,Zmr.MAP,{value:fra.map}),Object.defineProperty(this,Zmr.SCALAR,{value:hra.string}),Object.defineProperty(this,Zmr.SEQ,{value:pra.seq}),this.sortMapEntries=typeof c=="function"?c:c===!0?mra:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Poi.Schema=Xmr});var Noi=I(Doi=>{"use strict";p();var gra=tc(),t0r=pMe(),bMe=lMe();function Ara(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let u=t.directives.toString(t);u?(r.push(u),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let o=t0r.createStringifyContext(t,e),{commentString:s}=o.options;if(t.commentBefore){r.length!==1&&r.unshift("");let u=s(t.commentBefore);r.unshift(bMe.indentComment(u,""))}let c=!1,l=null;if(t.contents){if(gra.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let f=s(t.contents.commentBefore);r.push(bMe.indentComment(f,""))}o.forceBlockIndent=!!t.comment,l=t.contents.comment}let u=l?void 0:()=>c=!0,d=t0r.stringify(t.contents,o,()=>l=null,u);l&&(d+=bMe.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(t0r.stringify(t.contents,o));if(t.directives?.docEnd)if(t.comment){let u=s(t.comment);u.includes(` +`)?(r.push("..."),r.push(bMe.indentComment(u,""))):r.push(`... ${u}`)}else r.push("...");else{let u=t.comment;u&&c&&(u=u.replace(/^\n+/,"")),u&&((!c||l)&&r[r.length-1]!==""&&r.push(""),r.push(bMe.indentComment(s(u),"")))}return r.join(` `)+` -`}a(Fea,"stringifyDocument");Vii.stringifyDocument=Fea});var uMe=I(zii=>{"use strict";p();var Uea=WNe(),Qme=Xdt(),lR=Za(),Qea=$H(),qea=qH(),jea=Rmr(),Hea=Wii(),Pmr=Ydt(),Gea=Ohr(),$ea=zNe(),Dmr=Mhr(),Nmr=class t{static{a(this,"Document")}constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,lR.NODE_TYPE,{value:lR.DOC});let o=null;typeof r=="function"||Array.isArray(r)?o=r:n===void 0&&r&&(n=r,r=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:c}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(c=this.directives.yaml.version)):this.directives=new Dmr.Directives({version:c}),this.setSchema(c,n),this.contents=e===void 0?null:this.createNode(e,o,n)}clone(){let e=Object.create(t.prototype,{[lR.NODE_TYPE]:{value:lR.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=lR.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){qme(this.contents)&&this.contents.add(e)}addIn(e,r){qme(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=Pmr.anchorNames(this);e.anchor=!r||n.has(r)?Pmr.findNewAnchor(r||"a",n):r}return new Uea.Alias(e.anchor)}createNode(e,r,n){let o;if(typeof r=="function")e=r.call({"":e},"",e),o=r;else if(Array.isArray(r)){let E=a(v=>typeof v=="number"||v instanceof String||v instanceof Number,"keyToStr"),_=r.filter(E).map(String);_.length>0&&(r=r.concat(_)),o=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:c,flow:l,keepUndefined:u,onTagObj:d,tag:f}=n??{},{onAnchor:h,setAnchors:m,sourceObjects:g}=Pmr.createNodeAnchors(this,c||"a"),A={aliasDuplicateObjects:s??!0,keepUndefined:u??!1,onAnchor:h,onTagObj:d,replacer:o,schema:this.schema,sourceObjects:g},y=$ea.createNode(e,f,A);return l&&lR.isCollection(y)&&(y.flow=!0),m(),y}createPair(e,r,n={}){let o=this.createNode(e,null,n),s=this.createNode(r,null,n);return new Qea.Pair(o,s)}delete(e){return qme(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Qme.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):qme(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return lR.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return Qme.isEmptyPath(e)?!r&&lR.isScalar(this.contents)?this.contents.value:this.contents:lR.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return lR.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Qme.isEmptyPath(e)?this.contents!==void 0:lR.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=Qme.collectionFromPath(this.schema,[e],r):qme(this.contents)&&this.contents.set(e,r)}setIn(e,r){Qme.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=Qme.collectionFromPath(this.schema,Array.from(e),r):qme(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Dmr.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Dmr.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let o=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${o}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new jea.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:o,onAnchor:s,reviver:c}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},u=qea.toJS(this.contents,r??"",l);if(typeof s=="function")for(let{count:d,res:f}of l.anchors.values())s(f,d);return typeof c=="function"?Gea.applyReviver(c,{"":u},"",u):u}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Hea.stringifyDocument(this,e)}};function qme(t){if(lR.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}a(qme,"assertCollection");zii.Document=Nmr});var pMe=I(fMe=>{"use strict";p();var dMe=class extends Error{static{a(this,"YAMLError")}constructor(e,r,n,o){super(),this.name=e,this.code=n,this.message=o,this.pos=r}},Mmr=class extends dMe{static{a(this,"YAMLParseError")}constructor(e,r,n){super("YAMLParseError",e,r,n)}},Omr=class extends dMe{static{a(this,"YAMLWarning")}constructor(e,r,n){super("YAMLWarning",e,r,n)}},Vea=a((t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(l=>e.linePos(l));let{line:n,col:o}=r.linePos[0];r.message+=` at line ${n}, column ${o}`;let s=o-1,c=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&c.length>80){let l=Math.min(s-39,c.length-79);c="\u2026"+c.substring(l),s-=l-1}if(c.length>80&&(c=c.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(c.substring(0,s))){let l=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);l.length>80&&(l=l.substring(0,79)+`\u2026 +`}a(Ara,"stringifyDocument");Doi.stringifyDocument=Ara});var SMe=I(Moi=>{"use strict";p();var yra=aMe(),Zme=fft(),yR=tc(),Era=rG(),_ra=ZH(),vra=e0r(),Cra=Noi(),r0r=cft(),bra=smr(),Sra=cMe(),n0r=omr(),i0r=class t{static{a(this,"Document")}constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,yR.NODE_TYPE,{value:yR.DOC});let o=null;typeof r=="function"||Array.isArray(r)?o=r:n===void 0&&r&&(n=r,r=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:c}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(c=this.directives.yaml.version)):this.directives=new n0r.Directives({version:c}),this.setSchema(c,n),this.contents=e===void 0?null:this.createNode(e,o,n)}clone(){let e=Object.create(t.prototype,{[yR.NODE_TYPE]:{value:yR.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=yR.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Xme(this.contents)&&this.contents.add(e)}addIn(e,r){Xme(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=r0r.anchorNames(this);e.anchor=!r||n.has(r)?r0r.findNewAnchor(r||"a",n):r}return new yra.Alias(e.anchor)}createNode(e,r,n){let o;if(typeof r=="function")e=r.call({"":e},"",e),o=r;else if(Array.isArray(r)){let E=a(v=>typeof v=="number"||v instanceof String||v instanceof Number,"keyToStr"),_=r.filter(E).map(String);_.length>0&&(r=r.concat(_)),o=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:c,flow:l,keepUndefined:u,onTagObj:d,tag:f}=n??{},{onAnchor:h,setAnchors:m,sourceObjects:g}=r0r.createNodeAnchors(this,c||"a"),A={aliasDuplicateObjects:s??!0,keepUndefined:u??!1,onAnchor:h,onTagObj:d,replacer:o,schema:this.schema,sourceObjects:g},y=Sra.createNode(e,f,A);return l&&yR.isCollection(y)&&(y.flow=!0),m(),y}createPair(e,r,n={}){let o=this.createNode(e,null,n),s=this.createNode(r,null,n);return new Era.Pair(o,s)}delete(e){return Xme(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Zme.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Xme(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return yR.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return Zme.isEmptyPath(e)?!r&&yR.isScalar(this.contents)?this.contents.value:this.contents:yR.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return yR.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Zme.isEmptyPath(e)?this.contents!==void 0:yR.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=Zme.collectionFromPath(this.schema,[e],r):Xme(this.contents)&&this.contents.set(e,r)}setIn(e,r){Zme.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=Zme.collectionFromPath(this.schema,Array.from(e),r):Xme(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new n0r.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new n0r.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let o=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${o}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new vra.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:o,onAnchor:s,reviver:c}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},u=_ra.toJS(this.contents,r??"",l);if(typeof s=="function")for(let{count:d,res:f}of l.anchors.values())s(f,d);return typeof c=="function"?bra.applyReviver(c,{"":u},"",u):u}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Cra.stringifyDocument(this,e)}};function Xme(t){if(yR.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}a(Xme,"assertCollection");Moi.Document=i0r});var xMe=I(IMe=>{"use strict";p();var TMe=class extends Error{static{a(this,"YAMLError")}constructor(e,r,n,o){super(),this.name=e,this.code=n,this.message=o,this.pos=r}},o0r=class extends TMe{static{a(this,"YAMLParseError")}constructor(e,r,n){super("YAMLParseError",e,r,n)}},s0r=class extends TMe{static{a(this,"YAMLWarning")}constructor(e,r,n){super("YAMLWarning",e,r,n)}},Tra=a((t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(l=>e.linePos(l));let{line:n,col:o}=r.linePos[0];r.message+=` at line ${n}, column ${o}`;let s=o-1,c=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&c.length>80){let l=Math.min(s-39,c.length-79);c="\u2026"+c.substring(l),s-=l-1}if(c.length>80&&(c=c.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(c.substring(0,s))){let l=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);l.length>80&&(l=l.substring(0,79)+`\u2026 `),c=l+c}if(/[^ ]/.test(c)){let l=1,u=r.linePos[1];u?.line===n&&u.col>o&&(l=Math.max(1,Math.min(u.col-o,80-s)));let d=" ".repeat(s)+"^".repeat(l);r.message+=`: ${c} ${d} -`}},"prettifyError");fMe.YAMLError=dMe;fMe.YAMLParseError=Mmr;fMe.YAMLWarning=Omr;fMe.prettifyError=Vea});var hMe=I(Yii=>{"use strict";p();function Wea(t,{flow:e,indicator:r,next:n,offset:o,onError:s,parentIndent:c,startOnNewline:l}){let u=!1,d=l,f=l,h="",m="",g=!1,A=!1,y=null,E=null,_=null,v=null,b=null,T=null,w=null;for(let P of t)switch(A&&(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma"&&s(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),A=!1),y&&(d&&P.type!=="comment"&&P.type!=="newline"&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),P.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&P.source.includes(" ")&&(y=P),f=!0;break;case"comment":{f||s(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=P.source.substring(1)||" ";h?h+=m+D:h=D,m="",d=!1;break}case"newline":d?h?h+=P.source:(!T||r!=="seq-item-ind")&&(u=!0):m+=P.source,d=!0,g=!0,(E||_)&&(v=P),f=!0;break;case"anchor":E&&s(P,"MULTIPLE_ANCHORS","A node can have at most one anchor"),P.source.endsWith(":")&&s(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),E=P,w??(w=P.offset),d=!1,f=!1,A=!0;break;case"tag":{_&&s(P,"MULTIPLE_TAGS","A node can have at most one tag"),_=P,w??(w=P.offset),d=!1,f=!1,A=!0;break}case r:(E||_)&&s(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`),T&&s(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${e??"collection"}`),T=P,d=r==="seq-item-ind"||r==="explicit-key-ind",f=!1;break;case"comma":if(e){b&&s(P,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=P,d=!1,f=!1;break}default:s(P,"UNEXPECTED_TOKEN",`Unexpected ${P.type} token`),d=!1,f=!1}let R=t[t.length-1],x=R?R.offset+R.source.length:o;return A&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(d&&y.indent<=c||n?.type==="block-map"||n?.type==="block-seq")&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:T,spaceBefore:u,comment:h,hasNewline:g,anchor:E,tag:_,newlineAfterProp:v,end:x,start:w??x}}a(Wea,"resolveProps");Yii.resolveProps=Wea});var Nft=I(Kii=>{"use strict";p();function Lmr(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` -`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(Lmr(e.key)||Lmr(e.value))return!0}return!1;default:return!0}}a(Lmr,"containsNewline");Kii.containsNewline=Lmr});var Bmr=I(Jii=>{"use strict";p();var zea=Nft();function Yea(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&zea.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}a(Yea,"flowIndentCheck");Jii.flowIndentCheck=Yea});var Fmr=I(Xii=>{"use strict";p();var Zii=Za();function Kea(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let o=typeof n=="function"?n:(s,c)=>s===c||Zii.isScalar(s)&&Zii.isScalar(c)&&s.value===c.value;return e.some(s=>o(s.key,r))}a(Kea,"mapIncludes");Xii.mapIncludes=Kea});var ooi=I(ioi=>{"use strict";p();var eoi=$H(),Jea=WH(),toi=hMe(),Zea=Nft(),roi=Bmr(),Xea=Fmr(),noi="All mapping items must start at the same column";function eta({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??Jea.YAMLMap,l=new c(r.schema);r.atRoot&&(r.atRoot=!1);let u=n.offset,d=null;for(let f of n.items){let{start:h,key:m,sep:g,value:A}=f,y=toi.resolveProps(h,{indicator:"explicit-key-ind",next:m??g?.[0],offset:u,onError:o,parentIndent:n.indent,startOnNewline:!0}),E=!y.found;if(E){if(m&&(m.type==="block-seq"?o(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==n.indent&&o(u,"BAD_INDENT",noi)),!y.anchor&&!y.tag&&!g){d=y.end,y.comment&&(l.comment?l.comment+=` -`+y.comment:l.comment=y.comment);continue}(y.newlineAfterProp||Zea.containsNewline(m))&&o(m??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else y.found?.indent!==n.indent&&o(u,"BAD_INDENT",noi);r.atKey=!0;let _=y.end,v=m?t(r,m,y,o):e(r,_,h,null,y,o);r.schema.compat&&roi.flowIndentCheck(n.indent,m,o),r.atKey=!1,Xea.mapIncludes(r,l.items,v)&&o(_,"DUPLICATE_KEY","Map keys must be unique");let b=toi.resolveProps(g??[],{indicator:"map-value-ind",next:A,offset:v.range[2],onError:o,parentIndent:n.indent,startOnNewline:!m||m.type==="block-scalar"});if(u=b.end,b.found){E&&(A?.type==="block-map"&&!b.hasNewline&&o(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&y.start{"use strict";p();var tta=zH(),rta=hMe(),nta=Bmr();function ita({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??tta.YAMLSeq,l=new c(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let u=n.offset,d=null;for(let{start:f,value:h}of n.items){let m=rta.resolveProps(f,{indicator:"seq-item-ind",next:h,offset:u,onError:o,parentIndent:n.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||h)h?.type==="block-seq"?o(m.end,"BAD_INDENT","All sequence items must start at the same column"):o(u,"MISSING_CHAR","Sequence item without - indicator");else{d=m.end,m.comment&&(l.comment=m.comment);continue}let g=h?t(r,h,m,o):e(r,m.end,f,null,m,o);r.schema.compat&&nta.flowIndentCheck(n.indent,h,o),u=g.range[2],l.items.push(g)}return l.range=[n.offset,u,d??u],l}a(ita,"resolveBlockSeq");soi.resolveBlockSeq=ita});var jme=I(coi=>{"use strict";p();function ota(t,e,r,n){let o="";if(t){let s=!1,c="";for(let l of t){let{source:u,type:d}=l;switch(d){case"space":s=!0;break;case"comment":{r&&!s&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let f=u.substring(1)||" ";o?o+=c+f:o=f,c="";break}case"newline":o&&(c+=u),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}e+=u.length}}return{comment:o,offset:e}}a(ota,"resolveEnd");coi.resolveEnd=ota});var foi=I(doi=>{"use strict";p();var sta=Za(),ata=$H(),loi=WH(),cta=zH(),lta=jme(),uoi=hMe(),uta=Nft(),dta=Fmr(),Umr="Block collections are not allowed within flow collections",Qmr=a(t=>t&&(t.type==="block-map"||t.type==="block-seq"),"isBlock");function fta({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=n.start.source==="{",l=c?"flow map":"flow sequence",u=s?.nodeClass??(c?loi.YAMLMap:cta.YAMLSeq),d=new u(r.schema);d.flow=!0;let f=r.atRoot;f&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let h=n.offset+n.start.source.length;for(let E=0;E0){let E=lta.resolveEnd(A,y,r.options.strict,o);E.comment&&(d.comment?d.comment+=` -`+E.comment:d.comment=E.comment),d.range=[n.offset,y,E.offset]}else d.range=[n.offset,y,y];return d}a(fta,"resolveFlowCollection");doi.resolveFlowCollection=fta});var hoi=I(poi=>{"use strict";p();var pta=Za(),hta=mm(),mta=WH(),gta=zH(),Ata=ooi(),yta=aoi(),Eta=foi();function qmr(t,e,r,n,o,s){let c=r.type==="block-map"?Ata.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?yta.resolveBlockSeq(t,e,r,n,s):Eta.resolveFlowCollection(t,e,r,n,s),l=c.constructor;return o==="!"||o===l.tagName?(c.tag=l.tagName,c):(o&&(c.tag=o),c)}a(qmr,"resolveCollection");function _ta(t,e,r,n,o){let s=n.tag,c=s?e.directives.tagName(s.source,m=>o(s,"TAG_RESOLVE_FAILED",m)):null;if(r.type==="block-seq"){let{anchor:m,newlineAfterProp:g}=n,A=m&&s?m.offset>s.offset?m:s:m??s;A&&(!g||g.offsetm.tag===c&&m.collection===l);if(!u){let m=e.schema.knownTags[c];if(m?.collection===l)e.schema.tags.push(Object.assign({},m,{default:!1})),u=m;else return m?o(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):o(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${c}`,!0),qmr(t,e,r,o,c)}let d=qmr(t,e,r,o,c,u),f=u.resolve?.(d,m=>o(s,"TAG_RESOLVE_FAILED",m),e.options)??d,h=pta.isNode(f)?f:new hta.Scalar(f);return h.range=d.range,h.tag=c,u?.format&&(h.format=u.format),h}a(_ta,"composeCollection");poi.composeCollection=_ta});var Hmr=I(moi=>{"use strict";p();var jmr=mm();function vta(t,e,r){let n=e.offset,o=Cta(e,t.options.strict,r);if(!o)return{value:"",type:null,comment:"",range:[n,n,n]};let s=o.mode===">"?jmr.Scalar.BLOCK_FOLDED:jmr.Scalar.BLOCK_LITERAL,c=e.source?bta(e.source):[],l=c.length;for(let y=c.length-1;y>=0;--y){let E=c[y][1];if(E===""||E==="\r")l=y;else break}if(l===0){let y=o.chomp==="+"&&c.length>0?` +`}},"prettifyError");IMe.YAMLError=TMe;IMe.YAMLParseError=o0r;IMe.YAMLWarning=s0r;IMe.prettifyError=Tra});var wMe=I(Ooi=>{"use strict";p();function Ira(t,{flow:e,indicator:r,next:n,offset:o,onError:s,parentIndent:c,startOnNewline:l}){let u=!1,d=l,f=l,h="",m="",g=!1,A=!1,y=null,E=null,_=null,v=null,b=null,T=null,w=null;for(let P of t)switch(A&&(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma"&&s(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),A=!1),y&&(d&&P.type!=="comment"&&P.type!=="newline"&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),P.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&P.source.includes(" ")&&(y=P),f=!0;break;case"comment":{f||s(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=P.source.substring(1)||" ";h?h+=m+D:h=D,m="",d=!1;break}case"newline":d?h?h+=P.source:(!T||r!=="seq-item-ind")&&(u=!0):m+=P.source,d=!0,g=!0,(E||_)&&(v=P),f=!0;break;case"anchor":E&&s(P,"MULTIPLE_ANCHORS","A node can have at most one anchor"),P.source.endsWith(":")&&s(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),E=P,w??(w=P.offset),d=!1,f=!1,A=!0;break;case"tag":{_&&s(P,"MULTIPLE_TAGS","A node can have at most one tag"),_=P,w??(w=P.offset),d=!1,f=!1,A=!0;break}case r:(E||_)&&s(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`),T&&s(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${e??"collection"}`),T=P,d=r==="seq-item-ind"||r==="explicit-key-ind",f=!1;break;case"comma":if(e){b&&s(P,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=P,d=!1,f=!1;break}default:s(P,"UNEXPECTED_TOKEN",`Unexpected ${P.type} token`),d=!1,f=!1}let R=t[t.length-1],x=R?R.offset+R.source.length:o;return A&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(d&&y.indent<=c||n?.type==="block-map"||n?.type==="block-seq")&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:T,spaceBefore:u,comment:h,hasNewline:g,anchor:E,tag:_,newlineAfterProp:v,end:x,start:w??x}}a(Ira,"resolveProps");Ooi.resolveProps=Ira});var Vft=I(Loi=>{"use strict";p();function a0r(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` +`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(a0r(e.key)||a0r(e.value))return!0}return!1;default:return!0}}a(a0r,"containsNewline");Loi.containsNewline=a0r});var c0r=I(Boi=>{"use strict";p();var xra=Vft();function wra(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&xra.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}a(wra,"flowIndentCheck");Boi.flowIndentCheck=wra});var l0r=I(Uoi=>{"use strict";p();var Foi=tc();function Rra(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let o=typeof n=="function"?n:(s,c)=>s===c||Foi.isScalar(s)&&Foi.isScalar(c)&&s.value===c.value;return e.some(s=>o(s.key,r))}a(Rra,"mapIncludes");Uoi.mapIncludes=Rra});var $oi=I(Goi=>{"use strict";p();var Qoi=rG(),kra=iG(),qoi=wMe(),Pra=Vft(),joi=c0r(),Dra=l0r(),Hoi="All mapping items must start at the same column";function Nra({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??kra.YAMLMap,l=new c(r.schema);r.atRoot&&(r.atRoot=!1);let u=n.offset,d=null;for(let f of n.items){let{start:h,key:m,sep:g,value:A}=f,y=qoi.resolveProps(h,{indicator:"explicit-key-ind",next:m??g?.[0],offset:u,onError:o,parentIndent:n.indent,startOnNewline:!0}),E=!y.found;if(E){if(m&&(m.type==="block-seq"?o(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==n.indent&&o(u,"BAD_INDENT",Hoi)),!y.anchor&&!y.tag&&!g){d=y.end,y.comment&&(l.comment?l.comment+=` +`+y.comment:l.comment=y.comment);continue}(y.newlineAfterProp||Pra.containsNewline(m))&&o(m??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else y.found?.indent!==n.indent&&o(u,"BAD_INDENT",Hoi);r.atKey=!0;let _=y.end,v=m?t(r,m,y,o):e(r,_,h,null,y,o);r.schema.compat&&joi.flowIndentCheck(n.indent,m,o),r.atKey=!1,Dra.mapIncludes(r,l.items,v)&&o(_,"DUPLICATE_KEY","Map keys must be unique");let b=qoi.resolveProps(g??[],{indicator:"map-value-ind",next:A,offset:v.range[2],onError:o,parentIndent:n.indent,startOnNewline:!m||m.type==="block-scalar"});if(u=b.end,b.found){E&&(A?.type==="block-map"&&!b.hasNewline&&o(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&y.start{"use strict";p();var Mra=oG(),Ora=wMe(),Lra=c0r();function Bra({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??Mra.YAMLSeq,l=new c(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let u=n.offset,d=null;for(let{start:f,value:h}of n.items){let m=Ora.resolveProps(f,{indicator:"seq-item-ind",next:h,offset:u,onError:o,parentIndent:n.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||h)h?.type==="block-seq"?o(m.end,"BAD_INDENT","All sequence items must start at the same column"):o(u,"MISSING_CHAR","Sequence item without - indicator");else{d=m.end,m.comment&&(l.comment=m.comment);continue}let g=h?t(r,h,m,o):e(r,m.end,f,null,m,o);r.schema.compat&&Lra.flowIndentCheck(n.indent,h,o),u=g.range[2],l.items.push(g)}return l.range=[n.offset,u,d??u],l}a(Bra,"resolveBlockSeq");Voi.resolveBlockSeq=Bra});var e0e=I(zoi=>{"use strict";p();function Fra(t,e,r,n){let o="";if(t){let s=!1,c="";for(let l of t){let{source:u,type:d}=l;switch(d){case"space":s=!0;break;case"comment":{r&&!s&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let f=u.substring(1)||" ";o?o+=c+f:o=f,c="";break}case"newline":o&&(c+=u),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}e+=u.length}}return{comment:o,offset:e}}a(Fra,"resolveEnd");zoi.resolveEnd=Fra});var Zoi=I(Joi=>{"use strict";p();var Ura=tc(),Qra=rG(),Yoi=iG(),qra=oG(),jra=e0e(),Koi=wMe(),Hra=Vft(),Gra=l0r(),u0r="Block collections are not allowed within flow collections",d0r=a(t=>t&&(t.type==="block-map"||t.type==="block-seq"),"isBlock");function $ra({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=n.start.source==="{",l=c?"flow map":"flow sequence",u=s?.nodeClass??(c?Yoi.YAMLMap:qra.YAMLSeq),d=new u(r.schema);d.flow=!0;let f=r.atRoot;f&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let h=n.offset+n.start.source.length;for(let E=0;E0){let E=jra.resolveEnd(A,y,r.options.strict,o);E.comment&&(d.comment?d.comment+=` +`+E.comment:d.comment=E.comment),d.range=[n.offset,y,E.offset]}else d.range=[n.offset,y,y];return d}a($ra,"resolveFlowCollection");Joi.resolveFlowCollection=$ra});var esi=I(Xoi=>{"use strict";p();var Vra=tc(),Wra=_m(),zra=iG(),Yra=oG(),Kra=$oi(),Jra=Woi(),Zra=Zoi();function f0r(t,e,r,n,o,s){let c=r.type==="block-map"?Kra.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?Jra.resolveBlockSeq(t,e,r,n,s):Zra.resolveFlowCollection(t,e,r,n,s),l=c.constructor;return o==="!"||o===l.tagName?(c.tag=l.tagName,c):(o&&(c.tag=o),c)}a(f0r,"resolveCollection");function Xra(t,e,r,n,o){let s=n.tag,c=s?e.directives.tagName(s.source,m=>o(s,"TAG_RESOLVE_FAILED",m)):null;if(r.type==="block-seq"){let{anchor:m,newlineAfterProp:g}=n,A=m&&s?m.offset>s.offset?m:s:m??s;A&&(!g||g.offsetm.tag===c&&m.collection===l);if(!u){let m=e.schema.knownTags[c];if(m?.collection===l)e.schema.tags.push(Object.assign({},m,{default:!1})),u=m;else return m?o(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):o(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${c}`,!0),f0r(t,e,r,o,c)}let d=f0r(t,e,r,o,c,u),f=u.resolve?.(d,m=>o(s,"TAG_RESOLVE_FAILED",m),e.options)??d,h=Vra.isNode(f)?f:new Wra.Scalar(f);return h.range=d.range,h.tag=c,u?.format&&(h.format=u.format),h}a(Xra,"composeCollection");Xoi.composeCollection=Xra});var h0r=I(tsi=>{"use strict";p();var p0r=_m();function ena(t,e,r){let n=e.offset,o=tna(e,t.options.strict,r);if(!o)return{value:"",type:null,comment:"",range:[n,n,n]};let s=o.mode===">"?p0r.Scalar.BLOCK_FOLDED:p0r.Scalar.BLOCK_LITERAL,c=e.source?rna(e.source):[],l=c.length;for(let y=c.length-1;y>=0;--y){let E=c[y][1];if(E===""||E==="\r")l=y;else break}if(l===0){let y=o.chomp==="+"&&c.length>0?` `.repeat(Math.max(1,c.length-1)):"",E=n+o.length;return e.source&&(E+=e.source.length),{value:y,type:s,comment:o.comment,range:[n,E,E]}}let u=e.indent+o.indent,d=e.offset+o.length,f=0;for(let y=0;yu&&(u=E.length);else{E.length=l;--y)c[y][0].length>u&&(l=y+1);let h="",m="",g=!1;for(let y=0;yu||_[0]===" "?(m===" "?m=` `:!g&&m===` `&&(m=` @@ -417,84 +417,84 @@ ${d} `+c[y][0].slice(u);h[h.length-1]!==` `&&(h+=` `);break;default:h+=` -`}let A=n+o.length+e.source.length;return{value:h,type:s,comment:o.comment,range:[n,A,A]}}a(vta,"resolveBlockScalar");function Cta({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:o}=e[0],s=o[0],c=0,l="",u=-1;for(let m=1;m{"use strict";p();var Gmr=mm(),Sta=jme();function Tta(t,e,r){let{offset:n,type:o,source:s,end:c}=t,l,u,d=a((m,g,A)=>r(n+m,g,A),"_onError");switch(o){case"scalar":l=Gmr.Scalar.PLAIN,u=Ita(s,d);break;case"single-quoted-scalar":l=Gmr.Scalar.QUOTE_SINGLE,u=xta(s,d);break;case"double-quoted-scalar":l=Gmr.Scalar.QUOTE_DOUBLE,u=wta(s,d);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let f=n+s.length,h=Sta.resolveEnd(c,f,e,r);return{value:u,type:l,comment:h.comment,range:[n,f,h.offset]}}a(Tta,"resolveFlowScalar");function Ita(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),goi(t)}a(Ita,"plainValue");function xta(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),goi(t.slice(1,-1)).replace(/''/g,"'")}a(xta,"singleQuotedValue");function goi(t){let e,r;try{e=new RegExp(`(.*?)(?{"use strict";p();var m0r=_m(),nna=e0e();function ina(t,e,r){let{offset:n,type:o,source:s,end:c}=t,l,u,d=a((m,g,A)=>r(n+m,g,A),"_onError");switch(o){case"scalar":l=m0r.Scalar.PLAIN,u=ona(s,d);break;case"single-quoted-scalar":l=m0r.Scalar.QUOTE_SINGLE,u=sna(s,d);break;case"double-quoted-scalar":l=m0r.Scalar.QUOTE_DOUBLE,u=ana(s,d);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let f=n+s.length,h=nna.resolveEnd(c,f,e,r);return{value:u,type:l,comment:h.comment,range:[n,f,h.offset]}}a(ina,"resolveFlowScalar");function ona(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),rsi(t)}a(ona,"plainValue");function sna(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),rsi(t.slice(1,-1)).replace(/''/g,"'")}a(sna,"singleQuotedValue");function rsi(t){let e,r;try{e=new RegExp(`(.*?)(?s?t.slice(s,n+1):o)}else r+=o}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}a(wta,"doubleQuotedValue");function Rta(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===` +`)&&(r+=n>s?t.slice(s,n+1):o)}else r+=o}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}a(ana,"doubleQuotedValue");function cna(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===` `||n==="\r")&&!(n==="\r"&&t[e+2]!==` `);)n===` `&&(r+=` -`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}a(Rta,"foldNewline");var kta={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Pta(t,e,r,n){let o=t.substr(e,r),c=o.length===r&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,16):NaN;if(isNaN(c)){let l=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}return String.fromCodePoint(c)}a(Pta,"parseCharCode");Aoi.resolveFlowScalar=Tta});var _oi=I(Eoi=>{"use strict";p();var Eee=Za(),yoi=mm(),Dta=Hmr(),Nta=$mr();function Mta(t,e,r,n){let{value:o,type:s,comment:c,range:l}=e.type==="block-scalar"?Dta.resolveBlockScalar(t,e,n):Nta.resolveFlowScalar(e,t.options.strict,n),u=r?t.directives.tagName(r.source,h=>n(r,"TAG_RESOLVE_FAILED",h)):null,d;t.options.stringKeys&&t.atKey?d=t.schema[Eee.SCALAR]:u?d=Ota(t.schema,o,u,r,n):e.type==="scalar"?d=Lta(t,o,e,n):d=t.schema[Eee.SCALAR];let f;try{let h=d.resolve(o,m=>n(r??e,"TAG_RESOLVE_FAILED",m),t.options);f=Eee.isScalar(h)?h:new yoi.Scalar(h)}catch(h){let m=h instanceof Error?h.message:String(h);n(r??e,"TAG_RESOLVE_FAILED",m),f=new yoi.Scalar(o)}return f.range=l,f.source=o,s&&(f.type=s),u&&(f.tag=u),d.format&&(f.format=d.format),c&&(f.comment=c),f}a(Mta,"composeScalar");function Ota(t,e,r,n,o){if(r==="!")return t[Eee.SCALAR];let s=[];for(let l of t.tags)if(!l.collection&&l.tag===r)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if(l.test?.test(e))return l;let c=t.knownTags[r];return c&&!c.collection?(t.tags.push(Object.assign({},c,{default:!1,test:void 0})),c):(o(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Eee.SCALAR])}a(Ota,"findScalarTagByName");function Lta({atKey:t,directives:e,schema:r},n,o,s){let c=r.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(n))||r[Eee.SCALAR];if(r.compat){let l=r.compat.find(u=>u.default&&u.test?.test(n))??r[Eee.SCALAR];if(c.tag!==l.tag){let u=e.tagString(c.tag),d=e.tagString(l.tag),f=`Value may be parsed as either ${u} or ${d}`;s(o,"TAG_RESOLVE_FAILED",f,!0)}}return c}a(Lta,"findScalarTagByTest");Eoi.composeScalar=Mta});var Coi=I(voi=>{"use strict";p();function Bta(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let o=e[n];switch(o.type){case"space":case"comment":case"newline":t-=o.source.length;continue}for(o=e[++n];o?.type==="space";)t+=o.source.length,o=e[++n];break}}return t}a(Bta,"emptyScalarPosition");voi.emptyScalarPosition=Bta});var Toi=I(Wmr=>{"use strict";p();var Fta=WNe(),Uta=Za(),Qta=hoi(),boi=_oi(),qta=jme(),jta=Coi(),Hta={composeNode:Soi,composeEmptyNode:Vmr};function Soi(t,e,r,n){let o=t.atKey,{spaceBefore:s,comment:c,anchor:l,tag:u}=r,d,f=!0;switch(e.type){case"alias":d=Gta(t,e,n),(l||u)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":d=boi.composeScalar(t,e,u,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=Qta.composeCollection(Hta,t,e,r,n),l&&(d.anchor=l.source.substring(1))}catch(h){let m=h instanceof Error?h.message:String(h);n(e,"RESOURCE_EXHAUSTION",m)}break;default:{let h=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",h),f=!1}}return d??(d=Vmr(t,e.offset,void 0,null,r,n)),l&&d.anchor===""&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),o&&t.options.stringKeys&&(!Uta.isScalar(d)||typeof d.value!="string"||d.tag&&d.tag!=="tag:yaml.org,2002:str")&&n(u??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(d.spaceBefore=!0),c&&(e.type==="scalar"&&e.source===""?d.comment=c:d.commentBefore=c),t.options.keepSourceTokens&&f&&(d.srcToken=e),d}a(Soi,"composeNode");function Vmr(t,e,r,n,{spaceBefore:o,comment:s,anchor:c,tag:l,end:u},d){let f={type:"scalar",offset:jta.emptyScalarPosition(e,r,n),indent:-1,source:""},h=boi.composeScalar(t,f,l,d);return c&&(h.anchor=c.source.substring(1),h.anchor===""&&d(c,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(h.spaceBefore=!0),s&&(h.comment=s,h.range[2]=u),h}a(Vmr,"composeEmptyNode");function Gta({options:t},{offset:e,source:r,end:n},o){let s=new Fta.Alias(r.substring(1));s.source===""&&o(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&o(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let c=e+r.length,l=qta.resolveEnd(n,c,t.strict,o);return s.range=[e,c,l.offset],l.comment&&(s.comment=l.comment),s}a(Gta,"composeAlias");Wmr.composeEmptyNode=Vmr;Wmr.composeNode=Soi});var woi=I(xoi=>{"use strict";p();var $ta=uMe(),Ioi=Toi(),Vta=jme(),Wta=hMe();function zta(t,e,{offset:r,start:n,value:o,end:s},c){let l=Object.assign({_directives:e},t),u=new $ta.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},f=Wta.resolveProps(n,{indicator:"doc-start",next:o??s?.[0],offset:r,onError:c,parentIndent:0,startOnNewline:!0});f.found&&(u.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!f.hasNewline&&c(f.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=o?Ioi.composeNode(d,o,f,c):Ioi.composeEmptyNode(d,f.end,n,null,f,c);let h=u.contents.range[2],m=Vta.resolveEnd(s,h,!1,c);return m.comment&&(u.comment=m.comment),u.range=[r,h,m.offset],u}a(zta,"composeDoc");xoi.composeDoc=zta});var Ymr=I(Poi=>{"use strict";p();var Yta=require("process"),Kta=Mhr(),Jta=uMe(),mMe=pMe(),Roi=Za(),Zta=woi(),Xta=jme();function gMe(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}a(gMe,"getErrorPos");function koi(t){let e="",r=!1,n=!1;for(let o=0;o{"use strict";p();var bee=tc(),isi=_m(),dna=h0r(),fna=g0r();function pna(t,e,r,n){let{value:o,type:s,comment:c,range:l}=e.type==="block-scalar"?dna.resolveBlockScalar(t,e,n):fna.resolveFlowScalar(e,t.options.strict,n),u=r?t.directives.tagName(r.source,h=>n(r,"TAG_RESOLVE_FAILED",h)):null,d;t.options.stringKeys&&t.atKey?d=t.schema[bee.SCALAR]:u?d=hna(t.schema,o,u,r,n):e.type==="scalar"?d=mna(t,o,e,n):d=t.schema[bee.SCALAR];let f;try{let h=d.resolve(o,m=>n(r??e,"TAG_RESOLVE_FAILED",m),t.options);f=bee.isScalar(h)?h:new isi.Scalar(h)}catch(h){let m=h instanceof Error?h.message:String(h);n(r??e,"TAG_RESOLVE_FAILED",m),f=new isi.Scalar(o)}return f.range=l,f.source=o,s&&(f.type=s),u&&(f.tag=u),d.format&&(f.format=d.format),c&&(f.comment=c),f}a(pna,"composeScalar");function hna(t,e,r,n,o){if(r==="!")return t[bee.SCALAR];let s=[];for(let l of t.tags)if(!l.collection&&l.tag===r)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if(l.test?.test(e))return l;let c=t.knownTags[r];return c&&!c.collection?(t.tags.push(Object.assign({},c,{default:!1,test:void 0})),c):(o(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[bee.SCALAR])}a(hna,"findScalarTagByName");function mna({atKey:t,directives:e,schema:r},n,o,s){let c=r.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(n))||r[bee.SCALAR];if(r.compat){let l=r.compat.find(u=>u.default&&u.test?.test(n))??r[bee.SCALAR];if(c.tag!==l.tag){let u=e.tagString(c.tag),d=e.tagString(l.tag),f=`Value may be parsed as either ${u} or ${d}`;s(o,"TAG_RESOLVE_FAILED",f,!0)}}return c}a(mna,"findScalarTagByTest");osi.composeScalar=pna});var csi=I(asi=>{"use strict";p();function gna(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let o=e[n];switch(o.type){case"space":case"comment":case"newline":t-=o.source.length;continue}for(o=e[++n];o?.type==="space";)t+=o.source.length,o=e[++n];break}}return t}a(gna,"emptyScalarPosition");asi.emptyScalarPosition=gna});var dsi=I(y0r=>{"use strict";p();var Ana=aMe(),yna=tc(),Ena=esi(),lsi=ssi(),_na=e0e(),vna=csi(),Cna={composeNode:usi,composeEmptyNode:A0r};function usi(t,e,r,n){let o=t.atKey,{spaceBefore:s,comment:c,anchor:l,tag:u}=r,d,f=!0;switch(e.type){case"alias":d=bna(t,e,n),(l||u)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":d=lsi.composeScalar(t,e,u,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=Ena.composeCollection(Cna,t,e,r,n),l&&(d.anchor=l.source.substring(1))}catch(h){let m=h instanceof Error?h.message:String(h);n(e,"RESOURCE_EXHAUSTION",m)}break;default:{let h=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",h),f=!1}}return d??(d=A0r(t,e.offset,void 0,null,r,n)),l&&d.anchor===""&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),o&&t.options.stringKeys&&(!yna.isScalar(d)||typeof d.value!="string"||d.tag&&d.tag!=="tag:yaml.org,2002:str")&&n(u??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(d.spaceBefore=!0),c&&(e.type==="scalar"&&e.source===""?d.comment=c:d.commentBefore=c),t.options.keepSourceTokens&&f&&(d.srcToken=e),d}a(usi,"composeNode");function A0r(t,e,r,n,{spaceBefore:o,comment:s,anchor:c,tag:l,end:u},d){let f={type:"scalar",offset:vna.emptyScalarPosition(e,r,n),indent:-1,source:""},h=lsi.composeScalar(t,f,l,d);return c&&(h.anchor=c.source.substring(1),h.anchor===""&&d(c,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(h.spaceBefore=!0),s&&(h.comment=s,h.range[2]=u),h}a(A0r,"composeEmptyNode");function bna({options:t},{offset:e,source:r,end:n},o){let s=new Ana.Alias(r.substring(1));s.source===""&&o(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&o(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let c=e+r.length,l=_na.resolveEnd(n,c,t.strict,o);return s.range=[e,c,l.offset],l.comment&&(s.comment=l.comment),s}a(bna,"composeAlias");y0r.composeEmptyNode=A0r;y0r.composeNode=usi});var hsi=I(psi=>{"use strict";p();var Sna=SMe(),fsi=dsi(),Tna=e0e(),Ina=wMe();function xna(t,e,{offset:r,start:n,value:o,end:s},c){let l=Object.assign({_directives:e},t),u=new Sna.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},f=Ina.resolveProps(n,{indicator:"doc-start",next:o??s?.[0],offset:r,onError:c,parentIndent:0,startOnNewline:!0});f.found&&(u.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!f.hasNewline&&c(f.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=o?fsi.composeNode(d,o,f,c):fsi.composeEmptyNode(d,f.end,n,null,f,c);let h=u.contents.range[2],m=Tna.resolveEnd(s,h,!1,c);return m.comment&&(u.comment=m.comment),u.range=[r,h,m.offset],u}a(xna,"composeDoc");psi.composeDoc=xna});var _0r=I(Asi=>{"use strict";p();var wna=require("process"),Rna=omr(),kna=SMe(),RMe=xMe(),msi=tc(),Pna=hsi(),Dna=e0e();function kMe(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}a(kMe,"getErrorPos");function gsi(t){let e="",r=!1,n=!1;for(let o=0;o{let c=gMe(r);s?this.warnings.push(new mMe.YAMLWarning(c,n,o)):this.errors.push(new mMe.YAMLParseError(c,n,o))},this.directives=new Kta.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:o}=koi(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment} -${n}`:n;else if(o||e.directives.docStart||!s)e.commentBefore=n;else if(Roi.isCollection(s)&&!s.flow&&s.items.length>0){let c=s.items[0];Roi.isPair(c)&&(c=c.key);let l=c.commentBefore;c.commentBefore=l?`${n} +`)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":t[o+1]?.[0]!=="#"&&(o+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}a(gsi,"parsePrelude");var E0r=class{static{a(this,"Composer")}constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,o,s)=>{let c=kMe(r);s?this.warnings.push(new RMe.YAMLWarning(c,n,o)):this.errors.push(new RMe.YAMLParseError(c,n,o))},this.directives=new Rna.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:o}=gsi(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment} +${n}`:n;else if(o||e.directives.docStart||!s)e.commentBefore=n;else if(msi.isCollection(s)&&!s.flow&&s.items.length>0){let c=s.items[0];msi.isPair(c)&&(c=c.key);let l=c.commentBefore;c.commentBefore=l?`${n} ${l}`:n}else{let c=s.commentBefore;s.commentBefore=c?`${n} -${c}`:n}}r?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:koi(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let o of e)yield*this.next(o);yield*this.end(r,n)}*next(e){switch(Yta.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,o)=>{let s=gMe(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,o)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Zta.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new mMe.YAMLParseError(gMe(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new mMe.YAMLParseError(gMe(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Xta.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} -${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new mMe.YAMLParseError(gMe(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),o=new Jta.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),o.range=[0,r,r],this.decorate(o,!1),yield o}}};Poi.Composer=zmr});var Moi=I(Mft=>{"use strict";p();var era=Hmr(),tra=$mr(),rra=pMe(),Doi=ZNe();function nra(t,e=!0,r){if(t){let n=a((o,s,c)=>{let l=typeof o=="number"?o:Array.isArray(o)?o[0]:o.offset;if(r)r(l,s,c);else throw new rra.YAMLParseError([l,l+1],s,c)},"_onError");switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return tra.resolveFlowScalar(t,e,n);case"block-scalar":return era.resolveBlockScalar({options:{strict:e}},t,n)}}return null}a(nra,"resolveAsScalar");function ira(t,e){let{implicitKey:r=!1,indent:n,inFlow:o=!1,offset:s=-1,type:c="PLAIN"}=e,l=Doi.stringifyString({type:c,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}}),u=e.end??[{type:"newline",offset:-1,indent:n,source:` +${c}`:n}}r?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:gsi(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let o of e)yield*this.next(o);yield*this.end(r,n)}*next(e){switch(wna.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,o)=>{let s=kMe(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,o)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Pna.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new RMe.YAMLParseError(kMe(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new RMe.YAMLParseError(kMe(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Dna.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} +${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new RMe.YAMLParseError(kMe(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),o=new kna.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),o.range=[0,r,r],this.decorate(o,!1),yield o}}};Asi.Composer=E0r});var _si=I(Wft=>{"use strict";p();var Nna=h0r(),Mna=g0r(),Ona=xMe(),ysi=fMe();function Lna(t,e=!0,r){if(t){let n=a((o,s,c)=>{let l=typeof o=="number"?o:Array.isArray(o)?o[0]:o.offset;if(r)r(l,s,c);else throw new Ona.YAMLParseError([l,l+1],s,c)},"_onError");switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Mna.resolveFlowScalar(t,e,n);case"block-scalar":return Nna.resolveBlockScalar({options:{strict:e}},t,n)}}return null}a(Lna,"resolveAsScalar");function Bna(t,e){let{implicitKey:r=!1,indent:n,inFlow:o=!1,offset:s=-1,type:c="PLAIN"}=e,l=ysi.stringifyString({type:c,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}}),u=e.end??[{type:"newline",offset:-1,indent:n,source:` `}];switch(l[0]){case"|":case">":{let d=l.indexOf(` `),f=l.substring(0,d),h=l.substring(d+1)+` -`,m=[{type:"block-scalar-header",offset:s,indent:n,source:f}];return Noi(m,u)||m.push({type:"newline",offset:-1,indent:n,source:` -`}),{type:"block-scalar",offset:s,indent:n,props:m,source:h}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:l,end:u};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:l,end:u};default:return{type:"scalar",offset:s,indent:n,source:l,end:u}}}a(ira,"createScalarToken");function ora(t,e,r={}){let{afterKey:n=!1,implicitKey:o=!1,inFlow:s=!1,type:c}=r,l="indent"in t?t.indent:null;if(n&&typeof l=="number"&&(l+=2),!c)switch(t.type){case"single-quoted-scalar":c="QUOTE_SINGLE";break;case"double-quoted-scalar":c="QUOTE_DOUBLE";break;case"block-scalar":{let d=t.props[0];if(d.type!=="block-scalar-header")throw new Error("Invalid block scalar header");c=d.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:c="PLAIN"}let u=Doi.stringifyString({type:c,value:e},{implicitKey:o||l===null,indent:l!==null&&l>0?" ".repeat(l):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(u[0]){case"|":case">":sra(t,u);break;case'"':Kmr(t,u,"double-quoted-scalar");break;case"'":Kmr(t,u,"single-quoted-scalar");break;default:Kmr(t,u,"scalar")}}a(ora,"setScalarValue");function sra(t,e){let r=e.indexOf(` +`,m=[{type:"block-scalar-header",offset:s,indent:n,source:f}];return Esi(m,u)||m.push({type:"newline",offset:-1,indent:n,source:` +`}),{type:"block-scalar",offset:s,indent:n,props:m,source:h}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:l,end:u};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:l,end:u};default:return{type:"scalar",offset:s,indent:n,source:l,end:u}}}a(Bna,"createScalarToken");function Fna(t,e,r={}){let{afterKey:n=!1,implicitKey:o=!1,inFlow:s=!1,type:c}=r,l="indent"in t?t.indent:null;if(n&&typeof l=="number"&&(l+=2),!c)switch(t.type){case"single-quoted-scalar":c="QUOTE_SINGLE";break;case"double-quoted-scalar":c="QUOTE_DOUBLE";break;case"block-scalar":{let d=t.props[0];if(d.type!=="block-scalar-header")throw new Error("Invalid block scalar header");c=d.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:c="PLAIN"}let u=ysi.stringifyString({type:c,value:e},{implicitKey:o||l===null,indent:l!==null&&l>0?" ".repeat(l):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(u[0]){case"|":case">":Una(t,u);break;case'"':v0r(t,u,"double-quoted-scalar");break;case"'":v0r(t,u,"single-quoted-scalar");break;default:v0r(t,u,"scalar")}}a(Fna,"setScalarValue");function Una(t,e){let r=e.indexOf(` `),n=e.substring(0,r),o=e.substring(r+1)+` -`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=o}else{let{offset:s}=t,c="indent"in t?t.indent:-1,l=[{type:"block-scalar-header",offset:s,indent:c,source:n}];Noi(l,"end"in t?t.end:void 0)||l.push({type:"newline",offset:-1,indent:c,source:` -`});for(let u of Object.keys(t))u!=="type"&&u!=="offset"&&delete t[u];Object.assign(t,{type:"block-scalar",indent:c,props:l,source:o})}}a(sra,"setBlockScalarValue");function Noi(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}a(Noi,"addEndtoBlockProps");function Kmr(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),o=e.length;t.props[0].type==="block-scalar-header"&&(o-=t.props[0].source.length);for(let s of n)s.offset+=o;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let o={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` -`};delete t.items,Object.assign(t,{type:r,source:e,end:[o]});break}default:{let n="indent"in t?t.indent:-1,o="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:o})}}}a(Kmr,"setFlowScalarValue");Mft.createScalarToken=ira;Mft.resolveAsScalar=nra;Mft.setScalarValue=ora});var Loi=I(Ooi=>{"use strict";p();var ara=a(t=>"type"in t?Lft(t):Oft(t),"stringify");function Lft(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Lft(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Oft(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Oft(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Oft(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}a(Lft,"stringifyToken");function Oft({start:t,key:e,sep:r,value:n}){let o="";for(let s of t)o+=s.source;if(e&&(o+=Lft(e)),r)for(let s of r)o+=s.source;return n&&(o+=Lft(n)),o}a(Oft,"stringifyItem");Ooi.stringify=ara});var Qoi=I(Uoi=>{"use strict";p();var Jmr=Symbol("break visit"),cra=Symbol("skip children"),Boi=Symbol("remove item");function _ee(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Foi(Object.freeze([]),t,e)}a(_ee,"visit");_ee.BREAK=Jmr;_ee.SKIP=cra;_ee.REMOVE=Boi;_ee.itemAtPath=(t,e)=>{let r=t;for(let[n,o]of e){let s=r?.[n];if(s&&"items"in s)r=s.items[o];else return}return r};_ee.parentCollection=(t,e)=>{let r=_ee.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],o=r?.[n];if(o&&"items"in o)return o;throw new Error("Parent collection not found")};function Foi(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let o of["key","value"]){let s=e[o];if(s&&"items"in s){for(let c=0;c{"use strict";p();var Zmr=Moi(),lra=Loi(),ura=Qoi(),Xmr="\uFEFF",e0r="",t0r="",r0r="",dra=a(t=>!!t&&"items"in t,"isCollection"),fra=a(t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar"),"isScalar");function pra(t){switch(t){case Xmr:return"";case e0r:return"";case t0r:return"";case r0r:return"";default:return JSON.stringify(t)}}a(pra,"prettyToken");function hra(t){switch(t){case Xmr:return"byte-order-mark";case e0r:return"doc-mode";case t0r:return"flow-error-end";case r0r:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=o}else{let{offset:s}=t,c="indent"in t?t.indent:-1,l=[{type:"block-scalar-header",offset:s,indent:c,source:n}];Esi(l,"end"in t?t.end:void 0)||l.push({type:"newline",offset:-1,indent:c,source:` +`});for(let u of Object.keys(t))u!=="type"&&u!=="offset"&&delete t[u];Object.assign(t,{type:"block-scalar",indent:c,props:l,source:o})}}a(Una,"setBlockScalarValue");function Esi(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}a(Esi,"addEndtoBlockProps");function v0r(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),o=e.length;t.props[0].type==="block-scalar-header"&&(o-=t.props[0].source.length);for(let s of n)s.offset+=o;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let o={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` +`};delete t.items,Object.assign(t,{type:r,source:e,end:[o]});break}default:{let n="indent"in t?t.indent:-1,o="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:o})}}}a(v0r,"setFlowScalarValue");Wft.createScalarToken=Bna;Wft.resolveAsScalar=Lna;Wft.setScalarValue=Fna});var Csi=I(vsi=>{"use strict";p();var Qna=a(t=>"type"in t?Yft(t):zft(t),"stringify");function Yft(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Yft(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=zft(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=zft(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=zft(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}a(Yft,"stringifyToken");function zft({start:t,key:e,sep:r,value:n}){let o="";for(let s of t)o+=s.source;if(e&&(o+=Yft(e)),r)for(let s of r)o+=s.source;return n&&(o+=Yft(n)),o}a(zft,"stringifyItem");vsi.stringify=Qna});var Isi=I(Tsi=>{"use strict";p();var C0r=Symbol("break visit"),qna=Symbol("skip children"),bsi=Symbol("remove item");function See(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Ssi(Object.freeze([]),t,e)}a(See,"visit");See.BREAK=C0r;See.SKIP=qna;See.REMOVE=bsi;See.itemAtPath=(t,e)=>{let r=t;for(let[n,o]of e){let s=r?.[n];if(s&&"items"in s)r=s.items[o];else return}return r};See.parentCollection=(t,e)=>{let r=See.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],o=r?.[n];if(o&&"items"in o)return o;throw new Error("Parent collection not found")};function Ssi(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let o of["key","value"]){let s=e[o];if(s&&"items"in s){for(let c=0;c{"use strict";p();var b0r=_si(),jna=Csi(),Hna=Isi(),S0r="\uFEFF",T0r="",I0r="",x0r="",Gna=a(t=>!!t&&"items"in t,"isCollection"),$na=a(t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar"),"isScalar");function Vna(t){switch(t){case S0r:return"";case T0r:return"";case I0r:return"";case x0r:return"";default:return JSON.stringify(t)}}a(Vna,"prettyToken");function Wna(t){switch(t){case S0r:return"byte-order-mark";case T0r:return"doc-mode";case I0r:return"flow-error-end";case x0r:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}a(hra,"tokenType");Bb.createScalarToken=Zmr.createScalarToken;Bb.resolveAsScalar=Zmr.resolveAsScalar;Bb.setScalarValue=Zmr.setScalarValue;Bb.stringify=lra.stringify;Bb.visit=ura.visit;Bb.BOM=Xmr;Bb.DOCUMENT=e0r;Bb.FLOW_END=t0r;Bb.SCALAR=r0r;Bb.isCollection=dra;Bb.isScalar=fra;Bb.prettyToken=pra;Bb.tokenType=hra});var o0r=I(joi=>{"use strict";p();var AMe=Bft();function Z2(t){switch(t){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}a(Z2,"isEmpty");var qoi=new Set("0123456789ABCDEFabcdef"),mra=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Fft=new Set(",[]{}"),gra=new Set(` ,[]{} -\r `),n0r=a(t=>!t||gra.has(t),"isNotAnchorChar"),i0r=class{static{a(this,"Lexer")}constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===` +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}a(Wna,"tokenType");Bb.createScalarToken=b0r.createScalarToken;Bb.resolveAsScalar=b0r.resolveAsScalar;Bb.setScalarValue=b0r.setScalarValue;Bb.stringify=jna.stringify;Bb.visit=Hna.visit;Bb.BOM=S0r;Bb.DOCUMENT=T0r;Bb.FLOW_END=I0r;Bb.SCALAR=x0r;Bb.isCollection=Gna;Bb.isScalar=$na;Bb.prettyToken=Vna;Bb.tokenType=Wna});var k0r=I(wsi=>{"use strict";p();var PMe=Kft();function sD(t){switch(t){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}a(sD,"isEmpty");var xsi=new Set("0123456789ABCDEFabcdef"),zna=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Jft=new Set(",[]{}"),Yna=new Set(` ,[]{} +\r `),w0r=a(t=>!t||Yna.has(t),"isNotAnchorChar"),R0r=class{static{a(this,"Lexer")}constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===` `?!0:r==="\r"?this.buffer[e+1]===` `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let o=this.buffer[n+e+1];if(o===` `||!o&&!this.atEnd)return e+n+1}return r===` -`||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Z2(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!Z2(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Z2(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(n0r),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let o=this.getLine();if(o===null)return this.setNext("flow");if((n!==-1&&n=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&sD(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!sD(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&sD(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(w0r),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let o=this.getLine();if(o===null)return this.setNext("flow");if((n!==-1&&n"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>Z2(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let s=this.pos;n=this.buffer[s];++s)switch(n){case" ":r+=1;break;case` +`,s)}o!==-1&&(r=o-(n[o-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>sD(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let s=this.pos;n=this.buffer[s];++s)switch(n){case" ":r+=1;break;case` `:e=s,r=0;break;case"\r":{let c=this.buffer[s+1];if(!c&&!this.atEnd)return this.setNext("block-scalar");if(c===` `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(` `,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let o=e+1;for(n=this.buffer[o];n===" ";)n=this.buffer[++o];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===` `;)n=this.buffer[++o];e=o-1}else if(!this.blockScalarKeep)do{let s=e-1,c=this.buffer[s];c==="\r"&&(c=this.buffer[--s]);let l=s;for(;c===" ";)c=this.buffer[--s];if(c===` -`&&s>=this.pos&&s+1+r>l)e=s;else break}while(!0);return yield AMe.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,o;for(;o=this.buffer[++n];)if(o===":"){let s=this.buffer[n+1];if(Z2(s)||e&&Fft.has(s))break;r=n}else if(Z2(o)){let s=this.buffer[n+1];if(o==="\r"&&(s===` +`&&s>=this.pos&&s+1+r>l)e=s;else break}while(!0);return yield PMe.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,o;for(;o=this.buffer[++n];)if(o===":"){let s=this.buffer[n+1];if(sD(s)||e&&Jft.has(s))break;r=n}else if(sD(o)){let s=this.buffer[n+1];if(o==="\r"&&(s===` `?(n+=1,o=` -`,s=this.buffer[n+1]):r=n),s==="#"||e&&Fft.has(s))break;if(o===` -`){let c=this.continueScalar(n+1);if(c===-1)break;n=Math.max(n,c-2)}}else{if(e&&Fft.has(o))break;r=n}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield AMe.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(n0r))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,r=this.charAt(1);if(Z2(r)||e&&Fft.has(r))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Z2(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(mra.has(r))r=this.buffer[++e];else if(r==="%"&&qoi.has(this.buffer[e+1])&&qoi.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` +`,s=this.buffer[n+1]):r=n),s==="#"||e&&Jft.has(s))break;if(o===` +`){let c=this.continueScalar(n+1);if(c===-1)break;n=Math.max(n,c-2)}}else{if(e&&Jft.has(o))break;r=n}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield PMe.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(w0r))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,r=this.charAt(1);if(sD(r)||e&&Jft.has(r))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!sD(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(zna.has(r))r=this.buffer[++e];else if(r==="%"&&xsi.has(this.buffer[e+1])&&xsi.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let o=r-this.pos;return o>0&&(yield this.buffer.substr(this.pos,o),this.pos=r),o}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};joi.Lexer=i0r});var a0r=I(Hoi=>{"use strict";p();var s0r=class{static{a(this,"LineCounter")}constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r>1;this.lineStarts[s]{"use strict";p();var Ara=require("process"),Goi=Bft(),yra=o0r();function YH(t,e){for(let r=0;r=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}a(Hme,"getFirstKeyStartProps");function Voi(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!YH(e.start,"explicit-key-ind")&&!YH(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Woi(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}a(Voi,"fixFlowSeqItems");var c0r=class{static{a(this,"Parser")}constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new yra.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,Ara.env.LOG_TOKENS&&console.log("|",Goi.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=Goi.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&Voi(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let o=n.items[n.items.length-1];if(o.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(o.sep)o.value=r;else{Object.assign(o,{key:r,sep:[]}),this.onKeyLine=!o.explicitKey;return}break}case"block-seq":{let o=n.items[n.items.length-1];o.value?n.items.push({start:[],value:r}):o.value=r;break}case"flow-collection":{let o=n.items[n.items.length-1];!o||o.value?n.items.push({start:[],key:r,sep:[]}):o.sep?o.value=r:Object.assign(o,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let o=r.items[r.items.length-1];o&&!o.sep&&!o.value&&o.start.length>0&&$oi(o.start)===-1&&(r.indent===0||o.start.every(s=>s.type!=="comment"||s.indent0&&(yield this.buffer.substr(this.pos,o),this.pos=r),o}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};wsi.Lexer=R0r});var D0r=I(Rsi=>{"use strict";p();var P0r=class{static{a(this,"LineCounter")}constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r>1;this.lineStarts[s]{"use strict";p();var Kna=require("process"),ksi=Kft(),Jna=k0r();function sG(t,e){for(let r=0;r=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}a(t0e,"getFirstKeyStartProps");function Dsi(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!sG(e.start,"explicit-key-ind")&&!sG(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Nsi(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}a(Dsi,"fixFlowSeqItems");var N0r=class{static{a(this,"Parser")}constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Jna.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,Kna.env.LOG_TOKENS&&console.log("|",ksi.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=ksi.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&Dsi(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let o=n.items[n.items.length-1];if(o.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(o.sep)o.value=r;else{Object.assign(o,{key:r,sep:[]}),this.onKeyLine=!o.explicitKey;return}break}case"block-seq":{let o=n.items[n.items.length-1];o.value?n.items.push({start:[],value:r}):o.value=r;break}case"flow-collection":{let o=n.items[n.items.length-1];!o||o.value?n.items.push({start:[],key:r,sep:[]}):o.sep?o.value=r:Object.assign(o,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let o=r.items[r.items.length-1];o&&!o.sep&&!o.value&&o.start.length>0&&Psi(o.start)===-1&&(r.indent===0||o.start.every(s=>s.type!=="comment"||s.indent=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,o=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(o&&r.sep&&!r.value){let c=[];for(let l=0;le.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(s=r.sep.splice(c[1]))}switch(this.type){case"anchor":case"tag":o||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):o||r.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(YH(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(Woi(r.key)&&!YH(r.sep,"newline")){let c=Hme(r.start),l=r.key,u=r.sep;u.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:l,sep:u}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(YH(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let c=Hme(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||o?e.items.push({start:s,key:null,sep:[this.sourceToken]}):YH(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let c=this.flowScalar(this.type);o||r.value?(e.items.push({start:s,key:c,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(c):(Object.assign(r,{key:c,sep:[]}),this.onKeyLine=!0);return}default:{let c=this.startBlockValue(e);if(c){if(c.type==="block-seq"){if(!r.explicitKey&&r.sep&&!YH(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:s});this.stack.push(c);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let o=e.items[e.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,r.start),o.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||YH(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:o,sep:[]}):r.sep?this.stack.push(o):Object.assign(r,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let o=Uft(n),s=Hme(o);Voi(e);let c=e.end.splice(1,e.end.length);c.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:c}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(` +`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let o=e.items[e.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,r.start),o.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,o=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(o&&r.sep&&!r.value){let c=[];for(let l=0;le.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(s=r.sep.splice(c[1]))}switch(this.type){case"anchor":case"tag":o||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):o||r.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(sG(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(Nsi(r.key)&&!sG(r.sep,"newline")){let c=t0e(r.start),l=r.key,u=r.sep;u.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:l,sep:u}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(sG(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let c=t0e(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||o?e.items.push({start:s,key:null,sep:[this.sourceToken]}):sG(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let c=this.flowScalar(this.type);o||r.value?(e.items.push({start:s,key:c,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(c):(Object.assign(r,{key:c,sep:[]}),this.onKeyLine=!0);return}default:{let c=this.startBlockValue(e);if(c){if(c.type==="block-seq"){if(!r.explicitKey&&r.sep&&!sG(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:s});this.stack.push(c);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let o=e.items[e.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,r.start),o.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||sG(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:o,sep:[]}):r.sep?this.stack.push(o):Object.assign(r,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let o=Zft(n),s=t0e(o);Dsi(e);let c=e.end.splice(1,e.end.length);c.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:c}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(` `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(` -`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=Uft(e),n=Hme(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Uft(e),n=Hme(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};zoi.Parser=c0r});var Xoi=I(EMe=>{"use strict";p();var Yoi=Ymr(),Era=uMe(),yMe=pMe(),_ra=Whr(),vra=Za(),Cra=a0r(),Koi=l0r();function Joi(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Cra.LineCounter||null,prettyErrors:e}}a(Joi,"parseOptions");function bra(t,e={}){let{lineCounter:r,prettyErrors:n}=Joi(e),o=new Koi.Parser(r?.addNewLine),s=new Yoi.Composer(e),c=Array.from(s.compose(o.parse(t)));if(n&&r)for(let l of c)l.errors.forEach(yMe.prettifyError(t,r)),l.warnings.forEach(yMe.prettifyError(t,r));return c.length>0?c:Object.assign([],{empty:!0},s.streamInfo())}a(bra,"parseAllDocuments");function Zoi(t,e={}){let{lineCounter:r,prettyErrors:n}=Joi(e),o=new Koi.Parser(r?.addNewLine),s=new Yoi.Composer(e),c=null;for(let l of s.compose(o.parse(t),!0,t.length))if(!c)c=l;else if(c.options.logLevel!=="silent"){c.errors.push(new yMe.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(c.errors.forEach(yMe.prettifyError(t,r)),c.warnings.forEach(yMe.prettifyError(t,r))),c}a(Zoi,"parseDocument");function Sra(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let o=Zoi(t,r);if(!o)return null;if(o.warnings.forEach(s=>_ra.warn(o.options.logLevel,s)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:n},r))}a(Sra,"parse");function Tra(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let o=Math.round(r);r=o<1?void 0:o>8?{indent:8}:{indent:o}}if(t===void 0){let{keepUndefined:o}=r??e??{};if(!o)return}return vra.isDocument(t)&&!n?t.toString(r):new Era.Document(t,n,r).toString(r)}a(Tra,"stringify");EMe.parse=Sra;EMe.parseAllDocuments=bra;EMe.parseDocument=Zoi;EMe.stringify=Tra});var tsi=I(Hc=>{"use strict";p();var Ira=Ymr(),xra=uMe(),wra=Rmr(),u0r=pMe(),Rra=WNe(),KH=Za(),kra=$H(),Pra=mm(),Dra=WH(),Nra=zH(),Mra=Bft(),Ora=o0r(),Lra=a0r(),Bra=l0r(),Qft=Xoi(),esi=HNe();Hc.Composer=Ira.Composer;Hc.Document=xra.Document;Hc.Schema=wra.Schema;Hc.YAMLError=u0r.YAMLError;Hc.YAMLParseError=u0r.YAMLParseError;Hc.YAMLWarning=u0r.YAMLWarning;Hc.Alias=Rra.Alias;Hc.isAlias=KH.isAlias;Hc.isCollection=KH.isCollection;Hc.isDocument=KH.isDocument;Hc.isMap=KH.isMap;Hc.isNode=KH.isNode;Hc.isPair=KH.isPair;Hc.isScalar=KH.isScalar;Hc.isSeq=KH.isSeq;Hc.Pair=kra.Pair;Hc.Scalar=Pra.Scalar;Hc.YAMLMap=Dra.YAMLMap;Hc.YAMLSeq=Nra.YAMLSeq;Hc.CST=Mra;Hc.Lexer=Ora.Lexer;Hc.LineCounter=Lra.LineCounter;Hc.Parser=Bra.Parser;Hc.parse=Qft.parse;Hc.parseAllDocuments=Qft.parseAllDocuments;Hc.parseDocument=Qft.parseDocument;Hc.stringify=Qft.stringify;Hc.visit=esi.visit;Hc.visitAsync=esi.visitAsync});var rsi=I(qft=>{"use strict";p();Object.defineProperty(qft,"__esModule",{value:!0});qft.FetchCancellationError=void 0;var Fra=Rs(),d0r=class extends Fra.CancellationError{static{a(this,"FetchCancellationError")}constructor(e){super(),this.extraInformation=e}};qft.FetchCancellationError=d0r});var Gs=I(JH=>{"use strict";p();Object.defineProperty(JH,"__esModule",{value:!0});JH.IInstantiationService=JH._util=void 0;JH.createDecorator=nsi;JH.refineServiceDecorator=Qra;var R8;(function(t){t.serviceIds=new Map,t.DI_TARGET="$di$target",t.DI_DEPENDENCIES="$di$dependencies";function e(r){return r[t.DI_DEPENDENCIES]||[]}a(e,"getServiceDependencies"),t.getServiceDependencies=e})(R8||(JH._util=R8={}));JH.IInstantiationService=nsi("instantiationService");function Ura(t,e,r){e[R8.DI_TARGET]===e?e[R8.DI_DEPENDENCIES].push({id:t,index:r}):(e[R8.DI_DEPENDENCIES]=[{id:t,index:r}],e[R8.DI_TARGET]=e)}a(Ura,"storeServiceDependency");function nsi(t){if(R8.serviceIds.has(t))return R8.serviceIds.get(t);let e=a(function(r,n,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Ura(e,r,o)},"id");return e.toString=()=>t,R8.serviceIds.set(t,e),e}a(nsi,"createDecorator");function Qra(t){return t}a(Qra,"refineServiceDecorator")});var Hft=I(jft=>{"use strict";p();Object.defineProperty(jft,"__esModule",{value:!0});jft.SyncDescriptor=void 0;var f0r=class{static{a(this,"SyncDescriptor")}constructor(e,r=[],n=!1){this.ctor=e,this.staticArguments=r,this.supportsDelayedInstantiation=n}};jft.SyncDescriptor=f0r});var isi=I(Gme=>{"use strict";p();Object.defineProperty(Gme,"__esModule",{value:!0});Gme.Graph=Gme.Node=void 0;var Gft=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.data=r,this.incoming=new Map,this.outgoing=new Map}};Gme.Node=Gft;var p0r=class{static{a(this,"Graph")}constructor(e){this._hashFn=e,this._nodes=new Map}roots(){let e=[];for(let r of this._nodes.values())r.outgoing.size===0&&e.push(r);return e}insertEdge(e,r){let n=this.lookupOrInsertNode(e),o=this.lookupOrInsertNode(r);n.outgoing.set(o.key,o),o.incoming.set(n.key,n)}removeNode(e){let r=this._hashFn(e);this._nodes.delete(r);for(let n of this._nodes.values())n.outgoing.delete(r),n.incoming.delete(r)}lookupOrInsertNode(e){let r=this._hashFn(e),n=this._nodes.get(r);return n||(n=new Gft(r,e),this._nodes.set(r,n)),n}lookup(e){return this._nodes.get(this._hashFn(e))}isEmpty(){return this._nodes.size===0}toString(){let e=[];for(let[r,n]of this._nodes)e.push(`${r} +`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=Zft(e),n=t0e(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Zft(e),n=t0e(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Msi.Parser=N0r});var Usi=I(NMe=>{"use strict";p();var Osi=_0r(),Zna=SMe(),DMe=xMe(),Xna=ymr(),eia=tc(),tia=D0r(),Lsi=M0r();function Bsi(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new tia.LineCounter||null,prettyErrors:e}}a(Bsi,"parseOptions");function ria(t,e={}){let{lineCounter:r,prettyErrors:n}=Bsi(e),o=new Lsi.Parser(r?.addNewLine),s=new Osi.Composer(e),c=Array.from(s.compose(o.parse(t)));if(n&&r)for(let l of c)l.errors.forEach(DMe.prettifyError(t,r)),l.warnings.forEach(DMe.prettifyError(t,r));return c.length>0?c:Object.assign([],{empty:!0},s.streamInfo())}a(ria,"parseAllDocuments");function Fsi(t,e={}){let{lineCounter:r,prettyErrors:n}=Bsi(e),o=new Lsi.Parser(r?.addNewLine),s=new Osi.Composer(e),c=null;for(let l of s.compose(o.parse(t),!0,t.length))if(!c)c=l;else if(c.options.logLevel!=="silent"){c.errors.push(new DMe.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(c.errors.forEach(DMe.prettifyError(t,r)),c.warnings.forEach(DMe.prettifyError(t,r))),c}a(Fsi,"parseDocument");function nia(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let o=Fsi(t,r);if(!o)return null;if(o.warnings.forEach(s=>Xna.warn(o.options.logLevel,s)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:n},r))}a(nia,"parse");function iia(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let o=Math.round(r);r=o<1?void 0:o>8?{indent:8}:{indent:o}}if(t===void 0){let{keepUndefined:o}=r??e??{};if(!o)return}return eia.isDocument(t)&&!n?t.toString(r):new Zna.Document(t,n,r).toString(r)}a(iia,"stringify");NMe.parse=nia;NMe.parseAllDocuments=ria;NMe.parseDocument=Fsi;NMe.stringify=iia});var qsi=I($c=>{"use strict";p();var oia=_0r(),sia=SMe(),aia=e0r(),O0r=xMe(),cia=aMe(),aG=tc(),lia=rG(),uia=_m(),dia=iG(),fia=oG(),pia=Kft(),hia=k0r(),mia=D0r(),gia=M0r(),Xft=Usi(),Qsi=nMe();$c.Composer=oia.Composer;$c.Document=sia.Document;$c.Schema=aia.Schema;$c.YAMLError=O0r.YAMLError;$c.YAMLParseError=O0r.YAMLParseError;$c.YAMLWarning=O0r.YAMLWarning;$c.Alias=cia.Alias;$c.isAlias=aG.isAlias;$c.isCollection=aG.isCollection;$c.isDocument=aG.isDocument;$c.isMap=aG.isMap;$c.isNode=aG.isNode;$c.isPair=aG.isPair;$c.isScalar=aG.isScalar;$c.isSeq=aG.isSeq;$c.Pair=lia.Pair;$c.Scalar=uia.Scalar;$c.YAMLMap=dia.YAMLMap;$c.YAMLSeq=fia.YAMLSeq;$c.CST=pia;$c.Lexer=hia.Lexer;$c.LineCounter=mia.LineCounter;$c.Parser=gia.Parser;$c.parse=Xft.parse;$c.parseAllDocuments=Xft.parseAllDocuments;$c.parseDocument=Xft.parseDocument;$c.stringify=Xft.stringify;$c.visit=Qsi.visit;$c.visitAsync=Qsi.visitAsync});var jsi=I(ept=>{"use strict";p();Object.defineProperty(ept,"__esModule",{value:!0});ept.FetchCancellationError=void 0;var Aia=Rs(),L0r=class extends Aia.CancellationError{static{a(this,"FetchCancellationError")}constructor(e){super(),this.extraInformation=e}};ept.FetchCancellationError=L0r});var $s=I(cG=>{"use strict";p();Object.defineProperty(cG,"__esModule",{value:!0});cG.IInstantiationService=cG._util=void 0;cG.createDecorator=Hsi;cG.refineServiceDecorator=Eia;var U8;(function(t){t.serviceIds=new Map,t.DI_TARGET="$di$target",t.DI_DEPENDENCIES="$di$dependencies";function e(r){return r[t.DI_DEPENDENCIES]||[]}a(e,"getServiceDependencies"),t.getServiceDependencies=e})(U8||(cG._util=U8={}));cG.IInstantiationService=Hsi("instantiationService");function yia(t,e,r){e[U8.DI_TARGET]===e?e[U8.DI_DEPENDENCIES].push({id:t,index:r}):(e[U8.DI_DEPENDENCIES]=[{id:t,index:r}],e[U8.DI_TARGET]=e)}a(yia,"storeServiceDependency");function Hsi(t){if(U8.serviceIds.has(t))return U8.serviceIds.get(t);let e=a(function(r,n,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");yia(e,r,o)},"id");return e.toString=()=>t,U8.serviceIds.set(t,e),e}a(Hsi,"createDecorator");function Eia(t){return t}a(Eia,"refineServiceDecorator")});var rpt=I(tpt=>{"use strict";p();Object.defineProperty(tpt,"__esModule",{value:!0});tpt.SyncDescriptor=void 0;var B0r=class{static{a(this,"SyncDescriptor")}constructor(e,r=[],n=!1){this.ctor=e,this.staticArguments=r,this.supportsDelayedInstantiation=n}};tpt.SyncDescriptor=B0r});var Gsi=I(r0e=>{"use strict";p();Object.defineProperty(r0e,"__esModule",{value:!0});r0e.Graph=r0e.Node=void 0;var npt=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.data=r,this.incoming=new Map,this.outgoing=new Map}};r0e.Node=npt;var F0r=class{static{a(this,"Graph")}constructor(e){this._hashFn=e,this._nodes=new Map}roots(){let e=[];for(let r of this._nodes.values())r.outgoing.size===0&&e.push(r);return e}insertEdge(e,r){let n=this.lookupOrInsertNode(e),o=this.lookupOrInsertNode(r);n.outgoing.set(o.key,o),o.incoming.set(n.key,n)}removeNode(e){let r=this._hashFn(e);this._nodes.delete(r);for(let n of this._nodes.values())n.outgoing.delete(r),n.incoming.delete(r)}lookupOrInsertNode(e){let r=this._hashFn(e),n=this._nodes.get(r);return n||(n=new npt(r,e),this._nodes.set(r,n)),n}lookup(e){return this._nodes.get(this._hashFn(e))}isEmpty(){return this._nodes.size===0}toString(){let e=[];for(let[r,n]of this._nodes)e.push(`${r} (-> incoming)[${[...n.incoming.keys()].join(", ")}] (outgoing ->)[${[...n.outgoing.keys()].join(",")}] `);return e.join(` -`)}findCycleSlow(){for(let[e,r]of this._nodes){let n=new Set([e]),o=this._findCycle(r,n);if(o)return o}}_findCycle(e,r){for(let[n,o]of e.outgoing){if(r.has(n))return[...r,n].join(" -> ");r.add(n);let s=this._findCycle(o,r);if(s)return s;r.delete(n)}}};Gme.Graph=p0r});var m0r=I($ft=>{"use strict";p();Object.defineProperty($ft,"__esModule",{value:!0});$ft.ServiceCollection=void 0;var h0r=class{static{a(this,"ServiceCollection")}constructor(...e){this._entries=new Map;for(let[r,n]of e)this.set(r,n)}set(e,r){let n=this._entries.get(e);return this._entries.set(e,r),n}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}};$ft.ServiceCollection=h0r});var ssi=I(Wme=>{"use strict";p();Object.defineProperty(Wme,"__esModule",{value:!0});Wme.Trace=Wme.InstantiationService=void 0;var qra=nl(),jra=Rs(),g0r=Ro(),$me=Hft(),osi=isi(),A0r=Gs(),Hra=m0r(),Gra=vue(),$ra=!1,Vft=class extends Error{static{a(this,"CyclicDependencyError")}constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: -${e.toString()}`}},y0r=class t{static{a(this,"InstantiationService")}constructor(e=new Hra.ServiceCollection,r=!1,n,o=$ra){this._services=e,this._strict=r,this._parent=n,this._enableTracing=o,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(A0r.IInstantiationService,this),this._globalGraph=o?n?._globalGraph??new osi.Graph(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,(0,g0r.dispose)(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)(0,g0r.isDisposable)(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,r){this._throwIfDisposed();let n=this,o=new class extends t{dispose(){n._children.delete(o),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(o),r?.add(o),o}invokeFunction(e,...r){this._throwIfDisposed();let n=Vme.traceInvocation(this._enableTracing,e),o=!1;try{return e({get:a(c=>{if(o)throw(0,jra.illegalState)("service accessor is only valid during the invocation of its target method");let l=this._getOrCreateServiceInstance(c,n);return l||this._throwIfStrict(`[invokeFunction] unknown service '${c}'`,!1),l},"get")},...r)}finally{o=!0,n.stop()}}createInstance(e,...r){this._throwIfDisposed();let n,o;return e instanceof $me.SyncDescriptor?(n=Vme.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(r),n)):(n=Vme.traceCreation(this._enableTracing,e),o=this._createInstance(e,r,n)),n.stop(),o}_createInstance(e,r=[],n){let o=A0r._util.getServiceDependencies(e).sort((l,u)=>l.index-u.index),s=[];for(let l of o){let u=this._getOrCreateServiceInstance(l.id,n);u||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id}.`,!1),s.push(u)}let c=o.length>0?o[0].index:r.length;if(r.length!==c){console.trace(`[createInstance] First service dependency of ${e.name} at position ${c+1} conflicts with ${r.length} static arguments`);let l=c-r.length;l>0?r=r.concat(new Array(l)):r=r.slice(0,c)}return Reflect.construct(e,r.concat(s))}_setCreatedServiceInstance(e,r){if(this._services.get(e)instanceof $me.SyncDescriptor)this._services.set(e,r);else if(this._parent)this._parent._setCreatedServiceInstance(e,r);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){let r=this._services.get(e);return!r&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):r}_getOrCreateServiceInstance(e,r){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));let n=this._getServiceInstanceOrDescriptor(e);return n instanceof $me.SyncDescriptor?this._safeCreateAndCacheServiceInstance(e,n,r.branch(e,!0)):(r.branch(e,!1),n)}_safeCreateAndCacheServiceInstance(e,r,n){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,r,n)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,r,n){let o=new osi.Graph(u=>u.id.toString()),s=0,c=[{id:e,desc:r,_trace:n}],l=new Set;for(;c.length;){let u=c.pop();if(!l.has(String(u.id))){if(l.add(String(u.id)),o.lookupOrInsertNode(u),s++>1e3)throw new Vft(o);for(let d of A0r._util.getServiceDependencies(u.desc.ctor)){let f=this._getServiceInstanceOrDescriptor(d.id);if(f||this._throwIfStrict(`[createInstance] ${e} depends on ${d.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(u.id),String(d.id)),f instanceof $me.SyncDescriptor){let h={id:d.id,desc:f,_trace:u._trace.branch(d.id,!0)};o.insertEdge(u,h),c.push(h)}}}}for(;;){let u=o.roots();if(u.length===0){if(!o.isEmpty())throw new Vft(o);break}for(let{data:d}of u){if(this._getServiceInstanceOrDescriptor(d.id)instanceof $me.SyncDescriptor){let h=this._createServiceInstanceWithOwner(d.id,d.desc.ctor,d.desc.staticArguments,d.desc.supportsDelayedInstantiation,d._trace);this._setCreatedServiceInstance(d.id,h)}o.removeNode(d)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,r,n=[],o,s){if(this._services.get(e)instanceof $me.SyncDescriptor)return this._createServiceInstance(e,r,n,o,s,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,r,n,o,s);throw new Error(`illegalState - creating UNKNOWN service instance ${r.name}`)}_createServiceInstance(e,r,n=[],o,s,c){if(o){let l=new t(void 0,this._strict,this,this._enableTracing);l._globalGraphImplicitDependency=String(e);let u=new Map,d=new qra.GlobalIdleValue(()=>{let f=l._createInstance(r,n,s);for(let[h,m]of u){let g=f[h];if(typeof g=="function")for(let A of m)A.disposable=g.apply(f,A.listener)}return u.clear(),c.add(f),f});return new Proxy(Object.create(null),{get(f,h){if(!d.isInitialized&&typeof h=="string"&&(h.startsWith("onDid")||h.startsWith("onWill"))){let A=u.get(h);return A||(A=new Gra.LinkedList,u.set(h,A)),a((E,_,v)=>{if(d.isInitialized)return d.value[h](E,_,v);{let b={listener:[E,_,v],disposable:void 0},T=A.push(b);return(0,g0r.toDisposable)(()=>{T(),b.disposable?.dispose()})}},"event")}if(h in f)return f[h];let m=d.value,g=m[h];return typeof g!="function"||(g=g.bind(m),f[h]=g),g},set(f,h,m){return d.value[h]=m,!0},getPrototypeOf(f){return r.prototype}})}else{let l=this._createInstance(r,n,s);return c.add(l),l}}_throwIfStrict(e,r){if(r&&console.warn(e),this._strict)throw new Error(e)}};Wme.InstantiationService=y0r;var Vme=class t{static{a(this,"Trace")}static{this.all=new Set}static{this._None=new class extends t{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(e,r){return e?new t(2,r.name||new Error().stack.split(` +`)}findCycleSlow(){for(let[e,r]of this._nodes){let n=new Set([e]),o=this._findCycle(r,n);if(o)return o}}_findCycle(e,r){for(let[n,o]of e.outgoing){if(r.has(n))return[...r,n].join(" -> ");r.add(n);let s=this._findCycle(o,r);if(s)return s;r.delete(n)}}};r0e.Graph=F0r});var Q0r=I(ipt=>{"use strict";p();Object.defineProperty(ipt,"__esModule",{value:!0});ipt.ServiceCollection=void 0;var U0r=class{static{a(this,"ServiceCollection")}constructor(...e){this._entries=new Map;for(let[r,n]of e)this.set(r,n)}set(e,r){let n=this._entries.get(e);return this._entries.set(e,r),n}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}};ipt.ServiceCollection=U0r});var Vsi=I(o0e=>{"use strict";p();Object.defineProperty(o0e,"__esModule",{value:!0});o0e.Trace=o0e.InstantiationService=void 0;var _ia=nl(),via=Rs(),q0r=Ro(),n0e=rpt(),$si=Gsi(),j0r=$s(),Cia=Q0r(),bia=Due(),Sia=!1,opt=class extends Error{static{a(this,"CyclicDependencyError")}constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: +${e.toString()}`}},H0r=class t{static{a(this,"InstantiationService")}constructor(e=new Cia.ServiceCollection,r=!1,n,o=Sia){this._services=e,this._strict=r,this._parent=n,this._enableTracing=o,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(j0r.IInstantiationService,this),this._globalGraph=o?n?._globalGraph??new $si.Graph(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,(0,q0r.dispose)(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)(0,q0r.isDisposable)(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,r){this._throwIfDisposed();let n=this,o=new class extends t{dispose(){n._children.delete(o),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(o),r?.add(o),o}invokeFunction(e,...r){this._throwIfDisposed();let n=i0e.traceInvocation(this._enableTracing,e),o=!1;try{return e({get:a(c=>{if(o)throw(0,via.illegalState)("service accessor is only valid during the invocation of its target method");let l=this._getOrCreateServiceInstance(c,n);return l||this._throwIfStrict(`[invokeFunction] unknown service '${c}'`,!1),l},"get")},...r)}finally{o=!0,n.stop()}}createInstance(e,...r){this._throwIfDisposed();let n,o;return e instanceof n0e.SyncDescriptor?(n=i0e.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(r),n)):(n=i0e.traceCreation(this._enableTracing,e),o=this._createInstance(e,r,n)),n.stop(),o}_createInstance(e,r=[],n){let o=j0r._util.getServiceDependencies(e).sort((l,u)=>l.index-u.index),s=[];for(let l of o){let u=this._getOrCreateServiceInstance(l.id,n);u||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id}.`,!1),s.push(u)}let c=o.length>0?o[0].index:r.length;if(r.length!==c){console.trace(`[createInstance] First service dependency of ${e.name} at position ${c+1} conflicts with ${r.length} static arguments`);let l=c-r.length;l>0?r=r.concat(new Array(l)):r=r.slice(0,c)}return Reflect.construct(e,r.concat(s))}_setCreatedServiceInstance(e,r){if(this._services.get(e)instanceof n0e.SyncDescriptor)this._services.set(e,r);else if(this._parent)this._parent._setCreatedServiceInstance(e,r);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){let r=this._services.get(e);return!r&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):r}_getOrCreateServiceInstance(e,r){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));let n=this._getServiceInstanceOrDescriptor(e);return n instanceof n0e.SyncDescriptor?this._safeCreateAndCacheServiceInstance(e,n,r.branch(e,!0)):(r.branch(e,!1),n)}_safeCreateAndCacheServiceInstance(e,r,n){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,r,n)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,r,n){let o=new $si.Graph(u=>u.id.toString()),s=0,c=[{id:e,desc:r,_trace:n}],l=new Set;for(;c.length;){let u=c.pop();if(!l.has(String(u.id))){if(l.add(String(u.id)),o.lookupOrInsertNode(u),s++>1e3)throw new opt(o);for(let d of j0r._util.getServiceDependencies(u.desc.ctor)){let f=this._getServiceInstanceOrDescriptor(d.id);if(f||this._throwIfStrict(`[createInstance] ${e} depends on ${d.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(u.id),String(d.id)),f instanceof n0e.SyncDescriptor){let h={id:d.id,desc:f,_trace:u._trace.branch(d.id,!0)};o.insertEdge(u,h),c.push(h)}}}}for(;;){let u=o.roots();if(u.length===0){if(!o.isEmpty())throw new opt(o);break}for(let{data:d}of u){if(this._getServiceInstanceOrDescriptor(d.id)instanceof n0e.SyncDescriptor){let h=this._createServiceInstanceWithOwner(d.id,d.desc.ctor,d.desc.staticArguments,d.desc.supportsDelayedInstantiation,d._trace);this._setCreatedServiceInstance(d.id,h)}o.removeNode(d)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,r,n=[],o,s){if(this._services.get(e)instanceof n0e.SyncDescriptor)return this._createServiceInstance(e,r,n,o,s,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,r,n,o,s);throw new Error(`illegalState - creating UNKNOWN service instance ${r.name}`)}_createServiceInstance(e,r,n=[],o,s,c){if(o){let l=new t(void 0,this._strict,this,this._enableTracing);l._globalGraphImplicitDependency=String(e);let u=new Map,d=new _ia.GlobalIdleValue(()=>{let f=l._createInstance(r,n,s);for(let[h,m]of u){let g=f[h];if(typeof g=="function")for(let A of m)A.disposable=g.apply(f,A.listener)}return u.clear(),c.add(f),f});return new Proxy(Object.create(null),{get(f,h){if(!d.isInitialized&&typeof h=="string"&&(h.startsWith("onDid")||h.startsWith("onWill"))){let A=u.get(h);return A||(A=new bia.LinkedList,u.set(h,A)),a((E,_,v)=>{if(d.isInitialized)return d.value[h](E,_,v);{let b={listener:[E,_,v],disposable:void 0},T=A.push(b);return(0,q0r.toDisposable)(()=>{T(),b.disposable?.dispose()})}},"event")}if(h in f)return f[h];let m=d.value,g=m[h];return typeof g!="function"||(g=g.bind(m),f[h]=g),g},set(f,h,m){return d.value[h]=m,!0},getPrototypeOf(f){return r.prototype}})}else{let l=this._createInstance(r,n,s);return c.add(l),l}}_throwIfStrict(e,r){if(r&&console.warn(e),this._strict)throw new Error(e)}};o0e.InstantiationService=H0r;var i0e=class t{static{a(this,"Trace")}static{this.all=new Set}static{this._None=new class extends t{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(e,r){return e?new t(2,r.name||new Error().stack.split(` `).slice(3,4).join(` `)):t._None}static traceCreation(e,r){return e?new t(1,r.name):t._None}static{this._totals=0}constructor(e,r){this.type=e,this.name=r,this._start=Date.now(),this._dep=[]}branch(e,r){let n=new t(3,e.toString());return this._dep.push([e,r,n]),n}stop(){let e=Date.now()-this._start;t._totals+=e;let r=!1;function n(s,c){let l=[],u=new Array(s+1).join(" ");for(let[d,f,h]of c._dep)if(f&&h){r=!0,l.push(`${u}CREATES -> ${d}`);let m=n(s+1,h);m&&l.push(m)}else l.push(`${u}uses -> ${d}`);return l.join(` `)}a(n,"printChild");let o=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${n(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${t._totals.toFixed(2)}ms)`];(e>2||r)&&t.all.add(o.join(` -`))}};Wme.Trace=Vme});var nn=I(zme=>{"use strict";p();Object.defineProperty(zme,"__esModule",{value:!0});zme.InstantiationServiceBuilder=zme.createServiceIdentifier=void 0;var Vra=Gs();Object.defineProperty(zme,"createServiceIdentifier",{enumerable:!0,get:a(function(){return Vra.createDecorator},"get")});var Wra=ssi(),asi=m0r(),E0r=class{static{a(this,"InstantiationServiceBuilder")}constructor(e){this._isSealed=!1,this._collection=Array.isArray(e)?new asi.ServiceCollection(...e):e??new asi.ServiceCollection}define(e,r){if(this._isSealed)throw new Error("This accessor is sealed and cannot be modified anymore.");this._collection.set(e,r)}seal(){if(this._isSealed)throw new Error("This accessor is sealed and cannot be seal again anymore.");return this._isSealed=!0,new Wra.InstantiationService(this._collection,!0)}};zme.InstantiationServiceBuilder=E0r});var _Me=I(uR=>{"use strict";p();Object.defineProperty(uR,"__esModule",{value:!0});uR.NullLanguageContextService=uR.TriggerKind=uR.KnownSources=uR.ContextKind=uR.ILanguageContextService=void 0;var zra=nn();uR.ILanguageContextService=(0,zra.createServiceIdentifier)("ILanguageContextService");var csi;(function(t){t.Snippet="snippet",t.Trait="trait",t.DiagnosticBag="diagnosticBag"})(csi||(uR.ContextKind=csi={}));var lsi;(function(t){t.unknown="unknown",t.sideCar="sideCar",t.completion="completion",t.populateCache="populateCache",t.nes="nes",t.chat="chat",t.fix="fix"})(lsi||(uR.KnownSources=lsi={}));var usi;(function(t){t.unknown="unknown",t.selection="selection",t.completion="completion"})(usi||(uR.TriggerKind=usi={}));var _0r=class{static{a(this,"EmptyAsyncIterable")}async*[Symbol.asyncIterator](){}};uR.NullLanguageContextService={_serviceBrand:void 0,isActivated:a(async()=>!1,"isActivated"),populateCache:a(async()=>{},"populateCache"),getContext:a(()=>new _0r,"getContext"),getContextOnTimeout:a(()=>[],"getContextOnTimeout")}});var fsi=I(Wft=>{"use strict";p();Object.defineProperty(Wft,"__esModule",{value:!0});Wft.serializeLanguageContext=Kra;Wft.serializeFileDiagnostics=tna;var Yra=eh(),v0r=_Me();function Kra(t){return{start:t.start,end:t.end,items:t.items.map(e=>({context:Jra(e.context),timeStamp:e.timeStamp,onTimeout:e.onTimeout}))}}a(Kra,"serializeLanguageContext");function Jra(t){switch(t.kind){case v0r.ContextKind.Snippet:return Zra(t);case v0r.ContextKind.Trait:return Xra(t);case v0r.ContextKind.DiagnosticBag:return ena(t)}}a(Jra,"serializeLanguageContextItem");function Zra(t){return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),additionalUris:t.additionalUris?.map(e=>e.toString()),value:t.value}}a(Zra,"serializeSnippetContext");function Xra(t){return{kind:t.kind,priority:t.priority,name:t.name,value:t.value}}a(Xra,"serializeTraitContext");function ena(t){let e=t.values.map(r=>dsi(r));return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),values:e}}a(ena,"serializeDiagnosticBagContext");function dsi(t,e){let r={severity:t.severity===0?"Error":t.severity===1?"Warning":t.severity===2?"Information":"Hint",message:t.message,source:t.source||"",code:t.code&&typeof t.code!="number"&&typeof t.code!="string"?t.code.value:t.code,range:new Yra.Range(t.range.start.line+1,t.range.start.character+1,t.range.end.line+1,t.range.end.character+1).toString()};return e&&(r.uri=e.toString()),r}a(dsi,"serializeDiagnostic");function tna(t){return t.flatMap(([e,r])=>r.map(n=>dsi(n,e)))}a(tna,"serializeFileDiagnostics")});var b0r=I(C0r=>{"use strict";p();Object.defineProperty(C0r,"__esModule",{value:!0});C0r.stringifyChatMessages=rna;var zft=Io();function rna(t){return t.map(nna).join(` -`)}a(rna,"stringifyChatMessages");function nna({role:t,content:e}){if(t!==zft.Raw.ChatRole.User&&t!==zft.Raw.ChatRole.System)return"omitted because of non-user and non-system role";let r=t===zft.Raw.ChatRole.User?"User":"System",n=e.at(0);return n?.type!==zft.Raw.ChatCompletionContentPartKind.Text?"omitted because of non-text content":`${r} +`))}};o0e.Trace=i0e});var nn=I(s0e=>{"use strict";p();Object.defineProperty(s0e,"__esModule",{value:!0});s0e.InstantiationServiceBuilder=s0e.createServiceIdentifier=void 0;var Tia=$s();Object.defineProperty(s0e,"createServiceIdentifier",{enumerable:!0,get:a(function(){return Tia.createDecorator},"get")});var Iia=Vsi(),Wsi=Q0r(),G0r=class{static{a(this,"InstantiationServiceBuilder")}constructor(e){this._isSealed=!1,this._collection=Array.isArray(e)?new Wsi.ServiceCollection(...e):e??new Wsi.ServiceCollection}define(e,r){if(this._isSealed)throw new Error("This accessor is sealed and cannot be modified anymore.");this._collection.set(e,r)}seal(){if(this._isSealed)throw new Error("This accessor is sealed and cannot be seal again anymore.");return this._isSealed=!0,new Iia.InstantiationService(this._collection,!0)}};s0e.InstantiationServiceBuilder=G0r});var MMe=I(ER=>{"use strict";p();Object.defineProperty(ER,"__esModule",{value:!0});ER.NullLanguageContextService=ER.TriggerKind=ER.KnownSources=ER.ContextKind=ER.ILanguageContextService=void 0;var xia=nn();ER.ILanguageContextService=(0,xia.createServiceIdentifier)("ILanguageContextService");var zsi;(function(t){t.Snippet="snippet",t.Trait="trait",t.DiagnosticBag="diagnosticBag"})(zsi||(ER.ContextKind=zsi={}));var Ysi;(function(t){t.unknown="unknown",t.sideCar="sideCar",t.completion="completion",t.populateCache="populateCache",t.nes="nes",t.chat="chat",t.fix="fix"})(Ysi||(ER.KnownSources=Ysi={}));var Ksi;(function(t){t.unknown="unknown",t.selection="selection",t.completion="completion"})(Ksi||(ER.TriggerKind=Ksi={}));var $0r=class{static{a(this,"EmptyAsyncIterable")}async*[Symbol.asyncIterator](){}};ER.NullLanguageContextService={_serviceBrand:void 0,isActivated:a(async()=>!1,"isActivated"),populateCache:a(async()=>{},"populateCache"),getContext:a(()=>new $0r,"getContext"),getContextOnTimeout:a(()=>[],"getContextOnTimeout")}});var Zsi=I(spt=>{"use strict";p();Object.defineProperty(spt,"__esModule",{value:!0});spt.serializeLanguageContext=Ria;spt.serializeFileDiagnostics=Mia;var wia=nh(),V0r=MMe();function Ria(t){return{start:t.start,end:t.end,items:t.items.map(e=>({context:kia(e.context),timeStamp:e.timeStamp,onTimeout:e.onTimeout}))}}a(Ria,"serializeLanguageContext");function kia(t){switch(t.kind){case V0r.ContextKind.Snippet:return Pia(t);case V0r.ContextKind.Trait:return Dia(t);case V0r.ContextKind.DiagnosticBag:return Nia(t)}}a(kia,"serializeLanguageContextItem");function Pia(t){return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),additionalUris:t.additionalUris?.map(e=>e.toString()),value:t.value}}a(Pia,"serializeSnippetContext");function Dia(t){return{kind:t.kind,priority:t.priority,name:t.name,value:t.value}}a(Dia,"serializeTraitContext");function Nia(t){let e=t.values.map(r=>Jsi(r));return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),values:e}}a(Nia,"serializeDiagnosticBagContext");function Jsi(t,e){let r={severity:t.severity===0?"Error":t.severity===1?"Warning":t.severity===2?"Information":"Hint",message:t.message,source:t.source||"",code:t.code&&typeof t.code!="number"&&typeof t.code!="string"?t.code.value:t.code,range:new wia.Range(t.range.start.line+1,t.range.start.character+1,t.range.end.line+1,t.range.end.character+1).toString()};return e&&(r.uri=e.toString()),r}a(Jsi,"serializeDiagnostic");function Mia(t){return t.flatMap(([e,r])=>r.map(n=>Jsi(n,e)))}a(Mia,"serializeFileDiagnostics")});var z0r=I(W0r=>{"use strict";p();Object.defineProperty(W0r,"__esModule",{value:!0});W0r.stringifyChatMessages=Oia;var apt=Io();function Oia(t){return t.map(Lia).join(` +`)}a(Oia,"stringifyChatMessages");function Lia({role:t,content:e}){if(t!==apt.Raw.ChatRole.User&&t!==apt.Raw.ChatRole.System)return"omitted because of non-user and non-system role";let r=t===apt.Raw.ChatRole.User?"User":"System",n=e.at(0);return n?.type!==apt.Raw.ChatCompletionContentPartKind.Text?"omitted because of non-text content":`${r} ------ ${n.text} -==================`}a(nna,"stringifyMessage")});var T0r=I(Yft=>{"use strict";p();Object.defineProperty(Yft,"__esModule",{value:!0});Yft.register=ona;Yft.getCodiconFontCharacters=sna;var ina=KS(),S0r=Object.create(null);function ona(t,e){if((0,ina.isString)(e)){let r=S0r[e];if(r===void 0)throw new Error(`${t} references an unknown codicon: ${e}`);e=r}return S0r[t]=e,{id:t}}a(ona,"register");function sna(){return S0r}a(sna,"getCodiconFontCharacters")});var psi=I(Kft=>{"use strict";p();Object.defineProperty(Kft,"__esModule",{value:!0});Kft.codiconsLibrary=void 0;var $=T0r();Kft.codiconsLibrary={add:(0,$.register)("add",6e4),plus:(0,$.register)("plus",6e4),gistNew:(0,$.register)("gist-new",6e4),repoCreate:(0,$.register)("repo-create",6e4),lightbulb:(0,$.register)("lightbulb",60001),lightBulb:(0,$.register)("light-bulb",60001),repo:(0,$.register)("repo",60002),repoDelete:(0,$.register)("repo-delete",60002),gistFork:(0,$.register)("gist-fork",60003),repoForked:(0,$.register)("repo-forked",60003),gitPullRequest:(0,$.register)("git-pull-request",60004),gitPullRequestAbandoned:(0,$.register)("git-pull-request-abandoned",60004),recordKeys:(0,$.register)("record-keys",60005),keyboard:(0,$.register)("keyboard",60005),tag:(0,$.register)("tag",60006),gitPullRequestLabel:(0,$.register)("git-pull-request-label",60006),tagAdd:(0,$.register)("tag-add",60006),tagRemove:(0,$.register)("tag-remove",60006),person:(0,$.register)("person",60007),personFollow:(0,$.register)("person-follow",60007),personOutline:(0,$.register)("person-outline",60007),personFilled:(0,$.register)("person-filled",60007),sourceControl:(0,$.register)("source-control",60008),mirror:(0,$.register)("mirror",60009),mirrorPublic:(0,$.register)("mirror-public",60009),star:(0,$.register)("star",60010),starAdd:(0,$.register)("star-add",60010),starDelete:(0,$.register)("star-delete",60010),starEmpty:(0,$.register)("star-empty",60010),comment:(0,$.register)("comment",60011),commentAdd:(0,$.register)("comment-add",60011),alert:(0,$.register)("alert",60012),warning:(0,$.register)("warning",60012),search:(0,$.register)("search",60013),searchSave:(0,$.register)("search-save",60013),logOut:(0,$.register)("log-out",60014),signOut:(0,$.register)("sign-out",60014),logIn:(0,$.register)("log-in",60015),signIn:(0,$.register)("sign-in",60015),eye:(0,$.register)("eye",60016),eyeUnwatch:(0,$.register)("eye-unwatch",60016),eyeWatch:(0,$.register)("eye-watch",60016),circleFilled:(0,$.register)("circle-filled",60017),primitiveDot:(0,$.register)("primitive-dot",60017),closeDirty:(0,$.register)("close-dirty",60017),debugBreakpoint:(0,$.register)("debug-breakpoint",60017),debugBreakpointDisabled:(0,$.register)("debug-breakpoint-disabled",60017),debugHint:(0,$.register)("debug-hint",60017),terminalDecorationSuccess:(0,$.register)("terminal-decoration-success",60017),primitiveSquare:(0,$.register)("primitive-square",60018),edit:(0,$.register)("edit",60019),pencil:(0,$.register)("pencil",60019),info:(0,$.register)("info",60020),issueOpened:(0,$.register)("issue-opened",60020),gistPrivate:(0,$.register)("gist-private",60021),gitForkPrivate:(0,$.register)("git-fork-private",60021),lock:(0,$.register)("lock",60021),mirrorPrivate:(0,$.register)("mirror-private",60021),close:(0,$.register)("close",60022),removeClose:(0,$.register)("remove-close",60022),x:(0,$.register)("x",60022),repoSync:(0,$.register)("repo-sync",60023),sync:(0,$.register)("sync",60023),clone:(0,$.register)("clone",60024),desktopDownload:(0,$.register)("desktop-download",60024),beaker:(0,$.register)("beaker",60025),microscope:(0,$.register)("microscope",60025),vm:(0,$.register)("vm",60026),deviceDesktop:(0,$.register)("device-desktop",60026),file:(0,$.register)("file",60027),more:(0,$.register)("more",60028),ellipsis:(0,$.register)("ellipsis",60028),kebabHorizontal:(0,$.register)("kebab-horizontal",60028),mailReply:(0,$.register)("mail-reply",60029),reply:(0,$.register)("reply",60029),organization:(0,$.register)("organization",60030),organizationFilled:(0,$.register)("organization-filled",60030),organizationOutline:(0,$.register)("organization-outline",60030),newFile:(0,$.register)("new-file",60031),fileAdd:(0,$.register)("file-add",60031),newFolder:(0,$.register)("new-folder",60032),fileDirectoryCreate:(0,$.register)("file-directory-create",60032),trash:(0,$.register)("trash",60033),trashcan:(0,$.register)("trashcan",60033),history:(0,$.register)("history",60034),clock:(0,$.register)("clock",60034),folder:(0,$.register)("folder",60035),fileDirectory:(0,$.register)("file-directory",60035),symbolFolder:(0,$.register)("symbol-folder",60035),logoGithub:(0,$.register)("logo-github",60036),markGithub:(0,$.register)("mark-github",60036),github:(0,$.register)("github",60036),terminal:(0,$.register)("terminal",60037),console:(0,$.register)("console",60037),repl:(0,$.register)("repl",60037),zap:(0,$.register)("zap",60038),symbolEvent:(0,$.register)("symbol-event",60038),error:(0,$.register)("error",60039),stop:(0,$.register)("stop",60039),variable:(0,$.register)("variable",60040),symbolVariable:(0,$.register)("symbol-variable",60040),array:(0,$.register)("array",60042),symbolArray:(0,$.register)("symbol-array",60042),symbolModule:(0,$.register)("symbol-module",60043),symbolPackage:(0,$.register)("symbol-package",60043),symbolNamespace:(0,$.register)("symbol-namespace",60043),symbolObject:(0,$.register)("symbol-object",60043),symbolMethod:(0,$.register)("symbol-method",60044),symbolFunction:(0,$.register)("symbol-function",60044),symbolConstructor:(0,$.register)("symbol-constructor",60044),symbolBoolean:(0,$.register)("symbol-boolean",60047),symbolNull:(0,$.register)("symbol-null",60047),symbolNumeric:(0,$.register)("symbol-numeric",60048),symbolNumber:(0,$.register)("symbol-number",60048),symbolStructure:(0,$.register)("symbol-structure",60049),symbolStruct:(0,$.register)("symbol-struct",60049),symbolParameter:(0,$.register)("symbol-parameter",60050),symbolTypeParameter:(0,$.register)("symbol-type-parameter",60050),symbolKey:(0,$.register)("symbol-key",60051),symbolText:(0,$.register)("symbol-text",60051),symbolReference:(0,$.register)("symbol-reference",60052),goToFile:(0,$.register)("go-to-file",60052),symbolEnum:(0,$.register)("symbol-enum",60053),symbolValue:(0,$.register)("symbol-value",60053),symbolRuler:(0,$.register)("symbol-ruler",60054),symbolUnit:(0,$.register)("symbol-unit",60054),activateBreakpoints:(0,$.register)("activate-breakpoints",60055),archive:(0,$.register)("archive",60056),arrowBoth:(0,$.register)("arrow-both",60057),arrowDown:(0,$.register)("arrow-down",60058),arrowLeft:(0,$.register)("arrow-left",60059),arrowRight:(0,$.register)("arrow-right",60060),arrowSmallDown:(0,$.register)("arrow-small-down",60061),arrowSmallLeft:(0,$.register)("arrow-small-left",60062),arrowSmallRight:(0,$.register)("arrow-small-right",60063),arrowSmallUp:(0,$.register)("arrow-small-up",60064),arrowUp:(0,$.register)("arrow-up",60065),bell:(0,$.register)("bell",60066),bold:(0,$.register)("bold",60067),book:(0,$.register)("book",60068),bookmark:(0,$.register)("bookmark",60069),debugBreakpointConditionalUnverified:(0,$.register)("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:(0,$.register)("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:(0,$.register)("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:(0,$.register)("debug-breakpoint-data-unverified",60072),debugBreakpointData:(0,$.register)("debug-breakpoint-data",60073),debugBreakpointDataDisabled:(0,$.register)("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:(0,$.register)("debug-breakpoint-log-unverified",60074),debugBreakpointLog:(0,$.register)("debug-breakpoint-log",60075),debugBreakpointLogDisabled:(0,$.register)("debug-breakpoint-log-disabled",60075),briefcase:(0,$.register)("briefcase",60076),broadcast:(0,$.register)("broadcast",60077),browser:(0,$.register)("browser",60078),bug:(0,$.register)("bug",60079),calendar:(0,$.register)("calendar",60080),caseSensitive:(0,$.register)("case-sensitive",60081),check:(0,$.register)("check",60082),checklist:(0,$.register)("checklist",60083),chevronDown:(0,$.register)("chevron-down",60084),chevronLeft:(0,$.register)("chevron-left",60085),chevronRight:(0,$.register)("chevron-right",60086),chevronUp:(0,$.register)("chevron-up",60087),chromeClose:(0,$.register)("chrome-close",60088),chromeMaximize:(0,$.register)("chrome-maximize",60089),chromeMinimize:(0,$.register)("chrome-minimize",60090),chromeRestore:(0,$.register)("chrome-restore",60091),circleOutline:(0,$.register)("circle-outline",60092),circle:(0,$.register)("circle",60092),debugBreakpointUnverified:(0,$.register)("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:(0,$.register)("terminal-decoration-incomplete",60092),circleSlash:(0,$.register)("circle-slash",60093),circuitBoard:(0,$.register)("circuit-board",60094),clearAll:(0,$.register)("clear-all",60095),clippy:(0,$.register)("clippy",60096),closeAll:(0,$.register)("close-all",60097),cloudDownload:(0,$.register)("cloud-download",60098),cloudUpload:(0,$.register)("cloud-upload",60099),code:(0,$.register)("code",60100),collapseAll:(0,$.register)("collapse-all",60101),colorMode:(0,$.register)("color-mode",60102),commentDiscussion:(0,$.register)("comment-discussion",60103),creditCard:(0,$.register)("credit-card",60105),dash:(0,$.register)("dash",60108),dashboard:(0,$.register)("dashboard",60109),database:(0,$.register)("database",60110),debugContinue:(0,$.register)("debug-continue",60111),debugDisconnect:(0,$.register)("debug-disconnect",60112),debugPause:(0,$.register)("debug-pause",60113),debugRestart:(0,$.register)("debug-restart",60114),debugStart:(0,$.register)("debug-start",60115),debugStepInto:(0,$.register)("debug-step-into",60116),debugStepOut:(0,$.register)("debug-step-out",60117),debugStepOver:(0,$.register)("debug-step-over",60118),debugStop:(0,$.register)("debug-stop",60119),debug:(0,$.register)("debug",60120),deviceCameraVideo:(0,$.register)("device-camera-video",60121),deviceCamera:(0,$.register)("device-camera",60122),deviceMobile:(0,$.register)("device-mobile",60123),diffAdded:(0,$.register)("diff-added",60124),diffIgnored:(0,$.register)("diff-ignored",60125),diffModified:(0,$.register)("diff-modified",60126),diffRemoved:(0,$.register)("diff-removed",60127),diffRenamed:(0,$.register)("diff-renamed",60128),diff:(0,$.register)("diff",60129),diffSidebyside:(0,$.register)("diff-sidebyside",60129),discard:(0,$.register)("discard",60130),editorLayout:(0,$.register)("editor-layout",60131),emptyWindow:(0,$.register)("empty-window",60132),exclude:(0,$.register)("exclude",60133),extensions:(0,$.register)("extensions",60134),eyeClosed:(0,$.register)("eye-closed",60135),fileBinary:(0,$.register)("file-binary",60136),fileCode:(0,$.register)("file-code",60137),fileMedia:(0,$.register)("file-media",60138),filePdf:(0,$.register)("file-pdf",60139),fileSubmodule:(0,$.register)("file-submodule",60140),fileSymlinkDirectory:(0,$.register)("file-symlink-directory",60141),fileSymlinkFile:(0,$.register)("file-symlink-file",60142),fileZip:(0,$.register)("file-zip",60143),files:(0,$.register)("files",60144),filter:(0,$.register)("filter",60145),flame:(0,$.register)("flame",60146),foldDown:(0,$.register)("fold-down",60147),foldUp:(0,$.register)("fold-up",60148),fold:(0,$.register)("fold",60149),folderActive:(0,$.register)("folder-active",60150),folderOpened:(0,$.register)("folder-opened",60151),gear:(0,$.register)("gear",60152),gift:(0,$.register)("gift",60153),gistSecret:(0,$.register)("gist-secret",60154),gist:(0,$.register)("gist",60155),gitCommit:(0,$.register)("git-commit",60156),gitCompare:(0,$.register)("git-compare",60157),compareChanges:(0,$.register)("compare-changes",60157),gitMerge:(0,$.register)("git-merge",60158),githubAction:(0,$.register)("github-action",60159),githubAlt:(0,$.register)("github-alt",60160),globe:(0,$.register)("globe",60161),grabber:(0,$.register)("grabber",60162),graph:(0,$.register)("graph",60163),gripper:(0,$.register)("gripper",60164),heart:(0,$.register)("heart",60165),home:(0,$.register)("home",60166),horizontalRule:(0,$.register)("horizontal-rule",60167),hubot:(0,$.register)("hubot",60168),inbox:(0,$.register)("inbox",60169),issueReopened:(0,$.register)("issue-reopened",60171),issues:(0,$.register)("issues",60172),italic:(0,$.register)("italic",60173),jersey:(0,$.register)("jersey",60174),json:(0,$.register)("json",60175),bracket:(0,$.register)("bracket",60175),kebabVertical:(0,$.register)("kebab-vertical",60176),key:(0,$.register)("key",60177),law:(0,$.register)("law",60178),lightbulbAutofix:(0,$.register)("lightbulb-autofix",60179),linkExternal:(0,$.register)("link-external",60180),link:(0,$.register)("link",60181),listOrdered:(0,$.register)("list-ordered",60182),listUnordered:(0,$.register)("list-unordered",60183),liveShare:(0,$.register)("live-share",60184),loading:(0,$.register)("loading",60185),location:(0,$.register)("location",60186),mailRead:(0,$.register)("mail-read",60187),mail:(0,$.register)("mail",60188),markdown:(0,$.register)("markdown",60189),megaphone:(0,$.register)("megaphone",60190),mention:(0,$.register)("mention",60191),milestone:(0,$.register)("milestone",60192),gitPullRequestMilestone:(0,$.register)("git-pull-request-milestone",60192),mortarBoard:(0,$.register)("mortar-board",60193),move:(0,$.register)("move",60194),multipleWindows:(0,$.register)("multiple-windows",60195),mute:(0,$.register)("mute",60196),noNewline:(0,$.register)("no-newline",60197),note:(0,$.register)("note",60198),octoface:(0,$.register)("octoface",60199),openPreview:(0,$.register)("open-preview",60200),package:(0,$.register)("package",60201),paintcan:(0,$.register)("paintcan",60202),pin:(0,$.register)("pin",60203),play:(0,$.register)("play",60204),run:(0,$.register)("run",60204),plug:(0,$.register)("plug",60205),preserveCase:(0,$.register)("preserve-case",60206),preview:(0,$.register)("preview",60207),project:(0,$.register)("project",60208),pulse:(0,$.register)("pulse",60209),question:(0,$.register)("question",60210),quote:(0,$.register)("quote",60211),radioTower:(0,$.register)("radio-tower",60212),reactions:(0,$.register)("reactions",60213),references:(0,$.register)("references",60214),refresh:(0,$.register)("refresh",60215),regex:(0,$.register)("regex",60216),remoteExplorer:(0,$.register)("remote-explorer",60217),remote:(0,$.register)("remote",60218),remove:(0,$.register)("remove",60219),replaceAll:(0,$.register)("replace-all",60220),replace:(0,$.register)("replace",60221),repoClone:(0,$.register)("repo-clone",60222),repoForcePush:(0,$.register)("repo-force-push",60223),repoPull:(0,$.register)("repo-pull",60224),repoPush:(0,$.register)("repo-push",60225),report:(0,$.register)("report",60226),requestChanges:(0,$.register)("request-changes",60227),rocket:(0,$.register)("rocket",60228),rootFolderOpened:(0,$.register)("root-folder-opened",60229),rootFolder:(0,$.register)("root-folder",60230),rss:(0,$.register)("rss",60231),ruby:(0,$.register)("ruby",60232),saveAll:(0,$.register)("save-all",60233),saveAs:(0,$.register)("save-as",60234),save:(0,$.register)("save",60235),screenFull:(0,$.register)("screen-full",60236),screenNormal:(0,$.register)("screen-normal",60237),searchStop:(0,$.register)("search-stop",60238),server:(0,$.register)("server",60240),settingsGear:(0,$.register)("settings-gear",60241),settings:(0,$.register)("settings",60242),shield:(0,$.register)("shield",60243),smiley:(0,$.register)("smiley",60244),sortPrecedence:(0,$.register)("sort-precedence",60245),splitHorizontal:(0,$.register)("split-horizontal",60246),splitVertical:(0,$.register)("split-vertical",60247),squirrel:(0,$.register)("squirrel",60248),starFull:(0,$.register)("star-full",60249),starHalf:(0,$.register)("star-half",60250),symbolClass:(0,$.register)("symbol-class",60251),symbolColor:(0,$.register)("symbol-color",60252),symbolConstant:(0,$.register)("symbol-constant",60253),symbolEnumMember:(0,$.register)("symbol-enum-member",60254),symbolField:(0,$.register)("symbol-field",60255),symbolFile:(0,$.register)("symbol-file",60256),symbolInterface:(0,$.register)("symbol-interface",60257),symbolKeyword:(0,$.register)("symbol-keyword",60258),symbolMisc:(0,$.register)("symbol-misc",60259),symbolOperator:(0,$.register)("symbol-operator",60260),symbolProperty:(0,$.register)("symbol-property",60261),wrench:(0,$.register)("wrench",60261),wrenchSubaction:(0,$.register)("wrench-subaction",60261),symbolSnippet:(0,$.register)("symbol-snippet",60262),tasklist:(0,$.register)("tasklist",60263),telescope:(0,$.register)("telescope",60264),textSize:(0,$.register)("text-size",60265),threeBars:(0,$.register)("three-bars",60266),thumbsdown:(0,$.register)("thumbsdown",60267),thumbsup:(0,$.register)("thumbsup",60268),tools:(0,$.register)("tools",60269),triangleDown:(0,$.register)("triangle-down",60270),triangleLeft:(0,$.register)("triangle-left",60271),triangleRight:(0,$.register)("triangle-right",60272),triangleUp:(0,$.register)("triangle-up",60273),twitter:(0,$.register)("twitter",60274),unfold:(0,$.register)("unfold",60275),unlock:(0,$.register)("unlock",60276),unmute:(0,$.register)("unmute",60277),unverified:(0,$.register)("unverified",60278),verified:(0,$.register)("verified",60279),versions:(0,$.register)("versions",60280),vmActive:(0,$.register)("vm-active",60281),vmOutline:(0,$.register)("vm-outline",60282),vmRunning:(0,$.register)("vm-running",60283),watch:(0,$.register)("watch",60284),whitespace:(0,$.register)("whitespace",60285),wholeWord:(0,$.register)("whole-word",60286),window:(0,$.register)("window",60287),wordWrap:(0,$.register)("word-wrap",60288),zoomIn:(0,$.register)("zoom-in",60289),zoomOut:(0,$.register)("zoom-out",60290),listFilter:(0,$.register)("list-filter",60291),listFlat:(0,$.register)("list-flat",60292),listSelection:(0,$.register)("list-selection",60293),selection:(0,$.register)("selection",60293),listTree:(0,$.register)("list-tree",60294),debugBreakpointFunctionUnverified:(0,$.register)("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:(0,$.register)("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:(0,$.register)("debug-breakpoint-function-disabled",60296),debugStackframeActive:(0,$.register)("debug-stackframe-active",60297),circleSmallFilled:(0,$.register)("circle-small-filled",60298),debugStackframeDot:(0,$.register)("debug-stackframe-dot",60298),terminalDecorationMark:(0,$.register)("terminal-decoration-mark",60298),debugStackframe:(0,$.register)("debug-stackframe",60299),debugStackframeFocused:(0,$.register)("debug-stackframe-focused",60299),debugBreakpointUnsupported:(0,$.register)("debug-breakpoint-unsupported",60300),symbolString:(0,$.register)("symbol-string",60301),debugReverseContinue:(0,$.register)("debug-reverse-continue",60302),debugStepBack:(0,$.register)("debug-step-back",60303),debugRestartFrame:(0,$.register)("debug-restart-frame",60304),debugAlt:(0,$.register)("debug-alt",60305),callIncoming:(0,$.register)("call-incoming",60306),callOutgoing:(0,$.register)("call-outgoing",60307),menu:(0,$.register)("menu",60308),expandAll:(0,$.register)("expand-all",60309),feedback:(0,$.register)("feedback",60310),gitPullRequestReviewer:(0,$.register)("git-pull-request-reviewer",60310),groupByRefType:(0,$.register)("group-by-ref-type",60311),ungroupByRefType:(0,$.register)("ungroup-by-ref-type",60312),account:(0,$.register)("account",60313),gitPullRequestAssignee:(0,$.register)("git-pull-request-assignee",60313),bellDot:(0,$.register)("bell-dot",60314),debugConsole:(0,$.register)("debug-console",60315),library:(0,$.register)("library",60316),output:(0,$.register)("output",60317),runAll:(0,$.register)("run-all",60318),syncIgnored:(0,$.register)("sync-ignored",60319),pinned:(0,$.register)("pinned",60320),githubInverted:(0,$.register)("github-inverted",60321),serverProcess:(0,$.register)("server-process",60322),serverEnvironment:(0,$.register)("server-environment",60323),pass:(0,$.register)("pass",60324),issueClosed:(0,$.register)("issue-closed",60324),stopCircle:(0,$.register)("stop-circle",60325),playCircle:(0,$.register)("play-circle",60326),record:(0,$.register)("record",60327),debugAltSmall:(0,$.register)("debug-alt-small",60328),vmConnect:(0,$.register)("vm-connect",60329),cloud:(0,$.register)("cloud",60330),merge:(0,$.register)("merge",60331),export:(0,$.register)("export",60332),graphLeft:(0,$.register)("graph-left",60333),magnet:(0,$.register)("magnet",60334),notebook:(0,$.register)("notebook",60335),redo:(0,$.register)("redo",60336),checkAll:(0,$.register)("check-all",60337),pinnedDirty:(0,$.register)("pinned-dirty",60338),passFilled:(0,$.register)("pass-filled",60339),circleLargeFilled:(0,$.register)("circle-large-filled",60340),circleLarge:(0,$.register)("circle-large",60341),circleLargeOutline:(0,$.register)("circle-large-outline",60341),combine:(0,$.register)("combine",60342),gather:(0,$.register)("gather",60342),table:(0,$.register)("table",60343),variableGroup:(0,$.register)("variable-group",60344),typeHierarchy:(0,$.register)("type-hierarchy",60345),typeHierarchySub:(0,$.register)("type-hierarchy-sub",60346),typeHierarchySuper:(0,$.register)("type-hierarchy-super",60347),gitPullRequestCreate:(0,$.register)("git-pull-request-create",60348),runAbove:(0,$.register)("run-above",60349),runBelow:(0,$.register)("run-below",60350),notebookTemplate:(0,$.register)("notebook-template",60351),debugRerun:(0,$.register)("debug-rerun",60352),workspaceTrusted:(0,$.register)("workspace-trusted",60353),workspaceUntrusted:(0,$.register)("workspace-untrusted",60354),workspaceUnknown:(0,$.register)("workspace-unknown",60355),terminalCmd:(0,$.register)("terminal-cmd",60356),terminalDebian:(0,$.register)("terminal-debian",60357),terminalLinux:(0,$.register)("terminal-linux",60358),terminalPowershell:(0,$.register)("terminal-powershell",60359),terminalTmux:(0,$.register)("terminal-tmux",60360),terminalUbuntu:(0,$.register)("terminal-ubuntu",60361),terminalBash:(0,$.register)("terminal-bash",60362),arrowSwap:(0,$.register)("arrow-swap",60363),copy:(0,$.register)("copy",60364),personAdd:(0,$.register)("person-add",60365),filterFilled:(0,$.register)("filter-filled",60366),wand:(0,$.register)("wand",60367),debugLineByLine:(0,$.register)("debug-line-by-line",60368),inspect:(0,$.register)("inspect",60369),layers:(0,$.register)("layers",60370),layersDot:(0,$.register)("layers-dot",60371),layersActive:(0,$.register)("layers-active",60372),compass:(0,$.register)("compass",60373),compassDot:(0,$.register)("compass-dot",60374),compassActive:(0,$.register)("compass-active",60375),azure:(0,$.register)("azure",60376),issueDraft:(0,$.register)("issue-draft",60377),gitPullRequestClosed:(0,$.register)("git-pull-request-closed",60378),gitPullRequestDraft:(0,$.register)("git-pull-request-draft",60379),debugAll:(0,$.register)("debug-all",60380),debugCoverage:(0,$.register)("debug-coverage",60381),runErrors:(0,$.register)("run-errors",60382),folderLibrary:(0,$.register)("folder-library",60383),debugContinueSmall:(0,$.register)("debug-continue-small",60384),beakerStop:(0,$.register)("beaker-stop",60385),graphLine:(0,$.register)("graph-line",60386),graphScatter:(0,$.register)("graph-scatter",60387),pieChart:(0,$.register)("pie-chart",60388),bracketDot:(0,$.register)("bracket-dot",60389),bracketError:(0,$.register)("bracket-error",60390),lockSmall:(0,$.register)("lock-small",60391),azureDevops:(0,$.register)("azure-devops",60392),verifiedFilled:(0,$.register)("verified-filled",60393),newline:(0,$.register)("newline",60394),layout:(0,$.register)("layout",60395),layoutActivitybarLeft:(0,$.register)("layout-activitybar-left",60396),layoutActivitybarRight:(0,$.register)("layout-activitybar-right",60397),layoutPanelLeft:(0,$.register)("layout-panel-left",60398),layoutPanelCenter:(0,$.register)("layout-panel-center",60399),layoutPanelJustify:(0,$.register)("layout-panel-justify",60400),layoutPanelRight:(0,$.register)("layout-panel-right",60401),layoutPanel:(0,$.register)("layout-panel",60402),layoutSidebarLeft:(0,$.register)("layout-sidebar-left",60403),layoutSidebarRight:(0,$.register)("layout-sidebar-right",60404),layoutStatusbar:(0,$.register)("layout-statusbar",60405),layoutMenubar:(0,$.register)("layout-menubar",60406),layoutCentered:(0,$.register)("layout-centered",60407),target:(0,$.register)("target",60408),indent:(0,$.register)("indent",60409),recordSmall:(0,$.register)("record-small",60410),errorSmall:(0,$.register)("error-small",60411),terminalDecorationError:(0,$.register)("terminal-decoration-error",60411),arrowCircleDown:(0,$.register)("arrow-circle-down",60412),arrowCircleLeft:(0,$.register)("arrow-circle-left",60413),arrowCircleRight:(0,$.register)("arrow-circle-right",60414),arrowCircleUp:(0,$.register)("arrow-circle-up",60415),layoutSidebarRightOff:(0,$.register)("layout-sidebar-right-off",60416),layoutPanelOff:(0,$.register)("layout-panel-off",60417),layoutSidebarLeftOff:(0,$.register)("layout-sidebar-left-off",60418),blank:(0,$.register)("blank",60419),heartFilled:(0,$.register)("heart-filled",60420),map:(0,$.register)("map",60421),mapHorizontal:(0,$.register)("map-horizontal",60421),foldHorizontal:(0,$.register)("fold-horizontal",60421),mapFilled:(0,$.register)("map-filled",60422),mapHorizontalFilled:(0,$.register)("map-horizontal-filled",60422),foldHorizontalFilled:(0,$.register)("fold-horizontal-filled",60422),circleSmall:(0,$.register)("circle-small",60423),bellSlash:(0,$.register)("bell-slash",60424),bellSlashDot:(0,$.register)("bell-slash-dot",60425),commentUnresolved:(0,$.register)("comment-unresolved",60426),gitPullRequestGoToChanges:(0,$.register)("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:(0,$.register)("git-pull-request-new-changes",60428),searchFuzzy:(0,$.register)("search-fuzzy",60429),commentDraft:(0,$.register)("comment-draft",60430),send:(0,$.register)("send",60431),sparkle:(0,$.register)("sparkle",60432),insert:(0,$.register)("insert",60433),mic:(0,$.register)("mic",60434),thumbsdownFilled:(0,$.register)("thumbsdown-filled",60435),thumbsupFilled:(0,$.register)("thumbsup-filled",60436),coffee:(0,$.register)("coffee",60437),snake:(0,$.register)("snake",60438),game:(0,$.register)("game",60439),vr:(0,$.register)("vr",60440),chip:(0,$.register)("chip",60441),piano:(0,$.register)("piano",60442),music:(0,$.register)("music",60443),micFilled:(0,$.register)("mic-filled",60444),repoFetch:(0,$.register)("repo-fetch",60445),copilot:(0,$.register)("copilot",60446),lightbulbSparkle:(0,$.register)("lightbulb-sparkle",60447),robot:(0,$.register)("robot",60448),sparkleFilled:(0,$.register)("sparkle-filled",60449),diffSingle:(0,$.register)("diff-single",60450),diffMultiple:(0,$.register)("diff-multiple",60451),surroundWith:(0,$.register)("surround-with",60452),share:(0,$.register)("share",60453),gitStash:(0,$.register)("git-stash",60454),gitStashApply:(0,$.register)("git-stash-apply",60455),gitStashPop:(0,$.register)("git-stash-pop",60456),vscode:(0,$.register)("vscode",60457),vscodeInsiders:(0,$.register)("vscode-insiders",60458),codeOss:(0,$.register)("code-oss",60459),runCoverage:(0,$.register)("run-coverage",60460),runAllCoverage:(0,$.register)("run-all-coverage",60461),coverage:(0,$.register)("coverage",60462),githubProject:(0,$.register)("github-project",60463),mapVertical:(0,$.register)("map-vertical",60464),foldVertical:(0,$.register)("fold-vertical",60464),mapVerticalFilled:(0,$.register)("map-vertical-filled",60465),foldVerticalFilled:(0,$.register)("fold-vertical-filled",60465),goToSearch:(0,$.register)("go-to-search",60466),percentage:(0,$.register)("percentage",60467),sortPercentage:(0,$.register)("sort-percentage",60467),attach:(0,$.register)("attach",60468),goToEditingSession:(0,$.register)("go-to-editing-session",60469),editSession:(0,$.register)("edit-session",60470),codeReview:(0,$.register)("code-review",60471),copilotWarning:(0,$.register)("copilot-warning",60472),python:(0,$.register)("python",60473),copilotLarge:(0,$.register)("copilot-large",60474),copilotWarningLarge:(0,$.register)("copilot-warning-large",60475),keyboardTab:(0,$.register)("keyboard-tab",60476),copilotBlocked:(0,$.register)("copilot-blocked",60477),copilotNotConnected:(0,$.register)("copilot-not-connected",60478),flag:(0,$.register)("flag",60479),lightbulbEmpty:(0,$.register)("lightbulb-empty",60480),symbolMethodArrow:(0,$.register)("symbol-method-arrow",60481),copilotUnavailable:(0,$.register)("copilot-unavailable",60482),repoPinned:(0,$.register)("repo-pinned",60483),keyboardTabAbove:(0,$.register)("keyboard-tab-above",60484),keyboardTabBelow:(0,$.register)("keyboard-tab-below",60485),gitPullRequestDone:(0,$.register)("git-pull-request-done",60486),mcp:(0,$.register)("mcp",60487),extensionsLarge:(0,$.register)("extensions-large",60488),layoutPanelDock:(0,$.register)("layout-panel-dock",60489),layoutSidebarLeftDock:(0,$.register)("layout-sidebar-left-dock",60490),layoutSidebarRightDock:(0,$.register)("layout-sidebar-right-dock",60491),copilotInProgress:(0,$.register)("copilot-in-progress",60492),copilotError:(0,$.register)("copilot-error",60493),copilotSuccess:(0,$.register)("copilot-success",60494),chatSparkle:(0,$.register)("chat-sparkle",60495),searchSparkle:(0,$.register)("search-sparkle",60496),editSparkle:(0,$.register)("edit-sparkle",60497),copilotSnooze:(0,$.register)("copilot-snooze",60498),sendToRemoteAgent:(0,$.register)("send-to-remote-agent",60499),commentDiscussionSparkle:(0,$.register)("comment-discussion-sparkle",60500),chatSparkleWarning:(0,$.register)("chat-sparkle-warning",60501),chatSparkleError:(0,$.register)("chat-sparkle-error",60502),collection:(0,$.register)("collection",60503),newCollection:(0,$.register)("new-collection",60504),thinking:(0,$.register)("thinking",60505),build:(0,$.register)("build",60506),commentDiscussionQuote:(0,$.register)("comment-discussion-quote",60507),cursor:(0,$.register)("cursor",60508),eraser:(0,$.register)("eraser",60509),fileText:(0,$.register)("file-text",60510),quotes:(0,$.register)("quotes",60512),rename:(0,$.register)("rename",60513),runWithDeps:(0,$.register)("run-with-deps",60514),debugConnected:(0,$.register)("debug-connected",60515),strikethrough:(0,$.register)("strikethrough",60516),openInProduct:(0,$.register)("open-in-product",60517),indexZero:(0,$.register)("index-zero",60518),agent:(0,$.register)("agent",60519),editCode:(0,$.register)("edit-code",60520),repoSelected:(0,$.register)("repo-selected",60521),skip:(0,$.register)("skip",60522),mergeInto:(0,$.register)("merge-into",60523),gitBranchChanges:(0,$.register)("git-branch-changes",60524),gitBranchStagedChanges:(0,$.register)("git-branch-staged-changes",60525),gitBranchConflicts:(0,$.register)("git-branch-conflicts",60526),gitBranch:(0,$.register)("git-branch",60527),gitBranchCreate:(0,$.register)("git-branch-create",60527),gitBranchDelete:(0,$.register)("git-branch-delete",60527),searchLarge:(0,$.register)("search-large",60528),terminalGitBash:(0,$.register)("terminal-git-bash",60529),windowActive:(0,$.register)("window-active",60530),forward:(0,$.register)("forward",60531),download:(0,$.register)("download",60532),clockface:(0,$.register)("clockface",60533),unarchive:(0,$.register)("unarchive",60534),sessionInProgress:(0,$.register)("session-in-progress",60535),collectionSmall:(0,$.register)("collection-small",60536),vmSmall:(0,$.register)("vm-small",60537),cloudSmall:(0,$.register)("cloud-small",60538),addSmall:(0,$.register)("add-small",60539),removeSmall:(0,$.register)("remove-small",60540),worktreeSmall:(0,$.register)("worktree-small",60541),worktree:(0,$.register)("worktree",60542),screenCut:(0,$.register)("screen-cut",60543),ask:(0,$.register)("ask",60544),openai:(0,$.register)("openai",60545),claude:(0,$.register)("claude",60546),openInWindow:(0,$.register)("open-in-window",60547),newSession:(0,$.register)("new-session",60548),terminalSecure:(0,$.register)("terminal-secure",60549),chatImport:(0,$.register)("chat-import",60550),chatExport:(0,$.register)("chat-export",60551),shareWindow:(0,$.register)("share-window",60552)}});var I0r=I(k8=>{"use strict";p();Object.defineProperty(k8,"__esModule",{value:!0});k8.Codicon=k8.codiconsDerived=void 0;k8.getAllCodicons=cna;var Gc=T0r(),ana=psi();function cna(){return Object.values(k8.Codicon)}a(cna,"getAllCodicons");k8.codiconsDerived={dialogError:(0,Gc.register)("dialog-error","error"),dialogWarning:(0,Gc.register)("dialog-warning","warning"),dialogInfo:(0,Gc.register)("dialog-info","info"),dialogClose:(0,Gc.register)("dialog-close","close"),treeItemExpanded:(0,Gc.register)("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:(0,Gc.register)("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:(0,Gc.register)("tree-filter-on-type-off","list-selection"),treeFilterClear:(0,Gc.register)("tree-filter-clear","close"),treeItemLoading:(0,Gc.register)("tree-item-loading","loading"),menuSelection:(0,Gc.register)("menu-selection","check"),menuSubmenu:(0,Gc.register)("menu-submenu","chevron-right"),menuBarMore:(0,Gc.register)("menubar-more","more"),scrollbarButtonLeft:(0,Gc.register)("scrollbar-button-left","triangle-left"),scrollbarButtonRight:(0,Gc.register)("scrollbar-button-right","triangle-right"),scrollbarButtonUp:(0,Gc.register)("scrollbar-button-up","triangle-up"),scrollbarButtonDown:(0,Gc.register)("scrollbar-button-down","triangle-down"),toolBarMore:(0,Gc.register)("toolbar-more","more"),quickInputBack:(0,Gc.register)("quick-input-back","arrow-left"),dropDownButton:(0,Gc.register)("drop-down-button",60084),symbolCustomColor:(0,Gc.register)("symbol-customcolor",60252),exportIcon:(0,Gc.register)("export",60332),workspaceUnspecified:(0,Gc.register)("workspace-unspecified",60355),newLine:(0,Gc.register)("newline",60394),thumbsDownFilled:(0,Gc.register)("thumbsdown-filled",60435),thumbsUpFilled:(0,Gc.register)("thumbsup-filled",60436),gitFetch:(0,Gc.register)("git-fetch",60445),lightbulbSparkleAutofix:(0,Gc.register)("lightbulb-sparkle-autofix",60447),debugBreakpointPending:(0,Gc.register)("debug-breakpoint-pending",60377),chatImport:(0,Gc.register)("chat-import",60550),chatExport:(0,Gc.register)("chat-export",60551)};k8.Codicon={...ana.codiconsLibrary,...k8.codiconsDerived}});var R0r=I(vee=>{"use strict";p();Object.defineProperty(vee,"__esModule",{value:!0});vee.ThemeIcon=vee.ThemeColor=void 0;vee.themeColorFromId=lna;var x0r=I0r(),w0r;(function(t){function e(r){return!!r&&typeof r=="object"&&typeof r.id=="string"}a(e,"isThemeColor"),t.isThemeColor=e})(w0r||(vee.ThemeColor=w0r={}));function lna(t){return{id:t}}a(lna,"themeColorFromId");var hsi;(function(t){t.iconNameSegment="[A-Za-z0-9]+",t.iconNameExpression="[A-Za-z0-9-]+",t.iconModifierExpression="~[A-Za-z]+",t.iconNameCharacter="[A-Za-z0-9~-]";let e=new RegExp(`^(${t.iconNameExpression})(${t.iconModifierExpression})?$`);function r(A){let y=e.exec(A.id);if(!y)return r(x0r.Codicon.error);let[,E,_]=y,v=["codicon","codicon-"+E];return _&&v.push("codicon-modifier-"+_.substring(1)),v}a(r,"asClassNameArray"),t.asClassNameArray=r;function n(A){return r(A).join(" ")}a(n,"asClassName"),t.asClassName=n;function o(A){return"."+r(A).join(".")}a(o,"asCSSSelector"),t.asCSSSelector=o;function s(A){return!!A&&typeof A=="object"&&typeof A.id=="string"&&(typeof A.color>"u"||w0r.isThemeColor(A.color))}a(s,"isThemeIcon"),t.isThemeIcon=s;let c=new RegExp(`^\\$\\((${t.iconNameExpression}(?:${t.iconModifierExpression})?)\\)$`);function l(A){let y=c.exec(A);if(!y)return;let[,E]=y;return{id:E}}a(l,"fromString"),t.fromString=l;function u(A){return{id:A}}a(u,"fromId"),t.fromId=u;function d(A,y){let E=A.id,_=E.lastIndexOf("~");return _!==-1&&(E=E.substring(0,_)),y&&(E=`${E}~${y}`),{id:E}}a(d,"modify"),t.modify=d;function f(A){let y=A.id.lastIndexOf("~");if(y!==-1)return A.id.substring(y+1)}a(f,"getModifier"),t.getModifier=f;function h(A,y){return A.id===y.id&&A.color?.id===y.color?.id}a(h,"isEqual"),t.isEqual=h;function m(A){return A?.id===x0r.Codicon.file.id}a(m,"isFile"),t.isFile=m;function g(A){return A?.id===x0r.Codicon.folder.id}a(g,"isFolder"),t.isFolder=g})(hsi||(vee.ThemeIcon=hsi={}))});var vMe=I(ZH=>{"use strict";p();Object.defineProperty(ZH,"__esModule",{value:!0});ZH.Icon=void 0;ZH.overrideNowValue=una;ZH.now=dna;ZH.shortenOpportunityId=fna;ZH.checkIfCursorAtEndOfLine=pna;var P8=R0r(),k0r=-1;function una(t){k0r=t}a(una,"overrideNowValue");function dna(){return k0r!==-1?k0r:Date.now()}a(dna,"now");var msi;(function(t){t.circleSlash={themeIcon:P8.ThemeIcon.fromId("circle-slash"),svg:''},t.error={themeIcon:P8.ThemeIcon.fromId("error"),svg:''},t.skipped={themeIcon:P8.ThemeIcon.fromId("testing-skipped-icon"),svg:''},t.lightbulbFull={themeIcon:P8.ThemeIcon.fromId("refactor-preview-view-icon"),svg:''},t.database={themeIcon:P8.ThemeIcon.fromId("database"),svg:''},t.gitMerge={themeIcon:P8.ThemeIcon.fromId("git-merge"),svg:''},t.loading={themeIcon:P8.ThemeIcon.fromId("loading~spin"),svg:''},t.check={themeIcon:P8.ThemeIcon.fromId("check"),svg:''},t.thumbsdown={themeIcon:P8.ThemeIcon.fromId("thumbsdown"),svg:''}})(msi||(ZH.Icon=msi={}));function fna(t){return t.substring(4,8)}a(fna,"shortenOpportunityId");function pna(t,e){return t.substring(e).match(/^\s*$/)!==null}a(pna,"checkIfCursorAtEndOfLine")});var Zft=I(_4=>{"use strict";p();var hna=_4&&_4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mna=_4&&_4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),gna=_4&&_4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(cpt,"__esModule",{value:!0});cpt.register=Fia;cpt.getCodiconFontCharacters=Uia;var Bia=nT(),Y0r=Object.create(null);function Fia(t,e){if((0,Bia.isString)(e)){let r=Y0r[e];if(r===void 0)throw new Error(`${t} references an unknown codicon: ${e}`);e=r}return Y0r[t]=e,{id:t}}a(Fia,"register");function Uia(){return Y0r}a(Uia,"getCodiconFontCharacters")});var Xsi=I(lpt=>{"use strict";p();Object.defineProperty(lpt,"__esModule",{value:!0});lpt.codiconsLibrary=void 0;var $=K0r();lpt.codiconsLibrary={add:(0,$.register)("add",6e4),plus:(0,$.register)("plus",6e4),gistNew:(0,$.register)("gist-new",6e4),repoCreate:(0,$.register)("repo-create",6e4),lightbulb:(0,$.register)("lightbulb",60001),lightBulb:(0,$.register)("light-bulb",60001),repo:(0,$.register)("repo",60002),repoDelete:(0,$.register)("repo-delete",60002),gistFork:(0,$.register)("gist-fork",60003),repoForked:(0,$.register)("repo-forked",60003),gitPullRequest:(0,$.register)("git-pull-request",60004),gitPullRequestAbandoned:(0,$.register)("git-pull-request-abandoned",60004),recordKeys:(0,$.register)("record-keys",60005),keyboard:(0,$.register)("keyboard",60005),tag:(0,$.register)("tag",60006),gitPullRequestLabel:(0,$.register)("git-pull-request-label",60006),tagAdd:(0,$.register)("tag-add",60006),tagRemove:(0,$.register)("tag-remove",60006),person:(0,$.register)("person",60007),personFollow:(0,$.register)("person-follow",60007),personOutline:(0,$.register)("person-outline",60007),personFilled:(0,$.register)("person-filled",60007),sourceControl:(0,$.register)("source-control",60008),mirror:(0,$.register)("mirror",60009),mirrorPublic:(0,$.register)("mirror-public",60009),star:(0,$.register)("star",60010),starAdd:(0,$.register)("star-add",60010),starDelete:(0,$.register)("star-delete",60010),starEmpty:(0,$.register)("star-empty",60010),comment:(0,$.register)("comment",60011),commentAdd:(0,$.register)("comment-add",60011),alert:(0,$.register)("alert",60012),warning:(0,$.register)("warning",60012),search:(0,$.register)("search",60013),searchSave:(0,$.register)("search-save",60013),logOut:(0,$.register)("log-out",60014),signOut:(0,$.register)("sign-out",60014),logIn:(0,$.register)("log-in",60015),signIn:(0,$.register)("sign-in",60015),eye:(0,$.register)("eye",60016),eyeUnwatch:(0,$.register)("eye-unwatch",60016),eyeWatch:(0,$.register)("eye-watch",60016),circleFilled:(0,$.register)("circle-filled",60017),primitiveDot:(0,$.register)("primitive-dot",60017),closeDirty:(0,$.register)("close-dirty",60017),debugBreakpoint:(0,$.register)("debug-breakpoint",60017),debugBreakpointDisabled:(0,$.register)("debug-breakpoint-disabled",60017),debugHint:(0,$.register)("debug-hint",60017),terminalDecorationSuccess:(0,$.register)("terminal-decoration-success",60017),primitiveSquare:(0,$.register)("primitive-square",60018),edit:(0,$.register)("edit",60019),pencil:(0,$.register)("pencil",60019),info:(0,$.register)("info",60020),issueOpened:(0,$.register)("issue-opened",60020),gistPrivate:(0,$.register)("gist-private",60021),gitForkPrivate:(0,$.register)("git-fork-private",60021),lock:(0,$.register)("lock",60021),mirrorPrivate:(0,$.register)("mirror-private",60021),close:(0,$.register)("close",60022),removeClose:(0,$.register)("remove-close",60022),x:(0,$.register)("x",60022),repoSync:(0,$.register)("repo-sync",60023),sync:(0,$.register)("sync",60023),clone:(0,$.register)("clone",60024),desktopDownload:(0,$.register)("desktop-download",60024),beaker:(0,$.register)("beaker",60025),microscope:(0,$.register)("microscope",60025),vm:(0,$.register)("vm",60026),deviceDesktop:(0,$.register)("device-desktop",60026),file:(0,$.register)("file",60027),more:(0,$.register)("more",60028),ellipsis:(0,$.register)("ellipsis",60028),kebabHorizontal:(0,$.register)("kebab-horizontal",60028),mailReply:(0,$.register)("mail-reply",60029),reply:(0,$.register)("reply",60029),organization:(0,$.register)("organization",60030),organizationFilled:(0,$.register)("organization-filled",60030),organizationOutline:(0,$.register)("organization-outline",60030),newFile:(0,$.register)("new-file",60031),fileAdd:(0,$.register)("file-add",60031),newFolder:(0,$.register)("new-folder",60032),fileDirectoryCreate:(0,$.register)("file-directory-create",60032),trash:(0,$.register)("trash",60033),trashcan:(0,$.register)("trashcan",60033),history:(0,$.register)("history",60034),clock:(0,$.register)("clock",60034),folder:(0,$.register)("folder",60035),fileDirectory:(0,$.register)("file-directory",60035),symbolFolder:(0,$.register)("symbol-folder",60035),logoGithub:(0,$.register)("logo-github",60036),markGithub:(0,$.register)("mark-github",60036),github:(0,$.register)("github",60036),terminal:(0,$.register)("terminal",60037),console:(0,$.register)("console",60037),repl:(0,$.register)("repl",60037),zap:(0,$.register)("zap",60038),symbolEvent:(0,$.register)("symbol-event",60038),error:(0,$.register)("error",60039),stop:(0,$.register)("stop",60039),variable:(0,$.register)("variable",60040),symbolVariable:(0,$.register)("symbol-variable",60040),array:(0,$.register)("array",60042),symbolArray:(0,$.register)("symbol-array",60042),symbolModule:(0,$.register)("symbol-module",60043),symbolPackage:(0,$.register)("symbol-package",60043),symbolNamespace:(0,$.register)("symbol-namespace",60043),symbolObject:(0,$.register)("symbol-object",60043),symbolMethod:(0,$.register)("symbol-method",60044),symbolFunction:(0,$.register)("symbol-function",60044),symbolConstructor:(0,$.register)("symbol-constructor",60044),symbolBoolean:(0,$.register)("symbol-boolean",60047),symbolNull:(0,$.register)("symbol-null",60047),symbolNumeric:(0,$.register)("symbol-numeric",60048),symbolNumber:(0,$.register)("symbol-number",60048),symbolStructure:(0,$.register)("symbol-structure",60049),symbolStruct:(0,$.register)("symbol-struct",60049),symbolParameter:(0,$.register)("symbol-parameter",60050),symbolTypeParameter:(0,$.register)("symbol-type-parameter",60050),symbolKey:(0,$.register)("symbol-key",60051),symbolText:(0,$.register)("symbol-text",60051),symbolReference:(0,$.register)("symbol-reference",60052),goToFile:(0,$.register)("go-to-file",60052),symbolEnum:(0,$.register)("symbol-enum",60053),symbolValue:(0,$.register)("symbol-value",60053),symbolRuler:(0,$.register)("symbol-ruler",60054),symbolUnit:(0,$.register)("symbol-unit",60054),activateBreakpoints:(0,$.register)("activate-breakpoints",60055),archive:(0,$.register)("archive",60056),arrowBoth:(0,$.register)("arrow-both",60057),arrowDown:(0,$.register)("arrow-down",60058),arrowLeft:(0,$.register)("arrow-left",60059),arrowRight:(0,$.register)("arrow-right",60060),arrowSmallDown:(0,$.register)("arrow-small-down",60061),arrowSmallLeft:(0,$.register)("arrow-small-left",60062),arrowSmallRight:(0,$.register)("arrow-small-right",60063),arrowSmallUp:(0,$.register)("arrow-small-up",60064),arrowUp:(0,$.register)("arrow-up",60065),bell:(0,$.register)("bell",60066),bold:(0,$.register)("bold",60067),book:(0,$.register)("book",60068),bookmark:(0,$.register)("bookmark",60069),debugBreakpointConditionalUnverified:(0,$.register)("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:(0,$.register)("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:(0,$.register)("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:(0,$.register)("debug-breakpoint-data-unverified",60072),debugBreakpointData:(0,$.register)("debug-breakpoint-data",60073),debugBreakpointDataDisabled:(0,$.register)("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:(0,$.register)("debug-breakpoint-log-unverified",60074),debugBreakpointLog:(0,$.register)("debug-breakpoint-log",60075),debugBreakpointLogDisabled:(0,$.register)("debug-breakpoint-log-disabled",60075),briefcase:(0,$.register)("briefcase",60076),broadcast:(0,$.register)("broadcast",60077),browser:(0,$.register)("browser",60078),bug:(0,$.register)("bug",60079),calendar:(0,$.register)("calendar",60080),caseSensitive:(0,$.register)("case-sensitive",60081),check:(0,$.register)("check",60082),checklist:(0,$.register)("checklist",60083),chevronDown:(0,$.register)("chevron-down",60084),chevronLeft:(0,$.register)("chevron-left",60085),chevronRight:(0,$.register)("chevron-right",60086),chevronUp:(0,$.register)("chevron-up",60087),chromeClose:(0,$.register)("chrome-close",60088),chromeMaximize:(0,$.register)("chrome-maximize",60089),chromeMinimize:(0,$.register)("chrome-minimize",60090),chromeRestore:(0,$.register)("chrome-restore",60091),circleOutline:(0,$.register)("circle-outline",60092),circle:(0,$.register)("circle",60092),debugBreakpointUnverified:(0,$.register)("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:(0,$.register)("terminal-decoration-incomplete",60092),circleSlash:(0,$.register)("circle-slash",60093),circuitBoard:(0,$.register)("circuit-board",60094),clearAll:(0,$.register)("clear-all",60095),clippy:(0,$.register)("clippy",60096),closeAll:(0,$.register)("close-all",60097),cloudDownload:(0,$.register)("cloud-download",60098),cloudUpload:(0,$.register)("cloud-upload",60099),code:(0,$.register)("code",60100),collapseAll:(0,$.register)("collapse-all",60101),colorMode:(0,$.register)("color-mode",60102),commentDiscussion:(0,$.register)("comment-discussion",60103),creditCard:(0,$.register)("credit-card",60105),dash:(0,$.register)("dash",60108),dashboard:(0,$.register)("dashboard",60109),database:(0,$.register)("database",60110),debugContinue:(0,$.register)("debug-continue",60111),debugDisconnect:(0,$.register)("debug-disconnect",60112),debugPause:(0,$.register)("debug-pause",60113),debugRestart:(0,$.register)("debug-restart",60114),debugStart:(0,$.register)("debug-start",60115),debugStepInto:(0,$.register)("debug-step-into",60116),debugStepOut:(0,$.register)("debug-step-out",60117),debugStepOver:(0,$.register)("debug-step-over",60118),debugStop:(0,$.register)("debug-stop",60119),debug:(0,$.register)("debug",60120),deviceCameraVideo:(0,$.register)("device-camera-video",60121),deviceCamera:(0,$.register)("device-camera",60122),deviceMobile:(0,$.register)("device-mobile",60123),diffAdded:(0,$.register)("diff-added",60124),diffIgnored:(0,$.register)("diff-ignored",60125),diffModified:(0,$.register)("diff-modified",60126),diffRemoved:(0,$.register)("diff-removed",60127),diffRenamed:(0,$.register)("diff-renamed",60128),diff:(0,$.register)("diff",60129),diffSidebyside:(0,$.register)("diff-sidebyside",60129),discard:(0,$.register)("discard",60130),editorLayout:(0,$.register)("editor-layout",60131),emptyWindow:(0,$.register)("empty-window",60132),exclude:(0,$.register)("exclude",60133),extensions:(0,$.register)("extensions",60134),eyeClosed:(0,$.register)("eye-closed",60135),fileBinary:(0,$.register)("file-binary",60136),fileCode:(0,$.register)("file-code",60137),fileMedia:(0,$.register)("file-media",60138),filePdf:(0,$.register)("file-pdf",60139),fileSubmodule:(0,$.register)("file-submodule",60140),fileSymlinkDirectory:(0,$.register)("file-symlink-directory",60141),fileSymlinkFile:(0,$.register)("file-symlink-file",60142),fileZip:(0,$.register)("file-zip",60143),files:(0,$.register)("files",60144),filter:(0,$.register)("filter",60145),flame:(0,$.register)("flame",60146),foldDown:(0,$.register)("fold-down",60147),foldUp:(0,$.register)("fold-up",60148),fold:(0,$.register)("fold",60149),folderActive:(0,$.register)("folder-active",60150),folderOpened:(0,$.register)("folder-opened",60151),gear:(0,$.register)("gear",60152),gift:(0,$.register)("gift",60153),gistSecret:(0,$.register)("gist-secret",60154),gist:(0,$.register)("gist",60155),gitCommit:(0,$.register)("git-commit",60156),gitCompare:(0,$.register)("git-compare",60157),compareChanges:(0,$.register)("compare-changes",60157),gitMerge:(0,$.register)("git-merge",60158),githubAction:(0,$.register)("github-action",60159),githubAlt:(0,$.register)("github-alt",60160),globe:(0,$.register)("globe",60161),grabber:(0,$.register)("grabber",60162),graph:(0,$.register)("graph",60163),gripper:(0,$.register)("gripper",60164),heart:(0,$.register)("heart",60165),home:(0,$.register)("home",60166),horizontalRule:(0,$.register)("horizontal-rule",60167),hubot:(0,$.register)("hubot",60168),inbox:(0,$.register)("inbox",60169),issueReopened:(0,$.register)("issue-reopened",60171),issues:(0,$.register)("issues",60172),italic:(0,$.register)("italic",60173),jersey:(0,$.register)("jersey",60174),json:(0,$.register)("json",60175),bracket:(0,$.register)("bracket",60175),kebabVertical:(0,$.register)("kebab-vertical",60176),key:(0,$.register)("key",60177),law:(0,$.register)("law",60178),lightbulbAutofix:(0,$.register)("lightbulb-autofix",60179),linkExternal:(0,$.register)("link-external",60180),link:(0,$.register)("link",60181),listOrdered:(0,$.register)("list-ordered",60182),listUnordered:(0,$.register)("list-unordered",60183),liveShare:(0,$.register)("live-share",60184),loading:(0,$.register)("loading",60185),location:(0,$.register)("location",60186),mailRead:(0,$.register)("mail-read",60187),mail:(0,$.register)("mail",60188),markdown:(0,$.register)("markdown",60189),megaphone:(0,$.register)("megaphone",60190),mention:(0,$.register)("mention",60191),milestone:(0,$.register)("milestone",60192),gitPullRequestMilestone:(0,$.register)("git-pull-request-milestone",60192),mortarBoard:(0,$.register)("mortar-board",60193),move:(0,$.register)("move",60194),multipleWindows:(0,$.register)("multiple-windows",60195),mute:(0,$.register)("mute",60196),noNewline:(0,$.register)("no-newline",60197),note:(0,$.register)("note",60198),octoface:(0,$.register)("octoface",60199),openPreview:(0,$.register)("open-preview",60200),package:(0,$.register)("package",60201),paintcan:(0,$.register)("paintcan",60202),pin:(0,$.register)("pin",60203),play:(0,$.register)("play",60204),run:(0,$.register)("run",60204),plug:(0,$.register)("plug",60205),preserveCase:(0,$.register)("preserve-case",60206),preview:(0,$.register)("preview",60207),project:(0,$.register)("project",60208),pulse:(0,$.register)("pulse",60209),question:(0,$.register)("question",60210),quote:(0,$.register)("quote",60211),radioTower:(0,$.register)("radio-tower",60212),reactions:(0,$.register)("reactions",60213),references:(0,$.register)("references",60214),refresh:(0,$.register)("refresh",60215),regex:(0,$.register)("regex",60216),remoteExplorer:(0,$.register)("remote-explorer",60217),remote:(0,$.register)("remote",60218),remove:(0,$.register)("remove",60219),replaceAll:(0,$.register)("replace-all",60220),replace:(0,$.register)("replace",60221),repoClone:(0,$.register)("repo-clone",60222),repoForcePush:(0,$.register)("repo-force-push",60223),repoPull:(0,$.register)("repo-pull",60224),repoPush:(0,$.register)("repo-push",60225),report:(0,$.register)("report",60226),requestChanges:(0,$.register)("request-changes",60227),rocket:(0,$.register)("rocket",60228),rootFolderOpened:(0,$.register)("root-folder-opened",60229),rootFolder:(0,$.register)("root-folder",60230),rss:(0,$.register)("rss",60231),ruby:(0,$.register)("ruby",60232),saveAll:(0,$.register)("save-all",60233),saveAs:(0,$.register)("save-as",60234),save:(0,$.register)("save",60235),screenFull:(0,$.register)("screen-full",60236),screenNormal:(0,$.register)("screen-normal",60237),searchStop:(0,$.register)("search-stop",60238),server:(0,$.register)("server",60240),settingsGear:(0,$.register)("settings-gear",60241),settings:(0,$.register)("settings",60242),shield:(0,$.register)("shield",60243),smiley:(0,$.register)("smiley",60244),sortPrecedence:(0,$.register)("sort-precedence",60245),splitHorizontal:(0,$.register)("split-horizontal",60246),splitVertical:(0,$.register)("split-vertical",60247),squirrel:(0,$.register)("squirrel",60248),starFull:(0,$.register)("star-full",60249),starHalf:(0,$.register)("star-half",60250),symbolClass:(0,$.register)("symbol-class",60251),symbolColor:(0,$.register)("symbol-color",60252),symbolConstant:(0,$.register)("symbol-constant",60253),symbolEnumMember:(0,$.register)("symbol-enum-member",60254),symbolField:(0,$.register)("symbol-field",60255),symbolFile:(0,$.register)("symbol-file",60256),symbolInterface:(0,$.register)("symbol-interface",60257),symbolKeyword:(0,$.register)("symbol-keyword",60258),symbolMisc:(0,$.register)("symbol-misc",60259),symbolOperator:(0,$.register)("symbol-operator",60260),symbolProperty:(0,$.register)("symbol-property",60261),wrench:(0,$.register)("wrench",60261),wrenchSubaction:(0,$.register)("wrench-subaction",60261),symbolSnippet:(0,$.register)("symbol-snippet",60262),tasklist:(0,$.register)("tasklist",60263),telescope:(0,$.register)("telescope",60264),textSize:(0,$.register)("text-size",60265),threeBars:(0,$.register)("three-bars",60266),thumbsdown:(0,$.register)("thumbsdown",60267),thumbsup:(0,$.register)("thumbsup",60268),tools:(0,$.register)("tools",60269),triangleDown:(0,$.register)("triangle-down",60270),triangleLeft:(0,$.register)("triangle-left",60271),triangleRight:(0,$.register)("triangle-right",60272),triangleUp:(0,$.register)("triangle-up",60273),twitter:(0,$.register)("twitter",60274),unfold:(0,$.register)("unfold",60275),unlock:(0,$.register)("unlock",60276),unmute:(0,$.register)("unmute",60277),unverified:(0,$.register)("unverified",60278),verified:(0,$.register)("verified",60279),versions:(0,$.register)("versions",60280),vmActive:(0,$.register)("vm-active",60281),vmOutline:(0,$.register)("vm-outline",60282),vmRunning:(0,$.register)("vm-running",60283),watch:(0,$.register)("watch",60284),whitespace:(0,$.register)("whitespace",60285),wholeWord:(0,$.register)("whole-word",60286),window:(0,$.register)("window",60287),wordWrap:(0,$.register)("word-wrap",60288),zoomIn:(0,$.register)("zoom-in",60289),zoomOut:(0,$.register)("zoom-out",60290),listFilter:(0,$.register)("list-filter",60291),listFlat:(0,$.register)("list-flat",60292),listSelection:(0,$.register)("list-selection",60293),selection:(0,$.register)("selection",60293),listTree:(0,$.register)("list-tree",60294),debugBreakpointFunctionUnverified:(0,$.register)("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:(0,$.register)("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:(0,$.register)("debug-breakpoint-function-disabled",60296),debugStackframeActive:(0,$.register)("debug-stackframe-active",60297),circleSmallFilled:(0,$.register)("circle-small-filled",60298),debugStackframeDot:(0,$.register)("debug-stackframe-dot",60298),terminalDecorationMark:(0,$.register)("terminal-decoration-mark",60298),debugStackframe:(0,$.register)("debug-stackframe",60299),debugStackframeFocused:(0,$.register)("debug-stackframe-focused",60299),debugBreakpointUnsupported:(0,$.register)("debug-breakpoint-unsupported",60300),symbolString:(0,$.register)("symbol-string",60301),debugReverseContinue:(0,$.register)("debug-reverse-continue",60302),debugStepBack:(0,$.register)("debug-step-back",60303),debugRestartFrame:(0,$.register)("debug-restart-frame",60304),debugAlt:(0,$.register)("debug-alt",60305),callIncoming:(0,$.register)("call-incoming",60306),callOutgoing:(0,$.register)("call-outgoing",60307),menu:(0,$.register)("menu",60308),expandAll:(0,$.register)("expand-all",60309),feedback:(0,$.register)("feedback",60310),gitPullRequestReviewer:(0,$.register)("git-pull-request-reviewer",60310),groupByRefType:(0,$.register)("group-by-ref-type",60311),ungroupByRefType:(0,$.register)("ungroup-by-ref-type",60312),account:(0,$.register)("account",60313),gitPullRequestAssignee:(0,$.register)("git-pull-request-assignee",60313),bellDot:(0,$.register)("bell-dot",60314),debugConsole:(0,$.register)("debug-console",60315),library:(0,$.register)("library",60316),output:(0,$.register)("output",60317),runAll:(0,$.register)("run-all",60318),syncIgnored:(0,$.register)("sync-ignored",60319),pinned:(0,$.register)("pinned",60320),githubInverted:(0,$.register)("github-inverted",60321),serverProcess:(0,$.register)("server-process",60322),serverEnvironment:(0,$.register)("server-environment",60323),pass:(0,$.register)("pass",60324),issueClosed:(0,$.register)("issue-closed",60324),stopCircle:(0,$.register)("stop-circle",60325),playCircle:(0,$.register)("play-circle",60326),record:(0,$.register)("record",60327),debugAltSmall:(0,$.register)("debug-alt-small",60328),vmConnect:(0,$.register)("vm-connect",60329),cloud:(0,$.register)("cloud",60330),merge:(0,$.register)("merge",60331),export:(0,$.register)("export",60332),graphLeft:(0,$.register)("graph-left",60333),magnet:(0,$.register)("magnet",60334),notebook:(0,$.register)("notebook",60335),redo:(0,$.register)("redo",60336),checkAll:(0,$.register)("check-all",60337),pinnedDirty:(0,$.register)("pinned-dirty",60338),passFilled:(0,$.register)("pass-filled",60339),circleLargeFilled:(0,$.register)("circle-large-filled",60340),circleLarge:(0,$.register)("circle-large",60341),circleLargeOutline:(0,$.register)("circle-large-outline",60341),combine:(0,$.register)("combine",60342),gather:(0,$.register)("gather",60342),table:(0,$.register)("table",60343),variableGroup:(0,$.register)("variable-group",60344),typeHierarchy:(0,$.register)("type-hierarchy",60345),typeHierarchySub:(0,$.register)("type-hierarchy-sub",60346),typeHierarchySuper:(0,$.register)("type-hierarchy-super",60347),gitPullRequestCreate:(0,$.register)("git-pull-request-create",60348),runAbove:(0,$.register)("run-above",60349),runBelow:(0,$.register)("run-below",60350),notebookTemplate:(0,$.register)("notebook-template",60351),debugRerun:(0,$.register)("debug-rerun",60352),workspaceTrusted:(0,$.register)("workspace-trusted",60353),workspaceUntrusted:(0,$.register)("workspace-untrusted",60354),workspaceUnknown:(0,$.register)("workspace-unknown",60355),terminalCmd:(0,$.register)("terminal-cmd",60356),terminalDebian:(0,$.register)("terminal-debian",60357),terminalLinux:(0,$.register)("terminal-linux",60358),terminalPowershell:(0,$.register)("terminal-powershell",60359),terminalTmux:(0,$.register)("terminal-tmux",60360),terminalUbuntu:(0,$.register)("terminal-ubuntu",60361),terminalBash:(0,$.register)("terminal-bash",60362),arrowSwap:(0,$.register)("arrow-swap",60363),copy:(0,$.register)("copy",60364),personAdd:(0,$.register)("person-add",60365),filterFilled:(0,$.register)("filter-filled",60366),wand:(0,$.register)("wand",60367),debugLineByLine:(0,$.register)("debug-line-by-line",60368),inspect:(0,$.register)("inspect",60369),layers:(0,$.register)("layers",60370),layersDot:(0,$.register)("layers-dot",60371),layersActive:(0,$.register)("layers-active",60372),compass:(0,$.register)("compass",60373),compassDot:(0,$.register)("compass-dot",60374),compassActive:(0,$.register)("compass-active",60375),azure:(0,$.register)("azure",60376),issueDraft:(0,$.register)("issue-draft",60377),gitPullRequestClosed:(0,$.register)("git-pull-request-closed",60378),gitPullRequestDraft:(0,$.register)("git-pull-request-draft",60379),debugAll:(0,$.register)("debug-all",60380),debugCoverage:(0,$.register)("debug-coverage",60381),runErrors:(0,$.register)("run-errors",60382),folderLibrary:(0,$.register)("folder-library",60383),debugContinueSmall:(0,$.register)("debug-continue-small",60384),beakerStop:(0,$.register)("beaker-stop",60385),graphLine:(0,$.register)("graph-line",60386),graphScatter:(0,$.register)("graph-scatter",60387),pieChart:(0,$.register)("pie-chart",60388),bracketDot:(0,$.register)("bracket-dot",60389),bracketError:(0,$.register)("bracket-error",60390),lockSmall:(0,$.register)("lock-small",60391),azureDevops:(0,$.register)("azure-devops",60392),verifiedFilled:(0,$.register)("verified-filled",60393),newline:(0,$.register)("newline",60394),layout:(0,$.register)("layout",60395),layoutActivitybarLeft:(0,$.register)("layout-activitybar-left",60396),layoutActivitybarRight:(0,$.register)("layout-activitybar-right",60397),layoutPanelLeft:(0,$.register)("layout-panel-left",60398),layoutPanelCenter:(0,$.register)("layout-panel-center",60399),layoutPanelJustify:(0,$.register)("layout-panel-justify",60400),layoutPanelRight:(0,$.register)("layout-panel-right",60401),layoutPanel:(0,$.register)("layout-panel",60402),layoutSidebarLeft:(0,$.register)("layout-sidebar-left",60403),layoutSidebarRight:(0,$.register)("layout-sidebar-right",60404),layoutStatusbar:(0,$.register)("layout-statusbar",60405),layoutMenubar:(0,$.register)("layout-menubar",60406),layoutCentered:(0,$.register)("layout-centered",60407),target:(0,$.register)("target",60408),indent:(0,$.register)("indent",60409),recordSmall:(0,$.register)("record-small",60410),errorSmall:(0,$.register)("error-small",60411),terminalDecorationError:(0,$.register)("terminal-decoration-error",60411),arrowCircleDown:(0,$.register)("arrow-circle-down",60412),arrowCircleLeft:(0,$.register)("arrow-circle-left",60413),arrowCircleRight:(0,$.register)("arrow-circle-right",60414),arrowCircleUp:(0,$.register)("arrow-circle-up",60415),layoutSidebarRightOff:(0,$.register)("layout-sidebar-right-off",60416),layoutPanelOff:(0,$.register)("layout-panel-off",60417),layoutSidebarLeftOff:(0,$.register)("layout-sidebar-left-off",60418),blank:(0,$.register)("blank",60419),heartFilled:(0,$.register)("heart-filled",60420),map:(0,$.register)("map",60421),mapHorizontal:(0,$.register)("map-horizontal",60421),foldHorizontal:(0,$.register)("fold-horizontal",60421),mapFilled:(0,$.register)("map-filled",60422),mapHorizontalFilled:(0,$.register)("map-horizontal-filled",60422),foldHorizontalFilled:(0,$.register)("fold-horizontal-filled",60422),circleSmall:(0,$.register)("circle-small",60423),bellSlash:(0,$.register)("bell-slash",60424),bellSlashDot:(0,$.register)("bell-slash-dot",60425),commentUnresolved:(0,$.register)("comment-unresolved",60426),gitPullRequestGoToChanges:(0,$.register)("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:(0,$.register)("git-pull-request-new-changes",60428),searchFuzzy:(0,$.register)("search-fuzzy",60429),commentDraft:(0,$.register)("comment-draft",60430),send:(0,$.register)("send",60431),sparkle:(0,$.register)("sparkle",60432),insert:(0,$.register)("insert",60433),mic:(0,$.register)("mic",60434),thumbsdownFilled:(0,$.register)("thumbsdown-filled",60435),thumbsupFilled:(0,$.register)("thumbsup-filled",60436),coffee:(0,$.register)("coffee",60437),snake:(0,$.register)("snake",60438),game:(0,$.register)("game",60439),vr:(0,$.register)("vr",60440),chip:(0,$.register)("chip",60441),piano:(0,$.register)("piano",60442),music:(0,$.register)("music",60443),micFilled:(0,$.register)("mic-filled",60444),repoFetch:(0,$.register)("repo-fetch",60445),copilot:(0,$.register)("copilot",60446),lightbulbSparkle:(0,$.register)("lightbulb-sparkle",60447),robot:(0,$.register)("robot",60448),sparkleFilled:(0,$.register)("sparkle-filled",60449),diffSingle:(0,$.register)("diff-single",60450),diffMultiple:(0,$.register)("diff-multiple",60451),surroundWith:(0,$.register)("surround-with",60452),share:(0,$.register)("share",60453),gitStash:(0,$.register)("git-stash",60454),gitStashApply:(0,$.register)("git-stash-apply",60455),gitStashPop:(0,$.register)("git-stash-pop",60456),vscode:(0,$.register)("vscode",60457),vscodeInsiders:(0,$.register)("vscode-insiders",60458),codeOss:(0,$.register)("code-oss",60459),runCoverage:(0,$.register)("run-coverage",60460),runAllCoverage:(0,$.register)("run-all-coverage",60461),coverage:(0,$.register)("coverage",60462),githubProject:(0,$.register)("github-project",60463),mapVertical:(0,$.register)("map-vertical",60464),foldVertical:(0,$.register)("fold-vertical",60464),mapVerticalFilled:(0,$.register)("map-vertical-filled",60465),foldVerticalFilled:(0,$.register)("fold-vertical-filled",60465),goToSearch:(0,$.register)("go-to-search",60466),percentage:(0,$.register)("percentage",60467),sortPercentage:(0,$.register)("sort-percentage",60467),attach:(0,$.register)("attach",60468),goToEditingSession:(0,$.register)("go-to-editing-session",60469),editSession:(0,$.register)("edit-session",60470),codeReview:(0,$.register)("code-review",60471),copilotWarning:(0,$.register)("copilot-warning",60472),python:(0,$.register)("python",60473),copilotLarge:(0,$.register)("copilot-large",60474),copilotWarningLarge:(0,$.register)("copilot-warning-large",60475),keyboardTab:(0,$.register)("keyboard-tab",60476),copilotBlocked:(0,$.register)("copilot-blocked",60477),copilotNotConnected:(0,$.register)("copilot-not-connected",60478),flag:(0,$.register)("flag",60479),lightbulbEmpty:(0,$.register)("lightbulb-empty",60480),symbolMethodArrow:(0,$.register)("symbol-method-arrow",60481),copilotUnavailable:(0,$.register)("copilot-unavailable",60482),repoPinned:(0,$.register)("repo-pinned",60483),keyboardTabAbove:(0,$.register)("keyboard-tab-above",60484),keyboardTabBelow:(0,$.register)("keyboard-tab-below",60485),gitPullRequestDone:(0,$.register)("git-pull-request-done",60486),mcp:(0,$.register)("mcp",60487),extensionsLarge:(0,$.register)("extensions-large",60488),layoutPanelDock:(0,$.register)("layout-panel-dock",60489),layoutSidebarLeftDock:(0,$.register)("layout-sidebar-left-dock",60490),layoutSidebarRightDock:(0,$.register)("layout-sidebar-right-dock",60491),copilotInProgress:(0,$.register)("copilot-in-progress",60492),copilotError:(0,$.register)("copilot-error",60493),copilotSuccess:(0,$.register)("copilot-success",60494),chatSparkle:(0,$.register)("chat-sparkle",60495),searchSparkle:(0,$.register)("search-sparkle",60496),editSparkle:(0,$.register)("edit-sparkle",60497),copilotSnooze:(0,$.register)("copilot-snooze",60498),sendToRemoteAgent:(0,$.register)("send-to-remote-agent",60499),commentDiscussionSparkle:(0,$.register)("comment-discussion-sparkle",60500),chatSparkleWarning:(0,$.register)("chat-sparkle-warning",60501),chatSparkleError:(0,$.register)("chat-sparkle-error",60502),collection:(0,$.register)("collection",60503),newCollection:(0,$.register)("new-collection",60504),thinking:(0,$.register)("thinking",60505),build:(0,$.register)("build",60506),commentDiscussionQuote:(0,$.register)("comment-discussion-quote",60507),cursor:(0,$.register)("cursor",60508),eraser:(0,$.register)("eraser",60509),fileText:(0,$.register)("file-text",60510),quotes:(0,$.register)("quotes",60512),rename:(0,$.register)("rename",60513),runWithDeps:(0,$.register)("run-with-deps",60514),debugConnected:(0,$.register)("debug-connected",60515),strikethrough:(0,$.register)("strikethrough",60516),openInProduct:(0,$.register)("open-in-product",60517),indexZero:(0,$.register)("index-zero",60518),agent:(0,$.register)("agent",60519),editCode:(0,$.register)("edit-code",60520),repoSelected:(0,$.register)("repo-selected",60521),skip:(0,$.register)("skip",60522),mergeInto:(0,$.register)("merge-into",60523),gitBranchChanges:(0,$.register)("git-branch-changes",60524),gitBranchStagedChanges:(0,$.register)("git-branch-staged-changes",60525),gitBranchConflicts:(0,$.register)("git-branch-conflicts",60526),gitBranch:(0,$.register)("git-branch",60527),gitBranchCreate:(0,$.register)("git-branch-create",60527),gitBranchDelete:(0,$.register)("git-branch-delete",60527),searchLarge:(0,$.register)("search-large",60528),terminalGitBash:(0,$.register)("terminal-git-bash",60529),windowActive:(0,$.register)("window-active",60530),forward:(0,$.register)("forward",60531),download:(0,$.register)("download",60532),clockface:(0,$.register)("clockface",60533),unarchive:(0,$.register)("unarchive",60534),sessionInProgress:(0,$.register)("session-in-progress",60535),collectionSmall:(0,$.register)("collection-small",60536),vmSmall:(0,$.register)("vm-small",60537),cloudSmall:(0,$.register)("cloud-small",60538),addSmall:(0,$.register)("add-small",60539),removeSmall:(0,$.register)("remove-small",60540),worktreeSmall:(0,$.register)("worktree-small",60541),worktree:(0,$.register)("worktree",60542),screenCut:(0,$.register)("screen-cut",60543),ask:(0,$.register)("ask",60544),openai:(0,$.register)("openai",60545),claude:(0,$.register)("claude",60546),openInWindow:(0,$.register)("open-in-window",60547),newSession:(0,$.register)("new-session",60548),terminalSecure:(0,$.register)("terminal-secure",60549),chatImport:(0,$.register)("chat-import",60550),chatExport:(0,$.register)("chat-export",60551),shareWindow:(0,$.register)("share-window",60552)}});var J0r=I(Q8=>{"use strict";p();Object.defineProperty(Q8,"__esModule",{value:!0});Q8.Codicon=Q8.codiconsDerived=void 0;Q8.getAllCodicons=qia;var Vc=K0r(),Qia=Xsi();function qia(){return Object.values(Q8.Codicon)}a(qia,"getAllCodicons");Q8.codiconsDerived={dialogError:(0,Vc.register)("dialog-error","error"),dialogWarning:(0,Vc.register)("dialog-warning","warning"),dialogInfo:(0,Vc.register)("dialog-info","info"),dialogClose:(0,Vc.register)("dialog-close","close"),treeItemExpanded:(0,Vc.register)("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:(0,Vc.register)("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:(0,Vc.register)("tree-filter-on-type-off","list-selection"),treeFilterClear:(0,Vc.register)("tree-filter-clear","close"),treeItemLoading:(0,Vc.register)("tree-item-loading","loading"),menuSelection:(0,Vc.register)("menu-selection","check"),menuSubmenu:(0,Vc.register)("menu-submenu","chevron-right"),menuBarMore:(0,Vc.register)("menubar-more","more"),scrollbarButtonLeft:(0,Vc.register)("scrollbar-button-left","triangle-left"),scrollbarButtonRight:(0,Vc.register)("scrollbar-button-right","triangle-right"),scrollbarButtonUp:(0,Vc.register)("scrollbar-button-up","triangle-up"),scrollbarButtonDown:(0,Vc.register)("scrollbar-button-down","triangle-down"),toolBarMore:(0,Vc.register)("toolbar-more","more"),quickInputBack:(0,Vc.register)("quick-input-back","arrow-left"),dropDownButton:(0,Vc.register)("drop-down-button",60084),symbolCustomColor:(0,Vc.register)("symbol-customcolor",60252),exportIcon:(0,Vc.register)("export",60332),workspaceUnspecified:(0,Vc.register)("workspace-unspecified",60355),newLine:(0,Vc.register)("newline",60394),thumbsDownFilled:(0,Vc.register)("thumbsdown-filled",60435),thumbsUpFilled:(0,Vc.register)("thumbsup-filled",60436),gitFetch:(0,Vc.register)("git-fetch",60445),lightbulbSparkleAutofix:(0,Vc.register)("lightbulb-sparkle-autofix",60447),debugBreakpointPending:(0,Vc.register)("debug-breakpoint-pending",60377),chatImport:(0,Vc.register)("chat-import",60550),chatExport:(0,Vc.register)("chat-export",60551)};Q8.Codicon={...Qia.codiconsLibrary,...Q8.codiconsDerived}});var egr=I(Tee=>{"use strict";p();Object.defineProperty(Tee,"__esModule",{value:!0});Tee.ThemeIcon=Tee.ThemeColor=void 0;Tee.themeColorFromId=jia;var Z0r=J0r(),X0r;(function(t){function e(r){return!!r&&typeof r=="object"&&typeof r.id=="string"}a(e,"isThemeColor"),t.isThemeColor=e})(X0r||(Tee.ThemeColor=X0r={}));function jia(t){return{id:t}}a(jia,"themeColorFromId");var eai;(function(t){t.iconNameSegment="[A-Za-z0-9]+",t.iconNameExpression="[A-Za-z0-9-]+",t.iconModifierExpression="~[A-Za-z]+",t.iconNameCharacter="[A-Za-z0-9~-]";let e=new RegExp(`^(${t.iconNameExpression})(${t.iconModifierExpression})?$`);function r(A){let y=e.exec(A.id);if(!y)return r(Z0r.Codicon.error);let[,E,_]=y,v=["codicon","codicon-"+E];return _&&v.push("codicon-modifier-"+_.substring(1)),v}a(r,"asClassNameArray"),t.asClassNameArray=r;function n(A){return r(A).join(" ")}a(n,"asClassName"),t.asClassName=n;function o(A){return"."+r(A).join(".")}a(o,"asCSSSelector"),t.asCSSSelector=o;function s(A){return!!A&&typeof A=="object"&&typeof A.id=="string"&&(typeof A.color>"u"||X0r.isThemeColor(A.color))}a(s,"isThemeIcon"),t.isThemeIcon=s;let c=new RegExp(`^\\$\\((${t.iconNameExpression}(?:${t.iconModifierExpression})?)\\)$`);function l(A){let y=c.exec(A);if(!y)return;let[,E]=y;return{id:E}}a(l,"fromString"),t.fromString=l;function u(A){return{id:A}}a(u,"fromId"),t.fromId=u;function d(A,y){let E=A.id,_=E.lastIndexOf("~");return _!==-1&&(E=E.substring(0,_)),y&&(E=`${E}~${y}`),{id:E}}a(d,"modify"),t.modify=d;function f(A){let y=A.id.lastIndexOf("~");if(y!==-1)return A.id.substring(y+1)}a(f,"getModifier"),t.getModifier=f;function h(A,y){return A.id===y.id&&A.color?.id===y.color?.id}a(h,"isEqual"),t.isEqual=h;function m(A){return A?.id===Z0r.Codicon.file.id}a(m,"isFile"),t.isFile=m;function g(A){return A?.id===Z0r.Codicon.folder.id}a(g,"isFolder"),t.isFolder=g})(eai||(Tee.ThemeIcon=eai={}))});var OMe=I(lG=>{"use strict";p();Object.defineProperty(lG,"__esModule",{value:!0});lG.Icon=void 0;lG.overrideNowValue=Hia;lG.now=Gia;lG.shortenOpportunityId=$ia;lG.checkIfCursorAtEndOfLine=Via;var q8=egr(),tgr=-1;function Hia(t){tgr=t}a(Hia,"overrideNowValue");function Gia(){return tgr!==-1?tgr:Date.now()}a(Gia,"now");var tai;(function(t){t.circleSlash={themeIcon:q8.ThemeIcon.fromId("circle-slash"),svg:''},t.error={themeIcon:q8.ThemeIcon.fromId("error"),svg:''},t.skipped={themeIcon:q8.ThemeIcon.fromId("testing-skipped-icon"),svg:''},t.lightbulbFull={themeIcon:q8.ThemeIcon.fromId("refactor-preview-view-icon"),svg:''},t.database={themeIcon:q8.ThemeIcon.fromId("database"),svg:''},t.gitMerge={themeIcon:q8.ThemeIcon.fromId("git-merge"),svg:''},t.loading={themeIcon:q8.ThemeIcon.fromId("loading~spin"),svg:''},t.check={themeIcon:q8.ThemeIcon.fromId("check"),svg:''},t.thumbsdown={themeIcon:q8.ThemeIcon.fromId("thumbsdown"),svg:''}})(tai||(lG.Icon=tai={}));function $ia(t){return t.substring(4,8)}a($ia,"shortenOpportunityId");function Via(t,e){return t.substring(e).match(/^\s*$/)!==null}a(Via,"checkIfCursorAtEndOfLine")});var dpt=I(C4=>{"use strict";p();var Wia=C4&&C4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zia=C4&&C4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Yia=C4&&C4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oExplanation for icons -`),e.push(`- ${PE.Icon.lightbulbFull.svg} - model had suggestions -`),e.push(`- ${PE.Icon.circleSlash.svg} - model had NO suggestions -`),e.push(`- ${PE.Icon.database.svg} - response is from cache -`),e.push(`- ${PE.Icon.gitMerge.svg} - joined an in-flight request (async or speculative reuse) -`),e.push(`- ${PE.Icon.error.svg} - error happened -`),e.push(`- ${PE.Icon.skipped.svg} - fetching started but got cancelled +`),e.push(`- ${OE.Icon.lightbulbFull.svg} - model had suggestions +`),e.push(`- ${OE.Icon.circleSlash.svg} - model had NO suggestions +`),e.push(`- ${OE.Icon.database.svg} - response is from cache +`),e.push(`- ${OE.Icon.gitMerge.svg} - joined an in-flight request (async or speculative reuse) +`),e.push(`- ${OE.Icon.error.svg} - error happened +`),e.push(`- ${OE.Icon.skipped.svg} - fetching started but got cancelled `),e.push(` `),e.push(`Inline Edit Provider: ${this._statelessNextEditProviderId??""} `),e.push("Chat Endpoint"),e.push("```"),e.push(`Model name: ${this._endpointInfo?.modelName??""}`),e.push(`URL: ${this._endpointInfo?.url??""}`),e.push("```");let r=this._logContextOfCachedEdit?`(cached #${this._logContextOfCachedEdit.requestId})`:"(not cached)";if(e.push(`Opportunity ID: ${this._context?this._context.requestUuid:""}`),this.headerRequestId&&(e.push(""),e.push(`Header Request ID: ${this.headerRequestId} ${r}`)),this._nextEditRequest&&(e.push(`## Latest user edits ${r}`),e.push(`
Edit @@ -510,11 +510,11 @@ ${n.text} `);let n=this.prompt;e.push("````"),e.push(...n.split(` `)),e.push("````"),e.push(`
-`)}return this.error&&(e.push(`## Error ${r}`),e.push("```"),e.push(Jft.ErrorUtils.toString(Jft.ErrorUtils.fromUnknown(this.error))),e.push("```")),this.response&&(e.push(`## Response ${r}`),e.push(`
Click to view +`)}return this.error&&(e.push(`## Error ${r}`),e.push("```"),e.push(upt.ErrorUtils.toString(upt.ErrorUtils.fromUnknown(this.error))),e.push("```")),this.response&&(e.push(`## Response ${r}`),e.push(`
Click to view `),e.push("````"),e.push(this.response),e.push("````"),e.push(`
`)),this._responseResults&&(e.push(`## Response Results ${r}`),e.push(`
Click to view -`),e.push("```"),e.push(gsi.stringify(this._responseResults,null," ")),e.push("```"),e.push(` +`),e.push("```"),e.push(rai.stringify(this._responseResults,null," ")),e.push("```"),e.push(`
`)),this._isAccepted!==void 0&&e.push(`## Accepted : ${this._isAccepted?"Yes":"No"}`),this._rebaseFailure&&(e.push("## Rebase Failure"),e.push(`
Click to view `),e.push(this._rebaseFailure.toMarkdown()),e.push(` @@ -526,8 +526,8 @@ ${n.text} `),e.push("```"),e.push(...this._trace),e.push("```"),e.push(`
`)),e.join(` -`)}toMinimalLog(){let e=[];return this._nesTypePicked==="diagnostics"&&this._diagnosticsResultEdit?(e.push("## Result (Diagnostics):"),e.push("``` patch"),e.push(this._diagnosticsResultEdit.toString()),e.push("```")):this._nesTypePicked==="llm"&&this._resultEdit?(e.push("## Result:"),e.push("``` patch"),typeof this._resultEdit=="string"?e.push(this._resultEdit):e.push(this._resultEdit.toString()),e.push("```")):e.push("## Result: "),this.error&&(e.push("## Error:"),e.push("```"),e.push(Jft.ErrorUtils.toString(Jft.ErrorUtils.fromUnknown(this.error))),e.push("```")),e.push("### Info:"),e.push(`**From cache:** ${this._logContextOfCachedEdit?`YES (Request: ${this._logContextOfCachedEdit.requestId})`:"NO"}`),this._context&&(e.push(`**Trigger Kind:** ${this._context.triggerKind===0?"Manual":"Automatic"}`),e.push(`**Request UUID:** ${this._context.requestUuid}`)),e.join(` -`)}setStatelessNextEditProviderId(e){this._statelessNextEditProviderId=e}setRequestInput(e){this._isVisible=!0,this._nextEditRequest=e,this.fireDidChange()}setResult(e){this._isVisible=!0,this._resultEdit=e,this.fireDidChange()}setDiagnosticsResult(e){this._isVisible=!0,this._diagnosticsResultEdit=e,this.fireDidChange()}setPickedNESType(e){return this._nesTypePicked=e,this}setIsCachedResult(e){this._logContextOfCachedEdit=e,this.recordingBookmark=e.recordingBookmark,this._nextEditRequest=e._nextEditRequest??this._nextEditRequest,this._resultEdit=e._resultEdit??this._resultEdit,this._diagnosticsResultEdit=e._diagnosticsResultEdit??this._diagnosticsResultEdit,this._endpointInfo=e._endpointInfo??this._endpointInfo,this._headerRequestId=e._headerRequestId??this._headerRequestId,e._prompt&&(this._prompt=e._prompt),this.response=e.response??this.response,this._responseResults=e._responseResults??this._responseResults,e.fullResponsePromise&&this.setFullResponse(e.fullResponsePromise),this._error=e._error??this._error,this._isVisible=!0,this._outcome="cached",this.fireDidChange()}setIsReusedInFlightResult(e){this._logContextOfCachedEdit=e,this.recordingBookmark=e.recordingBookmark,this._nextEditRequest=e._nextEditRequest??this._nextEditRequest,this._resultEdit=e._resultEdit??this._resultEdit,this._diagnosticsResultEdit=e._diagnosticsResultEdit??this._diagnosticsResultEdit,this._endpointInfo=e._endpointInfo??this._endpointInfo,this._headerRequestId=e._headerRequestId??this._headerRequestId,e._prompt&&(this._prompt=e._prompt),this.response=e.response??this.response,this._responseResults=e._responseResults??this._responseResults,e.fullResponsePromise&&this.setFullResponse(e.fullResponsePromise),this._error=e._error??this._error,this._isVisible=!0,this._outcome="reusedInFlight",this.fireDidChange()}setEndpointInfo(e,r){this._endpointInfo={url:e,modelName:r},this.fireDidChange()}get endpointInfo(){return this._endpointInfo}setHeaderRequestId(e){this._headerRequestId=e,this.fireDidChange()}get headerRequestId(){return this._headerRequestId}get prompt(){return this._prompt}get rawMessages(){return this._rawMessages}setPrompt(e){this._isVisible=!0,typeof e=="string"?this._prompt=e:(this._rawMessages=e,this._prompt=(0,vna.stringifyChatMessages)(e)),this.fireDidChange()}get cursorJumpRawMessages(){return this._cursorJumpRawMessages}get cursorJumpKeptRange(){return this._cursorJumpKeptRange}setCursorJumpPrompt(e,r){this._cursorJumpRawMessages=e,this._cursorJumpKeptRange=r,this.fireDidChange()}_setOutcome(e){this._outcome!=="pending"&&this._outcome!=="reusedInFlight"&&console.warn(`[InlineEditRequestLogContext] outcome transition from '${this._outcome}' to '${e}' (request #${this.requestId})`),this._outcome=e}_resolveIcon(){switch(this._outcome){case"pending":return this._isCompleted?PE.Icon.check:PE.Icon.loading;case"succeeded":return PE.Icon.lightbulbFull;case"noSuggestions":return PE.Icon.circleSlash;case"cached":case"cachedFromGhostText":return PE.Icon.database;case"reusedInFlight":return PE.Icon.gitMerge;case"skipped":case"cancelled":return PE.Icon.skipped;case"errored":return PE.Icon.error;case"previouslyRejected":return PE.Icon.thumbsdown}}getIcon(){return this._resolveIcon().themeIcon}setIsSkipped(){this._setOutcome("skipped"),this._isVisible=!1,this.fireDidChange()}markAsFromCache(){this._setOutcome("cachedFromGhostText"),this._isVisible=!0,this.fireDidChange()}markAsNoSuggestions(){this._setOutcome("noSuggestions"),this._isVisible=!0,this.fireDidChange()}markAsPreviouslyRejected(){this._outcome="previouslyRejected",this._isVisible=!0,this.fireDidChange()}get error(){return this._error}setError(e){this._isVisible=!0,this._error=e,this._error instanceof Ena.FetchCancellationError?this._setOutcome("skipped"):(0,Ana.isCancellationError)(this._error)?(this._setOutcome("cancelled"),this._isVisible=!1):this._setOutcome("errored"),this.fireDidChange()}setResponse(e){this._isVisible=!0,this.response=e,this.fireDidChange()}setFullResponse(e){this.fullResponsePromise=e,e.then(r=>this.fullResponse=r)}async allPromisesResolved(){await this.fullResponsePromise}setProviderStartTime(){this.providerStartTime=Date.now(),this.fireDidChange()}setProviderEndTime(){this.providerEndTime=Date.now(),this.fireDidChange()}setFetchStartTime(){this.fetchStartTime=Date.now(),this.fireDidChange()}setFetchEndTime(){this.fetchEndTime=Date.now(),this.fireDidChange()}get responseResults(){return this._responseResults}setResponseResults(e){this._isVisible=!0,this._responseResults=e,this._outcome==="pending"&&(this._outcome="succeeded"),this.fireDidChange()}getDebugName(){return`NES | ${Cna(this.filePath)} (v${this.version})`}getMarkdownTitle(){return`${this._resolveIcon().svg} `+this.getDebugName()}setRecentEdit(e){this._recentEdit=e}trace(e){this._trace.push(e),this.fireDidChange()}_renderTraceDiagram(){if(this._trace.length===0)return[];let e=[];e.push("## Trace Diagram"),e.push(`
Trace Diagram +`)}toMinimalLog(){let e=[];return this._nesTypePicked==="diagnostics"&&this._diagnosticsResultEdit?(e.push("## Result (Diagnostics):"),e.push("``` patch"),e.push(this._diagnosticsResultEdit.toString()),e.push("```")):this._nesTypePicked==="llm"&&this._resultEdit?(e.push("## Result:"),e.push("``` patch"),typeof this._resultEdit=="string"?e.push(this._resultEdit):e.push(this._resultEdit.toString()),e.push("```")):e.push("## Result: "),this.error&&(e.push("## Error:"),e.push("```"),e.push(upt.ErrorUtils.toString(upt.ErrorUtils.fromUnknown(this.error))),e.push("```")),e.push("### Info:"),e.push(`**From cache:** ${this._logContextOfCachedEdit?`YES (Request: ${this._logContextOfCachedEdit.requestId})`:"NO"}`),this._context&&(e.push(`**Trigger Kind:** ${this._context.triggerKind===0?"Manual":"Automatic"}`),e.push(`**Request UUID:** ${this._context.requestUuid}`)),e.join(` +`)}setStatelessNextEditProviderId(e){this._statelessNextEditProviderId=e}setRequestInput(e){this._isVisible=!0,this._nextEditRequest=e,this.fireDidChange()}setResult(e){this._isVisible=!0,this._resultEdit=e,this.fireDidChange()}setDiagnosticsResult(e){this._isVisible=!0,this._diagnosticsResultEdit=e,this.fireDidChange()}setPickedNESType(e){return this._nesTypePicked=e,this}setIsCachedResult(e){this._logContextOfCachedEdit=e,this.recordingBookmark=e.recordingBookmark,this._nextEditRequest=e._nextEditRequest??this._nextEditRequest,this._resultEdit=e._resultEdit??this._resultEdit,this._diagnosticsResultEdit=e._diagnosticsResultEdit??this._diagnosticsResultEdit,this._endpointInfo=e._endpointInfo??this._endpointInfo,this._headerRequestId=e._headerRequestId??this._headerRequestId,e._prompt&&(this._prompt=e._prompt),this.response=e.response??this.response,this._responseResults=e._responseResults??this._responseResults,e.fullResponsePromise&&this.setFullResponse(e.fullResponsePromise),this._error=e._error??this._error,this._isVisible=!0,this._outcome="cached",this.fireDidChange()}setIsReusedInFlightResult(e){this._logContextOfCachedEdit=e,this.recordingBookmark=e.recordingBookmark,this._nextEditRequest=e._nextEditRequest??this._nextEditRequest,this._resultEdit=e._resultEdit??this._resultEdit,this._diagnosticsResultEdit=e._diagnosticsResultEdit??this._diagnosticsResultEdit,this._endpointInfo=e._endpointInfo??this._endpointInfo,this._headerRequestId=e._headerRequestId??this._headerRequestId,e._prompt&&(this._prompt=e._prompt),this.response=e.response??this.response,this._responseResults=e._responseResults??this._responseResults,e.fullResponsePromise&&this.setFullResponse(e.fullResponsePromise),this._error=e._error??this._error,this._isVisible=!0,this._outcome="reusedInFlight",this.fireDidChange()}setEndpointInfo(e,r){this._endpointInfo={url:e,modelName:r},this.fireDidChange()}get endpointInfo(){return this._endpointInfo}setHeaderRequestId(e){this._headerRequestId=e,this.fireDidChange()}get headerRequestId(){return this._headerRequestId}get prompt(){return this._prompt}get rawMessages(){return this._rawMessages}setPrompt(e){this._isVisible=!0,typeof e=="string"?this._prompt=e:(this._rawMessages=e,this._prompt=(0,eoa.stringifyChatMessages)(e)),this.fireDidChange()}get cursorJumpRawMessages(){return this._cursorJumpRawMessages}get cursorJumpKeptRange(){return this._cursorJumpKeptRange}setCursorJumpPrompt(e,r){this._cursorJumpRawMessages=e,this._cursorJumpKeptRange=r,this.fireDidChange()}_setOutcome(e){this._outcome!=="pending"&&this._outcome!=="reusedInFlight"&&console.warn(`[InlineEditRequestLogContext] outcome transition from '${this._outcome}' to '${e}' (request #${this.requestId})`),this._outcome=e}_resolveIcon(){switch(this._outcome){case"pending":return this._isCompleted?OE.Icon.check:OE.Icon.loading;case"succeeded":return OE.Icon.lightbulbFull;case"noSuggestions":return OE.Icon.circleSlash;case"cached":case"cachedFromGhostText":return OE.Icon.database;case"reusedInFlight":return OE.Icon.gitMerge;case"skipped":case"cancelled":return OE.Icon.skipped;case"errored":return OE.Icon.error;case"previouslyRejected":return OE.Icon.thumbsdown}}getIcon(){return this._resolveIcon().themeIcon}setIsSkipped(){this._setOutcome("skipped"),this._isVisible=!1,this.fireDidChange()}markAsFromCache(){this._setOutcome("cachedFromGhostText"),this._isVisible=!0,this.fireDidChange()}markAsNoSuggestions(){this._setOutcome("noSuggestions"),this._isVisible=!0,this.fireDidChange()}markAsPreviouslyRejected(){this._outcome="previouslyRejected",this._isVisible=!0,this.fireDidChange()}get error(){return this._error}setError(e){this._isVisible=!0,this._error=e,this._error instanceof Zia.FetchCancellationError?this._setOutcome("skipped"):(0,Kia.isCancellationError)(this._error)?(this._setOutcome("cancelled"),this._isVisible=!1):this._setOutcome("errored"),this.fireDidChange()}setResponse(e){this._isVisible=!0,this.response=e,this.fireDidChange()}setFullResponse(e){this.fullResponsePromise=e,e.then(r=>this.fullResponse=r)}async allPromisesResolved(){await this.fullResponsePromise}setProviderStartTime(){this.providerStartTime=Date.now(),this.fireDidChange()}setProviderEndTime(){this.providerEndTime=Date.now(),this.fireDidChange()}setFetchStartTime(){this.fetchStartTime=Date.now(),this.fireDidChange()}setFetchEndTime(){this.fetchEndTime=Date.now(),this.fireDidChange()}get responseResults(){return this._responseResults}setResponseResults(e){this._isVisible=!0,this._responseResults=e,this._outcome==="pending"&&(this._outcome="succeeded"),this.fireDidChange()}getDebugName(){return`NES | ${toa(this.filePath)} (v${this.version})`}getMarkdownTitle(){return`${this._resolveIcon().svg} `+this.getDebugName()}setRecentEdit(e){this._recentEdit=e}trace(e){this._trace.push(e),this.fireDidChange()}_renderTraceDiagram(){if(this._trace.length===0)return[];let e=[];e.push("## Trace Diagram"),e.push(`
Trace Diagram `),e.push("```");let r=this._trace.map(d=>{let f=d.match(/^\[\s*(\d+)ms\]/),h=f?parseInt(f[1],10):0,m=d.replace(/^\[\s*\d+ms\]\s*/,""),g=[],A=m,y;for(;y=A.match(/^\[([^\]]+)\]/);)g.push(y[1]),A=A.slice(y[0].length);let E=A.trim();return{timestamp:h,segments:g,message:E}});if(r.length===0)return e.push("(no trace data)"),e.push("```"),e.push(`
`),e;let n=Math.max(...r.map(d=>d.timestamp)),o=Math.max(6,String(n).length+3),s=new Map,c=[];r.forEach((d,f)=>{let h=d.segments.join("|");for(let[g,A]of s)!h.startsWith(g)&&h!==g&&(c.push({path:g,startTime:A.startTime,endTime:d.timestamp,depth:A.depth,name:g.split("|").pop()||""}),s.delete(g));let m="";d.segments.forEach((g,A)=>{m=m?`${m}|${g}`:g,s.has(m)||s.set(m,{startTime:d.timestamp,depth:A})})});let l=r[r.length-1]?.timestamp||0;for(let[d,f]of s)c.push({path:d,startTime:f.startTime,endTime:l,depth:f.depth,name:d.split("|").pop()||""});e.push(""),e.push("Timeline (nested call hierarchy):"),e.push("\u2500".repeat(60));let u=[];for(let d of r){let f=`[${String(d.timestamp).padStart(o-3)}ms]`,h="\u2502 ",m="\u251C\u2500\u2500 ",g="",A="",y=!1;for(let E=0;Ethis.addLog(`- ${r}`))}addCodeblockToLog(e,r=""){this._logs.push(`\`\`\`${r} ${e} \`\`\` -`)}setDiagnosticsData(e){this._fileDiagnostics=e}setTerminalData(e){this._terminalOutput=e}setLanguageContext(e){this._languageContext=e}toJSON(){return{requestId:this.requestId,time:this.time,filePath:this.filePath,version:this.version,statelessNextEditProviderId:this._statelessNextEditProviderId,nextEditRequest:this._nextEditRequest?.serialize(),diagnosticsResultEdit:this._diagnosticsResultEdit?.toString(),resultEdit:this._resultEdit?.toString(),isCachedResult:!!this._logContextOfCachedEdit,prompt:this.prompt,error:String(this.error),response:this.fullResponse,responseResults:gsi.stringify(this._responseResults,null," "),providerStartTime:this.providerStartTime,providerEndTime:this.providerEndTime,fetchStartTime:this.fetchStartTime,fetchEndTime:this.fetchEndTime,logs:this._logs,isAccepted:this._isAccepted,languageContext:this._languageContext?(0,_na.serializeLanguageContext)(this._languageContext):void 0,diagnostics:this._fileDiagnostics,terminalOutput:this._terminalOutput}}};_4.InlineEditRequestLogContext=P0r;function Cna(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?t:t.slice(e+1)}a(Cna,"basename")});var Asi=I(Xft=>{"use strict";p();Object.defineProperty(Xft,"__esModule",{value:!0});Xft.GhostTextLogContext=void 0;var bna=Zft(),Sna=NA(),D0r=class extends bna.InlineEditRequestLogContext{static{a(this,"GhostTextLogContext")}getDebugName(){return`Ghost | ${(0,Sna.basename)(this.filePath)} (v${this.version})`}};Xft.GhostTextLogContext=D0r});var XH=I(Yme=>{"use strict";p();Object.defineProperty(Yme,"__esModule",{value:!0});Yme.CopilotTokenStore=Yme.ICopilotTokenStore=void 0;var Tna=nn(),Ina=Ic(),xna=Ro();Yme.ICopilotTokenStore=(0,Tna.createServiceIdentifier)("ICopilotTokenStore");var N0r=class extends xna.Disposable{static{a(this,"CopilotTokenStore")}constructor(){super(...arguments),this._onDidStoreUpdate=this._register(new Ina.Emitter),this.onDidStoreUpdate=this._onDidStoreUpdate.event}get copilotToken(){return this._copilotToken}set copilotToken(e){let r=this._copilotToken?.token;this._copilotToken=e,r!==e?.token&&this._onDidStoreUpdate.fire()}};Yme.CopilotTokenStore=N0r});var gm=I(sy=>{"use strict";p();var wna=sy&&sy.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Rna=sy&&sy.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(sy,"__esModule",{value:!0});sy.TelemetryTrustedValue=sy.ITelemetryService=sy.TelemetryUserConfigImpl=sy.ITelemetryUserConfig=void 0;sy.createTrackingIdGetter=Pna;sy.multiplexProperties=Nna;var ysi=nn(),kna=XH();sy.ITelemetryUserConfig=(0,ysi.createServiceIdentifier)("ITelemetryUserConfig");var M0r=class{static{a(this,"TelemetryUserConfigImpl")}constructor(e,r,n){this._tokenStore=n,this.trackingId=e,this.optedIn=r??!1,this.updateFromToken(this._tokenStore.copilotToken),this._tokenStore.onDidStoreUpdate(()=>{this.updateFromToken(this._tokenStore.copilotToken)})}updateFromToken(e){if(!e)return;let r=e.getTokenValue("rt")==="1",n=e.getTokenValue("tid");n!==void 0&&(this.trackingId=n,this.organizationsList=e.organizationList.toString(),this.enterpriseList=e.enterpriseList.toString(),this.optedIn=r)}};sy.TelemetryUserConfigImpl=M0r;sy.TelemetryUserConfigImpl=M0r=wna([Rna(2,kna.ICopilotTokenStore)],M0r);function Pna(t){let e=t.copilotToken?.getTokenValue("tid");return t.onDidStoreUpdate(()=>{let r=t.copilotToken?.getTokenValue("tid");r&&(e=r)}),()=>e}a(Pna,"createTrackingIdGetter");sy.ITelemetryService=(0,ysi.createServiceIdentifier)("ITelemetryService");var O0r=class{static{a(this,"TelemetryTrustedValue")}constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};sy.TelemetryTrustedValue=O0r;var CMe=8192,Dna=50;function Nna(t){let e={...t};for(let r in t){let n=t[r],o=n?.length??0;if(o>CMe){let s=0,c=0;for(;o>0&&c1&&(l=r+"_"+(c<10?"0":"")+c);let u=s+CMe;o{"use strict";p();var Mna=jo&&jo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ona=jo&&jo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Lna=jo&&jo.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Mna(e,t,r);return Ona(e,t),e},L0r=jo&&jo.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},B0r=jo&&jo.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var Q0r=bee&&bee.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},q0r=bee&&bee.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]this.maxSizeBytes?[4,this._createBackupFile(r)]:[3,14];case 13:return u.sent(),[3,16];case 14:return[4,v4.appendFileAsync(this._fileFullPath,r)];case 15:u.sent(),u.label=16;case 16:return[3,18];case 17:return l=u.sent(),console.log(this.TAG,"Failed to create backup file: "+(l&&l.message)),[3,18];case 18:return[2]}})})},t.prototype._createBackupFile=function(e){return Q0r(this,void 0,void 0,function(){var r,n,o;return q0r(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),[4,v4.readFileAsync(this._fileFullPath)];case 1:return r=s.sent(),n=Cee.join(this._tempDir,new Date().getTime()+"."+this._logFileName),[4,v4.writeFileAsync(n,r)];case 2:return s.sent(),[3,5];case 3:return o=s.sent(),console.log("Failed to generate backup log file",o),[3,5];case 4:return v4.writeFileAsync(this._fileFullPath,e),[7];case 5:return[2]}})})},t.prototype._fileCleanupTask=function(){return Q0r(this,void 0,void 0,function(){var e,r,n,o,s,c=this;return q0r(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,v4.readdirAsync(this._tempDir)];case 1:e=l.sent(),e=e.filter(function(u){return Cee.basename(u).indexOf(c._backUpNameFormat)>-1}),e.sort(function(u,d){var f=new Date(parseInt(u.split(c._backUpNameFormat)[0])),h=new Date(parseInt(d.split(c._backUpNameFormat)[0]));if(f=h)return 1}),r=e.length,n=0,l.label=2;case 2:return n{"use strict";p();var bsi=Csi(),Gna="APPLICATION_INSIGHTS_ENABLE_DEBUG_LOGS",$na="APPLICATION_INSIGHTS_DISABLE_WARNING_LOGS",Vna=(function(){function t(){}return a(t,"Logging"),t.info=function(e){for(var r=[],n=1;n{Wna.exports={}});var tpt=I(Kme=>{"use strict";p();var zna=Kme&&Kme.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Kme,"__esModule",{value:!0});Kme.JsonConfig=void 0;var Yna=require("fs"),ept=require("path"),j0r=Kl(),Kna=zna(Tsi()),Jna="APPLICATIONINSIGHTS_CONFIGURATION_FILE",Zna="APPLICATIONINSIGHTS_CONNECTION_STRING",Isi="APPSETTING_",xsi="APPINSIGHTS_INSTRUMENTATIONKEY",wsi="APPINSIGHTS_INSTRUMENTATION_KEY",Xna="APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC",eia="APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS",tia="http_proxy",ria="https_proxy",nia="APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL",iia="APPLICATION_INSIGHTS_NO_STATSBEAT",oia="APPLICATION_INSIGHTS_NO_HTTP_AGENT_KEEP_ALIVE",sia="APPLICATION_INSIGHTS_NO_PATCH_MODULES",aia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_ENABLED",cia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_CONNECTION_STRING",lia="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_SOURCE",uia="APPLICATIONINSIGHTS_WEB_SNIPPET_ENABLED",dia="APPLICATIONINSIGHTS_WEB_SNIPPET_CONNECTION_STRING",fia=(function(){function t(){this.connectionString=process.env[Zna],this.instrumentationKey=process.env[xsi]||process.env[Isi+xsi]||process.env[wsi]||process.env[Isi+wsi],!this.connectionString&&this.instrumentationKey&&j0r.warn("APPINSIGHTS_INSTRUMENTATIONKEY is in path of deprecation, please use APPLICATIONINSIGHTS_CONNECTION_STRING env variable to setup the SDK."),this.disableAllExtendedMetrics=!!process.env[eia],this.extendedMetricDisablers=process.env[Xna],this.proxyHttpUrl=process.env[tia],this.proxyHttpsUrl=process.env[ria],this.noDiagnosticChannel=!!process.env[nia],this.disableStatsbeat=!!process.env[iia],this.noHttpAgentKeepAlive=!!process.env[oia],this.noPatchModules=process.env[sia]||"",this.enableWebInstrumentation=!!process.env[aia]||!!process.env[uia],this.webInstrumentationSrc=process.env[lia]||"",this.webInstrumentationConnectionString=process.env[cia]||process.env[dia]||"",this.enableAutoWebSnippetInjection=this.enableWebInstrumentation,this.webSnippetConnectionString=this.webInstrumentationConnectionString,this._loadJsonFile()}return a(t,"JsonConfig"),t.getInstance=function(){return t._instance||(t._instance=new t),t._instance},t.prototype._loadJsonFile=function(){var e="",r=process.env.APPLICATIONINSIGHTS_CONFIGURATION_CONTENT;if(r)e=r;else{var n="applicationinsights.json",o=ept.join(__dirname,"../../");this._tempDir=ept.join(o,n);var s=process.env[Jna];if(s){ept.isAbsolute(s)?this._tempDir=s:this._tempDir=ept.join(o,s);try{e=Yna.readFileSync(this._tempDir,"utf8")}catch(l){j0r.warn("Failed to read JSON config file: ",l)}}else e=JSON.stringify(Kna.default)}try{var c=JSON.parse(e);c.disableStatsbeat!=null&&(this.disableStatsbeat=c.disableStatsbeat),c.disableAllExtendedMetrics!=null&&(this.disableAllExtendedMetrics=c.disableStatsbeat),c.noDiagnosticChannel!=null&&(this.noDiagnosticChannel=c.noDiagnosticChannel),c.noHttpAgentKeepAlive!=null&&(this.noHttpAgentKeepAlive=c.noHttpAgentKeepAlive),c.connectionString!=null&&(this.connectionString=c.connectionString),c.extendedMetricDisablers!=null&&(this.extendedMetricDisablers=c.extendedMetricDisablers),c.noDiagnosticChannel!=null&&(this.noDiagnosticChannel=c.noDiagnosticChannel),c.proxyHttpUrl!=null&&(this.proxyHttpUrl=c.proxyHttpUrl),c.proxyHttpsUrl!=null&&(this.proxyHttpsUrl=c.proxyHttpsUrl),c.proxyHttpsUrl!=null&&(this.proxyHttpsUrl=c.proxyHttpsUrl),c.noPatchModules!=null&&(this.noPatchModules=c.noPatchModules),c.enableAutoWebSnippetInjection!=null&&(this.enableWebInstrumentation=c.enableAutoWebSnippetInjection,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation),c.enableWebInstrumentation!=null&&(this.enableWebInstrumentation=c.enableWebInstrumentation,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation),c.webSnippetConnectionString!=null&&(this.webInstrumentationConnectionString=c.webSnippetConnectionString,this.webSnippetConnectionString=this.webInstrumentationConnectionString),c.webInstrumentationConnectionString!=null&&(this.webInstrumentationConnectionString=c.webInstrumentationConnectionString,this.webSnippetConnectionString=this.webInstrumentationConnectionString),c.webInstrumentationConfig!=null&&(this.webInstrumentationConfig=c.webInstrumentationConfig),c.webInstrumentationSrc!=null&&(this.webInstrumentationSrc=c.webInstrumentationSrc),c.enableLoggerErrorToTrace!=null&&(this.enableLoggerErrorToTrace=c.enableLoggerErrorToTrace),this.endpointUrl=c.endpointUrl,this.maxBatchSize=c.maxBatchSize,this.maxBatchIntervalMs=c.maxBatchIntervalMs,this.disableAppInsights=c.disableAppInsights,this.samplingPercentage=c.samplingPercentage,this.correlationIdRetryIntervalMs=c.correlationIdRetryIntervalMs,this.correlationHeaderExcludedDomains=c.correlationHeaderExcludedDomains,this.ignoreLegacyHeaders=c.ignoreLegacyHeaders,this.distributedTracingMode=c.distributedTracingMode,this.enableAutoCollectExternalLoggers=c.enableAutoCollectExternalLoggers,this.enableAutoCollectConsole=c.enableAutoCollectConsole,this.enableLoggerErrorToTrace=c.enableLoggerErrorToTrace,this.enableAutoCollectExceptions=c.enableAutoCollectExceptions,this.enableAutoCollectPerformance=c.enableAutoCollectPerformance,this.enableAutoCollectExtendedMetrics=c.enableAutoCollectExtendedMetrics,this.enableAutoCollectPreAggregatedMetrics=c.enableAutoCollectPreAggregatedMetrics,this.enableAutoCollectHeartbeat=c.enableAutoCollectHeartbeat,this.enableAutoCollectRequests=c.enableAutoCollectRequests,this.enableAutoCollectDependencies=c.enableAutoCollectDependencies,this.enableAutoDependencyCorrelation=c.enableAutoDependencyCorrelation,this.enableAutoCollectIncomingRequestAzureFunctions=c.enableAutoCollectIncomingRequestAzureFunctions,this.enableUseAsyncHooks=c.enableUseAsyncHooks,this.enableUseDiskRetryCaching=c.enableUseDiskRetryCaching,this.enableResendInterval=c.enableResendInterval,this.enableMaxBytesOnDisk=c.enableMaxBytesOnDisk,this.enableInternalDebugLogging=c.enableInternalDebugLogging,this.enableInternalWarningLogging=c.enableInternalWarningLogging,this.enableSendLiveMetrics=c.enableSendLiveMetrics,this.quickPulseHost=c.quickPulseHost}catch(l){j0r.warn("Invalid JSON config file: ",l)}},t})();Kme.JsonConfig=fia});var H0r=I(rpt=>{"use strict";p();Object.defineProperty(rpt,"__esModule",{value:!0});rpt.makePatchingRequire=void 0;var pia=require("path"),hia=AP(),Rsi=Cp(),Psi=require("module"),mia=Object.keys(process.binding("natives")),ksi=Psi.prototype.require;function gia(t){var e={};return a(function(n){var o=ksi.apply(this,arguments);if(t[n]){var s=Psi._resolveFilename(n,this);if(e.hasOwnProperty(s))return e[s];var c=void 0;if(mia.indexOf(n)<0)try{c=ksi.call(this,pia.join(n,"package.json")).version}catch{return o}else c=process.version.substring(1);var l=c.indexOf("-");l>=0&&(c=c.substring(0,l));for(var u=o,d=0,f=t[n];d{Aia.exports={name:"diagnostic-channel",version:"1.1.1",main:"./dist/src/channel.js",types:"./dist/src/channel.d.ts",scripts:{build:"tsc",lint:"eslint ./ --fix",clean:"rimraf ./dist",test:"mocha ./dist/tests/**/*.js",debug:"mocha --inspect-brk ./dist/tests/**/*.js"},homepage:"https://github.com/Microsoft/node-diagnostic-channel",bugs:{url:"https://github.com/Microsoft/node-diagnostic-channel/issues"},repository:{type:"git",url:"https://github.com/Microsoft/node-diagnostic-channel.git"},description:"Provides a context-saving pub/sub channel to connect diagnostic event publishers and subscribers",dependencies:{semver:"^7.5.3"},devDependencies:{"@types/mocha":"^2.2.40","@types/node":"~8.0.0",mocha:"^3.2.0",rimraf:"^2.6.1",sinon:"1.17.6",typescript:"4.1.2"},files:["dist/src/**/*.d.ts","dist/src/**/*.js","LICENSE","README.md","package.json"],license:"MIT"}});var Cp=I(dR=>{"use strict";p();Object.defineProperty(dR,"__esModule",{value:!0});dR.channel=dR.ContextPreservingEventEmitter=dR.trueFilter=dR.makePatchingRequire=void 0;var yia=H0r(),Eia=H0r();Object.defineProperty(dR,"makePatchingRequire",{enumerable:!0,get:a(function(){return Eia.makePatchingRequire},"get")});var _ia=a(function(t){return!0},"trueFilter");dR.trueFilter=_ia;var Msi=(function(){function t(){this.version=Dsi().version,this.subscribers={},this.contextPreservationFunction=function(e){return e},this.knownPatches={},this.modulesPatched=[],this.currentlyPublishing=!1}return a(t,"ContextPreservingEventEmitter"),t.prototype.shouldPublish=function(e){var r=this.subscribers[e];return r?r.some(function(n){var o=n.filter;return!o||o(!1)}):!1},t.prototype.publish=function(e,r){if(!this.currentlyPublishing){var n=this.subscribers[e];if(n){var o={timestamp:Date.now(),data:r};this.currentlyPublishing=!0,n.forEach(function(s){var c=s.listener,l=s.filter;try{l&&l(!0)&&c(o)}catch{}}),this.currentlyPublishing=!1}}},t.prototype.subscribe=function(e,r,n,o){n===void 0&&(n=dR.trueFilter),this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push({listener:r,filter:n,patchCallback:o});var s=this.checkIfModuleIsAlreadyPatched(e);s&&o&&o(s.name,s.version)},t.prototype.unsubscribe=function(e,r,n){n===void 0&&(n=dR.trueFilter);var o=this.subscribers[e];if(o){for(var s=0;s{p();co();G0r=_b("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(Jme,"suppressTracing");a(Osi,"unsuppressTracing");a(eG,"isTracingSuppressed")});var Lsi,npt,Zme,ipt,Bsi,Fsi,Usi,$0r=ve(()=>{p();Lsi="=",npt=";",Zme=",",ipt="baggage",Bsi=180,Fsi=4096,Usi=8192});function opt(t){return t.reduce(function(e,r){var n=""+e+(e!==""?Zme:"")+r;return n.length>Usi?e:n},"")}function spt(t){return t.getAllEntries().map(function(e){var r=via(e,2),n=r[0],o=r[1],s=encodeURIComponent(n)+"="+encodeURIComponent(o.value);return o.metadata!==void 0&&(s+=npt+o.metadata.toString()),s})}function SMe(t){var e=t.split(npt);if(!(e.length<=0)){var r=e.shift();if(r){var n=r.indexOf(Lsi);if(!(n<=0)){var o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=Hpe(e.join(npt))),{key:o,value:s,metadata:c}}}}}function Qsi(t){return typeof t!="string"||t.length===0?{}:t.split(Zme).map(function(e){return SMe(e)}).filter(function(e){return e!==void 0&&e.value.length>0}).reduce(function(e,r){return e[r.key]=r.value,e},{})}var via,V0r=ve(()=>{p();co();$0r();via=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s};a(opt,"serializeKeyPairs");a(spt,"getKeyPairs");a(SMe,"parsePairKeyValue");a(Qsi,"parseKeyPairsIntoRecord")});var apt,qsi=ve(()=>{p();co();bMe();$0r();V0r();apt=(function(){function t(){}return a(t,"W3CBaggagePropagator"),t.prototype.inject=function(e,r,n){var o=kT.getBaggage(e);if(!(!o||eG(e))){var s=spt(o).filter(function(l){return l.length<=Fsi}).slice(0,Bsi),c=opt(s);c.length>0&&n.set(r,ipt,c)}},t.prototype.extract=function(e,r,n){var o=n.get(r,ipt),s=Array.isArray(o)?o.join(Zme):o;if(!s)return e;var c={};if(s.length===0)return e;var l=s.split(Zme);return l.forEach(function(u){var d=SMe(u);if(d){var f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0?e:kT.setBaggage(e,kT.createBaggage(c))},t.prototype.fields=function(){return[ipt]},t})()});var jsi,Hsi=ve(()=>{p();jsi=(function(){function t(e,r){this._monotonicClock=r,this._epochMillis=e.now(),this._performanceMillis=r.now()}return a(t,"AnchoredClock"),t.prototype.now=function(){var e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e},t})()});function tG(t){var e,r,n={};if(typeof t!="object"||t==null)return n;try{for(var o=Gsi(Object.entries(t)),s=o.next();!s.done;s=o.next()){var c=Cia(s.value,2),l=c[0],u=c[1];if(!W0r(l)){Dn.warn("Invalid attribute key: "+l);continue}if(!TMe(u)){Dn.warn("Invalid attribute value set for key: "+l);continue}Array.isArray(u)?n[l]=u.slice():n[l]=u}}catch(d){e={error:d}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n}function W0r(t){return typeof t=="string"&&t.length>0}function TMe(t){return t==null?!0:Array.isArray(t)?bia(t):$si(t)}function bia(t){var e,r,n;try{for(var o=Gsi(t),s=o.next();!s.done;s=o.next()){var c=s.value;if(c!=null){if(!n){if($si(c)){n=typeof c;continue}return!1}if(typeof c!==n)return!1}}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return!0}function $si(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}var Gsi,Cia,Vsi=ve(()=>{p();co();Gsi=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Cia=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s};a(tG,"sanitizeAttributes");a(W0r,"isAttributeKey");a(TMe,"isAttributeValue");a(bia,"isHomogeneousAttributeValueArray");a($si,"isValidPrimitiveAttributeValue")});function cpt(){return function(t){Dn.error(Sia(t))}}function Sia(t){return typeof t=="string"?t:JSON.stringify(Tia(t))}function Tia(t){for(var e={},r=t;r!==null;)Object.getOwnPropertyNames(r).forEach(function(n){if(!e[n]){var o=r[n];o&&(e[n]=String(o))}}),r=Object.getPrototypeOf(r);return e}var z0r=ve(()=>{p();co();a(cpt,"loggingErrorHandler");a(Sia,"stringifyException");a(Tia,"flattenException")});function zsi(t){Wsi=t}function Ev(t){try{Wsi(t)}catch{}}var Wsi,Y0r=ve(()=>{p();z0r();Wsi=cpt();a(zsi,"setGlobalErrorHandler");a(Ev,"globalErrorHandler")});var Fb,K0r=ve(()=>{p();(function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"})(Fb||(Fb={}))});function wia(t){return xia.indexOf(t)>-1}function kia(t){return Ria.indexOf(t)>-1}function Dia(t){return Pia.indexOf(t)>-1}function Nia(t,e,r){if(!(typeof r[t]>"u")){var n=String(r[t]);e[t]=n.toLowerCase()==="true"}}function Mia(t,e,r,n,o){if(n===void 0&&(n=-1/0),o===void 0&&(o=1/0),typeof r[t]<"u"){var s=Number(r[t]);isNaN(s)||(so?e[t]=o:e[t]=s)}}function Oia(t,e,r,n){n===void 0&&(n=Iia);var o=r[t];typeof o=="string"&&(e[t]=o.split(n).map(function(s){return s.trim()}))}function Bia(t,e,r){var n=r[t];if(typeof n=="string"){var o=Lia[n.toUpperCase()];o!=null&&(e[t]=o)}}function xMe(t){var e={};for(var r in IMe){var n=r;switch(n){case"OTEL_LOG_LEVEL":Bia(n,e,t);break;default:if(wia(n))Nia(n,e,t);else if(kia(n))Mia(n,e,t);else if(Dia(n))Oia(n,e,t);else{var o=t[n];typeof o<"u"&&o!==null&&(e[n]=String(o))}}}return e}var Iia,xia,Ria,Pia,See,Tee,J0r,Z0r,IMe,Lia,X0r=ve(()=>{p();co();K0r();Iia=",",xia=["OTEL_SDK_DISABLED"];a(wia,"isEnvVarABoolean");Ria=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];a(kia,"isEnvVarANumber");Pia=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];a(Dia,"isEnvVarAList");See=1/0,Tee=128,J0r=128,Z0r=128,IMe={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:Da.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:See,OTEL_ATTRIBUTE_COUNT_LIMIT:Tee,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:See,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Tee,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:See,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Tee,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:J0r,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:Z0r,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Fb.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};a(Nia,"parseBoolean");a(Mia,"parseNumber");a(Oia,"parseStringList");Lia={ALL:Da.ALL,VERBOSE:Da.VERBOSE,DEBUG:Da.DEBUG,INFO:Da.INFO,WARN:Da.WARN,ERROR:Da.ERROR,NONE:Da.NONE};a(Bia,"setLogLevelFromEnv");a(xMe,"parseEnvironment")});function fR(){var t=xMe(process.env);return Object.assign({},IMe,t)}function Xme(){return xMe(process.env)}var Ysi=ve(()=>{p();X0r();a(fR,"getEnv");a(Xme,"getEnvWithoutDefaults")});var lpt,Ksi=ve(()=>{p();lpt=typeof globalThis=="object"?globalThis:global});function Jsi(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function upt(t){for(var e=new Uint8Array(t.length/2),r=0,n=0;n{p();a(Jsi,"intValue");a(upt,"hexToBinary")});function dpt(t){return Buffer.from(upt(t)).toString("base64")}var Zsi=ve(()=>{p();egr();a(dpt,"hexToBase64")});function Xsi(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(fpt[t-1]=1);return fpt.toString("hex",0,t)},"generateId")}var Fia,eai,ppt,fpt,tai=ve(()=>{p();Fia=8,eai=16,ppt=(function(){function t(){this.generateTraceId=Xsi(eai),this.generateSpanId=Xsi(Fia)}return a(t,"RandomIdGenerator"),t})(),fpt=Buffer.allocUnsafe(eai);a(Xsi,"getIdGenerator")});var rai,pR,nai=ve(()=>{p();rai=require("perf_hooks"),pR=rai.performance});var hpt,tgr=ve(()=>{p();hpt="1.30.1"});var iai=ve(()=>{p()});var oai=ve(()=>{p();iai()});var Uia,Qia,qia,jia,sai,aai,cai,lai,Hia,uai,dai=ve(()=>{p();Uia="process.runtime.name",Qia="telemetry.sdk.name",qia="telemetry.sdk.language",jia="telemetry.sdk.version",sai=Uia,aai=Qia,cai=qia,lai=jia,Hia="nodejs",uai=Hia});var fai=ve(()=>{p();dai()});var pai=ve(()=>{p()});var hai=ve(()=>{p()});var mai=ve(()=>{p();oai();fai();pai();hai()});var e0e,rG,gai=ve(()=>{p();tgr();mai();rG=(e0e={},e0e[aai]="opentelemetry",e0e[sai]="node",e0e[cai]=uai,e0e[lai]=hpt,e0e)});function t0e(t){t.unref()}var Aai=ve(()=>{p();a(t0e,"unrefTimer")});var yai=ve(()=>{p();Ysi();Ksi();Zsi();tai();nai();gai();Aai()});var rgr=ve(()=>{p();yai()});function eD(t){var e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*$ia);return[r,n]}function r0e(){var t=pR.timeOrigin;if(typeof t!="number"){var e=pR;t=e.timing&&e.timing.fetchStart}return t}function wMe(t){var e=eD(r0e()),r=eD(typeof t=="number"?t:pR.now());return PMe(e,r)}function _ai(t){if(n0e(t))return t;if(typeof t=="number")return t=mpt&&(r[1]-=mpt,r[0]+=1),r}var Eai,Gia,$ia,mpt,Sai=ve(()=>{p();rgr();Eai=9,Gia=6,$ia=Math.pow(10,Gia),mpt=Math.pow(10,Eai);a(eD,"millisToHrTime");a(r0e,"getTimeOrigin");a(wMe,"hrTime");a(_ai,"timeInputToHrTime");a(gpt,"hrTimeDuration");a(vai,"hrTimeToTimeStamp");a(Cai,"hrTimeToNanoseconds");a(bai,"hrTimeToMilliseconds");a(RMe,"hrTimeToMicroseconds");a(n0e,"isTimeInputHrTime");a(kMe,"isTimeInput");a(PMe,"addHrTimes")});var GT,Tai=ve(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(GT||(GT={}))});var Via,Apt,Iai=ve(()=>{p();co();Via=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Apt=(function(){function t(e){e===void 0&&(e={});var r;this._propagators=(r=e.propagators)!==null&&r!==void 0?r:[],this._fields=Array.from(new Set(this._propagators.map(function(n){return typeof n.fields=="function"?n.fields():[]}).reduce(function(n,o){return n.concat(o)},[])))}return a(t,"CompositePropagator"),t.prototype.inject=function(e,r,n){var o,s;try{for(var c=Via(this._propagators),l=c.next();!l.done;l=c.next()){var u=l.value;try{u.inject(e,r,n)}catch(d){Dn.warn("Failed to inject with "+u.constructor.name+". Err: "+d.message)}}}catch(d){o={error:d}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(o)throw o.error}}},t.prototype.extract=function(e,r,n){return this._propagators.reduce(function(o,s){try{return s.extract(o,r,n)}catch(c){Dn.warn("Failed to extract with "+s.constructor.name+". Err: "+c.message)}return o},e)},t.prototype.fields=function(){return this._fields.slice()},t})()});function xai(t){return Yia.test(t)}function wai(t){return Kia.test(t)&&!Jia.test(t)}var ngr,Wia,zia,Yia,Kia,Jia,Rai=ve(()=>{p();ngr="[_0-9a-z-*/]",Wia="[a-z]"+ngr+"{0,255}",zia="[a-z0-9]"+ngr+"{0,240}@[a-z]"+ngr+"{0,13}",Yia=new RegExp("^(?:"+Wia+"|"+zia+")$"),Kia=/^[ -~]{0,255}[!-~]$/,Jia=/,|=/;a(xai,"validateKey");a(wai,"validateValue")});var kai,Zia,Pai,Dai,ypt,igr=ve(()=>{p();Rai();kai=32,Zia=512,Pai=",",Dai="=",ypt=(function(){function t(e){this._internalState=new Map,e&&this._parse(e)}return a(t,"TraceState"),t.prototype.set=function(e,r){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n},t.prototype.unset=function(e){var r=this._clone();return r._internalState.delete(e),r},t.prototype.get=function(e){return this._internalState.get(e)},t.prototype.serialize=function(){var e=this;return this._keys().reduce(function(r,n){return r.push(n+Dai+e.get(n)),r},[]).join(Pai)},t.prototype._parse=function(e){e.length>Zia||(this._internalState=e.split(Pai).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(Dai);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);xai(c)&&wai(l)&&r.set(c,l)}return r},new Map),this._internalState.size>kai&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,kai))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t})()});function ogr(t){var e=ioa.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var DMe,NMe,Xia,eoa,toa,roa,noa,ioa,Ept,Nai=ve(()=>{p();co();bMe();igr();DMe="traceparent",NMe="tracestate",Xia="00",eoa="(?!ff)[\\da-f]{2}",toa="(?![0]{32})[\\da-f]{32}",roa="(?![0]{16})[\\da-f]{16}",noa="[\\da-f]{2}",ioa=new RegExp("^\\s?("+eoa+")-("+toa+")-("+roa+")-("+noa+")(-.*)?\\s?$");a(ogr,"parseTraceParent");Ept=(function(){function t(){}return a(t,"W3CTraceContextPropagator"),t.prototype.inject=function(e,r,n){var o=wu.getSpanContext(e);if(!(!o||eG(e)||!vb(o))){var s=Xia+"-"+o.traceId+"-"+o.spanId+"-0"+Number(o.traceFlags||wf.NONE).toString(16);n.set(r,DMe,s),o.traceState&&n.set(r,NMe,o.traceState.serialize())}},t.prototype.extract=function(e,r,n){var o=n.get(r,DMe);if(!o)return e;var s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;var c=ogr(s);if(!c)return e;c.isRemote=!0;var l=n.get(r,NMe);if(l){var u=Array.isArray(l)?l.join(","):l;c.traceState=new ypt(typeof u=="string"?u:void 0)}return wu.setSpanContext(e,c)},t.prototype.fields=function(){return[DMe,NMe]},t})()});function Mai(t,e){return t.setValue(sgr,e)}function Oai(t){return t.deleteValue(sgr)}function Lai(t){return t.getValue(sgr)}var sgr,_pt,Bai=ve(()=>{p();co();sgr=_b("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(_pt||(_pt={}));a(Mai,"setRPCMetadata");a(Oai,"deleteRPCMetadata");a(Lai,"getRPCMetadata")});var MMe,agr=ve(()=>{p();co();MMe=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:Cb.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var i0e,cgr=ve(()=>{p();co();i0e=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:Cb.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var Fai,Uai=ve(()=>{p();co();Y0r();agr();cgr();Fai=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(Ev(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new i0e),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new i0e,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new MMe,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new i0e,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new MMe}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=wu.getSpanContext(e);return!l||!vb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&wf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&wf.SAMPLED?this._localParentSampled.shouldSample(e,r,n,o,s,c):this._localParentNotSampled.shouldSample(e,r,n,o,s,c)},t.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},t})()});var Qai,qai=ve(()=>{p();co();Qai=(function(){function t(e){e===void 0&&(e=0),this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}return a(t,"TraceIdRatioBasedSampler"),t.prototype.shouldSample=function(e,r){return{decision:aX(r)&&this._accumulate(r)=1?1:e<=0?0:e},t.prototype._accumulate=function(e){for(var r=0,n=0;n>>0}return r},t})()});function doa(t,e){return function(r){return t(e(r))}}function lgr(t){if(!foa(t)||poa(t)!==ooa)return!1;var e=uoa(t);if(e===null)return!0;var r=Gai.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&jai.call(r)===loa}function foa(t){return t!=null&&typeof t=="object"}function poa(t){return t==null?t===void 0?aoa:soa:Iee&&Iee in Object(t)?hoa(t):moa(t)}function hoa(t){var e=Gai.call(t,Iee),r=t[Iee],n=!1;try{t[Iee]=void 0,n=!0}catch{}var o=$ai.call(t);return n&&(e?t[Iee]=r:delete t[Iee]),o}function moa(t){return $ai.call(t)}var ooa,soa,aoa,coa,jai,loa,uoa,Hai,Gai,Iee,$ai,Vai=ve(()=>{p();ooa="[object Object]",soa="[object Null]",aoa="[object Undefined]",coa=Function.prototype,jai=coa.toString,loa=jai.call(Object),uoa=doa(Object.getPrototypeOf,Object),Hai=Object.prototype,Gai=Hai.hasOwnProperty,Iee=Symbol?Symbol.toStringTag:void 0,$ai=Hai.toString;a(doa,"overArg");a(lgr,"isPlainObject");a(foa,"isObjectLike");a(poa,"baseGetTag");a(hoa,"getRawTag");a(moa,"objectToString")});function bpt(){for(var t=[],e=0;e0;)r=zai(r,t.shift(),0,n);return r}function ugr(t){return Cpt(t)?t.slice():t}function zai(t,e,r,n){r===void 0&&(r=0);var o;if(!(r>goa)){if(r++,vpt(t)||vpt(e)||Yai(e))o=ugr(e);else if(Cpt(t)){if(o=t.slice(),Cpt(e))for(var s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{var f=o[u],h=d;if(Wai(t,u,n)||Wai(e,u,n))delete o[u];else{if(OMe(f)&&OMe(h)){var m=n.get(f)||[],g=n.get(h)||[];m.push({obj:t,key:u}),g.push({obj:e,key:u}),n.set(f,m),n.set(h,g)}o[u]=zai(o[u],d,r,n)}}}}else o=e;return o}}function Wai(t,e,r){for(var n=r.get(t[e])||[],o=0,s=n.length;o"u"||t instanceof Date||t instanceof RegExp||t===null}function Aoa(t,e){return!(!lgr(t)||!lgr(e))}var goa,Kai=ve(()=>{p();Vai();goa=20;a(bpt,"merge");a(ugr,"takeValue");a(zai,"mergeTwoObjects");a(Wai,"wasObjectReferenced");a(Cpt,"isArray");a(Yai,"isFunction");a(OMe,"isObject");a(vpt,"isPrimitive");a(Aoa,"shouldMerge")});function Jai(t,e){var r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new dgr("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(function(o){return clearTimeout(r),o},function(o){throw clearTimeout(r),o})}var yoa,dgr,Zai=ve(()=>{p();yoa=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),dgr=(function(t){yoa(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return a(e,"TimeoutError"),e})(Error);a(Jai,"callWithTimeout")});function fgr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function Xai(t,e){var r,n;if(!e)return!1;try{for(var o=Eoa(e),s=o.next();!s.done;s=o.next()){var c=s.value;if(fgr(t,c))return!0}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1}var Eoa,eci=ve(()=>{p();Eoa=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};a(fgr,"urlMatches");a(Xai,"isUrlIgnored")});function tci(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var rci=ve(()=>{p();a(tci,"isWrapped")});var nci,ici=ve(()=>{p();nci=(function(){function t(){var e=this;this._promise=new Promise(function(r,n){e._resolve=r,e._reject=n})}return a(t,"Deferred"),Object.defineProperty(t.prototype,"promise",{get:a(function(){return this._promise},"get"),enumerable:!1,configurable:!0}),t.prototype.resolve=function(e){this._resolve(e)},t.prototype.reject=function(e){this._reject(e)},t})()});var _oa,voa,o0e,oci=ve(()=>{p();ici();_oa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},voa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();co();bMe();a(sci,"_export")});var cci={};ki(cci,{AlwaysOffSampler:()=>MMe,AlwaysOnSampler:()=>i0e,AnchoredClock:()=>jsi,BindOnceFuture:()=>o0e,CompositePropagator:()=>Apt,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>Tee,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>See,DEFAULT_ENVIRONMENT:()=>IMe,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>J0r,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>Z0r,ExportResultCode:()=>GT,ParentBasedSampler:()=>Fai,RPCType:()=>_pt,RandomIdGenerator:()=>ppt,SDK_INFO:()=>rG,TRACE_PARENT_HEADER:()=>DMe,TRACE_STATE_HEADER:()=>NMe,TimeoutError:()=>dgr,TraceIdRatioBasedSampler:()=>Qai,TraceState:()=>ypt,TracesSamplerValues:()=>Fb,VERSION:()=>hpt,W3CBaggagePropagator:()=>apt,W3CTraceContextPropagator:()=>Ept,_globalThis:()=>lpt,addHrTimes:()=>PMe,baggageUtils:()=>Coa,callWithTimeout:()=>Jai,deleteRPCMetadata:()=>Oai,getEnv:()=>fR,getEnvWithoutDefaults:()=>Xme,getRPCMetadata:()=>Lai,getTimeOrigin:()=>r0e,globalErrorHandler:()=>Ev,hexToBase64:()=>dpt,hexToBinary:()=>upt,hrTime:()=>wMe,hrTimeDuration:()=>gpt,hrTimeToMicroseconds:()=>RMe,hrTimeToMilliseconds:()=>bai,hrTimeToNanoseconds:()=>Cai,hrTimeToTimeStamp:()=>vai,internal:()=>pgr,isAttributeKey:()=>W0r,isAttributeValue:()=>TMe,isTimeInput:()=>kMe,isTimeInputHrTime:()=>n0e,isTracingSuppressed:()=>eG,isUrlIgnored:()=>Xai,isWrapped:()=>tci,loggingErrorHandler:()=>cpt,merge:()=>bpt,millisToHrTime:()=>eD,otperformance:()=>pR,parseEnvironment:()=>xMe,parseTraceParent:()=>ogr,sanitizeAttributes:()=>tG,setGlobalErrorHandler:()=>zsi,setRPCMetadata:()=>Mai,suppressTracing:()=>Jme,timeInputToHrTime:()=>_ai,unrefTimer:()=>t0e,unsuppressTracing:()=>Osi,urlMatches:()=>fgr});var Coa,pgr,Ub=ve(()=>{p();qsi();Hsi();Vsi();Y0r();z0r();Sai();egr();Tai();V0r();rgr();Iai();Nai();Bai();agr();cgr();Uai();qai();bMe();igr();X0r();Kai();K0r();Zai();eci();rci();oci();tgr();aci();Coa={getKeyPairs:spt,serializeKeyPairs:opt,parseKeyPairsIntoRecord:Qsi,parsePairKeyValue:SMe},pgr={_export:sci}});var boa,Soa,Toa,Spt,Tpt,lci,uci=ve(()=>{p();boa="exception.type",Soa="exception.message",Toa="exception.stacktrace",Spt=boa,Tpt=Soa,lci=Toa});var dci=ve(()=>{p();uci()});var fci=ve(()=>{p()});var pci=ve(()=>{p();fci()});var hci=ve(()=>{p()});var mci=ve(()=>{p()});var gci=ve(()=>{p();dci();pci();hci();mci()});var Aci,yci=ve(()=>{p();Aci="exception"});var hgr,Ioa,Eci,xoa,Ipt,mgr=ve(()=>{p();co();Ub();gci();yci();hgr=function(){return hgr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Eci=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},xoa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(r),this):(Dn.warn("Invalid attribute value set for key: "+e),this)},t.prototype.setAttributes=function(e){var r,n;try{for(var o=Ioa(Object.entries(e)),s=o.next();!s.done;s=o.next()){var c=Eci(s.value,2),l=c[0],u=c[1];this.setAttribute(l,u)}}catch(d){r={error:d}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return this},t.prototype.addEvent=function(e,r,n){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return Dn.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&Dn.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),kMe(r)&&(kMe(n)||(n=r),r=void 0);var o=tG(r);return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:0}),this},t.prototype.addLink=function(e){return this.links.push(e),this},t.prototype.addLinks=function(e){var r;return(r=this.links).push.apply(r,xoa([],Eci(e),!1)),this},t.prototype.setStatus=function(e){return this._isSpanEnded()?this:(this.status=hgr({},e),this.status.message!=null&&typeof e.message!="string"&&(Dn.warn("Dropping invalid status.message of type '"+typeof e.message+"', expected 'string'"),delete this.status.message),this)},t.prototype.updateName=function(e){return this._isSpanEnded()?this:(this.name=e,this)},t.prototype.end=function(e){if(this._isSpanEnded()){Dn.error(this.name+" "+this._spanContext.traceId+"-"+this._spanContext.spanId+" - You can only call end() on a span once.");return}this._ended=!0,this.endTime=this._getTime(e),this._duration=gpt(this.startTime,this.endTime),this._duration[0]<0&&(Dn.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&Dn.warn("Dropped "+this._droppedEventsCount+" events because eventCountLimit reached"),this._spanProcessor.onEnd(this)},t.prototype._getTime=function(e){if(typeof e=="number"&&e<=pR.now())return wMe(e+this._performanceOffset);if(typeof e=="number")return eD(e);if(e instanceof Date)return eD(e.getTime());if(n0e(e))return e;if(this._startTimeProvided)return eD(Date.now());var r=pR.now()-this._performanceStartTime;return PMe(this.startTime,eD(r))},t.prototype.isRecording=function(){return this._ended===!1},t.prototype.recordException=function(e,r){var n={};typeof e=="string"?n[Tpt]=e:e&&(e.code?n[Spt]=e.code.toString():e.name&&(n[Spt]=e.name),e.message&&(n[Tpt]=e.message),e.stack&&(n[lci]=e.stack)),n[Spt]||n[Tpt]?this.addEvent(Aci,n,r):Dn.warn("Failed to record an exception "+e)},Object.defineProperty(t.prototype,"duration",{get:a(function(){return this._duration},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ended",{get:a(function(){return this._ended},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedAttributesCount",{get:a(function(){return this._droppedAttributesCount},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedEventsCount",{get:a(function(){return this._droppedEventsCount},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedLinksCount",{get:a(function(){return this._droppedLinksCount},"get"),enumerable:!1,configurable:!0}),t.prototype._isSpanEnded=function(){return this._ended&&Dn.warn("Can not execute the operation on ended Span {traceId: "+this._spanContext.traceId+", spanId: "+this._spanContext.spanId+"}"),this._ended},t.prototype._truncateToLimitUtil=function(e,r){return e.length<=r?e:e.substring(0,r)},t.prototype._truncateToSize=function(e){var r=this,n=this._attributeValueLengthLimit;return n<=0?(Dn.warn("Attribute value limit must be positive, got "+n),e):typeof e=="string"?this._truncateToLimitUtil(e,n):Array.isArray(e)?e.map(function(o){return typeof o=="string"?r._truncateToLimitUtil(o,n):o}):e},t})()});var tD,LMe=ve(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(tD||(tD={}))});var nG,xpt=ve(()=>{p();LMe();nG=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:tD.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var C4,wpt=ve(()=>{p();LMe();C4=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:tD.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var s0e,ggr=ve(()=>{p();co();Ub();xpt();wpt();s0e=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(Ev(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new C4),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new C4,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new nG,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new C4,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new nG}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=wu.getSpanContext(e);return!l||!vb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&wf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&wf.SAMPLED?this._localParentSampled.shouldSample(e,r,n,o,s,c):this._localParentNotSampled.shouldSample(e,r,n,o,s,c)},t.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},t})()});var BMe,Agr=ve(()=>{p();co();LMe();BMe=(function(){function t(e){e===void 0&&(e=0),this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}return a(t,"TraceIdRatioBasedSampler"),t.prototype.shouldSample=function(e,r){return{decision:aX(r)&&this._accumulate(r)=1?1:e<=0?0:e},t.prototype._accumulate=function(e){for(var r=0,n=0;n>>0}return r},t})()});function Rpt(){var t=fR();return{sampler:ygr(t),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:t.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:t.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:t.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:t.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT},mergeResourceWithDefaults:!0}}function ygr(t){switch(t===void 0&&(t=fR()),t.OTEL_TRACES_SAMPLER){case Fb.AlwaysOn:return new C4;case Fb.AlwaysOff:return new nG;case Fb.ParentBasedAlwaysOn:return new s0e({root:new C4});case Fb.ParentBasedAlwaysOff:return new s0e({root:new nG});case Fb.TraceIdRatio:return new BMe(_ci(t));case Fb.ParentBasedTraceIdRatio:return new s0e({root:new BMe(_ci(t))});default:return Dn.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+woa+'".'),new C4}}function _ci(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return Dn.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+a0e+"."),a0e;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(Dn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+a0e+"."),a0e):e<0||e>1?(Dn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+a0e+"."),a0e):e}var woa,a0e,Egr=ve(()=>{p();co();Ub();xpt();wpt();ggr();Agr();woa=Fb.AlwaysOn,a0e=1;a(Rpt,"loadDefaultConfig");a(ygr,"buildSamplerFromEnv");a(_ci,"getSamplerProbabilityFromEnv")});function vci(t){var e={sampler:ygr()},r=Rpt(),n=Object.assign({},r,e,t);return n.generalLimits=Object.assign({},r.generalLimits,t.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,t.spanLimits||{}),n}function Cci(t){var e,r,n,o,s,c,l,u,d,f,h,m,g=Object.assign({},t.spanLimits),A=Xme();return g.attributeCountLimit=(c=(s=(o=(r=(e=t.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&r!==void 0?r:(n=t.generalLimits)===null||n===void 0?void 0:n.attributeCountLimit)!==null&&o!==void 0?o:A.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:A.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&c!==void 0?c:Tee,g.attributeValueLengthLimit=(m=(h=(f=(u=(l=t.spanLimits)===null||l===void 0?void 0:l.attributeValueLengthLimit)!==null&&u!==void 0?u:(d=t.generalLimits)===null||d===void 0?void 0:d.attributeValueLengthLimit)!==null&&f!==void 0?f:A.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&h!==void 0?h:A.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&m!==void 0?m:See,Object.assign({},t,{spanLimits:g})}var _gr=ve(()=>{p();Egr();Ub();a(vci,"mergeConfig");a(Cci,"reconfigureLimits")});var bci,Sci=ve(()=>{p();co();Ub();bci=(function(){function t(e,r){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;var n=fR();this._maxExportBatchSize=typeof r?.maxExportBatchSize=="number"?r.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof r?.maxQueueSize=="number"?r.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof r?.scheduledDelayMillis=="number"?r.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof r?.exportTimeoutMillis=="number"?r.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new o0e(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Dn.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}return a(t,"BatchSpanProcessorBase"),t.prototype.forceFlush=function(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()},t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&wf.SAMPLED)!==0&&this._addToBuffer(e)},t.prototype.shutdown=function(){return this._shutdownOnce.call()},t.prototype._shutdown=function(){var e=this;return Promise.resolve().then(function(){return e.onShutdown()}).then(function(){return e._flushAll()}).then(function(){return e._exporter.shutdown()})},t.prototype._addToBuffer=function(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&Dn.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Dn.warn("Dropped "+this._droppedSpansCount+" spans because maxQueueSize reached"),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()},t.prototype._flushAll=function(){var e=this;return new Promise(function(r,n){for(var o=[],s=Math.ceil(e._finishedSpans.length/e._maxExportBatchSize),c=0,l=s;c0&&(e._clearTimer(),e._maybeStartTimer())}).catch(function(n){e._isExporting=!1,Ev(n)})},"flush");if(this._finishedSpans.length>=this._maxExportBatchSize)return r();this._timer===void 0&&(this._timer=setTimeout(function(){return r()},this._scheduledDelayMillis),t0e(this._timer))}},t.prototype._clearTimer=function(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)},t})()});var Roa,c0e,Tci=ve(()=>{p();Sci();Roa=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),c0e=(function(t){Roa(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"BatchSpanProcessor"),e.prototype.onShutdown=function(){},e})(bci)});function Ici(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(kpt[t-1]=1);return kpt.toString("hex",0,t)},"generateId")}var koa,xci,l0e,kpt,wci=ve(()=>{p();koa=8,xci=16,l0e=(function(){function t(){this.generateTraceId=Ici(xci),this.generateSpanId=Ici(koa)}return a(t,"RandomIdGenerator"),t})(),kpt=Buffer.allocUnsafe(xci);a(Ici,"getIdGenerator")});var Rci=ve(()=>{p();Tci();wci()});var Ppt=ve(()=>{p();Rci()});var Dpt,vgr=ve(()=>{p();co();Ub();mgr();_gr();Ppt();Dpt=(function(){function t(e,r,n){this._tracerProvider=n;var o=vci(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new l0e,this.resource=n.resource,this.instrumentationLibrary=e}return a(t,"Tracer"),t.prototype.startSpan=function(e,r,n){var o,s,c;r===void 0&&(r={}),n===void 0&&(n=Og.active()),r.root&&(n=wu.deleteSpan(n));var l=wu.getSpan(n);if(eG(n)){Dn.debug("Instrumentation suppressed, returning Noop Span");var u=wu.wrapSpanContext(Gpe);return u}var d=l?.spanContext(),f=this._idGenerator.generateSpanId(),h,m,g;!d||!wu.isSpanContextValid(d)?h=this._idGenerator.generateTraceId():(h=d.traceId,m=d.traceState,g=d.spanId);var A=(o=r.kind)!==null&&o!==void 0?o:$pe.INTERNAL,y=((s=r.links)!==null&&s!==void 0?s:[]).map(function(R){return{context:R.context,attributes:tG(R.attributes)}}),E=tG(r.attributes),_=this._sampler.shouldSample(n,h,e,A,E,y);m=(c=_.traceState)!==null&&c!==void 0?c:m;var v=_.decision===Cb.RECORD_AND_SAMPLED?wf.SAMPLED:wf.NONE,b={traceId:h,spanId:f,traceFlags:v,traceState:m};if(_.decision===Cb.NOT_RECORD){Dn.debug("Recording is off, propagating context in a non-recording span");var u=wu.wrapSpanContext(b);return u}var T=tG(Object.assign(E,_.attributes)),w=new Ipt(this,n,e,b,A,g,y,r.startTime,void 0,T);return w},t.prototype.startActiveSpan=function(e,r,n,o){var s,c,l;if(!(arguments.length<2)){arguments.length===2?l=r:arguments.length===3?(s=r,l=n):(s=r,c=n,l=o);var u=c??Og.active(),d=this.startSpan(e,s,u),f=wu.setSpan(u,d);return Og.with(f,l,void 0,d)}},t.prototype.getGeneralLimits=function(){return this._generalLimits},t.prototype.getSpanLimits=function(){return this._spanLimits},t.prototype.getActiveSpanProcessor=function(){return this._tracerProvider.getActiveSpanProcessor()},t})()});var kci=ve(()=>{p()});var Pci=ve(()=>{p();kci()});var Poa,Doa,Noa,Moa,Dci,Cgr,bgr,Sgr,Nci=ve(()=>{p();Poa="service.name",Doa="telemetry.sdk.name",Noa="telemetry.sdk.language",Moa="telemetry.sdk.version",Dci=Poa,Cgr=Doa,bgr=Noa,Sgr=Moa});var Mci=ve(()=>{p();Nci()});var Oci=ve(()=>{p()});var Lci=ve(()=>{p()});var Bci=ve(()=>{p();Pci();Mci();Oci();Lci()});function Npt(){return"unknown_service:"+process.argv0}var Fci=ve(()=>{p();a(Npt,"defaultServiceName")});var Uci=ve(()=>{p();Fci()});var Qci=ve(()=>{p();Uci()});var iG,Ooa,Loa,Boa,Mpt,qci=ve(()=>{p();co();Bci();Ub();Qci();iG=function(){return iG=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},Mpt=(function(){function t(e,r){var n=this,o;this._attributes=e,this.asyncAttributesPending=r!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=r?.then(function(s){return n._attributes=Object.assign({},n._attributes,s),n.asyncAttributesPending=!1,s},function(s){return Dn.debug("a resource's async attributes promise rejected: %s",s),n.asyncAttributesPending=!1,{}})}return a(t,"Resource"),t.empty=function(){return t.EMPTY},t.default=function(){var e;return new t((e={},e[Dci]=Npt(),e[bgr]=rG[bgr],e[Cgr]=rG[Cgr],e[Sgr]=rG[Sgr],e))},Object.defineProperty(t.prototype,"attributes",{get:a(function(){var e;return this.asyncAttributesPending&&Dn.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}},"get"),enumerable:!1,configurable:!0}),t.prototype.waitForAsyncAttributes=function(){return Ooa(this,void 0,void 0,function(){return Loa(this,function(e){switch(e.label){case 0:return this.asyncAttributesPending?[4,this._asyncAttributesPromise]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},t.prototype.merge=function(e){var r=this,n;if(!e)return this;var o=iG(iG({},this._syncAttributes),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new t(o);var s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(function(c){var l,u=Boa(c,2),d=u[0],f=u[1];return iG(iG(iG(iG({},r._syncAttributes),d),(l=e._syncAttributes)!==null&&l!==void 0?l:e.attributes),f)});return new t(o,s)},t.EMPTY=new t({}),t})()});var jci=ve(()=>{p();qci()});var Opt,Tgr,Hci=ve(()=>{p();Ub();Opt=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Tgr=(function(){function t(e){this._spanProcessors=e}return a(t,"MultiSpanProcessor"),t.prototype.forceFlush=function(){var e,r,n=[];try{for(var o=Opt(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;n.push(c.forceFlush())}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return new Promise(function(l){Promise.all(n).then(function(){l()}).catch(function(u){Ev(u||new Error("MultiSpanProcessor: forceFlush failed")),l()})})},t.prototype.onStart=function(e,r){var n,o;try{for(var s=Opt(this._spanProcessors),c=s.next();!c.done;c=s.next()){var l=c.value;l.onStart(e,r)}}catch(u){n={error:u}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}},t.prototype.onEnd=function(e){var r,n;try{for(var o=Opt(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;c.onEnd(e)}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},t.prototype.shutdown=function(){var e,r,n=[];try{for(var o=Opt(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;n.push(c.shutdown())}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return new Promise(function(l,u){Promise.all(n).then(function(){l()},u)})},t})()});var Lpt,Igr=ve(()=>{p();Lpt=(function(){function t(){}return a(t,"NoopSpanProcessor"),t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){},t.prototype.shutdown=function(){return Promise.resolve()},t.prototype.forceFlush=function(){return Promise.resolve()},t})()});var Foa,Uoa,N8,Gci,$ci=ve(()=>{p();co();Ub();jci();vgr();Egr();Hci();Igr();Ppt();_gr();Foa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},Uoa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n0?o(c):n()}).catch(function(s){return o([s])})})},t.prototype.shutdown=function(){return this.activeSpanProcessor.shutdown()},t.prototype._getPropagator=function(e){var r;return(r=this.constructor._registeredPropagators.get(e))===null||r===void 0?void 0:r()},t.prototype._getSpanExporter=function(e){var r;return(r=this.constructor._registeredExporters.get(e))===null||r===void 0?void 0:r()},t.prototype._buildPropagatorFromEnv=function(){var e=this,r=Array.from(new Set(fR().OTEL_PROPAGATORS)),n=r.map(function(s){var c=e._getPropagator(s);return c||Dn.warn('Propagator "'+s+'" requested through environment variable is unavailable.'),c}),o=n.reduce(function(s,c){return c&&s.push(c),s},[]);if(o.length!==0)return r.length===1?o[0]:new Apt({propagators:o})},t.prototype._buildExporterFromEnv=function(){var e=fR().OTEL_TRACES_EXPORTER;if(!(e==="none"||e==="")){var r=this._getSpanExporter(e);return r||Dn.error('Exporter "'+e+'" requested through environment variable is unavailable.'),r}},t._registeredPropagators=new Map([["tracecontext",function(){return new Ept}],["baggage",function(){return new apt}]]),t._registeredExporters=new Map,t})()});var Qoa,Vci,Wci=ve(()=>{p();Ub();Qoa=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Vci=(function(){function t(){}return a(t,"ConsoleSpanExporter"),t.prototype.export=function(e,r){return this._sendSpans(e,r)},t.prototype.shutdown=function(){return this._sendSpans([]),this.forceFlush()},t.prototype.forceFlush=function(){return Promise.resolve()},t.prototype._exportInfo=function(e){var r;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationLibrary,traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(r=e.spanContext().traceState)===null||r===void 0?void 0:r.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:RMe(e.startTime),duration:RMe(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}},t.prototype._sendSpans=function(e,r){var n,o;try{for(var s=Qoa(e),c=s.next();!c.done;c=s.next()){var l=c.value;console.dir(this._exportInfo(l),{depth:3})}}catch(u){n={error:u}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}if(r)return r({code:GT.SUCCESS})},t})()});var qoa,joa,zci,Yci=ve(()=>{p();Ub();qoa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},joa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();co();Ub();Hoa=function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},Goa=function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]nG,AlwaysOnSampler:()=>C4,BasicTracerProvider:()=>Gci,BatchSpanProcessor:()=>c0e,ConsoleSpanExporter:()=>Vci,ForceFlushState:()=>N8,InMemorySpanExporter:()=>zci,NoopSpanProcessor:()=>Lpt,ParentBasedSampler:()=>s0e,RandomIdGenerator:()=>l0e,SamplingDecision:()=>tD,SimpleSpanProcessor:()=>Kci,Span:()=>Ipt,TraceIdRatioBasedSampler:()=>BMe,Tracer:()=>Dpt});var Xci=ve(()=>{p();vgr();$ci();Ppt();Wci();Yci();Jci();Igr();xpt();wpt();ggr();Agr();LMe();mgr()});var FMe,eli,xgr=ve(()=>{p();FMe=class{static{a(this,"NoopLogger")}emit(e){}},eli=new FMe});var wgr,Bpt,Rgr=ve(()=>{p();xgr();wgr=class{static{a(this,"NoopLoggerProvider")}getLogger(e,r,n){return new FMe}},Bpt=new wgr});var Fpt,tli=ve(()=>{p();xgr();Fpt=class{static{a(this,"ProxyLogger")}constructor(e,r,n,o){this._provider=e,this.name=r,this.version=n,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):eli}}});var UMe,rli=ve(()=>{p();Rgr();tli();UMe=class{static{a(this,"ProxyLoggerProvider")}getLogger(e,r,n){var o;return(o=this.getDelegateLogger(e,r,n))!==null&&o!==void 0?o:new Fpt(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Bpt}setDelegate(e){this._delegate=e}getDelegateLogger(e,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,r,n)}}});var Upt,nli=ve(()=>{p();Upt=typeof globalThis=="object"?globalThis:global});var ili=ve(()=>{p();nli()});var oli=ve(()=>{p();ili()});function sli(t,e,r){return n=>n===t?e:r}var QMe,u0e,kgr,ali=ve(()=>{p();oli();QMe=Symbol.for("io.opentelemetry.js.api.logs"),u0e=Upt;a(sli,"makeGetter");kgr=1});var Qpt,cli=ve(()=>{p();ali();Rgr();rli();Qpt=class t{static{a(this,"LogsAPI")}constructor(){this._proxyLoggerProvider=new UMe}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return u0e[QMe]?this.getLoggerProvider():(u0e[QMe]=sli(kgr,e,Bpt),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=u0e[QMe])===null||e===void 0?void 0:e.call(u0e,kgr))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete u0e[QMe],this._proxyLoggerProvider=new UMe}}});var qpt,Pgr=ve(()=>{p();cli();qpt=Qpt.getInstance()});function lli(t,e,r,n){for(let o=0,s=t.length;oe.disable())}var dli=ve(()=>{p();a(lli,"enableInstrumentations");a(uli,"disableInstrumentations")});function fli(t){let e=t.tracerProvider||wu.getTracerProvider(),r=t.meterProvider||cX.getMeterProvider(),n=t.loggerProvider||qpt.getLoggerProvider(),o=t.instrumentations?.flat()??[];return lli(o,e,r,n),()=>{uli(o)}}var pli=ve(()=>{p();co();Pgr();dli();a(fli,"registerInstrumentations")});function Eli(t,e,r){if(!Woa(t))return Dn.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let n=Joa(t);if(!n)return!1;let o=[],s=_li(n,e,o,r);return s&&!r?.includePrerelease?Yoa(n,o):s}function Woa(t){return typeof t=="string"&&yli.test(t)}function _li(t,e,r,n){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(Dgr(t,s,r,n))return!0;return!1}else if(e.includes(" - "))e=ysa(e,n);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!Dgr(t,s,r,n))return!1;return!0}return Dgr(t,e,r,n)}function Dgr(t,e,r,n){if(e=Koa(e,n),e.includes(" "))return _li(t,e,r,n);{let o=Zoa(e);return r.push(o),zoa(t,o)}}function zoa(t,e){if(e.invalid)return!1;if(!e.version||Mgr(e.version))return!0;let r=mli(t.versionSegments||[],e.versionSegments||[]);if(r===0){let n=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!n.length&&!o.length?r=0:!n.length&&o.length?r=1:n.length&&!o.length?r=-1:r=mli(n,o)}return Voa[e.op]?.includes(r)}function Yoa(t,e){return t.prerelease?e.some(r=>r.prerelease&&r.version===t.version):!0}function Koa(t,e){return t=t.trim(),t=gsa(t,e),t=msa(t),t=Asa(t,e),t=t.trim(),t}function _v(t){return!t||t.toLowerCase()==="x"||t==="*"}function Joa(t){let e=t.match(yli);if(!e){Dn.error(`Invalid version: ${t}`);return}let r=e.groups.version,n=e.groups.prerelease,o=e.groups.build,s=r.split("."),c=n?.split(".");return{op:void 0,version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:n,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:o}}function Zoa(t){if(!t)return{};let e=t.match($oa);if(!e)return Dn.error(`Invalid range: ${t}`),{invalid:!0};let r=e.groups.op,n=e.groups.version,o=e.groups.prerelease,s=e.groups.build,c=n.split("."),l=o?.split(".");return r==="=="&&(r="="),{op:r||"=",version:n,versionSegments:c,versionSegmentCount:c.length,prerelease:o,prereleaseSegments:l,prereleaseSegmentCount:l?l.length:0,build:s}}function Mgr(t){return t==="*"||t==="x"||t==="X"}function hli(t){let e=parseInt(t,10);return isNaN(e)?t:e}function Xoa(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function esa(t,e){if(Mgr(t)||Mgr(e))return 0;let[r,n]=Xoa(hli(t),hli(e));return r>n?1:r{let l;return _v(n)?l="":_v(o)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:_v(s)?l=`>=${n}.${o}.0 <${n}.${+o+1}.0-0`:c?l=`>=${n}.${o}.${s}-${c} <${n}.${+o+1}.0-0`:l=`>=${n}.${o}.${s} <${n}.${+o+1}.0-0`,l})}function gsa(t,e){let r=hsa,n=e?.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{let d;return _v(s)?d="":_v(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:_v(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?s==="0"?c==="0"?d=`>=${s}.${c}.${l}-${u} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l}-${u} <${+s+1}.0.0-0`:s==="0"?c==="0"?d=`>=${s}.${c}.${l}${n} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l} <${+s+1}.0.0-0`,d})}function Asa(t,e){let r=ssa;return t.replace(r,(n,o,s,c,l,u)=>{let d=_v(s),f=d||_v(c),h=f||_v(l),m=h;return o==="="&&m&&(o=""),u=e?.includePrerelease?"-0":"",d?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),o==="<"&&(u="-0"),n=`${o+s}.${c}.${l}${u}`):f?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:h&&(n=`>=${s}.${c}.0${u} <${s}.${+c+1}.0-0`),n})}function ysa(t,e){let r=csa;return t.replace(r,(n,o,s,c,l,u,d,f,h,m,g,A)=>(_v(s)?o="":_v(c)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:_v(l)?o=`>=${s}.${c}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,_v(h)?f="":_v(m)?f=`<${+h+1}.0.0-0`:_v(g)?f=`<${h}.${+m+1}.0-0`:A?f=`<=${h}.${m}.${g}-${A}`:e?.includePrerelease?f=`<${h}.${m}.${+g+1}-0`:f=`<=${f}`,`${o} ${f}`.trim()))}var yli,$oa,Voa,vli,Cli,tsa,rsa,gli,nsa,Ali,isa,Ngr,qMe,osa,ssa,asa,csa,lsa,usa,dsa,fsa,psa,hsa,bli=ve(()=>{p();co();yli=/^(?:v)?(?(?0|[1-9]\d*)\.(?0|[1-9]\d*)\.(?0|[1-9]\d*))(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,$oa=/^(?<|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?(?x|X|\*|0|[1-9]\d*)(?:\.(?x|X|\*|0|[1-9]\d*))?(?:\.(?x|X|\*|0|[1-9]\d*))?)(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,Voa={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};a(Eli,"satisfies");a(Woa,"_validateVersion");a(_li,"_doSatisfies");a(Dgr,"_checkRange");a(zoa,"_satisfies");a(Yoa,"_doPreleaseCheck");a(Koa,"_normalizeRange");a(_v,"isX");a(Joa,"_parseVersion");a(Zoa,"_parseRange");a(Mgr,"_isWildcard");a(hli,"_parseVersionString");a(Xoa,"_normalizeVersionType");a(esa,"_compareVersionStrings");a(mli,"_compareVersionSegments");vli="[a-zA-Z0-9-]",Cli="0|[1-9]\\d*",tsa=`\\d*[a-zA-Z-]${vli}*`,rsa="((?:<|>)?=?)",gli=`(?:${Cli}|${tsa})`,nsa=`(?:-(${gli}(?:\\.${gli})*))`,Ali=`${vli}+`,isa=`(?:\\+(${Ali}(?:\\.${Ali})*))`,Ngr=`${Cli}|x|X|\\*`,qMe=`[v=\\s]*(${Ngr})(?:\\.(${Ngr})(?:\\.(${Ngr})(?:${nsa})?${isa}?)?)?`,osa=`^${rsa}\\s*${qMe}$`,ssa=new RegExp(osa),asa=`^\\s*(${qMe})\\s+-\\s+(${qMe})\\s*$`,csa=new RegExp(asa),lsa="(?:~>?)",usa=`^${lsa}${qMe}$`,dsa=new RegExp(usa),fsa="(?:\\^)",psa=`^${fsa}${qMe}$`,hsa=new RegExp(psa);a(msa,"replaceTilde");a(gsa,"replaceCaret");a(Asa,"replaceXRange");a(ysa,"replaceHyphen")});var d0e=I((Jsp,Ili)=>{"use strict";p();function Ogr(t){return typeof t=="function"}a(Ogr,"isFunction");var vv=console.error.bind(console);function jMe(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(jMe,"defineProperty");function HMe(t){t&&t.logger&&(Ogr(t.logger)?vv=t.logger:vv("new logger isn't a function, not replacing"))}a(HMe,"shimmer");function Sli(t,e,r){if(!t||!t[e]){vv("no original function "+e+" to wrap");return}if(!r){vv("no wrapper function"),vv(new Error().stack);return}if(!Ogr(t[e])||!Ogr(r)){vv("original object and wrapper must be functions");return}var n=t[e],o=r(n,e);return jMe(o,"__original",n),jMe(o,"__unwrap",function(){t[e]===o&&jMe(t,e,n)}),jMe(o,"__wrapped",!0),jMe(t,e,o),o}a(Sli,"wrap");function Esa(t,e,r){if(t)Array.isArray(t)||(t=[t]);else{vv("must provide one or more modules to patch"),vv(new Error().stack);return}if(!(e&&Array.isArray(e))){vv("must provide one or more functions to wrap on modules");return}t.forEach(function(n){e.forEach(function(o){Sli(n,o,r)})})}a(Esa,"massWrap");function Tli(t,e){if(!t||!t[e]){vv("no function to unwrap."),vv(new Error().stack);return}if(!t[e].__unwrap)vv("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}a(Tli,"unwrap");function _sa(t,e){if(t)Array.isArray(t)||(t=[t]);else{vv("must provide one or more modules to patch"),vv(new Error().stack);return}if(!(e&&Array.isArray(e))){vv("must provide one or more functions to unwrap on modules");return}t.forEach(function(r){e.forEach(function(n){Tli(r,n)})})}a(_sa,"massUnwrap");HMe.wrap=Sli;HMe.massWrap=Esa;HMe.unwrap=Tli;HMe.massUnwrap=_sa;Ili.exports=HMe});var oG,jpt,xli=ve(()=>{p();co();Pgr();oG=de(d0e()),jpt=class{static{a(this,"InstrumentationAbstract")}instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,r,n){this.instrumentationName=e,this.instrumentationVersion=r,this.setConfig(n),this._diag=Dn.createComponentLogger({namespace:e}),this._tracer=wu.getTracer(e,r),this._meter=cX.getMeter(e,r),this._logger=qpt.getLogger(e,r),this._updateMetricInstruments()}_wrap=oG.wrap;_unwrap=oG.unwrap;_massWrap=oG.massWrap;_massUnwrap=oG.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,r,n,o){if(e)try{e(n,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:r},s)}}}});var Rli=I((oap,wli)=>{p();var f0e=1e3,p0e=f0e*60,h0e=p0e*60,xee=h0e*24,vsa=xee*7,Csa=xee*365.25;wli.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return bsa(t);if(r==="number"&&isFinite(t))return e.long?Tsa(t):Ssa(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function bsa(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Csa;case"weeks":case"week":case"w":return r*vsa;case"days":case"day":case"d":return r*xee;case"hours":case"hour":case"hrs":case"hr":case"h":return r*h0e;case"minutes":case"minute":case"mins":case"min":case"m":return r*p0e;case"seconds":case"second":case"secs":case"sec":case"s":return r*f0e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(bsa,"parse");function Ssa(t){var e=Math.abs(t);return e>=xee?Math.round(t/xee)+"d":e>=h0e?Math.round(t/h0e)+"h":e>=p0e?Math.round(t/p0e)+"m":e>=f0e?Math.round(t/f0e)+"s":t+"ms"}a(Ssa,"fmtShort");function Tsa(t){var e=Math.abs(t);return e>=xee?Hpt(t,e,xee,"day"):e>=h0e?Hpt(t,e,h0e,"hour"):e>=p0e?Hpt(t,e,p0e,"minute"):e>=f0e?Hpt(t,e,f0e,"second"):t+" ms"}a(Tsa,"fmtLong");function Hpt(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(Hpt,"plural")});var Lgr=I((cap,kli)=>{p();function Isa(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=Rli(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let P=r.formatters[x];if(typeof P=="function"){let D=E[T];R=P.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,E),(_.log||r.log).apply(_,E)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(E=>{m=E},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of h)m[0]==="-"?r.skips.push(m.slice(1)):r.names.push(m)}a(o,"enable");function s(f,h){let m=0,g=0,A=-1,y=0;for(;m"-"+h)].join(",");return r.enable(""),f}a(c,"disable");function l(f){for(let h of r.skips)if(s(f,h))return!1;for(let h of r.names)if(s(f,h))return!0;return!1}a(l,"enabled");function u(f){return f instanceof Error?f.stack||f.message:f}a(u,"coerce");function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return a(d,"destroy"),r.enable(r.load()),r}a(Isa,"setup");kli.exports=Isa});var Pli=I((Qb,Gpt)=>{p();Qb.formatArgs=wsa;Qb.save=Rsa;Qb.load=ksa;Qb.useColors=xsa;Qb.storage=Psa();Qb.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Qb.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function xsa(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(xsa,"useColors");function wsa(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Gpt.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(wsa,"formatArgs");Qb.log=console.debug||console.log||(()=>{});function Rsa(t){try{t?Qb.storage.setItem("debug",t):Qb.storage.removeItem("debug")}catch{}}a(Rsa,"save");function ksa(){let t;try{t=Qb.storage.getItem("debug")||Qb.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(ksa,"load");function Psa(){try{return localStorage}catch{}}a(Psa,"localstorage");Gpt.exports=Lgr()(Qb);var{formatters:Dsa}=Gpt.exports;Dsa.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Nli=I((jg,Vpt)=>{p();var Nsa=require("tty"),$pt=require("util");jg.init=Qsa;jg.log=Bsa;jg.formatArgs=Osa;jg.save=Fsa;jg.load=Usa;jg.useColors=Msa;jg.destroy=$pt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");jg.colors=[6,2,3,4,5,1];try{let t=LGe();t&&(t.stderr||t).level>=2&&(jg.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}jg.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function Msa(){return"colors"in jg.inspectOpts?!!jg.inspectOpts.colors:Nsa.isatty(process.stderr.fd)}a(Msa,"useColors");function Osa(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` +`)}setDiagnosticsData(e){this._fileDiagnostics=e}setTerminalData(e){this._terminalOutput=e}setLanguageContext(e){this._languageContext=e}toJSON(){return{requestId:this.requestId,time:this.time,filePath:this.filePath,version:this.version,statelessNextEditProviderId:this._statelessNextEditProviderId,nextEditRequest:this._nextEditRequest?.serialize(),diagnosticsResultEdit:this._diagnosticsResultEdit?.toString(),resultEdit:this._resultEdit?.toString(),isCachedResult:!!this._logContextOfCachedEdit,prompt:this.prompt,error:String(this.error),response:this.fullResponse,responseResults:rai.stringify(this._responseResults,null," "),providerStartTime:this.providerStartTime,providerEndTime:this.providerEndTime,fetchStartTime:this.fetchStartTime,fetchEndTime:this.fetchEndTime,logs:this._logs,isAccepted:this._isAccepted,languageContext:this._languageContext?(0,Xia.serializeLanguageContext)(this._languageContext):void 0,diagnostics:this._fileDiagnostics,terminalOutput:this._terminalOutput}}};C4.InlineEditRequestLogContext=rgr;function toa(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?t:t.slice(e+1)}a(toa,"basename")});var nai=I(fpt=>{"use strict";p();Object.defineProperty(fpt,"__esModule",{value:!0});fpt.GhostTextLogContext=void 0;var roa=dpt(),noa=LA(),ngr=class extends roa.InlineEditRequestLogContext{static{a(this,"GhostTextLogContext")}getDebugName(){return`Ghost | ${(0,noa.basename)(this.filePath)} (v${this.version})`}};fpt.GhostTextLogContext=ngr});var uG=I(a0e=>{"use strict";p();Object.defineProperty(a0e,"__esModule",{value:!0});a0e.CopilotTokenStore=a0e.ICopilotTokenStore=void 0;var ioa=nn(),ooa=Rc(),soa=Ro();a0e.ICopilotTokenStore=(0,ioa.createServiceIdentifier)("ICopilotTokenStore");var igr=class extends soa.Disposable{static{a(this,"CopilotTokenStore")}constructor(){super(...arguments),this._onDidStoreUpdate=this._register(new ooa.Emitter),this.onDidStoreUpdate=this._onDidStoreUpdate.event}get copilotToken(){return this._copilotToken}set copilotToken(e){let r=this._copilotToken?.token;this._copilotToken=e,r!==e?.token&&this._onDidStoreUpdate.fire()}};a0e.CopilotTokenStore=igr});var vm=I(uy=>{"use strict";p();var aoa=uy&&uy.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},coa=uy&&uy.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(uy,"__esModule",{value:!0});uy.TelemetryTrustedValue=uy.ITelemetryService=uy.TelemetryUserConfigImpl=uy.ITelemetryUserConfig=void 0;uy.createTrackingIdGetter=uoa;uy.multiplexProperties=foa;var iai=nn(),loa=uG();uy.ITelemetryUserConfig=(0,iai.createServiceIdentifier)("ITelemetryUserConfig");var ogr=class{static{a(this,"TelemetryUserConfigImpl")}constructor(e,r,n){this._tokenStore=n,this.trackingId=e,this.optedIn=r??!1,this.updateFromToken(this._tokenStore.copilotToken),this._tokenStore.onDidStoreUpdate(()=>{this.updateFromToken(this._tokenStore.copilotToken)})}updateFromToken(e){if(!e)return;let r=e.getTokenValue("rt")==="1",n=e.getTokenValue("tid");n!==void 0&&(this.trackingId=n,this.organizationsList=e.organizationList.toString(),this.enterpriseList=e.enterpriseList.toString(),this.optedIn=r)}};uy.TelemetryUserConfigImpl=ogr;uy.TelemetryUserConfigImpl=ogr=aoa([coa(2,loa.ICopilotTokenStore)],ogr);function uoa(t){let e=t.copilotToken?.getTokenValue("tid");return t.onDidStoreUpdate(()=>{let r=t.copilotToken?.getTokenValue("tid");r&&(e=r)}),()=>e}a(uoa,"createTrackingIdGetter");uy.ITelemetryService=(0,iai.createServiceIdentifier)("ITelemetryService");var sgr=class{static{a(this,"TelemetryTrustedValue")}constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};uy.TelemetryTrustedValue=sgr;var LMe=8192,doa=50;function foa(t){let e={...t};for(let r in t){let n=t[r],o=n?.length??0;if(o>LMe){let s=0,c=0;for(;o>0&&c1&&(l=r+"_"+(c<10?"0":"")+c);let u=s+LMe;o{"use strict";p();var poa=jo&&jo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hoa=jo&&jo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),moa=jo&&jo.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&poa(e,t,r);return hoa(e,t),e},agr=jo&&jo.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},cgr=jo&&jo.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var dgr=xee&&xee.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},fgr=xee&&xee.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]this.maxSizeBytes?[4,this._createBackupFile(r)]:[3,14];case 13:return u.sent(),[3,16];case 14:return[4,b4.appendFileAsync(this._fileFullPath,r)];case 15:u.sent(),u.label=16;case 16:return[3,18];case 17:return l=u.sent(),console.log(this.TAG,"Failed to create backup file: "+(l&&l.message)),[3,18];case 18:return[2]}})})},t.prototype._createBackupFile=function(e){return dgr(this,void 0,void 0,function(){var r,n,o;return fgr(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),[4,b4.readFileAsync(this._fileFullPath)];case 1:return r=s.sent(),n=Iee.join(this._tempDir,new Date().getTime()+"."+this._logFileName),[4,b4.writeFileAsync(n,r)];case 2:return s.sent(),[3,5];case 3:return o=s.sent(),console.log("Failed to generate backup log file",o),[3,5];case 4:return b4.writeFileAsync(this._fileFullPath,e),[7];case 5:return[2]}})})},t.prototype._fileCleanupTask=function(){return dgr(this,void 0,void 0,function(){var e,r,n,o,s,c=this;return fgr(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,b4.readdirAsync(this._tempDir)];case 1:e=l.sent(),e=e.filter(function(u){return Iee.basename(u).indexOf(c._backUpNameFormat)>-1}),e.sort(function(u,d){var f=new Date(parseInt(u.split(c._backUpNameFormat)[0])),h=new Date(parseInt(d.split(c._backUpNameFormat)[0]));if(f=h)return 1}),r=e.length,n=0,l.label=2;case 2:return n{"use strict";p();var lai=cai(),boa="APPLICATION_INSIGHTS_ENABLE_DEBUG_LOGS",Soa="APPLICATION_INSIGHTS_DISABLE_WARNING_LOGS",Toa=(function(){function t(){}return a(t,"Logging"),t.info=function(e){for(var r=[],n=1;n{Ioa.exports={}});var hpt=I(c0e=>{"use strict";p();var xoa=c0e&&c0e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(c0e,"__esModule",{value:!0});c0e.JsonConfig=void 0;var woa=require("fs"),ppt=require("path"),pgr=Jl(),Roa=xoa(dai()),koa="APPLICATIONINSIGHTS_CONFIGURATION_FILE",Poa="APPLICATIONINSIGHTS_CONNECTION_STRING",fai="APPSETTING_",pai="APPINSIGHTS_INSTRUMENTATIONKEY",hai="APPINSIGHTS_INSTRUMENTATION_KEY",Doa="APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC",Noa="APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS",Moa="http_proxy",Ooa="https_proxy",Loa="APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL",Boa="APPLICATION_INSIGHTS_NO_STATSBEAT",Foa="APPLICATION_INSIGHTS_NO_HTTP_AGENT_KEEP_ALIVE",Uoa="APPLICATION_INSIGHTS_NO_PATCH_MODULES",Qoa="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_ENABLED",qoa="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_CONNECTION_STRING",joa="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_SOURCE",Hoa="APPLICATIONINSIGHTS_WEB_SNIPPET_ENABLED",Goa="APPLICATIONINSIGHTS_WEB_SNIPPET_CONNECTION_STRING",$oa=(function(){function t(){this.connectionString=process.env[Poa],this.instrumentationKey=process.env[pai]||process.env[fai+pai]||process.env[hai]||process.env[fai+hai],!this.connectionString&&this.instrumentationKey&&pgr.warn("APPINSIGHTS_INSTRUMENTATIONKEY is in path of deprecation, please use APPLICATIONINSIGHTS_CONNECTION_STRING env variable to setup the SDK."),this.disableAllExtendedMetrics=!!process.env[Noa],this.extendedMetricDisablers=process.env[Doa],this.proxyHttpUrl=process.env[Moa],this.proxyHttpsUrl=process.env[Ooa],this.noDiagnosticChannel=!!process.env[Loa],this.disableStatsbeat=!!process.env[Boa],this.noHttpAgentKeepAlive=!!process.env[Foa],this.noPatchModules=process.env[Uoa]||"",this.enableWebInstrumentation=!!process.env[Qoa]||!!process.env[Hoa],this.webInstrumentationSrc=process.env[joa]||"",this.webInstrumentationConnectionString=process.env[qoa]||process.env[Goa]||"",this.enableAutoWebSnippetInjection=this.enableWebInstrumentation,this.webSnippetConnectionString=this.webInstrumentationConnectionString,this._loadJsonFile()}return a(t,"JsonConfig"),t.getInstance=function(){return t._instance||(t._instance=new t),t._instance},t.prototype._loadJsonFile=function(){var e="",r=process.env.APPLICATIONINSIGHTS_CONFIGURATION_CONTENT;if(r)e=r;else{var n="applicationinsights.json",o=ppt.join(__dirname,"../../");this._tempDir=ppt.join(o,n);var s=process.env[koa];if(s){ppt.isAbsolute(s)?this._tempDir=s:this._tempDir=ppt.join(o,s);try{e=woa.readFileSync(this._tempDir,"utf8")}catch(l){pgr.warn("Failed to read JSON config file: ",l)}}else e=JSON.stringify(Roa.default)}try{var c=JSON.parse(e);c.disableStatsbeat!=null&&(this.disableStatsbeat=c.disableStatsbeat),c.disableAllExtendedMetrics!=null&&(this.disableAllExtendedMetrics=c.disableStatsbeat),c.noDiagnosticChannel!=null&&(this.noDiagnosticChannel=c.noDiagnosticChannel),c.noHttpAgentKeepAlive!=null&&(this.noHttpAgentKeepAlive=c.noHttpAgentKeepAlive),c.connectionString!=null&&(this.connectionString=c.connectionString),c.extendedMetricDisablers!=null&&(this.extendedMetricDisablers=c.extendedMetricDisablers),c.noDiagnosticChannel!=null&&(this.noDiagnosticChannel=c.noDiagnosticChannel),c.proxyHttpUrl!=null&&(this.proxyHttpUrl=c.proxyHttpUrl),c.proxyHttpsUrl!=null&&(this.proxyHttpsUrl=c.proxyHttpsUrl),c.proxyHttpsUrl!=null&&(this.proxyHttpsUrl=c.proxyHttpsUrl),c.noPatchModules!=null&&(this.noPatchModules=c.noPatchModules),c.enableAutoWebSnippetInjection!=null&&(this.enableWebInstrumentation=c.enableAutoWebSnippetInjection,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation),c.enableWebInstrumentation!=null&&(this.enableWebInstrumentation=c.enableWebInstrumentation,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation),c.webSnippetConnectionString!=null&&(this.webInstrumentationConnectionString=c.webSnippetConnectionString,this.webSnippetConnectionString=this.webInstrumentationConnectionString),c.webInstrumentationConnectionString!=null&&(this.webInstrumentationConnectionString=c.webInstrumentationConnectionString,this.webSnippetConnectionString=this.webInstrumentationConnectionString),c.webInstrumentationConfig!=null&&(this.webInstrumentationConfig=c.webInstrumentationConfig),c.webInstrumentationSrc!=null&&(this.webInstrumentationSrc=c.webInstrumentationSrc),c.enableLoggerErrorToTrace!=null&&(this.enableLoggerErrorToTrace=c.enableLoggerErrorToTrace),this.endpointUrl=c.endpointUrl,this.maxBatchSize=c.maxBatchSize,this.maxBatchIntervalMs=c.maxBatchIntervalMs,this.disableAppInsights=c.disableAppInsights,this.samplingPercentage=c.samplingPercentage,this.correlationIdRetryIntervalMs=c.correlationIdRetryIntervalMs,this.correlationHeaderExcludedDomains=c.correlationHeaderExcludedDomains,this.ignoreLegacyHeaders=c.ignoreLegacyHeaders,this.distributedTracingMode=c.distributedTracingMode,this.enableAutoCollectExternalLoggers=c.enableAutoCollectExternalLoggers,this.enableAutoCollectConsole=c.enableAutoCollectConsole,this.enableLoggerErrorToTrace=c.enableLoggerErrorToTrace,this.enableAutoCollectExceptions=c.enableAutoCollectExceptions,this.enableAutoCollectPerformance=c.enableAutoCollectPerformance,this.enableAutoCollectExtendedMetrics=c.enableAutoCollectExtendedMetrics,this.enableAutoCollectPreAggregatedMetrics=c.enableAutoCollectPreAggregatedMetrics,this.enableAutoCollectHeartbeat=c.enableAutoCollectHeartbeat,this.enableAutoCollectRequests=c.enableAutoCollectRequests,this.enableAutoCollectDependencies=c.enableAutoCollectDependencies,this.enableAutoDependencyCorrelation=c.enableAutoDependencyCorrelation,this.enableAutoCollectIncomingRequestAzureFunctions=c.enableAutoCollectIncomingRequestAzureFunctions,this.enableUseAsyncHooks=c.enableUseAsyncHooks,this.enableUseDiskRetryCaching=c.enableUseDiskRetryCaching,this.enableResendInterval=c.enableResendInterval,this.enableMaxBytesOnDisk=c.enableMaxBytesOnDisk,this.enableInternalDebugLogging=c.enableInternalDebugLogging,this.enableInternalWarningLogging=c.enableInternalWarningLogging,this.enableSendLiveMetrics=c.enableSendLiveMetrics,this.quickPulseHost=c.quickPulseHost}catch(l){pgr.warn("Invalid JSON config file: ",l)}},t})();c0e.JsonConfig=$oa});var hgr=I(mpt=>{"use strict";p();Object.defineProperty(mpt,"__esModule",{value:!0});mpt.makePatchingRequire=void 0;var Voa=require("path"),Woa=IP(),mai=Tp(),Aai=require("module"),zoa=Object.keys(process.binding("natives")),gai=Aai.prototype.require;function Yoa(t){var e={};return a(function(n){var o=gai.apply(this,arguments);if(t[n]){var s=Aai._resolveFilename(n,this);if(e.hasOwnProperty(s))return e[s];var c=void 0;if(zoa.indexOf(n)<0)try{c=gai.call(this,Voa.join(n,"package.json")).version}catch{return o}else c=process.version.substring(1);var l=c.indexOf("-");l>=0&&(c=c.substring(0,l));for(var u=o,d=0,f=t[n];d{Koa.exports={name:"diagnostic-channel",version:"1.1.1",main:"./dist/src/channel.js",types:"./dist/src/channel.d.ts",scripts:{build:"tsc",lint:"eslint ./ --fix",clean:"rimraf ./dist",test:"mocha ./dist/tests/**/*.js",debug:"mocha --inspect-brk ./dist/tests/**/*.js"},homepage:"https://github.com/Microsoft/node-diagnostic-channel",bugs:{url:"https://github.com/Microsoft/node-diagnostic-channel/issues"},repository:{type:"git",url:"https://github.com/Microsoft/node-diagnostic-channel.git"},description:"Provides a context-saving pub/sub channel to connect diagnostic event publishers and subscribers",dependencies:{semver:"^7.5.3"},devDependencies:{"@types/mocha":"^2.2.40","@types/node":"~8.0.0",mocha:"^3.2.0",rimraf:"^2.6.1",sinon:"1.17.6",typescript:"4.1.2"},files:["dist/src/**/*.d.ts","dist/src/**/*.js","LICENSE","README.md","package.json"],license:"MIT"}});var Tp=I(_R=>{"use strict";p();Object.defineProperty(_R,"__esModule",{value:!0});_R.channel=_R.ContextPreservingEventEmitter=_R.trueFilter=_R.makePatchingRequire=void 0;var Joa=hgr(),Zoa=hgr();Object.defineProperty(_R,"makePatchingRequire",{enumerable:!0,get:a(function(){return Zoa.makePatchingRequire},"get")});var Xoa=a(function(t){return!0},"trueFilter");_R.trueFilter=Xoa;var _ai=(function(){function t(){this.version=yai().version,this.subscribers={},this.contextPreservationFunction=function(e){return e},this.knownPatches={},this.modulesPatched=[],this.currentlyPublishing=!1}return a(t,"ContextPreservingEventEmitter"),t.prototype.shouldPublish=function(e){var r=this.subscribers[e];return r?r.some(function(n){var o=n.filter;return!o||o(!1)}):!1},t.prototype.publish=function(e,r){if(!this.currentlyPublishing){var n=this.subscribers[e];if(n){var o={timestamp:Date.now(),data:r};this.currentlyPublishing=!0,n.forEach(function(s){var c=s.listener,l=s.filter;try{l&&l(!0)&&c(o)}catch{}}),this.currentlyPublishing=!1}}},t.prototype.subscribe=function(e,r,n,o){n===void 0&&(n=_R.trueFilter),this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push({listener:r,filter:n,patchCallback:o});var s=this.checkIfModuleIsAlreadyPatched(e);s&&o&&o(s.name,s.version)},t.prototype.unsubscribe=function(e,r,n){n===void 0&&(n=_R.trueFilter);var o=this.subscribers[e];if(o){for(var s=0;s{p();vai=typeof globalThis=="object"?globalThis:global});var bai=Se(()=>{p();Cai()});var Sai=Se(()=>{p();bai()});var H8,mgr=Se(()=>{p();H8="1.9.0"});function esa(t){var e=new Set([t]),r=new Set,n=t.match(Tai);if(!n)return function(){return!1};var o={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(o.prerelease!=null)return a(function(u){return u===t},"isExactmatch");function s(l){return r.add(l),!1}a(s,"_reject");function c(l){return e.add(l),!0}return a(c,"_accept"),a(function(u){if(e.has(u))return!0;if(r.has(u))return!1;var d=u.match(Tai);if(!d)return s(u);var f={major:+d[1],minor:+d[2],patch:+d[3],prerelease:d[4]};return f.prerelease!=null||o.major!==f.major?s(u):o.major===0?o.minor===f.minor&&o.patch<=f.patch?c(u):s(u):o.minor<=f.minor?c(u):s(u)},"isCompatible")}var Tai,Iai,xai=Se(()=>{p();mgr();Tai=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;a(esa,"_makeCompatibilityCheck");Iai=esa(H8)});function S4(t,e,r,n){var o;n===void 0&&(n=!1);var s=FMe[BMe]=(o=FMe[BMe])!==null&&o!==void 0?o:{version:H8};if(!n&&s[t]){var c=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(c.stack||c.message),!1}if(s.version!==H8){var c=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+H8);return r.error(c.stack||c.message),!1}return s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+H8+"."),!0}function zT(t){var e,r,n=(e=FMe[BMe])===null||e===void 0?void 0:e.version;if(!(!n||!Iai(n)))return(r=FMe[BMe])===null||r===void 0?void 0:r[t]}function T4(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+H8+".");var r=FMe[BMe];r&&delete r[t]}var tsa,BMe,FMe,wee=Se(()=>{p();Sai();mgr();xai();tsa=H8.split(".")[0],BMe=Symbol.for("opentelemetry.js.api."+tsa),FMe=vai;a(S4,"registerGlobal");a(zT,"getGlobal");a(T4,"unregisterGlobal")});function UMe(t,e,r){var n=zT("diag");if(n)return r.unshift(e),n[t].apply(n,nsa([],rsa(r),!1))}var rsa,nsa,wai,Rai=Se(()=>{p();wee();rsa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},nsa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(Na||(Na={}))});function kai(t,e){tNa.ALL&&(t=Na.ALL),e=e||{};function r(n,o){var s=e[n];return typeof s=="function"&&t>=o?s.bind(e):function(){}}return a(r,"_filterFunc"),{error:r("error",Na.ERROR),warn:r("warn",Na.WARN),info:r("info",Na.INFO),debug:r("debug",Na.DEBUG),verbose:r("verbose",Na.VERBOSE)}}var Pai=Se(()=>{p();gpt();a(kai,"createLogLevelDiagLogger")});var isa,osa,ssa,LE,Ree=Se(()=>{p();Rai();Pai();gpt();wee();isa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},osa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n";f.warn("Current logger will be overwritten from "+m),h.warn("Current logger will overwrite one already registered from "+m)}return S4("diag",h,r,!0)},"setLogger");r.setLogger=n,r.disable=function(){T4(ssa,r)},r.createComponentLogger=function(o){return new wai(o)},r.verbose=e("verbose"),r.debug=e("debug"),r.info=e("info"),r.warn=e("warn"),r.error=e("error")}return a(t,"DiagAPI"),t.instance=function(){return this._instance||(this._instance=new t),this._instance},t})()});var asa,csa,Dai,Nai=Se(()=>{p();asa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},csa=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Dai=(function(){function t(e){this._entries=e?new Map(e):new Map}return a(t,"BaggageImpl"),t.prototype.getEntry=function(e){var r=this._entries.get(e);if(r)return Object.assign({},r)},t.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var r=asa(e,2),n=r[0],o=r[1];return[n,o]})},t.prototype.setEntry=function(e,r){var n=new t(this._entries);return n._entries.set(e,r),n},t.prototype.removeEntry=function(e){var r=new t(this._entries);return r._entries.delete(e),r},t.prototype.removeEntries=function(){for(var e,r,n=[],o=0;o{p();Mai=Symbol("BaggageEntryMetadata")});function Lai(t){return t===void 0&&(t={}),new Dai(new Map(Object.entries(t)))}function l0e(t){return typeof t!="string"&&(lsa.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:Mai,toString:a(function(){return t},"toString")}}var lsa,ggr=Se(()=>{p();Ree();Nai();Oai();lsa=LE.instance();a(Lai,"createBaggage");a(l0e,"baggageEntryMetadataFromString")});function Fb(t){return Symbol.for(t)}var usa,Apt,QMe=Se(()=>{p();a(Fb,"createContextKey");usa=(function(){function t(e){var r=this;r._currentContext=e?new Map(e):new Map,r.getValue=function(n){return r._currentContext.get(n)},r.setValue=function(n,o){var s=new t(r._currentContext);return s._currentContext.set(n,o),s},r.deleteValue=function(n){var o=new t(r._currentContext);return o._currentContext.delete(n),o}}return a(t,"BaseContext"),t})(),Apt=new usa});var Agr,Bai,Fai=Se(()=>{p();Agr=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],Bai=(function(){function t(){function e(n){return function(){for(var o=[],s=0;s{p();kee=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),dsa=(function(){function t(){}return a(t,"NoopMeter"),t.prototype.createGauge=function(e,r){return _sa},t.prototype.createHistogram=function(e,r){return vsa},t.prototype.createCounter=function(e,r){return Esa},t.prototype.createUpDownCounter=function(e,r){return Csa},t.prototype.createObservableGauge=function(e,r){return Ssa},t.prototype.createObservableCounter=function(e,r){return bsa},t.prototype.createObservableUpDownCounter=function(e,r){return Tsa},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),ypt=(function(){function t(){}return a(t,"NoopMetric"),t})(),fsa=(function(t){kee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopCounterMetric"),e.prototype.add=function(r,n){},e})(ypt),psa=(function(t){kee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopUpDownCounterMetric"),e.prototype.add=function(r,n){},e})(ypt),hsa=(function(t){kee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopGaugeMetric"),e.prototype.record=function(r,n){},e})(ypt),msa=(function(t){kee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopHistogramMetric"),e.prototype.record=function(r,n){},e})(ypt),ygr=(function(){function t(){}return a(t,"NoopObservableMetric"),t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),gsa=(function(t){kee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableCounterMetric"),e})(ygr),Asa=(function(t){kee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableGaugeMetric"),e})(ygr),ysa=(function(t){kee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableUpDownCounterMetric"),e})(ygr),Egr=new dsa,Esa=new fsa,_sa=new hsa,vsa=new msa,Csa=new psa,bsa=new gsa,Ssa=new Asa,Tsa=new ysa;a(Uai,"createNoopMeter")});var Ept,Qai=Se(()=>{p();(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(Ept||(Ept={}))});var _pt,vpt,vgr=Se(()=>{p();_pt={get:a(function(t,e){if(t!=null)return t[e]},"get"),keys:a(function(t){return t==null?[]:Object.keys(t)},"keys")},vpt={set:a(function(t,e,r){t!=null&&(t[e]=r)},"set")}});var Isa,xsa,qai,jai=Se(()=>{p();QMe();Isa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},xsa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();jai();wee();Ree();wsa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},Rsa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(Nf||(Nf={}))});var jMe,HMe,u0e,Cpt=Se(()=>{p();bgr();jMe="0000000000000000",HMe="00000000000000000000000000000000",u0e={traceId:HMe,spanId:jMe,traceFlags:Nf.NONE}});var fG,bpt=Se(()=>{p();Cpt();fG=(function(){function t(e){e===void 0&&(e=u0e),this._spanContext=e}return a(t,"NonRecordingSpan"),t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(e,r){return this},t.prototype.setAttributes=function(e){return this},t.prototype.addEvent=function(e,r){return this},t.prototype.addLink=function(e){return this},t.prototype.addLinks=function(e){return this},t.prototype.setStatus=function(e){return this},t.prototype.updateName=function(e){return this},t.prototype.end=function(e){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(e,r){},t})()});function Spt(t){return t.getValue(Sgr)||void 0}function Hai(){return Spt(dG.getInstance().active())}function GMe(t,e){return t.setValue(Sgr,e)}function Gai(t){return t.deleteValue(Sgr)}function $ai(t,e){return GMe(t,new fG(e))}function Tpt(t){var e;return(e=Spt(t))===null||e===void 0?void 0:e.spanContext()}var Sgr,Tgr=Se(()=>{p();QMe();bpt();qMe();Sgr=Fb("OpenTelemetry Context Key SPAN");a(Spt,"getSpan");a(Hai,"getActiveSpan");a(GMe,"setSpan");a(Gai,"deleteSpan");a($ai,"setSpanContext");a(Tpt,"getSpanContext")});function Pee(t){return Psa.test(t)&&t!==HMe}function Igr(t){return Dsa.test(t)&&t!==jMe}function Ub(t){return Pee(t.traceId)&&Igr(t.spanId)}function Vai(t){return new fG(t)}var Psa,Dsa,Ipt=Se(()=>{p();Cpt();bpt();Psa=/^([0-9a-f]{32})$/i,Dsa=/^[0-9a-f]{16}$/i;a(Pee,"isValidTraceId");a(Igr,"isValidSpanId");a(Ub,"isSpanContextValid");a(Vai,"wrapSpanContext")});function Nsa(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var xgr,xpt,wgr=Se(()=>{p();qMe();Tgr();bpt();Ipt();xgr=dG.getInstance(),xpt=(function(){function t(){}return a(t,"NoopTracer"),t.prototype.startSpan=function(e,r,n){n===void 0&&(n=xgr.active());var o=!!r?.root;if(o)return new fG;var s=n&&Tpt(n);return Nsa(s)&&Ub(s)?new fG(s):new fG},t.prototype.startActiveSpan=function(e,r,n,o){var s,c,l;if(!(arguments.length<2)){arguments.length===2?l=r:arguments.length===3?(s=r,l=n):(s=r,c=n,l=o);var u=c??xgr.active(),d=this.startSpan(e,s,u),f=GMe(u,d);return xgr.with(f,l,void 0,d)}},t})();a(Nsa,"isSpanContext")});var Msa,wpt,Rgr=Se(()=>{p();wgr();Msa=new xpt,wpt=(function(){function t(e,r,n,o){this._provider=e,this.name=r,this.version=n,this.options=o}return a(t,"ProxyTracer"),t.prototype.startSpan=function(e,r,n){return this._getTracer().startSpan(e,r,n)},t.prototype.startActiveSpan=function(e,r,n,o){var s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)},t.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Msa},t})()});var Wai,zai=Se(()=>{p();wgr();Wai=(function(){function t(){}return a(t,"NoopTracerProvider"),t.prototype.getTracer=function(e,r,n){return new xpt},t})()});var Osa,$Me,kgr=Se(()=>{p();Rgr();zai();Osa=new Wai,$Me=(function(){function t(){}return a(t,"ProxyTracerProvider"),t.prototype.getTracer=function(e,r,n){var o;return(o=this.getDelegateTracer(e,r,n))!==null&&o!==void 0?o:new wpt(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Osa},t.prototype.setDelegate=function(e){this._delegate=e},t.prototype.getDelegateTracer=function(e,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(e,r,n)},t})()});var Qb,Yai=Se(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Qb||(Qb={}))});var d0e,Kai=Se(()=>{p();(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(d0e||(d0e={}))});var f0e,Jai=Se(()=>{p();(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(f0e||(f0e={}))});function Zai(t){return Fsa.test(t)}function Xai(t){return Usa.test(t)&&!Qsa.test(t)}var Pgr,Lsa,Bsa,Fsa,Usa,Qsa,eci=Se(()=>{p();Pgr="[_0-9a-z-*/]",Lsa="[a-z]"+Pgr+"{0,255}",Bsa="[a-z0-9]"+Pgr+"{0,240}@[a-z]"+Pgr+"{0,13}",Fsa=new RegExp("^(?:"+Lsa+"|"+Bsa+")$"),Usa=/^[ -~]{0,255}[!-~]$/,Qsa=/,|=/;a(Zai,"validateKey");a(Xai,"validateValue")});var tci,qsa,rci,nci,ici,oci=Se(()=>{p();eci();tci=32,qsa=512,rci=",",nci="=",ici=(function(){function t(e){this._internalState=new Map,e&&this._parse(e)}return a(t,"TraceStateImpl"),t.prototype.set=function(e,r){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n},t.prototype.unset=function(e){var r=this._clone();return r._internalState.delete(e),r},t.prototype.get=function(e){return this._internalState.get(e)},t.prototype.serialize=function(){var e=this;return this._keys().reduce(function(r,n){return r.push(n+nci+e.get(n)),r},[]).join(rci)},t.prototype._parse=function(e){e.length>qsa||(this._internalState=e.split(rci).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(nci);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);Zai(c)&&Xai(l)&&r.set(c,l)}return r},new Map),this._internalState.size>tci&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,tci))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t})()});function sci(t){return new ici(t)}var aci=Se(()=>{p();oci();a(sci,"createTraceState")});var $g,cci=Se(()=>{p();qMe();$g=dG.getInstance()});var Dn,lci=Se(()=>{p();Ree();Dn=LE.instance()});var jsa,uci,dci=Se(()=>{p();_gr();jsa=(function(){function t(){}return a(t,"NoopMeterProvider"),t.prototype.getMeter=function(e,r,n){return Egr},t})(),uci=new jsa});var Dgr,fci,pci=Se(()=>{p();dci();wee();Ree();Dgr="metrics",fci=(function(){function t(){}return a(t,"MetricsAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(e){return S4(Dgr,e,LE.instance())},t.prototype.getMeterProvider=function(){return zT(Dgr)||uci},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){T4(Dgr,LE.instance())},t})()});var Dee,hci=Se(()=>{p();pci();Dee=fci.getInstance()});var mci,gci=Se(()=>{p();mci=(function(){function t(){}return a(t,"NoopTextMapPropagator"),t.prototype.inject=function(e,r){},t.prototype.extract=function(e,r){return e},t.prototype.fields=function(){return[]},t})()});function Mgr(t){return t.getValue(Ngr)||void 0}function Aci(){return Mgr(dG.getInstance().active())}function yci(t,e){return t.setValue(Ngr,e)}function Eci(t){return t.deleteValue(Ngr)}var Ngr,_ci=Se(()=>{p();qMe();QMe();Ngr=Fb("OpenTelemetry Baggage Key");a(Mgr,"getBaggage");a(Aci,"getActiveBaggage");a(yci,"setBaggage");a(Eci,"deleteBaggage")});var Ogr,Hsa,vci,Cci=Se(()=>{p();wee();gci();vgr();_ci();ggr();Ree();Ogr="propagation",Hsa=new mci,vci=(function(){function t(){this.createBaggage=Lai,this.getBaggage=Mgr,this.getActiveBaggage=Aci,this.setBaggage=yci,this.deleteBaggage=Eci}return a(t,"PropagationAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return S4(Ogr,e,LE.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=vpt),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=_pt),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){T4(Ogr,LE.instance())},t.prototype._getGlobalPropagator=function(){return zT(Ogr)||Hsa},t})()});var YT,bci=Se(()=>{p();Cci();YT=vci.getInstance()});var Lgr,Sci,Tci=Se(()=>{p();wee();kgr();Ipt();Tgr();Ree();Lgr="trace",Sci=(function(){function t(){this._proxyTracerProvider=new $Me,this.wrapSpanContext=Vai,this.isSpanContextValid=Ub,this.deleteSpan=Gai,this.getSpan=Spt,this.getActiveSpan=Hai,this.getSpanContext=Tpt,this.setSpan=GMe,this.setSpanContext=$ai}return a(t,"TraceAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=S4(Lgr,this._proxyTracerProvider,LE.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return zT(Lgr)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){T4(Lgr,LE.instance()),this._proxyTracerProvider=new $Me},t})()});var Pu,Ici=Se(()=>{p();Tci();Pu=Sci.getInstance()});var G8={};Ri(G8,{DiagConsoleLogger:()=>Bai,DiagLogLevel:()=>Na,INVALID_SPANID:()=>jMe,INVALID_SPAN_CONTEXT:()=>u0e,INVALID_TRACEID:()=>HMe,ProxyTracer:()=>wpt,ProxyTracerProvider:()=>$Me,ROOT_CONTEXT:()=>Apt,SamplingDecision:()=>Qb,SpanKind:()=>d0e,SpanStatusCode:()=>f0e,TraceFlags:()=>Nf,ValueType:()=>Ept,baggageEntryMetadataFromString:()=>l0e,context:()=>$g,createContextKey:()=>Fb,createNoopMeter:()=>Uai,createTraceState:()=>sci,default:()=>Gsa,defaultTextMapGetter:()=>_pt,defaultTextMapSetter:()=>vpt,diag:()=>Dn,isSpanContextValid:()=>Ub,isValidSpanId:()=>Igr,isValidTraceId:()=>Pee,metrics:()=>Dee,propagation:()=>YT,trace:()=>Pu});var Gsa,po=Se(()=>{p();ggr();QMe();Fai();gpt();_gr();Qai();vgr();Rgr();kgr();Yai();Kai();Jai();bgr();aci();Ipt();Cpt();cci();lci();hci();bci();Ici();Gsa={context:$g,diag:Dn,metrics:Dee,propagation:YT,trace:Pu}});function p0e(t){return t.setValue(Bgr,!0)}function xci(t){return t.deleteValue(Bgr)}function pG(t){return t.getValue(Bgr)===!0}var Bgr,VMe=Se(()=>{p();po();Bgr=Fb("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(p0e,"suppressTracing");a(xci,"unsuppressTracing");a(pG,"isTracingSuppressed")});var wci,Rpt,h0e,kpt,Rci,kci,Pci,Fgr=Se(()=>{p();wci="=",Rpt=";",h0e=",",kpt="baggage",Rci=180,kci=4096,Pci=8192});function Ppt(t){return t.reduce(function(e,r){var n=""+e+(e!==""?h0e:"")+r;return n.length>Pci?e:n},"")}function Dpt(t){return t.getAllEntries().map(function(e){var r=$sa(e,2),n=r[0],o=r[1],s=encodeURIComponent(n)+"="+encodeURIComponent(o.value);return o.metadata!==void 0&&(s+=Rpt+o.metadata.toString()),s})}function WMe(t){var e=t.split(Rpt);if(!(e.length<=0)){var r=e.shift();if(r){var n=r.indexOf(wci);if(!(n<=0)){var o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=l0e(e.join(Rpt))),{key:o,value:s,metadata:c}}}}}function Dci(t){return typeof t!="string"||t.length===0?{}:t.split(h0e).map(function(e){return WMe(e)}).filter(function(e){return e!==void 0&&e.value.length>0}).reduce(function(e,r){return e[r.key]=r.value,e},{})}var $sa,Ugr=Se(()=>{p();po();Fgr();$sa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s};a(Ppt,"serializeKeyPairs");a(Dpt,"getKeyPairs");a(WMe,"parsePairKeyValue");a(Dci,"parseKeyPairsIntoRecord")});var Npt,Nci=Se(()=>{p();po();VMe();Fgr();Ugr();Npt=(function(){function t(){}return a(t,"W3CBaggagePropagator"),t.prototype.inject=function(e,r,n){var o=YT.getBaggage(e);if(!(!o||pG(e))){var s=Dpt(o).filter(function(l){return l.length<=kci}).slice(0,Rci),c=Ppt(s);c.length>0&&n.set(r,kpt,c)}},t.prototype.extract=function(e,r,n){var o=n.get(r,kpt),s=Array.isArray(o)?o.join(h0e):o;if(!s)return e;var c={};if(s.length===0)return e;var l=s.split(h0e);return l.forEach(function(u){var d=WMe(u);if(d){var f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0?e:YT.setBaggage(e,YT.createBaggage(c))},t.prototype.fields=function(){return[kpt]},t})()});var Mci,Oci=Se(()=>{p();Mci=(function(){function t(e,r){this._monotonicClock=r,this._epochMillis=e.now(),this._performanceMillis=r.now()}return a(t,"AnchoredClock"),t.prototype.now=function(){var e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e},t})()});function hG(t){var e,r,n={};if(typeof t!="object"||t==null)return n;try{for(var o=Lci(Object.entries(t)),s=o.next();!s.done;s=o.next()){var c=Vsa(s.value,2),l=c[0],u=c[1];if(!Qgr(l)){Dn.warn("Invalid attribute key: "+l);continue}if(!zMe(u)){Dn.warn("Invalid attribute value set for key: "+l);continue}Array.isArray(u)?n[l]=u.slice():n[l]=u}}catch(d){e={error:d}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n}function Qgr(t){return typeof t=="string"&&t.length>0}function zMe(t){return t==null?!0:Array.isArray(t)?Wsa(t):Bci(t)}function Wsa(t){var e,r,n;try{for(var o=Lci(t),s=o.next();!s.done;s=o.next()){var c=s.value;if(c!=null){if(!n){if(Bci(c)){n=typeof c;continue}return!1}if(typeof c!==n)return!1}}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return!0}function Bci(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}var Lci,Vsa,Fci=Se(()=>{p();po();Lci=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Vsa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s};a(hG,"sanitizeAttributes");a(Qgr,"isAttributeKey");a(zMe,"isAttributeValue");a(Wsa,"isHomogeneousAttributeValueArray");a(Bci,"isValidPrimitiveAttributeValue")});function Mpt(){return function(t){Dn.error(zsa(t))}}function zsa(t){return typeof t=="string"?t:JSON.stringify(Ysa(t))}function Ysa(t){for(var e={},r=t;r!==null;)Object.getOwnPropertyNames(r).forEach(function(n){if(!e[n]){var o=r[n];o&&(e[n]=String(o))}}),r=Object.getPrototypeOf(r);return e}var qgr=Se(()=>{p();po();a(Mpt,"loggingErrorHandler");a(zsa,"stringifyException");a(Ysa,"flattenException")});function Qci(t){Uci=t}function Cv(t){try{Uci(t)}catch{}}var Uci,jgr=Se(()=>{p();qgr();Uci=Mpt();a(Qci,"setGlobalErrorHandler");a(Cv,"globalErrorHandler")});var qb,Hgr=Se(()=>{p();(function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"})(qb||(qb={}))});function Zsa(t){return Jsa.indexOf(t)>-1}function eaa(t){return Xsa.indexOf(t)>-1}function raa(t){return taa.indexOf(t)>-1}function naa(t,e,r){if(!(typeof r[t]>"u")){var n=String(r[t]);e[t]=n.toLowerCase()==="true"}}function iaa(t,e,r,n,o){if(n===void 0&&(n=-1/0),o===void 0&&(o=1/0),typeof r[t]<"u"){var s=Number(r[t]);isNaN(s)||(so?e[t]=o:e[t]=s)}}function oaa(t,e,r,n){n===void 0&&(n=Ksa);var o=r[t];typeof o=="string"&&(e[t]=o.split(n).map(function(s){return s.trim()}))}function aaa(t,e,r){var n=r[t];if(typeof n=="string"){var o=saa[n.toUpperCase()];o!=null&&(e[t]=o)}}function KMe(t){var e={};for(var r in YMe){var n=r;switch(n){case"OTEL_LOG_LEVEL":aaa(n,e,t);break;default:if(Zsa(n))naa(n,e,t);else if(eaa(n))iaa(n,e,t);else if(raa(n))oaa(n,e,t);else{var o=t[n];typeof o<"u"&&o!==null&&(e[n]=String(o))}}}return e}var Ksa,Jsa,Xsa,taa,Nee,Mee,Ggr,$gr,YMe,saa,Vgr=Se(()=>{p();po();Hgr();Ksa=",",Jsa=["OTEL_SDK_DISABLED"];a(Zsa,"isEnvVarABoolean");Xsa=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];a(eaa,"isEnvVarANumber");taa=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];a(raa,"isEnvVarAList");Nee=1/0,Mee=128,Ggr=128,$gr=128,YMe={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:Na.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:Nee,OTEL_ATTRIBUTE_COUNT_LIMIT:Mee,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:Nee,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Mee,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:Nee,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Mee,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:Ggr,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:$gr,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:qb.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};a(naa,"parseBoolean");a(iaa,"parseNumber");a(oaa,"parseStringList");saa={ALL:Na.ALL,VERBOSE:Na.VERBOSE,DEBUG:Na.DEBUG,INFO:Na.INFO,WARN:Na.WARN,ERROR:Na.ERROR,NONE:Na.NONE};a(aaa,"setLogLevelFromEnv");a(KMe,"parseEnvironment")});function vR(){var t=KMe(process.env);return Object.assign({},YMe,t)}function m0e(){return KMe(process.env)}var qci=Se(()=>{p();Vgr();a(vR,"getEnv");a(m0e,"getEnvWithoutDefaults")});var Opt,jci=Se(()=>{p();Opt=typeof globalThis=="object"?globalThis:global});function Hci(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function Lpt(t){for(var e=new Uint8Array(t.length/2),r=0,n=0;n{p();a(Hci,"intValue");a(Lpt,"hexToBinary")});function Bpt(t){return Buffer.from(Lpt(t)).toString("base64")}var Gci=Se(()=>{p();Wgr();a(Bpt,"hexToBase64")});function $ci(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(Fpt[t-1]=1);return Fpt.toString("hex",0,t)},"generateId")}var caa,Vci,Upt,Fpt,Wci=Se(()=>{p();caa=8,Vci=16,Upt=(function(){function t(){this.generateTraceId=$ci(Vci),this.generateSpanId=$ci(caa)}return a(t,"RandomIdGenerator"),t})(),Fpt=Buffer.allocUnsafe(Vci);a($ci,"getIdGenerator")});var zci,CR,Yci=Se(()=>{p();zci=require("perf_hooks"),CR=zci.performance});var Qpt,zgr=Se(()=>{p();Qpt="1.30.1"});var Kci=Se(()=>{p()});var Jci=Se(()=>{p();Kci()});var laa,uaa,daa,faa,Zci,Xci,eli,tli,paa,rli,nli=Se(()=>{p();laa="process.runtime.name",uaa="telemetry.sdk.name",daa="telemetry.sdk.language",faa="telemetry.sdk.version",Zci=laa,Xci=uaa,eli=daa,tli=faa,paa="nodejs",rli=paa});var ili=Se(()=>{p();nli()});var oli=Se(()=>{p()});var sli=Se(()=>{p()});var ali=Se(()=>{p();Jci();ili();oli();sli()});var g0e,mG,cli=Se(()=>{p();zgr();ali();mG=(g0e={},g0e[Xci]="opentelemetry",g0e[Zci]="node",g0e[eli]=rli,g0e[tli]=Qpt,g0e)});function A0e(t){t.unref()}var lli=Se(()=>{p();a(A0e,"unrefTimer")});var uli=Se(()=>{p();qci();jci();Gci();Wci();Yci();cli();lli()});var Ygr=Se(()=>{p();uli()});function cD(t){var e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*maa);return[r,n]}function y0e(){var t=CR.timeOrigin;if(typeof t!="number"){var e=CR;t=e.timing&&e.timing.fetchStart}return t}function JMe(t){var e=cD(y0e()),r=cD(typeof t=="number"?t:CR.now());return eOe(e,r)}function fli(t){if(E0e(t))return t;if(typeof t=="number")return t=qpt&&(r[1]-=qpt,r[0]+=1),r}var dli,haa,maa,qpt,gli=Se(()=>{p();Ygr();dli=9,haa=6,maa=Math.pow(10,haa),qpt=Math.pow(10,dli);a(cD,"millisToHrTime");a(y0e,"getTimeOrigin");a(JMe,"hrTime");a(fli,"timeInputToHrTime");a(jpt,"hrTimeDuration");a(pli,"hrTimeToTimeStamp");a(hli,"hrTimeToNanoseconds");a(mli,"hrTimeToMilliseconds");a(ZMe,"hrTimeToMicroseconds");a(E0e,"isTimeInputHrTime");a(XMe,"isTimeInput");a(eOe,"addHrTimes")});var KT,Ali=Se(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(KT||(KT={}))});var gaa,Hpt,yli=Se(()=>{p();po();gaa=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Hpt=(function(){function t(e){e===void 0&&(e={});var r;this._propagators=(r=e.propagators)!==null&&r!==void 0?r:[],this._fields=Array.from(new Set(this._propagators.map(function(n){return typeof n.fields=="function"?n.fields():[]}).reduce(function(n,o){return n.concat(o)},[])))}return a(t,"CompositePropagator"),t.prototype.inject=function(e,r,n){var o,s;try{for(var c=gaa(this._propagators),l=c.next();!l.done;l=c.next()){var u=l.value;try{u.inject(e,r,n)}catch(d){Dn.warn("Failed to inject with "+u.constructor.name+". Err: "+d.message)}}}catch(d){o={error:d}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(o)throw o.error}}},t.prototype.extract=function(e,r,n){return this._propagators.reduce(function(o,s){try{return s.extract(o,r,n)}catch(c){Dn.warn("Failed to extract with "+s.constructor.name+". Err: "+c.message)}return o},e)},t.prototype.fields=function(){return this._fields.slice()},t})()});function Eli(t){return Eaa.test(t)}function _li(t){return _aa.test(t)&&!vaa.test(t)}var Kgr,Aaa,yaa,Eaa,_aa,vaa,vli=Se(()=>{p();Kgr="[_0-9a-z-*/]",Aaa="[a-z]"+Kgr+"{0,255}",yaa="[a-z0-9]"+Kgr+"{0,240}@[a-z]"+Kgr+"{0,13}",Eaa=new RegExp("^(?:"+Aaa+"|"+yaa+")$"),_aa=/^[ -~]{0,255}[!-~]$/,vaa=/,|=/;a(Eli,"validateKey");a(_li,"validateValue")});var Cli,Caa,bli,Sli,Gpt,Jgr=Se(()=>{p();vli();Cli=32,Caa=512,bli=",",Sli="=",Gpt=(function(){function t(e){this._internalState=new Map,e&&this._parse(e)}return a(t,"TraceState"),t.prototype.set=function(e,r){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n},t.prototype.unset=function(e){var r=this._clone();return r._internalState.delete(e),r},t.prototype.get=function(e){return this._internalState.get(e)},t.prototype.serialize=function(){var e=this;return this._keys().reduce(function(r,n){return r.push(n+Sli+e.get(n)),r},[]).join(bli)},t.prototype._parse=function(e){e.length>Caa||(this._internalState=e.split(bli).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(Sli);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);Eli(c)&&_li(l)&&r.set(c,l)}return r},new Map),this._internalState.size>Cli&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Cli))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t})()});function Zgr(t){var e=waa.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var tOe,rOe,baa,Saa,Taa,Iaa,xaa,waa,$pt,Tli=Se(()=>{p();po();VMe();Jgr();tOe="traceparent",rOe="tracestate",baa="00",Saa="(?!ff)[\\da-f]{2}",Taa="(?![0]{32})[\\da-f]{32}",Iaa="(?![0]{16})[\\da-f]{16}",xaa="[\\da-f]{2}",waa=new RegExp("^\\s?("+Saa+")-("+Taa+")-("+Iaa+")-("+xaa+")(-.*)?\\s?$");a(Zgr,"parseTraceParent");$pt=(function(){function t(){}return a(t,"W3CTraceContextPropagator"),t.prototype.inject=function(e,r,n){var o=Pu.getSpanContext(e);if(!(!o||pG(e)||!Ub(o))){var s=baa+"-"+o.traceId+"-"+o.spanId+"-0"+Number(o.traceFlags||Nf.NONE).toString(16);n.set(r,tOe,s),o.traceState&&n.set(r,rOe,o.traceState.serialize())}},t.prototype.extract=function(e,r,n){var o=n.get(r,tOe);if(!o)return e;var s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;var c=Zgr(s);if(!c)return e;c.isRemote=!0;var l=n.get(r,rOe);if(l){var u=Array.isArray(l)?l.join(","):l;c.traceState=new Gpt(typeof u=="string"?u:void 0)}return Pu.setSpanContext(e,c)},t.prototype.fields=function(){return[tOe,rOe]},t})()});function Ili(t,e){return t.setValue(Xgr,e)}function xli(t){return t.deleteValue(Xgr)}function wli(t){return t.getValue(Xgr)}var Xgr,Vpt,Rli=Se(()=>{p();po();Xgr=Fb("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(Vpt||(Vpt={}));a(Ili,"setRPCMetadata");a(xli,"deleteRPCMetadata");a(wli,"getRPCMetadata")});var nOe,eAr=Se(()=>{p();po();nOe=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:Qb.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var _0e,tAr=Se(()=>{p();po();_0e=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:Qb.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var kli,Pli=Se(()=>{p();po();jgr();eAr();tAr();kli=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(Cv(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new _0e),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new _0e,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new nOe,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new _0e,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new nOe}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=Pu.getSpanContext(e);return!l||!Ub(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&Nf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&Nf.SAMPLED?this._localParentSampled.shouldSample(e,r,n,o,s,c):this._localParentNotSampled.shouldSample(e,r,n,o,s,c)},t.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},t})()});var Dli,Nli=Se(()=>{p();po();Dli=(function(){function t(e){e===void 0&&(e=0),this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}return a(t,"TraceIdRatioBasedSampler"),t.prototype.shouldSample=function(e,r){return{decision:Pee(r)&&this._accumulate(r)=1?1:e<=0?0:e},t.prototype._accumulate=function(e){for(var r=0,n=0;n>>0}return r},t})()});function Oaa(t,e){return function(r){return t(e(r))}}function rAr(t){if(!Laa(t)||Baa(t)!==Raa)return!1;var e=Maa(t);if(e===null)return!0;var r=Lli.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Mli.call(r)===Naa}function Laa(t){return t!=null&&typeof t=="object"}function Baa(t){return t==null?t===void 0?Paa:kaa:Oee&&Oee in Object(t)?Faa(t):Uaa(t)}function Faa(t){var e=Lli.call(t,Oee),r=t[Oee],n=!1;try{t[Oee]=void 0,n=!0}catch{}var o=Bli.call(t);return n&&(e?t[Oee]=r:delete t[Oee]),o}function Uaa(t){return Bli.call(t)}var Raa,kaa,Paa,Daa,Mli,Naa,Maa,Oli,Lli,Oee,Bli,Fli=Se(()=>{p();Raa="[object Object]",kaa="[object Null]",Paa="[object Undefined]",Daa=Function.prototype,Mli=Daa.toString,Naa=Mli.call(Object),Maa=Oaa(Object.getPrototypeOf,Object),Oli=Object.prototype,Lli=Oli.hasOwnProperty,Oee=Symbol?Symbol.toStringTag:void 0,Bli=Oli.toString;a(Oaa,"overArg");a(rAr,"isPlainObject");a(Laa,"isObjectLike");a(Baa,"baseGetTag");a(Faa,"getRawTag");a(Uaa,"objectToString")});function Ypt(){for(var t=[],e=0;e0;)r=Qli(r,t.shift(),0,n);return r}function nAr(t){return zpt(t)?t.slice():t}function Qli(t,e,r,n){r===void 0&&(r=0);var o;if(!(r>Qaa)){if(r++,Wpt(t)||Wpt(e)||qli(e))o=nAr(e);else if(zpt(t)){if(o=t.slice(),zpt(e))for(var s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{var f=o[u],h=d;if(Uli(t,u,n)||Uli(e,u,n))delete o[u];else{if(iOe(f)&&iOe(h)){var m=n.get(f)||[],g=n.get(h)||[];m.push({obj:t,key:u}),g.push({obj:e,key:u}),n.set(f,m),n.set(h,g)}o[u]=Qli(o[u],d,r,n)}}}}else o=e;return o}}function Uli(t,e,r){for(var n=r.get(t[e])||[],o=0,s=n.length;o"u"||t instanceof Date||t instanceof RegExp||t===null}function qaa(t,e){return!(!rAr(t)||!rAr(e))}var Qaa,jli=Se(()=>{p();Fli();Qaa=20;a(Ypt,"merge");a(nAr,"takeValue");a(Qli,"mergeTwoObjects");a(Uli,"wasObjectReferenced");a(zpt,"isArray");a(qli,"isFunction");a(iOe,"isObject");a(Wpt,"isPrimitive");a(qaa,"shouldMerge")});function Hli(t,e){var r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new iAr("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(function(o){return clearTimeout(r),o},function(o){throw clearTimeout(r),o})}var jaa,iAr,Gli=Se(()=>{p();jaa=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),iAr=(function(t){jaa(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return a(e,"TimeoutError"),e})(Error);a(Hli,"callWithTimeout")});function oAr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function $li(t,e){var r,n;if(!e)return!1;try{for(var o=Haa(e),s=o.next();!s.done;s=o.next()){var c=s.value;if(oAr(t,c))return!0}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1}var Haa,Vli=Se(()=>{p();Haa=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};a(oAr,"urlMatches");a($li,"isUrlIgnored")});function Wli(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var zli=Se(()=>{p();a(Wli,"isWrapped")});var Yli,Kli=Se(()=>{p();Yli=(function(){function t(){var e=this;this._promise=new Promise(function(r,n){e._resolve=r,e._reject=n})}return a(t,"Deferred"),Object.defineProperty(t.prototype,"promise",{get:a(function(){return this._promise},"get"),enumerable:!1,configurable:!0}),t.prototype.resolve=function(e){this._resolve(e)},t.prototype.reject=function(e){this._reject(e)},t})()});var Gaa,$aa,v0e,Jli=Se(()=>{p();Kli();Gaa=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},$aa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();po();VMe();a(Zli,"_export")});var eui={};Ri(eui,{AlwaysOffSampler:()=>nOe,AlwaysOnSampler:()=>_0e,AnchoredClock:()=>Mci,BindOnceFuture:()=>v0e,CompositePropagator:()=>Hpt,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>Mee,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>Nee,DEFAULT_ENVIRONMENT:()=>YMe,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>Ggr,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>$gr,ExportResultCode:()=>KT,ParentBasedSampler:()=>kli,RPCType:()=>Vpt,RandomIdGenerator:()=>Upt,SDK_INFO:()=>mG,TRACE_PARENT_HEADER:()=>tOe,TRACE_STATE_HEADER:()=>rOe,TimeoutError:()=>iAr,TraceIdRatioBasedSampler:()=>Dli,TraceState:()=>Gpt,TracesSamplerValues:()=>qb,VERSION:()=>Qpt,W3CBaggagePropagator:()=>Npt,W3CTraceContextPropagator:()=>$pt,_globalThis:()=>Opt,addHrTimes:()=>eOe,baggageUtils:()=>Vaa,callWithTimeout:()=>Hli,deleteRPCMetadata:()=>xli,getEnv:()=>vR,getEnvWithoutDefaults:()=>m0e,getRPCMetadata:()=>wli,getTimeOrigin:()=>y0e,globalErrorHandler:()=>Cv,hexToBase64:()=>Bpt,hexToBinary:()=>Lpt,hrTime:()=>JMe,hrTimeDuration:()=>jpt,hrTimeToMicroseconds:()=>ZMe,hrTimeToMilliseconds:()=>mli,hrTimeToNanoseconds:()=>hli,hrTimeToTimeStamp:()=>pli,internal:()=>sAr,isAttributeKey:()=>Qgr,isAttributeValue:()=>zMe,isTimeInput:()=>XMe,isTimeInputHrTime:()=>E0e,isTracingSuppressed:()=>pG,isUrlIgnored:()=>$li,isWrapped:()=>Wli,loggingErrorHandler:()=>Mpt,merge:()=>Ypt,millisToHrTime:()=>cD,otperformance:()=>CR,parseEnvironment:()=>KMe,parseTraceParent:()=>Zgr,sanitizeAttributes:()=>hG,setGlobalErrorHandler:()=>Qci,setRPCMetadata:()=>Ili,suppressTracing:()=>p0e,timeInputToHrTime:()=>fli,unrefTimer:()=>A0e,unsuppressTracing:()=>xci,urlMatches:()=>oAr});var Vaa,sAr,jb=Se(()=>{p();Nci();Oci();Fci();jgr();qgr();gli();Wgr();Ali();Ugr();Ygr();yli();Tli();Rli();eAr();tAr();Pli();Nli();VMe();Jgr();Vgr();jli();Hgr();Gli();Vli();zli();Jli();zgr();Xli();Vaa={getKeyPairs:Dpt,serializeKeyPairs:Ppt,parseKeyPairsIntoRecord:Dci,parsePairKeyValue:WMe},sAr={_export:Zli}});var Waa,zaa,Yaa,Kpt,Jpt,tui,rui=Se(()=>{p();Waa="exception.type",zaa="exception.message",Yaa="exception.stacktrace",Kpt=Waa,Jpt=zaa,tui=Yaa});var nui=Se(()=>{p();rui()});var iui=Se(()=>{p()});var oui=Se(()=>{p();iui()});var sui=Se(()=>{p()});var aui=Se(()=>{p()});var cui=Se(()=>{p();nui();oui();sui();aui()});var lui,uui=Se(()=>{p();lui="exception"});var aAr,Kaa,dui,Jaa,Zpt,cAr=Se(()=>{p();po();jb();cui();uui();aAr=function(){return aAr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},dui=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},Jaa=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(r),this):(Dn.warn("Invalid attribute value set for key: "+e),this)},t.prototype.setAttributes=function(e){var r,n;try{for(var o=Kaa(Object.entries(e)),s=o.next();!s.done;s=o.next()){var c=dui(s.value,2),l=c[0],u=c[1];this.setAttribute(l,u)}}catch(d){r={error:d}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return this},t.prototype.addEvent=function(e,r,n){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return Dn.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&Dn.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),XMe(r)&&(XMe(n)||(n=r),r=void 0);var o=hG(r);return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:0}),this},t.prototype.addLink=function(e){return this.links.push(e),this},t.prototype.addLinks=function(e){var r;return(r=this.links).push.apply(r,Jaa([],dui(e),!1)),this},t.prototype.setStatus=function(e){return this._isSpanEnded()?this:(this.status=aAr({},e),this.status.message!=null&&typeof e.message!="string"&&(Dn.warn("Dropping invalid status.message of type '"+typeof e.message+"', expected 'string'"),delete this.status.message),this)},t.prototype.updateName=function(e){return this._isSpanEnded()?this:(this.name=e,this)},t.prototype.end=function(e){if(this._isSpanEnded()){Dn.error(this.name+" "+this._spanContext.traceId+"-"+this._spanContext.spanId+" - You can only call end() on a span once.");return}this._ended=!0,this.endTime=this._getTime(e),this._duration=jpt(this.startTime,this.endTime),this._duration[0]<0&&(Dn.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&Dn.warn("Dropped "+this._droppedEventsCount+" events because eventCountLimit reached"),this._spanProcessor.onEnd(this)},t.prototype._getTime=function(e){if(typeof e=="number"&&e<=CR.now())return JMe(e+this._performanceOffset);if(typeof e=="number")return cD(e);if(e instanceof Date)return cD(e.getTime());if(E0e(e))return e;if(this._startTimeProvided)return cD(Date.now());var r=CR.now()-this._performanceStartTime;return eOe(this.startTime,cD(r))},t.prototype.isRecording=function(){return this._ended===!1},t.prototype.recordException=function(e,r){var n={};typeof e=="string"?n[Jpt]=e:e&&(e.code?n[Kpt]=e.code.toString():e.name&&(n[Kpt]=e.name),e.message&&(n[Jpt]=e.message),e.stack&&(n[tui]=e.stack)),n[Kpt]||n[Jpt]?this.addEvent(lui,n,r):Dn.warn("Failed to record an exception "+e)},Object.defineProperty(t.prototype,"duration",{get:a(function(){return this._duration},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ended",{get:a(function(){return this._ended},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedAttributesCount",{get:a(function(){return this._droppedAttributesCount},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedEventsCount",{get:a(function(){return this._droppedEventsCount},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedLinksCount",{get:a(function(){return this._droppedLinksCount},"get"),enumerable:!1,configurable:!0}),t.prototype._isSpanEnded=function(){return this._ended&&Dn.warn("Can not execute the operation on ended Span {traceId: "+this._spanContext.traceId+", spanId: "+this._spanContext.spanId+"}"),this._ended},t.prototype._truncateToLimitUtil=function(e,r){return e.length<=r?e:e.substring(0,r)},t.prototype._truncateToSize=function(e){var r=this,n=this._attributeValueLengthLimit;return n<=0?(Dn.warn("Attribute value limit must be positive, got "+n),e):typeof e=="string"?this._truncateToLimitUtil(e,n):Array.isArray(e)?e.map(function(o){return typeof o=="string"?r._truncateToLimitUtil(o,n):o}):e},t})()});var lD,oOe=Se(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(lD||(lD={}))});var gG,Xpt=Se(()=>{p();oOe();gG=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:lD.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var I4,eht=Se(()=>{p();oOe();I4=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:lD.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var C0e,lAr=Se(()=>{p();po();jb();Xpt();eht();C0e=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(Cv(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new I4),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new I4,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new gG,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new I4,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new gG}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=Pu.getSpanContext(e);return!l||!Ub(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&Nf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&Nf.SAMPLED?this._localParentSampled.shouldSample(e,r,n,o,s,c):this._localParentNotSampled.shouldSample(e,r,n,o,s,c)},t.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},t})()});var sOe,uAr=Se(()=>{p();po();oOe();sOe=(function(){function t(e){e===void 0&&(e=0),this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}return a(t,"TraceIdRatioBasedSampler"),t.prototype.shouldSample=function(e,r){return{decision:Pee(r)&&this._accumulate(r)=1?1:e<=0?0:e},t.prototype._accumulate=function(e){for(var r=0,n=0;n>>0}return r},t})()});function tht(){var t=vR();return{sampler:dAr(t),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:t.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:t.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:t.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:t.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT},mergeResourceWithDefaults:!0}}function dAr(t){switch(t===void 0&&(t=vR()),t.OTEL_TRACES_SAMPLER){case qb.AlwaysOn:return new I4;case qb.AlwaysOff:return new gG;case qb.ParentBasedAlwaysOn:return new C0e({root:new I4});case qb.ParentBasedAlwaysOff:return new C0e({root:new gG});case qb.TraceIdRatio:return new sOe(fui(t));case qb.ParentBasedTraceIdRatio:return new C0e({root:new sOe(fui(t))});default:return Dn.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+Zaa+'".'),new I4}}function fui(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return Dn.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+b0e+"."),b0e;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(Dn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+b0e+"."),b0e):e<0||e>1?(Dn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+b0e+"."),b0e):e}var Zaa,b0e,fAr=Se(()=>{p();po();jb();Xpt();eht();lAr();uAr();Zaa=qb.AlwaysOn,b0e=1;a(tht,"loadDefaultConfig");a(dAr,"buildSamplerFromEnv");a(fui,"getSamplerProbabilityFromEnv")});function pui(t){var e={sampler:dAr()},r=tht(),n=Object.assign({},r,e,t);return n.generalLimits=Object.assign({},r.generalLimits,t.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,t.spanLimits||{}),n}function hui(t){var e,r,n,o,s,c,l,u,d,f,h,m,g=Object.assign({},t.spanLimits),A=m0e();return g.attributeCountLimit=(c=(s=(o=(r=(e=t.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&r!==void 0?r:(n=t.generalLimits)===null||n===void 0?void 0:n.attributeCountLimit)!==null&&o!==void 0?o:A.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:A.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&c!==void 0?c:Mee,g.attributeValueLengthLimit=(m=(h=(f=(u=(l=t.spanLimits)===null||l===void 0?void 0:l.attributeValueLengthLimit)!==null&&u!==void 0?u:(d=t.generalLimits)===null||d===void 0?void 0:d.attributeValueLengthLimit)!==null&&f!==void 0?f:A.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&h!==void 0?h:A.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&m!==void 0?m:Nee,Object.assign({},t,{spanLimits:g})}var pAr=Se(()=>{p();fAr();jb();a(pui,"mergeConfig");a(hui,"reconfigureLimits")});var mui,gui=Se(()=>{p();po();jb();mui=(function(){function t(e,r){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;var n=vR();this._maxExportBatchSize=typeof r?.maxExportBatchSize=="number"?r.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof r?.maxQueueSize=="number"?r.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof r?.scheduledDelayMillis=="number"?r.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof r?.exportTimeoutMillis=="number"?r.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new v0e(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Dn.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}return a(t,"BatchSpanProcessorBase"),t.prototype.forceFlush=function(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()},t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&Nf.SAMPLED)!==0&&this._addToBuffer(e)},t.prototype.shutdown=function(){return this._shutdownOnce.call()},t.prototype._shutdown=function(){var e=this;return Promise.resolve().then(function(){return e.onShutdown()}).then(function(){return e._flushAll()}).then(function(){return e._exporter.shutdown()})},t.prototype._addToBuffer=function(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&Dn.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Dn.warn("Dropped "+this._droppedSpansCount+" spans because maxQueueSize reached"),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()},t.prototype._flushAll=function(){var e=this;return new Promise(function(r,n){for(var o=[],s=Math.ceil(e._finishedSpans.length/e._maxExportBatchSize),c=0,l=s;c0&&(e._clearTimer(),e._maybeStartTimer())}).catch(function(n){e._isExporting=!1,Cv(n)})},"flush");if(this._finishedSpans.length>=this._maxExportBatchSize)return r();this._timer===void 0&&(this._timer=setTimeout(function(){return r()},this._scheduledDelayMillis),A0e(this._timer))}},t.prototype._clearTimer=function(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)},t})()});var Xaa,S0e,Aui=Se(()=>{p();gui();Xaa=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),S0e=(function(t){Xaa(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"BatchSpanProcessor"),e.prototype.onShutdown=function(){},e})(mui)});function yui(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(rht[t-1]=1);return rht.toString("hex",0,t)},"generateId")}var eca,Eui,T0e,rht,_ui=Se(()=>{p();eca=8,Eui=16,T0e=(function(){function t(){this.generateTraceId=yui(Eui),this.generateSpanId=yui(eca)}return a(t,"RandomIdGenerator"),t})(),rht=Buffer.allocUnsafe(Eui);a(yui,"getIdGenerator")});var vui=Se(()=>{p();Aui();_ui()});var nht=Se(()=>{p();vui()});var iht,hAr=Se(()=>{p();po();jb();cAr();pAr();nht();iht=(function(){function t(e,r,n){this._tracerProvider=n;var o=pui(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new T0e,this.resource=n.resource,this.instrumentationLibrary=e}return a(t,"Tracer"),t.prototype.startSpan=function(e,r,n){var o,s,c;r===void 0&&(r={}),n===void 0&&(n=$g.active()),r.root&&(n=Pu.deleteSpan(n));var l=Pu.getSpan(n);if(pG(n)){Dn.debug("Instrumentation suppressed, returning Noop Span");var u=Pu.wrapSpanContext(u0e);return u}var d=l?.spanContext(),f=this._idGenerator.generateSpanId(),h,m,g;!d||!Pu.isSpanContextValid(d)?h=this._idGenerator.generateTraceId():(h=d.traceId,m=d.traceState,g=d.spanId);var A=(o=r.kind)!==null&&o!==void 0?o:d0e.INTERNAL,y=((s=r.links)!==null&&s!==void 0?s:[]).map(function(R){return{context:R.context,attributes:hG(R.attributes)}}),E=hG(r.attributes),_=this._sampler.shouldSample(n,h,e,A,E,y);m=(c=_.traceState)!==null&&c!==void 0?c:m;var v=_.decision===Qb.RECORD_AND_SAMPLED?Nf.SAMPLED:Nf.NONE,b={traceId:h,spanId:f,traceFlags:v,traceState:m};if(_.decision===Qb.NOT_RECORD){Dn.debug("Recording is off, propagating context in a non-recording span");var u=Pu.wrapSpanContext(b);return u}var T=hG(Object.assign(E,_.attributes)),w=new Zpt(this,n,e,b,A,g,y,r.startTime,void 0,T);return w},t.prototype.startActiveSpan=function(e,r,n,o){var s,c,l;if(!(arguments.length<2)){arguments.length===2?l=r:arguments.length===3?(s=r,l=n):(s=r,c=n,l=o);var u=c??$g.active(),d=this.startSpan(e,s,u),f=Pu.setSpan(u,d);return $g.with(f,l,void 0,d)}},t.prototype.getGeneralLimits=function(){return this._generalLimits},t.prototype.getSpanLimits=function(){return this._spanLimits},t.prototype.getActiveSpanProcessor=function(){return this._tracerProvider.getActiveSpanProcessor()},t})()});var Cui=Se(()=>{p()});var bui=Se(()=>{p();Cui()});var tca,rca,nca,ica,Sui,mAr,gAr,AAr,Tui=Se(()=>{p();tca="service.name",rca="telemetry.sdk.name",nca="telemetry.sdk.language",ica="telemetry.sdk.version",Sui=tca,mAr=rca,gAr=nca,AAr=ica});var Iui=Se(()=>{p();Tui()});var xui=Se(()=>{p()});var wui=Se(()=>{p()});var Rui=Se(()=>{p();bui();Iui();xui();wui()});function oht(){return"unknown_service:"+process.argv0}var kui=Se(()=>{p();a(oht,"defaultServiceName")});var Pui=Se(()=>{p();kui()});var Dui=Se(()=>{p();Pui()});var AG,oca,sca,aca,sht,Nui=Se(()=>{p();po();Rui();jb();Dui();AG=function(){return AG=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},sht=(function(){function t(e,r){var n=this,o;this._attributes=e,this.asyncAttributesPending=r!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=r?.then(function(s){return n._attributes=Object.assign({},n._attributes,s),n.asyncAttributesPending=!1,s},function(s){return Dn.debug("a resource's async attributes promise rejected: %s",s),n.asyncAttributesPending=!1,{}})}return a(t,"Resource"),t.empty=function(){return t.EMPTY},t.default=function(){var e;return new t((e={},e[Sui]=oht(),e[gAr]=mG[gAr],e[mAr]=mG[mAr],e[AAr]=mG[AAr],e))},Object.defineProperty(t.prototype,"attributes",{get:a(function(){var e;return this.asyncAttributesPending&&Dn.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}},"get"),enumerable:!1,configurable:!0}),t.prototype.waitForAsyncAttributes=function(){return oca(this,void 0,void 0,function(){return sca(this,function(e){switch(e.label){case 0:return this.asyncAttributesPending?[4,this._asyncAttributesPromise]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},t.prototype.merge=function(e){var r=this,n;if(!e)return this;var o=AG(AG({},this._syncAttributes),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new t(o);var s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(function(c){var l,u=aca(c,2),d=u[0],f=u[1];return AG(AG(AG(AG({},r._syncAttributes),d),(l=e._syncAttributes)!==null&&l!==void 0?l:e.attributes),f)});return new t(o,s)},t.EMPTY=new t({}),t})()});var Mui=Se(()=>{p();Nui()});var aht,yAr,Oui=Se(()=>{p();jb();aht=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},yAr=(function(){function t(e){this._spanProcessors=e}return a(t,"MultiSpanProcessor"),t.prototype.forceFlush=function(){var e,r,n=[];try{for(var o=aht(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;n.push(c.forceFlush())}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return new Promise(function(l){Promise.all(n).then(function(){l()}).catch(function(u){Cv(u||new Error("MultiSpanProcessor: forceFlush failed")),l()})})},t.prototype.onStart=function(e,r){var n,o;try{for(var s=aht(this._spanProcessors),c=s.next();!c.done;c=s.next()){var l=c.value;l.onStart(e,r)}}catch(u){n={error:u}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}},t.prototype.onEnd=function(e){var r,n;try{for(var o=aht(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;c.onEnd(e)}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},t.prototype.shutdown=function(){var e,r,n=[];try{for(var o=aht(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;n.push(c.shutdown())}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return new Promise(function(l,u){Promise.all(n).then(function(){l()},u)})},t})()});var cht,EAr=Se(()=>{p();cht=(function(){function t(){}return a(t,"NoopSpanProcessor"),t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){},t.prototype.shutdown=function(){return Promise.resolve()},t.prototype.forceFlush=function(){return Promise.resolve()},t})()});var cca,lca,$8,Lui,Bui=Se(()=>{p();po();jb();Mui();hAr();fAr();Oui();EAr();nht();pAr();cca=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},lca=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n0?o(c):n()}).catch(function(s){return o([s])})})},t.prototype.shutdown=function(){return this.activeSpanProcessor.shutdown()},t.prototype._getPropagator=function(e){var r;return(r=this.constructor._registeredPropagators.get(e))===null||r===void 0?void 0:r()},t.prototype._getSpanExporter=function(e){var r;return(r=this.constructor._registeredExporters.get(e))===null||r===void 0?void 0:r()},t.prototype._buildPropagatorFromEnv=function(){var e=this,r=Array.from(new Set(vR().OTEL_PROPAGATORS)),n=r.map(function(s){var c=e._getPropagator(s);return c||Dn.warn('Propagator "'+s+'" requested through environment variable is unavailable.'),c}),o=n.reduce(function(s,c){return c&&s.push(c),s},[]);if(o.length!==0)return r.length===1?o[0]:new Hpt({propagators:o})},t.prototype._buildExporterFromEnv=function(){var e=vR().OTEL_TRACES_EXPORTER;if(!(e==="none"||e==="")){var r=this._getSpanExporter(e);return r||Dn.error('Exporter "'+e+'" requested through environment variable is unavailable.'),r}},t._registeredPropagators=new Map([["tracecontext",function(){return new $pt}],["baggage",function(){return new Npt}]]),t._registeredExporters=new Map,t})()});var uca,Fui,Uui=Se(()=>{p();jb();uca=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Fui=(function(){function t(){}return a(t,"ConsoleSpanExporter"),t.prototype.export=function(e,r){return this._sendSpans(e,r)},t.prototype.shutdown=function(){return this._sendSpans([]),this.forceFlush()},t.prototype.forceFlush=function(){return Promise.resolve()},t.prototype._exportInfo=function(e){var r;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationLibrary,traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(r=e.spanContext().traceState)===null||r===void 0?void 0:r.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:ZMe(e.startTime),duration:ZMe(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}},t.prototype._sendSpans=function(e,r){var n,o;try{for(var s=uca(e),c=s.next();!c.done;c=s.next()){var l=c.value;console.dir(this._exportInfo(l),{depth:3})}}catch(u){n={error:u}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}if(r)return r({code:KT.SUCCESS})},t})()});var dca,fca,Qui,qui=Se(()=>{p();jb();dca=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},fca=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();po();jb();pca=function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},hca=function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]gG,AlwaysOnSampler:()=>I4,BasicTracerProvider:()=>Lui,BatchSpanProcessor:()=>S0e,ConsoleSpanExporter:()=>Fui,ForceFlushState:()=>$8,InMemorySpanExporter:()=>Qui,NoopSpanProcessor:()=>cht,ParentBasedSampler:()=>C0e,RandomIdGenerator:()=>T0e,SamplingDecision:()=>lD,SimpleSpanProcessor:()=>jui,Span:()=>Zpt,TraceIdRatioBasedSampler:()=>sOe,Tracer:()=>iht});var $ui=Se(()=>{p();hAr();Bui();nht();Uui();qui();Hui();EAr();Xpt();eht();lAr();uAr();oOe();cAr()});var aOe,Vui,_Ar=Se(()=>{p();aOe=class{static{a(this,"NoopLogger")}emit(e){}},Vui=new aOe});var vAr,lht,CAr=Se(()=>{p();_Ar();vAr=class{static{a(this,"NoopLoggerProvider")}getLogger(e,r,n){return new aOe}},lht=new vAr});var uht,Wui=Se(()=>{p();_Ar();uht=class{static{a(this,"ProxyLogger")}constructor(e,r,n,o){this._provider=e,this.name=r,this.version=n,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Vui}}});var cOe,zui=Se(()=>{p();CAr();Wui();cOe=class{static{a(this,"ProxyLoggerProvider")}getLogger(e,r,n){var o;return(o=this.getDelegateLogger(e,r,n))!==null&&o!==void 0?o:new uht(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:lht}setDelegate(e){this._delegate=e}getDelegateLogger(e,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,r,n)}}});var dht,Yui=Se(()=>{p();dht=typeof globalThis=="object"?globalThis:global});var Kui=Se(()=>{p();Yui()});var Jui=Se(()=>{p();Kui()});function Zui(t,e,r){return n=>n===t?e:r}var lOe,I0e,bAr,Xui=Se(()=>{p();Jui();lOe=Symbol.for("io.opentelemetry.js.api.logs"),I0e=dht;a(Zui,"makeGetter");bAr=1});var fht,edi=Se(()=>{p();Xui();CAr();zui();fht=class t{static{a(this,"LogsAPI")}constructor(){this._proxyLoggerProvider=new cOe}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return I0e[lOe]?this.getLoggerProvider():(I0e[lOe]=Zui(bAr,e,lht),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=I0e[lOe])===null||e===void 0?void 0:e.call(I0e,bAr))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete I0e[lOe],this._proxyLoggerProvider=new cOe}}});var pht,SAr=Se(()=>{p();edi();pht=fht.getInstance()});function tdi(t,e,r,n){for(let o=0,s=t.length;oe.disable())}var ndi=Se(()=>{p();a(tdi,"enableInstrumentations");a(rdi,"disableInstrumentations")});function idi(t){let e=t.tracerProvider||Pu.getTracerProvider(),r=t.meterProvider||Dee.getMeterProvider(),n=t.loggerProvider||pht.getLoggerProvider(),o=t.instrumentations?.flat()??[];return tdi(o,e,r,n),()=>{rdi(o)}}var odi=Se(()=>{p();po();SAr();ndi();a(idi,"registerInstrumentations")});function ddi(t,e,r){if(!Aca(t))return Dn.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let n=vca(t);if(!n)return!1;let o=[],s=fdi(n,e,o,r);return s&&!r?.includePrerelease?Eca(n,o):s}function Aca(t){return typeof t=="string"&&udi.test(t)}function fdi(t,e,r,n){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(TAr(t,s,r,n))return!0;return!1}else if(e.includes(" - "))e=jca(e,n);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!TAr(t,s,r,n))return!1;return!0}return TAr(t,e,r,n)}function TAr(t,e,r,n){if(e=_ca(e,n),e.includes(" "))return fdi(t,e,r,n);{let o=Cca(e);return r.push(o),yca(t,o)}}function yca(t,e){if(e.invalid)return!1;if(!e.version||xAr(e.version))return!0;let r=adi(t.versionSegments||[],e.versionSegments||[]);if(r===0){let n=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!n.length&&!o.length?r=0:!n.length&&o.length?r=1:n.length&&!o.length?r=-1:r=adi(n,o)}return gca[e.op]?.includes(r)}function Eca(t,e){return t.prerelease?e.some(r=>r.prerelease&&r.version===t.version):!0}function _ca(t,e){return t=t.trim(),t=Qca(t,e),t=Uca(t),t=qca(t,e),t=t.trim(),t}function bv(t){return!t||t.toLowerCase()==="x"||t==="*"}function vca(t){let e=t.match(udi);if(!e){Dn.error(`Invalid version: ${t}`);return}let r=e.groups.version,n=e.groups.prerelease,o=e.groups.build,s=r.split("."),c=n?.split(".");return{op:void 0,version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:n,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:o}}function Cca(t){if(!t)return{};let e=t.match(mca);if(!e)return Dn.error(`Invalid range: ${t}`),{invalid:!0};let r=e.groups.op,n=e.groups.version,o=e.groups.prerelease,s=e.groups.build,c=n.split("."),l=o?.split(".");return r==="=="&&(r="="),{op:r||"=",version:n,versionSegments:c,versionSegmentCount:c.length,prerelease:o,prereleaseSegments:l,prereleaseSegmentCount:l?l.length:0,build:s}}function xAr(t){return t==="*"||t==="x"||t==="X"}function sdi(t){let e=parseInt(t,10);return isNaN(e)?t:e}function bca(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function Sca(t,e){if(xAr(t)||xAr(e))return 0;let[r,n]=bca(sdi(t),sdi(e));return r>n?1:r{let l;return bv(n)?l="":bv(o)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:bv(s)?l=`>=${n}.${o}.0 <${n}.${+o+1}.0-0`:c?l=`>=${n}.${o}.${s}-${c} <${n}.${+o+1}.0-0`:l=`>=${n}.${o}.${s} <${n}.${+o+1}.0-0`,l})}function Qca(t,e){let r=Fca,n=e?.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{let d;return bv(s)?d="":bv(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:bv(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?s==="0"?c==="0"?d=`>=${s}.${c}.${l}-${u} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l}-${u} <${+s+1}.0.0-0`:s==="0"?c==="0"?d=`>=${s}.${c}.${l}${n} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l} <${+s+1}.0.0-0`,d})}function qca(t,e){let r=kca;return t.replace(r,(n,o,s,c,l,u)=>{let d=bv(s),f=d||bv(c),h=f||bv(l),m=h;return o==="="&&m&&(o=""),u=e?.includePrerelease?"-0":"",d?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),o==="<"&&(u="-0"),n=`${o+s}.${c}.${l}${u}`):f?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:h&&(n=`>=${s}.${c}.0${u} <${s}.${+c+1}.0-0`),n})}function jca(t,e){let r=Dca;return t.replace(r,(n,o,s,c,l,u,d,f,h,m,g,A)=>(bv(s)?o="":bv(c)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:bv(l)?o=`>=${s}.${c}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,bv(h)?f="":bv(m)?f=`<${+h+1}.0.0-0`:bv(g)?f=`<${h}.${+m+1}.0-0`:A?f=`<=${h}.${m}.${g}-${A}`:e?.includePrerelease?f=`<${h}.${m}.${+g+1}-0`:f=`<=${f}`,`${o} ${f}`.trim()))}var udi,mca,gca,pdi,hdi,Tca,Ica,cdi,xca,ldi,wca,IAr,uOe,Rca,kca,Pca,Dca,Nca,Mca,Oca,Lca,Bca,Fca,mdi=Se(()=>{p();po();udi=/^(?:v)?(?(?0|[1-9]\d*)\.(?0|[1-9]\d*)\.(?0|[1-9]\d*))(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,mca=/^(?<|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?(?x|X|\*|0|[1-9]\d*)(?:\.(?x|X|\*|0|[1-9]\d*))?(?:\.(?x|X|\*|0|[1-9]\d*))?)(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,gca={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};a(ddi,"satisfies");a(Aca,"_validateVersion");a(fdi,"_doSatisfies");a(TAr,"_checkRange");a(yca,"_satisfies");a(Eca,"_doPreleaseCheck");a(_ca,"_normalizeRange");a(bv,"isX");a(vca,"_parseVersion");a(Cca,"_parseRange");a(xAr,"_isWildcard");a(sdi,"_parseVersionString");a(bca,"_normalizeVersionType");a(Sca,"_compareVersionStrings");a(adi,"_compareVersionSegments");pdi="[a-zA-Z0-9-]",hdi="0|[1-9]\\d*",Tca=`\\d*[a-zA-Z-]${pdi}*`,Ica="((?:<|>)?=?)",cdi=`(?:${hdi}|${Tca})`,xca=`(?:-(${cdi}(?:\\.${cdi})*))`,ldi=`${pdi}+`,wca=`(?:\\+(${ldi}(?:\\.${ldi})*))`,IAr=`${hdi}|x|X|\\*`,uOe=`[v=\\s]*(${IAr})(?:\\.(${IAr})(?:\\.(${IAr})(?:${xca})?${wca}?)?)?`,Rca=`^${Ica}\\s*${uOe}$`,kca=new RegExp(Rca),Pca=`^\\s*(${uOe})\\s+-\\s+(${uOe})\\s*$`,Dca=new RegExp(Pca),Nca="(?:~>?)",Mca=`^${Nca}${uOe}$`,Oca=new RegExp(Mca),Lca="(?:\\^)",Bca=`^${Lca}${uOe}$`,Fca=new RegExp(Bca);a(Uca,"replaceTilde");a(Qca,"replaceCaret");a(qca,"replaceXRange");a(jca,"replaceHyphen")});var x0e=I((Mup,ydi)=>{"use strict";p();function wAr(t){return typeof t=="function"}a(wAr,"isFunction");var Sv=console.error.bind(console);function dOe(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(dOe,"defineProperty");function fOe(t){t&&t.logger&&(wAr(t.logger)?Sv=t.logger:Sv("new logger isn't a function, not replacing"))}a(fOe,"shimmer");function gdi(t,e,r){if(!t||!t[e]){Sv("no original function "+e+" to wrap");return}if(!r){Sv("no wrapper function"),Sv(new Error().stack);return}if(!wAr(t[e])||!wAr(r)){Sv("original object and wrapper must be functions");return}var n=t[e],o=r(n,e);return dOe(o,"__original",n),dOe(o,"__unwrap",function(){t[e]===o&&dOe(t,e,n)}),dOe(o,"__wrapped",!0),dOe(t,e,o),o}a(gdi,"wrap");function Hca(t,e,r){if(t)Array.isArray(t)||(t=[t]);else{Sv("must provide one or more modules to patch"),Sv(new Error().stack);return}if(!(e&&Array.isArray(e))){Sv("must provide one or more functions to wrap on modules");return}t.forEach(function(n){e.forEach(function(o){gdi(n,o,r)})})}a(Hca,"massWrap");function Adi(t,e){if(!t||!t[e]){Sv("no function to unwrap."),Sv(new Error().stack);return}if(!t[e].__unwrap)Sv("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}a(Adi,"unwrap");function Gca(t,e){if(t)Array.isArray(t)||(t=[t]);else{Sv("must provide one or more modules to patch"),Sv(new Error().stack);return}if(!(e&&Array.isArray(e))){Sv("must provide one or more functions to unwrap on modules");return}t.forEach(function(r){e.forEach(function(n){Adi(r,n)})})}a(Gca,"massUnwrap");fOe.wrap=gdi;fOe.massWrap=Hca;fOe.unwrap=Adi;fOe.massUnwrap=Gca;ydi.exports=fOe});var yG,hht,Edi=Se(()=>{p();po();SAr();yG=fe(x0e()),hht=class{static{a(this,"InstrumentationAbstract")}instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,r,n){this.instrumentationName=e,this.instrumentationVersion=r,this.setConfig(n),this._diag=Dn.createComponentLogger({namespace:e}),this._tracer=Pu.getTracer(e,r),this._meter=Dee.getMeter(e,r),this._logger=pht.getLogger(e,r),this._updateMetricInstruments()}_wrap=yG.wrap;_unwrap=yG.unwrap;_massWrap=yG.massWrap;_massUnwrap=yG.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,r,n,o){if(e)try{e(n,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:r},s)}}}});var vdi=I((jup,_di)=>{p();var w0e=1e3,R0e=w0e*60,k0e=R0e*60,Lee=k0e*24,$ca=Lee*7,Vca=Lee*365.25;_di.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Wca(t);if(r==="number"&&isFinite(t))return e.long?Yca(t):zca(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Wca(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Vca;case"weeks":case"week":case"w":return r*$ca;case"days":case"day":case"d":return r*Lee;case"hours":case"hour":case"hrs":case"hr":case"h":return r*k0e;case"minutes":case"minute":case"mins":case"min":case"m":return r*R0e;case"seconds":case"second":case"secs":case"sec":case"s":return r*w0e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(Wca,"parse");function zca(t){var e=Math.abs(t);return e>=Lee?Math.round(t/Lee)+"d":e>=k0e?Math.round(t/k0e)+"h":e>=R0e?Math.round(t/R0e)+"m":e>=w0e?Math.round(t/w0e)+"s":t+"ms"}a(zca,"fmtShort");function Yca(t){var e=Math.abs(t);return e>=Lee?mht(t,e,Lee,"day"):e>=k0e?mht(t,e,k0e,"hour"):e>=R0e?mht(t,e,R0e,"minute"):e>=w0e?mht(t,e,w0e,"second"):t+" ms"}a(Yca,"fmtLong");function mht(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(mht,"plural")});var RAr=I(($up,Cdi)=>{p();function Kca(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=vdi(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let P=r.formatters[x];if(typeof P=="function"){let D=E[T];R=P.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,E),(_.log||r.log).apply(_,E)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(E=>{m=E},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of h)m[0]==="-"?r.skips.push(m.slice(1)):r.names.push(m)}a(o,"enable");function s(f,h){let m=0,g=0,A=-1,y=0;for(;m"-"+h)].join(",");return r.enable(""),f}a(c,"disable");function l(f){for(let h of r.skips)if(s(f,h))return!1;for(let h of r.names)if(s(f,h))return!0;return!1}a(l,"enabled");function u(f){return f instanceof Error?f.stack||f.message:f}a(u,"coerce");function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return a(d,"destroy"),r.enable(r.load()),r}a(Kca,"setup");Cdi.exports=Kca});var bdi=I((Hb,ght)=>{p();Hb.formatArgs=Zca;Hb.save=Xca;Hb.load=ela;Hb.useColors=Jca;Hb.storage=tla();Hb.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Hb.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Jca(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(Jca,"useColors");function Zca(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+ght.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(Zca,"formatArgs");Hb.log=console.debug||console.log||(()=>{});function Xca(t){try{t?Hb.storage.setItem("debug",t):Hb.storage.removeItem("debug")}catch{}}a(Xca,"save");function ela(){let t;try{t=Hb.storage.getItem("debug")||Hb.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(ela,"load");function tla(){try{return localStorage}catch{}}a(tla,"localstorage");ght.exports=RAr()(Hb);var{formatters:rla}=ght.exports;rla.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Tdi=I((Vg,yht)=>{p();var nla=require("tty"),Aht=require("util");Vg.init=ula;Vg.log=ala;Vg.formatArgs=ola;Vg.save=cla;Vg.load=lla;Vg.useColors=ila;Vg.destroy=Aht.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Vg.colors=[6,2,3,4,5,1];try{let t=c$e();t&&(t.stderr||t).level>=2&&(Vg.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Vg.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function ila(){return"colors"in Vg.inspectOpts?!!Vg.inspectOpts.colors:nla.isatty(process.stderr.fd)}a(ila,"useColors");function ola(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` `).join(` -`+s),t.push(o+"m+"+Vpt.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Lsa()+e+" "+t[0]}a(Osa,"formatArgs");function Lsa(){return jg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(Lsa,"getDate");function Bsa(...t){return process.stderr.write($pt.formatWithOptions(jg.inspectOpts,...t)+` -`)}a(Bsa,"log");function Fsa(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(Fsa,"save");function Usa(){return process.env.DEBUG}a(Usa,"load");function Qsa(t){t.inspectOpts={};let e=Object.keys(jg.inspectOpts);for(let r=0;re.trim()).join(" ")};Dli.O=function(t){return this.inspectOpts.colors=this.useColors,$pt.inspect(t,this.inspectOpts)}});var Mli=I((map,Bgr)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Bgr.exports=Pli():Bgr.exports=Nli()});var Ugr=I((Aap,Oli)=>{"use strict";p();var Fgr=require("path").sep;Oli.exports=function(t){var e=t.split(Fgr),r=e.lastIndexOf("node_modules");if(r!==-1&&e[r+1]){for(var n=e[r+1][0]==="@",o=n?e[r+1]+"/"+e[r+2]:e[r+1],s=n?3:2,c="",l=r+s-1,u=0;u<=l;u++)u===l?c+=e[u]:c+=e[u]+Fgr;for(var d="",f=e.length-1,h=r+s;h<=f;h++)h===f?d+=e[h]:d+=e[h]+Fgr;return{name:o,basedir:c,path:d}}}});var Qgr=I((Eap,Lli)=>{"use strict";p();var qsa=require("os");Lli.exports=qsa.homedir||a(function(){var e=process.env.HOME,r=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform==="win32"?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:process.platform==="darwin"?e||(r?"/Users/"+r:null):process.platform==="linux"?e||(process.getuid()===0?"/root":r?"/home/"+r:null):e||null},"homedir")});var qgr=I((Cap,Bli)=>{p();Bli.exports=function(){var t=Error.prepareStackTrace;Error.prepareStackTrace=function(r,n){return n};var e=new Error().stack;return Error.prepareStackTrace=t,e[2].getFileName()}});var Fli=I((Sap,GMe)=>{"use strict";p();var jsa=process.platform==="win32",Hsa=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,jgr={};function Gsa(t){return Hsa.exec(t).slice(1)}a(Gsa,"win32SplitPath");jgr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=Gsa(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0]===e[1]?e[0]:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};var $sa=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,Hgr={};function Vsa(t){return $sa.exec(t).slice(1)}a(Vsa,"posixSplitPath");Hgr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=Vsa(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};jsa?GMe.exports=jgr.parse:GMe.exports=Hgr.parse;GMe.exports.posix=Hgr.parse;GMe.exports.win32=jgr.parse});var Ggr=I((xap,jli)=>{p();var qli=require("path"),Uli=qli.parse||Fli(),Qli=a(function(e,r){var n="/";/^([A-Za-z]:)/.test(e)?n="":/^\\\\/.test(e)&&(n="\\\\");for(var o=[e],s=Uli(e);s.dir!==o[o.length-1];)o.push(s.dir),s=Uli(s.dir);return o.reduce(function(c,l){return c.concat(r.map(function(u){return qli.resolve(n,l,u)}))},[])},"getNodeModulesDirs");jli.exports=a(function(e,r,n){var o=r&&r.moduleDirectory?[].concat(r.moduleDirectory):["node_modules"];if(r&&typeof r.paths=="function")return r.paths(n,e,function(){return Qli(e,o)},r);var s=Qli(e,o);return r&&r.paths?s.concat(r.paths):s},"nodeModulesPaths")});var $gr=I((kap,Hli)=>{p();Hli.exports=function(t,e){return e||{}}});var Vli=I((Dap,$li)=>{"use strict";p();var Wsa="Function.prototype.bind called on incompatible ",zsa=Object.prototype.toString,Ysa=Math.max,Ksa="[object Function]",Gli=a(function(e,r){for(var n=[],o=0;o{"use strict";p();var Xsa=Vli();Wli.exports=Function.prototype.bind||Xsa});var Kli=I((Fap,Yli)=>{"use strict";p();var eaa=Function.prototype.call,taa=Object.prototype.hasOwnProperty,raa=zli();Yli.exports=raa.call(eaa,taa)});var Jli=I((Qap,naa)=>{naa.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var $Me=I((qap,eui)=>{"use strict";p();var iaa=Kli();function oaa(t,e){for(var r=t.split("."),n=e.split(" "),o=n.length>1?n[0]:"=",s=(n.length>1?n[1]:n[0]).split("."),c=0;c<3;++c){var l=parseInt(r[c]||0,10),u=parseInt(s[c]||0,10);if(l!==u)return o==="<"?l="?l>=u:!1}return o===">="}a(oaa,"specifierIncluded");function Zli(t,e){var r=e.split(/ ?&& ?/);if(r.length===0)return!1;for(var n=0;n"u"?process.versions&&process.versions.node:t;if(typeof r!="string")throw new TypeError(typeof t>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(e&&typeof e=="object"){for(var n=0;n{p();var wee=require("fs"),aaa=Qgr(),Am=require("path"),caa=qgr(),laa=Ggr(),uaa=$gr(),daa=$Me(),faa=process.platform!=="win32"&&wee.realpath&&typeof wee.realpath.native=="function"?wee.realpath.native:wee.realpath,tui=aaa(),paa=a(function(){return[Am.join(tui,".node_modules"),Am.join(tui,".node_libraries")]},"defaultPaths"),haa=a(function(e,r){wee.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isFile()||o.isFIFO())})},"isFile"),maa=a(function(e,r){wee.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isDirectory())})},"isDirectory"),gaa=a(function(e,r){faa(e,function(n,o){n&&n.code!=="ENOENT"?r(n):r(null,n?e:o)})},"realpath"),VMe=a(function(e,r,n,o){n&&n.preserveSymlinks===!1?e(r,o):o(null,r)},"maybeRealpath"),Aaa=a(function(e,r,n){e(r,function(o,s){if(o)n(o);else try{var c=JSON.parse(s);n(null,c)}catch{n(null)}})},"defaultReadPackage"),yaa=a(function(e,r,n){for(var o=laa(r,n,e),s=0;s{Eaa.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":">= 23.4",_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var cui=I((zap,aui)=>{"use strict";p();var _aa=$Me(),oui=iui(),sui={};for(Wpt in oui)Object.prototype.hasOwnProperty.call(oui,Wpt)&&(sui[Wpt]=_aa(Wpt));var Wpt;aui.exports=sui});var uui=I((Kap,lui)=>{p();var vaa=$Me();lui.exports=a(function(e){return vaa(e)},"isCore")});var pui=I((Xap,fui)=>{p();var Caa=$Me(),Ree=require("fs"),DE=require("path"),baa=Qgr(),Saa=qgr(),Taa=Ggr(),Iaa=$gr(),xaa=process.platform!=="win32"&&Ree.realpathSync&&typeof Ree.realpathSync.native=="function"?Ree.realpathSync.native:Ree.realpathSync,dui=baa(),waa=a(function(){return[DE.join(dui,".node_modules"),DE.join(dui,".node_libraries")]},"defaultPaths"),Raa=a(function(e){try{var r=Ree.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&(r.isFile()||r.isFIFO())},"isFile"),kaa=a(function(e){try{var r=Ree.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&r.isDirectory()},"isDirectory"),Paa=a(function(e){try{return xaa(e)}catch(r){if(r.code!=="ENOENT")throw r}return e},"realpathSync"),WMe=a(function(e,r,n){return n&&n.preserveSymlinks===!1?e(r):r},"maybeRealpathSync"),Daa=a(function(e,r){var n=e(r);try{var o=JSON.parse(n);return o}catch{}},"defaultReadPackageSync"),Naa=a(function(e,r,n){for(var o=Taa(r,n,e),s=0;s{p();var zpt=nui();zpt.core=cui();zpt.isCore=uui();zpt.sync=pui();hui.exports=zpt});var mui=I((icp,Maa)=>{Maa.exports={name:"require-in-the-middle",version:"7.5.2",description:"Module to hook into the Node.js require function",main:"index.js",types:"types/index.d.ts",dependencies:{debug:"^4.3.5","module-details-from-path":"^1.0.3",resolve:"^1.22.8"},devDependencies:{"@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@babel/preset-typescript":"^7.9.0","@babel/register":"^7.9.0","ipp-printer":"^1.0.0",patterns:"^1.0.3",roundround:"^0.2.0",semver:"^6.3.0",standard:"^14.3.1",tape:"^4.11.0"},scripts:{test:"npm run test:lint && npm run test:tape && npm run test:babel","test:lint":"standard","test:tape":"tape test/*.js","test:babel":"node test/babel/babel-register.js"},repository:{type:"git",url:"git+https://github.com/nodejs/require-in-the-middle.git"},keywords:["require","hook","shim","shimmer","shimming","patch","monkey","monkeypatch","module","load"],files:["types"],author:"Thomas Watson Steen (https://twitter.com/wa7son)",license:"MIT",bugs:{url:"https://github.com/nodejs/require-in-the-middle/issues"},homepage:"https://github.com/nodejs/require-in-the-middle#readme",engines:{node:">=8.6.0"}}});var Kgr=I((ocp,Ygr)=>{"use strict";p();var g0e=require("path"),rD=require("module"),dh=Mli()("require-in-the-middle"),Oaa=Ugr();Ygr.exports=zMe;Ygr.exports.Hook=zMe;var Wgr,m0e;if(rD.isBuiltin)m0e=rD.isBuiltin;else if(rD.builtinModules)m0e=a(t=>t.startsWith("node:")?!0:(Wgr===void 0&&(Wgr=new Set(rD.builtinModules)),Wgr.has(t)),"isCore");else{let t=Vgr(),[e,r]=process.versions.node.split(".").map(Number);e===8&&r<8?m0e=a(n=>n==="http2"?!0:!!t.core[n],"isCore"):m0e=a(n=>!!t.core[n],"isCore")}var Ypt;function Laa(t,e){if(!Ypt)if(require.resolve&&require.resolve.paths)Ypt=a(function(r,n){return require.resolve(r,{paths:[n]})},"_resolve");else{let r=Vgr();Ypt=a(function(n,o){return r.sync(n,{basedir:o})},"_resolve")}return Ypt(t,e)}a(Laa,"resolve");var Baa=/([/\\]index)?(\.js)?$/,zgr=class{static{a(this,"ExportsCache")}constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,r){if(this._localCache.has(e))return!0;if(r)return!1;{let n=require.cache[e];return!!(n&&this._kRitmExports in n)}}get(e,r){let n=this._localCache.get(e);if(n!==void 0)return n;if(!r){let o=require.cache[e];return o&&o[this._kRitmExports]}}set(e,r,n){n?this._localCache.set(e,r):e in require.cache?require.cache[e][this._kRitmExports]=r:(dh('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,r))}};function zMe(t,e,r){if(!(this instanceof zMe))return new zMe(t,e,r);if(typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),typeof rD._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof rD._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,mui().bugs.url);return}this._cache=new zgr,this._unhooked=!1,this._origRequire=rD.prototype.require;let n=this,o=new Set,s=e?e.internals===!0:!1,c=Array.isArray(t);dh("registering require hook"),this._require=rD.prototype.require=function(u){return n._unhooked===!0?(dh("ignoring require call - module is soft-unhooked"),n._origRequire.apply(this,arguments)):l.call(this,arguments,!1)},typeof process.getBuiltinModule=="function"&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(u){return n._unhooked===!0?(dh("ignoring process.getBuiltinModule call - module is soft-unhooked"),n._origGetBuiltinModule.apply(this,arguments)):l.call(this,arguments,!0)});function l(u,d){let f=u[0],h=m0e(f),m;if(h){if(m=f,f.startsWith("node:")){let v=f.slice(5);m0e(v)&&(m=v)}}else{if(d)return dh("call to process.getBuiltinModule with unknown built-in id"),n._origGetBuiltinModule.apply(this,u);try{m=rD._resolveFilename(f,this)}catch(v){return dh('Module._resolveFilename("%s") threw %j, calling original Module.require',f,v.message),n._origRequire.apply(this,u)}}let g,A;if(dh("processing %s module require('%s'): %s",h===!0?"core":"non-core",f,m),n._cache.has(m,h)===!0)return dh("returning already patched cached module: %s",m),n._cache.get(m,h);let y=o.has(m);y===!1&&o.add(m);let E=d?n._origGetBuiltinModule.apply(this,u):n._origRequire.apply(this,u);if(y===!0)return dh("module is in the process of being patched already - ignoring: %s",m),E;if(o.delete(m),h===!0){if(c===!0&&t.includes(m)===!1)return dh("ignoring core module not on whitelist: %s",m),E;g=m}else if(c===!0&&t.includes(m)){let v=g0e.parse(m);g=v.name,A=v.dir}else{let v=Oaa(m);if(v===void 0)return dh("could not parse filename: %s",m),E;g=v.name,A=v.basedir;let b=Faa(v);dh("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",g,f,b,A);let T=!1;if(c){if(!f.startsWith(".")&&t.includes(f)&&(g=f,T=!0),!t.includes(g)&&!t.includes(b))return E;t.includes(b)&&b!==g&&(g=b,T=!0)}if(!T){let w;try{w=Laa(g,A)}catch{return dh("could not resolve module: %s",g),n._cache.set(m,E,h),E}if(w!==m)if(s===!0)g=g+g0e.sep+g0e.relative(A,m),dh("preparing to process require of internal file: %s",g);else return dh("ignoring require of non-main module file: %s",w),n._cache.set(m,E,h),E}}n._cache.set(m,E,h),dh("calling require hook: %s",g);let _=r(E,g,A);return n._cache.set(m,_,h),dh("returning module: %s",g),_}a(l,"patchedRequire")}a(zMe,"Hook");zMe.prototype.unhook=function(){this._unhooked=!0,this._require===rD.prototype.require?(rD.prototype.require=this._origRequire,dh("require unhook successful")):dh("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,dh("process.getBuiltinModule unhook successful")):dh("process.getBuiltinModule unhook unsuccessful"))};function Faa(t){let e=g0e.sep!=="/"?t.path.split(g0e.sep).join("/"):t.path;return g0e.posix.join(t.name,e).replace(Baa,"")}a(Faa,"resolveModuleName")});var Kpt,Jpt,gui=ve(()=>{p();Kpt=class{static{a(this,"ModuleNameTrieNode")}hooks=[];children=new Map},Jpt=class{static{a(this,"ModuleNameTrie")}_trie=new Kpt;_counter=0;insert(e){let r=this._trie;for(let n of e.moduleName.split("/")){let o=r.children.get(n);o||(o=new Kpt,r.children.set(n,o)),r=o}r.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:r,fullOnly:n}={}){let o=this._trie,s=[],c=!0;for(let l of e.split("/")){let u=o.children.get(l);if(!u){c=!1;break}n||s.push(...u.hooks),o=u}return n&&c&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(r&&s.sort((l,u)=>l.insertedId-u.insertedId),s.map(({hook:l})=>l))}}});function Qaa(t){return Jgr.sep!=="/"?t.split(Jgr.sep).join("/"):t}var yui,Jgr,Uaa,Zpt,Eui=ve(()=>{p();yui=de(Kgr()),Jgr=de(require("path"));gui();Uaa=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),Zpt=class t{static{a(this,"RequireInTheMiddleSingleton")}_moduleNameTrie=new Jpt;static _instance;constructor(){this._initialize()}_initialize(){new yui.Hook(null,{internals:!0},(e,r,n)=>{let o=Qaa(r),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:n===void 0});for(let{onRequire:c}of s)e=c(e,r,n);return e})}register(e,r){let n={moduleName:e,onRequire:r};return this._moduleNameTrie.insert(n),n}static getInstance(){return Uaa?new t:this._instance=this._instance??new t}};a(Qaa,"normalizePathSeparators")});var Tui=I(kee=>{p();var _ui=[],Zgr=new WeakMap,vui=new WeakMap,Cui=new Map,bui=[],qaa={set(t,e,r){return Zgr.get(t)[e](r)},get(t,e){if(e===Symbol.toStringTag)return"Module";let r=vui.get(t)[e];if(typeof r=="function")return r()},defineProperty(t,e,r){if(!("value"in r))throw new Error("Getters/setters are not supported for exports property descriptors.");return Zgr.get(t)[e](r.value)}};function jaa(t,e,r,n,o){Cui.set(t,o),Zgr.set(e,r),vui.set(e,n);let s=new Proxy(e,qaa);_ui.forEach(c=>c(t,s)),bui.push([t,s])}a(jaa,"register");var Sui=!1;function Haa(){return Sui}a(Haa,"getExperimentalPatchInternals");function Gaa(t){Sui=t}a(Gaa,"setExperimentalPatchInternals");kee.register=jaa;kee.importHooks=_ui;kee.specifiers=Cui;kee.toHook=bui;kee.getExperimentalPatchInternals=Haa;kee.setExperimentalPatchInternals=Gaa});var Pui=I((ycp,A0e)=>{p();var Iui=require("path"),$aa=Ugr(),{fileURLToPath:xui}=require("url"),{MessageChannel:Vaa}=require("worker_threads"),{importHooks:Xgr,specifiers:Waa,toHook:zaa,getExperimentalPatchInternals:Yaa}=Tui();function Rui(t){Xgr.push(t),zaa.forEach(([e,r])=>t(e,r))}a(Rui,"addHook");function kui(t){let e=Xgr.indexOf(t);e>-1&&Xgr.splice(e,1)}a(kui,"removeHook");function wui(t,e,r,n){let o=t(e,r,n);o&&o!==e&&(e.default=o)}a(wui,"callHookFn");var eAr;function Kaa(){let{port1:t,port2:e}=new Vaa,r=0,n;eAr=a(l=>{r++,t.postMessage(l)},"sendModulesToLoader"),t.on("message",()=>{r--,n&&r<=0&&n()}).unref();function o(){let l=setInterval(()=>{},1e3),u=new Promise(d=>{n=d}).then(()=>{clearInterval(l)});return r===0&&n(),u}a(o,"waitForAllMessagesAcknowledged");let s=e;return{registerOptions:{data:{addHookMessagePort:s,include:[]},transferList:[s]},addHookMessagePort:s,waitForAllMessagesAcknowledged:o}}a(Kaa,"createAddHookMessageChannel");function YMe(t,e,r){if(!(this instanceof YMe))return new YMe(t,e,r);typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let n=e?e.internals===!0:!1;eAr&&Array.isArray(t)&&eAr(t),this._iitmHook=(o,s)=>{let c=o,l=o.startsWith("node:"),u;if(l)o=o.replace(/^node:/,"");else{if(o.startsWith("file://"))try{o=xui(o)}catch{}let d=$aa(o);d&&(o=d.name,u=d.basedir)}if(t){for(let d of t)if(d===o){if(u){if(n)o=o+Iui.sep+Iui.relative(u,xui(c));else if(!Yaa()&&!u.endsWith(Waa.get(c)))continue}wui(r,s,o,u)}}else wui(r,s,o,u)},Rui(this._iitmHook)}a(YMe,"Hook");YMe.prototype.unhook=function(){kui(this._iitmHook)};A0e.exports=YMe;A0e.exports.Hook=YMe;A0e.exports.addHook=Rui;A0e.exports.removeHook=kui;A0e.exports.createAddHookMessageChannel=Kaa});function Dui(t,e,r){let n,o;try{o=t()}catch(s){n=s}finally{if(e(n,o),n&&!r)throw n;return o}}async function Nui(t,e,r){let n,o;try{o=await t()}catch(s){n=s}finally{if(e(n,o),n&&!r)throw n;return o}}function Xpt(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var tAr=ve(()=>{p();a(Dui,"safeExecuteInTheMiddle");a(Nui,"safeExecuteInTheMiddleAsync");a(Xpt,"isWrapped")});function Mui(t,e,r){return typeof e>"u"?t.includes("*"):t.some(n=>Eli(e,n,{includePrerelease:r}))}var M8,rAr,KMe,Oui,Lui,Bui,y0e,Fui=ve(()=>{p();M8=de(require("path")),rAr=require("util");bli();KMe=de(d0e());xli();Eui();Oui=de(Pui());co();Lui=de(Kgr()),Bui=require("fs");tAr();y0e=class extends jpt{static{a(this,"InstrumentationBase")}_modules;_hooks=[];_requireInTheMiddleSingleton=Zpt.getInstance();_enabled=!1;constructor(e,r,n){super(e,r,n);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=a((e,r,n)=>{if(Xpt(e[r])&&this._unwrap(e,r),rAr.types.isProxy(e)){let o=(0,KMe.wrap)(Object.assign({},e),r,n);return Object.defineProperty(e,r,{value:o}),o}else return(0,KMe.wrap)(e,r,n)},"_wrap");_unwrap=a((e,r)=>rAr.types.isProxy(e)?Object.defineProperty(e,r,{value:e[r]}):(0,KMe.unwrap)(e,r),"_unwrap");_massWrap=a((e,r,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Dn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Dn.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{r.forEach(s=>{this._wrap(o,s,n)})})},"_massWrap");_massUnwrap=a((e,r)=>{if(e)Array.isArray(e)||(e=[e]);else{Dn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Dn.error("must provide one or more functions to wrap on modules");return}e.forEach(n=>{r.forEach(o=>{this._unwrap(n,o)})})},"_massUnwrap");_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:r}=e;try{let n=require.resolve(r);require.cache[n]&&this._diag.warn(`Module ${r} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${r}`)}catch{}})}_extractPackageVersion(e){try{let r=(0,Bui.readFileSync)(M8.join(e,"package.json"),{encoding:"utf8"}),n=JSON.parse(r).version;return typeof n=="string"?n:void 0}catch{Dn.warn("Failed extracting version",e)}}_onRequire(e,r,n,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=r,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(r)):r;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===n)return Mui(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=r,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(r,e.moduleVersion)):r;let c=e.files??[],l=M8.normalize(n);return c.filter(d=>d.name===l).filter(d=>Mui(d.supportedVersions,s,e.includePrerelease)).reduce((d,f)=>(f.moduleExports=d,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:f.name,baseDir:o}),f.patch(d,e.moduleVersion)):d),r)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let r of e.files)r.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:r.name}),r.patch(r.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let r=a((c,l,u)=>{if(!u&&M8.isAbsolute(l)){let d=M8.parse(l);l=d.name,u=d.dir}return this._onRequire(e,c,l,u)},"hookFn"),n=a((c,l,u)=>this._onRequire(e,c,l,u),"onRequire"),o=M8.isAbsolute(e.name)?new Lui.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(o);let s=new Oui.Hook([e.name],{internals:!1},r);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let r of e.files)r.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:r.name}),r.unpatch(r.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};a(Mui,"isSupported")});var JMe,Uui=ve(()=>{p();JMe=require("path")});var Qui=ve(()=>{p();Fui();Uui()});var nAr=ve(()=>{p();Qui()});var eht,qui=ve(()=>{p();eht=class{static{a(this,"InstrumentationNodeModuleDefinition")}name;supportedVersions;patch;unpatch;files;constructor(e,r,n,o,s){this.name=e,this.supportedVersions=r,this.patch=n,this.unpatch=o,this.files=s||[]}}});var tht,jui=ve(()=>{p();nAr();tht=class{static{a(this,"InstrumentationNodeModuleFile")}supportedVersions;patch;unpatch;name;constructor(e,r,n,o){this.supportedVersions=r,this.patch=n,this.unpatch=o,this.name=(0,JMe.normalize)(e)}}});var iAr={};ki(iAr,{InstrumentationBase:()=>y0e,InstrumentationNodeModuleDefinition:()=>eht,InstrumentationNodeModuleFile:()=>tht,isWrapped:()=>Xpt,registerInstrumentations:()=>fli,safeExecuteInTheMiddle:()=>Dui,safeExecuteInTheMiddleAsync:()=>Nui});var oAr=ve(()=>{p();pli();nAr();qui();jui();tAr()});var Gui=I(sAr=>{"use strict";p();Object.defineProperty(sAr,"__esModule",{value:!0});sAr.log=eca;var Hui=(m3(),ba(iQ)),Jaa=require("node:os"),Zaa=Hui.__importDefault(require("node:util")),Xaa=Hui.__importStar(require("node:process"));function eca(t,...e){Xaa.stderr.write(`${Zaa.default.format(t,...e)}${Jaa.EOL}`)}a(eca,"log")});var Yui=I(dAr=>{"use strict";p();Object.defineProperty(dAr,"__esModule",{value:!0});var tca=Gui(),$ui=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,Vui,aAr=[],cAr=[],rht=[];$ui&&lAr($ui);var Wui=Object.assign(t=>zui(t),{enable:lAr,enabled:uAr,disable:rca,log:tca.log});function lAr(t){Vui=t,aAr=[],cAr=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?cAr.push(new RegExp(`^${n.substr(1)}$`)):aAr.push(new RegExp(`^${n}$`));for(let n of rht)n.enabled=uAr(n.namespace)}a(lAr,"enable");function uAr(t){if(t.endsWith("*"))return!0;for(let e of cAr)if(e.test(t))return!1;for(let e of aAr)if(e.test(t))return!0;return!1}a(uAr,"enabled");function rca(){let t=Vui||"";return lAr(""),t}a(rca,"disable");function zui(t){let e=Object.assign(r,{enabled:uAr(t),destroy:nca,log:Wui.log,namespace:t,extend:ica});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),rht.push(e),e}a(zui,"createDebugger");function nca(){let t=rht.indexOf(this);return t>=0?(rht.splice(t,1),!0):!1}a(nca,"destroy");function ica(t){let e=zui(`${this.namespace}:${t}`);return e.log=this.log,e}a(ica,"extend");dAr.default=Wui});var sht=I(b4=>{"use strict";p();Object.defineProperty(b4,"__esModule",{value:!0});b4.AzureLogger=void 0;b4.setLogLevel=Zui;b4.getLogLevel=sca;b4.createClientLogger=aca;var oca=(m3(),ba(iQ)),ZMe=oca.__importDefault(Yui()),Jui=new Set,nht=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,oht;b4.AzureLogger=(0,ZMe.default)("azure");b4.AzureLogger.log=(...t)=>{ZMe.default.log(...t)};var fAr=["verbose","info","warning","error"];nht&&(tdi(nht)?Zui(nht):console.error(`AZURE_LOG_LEVEL set to unknown log level '${nht}'; logging is not enabled. Acceptable values: ${fAr.join(", ")}.`));function Zui(t){if(t&&!tdi(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${fAr.join(",")}`);oht=t;let e=[];for(let r of Jui)edi(r)&&e.push(r.namespace);ZMe.default.enable(e.join(","))}a(Zui,"setLogLevel");function sca(){return oht}a(sca,"getLogLevel");var Kui={verbose:400,info:300,warning:200,error:100};function aca(t){let e=b4.AzureLogger.extend(t);return Xui(b4.AzureLogger,e),{error:iht(e,"error"),warning:iht(e,"warning"),info:iht(e,"info"),verbose:iht(e,"verbose")}}a(aca,"createClientLogger");function Xui(t,e){e.log=(...r)=>{t.log(...r)}}a(Xui,"patchLogMethod");function iht(t,e){let r=Object.assign(t.extend(e),{level:e});if(Xui(t,r),edi(r)){let n=ZMe.default.disable();ZMe.default.enable(n+","+r.namespace)}return Jui.add(r),r}a(iht,"createLogger");function edi(t){return!!(oht&&Kui[t.level]<=Kui[oht])}a(edi,"shouldEnable");function tdi(t){return fAr.includes(t)}a(tdi,"isAzureLogLevel")});var pAr=I(aht=>{"use strict";p();Object.defineProperty(aht,"__esModule",{value:!0});aht.logger=void 0;var cca=sht();aht.logger=(0,cca.createClientLogger)("opentelemetry-instrumentation-azure-sdk")});function cht(t){return t.setValue(hAr,!0)}function rdi(t){return t.deleteValue(hAr)}function E0e(t){return t.getValue(hAr)===!0}var hAr,XMe=ve(()=>{p();co();hAr=_b("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(cht,"suppressTracing");a(rdi,"unsuppressTracing");a(E0e,"isTracingSuppressed")});var lht,ndi=ve(()=>{p();lht="baggage"});function odi(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?",":""}${r}`;return n.length>8192?e:n},"")}function sdi(t){return t.getAllEntries().map(([e,r])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=";"+r.metadata.toString()),n})}function mAr(t){let e=t.split(";");if(e.length<=0)return;let r=e.shift();if(!r)return;let n=r.indexOf("=");if(n<=0)return;let o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=Hpe(e.join(";"))),{key:o,value:s,metadata:c}}function adi(t){let e={};return typeof t=="string"&&t.length>0&&t.split(",").forEach(r=>{let n=mAr(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var gAr=ve(()=>{p();co();a(odi,"serializeKeyPairs");a(sdi,"getKeyPairs");a(mAr,"parsePairKeyValue");a(adi,"parseKeyPairsIntoRecord")});var dht,cdi=ve(()=>{p();co();XMe();ndi();gAr();dht=class{static{a(this,"W3CBaggagePropagator")}inject(e,r,n){let o=kT.getBaggage(e);if(!o||E0e(e))return;let s=sdi(o).filter(l=>l.length<=4096).slice(0,180),c=odi(s);c.length>0&&n.set(r,lht,c)}extract(e,r,n){let o=n.get(r,lht),s=Array.isArray(o)?o.join(","):o;if(!s)return e;let c={};return s.length===0||(s.split(",").forEach(u=>{let d=mAr(u);if(d){let f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0)?e:kT.setBaggage(e,kT.createBaggage(c))}fields(){return[lht]}}});var fht,ldi=ve(()=>{p();fht=class{static{a(this,"AnchoredClock")}_monotonicClock;_epochMillis;_performanceMillis;constructor(e,r){this._monotonicClock=r,this._epochMillis=e.now(),this._performanceMillis=r.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function udi(t){let e={};if(typeof t!="object"||t==null)return e;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(!dca(r)){Dn.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!AAr(n)){Dn.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function dca(t){return typeof t=="string"&&t!==""}function AAr(t){return t==null?!0:Array.isArray(t)?fca(t):ddi(typeof t)}function fca(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(ddi(n)){e=n;continue}return!1}return!1}}return!0}function ddi(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var fdi=ve(()=>{p();co();a(udi,"sanitizeAttributes");a(dca,"isAttributeKey");a(AAr,"isAttributeValue");a(fca,"isHomogeneousAttributeValueArray");a(ddi,"isValidPrimitiveAttributeValueType")});function pht(){return t=>{Dn.error(pca(t))}}function pca(t){return typeof t=="string"?t:JSON.stringify(hca(t))}function hca(t){let e={},r=t;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(e[n])return;let o=r[n];o&&(e[n]=String(o))}),r=Object.getPrototypeOf(r);return e}var yAr=ve(()=>{p();co();a(pht,"loggingErrorHandler");a(pca,"stringifyException");a(hca,"flattenException")});function hdi(t){pdi=t}function mdi(t){try{pdi(t)}catch{}}var pdi,gdi=ve(()=>{p();yAr();pdi=pht();a(hdi,"setGlobalErrorHandler");a(mdi,"globalErrorHandler")});function hht(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){Dn.warn(`Unknown value ${(0,EAr.inspect)(e)} for ${t}, expected a number, using defaults`);return}return r}function eOe(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function mht(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||Dn.warn(`Unknown value ${(0,EAr.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function ght(t){return eOe(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var EAr,Adi=ve(()=>{p();co();EAr=require("util");a(hht,"getNumberFromEnv");a(eOe,"getStringFromEnv");a(mht,"getBooleanFromEnv");a(ght,"getStringListFromEnv")});var Aht,ydi=ve(()=>{p();Aht=typeof globalThis=="object"?globalThis:global});var Edi,sG,_di=ve(()=>{p();Edi=require("perf_hooks"),sG=Edi.performance});var vdi,Cdi=ve(()=>{p();vdi="2.2.0"});function fh(t){let e={},r=t.length;for(let n=0;n{p();a(fh,"createConstMap")});var bdi,Sdi,Tdi,Idi,xdi,wdi,Rdi,kdi,Pdi,Ddi,Ndi,Mdi,Odi,Ldi,Bdi,Fdi,Udi,Qdi,qdi,jdi,Hdi,Gdi,$di,Vdi,Wdi,zdi,Ydi,Kdi,Jdi,Zdi,Xdi,efi,tfi,rfi,nfi,ifi,ofi,sfi,afi,cfi,lfi,ufi,dfi,ffi,pfi,hfi,mfi,gfi,Afi,yfi,Efi,_fi,vfi,Cfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,kfi,Pfi,Dfi,Nfi,Mfi,Ofi,Lfi,Bfi,Ffi,Ufi,Qfi,qfi,jfi,Hfi,Gfi,$fi,Vfi,Wfi,zfi,Yfi,Kfi,Jfi,Zfi,Xfi,epi,tpi,rpi,npi,ipi,opi,spi,api,cpi,lpi,upi,dpi,fpi,ppi,hpi,mpi,gpi,Api,ypi,Epi,_pi,vpi,Cpi,bpi,Spi,Tpi,Ipi,xpi,wpi,Rpi,kpi,Ppi,Dpi,Npi,Mpi,Opi,Lpi,Bpi,Fpi,Upi,Qpi,qpi,jpi,mca,gca,Aca,yca,Eca,_ca,vca,Cca,bca,Sca,Tca,Ica,xca,wca,Rca,kca,Pca,Dca,Nca,Mca,Oca,Lca,Bca,Fca,Uca,Qca,qca,jca,Hca,Gca,$ca,Vca,Wca,zca,Yca,Kca,Jca,Zca,Xca,ela,tla,rla,nla,ila,ola,sla,ala,cla,lla,ula,dla,fla,pla,hla,mla,gla,Ala,yla,Ela,_la,vla,Cla,bla,Sla,Tla,Ila,xla,wla,Rla,kla,Pla,Dla,Nla,Mla,Ola,Lla,Bla,Fla,Ula,Qla,qla,jla,Hla,Gla,$la,Vla,Wla,zla,Yla,Kla,Jla,Zla,Xla,eua,tua,rua,nua,iua,oua,sua,aua,cua,lua,uua,dua,fua,pua,hua,mua,gua,Aua,yua,Eua,_ua,vua,Cua,bua,Sua,Tua,Iua,xua,wua,Rua,kua,Pua,Dua,Nua,Mua,Oua,Hpi,Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi,Jpi,Zpi,Xpi,ehi,thi,rhi,nhi,ihi,ohi,shi,ahi,chi,lhi,uhi,dhi,fhi,phi,hhi,mhi,ghi,Ahi,yhi,Ehi,_hi,vhi,Chi,bhi,Shi,Thi,Ihi,xhi,whi,Rhi,khi,Phi,Dhi,Nhi,Mhi,Ohi,Lua,Bua,Fua,Uua,Qua,qua,jua,Hua,Gua,$ua,Vua,Wua,zua,Yua,Kua,Jua,Zua,Xua,eda,tda,rda,nda,ida,oda,sda,ada,cda,lda,uda,dda,fda,pda,hda,mda,gda,Ada,yda,Eda,_da,vda,Cda,bda,Sda,Tda,Ida,xda,wda,Rda,Lhi,Bhi,Fhi,Uhi,Qhi,qhi,jhi,Hhi,Ghi,$hi,Vhi,kda,Pda,Dda,Nda,Mda,Oda,Lda,Bda,Fda,Uda,Qda,qda,Whi,zhi,Yhi,Khi,Jhi,jda,Hda,Gda,$da,Vda,Wda,Zhi,Xhi,emi,zda,Yda,Kda,Jda,tmi,rmi,nmi,imi,Zda,Xda,efa,tfa,rfa,omi,smi,ami,cmi,lmi,umi,dmi,nfa,ifa,ofa,sfa,afa,cfa,lfa,ufa,fmi,pmi,hmi,mmi,gmi,dfa,ffa,pfa,hfa,mfa,gfa,Ami,ymi,Emi,_mi,vmi,Cmi,bmi,Smi,Tmi,Imi,xmi,wmi,Rmi,kmi,Pmi,Dmi,Nmi,Mmi,Omi,Lmi,Bmi,Afa,yfa,Efa,_fa,vfa,Cfa,bfa,Sfa,Tfa,Ifa,xfa,wfa,Rfa,kfa,Pfa,Dfa,Nfa,Mfa,Ofa,Lfa,Bfa,Ffa,Fmi,Umi,Qmi,qmi,jmi,Ufa,Qfa,qfa,jfa,Hfa,Gfa,Hmi,Gmi,$fa,Vfa,Wfa,$mi,Vmi,zfa,Yfa,Kfa,Wmi,zmi,Ymi,Kmi,Jmi,Zmi,Xmi,e0i,t0i,r0i,n0i,i0i,o0i,s0i,a0i,c0i,l0i,Jfa,Zfa,Xfa,epa,tpa,rpa,npa,ipa,opa,spa,apa,cpa,lpa,upa,dpa,fpa,ppa,hpa,u0i,d0i,mpa,gpa,Apa,f0i=ve(()=>{p();_Ar();bdi="aws.lambda.invoked_arn",Sdi="db.system",Tdi="db.connection_string",Idi="db.user",xdi="db.jdbc.driver_classname",wdi="db.name",Rdi="db.statement",kdi="db.operation",Pdi="db.mssql.instance_name",Ddi="db.cassandra.keyspace",Ndi="db.cassandra.page_size",Mdi="db.cassandra.consistency_level",Odi="db.cassandra.table",Ldi="db.cassandra.idempotence",Bdi="db.cassandra.speculative_execution_count",Fdi="db.cassandra.coordinator.id",Udi="db.cassandra.coordinator.dc",Qdi="db.hbase.namespace",qdi="db.redis.database_index",jdi="db.mongodb.collection",Hdi="db.sql.table",Gdi="exception.type",$di="exception.message",Vdi="exception.stacktrace",Wdi="exception.escaped",zdi="faas.trigger",Ydi="faas.execution",Kdi="faas.document.collection",Jdi="faas.document.operation",Zdi="faas.document.time",Xdi="faas.document.name",efi="faas.time",tfi="faas.cron",rfi="faas.coldstart",nfi="faas.invoked_name",ifi="faas.invoked_provider",ofi="faas.invoked_region",sfi="net.transport",afi="net.peer.ip",cfi="net.peer.port",lfi="net.peer.name",ufi="net.host.ip",dfi="net.host.port",ffi="net.host.name",pfi="net.host.connection.type",hfi="net.host.connection.subtype",mfi="net.host.carrier.name",gfi="net.host.carrier.mcc",Afi="net.host.carrier.mnc",yfi="net.host.carrier.icc",Efi="peer.service",_fi="enduser.id",vfi="enduser.role",Cfi="enduser.scope",bfi="thread.id",Sfi="thread.name",Tfi="code.function",Ifi="code.namespace",xfi="code.filepath",wfi="code.lineno",Rfi="http.method",kfi="http.url",Pfi="http.target",Dfi="http.host",Nfi="http.scheme",Mfi="http.status_code",Ofi="http.flavor",Lfi="http.user_agent",Bfi="http.request_content_length",Ffi="http.request_content_length_uncompressed",Ufi="http.response_content_length",Qfi="http.response_content_length_uncompressed",qfi="http.server_name",jfi="http.route",Hfi="http.client_ip",Gfi="aws.dynamodb.table_names",$fi="aws.dynamodb.consumed_capacity",Vfi="aws.dynamodb.item_collection_metrics",Wfi="aws.dynamodb.provisioned_read_capacity",zfi="aws.dynamodb.provisioned_write_capacity",Yfi="aws.dynamodb.consistent_read",Kfi="aws.dynamodb.projection",Jfi="aws.dynamodb.limit",Zfi="aws.dynamodb.attributes_to_get",Xfi="aws.dynamodb.index_name",epi="aws.dynamodb.select",tpi="aws.dynamodb.global_secondary_indexes",rpi="aws.dynamodb.local_secondary_indexes",npi="aws.dynamodb.exclusive_start_table",ipi="aws.dynamodb.table_count",opi="aws.dynamodb.scan_forward",spi="aws.dynamodb.segment",api="aws.dynamodb.total_segments",cpi="aws.dynamodb.count",lpi="aws.dynamodb.scanned_count",upi="aws.dynamodb.attribute_definitions",dpi="aws.dynamodb.global_secondary_index_updates",fpi="messaging.system",ppi="messaging.destination",hpi="messaging.destination_kind",mpi="messaging.temp_destination",gpi="messaging.protocol",Api="messaging.protocol_version",ypi="messaging.url",Epi="messaging.message_id",_pi="messaging.conversation_id",vpi="messaging.message_payload_size_bytes",Cpi="messaging.message_payload_compressed_size_bytes",bpi="messaging.operation",Spi="messaging.consumer_id",Tpi="messaging.rabbitmq.routing_key",Ipi="messaging.kafka.message_key",xpi="messaging.kafka.consumer_group",wpi="messaging.kafka.client_id",Rpi="messaging.kafka.partition",kpi="messaging.kafka.tombstone",Ppi="rpc.system",Dpi="rpc.service",Npi="rpc.method",Mpi="rpc.grpc.status_code",Opi="rpc.jsonrpc.version",Lpi="rpc.jsonrpc.request_id",Bpi="rpc.jsonrpc.error_code",Fpi="rpc.jsonrpc.error_message",Upi="message.type",Qpi="message.id",qpi="message.compressed_size",jpi="message.uncompressed_size",mca=bdi,gca=Sdi,Aca=Tdi,yca=Idi,Eca=xdi,_ca=wdi,vca=Rdi,Cca=kdi,bca=Pdi,Sca=Ddi,Tca=Ndi,Ica=Mdi,xca=Odi,wca=Ldi,Rca=Bdi,kca=Fdi,Pca=Udi,Dca=Qdi,Nca=qdi,Mca=jdi,Oca=Hdi,Lca=Gdi,Bca=$di,Fca=Vdi,Uca=Wdi,Qca=zdi,qca=Ydi,jca=Kdi,Hca=Jdi,Gca=Zdi,$ca=Xdi,Vca=efi,Wca=tfi,zca=rfi,Yca=nfi,Kca=ifi,Jca=ofi,Zca=sfi,Xca=afi,ela=cfi,tla=lfi,rla=ufi,nla=dfi,ila=ffi,ola=pfi,sla=hfi,ala=mfi,cla=gfi,lla=Afi,ula=yfi,dla=Efi,fla=_fi,pla=vfi,hla=Cfi,mla=bfi,gla=Sfi,Ala=Tfi,yla=Ifi,Ela=xfi,_la=wfi,vla=Rfi,Cla=kfi,bla=Pfi,Sla=Dfi,Tla=Nfi,Ila=Mfi,xla=Ofi,wla=Lfi,Rla=Bfi,kla=Ffi,Pla=Ufi,Dla=Qfi,Nla=qfi,Mla=jfi,Ola=Hfi,Lla=Gfi,Bla=$fi,Fla=Vfi,Ula=Wfi,Qla=zfi,qla=Yfi,jla=Kfi,Hla=Jfi,Gla=Zfi,$la=Xfi,Vla=epi,Wla=tpi,zla=rpi,Yla=npi,Kla=ipi,Jla=opi,Zla=spi,Xla=api,eua=cpi,tua=lpi,rua=upi,nua=dpi,iua=fpi,oua=ppi,sua=hpi,aua=mpi,cua=gpi,lua=Api,uua=ypi,dua=Epi,fua=_pi,pua=vpi,hua=Cpi,mua=bpi,gua=Spi,Aua=Tpi,yua=Ipi,Eua=xpi,_ua=wpi,vua=Rpi,Cua=kpi,bua=Ppi,Sua=Dpi,Tua=Npi,Iua=Mpi,xua=Opi,wua=Lpi,Rua=Bpi,kua=Fpi,Pua=Upi,Dua=Qpi,Nua=qpi,Mua=jpi,Oua=fh([bdi,Sdi,Tdi,Idi,xdi,wdi,Rdi,kdi,Pdi,Ddi,Ndi,Mdi,Odi,Ldi,Bdi,Fdi,Udi,Qdi,qdi,jdi,Hdi,Gdi,$di,Vdi,Wdi,zdi,Ydi,Kdi,Jdi,Zdi,Xdi,efi,tfi,rfi,nfi,ifi,ofi,sfi,afi,cfi,lfi,ufi,dfi,ffi,pfi,hfi,mfi,gfi,Afi,yfi,Efi,_fi,vfi,Cfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,kfi,Pfi,Dfi,Nfi,Mfi,Ofi,Lfi,Bfi,Ffi,Ufi,Qfi,qfi,jfi,Hfi,Gfi,$fi,Vfi,Wfi,zfi,Yfi,Kfi,Jfi,Zfi,Xfi,epi,tpi,rpi,npi,ipi,opi,spi,api,cpi,lpi,upi,dpi,fpi,ppi,hpi,mpi,gpi,Api,ypi,Epi,_pi,vpi,Cpi,bpi,Spi,Tpi,Ipi,xpi,wpi,Rpi,kpi,Ppi,Dpi,Npi,Mpi,Opi,Lpi,Bpi,Fpi,Upi,Qpi,qpi,jpi]),Hpi="other_sql",Gpi="mssql",$pi="mysql",Vpi="oracle",Wpi="db2",zpi="postgresql",Ypi="redshift",Kpi="hive",Jpi="cloudscape",Zpi="hsqldb",Xpi="progress",ehi="maxdb",thi="hanadb",rhi="ingres",nhi="firstsql",ihi="edb",ohi="cache",shi="adabas",ahi="firebird",chi="derby",lhi="filemaker",uhi="informix",dhi="instantdb",fhi="interbase",phi="mariadb",hhi="netezza",mhi="pervasive",ghi="pointbase",Ahi="sqlite",yhi="sybase",Ehi="teradata",_hi="vertica",vhi="h2",Chi="coldfusion",bhi="cassandra",Shi="hbase",Thi="mongodb",Ihi="redis",xhi="couchbase",whi="couchdb",Rhi="cosmosdb",khi="dynamodb",Phi="neo4j",Dhi="geode",Nhi="elasticsearch",Mhi="memcached",Ohi="cockroachdb",Lua=Hpi,Bua=Gpi,Fua=$pi,Uua=Vpi,Qua=Wpi,qua=zpi,jua=Ypi,Hua=Kpi,Gua=Jpi,$ua=Zpi,Vua=Xpi,Wua=ehi,zua=thi,Yua=rhi,Kua=nhi,Jua=ihi,Zua=ohi,Xua=shi,eda=ahi,tda=chi,rda=lhi,nda=uhi,ida=dhi,oda=fhi,sda=phi,ada=hhi,cda=mhi,lda=ghi,uda=Ahi,dda=yhi,fda=Ehi,pda=_hi,hda=vhi,mda=Chi,gda=bhi,Ada=Shi,yda=Thi,Eda=Ihi,_da=xhi,vda=whi,Cda=Rhi,bda=khi,Sda=Phi,Tda=Dhi,Ida=Nhi,xda=Mhi,wda=Ohi,Rda=fh([Hpi,Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi,Jpi,Zpi,Xpi,ehi,thi,rhi,nhi,ihi,ohi,shi,ahi,chi,lhi,uhi,dhi,fhi,phi,hhi,mhi,ghi,Ahi,yhi,Ehi,_hi,vhi,Chi,bhi,Shi,Thi,Ihi,xhi,whi,Rhi,khi,Phi,Dhi,Nhi,Mhi,Ohi]),Lhi="all",Bhi="each_quorum",Fhi="quorum",Uhi="local_quorum",Qhi="one",qhi="two",jhi="three",Hhi="local_one",Ghi="any",$hi="serial",Vhi="local_serial",kda=Lhi,Pda=Bhi,Dda=Fhi,Nda=Uhi,Mda=Qhi,Oda=qhi,Lda=jhi,Bda=Hhi,Fda=Ghi,Uda=$hi,Qda=Vhi,qda=fh([Lhi,Bhi,Fhi,Uhi,Qhi,qhi,jhi,Hhi,Ghi,$hi,Vhi]),Whi="datasource",zhi="http",Yhi="pubsub",Khi="timer",Jhi="other",jda=Whi,Hda=zhi,Gda=Yhi,$da=Khi,Vda=Jhi,Wda=fh([Whi,zhi,Yhi,Khi,Jhi]),Zhi="insert",Xhi="edit",emi="delete",zda=Zhi,Yda=Xhi,Kda=emi,Jda=fh([Zhi,Xhi,emi]),tmi="alibaba_cloud",rmi="aws",nmi="azure",imi="gcp",Zda=tmi,Xda=rmi,efa=nmi,tfa=imi,rfa=fh([tmi,rmi,nmi,imi]),omi="ip_tcp",smi="ip_udp",ami="ip",cmi="unix",lmi="pipe",umi="inproc",dmi="other",nfa=omi,ifa=smi,ofa=ami,sfa=cmi,afa=lmi,cfa=umi,lfa=dmi,ufa=fh([omi,smi,ami,cmi,lmi,umi,dmi]),fmi="wifi",pmi="wired",hmi="cell",mmi="unavailable",gmi="unknown",dfa=fmi,ffa=pmi,pfa=hmi,hfa=mmi,mfa=gmi,gfa=fh([fmi,pmi,hmi,mmi,gmi]),Ami="gprs",ymi="edge",Emi="umts",_mi="cdma",vmi="evdo_0",Cmi="evdo_a",bmi="cdma2000_1xrtt",Smi="hsdpa",Tmi="hsupa",Imi="hspa",xmi="iden",wmi="evdo_b",Rmi="lte",kmi="ehrpd",Pmi="hspap",Dmi="gsm",Nmi="td_scdma",Mmi="iwlan",Omi="nr",Lmi="nrnsa",Bmi="lte_ca",Afa=Ami,yfa=ymi,Efa=Emi,_fa=_mi,vfa=vmi,Cfa=Cmi,bfa=bmi,Sfa=Smi,Tfa=Tmi,Ifa=Imi,xfa=xmi,wfa=wmi,Rfa=Rmi,kfa=kmi,Pfa=Pmi,Dfa=Dmi,Nfa=Nmi,Mfa=Mmi,Ofa=Omi,Lfa=Lmi,Bfa=Bmi,Ffa=fh([Ami,ymi,Emi,_mi,vmi,Cmi,bmi,Smi,Tmi,Imi,xmi,wmi,Rmi,kmi,Pmi,Dmi,Nmi,Mmi,Omi,Lmi,Bmi]),Fmi="1.0",Umi="1.1",Qmi="2.0",qmi="SPDY",jmi="QUIC",Ufa=Fmi,Qfa=Umi,qfa=Qmi,jfa=qmi,Hfa=jmi,Gfa={HTTP_1_0:Fmi,HTTP_1_1:Umi,HTTP_2_0:Qmi,SPDY:qmi,QUIC:jmi},Hmi="queue",Gmi="topic",$fa=Hmi,Vfa=Gmi,Wfa=fh([Hmi,Gmi]),$mi="receive",Vmi="process",zfa=$mi,Yfa=Vmi,Kfa=fh([$mi,Vmi]),Wmi=0,zmi=1,Ymi=2,Kmi=3,Jmi=4,Zmi=5,Xmi=6,e0i=7,t0i=8,r0i=9,n0i=10,i0i=11,o0i=12,s0i=13,a0i=14,c0i=15,l0i=16,Jfa=Wmi,Zfa=zmi,Xfa=Ymi,epa=Kmi,tpa=Jmi,rpa=Zmi,npa=Xmi,ipa=e0i,opa=t0i,spa=r0i,apa=n0i,cpa=i0i,lpa=o0i,upa=s0i,dpa=a0i,fpa=c0i,ppa=l0i,hpa={OK:Wmi,CANCELLED:zmi,UNKNOWN:Ymi,INVALID_ARGUMENT:Kmi,DEADLINE_EXCEEDED:Jmi,NOT_FOUND:Zmi,ALREADY_EXISTS:Xmi,PERMISSION_DENIED:e0i,RESOURCE_EXHAUSTED:t0i,FAILED_PRECONDITION:r0i,ABORTED:n0i,OUT_OF_RANGE:i0i,UNIMPLEMENTED:o0i,INTERNAL:s0i,UNAVAILABLE:a0i,DATA_LOSS:c0i,UNAUTHENTICATED:l0i},u0i="SENT",d0i="RECEIVED",mpa=u0i,gpa=d0i,Apa=fh([u0i,d0i])});var p0i=ve(()=>{p();f0i()});var h0i,m0i,g0i,A0i,y0i,E0i,_0i,v0i,C0i,b0i,S0i,T0i,I0i,x0i,w0i,R0i,k0i,P0i,D0i,N0i,M0i,O0i,L0i,B0i,F0i,U0i,Q0i,q0i,j0i,H0i,G0i,$0i,V0i,W0i,z0i,Y0i,K0i,J0i,Z0i,X0i,egi,tgi,rgi,ngi,igi,ogi,sgi,agi,cgi,lgi,ugi,dgi,fgi,pgi,hgi,mgi,ggi,Agi,ygi,Egi,_gi,vgi,Cgi,bgi,Sgi,Tgi,Igi,xgi,wgi,Rgi,kgi,Pgi,Dgi,Ngi,Mgi,Ogi,Lgi,Bgi,Fgi,Ugi,Qgi,ypa,Epa,_pa,vpa,Cpa,bpa,Spa,Tpa,Ipa,xpa,wpa,Rpa,kpa,Ppa,Dpa,Npa,Mpa,Opa,Lpa,Bpa,Fpa,Upa,Qpa,qpa,jpa,Hpa,Gpa,$pa,Vpa,Wpa,zpa,Ypa,Kpa,Jpa,Zpa,Xpa,eha,tha,rha,nha,iha,oha,sha,aha,cha,lha,uha,dha,fha,pha,hha,mha,gha,Aha,yha,Eha,_ha,vha,Cha,bha,Sha,Tha,Iha,xha,wha,Rha,kha,Pha,Dha,Nha,Mha,Oha,Lha,Bha,Fha,Uha,Qha,qha,jha,Hha,Gha,$ha,qgi,jgi,Hgi,Ggi,Vha,Wha,zha,Yha,Kha,$gi,Vgi,Wgi,zgi,Ygi,Kgi,Jgi,Zgi,Xgi,eAi,tAi,rAi,nAi,iAi,oAi,sAi,aAi,Jha,Zha,Xha,ema,tma,rma,nma,ima,oma,sma,ama,cma,lma,uma,dma,fma,pma,hma,cAi,lAi,mma,gma,Ama,uAi,dAi,fAi,pAi,hAi,mAi,gAi,yma,Ema,_ma,vma,Cma,bma,Sma,Tma,AAi,yAi,EAi,_Ai,vAi,CAi,bAi,SAi,TAi,IAi,xAi,Ima,xma,wma,Rma,kma,Pma,Dma,Nma,Mma,Oma,Lma,Bma,wAi,RAi,kAi,PAi,DAi,NAi,MAi,OAi,LAi,BAi,Fma,Uma,Qma,qma,jma,Hma,Gma,$ma,Vma,Wma,zma,FAi=ve(()=>{p();_Ar();h0i="cloud.provider",m0i="cloud.account.id",g0i="cloud.region",A0i="cloud.availability_zone",y0i="cloud.platform",E0i="aws.ecs.container.arn",_0i="aws.ecs.cluster.arn",v0i="aws.ecs.launchtype",C0i="aws.ecs.task.arn",b0i="aws.ecs.task.family",S0i="aws.ecs.task.revision",T0i="aws.eks.cluster.arn",I0i="aws.log.group.names",x0i="aws.log.group.arns",w0i="aws.log.stream.names",R0i="aws.log.stream.arns",k0i="container.name",P0i="container.id",D0i="container.runtime",N0i="container.image.name",M0i="container.image.tag",O0i="deployment.environment",L0i="device.id",B0i="device.model.identifier",F0i="device.model.name",U0i="faas.name",Q0i="faas.id",q0i="faas.version",j0i="faas.instance",H0i="faas.max_memory",G0i="host.id",$0i="host.name",V0i="host.type",W0i="host.arch",z0i="host.image.name",Y0i="host.image.id",K0i="host.image.version",J0i="k8s.cluster.name",Z0i="k8s.node.name",X0i="k8s.node.uid",egi="k8s.namespace.name",tgi="k8s.pod.uid",rgi="k8s.pod.name",ngi="k8s.container.name",igi="k8s.replicaset.uid",ogi="k8s.replicaset.name",sgi="k8s.deployment.uid",agi="k8s.deployment.name",cgi="k8s.statefulset.uid",lgi="k8s.statefulset.name",ugi="k8s.daemonset.uid",dgi="k8s.daemonset.name",fgi="k8s.job.uid",pgi="k8s.job.name",hgi="k8s.cronjob.uid",mgi="k8s.cronjob.name",ggi="os.type",Agi="os.description",ygi="os.name",Egi="os.version",_gi="process.pid",vgi="process.executable.name",Cgi="process.executable.path",bgi="process.command",Sgi="process.command_line",Tgi="process.command_args",Igi="process.owner",xgi="process.runtime.name",wgi="process.runtime.version",Rgi="process.runtime.description",kgi="service.name",Pgi="service.namespace",Dgi="service.instance.id",Ngi="service.version",Mgi="telemetry.sdk.name",Ogi="telemetry.sdk.language",Lgi="telemetry.sdk.version",Bgi="telemetry.auto.version",Fgi="webengine.name",Ugi="webengine.version",Qgi="webengine.description",ypa=h0i,Epa=m0i,_pa=g0i,vpa=A0i,Cpa=y0i,bpa=E0i,Spa=_0i,Tpa=v0i,Ipa=C0i,xpa=b0i,wpa=S0i,Rpa=T0i,kpa=I0i,Ppa=x0i,Dpa=w0i,Npa=R0i,Mpa=k0i,Opa=P0i,Lpa=D0i,Bpa=N0i,Fpa=M0i,Upa=O0i,Qpa=L0i,qpa=B0i,jpa=F0i,Hpa=U0i,Gpa=Q0i,$pa=q0i,Vpa=j0i,Wpa=H0i,zpa=G0i,Ypa=$0i,Kpa=V0i,Jpa=W0i,Zpa=z0i,Xpa=Y0i,eha=K0i,tha=J0i,rha=Z0i,nha=X0i,iha=egi,oha=tgi,sha=rgi,aha=ngi,cha=igi,lha=ogi,uha=sgi,dha=agi,fha=cgi,pha=lgi,hha=ugi,mha=dgi,gha=fgi,Aha=pgi,yha=hgi,Eha=mgi,_ha=ggi,vha=Agi,Cha=ygi,bha=Egi,Sha=_gi,Tha=vgi,Iha=Cgi,xha=bgi,wha=Sgi,Rha=Tgi,kha=Igi,Pha=xgi,Dha=wgi,Nha=Rgi,Mha=kgi,Oha=Pgi,Lha=Dgi,Bha=Ngi,Fha=Mgi,Uha=Ogi,Qha=Lgi,qha=Bgi,jha=Fgi,Hha=Ugi,Gha=Qgi,$ha=fh([h0i,m0i,g0i,A0i,y0i,E0i,_0i,v0i,C0i,b0i,S0i,T0i,I0i,x0i,w0i,R0i,k0i,P0i,D0i,N0i,M0i,O0i,L0i,B0i,F0i,U0i,Q0i,q0i,j0i,H0i,G0i,$0i,V0i,W0i,z0i,Y0i,K0i,J0i,Z0i,X0i,egi,tgi,rgi,ngi,igi,ogi,sgi,agi,cgi,lgi,ugi,dgi,fgi,pgi,hgi,mgi,ggi,Agi,ygi,Egi,_gi,vgi,Cgi,bgi,Sgi,Tgi,Igi,xgi,wgi,Rgi,kgi,Pgi,Dgi,Ngi,Mgi,Ogi,Lgi,Bgi,Fgi,Ugi,Qgi]),qgi="alibaba_cloud",jgi="aws",Hgi="azure",Ggi="gcp",Vha=qgi,Wha=jgi,zha=Hgi,Yha=Ggi,Kha=fh([qgi,jgi,Hgi,Ggi]),$gi="alibaba_cloud_ecs",Vgi="alibaba_cloud_fc",Wgi="aws_ec2",zgi="aws_ecs",Ygi="aws_eks",Kgi="aws_lambda",Jgi="aws_elastic_beanstalk",Zgi="azure_vm",Xgi="azure_container_instances",eAi="azure_aks",tAi="azure_functions",rAi="azure_app_service",nAi="gcp_compute_engine",iAi="gcp_cloud_run",oAi="gcp_kubernetes_engine",sAi="gcp_cloud_functions",aAi="gcp_app_engine",Jha=$gi,Zha=Vgi,Xha=Wgi,ema=zgi,tma=Ygi,rma=Kgi,nma=Jgi,ima=Zgi,oma=Xgi,sma=eAi,ama=tAi,cma=rAi,lma=nAi,uma=iAi,dma=oAi,fma=sAi,pma=aAi,hma=fh([$gi,Vgi,Wgi,zgi,Ygi,Kgi,Jgi,Zgi,Xgi,eAi,tAi,rAi,nAi,iAi,oAi,sAi,aAi]),cAi="ec2",lAi="fargate",mma=cAi,gma=lAi,Ama=fh([cAi,lAi]),uAi="amd64",dAi="arm32",fAi="arm64",pAi="ia64",hAi="ppc32",mAi="ppc64",gAi="x86",yma=uAi,Ema=dAi,_ma=fAi,vma=pAi,Cma=hAi,bma=mAi,Sma=gAi,Tma=fh([uAi,dAi,fAi,pAi,hAi,mAi,gAi]),AAi="windows",yAi="linux",EAi="darwin",_Ai="freebsd",vAi="netbsd",CAi="openbsd",bAi="dragonflybsd",SAi="hpux",TAi="aix",IAi="solaris",xAi="z_os",Ima=AAi,xma=yAi,wma=EAi,Rma=_Ai,kma=vAi,Pma=CAi,Dma=bAi,Nma=SAi,Mma=TAi,Oma=IAi,Lma=xAi,Bma=fh([AAi,yAi,EAi,_Ai,vAi,CAi,bAi,SAi,TAi,IAi,xAi]),wAi="cpp",RAi="dotnet",kAi="erlang",PAi="go",DAi="java",NAi="nodejs",MAi="php",OAi="python",LAi="ruby",BAi="webjs",Fma=wAi,Uma=RAi,Qma=kAi,qma=PAi,jma=DAi,Hma=NAi,Gma=MAi,$ma=OAi,Vma=LAi,Wma=BAi,zma=fh([wAi,RAi,kAi,PAi,DAi,NAi,MAi,OAi,LAi,BAi])});var UAi=ve(()=>{p();FAi()});var Yma,Kma,Jma,Zma,Xma,e0a,t0a,r0a,n0a,i0a,o0a,s0a,a0a,c0a,l0a,u0a,d0a,f0a,p0a,h0a,m0a,g0a,A0a,y0a,E0a,_0a,v0a,C0a,b0a,S0a,T0a,I0a,x0a,w0a,R0a,k0a,P0a,D0a,N0a,M0a,O0a,L0a,gup,Aup,B0a,F0a,U0a,Q0a,q0a,j0a,H0a,G0a,$0a,V0a,W0a,z0a,Y0a,K0a,J0a,Z0a,X0a,ega,tga,rga,nga,iga,oga,sga,aga,cga,lga,uga,dga,fga,pga,hga,mga,gga,Aga,yga,Ega,_ga,vga,Cga,bga,Sga,Tga,Iga,xga,wga,Rga,kga,Pga,Dga,Nga,Mga,Oga,Lga,Bga,Fga,Uga,Qga,qga,jga,Hga,Gga,$ga,Vga,Wga,zga,Yga,Kga,Jga,Zga,vAr,Xga,eAa,tAa,rAa,nAa,CAr,iAa,oAa,sAa,aAa,cAa,lAa,bAr,SAr,uAa,dAa,fAa,pAa,hAa,mAa,QAi=ve(()=>{p();Yma="aspnetcore.diagnostics.exception.result",Kma="aborted",Jma="handled",Zma="skipped",Xma="unhandled",e0a="aspnetcore.diagnostics.handler.type",t0a="aspnetcore.rate_limiting.policy",r0a="aspnetcore.rate_limiting.result",n0a="acquired",i0a="endpoint_limiter",o0a="global_limiter",s0a="request_canceled",a0a="aspnetcore.request.is_unhandled",c0a="aspnetcore.routing.is_fallback",l0a="aspnetcore.routing.match_status",u0a="failure",d0a="success",f0a="aspnetcore.user.is_authenticated",p0a="client.address",h0a="client.port",m0a="code.column.number",g0a="code.file.path",A0a="code.function.name",y0a="code.line.number",E0a="code.stacktrace",_0a="db.collection.name",v0a="db.namespace",C0a="db.operation.batch.size",b0a="db.operation.name",S0a="db.query.summary",T0a="db.query.text",I0a="db.response.status_code",x0a="db.stored_procedure.name",w0a="db.system.name",R0a="mariadb",k0a="microsoft.sql_server",P0a="mysql",D0a="postgresql",N0a="dotnet.gc.heap.generation",M0a="gen0",O0a="gen1",L0a="gen2",gup="loh",Aup="poh",B0a="error.type",F0a="_OTHER",U0a="exception.escaped",Q0a="exception.message",q0a="exception.stacktrace",j0a="exception.type",H0a=a(t=>`http.request.header.${t}`,"ATTR_HTTP_REQUEST_HEADER"),G0a="http.request.method",$0a="_OTHER",V0a="CONNECT",W0a="DELETE",z0a="GET",Y0a="HEAD",K0a="OPTIONS",J0a="PATCH",Z0a="POST",X0a="PUT",ega="TRACE",tga="http.request.method_original",rga="http.request.resend_count",nga=a(t=>`http.response.header.${t}`,"ATTR_HTTP_RESPONSE_HEADER"),iga="http.response.status_code",oga="http.route",sga="jvm.gc.action",aga="jvm.gc.name",cga="jvm.memory.pool.name",lga="jvm.memory.type",uga="heap",dga="non_heap",fga="jvm.thread.daemon",pga="jvm.thread.state",hga="blocked",mga="new",gga="runnable",Aga="terminated",yga="timed_waiting",Ega="waiting",_ga="network.local.address",vga="network.local.port",Cga="network.peer.address",bga="network.peer.port",Sga="network.protocol.name",Tga="network.protocol.version",Iga="network.transport",xga="pipe",wga="quic",Rga="tcp",kga="udp",Pga="unix",Dga="network.type",Nga="ipv4",Mga="ipv6",Oga="otel.scope.name",Lga="otel.scope.version",Bga="otel.status_code",Fga="ERROR",Uga="OK",Qga="otel.status_description",qga="server.address",jga="server.port",Hga="service.name",Gga="service.version",$ga="signalr.connection.status",Vga="app_shutdown",Wga="normal_closure",zga="timeout",Yga="signalr.transport",Kga="long_polling",Jga="server_sent_events",Zga="web_sockets",vAr="telemetry.sdk.language",Xga="cpp",eAa="dotnet",tAa="erlang",rAa="go",nAa="java",CAr="nodejs",iAa="php",oAa="python",sAa="ruby",aAa="rust",cAa="swift",lAa="webjs",bAr="telemetry.sdk.name",SAr="telemetry.sdk.version",uAa="url.fragment",dAa="url.full",fAa="url.path",pAa="url.query",hAa="url.scheme",mAa="user_agent.original"});var gAa,AAa,yAa,EAa,_Aa,vAa,CAa,bAa,SAa,TAa,IAa,xAa,wAa,RAa,kAa,PAa,DAa,NAa,MAa,OAa,LAa,BAa,FAa,UAa,QAa,qAa,jAa,HAa,GAa,$Aa,VAa,WAa,zAa,YAa,KAa,JAa,ZAa,XAa,eya,tya,rya,nya,iya,oya,sya,aya,cya,lya,uya,dya,fya,qAi=ve(()=>{p();gAa="aspnetcore.diagnostics.exceptions",AAa="aspnetcore.rate_limiting.active_request_leases",yAa="aspnetcore.rate_limiting.queued_requests",EAa="aspnetcore.rate_limiting.request.time_in_queue",_Aa="aspnetcore.rate_limiting.request_lease.duration",vAa="aspnetcore.rate_limiting.requests",CAa="aspnetcore.routing.match_attempts",bAa="db.client.operation.duration",SAa="dotnet.assembly.count",TAa="dotnet.exceptions",IAa="dotnet.gc.collections",xAa="dotnet.gc.heap.total_allocated",wAa="dotnet.gc.last_collection.heap.fragmentation.size",RAa="dotnet.gc.last_collection.heap.size",kAa="dotnet.gc.last_collection.memory.committed_size",PAa="dotnet.gc.pause.time",DAa="dotnet.jit.compilation.time",NAa="dotnet.jit.compiled_il.size",MAa="dotnet.jit.compiled_methods",OAa="dotnet.monitor.lock_contentions",LAa="dotnet.process.cpu.count",BAa="dotnet.process.cpu.time",FAa="dotnet.process.memory.working_set",UAa="dotnet.thread_pool.queue.length",QAa="dotnet.thread_pool.thread.count",qAa="dotnet.thread_pool.work_item.count",jAa="dotnet.timer.count",HAa="http.client.request.duration",GAa="http.server.request.duration",$Aa="jvm.class.count",VAa="jvm.class.loaded",WAa="jvm.class.unloaded",zAa="jvm.cpu.count",YAa="jvm.cpu.recent_utilization",KAa="jvm.cpu.time",JAa="jvm.gc.duration",ZAa="jvm.memory.committed",XAa="jvm.memory.limit",eya="jvm.memory.used",tya="jvm.memory.used_after_last_gc",rya="jvm.thread.count",nya="kestrel.active_connections",iya="kestrel.active_tls_handshakes",oya="kestrel.connection.duration",sya="kestrel.queued_connections",aya="kestrel.queued_requests",cya="kestrel.rejected_connections",lya="kestrel.tls_handshake.duration",uya="kestrel.upgraded_connections",dya="signalr.server.active_connections",fya="signalr.server.connection.duration"});var pya,jAi=ve(()=>{p();pya="exception"});var TAr={};ki(TAr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>Kma,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Jma,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>Zma,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>Xma,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>n0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>i0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>o0a,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>s0a,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>u0a,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>d0a,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Yma,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>e0a,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>t0a,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>r0a,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>a0a,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>c0a,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>l0a,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>f0a,ATTR_CLIENT_ADDRESS:()=>p0a,ATTR_CLIENT_PORT:()=>h0a,ATTR_CODE_COLUMN_NUMBER:()=>m0a,ATTR_CODE_FILE_PATH:()=>g0a,ATTR_CODE_FUNCTION_NAME:()=>A0a,ATTR_CODE_LINE_NUMBER:()=>y0a,ATTR_CODE_STACKTRACE:()=>E0a,ATTR_DB_COLLECTION_NAME:()=>_0a,ATTR_DB_NAMESPACE:()=>v0a,ATTR_DB_OPERATION_BATCH_SIZE:()=>C0a,ATTR_DB_OPERATION_NAME:()=>b0a,ATTR_DB_QUERY_SUMMARY:()=>S0a,ATTR_DB_QUERY_TEXT:()=>T0a,ATTR_DB_RESPONSE_STATUS_CODE:()=>I0a,ATTR_DB_STORED_PROCEDURE_NAME:()=>x0a,ATTR_DB_SYSTEM_NAME:()=>w0a,ATTR_DOTNET_GC_HEAP_GENERATION:()=>N0a,ATTR_ERROR_TYPE:()=>B0a,ATTR_EXCEPTION_ESCAPED:()=>U0a,ATTR_EXCEPTION_MESSAGE:()=>Q0a,ATTR_EXCEPTION_STACKTRACE:()=>q0a,ATTR_EXCEPTION_TYPE:()=>j0a,ATTR_HTTP_REQUEST_HEADER:()=>H0a,ATTR_HTTP_REQUEST_METHOD:()=>G0a,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>tga,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>rga,ATTR_HTTP_RESPONSE_HEADER:()=>nga,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>iga,ATTR_HTTP_ROUTE:()=>oga,ATTR_JVM_GC_ACTION:()=>sga,ATTR_JVM_GC_NAME:()=>aga,ATTR_JVM_MEMORY_POOL_NAME:()=>cga,ATTR_JVM_MEMORY_TYPE:()=>lga,ATTR_JVM_THREAD_DAEMON:()=>fga,ATTR_JVM_THREAD_STATE:()=>pga,ATTR_NETWORK_LOCAL_ADDRESS:()=>_ga,ATTR_NETWORK_LOCAL_PORT:()=>vga,ATTR_NETWORK_PEER_ADDRESS:()=>Cga,ATTR_NETWORK_PEER_PORT:()=>bga,ATTR_NETWORK_PROTOCOL_NAME:()=>Sga,ATTR_NETWORK_PROTOCOL_VERSION:()=>Tga,ATTR_NETWORK_TRANSPORT:()=>Iga,ATTR_NETWORK_TYPE:()=>Dga,ATTR_OTEL_SCOPE_NAME:()=>Oga,ATTR_OTEL_SCOPE_VERSION:()=>Lga,ATTR_OTEL_STATUS_CODE:()=>Bga,ATTR_OTEL_STATUS_DESCRIPTION:()=>Qga,ATTR_SERVER_ADDRESS:()=>qga,ATTR_SERVER_PORT:()=>jga,ATTR_SERVICE_NAME:()=>Hga,ATTR_SERVICE_VERSION:()=>Gga,ATTR_SIGNALR_CONNECTION_STATUS:()=>$ga,ATTR_SIGNALR_TRANSPORT:()=>Yga,ATTR_TELEMETRY_SDK_LANGUAGE:()=>vAr,ATTR_TELEMETRY_SDK_NAME:()=>bAr,ATTR_TELEMETRY_SDK_VERSION:()=>SAr,ATTR_URL_FRAGMENT:()=>uAa,ATTR_URL_FULL:()=>dAa,ATTR_URL_PATH:()=>fAa,ATTR_URL_QUERY:()=>pAa,ATTR_URL_SCHEME:()=>hAa,ATTR_USER_AGENT_ORIGINAL:()=>mAa,AWSECSLAUNCHTYPEVALUES_EC2:()=>mma,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>gma,AwsEcsLaunchtypeValues:()=>Ama,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Jha,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>Zha,CLOUDPLATFORMVALUES_AWS_EC2:()=>Xha,CLOUDPLATFORMVALUES_AWS_ECS:()=>ema,CLOUDPLATFORMVALUES_AWS_EKS:()=>tma,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>nma,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>rma,CLOUDPLATFORMVALUES_AZURE_AKS:()=>sma,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>cma,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>oma,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>ama,CLOUDPLATFORMVALUES_AZURE_VM:()=>ima,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>pma,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>fma,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>uma,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>lma,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>dma,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Vha,CLOUDPROVIDERVALUES_AWS:()=>Wha,CLOUDPROVIDERVALUES_AZURE:()=>zha,CLOUDPROVIDERVALUES_GCP:()=>Yha,CloudPlatformValues:()=>hma,CloudProviderValues:()=>Kha,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>kda,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>Fda,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>Pda,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>Bda,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>Nda,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>Qda,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>Mda,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>Dda,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>Uda,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>Lda,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>Oda,DBSYSTEMVALUES_ADABAS:()=>Xua,DBSYSTEMVALUES_CACHE:()=>Zua,DBSYSTEMVALUES_CASSANDRA:()=>gda,DBSYSTEMVALUES_CLOUDSCAPE:()=>Gua,DBSYSTEMVALUES_COCKROACHDB:()=>wda,DBSYSTEMVALUES_COLDFUSION:()=>mda,DBSYSTEMVALUES_COSMOSDB:()=>Cda,DBSYSTEMVALUES_COUCHBASE:()=>_da,DBSYSTEMVALUES_COUCHDB:()=>vda,DBSYSTEMVALUES_DB2:()=>Qua,DBSYSTEMVALUES_DERBY:()=>tda,DBSYSTEMVALUES_DYNAMODB:()=>bda,DBSYSTEMVALUES_EDB:()=>Jua,DBSYSTEMVALUES_ELASTICSEARCH:()=>Ida,DBSYSTEMVALUES_FILEMAKER:()=>rda,DBSYSTEMVALUES_FIREBIRD:()=>eda,DBSYSTEMVALUES_FIRSTSQL:()=>Kua,DBSYSTEMVALUES_GEODE:()=>Tda,DBSYSTEMVALUES_H2:()=>hda,DBSYSTEMVALUES_HANADB:()=>zua,DBSYSTEMVALUES_HBASE:()=>Ada,DBSYSTEMVALUES_HIVE:()=>Hua,DBSYSTEMVALUES_HSQLDB:()=>$ua,DBSYSTEMVALUES_INFORMIX:()=>nda,DBSYSTEMVALUES_INGRES:()=>Yua,DBSYSTEMVALUES_INSTANTDB:()=>ida,DBSYSTEMVALUES_INTERBASE:()=>oda,DBSYSTEMVALUES_MARIADB:()=>sda,DBSYSTEMVALUES_MAXDB:()=>Wua,DBSYSTEMVALUES_MEMCACHED:()=>xda,DBSYSTEMVALUES_MONGODB:()=>yda,DBSYSTEMVALUES_MSSQL:()=>Bua,DBSYSTEMVALUES_MYSQL:()=>Fua,DBSYSTEMVALUES_NEO4J:()=>Sda,DBSYSTEMVALUES_NETEZZA:()=>ada,DBSYSTEMVALUES_ORACLE:()=>Uua,DBSYSTEMVALUES_OTHER_SQL:()=>Lua,DBSYSTEMVALUES_PERVASIVE:()=>cda,DBSYSTEMVALUES_POINTBASE:()=>lda,DBSYSTEMVALUES_POSTGRESQL:()=>qua,DBSYSTEMVALUES_PROGRESS:()=>Vua,DBSYSTEMVALUES_REDIS:()=>Eda,DBSYSTEMVALUES_REDSHIFT:()=>jua,DBSYSTEMVALUES_SQLITE:()=>uda,DBSYSTEMVALUES_SYBASE:()=>dda,DBSYSTEMVALUES_TERADATA:()=>fda,DBSYSTEMVALUES_VERTICA:()=>pda,DB_SYSTEM_NAME_VALUE_MARIADB:()=>R0a,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>k0a,DB_SYSTEM_NAME_VALUE_MYSQL:()=>P0a,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>D0a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>M0a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>O0a,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>L0a,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>gup,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>Aup,DbCassandraConsistencyLevelValues:()=>qda,DbSystemValues:()=>Rda,ERROR_TYPE_VALUE_OTHER:()=>F0a,EVENT_EXCEPTION:()=>pya,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>Kda,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>Yda,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>zda,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>Zda,FAASINVOKEDPROVIDERVALUES_AWS:()=>Xda,FAASINVOKEDPROVIDERVALUES_AZURE:()=>efa,FAASINVOKEDPROVIDERVALUES_GCP:()=>tfa,FAASTRIGGERVALUES_DATASOURCE:()=>jda,FAASTRIGGERVALUES_HTTP:()=>Hda,FAASTRIGGERVALUES_OTHER:()=>Vda,FAASTRIGGERVALUES_PUBSUB:()=>Gda,FAASTRIGGERVALUES_TIMER:()=>$da,FaasDocumentOperationValues:()=>Jda,FaasInvokedProviderValues:()=>rfa,FaasTriggerValues:()=>Wda,HOSTARCHVALUES_AMD64:()=>yma,HOSTARCHVALUES_ARM32:()=>Ema,HOSTARCHVALUES_ARM64:()=>_ma,HOSTARCHVALUES_IA64:()=>vma,HOSTARCHVALUES_PPC32:()=>Cma,HOSTARCHVALUES_PPC64:()=>bma,HOSTARCHVALUES_X86:()=>Sma,HTTPFLAVORVALUES_HTTP_1_0:()=>Ufa,HTTPFLAVORVALUES_HTTP_1_1:()=>Qfa,HTTPFLAVORVALUES_HTTP_2_0:()=>qfa,HTTPFLAVORVALUES_QUIC:()=>Hfa,HTTPFLAVORVALUES_SPDY:()=>jfa,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>V0a,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>W0a,HTTP_REQUEST_METHOD_VALUE_GET:()=>z0a,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Y0a,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>K0a,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>$0a,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>J0a,HTTP_REQUEST_METHOD_VALUE_POST:()=>Z0a,HTTP_REQUEST_METHOD_VALUE_PUT:()=>X0a,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>ega,HostArchValues:()=>Tma,HttpFlavorValues:()=>Gfa,JVM_MEMORY_TYPE_VALUE_HEAP:()=>uga,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>dga,JVM_THREAD_STATE_VALUE_BLOCKED:()=>hga,JVM_THREAD_STATE_VALUE_NEW:()=>mga,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>gga,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Aga,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>yga,JVM_THREAD_STATE_VALUE_WAITING:()=>Ega,MESSAGETYPEVALUES_RECEIVED:()=>gpa,MESSAGETYPEVALUES_SENT:()=>mpa,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>$fa,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>Vfa,MESSAGINGOPERATIONVALUES_PROCESS:()=>Yfa,MESSAGINGOPERATIONVALUES_RECEIVE:()=>zfa,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>gAa,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>AAa,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>yAa,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>vAa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>_Aa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>EAa,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>CAa,METRIC_DB_CLIENT_OPERATION_DURATION:()=>bAa,METRIC_DOTNET_ASSEMBLY_COUNT:()=>SAa,METRIC_DOTNET_EXCEPTIONS:()=>TAa,METRIC_DOTNET_GC_COLLECTIONS:()=>IAa,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>xAa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>wAa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>RAa,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>kAa,METRIC_DOTNET_GC_PAUSE_TIME:()=>PAa,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>DAa,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>NAa,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>MAa,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>OAa,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>LAa,METRIC_DOTNET_PROCESS_CPU_TIME:()=>BAa,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>FAa,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>UAa,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>QAa,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>qAa,METRIC_DOTNET_TIMER_COUNT:()=>jAa,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>HAa,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>GAa,METRIC_JVM_CLASS_COUNT:()=>$Aa,METRIC_JVM_CLASS_LOADED:()=>VAa,METRIC_JVM_CLASS_UNLOADED:()=>WAa,METRIC_JVM_CPU_COUNT:()=>zAa,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>YAa,METRIC_JVM_CPU_TIME:()=>KAa,METRIC_JVM_GC_DURATION:()=>JAa,METRIC_JVM_MEMORY_COMMITTED:()=>ZAa,METRIC_JVM_MEMORY_LIMIT:()=>XAa,METRIC_JVM_MEMORY_USED:()=>eya,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>tya,METRIC_JVM_THREAD_COUNT:()=>rya,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>nya,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>iya,METRIC_KESTREL_CONNECTION_DURATION:()=>oya,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>sya,METRIC_KESTREL_QUEUED_REQUESTS:()=>aya,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>cya,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>lya,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>uya,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>dya,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>fya,MessageTypeValues:()=>Apa,MessagingDestinationKindValues:()=>Wfa,MessagingOperationValues:()=>Kfa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>_fa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>bfa,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>yfa,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>kfa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>vfa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>Cfa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>wfa,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>Afa,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>Dfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>Sfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>Ifa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>Pfa,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>Tfa,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>xfa,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>Mfa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>Rfa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>Bfa,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>Ofa,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>Lfa,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>Nfa,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>Efa,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>pfa,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>hfa,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>mfa,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>dfa,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>ffa,NETTRANSPORTVALUES_INPROC:()=>cfa,NETTRANSPORTVALUES_IP:()=>ofa,NETTRANSPORTVALUES_IP_TCP:()=>nfa,NETTRANSPORTVALUES_IP_UDP:()=>ifa,NETTRANSPORTVALUES_OTHER:()=>lfa,NETTRANSPORTVALUES_PIPE:()=>afa,NETTRANSPORTVALUES_UNIX:()=>sfa,NETWORK_TRANSPORT_VALUE_PIPE:()=>xga,NETWORK_TRANSPORT_VALUE_QUIC:()=>wga,NETWORK_TRANSPORT_VALUE_TCP:()=>Rga,NETWORK_TRANSPORT_VALUE_UDP:()=>kga,NETWORK_TRANSPORT_VALUE_UNIX:()=>Pga,NETWORK_TYPE_VALUE_IPV4:()=>Nga,NETWORK_TYPE_VALUE_IPV6:()=>Mga,NetHostConnectionSubtypeValues:()=>Ffa,NetHostConnectionTypeValues:()=>gfa,NetTransportValues:()=>ufa,OSTYPEVALUES_AIX:()=>Mma,OSTYPEVALUES_DARWIN:()=>wma,OSTYPEVALUES_DRAGONFLYBSD:()=>Dma,OSTYPEVALUES_FREEBSD:()=>Rma,OSTYPEVALUES_HPUX:()=>Nma,OSTYPEVALUES_LINUX:()=>xma,OSTYPEVALUES_NETBSD:()=>kma,OSTYPEVALUES_OPENBSD:()=>Pma,OSTYPEVALUES_SOLARIS:()=>Oma,OSTYPEVALUES_WINDOWS:()=>Ima,OSTYPEVALUES_Z_OS:()=>Lma,OTEL_STATUS_CODE_VALUE_ERROR:()=>Fga,OTEL_STATUS_CODE_VALUE_OK:()=>Uga,OsTypeValues:()=>Bma,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>apa,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>npa,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>Zfa,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>fpa,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>tpa,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>spa,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>upa,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>epa,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>rpa,RPCGRPCSTATUSCODEVALUES_OK:()=>Jfa,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>cpa,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>ipa,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>opa,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>ppa,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>dpa,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>lpa,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>Xfa,RpcGrpcStatusCodeValues:()=>hpa,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>Gla,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>rua,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>qla,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>Bla,SEMATTRS_AWS_DYNAMODB_COUNT:()=>eua,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Yla,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>Wla,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>nua,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>$la,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>Fla,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>Hla,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>zla,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>jla,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>Ula,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>Qla,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>tua,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>Jla,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>Zla,SEMATTRS_AWS_DYNAMODB_SELECT:()=>Vla,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>Kla,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>Lla,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>Xla,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>mca,SEMATTRS_CODE_FILEPATH:()=>Ela,SEMATTRS_CODE_FUNCTION:()=>Ala,SEMATTRS_CODE_LINENO:()=>_la,SEMATTRS_CODE_NAMESPACE:()=>yla,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>Ica,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>Pca,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>kca,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>wca,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>Sca,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>Tca,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>Rca,SEMATTRS_DB_CASSANDRA_TABLE:()=>xca,SEMATTRS_DB_CONNECTION_STRING:()=>Aca,SEMATTRS_DB_HBASE_NAMESPACE:()=>Dca,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Eca,SEMATTRS_DB_MONGODB_COLLECTION:()=>Mca,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>bca,SEMATTRS_DB_NAME:()=>_ca,SEMATTRS_DB_OPERATION:()=>Cca,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>Nca,SEMATTRS_DB_SQL_TABLE:()=>Oca,SEMATTRS_DB_STATEMENT:()=>vca,SEMATTRS_DB_SYSTEM:()=>gca,SEMATTRS_DB_USER:()=>yca,SEMATTRS_ENDUSER_ID:()=>fla,SEMATTRS_ENDUSER_ROLE:()=>pla,SEMATTRS_ENDUSER_SCOPE:()=>hla,SEMATTRS_EXCEPTION_ESCAPED:()=>Uca,SEMATTRS_EXCEPTION_MESSAGE:()=>Bca,SEMATTRS_EXCEPTION_STACKTRACE:()=>Fca,SEMATTRS_EXCEPTION_TYPE:()=>Lca,SEMATTRS_FAAS_COLDSTART:()=>zca,SEMATTRS_FAAS_CRON:()=>Wca,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>jca,SEMATTRS_FAAS_DOCUMENT_NAME:()=>$ca,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>Hca,SEMATTRS_FAAS_DOCUMENT_TIME:()=>Gca,SEMATTRS_FAAS_EXECUTION:()=>qca,SEMATTRS_FAAS_INVOKED_NAME:()=>Yca,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>Kca,SEMATTRS_FAAS_INVOKED_REGION:()=>Jca,SEMATTRS_FAAS_TIME:()=>Vca,SEMATTRS_FAAS_TRIGGER:()=>Qca,SEMATTRS_HTTP_CLIENT_IP:()=>Ola,SEMATTRS_HTTP_FLAVOR:()=>xla,SEMATTRS_HTTP_HOST:()=>Sla,SEMATTRS_HTTP_METHOD:()=>vla,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>Rla,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>kla,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>Pla,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>Dla,SEMATTRS_HTTP_ROUTE:()=>Mla,SEMATTRS_HTTP_SCHEME:()=>Tla,SEMATTRS_HTTP_SERVER_NAME:()=>Nla,SEMATTRS_HTTP_STATUS_CODE:()=>Ila,SEMATTRS_HTTP_TARGET:()=>bla,SEMATTRS_HTTP_URL:()=>Cla,SEMATTRS_HTTP_USER_AGENT:()=>wla,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>Nua,SEMATTRS_MESSAGE_ID:()=>Dua,SEMATTRS_MESSAGE_TYPE:()=>Pua,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>Mua,SEMATTRS_MESSAGING_CONSUMER_ID:()=>gua,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>fua,SEMATTRS_MESSAGING_DESTINATION:()=>oua,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>sua,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>_ua,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>Eua,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>yua,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>vua,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>Cua,SEMATTRS_MESSAGING_MESSAGE_ID:()=>dua,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>hua,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>pua,SEMATTRS_MESSAGING_OPERATION:()=>mua,SEMATTRS_MESSAGING_PROTOCOL:()=>cua,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>lua,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Aua,SEMATTRS_MESSAGING_SYSTEM:()=>iua,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>aua,SEMATTRS_MESSAGING_URL:()=>uua,SEMATTRS_NET_HOST_CARRIER_ICC:()=>ula,SEMATTRS_NET_HOST_CARRIER_MCC:()=>cla,SEMATTRS_NET_HOST_CARRIER_MNC:()=>lla,SEMATTRS_NET_HOST_CARRIER_NAME:()=>ala,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>sla,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>ola,SEMATTRS_NET_HOST_IP:()=>rla,SEMATTRS_NET_HOST_NAME:()=>ila,SEMATTRS_NET_HOST_PORT:()=>nla,SEMATTRS_NET_PEER_IP:()=>Xca,SEMATTRS_NET_PEER_NAME:()=>tla,SEMATTRS_NET_PEER_PORT:()=>ela,SEMATTRS_NET_TRANSPORT:()=>Zca,SEMATTRS_PEER_SERVICE:()=>dla,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>Iua,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>Rua,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>kua,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>wua,SEMATTRS_RPC_JSONRPC_VERSION:()=>xua,SEMATTRS_RPC_METHOD:()=>Tua,SEMATTRS_RPC_SERVICE:()=>Sua,SEMATTRS_RPC_SYSTEM:()=>bua,SEMATTRS_THREAD_ID:()=>mla,SEMATTRS_THREAD_NAME:()=>gla,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>Spa,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>bpa,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>Tpa,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>Ipa,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>xpa,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>wpa,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>Rpa,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>Ppa,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>kpa,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>Npa,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>Dpa,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>Epa,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>vpa,SEMRESATTRS_CLOUD_PLATFORM:()=>Cpa,SEMRESATTRS_CLOUD_PROVIDER:()=>ypa,SEMRESATTRS_CLOUD_REGION:()=>_pa,SEMRESATTRS_CONTAINER_ID:()=>Opa,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>Bpa,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>Fpa,SEMRESATTRS_CONTAINER_NAME:()=>Mpa,SEMRESATTRS_CONTAINER_RUNTIME:()=>Lpa,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>Upa,SEMRESATTRS_DEVICE_ID:()=>Qpa,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>qpa,SEMRESATTRS_DEVICE_MODEL_NAME:()=>jpa,SEMRESATTRS_FAAS_ID:()=>Gpa,SEMRESATTRS_FAAS_INSTANCE:()=>Vpa,SEMRESATTRS_FAAS_MAX_MEMORY:()=>Wpa,SEMRESATTRS_FAAS_NAME:()=>Hpa,SEMRESATTRS_FAAS_VERSION:()=>$pa,SEMRESATTRS_HOST_ARCH:()=>Jpa,SEMRESATTRS_HOST_ID:()=>zpa,SEMRESATTRS_HOST_IMAGE_ID:()=>Xpa,SEMRESATTRS_HOST_IMAGE_NAME:()=>Zpa,SEMRESATTRS_HOST_IMAGE_VERSION:()=>eha,SEMRESATTRS_HOST_NAME:()=>Ypa,SEMRESATTRS_HOST_TYPE:()=>Kpa,SEMRESATTRS_K8S_CLUSTER_NAME:()=>tha,SEMRESATTRS_K8S_CONTAINER_NAME:()=>aha,SEMRESATTRS_K8S_CRONJOB_NAME:()=>Eha,SEMRESATTRS_K8S_CRONJOB_UID:()=>yha,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>mha,SEMRESATTRS_K8S_DAEMONSET_UID:()=>hha,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>dha,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>uha,SEMRESATTRS_K8S_JOB_NAME:()=>Aha,SEMRESATTRS_K8S_JOB_UID:()=>gha,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>iha,SEMRESATTRS_K8S_NODE_NAME:()=>rha,SEMRESATTRS_K8S_NODE_UID:()=>nha,SEMRESATTRS_K8S_POD_NAME:()=>sha,SEMRESATTRS_K8S_POD_UID:()=>oha,SEMRESATTRS_K8S_REPLICASET_NAME:()=>lha,SEMRESATTRS_K8S_REPLICASET_UID:()=>cha,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>pha,SEMRESATTRS_K8S_STATEFULSET_UID:()=>fha,SEMRESATTRS_OS_DESCRIPTION:()=>vha,SEMRESATTRS_OS_NAME:()=>Cha,SEMRESATTRS_OS_TYPE:()=>_ha,SEMRESATTRS_OS_VERSION:()=>bha,SEMRESATTRS_PROCESS_COMMAND:()=>xha,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>Rha,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>wha,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>Tha,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>Iha,SEMRESATTRS_PROCESS_OWNER:()=>kha,SEMRESATTRS_PROCESS_PID:()=>Sha,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Nha,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>Pha,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>Dha,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>Lha,SEMRESATTRS_SERVICE_NAME:()=>Mha,SEMRESATTRS_SERVICE_NAMESPACE:()=>Oha,SEMRESATTRS_SERVICE_VERSION:()=>Bha,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>qha,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>Uha,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Fha,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>Qha,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Gha,SEMRESATTRS_WEBENGINE_NAME:()=>jha,SEMRESATTRS_WEBENGINE_VERSION:()=>Hha,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Vga,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>Wga,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>zga,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>Kga,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>Jga,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>Zga,SemanticAttributes:()=>Oua,SemanticResourceAttributes:()=>$ha,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>Fma,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>Uma,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>Qma,TELEMETRYSDKLANGUAGEVALUES_GO:()=>qma,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>jma,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>Hma,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>Gma,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>$ma,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Vma,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>Wma,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>Xga,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>eAa,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>tAa,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>rAa,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>nAa,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>CAr,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>iAa,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>oAa,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>sAa,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>aAa,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>cAa,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>lAa,TelemetrySdkLanguageValues:()=>zma});var yht=ve(()=>{p();p0i();UAi();QAi();qAi();jAi()});var HAi,GAi=ve(()=>{p();HAi="process.runtime.name"});var Eht,$Ai=ve(()=>{p();Cdi();yht();GAi();Eht={[bAr]:"opentelemetry",[HAi]:"node",[vAr]:CAr,[SAr]:vdi}});var VAi=ve(()=>{p();Adi();ydi();_di();$Ai()});var IAr=ve(()=>{p();VAi()});function _0e(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*mya);return[r,n]}function vht(){let t=sG.timeOrigin;if(typeof t!="number"){let e=sG;t=e.timing&&e.timing.fetchStart}return t}function xAr(t){let e=_0e(vht()),r=_0e(typeof t=="number"?t:sG.now());return wAr(e,r)}function zAi(t){if(Cht(t))return t;if(typeof t=="number")return t=_ht&&(r[1]-=_ht,r[0]+=1),r}var WAi,hya,mya,_ht,tyi=ve(()=>{p();IAr();WAi=9,hya=6,mya=Math.pow(10,hya),_ht=Math.pow(10,WAi);a(_0e,"millisToHrTime");a(vht,"getTimeOrigin");a(xAr,"hrTime");a(zAi,"timeInputToHrTime");a(YAi,"hrTimeDuration");a(KAi,"hrTimeToTimeStamp");a(JAi,"hrTimeToNanoseconds");a(ZAi,"hrTimeToMilliseconds");a(XAi,"hrTimeToMicroseconds");a(Cht,"isTimeInputHrTime");a(eyi,"isTimeInput");a(wAr,"addHrTimes")});function ryi(t){typeof t!="number"&&t.unref()}var nyi=ve(()=>{p();a(ryi,"unrefTimer")});var bht,iyi=ve(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(bht||(bht={}))});var Sht,oyi=ve(()=>{p();co();Sht=class{static{a(this,"CompositePropagator")}_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(r=>typeof r.fields=="function"?r.fields():[]).reduce((r,n)=>r.concat(n),[])))}inject(e,r,n){for(let o of this._propagators)try{o.inject(e,r,n)}catch(s){Dn.warn(`Failed to inject with ${o.constructor.name}. Err: ${s.message}`)}}extract(e,r,n){return this._propagators.reduce((o,s)=>{try{return s.extract(o,r,n)}catch(c){Dn.warn(`Failed to extract with ${s.constructor.name}. Err: ${c.message}`)}return o},e)}fields(){return this._fields.slice()}}});function syi(t){return yya.test(t)}function ayi(t){return Eya.test(t)&&!_ya.test(t)}var RAr,gya,Aya,yya,Eya,_ya,cyi=ve(()=>{p();RAr="[_0-9a-z-*/]",gya=`[a-z]${RAr}{0,255}`,Aya=`[a-z0-9]${RAr}{0,240}@[a-z]${RAr}{0,13}`,yya=new RegExp(`^(?:${gya}|${Aya})$`),Eya=/^[ -~]{0,255}[!-~]$/,_ya=/,|=/;a(syi,"validateKey");a(ayi,"validateValue")});var lyi,vya,uyi,dyi,v0e,kAr=ve(()=>{p();cyi();lyi=32,vya=512,uyi=",",dyi="=",v0e=class t{static{a(this,"TraceState")}_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,r){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n}unset(e){let r=this._clone();return r._internalState.delete(e),r}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,r)=>(e.push(r+dyi+this.get(r)),e),[]).join(uyi)}_parse(e){e.length>vya||(this._internalState=e.split(uyi).reverse().reduce((r,n)=>{let o=n.trim(),s=o.indexOf(dyi);if(s!==-1){let c=o.slice(0,s),l=o.slice(s+1,n.length);syi(c)&&ayi(l)&&r.set(c,l)}return r},new Map),this._internalState.size>lyi&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,lyi))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function PAr(t){let e=xya.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var tOe,rOe,Cya,bya,Sya,Tya,Iya,xya,Tht,fyi=ve(()=>{p();co();XMe();kAr();tOe="traceparent",rOe="tracestate",Cya="00",bya="(?!ff)[\\da-f]{2}",Sya="(?![0]{32})[\\da-f]{32}",Tya="(?![0]{16})[\\da-f]{16}",Iya="[\\da-f]{2}",xya=new RegExp(`^\\s?(${bya})-(${Sya})-(${Tya})-(${Iya})(-.*)?\\s?$`);a(PAr,"parseTraceParent");Tht=class{static{a(this,"W3CTraceContextPropagator")}inject(e,r,n){let o=wu.getSpanContext(e);if(!o||E0e(e)||!vb(o))return;let s=`${Cya}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||wf.NONE).toString(16)}`;n.set(r,tOe,s),o.traceState&&n.set(r,rOe,o.traceState.serialize())}extract(e,r,n){let o=n.get(r,tOe);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let c=PAr(s);if(!c)return e;c.isRemote=!0;let l=n.get(r,rOe);if(l){let u=Array.isArray(l)?l.join(","):l;c.traceState=new v0e(typeof u=="string"?u:void 0)}return wu.setSpanContext(e,c)}fields(){return[tOe,rOe]}}});function pyi(t,e){return t.setValue(DAr,e)}function hyi(t){return t.deleteValue(DAr)}function myi(t){return t.getValue(DAr)}var DAr,Iht,gyi=ve(()=>{p();co();DAr=_b("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(Iht||(Iht={}));a(pyi,"setRPCMetadata");a(hyi,"deleteRPCMetadata");a(myi,"getRPCMetadata")});function NAr(t){if(!Mya(t)||Oya(t)!==wya)return!1;let e=Nya(t);if(e===null)return!0;let r=Eyi.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Ayi.call(r)===Dya}function Mya(t){return t!=null&&typeof t=="object"}function Oya(t){return t==null?t===void 0?kya:Rya:Pee&&Pee in Object(t)?Lya(t):Bya(t)}function Lya(t){let e=Eyi.call(t,Pee),r=t[Pee],n=!1;try{t[Pee]=void 0,n=!0}catch{}let o=_yi.call(t);return n&&(e?t[Pee]=r:delete t[Pee]),o}function Bya(t){return _yi.call(t)}var wya,Rya,kya,Pya,Ayi,Dya,Nya,yyi,Eyi,Pee,_yi,vyi=ve(()=>{p();wya="[object Object]",Rya="[object Null]",kya="[object Undefined]",Pya=Function.prototype,Ayi=Pya.toString,Dya=Ayi.call(Object),Nya=Object.getPrototypeOf,yyi=Object.prototype,Eyi=yyi.hasOwnProperty,Pee=Symbol?Symbol.toStringTag:void 0,_yi=yyi.toString;a(NAr,"isPlainObject");a(Mya,"isObjectLike");a(Oya,"baseGetTag");a(Lya,"getRawTag");a(Bya,"objectToString")});function byi(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=Syi(e,t.shift(),0,r);return e}function MAr(t){return wht(t)?t.slice():t}function Syi(t,e,r=0,n){let o;if(!(r>Fya)){if(r++,xht(t)||xht(e)||Tyi(e))o=MAr(e);else if(wht(t)){if(o=t.slice(),wht(e))for(let s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{let f=o[u],h=d;if(Cyi(t,u,n)||Cyi(e,u,n))delete o[u];else{if(nOe(f)&&nOe(h)){let m=n.get(f)||[],g=n.get(h)||[];m.push({obj:t,key:u}),g.push({obj:e,key:u}),n.set(f,m),n.set(h,g)}o[u]=Syi(o[u],d,r,n)}}}}else o=e;return o}}function Cyi(t,e,r){let n=r.get(t[e])||[];for(let o=0,s=n.length;o"u"||t instanceof Date||t instanceof RegExp||t===null}function Uya(t,e){return!(!NAr(t)||!NAr(e))}var Fya,Iyi=ve(()=>{p();vyi();Fya=20;a(byi,"merge");a(MAr,"takeValue");a(Syi,"mergeTwoObjects");a(Cyi,"wasObjectReferenced");a(wht,"isArray");a(Tyi,"isFunction");a(nOe,"isObject");a(xht,"isPrimitive");a(Uya,"shouldMerge")});function xyi(t,e){let r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new iOe("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(o=>(clearTimeout(r),o),o=>{throw clearTimeout(r),o})}var iOe,wyi=ve(()=>{p();iOe=class t extends Error{static{a(this,"TimeoutError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};a(xyi,"callWithTimeout")});function OAr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function Ryi(t,e){if(!e)return!1;for(let r of e)if(OAr(t,r))return!0;return!1}var kyi=ve(()=>{p();a(OAr,"urlMatches");a(Ryi,"isUrlIgnored")});var Rht,Pyi=ve(()=>{p();Rht=class{static{a(this,"Deferred")}_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,r)=>{this._resolve=e,this._reject=r})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var kht,Dyi=ve(()=>{p();Pyi();kht=class{static{a(this,"BindOnceFuture")}_callback;_that;_isCalled=!1;_deferred=new Rht;constructor(e,r){this._callback=e,this._that=r}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}}});function Myi(t){if(t==null)return;let e=Nyi[t.toUpperCase()];return e??(Dn.warn(`Unknown log level "${t}", expected one of ${Object.keys(Nyi)}, using default`),Da.INFO)}var Nyi,Oyi=ve(()=>{p();co();Nyi={ALL:Da.ALL,VERBOSE:Da.VERBOSE,DEBUG:Da.DEBUG,INFO:Da.INFO,WARN:Da.WARN,ERROR:Da.ERROR,NONE:Da.NONE};a(Myi,"diagLogLevelFromString")});function Lyi(t,e){return new Promise(r=>{Og.with(cht(Og.active()),()=>{t.export(e,n=>{r(n)})})})}var Byi=ve(()=>{p();co();XMe();a(Lyi,"_export")});var Pht={};ki(Pht,{AnchoredClock:()=>fht,BindOnceFuture:()=>kht,CompositePropagator:()=>Sht,ExportResultCode:()=>bht,RPCType:()=>Iht,SDK_INFO:()=>Eht,TRACE_PARENT_HEADER:()=>tOe,TRACE_STATE_HEADER:()=>rOe,TimeoutError:()=>iOe,TraceState:()=>v0e,W3CBaggagePropagator:()=>dht,W3CTraceContextPropagator:()=>Tht,_globalThis:()=>Aht,addHrTimes:()=>wAr,callWithTimeout:()=>xyi,deleteRPCMetadata:()=>hyi,diagLogLevelFromString:()=>Myi,getBooleanFromEnv:()=>mht,getNumberFromEnv:()=>hht,getRPCMetadata:()=>myi,getStringFromEnv:()=>eOe,getStringListFromEnv:()=>ght,getTimeOrigin:()=>vht,globalErrorHandler:()=>mdi,hrTime:()=>xAr,hrTimeDuration:()=>YAi,hrTimeToMicroseconds:()=>XAi,hrTimeToMilliseconds:()=>ZAi,hrTimeToNanoseconds:()=>JAi,hrTimeToTimeStamp:()=>KAi,internal:()=>Qya,isAttributeValue:()=>AAr,isTimeInput:()=>eyi,isTimeInputHrTime:()=>Cht,isTracingSuppressed:()=>E0e,isUrlIgnored:()=>Ryi,loggingErrorHandler:()=>pht,merge:()=>byi,millisToHrTime:()=>_0e,otperformance:()=>sG,parseKeyPairsIntoRecord:()=>adi,parseTraceParent:()=>PAr,sanitizeAttributes:()=>udi,setGlobalErrorHandler:()=>hdi,setRPCMetadata:()=>pyi,suppressTracing:()=>cht,timeInputToHrTime:()=>zAi,unrefTimer:()=>ryi,unsuppressTracing:()=>rdi,urlMatches:()=>OAr});var Qya,Dht=ve(()=>{p();cdi();ldi();fdi();gdi();yAr();tyi();nyi();iyi();gAr();IAr();oyi();fyi();gyi();XMe();kAr();Iyi();wyi();kyi();Dyi();Oyi();Byi();Qya={_export:Lyi}});var Qyi=I(Nht=>{"use strict";p();Object.defineProperty(Nht,"__esModule",{value:!0});Nht.OpenTelemetrySpanWrapper=void 0;var Fyi=(co(),ba(V5)),Uyi=(Dht(),ba(Pht)),qya=pAr(),LAr=class{static{a(this,"OpenTelemetrySpanWrapper")}constructor(e){this._span=e}setStatus(e){e.status==="error"&&jya(e.error)?e.error?(this._span.setStatus({code:Fyi.SpanStatusCode.ERROR,message:e.error.toString()}),this.recordException(e.error)):this._span.setStatus({code:Fyi.SpanStatusCode.ERROR}):e.status==="success"&&qya.logger.verbose("Leaving span with status UNSET per OpenTelemetry spec.")}setAttribute(e,r){r!=null&&(0,Uyi.isAttributeValue)(r)&&this._span.setAttribute(e,r)}end(){this._span.end()}recordException(e){this._span.recordException(e)}isRecording(){return this._span.isRecording()}addEvent(e,r={}){this._span.addEvent(e,(0,Uyi.sanitizeAttributes)(r.attributes),r.startTime)}unwrap(){return this._span}};Nht.OpenTelemetrySpanWrapper=LAr;function jya(t){return t!==null&&typeof t=="object"&&"statusCode"in t?t.statusCode!==304:!0}a(jya,"isRecordableError")});var BAr=I(S4=>{"use strict";p();Object.defineProperty(S4,"__esModule",{value:!0});S4.environmentCache=S4.SDK_VERSION=void 0;S4.envVarToBoolean=Hya;S4.SDK_VERSION="1.0.0-beta.9";S4.environmentCache=new Map;function Hya(t){var e;S4.environmentCache.has(t)||Gya(t);let r=((e=S4.environmentCache.get(t))!==null&&e!==void 0?e:"").toLowerCase();return r!=="false"&&r!=="0"&&!!r}a(Hya,"envVarToBoolean");function Gya(t){var e;if(typeof process<"u"&&process.env){let r=(e=process.env[t])!==null&&e!==void 0?e:process.env[t.toLowerCase()];S4.environmentCache.set(t,r)}}a(Gya,"loadEnvironmentVariable")});var Gyi=I(Mht=>{"use strict";p();Object.defineProperty(Mht,"__esModule",{value:!0});Mht.toOpenTelemetrySpanKind=Hyi;Mht.toSpanOptions=Vya;var qyi=(co(),ba(V5)),jyi=(Dht(),ba(Pht));function Hyi(t){let e=(t||"internal").toUpperCase();return qyi.SpanKind[e]}a(Hyi,"toOpenTelemetrySpanKind");function $ya(t=[]){return t.reduce((e,r)=>{let n=qyi.trace.getSpanContext(r.tracingContext);return n&&e.push({context:n,attributes:(0,jyi.sanitizeAttributes)(r.attributes)}),e},[])}a($ya,"toOpenTelemetryLinks");function Vya(t){let{spanAttributes:e,spanLinks:r,spanKind:n}=t||{},o=(0,jyi.sanitizeAttributes)(e),s=Hyi(n),c=$ya(r);return{attributes:o,kind:s,links:c}}a(Vya,"toSpanOptions")});var Wyi=I(aG=>{"use strict";p();Object.defineProperty(aG,"__esModule",{value:!0});aG.OpenTelemetryInstrumenter=aG.propagator=void 0;var T4=(co(),ba(V5)),Vyi=(Dht(),ba(Pht)),Wya=Qyi(),$yi=BAr(),zya=Gyi();aG.propagator=new Vyi.W3CTraceContextPropagator;var FAr=class{static{a(this,"OpenTelemetryInstrumenter")}startSpan(e,r){let n=r?.tracingContext||T4.context.active(),o;return(0,$yi.envVarToBoolean)("AZURE_TRACING_DISABLED")?o=T4.trace.wrapSpanContext(T4.INVALID_SPAN_CONTEXT):(o=T4.trace.getTracer(r.packageName,r.packageVersion).startSpan(e,(0,zya.toSpanOptions)(r),n),(0,$yi.envVarToBoolean)("AZURE_HTTP_TRACING_CHILDREN_DISABLED")&&e.toUpperCase().startsWith("HTTP")&&(n=(0,Vyi.suppressTracing)(n))),{span:new Wya.OpenTelemetrySpanWrapper(o),tracingContext:T4.trace.setSpan(n,o)}}withContext(e,r,...n){return T4.context.with(e,r,void 0,...n)}parseTraceparentHeader(e){return aG.propagator.extract(T4.context.active(),{traceparent:e},T4.defaultTextMapGetter)}createRequestHeaders(e){let r={};return aG.propagator.inject(e||T4.context.active(),r,T4.defaultTextMapSetter),r}};aG.OpenTelemetryInstrumenter=FAr});var Yyi=I(oOe=>{"use strict";p();Object.defineProperty(oOe,"__esModule",{value:!0});oOe.AzureSdkInstrumentation=void 0;oOe.createAzureSdkInstrumentation=Jya;var zyi=(oAr(),ba(iAr)),Yya=Wyi(),Kya=BAr(),Oht=class extends zyi.InstrumentationBase{static{a(this,"AzureSdkInstrumentation")}constructor(e={}){super("@azure/opentelemetry-instrumentation-azure-sdk",Kya.SDK_VERSION,Object.assign({},e))}init(){let e=new zyi.InstrumentationNodeModuleDefinition("@azure/core-tracing",["^1.0.0-preview.14","^1.0.0"],r=>(typeof r.useInstrumenter=="function"&&r.useInstrumenter(new Yya.OpenTelemetryInstrumenter),r));return e.includePrerelease=!0,e}};oOe.AzureSdkInstrumentation=Oht;function Jya(t={}){return new Oht(t)}a(Jya,"createAzureSdkInstrumentation")});var Jyi=I(Lht=>{"use strict";p();Object.defineProperty(Lht,"__esModule",{value:!0});var Kyi=(m3(),ba(iQ));Kyi.__exportStar(pAr(),Lht);Kyi.__exportStar(Yyi(),Lht)});var Xyi=I(hR=>{"use strict";p();Object.defineProperty(hR,"__esModule",{value:!0});hR.enable=hR.azureCoreTracing=hR.AzureMonitorSymbol=void 0;var UAr=Cp();hR.AzureMonitorSymbol="Azure_Monitor_Tracer";var QAr="azure-coretracing",Zyi=!1,Zya=a(function(t){if(Zyi)return t;try{var e=(Xci(),ba(Zci)),r=(co(),ba(V5)),n=new e.BasicTracerProvider,o=n.getTracer("applicationinsights tracer");if(t.setTracer){var s=t.setTracer;t.setTracer=function(d){var f=d.startSpan;d.startSpan=function(h,m,g){var A=f.call(this,h,m,g),y=A.end;return A.end=function(){var E=y.apply(this,arguments);return UAr.channel.publish(QAr,A),E},A},d[hR.AzureMonitorSymbol]=!0,s.call(this,d)},r.trace.getSpan(r.context.active()),t.setTracer(o)}else{var c=r.trace.setGlobalTracerProvider;r.trace.setGlobalTracerProvider=function(d){var f=d.getTracer;return d.getTracer=function(h,m){var g=f.call(this,h,m);if(!g[hR.AzureMonitorSymbol]){var A=g.startSpan;g.startSpan=function(y,E,_){var v=A.call(this,y,E,_),b=v.end;return v.end=function(){var T=b.apply(this,arguments);return UAr.channel.publish(QAr,v),T},v},g[hR.AzureMonitorSymbol]=!0}return g},c.call(this,d)},n.register(),r.trace.getSpan(r.context.active());var l=(oAr(),ba(iAr)),u=Jyi();l.registerInstrumentations({instrumentations:[u.createAzureSdkInstrumentation()]})}Zyi=!0}catch{}return t},"azureCoreTracingPatchFunction");hR.azureCoreTracing={versionSpecifier:">= 1.0.0 < 2.0.0",patch:Zya,publisherName:QAr};function Xya(){UAr.channel.registerMonkeyPatch("@azure/core-tracing",hR.azureCoreTracing)}a(Xya,"enable");hR.enable=Xya});var tEi=I(Dee=>{"use strict";p();Object.defineProperty(Dee,"__esModule",{value:!0});Dee.enable=Dee.bunyan=void 0;var eEi=Cp(),eEa=a(function(t){var e=t.prototype._emit;return t.prototype._emit=function(r,n){var o=e.apply(this,arguments);if(!n){var s=o;s||(s=e.call(this,r,!0)),eEi.channel.publish("bunyan",{level:r.level,result:s})}return o},t},"bunyanPatchFunction");Dee.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:eEa};function tEa(){eEi.channel.registerMonkeyPatch("bunyan",Dee.bunyan)}a(tEa,"enable");Dee.enable=tEa});var nEi=I(Nee=>{"use strict";p();Object.defineProperty(Nee,"__esModule",{value:!0});Nee.enable=Nee.console=void 0;var qAr=Cp(),rEi=require("stream"),rEa=a(function(t){var e=new rEi.Writable,r=new rEi.Writable;e.write=function(d){if(!d)return!0;var f=d.toString();return qAr.channel.publish("console",{message:f}),!0},r.write=function(d){if(!d)return!0;var f=d.toString();return qAr.channel.publish("console",{message:f,stderr:!0}),!0};for(var n=new t.Console(e,r),o=["log","info","warn","error","dir","time","timeEnd","trace","assert"],s=a(function(d){var f=t[d];f&&(t[d]=function(){if(n[d])try{n[d].apply(n,arguments)}catch{}return f.apply(t,arguments)})},"_loop_1"),c=0,l=o;c= 4.0.0",patch:rEa};function nEa(){qAr.channel.registerMonkeyPatch("console",Nee.console),require("console")}a(nEa,"enable");Nee.enable=nEa});var iEi=I(Mee=>{"use strict";p();Object.defineProperty(Mee,"__esModule",{value:!0});Mee.enable=Mee.mongoCore=void 0;var jAr=Cp(),iEa=a(function(t){var e=t.Server.prototype.connect;return t.Server.prototype.connect=a(function(){var n=e.apply(this,arguments),o=this.s.pool.write;this.s.pool.write=a(function(){var l=typeof arguments[1]=="function"?1:2;return typeof arguments[l]=="function"&&(arguments[l]=jAr.channel.bindToContext(arguments[l])),o.apply(this,arguments)},"contextPreservingWrite");var s=this.s.pool.logout;return this.s.pool.logout=a(function(){return typeof arguments[1]=="function"&&(arguments[1]=jAr.channel.bindToContext(arguments[1])),s.apply(this,arguments)},"contextPreservingLogout"),n},"contextPreservingConnect"),t},"mongodbcorePatchFunction");Mee.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:iEa};function oEa(){jAr.channel.registerMonkeyPatch("mongodb-core",Mee.mongoCore)}a(oEa,"enable");Mee.enable=oEa});var oEi=I(Cv=>{"use strict";p();var C0e=Cv&&Cv.__assign||function(){return C0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 2.0.0 <= 3.0.5",patch:sEa};Cv.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:aEa};Cv.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:lEa};function uEa(){NE.channel.registerMonkeyPatch("mongodb",Cv.mongo2),NE.channel.registerMonkeyPatch("mongodb",Cv.mongo3),NE.channel.registerMonkeyPatch("mongodb",Cv.mongo330)}a(uEa,"enable");Cv.enable=uEa});var aEi=I(Oee=>{"use strict";p();Object.defineProperty(Oee,"__esModule",{value:!0});Oee.enable=Oee.mysql=void 0;var Bht=Cp(),sEi=require("path"),dEa=a(function(t,e){var r=a(function(u,d){return function(f,h){var m=u[f];m&&(u[f]=a(function(){for(var A=arguments.length-1,y=arguments.length-1;y>=0;--y)if(typeof arguments[y]=="function"){A=y;break}else if(typeof arguments[y]<"u")break;var E=arguments[A],_={result:null,startTime:null,startDate:null};typeof E=="function"&&(h?(_.startTime=process.hrtime(),_.startDate=new Date,arguments[A]=Bht.channel.bindToContext(h(_,E))):arguments[A]=Bht.channel.bindToContext(E));var v=m.apply(this,arguments);return _.result=v,v},"mysqlContextPreserver"))}},"patchObjectFunction"),n=a(function(u,d){return r(u.prototype,d+".prototype")},"patchClassMemberFunction"),o=["connect","changeUser","ping","statistics","end"],s=require(sEi.dirname(e)+"/lib/Connection");o.forEach(function(u){return n(s,"Connection")(u)}),r(s,"Connection")("createQuery",function(u,d){return function(f){var h=process.hrtime(u.startTime),m=h[0]*1e3+h[1]/1e6|0;Bht.channel.publish("mysql",{query:u.result,callbackArgs:arguments,err:f,duration:m,time:u.startDate}),d.apply(this,arguments)}});var c=["_enqueueCallback"],l=require(sEi.dirname(e)+"/lib/Pool");return c.forEach(function(u){return n(l,"Pool")(u)}),t},"mysqlPatchFunction");Oee.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:dEa};function fEa(){Bht.channel.registerMonkeyPatch("mysql",Oee.mysql)}a(fEa,"enable");Oee.enable=fEa});var lEi=I(Lee=>{"use strict";p();Object.defineProperty(Lee,"__esModule",{value:!0});Lee.enable=Lee.postgresPool1=void 0;var cEi=Cp();function pEa(t){var e=t.prototype.connect;return t.prototype.connect=a(function(n){return n&&(arguments[0]=cEi.channel.bindToContext(n)),e.apply(this,arguments)},"connect"),t}a(pEa,"postgresPool1PatchFunction");Lee.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:pEa};function hEa(){cEi.channel.registerMonkeyPatch("pg-pool",Lee.postgresPool1)}a(hEa,"enable");Lee.enable=hEa});var dEi=I(I4=>{"use strict";p();Object.defineProperty(I4,"__esModule",{value:!0});I4.enable=I4.postgres=I4.postgres6=void 0;var b0e=Cp(),uEi=require("events"),HAr="postgres";function mEa(t,e){var r=t.Client.prototype.query,n="__diagnosticOriginalFunc";return t.Client.prototype.query=a(function(s,c,l){var u={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},d=process.hrtime(),f;function h(m){m&&m[n]&&(m=m[n]);var g=b0e.channel.bindToContext(function(A,y){var E=process.hrtime(d);if(u.result=y&&{rowCount:y.rowCount,command:y.command},u.error=A,u.duration=Math.ceil(E[0]*1e3+E[1]/1e6),b0e.channel.publish(HAr,u),A){if(m)return m.apply(this,arguments);f&&f instanceof uEi.EventEmitter&&f.emit("error",A)}else m&&m.apply(this,arguments)});try{return Object.defineProperty(g,n,{value:m}),g}catch{return m}}a(h,"patchCallback");try{typeof s=="string"?c instanceof Array?(u.query.preparable={text:s,args:c},l=h(l)):(u.query.text=s,l?l=h(l):c=h(c)):(typeof s.name=="string"?u.query.plan=s.name:s.values instanceof Array?u.query.preparable={text:s.text,args:s.values}:u.query.text=s.text,l?l=h(l):c?c=h(c):s.callback=h(s.callback))}catch{return r.apply(this,arguments)}return arguments[0]=s,arguments[1]=c,arguments[2]=l,arguments.length=arguments.length>3?arguments.length:3,f=r.apply(this,arguments),f},"query"),t}a(mEa,"postgres6PatchFunction");function gEa(t,e){var r=t.Client.prototype.query,n="__diagnosticOriginalFunc";return t.Client.prototype.query=a(function(s,c,l){var u=this,d,f,h=!!l,m={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},g,A=process.hrtime();function y(v){v&&v[n]&&(v=v[n]);var b=b0e.channel.bindToContext(function(T,w){var R=process.hrtime(A);if(m.result=w&&{rowCount:w.rowCount,command:w.command},m.error=T,m.duration=Math.ceil(R[0]*1e3+R[1]/1e6),b0e.channel.publish(HAr,m),T){if(v)return v.apply(this,arguments);g&&g instanceof uEi.EventEmitter&&g.emit("error",T)}else v&&v.apply(this,arguments)});try{return Object.defineProperty(b,n,{value:v}),b}catch{return v}}a(y,"patchCallback");try{typeof s=="string"?c instanceof Array?(m.query.preparable={text:s,args:c},h=typeof l=="function",l=h?y(l):l):(m.query.text=s,l?(h=typeof l=="function",l=h?y(l):l):(h=typeof c=="function",c=h?y(c):c)):(typeof s.name=="string"?m.query.plan=s.name:s.values instanceof Array?m.query.preparable={text:s.text,args:s.values}:s.cursor?m.query.text=(d=s.cursor)===null||d===void 0?void 0:d.text:m.query.text=s.text,l?(h=typeof l=="function",l=y(l)):c?(h=typeof c=="function",c=h?y(c):c):(h=typeof s.callback=="function",s.callback=h?y(s.callback):s.callback))}catch{return r.apply(this,arguments)}arguments[0]=s,arguments[1]=c,arguments[2]=l,arguments.length=arguments.length>3?arguments.length:3;try{g=r.apply(this,arguments)}catch(v){throw y()(v,void 0),v}if(!h){if(g instanceof Promise)return g.then(function(v){return y()(void 0,v),new u._Promise(function(b,T){b(v)})}).catch(function(v){return y()(v,void 0),new u._Promise(function(b,T){T(v)})});var E=g.text?g.text:"";if(g.cursor&&(E=(f=g.cursor)===null||f===void 0?void 0:f.text),E){var _={command:E,rowCount:0};y()(void 0,_)}}return g},"query"),t}a(gEa,"postgresLatestPatchFunction");I4.postgres6={versionSpecifier:"6.*",patch:mEa};I4.postgres={versionSpecifier:">=7.* <=8.*",patch:gEa,publisherName:HAr};function AEa(){b0e.channel.registerMonkeyPatch("pg",I4.postgres6),b0e.channel.registerMonkeyPatch("pg",I4.postgres)}a(AEa,"enable");I4.enable=AEa});var fEi=I(Bee=>{"use strict";p();Object.defineProperty(Bee,"__esModule",{value:!0});Bee.enable=Bee.redis=void 0;var GAr=Cp(),yEa=a(function(t){var e=t.RedisClient.prototype.internal_send_command;return t.RedisClient.prototype.internal_send_command=function(r){if(r){var n=r.callback;if(!n||!n.pubsubBound){var o=this.address,s=process.hrtime(),c=new Date;r.callback=GAr.channel.bindToContext(function(l,u){var d=process.hrtime(s),f=d[0]*1e3+d[1]/1e6|0;GAr.channel.publish("redis",{duration:f,address:o,commandObj:r,err:l,result:u,time:c}),typeof n=="function"&&n.apply(this,arguments)}),r.callback.pubsubBound=!0}}return e.call(this,r)},t},"redisPatchFunction");Bee.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:yEa};function EEa(){GAr.channel.registerMonkeyPatch("redis",Bee.redis)}a(EEa,"enable");Bee.enable=EEa});var pEi=I(O8=>{"use strict";p();var Fht=O8&&O8.__assign||function(){return Fht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 6.0.0 < 9.0.0",patch:_Ea};function vEa(){$Ar.channel.registerMonkeyPatch("tedious",O8.tedious)}a(vEa,"enable");O8.enable=vEa});var hEi=I(qb=>{"use strict";p();var CEa=qb&&qb.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),bEa=qb&&qb.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);od[f]?h:f);return f}a(n,"getLogLevel");function o(l){this.add(new r(t,{level:n(l)}))}a(o,"patchedConfigure");var s=t.createLogger;t.createLogger=a(function(u){var d=s.call(this,u);d.add(new r(t,{level:n(u)}));var f=d.configure;return d.configure=function(){f.apply(this,arguments),o.apply(this,arguments)},d},"patchedCreate");var c=t.configure;return t.configure=function(){c.apply(this,arguments),o.apply(this,arguments)},t.add(new r(t)),t},"winston3PatchFunction");qb.winston3={versionSpecifier:"3.x",patch:TEa};qb.winston2={versionSpecifier:"2.x",patch:SEa};function IEa(){Uht.channel.registerMonkeyPatch("winston",qb.winston2),Uht.channel.registerMonkeyPatch("winston",qb.winston3)}a(IEa,"enable");qb.enable=IEa});var IEi=I(ku=>{"use strict";p();Object.defineProperty(ku,"__esModule",{value:!0});ku.enable=ku.tedious=ku.pgPool=ku.pg=ku.winston=ku.redis=ku.mysql=ku.mongodb=ku.mongodbCore=ku.console=ku.bunyan=ku.azuresdk=void 0;var mEi=Xyi();ku.azuresdk=mEi;var gEi=tEi();ku.bunyan=gEi;var AEi=nEi();ku.console=AEi;var yEi=iEi();ku.mongodbCore=yEi;var EEi=oEi();ku.mongodb=EEi;var _Ei=aEi();ku.mysql=_Ei;var vEi=lEi();ku.pgPool=vEi;var CEi=dEi();ku.pg=CEi;var bEi=fEi();ku.redis=bEi;var SEi=pEi();ku.tedious=SEi;var TEi=hEi();ku.winston=TEi;function xEa(){gEi.enable(),AEi.enable(),yEi.enable(),EEi.enable(),_Ei.enable(),CEi.enable(),vEi.enable(),bEi.enable(),TEi.enable(),mEi.enable(),SEi.enable()}a(xEa,"enable");ku.enable=xEa});var jht=I(Fee=>{"use strict";p();Object.defineProperty(Fee,"__esModule",{value:!0});Fee.IsInitialized=void 0;Fee.registerContextPreservation=wEa;var VAr=Kl(),wEi=tpt();Fee.IsInitialized=!wEi.JsonConfig.getInstance().noDiagnosticChannel;var WAr="DiagnosticChannel";if(Fee.IsInitialized){nD=IEi(),xEi=wEi.JsonConfig.getInstance().noPatchModules,Qht=xEi.split(","),zAr={bunyan:nD.bunyan,console:nD.console,mongodb:nD.mongodb,mongodbCore:nD.mongodbCore,mysql:nD.mysql,redis:nD.redis,pg:nD.pg,pgPool:nD.pgPool,winston:nD.winston,azuresdk:nD.azuresdk};for(qht in zAr)Qht.indexOf(qht)===-1&&(zAr[qht].enable(),VAr.info(WAr,"Subscribed to ".concat(qht," events")));Qht.length>0&&VAr.info(WAr,"Some modules will not be patched",Qht)}else VAr.info(WAr,"Not subscribing to dependency autocollection because APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL was set");var nD,xEi,Qht,zAr,qht;function wEa(t){if(Fee.IsInitialized){var e=Cp();e.channel.addContextPreservation(t)}}a(wEa,"registerContextPreservation")});var S0e=I((Cpp,REi)=>{"use strict";p();REi.exports={requestContextHeader:"request-context",requestContextSourceKey:"appId",requestContextTargetKey:"appId",requestIdHeader:"request-id",parentIdHeader:"x-ms-request-id",rootIdHeader:"x-ms-request-root-id",correlationContextHeader:"correlation-context",traceparentHeader:"traceparent",traceStateHeader:"tracestate"}});var ay=I((JAr,kEi)=>{"use strict";p();var lG=JAr&&JAr.__assign||function(){return lG=Object.assign||function(t){for(var e,r=1,n=arguments.length;r>u&255)},"toChar"),n=a(function(l){return r(l,24)+r(l,16)+r(l,8)+r(l,0)},"int32AsString"),o=e.map(n).join(""),s=Buffer.from?Buffer.from(o,"binary"):new Buffer(o,"binary"),c=s.toString("base64");return c.substr(0,c.indexOf("="))},t.random32=function(){return 4294967296*Math.random()|0},t.randomu32=function(){return t.random32()+2147483648},t.w3cTraceId=function(){for(var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],r="",n,o=0;o<4;o++)n=t.random32(),r+=e[n&15]+e[n>>4&15]+e[n>>8&15]+e[n>>12&15]+e[n>>16&15]+e[n>>20&15]+e[n>>24&15]+e[n>>28&15];var s=e[8+Math.random()*4|0];return r.substr(0,8)+r.substr(9,4)+"4"+r.substr(13,3)+s+r.substr(16,3)+r.substr(19,12)},t.w3cSpanId=function(){return t.w3cTraceId().substring(16)},t.isValidW3CId=function(e){return e.length===32&&e!=="00000000000000000000000000000000"},t.isArray=function(e){return Object.prototype.toString.call(e)==="[object Array]"},t.isError=function(e){return Object.prototype.toString.call(e)==="[object Error]"},t.isPrimitive=function(e){var r=typeof e;return r==="string"||r==="number"||r==="boolean"},t.isDate=function(e){return Object.prototype.toString.call(e)==="[object Date]"},t.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var r=(e/1e3%60).toFixed(7).replace(/0{0,4}$/,""),n=""+Math.floor(e/(1e3*60))%60,o=""+Math.floor(e/(1e3*60*60))%24,s=Math.floor(e/(1e3*60*60*24));r=r.indexOf(".")<2?"0"+r:r,n=n.length<2?"0"+n:n,o=o.length<2?"0"+o:o;var c=s>0?s+".":"";return c+o+":"+n+":"+r},t.extractError=function(e){var r=e;return{message:e.message,code:r.code||r.id||""}},t.extractObject=function(e){return e instanceof Error?t.extractError(e):typeof e.toJSON=="function"?e.toJSON():e},t.validateStringMap=function(e){if(typeof e!="object"){Uee.info("Invalid properties dropped from payload");return}var r={};for(var n in e){var o="",s=e[n],c=typeof s;if(t.isPrimitive(s))o=s.toString();else if(s===null||c==="undefined")o="";else if(c==="function"){Uee.info("key: "+n+" was function; will not serialize");continue}else{var l=t.isArray(s)?s:t.extractObject(s);try{t.isPrimitive(l)?o=l:o=JSON.stringify(l)}catch(u){o=s.constructor.name.toString()+" (Error: "+u.message+")",Uee.info("key: "+n+", could not be serialized")}}r[n]=o.substring(0,t.MAX_PROPERTY_LENGTH)}return r},t.canIncludeCorrelationHeader=function(e,r){var n=e&&e.config&&e.config.correlationHeaderExcludedDomains;if(!n||n.length==0||!r)return!0;for(var o=0;o{"use strict";p();var ZAr=ay(),DEa=(function(){function t(){}return a(t,"CorrelationIdManager"),t.queryCorrelationId=function(e,r){},t.cancelCorrelationIdQuery=function(e,r){},t.generateRequestId=function(e){if(e){e=e[0]=="|"?e:"|"+e,e[e.length-1]!=="."&&(e+=".");var r=(t.currentRootId++).toString(16);return t.appendSuffix(e,r,"_")}else return t.generateRootId()},t.getRootId=function(e){var r=e.indexOf(".");r<0&&(r=e.length);var n=e[0]==="|"?1:0;return e.substring(n,r)},t.generateRootId=function(){return"|"+ZAr.w3cTraceId()+"."},t.appendSuffix=function(e,r,n){if(e.length+r.lengtho)for(;o>1;--o){var s=e[o-1];if(s==="."||s==="_")break}if(o<=1)return t.generateRootId();for(r=ZAr.randomu32().toString(16);r.length<8;)r="0"+r;return e.substring(0,o)+r+"#"},t.correlationIdPrefix="cid-v1:",t.w3cEnabled=!0,t.HTTP_TIMEOUT=2500,t.requestIdMaxLength=1024,t.currentRootId=ZAr.randomu32(),t})();PEi.exports=DEa});var Hht=I((Rpp,DEi)=>{"use strict";p();var cy=ay(),NEa=Qee(),MEa=(function(){function t(e,r){if(this.traceFlag=t.DEFAULT_TRACE_FLAG,this.version=t.DEFAULT_VERSION,e&&typeof e=="string")if(e.split(",").length>1)this.traceId=cy.w3cTraceId(),this.spanId=cy.w3cTraceId().substr(0,16);else{var n=e.trim().split("-"),o=n.length;o>=4?(this.version=n[0],this.traceId=n[1],this.spanId=n[2],this.traceFlag=n[3]):(this.traceId=cy.w3cTraceId(),this.spanId=cy.w3cTraceId().substr(0,16)),this.version.match(/^[0-9a-f]{2}$/g)||(this.version=t.DEFAULT_VERSION,this.traceId=cy.w3cTraceId()),this.version==="00"&&o!==4&&(this.traceId=cy.w3cTraceId(),this.spanId=cy.w3cTraceId().substr(0,16)),this.version==="ff"&&(this.version=t.DEFAULT_VERSION,this.traceId=cy.w3cTraceId(),this.spanId=cy.w3cTraceId().substr(0,16)),this.version.match(/^0[0-9a-f]$/g)||(this.version=t.DEFAULT_VERSION),this.traceFlag.match(/^[0-9a-f]{2}$/g)||(this.traceFlag=t.DEFAULT_TRACE_FLAG,this.traceId=cy.w3cTraceId()),t.isValidTraceId(this.traceId)||(this.traceId=cy.w3cTraceId()),t.isValidSpanId(this.spanId)||(this.spanId=cy.w3cTraceId().substr(0,16),this.traceId=cy.w3cTraceId()),this.parentId=this.getBackCompatRequestId()}else if(r){this.parentId=r.slice();var s=NEa.getRootId(r);t.isValidTraceId(s)||(this.legacyRootId=s,s=cy.w3cTraceId()),r.indexOf("|")!==-1&&(r=r.substring(1+r.substring(0,r.length-1).lastIndexOf("."),r.length-1)),this.traceId=s,this.spanId=r}else this.traceId=cy.w3cTraceId(),this.spanId=cy.w3cTraceId().substr(0,16)}return a(t,"Traceparent"),t.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&e!=="00000000000000000000000000000000"},t.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&e!=="0000000000000000"},t.formatOpenTelemetryTraceFlags=function(e){var r="0"+e.toString(16);return r.substring(r.length-2)},t.prototype.getBackCompatRequestId=function(){return"|".concat(this.traceId,".").concat(this.spanId,".")},t.prototype.toString=function(){return"".concat(this.version,"-").concat(this.traceId,"-").concat(this.spanId,"-").concat(this.traceFlag)},t.prototype.updateSpanId=function(){this.spanId=cy.w3cTraceId().substr(0,16)},t.DEFAULT_TRACE_FLAG="01",t.DEFAULT_VERSION="00",t})();DEi.exports=MEa});var XAr=I((Dpp,NEi)=>{"use strict";p();var OEa=(function(){function t(e){this.fieldmap=[],e&&(this.fieldmap=this.parseHeader(e))}return a(t,"Tracestate"),t.prototype.toString=function(){var e=this.fieldmap;return!e||e.length==0?null:e.join(", ")},t.validateKeyChars=function(e){var r=e.split("@");if(r.length==2){var n=r[0].trim(),o=r[1].trim(),s=!!n.match(/^[\ ]?[a-z0-9\*\-\_/]{1,241}$/),c=!!o.match(/^[\ ]?[a-z0-9\*\-\_/]{1,14}$/);return s&&c}else if(r.length==1)return!!e.match(/^[\ ]?[a-z0-9\*\-\_/]{1,256}$/);return!1},t.prototype.parseHeader=function(e){var r=[],n={},o=e.split(",");if(o.length>32)return null;for(var s=0,c=o;s{"use strict";p();var LEa=(function(){function t(){}return a(t,"Domain"),t})();MEi.exports=LEa});var LEi=I((eyr,OEi)=>{"use strict";p();var BEa=eyr&&eyr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),FEa=L8(),UEa=(function(t){BEa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"AvailabilityData"),e})(FEa);OEi.exports=UEa});var tyr=I((Qpp,BEi)=>{"use strict";p();var QEa=(function(){function t(){}return a(t,"Base"),t})();BEi.exports=QEa});var UEi=I((Hpp,FEi)=>{"use strict";p();var qEa=(function(){function t(){this.applicationVersion="ai.application.ver",this.deviceId="ai.device.id",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceOEMName="ai.device.oemName",this.deviceOSVersion="ai.device.osVersion",this.deviceType="ai.device.type",this.locationIp="ai.location.ip",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.userAccountId="ai.user.accountId",this.userId="ai.user.id",this.userAuthUserId="ai.user.authUserId",this.cloudRole="ai.cloud.role",this.cloudRoleInstance="ai.cloud.roleInstance",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion",this.internalNodeName="ai.internal.nodeName"}return a(t,"ContextTagKeys"),t})();FEi.exports=qEa});var qEi=I((ryr,QEi)=>{"use strict";p();var jEa=ryr&&ryr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),HEa=tyr(),GEa=(function(t){jEa(e,t);function e(){return t.call(this)||this}return a(e,"Data"),e})(HEa);QEi.exports=GEa});var iyr=I((zpp,jEi)=>{"use strict";p();var nyr;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(nyr||(nyr={}));jEi.exports=nyr});var GEi=I((Kpp,HEi)=>{"use strict";p();var $Ea=iyr(),VEa=(function(){function t(){this.kind=$Ea.Measurement}return a(t,"DataPoint"),t})();HEi.exports=VEa});var VEi=I((Xpp,$Ei)=>{"use strict";p();var WEa=(function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return a(t,"Envelope"),t})();$Ei.exports=WEa});var syr=I((oyr,WEi)=>{"use strict";p();var zEa=oyr&&oyr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),YEa=L8(),KEa=(function(t){zEa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"EventData"),e})(YEa);WEi.exports=KEa});var YEi=I((ayr,zEi)=>{"use strict";p();var JEa=ayr&&ayr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),ZEa=L8(),XEa=(function(t){JEa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.exceptions=[],r.properties={},r.measurements={},r}return a(e,"ExceptionData"),e})(ZEa);zEi.exports=XEa});var JEi=I((shp,KEi)=>{"use strict";p();var e_a=(function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return a(t,"ExceptionDetails"),t})();KEi.exports=e_a});var XEi=I((cyr,ZEi)=>{"use strict";p();var t_a=cyr&&cyr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),r_a=L8(),n_a=(function(t){t_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r}return a(e,"MessageData"),e})(r_a);ZEi.exports=n_a});var t_i=I((lyr,e_i)=>{"use strict";p();var i_a=lyr&&lyr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),o_a=L8(),s_a=(function(t){i_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.metrics=[],r.properties={},r}return a(e,"MetricData"),e})(o_a);e_i.exports=s_a});var n_i=I((uyr,r_i)=>{"use strict";p();var a_a=uyr&&uyr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),c_a=syr(),l_a=(function(t){a_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"PageViewData"),e})(c_a);r_i.exports=l_a});var o_i=I((dyr,i_i)=>{"use strict";p();var u_a=dyr&&dyr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),d_a=L8(),f_a=(function(t){u_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.success=!0,r.properties={},r.measurements={},r}return a(e,"RemoteDependencyData"),e})(d_a);i_i.exports=f_a});var a_i=I((fyr,s_i)=>{"use strict";p();var p_a=fyr&&fyr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),h_a=L8(),m_a=(function(t){p_a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"RequestData"),e})(h_a);s_i.exports=m_a});var l_i=I((Ehp,c_i)=>{"use strict";p();var pyr;(function(t){t[t.Verbose=0]="Verbose",t[t.Information=1]="Information",t[t.Warning=2]="Warning",t[t.Error=3]="Error",t[t.Critical=4]="Critical"})(pyr||(pyr={}));c_i.exports=pyr});var d_i=I((vhp,u_i)=>{"use strict";p();var g_a=(function(){function t(){}return a(t,"StackFrame"),t})();u_i.exports=g_a});var hyr=I(ym=>{"use strict";p();Object.defineProperty(ym,"__esModule",{value:!0});ym.AvailabilityData=LEi();ym.Base=tyr();ym.ContextTagKeys=UEi();ym.Data=qEi();ym.DataPoint=GEi();ym.DataPointType=iyr();ym.Domain=L8();ym.Envelope=VEi();ym.EventData=syr();ym.ExceptionData=YEi();ym.ExceptionDetails=JEi();ym.MessageData=XEi();ym.MetricData=t_i();ym.PageViewData=n_i();ym.RemoteDependencyData=o_i();ym.RequestData=a_i();ym.SeverityLevel=l_i();ym.StackFrame=d_i()});var f_i=I(sOe=>{"use strict";p();Object.defineProperty(sOe,"__esModule",{value:!0});sOe.RemoteDependencyDataConstants=void 0;sOe.domainSupportsProperties=y_a;var qee=hyr(),A_a=(function(){function t(){}return a(t,"RemoteDependencyDataConstants"),t.TYPE_HTTP="Http",t.TYPE_AI="Http (tracked component)",t})();sOe.RemoteDependencyDataConstants=A_a;function y_a(t){return"properties"in t||t instanceof qee.EventData||t instanceof qee.ExceptionData||t instanceof qee.MessageData||t instanceof qee.MetricData||t instanceof qee.PageViewData||t instanceof qee.RemoteDependencyData||t instanceof qee.RequestData}a(y_a,"domainSupportsProperties")});var h_i=I(p_i=>{"use strict";p();Object.defineProperty(p_i,"__esModule",{value:!0})});var g_i=I(m_i=>{"use strict";p();Object.defineProperty(m_i,"__esModule",{value:!0})});var y_i=I(A_i=>{"use strict";p();Object.defineProperty(A_i,"__esModule",{value:!0})});var __i=I(E_i=>{"use strict";p();Object.defineProperty(E_i,"__esModule",{value:!0})});var C_i=I(v_i=>{"use strict";p();Object.defineProperty(v_i,"__esModule",{value:!0})});var S_i=I(b_i=>{"use strict";p();Object.defineProperty(b_i,"__esModule",{value:!0})});var I_i=I(T_i=>{"use strict";p();Object.defineProperty(T_i,"__esModule",{value:!0})});var w_i=I(x_i=>{"use strict";p();Object.defineProperty(x_i,"__esModule",{value:!0})});var k_i=I(R_i=>{"use strict";p();Object.defineProperty(R_i,"__esModule",{value:!0})});var D_i=I(P_i=>{"use strict";p();Object.defineProperty(P_i,"__esModule",{value:!0})});var M_i=I(N_i=>{"use strict";p();Object.defineProperty(N_i,"__esModule",{value:!0})});var L_i=I(O_i=>{"use strict";p();Object.defineProperty(O_i,"__esModule",{value:!0})});var B_i=I(uG=>{"use strict";p();Object.defineProperty(uG,"__esModule",{value:!0});uG.TelemetryType=uG.TelemetryTypeString=void 0;uG.telemetryTypeToBaseType=E_a;uG.baseTypeToTelemetryType=__a;function E_a(t){switch(t){case Hg.Event:return"EventData";case Hg.Exception:return"ExceptionData";case Hg.Trace:return"MessageData";case Hg.Metric:return"MetricData";case Hg.Request:return"RequestData";case Hg.Dependency:return"RemoteDependencyData";case Hg.Availability:return"AvailabilityData";case Hg.PageView:return"PageViewData"}}a(E_a,"telemetryTypeToBaseType");function __a(t){switch(t){case"EventData":return Hg.Event;case"ExceptionData":return Hg.Exception;case"MessageData":return Hg.Trace;case"MetricData":return Hg.Metric;case"RequestData":return Hg.Request;case"RemoteDependencyData":return Hg.Dependency;case"AvailabilityData":return Hg.Availability;case"PageViewData":return Hg.PageView}}a(__a,"baseTypeToTelemetryType");uG.TelemetryTypeString={Event:"EventData",Exception:"ExceptionData",Trace:"MessageData",Metric:"MetricData",Request:"RequestData",Dependency:"RemoteDependencyData",Availability:"AvailabilityData",PageView:"PageViewData"};var Hg;(function(t){t[t.Event=0]="Event",t[t.Exception=1]="Exception",t[t.Trace=2]="Trace",t[t.Metric=3]="Metric",t[t.Request=4]="Request",t[t.Dependency=5]="Dependency",t[t.Availability=6]="Availability",t[t.PageView=7]="PageView"})(Hg||(uG.TelemetryType=Hg={}))});var F_i=I(b0=>{"use strict";p();var v_a=b0&&b0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$T=b0&&b0.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&v_a(e,t,r)};Object.defineProperty(b0,"__esModule",{value:!0});$T(h_i(),b0);$T(g_i(),b0);$T(y_i(),b0);$T(__i(),b0);$T(C_i(),b0);$T(S_i(),b0);$T(I_i(),b0);$T(w_i(),b0);$T(k_i(),b0);$T(D_i(),b0);$T(M_i(),b0);$T(L_i(),b0);$T(B_i(),b0)});var Q_i=I(U_i=>{"use strict";p();Object.defineProperty(U_i,"__esModule",{value:!0})});var j_i=I(q_i=>{"use strict";p();Object.defineProperty(q_i,"__esModule",{value:!0})});var G_i=I(H_i=>{"use strict";p();Object.defineProperty(H_i,"__esModule",{value:!0})});var V_i=I($_i=>{"use strict";p();Object.defineProperty($_i,"__esModule",{value:!0})});var z_i=I(W_i=>{"use strict";p();Object.defineProperty(W_i,"__esModule",{value:!0})});var K_i=I(Y_i=>{"use strict";p();Object.defineProperty(Y_i,"__esModule",{value:!0})});var Z_i=I(J_i=>{"use strict";p();Object.defineProperty(J_i,"__esModule",{value:!0})});var evi=I(X_i=>{"use strict";p();Object.defineProperty(X_i,"__esModule",{value:!0})});var tvi=I(jb=>{"use strict";p();var C_a=jb&&jb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dG=jb&&jb.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&C_a(e,t,r)};Object.defineProperty(jb,"__esModule",{value:!0});dG(Q_i(),jb);dG(j_i(),jb);dG(G_i(),jb);dG(V_i(),jb);dG(z_i(),jb);dG(K_i(),jb);dG(Z_i(),jb);dG(evi(),jb)});var ME=I(x4=>{"use strict";p();var b_a=x4&&x4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ght=x4&&x4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&b_a(e,t,r)};Object.defineProperty(x4,"__esModule",{value:!0});Ght(f_i(),x4);Ght(hyr(),x4);Ght(F_i(),x4);Ght(tvi(),x4)});var myr=I((xmp,rvi)=>{"use strict";p();var S_a=(function(){function t(){}return a(t,"RequestParser"),t.prototype.getUrl=function(){return this.url},t.prototype.RequestParser=function(){this.startTime=+new Date},t.prototype._setStatus=function(e,r){var n=+new Date;this.duration=n-this.startTime,this.statusCode=e;var o=this.properties||{};if(r){if(typeof r=="string")o.error=r;else if(r instanceof Error)o.error=r.message;else if(typeof r=="object")for(var s in r)o[s]=r[s]&&r[s].toString&&r[s].toString()}this.properties=o},t.prototype._isSuccess=function(){return 0{"use strict";p();var iD;Object.defineProperty(jr,"__esModule",{value:!0});jr.WEB_INSTRUMENTATION_DEPRECATED_SOURCE=jr.WEB_INSTRUMENTATION_DEFAULT_SOURCE=jr.TIME_SINCE_ENQUEUED=jr.ENQUEUED_TIME=jr.MessageBusDestination=jr.MicrosoftEventHub=jr.AzNamespace=jr.AttachTypePrefix=jr.HttpRequestCookieNames=jr.StatsbeatNetworkCategory=jr.StatsbeatFeatureType=jr.StatsbeatInstrumentation=jr.StatsbeatFeature=jr.StatsbeatCounter=jr.StatsbeatAttach=jr.StatsbeatResourceProvider=jr.StatsbeatTelemetryName=jr.HeartBeatMetricName=jr.DependencyTypeName=jr.TelemetryTypeStringToQuickPulseDocumentType=jr.TelemetryTypeStringToQuickPulseType=jr.QuickPulseType=jr.QuickPulseDocumentType=jr.PerformanceToQuickPulseCounter=jr.MetricId=jr.PerformanceCounter=jr.QuickPulseCounter=jr.DEFAULT_LIVEMETRICS_HOST=jr.DEFAULT_LIVEMETRICS_ENDPOINT=jr.DEFAULT_BREEZE_ENDPOINT=jr.APPLICATION_INSIGHTS_SDK_VERSION=void 0;jr.APPLICATION_INSIGHTS_SDK_VERSION="2.9.8";jr.DEFAULT_BREEZE_ENDPOINT="https://dc.services.visualstudio.com";jr.DEFAULT_LIVEMETRICS_ENDPOINT="https://rt.services.visualstudio.com";jr.DEFAULT_LIVEMETRICS_HOST="rt.services.visualstudio.com";var ly;(function(t){t.COMMITTED_BYTES="\\Memory\\Committed Bytes",t.PROCESSOR_TIME="\\Processor(_Total)\\% Processor Time",t.REQUEST_RATE="\\ApplicationInsights\\Requests/Sec",t.REQUEST_FAILURE_RATE="\\ApplicationInsights\\Requests Failed/Sec",t.REQUEST_DURATION="\\ApplicationInsights\\Request Duration",t.DEPENDENCY_RATE="\\ApplicationInsights\\Dependency Calls/Sec",t.DEPENDENCY_FAILURE_RATE="\\ApplicationInsights\\Dependency Calls Failed/Sec",t.DEPENDENCY_DURATION="\\ApplicationInsights\\Dependency Call Duration",t.EXCEPTION_RATE="\\ApplicationInsights\\Exceptions/Sec"})(ly||(jr.QuickPulseCounter=ly={}));var aOe;(function(t){t.PRIVATE_BYTES="\\Process(??APP_WIN32_PROC??)\\Private Bytes",t.AVAILABLE_BYTES="\\Memory\\Available Bytes",t.PROCESSOR_TIME="\\Processor(_Total)\\% Processor Time",t.PROCESS_TIME="\\Process(??APP_WIN32_PROC??)\\% Processor Time",t.REQUEST_RATE="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec",t.REQUEST_DURATION="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Request Execution Time"})(aOe||(jr.PerformanceCounter=aOe={}));var nvi;(function(t){t.REQUESTS_DURATION="requests/duration",t.DEPENDENCIES_DURATION="dependencies/duration",t.EXCEPTIONS_COUNT="exceptions/count",t.TRACES_COUNT="traces/count"})(nvi||(jr.MetricId=nvi={}));jr.PerformanceToQuickPulseCounter=(iD={},iD[aOe.PROCESSOR_TIME]=ly.PROCESSOR_TIME,iD[aOe.REQUEST_RATE]=ly.REQUEST_RATE,iD[aOe.REQUEST_DURATION]=ly.REQUEST_DURATION,iD[ly.COMMITTED_BYTES]=ly.COMMITTED_BYTES,iD[ly.REQUEST_FAILURE_RATE]=ly.REQUEST_FAILURE_RATE,iD[ly.DEPENDENCY_RATE]=ly.DEPENDENCY_RATE,iD[ly.DEPENDENCY_FAILURE_RATE]=ly.DEPENDENCY_FAILURE_RATE,iD[ly.DEPENDENCY_DURATION]=ly.DEPENDENCY_DURATION,iD[ly.EXCEPTION_RATE]=ly.EXCEPTION_RATE,iD);jr.QuickPulseDocumentType={Event:"Event",Exception:"Exception",Trace:"Trace",Metric:"Metric",Request:"Request",Dependency:"RemoteDependency",Availability:"Availability",PageView:"PageView"};jr.QuickPulseType={Event:"EventTelemetryDocument",Exception:"ExceptionTelemetryDocument",Trace:"TraceTelemetryDocument",Metric:"MetricTelemetryDocument",Request:"RequestTelemetryDocument",Dependency:"DependencyTelemetryDocument",Availability:"AvailabilityTelemetryDocument",PageView:"PageViewTelemetryDocument"};jr.TelemetryTypeStringToQuickPulseType={EventData:jr.QuickPulseType.Event,ExceptionData:jr.QuickPulseType.Exception,MessageData:jr.QuickPulseType.Trace,MetricData:jr.QuickPulseType.Metric,RequestData:jr.QuickPulseType.Request,RemoteDependencyData:jr.QuickPulseType.Dependency,AvailabilityData:jr.QuickPulseType.Availability,PageViewData:jr.QuickPulseType.PageView};jr.TelemetryTypeStringToQuickPulseDocumentType={EventData:jr.QuickPulseDocumentType.Event,ExceptionData:jr.QuickPulseDocumentType.Exception,MessageData:jr.QuickPulseDocumentType.Trace,MetricData:jr.QuickPulseDocumentType.Metric,RequestData:jr.QuickPulseDocumentType.Request,RemoteDependencyData:jr.QuickPulseDocumentType.Dependency,AvailabilityData:jr.QuickPulseDocumentType.Availability,PageViewData:jr.QuickPulseDocumentType.PageView};jr.DependencyTypeName={Grpc:"GRPC",Http:"HTTP",InProc:"InProc",Sql:"SQL",QueueMessage:"Queue Message"};jr.HeartBeatMetricName="HeartbeatState";jr.StatsbeatTelemetryName="Statsbeat";jr.StatsbeatResourceProvider={appsvc:"appsvc",aks:"aks",functions:"functions",vm:"vm",unknown:"unknown"};jr.StatsbeatAttach={codeless:"IntegratedAuto",sdk:"Manual"};jr.StatsbeatCounter={REQUEST_SUCCESS:"Request_Success_Count",REQUEST_FAILURE:"Request_Failure_Count",REQUEST_DURATION:"Request_Duration",RETRY_COUNT:"Retry_Count",THROTTLE_COUNT:"Throttle_Count",EXCEPTION_COUNT:"Exception_Count",ATTACH:"Attach",FEATURE:"Feature"};var ivi;(function(t){t[t.NONE=0]="NONE",t[t.DISK_RETRY=1]="DISK_RETRY",t[t.AAD_HANDLING=2]="AAD_HANDLING",t[t.BROWSER_SDK_LOADER=4]="BROWSER_SDK_LOADER",t[t.LIVE_METRICS=16]="LIVE_METRICS",t[t.NATIVE_METRICS=8192]="NATIVE_METRICS"})(ivi||(jr.StatsbeatFeature=ivi={}));var ovi;(function(t){t[t.NONE=0]="NONE",t[t.AZURE_CORE_TRACING=1]="AZURE_CORE_TRACING",t[t.MONGODB=2]="MONGODB",t[t.MYSQL=4]="MYSQL",t[t.REDIS=8]="REDIS",t[t.POSTGRES=16]="POSTGRES",t[t.BUNYAN=32]="BUNYAN",t[t.WINSTON=64]="WINSTON",t[t.CONSOLE=128]="CONSOLE"})(ovi||(jr.StatsbeatInstrumentation=ovi={}));var svi;(function(t){t[t.Feature=0]="Feature",t[t.Instrumentation=1]="Instrumentation"})(svi||(jr.StatsbeatFeatureType=svi={}));var avi;(function(t){t[t.Breeze=0]="Breeze",t[t.Quickpulse=1]="Quickpulse"})(avi||(jr.StatsbeatNetworkCategory=avi={}));var cvi;(function(t){t.SESSION="ai_session",t.USER="ai_user",t.AUTH_USER="ai_authUser"})(cvi||(jr.HttpRequestCookieNames=cvi={}));var lvi;(function(t){t.INTEGRATED_AUTO="i",t.MANUAL="m"})(lvi||(jr.AttachTypePrefix=lvi={}));jr.AzNamespace="az.namespace";jr.MicrosoftEventHub="Microsoft.EventHub";jr.MessageBusDestination="message_bus.destination";jr.ENQUEUED_TIME="enqueuedTime";jr.TIME_SINCE_ENQUEUED="timeSinceEnqueued";jr.WEB_INSTRUMENTATION_DEFAULT_SOURCE="https://js.monitor.azure.com/scripts/b/ai";jr.WEB_INSTRUMENTATION_DEPRECATED_SOURCE="https://az416426.vo.msecnd.net/scripts/b/ai"});var Eyr=I((yyr,uvi)=>{"use strict";p();var T_a=yyr&&yyr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),$ht=require("url"),I_a=ME(),gyr=ay(),VT=S0e(),x_a=myr(),fG=Qee(),w_a=XAr(),Ayr=Hht(),R_a=Kl(),Vht=md(),k_a=(function(t){T_a(e,t);function e(r,n){var o=t.call(this)||this;return r&&(o.method=r.method,o.url=o._getAbsoluteUrl(r),o.startTime=+new Date,o.socketRemoteAddress=r.socket&&r.socket.remoteAddress,o.parseHeaders(r,n),r.connection&&(o.connectionRemoteAddress=r.connection.remoteAddress,o.legacySocketRemoteAddress=r.connection.socket&&r.connection.socket.remoteAddress)),o}return a(e,"HttpRequestParser"),e.prototype.onError=function(r,n){this._setStatus(void 0,r),n&&(this.duration=n)},e.prototype.onResponse=function(r,n){this._setStatus(r.statusCode,void 0),n&&(this.duration=n)},e.prototype.getRequestTelemetry=function(r){var n=this.method;try{n+=" "+new $ht.URL(this.url).pathname}catch{}var o={id:this.requestId,name:n,url:this.url,source:this.sourceCorrelationId,duration:this.duration,resultCode:this.statusCode?this.statusCode.toString():null,success:this._isSuccess(),properties:this.properties};if(r&&r.time?o.time=r.time:this.startTime&&(o.time=new Date(this.startTime)),r){for(var s in r)o[s]||(o[s]=r[s]);if(r.properties)for(var s in r.properties)o.properties[s]=r.properties[s]}return o},e.prototype.getRequestTags=function(r){var n={};for(var o in r)n[o]=r[o];return n[e.keys.locationIp]=r[e.keys.locationIp]||this._getIp(),n[e.keys.sessionId]=r[e.keys.sessionId]||this._getId(Vht.HttpRequestCookieNames.SESSION),n[e.keys.userId]=r[e.keys.userId]||this._getId(Vht.HttpRequestCookieNames.USER),n[e.keys.userAuthUserId]=r[e.keys.userAuthUserId]||this._getId(Vht.HttpRequestCookieNames.AUTH_USER),n[e.keys.operationName]=this.getOperationName(r),n[e.keys.operationParentId]=this.getOperationParentId(r),n[e.keys.operationId]=this.getOperationId(r),n},e.prototype.getOperationId=function(r){return r[e.keys.operationId]||this.operationId},e.prototype.getOperationParentId=function(r){return r[e.keys.operationParentId]||this.parentId||this.getOperationId(r)},e.prototype.getOperationName=function(r){if(r[e.keys.operationName])return r[e.keys.operationName];var n="";try{n=new $ht.URL(this.url).pathname}catch{}var o=this.method;return n&&(o+=" "+n),o},e.prototype.getRequestId=function(){return this.requestId},e.prototype.getCorrelationContextHeader=function(){return this.correlationContextHeader},e.prototype.getTraceparent=function(){return this.traceparent},e.prototype.getTracestate=function(){return this.tracestate},e.prototype.getLegacyRootId=function(){return this.legacyRootId},e.prototype._getAbsoluteUrl=function(r){if(!r.headers)return r.url;var n=r.connection?r.connection.encrypted:null,o=n||r.headers["x-forwarded-proto"]=="https"?"https":"http",s=o+"://"+r.headers.host+"/",c="",l="";try{var u=new $ht.URL(r.url,s);c=u.pathname,l=u.search}catch{}var d=$ht.format({protocol:o,host:r.headers.host,pathname:c,search:l});return d},e.prototype._getIp=function(){var r=/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/,n=a(function(s){var c=r.exec(s);if(c)return c[0]},"check"),o=n(this.rawHeaders["x-forwarded-for"])||n(this.rawHeaders["x-client-ip"])||n(this.rawHeaders["x-real-ip"])||n(this.connectionRemoteAddress)||n(this.socketRemoteAddress)||n(this.legacySocketRemoteAddress);return!o&&this.connectionRemoteAddress&&this.connectionRemoteAddress.substr&&this.connectionRemoteAddress.substr(0,2)==="::"&&(o="127.0.0.1"),o},e.prototype._getId=function(r){var n=this.rawHeaders&&this.rawHeaders.cookie&&typeof this.rawHeaders.cookie=="string"&&this.rawHeaders.cookie||"";if(r===Vht.HttpRequestCookieNames.AUTH_USER)try{n=decodeURI(n)}catch(s){n="",R_a.warn("Could not decode the auth cookie with error: ",gyr.dumpObj(s))}var o=e.parseId(gyr.getCookie(r,n));return o},e.prototype.setBackCompatFromThisTraceContext=function(){this.operationId=this.traceparent.traceId,this.traceparent.legacyRootId&&(this.legacyRootId=this.traceparent.legacyRootId),this.parentId=this.traceparent.parentId,this.traceparent.updateSpanId(),this.requestId=this.traceparent.getBackCompatRequestId()},e.prototype.parseHeaders=function(r,n){if(this.rawHeaders=r.headers||r.rawHeaders,this.userAgent=r.headers&&r.headers["user-agent"],this.sourceCorrelationId=gyr.getCorrelationContextTarget(r,VT.requestContextSourceKey),r.headers){var o=r.headers[VT.traceStateHeader]?r.headers[VT.traceStateHeader].toString():null,s=r.headers[VT.traceparentHeader]?r.headers[VT.traceparentHeader].toString():null,c=r.headers[VT.requestIdHeader]?r.headers[VT.requestIdHeader].toString():null,l=r.headers[VT.parentIdHeader]?r.headers[VT.parentIdHeader].toString():null,u=r.headers[VT.rootIdHeader]?r.headers[VT.rootIdHeader].toString():null;this.correlationContextHeader=r.headers[VT.correlationContextHeader]?r.headers[VT.correlationContextHeader].toString():null,fG.w3cEnabled&&(s||o)?(this.traceparent=new Ayr(s?s.toString():null),this.tracestate=s&&o&&new w_a(o?o.toString():null),this.setBackCompatFromThisTraceContext()):c?fG.w3cEnabled?(this.traceparent=new Ayr(null,c),this.setBackCompatFromThisTraceContext()):(this.parentId=c,this.requestId=fG.generateRequestId(this.parentId),this.operationId=fG.getRootId(this.requestId)):fG.w3cEnabled?(this.traceparent=new Ayr,this.traceparent.parentId=l,this.traceparent.legacyRootId=u||l,this.setBackCompatFromThisTraceContext()):(this.parentId=l,this.requestId=fG.generateRequestId(u||this.parentId),this.correlationContextHeader=null,this.operationId=fG.getRootId(this.requestId)),n&&(this.requestId=n,this.operationId=fG.getRootId(this.requestId))}},e.parseId=function(r){var n=r.split("|");return n.length>0?n[0]:""},e.keys=new I_a.ContextTagKeys,e})(x_a);uvi.exports=k_a});var xvi=I((yo,Ivi)=>{p();yo=Ivi.exports=Ma;var dl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?dl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):dl=a(function(){},"debug");yo.SEMVER_SPEC_VERSION="2.0.0";var cOe=256,Wht=Number.MAX_SAFE_INTEGER||9007199254740991,_yr=16,P_a=cOe-6,lOe=yo.re=[],Pu=yo.safeRe=[],rr=yo.src=[],ma=0,Tyr="[a-zA-Z0-9-]",vyr=[["\\s",1],["\\d",cOe],[Tyr,P_a]];function Xht(t){for(var e=0;e)?=?)";var zht=ma++;rr[zht]=rr[x0e]+"|x|X|\\*";var Yht=ma++;rr[Yht]=rr[I0e]+"|x|X|\\*";var jee=ma++;rr[jee]="[v=\\s]*("+rr[Yht]+")(?:\\.("+rr[Yht]+")(?:\\.("+rr[Yht]+")(?:"+rr[xyr]+")?"+rr[dOe]+"?)?)?";var R0e=ma++;rr[R0e]="[v=\\s]*("+rr[zht]+")(?:\\.("+rr[zht]+")(?:\\.("+rr[zht]+")(?:"+rr[wyr]+")?"+rr[dOe]+"?)?)?";var mvi=ma++;rr[mvi]="^"+rr[D0e]+"\\s*"+rr[jee]+"$";var gvi=ma++;rr[gvi]="^"+rr[D0e]+"\\s*"+rr[R0e]+"$";var Avi=ma++;rr[Avi]="(?:^|[^\\d])(\\d{1,"+_yr+"})(?:\\.(\\d{1,"+_yr+"}))?(?:\\.(\\d{1,"+_yr+"}))?(?:$|[^\\d])";var emt=ma++;rr[emt]="(?:~>?)";var k0e=ma++;rr[k0e]="(\\s*)"+rr[emt]+"\\s+";lOe[k0e]=new RegExp(rr[k0e],"g");Pu[k0e]=new RegExp(Xht(rr[k0e]),"g");var D_a="$1~",yvi=ma++;rr[yvi]="^"+rr[emt]+rr[jee]+"$";var Evi=ma++;rr[Evi]="^"+rr[emt]+rr[R0e]+"$";var tmt=ma++;rr[tmt]="(?:\\^)";var P0e=ma++;rr[P0e]="(\\s*)"+rr[tmt]+"\\s+";lOe[P0e]=new RegExp(rr[P0e],"g");Pu[P0e]=new RegExp(Xht(rr[P0e]),"g");var N_a="$1^",_vi=ma++;rr[_vi]="^"+rr[tmt]+rr[jee]+"$";var vvi=ma++;rr[vvi]="^"+rr[tmt]+rr[R0e]+"$";var Dyr=ma++;rr[Dyr]="^"+rr[D0e]+"\\s*("+kyr+")$|^$";var Nyr=ma++;rr[Nyr]="^"+rr[D0e]+"\\s*("+hvi+")$|^$";var Hee=ma++;rr[Hee]="(\\s*)"+rr[D0e]+"\\s*("+kyr+"|"+rr[jee]+")";lOe[Hee]=new RegExp(rr[Hee],"g");Pu[Hee]=new RegExp(Xht(rr[Hee]),"g");var M_a="$1$2$3",Cvi=ma++;rr[Cvi]="^\\s*("+rr[jee]+")\\s+-\\s+("+rr[jee]+")\\s*$";var bvi=ma++;rr[bvi]="^\\s*("+rr[R0e]+")\\s+-\\s+("+rr[R0e]+")\\s*$";var Svi=ma++;rr[Svi]="(<|>)?=?\\s*\\*";for(w4=0;w4cOe)return null;var r=e.loose?Pu[Pyr]:Pu[Ryr];if(!r.test(t))return null;try{return new Ma(t,e)}catch{return null}}a(Gee,"parse");yo.valid=O_a;function O_a(t,e){var r=Gee(t,e);return r?r.version:null}a(O_a,"valid");yo.clean=L_a;function L_a(t,e){var r=Gee(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(L_a,"clean");yo.SemVer=Ma;function Ma(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Ma){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>cOe)throw new TypeError("version is longer than "+cOe+" characters");if(!(this instanceof Ma))return new Ma(t,e);dl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Pu[Pyr]:Pu[Ryr]);if(!r)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Wht||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Wht||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Wht||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(n){if(/^[0-9]+$/.test(n)){var o=+n;if(o>=0&&o=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this};yo.inc=B_a;function B_a(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Ma(t,r).inc(e,n).version}catch{return null}}a(B_a,"inc");yo.diff=F_a;function F_a(t,e){if(Myr(t,e))return null;var r=Gee(t),n=Gee(e),o="";if(r.prerelease.length||n.prerelease.length){o="pre";var s="prerelease"}for(var c in r)if((c==="major"||c==="minor"||c==="patch")&&r[c]!==n[c])return o+c;return s}a(F_a,"diff");yo.compareIdentifiers=w0e;var dvi=/^[0-9]+$/;function w0e(t,e){var r=dvi.test(t),n=dvi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(uOe,"gt");yo.lt=Kht;function Kht(t,e,r){return B8(t,e,r)<0}a(Kht,"lt");yo.eq=Myr;function Myr(t,e,r){return B8(t,e,r)===0}a(Myr,"eq");yo.neq=Tvi;function Tvi(t,e,r){return B8(t,e,r)!==0}a(Tvi,"neq");yo.gte=Oyr;function Oyr(t,e,r){return B8(t,e,r)>=0}a(Oyr,"gte");yo.lte=Lyr;function Lyr(t,e,r){return B8(t,e,r)<=0}a(Lyr,"lte");yo.cmp=Jht;function Jht(t,e,r,n){switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return Myr(t,r,n);case"!=":return Tvi(t,r,n);case">":return uOe(t,r,n);case">=":return Oyr(t,r,n);case"<":return Kht(t,r,n);case"<=":return Lyr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(Jht,"cmp");yo.Comparator=mR;function mR(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof mR){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof mR))return new mR(t,e);t=t.trim().split(/\s+/).join(" "),dl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===fOe?this.value="":this.value=this.operator+this.semver.version,dl("comp",this)}a(mR,"Comparator");var fOe={};mR.prototype.parse=function(t){var e=this.options.loose?Pu[Dyr]:Pu[Nyr],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=r[1],this.operator==="="&&(this.operator=""),r[2]?this.semver=new Ma(r[2],this.options.loose):this.semver=fOe};mR.prototype.toString=function(){return this.value};mR.prototype.test=function(t){return dl("Comparator.test",t,this.options.loose),this.semver===fOe?!0:(typeof t=="string"&&(t=new Ma(t,this.options)),Jht(t,this.operator,this.semver,this.options))};mR.prototype.intersects=function(t,e){if(!(t instanceof mR))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Rf(t.value,e),Zht(this.value,r,e);if(t.operator==="")return r=new Rf(this.value,e),Zht(t.semver,r,e);var n=(this.operator===">="||this.operator===">")&&(t.operator===">="||t.operator===">"),o=(this.operator==="<="||this.operator==="<")&&(t.operator==="<="||t.operator==="<"),s=this.semver.version===t.semver.version,c=(this.operator===">="||this.operator==="<=")&&(t.operator===">="||t.operator==="<="),l=Jht(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=Jht(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};yo.Range=Rf;function Rf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Rf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Rf(t.raw,e);if(t instanceof mR)return new Rf(t.value,e);if(!(this instanceof Rf))return new Rf(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}a(Rf,"Range");Rf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Rf.prototype.toString=function(){return this.range};Rf.prototype.parseRange=function(t){var e=this.options.loose,r=e?Pu[bvi]:Pu[Cvi];t=t.replace(r,rva),dl("hyphen replace",t),t=t.replace(Pu[Hee],M_a),dl("comparator trim",t,Pu[Hee]),t=t.replace(Pu[k0e],D_a),t=t.replace(Pu[P0e],N_a);var n=e?Pu[Dyr]:Pu[Nyr],o=t.split(" ").map(function(s){return z_a(s,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter(function(s){return!!s.match(n)})),o=o.map(function(s){return new mR(s,this.options)},this),o};Rf.prototype.intersects=function(t,e){if(!(t instanceof Rf))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(n){return t.set.some(function(o){return o.every(function(s){return n.intersects(s,e)})})})})};yo.toComparators=W_a;function W_a(t,e){return new Rf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(W_a,"toComparators");function z_a(t,e){return dl("comp",t,e),t=J_a(t,e),dl("caret",t),t=Y_a(t,e),dl("tildes",t),t=X_a(t,e),dl("xrange",t),t=tva(t,e),dl("stars",t),t}a(z_a,"parseComparator");function bv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(bv,"isX");function Y_a(t,e){return t.trim().split(/\s+/).map(function(r){return K_a(r,e)}).join(" ")}a(Y_a,"replaceTildes");function K_a(t,e){var r=e.loose?Pu[Evi]:Pu[yvi];return t.replace(r,function(n,o,s,c,l){dl("tilde",t,n,o,s,c,l);var u;return bv(o)?u="":bv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":bv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(dl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",dl("tilde return",u),u})}a(K_a,"replaceTilde");function J_a(t,e){return t.trim().split(/\s+/).map(function(r){return Z_a(r,e)}).join(" ")}a(J_a,"replaceCarets");function Z_a(t,e){dl("caret",t,e);var r=e.loose?Pu[vvi]:Pu[_vi];return t.replace(r,function(n,o,s,c,l){dl("caret",t,n,o,s,c,l);var u;return bv(o)?u="":bv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":bv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(dl("replaceCaret pr",l),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+"-"+l+" <"+(+o+1)+".0.0"):(dl("no pr"),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+" <"+(+o+1)+".0.0"),dl("caret return",u),u})}a(Z_a,"replaceCaret");function X_a(t,e){return dl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return eva(r,e)}).join(" ")}a(X_a,"replaceXRanges");function eva(t,e){t=t.trim();var r=e.loose?Pu[gvi]:Pu[mvi];return t.replace(r,function(n,o,s,c,l,u){dl("xRange",t,n,o,s,c,l,u);var d=bv(s),f=d||bv(c),h=f||bv(l),m=h;return o==="="&&m&&(o=""),d?o===">"||o==="<"?n="<0.0.0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),n=o+s+"."+c+"."+l):f?n=">="+s+".0.0 <"+(+s+1)+".0.0":h&&(n=">="+s+"."+c+".0 <"+s+"."+(+c+1)+".0"),dl("xRange return",n),n})}a(eva,"replaceXRange");function tva(t,e){return dl("replaceStars",t,e),t.trim().replace(Pu[Svi],"")}a(tva,"replaceStars");function rva(t,e,r,n,o,s,c,l,u,d,f,h,m){return bv(r)?e="":bv(n)?e=">="+r+".0.0":bv(o)?e=">="+r+"."+n+".0":e=">="+e,bv(u)?l="":bv(d)?l="<"+(+u+1)+".0.0":bv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(rva,"hyphenReplace");Rf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Ma(t,this.options));for(var e=0;e0){var o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}a(nva,"testSet");yo.satisfies=Zht;function Zht(t,e,r){try{e=new Rf(e,r)}catch{return!1}return e.test(t)}a(Zht,"satisfies");yo.maxSatisfying=iva;function iva(t,e,r){var n=null,o=null;try{var s=new Rf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Ma(n,r))}),n}a(iva,"maxSatisfying");yo.minSatisfying=ova;function ova(t,e,r){var n=null,o=null;try{var s=new Rf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Ma(n,r))}),n}a(ova,"minSatisfying");yo.minVersion=sva;function sva(t,e){t=new Rf(t,e);var r=new Ma("0.0.0");if(t.test(r)||(r=new Ma("0.0.0-0"),t.test(r)))return r;r=null;for(var n=0;n":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!r||uOe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(sva,"minVersion");yo.validRange=ava;function ava(t,e){try{return new Rf(t,e).range||"*"}catch{return null}}a(ava,"validRange");yo.ltr=cva;function cva(t,e,r){return Byr(t,e,"<",r)}a(cva,"ltr");yo.gtr=lva;function lva(t,e,r){return Byr(t,e,">",r)}a(lva,"gtr");yo.outside=Byr;function Byr(t,e,r,n){t=new Ma(t,n),e=new Rf(e,n);var o,s,c,l,u;switch(r){case">":o=uOe,s=Lyr,c=Kht,l=">",u=">=";break;case"<":o=Kht,s=Oyr,c=uOe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Zht(t,e,n))return!1;for(var d=0;d=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0}a(Byr,"outside");yo.prerelease=uva;function uva(t,e){var r=Gee(t,e);return r&&r.prerelease.length?r.prerelease:null}a(uva,"prerelease");yo.intersects=dva;function dva(t,e,r){return t=new Rf(t,r),e=new Rf(e,r),t.intersects(e)}a(dva,"intersects");yo.coerce=fva;function fva(t){if(t instanceof Ma)return t;if(typeof t!="string")return null;var e=t.match(Pu[Avi]);return e==null?null:Gee(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(fva,"coerce")});var imt=I((Lmp,Pvi)=>{"use strict";p();var Rvi=d0e(),N0e=Rvi.wrap,rmt=Rvi.unwrap,F8="wrap@before";function nmt(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(nmt,"defineProperty");function pva(t,e){for(var r=e.length,n=0;n0&&pva(t,o)}a(hva,"_findAndProcess");function wvi(t,e){if(t){var r=t;if(typeof t=="function")r=e(t);else if(Array.isArray(t)){r=[];for(var n=0;n{"use strict";p();var Pc=require("util"),U8=require("assert"),mva=imt(),gd=require("async_hooks"),pOe="cls@contexts",hOe="error@context",kf=process.env.DEBUG_CLS_HOOKED,kc=-1;Mvi.exports={getNamespace:Dvi,createNamespace:gva,destroyNamespace:Nvi,reset:Ava,ERROR_SYMBOL:hOe};function gR(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}a(gR,"Namespace");gR.prototype.set=a(function(e,r){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");if(this.active[e]=r,kf){let n=" ".repeat(this._indent<0?0:this._indent);zd(n+"CONTEXT-SET KEY:"+e+"="+r+" in ns:"+this.name+" currentUid:"+kc+" active:"+Pc.inspect(this.active,{showHidden:!0,depth:2,colors:!0}))}return r},"set");gR.prototype.get=a(function(e){if(!this.active){if(kf){let r=gd.currentId(),n=gd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);zd(`${o}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${kc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length}`)}return}if(kf){let r=gd.executionAsyncId(),n=gd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);zd(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+kc+" active:"+Pc.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),zd(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${kc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} active:${Pc.inspect(this.active)}`)}return this.active[e]},"get");gR.prototype.createContext=a(function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=kc,kf){let r=gd.executionAsyncId(),n=gd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);zd(`${o}CONTEXT-CREATED Context: (${this.name}) currentUid:${kc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} context:${Pc.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},"createContext");gR.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{if(kf){let n=gd.triggerAsyncId(),o=gd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);zd(`${s}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${kc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} context:${Pc.inspect(r)}`)}return e(r),r}catch(n){throw n&&(n[hOe]=r),n}finally{if(kf){let n=gd.triggerAsyncId(),o=gd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);zd(`${s}CONTEXT-RUN END: (${this.name}) currentUid:${kc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} ${Pc.inspect(r)}`)}this.exit(r)}},"run");gR.prototype.runAndReturn=a(function(e){let r;return this.run(function(n){r=e(n)}),r},"runAndReturn");gR.prototype.runPromise=a(function(e){let r=this.createContext();this.enter(r);let n=e(r);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return kf&&zd("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+kc+" len:"+this._set.length+" "+Pc.inspect(r)),n.then(o=>(kf&&zd("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+kc+" len:"+this._set.length+" "+Pc.inspect(r)),this.exit(r),o)).catch(o=>{throw o[hOe]=r,kf&&zd("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+kc+" len:"+this._set.length+" "+Pc.inspect(r)),this.exit(r),o})},"runPromise");gR.prototype.bind=a(function(e,r){r||(this.active?r=this.active:r=this.createContext());let n=this;return a(function(){n.enter(r);try{return e.apply(this,arguments)}catch(s){throw s&&(s[hOe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");gR.prototype.enter=a(function(e){if(U8.ok(e,"context must be provided for entering"),kf){let r=gd.executionAsyncId(),n=gd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);zd(`${o}CONTEXT-ENTER: (${this.name}) currentUid:${kc} triggerId:${n} asyncHooksCurrentId:${r} len:${this._set.length} ${Pc.inspect(e)}`)}this._set.push(this.active),this.active=e},"enter");gR.prototype.exit=a(function(e){if(U8.ok(e,"context must be provided for exiting"),kf){let n=gd.executionAsyncId(),o=gd.triggerAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);zd(`${s}CONTEXT-EXIT: (${this.name}) currentUid:${kc} triggerId:${o} asyncHooksCurrentId:${n} len:${this._set.length} ${Pc.inspect(e)}`)}if(this.active===e){U8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(kf&&zd("??ERROR?? context exiting but not entered - ignoring: "+Pc.inspect(e)),U8.ok(r>=0,`context not currently entered; can't exit. -`+Pc.inspect(this)+` -`+Pc.inspect(e))):(U8.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");gR.prototype.bindEmitter=a(function(e){U8.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[pOe]||(c[pOe]=Object.create(null)),c[pOe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[pOe]))return c;let l=c,u=c[pOe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),mva(e,o,s)},"bindEmitter");gR.prototype.fromException=a(function(e){return e[hOe]},"fromException");function Dvi(t){return process.namespaces[t]}a(Dvi,"getNamespace");function gva(t){U8.ok(t,"namespace must be given a name."),kf&&zd(`NS-CREATING NAMESPACE (${t})`);let e=new gR(t);return e.id=kc,gd.createHook({init(n,o,s,c){if(kc=gd.executionAsyncId(),e.active){if(e._contexts.set(n,e.active),kf){let l=" ".repeat(e._indent<0?0:e._indent);zd(`${l}INIT [${o}] (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(kc===0){let l=gd.triggerAsyncId(),u=e._contexts.get(l);if(u){if(e._contexts.set(n,u),kf){let d=" ".repeat(e._indent<0?0:e._indent);zd(`${d}INIT USING CONTEXT FROM TRIGGERID [${o}] (${t}) asyncId:${n} currentUid:${kc} triggerId:${l} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(kf){let d=" ".repeat(e._indent<0?0:e._indent);zd(`${d}INIT MISSING CONTEXT [${o}] (${t}) asyncId:${n} currentUid:${kc} triggerId:${l} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}if(kf&&o==="PROMISE"){zd(Pc.inspect(c,{showHidden:!0}));let l=c.parentId,u=" ".repeat(e._indent<0?0:e._indent);zd(`${u}INIT RESOURCE-PROMISE [${o}] (${t}) parentId:${l} asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}},before(n){kc=gd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(kc),o){if(kf){let s=gd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);zd(`${c}BEFORE (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Pc.inspect(o)}`),e._indent+=2}e.enter(o)}else if(kf){let s=gd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);zd(`${c}BEFORE MISSING CONTEXT (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${Pc.inspect(e._contexts,{showHidden:!0,depth:2,colors:!0})}`),e._indent+=2}},after(n){kc=gd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(kc),o){if(kf){let s=gd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);zd(`${c}AFTER (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Pc.inspect(o)}`)}e.exit(o)}else if(kf){let s=gd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);zd(`${c}AFTER MISSING CONTEXT (${t}) asyncId:${n} currentUid:${kc} triggerId:${s} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Pc.inspect(o)}`)}},destroy(n){if(kc=gd.executionAsyncId(),kf){let o=gd.triggerAsyncId(),s=" ".repeat(e._indent<0?0:e._indent);zd(`${s}DESTROY (${t}) currentUid:${kc} asyncId:${n} triggerId:${o} active:${Pc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Pc.inspect(e._contexts.get(kc))}`)}e._contexts.delete(n)}}).enable(),process.namespaces[t]=e,e}a(gva,"createNamespace");function Nvi(t){let e=Dvi(t);U8.ok(e,`can't delete nonexistent namespace! "`+t+'"'),U8.ok(e.id,"don't assign to process.namespaces directly! "+Pc.inspect(e)),process.namespaces[t]=null}a(Nvi,"destroyNamespace");function Ava(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){Nvi(t)}),process.namespaces=Object.create(null)}a(Ava,"reset");process.namespaces={};function zd(...t){kf&&process._rawDebug(`${Pc.format(...t)}`)}a(zd,"debug2")});var Bvi=I((jmp,Lvi)=>{"use strict";p();function yva(){}a(yva,"NextTickWrap");Lvi.exports=a(function(){let e=this._hooks,r=this._state,n=process.nextTick;process.nextTick=function(){if(!r.enabled)return n.apply(process,arguments);let o=new Array(arguments.length);for(let u=0;u0&&process.once("uncaughtException",function(){e.post.call(c,l,!0),e.destroy.call(null,l)})}e.post.call(c,l,!1),e.destroy.call(null,l)},n.apply(process,o)}},"patch")});var Uvi=I(($mp,Fvi)=>{"use strict";p();function Eva(){}a(Eva,"PromiseWrap");Fvi.exports=a(function(){let e=this._hooks,r=this._state,n=global.Promise,o=n.prototype.then;n.prototype.then=u;function s(d,f,h,m){return typeof d!="function"?m?c(h):l(h):a(function(){e.pre.call(f,h);try{return d.apply(this,arguments)}finally{e.post.call(f,h,!1),e.destroy.call(null,h)}},"wrappedHandler")}a(s,"makeWrappedHandler");function c(d){return a(function(h){return e.destroy.call(null,d),h},"unhandledResolutionHandler")}a(c,"makeUnhandledResolutionHandler");function l(d){return a(function(h){throw e.destroy.call(null,d),h},"unhandledRejectedHandler")}a(l,"makeUnhandledRejectionHandler");function u(d,f){if(!r.enabled)return o.call(this,d,f);let h=new Eva,m=--r.counter;return e.init.call(h,m,0,null,null),o.call(this,s(d,h,m,!0),s(f,h,m,!1))}a(u,"wrappedThen")},"patchPromise")});var qvi=I((zmp,Qvi)=>{"use strict";p();var WT=require("timers");function _va(){}a(_va,"TimeoutWrap");function vva(){}a(vva,"IntervalWrap");function Cva(){}a(Cva,"ImmediateWrap");var bva=new Map,Sva=new Map,Tva=new Map,Fyr=null,Uyr=!1;Qvi.exports=a(function(){Qyr(this._hooks,this._state,"setTimeout","clearTimeout",_va,bva,!0),Qyr(this._hooks,this._state,"setInterval","clearInterval",vva,Sva,!1),Qyr(this._hooks,this._state,"setImmediate","clearImmediate",Cva,Tva,!0),global.setTimeout=WT.setTimeout,global.setInterval=WT.setInterval,global.setImmediate=WT.setImmediate,global.clearTimeout=WT.clearTimeout,global.clearInterval=WT.clearInterval,global.clearImmediate=WT.clearImmediate},"patch");function Qyr(t,e,r,n,o,s,c){let l=WT[r],u=WT[n];WT[r]=function(){if(!e.enabled)return l.apply(WT,arguments);let d=new Array(arguments.length);for(let A=0;A0&&process.once("uncaughtException",function(){t.post.call(h,m,!0),s.delete(g),t.destroy.call(null,m)})}t.post.call(h,m,!1),Fyr=null,(c||Uyr)&&(Uyr=!1,s.delete(g),t.destroy.call(null,m))},g=l.apply(WT,d),s.set(g,m),g},WT[n]=function(d){if(Fyr===d&&d!==null)Uyr=!0;else if(s.has(d)){let f=s.get(d);s.delete(d),t.destroy.call(null,f)}u.apply(WT,arguments)}}a(Qyr,"patchTimer")});var qyr=I((Jmp,Iva)=>{Iva.exports={name:"async-hook-jl",description:"Inspect the life of handle objects in node",version:"1.7.6",author:"Andreas Madsen ",main:"./index.js",scripts:{test:"node ./test/runner.js && eslint ."},repository:{type:"git",url:"git://github.com/jeff-lewis/async-hook-jl.git"},keywords:["async","async hooks","inspect","async wrap"],license:"MIT",dependencies:{"stack-chain":"^1.3.7"},devDependencies:{async:"1.5.x","cli-color":"1.1.x",eslint:"^3.4.0",endpoint:"0.4.x"},engines:{node:"^4.7 || >=6.9 || >=7.3"}}});var Gvi=I((Zmp,Hvi)=>{"use strict";p();var gOe=process.binding("async_wrap"),xva=gOe.Providers.TIMERWRAP,jvi={nextTick:Bvi(),promise:Uvi(),timers:qvi()},mOe=new Set;function wva(){this.enabled=!1,this.counter=0}a(wva,"State");function jyr(){let t=this.initFns=[],e=this.preFns=[],r=this.postFns=[],n=this.destroyFns=[];this.init=function(o,s,c,l){if(s===xva){mOe.add(o);return}for(let u of t)u(o,this,s,c,l)},this.pre=function(o){if(!mOe.has(o))for(let s of e)s(o,this)},this.post=function(o,s){if(!mOe.has(o))for(let c of r)c(o,this,s)},this.destroy=function(o){if(mOe.has(o)){mOe.delete(o);return}for(let s of n)s(o)}}a(jyr,"Hooks");jyr.prototype.add=function(t){t.init&&this.initFns.push(t.init),t.pre&&this.preFns.push(t.pre),t.post&&this.postFns.push(t.post),t.destroy&&this.destroyFns.push(t.destroy)};function omt(t,e){let r=t.indexOf(e);r!==-1&&t.splice(r,1)}a(omt,"removeElement");jyr.prototype.remove=function(t){t.init&&omt(this.initFns,t.init),t.pre&&omt(this.preFns,t.pre),t.post&&omt(this.postFns,t.post),t.destroy&&omt(this.destroyFns,t.destroy)};function AOe(){this._state=new wva,this._hooks=new jyr,this.version=qyr().version,this.providers=gOe.Providers;for(let t of Object.keys(jvi))jvi[t].call(this);process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")&&console.warn("warning: you are using async-hook-jl which is unstable."),gOe.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}a(AOe,"AsyncHook");Hvi.exports=AOe;AOe.prototype.addHooks=function(t){this._hooks.add(t)};AOe.prototype.removeHooks=function(t){this._hooks.remove(t)};AOe.prototype.enable=function(){this._state.enabled=!0,gOe.enable()};AOe.prototype.disable=function(){this._state.enabled=!1,gOe.disable()}});var Hyr=I((t0p,Rva)=>{Rva.exports={name:"stack-chain",description:"API for combining call site modifiers",version:"1.3.7",author:"Andreas Madsen ",scripts:{test:"tap ./test/simple"},repository:{type:"git",url:"git://github.com/AndreasMadsen/stack-chain.git"},keywords:["stack","chain","trace","call site","concat","format"],devDependencies:{tap:"2.x.x","uglify-js":"2.5.x"},license:"MIT"}});var Vvi=I((r0p,$vi)=>{p();function kva(t){try{return Error.prototype.toString.call(t)}catch(e){try{return""}catch{return""}}}a(kva,"FormatErrorString");$vi.exports=a(function(e,r){var n=[];n.push(kva(e));for(var o=0;o"}catch{c=""}}n.push(" at "+c)}return n.join(` -`)},"FormatStackTrace")});var Kvi=I((o0p,Yvi)=>{p();var smt=Vvi();function zvi(){this.extend=new yOe,this.filter=new yOe,this.format=new EOe,this.version=Hyr().version}a(zvi,"stackChain");var $yr=!1;zvi.prototype.callSite=a(function t(e){e||(e={}),$yr=!0;var r={};Error.captureStackTrace(r,t);var n=r.stack;return $yr=!1,n=n.slice(e.slice||0),e.extend&&(n=this.extend._modify(r,n)),e.filter&&(n=this.filter._modify(r,n)),n},"collectCallSites");var pG=new zvi;function yOe(){this._modifiers=[]}a(yOe,"TraceModifier");yOe.prototype._modify=function(t,e){for(var r=0,n=this._modifiers.length;r{p();if(global._stackChain)if(global._stackChain.version===Hyr().version)Vyr.exports=global._stackChain;else throw new Error("Conflicting version of stack-chain found");else Vyr.exports=global._stackChain=Kvi()});var Jvi=I((u0p,zyr)=>{"use strict";p();var Dva=Gvi();if(global._asyncHook)if(global._asyncHook.version===qyr().version)zyr.exports=global._asyncHook;else throw new Error("Conflicting version of async-hook-jl found");else Wyr().filter.attach(function(e,r){return r.filter(function(n){let o=n.getFileName();return!(o&&o.slice(0,__dirname.length)===__dirname)})}),zyr.exports=global._asyncHook=new Dva});var nCi=I((f0p,rCi)=>{"use strict";p();var hh=require("util"),Q8=require("assert"),Nva=imt(),M0e=Jvi(),_Oe="cls@contexts",vOe="error@context",Xvi=[];for(let t in M0e.providers)Xvi[M0e.providers[t]]=t;var bp=process.env.DEBUG_CLS_HOOKED,Em=-1;rCi.exports={getNamespace:eCi,createNamespace:Mva,destroyNamespace:tCi,reset:Ova,ERROR_SYMBOL:vOe};function AR(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map}a(AR,"Namespace");AR.prototype.set=a(function(e,r){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return bp&&ph(" SETTING KEY:"+e+"="+r+" in ns:"+this.name+" uid:"+Em+" active:"+hh.inspect(this.active,!0)),this.active[e]=r,r},"set");AR.prototype.get=a(function(e){if(!this.active){bp&&ph(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+Em+" active:"+hh.inspect(this.active,!0));return}return bp&&ph(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+Em+" active:"+hh.inspect(this.active,!0)),this.active[e]},"get");AR.prototype.createContext=a(function(){bp&&ph(" CREATING Context: "+this.name+" uid:"+Em+" len:"+this._set.length+" active:"+hh.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=Em,bp&&ph(" CREATED Context: "+this.name+" uid:"+Em+" len:"+this._set.length+" context:"+hh.inspect(e,!0,2,!0)),e},"createContext");AR.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{return bp&&ph(" BEFORE RUN: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),e(r),r}catch(n){throw n&&(n[vOe]=r),n}finally{bp&&ph(" AFTER RUN: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),this.exit(r)}},"run");AR.prototype.runAndReturn=a(function(e){var r;return this.run(function(n){r=e(n)}),r},"runAndReturn");AR.prototype.runPromise=a(function(e){let r=this.createContext();this.enter(r);let n=e(r);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return bp&&ph(" BEFORE runPromise: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),n.then(o=>(bp&&ph(" AFTER runPromise: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),this.exit(r),o)).catch(o=>{throw o[vOe]=r,bp&&ph(" AFTER runPromise: "+this.name+" uid:"+Em+" len:"+this._set.length+" "+hh.inspect(r)),this.exit(r),o})},"runPromise");AR.prototype.bind=a(function(e,r){r||(this.active?r=this.active:r=this.createContext());let n=this;return a(function(){n.enter(r);try{return e.apply(this,arguments)}catch(s){throw s&&(s[vOe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");AR.prototype.enter=a(function(e){Q8.ok(e,"context must be provided for entering"),bp&&ph(" ENTER "+this.name+" uid:"+Em+" len:"+this._set.length+" context: "+hh.inspect(e)),this._set.push(this.active),this.active=e},"enter");AR.prototype.exit=a(function(e){if(Q8.ok(e,"context must be provided for exiting"),bp&&ph(" EXIT "+this.name+" uid:"+Em+" len:"+this._set.length+" context: "+hh.inspect(e)),this.active===e){Q8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(bp&&ph("??ERROR?? context exiting but not entered - ignoring: "+hh.inspect(e)),Q8.ok(r>=0,`context not currently entered; can't exit. -`+hh.inspect(this)+` -`+hh.inspect(e))):(Q8.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");AR.prototype.bindEmitter=a(function(e){Q8.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[_Oe]||(c[_Oe]=Object.create(null)),c[_Oe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[_Oe]))return c;let l=c,u=c[_Oe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),Nva(e,o,s)},"bindEmitter");AR.prototype.fromException=a(function(e){return e[vOe]},"fromException");function eCi(t){return process.namespaces[t]}a(eCi,"getNamespace");function Mva(t){Q8.ok(t,"namespace must be given a name."),bp&&ph("CREATING NAMESPACE "+t);let e=new AR(t);return e.id=Em,M0e.addHooks({init(r,n,o,s,c){Em=r,s?(e._contexts.set(r,e._contexts.get(s)),bp&&ph("PARENTID: "+t+" uid:"+r+" parent:"+s+" provider:"+o)):e._contexts.set(Em,e.active),bp&&ph("INIT "+t+" uid:"+r+" parent:"+s+" provider:"+Xvi[o]+" active:"+hh.inspect(e.active,!0))},pre(r,n){Em=r;let o=e._contexts.get(r);o?(bp&&ph(" PRE "+t+" uid:"+r+" handle:"+amt(n)+" context:"+hh.inspect(o)),e.enter(o)):bp&&ph(" PRE MISSING CONTEXT "+t+" uid:"+r+" handle:"+amt(n))},post(r,n){Em=r;let o=e._contexts.get(r);o?(bp&&ph(" POST "+t+" uid:"+r+" handle:"+amt(n)+" context:"+hh.inspect(o)),e.exit(o)):bp&&ph(" POST MISSING CONTEXT "+t+" uid:"+r+" handle:"+amt(n))},destroy(r){Em=r,bp&&ph("DESTROY "+t+" uid:"+r+" context:"+hh.inspect(e._contexts.get(Em))+" active:"+hh.inspect(e.active,!0)),e._contexts.delete(r)}}),process.namespaces[t]=e,e}a(Mva,"createNamespace");function tCi(t){let e=eCi(t);Q8.ok(e,`can't delete nonexistent namespace! "`+t+'"'),Q8.ok(e.id,"don't assign to process.namespaces directly! "+hh.inspect(e)),process.namespaces[t]=null}a(tCi,"destroyNamespace");function Ova(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){tCi(t)}),process.namespaces=Object.create(null)}a(Ova,"reset");process.namespaces={};M0e._state&&!M0e._state.enabled&&M0e.enable();function ph(t){process.env.DEBUG&&process._rawDebug(t)}a(ph,"debug2");function amt(t){if(!t)return t;if(typeof t=="function")return t.name?t.name:(t.toString().trim().match(/^function\s*([^\s(]+)/)||[])[1];if(t.constructor&&t.constructor.name)return t.constructor.name}a(amt,"getFunctionName");if(bp){Yyr=Wyr();for(Zvi in Yyr.filter._modifiers)Yyr.filter.deattach(Zvi)}var Yyr,Zvi});var iCi=I((m0p,Kyr)=>{"use strict";p();var Lva=xvi();process&&Lva.gte(process.versions.node,"8.0.0")?Kyr.exports=Ovi():Kyr.exports=nCi()});var vCi=I((Eo,_Ci)=>{p();Eo=_Ci.exports=Oa;var fl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?fl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):fl=a(function(){},"debug");Eo.SEMVER_SPEC_VERSION="2.0.0";var COe=256,cmt=Number.MAX_SAFE_INTEGER||9007199254740991,Jyr=16,Bva=COe-6,bOe=Eo.re=[],Du=Eo.safeRe=[],nr=Eo.src=[],ga=0,rEr="[a-zA-Z0-9-]",Zyr=[["\\s",1],["\\d",COe],[rEr,Bva]];function hmt(t){for(var e=0;e)?=?)";var lmt=ga++;nr[lmt]=nr[L0e]+"|x|X|\\*";var umt=ga++;nr[umt]=nr[O0e]+"|x|X|\\*";var $ee=ga++;nr[$ee]="[v=\\s]*("+nr[umt]+")(?:\\.("+nr[umt]+")(?:\\.("+nr[umt]+")(?:"+nr[iEr]+")?"+nr[TOe]+"?)?)?";var F0e=ga++;nr[F0e]="[v=\\s]*("+nr[lmt]+")(?:\\.("+nr[lmt]+")(?:\\.("+nr[lmt]+")(?:"+nr[oEr]+")?"+nr[TOe]+"?)?)?";var lCi=ga++;nr[lCi]="^"+nr[q0e]+"\\s*"+nr[$ee]+"$";var uCi=ga++;nr[uCi]="^"+nr[q0e]+"\\s*"+nr[F0e]+"$";var dCi=ga++;nr[dCi]="(?:^|[^\\d])(\\d{1,"+Jyr+"})(?:\\.(\\d{1,"+Jyr+"}))?(?:\\.(\\d{1,"+Jyr+"}))?(?:$|[^\\d])";var mmt=ga++;nr[mmt]="(?:~>?)";var U0e=ga++;nr[U0e]="(\\s*)"+nr[mmt]+"\\s+";bOe[U0e]=new RegExp(nr[U0e],"g");Du[U0e]=new RegExp(hmt(nr[U0e]),"g");var Fva="$1~",fCi=ga++;nr[fCi]="^"+nr[mmt]+nr[$ee]+"$";var pCi=ga++;nr[pCi]="^"+nr[mmt]+nr[F0e]+"$";var gmt=ga++;nr[gmt]="(?:\\^)";var Q0e=ga++;nr[Q0e]="(\\s*)"+nr[gmt]+"\\s+";bOe[Q0e]=new RegExp(nr[Q0e],"g");Du[Q0e]=new RegExp(hmt(nr[Q0e]),"g");var Uva="$1^",hCi=ga++;nr[hCi]="^"+nr[gmt]+nr[$ee]+"$";var mCi=ga++;nr[mCi]="^"+nr[gmt]+nr[F0e]+"$";var lEr=ga++;nr[lEr]="^"+nr[q0e]+"\\s*("+aEr+")$|^$";var uEr=ga++;nr[uEr]="^"+nr[q0e]+"\\s*("+cCi+")$|^$";var Vee=ga++;nr[Vee]="(\\s*)"+nr[q0e]+"\\s*("+aEr+"|"+nr[$ee]+")";bOe[Vee]=new RegExp(nr[Vee],"g");Du[Vee]=new RegExp(hmt(nr[Vee]),"g");var Qva="$1$2$3",gCi=ga++;nr[gCi]="^\\s*("+nr[$ee]+")\\s+-\\s+("+nr[$ee]+")\\s*$";var ACi=ga++;nr[ACi]="^\\s*("+nr[F0e]+")\\s+-\\s+("+nr[F0e]+")\\s*$";var yCi=ga++;nr[yCi]="(<|>)?=?\\s*\\*";for(R4=0;R4COe)return null;var r=e.loose?Du[cEr]:Du[sEr];if(!r.test(t))return null;try{return new Oa(t,e)}catch{return null}}a(Wee,"parse");Eo.valid=qva;function qva(t,e){var r=Wee(t,e);return r?r.version:null}a(qva,"valid");Eo.clean=jva;function jva(t,e){var r=Wee(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(jva,"clean");Eo.SemVer=Oa;function Oa(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Oa){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>COe)throw new TypeError("version is longer than "+COe+" characters");if(!(this instanceof Oa))return new Oa(t,e);fl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Du[cEr]:Du[sEr]);if(!r)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>cmt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>cmt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>cmt||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(n){if(/^[0-9]+$/.test(n)){var o=+n;if(o>=0&&o=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this};Eo.inc=Hva;function Hva(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Oa(t,r).inc(e,n).version}catch{return null}}a(Hva,"inc");Eo.diff=Gva;function Gva(t,e){if(dEr(t,e))return null;var r=Wee(t),n=Wee(e),o="";if(r.prerelease.length||n.prerelease.length){o="pre";var s="prerelease"}for(var c in r)if((c==="major"||c==="minor"||c==="patch")&&r[c]!==n[c])return o+c;return s}a(Gva,"diff");Eo.compareIdentifiers=B0e;var oCi=/^[0-9]+$/;function B0e(t,e){var r=oCi.test(t),n=oCi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(SOe,"gt");Eo.lt=dmt;function dmt(t,e,r){return q8(t,e,r)<0}a(dmt,"lt");Eo.eq=dEr;function dEr(t,e,r){return q8(t,e,r)===0}a(dEr,"eq");Eo.neq=ECi;function ECi(t,e,r){return q8(t,e,r)!==0}a(ECi,"neq");Eo.gte=fEr;function fEr(t,e,r){return q8(t,e,r)>=0}a(fEr,"gte");Eo.lte=pEr;function pEr(t,e,r){return q8(t,e,r)<=0}a(pEr,"lte");Eo.cmp=fmt;function fmt(t,e,r,n){switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return dEr(t,r,n);case"!=":return ECi(t,r,n);case">":return SOe(t,r,n);case">=":return fEr(t,r,n);case"<":return dmt(t,r,n);case"<=":return pEr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(fmt,"cmp");Eo.Comparator=yR;function yR(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof yR){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof yR))return new yR(t,e);t=t.trim().split(/\s+/).join(" "),fl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===IOe?this.value="":this.value=this.operator+this.semver.version,fl("comp",this)}a(yR,"Comparator");var IOe={};yR.prototype.parse=function(t){var e=this.options.loose?Du[lEr]:Du[uEr],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=r[1],this.operator==="="&&(this.operator=""),r[2]?this.semver=new Oa(r[2],this.options.loose):this.semver=IOe};yR.prototype.toString=function(){return this.value};yR.prototype.test=function(t){return fl("Comparator.test",t,this.options.loose),this.semver===IOe?!0:(typeof t=="string"&&(t=new Oa(t,this.options)),fmt(t,this.operator,this.semver,this.options))};yR.prototype.intersects=function(t,e){if(!(t instanceof yR))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Pf(t.value,e),pmt(this.value,r,e);if(t.operator==="")return r=new Pf(this.value,e),pmt(t.semver,r,e);var n=(this.operator===">="||this.operator===">")&&(t.operator===">="||t.operator===">"),o=(this.operator==="<="||this.operator==="<")&&(t.operator==="<="||t.operator==="<"),s=this.semver.version===t.semver.version,c=(this.operator===">="||this.operator==="<=")&&(t.operator===">="||t.operator==="<="),l=fmt(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=fmt(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};Eo.Range=Pf;function Pf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Pf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Pf(t.raw,e);if(t instanceof yR)return new Pf(t.value,e);if(!(this instanceof Pf))return new Pf(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}a(Pf,"Range");Pf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Pf.prototype.toString=function(){return this.range};Pf.prototype.parseRange=function(t){var e=this.options.loose,r=e?Du[ACi]:Du[gCi];t=t.replace(r,cCa),fl("hyphen replace",t),t=t.replace(Du[Vee],Qva),fl("comparator trim",t,Du[Vee]),t=t.replace(Du[U0e],Fva),t=t.replace(Du[Q0e],Uva);var n=e?Du[lEr]:Du[uEr],o=t.split(" ").map(function(s){return eCa(s,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter(function(s){return!!s.match(n)})),o=o.map(function(s){return new yR(s,this.options)},this),o};Pf.prototype.intersects=function(t,e){if(!(t instanceof Pf))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(n){return t.set.some(function(o){return o.every(function(s){return n.intersects(s,e)})})})})};Eo.toComparators=Xva;function Xva(t,e){return new Pf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(Xva,"toComparators");function eCa(t,e){return fl("comp",t,e),t=nCa(t,e),fl("caret",t),t=tCa(t,e),fl("tildes",t),t=oCa(t,e),fl("xrange",t),t=aCa(t,e),fl("stars",t),t}a(eCa,"parseComparator");function Sv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(Sv,"isX");function tCa(t,e){return t.trim().split(/\s+/).map(function(r){return rCa(r,e)}).join(" ")}a(tCa,"replaceTildes");function rCa(t,e){var r=e.loose?Du[pCi]:Du[fCi];return t.replace(r,function(n,o,s,c,l){fl("tilde",t,n,o,s,c,l);var u;return Sv(o)?u="":Sv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Sv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(fl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",fl("tilde return",u),u})}a(rCa,"replaceTilde");function nCa(t,e){return t.trim().split(/\s+/).map(function(r){return iCa(r,e)}).join(" ")}a(nCa,"replaceCarets");function iCa(t,e){fl("caret",t,e);var r=e.loose?Du[mCi]:Du[hCi];return t.replace(r,function(n,o,s,c,l){fl("caret",t,n,o,s,c,l);var u;return Sv(o)?u="":Sv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Sv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(fl("replaceCaret pr",l),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+"-"+l+" <"+(+o+1)+".0.0"):(fl("no pr"),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+" <"+(+o+1)+".0.0"),fl("caret return",u),u})}a(iCa,"replaceCaret");function oCa(t,e){return fl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return sCa(r,e)}).join(" ")}a(oCa,"replaceXRanges");function sCa(t,e){t=t.trim();var r=e.loose?Du[uCi]:Du[lCi];return t.replace(r,function(n,o,s,c,l,u){fl("xRange",t,n,o,s,c,l,u);var d=Sv(s),f=d||Sv(c),h=f||Sv(l),m=h;return o==="="&&m&&(o=""),d?o===">"||o==="<"?n="<0.0.0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),n=o+s+"."+c+"."+l):f?n=">="+s+".0.0 <"+(+s+1)+".0.0":h&&(n=">="+s+"."+c+".0 <"+s+"."+(+c+1)+".0"),fl("xRange return",n),n})}a(sCa,"replaceXRange");function aCa(t,e){return fl("replaceStars",t,e),t.trim().replace(Du[yCi],"")}a(aCa,"replaceStars");function cCa(t,e,r,n,o,s,c,l,u,d,f,h,m){return Sv(r)?e="":Sv(n)?e=">="+r+".0.0":Sv(o)?e=">="+r+"."+n+".0":e=">="+e,Sv(u)?l="":Sv(d)?l="<"+(+u+1)+".0.0":Sv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(cCa,"hyphenReplace");Pf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Oa(t,this.options));for(var e=0;e0){var o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}a(lCa,"testSet");Eo.satisfies=pmt;function pmt(t,e,r){try{e=new Pf(e,r)}catch{return!1}return e.test(t)}a(pmt,"satisfies");Eo.maxSatisfying=uCa;function uCa(t,e,r){var n=null,o=null;try{var s=new Pf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Oa(n,r))}),n}a(uCa,"maxSatisfying");Eo.minSatisfying=dCa;function dCa(t,e,r){var n=null,o=null;try{var s=new Pf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Oa(n,r))}),n}a(dCa,"minSatisfying");Eo.minVersion=fCa;function fCa(t,e){t=new Pf(t,e);var r=new Oa("0.0.0");if(t.test(r)||(r=new Oa("0.0.0-0"),t.test(r)))return r;r=null;for(var n=0;n":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!r||SOe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(fCa,"minVersion");Eo.validRange=pCa;function pCa(t,e){try{return new Pf(t,e).range||"*"}catch{return null}}a(pCa,"validRange");Eo.ltr=hCa;function hCa(t,e,r){return hEr(t,e,"<",r)}a(hCa,"ltr");Eo.gtr=mCa;function mCa(t,e,r){return hEr(t,e,">",r)}a(mCa,"gtr");Eo.outside=hEr;function hEr(t,e,r,n){t=new Oa(t,n),e=new Pf(e,n);var o,s,c,l,u;switch(r){case">":o=SOe,s=pEr,c=dmt,l=">",u=">=";break;case"<":o=dmt,s=fEr,c=SOe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(pmt(t,e,n))return!1;for(var d=0;d=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0}a(hEr,"outside");Eo.prerelease=gCa;function gCa(t,e){var r=Wee(t,e);return r&&r.prerelease.length?r.prerelease:null}a(gCa,"prerelease");Eo.intersects=ACa;function ACa(t,e,r){return t=new Pf(t,r),e=new Pf(e,r),t.intersects(e)}a(ACa,"intersects");Eo.coerce=yCa;function yCa(t){if(t instanceof Oa)return t;if(typeof t!="string")return null;var e=t.match(Du[dCi]);return e==null?null:Wee(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(yCa,"coerce")});var SCi=I((E0p,bCi)=>{p();var ECa=d0e().wrap,gEr=1,AEr=2,yEr=4,ymt=8,Jl=[],_Ca=0,OE=!1,hG=[],j0e,EEr;function _Er(t,e){var r=t.length,n=e.length,o=[];if(r===0&&n===0)return o;for(var s=0;s0&&(Jl=hG.pop()),H0e=void 0,n&&!OE},"asyncCatcher"),EEr=a(function(e,r,n){var o=[];OE=!0;for(var s=0;s0&&r[u].before(this,o[r[u].uid]);OE=!1;var d=e.apply(this,arguments);for(OE=!0,u=0;u0&&r[u].after(this,o[r[u].uid]);return OE=!1,Jl=hG.pop(),H0e=void 0,d}},"asyncWrap"),ECa(process,"_fatalException",function(t){return a(function(r){return j0e(r)||t(r)},"_asyncFatalException")})):(mEr=!1,j0e=a(function(e){if(mEr)throw e;for(var r=!1,n=Jl.length,o=0;o0&&r[f].before(this,o[r[f].uid]);OE=!1;var h;try{h=e.apply(this,arguments)}catch(m){u=!0;for(var f=0;f0&&r[f].after(this,o[r[f].uid]);OE=!1}Jl=hG.pop()}return h}},"asyncWrap"),process.addListener("uncaughtException",j0e));var Amt,H0e,mEr;function vCa(t,e,r){OE=!0;for(var n=0;n0)return EEr(t,r,e);return vCa(t,r,e)}a(CCa,"wrapCallback");function k4(t,e){typeof t.create=="function"&&(this.create=t.create,this.flags|=gEr),typeof t.before=="function"&&(this.before=t.before,this.flags|=AEr),typeof t.after=="function"&&(this.after=t.after,this.flags|=yEr),typeof t.error=="function"&&(this.error=t.error,this.flags|=ymt),this.uid=++_Ca,this.data=e===void 0?null:e}a(k4,"AsyncListener");k4.prototype.create=void 0;k4.prototype.before=void 0;k4.prototype.after=void 0;k4.prototype.error=void 0;k4.prototype.data=void 0;k4.prototype.uid=0;k4.prototype.flags=0;function CCi(t,e){if(typeof t!="object"||!t)throw new TypeError("callbacks argument must be an object");return t instanceof k4?t:new k4(t,e)}a(CCi,"createAsyncListener");function bCa(t,e){var r;t instanceof k4?r=t:r=CCi(t,e);for(var n=!1,o=0;o{"use strict";p();TCi.exports=(t,e)=>class extends t{static{a(this,"WrappedPromise")}constructor(n){var o,s;super(l);var c=this;try{n.apply(o,s)}catch(u){s[1](u)}return c;function l(u,d){o=this,s=[f,h];function f(m){return e(c,!1),u(m)}a(f,"wrappedResolve");function h(m){return e(c,!1),d(m)}a(h,"wrappedReject")}}}});var NCi=I(()=>{"use strict";p();if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var kCi=d0e(),_mt=vCi(),Hb=kCi.wrap,mG=kCi.massWrap,Df=SCi(),TCa=require("util"),ICa=_mt.gte(process.version,"6.0.0"),bEr=_mt.gte(process.version,"7.0.0"),xCa=_mt.gte(process.version,"8.0.0"),wCa=_mt.gte(process.version,"11.0.0"),P4=require("net");bEr&&!P4._normalizeArgs?P4._normalizeArgs=function(t){if(t.length===0)return[{},null];var e=t[0],r={};typeof e=="object"&&e!==null?r=e:NCa(e)?r.path=e:(r.port=e,t.length>1&&typeof t[1]=="string"&&(r.host=t[1]));var n=t[t.length-1];return typeof n!="function"?[r,null]:[r,n]}:!bEr&&!P4._normalizeConnectArgs&&(P4._normalizeConnectArgs=function(t){var e={};function r(o){return(o=Number(o))>=0?o:!1}a(r,"toNumber"),typeof t[0]=="object"&&t[0]!==null?e=t[0]:typeof t[0]=="string"&&r(t[0])===!1?e.path=t[0]:(e.port=t[0],typeof t[1]=="string"&&(e.host=t[1]));var n=t[t.length-1];return typeof n=="function"?[e,n]:[e]});"_setUpListenHandle"in P4.Server.prototype?Hb(P4.Server.prototype,"_setUpListenHandle",xCi):Hb(P4.Server.prototype,"_listen2",xCi);function xCi(t){return function(){this.on("connection",function(e){e._handle&&(e._handle.onread=Df(e._handle.onread))});try{return t.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=Df(this._handle.onconnection))}}}a(xCi,"wrapSetUpListenHandle");function PCi(t){if(t&&t._handle){var e=t._handle;e._originalOnread||(e._originalOnread=e.onread),e.onread=Df(e._originalOnread)}}a(PCi,"patchOnRead");Hb(P4.Socket.prototype,"connect",function(t){return function(){var e;xCa&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?e=arguments[0]:e=bEr?P4._normalizeArgs(arguments):P4._normalizeConnectArgs(arguments),e[1]&&(e[1]=Df(e[1]));var r=t.apply(this,e);return PCi(this),r}});var RCa=require("http");Hb(RCa.Agent.prototype,"addRequest",function(t){return function(e){var r=e.onSocket;return e.onSocket=Df(function(n){return PCi(n),r.apply(this,arguments)}),t.apply(this,arguments)}});var vEr=require("child_process");function wCi(t){Array.isArray(t.stdio)&&t.stdio.forEach(function(e){e&&e._handle&&(e._handle.onread=Df(e._handle.onread),Hb(e._handle,"close",vmt))}),t._handle&&(t._handle.onexit=Df(t._handle.onexit))}a(wCi,"wrapChildProcess");vEr.ChildProcess?Hb(vEr.ChildProcess.prototype,"spawn",function(t){return function(){var e=t.apply(this,arguments);return wCi(this),e}}):mG(vEr,["execFile","fork","spawn"],function(t){return function(){var e=t.apply(this,arguments);return wCi(e),e}});process._fatalException||(process._originalNextTick=process.nextTick);var IEr=[];process._nextDomainTick&&IEr.push("_nextDomainTick");process._tickDomainCallback&&IEr.push("_tickDomainCallback");mG(process,IEr,D4);Hb(process,"nextTick",vmt);var xEr=["setTimeout","setInterval"];global.setImmediate&&xEr.push("setImmediate");var DCi=require("timers"),kCa=global.setTimeout===DCi.setTimeout;mG(DCi,xEr,vmt);kCa&&mG(global,xEr,vmt);var SEr=require("dns");mG(SEr,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],D4);SEr.resolveNaptr&&Hb(SEr,"resolveNaptr",D4);var Yee=require("fs");mG(Yee,["watch","rename","truncate","chown","fchown","chmod","fchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","watchFile","unwatchFile","exists"],D4);Yee.lchown&&Hb(Yee,"lchown",D4);Yee.lchmod&&Hb(Yee,"lchmod",D4);Yee.ftruncate&&Hb(Yee,"ftruncate",D4);var xOe;try{xOe=require("zlib")}catch{}xOe&&xOe.Deflate&&xOe.Deflate.prototype&&(zee=Object.getPrototypeOf(xOe.Deflate.prototype),zee._transform?Hb(zee,"_transform",D4):zee.write&&zee.flush&&zee.end&&mG(zee,["write","flush","end"],D4));var zee,TEr;try{TEr=require("crypto")}catch{}TEr&&(CEr=["pbkdf2","randomBytes"],wCa||CEr.push("pseudoRandomBytes"),mG(TEr,CEr,D4));var CEr,Emt=!!global.Promise&&Promise.toString()==="function Promise() { [native code] }"&&Promise.toString.toString()==="function toString() { [native code] }";Emt&&(RCi=process.addAsyncListener({create:a(function(){Emt=!1},"create")}),global.Promise.resolve(!0).then(a(function(){Emt=!1},"notSync")),process.removeAsyncListener(RCi));var RCi;Emt&&PCa();function PCa(){var t=global.Promise;function e(c){if(!(this instanceof e))return t(c);if(typeof c!="function")return new t(c);var l,u,d=new t(f);d.__proto__=e.prototype;try{c.apply(l,u)}catch(h){u[1](h)}return d;function f(h,m){l=this,u=[g,A];function g(y){return n(d,!1),h(y)}a(g,"wrappedResolve");function A(y){return n(d,!1),m(y)}a(A,"wrappedReject")}}if(a(e,"wrappedPromise"),TCa.inherits(e,t),Hb(t.prototype,"then",s),t.prototype.chain&&Hb(t.prototype,"chain",s),ICa)global.Promise=ICi()(t,n);else{var r=["all","race","reject","resolve","accept","defer"];r.forEach(function(c){typeof t[c]=="function"&&(e[c]=t[c])}),global.Promise=e}function n(c,l){(!c.__asl_wrapper||l)&&(c.__asl_wrapper=Df(o))}a(n,"ensureAslWrapper");function o(c,l,u,d){var f;try{return f=l.call(c,u),{returnVal:f,error:!1}}catch(h){return{errorVal:h,error:!0}}finally{f instanceof t?d.__asl_wrapper=a(function(){var m=f.__asl_wrapper||o;return m.apply(this,arguments)},"proxyWrapper"):n(d,!0)}}a(o,"propagateAslWrapper");function s(c){return a(function(){var u=this,d=c.apply(u,Array.prototype.map.call(arguments,f));return d.__asl_wrapper=a(function(m,g,A,y){return u.__asl_wrapper?(u.__asl_wrapper(m,function(){},null,d),d.__asl_wrapper(m,g,A,y)):o(m,g,A,y)},"proxyWrapper"),d;function f(h){return typeof h!="function"?h:Df(function(m){var g=(u.__asl_wrapper||o)(this,h,m,d);if(g.error)throw g.errorVal;return g.returnVal})}a(f,"bind")},"wrappedThen")}a(s,"wrapThen")}a(PCa,"wrapPromise");function D4(t){var e=a(function(){var r,n=arguments.length-1;if(typeof arguments[n]=="function"){r=Array(arguments.length);for(var o=0;o=0?t:!1}a(DCa,"toNumber");function NCa(t){return typeof t=="string"&&DCa(t)===!1}a(NCa,"isPipeName")});var FCi=I((k0p,BCi)=>{"use strict";p();var j8=require("assert"),MCa=imt(),wOe="cls@contexts",wEr="error@context";process.addAsyncListener||NCi();function oD(t){this.name=t,this.active=null,this._set=[],this.id=null}a(oD,"Namespace");oD.prototype.set=function(t,e){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return this.active[t]=e,e};oD.prototype.get=function(t){if(this.active)return this.active[t]};oD.prototype.createContext=function(){return Object.create(this.active)};oD.prototype.run=function(t){var e=this.createContext();this.enter(e);try{return t(e),e}catch(r){throw r&&(r[wEr]=e),r}finally{this.exit(e)}};oD.prototype.runAndReturn=function(t){var e;return this.run(function(r){e=t(r)}),e};oD.prototype.bind=function(t,e){e||(this.active?e=this.active:e=this.createContext());var r=this;return function(){r.enter(e);try{return t.apply(this,arguments)}catch(n){throw n&&(n[wEr]=e),n}finally{r.exit(e)}}};oD.prototype.enter=function(t){j8.ok(t,"context must be provided for entering"),this._set.push(this.active),this.active=t};oD.prototype.exit=function(t){if(j8.ok(t,"context must be provided for exiting"),this.active===t){j8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}var e=this._set.lastIndexOf(t);j8.ok(e>=0,"context not currently entered; can't exit"),j8.ok(e,"can't remove top context"),this._set.splice(e,1)};oD.prototype.bindEmitter=function(t){j8.ok(t.on&&t.addListener&&t.emit,"can only bind real EEs");var e=this,r="context@"+this.name;function n(s){s&&(s[wOe]||(s[wOe]=Object.create(null)),s[wOe][r]={namespace:e,context:e.active})}a(n,"attach");function o(s){if(!(s&&s[wOe]))return s;var c=s,l=s[wOe];return Object.keys(l).forEach(function(u){var d=l[u];c=d.namespace.bind(c,d.context)}),c}a(o,"bind"),MCa(t,n,o)};oD.prototype.fromException=function(t){return t[wEr]};function MCi(t){return process.namespaces[t]}a(MCi,"get");function OCa(t){j8.ok(t,"namespace must be given a name!");var e=new oD(t);return e.id=process.addAsyncListener({create:a(function(){return e.active},"create"),before:a(function(r,n){n&&e.enter(n)},"before"),after:a(function(r,n){n&&e.exit(n)},"after"),error:a(function(r){r&&e.exit(r)},"error")}),process.namespaces[t]=e,e}a(OCa,"create");function OCi(t){var e=MCi(t);j8.ok(e,"can't delete nonexistent namespace!"),j8.ok(e.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(e.id),process.namespaces[t]=null}a(OCi,"destroy");function LCi(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){OCi(t)}),process.namespaces=Object.create(null)}a(LCi,"reset");process.namespaces||LCi();BCi.exports={getNamespace:MCi,createNamespace:OCa,destroyNamespace:OCi,reset:LCi}});var AG=I(N4=>{"use strict";p();var LCa=N4&&N4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),BCa=N4&&N4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),FCa=N4&&N4.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&LCa(e,t,r);return BCa(e,t),e};Object.defineProperty(N4,"__esModule",{value:!0});N4.CorrelationContextManager=void 0;var gG=Kl(),UCa=FCa(jht()),Kee=Hht(),REr=XAr(),UCi=Eyr(),G0e=ay(),QCa=(function(){function t(){}return a(t,"CorrelationContextManager"),t.getCurrentContext=function(){if(!t.enabled)return null;var e=t.session.get(t.CONTEXT_NAME);return e===void 0?null:e},t.generateContextObject=function(e,r,n,o,s,c){return r=r||e,this.enabled?{operation:{name:n,id:e,parentId:r,traceparent:s,tracestate:c},customProperties:new qCa(o)}:null},t.spanToContextObject=function(e,r,n){var o=new Kee;return o.traceId=e.traceId,o.spanId=e.spanId,o.traceFlag=Kee.formatOpenTelemetryTraceFlags(e.traceFlags)||Kee.DEFAULT_TRACE_FLAG,o.parentId=r,t.generateContextObject(o.traceId,o.parentId,n,null,o)},t.runWithContext=function(e,r){var n;if(t.enabled)try{return t.session.bind(r,(n={},n[t.CONTEXT_NAME]=e,n))()}catch(o){gG.warn("Error binding to session context",G0e.dumpObj(o))}return r()},t.wrapEmitter=function(e){if(t.enabled)try{t.session.bindEmitter(e)}catch(r){gG.warn("Error binding to session context",G0e.dumpObj(r))}},t.wrapCallback=function(e,r){var n;if(t.enabled)try{return t.session.bind(e,r?(n={},n[t.CONTEXT_NAME]=r,n):void 0)}catch(o){gG.warn("Error binding to session context",G0e.dumpObj(o))}return e},t.enable=function(e){if(!this.enabled){if(!this.isNodeVersionCompatible()){this.enabled=!1;return}if(!t.hasEverEnabled){this.forceClsHooked=e,this.hasEverEnabled=!0,typeof this.cls>"u"&&(t.forceClsHooked===!0||t.forceClsHooked===void 0&&t.shouldUseClsHooked()?this.cls=iCi():this.cls=FCi());try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(r){gG.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",G0e.dumpObj(r)),this.enabled=!1;return}UCa.registerContextPreservation(function(r){try{return t.session.bind(r)}catch(n){gG.warn("Error binding to session context",G0e.dumpObj(n))}})}this.enabled=!0}},t.startOperation=function(e,r){var n=e&&e.traceContext||null,o=e&&e.spanContext?e:null,s=e&&e.traceId?e:null,c=e&&e.headers;if(o)return this.spanToContextObject(o.spanContext(),o.parentSpanId,o.name);if(s)return this.spanToContextObject(s,"|".concat(s.traceId,".").concat(s.spanId,"."),typeof r=="string"?r:"");var l=typeof r=="string"?r:"";if(n){var u=null,d=null;if(l=n.attributes.OperationName||l,r){var f=r;f.headers&&(f.headers.traceparent?u=new Kee(f.headers.traceparent):f.headers["request-id"]&&(u=new Kee(null,f.headers["request-id"])),f.headers.tracestate&&(d=new REr(f.headers.tracestate)))}u||(u=new Kee(n.traceParent||n.traceparent)),d||(d=new REr(n.traceState||n.tracestate));var h=void 0;if(typeof r=="object"){var m=new UCi(r);h=m.getCorrelationContextHeader(),l=m.getOperationName({})}var g=t.generateContextObject(u.traceId,u.parentId,l,h,u,d);return g}if(c){var u=new Kee(c.traceparent?c.traceparent.toString():null),d=new REr(c.tracestate?c.tracestate.toString():null),m=new UCi(e),g=t.generateContextObject(u.traceId,u.parentId,m.getOperationName({}),m.getCorrelationContextHeader(),u,d);return g}return gG.warn("startOperation was called with invalid arguments",arguments),null},t.disable=function(){this.enabled=!1},t.reset=function(){if(t.hasEverEnabled){t.session=null;try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(e){gG.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",G0e.dumpObj(e)),this.enabled=!1;return}}},t.isNodeVersionCompatible=function(){var e=process.versions.node.split(".");return parseInt(e[0])>3||parseInt(e[0])>2&&parseInt(e[1])>2},t.shouldUseClsHooked=function(){var e=process.versions.node.split(".");return parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=2},t.canUseClsHooked=function(){var e=process.versions.node.split("."),r=parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=0,n=parseInt(e[0])<8||parseInt(e[0])<=8&&parseInt(e[1])<2,o=parseInt(e[0])>4||parseInt(e[0])>=4&&parseInt(e[1])>=7;return!(r&&n)&&o},t.enabled=!1,t.hasEverEnabled=!1,t.forceClsHooked=void 0,t.CONTEXT_NAME="ApplicationInsights-Context",t})();N4.CorrelationContextManager=QCa;var qCa=(function(){function t(e){this.props=[],this.addHeaderData(e)}return a(t,"CustomPropertiesImpl"),t.prototype.addHeaderData=function(e){var r=e?e.split(", "):[];this.props=r.map(function(n){var o=n.split("=");return{key:o[0],value:o[1]}}).concat(this.props)},t.prototype.serializeToHeader=function(){return this.props.map(function(e){return"".concat(e.key,"=").concat(e.value)}).join(", ")},t.prototype.getProperty=function(e){for(var r=0;r'+r+""+s,n},"insertSnippetByIndex");Do.insertSnippetByIndex=Uba;var Qba=a(function(t){var e=!1,r=t.getHeader("Content-Type");return r&&(typeof r=="string"?e=r.indexOf("html")>=0:e=r.toString().indexOf("html")>=0),e},"isContentTypeHeaderHtml");Do.isContentTypeHeaderHtml=Qba});var LEr=I((Agp,obi)=>{"use strict";p();var ibi=md(),qba=(function(){function t(){}return a(t,"ConnectionStringParser"),t.parse=function(e){if(!e)return{};var r=e.split(t._FIELDS_SEPARATOR),n=r.reduce(function(s,c){var l=c.split(t._FIELD_KEY_VALUE_SEPARATOR);if(l.length===2){var u=l[0].toLowerCase(),d=l[1];s[u]=d}return s},{});if(Object.keys(n).length>0){if(n.endpointsuffix){var o=n.location?n.location+".":"";n.ingestionendpoint=n.ingestionendpoint||"https://"+o+"dc."+n.endpointsuffix,n.liveendpoint=n.liveendpoint||"https://"+o+"live."+n.endpointsuffix}n.ingestionendpoint=n.ingestionendpoint||ibi.DEFAULT_BREEZE_ENDPOINT,n.liveendpoint=n.liveendpoint||ibi.DEFAULT_LIVEMETRICS_ENDPOINT}return n},t.isIkeyValid=function(e){if(!e||e=="")return!1;var r="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",n=new RegExp(r);return n.test(e)},t._FIELDS_SEPARATOR=";",t._FIELD_KEY_VALUE_SEPARATOR="=",t})();obi.exports=qba});var sbi={};ki(sbi,{webSnippet:()=>jba});var jba,abi=ve(()=>{p();jba=`!function(T,l,y){var S=T.location,k="script",D="instrumentationKey",C="ingestionendpoint",I="disableExceptionTracking",E="ai.device.",b="toLowerCase",w="crossOrigin",N="POST",e="appInsightsSDK",t=y.name||"appInsights";(y.name||T[e])&&(T[e]=t);var n=T[t]||function(d){var g=!1,f=!1,m={initialize:!0,queue:[],sv:"5",version:2,config:d};function v(e,t){var n={},a="Browser";return n[E+"id"]=a[b](),n[E+"type"]=a,n["ai.operation.name"]=S&&S.pathname||"_unknown_",n["ai.internal.sdkVersion"]="javascript:snippet_"+(m.sv||m.version),{time:function(){var e=new Date;function t(e){var t=""+e;return 1===t.length&&(t="0"+t),t}return e.getUTCFullYear()+"-"+t(1+e.getUTCMonth())+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}(),iKey:e,name:"Microsoft.ApplicationInsights."+e.replace(/-/g,"")+"."+t,sampleRate:100,tags:n,data:{baseData:{ver:2}}}}var h=d.url||y.src;if(h){function a(e){var t,n,a,i,r,o,s,c,u,p,l;g=!0,m.queue=[],f||(f=!0,t=h,s=function(){var e={},t=d.connectionString;if(t)for(var n=t.split(";"),a=0;ae.trim()).join(" ")};Sdi.O=function(t){return this.inspectOpts.colors=this.useColors,Aht.inspect(t,this.inspectOpts)}});var Idi=I((Zup,kAr)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?kAr.exports=bdi():kAr.exports=Tdi()});var DAr=I((edp,xdi)=>{"use strict";p();var PAr=require("path").sep;xdi.exports=function(t){var e=t.split(PAr),r=e.lastIndexOf("node_modules");if(r!==-1&&e[r+1]){for(var n=e[r+1][0]==="@",o=n?e[r+1]+"/"+e[r+2]:e[r+1],s=n?3:2,c="",l=r+s-1,u=0;u<=l;u++)u===l?c+=e[u]:c+=e[u]+PAr;for(var d="",f=e.length-1,h=r+s;h<=f;h++)h===f?d+=e[h]:d+=e[h]+PAr;return{name:o,basedir:c,path:d}}}});var NAr=I((rdp,wdi)=>{"use strict";p();var dla=require("os");wdi.exports=dla.homedir||a(function(){var e=process.env.HOME,r=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform==="win32"?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:process.platform==="darwin"?e||(r?"/Users/"+r:null):process.platform==="linux"?e||(process.getuid()===0?"/root":r?"/home/"+r:null):e||null},"homedir")});var MAr=I((odp,Rdi)=>{p();Rdi.exports=function(){var t=Error.prepareStackTrace;Error.prepareStackTrace=function(r,n){return n};var e=new Error().stack;return Error.prepareStackTrace=t,e[2].getFileName()}});var kdi=I((adp,pOe)=>{"use strict";p();var fla=process.platform==="win32",pla=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,OAr={};function hla(t){return pla.exec(t).slice(1)}a(hla,"win32SplitPath");OAr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=hla(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0]===e[1]?e[0]:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};var mla=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,LAr={};function gla(t){return mla.exec(t).slice(1)}a(gla,"posixSplitPath");LAr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=gla(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};fla?pOe.exports=OAr.parse:pOe.exports=LAr.parse;pOe.exports.posix=LAr.parse;pOe.exports.win32=OAr.parse});var BAr=I((udp,Mdi)=>{p();var Ndi=require("path"),Pdi=Ndi.parse||kdi(),Ddi=a(function(e,r){var n="/";/^([A-Za-z]:)/.test(e)?n="":/^\\\\/.test(e)&&(n="\\\\");for(var o=[e],s=Pdi(e);s.dir!==o[o.length-1];)o.push(s.dir),s=Pdi(s.dir);return o.reduce(function(c,l){return c.concat(r.map(function(u){return Ndi.resolve(n,l,u)}))},[])},"getNodeModulesDirs");Mdi.exports=a(function(e,r,n){var o=r&&r.moduleDirectory?[].concat(r.moduleDirectory):["node_modules"];if(r&&typeof r.paths=="function")return r.paths(n,e,function(){return Ddi(e,o)},r);var s=Ddi(e,o);return r&&r.paths?s.concat(r.paths):s},"nodeModulesPaths")});var FAr=I((pdp,Odi)=>{p();Odi.exports=function(t,e){return e||{}}});var Fdi=I((mdp,Bdi)=>{"use strict";p();var Ala="Function.prototype.bind called on incompatible ",yla=Object.prototype.toString,Ela=Math.max,_la="[object Function]",Ldi=a(function(e,r){for(var n=[],o=0;o{"use strict";p();var bla=Fdi();Udi.exports=Function.prototype.bind||bla});var jdi=I((_dp,qdi)=>{"use strict";p();var Sla=Function.prototype.call,Tla=Object.prototype.hasOwnProperty,Ila=Qdi();qdi.exports=Ila.call(Sla,Tla)});var Hdi=I((Cdp,xla)=>{xla.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var hOe=I((bdp,Vdi)=>{"use strict";p();var wla=jdi();function Rla(t,e){for(var r=t.split("."),n=e.split(" "),o=n.length>1?n[0]:"=",s=(n.length>1?n[1]:n[0]).split("."),c=0;c<3;++c){var l=parseInt(r[c]||0,10),u=parseInt(s[c]||0,10);if(l!==u)return o==="<"?l="?l>=u:!1}return o===">="}a(Rla,"specifierIncluded");function Gdi(t,e){var r=e.split(/ ?&& ?/);if(r.length===0)return!1;for(var n=0;n"u"?process.versions&&process.versions.node:t;if(typeof r!="string")throw new TypeError(typeof t>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(e&&typeof e=="object"){for(var n=0;n{p();var Bee=require("fs"),Pla=NAr(),Cm=require("path"),Dla=MAr(),Nla=BAr(),Mla=FAr(),Ola=hOe(),Lla=process.platform!=="win32"&&Bee.realpath&&typeof Bee.realpath.native=="function"?Bee.realpath.native:Bee.realpath,Wdi=Pla(),Bla=a(function(){return[Cm.join(Wdi,".node_modules"),Cm.join(Wdi,".node_libraries")]},"defaultPaths"),Fla=a(function(e,r){Bee.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isFile()||o.isFIFO())})},"isFile"),Ula=a(function(e,r){Bee.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isDirectory())})},"isDirectory"),Qla=a(function(e,r){Lla(e,function(n,o){n&&n.code!=="ENOENT"?r(n):r(null,n?e:o)})},"realpath"),mOe=a(function(e,r,n,o){n&&n.preserveSymlinks===!1?e(r,o):o(null,r)},"maybeRealpath"),qla=a(function(e,r,n){e(r,function(o,s){if(o)n(o);else try{var c=JSON.parse(s);n(null,c)}catch{n(null)}})},"defaultReadPackage"),jla=a(function(e,r,n){for(var o=Nla(r,n,e),s=0;s{Hla.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":">= 23.4",_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var efi=I((kdp,Xdi)=>{"use strict";p();var Gla=hOe(),Jdi=Kdi(),Zdi={};for(Eht in Jdi)Object.prototype.hasOwnProperty.call(Jdi,Eht)&&(Zdi[Eht]=Gla(Eht));var Eht;Xdi.exports=Zdi});var rfi=I((Ddp,tfi)=>{p();var $la=hOe();tfi.exports=a(function(e){return $la(e)},"isCore")});var ofi=I((Odp,ifi)=>{p();var Vla=hOe(),Fee=require("fs"),BE=require("path"),Wla=NAr(),zla=MAr(),Yla=BAr(),Kla=FAr(),Jla=process.platform!=="win32"&&Fee.realpathSync&&typeof Fee.realpathSync.native=="function"?Fee.realpathSync.native:Fee.realpathSync,nfi=Wla(),Zla=a(function(){return[BE.join(nfi,".node_modules"),BE.join(nfi,".node_libraries")]},"defaultPaths"),Xla=a(function(e){try{var r=Fee.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&(r.isFile()||r.isFIFO())},"isFile"),eua=a(function(e){try{var r=Fee.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&r.isDirectory()},"isDirectory"),tua=a(function(e){try{return Jla(e)}catch(r){if(r.code!=="ENOENT")throw r}return e},"realpathSync"),gOe=a(function(e,r,n){return n&&n.preserveSymlinks===!1?e(r):r},"maybeRealpathSync"),rua=a(function(e,r){var n=e(r);try{var o=JSON.parse(n);return o}catch{}},"defaultReadPackageSync"),nua=a(function(e,r,n){for(var o=Yla(r,n,e),s=0;s{p();var _ht=Ydi();_ht.core=efi();_ht.isCore=rfi();_ht.sync=ofi();sfi.exports=_ht});var afi=I((Qdp,iua)=>{iua.exports={name:"require-in-the-middle",version:"7.5.2",description:"Module to hook into the Node.js require function",main:"index.js",types:"types/index.d.ts",dependencies:{debug:"^4.3.5","module-details-from-path":"^1.0.3",resolve:"^1.22.8"},devDependencies:{"@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@babel/preset-typescript":"^7.9.0","@babel/register":"^7.9.0","ipp-printer":"^1.0.0",patterns:"^1.0.3",roundround:"^0.2.0",semver:"^6.3.0",standard:"^14.3.1",tape:"^4.11.0"},scripts:{test:"npm run test:lint && npm run test:tape && npm run test:babel","test:lint":"standard","test:tape":"tape test/*.js","test:babel":"node test/babel/babel-register.js"},repository:{type:"git",url:"git+https://github.com/nodejs/require-in-the-middle.git"},keywords:["require","hook","shim","shimmer","shimming","patch","monkey","monkeypatch","module","load"],files:["types"],author:"Thomas Watson Steen (https://twitter.com/wa7son)",license:"MIT",bugs:{url:"https://github.com/nodejs/require-in-the-middle/issues"},homepage:"https://github.com/nodejs/require-in-the-middle#readme",engines:{node:">=8.6.0"}}});var HAr=I((qdp,jAr)=>{"use strict";p();var D0e=require("path"),uD=require("module"),hh=Idi()("require-in-the-middle"),oua=DAr();jAr.exports=AOe;jAr.exports.Hook=AOe;var QAr,P0e;if(uD.isBuiltin)P0e=uD.isBuiltin;else if(uD.builtinModules)P0e=a(t=>t.startsWith("node:")?!0:(QAr===void 0&&(QAr=new Set(uD.builtinModules)),QAr.has(t)),"isCore");else{let t=UAr(),[e,r]=process.versions.node.split(".").map(Number);e===8&&r<8?P0e=a(n=>n==="http2"?!0:!!t.core[n],"isCore"):P0e=a(n=>!!t.core[n],"isCore")}var vht;function sua(t,e){if(!vht)if(require.resolve&&require.resolve.paths)vht=a(function(r,n){return require.resolve(r,{paths:[n]})},"_resolve");else{let r=UAr();vht=a(function(n,o){return r.sync(n,{basedir:o})},"_resolve")}return vht(t,e)}a(sua,"resolve");var aua=/([/\\]index)?(\.js)?$/,qAr=class{static{a(this,"ExportsCache")}constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,r){if(this._localCache.has(e))return!0;if(r)return!1;{let n=require.cache[e];return!!(n&&this._kRitmExports in n)}}get(e,r){let n=this._localCache.get(e);if(n!==void 0)return n;if(!r){let o=require.cache[e];return o&&o[this._kRitmExports]}}set(e,r,n){n?this._localCache.set(e,r):e in require.cache?require.cache[e][this._kRitmExports]=r:(hh('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,r))}};function AOe(t,e,r){if(!(this instanceof AOe))return new AOe(t,e,r);if(typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),typeof uD._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof uD._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,afi().bugs.url);return}this._cache=new qAr,this._unhooked=!1,this._origRequire=uD.prototype.require;let n=this,o=new Set,s=e?e.internals===!0:!1,c=Array.isArray(t);hh("registering require hook"),this._require=uD.prototype.require=function(u){return n._unhooked===!0?(hh("ignoring require call - module is soft-unhooked"),n._origRequire.apply(this,arguments)):l.call(this,arguments,!1)},typeof process.getBuiltinModule=="function"&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(u){return n._unhooked===!0?(hh("ignoring process.getBuiltinModule call - module is soft-unhooked"),n._origGetBuiltinModule.apply(this,arguments)):l.call(this,arguments,!0)});function l(u,d){let f=u[0],h=P0e(f),m;if(h){if(m=f,f.startsWith("node:")){let v=f.slice(5);P0e(v)&&(m=v)}}else{if(d)return hh("call to process.getBuiltinModule with unknown built-in id"),n._origGetBuiltinModule.apply(this,u);try{m=uD._resolveFilename(f,this)}catch(v){return hh('Module._resolveFilename("%s") threw %j, calling original Module.require',f,v.message),n._origRequire.apply(this,u)}}let g,A;if(hh("processing %s module require('%s'): %s",h===!0?"core":"non-core",f,m),n._cache.has(m,h)===!0)return hh("returning already patched cached module: %s",m),n._cache.get(m,h);let y=o.has(m);y===!1&&o.add(m);let E=d?n._origGetBuiltinModule.apply(this,u):n._origRequire.apply(this,u);if(y===!0)return hh("module is in the process of being patched already - ignoring: %s",m),E;if(o.delete(m),h===!0){if(c===!0&&t.includes(m)===!1)return hh("ignoring core module not on whitelist: %s",m),E;g=m}else if(c===!0&&t.includes(m)){let v=D0e.parse(m);g=v.name,A=v.dir}else{let v=oua(m);if(v===void 0)return hh("could not parse filename: %s",m),E;g=v.name,A=v.basedir;let b=cua(v);hh("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",g,f,b,A);let T=!1;if(c){if(!f.startsWith(".")&&t.includes(f)&&(g=f,T=!0),!t.includes(g)&&!t.includes(b))return E;t.includes(b)&&b!==g&&(g=b,T=!0)}if(!T){let w;try{w=sua(g,A)}catch{return hh("could not resolve module: %s",g),n._cache.set(m,E,h),E}if(w!==m)if(s===!0)g=g+D0e.sep+D0e.relative(A,m),hh("preparing to process require of internal file: %s",g);else return hh("ignoring require of non-main module file: %s",w),n._cache.set(m,E,h),E}}n._cache.set(m,E,h),hh("calling require hook: %s",g);let _=r(E,g,A);return n._cache.set(m,_,h),hh("returning module: %s",g),_}a(l,"patchedRequire")}a(AOe,"Hook");AOe.prototype.unhook=function(){this._unhooked=!0,this._require===uD.prototype.require?(uD.prototype.require=this._origRequire,hh("require unhook successful")):hh("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,hh("process.getBuiltinModule unhook successful")):hh("process.getBuiltinModule unhook unsuccessful"))};function cua(t){let e=D0e.sep!=="/"?t.path.split(D0e.sep).join("/"):t.path;return D0e.posix.join(t.name,e).replace(aua,"")}a(cua,"resolveModuleName")});var Cht,bht,cfi=Se(()=>{p();Cht=class{static{a(this,"ModuleNameTrieNode")}hooks=[];children=new Map},bht=class{static{a(this,"ModuleNameTrie")}_trie=new Cht;_counter=0;insert(e){let r=this._trie;for(let n of e.moduleName.split("/")){let o=r.children.get(n);o||(o=new Cht,r.children.set(n,o)),r=o}r.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:r,fullOnly:n}={}){let o=this._trie,s=[],c=!0;for(let l of e.split("/")){let u=o.children.get(l);if(!u){c=!1;break}n||s.push(...u.hooks),o=u}return n&&c&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(r&&s.sort((l,u)=>l.insertedId-u.insertedId),s.map(({hook:l})=>l))}}});function uua(t){return GAr.sep!=="/"?t.split(GAr.sep).join("/"):t}var ufi,GAr,lua,Sht,dfi=Se(()=>{p();ufi=fe(HAr()),GAr=fe(require("path"));cfi();lua=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),Sht=class t{static{a(this,"RequireInTheMiddleSingleton")}_moduleNameTrie=new bht;static _instance;constructor(){this._initialize()}_initialize(){new ufi.Hook(null,{internals:!0},(e,r,n)=>{let o=uua(r),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:n===void 0});for(let{onRequire:c}of s)e=c(e,r,n);return e})}register(e,r){let n={moduleName:e,onRequire:r};return this._moduleNameTrie.insert(n),n}static getInstance(){return lua?new t:this._instance=this._instance??new t}};a(uua,"normalizePathSeparators")});var Afi=I(Uee=>{p();var ffi=[],$Ar=new WeakMap,pfi=new WeakMap,hfi=new Map,mfi=[],dua={set(t,e,r){return $Ar.get(t)[e](r)},get(t,e){if(e===Symbol.toStringTag)return"Module";let r=pfi.get(t)[e];if(typeof r=="function")return r()},defineProperty(t,e,r){if(!("value"in r))throw new Error("Getters/setters are not supported for exports property descriptors.");return $Ar.get(t)[e](r.value)}};function fua(t,e,r,n,o){hfi.set(t,o),$Ar.set(e,r),pfi.set(e,n);let s=new Proxy(e,dua);ffi.forEach(c=>c(t,s)),mfi.push([t,s])}a(fua,"register");var gfi=!1;function pua(){return gfi}a(pua,"getExperimentalPatchInternals");function hua(t){gfi=t}a(hua,"setExperimentalPatchInternals");Uee.register=fua;Uee.importHooks=ffi;Uee.specifiers=hfi;Uee.toHook=mfi;Uee.getExperimentalPatchInternals=pua;Uee.setExperimentalPatchInternals=hua});var bfi=I((efp,N0e)=>{p();var yfi=require("path"),mua=DAr(),{fileURLToPath:Efi}=require("url"),{MessageChannel:gua}=require("worker_threads"),{importHooks:VAr,specifiers:Aua,toHook:yua,getExperimentalPatchInternals:Eua}=Afi();function vfi(t){VAr.push(t),yua.forEach(([e,r])=>t(e,r))}a(vfi,"addHook");function Cfi(t){let e=VAr.indexOf(t);e>-1&&VAr.splice(e,1)}a(Cfi,"removeHook");function _fi(t,e,r,n){let o=t(e,r,n);o&&o!==e&&(e.default=o)}a(_fi,"callHookFn");var WAr;function _ua(){let{port1:t,port2:e}=new gua,r=0,n;WAr=a(l=>{r++,t.postMessage(l)},"sendModulesToLoader"),t.on("message",()=>{r--,n&&r<=0&&n()}).unref();function o(){let l=setInterval(()=>{},1e3),u=new Promise(d=>{n=d}).then(()=>{clearInterval(l)});return r===0&&n(),u}a(o,"waitForAllMessagesAcknowledged");let s=e;return{registerOptions:{data:{addHookMessagePort:s,include:[]},transferList:[s]},addHookMessagePort:s,waitForAllMessagesAcknowledged:o}}a(_ua,"createAddHookMessageChannel");function yOe(t,e,r){if(!(this instanceof yOe))return new yOe(t,e,r);typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let n=e?e.internals===!0:!1;WAr&&Array.isArray(t)&&WAr(t),this._iitmHook=(o,s)=>{let c=o,l=o.startsWith("node:"),u;if(l)o=o.replace(/^node:/,"");else{if(o.startsWith("file://"))try{o=Efi(o)}catch{}let d=mua(o);d&&(o=d.name,u=d.basedir)}if(t){for(let d of t)if(d===o){if(u){if(n)o=o+yfi.sep+yfi.relative(u,Efi(c));else if(!Eua()&&!u.endsWith(Aua.get(c)))continue}_fi(r,s,o,u)}}else _fi(r,s,o,u)},vfi(this._iitmHook)}a(yOe,"Hook");yOe.prototype.unhook=function(){Cfi(this._iitmHook)};N0e.exports=yOe;N0e.exports.Hook=yOe;N0e.exports.addHook=vfi;N0e.exports.removeHook=Cfi;N0e.exports.createAddHookMessageChannel=_ua});function Sfi(t,e,r){let n,o;try{o=t()}catch(s){n=s}finally{if(e(n,o),n&&!r)throw n;return o}}async function Tfi(t,e,r){let n,o;try{o=await t()}catch(s){n=s}finally{if(e(n,o),n&&!r)throw n;return o}}function Tht(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var zAr=Se(()=>{p();a(Sfi,"safeExecuteInTheMiddle");a(Tfi,"safeExecuteInTheMiddleAsync");a(Tht,"isWrapped")});function Ifi(t,e,r){return typeof e>"u"?t.includes("*"):t.some(n=>ddi(e,n,{includePrerelease:r}))}var V8,YAr,EOe,xfi,wfi,Rfi,M0e,kfi=Se(()=>{p();V8=fe(require("path")),YAr=require("util");mdi();EOe=fe(x0e());Edi();dfi();xfi=fe(bfi());po();wfi=fe(HAr()),Rfi=require("fs");zAr();M0e=class extends hht{static{a(this,"InstrumentationBase")}_modules;_hooks=[];_requireInTheMiddleSingleton=Sht.getInstance();_enabled=!1;constructor(e,r,n){super(e,r,n);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=a((e,r,n)=>{if(Tht(e[r])&&this._unwrap(e,r),YAr.types.isProxy(e)){let o=(0,EOe.wrap)(Object.assign({},e),r,n);return Object.defineProperty(e,r,{value:o}),o}else return(0,EOe.wrap)(e,r,n)},"_wrap");_unwrap=a((e,r)=>YAr.types.isProxy(e)?Object.defineProperty(e,r,{value:e[r]}):(0,EOe.unwrap)(e,r),"_unwrap");_massWrap=a((e,r,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Dn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Dn.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{r.forEach(s=>{this._wrap(o,s,n)})})},"_massWrap");_massUnwrap=a((e,r)=>{if(e)Array.isArray(e)||(e=[e]);else{Dn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Dn.error("must provide one or more functions to wrap on modules");return}e.forEach(n=>{r.forEach(o=>{this._unwrap(n,o)})})},"_massUnwrap");_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:r}=e;try{let n=require.resolve(r);require.cache[n]&&this._diag.warn(`Module ${r} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${r}`)}catch{}})}_extractPackageVersion(e){try{let r=(0,Rfi.readFileSync)(V8.join(e,"package.json"),{encoding:"utf8"}),n=JSON.parse(r).version;return typeof n=="string"?n:void 0}catch{Dn.warn("Failed extracting version",e)}}_onRequire(e,r,n,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=r,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(r)):r;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===n)return Ifi(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=r,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(r,e.moduleVersion)):r;let c=e.files??[],l=V8.normalize(n);return c.filter(d=>d.name===l).filter(d=>Ifi(d.supportedVersions,s,e.includePrerelease)).reduce((d,f)=>(f.moduleExports=d,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:f.name,baseDir:o}),f.patch(d,e.moduleVersion)):d),r)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let r of e.files)r.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:r.name}),r.patch(r.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let r=a((c,l,u)=>{if(!u&&V8.isAbsolute(l)){let d=V8.parse(l);l=d.name,u=d.dir}return this._onRequire(e,c,l,u)},"hookFn"),n=a((c,l,u)=>this._onRequire(e,c,l,u),"onRequire"),o=V8.isAbsolute(e.name)?new wfi.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(o);let s=new xfi.Hook([e.name],{internals:!1},r);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let r of e.files)r.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:r.name}),r.unpatch(r.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};a(Ifi,"isSupported")});var _Oe,Pfi=Se(()=>{p();_Oe=require("path")});var Dfi=Se(()=>{p();kfi();Pfi()});var KAr=Se(()=>{p();Dfi()});var Iht,Nfi=Se(()=>{p();Iht=class{static{a(this,"InstrumentationNodeModuleDefinition")}name;supportedVersions;patch;unpatch;files;constructor(e,r,n,o,s){this.name=e,this.supportedVersions=r,this.patch=n,this.unpatch=o,this.files=s||[]}}});var xht,Mfi=Se(()=>{p();KAr();xht=class{static{a(this,"InstrumentationNodeModuleFile")}supportedVersions;patch;unpatch;name;constructor(e,r,n,o){this.supportedVersions=r,this.patch=n,this.unpatch=o,this.name=(0,_Oe.normalize)(e)}}});var JAr={};Ri(JAr,{InstrumentationBase:()=>M0e,InstrumentationNodeModuleDefinition:()=>Iht,InstrumentationNodeModuleFile:()=>xht,isWrapped:()=>Tht,registerInstrumentations:()=>idi,safeExecuteInTheMiddle:()=>Sfi,safeExecuteInTheMiddleAsync:()=>Tfi});var ZAr=Se(()=>{p();odi();KAr();Nfi();Mfi();zAr()});var Lfi=I(XAr=>{"use strict";p();Object.defineProperty(XAr,"__esModule",{value:!0});XAr.log=Sua;var Ofi=(v3(),Qa(hQ)),vua=require("node:os"),Cua=Ofi.__importDefault(require("node:util")),bua=Ofi.__importStar(require("node:process"));function Sua(t,...e){bua.stderr.write(`${Cua.default.format(t,...e)}${vua.EOL}`)}a(Sua,"log")});var qfi=I(iyr=>{"use strict";p();Object.defineProperty(iyr,"__esModule",{value:!0});var Tua=Lfi(),Bfi=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,Ffi,eyr=[],tyr=[],wht=[];Bfi&&ryr(Bfi);var Ufi=Object.assign(t=>Qfi(t),{enable:ryr,enabled:nyr,disable:Iua,log:Tua.log});function ryr(t){Ffi=t,eyr=[],tyr=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?tyr.push(new RegExp(`^${n.substr(1)}$`)):eyr.push(new RegExp(`^${n}$`));for(let n of wht)n.enabled=nyr(n.namespace)}a(ryr,"enable");function nyr(t){if(t.endsWith("*"))return!0;for(let e of tyr)if(e.test(t))return!1;for(let e of eyr)if(e.test(t))return!0;return!1}a(nyr,"enabled");function Iua(){let t=Ffi||"";return ryr(""),t}a(Iua,"disable");function Qfi(t){let e=Object.assign(r,{enabled:nyr(t),destroy:xua,log:Ufi.log,namespace:t,extend:wua});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),wht.push(e),e}a(Qfi,"createDebugger");function xua(){let t=wht.indexOf(this);return t>=0?(wht.splice(t,1),!0):!1}a(xua,"destroy");function wua(t){let e=Qfi(`${this.namespace}:${t}`);return e.log=this.log,e}a(wua,"extend");iyr.default=Ufi});var Dht=I(x4=>{"use strict";p();Object.defineProperty(x4,"__esModule",{value:!0});x4.AzureLogger=void 0;x4.setLogLevel=Gfi;x4.getLogLevel=kua;x4.createClientLogger=Pua;var Rua=(v3(),Qa(hQ)),vOe=Rua.__importDefault(qfi()),Hfi=new Set,Rht=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,Pht;x4.AzureLogger=(0,vOe.default)("azure");x4.AzureLogger.log=(...t)=>{vOe.default.log(...t)};var oyr=["verbose","info","warning","error"];Rht&&(Wfi(Rht)?Gfi(Rht):console.error(`AZURE_LOG_LEVEL set to unknown log level '${Rht}'; logging is not enabled. Acceptable values: ${oyr.join(", ")}.`));function Gfi(t){if(t&&!Wfi(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${oyr.join(",")}`);Pht=t;let e=[];for(let r of Hfi)Vfi(r)&&e.push(r.namespace);vOe.default.enable(e.join(","))}a(Gfi,"setLogLevel");function kua(){return Pht}a(kua,"getLogLevel");var jfi={verbose:400,info:300,warning:200,error:100};function Pua(t){let e=x4.AzureLogger.extend(t);return $fi(x4.AzureLogger,e),{error:kht(e,"error"),warning:kht(e,"warning"),info:kht(e,"info"),verbose:kht(e,"verbose")}}a(Pua,"createClientLogger");function $fi(t,e){e.log=(...r)=>{t.log(...r)}}a($fi,"patchLogMethod");function kht(t,e){let r=Object.assign(t.extend(e),{level:e});if($fi(t,r),Vfi(r)){let n=vOe.default.disable();vOe.default.enable(n+","+r.namespace)}return Hfi.add(r),r}a(kht,"createLogger");function Vfi(t){return!!(Pht&&jfi[t.level]<=jfi[Pht])}a(Vfi,"shouldEnable");function Wfi(t){return oyr.includes(t)}a(Wfi,"isAzureLogLevel")});var syr=I(Nht=>{"use strict";p();Object.defineProperty(Nht,"__esModule",{value:!0});Nht.logger=void 0;var Dua=Dht();Nht.logger=(0,Dua.createClientLogger)("opentelemetry-instrumentation-azure-sdk")});function Mht(t){return t.setValue(ayr,!0)}function zfi(t){return t.deleteValue(ayr)}function O0e(t){return t.getValue(ayr)===!0}var ayr,COe=Se(()=>{p();po();ayr=Fb("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(Mht,"suppressTracing");a(zfi,"unsuppressTracing");a(O0e,"isTracingSuppressed")});var Oht,Yfi=Se(()=>{p();Oht="baggage"});function Jfi(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?",":""}${r}`;return n.length>8192?e:n},"")}function Zfi(t){return t.getAllEntries().map(([e,r])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=";"+r.metadata.toString()),n})}function cyr(t){let e=t.split(";");if(e.length<=0)return;let r=e.shift();if(!r)return;let n=r.indexOf("=");if(n<=0)return;let o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=l0e(e.join(";"))),{key:o,value:s,metadata:c}}function Xfi(t){let e={};return typeof t=="string"&&t.length>0&&t.split(",").forEach(r=>{let n=cyr(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var lyr=Se(()=>{p();po();a(Jfi,"serializeKeyPairs");a(Zfi,"getKeyPairs");a(cyr,"parsePairKeyValue");a(Xfi,"parseKeyPairsIntoRecord")});var Bht,epi=Se(()=>{p();po();COe();Yfi();lyr();Bht=class{static{a(this,"W3CBaggagePropagator")}inject(e,r,n){let o=YT.getBaggage(e);if(!o||O0e(e))return;let s=Zfi(o).filter(l=>l.length<=4096).slice(0,180),c=Jfi(s);c.length>0&&n.set(r,Oht,c)}extract(e,r,n){let o=n.get(r,Oht),s=Array.isArray(o)?o.join(","):o;if(!s)return e;let c={};return s.length===0||(s.split(",").forEach(u=>{let d=cyr(u);if(d){let f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0)?e:YT.setBaggage(e,YT.createBaggage(c))}fields(){return[Oht]}}});var Fht,tpi=Se(()=>{p();Fht=class{static{a(this,"AnchoredClock")}_monotonicClock;_epochMillis;_performanceMillis;constructor(e,r){this._monotonicClock=r,this._epochMillis=e.now(),this._performanceMillis=r.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function rpi(t){let e={};if(typeof t!="object"||t==null)return e;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(!Oua(r)){Dn.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!uyr(n)){Dn.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function Oua(t){return typeof t=="string"&&t!==""}function uyr(t){return t==null?!0:Array.isArray(t)?Lua(t):npi(typeof t)}function Lua(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(npi(n)){e=n;continue}return!1}return!1}}return!0}function npi(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var ipi=Se(()=>{p();po();a(rpi,"sanitizeAttributes");a(Oua,"isAttributeKey");a(uyr,"isAttributeValue");a(Lua,"isHomogeneousAttributeValueArray");a(npi,"isValidPrimitiveAttributeValueType")});function Uht(){return t=>{Dn.error(Bua(t))}}function Bua(t){return typeof t=="string"?t:JSON.stringify(Fua(t))}function Fua(t){let e={},r=t;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(e[n])return;let o=r[n];o&&(e[n]=String(o))}),r=Object.getPrototypeOf(r);return e}var dyr=Se(()=>{p();po();a(Uht,"loggingErrorHandler");a(Bua,"stringifyException");a(Fua,"flattenException")});function spi(t){opi=t}function api(t){try{opi(t)}catch{}}var opi,cpi=Se(()=>{p();dyr();opi=Uht();a(spi,"setGlobalErrorHandler");a(api,"globalErrorHandler")});function Qht(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){Dn.warn(`Unknown value ${(0,fyr.inspect)(e)} for ${t}, expected a number, using defaults`);return}return r}function bOe(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function qht(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||Dn.warn(`Unknown value ${(0,fyr.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function jht(t){return bOe(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var fyr,lpi=Se(()=>{p();po();fyr=require("util");a(Qht,"getNumberFromEnv");a(bOe,"getStringFromEnv");a(qht,"getBooleanFromEnv");a(jht,"getStringListFromEnv")});var Hht,upi=Se(()=>{p();Hht=typeof globalThis=="object"?globalThis:global});var dpi,EG,fpi=Se(()=>{p();dpi=require("perf_hooks"),EG=dpi.performance});var ppi,hpi=Se(()=>{p();ppi="2.2.0"});function mh(t){let e={},r=t.length;for(let n=0;n{p();a(mh,"createConstMap")});var mpi,gpi,Api,ypi,Epi,_pi,vpi,Cpi,bpi,Spi,Tpi,Ipi,xpi,wpi,Rpi,kpi,Ppi,Dpi,Npi,Mpi,Opi,Lpi,Bpi,Fpi,Upi,Qpi,qpi,jpi,Hpi,Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi,Jpi,Zpi,Xpi,ehi,thi,rhi,nhi,ihi,ohi,shi,ahi,chi,lhi,uhi,dhi,fhi,phi,hhi,mhi,ghi,Ahi,yhi,Ehi,_hi,vhi,Chi,bhi,Shi,Thi,Ihi,xhi,whi,Rhi,khi,Phi,Dhi,Nhi,Mhi,Ohi,Lhi,Bhi,Fhi,Uhi,Qhi,qhi,jhi,Hhi,Ghi,$hi,Vhi,Whi,zhi,Yhi,Khi,Jhi,Zhi,Xhi,emi,tmi,rmi,nmi,imi,omi,smi,ami,cmi,lmi,umi,dmi,fmi,pmi,hmi,mmi,gmi,Ami,ymi,Emi,_mi,vmi,Cmi,bmi,Smi,Tmi,Imi,xmi,wmi,Rmi,kmi,Pmi,Dmi,Nmi,Mmi,Uua,Qua,qua,jua,Hua,Gua,$ua,Vua,Wua,zua,Yua,Kua,Jua,Zua,Xua,eda,tda,rda,nda,ida,oda,sda,ada,cda,lda,uda,dda,fda,pda,hda,mda,gda,Ada,yda,Eda,_da,vda,Cda,bda,Sda,Tda,Ida,xda,wda,Rda,kda,Pda,Dda,Nda,Mda,Oda,Lda,Bda,Fda,Uda,Qda,qda,jda,Hda,Gda,$da,Vda,Wda,zda,Yda,Kda,Jda,Zda,Xda,efa,tfa,rfa,nfa,ifa,ofa,sfa,afa,cfa,lfa,ufa,dfa,ffa,pfa,hfa,mfa,gfa,Afa,yfa,Efa,_fa,vfa,Cfa,bfa,Sfa,Tfa,Ifa,xfa,wfa,Rfa,kfa,Pfa,Dfa,Nfa,Mfa,Ofa,Lfa,Bfa,Ffa,Ufa,Qfa,qfa,jfa,Hfa,Gfa,$fa,Vfa,Wfa,zfa,Yfa,Kfa,Jfa,Zfa,Xfa,epa,tpa,rpa,npa,ipa,opa,Omi,Lmi,Bmi,Fmi,Umi,Qmi,qmi,jmi,Hmi,Gmi,$mi,Vmi,Wmi,zmi,Ymi,Kmi,Jmi,Zmi,Xmi,e0i,t0i,r0i,n0i,i0i,o0i,s0i,a0i,c0i,l0i,u0i,d0i,f0i,p0i,h0i,m0i,g0i,A0i,y0i,E0i,_0i,v0i,C0i,b0i,S0i,T0i,I0i,x0i,spa,apa,cpa,lpa,upa,dpa,fpa,ppa,hpa,mpa,gpa,Apa,ypa,Epa,_pa,vpa,Cpa,bpa,Spa,Tpa,Ipa,xpa,wpa,Rpa,kpa,Ppa,Dpa,Npa,Mpa,Opa,Lpa,Bpa,Fpa,Upa,Qpa,qpa,jpa,Hpa,Gpa,$pa,Vpa,Wpa,zpa,Ypa,Kpa,Jpa,Zpa,Xpa,w0i,R0i,k0i,P0i,D0i,N0i,M0i,O0i,L0i,B0i,F0i,eha,tha,rha,nha,iha,oha,sha,aha,cha,lha,uha,dha,U0i,Q0i,q0i,j0i,H0i,fha,pha,hha,mha,gha,Aha,G0i,$0i,V0i,yha,Eha,_ha,vha,W0i,z0i,Y0i,K0i,Cha,bha,Sha,Tha,Iha,J0i,Z0i,X0i,egi,tgi,rgi,ngi,xha,wha,Rha,kha,Pha,Dha,Nha,Mha,igi,ogi,sgi,agi,cgi,Oha,Lha,Bha,Fha,Uha,Qha,lgi,ugi,dgi,fgi,pgi,hgi,mgi,ggi,Agi,ygi,Egi,_gi,vgi,Cgi,bgi,Sgi,Tgi,Igi,xgi,wgi,Rgi,qha,jha,Hha,Gha,$ha,Vha,Wha,zha,Yha,Kha,Jha,Zha,Xha,ema,tma,rma,nma,ima,oma,sma,ama,cma,kgi,Pgi,Dgi,Ngi,Mgi,lma,uma,dma,fma,pma,hma,Ogi,Lgi,mma,gma,Ama,Bgi,Fgi,yma,Ema,_ma,Ugi,Qgi,qgi,jgi,Hgi,Ggi,$gi,Vgi,Wgi,zgi,Ygi,Kgi,Jgi,Zgi,Xgi,eAi,tAi,vma,Cma,bma,Sma,Tma,Ima,xma,wma,Rma,kma,Pma,Dma,Nma,Mma,Oma,Lma,Bma,Fma,rAi,nAi,Uma,Qma,qma,iAi=Se(()=>{p();pyr();mpi="aws.lambda.invoked_arn",gpi="db.system",Api="db.connection_string",ypi="db.user",Epi="db.jdbc.driver_classname",_pi="db.name",vpi="db.statement",Cpi="db.operation",bpi="db.mssql.instance_name",Spi="db.cassandra.keyspace",Tpi="db.cassandra.page_size",Ipi="db.cassandra.consistency_level",xpi="db.cassandra.table",wpi="db.cassandra.idempotence",Rpi="db.cassandra.speculative_execution_count",kpi="db.cassandra.coordinator.id",Ppi="db.cassandra.coordinator.dc",Dpi="db.hbase.namespace",Npi="db.redis.database_index",Mpi="db.mongodb.collection",Opi="db.sql.table",Lpi="exception.type",Bpi="exception.message",Fpi="exception.stacktrace",Upi="exception.escaped",Qpi="faas.trigger",qpi="faas.execution",jpi="faas.document.collection",Hpi="faas.document.operation",Gpi="faas.document.time",$pi="faas.document.name",Vpi="faas.time",Wpi="faas.cron",zpi="faas.coldstart",Ypi="faas.invoked_name",Kpi="faas.invoked_provider",Jpi="faas.invoked_region",Zpi="net.transport",Xpi="net.peer.ip",ehi="net.peer.port",thi="net.peer.name",rhi="net.host.ip",nhi="net.host.port",ihi="net.host.name",ohi="net.host.connection.type",shi="net.host.connection.subtype",ahi="net.host.carrier.name",chi="net.host.carrier.mcc",lhi="net.host.carrier.mnc",uhi="net.host.carrier.icc",dhi="peer.service",fhi="enduser.id",phi="enduser.role",hhi="enduser.scope",mhi="thread.id",ghi="thread.name",Ahi="code.function",yhi="code.namespace",Ehi="code.filepath",_hi="code.lineno",vhi="http.method",Chi="http.url",bhi="http.target",Shi="http.host",Thi="http.scheme",Ihi="http.status_code",xhi="http.flavor",whi="http.user_agent",Rhi="http.request_content_length",khi="http.request_content_length_uncompressed",Phi="http.response_content_length",Dhi="http.response_content_length_uncompressed",Nhi="http.server_name",Mhi="http.route",Ohi="http.client_ip",Lhi="aws.dynamodb.table_names",Bhi="aws.dynamodb.consumed_capacity",Fhi="aws.dynamodb.item_collection_metrics",Uhi="aws.dynamodb.provisioned_read_capacity",Qhi="aws.dynamodb.provisioned_write_capacity",qhi="aws.dynamodb.consistent_read",jhi="aws.dynamodb.projection",Hhi="aws.dynamodb.limit",Ghi="aws.dynamodb.attributes_to_get",$hi="aws.dynamodb.index_name",Vhi="aws.dynamodb.select",Whi="aws.dynamodb.global_secondary_indexes",zhi="aws.dynamodb.local_secondary_indexes",Yhi="aws.dynamodb.exclusive_start_table",Khi="aws.dynamodb.table_count",Jhi="aws.dynamodb.scan_forward",Zhi="aws.dynamodb.segment",Xhi="aws.dynamodb.total_segments",emi="aws.dynamodb.count",tmi="aws.dynamodb.scanned_count",rmi="aws.dynamodb.attribute_definitions",nmi="aws.dynamodb.global_secondary_index_updates",imi="messaging.system",omi="messaging.destination",smi="messaging.destination_kind",ami="messaging.temp_destination",cmi="messaging.protocol",lmi="messaging.protocol_version",umi="messaging.url",dmi="messaging.message_id",fmi="messaging.conversation_id",pmi="messaging.message_payload_size_bytes",hmi="messaging.message_payload_compressed_size_bytes",mmi="messaging.operation",gmi="messaging.consumer_id",Ami="messaging.rabbitmq.routing_key",ymi="messaging.kafka.message_key",Emi="messaging.kafka.consumer_group",_mi="messaging.kafka.client_id",vmi="messaging.kafka.partition",Cmi="messaging.kafka.tombstone",bmi="rpc.system",Smi="rpc.service",Tmi="rpc.method",Imi="rpc.grpc.status_code",xmi="rpc.jsonrpc.version",wmi="rpc.jsonrpc.request_id",Rmi="rpc.jsonrpc.error_code",kmi="rpc.jsonrpc.error_message",Pmi="message.type",Dmi="message.id",Nmi="message.compressed_size",Mmi="message.uncompressed_size",Uua=mpi,Qua=gpi,qua=Api,jua=ypi,Hua=Epi,Gua=_pi,$ua=vpi,Vua=Cpi,Wua=bpi,zua=Spi,Yua=Tpi,Kua=Ipi,Jua=xpi,Zua=wpi,Xua=Rpi,eda=kpi,tda=Ppi,rda=Dpi,nda=Npi,ida=Mpi,oda=Opi,sda=Lpi,ada=Bpi,cda=Fpi,lda=Upi,uda=Qpi,dda=qpi,fda=jpi,pda=Hpi,hda=Gpi,mda=$pi,gda=Vpi,Ada=Wpi,yda=zpi,Eda=Ypi,_da=Kpi,vda=Jpi,Cda=Zpi,bda=Xpi,Sda=ehi,Tda=thi,Ida=rhi,xda=nhi,wda=ihi,Rda=ohi,kda=shi,Pda=ahi,Dda=chi,Nda=lhi,Mda=uhi,Oda=dhi,Lda=fhi,Bda=phi,Fda=hhi,Uda=mhi,Qda=ghi,qda=Ahi,jda=yhi,Hda=Ehi,Gda=_hi,$da=vhi,Vda=Chi,Wda=bhi,zda=Shi,Yda=Thi,Kda=Ihi,Jda=xhi,Zda=whi,Xda=Rhi,efa=khi,tfa=Phi,rfa=Dhi,nfa=Nhi,ifa=Mhi,ofa=Ohi,sfa=Lhi,afa=Bhi,cfa=Fhi,lfa=Uhi,ufa=Qhi,dfa=qhi,ffa=jhi,pfa=Hhi,hfa=Ghi,mfa=$hi,gfa=Vhi,Afa=Whi,yfa=zhi,Efa=Yhi,_fa=Khi,vfa=Jhi,Cfa=Zhi,bfa=Xhi,Sfa=emi,Tfa=tmi,Ifa=rmi,xfa=nmi,wfa=imi,Rfa=omi,kfa=smi,Pfa=ami,Dfa=cmi,Nfa=lmi,Mfa=umi,Ofa=dmi,Lfa=fmi,Bfa=pmi,Ffa=hmi,Ufa=mmi,Qfa=gmi,qfa=Ami,jfa=ymi,Hfa=Emi,Gfa=_mi,$fa=vmi,Vfa=Cmi,Wfa=bmi,zfa=Smi,Yfa=Tmi,Kfa=Imi,Jfa=xmi,Zfa=wmi,Xfa=Rmi,epa=kmi,tpa=Pmi,rpa=Dmi,npa=Nmi,ipa=Mmi,opa=mh([mpi,gpi,Api,ypi,Epi,_pi,vpi,Cpi,bpi,Spi,Tpi,Ipi,xpi,wpi,Rpi,kpi,Ppi,Dpi,Npi,Mpi,Opi,Lpi,Bpi,Fpi,Upi,Qpi,qpi,jpi,Hpi,Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi,Jpi,Zpi,Xpi,ehi,thi,rhi,nhi,ihi,ohi,shi,ahi,chi,lhi,uhi,dhi,fhi,phi,hhi,mhi,ghi,Ahi,yhi,Ehi,_hi,vhi,Chi,bhi,Shi,Thi,Ihi,xhi,whi,Rhi,khi,Phi,Dhi,Nhi,Mhi,Ohi,Lhi,Bhi,Fhi,Uhi,Qhi,qhi,jhi,Hhi,Ghi,$hi,Vhi,Whi,zhi,Yhi,Khi,Jhi,Zhi,Xhi,emi,tmi,rmi,nmi,imi,omi,smi,ami,cmi,lmi,umi,dmi,fmi,pmi,hmi,mmi,gmi,Ami,ymi,Emi,_mi,vmi,Cmi,bmi,Smi,Tmi,Imi,xmi,wmi,Rmi,kmi,Pmi,Dmi,Nmi,Mmi]),Omi="other_sql",Lmi="mssql",Bmi="mysql",Fmi="oracle",Umi="db2",Qmi="postgresql",qmi="redshift",jmi="hive",Hmi="cloudscape",Gmi="hsqldb",$mi="progress",Vmi="maxdb",Wmi="hanadb",zmi="ingres",Ymi="firstsql",Kmi="edb",Jmi="cache",Zmi="adabas",Xmi="firebird",e0i="derby",t0i="filemaker",r0i="informix",n0i="instantdb",i0i="interbase",o0i="mariadb",s0i="netezza",a0i="pervasive",c0i="pointbase",l0i="sqlite",u0i="sybase",d0i="teradata",f0i="vertica",p0i="h2",h0i="coldfusion",m0i="cassandra",g0i="hbase",A0i="mongodb",y0i="redis",E0i="couchbase",_0i="couchdb",v0i="cosmosdb",C0i="dynamodb",b0i="neo4j",S0i="geode",T0i="elasticsearch",I0i="memcached",x0i="cockroachdb",spa=Omi,apa=Lmi,cpa=Bmi,lpa=Fmi,upa=Umi,dpa=Qmi,fpa=qmi,ppa=jmi,hpa=Hmi,mpa=Gmi,gpa=$mi,Apa=Vmi,ypa=Wmi,Epa=zmi,_pa=Ymi,vpa=Kmi,Cpa=Jmi,bpa=Zmi,Spa=Xmi,Tpa=e0i,Ipa=t0i,xpa=r0i,wpa=n0i,Rpa=i0i,kpa=o0i,Ppa=s0i,Dpa=a0i,Npa=c0i,Mpa=l0i,Opa=u0i,Lpa=d0i,Bpa=f0i,Fpa=p0i,Upa=h0i,Qpa=m0i,qpa=g0i,jpa=A0i,Hpa=y0i,Gpa=E0i,$pa=_0i,Vpa=v0i,Wpa=C0i,zpa=b0i,Ypa=S0i,Kpa=T0i,Jpa=I0i,Zpa=x0i,Xpa=mh([Omi,Lmi,Bmi,Fmi,Umi,Qmi,qmi,jmi,Hmi,Gmi,$mi,Vmi,Wmi,zmi,Ymi,Kmi,Jmi,Zmi,Xmi,e0i,t0i,r0i,n0i,i0i,o0i,s0i,a0i,c0i,l0i,u0i,d0i,f0i,p0i,h0i,m0i,g0i,A0i,y0i,E0i,_0i,v0i,C0i,b0i,S0i,T0i,I0i,x0i]),w0i="all",R0i="each_quorum",k0i="quorum",P0i="local_quorum",D0i="one",N0i="two",M0i="three",O0i="local_one",L0i="any",B0i="serial",F0i="local_serial",eha=w0i,tha=R0i,rha=k0i,nha=P0i,iha=D0i,oha=N0i,sha=M0i,aha=O0i,cha=L0i,lha=B0i,uha=F0i,dha=mh([w0i,R0i,k0i,P0i,D0i,N0i,M0i,O0i,L0i,B0i,F0i]),U0i="datasource",Q0i="http",q0i="pubsub",j0i="timer",H0i="other",fha=U0i,pha=Q0i,hha=q0i,mha=j0i,gha=H0i,Aha=mh([U0i,Q0i,q0i,j0i,H0i]),G0i="insert",$0i="edit",V0i="delete",yha=G0i,Eha=$0i,_ha=V0i,vha=mh([G0i,$0i,V0i]),W0i="alibaba_cloud",z0i="aws",Y0i="azure",K0i="gcp",Cha=W0i,bha=z0i,Sha=Y0i,Tha=K0i,Iha=mh([W0i,z0i,Y0i,K0i]),J0i="ip_tcp",Z0i="ip_udp",X0i="ip",egi="unix",tgi="pipe",rgi="inproc",ngi="other",xha=J0i,wha=Z0i,Rha=X0i,kha=egi,Pha=tgi,Dha=rgi,Nha=ngi,Mha=mh([J0i,Z0i,X0i,egi,tgi,rgi,ngi]),igi="wifi",ogi="wired",sgi="cell",agi="unavailable",cgi="unknown",Oha=igi,Lha=ogi,Bha=sgi,Fha=agi,Uha=cgi,Qha=mh([igi,ogi,sgi,agi,cgi]),lgi="gprs",ugi="edge",dgi="umts",fgi="cdma",pgi="evdo_0",hgi="evdo_a",mgi="cdma2000_1xrtt",ggi="hsdpa",Agi="hsupa",ygi="hspa",Egi="iden",_gi="evdo_b",vgi="lte",Cgi="ehrpd",bgi="hspap",Sgi="gsm",Tgi="td_scdma",Igi="iwlan",xgi="nr",wgi="nrnsa",Rgi="lte_ca",qha=lgi,jha=ugi,Hha=dgi,Gha=fgi,$ha=pgi,Vha=hgi,Wha=mgi,zha=ggi,Yha=Agi,Kha=ygi,Jha=Egi,Zha=_gi,Xha=vgi,ema=Cgi,tma=bgi,rma=Sgi,nma=Tgi,ima=Igi,oma=xgi,sma=wgi,ama=Rgi,cma=mh([lgi,ugi,dgi,fgi,pgi,hgi,mgi,ggi,Agi,ygi,Egi,_gi,vgi,Cgi,bgi,Sgi,Tgi,Igi,xgi,wgi,Rgi]),kgi="1.0",Pgi="1.1",Dgi="2.0",Ngi="SPDY",Mgi="QUIC",lma=kgi,uma=Pgi,dma=Dgi,fma=Ngi,pma=Mgi,hma={HTTP_1_0:kgi,HTTP_1_1:Pgi,HTTP_2_0:Dgi,SPDY:Ngi,QUIC:Mgi},Ogi="queue",Lgi="topic",mma=Ogi,gma=Lgi,Ama=mh([Ogi,Lgi]),Bgi="receive",Fgi="process",yma=Bgi,Ema=Fgi,_ma=mh([Bgi,Fgi]),Ugi=0,Qgi=1,qgi=2,jgi=3,Hgi=4,Ggi=5,$gi=6,Vgi=7,Wgi=8,zgi=9,Ygi=10,Kgi=11,Jgi=12,Zgi=13,Xgi=14,eAi=15,tAi=16,vma=Ugi,Cma=Qgi,bma=qgi,Sma=jgi,Tma=Hgi,Ima=Ggi,xma=$gi,wma=Vgi,Rma=Wgi,kma=zgi,Pma=Ygi,Dma=Kgi,Nma=Jgi,Mma=Zgi,Oma=Xgi,Lma=eAi,Bma=tAi,Fma={OK:Ugi,CANCELLED:Qgi,UNKNOWN:qgi,INVALID_ARGUMENT:jgi,DEADLINE_EXCEEDED:Hgi,NOT_FOUND:Ggi,ALREADY_EXISTS:$gi,PERMISSION_DENIED:Vgi,RESOURCE_EXHAUSTED:Wgi,FAILED_PRECONDITION:zgi,ABORTED:Ygi,OUT_OF_RANGE:Kgi,UNIMPLEMENTED:Jgi,INTERNAL:Zgi,UNAVAILABLE:Xgi,DATA_LOSS:eAi,UNAUTHENTICATED:tAi},rAi="SENT",nAi="RECEIVED",Uma=rAi,Qma=nAi,qma=mh([rAi,nAi])});var oAi=Se(()=>{p();iAi()});var sAi,aAi,cAi,lAi,uAi,dAi,fAi,pAi,hAi,mAi,gAi,AAi,yAi,EAi,_Ai,vAi,CAi,bAi,SAi,TAi,IAi,xAi,wAi,RAi,kAi,PAi,DAi,NAi,MAi,OAi,LAi,BAi,FAi,UAi,QAi,qAi,jAi,HAi,GAi,$Ai,VAi,WAi,zAi,YAi,KAi,JAi,ZAi,XAi,eyi,tyi,ryi,nyi,iyi,oyi,syi,ayi,cyi,lyi,uyi,dyi,fyi,pyi,hyi,myi,gyi,Ayi,yyi,Eyi,_yi,vyi,Cyi,byi,Syi,Tyi,Iyi,xyi,wyi,Ryi,kyi,Pyi,Dyi,jma,Hma,Gma,$ma,Vma,Wma,zma,Yma,Kma,Jma,Zma,Xma,e0a,t0a,r0a,n0a,i0a,o0a,s0a,a0a,c0a,l0a,u0a,d0a,f0a,p0a,h0a,m0a,g0a,A0a,y0a,E0a,_0a,v0a,C0a,b0a,S0a,T0a,I0a,x0a,w0a,R0a,k0a,P0a,D0a,N0a,M0a,O0a,L0a,B0a,F0a,U0a,Q0a,q0a,j0a,H0a,G0a,$0a,V0a,W0a,z0a,Y0a,K0a,J0a,Z0a,X0a,ega,tga,rga,nga,iga,oga,sga,aga,cga,lga,uga,dga,fga,pga,hga,mga,Nyi,Myi,Oyi,Lyi,gga,Aga,yga,Ega,_ga,Byi,Fyi,Uyi,Qyi,qyi,jyi,Hyi,Gyi,$yi,Vyi,Wyi,zyi,Yyi,Kyi,Jyi,Zyi,Xyi,vga,Cga,bga,Sga,Tga,Iga,xga,wga,Rga,kga,Pga,Dga,Nga,Mga,Oga,Lga,Bga,Fga,eEi,tEi,Uga,Qga,qga,rEi,nEi,iEi,oEi,sEi,aEi,cEi,jga,Hga,Gga,$ga,Vga,Wga,zga,Yga,lEi,uEi,dEi,fEi,pEi,hEi,mEi,gEi,AEi,yEi,EEi,Kga,Jga,Zga,Xga,eAa,tAa,rAa,nAa,iAa,oAa,sAa,aAa,_Ei,vEi,CEi,bEi,SEi,TEi,IEi,xEi,wEi,REi,cAa,lAa,uAa,dAa,fAa,pAa,hAa,mAa,gAa,AAa,yAa,kEi=Se(()=>{p();pyr();sAi="cloud.provider",aAi="cloud.account.id",cAi="cloud.region",lAi="cloud.availability_zone",uAi="cloud.platform",dAi="aws.ecs.container.arn",fAi="aws.ecs.cluster.arn",pAi="aws.ecs.launchtype",hAi="aws.ecs.task.arn",mAi="aws.ecs.task.family",gAi="aws.ecs.task.revision",AAi="aws.eks.cluster.arn",yAi="aws.log.group.names",EAi="aws.log.group.arns",_Ai="aws.log.stream.names",vAi="aws.log.stream.arns",CAi="container.name",bAi="container.id",SAi="container.runtime",TAi="container.image.name",IAi="container.image.tag",xAi="deployment.environment",wAi="device.id",RAi="device.model.identifier",kAi="device.model.name",PAi="faas.name",DAi="faas.id",NAi="faas.version",MAi="faas.instance",OAi="faas.max_memory",LAi="host.id",BAi="host.name",FAi="host.type",UAi="host.arch",QAi="host.image.name",qAi="host.image.id",jAi="host.image.version",HAi="k8s.cluster.name",GAi="k8s.node.name",$Ai="k8s.node.uid",VAi="k8s.namespace.name",WAi="k8s.pod.uid",zAi="k8s.pod.name",YAi="k8s.container.name",KAi="k8s.replicaset.uid",JAi="k8s.replicaset.name",ZAi="k8s.deployment.uid",XAi="k8s.deployment.name",eyi="k8s.statefulset.uid",tyi="k8s.statefulset.name",ryi="k8s.daemonset.uid",nyi="k8s.daemonset.name",iyi="k8s.job.uid",oyi="k8s.job.name",syi="k8s.cronjob.uid",ayi="k8s.cronjob.name",cyi="os.type",lyi="os.description",uyi="os.name",dyi="os.version",fyi="process.pid",pyi="process.executable.name",hyi="process.executable.path",myi="process.command",gyi="process.command_line",Ayi="process.command_args",yyi="process.owner",Eyi="process.runtime.name",_yi="process.runtime.version",vyi="process.runtime.description",Cyi="service.name",byi="service.namespace",Syi="service.instance.id",Tyi="service.version",Iyi="telemetry.sdk.name",xyi="telemetry.sdk.language",wyi="telemetry.sdk.version",Ryi="telemetry.auto.version",kyi="webengine.name",Pyi="webengine.version",Dyi="webengine.description",jma=sAi,Hma=aAi,Gma=cAi,$ma=lAi,Vma=uAi,Wma=dAi,zma=fAi,Yma=pAi,Kma=hAi,Jma=mAi,Zma=gAi,Xma=AAi,e0a=yAi,t0a=EAi,r0a=_Ai,n0a=vAi,i0a=CAi,o0a=bAi,s0a=SAi,a0a=TAi,c0a=IAi,l0a=xAi,u0a=wAi,d0a=RAi,f0a=kAi,p0a=PAi,h0a=DAi,m0a=NAi,g0a=MAi,A0a=OAi,y0a=LAi,E0a=BAi,_0a=FAi,v0a=UAi,C0a=QAi,b0a=qAi,S0a=jAi,T0a=HAi,I0a=GAi,x0a=$Ai,w0a=VAi,R0a=WAi,k0a=zAi,P0a=YAi,D0a=KAi,N0a=JAi,M0a=ZAi,O0a=XAi,L0a=eyi,B0a=tyi,F0a=ryi,U0a=nyi,Q0a=iyi,q0a=oyi,j0a=syi,H0a=ayi,G0a=cyi,$0a=lyi,V0a=uyi,W0a=dyi,z0a=fyi,Y0a=pyi,K0a=hyi,J0a=myi,Z0a=gyi,X0a=Ayi,ega=yyi,tga=Eyi,rga=_yi,nga=vyi,iga=Cyi,oga=byi,sga=Syi,aga=Tyi,cga=Iyi,lga=xyi,uga=wyi,dga=Ryi,fga=kyi,pga=Pyi,hga=Dyi,mga=mh([sAi,aAi,cAi,lAi,uAi,dAi,fAi,pAi,hAi,mAi,gAi,AAi,yAi,EAi,_Ai,vAi,CAi,bAi,SAi,TAi,IAi,xAi,wAi,RAi,kAi,PAi,DAi,NAi,MAi,OAi,LAi,BAi,FAi,UAi,QAi,qAi,jAi,HAi,GAi,$Ai,VAi,WAi,zAi,YAi,KAi,JAi,ZAi,XAi,eyi,tyi,ryi,nyi,iyi,oyi,syi,ayi,cyi,lyi,uyi,dyi,fyi,pyi,hyi,myi,gyi,Ayi,yyi,Eyi,_yi,vyi,Cyi,byi,Syi,Tyi,Iyi,xyi,wyi,Ryi,kyi,Pyi,Dyi]),Nyi="alibaba_cloud",Myi="aws",Oyi="azure",Lyi="gcp",gga=Nyi,Aga=Myi,yga=Oyi,Ega=Lyi,_ga=mh([Nyi,Myi,Oyi,Lyi]),Byi="alibaba_cloud_ecs",Fyi="alibaba_cloud_fc",Uyi="aws_ec2",Qyi="aws_ecs",qyi="aws_eks",jyi="aws_lambda",Hyi="aws_elastic_beanstalk",Gyi="azure_vm",$yi="azure_container_instances",Vyi="azure_aks",Wyi="azure_functions",zyi="azure_app_service",Yyi="gcp_compute_engine",Kyi="gcp_cloud_run",Jyi="gcp_kubernetes_engine",Zyi="gcp_cloud_functions",Xyi="gcp_app_engine",vga=Byi,Cga=Fyi,bga=Uyi,Sga=Qyi,Tga=qyi,Iga=jyi,xga=Hyi,wga=Gyi,Rga=$yi,kga=Vyi,Pga=Wyi,Dga=zyi,Nga=Yyi,Mga=Kyi,Oga=Jyi,Lga=Zyi,Bga=Xyi,Fga=mh([Byi,Fyi,Uyi,Qyi,qyi,jyi,Hyi,Gyi,$yi,Vyi,Wyi,zyi,Yyi,Kyi,Jyi,Zyi,Xyi]),eEi="ec2",tEi="fargate",Uga=eEi,Qga=tEi,qga=mh([eEi,tEi]),rEi="amd64",nEi="arm32",iEi="arm64",oEi="ia64",sEi="ppc32",aEi="ppc64",cEi="x86",jga=rEi,Hga=nEi,Gga=iEi,$ga=oEi,Vga=sEi,Wga=aEi,zga=cEi,Yga=mh([rEi,nEi,iEi,oEi,sEi,aEi,cEi]),lEi="windows",uEi="linux",dEi="darwin",fEi="freebsd",pEi="netbsd",hEi="openbsd",mEi="dragonflybsd",gEi="hpux",AEi="aix",yEi="solaris",EEi="z_os",Kga=lEi,Jga=uEi,Zga=dEi,Xga=fEi,eAa=pEi,tAa=hEi,rAa=mEi,nAa=gEi,iAa=AEi,oAa=yEi,sAa=EEi,aAa=mh([lEi,uEi,dEi,fEi,pEi,hEi,mEi,gEi,AEi,yEi,EEi]),_Ei="cpp",vEi="dotnet",CEi="erlang",bEi="go",SEi="java",TEi="nodejs",IEi="php",xEi="python",wEi="ruby",REi="webjs",cAa=_Ei,lAa=vEi,uAa=CEi,dAa=bEi,fAa=SEi,pAa=TEi,hAa=IEi,mAa=xEi,gAa=wEi,AAa=REi,yAa=mh([_Ei,vEi,CEi,bEi,SEi,TEi,IEi,xEi,wEi,REi])});var PEi=Se(()=>{p();kEi()});var EAa,_Aa,vAa,CAa,bAa,SAa,TAa,IAa,xAa,wAa,RAa,kAa,PAa,DAa,NAa,MAa,OAa,LAa,BAa,FAa,UAa,QAa,qAa,jAa,HAa,GAa,$Aa,VAa,WAa,zAa,YAa,KAa,JAa,ZAa,XAa,eya,tya,rya,nya,iya,oya,sya,Zpp,Xpp,aya,cya,lya,uya,dya,fya,pya,hya,mya,gya,Aya,yya,Eya,_ya,vya,Cya,bya,Sya,Tya,Iya,xya,wya,Rya,kya,Pya,Dya,Nya,Mya,Oya,Lya,Bya,Fya,Uya,Qya,qya,jya,Hya,Gya,$ya,Vya,Wya,zya,Yya,Kya,Jya,Zya,Xya,eEa,tEa,rEa,nEa,iEa,oEa,sEa,aEa,cEa,lEa,uEa,dEa,fEa,pEa,hEa,mEa,gEa,AEa,yEa,EEa,_Ea,vEa,CEa,hyr,bEa,SEa,TEa,IEa,xEa,myr,wEa,REa,kEa,PEa,DEa,NEa,gyr,Ayr,MEa,OEa,LEa,BEa,FEa,UEa,DEi=Se(()=>{p();EAa="aspnetcore.diagnostics.exception.result",_Aa="aborted",vAa="handled",CAa="skipped",bAa="unhandled",SAa="aspnetcore.diagnostics.handler.type",TAa="aspnetcore.rate_limiting.policy",IAa="aspnetcore.rate_limiting.result",xAa="acquired",wAa="endpoint_limiter",RAa="global_limiter",kAa="request_canceled",PAa="aspnetcore.request.is_unhandled",DAa="aspnetcore.routing.is_fallback",NAa="aspnetcore.routing.match_status",MAa="failure",OAa="success",LAa="aspnetcore.user.is_authenticated",BAa="client.address",FAa="client.port",UAa="code.column.number",QAa="code.file.path",qAa="code.function.name",jAa="code.line.number",HAa="code.stacktrace",GAa="db.collection.name",$Aa="db.namespace",VAa="db.operation.batch.size",WAa="db.operation.name",zAa="db.query.summary",YAa="db.query.text",KAa="db.response.status_code",JAa="db.stored_procedure.name",ZAa="db.system.name",XAa="mariadb",eya="microsoft.sql_server",tya="mysql",rya="postgresql",nya="dotnet.gc.heap.generation",iya="gen0",oya="gen1",sya="gen2",Zpp="loh",Xpp="poh",aya="error.type",cya="_OTHER",lya="exception.escaped",uya="exception.message",dya="exception.stacktrace",fya="exception.type",pya=a(t=>`http.request.header.${t}`,"ATTR_HTTP_REQUEST_HEADER"),hya="http.request.method",mya="_OTHER",gya="CONNECT",Aya="DELETE",yya="GET",Eya="HEAD",_ya="OPTIONS",vya="PATCH",Cya="POST",bya="PUT",Sya="TRACE",Tya="http.request.method_original",Iya="http.request.resend_count",xya=a(t=>`http.response.header.${t}`,"ATTR_HTTP_RESPONSE_HEADER"),wya="http.response.status_code",Rya="http.route",kya="jvm.gc.action",Pya="jvm.gc.name",Dya="jvm.memory.pool.name",Nya="jvm.memory.type",Mya="heap",Oya="non_heap",Lya="jvm.thread.daemon",Bya="jvm.thread.state",Fya="blocked",Uya="new",Qya="runnable",qya="terminated",jya="timed_waiting",Hya="waiting",Gya="network.local.address",$ya="network.local.port",Vya="network.peer.address",Wya="network.peer.port",zya="network.protocol.name",Yya="network.protocol.version",Kya="network.transport",Jya="pipe",Zya="quic",Xya="tcp",eEa="udp",tEa="unix",rEa="network.type",nEa="ipv4",iEa="ipv6",oEa="otel.scope.name",sEa="otel.scope.version",aEa="otel.status_code",cEa="ERROR",lEa="OK",uEa="otel.status_description",dEa="server.address",fEa="server.port",pEa="service.name",hEa="service.version",mEa="signalr.connection.status",gEa="app_shutdown",AEa="normal_closure",yEa="timeout",EEa="signalr.transport",_Ea="long_polling",vEa="server_sent_events",CEa="web_sockets",hyr="telemetry.sdk.language",bEa="cpp",SEa="dotnet",TEa="erlang",IEa="go",xEa="java",myr="nodejs",wEa="php",REa="python",kEa="ruby",PEa="rust",DEa="swift",NEa="webjs",gyr="telemetry.sdk.name",Ayr="telemetry.sdk.version",MEa="url.fragment",OEa="url.full",LEa="url.path",BEa="url.query",FEa="url.scheme",UEa="user_agent.original"});var QEa,qEa,jEa,HEa,GEa,$Ea,VEa,WEa,zEa,YEa,KEa,JEa,ZEa,XEa,e_a,t_a,r_a,n_a,i_a,o_a,s_a,a_a,c_a,l_a,u_a,d_a,f_a,p_a,h_a,m_a,g_a,A_a,y_a,E_a,__a,v_a,C_a,b_a,S_a,T_a,I_a,x_a,w_a,R_a,k_a,P_a,D_a,N_a,M_a,O_a,L_a,NEi=Se(()=>{p();QEa="aspnetcore.diagnostics.exceptions",qEa="aspnetcore.rate_limiting.active_request_leases",jEa="aspnetcore.rate_limiting.queued_requests",HEa="aspnetcore.rate_limiting.request.time_in_queue",GEa="aspnetcore.rate_limiting.request_lease.duration",$Ea="aspnetcore.rate_limiting.requests",VEa="aspnetcore.routing.match_attempts",WEa="db.client.operation.duration",zEa="dotnet.assembly.count",YEa="dotnet.exceptions",KEa="dotnet.gc.collections",JEa="dotnet.gc.heap.total_allocated",ZEa="dotnet.gc.last_collection.heap.fragmentation.size",XEa="dotnet.gc.last_collection.heap.size",e_a="dotnet.gc.last_collection.memory.committed_size",t_a="dotnet.gc.pause.time",r_a="dotnet.jit.compilation.time",n_a="dotnet.jit.compiled_il.size",i_a="dotnet.jit.compiled_methods",o_a="dotnet.monitor.lock_contentions",s_a="dotnet.process.cpu.count",a_a="dotnet.process.cpu.time",c_a="dotnet.process.memory.working_set",l_a="dotnet.thread_pool.queue.length",u_a="dotnet.thread_pool.thread.count",d_a="dotnet.thread_pool.work_item.count",f_a="dotnet.timer.count",p_a="http.client.request.duration",h_a="http.server.request.duration",m_a="jvm.class.count",g_a="jvm.class.loaded",A_a="jvm.class.unloaded",y_a="jvm.cpu.count",E_a="jvm.cpu.recent_utilization",__a="jvm.cpu.time",v_a="jvm.gc.duration",C_a="jvm.memory.committed",b_a="jvm.memory.limit",S_a="jvm.memory.used",T_a="jvm.memory.used_after_last_gc",I_a="jvm.thread.count",x_a="kestrel.active_connections",w_a="kestrel.active_tls_handshakes",R_a="kestrel.connection.duration",k_a="kestrel.queued_connections",P_a="kestrel.queued_requests",D_a="kestrel.rejected_connections",N_a="kestrel.tls_handshake.duration",M_a="kestrel.upgraded_connections",O_a="signalr.server.active_connections",L_a="signalr.server.connection.duration"});var B_a,MEi=Se(()=>{p();B_a="exception"});var yyr={};Ri(yyr,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>_Aa,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>vAa,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>CAa,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>bAa,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>xAa,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>wAa,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>RAa,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>kAa,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>MAa,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>OAa,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>EAa,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>SAa,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>TAa,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>IAa,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>PAa,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>DAa,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>NAa,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>LAa,ATTR_CLIENT_ADDRESS:()=>BAa,ATTR_CLIENT_PORT:()=>FAa,ATTR_CODE_COLUMN_NUMBER:()=>UAa,ATTR_CODE_FILE_PATH:()=>QAa,ATTR_CODE_FUNCTION_NAME:()=>qAa,ATTR_CODE_LINE_NUMBER:()=>jAa,ATTR_CODE_STACKTRACE:()=>HAa,ATTR_DB_COLLECTION_NAME:()=>GAa,ATTR_DB_NAMESPACE:()=>$Aa,ATTR_DB_OPERATION_BATCH_SIZE:()=>VAa,ATTR_DB_OPERATION_NAME:()=>WAa,ATTR_DB_QUERY_SUMMARY:()=>zAa,ATTR_DB_QUERY_TEXT:()=>YAa,ATTR_DB_RESPONSE_STATUS_CODE:()=>KAa,ATTR_DB_STORED_PROCEDURE_NAME:()=>JAa,ATTR_DB_SYSTEM_NAME:()=>ZAa,ATTR_DOTNET_GC_HEAP_GENERATION:()=>nya,ATTR_ERROR_TYPE:()=>aya,ATTR_EXCEPTION_ESCAPED:()=>lya,ATTR_EXCEPTION_MESSAGE:()=>uya,ATTR_EXCEPTION_STACKTRACE:()=>dya,ATTR_EXCEPTION_TYPE:()=>fya,ATTR_HTTP_REQUEST_HEADER:()=>pya,ATTR_HTTP_REQUEST_METHOD:()=>hya,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>Tya,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>Iya,ATTR_HTTP_RESPONSE_HEADER:()=>xya,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>wya,ATTR_HTTP_ROUTE:()=>Rya,ATTR_JVM_GC_ACTION:()=>kya,ATTR_JVM_GC_NAME:()=>Pya,ATTR_JVM_MEMORY_POOL_NAME:()=>Dya,ATTR_JVM_MEMORY_TYPE:()=>Nya,ATTR_JVM_THREAD_DAEMON:()=>Lya,ATTR_JVM_THREAD_STATE:()=>Bya,ATTR_NETWORK_LOCAL_ADDRESS:()=>Gya,ATTR_NETWORK_LOCAL_PORT:()=>$ya,ATTR_NETWORK_PEER_ADDRESS:()=>Vya,ATTR_NETWORK_PEER_PORT:()=>Wya,ATTR_NETWORK_PROTOCOL_NAME:()=>zya,ATTR_NETWORK_PROTOCOL_VERSION:()=>Yya,ATTR_NETWORK_TRANSPORT:()=>Kya,ATTR_NETWORK_TYPE:()=>rEa,ATTR_OTEL_SCOPE_NAME:()=>oEa,ATTR_OTEL_SCOPE_VERSION:()=>sEa,ATTR_OTEL_STATUS_CODE:()=>aEa,ATTR_OTEL_STATUS_DESCRIPTION:()=>uEa,ATTR_SERVER_ADDRESS:()=>dEa,ATTR_SERVER_PORT:()=>fEa,ATTR_SERVICE_NAME:()=>pEa,ATTR_SERVICE_VERSION:()=>hEa,ATTR_SIGNALR_CONNECTION_STATUS:()=>mEa,ATTR_SIGNALR_TRANSPORT:()=>EEa,ATTR_TELEMETRY_SDK_LANGUAGE:()=>hyr,ATTR_TELEMETRY_SDK_NAME:()=>gyr,ATTR_TELEMETRY_SDK_VERSION:()=>Ayr,ATTR_URL_FRAGMENT:()=>MEa,ATTR_URL_FULL:()=>OEa,ATTR_URL_PATH:()=>LEa,ATTR_URL_QUERY:()=>BEa,ATTR_URL_SCHEME:()=>FEa,ATTR_USER_AGENT_ORIGINAL:()=>UEa,AWSECSLAUNCHTYPEVALUES_EC2:()=>Uga,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>Qga,AwsEcsLaunchtypeValues:()=>qga,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>vga,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>Cga,CLOUDPLATFORMVALUES_AWS_EC2:()=>bga,CLOUDPLATFORMVALUES_AWS_ECS:()=>Sga,CLOUDPLATFORMVALUES_AWS_EKS:()=>Tga,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>xga,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Iga,CLOUDPLATFORMVALUES_AZURE_AKS:()=>kga,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>Dga,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>Rga,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>Pga,CLOUDPLATFORMVALUES_AZURE_VM:()=>wga,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>Bga,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>Lga,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>Mga,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>Nga,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>Oga,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>gga,CLOUDPROVIDERVALUES_AWS:()=>Aga,CLOUDPROVIDERVALUES_AZURE:()=>yga,CLOUDPROVIDERVALUES_GCP:()=>Ega,CloudPlatformValues:()=>Fga,CloudProviderValues:()=>_ga,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>eha,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>cha,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>tha,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>aha,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>nha,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>uha,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>iha,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>rha,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>lha,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>sha,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>oha,DBSYSTEMVALUES_ADABAS:()=>bpa,DBSYSTEMVALUES_CACHE:()=>Cpa,DBSYSTEMVALUES_CASSANDRA:()=>Qpa,DBSYSTEMVALUES_CLOUDSCAPE:()=>hpa,DBSYSTEMVALUES_COCKROACHDB:()=>Zpa,DBSYSTEMVALUES_COLDFUSION:()=>Upa,DBSYSTEMVALUES_COSMOSDB:()=>Vpa,DBSYSTEMVALUES_COUCHBASE:()=>Gpa,DBSYSTEMVALUES_COUCHDB:()=>$pa,DBSYSTEMVALUES_DB2:()=>upa,DBSYSTEMVALUES_DERBY:()=>Tpa,DBSYSTEMVALUES_DYNAMODB:()=>Wpa,DBSYSTEMVALUES_EDB:()=>vpa,DBSYSTEMVALUES_ELASTICSEARCH:()=>Kpa,DBSYSTEMVALUES_FILEMAKER:()=>Ipa,DBSYSTEMVALUES_FIREBIRD:()=>Spa,DBSYSTEMVALUES_FIRSTSQL:()=>_pa,DBSYSTEMVALUES_GEODE:()=>Ypa,DBSYSTEMVALUES_H2:()=>Fpa,DBSYSTEMVALUES_HANADB:()=>ypa,DBSYSTEMVALUES_HBASE:()=>qpa,DBSYSTEMVALUES_HIVE:()=>ppa,DBSYSTEMVALUES_HSQLDB:()=>mpa,DBSYSTEMVALUES_INFORMIX:()=>xpa,DBSYSTEMVALUES_INGRES:()=>Epa,DBSYSTEMVALUES_INSTANTDB:()=>wpa,DBSYSTEMVALUES_INTERBASE:()=>Rpa,DBSYSTEMVALUES_MARIADB:()=>kpa,DBSYSTEMVALUES_MAXDB:()=>Apa,DBSYSTEMVALUES_MEMCACHED:()=>Jpa,DBSYSTEMVALUES_MONGODB:()=>jpa,DBSYSTEMVALUES_MSSQL:()=>apa,DBSYSTEMVALUES_MYSQL:()=>cpa,DBSYSTEMVALUES_NEO4J:()=>zpa,DBSYSTEMVALUES_NETEZZA:()=>Ppa,DBSYSTEMVALUES_ORACLE:()=>lpa,DBSYSTEMVALUES_OTHER_SQL:()=>spa,DBSYSTEMVALUES_PERVASIVE:()=>Dpa,DBSYSTEMVALUES_POINTBASE:()=>Npa,DBSYSTEMVALUES_POSTGRESQL:()=>dpa,DBSYSTEMVALUES_PROGRESS:()=>gpa,DBSYSTEMVALUES_REDIS:()=>Hpa,DBSYSTEMVALUES_REDSHIFT:()=>fpa,DBSYSTEMVALUES_SQLITE:()=>Mpa,DBSYSTEMVALUES_SYBASE:()=>Opa,DBSYSTEMVALUES_TERADATA:()=>Lpa,DBSYSTEMVALUES_VERTICA:()=>Bpa,DB_SYSTEM_NAME_VALUE_MARIADB:()=>XAa,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>eya,DB_SYSTEM_NAME_VALUE_MYSQL:()=>tya,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>rya,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>iya,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>oya,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>sya,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>Zpp,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>Xpp,DbCassandraConsistencyLevelValues:()=>dha,DbSystemValues:()=>Xpa,ERROR_TYPE_VALUE_OTHER:()=>cya,EVENT_EXCEPTION:()=>B_a,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>_ha,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>Eha,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>yha,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>Cha,FAASINVOKEDPROVIDERVALUES_AWS:()=>bha,FAASINVOKEDPROVIDERVALUES_AZURE:()=>Sha,FAASINVOKEDPROVIDERVALUES_GCP:()=>Tha,FAASTRIGGERVALUES_DATASOURCE:()=>fha,FAASTRIGGERVALUES_HTTP:()=>pha,FAASTRIGGERVALUES_OTHER:()=>gha,FAASTRIGGERVALUES_PUBSUB:()=>hha,FAASTRIGGERVALUES_TIMER:()=>mha,FaasDocumentOperationValues:()=>vha,FaasInvokedProviderValues:()=>Iha,FaasTriggerValues:()=>Aha,HOSTARCHVALUES_AMD64:()=>jga,HOSTARCHVALUES_ARM32:()=>Hga,HOSTARCHVALUES_ARM64:()=>Gga,HOSTARCHVALUES_IA64:()=>$ga,HOSTARCHVALUES_PPC32:()=>Vga,HOSTARCHVALUES_PPC64:()=>Wga,HOSTARCHVALUES_X86:()=>zga,HTTPFLAVORVALUES_HTTP_1_0:()=>lma,HTTPFLAVORVALUES_HTTP_1_1:()=>uma,HTTPFLAVORVALUES_HTTP_2_0:()=>dma,HTTPFLAVORVALUES_QUIC:()=>pma,HTTPFLAVORVALUES_SPDY:()=>fma,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>gya,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>Aya,HTTP_REQUEST_METHOD_VALUE_GET:()=>yya,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Eya,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>_ya,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>mya,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>vya,HTTP_REQUEST_METHOD_VALUE_POST:()=>Cya,HTTP_REQUEST_METHOD_VALUE_PUT:()=>bya,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>Sya,HostArchValues:()=>Yga,HttpFlavorValues:()=>hma,JVM_MEMORY_TYPE_VALUE_HEAP:()=>Mya,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>Oya,JVM_THREAD_STATE_VALUE_BLOCKED:()=>Fya,JVM_THREAD_STATE_VALUE_NEW:()=>Uya,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>Qya,JVM_THREAD_STATE_VALUE_TERMINATED:()=>qya,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>jya,JVM_THREAD_STATE_VALUE_WAITING:()=>Hya,MESSAGETYPEVALUES_RECEIVED:()=>Qma,MESSAGETYPEVALUES_SENT:()=>Uma,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>mma,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>gma,MESSAGINGOPERATIONVALUES_PROCESS:()=>Ema,MESSAGINGOPERATIONVALUES_RECEIVE:()=>yma,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>QEa,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>qEa,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>jEa,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>$Ea,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>GEa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>HEa,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>VEa,METRIC_DB_CLIENT_OPERATION_DURATION:()=>WEa,METRIC_DOTNET_ASSEMBLY_COUNT:()=>zEa,METRIC_DOTNET_EXCEPTIONS:()=>YEa,METRIC_DOTNET_GC_COLLECTIONS:()=>KEa,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>JEa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>ZEa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>XEa,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>e_a,METRIC_DOTNET_GC_PAUSE_TIME:()=>t_a,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>r_a,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>n_a,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>i_a,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>o_a,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>s_a,METRIC_DOTNET_PROCESS_CPU_TIME:()=>a_a,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>c_a,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>l_a,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>u_a,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>d_a,METRIC_DOTNET_TIMER_COUNT:()=>f_a,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>p_a,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>h_a,METRIC_JVM_CLASS_COUNT:()=>m_a,METRIC_JVM_CLASS_LOADED:()=>g_a,METRIC_JVM_CLASS_UNLOADED:()=>A_a,METRIC_JVM_CPU_COUNT:()=>y_a,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>E_a,METRIC_JVM_CPU_TIME:()=>__a,METRIC_JVM_GC_DURATION:()=>v_a,METRIC_JVM_MEMORY_COMMITTED:()=>C_a,METRIC_JVM_MEMORY_LIMIT:()=>b_a,METRIC_JVM_MEMORY_USED:()=>S_a,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>T_a,METRIC_JVM_THREAD_COUNT:()=>I_a,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>x_a,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>w_a,METRIC_KESTREL_CONNECTION_DURATION:()=>R_a,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>k_a,METRIC_KESTREL_QUEUED_REQUESTS:()=>P_a,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>D_a,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>N_a,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>M_a,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>O_a,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>L_a,MessageTypeValues:()=>qma,MessagingDestinationKindValues:()=>Ama,MessagingOperationValues:()=>_ma,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>Gha,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>Wha,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>jha,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>ema,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>$ha,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>Vha,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>Zha,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>qha,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>rma,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>zha,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>Kha,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>tma,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>Yha,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>Jha,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>ima,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>Xha,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>ama,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>oma,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>sma,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>nma,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>Hha,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>Bha,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>Fha,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>Uha,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>Oha,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>Lha,NETTRANSPORTVALUES_INPROC:()=>Dha,NETTRANSPORTVALUES_IP:()=>Rha,NETTRANSPORTVALUES_IP_TCP:()=>xha,NETTRANSPORTVALUES_IP_UDP:()=>wha,NETTRANSPORTVALUES_OTHER:()=>Nha,NETTRANSPORTVALUES_PIPE:()=>Pha,NETTRANSPORTVALUES_UNIX:()=>kha,NETWORK_TRANSPORT_VALUE_PIPE:()=>Jya,NETWORK_TRANSPORT_VALUE_QUIC:()=>Zya,NETWORK_TRANSPORT_VALUE_TCP:()=>Xya,NETWORK_TRANSPORT_VALUE_UDP:()=>eEa,NETWORK_TRANSPORT_VALUE_UNIX:()=>tEa,NETWORK_TYPE_VALUE_IPV4:()=>nEa,NETWORK_TYPE_VALUE_IPV6:()=>iEa,NetHostConnectionSubtypeValues:()=>cma,NetHostConnectionTypeValues:()=>Qha,NetTransportValues:()=>Mha,OSTYPEVALUES_AIX:()=>iAa,OSTYPEVALUES_DARWIN:()=>Zga,OSTYPEVALUES_DRAGONFLYBSD:()=>rAa,OSTYPEVALUES_FREEBSD:()=>Xga,OSTYPEVALUES_HPUX:()=>nAa,OSTYPEVALUES_LINUX:()=>Jga,OSTYPEVALUES_NETBSD:()=>eAa,OSTYPEVALUES_OPENBSD:()=>tAa,OSTYPEVALUES_SOLARIS:()=>oAa,OSTYPEVALUES_WINDOWS:()=>Kga,OSTYPEVALUES_Z_OS:()=>sAa,OTEL_STATUS_CODE_VALUE_ERROR:()=>cEa,OTEL_STATUS_CODE_VALUE_OK:()=>lEa,OsTypeValues:()=>aAa,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>Pma,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>xma,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>Cma,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>Lma,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>Tma,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>kma,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>Mma,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>Sma,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>Ima,RPCGRPCSTATUSCODEVALUES_OK:()=>vma,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>Dma,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>wma,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>Rma,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>Bma,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>Oma,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>Nma,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>bma,RpcGrpcStatusCodeValues:()=>Fma,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>hfa,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>Ifa,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>dfa,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>afa,SEMATTRS_AWS_DYNAMODB_COUNT:()=>Sfa,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Efa,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>Afa,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>xfa,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>mfa,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>cfa,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>pfa,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>yfa,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>ffa,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>lfa,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>ufa,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>Tfa,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>vfa,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>Cfa,SEMATTRS_AWS_DYNAMODB_SELECT:()=>gfa,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>_fa,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>sfa,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>bfa,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>Uua,SEMATTRS_CODE_FILEPATH:()=>Hda,SEMATTRS_CODE_FUNCTION:()=>qda,SEMATTRS_CODE_LINENO:()=>Gda,SEMATTRS_CODE_NAMESPACE:()=>jda,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>Kua,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>tda,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>eda,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>Zua,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>zua,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>Yua,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>Xua,SEMATTRS_DB_CASSANDRA_TABLE:()=>Jua,SEMATTRS_DB_CONNECTION_STRING:()=>qua,SEMATTRS_DB_HBASE_NAMESPACE:()=>rda,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Hua,SEMATTRS_DB_MONGODB_COLLECTION:()=>ida,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>Wua,SEMATTRS_DB_NAME:()=>Gua,SEMATTRS_DB_OPERATION:()=>Vua,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>nda,SEMATTRS_DB_SQL_TABLE:()=>oda,SEMATTRS_DB_STATEMENT:()=>$ua,SEMATTRS_DB_SYSTEM:()=>Qua,SEMATTRS_DB_USER:()=>jua,SEMATTRS_ENDUSER_ID:()=>Lda,SEMATTRS_ENDUSER_ROLE:()=>Bda,SEMATTRS_ENDUSER_SCOPE:()=>Fda,SEMATTRS_EXCEPTION_ESCAPED:()=>lda,SEMATTRS_EXCEPTION_MESSAGE:()=>ada,SEMATTRS_EXCEPTION_STACKTRACE:()=>cda,SEMATTRS_EXCEPTION_TYPE:()=>sda,SEMATTRS_FAAS_COLDSTART:()=>yda,SEMATTRS_FAAS_CRON:()=>Ada,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>fda,SEMATTRS_FAAS_DOCUMENT_NAME:()=>mda,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>pda,SEMATTRS_FAAS_DOCUMENT_TIME:()=>hda,SEMATTRS_FAAS_EXECUTION:()=>dda,SEMATTRS_FAAS_INVOKED_NAME:()=>Eda,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>_da,SEMATTRS_FAAS_INVOKED_REGION:()=>vda,SEMATTRS_FAAS_TIME:()=>gda,SEMATTRS_FAAS_TRIGGER:()=>uda,SEMATTRS_HTTP_CLIENT_IP:()=>ofa,SEMATTRS_HTTP_FLAVOR:()=>Jda,SEMATTRS_HTTP_HOST:()=>zda,SEMATTRS_HTTP_METHOD:()=>$da,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>Xda,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>efa,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>tfa,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>rfa,SEMATTRS_HTTP_ROUTE:()=>ifa,SEMATTRS_HTTP_SCHEME:()=>Yda,SEMATTRS_HTTP_SERVER_NAME:()=>nfa,SEMATTRS_HTTP_STATUS_CODE:()=>Kda,SEMATTRS_HTTP_TARGET:()=>Wda,SEMATTRS_HTTP_URL:()=>Vda,SEMATTRS_HTTP_USER_AGENT:()=>Zda,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>npa,SEMATTRS_MESSAGE_ID:()=>rpa,SEMATTRS_MESSAGE_TYPE:()=>tpa,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>ipa,SEMATTRS_MESSAGING_CONSUMER_ID:()=>Qfa,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>Lfa,SEMATTRS_MESSAGING_DESTINATION:()=>Rfa,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>kfa,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>Gfa,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>Hfa,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>jfa,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>$fa,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>Vfa,SEMATTRS_MESSAGING_MESSAGE_ID:()=>Ofa,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>Ffa,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>Bfa,SEMATTRS_MESSAGING_OPERATION:()=>Ufa,SEMATTRS_MESSAGING_PROTOCOL:()=>Dfa,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>Nfa,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>qfa,SEMATTRS_MESSAGING_SYSTEM:()=>wfa,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>Pfa,SEMATTRS_MESSAGING_URL:()=>Mfa,SEMATTRS_NET_HOST_CARRIER_ICC:()=>Mda,SEMATTRS_NET_HOST_CARRIER_MCC:()=>Dda,SEMATTRS_NET_HOST_CARRIER_MNC:()=>Nda,SEMATTRS_NET_HOST_CARRIER_NAME:()=>Pda,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>kda,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>Rda,SEMATTRS_NET_HOST_IP:()=>Ida,SEMATTRS_NET_HOST_NAME:()=>wda,SEMATTRS_NET_HOST_PORT:()=>xda,SEMATTRS_NET_PEER_IP:()=>bda,SEMATTRS_NET_PEER_NAME:()=>Tda,SEMATTRS_NET_PEER_PORT:()=>Sda,SEMATTRS_NET_TRANSPORT:()=>Cda,SEMATTRS_PEER_SERVICE:()=>Oda,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>Kfa,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>Xfa,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>epa,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>Zfa,SEMATTRS_RPC_JSONRPC_VERSION:()=>Jfa,SEMATTRS_RPC_METHOD:()=>Yfa,SEMATTRS_RPC_SERVICE:()=>zfa,SEMATTRS_RPC_SYSTEM:()=>Wfa,SEMATTRS_THREAD_ID:()=>Uda,SEMATTRS_THREAD_NAME:()=>Qda,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>zma,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>Wma,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>Yma,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>Kma,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>Jma,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>Zma,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>Xma,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>t0a,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>e0a,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>n0a,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>r0a,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>Hma,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>$ma,SEMRESATTRS_CLOUD_PLATFORM:()=>Vma,SEMRESATTRS_CLOUD_PROVIDER:()=>jma,SEMRESATTRS_CLOUD_REGION:()=>Gma,SEMRESATTRS_CONTAINER_ID:()=>o0a,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>a0a,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>c0a,SEMRESATTRS_CONTAINER_NAME:()=>i0a,SEMRESATTRS_CONTAINER_RUNTIME:()=>s0a,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>l0a,SEMRESATTRS_DEVICE_ID:()=>u0a,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>d0a,SEMRESATTRS_DEVICE_MODEL_NAME:()=>f0a,SEMRESATTRS_FAAS_ID:()=>h0a,SEMRESATTRS_FAAS_INSTANCE:()=>g0a,SEMRESATTRS_FAAS_MAX_MEMORY:()=>A0a,SEMRESATTRS_FAAS_NAME:()=>p0a,SEMRESATTRS_FAAS_VERSION:()=>m0a,SEMRESATTRS_HOST_ARCH:()=>v0a,SEMRESATTRS_HOST_ID:()=>y0a,SEMRESATTRS_HOST_IMAGE_ID:()=>b0a,SEMRESATTRS_HOST_IMAGE_NAME:()=>C0a,SEMRESATTRS_HOST_IMAGE_VERSION:()=>S0a,SEMRESATTRS_HOST_NAME:()=>E0a,SEMRESATTRS_HOST_TYPE:()=>_0a,SEMRESATTRS_K8S_CLUSTER_NAME:()=>T0a,SEMRESATTRS_K8S_CONTAINER_NAME:()=>P0a,SEMRESATTRS_K8S_CRONJOB_NAME:()=>H0a,SEMRESATTRS_K8S_CRONJOB_UID:()=>j0a,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>U0a,SEMRESATTRS_K8S_DAEMONSET_UID:()=>F0a,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>O0a,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>M0a,SEMRESATTRS_K8S_JOB_NAME:()=>q0a,SEMRESATTRS_K8S_JOB_UID:()=>Q0a,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>w0a,SEMRESATTRS_K8S_NODE_NAME:()=>I0a,SEMRESATTRS_K8S_NODE_UID:()=>x0a,SEMRESATTRS_K8S_POD_NAME:()=>k0a,SEMRESATTRS_K8S_POD_UID:()=>R0a,SEMRESATTRS_K8S_REPLICASET_NAME:()=>N0a,SEMRESATTRS_K8S_REPLICASET_UID:()=>D0a,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>B0a,SEMRESATTRS_K8S_STATEFULSET_UID:()=>L0a,SEMRESATTRS_OS_DESCRIPTION:()=>$0a,SEMRESATTRS_OS_NAME:()=>V0a,SEMRESATTRS_OS_TYPE:()=>G0a,SEMRESATTRS_OS_VERSION:()=>W0a,SEMRESATTRS_PROCESS_COMMAND:()=>J0a,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>X0a,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>Z0a,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>Y0a,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>K0a,SEMRESATTRS_PROCESS_OWNER:()=>ega,SEMRESATTRS_PROCESS_PID:()=>z0a,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>nga,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>tga,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>rga,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>sga,SEMRESATTRS_SERVICE_NAME:()=>iga,SEMRESATTRS_SERVICE_NAMESPACE:()=>oga,SEMRESATTRS_SERVICE_VERSION:()=>aga,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>dga,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>lga,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>cga,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>uga,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>hga,SEMRESATTRS_WEBENGINE_NAME:()=>fga,SEMRESATTRS_WEBENGINE_VERSION:()=>pga,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>gEa,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>AEa,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>yEa,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>_Ea,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>vEa,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>CEa,SemanticAttributes:()=>opa,SemanticResourceAttributes:()=>mga,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>cAa,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>lAa,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>uAa,TELEMETRYSDKLANGUAGEVALUES_GO:()=>dAa,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>fAa,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>pAa,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>hAa,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>mAa,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>gAa,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>AAa,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>bEa,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>SEa,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>TEa,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>IEa,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>xEa,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>myr,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>wEa,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>REa,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>kEa,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>PEa,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>DEa,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>NEa,TelemetrySdkLanguageValues:()=>yAa});var Ght=Se(()=>{p();oAi();PEi();DEi();NEi();MEi()});var OEi,LEi=Se(()=>{p();OEi="process.runtime.name"});var $ht,BEi=Se(()=>{p();hpi();Ght();LEi();$ht={[gyr]:"opentelemetry",[OEi]:"node",[hyr]:myr,[Ayr]:ppi}});var FEi=Se(()=>{p();lpi();upi();fpi();BEi()});var Eyr=Se(()=>{p();FEi()});function L0e(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*U_a);return[r,n]}function Wht(){let t=EG.timeOrigin;if(typeof t!="number"){let e=EG;t=e.timing&&e.timing.fetchStart}return t}function _yr(t){let e=L0e(Wht()),r=L0e(typeof t=="number"?t:EG.now());return vyr(e,r)}function QEi(t){if(zht(t))return t;if(typeof t=="number")return t=Vht&&(r[1]-=Vht,r[0]+=1),r}var UEi,F_a,U_a,Vht,WEi=Se(()=>{p();Eyr();UEi=9,F_a=6,U_a=Math.pow(10,F_a),Vht=Math.pow(10,UEi);a(L0e,"millisToHrTime");a(Wht,"getTimeOrigin");a(_yr,"hrTime");a(QEi,"timeInputToHrTime");a(qEi,"hrTimeDuration");a(jEi,"hrTimeToTimeStamp");a(HEi,"hrTimeToNanoseconds");a(GEi,"hrTimeToMilliseconds");a($Ei,"hrTimeToMicroseconds");a(zht,"isTimeInputHrTime");a(VEi,"isTimeInput");a(vyr,"addHrTimes")});function zEi(t){typeof t!="number"&&t.unref()}var YEi=Se(()=>{p();a(zEi,"unrefTimer")});var Yht,KEi=Se(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(Yht||(Yht={}))});var Kht,JEi=Se(()=>{p();po();Kht=class{static{a(this,"CompositePropagator")}_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(r=>typeof r.fields=="function"?r.fields():[]).reduce((r,n)=>r.concat(n),[])))}inject(e,r,n){for(let o of this._propagators)try{o.inject(e,r,n)}catch(s){Dn.warn(`Failed to inject with ${o.constructor.name}. Err: ${s.message}`)}}extract(e,r,n){return this._propagators.reduce((o,s)=>{try{return s.extract(o,r,n)}catch(c){Dn.warn(`Failed to extract with ${s.constructor.name}. Err: ${c.message}`)}return o},e)}fields(){return this._fields.slice()}}});function ZEi(t){return j_a.test(t)}function XEi(t){return H_a.test(t)&&!G_a.test(t)}var Cyr,Q_a,q_a,j_a,H_a,G_a,e_i=Se(()=>{p();Cyr="[_0-9a-z-*/]",Q_a=`[a-z]${Cyr}{0,255}`,q_a=`[a-z0-9]${Cyr}{0,240}@[a-z]${Cyr}{0,13}`,j_a=new RegExp(`^(?:${Q_a}|${q_a})$`),H_a=/^[ -~]{0,255}[!-~]$/,G_a=/,|=/;a(ZEi,"validateKey");a(XEi,"validateValue")});var t_i,$_a,r_i,n_i,B0e,byr=Se(()=>{p();e_i();t_i=32,$_a=512,r_i=",",n_i="=",B0e=class t{static{a(this,"TraceState")}_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,r){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n}unset(e){let r=this._clone();return r._internalState.delete(e),r}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,r)=>(e.push(r+n_i+this.get(r)),e),[]).join(r_i)}_parse(e){e.length>$_a||(this._internalState=e.split(r_i).reverse().reduce((r,n)=>{let o=n.trim(),s=o.indexOf(n_i);if(s!==-1){let c=o.slice(0,s),l=o.slice(s+1,n.length);ZEi(c)&&XEi(l)&&r.set(c,l)}return r},new Map),this._internalState.size>t_i&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,t_i))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function Syr(t){let e=J_a.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var SOe,TOe,V_a,W_a,z_a,Y_a,K_a,J_a,Jht,i_i=Se(()=>{p();po();COe();byr();SOe="traceparent",TOe="tracestate",V_a="00",W_a="(?!ff)[\\da-f]{2}",z_a="(?![0]{32})[\\da-f]{32}",Y_a="(?![0]{16})[\\da-f]{16}",K_a="[\\da-f]{2}",J_a=new RegExp(`^\\s?(${W_a})-(${z_a})-(${Y_a})-(${K_a})(-.*)?\\s?$`);a(Syr,"parseTraceParent");Jht=class{static{a(this,"W3CTraceContextPropagator")}inject(e,r,n){let o=Pu.getSpanContext(e);if(!o||O0e(e)||!Ub(o))return;let s=`${V_a}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||Nf.NONE).toString(16)}`;n.set(r,SOe,s),o.traceState&&n.set(r,TOe,o.traceState.serialize())}extract(e,r,n){let o=n.get(r,SOe);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let c=Syr(s);if(!c)return e;c.isRemote=!0;let l=n.get(r,TOe);if(l){let u=Array.isArray(l)?l.join(","):l;c.traceState=new B0e(typeof u=="string"?u:void 0)}return Pu.setSpanContext(e,c)}fields(){return[SOe,TOe]}}});function o_i(t,e){return t.setValue(Tyr,e)}function s_i(t){return t.deleteValue(Tyr)}function a_i(t){return t.getValue(Tyr)}var Tyr,Zht,c_i=Se(()=>{p();po();Tyr=Fb("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(Zht||(Zht={}));a(o_i,"setRPCMetadata");a(s_i,"deleteRPCMetadata");a(a_i,"getRPCMetadata")});function Iyr(t){if(!iva(t)||ova(t)!==Z_a)return!1;let e=nva(t);if(e===null)return!0;let r=d_i.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&l_i.call(r)===rva}function iva(t){return t!=null&&typeof t=="object"}function ova(t){return t==null?t===void 0?eva:X_a:Qee&&Qee in Object(t)?sva(t):ava(t)}function sva(t){let e=d_i.call(t,Qee),r=t[Qee],n=!1;try{t[Qee]=void 0,n=!0}catch{}let o=f_i.call(t);return n&&(e?t[Qee]=r:delete t[Qee]),o}function ava(t){return f_i.call(t)}var Z_a,X_a,eva,tva,l_i,rva,nva,u_i,d_i,Qee,f_i,p_i=Se(()=>{p();Z_a="[object Object]",X_a="[object Null]",eva="[object Undefined]",tva=Function.prototype,l_i=tva.toString,rva=l_i.call(Object),nva=Object.getPrototypeOf,u_i=Object.prototype,d_i=u_i.hasOwnProperty,Qee=Symbol?Symbol.toStringTag:void 0,f_i=u_i.toString;a(Iyr,"isPlainObject");a(iva,"isObjectLike");a(ova,"baseGetTag");a(sva,"getRawTag");a(ava,"objectToString")});function m_i(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=g_i(e,t.shift(),0,r);return e}function xyr(t){return emt(t)?t.slice():t}function g_i(t,e,r=0,n){let o;if(!(r>cva)){if(r++,Xht(t)||Xht(e)||A_i(e))o=xyr(e);else if(emt(t)){if(o=t.slice(),emt(e))for(let s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{let f=o[u],h=d;if(h_i(t,u,n)||h_i(e,u,n))delete o[u];else{if(IOe(f)&&IOe(h)){let m=n.get(f)||[],g=n.get(h)||[];m.push({obj:t,key:u}),g.push({obj:e,key:u}),n.set(f,m),n.set(h,g)}o[u]=g_i(o[u],d,r,n)}}}}else o=e;return o}}function h_i(t,e,r){let n=r.get(t[e])||[];for(let o=0,s=n.length;o"u"||t instanceof Date||t instanceof RegExp||t===null}function lva(t,e){return!(!Iyr(t)||!Iyr(e))}var cva,y_i=Se(()=>{p();p_i();cva=20;a(m_i,"merge");a(xyr,"takeValue");a(g_i,"mergeTwoObjects");a(h_i,"wasObjectReferenced");a(emt,"isArray");a(A_i,"isFunction");a(IOe,"isObject");a(Xht,"isPrimitive");a(lva,"shouldMerge")});function E_i(t,e){let r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new xOe("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(o=>(clearTimeout(r),o),o=>{throw clearTimeout(r),o})}var xOe,__i=Se(()=>{p();xOe=class t extends Error{static{a(this,"TimeoutError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};a(E_i,"callWithTimeout")});function wyr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function v_i(t,e){if(!e)return!1;for(let r of e)if(wyr(t,r))return!0;return!1}var C_i=Se(()=>{p();a(wyr,"urlMatches");a(v_i,"isUrlIgnored")});var tmt,b_i=Se(()=>{p();tmt=class{static{a(this,"Deferred")}_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,r)=>{this._resolve=e,this._reject=r})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var rmt,S_i=Se(()=>{p();b_i();rmt=class{static{a(this,"BindOnceFuture")}_callback;_that;_isCalled=!1;_deferred=new tmt;constructor(e,r){this._callback=e,this._that=r}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}}});function I_i(t){if(t==null)return;let e=T_i[t.toUpperCase()];return e??(Dn.warn(`Unknown log level "${t}", expected one of ${Object.keys(T_i)}, using default`),Na.INFO)}var T_i,x_i=Se(()=>{p();po();T_i={ALL:Na.ALL,VERBOSE:Na.VERBOSE,DEBUG:Na.DEBUG,INFO:Na.INFO,WARN:Na.WARN,ERROR:Na.ERROR,NONE:Na.NONE};a(I_i,"diagLogLevelFromString")});function w_i(t,e){return new Promise(r=>{$g.with(Mht($g.active()),()=>{t.export(e,n=>{r(n)})})})}var R_i=Se(()=>{p();po();COe();a(w_i,"_export")});var nmt={};Ri(nmt,{AnchoredClock:()=>Fht,BindOnceFuture:()=>rmt,CompositePropagator:()=>Kht,ExportResultCode:()=>Yht,RPCType:()=>Zht,SDK_INFO:()=>$ht,TRACE_PARENT_HEADER:()=>SOe,TRACE_STATE_HEADER:()=>TOe,TimeoutError:()=>xOe,TraceState:()=>B0e,W3CBaggagePropagator:()=>Bht,W3CTraceContextPropagator:()=>Jht,_globalThis:()=>Hht,addHrTimes:()=>vyr,callWithTimeout:()=>E_i,deleteRPCMetadata:()=>s_i,diagLogLevelFromString:()=>I_i,getBooleanFromEnv:()=>qht,getNumberFromEnv:()=>Qht,getRPCMetadata:()=>a_i,getStringFromEnv:()=>bOe,getStringListFromEnv:()=>jht,getTimeOrigin:()=>Wht,globalErrorHandler:()=>api,hrTime:()=>_yr,hrTimeDuration:()=>qEi,hrTimeToMicroseconds:()=>$Ei,hrTimeToMilliseconds:()=>GEi,hrTimeToNanoseconds:()=>HEi,hrTimeToTimeStamp:()=>jEi,internal:()=>uva,isAttributeValue:()=>uyr,isTimeInput:()=>VEi,isTimeInputHrTime:()=>zht,isTracingSuppressed:()=>O0e,isUrlIgnored:()=>v_i,loggingErrorHandler:()=>Uht,merge:()=>m_i,millisToHrTime:()=>L0e,otperformance:()=>EG,parseKeyPairsIntoRecord:()=>Xfi,parseTraceParent:()=>Syr,sanitizeAttributes:()=>rpi,setGlobalErrorHandler:()=>spi,setRPCMetadata:()=>o_i,suppressTracing:()=>Mht,timeInputToHrTime:()=>QEi,unrefTimer:()=>zEi,unsuppressTracing:()=>zfi,urlMatches:()=>wyr});var uva,imt=Se(()=>{p();epi();tpi();ipi();cpi();dyr();WEi();YEi();KEi();lyr();Eyr();JEi();i_i();c_i();COe();byr();y_i();__i();C_i();S_i();x_i();R_i();uva={_export:w_i}});var D_i=I(omt=>{"use strict";p();Object.defineProperty(omt,"__esModule",{value:!0});omt.OpenTelemetrySpanWrapper=void 0;var k_i=(po(),Qa(G8)),P_i=(imt(),Qa(nmt)),dva=syr(),Ryr=class{static{a(this,"OpenTelemetrySpanWrapper")}constructor(e){this._span=e}setStatus(e){e.status==="error"&&fva(e.error)?e.error?(this._span.setStatus({code:k_i.SpanStatusCode.ERROR,message:e.error.toString()}),this.recordException(e.error)):this._span.setStatus({code:k_i.SpanStatusCode.ERROR}):e.status==="success"&&dva.logger.verbose("Leaving span with status UNSET per OpenTelemetry spec.")}setAttribute(e,r){r!=null&&(0,P_i.isAttributeValue)(r)&&this._span.setAttribute(e,r)}end(){this._span.end()}recordException(e){this._span.recordException(e)}isRecording(){return this._span.isRecording()}addEvent(e,r={}){this._span.addEvent(e,(0,P_i.sanitizeAttributes)(r.attributes),r.startTime)}unwrap(){return this._span}};omt.OpenTelemetrySpanWrapper=Ryr;function fva(t){return t!==null&&typeof t=="object"&&"statusCode"in t?t.statusCode!==304:!0}a(fva,"isRecordableError")});var kyr=I(w4=>{"use strict";p();Object.defineProperty(w4,"__esModule",{value:!0});w4.environmentCache=w4.SDK_VERSION=void 0;w4.envVarToBoolean=pva;w4.SDK_VERSION="1.0.0-beta.9";w4.environmentCache=new Map;function pva(t){var e;w4.environmentCache.has(t)||hva(t);let r=((e=w4.environmentCache.get(t))!==null&&e!==void 0?e:"").toLowerCase();return r!=="false"&&r!=="0"&&!!r}a(pva,"envVarToBoolean");function hva(t){var e;if(typeof process<"u"&&process.env){let r=(e=process.env[t])!==null&&e!==void 0?e:process.env[t.toLowerCase()];w4.environmentCache.set(t,r)}}a(hva,"loadEnvironmentVariable")});var L_i=I(smt=>{"use strict";p();Object.defineProperty(smt,"__esModule",{value:!0});smt.toOpenTelemetrySpanKind=O_i;smt.toSpanOptions=gva;var N_i=(po(),Qa(G8)),M_i=(imt(),Qa(nmt));function O_i(t){let e=(t||"internal").toUpperCase();return N_i.SpanKind[e]}a(O_i,"toOpenTelemetrySpanKind");function mva(t=[]){return t.reduce((e,r)=>{let n=N_i.trace.getSpanContext(r.tracingContext);return n&&e.push({context:n,attributes:(0,M_i.sanitizeAttributes)(r.attributes)}),e},[])}a(mva,"toOpenTelemetryLinks");function gva(t){let{spanAttributes:e,spanLinks:r,spanKind:n}=t||{},o=(0,M_i.sanitizeAttributes)(e),s=O_i(n),c=mva(r);return{attributes:o,kind:s,links:c}}a(gva,"toSpanOptions")});var U_i=I(_G=>{"use strict";p();Object.defineProperty(_G,"__esModule",{value:!0});_G.OpenTelemetryInstrumenter=_G.propagator=void 0;var R4=(po(),Qa(G8)),F_i=(imt(),Qa(nmt)),Ava=D_i(),B_i=kyr(),yva=L_i();_G.propagator=new F_i.W3CTraceContextPropagator;var Pyr=class{static{a(this,"OpenTelemetryInstrumenter")}startSpan(e,r){let n=r?.tracingContext||R4.context.active(),o;return(0,B_i.envVarToBoolean)("AZURE_TRACING_DISABLED")?o=R4.trace.wrapSpanContext(R4.INVALID_SPAN_CONTEXT):(o=R4.trace.getTracer(r.packageName,r.packageVersion).startSpan(e,(0,yva.toSpanOptions)(r),n),(0,B_i.envVarToBoolean)("AZURE_HTTP_TRACING_CHILDREN_DISABLED")&&e.toUpperCase().startsWith("HTTP")&&(n=(0,F_i.suppressTracing)(n))),{span:new Ava.OpenTelemetrySpanWrapper(o),tracingContext:R4.trace.setSpan(n,o)}}withContext(e,r,...n){return R4.context.with(e,r,void 0,...n)}parseTraceparentHeader(e){return _G.propagator.extract(R4.context.active(),{traceparent:e},R4.defaultTextMapGetter)}createRequestHeaders(e){let r={};return _G.propagator.inject(e||R4.context.active(),r,R4.defaultTextMapSetter),r}};_G.OpenTelemetryInstrumenter=Pyr});var q_i=I(wOe=>{"use strict";p();Object.defineProperty(wOe,"__esModule",{value:!0});wOe.AzureSdkInstrumentation=void 0;wOe.createAzureSdkInstrumentation=vva;var Q_i=(ZAr(),Qa(JAr)),Eva=U_i(),_va=kyr(),amt=class extends Q_i.InstrumentationBase{static{a(this,"AzureSdkInstrumentation")}constructor(e={}){super("@azure/opentelemetry-instrumentation-azure-sdk",_va.SDK_VERSION,Object.assign({},e))}init(){let e=new Q_i.InstrumentationNodeModuleDefinition("@azure/core-tracing",["^1.0.0-preview.14","^1.0.0"],r=>(typeof r.useInstrumenter=="function"&&r.useInstrumenter(new Eva.OpenTelemetryInstrumenter),r));return e.includePrerelease=!0,e}};wOe.AzureSdkInstrumentation=amt;function vva(t={}){return new amt(t)}a(vva,"createAzureSdkInstrumentation")});var H_i=I(cmt=>{"use strict";p();Object.defineProperty(cmt,"__esModule",{value:!0});var j_i=(v3(),Qa(hQ));j_i.__exportStar(syr(),cmt);j_i.__exportStar(q_i(),cmt)});var $_i=I(bR=>{"use strict";p();Object.defineProperty(bR,"__esModule",{value:!0});bR.enable=bR.azureCoreTracing=bR.AzureMonitorSymbol=void 0;var Dyr=Tp();bR.AzureMonitorSymbol="Azure_Monitor_Tracer";var Nyr="azure-coretracing",G_i=!1,Cva=a(function(t){if(G_i)return t;try{var e=($ui(),Qa(Gui)),r=(po(),Qa(G8)),n=new e.BasicTracerProvider,o=n.getTracer("applicationinsights tracer");if(t.setTracer){var s=t.setTracer;t.setTracer=function(d){var f=d.startSpan;d.startSpan=function(h,m,g){var A=f.call(this,h,m,g),y=A.end;return A.end=function(){var E=y.apply(this,arguments);return Dyr.channel.publish(Nyr,A),E},A},d[bR.AzureMonitorSymbol]=!0,s.call(this,d)},r.trace.getSpan(r.context.active()),t.setTracer(o)}else{var c=r.trace.setGlobalTracerProvider;r.trace.setGlobalTracerProvider=function(d){var f=d.getTracer;return d.getTracer=function(h,m){var g=f.call(this,h,m);if(!g[bR.AzureMonitorSymbol]){var A=g.startSpan;g.startSpan=function(y,E,_){var v=A.call(this,y,E,_),b=v.end;return v.end=function(){var T=b.apply(this,arguments);return Dyr.channel.publish(Nyr,v),T},v},g[bR.AzureMonitorSymbol]=!0}return g},c.call(this,d)},n.register(),r.trace.getSpan(r.context.active());var l=(ZAr(),Qa(JAr)),u=H_i();l.registerInstrumentations({instrumentations:[u.createAzureSdkInstrumentation()]})}G_i=!0}catch{}return t},"azureCoreTracingPatchFunction");bR.azureCoreTracing={versionSpecifier:">= 1.0.0 < 2.0.0",patch:Cva,publisherName:Nyr};function bva(){Dyr.channel.registerMonkeyPatch("@azure/core-tracing",bR.azureCoreTracing)}a(bva,"enable");bR.enable=bva});var W_i=I(qee=>{"use strict";p();Object.defineProperty(qee,"__esModule",{value:!0});qee.enable=qee.bunyan=void 0;var V_i=Tp(),Sva=a(function(t){var e=t.prototype._emit;return t.prototype._emit=function(r,n){var o=e.apply(this,arguments);if(!n){var s=o;s||(s=e.call(this,r,!0)),V_i.channel.publish("bunyan",{level:r.level,result:s})}return o},t},"bunyanPatchFunction");qee.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:Sva};function Tva(){V_i.channel.registerMonkeyPatch("bunyan",qee.bunyan)}a(Tva,"enable");qee.enable=Tva});var Y_i=I(jee=>{"use strict";p();Object.defineProperty(jee,"__esModule",{value:!0});jee.enable=jee.console=void 0;var Myr=Tp(),z_i=require("stream"),Iva=a(function(t){var e=new z_i.Writable,r=new z_i.Writable;e.write=function(d){if(!d)return!0;var f=d.toString();return Myr.channel.publish("console",{message:f}),!0},r.write=function(d){if(!d)return!0;var f=d.toString();return Myr.channel.publish("console",{message:f,stderr:!0}),!0};for(var n=new t.Console(e,r),o=["log","info","warn","error","dir","time","timeEnd","trace","assert"],s=a(function(d){var f=t[d];f&&(t[d]=function(){if(n[d])try{n[d].apply(n,arguments)}catch{}return f.apply(t,arguments)})},"_loop_1"),c=0,l=o;c= 4.0.0",patch:Iva};function xva(){Myr.channel.registerMonkeyPatch("console",jee.console),require("console")}a(xva,"enable");jee.enable=xva});var K_i=I(Hee=>{"use strict";p();Object.defineProperty(Hee,"__esModule",{value:!0});Hee.enable=Hee.mongoCore=void 0;var Oyr=Tp(),wva=a(function(t){var e=t.Server.prototype.connect;return t.Server.prototype.connect=a(function(){var n=e.apply(this,arguments),o=this.s.pool.write;this.s.pool.write=a(function(){var l=typeof arguments[1]=="function"?1:2;return typeof arguments[l]=="function"&&(arguments[l]=Oyr.channel.bindToContext(arguments[l])),o.apply(this,arguments)},"contextPreservingWrite");var s=this.s.pool.logout;return this.s.pool.logout=a(function(){return typeof arguments[1]=="function"&&(arguments[1]=Oyr.channel.bindToContext(arguments[1])),s.apply(this,arguments)},"contextPreservingLogout"),n},"contextPreservingConnect"),t},"mongodbcorePatchFunction");Hee.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:wva};function Rva(){Oyr.channel.registerMonkeyPatch("mongodb-core",Hee.mongoCore)}a(Rva,"enable");Hee.enable=Rva});var J_i=I(Tv=>{"use strict";p();var F0e=Tv&&Tv.__assign||function(){return F0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 2.0.0 <= 3.0.5",patch:kva};Tv.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:Pva};Tv.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:Nva};function Mva(){FE.channel.registerMonkeyPatch("mongodb",Tv.mongo2),FE.channel.registerMonkeyPatch("mongodb",Tv.mongo3),FE.channel.registerMonkeyPatch("mongodb",Tv.mongo330)}a(Mva,"enable");Tv.enable=Mva});var X_i=I(Gee=>{"use strict";p();Object.defineProperty(Gee,"__esModule",{value:!0});Gee.enable=Gee.mysql=void 0;var lmt=Tp(),Z_i=require("path"),Ova=a(function(t,e){var r=a(function(u,d){return function(f,h){var m=u[f];m&&(u[f]=a(function(){for(var A=arguments.length-1,y=arguments.length-1;y>=0;--y)if(typeof arguments[y]=="function"){A=y;break}else if(typeof arguments[y]<"u")break;var E=arguments[A],_={result:null,startTime:null,startDate:null};typeof E=="function"&&(h?(_.startTime=process.hrtime(),_.startDate=new Date,arguments[A]=lmt.channel.bindToContext(h(_,E))):arguments[A]=lmt.channel.bindToContext(E));var v=m.apply(this,arguments);return _.result=v,v},"mysqlContextPreserver"))}},"patchObjectFunction"),n=a(function(u,d){return r(u.prototype,d+".prototype")},"patchClassMemberFunction"),o=["connect","changeUser","ping","statistics","end"],s=require(Z_i.dirname(e)+"/lib/Connection");o.forEach(function(u){return n(s,"Connection")(u)}),r(s,"Connection")("createQuery",function(u,d){return function(f){var h=process.hrtime(u.startTime),m=h[0]*1e3+h[1]/1e6|0;lmt.channel.publish("mysql",{query:u.result,callbackArgs:arguments,err:f,duration:m,time:u.startDate}),d.apply(this,arguments)}});var c=["_enqueueCallback"],l=require(Z_i.dirname(e)+"/lib/Pool");return c.forEach(function(u){return n(l,"Pool")(u)}),t},"mysqlPatchFunction");Gee.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:Ova};function Lva(){lmt.channel.registerMonkeyPatch("mysql",Gee.mysql)}a(Lva,"enable");Gee.enable=Lva});var tvi=I($ee=>{"use strict";p();Object.defineProperty($ee,"__esModule",{value:!0});$ee.enable=$ee.postgresPool1=void 0;var evi=Tp();function Bva(t){var e=t.prototype.connect;return t.prototype.connect=a(function(n){return n&&(arguments[0]=evi.channel.bindToContext(n)),e.apply(this,arguments)},"connect"),t}a(Bva,"postgresPool1PatchFunction");$ee.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:Bva};function Fva(){evi.channel.registerMonkeyPatch("pg-pool",$ee.postgresPool1)}a(Fva,"enable");$ee.enable=Fva});var nvi=I(k4=>{"use strict";p();Object.defineProperty(k4,"__esModule",{value:!0});k4.enable=k4.postgres=k4.postgres6=void 0;var U0e=Tp(),rvi=require("events"),Lyr="postgres";function Uva(t,e){var r=t.Client.prototype.query,n="__diagnosticOriginalFunc";return t.Client.prototype.query=a(function(s,c,l){var u={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},d=process.hrtime(),f;function h(m){m&&m[n]&&(m=m[n]);var g=U0e.channel.bindToContext(function(A,y){var E=process.hrtime(d);if(u.result=y&&{rowCount:y.rowCount,command:y.command},u.error=A,u.duration=Math.ceil(E[0]*1e3+E[1]/1e6),U0e.channel.publish(Lyr,u),A){if(m)return m.apply(this,arguments);f&&f instanceof rvi.EventEmitter&&f.emit("error",A)}else m&&m.apply(this,arguments)});try{return Object.defineProperty(g,n,{value:m}),g}catch{return m}}a(h,"patchCallback");try{typeof s=="string"?c instanceof Array?(u.query.preparable={text:s,args:c},l=h(l)):(u.query.text=s,l?l=h(l):c=h(c)):(typeof s.name=="string"?u.query.plan=s.name:s.values instanceof Array?u.query.preparable={text:s.text,args:s.values}:u.query.text=s.text,l?l=h(l):c?c=h(c):s.callback=h(s.callback))}catch{return r.apply(this,arguments)}return arguments[0]=s,arguments[1]=c,arguments[2]=l,arguments.length=arguments.length>3?arguments.length:3,f=r.apply(this,arguments),f},"query"),t}a(Uva,"postgres6PatchFunction");function Qva(t,e){var r=t.Client.prototype.query,n="__diagnosticOriginalFunc";return t.Client.prototype.query=a(function(s,c,l){var u=this,d,f,h=!!l,m={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},g,A=process.hrtime();function y(v){v&&v[n]&&(v=v[n]);var b=U0e.channel.bindToContext(function(T,w){var R=process.hrtime(A);if(m.result=w&&{rowCount:w.rowCount,command:w.command},m.error=T,m.duration=Math.ceil(R[0]*1e3+R[1]/1e6),U0e.channel.publish(Lyr,m),T){if(v)return v.apply(this,arguments);g&&g instanceof rvi.EventEmitter&&g.emit("error",T)}else v&&v.apply(this,arguments)});try{return Object.defineProperty(b,n,{value:v}),b}catch{return v}}a(y,"patchCallback");try{typeof s=="string"?c instanceof Array?(m.query.preparable={text:s,args:c},h=typeof l=="function",l=h?y(l):l):(m.query.text=s,l?(h=typeof l=="function",l=h?y(l):l):(h=typeof c=="function",c=h?y(c):c)):(typeof s.name=="string"?m.query.plan=s.name:s.values instanceof Array?m.query.preparable={text:s.text,args:s.values}:s.cursor?m.query.text=(d=s.cursor)===null||d===void 0?void 0:d.text:m.query.text=s.text,l?(h=typeof l=="function",l=y(l)):c?(h=typeof c=="function",c=h?y(c):c):(h=typeof s.callback=="function",s.callback=h?y(s.callback):s.callback))}catch{return r.apply(this,arguments)}arguments[0]=s,arguments[1]=c,arguments[2]=l,arguments.length=arguments.length>3?arguments.length:3;try{g=r.apply(this,arguments)}catch(v){throw y()(v,void 0),v}if(!h){if(g instanceof Promise)return g.then(function(v){return y()(void 0,v),new u._Promise(function(b,T){b(v)})}).catch(function(v){return y()(v,void 0),new u._Promise(function(b,T){T(v)})});var E=g.text?g.text:"";if(g.cursor&&(E=(f=g.cursor)===null||f===void 0?void 0:f.text),E){var _={command:E,rowCount:0};y()(void 0,_)}}return g},"query"),t}a(Qva,"postgresLatestPatchFunction");k4.postgres6={versionSpecifier:"6.*",patch:Uva};k4.postgres={versionSpecifier:">=7.* <=8.*",patch:Qva,publisherName:Lyr};function qva(){U0e.channel.registerMonkeyPatch("pg",k4.postgres6),U0e.channel.registerMonkeyPatch("pg",k4.postgres)}a(qva,"enable");k4.enable=qva});var ivi=I(Vee=>{"use strict";p();Object.defineProperty(Vee,"__esModule",{value:!0});Vee.enable=Vee.redis=void 0;var Byr=Tp(),jva=a(function(t){var e=t.RedisClient.prototype.internal_send_command;return t.RedisClient.prototype.internal_send_command=function(r){if(r){var n=r.callback;if(!n||!n.pubsubBound){var o=this.address,s=process.hrtime(),c=new Date;r.callback=Byr.channel.bindToContext(function(l,u){var d=process.hrtime(s),f=d[0]*1e3+d[1]/1e6|0;Byr.channel.publish("redis",{duration:f,address:o,commandObj:r,err:l,result:u,time:c}),typeof n=="function"&&n.apply(this,arguments)}),r.callback.pubsubBound=!0}}return e.call(this,r)},t},"redisPatchFunction");Vee.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:jva};function Hva(){Byr.channel.registerMonkeyPatch("redis",Vee.redis)}a(Hva,"enable");Vee.enable=Hva});var ovi=I(W8=>{"use strict";p();var umt=W8&&W8.__assign||function(){return umt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 6.0.0 < 9.0.0",patch:Gva};function $va(){Fyr.channel.registerMonkeyPatch("tedious",W8.tedious)}a($va,"enable");W8.enable=$va});var svi=I(Gb=>{"use strict";p();var Vva=Gb&&Gb.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Wva=Gb&&Gb.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);od[f]?h:f);return f}a(n,"getLogLevel");function o(l){this.add(new r(t,{level:n(l)}))}a(o,"patchedConfigure");var s=t.createLogger;t.createLogger=a(function(u){var d=s.call(this,u);d.add(new r(t,{level:n(u)}));var f=d.configure;return d.configure=function(){f.apply(this,arguments),o.apply(this,arguments)},d},"patchedCreate");var c=t.configure;return t.configure=function(){c.apply(this,arguments),o.apply(this,arguments)},t.add(new r(t)),t},"winston3PatchFunction");Gb.winston3={versionSpecifier:"3.x",patch:Yva};Gb.winston2={versionSpecifier:"2.x",patch:zva};function Kva(){dmt.channel.registerMonkeyPatch("winston",Gb.winston2),dmt.channel.registerMonkeyPatch("winston",Gb.winston3)}a(Kva,"enable");Gb.enable=Kva});var yvi=I(Du=>{"use strict";p();Object.defineProperty(Du,"__esModule",{value:!0});Du.enable=Du.tedious=Du.pgPool=Du.pg=Du.winston=Du.redis=Du.mysql=Du.mongodb=Du.mongodbCore=Du.console=Du.bunyan=Du.azuresdk=void 0;var avi=$_i();Du.azuresdk=avi;var cvi=W_i();Du.bunyan=cvi;var lvi=Y_i();Du.console=lvi;var uvi=K_i();Du.mongodbCore=uvi;var dvi=J_i();Du.mongodb=dvi;var fvi=X_i();Du.mysql=fvi;var pvi=tvi();Du.pgPool=pvi;var hvi=nvi();Du.pg=hvi;var mvi=ivi();Du.redis=mvi;var gvi=ovi();Du.tedious=gvi;var Avi=svi();Du.winston=Avi;function Jva(){cvi.enable(),lvi.enable(),uvi.enable(),dvi.enable(),fvi.enable(),hvi.enable(),pvi.enable(),mvi.enable(),Avi.enable(),avi.enable(),gvi.enable()}a(Jva,"enable");Du.enable=Jva});var hmt=I(Wee=>{"use strict";p();Object.defineProperty(Wee,"__esModule",{value:!0});Wee.IsInitialized=void 0;Wee.registerContextPreservation=Zva;var Uyr=Jl(),_vi=hpt();Wee.IsInitialized=!_vi.JsonConfig.getInstance().noDiagnosticChannel;var Qyr="DiagnosticChannel";if(Wee.IsInitialized){dD=yvi(),Evi=_vi.JsonConfig.getInstance().noPatchModules,fmt=Evi.split(","),qyr={bunyan:dD.bunyan,console:dD.console,mongodb:dD.mongodb,mongodbCore:dD.mongodbCore,mysql:dD.mysql,redis:dD.redis,pg:dD.pg,pgPool:dD.pgPool,winston:dD.winston,azuresdk:dD.azuresdk};for(pmt in qyr)fmt.indexOf(pmt)===-1&&(qyr[pmt].enable(),Uyr.info(Qyr,"Subscribed to ".concat(pmt," events")));fmt.length>0&&Uyr.info(Qyr,"Some modules will not be patched",fmt)}else Uyr.info(Qyr,"Not subscribing to dependency autocollection because APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL was set");var dD,Evi,fmt,qyr,pmt;function Zva(t){if(Wee.IsInitialized){var e=Tp();e.channel.addContextPreservation(t)}}a(Zva,"registerContextPreservation")});var Q0e=I((igp,vvi)=>{"use strict";p();vvi.exports={requestContextHeader:"request-context",requestContextSourceKey:"appId",requestContextTargetKey:"appId",requestIdHeader:"request-id",parentIdHeader:"x-ms-request-id",rootIdHeader:"x-ms-request-root-id",correlationContextHeader:"correlation-context",traceparentHeader:"traceparent",traceStateHeader:"tracestate"}});var dy=I((Gyr,Cvi)=>{"use strict";p();var CG=Gyr&&Gyr.__assign||function(){return CG=Object.assign||function(t){for(var e,r=1,n=arguments.length;r>u&255)},"toChar"),n=a(function(l){return r(l,24)+r(l,16)+r(l,8)+r(l,0)},"int32AsString"),o=e.map(n).join(""),s=Buffer.from?Buffer.from(o,"binary"):new Buffer(o,"binary"),c=s.toString("base64");return c.substr(0,c.indexOf("="))},t.random32=function(){return 4294967296*Math.random()|0},t.randomu32=function(){return t.random32()+2147483648},t.w3cTraceId=function(){for(var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],r="",n,o=0;o<4;o++)n=t.random32(),r+=e[n&15]+e[n>>4&15]+e[n>>8&15]+e[n>>12&15]+e[n>>16&15]+e[n>>20&15]+e[n>>24&15]+e[n>>28&15];var s=e[8+Math.random()*4|0];return r.substr(0,8)+r.substr(9,4)+"4"+r.substr(13,3)+s+r.substr(16,3)+r.substr(19,12)},t.w3cSpanId=function(){return t.w3cTraceId().substring(16)},t.isValidW3CId=function(e){return e.length===32&&e!=="00000000000000000000000000000000"},t.isArray=function(e){return Object.prototype.toString.call(e)==="[object Array]"},t.isError=function(e){return Object.prototype.toString.call(e)==="[object Error]"},t.isPrimitive=function(e){var r=typeof e;return r==="string"||r==="number"||r==="boolean"},t.isDate=function(e){return Object.prototype.toString.call(e)==="[object Date]"},t.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var r=(e/1e3%60).toFixed(7).replace(/0{0,4}$/,""),n=""+Math.floor(e/(1e3*60))%60,o=""+Math.floor(e/(1e3*60*60))%24,s=Math.floor(e/(1e3*60*60*24));r=r.indexOf(".")<2?"0"+r:r,n=n.length<2?"0"+n:n,o=o.length<2?"0"+o:o;var c=s>0?s+".":"";return c+o+":"+n+":"+r},t.extractError=function(e){var r=e;return{message:e.message,code:r.code||r.id||""}},t.extractObject=function(e){return e instanceof Error?t.extractError(e):typeof e.toJSON=="function"?e.toJSON():e},t.validateStringMap=function(e){if(typeof e!="object"){zee.info("Invalid properties dropped from payload");return}var r={};for(var n in e){var o="",s=e[n],c=typeof s;if(t.isPrimitive(s))o=s.toString();else if(s===null||c==="undefined")o="";else if(c==="function"){zee.info("key: "+n+" was function; will not serialize");continue}else{var l=t.isArray(s)?s:t.extractObject(s);try{t.isPrimitive(l)?o=l:o=JSON.stringify(l)}catch(u){o=s.constructor.name.toString()+" (Error: "+u.message+")",zee.info("key: "+n+", could not be serialized")}}r[n]=o.substring(0,t.MAX_PROPERTY_LENGTH)}return r},t.canIncludeCorrelationHeader=function(e,r){var n=e&&e.config&&e.config.correlationHeaderExcludedDomains;if(!n||n.length==0||!r)return!0;for(var o=0;o{"use strict";p();var $yr=dy(),rCa=(function(){function t(){}return a(t,"CorrelationIdManager"),t.queryCorrelationId=function(e,r){},t.cancelCorrelationIdQuery=function(e,r){},t.generateRequestId=function(e){if(e){e=e[0]=="|"?e:"|"+e,e[e.length-1]!=="."&&(e+=".");var r=(t.currentRootId++).toString(16);return t.appendSuffix(e,r,"_")}else return t.generateRootId()},t.getRootId=function(e){var r=e.indexOf(".");r<0&&(r=e.length);var n=e[0]==="|"?1:0;return e.substring(n,r)},t.generateRootId=function(){return"|"+$yr.w3cTraceId()+"."},t.appendSuffix=function(e,r,n){if(e.length+r.lengtho)for(;o>1;--o){var s=e[o-1];if(s==="."||s==="_")break}if(o<=1)return t.generateRootId();for(r=$yr.randomu32().toString(16);r.length<8;)r="0"+r;return e.substring(0,o)+r+"#"},t.correlationIdPrefix="cid-v1:",t.w3cEnabled=!0,t.HTTP_TIMEOUT=2500,t.requestIdMaxLength=1024,t.currentRootId=$yr.randomu32(),t})();bvi.exports=rCa});var mmt=I((dgp,Svi)=>{"use strict";p();var fy=dy(),nCa=Yee(),iCa=(function(){function t(e,r){if(this.traceFlag=t.DEFAULT_TRACE_FLAG,this.version=t.DEFAULT_VERSION,e&&typeof e=="string")if(e.split(",").length>1)this.traceId=fy.w3cTraceId(),this.spanId=fy.w3cTraceId().substr(0,16);else{var n=e.trim().split("-"),o=n.length;o>=4?(this.version=n[0],this.traceId=n[1],this.spanId=n[2],this.traceFlag=n[3]):(this.traceId=fy.w3cTraceId(),this.spanId=fy.w3cTraceId().substr(0,16)),this.version.match(/^[0-9a-f]{2}$/g)||(this.version=t.DEFAULT_VERSION,this.traceId=fy.w3cTraceId()),this.version==="00"&&o!==4&&(this.traceId=fy.w3cTraceId(),this.spanId=fy.w3cTraceId().substr(0,16)),this.version==="ff"&&(this.version=t.DEFAULT_VERSION,this.traceId=fy.w3cTraceId(),this.spanId=fy.w3cTraceId().substr(0,16)),this.version.match(/^0[0-9a-f]$/g)||(this.version=t.DEFAULT_VERSION),this.traceFlag.match(/^[0-9a-f]{2}$/g)||(this.traceFlag=t.DEFAULT_TRACE_FLAG,this.traceId=fy.w3cTraceId()),t.isValidTraceId(this.traceId)||(this.traceId=fy.w3cTraceId()),t.isValidSpanId(this.spanId)||(this.spanId=fy.w3cTraceId().substr(0,16),this.traceId=fy.w3cTraceId()),this.parentId=this.getBackCompatRequestId()}else if(r){this.parentId=r.slice();var s=nCa.getRootId(r);t.isValidTraceId(s)||(this.legacyRootId=s,s=fy.w3cTraceId()),r.indexOf("|")!==-1&&(r=r.substring(1+r.substring(0,r.length-1).lastIndexOf("."),r.length-1)),this.traceId=s,this.spanId=r}else this.traceId=fy.w3cTraceId(),this.spanId=fy.w3cTraceId().substr(0,16)}return a(t,"Traceparent"),t.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&e!=="00000000000000000000000000000000"},t.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&e!=="0000000000000000"},t.formatOpenTelemetryTraceFlags=function(e){var r="0"+e.toString(16);return r.substring(r.length-2)},t.prototype.getBackCompatRequestId=function(){return"|".concat(this.traceId,".").concat(this.spanId,".")},t.prototype.toString=function(){return"".concat(this.version,"-").concat(this.traceId,"-").concat(this.spanId,"-").concat(this.traceFlag)},t.prototype.updateSpanId=function(){this.spanId=fy.w3cTraceId().substr(0,16)},t.DEFAULT_TRACE_FLAG="01",t.DEFAULT_VERSION="00",t})();Svi.exports=iCa});var Vyr=I((hgp,Tvi)=>{"use strict";p();var oCa=(function(){function t(e){this.fieldmap=[],e&&(this.fieldmap=this.parseHeader(e))}return a(t,"Tracestate"),t.prototype.toString=function(){var e=this.fieldmap;return!e||e.length==0?null:e.join(", ")},t.validateKeyChars=function(e){var r=e.split("@");if(r.length==2){var n=r[0].trim(),o=r[1].trim(),s=!!n.match(/^[\ ]?[a-z0-9\*\-\_/]{1,241}$/),c=!!o.match(/^[\ ]?[a-z0-9\*\-\_/]{1,14}$/);return s&&c}else if(r.length==1)return!!e.match(/^[\ ]?[a-z0-9\*\-\_/]{1,256}$/);return!1},t.prototype.parseHeader=function(e){var r=[],n={},o=e.split(",");if(o.length>32)return null;for(var s=0,c=o;s{"use strict";p();var sCa=(function(){function t(){}return a(t,"Domain"),t})();Ivi.exports=sCa});var wvi=I((Wyr,xvi)=>{"use strict";p();var aCa=Wyr&&Wyr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),cCa=z8(),lCa=(function(t){aCa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"AvailabilityData"),e})(cCa);xvi.exports=lCa});var zyr=I((Cgp,Rvi)=>{"use strict";p();var uCa=(function(){function t(){}return a(t,"Base"),t})();Rvi.exports=uCa});var Pvi=I((Tgp,kvi)=>{"use strict";p();var dCa=(function(){function t(){this.applicationVersion="ai.application.ver",this.deviceId="ai.device.id",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceOEMName="ai.device.oemName",this.deviceOSVersion="ai.device.osVersion",this.deviceType="ai.device.type",this.locationIp="ai.location.ip",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.userAccountId="ai.user.accountId",this.userId="ai.user.id",this.userAuthUserId="ai.user.authUserId",this.cloudRole="ai.cloud.role",this.cloudRoleInstance="ai.cloud.roleInstance",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion",this.internalNodeName="ai.internal.nodeName"}return a(t,"ContextTagKeys"),t})();kvi.exports=dCa});var Nvi=I((Yyr,Dvi)=>{"use strict";p();var fCa=Yyr&&Yyr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),pCa=zyr(),hCa=(function(t){fCa(e,t);function e(){return t.call(this)||this}return a(e,"Data"),e})(pCa);Dvi.exports=hCa});var Jyr=I((kgp,Mvi)=>{"use strict";p();var Kyr;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(Kyr||(Kyr={}));Mvi.exports=Kyr});var Lvi=I((Dgp,Ovi)=>{"use strict";p();var mCa=Jyr(),gCa=(function(){function t(){this.kind=mCa.Measurement}return a(t,"DataPoint"),t})();Ovi.exports=gCa});var Fvi=I((Ogp,Bvi)=>{"use strict";p();var ACa=(function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return a(t,"Envelope"),t})();Bvi.exports=ACa});var Xyr=I((Zyr,Uvi)=>{"use strict";p();var yCa=Zyr&&Zyr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),ECa=z8(),_Ca=(function(t){yCa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"EventData"),e})(ECa);Uvi.exports=_Ca});var qvi=I((eEr,Qvi)=>{"use strict";p();var vCa=eEr&&eEr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),CCa=z8(),bCa=(function(t){vCa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.exceptions=[],r.properties={},r.measurements={},r}return a(e,"ExceptionData"),e})(CCa);Qvi.exports=bCa});var Hvi=I((jgp,jvi)=>{"use strict";p();var SCa=(function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return a(t,"ExceptionDetails"),t})();jvi.exports=SCa});var $vi=I((tEr,Gvi)=>{"use strict";p();var TCa=tEr&&tEr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),ICa=z8(),xCa=(function(t){TCa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r}return a(e,"MessageData"),e})(ICa);Gvi.exports=xCa});var Wvi=I((rEr,Vvi)=>{"use strict";p();var wCa=rEr&&rEr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),RCa=z8(),kCa=(function(t){wCa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.metrics=[],r.properties={},r}return a(e,"MetricData"),e})(RCa);Vvi.exports=kCa});var Yvi=I((nEr,zvi)=>{"use strict";p();var PCa=nEr&&nEr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),DCa=Xyr(),NCa=(function(t){PCa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"PageViewData"),e})(DCa);zvi.exports=NCa});var Jvi=I((iEr,Kvi)=>{"use strict";p();var MCa=iEr&&iEr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),OCa=z8(),LCa=(function(t){MCa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.success=!0,r.properties={},r.measurements={},r}return a(e,"RemoteDependencyData"),e})(OCa);Kvi.exports=LCa});var Xvi=I((oEr,Zvi)=>{"use strict";p();var BCa=oEr&&oEr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),FCa=z8(),UCa=(function(t){BCa(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"RequestData"),e})(FCa);Zvi.exports=UCa});var tCi=I((tAp,eCi)=>{"use strict";p();var sEr;(function(t){t[t.Verbose=0]="Verbose",t[t.Information=1]="Information",t[t.Warning=2]="Warning",t[t.Error=3]="Error",t[t.Critical=4]="Critical"})(sEr||(sEr={}));eCi.exports=sEr});var nCi=I((nAp,rCi)=>{"use strict";p();var QCa=(function(){function t(){}return a(t,"StackFrame"),t})();rCi.exports=QCa});var aEr=I(bm=>{"use strict";p();Object.defineProperty(bm,"__esModule",{value:!0});bm.AvailabilityData=wvi();bm.Base=zyr();bm.ContextTagKeys=Pvi();bm.Data=Nvi();bm.DataPoint=Lvi();bm.DataPointType=Jyr();bm.Domain=z8();bm.Envelope=Fvi();bm.EventData=Xyr();bm.ExceptionData=qvi();bm.ExceptionDetails=Hvi();bm.MessageData=$vi();bm.MetricData=Wvi();bm.PageViewData=Yvi();bm.RemoteDependencyData=Jvi();bm.RequestData=Xvi();bm.SeverityLevel=tCi();bm.StackFrame=nCi()});var iCi=I(ROe=>{"use strict";p();Object.defineProperty(ROe,"__esModule",{value:!0});ROe.RemoteDependencyDataConstants=void 0;ROe.domainSupportsProperties=jCa;var Kee=aEr(),qCa=(function(){function t(){}return a(t,"RemoteDependencyDataConstants"),t.TYPE_HTTP="Http",t.TYPE_AI="Http (tracked component)",t})();ROe.RemoteDependencyDataConstants=qCa;function jCa(t){return"properties"in t||t instanceof Kee.EventData||t instanceof Kee.ExceptionData||t instanceof Kee.MessageData||t instanceof Kee.MetricData||t instanceof Kee.PageViewData||t instanceof Kee.RemoteDependencyData||t instanceof Kee.RequestData}a(jCa,"domainSupportsProperties")});var sCi=I(oCi=>{"use strict";p();Object.defineProperty(oCi,"__esModule",{value:!0})});var cCi=I(aCi=>{"use strict";p();Object.defineProperty(aCi,"__esModule",{value:!0})});var uCi=I(lCi=>{"use strict";p();Object.defineProperty(lCi,"__esModule",{value:!0})});var fCi=I(dCi=>{"use strict";p();Object.defineProperty(dCi,"__esModule",{value:!0})});var hCi=I(pCi=>{"use strict";p();Object.defineProperty(pCi,"__esModule",{value:!0})});var gCi=I(mCi=>{"use strict";p();Object.defineProperty(mCi,"__esModule",{value:!0})});var yCi=I(ACi=>{"use strict";p();Object.defineProperty(ACi,"__esModule",{value:!0})});var _Ci=I(ECi=>{"use strict";p();Object.defineProperty(ECi,"__esModule",{value:!0})});var CCi=I(vCi=>{"use strict";p();Object.defineProperty(vCi,"__esModule",{value:!0})});var SCi=I(bCi=>{"use strict";p();Object.defineProperty(bCi,"__esModule",{value:!0})});var ICi=I(TCi=>{"use strict";p();Object.defineProperty(TCi,"__esModule",{value:!0})});var wCi=I(xCi=>{"use strict";p();Object.defineProperty(xCi,"__esModule",{value:!0})});var RCi=I(bG=>{"use strict";p();Object.defineProperty(bG,"__esModule",{value:!0});bG.TelemetryType=bG.TelemetryTypeString=void 0;bG.telemetryTypeToBaseType=HCa;bG.baseTypeToTelemetryType=GCa;function HCa(t){switch(t){case Wg.Event:return"EventData";case Wg.Exception:return"ExceptionData";case Wg.Trace:return"MessageData";case Wg.Metric:return"MetricData";case Wg.Request:return"RequestData";case Wg.Dependency:return"RemoteDependencyData";case Wg.Availability:return"AvailabilityData";case Wg.PageView:return"PageViewData"}}a(HCa,"telemetryTypeToBaseType");function GCa(t){switch(t){case"EventData":return Wg.Event;case"ExceptionData":return Wg.Exception;case"MessageData":return Wg.Trace;case"MetricData":return Wg.Metric;case"RequestData":return Wg.Request;case"RemoteDependencyData":return Wg.Dependency;case"AvailabilityData":return Wg.Availability;case"PageViewData":return Wg.PageView}}a(GCa,"baseTypeToTelemetryType");bG.TelemetryTypeString={Event:"EventData",Exception:"ExceptionData",Trace:"MessageData",Metric:"MetricData",Request:"RequestData",Dependency:"RemoteDependencyData",Availability:"AvailabilityData",PageView:"PageViewData"};var Wg;(function(t){t[t.Event=0]="Event",t[t.Exception=1]="Exception",t[t.Trace=2]="Trace",t[t.Metric=3]="Metric",t[t.Request=4]="Request",t[t.Dependency=5]="Dependency",t[t.Availability=6]="Availability",t[t.PageView=7]="PageView"})(Wg||(bG.TelemetryType=Wg={}))});var kCi=I(T0=>{"use strict";p();var $Ca=T0&&T0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),JT=T0&&T0.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$Ca(e,t,r)};Object.defineProperty(T0,"__esModule",{value:!0});JT(sCi(),T0);JT(cCi(),T0);JT(uCi(),T0);JT(fCi(),T0);JT(hCi(),T0);JT(gCi(),T0);JT(yCi(),T0);JT(_Ci(),T0);JT(CCi(),T0);JT(SCi(),T0);JT(ICi(),T0);JT(wCi(),T0);JT(RCi(),T0)});var DCi=I(PCi=>{"use strict";p();Object.defineProperty(PCi,"__esModule",{value:!0})});var MCi=I(NCi=>{"use strict";p();Object.defineProperty(NCi,"__esModule",{value:!0})});var LCi=I(OCi=>{"use strict";p();Object.defineProperty(OCi,"__esModule",{value:!0})});var FCi=I(BCi=>{"use strict";p();Object.defineProperty(BCi,"__esModule",{value:!0})});var QCi=I(UCi=>{"use strict";p();Object.defineProperty(UCi,"__esModule",{value:!0})});var jCi=I(qCi=>{"use strict";p();Object.defineProperty(qCi,"__esModule",{value:!0})});var GCi=I(HCi=>{"use strict";p();Object.defineProperty(HCi,"__esModule",{value:!0})});var VCi=I($Ci=>{"use strict";p();Object.defineProperty($Ci,"__esModule",{value:!0})});var WCi=I($b=>{"use strict";p();var VCa=$b&&$b.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SG=$b&&$b.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&VCa(e,t,r)};Object.defineProperty($b,"__esModule",{value:!0});SG(DCi(),$b);SG(MCi(),$b);SG(LCi(),$b);SG(FCi(),$b);SG(QCi(),$b);SG(jCi(),$b);SG(GCi(),$b);SG(VCi(),$b)});var UE=I(P4=>{"use strict";p();var WCa=P4&&P4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gmt=P4&&P4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&WCa(e,t,r)};Object.defineProperty(P4,"__esModule",{value:!0});gmt(iCi(),P4);gmt(aEr(),P4);gmt(kCi(),P4);gmt(WCi(),P4)});var cEr=I((lyp,zCi)=>{"use strict";p();var zCa=(function(){function t(){}return a(t,"RequestParser"),t.prototype.getUrl=function(){return this.url},t.prototype.RequestParser=function(){this.startTime=+new Date},t.prototype._setStatus=function(e,r){var n=+new Date;this.duration=n-this.startTime,this.statusCode=e;var o=this.properties||{};if(r){if(typeof r=="string")o.error=r;else if(r instanceof Error)o.error=r.message;else if(typeof r=="object")for(var s in r)o[s]=r[s]&&r[s].toString&&r[s].toString()}this.properties=o},t.prototype._isSuccess=function(){return 0{"use strict";p();var fD;Object.defineProperty(jr,"__esModule",{value:!0});jr.WEB_INSTRUMENTATION_DEPRECATED_SOURCE=jr.WEB_INSTRUMENTATION_DEFAULT_SOURCE=jr.TIME_SINCE_ENQUEUED=jr.ENQUEUED_TIME=jr.MessageBusDestination=jr.MicrosoftEventHub=jr.AzNamespace=jr.AttachTypePrefix=jr.HttpRequestCookieNames=jr.StatsbeatNetworkCategory=jr.StatsbeatFeatureType=jr.StatsbeatInstrumentation=jr.StatsbeatFeature=jr.StatsbeatCounter=jr.StatsbeatAttach=jr.StatsbeatResourceProvider=jr.StatsbeatTelemetryName=jr.HeartBeatMetricName=jr.DependencyTypeName=jr.TelemetryTypeStringToQuickPulseDocumentType=jr.TelemetryTypeStringToQuickPulseType=jr.QuickPulseType=jr.QuickPulseDocumentType=jr.PerformanceToQuickPulseCounter=jr.MetricId=jr.PerformanceCounter=jr.QuickPulseCounter=jr.DEFAULT_LIVEMETRICS_HOST=jr.DEFAULT_LIVEMETRICS_ENDPOINT=jr.DEFAULT_BREEZE_ENDPOINT=jr.APPLICATION_INSIGHTS_SDK_VERSION=void 0;jr.APPLICATION_INSIGHTS_SDK_VERSION="2.9.8";jr.DEFAULT_BREEZE_ENDPOINT="https://dc.services.visualstudio.com";jr.DEFAULT_LIVEMETRICS_ENDPOINT="https://rt.services.visualstudio.com";jr.DEFAULT_LIVEMETRICS_HOST="rt.services.visualstudio.com";var py;(function(t){t.COMMITTED_BYTES="\\Memory\\Committed Bytes",t.PROCESSOR_TIME="\\Processor(_Total)\\% Processor Time",t.REQUEST_RATE="\\ApplicationInsights\\Requests/Sec",t.REQUEST_FAILURE_RATE="\\ApplicationInsights\\Requests Failed/Sec",t.REQUEST_DURATION="\\ApplicationInsights\\Request Duration",t.DEPENDENCY_RATE="\\ApplicationInsights\\Dependency Calls/Sec",t.DEPENDENCY_FAILURE_RATE="\\ApplicationInsights\\Dependency Calls Failed/Sec",t.DEPENDENCY_DURATION="\\ApplicationInsights\\Dependency Call Duration",t.EXCEPTION_RATE="\\ApplicationInsights\\Exceptions/Sec"})(py||(jr.QuickPulseCounter=py={}));var kOe;(function(t){t.PRIVATE_BYTES="\\Process(??APP_WIN32_PROC??)\\Private Bytes",t.AVAILABLE_BYTES="\\Memory\\Available Bytes",t.PROCESSOR_TIME="\\Processor(_Total)\\% Processor Time",t.PROCESS_TIME="\\Process(??APP_WIN32_PROC??)\\% Processor Time",t.REQUEST_RATE="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec",t.REQUEST_DURATION="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Request Execution Time"})(kOe||(jr.PerformanceCounter=kOe={}));var YCi;(function(t){t.REQUESTS_DURATION="requests/duration",t.DEPENDENCIES_DURATION="dependencies/duration",t.EXCEPTIONS_COUNT="exceptions/count",t.TRACES_COUNT="traces/count"})(YCi||(jr.MetricId=YCi={}));jr.PerformanceToQuickPulseCounter=(fD={},fD[kOe.PROCESSOR_TIME]=py.PROCESSOR_TIME,fD[kOe.REQUEST_RATE]=py.REQUEST_RATE,fD[kOe.REQUEST_DURATION]=py.REQUEST_DURATION,fD[py.COMMITTED_BYTES]=py.COMMITTED_BYTES,fD[py.REQUEST_FAILURE_RATE]=py.REQUEST_FAILURE_RATE,fD[py.DEPENDENCY_RATE]=py.DEPENDENCY_RATE,fD[py.DEPENDENCY_FAILURE_RATE]=py.DEPENDENCY_FAILURE_RATE,fD[py.DEPENDENCY_DURATION]=py.DEPENDENCY_DURATION,fD[py.EXCEPTION_RATE]=py.EXCEPTION_RATE,fD);jr.QuickPulseDocumentType={Event:"Event",Exception:"Exception",Trace:"Trace",Metric:"Metric",Request:"Request",Dependency:"RemoteDependency",Availability:"Availability",PageView:"PageView"};jr.QuickPulseType={Event:"EventTelemetryDocument",Exception:"ExceptionTelemetryDocument",Trace:"TraceTelemetryDocument",Metric:"MetricTelemetryDocument",Request:"RequestTelemetryDocument",Dependency:"DependencyTelemetryDocument",Availability:"AvailabilityTelemetryDocument",PageView:"PageViewTelemetryDocument"};jr.TelemetryTypeStringToQuickPulseType={EventData:jr.QuickPulseType.Event,ExceptionData:jr.QuickPulseType.Exception,MessageData:jr.QuickPulseType.Trace,MetricData:jr.QuickPulseType.Metric,RequestData:jr.QuickPulseType.Request,RemoteDependencyData:jr.QuickPulseType.Dependency,AvailabilityData:jr.QuickPulseType.Availability,PageViewData:jr.QuickPulseType.PageView};jr.TelemetryTypeStringToQuickPulseDocumentType={EventData:jr.QuickPulseDocumentType.Event,ExceptionData:jr.QuickPulseDocumentType.Exception,MessageData:jr.QuickPulseDocumentType.Trace,MetricData:jr.QuickPulseDocumentType.Metric,RequestData:jr.QuickPulseDocumentType.Request,RemoteDependencyData:jr.QuickPulseDocumentType.Dependency,AvailabilityData:jr.QuickPulseDocumentType.Availability,PageViewData:jr.QuickPulseDocumentType.PageView};jr.DependencyTypeName={Grpc:"GRPC",Http:"HTTP",InProc:"InProc",Sql:"SQL",QueueMessage:"Queue Message"};jr.HeartBeatMetricName="HeartbeatState";jr.StatsbeatTelemetryName="Statsbeat";jr.StatsbeatResourceProvider={appsvc:"appsvc",aks:"aks",functions:"functions",vm:"vm",unknown:"unknown"};jr.StatsbeatAttach={codeless:"IntegratedAuto",sdk:"Manual"};jr.StatsbeatCounter={REQUEST_SUCCESS:"Request_Success_Count",REQUEST_FAILURE:"Request_Failure_Count",REQUEST_DURATION:"Request_Duration",RETRY_COUNT:"Retry_Count",THROTTLE_COUNT:"Throttle_Count",EXCEPTION_COUNT:"Exception_Count",ATTACH:"Attach",FEATURE:"Feature"};var KCi;(function(t){t[t.NONE=0]="NONE",t[t.DISK_RETRY=1]="DISK_RETRY",t[t.AAD_HANDLING=2]="AAD_HANDLING",t[t.BROWSER_SDK_LOADER=4]="BROWSER_SDK_LOADER",t[t.LIVE_METRICS=16]="LIVE_METRICS",t[t.NATIVE_METRICS=8192]="NATIVE_METRICS"})(KCi||(jr.StatsbeatFeature=KCi={}));var JCi;(function(t){t[t.NONE=0]="NONE",t[t.AZURE_CORE_TRACING=1]="AZURE_CORE_TRACING",t[t.MONGODB=2]="MONGODB",t[t.MYSQL=4]="MYSQL",t[t.REDIS=8]="REDIS",t[t.POSTGRES=16]="POSTGRES",t[t.BUNYAN=32]="BUNYAN",t[t.WINSTON=64]="WINSTON",t[t.CONSOLE=128]="CONSOLE"})(JCi||(jr.StatsbeatInstrumentation=JCi={}));var ZCi;(function(t){t[t.Feature=0]="Feature",t[t.Instrumentation=1]="Instrumentation"})(ZCi||(jr.StatsbeatFeatureType=ZCi={}));var XCi;(function(t){t[t.Breeze=0]="Breeze",t[t.Quickpulse=1]="Quickpulse"})(XCi||(jr.StatsbeatNetworkCategory=XCi={}));var ebi;(function(t){t.SESSION="ai_session",t.USER="ai_user",t.AUTH_USER="ai_authUser"})(ebi||(jr.HttpRequestCookieNames=ebi={}));var tbi;(function(t){t.INTEGRATED_AUTO="i",t.MANUAL="m"})(tbi||(jr.AttachTypePrefix=tbi={}));jr.AzNamespace="az.namespace";jr.MicrosoftEventHub="Microsoft.EventHub";jr.MessageBusDestination="message_bus.destination";jr.ENQUEUED_TIME="enqueuedTime";jr.TIME_SINCE_ENQUEUED="timeSinceEnqueued";jr.WEB_INSTRUMENTATION_DEFAULT_SOURCE="https://js.monitor.azure.com/scripts/b/ai";jr.WEB_INSTRUMENTATION_DEPRECATED_SOURCE="https://az416426.vo.msecnd.net/scripts/b/ai"});var fEr=I((dEr,rbi)=>{"use strict";p();var YCa=dEr&&dEr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Amt=require("url"),KCa=UE(),lEr=dy(),ZT=Q0e(),JCa=cEr(),TG=Yee(),ZCa=Vyr(),uEr=mmt(),XCa=Jl(),ymt=_d(),eba=(function(t){YCa(e,t);function e(r,n){var o=t.call(this)||this;return r&&(o.method=r.method,o.url=o._getAbsoluteUrl(r),o.startTime=+new Date,o.socketRemoteAddress=r.socket&&r.socket.remoteAddress,o.parseHeaders(r,n),r.connection&&(o.connectionRemoteAddress=r.connection.remoteAddress,o.legacySocketRemoteAddress=r.connection.socket&&r.connection.socket.remoteAddress)),o}return a(e,"HttpRequestParser"),e.prototype.onError=function(r,n){this._setStatus(void 0,r),n&&(this.duration=n)},e.prototype.onResponse=function(r,n){this._setStatus(r.statusCode,void 0),n&&(this.duration=n)},e.prototype.getRequestTelemetry=function(r){var n=this.method;try{n+=" "+new Amt.URL(this.url).pathname}catch{}var o={id:this.requestId,name:n,url:this.url,source:this.sourceCorrelationId,duration:this.duration,resultCode:this.statusCode?this.statusCode.toString():null,success:this._isSuccess(),properties:this.properties};if(r&&r.time?o.time=r.time:this.startTime&&(o.time=new Date(this.startTime)),r){for(var s in r)o[s]||(o[s]=r[s]);if(r.properties)for(var s in r.properties)o.properties[s]=r.properties[s]}return o},e.prototype.getRequestTags=function(r){var n={};for(var o in r)n[o]=r[o];return n[e.keys.locationIp]=r[e.keys.locationIp]||this._getIp(),n[e.keys.sessionId]=r[e.keys.sessionId]||this._getId(ymt.HttpRequestCookieNames.SESSION),n[e.keys.userId]=r[e.keys.userId]||this._getId(ymt.HttpRequestCookieNames.USER),n[e.keys.userAuthUserId]=r[e.keys.userAuthUserId]||this._getId(ymt.HttpRequestCookieNames.AUTH_USER),n[e.keys.operationName]=this.getOperationName(r),n[e.keys.operationParentId]=this.getOperationParentId(r),n[e.keys.operationId]=this.getOperationId(r),n},e.prototype.getOperationId=function(r){return r[e.keys.operationId]||this.operationId},e.prototype.getOperationParentId=function(r){return r[e.keys.operationParentId]||this.parentId||this.getOperationId(r)},e.prototype.getOperationName=function(r){if(r[e.keys.operationName])return r[e.keys.operationName];var n="";try{n=new Amt.URL(this.url).pathname}catch{}var o=this.method;return n&&(o+=" "+n),o},e.prototype.getRequestId=function(){return this.requestId},e.prototype.getCorrelationContextHeader=function(){return this.correlationContextHeader},e.prototype.getTraceparent=function(){return this.traceparent},e.prototype.getTracestate=function(){return this.tracestate},e.prototype.getLegacyRootId=function(){return this.legacyRootId},e.prototype._getAbsoluteUrl=function(r){if(!r.headers)return r.url;var n=r.connection?r.connection.encrypted:null,o=n||r.headers["x-forwarded-proto"]=="https"?"https":"http",s=o+"://"+r.headers.host+"/",c="",l="";try{var u=new Amt.URL(r.url,s);c=u.pathname,l=u.search}catch{}var d=Amt.format({protocol:o,host:r.headers.host,pathname:c,search:l});return d},e.prototype._getIp=function(){var r=/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/,n=a(function(s){var c=r.exec(s);if(c)return c[0]},"check"),o=n(this.rawHeaders["x-forwarded-for"])||n(this.rawHeaders["x-client-ip"])||n(this.rawHeaders["x-real-ip"])||n(this.connectionRemoteAddress)||n(this.socketRemoteAddress)||n(this.legacySocketRemoteAddress);return!o&&this.connectionRemoteAddress&&this.connectionRemoteAddress.substr&&this.connectionRemoteAddress.substr(0,2)==="::"&&(o="127.0.0.1"),o},e.prototype._getId=function(r){var n=this.rawHeaders&&this.rawHeaders.cookie&&typeof this.rawHeaders.cookie=="string"&&this.rawHeaders.cookie||"";if(r===ymt.HttpRequestCookieNames.AUTH_USER)try{n=decodeURI(n)}catch(s){n="",XCa.warn("Could not decode the auth cookie with error: ",lEr.dumpObj(s))}var o=e.parseId(lEr.getCookie(r,n));return o},e.prototype.setBackCompatFromThisTraceContext=function(){this.operationId=this.traceparent.traceId,this.traceparent.legacyRootId&&(this.legacyRootId=this.traceparent.legacyRootId),this.parentId=this.traceparent.parentId,this.traceparent.updateSpanId(),this.requestId=this.traceparent.getBackCompatRequestId()},e.prototype.parseHeaders=function(r,n){if(this.rawHeaders=r.headers||r.rawHeaders,this.userAgent=r.headers&&r.headers["user-agent"],this.sourceCorrelationId=lEr.getCorrelationContextTarget(r,ZT.requestContextSourceKey),r.headers){var o=r.headers[ZT.traceStateHeader]?r.headers[ZT.traceStateHeader].toString():null,s=r.headers[ZT.traceparentHeader]?r.headers[ZT.traceparentHeader].toString():null,c=r.headers[ZT.requestIdHeader]?r.headers[ZT.requestIdHeader].toString():null,l=r.headers[ZT.parentIdHeader]?r.headers[ZT.parentIdHeader].toString():null,u=r.headers[ZT.rootIdHeader]?r.headers[ZT.rootIdHeader].toString():null;this.correlationContextHeader=r.headers[ZT.correlationContextHeader]?r.headers[ZT.correlationContextHeader].toString():null,TG.w3cEnabled&&(s||o)?(this.traceparent=new uEr(s?s.toString():null),this.tracestate=s&&o&&new ZCa(o?o.toString():null),this.setBackCompatFromThisTraceContext()):c?TG.w3cEnabled?(this.traceparent=new uEr(null,c),this.setBackCompatFromThisTraceContext()):(this.parentId=c,this.requestId=TG.generateRequestId(this.parentId),this.operationId=TG.getRootId(this.requestId)):TG.w3cEnabled?(this.traceparent=new uEr,this.traceparent.parentId=l,this.traceparent.legacyRootId=u||l,this.setBackCompatFromThisTraceContext()):(this.parentId=l,this.requestId=TG.generateRequestId(u||this.parentId),this.correlationContextHeader=null,this.operationId=TG.getRootId(this.requestId)),n&&(this.requestId=n,this.operationId=TG.getRootId(this.requestId))}},e.parseId=function(r){var n=r.split("|");return n.length>0?n[0]:""},e.keys=new KCa.ContextTagKeys,e})(JCa);rbi.exports=eba});var Ebi=I((yo,ybi)=>{p();yo=ybi.exports=Ma;var fl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?fl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):fl=a(function(){},"debug");yo.SEMVER_SPEC_VERSION="2.0.0";var POe=256,Emt=Number.MAX_SAFE_INTEGER||9007199254740991,pEr=16,tba=POe-6,DOe=yo.re=[],Nu=yo.safeRe=[],tr=yo.src=[],ma=0,yEr="[a-zA-Z0-9-]",hEr=[["\\s",1],["\\d",POe],[yEr,tba]];function Tmt(t){for(var e=0;e)?=?)";var _mt=ma++;tr[_mt]=tr[H0e]+"|x|X|\\*";var vmt=ma++;tr[vmt]=tr[j0e]+"|x|X|\\*";var Jee=ma++;tr[Jee]="[v=\\s]*("+tr[vmt]+")(?:\\.("+tr[vmt]+")(?:\\.("+tr[vmt]+")(?:"+tr[_Er]+")?"+tr[MOe]+"?)?)?";var $0e=ma++;tr[$0e]="[v=\\s]*("+tr[_mt]+")(?:\\.("+tr[_mt]+")(?:\\.("+tr[_mt]+")(?:"+tr[vEr]+")?"+tr[MOe]+"?)?)?";var abi=ma++;tr[abi]="^"+tr[z0e]+"\\s*"+tr[Jee]+"$";var cbi=ma++;tr[cbi]="^"+tr[z0e]+"\\s*"+tr[$0e]+"$";var lbi=ma++;tr[lbi]="(?:^|[^\\d])(\\d{1,"+pEr+"})(?:\\.(\\d{1,"+pEr+"}))?(?:\\.(\\d{1,"+pEr+"}))?(?:$|[^\\d])";var Imt=ma++;tr[Imt]="(?:~>?)";var V0e=ma++;tr[V0e]="(\\s*)"+tr[Imt]+"\\s+";DOe[V0e]=new RegExp(tr[V0e],"g");Nu[V0e]=new RegExp(Tmt(tr[V0e]),"g");var rba="$1~",ubi=ma++;tr[ubi]="^"+tr[Imt]+tr[Jee]+"$";var dbi=ma++;tr[dbi]="^"+tr[Imt]+tr[$0e]+"$";var xmt=ma++;tr[xmt]="(?:\\^)";var W0e=ma++;tr[W0e]="(\\s*)"+tr[xmt]+"\\s+";DOe[W0e]=new RegExp(tr[W0e],"g");Nu[W0e]=new RegExp(Tmt(tr[W0e]),"g");var nba="$1^",fbi=ma++;tr[fbi]="^"+tr[xmt]+tr[Jee]+"$";var pbi=ma++;tr[pbi]="^"+tr[xmt]+tr[$0e]+"$";var TEr=ma++;tr[TEr]="^"+tr[z0e]+"\\s*("+bEr+")$|^$";var IEr=ma++;tr[IEr]="^"+tr[z0e]+"\\s*("+sbi+")$|^$";var Zee=ma++;tr[Zee]="(\\s*)"+tr[z0e]+"\\s*("+bEr+"|"+tr[Jee]+")";DOe[Zee]=new RegExp(tr[Zee],"g");Nu[Zee]=new RegExp(Tmt(tr[Zee]),"g");var iba="$1$2$3",hbi=ma++;tr[hbi]="^\\s*("+tr[Jee]+")\\s+-\\s+("+tr[Jee]+")\\s*$";var mbi=ma++;tr[mbi]="^\\s*("+tr[$0e]+")\\s+-\\s+("+tr[$0e]+")\\s*$";var gbi=ma++;tr[gbi]="(<|>)?=?\\s*\\*";for(D4=0;D4POe)return null;var r=e.loose?Nu[SEr]:Nu[CEr];if(!r.test(t))return null;try{return new Ma(t,e)}catch{return null}}a(Xee,"parse");yo.valid=oba;function oba(t,e){var r=Xee(t,e);return r?r.version:null}a(oba,"valid");yo.clean=sba;function sba(t,e){var r=Xee(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(sba,"clean");yo.SemVer=Ma;function Ma(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Ma){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>POe)throw new TypeError("version is longer than "+POe+" characters");if(!(this instanceof Ma))return new Ma(t,e);fl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Nu[SEr]:Nu[CEr]);if(!r)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Emt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Emt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Emt||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(n){if(/^[0-9]+$/.test(n)){var o=+n;if(o>=0&&o=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this};yo.inc=aba;function aba(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Ma(t,r).inc(e,n).version}catch{return null}}a(aba,"inc");yo.diff=cba;function cba(t,e){if(xEr(t,e))return null;var r=Xee(t),n=Xee(e),o="";if(r.prerelease.length||n.prerelease.length){o="pre";var s="prerelease"}for(var c in r)if((c==="major"||c==="minor"||c==="patch")&&r[c]!==n[c])return o+c;return s}a(cba,"diff");yo.compareIdentifiers=G0e;var nbi=/^[0-9]+$/;function G0e(t,e){var r=nbi.test(t),n=nbi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(NOe,"gt");yo.lt=Cmt;function Cmt(t,e,r){return Y8(t,e,r)<0}a(Cmt,"lt");yo.eq=xEr;function xEr(t,e,r){return Y8(t,e,r)===0}a(xEr,"eq");yo.neq=Abi;function Abi(t,e,r){return Y8(t,e,r)!==0}a(Abi,"neq");yo.gte=wEr;function wEr(t,e,r){return Y8(t,e,r)>=0}a(wEr,"gte");yo.lte=REr;function REr(t,e,r){return Y8(t,e,r)<=0}a(REr,"lte");yo.cmp=bmt;function bmt(t,e,r,n){switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return xEr(t,r,n);case"!=":return Abi(t,r,n);case">":return NOe(t,r,n);case">=":return wEr(t,r,n);case"<":return Cmt(t,r,n);case"<=":return REr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(bmt,"cmp");yo.Comparator=SR;function SR(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof SR){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof SR))return new SR(t,e);t=t.trim().split(/\s+/).join(" "),fl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===OOe?this.value="":this.value=this.operator+this.semver.version,fl("comp",this)}a(SR,"Comparator");var OOe={};SR.prototype.parse=function(t){var e=this.options.loose?Nu[TEr]:Nu[IEr],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=r[1],this.operator==="="&&(this.operator=""),r[2]?this.semver=new Ma(r[2],this.options.loose):this.semver=OOe};SR.prototype.toString=function(){return this.value};SR.prototype.test=function(t){return fl("Comparator.test",t,this.options.loose),this.semver===OOe?!0:(typeof t=="string"&&(t=new Ma(t,this.options)),bmt(t,this.operator,this.semver,this.options))};SR.prototype.intersects=function(t,e){if(!(t instanceof SR))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Mf(t.value,e),Smt(this.value,r,e);if(t.operator==="")return r=new Mf(this.value,e),Smt(t.semver,r,e);var n=(this.operator===">="||this.operator===">")&&(t.operator===">="||t.operator===">"),o=(this.operator==="<="||this.operator==="<")&&(t.operator==="<="||t.operator==="<"),s=this.semver.version===t.semver.version,c=(this.operator===">="||this.operator==="<=")&&(t.operator===">="||t.operator==="<="),l=bmt(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=bmt(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};yo.Range=Mf;function Mf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Mf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Mf(t.raw,e);if(t instanceof SR)return new Mf(t.value,e);if(!(this instanceof Mf))return new Mf(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}a(Mf,"Range");Mf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Mf.prototype.toString=function(){return this.range};Mf.prototype.parseRange=function(t){var e=this.options.loose,r=e?Nu[mbi]:Nu[hbi];t=t.replace(r,Iba),fl("hyphen replace",t),t=t.replace(Nu[Zee],iba),fl("comparator trim",t,Nu[Zee]),t=t.replace(Nu[V0e],rba),t=t.replace(Nu[W0e],nba);var n=e?Nu[TEr]:Nu[IEr],o=t.split(" ").map(function(s){return yba(s,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter(function(s){return!!s.match(n)})),o=o.map(function(s){return new SR(s,this.options)},this),o};Mf.prototype.intersects=function(t,e){if(!(t instanceof Mf))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(n){return t.set.some(function(o){return o.every(function(s){return n.intersects(s,e)})})})})};yo.toComparators=Aba;function Aba(t,e){return new Mf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(Aba,"toComparators");function yba(t,e){return fl("comp",t,e),t=vba(t,e),fl("caret",t),t=Eba(t,e),fl("tildes",t),t=bba(t,e),fl("xrange",t),t=Tba(t,e),fl("stars",t),t}a(yba,"parseComparator");function Iv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(Iv,"isX");function Eba(t,e){return t.trim().split(/\s+/).map(function(r){return _ba(r,e)}).join(" ")}a(Eba,"replaceTildes");function _ba(t,e){var r=e.loose?Nu[dbi]:Nu[ubi];return t.replace(r,function(n,o,s,c,l){fl("tilde",t,n,o,s,c,l);var u;return Iv(o)?u="":Iv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Iv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(fl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",fl("tilde return",u),u})}a(_ba,"replaceTilde");function vba(t,e){return t.trim().split(/\s+/).map(function(r){return Cba(r,e)}).join(" ")}a(vba,"replaceCarets");function Cba(t,e){fl("caret",t,e);var r=e.loose?Nu[pbi]:Nu[fbi];return t.replace(r,function(n,o,s,c,l){fl("caret",t,n,o,s,c,l);var u;return Iv(o)?u="":Iv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":Iv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(fl("replaceCaret pr",l),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+"-"+l+" <"+(+o+1)+".0.0"):(fl("no pr"),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+" <"+(+o+1)+".0.0"),fl("caret return",u),u})}a(Cba,"replaceCaret");function bba(t,e){return fl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return Sba(r,e)}).join(" ")}a(bba,"replaceXRanges");function Sba(t,e){t=t.trim();var r=e.loose?Nu[cbi]:Nu[abi];return t.replace(r,function(n,o,s,c,l,u){fl("xRange",t,n,o,s,c,l,u);var d=Iv(s),f=d||Iv(c),h=f||Iv(l),m=h;return o==="="&&m&&(o=""),d?o===">"||o==="<"?n="<0.0.0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),n=o+s+"."+c+"."+l):f?n=">="+s+".0.0 <"+(+s+1)+".0.0":h&&(n=">="+s+"."+c+".0 <"+s+"."+(+c+1)+".0"),fl("xRange return",n),n})}a(Sba,"replaceXRange");function Tba(t,e){return fl("replaceStars",t,e),t.trim().replace(Nu[gbi],"")}a(Tba,"replaceStars");function Iba(t,e,r,n,o,s,c,l,u,d,f,h,m){return Iv(r)?e="":Iv(n)?e=">="+r+".0.0":Iv(o)?e=">="+r+"."+n+".0":e=">="+e,Iv(u)?l="":Iv(d)?l="<"+(+u+1)+".0.0":Iv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(Iba,"hyphenReplace");Mf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Ma(t,this.options));for(var e=0;e0){var o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}a(xba,"testSet");yo.satisfies=Smt;function Smt(t,e,r){try{e=new Mf(e,r)}catch{return!1}return e.test(t)}a(Smt,"satisfies");yo.maxSatisfying=wba;function wba(t,e,r){var n=null,o=null;try{var s=new Mf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Ma(n,r))}),n}a(wba,"maxSatisfying");yo.minSatisfying=Rba;function Rba(t,e,r){var n=null,o=null;try{var s=new Mf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Ma(n,r))}),n}a(Rba,"minSatisfying");yo.minVersion=kba;function kba(t,e){t=new Mf(t,e);var r=new Ma("0.0.0");if(t.test(r)||(r=new Ma("0.0.0-0"),t.test(r)))return r;r=null;for(var n=0;n":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!r||NOe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(kba,"minVersion");yo.validRange=Pba;function Pba(t,e){try{return new Mf(t,e).range||"*"}catch{return null}}a(Pba,"validRange");yo.ltr=Dba;function Dba(t,e,r){return kEr(t,e,"<",r)}a(Dba,"ltr");yo.gtr=Nba;function Nba(t,e,r){return kEr(t,e,">",r)}a(Nba,"gtr");yo.outside=kEr;function kEr(t,e,r,n){t=new Ma(t,n),e=new Mf(e,n);var o,s,c,l,u;switch(r){case">":o=NOe,s=REr,c=Cmt,l=">",u=">=";break;case"<":o=Cmt,s=wEr,c=NOe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Smt(t,e,n))return!1;for(var d=0;d=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0}a(kEr,"outside");yo.prerelease=Mba;function Mba(t,e){var r=Xee(t,e);return r&&r.prerelease.length?r.prerelease:null}a(Mba,"prerelease");yo.intersects=Oba;function Oba(t,e,r){return t=new Mf(t,r),e=new Mf(e,r),t.intersects(e)}a(Oba,"intersects");yo.coerce=Lba;function Lba(t){if(t instanceof Ma)return t;if(typeof t!="string")return null;var e=t.match(Nu[lbi]);return e==null?null:Xee(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(Lba,"coerce")});var kmt=I((yyp,bbi)=>{"use strict";p();var vbi=x0e(),Y0e=vbi.wrap,wmt=vbi.unwrap,K8="wrap@before";function Rmt(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(Rmt,"defineProperty");function Bba(t,e){for(var r=e.length,n=0;n0&&Bba(t,o)}a(Fba,"_findAndProcess");function _bi(t,e){if(t){var r=t;if(typeof t=="function")r=e(t);else if(Array.isArray(t)){r=[];for(var n=0;n{"use strict";p();var Mc=require("util"),J8=require("assert"),Uba=kmt(),vd=require("async_hooks"),LOe="cls@contexts",BOe="error@context",Of=process.env.DEBUG_CLS_HOOKED,Nc=-1;Ibi.exports={getNamespace:Sbi,createNamespace:Qba,destroyNamespace:Tbi,reset:qba,ERROR_SYMBOL:BOe};function TR(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}a(TR,"Namespace");TR.prototype.set=a(function(e,r){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");if(this.active[e]=r,Of){let n=" ".repeat(this._indent<0?0:this._indent);Xd(n+"CONTEXT-SET KEY:"+e+"="+r+" in ns:"+this.name+" currentUid:"+Nc+" active:"+Mc.inspect(this.active,{showHidden:!0,depth:2,colors:!0}))}return r},"set");TR.prototype.get=a(function(e){if(!this.active){if(Of){let r=vd.currentId(),n=vd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Xd(`${o}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${Nc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length}`)}return}if(Of){let r=vd.executionAsyncId(),n=vd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Xd(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+Nc+" active:"+Mc.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),Xd(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${Nc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} active:${Mc.inspect(this.active)}`)}return this.active[e]},"get");TR.prototype.createContext=a(function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=Nc,Of){let r=vd.executionAsyncId(),n=vd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Xd(`${o}CONTEXT-CREATED Context: (${this.name}) currentUid:${Nc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} context:${Mc.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},"createContext");TR.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{if(Of){let n=vd.triggerAsyncId(),o=vd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Xd(`${s}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${Nc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} context:${Mc.inspect(r)}`)}return e(r),r}catch(n){throw n&&(n[BOe]=r),n}finally{if(Of){let n=vd.triggerAsyncId(),o=vd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Xd(`${s}CONTEXT-RUN END: (${this.name}) currentUid:${Nc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} ${Mc.inspect(r)}`)}this.exit(r)}},"run");TR.prototype.runAndReturn=a(function(e){let r;return this.run(function(n){r=e(n)}),r},"runAndReturn");TR.prototype.runPromise=a(function(e){let r=this.createContext();this.enter(r);let n=e(r);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return Of&&Xd("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+Nc+" len:"+this._set.length+" "+Mc.inspect(r)),n.then(o=>(Of&&Xd("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+Nc+" len:"+this._set.length+" "+Mc.inspect(r)),this.exit(r),o)).catch(o=>{throw o[BOe]=r,Of&&Xd("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+Nc+" len:"+this._set.length+" "+Mc.inspect(r)),this.exit(r),o})},"runPromise");TR.prototype.bind=a(function(e,r){r||(this.active?r=this.active:r=this.createContext());let n=this;return a(function(){n.enter(r);try{return e.apply(this,arguments)}catch(s){throw s&&(s[BOe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");TR.prototype.enter=a(function(e){if(J8.ok(e,"context must be provided for entering"),Of){let r=vd.executionAsyncId(),n=vd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Xd(`${o}CONTEXT-ENTER: (${this.name}) currentUid:${Nc} triggerId:${n} asyncHooksCurrentId:${r} len:${this._set.length} ${Mc.inspect(e)}`)}this._set.push(this.active),this.active=e},"enter");TR.prototype.exit=a(function(e){if(J8.ok(e,"context must be provided for exiting"),Of){let n=vd.executionAsyncId(),o=vd.triggerAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Xd(`${s}CONTEXT-EXIT: (${this.name}) currentUid:${Nc} triggerId:${o} asyncHooksCurrentId:${n} len:${this._set.length} ${Mc.inspect(e)}`)}if(this.active===e){J8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(Of&&Xd("??ERROR?? context exiting but not entered - ignoring: "+Mc.inspect(e)),J8.ok(r>=0,`context not currently entered; can't exit. +`+Mc.inspect(this)+` +`+Mc.inspect(e))):(J8.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");TR.prototype.bindEmitter=a(function(e){J8.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[LOe]||(c[LOe]=Object.create(null)),c[LOe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[LOe]))return c;let l=c,u=c[LOe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),Uba(e,o,s)},"bindEmitter");TR.prototype.fromException=a(function(e){return e[BOe]},"fromException");function Sbi(t){return process.namespaces[t]}a(Sbi,"getNamespace");function Qba(t){J8.ok(t,"namespace must be given a name."),Of&&Xd(`NS-CREATING NAMESPACE (${t})`);let e=new TR(t);return e.id=Nc,vd.createHook({init(n,o,s,c){if(Nc=vd.executionAsyncId(),e.active){if(e._contexts.set(n,e.active),Of){let l=" ".repeat(e._indent<0?0:e._indent);Xd(`${l}INIT [${o}] (${t}) asyncId:${n} currentUid:${Nc} triggerId:${s} active:${Mc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(Nc===0){let l=vd.triggerAsyncId(),u=e._contexts.get(l);if(u){if(e._contexts.set(n,u),Of){let d=" ".repeat(e._indent<0?0:e._indent);Xd(`${d}INIT USING CONTEXT FROM TRIGGERID [${o}] (${t}) asyncId:${n} currentUid:${Nc} triggerId:${l} active:${Mc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(Of){let d=" ".repeat(e._indent<0?0:e._indent);Xd(`${d}INIT MISSING CONTEXT [${o}] (${t}) asyncId:${n} currentUid:${Nc} triggerId:${l} active:${Mc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}if(Of&&o==="PROMISE"){Xd(Mc.inspect(c,{showHidden:!0}));let l=c.parentId,u=" ".repeat(e._indent<0?0:e._indent);Xd(`${u}INIT RESOURCE-PROMISE [${o}] (${t}) parentId:${l} asyncId:${n} currentUid:${Nc} triggerId:${s} active:${Mc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}},before(n){Nc=vd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(Nc),o){if(Of){let s=vd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);Xd(`${c}BEFORE (${t}) asyncId:${n} currentUid:${Nc} triggerId:${s} active:${Mc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Mc.inspect(o)}`),e._indent+=2}e.enter(o)}else if(Of){let s=vd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);Xd(`${c}BEFORE MISSING CONTEXT (${t}) asyncId:${n} currentUid:${Nc} triggerId:${s} active:${Mc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${Mc.inspect(e._contexts,{showHidden:!0,depth:2,colors:!0})}`),e._indent+=2}},after(n){Nc=vd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(Nc),o){if(Of){let s=vd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);Xd(`${c}AFTER (${t}) asyncId:${n} currentUid:${Nc} triggerId:${s} active:${Mc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Mc.inspect(o)}`)}e.exit(o)}else if(Of){let s=vd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);Xd(`${c}AFTER MISSING CONTEXT (${t}) asyncId:${n} currentUid:${Nc} triggerId:${s} active:${Mc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Mc.inspect(o)}`)}},destroy(n){if(Nc=vd.executionAsyncId(),Of){let o=vd.triggerAsyncId(),s=" ".repeat(e._indent<0?0:e._indent);Xd(`${s}DESTROY (${t}) currentUid:${Nc} asyncId:${n} triggerId:${o} active:${Mc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Mc.inspect(e._contexts.get(Nc))}`)}e._contexts.delete(n)}}).enable(),process.namespaces[t]=e,e}a(Qba,"createNamespace");function Tbi(t){let e=Sbi(t);J8.ok(e,`can't delete nonexistent namespace! "`+t+'"'),J8.ok(e.id,"don't assign to process.namespaces directly! "+Mc.inspect(e)),process.namespaces[t]=null}a(Tbi,"destroyNamespace");function qba(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){Tbi(t)}),process.namespaces=Object.create(null)}a(qba,"reset");process.namespaces={};function Xd(...t){Of&&process._rawDebug(`${Mc.format(...t)}`)}a(Xd,"debug2")});var Rbi=I((Syp,wbi)=>{"use strict";p();function jba(){}a(jba,"NextTickWrap");wbi.exports=a(function(){let e=this._hooks,r=this._state,n=process.nextTick;process.nextTick=function(){if(!r.enabled)return n.apply(process,arguments);let o=new Array(arguments.length);for(let u=0;u0&&process.once("uncaughtException",function(){e.post.call(c,l,!0),e.destroy.call(null,l)})}e.post.call(c,l,!1),e.destroy.call(null,l)},n.apply(process,o)}},"patch")});var Pbi=I((xyp,kbi)=>{"use strict";p();function Hba(){}a(Hba,"PromiseWrap");kbi.exports=a(function(){let e=this._hooks,r=this._state,n=global.Promise,o=n.prototype.then;n.prototype.then=u;function s(d,f,h,m){return typeof d!="function"?m?c(h):l(h):a(function(){e.pre.call(f,h);try{return d.apply(this,arguments)}finally{e.post.call(f,h,!1),e.destroy.call(null,h)}},"wrappedHandler")}a(s,"makeWrappedHandler");function c(d){return a(function(h){return e.destroy.call(null,d),h},"unhandledResolutionHandler")}a(c,"makeUnhandledResolutionHandler");function l(d){return a(function(h){throw e.destroy.call(null,d),h},"unhandledRejectedHandler")}a(l,"makeUnhandledRejectionHandler");function u(d,f){if(!r.enabled)return o.call(this,d,f);let h=new Hba,m=--r.counter;return e.init.call(h,m,0,null,null),o.call(this,s(d,h,m,!0),s(f,h,m,!1))}a(u,"wrappedThen")},"patchPromise")});var Nbi=I((kyp,Dbi)=>{"use strict";p();var XT=require("timers");function Gba(){}a(Gba,"TimeoutWrap");function $ba(){}a($ba,"IntervalWrap");function Vba(){}a(Vba,"ImmediateWrap");var Wba=new Map,zba=new Map,Yba=new Map,PEr=null,DEr=!1;Dbi.exports=a(function(){NEr(this._hooks,this._state,"setTimeout","clearTimeout",Gba,Wba,!0),NEr(this._hooks,this._state,"setInterval","clearInterval",$ba,zba,!1),NEr(this._hooks,this._state,"setImmediate","clearImmediate",Vba,Yba,!0),global.setTimeout=XT.setTimeout,global.setInterval=XT.setInterval,global.setImmediate=XT.setImmediate,global.clearTimeout=XT.clearTimeout,global.clearInterval=XT.clearInterval,global.clearImmediate=XT.clearImmediate},"patch");function NEr(t,e,r,n,o,s,c){let l=XT[r],u=XT[n];XT[r]=function(){if(!e.enabled)return l.apply(XT,arguments);let d=new Array(arguments.length);for(let A=0;A0&&process.once("uncaughtException",function(){t.post.call(h,m,!0),s.delete(g),t.destroy.call(null,m)})}t.post.call(h,m,!1),PEr=null,(c||DEr)&&(DEr=!1,s.delete(g),t.destroy.call(null,m))},g=l.apply(XT,d),s.set(g,m),g},XT[n]=function(d){if(PEr===d&&d!==null)DEr=!0;else if(s.has(d)){let f=s.get(d);s.delete(d),t.destroy.call(null,f)}u.apply(XT,arguments)}}a(NEr,"patchTimer")});var MEr=I((Nyp,Kba)=>{Kba.exports={name:"async-hook-jl",description:"Inspect the life of handle objects in node",version:"1.7.6",author:"Andreas Madsen ",main:"./index.js",scripts:{test:"node ./test/runner.js && eslint ."},repository:{type:"git",url:"git://github.com/jeff-lewis/async-hook-jl.git"},keywords:["async","async hooks","inspect","async wrap"],license:"MIT",dependencies:{"stack-chain":"^1.3.7"},devDependencies:{async:"1.5.x","cli-color":"1.1.x",eslint:"^3.4.0",endpoint:"0.4.x"},engines:{node:"^4.7 || >=6.9 || >=7.3"}}});var Lbi=I((Myp,Obi)=>{"use strict";p();var UOe=process.binding("async_wrap"),Jba=UOe.Providers.TIMERWRAP,Mbi={nextTick:Rbi(),promise:Pbi(),timers:Nbi()},FOe=new Set;function Zba(){this.enabled=!1,this.counter=0}a(Zba,"State");function OEr(){let t=this.initFns=[],e=this.preFns=[],r=this.postFns=[],n=this.destroyFns=[];this.init=function(o,s,c,l){if(s===Jba){FOe.add(o);return}for(let u of t)u(o,this,s,c,l)},this.pre=function(o){if(!FOe.has(o))for(let s of e)s(o,this)},this.post=function(o,s){if(!FOe.has(o))for(let c of r)c(o,this,s)},this.destroy=function(o){if(FOe.has(o)){FOe.delete(o);return}for(let s of n)s(o)}}a(OEr,"Hooks");OEr.prototype.add=function(t){t.init&&this.initFns.push(t.init),t.pre&&this.preFns.push(t.pre),t.post&&this.postFns.push(t.post),t.destroy&&this.destroyFns.push(t.destroy)};function Pmt(t,e){let r=t.indexOf(e);r!==-1&&t.splice(r,1)}a(Pmt,"removeElement");OEr.prototype.remove=function(t){t.init&&Pmt(this.initFns,t.init),t.pre&&Pmt(this.preFns,t.pre),t.post&&Pmt(this.postFns,t.post),t.destroy&&Pmt(this.destroyFns,t.destroy)};function QOe(){this._state=new Zba,this._hooks=new OEr,this.version=MEr().version,this.providers=UOe.Providers;for(let t of Object.keys(Mbi))Mbi[t].call(this);process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")&&console.warn("warning: you are using async-hook-jl which is unstable."),UOe.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}a(QOe,"AsyncHook");Obi.exports=QOe;QOe.prototype.addHooks=function(t){this._hooks.add(t)};QOe.prototype.removeHooks=function(t){this._hooks.remove(t)};QOe.prototype.enable=function(){this._state.enabled=!0,UOe.enable()};QOe.prototype.disable=function(){this._state.enabled=!1,UOe.disable()}});var LEr=I((Byp,Xba)=>{Xba.exports={name:"stack-chain",description:"API for combining call site modifiers",version:"1.3.7",author:"Andreas Madsen ",scripts:{test:"tap ./test/simple"},repository:{type:"git",url:"git://github.com/AndreasMadsen/stack-chain.git"},keywords:["stack","chain","trace","call site","concat","format"],devDependencies:{tap:"2.x.x","uglify-js":"2.5.x"},license:"MIT"}});var Fbi=I((Fyp,Bbi)=>{p();function e1a(t){try{return Error.prototype.toString.call(t)}catch(e){try{return""}catch{return""}}}a(e1a,"FormatErrorString");Bbi.exports=a(function(e,r){var n=[];n.push(e1a(e));for(var o=0;o"}catch{c=""}}n.push(" at "+c)}return n.join(` +`)},"FormatStackTrace")});var jbi=I((qyp,qbi)=>{p();var Dmt=Fbi();function Qbi(){this.extend=new qOe,this.filter=new qOe,this.format=new jOe,this.version=LEr().version}a(Qbi,"stackChain");var FEr=!1;Qbi.prototype.callSite=a(function t(e){e||(e={}),FEr=!0;var r={};Error.captureStackTrace(r,t);var n=r.stack;return FEr=!1,n=n.slice(e.slice||0),e.extend&&(n=this.extend._modify(r,n)),e.filter&&(n=this.filter._modify(r,n)),n},"collectCallSites");var IG=new Qbi;function qOe(){this._modifiers=[]}a(qOe,"TraceModifier");qOe.prototype._modify=function(t,e){for(var r=0,n=this._modifiers.length;r{p();if(global._stackChain)if(global._stackChain.version===LEr().version)UEr.exports=global._stackChain;else throw new Error("Conflicting version of stack-chain found");else UEr.exports=global._stackChain=jbi()});var Hbi=I((Vyp,qEr)=>{"use strict";p();var r1a=Lbi();if(global._asyncHook)if(global._asyncHook.version===MEr().version)qEr.exports=global._asyncHook;else throw new Error("Conflicting version of async-hook-jl found");else QEr().filter.attach(function(e,r){return r.filter(function(n){let o=n.getFileName();return!(o&&o.slice(0,__dirname.length)===__dirname)})}),qEr.exports=global._asyncHook=new r1a});var Ybi=I((zyp,zbi)=>{"use strict";p();var Ah=require("util"),Z8=require("assert"),n1a=kmt(),K0e=Hbi(),HOe="cls@contexts",GOe="error@context",$bi=[];for(let t in K0e.providers)$bi[K0e.providers[t]]=t;var Ip=process.env.DEBUG_CLS_HOOKED,Sm=-1;zbi.exports={getNamespace:Vbi,createNamespace:i1a,destroyNamespace:Wbi,reset:o1a,ERROR_SYMBOL:GOe};function IR(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map}a(IR,"Namespace");IR.prototype.set=a(function(e,r){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return Ip&&gh(" SETTING KEY:"+e+"="+r+" in ns:"+this.name+" uid:"+Sm+" active:"+Ah.inspect(this.active,!0)),this.active[e]=r,r},"set");IR.prototype.get=a(function(e){if(!this.active){Ip&&gh(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+Sm+" active:"+Ah.inspect(this.active,!0));return}return Ip&&gh(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+Sm+" active:"+Ah.inspect(this.active,!0)),this.active[e]},"get");IR.prototype.createContext=a(function(){Ip&&gh(" CREATING Context: "+this.name+" uid:"+Sm+" len:"+this._set.length+" active:"+Ah.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=Sm,Ip&&gh(" CREATED Context: "+this.name+" uid:"+Sm+" len:"+this._set.length+" context:"+Ah.inspect(e,!0,2,!0)),e},"createContext");IR.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{return Ip&&gh(" BEFORE RUN: "+this.name+" uid:"+Sm+" len:"+this._set.length+" "+Ah.inspect(r)),e(r),r}catch(n){throw n&&(n[GOe]=r),n}finally{Ip&&gh(" AFTER RUN: "+this.name+" uid:"+Sm+" len:"+this._set.length+" "+Ah.inspect(r)),this.exit(r)}},"run");IR.prototype.runAndReturn=a(function(e){var r;return this.run(function(n){r=e(n)}),r},"runAndReturn");IR.prototype.runPromise=a(function(e){let r=this.createContext();this.enter(r);let n=e(r);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return Ip&&gh(" BEFORE runPromise: "+this.name+" uid:"+Sm+" len:"+this._set.length+" "+Ah.inspect(r)),n.then(o=>(Ip&&gh(" AFTER runPromise: "+this.name+" uid:"+Sm+" len:"+this._set.length+" "+Ah.inspect(r)),this.exit(r),o)).catch(o=>{throw o[GOe]=r,Ip&&gh(" AFTER runPromise: "+this.name+" uid:"+Sm+" len:"+this._set.length+" "+Ah.inspect(r)),this.exit(r),o})},"runPromise");IR.prototype.bind=a(function(e,r){r||(this.active?r=this.active:r=this.createContext());let n=this;return a(function(){n.enter(r);try{return e.apply(this,arguments)}catch(s){throw s&&(s[GOe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");IR.prototype.enter=a(function(e){Z8.ok(e,"context must be provided for entering"),Ip&&gh(" ENTER "+this.name+" uid:"+Sm+" len:"+this._set.length+" context: "+Ah.inspect(e)),this._set.push(this.active),this.active=e},"enter");IR.prototype.exit=a(function(e){if(Z8.ok(e,"context must be provided for exiting"),Ip&&gh(" EXIT "+this.name+" uid:"+Sm+" len:"+this._set.length+" context: "+Ah.inspect(e)),this.active===e){Z8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(Ip&&gh("??ERROR?? context exiting but not entered - ignoring: "+Ah.inspect(e)),Z8.ok(r>=0,`context not currently entered; can't exit. +`+Ah.inspect(this)+` +`+Ah.inspect(e))):(Z8.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");IR.prototype.bindEmitter=a(function(e){Z8.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[HOe]||(c[HOe]=Object.create(null)),c[HOe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[HOe]))return c;let l=c,u=c[HOe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),n1a(e,o,s)},"bindEmitter");IR.prototype.fromException=a(function(e){return e[GOe]},"fromException");function Vbi(t){return process.namespaces[t]}a(Vbi,"getNamespace");function i1a(t){Z8.ok(t,"namespace must be given a name."),Ip&&gh("CREATING NAMESPACE "+t);let e=new IR(t);return e.id=Sm,K0e.addHooks({init(r,n,o,s,c){Sm=r,s?(e._contexts.set(r,e._contexts.get(s)),Ip&&gh("PARENTID: "+t+" uid:"+r+" parent:"+s+" provider:"+o)):e._contexts.set(Sm,e.active),Ip&&gh("INIT "+t+" uid:"+r+" parent:"+s+" provider:"+$bi[o]+" active:"+Ah.inspect(e.active,!0))},pre(r,n){Sm=r;let o=e._contexts.get(r);o?(Ip&&gh(" PRE "+t+" uid:"+r+" handle:"+Nmt(n)+" context:"+Ah.inspect(o)),e.enter(o)):Ip&&gh(" PRE MISSING CONTEXT "+t+" uid:"+r+" handle:"+Nmt(n))},post(r,n){Sm=r;let o=e._contexts.get(r);o?(Ip&&gh(" POST "+t+" uid:"+r+" handle:"+Nmt(n)+" context:"+Ah.inspect(o)),e.exit(o)):Ip&&gh(" POST MISSING CONTEXT "+t+" uid:"+r+" handle:"+Nmt(n))},destroy(r){Sm=r,Ip&&gh("DESTROY "+t+" uid:"+r+" context:"+Ah.inspect(e._contexts.get(Sm))+" active:"+Ah.inspect(e.active,!0)),e._contexts.delete(r)}}),process.namespaces[t]=e,e}a(i1a,"createNamespace");function Wbi(t){let e=Vbi(t);Z8.ok(e,`can't delete nonexistent namespace! "`+t+'"'),Z8.ok(e.id,"don't assign to process.namespaces directly! "+Ah.inspect(e)),process.namespaces[t]=null}a(Wbi,"destroyNamespace");function o1a(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){Wbi(t)}),process.namespaces=Object.create(null)}a(o1a,"reset");process.namespaces={};K0e._state&&!K0e._state.enabled&&K0e.enable();function gh(t){process.env.DEBUG&&process._rawDebug(t)}a(gh,"debug2");function Nmt(t){if(!t)return t;if(typeof t=="function")return t.name?t.name:(t.toString().trim().match(/^function\s*([^\s(]+)/)||[])[1];if(t.constructor&&t.constructor.name)return t.constructor.name}a(Nmt,"getFunctionName");if(Ip){jEr=QEr();for(Gbi in jEr.filter._modifiers)jEr.filter.deattach(Gbi)}var jEr,Gbi});var Kbi=I((Jyp,HEr)=>{"use strict";p();var s1a=Ebi();process&&s1a.gte(process.versions.node,"8.0.0")?HEr.exports=xbi():HEr.exports=Ybi()});var p1i=I((Eo,f1i)=>{p();Eo=f1i.exports=Oa;var pl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?pl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):pl=a(function(){},"debug");Eo.SEMVER_SPEC_VERSION="2.0.0";var $Oe=256,Mmt=Number.MAX_SAFE_INTEGER||9007199254740991,GEr=16,a1a=$Oe-6,VOe=Eo.re=[],Mu=Eo.safeRe=[],rr=Eo.src=[],ga=0,YEr="[a-zA-Z0-9-]",$Er=[["\\s",1],["\\d",$Oe],[YEr,a1a]];function Qmt(t){for(var e=0;e<$Er.length;e++){var r=$Er[e][0],n=$Er[e][1];t=t.split(r+"*").join(r+"{0,"+n+"}").split(r+"+").join(r+"{1,"+n+"}")}return t}a(Qmt,"makeSafeRe");var J0e=ga++;rr[J0e]="0|[1-9]\\d*";var Z0e=ga++;rr[Z0e]="\\d+";var KEr=ga++;rr[KEr]="\\d*[a-zA-Z-]"+YEr+"*";var Zbi=ga++;rr[Zbi]="("+rr[J0e]+")\\.("+rr[J0e]+")\\.("+rr[J0e]+")";var Xbi=ga++;rr[Xbi]="("+rr[Z0e]+")\\.("+rr[Z0e]+")\\.("+rr[Z0e]+")";var VEr=ga++;rr[VEr]="(?:"+rr[J0e]+"|"+rr[KEr]+")";var WEr=ga++;rr[WEr]="(?:"+rr[Z0e]+"|"+rr[KEr]+")";var JEr=ga++;rr[JEr]="(?:-("+rr[VEr]+"(?:\\."+rr[VEr]+")*))";var ZEr=ga++;rr[ZEr]="(?:-?("+rr[WEr]+"(?:\\."+rr[WEr]+")*))";var zEr=ga++;rr[zEr]=YEr+"+";var zOe=ga++;rr[zOe]="(?:\\+("+rr[zEr]+"(?:\\."+rr[zEr]+")*))";var XEr=ga++,e1i="v?"+rr[Zbi]+rr[JEr]+"?"+rr[zOe]+"?";rr[XEr]="^"+e1i+"$";var e_r="[v=\\s]*"+rr[Xbi]+rr[ZEr]+"?"+rr[zOe]+"?",t_r=ga++;rr[t_r]="^"+e_r+"$";var nge=ga++;rr[nge]="((?:<|>)?=?)";var Omt=ga++;rr[Omt]=rr[Z0e]+"|x|X|\\*";var Lmt=ga++;rr[Lmt]=rr[J0e]+"|x|X|\\*";var ete=ga++;rr[ete]="[v=\\s]*("+rr[Lmt]+")(?:\\.("+rr[Lmt]+")(?:\\.("+rr[Lmt]+")(?:"+rr[JEr]+")?"+rr[zOe]+"?)?)?";var ege=ga++;rr[ege]="[v=\\s]*("+rr[Omt]+")(?:\\.("+rr[Omt]+")(?:\\.("+rr[Omt]+")(?:"+rr[ZEr]+")?"+rr[zOe]+"?)?)?";var t1i=ga++;rr[t1i]="^"+rr[nge]+"\\s*"+rr[ete]+"$";var r1i=ga++;rr[r1i]="^"+rr[nge]+"\\s*"+rr[ege]+"$";var n1i=ga++;rr[n1i]="(?:^|[^\\d])(\\d{1,"+GEr+"})(?:\\.(\\d{1,"+GEr+"}))?(?:\\.(\\d{1,"+GEr+"}))?(?:$|[^\\d])";var qmt=ga++;rr[qmt]="(?:~>?)";var tge=ga++;rr[tge]="(\\s*)"+rr[qmt]+"\\s+";VOe[tge]=new RegExp(rr[tge],"g");Mu[tge]=new RegExp(Qmt(rr[tge]),"g");var c1a="$1~",i1i=ga++;rr[i1i]="^"+rr[qmt]+rr[ete]+"$";var o1i=ga++;rr[o1i]="^"+rr[qmt]+rr[ege]+"$";var jmt=ga++;rr[jmt]="(?:\\^)";var rge=ga++;rr[rge]="(\\s*)"+rr[jmt]+"\\s+";VOe[rge]=new RegExp(rr[rge],"g");Mu[rge]=new RegExp(Qmt(rr[rge]),"g");var l1a="$1^",s1i=ga++;rr[s1i]="^"+rr[jmt]+rr[ete]+"$";var a1i=ga++;rr[a1i]="^"+rr[jmt]+rr[ege]+"$";var r_r=ga++;rr[r_r]="^"+rr[nge]+"\\s*("+e_r+")$|^$";var n_r=ga++;rr[n_r]="^"+rr[nge]+"\\s*("+e1i+")$|^$";var tte=ga++;rr[tte]="(\\s*)"+rr[nge]+"\\s*("+e_r+"|"+rr[ete]+")";VOe[tte]=new RegExp(rr[tte],"g");Mu[tte]=new RegExp(Qmt(rr[tte]),"g");var u1a="$1$2$3",c1i=ga++;rr[c1i]="^\\s*("+rr[ete]+")\\s+-\\s+("+rr[ete]+")\\s*$";var l1i=ga++;rr[l1i]="^\\s*("+rr[ege]+")\\s+-\\s+("+rr[ege]+")\\s*$";var u1i=ga++;rr[u1i]="(<|>)?=?\\s*\\*";for(N4=0;N4$Oe)return null;var r=e.loose?Mu[t_r]:Mu[XEr];if(!r.test(t))return null;try{return new Oa(t,e)}catch{return null}}a(rte,"parse");Eo.valid=d1a;function d1a(t,e){var r=rte(t,e);return r?r.version:null}a(d1a,"valid");Eo.clean=f1a;function f1a(t,e){var r=rte(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(f1a,"clean");Eo.SemVer=Oa;function Oa(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Oa){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>$Oe)throw new TypeError("version is longer than "+$Oe+" characters");if(!(this instanceof Oa))return new Oa(t,e);pl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Mu[t_r]:Mu[XEr]);if(!r)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Mmt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Mmt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Mmt||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(n){if(/^[0-9]+$/.test(n)){var o=+n;if(o>=0&&o=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this};Eo.inc=p1a;function p1a(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Oa(t,r).inc(e,n).version}catch{return null}}a(p1a,"inc");Eo.diff=h1a;function h1a(t,e){if(i_r(t,e))return null;var r=rte(t),n=rte(e),o="";if(r.prerelease.length||n.prerelease.length){o="pre";var s="prerelease"}for(var c in r)if((c==="major"||c==="minor"||c==="patch")&&r[c]!==n[c])return o+c;return s}a(h1a,"diff");Eo.compareIdentifiers=X0e;var Jbi=/^[0-9]+$/;function X0e(t,e){var r=Jbi.test(t),n=Jbi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(WOe,"gt");Eo.lt=Bmt;function Bmt(t,e,r){return X8(t,e,r)<0}a(Bmt,"lt");Eo.eq=i_r;function i_r(t,e,r){return X8(t,e,r)===0}a(i_r,"eq");Eo.neq=d1i;function d1i(t,e,r){return X8(t,e,r)!==0}a(d1i,"neq");Eo.gte=o_r;function o_r(t,e,r){return X8(t,e,r)>=0}a(o_r,"gte");Eo.lte=s_r;function s_r(t,e,r){return X8(t,e,r)<=0}a(s_r,"lte");Eo.cmp=Fmt;function Fmt(t,e,r,n){switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return i_r(t,r,n);case"!=":return d1i(t,r,n);case">":return WOe(t,r,n);case">=":return o_r(t,r,n);case"<":return Bmt(t,r,n);case"<=":return s_r(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(Fmt,"cmp");Eo.Comparator=xR;function xR(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof xR){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof xR))return new xR(t,e);t=t.trim().split(/\s+/).join(" "),pl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===YOe?this.value="":this.value=this.operator+this.semver.version,pl("comp",this)}a(xR,"Comparator");var YOe={};xR.prototype.parse=function(t){var e=this.options.loose?Mu[r_r]:Mu[n_r],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=r[1],this.operator==="="&&(this.operator=""),r[2]?this.semver=new Oa(r[2],this.options.loose):this.semver=YOe};xR.prototype.toString=function(){return this.value};xR.prototype.test=function(t){return pl("Comparator.test",t,this.options.loose),this.semver===YOe?!0:(typeof t=="string"&&(t=new Oa(t,this.options)),Fmt(t,this.operator,this.semver,this.options))};xR.prototype.intersects=function(t,e){if(!(t instanceof xR))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Lf(t.value,e),Umt(this.value,r,e);if(t.operator==="")return r=new Lf(this.value,e),Umt(t.semver,r,e);var n=(this.operator===">="||this.operator===">")&&(t.operator===">="||t.operator===">"),o=(this.operator==="<="||this.operator==="<")&&(t.operator==="<="||t.operator==="<"),s=this.semver.version===t.semver.version,c=(this.operator===">="||this.operator==="<=")&&(t.operator===">="||t.operator==="<="),l=Fmt(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=Fmt(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};Eo.Range=Lf;function Lf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Lf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Lf(t.raw,e);if(t instanceof xR)return new Lf(t.value,e);if(!(this instanceof Lf))return new Lf(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}a(Lf,"Range");Lf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Lf.prototype.toString=function(){return this.range};Lf.prototype.parseRange=function(t){var e=this.options.loose,r=e?Mu[l1i]:Mu[c1i];t=t.replace(r,D1a),pl("hyphen replace",t),t=t.replace(Mu[tte],u1a),pl("comparator trim",t,Mu[tte]),t=t.replace(Mu[tge],c1a),t=t.replace(Mu[rge],l1a);var n=e?Mu[r_r]:Mu[n_r],o=t.split(" ").map(function(s){return S1a(s,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter(function(s){return!!s.match(n)})),o=o.map(function(s){return new xR(s,this.options)},this),o};Lf.prototype.intersects=function(t,e){if(!(t instanceof Lf))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(n){return t.set.some(function(o){return o.every(function(s){return n.intersects(s,e)})})})})};Eo.toComparators=b1a;function b1a(t,e){return new Lf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(b1a,"toComparators");function S1a(t,e){return pl("comp",t,e),t=x1a(t,e),pl("caret",t),t=T1a(t,e),pl("tildes",t),t=R1a(t,e),pl("xrange",t),t=P1a(t,e),pl("stars",t),t}a(S1a,"parseComparator");function xv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(xv,"isX");function T1a(t,e){return t.trim().split(/\s+/).map(function(r){return I1a(r,e)}).join(" ")}a(T1a,"replaceTildes");function I1a(t,e){var r=e.loose?Mu[o1i]:Mu[i1i];return t.replace(r,function(n,o,s,c,l){pl("tilde",t,n,o,s,c,l);var u;return xv(o)?u="":xv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":xv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(pl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",pl("tilde return",u),u})}a(I1a,"replaceTilde");function x1a(t,e){return t.trim().split(/\s+/).map(function(r){return w1a(r,e)}).join(" ")}a(x1a,"replaceCarets");function w1a(t,e){pl("caret",t,e);var r=e.loose?Mu[a1i]:Mu[s1i];return t.replace(r,function(n,o,s,c,l){pl("caret",t,n,o,s,c,l);var u;return xv(o)?u="":xv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":xv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(pl("replaceCaret pr",l),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+"-"+l+" <"+(+o+1)+".0.0"):(pl("no pr"),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+" <"+(+o+1)+".0.0"),pl("caret return",u),u})}a(w1a,"replaceCaret");function R1a(t,e){return pl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return k1a(r,e)}).join(" ")}a(R1a,"replaceXRanges");function k1a(t,e){t=t.trim();var r=e.loose?Mu[r1i]:Mu[t1i];return t.replace(r,function(n,o,s,c,l,u){pl("xRange",t,n,o,s,c,l,u);var d=xv(s),f=d||xv(c),h=f||xv(l),m=h;return o==="="&&m&&(o=""),d?o===">"||o==="<"?n="<0.0.0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),n=o+s+"."+c+"."+l):f?n=">="+s+".0.0 <"+(+s+1)+".0.0":h&&(n=">="+s+"."+c+".0 <"+s+"."+(+c+1)+".0"),pl("xRange return",n),n})}a(k1a,"replaceXRange");function P1a(t,e){return pl("replaceStars",t,e),t.trim().replace(Mu[u1i],"")}a(P1a,"replaceStars");function D1a(t,e,r,n,o,s,c,l,u,d,f,h,m){return xv(r)?e="":xv(n)?e=">="+r+".0.0":xv(o)?e=">="+r+"."+n+".0":e=">="+e,xv(u)?l="":xv(d)?l="<"+(+u+1)+".0.0":xv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(D1a,"hyphenReplace");Lf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Oa(t,this.options));for(var e=0;e0){var o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}a(N1a,"testSet");Eo.satisfies=Umt;function Umt(t,e,r){try{e=new Lf(e,r)}catch{return!1}return e.test(t)}a(Umt,"satisfies");Eo.maxSatisfying=M1a;function M1a(t,e,r){var n=null,o=null;try{var s=new Lf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Oa(n,r))}),n}a(M1a,"maxSatisfying");Eo.minSatisfying=O1a;function O1a(t,e,r){var n=null,o=null;try{var s=new Lf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Oa(n,r))}),n}a(O1a,"minSatisfying");Eo.minVersion=L1a;function L1a(t,e){t=new Lf(t,e);var r=new Oa("0.0.0");if(t.test(r)||(r=new Oa("0.0.0-0"),t.test(r)))return r;r=null;for(var n=0;n":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!r||WOe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(L1a,"minVersion");Eo.validRange=B1a;function B1a(t,e){try{return new Lf(t,e).range||"*"}catch{return null}}a(B1a,"validRange");Eo.ltr=F1a;function F1a(t,e,r){return a_r(t,e,"<",r)}a(F1a,"ltr");Eo.gtr=U1a;function U1a(t,e,r){return a_r(t,e,">",r)}a(U1a,"gtr");Eo.outside=a_r;function a_r(t,e,r,n){t=new Oa(t,n),e=new Lf(e,n);var o,s,c,l,u;switch(r){case">":o=WOe,s=s_r,c=Bmt,l=">",u=">=";break;case"<":o=Bmt,s=o_r,c=WOe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Umt(t,e,n))return!1;for(var d=0;d=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0}a(a_r,"outside");Eo.prerelease=Q1a;function Q1a(t,e){var r=rte(t,e);return r&&r.prerelease.length?r.prerelease:null}a(Q1a,"prerelease");Eo.intersects=q1a;function q1a(t,e,r){return t=new Lf(t,r),e=new Lf(e,r),t.intersects(e)}a(q1a,"intersects");Eo.coerce=j1a;function j1a(t){if(t instanceof Oa)return t;if(typeof t!="string")return null;var e=t.match(Mu[n1i]);return e==null?null:rte(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(j1a,"coerce")});var g1i=I((tEp,m1i)=>{p();var H1a=x0e().wrap,l_r=1,u_r=2,d_r=4,Gmt=8,Zl=[],G1a=0,QE=!1,xG=[],ige,f_r;function p_r(t,e){var r=t.length,n=e.length,o=[];if(r===0&&n===0)return o;for(var s=0;s0&&(Zl=xG.pop()),oge=void 0,n&&!QE},"asyncCatcher"),f_r=a(function(e,r,n){var o=[];QE=!0;for(var s=0;s0&&r[u].before(this,o[r[u].uid]);QE=!1;var d=e.apply(this,arguments);for(QE=!0,u=0;u0&&r[u].after(this,o[r[u].uid]);return QE=!1,Zl=xG.pop(),oge=void 0,d}},"asyncWrap"),H1a(process,"_fatalException",function(t){return a(function(r){return ige(r)||t(r)},"_asyncFatalException")})):(c_r=!1,ige=a(function(e){if(c_r)throw e;for(var r=!1,n=Zl.length,o=0;o0&&r[f].before(this,o[r[f].uid]);QE=!1;var h;try{h=e.apply(this,arguments)}catch(m){u=!0;for(var f=0;f0&&r[f].after(this,o[r[f].uid]);QE=!1}Zl=xG.pop()}return h}},"asyncWrap"),process.addListener("uncaughtException",ige));var Hmt,oge,c_r;function $1a(t,e,r){QE=!0;for(var n=0;n0)return f_r(t,r,e);return $1a(t,r,e)}a(V1a,"wrapCallback");function M4(t,e){typeof t.create=="function"&&(this.create=t.create,this.flags|=l_r),typeof t.before=="function"&&(this.before=t.before,this.flags|=u_r),typeof t.after=="function"&&(this.after=t.after,this.flags|=d_r),typeof t.error=="function"&&(this.error=t.error,this.flags|=Gmt),this.uid=++G1a,this.data=e===void 0?null:e}a(M4,"AsyncListener");M4.prototype.create=void 0;M4.prototype.before=void 0;M4.prototype.after=void 0;M4.prototype.error=void 0;M4.prototype.data=void 0;M4.prototype.uid=0;M4.prototype.flags=0;function h1i(t,e){if(typeof t!="object"||!t)throw new TypeError("callbacks argument must be an object");return t instanceof M4?t:new M4(t,e)}a(h1i,"createAsyncListener");function W1a(t,e){var r;t instanceof M4?r=t:r=h1i(t,e);for(var n=!1,o=0;o{"use strict";p();A1i.exports=(t,e)=>class extends t{static{a(this,"WrappedPromise")}constructor(n){var o,s;super(l);var c=this;try{n.apply(o,s)}catch(u){s[1](u)}return c;function l(u,d){o=this,s=[f,h];function f(m){return e(c,!1),u(m)}a(f,"wrappedResolve");function h(m){return e(c,!1),d(m)}a(h,"wrappedReject")}}}});var T1i=I(()=>{"use strict";p();if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var C1i=x0e(),Vmt=p1i(),Vb=C1i.wrap,wG=C1i.massWrap,Bf=g1i(),Y1a=require("util"),K1a=Vmt.gte(process.version,"6.0.0"),g_r=Vmt.gte(process.version,"7.0.0"),J1a=Vmt.gte(process.version,"8.0.0"),Z1a=Vmt.gte(process.version,"11.0.0"),O4=require("net");g_r&&!O4._normalizeArgs?O4._normalizeArgs=function(t){if(t.length===0)return[{},null];var e=t[0],r={};typeof e=="object"&&e!==null?r=e:nSa(e)?r.path=e:(r.port=e,t.length>1&&typeof t[1]=="string"&&(r.host=t[1]));var n=t[t.length-1];return typeof n!="function"?[r,null]:[r,n]}:!g_r&&!O4._normalizeConnectArgs&&(O4._normalizeConnectArgs=function(t){var e={};function r(o){return(o=Number(o))>=0?o:!1}a(r,"toNumber"),typeof t[0]=="object"&&t[0]!==null?e=t[0]:typeof t[0]=="string"&&r(t[0])===!1?e.path=t[0]:(e.port=t[0],typeof t[1]=="string"&&(e.host=t[1]));var n=t[t.length-1];return typeof n=="function"?[e,n]:[e]});"_setUpListenHandle"in O4.Server.prototype?Vb(O4.Server.prototype,"_setUpListenHandle",E1i):Vb(O4.Server.prototype,"_listen2",E1i);function E1i(t){return function(){this.on("connection",function(e){e._handle&&(e._handle.onread=Bf(e._handle.onread))});try{return t.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=Bf(this._handle.onconnection))}}}a(E1i,"wrapSetUpListenHandle");function b1i(t){if(t&&t._handle){var e=t._handle;e._originalOnread||(e._originalOnread=e.onread),e.onread=Bf(e._originalOnread)}}a(b1i,"patchOnRead");Vb(O4.Socket.prototype,"connect",function(t){return function(){var e;J1a&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?e=arguments[0]:e=g_r?O4._normalizeArgs(arguments):O4._normalizeConnectArgs(arguments),e[1]&&(e[1]=Bf(e[1]));var r=t.apply(this,e);return b1i(this),r}});var X1a=require("http");Vb(X1a.Agent.prototype,"addRequest",function(t){return function(e){var r=e.onSocket;return e.onSocket=Bf(function(n){return b1i(n),r.apply(this,arguments)}),t.apply(this,arguments)}});var h_r=require("child_process");function _1i(t){Array.isArray(t.stdio)&&t.stdio.forEach(function(e){e&&e._handle&&(e._handle.onread=Bf(e._handle.onread),Vb(e._handle,"close",Wmt))}),t._handle&&(t._handle.onexit=Bf(t._handle.onexit))}a(_1i,"wrapChildProcess");h_r.ChildProcess?Vb(h_r.ChildProcess.prototype,"spawn",function(t){return function(){var e=t.apply(this,arguments);return _1i(this),e}}):wG(h_r,["execFile","fork","spawn"],function(t){return function(){var e=t.apply(this,arguments);return _1i(e),e}});process._fatalException||(process._originalNextTick=process.nextTick);var E_r=[];process._nextDomainTick&&E_r.push("_nextDomainTick");process._tickDomainCallback&&E_r.push("_tickDomainCallback");wG(process,E_r,L4);Vb(process,"nextTick",Wmt);var __r=["setTimeout","setInterval"];global.setImmediate&&__r.push("setImmediate");var S1i=require("timers"),eSa=global.setTimeout===S1i.setTimeout;wG(S1i,__r,Wmt);eSa&&wG(global,__r,Wmt);var A_r=require("dns");wG(A_r,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],L4);A_r.resolveNaptr&&Vb(A_r,"resolveNaptr",L4);var ite=require("fs");wG(ite,["watch","rename","truncate","chown","fchown","chmod","fchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","watchFile","unwatchFile","exists"],L4);ite.lchown&&Vb(ite,"lchown",L4);ite.lchmod&&Vb(ite,"lchmod",L4);ite.ftruncate&&Vb(ite,"ftruncate",L4);var KOe;try{KOe=require("zlib")}catch{}KOe&&KOe.Deflate&&KOe.Deflate.prototype&&(nte=Object.getPrototypeOf(KOe.Deflate.prototype),nte._transform?Vb(nte,"_transform",L4):nte.write&&nte.flush&&nte.end&&wG(nte,["write","flush","end"],L4));var nte,y_r;try{y_r=require("crypto")}catch{}y_r&&(m_r=["pbkdf2","randomBytes"],Z1a||m_r.push("pseudoRandomBytes"),wG(y_r,m_r,L4));var m_r,$mt=!!global.Promise&&Promise.toString()==="function Promise() { [native code] }"&&Promise.toString.toString()==="function toString() { [native code] }";$mt&&(v1i=process.addAsyncListener({create:a(function(){$mt=!1},"create")}),global.Promise.resolve(!0).then(a(function(){$mt=!1},"notSync")),process.removeAsyncListener(v1i));var v1i;$mt&&tSa();function tSa(){var t=global.Promise;function e(c){if(!(this instanceof e))return t(c);if(typeof c!="function")return new t(c);var l,u,d=new t(f);d.__proto__=e.prototype;try{c.apply(l,u)}catch(h){u[1](h)}return d;function f(h,m){l=this,u=[g,A];function g(y){return n(d,!1),h(y)}a(g,"wrappedResolve");function A(y){return n(d,!1),m(y)}a(A,"wrappedReject")}}if(a(e,"wrappedPromise"),Y1a.inherits(e,t),Vb(t.prototype,"then",s),t.prototype.chain&&Vb(t.prototype,"chain",s),K1a)global.Promise=y1i()(t,n);else{var r=["all","race","reject","resolve","accept","defer"];r.forEach(function(c){typeof t[c]=="function"&&(e[c]=t[c])}),global.Promise=e}function n(c,l){(!c.__asl_wrapper||l)&&(c.__asl_wrapper=Bf(o))}a(n,"ensureAslWrapper");function o(c,l,u,d){var f;try{return f=l.call(c,u),{returnVal:f,error:!1}}catch(h){return{errorVal:h,error:!0}}finally{f instanceof t?d.__asl_wrapper=a(function(){var m=f.__asl_wrapper||o;return m.apply(this,arguments)},"proxyWrapper"):n(d,!0)}}a(o,"propagateAslWrapper");function s(c){return a(function(){var u=this,d=c.apply(u,Array.prototype.map.call(arguments,f));return d.__asl_wrapper=a(function(m,g,A,y){return u.__asl_wrapper?(u.__asl_wrapper(m,function(){},null,d),d.__asl_wrapper(m,g,A,y)):o(m,g,A,y)},"proxyWrapper"),d;function f(h){return typeof h!="function"?h:Bf(function(m){var g=(u.__asl_wrapper||o)(this,h,m,d);if(g.error)throw g.errorVal;return g.returnVal})}a(f,"bind")},"wrappedThen")}a(s,"wrapThen")}a(tSa,"wrapPromise");function L4(t){var e=a(function(){var r,n=arguments.length-1;if(typeof arguments[n]=="function"){r=Array(arguments.length);for(var o=0;o=0?t:!1}a(rSa,"toNumber");function nSa(t){return typeof t=="string"&&rSa(t)===!1}a(nSa,"isPipeName")});var k1i=I((fEp,R1i)=>{"use strict";p();var e6=require("assert"),iSa=kmt(),JOe="cls@contexts",v_r="error@context";process.addAsyncListener||T1i();function pD(t){this.name=t,this.active=null,this._set=[],this.id=null}a(pD,"Namespace");pD.prototype.set=function(t,e){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return this.active[t]=e,e};pD.prototype.get=function(t){if(this.active)return this.active[t]};pD.prototype.createContext=function(){return Object.create(this.active)};pD.prototype.run=function(t){var e=this.createContext();this.enter(e);try{return t(e),e}catch(r){throw r&&(r[v_r]=e),r}finally{this.exit(e)}};pD.prototype.runAndReturn=function(t){var e;return this.run(function(r){e=t(r)}),e};pD.prototype.bind=function(t,e){e||(this.active?e=this.active:e=this.createContext());var r=this;return function(){r.enter(e);try{return t.apply(this,arguments)}catch(n){throw n&&(n[v_r]=e),n}finally{r.exit(e)}}};pD.prototype.enter=function(t){e6.ok(t,"context must be provided for entering"),this._set.push(this.active),this.active=t};pD.prototype.exit=function(t){if(e6.ok(t,"context must be provided for exiting"),this.active===t){e6.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}var e=this._set.lastIndexOf(t);e6.ok(e>=0,"context not currently entered; can't exit"),e6.ok(e,"can't remove top context"),this._set.splice(e,1)};pD.prototype.bindEmitter=function(t){e6.ok(t.on&&t.addListener&&t.emit,"can only bind real EEs");var e=this,r="context@"+this.name;function n(s){s&&(s[JOe]||(s[JOe]=Object.create(null)),s[JOe][r]={namespace:e,context:e.active})}a(n,"attach");function o(s){if(!(s&&s[JOe]))return s;var c=s,l=s[JOe];return Object.keys(l).forEach(function(u){var d=l[u];c=d.namespace.bind(c,d.context)}),c}a(o,"bind"),iSa(t,n,o)};pD.prototype.fromException=function(t){return t[v_r]};function I1i(t){return process.namespaces[t]}a(I1i,"get");function oSa(t){e6.ok(t,"namespace must be given a name!");var e=new pD(t);return e.id=process.addAsyncListener({create:a(function(){return e.active},"create"),before:a(function(r,n){n&&e.enter(n)},"before"),after:a(function(r,n){n&&e.exit(n)},"after"),error:a(function(r){r&&e.exit(r)},"error")}),process.namespaces[t]=e,e}a(oSa,"create");function x1i(t){var e=I1i(t);e6.ok(e,"can't delete nonexistent namespace!"),e6.ok(e.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(e.id),process.namespaces[t]=null}a(x1i,"destroy");function w1i(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){x1i(t)}),process.namespaces=Object.create(null)}a(w1i,"reset");process.namespaces||w1i();R1i.exports={getNamespace:I1i,createNamespace:oSa,destroyNamespace:x1i,reset:w1i}});var kG=I(B4=>{"use strict";p();var sSa=B4&&B4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aSa=B4&&B4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),cSa=B4&&B4.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&sSa(e,t,r);return aSa(e,t),e};Object.defineProperty(B4,"__esModule",{value:!0});B4.CorrelationContextManager=void 0;var RG=Jl(),lSa=cSa(hmt()),ote=mmt(),C_r=Vyr(),P1i=fEr(),sge=dy(),uSa=(function(){function t(){}return a(t,"CorrelationContextManager"),t.getCurrentContext=function(){if(!t.enabled)return null;var e=t.session.get(t.CONTEXT_NAME);return e===void 0?null:e},t.generateContextObject=function(e,r,n,o,s,c){return r=r||e,this.enabled?{operation:{name:n,id:e,parentId:r,traceparent:s,tracestate:c},customProperties:new dSa(o)}:null},t.spanToContextObject=function(e,r,n){var o=new ote;return o.traceId=e.traceId,o.spanId=e.spanId,o.traceFlag=ote.formatOpenTelemetryTraceFlags(e.traceFlags)||ote.DEFAULT_TRACE_FLAG,o.parentId=r,t.generateContextObject(o.traceId,o.parentId,n,null,o)},t.runWithContext=function(e,r){var n;if(t.enabled)try{return t.session.bind(r,(n={},n[t.CONTEXT_NAME]=e,n))()}catch(o){RG.warn("Error binding to session context",sge.dumpObj(o))}return r()},t.wrapEmitter=function(e){if(t.enabled)try{t.session.bindEmitter(e)}catch(r){RG.warn("Error binding to session context",sge.dumpObj(r))}},t.wrapCallback=function(e,r){var n;if(t.enabled)try{return t.session.bind(e,r?(n={},n[t.CONTEXT_NAME]=r,n):void 0)}catch(o){RG.warn("Error binding to session context",sge.dumpObj(o))}return e},t.enable=function(e){if(!this.enabled){if(!this.isNodeVersionCompatible()){this.enabled=!1;return}if(!t.hasEverEnabled){this.forceClsHooked=e,this.hasEverEnabled=!0,typeof this.cls>"u"&&(t.forceClsHooked===!0||t.forceClsHooked===void 0&&t.shouldUseClsHooked()?this.cls=Kbi():this.cls=k1i());try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(r){RG.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",sge.dumpObj(r)),this.enabled=!1;return}lSa.registerContextPreservation(function(r){try{return t.session.bind(r)}catch(n){RG.warn("Error binding to session context",sge.dumpObj(n))}})}this.enabled=!0}},t.startOperation=function(e,r){var n=e&&e.traceContext||null,o=e&&e.spanContext?e:null,s=e&&e.traceId?e:null,c=e&&e.headers;if(o)return this.spanToContextObject(o.spanContext(),o.parentSpanId,o.name);if(s)return this.spanToContextObject(s,"|".concat(s.traceId,".").concat(s.spanId,"."),typeof r=="string"?r:"");var l=typeof r=="string"?r:"";if(n){var u=null,d=null;if(l=n.attributes.OperationName||l,r){var f=r;f.headers&&(f.headers.traceparent?u=new ote(f.headers.traceparent):f.headers["request-id"]&&(u=new ote(null,f.headers["request-id"])),f.headers.tracestate&&(d=new C_r(f.headers.tracestate)))}u||(u=new ote(n.traceParent||n.traceparent)),d||(d=new C_r(n.traceState||n.tracestate));var h=void 0;if(typeof r=="object"){var m=new P1i(r);h=m.getCorrelationContextHeader(),l=m.getOperationName({})}var g=t.generateContextObject(u.traceId,u.parentId,l,h,u,d);return g}if(c){var u=new ote(c.traceparent?c.traceparent.toString():null),d=new C_r(c.tracestate?c.tracestate.toString():null),m=new P1i(e),g=t.generateContextObject(u.traceId,u.parentId,m.getOperationName({}),m.getCorrelationContextHeader(),u,d);return g}return RG.warn("startOperation was called with invalid arguments",arguments),null},t.disable=function(){this.enabled=!1},t.reset=function(){if(t.hasEverEnabled){t.session=null;try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(e){RG.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",sge.dumpObj(e)),this.enabled=!1;return}}},t.isNodeVersionCompatible=function(){var e=process.versions.node.split(".");return parseInt(e[0])>3||parseInt(e[0])>2&&parseInt(e[1])>2},t.shouldUseClsHooked=function(){var e=process.versions.node.split(".");return parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=2},t.canUseClsHooked=function(){var e=process.versions.node.split("."),r=parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=0,n=parseInt(e[0])<8||parseInt(e[0])<=8&&parseInt(e[1])<2,o=parseInt(e[0])>4||parseInt(e[0])>=4&&parseInt(e[1])>=7;return!(r&&n)&&o},t.enabled=!1,t.hasEverEnabled=!1,t.forceClsHooked=void 0,t.CONTEXT_NAME="ApplicationInsights-Context",t})();B4.CorrelationContextManager=uSa;var dSa=(function(){function t(e){this.props=[],this.addHeaderData(e)}return a(t,"CustomPropertiesImpl"),t.prototype.addHeaderData=function(e){var r=e?e.split(", "):[];this.props=r.map(function(n){var o=n.split("=");return{key:o[0],value:o[1]}}).concat(this.props)},t.prototype.serializeToHeader=function(){return this.props.map(function(e){return"".concat(e.key,"=").concat(e.value)}).join(", ")},t.prototype.getProperty=function(e){for(var r=0;r'+r+""+s,n},"insertSnippetByIndex");Do.insertSnippetByIndex=lTa;var uTa=a(function(t){var e=!1,r=t.getHeader("Content-Type");return r&&(typeof r=="string"?e=r.indexOf("html")>=0:e=r.toString().indexOf("html")>=0),e},"isContentTypeHeaderHtml");Do.isContentTypeHeaderHtml=uTa});var R_r=I((XEp,J1i)=>{"use strict";p();var K1i=_d(),dTa=(function(){function t(){}return a(t,"ConnectionStringParser"),t.parse=function(e){if(!e)return{};var r=e.split(t._FIELDS_SEPARATOR),n=r.reduce(function(s,c){var l=c.split(t._FIELD_KEY_VALUE_SEPARATOR);if(l.length===2){var u=l[0].toLowerCase(),d=l[1];s[u]=d}return s},{});if(Object.keys(n).length>0){if(n.endpointsuffix){var o=n.location?n.location+".":"";n.ingestionendpoint=n.ingestionendpoint||"https://"+o+"dc."+n.endpointsuffix,n.liveendpoint=n.liveendpoint||"https://"+o+"live."+n.endpointsuffix}n.ingestionendpoint=n.ingestionendpoint||K1i.DEFAULT_BREEZE_ENDPOINT,n.liveendpoint=n.liveendpoint||K1i.DEFAULT_LIVEMETRICS_ENDPOINT}return n},t.isIkeyValid=function(e){if(!e||e=="")return!1;var r="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",n=new RegExp(r);return n.test(e)},t._FIELDS_SEPARATOR=";",t._FIELD_KEY_VALUE_SEPARATOR="=",t})();J1i.exports=dTa});var Z1i={};Ri(Z1i,{webSnippet:()=>fTa});var fTa,X1i=Se(()=>{p();fTa=`!function(T,l,y){var S=T.location,k="script",D="instrumentationKey",C="ingestionendpoint",I="disableExceptionTracking",E="ai.device.",b="toLowerCase",w="crossOrigin",N="POST",e="appInsightsSDK",t=y.name||"appInsights";(y.name||T[e])&&(T[e]=t);var n=T[t]||function(d){var g=!1,f=!1,m={initialize:!0,queue:[],sv:"5",version:2,config:d};function v(e,t){var n={},a="Browser";return n[E+"id"]=a[b](),n[E+"type"]=a,n["ai.operation.name"]=S&&S.pathname||"_unknown_",n["ai.internal.sdkVersion"]="javascript:snippet_"+(m.sv||m.version),{time:function(){var e=new Date;function t(e){var t=""+e;return 1===t.length&&(t="0"+t),t}return e.getUTCFullYear()+"-"+t(1+e.getUTCMonth())+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}(),iKey:e,name:"Microsoft.ApplicationInsights."+e.replace(/-/g,"")+"."+t,sampleRate:100,tags:n,data:{baseData:{ver:2}}}}var h=d.url||y.src;if(h){function a(e){var t,n,a,i,r,o,s,c,u,p,l;g=!0,m.queue=[],f||(f=!0,t=h,s=function(){var e={},t=d.connectionString;if(t)for(var n=t.split(";"),a=0;a{"use strict";p();var cbi=require("http"),lbi=require("https"),z0e=require("zlib"),M4=Kl(),_R=nbi(),ubi=OEr(),kOe=md(),dbi=LEr(),Hba=(abi(),ba(sbi)),Gba=(function(){function t(e){var r;if(this._isIkeyValid=!0,t.INSTANCE)throw new Error("Web snippet injection should be configured from the applicationInsights object");t.INSTANCE=this,t._aiUrl=kOe.WEB_INSTRUMENTATION_DEFAULT_SOURCE,t._aiDeprecatedUrl=kOe.WEB_INSTRUMENTATION_DEPRECATED_SOURCE;var n=this._getWebSnippetIkey((r=e.config)===null||r===void 0?void 0:r.webInstrumentationConnectionString);this._webInstrumentationIkey=n||e.config.instrumentationKey,this._clientWebInstrumentationConfig=e.config.webInstrumentationConfig,this._clientWebInstrumentationSrc=e.config.webInstrumentationSrc,this._statsbeat=e?.getStatsbeat()}return a(t,"WebSnippet"),t.prototype.enable=function(e,r){this._isEnabled=e,this._webInstrumentationIkey=this._getWebSnippetIkey(r)||this._webInstrumentationIkey,t._snippet=this._getWebInstrumentationReplacedStr(),this._isEnabled&&!this._isInitialized&&this._isIkeyValid?(this._statsbeat&&this._statsbeat.addFeature(kOe.StatsbeatFeature.BROWSER_SDK_LOADER),this._initialize()):this._isEnabled||this._statsbeat&&this._statsbeat.removeFeature(kOe.StatsbeatFeature.BROWSER_SDK_LOADER)},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype._getWebSnippetIkey=function(e){var r=null;try{var n=dbi.parse(e),o=n.instrumentationkey||"";dbi.isIkeyValid(o)?(this._isIkeyValid=!0,r=o):(this._isIkeyValid=!1,M4.info("Invalid web Instrumentation connection string, web Instrumentation is not enabled."))}catch(s){M4.info("get web snippet ikey error: "+s)}return r},t.prototype._getWebInstrumentationReplacedStr=function(){var e=this._getClientWebInstrumentationConfigStr(this._clientWebInstrumentationConfig),r=ubi.getOsPrefix(),n=ubi.getResourceProvider(),o="".concat(this._webInstrumentationIkey,`",\r +}});`});var oSi=I((n_p,iSi)=>{"use strict";p();var eSi=require("http"),tSi=require("https"),uge=require("zlib"),F4=Jl(),RR=Y1i(),rSi=w_r(),XOe=_d(),nSi=R_r(),pTa=(X1i(),Qa(Z1i)),hTa=(function(){function t(e){var r;if(this._isIkeyValid=!0,t.INSTANCE)throw new Error("Web snippet injection should be configured from the applicationInsights object");t.INSTANCE=this,t._aiUrl=XOe.WEB_INSTRUMENTATION_DEFAULT_SOURCE,t._aiDeprecatedUrl=XOe.WEB_INSTRUMENTATION_DEPRECATED_SOURCE;var n=this._getWebSnippetIkey((r=e.config)===null||r===void 0?void 0:r.webInstrumentationConnectionString);this._webInstrumentationIkey=n||e.config.instrumentationKey,this._clientWebInstrumentationConfig=e.config.webInstrumentationConfig,this._clientWebInstrumentationSrc=e.config.webInstrumentationSrc,this._statsbeat=e?.getStatsbeat()}return a(t,"WebSnippet"),t.prototype.enable=function(e,r){this._isEnabled=e,this._webInstrumentationIkey=this._getWebSnippetIkey(r)||this._webInstrumentationIkey,t._snippet=this._getWebInstrumentationReplacedStr(),this._isEnabled&&!this._isInitialized&&this._isIkeyValid?(this._statsbeat&&this._statsbeat.addFeature(XOe.StatsbeatFeature.BROWSER_SDK_LOADER),this._initialize()):this._isEnabled||this._statsbeat&&this._statsbeat.removeFeature(XOe.StatsbeatFeature.BROWSER_SDK_LOADER)},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype._getWebSnippetIkey=function(e){var r=null;try{var n=nSi.parse(e),o=n.instrumentationkey||"";nSi.isIkeyValid(o)?(this._isIkeyValid=!0,r=o):(this._isIkeyValid=!1,F4.info("Invalid web Instrumentation connection string, web Instrumentation is not enabled."))}catch(s){F4.info("get web snippet ikey error: "+s)}return r},t.prototype._getWebInstrumentationReplacedStr=function(){var e=this._getClientWebInstrumentationConfigStr(this._clientWebInstrumentationConfig),r=rSi.getOsPrefix(),n=rSi.getResourceProvider(),o="".concat(this._webInstrumentationIkey,`",\r `).concat(e,` disableIkeyDeprecationMessage: true,\r - sdkExtension: "`).concat(n).concat(r,"d_n_"),s=Hba.webSnippet.replace("INSTRUMENTATION_KEY",o);return this._clientWebInstrumentationSrc?s.replace("".concat(kOe.WEB_INSTRUMENTATION_DEFAULT_SOURCE,".2.min.js"),this._clientWebInstrumentationSrc):s},t.prototype._getClientWebInstrumentationConfigStr=function(e){var r="";try{e!=null&&e.length>0&&e.forEach(function(n){var o=n.name;if(o!==void 0){var s=n.value,c="";switch(typeof s){case"function":break;case"object":break;case"string":c=" ".concat(o,': "').concat(s,`",\r + sdkExtension: "`).concat(n).concat(r,"d_n_"),s=pTa.webSnippet.replace("INSTRUMENTATION_KEY",o);return this._clientWebInstrumentationSrc?s.replace("".concat(XOe.WEB_INSTRUMENTATION_DEFAULT_SOURCE,".2.min.js"),this._clientWebInstrumentationSrc):s},t.prototype._getClientWebInstrumentationConfigStr=function(e){var r="";try{e!=null&&e.length>0&&e.forEach(function(n){var o=n.name;if(o!==void 0){var s=n.value,c="";switch(typeof s){case"function":break;case"object":break;case"string":c=" ".concat(o,': "').concat(s,`",\r `),r+=c;break;default:c=" ".concat(o,": ").concat(s,`,\r -`),r+=c;break}}})}catch{this._isEnabled=!1,M4.info("Parse client web instrumentation error. Web Instrumentation is disabled")}return r},t.prototype._initialize=function(){this._isInitialized=!0;var e=cbi.createServer,r=lbi.createServer,n=this._isEnabled;cbi.createServer=function(o){var s=o;return s&&(o=a(function(c,l){var u=l.write,d=c.method=="GET";l.write=a(function(m,g,A){try{if(n&&d){var y=_R.getContentEncodingFromHeaders(l),E=void 0;if(typeof g=="string"&&(E=g),y==null)t.INSTANCE.ValidateInjection(l,m)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,void 0,E));else if(y.length){var _=y[0];arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,_)}}}catch(v){M4.warn("Inject snippet error: "+v)}return u.apply(l,arguments)},"wrap");var f=l.end;return l.end=a(function(m,g,A){if(n&&d)try{if(n&&d){var y=_R.getContentEncodingFromHeaders(l),E=void 0;if(typeof g=="string"&&(E=g),y==null)t.INSTANCE.ValidateInjection(l,m)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,void 0,E));else if(y.length){var _=y[0];arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,_)}}}catch(v){M4.warn("Inject snipet error: "+v)}return f.apply(l,arguments)},"wrap"),s(c,l)},"requestListener")),e(o)},lbi.createServer=function(o,s){var c=s;if(c)return s=a(function(l,u){var d=l.method=="GET",f=u.write,h=u.end;return u.write=a(function(g,A,y){try{if(n&&d){var E=_R.getContentEncodingFromHeaders(u),_=void 0;if(typeof A=="string"&&(_=A),E==null)t.INSTANCE.ValidateInjection(u,g)&&(arguments[0]=this.InjectWebSnippet(u,g,void 0,_));else if(E.length){var v=E[0];arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,v)}}}catch(b){M4.warn("Inject snippet error: "+b)}return f.apply(u,arguments)},"wrap"),u.end=a(function(g,A,y){try{if(n&&d){var E=_R.getContentEncodingFromHeaders(u),_=void 0;if(typeof A=="string"&&(_=A),E==null)t.INSTANCE.ValidateInjection(u,g)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,void 0,_));else if(E.length){var v=E[0];arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,v)}}}catch(b){M4.warn("Inject snippet error: "+b)}return h.apply(u,arguments)},"wrap"),c(l,u)},"httpsRequestListener"),r(o,s)}},t.prototype.ValidateInjection=function(e,r){try{if(!e||!r||e.statusCode!=200)return!1;var n=_R.isContentTypeHeaderHtml(e);if(!n)return!1;var o=r.slice().toString();if(o.indexOf("")>=0&&o.indexOf("")>=0&&o.indexOf(t._aiUrl)<0&&o.indexOf(t._aiDeprecatedUrl)<0)return!0}catch(s){M4.info("validate injections error: "+s)}return!1},t.prototype.InjectWebSnippet=function(e,r,n,o){try{var s=!!n;if(s)e.removeHeader("Content-Length"),r=this._getInjectedCompressBuffer(e,r,n),e.setHeader("Content-Length",r.length);else{var c=r.toString(),l=c.indexOf("");if(l<0)return r;var u=_R.insertSnippetByIndex(l,c,t._snippet);if(typeof r=="string")e.removeHeader("Content-Length"),r=u,e.setHeader("Content-Length",Buffer.byteLength(r));else if(Buffer.isBuffer(r)){var d=o||"utf8",f=_R.isBufferType(r,d);if(f){e.removeHeader("Content-Length");var h=Buffer.from(u).toString(d);r=Buffer.from(h,d),e.setHeader("Content-Length",r.length)}}}}catch(m){M4.warn("Failed to inject web snippet and change content-lenght headers. Exception:"+m)}return r},t.prototype._getInjectedCompressBuffer=function(e,r,n){try{switch(n){case _R.contentEncodingMethod.GZIP:var o=z0e.gunzipSync(r);if(this.ValidateInjection(e,o)){var s=this.InjectWebSnippet(e,o);r=z0e.gzipSync(s)}break;case _R.contentEncodingMethod.DEFLATE:var c=z0e.inflateSync(r);if(this.ValidateInjection(e,c)){var l=this.InjectWebSnippet(e,c);r=z0e.deflateSync(l)}break;case _R.contentEncodingMethod.BR:var u=_R.getBrotliDecompressSync(z0e),d=_R.getBrotliCompressSync(z0e);if(u&&d){var f=u(r);if(this.ValidateInjection(e,f)){var h=this.InjectWebSnippet(e,f);r=d(h)}break}}}catch(m){M4.info("get web injection compress buffer error: "+m)}return r},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1},t})();fbi.exports=Gba});var mbi=I((FEr,hbi)=>{"use strict";p();var $ba=FEr&&FEr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),vR=require("url"),BEr=ME(),Vba=ay(),Wba=S0e(),zba=myr(),Yba=Qee(),Kba=(function(t){$ba(e,t);function e(r,n){var o=t.call(this)||this;return n&&n.method&&r&&(o.method=n.method,o.url=e._getUrlFromRequestOptions(r,n),o.startTime=+new Date),o}return a(e,"HttpDependencyParser"),e.prototype.onError=function(r){this._setStatus(void 0,r)},e.prototype.onResponse=function(r){this._setStatus(r.statusCode,void 0),this.correlationId=Vba.getCorrelationContextTarget(r,Wba.requestContextTargetKey)},e.prototype.getDependencyTelemetry=function(r,n){var o=this.method.toUpperCase(),s=BEr.RemoteDependencyDataConstants.TYPE_HTTP,c="";try{var l=new vR.URL(this.url);l.search=void 0,l.hash=void 0,o+=" "+l.pathname,c=l.hostname,l.port&&(c+=":"+l.port)}catch{}this.correlationId?(s=BEr.RemoteDependencyDataConstants.TYPE_AI,this.correlationId!==Yba.correlationIdPrefix&&(c+=" | "+this.correlationId)):s=BEr.RemoteDependencyDataConstants.TYPE_HTTP;var u={id:n,name:o,data:this.url,duration:this.duration,success:this._isSuccess(),resultCode:this.statusCode?this.statusCode.toString():null,properties:this.properties||{},dependencyTypeName:s,target:c};if(r&&r.time?u.time=r.time:this.startTime&&(u.time=new Date(this.startTime)),r){for(var d in r)u[d]||(u[d]=r[d]);if(r.properties)for(var d in r.properties)u.properties[d]=r.properties[d]}return u},e._getUrlFromRequestOptions=function(r,n){if(typeof r=="string")if(r.indexOf("http://")===0||r.indexOf("https://")===0)try{r=new vR.URL(r)}catch{}else try{var o=new vR.URL("http://"+r);o.port==="443"?r=new vR.URL("https://"+r):r=new vR.URL("http://"+r)}catch{}else{if(r&&typeof vR.URL=="function"&&r instanceof vR.URL)return vR.format(r);var s=r;r={},s&&Object.keys(s).forEach(function(u){r[u]=s[u]})}if(r.path&&r.host)try{var c=new vR.URL(r.path,"http://"+r.host+r.path);r.pathname=c.pathname,r.search=c.search}catch{}if(r.path&&r.hostname&&!r.host)try{var c=new vR.URL(r.path,"http://"+r.hostname+r.path);r.pathname=c.pathname,r.search=c.search}catch{}if(r.host&&r.port)try{var l=new vR.URL("http://".concat(r.host));!l.port&&r.port&&(r.hostname=r.host,delete r.host)}catch{}return r.protocol=r.protocol||n.agent&&n.agent.protocol||n.protocol||void 0,r.hostname=r.hostname||"localhost",vR.format(r)},e})(zba);hbi.exports=Kba});var gbi=I(Y0e=>{"use strict";p();var Lmt=Y0e&&Y0e.__assign||function(){return Lmt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var t1a=$8&&$8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),r1a=$8&&$8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),n1a=$8&&$8.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&t1a(e,t,r);return r1a(e,t),e};Object.defineProperty($8,"__esModule",{value:!0});$8.spanToTelemetryContract=u1a;var Abi=require("url"),sD=(co(),ba(V5)),_s=(yht(),ba(TAr)),G8=n1a(md()),i1a=gbi(),o1a=ay();function s1a(t){for(var e={},r=0,n=Object.keys(t.attributes);r0&&(e["_MS.links"]=o1a.stringify(s)),e}a(s1a,"createPropertiesFromSpan");function a1a(t){return t===_s.DbSystemValues.DB2||t===_s.DbSystemValues.DERBY||t===_s.DbSystemValues.MARIADB||t===_s.DbSystemValues.MSSQL||t===_s.DbSystemValues.ORACLE||t===_s.DbSystemValues.SQLITE||t===_s.DbSystemValues.OTHER_SQL||t===_s.DbSystemValues.HSQLDB||t===_s.DbSystemValues.H2}a(a1a,"isSqlDB");function ybi(t){var e=t.attributes[_s.SemanticAttributes.HTTP_METHOD];if(e){var r=t.attributes[_s.SemanticAttributes.HTTP_URL];if(r)return String(r);var n=t.attributes[_s.SemanticAttributes.HTTP_SCHEME],o=t.attributes[_s.SemanticAttributes.HTTP_TARGET];if(n&&o){var s=t.attributes[_s.SemanticAttributes.HTTP_HOST];if(s)return"".concat(n,"://").concat(s).concat(o);var c=t.attributes[_s.SemanticAttributes.NET_PEER_PORT];if(c){var l=t.attributes[_s.SemanticAttributes.NET_PEER_NAME];if(l)return"".concat(n,"://").concat(l,":").concat(c).concat(o);var u=t.attributes[_s.SemanticAttributes.NET_PEER_IP];if(u)return"".concat(n,"://").concat(u,":").concat(c).concat(o)}}}return""}a(ybi,"getUrl");function QEr(t){var e=t.attributes[_s.SemanticAttributes.PEER_SERVICE],r=t.attributes[_s.SemanticAttributes.HTTP_HOST],n=t.attributes[_s.SemanticAttributes.HTTP_URL],o=t.attributes[_s.SemanticAttributes.NET_PEER_NAME],s=t.attributes[_s.SemanticAttributes.NET_PEER_IP];return e?String(e):r?String(r):n?String(n):o?String(o):s?String(s):""}a(QEr,"getDependencyTarget");function c1a(t){var e={name:t.name,success:t.status.code!=sD.SpanStatusCode.ERROR,resultCode:"0",duration:0,data:"",dependencyTypeName:""};t.kind===sD.SpanKind.PRODUCER&&(e.dependencyTypeName=G8.DependencyTypeName.QueueMessage),t.kind===sD.SpanKind.INTERNAL&&t.parentSpanId&&(e.dependencyTypeName=G8.DependencyTypeName.InProc);var r=t.attributes[_s.SemanticAttributes.HTTP_METHOD],n=t.attributes[_s.SemanticAttributes.DB_SYSTEM],o=t.attributes[_s.SemanticAttributes.RPC_SYSTEM];if(r){e.dependencyTypeName=G8.DependencyTypeName.Http;var s=t.attributes[_s.SemanticAttributes.HTTP_URL];if(s){var c="";try{var l=new Abi.URL(String(s));c=l.pathname}catch{}e.name="".concat(r," ").concat(c)}e.data=ybi(t);var u=t.attributes[_s.SemanticAttributes.HTTP_STATUS_CODE];u&&(e.resultCode=String(u));var d=QEr(t);if(d){try{var f=new RegExp(/(https?)(:\/\/.*)(:\d+)(\S*)/),h=f.exec(d);if(h!=null){var m=h[1],g=h[3];(m=="https"&&g==":443"||m=="http"&&g==":80")&&(d=h[1]+h[2]+h[4])}}catch{}e.target="".concat(d)}}else if(n){String(n)===_s.DbSystemValues.MYSQL?e.dependencyTypeName="mysql":String(n)===_s.DbSystemValues.POSTGRESQL?e.dependencyTypeName="postgresql":String(n)===_s.DbSystemValues.MONGODB?e.dependencyTypeName="mongodb":String(n)===_s.DbSystemValues.REDIS?e.dependencyTypeName="redis":a1a(String(n))?e.dependencyTypeName="SQL":e.dependencyTypeName=String(n);var A=t.attributes[_s.SemanticAttributes.DB_STATEMENT],y=t.attributes[_s.SemanticAttributes.DB_OPERATION];A?e.data=String(A):y&&(e.data=String(y));var d=QEr(t),E=t.attributes[_s.SemanticAttributes.DB_NAME];d?e.target=E?"".concat(d,"|").concat(E):"".concat(d):e.target=E?"".concat(E):"".concat(n)}else if(o){e.dependencyTypeName=G8.DependencyTypeName.Grpc;var _=t.attributes[_s.SemanticAttributes.RPC_GRPC_STATUS_CODE];_&&(e.resultCode=String(_));var d=QEr(t);d?e.target="".concat(d):o&&(e.target=String(o))}return e}a(c1a,"createDependencyData");function l1a(t){var e={name:t.name,success:t.status.code!=sD.SpanStatusCode.ERROR,resultCode:"0",duration:0,url:"",source:void 0},r=t.attributes[_s.SemanticAttributes.HTTP_METHOD],n=t.attributes[_s.SemanticAttributes.RPC_GRPC_STATUS_CODE];if(r){if(t.kind==sD.SpanKind.SERVER){var o=t.attributes[_s.SemanticAttributes.HTTP_ROUTE],s=t.attributes[_s.SemanticAttributes.HTTP_URL];if(o)e.name="".concat(r," ").concat(o);else if(s)try{var c=new Abi.URL(String(s));e.name="".concat(r," ").concat(c.pathname)}catch{}}e.url=ybi(t);var l=t.attributes[_s.SemanticAttributes.HTTP_STATUS_CODE];l&&(e.resultCode=String(l))}else n&&(e.resultCode=String(n));return e}a(l1a,"createRequestData");function u1a(t){var e;switch(t.kind){case sD.SpanKind.CLIENT:case sD.SpanKind.PRODUCER:case sD.SpanKind.INTERNAL:e=c1a(t);break;case sD.SpanKind.SERVER:case sD.SpanKind.CONSUMER:e=l1a(t);break}var r=t.spanContext?t.spanContext():t.context(),n="".concat(r.spanId),o=Math.round(t.duration[0]*1e3+t.duration[1]/1e6);return e.id=n,e.duration=o,e.properties=s1a(t),t.attributes[G8.AzNamespace]&&(t.kind===sD.SpanKind.INTERNAL&&(e.dependencyTypeName="".concat(G8.DependencyTypeName.InProc," | ").concat(t.attributes[G8.AzNamespace])),t.attributes[G8.AzNamespace]===G8.MicrosoftEventHub&&(0,i1a.parseEventHubSpan)(t,e)),e}a(u1a,"spanToTelemetryContract")});var vbi=I(CG=>{"use strict";p();var K0e=CG&&CG.__assign||function(){return K0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var f1a=zT&&zT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),p1a=zT&&zT.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),h1a=zT&&zT.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&f1a(e,t,r);return p1a(e,t),e};Object.defineProperty(zT,"__esModule",{value:!0});zT.subscriber=void 0;zT.enable=E1a;var DOe=(co(),ba(V5)),m1a=md(),qEr=Cp(),g1a=h1a(Ebi()),A1a=vbi(),Xee=[],y1a=a(function(t){try{var e=t.data,r=g1a.spanToTelemetryContract(e);A1a.AsyncScopeManager.with(e,function(){Xee.forEach(function(n){e.kind===DOe.SpanKind.SERVER||e.kind===DOe.SpanKind.CONSUMER?n.trackRequest(r):(e.kind===DOe.SpanKind.CLIENT||e.kind===DOe.SpanKind.INTERNAL||e.kind===DOe.SpanKind.PRODUCER)&&n.trackDependency(r)})})}catch{}},"subscriber");zT.subscriber=y1a;function E1a(t,e){if(t){var r=Xee.find(function(n){return n==e});if(r)return;Xee.length===0&&qEr.channel.subscribe("azure-coretracing",zT.subscriber,qEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(m1a.StatsbeatInstrumentation.AZURE_CORE_TRACING)}),Xee.push(e)}else Xee=Xee.filter(function(n){return n!=e}),Xee.length===0&&qEr.channel.unsubscribe("azure-coretracing",zT.subscriber)}a(E1a,"enable")});var bbi=I(tte=>{"use strict";p();Object.defineProperty(tte,"__esModule",{value:!0});tte.subscriber=void 0;tte.enable=C1a;var _1a=md(),jEr=Cp(),ete=[],v1a=a(function(t){t.data.event.commandName!=="ismaster"&&ete.forEach(function(e){var r=t.data.startedData&&t.data.startedData.databaseName||"Unknown database";e.trackDependency({target:r,data:t.data.event.commandName,name:t.data.event.commandName,duration:t.data.event.duration,success:t.data.succeeded,resultCode:t.data.succeeded?"0":"1",time:t.data.startedData.time,dependencyTypeName:"mongodb"})})},"subscriber");tte.subscriber=v1a;function C1a(t,e){if(t){var r=ete.find(function(n){return n==e});if(r)return;ete.length===0&&jEr.channel.subscribe("mongodb",tte.subscriber,jEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(_1a.StatsbeatInstrumentation.MONGODB)}),ete.push(e)}else ete=ete.filter(function(n){return n!=e}),ete.length===0&&jEr.channel.unsubscribe("mongodb",tte.subscriber)}a(C1a,"enable")});var Sbi=I(nte=>{"use strict";p();Object.defineProperty(nte,"__esModule",{value:!0});nte.subscriber=void 0;nte.enable=T1a;var b1a=md(),HEr=Cp(),rte=[],S1a=a(function(t){rte.forEach(function(e){var r=t.data.query||{},n=r.sql||"Unknown query",o=!t.data.err,s=r._connection||{},c=s.config||{},l=c.socketPath?c.socketPath:"".concat(c.host||"localhost",":").concat(c.port);e.trackDependency({target:l,data:n,name:n,duration:t.data.duration,success:o,resultCode:o?"0":"1",time:t.data.time,dependencyTypeName:"mysql"})})},"subscriber");nte.subscriber=S1a;function T1a(t,e){if(t){var r=rte.find(function(n){return n==e});if(r)return;rte.length===0&&HEr.channel.subscribe("mysql",nte.subscriber,HEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(b1a.StatsbeatInstrumentation.MYSQL)}),rte.push(e)}else rte=rte.filter(function(n){return n!=e}),rte.length===0&&HEr.channel.unsubscribe("mysql",nte.subscriber)}a(T1a,"enable")});var Tbi=I(ote=>{"use strict";p();Object.defineProperty(ote,"__esModule",{value:!0});ote.subscriber=void 0;ote.enable=w1a;var I1a=md(),GEr=Cp(),ite=[],x1a=a(function(t){ite.forEach(function(e){t.data.commandObj.command!=="info"&&e.trackDependency({target:t.data.address,name:t.data.commandObj.command,data:t.data.commandObj.command,duration:t.data.duration,success:!t.data.err,resultCode:t.data.err?"1":"0",time:t.data.time,dependencyTypeName:"redis"})})},"subscriber");ote.subscriber=x1a;function w1a(t,e){if(t){var r=ite.find(function(n){return n==e});if(r)return;ite.length===0&&GEr.channel.subscribe("redis",ote.subscriber,GEr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(I1a.StatsbeatInstrumentation.REDIS)}),ite.push(e)}else ite=ite.filter(function(n){return n!=e}),ite.length===0&&GEr.channel.unsubscribe("redis",ote.subscriber)}a(w1a,"enable")});var Ibi=I(ate=>{"use strict";p();Object.defineProperty(ate,"__esModule",{value:!0});ate.subscriber=void 0;ate.enable=P1a;var R1a=md(),$Er=Cp(),ste=[],k1a=a(function(t){ste.forEach(function(e){var r=t.data.query,n=r.preparable&&r.preparable.text||r.plan||r.text||"unknown query",o=!t.data.error,s="".concat(t.data.database.host,":").concat(t.data.database.port);e.trackDependency({target:s,data:n,name:n,duration:t.data.duration,success:o,resultCode:o?"0":"1",time:t.data.time,dependencyTypeName:"postgres"})})},"subscriber");ate.subscriber=k1a;function P1a(t,e){if(t){var r=ste.find(function(n){return n==e});if(r)return;ste.length===0&&$Er.channel.subscribe("postgres",ate.subscriber,$Er.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(R1a.StatsbeatInstrumentation.POSTGRES)}),ste.push(e)}else ste=ste.filter(function(n){return n!=e}),ste.length===0&&$Er.channel.unsubscribe("postgres",ate.subscriber)}a(P1a,"enable")});var X0e=I((V8,xbi)=>{"use strict";p();var D1a=V8&&V8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),N1a=V8&&V8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),M1a=V8&&V8.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&D1a(e,t,r);return N1a(e,t),e},Bmt=V8&&V8.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{"use strict";p();var wbi=require("http"),Rbi=require("https"),kbi=Kl(),Pbi=ay(),F1a=S0e(),WEr=Eyr(),W8=AG(),U1a=kmt(),Q1a=(function(){function t(e){if(t.INSTANCE)throw new Error("Server request tracking should be configured from the applicationInsights object");t.INSTANCE=this,this._client=e}return a(t,"AutoCollectHttpRequests"),t.prototype.enable=function(e){this._isEnabled=e,(this._isAutoCorrelating||this._isEnabled||U1a.isEnabled())&&!this._isInitialized&&(this.useAutoCorrelation(this._isAutoCorrelating),this._initialize())},t.prototype.useAutoCorrelation=function(e,r){e&&!this._isAutoCorrelating?W8.CorrelationContextManager.enable(r):!e&&this._isAutoCorrelating&&W8.CorrelationContextManager.disable(),this._isAutoCorrelating=e},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype.isAutoCorrelating=function(){return this._isAutoCorrelating},t.prototype._generateCorrelationContext=function(e){if(this._isAutoCorrelating)return W8.CorrelationContextManager.generateContextObject(e.getOperationId(this._client.context.tags),e.getRequestId(),e.getOperationName(this._client.context.tags),e.getCorrelationContextHeader(),e.getTraceparent(),e.getTracestate())},t.prototype._registerRequest=function(e,r,n){var o=this,s=new WEr(e),c=this._generateCorrelationContext(s);W8.CorrelationContextManager.runWithContext(c,function(){o._isEnabled&&(e[t.alreadyAutoCollectedFlag]=!0,t.trackRequest(o._client,{request:e,response:r},s)),typeof n=="function"&&n(e,r)})},t.prototype._initialize=function(){if(this._isInitialized=!0,!t.HANDLER_READY){t.HANDLER_READY=!0;var e=a(function(s){if(s){if(typeof s!="function")throw new Error("onRequest handler must be a function");return function(c,l){W8.CorrelationContextManager.wrapEmitter(c),W8.CorrelationContextManager.wrapEmitter(l);var u=c&&!c[t.alreadyAutoCollectedFlag];c&&u&&t.INSTANCE?t.INSTANCE._registerRequest(c,l,s):s(c,l)}}},"wrapOnRequestHandler"),r=a(function(s){var c=s.addListener.bind(s);s.addListener=function(l,u){switch(l){case"request":case"checkContinue":return c(l,e(u));default:return c(l,u)}},s.on=s.addListener},"wrapServerEventHandler"),n=wbi.createServer;wbi.createServer=function(s,c){if(c&&typeof c=="function"){var l=n(s,e(c));return r(l),l}else{var l=n(e(s));return r(l),l}};var o=Rbi.createServer;Rbi.createServer=function(s,c){var l=o(s,e(c));return r(l),l}}},t.trackRequestSync=function(e,r){if(!r.request||!r.response||!e){kbi.info("AutoCollectHttpRequests.trackRequestSync was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1,t.addResponseCorrelationIdHeader(e,r.response);var n=W8.CorrelationContextManager.getCurrentContext(),o=new WEr(r.request,n&&n.operation.parentId);n&&(n.operation.id=o.getOperationId(e.context.tags)||n.operation.id,n.operation.name=o.getOperationName(e.context.tags)||n.operation.name,n.operation.parentId=o.getRequestId()||n.operation.parentId,n.customProperties.addHeaderData(o.getCorrelationContextHeader())),t.endRequest(e,o,r,r.duration,r.error)},t.trackRequest=function(e,r,n){if(!r.request||!r.response||!e){kbi.info("AutoCollectHttpRequests.trackRequest was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1;var o=W8.CorrelationContextManager.getCurrentContext(),s=n||new WEr(r.request,o&&o.operation.parentId);Pbi.canIncludeCorrelationHeader(e,s.getUrl())&&t.addResponseCorrelationIdHeader(e,r.response),o&&!n&&(o.operation.id=s.getOperationId(e.context.tags)||o.operation.id,o.operation.name=s.getOperationName(e.context.tags)||o.operation.name,o.operation.parentId=s.getOperationParentId(e.context.tags)||o.operation.parentId,o.customProperties.addHeaderData(s.getCorrelationContextHeader())),r.response.once&&r.response.once("finish",function(){t.endRequest(e,s,r,null,null)}),r.request.on&&r.request.on("error",function(c){t.endRequest(e,s,r,null,c)}),r.request.on&&r.request.on("aborted",function(){var c="The request has been aborted and the network socket has closed.";t.endRequest(e,s,r,null,c)})},t.addResponseCorrelationIdHeader=function(e,r){if(e.config&&e.config.correlationId&&r.getHeader&&r.setHeader&&!r.headersSent){var n=r.getHeader(F1a.requestContextHeader);Pbi.safeIncludeCorrelationHeader(e,r,n)}},t.endRequest=function(e,r,n,o,s){if(!n.isProcessed){n.isProcessed=!0,s?r.onError(s,o):r.onResponse(n.response,o);var c=r.getRequestTelemetry(n);if(c.tagOverrides=r.getRequestTags(e.context.tags),n.tagOverrides)for(var l in n.tagOverrides)c.tagOverrides[l]=n.tagOverrides[l];var u=r.getLegacyRootId();u&&(c.properties.ai_legacyRootId=u),c.contextObjects=c.contextObjects||{},c.contextObjects["http.ServerRequest"]=n.request,c.contextObjects["http.ServerResponse"]=n.response,e.trackRequest(c)}},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1,W8.CorrelationContextManager.disable(),this._isAutoCorrelating=!1},t.HANDLER_READY=!1,t.alreadyAutoCollectedFlag="_appInsightsAutoCollected",t})();Dbi.exports=Q1a});var Obi=I((KEr,Mbi)=>{"use strict";p();var CR=KEr&&KEr.__assign||function(){return CR=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0?r:null,InstrumentationKey:n.instrumentationKey||"",Metrics:e.length>0?e:null,InvariantVersion:1,Timestamp:"/Date(".concat(Date.now(),")/"),Version:o.tags[o.keys.internalSdkVersion],StreamId:H1a,MachineName:s,Instance:c,RoleName:l};return u},t.createQuickPulseMetric=function(e){var r;return r={Name:e.name,Value:e.value,Weight:e.count||1},r},t.telemetryEnvelopeToQuickPulseDocument=function(e){switch(e.data.baseType){case cte.TelemetryTypeString.Event:return t.createQuickPulseEventDocument(e);case cte.TelemetryTypeString.Exception:return t.createQuickPulseExceptionDocument(e);case cte.TelemetryTypeString.Trace:return t.createQuickPulseTraceDocument(e);case cte.TelemetryTypeString.Dependency:return t.createQuickPulseDependencyDocument(e);case cte.TelemetryTypeString.Request:return t.createQuickPulseRequestDocument(e)}return null},t.createQuickPulseEventDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.name,o=CR(CR({},r),{Name:n});return o},t.createQuickPulseTraceDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.severityLevel||0,o=CR(CR({},r),{Message:e.data.baseData.message,SeverityLevel:cte.SeverityLevel[n]});return o},t.createQuickPulseExceptionDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.exceptions,o="",s="",c="";n&&n.length>0&&(n[0].parsedStack&&n[0].parsedStack.length>0?n[0].parsedStack.forEach(function(u){o+=u.assembly+` -`}):n[0].stack&&n[0].stack.length>0&&(o=n[0].stack),s=n[0].message,c=n[0].typeName);var l=CR(CR({},r),{Exception:o,ExceptionMessage:s,ExceptionType:c});return l},t.createQuickPulseRequestDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=CR(CR({},r),{Name:n.name,Success:n.success,Duration:n.duration,ResponseCode:n.responseCode,OperationName:n.name});return o},t.createQuickPulseDependencyDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=CR(CR({},r),{Name:n.name,Target:n.target,Success:n.success,Duration:n.duration,ResultCode:n.resultCode,CommandName:n.data,OperationName:r.OperationId,DependencyTypeName:n.type});return o},t.createQuickPulseDocument=function(e){var r,n,o,s;e.data.baseType?(n=Nbi.TelemetryTypeStringToQuickPulseType[e.data.baseType],r=Nbi.TelemetryTypeStringToQuickPulseDocumentType[e.data.baseType]):j1a.warn("Document type invalid; not sending live metric document",e.data.baseType),o=e.tags[t.keys.operationId],s=t.aggregateProperties(e);var c={DocumentType:r,__type:n,OperationId:o,Version:"1.0",Properties:s};return c},t.aggregateProperties=function(e){var r=[],n=e.data.baseData.measurements||{};for(var o in n)if(n.hasOwnProperty(o)){var s=n[o],c={key:o,value:s};r.push(c)}var l=e.data.baseData.properties||{};for(var o in l)if(l.hasOwnProperty(o)){var s=l[o],c={key:o,value:s};r.push(c)}return r},t.keys=new cte.ContextTagKeys,t})();Mbi.exports=G1a});var Bbi=I((nAp,Lbi)=>{"use strict";p();var $1a=a(function(){return(Date.now()+621355968e5)*1e4},"getTransmissionTime");Lbi.exports={getTransmissionTime:$1a}});var qbi=I((OOe,Qbi)=>{"use strict";p();var Fbi=OOe&&OOe.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},Ubi=OOe&&OOe.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0?r:this._config.quickPulseHost,m.method=bR.method,m.path="/QuickPulseService.svc/".concat(o,"?ikey=").concat(this._config.instrumentationKey),m.headers=(g={Expect:"100-continue"},g[bR.time]=z1a.getTransmissionTime(),g["Content-Type"]="application/json",g["Content-Length"]=Buffer.byteLength(c),g),m),s&&s.length>0&&s.forEach(function(E){return l.headers[E.name]=E.value}),o!=="post")return[3,4];if(u=this._getAuthorizationHandler?this._getAuthorizationHandler(this._config):null,!u)return[3,4];y.label=1;case 1:return y.trys.push([1,3,,4]),[4,u.addAuthorizationHeader(l)];case 2:return y.sent(),[3,4];case 3:return d=y.sent(),f="Failed to get AAD bearer token for the Application. Error:",JEr.info(t.TAG,f,d),[2];case 4:return this._config.httpsAgent?l.agent=this._config.httpsAgent:l.agent=ZEr.tlsRestrictedAgent,h=V1a.request(l,function(E){if(E.statusCode==200){var _=E.headers[bR.subscribed]==="true",v=null;try{v=E.headers[bR.endpointRedirect]?new Y1a.URL(E.headers[bR.endpointRedirect].toString()).host:null}catch(T){A._onError("Failed to parse redirect header from QuickPulse: "+ZEr.dumpObj(T))}var b=E.headers[bR.pollingIntervalHint]?parseInt(E.headers[bR.pollingIntervalHint].toString()):null;A._consecutiveErrors=0,n(_,E,v,b)}else A._onError("StatusCode:"+E.statusCode+" StatusMessage:"+E.statusMessage),n()}),h.on("error",function(E){A._onError(E),n()}),h.write(c),h.end(),[2]}})})},t.prototype._onError=function(e){this._consecutiveErrors++;var r="Transient error connecting to the Live Metrics endpoint. This packet will not appear in your Live Metrics Stream. Error:";this._consecutiveErrors%t.MAX_QPS_FAILURES_BEFORE_WARN===0?(r="Live Metrics endpoint could not be reached ".concat(this._consecutiveErrors," consecutive times. Most recent error:"),JEr.warn(t.TAG,r,e)):JEr.info(t.TAG,r,e)},t.TAG="QuickPulseSender",t.MAX_QPS_FAILURES_BEFORE_WARN=25,t})();Qbi.exports=K1a});var Wbi=I((LOe,Vbi)=>{"use strict";p();var jbi=LOe&&LOe.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},Hbi=LOe&&LOe.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0?this._pollingIntervalHint:t.PING_INTERVAL,o=this._isCollectingData?t.POST_INTERVAL:n,this._isCollectingData&&Date.now()-this._lastSuccessTime>=t.MAX_POST_WAIT_TIME&&!this._lastSendSucceeded?(this._isCollectingData=!1,o=t.FALLBACK_INTERVAL):!this._isCollectingData&&Date.now()-this._lastSuccessTime>=t.MAX_PING_WAIT_TIME&&!this._lastSendSucceeded&&(o=t.FALLBACK_INTERVAL),this._lastSendSucceeded=null,this._handle=setTimeout(this._goQuickPulse.bind(this),o),this._handle.unref(),[2]}})})},t.prototype._ping=function(e){this._sender.ping(e,this._redirectedHost,this._quickPulseDone.bind(this))},t.prototype._post=function(e){return jbi(this,void 0,void 0,function(){return Hbi(this,function(r){switch(r.label){case 0:return[4,this._sender.post(e,this._redirectedHost,this._quickPulseDone.bind(this))];case 1:return r.sent(),[2]}})})},t.prototype._quickPulseDone=function(e,r,n,o){e!=null?(this._isCollectingData!==e&&(Gbi.info("Live Metrics sending data",e),this.enableCollectors(e)),this._isCollectingData=e,n&&n.length>0&&(this._redirectedHost=n,Gbi.info("Redirecting endpoint to: ",n)),o&&o>0&&(this._pollingIntervalHint=o),r&&r.statusCode<300&&r.statusCode>=200?(this._lastSuccessTime=Date.now(),this._lastSendSucceeded=!0):this._lastSendSucceeded=!1):this._lastSendSucceeded=!1},t.MAX_POST_WAIT_TIME=2e4,t.MAX_PING_WAIT_TIME=6e4,t.FALLBACK_INTERVAL=6e4,t.PING_INTERVAL=5e3,t.POST_INTERVAL=1e3,t})();Vbi.exports=X1a});var Ybi=I(ege=>{"use strict";p();var Qmt=ege&&ege.__assign||function(){return Qmt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0)for(var l=0,u=s;l{"use strict";p();var Kbi=SG&&SG.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},Jbi=SG&&SG.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var oSa=Qee(),Xbi=LEr(),sSa=Kl(),e1i=md(),aSa=require("url"),cSa=tpt(),lSa=(function(){function t(e){this._endpointBase=e1i.DEFAULT_BREEZE_ENDPOINT,this._mergeConfig();var r=this._connectionString,n=Xbi.parse(e),o=Xbi.parse(r),s=!n.instrumentationkey&&Object.keys(n).length>0?null:e,c=this._instrumentationKey;this.instrumentationKey=n.instrumentationkey||s||o.instrumentationkey||c;var l="".concat(this.endpointUrl||n.ingestionendpoint||o.ingestionendpoint||this._endpointBase);l.endsWith("/")&&(l=l.slice(0,-1)),this.endpointUrl="".concat(l,"/v2.1/track"),this.maxBatchSize=this.maxBatchSize||250,this.maxBatchIntervalMs=this.maxBatchIntervalMs||15e3,this.disableAppInsights=this.disableAppInsights||!1,this.samplingPercentage=this.samplingPercentage||100,this.correlationIdRetryIntervalMs=this.correlationIdRetryIntervalMs||30*1e3,this.enableWebInstrumentation=this.enableWebInstrumentation||this.enableAutoWebSnippetInjection||!1,this.webInstrumentationConfig=this.webInstrumentationConfig||null,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation,this.correlationHeaderExcludedDomains=this.correlationHeaderExcludedDomains||["*.core.windows.net","*.core.chinacloudapi.cn","*.core.cloudapi.de","*.core.usgovcloudapi.net","*.core.microsoft.scloud","*.core.eaglex.ic.gov"],this.ignoreLegacyHeaders=this.ignoreLegacyHeaders||!1,this.profileQueryEndpoint=n.ingestionendpoint||o.ingestionendpoint||process.env[t.ENV_profileQueryEndpoint]||this._endpointBase,this.quickPulseHost=this.quickPulseHost||n.liveendpoint||o.liveendpoint||process.env[t.ENV_quickPulseHost]||e1i.DEFAULT_LIVEMETRICS_HOST,this.webInstrumentationConnectionString=this.webInstrumentationConnectionString||this._webInstrumentationConnectionString||"",this.webSnippetConnectionString=this.webInstrumentationConnectionString,this.quickPulseHost.match(/^https?:\/\//)&&(this.quickPulseHost=new aSa.URL(this.quickPulseHost).host),this.aadAudience=n.aadaudience||o.aadaudience}return a(t,"Config"),Object.defineProperty(t.prototype,"profileQueryEndpoint",{get:a(function(){return this._profileQueryEndpoint},"get"),set:a(function(e){this._profileQueryEndpoint=e,this.correlationId=oSa.correlationIdPrefix},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instrumentationKey",{get:a(function(){return this._instrumentationKey},"get"),set:a(function(e){t._validateInstrumentationKey(e)||sSa.warn("An invalid instrumentation key was provided. There may be resulting telemetry loss",this.instrumentationKey),this._instrumentationKey=e},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"webSnippetConnectionString",{get:a(function(){return this._webInstrumentationConnectionString},"get"),set:a(function(e){this._webInstrumentationConnectionString=e},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"webInstrumentationConnectionString",{get:a(function(){return this._webInstrumentationConnectionString},"get"),set:a(function(e){this._webInstrumentationConnectionString=e},"set"),enumerable:!1,configurable:!0}),t.prototype._mergeConfig=function(){var e=cSa.JsonConfig.getInstance();this._connectionString=e.connectionString,this._instrumentationKey=e.instrumentationKey,this.correlationHeaderExcludedDomains=e.correlationHeaderExcludedDomains,this.correlationIdRetryIntervalMs=e.correlationIdRetryIntervalMs,this.disableAllExtendedMetrics=e.disableAllExtendedMetrics,this.disableAppInsights=e.disableAppInsights,this.disableStatsbeat=e.disableStatsbeat,this.distributedTracingMode=e.distributedTracingMode,this.enableAutoCollectConsole=e.enableAutoCollectConsole,this.enableLoggerErrorToTrace=e.enableLoggerErrorToTrace,this.enableAutoCollectDependencies=e.enableAutoCollectDependencies,this.enableAutoCollectIncomingRequestAzureFunctions=e.enableAutoCollectIncomingRequestAzureFunctions,this.enableAutoCollectExceptions=e.enableAutoCollectExceptions,this.enableAutoCollectExtendedMetrics=e.enableAutoCollectExtendedMetrics,this.enableAutoCollectExternalLoggers=e.enableAutoCollectExternalLoggers,this.enableAutoCollectHeartbeat=e.enableAutoCollectHeartbeat,this.enableAutoCollectPerformance=e.enableAutoCollectPerformance,this.enableAutoCollectPreAggregatedMetrics=e.enableAutoCollectPreAggregatedMetrics,this.enableAutoCollectRequests=e.enableAutoCollectRequests,this.enableAutoDependencyCorrelation=e.enableAutoDependencyCorrelation,this.enableInternalDebugLogging=e.enableInternalDebugLogging,this.enableInternalWarningLogging=e.enableInternalWarningLogging,this.enableResendInterval=e.enableResendInterval,this.enableMaxBytesOnDisk=e.enableMaxBytesOnDisk,this.enableSendLiveMetrics=e.enableSendLiveMetrics,this.enableUseAsyncHooks=e.enableUseAsyncHooks,this.enableUseDiskRetryCaching=e.enableUseDiskRetryCaching,this.endpointUrl=e.endpointUrl,this.extendedMetricDisablers=e.extendedMetricDisablers,this.ignoreLegacyHeaders=e.ignoreLegacyHeaders,this.maxBatchIntervalMs=e.maxBatchIntervalMs,this.maxBatchSize=e.maxBatchSize,this.proxyHttpUrl=e.proxyHttpUrl,this.proxyHttpsUrl=e.proxyHttpsUrl,this.quickPulseHost=e.quickPulseHost,this.samplingPercentage=e.samplingPercentage,this.enableWebInstrumentation=e.enableWebInstrumentation,this._webInstrumentationConnectionString=e.webInstrumentationConnectionString,this.webInstrumentationConfig=e.webInstrumentationConfig,this.webInstrumentationSrc=e.webInstrumentationSrc},t._validateInstrumentationKey=function(e){var r="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",n=new RegExp(r);return n.test(e)},t.ENV_azurePrefix="APPSETTING_",t.ENV_iKey="APPINSIGHTS_INSTRUMENTATIONKEY",t.legacy_ENV_iKey="APPINSIGHTS_INSTRUMENTATION_KEY",t.ENV_profileQueryEndpoint="APPINSIGHTS_PROFILE_QUERY_ENDPOINT",t.ENV_quickPulseHost="APPINSIGHTS_QUICKPULSE_HOST",t})();t1i.exports=lSa});var i_r=I(n_r=>{"use strict";p();Object.defineProperty(n_r,"__esModule",{value:!0});n_r.createEmptyPipeline=uSa;var r1i=new Set(["Deserialize","Serialize","Retry","Sign"]),r_r=class t{static{a(this,"HttpPipeline")}constructor(e){var r;this._policies=[],this._policies=(r=e?.slice(0))!==null&&r!==void 0?r:[],this._orderedPolicies=void 0}addPolicy(e,r={}){if(r.phase&&r.afterPhase)throw new Error("Policies inside a phase cannot specify afterPhase.");if(r.phase&&!r1i.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!r1i.has(r.afterPhase))throw new Error(`Invalid afterPhase name: ${r.afterPhase}`);this._policies.push({policy:e,options:r}),this._orderedPolicies=void 0}removePolicy(e){let r=[];return this._policies=this._policies.filter(n=>e.name&&n.policy.name===e.name||e.phase&&n.options.phase===e.phase?(r.push(n.policy),!1):!0),this._orderedPolicies=void 0,r}sendRequest(e,r){return this.getOrderedPolicies().reduceRight((s,c)=>l=>c.sendRequest(l,s),s=>e.sendRequest(s))(r)}getOrderedPolicies(){return this._orderedPolicies||(this._orderedPolicies=this.orderPolicies()),this._orderedPolicies}clone(){return new t(this._policies)}static create(){return new t}orderPolicies(){let e=[],r=new Map;function n(A){return{name:A,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}a(n,"createPhase");let o=n("Serialize"),s=n("None"),c=n("Deserialize"),l=n("Retry"),u=n("Sign"),d=[o,s,c,l,u];function f(A){return A==="Retry"?l:A==="Serialize"?o:A==="Deserialize"?c:A==="Sign"?u:s}a(f,"getPhase");for(let A of this._policies){let y=A.policy,E=A.options,_=y.name;if(r.has(_))throw new Error("Duplicate policy names not allowed in pipeline");let v={policy:y,dependsOn:new Set,dependants:new Set};E.afterPhase&&(v.afterPhase=f(E.afterPhase),v.afterPhase.hasAfterPolicies=!0),r.set(_,v),f(E.phase).policies.add(v)}for(let A of this._policies){let{policy:y,options:E}=A,_=y.name,v=r.get(_);if(!v)throw new Error(`Missing node for policy ${_}`);if(E.afterPolicies)for(let b of E.afterPolicies){let T=r.get(b);T&&(v.dependsOn.add(T),T.dependants.add(v))}if(E.beforePolicies)for(let b of E.beforePolicies){let T=r.get(b);T&&(T.dependsOn.add(v),v.dependants.add(T))}}function h(A){A.hasRun=!0;for(let y of A.policies)if(!(y.afterPhase&&(!y.afterPhase.hasRun||y.afterPhase.policies.size))&&y.dependsOn.size===0){e.push(y.policy);for(let E of y.dependants)E.dependsOn.delete(y);r.delete(y.policy.name),A.policies.delete(y)}}a(h,"walkPhase");function m(){for(let A of d){if(h(A),A.policies.size>0&&A!==s){s.hasRun||h(s);return}A.hasAfterPolicies&&h(s)}}a(m,"walkPhases");let g=0;for(;r.size>0;){g++;let A=e.length;if(m(),e.length<=A&&g>1)throw new Error("Cannot satisfy policy dependencies due to requirements cycle.")}return e}};function uSa(){return r_r.create()}a(uSa,"createEmptyPipeline")});var lte=I(jmt=>{"use strict";p();Object.defineProperty(jmt,"__esModule",{value:!0});jmt.logger=void 0;var dSa=sht();jmt.logger=(0,dSa.createClientLogger)("core-rest-pipeline")});var s_r=I(o_r=>{"use strict";p();Object.defineProperty(o_r,"__esModule",{value:!0});o_r.getRandomIntegerInclusive=fSa;function fSa(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(fSa,"getRandomIntegerInclusive")});var n1i=I(a_r=>{"use strict";p();Object.defineProperty(a_r,"__esModule",{value:!0});a_r.calculateRetryDelay=hSa;var pSa=s_r();function hSa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,pSa.getRandomIntegerInclusive)(0,n/2)}}a(hSa,"calculateRetryDelay")});var Hmt=I(c_r=>{"use strict";p();Object.defineProperty(c_r,"__esModule",{value:!0});c_r.isObject=mSa;function mSa(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(mSa,"isObject")});var i1i=I(l_r=>{"use strict";p();Object.defineProperty(l_r,"__esModule",{value:!0});l_r.isError=ASa;var gSa=Hmt();function ASa(t){if((0,gSa.isObject)(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(ASa,"isError")});var s1i=I(Gmt=>{"use strict";p();Object.defineProperty(Gmt,"__esModule",{value:!0});Gmt.computeSha256Hmac=ySa;Gmt.computeSha256Hash=ESa;var o1i=require("node:crypto");async function ySa(t,e,r){let n=Buffer.from(t,"base64");return(0,o1i.createHmac)("sha256",n).update(e).digest(r)}a(ySa,"computeSha256Hmac");async function ESa(t,e){return(0,o1i.createHash)("sha256").update(t).digest(e)}a(ESa,"computeSha256Hash")});var a1i=I(d_r=>{"use strict";p();var u_r;Object.defineProperty(d_r,"__esModule",{value:!0});d_r.randomUUID=CSa;var _Sa=require("node:crypto"),vSa=typeof((u_r=globalThis?.crypto)===null||u_r===void 0?void 0:u_r.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):_Sa.randomUUID;function CSa(){return vSa()}a(CSa,"randomUUID")});var c1i=I(S0=>{"use strict";p();var f_r,p_r,h_r,m_r;Object.defineProperty(S0,"__esModule",{value:!0});S0.isReactNative=S0.isNodeRuntime=S0.isNodeLike=S0.isBun=S0.isDeno=S0.isWebWorker=S0.isBrowser=void 0;S0.isBrowser=typeof window<"u"&&typeof window.document<"u";S0.isWebWorker=typeof self=="object"&&typeof self?.importScripts=="function"&&(((f_r=self.constructor)===null||f_r===void 0?void 0:f_r.name)==="DedicatedWorkerGlobalScope"||((p_r=self.constructor)===null||p_r===void 0?void 0:p_r.name)==="ServiceWorkerGlobalScope"||((h_r=self.constructor)===null||h_r===void 0?void 0:h_r.name)==="SharedWorkerGlobalScope");S0.isDeno=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";S0.isBun=typeof Bun<"u"&&typeof Bun.version<"u";S0.isNodeLike=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((m_r=globalThis.process.versions)===null||m_r===void 0)&&m_r.node);S0.isNodeRuntime=S0.isNodeLike&&!S0.isBun&&!S0.isDeno;S0.isReactNative=typeof navigator<"u"&&navigator?.product==="ReactNative"});var l1i=I($mt=>{"use strict";p();Object.defineProperty($mt,"__esModule",{value:!0});$mt.uint8ArrayToString=bSa;$mt.stringToUint8Array=SSa;function bSa(t,e){return Buffer.from(t).toString(e)}a(bSa,"uint8ArrayToString");function SSa(t,e){return Buffer.from(t,e)}a(SSa,"stringToUint8Array")});var u1i=I(Vmt=>{"use strict";p();Object.defineProperty(Vmt,"__esModule",{value:!0});Vmt.Sanitizer=void 0;var TSa=Hmt(),g_r="REDACTED",ISa=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],xSa=["api-version"],A_r=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=ISa.concat(e),r=xSa.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||(0,TSa.isObject)(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,g_r);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=g_r;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=g_r;return r}};Vmt.Sanitizer=A_r});var Wmt=I(Aa=>{"use strict";p();Object.defineProperty(Aa,"__esModule",{value:!0});Aa.Sanitizer=Aa.uint8ArrayToString=Aa.stringToUint8Array=Aa.isWebWorker=Aa.isReactNative=Aa.isDeno=Aa.isNodeRuntime=Aa.isNodeLike=Aa.isBun=Aa.isBrowser=Aa.randomUUID=Aa.computeSha256Hmac=Aa.computeSha256Hash=Aa.isError=Aa.isObject=Aa.getRandomIntegerInclusive=Aa.calculateRetryDelay=void 0;var wSa=n1i();Object.defineProperty(Aa,"calculateRetryDelay",{enumerable:!0,get:a(function(){return wSa.calculateRetryDelay},"get")});var RSa=s_r();Object.defineProperty(Aa,"getRandomIntegerInclusive",{enumerable:!0,get:a(function(){return RSa.getRandomIntegerInclusive},"get")});var kSa=Hmt();Object.defineProperty(Aa,"isObject",{enumerable:!0,get:a(function(){return kSa.isObject},"get")});var PSa=i1i();Object.defineProperty(Aa,"isError",{enumerable:!0,get:a(function(){return PSa.isError},"get")});var d1i=s1i();Object.defineProperty(Aa,"computeSha256Hash",{enumerable:!0,get:a(function(){return d1i.computeSha256Hash},"get")});Object.defineProperty(Aa,"computeSha256Hmac",{enumerable:!0,get:a(function(){return d1i.computeSha256Hmac},"get")});var DSa=a1i();Object.defineProperty(Aa,"randomUUID",{enumerable:!0,get:a(function(){return DSa.randomUUID},"get")});var ute=c1i();Object.defineProperty(Aa,"isBrowser",{enumerable:!0,get:a(function(){return ute.isBrowser},"get")});Object.defineProperty(Aa,"isBun",{enumerable:!0,get:a(function(){return ute.isBun},"get")});Object.defineProperty(Aa,"isNodeLike",{enumerable:!0,get:a(function(){return ute.isNodeLike},"get")});Object.defineProperty(Aa,"isNodeRuntime",{enumerable:!0,get:a(function(){return ute.isNodeRuntime},"get")});Object.defineProperty(Aa,"isDeno",{enumerable:!0,get:a(function(){return ute.isDeno},"get")});Object.defineProperty(Aa,"isReactNative",{enumerable:!0,get:a(function(){return ute.isReactNative},"get")});Object.defineProperty(Aa,"isWebWorker",{enumerable:!0,get:a(function(){return ute.isWebWorker},"get")});var f1i=l1i();Object.defineProperty(Aa,"stringToUint8Array",{enumerable:!0,get:a(function(){return f1i.stringToUint8Array},"get")});Object.defineProperty(Aa,"uint8ArrayToString",{enumerable:!0,get:a(function(){return f1i.uint8ArrayToString},"get")});var NSa=u1i();Object.defineProperty(Aa,"Sanitizer",{enumerable:!0,get:a(function(){return NSa.Sanitizer},"get")})});var p1i=I(y_r=>{"use strict";p();Object.defineProperty(y_r,"__esModule",{value:!0});y_r.cancelablePromiseRace=MSa;async function MSa(t,e){var r,n;let o=new AbortController;function s(){o.abort()}a(s,"abortHandler"),(r=e?.abortSignal)===null||r===void 0||r.addEventListener("abort",s);try{return await Promise.race(t.map(c=>c({abortSignal:o.signal})))}finally{o.abort(),(n=e?.abortSignal)===null||n===void 0||n.removeEventListener("abort",s)}}a(MSa,"cancelablePromiseRace")});var h1i=I(zmt=>{"use strict";p();Object.defineProperty(zmt,"__esModule",{value:!0});zmt.AbortError=void 0;var E_r=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};zmt.AbortError=E_r});var FOe=I(Ymt=>{"use strict";p();Object.defineProperty(Ymt,"__esModule",{value:!0});Ymt.AbortError=void 0;var OSa=h1i();Object.defineProperty(Ymt,"AbortError",{enumerable:!0,get:a(function(){return OSa.AbortError},"get")})});var v_r=I(__r=>{"use strict";p();Object.defineProperty(__r,"__esModule",{value:!0});__r.createAbortablePromise=BSa;var LSa=FOe();function BSa(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new LSa.AbortError(o??"The operation was aborted."))}a(l,"rejectOnAbort");function u(){n?.removeEventListener("abort",d)}a(u,"removeListeners");function d(){r?.(),u(),l()}if(a(d,"onAbort"),n?.aborted)return l();try{t(f=>{u(),s(f)},f=>{u(),c(f)})}catch(f){c(f)}n?.addEventListener("abort",d)})}a(BSa,"createAbortablePromise")});var m1i=I(Kmt=>{"use strict";p();Object.defineProperty(Kmt,"__esModule",{value:!0});Kmt.delay=qSa;Kmt.calculateRetryDelay=jSa;var FSa=v_r(),USa=Wmt(),QSa="The delay was aborted.";function qSa(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return(0,FSa.createAbortablePromise)(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??QSa})}a(qSa,"delay");function jSa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,USa.getRandomIntegerInclusive)(0,n/2)}}a(jSa,"calculateRetryDelay")});var g1i=I(C_r=>{"use strict";p();Object.defineProperty(C_r,"__esModule",{value:!0});C_r.getErrorMessage=GSa;var HSa=Wmt();function GSa(t){if((0,HSa.isError)(t))return t.message;{let e;try{typeof t=="object"&&t?e=JSON.stringify(t):e=String(t)}catch{e="[unable to stringify input]"}return`Unknown error ${e}`}}a(GSa,"getErrorMessage")});var y1i=I(UOe=>{"use strict";p();Object.defineProperty(UOe,"__esModule",{value:!0});UOe.isDefined=b_r;UOe.isObjectWithProperties=$Sa;UOe.objectHasProperty=A1i;function b_r(t){return typeof t<"u"&&t!==null}a(b_r,"isDefined");function $Sa(t,e){if(!b_r(t)||typeof t!="object")return!1;for(let r of e)if(!A1i(t,r))return!1;return!0}a($Sa,"isObjectWithProperties");function A1i(t,e){return b_r(t)&&typeof t=="object"&&e in t}a(A1i,"objectHasProperty")});var O4=I(ls=>{"use strict";p();Object.defineProperty(ls,"__esModule",{value:!0});ls.isWebWorker=ls.isReactNative=ls.isNodeRuntime=ls.isNodeLike=ls.isNode=ls.isDeno=ls.isBun=ls.isBrowser=ls.objectHasProperty=ls.isObjectWithProperties=ls.isDefined=ls.getErrorMessage=ls.delay=ls.createAbortablePromise=ls.cancelablePromiseRace=void 0;ls.calculateRetryDelay=JSa;ls.computeSha256Hash=ZSa;ls.computeSha256Hmac=XSa;ls.getRandomIntegerInclusive=eTa;ls.isError=tTa;ls.isObject=rTa;ls.randomUUID=nTa;ls.uint8ArrayToString=iTa;ls.stringToUint8Array=oTa;var VSa=(m3(),ba(iQ)),dy=VSa.__importStar(Wmt()),WSa=p1i();Object.defineProperty(ls,"cancelablePromiseRace",{enumerable:!0,get:a(function(){return WSa.cancelablePromiseRace},"get")});var zSa=v_r();Object.defineProperty(ls,"createAbortablePromise",{enumerable:!0,get:a(function(){return zSa.createAbortablePromise},"get")});var YSa=m1i();Object.defineProperty(ls,"delay",{enumerable:!0,get:a(function(){return YSa.delay},"get")});var KSa=g1i();Object.defineProperty(ls,"getErrorMessage",{enumerable:!0,get:a(function(){return KSa.getErrorMessage},"get")});var S_r=y1i();Object.defineProperty(ls,"isDefined",{enumerable:!0,get:a(function(){return S_r.isDefined},"get")});Object.defineProperty(ls,"isObjectWithProperties",{enumerable:!0,get:a(function(){return S_r.isObjectWithProperties},"get")});Object.defineProperty(ls,"objectHasProperty",{enumerable:!0,get:a(function(){return S_r.objectHasProperty},"get")});function JSa(t,e){return dy.calculateRetryDelay(t,e)}a(JSa,"calculateRetryDelay");function ZSa(t,e){return dy.computeSha256Hash(t,e)}a(ZSa,"computeSha256Hash");function XSa(t,e,r){return dy.computeSha256Hmac(t,e,r)}a(XSa,"computeSha256Hmac");function eTa(t,e){return dy.getRandomIntegerInclusive(t,e)}a(eTa,"getRandomIntegerInclusive");function tTa(t){return dy.isError(t)}a(tTa,"isError");function rTa(t){return dy.isObject(t)}a(rTa,"isObject");function nTa(){return dy.randomUUID()}a(nTa,"randomUUID");ls.isBrowser=dy.isBrowser;ls.isBun=dy.isBun;ls.isDeno=dy.isDeno;ls.isNode=dy.isNodeLike;ls.isNodeLike=dy.isNodeLike;ls.isNodeRuntime=dy.isNodeRuntime;ls.isReactNative=dy.isReactNative;ls.isWebWorker=dy.isWebWorker;function iTa(t,e){return dy.uint8ArrayToString(t,e)}a(iTa,"uint8ArrayToString");function oTa(t,e){return dy.stringToUint8Array(t,e)}a(oTa,"stringToUint8Array")});var Zmt=I(Jmt=>{"use strict";p();Object.defineProperty(Jmt,"__esModule",{value:!0});Jmt.Sanitizer=void 0;var sTa=O4(),T_r="REDACTED",aTa=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],cTa=["api-version"],I_r=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=aTa.concat(e),r=cTa.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||(0,sTa.isObject)(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,T_r);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=T_r;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=T_r;return r}};Jmt.Sanitizer=I_r});var x_r=I(tge=>{"use strict";p();Object.defineProperty(tge,"__esModule",{value:!0});tge.logPolicyName=void 0;tge.logPolicy=dTa;var lTa=lte(),uTa=Zmt();tge.logPolicyName="logPolicy";function dTa(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:lTa.logger.info,n=new uTa.Sanitizer({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:tge.logPolicyName,async sendRequest(o,s){if(!r.enabled)return s(o);r(`Request: ${n.sanitize(o)}`);let c=await s(o);return r(`Response status code: ${c.status}`),r(`Headers: ${n.sanitize(c.headers)}`),c}}}a(dTa,"logPolicy")});var w_r=I(rge=>{"use strict";p();Object.defineProperty(rge,"__esModule",{value:!0});rge.redirectPolicyName=void 0;rge.redirectPolicy=fTa;rge.redirectPolicyName="redirectPolicy";var E1i=["GET","HEAD"];function fTa(t={}){let{maxRetries:e=20}=t;return{name:rge.redirectPolicyName,async sendRequest(r,n){let o=await n(r);return _1i(n,o,e)}}}a(fTa,"redirectPolicy");async function _1i(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&E1i.includes(o.method)||s===302&&E1i.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{"use strict";p();Object.defineProperty(Xmt,"__esModule",{value:!0});Xmt.getHeaderName=pTa;Xmt.setPlatformSpecificData=hTa;var v1i=(m3(),ba(iQ)),R_r=v1i.__importStar(require("node:os")),k_r=v1i.__importStar(require("node:process"));function pTa(){return"User-Agent"}a(pTa,"getHeaderName");async function hTa(t){if(k_r&&k_r.versions){let e=k_r.versions;e.bun?t.set("Bun",e.bun):e.deno?t.set("Deno",e.deno):e.node&&t.set("Node",e.node)}t.set("OS",`(${R_r.arch()}-${R_r.type()}-${R_r.release()})`)}a(hTa,"setPlatformSpecificData")});var TG=I(nge=>{"use strict";p();Object.defineProperty(nge,"__esModule",{value:!0});nge.DEFAULT_RETRY_POLICY_COUNT=nge.SDK_VERSION=void 0;nge.SDK_VERSION="1.16.3";nge.DEFAULT_RETRY_POLICY_COUNT=3});var P_r=I(e0t=>{"use strict";p();Object.defineProperty(e0t,"__esModule",{value:!0});e0t.getUserAgentHeaderName=ATa;e0t.getUserAgentValue=yTa;var b1i=C1i(),mTa=TG();function gTa(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(gTa,"getUserAgentString");function ATa(){return(0,b1i.getHeaderName)()}a(ATa,"getUserAgentHeaderName");async function yTa(t){let e=new Map;e.set("core-rest-pipeline",mTa.SDK_VERSION),await(0,b1i.setPlatformSpecificData)(e);let r=gTa(e);return t?`${t} ${r}`:r}a(yTa,"getUserAgentValue")});var D_r=I(ige=>{"use strict";p();Object.defineProperty(ige,"__esModule",{value:!0});ige.userAgentPolicyName=void 0;ige.userAgentPolicy=ETa;var T1i=P_r(),S1i=(0,T1i.getUserAgentHeaderName)();ige.userAgentPolicyName="userAgentPolicy";function ETa(t={}){let e=(0,T1i.getUserAgentValue)(t.userAgentPrefix);return{name:ige.userAgentPolicyName,async sendRequest(r,n){return r.headers.has(S1i)||r.headers.set(S1i,await e),n(r)}}}a(ETa,"userAgentPolicy")});var t0t=I(oge=>{"use strict";p();Object.defineProperty(oge,"__esModule",{value:!0});oge.isNodeReadableStream=I1i;oge.isWebReadableStream=x1i;oge.isReadableStream=_Ta;oge.isBlob=vTa;function I1i(t){return!!(t&&typeof t.pipe=="function")}a(I1i,"isNodeReadableStream");function x1i(t){return!!(t&&typeof t.getReader=="function"&&typeof t.tee=="function")}a(x1i,"isWebReadableStream");function _Ta(t){return I1i(t)||x1i(t)}a(_Ta,"isReadableStream");function vTa(t){return typeof t.stream=="function"}a(vTa,"isBlob")});var N_r=I(QOe=>{"use strict";p();Object.defineProperty(QOe,"__esModule",{value:!0});QOe.getRawContent=TTa;QOe.createFileFromStream=ITa;QOe.createFile=xTa;var CTa=O4(),bTa=t0t(),w1i={arrayBuffer:a(()=>{throw new Error("Not implemented")},"arrayBuffer"),slice:a(()=>{throw new Error("Not implemented")},"slice"),text:a(()=>{throw new Error("Not implemented")},"text")},r0t=Symbol("rawContent");function STa(t){return typeof t[r0t]=="function"}a(STa,"hasRawContent");function TTa(t){return STa(t)?t[r0t]():t.stream()}a(TTa,"getRawContent");function ITa(t,e,r={}){var n,o,s,c;return Object.assign(Object.assign({},w1i),{type:(n=r.type)!==null&&n!==void 0?n:"",lastModified:(o=r.lastModified)!==null&&o!==void 0?o:new Date().getTime(),webkitRelativePath:(s=r.webkitRelativePath)!==null&&s!==void 0?s:"",size:(c=r.size)!==null&&c!==void 0?c:-1,name:e,stream:a(()=>{let l=t();if((0,bTa.isNodeReadableStream)(l))throw new Error("Not supported: a Node stream was provided as input to createFileFromStream.");return l},"stream"),[r0t]:t})}a(ITa,"createFileFromStream");function xTa(t,e,r={}){var n,o,s;return CTa.isNodeLike?Object.assign(Object.assign({},w1i),{type:(n=r.type)!==null&&n!==void 0?n:"",lastModified:(o=r.lastModified)!==null&&o!==void 0?o:new Date().getTime(),webkitRelativePath:(s=r.webkitRelativePath)!==null&&s!==void 0?s:"",size:t.byteLength,name:e,arrayBuffer:a(async()=>t.buffer,"arrayBuffer"),stream:a(()=>new Blob([t]).stream(),"stream"),[r0t]:()=>t}):new File([t],e,r)}a(xTa,"createFile")});var P1i=I(O_r=>{"use strict";p();Object.defineProperty(O_r,"__esModule",{value:!0});O_r.concat=DTa;var z8=(m3(),ba(iQ)),M_r=require("node:stream"),wTa=t0t(),RTa=N_r();function R1i(){return z8.__asyncGenerator(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield z8.__await(e.read());if(r)return yield z8.__await(void 0);yield yield z8.__await(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(R1i,"streamAsyncIterator");function kTa(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=R1i.bind(t)),t.values||(t.values=R1i.bind(t))}a(kTa,"makeAsyncIterable");function PTa(t){return t instanceof ReadableStream?(kTa(t),M_r.Readable.fromWeb(t)):t}a(PTa,"ensureNodeStream");function k1i(t){return t instanceof Uint8Array?M_r.Readable.from(Buffer.from(t)):(0,wTa.isBlob)(t)?k1i((0,RTa.getRawContent)(t)):PTa(t)}a(k1i,"toStream");async function DTa(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(k1i);return M_r.Readable.from((function(){return z8.__asyncGenerator(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,z8.__asyncValues(d)),u;u=yield z8.__await(l.next()),r=u.done,!r;c=!0){s=u.value,c=!1;let f=s;yield yield z8.__await(f)}}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield z8.__await(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(DTa,"concat")});var L_r=I(sge=>{"use strict";p();Object.defineProperty(sge,"__esModule",{value:!0});sge.multipartPolicyName=void 0;sge.multipartPolicy=HTa;var dte=O4(),NTa=P1i(),MTa=t0t();function OTa(){return`----AzSDKFormBoundary${(0,dte.randomUUID)()}`}a(OTa,"generateBoundary");function LTa(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r -`;return e}a(LTa,"encodeHeaders");function BTa(t){return t instanceof Uint8Array?t.byteLength:(0,MTa.isBlob)(t)?t.size===-1?void 0:t.size:void 0}a(BTa,"getLength");function FTa(t){let e=0;for(let r of t){let n=BTa(r);if(n===void 0)return;e+=n}return e}a(FTa,"getTotalLength");async function UTa(t,e,r){let n=[(0,dte.stringToUint8Array)(`--${r}`,"utf-8"),...e.flatMap(s=>[(0,dte.stringToUint8Array)(`\r -`,"utf-8"),(0,dte.stringToUint8Array)(LTa(s.headers),"utf-8"),(0,dte.stringToUint8Array)(`\r -`,"utf-8"),s.body,(0,dte.stringToUint8Array)(`\r ---${r}`,"utf-8")]),(0,dte.stringToUint8Array)(`--\r +`),r+=c;break}}})}catch{this._isEnabled=!1,F4.info("Parse client web instrumentation error. Web Instrumentation is disabled")}return r},t.prototype._initialize=function(){this._isInitialized=!0;var e=eSi.createServer,r=tSi.createServer,n=this._isEnabled;eSi.createServer=function(o){var s=o;return s&&(o=a(function(c,l){var u=l.write,d=c.method=="GET";l.write=a(function(m,g,A){try{if(n&&d){var y=RR.getContentEncodingFromHeaders(l),E=void 0;if(typeof g=="string"&&(E=g),y==null)t.INSTANCE.ValidateInjection(l,m)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,void 0,E));else if(y.length){var _=y[0];arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,_)}}}catch(v){F4.warn("Inject snippet error: "+v)}return u.apply(l,arguments)},"wrap");var f=l.end;return l.end=a(function(m,g,A){if(n&&d)try{if(n&&d){var y=RR.getContentEncodingFromHeaders(l),E=void 0;if(typeof g=="string"&&(E=g),y==null)t.INSTANCE.ValidateInjection(l,m)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,void 0,E));else if(y.length){var _=y[0];arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,_)}}}catch(v){F4.warn("Inject snipet error: "+v)}return f.apply(l,arguments)},"wrap"),s(c,l)},"requestListener")),e(o)},tSi.createServer=function(o,s){var c=s;if(c)return s=a(function(l,u){var d=l.method=="GET",f=u.write,h=u.end;return u.write=a(function(g,A,y){try{if(n&&d){var E=RR.getContentEncodingFromHeaders(u),_=void 0;if(typeof A=="string"&&(_=A),E==null)t.INSTANCE.ValidateInjection(u,g)&&(arguments[0]=this.InjectWebSnippet(u,g,void 0,_));else if(E.length){var v=E[0];arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,v)}}}catch(b){F4.warn("Inject snippet error: "+b)}return f.apply(u,arguments)},"wrap"),u.end=a(function(g,A,y){try{if(n&&d){var E=RR.getContentEncodingFromHeaders(u),_=void 0;if(typeof A=="string"&&(_=A),E==null)t.INSTANCE.ValidateInjection(u,g)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,void 0,_));else if(E.length){var v=E[0];arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,v)}}}catch(b){F4.warn("Inject snippet error: "+b)}return h.apply(u,arguments)},"wrap"),c(l,u)},"httpsRequestListener"),r(o,s)}},t.prototype.ValidateInjection=function(e,r){try{if(!e||!r||e.statusCode!=200)return!1;var n=RR.isContentTypeHeaderHtml(e);if(!n)return!1;var o=r.slice().toString();if(o.indexOf("")>=0&&o.indexOf("")>=0&&o.indexOf(t._aiUrl)<0&&o.indexOf(t._aiDeprecatedUrl)<0)return!0}catch(s){F4.info("validate injections error: "+s)}return!1},t.prototype.InjectWebSnippet=function(e,r,n,o){try{var s=!!n;if(s)e.removeHeader("Content-Length"),r=this._getInjectedCompressBuffer(e,r,n),e.setHeader("Content-Length",r.length);else{var c=r.toString(),l=c.indexOf("");if(l<0)return r;var u=RR.insertSnippetByIndex(l,c,t._snippet);if(typeof r=="string")e.removeHeader("Content-Length"),r=u,e.setHeader("Content-Length",Buffer.byteLength(r));else if(Buffer.isBuffer(r)){var d=o||"utf8",f=RR.isBufferType(r,d);if(f){e.removeHeader("Content-Length");var h=Buffer.from(u).toString(d);r=Buffer.from(h,d),e.setHeader("Content-Length",r.length)}}}}catch(m){F4.warn("Failed to inject web snippet and change content-lenght headers. Exception:"+m)}return r},t.prototype._getInjectedCompressBuffer=function(e,r,n){try{switch(n){case RR.contentEncodingMethod.GZIP:var o=uge.gunzipSync(r);if(this.ValidateInjection(e,o)){var s=this.InjectWebSnippet(e,o);r=uge.gzipSync(s)}break;case RR.contentEncodingMethod.DEFLATE:var c=uge.inflateSync(r);if(this.ValidateInjection(e,c)){var l=this.InjectWebSnippet(e,c);r=uge.deflateSync(l)}break;case RR.contentEncodingMethod.BR:var u=RR.getBrotliDecompressSync(uge),d=RR.getBrotliCompressSync(uge);if(u&&d){var f=u(r);if(this.ValidateInjection(e,f)){var h=this.InjectWebSnippet(e,f);r=d(h)}break}}}catch(m){F4.info("get web injection compress buffer error: "+m)}return r},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1},t})();iSi.exports=hTa});var aSi=I((P_r,sSi)=>{"use strict";p();var mTa=P_r&&P_r.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),kR=require("url"),k_r=UE(),gTa=dy(),ATa=Q0e(),yTa=cEr(),ETa=Yee(),_Ta=(function(t){mTa(e,t);function e(r,n){var o=t.call(this)||this;return n&&n.method&&r&&(o.method=n.method,o.url=e._getUrlFromRequestOptions(r,n),o.startTime=+new Date),o}return a(e,"HttpDependencyParser"),e.prototype.onError=function(r){this._setStatus(void 0,r)},e.prototype.onResponse=function(r){this._setStatus(r.statusCode,void 0),this.correlationId=gTa.getCorrelationContextTarget(r,ATa.requestContextTargetKey)},e.prototype.getDependencyTelemetry=function(r,n){var o=this.method.toUpperCase(),s=k_r.RemoteDependencyDataConstants.TYPE_HTTP,c="";try{var l=new kR.URL(this.url);l.search=void 0,l.hash=void 0,o+=" "+l.pathname,c=l.hostname,l.port&&(c+=":"+l.port)}catch{}this.correlationId?(s=k_r.RemoteDependencyDataConstants.TYPE_AI,this.correlationId!==ETa.correlationIdPrefix&&(c+=" | "+this.correlationId)):s=k_r.RemoteDependencyDataConstants.TYPE_HTTP;var u={id:n,name:o,data:this.url,duration:this.duration,success:this._isSuccess(),resultCode:this.statusCode?this.statusCode.toString():null,properties:this.properties||{},dependencyTypeName:s,target:c};if(r&&r.time?u.time=r.time:this.startTime&&(u.time=new Date(this.startTime)),r){for(var d in r)u[d]||(u[d]=r[d]);if(r.properties)for(var d in r.properties)u.properties[d]=r.properties[d]}return u},e._getUrlFromRequestOptions=function(r,n){if(typeof r=="string")if(r.indexOf("http://")===0||r.indexOf("https://")===0)try{r=new kR.URL(r)}catch{}else try{var o=new kR.URL("http://"+r);o.port==="443"?r=new kR.URL("https://"+r):r=new kR.URL("http://"+r)}catch{}else{if(r&&typeof kR.URL=="function"&&r instanceof kR.URL)return kR.format(r);var s=r;r={},s&&Object.keys(s).forEach(function(u){r[u]=s[u]})}if(r.path&&r.host)try{var c=new kR.URL(r.path,"http://"+r.host+r.path);r.pathname=c.pathname,r.search=c.search}catch{}if(r.path&&r.hostname&&!r.host)try{var c=new kR.URL(r.path,"http://"+r.hostname+r.path);r.pathname=c.pathname,r.search=c.search}catch{}if(r.host&&r.port)try{var l=new kR.URL("http://".concat(r.host));!l.port&&r.port&&(r.hostname=r.host,delete r.host)}catch{}return r.protocol=r.protocol||n.agent&&n.agent.protocol||n.protocol||void 0,r.hostname=r.hostname||"localhost",kR.format(r)},e})(yTa);sSi.exports=_Ta});var cSi=I(dge=>{"use strict";p();var c0t=dge&&dge.__assign||function(){return c0t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var TTa=n6&&n6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ITa=n6&&n6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xTa=n6&&n6.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&TTa(e,t,r);return ITa(e,t),e};Object.defineProperty(n6,"__esModule",{value:!0});n6.spanToTelemetryContract=MTa;var lSi=require("url"),hD=(po(),Qa(G8)),ys=(Ght(),Qa(yyr)),r6=xTa(_d()),wTa=cSi(),RTa=dy();function kTa(t){for(var e={},r=0,n=Object.keys(t.attributes);r0&&(e["_MS.links"]=RTa.stringify(s)),e}a(kTa,"createPropertiesFromSpan");function PTa(t){return t===ys.DbSystemValues.DB2||t===ys.DbSystemValues.DERBY||t===ys.DbSystemValues.MARIADB||t===ys.DbSystemValues.MSSQL||t===ys.DbSystemValues.ORACLE||t===ys.DbSystemValues.SQLITE||t===ys.DbSystemValues.OTHER_SQL||t===ys.DbSystemValues.HSQLDB||t===ys.DbSystemValues.H2}a(PTa,"isSqlDB");function uSi(t){var e=t.attributes[ys.SemanticAttributes.HTTP_METHOD];if(e){var r=t.attributes[ys.SemanticAttributes.HTTP_URL];if(r)return String(r);var n=t.attributes[ys.SemanticAttributes.HTTP_SCHEME],o=t.attributes[ys.SemanticAttributes.HTTP_TARGET];if(n&&o){var s=t.attributes[ys.SemanticAttributes.HTTP_HOST];if(s)return"".concat(n,"://").concat(s).concat(o);var c=t.attributes[ys.SemanticAttributes.NET_PEER_PORT];if(c){var l=t.attributes[ys.SemanticAttributes.NET_PEER_NAME];if(l)return"".concat(n,"://").concat(l,":").concat(c).concat(o);var u=t.attributes[ys.SemanticAttributes.NET_PEER_IP];if(u)return"".concat(n,"://").concat(u,":").concat(c).concat(o)}}}return""}a(uSi,"getUrl");function N_r(t){var e=t.attributes[ys.SemanticAttributes.PEER_SERVICE],r=t.attributes[ys.SemanticAttributes.HTTP_HOST],n=t.attributes[ys.SemanticAttributes.HTTP_URL],o=t.attributes[ys.SemanticAttributes.NET_PEER_NAME],s=t.attributes[ys.SemanticAttributes.NET_PEER_IP];return e?String(e):r?String(r):n?String(n):o?String(o):s?String(s):""}a(N_r,"getDependencyTarget");function DTa(t){var e={name:t.name,success:t.status.code!=hD.SpanStatusCode.ERROR,resultCode:"0",duration:0,data:"",dependencyTypeName:""};t.kind===hD.SpanKind.PRODUCER&&(e.dependencyTypeName=r6.DependencyTypeName.QueueMessage),t.kind===hD.SpanKind.INTERNAL&&t.parentSpanId&&(e.dependencyTypeName=r6.DependencyTypeName.InProc);var r=t.attributes[ys.SemanticAttributes.HTTP_METHOD],n=t.attributes[ys.SemanticAttributes.DB_SYSTEM],o=t.attributes[ys.SemanticAttributes.RPC_SYSTEM];if(r){e.dependencyTypeName=r6.DependencyTypeName.Http;var s=t.attributes[ys.SemanticAttributes.HTTP_URL];if(s){var c="";try{var l=new lSi.URL(String(s));c=l.pathname}catch{}e.name="".concat(r," ").concat(c)}e.data=uSi(t);var u=t.attributes[ys.SemanticAttributes.HTTP_STATUS_CODE];u&&(e.resultCode=String(u));var d=N_r(t);if(d){try{var f=new RegExp(/(https?)(:\/\/.*)(:\d+)(\S*)/),h=f.exec(d);if(h!=null){var m=h[1],g=h[3];(m=="https"&&g==":443"||m=="http"&&g==":80")&&(d=h[1]+h[2]+h[4])}}catch{}e.target="".concat(d)}}else if(n){String(n)===ys.DbSystemValues.MYSQL?e.dependencyTypeName="mysql":String(n)===ys.DbSystemValues.POSTGRESQL?e.dependencyTypeName="postgresql":String(n)===ys.DbSystemValues.MONGODB?e.dependencyTypeName="mongodb":String(n)===ys.DbSystemValues.REDIS?e.dependencyTypeName="redis":PTa(String(n))?e.dependencyTypeName="SQL":e.dependencyTypeName=String(n);var A=t.attributes[ys.SemanticAttributes.DB_STATEMENT],y=t.attributes[ys.SemanticAttributes.DB_OPERATION];A?e.data=String(A):y&&(e.data=String(y));var d=N_r(t),E=t.attributes[ys.SemanticAttributes.DB_NAME];d?e.target=E?"".concat(d,"|").concat(E):"".concat(d):e.target=E?"".concat(E):"".concat(n)}else if(o){e.dependencyTypeName=r6.DependencyTypeName.Grpc;var _=t.attributes[ys.SemanticAttributes.RPC_GRPC_STATUS_CODE];_&&(e.resultCode=String(_));var d=N_r(t);d?e.target="".concat(d):o&&(e.target=String(o))}return e}a(DTa,"createDependencyData");function NTa(t){var e={name:t.name,success:t.status.code!=hD.SpanStatusCode.ERROR,resultCode:"0",duration:0,url:"",source:void 0},r=t.attributes[ys.SemanticAttributes.HTTP_METHOD],n=t.attributes[ys.SemanticAttributes.RPC_GRPC_STATUS_CODE];if(r){if(t.kind==hD.SpanKind.SERVER){var o=t.attributes[ys.SemanticAttributes.HTTP_ROUTE],s=t.attributes[ys.SemanticAttributes.HTTP_URL];if(o)e.name="".concat(r," ").concat(o);else if(s)try{var c=new lSi.URL(String(s));e.name="".concat(r," ").concat(c.pathname)}catch{}}e.url=uSi(t);var l=t.attributes[ys.SemanticAttributes.HTTP_STATUS_CODE];l&&(e.resultCode=String(l))}else n&&(e.resultCode=String(n));return e}a(NTa,"createRequestData");function MTa(t){var e;switch(t.kind){case hD.SpanKind.CLIENT:case hD.SpanKind.PRODUCER:case hD.SpanKind.INTERNAL:e=DTa(t);break;case hD.SpanKind.SERVER:case hD.SpanKind.CONSUMER:e=NTa(t);break}var r=t.spanContext?t.spanContext():t.context(),n="".concat(r.spanId),o=Math.round(t.duration[0]*1e3+t.duration[1]/1e6);return e.id=n,e.duration=o,e.properties=kTa(t),t.attributes[r6.AzNamespace]&&(t.kind===hD.SpanKind.INTERNAL&&(e.dependencyTypeName="".concat(r6.DependencyTypeName.InProc," | ").concat(t.attributes[r6.AzNamespace])),t.attributes[r6.AzNamespace]===r6.MicrosoftEventHub&&(0,wTa.parseEventHubSpan)(t,e)),e}a(MTa,"spanToTelemetryContract")});var pSi=I(OG=>{"use strict";p();var fge=OG&&OG.__assign||function(){return fge=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var LTa=eI&&eI.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),BTa=eI&&eI.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),FTa=eI&&eI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&<a(e,t,r);return BTa(e,t),e};Object.defineProperty(eI,"__esModule",{value:!0});eI.subscriber=void 0;eI.enable=HTa;var t5e=(po(),Qa(G8)),UTa=_d(),M_r=Tp(),QTa=FTa(dSi()),qTa=pSi(),cte=[],jTa=a(function(t){try{var e=t.data,r=QTa.spanToTelemetryContract(e);qTa.AsyncScopeManager.with(e,function(){cte.forEach(function(n){e.kind===t5e.SpanKind.SERVER||e.kind===t5e.SpanKind.CONSUMER?n.trackRequest(r):(e.kind===t5e.SpanKind.CLIENT||e.kind===t5e.SpanKind.INTERNAL||e.kind===t5e.SpanKind.PRODUCER)&&n.trackDependency(r)})})}catch{}},"subscriber");eI.subscriber=jTa;function HTa(t,e){if(t){var r=cte.find(function(n){return n==e});if(r)return;cte.length===0&&M_r.channel.subscribe("azure-coretracing",eI.subscriber,M_r.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(UTa.StatsbeatInstrumentation.AZURE_CORE_TRACING)}),cte.push(e)}else cte=cte.filter(function(n){return n!=e}),cte.length===0&&M_r.channel.unsubscribe("azure-coretracing",eI.subscriber)}a(HTa,"enable")});var mSi=I(ute=>{"use strict";p();Object.defineProperty(ute,"__esModule",{value:!0});ute.subscriber=void 0;ute.enable=VTa;var GTa=_d(),O_r=Tp(),lte=[],$Ta=a(function(t){t.data.event.commandName!=="ismaster"&<e.forEach(function(e){var r=t.data.startedData&&t.data.startedData.databaseName||"Unknown database";e.trackDependency({target:r,data:t.data.event.commandName,name:t.data.event.commandName,duration:t.data.event.duration,success:t.data.succeeded,resultCode:t.data.succeeded?"0":"1",time:t.data.startedData.time,dependencyTypeName:"mongodb"})})},"subscriber");ute.subscriber=$Ta;function VTa(t,e){if(t){var r=lte.find(function(n){return n==e});if(r)return;lte.length===0&&O_r.channel.subscribe("mongodb",ute.subscriber,O_r.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(GTa.StatsbeatInstrumentation.MONGODB)}),lte.push(e)}else lte=lte.filter(function(n){return n!=e}),lte.length===0&&O_r.channel.unsubscribe("mongodb",ute.subscriber)}a(VTa,"enable")});var gSi=I(fte=>{"use strict";p();Object.defineProperty(fte,"__esModule",{value:!0});fte.subscriber=void 0;fte.enable=YTa;var WTa=_d(),L_r=Tp(),dte=[],zTa=a(function(t){dte.forEach(function(e){var r=t.data.query||{},n=r.sql||"Unknown query",o=!t.data.err,s=r._connection||{},c=s.config||{},l=c.socketPath?c.socketPath:"".concat(c.host||"localhost",":").concat(c.port);e.trackDependency({target:l,data:n,name:n,duration:t.data.duration,success:o,resultCode:o?"0":"1",time:t.data.time,dependencyTypeName:"mysql"})})},"subscriber");fte.subscriber=zTa;function YTa(t,e){if(t){var r=dte.find(function(n){return n==e});if(r)return;dte.length===0&&L_r.channel.subscribe("mysql",fte.subscriber,L_r.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(WTa.StatsbeatInstrumentation.MYSQL)}),dte.push(e)}else dte=dte.filter(function(n){return n!=e}),dte.length===0&&L_r.channel.unsubscribe("mysql",fte.subscriber)}a(YTa,"enable")});var ASi=I(hte=>{"use strict";p();Object.defineProperty(hte,"__esModule",{value:!0});hte.subscriber=void 0;hte.enable=ZTa;var KTa=_d(),B_r=Tp(),pte=[],JTa=a(function(t){pte.forEach(function(e){t.data.commandObj.command!=="info"&&e.trackDependency({target:t.data.address,name:t.data.commandObj.command,data:t.data.commandObj.command,duration:t.data.duration,success:!t.data.err,resultCode:t.data.err?"1":"0",time:t.data.time,dependencyTypeName:"redis"})})},"subscriber");hte.subscriber=JTa;function ZTa(t,e){if(t){var r=pte.find(function(n){return n==e});if(r)return;pte.length===0&&B_r.channel.subscribe("redis",hte.subscriber,B_r.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(KTa.StatsbeatInstrumentation.REDIS)}),pte.push(e)}else pte=pte.filter(function(n){return n!=e}),pte.length===0&&B_r.channel.unsubscribe("redis",hte.subscriber)}a(ZTa,"enable")});var ySi=I(gte=>{"use strict";p();Object.defineProperty(gte,"__esModule",{value:!0});gte.subscriber=void 0;gte.enable=tIa;var XTa=_d(),F_r=Tp(),mte=[],eIa=a(function(t){mte.forEach(function(e){var r=t.data.query,n=r.preparable&&r.preparable.text||r.plan||r.text||"unknown query",o=!t.data.error,s="".concat(t.data.database.host,":").concat(t.data.database.port);e.trackDependency({target:s,data:n,name:n,duration:t.data.duration,success:o,resultCode:o?"0":"1",time:t.data.time,dependencyTypeName:"postgres"})})},"subscriber");gte.subscriber=eIa;function tIa(t,e){if(t){var r=mte.find(function(n){return n==e});if(r)return;mte.length===0&&F_r.channel.subscribe("postgres",gte.subscriber,F_r.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(XTa.StatsbeatInstrumentation.POSTGRES)}),mte.push(e)}else mte=mte.filter(function(n){return n!=e}),mte.length===0&&F_r.channel.unsubscribe("postgres",gte.subscriber)}a(tIa,"enable")});var mge=I((i6,ESi)=>{"use strict";p();var rIa=i6&&i6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nIa=i6&&i6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),iIa=i6&&i6.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&rIa(e,t,r);return nIa(e,t),e},l0t=i6&&i6.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{"use strict";p();var _Si=require("http"),vSi=require("https"),CSi=Jl(),bSi=dy(),cIa=Q0e(),Q_r=fEr(),o6=kG(),lIa=r0t(),uIa=(function(){function t(e){if(t.INSTANCE)throw new Error("Server request tracking should be configured from the applicationInsights object");t.INSTANCE=this,this._client=e}return a(t,"AutoCollectHttpRequests"),t.prototype.enable=function(e){this._isEnabled=e,(this._isAutoCorrelating||this._isEnabled||lIa.isEnabled())&&!this._isInitialized&&(this.useAutoCorrelation(this._isAutoCorrelating),this._initialize())},t.prototype.useAutoCorrelation=function(e,r){e&&!this._isAutoCorrelating?o6.CorrelationContextManager.enable(r):!e&&this._isAutoCorrelating&&o6.CorrelationContextManager.disable(),this._isAutoCorrelating=e},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype.isAutoCorrelating=function(){return this._isAutoCorrelating},t.prototype._generateCorrelationContext=function(e){if(this._isAutoCorrelating)return o6.CorrelationContextManager.generateContextObject(e.getOperationId(this._client.context.tags),e.getRequestId(),e.getOperationName(this._client.context.tags),e.getCorrelationContextHeader(),e.getTraceparent(),e.getTracestate())},t.prototype._registerRequest=function(e,r,n){var o=this,s=new Q_r(e),c=this._generateCorrelationContext(s);o6.CorrelationContextManager.runWithContext(c,function(){o._isEnabled&&(e[t.alreadyAutoCollectedFlag]=!0,t.trackRequest(o._client,{request:e,response:r},s)),typeof n=="function"&&n(e,r)})},t.prototype._initialize=function(){if(this._isInitialized=!0,!t.HANDLER_READY){t.HANDLER_READY=!0;var e=a(function(s){if(s){if(typeof s!="function")throw new Error("onRequest handler must be a function");return function(c,l){o6.CorrelationContextManager.wrapEmitter(c),o6.CorrelationContextManager.wrapEmitter(l);var u=c&&!c[t.alreadyAutoCollectedFlag];c&&u&&t.INSTANCE?t.INSTANCE._registerRequest(c,l,s):s(c,l)}}},"wrapOnRequestHandler"),r=a(function(s){var c=s.addListener.bind(s);s.addListener=function(l,u){switch(l){case"request":case"checkContinue":return c(l,e(u));default:return c(l,u)}},s.on=s.addListener},"wrapServerEventHandler"),n=_Si.createServer;_Si.createServer=function(s,c){if(c&&typeof c=="function"){var l=n(s,e(c));return r(l),l}else{var l=n(e(s));return r(l),l}};var o=vSi.createServer;vSi.createServer=function(s,c){var l=o(s,e(c));return r(l),l}}},t.trackRequestSync=function(e,r){if(!r.request||!r.response||!e){CSi.info("AutoCollectHttpRequests.trackRequestSync was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1,t.addResponseCorrelationIdHeader(e,r.response);var n=o6.CorrelationContextManager.getCurrentContext(),o=new Q_r(r.request,n&&n.operation.parentId);n&&(n.operation.id=o.getOperationId(e.context.tags)||n.operation.id,n.operation.name=o.getOperationName(e.context.tags)||n.operation.name,n.operation.parentId=o.getRequestId()||n.operation.parentId,n.customProperties.addHeaderData(o.getCorrelationContextHeader())),t.endRequest(e,o,r,r.duration,r.error)},t.trackRequest=function(e,r,n){if(!r.request||!r.response||!e){CSi.info("AutoCollectHttpRequests.trackRequest was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1;var o=o6.CorrelationContextManager.getCurrentContext(),s=n||new Q_r(r.request,o&&o.operation.parentId);bSi.canIncludeCorrelationHeader(e,s.getUrl())&&t.addResponseCorrelationIdHeader(e,r.response),o&&!n&&(o.operation.id=s.getOperationId(e.context.tags)||o.operation.id,o.operation.name=s.getOperationName(e.context.tags)||o.operation.name,o.operation.parentId=s.getOperationParentId(e.context.tags)||o.operation.parentId,o.customProperties.addHeaderData(s.getCorrelationContextHeader())),r.response.once&&r.response.once("finish",function(){t.endRequest(e,s,r,null,null)}),r.request.on&&r.request.on("error",function(c){t.endRequest(e,s,r,null,c)}),r.request.on&&r.request.on("aborted",function(){var c="The request has been aborted and the network socket has closed.";t.endRequest(e,s,r,null,c)})},t.addResponseCorrelationIdHeader=function(e,r){if(e.config&&e.config.correlationId&&r.getHeader&&r.setHeader&&!r.headersSent){var n=r.getHeader(cIa.requestContextHeader);bSi.safeIncludeCorrelationHeader(e,r,n)}},t.endRequest=function(e,r,n,o,s){if(!n.isProcessed){n.isProcessed=!0,s?r.onError(s,o):r.onResponse(n.response,o);var c=r.getRequestTelemetry(n);if(c.tagOverrides=r.getRequestTags(e.context.tags),n.tagOverrides)for(var l in n.tagOverrides)c.tagOverrides[l]=n.tagOverrides[l];var u=r.getLegacyRootId();u&&(c.properties.ai_legacyRootId=u),c.contextObjects=c.contextObjects||{},c.contextObjects["http.ServerRequest"]=n.request,c.contextObjects["http.ServerResponse"]=n.response,e.trackRequest(c)}},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1,o6.CorrelationContextManager.disable(),this._isAutoCorrelating=!1},t.HANDLER_READY=!1,t.alreadyAutoCollectedFlag="_appInsightsAutoCollected",t})();SSi.exports=uIa});var xSi=I((H_r,ISi)=>{"use strict";p();var PR=H_r&&H_r.__assign||function(){return PR=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0?r:null,InstrumentationKey:n.instrumentationKey||"",Metrics:e.length>0?e:null,InvariantVersion:1,Timestamp:"/Date(".concat(Date.now(),")/"),Version:o.tags[o.keys.internalSdkVersion],StreamId:pIa,MachineName:s,Instance:c,RoleName:l};return u},t.createQuickPulseMetric=function(e){var r;return r={Name:e.name,Value:e.value,Weight:e.count||1},r},t.telemetryEnvelopeToQuickPulseDocument=function(e){switch(e.data.baseType){case Ate.TelemetryTypeString.Event:return t.createQuickPulseEventDocument(e);case Ate.TelemetryTypeString.Exception:return t.createQuickPulseExceptionDocument(e);case Ate.TelemetryTypeString.Trace:return t.createQuickPulseTraceDocument(e);case Ate.TelemetryTypeString.Dependency:return t.createQuickPulseDependencyDocument(e);case Ate.TelemetryTypeString.Request:return t.createQuickPulseRequestDocument(e)}return null},t.createQuickPulseEventDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.name,o=PR(PR({},r),{Name:n});return o},t.createQuickPulseTraceDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.severityLevel||0,o=PR(PR({},r),{Message:e.data.baseData.message,SeverityLevel:Ate.SeverityLevel[n]});return o},t.createQuickPulseExceptionDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.exceptions,o="",s="",c="";n&&n.length>0&&(n[0].parsedStack&&n[0].parsedStack.length>0?n[0].parsedStack.forEach(function(u){o+=u.assembly+` +`}):n[0].stack&&n[0].stack.length>0&&(o=n[0].stack),s=n[0].message,c=n[0].typeName);var l=PR(PR({},r),{Exception:o,ExceptionMessage:s,ExceptionType:c});return l},t.createQuickPulseRequestDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=PR(PR({},r),{Name:n.name,Success:n.success,Duration:n.duration,ResponseCode:n.responseCode,OperationName:n.name});return o},t.createQuickPulseDependencyDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=PR(PR({},r),{Name:n.name,Target:n.target,Success:n.success,Duration:n.duration,ResultCode:n.resultCode,CommandName:n.data,OperationName:r.OperationId,DependencyTypeName:n.type});return o},t.createQuickPulseDocument=function(e){var r,n,o,s;e.data.baseType?(n=TSi.TelemetryTypeStringToQuickPulseType[e.data.baseType],r=TSi.TelemetryTypeStringToQuickPulseDocumentType[e.data.baseType]):fIa.warn("Document type invalid; not sending live metric document",e.data.baseType),o=e.tags[t.keys.operationId],s=t.aggregateProperties(e);var c={DocumentType:r,__type:n,OperationId:o,Version:"1.0",Properties:s};return c},t.aggregateProperties=function(e){var r=[],n=e.data.baseData.measurements||{};for(var o in n)if(n.hasOwnProperty(o)){var s=n[o],c={key:o,value:s};r.push(c)}var l=e.data.baseData.properties||{};for(var o in l)if(l.hasOwnProperty(o)){var s=l[o],c={key:o,value:s};r.push(c)}return r},t.keys=new Ate.ContextTagKeys,t})();ISi.exports=hIa});var RSi=I((U_p,wSi)=>{"use strict";p();var mIa=a(function(){return(Date.now()+621355968e5)*1e4},"getTransmissionTime");wSi.exports={getTransmissionTime:mIa}});var NSi=I((i5e,DSi)=>{"use strict";p();var kSi=i5e&&i5e.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},PSi=i5e&&i5e.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0?r:this._config.quickPulseHost,m.method=DR.method,m.path="/QuickPulseService.svc/".concat(o,"?ikey=").concat(this._config.instrumentationKey),m.headers=(g={Expect:"100-continue"},g[DR.time]=yIa.getTransmissionTime(),g["Content-Type"]="application/json",g["Content-Length"]=Buffer.byteLength(c),g),m),s&&s.length>0&&s.forEach(function(E){return l.headers[E.name]=E.value}),o!=="post")return[3,4];if(u=this._getAuthorizationHandler?this._getAuthorizationHandler(this._config):null,!u)return[3,4];y.label=1;case 1:return y.trys.push([1,3,,4]),[4,u.addAuthorizationHeader(l)];case 2:return y.sent(),[3,4];case 3:return d=y.sent(),f="Failed to get AAD bearer token for the Application. Error:",G_r.info(t.TAG,f,d),[2];case 4:return this._config.httpsAgent?l.agent=this._config.httpsAgent:l.agent=$_r.tlsRestrictedAgent,h=gIa.request(l,function(E){if(E.statusCode==200){var _=E.headers[DR.subscribed]==="true",v=null;try{v=E.headers[DR.endpointRedirect]?new EIa.URL(E.headers[DR.endpointRedirect].toString()).host:null}catch(T){A._onError("Failed to parse redirect header from QuickPulse: "+$_r.dumpObj(T))}var b=E.headers[DR.pollingIntervalHint]?parseInt(E.headers[DR.pollingIntervalHint].toString()):null;A._consecutiveErrors=0,n(_,E,v,b)}else A._onError("StatusCode:"+E.statusCode+" StatusMessage:"+E.statusMessage),n()}),h.on("error",function(E){A._onError(E),n()}),h.write(c),h.end(),[2]}})})},t.prototype._onError=function(e){this._consecutiveErrors++;var r="Transient error connecting to the Live Metrics endpoint. This packet will not appear in your Live Metrics Stream. Error:";this._consecutiveErrors%t.MAX_QPS_FAILURES_BEFORE_WARN===0?(r="Live Metrics endpoint could not be reached ".concat(this._consecutiveErrors," consecutive times. Most recent error:"),G_r.warn(t.TAG,r,e)):G_r.info(t.TAG,r,e)},t.TAG="QuickPulseSender",t.MAX_QPS_FAILURES_BEFORE_WARN=25,t})();DSi.exports=_Ia});var USi=I((o5e,FSi)=>{"use strict";p();var MSi=o5e&&o5e.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},OSi=o5e&&o5e.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0?this._pollingIntervalHint:t.PING_INTERVAL,o=this._isCollectingData?t.POST_INTERVAL:n,this._isCollectingData&&Date.now()-this._lastSuccessTime>=t.MAX_POST_WAIT_TIME&&!this._lastSendSucceeded?(this._isCollectingData=!1,o=t.FALLBACK_INTERVAL):!this._isCollectingData&&Date.now()-this._lastSuccessTime>=t.MAX_PING_WAIT_TIME&&!this._lastSendSucceeded&&(o=t.FALLBACK_INTERVAL),this._lastSendSucceeded=null,this._handle=setTimeout(this._goQuickPulse.bind(this),o),this._handle.unref(),[2]}})})},t.prototype._ping=function(e){this._sender.ping(e,this._redirectedHost,this._quickPulseDone.bind(this))},t.prototype._post=function(e){return MSi(this,void 0,void 0,function(){return OSi(this,function(r){switch(r.label){case 0:return[4,this._sender.post(e,this._redirectedHost,this._quickPulseDone.bind(this))];case 1:return r.sent(),[2]}})})},t.prototype._quickPulseDone=function(e,r,n,o){e!=null?(this._isCollectingData!==e&&(LSi.info("Live Metrics sending data",e),this.enableCollectors(e)),this._isCollectingData=e,n&&n.length>0&&(this._redirectedHost=n,LSi.info("Redirecting endpoint to: ",n)),o&&o>0&&(this._pollingIntervalHint=o),r&&r.statusCode<300&&r.statusCode>=200?(this._lastSuccessTime=Date.now(),this._lastSendSucceeded=!0):this._lastSendSucceeded=!1):this._lastSendSucceeded=!1},t.MAX_POST_WAIT_TIME=2e4,t.MAX_PING_WAIT_TIME=6e4,t.FALLBACK_INTERVAL=6e4,t.PING_INTERVAL=5e3,t.POST_INTERVAL=1e3,t})();FSi.exports=bIa});var qSi=I(gge=>{"use strict";p();var f0t=gge&&gge.__assign||function(){return f0t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0)for(var l=0,u=s;l{"use strict";p();var jSi=BG&&BG.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},HSi=BG&&BG.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var RIa=Yee(),$Si=R_r(),kIa=Jl(),VSi=_d(),PIa=require("url"),DIa=hpt(),NIa=(function(){function t(e){this._endpointBase=VSi.DEFAULT_BREEZE_ENDPOINT,this._mergeConfig();var r=this._connectionString,n=$Si.parse(e),o=$Si.parse(r),s=!n.instrumentationkey&&Object.keys(n).length>0?null:e,c=this._instrumentationKey;this.instrumentationKey=n.instrumentationkey||s||o.instrumentationkey||c;var l="".concat(this.endpointUrl||n.ingestionendpoint||o.ingestionendpoint||this._endpointBase);l.endsWith("/")&&(l=l.slice(0,-1)),this.endpointUrl="".concat(l,"/v2.1/track"),this.maxBatchSize=this.maxBatchSize||250,this.maxBatchIntervalMs=this.maxBatchIntervalMs||15e3,this.disableAppInsights=this.disableAppInsights||!1,this.samplingPercentage=this.samplingPercentage||100,this.correlationIdRetryIntervalMs=this.correlationIdRetryIntervalMs||30*1e3,this.enableWebInstrumentation=this.enableWebInstrumentation||this.enableAutoWebSnippetInjection||!1,this.webInstrumentationConfig=this.webInstrumentationConfig||null,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation,this.correlationHeaderExcludedDomains=this.correlationHeaderExcludedDomains||["*.core.windows.net","*.core.chinacloudapi.cn","*.core.cloudapi.de","*.core.usgovcloudapi.net","*.core.microsoft.scloud","*.core.eaglex.ic.gov"],this.ignoreLegacyHeaders=this.ignoreLegacyHeaders||!1,this.profileQueryEndpoint=n.ingestionendpoint||o.ingestionendpoint||process.env[t.ENV_profileQueryEndpoint]||this._endpointBase,this.quickPulseHost=this.quickPulseHost||n.liveendpoint||o.liveendpoint||process.env[t.ENV_quickPulseHost]||VSi.DEFAULT_LIVEMETRICS_HOST,this.webInstrumentationConnectionString=this.webInstrumentationConnectionString||this._webInstrumentationConnectionString||"",this.webSnippetConnectionString=this.webInstrumentationConnectionString,this.quickPulseHost.match(/^https?:\/\//)&&(this.quickPulseHost=new PIa.URL(this.quickPulseHost).host),this.aadAudience=n.aadaudience||o.aadaudience}return a(t,"Config"),Object.defineProperty(t.prototype,"profileQueryEndpoint",{get:a(function(){return this._profileQueryEndpoint},"get"),set:a(function(e){this._profileQueryEndpoint=e,this.correlationId=RIa.correlationIdPrefix},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instrumentationKey",{get:a(function(){return this._instrumentationKey},"get"),set:a(function(e){t._validateInstrumentationKey(e)||kIa.warn("An invalid instrumentation key was provided. There may be resulting telemetry loss",this.instrumentationKey),this._instrumentationKey=e},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"webSnippetConnectionString",{get:a(function(){return this._webInstrumentationConnectionString},"get"),set:a(function(e){this._webInstrumentationConnectionString=e},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"webInstrumentationConnectionString",{get:a(function(){return this._webInstrumentationConnectionString},"get"),set:a(function(e){this._webInstrumentationConnectionString=e},"set"),enumerable:!1,configurable:!0}),t.prototype._mergeConfig=function(){var e=DIa.JsonConfig.getInstance();this._connectionString=e.connectionString,this._instrumentationKey=e.instrumentationKey,this.correlationHeaderExcludedDomains=e.correlationHeaderExcludedDomains,this.correlationIdRetryIntervalMs=e.correlationIdRetryIntervalMs,this.disableAllExtendedMetrics=e.disableAllExtendedMetrics,this.disableAppInsights=e.disableAppInsights,this.disableStatsbeat=e.disableStatsbeat,this.distributedTracingMode=e.distributedTracingMode,this.enableAutoCollectConsole=e.enableAutoCollectConsole,this.enableLoggerErrorToTrace=e.enableLoggerErrorToTrace,this.enableAutoCollectDependencies=e.enableAutoCollectDependencies,this.enableAutoCollectIncomingRequestAzureFunctions=e.enableAutoCollectIncomingRequestAzureFunctions,this.enableAutoCollectExceptions=e.enableAutoCollectExceptions,this.enableAutoCollectExtendedMetrics=e.enableAutoCollectExtendedMetrics,this.enableAutoCollectExternalLoggers=e.enableAutoCollectExternalLoggers,this.enableAutoCollectHeartbeat=e.enableAutoCollectHeartbeat,this.enableAutoCollectPerformance=e.enableAutoCollectPerformance,this.enableAutoCollectPreAggregatedMetrics=e.enableAutoCollectPreAggregatedMetrics,this.enableAutoCollectRequests=e.enableAutoCollectRequests,this.enableAutoDependencyCorrelation=e.enableAutoDependencyCorrelation,this.enableInternalDebugLogging=e.enableInternalDebugLogging,this.enableInternalWarningLogging=e.enableInternalWarningLogging,this.enableResendInterval=e.enableResendInterval,this.enableMaxBytesOnDisk=e.enableMaxBytesOnDisk,this.enableSendLiveMetrics=e.enableSendLiveMetrics,this.enableUseAsyncHooks=e.enableUseAsyncHooks,this.enableUseDiskRetryCaching=e.enableUseDiskRetryCaching,this.endpointUrl=e.endpointUrl,this.extendedMetricDisablers=e.extendedMetricDisablers,this.ignoreLegacyHeaders=e.ignoreLegacyHeaders,this.maxBatchIntervalMs=e.maxBatchIntervalMs,this.maxBatchSize=e.maxBatchSize,this.proxyHttpUrl=e.proxyHttpUrl,this.proxyHttpsUrl=e.proxyHttpsUrl,this.quickPulseHost=e.quickPulseHost,this.samplingPercentage=e.samplingPercentage,this.enableWebInstrumentation=e.enableWebInstrumentation,this._webInstrumentationConnectionString=e.webInstrumentationConnectionString,this.webInstrumentationConfig=e.webInstrumentationConfig,this.webInstrumentationSrc=e.webInstrumentationSrc},t._validateInstrumentationKey=function(e){var r="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",n=new RegExp(r);return n.test(e)},t.ENV_azurePrefix="APPSETTING_",t.ENV_iKey="APPINSIGHTS_INSTRUMENTATIONKEY",t.legacy_ENV_iKey="APPINSIGHTS_INSTRUMENTATION_KEY",t.ENV_profileQueryEndpoint="APPINSIGHTS_PROFILE_QUERY_ENDPOINT",t.ENV_quickPulseHost="APPINSIGHTS_QUICKPULSE_HOST",t})();WSi.exports=NIa});var J_r=I(K_r=>{"use strict";p();Object.defineProperty(K_r,"__esModule",{value:!0});K_r.createEmptyPipeline=MIa;var zSi=new Set(["Deserialize","Serialize","Retry","Sign"]),Y_r=class t{static{a(this,"HttpPipeline")}constructor(e){var r;this._policies=[],this._policies=(r=e?.slice(0))!==null&&r!==void 0?r:[],this._orderedPolicies=void 0}addPolicy(e,r={}){if(r.phase&&r.afterPhase)throw new Error("Policies inside a phase cannot specify afterPhase.");if(r.phase&&!zSi.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!zSi.has(r.afterPhase))throw new Error(`Invalid afterPhase name: ${r.afterPhase}`);this._policies.push({policy:e,options:r}),this._orderedPolicies=void 0}removePolicy(e){let r=[];return this._policies=this._policies.filter(n=>e.name&&n.policy.name===e.name||e.phase&&n.options.phase===e.phase?(r.push(n.policy),!1):!0),this._orderedPolicies=void 0,r}sendRequest(e,r){return this.getOrderedPolicies().reduceRight((s,c)=>l=>c.sendRequest(l,s),s=>e.sendRequest(s))(r)}getOrderedPolicies(){return this._orderedPolicies||(this._orderedPolicies=this.orderPolicies()),this._orderedPolicies}clone(){return new t(this._policies)}static create(){return new t}orderPolicies(){let e=[],r=new Map;function n(A){return{name:A,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}a(n,"createPhase");let o=n("Serialize"),s=n("None"),c=n("Deserialize"),l=n("Retry"),u=n("Sign"),d=[o,s,c,l,u];function f(A){return A==="Retry"?l:A==="Serialize"?o:A==="Deserialize"?c:A==="Sign"?u:s}a(f,"getPhase");for(let A of this._policies){let y=A.policy,E=A.options,_=y.name;if(r.has(_))throw new Error("Duplicate policy names not allowed in pipeline");let v={policy:y,dependsOn:new Set,dependants:new Set};E.afterPhase&&(v.afterPhase=f(E.afterPhase),v.afterPhase.hasAfterPolicies=!0),r.set(_,v),f(E.phase).policies.add(v)}for(let A of this._policies){let{policy:y,options:E}=A,_=y.name,v=r.get(_);if(!v)throw new Error(`Missing node for policy ${_}`);if(E.afterPolicies)for(let b of E.afterPolicies){let T=r.get(b);T&&(v.dependsOn.add(T),T.dependants.add(v))}if(E.beforePolicies)for(let b of E.beforePolicies){let T=r.get(b);T&&(T.dependsOn.add(v),v.dependants.add(T))}}function h(A){A.hasRun=!0;for(let y of A.policies)if(!(y.afterPhase&&(!y.afterPhase.hasRun||y.afterPhase.policies.size))&&y.dependsOn.size===0){e.push(y.policy);for(let E of y.dependants)E.dependsOn.delete(y);r.delete(y.policy.name),A.policies.delete(y)}}a(h,"walkPhase");function m(){for(let A of d){if(h(A),A.policies.size>0&&A!==s){s.hasRun||h(s);return}A.hasAfterPolicies&&h(s)}}a(m,"walkPhases");let g=0;for(;r.size>0;){g++;let A=e.length;if(m(),e.length<=A&&g>1)throw new Error("Cannot satisfy policy dependencies due to requirements cycle.")}return e}};function MIa(){return Y_r.create()}a(MIa,"createEmptyPipeline")});var yte=I(h0t=>{"use strict";p();Object.defineProperty(h0t,"__esModule",{value:!0});h0t.logger=void 0;var OIa=Dht();h0t.logger=(0,OIa.createClientLogger)("core-rest-pipeline")});var X_r=I(Z_r=>{"use strict";p();Object.defineProperty(Z_r,"__esModule",{value:!0});Z_r.getRandomIntegerInclusive=LIa;function LIa(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(LIa,"getRandomIntegerInclusive")});var YSi=I(evr=>{"use strict";p();Object.defineProperty(evr,"__esModule",{value:!0});evr.calculateRetryDelay=FIa;var BIa=X_r();function FIa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,BIa.getRandomIntegerInclusive)(0,n/2)}}a(FIa,"calculateRetryDelay")});var m0t=I(tvr=>{"use strict";p();Object.defineProperty(tvr,"__esModule",{value:!0});tvr.isObject=UIa;function UIa(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(UIa,"isObject")});var KSi=I(rvr=>{"use strict";p();Object.defineProperty(rvr,"__esModule",{value:!0});rvr.isError=qIa;var QIa=m0t();function qIa(t){if((0,QIa.isObject)(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(qIa,"isError")});var ZSi=I(g0t=>{"use strict";p();Object.defineProperty(g0t,"__esModule",{value:!0});g0t.computeSha256Hmac=jIa;g0t.computeSha256Hash=HIa;var JSi=require("node:crypto");async function jIa(t,e,r){let n=Buffer.from(t,"base64");return(0,JSi.createHmac)("sha256",n).update(e).digest(r)}a(jIa,"computeSha256Hmac");async function HIa(t,e){return(0,JSi.createHash)("sha256").update(t).digest(e)}a(HIa,"computeSha256Hash")});var XSi=I(ivr=>{"use strict";p();var nvr;Object.defineProperty(ivr,"__esModule",{value:!0});ivr.randomUUID=VIa;var GIa=require("node:crypto"),$Ia=typeof((nvr=globalThis?.crypto)===null||nvr===void 0?void 0:nvr.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):GIa.randomUUID;function VIa(){return $Ia()}a(VIa,"randomUUID")});var eTi=I(I0=>{"use strict";p();var ovr,svr,avr,cvr;Object.defineProperty(I0,"__esModule",{value:!0});I0.isReactNative=I0.isNodeRuntime=I0.isNodeLike=I0.isBun=I0.isDeno=I0.isWebWorker=I0.isBrowser=void 0;I0.isBrowser=typeof window<"u"&&typeof window.document<"u";I0.isWebWorker=typeof self=="object"&&typeof self?.importScripts=="function"&&(((ovr=self.constructor)===null||ovr===void 0?void 0:ovr.name)==="DedicatedWorkerGlobalScope"||((svr=self.constructor)===null||svr===void 0?void 0:svr.name)==="ServiceWorkerGlobalScope"||((avr=self.constructor)===null||avr===void 0?void 0:avr.name)==="SharedWorkerGlobalScope");I0.isDeno=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";I0.isBun=typeof Bun<"u"&&typeof Bun.version<"u";I0.isNodeLike=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((cvr=globalThis.process.versions)===null||cvr===void 0)&&cvr.node);I0.isNodeRuntime=I0.isNodeLike&&!I0.isBun&&!I0.isDeno;I0.isReactNative=typeof navigator<"u"&&navigator?.product==="ReactNative"});var tTi=I(A0t=>{"use strict";p();Object.defineProperty(A0t,"__esModule",{value:!0});A0t.uint8ArrayToString=WIa;A0t.stringToUint8Array=zIa;function WIa(t,e){return Buffer.from(t).toString(e)}a(WIa,"uint8ArrayToString");function zIa(t,e){return Buffer.from(t,e)}a(zIa,"stringToUint8Array")});var rTi=I(y0t=>{"use strict";p();Object.defineProperty(y0t,"__esModule",{value:!0});y0t.Sanitizer=void 0;var YIa=m0t(),lvr="REDACTED",KIa=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],JIa=["api-version"],uvr=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=KIa.concat(e),r=JIa.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||(0,YIa.isObject)(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,lvr);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=lvr;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=lvr;return r}};y0t.Sanitizer=uvr});var E0t=I(Aa=>{"use strict";p();Object.defineProperty(Aa,"__esModule",{value:!0});Aa.Sanitizer=Aa.uint8ArrayToString=Aa.stringToUint8Array=Aa.isWebWorker=Aa.isReactNative=Aa.isDeno=Aa.isNodeRuntime=Aa.isNodeLike=Aa.isBun=Aa.isBrowser=Aa.randomUUID=Aa.computeSha256Hmac=Aa.computeSha256Hash=Aa.isError=Aa.isObject=Aa.getRandomIntegerInclusive=Aa.calculateRetryDelay=void 0;var ZIa=YSi();Object.defineProperty(Aa,"calculateRetryDelay",{enumerable:!0,get:a(function(){return ZIa.calculateRetryDelay},"get")});var XIa=X_r();Object.defineProperty(Aa,"getRandomIntegerInclusive",{enumerable:!0,get:a(function(){return XIa.getRandomIntegerInclusive},"get")});var exa=m0t();Object.defineProperty(Aa,"isObject",{enumerable:!0,get:a(function(){return exa.isObject},"get")});var txa=KSi();Object.defineProperty(Aa,"isError",{enumerable:!0,get:a(function(){return txa.isError},"get")});var nTi=ZSi();Object.defineProperty(Aa,"computeSha256Hash",{enumerable:!0,get:a(function(){return nTi.computeSha256Hash},"get")});Object.defineProperty(Aa,"computeSha256Hmac",{enumerable:!0,get:a(function(){return nTi.computeSha256Hmac},"get")});var rxa=XSi();Object.defineProperty(Aa,"randomUUID",{enumerable:!0,get:a(function(){return rxa.randomUUID},"get")});var Ete=eTi();Object.defineProperty(Aa,"isBrowser",{enumerable:!0,get:a(function(){return Ete.isBrowser},"get")});Object.defineProperty(Aa,"isBun",{enumerable:!0,get:a(function(){return Ete.isBun},"get")});Object.defineProperty(Aa,"isNodeLike",{enumerable:!0,get:a(function(){return Ete.isNodeLike},"get")});Object.defineProperty(Aa,"isNodeRuntime",{enumerable:!0,get:a(function(){return Ete.isNodeRuntime},"get")});Object.defineProperty(Aa,"isDeno",{enumerable:!0,get:a(function(){return Ete.isDeno},"get")});Object.defineProperty(Aa,"isReactNative",{enumerable:!0,get:a(function(){return Ete.isReactNative},"get")});Object.defineProperty(Aa,"isWebWorker",{enumerable:!0,get:a(function(){return Ete.isWebWorker},"get")});var iTi=tTi();Object.defineProperty(Aa,"stringToUint8Array",{enumerable:!0,get:a(function(){return iTi.stringToUint8Array},"get")});Object.defineProperty(Aa,"uint8ArrayToString",{enumerable:!0,get:a(function(){return iTi.uint8ArrayToString},"get")});var nxa=rTi();Object.defineProperty(Aa,"Sanitizer",{enumerable:!0,get:a(function(){return nxa.Sanitizer},"get")})});var oTi=I(dvr=>{"use strict";p();Object.defineProperty(dvr,"__esModule",{value:!0});dvr.cancelablePromiseRace=ixa;async function ixa(t,e){var r,n;let o=new AbortController;function s(){o.abort()}a(s,"abortHandler"),(r=e?.abortSignal)===null||r===void 0||r.addEventListener("abort",s);try{return await Promise.race(t.map(c=>c({abortSignal:o.signal})))}finally{o.abort(),(n=e?.abortSignal)===null||n===void 0||n.removeEventListener("abort",s)}}a(ixa,"cancelablePromiseRace")});var sTi=I(_0t=>{"use strict";p();Object.defineProperty(_0t,"__esModule",{value:!0});_0t.AbortError=void 0;var fvr=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};_0t.AbortError=fvr});var a5e=I(v0t=>{"use strict";p();Object.defineProperty(v0t,"__esModule",{value:!0});v0t.AbortError=void 0;var oxa=sTi();Object.defineProperty(v0t,"AbortError",{enumerable:!0,get:a(function(){return oxa.AbortError},"get")})});var hvr=I(pvr=>{"use strict";p();Object.defineProperty(pvr,"__esModule",{value:!0});pvr.createAbortablePromise=axa;var sxa=a5e();function axa(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new sxa.AbortError(o??"The operation was aborted."))}a(l,"rejectOnAbort");function u(){n?.removeEventListener("abort",d)}a(u,"removeListeners");function d(){r?.(),u(),l()}if(a(d,"onAbort"),n?.aborted)return l();try{t(f=>{u(),s(f)},f=>{u(),c(f)})}catch(f){c(f)}n?.addEventListener("abort",d)})}a(axa,"createAbortablePromise")});var aTi=I(C0t=>{"use strict";p();Object.defineProperty(C0t,"__esModule",{value:!0});C0t.delay=dxa;C0t.calculateRetryDelay=fxa;var cxa=hvr(),lxa=E0t(),uxa="The delay was aborted.";function dxa(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return(0,cxa.createAbortablePromise)(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??uxa})}a(dxa,"delay");function fxa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,lxa.getRandomIntegerInclusive)(0,n/2)}}a(fxa,"calculateRetryDelay")});var cTi=I(mvr=>{"use strict";p();Object.defineProperty(mvr,"__esModule",{value:!0});mvr.getErrorMessage=hxa;var pxa=E0t();function hxa(t){if((0,pxa.isError)(t))return t.message;{let e;try{typeof t=="object"&&t?e=JSON.stringify(t):e=String(t)}catch{e="[unable to stringify input]"}return`Unknown error ${e}`}}a(hxa,"getErrorMessage")});var uTi=I(c5e=>{"use strict";p();Object.defineProperty(c5e,"__esModule",{value:!0});c5e.isDefined=gvr;c5e.isObjectWithProperties=mxa;c5e.objectHasProperty=lTi;function gvr(t){return typeof t<"u"&&t!==null}a(gvr,"isDefined");function mxa(t,e){if(!gvr(t)||typeof t!="object")return!1;for(let r of e)if(!lTi(t,r))return!1;return!0}a(mxa,"isObjectWithProperties");function lTi(t,e){return gvr(t)&&typeof t=="object"&&e in t}a(lTi,"objectHasProperty")});var U4=I(cs=>{"use strict";p();Object.defineProperty(cs,"__esModule",{value:!0});cs.isWebWorker=cs.isReactNative=cs.isNodeRuntime=cs.isNodeLike=cs.isNode=cs.isDeno=cs.isBun=cs.isBrowser=cs.objectHasProperty=cs.isObjectWithProperties=cs.isDefined=cs.getErrorMessage=cs.delay=cs.createAbortablePromise=cs.cancelablePromiseRace=void 0;cs.calculateRetryDelay=vxa;cs.computeSha256Hash=Cxa;cs.computeSha256Hmac=bxa;cs.getRandomIntegerInclusive=Sxa;cs.isError=Txa;cs.isObject=Ixa;cs.randomUUID=xxa;cs.uint8ArrayToString=wxa;cs.stringToUint8Array=Rxa;var gxa=(v3(),Qa(hQ)),my=gxa.__importStar(E0t()),Axa=oTi();Object.defineProperty(cs,"cancelablePromiseRace",{enumerable:!0,get:a(function(){return Axa.cancelablePromiseRace},"get")});var yxa=hvr();Object.defineProperty(cs,"createAbortablePromise",{enumerable:!0,get:a(function(){return yxa.createAbortablePromise},"get")});var Exa=aTi();Object.defineProperty(cs,"delay",{enumerable:!0,get:a(function(){return Exa.delay},"get")});var _xa=cTi();Object.defineProperty(cs,"getErrorMessage",{enumerable:!0,get:a(function(){return _xa.getErrorMessage},"get")});var Avr=uTi();Object.defineProperty(cs,"isDefined",{enumerable:!0,get:a(function(){return Avr.isDefined},"get")});Object.defineProperty(cs,"isObjectWithProperties",{enumerable:!0,get:a(function(){return Avr.isObjectWithProperties},"get")});Object.defineProperty(cs,"objectHasProperty",{enumerable:!0,get:a(function(){return Avr.objectHasProperty},"get")});function vxa(t,e){return my.calculateRetryDelay(t,e)}a(vxa,"calculateRetryDelay");function Cxa(t,e){return my.computeSha256Hash(t,e)}a(Cxa,"computeSha256Hash");function bxa(t,e,r){return my.computeSha256Hmac(t,e,r)}a(bxa,"computeSha256Hmac");function Sxa(t,e){return my.getRandomIntegerInclusive(t,e)}a(Sxa,"getRandomIntegerInclusive");function Txa(t){return my.isError(t)}a(Txa,"isError");function Ixa(t){return my.isObject(t)}a(Ixa,"isObject");function xxa(){return my.randomUUID()}a(xxa,"randomUUID");cs.isBrowser=my.isBrowser;cs.isBun=my.isBun;cs.isDeno=my.isDeno;cs.isNode=my.isNodeLike;cs.isNodeLike=my.isNodeLike;cs.isNodeRuntime=my.isNodeRuntime;cs.isReactNative=my.isReactNative;cs.isWebWorker=my.isWebWorker;function wxa(t,e){return my.uint8ArrayToString(t,e)}a(wxa,"uint8ArrayToString");function Rxa(t,e){return my.stringToUint8Array(t,e)}a(Rxa,"stringToUint8Array")});var S0t=I(b0t=>{"use strict";p();Object.defineProperty(b0t,"__esModule",{value:!0});b0t.Sanitizer=void 0;var kxa=U4(),yvr="REDACTED",Pxa=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],Dxa=["api-version"],Evr=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=Pxa.concat(e),r=Dxa.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||(0,kxa.isObject)(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,yvr);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=yvr;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=yvr;return r}};b0t.Sanitizer=Evr});var _vr=I(Age=>{"use strict";p();Object.defineProperty(Age,"__esModule",{value:!0});Age.logPolicyName=void 0;Age.logPolicy=Oxa;var Nxa=yte(),Mxa=S0t();Age.logPolicyName="logPolicy";function Oxa(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:Nxa.logger.info,n=new Mxa.Sanitizer({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:Age.logPolicyName,async sendRequest(o,s){if(!r.enabled)return s(o);r(`Request: ${n.sanitize(o)}`);let c=await s(o);return r(`Response status code: ${c.status}`),r(`Headers: ${n.sanitize(c.headers)}`),c}}}a(Oxa,"logPolicy")});var vvr=I(yge=>{"use strict";p();Object.defineProperty(yge,"__esModule",{value:!0});yge.redirectPolicyName=void 0;yge.redirectPolicy=Lxa;yge.redirectPolicyName="redirectPolicy";var dTi=["GET","HEAD"];function Lxa(t={}){let{maxRetries:e=20}=t;return{name:yge.redirectPolicyName,async sendRequest(r,n){let o=await n(r);return fTi(n,o,e)}}}a(Lxa,"redirectPolicy");async function fTi(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&dTi.includes(o.method)||s===302&&dTi.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{"use strict";p();Object.defineProperty(T0t,"__esModule",{value:!0});T0t.getHeaderName=Bxa;T0t.setPlatformSpecificData=Fxa;var pTi=(v3(),Qa(hQ)),Cvr=pTi.__importStar(require("node:os")),bvr=pTi.__importStar(require("node:process"));function Bxa(){return"User-Agent"}a(Bxa,"getHeaderName");async function Fxa(t){if(bvr&&bvr.versions){let e=bvr.versions;e.bun?t.set("Bun",e.bun):e.deno?t.set("Deno",e.deno):e.node&&t.set("Node",e.node)}t.set("OS",`(${Cvr.arch()}-${Cvr.type()}-${Cvr.release()})`)}a(Fxa,"setPlatformSpecificData")});var FG=I(Ege=>{"use strict";p();Object.defineProperty(Ege,"__esModule",{value:!0});Ege.DEFAULT_RETRY_POLICY_COUNT=Ege.SDK_VERSION=void 0;Ege.SDK_VERSION="1.16.3";Ege.DEFAULT_RETRY_POLICY_COUNT=3});var Svr=I(I0t=>{"use strict";p();Object.defineProperty(I0t,"__esModule",{value:!0});I0t.getUserAgentHeaderName=qxa;I0t.getUserAgentValue=jxa;var mTi=hTi(),Uxa=FG();function Qxa(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(Qxa,"getUserAgentString");function qxa(){return(0,mTi.getHeaderName)()}a(qxa,"getUserAgentHeaderName");async function jxa(t){let e=new Map;e.set("core-rest-pipeline",Uxa.SDK_VERSION),await(0,mTi.setPlatformSpecificData)(e);let r=Qxa(e);return t?`${t} ${r}`:r}a(jxa,"getUserAgentValue")});var Tvr=I(_ge=>{"use strict";p();Object.defineProperty(_ge,"__esModule",{value:!0});_ge.userAgentPolicyName=void 0;_ge.userAgentPolicy=Hxa;var ATi=Svr(),gTi=(0,ATi.getUserAgentHeaderName)();_ge.userAgentPolicyName="userAgentPolicy";function Hxa(t={}){let e=(0,ATi.getUserAgentValue)(t.userAgentPrefix);return{name:_ge.userAgentPolicyName,async sendRequest(r,n){return r.headers.has(gTi)||r.headers.set(gTi,await e),n(r)}}}a(Hxa,"userAgentPolicy")});var x0t=I(vge=>{"use strict";p();Object.defineProperty(vge,"__esModule",{value:!0});vge.isNodeReadableStream=yTi;vge.isWebReadableStream=ETi;vge.isReadableStream=Gxa;vge.isBlob=$xa;function yTi(t){return!!(t&&typeof t.pipe=="function")}a(yTi,"isNodeReadableStream");function ETi(t){return!!(t&&typeof t.getReader=="function"&&typeof t.tee=="function")}a(ETi,"isWebReadableStream");function Gxa(t){return yTi(t)||ETi(t)}a(Gxa,"isReadableStream");function $xa(t){return typeof t.stream=="function"}a($xa,"isBlob")});var Ivr=I(l5e=>{"use strict";p();Object.defineProperty(l5e,"__esModule",{value:!0});l5e.getRawContent=Yxa;l5e.createFileFromStream=Kxa;l5e.createFile=Jxa;var Vxa=U4(),Wxa=x0t(),_Ti={arrayBuffer:a(()=>{throw new Error("Not implemented")},"arrayBuffer"),slice:a(()=>{throw new Error("Not implemented")},"slice"),text:a(()=>{throw new Error("Not implemented")},"text")},w0t=Symbol("rawContent");function zxa(t){return typeof t[w0t]=="function"}a(zxa,"hasRawContent");function Yxa(t){return zxa(t)?t[w0t]():t.stream()}a(Yxa,"getRawContent");function Kxa(t,e,r={}){var n,o,s,c;return Object.assign(Object.assign({},_Ti),{type:(n=r.type)!==null&&n!==void 0?n:"",lastModified:(o=r.lastModified)!==null&&o!==void 0?o:new Date().getTime(),webkitRelativePath:(s=r.webkitRelativePath)!==null&&s!==void 0?s:"",size:(c=r.size)!==null&&c!==void 0?c:-1,name:e,stream:a(()=>{let l=t();if((0,Wxa.isNodeReadableStream)(l))throw new Error("Not supported: a Node stream was provided as input to createFileFromStream.");return l},"stream"),[w0t]:t})}a(Kxa,"createFileFromStream");function Jxa(t,e,r={}){var n,o,s;return Vxa.isNodeLike?Object.assign(Object.assign({},_Ti),{type:(n=r.type)!==null&&n!==void 0?n:"",lastModified:(o=r.lastModified)!==null&&o!==void 0?o:new Date().getTime(),webkitRelativePath:(s=r.webkitRelativePath)!==null&&s!==void 0?s:"",size:t.byteLength,name:e,arrayBuffer:a(async()=>t.buffer,"arrayBuffer"),stream:a(()=>new Blob([t]).stream(),"stream"),[w0t]:()=>t}):new File([t],e,r)}a(Jxa,"createFile")});var bTi=I(wvr=>{"use strict";p();Object.defineProperty(wvr,"__esModule",{value:!0});wvr.concat=rwa;var s6=(v3(),Qa(hQ)),xvr=require("node:stream"),Zxa=x0t(),Xxa=Ivr();function vTi(){return s6.__asyncGenerator(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield s6.__await(e.read());if(r)return yield s6.__await(void 0);yield yield s6.__await(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(vTi,"streamAsyncIterator");function ewa(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=vTi.bind(t)),t.values||(t.values=vTi.bind(t))}a(ewa,"makeAsyncIterable");function twa(t){return t instanceof ReadableStream?(ewa(t),xvr.Readable.fromWeb(t)):t}a(twa,"ensureNodeStream");function CTi(t){return t instanceof Uint8Array?xvr.Readable.from(Buffer.from(t)):(0,Zxa.isBlob)(t)?CTi((0,Xxa.getRawContent)(t)):twa(t)}a(CTi,"toStream");async function rwa(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(CTi);return xvr.Readable.from((function(){return s6.__asyncGenerator(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,s6.__asyncValues(d)),u;u=yield s6.__await(l.next()),r=u.done,!r;c=!0){s=u.value,c=!1;let f=s;yield yield s6.__await(f)}}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield s6.__await(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(rwa,"concat")});var Rvr=I(Cge=>{"use strict";p();Object.defineProperty(Cge,"__esModule",{value:!0});Cge.multipartPolicyName=void 0;Cge.multipartPolicy=pwa;var _te=U4(),nwa=bTi(),iwa=x0t();function owa(){return`----AzSDKFormBoundary${(0,_te.randomUUID)()}`}a(owa,"generateBoundary");function swa(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r +`;return e}a(swa,"encodeHeaders");function awa(t){return t instanceof Uint8Array?t.byteLength:(0,iwa.isBlob)(t)?t.size===-1?void 0:t.size:void 0}a(awa,"getLength");function cwa(t){let e=0;for(let r of t){let n=awa(r);if(n===void 0)return;e+=n}return e}a(cwa,"getTotalLength");async function lwa(t,e,r){let n=[(0,_te.stringToUint8Array)(`--${r}`,"utf-8"),...e.flatMap(s=>[(0,_te.stringToUint8Array)(`\r +`,"utf-8"),(0,_te.stringToUint8Array)(swa(s.headers),"utf-8"),(0,_te.stringToUint8Array)(`\r +`,"utf-8"),s.body,(0,_te.stringToUint8Array)(`\r +--${r}`,"utf-8")]),(0,_te.stringToUint8Array)(`--\r \r -`,"utf-8")],o=FTa(n);o&&t.headers.set("Content-Length",o),t.body=await(0,NTa.concat)(n)}a(UTa,"buildRequestBody");sge.multipartPolicyName="multipartPolicy";var QTa=70,qTa=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function jTa(t){if(t.length>QTa)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!qTa.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(jTa,"assertValidBoundary");function HTa(){return{name:sge.multipartPolicyName,async sendRequest(t,e){var r;if(!t.multipartBody)return e(t);if(t.body)throw new Error("multipartBody and regular body cannot be set at the same time");let n=t.multipartBody.boundary,o=(r=t.headers.get("Content-Type"))!==null&&r!==void 0?r:"multipart/mixed",s=o.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!s)throw new Error(`Got multipart request body, but content-type header was not multipart: ${o}`);let[,c,l]=s;if(l&&n&&l!==n)throw new Error(`Multipart boundary was specified as ${l} in the header, but got ${n} in the request body`);return n??(n=l),n?jTa(n):n=OTa(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await UTa(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(HTa,"multipartPolicy")});var B_r=I(age=>{"use strict";p();Object.defineProperty(age,"__esModule",{value:!0});age.decompressResponsePolicyName=void 0;age.decompressResponsePolicy=GTa;age.decompressResponsePolicyName="decompressResponsePolicy";function GTa(){return{name:age.decompressResponsePolicyName,async sendRequest(t,e){return t.method!=="HEAD"&&t.headers.set("Accept-Encoding","gzip,deflate"),e(t)}}}a(GTa,"decompressResponsePolicy")});var i0t=I(n0t=>{"use strict";p();Object.defineProperty(n0t,"__esModule",{value:!0});n0t.delay=WTa;n0t.parseHeaderValueAsNumber=zTa;var $Ta=FOe(),VTa="The operation was aborted.";function WTa(t,e,r){return new Promise((n,o)=>{let s,c,l=a(()=>o(new $Ta.AbortError(r?.abortErrorMsg?r?.abortErrorMsg:VTa)),"rejectOnAbort"),u=a(()=>{r?.abortSignal&&c&&r.abortSignal.removeEventListener("abort",c)},"removeListeners");if(c=a(()=>(s&&clearTimeout(s),u(),l()),"onAborted"),r?.abortSignal&&r.abortSignal.aborted)return l();s=setTimeout(()=>{u(),n(e)},t),r?.abortSignal&&r.abortSignal.addEventListener("abort",c)})}a(WTa,"delay");function zTa(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(zTa,"parseHeaderValueAsNumber")});var s0t=I(o0t=>{"use strict";p();Object.defineProperty(o0t,"__esModule",{value:!0});o0t.isThrottlingRetryResponse=JTa;o0t.throttlingRetryStrategy=ZTa;var YTa=i0t(),F_r="Retry-After",KTa=["retry-after-ms","x-ms-retry-after-ms",F_r];function D1i(t){if(t&&[429,503].includes(t.status))try{for(let o of KTa){let s=(0,YTa.parseHeaderValueAsNumber)(t,o);if(s===0||s)return s*(o===F_r?1e3:1)}let e=t.headers.get(F_r);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(D1i,"getRetryAfterInMs");function JTa(t){return Number.isFinite(D1i(t))}a(JTa,"isThrottlingRetryResponse");function ZTa(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=D1i(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(ZTa,"throttlingRetryStrategy")});var a0t=I(qOe=>{"use strict";p();Object.defineProperty(qOe,"__esModule",{value:!0});qOe.exponentialRetryStrategy=nIa;qOe.isExponentialRetryResponse=N1i;qOe.isSystemError=M1i;var XTa=O4(),eIa=s0t(),tIa=1e3,rIa=1e3*64;function nIa(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:tIa,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:rIa,s=n;return{name:"exponentialRetryStrategy",retry({retryCount:c,response:l,responseError:u}){let d=M1i(u),f=d&&t.ignoreSystemErrors,h=N1i(l),m=h&&t.ignoreHttpStatusCodes;if(l&&((0,eIa.isThrottlingRetryResponse)(l)||!h)||m||f)return{skipStrategy:!0};if(u&&!d&&!h)return{errorToThrow:u};let A=s*Math.pow(2,c),y=Math.min(o,A);return s=y/2+(0,XTa.getRandomIntegerInclusive)(0,y/2),{retryAfterInMs:s}}}}a(nIa,"exponentialRetryStrategy");function N1i(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(N1i,"isExponentialRetryResponse");function M1i(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(M1i,"isSystemError")});var cge=I(U_r=>{"use strict";p();Object.defineProperty(U_r,"__esModule",{value:!0});U_r.retryPolicy=cIa;var iIa=i0t(),oIa=sht(),sIa=FOe(),O1i=TG(),L1i=(0,oIa.createClientLogger)("core-rest-pipeline retryPolicy"),aIa="retryPolicy";function cIa(t,e={maxRetries:O1i.DEFAULT_RETRY_POLICY_COUNT}){let r=e.logger||L1i;return{name:aIa,async sendRequest(n,o){var s,c;let l,u,d=-1;e:for(;;){d+=1,l=void 0,u=void 0;try{r.info(`Retry ${d}: Attempting to send request`,n.requestId),l=await o(n),r.info(`Retry ${d}: Received a response from request`,n.requestId)}catch(f){if(r.error(`Retry ${d}: Received an error from request`,n.requestId),u=f,!f||u.name!=="RestError")throw f;l=u.response}if(!((s=n.abortSignal)===null||s===void 0)&&s.aborted)throw r.error(`Retry ${d}: Request aborted.`),new sIa.AbortError;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:O1i.DEFAULT_RETRY_POLICY_COUNT)){if(r.info(`Retry ${d}: Maximum retries reached. Returning the last received response, or throwing the last received error.`),u)throw u;if(l)return l;throw new Error("Maximum retries reached with no response or error to throw")}r.info(`Retry ${d}: Processing ${t.length} retry strategies.`);t:for(let f of t){let h=f.logger||L1i;h.info(`Retry ${d}: Processing retry strategy ${f.name}.`);let m=f.retry({retryCount:d,response:l,responseError:u});if(m.skipStrategy){h.info(`Retry ${d}: Skipped.`);continue t}let{errorToThrow:g,retryAfterInMs:A,redirectTo:y}=m;if(g)throw h.error(`Retry ${d}: Retry strategy ${f.name} throws error:`,g),g;if(A||A===0){h.info(`Retry ${d}: Retry strategy ${f.name} retries after ${A}`),await(0,iIa.delay)(A,void 0,{abortSignal:n.abortSignal});continue e}if(y){h.info(`Retry ${d}: Retry strategy ${f.name} redirects to ${y}`),n.url=y;continue e}}if(u)throw r.info("None of the retry strategies could work with the received error. Throwing it."),u;if(l)return r.info("None of the retry strategies could work with the received response. Returning it."),l}}}}a(cIa,"retryPolicy")});var Q_r=I(lge=>{"use strict";p();Object.defineProperty(lge,"__esModule",{value:!0});lge.defaultRetryPolicyName=void 0;lge.defaultRetryPolicy=pIa;var lIa=a0t(),uIa=s0t(),dIa=cge(),fIa=TG();lge.defaultRetryPolicyName="defaultRetryPolicy";function pIa(t={}){var e;return{name:lge.defaultRetryPolicyName,sendRequest:(0,dIa.retryPolicy)([(0,uIa.throttlingRetryStrategy)(),(0,lIa.exponentialRetryStrategy)(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:fIa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(pIa,"defaultRetryPolicy")});var jOe=I(j_r=>{"use strict";p();Object.defineProperty(j_r,"__esModule",{value:!0});j_r.createHttpHeaders=mIa;function c0t(t){return t.toLowerCase()}a(c0t,"normalizeName");function*hIa(t){for(let e of t.values())yield[e.name,e.value]}a(hIa,"headerIterator");var q_r=class{static{a(this,"HttpHeadersImpl")}constructor(e){if(this._headersMap=new Map,e)for(let r of Object.keys(e))this.set(r,e[r])}set(e,r){this._headersMap.set(c0t(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(c0t(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(c0t(e))}delete(e){this._headersMap.delete(c0t(e))}toJSON(e={}){let r={};if(e.preserveCase)for(let n of this._headersMap.values())r[n.name]=n.value;else for(let[n,o]of this._headersMap)r[n]=o.value;return r}toString(){return JSON.stringify(this.toJSON({preserveCase:!0}))}[Symbol.iterator](){return hIa(this._headersMap)}};function mIa(t){return new q_r(t)}a(mIa,"createHttpHeaders")});var H_r=I(uge=>{"use strict";p();Object.defineProperty(uge,"__esModule",{value:!0});uge.formDataPolicyName=void 0;uge.formDataPolicy=AIa;var F1i=O4(),B1i=jOe();uge.formDataPolicyName="formDataPolicy";function gIa(t){var e;let r={};for(let[n,o]of t.entries())(e=r[n])!==null&&e!==void 0||(r[n]=[]),r[n].push(o);return r}a(gIa,"formDataToFormDataMap");function AIa(){return{name:uge.formDataPolicyName,async sendRequest(t,e){if(F1i.isNodeLike&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=gIa(t.body),t.body=void 0),t.formData){let r=t.headers.get("Content-Type");r&&r.indexOf("application/x-www-form-urlencoded")!==-1?t.body=yIa(t.formData):await EIa(t.formData,t),t.formData=void 0}return e(t)}}}a(AIa,"formDataPolicy");function yIa(t){let e=new URLSearchParams;for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.append(r,o.toString());else e.append(r,n.toString());return e.toString()}a(yIa,"wwwFormUrlEncode");async function EIa(t,e){let r=e.headers.get("Content-Type");if(r&&!r.startsWith("multipart/form-data"))return;e.headers.set("Content-Type",r??"multipart/form-data");let n=[];for(let[o,s]of Object.entries(t))for(let c of Array.isArray(s)?s:[s])if(typeof c=="string")n.push({headers:(0,B1i.createHttpHeaders)({"Content-Disposition":`form-data; name="${o}"`}),body:(0,F1i.stringToUint8Array)(c,"utf-8")});else{if(c==null||typeof c!="object")throw new Error(`Unexpected value for key ${o}: ${c}. Value should be serialized to string first.`);{let l=c.name||"blob",u=(0,B1i.createHttpHeaders)();u.set("Content-Disposition",`form-data; name="${o}"; filename="${l}"`),u.set("Content-Type",c.type||"application/octet-stream"),n.push({headers:u,body:c})}}e.multipartBody={parts:n}}a(EIa,"prepareFormData")});var G_r=I(SR=>{"use strict";p();Object.defineProperty(SR,"__esModule",{value:!0});SR.globalNoProxyList=SR.proxyPolicyName=void 0;SR.loadNoProxy=H1i;SR.getDefaultProxySettings=RIa;SR.proxyPolicy=PIa;var _Ia=W3t(),vIa=z3t(),CIa=lte(),bIa="HTTPS_PROXY",SIa="HTTP_PROXY",TIa="ALL_PROXY",IIa="NO_PROXY";SR.proxyPolicyName="proxyPolicy";SR.globalNoProxyList=[];var q1i=!1,xIa=new Map;function l0t(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(l0t,"getEnvironmentValue");function j1i(){if(!process)return;let t=l0t(bIa),e=l0t(TIa),r=l0t(SIa);return t||e||r}a(j1i,"loadEnvironmentProxyValue");function wIa(t,e,r){if(e.length===0)return!1;let n=new URL(t).hostname;if(r?.has(n))return r.get(n);let o=!1;for(let s of e)s[0]==="."?(n.endsWith(s)||n.length===s.length-1&&n===s.slice(1))&&(o=!0):n===s&&(o=!0);return r?.set(n,o),o}a(wIa,"isBypassed");function H1i(){let t=l0t(IIa);return q1i=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(H1i,"loadNoProxy");function RIa(t){if(!t&&(t=j1i(),!t))return;let e=new URL(t);return{host:(e.protocol?e.protocol+"//":"")+e.hostname,port:Number.parseInt(e.port||"80"),username:e.username,password:e.password}}a(RIa,"getDefaultProxySettings");function kIa(){let t=j1i();return t?new URL(t):void 0}a(kIa,"getDefaultProxySettingsInternal");function U1i(t){let e;try{e=new URL(t.host)}catch{throw new Error(`Expecting a valid host string in proxy settings, but found "${t.host}".`)}return e.port=String(t.port),t.username&&(e.username=t.username),t.password&&(e.password=t.password),e}a(U1i,"getUrlFromProxySettings");function Q1i(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&CIa.logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");let s=t.headers.toJSON();o?(e.httpProxyAgent||(e.httpProxyAgent=new vIa.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new _Ia.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(Q1i,"setProxyAgentOnRequest");function PIa(t,e){q1i||SR.globalNoProxyList.push(...H1i());let r=t?U1i(t):kIa(),n={};return{name:SR.proxyPolicyName,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!wIa(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:SR.globalNoProxyList,e?.customNoProxyList?void 0:xIa)?Q1i(o,n,r):o.proxySettings&&Q1i(o,n,U1i(o.proxySettings)),s(o)}}}a(PIa,"proxyPolicy")});var $_r=I(dge=>{"use strict";p();Object.defineProperty(dge,"__esModule",{value:!0});dge.setClientRequestIdPolicyName=void 0;dge.setClientRequestIdPolicy=DIa;dge.setClientRequestIdPolicyName="setClientRequestIdPolicy";function DIa(t="x-ms-client-request-id"){return{name:dge.setClientRequestIdPolicyName,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(DIa,"setClientRequestIdPolicy")});var V_r=I(fge=>{"use strict";p();Object.defineProperty(fge,"__esModule",{value:!0});fge.tlsPolicyName=void 0;fge.tlsPolicy=NIa;fge.tlsPolicyName="tlsPolicy";function NIa(t){return{name:fge.tlsPolicyName,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(NIa,"tlsPolicy")});var W_r=I(Y8=>{"use strict";p();Object.defineProperty(Y8,"__esModule",{value:!0});Y8.TracingContextImpl=Y8.knownContextKeys=void 0;Y8.createTracingContext=MIa;Y8.knownContextKeys={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function MIa(t={}){let e=new u0t(t.parentContext);return t.span&&(e=e.setValue(Y8.knownContextKeys.span,t.span)),t.namespace&&(e=e.setValue(Y8.knownContextKeys.namespace,t.namespace)),e}a(MIa,"createTracingContext");var u0t=class t{static{a(this,"TracingContextImpl")}constructor(e){this._contextMap=e instanceof t?new Map(e._contextMap):new Map}setValue(e,r){let n=new t(this);return n._contextMap.set(e,r),n}getValue(e){return this._contextMap.get(e)}deleteValue(e){let r=new t(this);return r._contextMap.delete(e),r}};Y8.TracingContextImpl=u0t});var z_r=I(pge=>{"use strict";p();Object.defineProperty(pge,"__esModule",{value:!0});pge.createDefaultTracingSpan=G1i;pge.createDefaultInstrumenter=$1i;pge.useInstrumenter=LIa;pge.getInstrumenter=BIa;var OIa=W_r(),d0t=q5t();function G1i(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(G1i,"createDefaultTracingSpan");function $1i(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:G1i(),tracingContext:(0,OIa.createTracingContext)({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a($1i,"createDefaultInstrumenter");function LIa(t){d0t.state.instrumenterImplementation=t}a(LIa,"useInstrumenter");function BIa(){return d0t.state.instrumenterImplementation||(d0t.state.instrumenterImplementation=$1i()),d0t.state.instrumenterImplementation}a(BIa,"getInstrumenter")});var V1i=I(K_r=>{"use strict";p();Object.defineProperty(K_r,"__esModule",{value:!0});K_r.createTracingClient=FIa;var f0t=z_r(),Y_r=W_r();function FIa(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=(0,f0t.getInstrumenter)().startSpan(d,Object.assign(Object.assign({},h),{packageName:r,packageVersion:n,tracingContext:(m=f?.tracingOptions)===null||m===void 0?void 0:m.tracingContext})),A=g.tracingContext,y=g.span;A.getValue(Y_r.knownContextKeys.namespace)||(A=A.setValue(Y_r.knownContextKeys.namespace,e)),y.setAttribute("az.namespace",A.getValue(Y_r.knownContextKeys.namespace));let E=Object.assign({},f,{tracingOptions:Object.assign(Object.assign({},f?.tracingOptions),{tracingContext:A})});return{span:y,updatedOptions:E}}a(o,"startSpan");async function s(d,f,h,m){let{span:g,updatedOptions:A}=o(d,f,m);try{let y=await c(A.tracingOptions.tracingContext,()=>Promise.resolve(h(A,g)));return g.setStatus({status:"success"}),y}catch(y){throw g.setStatus({status:"error",error:y}),y}finally{g.end()}}a(s,"withSpan");function c(d,f,...h){return(0,f0t.getInstrumenter)().withContext(d,f,...h)}a(c,"withContext");function l(d){return(0,f0t.getInstrumenter)().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return(0,f0t.getInstrumenter)().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(FIa,"createTracingClient")});var W1i=I(hge=>{"use strict";p();Object.defineProperty(hge,"__esModule",{value:!0});hge.createTracingClient=hge.useInstrumenter=void 0;var UIa=z_r();Object.defineProperty(hge,"useInstrumenter",{enumerable:!0,get:a(function(){return UIa.useInstrumenter},"get")});var QIa=V1i();Object.defineProperty(hge,"createTracingClient",{enumerable:!0,get:a(function(){return QIa.createTracingClient},"get")})});var z1i=I(p0t=>{"use strict";p();Object.defineProperty(p0t,"__esModule",{value:!0});p0t.custom=void 0;var qIa=require("node:util");p0t.custom=qIa.inspect.custom});var h0t=I(HOe=>{"use strict";p();Object.defineProperty(HOe,"__esModule",{value:!0});HOe.RestError=void 0;HOe.isRestError=VIa;var jIa=O4(),HIa=z1i(),GIa=Zmt(),$Ia=new GIa.Sanitizer,mge=class t extends Error{static{a(this,"RestError")}constructor(e,r={}){super(e),this.name="RestError",this.code=r.code,this.statusCode=r.statusCode,Object.defineProperty(this,"request",{value:r.request,enumerable:!1}),Object.defineProperty(this,"response",{value:r.response,enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}[HIa.custom](){return`RestError: ${this.message} - ${$Ia.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`}};HOe.RestError=mge;mge.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";mge.PARSE_ERROR="PARSE_ERROR";function VIa(t){return t instanceof mge?!0:(0,jIa.isError)(t)&&t.name==="RestError"}a(VIa,"isRestError")});var J_r=I(gge=>{"use strict";p();Object.defineProperty(gge,"__esModule",{value:!0});gge.tracingPolicyName=void 0;gge.tracingPolicy=ZIa;var WIa=W1i(),zIa=TG(),YIa=P_r(),m0t=lte(),GOe=O4(),KIa=h0t(),JIa=Zmt();gge.tracingPolicyName="tracingPolicy";function ZIa(t={}){let e=(0,YIa.getUserAgentValue)(t.userAgentPrefix),r=new JIa.Sanitizer({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=XIa();return{name:gge.tracingPolicyName,async sendRequest(o,s){var c,l;if(!n||!(!((c=o.tracingOptions)===null||c===void 0)&&c.tracingContext))return s(o);let u=await e,d={"http.url":r.sanitizeUrl(o.url),"http.method":o.method,"http.user_agent":u,requestId:o.requestId};u&&(d["http.user_agent"]=u);let{span:f,tracingContext:h}=(l=exa(n,o,d))!==null&&l!==void 0?l:{};if(!f||!h)return s(o);try{let m=await n.withContext(h,s,o);return rxa(f,m),m}catch(m){throw txa(f,m),m}}}}a(ZIa,"tracingPolicy");function XIa(){try{return(0,WIa.createTracingClient)({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:zIa.SDK_VERSION})}catch(t){m0t.logger.warning(`Error when creating the TracingClient: ${(0,GOe.getErrorMessage)(t)}`);return}}a(XIa,"tryCreateTracingClient");function exa(t,e,r){try{let{span:n,updatedOptions:o}=t.startSpan(`HTTP ${e.method}`,{tracingOptions:e.tracingOptions},{spanKind:"client",spanAttributes:r});if(!n.isRecording()){n.end();return}let s=t.createRequestHeaders(o.tracingOptions.tracingContext);for(let[c,l]of Object.entries(s))e.headers.set(c,l);return{span:n,tracingContext:o.tracingOptions.tracingContext}}catch(n){m0t.logger.warning(`Skipping creating a tracing span due to an error: ${(0,GOe.getErrorMessage)(n)}`);return}}a(exa,"tryCreateSpan");function txa(t,e){try{t.setStatus({status:"error",error:(0,GOe.isError)(e)?e:void 0}),(0,KIa.isRestError)(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){m0t.logger.warning(`Skipping tracing span processing due to an error: ${(0,GOe.getErrorMessage)(r)}`)}}a(txa,"tryProcessError");function rxa(t,e){try{t.setAttribute("http.status_code",e.status);let r=e.headers.get("x-ms-request-id");r&&t.setAttribute("serviceRequestId",r),t.setStatus({status:"success"}),t.end()}catch(r){m0t.logger.warning(`Skipping tracing span processing due to an error: ${(0,GOe.getErrorMessage)(r)}`)}}a(rxa,"tryProcessResponse")});var J1i=I(Z_r=>{"use strict";p();Object.defineProperty(Z_r,"__esModule",{value:!0});Z_r.createPipelineFromOptions=hxa;var nxa=x_r(),ixa=i_r(),oxa=w_r(),sxa=D_r(),Y1i=L_r(),axa=B_r(),cxa=Q_r(),lxa=H_r(),K1i=O4(),uxa=G_r(),dxa=$_r(),fxa=V_r(),pxa=J_r();function hxa(t){var e;let r=(0,ixa.createEmptyPipeline)();return K1i.isNodeLike&&(t.tlsOptions&&r.addPolicy((0,fxa.tlsPolicy)(t.tlsOptions)),r.addPolicy((0,uxa.proxyPolicy)(t.proxyOptions)),r.addPolicy((0,axa.decompressResponsePolicy)())),r.addPolicy((0,lxa.formDataPolicy)(),{beforePolicies:[Y1i.multipartPolicyName]}),r.addPolicy((0,sxa.userAgentPolicy)(t.userAgentOptions)),r.addPolicy((0,dxa.setClientRequestIdPolicy)((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy((0,Y1i.multipartPolicy)(),{afterPhase:"Deserialize"}),r.addPolicy((0,cxa.defaultRetryPolicy)(t.retryOptions),{phase:"Retry"}),r.addPolicy((0,pxa.tracingPolicy)(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),K1i.isNodeLike&&r.addPolicy((0,oxa.redirectPolicy)(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy((0,nxa.logPolicy)(t.loggingOptions),{afterPhase:"Sign"}),r}a(hxa,"createPipelineFromOptions")});var nSi=I(A0t=>{"use strict";p();Object.defineProperty(A0t,"__esModule",{value:!0});A0t.getBodyLength=rSi;A0t.createNodeHttpClient=vxa;var rvr=(m3(),ba(iQ)),X_r=rvr.__importStar(require("node:http")),evr=rvr.__importStar(require("node:https")),Z1i=rvr.__importStar(require("node:zlib")),mxa=require("node:stream"),X1i=FOe(),gxa=jOe(),WOe=h0t(),$Oe=lte(),Axa={};function VOe(t){return t&&typeof t.pipe=="function"}a(VOe,"isReadableStream");function eSi(t){return new Promise(e=>{t.on("close",e),t.on("end",e),t.on("error",e)})}a(eSi,"isStreamComplete");function tSi(t){return t&&typeof t.byteLength=="number"}a(tSi,"isArrayBuffer");var g0t=class extends mxa.Transform{static{a(this,"ReportTransform")}_transform(e,r,n){this.push(e),this.loadedBytes+=e.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),n()}catch(o){n(o)}}constructor(e){super(),this.loadedBytes=0,this.progressCallback=e}},tvr=class{static{a(this,"NodeHttpClient")}constructor(){this.cachedHttpsAgents=new WeakMap}async sendRequest(e){var r,n,o;let s=new AbortController,c;if(e.abortSignal){if(e.abortSignal.aborted)throw new X1i.AbortError("The operation was aborted.");c=a(h=>{h.type==="abort"&&s.abort()},"abortListener"),e.abortSignal.addEventListener("abort",c)}e.timeout>0&&setTimeout(()=>{s.abort()},e.timeout);let l=e.headers.get("Accept-Encoding"),u=l?.includes("gzip")||l?.includes("deflate"),d=typeof e.body=="function"?e.body():e.body;if(d&&!e.headers.has("Content-Length")){let h=rSi(d);h!==null&&e.headers.set("Content-Length",h)}let f;try{if(d&&e.onUploadProgress){let E=e.onUploadProgress,_=new g0t(E);_.on("error",v=>{$Oe.logger.error("Error in upload progress",v)}),VOe(d)?d.pipe(_):_.end(d),d=_}let h=await this.makeRequest(e,s,d),m=yxa(h),A={status:(r=h.statusCode)!==null&&r!==void 0?r:0,headers:m,request:e};if(e.method==="HEAD")return h.resume(),A;f=u?Exa(h,m):h;let y=e.onDownloadProgress;if(y){let E=new g0t(y);E.on("error",_=>{$Oe.logger.error("Error in download progress",_)}),f.pipe(E),f=E}return!((n=e.streamResponseStatusCodes)===null||n===void 0)&&n.has(Number.POSITIVE_INFINITY)||!((o=e.streamResponseStatusCodes)===null||o===void 0)&&o.has(A.status)?A.readableStreamBody=f:A.bodyAsText=await _xa(f),A}finally{if(e.abortSignal&&c){let h=Promise.resolve();VOe(d)&&(h=eSi(d));let m=Promise.resolve();VOe(f)&&(m=eSi(f)),Promise.all([h,m]).then(()=>{var g;c&&((g=e.abortSignal)===null||g===void 0||g.removeEventListener("abort",c))}).catch(g=>{$Oe.logger.warning("Error when cleaning up abortListener on httpRequest",g)})}}}makeRequest(e,r,n){var o;let s=new URL(e.url),c=s.protocol!=="https:";if(c&&!e.allowInsecureConnection)throw new Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);let u={agent:(o=e.agent)!==null&&o!==void 0?o:this.getOrCreateAgent(e,c),hostname:s.hostname,path:`${s.pathname}${s.search}`,port:s.port,method:e.method,headers:e.headers.toJSON({preserveCase:!0})};return new Promise((d,f)=>{let h=c?X_r.request(u,d):evr.request(u,d);h.once("error",m=>{var g;f(new WOe.RestError(m.message,{code:(g=m.code)!==null&&g!==void 0?g:WOe.RestError.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new X1i.AbortError("The operation was aborted.");h.destroy(m),f(m)}),n&&VOe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):tSi(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):($Oe.logger.error("Unrecognized body type",n),f(new WOe.RestError("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?X_r.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new X_r.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return evr.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:Axa,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||($Oe.logger.info("No cached TLS Agent exist, creating a new Agent"),c=new evr.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function yxa(t){let e=(0,gxa.createHttpHeaders)();for(let r of Object.keys(t.headers)){let n=t.headers[r];Array.isArray(n)?n.length>0&&e.set(r,n[0]):n&&e.set(r,n)}return e}a(yxa,"getResponseHeaders");function Exa(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=Z1i.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=Z1i.createInflate();return t.pipe(n),n}return t}a(Exa,"getDecodedResponseStream");function _xa(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{Buffer.isBuffer(o)?n.push(o):n.push(Buffer.from(o))}),t.on("end",()=>{e(Buffer.concat(n).toString("utf8"))}),t.on("error",o=>{o&&o?.name==="AbortError"?r(o):r(new WOe.RestError(`Error reading response as text: ${o.message}`,{code:WOe.RestError.PARSE_ERROR}))})})}a(_xa,"streamToText");function rSi(t){return t?Buffer.isBuffer(t)?t.length:VOe(t)?null:tSi(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(rSi,"getBodyLength");function vxa(){return new tvr}a(vxa,"createNodeHttpClient")});var iSi=I(nvr=>{"use strict";p();Object.defineProperty(nvr,"__esModule",{value:!0});nvr.createDefaultHttpClient=bxa;var Cxa=nSi();function bxa(){return(0,Cxa.createNodeHttpClient)()}a(bxa,"createDefaultHttpClient")});var oSi=I(ovr=>{"use strict";p();Object.defineProperty(ovr,"__esModule",{value:!0});ovr.createPipelineRequest=Ixa;var Sxa=jOe(),Txa=O4(),ivr=class{static{a(this,"PipelineRequestImpl")}constructor(e){var r,n,o,s,c,l,u;this.url=e.url,this.body=e.body,this.headers=(r=e.headers)!==null&&r!==void 0?r:(0,Sxa.createHttpHeaders)(),this.method=(n=e.method)!==null&&n!==void 0?n:"GET",this.timeout=(o=e.timeout)!==null&&o!==void 0?o:0,this.multipartBody=e.multipartBody,this.formData=e.formData,this.disableKeepAlive=(s=e.disableKeepAlive)!==null&&s!==void 0?s:!1,this.proxySettings=e.proxySettings,this.streamResponseStatusCodes=e.streamResponseStatusCodes,this.withCredentials=(c=e.withCredentials)!==null&&c!==void 0?c:!1,this.abortSignal=e.abortSignal,this.tracingOptions=e.tracingOptions,this.onUploadProgress=e.onUploadProgress,this.onDownloadProgress=e.onDownloadProgress,this.requestId=e.requestId||(0,Txa.randomUUID)(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1}};function Ixa(t){return new ivr(t)}a(Ixa,"createPipelineRequest")});var sSi=I(zOe=>{"use strict";p();Object.defineProperty(zOe,"__esModule",{value:!0});zOe.exponentialRetryPolicyName=void 0;zOe.exponentialRetryPolicy=kxa;var xxa=a0t(),wxa=cge(),Rxa=TG();zOe.exponentialRetryPolicyName="exponentialRetryPolicy";function kxa(t={}){var e;return(0,wxa.retryPolicy)([(0,xxa.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreSystemErrors:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Rxa.DEFAULT_RETRY_POLICY_COUNT})}a(kxa,"exponentialRetryPolicy")});var aSi=I(Age=>{"use strict";p();Object.defineProperty(Age,"__esModule",{value:!0});Age.systemErrorRetryPolicyName=void 0;Age.systemErrorRetryPolicy=Mxa;var Pxa=a0t(),Dxa=cge(),Nxa=TG();Age.systemErrorRetryPolicyName="systemErrorRetryPolicy";function Mxa(t={}){var e;return{name:Age.systemErrorRetryPolicyName,sendRequest:(0,Dxa.retryPolicy)([(0,Pxa.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreHttpStatusCodes:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Nxa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(Mxa,"systemErrorRetryPolicy")});var cSi=I(yge=>{"use strict";p();Object.defineProperty(yge,"__esModule",{value:!0});yge.throttlingRetryPolicyName=void 0;yge.throttlingRetryPolicy=Fxa;var Oxa=s0t(),Lxa=cge(),Bxa=TG();yge.throttlingRetryPolicyName="throttlingRetryPolicy";function Fxa(t={}){var e;return{name:yge.throttlingRetryPolicyName,sendRequest:(0,Lxa.retryPolicy)([(0,Oxa.throttlingRetryStrategy)()],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Bxa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(Fxa,"throttlingRetryPolicy")});var svr=I(Ege=>{"use strict";p();Object.defineProperty(Ege,"__esModule",{value:!0});Ege.DEFAULT_CYCLER_OPTIONS=void 0;Ege.createTokenCycler=qxa;var Uxa=i0t();Ege.DEFAULT_CYCLER_OPTIONS={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function Qxa(t,e,r){async function n(){if(Date.now()t.getToken(u,d),"tryGetAccessToken"),s.retryIntervalInMs,(f=n?.expiresOnTimestamp)!==null&&f!==void 0?f:Date.now()).then(m=>(r=null,n=m,o=d.tenantId,n)).catch(m=>{throw r=null,n=null,o=void 0,m})),r}return a(l,"refresh"),async(u,d)=>{let f=!!d.claims,h=o!==d.tenantId;return f&&(n=null),h||f||c.mustRefresh?l(u,d):(c.shouldRefresh&&l(u,d),n)}}a(qxa,"createTokenCycler")});var lSi=I(_ge=>{"use strict";p();Object.defineProperty(_ge,"__esModule",{value:!0});_ge.bearerTokenAuthenticationPolicyName=void 0;_ge.bearerTokenAuthenticationPolicy=Vxa;var jxa=svr(),Hxa=lte();_ge.bearerTokenAuthenticationPolicyName="bearerTokenAuthenticationPolicy";async function Gxa(t){let{scopes:e,getAccessToken:r,request:n}=t,o={abortSignal:n.abortSignal,tracingOptions:n.tracingOptions},s=await r(e,o);s&&t.request.headers.set("Authorization",`Bearer ${s.token}`)}a(Gxa,"defaultAuthorizeRequest");function $xa(t){let e=t.headers.get("WWW-Authenticate");if(t.status===401&&e)return e}a($xa,"getChallenge");function Vxa(t){var e;let{credential:r,scopes:n,challengeCallbacks:o}=t,s=t.logger||Hxa.logger,c=Object.assign({authorizeRequest:(e=o?.authorizeRequest)!==null&&e!==void 0?e:Gxa,authorizeRequestOnChallenge:o?.authorizeRequestOnChallenge},o),l=r?(0,jxa.createTokenCycler)(r):()=>Promise.resolve(null);return{name:_ge.bearerTokenAuthenticationPolicyName,async sendRequest(u,d){if(!u.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");await c.authorizeRequest({scopes:Array.isArray(n)?n:[n],request:u,getAccessToken:l,logger:s});let f,h;try{f=await d(u)}catch(m){h=m,f=m.response}if(c.authorizeRequestOnChallenge&&f?.status===401&&$xa(f)&&await c.authorizeRequestOnChallenge({scopes:Array.isArray(n)?n:[n],request:u,response:f,getAccessToken:l,logger:s}))return d(u);if(h)throw h;return f}}}a(Vxa,"bearerTokenAuthenticationPolicy")});var uSi=I(vge=>{"use strict";p();Object.defineProperty(vge,"__esModule",{value:!0});vge.ndJsonPolicyName=void 0;vge.ndJsonPolicy=Wxa;vge.ndJsonPolicyName="ndJsonPolicy";function Wxa(){return{name:vge.ndJsonPolicyName,async sendRequest(t,e){if(typeof t.body=="string"&&t.body.startsWith("[")){let r=JSON.parse(t.body);Array.isArray(r)&&(t.body=r.map(n=>JSON.stringify(n)+` -`).join(""))}return e(t)}}}a(Wxa,"ndJsonPolicy")});var fSi=I(fte=>{"use strict";p();Object.defineProperty(fte,"__esModule",{value:!0});fte.auxiliaryAuthenticationHeaderPolicyName=void 0;fte.auxiliaryAuthenticationHeaderPolicy=Jxa;var zxa=svr(),Yxa=lte();fte.auxiliaryAuthenticationHeaderPolicyName="auxiliaryAuthenticationHeaderPolicy";var dSi="x-ms-authorization-auxiliary";async function Kxa(t){var e,r;let{scopes:n,getAccessToken:o,request:s}=t,c={abortSignal:s.abortSignal,tracingOptions:s.tracingOptions};return(r=(e=await o(n,c))===null||e===void 0?void 0:e.token)!==null&&r!==void 0?r:""}a(Kxa,"sendAuthorizeRequest");function Jxa(t){let{credentials:e,scopes:r}=t,n=t.logger||Yxa.logger,o=new WeakMap;return{name:fte.auxiliaryAuthenticationHeaderPolicyName,async sendRequest(s,c){if(!s.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication for auxiliary header is not permitted for non-TLS protected (non-https) URLs.");if(!e||e.length===0)return n.info(`${fte.auxiliaryAuthenticationHeaderPolicyName} header will not be set due to empty credentials.`),c(s);let l=[];for(let d of e){let f=o.get(d);f||(f=(0,zxa.createTokenCycler)(d),o.set(d,f)),l.push(Kxa({scopes:Array.isArray(r)?r:[r],request:s,getAccessToken:f,logger:n}))}let u=(await Promise.all(l)).filter(d=>!!d);return u.length===0?(n.warning(`None of the auxiliary tokens are valid. ${dSi} header will not be set.`),c(s)):(s.headers.set(dSi,u.map(d=>`Bearer ${d}`).join(", ")),c(s))}}}a(Jxa,"auxiliaryAuthenticationHeaderPolicy")});var kSi=I(vr=>{"use strict";p();Object.defineProperty(vr,"__esModule",{value:!0});vr.createFileFromStream=vr.createFile=vr.auxiliaryAuthenticationHeaderPolicyName=vr.auxiliaryAuthenticationHeaderPolicy=vr.ndJsonPolicyName=vr.ndJsonPolicy=vr.bearerTokenAuthenticationPolicyName=vr.bearerTokenAuthenticationPolicy=vr.formDataPolicyName=vr.formDataPolicy=vr.tlsPolicyName=vr.tlsPolicy=vr.userAgentPolicyName=vr.userAgentPolicy=vr.defaultRetryPolicy=vr.tracingPolicyName=vr.tracingPolicy=vr.retryPolicy=vr.throttlingRetryPolicyName=vr.throttlingRetryPolicy=vr.systemErrorRetryPolicyName=vr.systemErrorRetryPolicy=vr.redirectPolicyName=vr.redirectPolicy=vr.getDefaultProxySettings=vr.proxyPolicyName=vr.proxyPolicy=vr.multipartPolicyName=vr.multipartPolicy=vr.logPolicyName=vr.logPolicy=vr.setClientRequestIdPolicyName=vr.setClientRequestIdPolicy=vr.exponentialRetryPolicyName=vr.exponentialRetryPolicy=vr.decompressResponsePolicyName=vr.decompressResponsePolicy=vr.isRestError=vr.RestError=vr.createPipelineRequest=vr.createHttpHeaders=vr.createDefaultHttpClient=vr.createPipelineFromOptions=vr.createEmptyPipeline=void 0;var Zxa=i_r();Object.defineProperty(vr,"createEmptyPipeline",{enumerable:!0,get:a(function(){return Zxa.createEmptyPipeline},"get")});var Xxa=J1i();Object.defineProperty(vr,"createPipelineFromOptions",{enumerable:!0,get:a(function(){return Xxa.createPipelineFromOptions},"get")});var ewa=iSi();Object.defineProperty(vr,"createDefaultHttpClient",{enumerable:!0,get:a(function(){return ewa.createDefaultHttpClient},"get")});var twa=jOe();Object.defineProperty(vr,"createHttpHeaders",{enumerable:!0,get:a(function(){return twa.createHttpHeaders},"get")});var rwa=oSi();Object.defineProperty(vr,"createPipelineRequest",{enumerable:!0,get:a(function(){return rwa.createPipelineRequest},"get")});var pSi=h0t();Object.defineProperty(vr,"RestError",{enumerable:!0,get:a(function(){return pSi.RestError},"get")});Object.defineProperty(vr,"isRestError",{enumerable:!0,get:a(function(){return pSi.isRestError},"get")});var hSi=B_r();Object.defineProperty(vr,"decompressResponsePolicy",{enumerable:!0,get:a(function(){return hSi.decompressResponsePolicy},"get")});Object.defineProperty(vr,"decompressResponsePolicyName",{enumerable:!0,get:a(function(){return hSi.decompressResponsePolicyName},"get")});var mSi=sSi();Object.defineProperty(vr,"exponentialRetryPolicy",{enumerable:!0,get:a(function(){return mSi.exponentialRetryPolicy},"get")});Object.defineProperty(vr,"exponentialRetryPolicyName",{enumerable:!0,get:a(function(){return mSi.exponentialRetryPolicyName},"get")});var gSi=$_r();Object.defineProperty(vr,"setClientRequestIdPolicy",{enumerable:!0,get:a(function(){return gSi.setClientRequestIdPolicy},"get")});Object.defineProperty(vr,"setClientRequestIdPolicyName",{enumerable:!0,get:a(function(){return gSi.setClientRequestIdPolicyName},"get")});var ASi=x_r();Object.defineProperty(vr,"logPolicy",{enumerable:!0,get:a(function(){return ASi.logPolicy},"get")});Object.defineProperty(vr,"logPolicyName",{enumerable:!0,get:a(function(){return ASi.logPolicyName},"get")});var ySi=L_r();Object.defineProperty(vr,"multipartPolicy",{enumerable:!0,get:a(function(){return ySi.multipartPolicy},"get")});Object.defineProperty(vr,"multipartPolicyName",{enumerable:!0,get:a(function(){return ySi.multipartPolicyName},"get")});var avr=G_r();Object.defineProperty(vr,"proxyPolicy",{enumerable:!0,get:a(function(){return avr.proxyPolicy},"get")});Object.defineProperty(vr,"proxyPolicyName",{enumerable:!0,get:a(function(){return avr.proxyPolicyName},"get")});Object.defineProperty(vr,"getDefaultProxySettings",{enumerable:!0,get:a(function(){return avr.getDefaultProxySettings},"get")});var ESi=w_r();Object.defineProperty(vr,"redirectPolicy",{enumerable:!0,get:a(function(){return ESi.redirectPolicy},"get")});Object.defineProperty(vr,"redirectPolicyName",{enumerable:!0,get:a(function(){return ESi.redirectPolicyName},"get")});var _Si=aSi();Object.defineProperty(vr,"systemErrorRetryPolicy",{enumerable:!0,get:a(function(){return _Si.systemErrorRetryPolicy},"get")});Object.defineProperty(vr,"systemErrorRetryPolicyName",{enumerable:!0,get:a(function(){return _Si.systemErrorRetryPolicyName},"get")});var vSi=cSi();Object.defineProperty(vr,"throttlingRetryPolicy",{enumerable:!0,get:a(function(){return vSi.throttlingRetryPolicy},"get")});Object.defineProperty(vr,"throttlingRetryPolicyName",{enumerable:!0,get:a(function(){return vSi.throttlingRetryPolicyName},"get")});var nwa=cge();Object.defineProperty(vr,"retryPolicy",{enumerable:!0,get:a(function(){return nwa.retryPolicy},"get")});var CSi=J_r();Object.defineProperty(vr,"tracingPolicy",{enumerable:!0,get:a(function(){return CSi.tracingPolicy},"get")});Object.defineProperty(vr,"tracingPolicyName",{enumerable:!0,get:a(function(){return CSi.tracingPolicyName},"get")});var iwa=Q_r();Object.defineProperty(vr,"defaultRetryPolicy",{enumerable:!0,get:a(function(){return iwa.defaultRetryPolicy},"get")});var bSi=D_r();Object.defineProperty(vr,"userAgentPolicy",{enumerable:!0,get:a(function(){return bSi.userAgentPolicy},"get")});Object.defineProperty(vr,"userAgentPolicyName",{enumerable:!0,get:a(function(){return bSi.userAgentPolicyName},"get")});var SSi=V_r();Object.defineProperty(vr,"tlsPolicy",{enumerable:!0,get:a(function(){return SSi.tlsPolicy},"get")});Object.defineProperty(vr,"tlsPolicyName",{enumerable:!0,get:a(function(){return SSi.tlsPolicyName},"get")});var TSi=H_r();Object.defineProperty(vr,"formDataPolicy",{enumerable:!0,get:a(function(){return TSi.formDataPolicy},"get")});Object.defineProperty(vr,"formDataPolicyName",{enumerable:!0,get:a(function(){return TSi.formDataPolicyName},"get")});var ISi=lSi();Object.defineProperty(vr,"bearerTokenAuthenticationPolicy",{enumerable:!0,get:a(function(){return ISi.bearerTokenAuthenticationPolicy},"get")});Object.defineProperty(vr,"bearerTokenAuthenticationPolicyName",{enumerable:!0,get:a(function(){return ISi.bearerTokenAuthenticationPolicyName},"get")});var xSi=uSi();Object.defineProperty(vr,"ndJsonPolicy",{enumerable:!0,get:a(function(){return xSi.ndJsonPolicy},"get")});Object.defineProperty(vr,"ndJsonPolicyName",{enumerable:!0,get:a(function(){return xSi.ndJsonPolicyName},"get")});var wSi=fSi();Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicy",{enumerable:!0,get:a(function(){return wSi.auxiliaryAuthenticationHeaderPolicy},"get")});Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicyName",{enumerable:!0,get:a(function(){return wSi.auxiliaryAuthenticationHeaderPolicyName},"get")});var RSi=N_r();Object.defineProperty(vr,"createFile",{enumerable:!0,get:a(function(){return RSi.createFile},"get")});Object.defineProperty(vr,"createFileFromStream",{enumerable:!0,get:a(function(){return RSi.createFileFromStream},"get")})});var DSi=I((KOe,PSi)=>{"use strict";p();var owa=KOe&&KOe.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},swa=KOe&&KOe.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var dwa=Kl(),fwa=ay(),pwa=(function(){function t(e,r,n,o){this._buffer=[],this._lastSend=0,this._isDisabled=e,this._getBatchSize=r,this._getBatchIntervalMs=n,this._sender=o}return a(t,"Channel"),t.prototype.setUseDiskRetryCaching=function(e,r,n){this._sender.setDiskRetryMode(e,r,n)},t.prototype.send=function(e){var r=this;if(!this._isDisabled()){if(!e){dwa.warn("Cannot send null/undefined telemetry");return}if(this._buffer.push(e),this._buffer.length>=this._getBatchSize()){this.triggerSend(!1);return}!this._timeoutHandle&&this._buffer.length>0&&(this._timeoutHandle=setTimeout(function(){r._timeoutHandle=null,r.triggerSend(!1)},this._getBatchIntervalMs()))}},t.prototype.triggerSend=function(e,r){var n=this._buffer.length<1;n||(e||fwa.isNodeExit?(this._sender.saveOnCrash(this._buffer),typeof r=="function"&&r("data saved on crash")):this._sender.send(this._buffer,r)),this._lastSend=+new Date,this._buffer=[],clearTimeout(this._timeoutHandle),this._timeoutHandle=null,n&&typeof r=="function"&&r("no data to send")},t})();NSi.exports=pwa});var OSi=I(cvr=>{"use strict";p();Object.defineProperty(cvr,"__esModule",{value:!0});cvr.azureRoleEnvironmentTelemetryProcessor=hwa;function hwa(t,e){}a(hwa,"azureRoleEnvironmentTelemetryProcessor")});var FSi=I(y0t=>{"use strict";p();Object.defineProperty(y0t,"__esModule",{value:!0});y0t.samplingTelemetryProcessor=mwa;y0t.getSamplingHashCode=BSi;var LSi=ME();function mwa(t,e){var r=t.sampleRate,n=!1;return r==null||r>=100||t.data&&LSi.TelemetryType.Metric===LSi.baseTypeToTelemetryType(t.data.baseType)?!0:(e.correlationContext&&e.correlationContext.operation?n=BSi(e.correlationContext.operation.id){"use strict";p();var gwa=K8&&K8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Awa=K8&&K8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ywa=K8&&K8.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&gwa(e,t,r);return Awa(e,t),e};Object.defineProperty(K8,"__esModule",{value:!0});K8.performanceMetricsTelemetryProcessor=Ewa;var lvr=kmt(),uvr=ywa(ME());function Ewa(t,e){switch(e&&e.addDocument(t),t.data.baseType){case uvr.TelemetryTypeString.Exception:lvr.countException();break;case uvr.TelemetryTypeString.Request:var r=t.data.baseData;lvr.countRequest(r.duration,r.success);break;case uvr.TelemetryTypeString.Dependency:var n=t.data.baseData;lvr.countDependency(n.duration,n.success);break}return!0}a(Ewa,"performanceMetricsTelemetryProcessor")});var QSi=I(aD=>{"use strict";p();var L4=aD&&aD.__assign||function(){return L4=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var Twa=B4&&B4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_0t=B4&&B4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Twa(e,t,r)};Object.defineProperty(B4,"__esModule",{value:!0});_0t(OSi(),B4);_0t(FSi(),B4);_0t(USi(),B4);_0t(QSi(),B4)});var dvr=I((rvp,GSi)=>{"use strict";p();var Zi=ME(),Gb=ay(),jSi=AG(),Iwa=Kl(),xwa=(function(){function t(){}return a(t,"EnvelopeFactory"),t.createEnvelope=function(e,r,n,o,s){var c=null;switch(r){case Zi.TelemetryType.Trace:c=t.createTraceData(e);break;case Zi.TelemetryType.Dependency:c=t.createDependencyData(e);break;case Zi.TelemetryType.Event:c=t.createEventData(e);break;case Zi.TelemetryType.Exception:c=t.createExceptionData(e);break;case Zi.TelemetryType.Request:c=t.createRequestData(e);break;case Zi.TelemetryType.Metric:c=t.createMetricData(e);break;case Zi.TelemetryType.Availability:c=t.createAvailabilityData(e);break;case Zi.TelemetryType.PageView:c=t.createPageViewData(e);break}if(c&&c.baseData&&Zi.domainSupportsProperties(c.baseData)){if(n)if(!c.baseData.properties)c.baseData.properties=n;else for(var l in n)c.baseData.properties[l]||(c.baseData.properties[l]=n[l]);t.addAzureFunctionsCorrelationProperties(c.baseData.properties),c.baseData.properties&&(c.baseData.properties=Gb.validateStringMap(c.baseData.properties))}var u=s&&s.instrumentationKey||"",d=new Zi.Envelope;return d.data=c,d.iKey=u,d.name="Microsoft.ApplicationInsights."+u.replace(/-/g,"")+"."+c.baseType.substr(0,c.baseType.length-4),d.tags=this.getTags(o,e.tagOverrides),d.time=new Date().toISOString(),d.ver=1,d.sampleRate=s?s.samplingPercentage:100,r===Zi.TelemetryType.Metric&&(d.sampleRate=100),d},t.addAzureFunctionsCorrelationProperties=function(e){var r=jSi.CorrelationContextManager.getCurrentContext();if(r&&r.customProperties&&r.customProperties.getProperty instanceof Function){e=e||{};var n=r.customProperties.getProperty("InvocationId");n&&(e.InvocationId=n),n=r.customProperties.getProperty("ProcessId"),n&&(e.ProcessId=n),n=r.customProperties.getProperty("LogLevel"),n&&(e.LogLevel=n),n=r.customProperties.getProperty("Category"),n&&(e.Category=n),n=r.customProperties.getProperty("HostInstanceId"),n&&(e.HostInstanceId=n),n=r.customProperties.getProperty("AzFuncLiveLogsSessionId"),n&&(e.AzFuncLiveLogsSessionId=n)}},t.truncateProperties=function(e){if(e.properties)try{for(var r={},n=Object.keys(e.properties),o=Object.values(e.properties),s=0;s0,o.exceptions.push(c);var l=new Zi.Data;return l.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.Exception),l.baseData=o,l},t.createRequestData=function(e){var r,n,o,s,c=new Zi.RequestData;e.id?c.id=e.id:c.id=Gb.w3cTraceId(),c.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),c.url=(n=e.url)===null||n===void 0?void 0:n.substring(0,2048),c.source=(o=e.source)===null||o===void 0?void 0:o.substring(0,1024),c.duration=Gb.msToTimeSpan(e.duration),c.responseCode=(s=e.resultCode?e.resultCode.toString():"0")===null||s===void 0?void 0:s.substring(0,1024),c.success=e.success,c.properties=this.truncateProperties(e),c.measurements=e.measurements;var l=new Zi.Data;return l.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.Request),l.baseData=c,l},t.createMetricData=function(e){var r,n=new Zi.MetricData;n.metrics=[];var o=new Zi.DataPoint;o.count=isNaN(e.count)?1:e.count,o.kind=Zi.DataPointType.Aggregation,o.max=isNaN(e.max)?e.value:e.max,o.min=isNaN(e.min)?e.value:e.min,o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.stdDev=isNaN(e.stdDev)?0:e.stdDev,o.value=e.value,o.ns=e.namespace,n.metrics.push(o),n.properties=this.truncateProperties(e);var s=new Zi.Data;return s.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.Metric),s.baseData=n,s},t.createAvailabilityData=function(e){var r,n,o=new Zi.AvailabilityData;e.id?o.id=e.id:o.id=Gb.w3cTraceId(),o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=Gb.msToTimeSpan(e.duration),o.success=e.success,o.runLocation=e.runLocation,o.message=(n=e.message)===null||n===void 0?void 0:n.substring(0,8192),o.measurements=e.measurements,o.properties=this.truncateProperties(e);var s=new Zi.Data;return s.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.Availability),s.baseData=o,s},t.createPageViewData=function(e){var r,n,o=new Zi.PageViewData;o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=Gb.msToTimeSpan(e.duration),o.url=(n=e.url)===null||n===void 0?void 0:n.substring(0,2048),o.measurements=e.measurements,o.properties=this.truncateProperties(e);var s=new Zi.Data;return s.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.PageView),s.baseData=o,s},t.getTags=function(e,r){var n=jSi.CorrelationContextManager.getCurrentContext(),o={};if(e&&e.tags)for(var s in e.tags)o[s]=e.tags[s];if(r)for(var s in r)o[s]=r[s];return n&&(o[e.keys.operationId]=o[e.keys.operationId]||n.operation.id,o[e.keys.operationName]=o[e.keys.operationName]||n.operation.name,o[e.keys.operationParentId]=o[e.keys.operationParentId]||n.operation.parentId),o},t.parseStack=function(e){var r=void 0;if(typeof e=="string"){var n=e.split(` -`);r=[];for(var o=0,s=0,c=0;c<=n.length;c++){var l=n[c];if(HSi.regex.test(l)){var u=new HSi(n[c],o++);s+=u.sizeInBytes,r.push(u)}}var d=32*1024;if(s>d)for(var f=0,h=r.length-1,m=0,g=f,A=h;fd){var _=A-g+1;r.splice(g,_);break}g=f,A=h,f++,h--}}return r},t})(),HSi=(function(){function t(e,r){this.sizeInBytes=0,this.level=r,this.method="",this.assembly=Gb.trim(e);var n=e.match(t.regex);n&&n.length>=5&&(this.method=Gb.trim(n[2])||this.method,this.fileName=Gb.trim(n[4])||"",this.line=parseInt(n[5])||0),this.sizeInBytes+=this.method.length,this.sizeInBytes+=this.fileName.length,this.sizeInBytes+=this.assembly.length,this.sizeInBytes+=t.baseSize,this.sizeInBytes+=this.level.toString().length,this.sizeInBytes+=this.line.toString().length}return a(t,"_StackFrame"),t.regex=/^(\s+at)?(.*?)(\@|\s\(|\s)([^\(\n]+):(\d+):(\d+)(\)?)$/,t.baseSize=58,t})();GSi.exports=xwa});var $Si=I(IG=>{"use strict";p();var wwa=IG&&IG.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},Rwa=IG&&IG.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var v0t=XOe&&XOe.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},C0t=XOe&&XOe.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]=0&&(this._resendInterval=Math.floor(r)),typeof n=="number"&&n>=0&&(this._maxBytesOnDisk=Math.floor(n)),e&&!ZOe.FileAccessControl.OS_PROVIDES_FILE_PROTECTION&&(this._enableDiskRetryMode=!1,this._logWarn("Ignoring request to enable disk retry mode. Sufficient file protection capabilities were not detected.")),this._enableDiskRetryMode?(this._statsbeat&&this._statsbeat.addFeature(xG.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer||(this._fileCleanupTimer=setTimeout(function(){o._fileCleanupTask()},t.CLEANUP_TIMEOUT),this._fileCleanupTimer.unref())):(this._statsbeat&&this._statsbeat.removeFeature(xG.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer&&clearTimeout(this._fileCleanupTimer))},t.prototype.send=function(e,r){return v0t(this,void 0,void 0,function(){var n,o,s,c,l,u,d,f,h=this;return C0t(this,function(m){switch(m.label){case 0:if(!(e&&e.length>0))return[3,5];if(n=this._redirectedHost||this._config.endpointUrl,o=new Bwa.URL(n).hostname,s={method:"POST",withCredentials:!1,headers:{"Content-Type":"application/x-json-stream"}},c=this._getAuthorizationHandler?this._getAuthorizationHandler(this._config):null,!c)return[3,4];this._statsbeat&&this._statsbeat.addFeature(xG.StatsbeatFeature.AAD_HANDLING),m.label=1;case 1:return m.trys.push([1,3,,4]),[4,c.addAuthorizationHeader(s)];case 2:return m.sent(),[3,4];case 3:return l=m.sent(),u="Failed to get AAD bearer token for the Application.",this._enableDiskRetryMode&&(u+="This batch of telemetry items will be retried. ",this._storeToDisk(e)),u+="Error:"+l.toString(),this._logWarn(u),typeof r=="function"&&r(u),[2];case 4:if(d="",e.forEach(function(g){var A=$b.stringify(g);typeof A=="string"&&(d+=A+` -`)}),d.length>0&&(d=d.substring(0,d.length-1)),d.length===0)return typeof r=="function"&&r("Empty batch of telemetry items. Nothing to send."),[2];f=Buffer.from?Buffer.from(d):new Buffer(d),Owa.gzip(f,function(g,A){var y=A;g?(h._logWarn($b.dumpObj(g)),y=f,s.headers["Content-Length"]=f.length.toString()):(s.headers["Content-Encoding"]="gzip",s.headers["Content-Length"]=A.length.toString()),h._logInfo($b.dumpObj(s)),s[Lwa.disableCollectionRequestOption]=!0;var E=+new Date,_=a(function(b){b.setEncoding("utf-8");var T="";b.on("data",function(w){T+=w}),b.on("end",function(){var w,R=+new Date,x=R-E;if(h._numConsecutiveFailures=0,T.includes(qwa)&&b.statusCode===400&&(pvr.warn("Instrumentation key was invalid, please check the iKey"),(w=h._shutdownStatsbeat)===null||w===void 0||w.call(h)),h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&(Qwa.includes(b.statusCode)?h._statsbeatHasReachedIngestionAtLeastOnce=!0:h._statsbeatFailedToIngest()),h._statsbeat&&(b.statusCode==Uwa||b.statusCode==Fwa?h._statsbeat.countThrottle(xG.StatsbeatNetworkCategory.Breeze,o,b.statusCode):h._statsbeat.countRequest(xG.StatsbeatNetworkCategory.Breeze,o,x,b.statusCode===200,b.statusCode)),h._enableDiskRetryMode){if(b.statusCode===200)h._resendTimer||(h._resendTimer=setTimeout(function(){h._resendTimer=null,h._sendFirstFileOnDisk()},h._resendInterval),h._resendTimer.unref());else if(h._isRetriable(b.statusCode))try{h._statsbeat&&h._statsbeat.countRetry(xG.StatsbeatNetworkCategory.Breeze,o,b.statusCode);var P=JSON.parse(T),D=[];P.errors&&(P.errors.forEach(function(B){(B.statusCode==429||B.statusCode==500||B.statusCode==503)&&D.push(e[B.index])}),D.length>0&&h._storeToDisk(D))}catch{h._storeToDisk(e)}}if(b.statusCode===307||b.statusCode===308)if(h._numConsecutiveRedirects++,h._numConsecutiveRedirects<10){var N=b.headers.location?b.headers.location.toString():null;N&&(h._redirectedHost=N,h.send(e,r))}else{var L={name:"Circular Redirect",message:"Error sending telemetry because of circular redirects."};h._statsbeat&&h._statsbeat.countException(xG.StatsbeatNetworkCategory.Breeze,o,L),typeof r=="function"&&r("Error sending telemetry because of circular redirects.")}else h._numConsecutiveRedirects=0,typeof r=="function"&&r(T),h._logInfo(T),typeof h._onSuccess=="function"&&h._onSuccess(T)})},"requestCallback"),v=$b.makeRequest(h._config,n,s,_);v.setTimeout(t.HTTP_TIMEOUT,function(){h._requestTimedOut=!0,v.abort()}),v.on("error",function(b){if(h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&h._statsbeatFailedToIngest(),h._numConsecutiveFailures++,h._statsbeat&&h._statsbeat.countException(xG.StatsbeatNetworkCategory.Breeze,o,b),!h._enableDiskRetryMode||h._numConsecutiveFailures>0&&h._numConsecutiveFailures%t.MAX_CONNECTION_FAILURES_BEFORE_WARN===0){var T="Ingestion endpoint could not be reached. This batch of telemetry items has been lost. Use Disk Retry Caching to enable resending of failed telemetry. Error:";h._enableDiskRetryMode&&(T="Ingestion endpoint could not be reached ".concat(h._numConsecutiveFailures," consecutive times. There may be resulting telemetry loss. Most recent error:")),h._logWarn(T,$b.dumpObj(b))}else{var T="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";h._logInfo(T,$b.dumpObj(b))}h._onErrorHelper(b),typeof r=="function"&&(b?(h._requestTimedOut&&(b.name="telemetry timeout",b.message="telemetry request timed out"),r($b.dumpObj(b))):r("Error sending telemetry")),h._enableDiskRetryMode&&h._storeToDisk(e)}),v.write(y),v.end()}),m.label=5;case 5:return[2]}})})},t.prototype.saveOnCrash=function(e){this._enableDiskRetryMode&&this._storeToDiskSync($b.stringify(e))},t.prototype._isRetriable=function(e){return e===206||e===401||e===403||e===408||e===429||e===500||e===502||e===503||e===504},t.prototype._logInfo=function(e){for(var r=[],n=1;n=3&&this._shutdownStatsbeat())},t.prototype._storeToDisk=function(e){return v0t(this,void 0,void 0,function(){var r,n,o,s,c,l,u;return C0t(this,function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),this._logInfo("Checking existence of data storage directory: "+this._tempDir),[4,J8.confirmDirExists(this._tempDir)];case 1:return d.sent(),[3,3];case 2:return r=d.sent(),this._logWarn("Failed to create folder to put telemetry: "+$b.dumpObj(r)),this._onErrorHelper(r),[2];case 3:return d.trys.push([3,5,,6]),[4,ZOe.FileAccessControl.applyACLRules(this._tempDir)];case 4:return d.sent(),[3,6];case 5:return n=d.sent(),this._logWarn("Failed to apply file access control to folder: "+$b.dumpObj(n)),this._onErrorHelper(n),[2];case 6:return d.trys.push([6,8,,9]),[4,J8.getShallowDirectorySize(this._tempDir)];case 7:return o=d.sent(),o>this._maxBytesOnDisk?(this._logWarn("Not saving data due to max size limit being met. Directory size in bytes is: "+o),[2]):[3,9];case 8:return s=d.sent(),this._logWarn("Failed to read directory for retriable telemetry: "+$b.dumpObj(s)),this._onErrorHelper(s),[2];case 9:return d.trys.push([9,11,,12]),c="".concat(new Date().getTime(),".ai.json"),l=pte.join(this._tempDir,c),this._logInfo("saving data to disk at: "+l),[4,J8.writeFileAsync(l,$b.stringify(e),{mode:384})];case 10:return d.sent(),[3,12];case 11:return u=d.sent(),this._logWarn("Failed to persist telemetry to disk: "+$b.dumpObj(u)),this._onErrorHelper(u),[2];case 12:return[2]}})})},t.prototype._storeToDiskSync=function(e){try{this._logInfo("Checking existence of data storage directory: "+this._tempDir),fvr.existsSync(this._tempDir)||fvr.mkdirSync(this._tempDir),ZOe.FileAccessControl.applyACLRulesSync(this._tempDir);var r=J8.getShallowDirectorySizeSync(this._tempDir);if(r>this._maxBytesOnDisk){this._logInfo("Not saving data due to max size limit being met. Directory size in bytes is: "+r);return}var n="".concat(new Date().getTime(),".ai.json"),o=pte.join(this._tempDir,n);this._logInfo("saving data before crash to disk at: "+o),fvr.writeFileSync(o,e,{mode:384})}catch(s){this._logWarn("Error while saving data to disk: "+$b.dumpObj(s)),this._onErrorHelper(s)}},t.prototype._sendFirstFileOnDisk=function(){return v0t(this,void 0,void 0,function(){var e,r,n,o,s,c;return C0t(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,J8.readdirAsync(this._tempDir)];case 1:return e=l.sent(),e=e.filter(function(u){return pte.basename(u).indexOf(".ai.json")>-1}),e.length>0?(r=e[0],n=pte.join(this._tempDir,r),[4,J8.readFileAsync(n)]):[3,5];case 2:return o=l.sent(),[4,J8.unlinkAsync(n)];case 3:return l.sent(),s=JSON.parse(o.toString()),[4,this.send(s)];case 4:l.sent(),l.label=5;case 5:return[3,7];case 6:return c=l.sent(),this._onErrorHelper(c),[3,7];case 7:return[2]}})})},t.prototype._onErrorHelper=function(e){typeof this._onError=="function"&&this._onError(e)},t.prototype._fileCleanupTask=function(){return v0t(this,void 0,void 0,function(){var e,r,n,o,s,c,l=this;return C0t(this,function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),[4,J8.readdirAsync(this._tempDir)];case 1:if(e=u.sent(),e=e.filter(function(d){return pte.basename(d).indexOf(".ai.json")>-1}),!(e.length>0))return[3,5];r=0,u.label=2;case 2:return rn,o?(s=pte.join(this._tempDir,e[r]),[4,J8.unlinkAsync(s).catch(function(d){l._onErrorHelper(d)})]):[3,4]):[3,5];case 3:u.sent(),u.label=4;case 4:return r++,[3,2];case 5:return[3,7];case 6:return c=u.sent(),c.code!="ENOENT"&&this._onErrorHelper(c),[3,7];case 7:return[2]}})})},t.TAG="Sender",t.WAIT_BETWEEN_RESEND=60*1e3,t.MAX_BYTES_ON_DISK=50*1024*1024,t.MAX_CONNECTION_FAILURES_BEFORE_WARN=5,t.CLEANUP_TIMEOUT=3600*1e3,t.FILE_RETEMPTION_PERIOD=10080*60*1e3,t.TEMPDIR_PREFIX="appInsights-node",t.HTTP_TIMEOUT=2e4,t})();VSi.exports=jwa});var zSi=I(b0t=>{"use strict";p();Object.defineProperty(b0t,"__esModule",{value:!0});b0t.AzureVirtualMachine=void 0;var WSi=Kl(),Hwa=ay(),Gwa=X0e(),$wa="http://169.254.169.254/metadata/instance/compute",Vwa="api-version=2017-12-01",Wwa="format=json",zwa="UNREACH",Ywa=(function(){function t(){}return a(t,"AzureVirtualMachine"),t.getAzureComputeMetadata=function(e,r){var n,o=this,s={},c="".concat($wa,"?").concat(Vwa,"&").concat(Wwa),l=(n={method:"GET"},n[Gwa.disableCollectionRequestOption]=!0,n.headers={Metadata:"True"},n),u=Hwa.makeRequest(e,c,l,function(d){if(d.statusCode===200){s.isVM=!0;var f="";d.on("data",function(h){f+=h}),d.on("end",function(){try{var h=JSON.parse(f);s.id=h.vmId||"",s.subscriptionId=h.subscriptionId||"",s.osType=h.osType||""}catch(m){WSi.info(t.TAG,m)}r(s)})}else r(s)},!1,!1);u&&(setTimeout(function(){o._requestTimedOut=!0,u.abort()},t.HTTP_TIMEOUT),u.on("error",function(d){o._requestTimedOut&&d&&(d.name="telemetry timeout",d.message="telemetry request timed out"),d&&d.message&&d.message.indexOf(zwa)>-1?s.isVM=!1:WSi.info(t.TAG,d),r(s)}),u.end())},t.HTTP_TIMEOUT=2500,t.TAG="AzureVirtualMachine",t})();b0t.AzureVirtualMachine=Ywa});var YSi=I(S0t=>{"use strict";p();Object.defineProperty(S0t,"__esModule",{value:!0});S0t.NetworkStatsbeat=void 0;var Kwa=(function(){function t(e,r){this.endpoint=e,this.host=r,this.totalRequestCount=0,this.totalSuccesfulRequestCount=0,this.totalFailedRequestCount=[],this.retryCount=[],this.exceptionCount=[],this.throttleCount=[],this.intervalRequestExecutionTime=0,this.lastIntervalRequestExecutionTime=0,this.lastTime=+new Date,this.lastRequestCount=0}return a(t,"NetworkStatsbeat"),t})();S0t.NetworkStatsbeat=Kwa});var eTi=I((hte,XSi)=>{"use strict";p();var F4=hte&&hte.__assign||function(){return F4=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0&&s/o||0;if(n.lastIntervalRequestExecutionTime=n.intervalRequestExecutionTime,o>0){var l=Object.assign({endpoint:this._networkStatsbeatCollection[r].endpoint,host:this._networkStatsbeatCollection[r].host},e);this._statbeatMetrics.push({name:Ad.StatsbeatCounter.REQUEST_DURATION,value:c,properties:l})}n.lastRequestCount=n.totalRequestCount,n.lastTime=n.time}},t.prototype._getShortHost=function(e){var r=e;try{var n=new RegExp(/^https?:\/\/(?:www\.)?([^\/.-]+)/),o=n.exec(e);o!=null&&o.length>1&&(r=o[1]),r=r.replace(".in.applicationinsights.azure.com","")}catch{}return r},t.prototype._trackRequestsCount=function(e){for(var r=this,n=a(function(l){s=o._networkStatsbeatCollection[l];var u=Object.assign({endpoint:s.endpoint,host:s.host},e);s.totalSuccesfulRequestCount>0&&(o._statbeatMetrics.push({name:Ad.StatsbeatCounter.REQUEST_SUCCESS,value:s.totalSuccesfulRequestCount,properties:u}),s.totalSuccesfulRequestCount=0),s.totalFailedRequestCount.length>0&&(s.totalFailedRequestCount.forEach(function(d){u=Object.assign(F4(F4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Ad.StatsbeatCounter.REQUEST_FAILURE,value:d.count,properties:u})}),s.totalFailedRequestCount=[]),s.retryCount.length>0&&(s.retryCount.forEach(function(d){u=Object.assign(F4(F4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Ad.StatsbeatCounter.RETRY_COUNT,value:d.count,properties:u})}),s.retryCount=[]),s.throttleCount.length>0&&(s.throttleCount.forEach(function(d){u=Object.assign(F4(F4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Ad.StatsbeatCounter.THROTTLE_COUNT,value:d.count,properties:u})}),s.throttleCount=[]),s.exceptionCount.length>0&&(s.exceptionCount.forEach(function(d){u=Object.assign(F4(F4({},u),{exceptionType:d.exceptionType})),r._statbeatMetrics.push({name:Ad.StatsbeatCounter.EXCEPTION_COUNT,value:d.count,properties:u})}),s.exceptionCount=[])},"_loop_1"),o=this,s,c=0;c0))return[3,2];for(e=[],r=0;r-1)return t.EU_CONNECTION_STRING;return t.NON_EU_CONNECTION_STRING},t.NON_EU_CONNECTION_STRING="InstrumentationKey=c4a29126-a7cb-47e5-b348-11414998b11e;IngestionEndpoint=https://westus-0.in.applicationinsights.azure.com",t.EU_CONNECTION_STRING="InstrumentationKey=7dc56bab-3c0c-4e9f-9ebb-d1acadee8d0f;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com",t.STATS_COLLECTION_SHORT_INTERVAL=9e5,t.STATS_COLLECTION_LONG_INTERVAL=864e5,t.STATS_COLLECTION_INITIAL_DELAY=15e3,t.TAG="Statsbeat",t})();XSi.exports=oRa});var nTi=I((yvp,rTi)=>{"use strict";p();var sRa=require("url"),aRa=t_r(),cRa=DSi(),lRa=V0e(),Z8=ME(),uRa=MSi(),Avr=qSi(),tTi=AG(),dRa=eTi(),fRa=hvr(),yvr=ay(),T0t=Kl(),pRa=dvr(),hRa=(function(){function t(e){this._telemetryProcessors=[];var r=new aRa(e);if(this.config=r,!this.config.instrumentationKey||this.config.instrumentationKey=="")throw new Error("Instrumentation key not found, please provide a connection string before starting Application Insights SDK.");this.context=new lRa,this.commonProperties={},this.authorizationHandler=null,this.config.disableStatsbeat||(this._statsbeat=new dRa(this.config,this.context),this._statsbeat.enable(!0));var n=new fRa(this.config,this.getAuthorizationHandler,null,null,this._statsbeat);this.channel=new uRa(function(){return r.disableAppInsights},function(){return r.maxBatchSize},function(){return r.maxBatchIntervalMs},n)}return a(t,"TelemetryClient"),t.prototype.trackAvailability=function(e){this.track(e,Z8.TelemetryType.Availability)},t.prototype.trackPageView=function(e){this.track(e,Z8.TelemetryType.PageView)},t.prototype.trackTrace=function(e){this.track(e,Z8.TelemetryType.Trace)},t.prototype.trackMetric=function(e){this.track(e,Z8.TelemetryType.Metric)},t.prototype.trackException=function(e){e&&e.exception&&!yvr.isError(e.exception)&&(e.exception=new Error(e.exception.toString())),this.track(e,Z8.TelemetryType.Exception)},t.prototype.trackEvent=function(e){this.track(e,Z8.TelemetryType.Event)},t.prototype.trackRequest=function(e){this.track(e,Z8.TelemetryType.Request)},t.prototype.trackDependency=function(e){if(e&&!e.target&&e.data)try{e.target=new sRa.URL(e.data).host}catch(r){e.target=null,T0t.warn(t.TAG,"The URL object is failed to create.",r)}this.track(e,Z8.TelemetryType.Dependency)},t.prototype.flush=function(e){this.channel.triggerSend(e?!!e.isAppCrashing:!1,e?e.callback:void 0)},t.prototype.track=function(e,r){if(e&&Z8.telemetryTypeToBaseType(r)){var n=pRa.createEnvelope(e,r,this.commonProperties,this.context,this.config);e.time&&(n.time=e.time.toISOString());var o=this.runTelemetryProcessors(n,e.contextObjects);o=o&&Avr.samplingTelemetryProcessor(n,{correlationContext:tTi.CorrelationContextManager.getCurrentContext()}),Avr.preAggregatedMetricsTelemetryProcessor(n,this.context),o&&(Avr.performanceMetricsTelemetryProcessor(n,this.quickPulseClient),this.channel.send(n))}else T0t.warn(t.TAG,"track() requires telemetry object and telemetryType to be specified.")},t.prototype.setAutoPopulateAzureProperties=function(e){},t.prototype.getAuthorizationHandler=function(e){return e&&e.aadTokenCredential?(this.authorizationHandler||(T0t.info(t.TAG,"Adding authorization handler"),this.authorizationHandler=new cRa(e.aadTokenCredential,e.aadAudience)),this.authorizationHandler):null},t.prototype.addTelemetryProcessor=function(e){this._telemetryProcessors.push(e)},t.prototype.clearTelemetryProcessors=function(){this._telemetryProcessors=[]},t.prototype.runTelemetryProcessors=function(e,r){var n=!0,o=this._telemetryProcessors.length;if(o===0)return n;r=r||{},r.correlationContext=tTi.CorrelationContextManager.getCurrentContext();for(var s=0;s{"use strict";p();var mRa=Evr&&Evr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),gRa=nTi(),iTi=zEr(),ARa=X0e(),I0t=Kl(),yRa=(function(t){mRa(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NodeClient"),e.prototype.trackNodeHttpRequestSync=function(r){r&&r.request&&r.response&&r.duration?iTi.trackRequestSync(this,r):I0t.warn("trackNodeHttpRequestSync requires NodeHttpRequestTelemetry object with request, response and duration specified.")},e.prototype.trackNodeHttpRequest=function(r){(r.duration||r.error)&&I0t.warn("trackNodeHttpRequest will ignore supplied duration and error parameters. These values are collected from the request and response objects."),r&&r.request&&r.response?iTi.trackRequest(this,r):I0t.warn("trackNodeHttpRequest requires NodeHttpRequestTelemetry object with request and response specified.")},e.prototype.trackNodeHttpDependency=function(r){r&&r.request?ARa.trackRequest(this,r):I0t.warn("trackNodeHttpDependency requires NodeHttpDependencyTelemetry object with request specified.")},e})(gRa);oTi.exports=yRa});var cTi=I(aTi=>{"use strict";p();Object.defineProperty(aTi,"__esModule",{value:!0})});var fTi=I(yt=>{"use strict";p();Object.defineProperty(yt,"__esModule",{value:!0});yt.Configuration=yt.liveMetricsClient=yt.defaultClient=yt.DistributedTracingModes=void 0;yt.setup=xRa;yt.start=dTi;yt.getCorrelationContext=RRa;yt.startOperation=kRa;yt.wrapWithCorrelationContext=PRa;yt.dispose=DRa;var vvr=AG(),ERa=GCi(),_Ra=VCi(),Cvr=kmt(),vRa=MEr(),CRa=rbi(),bRa=pbi(),SRa=X0e(),TRa=zEr(),lTi=Qee(),e5e=Kl(),uTi=Wbi(),bvr=Ybi(),IRa=Zbi();yt.TelemetryClient=sTi();yt.Contracts=ME();yt.azureFunctionsTypes=cTi();var _vr;(function(t){t[t.AI=0]="AI",t[t.AI_AND_W3C=1]="AI_AND_W3C"})(_vr||(yt.DistributedTracingModes=_vr={}));var t5e,r5e,n5e,i5e,o5e,bge,Sge,mte,s5e,a5e,YT=!1,x0t;function xRa(t){return yt.defaultClient?e5e.info("The default client is already setup"):(yt.defaultClient=new yt.TelemetryClient(t),t5e=new ERa(yt.defaultClient),r5e=new _Ra(yt.defaultClient),n5e=new Cvr(yt.defaultClient),i5e=new vRa(yt.defaultClient),o5e=new CRa(yt.defaultClient),bge=new bRa(yt.defaultClient),mte=new TRa(yt.defaultClient),s5e=new SRa(yt.defaultClient),Sge||(Sge=new bvr.AutoCollectNativePerformance(yt.defaultClient)),a5e=new IRa.AzureFunctionsHook(yt.defaultClient)),Svr}a(xRa,"setup");function wRa(){yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectExternalLoggers==null&&(yt.defaultClient.config.enableAutoCollectExternalLoggers=!0),yt.defaultClient.config.enableAutoCollectConsole==null&&(yt.defaultClient.config.enableAutoCollectConsole=!1),yt.defaultClient.config.enableAutoCollectExceptions==null&&(yt.defaultClient.config.enableAutoCollectExceptions=!0),yt.defaultClient.config.enableAutoCollectPerformance==null&&(yt.defaultClient.config.enableAutoCollectPerformance=!0),yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics==null&&(yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics=!0),yt.defaultClient.config.enableAutoCollectHeartbeat==null&&(yt.defaultClient.config.enableAutoCollectHeartbeat=!0),yt.defaultClient.config.enableAutoCollectRequests==null&&(yt.defaultClient.config.enableAutoCollectRequests=!0),yt.defaultClient.config.enableAutoCollectDependencies==null&&(yt.defaultClient.config.enableAutoCollectDependencies=!0),yt.defaultClient.config.enableUseDiskRetryCaching==null&&(yt.defaultClient.config.enableUseDiskRetryCaching=!0),yt.defaultClient.config.enableAutoDependencyCorrelation==null&&(yt.defaultClient.config.enableAutoDependencyCorrelation=!0),yt.defaultClient.config.enableSendLiveMetrics==null&&(yt.defaultClient.config.enableSendLiveMetrics=!1),yt.defaultClient.config.enableAutoCollectExtendedMetrics==null&&(yt.defaultClient.config.enableAutoCollectExtendedMetrics=!0),yt.defaultClient.config.enableWebInstrumentation==null&&(yt.defaultClient.config.enableWebInstrumentation=!1),yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions==null&&(yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=!1))}a(wRa,"_setDefaultConfig");function dTi(){if(yt.defaultClient){YT=!0,wRa(),t5e.enable(yt.defaultClient.config.enableAutoCollectExternalLoggers,yt.defaultClient.config.enableAutoCollectConsole),r5e.enable(yt.defaultClient.config.enableAutoCollectExceptions),n5e.enable(yt.defaultClient.config.enableAutoCollectPerformance),i5e.enable(yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics),o5e.enable(yt.defaultClient.config.enableAutoCollectHeartbeat),mte.useAutoCorrelation(yt.defaultClient.config.enableAutoDependencyCorrelation,yt.defaultClient.config.enableUseAsyncHooks),mte.enable(yt.defaultClient.config.enableAutoCollectRequests),s5e.enable(yt.defaultClient.config.enableAutoCollectDependencies),bge.enable(yt.defaultClient.config.enableWebInstrumentation,yt.defaultClient.config.webInstrumentationConnectionString),yt.defaultClient.config.enableSendLiveMetrics&&(yt.liveMetricsClient||(yt.liveMetricsClient=new uTi(yt.defaultClient.config,yt.defaultClient.context,yt.defaultClient.getAuthorizationHandler,yt.defaultClient),x0t=new Cvr(yt.liveMetricsClient,1e3,!0),yt.liveMetricsClient.addCollector(x0t),yt.defaultClient.quickPulseClient=yt.liveMetricsClient),yt.liveMetricsClient.enable(yt.defaultClient.config.enableSendLiveMetrics)),a5e.enable(yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions);var t=bvr.AutoCollectNativePerformance.parseEnabled(yt.defaultClient.config.enableAutoCollectExtendedMetrics,yt.defaultClient.config);Sge.enable(yt.defaultClient.config.enableAutoCollectExtendedMetrics,t.disabledMetrics),yt.defaultClient&&yt.defaultClient.channel&&yt.defaultClient.channel.setUseDiskRetryCaching(yt.defaultClient.config.enableUseDiskRetryCaching,yt.defaultClient.config.enableResendInterval,yt.defaultClient.config.enableMaxBytesOnDisk)}else e5e.warn("Start cannot be called before setup");return Svr}a(dTi,"start");function RRa(){return vvr.CorrelationContextManager.getCurrentContext()}a(RRa,"getCorrelationContext");function kRa(t,e){return vvr.CorrelationContextManager.startOperation(t,e)}a(kRa,"startOperation");function PRa(t,e){return vvr.CorrelationContextManager.wrapCallback(t,e)}a(PRa,"wrapWithCorrelationContext");var Svr=(function(){function t(){}return a(t,"Configuration"),t.setDistributedTracingMode=function(e){return lTi.w3cEnabled=e===_vr.AI_AND_W3C,t},t.setAutoCollectConsole=function(e,r){return r===void 0&&(r=!1),yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectExternalLoggers=e,yt.defaultClient.config.enableAutoCollectConsole=r,YT&&t5e.enable(e,r)),t},t.setAutoCollectExceptions=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectExceptions=e,YT&&r5e.enable(e)),t},t.setAutoCollectPerformance=function(e,r){if(r===void 0&&(r=!0),yt.defaultClient){yt.defaultClient.config.enableAutoCollectPerformance=e;var n=bvr.AutoCollectNativePerformance.parseEnabled(r,yt.defaultClient.config);yt.defaultClient.config.enableAutoCollectExtendedMetrics=n.isEnabled,YT&&(n5e.enable(e),Sge.enable(yt.defaultClient.config.enableAutoCollectExtendedMetrics,n.disabledMetrics))}return t},t.setAutoCollectPreAggregatedMetrics=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectPreAggregatedMetrics=e,YT&&i5e.enable(e)),t},t.setAutoCollectHeartbeat=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectHeartbeat=e,YT&&o5e.enable(e)),t},t.enableAutoWebSnippetInjection=function(e,r){return yt.defaultClient&&(yt.defaultClient.config.enableWebInstrumentation=e,yt.defaultClient.config.webInstrumentationConnectionString=r,YT&&bge.enable(yt.defaultClient.config.enableAutoWebSnippetInjection,yt.defaultClient.config.webSnippetConnectionString)),t},t.enableWebInstrumentation=function(e,r){return yt.defaultClient&&(yt.defaultClient.config.enableWebInstrumentation=e,yt.defaultClient.config.webInstrumentationConnectionString=r,YT&&bge.enable(yt.defaultClient.config.enableWebInstrumentation,yt.defaultClient.config.webInstrumentationConnectionString)),t},t.setAutoCollectRequests=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectRequests=e,YT&&mte.enable(e)),t},t.setAutoCollectDependencies=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectDependencies=e,YT&&s5e.enable(e)),t},t.setAutoDependencyCorrelation=function(e,r){return yt.defaultClient&&(yt.defaultClient.config.enableAutoDependencyCorrelation=e,yt.defaultClient.config.enableUseAsyncHooks=r,YT&&mte.useAutoCorrelation(e,r)),t},t.setUseDiskRetryCaching=function(e,r,n){return yt.defaultClient&&(yt.defaultClient.config.enableUseDiskRetryCaching=e,yt.defaultClient.config.enableResendInterval=r,yt.defaultClient.config.enableMaxBytesOnDisk=n,yt.defaultClient.channel&&yt.defaultClient.channel.setUseDiskRetryCaching(yt.defaultClient.config.enableUseDiskRetryCaching,yt.defaultClient.config.enableResendInterval,yt.defaultClient.config.enableMaxBytesOnDisk)),t},t.setInternalLogging=function(e,r){return e===void 0&&(e=!1),r===void 0&&(r=!0),e5e.enableDebug=e,e5e.disableWarnings=!r,t},t.setAutoCollectIncomingRequestAzureFunctions=function(e){return yt.defaultClient&&(yt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=e,YT&&a5e.enable(e)),t},t.setSendLiveMetrics=function(e){return e===void 0&&(e=!1),yt.defaultClient?(!yt.liveMetricsClient&&e?(yt.liveMetricsClient=new uTi(yt.defaultClient.config,yt.defaultClient.context,yt.defaultClient.getAuthorizationHandler,yt.defaultClient),x0t=new Cvr(yt.liveMetricsClient,1e3,!0),yt.liveMetricsClient.addCollector(x0t),yt.defaultClient.quickPulseClient=yt.liveMetricsClient):yt.liveMetricsClient&&yt.liveMetricsClient.enable(e),yt.defaultClient.config.enableSendLiveMetrics=e,t):(e5e.warn("Live metrics client cannot be setup without the default client"),t)},t.start=dTi,t})();yt.Configuration=Svr;function DRa(){lTi.w3cEnabled=!0,yt.defaultClient=null,YT=!1,t5e&&t5e.dispose(),r5e&&r5e.dispose(),n5e&&n5e.dispose(),i5e&&i5e.dispose(),o5e&&o5e.dispose(),bge&&bge.dispose(),Sge&&Sge.dispose(),mte&&mte.dispose(),s5e&&s5e.dispose(),yt.liveMetricsClient&&(yt.liveMetricsClient.enable(!1),yt.liveMetricsClient=void 0),a5e&&a5e.dispose()}a(DRa,"dispose")});var Ivr=I(TR=>{"use strict";p();var NRa=TR&&TR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),MRa=TR&&TR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pTi=TR&&TR.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{this.client.flush({callback:a(()=>{e(void 0)},"callback")})})}massageEventName(e){return FRa(e)?hTi(e):e.includes(this.namespace)?e:`${this.namespace}/${e}`}};TR.AzureInsightReporter=Tvr;function URa(t,e,r){let n=new ORa.TelemetryClient(r);return n.config.enableAutoCollectRequests=!1,n.config.enableAutoCollectPerformance=!1,n.config.enableAutoCollectExceptions=!1,n.config.enableAutoCollectConsole=!1,n.config.enableAutoCollectDependencies=!1,n.config.noDiagnosticChannel=!0,mTi(t,e,n),n}a(URa,"createAppInsightsClient");function mTi(t,e,r){r.commonProperties=QRa(r.commonProperties,e),r.context.tags[r.context.keys.cloudRoleInstance]="REDACTED",r.context.tags[r.context.keys.sessionId]=e.sessionId;let n=t.copilotTelemetryURL;n&&URL.canParse(n)&&(r.config.endpointUrl=n)}a(mTi,"configureReporter");function QRa(t,e){return t=t||{},t.common_os=w0t.platform(),t.common_platformversion=w0t.release(),t.common_arch=w0t.arch(),t.common_cpu=Array.from(new Set(w0t.cpus().map(r=>r.model))).join(),t.common_vscodemachineid=e.machineId,t.common_vscodesessionid=e.sessionId,t.client_deviceid=e.devDeviceId,t.common_uikind=e.uiKind,t.common_remotename=e.remoteName??"none",t.common_isnewappinstall="",t}a(QRa,"decorateWithCommonProperties")});var gTi=I((Pvp,qRa)=>{qRa.exports={name:"copilot-chat",displayName:"GitHub Copilot Chat",description:"AI chat features powered by Copilot",version:"0.54.0",build:"1",completionsCoreVersion:"1.378.1799",internalLargeStorageAriaKey:"ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917",ariaKey:"0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",buildType:"dev",publisher:"GitHub",homepage:"https://github.com/features/copilot?editor=vscode",license:"SEE LICENSE IN LICENSE.txt",repository:{type:"git",url:"https://github.com/microsoft/vscode-copilot-chat"},bugs:{url:"https://github.com/microsoft/vscode/issues"},qna:"https://github.com/github-community/community/discussions/categories/copilot",icon:"assets/copilot.png",pricing:"Trial",engines:{vscode:"^1.126.0",npm:">=9.0.0",node:">=22.14.0"},categories:["AI","Chat","Programming Languages","Machine Learning"],keywords:["ai","openai","codex","pilot","snippets","documentation","autocomplete","intellisense","refactor","javascript","python","typescript","php","go","golang","ruby","c++","c#","java","kotlin","co-pilot"],badges:[{url:"https://img.shields.io/badge/GitHub%20Copilot-Subscription%20Required-orange",href:"https://github.com/github-copilot/signup?editor=vscode",description:"%github.copilot.badge.signUp%"},{url:"https://img.shields.io/github/stars/github/copilot-docs?style=social",href:"https://github.com/github/copilot-docs",description:"%github.copilot.badge.star%"},{url:"https://img.shields.io/youtube/channel/views/UC7c3Kb6jYCRj4JOHHZTxKsQ?style=social",href:"https://www.youtube.com/@GitHub/search?query=copilot",description:"%github.copilot.badge.youtube%"},{url:"https://img.shields.io/twitter/follow/github?style=social",href:"https://twitter.com/github",description:"%github.copilot.badge.twitter%"}],activationEvents:["onStartupFinished","onLanguageModelChat:copilot","onUri","onFileSystem:ccreq","onFileSystem:ccsettings"],main:"./dist/extension",l10n:"./l10n",enabledApiProposals:["agentSessionsWorkspace","agentsWindowConfiguration","chatDebug","chatHooks","extensionsAny","newSymbolNamesProvider","interactive","codeActionAI","activeComment","commentReveal","contribCommentThreadAdditionalMenu","contribCommentsViewThreadMenus","contribChatEditorInlineGutterMenu","documentFiltersExclusive","embeddings","findTextInFiles","findTextInFiles2","languageModelToolSupportsModel","findFiles2","textSearchProvider","terminalDataWriteEvent","terminalExecuteCommandEvent","terminalSelection","terminalQuickFixProvider","mappedEditsProvider","aiRelatedInformation","aiSettingsSearch","chatParticipantAdditions","defaultChatParticipant","contribSourceControlInputBoxMenu","authLearnMore","testObserver","aiTextSearchProvider","chatParticipantPrivate","chatProvider","contribDebugCreateConfiguration","chatReferenceDiagnostic","textSearchProvider2","chatReferenceBinaryData","languageModelSystem","languageModelCapabilities","languageModelPricing","inlineCompletionsAdditions","chatStatusItem","chatInputNotification","taskProblemMatcherStatus","contribLanguageModelToolSets","textDocumentChangeReason","resolvers","taskExecutionTerminal","dataChannels","languageModelThinkingPart","chatSessionsProvider","devDeviceId","contribEditorContentMenu","chatPromptFiles","mcpServerDefinitions","tabInputMultiDiff","workspaceTrust","environmentPower","terminalTitle","toolInvocationApproveCombination","chatSessionCustomizationProvider"],contributes:{languageModelTools:[{name:"copilot_searchCodebase",toolReferenceName:"codebase",displayName:"%copilot.tools.searchCodebase.name%",icon:"$(folder)",userDescription:"%copilot.codebase.tool.description%",modelDescription:"Run a natural language search for relevant code or documentation comments from the user's current workspace. Returns relevant code snippets from the user's current workspace if it is large, or the full contents of the workspace if it is small.",tags:["codesearch","vscode_codesearch"],inputSchema:{type:"object",properties:{query:{type:"string",description:"The query to search the codebase for. Should contain all relevant context. Should ideally be text that might appear in the codebase, such as function names, variable names, or comments."}},required:["query"]}},{name:"execution_subagent",toolReferenceName:"executionSubagent",displayName:"%copilot.tools.executionSubagent.name%",icon:"$(play)",userDescription:"%copilot.tools.executionSubagent.description%",modelDescription:`Launch an iterative execution-focused subagent that performs an execution-based task. +`,"utf-8")],o=cwa(n);o&&t.headers.set("Content-Length",o),t.body=await(0,nwa.concat)(n)}a(lwa,"buildRequestBody");Cge.multipartPolicyName="multipartPolicy";var uwa=70,dwa=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function fwa(t){if(t.length>uwa)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!dwa.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(fwa,"assertValidBoundary");function pwa(){return{name:Cge.multipartPolicyName,async sendRequest(t,e){var r;if(!t.multipartBody)return e(t);if(t.body)throw new Error("multipartBody and regular body cannot be set at the same time");let n=t.multipartBody.boundary,o=(r=t.headers.get("Content-Type"))!==null&&r!==void 0?r:"multipart/mixed",s=o.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!s)throw new Error(`Got multipart request body, but content-type header was not multipart: ${o}`);let[,c,l]=s;if(l&&n&&l!==n)throw new Error(`Multipart boundary was specified as ${l} in the header, but got ${n} in the request body`);return n??(n=l),n?fwa(n):n=owa(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await lwa(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(pwa,"multipartPolicy")});var kvr=I(bge=>{"use strict";p();Object.defineProperty(bge,"__esModule",{value:!0});bge.decompressResponsePolicyName=void 0;bge.decompressResponsePolicy=hwa;bge.decompressResponsePolicyName="decompressResponsePolicy";function hwa(){return{name:bge.decompressResponsePolicyName,async sendRequest(t,e){return t.method!=="HEAD"&&t.headers.set("Accept-Encoding","gzip,deflate"),e(t)}}}a(hwa,"decompressResponsePolicy")});var k0t=I(R0t=>{"use strict";p();Object.defineProperty(R0t,"__esModule",{value:!0});R0t.delay=Awa;R0t.parseHeaderValueAsNumber=ywa;var mwa=a5e(),gwa="The operation was aborted.";function Awa(t,e,r){return new Promise((n,o)=>{let s,c,l=a(()=>o(new mwa.AbortError(r?.abortErrorMsg?r?.abortErrorMsg:gwa)),"rejectOnAbort"),u=a(()=>{r?.abortSignal&&c&&r.abortSignal.removeEventListener("abort",c)},"removeListeners");if(c=a(()=>(s&&clearTimeout(s),u(),l()),"onAborted"),r?.abortSignal&&r.abortSignal.aborted)return l();s=setTimeout(()=>{u(),n(e)},t),r?.abortSignal&&r.abortSignal.addEventListener("abort",c)})}a(Awa,"delay");function ywa(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(ywa,"parseHeaderValueAsNumber")});var D0t=I(P0t=>{"use strict";p();Object.defineProperty(P0t,"__esModule",{value:!0});P0t.isThrottlingRetryResponse=vwa;P0t.throttlingRetryStrategy=Cwa;var Ewa=k0t(),Pvr="Retry-After",_wa=["retry-after-ms","x-ms-retry-after-ms",Pvr];function STi(t){if(t&&[429,503].includes(t.status))try{for(let o of _wa){let s=(0,Ewa.parseHeaderValueAsNumber)(t,o);if(s===0||s)return s*(o===Pvr?1e3:1)}let e=t.headers.get(Pvr);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(STi,"getRetryAfterInMs");function vwa(t){return Number.isFinite(STi(t))}a(vwa,"isThrottlingRetryResponse");function Cwa(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=STi(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(Cwa,"throttlingRetryStrategy")});var N0t=I(u5e=>{"use strict";p();Object.defineProperty(u5e,"__esModule",{value:!0});u5e.exponentialRetryStrategy=xwa;u5e.isExponentialRetryResponse=TTi;u5e.isSystemError=ITi;var bwa=U4(),Swa=D0t(),Twa=1e3,Iwa=1e3*64;function xwa(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:Twa,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:Iwa,s=n;return{name:"exponentialRetryStrategy",retry({retryCount:c,response:l,responseError:u}){let d=ITi(u),f=d&&t.ignoreSystemErrors,h=TTi(l),m=h&&t.ignoreHttpStatusCodes;if(l&&((0,Swa.isThrottlingRetryResponse)(l)||!h)||m||f)return{skipStrategy:!0};if(u&&!d&&!h)return{errorToThrow:u};let A=s*Math.pow(2,c),y=Math.min(o,A);return s=y/2+(0,bwa.getRandomIntegerInclusive)(0,y/2),{retryAfterInMs:s}}}}a(xwa,"exponentialRetryStrategy");function TTi(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(TTi,"isExponentialRetryResponse");function ITi(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(ITi,"isSystemError")});var Sge=I(Dvr=>{"use strict";p();Object.defineProperty(Dvr,"__esModule",{value:!0});Dvr.retryPolicy=Dwa;var wwa=k0t(),Rwa=Dht(),kwa=a5e(),xTi=FG(),wTi=(0,Rwa.createClientLogger)("core-rest-pipeline retryPolicy"),Pwa="retryPolicy";function Dwa(t,e={maxRetries:xTi.DEFAULT_RETRY_POLICY_COUNT}){let r=e.logger||wTi;return{name:Pwa,async sendRequest(n,o){var s,c;let l,u,d=-1;e:for(;;){d+=1,l=void 0,u=void 0;try{r.info(`Retry ${d}: Attempting to send request`,n.requestId),l=await o(n),r.info(`Retry ${d}: Received a response from request`,n.requestId)}catch(f){if(r.error(`Retry ${d}: Received an error from request`,n.requestId),u=f,!f||u.name!=="RestError")throw f;l=u.response}if(!((s=n.abortSignal)===null||s===void 0)&&s.aborted)throw r.error(`Retry ${d}: Request aborted.`),new kwa.AbortError;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:xTi.DEFAULT_RETRY_POLICY_COUNT)){if(r.info(`Retry ${d}: Maximum retries reached. Returning the last received response, or throwing the last received error.`),u)throw u;if(l)return l;throw new Error("Maximum retries reached with no response or error to throw")}r.info(`Retry ${d}: Processing ${t.length} retry strategies.`);t:for(let f of t){let h=f.logger||wTi;h.info(`Retry ${d}: Processing retry strategy ${f.name}.`);let m=f.retry({retryCount:d,response:l,responseError:u});if(m.skipStrategy){h.info(`Retry ${d}: Skipped.`);continue t}let{errorToThrow:g,retryAfterInMs:A,redirectTo:y}=m;if(g)throw h.error(`Retry ${d}: Retry strategy ${f.name} throws error:`,g),g;if(A||A===0){h.info(`Retry ${d}: Retry strategy ${f.name} retries after ${A}`),await(0,wwa.delay)(A,void 0,{abortSignal:n.abortSignal});continue e}if(y){h.info(`Retry ${d}: Retry strategy ${f.name} redirects to ${y}`),n.url=y;continue e}}if(u)throw r.info("None of the retry strategies could work with the received error. Throwing it."),u;if(l)return r.info("None of the retry strategies could work with the received response. Returning it."),l}}}}a(Dwa,"retryPolicy")});var Nvr=I(Tge=>{"use strict";p();Object.defineProperty(Tge,"__esModule",{value:!0});Tge.defaultRetryPolicyName=void 0;Tge.defaultRetryPolicy=Bwa;var Nwa=N0t(),Mwa=D0t(),Owa=Sge(),Lwa=FG();Tge.defaultRetryPolicyName="defaultRetryPolicy";function Bwa(t={}){var e;return{name:Tge.defaultRetryPolicyName,sendRequest:(0,Owa.retryPolicy)([(0,Mwa.throttlingRetryStrategy)(),(0,Nwa.exponentialRetryStrategy)(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Lwa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(Bwa,"defaultRetryPolicy")});var d5e=I(Ovr=>{"use strict";p();Object.defineProperty(Ovr,"__esModule",{value:!0});Ovr.createHttpHeaders=Uwa;function M0t(t){return t.toLowerCase()}a(M0t,"normalizeName");function*Fwa(t){for(let e of t.values())yield[e.name,e.value]}a(Fwa,"headerIterator");var Mvr=class{static{a(this,"HttpHeadersImpl")}constructor(e){if(this._headersMap=new Map,e)for(let r of Object.keys(e))this.set(r,e[r])}set(e,r){this._headersMap.set(M0t(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(M0t(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(M0t(e))}delete(e){this._headersMap.delete(M0t(e))}toJSON(e={}){let r={};if(e.preserveCase)for(let n of this._headersMap.values())r[n.name]=n.value;else for(let[n,o]of this._headersMap)r[n]=o.value;return r}toString(){return JSON.stringify(this.toJSON({preserveCase:!0}))}[Symbol.iterator](){return Fwa(this._headersMap)}};function Uwa(t){return new Mvr(t)}a(Uwa,"createHttpHeaders")});var Lvr=I(Ige=>{"use strict";p();Object.defineProperty(Ige,"__esModule",{value:!0});Ige.formDataPolicyName=void 0;Ige.formDataPolicy=qwa;var kTi=U4(),RTi=d5e();Ige.formDataPolicyName="formDataPolicy";function Qwa(t){var e;let r={};for(let[n,o]of t.entries())(e=r[n])!==null&&e!==void 0||(r[n]=[]),r[n].push(o);return r}a(Qwa,"formDataToFormDataMap");function qwa(){return{name:Ige.formDataPolicyName,async sendRequest(t,e){if(kTi.isNodeLike&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=Qwa(t.body),t.body=void 0),t.formData){let r=t.headers.get("Content-Type");r&&r.indexOf("application/x-www-form-urlencoded")!==-1?t.body=jwa(t.formData):await Hwa(t.formData,t),t.formData=void 0}return e(t)}}}a(qwa,"formDataPolicy");function jwa(t){let e=new URLSearchParams;for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.append(r,o.toString());else e.append(r,n.toString());return e.toString()}a(jwa,"wwwFormUrlEncode");async function Hwa(t,e){let r=e.headers.get("Content-Type");if(r&&!r.startsWith("multipart/form-data"))return;e.headers.set("Content-Type",r??"multipart/form-data");let n=[];for(let[o,s]of Object.entries(t))for(let c of Array.isArray(s)?s:[s])if(typeof c=="string")n.push({headers:(0,RTi.createHttpHeaders)({"Content-Disposition":`form-data; name="${o}"`}),body:(0,kTi.stringToUint8Array)(c,"utf-8")});else{if(c==null||typeof c!="object")throw new Error(`Unexpected value for key ${o}: ${c}. Value should be serialized to string first.`);{let l=c.name||"blob",u=(0,RTi.createHttpHeaders)();u.set("Content-Disposition",`form-data; name="${o}"; filename="${l}"`),u.set("Content-Type",c.type||"application/octet-stream"),n.push({headers:u,body:c})}}e.multipartBody={parts:n}}a(Hwa,"prepareFormData")});var Bvr=I(NR=>{"use strict";p();Object.defineProperty(NR,"__esModule",{value:!0});NR.globalNoProxyList=NR.proxyPolicyName=void 0;NR.loadNoProxy=OTi;NR.getDefaultProxySettings=Xwa;NR.proxyPolicy=tRa;var Gwa=yFt(),$wa=EFt(),Vwa=yte(),Wwa="HTTPS_PROXY",zwa="HTTP_PROXY",Ywa="ALL_PROXY",Kwa="NO_PROXY";NR.proxyPolicyName="proxyPolicy";NR.globalNoProxyList=[];var NTi=!1,Jwa=new Map;function O0t(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(O0t,"getEnvironmentValue");function MTi(){if(!process)return;let t=O0t(Wwa),e=O0t(Ywa),r=O0t(zwa);return t||e||r}a(MTi,"loadEnvironmentProxyValue");function Zwa(t,e,r){if(e.length===0)return!1;let n=new URL(t).hostname;if(r?.has(n))return r.get(n);let o=!1;for(let s of e)s[0]==="."?(n.endsWith(s)||n.length===s.length-1&&n===s.slice(1))&&(o=!0):n===s&&(o=!0);return r?.set(n,o),o}a(Zwa,"isBypassed");function OTi(){let t=O0t(Kwa);return NTi=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(OTi,"loadNoProxy");function Xwa(t){if(!t&&(t=MTi(),!t))return;let e=new URL(t);return{host:(e.protocol?e.protocol+"//":"")+e.hostname,port:Number.parseInt(e.port||"80"),username:e.username,password:e.password}}a(Xwa,"getDefaultProxySettings");function eRa(){let t=MTi();return t?new URL(t):void 0}a(eRa,"getDefaultProxySettingsInternal");function PTi(t){let e;try{e=new URL(t.host)}catch{throw new Error(`Expecting a valid host string in proxy settings, but found "${t.host}".`)}return e.port=String(t.port),t.username&&(e.username=t.username),t.password&&(e.password=t.password),e}a(PTi,"getUrlFromProxySettings");function DTi(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&Vwa.logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");let s=t.headers.toJSON();o?(e.httpProxyAgent||(e.httpProxyAgent=new $wa.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new Gwa.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(DTi,"setProxyAgentOnRequest");function tRa(t,e){NTi||NR.globalNoProxyList.push(...OTi());let r=t?PTi(t):eRa(),n={};return{name:NR.proxyPolicyName,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!Zwa(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:NR.globalNoProxyList,e?.customNoProxyList?void 0:Jwa)?DTi(o,n,r):o.proxySettings&&DTi(o,n,PTi(o.proxySettings)),s(o)}}}a(tRa,"proxyPolicy")});var Fvr=I(xge=>{"use strict";p();Object.defineProperty(xge,"__esModule",{value:!0});xge.setClientRequestIdPolicyName=void 0;xge.setClientRequestIdPolicy=rRa;xge.setClientRequestIdPolicyName="setClientRequestIdPolicy";function rRa(t="x-ms-client-request-id"){return{name:xge.setClientRequestIdPolicyName,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(rRa,"setClientRequestIdPolicy")});var Uvr=I(wge=>{"use strict";p();Object.defineProperty(wge,"__esModule",{value:!0});wge.tlsPolicyName=void 0;wge.tlsPolicy=nRa;wge.tlsPolicyName="tlsPolicy";function nRa(t){return{name:wge.tlsPolicyName,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(nRa,"tlsPolicy")});var Qvr=I(a6=>{"use strict";p();Object.defineProperty(a6,"__esModule",{value:!0});a6.TracingContextImpl=a6.knownContextKeys=void 0;a6.createTracingContext=iRa;a6.knownContextKeys={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function iRa(t={}){let e=new L0t(t.parentContext);return t.span&&(e=e.setValue(a6.knownContextKeys.span,t.span)),t.namespace&&(e=e.setValue(a6.knownContextKeys.namespace,t.namespace)),e}a(iRa,"createTracingContext");var L0t=class t{static{a(this,"TracingContextImpl")}constructor(e){this._contextMap=e instanceof t?new Map(e._contextMap):new Map}setValue(e,r){let n=new t(this);return n._contextMap.set(e,r),n}getValue(e){return this._contextMap.get(e)}deleteValue(e){let r=new t(this);return r._contextMap.delete(e),r}};a6.TracingContextImpl=L0t});var qvr=I(Rge=>{"use strict";p();Object.defineProperty(Rge,"__esModule",{value:!0});Rge.createDefaultTracingSpan=LTi;Rge.createDefaultInstrumenter=BTi;Rge.useInstrumenter=sRa;Rge.getInstrumenter=aRa;var oRa=Qvr(),B0t=f4t();function LTi(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(LTi,"createDefaultTracingSpan");function BTi(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:LTi(),tracingContext:(0,oRa.createTracingContext)({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(BTi,"createDefaultInstrumenter");function sRa(t){B0t.state.instrumenterImplementation=t}a(sRa,"useInstrumenter");function aRa(){return B0t.state.instrumenterImplementation||(B0t.state.instrumenterImplementation=BTi()),B0t.state.instrumenterImplementation}a(aRa,"getInstrumenter")});var FTi=I(Hvr=>{"use strict";p();Object.defineProperty(Hvr,"__esModule",{value:!0});Hvr.createTracingClient=cRa;var F0t=qvr(),jvr=Qvr();function cRa(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=(0,F0t.getInstrumenter)().startSpan(d,Object.assign(Object.assign({},h),{packageName:r,packageVersion:n,tracingContext:(m=f?.tracingOptions)===null||m===void 0?void 0:m.tracingContext})),A=g.tracingContext,y=g.span;A.getValue(jvr.knownContextKeys.namespace)||(A=A.setValue(jvr.knownContextKeys.namespace,e)),y.setAttribute("az.namespace",A.getValue(jvr.knownContextKeys.namespace));let E=Object.assign({},f,{tracingOptions:Object.assign(Object.assign({},f?.tracingOptions),{tracingContext:A})});return{span:y,updatedOptions:E}}a(o,"startSpan");async function s(d,f,h,m){let{span:g,updatedOptions:A}=o(d,f,m);try{let y=await c(A.tracingOptions.tracingContext,()=>Promise.resolve(h(A,g)));return g.setStatus({status:"success"}),y}catch(y){throw g.setStatus({status:"error",error:y}),y}finally{g.end()}}a(s,"withSpan");function c(d,f,...h){return(0,F0t.getInstrumenter)().withContext(d,f,...h)}a(c,"withContext");function l(d){return(0,F0t.getInstrumenter)().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return(0,F0t.getInstrumenter)().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(cRa,"createTracingClient")});var UTi=I(kge=>{"use strict";p();Object.defineProperty(kge,"__esModule",{value:!0});kge.createTracingClient=kge.useInstrumenter=void 0;var lRa=qvr();Object.defineProperty(kge,"useInstrumenter",{enumerable:!0,get:a(function(){return lRa.useInstrumenter},"get")});var uRa=FTi();Object.defineProperty(kge,"createTracingClient",{enumerable:!0,get:a(function(){return uRa.createTracingClient},"get")})});var QTi=I(U0t=>{"use strict";p();Object.defineProperty(U0t,"__esModule",{value:!0});U0t.custom=void 0;var dRa=require("node:util");U0t.custom=dRa.inspect.custom});var Q0t=I(f5e=>{"use strict";p();Object.defineProperty(f5e,"__esModule",{value:!0});f5e.RestError=void 0;f5e.isRestError=gRa;var fRa=U4(),pRa=QTi(),hRa=S0t(),mRa=new hRa.Sanitizer,Pge=class t extends Error{static{a(this,"RestError")}constructor(e,r={}){super(e),this.name="RestError",this.code=r.code,this.statusCode=r.statusCode,Object.defineProperty(this,"request",{value:r.request,enumerable:!1}),Object.defineProperty(this,"response",{value:r.response,enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}[pRa.custom](){return`RestError: ${this.message} + ${mRa.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`}};f5e.RestError=Pge;Pge.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";Pge.PARSE_ERROR="PARSE_ERROR";function gRa(t){return t instanceof Pge?!0:(0,fRa.isError)(t)&&t.name==="RestError"}a(gRa,"isRestError")});var Gvr=I(Dge=>{"use strict";p();Object.defineProperty(Dge,"__esModule",{value:!0});Dge.tracingPolicyName=void 0;Dge.tracingPolicy=CRa;var ARa=UTi(),yRa=FG(),ERa=Svr(),q0t=yte(),p5e=U4(),_Ra=Q0t(),vRa=S0t();Dge.tracingPolicyName="tracingPolicy";function CRa(t={}){let e=(0,ERa.getUserAgentValue)(t.userAgentPrefix),r=new vRa.Sanitizer({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=bRa();return{name:Dge.tracingPolicyName,async sendRequest(o,s){var c,l;if(!n||!(!((c=o.tracingOptions)===null||c===void 0)&&c.tracingContext))return s(o);let u=await e,d={"http.url":r.sanitizeUrl(o.url),"http.method":o.method,"http.user_agent":u,requestId:o.requestId};u&&(d["http.user_agent"]=u);let{span:f,tracingContext:h}=(l=SRa(n,o,d))!==null&&l!==void 0?l:{};if(!f||!h)return s(o);try{let m=await n.withContext(h,s,o);return IRa(f,m),m}catch(m){throw TRa(f,m),m}}}}a(CRa,"tracingPolicy");function bRa(){try{return(0,ARa.createTracingClient)({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:yRa.SDK_VERSION})}catch(t){q0t.logger.warning(`Error when creating the TracingClient: ${(0,p5e.getErrorMessage)(t)}`);return}}a(bRa,"tryCreateTracingClient");function SRa(t,e,r){try{let{span:n,updatedOptions:o}=t.startSpan(`HTTP ${e.method}`,{tracingOptions:e.tracingOptions},{spanKind:"client",spanAttributes:r});if(!n.isRecording()){n.end();return}let s=t.createRequestHeaders(o.tracingOptions.tracingContext);for(let[c,l]of Object.entries(s))e.headers.set(c,l);return{span:n,tracingContext:o.tracingOptions.tracingContext}}catch(n){q0t.logger.warning(`Skipping creating a tracing span due to an error: ${(0,p5e.getErrorMessage)(n)}`);return}}a(SRa,"tryCreateSpan");function TRa(t,e){try{t.setStatus({status:"error",error:(0,p5e.isError)(e)?e:void 0}),(0,_Ra.isRestError)(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){q0t.logger.warning(`Skipping tracing span processing due to an error: ${(0,p5e.getErrorMessage)(r)}`)}}a(TRa,"tryProcessError");function IRa(t,e){try{t.setAttribute("http.status_code",e.status);let r=e.headers.get("x-ms-request-id");r&&t.setAttribute("serviceRequestId",r),t.setStatus({status:"success"}),t.end()}catch(r){q0t.logger.warning(`Skipping tracing span processing due to an error: ${(0,p5e.getErrorMessage)(r)}`)}}a(IRa,"tryProcessResponse")});var HTi=I($vr=>{"use strict";p();Object.defineProperty($vr,"__esModule",{value:!0});$vr.createPipelineFromOptions=FRa;var xRa=_vr(),wRa=J_r(),RRa=vvr(),kRa=Tvr(),qTi=Rvr(),PRa=kvr(),DRa=Nvr(),NRa=Lvr(),jTi=U4(),MRa=Bvr(),ORa=Fvr(),LRa=Uvr(),BRa=Gvr();function FRa(t){var e;let r=(0,wRa.createEmptyPipeline)();return jTi.isNodeLike&&(t.tlsOptions&&r.addPolicy((0,LRa.tlsPolicy)(t.tlsOptions)),r.addPolicy((0,MRa.proxyPolicy)(t.proxyOptions)),r.addPolicy((0,PRa.decompressResponsePolicy)())),r.addPolicy((0,NRa.formDataPolicy)(),{beforePolicies:[qTi.multipartPolicyName]}),r.addPolicy((0,kRa.userAgentPolicy)(t.userAgentOptions)),r.addPolicy((0,ORa.setClientRequestIdPolicy)((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy((0,qTi.multipartPolicy)(),{afterPhase:"Deserialize"}),r.addPolicy((0,DRa.defaultRetryPolicy)(t.retryOptions),{phase:"Retry"}),r.addPolicy((0,BRa.tracingPolicy)(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),jTi.isNodeLike&&r.addPolicy((0,RRa.redirectPolicy)(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy((0,xRa.logPolicy)(t.loggingOptions),{afterPhase:"Sign"}),r}a(FRa,"createPipelineFromOptions")});var YTi=I(H0t=>{"use strict";p();Object.defineProperty(H0t,"__esModule",{value:!0});H0t.getBodyLength=zTi;H0t.createNodeHttpClient=$Ra;var Yvr=(v3(),Qa(hQ)),Vvr=Yvr.__importStar(require("node:http")),Wvr=Yvr.__importStar(require("node:https")),GTi=Yvr.__importStar(require("node:zlib")),URa=require("node:stream"),$Ti=a5e(),QRa=d5e(),g5e=Q0t(),h5e=yte(),qRa={};function m5e(t){return t&&typeof t.pipe=="function"}a(m5e,"isReadableStream");function VTi(t){return new Promise(e=>{t.on("close",e),t.on("end",e),t.on("error",e)})}a(VTi,"isStreamComplete");function WTi(t){return t&&typeof t.byteLength=="number"}a(WTi,"isArrayBuffer");var j0t=class extends URa.Transform{static{a(this,"ReportTransform")}_transform(e,r,n){this.push(e),this.loadedBytes+=e.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),n()}catch(o){n(o)}}constructor(e){super(),this.loadedBytes=0,this.progressCallback=e}},zvr=class{static{a(this,"NodeHttpClient")}constructor(){this.cachedHttpsAgents=new WeakMap}async sendRequest(e){var r,n,o;let s=new AbortController,c;if(e.abortSignal){if(e.abortSignal.aborted)throw new $Ti.AbortError("The operation was aborted.");c=a(h=>{h.type==="abort"&&s.abort()},"abortListener"),e.abortSignal.addEventListener("abort",c)}e.timeout>0&&setTimeout(()=>{s.abort()},e.timeout);let l=e.headers.get("Accept-Encoding"),u=l?.includes("gzip")||l?.includes("deflate"),d=typeof e.body=="function"?e.body():e.body;if(d&&!e.headers.has("Content-Length")){let h=zTi(d);h!==null&&e.headers.set("Content-Length",h)}let f;try{if(d&&e.onUploadProgress){let E=e.onUploadProgress,_=new j0t(E);_.on("error",v=>{h5e.logger.error("Error in upload progress",v)}),m5e(d)?d.pipe(_):_.end(d),d=_}let h=await this.makeRequest(e,s,d),m=jRa(h),A={status:(r=h.statusCode)!==null&&r!==void 0?r:0,headers:m,request:e};if(e.method==="HEAD")return h.resume(),A;f=u?HRa(h,m):h;let y=e.onDownloadProgress;if(y){let E=new j0t(y);E.on("error",_=>{h5e.logger.error("Error in download progress",_)}),f.pipe(E),f=E}return!((n=e.streamResponseStatusCodes)===null||n===void 0)&&n.has(Number.POSITIVE_INFINITY)||!((o=e.streamResponseStatusCodes)===null||o===void 0)&&o.has(A.status)?A.readableStreamBody=f:A.bodyAsText=await GRa(f),A}finally{if(e.abortSignal&&c){let h=Promise.resolve();m5e(d)&&(h=VTi(d));let m=Promise.resolve();m5e(f)&&(m=VTi(f)),Promise.all([h,m]).then(()=>{var g;c&&((g=e.abortSignal)===null||g===void 0||g.removeEventListener("abort",c))}).catch(g=>{h5e.logger.warning("Error when cleaning up abortListener on httpRequest",g)})}}}makeRequest(e,r,n){var o;let s=new URL(e.url),c=s.protocol!=="https:";if(c&&!e.allowInsecureConnection)throw new Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);let u={agent:(o=e.agent)!==null&&o!==void 0?o:this.getOrCreateAgent(e,c),hostname:s.hostname,path:`${s.pathname}${s.search}`,port:s.port,method:e.method,headers:e.headers.toJSON({preserveCase:!0})};return new Promise((d,f)=>{let h=c?Vvr.request(u,d):Wvr.request(u,d);h.once("error",m=>{var g;f(new g5e.RestError(m.message,{code:(g=m.code)!==null&&g!==void 0?g:g5e.RestError.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new $Ti.AbortError("The operation was aborted.");h.destroy(m),f(m)}),n&&m5e(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):WTi(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(h5e.logger.error("Unrecognized body type",n),f(new g5e.RestError("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?Vvr.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new Vvr.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return Wvr.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:qRa,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(h5e.logger.info("No cached TLS Agent exist, creating a new Agent"),c=new Wvr.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function jRa(t){let e=(0,QRa.createHttpHeaders)();for(let r of Object.keys(t.headers)){let n=t.headers[r];Array.isArray(n)?n.length>0&&e.set(r,n[0]):n&&e.set(r,n)}return e}a(jRa,"getResponseHeaders");function HRa(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=GTi.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=GTi.createInflate();return t.pipe(n),n}return t}a(HRa,"getDecodedResponseStream");function GRa(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{Buffer.isBuffer(o)?n.push(o):n.push(Buffer.from(o))}),t.on("end",()=>{e(Buffer.concat(n).toString("utf8"))}),t.on("error",o=>{o&&o?.name==="AbortError"?r(o):r(new g5e.RestError(`Error reading response as text: ${o.message}`,{code:g5e.RestError.PARSE_ERROR}))})})}a(GRa,"streamToText");function zTi(t){return t?Buffer.isBuffer(t)?t.length:m5e(t)?null:WTi(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(zTi,"getBodyLength");function $Ra(){return new zvr}a($Ra,"createNodeHttpClient")});var KTi=I(Kvr=>{"use strict";p();Object.defineProperty(Kvr,"__esModule",{value:!0});Kvr.createDefaultHttpClient=WRa;var VRa=YTi();function WRa(){return(0,VRa.createNodeHttpClient)()}a(WRa,"createDefaultHttpClient")});var JTi=I(Zvr=>{"use strict";p();Object.defineProperty(Zvr,"__esModule",{value:!0});Zvr.createPipelineRequest=KRa;var zRa=d5e(),YRa=U4(),Jvr=class{static{a(this,"PipelineRequestImpl")}constructor(e){var r,n,o,s,c,l,u;this.url=e.url,this.body=e.body,this.headers=(r=e.headers)!==null&&r!==void 0?r:(0,zRa.createHttpHeaders)(),this.method=(n=e.method)!==null&&n!==void 0?n:"GET",this.timeout=(o=e.timeout)!==null&&o!==void 0?o:0,this.multipartBody=e.multipartBody,this.formData=e.formData,this.disableKeepAlive=(s=e.disableKeepAlive)!==null&&s!==void 0?s:!1,this.proxySettings=e.proxySettings,this.streamResponseStatusCodes=e.streamResponseStatusCodes,this.withCredentials=(c=e.withCredentials)!==null&&c!==void 0?c:!1,this.abortSignal=e.abortSignal,this.tracingOptions=e.tracingOptions,this.onUploadProgress=e.onUploadProgress,this.onDownloadProgress=e.onDownloadProgress,this.requestId=e.requestId||(0,YRa.randomUUID)(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1}};function KRa(t){return new Jvr(t)}a(KRa,"createPipelineRequest")});var ZTi=I(A5e=>{"use strict";p();Object.defineProperty(A5e,"__esModule",{value:!0});A5e.exponentialRetryPolicyName=void 0;A5e.exponentialRetryPolicy=eka;var JRa=N0t(),ZRa=Sge(),XRa=FG();A5e.exponentialRetryPolicyName="exponentialRetryPolicy";function eka(t={}){var e;return(0,ZRa.retryPolicy)([(0,JRa.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreSystemErrors:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:XRa.DEFAULT_RETRY_POLICY_COUNT})}a(eka,"exponentialRetryPolicy")});var XTi=I(Nge=>{"use strict";p();Object.defineProperty(Nge,"__esModule",{value:!0});Nge.systemErrorRetryPolicyName=void 0;Nge.systemErrorRetryPolicy=ika;var tka=N0t(),rka=Sge(),nka=FG();Nge.systemErrorRetryPolicyName="systemErrorRetryPolicy";function ika(t={}){var e;return{name:Nge.systemErrorRetryPolicyName,sendRequest:(0,rka.retryPolicy)([(0,tka.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreHttpStatusCodes:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:nka.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(ika,"systemErrorRetryPolicy")});var eIi=I(Mge=>{"use strict";p();Object.defineProperty(Mge,"__esModule",{value:!0});Mge.throttlingRetryPolicyName=void 0;Mge.throttlingRetryPolicy=cka;var oka=D0t(),ska=Sge(),aka=FG();Mge.throttlingRetryPolicyName="throttlingRetryPolicy";function cka(t={}){var e;return{name:Mge.throttlingRetryPolicyName,sendRequest:(0,ska.retryPolicy)([(0,oka.throttlingRetryStrategy)()],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:aka.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(cka,"throttlingRetryPolicy")});var Xvr=I(Oge=>{"use strict";p();Object.defineProperty(Oge,"__esModule",{value:!0});Oge.DEFAULT_CYCLER_OPTIONS=void 0;Oge.createTokenCycler=dka;var lka=k0t();Oge.DEFAULT_CYCLER_OPTIONS={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function uka(t,e,r){async function n(){if(Date.now()t.getToken(u,d),"tryGetAccessToken"),s.retryIntervalInMs,(f=n?.expiresOnTimestamp)!==null&&f!==void 0?f:Date.now()).then(m=>(r=null,n=m,o=d.tenantId,n)).catch(m=>{throw r=null,n=null,o=void 0,m})),r}return a(l,"refresh"),async(u,d)=>{let f=!!d.claims,h=o!==d.tenantId;return f&&(n=null),h||f||c.mustRefresh?l(u,d):(c.shouldRefresh&&l(u,d),n)}}a(dka,"createTokenCycler")});var tIi=I(Lge=>{"use strict";p();Object.defineProperty(Lge,"__esModule",{value:!0});Lge.bearerTokenAuthenticationPolicyName=void 0;Lge.bearerTokenAuthenticationPolicy=gka;var fka=Xvr(),pka=yte();Lge.bearerTokenAuthenticationPolicyName="bearerTokenAuthenticationPolicy";async function hka(t){let{scopes:e,getAccessToken:r,request:n}=t,o={abortSignal:n.abortSignal,tracingOptions:n.tracingOptions},s=await r(e,o);s&&t.request.headers.set("Authorization",`Bearer ${s.token}`)}a(hka,"defaultAuthorizeRequest");function mka(t){let e=t.headers.get("WWW-Authenticate");if(t.status===401&&e)return e}a(mka,"getChallenge");function gka(t){var e;let{credential:r,scopes:n,challengeCallbacks:o}=t,s=t.logger||pka.logger,c=Object.assign({authorizeRequest:(e=o?.authorizeRequest)!==null&&e!==void 0?e:hka,authorizeRequestOnChallenge:o?.authorizeRequestOnChallenge},o),l=r?(0,fka.createTokenCycler)(r):()=>Promise.resolve(null);return{name:Lge.bearerTokenAuthenticationPolicyName,async sendRequest(u,d){if(!u.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");await c.authorizeRequest({scopes:Array.isArray(n)?n:[n],request:u,getAccessToken:l,logger:s});let f,h;try{f=await d(u)}catch(m){h=m,f=m.response}if(c.authorizeRequestOnChallenge&&f?.status===401&&mka(f)&&await c.authorizeRequestOnChallenge({scopes:Array.isArray(n)?n:[n],request:u,response:f,getAccessToken:l,logger:s}))return d(u);if(h)throw h;return f}}}a(gka,"bearerTokenAuthenticationPolicy")});var rIi=I(Bge=>{"use strict";p();Object.defineProperty(Bge,"__esModule",{value:!0});Bge.ndJsonPolicyName=void 0;Bge.ndJsonPolicy=Aka;Bge.ndJsonPolicyName="ndJsonPolicy";function Aka(){return{name:Bge.ndJsonPolicyName,async sendRequest(t,e){if(typeof t.body=="string"&&t.body.startsWith("[")){let r=JSON.parse(t.body);Array.isArray(r)&&(t.body=r.map(n=>JSON.stringify(n)+` +`).join(""))}return e(t)}}}a(Aka,"ndJsonPolicy")});var iIi=I(vte=>{"use strict";p();Object.defineProperty(vte,"__esModule",{value:!0});vte.auxiliaryAuthenticationHeaderPolicyName=void 0;vte.auxiliaryAuthenticationHeaderPolicy=vka;var yka=Xvr(),Eka=yte();vte.auxiliaryAuthenticationHeaderPolicyName="auxiliaryAuthenticationHeaderPolicy";var nIi="x-ms-authorization-auxiliary";async function _ka(t){var e,r;let{scopes:n,getAccessToken:o,request:s}=t,c={abortSignal:s.abortSignal,tracingOptions:s.tracingOptions};return(r=(e=await o(n,c))===null||e===void 0?void 0:e.token)!==null&&r!==void 0?r:""}a(_ka,"sendAuthorizeRequest");function vka(t){let{credentials:e,scopes:r}=t,n=t.logger||Eka.logger,o=new WeakMap;return{name:vte.auxiliaryAuthenticationHeaderPolicyName,async sendRequest(s,c){if(!s.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication for auxiliary header is not permitted for non-TLS protected (non-https) URLs.");if(!e||e.length===0)return n.info(`${vte.auxiliaryAuthenticationHeaderPolicyName} header will not be set due to empty credentials.`),c(s);let l=[];for(let d of e){let f=o.get(d);f||(f=(0,yka.createTokenCycler)(d),o.set(d,f)),l.push(_ka({scopes:Array.isArray(r)?r:[r],request:s,getAccessToken:f,logger:n}))}let u=(await Promise.all(l)).filter(d=>!!d);return u.length===0?(n.warning(`None of the auxiliary tokens are valid. ${nIi} header will not be set.`),c(s)):(s.headers.set(nIi,u.map(d=>`Bearer ${d}`).join(", ")),c(s))}}}a(vka,"auxiliaryAuthenticationHeaderPolicy")});var CIi=I(vr=>{"use strict";p();Object.defineProperty(vr,"__esModule",{value:!0});vr.createFileFromStream=vr.createFile=vr.auxiliaryAuthenticationHeaderPolicyName=vr.auxiliaryAuthenticationHeaderPolicy=vr.ndJsonPolicyName=vr.ndJsonPolicy=vr.bearerTokenAuthenticationPolicyName=vr.bearerTokenAuthenticationPolicy=vr.formDataPolicyName=vr.formDataPolicy=vr.tlsPolicyName=vr.tlsPolicy=vr.userAgentPolicyName=vr.userAgentPolicy=vr.defaultRetryPolicy=vr.tracingPolicyName=vr.tracingPolicy=vr.retryPolicy=vr.throttlingRetryPolicyName=vr.throttlingRetryPolicy=vr.systemErrorRetryPolicyName=vr.systemErrorRetryPolicy=vr.redirectPolicyName=vr.redirectPolicy=vr.getDefaultProxySettings=vr.proxyPolicyName=vr.proxyPolicy=vr.multipartPolicyName=vr.multipartPolicy=vr.logPolicyName=vr.logPolicy=vr.setClientRequestIdPolicyName=vr.setClientRequestIdPolicy=vr.exponentialRetryPolicyName=vr.exponentialRetryPolicy=vr.decompressResponsePolicyName=vr.decompressResponsePolicy=vr.isRestError=vr.RestError=vr.createPipelineRequest=vr.createHttpHeaders=vr.createDefaultHttpClient=vr.createPipelineFromOptions=vr.createEmptyPipeline=void 0;var Cka=J_r();Object.defineProperty(vr,"createEmptyPipeline",{enumerable:!0,get:a(function(){return Cka.createEmptyPipeline},"get")});var bka=HTi();Object.defineProperty(vr,"createPipelineFromOptions",{enumerable:!0,get:a(function(){return bka.createPipelineFromOptions},"get")});var Ska=KTi();Object.defineProperty(vr,"createDefaultHttpClient",{enumerable:!0,get:a(function(){return Ska.createDefaultHttpClient},"get")});var Tka=d5e();Object.defineProperty(vr,"createHttpHeaders",{enumerable:!0,get:a(function(){return Tka.createHttpHeaders},"get")});var Ika=JTi();Object.defineProperty(vr,"createPipelineRequest",{enumerable:!0,get:a(function(){return Ika.createPipelineRequest},"get")});var oIi=Q0t();Object.defineProperty(vr,"RestError",{enumerable:!0,get:a(function(){return oIi.RestError},"get")});Object.defineProperty(vr,"isRestError",{enumerable:!0,get:a(function(){return oIi.isRestError},"get")});var sIi=kvr();Object.defineProperty(vr,"decompressResponsePolicy",{enumerable:!0,get:a(function(){return sIi.decompressResponsePolicy},"get")});Object.defineProperty(vr,"decompressResponsePolicyName",{enumerable:!0,get:a(function(){return sIi.decompressResponsePolicyName},"get")});var aIi=ZTi();Object.defineProperty(vr,"exponentialRetryPolicy",{enumerable:!0,get:a(function(){return aIi.exponentialRetryPolicy},"get")});Object.defineProperty(vr,"exponentialRetryPolicyName",{enumerable:!0,get:a(function(){return aIi.exponentialRetryPolicyName},"get")});var cIi=Fvr();Object.defineProperty(vr,"setClientRequestIdPolicy",{enumerable:!0,get:a(function(){return cIi.setClientRequestIdPolicy},"get")});Object.defineProperty(vr,"setClientRequestIdPolicyName",{enumerable:!0,get:a(function(){return cIi.setClientRequestIdPolicyName},"get")});var lIi=_vr();Object.defineProperty(vr,"logPolicy",{enumerable:!0,get:a(function(){return lIi.logPolicy},"get")});Object.defineProperty(vr,"logPolicyName",{enumerable:!0,get:a(function(){return lIi.logPolicyName},"get")});var uIi=Rvr();Object.defineProperty(vr,"multipartPolicy",{enumerable:!0,get:a(function(){return uIi.multipartPolicy},"get")});Object.defineProperty(vr,"multipartPolicyName",{enumerable:!0,get:a(function(){return uIi.multipartPolicyName},"get")});var eCr=Bvr();Object.defineProperty(vr,"proxyPolicy",{enumerable:!0,get:a(function(){return eCr.proxyPolicy},"get")});Object.defineProperty(vr,"proxyPolicyName",{enumerable:!0,get:a(function(){return eCr.proxyPolicyName},"get")});Object.defineProperty(vr,"getDefaultProxySettings",{enumerable:!0,get:a(function(){return eCr.getDefaultProxySettings},"get")});var dIi=vvr();Object.defineProperty(vr,"redirectPolicy",{enumerable:!0,get:a(function(){return dIi.redirectPolicy},"get")});Object.defineProperty(vr,"redirectPolicyName",{enumerable:!0,get:a(function(){return dIi.redirectPolicyName},"get")});var fIi=XTi();Object.defineProperty(vr,"systemErrorRetryPolicy",{enumerable:!0,get:a(function(){return fIi.systemErrorRetryPolicy},"get")});Object.defineProperty(vr,"systemErrorRetryPolicyName",{enumerable:!0,get:a(function(){return fIi.systemErrorRetryPolicyName},"get")});var pIi=eIi();Object.defineProperty(vr,"throttlingRetryPolicy",{enumerable:!0,get:a(function(){return pIi.throttlingRetryPolicy},"get")});Object.defineProperty(vr,"throttlingRetryPolicyName",{enumerable:!0,get:a(function(){return pIi.throttlingRetryPolicyName},"get")});var xka=Sge();Object.defineProperty(vr,"retryPolicy",{enumerable:!0,get:a(function(){return xka.retryPolicy},"get")});var hIi=Gvr();Object.defineProperty(vr,"tracingPolicy",{enumerable:!0,get:a(function(){return hIi.tracingPolicy},"get")});Object.defineProperty(vr,"tracingPolicyName",{enumerable:!0,get:a(function(){return hIi.tracingPolicyName},"get")});var wka=Nvr();Object.defineProperty(vr,"defaultRetryPolicy",{enumerable:!0,get:a(function(){return wka.defaultRetryPolicy},"get")});var mIi=Tvr();Object.defineProperty(vr,"userAgentPolicy",{enumerable:!0,get:a(function(){return mIi.userAgentPolicy},"get")});Object.defineProperty(vr,"userAgentPolicyName",{enumerable:!0,get:a(function(){return mIi.userAgentPolicyName},"get")});var gIi=Uvr();Object.defineProperty(vr,"tlsPolicy",{enumerable:!0,get:a(function(){return gIi.tlsPolicy},"get")});Object.defineProperty(vr,"tlsPolicyName",{enumerable:!0,get:a(function(){return gIi.tlsPolicyName},"get")});var AIi=Lvr();Object.defineProperty(vr,"formDataPolicy",{enumerable:!0,get:a(function(){return AIi.formDataPolicy},"get")});Object.defineProperty(vr,"formDataPolicyName",{enumerable:!0,get:a(function(){return AIi.formDataPolicyName},"get")});var yIi=tIi();Object.defineProperty(vr,"bearerTokenAuthenticationPolicy",{enumerable:!0,get:a(function(){return yIi.bearerTokenAuthenticationPolicy},"get")});Object.defineProperty(vr,"bearerTokenAuthenticationPolicyName",{enumerable:!0,get:a(function(){return yIi.bearerTokenAuthenticationPolicyName},"get")});var EIi=rIi();Object.defineProperty(vr,"ndJsonPolicy",{enumerable:!0,get:a(function(){return EIi.ndJsonPolicy},"get")});Object.defineProperty(vr,"ndJsonPolicyName",{enumerable:!0,get:a(function(){return EIi.ndJsonPolicyName},"get")});var _Ii=iIi();Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicy",{enumerable:!0,get:a(function(){return _Ii.auxiliaryAuthenticationHeaderPolicy},"get")});Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicyName",{enumerable:!0,get:a(function(){return _Ii.auxiliaryAuthenticationHeaderPolicyName},"get")});var vIi=Ivr();Object.defineProperty(vr,"createFile",{enumerable:!0,get:a(function(){return vIi.createFile},"get")});Object.defineProperty(vr,"createFileFromStream",{enumerable:!0,get:a(function(){return vIi.createFileFromStream},"get")})});var SIi=I((E5e,bIi)=>{"use strict";p();var Rka=E5e&&E5e.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},kka=E5e&&E5e.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var Oka=Jl(),Lka=dy(),Bka=(function(){function t(e,r,n,o){this._buffer=[],this._lastSend=0,this._isDisabled=e,this._getBatchSize=r,this._getBatchIntervalMs=n,this._sender=o}return a(t,"Channel"),t.prototype.setUseDiskRetryCaching=function(e,r,n){this._sender.setDiskRetryMode(e,r,n)},t.prototype.send=function(e){var r=this;if(!this._isDisabled()){if(!e){Oka.warn("Cannot send null/undefined telemetry");return}if(this._buffer.push(e),this._buffer.length>=this._getBatchSize()){this.triggerSend(!1);return}!this._timeoutHandle&&this._buffer.length>0&&(this._timeoutHandle=setTimeout(function(){r._timeoutHandle=null,r.triggerSend(!1)},this._getBatchIntervalMs()))}},t.prototype.triggerSend=function(e,r){var n=this._buffer.length<1;n||(e||Lka.isNodeExit?(this._sender.saveOnCrash(this._buffer),typeof r=="function"&&r("data saved on crash")):this._sender.send(this._buffer,r)),this._lastSend=+new Date,this._buffer=[],clearTimeout(this._timeoutHandle),this._timeoutHandle=null,n&&typeof r=="function"&&r("no data to send")},t})();TIi.exports=Bka});var xIi=I(tCr=>{"use strict";p();Object.defineProperty(tCr,"__esModule",{value:!0});tCr.azureRoleEnvironmentTelemetryProcessor=Fka;function Fka(t,e){}a(Fka,"azureRoleEnvironmentTelemetryProcessor")});var kIi=I(G0t=>{"use strict";p();Object.defineProperty(G0t,"__esModule",{value:!0});G0t.samplingTelemetryProcessor=Uka;G0t.getSamplingHashCode=RIi;var wIi=UE();function Uka(t,e){var r=t.sampleRate,n=!1;return r==null||r>=100||t.data&&wIi.TelemetryType.Metric===wIi.baseTypeToTelemetryType(t.data.baseType)?!0:(e.correlationContext&&e.correlationContext.operation?n=RIi(e.correlationContext.operation.id){"use strict";p();var Qka=c6&&c6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qka=c6&&c6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jka=c6&&c6.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Qka(e,t,r);return qka(e,t),e};Object.defineProperty(c6,"__esModule",{value:!0});c6.performanceMetricsTelemetryProcessor=Hka;var rCr=r0t(),nCr=jka(UE());function Hka(t,e){switch(e&&e.addDocument(t),t.data.baseType){case nCr.TelemetryTypeString.Exception:rCr.countException();break;case nCr.TelemetryTypeString.Request:var r=t.data.baseData;rCr.countRequest(r.duration,r.success);break;case nCr.TelemetryTypeString.Dependency:var n=t.data.baseData;rCr.countDependency(n.duration,n.success);break}return!0}a(Hka,"performanceMetricsTelemetryProcessor")});var DIi=I(mD=>{"use strict";p();var Q4=mD&&mD.__assign||function(){return Q4=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var Yka=q4&&q4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),V0t=q4&&q4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Yka(e,t,r)};Object.defineProperty(q4,"__esModule",{value:!0});V0t(xIi(),q4);V0t(kIi(),q4);V0t(PIi(),q4);V0t(DIi(),q4)});var iCr=I((F1p,LIi)=>{"use strict";p();var Ji=UE(),Wb=dy(),MIi=kG(),Kka=Jl(),Jka=(function(){function t(){}return a(t,"EnvelopeFactory"),t.createEnvelope=function(e,r,n,o,s){var c=null;switch(r){case Ji.TelemetryType.Trace:c=t.createTraceData(e);break;case Ji.TelemetryType.Dependency:c=t.createDependencyData(e);break;case Ji.TelemetryType.Event:c=t.createEventData(e);break;case Ji.TelemetryType.Exception:c=t.createExceptionData(e);break;case Ji.TelemetryType.Request:c=t.createRequestData(e);break;case Ji.TelemetryType.Metric:c=t.createMetricData(e);break;case Ji.TelemetryType.Availability:c=t.createAvailabilityData(e);break;case Ji.TelemetryType.PageView:c=t.createPageViewData(e);break}if(c&&c.baseData&&Ji.domainSupportsProperties(c.baseData)){if(n)if(!c.baseData.properties)c.baseData.properties=n;else for(var l in n)c.baseData.properties[l]||(c.baseData.properties[l]=n[l]);t.addAzureFunctionsCorrelationProperties(c.baseData.properties),c.baseData.properties&&(c.baseData.properties=Wb.validateStringMap(c.baseData.properties))}var u=s&&s.instrumentationKey||"",d=new Ji.Envelope;return d.data=c,d.iKey=u,d.name="Microsoft.ApplicationInsights."+u.replace(/-/g,"")+"."+c.baseType.substr(0,c.baseType.length-4),d.tags=this.getTags(o,e.tagOverrides),d.time=new Date().toISOString(),d.ver=1,d.sampleRate=s?s.samplingPercentage:100,r===Ji.TelemetryType.Metric&&(d.sampleRate=100),d},t.addAzureFunctionsCorrelationProperties=function(e){var r=MIi.CorrelationContextManager.getCurrentContext();if(r&&r.customProperties&&r.customProperties.getProperty instanceof Function){e=e||{};var n=r.customProperties.getProperty("InvocationId");n&&(e.InvocationId=n),n=r.customProperties.getProperty("ProcessId"),n&&(e.ProcessId=n),n=r.customProperties.getProperty("LogLevel"),n&&(e.LogLevel=n),n=r.customProperties.getProperty("Category"),n&&(e.Category=n),n=r.customProperties.getProperty("HostInstanceId"),n&&(e.HostInstanceId=n),n=r.customProperties.getProperty("AzFuncLiveLogsSessionId"),n&&(e.AzFuncLiveLogsSessionId=n)}},t.truncateProperties=function(e){if(e.properties)try{for(var r={},n=Object.keys(e.properties),o=Object.values(e.properties),s=0;s0,o.exceptions.push(c);var l=new Ji.Data;return l.baseType=Ji.telemetryTypeToBaseType(Ji.TelemetryType.Exception),l.baseData=o,l},t.createRequestData=function(e){var r,n,o,s,c=new Ji.RequestData;e.id?c.id=e.id:c.id=Wb.w3cTraceId(),c.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),c.url=(n=e.url)===null||n===void 0?void 0:n.substring(0,2048),c.source=(o=e.source)===null||o===void 0?void 0:o.substring(0,1024),c.duration=Wb.msToTimeSpan(e.duration),c.responseCode=(s=e.resultCode?e.resultCode.toString():"0")===null||s===void 0?void 0:s.substring(0,1024),c.success=e.success,c.properties=this.truncateProperties(e),c.measurements=e.measurements;var l=new Ji.Data;return l.baseType=Ji.telemetryTypeToBaseType(Ji.TelemetryType.Request),l.baseData=c,l},t.createMetricData=function(e){var r,n=new Ji.MetricData;n.metrics=[];var o=new Ji.DataPoint;o.count=isNaN(e.count)?1:e.count,o.kind=Ji.DataPointType.Aggregation,o.max=isNaN(e.max)?e.value:e.max,o.min=isNaN(e.min)?e.value:e.min,o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.stdDev=isNaN(e.stdDev)?0:e.stdDev,o.value=e.value,o.ns=e.namespace,n.metrics.push(o),n.properties=this.truncateProperties(e);var s=new Ji.Data;return s.baseType=Ji.telemetryTypeToBaseType(Ji.TelemetryType.Metric),s.baseData=n,s},t.createAvailabilityData=function(e){var r,n,o=new Ji.AvailabilityData;e.id?o.id=e.id:o.id=Wb.w3cTraceId(),o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=Wb.msToTimeSpan(e.duration),o.success=e.success,o.runLocation=e.runLocation,o.message=(n=e.message)===null||n===void 0?void 0:n.substring(0,8192),o.measurements=e.measurements,o.properties=this.truncateProperties(e);var s=new Ji.Data;return s.baseType=Ji.telemetryTypeToBaseType(Ji.TelemetryType.Availability),s.baseData=o,s},t.createPageViewData=function(e){var r,n,o=new Ji.PageViewData;o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=Wb.msToTimeSpan(e.duration),o.url=(n=e.url)===null||n===void 0?void 0:n.substring(0,2048),o.measurements=e.measurements,o.properties=this.truncateProperties(e);var s=new Ji.Data;return s.baseType=Ji.telemetryTypeToBaseType(Ji.TelemetryType.PageView),s.baseData=o,s},t.getTags=function(e,r){var n=MIi.CorrelationContextManager.getCurrentContext(),o={};if(e&&e.tags)for(var s in e.tags)o[s]=e.tags[s];if(r)for(var s in r)o[s]=r[s];return n&&(o[e.keys.operationId]=o[e.keys.operationId]||n.operation.id,o[e.keys.operationName]=o[e.keys.operationName]||n.operation.name,o[e.keys.operationParentId]=o[e.keys.operationParentId]||n.operation.parentId),o},t.parseStack=function(e){var r=void 0;if(typeof e=="string"){var n=e.split(` +`);r=[];for(var o=0,s=0,c=0;c<=n.length;c++){var l=n[c];if(OIi.regex.test(l)){var u=new OIi(n[c],o++);s+=u.sizeInBytes,r.push(u)}}var d=32*1024;if(s>d)for(var f=0,h=r.length-1,m=0,g=f,A=h;fd){var _=A-g+1;r.splice(g,_);break}g=f,A=h,f++,h--}}return r},t})(),OIi=(function(){function t(e,r){this.sizeInBytes=0,this.level=r,this.method="",this.assembly=Wb.trim(e);var n=e.match(t.regex);n&&n.length>=5&&(this.method=Wb.trim(n[2])||this.method,this.fileName=Wb.trim(n[4])||"",this.line=parseInt(n[5])||0),this.sizeInBytes+=this.method.length,this.sizeInBytes+=this.fileName.length,this.sizeInBytes+=this.assembly.length,this.sizeInBytes+=t.baseSize,this.sizeInBytes+=this.level.toString().length,this.sizeInBytes+=this.line.toString().length}return a(t,"_StackFrame"),t.regex=/^(\s+at)?(.*?)(\@|\s\(|\s)([^\(\n]+):(\d+):(\d+)(\)?)$/,t.baseSize=58,t})();LIi.exports=Jka});var BIi=I(UG=>{"use strict";p();var Zka=UG&&UG.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},Xka=UG&&UG.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var W0t=C5e&&C5e.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},z0t=C5e&&C5e.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]=0&&(this._resendInterval=Math.floor(r)),typeof n=="number"&&n>=0&&(this._maxBytesOnDisk=Math.floor(n)),e&&!v5e.FileAccessControl.OS_PROVIDES_FILE_PROTECTION&&(this._enableDiskRetryMode=!1,this._logWarn("Ignoring request to enable disk retry mode. Sufficient file protection capabilities were not detected.")),this._enableDiskRetryMode?(this._statsbeat&&this._statsbeat.addFeature(QG.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer||(this._fileCleanupTimer=setTimeout(function(){o._fileCleanupTask()},t.CLEANUP_TIMEOUT),this._fileCleanupTimer.unref())):(this._statsbeat&&this._statsbeat.removeFeature(QG.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer&&clearTimeout(this._fileCleanupTimer))},t.prototype.send=function(e,r){return W0t(this,void 0,void 0,function(){var n,o,s,c,l,u,d,f,h=this;return z0t(this,function(m){switch(m.label){case 0:if(!(e&&e.length>0))return[3,5];if(n=this._redirectedHost||this._config.endpointUrl,o=new aPa.URL(n).hostname,s={method:"POST",withCredentials:!1,headers:{"Content-Type":"application/x-json-stream"}},c=this._getAuthorizationHandler?this._getAuthorizationHandler(this._config):null,!c)return[3,4];this._statsbeat&&this._statsbeat.addFeature(QG.StatsbeatFeature.AAD_HANDLING),m.label=1;case 1:return m.trys.push([1,3,,4]),[4,c.addAuthorizationHeader(s)];case 2:return m.sent(),[3,4];case 3:return l=m.sent(),u="Failed to get AAD bearer token for the Application.",this._enableDiskRetryMode&&(u+="This batch of telemetry items will be retried. ",this._storeToDisk(e)),u+="Error:"+l.toString(),this._logWarn(u),typeof r=="function"&&r(u),[2];case 4:if(d="",e.forEach(function(g){var A=zb.stringify(g);typeof A=="string"&&(d+=A+` +`)}),d.length>0&&(d=d.substring(0,d.length-1)),d.length===0)return typeof r=="function"&&r("Empty batch of telemetry items. Nothing to send."),[2];f=Buffer.from?Buffer.from(d):new Buffer(d),oPa.gzip(f,function(g,A){var y=A;g?(h._logWarn(zb.dumpObj(g)),y=f,s.headers["Content-Length"]=f.length.toString()):(s.headers["Content-Encoding"]="gzip",s.headers["Content-Length"]=A.length.toString()),h._logInfo(zb.dumpObj(s)),s[sPa.disableCollectionRequestOption]=!0;var E=+new Date,_=a(function(b){b.setEncoding("utf-8");var T="";b.on("data",function(w){T+=w}),b.on("end",function(){var w,R=+new Date,x=R-E;if(h._numConsecutiveFailures=0,T.includes(dPa)&&b.statusCode===400&&(sCr.warn("Instrumentation key was invalid, please check the iKey"),(w=h._shutdownStatsbeat)===null||w===void 0||w.call(h)),h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&(uPa.includes(b.statusCode)?h._statsbeatHasReachedIngestionAtLeastOnce=!0:h._statsbeatFailedToIngest()),h._statsbeat&&(b.statusCode==lPa||b.statusCode==cPa?h._statsbeat.countThrottle(QG.StatsbeatNetworkCategory.Breeze,o,b.statusCode):h._statsbeat.countRequest(QG.StatsbeatNetworkCategory.Breeze,o,x,b.statusCode===200,b.statusCode)),h._enableDiskRetryMode){if(b.statusCode===200)h._resendTimer||(h._resendTimer=setTimeout(function(){h._resendTimer=null,h._sendFirstFileOnDisk()},h._resendInterval),h._resendTimer.unref());else if(h._isRetriable(b.statusCode))try{h._statsbeat&&h._statsbeat.countRetry(QG.StatsbeatNetworkCategory.Breeze,o,b.statusCode);var P=JSON.parse(T),D=[];P.errors&&(P.errors.forEach(function(B){(B.statusCode==429||B.statusCode==500||B.statusCode==503)&&D.push(e[B.index])}),D.length>0&&h._storeToDisk(D))}catch{h._storeToDisk(e)}}if(b.statusCode===307||b.statusCode===308)if(h._numConsecutiveRedirects++,h._numConsecutiveRedirects<10){var N=b.headers.location?b.headers.location.toString():null;N&&(h._redirectedHost=N,h.send(e,r))}else{var L={name:"Circular Redirect",message:"Error sending telemetry because of circular redirects."};h._statsbeat&&h._statsbeat.countException(QG.StatsbeatNetworkCategory.Breeze,o,L),typeof r=="function"&&r("Error sending telemetry because of circular redirects.")}else h._numConsecutiveRedirects=0,typeof r=="function"&&r(T),h._logInfo(T),typeof h._onSuccess=="function"&&h._onSuccess(T)})},"requestCallback"),v=zb.makeRequest(h._config,n,s,_);v.setTimeout(t.HTTP_TIMEOUT,function(){h._requestTimedOut=!0,v.abort()}),v.on("error",function(b){if(h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&h._statsbeatFailedToIngest(),h._numConsecutiveFailures++,h._statsbeat&&h._statsbeat.countException(QG.StatsbeatNetworkCategory.Breeze,o,b),!h._enableDiskRetryMode||h._numConsecutiveFailures>0&&h._numConsecutiveFailures%t.MAX_CONNECTION_FAILURES_BEFORE_WARN===0){var T="Ingestion endpoint could not be reached. This batch of telemetry items has been lost. Use Disk Retry Caching to enable resending of failed telemetry. Error:";h._enableDiskRetryMode&&(T="Ingestion endpoint could not be reached ".concat(h._numConsecutiveFailures," consecutive times. There may be resulting telemetry loss. Most recent error:")),h._logWarn(T,zb.dumpObj(b))}else{var T="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";h._logInfo(T,zb.dumpObj(b))}h._onErrorHelper(b),typeof r=="function"&&(b?(h._requestTimedOut&&(b.name="telemetry timeout",b.message="telemetry request timed out"),r(zb.dumpObj(b))):r("Error sending telemetry")),h._enableDiskRetryMode&&h._storeToDisk(e)}),v.write(y),v.end()}),m.label=5;case 5:return[2]}})})},t.prototype.saveOnCrash=function(e){this._enableDiskRetryMode&&this._storeToDiskSync(zb.stringify(e))},t.prototype._isRetriable=function(e){return e===206||e===401||e===403||e===408||e===429||e===500||e===502||e===503||e===504},t.prototype._logInfo=function(e){for(var r=[],n=1;n=3&&this._shutdownStatsbeat())},t.prototype._storeToDisk=function(e){return W0t(this,void 0,void 0,function(){var r,n,o,s,c,l,u;return z0t(this,function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),this._logInfo("Checking existence of data storage directory: "+this._tempDir),[4,l6.confirmDirExists(this._tempDir)];case 1:return d.sent(),[3,3];case 2:return r=d.sent(),this._logWarn("Failed to create folder to put telemetry: "+zb.dumpObj(r)),this._onErrorHelper(r),[2];case 3:return d.trys.push([3,5,,6]),[4,v5e.FileAccessControl.applyACLRules(this._tempDir)];case 4:return d.sent(),[3,6];case 5:return n=d.sent(),this._logWarn("Failed to apply file access control to folder: "+zb.dumpObj(n)),this._onErrorHelper(n),[2];case 6:return d.trys.push([6,8,,9]),[4,l6.getShallowDirectorySize(this._tempDir)];case 7:return o=d.sent(),o>this._maxBytesOnDisk?(this._logWarn("Not saving data due to max size limit being met. Directory size in bytes is: "+o),[2]):[3,9];case 8:return s=d.sent(),this._logWarn("Failed to read directory for retriable telemetry: "+zb.dumpObj(s)),this._onErrorHelper(s),[2];case 9:return d.trys.push([9,11,,12]),c="".concat(new Date().getTime(),".ai.json"),l=Cte.join(this._tempDir,c),this._logInfo("saving data to disk at: "+l),[4,l6.writeFileAsync(l,zb.stringify(e),{mode:384})];case 10:return d.sent(),[3,12];case 11:return u=d.sent(),this._logWarn("Failed to persist telemetry to disk: "+zb.dumpObj(u)),this._onErrorHelper(u),[2];case 12:return[2]}})})},t.prototype._storeToDiskSync=function(e){try{this._logInfo("Checking existence of data storage directory: "+this._tempDir),oCr.existsSync(this._tempDir)||oCr.mkdirSync(this._tempDir),v5e.FileAccessControl.applyACLRulesSync(this._tempDir);var r=l6.getShallowDirectorySizeSync(this._tempDir);if(r>this._maxBytesOnDisk){this._logInfo("Not saving data due to max size limit being met. Directory size in bytes is: "+r);return}var n="".concat(new Date().getTime(),".ai.json"),o=Cte.join(this._tempDir,n);this._logInfo("saving data before crash to disk at: "+o),oCr.writeFileSync(o,e,{mode:384})}catch(s){this._logWarn("Error while saving data to disk: "+zb.dumpObj(s)),this._onErrorHelper(s)}},t.prototype._sendFirstFileOnDisk=function(){return W0t(this,void 0,void 0,function(){var e,r,n,o,s,c;return z0t(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,l6.readdirAsync(this._tempDir)];case 1:return e=l.sent(),e=e.filter(function(u){return Cte.basename(u).indexOf(".ai.json")>-1}),e.length>0?(r=e[0],n=Cte.join(this._tempDir,r),[4,l6.readFileAsync(n)]):[3,5];case 2:return o=l.sent(),[4,l6.unlinkAsync(n)];case 3:return l.sent(),s=JSON.parse(o.toString()),[4,this.send(s)];case 4:l.sent(),l.label=5;case 5:return[3,7];case 6:return c=l.sent(),this._onErrorHelper(c),[3,7];case 7:return[2]}})})},t.prototype._onErrorHelper=function(e){typeof this._onError=="function"&&this._onError(e)},t.prototype._fileCleanupTask=function(){return W0t(this,void 0,void 0,function(){var e,r,n,o,s,c,l=this;return z0t(this,function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),[4,l6.readdirAsync(this._tempDir)];case 1:if(e=u.sent(),e=e.filter(function(d){return Cte.basename(d).indexOf(".ai.json")>-1}),!(e.length>0))return[3,5];r=0,u.label=2;case 2:return rn,o?(s=Cte.join(this._tempDir,e[r]),[4,l6.unlinkAsync(s).catch(function(d){l._onErrorHelper(d)})]):[3,4]):[3,5];case 3:u.sent(),u.label=4;case 4:return r++,[3,2];case 5:return[3,7];case 6:return c=u.sent(),c.code!="ENOENT"&&this._onErrorHelper(c),[3,7];case 7:return[2]}})})},t.TAG="Sender",t.WAIT_BETWEEN_RESEND=60*1e3,t.MAX_BYTES_ON_DISK=50*1024*1024,t.MAX_CONNECTION_FAILURES_BEFORE_WARN=5,t.CLEANUP_TIMEOUT=3600*1e3,t.FILE_RETEMPTION_PERIOD=10080*60*1e3,t.TEMPDIR_PREFIX="appInsights-node",t.HTTP_TIMEOUT=2e4,t})();FIi.exports=fPa});var QIi=I(Y0t=>{"use strict";p();Object.defineProperty(Y0t,"__esModule",{value:!0});Y0t.AzureVirtualMachine=void 0;var UIi=Jl(),pPa=dy(),hPa=mge(),mPa="http://169.254.169.254/metadata/instance/compute",gPa="api-version=2017-12-01",APa="format=json",yPa="UNREACH",EPa=(function(){function t(){}return a(t,"AzureVirtualMachine"),t.getAzureComputeMetadata=function(e,r){var n,o=this,s={},c="".concat(mPa,"?").concat(gPa,"&").concat(APa),l=(n={method:"GET"},n[hPa.disableCollectionRequestOption]=!0,n.headers={Metadata:"True"},n),u=pPa.makeRequest(e,c,l,function(d){if(d.statusCode===200){s.isVM=!0;var f="";d.on("data",function(h){f+=h}),d.on("end",function(){try{var h=JSON.parse(f);s.id=h.vmId||"",s.subscriptionId=h.subscriptionId||"",s.osType=h.osType||""}catch(m){UIi.info(t.TAG,m)}r(s)})}else r(s)},!1,!1);u&&(setTimeout(function(){o._requestTimedOut=!0,u.abort()},t.HTTP_TIMEOUT),u.on("error",function(d){o._requestTimedOut&&d&&(d.name="telemetry timeout",d.message="telemetry request timed out"),d&&d.message&&d.message.indexOf(yPa)>-1?s.isVM=!1:UIi.info(t.TAG,d),r(s)}),u.end())},t.HTTP_TIMEOUT=2500,t.TAG="AzureVirtualMachine",t})();Y0t.AzureVirtualMachine=EPa});var qIi=I(K0t=>{"use strict";p();Object.defineProperty(K0t,"__esModule",{value:!0});K0t.NetworkStatsbeat=void 0;var _Pa=(function(){function t(e,r){this.endpoint=e,this.host=r,this.totalRequestCount=0,this.totalSuccesfulRequestCount=0,this.totalFailedRequestCount=[],this.retryCount=[],this.exceptionCount=[],this.throttleCount=[],this.intervalRequestExecutionTime=0,this.lastIntervalRequestExecutionTime=0,this.lastTime=+new Date,this.lastRequestCount=0}return a(t,"NetworkStatsbeat"),t})();K0t.NetworkStatsbeat=_Pa});var VIi=I((bte,$Ii)=>{"use strict";p();var j4=bte&&bte.__assign||function(){return j4=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0&&s/o||0;if(n.lastIntervalRequestExecutionTime=n.intervalRequestExecutionTime,o>0){var l=Object.assign({endpoint:this._networkStatsbeatCollection[r].endpoint,host:this._networkStatsbeatCollection[r].host},e);this._statbeatMetrics.push({name:Cd.StatsbeatCounter.REQUEST_DURATION,value:c,properties:l})}n.lastRequestCount=n.totalRequestCount,n.lastTime=n.time}},t.prototype._getShortHost=function(e){var r=e;try{var n=new RegExp(/^https?:\/\/(?:www\.)?([^\/.-]+)/),o=n.exec(e);o!=null&&o.length>1&&(r=o[1]),r=r.replace(".in.applicationinsights.azure.com","")}catch{}return r},t.prototype._trackRequestsCount=function(e){for(var r=this,n=a(function(l){s=o._networkStatsbeatCollection[l];var u=Object.assign({endpoint:s.endpoint,host:s.host},e);s.totalSuccesfulRequestCount>0&&(o._statbeatMetrics.push({name:Cd.StatsbeatCounter.REQUEST_SUCCESS,value:s.totalSuccesfulRequestCount,properties:u}),s.totalSuccesfulRequestCount=0),s.totalFailedRequestCount.length>0&&(s.totalFailedRequestCount.forEach(function(d){u=Object.assign(j4(j4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Cd.StatsbeatCounter.REQUEST_FAILURE,value:d.count,properties:u})}),s.totalFailedRequestCount=[]),s.retryCount.length>0&&(s.retryCount.forEach(function(d){u=Object.assign(j4(j4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Cd.StatsbeatCounter.RETRY_COUNT,value:d.count,properties:u})}),s.retryCount=[]),s.throttleCount.length>0&&(s.throttleCount.forEach(function(d){u=Object.assign(j4(j4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:Cd.StatsbeatCounter.THROTTLE_COUNT,value:d.count,properties:u})}),s.throttleCount=[]),s.exceptionCount.length>0&&(s.exceptionCount.forEach(function(d){u=Object.assign(j4(j4({},u),{exceptionType:d.exceptionType})),r._statbeatMetrics.push({name:Cd.StatsbeatCounter.EXCEPTION_COUNT,value:d.count,properties:u})}),s.exceptionCount=[])},"_loop_1"),o=this,s,c=0;c0))return[3,2];for(e=[],r=0;r-1)return t.EU_CONNECTION_STRING;return t.NON_EU_CONNECTION_STRING},t.NON_EU_CONNECTION_STRING="InstrumentationKey=c4a29126-a7cb-47e5-b348-11414998b11e;IngestionEndpoint=https://westus-0.in.applicationinsights.azure.com",t.EU_CONNECTION_STRING="InstrumentationKey=7dc56bab-3c0c-4e9f-9ebb-d1acadee8d0f;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com",t.STATS_COLLECTION_SHORT_INTERVAL=9e5,t.STATS_COLLECTION_LONG_INTERVAL=864e5,t.STATS_COLLECTION_INITIAL_DELAY=15e3,t.TAG="Statsbeat",t})();$Ii.exports=RPa});var YIi=I((eSp,zIi)=>{"use strict";p();var kPa=require("url"),PPa=z_r(),DPa=SIi(),NPa=cge(),u6=UE(),MPa=IIi(),uCr=NIi(),WIi=kG(),OPa=VIi(),LPa=aCr(),dCr=dy(),J0t=Jl(),BPa=iCr(),FPa=(function(){function t(e){this._telemetryProcessors=[];var r=new PPa(e);if(this.config=r,!this.config.instrumentationKey||this.config.instrumentationKey=="")throw new Error("Instrumentation key not found, please provide a connection string before starting Application Insights SDK.");this.context=new NPa,this.commonProperties={},this.authorizationHandler=null,this.config.disableStatsbeat||(this._statsbeat=new OPa(this.config,this.context),this._statsbeat.enable(!0));var n=new LPa(this.config,this.getAuthorizationHandler,null,null,this._statsbeat);this.channel=new MPa(function(){return r.disableAppInsights},function(){return r.maxBatchSize},function(){return r.maxBatchIntervalMs},n)}return a(t,"TelemetryClient"),t.prototype.trackAvailability=function(e){this.track(e,u6.TelemetryType.Availability)},t.prototype.trackPageView=function(e){this.track(e,u6.TelemetryType.PageView)},t.prototype.trackTrace=function(e){this.track(e,u6.TelemetryType.Trace)},t.prototype.trackMetric=function(e){this.track(e,u6.TelemetryType.Metric)},t.prototype.trackException=function(e){e&&e.exception&&!dCr.isError(e.exception)&&(e.exception=new Error(e.exception.toString())),this.track(e,u6.TelemetryType.Exception)},t.prototype.trackEvent=function(e){this.track(e,u6.TelemetryType.Event)},t.prototype.trackRequest=function(e){this.track(e,u6.TelemetryType.Request)},t.prototype.trackDependency=function(e){if(e&&!e.target&&e.data)try{e.target=new kPa.URL(e.data).host}catch(r){e.target=null,J0t.warn(t.TAG,"The URL object is failed to create.",r)}this.track(e,u6.TelemetryType.Dependency)},t.prototype.flush=function(e){this.channel.triggerSend(e?!!e.isAppCrashing:!1,e?e.callback:void 0)},t.prototype.track=function(e,r){if(e&&u6.telemetryTypeToBaseType(r)){var n=BPa.createEnvelope(e,r,this.commonProperties,this.context,this.config);e.time&&(n.time=e.time.toISOString());var o=this.runTelemetryProcessors(n,e.contextObjects);o=o&&uCr.samplingTelemetryProcessor(n,{correlationContext:WIi.CorrelationContextManager.getCurrentContext()}),uCr.preAggregatedMetricsTelemetryProcessor(n,this.context),o&&(uCr.performanceMetricsTelemetryProcessor(n,this.quickPulseClient),this.channel.send(n))}else J0t.warn(t.TAG,"track() requires telemetry object and telemetryType to be specified.")},t.prototype.setAutoPopulateAzureProperties=function(e){},t.prototype.getAuthorizationHandler=function(e){return e&&e.aadTokenCredential?(this.authorizationHandler||(J0t.info(t.TAG,"Adding authorization handler"),this.authorizationHandler=new DPa(e.aadTokenCredential,e.aadAudience)),this.authorizationHandler):null},t.prototype.addTelemetryProcessor=function(e){this._telemetryProcessors.push(e)},t.prototype.clearTelemetryProcessors=function(){this._telemetryProcessors=[]},t.prototype.runTelemetryProcessors=function(e,r){var n=!0,o=this._telemetryProcessors.length;if(o===0)return n;r=r||{},r.correlationContext=WIi.CorrelationContextManager.getCurrentContext();for(var s=0;s{"use strict";p();var UPa=fCr&&fCr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),QPa=YIi(),KIi=q_r(),qPa=mge(),Z0t=Jl(),jPa=(function(t){UPa(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NodeClient"),e.prototype.trackNodeHttpRequestSync=function(r){r&&r.request&&r.response&&r.duration?KIi.trackRequestSync(this,r):Z0t.warn("trackNodeHttpRequestSync requires NodeHttpRequestTelemetry object with request, response and duration specified.")},e.prototype.trackNodeHttpRequest=function(r){(r.duration||r.error)&&Z0t.warn("trackNodeHttpRequest will ignore supplied duration and error parameters. These values are collected from the request and response objects."),r&&r.request&&r.response?KIi.trackRequest(this,r):Z0t.warn("trackNodeHttpRequest requires NodeHttpRequestTelemetry object with request and response specified.")},e.prototype.trackNodeHttpDependency=function(r){r&&r.request?qPa.trackRequest(this,r):Z0t.warn("trackNodeHttpDependency requires NodeHttpDependencyTelemetry object with request specified.")},e})(QPa);JIi.exports=jPa});var exi=I(XIi=>{"use strict";p();Object.defineProperty(XIi,"__esModule",{value:!0})});var ixi=I(At=>{"use strict";p();Object.defineProperty(At,"__esModule",{value:!0});At.Configuration=At.liveMetricsClient=At.defaultClient=At.DistributedTracingModes=void 0;At.setup=JPa;At.start=nxi;At.getCorrelationContext=XPa;At.startOperation=e2a;At.wrapWithCorrelationContext=t2a;At.dispose=r2a;var hCr=kG(),HPa=L1i(),GPa=F1i(),mCr=r0t(),$Pa=x_r(),VPa=z1i(),WPa=oSi(),zPa=mge(),YPa=q_r(),txi=Yee(),b5e=Jl(),rxi=USi(),gCr=qSi(),KPa=GSi();At.TelemetryClient=ZIi();At.Contracts=UE();At.azureFunctionsTypes=exi();var pCr;(function(t){t[t.AI=0]="AI",t[t.AI_AND_W3C=1]="AI_AND_W3C"})(pCr||(At.DistributedTracingModes=pCr={}));var S5e,T5e,I5e,x5e,w5e,Uge,Qge,Ste,R5e,k5e,tI=!1,X0t;function JPa(t){return At.defaultClient?b5e.info("The default client is already setup"):(At.defaultClient=new At.TelemetryClient(t),S5e=new HPa(At.defaultClient),T5e=new GPa(At.defaultClient),I5e=new mCr(At.defaultClient),x5e=new $Pa(At.defaultClient),w5e=new VPa(At.defaultClient),Uge=new WPa(At.defaultClient),Ste=new YPa(At.defaultClient),R5e=new zPa(At.defaultClient),Qge||(Qge=new gCr.AutoCollectNativePerformance(At.defaultClient)),k5e=new KPa.AzureFunctionsHook(At.defaultClient)),ACr}a(JPa,"setup");function ZPa(){At.defaultClient&&(At.defaultClient.config.enableAutoCollectExternalLoggers==null&&(At.defaultClient.config.enableAutoCollectExternalLoggers=!0),At.defaultClient.config.enableAutoCollectConsole==null&&(At.defaultClient.config.enableAutoCollectConsole=!1),At.defaultClient.config.enableAutoCollectExceptions==null&&(At.defaultClient.config.enableAutoCollectExceptions=!0),At.defaultClient.config.enableAutoCollectPerformance==null&&(At.defaultClient.config.enableAutoCollectPerformance=!0),At.defaultClient.config.enableAutoCollectPreAggregatedMetrics==null&&(At.defaultClient.config.enableAutoCollectPreAggregatedMetrics=!0),At.defaultClient.config.enableAutoCollectHeartbeat==null&&(At.defaultClient.config.enableAutoCollectHeartbeat=!0),At.defaultClient.config.enableAutoCollectRequests==null&&(At.defaultClient.config.enableAutoCollectRequests=!0),At.defaultClient.config.enableAutoCollectDependencies==null&&(At.defaultClient.config.enableAutoCollectDependencies=!0),At.defaultClient.config.enableUseDiskRetryCaching==null&&(At.defaultClient.config.enableUseDiskRetryCaching=!0),At.defaultClient.config.enableAutoDependencyCorrelation==null&&(At.defaultClient.config.enableAutoDependencyCorrelation=!0),At.defaultClient.config.enableSendLiveMetrics==null&&(At.defaultClient.config.enableSendLiveMetrics=!1),At.defaultClient.config.enableAutoCollectExtendedMetrics==null&&(At.defaultClient.config.enableAutoCollectExtendedMetrics=!0),At.defaultClient.config.enableWebInstrumentation==null&&(At.defaultClient.config.enableWebInstrumentation=!1),At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions==null&&(At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=!1))}a(ZPa,"_setDefaultConfig");function nxi(){if(At.defaultClient){tI=!0,ZPa(),S5e.enable(At.defaultClient.config.enableAutoCollectExternalLoggers,At.defaultClient.config.enableAutoCollectConsole),T5e.enable(At.defaultClient.config.enableAutoCollectExceptions),I5e.enable(At.defaultClient.config.enableAutoCollectPerformance),x5e.enable(At.defaultClient.config.enableAutoCollectPreAggregatedMetrics),w5e.enable(At.defaultClient.config.enableAutoCollectHeartbeat),Ste.useAutoCorrelation(At.defaultClient.config.enableAutoDependencyCorrelation,At.defaultClient.config.enableUseAsyncHooks),Ste.enable(At.defaultClient.config.enableAutoCollectRequests),R5e.enable(At.defaultClient.config.enableAutoCollectDependencies),Uge.enable(At.defaultClient.config.enableWebInstrumentation,At.defaultClient.config.webInstrumentationConnectionString),At.defaultClient.config.enableSendLiveMetrics&&(At.liveMetricsClient||(At.liveMetricsClient=new rxi(At.defaultClient.config,At.defaultClient.context,At.defaultClient.getAuthorizationHandler,At.defaultClient),X0t=new mCr(At.liveMetricsClient,1e3,!0),At.liveMetricsClient.addCollector(X0t),At.defaultClient.quickPulseClient=At.liveMetricsClient),At.liveMetricsClient.enable(At.defaultClient.config.enableSendLiveMetrics)),k5e.enable(At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions);var t=gCr.AutoCollectNativePerformance.parseEnabled(At.defaultClient.config.enableAutoCollectExtendedMetrics,At.defaultClient.config);Qge.enable(At.defaultClient.config.enableAutoCollectExtendedMetrics,t.disabledMetrics),At.defaultClient&&At.defaultClient.channel&&At.defaultClient.channel.setUseDiskRetryCaching(At.defaultClient.config.enableUseDiskRetryCaching,At.defaultClient.config.enableResendInterval,At.defaultClient.config.enableMaxBytesOnDisk)}else b5e.warn("Start cannot be called before setup");return ACr}a(nxi,"start");function XPa(){return hCr.CorrelationContextManager.getCurrentContext()}a(XPa,"getCorrelationContext");function e2a(t,e){return hCr.CorrelationContextManager.startOperation(t,e)}a(e2a,"startOperation");function t2a(t,e){return hCr.CorrelationContextManager.wrapCallback(t,e)}a(t2a,"wrapWithCorrelationContext");var ACr=(function(){function t(){}return a(t,"Configuration"),t.setDistributedTracingMode=function(e){return txi.w3cEnabled=e===pCr.AI_AND_W3C,t},t.setAutoCollectConsole=function(e,r){return r===void 0&&(r=!1),At.defaultClient&&(At.defaultClient.config.enableAutoCollectExternalLoggers=e,At.defaultClient.config.enableAutoCollectConsole=r,tI&&S5e.enable(e,r)),t},t.setAutoCollectExceptions=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectExceptions=e,tI&&T5e.enable(e)),t},t.setAutoCollectPerformance=function(e,r){if(r===void 0&&(r=!0),At.defaultClient){At.defaultClient.config.enableAutoCollectPerformance=e;var n=gCr.AutoCollectNativePerformance.parseEnabled(r,At.defaultClient.config);At.defaultClient.config.enableAutoCollectExtendedMetrics=n.isEnabled,tI&&(I5e.enable(e),Qge.enable(At.defaultClient.config.enableAutoCollectExtendedMetrics,n.disabledMetrics))}return t},t.setAutoCollectPreAggregatedMetrics=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectPreAggregatedMetrics=e,tI&&x5e.enable(e)),t},t.setAutoCollectHeartbeat=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectHeartbeat=e,tI&&w5e.enable(e)),t},t.enableAutoWebSnippetInjection=function(e,r){return At.defaultClient&&(At.defaultClient.config.enableWebInstrumentation=e,At.defaultClient.config.webInstrumentationConnectionString=r,tI&&Uge.enable(At.defaultClient.config.enableAutoWebSnippetInjection,At.defaultClient.config.webSnippetConnectionString)),t},t.enableWebInstrumentation=function(e,r){return At.defaultClient&&(At.defaultClient.config.enableWebInstrumentation=e,At.defaultClient.config.webInstrumentationConnectionString=r,tI&&Uge.enable(At.defaultClient.config.enableWebInstrumentation,At.defaultClient.config.webInstrumentationConnectionString)),t},t.setAutoCollectRequests=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectRequests=e,tI&&Ste.enable(e)),t},t.setAutoCollectDependencies=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectDependencies=e,tI&&R5e.enable(e)),t},t.setAutoDependencyCorrelation=function(e,r){return At.defaultClient&&(At.defaultClient.config.enableAutoDependencyCorrelation=e,At.defaultClient.config.enableUseAsyncHooks=r,tI&&Ste.useAutoCorrelation(e,r)),t},t.setUseDiskRetryCaching=function(e,r,n){return At.defaultClient&&(At.defaultClient.config.enableUseDiskRetryCaching=e,At.defaultClient.config.enableResendInterval=r,At.defaultClient.config.enableMaxBytesOnDisk=n,At.defaultClient.channel&&At.defaultClient.channel.setUseDiskRetryCaching(At.defaultClient.config.enableUseDiskRetryCaching,At.defaultClient.config.enableResendInterval,At.defaultClient.config.enableMaxBytesOnDisk)),t},t.setInternalLogging=function(e,r){return e===void 0&&(e=!1),r===void 0&&(r=!0),b5e.enableDebug=e,b5e.disableWarnings=!r,t},t.setAutoCollectIncomingRequestAzureFunctions=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=e,tI&&k5e.enable(e)),t},t.setSendLiveMetrics=function(e){return e===void 0&&(e=!1),At.defaultClient?(!At.liveMetricsClient&&e?(At.liveMetricsClient=new rxi(At.defaultClient.config,At.defaultClient.context,At.defaultClient.getAuthorizationHandler,At.defaultClient),X0t=new mCr(At.liveMetricsClient,1e3,!0),At.liveMetricsClient.addCollector(X0t),At.defaultClient.quickPulseClient=At.liveMetricsClient):At.liveMetricsClient&&At.liveMetricsClient.enable(e),At.defaultClient.config.enableSendLiveMetrics=e,t):(b5e.warn("Live metrics client cannot be setup without the default client"),t)},t.start=nxi,t})();At.Configuration=ACr;function r2a(){txi.w3cEnabled=!0,At.defaultClient=null,tI=!1,S5e&&S5e.dispose(),T5e&&T5e.dispose(),I5e&&I5e.dispose(),x5e&&x5e.dispose(),w5e&&w5e.dispose(),Uge&&Uge.dispose(),Qge&&Qge.dispose(),Ste&&Ste.dispose(),R5e&&R5e.dispose(),At.liveMetricsClient&&(At.liveMetricsClient.enable(!1),At.liveMetricsClient=void 0),k5e&&k5e.dispose()}a(r2a,"dispose")});var ECr=I(MR=>{"use strict";p();var n2a=MR&&MR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),i2a=MR&&MR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),oxi=MR&&MR.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{this.client.flush({callback:a(()=>{e(void 0)},"callback")})})}massageEventName(e){return c2a(e)?sxi(e):e.includes(this.namespace)?e:`${this.namespace}/${e}`}};MR.AzureInsightReporter=yCr;function l2a(t,e,r){let n=new o2a.TelemetryClient(r);return n.config.enableAutoCollectRequests=!1,n.config.enableAutoCollectPerformance=!1,n.config.enableAutoCollectExceptions=!1,n.config.enableAutoCollectConsole=!1,n.config.enableAutoCollectDependencies=!1,n.config.noDiagnosticChannel=!0,axi(t,e,n),n}a(l2a,"createAppInsightsClient");function axi(t,e,r){r.commonProperties=u2a(r.commonProperties,e),r.context.tags[r.context.keys.cloudRoleInstance]="REDACTED",r.context.tags[r.context.keys.sessionId]=e.sessionId;let n=t.copilotTelemetryURL;n&&URL.canParse(n)&&(r.config.endpointUrl=n)}a(axi,"configureReporter");function u2a(t,e){return t=t||{},t.common_os=egt.platform(),t.common_platformversion=egt.release(),t.common_arch=egt.arch(),t.common_cpu=Array.from(new Set(egt.cpus().map(r=>r.model))).join(),t.common_vscodemachineid=e.machineId,t.common_vscodesessionid=e.sessionId,t.client_deviceid=e.devDeviceId,t.common_uikind=e.uiKind,t.common_remotename=e.remoteName??"none",t.common_isnewappinstall="",t}a(u2a,"decorateWithCommonProperties")});var cxi=I((pSp,d2a)=>{d2a.exports={name:"copilot-chat",displayName:"GitHub Copilot Chat",description:"AI chat features powered by Copilot",version:"0.54.0",build:"1",completionsCoreVersion:"1.378.1799",internalLargeStorageAriaKey:"ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917",ariaKey:"0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",buildType:"dev",publisher:"GitHub",homepage:"https://github.com/features/copilot?editor=vscode",license:"SEE LICENSE IN LICENSE.txt",repository:{type:"git",url:"https://github.com/microsoft/vscode-copilot-chat"},bugs:{url:"https://github.com/microsoft/vscode/issues"},qna:"https://github.com/github-community/community/discussions/categories/copilot",icon:"assets/copilot.png",pricing:"Trial",engines:{vscode:"^1.126.0",npm:">=9.0.0",node:">=22.14.0"},categories:["AI","Chat","Programming Languages","Machine Learning"],keywords:["ai","openai","codex","pilot","snippets","documentation","autocomplete","intellisense","refactor","javascript","python","typescript","php","go","golang","ruby","c++","c#","java","kotlin","co-pilot"],badges:[{url:"https://img.shields.io/badge/GitHub%20Copilot-Subscription%20Required-orange",href:"https://github.com/github-copilot/signup?editor=vscode",description:"%github.copilot.badge.signUp%"},{url:"https://img.shields.io/github/stars/github/copilot-docs?style=social",href:"https://github.com/github/copilot-docs",description:"%github.copilot.badge.star%"},{url:"https://img.shields.io/youtube/channel/views/UC7c3Kb6jYCRj4JOHHZTxKsQ?style=social",href:"https://www.youtube.com/@GitHub/search?query=copilot",description:"%github.copilot.badge.youtube%"},{url:"https://img.shields.io/twitter/follow/github?style=social",href:"https://twitter.com/github",description:"%github.copilot.badge.twitter%"}],activationEvents:["onStartupFinished","onLanguageModelChat:copilot","onUri","onFileSystem:ccreq","onFileSystem:ccsettings"],main:"./dist/extension",l10n:"./l10n",enabledApiProposals:["agentSessionsWorkspace","agentsWindowConfiguration","chatDebug","chatHooks","extensionsAny","newSymbolNamesProvider","interactive","codeActionAI","activeComment","commentReveal","contribCommentThreadAdditionalMenu","contribCommentsViewThreadMenus","contribChatEditorInlineGutterMenu","documentFiltersExclusive","embeddings","findTextInFiles","findTextInFiles2","languageModelToolSupportsModel","findFiles2","textSearchProvider","terminalDataWriteEvent","terminalExecuteCommandEvent","terminalSelection","terminalQuickFixProvider","mappedEditsProvider","aiRelatedInformation","aiSettingsSearch","chatParticipantAdditions","defaultChatParticipant","contribSourceControlInputBoxMenu","authLearnMore","testObserver","aiTextSearchProvider","chatParticipantPrivate","chatProvider","contribDebugCreateConfiguration","chatReferenceDiagnostic","textSearchProvider2","chatReferenceBinaryData","languageModelSystem","languageModelCapabilities","languageModelPricing","inlineCompletionsAdditions","chatStatusItem","chatInputNotification","taskProblemMatcherStatus","contribLanguageModelToolSets","textDocumentChangeReason","resolvers","taskExecutionTerminal","dataChannels","languageModelThinkingPart","chatSessionsProvider","devDeviceId","contribEditorContentMenu","chatPromptFiles","mcpServerDefinitions","tabInputMultiDiff","workspaceTrust","environmentPower","terminalTitle","toolInvocationApproveCombination","chatSessionCustomizationProvider"],contributes:{languageModelTools:[{name:"copilot_searchCodebase",toolReferenceName:"codebase",displayName:"%copilot.tools.searchCodebase.name%",icon:"$(folder)",userDescription:"%copilot.codebase.tool.description%",modelDescription:"Run a natural language search for relevant code or documentation comments from the user's current workspace. Returns relevant code snippets from the user's current workspace if it is large, or the full contents of the workspace if it is small.",tags:["codesearch","vscode_codesearch"],inputSchema:{type:"object",properties:{query:{type:"string",description:"The query to search the codebase for. Should contain all relevant context. Should ideally be text that might appear in the codebase, such as function names, variable names, or comments."}},required:["query"]}},{name:"execution_subagent",toolReferenceName:"executionSubagent",displayName:"%copilot.tools.executionSubagent.name%",icon:"$(play)",userDescription:"%copilot.tools.executionSubagent.description%",modelDescription:`Launch an iterative execution-focused subagent that performs an execution-based task. USE THIS INSTEAD OF RUNNING INDIVIDUAL COMMANDS WITH run_in_terminal EXCEPT IN THE RARE CASES THAT YOU NEED THE FULL OUTPUT OF A COMMAND. Here are some examples of how it can be used: - Run tests and filter the output to summarize which tests failed and why. @@ -760,51 +760,51 @@ EXAMPLES: **Note**: This is an advanced setting.`,tags:["advanced","experimental"]},"github.copilot.chat.reasoningEffortOverride":{type:["string","null"],default:null,markdownDescription:"Overrides the reasoning/thinking effort sent to model APIs. The configured value must match a reasoning-effort value supported by the selected model or endpoint (for example, `low`, `medium`, `high`, or other model-specific values). Used by evals.\n\n**Note**: This is an advanced debugging setting.",tags:["advanced"]},"github.copilot.chat.anthropic.promptCaching.extendedTtl":{type:"boolean",default:!1,tags:["advanced","experimental","onExp"],description:"%github.copilot.config.anthropic.promptCaching.extendedTtl%"},"github.copilot.chat.anthropic.promptCaching.extendedTtlMessages":{type:"boolean",default:!1,tags:["advanced","experimental","onExp"],description:"%github.copilot.config.anthropic.promptCaching.extendedTtlMessages%"},"github.copilot.chat.modelCapabilityOverrides":{type:"object",default:{},markdownDescription:"%github.copilot.config.modelCapabilityOverrides%",additionalProperties:{type:"object",properties:{family:{type:"string",description:"Alias the model's family for capability routing (e.g. 'claude-opus-4.7')."}},additionalProperties:!1},tags:["advanced"]},"github.copilot.chat.installExtensionSkill.enabled":{type:"boolean",default:!1,tags:["advanced","experimental","onExp"],description:"%github.copilot.config.installExtensionSkill.enabled%"},"github.copilot.chat.debug.promptOverrideString":{type:["string","null"],default:null,markdownDescription:"YAML string that overrides the system prompt and/or tool descriptions sent to the model. When both this setting and `github.copilot.chat.debug.promptOverrideFile` are configured, this setting takes precedence.\n\n**Note**: This is an advanced debugging setting.",tags:["advanced","experimental"]},"github.copilot.chat.debug.promptOverrideFile":{type:["string","null"],default:null,markdownDescription:`Path to a YAML file that overrides the system prompt and/or tool descriptions sent to the model. -**Note**: This is an advanced debugging setting.`,tags:["advanced","experimental"]},"github.copilot.chat.edits.gemini3MultiReplaceString":{type:"boolean",default:!1,markdownDescription:"Enable the modern `multi_replace_string_in_file` edit tool when generating edits with Gemini 3 models.",tags:["advanced","experimental","onExp"]},"github.copilot.chat.edits.batchReplaceStringDescriptions":{type:"boolean",default:!1,markdownDescription:"Update tool descriptions to promote `multi_replace_string_in_file` as the primary multi-edit tool.",tags:["advanced","experimental","onExp"]},"github.copilot.chat.projectLabels.expanded":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.projectLabels.expanded%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.projectLabels.chat":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.projectLabels.chat%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.projectLabels.inline":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.projectLabels.inline%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.workspace.maxLocalIndexSize":{type:"number",default:1e5,markdownDescription:"%github.copilot.config.workspace.maxLocalIndexSize%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.workspace.enableCodeSearch":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.workspace.enableCodeSearch%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.workspace.preferredEmbeddingsModel":{type:"string",default:"",markdownDescription:"%github.copilot.config.workspace.preferredEmbeddingsModel%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.workspace.prototypeAdoCodeSearchEndpointOverride":{type:"string",default:"",markdownDescription:"%github.copilot.config.workspace.prototypeAdoCodeSearchEndpointOverride%",tags:["advanced","experimental"]},"github.copilot.chat.feedback.onChange":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.feedback.onChange%",tags:["advanced","experimental"]},"github.copilot.chat.review.intent":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.review.intent%",tags:["advanced","experimental"]},"github.copilot.chat.notebook.summaryExperimentEnabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.notebook.summaryExperimentEnabled%",tags:["advanced","experimental"]},"github.copilot.chat.notebook.variableFilteringEnabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.notebook.variableFilteringEnabled%",tags:["advanced","experimental"]},"github.copilot.chat.notebook.alternativeFormat":{type:"string",default:"xml",enum:["xml","markdown"],markdownDescription:"%github.copilot.config.notebook.alternativeFormat%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.notebook.alternativeNESFormat.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.notebook.alternativeNESFormat.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.debugTerminalCommandPatterns":{type:"array",default:[],items:{type:"string"},markdownDescription:"%github.copilot.config.debugTerminalCommandPatterns%",tags:["advanced","experimental"]},"github.copilot.chat.localWorkspaceRecording.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.localWorkspaceRecording.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.editRecording.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.editRecording.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.inlineChat.reasoningEffort":{type:"string",default:"low",enum:["none","minimal","low","medium","high"],markdownDescription:"%github.copilot.config.inlineChat.reasoningEffort%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineChat.enableThinking":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.inlineChat.enableThinking%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.debug.requestLogger.maxEntries":{type:"number",default:100,markdownDescription:"%github.copilot.config.debug.requestLogger.maxEntries%",tags:["advanced","experimental"]},"github.copilot.chat.inlineEdits.diagnosticsContextProvider.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.inlineEdits.diagnosticsContextProvider.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.chatSessionContextProvider.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.inlineEdits.chatSessionContextProvider.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.codesearch.agent.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.codesearch.agent.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.agent.temperature":{type:["number","null"],markdownDescription:"%github.copilot.config.agent.temperature%",tags:["advanced","experimental"]},"github.copilot.chat.agent.omitFileAttachmentContents":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.agent.omitFileAttachmentContents%",tags:["advanced","experimental"]},"github.copilot.chat.agent.backgroundTodoAgent.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.agent.backgroundTodoAgent.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agent.longToolCallCachePreservation.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.agent.longToolCallCachePreservation.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agent.longToolCallCachePreservation.maxProbes":{type:"number",default:1,markdownDescription:"%github.copilot.config.agent.longToolCallCachePreservation.maxProbes%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agent.largeToolResultsToDisk.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.agent.largeToolResultsToDisk.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agent.largeToolResultsToDisk.thresholdBytes":{type:"number",default:8192,markdownDescription:"%github.copilot.config.agent.largeToolResultsToDisk.thresholdBytes%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.instantApply.shortContextModelName":{type:"string",default:"gpt-4o-instant-apply-full-ft-v66-short",markdownDescription:"%github.copilot.config.instantApply.shortContextModelName%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.instantApply.shortContextLimit":{type:"number",default:8e3,markdownDescription:"%github.copilot.config.instantApply.shortContextLimit%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.enableUserPreferences":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.enableUserPreferences%",tags:["advanced","experimental"]},"github.copilot.chat.skillTool.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.skill.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.getChangedFilesTool.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.getChangedFilesTool.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.executionSubagent.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.executionSubagent.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.executionSubagent.model":{type:"string",default:"gemini-3-flash",markdownDescription:"%github.copilot.config.executionSubagent.model%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.executionSubagent.useAgenticProxy":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.executionSubagent.useAgenticProxy%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.executionSubagent.toolCallLimit":{type:"number",default:10,markdownDescription:"%github.copilot.config.executionSubagent.toolCallLimit%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.summarizeAgentConversationHistoryThreshold":{type:["number","null"],markdownDescription:"%github.copilot.config.summarizeAgentConversationHistoryThreshold%",tags:["advanced","experimental"]},"github.copilot.chat.agentHistorySummarizationMode":{type:["string","null"],markdownDescription:"%github.copilot.config.agentHistorySummarizationMode%",tags:["advanced","experimental"]},"github.copilot.chat.useResponsesApiTruncation":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.useResponsesApiTruncation%",tags:["advanced","experimental"]},"github.copilot.chat.omitBaseAgentInstructions":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.omitBaseAgentInstructions%",tags:["advanced","experimental"]},"github.copilot.chat.promptFileContextProvider.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.promptFileContextProvider.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.tools.defaultToolsGrouped":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.tools.defaultToolsGrouped%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.gpt5AlternativePatch":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.gpt5AlternativePatch%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.triggerOnEditorChangeAfterSeconds":{type:["number","null"],default:10,markdownDescription:"%github.copilot.config.inlineEdits.triggerOnEditorChangeAfterSeconds%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.nextCursorPrediction.displayLine":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.inlineEdits.nextCursorPrediction.displayLine%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens":{type:"number",default:3e3,markdownDescription:"%github.copilot.config.inlineEdits.nextCursorPrediction.currentFileMaxTokens%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.renameSymbolSuggestions":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.inlineEdits.renameSymbolSuggestions%",tags:["advanced","experimental","onExp"]},"github.copilot.nextEditSuggestions.preferredModel":{type:"string",default:"none",markdownDescription:"%github.copilot.config.nextEditSuggestions.preferredModel%",tags:["advanced","experimental","onExp"]},"github.copilot.nextEditSuggestions.eagerness":{type:"string",default:"auto",enum:["auto","low","medium","high"],enumItemLabels:["%github.copilot.config.nextEditSuggestions.eagerness.auto.label%","%github.copilot.config.nextEditSuggestions.eagerness.low.label%","%github.copilot.config.nextEditSuggestions.eagerness.medium.label%","%github.copilot.config.nextEditSuggestions.eagerness.high.label%"],enumDescriptions:["%github.copilot.config.nextEditSuggestions.eagerness.auto%","%github.copilot.config.nextEditSuggestions.eagerness.low%","%github.copilot.config.nextEditSuggestions.eagerness.medium%","%github.copilot.config.nextEditSuggestions.eagerness.high%"],markdownDescription:"%github.copilot.config.nextEditSuggestions.eagerness%",tags:["advanced","experimental"]},"github.copilot.chat.cli.mcp.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.mcp.enabled%",tags:["advanced","experimental"],agentsWindow:{default:!0}},"github.copilot.chat.cli.sandbox.enabled":{type:"string",enum:["off","on","allowNetwork"],enumDescriptions:["%github.copilot.config.cli.sandbox.enabled.offDescription%","%github.copilot.config.cli.sandbox.enabled.onDescription%","%github.copilot.config.cli.sandbox.enabled.allowNetworkDescription%"],default:"off",markdownDescription:"%github.copilot.config.cli.sandbox.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.cli.branchSupport.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.cli.branchSupport.enabled%",tags:["advanced"],agentsWindow:{default:!0}},"github.copilot.chat.cli.showExternalSessions":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.showExternalSessions%",tags:["advanced"],agentsWindow:{default:!1}},"github.copilot.chat.cli.planExitMode.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.planExitMode.enabled%",tags:["advanced"]},"github.copilot.chat.cli.autoModel.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.autoModel.enabled%",tags:["advanced"]},"github.copilot.chat.agent.modelDetails.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.chat.agent.modelDetails.enabled%",tags:["advanced"]},"github.copilot.chat.cli.planCommand.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.planCommand.enabled%",tags:["advanced"]},"github.copilot.chat.cli.lazyLoadSessionItem.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.lazyLoadSessionItem.enabled%",tags:["advanced"],agentsWindow:{default:!1}},"github.copilot.chat.cli.aiGenerateBranchNames.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.aiGenerateBranchNames.enabled%",tags:["advanced"]},"github.copilot.chat.cli.forkSessions.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.forkSessions.enabled%",tags:["advanced"]},"github.copilot.chat.cli.isolationOption.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.isolationOption.enabled%",tags:["advanced"],agentsWindow:{default:!0}},"github.copilot.chat.cli.autoCommit.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.autoCommit.enabled%",tags:["advanced","experimental"],agentsWindow:{default:!1}},"github.copilot.chat.cli.sessionController.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.cli.sessionController.enabled%",tags:["advanced"],agentsWindow:{default:!1,readOnly:!0}},"github.copilot.chat.cli.thinkingEffort.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.thinkingEffort.enabled%",tags:["advanced"]},"github.copilot.chat.cli.sessionControllerForSessionsApp.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.cli.sessionControllerForSessionsApp.enabled%",tags:["advanced"]},"github.copilot.chat.cli.terminalLinks.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.terminalLinks.enabled%",tags:["advanced"]},"github.copilot.chat.cli.remote.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.remote.enabled%",tags:["advanced"],agentsWindow:{default:!1}},"github.copilot.chat.searchSubagent.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.searchSubagent.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.searchSubagent.useAgenticProxy":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.searchSubagent.useAgenticProxy%",tags:["advanced"]},"github.copilot.chat.searchSubagent.model":{type:"string",default:"",markdownDescription:"%github.copilot.config.searchSubagent.model%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.searchSubagent.toolCallLimit":{type:"number",default:4,markdownDescription:"%github.copilot.config.searchSubagent.toolCallLimit%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.searchSubagent.thoroughnessEnabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.searchSubagent.thoroughnessEnabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agentDebugLog.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.chat.agentDebugLog.enabled%",deprecationMessage:"%github.copilot.config.chat.agentDebugLog.enabled.deprecated%",tags:["advanced","experimental"]},"github.copilot.chat.agentDebugLog.fileLogging.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.chat.agentDebugLog.fileLogging.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agentDebugLog.fileLogging.flushIntervalMs":{type:"number",default:4e3,minimum:2e3,markdownDescription:"%github.copilot.config.chat.agentDebugLog.fileLogging.flushIntervalMs%",tags:["advanced","experimental"]},"github.copilot.chat.agentDebugLog.fileLogging.maxRetainedSessionLogs":{type:"number",default:50,minimum:1,markdownDescription:"%github.copilot.config.chat.agentDebugLog.fileLogging.maxRetainedSessionLogs%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agentDebugLog.fileLogging.maxSessionLogSizeMB":{type:"number",default:100,minimum:1,markdownDescription:"%github.copilot.config.chat.agentDebugLog.fileLogging.maxSessionLogSizeMB%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.otel.enabled":{type:"boolean",default:!1,scope:"application",markdownDescription:"Enable OpenTelemetry trace/metric/log emission for Copilot Chat operations. Configurable in user settings only. Env var `COPILOT_OTEL_ENABLED` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.exporterType":{type:"string",enum:["otlp-grpc","otlp-http","console","file"],default:"otlp-http",scope:"application",markdownDescription:"OTel exporter type for Copilot Chat telemetry. Configurable in user settings only. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.otlpEndpoint":{type:"string",default:"http://localhost:4318",scope:"application",markdownDescription:"OTLP collector endpoint URL for Copilot Chat OTel data. Configurable in user settings only. Env var `OTEL_EXPORTER_OTLP_ENDPOINT` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.captureContent":{type:"boolean",default:!1,scope:"application",markdownDescription:"Capture input/output messages, system instructions, and tool definitions in OTel telemetry. **Contains potentially sensitive data.** Configurable in user settings only. Env var `COPILOT_OTEL_CAPTURE_CONTENT` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.maxAttributeSizeChars":{type:"integer",default:0,minimum:0,scope:"application",markdownDescription:"Maximum size **in characters** for free-form OTel content attributes (prompts, responses, tool arguments/results, hook input/output). `0` (the default) disables truncation so backends without per-attribute size limits receive full JSON payloads. Set to a positive value when your OTel backend caps attribute size \u2014 consult your backend's documentation for its per-attribute limit. Truncated values are suffixed with `...[truncated, original N chars]`. Configurable in user settings only. Env var `COPILOT_OTEL_MAX_ATTRIBUTE_SIZE_CHARS` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.outfile":{type:"string",default:"",scope:"application",markdownDescription:"File path for file-based OTel exporter output (JSON-lines). When set, overrides exporter type to `file`. Configurable in user settings only. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.dbSpanExporter.enabled":{type:"boolean",default:!1,scope:"application",markdownDescription:"Enable SQLite DB span exporter. Persists OTel spans to a local SQLite database. Automatically enables OTel when set to true. Configurable in user settings only. Requires window reload.",tags:["advanced"]},"github.copilot.chat.workspace.codeSearchExternalIngest.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.workspace.codeSearchExternalIngest.enabled%",tags:["advanced","onExp"]}}}],submenus:[{id:"copilot/reviewComment/additionalActions/applyAndNext",label:"%github.copilot.submenu.reviewComment.applyAndNext.label%"},{id:"copilot/reviewComment/additionalActions/discardAndNext",label:"%github.copilot.submenu.reviewComment.discardAndNext.label%"},{id:"copilot/reviewComment/additionalActions/discard",label:"%github.copilot.submenu.reviewComment.discard.label%"},{id:"github.copilot.chat.debug.filter",label:"Filter",icon:"$(filter)"},{id:"github.copilot.chat.debug.exportAllPromptLogsAsJson",label:"Export All Logs as JSON",icon:"$(file-export)"}],menus:{"editor/title":[{command:"github.copilot.debug.generateInlineEditTests",when:"resourceScheme == 'ccreq'"},{command:"github.copilot.chat.notebook.enableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && !github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && !config.notebook.globalToolbar",group:"navigation@10"},{command:"github.copilot.chat.notebook.disableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && !config.notebook.globalToolbar",group:"navigation@10"},{command:"github.copilot.chat.copilotCLI.acceptDiff",group:"navigation@1",when:"github.copilot.chat.copilotCLI.hasActiveDiff"},{command:"github.copilot.chat.copilotCLI.rejectDiff",group:"navigation@2",when:"github.copilot.chat.copilotCLI.hasActiveDiff"}],"editor/title/context":[{command:"github.copilot.chat.copilotCLI.addFileReference",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && !inOutput && resourceScheme != 'vscode-webview' && resourceScheme != 'webview-panel'"}],"explorer/context":[{command:"github.copilot.chat.copilotCLI.addFileReference",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && !explorerResourceIsFolder"}],"editor/context":[{command:"github.copilot.chat.fix",when:"!github.copilot.interactiveSession.disabled && chatSetupCompleted && !editorReadonly && editorSelectionHasDiagnostics",group:"1_chat@4"},{command:"github.copilot.chat.explain",when:"!github.copilot.interactiveSession.disabled && chatSetupCompleted",group:"1_chat@5"},{command:"github.copilot.chat.review",when:"config.github.copilot.chat.reviewSelection.enabled && !github.copilot.interactiveSession.disabled && chatSetupCompleted && resourceScheme != 'vscode-chat-code-block'",group:"1_chat@6"},{command:"github.copilot.chat.copilotCLI.addFileReference",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && !inOutput && resourceScheme != 'vscode-webview' && resourceScheme != 'webview-panel'"},{command:"github.copilot.chat.copilotCLI.addSelection",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && editorHasSelection && !inOutput && resourceScheme != 'vscode-webview' && resourceScheme != 'webview-panel'"}],"chat/editor/inlineGutter":[{command:"github.copilot.chat.explain",when:"!github.copilot.interactiveSession.disabled && editor.hasSelection && !inlineChatFileBelongsToChat",group:"2_chat@2"},{command:"github.copilot.chat.review",when:"!github.copilot.interactiveSession.disabled && editor.hasSelection && config.github.copilot.chat.reviewSelection.enabled && !inlineChatFileBelongsToChat",group:"2_chat@3"}],"chat/input/editing/sessionToolbar":[{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges.apply",when:"chatSessionType == copilotcli && workbenchState != empty && !isSessionsWindow",group:"navigation@0"},{command:"github.copilot.chat.checkoutPullRequestReroute",when:"chatSessionType == copilot-cloud-agent && !github.vscode-pull-request-github.activated && gitOpenRepositoryCount != 0",group:"navigation@0"},{command:"github.copilot.chat.cloudSessions.createPullRequestForTask",when:"chatSessionType == copilot-cloud-agent && github.copilot.chat.cloudTaskCanCreatePullRequest && !isSessionsWindow",group:"navigation@0"},{command:"github.copilot.chat.cloudSessions.openPullRequestForTask",when:"chatSessionType == copilot-cloud-agent && github.copilot.chat.cloudTaskCanOpenPullRequest && !isSessionsWindow",group:"navigation@0"}],"agents/changes/actions/primary":[{command:"github.copilot.sessions.initializeRepository",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.isolationMode == workspace && !sessions.hasGitRepository && !sessions.isAgentHostSession",group:"0_init@1"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.merge",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && !sessions.isMergeBaseBranchProtected && !sessions.hasPullRequest && (sessions.hasUncommittedChanges || sessions.hasOutgoingChanges) && !sessions.isAgentHostSession",group:"1_merge@1"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.mergeAndSync",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && !sessions.isMergeBaseBranchProtected && !sessions.hasPullRequest && (sessions.hasUncommittedChanges || sessions.hasOutgoingChanges) && !sessions.isAgentHostSession",group:"1_merge@2"},{command:"github.copilot.chat.createPullRequestCopilotCLIAgentSession.createPR",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && sessions.hasGitHubRemote && !sessions.hasPullRequest && sessions.hasBranchChanges && !sessions.isAgentHostSession",group:"2_pull_request@1"},{command:"github.copilot.chat.createDraftPullRequestCopilotCLIAgentSession.createDraftPR",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && sessions.hasGitHubRemote && !sessions.hasPullRequest && sessions.hasBranchChanges && !sessions.isAgentHostSession",group:"2_pull_request@2"},{command:"github.copilot.sessions.commit",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && !sessions.isAgentHostSession",group:"3_commit@1"},{command:"github.copilot.sessions.commitAndSync",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && !sessions.isAgentHostSession",group:"3_commit@2"},{command:"github.copilot.sessions.sync",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && sessions.hasUpstream && !sessions.hasUncommittedChanges && (sessions.hasIncomingChanges || sessions.hasOutgoingChanges) && !sessions.isAgentHostSession",group:"4_sync@1"},{command:"github.copilot.claude.sessions.initializeRepository",when:"chatSessionType == claude-code && isSessionsWindow && !sessions.hasGitRepository",group:"init@1"},{command:"github.copilot.claude.sessions.commit",when:"chatSessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges",group:"commit@1"},{command:"github.copilot.claude.sessions.commitAndSync",when:"chatSessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && sessions.hasUpstream",group:"commit@2"},{command:"github.copilot.claude.sessions.sync",when:"chatSessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && !sessions.hasUncommittedChanges && sessions.hasUpstream",group:"sync@1"}],"agents/change/inline":[{command:"github.copilot.sessions.discardChanges",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && !isActiveSessionArchived && !sessions.isAgentHostSession",group:"navigation@2"}],"chat/contextUsage/actions":[{command:"github.copilot.chat.compact",when:"!chatIsAgentHostSession"}],"chat/input/status":[{command:"github.copilot.chat.otel.statusActive",when:"github.copilot.otel.enabledExplicitly && isSessionsWindow",group:"otel@1"}],"chat/newSession":[{command:"github.copilot.cli.newSession",group:"4_recommendations@0"}],"testing/item/result":[{command:"github.copilot.tests.fixTestFailure.fromInline",when:"testResultState == failed && !testResultOutdated",group:"inline@2"}],"testing/item/context":[{command:"github.copilot.tests.fixTestFailure.fromInline",when:"testResultState == failed && !testResultOutdated",group:"inline@2"}],commandPalette:[{command:"github.copilot.cli.openInCopilotCLI",when:"false"},{command:"github.copilot.debug.extensionState",when:"false"},{command:"github.copilot.cli.sessions.commitToWorktree",when:"false"},{command:"github.copilot.cli.sessions.commitToRepository",when:"false"},{command:"github.copilot.chat.triggerPermissiveSignIn",when:"false"},{command:"github.copilot.chat.otel.statusActive",when:"false"},{command:"github.copilot.interactiveSession.feedback",when:"github.copilot-chat.activated && !github.copilot.interactiveSession.disabled"},{command:"github.copilot.debug.workbenchState",when:"true"},{command:"github.copilot.chat.rerunWithCopilotDebug",when:"false"},{command:"github.copilot.chat.startCopilotDebugCommand",when:"false"},{command:"github.copilot.git.generateCommitMessage",when:"false"},{command:"github.copilot.git.resolveMergeConflicts",when:"false"},{command:"github.copilot.chat.explain",when:"false"},{command:"github.copilot.chat.review",when:"!github.copilot.interactiveSession.disabled"},{command:"github.copilot.chat.review.apply",when:"false"},{command:"github.copilot.chat.review.applyAndNext",when:"false"},{command:"github.copilot.chat.review.discard",when:"false"},{command:"github.copilot.chat.review.discardAndNext",when:"false"},{command:"github.copilot.chat.review.discardAll",when:"false"},{command:"github.copilot.chat.review.stagedChanges",when:"false"},{command:"github.copilot.chat.review.unstagedChanges",when:"false"},{command:"github.copilot.chat.review.changes",when:"false"},{command:"github.copilot.chat.review.stagedFileChange",when:"false"},{command:"github.copilot.chat.review.unstagedFileChange",when:"false"},{command:"github.copilot.chat.review.previous",when:"false"},{command:"github.copilot.chat.review.next",when:"false"},{command:"github.copilot.chat.review.continueInInlineChat",when:"false"},{command:"github.copilot.chat.review.continueInChat",when:"false"},{command:"github.copilot.chat.review.markHelpful",when:"false"},{command:"github.copilot.chat.review.markUnhelpful",when:"false"},{command:"github.copilot.devcontainer.generateDevContainerConfig",when:"false"},{command:"github.copilot.tests.fixTestFailure",when:"false"},{command:"github.copilot.tests.fixTestFailure.fromInline",when:"false"},{command:"github.copilot.search.markHelpful",when:"false"},{command:"github.copilot.search.markUnhelpful",when:"false"},{command:"github.copilot.search.feedback",when:"false"},{command:"github.copilot.chat.debug.showElements",when:"false"},{command:"github.copilot.chat.debug.hideElements",when:"false"},{command:"github.copilot.chat.debug.showTools",when:"false"},{command:"github.copilot.chat.debug.hideTools",when:"false"},{command:"github.copilot.chat.debug.showNesRequests",when:"false"},{command:"github.copilot.chat.debug.hideNesRequests",when:"false"},{command:"github.copilot.chat.debug.showGhostRequests",when:"false"},{command:"github.copilot.chat.debug.hideGhostRequests",when:"false"},{command:"github.copilot.chat.debug.exportLogItem",when:"false"},{command:"github.copilot.chat.debug.exportPromptArchive",when:"false"},{command:"github.copilot.chat.debug.exportPromptLogsAsJson",when:"false"},{command:"github.copilot.chat.debug.exportAllPromptLogsAsJson",when:"false"},{command:"github.copilot.chat.mcp.setup.check",when:"false"},{command:"github.copilot.chat.mcp.setup.validatePackage",when:"false"},{command:"github.copilot.chat.mcp.setup.flow",when:"false"},{command:"github.copilot.chat.debug.showRawRequestBody",when:"false"},{command:"github.copilot.debug.showOutputChannel",when:"false"},{command:"github.copilot.cli.sessions.delete",when:"false"},{command:"github.copilot.cli.sessions.resumeInTerminal",when:"false"},{command:"github.copilot.cli.sessions.rename",when:"false"},{command:"github.copilot.claude.sessions.rename",when:"false"},{command:"github.copilot.cli.sessions.setTitle",when:"false"},{command:"github.copilot.cli.sessions.openRepository",when:"false"},{command:"github.copilot.cli.sessions.openWorktreeInNewWindow",when:"false"},{command:"github.copilot.cli.sessions.openWorktreeInTerminal",when:"false"},{command:"github.copilot.cli.sessions.copyWorktreeBranchName",when:"false"},{command:"github.copilot.cloud.sessions.openInBrowser",when:"false"},{command:"github.copilot.cloud.sessions.proxy.closeChatSessionPullRequest",when:"false"},{command:"github.copilot.cloud.sessions.installPRExtension",when:"false"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"false"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges.apply",when:"false"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.merge",when:"false"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.mergeAndSync",when:"false"},{command:"github.copilot.chat.createPullRequestCopilotCLIAgentSession.createPR",when:"false"},{command:"github.copilot.chat.createDraftPullRequestCopilotCLIAgentSession.createDraftPR",when:"false"},{command:"github.copilot.chat.checkoutPullRequestReroute",when:"false"},{command:"github.copilot.chat.cloudSessions.openRepository",when:"false"},{command:"github.copilot.chat.cloudSessions.createPullRequestForTask",when:"false"},{command:"github.copilot.chat.cloudSessions.openPullRequestForTask",when:"false"},{command:"github.copilot.nes.captureExpected.start",when:"github.copilot.inlineEditsEnabled"},{command:"github.copilot.nes.captureExpected.submit",when:"github.copilot.inlineEditsEnabled"},{command:"github.copilot.sessions.commit",when:"false"},{command:"github.copilot.sessions.commitAndSync",when:"false"},{command:"github.copilot.sessions.sync",when:"false"},{command:"github.copilot.sessions.discardChanges",when:"false"},{command:"github.copilot.sessions.refreshChanges",when:"false"},{command:"github.copilot.sessions.initializeRepository",when:"false"},{command:"github.copilot.claude.sessions.commit",when:"false"},{command:"github.copilot.claude.sessions.commitAndSync",when:"false"},{command:"github.copilot.claude.sessions.sync",when:"false"},{command:"github.copilot.claude.sessions.initializeRepository",when:"false"}],"view/title":[{submenu:"github.copilot.chat.debug.filter",when:"view == copilot-chat",group:"navigation"},{command:"github.copilot.chat.debug.exportAllPromptLogsAsJson",when:"view == copilot-chat",group:"export@1"},{command:"workbench.action.chat.openAgentDebugPanel",when:"view == copilot-chat",group:"3_show@0"},{command:"github.copilot.debug.showOutputChannel",when:"view == copilot-chat",group:"3_show@1"},{command:"github.copilot.debug.showChatLogView",when:"view == workbench.panel.chat.view.copilot",group:"3_show"}],"view/item/context":[{command:"github.copilot.chat.debug.showRawRequestBody",when:"view == copilot-chat && viewItem == request",group:"export@0"},{command:"github.copilot.chat.debug.exportLogItem",when:"view == copilot-chat && (viewItem == toolcall || viewItem == request)",group:"export@1"},{command:"github.copilot.chat.debug.exportPromptArchive",when:"view == copilot-chat && viewItem == chatprompt",group:"export@2"},{command:"github.copilot.chat.debug.exportPromptLogsAsJson",when:"view == copilot-chat && viewItem == chatprompt",group:"export@3"}],"searchPanel/aiResults/commands":[{command:"github.copilot.search.markHelpful",group:"inline@0",when:"aiResultsTitle && aiResultsRequested"},{command:"github.copilot.search.markUnhelpful",group:"inline@1",when:"aiResultsTitle && aiResultsRequested"},{command:"github.copilot.search.feedback",group:"inline@2",when:"aiResultsTitle && aiResultsRequested && github.copilot.debugReportFeedback"}],"comments/comment/title":[{command:"github.copilot.chat.review.markHelpful",group:"inline@0",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.markUnhelpful",group:"inline@1",when:"commentController == github-copilot-review"}],"commentsView/commentThread/context":[{command:"github.copilot.chat.review.apply",group:"context@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discard",group:"context@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discardAll",group:"context@3",when:"commentController == github-copilot-review"}],"comments/commentThread/additionalActions":[{submenu:"copilot/reviewComment/additionalActions/applyAndNext",group:"inline@1",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments > 1"},{command:"github.copilot.chat.review.apply",group:"inline@1",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments == 1"},{submenu:"copilot/reviewComment/additionalActions/discardAndNext",group:"inline@2",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments > 1"},{submenu:"copilot/reviewComment/additionalActions/discard",group:"inline@2",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments == 1"}],"copilot/reviewComment/additionalActions/applyAndNext":[{command:"github.copilot.chat.review.applyAndNext",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.apply",group:"inline@2",when:"commentController == github-copilot-review"}],"copilot/reviewComment/additionalActions/discardAndNext":[{command:"github.copilot.chat.review.discardAndNext",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discard",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInInlineChat",group:"inline@3",when:"commentController == github-copilot-review"}],"copilot/reviewComment/additionalActions/discard":[{command:"github.copilot.chat.review.discard",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInInlineChat",group:"inline@3",when:"commentController == github-copilot-review"}],"comments/commentThread/title":[{command:"github.copilot.chat.review.previous",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.next",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInChat",group:"inline@3",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discardAll",group:"inline@4",when:"commentController == github-copilot-review"}],"scm/title":[{command:"github.copilot.chat.review.changes",group:"navigation",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmProviderRootUri in github.copilot.chat.reviewDiff.enabledRootUris"}],"scm/sourceControl":[{command:"github.copilot.cli.openInCopilotCLI",group:"3_worktree@1",when:"scmProvider == git"}],"scm/resourceGroup/context":[{command:"github.copilot.chat.review.stagedChanges",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == index",group:"inline@-3"},{command:"github.copilot.chat.review.unstagedChanges",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == workingTree",group:"inline@-3"}],"scm/resourceState/context":[{command:"github.copilot.git.resolveMergeConflicts",when:"scmProvider == git && scmResourceGroup == merge && git.activeResourceHasMergeConflicts",group:"z_chat@1"},{command:"github.copilot.chat.review.stagedFileChange",group:"3_copilot",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == index"},{command:"github.copilot.chat.review.unstagedFileChange",group:"3_copilot",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == workingTree"}],"scm/inputBox":[{command:"github.copilot.git.generateCommitMessage",when:"scmProvider == git && chatSetupCompleted"}],"testing/message/context":[{command:"github.copilot.tests.fixTestFailure",when:"testing.testItemHasUri",group:"inline@1"}],"issue/reporter":[{command:"github.copilot.report"}],"github.copilot.chat.debug.filter":[{command:"github.copilot.chat.debug.showElements",when:"github.copilot.chat.debug.elementsHidden",group:"commands@0"},{command:"github.copilot.chat.debug.hideElements",when:"!github.copilot.chat.debug.elementsHidden",group:"commands@0"},{command:"github.copilot.chat.debug.showTools",when:"github.copilot.chat.debug.toolsHidden",group:"commands@1"},{command:"github.copilot.chat.debug.hideTools",when:"!github.copilot.chat.debug.toolsHidden",group:"commands@1"},{command:"github.copilot.chat.debug.showNesRequests",when:"github.copilot.chat.debug.nesRequestsHidden",group:"commands@2"},{command:"github.copilot.chat.debug.hideNesRequests",when:"!github.copilot.chat.debug.nesRequestsHidden",group:"commands@2"},{command:"github.copilot.chat.debug.showGhostRequests",when:"github.copilot.chat.debug.ghostRequestsHidden",group:"commands@3"},{command:"github.copilot.chat.debug.hideGhostRequests",when:"!github.copilot.chat.debug.ghostRequestsHidden",group:"commands@3"}],"notebook/toolbar":[{command:"github.copilot.chat.notebook.enableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && !github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && config.notebook.globalToolbar",group:"navigation/execute@15"},{command:"github.copilot.chat.notebook.disableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && config.notebook.globalToolbar",group:"navigation/execute@15"}],"editor/content":[{command:"github.copilot.git.resolveMergeConflicts",group:"z_chat@1",when:"config.git.enabled && !git.missing && !isInDiffEditor && !isMergeEditor && resource in git.mergeChanges && git.activeResourceHasMergeConflicts && chatSetupCompleted"}],"multiDiffEditor/content":[{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"resourceScheme == copilotcli-worktree-changes && workbenchState != empty && !isSessionsWindow"}],"chat/chatSessions":[{command:"github.copilot.claude.sessions.rename",when:"chatSessionType == claude-code",group:"1_edit@4"},{command:"github.copilot.cli.sessions.delete",when:"chatSessionType == copilotcli",group:"1_edit@10"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli",group:"1_edit@4"},{command:"github.copilot.cli.sessions.openWorktreeInNewWindow",when:"chatSessionType == copilotcli && !isSessionsWindow",group:"2_open@1"},{command:"github.copilot.cli.sessions.openWorktreeInTerminal",when:"chatSessionType == copilotcli",group:"2_open@2"},{command:"github.copilot.cli.sessions.copyWorktreeBranchName",when:"chatSessionType == copilotcli",group:"2_open@3"},{command:"github.copilot.cli.sessions.resumeInTerminal",when:"chatSessionType == copilotcli",group:"2_open@4"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"chatSessionType == copilotcli && workbenchState != empty && !isSessionsWindow",group:"3_apply@0"},{command:"github.copilot.cloud.sessions.openInBrowser",when:"chatSessionType == copilot-cloud-agent",group:"navigation@10"},{command:"github.copilot.cloud.sessions.proxy.closeChatSessionPullRequest",when:"chatSessionType == copilot-cloud-agent",group:"1_edit@10"}],"chatSessions/item/context":[{command:"github.copilot.claude.sessions.rename",when:"chatSessionType == claude-code && chatSessionProviderId == default-copilot",group:"1_edit@4"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli && chatSessionProviderId == default-copilot",group:"1_edit@4"}],"chat/multiDiff/context":[{command:"github.copilot.cloud.sessions.installPRExtension",when:"chatSessionType == copilot-cloud-agent && !github.copilot.prExtensionInstalled",group:"inline@1"}],"chat/input/editing/sessionTitleToolbar":[{command:"github.copilot.sessions.refreshChanges",when:"chatSessionType == copilotcli && isSessionsWindow && !sessions.isAgentHostSession",group:"9_refresh@1"}],"chat/customizations/create":[{command:"copilot.claude.agents",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == agents",group:"navigation@1"},{command:"copilot.claude.hooks",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == hooks",group:"navigation@1"},{command:"copilot.claude.memory",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == instructions",group:"navigation@1"}]},icons:{"copilot-logo":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0041"}},"copilot-warning":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0042"}},"copilot-notconnected":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0043"}}},iconFonts:[{id:"copilot-font",src:[{path:"assets/copilot.woff",format:"woff"}]}],terminalQuickFixes:[{id:"copilot-chat.fixWithCopilot",commandLineMatcher:".+",commandExitResult:"error",outputMatcher:{anchor:"bottom",length:1,lineMatcher:".+",offset:0},kind:"explain"},{id:"copilot-chat.generateCommitMessage",commandLineMatcher:"git add .+",commandExitResult:"success",kind:"explain",outputMatcher:{anchor:"bottom",length:1,lineMatcher:".+",offset:0}},{id:"copilot-chat.terminalToDebugging",commandLineMatcher:".+",kind:"explain",commandExitResult:"error",outputMatcher:{anchor:"bottom",length:1,lineMatcher:"",offset:0}},{id:"copilot-chat.terminalToDebuggingSuccess",commandLineMatcher:".+",kind:"explain",commandExitResult:"success",outputMatcher:{anchor:"bottom",length:1,lineMatcher:"",offset:0}}],languages:[{id:"ignore",filenamePatterns:[".copilotignore"],aliases:[]},{id:"markdown",extensions:[".copilotmd"]}],views:{"copilot-chat":[{id:"copilot-chat",name:"Chat Debug",icon:"assets/debug-icon.svg",when:"github.copilot.chat.showLogView"}],"context-inspector":[{id:"context-inspector",name:"Language Context Inspector",icon:"$(inspect)",when:"github.copilot.chat.showContextInspectorView"}]},viewsContainers:{activitybar:[{id:"copilot-chat",title:"Chat Debug",icon:"assets/debug-icon.svg"},{id:"context-inspector",title:"Language Context Inspector",icon:"$(inspect)"}]},configurationDefaults:{"workbench.editorAssociations":{"*.copilotmd":"vscode.markdown.preview.editor"}},keybindings:[{command:"github.copilot.chat.copilotCLI.addFileReference",key:"ctrl+shift+.",mac:"cmd+shift+.",when:"github.copilot.chat.copilotCLI.hasSession && editorTextFocus"},{command:"github.copilot.chat.rerunWithCopilotDebug",key:"ctrl+alt+.",mac:"cmd+alt+.",when:"github.copilot-chat.activated && terminalShellIntegrationEnabled && terminalFocus && !terminalAltBufferActive"},{command:"github.copilot.nes.captureExpected.confirm",key:"ctrl+enter",mac:"cmd+enter",when:"copilotNesCaptureMode && editorTextFocus"},{command:"github.copilot.nes.captureExpected.abort",key:"escape",when:"copilotNesCaptureMode && editorTextFocus"}],walkthroughs:[{id:"copilotWelcome",title:"%github.copilot.walkthrough.title%",description:"%github.copilot.walkthrough.description%",when:"!isWeb",steps:[{id:"copilot.setup.signIn",title:"%github.copilot.walkthrough.setup.signIn.title%",description:"%github.copilot.walkthrough.setup.signIn.description%",when:"chatEntitlementSignedOut && !view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && !github.copilot.interactiveSession.individual.disabled && !github.copilot.interactiveSession.individual.expired && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signInNoAction",title:"%github.copilot.walkthrough.setup.signIn.title%",description:"%github.copilot.walkthrough.setup.noAction.description%",when:"chatEntitlementSignedOut && view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && !github.copilot.interactiveSession.individual.disabled && !github.copilot.interactiveSession.individual.expired && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signUp",title:"%github.copilot.walkthrough.setup.signUp.title%",description:"%github.copilot.walkthrough.setup.signUp.description%",when:"chatPlanCanSignUp && !view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && (github.copilot.interactiveSession.individual.disabled || github.copilot.interactiveSession.individual.expired) && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signUpNoAction",title:"%github.copilot.walkthrough.setup.signUp.title%",description:"%github.copilot.walkthrough.setup.noAction.description%",when:"chatPlanCanSignUp && view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && (github.copilot.interactiveSession.individual.disabled || github.copilot.interactiveSession.individual.expired) && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.panelChat",title:"%github.copilot.walkthrough.panelChat.title%",description:"%github.copilot.walkthrough.panelChat.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.edits",title:"%github.copilot.walkthrough.edits.title%",description:"%github.copilot.walkthrough.edits.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-hclight.mp4"},altText:"%github.copilot.walkthrough.edits.media.altText%"}},{id:"copilot.firstSuggest",title:"%github.copilot.walkthrough.firstSuggest.title%",description:"%github.copilot.walkthrough.firstSuggest.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-hclight.mp4"},altText:"%github.copilot.walkthrough.firstSuggest.media.altText%"}},{id:"copilot.inlineChatNotMac",title:"%github.copilot.walkthrough.inlineChatNotMac.title%",description:"%github.copilot.walkthrough.inlineChatNotMac.description%",when:"!isMac && (!chatEntitlementSignedOut || chatIsEnabled )",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hclight.mp4"},altText:"%github.copilot.walkthrough.inlineChatNotMac.media.altText%"}},{id:"copilot.inlineChatMac",title:"%github.copilot.walkthrough.inlineChatMac.title%",description:"%github.copilot.walkthrough.inlineChatMac.description%",when:"isMac && (!chatEntitlementSignedOut || chatIsEnabled )",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hclight.mp4"},altText:"%github.copilot.walkthrough.inlineChatMac.media.altText%"}},{id:"copilot.sparkle",title:"%github.copilot.walkthrough.sparkle.title%",description:"%github.copilot.walkthrough.sparkle.description%",when:"!chatEntitlementSignedOut || chatIsEnabled",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-hclight.mp4"},altText:"%github.copilot.walkthrough.sparkle.media.altText%"}}]}],jsonValidation:[{fileMatch:"settings.json",url:"ccsettings://root/schema.json"}],typescriptServerPlugins:[{name:"@vscode/copilot-typescript-server-plugin",enableForWorkspaceTypeScriptVersions:!0}],chatSessions:[{type:"claude-code",name:"claude",displayName:"Claude",icon:"$(claude)",welcomeTitle:"Claude Agent",welcomeMessage:"Powered by the same agent as Claude Code",inputPlaceholder:"Run local tasks with Claude, type `#` for adding context",order:3,description:"%github.copilot.session.providerDescription.claude%",when:"config.github.copilot.chat.claudeAgent.enabled && ((isSessionsWindow && !config.chat.agents.claude.preferAgentHost) || (!isSessionsWindow && !config.chat.editor.claude.preferAgentHost))",canDelegate:!0,requiresCustomModels:!0,supportsAutoModel:!1,capabilities:{supportsFileAttachments:!0,supportsImageAttachments:!0},commands:[{name:"init",description:"Initialize a new CLAUDE.md file with codebase documentation"},{name:"pr-comments",description:"Get comments from a GitHub pull request"},{name:"review",description:"Review a pull request"},{name:"security-review",description:"Complete a security review of the pending changes on the current branch"},{name:"simplify",description:"Review changed code for reuse, quality, and efficiency"},{name:"claude-api",description:"Help building with Claude API or Anthropic SDK"},{name:"agents",description:"Create and manage specialized Claude agents"},{name:"hooks",description:"Configure Claude Code hooks for tool execution and events"},{name:"memory",description:"Open memory files (CLAUDE.md) for editing"},{name:"compact",description:"Compact the conversation history to save context tokens"}]},{type:"copilotcli",name:"cli",displayName:"Copilot CLI",icon:"$(copilot)",welcomeTitle:"Copilot CLI",welcomeMessage:"Run tasks in the background with the Copilot CLI",inputPlaceholder:"Run tasks in the background with the Copilot CLI, type `#` for adding context",order:1,canDelegate:!0,description:"%github.copilot.session.providerDescription.background%",when:"config.github.copilot.chat.backgroundAgent.enabled",supportsAutoModel:!0,capabilities:{supportsFileAttachments:!0,supportsProblemAttachments:!0,supportsToolAttachments:!1,supportsImageAttachments:!0,supportsSymbolAttachments:!0,supportsSearchResultAttachments:!0,supportsSourceControlAttachments:!0,supportsPromptAttachments:!0,supportsHandOffs:!0},commands:[{name:"delegate",description:"Delegate chat session to cloud agent and create associated PR",when:"config.github.copilot.chat.cloudAgent.enabled"},{name:"compact",description:"%github.copilot.command.cli.compact.description%"},{name:"plan",description:"%github.copilot.command.cli.plan.description%",when:"config.github.copilot.chat.cli.planCommand.enabled"},{name:"fleet",description:"%github.copilot.command.cli.fleet.description%",when:"false"},{name:"remote",description:"%github.copilot.command.cli.remote.description%",when:"config.github.copilot.chat.cli.remote.enabled"}],customAgentTarget:"github-copilot",requiresCustomModels:!0,autoAttachReferences:!0,useRequestToPopulateBuiltInPickers:!0},{type:"copilot-cloud-agent",alternativeIds:["copilot-swe-agent"],name:"cloud",displayName:"Cloud",icon:"$(cloud)",welcomeTitle:"Cloud Agent",welcomeMessage:"Delegate tasks to the cloud",inputPlaceholder:"Delegate tasks to the cloud, type `#` for adding context",order:2,canDelegate:!0,description:"%github.copilot.session.providerDescription.cloud%",when:"config.github.copilot.chat.cloudAgent.enabled",supportsAutoModel:!1,capabilities:{supportsFileAttachments:!0},autoAttachReferences:!0}],chatAgents:[],chatPromptFiles:[{path:"./assets/prompts/plan.prompt.md",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-standup.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-tips.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-cost-tips.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-improve.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-reindex.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-search.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]}],chatSkills:[{path:"./assets/prompts/skills/project-setup-info-local/SKILL.md",when:"!config.github.copilot.chat.newWorkspace.useContext7",sessionTypes:["local"]},{path:"./assets/prompts/skills/project-setup-info-context7/SKILL.md",when:"config.github.copilot.chat.newWorkspace.useContext7",sessionTypes:["local"]},{path:"./assets/prompts/skills/install-vscode-extension/SKILL.md",when:"config.github.copilot.chat.installExtensionSkill.enabled && config.github.copilot.chat.newWorkspaceCreation.enabled",sessionTypes:["local"]},{path:"./assets/prompts/skills/get-search-view-results/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/troubleshoot/SKILL.md",sessionTypes:["local","copilotcli"]},{path:"./assets/prompts/skills/agent-customization/SKILL.md",sessionTypes:["local","copilotcli"]},{path:"./assets/prompts/skills/init/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-prompt/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-instructions/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-skill/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-agent/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-hook/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/chronicle/SKILL.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]}],terminal:{profiles:[{icon:"copilot",id:"copilot-cli",title:"GitHub Copilot CLI",titleTemplate:"${sequence}"}]}},prettier:{useTabs:!0,tabWidth:4,singleQuote:!0},scripts:{postinstall:"tsx ./script/postinstall.ts",build:"node .esbuild.mts --sourcemaps",compile:"node .esbuild.mts --dev",watch:"npm-run-all -lp watch:esbuild watch:typecheck","watch:esbuild":"node .esbuild.mts --watch --dev","watch:typecheck":"npx tsgo --noEmit --watch --preserveWatchOutput --project tsconfig.json","watch:typecheck-extension":"npx tsgo --noEmit --watch --project tsconfig.json","watch:typecheck-extension-web":"npx tsgo --noEmit --watch --project tsconfig.worker.json","watch:typecheck-simulation-workbench":"npx tsgo --noEmit --watch --project test/simulation/workbench/tsconfig.json",typecheck:"npx tsgo --noEmit --project tsconfig.json && npx tsgo --noEmit --project test/simulation/workbench/tsconfig.json && npx tsgo --noEmit --project tsconfig.worker.json && npx tsgo --noEmit --project src/extension/completions-core/vscode-node/extension/src/copilotPanel/webView/tsconfig.json",lint:"npx eslint . --max-warnings=0","lint-staged":"npx eslint --max-warnings=0",tsfmt:"npx tsfmt -r --verify",test:"npm-run-all test:*","test:extension":"vscode-test","test:sanity":"vscode-test --sanity","test:unit":"vitest --run --pool=forks",vitest:"vitest",bench:"vitest bench",get_env:"tsx script/setup/getEnv.mts",get_token:"tsx script/setup/getToken.mts",prettier:"prettier --list-different --write --cache .",simulate:"node dist/simulationMain.js","simulate-require-cache":"node dist/simulationMain.js --require-cache","simulate-ci":"node dist/simulationMain.js --ci --require-cache","simulate-update-baseline":"node dist/simulationMain.js --update-baseline","simulate-gc":"node dist/simulationMain.js --require-cache --gc",setup:"npm run get_env && npm run get_token","setup:dotnet":"run-script-os","setup:dotnet:darwin:linux":"curl -O https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.sh && chmod u+x dotnet-install.sh && ./dotnet-install.sh --channel 10.0 && rm dotnet-install.sh","setup:dotnet:win32":'powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Invoke-WebRequest -Uri https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.ps1 -OutFile dotnet-install.ps1; ./dotnet-install.ps1 -channel 10.0; Remove-Item dotnet-install.ps1"',"analyze-edits":"tsx script/analyzeEdits.ts","extract-chat-lib":"tsx script/build/extractChatLib.ts",create_venv:"tsx script/setup/createVenv.mts",package:"vsce package",web:"vscode-test-web --headless --extensionDevelopmentPath=. .","test:prompt":'mocha "src/extension/completions-core/vscode-node/prompt/**/test/**/*.test.{ts,tsx}"',"test:completions-core":"tsx src/extension/completions-core/vscode-node/extension/test/runTest.ts"},devDependencies:{"@azure/identity":"4.9.1","@azure/keyvault-secrets":"^4.10.0","@azure/msal-node":"^3.6.3","@c4312/scip":"^0.1.0","@fluentui/react-components":"^9.66.6","@fluentui/react-icons":"^2.0.305","@hediet/node-reload":"^0.8.0","@octokit/types":"^14.1.0","@stylistic/eslint-plugin":"^3.0.1","@types/eslint":"^9.0.0","@types/express":"^5.0.6","@types/google-protobuf":"^3.15.12","@types/js-yaml":"^4.0.9","@types/markdown-it":"^14.0.0","@types/minimist":"^1.2.5","@types/mocha":"^10.0.10","@types/node":"^22.16.3","@types/picomatch":"^4.0.0","@types/react":"17.0.44","@types/react-dom":"^18.2.17","@types/sinon":"^17.0.4","@types/source-map-support":"^0.5.10","@types/tar":"^6.1.13","@types/vinyl":"^2.0.12","@types/vscode-webview":"^1.57.5","@types/ws":"^8.5.3","@types/yargs":"^17.0.24","@typescript-eslint/eslint-plugin":"^8.35.0","@typescript-eslint/parser":"^8.32.0","@typescript-eslint/typescript-estree":"^8.26.1","@typescript/native-preview":"^7.0.0-dev.20260429","@vitest/coverage-v8":"^4.1.8","@vitest/snapshot":"^1.5.0","@vscode/debugadapter":"^1.68.0","@vscode/debugprotocol":"^1.68.0","@vscode/dts":"^0.4.1","@vscode/lsif-language-service":"^0.1.0-pre.4","@vscode/test-cli":"^0.0.11","@vscode/test-electron":"^2.5.2","@vscode/test-web":"^0.0.80","@vscode/vsce":"3.6.0",copyfiles:"^2.4.1","csv-parse":"^6.0.0",dotenv:"^17.2.0",electron:"^39.8.5",esbuild:"0.28.1",fastq:"^1.19.1",glob:"^11.1.0","js-yaml":"^4.1.1",minimist:"^1.2.8",mobx:"^6.13.7","mobx-react-lite":"^4.1.0",mocha:"^11.7.1","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","monaco-editor":"0.44.0","npm-run-all":"^4.1.5",open:"^10.1.2",openai:"^6.7.0",outdent:"^0.8.0",picomatch:"^4.0.4",playwright:"^1.58.2",prettier:"^3.6.2",react:"^17.0.2","react-dom":"17.0.2",rimraf:"^6.0.1","run-script-os":"^1.1.6",shiki:"~1.15.0",sinon:"^21.0.0","source-map-support":"^0.5.21",tar:"^7.5.16","ts-dedent":"^2.2.0",tsx:"^4.22.4",typescript:"^5.8.3","vite-plugin-wasm":"^3.6.0",vitest:"^4.1.8","vscode-languageserver-protocol":"^3.17.5","vscode-languageserver-textdocument":"^1.0.12","vscode-languageserver-types":"^3.17.5",yaml:"^2.8.0",yargs:"^17.7.2",zod:"3.25.76"},dependencies:{"@anthropic-ai/claude-agent-sdk":"0.2.112","@anthropic-ai/sdk":"^0.82.0","@github/blackbird-external-ingest-utils":"^0.3.0","@github/copilot":"^1.0.64-0","@google/genai":"^1.22.0","@humanwhocodes/gitignore-to-minimatch":"1.0.2","@microsoft/tiktokenizer":"^1.0.10","@modelcontextprotocol/sdk":"^1.25.2","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.212.0","@opentelemetry/exporter-logs-otlp-grpc":"^0.214.0","@opentelemetry/exporter-logs-otlp-http":"^0.214.0","@opentelemetry/exporter-metrics-otlp-grpc":"^0.214.0","@opentelemetry/exporter-metrics-otlp-http":"^0.214.0","@opentelemetry/exporter-trace-otlp-grpc":"^0.214.0","@opentelemetry/exporter-trace-otlp-http":"^0.214.0","@opentelemetry/resources":"^2.5.1","@opentelemetry/sdk-logs":"^0.212.0","@opentelemetry/sdk-metrics":"^2.5.1","@opentelemetry/sdk-trace-node":"^2.5.1","@opentelemetry/semantic-conventions":"^1.39.0","@sinclair/typebox":"^0.34.41","@vscode/copilot-api":"^0.4.3","@vscode/extension-telemetry":"^1.5.1","@vscode/l10n":"^0.0.18","@vscode/prompt-tsx":"^0.4.0-alpha.8","@vscode/tree-sitter-wasm":"0.0.5-php.2","@vscode/webview-ui-toolkit":"^1.3.1","@xterm/headless":"^5.5.0",ajv:"^8.18.0",applicationinsights:"^2.9.7","best-effort-json-parser":"^1.2.1",diff:"^8.0.3",express:"^5.2.1",ignore:"^7.0.5",isbinaryfile:"^5.0.4","jsonc-parser":"^3.3.1","lru-cache":"^11.1.0","markdown-it":"^14.1.1",minimatch:"^10.2.1",undici:"^7.24.1","vscode-tas-client":"^0.1.84","web-tree-sitter":"^0.23.0"},overrides:{string_decoder:"npm:string_decoder@1.2.0",zod:"3.25.76"},vscodeCommit:"94c8e2adc50e26ef70af85a0de3a9efed757acaa",__metadata:{id:"7ec7d6e6-b89e-4cc5-a59b-d6c4d238246f",publisherId:{publisherId:"7c1c19cd-78eb-4dfb-8999-99caf7679002",publisherName:"github",displayName:"GitHub",flags:"verified"},publisherDisplayName:"GitHub"}}});var c5e=I(Vb=>{"use strict";p();Object.defineProperty(Vb,"__esModule",{value:!0});Vb.vscodeEngineVersion=Vb.isPreRelease=Vb.isProduction=Vb.packageJson=void 0;Vb.packageJson=gTi();Vb.isProduction=Vb.packageJson.buildType!=="dev";Vb.isPreRelease=Vb.packageJson.isPreRelease||!Vb.isProduction;Vb.vscodeEngineVersion=Vb.packageJson.engines.vscode});var U4=I(Wb=>{"use strict";p();Object.defineProperty(Wb,"__esModule",{value:!0});Wb.isScenarioAutomation=Wb.AbstractEnvService=Wb.INativeEnvService=Wb.IEnvService=Wb.NameAndVersion=Wb.OperatingSystem=void 0;var yTi=nn(),ETi=owe(),Tge=c5e(),ATi;(function(t){t.Windows="Windows",t.Macintosh="Mac",t.Linux="Linux"})(ATi||(Wb.OperatingSystem=ATi={}));var xvr=class{static{a(this,"NameAndVersion")}constructor(e,r){this.name=e,this.version=r}format(){return`${this.name}/${this.version}`}};Wb.NameAndVersion=xvr;Wb.IEnvService=(0,yTi.createServiceIdentifier)("IEnvService");Wb.INativeEnvService=(0,yTi.createServiceIdentifier)("INativeEnvService");var wvr=class{static{a(this,"AbstractEnvService")}isProduction(){return Tge.isProduction}isPreRelease(){return Tge.isPreRelease}isSimulation(){return ETi.env.SIMULATION==="1"}getBuildType(){return Tge.packageJson.buildType}getVersion(){return Tge.packageJson.version}getBuild(){return Tge.packageJson.build}getName(){return Tge.packageJson.name}getEditorVersionHeaders(){return{"Editor-Version":this.getEditorInfo().format(),"Editor-Plugin-Version":this.getEditorPluginInfo().format()}}};Wb.AbstractEnvService=wvr;Wb.isScenarioAutomation=ETi.env.IS_SCENARIO_AUTOMATION==="1"});var T0=I(gte=>{"use strict";p();Object.defineProperty(gte,"__esModule",{value:!0});gte.generateUuid=void 0;gte.isUUID=HRa;gte.prefixedUuid=GRa;var jRa=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function HRa(t){return jRa.test(t)}a(HRa,"isUUID");gte.generateUuid=(function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let t=new Uint8Array(16),e=[];for(let r=0;r<256;r++)e.push(r.toString(16).padStart(2,"0"));return a(function(){crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=0,o="";return o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o},"generateUuid")})();function GRa(t){return`${t}-${(0,gte.generateUuid)()}`}a(GRa,"prefixedUuid")});var _Ti=I(R0t=>{"use strict";p();Object.defineProperty(R0t,"__esModule",{value:!0});R0t.CopilotConfigPrefix=void 0;R0t.CopilotConfigPrefix="github.copilot"});var kvr=I(cD=>{"use strict";p();var $Ra=cD&&cD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),VRa=cD&&cD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),WRa=cD&&cD.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o(n&&(r=r.bind(n)),t(a(c=>{let l=e(c);l!==void 0&&r(l)},"wrappedListener"),void 0,o))}a(YRa,"transformEvent")});var LE=I(hn=>{"use strict";p();Object.defineProperty(hn,"__esModule",{value:!0});hn.apiVersion=hn.ICompletionsEditorAndPluginInfo=hn.BuildInfo=hn.InMemoryConfigProvider=hn.DefaultsOnlyConfigProvider=hn.ConfigProvider=hn.ICompletionsConfigProvider=hn.BuildType=hn.BlockMode=hn.ConfigKey=hn.packageJson=void 0;hn.shouldDoServerTrimming=ZRa;hn.getConfigKeyRecursively=XRa;hn.getConfigDefaultForKey=CTi;hn.getOptionalConfigDefaultForKey=bTi;hn.getConfig=eka;hn.dumpForTelemetry=tka;hn.formatNameAndVersion=Mvr;hn.editorVersionHeaders=rka;var k0t=c5e();Object.defineProperty(hn,"packageJson",{enumerable:!0,get:a(function(){return k0t.packageJson},"get")});var vTi=nn(),KRa=_Ti(),JRa=kvr();hn.ConfigKey={Enable:"enable",UserSelectedCompletionModel:"selectedCompletionModel",ShowEditorCompletions:"editor.showEditorCompletions",EnableAutoCompletions:"editor.enableAutoCompletions",DelayCompletions:"editor.delayCompletions",FilterCompletions:"editor.filterCompletions",CompletionsDelay:"completionsDelay",CompletionsDebounce:"completionsDebounce",RelatedFilesVSCodeCSharp:"advanced.relatedFilesVSCodeCSharp",RelatedFilesVSCodeTypeScript:"advanced.relatedFilesVSCodeTypeScript",RelatedFilesVSCode:"advanced.relatedFilesVSCode",ContextProviders:"advanced.contextProviders",DebugFilterLogCategories:"advanced.debug.filterLogCategories",DebugSnippyOverrideUrl:"advanced.debug.codeRefOverrideUrl",UseSubsetMatching:"advanced.useSubsetMatching",ContextProviderTimeBudget:"advanced.contextProviderTimeBudget",DebugOverrideCapiUrl:"internal.capiUrl",DebugOverrideCapiUrlLegacy:"advanced.debug.overrideCapiUrl",DebugTestOverrideCapiUrl:"internal.capiTestUrl",DebugTestOverrideCapiUrlLegacy:"advanced.debug.testOverrideCapiUrl",DebugOverrideProxyUrl:"internal.completionsUrl",DebugOverrideProxyUrlLegacy:"advanced.debug.overrideProxyUrl",DebugTestOverrideProxyUrl:"internal.completionsTestUrl",DebugTestOverrideProxyUrlLegacy:"advanced.debug.testOverrideProxyUrl",DebugOverrideEngine:"internal.completionModel",DebugOverrideEngineLegacy:"advanced.debug.overrideEngine",AlwaysRequestMultiline:"internal.alwaysRequestMultiline",ModelAlwaysTerminatesSingleline:"internal.modelAlwaysTerminatesSingleline",UseWorkspaceContextCoordinator:"internal.useWorkspaceContextCoordinator",IncludeNeighboringFiles:"internal.includeNeighboringFiles",ExcludeRelatedFiles:"internal.excludeRelatedFiles",DebugOverrideCppHeadersEnableSwitch:"internal.cppHeadersEnableSwitch",UseSplitContextPrompt:"internal.useSplitContextPrompt"};var P0t;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(P0t||(hn.BlockMode=P0t={}));function ZRa(t){return[P0t.Server,P0t.ParsingAndServer].includes(t)}a(ZRa,"shouldDoServerTrimming");var Ate;(function(t){t.DEV="dev",t.PROD="prod",t.NIGHTLY="nightly"})(Ate||(hn.BuildType=Ate={}));hn.ICompletionsConfigProvider=(0,vTi.createServiceIdentifier)("ICompletionsConfigProvider");var l5e=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}};hn.ConfigProvider=l5e;var Pvr=class extends l5e{static{a(this,"DefaultsOnlyConfigProvider")}constructor(){super(...arguments),this.onDidChangeCopilotSettings=()=>({dispose:a(()=>{},"dispose")})}getConfig(e){return CTi(e)}getOptionalConfig(e){return bTi(e)}dumpForTelemetry(){return{}}};hn.DefaultsOnlyConfigProvider=Pvr;var Dvr=class extends l5e{static{a(this,"InMemoryConfigProvider")}constructor(e){super(),this.baseConfigProvider=e,this.copilotEmitter=new JRa.Emitter,this.onDidChangeCopilotSettings=this.copilotEmitter.event,this.overrides=new Map}setOverrides(e){this.overrides=e}clearOverrides(){this.overrides.clear()}getOptionalOverride(e){return this.overrides.get(e)}getConfig(e){return this.getOptionalOverride(e)??this.baseConfigProvider.getConfig(e)}getOptionalConfig(e){return this.getOptionalOverride(e)??this.baseConfigProvider.getOptionalConfig(e)}setConfig(e,r){this.setCopilotSettings({[e]:r})}setCopilotSettings(e){for(let[r,n]of Object.entries(e))n!==void 0?this.overrides.set(r,n):this.overrides.delete(r);this.copilotEmitter.fire(this)}dumpForTelemetry(){let e=this.baseConfigProvider.dumpForTelemetry();for(let r of[hn.ConfigKey.ShowEditorCompletions,hn.ConfigKey.EnableAutoCompletions,hn.ConfigKey.DelayCompletions,hn.ConfigKey.FilterCompletions]){let n=this.overrides.get(r);n!==void 0&&(e[r]=JSON.stringify(n))}return e}};hn.InMemoryConfigProvider=Dvr;function XRa(t,e){let r=t,n=[];for(let o of e.split(".")){let s=[...n,o].join(".");r&&typeof r=="object"&&s in r?(r=r[s],n.length=0):n.push(o)}if(!(r===void 0||n.length>0))return r}a(XRa,"getConfigKeyRecursively");function CTi(t){if(Nvr.has(t))return Nvr.get(t);throw new Error(`Missing config default value: ${KRa.CopilotConfigPrefix}.${t}`)}a(CTi,"getConfigDefaultForKey");function bTi(t){return Nvr.get(t)}a(bTi,"getOptionalConfigDefaultForKey");var Nvr=new Map([[hn.ConfigKey.DebugOverrideCppHeadersEnableSwitch,!1],[hn.ConfigKey.RelatedFilesVSCodeCSharp,!1],[hn.ConfigKey.RelatedFilesVSCodeTypeScript,!1],[hn.ConfigKey.RelatedFilesVSCode,!1],[hn.ConfigKey.IncludeNeighboringFiles,!1],[hn.ConfigKey.ExcludeRelatedFiles,!1],[hn.ConfigKey.ContextProviders,[]],[hn.ConfigKey.DebugSnippyOverrideUrl,""],[hn.ConfigKey.UseSubsetMatching,null],[hn.ConfigKey.ContextProviderTimeBudget,void 0],[hn.ConfigKey.DebugOverrideCapiUrl,""],[hn.ConfigKey.DebugTestOverrideCapiUrl,""],[hn.ConfigKey.DebugOverrideProxyUrl,""],[hn.ConfigKey.DebugTestOverrideProxyUrl,""],[hn.ConfigKey.DebugOverrideEngine,""],[hn.ConfigKey.AlwaysRequestMultiline,void 0],[hn.ConfigKey.CompletionsDebounce,void 0],[hn.ConfigKey.CompletionsDelay,void 0],[hn.ConfigKey.ModelAlwaysTerminatesSingleline,void 0],[hn.ConfigKey.UseWorkspaceContextCoordinator,void 0],[hn.ConfigKey.ShowEditorCompletions,void 0],[hn.ConfigKey.EnableAutoCompletions,void 0],[hn.ConfigKey.DelayCompletions,void 0],[hn.ConfigKey.FilterCompletions,void 0],[hn.ConfigKey.UseSplitContextPrompt,!0],[hn.ConfigKey.Enable,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}],[hn.ConfigKey.UserSelectedCompletionModel,""],[hn.ConfigKey.DebugOverrideEngineLegacy,""],[hn.ConfigKey.DebugOverrideProxyUrlLegacy,""],[hn.ConfigKey.DebugTestOverrideProxyUrlLegacy,""],[hn.ConfigKey.DebugOverrideCapiUrlLegacy,""],[hn.ConfigKey.DebugTestOverrideCapiUrlLegacy,""],[hn.ConfigKey.DebugFilterLogCategories,[]]]);function eka(t,e){return t.get(hn.ICompletionsConfigProvider).getConfig(e)}a(eka,"getConfig");function tka(t){try{return t.get(hn.ICompletionsConfigProvider).dumpForTelemetry()}catch(e){return console.error(`Error dumping config for telemetry: ${e}`),{}}}a(tka,"dumpForTelemetry");var D0t=class t{static{a(this,"BuildInfo")}static isPreRelease(){return this.getBuildType()===Ate.NIGHTLY}static isProduction(){return this.getBuildType()!==Ate.DEV}static getBuildType(){return k0t.packageJson.buildType==="prod"?t.getVersion().length===15?Ate.NIGHTLY:Ate.PROD:Ate.DEV}static getVersion(){return k0t.packageJson.version}static getBuild(){return k0t.packageJson.build}};hn.BuildInfo=D0t;function Mvr({name:t,version:e}){return`${t}/${e}`}a(Mvr,"formatNameAndVersion");hn.ICompletionsEditorAndPluginInfo=(0,vTi.createServiceIdentifier)("ICompletionsEditorAndPluginInfo");hn.apiVersion="2025-05-01";function rka(t){let e=t.get(hn.ICompletionsEditorAndPluginInfo);return{"Editor-Version":Mvr(e.getEditorInfo()),"Editor-Plugin-Version":Mvr(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":D0t.getVersion()}}a(rka,"editorVersionHeaders")});var Ovr=I(N0t=>{"use strict";p();Object.defineProperty(N0t,"__esModule",{value:!0});N0t.ExpServiceTelemetryNames=void 0;var STi;(function(t){t.featuresTelemetryPropertyName="VSCode.ABExp.Features"})(STi||(N0t.ExpServiceTelemetryNames=STi={}))});var M0t=I(Ige=>{"use strict";p();Object.defineProperty(Ige,"__esModule",{value:!0});Ige.ExpConfig=Ige.ExpTreatmentVariables=void 0;var nka=$g(),ika=Ovr(),TTi;(function(t){t.CustomEngine="copilotcustomengine",t.CustomEngineTargetEngine="copilotcustomenginetargetengine",t.OverrideBlockMode="copilotoverrideblockmode",t.SuffixPercent="CopilotSuffixPercent",t.CppHeadersEnableSwitch="copilotcppheadersenableswitch",t.UseSubsetMatching="copilotsubsetmatching",t.SuffixMatchThreshold="copilotsuffixmatchthreshold",t.MaxPromptCompletionTokens="maxpromptcompletionTokens",t.StableContextPercent="copilotstablecontextpercent",t.VolatileContextPercent="copilotvolatilecontextpercent",t.RelatedFilesVSCodeCSharp="copilotrelatedfilesvscodecsharp",t.RelatedFilesVSCodeTypeScript="copilotrelatedfilesvscodetypescript",t.RelatedFilesVSCode="copilotrelatedfilesvscode",t.ContextProviders="copilotcontextproviders",t.IncludeNeighboringFiles="copilotincludeneighboringfiles",t.ExcludeRelatedFiles="copilotexcluderelatedfiles",t.ContextProviderTimeBudget="copilotcontextprovidertimebudget",t.CppContextProviderParams="copilotcppContextProviderParams",t.CSharpContextProviderParams="copilotcsharpcontextproviderparams",t.JavaContextProviderParams="copilotjavacontextproviderparams",t.MultiLanguageContextProviderParams="copilotmultilanguagecontextproviderparams",t.TsContextProviderParams="copilottscontextproviderparams",t.CompletionsDebounce="copilotcompletionsdebounce",t.ElectronFetcher="copilotelectronfetcher",t.FetchFetcher="copilotfetchfetcher",t.AsyncCompletionsTimeout="copilotasynccompletionstimeout",t.EnablePromptContextProxyField="copilotenablepromptcontextproxyfield",t.ProgressiveReveal="copilotprogressivereveal",t.ModelAlwaysTerminatesSingleline="copilotmodelterminatesingleline",t.ProgressiveRevealLongLookaheadSize="copilotprogressivereveallonglookaheadsize",t.ProgressiveRevealShortLookaheadSize="copilotprogressiverevealshortlookaheadsize",t.MaxMultilineTokens="copilotmaxmultilinetokens",t.MultilineAfterAcceptLines="copilotmultilineafteracceptlines",t.CompletionsDelay="copilotcompletionsdelay",t.SingleLineUnlessAccepted="copilotsinglelineunlessaccepted"})(TTi||(Ige.ExpTreatmentVariables=TTi={}));var Lvr=class t{static{a(this,"ExpConfig")}constructor(e,r){this.variables=e,this.features=r}static createFallbackConfig(e,r){return(0,nka.telemetryExpProblem)(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"")}addToTelemetry(e){e.properties[ika.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features}};Ige.ExpConfig=Lvr});var fy=I(O0t=>{"use strict";p();Object.defineProperty(O0t,"__esModule",{value:!0});O0t.ICompletionsFeaturesService=void 0;var oka=nn();O0t.ICompletionsFeaturesService=(0,oka.createServiceIdentifier)("ICompletionsFeaturesService")});var L0t=I(wG=>{"use strict";p();Object.defineProperty(wG,"__esModule",{value:!0});wG.FilterSettings=wG.Release=wG.Filter=void 0;var yte;(function(t){t.ExtensionRelease="X-VSCode-ExtensionRelease",t.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",t.CopilotEngine="X-Copilot-Engine",t.CopilotOverrideEngine="X-Copilot-OverrideEngine",t.CopilotRepository="X-Copilot-Repository",t.CopilotFileType="X-Copilot-FileType",t.CopilotUserKind="X-Copilot-UserKind",t.CopilotDogfood="X-Copilot-Dogfood",t.CopilotCustomModel="X-Copilot-CustomModel",t.CopilotOrgs="X-Copilot-Orgs",t.CopilotCustomModelNames="X-Copilot-CustomModelNames",t.CopilotTrackingId="X-Copilot-CopilotTrackingId",t.CopilotClientVersion="X-Copilot-ClientVersion",t.CopilotRelatedPluginVersionCppTools="X-Copilot-RelatedPluginVersion-msvscodecpptools",t.CopilotRelatedPluginVersionCMakeTools="X-Copilot-RelatedPluginVersion-msvscodecmaketools",t.CopilotRelatedPluginVersionMakefileTools="X-Copilot-RelatedPluginVersion-msvscodemakefiletools",t.CopilotRelatedPluginVersionCSharpDevKit="X-Copilot-RelatedPluginVersion-msdotnettoolscsdevkit",t.CopilotRelatedPluginVersionPython="X-Copilot-RelatedPluginVersion-mspythonpython",t.CopilotRelatedPluginVersionPylance="X-Copilot-RelatedPluginVersion-mspythonvscodepylance",t.CopilotRelatedPluginVersionJavaPack="X-Copilot-RelatedPluginVersion-vscjavavscodejavapack",t.CopilotRelatedPluginVersionJavaManager="X-Copilot-RelatedPluginVersion-vscjavavscodejavadependency",t.CopilotRelatedPluginVersionTypescript="X-Copilot-RelatedPluginVersion-vscodetypescriptlanguagefeatures",t.CopilotRelatedPluginVersionTypescriptNext="X-Copilot-RelatedPluginVersion-msvscodevscodetypescriptnext",t.CopilotRelatedPluginVersionCSharp="X-Copilot-RelatedPluginVersion-msdotnettoolscsharp",t.CopilotRelatedPluginVersionGithubCopilotChat="X-Copilot-RelatedPluginVersion-githubcopilotchat",t.CopilotRelatedPluginVersionGithubCopilot="X-Copilot-RelatedPluginVersion-githubcopilot"})(yte||(wG.Filter=yte={}));var ITi;(function(t){t.Stable="stable",t.Nightly="nightly"})(ITi||(wG.Release=ITi={}));var ska={[yte.CopilotClientTimeBucket]:"timeBucket",[yte.CopilotOverrideEngine]:"engine",[yte.CopilotRepository]:"repo",[yte.CopilotFileType]:"fileType",[yte.CopilotUserKind]:"userKind"},Bvr=class{static{a(this,"FilterSettings")}constructor(e){this.filters=e;for(let[r,n]of Object.entries(this.filters))n===""&&delete this.filters[r]}addToTelemetry(e){for(let[r,n]of Object.entries(this.filters)){let o=ska[r];o!==void 0&&(e.properties[o]=n)}}toHeaders(){return{...this.filters}}};wG.FilterSettings=Bvr});var RTi=I(xge=>{"use strict";p();Object.defineProperty(xge,"__esModule",{value:!0});xge.JointCompletionsProviderTriggerChangeStrategy=xge.JointCompletionsProviderStrategy=void 0;var xTi;(function(t){t.Regular="regular",t.CursorEndOfLine="cursorEndOfLine"})(xTi||(xge.JointCompletionsProviderStrategy=xTi={}));var wTi;(function(t){t.NoTriggerOnRequestInFlight="noTriggerOnRequestInFlight",t.NoTriggerOnCompletionsRequestInFlight="noTriggerOnCompletionsRequestInFlight",t.AlwaysTrigger="alwaysTrigger"})(wTi||(xge.JointCompletionsProviderTriggerChangeStrategy=wTi={}))});var RG=I(I0=>{"use strict";p();Object.defineProperty(I0,"__esModule",{value:!0});I0.vString=cka;I0.vNumber=uka;I0.vBoolean=fka;I0.vObjAny=hka;I0.vUndefined=gka;I0.vNull=Aka;I0.vNullable=yka;I0.vUnchecked=PTi;I0.vUnknown=Eka;I0.vRequired=_ka;I0.vObj=vka;I0.vArray=Cka;I0.vTuple=bka;I0.vUnion=DTi;I0.vEnum=Ska;I0.vLiteral=Tka;I0.vLazy=Ika;var Ete=class{static{a(this,"TypeofValidator")}constructor(e){this.type=e}validate(e){return typeof e!==this.type?{content:void 0,error:{message:`Expected ${this.type}, but got ${typeof e}`}}:{content:e,error:void 0}}toSchema(){return{type:this.type}}},aka=new Ete("string");function cka(){return aka}a(cka,"vString");var lka=new Ete("number");function uka(){return lka}a(uka,"vNumber");var dka=new Ete("boolean");function fka(){return dka}a(fka,"vBoolean");var pka=new Ete("object");function hka(){return pka}a(hka,"vObjAny");var mka=new Ete("undefined");function gka(){return mka}a(gka,"vUndefined");var Fvr=class{static{a(this,"NullValidator")}validate(e){return e!==null?{content:void 0,error:{message:`Expected null, but got ${typeof e}`}}:{content:null,error:void 0}}toSchema(){return{type:"null"}}},kTi=new Fvr;function Aka(){return kTi}a(Aka,"vNull");function yka(t){return DTi(t,kTi)}a(yka,"vNullable");function PTi(){return{validate(t){return{content:t,error:void 0}},toSchema(){return{}}}}a(PTi,"vUnchecked");function Eka(){return PTi()}a(Eka,"vUnknown");function _ka(t){return{validate(e){return e===void 0?{content:void 0,error:{message:"Required field is missing"}}:t.validate(e)},toSchema(){return t.toSchema()},isRequired(){return!0}}}a(_ka,"vRequired");function vka(t){return{validate(e){if(typeof e!="object"||e===null)return{content:void 0,error:{message:"Expected object"}};let r={};for(let n in t){let o=t[n],s=e[n],c=o.isRequired?.()??!1;if(c&&s===void 0)return{content:void 0,error:{message:`Required field '${n}' is missing`}};if(!c&&s===void 0)continue;let{content:l,error:u}=o.validate(s);if(u)return{content:void 0,error:{message:`Error in property '${n}': ${u.message}`}};r[n]=l}return{content:r,error:void 0}},toSchema(){let e=[],r={};for(let[o,s]of Object.entries(t))r[o]=s.toSchema(),s.isRequired?.()&&e.push(o);return{type:"object",properties:r,...e.length>0?{required:e}:{}}}}}a(vka,"vObj");function Cka(t){return{validate(e){if(!Array.isArray(e))return{content:void 0,error:{message:"Expected array"}};let r=[];for(let n=0;ne.toSchema())}}}}a(bka,"vTuple");function DTi(...t){return{validate(e){let r;for(let n of t){let{content:o,error:s}=n.validate(e);if(!s)return{content:o,error:void 0};r=s}return{content:void 0,error:r}},toSchema(){return{oneOf:t.map(e=>e.toSchema())}}}}a(DTi,"vUnion");function Ska(...t){return{validate(e){return t.indexOf(e)===-1?{content:void 0,error:{message:`Expected one of: ${t.join(", ")}`}}:{content:e,error:void 0}},toSchema(){return{enum:t}}}}a(Ska,"vEnum");function Tka(t){return{validate(e){return e!==t?{content:void 0,error:{message:`Expected: ${t}`}}:{content:e,error:void 0}},toSchema(){return{const:t}}}}a(Tka,"vLiteral");function Ika(t){return{validate(e){return t().validate(e)},toSchema(){return t().toSchema()}}}a(Ika,"vLazy")});var NTi=I(u5e=>{"use strict";p();Object.defineProperty(u5e,"__esModule",{value:!0});u5e.DocumentSwitchTriggerStrategy=void 0;var xka=RG(),B0t;(function(t){t.Always="always",t.AfterAcceptance="afterAcceptance"})(B0t||(u5e.DocumentSwitchTriggerStrategy=B0t={}));(function(t){t.VALIDATOR=(0,xka.vEnum)(t.Always,t.AfterAcceptance)})(B0t||(u5e.DocumentSwitchTriggerStrategy=B0t={}))});var Uvr=I(d5e=>{"use strict";p();Object.defineProperty(d5e,"__esModule",{value:!0});d5e.DiffHistoryMergeStrategy=void 0;var wka=RG(),F0t;(function(t){t.SameStartLine="sameStartLine",t.Proximity="proximity",t.Hybrid="hybrid"})(F0t||(d5e.DiffHistoryMergeStrategy=F0t={}));(function(t){t.VALIDATOR=(0,wka.vEnum)(t.SameStartLine,t.Proximity,t.Hybrid)})(F0t||(d5e.DiffHistoryMergeStrategy=F0t={}))});var Q0t=I(f5e=>{"use strict";p();Object.defineProperty(f5e,"__esModule",{value:!0});f5e.ImportChanges=void 0;var Rka=RG(),U0t;(function(t){t.All="all",t.None="none"})(U0t||(f5e.ImportChanges=U0t={}));(function(t){t.VALIDATOR=(0,Rka.vEnum)(t.All,t.None)})(U0t||(f5e.ImportChanges=U0t={}))});var py=I(mn=>{"use strict";p();Object.defineProperty(mn,"__esModule",{value:!0});mn.PatchModelPrediction=mn.SpeculativeRequestsAutoExpandEditWindowLines=mn.SpeculativeRequestsCursorPlacement=mn.DuplicateAdditionsMode=mn.SpeculativeRequestsEnablement=mn.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR=mn.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION=mn.MODEL_CONFIGURATION_VALIDATOR=mn.LINT_OPTIONS_VALIDATOR=mn.LANGUAGE_CONTEXT_ENABLED_LANGUAGES=mn.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS=mn.DEFAULT_OPTIONS=mn.ResponseFormat=mn.PromptingStrategy=mn.EditIntent=mn.EarlyDivergenceCancellationMode=mn.AggressivenessLevel=mn.AggressivenessSetting=mn.LintOptionShowCode=mn.LintOptionWarning=mn.CurrentFileOptions=mn.GlobalBudgetOptions=mn.NeighborFilesOptions=mn.RecentlyViewedDocumentsOptions=mn.RecentFileClippingStrategy=mn.IncludeLineNumbersOption=void 0;mn.isPromptingStrategy=kka;mn.isAggressivenessStrategy=Pka;mn.applyStrategyConfig=Nka;mn.parseLintOptionString=Mka;mn.parseUserHappinessScoreConfigurationString=Oka;var BTi=rd(),pn=RG(),Qvr=Q0t(),zb;(function(t){t.WithSpaceAfter="withSpaceAfter",t.WithoutSpace="withoutSpaceAfter",t.None="none"})(zb||(mn.IncludeLineNumbersOption=zb={}));var _te;(function(t){t.AroundEditRange="aroundEditRange",t.Proportional="proportional"})(_te||(mn.RecentFileClippingStrategy=_te={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.AroundEditRange,t.Proportional)})(_te||(mn.RecentFileClippingStrategy=_te={}));var qvr;(function(t){t.VALIDATOR=(0,pn.vObj)({nDocuments:(0,pn.vNumber)(),maxTokens:(0,pn.vNumber)(),includeViewedFiles:(0,pn.vBoolean)(),includeLineNumbers:(0,pn.vEnum)(zb.WithSpaceAfter,zb.WithoutSpace,zb.None),clippingStrategy:(0,pn.vEnum)(_te.AroundEditRange,_te.Proportional),useLeftoverBudgetFromAbove:(0,pn.vBoolean)()})})(qvr||(mn.RecentlyViewedDocumentsOptions=qvr={}));var MTi;(function(t){t.VALIDATOR=(0,pn.vObj)({enabled:(0,pn.vBoolean)(),maxTokens:(0,pn.vNumber)()})})(MTi||(mn.NeighborFilesOptions=MTi={}));var OTi;(function(t){t.DEFAULT_ORDER=["languageContext","recentlyViewedDocuments","neighborFiles","diffHistory"],t.DEFAULT_SHARES={recentlyViewedDocuments:2/6,languageContext:2/6,neighborFiles:1/6,diffHistory:1/6},t.DEFAULT_TOTAL_TOKENS=6e3})(OTi||(mn.GlobalBudgetOptions=OTi={}));var jvr;(function(t){t.VALIDATOR=(0,pn.vObj)({maxTokens:(0,pn.vNumber)(),includeTags:(0,pn.vBoolean)(),includeLineNumbers:(0,pn.vEnum)(zb.WithSpaceAfter,zb.WithoutSpace,zb.None),includeCursorTag:(0,pn.vBoolean)(),prioritizeAboveCursor:(0,pn.vBoolean)(),useLeftoverBudgetFromAbove:(0,pn.vBoolean)()})})(jvr||(mn.CurrentFileOptions=jvr={}));var wge;(function(t){t.YES="yes",t.NO="no",t.YES_IF_NO_ERRORS="yesIfNoErrors"})(wge||(mn.LintOptionWarning=wge={}));var Rge;(function(t){t.YES="yes",t.NO="no",t.YES_WITH_SURROUNDING="yesWithSurroundingLines"})(Rge||(mn.LintOptionShowCode=Rge={}));var q0t;(function(t){t.Default="auto",t.Low="low",t.Medium="medium",t.High="high"})(q0t||(mn.AggressivenessSetting=q0t={}));var kG;(function(t){t.Low="low",t.Medium="medium",t.High="high"})(kG||(mn.AggressivenessLevel=kG={}));var j0t;(function(t){t.Cursor="cursor",t.EditWindow="editWindow",t.Off="off"})(j0t||(mn.EarlyDivergenceCancellationMode=j0t={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.Cursor,t.EditWindow,t.Off)})(j0t||(mn.EarlyDivergenceCancellationMode=j0t={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.Default,t.Low,t.Medium,t.High);function e(r){switch(r){case t.Low:return kG.Low;case t.Medium:return kG.Medium;case t.High:return kG.High;case t.Default:return}}a(e,"toLevel"),t.toLevel=e})(q0t||(mn.AggressivenessSetting=q0t={}));var H0t;(function(t){t.NoEdit="no_edit",t.Low="low",t.Medium="medium",t.High="high"})(H0t||(mn.EditIntent=H0t={}));(function(t){function e(o){switch(o){case"no_edit":return t.NoEdit;case"low":return t.Low;case"medium":return t.Medium;case"high":return t.High;default:return t.High}}a(e,"fromString"),t.fromString=e;function r(o){switch(o){case"N":return t.NoEdit;case"L":return t.Low;case"M":return t.Medium;case"H":return t.High;default:return}}a(r,"fromShortName"),t.fromShortName=r;function n(o,s){switch(o){case t.NoEdit:return!1;case t.High:return!0;case t.Medium:return s===kG.Medium||s===kG.High;case t.Low:return s===kG.High;default:(0,BTi.assertNever)(o)}}a(n,"shouldShowEdit"),t.shouldShowEdit=n})(H0t||(mn.EditIntent=H0t={}));var kl;(function(t){t.CopilotNesXtab="copilotNesXtab",t.UnifiedModel="xtabUnifiedModel",t.Codexv21NesUnified="codexv21nesUnified",t.Nes41Miniv3="nes41miniv3",t.SimplifiedSystemPrompt="simplifiedSystemPrompt",t.Xtab275="xtab275",t.XtabAggressiveness="xtabAggressiveness",t.Xtab275Aggressiveness="xtab275Aggressiveness",t.Xtab275AggressivenessHighLow="xtab275AggressivenessHighLow",t.PatchBased="patchBased",t.PatchBased01="patchBased01",t.PatchBased02="patchBased02",t.PatchBased02WithRecentLineNumbers="patchBased02WithRecentLineNumbers",t.PatchBased02WithoutRecentLineNumbers="patchBased02WithoutRecentLineNumbers",t.Xtab275EditIntent="xtab275EditIntent",t.Xtab275EditIntentShort="xtab275EditIntentShort"})(kl||(mn.PromptingStrategy=kl={}));function kka(t){return Object.values(kl).includes(t)}a(kka,"isPromptingStrategy");function Pka(t){return t===kl.XtabAggressiveness||t===kl.Xtab275Aggressiveness||t===kl.Xtab275AggressivenessHighLow||t===kl.Xtab275EditIntent||t===kl.Xtab275EditIntentShort}a(Pka,"isAggressivenessStrategy");var G0t;(function(t){t.CodeBlock="codeBlock",t.UnifiedWithXml="unifiedWithXml",t.EditWindowOnly="editWindowOnly",t.CustomDiffPatch="customDiffPatch",t.EditWindowWithEditIntent="editWindowWithEditIntent",t.EditWindowWithEditIntentShort="editWindowWithEditIntentShort"})(G0t||(mn.ResponseFormat=G0t={}));(function(t){function e(r){switch(r){case kl.UnifiedModel:case kl.Codexv21NesUnified:case kl.Nes41Miniv3:return t.UnifiedWithXml;case kl.Xtab275:case kl.XtabAggressiveness:case kl.Xtab275Aggressiveness:case kl.Xtab275AggressivenessHighLow:return t.EditWindowOnly;case kl.PatchBased:case kl.PatchBased01:case kl.PatchBased02:case kl.PatchBased02WithRecentLineNumbers:case kl.PatchBased02WithoutRecentLineNumbers:return t.CustomDiffPatch;case kl.Xtab275EditIntent:return t.EditWindowWithEditIntent;case kl.Xtab275EditIntentShort:return t.EditWindowWithEditIntentShort;case kl.SimplifiedSystemPrompt:case kl.CopilotNesXtab:case void 0:return t.CodeBlock;default:(0,BTi.assertNever)(r)}}a(e,"fromPromptingStrategy"),t.fromPromptingStrategy=e})(G0t||(mn.ResponseFormat=G0t={}));mn.DEFAULT_OPTIONS={promptingStrategy:void 0,currentFile:{maxTokens:1500,includeTags:!0,includeLineNumbers:zb.None,includeCursorTag:!1,prioritizeAboveCursor:!1,useLeftoverBudgetFromAbove:!0},pagedClipping:{pageSize:10},recentlyViewedDocuments:{nDocuments:5,maxTokens:2e3,includeViewedFiles:!1,includeLineNumbers:zb.None,clippingStrategy:_te.AroundEditRange,useLeftoverBudgetFromAbove:!1},languageContext:{enabled:!1,maxTokens:2e3,traitPosition:"after"},neighborFiles:{enabled:!1,maxTokens:1e3},diffHistory:{nEntries:25,maxTokens:1e3,onlyForDocsInPrompt:!1,useRelativePaths:!1},lintOptions:void 0,includePostScript:!0};mn.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS={maxLineDistance:1e3,maxLints:5,showCode:Rge.YES_WITH_SURROUNDING,tagName:"linter",warnings:wge.YES_IF_NO_ERRORS,nRecentFiles:0};mn.LANGUAGE_CONTEXT_ENABLED_LANGUAGES={prompt:!0,instructions:!0,chatagent:!0};var Dka={[kl.CopilotNesXtab]:{includeTagsInCurrentFile:!0},[kl.PatchBased02WithRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:zb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:zb.WithoutSpace},supportsNextCursorLinePrediction:!1,allowImportChanges:Qvr.ImportChanges.All},[kl.PatchBased02WithoutRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:zb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:zb.None},supportsNextCursorLinePrediction:!1,allowImportChanges:Qvr.ImportChanges.All}};function Nka(t){let e=t.promptingStrategy===void 0?void 0:Dka[t.promptingStrategy];if(!e)return t;let r=t.currentFile!==void 0||e.currentFile!==void 0,n=t.recentlyViewedDocuments!==void 0||e.recentlyViewedDocuments!==void 0,o=t.lintOptions!==void 0||e.lintOptions!==void 0;return{...t,...e,currentFile:r?{...t.currentFile,...e.currentFile}:void 0,recentlyViewedDocuments:n?{...t.recentlyViewedDocuments,...e.recentlyViewedDocuments}:void 0,lintOptions:o?{...t.lintOptions,...e.lintOptions}:void 0}}a(Nka,"applyStrategyConfig");mn.LINT_OPTIONS_VALIDATOR=(0,pn.vObj)({tagName:(0,pn.vString)(),warnings:(0,pn.vEnum)(wge.YES,wge.NO,wge.YES_IF_NO_ERRORS),showCode:(0,pn.vEnum)(Rge.NO,Rge.YES,Rge.YES_WITH_SURROUNDING),maxLints:(0,pn.vNumber)(),maxLineDistance:(0,pn.vNumber)(),nRecentFiles:(0,pn.vNumber)()});mn.MODEL_CONFIGURATION_VALIDATOR=(0,pn.vObj)({modelName:(0,pn.vRequired)((0,pn.vString)()),promptingStrategy:(0,pn.vUnion)((0,pn.vEnum)(...Object.values(kl)),(0,pn.vUndefined)()),includeTagsInCurrentFile:(0,pn.vRequired)((0,pn.vBoolean)()),includePostScript:(0,pn.vUnion)((0,pn.vBoolean)(),(0,pn.vUndefined)()),currentFile:(0,pn.vUnion)(jvr.VALIDATOR,(0,pn.vUndefined)()),recentlyViewedDocuments:(0,pn.vUnion)(qvr.VALIDATOR,(0,pn.vUndefined)()),lintOptions:(0,pn.vUnion)(mn.LINT_OPTIONS_VALIDATOR,(0,pn.vUndefined)()),supportsNextCursorLinePrediction:(0,pn.vUnion)((0,pn.vBoolean)(),(0,pn.vUndefined)()),allowImportChanges:(0,pn.vUnion)(Qvr.ImportChanges.VALIDATOR,(0,pn.vUndefined)())});function Mka(t,e){try{let r=JSON.parse(t),n=mn.LINT_OPTIONS_VALIDATOR.validate(r);if(n.error)throw new Error(`Lint options validation failed: ${n.error.message}`);return{...e,...n.content}}catch(r){throw new Error(`Failed to parse lint options string: ${r}`)}}a(Mka,"parseLintOptionString");mn.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION={acceptedScore:1,rejectedScore:0,ignoredScore:.5,highThreshold:.7,mediumThreshold:.4,includeIgnored:!1,ignoredLimit:0,limitConsecutiveIgnored:!1,limitTotalIgnored:!0};var LTi=(0,pn.vObj)({acceptedScore:(0,pn.vRequired)((0,pn.vNumber)()),rejectedScore:(0,pn.vRequired)((0,pn.vNumber)()),ignoredScore:(0,pn.vRequired)((0,pn.vNumber)()),highThreshold:(0,pn.vRequired)((0,pn.vNumber)()),mediumThreshold:(0,pn.vRequired)((0,pn.vNumber)()),includeIgnored:(0,pn.vRequired)((0,pn.vBoolean)()),ignoredLimit:(0,pn.vRequired)((0,pn.vNumber)()),limitConsecutiveIgnored:(0,pn.vRequired)((0,pn.vBoolean)()),limitTotalIgnored:(0,pn.vRequired)((0,pn.vBoolean)())});function p5e(t,e,r){return t>=e&&t<=r}a(p5e,"isInRange");mn.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR={validate(t){let e=LTi.validate(t);if(e.error)return e;let r=e.content;return p5e(r.acceptedScore,0,1)?p5e(r.rejectedScore,0,1)?p5e(r.ignoredScore,0,1)?p5e(r.highThreshold,0,1)?p5e(r.mediumThreshold,0,1)?r.acceptedScore<=r.rejectedScore?{content:void 0,error:{message:"acceptedScore must be greater than rejectedScore to prevent division by zero"}}:r.ignoredScore{"use strict";p();Object.defineProperty(kge,"__esModule",{value:!0});kge.TextReplacement=kge.TextEdit=void 0;var FTi=Sl(),UTi=rd(),Z0t=Rs(),K0t=em(),PG=q_(),_m=eh(),X0t=Tme(),QTi=qT(),egt=class t{static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>Tv.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new Tv(e,r)])}static delete(e){return new t([new Tv(e,"")])}static insert(e,r){return new t([new Tv(_m.Range.fromPositions(e,e),r)])}static fromParallelReplacementsUnsorted(e){let r=e.slice().sort((0,FTi.compareBy)(n=>n.range,_m.Range.compareRangesUsingStarts));return new t(r)}constructor(e){this.replacements=e,(0,UTi.assertFn)(()=>(0,UTi.checkAdjacentItems)(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}normalize(){let e=[];for(let r of this.replacements)if(e.length>0&&e[e.length-1].range.getEndPosition().equals(r.range.getStartPosition())){let n=e[e.length-1];e[e.length-1]=new Tv(n.range.plusRange(r.range),n.text+r.text)}else r.isEmpty||e.push(r);return new t(e)}mapPosition(e){let r=0,n=0,o=0;for(let s of this.replacements){let c=s.range.getStartPosition();if(e.isBeforeOrEqual(c))break;let l=s.range.getEndPosition(),u=X0t.TextLength.ofText(s.text);if(e.isBefore(l)){let d=new PG.Position(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return J0t(d,f)}c.lineNumber+r!==n&&(o=0),r+=u.lineCount-(s.range.endLineNumber-s.range.startLineNumber),u.lineCount===0?l.lineNumber!==c.lineNumber?o+=u.columnCount-(l.column-1):o+=u.columnCount-(l.column-c.column):o=u.columnCount,n=l.lineNumber+r}return new PG.Position(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof PG.Position?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof PG.Position?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return J0t(o,s)}inverseMapPosition(e,r){return this.inverse(r).mapPosition(e)}inverseMapRange(e,r){return this.inverse(r).mapRange(e)}apply(e){let r="",n=new PG.Position(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=J0t(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=J0t(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new QTi.StringText(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new Tv(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=X0t.TextLength.ofText(s.text),l=PG.Position.lift({lineNumber:s.range.startLineNumber+n,column:s.range.startColumn+(s.range.startLineNumber===r?o:0)}),u=c.createRange(l);e.push(u),n=u.endLineNumber-s.range.endLineNumber,o=u.endColumn-s.range.endColumn,r=s.range.endLineNumber}return e}toReplacement(e){if(this.replacements.length===0)throw new Z0t.BugIndicatingError;if(this.replacements.length===1)return this.replacements[0];let r=this.replacements[0].range.getStartPosition(),n=this.replacements[this.replacements.length-1].range.getEndPosition(),o="";for(let s=0;sr.equals(n))}compose(e){let r=this.normalize(),n=e.normalize();if(r.replacements.length===0)return n;if(n.replacements.length===0)return r;let o=[],s=0,c=1,l=1,u=0,d=0,f=0,h=0,m=null,g=0,A=0,y=!1,E=!1,_=1,v=1;function b(){if(!y)if(sr.toString()).join(` -`):typeof e=="string"?this.toString(new QTi.StringText(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=_m.Range.fromPositions(new PG.Position(Math.max(1,r.range.startLineNumber-1),1),r.range.getStartPosition()),c=e.getValueOfRange(s);c.length>10&&(c="..."+c.substring(c.length-10));let l=_m.Range.fromPositions(r.range.getEndPosition(),new PG.Position(r.range.endLineNumber+1,1)),u=e.getValueOfRange(l);u.length>10&&(u=u.substring(0,10)+"...");let d=o;if(d.length>10){let h=Math.floor(5);d=d.substring(0,h)+"..."+d.substring(d.length-h)}let f=r.text;if(f.length>10){let h=Math.floor(5);f=f.substring(0,h)+"..."+f.substring(f.length-h)}return d.length===0?`${c}\u2770${f}\u2771${u}`:`${c}\u2770${d}\u21A6${f}\u2771${u}`}).join(` -`)}};kge.TextEdit=egt;var Tv=class t{static{a(this,"TextReplacement")}static joinReplacements(e,r){if(e.length===0)throw new Z0t.BugIndicatingError;if(e.length===1)return e[0];let n=e[0].range.getStartPosition(),o=e[e.length-1].range.getEndPosition(),s="";for(let c=0;c 1"},{command:"github.copilot.chat.review.apply",group:"inline@1",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments == 1"},{submenu:"copilot/reviewComment/additionalActions/discardAndNext",group:"inline@2",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments > 1"},{submenu:"copilot/reviewComment/additionalActions/discard",group:"inline@2",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments == 1"}],"copilot/reviewComment/additionalActions/applyAndNext":[{command:"github.copilot.chat.review.applyAndNext",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.apply",group:"inline@2",when:"commentController == github-copilot-review"}],"copilot/reviewComment/additionalActions/discardAndNext":[{command:"github.copilot.chat.review.discardAndNext",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discard",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInInlineChat",group:"inline@3",when:"commentController == github-copilot-review"}],"copilot/reviewComment/additionalActions/discard":[{command:"github.copilot.chat.review.discard",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInInlineChat",group:"inline@3",when:"commentController == github-copilot-review"}],"comments/commentThread/title":[{command:"github.copilot.chat.review.previous",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.next",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInChat",group:"inline@3",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discardAll",group:"inline@4",when:"commentController == github-copilot-review"}],"scm/title":[{command:"github.copilot.chat.review.changes",group:"navigation",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmProviderRootUri in github.copilot.chat.reviewDiff.enabledRootUris"}],"scm/sourceControl":[{command:"github.copilot.cli.openInCopilotCLI",group:"3_worktree@1",when:"scmProvider == git"}],"scm/resourceGroup/context":[{command:"github.copilot.chat.review.stagedChanges",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == index",group:"inline@-3"},{command:"github.copilot.chat.review.unstagedChanges",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == workingTree",group:"inline@-3"}],"scm/resourceState/context":[{command:"github.copilot.git.resolveMergeConflicts",when:"scmProvider == git && scmResourceGroup == merge && git.activeResourceHasMergeConflicts",group:"z_chat@1"},{command:"github.copilot.chat.review.stagedFileChange",group:"3_copilot",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == index"},{command:"github.copilot.chat.review.unstagedFileChange",group:"3_copilot",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == workingTree"}],"scm/inputBox":[{command:"github.copilot.git.generateCommitMessage",when:"scmProvider == git && chatSetupCompleted"}],"testing/message/context":[{command:"github.copilot.tests.fixTestFailure",when:"testing.testItemHasUri",group:"inline@1"}],"issue/reporter":[{command:"github.copilot.report"}],"github.copilot.chat.debug.filter":[{command:"github.copilot.chat.debug.showElements",when:"github.copilot.chat.debug.elementsHidden",group:"commands@0"},{command:"github.copilot.chat.debug.hideElements",when:"!github.copilot.chat.debug.elementsHidden",group:"commands@0"},{command:"github.copilot.chat.debug.showTools",when:"github.copilot.chat.debug.toolsHidden",group:"commands@1"},{command:"github.copilot.chat.debug.hideTools",when:"!github.copilot.chat.debug.toolsHidden",group:"commands@1"},{command:"github.copilot.chat.debug.showNesRequests",when:"github.copilot.chat.debug.nesRequestsHidden",group:"commands@2"},{command:"github.copilot.chat.debug.hideNesRequests",when:"!github.copilot.chat.debug.nesRequestsHidden",group:"commands@2"},{command:"github.copilot.chat.debug.showGhostRequests",when:"github.copilot.chat.debug.ghostRequestsHidden",group:"commands@3"},{command:"github.copilot.chat.debug.hideGhostRequests",when:"!github.copilot.chat.debug.ghostRequestsHidden",group:"commands@3"}],"notebook/toolbar":[{command:"github.copilot.chat.notebook.enableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && !github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && config.notebook.globalToolbar",group:"navigation/execute@15"},{command:"github.copilot.chat.notebook.disableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && config.notebook.globalToolbar",group:"navigation/execute@15"}],"editor/content":[{command:"github.copilot.git.resolveMergeConflicts",group:"z_chat@1",when:"config.git.enabled && !git.missing && !isInDiffEditor && !isMergeEditor && resource in git.mergeChanges && git.activeResourceHasMergeConflicts && chatSetupCompleted"}],"multiDiffEditor/content":[{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"resourceScheme == copilotcli-worktree-changes && workbenchState != empty && !isSessionsWindow"}],"chat/chatSessions":[{command:"github.copilot.claude.sessions.rename",when:"chatSessionType == claude-code",group:"1_edit@4"},{command:"github.copilot.cli.sessions.delete",when:"chatSessionType == copilotcli",group:"1_edit@10"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli",group:"1_edit@4"},{command:"github.copilot.cli.sessions.openWorktreeInNewWindow",when:"chatSessionType == copilotcli && !isSessionsWindow",group:"2_open@1"},{command:"github.copilot.cli.sessions.openWorktreeInTerminal",when:"chatSessionType == copilotcli",group:"2_open@2"},{command:"github.copilot.cli.sessions.copyWorktreeBranchName",when:"chatSessionType == copilotcli",group:"2_open@3"},{command:"github.copilot.cli.sessions.resumeInTerminal",when:"chatSessionType == copilotcli",group:"2_open@4"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"chatSessionType == copilotcli && workbenchState != empty && !isSessionsWindow",group:"3_apply@0"},{command:"github.copilot.cloud.sessions.openInBrowser",when:"chatSessionType == copilot-cloud-agent",group:"navigation@10"},{command:"github.copilot.cloud.sessions.proxy.closeChatSessionPullRequest",when:"chatSessionType == copilot-cloud-agent",group:"1_edit@10"}],"chatSessions/item/context":[{command:"github.copilot.claude.sessions.rename",when:"chatSessionType == claude-code && chatSessionProviderId == default-copilot",group:"1_edit@4"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli && chatSessionProviderId == default-copilot",group:"1_edit@4"}],"chat/multiDiff/context":[{command:"github.copilot.cloud.sessions.installPRExtension",when:"chatSessionType == copilot-cloud-agent && !github.copilot.prExtensionInstalled",group:"inline@1"}],"chat/input/editing/sessionTitleToolbar":[{command:"github.copilot.sessions.refreshChanges",when:"chatSessionType == copilotcli && isSessionsWindow && !sessions.isAgentHostSession",group:"9_refresh@1"}],"chat/customizations/create":[{command:"copilot.claude.agents",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == agents",group:"navigation@1"},{command:"copilot.claude.hooks",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == hooks",group:"navigation@1"},{command:"copilot.claude.memory",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == instructions",group:"navigation@1"}]},icons:{"copilot-logo":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0041"}},"copilot-warning":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0042"}},"copilot-notconnected":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0043"}}},iconFonts:[{id:"copilot-font",src:[{path:"assets/copilot.woff",format:"woff"}]}],terminalQuickFixes:[{id:"copilot-chat.fixWithCopilot",commandLineMatcher:".+",commandExitResult:"error",outputMatcher:{anchor:"bottom",length:1,lineMatcher:".+",offset:0},kind:"explain"},{id:"copilot-chat.generateCommitMessage",commandLineMatcher:"git add .+",commandExitResult:"success",kind:"explain",outputMatcher:{anchor:"bottom",length:1,lineMatcher:".+",offset:0}},{id:"copilot-chat.terminalToDebugging",commandLineMatcher:".+",kind:"explain",commandExitResult:"error",outputMatcher:{anchor:"bottom",length:1,lineMatcher:"",offset:0}},{id:"copilot-chat.terminalToDebuggingSuccess",commandLineMatcher:".+",kind:"explain",commandExitResult:"success",outputMatcher:{anchor:"bottom",length:1,lineMatcher:"",offset:0}}],languages:[{id:"ignore",filenamePatterns:[".copilotignore"],aliases:[]},{id:"markdown",extensions:[".copilotmd"]}],views:{"copilot-chat":[{id:"copilot-chat",name:"Chat Debug",icon:"assets/debug-icon.svg",when:"github.copilot.chat.showLogView"}],"context-inspector":[{id:"context-inspector",name:"Language Context Inspector",icon:"$(inspect)",when:"github.copilot.chat.showContextInspectorView"}]},viewsContainers:{activitybar:[{id:"copilot-chat",title:"Chat Debug",icon:"assets/debug-icon.svg"},{id:"context-inspector",title:"Language Context Inspector",icon:"$(inspect)"}]},configurationDefaults:{"workbench.editorAssociations":{"*.copilotmd":"vscode.markdown.preview.editor"}},keybindings:[{command:"github.copilot.chat.copilotCLI.addFileReference",key:"ctrl+shift+.",mac:"cmd+shift+.",when:"github.copilot.chat.copilotCLI.hasSession && editorTextFocus"},{command:"github.copilot.chat.rerunWithCopilotDebug",key:"ctrl+alt+.",mac:"cmd+alt+.",when:"github.copilot-chat.activated && terminalShellIntegrationEnabled && terminalFocus && !terminalAltBufferActive"},{command:"github.copilot.nes.captureExpected.confirm",key:"ctrl+enter",mac:"cmd+enter",when:"copilotNesCaptureMode && editorTextFocus"},{command:"github.copilot.nes.captureExpected.abort",key:"escape",when:"copilotNesCaptureMode && editorTextFocus"}],walkthroughs:[{id:"copilotWelcome",title:"%github.copilot.walkthrough.title%",description:"%github.copilot.walkthrough.description%",when:"!isWeb",steps:[{id:"copilot.setup.signIn",title:"%github.copilot.walkthrough.setup.signIn.title%",description:"%github.copilot.walkthrough.setup.signIn.description%",when:"chatEntitlementSignedOut && !view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && !github.copilot.interactiveSession.individual.disabled && !github.copilot.interactiveSession.individual.expired && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signInNoAction",title:"%github.copilot.walkthrough.setup.signIn.title%",description:"%github.copilot.walkthrough.setup.noAction.description%",when:"chatEntitlementSignedOut && view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && !github.copilot.interactiveSession.individual.disabled && !github.copilot.interactiveSession.individual.expired && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signUp",title:"%github.copilot.walkthrough.setup.signUp.title%",description:"%github.copilot.walkthrough.setup.signUp.description%",when:"chatPlanCanSignUp && !view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && (github.copilot.interactiveSession.individual.disabled || github.copilot.interactiveSession.individual.expired) && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signUpNoAction",title:"%github.copilot.walkthrough.setup.signUp.title%",description:"%github.copilot.walkthrough.setup.noAction.description%",when:"chatPlanCanSignUp && view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && (github.copilot.interactiveSession.individual.disabled || github.copilot.interactiveSession.individual.expired) && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.panelChat",title:"%github.copilot.walkthrough.panelChat.title%",description:"%github.copilot.walkthrough.panelChat.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.edits",title:"%github.copilot.walkthrough.edits.title%",description:"%github.copilot.walkthrough.edits.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-hclight.mp4"},altText:"%github.copilot.walkthrough.edits.media.altText%"}},{id:"copilot.firstSuggest",title:"%github.copilot.walkthrough.firstSuggest.title%",description:"%github.copilot.walkthrough.firstSuggest.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-hclight.mp4"},altText:"%github.copilot.walkthrough.firstSuggest.media.altText%"}},{id:"copilot.inlineChatNotMac",title:"%github.copilot.walkthrough.inlineChatNotMac.title%",description:"%github.copilot.walkthrough.inlineChatNotMac.description%",when:"!isMac && (!chatEntitlementSignedOut || chatIsEnabled )",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hclight.mp4"},altText:"%github.copilot.walkthrough.inlineChatNotMac.media.altText%"}},{id:"copilot.inlineChatMac",title:"%github.copilot.walkthrough.inlineChatMac.title%",description:"%github.copilot.walkthrough.inlineChatMac.description%",when:"isMac && (!chatEntitlementSignedOut || chatIsEnabled )",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hclight.mp4"},altText:"%github.copilot.walkthrough.inlineChatMac.media.altText%"}},{id:"copilot.sparkle",title:"%github.copilot.walkthrough.sparkle.title%",description:"%github.copilot.walkthrough.sparkle.description%",when:"!chatEntitlementSignedOut || chatIsEnabled",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-hclight.mp4"},altText:"%github.copilot.walkthrough.sparkle.media.altText%"}}]}],jsonValidation:[{fileMatch:"settings.json",url:"ccsettings://root/schema.json"}],typescriptServerPlugins:[{name:"@vscode/copilot-typescript-server-plugin",enableForWorkspaceTypeScriptVersions:!0}],chatSessions:[{type:"claude-code",name:"claude",displayName:"Claude",icon:"$(claude)",welcomeTitle:"Claude Agent",welcomeMessage:"Powered by the same agent as Claude Code",inputPlaceholder:"Run local tasks with Claude, type `#` for adding context",order:3,description:"%github.copilot.session.providerDescription.claude%",when:"config.github.copilot.chat.claudeAgent.enabled && ((isSessionsWindow && !config.chat.agents.claude.preferAgentHost) || (!isSessionsWindow && !config.chat.editor.claude.preferAgentHost))",canDelegate:!0,requiresCustomModels:!0,supportsAutoModel:!1,capabilities:{supportsFileAttachments:!0,supportsImageAttachments:!0},commands:[{name:"init",description:"Initialize a new CLAUDE.md file with codebase documentation"},{name:"pr-comments",description:"Get comments from a GitHub pull request"},{name:"review",description:"Review a pull request"},{name:"security-review",description:"Complete a security review of the pending changes on the current branch"},{name:"simplify",description:"Review changed code for reuse, quality, and efficiency"},{name:"claude-api",description:"Help building with Claude API or Anthropic SDK"},{name:"agents",description:"Create and manage specialized Claude agents"},{name:"hooks",description:"Configure Claude Code hooks for tool execution and events"},{name:"memory",description:"Open memory files (CLAUDE.md) for editing"},{name:"compact",description:"Compact the conversation history to save context tokens"}]},{type:"copilotcli",name:"cli",displayName:"Copilot CLI",icon:"$(copilot)",welcomeTitle:"Copilot CLI",welcomeMessage:"Run tasks in the background with the Copilot CLI",inputPlaceholder:"Run tasks in the background with the Copilot CLI, type `#` for adding context",order:1,canDelegate:!0,description:"%github.copilot.session.providerDescription.background%",when:"config.github.copilot.chat.backgroundAgent.enabled",supportsAutoModel:!0,capabilities:{supportsFileAttachments:!0,supportsProblemAttachments:!0,supportsToolAttachments:!1,supportsImageAttachments:!0,supportsSymbolAttachments:!0,supportsSearchResultAttachments:!0,supportsSourceControlAttachments:!0,supportsPromptAttachments:!0,supportsHandOffs:!0},commands:[{name:"delegate",description:"Delegate chat session to cloud agent and create associated PR",when:"config.github.copilot.chat.cloudAgent.enabled"},{name:"compact",description:"%github.copilot.command.cli.compact.description%"},{name:"plan",description:"%github.copilot.command.cli.plan.description%",when:"config.github.copilot.chat.cli.planCommand.enabled"},{name:"fleet",description:"%github.copilot.command.cli.fleet.description%",when:"false"},{name:"remote",description:"%github.copilot.command.cli.remote.description%",when:"config.github.copilot.chat.cli.remote.enabled"}],customAgentTarget:"github-copilot",requiresCustomModels:!0,autoAttachReferences:!0,useRequestToPopulateBuiltInPickers:!0},{type:"copilot-cloud-agent",alternativeIds:["copilot-swe-agent"],name:"cloud",displayName:"Cloud",icon:"$(cloud)",welcomeTitle:"Cloud Agent",welcomeMessage:"Delegate tasks to the cloud",inputPlaceholder:"Delegate tasks to the cloud, type `#` for adding context",order:2,canDelegate:!0,description:"%github.copilot.session.providerDescription.cloud%",when:"config.github.copilot.chat.cloudAgent.enabled",supportsAutoModel:!1,capabilities:{supportsFileAttachments:!0},autoAttachReferences:!0}],chatAgents:[],chatPromptFiles:[{path:"./assets/prompts/plan.prompt.md",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-standup.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-tips.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-cost-tips.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-improve.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-reindex.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-search.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]}],chatSkills:[{path:"./assets/prompts/skills/project-setup-info-local/SKILL.md",when:"!config.github.copilot.chat.newWorkspace.useContext7",sessionTypes:["local"]},{path:"./assets/prompts/skills/project-setup-info-context7/SKILL.md",when:"config.github.copilot.chat.newWorkspace.useContext7",sessionTypes:["local"]},{path:"./assets/prompts/skills/install-vscode-extension/SKILL.md",when:"config.github.copilot.chat.installExtensionSkill.enabled && config.github.copilot.chat.newWorkspaceCreation.enabled",sessionTypes:["local"]},{path:"./assets/prompts/skills/get-search-view-results/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/troubleshoot/SKILL.md",sessionTypes:["local","copilotcli"]},{path:"./assets/prompts/skills/agent-customization/SKILL.md",sessionTypes:["local","copilotcli"]},{path:"./assets/prompts/skills/init/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-prompt/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-instructions/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-skill/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-agent/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-hook/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/chronicle/SKILL.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]}],terminal:{profiles:[{icon:"copilot",id:"copilot-cli",title:"GitHub Copilot CLI",titleTemplate:"${sequence}"}]}},prettier:{useTabs:!0,tabWidth:4,singleQuote:!0},scripts:{postinstall:"tsx ./script/postinstall.ts",build:"node .esbuild.mts --sourcemaps",compile:"node .esbuild.mts --dev",watch:"npm-run-all -lp watch:esbuild watch:typecheck","watch:esbuild":"node .esbuild.mts --watch --dev","watch:typecheck":"npx tsgo --noEmit --watch --preserveWatchOutput --project tsconfig.json","watch:typecheck-extension":"npx tsgo --noEmit --watch --project tsconfig.json","watch:typecheck-extension-web":"npx tsgo --noEmit --watch --project tsconfig.worker.json","watch:typecheck-simulation-workbench":"npx tsgo --noEmit --watch --project test/simulation/workbench/tsconfig.json",typecheck:"npx tsgo --noEmit --project tsconfig.json && npx tsgo --noEmit --project test/simulation/workbench/tsconfig.json && npx tsgo --noEmit --project tsconfig.worker.json && npx tsgo --noEmit --project src/extension/completions-core/vscode-node/extension/src/copilotPanel/webView/tsconfig.json",lint:"npx eslint . --max-warnings=0","lint-staged":"npx eslint --max-warnings=0",tsfmt:"npx tsfmt -r --verify",test:"npm-run-all test:*","test:extension":"vscode-test","test:sanity":"vscode-test --sanity","test:unit":"vitest --run --pool=forks",vitest:"vitest",bench:"vitest bench",get_env:"tsx script/setup/getEnv.mts",get_token:"tsx script/setup/getToken.mts",prettier:"prettier --list-different --write --cache .",simulate:"node dist/simulationMain.js","simulate-require-cache":"node dist/simulationMain.js --require-cache","simulate-ci":"node dist/simulationMain.js --ci --require-cache","simulate-update-baseline":"node dist/simulationMain.js --update-baseline","simulate-gc":"node dist/simulationMain.js --require-cache --gc",setup:"npm run get_env && npm run get_token","setup:dotnet":"run-script-os","setup:dotnet:darwin:linux":"curl -O https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.sh && chmod u+x dotnet-install.sh && ./dotnet-install.sh --channel 10.0 && rm dotnet-install.sh","setup:dotnet:win32":'powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Invoke-WebRequest -Uri https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.ps1 -OutFile dotnet-install.ps1; ./dotnet-install.ps1 -channel 10.0; Remove-Item dotnet-install.ps1"',"analyze-edits":"tsx script/analyzeEdits.ts","extract-chat-lib":"tsx script/build/extractChatLib.ts",create_venv:"tsx script/setup/createVenv.mts",package:"vsce package",web:"vscode-test-web --headless --extensionDevelopmentPath=. .","test:prompt":'mocha "src/extension/completions-core/vscode-node/prompt/**/test/**/*.test.{ts,tsx}"',"test:completions-core":"tsx src/extension/completions-core/vscode-node/extension/test/runTest.ts"},devDependencies:{"@azure/identity":"4.9.1","@azure/keyvault-secrets":"^4.10.0","@azure/msal-node":"^3.6.3","@c4312/scip":"^0.1.0","@fluentui/react-components":"^9.66.6","@fluentui/react-icons":"^2.0.305","@hediet/node-reload":"^0.8.0","@octokit/types":"^14.1.0","@stylistic/eslint-plugin":"^3.0.1","@types/eslint":"^9.0.0","@types/express":"^5.0.6","@types/google-protobuf":"^3.15.12","@types/js-yaml":"^4.0.9","@types/markdown-it":"^14.0.0","@types/minimist":"^1.2.5","@types/mocha":"^10.0.10","@types/node":"^22.16.3","@types/picomatch":"^4.0.0","@types/react":"17.0.44","@types/react-dom":"^18.2.17","@types/sinon":"^17.0.4","@types/source-map-support":"^0.5.10","@types/tar":"^6.1.13","@types/vinyl":"^2.0.12","@types/vscode-webview":"^1.57.5","@types/ws":"^8.5.3","@types/yargs":"^17.0.24","@typescript-eslint/eslint-plugin":"^8.35.0","@typescript-eslint/parser":"^8.32.0","@typescript-eslint/typescript-estree":"^8.26.1","@typescript/native-preview":"^7.0.0-dev.20260429","@vitest/coverage-v8":"^4.1.8","@vitest/snapshot":"^1.5.0","@vscode/debugadapter":"^1.68.0","@vscode/debugprotocol":"^1.68.0","@vscode/dts":"^0.4.1","@vscode/lsif-language-service":"^0.1.0-pre.4","@vscode/test-cli":"^0.0.11","@vscode/test-electron":"^2.5.2","@vscode/test-web":"^0.0.80","@vscode/vsce":"3.6.0",copyfiles:"^2.4.1","csv-parse":"^6.0.0",dotenv:"^17.2.0",electron:"^39.8.5",esbuild:"0.28.1",fastq:"^1.19.1",glob:"^11.1.0","js-yaml":"^4.1.1",minimist:"^1.2.8",mobx:"^6.13.7","mobx-react-lite":"^4.1.0",mocha:"^11.7.1","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","monaco-editor":"0.44.0","npm-run-all":"^4.1.5",open:"^10.1.2",openai:"^6.7.0",outdent:"^0.8.0",picomatch:"^4.0.4",playwright:"^1.58.2",prettier:"^3.6.2",react:"^17.0.2","react-dom":"17.0.2",rimraf:"^6.0.1","run-script-os":"^1.1.6",shiki:"~1.15.0",sinon:"^21.0.0","source-map-support":"^0.5.21",tar:"^7.5.16","ts-dedent":"^2.2.0",tsx:"^4.22.4",typescript:"^5.8.3","vite-plugin-wasm":"^3.6.0",vitest:"^4.1.8","vscode-languageserver-protocol":"^3.17.5","vscode-languageserver-textdocument":"^1.0.12","vscode-languageserver-types":"^3.17.5",yaml:"^2.8.0",yargs:"^17.7.2",zod:"3.25.76"},dependencies:{"@anthropic-ai/claude-agent-sdk":"0.2.112","@anthropic-ai/sdk":"^0.82.0","@github/blackbird-external-ingest-utils":"^0.3.0","@github/copilot":"^1.0.64-0","@google/genai":"^1.22.0","@humanwhocodes/gitignore-to-minimatch":"1.0.2","@microsoft/tiktokenizer":"^1.0.10","@modelcontextprotocol/sdk":"^1.25.2","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.212.0","@opentelemetry/exporter-logs-otlp-grpc":"^0.214.0","@opentelemetry/exporter-logs-otlp-http":"^0.214.0","@opentelemetry/exporter-metrics-otlp-grpc":"^0.214.0","@opentelemetry/exporter-metrics-otlp-http":"^0.214.0","@opentelemetry/exporter-trace-otlp-grpc":"^0.214.0","@opentelemetry/exporter-trace-otlp-http":"^0.214.0","@opentelemetry/resources":"^2.5.1","@opentelemetry/sdk-logs":"^0.212.0","@opentelemetry/sdk-metrics":"^2.5.1","@opentelemetry/sdk-trace-node":"^2.5.1","@opentelemetry/semantic-conventions":"^1.39.0","@sinclair/typebox":"^0.34.41","@vscode/copilot-api":"^0.4.3","@vscode/extension-telemetry":"^1.5.1","@vscode/l10n":"^0.0.18","@vscode/prompt-tsx":"^0.4.0-alpha.8","@vscode/tree-sitter-wasm":"0.0.5-php.2","@vscode/webview-ui-toolkit":"^1.3.1","@xterm/headless":"^5.5.0",ajv:"^8.18.0",applicationinsights:"^2.9.7","best-effort-json-parser":"^1.2.1",diff:"^8.0.3",express:"^5.2.1",ignore:"^7.0.5",isbinaryfile:"^5.0.4","jsonc-parser":"^3.3.1","lru-cache":"^11.1.0","markdown-it":"^14.1.1",minimatch:"^10.2.1",undici:"^7.24.1","vscode-tas-client":"^0.1.84","web-tree-sitter":"^0.23.0"},overrides:{string_decoder:"npm:string_decoder@1.2.0",zod:"3.25.76"},vscodeCommit:"94c8e2adc50e26ef70af85a0de3a9efed757acaa",__metadata:{id:"7ec7d6e6-b89e-4cc5-a59b-d6c4d238246f",publisherId:{publisherId:"7c1c19cd-78eb-4dfb-8999-99caf7679002",publisherName:"github",displayName:"GitHub",flags:"verified"},publisherDisplayName:"GitHub"}}});var P5e=I(Yb=>{"use strict";p();Object.defineProperty(Yb,"__esModule",{value:!0});Yb.vscodeEngineVersion=Yb.isPreRelease=Yb.isProduction=Yb.packageJson=void 0;Yb.packageJson=cxi();Yb.isProduction=Yb.packageJson.buildType!=="dev";Yb.isPreRelease=Yb.packageJson.isPreRelease||!Yb.isProduction;Yb.vscodeEngineVersion=Yb.packageJson.engines.vscode});var H4=I(Kb=>{"use strict";p();Object.defineProperty(Kb,"__esModule",{value:!0});Kb.isScenarioAutomation=Kb.AbstractEnvService=Kb.INativeEnvService=Kb.IEnvService=Kb.NameAndVersion=Kb.OperatingSystem=void 0;var uxi=nn(),dxi=Swe(),qge=P5e(),lxi;(function(t){t.Windows="Windows",t.Macintosh="Mac",t.Linux="Linux"})(lxi||(Kb.OperatingSystem=lxi={}));var _Cr=class{static{a(this,"NameAndVersion")}constructor(e,r){this.name=e,this.version=r}format(){return`${this.name}/${this.version}`}};Kb.NameAndVersion=_Cr;Kb.IEnvService=(0,uxi.createServiceIdentifier)("IEnvService");Kb.INativeEnvService=(0,uxi.createServiceIdentifier)("INativeEnvService");var vCr=class{static{a(this,"AbstractEnvService")}isProduction(){return qge.isProduction}isPreRelease(){return qge.isPreRelease}isSimulation(){return dxi.env.SIMULATION==="1"}getBuildType(){return qge.packageJson.buildType}getVersion(){return qge.packageJson.version}getBuild(){return qge.packageJson.build}getName(){return qge.packageJson.name}getEditorVersionHeaders(){return{"Editor-Version":this.getEditorInfo().format(),"Editor-Plugin-Version":this.getEditorPluginInfo().format()}}};Kb.AbstractEnvService=vCr;Kb.isScenarioAutomation=dxi.env.IS_SCENARIO_AUTOMATION==="1"});var x0=I(Tte=>{"use strict";p();Object.defineProperty(Tte,"__esModule",{value:!0});Tte.generateUuid=void 0;Tte.isUUID=p2a;Tte.prefixedUuid=h2a;var f2a=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function p2a(t){return f2a.test(t)}a(p2a,"isUUID");Tte.generateUuid=(function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let t=new Uint8Array(16),e=[];for(let r=0;r<256;r++)e.push(r.toString(16).padStart(2,"0"));return a(function(){crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=0,o="";return o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o},"generateUuid")})();function h2a(t){return`${t}-${(0,Tte.generateUuid)()}`}a(h2a,"prefixedUuid")});var fxi=I(tgt=>{"use strict";p();Object.defineProperty(tgt,"__esModule",{value:!0});tgt.CopilotConfigPrefix=void 0;tgt.CopilotConfigPrefix="github.copilot"});var bCr=I(gD=>{"use strict";p();var m2a=gD&&gD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),g2a=gD&&gD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),A2a=gD&&gD.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o(n&&(r=r.bind(n)),t(a(c=>{let l=e(c);l!==void 0&&r(l)},"wrappedListener"),void 0,o))}a(E2a,"transformEvent")});var qE=I(hn=>{"use strict";p();Object.defineProperty(hn,"__esModule",{value:!0});hn.apiVersion=hn.ICompletionsEditorAndPluginInfo=hn.BuildInfo=hn.InMemoryConfigProvider=hn.DefaultsOnlyConfigProvider=hn.ConfigProvider=hn.ICompletionsConfigProvider=hn.BuildType=hn.BlockMode=hn.ConfigKey=hn.packageJson=void 0;hn.shouldDoServerTrimming=C2a;hn.getConfigKeyRecursively=b2a;hn.getConfigDefaultForKey=hxi;hn.getOptionalConfigDefaultForKey=mxi;hn.getConfig=S2a;hn.dumpForTelemetry=T2a;hn.formatNameAndVersion=xCr;hn.editorVersionHeaders=I2a;var rgt=P5e();Object.defineProperty(hn,"packageJson",{enumerable:!0,get:a(function(){return rgt.packageJson},"get")});var pxi=nn(),_2a=fxi(),v2a=bCr();hn.ConfigKey={Enable:"enable",UserSelectedCompletionModel:"selectedCompletionModel",ShowEditorCompletions:"editor.showEditorCompletions",EnableAutoCompletions:"editor.enableAutoCompletions",DelayCompletions:"editor.delayCompletions",FilterCompletions:"editor.filterCompletions",CompletionsDelay:"completionsDelay",CompletionsDebounce:"completionsDebounce",RelatedFilesVSCodeCSharp:"advanced.relatedFilesVSCodeCSharp",RelatedFilesVSCodeTypeScript:"advanced.relatedFilesVSCodeTypeScript",RelatedFilesVSCode:"advanced.relatedFilesVSCode",ContextProviders:"advanced.contextProviders",DebugFilterLogCategories:"advanced.debug.filterLogCategories",DebugSnippyOverrideUrl:"advanced.debug.codeRefOverrideUrl",UseSubsetMatching:"advanced.useSubsetMatching",ContextProviderTimeBudget:"advanced.contextProviderTimeBudget",DebugOverrideCapiUrl:"internal.capiUrl",DebugOverrideCapiUrlLegacy:"advanced.debug.overrideCapiUrl",DebugTestOverrideCapiUrl:"internal.capiTestUrl",DebugTestOverrideCapiUrlLegacy:"advanced.debug.testOverrideCapiUrl",DebugOverrideProxyUrl:"internal.completionsUrl",DebugOverrideProxyUrlLegacy:"advanced.debug.overrideProxyUrl",DebugTestOverrideProxyUrl:"internal.completionsTestUrl",DebugTestOverrideProxyUrlLegacy:"advanced.debug.testOverrideProxyUrl",DebugOverrideEngine:"internal.completionModel",DebugOverrideEngineLegacy:"advanced.debug.overrideEngine",AlwaysRequestMultiline:"internal.alwaysRequestMultiline",ModelAlwaysTerminatesSingleline:"internal.modelAlwaysTerminatesSingleline",UseWorkspaceContextCoordinator:"internal.useWorkspaceContextCoordinator",IncludeNeighboringFiles:"internal.includeNeighboringFiles",ExcludeRelatedFiles:"internal.excludeRelatedFiles",DebugOverrideCppHeadersEnableSwitch:"internal.cppHeadersEnableSwitch",UseSplitContextPrompt:"internal.useSplitContextPrompt"};var ngt;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(ngt||(hn.BlockMode=ngt={}));function C2a(t){return[ngt.Server,ngt.ParsingAndServer].includes(t)}a(C2a,"shouldDoServerTrimming");var Ite;(function(t){t.DEV="dev",t.PROD="prod",t.NIGHTLY="nightly"})(Ite||(hn.BuildType=Ite={}));hn.ICompletionsConfigProvider=(0,pxi.createServiceIdentifier)("ICompletionsConfigProvider");var D5e=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}};hn.ConfigProvider=D5e;var SCr=class extends D5e{static{a(this,"DefaultsOnlyConfigProvider")}constructor(){super(...arguments),this.onDidChangeCopilotSettings=()=>({dispose:a(()=>{},"dispose")})}getConfig(e){return hxi(e)}getOptionalConfig(e){return mxi(e)}dumpForTelemetry(){return{}}};hn.DefaultsOnlyConfigProvider=SCr;var TCr=class extends D5e{static{a(this,"InMemoryConfigProvider")}constructor(e){super(),this.baseConfigProvider=e,this.copilotEmitter=new v2a.Emitter,this.onDidChangeCopilotSettings=this.copilotEmitter.event,this.overrides=new Map}setOverrides(e){this.overrides=e}clearOverrides(){this.overrides.clear()}getOptionalOverride(e){return this.overrides.get(e)}getConfig(e){return this.getOptionalOverride(e)??this.baseConfigProvider.getConfig(e)}getOptionalConfig(e){return this.getOptionalOverride(e)??this.baseConfigProvider.getOptionalConfig(e)}setConfig(e,r){this.setCopilotSettings({[e]:r})}setCopilotSettings(e){for(let[r,n]of Object.entries(e))n!==void 0?this.overrides.set(r,n):this.overrides.delete(r);this.copilotEmitter.fire(this)}dumpForTelemetry(){let e=this.baseConfigProvider.dumpForTelemetry();for(let r of[hn.ConfigKey.ShowEditorCompletions,hn.ConfigKey.EnableAutoCompletions,hn.ConfigKey.DelayCompletions,hn.ConfigKey.FilterCompletions]){let n=this.overrides.get(r);n!==void 0&&(e[r]=JSON.stringify(n))}return e}};hn.InMemoryConfigProvider=TCr;function b2a(t,e){let r=t,n=[];for(let o of e.split(".")){let s=[...n,o].join(".");r&&typeof r=="object"&&s in r?(r=r[s],n.length=0):n.push(o)}if(!(r===void 0||n.length>0))return r}a(b2a,"getConfigKeyRecursively");function hxi(t){if(ICr.has(t))return ICr.get(t);throw new Error(`Missing config default value: ${_2a.CopilotConfigPrefix}.${t}`)}a(hxi,"getConfigDefaultForKey");function mxi(t){return ICr.get(t)}a(mxi,"getOptionalConfigDefaultForKey");var ICr=new Map([[hn.ConfigKey.DebugOverrideCppHeadersEnableSwitch,!1],[hn.ConfigKey.RelatedFilesVSCodeCSharp,!1],[hn.ConfigKey.RelatedFilesVSCodeTypeScript,!1],[hn.ConfigKey.RelatedFilesVSCode,!1],[hn.ConfigKey.IncludeNeighboringFiles,!1],[hn.ConfigKey.ExcludeRelatedFiles,!1],[hn.ConfigKey.ContextProviders,[]],[hn.ConfigKey.DebugSnippyOverrideUrl,""],[hn.ConfigKey.UseSubsetMatching,null],[hn.ConfigKey.ContextProviderTimeBudget,void 0],[hn.ConfigKey.DebugOverrideCapiUrl,""],[hn.ConfigKey.DebugTestOverrideCapiUrl,""],[hn.ConfigKey.DebugOverrideProxyUrl,""],[hn.ConfigKey.DebugTestOverrideProxyUrl,""],[hn.ConfigKey.DebugOverrideEngine,""],[hn.ConfigKey.AlwaysRequestMultiline,void 0],[hn.ConfigKey.CompletionsDebounce,void 0],[hn.ConfigKey.CompletionsDelay,void 0],[hn.ConfigKey.ModelAlwaysTerminatesSingleline,void 0],[hn.ConfigKey.UseWorkspaceContextCoordinator,void 0],[hn.ConfigKey.ShowEditorCompletions,void 0],[hn.ConfigKey.EnableAutoCompletions,void 0],[hn.ConfigKey.DelayCompletions,void 0],[hn.ConfigKey.FilterCompletions,void 0],[hn.ConfigKey.UseSplitContextPrompt,!0],[hn.ConfigKey.Enable,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}],[hn.ConfigKey.UserSelectedCompletionModel,""],[hn.ConfigKey.DebugOverrideEngineLegacy,""],[hn.ConfigKey.DebugOverrideProxyUrlLegacy,""],[hn.ConfigKey.DebugTestOverrideProxyUrlLegacy,""],[hn.ConfigKey.DebugOverrideCapiUrlLegacy,""],[hn.ConfigKey.DebugTestOverrideCapiUrlLegacy,""],[hn.ConfigKey.DebugFilterLogCategories,[]]]);function S2a(t,e){return t.get(hn.ICompletionsConfigProvider).getConfig(e)}a(S2a,"getConfig");function T2a(t){try{return t.get(hn.ICompletionsConfigProvider).dumpForTelemetry()}catch(e){return console.error(`Error dumping config for telemetry: ${e}`),{}}}a(T2a,"dumpForTelemetry");var igt=class t{static{a(this,"BuildInfo")}static isPreRelease(){return this.getBuildType()===Ite.NIGHTLY}static isProduction(){return this.getBuildType()!==Ite.DEV}static getBuildType(){return rgt.packageJson.buildType==="prod"?t.getVersion().length===15?Ite.NIGHTLY:Ite.PROD:Ite.DEV}static getVersion(){return rgt.packageJson.version}static getBuild(){return rgt.packageJson.build}};hn.BuildInfo=igt;function xCr({name:t,version:e}){return`${t}/${e}`}a(xCr,"formatNameAndVersion");hn.ICompletionsEditorAndPluginInfo=(0,pxi.createServiceIdentifier)("ICompletionsEditorAndPluginInfo");hn.apiVersion="2025-05-01";function I2a(t){let e=t.get(hn.ICompletionsEditorAndPluginInfo);return{"Editor-Version":xCr(e.getEditorInfo()),"Editor-Plugin-Version":xCr(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":igt.getVersion()}}a(I2a,"editorVersionHeaders")});var wCr=I(ogt=>{"use strict";p();Object.defineProperty(ogt,"__esModule",{value:!0});ogt.ExpServiceTelemetryNames=void 0;var gxi;(function(t){t.featuresTelemetryPropertyName="VSCode.ABExp.Features"})(gxi||(ogt.ExpServiceTelemetryNames=gxi={}))});var sgt=I(jge=>{"use strict";p();Object.defineProperty(jge,"__esModule",{value:!0});jge.ExpConfig=jge.ExpTreatmentVariables=void 0;var x2a=Yg(),w2a=wCr(),Axi;(function(t){t.CustomEngine="copilotcustomengine",t.CustomEngineTargetEngine="copilotcustomenginetargetengine",t.OverrideBlockMode="copilotoverrideblockmode",t.SuffixPercent="CopilotSuffixPercent",t.CppHeadersEnableSwitch="copilotcppheadersenableswitch",t.UseSubsetMatching="copilotsubsetmatching",t.SuffixMatchThreshold="copilotsuffixmatchthreshold",t.MaxPromptCompletionTokens="maxpromptcompletionTokens",t.StableContextPercent="copilotstablecontextpercent",t.VolatileContextPercent="copilotvolatilecontextpercent",t.RelatedFilesVSCodeCSharp="copilotrelatedfilesvscodecsharp",t.RelatedFilesVSCodeTypeScript="copilotrelatedfilesvscodetypescript",t.RelatedFilesVSCode="copilotrelatedfilesvscode",t.ContextProviders="copilotcontextproviders",t.IncludeNeighboringFiles="copilotincludeneighboringfiles",t.ExcludeRelatedFiles="copilotexcluderelatedfiles",t.ContextProviderTimeBudget="copilotcontextprovidertimebudget",t.CppContextProviderParams="copilotcppContextProviderParams",t.CSharpContextProviderParams="copilotcsharpcontextproviderparams",t.JavaContextProviderParams="copilotjavacontextproviderparams",t.MultiLanguageContextProviderParams="copilotmultilanguagecontextproviderparams",t.TsContextProviderParams="copilottscontextproviderparams",t.CompletionsDebounce="copilotcompletionsdebounce",t.ElectronFetcher="copilotelectronfetcher",t.FetchFetcher="copilotfetchfetcher",t.AsyncCompletionsTimeout="copilotasynccompletionstimeout",t.EnablePromptContextProxyField="copilotenablepromptcontextproxyfield",t.ProgressiveReveal="copilotprogressivereveal",t.ModelAlwaysTerminatesSingleline="copilotmodelterminatesingleline",t.ProgressiveRevealLongLookaheadSize="copilotprogressivereveallonglookaheadsize",t.ProgressiveRevealShortLookaheadSize="copilotprogressiverevealshortlookaheadsize",t.MaxMultilineTokens="copilotmaxmultilinetokens",t.MultilineAfterAcceptLines="copilotmultilineafteracceptlines",t.CompletionsDelay="copilotcompletionsdelay",t.SingleLineUnlessAccepted="copilotsinglelineunlessaccepted"})(Axi||(jge.ExpTreatmentVariables=Axi={}));var RCr=class t{static{a(this,"ExpConfig")}constructor(e,r){this.variables=e,this.features=r}static createFallbackConfig(e,r){return(0,x2a.telemetryExpProblem)(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"")}addToTelemetry(e){e.properties[w2a.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features}};jge.ExpConfig=RCr});var gy=I(agt=>{"use strict";p();Object.defineProperty(agt,"__esModule",{value:!0});agt.ICompletionsFeaturesService=void 0;var R2a=nn();agt.ICompletionsFeaturesService=(0,R2a.createServiceIdentifier)("ICompletionsFeaturesService")});var cgt=I(qG=>{"use strict";p();Object.defineProperty(qG,"__esModule",{value:!0});qG.FilterSettings=qG.Release=qG.Filter=void 0;var xte;(function(t){t.ExtensionRelease="X-VSCode-ExtensionRelease",t.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",t.CopilotEngine="X-Copilot-Engine",t.CopilotOverrideEngine="X-Copilot-OverrideEngine",t.CopilotRepository="X-Copilot-Repository",t.CopilotFileType="X-Copilot-FileType",t.CopilotUserKind="X-Copilot-UserKind",t.CopilotDogfood="X-Copilot-Dogfood",t.CopilotCustomModel="X-Copilot-CustomModel",t.CopilotOrgs="X-Copilot-Orgs",t.CopilotCustomModelNames="X-Copilot-CustomModelNames",t.CopilotTrackingId="X-Copilot-CopilotTrackingId",t.CopilotClientVersion="X-Copilot-ClientVersion",t.CopilotRelatedPluginVersionCppTools="X-Copilot-RelatedPluginVersion-msvscodecpptools",t.CopilotRelatedPluginVersionCMakeTools="X-Copilot-RelatedPluginVersion-msvscodecmaketools",t.CopilotRelatedPluginVersionMakefileTools="X-Copilot-RelatedPluginVersion-msvscodemakefiletools",t.CopilotRelatedPluginVersionCSharpDevKit="X-Copilot-RelatedPluginVersion-msdotnettoolscsdevkit",t.CopilotRelatedPluginVersionPython="X-Copilot-RelatedPluginVersion-mspythonpython",t.CopilotRelatedPluginVersionPylance="X-Copilot-RelatedPluginVersion-mspythonvscodepylance",t.CopilotRelatedPluginVersionJavaPack="X-Copilot-RelatedPluginVersion-vscjavavscodejavapack",t.CopilotRelatedPluginVersionJavaManager="X-Copilot-RelatedPluginVersion-vscjavavscodejavadependency",t.CopilotRelatedPluginVersionTypescript="X-Copilot-RelatedPluginVersion-vscodetypescriptlanguagefeatures",t.CopilotRelatedPluginVersionTypescriptNext="X-Copilot-RelatedPluginVersion-msvscodevscodetypescriptnext",t.CopilotRelatedPluginVersionCSharp="X-Copilot-RelatedPluginVersion-msdotnettoolscsharp",t.CopilotRelatedPluginVersionGithubCopilotChat="X-Copilot-RelatedPluginVersion-githubcopilotchat",t.CopilotRelatedPluginVersionGithubCopilot="X-Copilot-RelatedPluginVersion-githubcopilot"})(xte||(qG.Filter=xte={}));var yxi;(function(t){t.Stable="stable",t.Nightly="nightly"})(yxi||(qG.Release=yxi={}));var k2a={[xte.CopilotClientTimeBucket]:"timeBucket",[xte.CopilotOverrideEngine]:"engine",[xte.CopilotRepository]:"repo",[xte.CopilotFileType]:"fileType",[xte.CopilotUserKind]:"userKind"},kCr=class{static{a(this,"FilterSettings")}constructor(e){this.filters=e;for(let[r,n]of Object.entries(this.filters))n===""&&delete this.filters[r]}addToTelemetry(e){for(let[r,n]of Object.entries(this.filters)){let o=k2a[r];o!==void 0&&(e.properties[o]=n)}}toHeaders(){return{...this.filters}}};qG.FilterSettings=kCr});var vxi=I(Hge=>{"use strict";p();Object.defineProperty(Hge,"__esModule",{value:!0});Hge.JointCompletionsProviderTriggerChangeStrategy=Hge.JointCompletionsProviderStrategy=void 0;var Exi;(function(t){t.Regular="regular",t.CursorEndOfLine="cursorEndOfLine"})(Exi||(Hge.JointCompletionsProviderStrategy=Exi={}));var _xi;(function(t){t.NoTriggerOnRequestInFlight="noTriggerOnRequestInFlight",t.NoTriggerOnCompletionsRequestInFlight="noTriggerOnCompletionsRequestInFlight",t.AlwaysTrigger="alwaysTrigger"})(_xi||(Hge.JointCompletionsProviderTriggerChangeStrategy=_xi={}))});var jG=I(w0=>{"use strict";p();Object.defineProperty(w0,"__esModule",{value:!0});w0.vString=D2a;w0.vNumber=M2a;w0.vBoolean=L2a;w0.vObjAny=F2a;w0.vUndefined=Q2a;w0.vNull=q2a;w0.vNullable=j2a;w0.vUnchecked=bxi;w0.vUnknown=H2a;w0.vRequired=G2a;w0.vObj=$2a;w0.vArray=V2a;w0.vTuple=W2a;w0.vUnion=Sxi;w0.vEnum=z2a;w0.vLiteral=Y2a;w0.vLazy=K2a;var wte=class{static{a(this,"TypeofValidator")}constructor(e){this.type=e}validate(e){return typeof e!==this.type?{content:void 0,error:{message:`Expected ${this.type}, but got ${typeof e}`}}:{content:e,error:void 0}}toSchema(){return{type:this.type}}},P2a=new wte("string");function D2a(){return P2a}a(D2a,"vString");var N2a=new wte("number");function M2a(){return N2a}a(M2a,"vNumber");var O2a=new wte("boolean");function L2a(){return O2a}a(L2a,"vBoolean");var B2a=new wte("object");function F2a(){return B2a}a(F2a,"vObjAny");var U2a=new wte("undefined");function Q2a(){return U2a}a(Q2a,"vUndefined");var PCr=class{static{a(this,"NullValidator")}validate(e){return e!==null?{content:void 0,error:{message:`Expected null, but got ${typeof e}`}}:{content:null,error:void 0}}toSchema(){return{type:"null"}}},Cxi=new PCr;function q2a(){return Cxi}a(q2a,"vNull");function j2a(t){return Sxi(t,Cxi)}a(j2a,"vNullable");function bxi(){return{validate(t){return{content:t,error:void 0}},toSchema(){return{}}}}a(bxi,"vUnchecked");function H2a(){return bxi()}a(H2a,"vUnknown");function G2a(t){return{validate(e){return e===void 0?{content:void 0,error:{message:"Required field is missing"}}:t.validate(e)},toSchema(){return t.toSchema()},isRequired(){return!0}}}a(G2a,"vRequired");function $2a(t){return{validate(e){if(typeof e!="object"||e===null)return{content:void 0,error:{message:"Expected object"}};let r={};for(let n in t){let o=t[n],s=e[n],c=o.isRequired?.()??!1;if(c&&s===void 0)return{content:void 0,error:{message:`Required field '${n}' is missing`}};if(!c&&s===void 0)continue;let{content:l,error:u}=o.validate(s);if(u)return{content:void 0,error:{message:`Error in property '${n}': ${u.message}`}};r[n]=l}return{content:r,error:void 0}},toSchema(){let e=[],r={};for(let[o,s]of Object.entries(t))r[o]=s.toSchema(),s.isRequired?.()&&e.push(o);return{type:"object",properties:r,...e.length>0?{required:e}:{}}}}}a($2a,"vObj");function V2a(t){return{validate(e){if(!Array.isArray(e))return{content:void 0,error:{message:"Expected array"}};let r=[];for(let n=0;ne.toSchema())}}}}a(W2a,"vTuple");function Sxi(...t){return{validate(e){let r;for(let n of t){let{content:o,error:s}=n.validate(e);if(!s)return{content:o,error:void 0};r=s}return{content:void 0,error:r}},toSchema(){return{oneOf:t.map(e=>e.toSchema())}}}}a(Sxi,"vUnion");function z2a(...t){return{validate(e){return t.indexOf(e)===-1?{content:void 0,error:{message:`Expected one of: ${t.join(", ")}`}}:{content:e,error:void 0}},toSchema(){return{enum:t}}}}a(z2a,"vEnum");function Y2a(t){return{validate(e){return e!==t?{content:void 0,error:{message:`Expected: ${t}`}}:{content:e,error:void 0}},toSchema(){return{const:t}}}}a(Y2a,"vLiteral");function K2a(t){return{validate(e){return t().validate(e)},toSchema(){return t().toSchema()}}}a(K2a,"vLazy")});var Txi=I(N5e=>{"use strict";p();Object.defineProperty(N5e,"__esModule",{value:!0});N5e.DocumentSwitchTriggerStrategy=void 0;var J2a=jG(),lgt;(function(t){t.Always="always",t.AfterAcceptance="afterAcceptance"})(lgt||(N5e.DocumentSwitchTriggerStrategy=lgt={}));(function(t){t.VALIDATOR=(0,J2a.vEnum)(t.Always,t.AfterAcceptance)})(lgt||(N5e.DocumentSwitchTriggerStrategy=lgt={}))});var DCr=I(M5e=>{"use strict";p();Object.defineProperty(M5e,"__esModule",{value:!0});M5e.DiffHistoryMergeStrategy=void 0;var Z2a=jG(),ugt;(function(t){t.SameStartLine="sameStartLine",t.Proximity="proximity",t.Hybrid="hybrid"})(ugt||(M5e.DiffHistoryMergeStrategy=ugt={}));(function(t){t.VALIDATOR=(0,Z2a.vEnum)(t.SameStartLine,t.Proximity,t.Hybrid)})(ugt||(M5e.DiffHistoryMergeStrategy=ugt={}))});var fgt=I(O5e=>{"use strict";p();Object.defineProperty(O5e,"__esModule",{value:!0});O5e.ImportChanges=void 0;var X2a=jG(),dgt;(function(t){t.All="all",t.None="none"})(dgt||(O5e.ImportChanges=dgt={}));(function(t){t.VALIDATOR=(0,X2a.vEnum)(t.All,t.None)})(dgt||(O5e.ImportChanges=dgt={}))});var Ay=I(mn=>{"use strict";p();Object.defineProperty(mn,"__esModule",{value:!0});mn.PatchModelPrediction=mn.SpeculativeRequestsAutoExpandEditWindowLines=mn.SpeculativeRequestsCursorPlacement=mn.DuplicateAdditionsMode=mn.SpeculativeRequestsEnablement=mn.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR=mn.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION=mn.MODEL_CONFIGURATION_VALIDATOR=mn.LINT_OPTIONS_VALIDATOR=mn.LANGUAGE_CONTEXT_ENABLED_LANGUAGES=mn.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS=mn.DEFAULT_OPTIONS=mn.ResponseFormat=mn.PromptingStrategy=mn.EditIntent=mn.EarlyDivergenceCancellationMode=mn.AggressivenessLevel=mn.AggressivenessSetting=mn.LintOptionShowCode=mn.LintOptionWarning=mn.CurrentFileOptions=mn.GlobalBudgetOptions=mn.NeighborFilesOptions=mn.RecentlyViewedDocumentsOptions=mn.RecentFileClippingStrategy=mn.IncludeLineNumbersOption=void 0;mn.isPromptingStrategy=eDa;mn.isAggressivenessStrategy=tDa;mn.applyStrategyConfig=nDa;mn.parseLintOptionString=iDa;mn.parseUserHappinessScoreConfigurationString=oDa;var Rxi=sd(),pn=jG(),NCr=fgt(),Jb;(function(t){t.WithSpaceAfter="withSpaceAfter",t.WithoutSpace="withoutSpaceAfter",t.None="none"})(Jb||(mn.IncludeLineNumbersOption=Jb={}));var Rte;(function(t){t.AroundEditRange="aroundEditRange",t.Proportional="proportional"})(Rte||(mn.RecentFileClippingStrategy=Rte={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.AroundEditRange,t.Proportional)})(Rte||(mn.RecentFileClippingStrategy=Rte={}));var MCr;(function(t){t.VALIDATOR=(0,pn.vObj)({nDocuments:(0,pn.vNumber)(),maxTokens:(0,pn.vNumber)(),includeViewedFiles:(0,pn.vBoolean)(),includeLineNumbers:(0,pn.vEnum)(Jb.WithSpaceAfter,Jb.WithoutSpace,Jb.None),clippingStrategy:(0,pn.vEnum)(Rte.AroundEditRange,Rte.Proportional),useLeftoverBudgetFromAbove:(0,pn.vBoolean)()})})(MCr||(mn.RecentlyViewedDocumentsOptions=MCr={}));var Ixi;(function(t){t.VALIDATOR=(0,pn.vObj)({enabled:(0,pn.vBoolean)(),maxTokens:(0,pn.vNumber)()})})(Ixi||(mn.NeighborFilesOptions=Ixi={}));var xxi;(function(t){t.DEFAULT_ORDER=["languageContext","recentlyViewedDocuments","neighborFiles","diffHistory"],t.DEFAULT_SHARES={recentlyViewedDocuments:2/6,languageContext:2/6,neighborFiles:1/6,diffHistory:1/6},t.DEFAULT_TOTAL_TOKENS=6e3})(xxi||(mn.GlobalBudgetOptions=xxi={}));var OCr;(function(t){t.VALIDATOR=(0,pn.vObj)({maxTokens:(0,pn.vNumber)(),includeTags:(0,pn.vBoolean)(),includeLineNumbers:(0,pn.vEnum)(Jb.WithSpaceAfter,Jb.WithoutSpace,Jb.None),includeCursorTag:(0,pn.vBoolean)(),prioritizeAboveCursor:(0,pn.vBoolean)(),useLeftoverBudgetFromAbove:(0,pn.vBoolean)()})})(OCr||(mn.CurrentFileOptions=OCr={}));var Gge;(function(t){t.YES="yes",t.NO="no",t.YES_IF_NO_ERRORS="yesIfNoErrors"})(Gge||(mn.LintOptionWarning=Gge={}));var $ge;(function(t){t.YES="yes",t.NO="no",t.YES_WITH_SURROUNDING="yesWithSurroundingLines"})($ge||(mn.LintOptionShowCode=$ge={}));var pgt;(function(t){t.Default="auto",t.Low="low",t.Medium="medium",t.High="high"})(pgt||(mn.AggressivenessSetting=pgt={}));var HG;(function(t){t.Low="low",t.Medium="medium",t.High="high"})(HG||(mn.AggressivenessLevel=HG={}));var hgt;(function(t){t.Cursor="cursor",t.EditWindow="editWindow",t.Off="off"})(hgt||(mn.EarlyDivergenceCancellationMode=hgt={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.Cursor,t.EditWindow,t.Off)})(hgt||(mn.EarlyDivergenceCancellationMode=hgt={}));(function(t){t.VALIDATOR=(0,pn.vEnum)(t.Default,t.Low,t.Medium,t.High);function e(r){switch(r){case t.Low:return HG.Low;case t.Medium:return HG.Medium;case t.High:return HG.High;case t.Default:return}}a(e,"toLevel"),t.toLevel=e})(pgt||(mn.AggressivenessSetting=pgt={}));var mgt;(function(t){t.NoEdit="no_edit",t.Low="low",t.Medium="medium",t.High="high"})(mgt||(mn.EditIntent=mgt={}));(function(t){function e(o){switch(o){case"no_edit":return t.NoEdit;case"low":return t.Low;case"medium":return t.Medium;case"high":return t.High;default:return t.High}}a(e,"fromString"),t.fromString=e;function r(o){switch(o){case"N":return t.NoEdit;case"L":return t.Low;case"M":return t.Medium;case"H":return t.High;default:return}}a(r,"fromShortName"),t.fromShortName=r;function n(o,s){switch(o){case t.NoEdit:return!1;case t.High:return!0;case t.Medium:return s===HG.Medium||s===HG.High;case t.Low:return s===HG.High;default:(0,Rxi.assertNever)(o)}}a(n,"shouldShowEdit"),t.shouldShowEdit=n})(mgt||(mn.EditIntent=mgt={}));var kl;(function(t){t.CopilotNesXtab="copilotNesXtab",t.UnifiedModel="xtabUnifiedModel",t.Codexv21NesUnified="codexv21nesUnified",t.Nes41Miniv3="nes41miniv3",t.SimplifiedSystemPrompt="simplifiedSystemPrompt",t.Xtab275="xtab275",t.XtabAggressiveness="xtabAggressiveness",t.Xtab275Aggressiveness="xtab275Aggressiveness",t.Xtab275AggressivenessHighLow="xtab275AggressivenessHighLow",t.PatchBased="patchBased",t.PatchBased01="patchBased01",t.PatchBased02="patchBased02",t.PatchBased02WithRecentLineNumbers="patchBased02WithRecentLineNumbers",t.PatchBased02WithoutRecentLineNumbers="patchBased02WithoutRecentLineNumbers",t.Xtab275EditIntent="xtab275EditIntent",t.Xtab275EditIntentShort="xtab275EditIntentShort"})(kl||(mn.PromptingStrategy=kl={}));function eDa(t){return Object.values(kl).includes(t)}a(eDa,"isPromptingStrategy");function tDa(t){return t===kl.XtabAggressiveness||t===kl.Xtab275Aggressiveness||t===kl.Xtab275AggressivenessHighLow||t===kl.Xtab275EditIntent||t===kl.Xtab275EditIntentShort}a(tDa,"isAggressivenessStrategy");var ggt;(function(t){t.CodeBlock="codeBlock",t.UnifiedWithXml="unifiedWithXml",t.EditWindowOnly="editWindowOnly",t.CustomDiffPatch="customDiffPatch",t.EditWindowWithEditIntent="editWindowWithEditIntent",t.EditWindowWithEditIntentShort="editWindowWithEditIntentShort"})(ggt||(mn.ResponseFormat=ggt={}));(function(t){function e(r){switch(r){case kl.UnifiedModel:case kl.Codexv21NesUnified:case kl.Nes41Miniv3:return t.UnifiedWithXml;case kl.Xtab275:case kl.XtabAggressiveness:case kl.Xtab275Aggressiveness:case kl.Xtab275AggressivenessHighLow:return t.EditWindowOnly;case kl.PatchBased:case kl.PatchBased01:case kl.PatchBased02:case kl.PatchBased02WithRecentLineNumbers:case kl.PatchBased02WithoutRecentLineNumbers:return t.CustomDiffPatch;case kl.Xtab275EditIntent:return t.EditWindowWithEditIntent;case kl.Xtab275EditIntentShort:return t.EditWindowWithEditIntentShort;case kl.SimplifiedSystemPrompt:case kl.CopilotNesXtab:case void 0:return t.CodeBlock;default:(0,Rxi.assertNever)(r)}}a(e,"fromPromptingStrategy"),t.fromPromptingStrategy=e})(ggt||(mn.ResponseFormat=ggt={}));mn.DEFAULT_OPTIONS={promptingStrategy:void 0,currentFile:{maxTokens:1500,includeTags:!0,includeLineNumbers:Jb.None,includeCursorTag:!1,prioritizeAboveCursor:!1,useLeftoverBudgetFromAbove:!0},pagedClipping:{pageSize:10},recentlyViewedDocuments:{nDocuments:5,maxTokens:2e3,includeViewedFiles:!1,includeLineNumbers:Jb.None,clippingStrategy:Rte.AroundEditRange,useLeftoverBudgetFromAbove:!1},languageContext:{enabled:!1,maxTokens:2e3,traitPosition:"after"},neighborFiles:{enabled:!1,maxTokens:1e3},diffHistory:{nEntries:25,maxTokens:1e3,onlyForDocsInPrompt:!1,useRelativePaths:!1},lintOptions:void 0,includePostScript:!0};mn.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS={maxLineDistance:1e3,maxLints:5,showCode:$ge.YES_WITH_SURROUNDING,tagName:"linter",warnings:Gge.YES_IF_NO_ERRORS,nRecentFiles:0};mn.LANGUAGE_CONTEXT_ENABLED_LANGUAGES={prompt:!0,instructions:!0,chatagent:!0};var rDa={[kl.CopilotNesXtab]:{includeTagsInCurrentFile:!0},[kl.PatchBased02WithRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:Jb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:Jb.WithoutSpace},supportsNextCursorLinePrediction:!1,allowImportChanges:NCr.ImportChanges.All},[kl.PatchBased02WithoutRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:Jb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:Jb.None},supportsNextCursorLinePrediction:!1,allowImportChanges:NCr.ImportChanges.All}};function nDa(t){let e=t.promptingStrategy===void 0?void 0:rDa[t.promptingStrategy];if(!e)return t;let r=t.currentFile!==void 0||e.currentFile!==void 0,n=t.recentlyViewedDocuments!==void 0||e.recentlyViewedDocuments!==void 0,o=t.lintOptions!==void 0||e.lintOptions!==void 0;return{...t,...e,currentFile:r?{...t.currentFile,...e.currentFile}:void 0,recentlyViewedDocuments:n?{...t.recentlyViewedDocuments,...e.recentlyViewedDocuments}:void 0,lintOptions:o?{...t.lintOptions,...e.lintOptions}:void 0}}a(nDa,"applyStrategyConfig");mn.LINT_OPTIONS_VALIDATOR=(0,pn.vObj)({tagName:(0,pn.vString)(),warnings:(0,pn.vEnum)(Gge.YES,Gge.NO,Gge.YES_IF_NO_ERRORS),showCode:(0,pn.vEnum)($ge.NO,$ge.YES,$ge.YES_WITH_SURROUNDING),maxLints:(0,pn.vNumber)(),maxLineDistance:(0,pn.vNumber)(),nRecentFiles:(0,pn.vNumber)()});mn.MODEL_CONFIGURATION_VALIDATOR=(0,pn.vObj)({modelName:(0,pn.vRequired)((0,pn.vString)()),promptingStrategy:(0,pn.vUnion)((0,pn.vEnum)(...Object.values(kl)),(0,pn.vUndefined)()),includeTagsInCurrentFile:(0,pn.vRequired)((0,pn.vBoolean)()),includePostScript:(0,pn.vUnion)((0,pn.vBoolean)(),(0,pn.vUndefined)()),currentFile:(0,pn.vUnion)(OCr.VALIDATOR,(0,pn.vUndefined)()),recentlyViewedDocuments:(0,pn.vUnion)(MCr.VALIDATOR,(0,pn.vUndefined)()),lintOptions:(0,pn.vUnion)(mn.LINT_OPTIONS_VALIDATOR,(0,pn.vUndefined)()),supportsNextCursorLinePrediction:(0,pn.vUnion)((0,pn.vBoolean)(),(0,pn.vUndefined)()),allowImportChanges:(0,pn.vUnion)(NCr.ImportChanges.VALIDATOR,(0,pn.vUndefined)())});function iDa(t,e){try{let r=JSON.parse(t),n=mn.LINT_OPTIONS_VALIDATOR.validate(r);if(n.error)throw new Error(`Lint options validation failed: ${n.error.message}`);return{...e,...n.content}}catch(r){throw new Error(`Failed to parse lint options string: ${r}`)}}a(iDa,"parseLintOptionString");mn.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION={acceptedScore:1,rejectedScore:0,ignoredScore:.5,highThreshold:.7,mediumThreshold:.4,includeIgnored:!1,ignoredLimit:0,limitConsecutiveIgnored:!1,limitTotalIgnored:!0};var wxi=(0,pn.vObj)({acceptedScore:(0,pn.vRequired)((0,pn.vNumber)()),rejectedScore:(0,pn.vRequired)((0,pn.vNumber)()),ignoredScore:(0,pn.vRequired)((0,pn.vNumber)()),highThreshold:(0,pn.vRequired)((0,pn.vNumber)()),mediumThreshold:(0,pn.vRequired)((0,pn.vNumber)()),includeIgnored:(0,pn.vRequired)((0,pn.vBoolean)()),ignoredLimit:(0,pn.vRequired)((0,pn.vNumber)()),limitConsecutiveIgnored:(0,pn.vRequired)((0,pn.vBoolean)()),limitTotalIgnored:(0,pn.vRequired)((0,pn.vBoolean)())});function L5e(t,e,r){return t>=e&&t<=r}a(L5e,"isInRange");mn.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR={validate(t){let e=wxi.validate(t);if(e.error)return e;let r=e.content;return L5e(r.acceptedScore,0,1)?L5e(r.rejectedScore,0,1)?L5e(r.ignoredScore,0,1)?L5e(r.highThreshold,0,1)?L5e(r.mediumThreshold,0,1)?r.acceptedScore<=r.rejectedScore?{content:void 0,error:{message:"acceptedScore must be greater than rejectedScore to prevent division by zero"}}:r.ignoredScore{"use strict";p();Object.defineProperty(Vge,"__esModule",{value:!0});Vge.TextReplacement=Vge.TextEdit=void 0;var kxi=Sl(),Pxi=sd(),Sgt=Rs(),Cgt=om(),GG=$_(),Tm=nh(),Tgt=Bme(),Dxi=$T(),Igt=class t{static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>wv.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new wv(e,r)])}static delete(e){return new t([new wv(e,"")])}static insert(e,r){return new t([new wv(Tm.Range.fromPositions(e,e),r)])}static fromParallelReplacementsUnsorted(e){let r=e.slice().sort((0,kxi.compareBy)(n=>n.range,Tm.Range.compareRangesUsingStarts));return new t(r)}constructor(e){this.replacements=e,(0,Pxi.assertFn)(()=>(0,Pxi.checkAdjacentItems)(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}normalize(){let e=[];for(let r of this.replacements)if(e.length>0&&e[e.length-1].range.getEndPosition().equals(r.range.getStartPosition())){let n=e[e.length-1];e[e.length-1]=new wv(n.range.plusRange(r.range),n.text+r.text)}else r.isEmpty||e.push(r);return new t(e)}mapPosition(e){let r=0,n=0,o=0;for(let s of this.replacements){let c=s.range.getStartPosition();if(e.isBeforeOrEqual(c))break;let l=s.range.getEndPosition(),u=Tgt.TextLength.ofText(s.text);if(e.isBefore(l)){let d=new GG.Position(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return bgt(d,f)}c.lineNumber+r!==n&&(o=0),r+=u.lineCount-(s.range.endLineNumber-s.range.startLineNumber),u.lineCount===0?l.lineNumber!==c.lineNumber?o+=u.columnCount-(l.column-1):o+=u.columnCount-(l.column-c.column):o=u.columnCount,n=l.lineNumber+r}return new GG.Position(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof GG.Position?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof GG.Position?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return bgt(o,s)}inverseMapPosition(e,r){return this.inverse(r).mapPosition(e)}inverseMapRange(e,r){return this.inverse(r).mapRange(e)}apply(e){let r="",n=new GG.Position(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=bgt(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=bgt(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new Dxi.StringText(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new wv(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=Tgt.TextLength.ofText(s.text),l=GG.Position.lift({lineNumber:s.range.startLineNumber+n,column:s.range.startColumn+(s.range.startLineNumber===r?o:0)}),u=c.createRange(l);e.push(u),n=u.endLineNumber-s.range.endLineNumber,o=u.endColumn-s.range.endColumn,r=s.range.endLineNumber}return e}toReplacement(e){if(this.replacements.length===0)throw new Sgt.BugIndicatingError;if(this.replacements.length===1)return this.replacements[0];let r=this.replacements[0].range.getStartPosition(),n=this.replacements[this.replacements.length-1].range.getEndPosition(),o="";for(let s=0;sr.equals(n))}compose(e){let r=this.normalize(),n=e.normalize();if(r.replacements.length===0)return n;if(n.replacements.length===0)return r;let o=[],s=0,c=1,l=1,u=0,d=0,f=0,h=0,m=null,g=0,A=0,y=!1,E=!1,_=1,v=1;function b(){if(!y)if(sr.toString()).join(` +`):typeof e=="string"?this.toString(new Dxi.StringText(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=Tm.Range.fromPositions(new GG.Position(Math.max(1,r.range.startLineNumber-1),1),r.range.getStartPosition()),c=e.getValueOfRange(s);c.length>10&&(c="..."+c.substring(c.length-10));let l=Tm.Range.fromPositions(r.range.getEndPosition(),new GG.Position(r.range.endLineNumber+1,1)),u=e.getValueOfRange(l);u.length>10&&(u=u.substring(0,10)+"...");let d=o;if(d.length>10){let h=Math.floor(5);d=d.substring(0,h)+"..."+d.substring(d.length-h)}let f=r.text;if(f.length>10){let h=Math.floor(5);f=f.substring(0,h)+"..."+f.substring(f.length-h)}return d.length===0?`${c}\u2770${f}\u2771${u}`:`${c}\u2770${d}\u21A6${f}\u2771${u}`}).join(` +`)}};Vge.TextEdit=Igt;var wv=class t{static{a(this,"TextReplacement")}static joinReplacements(e,r){if(e.length===0)throw new Sgt.BugIndicatingError;if(e.length===1)return e[0];let n=e[0].range.getStartPosition(),o=e[e.length-1].range.getEndPosition(),s="";for(let c=0;c ${r.lineNumber},${r.column}): "${this.text}"`}};kge.TextReplacement=Tv;function J0t(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return _m.Range.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new Z0t.BugIndicatingError("start must be before end");return new _m.Range(t.lineNumber,t.column,e.lineNumber,e.column)}a(J0t,"rangeFromPositions")});var NG=I(DG=>{"use strict";p();Object.defineProperty(DG,"__esModule",{value:!0});DG.SerializedLineReplacement=DG.LineReplacement=DG.LineEdit=void 0;var Hvr=Sl(),qTi=rd(),Lka=em(),m5e=$2(),HTi=kE(),Pge=q_(),Dge=eh(),Nge=h5e(),tgt=class t{static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>vte.deserialize(r)))}static fromStringEdit(e,r){let n=Nge.TextEdit.fromStringEdit(e,r);return t.fromTextEdit(n,r)}static fromTextEdit(e,r){let n=e.replacements,o=[],s=[];for(let c=0;cn.lineRange.startLineNumber,Hvr.numberComparator)),new t(r)}constructor(e){this.replacements=e,(0,qTi.assert)((0,qTi.checkAdjacentItems)(e,(r,n)=>r.lineRange.endLineNumberExclusive<=n.lineRange.startLineNumber))}isEmpty(){return this.replacements.length===0}toEdit(e){let r=[];for(let n of this.replacements){let o=n.toSingleEdit(e);r.push(o)}return new HTi.StringEdit(r)}toString(){return this.replacements.map(e=>e.toString()).join(",")}serialize(){return this.replacements.map(e=>e.serialize())}getNewLineRanges(){let e=[],r=0;for(let n of this.replacements)e.push(m5e.LineRange.ofLength(n.lineRange.startLineNumber+r,n.newLines.length)),r+=n.newLines.length-n.lineRange.length;return e}mapLineNumber(e){let r=0;for(let n of this.replacements){if(n.lineRange.endLineNumberExclusive>e)break;r+=n.newLines.length-n.lineRange.length}return e+r}mapLineRange(e){return new m5e.LineRange(this.mapLineNumber(e.startLineNumber),this.mapLineNumber(e.endLineNumberExclusive))}mapBackLineRange(e,r){return this.inverse(r).mapLineRange(e)}touches(e){return this.replacements.some(r=>e.replacements.some(n=>r.lineRange.intersect(n.lineRange)))}rebase(e){return new t(this.replacements.map(r=>new vte(e.mapLineRange(r.lineRange),r.newLines)))}humanReadablePatch(e){let r=[];function n(l,u,d,f){let h=d==="unmodified"?" ":d==="deleted"?"-":"+";f===void 0&&(f="[[[[[ WARNING: LINE DOES NOT EXIST ]]]]]");let m=l===-1?" ":l.toString().padStart(3," "),g=u===-1?" ":u.toString().padStart(3," ");r.push(`${h} ${m} ${g} ${f}`)}a(n,"pushLine");function o(){r.push("---")}a(o,"pushSeperator");let s=0,c=!0;for(let l of(0,Hvr.groupAdjacentBy)(this.replacements,(u,d)=>u.lineRange.distanceToRange(d.lineRange)<=5)){c?c=!1:o();let u=l[0].lineRange.startLineNumber-2;for(let d of l){for(let m=Math.max(1,u);mg)){let g=e[m-1];n(m,-1,"deleted",g)}for(let m=0;mnew vte(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}};DG.LineEdit=tgt;var vte=class t{static{a(this,"LineReplacement")}static deserialize(e){return new t(m5e.LineRange.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=(0,Lka.splitLines)(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Dge.Range.fromPositions(new Pge.Position(e.range.startLineNumber,1),e.range.getStartPosition()));n[0]=s+n[0];let c=e.range.endLineNumber+1,l=r.getTransformer().getLineLength(e.range.endLineNumber)+1,u=r.getValueOfRange(Dge.Range.fromPositions(e.range.getEndPosition(),new Pge.Position(e.range.endLineNumber,l)));n[n.length-1]=n[n.length-1]+u;let d=e.range.startColumn===r.getTransformer().getLineLength(e.range.startLineNumber)+1,f=e.range.endColumn===1;return d&&n[0].length===s.length&&(o++,n.shift()),n.length>0&&o1){let s=this.lineRange.startLineNumber-1,c=e.getTransformer().getLineLength(s)+1;n=new Pge.Position(s,c)}else n=new Pge.Position(1,1);let o=r.addToPosition(new Pge.Position(1,1));return new Nge.TextReplacement(Dge.Range.fromPositions(n,o),"")}else return new Nge.TextReplacement(new Dge.Range(this.lineRange.startLineNumber,1,this.lineRange.endLineNumberExclusive,1),"")}else if(this.lineRange.isEmpty){let r,n,o,s=this.lineRange.startLineNumber;return s===e.getTransformer().textLength.lineCount+2?(r=s-1,n=e.getTransformer().getLineLength(r)+1,o=this.newLines.map(c=>` +`),o=(0,Cgt.commonPrefixLength)(r,n);r=r.substring(o),n=n.substring(o);let s=(0,Cgt.commonSuffixLength)(r,n);return r=r.substring(0,r.length-s),n=n.substring(0,n.length-s),r===""}toString(){let e=this.range.getStartPosition(),r=this.range.getEndPosition();return`(${e.lineNumber},${e.column} -> ${r.lineNumber},${r.column}): "${this.text}"`}};Vge.TextReplacement=wv;function bgt(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return Tm.Range.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new Sgt.BugIndicatingError("start must be before end");return new Tm.Range(t.lineNumber,t.column,e.lineNumber,e.column)}a(bgt,"rangeFromPositions")});var VG=I($G=>{"use strict";p();Object.defineProperty($G,"__esModule",{value:!0});$G.SerializedLineReplacement=$G.LineReplacement=$G.LineEdit=void 0;var LCr=Sl(),Nxi=sd(),sDa=om(),F5e=X2(),Oxi=ME(),Wge=$_(),zge=nh(),Yge=B5e(),xgt=class t{static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>kte.deserialize(r)))}static fromStringEdit(e,r){let n=Yge.TextEdit.fromStringEdit(e,r);return t.fromTextEdit(n,r)}static fromTextEdit(e,r){let n=e.replacements,o=[],s=[];for(let c=0;cn.lineRange.startLineNumber,LCr.numberComparator)),new t(r)}constructor(e){this.replacements=e,(0,Nxi.assert)((0,Nxi.checkAdjacentItems)(e,(r,n)=>r.lineRange.endLineNumberExclusive<=n.lineRange.startLineNumber))}isEmpty(){return this.replacements.length===0}toEdit(e){let r=[];for(let n of this.replacements){let o=n.toSingleEdit(e);r.push(o)}return new Oxi.StringEdit(r)}toString(){return this.replacements.map(e=>e.toString()).join(",")}serialize(){return this.replacements.map(e=>e.serialize())}getNewLineRanges(){let e=[],r=0;for(let n of this.replacements)e.push(F5e.LineRange.ofLength(n.lineRange.startLineNumber+r,n.newLines.length)),r+=n.newLines.length-n.lineRange.length;return e}mapLineNumber(e){let r=0;for(let n of this.replacements){if(n.lineRange.endLineNumberExclusive>e)break;r+=n.newLines.length-n.lineRange.length}return e+r}mapLineRange(e){return new F5e.LineRange(this.mapLineNumber(e.startLineNumber),this.mapLineNumber(e.endLineNumberExclusive))}mapBackLineRange(e,r){return this.inverse(r).mapLineRange(e)}touches(e){return this.replacements.some(r=>e.replacements.some(n=>r.lineRange.intersect(n.lineRange)))}rebase(e){return new t(this.replacements.map(r=>new kte(e.mapLineRange(r.lineRange),r.newLines)))}humanReadablePatch(e){let r=[];function n(l,u,d,f){let h=d==="unmodified"?" ":d==="deleted"?"-":"+";f===void 0&&(f="[[[[[ WARNING: LINE DOES NOT EXIST ]]]]]");let m=l===-1?" ":l.toString().padStart(3," "),g=u===-1?" ":u.toString().padStart(3," ");r.push(`${h} ${m} ${g} ${f}`)}a(n,"pushLine");function o(){r.push("---")}a(o,"pushSeperator");let s=0,c=!0;for(let l of(0,LCr.groupAdjacentBy)(this.replacements,(u,d)=>u.lineRange.distanceToRange(d.lineRange)<=5)){c?c=!1:o();let u=l[0].lineRange.startLineNumber-2;for(let d of l){for(let m=Math.max(1,u);mg)){let g=e[m-1];n(m,-1,"deleted",g)}for(let m=0;mnew kte(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}};$G.LineEdit=xgt;var kte=class t{static{a(this,"LineReplacement")}static deserialize(e){return new t(F5e.LineRange.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=(0,sDa.splitLines)(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(zge.Range.fromPositions(new Wge.Position(e.range.startLineNumber,1),e.range.getStartPosition()));n[0]=s+n[0];let c=e.range.endLineNumber+1,l=r.getTransformer().getLineLength(e.range.endLineNumber)+1,u=r.getValueOfRange(zge.Range.fromPositions(e.range.getEndPosition(),new Wge.Position(e.range.endLineNumber,l)));n[n.length-1]=n[n.length-1]+u;let d=e.range.startColumn===r.getTransformer().getLineLength(e.range.startLineNumber)+1,f=e.range.endColumn===1;return d&&n[0].length===s.length&&(o++,n.shift()),n.length>0&&o1){let s=this.lineRange.startLineNumber-1,c=e.getTransformer().getLineLength(s)+1;n=new Wge.Position(s,c)}else n=new Wge.Position(1,1);let o=r.addToPosition(new Wge.Position(1,1));return new Yge.TextReplacement(zge.Range.fromPositions(n,o),"")}else return new Yge.TextReplacement(new zge.Range(this.lineRange.startLineNumber,1,this.lineRange.endLineNumberExclusive,1),"")}else if(this.lineRange.isEmpty){let r,n,o,s=this.lineRange.startLineNumber;return s===e.getTransformer().textLength.lineCount+2?(r=s-1,n=e.getTransformer().getLineLength(r)+1,o=this.newLines.map(c=>` `+c).join("")):(r=s,n=1,o=this.newLines.map(c=>c+` -`).join("")),new Nge.TextReplacement(Dge.Range.fromPositions(new Pge.Position(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new Dge.Range(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` -`);return new Nge.TextReplacement(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new HTi.StringReplacement(n,r.text)}toString(){return`${this.lineRange}->${JSON.stringify(this.newLines)}`}serialize(){return[this.lineRange.startLineNumber,this.lineRange.endLineNumberExclusive,this.newLines]}removeCommonSuffixPrefixLines(e){let r=this.lineRange.startLineNumber,n=this.lineRange.endLineNumberExclusive,o=0;for(;rtypeof n=="string")}a(e,"is"),t.is=e})(jTi||(DG.SerializedLineReplacement=jTi={}))});var ogt=I(Mge=>{"use strict";p();Object.defineProperty(Mge,"__esModule",{value:!0});Mge.ArrayMap=Mge.ResponseProcessor=void 0;var Bka=Rs(),rgt=NG(),ngt=$2(),GTi;(function(t){t.DEFAULT_DIFF_PARAMS={emitFastCursorLineChange:"off",nSignificantLinesToConverge:2,nLinesToConverge:3};function e(l){return l===!0?"additiveOnly":l===!1?"off":l}a(e,"mapEmitFastCursorLineChange"),t.mapEmitFastCursorLineChange=e;async function*r(l,u,d,f){let h=new igt;for(let[y,E]of l.entries())h.add(E,y);let m=0,g=-1,A={k:"aligned"};for await(let y of u){if(++g,m>=l.length){switch(A.k){case"aligned":{A={k:"diverged",startLineIdx:m,newLines:[y]};break}case"diverged":A.newLines.push(y)}continue}if(A.k==="aligned"){if(l[m]===y){++m;continue}A={k:"diverged",startLineIdx:m,newLines:[]}}A.newLines.push(y);let E=c(l,d,h,A,m,f);E&&(yield E.singleLineEdit,m=E.convergenceEndIdx,A={k:"aligned"})}switch(A.k){case"diverged":{let y=new ngt.LineRange(A.startLineIdx+1,l.length+1);yield new rgt.LineReplacement(y,A.newLines);break}case"aligned":{if(mu.length)return!1;let d=0;for(let f=0;f[B,B]);if(A.length===0){if(m.emitFastCursorLineChange==="off"||h!==u||f.newLines.length>1)return;let B=l[h],q=f.newLines[0];if(B.trim()===""&&h+10&&v[0]-f.startLineIdx===f.newLines.length-1&&(_="found_significant_matches");g>=0&&(A=A.map(([B,q])=>[B,q-1]),A=A.filter(([B,q])=>q>=0&&h<=q),A=A.filter(([B,q])=>l[q]===f.newLines[g]),A.length!==0);--g)if(++y,n(f.newLines[g])&&++E,E===m.nSignificantLinesToConverge&&(_="found_significant_matches",v=A[0]),y===m.nLinesToConverge){_="found_matches",v=A[0];break}if(!_)return;let b=v[1],T=v[0],w=T-b+1,R=b-f.startLineIdx,x=f.newLines.slice(0,f.newLines.length-w),P=x.length;if(R-P>1&&P>0)return;let D=[f.startLineIdx,b],N=new ngt.LineRange(D[0]+1,D[1]+1);return{singleLineEdit:new rgt.LineReplacement(N,x),convergenceEndIdx:T+1}}a(c,"checkForConvergence")})(GTi||(Mge.ResponseProcessor=GTi={}));var igt=class{static{a(this,"ArrayMap")}constructor(){this.map=new Map}add(e,r){let n=this.map.get(e);n?n.push(r):this.map.set(e,[r])}get(e){return this.map.get(e)||[]}};Mge.ArrayMap=igt});var VTi=I(sgt=>{"use strict";p();Object.defineProperty(sgt,"__esModule",{value:!0});sgt.AlternativeNotebookFormat=void 0;var $Ti;(function(t){t.json="json",t.xml="xml",t.text="text"})($Ti||(sgt.AlternativeNotebookFormat=$Ti={}))});var Pl=I(Ho=>{"use strict";p();var Fka=Ho&&Ho.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Uka=Ho&&Ho.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),A5e=Ho&&Ho.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{this._setUserInfo({isInternal:!!e.copilotToken?.isInternal})}))}getConfigMixedWithDefaults(e){if(e.options?.valueIgnoredForExternals&&!this._isInternal)return this.getDefaultValue(e);let r=this.getConfig(e);return r===void 0?this.getDefaultValue(e):WTi.isObject(r)&&WTi.isObject(e.defaultValue)?{...e.defaultValue,...r}:r}getDefaultValue(e){let r=this.getDefaultValueForConfig(e),n=r==null||r===!1||r===0||r==="";return e.defaultValue===void 0&&n?e.defaultValue:r!==void 0?r:e.defaultValue}_setUserInfo(e){if(this._isInternal===e.isInternal)return;let r=this._isInternal!==e.isInternal;this._isInternal=e.isInternal;let n=new Set;for(let o of Ho.globalConfigRegistry.configs.values())r&&o.options?.valueIgnoredForExternals&&n.add(o.fullyQualifiedId);n.size>0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a(o=>{for(let s of n)if(s===o||s.startsWith(o+".")||o.startsWith(s+"."))return!0;return!1},"affectsConfiguration")})}updateExperimentBasedConfiguration(e){e.length!==0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a(()=>!0,"affectsConfiguration")})}getConfigObservable(e){return this._getObservable_$show2FramesUp(e,()=>this.getConfig(e))}getExperimentBasedConfigObservable(e,r){return this._getObservable_$show2FramesUp(e,()=>this.getExperimentBasedConfig(e,r))}_getObservable_$show2FramesUp(e,r){let n=this.observables.get(e.id);return n||(n=(0,Hka.observableFromEventOpts)({debugName:a(()=>`Configuration Key "${e.id}"`,"debugName")},o=>this._register(this.onDidChangeConfiguration(s=>{s.affectsConfiguration(e.fullyQualifiedId)&&o(s)})),r),this.observables.set(e.id,n)),n}isConfigured(e,r){let n=this.inspectConfig(e,r);return n?.globalValue!==void 0||n?.globalLanguageValue!==void 0||n?.workspaceFolderValue!==void 0||n?.workspaceFolderLanguageValue!==void 0||n?.workspaceValue!==void 0||n?.workspaceLanguageValue!==void 0}getDefaultValueForConfig(e){}};Ho.AbstractConfigurationService=$vr;var agt;function Vka(){if(!agt){agt=new Map;let e=Gka.packageJson.contributes.configuration.map(n=>n.properties),r=Object.assign({},...e);for(let n in r)agt.set(n,r[n].default)}return agt}a(Vka,"getPackageJsonDefaults");function ZTi(t,e,r){let n=`${Ho.CopilotConfigPrefix}.${t}`,o=r?.oldKey?`${Ho.CopilotConfigPrefix}.${r.oldKey}`:void 0,s=Vka(),c=s.has(n),l=s.get(n);if(c&&!jka.equals(e,l))throw new Gvr.BugIndicatingError(`The default value for setting ${t} is different in packageJson and in code`);if(c&&r?.valueIgnoredForExternals)throw new Gvr.BugIndicatingError(`The setting ${t} is public, it therefore cannot be restricted to internal!`);let u=n.startsWith("github.copilot.advanced.")?n.substring(24):void 0;return{id:t,oldId:r?.oldKey,isPublic:c,fullyQualifiedId:n,fullyQualifiedOldId:o,advancedSubKey:u,defaultValue:e,options:r}}a(ZTi,"toBaseConfig");var Vvr=class{static{a(this,"ConfigRegistry")}constructor(){this.configs=new Map}registerConfig(e){this.configs.set(e.fullyQualifiedId,e)}};Ho.globalConfigRegistry=new Vvr;var Wvr=class{static{a(this,"ConfigurationMigrationRegistryImpl")}constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new XTi.Emitter,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e),this._onDidRegisterConfigurationMigrations.fire(e)}};Ho.ConfigurationMigrationRegistry=new Wvr;function lt(t,e,r,n,o,s){if(e===1){let l={...ZTi(t,r,o),configType:1,experimentName:s?.experimentName,validator:n};if(l.advancedSubKey)throw new Gvr.BugIndicatingError("Shared settings cannot be experiment based");return Ho.globalConfigRegistry.registerConfig(l),l}let c={...ZTi(t,r,o),configType:0,validator:n};return Ho.globalConfigRegistry.registerConfig(c),c}a(lt,"defineSetting");function Pt(t,e,r,n,o,s){return o={...o,valueIgnoredForExternals:!0},e===0?lt(t,e,r,n,o):lt(t,e,r,n,o,s)}a(Pt,"defineTeamInternalSetting");function Jvr(t,e){Ho.ConfigurationMigrationRegistry.registerConfigurationMigrations([{key:`${Ho.CopilotConfigPrefix}.${e}`,migrateFn:a(async r=>[[`${Ho.CopilotConfigPrefix}.${t}`,{value:r}],[`${Ho.CopilotConfigPrefix}.${e}`,{value:void 0}]],"migrateFn")}])}a(Jvr,"migrateSetting");function Vg(t,e,r,n){return Jvr(e,t),lt(e,0,r,void 0,{...n,oldKey:t})}a(Vg,"defineAndMigrateSetting");function w0(t,e,r,n,o){return Jvr(e,t),lt(e,1,r,void 0,{...n,oldKey:t},o)}a(w0,"defineAndMigrateExpSetting");Ho.HARD_TOOL_LIMIT=128;var zvr;(function(t){t.GitHub="github",t.GitHubEnterprise="github-enterprise",t.Microsoft="microsoft"})(zvr||(Ho.AuthProviderId=zvr={}));var Yvr;(function(t){t.Default="default",t.Minimal="minimal"})(Yvr||(Ho.AuthPermissionMode=Yvr={}));var g5e;(function(t){t.EntraId="entraId",t.ApiKey="apiKey"})(g5e||(Ho.AzureAuthMode=g5e={}));(function(t){t.MICROSOFT_AUTH_PROVIDER="microsoft",t.COGNITIVE_SERVICES_SCOPE="https://cognitiveservices.azure.com/.default"})(g5e||(Ho.AzureAuthMode=g5e={}));Ho.XTabProviderId="XtabProvider";var Kvr;(function(t){let e;(function(s){s.DebugOverrideProxyUrl=lt("advanced.debug.overrideProxyUrl",0,void 0),s.DebugOverrideAuthType=lt("advanced.debug.overrideAuthType",0,"hmac"),s.DebugOverrideCAPIUrl=lt("advanced.debug.overrideCapiUrl",0,void 0),s.DebugUseNodeFetchFetcher=lt("advanced.debug.useNodeFetchFetcher",0,!0),s.DebugUseNodeFetcher=lt("advanced.debug.useNodeFetcher",0,!1),s.DebugUseElectronFetcher=lt("advanced.debug.useElectronFetcher",0,!0),s.DebugNodeFetchCache=lt("advanced.debug.nodeFetchCache",0,"memory"),s.AuthProvider=lt("advanced.authProvider",0,zvr.GitHub),s.AuthPermissions=lt("advanced.authPermissions",0,Yvr.Default)})(e=t.Shared||(t.Shared={}));let r;(function(s){s.DebugPromptOverrideString=lt("chat.debug.promptOverrideString",0,null),s.DebugPromptOverrideFile=lt("chat.debug.promptOverrideFile",0,null),s.WorkspacePrototypeAdoCodeSearchEndpointOverride=Vg("chat.advanced.workspace.prototypeAdoCodeSearchEndpointOverride","chat.workspace.prototypeAdoCodeSearchEndpointOverride",""),s.FeedbackOnChange=Vg("chat.advanced.feedback.onChange","chat.feedback.onChange",!1),s.ReviewIntent=Vg("chat.advanced.review.intent","chat.review.intent",!1),s.NotebookSummaryExperimentEnabled=Vg("chat.advanced.notebook.summaryExperimentEnabled","chat.notebook.summaryExperimentEnabled",!1),s.NotebookVariableFilteringEnabled=Vg("chat.advanced.notebook.variableFilteringEnabled","chat.notebook.variableFilteringEnabled",!1),s.TerminalToDebuggerPatterns=Vg("chat.advanced.debugTerminalCommandPatterns","chat.debugTerminalCommandPatterns",[]),s.WorkspaceRecordingEnabled=Vg("chat.advanced.localWorkspaceRecording.enabled","chat.localWorkspaceRecording.enabled",!1),s.EditRecordingEnabled=Vg("chat.advanced.editRecording.enabled","chat.editRecording.enabled",!1),s.CodeSearchAgentEnabled=Vg("chat.advanced.codesearch.agent.enabled","chat.codesearch.agent.enabled",!0),s.AgentTemperature=Vg("chat.advanced.agent.temperature","chat.agent.temperature",void 0),s.EnableUserPreferences=Vg("chat.advanced.enableUserPreferences","chat.enableUserPreferences",!1),s.SummarizeAgentConversationHistoryThreshold=Vg("chat.advanced.summarizeAgentConversationHistoryThreshold","chat.summarizeAgentConversationHistoryThreshold",void 0),s.AgentHistorySummarizationMode=Vg("chat.advanced.agentHistorySummarizationMode","chat.agentHistorySummarizationMode",void 0),s.UseResponsesApiTruncation=Vg("chat.advanced.useResponsesApiTruncation","chat.useResponsesApiTruncation",!1),s.OmitBaseAgentInstructions=Vg("chat.advanced.omitBaseAgentInstructions","chat.omitBaseAgentInstructions",!1),s.CLIShowExternalSessions=lt("chat.cli.showExternalSessions",0,!0),s.CLIPlanExitModeEnabled=lt("chat.cli.planExitMode.enabled",0,!0),s.CLIAutoModelEnabled=lt("chat.cli.autoModel.enabled",0,!0),s.CLIModelDetailsEnabled=lt("chat.agent.modelDetails.enabled",0,!0),s.CLIPlanCommandEnabled=lt("chat.cli.planCommand.enabled",0,!0),s.CLIChatLazyLoadSessionItem=lt("chat.cli.lazyLoadSessionItem.enabled",0,!0),s.CLIAIGenerateBranchNames=lt("chat.cli.aiGenerateBranchNames.enabled",0,!0),s.CLIForkSessionsEnabled=lt("chat.cli.forkSessions.enabled",0,!0),s.CLIMCPServerEnabled=Vg("chat.advanced.cli.mcp.enabled","chat.cli.mcp.enabled",!0),s.CLISandboxEnabled=lt("chat.cli.sandbox.enabled",1,"off"),s.CLIBranchSupport=lt("chat.cli.branchSupport.enabled",0,!1),s.CLIIsolationOption=lt("chat.cli.isolationOption.enabled",0,!0),s.CLIAutoCommitEnabled=lt("chat.cli.autoCommit.enabled",0,!0),s.CLISessionController=lt("chat.cli.sessionController.enabled",0,!1),s.CLIThinkingEffortEnabled=lt("chat.cli.thinkingEffort.enabled",0,!0),s.CLIRemoteEnabled=lt("chat.cli.remote.enabled",0,!0),s.CLISessionControllerForSessionsApp=lt("chat.cli.sessionControllerForSessionsApp.enabled",0,!1),s.CLITerminalLinks=lt("chat.cli.terminalLinks.enabled",0,!0),s.CLISessionEventLoggingEnabled=lt("chat.cli.sessionEventLogging.enabled",0,!1),s.RequestLoggerMaxEntries=Vg("chat.advanced.debug.requestLogger.maxEntries","chat.debug.requestLogger.maxEntries",100),s.ProjectLabelsExpanded=w0("chat.advanced.projectLabels.expanded","chat.projectLabels.expanded",!1),s.ProjectLabelsChat=w0("chat.advanced.projectLabels.chat","chat.projectLabels.chat",!1),s.ProjectLabelsInline=w0("chat.advanced.projectLabels.inline","chat.projectLabels.inline",!1),s.WorkspaceMaxLocalIndexSize=w0("chat.advanced.workspace.maxLocalIndexSize","chat.workspace.maxLocalIndexSize",1e5),s.WorkspaceEnableCodeSearch=w0("chat.advanced.workspace.enableCodeSearch","chat.workspace.enableCodeSearch",!0),s.WorkspaceEnableCodeSearchExternalIngest=lt("chat.workspace.codeSearchExternalIngest.enabled",1,!0,void 0,void 0,{experimentName:"copilotchat.config.chat.advanced.workspace.codeSearchExternalIngest.enabled"}),s.WorkspacePreferredEmbeddingsModel=w0("chat.advanced.workspace.preferredEmbeddingsModel","chat.workspace.preferredEmbeddingsModel",""),s.NotebookAlternativeDocumentFormat=w0("chat.advanced.notebook.alternativeFormat","chat.notebook.alternativeFormat",$ka.AlternativeNotebookFormat.xml),s.UseAlternativeNESNotebookFormat=w0("chat.advanced.notebook.alternativeNESFormat.enabled","chat.notebook.alternativeNESFormat.enabled",!1),s.InlineChatReasoningEffort=lt("chat.inlineChat.reasoningEffort",1,"low"),s.InlineChatEnableThinking=lt("chat.inlineChat.enableThinking",1,!1),s.InstantApplyShortModelName=w0("chat.advanced.instantApply.shortContextModelName","chat.instantApply.shortContextModelName","gpt-4o-instant-apply-full-ft-v66-short"),s.InstantApplyShortContextLimit=w0("chat.advanced.instantApply.shortContextLimit","chat.instantApply.shortContextLimit",8e3),s.PromptFileContext=w0("chat.advanced.promptFileContextProvider.enabled","chat.promptFileContextProvider.enabled",!0),s.DefaultToolsGrouped=w0("chat.advanced.tools.defaultToolsGrouped","chat.tools.defaultToolsGrouped",!1),s.Gpt5AlternativePatch=w0("chat.advanced.gpt5AlternativePatch","chat.gpt5AlternativePatch",!1),s.SearchSubagentToolEnabled=lt("chat.searchSubagent.enabled",1,!1),s.SearchSubagentUseAgenticProxy=lt("chat.searchSubagent.useAgenticProxy",1,!1),s.SearchSubagentModel=lt("chat.searchSubagent.model",1,""),s.SearchSubagentToolCallLimit=lt("chat.searchSubagent.toolCallLimit",1,4),s.SearchSubagentThoroughnessEnabled=lt("chat.searchSubagent.thoroughnessEnabled",1,!1),s.ExecutionSubagentToolEnabled=lt("chat.executionSubagent.enabled",1,!1),s.SkillToolEnabled=lt("chat.skillTool.enabled",1,!1),s.GetChangedFilesToolEnabled=lt("chat.getChangedFilesTool.enabled",1,!1),s.ExecutionSubagentUseAgenticProxy=lt("chat.executionSubagent.useAgenticProxy",1,!1),s.ExecutionSubagentModel=lt("chat.executionSubagent.model",1,"gemini-3-flash"),s.ExecutionSubagentToolCallLimit=lt("chat.executionSubagent.toolCallLimit",1,10),s.BackgroundTodoAgentEnabled=lt("chat.agent.backgroundTodoAgent.enabled",1,!1),s.InlineEditsTriggerOnEditorChangeAfterSeconds=w0("chat.advanced.inlineEdits.triggerOnEditorChangeAfterSeconds","chat.inlineEdits.triggerOnEditorChangeAfterSeconds",10),s.InlineEditsNextCursorPredictionDisplayLine=w0("chat.advanced.inlineEdits.nextCursorPrediction.displayLine","chat.inlineEdits.nextCursorPrediction.displayLine",!0),s.InlineEditsNextCursorPredictionCurrentFileMaxTokens=w0("chat.advanced.inlineEdits.nextCursorPrediction.currentFileMaxTokens","chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens",3e3),s.InlineEditsRenameSymbolSuggestions=lt("chat.inlineEdits.renameSymbolSuggestions",1,!0),s.InlineEditsPreferredModel=lt("nextEditSuggestions.preferredModel",1,"none"),s.InlineEditsAggressiveness=lt("nextEditSuggestions.eagerness",1,$c.AggressivenessSetting.Default,$c.AggressivenessSetting.VALIDATOR),s.DiagnosticsContextProvider=w0("chat.advanced.inlineEdits.diagnosticsContextProvider.enabled","chat.inlineEdits.diagnosticsContextProvider.enabled",!1),s.ChatSessionContextProvider=lt("chat.inlineEdits.chatSessionContextProvider.enabled",1,!1),s.Gemini3MultiReplaceString=lt("chat.edits.gemini3MultiReplaceString",1,!1),s.BatchReplaceStringDescriptions=lt("chat.edits.batchReplaceStringDescriptions",1,!1),s.AgentOmitFileAttachmentContents=lt("chat.agent.omitFileAttachmentContents",1,!1),s.InstallExtensionSkillEnabled=lt("chat.installExtensionSkill.enabled",1,!1),s.LargeToolResultsToDiskEnabled=lt("chat.agent.largeToolResultsToDisk.enabled",1,!0),s.LargeToolResultsToDiskThreshold=lt("chat.agent.largeToolResultsToDisk.thresholdBytes",1,8*1024),s.DebugGitHubAuthFailWith=lt("chat.debug.githubAuthFailWith",0,null),s.AgentDebugLogEnabled=w0("agentDebugLog.enabled","chat.agentDebugLog.enabled",!1),s.ChatDebugFileLogging=w0("chat.chatDebug.fileLogging.enabled","chat.agentDebugLog.fileLogging.enabled",!1),s.ChatDebugFileLoggingFlushInterval=Vg("chat.chatDebug.fileLogging.flushIntervalMs","chat.agentDebugLog.fileLogging.flushIntervalMs",4e3),s.ChatDebugFileLoggingMaxRetainedSessionLogs=lt("chat.agentDebugLog.fileLogging.maxRetainedSessionLogs",1,50),s.ChatDebugFileLoggingMaxSessionLogSizeMB=lt("chat.agentDebugLog.fileLogging.maxSessionLogSizeMB",1,100),s.OTelEnabled=lt("chat.otel.enabled",0,!1),s.OTelExporterType=lt("chat.otel.exporterType",0,"otlp-http"),s.OTelOtlpEndpoint=lt("chat.otel.otlpEndpoint",0,"http://localhost:4318"),s.OTelCaptureContent=lt("chat.otel.captureContent",0,!1),s.OTelMaxAttributeSizeChars=lt("chat.otel.maxAttributeSizeChars",0,0),s.OTelOutfile=lt("chat.otel.outfile",0,""),s.OTelDbSpanExporter=lt("chat.otel.dbSpanExporter.enabled",0,!1),s.ReasoningEffortOverride=lt("chat.reasoningEffortOverride",0,null),s.LongToolCallCachePreservation=lt("chat.agent.longToolCallCachePreservation.enabled",1,!1),s.LongToolCallCachePreservationMaxProbes=lt("chat.agent.longToolCallCachePreservation.maxProbes",1,1),s.AnthropicExtendedCacheTtl=lt("chat.anthropic.promptCaching.extendedTtl",1,!1),s.AnthropicExtendedCacheTtlMessages=lt("chat.anthropic.promptCaching.extendedTtlMessages",1,!1),s.ModelCapabilityOverrides=lt("chat.modelCapabilityOverrides",0,{}),s.InlineEditsXtabProviderModelConfiguration=(()=>{let c="chat.advanced.inlineEdits.xtabProvider.modelConfiguration",l="chat.inlineEdits.xtabProvider.modelConfiguration";return Jvr(l,c),lt(l,0,null,$c.MODEL_CONFIGURATION_VALIDATOR,{oldKey:c})})()})(r=t.Advanced||(t.Advanced={}));let n;(function(s){s.DebugOverrideChatMaxTokenNum=Pt("chat.advanced.debug.overrideChatMaxTokenNum",0,0),s.DebugReportFeedback=Pt("chat.advanced.debug.reportFeedback",0,!1),s.DisableRepoInfoTelemetry=Pt("chat.advanced.debug.disableRepoInfoTelemetry",0,!1),s.InlineEditsIgnoreCompletionsDisablement=Pt("chat.advanced.inlineEdits.ignoreCompletionsDisablement",0,!1,(0,x0.vBoolean)()),s.InlineEditsModelPickerEnabled=Pt("chat.advanced.inlineEdits.modelPicker.enabled",1,!1,(0,x0.vBoolean)()),s.InlineEditsUseSlashModels=Pt("chat.advanced.inlineEdits.useSlashModels",1,!0),s.InlineEditsLogContextRecorderEnabled=Pt("chat.advanced.inlineEdits.logContextRecorder.enabled",0,!1),s.InlineEditsHideInternalInterface=Pt("chat.advanced.inlineEdits.hideInternalInterface",0,!1,(0,x0.vBoolean)()),s.InlineEditsLogCancelledRequests=Pt("chat.advanced.inlineEdits.logCancelledRequests",0,!1,(0,x0.vBoolean)()),s.InlineEditsNextCursorPredictionUrl=Pt("chat.advanced.inlineEdits.nextCursorPrediction.url",0,void 0,(0,x0.vString)()),s.InlineEditsNextCursorPredictionApiKey=Pt("chat.advanced.inlineEdits.nextCursorPrediction.apiKey",0,void 0,(0,x0.vString)()),s.InlineEditsXtabProviderUrl=Pt("chat.advanced.inlineEdits.xtabProvider.url",0,void 0,(0,x0.vString)()),s.InlineEditsXtabProviderApiKey=Pt("chat.advanced.inlineEdits.xtabProvider.apiKey",0,void 0,(0,x0.vString)()),s.InlineEditsNextCursorPredictionLintOptions=Pt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptions",0,void 0,$c.LINT_OPTIONS_VALIDATOR),s.InlineEditsInlineCompletionsEnabled=Pt("chat.advanced.inlineEdits.inlineCompletions.enabled",0,!0,(0,x0.vBoolean)()),s.InlineEditsInlineCompletionsAdvanced=Pt("chat.advanced.inlineEdits.inlineCompletions.advancedDetection",1,!0,(0,x0.vBoolean)()),s.InlineEditsNesMimicGhostTextBehavior=Pt("chat.advanced.inlineEdits.nesMimicGhostTextBehavior",1,!1,(0,x0.vBoolean)()),s.InlineEditsXtabProviderUsePrediction=Pt("chat.advanced.inlineEdits.xtabProvider.usePrediction",1,!0,(0,x0.vBoolean)()),s.InlineEditsXtabProviderPatchModelPredictionKind=Pt("chat.advanced.inlineEdits.xtabProvider.patchModelPredictionKind",1,$c.PatchModelPrediction.FilePath,$c.PatchModelPrediction.VALIDATOR),s.InlineEditsXtabProviderPatchFastYieldLineWithCursor=Pt("chat.advanced.inlineEdits.xtabProvider.patchFastYieldLineWithCursor",1,!0,(0,x0.vBoolean)()),s.InlineEditsXtabLanguageContextEnabledLanguages=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabledLanguages",0,lD.LANGUAGE_CONTEXT_ENABLED_LANGUAGES),s.InlineEditsXtabLanguageContextTraitsPosition=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.traitsPosition",1,"before"),s.InlineEditsDiagnosticsExplorationEnabled=Pt("chat.advanced.inlineEdits.inlineEditsDiagnosticsExplorationEnabled",0,!1),s.InternalWelcomeHintEnabled=Pt("chat.advanced.welcomePageHint.enabled",0,!1),s.InlineChatUseCodeMapper=Pt("chat.advanced.inlineChat.useCodeMapper",0,!1),s.EnablePromptRendererTracing=Pt("chat.advanced.promptRenderer.trace",0,!1),s.DebugCollectFetcherTelemetry=Pt("chat.advanced.debug.collectFetcherTelemetry",1,!0),s.DebugShowNetworkStatus=Pt("chat.advanced.debug.showNetworkStatus",1,!1),s.GeminiFunctionCallingMode=Pt("chat.advanced.gemini.functionCallingMode",1,"validated"),s.ModelProviderPreference=Pt("chat.advanced.modelProviderPreference",0,void 0,(0,x0.vString)()),s.UseVSCodeTelemetryLibForGH=Pt("chat.advanced.telemetry.useVSCodeTelemetryLibForGH",1,!1),s.DebugExpUseNodeFetchFetcher=Pt("chat.advanced.debug.useNodeFetchFetcher",1,void 0),s.DebugExpUseNodeFetcher=Pt("chat.advanced.debug.useNodeFetcher",1,void 0),s.DebugExpUseElectronFetcher=Pt("chat.advanced.debug.useElectronFetcher",1,void 0),s.InlineEditsAsyncCompletions=Pt("chat.advanced.inlineEdits.asyncCompletions",1,!0),s.InlineEditsDebounceUseCoreRequestTime=Pt("chat.advanced.inlineEdits.debounceUseCoreRequestTime",1,!1),s.InlineEditsYieldToCopilot=Pt("chat.advanced.inlineEdits.yieldToCopilot",1,!1),s.InlineEditsExcludedProviders=Pt("chat.advanced.inlineEdits.excludedProviders",1,void 0),s.InlineEditsEnableGhCompletionsProvider=Pt("chat.advanced.inlineEdits.githubCompletionsProvider.enabled",1,!1),s.InlineEditsCompletionsUrl=Pt("chat.advanced.inlineEdits.completionsProvider.url",1,void 0),s.InlineEditsDebounce=Pt("chat.advanced.inlineEdits.debounce",1,100),s.InlineEditsCacheCursorDistanceCheck=Pt("chat.advanced.inlineEdits.cacheCursorDistanceCheck",1,!1),s.InlineEditsCacheDelay=Pt("chat.advanced.inlineEdits.cacheDelay",1,200),s.InlineEditsSubsequentCacheDelay=Pt("chat.advanced.inlineEdits.subsequentCacheDelay",1,0),s.InlineEditsSpeculativeRequestDelay=Pt("chat.advanced.inlineEdits.speculativeRequestDelay",1,0),s.InlineEditsRebasedCacheDelay=Pt("chat.advanced.inlineEdits.rebasedCacheDelay",1,0),s.InlineEditsAbsorbSubsequenceTyping=Pt("chat.advanced.inlineEdits.absorbSubsequenceTyping",1,!1),s.InlineEditsReverseAgreement=Pt("chat.advanced.inlineEdits.reverseAgreement",1,!0),s.InlineEditsMaxImperfectAgreementLength=Pt("chat.advanced.inlineEdits.maxImperfectAgreementLength",1,1,(0,x0.vNumber)()),s.InlineEditsBackoffDebounceEnabled=Pt("chat.advanced.inlineEdits.backoffDebounceEnabled",1,!0),s.InlineEditsExtraDebounceEndOfLine=Pt("chat.advanced.inlineEdits.extraDebounceEndOfLine",1,2e3),s.InlineEditsSpeculativeRequests=Pt("chat.advanced.inlineEdits.speculativeRequests",1,lD.SpeculativeRequestsEnablement.Off,lD.SpeculativeRequestsEnablement.VALIDATOR),s.InlineEditsSpeculativeRequestsCursorPlacement=Pt("chat.advanced.inlineEdits.speculativeRequestsCursorPlacement",1,lD.SpeculativeRequestsCursorPlacement.AfterEditApplied,lD.SpeculativeRequestsCursorPlacement.VALIDATOR),s.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines=Pt("chat.advanced.inlineEdits.speculativeRequestsAutoExpandEditWindowLines",1,lD.SpeculativeRequestsAutoExpandEditWindowLines.Off,lD.SpeculativeRequestsAutoExpandEditWindowLines.VALIDATOR),s.InlineEditsExtraDebounceInlineSuggestion=Pt("chat.advanced.inlineEdits.extraDebounceInlineSuggestion",1,0),s.InlineEditsDebounceOnSelectionChange=Pt("chat.advanced.inlineEdits.debounceOnSelectionChange",1,void 0),s.InlineEditsTriggerOnEditorChangeStrategy=Pt("chat.advanced.inlineEdits.triggerOnEditorChangeStrategy",1,YTi.DocumentSwitchTriggerStrategy.AfterAcceptance,YTi.DocumentSwitchTriggerStrategy.VALIDATOR),s.InlineEditsProviderId=Pt("chat.advanced.inlineEdits.providerId",1,void 0),s.InlineEditsUnification=Pt("chat.advanced.inlineEdits.unification",1,!1),s.InlineEditsNextCursorPredictionModelName=Pt("chat.advanced.inlineEdits.nextCursorPrediction.modelName",1,void 0),s.InlineEditsNextCursorPredictionUseEndpointProvider=Pt("chat.advanced.inlineEdits.nextCursorPrediction.useEndpointProvider",0,!1,(0,x0.vBoolean)()),s.InlineEditsNextCursorPredictionMaxResponseTokens=Pt("chat.advanced.inlineEdits.nextCursorPrediction.maxResponseTokens",1,40),s.InlineEditsNextCursorPredictionLintOptionsString=Pt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptionsString",1,void 0),s.InlineEditsXtabProviderModelConfigurationString=Pt("chat.advanced.inlineEdits.xtabProvider.modelConfigurationString",1,void 0),s.InlineEditsXtabProviderDefaultModelConfigurationString=Pt("chat.advanced.inlineEdits.xtabProvider.defaultModelConfigurationString",1,void 0),s.InlineEditsXtabProviderUseVaryingLinesAbove=Pt("chat.advanced.inlineEdits.xtabProvider.useVaryingLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesAbove=Pt("chat.advanced.inlineEdits.xtabProvider.nLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesBelow=Pt("chat.advanced.inlineEdits.xtabProvider.nLinesBelow",1,void 0),s.InlineEditsAutoExpandEditWindowLines=Pt("chat.advanced.inlineEdits.autoExpandEditWindowLines",1,10),s.InlineEditsXtabNRecentlyViewedDocuments=Pt("chat.advanced.inlineEdits.xtabProvider.nRecentlyViewedDocuments",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.nDocuments),s.InlineEditsXtabRecentlyViewedDocumentsMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.maxTokens",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.maxTokens),s.InlineEditsXtabRecentlyViewedIncludeLineNumbers=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.includeLineNumbers",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.includeLineNumbers),s.InlineEditsNextCursorPredictionRecentSnippetsIncludeLineNumbers=Pt("chat.advanced.inlineEdits.nextCursorPrediction.recentSnippets.includeLineNumbers",1,$c.IncludeLineNumbersOption.None),s.InlineEditsXtabDiffNEntries=Pt("chat.advanced.inlineEdits.xtabProvider.diffNEntries",1,$c.DEFAULT_OPTIONS.diffHistory.nEntries),s.InlineEditsXtabDiffMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.diffMaxTokens",1,$c.DEFAULT_OPTIONS.diffHistory.maxTokens),s.InlineEditsXtabDiffMergeStrategy=Pt("chat.advanced.inlineEdits.xtabProvider.diffMergeStrategy",1,KTi.DiffHistoryMergeStrategy.SameStartLine,KTi.DiffHistoryMergeStrategy.VALIDATOR),s.InlineEditsXtabDiffMergeLineGap=Pt("chat.advanced.inlineEdits.xtabProvider.diffMergeLineGap",1,0,(0,x0.vNumber)()),s.InlineEditsXtabDiffMergeSplitAfterMs=Pt("chat.advanced.inlineEdits.xtabProvider.diffMergeSplitAfterMs",1,100,(0,x0.vNumber)()),s.InlineEditsXtabProviderEmitFastCursorLineChange=Pt("chat.advanced.inlineEdits.xtabProvider.emitFastCursorLineChange",1,"additiveOnly"),s.InlineEditsXtabIncludeViewedFiles=Pt("chat.advanced.inlineEdits.xtabProvider.includeViewedFiles",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.includeViewedFiles),s.InlineEditsXtabRecentlyViewedClippingStrategy=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.clippingStrategy",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.clippingStrategy,$c.RecentFileClippingStrategy.VALIDATOR),s.InlineEditsXtabRecentlyViewedUseLeftoverBudgetFromAbove=Pt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.useLeftoverBudgetFromAbove",1,$c.DEFAULT_OPTIONS.recentlyViewedDocuments.useLeftoverBudgetFromAbove),s.InlineEditsXtabPageSize=Pt("chat.advanced.inlineEdits.xtabProvider.pageSize",1,$c.DEFAULT_OPTIONS.pagedClipping.pageSize),s.InlineEditsXtabEditWindowMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.editWindowMaxTokens",1,2e3),s.InlineEditsXtabIncludeTagsInCurrentFile=Pt("chat.advanced.inlineEdits.xtabProvider.includeTagsInCurrentFile",1,$c.DEFAULT_OPTIONS.currentFile.includeTags),s.InlineEditsXtabIncludeLineNumbersInCurrentFile=Pt("chat.advanced.inlineEdits.xtabProvider.includeLineNumbersInCurrentFile",1,$c.DEFAULT_OPTIONS.currentFile.includeLineNumbers),s.InlineEditsXtabIncludeCursorTagInCurrentFile=Pt("chat.advanced.inlineEdits.xtabProvider.includeCursorTagInCurrentFile",1,$c.DEFAULT_OPTIONS.currentFile.includeCursorTag),s.InlineEditsXtabCurrentFileMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.currentFileMaxTokens",1,$c.DEFAULT_OPTIONS.currentFile.maxTokens),s.InlineEditsXtabPrioritizeAboveCursor=Pt("chat.advanced.inlineEdits.xtabProvider.currentFile.prioritizeAboveCursor",1,$c.DEFAULT_OPTIONS.currentFile.prioritizeAboveCursor),s.InlineEditsXtabCurrentFileUseLeftoverBudgetFromAbove=Pt("chat.advanced.inlineEdits.xtabProvider.currentFile.useLeftoverBudgetFromAbove",1,$c.DEFAULT_OPTIONS.currentFile.useLeftoverBudgetFromAbove),s.InlineEditsXtabDiffOnlyForDocsInPrompt=Pt("chat.advanced.inlineEdits.xtabProvider.diffOnlyForDocsInPrompt",1,$c.DEFAULT_OPTIONS.diffHistory.onlyForDocsInPrompt),s.InlineEditsXtabDiffUseRelativePaths=Pt("chat.advanced.inlineEdits.xtabProvider.diffUseRelativePaths",1,$c.DEFAULT_OPTIONS.diffHistory.useRelativePaths),s.InlineEditsXtabNNonSignificantLinesToConverge=Pt("chat.advanced.inlineEdits.xtabProvider.nNonSignificantLinesToConverge",1,JTi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nLinesToConverge),s.InlineEditsXtabNSignificantLinesToConverge=Pt("chat.advanced.inlineEdits.xtabProvider.nSignificantLinesToConverge",1,JTi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nSignificantLinesToConverge),s.InlineEditsXtabEarlyCursorLineDivergenceCancellation=Pt("chat.advanced.inlineEdits.xtabProvider.earlyCursorLineDivergenceCancellation",1,lD.EarlyDivergenceCancellationMode.Off,lD.EarlyDivergenceCancellationMode.VALIDATOR),s.InlineEditsXtabLanguageContextEnabled=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabled",1,$c.DEFAULT_OPTIONS.languageContext.enabled),s.InlineEditsXtabLanguageContextMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.languageContext.maxTokens",1,$c.DEFAULT_OPTIONS.languageContext.maxTokens),s.InlineEditsXtabIncludeNeighborFiles=Pt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.enabled",1,$c.DEFAULT_OPTIONS.neighborFiles.enabled),s.InlineEditsXtabNeighborFilesMaxTokens=Pt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.maxTokens",1,$c.DEFAULT_OPTIONS.neighborFiles.maxTokens),s.InlineEditsXtabGlobalBudgetEnabled=Pt("chat.advanced.inlineEdits.xtabProvider.globalBudget.enabled",1,!1),s.InlineEditsXtabGlobalBudgetTotalTokens=Pt("chat.advanced.inlineEdits.xtabProvider.globalBudget.totalTokens",1,$c.GlobalBudgetOptions.DEFAULT_TOTAL_TOKENS),s.InlineEditsXtabMaxMergeConflictLines=Pt("chat.advanced.inlineEdits.xtabProvider.maxMergeConflictLines",1,void 0),s.InlineEditsXtabOnlyMergeConflictLines=Pt("chat.advanced.inlineEdits.xtabProvider.onlyMergeConflictLines",1,!1),s.InlineEditsXtabDuplicateAdditionsMode=Pt("chat.advanced.inlineEdits.xtabProvider.diffPatch.duplicateAdditionsMode",1,lD.DuplicateAdditionsMode.Off,lD.DuplicateAdditionsMode.VALIDATOR),s.InlineEditsXtabAggressivenessLevel=Pt("chat.advanced.inlineEdits.xtabProvider.aggressivenessLevel",1,void 0),s.InlineEditsAggressivenessLowMinResponseTimeMs=Pt("chat.advanced.inlineEdits.aggressiveness.lowMinResponseTimeMs",1,1500),s.InlineEditsAggressivenessMediumMinResponseTimeMs=Pt("chat.advanced.inlineEdits.aggressiveness.mediumMinResponseTimeMs",1,700),s.InlineEditsAggressivenessHighDebounceMs=Pt("chat.advanced.inlineEdits.aggressiveness.highDebounceMs",1,0),s.InlineEditsUserHappinessScoreConfigurationString=Pt("chat.advanced.inlineEdits.adaptiveAggressivenessConfigurationString",1,void 0),s.InlineEditsUndoInsertionFiltering=Pt("chat.advanced.inlineEdits.undoInsertionFiltering",1,"v1"),s.InlineEditsFilterOutEditsWithSubstrings=Pt("chat.advanced.inlineEdits.filterOutEditsWithSubstrings",1,"<|current_file_content|>,<|/current_file_content|>,<|diff_marker|>"),s.InlineEditsIgnoreWhenSuggestVisible=Pt("chat.advanced.inlineEdits.ignoreWhenSuggestVisible",1,!0),s.InlineEditsJointCompletionsProviderEnabled=Pt("chat.advanced.inlineEdits.jointCompletionsProvider.enabled",1,!1),s.InlineEditsJointCompletionsProviderStrategy=Pt("chat.advanced.inlineEdits.jointCompletionsProvider.strategy",1,zTi.JointCompletionsProviderStrategy.Regular),s.InlineEditsJointCompletionsProviderTriggerChangeStrategy=Pt("chat.advanced.inlineEdits.jointCompletionsProvider.triggerChangeStrategy",1,zTi.JointCompletionsProviderTriggerChangeStrategy.NoTriggerOnCompletionsRequestInFlight),s.InstantApplyModelName=Pt("chat.advanced.instantApply.modelName",1,"gpt-4o-instant-apply-full-ft-v66"),s.VerifyTextDocumentChanges=Pt("chat.advanced.inlineEdits.verifyTextDocumentChanges",1,!1),s.UseAutoModeRouting=Pt("chat.advanced.useAutoModeRouter",1,!1),s.AutoModeRoutingMethod=Pt("chat.advanced.autoModeRoutingMethod",1,"",void 0,void 0,{experimentName:"copilotchat.autoModeRoutingMethod"}),s.InlineCompletionsDefaultDiagnosticsOptions=Pt("chat.advanced.inlineCompletions.defaultDiagnosticsOptionsString",1,void 0),s.RecordExpectedEditEnabled=Pt("chat.advanced.inlineEdits.recordExpectedEdit.enabled",0,!1),s.RecordExpectedEditOnReject=Pt("chat.advanced.inlineEdits.recordExpectedEdit.onReject",0,!1),s.ReadFileCodeFences=Pt("chat.advanced.readFileCodeFences",1,!1),s.EnableReadFileV2=lt("chat.advanced.enableReadFileV2",1,!1),s.AskAgent=lt("chat.advanced.enableAskAgent",1,!1),s.RetryNetworkErrors=lt("chat.advanced.enableRetryNetworkErrors",1,!0),s.RetryServerErrorStatusCodes=lt("chat.advanced.retryServerErrorStatusCodes",1,"500,502"),s.FallbackNodeFetchOnNetworkProcessCrash=lt("chat.advanced.enableFallbackNodeFetchOnNetworkProcessCrash",1,!0),s.ChatRequestPowerSaveBlocker=Pt("chat.advanced.chatRequestPowerSaveBlocker",1,!0),s.ResponsesApiWebSocketEnabled=Pt("chat.advanced.responsesApi.webSocket.enabled",1,!0),s.DebugSimulateWebSocketResponse=Pt("chat.advanced.debug.simulateWebSocketResponse",0,""),s.SessionSyncMaxEventsPerFlush=Pt("chat.advanced.sessionSync.maxEventsPerFlush",1,500),s.SessionSyncSafetyIntervalMs=Pt("chat.advanced.sessionSync.safetyIntervalMs",1,6e4)})(n=t.TeamInternal||(t.TeamInternal={}));let o;(function(s){s.PlanAgentModel=lt("chat.planAgent.model",0,""),s.OllamaEndpoint=lt("chat.byok.ollamaEndpoint",0,"http://localhost:11434"),s.AzureModels=lt("chat.azureModels",0,{}),s.CustomOAIModels=lt("chat.customOAIModels",0,{}),s.AzureAuthType=lt("chat.azureAuthType",0,g5e.EntraId)})(o=t.Deprecated||(t.Deprecated={})),t.Enable=lt("enable",0,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}),t.selectedCompletionsModel=lt("selectedCompletionModel",0,""),t.RateLimitAutoSwitchToAuto=lt("chat.rateLimitAutoSwitchToAuto",0,!1,(0,x0.vBoolean)()),t.ConversationUsePrismCompaction=lt("chat.conversationCompaction.usePrismCompaction",1,!1),t.ConversationCompactionModel=lt("chat.conversationCompaction.model",1,""),t.ConversationPrismCompactionModelFilter=lt("chat.conversationCompaction.prismModelFilter",1,"claude-haiku-4.5,claude-sonnet-4.5,claude-sonnet-4.6,gemini-2.5-pro,gemini-3-flash,gemini-3.5-flash"),t.UseAnthropicMessagesApi=lt("chat.anthropic.useMessagesApi",1,!0),t.AnthropicContextEditingMode=lt("chat.anthropic.contextEditing.mode",1,"off"),t.ResponsesApiReasoningSummary=lt("chat.responsesApiReasoningSummary",1,"detailed"),t.ResponsesApiContextManagementEnabled=lt("chat.responsesApiContextManagement.enabled",1,!1),t.ResponsesApiPromptCacheKeyEnabled=lt("chat.responsesApi.promptCacheKey.enabled",1,!1),t.ResponsesApiPersistentCoTEnabled=lt("chat.responsesApi.persistentCoT.enabled",1,!1),t.Updated53CodexPromptEnabled=lt("chat.updated53CodexPrompt.enabled",1,!0),t.Claude47OpusPromptEnabled=lt("chat.claude47OpusPrompt.enabled",1,!1),t.EnableGpt55GetChangedFilesTool=lt("chat.gpt55GetChangedFilesTool.enabled",1,!0),t.EnableGemini3GetChangedFilesTool=lt("chat.gemini3GetChangedFilesTool.enabled",1,!0),t.EnableGemini3LowReasoningEffort=lt("chat.gemini3LowReasoningEffort.enabled",1,!1),t.EnableGpt55ReadFileTool=lt("chat.gpt55ReadFileTool.enabled",1,!0),t.EnableChatImageUpload=lt("chat.imageUpload.enabled",1,!0),t.AnthropicWebSearchToolEnabled=lt("chat.anthropic.tools.websearch.enabled",1,!1),t.AnthropicWebSearchMaxUses=lt("chat.anthropic.tools.websearch.maxUses",0,5),t.AnthropicWebSearchAllowedDomains=lt("chat.anthropic.tools.websearch.allowedDomains",0,[]),t.AnthropicWebSearchBlockedDomains=lt("chat.anthropic.tools.websearch.blockedDomains",0,[]),t.AnthropicWebSearchUserLocation=lt("chat.anthropic.tools.websearch.userLocation",0,null),t.CodeGenerationInstructions=lt("chat.codeGeneration.instructions",0,[]),t.TestGenerationInstructions=lt("chat.testGeneration.instructions",0,[]),t.CommitMessageGenerationInstructions=lt("chat.commitMessageGeneration.instructions",0,[]),t.PullRequestDescriptionGenerationInstructions=lt("chat.pullRequestDescriptionGeneration.instructions",0,[]),t.SetupTests=lt("chat.setupTests.enabled",0,!0),t.TypeScriptLanguageContext=lt("chat.languageContext.typescript.enabled",1,!0),t.TypeScriptLanguageContextMode=lt("chat.languageContext.typescript.items",1,"double"),t.TypeScriptLanguageContextIncludeDocumentation=lt("chat.languageContext.typescript.includeDocumentation",1,!1),t.TypeScriptLanguageContextCacheTimeout=lt("chat.languageContext.typescript.cacheTimeout",1,500),t.TypeScriptLanguageContextFix=lt("chat.languageContext.fix.typescript.enabled",1,!1),t.TypeScriptLanguageContextInline=lt("chat.languageContext.inline.typescript.enabled",1,!1),t.UseInstructionFiles=lt("chat.codeGeneration.useInstructionFiles",0,!0),t.ReviewAgent=lt("chat.reviewAgent.enabled",0,!0),t.CodeFeedback=lt("chat.reviewSelection.enabled",0,!0),t.CodeFeedbackInstructions=lt("chat.reviewSelection.instructions",0,[]),t.UseProjectTemplates=lt("chat.useProjectTemplates",0,!0),t.ExplainScopeSelection=lt("chat.scopeSelection",0,!1),t.EnableCodeActions=lt("editor.enableCodeActions",0,!0),t.LocaleOverride=lt("chat.localeOverride",0,"auto"),t.TerminalChatLocation=lt("chat.terminalChatLocation",0,"chatView"),t.AutomaticRenameSuggestions=lt("renameSuggestions.triggerAutomatically",0,!0),t.TerminalToDebuggerEnabled=lt("chat.copilotDebugCommand.enabled",0,!0),t.CodeSearchAgentEnabled=lt("chat.codesearch.enabled",0,!1),t.ClaudeAgentEnabled=lt("chat.claudeAgent.enabled",0,!0),t.ClaudeAgentAllowDangerouslySkipPermissions=lt("chat.claudeAgent.allowDangerouslySkipPermissions",0,!1),t.ClaudeAgentAllowAutoPermissions=lt("chat.claudeAgent.allowAutoPermissions",1,!1),t.ClaudeAgentUseSdkExtension=lt("chat.claudeAgent.useSdkExtension",1,!1),t.ClaudeAgentSdkExtensionInstallTimeout=lt("chat.claudeAgent.sdkExtensionInstallTimeout",0,12e4),t.InlineEditsEnabled=lt("nextEditSuggestions.enabled",1,!0),t.CompletionsInChatEnabled=lt("completions.chat.enabled",0,!1),t.InlineEditsEnableDiagnosticsProvider=lt("nextEditSuggestions.fixes",1,!0),t.InlineEditsAllowWhitespaceOnlyChanges=lt("nextEditSuggestions.allowWhitespaceOnlyChanges",1,!0),t.InlineEditsNextCursorPredictionEnabled=lt("nextEditSuggestions.extendedRange",1,!0,void 0,{oldKey:"chat.advanced.inlineEdits.nextCursorPrediction.enabled"}),t.NewWorkspaceCreationAgentEnabled=lt("chat.newWorkspaceCreation.enabled",0,!0),t.NewWorkspaceUseContext7=lt("chat.newWorkspace.useContext7",0,!1),t.SummarizeAgentConversationHistory=lt("chat.summarizeAgentConversationHistory.enabled",0,!0),t.VirtualToolThreshold=lt("chat.virtualTools.threshold",1,Ho.HARD_TOOL_LIMIT),t.CurrentEditorAgentContext=lt("chat.agent.currentEditorContext.enabled",0,!0),t.AutoFixDiagnostics=lt("chat.agent.autoFix",1,!1),t.NotebookFollowCellExecution=lt("chat.notebook.followCellExecution.enabled",0,!1),t.UseAlternativeNESNotebookFormat=lt("chat.notebook.enhancedNextEditSuggestions.enabled",1,!1),t.CustomInstructionsInSystemMessage=lt("chat.customInstructionsInSystemMessage",0,!0),t.EnableAlternateGptPrompt=lt("chat.alternateGptPrompt.enabled",1,!1),t.EnableAlternateGeminiModelFPrompt=lt("chat.alternateGeminiModelFPrompt.enabled",1,!1),t.EnableGemini35FlashReducedToolUsePrompt=lt("chat.gemini35FlashReducedToolUsePrompt.enabled",1,!1),t.EnableOrganizationCustomAgents=lt("chat.organizationCustomAgents.enabled",0,!0),t.EnableOrganizationInstructions=lt("chat.organizationInstructions.enabled",0,!0),t.CompletionsFetcher=lt("chat.completionsFetcher",1,void 0),t.NextEditSuggestionsFetcher=lt("chat.nesFetcher",1,void 0),t.GitHubMcpEnabled=lt("chat.githubMcpServer.enabled",1,!1),t.GitHubMcpToolsets=lt("chat.githubMcpServer.toolsets",0,["default"]),t.GitHubMcpReadonly=lt("chat.githubMcpServer.readonly",0,!1),t.GitHubMcpLockdown=lt("chat.githubMcpServer.lockdown",0,!1),t.GitHubMcpChannel=lt("chat.githubMcpServer.channel",0,"stable"),t.BackgroundAgentEnabled=lt("chat.backgroundAgent.enabled",0,!0),t.CloudAgentEnabled=lt("chat.cloudAgent.enabled",0,!0),t.CloudAgentBackendVersion=lt("chat.cloudAgentBackend.version",1,"v1"),t.AdditionalReadAccessPaths=lt("chat.additionalReadAccessPaths",0,[]),t.SwitchAgentEnabled=lt("chat.switchAgent.enabled",1,!1),t.PlanAgentAdditionalTools=lt("chat.planAgent.additionalTools",0,[]),t.ImplementAgentModel=lt("chat.implementAgent.model",0,""),t.AskAgentAdditionalTools=lt("chat.askAgent.additionalTools",0,[]),t.AskAgentModel=lt("chat.askAgent.model",0,""),t.ExploreAgentEnabled=lt("chat.exploreAgent.enabled",1,!0),t.ExploreAgentModel=lt("chat.exploreAgent.model",0,""),t.ViewImageToolEnabled=lt("chat.tools.viewImage.enabled",1,!0),t.LocalIndexEnabled=lt("chat.localIndex.enabled",1,!1),t.GrepSearchOutputFormat=lt("chat.tools.grepSearch.outputFormat",1,"tag")})(Kvr||(Ho.ConfigKey=Kvr={}));function Wka(){return Object.values(Kvr).flatMap(t=>Object.values(t).map(e=>e.fullyQualifiedId))}a(Wka,"getAllConfigKeys");var zka=[];function Yka(t){return zka.push(t),t}a(Yka,"registerNextEditProviderId")});var Sp=I(hy=>{"use strict";p();Object.defineProperty(hy,"__esModule",{value:!0});hy.LogMemory=hy.LogServiceImpl=hy.ConsoleLog=hy.LogTarget=hy.LogLevel=hy.ILogService=void 0;hy.collectErrorMessages=tIi;hy.collectSingleLineErrorMessage=Zka;hy.sanitizeNetworkErrorForTelemetry=Xka;var Kka=nn(),Jka=Ro();hy.ILogService=(0,Kka.createServiceIdentifier)("ILogService");var BE;(function(t){t[t.Off=0]="Off",t[t.Trace=1]="Trace",t[t.Debug=2]="Debug",t[t.Info=3]="Info",t[t.Warning=4]="Warning",t[t.Error=5]="Error"})(BE||(hy.LogLevel=BE={}));var eIi;(function(t){function e(r){return{logIt:r}}a(e,"fromCallback"),t.fromCallback=e})(eIi||(hy.LogTarget=eIi={}));var Zvr=class{static{a(this,"ConsoleLog")}constructor(e,r=BE.Warning){this.prefix=e,this.minLogLevel=r}logIt(e,r,...n){this.prefix&&(r=`${this.prefix}${r}`),e===BE.Error?console.error(r,...n):e===BE.Warning?console.warn(r,...n):e>=this.minLogLevel&&console.log(r,...n)}};hy.ConsoleLog=Zvr;var Xvr=class extends Jka.Disposable{static{a(this,"LogServiceImpl")}constructor(e){super(),this.logger=new eCr(e)}trace(e){this.logger.trace(e)}debug(e){this.logger.debug(e)}info(e){this.logger.info(e)}warn(e){this.logger.warn(e)}error(e,r){this.logger.error(e,r)}show(e){this.logger.show(e)}createSubLogger(e){return this.logger.createSubLogger(e)}withExtraTarget(e){return this.logger.withExtraTarget(e)}};hy.LogServiceImpl=Xvr;var eCr=class{static{a(this,"LoggerImpl")}constructor(e){this._logTargets=e}_logIt(e,r){lgt.addLog(BE[e],r),this._logTargets.forEach(n=>n.logIt(e,r))}trace(e){this._logIt(BE.Trace,e)}debug(e){this._logIt(BE.Debug,e)}info(e){this._logIt(BE.Info,e)}warn(e){this._logIt(BE.Warning,e)}error(e,r){this._logIt(BE.Error,tIi(e)+(r?`: ${r}`:""))}show(e){this._logTargets.forEach(r=>r.show?.(e))}createSubLogger(e){return new tCr(this,e)}withExtraTarget(e){return new cgt(this,[e])}},tCr=class t{static{a(this,"SubLogger")}constructor(e,r,n){this._parent=e;let s=(Array.isArray(r)?r:[r]).map(c=>`[${c}]`).join("");this._prefix=n?n+s:s}_prefixMessage(e){return`${this._prefix} ${e}`}trace(e){this._parent.trace(this._prefixMessage(e))}debug(e){this._parent.debug(this._prefixMessage(e))}info(e){this._parent.info(this._prefixMessage(e))}warn(e){this._parent.warn(this._prefixMessage(e))}error(e,r){let n=r?this._prefixMessage(r):this._prefix;this._parent.error(e,n)}show(e){this._parent.show(e)}createSubLogger(e){return new t(this._parent,e,this._prefix)}withExtraTarget(e){return new cgt(this,[e],this._prefix)}},cgt=class t{static{a(this,"LoggerWithExtraTargets")}constructor(e,r,n=""){this._parent=e,this._extraTargets=r,this._prefix=n}_notifyExtraTargets(e,r){let n=this._prefix?`${this._prefix} ${r}`:r;for(let o of this._extraTargets)try{o.logIt(e,n)}catch{}}trace(e){this._notifyExtraTargets(BE.Trace,e),this._parent.trace(e)}debug(e){this._notifyExtraTargets(BE.Debug,e),this._parent.debug(e)}info(e){this._notifyExtraTargets(BE.Info,e),this._parent.info(e)}warn(e){this._notifyExtraTargets(BE.Warning,e),this._parent.warn(e)}error(e,r){let n=typeof e=="string"?e:e.message||"Error",o=r?`${n}: ${r}`:n;this._notifyExtraTargets(BE.Error,o),this._parent.error(e,r)}show(e){this._parent.show(e);for(let r of this._extraTargets)try{r.show?.(e)}catch{}}createSubLogger(e){let r=Array.isArray(e)?e:[e],n=this._prefix+r.map(o=>`[${o}]`).join("");return new t(this._parent.createSubLogger(e),this._extraTargets,n)}withExtraTarget(e){return new t(this._parent,[...this._extraTargets,e],this._prefix)}};function tIi(t){let e=new Set;function r(n,o){if(!n||!["object","string"].includes(typeof n)||e.has(n))return"";e.add(n);let c=(typeof n=="string"?n:n.stack||n.message||n.code||"").toString?.()||"";return[c?`${c.split(` +`).join("")),new Yge.TextReplacement(zge.Range.fromPositions(new Wge.Position(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new zge.Range(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` +`);return new Yge.TextReplacement(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new Oxi.StringReplacement(n,r.text)}toString(){return`${this.lineRange}->${JSON.stringify(this.newLines)}`}serialize(){return[this.lineRange.startLineNumber,this.lineRange.endLineNumberExclusive,this.newLines]}removeCommonSuffixPrefixLines(e){let r=this.lineRange.startLineNumber,n=this.lineRange.endLineNumberExclusive,o=0;for(;rtypeof n=="string")}a(e,"is"),t.is=e})(Mxi||($G.SerializedLineReplacement=Mxi={}))});var Pgt=I(Kge=>{"use strict";p();Object.defineProperty(Kge,"__esModule",{value:!0});Kge.ArrayMap=Kge.ResponseProcessor=void 0;var aDa=Rs(),wgt=VG(),Rgt=X2(),Lxi;(function(t){t.DEFAULT_DIFF_PARAMS={emitFastCursorLineChange:"off",nSignificantLinesToConverge:2,nLinesToConverge:3};function e(l){return l===!0?"additiveOnly":l===!1?"off":l}a(e,"mapEmitFastCursorLineChange"),t.mapEmitFastCursorLineChange=e;async function*r(l,u,d,f){let h=new kgt;for(let[y,E]of l.entries())h.add(E,y);let m=0,g=-1,A={k:"aligned"};for await(let y of u){if(++g,m>=l.length){switch(A.k){case"aligned":{A={k:"diverged",startLineIdx:m,newLines:[y]};break}case"diverged":A.newLines.push(y)}continue}if(A.k==="aligned"){if(l[m]===y){++m;continue}A={k:"diverged",startLineIdx:m,newLines:[]}}A.newLines.push(y);let E=c(l,d,h,A,m,f);E&&(yield E.singleLineEdit,m=E.convergenceEndIdx,A={k:"aligned"})}switch(A.k){case"diverged":{let y=new Rgt.LineRange(A.startLineIdx+1,l.length+1);yield new wgt.LineReplacement(y,A.newLines);break}case"aligned":{if(mu.length)return!1;let d=0;for(let f=0;f[B,B]);if(A.length===0){if(m.emitFastCursorLineChange==="off"||h!==u||f.newLines.length>1)return;let B=l[h],j=f.newLines[0];if(B.trim()===""&&h+10&&v[0]-f.startLineIdx===f.newLines.length-1&&(_="found_significant_matches");g>=0&&(A=A.map(([B,j])=>[B,j-1]),A=A.filter(([B,j])=>j>=0&&h<=j),A=A.filter(([B,j])=>l[j]===f.newLines[g]),A.length!==0);--g)if(++y,n(f.newLines[g])&&++E,E===m.nSignificantLinesToConverge&&(_="found_significant_matches",v=A[0]),y===m.nLinesToConverge){_="found_matches",v=A[0];break}if(!_)return;let b=v[1],T=v[0],w=T-b+1,R=b-f.startLineIdx,x=f.newLines.slice(0,f.newLines.length-w),P=x.length;if(R-P>1&&P>0)return;let D=[f.startLineIdx,b],N=new Rgt.LineRange(D[0]+1,D[1]+1);return{singleLineEdit:new wgt.LineReplacement(N,x),convergenceEndIdx:T+1}}a(c,"checkForConvergence")})(Lxi||(Kge.ResponseProcessor=Lxi={}));var kgt=class{static{a(this,"ArrayMap")}constructor(){this.map=new Map}add(e,r){let n=this.map.get(e);n?n.push(r):this.map.set(e,[r])}get(e){return this.map.get(e)||[]}};Kge.ArrayMap=kgt});var Fxi=I(Dgt=>{"use strict";p();Object.defineProperty(Dgt,"__esModule",{value:!0});Dgt.AlternativeNotebookFormat=void 0;var Bxi;(function(t){t.json="json",t.xml="xml",t.text="text"})(Bxi||(Dgt.AlternativeNotebookFormat=Bxi={}))});var Pl=I(Ho=>{"use strict";p();var cDa=Ho&&Ho.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lDa=Ho&&Ho.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Q5e=Ho&&Ho.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{this._setUserInfo({isInternal:!!e.copilotToken?.isInternal})}))}getConfigMixedWithDefaults(e){if(e.options?.valueIgnoredForExternals&&!this._isInternal)return this.getDefaultValue(e);let r=this.getConfig(e);return r===void 0?this.getDefaultValue(e):Uxi.isObject(r)&&Uxi.isObject(e.defaultValue)?{...e.defaultValue,...r}:r}getDefaultValue(e){let r=this.getDefaultValueForConfig(e),n=r==null||r===!1||r===0||r==="";return e.defaultValue===void 0&&n?e.defaultValue:r!==void 0?r:e.defaultValue}_setUserInfo(e){if(this._isInternal===e.isInternal)return;let r=this._isInternal!==e.isInternal;this._isInternal=e.isInternal;let n=new Set;for(let o of Ho.globalConfigRegistry.configs.values())r&&o.options?.valueIgnoredForExternals&&n.add(o.fullyQualifiedId);n.size>0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a(o=>{for(let s of n)if(s===o||s.startsWith(o+".")||o.startsWith(s+"."))return!0;return!1},"affectsConfiguration")})}updateExperimentBasedConfiguration(e){e.length!==0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a(()=>!0,"affectsConfiguration")})}getConfigObservable(e){return this._getObservable_$show2FramesUp(e,()=>this.getConfig(e))}getExperimentBasedConfigObservable(e,r){return this._getObservable_$show2FramesUp(e,()=>this.getExperimentBasedConfig(e,r))}_getObservable_$show2FramesUp(e,r){let n=this.observables.get(e.id);return n||(n=(0,pDa.observableFromEventOpts)({debugName:a(()=>`Configuration Key "${e.id}"`,"debugName")},o=>this._register(this.onDidChangeConfiguration(s=>{s.affectsConfiguration(e.fullyQualifiedId)&&o(s)})),r),this.observables.set(e.id,n)),n}isConfigured(e,r){let n=this.inspectConfig(e,r);return n?.globalValue!==void 0||n?.globalLanguageValue!==void 0||n?.workspaceFolderValue!==void 0||n?.workspaceFolderLanguageValue!==void 0||n?.workspaceValue!==void 0||n?.workspaceLanguageValue!==void 0}getDefaultValueForConfig(e){}};Ho.AbstractConfigurationService=FCr;var Ngt;function gDa(){if(!Ngt){Ngt=new Map;let e=hDa.packageJson.contributes.configuration.map(n=>n.properties),r=Object.assign({},...e);for(let n in r)Ngt.set(n,r[n].default)}return Ngt}a(gDa,"getPackageJsonDefaults");function Gxi(t,e,r){let n=`${Ho.CopilotConfigPrefix}.${t}`,o=r?.oldKey?`${Ho.CopilotConfigPrefix}.${r.oldKey}`:void 0,s=gDa(),c=s.has(n),l=s.get(n);if(c&&!fDa.equals(e,l))throw new BCr.BugIndicatingError(`The default value for setting ${t} is different in packageJson and in code`);if(c&&r?.valueIgnoredForExternals)throw new BCr.BugIndicatingError(`The setting ${t} is public, it therefore cannot be restricted to internal!`);let u=n.startsWith("github.copilot.advanced.")?n.substring(24):void 0;return{id:t,oldId:r?.oldKey,isPublic:c,fullyQualifiedId:n,fullyQualifiedOldId:o,advancedSubKey:u,defaultValue:e,options:r}}a(Gxi,"toBaseConfig");var UCr=class{static{a(this,"ConfigRegistry")}constructor(){this.configs=new Map}registerConfig(e){this.configs.set(e.fullyQualifiedId,e)}};Ho.globalConfigRegistry=new UCr;var QCr=class{static{a(this,"ConfigurationMigrationRegistryImpl")}constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new $xi.Emitter,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e),this._onDidRegisterConfigurationMigrations.fire(e)}};Ho.ConfigurationMigrationRegistry=new QCr;function ct(t,e,r,n,o,s){if(e===1){let l={...Gxi(t,r,o),configType:1,experimentName:s?.experimentName,validator:n};if(l.advancedSubKey)throw new BCr.BugIndicatingError("Shared settings cannot be experiment based");return Ho.globalConfigRegistry.registerConfig(l),l}let c={...Gxi(t,r,o),configType:0,validator:n};return Ho.globalConfigRegistry.registerConfig(c),c}a(ct,"defineSetting");function Dt(t,e,r,n,o,s){return o={...o,valueIgnoredForExternals:!0},e===0?ct(t,e,r,n,o):ct(t,e,r,n,o,s)}a(Dt,"defineTeamInternalSetting");function GCr(t,e){Ho.ConfigurationMigrationRegistry.registerConfigurationMigrations([{key:`${Ho.CopilotConfigPrefix}.${e}`,migrateFn:a(async r=>[[`${Ho.CopilotConfigPrefix}.${t}`,{value:r}],[`${Ho.CopilotConfigPrefix}.${e}`,{value:void 0}]],"migrateFn")}])}a(GCr,"migrateSetting");function Kg(t,e,r,n){return GCr(e,t),ct(e,0,r,void 0,{...n,oldKey:t})}a(Kg,"defineAndMigrateSetting");function k0(t,e,r,n,o){return GCr(e,t),ct(e,1,r,void 0,{...n,oldKey:t},o)}a(k0,"defineAndMigrateExpSetting");Ho.HARD_TOOL_LIMIT=128;var qCr;(function(t){t.GitHub="github",t.GitHubEnterprise="github-enterprise",t.Microsoft="microsoft"})(qCr||(Ho.AuthProviderId=qCr={}));var jCr;(function(t){t.Default="default",t.Minimal="minimal"})(jCr||(Ho.AuthPermissionMode=jCr={}));var U5e;(function(t){t.EntraId="entraId",t.ApiKey="apiKey"})(U5e||(Ho.AzureAuthMode=U5e={}));(function(t){t.MICROSOFT_AUTH_PROVIDER="microsoft",t.COGNITIVE_SERVICES_SCOPE="https://cognitiveservices.azure.com/.default"})(U5e||(Ho.AzureAuthMode=U5e={}));Ho.XTabProviderId="XtabProvider";var HCr;(function(t){let e;(function(s){s.DebugOverrideProxyUrl=ct("advanced.debug.overrideProxyUrl",0,void 0),s.DebugOverrideAuthType=ct("advanced.debug.overrideAuthType",0,"hmac"),s.DebugOverrideCAPIUrl=ct("advanced.debug.overrideCapiUrl",0,void 0),s.DebugUseNodeFetchFetcher=ct("advanced.debug.useNodeFetchFetcher",0,!0),s.DebugUseNodeFetcher=ct("advanced.debug.useNodeFetcher",0,!1),s.DebugUseElectronFetcher=ct("advanced.debug.useElectronFetcher",0,!0),s.DebugNodeFetchCache=ct("advanced.debug.nodeFetchCache",0,"memory"),s.AuthProvider=ct("advanced.authProvider",0,qCr.GitHub),s.AuthPermissions=ct("advanced.authPermissions",0,jCr.Default)})(e=t.Shared||(t.Shared={}));let r;(function(s){s.DebugPromptOverrideString=ct("chat.debug.promptOverrideString",0,null),s.DebugPromptOverrideFile=ct("chat.debug.promptOverrideFile",0,null),s.WorkspacePrototypeAdoCodeSearchEndpointOverride=Kg("chat.advanced.workspace.prototypeAdoCodeSearchEndpointOverride","chat.workspace.prototypeAdoCodeSearchEndpointOverride",""),s.FeedbackOnChange=Kg("chat.advanced.feedback.onChange","chat.feedback.onChange",!1),s.ReviewIntent=Kg("chat.advanced.review.intent","chat.review.intent",!1),s.NotebookSummaryExperimentEnabled=Kg("chat.advanced.notebook.summaryExperimentEnabled","chat.notebook.summaryExperimentEnabled",!1),s.NotebookVariableFilteringEnabled=Kg("chat.advanced.notebook.variableFilteringEnabled","chat.notebook.variableFilteringEnabled",!1),s.TerminalToDebuggerPatterns=Kg("chat.advanced.debugTerminalCommandPatterns","chat.debugTerminalCommandPatterns",[]),s.WorkspaceRecordingEnabled=Kg("chat.advanced.localWorkspaceRecording.enabled","chat.localWorkspaceRecording.enabled",!1),s.EditRecordingEnabled=Kg("chat.advanced.editRecording.enabled","chat.editRecording.enabled",!1),s.CodeSearchAgentEnabled=Kg("chat.advanced.codesearch.agent.enabled","chat.codesearch.agent.enabled",!0),s.AgentTemperature=Kg("chat.advanced.agent.temperature","chat.agent.temperature",void 0),s.EnableUserPreferences=Kg("chat.advanced.enableUserPreferences","chat.enableUserPreferences",!1),s.SummarizeAgentConversationHistoryThreshold=Kg("chat.advanced.summarizeAgentConversationHistoryThreshold","chat.summarizeAgentConversationHistoryThreshold",void 0),s.AgentHistorySummarizationMode=Kg("chat.advanced.agentHistorySummarizationMode","chat.agentHistorySummarizationMode",void 0),s.UseResponsesApiTruncation=Kg("chat.advanced.useResponsesApiTruncation","chat.useResponsesApiTruncation",!1),s.OmitBaseAgentInstructions=Kg("chat.advanced.omitBaseAgentInstructions","chat.omitBaseAgentInstructions",!1),s.CLIShowExternalSessions=ct("chat.cli.showExternalSessions",0,!0),s.CLIPlanExitModeEnabled=ct("chat.cli.planExitMode.enabled",0,!0),s.CLIAutoModelEnabled=ct("chat.cli.autoModel.enabled",0,!0),s.CLIModelDetailsEnabled=ct("chat.agent.modelDetails.enabled",0,!0),s.CLIPlanCommandEnabled=ct("chat.cli.planCommand.enabled",0,!0),s.CLIChatLazyLoadSessionItem=ct("chat.cli.lazyLoadSessionItem.enabled",0,!0),s.CLIAIGenerateBranchNames=ct("chat.cli.aiGenerateBranchNames.enabled",0,!0),s.CLIForkSessionsEnabled=ct("chat.cli.forkSessions.enabled",0,!0),s.CLIMCPServerEnabled=Kg("chat.advanced.cli.mcp.enabled","chat.cli.mcp.enabled",!0),s.CLISandboxEnabled=ct("chat.cli.sandbox.enabled",1,"off"),s.CLIBranchSupport=ct("chat.cli.branchSupport.enabled",0,!1),s.CLIIsolationOption=ct("chat.cli.isolationOption.enabled",0,!0),s.CLIAutoCommitEnabled=ct("chat.cli.autoCommit.enabled",0,!0),s.CLISessionController=ct("chat.cli.sessionController.enabled",0,!1),s.CLIThinkingEffortEnabled=ct("chat.cli.thinkingEffort.enabled",0,!0),s.CLIRemoteEnabled=ct("chat.cli.remote.enabled",0,!0),s.CLISessionControllerForSessionsApp=ct("chat.cli.sessionControllerForSessionsApp.enabled",0,!1),s.CLITerminalLinks=ct("chat.cli.terminalLinks.enabled",0,!0),s.CLISessionEventLoggingEnabled=ct("chat.cli.sessionEventLogging.enabled",0,!1),s.RequestLoggerMaxEntries=Kg("chat.advanced.debug.requestLogger.maxEntries","chat.debug.requestLogger.maxEntries",100),s.ProjectLabelsExpanded=k0("chat.advanced.projectLabels.expanded","chat.projectLabels.expanded",!1),s.ProjectLabelsChat=k0("chat.advanced.projectLabels.chat","chat.projectLabels.chat",!1),s.ProjectLabelsInline=k0("chat.advanced.projectLabels.inline","chat.projectLabels.inline",!1),s.WorkspaceMaxLocalIndexSize=k0("chat.advanced.workspace.maxLocalIndexSize","chat.workspace.maxLocalIndexSize",1e5),s.WorkspaceEnableCodeSearch=k0("chat.advanced.workspace.enableCodeSearch","chat.workspace.enableCodeSearch",!0),s.WorkspaceEnableCodeSearchExternalIngest=ct("chat.workspace.codeSearchExternalIngest.enabled",1,!0,void 0,void 0,{experimentName:"copilotchat.config.chat.advanced.workspace.codeSearchExternalIngest.enabled"}),s.WorkspacePreferredEmbeddingsModel=k0("chat.advanced.workspace.preferredEmbeddingsModel","chat.workspace.preferredEmbeddingsModel",""),s.NotebookAlternativeDocumentFormat=k0("chat.advanced.notebook.alternativeFormat","chat.notebook.alternativeFormat",mDa.AlternativeNotebookFormat.xml),s.UseAlternativeNESNotebookFormat=k0("chat.advanced.notebook.alternativeNESFormat.enabled","chat.notebook.alternativeNESFormat.enabled",!1),s.InlineChatReasoningEffort=ct("chat.inlineChat.reasoningEffort",1,"low"),s.InlineChatEnableThinking=ct("chat.inlineChat.enableThinking",1,!1),s.InstantApplyShortModelName=k0("chat.advanced.instantApply.shortContextModelName","chat.instantApply.shortContextModelName","gpt-4o-instant-apply-full-ft-v66-short"),s.InstantApplyShortContextLimit=k0("chat.advanced.instantApply.shortContextLimit","chat.instantApply.shortContextLimit",8e3),s.PromptFileContext=k0("chat.advanced.promptFileContextProvider.enabled","chat.promptFileContextProvider.enabled",!0),s.DefaultToolsGrouped=k0("chat.advanced.tools.defaultToolsGrouped","chat.tools.defaultToolsGrouped",!1),s.Gpt5AlternativePatch=k0("chat.advanced.gpt5AlternativePatch","chat.gpt5AlternativePatch",!1),s.SearchSubagentToolEnabled=ct("chat.searchSubagent.enabled",1,!1),s.SearchSubagentUseAgenticProxy=ct("chat.searchSubagent.useAgenticProxy",1,!1),s.SearchSubagentModel=ct("chat.searchSubagent.model",1,""),s.SearchSubagentToolCallLimit=ct("chat.searchSubagent.toolCallLimit",1,4),s.SearchSubagentThoroughnessEnabled=ct("chat.searchSubagent.thoroughnessEnabled",1,!1),s.ExecutionSubagentToolEnabled=ct("chat.executionSubagent.enabled",1,!1),s.SkillToolEnabled=ct("chat.skillTool.enabled",1,!1),s.GetChangedFilesToolEnabled=ct("chat.getChangedFilesTool.enabled",1,!1),s.ExecutionSubagentUseAgenticProxy=ct("chat.executionSubagent.useAgenticProxy",1,!1),s.ExecutionSubagentModel=ct("chat.executionSubagent.model",1,"gemini-3-flash"),s.ExecutionSubagentToolCallLimit=ct("chat.executionSubagent.toolCallLimit",1,10),s.BackgroundTodoAgentEnabled=ct("chat.agent.backgroundTodoAgent.enabled",1,!1),s.InlineEditsTriggerOnEditorChangeAfterSeconds=k0("chat.advanced.inlineEdits.triggerOnEditorChangeAfterSeconds","chat.inlineEdits.triggerOnEditorChangeAfterSeconds",10),s.InlineEditsNextCursorPredictionDisplayLine=k0("chat.advanced.inlineEdits.nextCursorPrediction.displayLine","chat.inlineEdits.nextCursorPrediction.displayLine",!0),s.InlineEditsNextCursorPredictionCurrentFileMaxTokens=k0("chat.advanced.inlineEdits.nextCursorPrediction.currentFileMaxTokens","chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens",3e3),s.InlineEditsRenameSymbolSuggestions=ct("chat.inlineEdits.renameSymbolSuggestions",1,!0),s.InlineEditsPreferredModel=ct("nextEditSuggestions.preferredModel",1,"none"),s.InlineEditsAggressiveness=ct("nextEditSuggestions.eagerness",1,Wc.AggressivenessSetting.Default,Wc.AggressivenessSetting.VALIDATOR),s.DiagnosticsContextProvider=k0("chat.advanced.inlineEdits.diagnosticsContextProvider.enabled","chat.inlineEdits.diagnosticsContextProvider.enabled",!1),s.ChatSessionContextProvider=ct("chat.inlineEdits.chatSessionContextProvider.enabled",1,!1),s.Gemini3MultiReplaceString=ct("chat.edits.gemini3MultiReplaceString",1,!1),s.BatchReplaceStringDescriptions=ct("chat.edits.batchReplaceStringDescriptions",1,!1),s.AgentOmitFileAttachmentContents=ct("chat.agent.omitFileAttachmentContents",1,!1),s.InstallExtensionSkillEnabled=ct("chat.installExtensionSkill.enabled",1,!1),s.LargeToolResultsToDiskEnabled=ct("chat.agent.largeToolResultsToDisk.enabled",1,!0),s.LargeToolResultsToDiskThreshold=ct("chat.agent.largeToolResultsToDisk.thresholdBytes",1,8*1024),s.DebugGitHubAuthFailWith=ct("chat.debug.githubAuthFailWith",0,null),s.AgentDebugLogEnabled=k0("agentDebugLog.enabled","chat.agentDebugLog.enabled",!1),s.ChatDebugFileLogging=k0("chat.chatDebug.fileLogging.enabled","chat.agentDebugLog.fileLogging.enabled",!1),s.ChatDebugFileLoggingFlushInterval=Kg("chat.chatDebug.fileLogging.flushIntervalMs","chat.agentDebugLog.fileLogging.flushIntervalMs",4e3),s.ChatDebugFileLoggingMaxRetainedSessionLogs=ct("chat.agentDebugLog.fileLogging.maxRetainedSessionLogs",1,50),s.ChatDebugFileLoggingMaxSessionLogSizeMB=ct("chat.agentDebugLog.fileLogging.maxSessionLogSizeMB",1,100),s.OTelEnabled=ct("chat.otel.enabled",0,!1),s.OTelExporterType=ct("chat.otel.exporterType",0,"otlp-http"),s.OTelOtlpEndpoint=ct("chat.otel.otlpEndpoint",0,"http://localhost:4318"),s.OTelCaptureContent=ct("chat.otel.captureContent",0,!1),s.OTelMaxAttributeSizeChars=ct("chat.otel.maxAttributeSizeChars",0,0),s.OTelOutfile=ct("chat.otel.outfile",0,""),s.OTelDbSpanExporter=ct("chat.otel.dbSpanExporter.enabled",0,!1),s.ReasoningEffortOverride=ct("chat.reasoningEffortOverride",0,null),s.LongToolCallCachePreservation=ct("chat.agent.longToolCallCachePreservation.enabled",1,!1),s.LongToolCallCachePreservationMaxProbes=ct("chat.agent.longToolCallCachePreservation.maxProbes",1,1),s.AnthropicExtendedCacheTtl=ct("chat.anthropic.promptCaching.extendedTtl",1,!1),s.AnthropicExtendedCacheTtlMessages=ct("chat.anthropic.promptCaching.extendedTtlMessages",1,!1),s.ModelCapabilityOverrides=ct("chat.modelCapabilityOverrides",0,{}),s.InlineEditsXtabProviderModelConfiguration=(()=>{let c="chat.advanced.inlineEdits.xtabProvider.modelConfiguration",l="chat.inlineEdits.xtabProvider.modelConfiguration";return GCr(l,c),ct(l,0,null,Wc.MODEL_CONFIGURATION_VALIDATOR,{oldKey:c})})()})(r=t.Advanced||(t.Advanced={}));let n;(function(s){s.DebugOverrideChatMaxTokenNum=Dt("chat.advanced.debug.overrideChatMaxTokenNum",0,0),s.DebugReportFeedback=Dt("chat.advanced.debug.reportFeedback",0,!1),s.DisableRepoInfoTelemetry=Dt("chat.advanced.debug.disableRepoInfoTelemetry",0,!1),s.InlineEditsIgnoreCompletionsDisablement=Dt("chat.advanced.inlineEdits.ignoreCompletionsDisablement",0,!1,(0,R0.vBoolean)()),s.InlineEditsModelPickerEnabled=Dt("chat.advanced.inlineEdits.modelPicker.enabled",1,!1,(0,R0.vBoolean)()),s.InlineEditsUseSlashModels=Dt("chat.advanced.inlineEdits.useSlashModels",1,!0),s.InlineEditsLogContextRecorderEnabled=Dt("chat.advanced.inlineEdits.logContextRecorder.enabled",0,!1),s.InlineEditsHideInternalInterface=Dt("chat.advanced.inlineEdits.hideInternalInterface",0,!1,(0,R0.vBoolean)()),s.InlineEditsLogCancelledRequests=Dt("chat.advanced.inlineEdits.logCancelledRequests",0,!1,(0,R0.vBoolean)()),s.InlineEditsNextCursorPredictionUrl=Dt("chat.advanced.inlineEdits.nextCursorPrediction.url",0,void 0,(0,R0.vString)()),s.InlineEditsNextCursorPredictionApiKey=Dt("chat.advanced.inlineEdits.nextCursorPrediction.apiKey",0,void 0,(0,R0.vString)()),s.InlineEditsXtabProviderUrl=Dt("chat.advanced.inlineEdits.xtabProvider.url",0,void 0,(0,R0.vString)()),s.InlineEditsXtabProviderApiKey=Dt("chat.advanced.inlineEdits.xtabProvider.apiKey",0,void 0,(0,R0.vString)()),s.InlineEditsNextCursorPredictionLintOptions=Dt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptions",0,void 0,Wc.LINT_OPTIONS_VALIDATOR),s.InlineEditsInlineCompletionsEnabled=Dt("chat.advanced.inlineEdits.inlineCompletions.enabled",0,!0,(0,R0.vBoolean)()),s.InlineEditsInlineCompletionsAdvanced=Dt("chat.advanced.inlineEdits.inlineCompletions.advancedDetection",1,!0,(0,R0.vBoolean)()),s.InlineEditsNesMimicGhostTextBehavior=Dt("chat.advanced.inlineEdits.nesMimicGhostTextBehavior",1,!1,(0,R0.vBoolean)()),s.InlineEditsXtabProviderUsePrediction=Dt("chat.advanced.inlineEdits.xtabProvider.usePrediction",1,!0,(0,R0.vBoolean)()),s.InlineEditsXtabProviderPatchModelPredictionKind=Dt("chat.advanced.inlineEdits.xtabProvider.patchModelPredictionKind",1,Wc.PatchModelPrediction.FilePath,Wc.PatchModelPrediction.VALIDATOR),s.InlineEditsXtabProviderPatchFastYieldLineWithCursor=Dt("chat.advanced.inlineEdits.xtabProvider.patchFastYieldLineWithCursor",1,!0,(0,R0.vBoolean)()),s.InlineEditsXtabLanguageContextEnabledLanguages=Dt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabledLanguages",0,AD.LANGUAGE_CONTEXT_ENABLED_LANGUAGES),s.InlineEditsXtabLanguageContextTraitsPosition=Dt("chat.advanced.inlineEdits.xtabProvider.languageContext.traitsPosition",1,"before"),s.InlineEditsDiagnosticsExplorationEnabled=Dt("chat.advanced.inlineEdits.inlineEditsDiagnosticsExplorationEnabled",0,!1),s.InternalWelcomeHintEnabled=Dt("chat.advanced.welcomePageHint.enabled",0,!1),s.InlineChatUseCodeMapper=Dt("chat.advanced.inlineChat.useCodeMapper",0,!1),s.EnablePromptRendererTracing=Dt("chat.advanced.promptRenderer.trace",0,!1),s.DebugCollectFetcherTelemetry=Dt("chat.advanced.debug.collectFetcherTelemetry",1,!0),s.DebugShowNetworkStatus=Dt("chat.advanced.debug.showNetworkStatus",1,!1),s.GeminiFunctionCallingMode=Dt("chat.advanced.gemini.functionCallingMode",1,"validated"),s.ModelProviderPreference=Dt("chat.advanced.modelProviderPreference",0,void 0,(0,R0.vString)()),s.UseVSCodeTelemetryLibForGH=Dt("chat.advanced.telemetry.useVSCodeTelemetryLibForGH",1,!1),s.DebugExpUseNodeFetchFetcher=Dt("chat.advanced.debug.useNodeFetchFetcher",1,void 0),s.DebugExpUseNodeFetcher=Dt("chat.advanced.debug.useNodeFetcher",1,void 0),s.DebugExpUseElectronFetcher=Dt("chat.advanced.debug.useElectronFetcher",1,void 0),s.InlineEditsAsyncCompletions=Dt("chat.advanced.inlineEdits.asyncCompletions",1,!0),s.InlineEditsDebounceUseCoreRequestTime=Dt("chat.advanced.inlineEdits.debounceUseCoreRequestTime",1,!1),s.InlineEditsYieldToCopilot=Dt("chat.advanced.inlineEdits.yieldToCopilot",1,!1),s.InlineEditsExcludedProviders=Dt("chat.advanced.inlineEdits.excludedProviders",1,void 0),s.InlineEditsEnableGhCompletionsProvider=Dt("chat.advanced.inlineEdits.githubCompletionsProvider.enabled",1,!1),s.InlineEditsCompletionsUrl=Dt("chat.advanced.inlineEdits.completionsProvider.url",1,void 0),s.InlineEditsDebounce=Dt("chat.advanced.inlineEdits.debounce",1,100),s.InlineEditsCacheCursorDistanceCheck=Dt("chat.advanced.inlineEdits.cacheCursorDistanceCheck",1,!1),s.InlineEditsCacheDelay=Dt("chat.advanced.inlineEdits.cacheDelay",1,200),s.InlineEditsSubsequentCacheDelay=Dt("chat.advanced.inlineEdits.subsequentCacheDelay",1,0),s.InlineEditsSpeculativeRequestDelay=Dt("chat.advanced.inlineEdits.speculativeRequestDelay",1,0),s.InlineEditsRebasedCacheDelay=Dt("chat.advanced.inlineEdits.rebasedCacheDelay",1,0),s.InlineEditsAbsorbSubsequenceTyping=Dt("chat.advanced.inlineEdits.absorbSubsequenceTyping",1,!1),s.InlineEditsReverseAgreement=Dt("chat.advanced.inlineEdits.reverseAgreement",1,!0),s.InlineEditsMaxImperfectAgreementLength=Dt("chat.advanced.inlineEdits.maxImperfectAgreementLength",1,1,(0,R0.vNumber)()),s.InlineEditsBackoffDebounceEnabled=Dt("chat.advanced.inlineEdits.backoffDebounceEnabled",1,!0),s.InlineEditsExtraDebounceEndOfLine=Dt("chat.advanced.inlineEdits.extraDebounceEndOfLine",1,2e3),s.InlineEditsSpeculativeRequests=Dt("chat.advanced.inlineEdits.speculativeRequests",1,AD.SpeculativeRequestsEnablement.Off,AD.SpeculativeRequestsEnablement.VALIDATOR),s.InlineEditsSpeculativeRequestsCursorPlacement=Dt("chat.advanced.inlineEdits.speculativeRequestsCursorPlacement",1,AD.SpeculativeRequestsCursorPlacement.AfterEditApplied,AD.SpeculativeRequestsCursorPlacement.VALIDATOR),s.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines=Dt("chat.advanced.inlineEdits.speculativeRequestsAutoExpandEditWindowLines",1,AD.SpeculativeRequestsAutoExpandEditWindowLines.Off,AD.SpeculativeRequestsAutoExpandEditWindowLines.VALIDATOR),s.InlineEditsExtraDebounceInlineSuggestion=Dt("chat.advanced.inlineEdits.extraDebounceInlineSuggestion",1,0),s.InlineEditsDebounceOnSelectionChange=Dt("chat.advanced.inlineEdits.debounceOnSelectionChange",1,void 0),s.InlineEditsTriggerOnEditorChangeStrategy=Dt("chat.advanced.inlineEdits.triggerOnEditorChangeStrategy",1,qxi.DocumentSwitchTriggerStrategy.AfterAcceptance,qxi.DocumentSwitchTriggerStrategy.VALIDATOR),s.InlineEditsProviderId=Dt("chat.advanced.inlineEdits.providerId",1,void 0),s.InlineEditsUnification=Dt("chat.advanced.inlineEdits.unification",1,!1),s.InlineEditsNextCursorPredictionModelName=Dt("chat.advanced.inlineEdits.nextCursorPrediction.modelName",1,void 0),s.InlineEditsNextCursorPredictionUseEndpointProvider=Dt("chat.advanced.inlineEdits.nextCursorPrediction.useEndpointProvider",0,!1,(0,R0.vBoolean)()),s.InlineEditsNextCursorPredictionMaxResponseTokens=Dt("chat.advanced.inlineEdits.nextCursorPrediction.maxResponseTokens",1,40),s.InlineEditsNextCursorPredictionLintOptionsString=Dt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptionsString",1,void 0),s.InlineEditsXtabProviderModelConfigurationString=Dt("chat.advanced.inlineEdits.xtabProvider.modelConfigurationString",1,void 0),s.InlineEditsXtabProviderDefaultModelConfigurationString=Dt("chat.advanced.inlineEdits.xtabProvider.defaultModelConfigurationString",1,void 0),s.InlineEditsXtabProviderUseVaryingLinesAbove=Dt("chat.advanced.inlineEdits.xtabProvider.useVaryingLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesAbove=Dt("chat.advanced.inlineEdits.xtabProvider.nLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesBelow=Dt("chat.advanced.inlineEdits.xtabProvider.nLinesBelow",1,void 0),s.InlineEditsAutoExpandEditWindowLines=Dt("chat.advanced.inlineEdits.autoExpandEditWindowLines",1,10),s.InlineEditsXtabNRecentlyViewedDocuments=Dt("chat.advanced.inlineEdits.xtabProvider.nRecentlyViewedDocuments",1,Wc.DEFAULT_OPTIONS.recentlyViewedDocuments.nDocuments),s.InlineEditsXtabRecentlyViewedDocumentsMaxTokens=Dt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.maxTokens",1,Wc.DEFAULT_OPTIONS.recentlyViewedDocuments.maxTokens),s.InlineEditsXtabRecentlyViewedIncludeLineNumbers=Dt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.includeLineNumbers",1,Wc.DEFAULT_OPTIONS.recentlyViewedDocuments.includeLineNumbers),s.InlineEditsNextCursorPredictionRecentSnippetsIncludeLineNumbers=Dt("chat.advanced.inlineEdits.nextCursorPrediction.recentSnippets.includeLineNumbers",1,Wc.IncludeLineNumbersOption.None),s.InlineEditsXtabDiffNEntries=Dt("chat.advanced.inlineEdits.xtabProvider.diffNEntries",1,Wc.DEFAULT_OPTIONS.diffHistory.nEntries),s.InlineEditsXtabDiffMaxTokens=Dt("chat.advanced.inlineEdits.xtabProvider.diffMaxTokens",1,Wc.DEFAULT_OPTIONS.diffHistory.maxTokens),s.InlineEditsXtabDiffMergeStrategy=Dt("chat.advanced.inlineEdits.xtabProvider.diffMergeStrategy",1,jxi.DiffHistoryMergeStrategy.SameStartLine,jxi.DiffHistoryMergeStrategy.VALIDATOR),s.InlineEditsXtabDiffMergeLineGap=Dt("chat.advanced.inlineEdits.xtabProvider.diffMergeLineGap",1,0,(0,R0.vNumber)()),s.InlineEditsXtabDiffMergeSplitAfterMs=Dt("chat.advanced.inlineEdits.xtabProvider.diffMergeSplitAfterMs",1,100,(0,R0.vNumber)()),s.InlineEditsXtabProviderEmitFastCursorLineChange=Dt("chat.advanced.inlineEdits.xtabProvider.emitFastCursorLineChange",1,"additiveOnly"),s.InlineEditsXtabIncludeViewedFiles=Dt("chat.advanced.inlineEdits.xtabProvider.includeViewedFiles",1,Wc.DEFAULT_OPTIONS.recentlyViewedDocuments.includeViewedFiles),s.InlineEditsXtabRecentlyViewedClippingStrategy=Dt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.clippingStrategy",1,Wc.DEFAULT_OPTIONS.recentlyViewedDocuments.clippingStrategy,Wc.RecentFileClippingStrategy.VALIDATOR),s.InlineEditsXtabRecentlyViewedUseLeftoverBudgetFromAbove=Dt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.useLeftoverBudgetFromAbove",1,Wc.DEFAULT_OPTIONS.recentlyViewedDocuments.useLeftoverBudgetFromAbove),s.InlineEditsXtabPageSize=Dt("chat.advanced.inlineEdits.xtabProvider.pageSize",1,Wc.DEFAULT_OPTIONS.pagedClipping.pageSize),s.InlineEditsXtabEditWindowMaxTokens=Dt("chat.advanced.inlineEdits.xtabProvider.editWindowMaxTokens",1,2e3),s.InlineEditsXtabIncludeTagsInCurrentFile=Dt("chat.advanced.inlineEdits.xtabProvider.includeTagsInCurrentFile",1,Wc.DEFAULT_OPTIONS.currentFile.includeTags),s.InlineEditsXtabIncludeLineNumbersInCurrentFile=Dt("chat.advanced.inlineEdits.xtabProvider.includeLineNumbersInCurrentFile",1,Wc.DEFAULT_OPTIONS.currentFile.includeLineNumbers),s.InlineEditsXtabIncludeCursorTagInCurrentFile=Dt("chat.advanced.inlineEdits.xtabProvider.includeCursorTagInCurrentFile",1,Wc.DEFAULT_OPTIONS.currentFile.includeCursorTag),s.InlineEditsXtabCurrentFileMaxTokens=Dt("chat.advanced.inlineEdits.xtabProvider.currentFileMaxTokens",1,Wc.DEFAULT_OPTIONS.currentFile.maxTokens),s.InlineEditsXtabPrioritizeAboveCursor=Dt("chat.advanced.inlineEdits.xtabProvider.currentFile.prioritizeAboveCursor",1,Wc.DEFAULT_OPTIONS.currentFile.prioritizeAboveCursor),s.InlineEditsXtabCurrentFileUseLeftoverBudgetFromAbove=Dt("chat.advanced.inlineEdits.xtabProvider.currentFile.useLeftoverBudgetFromAbove",1,Wc.DEFAULT_OPTIONS.currentFile.useLeftoverBudgetFromAbove),s.InlineEditsXtabDiffOnlyForDocsInPrompt=Dt("chat.advanced.inlineEdits.xtabProvider.diffOnlyForDocsInPrompt",1,Wc.DEFAULT_OPTIONS.diffHistory.onlyForDocsInPrompt),s.InlineEditsXtabDiffUseRelativePaths=Dt("chat.advanced.inlineEdits.xtabProvider.diffUseRelativePaths",1,Wc.DEFAULT_OPTIONS.diffHistory.useRelativePaths),s.InlineEditsXtabNNonSignificantLinesToConverge=Dt("chat.advanced.inlineEdits.xtabProvider.nNonSignificantLinesToConverge",1,Hxi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nLinesToConverge),s.InlineEditsXtabNSignificantLinesToConverge=Dt("chat.advanced.inlineEdits.xtabProvider.nSignificantLinesToConverge",1,Hxi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nSignificantLinesToConverge),s.InlineEditsXtabEarlyCursorLineDivergenceCancellation=Dt("chat.advanced.inlineEdits.xtabProvider.earlyCursorLineDivergenceCancellation",1,AD.EarlyDivergenceCancellationMode.Off,AD.EarlyDivergenceCancellationMode.VALIDATOR),s.InlineEditsXtabLanguageContextEnabled=Dt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabled",1,Wc.DEFAULT_OPTIONS.languageContext.enabled),s.InlineEditsXtabLanguageContextMaxTokens=Dt("chat.advanced.inlineEdits.xtabProvider.languageContext.maxTokens",1,Wc.DEFAULT_OPTIONS.languageContext.maxTokens),s.InlineEditsXtabIncludeNeighborFiles=Dt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.enabled",1,Wc.DEFAULT_OPTIONS.neighborFiles.enabled),s.InlineEditsXtabNeighborFilesMaxTokens=Dt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.maxTokens",1,Wc.DEFAULT_OPTIONS.neighborFiles.maxTokens),s.InlineEditsXtabGlobalBudgetEnabled=Dt("chat.advanced.inlineEdits.xtabProvider.globalBudget.enabled",1,!1),s.InlineEditsXtabGlobalBudgetTotalTokens=Dt("chat.advanced.inlineEdits.xtabProvider.globalBudget.totalTokens",1,Wc.GlobalBudgetOptions.DEFAULT_TOTAL_TOKENS),s.InlineEditsXtabMaxMergeConflictLines=Dt("chat.advanced.inlineEdits.xtabProvider.maxMergeConflictLines",1,void 0),s.InlineEditsXtabOnlyMergeConflictLines=Dt("chat.advanced.inlineEdits.xtabProvider.onlyMergeConflictLines",1,!1),s.InlineEditsXtabDuplicateAdditionsMode=Dt("chat.advanced.inlineEdits.xtabProvider.diffPatch.duplicateAdditionsMode",1,AD.DuplicateAdditionsMode.Off,AD.DuplicateAdditionsMode.VALIDATOR),s.InlineEditsXtabAggressivenessLevel=Dt("chat.advanced.inlineEdits.xtabProvider.aggressivenessLevel",1,void 0),s.InlineEditsAggressivenessLowMinResponseTimeMs=Dt("chat.advanced.inlineEdits.aggressiveness.lowMinResponseTimeMs",1,1500),s.InlineEditsAggressivenessMediumMinResponseTimeMs=Dt("chat.advanced.inlineEdits.aggressiveness.mediumMinResponseTimeMs",1,700),s.InlineEditsAggressivenessHighDebounceMs=Dt("chat.advanced.inlineEdits.aggressiveness.highDebounceMs",1,0),s.InlineEditsUserHappinessScoreConfigurationString=Dt("chat.advanced.inlineEdits.adaptiveAggressivenessConfigurationString",1,void 0),s.InlineEditsUndoInsertionFiltering=Dt("chat.advanced.inlineEdits.undoInsertionFiltering",1,"v1"),s.InlineEditsFilterOutEditsWithSubstrings=Dt("chat.advanced.inlineEdits.filterOutEditsWithSubstrings",1,"<|current_file_content|>,<|/current_file_content|>,<|diff_marker|>"),s.InlineEditsIgnoreWhenSuggestVisible=Dt("chat.advanced.inlineEdits.ignoreWhenSuggestVisible",1,!0),s.InlineEditsJointCompletionsProviderEnabled=Dt("chat.advanced.inlineEdits.jointCompletionsProvider.enabled",1,!1),s.InlineEditsJointCompletionsProviderStrategy=Dt("chat.advanced.inlineEdits.jointCompletionsProvider.strategy",1,Qxi.JointCompletionsProviderStrategy.Regular),s.InlineEditsJointCompletionsProviderTriggerChangeStrategy=Dt("chat.advanced.inlineEdits.jointCompletionsProvider.triggerChangeStrategy",1,Qxi.JointCompletionsProviderTriggerChangeStrategy.NoTriggerOnCompletionsRequestInFlight),s.InstantApplyModelName=Dt("chat.advanced.instantApply.modelName",1,"gpt-4o-instant-apply-full-ft-v66"),s.VerifyTextDocumentChanges=Dt("chat.advanced.inlineEdits.verifyTextDocumentChanges",1,!1),s.UseAutoModeRouting=Dt("chat.advanced.useAutoModeRouter",1,!1),s.AutoModeRoutingMethod=Dt("chat.advanced.autoModeRoutingMethod",1,"",void 0,void 0,{experimentName:"copilotchat.autoModeRoutingMethod"}),s.InlineCompletionsDefaultDiagnosticsOptions=Dt("chat.advanced.inlineCompletions.defaultDiagnosticsOptionsString",1,void 0),s.RecordExpectedEditEnabled=Dt("chat.advanced.inlineEdits.recordExpectedEdit.enabled",0,!1),s.RecordExpectedEditOnReject=Dt("chat.advanced.inlineEdits.recordExpectedEdit.onReject",0,!1),s.ReadFileCodeFences=Dt("chat.advanced.readFileCodeFences",1,!1),s.EnableReadFileV2=ct("chat.advanced.enableReadFileV2",1,!1),s.AskAgent=ct("chat.advanced.enableAskAgent",1,!1),s.RetryNetworkErrors=ct("chat.advanced.enableRetryNetworkErrors",1,!0),s.RetryServerErrorStatusCodes=ct("chat.advanced.retryServerErrorStatusCodes",1,"500,502"),s.FallbackNodeFetchOnNetworkProcessCrash=ct("chat.advanced.enableFallbackNodeFetchOnNetworkProcessCrash",1,!0),s.ChatRequestPowerSaveBlocker=Dt("chat.advanced.chatRequestPowerSaveBlocker",1,!0),s.ResponsesApiWebSocketEnabled=Dt("chat.advanced.responsesApi.webSocket.enabled",1,!0),s.DebugSimulateWebSocketResponse=Dt("chat.advanced.debug.simulateWebSocketResponse",0,""),s.SessionSyncMaxEventsPerFlush=Dt("chat.advanced.sessionSync.maxEventsPerFlush",1,500),s.SessionSyncSafetyIntervalMs=Dt("chat.advanced.sessionSync.safetyIntervalMs",1,6e4)})(n=t.TeamInternal||(t.TeamInternal={}));let o;(function(s){s.PlanAgentModel=ct("chat.planAgent.model",0,""),s.OllamaEndpoint=ct("chat.byok.ollamaEndpoint",0,"http://localhost:11434"),s.AzureModels=ct("chat.azureModels",0,{}),s.CustomOAIModels=ct("chat.customOAIModels",0,{}),s.AzureAuthType=ct("chat.azureAuthType",0,U5e.EntraId)})(o=t.Deprecated||(t.Deprecated={})),t.Enable=ct("enable",0,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}),t.selectedCompletionsModel=ct("selectedCompletionModel",0,""),t.RateLimitAutoSwitchToAuto=ct("chat.rateLimitAutoSwitchToAuto",0,!1,(0,R0.vBoolean)()),t.ConversationUsePrismCompaction=ct("chat.conversationCompaction.usePrismCompaction",1,!1),t.ConversationCompactionModel=ct("chat.conversationCompaction.model",1,""),t.ConversationPrismCompactionModelFilter=ct("chat.conversationCompaction.prismModelFilter",1,"claude-haiku-4.5,claude-sonnet-4.5,claude-sonnet-4.6,gemini-2.5-pro,gemini-3-flash,gemini-3.5-flash"),t.UseAnthropicMessagesApi=ct("chat.anthropic.useMessagesApi",1,!0),t.AnthropicContextEditingMode=ct("chat.anthropic.contextEditing.mode",1,"off"),t.ResponsesApiReasoningSummary=ct("chat.responsesApiReasoningSummary",1,"detailed"),t.ResponsesApiContextManagementEnabled=ct("chat.responsesApiContextManagement.enabled",1,!1),t.ResponsesApiPromptCacheKeyEnabled=ct("chat.responsesApi.promptCacheKey.enabled",1,!1),t.ResponsesApiPersistentCoTEnabled=ct("chat.responsesApi.persistentCoT.enabled",1,!1),t.Updated53CodexPromptEnabled=ct("chat.updated53CodexPrompt.enabled",1,!0),t.Claude47OpusPromptEnabled=ct("chat.claude47OpusPrompt.enabled",1,!1),t.EnableGpt55GetChangedFilesTool=ct("chat.gpt55GetChangedFilesTool.enabled",1,!0),t.EnableGemini3GetChangedFilesTool=ct("chat.gemini3GetChangedFilesTool.enabled",1,!0),t.EnableGemini3LowReasoningEffort=ct("chat.gemini3LowReasoningEffort.enabled",1,!1),t.EnableGpt55ReadFileTool=ct("chat.gpt55ReadFileTool.enabled",1,!0),t.EnableChatImageUpload=ct("chat.imageUpload.enabled",1,!0),t.AnthropicWebSearchToolEnabled=ct("chat.anthropic.tools.websearch.enabled",1,!1),t.AnthropicWebSearchMaxUses=ct("chat.anthropic.tools.websearch.maxUses",0,5),t.AnthropicWebSearchAllowedDomains=ct("chat.anthropic.tools.websearch.allowedDomains",0,[]),t.AnthropicWebSearchBlockedDomains=ct("chat.anthropic.tools.websearch.blockedDomains",0,[]),t.AnthropicWebSearchUserLocation=ct("chat.anthropic.tools.websearch.userLocation",0,null),t.CodeGenerationInstructions=ct("chat.codeGeneration.instructions",0,[]),t.TestGenerationInstructions=ct("chat.testGeneration.instructions",0,[]),t.CommitMessageGenerationInstructions=ct("chat.commitMessageGeneration.instructions",0,[]),t.PullRequestDescriptionGenerationInstructions=ct("chat.pullRequestDescriptionGeneration.instructions",0,[]),t.SetupTests=ct("chat.setupTests.enabled",0,!0),t.TypeScriptLanguageContext=ct("chat.languageContext.typescript.enabled",1,!0),t.TypeScriptLanguageContextMode=ct("chat.languageContext.typescript.items",1,"double"),t.TypeScriptLanguageContextIncludeDocumentation=ct("chat.languageContext.typescript.includeDocumentation",1,!1),t.TypeScriptLanguageContextCacheTimeout=ct("chat.languageContext.typescript.cacheTimeout",1,500),t.TypeScriptLanguageContextFix=ct("chat.languageContext.fix.typescript.enabled",1,!1),t.TypeScriptLanguageContextInline=ct("chat.languageContext.inline.typescript.enabled",1,!1),t.UseInstructionFiles=ct("chat.codeGeneration.useInstructionFiles",0,!0),t.ReviewAgent=ct("chat.reviewAgent.enabled",0,!0),t.CodeFeedback=ct("chat.reviewSelection.enabled",0,!0),t.CodeFeedbackInstructions=ct("chat.reviewSelection.instructions",0,[]),t.UseProjectTemplates=ct("chat.useProjectTemplates",0,!0),t.ExplainScopeSelection=ct("chat.scopeSelection",0,!1),t.EnableCodeActions=ct("editor.enableCodeActions",0,!0),t.LocaleOverride=ct("chat.localeOverride",0,"auto"),t.TerminalChatLocation=ct("chat.terminalChatLocation",0,"chatView"),t.AutomaticRenameSuggestions=ct("renameSuggestions.triggerAutomatically",0,!0),t.TerminalToDebuggerEnabled=ct("chat.copilotDebugCommand.enabled",0,!0),t.CodeSearchAgentEnabled=ct("chat.codesearch.enabled",0,!1),t.ClaudeAgentEnabled=ct("chat.claudeAgent.enabled",0,!0),t.ClaudeAgentAllowDangerouslySkipPermissions=ct("chat.claudeAgent.allowDangerouslySkipPermissions",0,!1),t.ClaudeAgentAllowAutoPermissions=ct("chat.claudeAgent.allowAutoPermissions",1,!1),t.ClaudeAgentUseSdkExtension=ct("chat.claudeAgent.useSdkExtension",1,!1),t.ClaudeAgentSdkExtensionInstallTimeout=ct("chat.claudeAgent.sdkExtensionInstallTimeout",0,12e4),t.InlineEditsEnabled=ct("nextEditSuggestions.enabled",1,!0),t.CompletionsInChatEnabled=ct("completions.chat.enabled",0,!1),t.InlineEditsEnableDiagnosticsProvider=ct("nextEditSuggestions.fixes",1,!0),t.InlineEditsAllowWhitespaceOnlyChanges=ct("nextEditSuggestions.allowWhitespaceOnlyChanges",1,!0),t.InlineEditsNextCursorPredictionEnabled=ct("nextEditSuggestions.extendedRange",1,!0,void 0,{oldKey:"chat.advanced.inlineEdits.nextCursorPrediction.enabled"}),t.NewWorkspaceCreationAgentEnabled=ct("chat.newWorkspaceCreation.enabled",0,!0),t.NewWorkspaceUseContext7=ct("chat.newWorkspace.useContext7",0,!1),t.SummarizeAgentConversationHistory=ct("chat.summarizeAgentConversationHistory.enabled",0,!0),t.VirtualToolThreshold=ct("chat.virtualTools.threshold",1,Ho.HARD_TOOL_LIMIT),t.CurrentEditorAgentContext=ct("chat.agent.currentEditorContext.enabled",0,!0),t.AutoFixDiagnostics=ct("chat.agent.autoFix",1,!1),t.NotebookFollowCellExecution=ct("chat.notebook.followCellExecution.enabled",0,!1),t.UseAlternativeNESNotebookFormat=ct("chat.notebook.enhancedNextEditSuggestions.enabled",1,!1),t.CustomInstructionsInSystemMessage=ct("chat.customInstructionsInSystemMessage",0,!0),t.EnableAlternateGptPrompt=ct("chat.alternateGptPrompt.enabled",1,!1),t.EnableAlternateGeminiModelFPrompt=ct("chat.alternateGeminiModelFPrompt.enabled",1,!1),t.EnableGemini35FlashReducedToolUsePrompt=ct("chat.gemini35FlashReducedToolUsePrompt.enabled",1,!1),t.EnableOrganizationCustomAgents=ct("chat.organizationCustomAgents.enabled",0,!0),t.EnableOrganizationInstructions=ct("chat.organizationInstructions.enabled",0,!0),t.CompletionsFetcher=ct("chat.completionsFetcher",1,void 0),t.NextEditSuggestionsFetcher=ct("chat.nesFetcher",1,void 0),t.GitHubMcpEnabled=ct("chat.githubMcpServer.enabled",1,!1),t.GitHubMcpToolsets=ct("chat.githubMcpServer.toolsets",0,["default"]),t.GitHubMcpReadonly=ct("chat.githubMcpServer.readonly",0,!1),t.GitHubMcpLockdown=ct("chat.githubMcpServer.lockdown",0,!1),t.GitHubMcpChannel=ct("chat.githubMcpServer.channel",0,"stable"),t.BackgroundAgentEnabled=ct("chat.backgroundAgent.enabled",0,!0),t.CloudAgentEnabled=ct("chat.cloudAgent.enabled",0,!0),t.CloudAgentBackendVersion=ct("chat.cloudAgentBackend.version",1,"v1"),t.AdditionalReadAccessPaths=ct("chat.additionalReadAccessPaths",0,[]),t.SwitchAgentEnabled=ct("chat.switchAgent.enabled",1,!1),t.PlanAgentAdditionalTools=ct("chat.planAgent.additionalTools",0,[]),t.ImplementAgentModel=ct("chat.implementAgent.model",0,""),t.AskAgentAdditionalTools=ct("chat.askAgent.additionalTools",0,[]),t.AskAgentModel=ct("chat.askAgent.model",0,""),t.ExploreAgentEnabled=ct("chat.exploreAgent.enabled",1,!0),t.ExploreAgentModel=ct("chat.exploreAgent.model",0,""),t.ViewImageToolEnabled=ct("chat.tools.viewImage.enabled",1,!0),t.LocalIndexEnabled=ct("chat.localIndex.enabled",1,!1),t.GrepSearchOutputFormat=ct("chat.tools.grepSearch.outputFormat",1,"tag")})(HCr||(Ho.ConfigKey=HCr={}));function ADa(){return Object.values(HCr).flatMap(t=>Object.values(t).map(e=>e.fullyQualifiedId))}a(ADa,"getAllConfigKeys");var yDa=[];function EDa(t){return yDa.push(t),t}a(EDa,"registerNextEditProviderId")});var xp=I(yy=>{"use strict";p();Object.defineProperty(yy,"__esModule",{value:!0});yy.LogMemory=yy.LogServiceImpl=yy.ConsoleLog=yy.LogTarget=yy.LogLevel=yy.ILogService=void 0;yy.collectErrorMessages=Wxi;yy.collectSingleLineErrorMessage=CDa;yy.sanitizeNetworkErrorForTelemetry=bDa;var _Da=nn(),vDa=Ro();yy.ILogService=(0,_Da.createServiceIdentifier)("ILogService");var jE;(function(t){t[t.Off=0]="Off",t[t.Trace=1]="Trace",t[t.Debug=2]="Debug",t[t.Info=3]="Info",t[t.Warning=4]="Warning",t[t.Error=5]="Error"})(jE||(yy.LogLevel=jE={}));var Vxi;(function(t){function e(r){return{logIt:r}}a(e,"fromCallback"),t.fromCallback=e})(Vxi||(yy.LogTarget=Vxi={}));var $Cr=class{static{a(this,"ConsoleLog")}constructor(e,r=jE.Warning){this.prefix=e,this.minLogLevel=r}logIt(e,r,...n){this.prefix&&(r=`${this.prefix}${r}`),e===jE.Error?console.error(r,...n):e===jE.Warning?console.warn(r,...n):e>=this.minLogLevel&&console.log(r,...n)}};yy.ConsoleLog=$Cr;var VCr=class extends vDa.Disposable{static{a(this,"LogServiceImpl")}constructor(e){super(),this.logger=new WCr(e)}trace(e){this.logger.trace(e)}debug(e){this.logger.debug(e)}info(e){this.logger.info(e)}warn(e){this.logger.warn(e)}error(e,r){this.logger.error(e,r)}show(e){this.logger.show(e)}createSubLogger(e){return this.logger.createSubLogger(e)}withExtraTarget(e){return this.logger.withExtraTarget(e)}};yy.LogServiceImpl=VCr;var WCr=class{static{a(this,"LoggerImpl")}constructor(e){this._logTargets=e}_logIt(e,r){Ogt.addLog(jE[e],r),this._logTargets.forEach(n=>n.logIt(e,r))}trace(e){this._logIt(jE.Trace,e)}debug(e){this._logIt(jE.Debug,e)}info(e){this._logIt(jE.Info,e)}warn(e){this._logIt(jE.Warning,e)}error(e,r){this._logIt(jE.Error,Wxi(e)+(r?`: ${r}`:""))}show(e){this._logTargets.forEach(r=>r.show?.(e))}createSubLogger(e){return new zCr(this,e)}withExtraTarget(e){return new Mgt(this,[e])}},zCr=class t{static{a(this,"SubLogger")}constructor(e,r,n){this._parent=e;let s=(Array.isArray(r)?r:[r]).map(c=>`[${c}]`).join("");this._prefix=n?n+s:s}_prefixMessage(e){return`${this._prefix} ${e}`}trace(e){this._parent.trace(this._prefixMessage(e))}debug(e){this._parent.debug(this._prefixMessage(e))}info(e){this._parent.info(this._prefixMessage(e))}warn(e){this._parent.warn(this._prefixMessage(e))}error(e,r){let n=r?this._prefixMessage(r):this._prefix;this._parent.error(e,n)}show(e){this._parent.show(e)}createSubLogger(e){return new t(this._parent,e,this._prefix)}withExtraTarget(e){return new Mgt(this,[e],this._prefix)}},Mgt=class t{static{a(this,"LoggerWithExtraTargets")}constructor(e,r,n=""){this._parent=e,this._extraTargets=r,this._prefix=n}_notifyExtraTargets(e,r){let n=this._prefix?`${this._prefix} ${r}`:r;for(let o of this._extraTargets)try{o.logIt(e,n)}catch{}}trace(e){this._notifyExtraTargets(jE.Trace,e),this._parent.trace(e)}debug(e){this._notifyExtraTargets(jE.Debug,e),this._parent.debug(e)}info(e){this._notifyExtraTargets(jE.Info,e),this._parent.info(e)}warn(e){this._notifyExtraTargets(jE.Warning,e),this._parent.warn(e)}error(e,r){let n=typeof e=="string"?e:e.message||"Error",o=r?`${n}: ${r}`:n;this._notifyExtraTargets(jE.Error,o),this._parent.error(e,r)}show(e){this._parent.show(e);for(let r of this._extraTargets)try{r.show?.(e)}catch{}}createSubLogger(e){let r=Array.isArray(e)?e:[e],n=this._prefix+r.map(o=>`[${o}]`).join("");return new t(this._parent.createSubLogger(e),this._extraTargets,n)}withExtraTarget(e){return new t(this._parent,[...this._extraTargets,e],this._prefix)}};function Wxi(t){let e=new Set;function r(n,o){if(!n||!["object","string"].includes(typeof n)||e.has(n))return"";e.add(n);let c=(typeof n=="string"?n:n.stack||n.message||n.code||"").toString?.()||"";return[c?`${c.split(` `).map(l=>`${o}${l}`).join(` `)} -`:"",n.chromiumDetails?`${o}${JSON.stringify(rIi(n.chromiumDetails))} -`:"",r(n.cause,o+" "),...Array.isArray(n.errors)?n.errors.map(l=>r(l,o+" ")):[]].join("")}return a(r,"collect"),r(t,"").trim()}a(tIi,"collectErrorMessages");function Zka(t,e=!1){let r=new Set;function n(o){if(!o||!["object","string"].includes(typeof o)||r.has(o))return"";r.add(o);let l=((typeof o=="string"?o:o.message||o.code||"").toString?.()||"").trim().split(` -`).join(" "),u=[...e&&o.chromiumDetails?[JSON.stringify(rIi(o.chromiumDetails))]:[],...o.cause?[n(o.cause)]:[],...Array.isArray(o.errors)?o.errors.map(d=>n(d)):[]].join(", ");return u?`${l}: ${u}`:l}return a(n,"collect"),n(t)}a(Zka,"collectSingleLineErrorMessage");function Xka(t){return t=t.replace(/(\b(?:PROXY|HTTPS?|SOCKS[45]?)\s+)[^\s]+@([^\s:\/]+)/gi,"$1@"),t=t.replace(/(\b(?:PROXY|HTTPS?|SOCKS[45]?)\s+)([a-zA-Z0-9][-a-zA-Z0-9.]*)/gi,"$1"),t=t.replace(/(\/\/)[^\s/]+@([^\s:\/]+)/g,"$1@"),t=t.replace(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g,""),t=t.replace(/(?"),t=t.replace(/(?"),t=t.replace(/\b([a-zA-Z0-9][-a-zA-Z0-9]*\.)+[a-zA-Z]{2,}\b/g,""),t}a(Xka,"sanitizeNetworkErrorForTelemetry");function rIi(t){if(!t||typeof t!="object")return{};if(t.is_request_error!==void 0&&t.session_state===void 0)return{is_request_error:t.is_request_error,network_process_crashed:t.network_process_crashed};let e={drain_error:t.drain_error,drain_description:t.drain_description,go_away_error:t.go_away_error,go_away_error_details:t.go_away_error_details,go_away_debug_data:t.go_away_debug_data,rst_stream_error:t.rst_stream_error,rst_stream_error_details:t.rst_stream_error_details,rst_stream_description:t.rst_stream_description,last_framer_error:t.last_framer_error,last_framer_error_details:t.last_framer_error_details,error_source:t.error_source,aliases_length:Array.isArray(t.aliases)?t.aliases.length:void 0};if(t.proxy){let n=[...String(t.proxy).matchAll(/([a-z][a-z0-9+.-]*):\/\//gi)].map(o=>o[1]);n.length>0&&(e.proxy_schemes=n)}if(t.in_flight_write&&typeof t.in_flight_write=="object"&&(e.in_flight_write={frame_type:t.in_flight_write.frame_type,frame_size:t.in_flight_write.frame_size,remaining_size:t.in_flight_write.remaining_size}),t.buffered_spdy_framer&&typeof t.buffered_spdy_framer=="object"&&(e.buffered_spdy_framer={frames_received:t.buffered_spdy_framer.frames_received,has_error:t.buffered_spdy_framer.has_error,message_fully_read:t.buffered_spdy_framer.message_fully_read}),t.session_state&&typeof t.session_state=="object"){let r=t.session_state;e.session_state={availability_state:r.availability_state,session_send_window:r.session_send_window,session_recv_window:r.session_recv_window,stream_initial_send_window:r.stream_initial_send_window,stream_initial_recv_window:r.stream_initial_recv_window,send_stalled_by_session_window:r.send_stalled_by_session_window,active_stream_count:r.active_stream_count,created_stream_count:r.created_stream_count,max_concurrent_streams:r.max_concurrent_streams,highest_stream_id_sent:r.highest_stream_id_sent,frames_sent:r.frames_sent,frames_received:r.frames_received,ping_in_flight:r.ping_in_flight,last_ping_sent_ms:r.last_ping_sent_ms,next_ping_id:r.next_ping_id,failed_ping_count:r.failed_ping_count,support_websocket:r.support_websocket,deprecate_http2_priorities:r.deprecate_http2_priorities,streams_initiated_count:r.streams_initiated_count,streams_abandoned_count:r.streams_abandoned_count,read_state:r.read_state,write_state:r.write_state,pending_create_stream_request_count:r.pending_create_stream_request_count,error:r.error,error_on_unavailable:r.error_on_unavailable,unacked_recv_window_bytes:r.unacked_recv_window_bytes,last_good_stream_id:r.last_good_stream_id,debug_stream_id:r.debug_stream_id,has_ping_based_connection_checking:r.has_ping_based_connection_checking,num_broken_connection_detection_requests:r.num_broken_connection_detection_requests,session_max_queued_capped_frames:r.session_max_queued_capped_frames,num_queued_capped_frames:r.num_queued_capped_frames,check_ping_status_pending:r.check_ping_status_pending,in_confirm_handshake:r.in_confirm_handshake,http2_end_stream_with_data_frame:r.http2_end_stream_with_data_frame,reused:r.reused,session_max_recv_window_size:r.session_max_recv_window_size,max_header_table_size:r.max_header_table_size,time_since_last_read_ms:r.time_since_last_read_ms,time_since_last_write_ms:r.time_since_last_write_ms,time_since_last_recv_window_update_ms:r.time_since_last_recv_window_update_ms}}if(t.tls_info&&typeof t.tls_info=="object"){let r=t.tls_info;e.tls_info={is_secure_connection:r.is_secure_connection,ssl_version:r.ssl_version,cipher_suite:r.cipher_suite,negotiated_alpn:r.negotiated_alpn,cert_status:r.cert_status,is_issued_by_known_root:r.is_issued_by_known_root,handshake_type:r.handshake_type,client_cert_sent:r.client_cert_sent,exchange_group:r.key_exchange_group,ct_compliance:r.ct_compliance,alps_negotiated:r.alps_negotiated}}if(t.socket_info&&typeof t.socket_info=="object"){let r=t.socket_info;e.socket_info={is_connected:r.is_connected,was_ever_used:r.was_ever_used,dns_lookup_duration_ms:r.dns_lookup_duration_ms,tcp_connect_duration_ms:r.tcp_connect_duration_ms,ssl_handshake_duration_ms:r.ssl_handshake_duration_ms,owned_socket:r.owned_socket,socket_reuse_type:r.socket_reuse_type}}return t.url_loader_error&&typeof t.url_loader_error=="object"&&(e.url_loader_error={is_request_error:t.url_loader_error.is_request_error,network_process_crashed:t.url_loader_error.network_process_crashed}),Array.isArray(t.active_stream_details)&&(e.active_stream_details=t.active_stream_details.map(r=>({stream_id:r.stream_id,io_state:r.io_state,type:r.type,priority:r.priority,send_window_size:r.send_window_size,recv_window_size:r.recv_window_size,max_recv_window_size:r.max_recv_window_size,unacked_recv_window_bytes:r.unacked_recv_window_bytes,send_stalled_by_flow_control:r.send_stalled_by_flow_control,raw_sent_bytes:r.raw_sent_bytes,raw_received_bytes:r.raw_received_bytes,recv_bytes:r.recv_bytes,pending_send_status:r.pending_send_status,response_state:r.response_state,pending_send_data_remaining:r.pending_send_data_remaining,request_time_ms:r.request_time_ms,response_time_ms:r.response_time_ms}))),Array.isArray(t.closed_stream_details)&&(e.closed_stream_details=t.closed_stream_details.map(r=>({stream_id:r.stream_id,io_state:r.io_state,type:r.type,priority:r.priority,send_window_size:r.send_window_size,recv_window_size:r.recv_window_size,max_recv_window_size:r.max_recv_window_size,unacked_recv_window_bytes:r.unacked_recv_window_bytes,send_stalled_by_flow_control:r.send_stalled_by_flow_control,raw_sent_bytes:r.raw_sent_bytes,raw_received_bytes:r.raw_received_bytes,recv_bytes:r.recv_bytes,pending_send_status:r.pending_send_status,response_state:r.response_state,pending_send_data_remaining:r.pending_send_data_remaining,request_time_ms:r.request_time_ms,response_time_ms:r.response_time_ms}))),e}a(rIi,"extractChromiumDetails");var lgt=class{static{a(this,"LogMemory")}static{this._logs=[]}static{this._requestIds=[]}static{this.MAX_LOGS=50}static extractRequestIdFromMessage(e){let r=e.match(/request done: requestId: \[([0-9a-fA-F-]+)\] model deployment ID: \[/);if(r){let n=r[1];if(!this._requestIds.includes(n))return n}}static addLog(e,r){this._logs.length>=this.MAX_LOGS&&this._logs.shift(),this._logs.push(`${e}: ${r}`),this._requestIds.length>=this.MAX_LOGS&&this._requestIds.shift();let n=this.extractRequestIdFromMessage(r);n&&this._requestIds.push(n)}static getLogs(){return this._logs}static getRequestIds(){return this._requestIds}};hy.LogMemory=lgt});var E5e=I(y5e=>{"use strict";p();Object.defineProperty(y5e,"__esModule",{value:!0});y5e.ICopilotTokenManager=void 0;y5e.nowSeconds=tPa;var ePa=nn();y5e.ICopilotTokenManager=(0,ePa.createServiceIdentifier)("ICopilotTokenManager");function tPa(){return Math.floor(Date.now()/1e3)}a(tPa,"nowSeconds")});var FE=I(vm=>{"use strict";p();var rPa=vm&&vm.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ugt=vm&&vm.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(vm,"__esModule",{value:!0});vm.BaseAuthenticationService=vm.IAuthenticationService=vm.MinimalModeError=vm.GITHUB_SCOPE_ALIGNED=vm.GITHUB_SCOPE_READ_USER=vm.GITHUB_SCOPE_USER_EMAIL=void 0;vm.authProviderId=lPa;var nPa=nn(),dgt=Ic(),iPa=Ro(),oPa=C8(),Cte=Pl(),sPa=Sp(),aPa=E5e(),cPa=XH();vm.GITHUB_SCOPE_USER_EMAIL=["user:email"];vm.GITHUB_SCOPE_READ_USER=["read:user"];vm.GITHUB_SCOPE_ALIGNED=["read:user","user:email","repo","workflow"];var rCr=class extends Error{static{a(this,"MinimalModeError")}constructor(){super("The authentication service is in minimal mode."),this.name="MinimalModeError"}};vm.MinimalModeError=rCr;vm.IAuthenticationService=(0,nPa.createServiceIdentifier)("IAuthenticationService");var nCr=class extends iPa.Disposable{static{a(this,"BaseAuthenticationService")}fireAuthenticationChange(e){let r=!!this.copilotToken;this._logService.info(`AuthenticationService: firing onDidAuthenticationChange from ${e}. Has token: ${r}`),this._onDidAuthenticationChange.fire()}fireCopilotTokenChange(e){this._logService.debug(`AuthenticationService: firing onDidCopilotTokenChange from ${e}.`),this._onDidCopilotTokenChange.fire()}constructor(e,r,n,o){super(),this._logService=e,this._tokenStore=r,this._tokenManager=n,this._configurationService=o,this._onDidAuthenticationChange=this._register(new dgt.Emitter),this.onDidAuthenticationChange=this._onDidAuthenticationChange.event,this._onDidCopilotTokenChange=this._register(new dgt.Emitter),this.onDidCopilotTokenChange=this._onDidCopilotTokenChange.event,this._onDidAccessTokenChange=this._register(new dgt.Emitter),this.onDidAccessTokenChange=this._onDidAccessTokenChange.event,this._onDidAdoAuthenticationChange=this._register(new dgt.Emitter),this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event,this._isMinimalMode=(0,oPa.derived)(s=>this._configurationService.getConfigObservable(Cte.ConfigKey.Shared.AuthPermissions).read(s)===Cte.AuthPermissionMode.Minimal),this._register(n.onDidCopilotTokenRefresh(()=>{this._logService.debug("Handling CopilotToken refresh."),this._handleAuthChangeEvent()}))}get isMinimalMode(){return this._isMinimalMode.get()}get anyGitHubSession(){return this._anyGitHubSession}get hasCopilotTokenSource(){return!!this._anyGitHubSession}get permissiveGitHubSession(){return this._permissiveGitHubSession}get anyAdoSession(){return this._anyAdoSession}get copilotToken(){return this._tokenStore.copilotToken}async getCopilotToken(e){try{let r=this._tokenStore.copilotToken,n=await this._tokenManager.getCopilotToken(e);return this._tokenStore.copilotToken=n,this._copilotTokenError=void 0,r?.token!==n.token&&this.fireCopilotTokenChange("getCopilotToken"),n}catch(r){let n=this._tokenStore.copilotToken;this._tokenStore.copilotToken=void 0;let o=this._copilotTokenError;throw this._copilotTokenError=r,n?this.fireCopilotTokenChange("getCopilotToken token lost"):o&&r&&o.message!==r.message&&this.fireCopilotTokenChange("getCopilotToken error change"),r}}resetCopilotToken(e){let r=!!this._tokenStore.copilotToken;this._tokenStore.copilotToken=void 0,this._tokenManager.resetCopilotToken(e),r&&this.fireCopilotTokenChange("resetCopilotToken")}async _handleAuthChangeEvent(){let e=this._anyGitHubSession,r=this._permissiveGitHubSession,n=this._anyAdoSession,o=await Promise.allSettled([this.getGitHubSession("any",{silent:!0}),this.getGitHubSession("permissive",{silent:!0}),this.getAnyAdoSession({silent:!0})]);for(let s of o)s.status==="rejected"&&this._logService.error(`Error getting a session: ${s.reason}`);if(e?.accessToken!==this._anyGitHubSession?.accessToken||r?.accessToken!==this._permissiveGitHubSession?.accessToken){this._onDidAccessTokenChange.fire(),this._logService.debug("Auth state changed (identity change), minting a new CopilotToken...");try{await this.getCopilotToken(!0)}catch{}this._logService.debug("Minted a new CopilotToken."),this.fireAuthenticationChange("handleAuthChangeEvent identity change");return}n?.accessToken!==this._anyAdoSession?.accessToken&&(this._logService.debug(`Ado auth state changed, firing event. Had token before: ${!!n?.accessToken}. Has token now: ${!!this._anyAdoSession?.accessToken}.`),this._onDidAdoAuthenticationChange.fire());try{await this.getCopilotToken()}catch{}this._logService.debug("Finished handling auth change event.")}};vm.BaseAuthenticationService=nCr;vm.BaseAuthenticationService=nCr=rPa([ugt(0,sPa.ILogService),ugt(1,cPa.ICopilotTokenStore),ugt(2,aPa.ICopilotTokenManager),ugt(3,Cte.IConfigurationService)],nCr);function lPa(t){return t.getConfig(Cte.ConfigKey.Shared.AuthProvider)===Cte.AuthProviderId.GitHubEnterprise?Cte.AuthProviderId.GitHubEnterprise:Cte.AuthProviderId.GitHub}a(lPa,"authProviderId")});var fgt=I(iCr=>{"use strict";p();Object.defineProperty(iCr,"__esModule",{value:!0});iCr.onCopilotToken=uPa;function uPa(t,e){return t.onDidCopilotTokenChange(()=>{let r=t.copilotToken;r&&e(r)})}a(uPa,"onCopilotToken")});var sCr=I(uD=>{"use strict";p();var dPa=uD&&uD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},fPa=uD&&uD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(uD,"__esModule",{value:!0});uD.TelemetryUserConfig=uD.ICompletionsTelemetryUserConfigService=void 0;var pPa=FE(),hPa=nn(),mPa=Ro(),gPa=fgt();function APa(t){let e=t.getTokenValue("tid"),r=t.organizationList,n=t.enterpriseList,o=t.getTokenValue("sku");if(!e)return;let s={copilot_trackingId:e};return r&&(s.organizations_list=r.toString()),n&&(s.enterprise_list=n.toString()),o&&(s.sku=o),s}a(APa,"propertiesFromCopilotToken");uD.ICompletionsTelemetryUserConfigService=(0,hPa.createServiceIdentifier)("ICompletionsTelemetryUserConfigService");var oCr=class extends mPa.Disposable{static{a(this,"TelemetryUserConfig")}#e;constructor(e){super(),this.#e={},this.optedIn=!1,this.ftFlag="",this._register((0,gPa.onCopilotToken)(e,n=>this.updateFromToken(n)));let r=e.copilotToken;r&&this.updateFromToken(r)}getProperties(){return this.#e}get trackingId(){return this.#e.copilot_trackingId}updateFromToken(e){let r=APa(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1",this.ftFlag=e.getTokenValue("ft")??"")}};uD.TelemetryUserConfig=oCr;uD.TelemetryUserConfig=oCr=dPa([fPa(0,pPa.IAuthenticationService)],oCr)});var _5e=I(Oge=>{"use strict";p();Object.defineProperty(Oge,"__esModule",{value:!0});Oge.PromiseQueue=Oge.ICompletionsPromiseQueueService=void 0;var yPa=nn();Oge.ICompletionsPromiseQueueService=(0,yPa.createServiceIdentifier)("completionsPromiseQueueService");var aCr=class{static{a(this,"PromiseQueue")}constructor(){this.promises=new Set}register(e){this.promises.add(e),e.finally(()=>this.promises.delete(e))}async flush(){await Promise.allSettled(this.promises)}};Oge.PromiseQueue=aCr});var $g=I(yd=>{"use strict";p();Object.defineProperty(yd,"__esModule",{value:!0});yd.TelemetryReporters=yd.ICompletionsTelemetryReporters=yd.CopilotTelemetryReporter=yd.TelemetryWithExp=yd.TelemetryData=yd.TelemetryStore=void 0;yd.telemetrizePromptLength=kPa;yd.now=Bge;yd.telemetry=gCr;yd.telemetryExpProblem=NPa;yd.telemetryRaw=OPa;yd.telemetryException=oIi;yd.telemetryCatch=LPa;yd.telemetryError=BPa;yd.logEngineCompletion=UPa;yd.logEnginePrompt=QPa;var EPa=U4(),_Pa=nn(),vPa=T0(),dCr=Gs(),pgt=bte(),Q4=LE(),CPa=M0t(),bPa=fy(),SPa=L0t(),TPa=Ovr(),fCr=sCr(),pCr=_5e(),KT;(function(t){t[t.Standard=0]="Standard",t[t.Enhanced=1]="Enhanced"})(KT||(yd.TelemetryStore=KT={}));(function(t){function e(r){return r===t.Enhanced}a(e,"isEnhanced"),t.isEnhanced=e})(KT||(yd.TelemetryStore=KT={}));function Lge(t){return t===KT.Enhanced}a(Lge,"isEnhanced");var IPa=["engine.prompt","engine.completion","ghostText.capturedAfterAccepted","ghostText.capturedAfterRejected"],v5e=8192,xPa=21,q4=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=[TPa.ExpServiceTelemetryNames.featuresTelemetryPropertyName]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},Bge())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=Bge())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(bPa.ICompletionsFeaturesService).getFallbackExpAndFilters();n.addToTelemetry(this),r.addToTelemetry(this)}extendWithEditorAgnosticFields(e){let r=e.get(EPa.IEnvService),n=e.get(Q4.ICompletionsEditorAndPluginInfo);this.properties.editor_version=(0,Q4.formatNameAndVersion)(n.getEditorInfo()),this.properties.editor_plugin_version=(0,Q4.formatNameAndVersion)(n.getEditorPluginInfo()),this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${Q4.BuildInfo.getVersion()}`,typeof process<"u"&&(this.properties.runtime_version=`node/${process.versions.node}`),this.properties.common_extname=n.getEditorPluginInfo().name,this.properties.common_extversion=n.getEditorPluginInfo().version,this.properties.common_vscodeversion=(0,Q4.formatNameAndVersion)(n.getEditorInfo())}extendWithConfigProperties(e){let r=(0,Q4.dumpForTelemetry)(e);r["copilot.build"]=Q4.BuildInfo.getBuild(),r["copilot.buildType"]=Q4.BuildInfo.getBuildType(),this.properties={...this.properties,...r}}extendWithRequestId(e){let r={headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetry=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromProperties(e,r){if(Lge(e))return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetry.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements);for(let e in this.measurements)isNaN(this.measurements[e])&&delete this.measurements[e]}multiplexProperties(){this.properties=t.multiplexProperties(this.properties)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}static multiplexProperties(e){let r={...e};for(let n in e){let o=e[n],s=o?.length??0;if(s>v5e){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+v5e;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(kPa,"telemetrizePromptLength");function Bge(){return performance.now()}a(Bge,"now");function PPa(t){return Math.floor(t/1e3)}a(PPa,"nowSeconds");function mCr(t){return t.get(fCr.ICompletionsTelemetryUserConfigService).optedIn}a(mCr,"shouldSendEnhanced");function nIi(t){return t.get(fCr.ICompletionsTelemetryUserConfigService).ftFlag!==""}a(nIi,"shouldSendFinetuningTelemetry");function gCr(t,e,r,n){return t.get(pCr.ICompletionsPromiseQueueService).register(DPa(t,e,Bge(),r?.extendedBy(),n))}a(gCr,"telemetry");async function DPa(t,e,r,n,o=KT.Standard){let s=t.get(pgt.ICompletionsTelemetryService),c=t.get(dCr.IInstantiationService),l=n||q4.createAndMarkAsIssued({},{});await l.makeReadyForSending(t,o??!1,"IncludeExp",r),(!Lge(o)||c.invokeFunction(mCr))&&hCr(s,o,e,l),Lge(o)&&IPa.includes(e)&&c.invokeFunction(nIi)&&c.invokeFunction(RPa,o,e,l)}a(DPa,"_telemetry");function NPa(t,e){return t.get(pCr.ICompletionsPromiseQueueService).register(MPa(t,e,Bge()))}a(NPa,"telemetryExpProblem");async function MPa(t,e,r){let n=t.get(pgt.ICompletionsTelemetryService),o="expProblem",s=q4.createAndMarkAsIssued(e,{});await s.makeReadyForSending(t,KT.Standard,"SkipExp",r),hCr(n,KT.Standard,o,s)}a(MPa,"_telemetryExpProblem");function OPa(t,e,r,n){let o=t.get(pgt.ICompletionsTelemetryService),s={...r,...iIi(t)};hCr(o,KT.Standard,e,{properties:s,measurements:n})}a(OPa,"telemetryRaw");function iIi(t){let e=t.get(Q4.ICompletionsEditorAndPluginInfo),r={unique_id:(0,vPa.generateUuid)(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:(0,Q4.formatNameAndVersion)(e.getEditorInfo())};return{...t.get(fCr.ICompletionsTelemetryUserConfigService).getProperties(),...r}}a(iIi,"createRequiredProperties");function oIi(t,e,r){return t.sendGHTelemetryException(e,r||"")}a(oIi,"telemetryException");function LPa(t,e,r,n){let o=a(async(...s)=>{try{await r(...s)}catch(c){oIi(t,c,n)}},"wrapped");return(...s)=>e.register(o(...s))}a(LPa,"telemetryCatch");function BPa(t,e,r,n){return t.get(pCr.ICompletionsPromiseQueueService).register(FPa(t,e,Bge(),r?.extendedBy(),n))}a(BPa,"telemetryError");async function FPa(t,e,r,n,o=KT.Standard){if(Lge(o)&&!mCr(t))return;let s=t.get(dCr.IInstantiationService),c=n||q4.createAndMarkAsIssued({},{});await c.makeReadyForSending(t,o,"IncludeExp",r),s.invokeFunction(wPa,o,e,c)}a(FPa,"_telemetryError");function UPa(t,e,r,n,o){let s=q4.createAndMarkAsIssued({completionTextJson:JSON.stringify(e),choiceIndex:o.toString()});if(r.logprobs)for(let[c,l]of Object.entries(r.logprobs))s.properties["logprobs_"+c]=JSON.stringify(l)??"unset";return s.extendWithRequestId(n),gCr(t,"engine.completion",s,KT.Enhanced)}a(UPa,"logEngineCompletion");function QPa(t,e,r){let n={promptJson:JSON.stringify({prefix:e.prefix,context:e.context}),promptSuffixJson:JSON.stringify(e.suffix)};if(e.context){let s=r.properties["request.option.extra"]?JSON.parse(r.properties["request.option.extra"]):{};s.context=e.context,n["request.option.extra"]=JSON.stringify(s)}let o=r.extendedBy(n);return gCr(t,"engine.prompt",o,KT.Enhanced)}a(QPa,"logEnginePrompt");var lCr=class{static{a(this,"CopilotTelemetryReporter")}};yd.CopilotTelemetryReporter=lCr;yd.ICompletionsTelemetryReporters=(0,_Pa.createServiceIdentifier)("ICompletionsTelemetryReporters");var uCr=class{static{a(this,"TelemetryReporters")}getReporter(e,r=KT.Standard){return Lge(r)?this.getEnhancedReporter(e):this.reporter}getEnhancedReporter(e){if(mCr(e))return this.reporterEnhanced}getFTReporter(e){}setReporter(e){this.reporter=e}setEnhancedReporter(e){this.reporterEnhanced=e}setFTReporter(e){this.reporterFT=e}async deactivate(){let e=[this.reporter,this.reporterEnhanced,this.reporterFT];this.reporter=this.reporterEnhanced=this.reporterFT=void 0,await Promise.all(e.map(r=>r?.dispose()))}};yd.TelemetryReporters=uCr});var bte=I(dD=>{"use strict";p();var qPa=dD&&dD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},jPa=dD&&dD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(dD,"__esModule",{value:!0});dD.CompletionsTelemetryServiceBridge=dD.ICompletionsTelemetryService=void 0;var HPa=gm(),ACr=Ivr(),GPa=nn(),C5e=$g();dD.ICompletionsTelemetryService=(0,GPa.createServiceIdentifier)("completionsTelemetryService");var yCr=class{static{a(this,"CompletionsTelemetryServiceBridge")}constructor(e){this.telemetryService=e,this.reporter=void 0,this.enhancedReporter=void 0}sendGHTelemetryEvent(e,r,n,o){this.telemetryService.sendGHTelemetryEvent((0,ACr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??C5e.TelemetryStore.Standard)?.sendTelemetryEvent(e,r,n)}sendEnhancedGHTelemetryEvent(e,r,n,o){this.telemetryService.sendEnhancedGHTelemetryEvent((0,ACr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??C5e.TelemetryStore.Enhanced)?.sendTelemetryEvent(e,r,n)}sendGHTelemetryErrorEvent(e,r,n,o){this.telemetryService.sendGHTelemetryErrorEvent((0,ACr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??C5e.TelemetryStore.Enhanced)?.sendTelemetryErrorEvent(e,r,n)}sendGHTelemetryException(e,r,n){this.telemetryService.sendGHTelemetryException(e,r),e instanceof Error&&this.getSpyReporters(n??C5e.TelemetryStore.Enhanced)?.sendTelemetryException(e,void 0,void 0)}setSpyReporters(e,r){this.reporter=e,this.enhancedReporter=r}clearSpyReporters(){this.reporter=void 0,this.enhancedReporter=void 0}getSpyReporters(e){return C5e.TelemetryStore.isEnhanced(e)?this.enhancedReporter:this.reporter}};dD.CompletionsTelemetryServiceBridge=yCr;dD.CompletionsTelemetryServiceBridge=yCr=qPa([jPa(0,HPa.ITelemetryService)],yCr)});var sIi=I(Fge=>{"use strict";p();Object.defineProperty(Fge,"__esModule",{value:!0});Fge.CopilotExtensionStatus=Fge.ICompletionsExtensionStatus=void 0;var $Pa=nn();Fge.ICompletionsExtensionStatus=(0,$Pa.createServiceIdentifier)("ICompletionsExtensionStatus");var ECr=class{static{a(this,"CopilotExtensionStatus")}constructor(e="Normal",r,n=!1,o){this.kind=e,this.message=r,this.busy=n,this.command=o}};Fge.CopilotExtensionStatus=ECr});var hgt=I(fD=>{"use strict";p();Object.defineProperty(fD,"__esModule",{value:!0});fD.CopilotToken=void 0;fD.containsInternalOrg=aIi;fD.containsVSCodeOrg=uIi;fD.validateTokenEnvelope=dIi;fD.isTokenEnvelope=JPa;fD.isErrorEnvelope=ZPa;fD.isStandardErrorEnvelope=XPa;fD.createTestExtendedTokenInfo=e2a;var Qn=RG();function aIi(t){return cIi(t)||lIi(t)}a(aIi,"containsInternalOrg");function cIi(t){let e=["4535c7beffc844b46bb1ed4aa04d759a"];for(let r of t)if(e.includes(r))return!0;return!1}a(cIi,"containsGitHubOrg");function lIi(t){let e=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"];for(let r of t)if(e.includes(r))return!0;return!1}a(lIi,"containsMicrosoftOrg");function uIi(t){let e=["551cca60ce19654d894e786220822482"];for(let r of t)if(e.includes(r))return!0;return!1}a(uIi,"containsVSCodeOrg");var _Cr=class{static{a(this,"CopilotToken")}constructor(e){this._info=e,this.tokenMap=this.parseToken(e.token)}parseToken(e){let r=new Map,o=e?.split(":")[0]?.split(";");for(let s of o){let[c,l]=s.split("=");r.set(c,l)}return r}get token(){return this._info.token}get sku(){return this._info.sku}get isIndividual(){return this._info.individual??!1}get organizationList(){return this._info.organization_list||[]}get organizationLoginList(){return this._info.organization_login_list||[]}get enterpriseList(){return this._info.enterprise_list||[]}get endpoints(){return this._info.endpoints}get isInternal(){return aIi(this.organizationList)}get isMicrosoftInternal(){return lIi(this.organizationList)}get isGitHubInternal(){return cIi(this.organizationList)}get isFreeUser(){return this.sku==="free_limited_copilot"}get isNoAuthUser(){return this.sku==="no_auth_limited_copilot"}get isManagedPlan(){let e=this.copilotPlan;return e==="business"||e==="enterprise"}get isUsageBasedBilling(){return this._info.token_based_billing===!0}get isChatQuotaExceeded(){return this.isFreeUser&&(this._info.limited_user_quotas?.chat??1)<=0}get isCompletionsQuotaExceeded(){return this.isFreeUser&&(this._info.limited_user_quotas?.completions??1)<=0}get codeQuoteEnabled(){return this._info.code_quote_enabled??!1}get isVscodeTeamMember(){return this._info.isVscodeTeamMember||uIi(this.organizationList)}get codexAgentEnabled(){return this._info.codex_agent_enabled??!1}get copilotPlan(){if(this.isFreeUser)return"free";let e=this._info.copilot_plan;switch(e){case"individual":case"individual_pro":case"individual_max":case"business":case"enterprise":return e;default:return"individual"}}get rawCopilotPlan(){return this.isFreeUser?"free":this._info.copilot_plan??"individual"}get quotaInfo(){return{quota_snapshots:this._info.quota_snapshots,quota_reset_date:this._info.quota_reset_date}}get tokenBasedBilling(){return this._info.token_based_billing}get username(){return this._info.username}isTelemetryEnabled(){return this._isTelemetryEnabled===void 0&&(this._isTelemetryEnabled=this._info.telemetry==="enabled"),this._isTelemetryEnabled}isPublicSuggestionsEnabled(){return this._isPublicSuggestionsEnabled===void 0&&(this._isPublicSuggestionsEnabled=this._info.public_suggestions==="enabled"),this._isPublicSuggestionsEnabled}isCopilotIgnoreEnabled(){return this._info.copilotignore_enabled??!1}get isCopilotCodeReviewEnabled(){return this._info.code_review_enabled??this.getTokenValue("ccr")==="1"}isEditorPreviewFeaturesEnabled(){return this.getTokenValue("editor_preview_features")!=="0"}isBlackbirdExternalIndexingEnabled(){return this.getTokenValue("blackbird_external_indexing")==="1"}isMcpEnabled(){return this.getTokenValue("mcp")!=="0"}isClientBYOKEnabled(){return this.getTokenValue("client_byok")==="1"}getTokenValue(e){return this.tokenMap.get(e)}isExpandedClientSideIndexingEnabled(){return this._info.blackbird_clientside_indexing===!0}isFcv1(){return this.tokenMap.get("fcv1")==="1"}isSn(){return this.tokenMap.get("sn")==="1"}};fD.CopilotToken=_Cr;var VPa=(0,Qn.vObj)({message:(0,Qn.vRequired)((0,Qn.vString)()),notification_id:(0,Qn.vRequired)((0,Qn.vString)()),title:(0,Qn.vRequired)((0,Qn.vString)()),url:(0,Qn.vRequired)((0,Qn.vString)())}),WPa=(0,Qn.vObj)({can_signup_for_limited:(0,Qn.vNullable)((0,Qn.vBoolean)()),error_details:(0,Qn.vRequired)(VPa),message:(0,Qn.vRequired)((0,Qn.vString)()),reason:(0,Qn.vString)()}),zPa=(0,Qn.vObj)({token:(0,Qn.vRequired)((0,Qn.vString)()),expires_at:(0,Qn.vRequired)((0,Qn.vNumber)()),refresh_in:(0,Qn.vRequired)((0,Qn.vNumber)()),sku:(0,Qn.vString)(),individual:(0,Qn.vBoolean)(),blackbird_clientside_indexing:(0,Qn.vBoolean)(),code_quote_enabled:(0,Qn.vBoolean)(),code_review_enabled:(0,Qn.vBoolean)(),codesearch:(0,Qn.vBoolean)(),copilotignore_enabled:(0,Qn.vBoolean)(),public_suggestions:(0,Qn.vEnum)("enabled","disabled","unconfigured"),telemetry:(0,Qn.vEnum)("enabled","disabled"),endpoints:(0,Qn.vObj)({api:(0,Qn.vString)(),"origin-tracker":(0,Qn.vString)(),proxy:(0,Qn.vString)(),telemetry:(0,Qn.vString)()}),enterprise_list:(0,Qn.vNullable)((0,Qn.vArray)((0,Qn.vNumber)())),limited_user_quotas:(0,Qn.vNullable)((0,Qn.vObj)({chat:(0,Qn.vRequired)((0,Qn.vNumber)()),completions:(0,Qn.vRequired)((0,Qn.vNumber)())})),limited_user_reset_date:(0,Qn.vNullable)((0,Qn.vNumber)()),organization_list:(0,Qn.vArray)((0,Qn.vString)())}),YPa=(0,Qn.vObj)({message:(0,Qn.vRequired)((0,Qn.vString)()),documentation_url:(0,Qn.vRequired)((0,Qn.vString)()),status:(0,Qn.vRequired)((0,Qn.vString)())}),KPa=(0,Qn.vObj)({token:(0,Qn.vRequired)((0,Qn.vString)()),expires_at:(0,Qn.vRequired)((0,Qn.vNumber)()),refresh_in:(0,Qn.vRequired)((0,Qn.vNumber)())});function dIi(t){let e=zPa.validate(t);if(e.error===void 0)return{valid:!0,strategy:"strict",envelope:e.content};let r=e.error.message,n=KPa.validate(t);return n.error===void 0?{valid:!0,strategy:"fallback",strictError:r,envelope:t}:{valid:!1,strategy:"failed",strictError:r,fallbackError:n.error.message}}a(dIi,"validateTokenEnvelope");function JPa(t){return dIi(t).valid}a(JPa,"isTokenEnvelope");function ZPa(t){return WPa.validate(t).error===void 0}a(ZPa,"isErrorEnvelope");function XPa(t){return YPa.validate(t).error===void 0}a(XPa,"isStandardErrorEnvelope");function e2a(t){return{token:"test-token",expires_at:0,refresh_in:0,sku:"free_limited_copilot",individual:!0,blackbird_clientside_indexing:!1,code_quote_enabled:!1,code_review_enabled:!1,codesearch:!1,copilotignore_enabled:!1,public_suggestions:"enabled",telemetry:"enabled",username:"testuser",isVscodeTeamMember:!1,copilot_plan:"free",organization_login_list:[],...t}}a(e2a,"createTestExtendedTokenInfo")});var Uge=I(JT=>{"use strict";p();var t2a=JT&&JT.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},r2a=JT&&JT.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(JT,"__esModule",{value:!0});JT.CopilotTokenManagerImpl=JT.ICompletionsCopilotTokenManager=JT.CopilotToken=void 0;var n2a=FE(),i2a=nn(),o2a=nl(),s2a=Ro(),a2a=hgt();Object.defineProperty(JT,"CopilotToken",{enumerable:!0,get:a(function(){return a2a.CopilotToken},"get")});JT.ICompletionsCopilotTokenManager=(0,i2a.createServiceIdentifier)("ICompletionsCopilotTokenManager");var vCr=class extends s2a.Disposable{static{a(this,"CopilotTokenManagerImpl")}get token(){return this.tokenRefetcher.trigger(()=>this.updateCachedToken()),this._token}constructor(e=!1,r){super(),this.primed=e,this.authenticationService=r,this.tokenRefetcher=new o2a.ThrottledDelayer(5e3),this.updateCachedToken(),this._register(this.authenticationService.onDidCopilotTokenChange(()=>this.updateCachedToken()))}primeToken(){try{return this.getToken().then(()=>!0,()=>!1)}catch{return Promise.resolve(!1)}}async getToken(){return this.updateCachedToken()}async updateCachedToken(){return this._token=await this.authenticationService.getCopilotToken(),this._token}resetToken(e){this.authenticationService.resetCopilotToken()}getLastToken(){return this.authenticationService.copilotToken}};JT.CopilotTokenManagerImpl=vCr;JT.CopilotTokenManagerImpl=vCr=t2a([r2a(1,n2a.IAuthenticationService)],vCr)});var mgt=I(Qge=>{"use strict";p();Object.defineProperty(Qge,"__esModule",{value:!0});Qge.NoOpCitationManager=Qge.ICompletionsCitationManager=void 0;var c2a=nn(),l2a=Ro();Qge.ICompletionsCitationManager=(0,c2a.createServiceIdentifier)("ICompletionsCitationManager");var CCr=class{static{a(this,"NoOpCitationManager")}register(){return l2a.Disposable.None}async handleIPCodeCitation(e){}};Qge.NoOpCitationManager=CCr});var Iv=I(Wg=>{"use strict";p();Object.defineProperty(Wg,"__esModule",{value:!0});Wg.HasPropertyKey=u2a;Wg.IsAsyncIterator=d2a;Wg.IsArray=bCr;Wg.IsBigInt=f2a;Wg.IsBoolean=p2a;Wg.IsDate=h2a;Wg.IsFunction=m2a;Wg.IsIterator=g2a;Wg.IsNull=A2a;Wg.IsNumber=y2a;Wg.IsObject=SCr;Wg.IsRegExp=E2a;Wg.IsString=_2a;Wg.IsSymbol=v2a;Wg.IsUint8Array=TCr;Wg.IsUndefined=C2a;function u2a(t,e){return e in t}a(u2a,"HasPropertyKey");function d2a(t){return SCr(t)&&!bCr(t)&&!TCr(t)&&Symbol.asyncIterator in t}a(d2a,"IsAsyncIterator");function bCr(t){return Array.isArray(t)}a(bCr,"IsArray");function f2a(t){return typeof t=="bigint"}a(f2a,"IsBigInt");function p2a(t){return typeof t=="boolean"}a(p2a,"IsBoolean");function h2a(t){return t instanceof globalThis.Date}a(h2a,"IsDate");function m2a(t){return typeof t=="function"}a(m2a,"IsFunction");function g2a(t){return SCr(t)&&!bCr(t)&&!TCr(t)&&Symbol.iterator in t}a(g2a,"IsIterator");function A2a(t){return t===null}a(A2a,"IsNull");function y2a(t){return typeof t=="number"}a(y2a,"IsNumber");function SCr(t){return typeof t=="object"&&t!==null}a(SCr,"IsObject");function E2a(t){return t instanceof globalThis.RegExp}a(E2a,"IsRegExp");function _2a(t){return typeof t=="string"}a(_2a,"IsString");function v2a(t){return typeof t=="symbol"}a(v2a,"IsSymbol");function TCr(t){return t instanceof globalThis.Uint8Array}a(TCr,"IsUint8Array");function C2a(t){return t===void 0}a(C2a,"IsUndefined")});var Yb=I(X8=>{"use strict";p();var b2a=X8&&X8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),S2a=X8&&X8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),T2a=X8&&X8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oggt(e))}a(I2a,"ArrayType");function x2a(t){return new Date(t.getTime())}a(x2a,"DateType");function w2a(t){return new Uint8Array(t)}a(w2a,"Uint8ArrayType");function R2a(t){return new RegExp(t.source,t.flags)}a(R2a,"RegExpType");function k2a(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=ggt(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=ggt(t[r]);return e}a(k2a,"ObjectType");function ggt(t){return b5e.IsArray(t)?I2a(t):b5e.IsDate(t)?x2a(t):b5e.IsUint8Array(t)?w2a(t):b5e.IsRegExp(t)?R2a(t):b5e.IsObject(t)?k2a(t):t}a(ggt,"Visit");function P2a(t){return ggt(t)}a(P2a,"Clone")});var ygt=I(Agt=>{"use strict";p();Object.defineProperty(Agt,"__esModule",{value:!0});Agt.CloneRest=D2a;Agt.CloneType=pIi;var fIi=Yb();function D2a(t){return t.map(e=>pIi(e))}a(D2a,"CloneRest");function pIi(t,e){return e===void 0?(0,fIi.Clone)(t):(0,fIi.Clone)({...e,...t})}a(pIi,"CloneType")});var ICr=I(MG=>{"use strict";p();var N2a=MG&&MG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hIi=MG&&MG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&N2a(e,t,r)};Object.defineProperty(MG,"__esModule",{value:!0});hIi(ygt(),MG);hIi(Yb(),MG)});var Egt=I(ya=>{"use strict";p();Object.defineProperty(ya,"__esModule",{value:!0});ya.IsAsyncIterator=M2a;ya.IsIterator=O2a;ya.IsStandardObject=L2a;ya.IsInstanceObject=B2a;ya.IsPromise=F2a;ya.IsDate=U2a;ya.IsMap=Q2a;ya.IsSet=q2a;ya.IsRegExp=j2a;ya.IsTypedArray=H2a;ya.IsInt8Array=G2a;ya.IsUint8Array=$2a;ya.IsUint8ClampedArray=V2a;ya.IsInt16Array=W2a;ya.IsUint16Array=z2a;ya.IsInt32Array=Y2a;ya.IsUint32Array=K2a;ya.IsFloat32Array=J2a;ya.IsFloat64Array=Z2a;ya.IsBigInt64Array=X2a;ya.IsBigUint64Array=eDa;ya.HasPropertyKey=tDa;ya.IsObject=S5e;ya.IsArray=mIi;ya.IsUndefined=gIi;ya.IsNull=AIi;ya.IsBoolean=yIi;ya.IsNumber=EIi;ya.IsInteger=rDa;ya.IsBigInt=_Ii;ya.IsString=vIi;ya.IsFunction=CIi;ya.IsSymbol=bIi;ya.IsValueType=nDa;function M2a(t){return S5e(t)&&globalThis.Symbol.asyncIterator in t}a(M2a,"IsAsyncIterator");function O2a(t){return S5e(t)&&globalThis.Symbol.iterator in t}a(O2a,"IsIterator");function L2a(t){return S5e(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(L2a,"IsStandardObject");function B2a(t){return S5e(t)&&!mIi(t)&&CIi(t.constructor)&&t.constructor.name!=="Object"}a(B2a,"IsInstanceObject");function F2a(t){return t instanceof globalThis.Promise}a(F2a,"IsPromise");function U2a(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(U2a,"IsDate");function Q2a(t){return t instanceof globalThis.Map}a(Q2a,"IsMap");function q2a(t){return t instanceof globalThis.Set}a(q2a,"IsSet");function j2a(t){return t instanceof globalThis.RegExp}a(j2a,"IsRegExp");function H2a(t){return globalThis.ArrayBuffer.isView(t)}a(H2a,"IsTypedArray");function G2a(t){return t instanceof globalThis.Int8Array}a(G2a,"IsInt8Array");function $2a(t){return t instanceof globalThis.Uint8Array}a($2a,"IsUint8Array");function V2a(t){return t instanceof globalThis.Uint8ClampedArray}a(V2a,"IsUint8ClampedArray");function W2a(t){return t instanceof globalThis.Int16Array}a(W2a,"IsInt16Array");function z2a(t){return t instanceof globalThis.Uint16Array}a(z2a,"IsUint16Array");function Y2a(t){return t instanceof globalThis.Int32Array}a(Y2a,"IsInt32Array");function K2a(t){return t instanceof globalThis.Uint32Array}a(K2a,"IsUint32Array");function J2a(t){return t instanceof globalThis.Float32Array}a(J2a,"IsFloat32Array");function Z2a(t){return t instanceof globalThis.Float64Array}a(Z2a,"IsFloat64Array");function X2a(t){return t instanceof globalThis.BigInt64Array}a(X2a,"IsBigInt64Array");function eDa(t){return t instanceof globalThis.BigUint64Array}a(eDa,"IsBigUint64Array");function tDa(t,e){return e in t}a(tDa,"HasPropertyKey");function S5e(t){return t!==null&&typeof t=="object"}a(S5e,"IsObject");function mIi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(mIi,"IsArray");function gIi(t){return t===void 0}a(gIi,"IsUndefined");function AIi(t){return t===null}a(AIi,"IsNull");function yIi(t){return typeof t=="boolean"}a(yIi,"IsBoolean");function EIi(t){return typeof t=="number"}a(EIi,"IsNumber");function rDa(t){return globalThis.Number.isInteger(t)}a(rDa,"IsInteger");function _Ii(t){return typeof t=="bigint"}a(_Ii,"IsBigInt");function vIi(t){return typeof t=="string"}a(vIi,"IsString");function CIi(t){return typeof t=="function"}a(CIi,"IsFunction");function bIi(t){return typeof t=="symbol"}a(bIi,"IsSymbol");function nDa(t){return _Ii(t)||yIi(t)||AIi(t)||EIi(t)||vIi(t)||bIi(t)||gIi(t)}a(nDa,"IsValueType")});var R0=I(Ste=>{"use strict";p();var iDa=Ste&&Ste.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),oDa=Ste&&Ste.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iDa(e,t,r)};Object.defineProperty(Ste,"__esModule",{value:!0});oDa(Egt(),Ste)});var T5e=I(vgt=>{"use strict";p();Object.defineProperty(vgt,"__esModule",{value:!0});vgt.TypeSystemPolicy=void 0;var _gt=R0(),SIi;(function(t){t.InstanceMode="default",t.ExactOptionalPropertyTypes=!1,t.AllowArrayObject=!1,t.AllowNaN=!1,t.AllowNullVoid=!1;function e(c,l){return t.ExactOptionalPropertyTypes?l in c:c[l]!==void 0}a(e,"IsExactOptionalProperty"),t.IsExactOptionalProperty=e;function r(c){let l=(0,_gt.IsObject)(c);return t.AllowArrayObject?l:l&&!(0,_gt.IsArray)(c)}a(r,"IsObjectLike"),t.IsObjectLike=r;function n(c){return r(c)&&!(c instanceof Date)&&!(c instanceof Uint8Array)}a(n,"IsRecordLike"),t.IsRecordLike=n;function o(c){return t.AllowNaN?(0,_gt.IsNumber)(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=(0,_gt.IsUndefined)(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(SIi||(vgt.TypeSystemPolicy=SIi={}))});var TIi=I(e6=>{"use strict";p();var sDa=e6&&e6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aDa=e6&&e6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),cDa=e6&&e6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oCgt(e))}a(lDa,"ImmutableArray");function uDa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Cgt(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Cgt(t[r]);return globalThis.Object.freeze(e)}a(uDa,"ImmutableObject");function Cgt(t){return I5e.IsArray(t)?lDa(t):I5e.IsDate(t)?t:I5e.IsUint8Array(t)?t:I5e.IsRegExp(t)?t:I5e.IsObject(t)?uDa(t):t}a(Cgt,"Immutable")});var Ii=I(xCr=>{"use strict";p();Object.defineProperty(xCr,"__esModule",{value:!0});xCr.CreateType=hDa;var dDa=T5e(),fDa=TIi(),pDa=Yb();function hDa(t,e){let r=e!==void 0?{...e,...t}:t;switch(dDa.TypeSystemPolicy.InstanceMode){case"freeze":return(0,fDa.Immutable)(r);case"clone":return(0,pDa.Clone)(r);default:return r}}a(hDa,"CreateType")});var t6=I(Tte=>{"use strict";p();var mDa=Tte&&Tte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gDa=Tte&&Tte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mDa(e,t,r)};Object.defineProperty(Tte,"__esModule",{value:!0});gDa(Ii(),Tte)});var RCr=I(bgt=>{"use strict";p();Object.defineProperty(bgt,"__esModule",{value:!0});bgt.TypeBoxError=void 0;var wCr=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};bgt.TypeBoxError=wCr});var Nf=I(Ite=>{"use strict";p();var ADa=Ite&&Ite.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yDa=Ite&&Ite.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ADa(e,t,r)};Object.defineProperty(Ite,"__esModule",{value:!0});yDa(RCr(),Ite)});var x5e=I(IR=>{"use strict";p();Object.defineProperty(IR,"__esModule",{value:!0});IR.Kind=IR.Hint=IR.OptionalKind=IR.ReadonlyKind=IR.TransformKind=void 0;IR.TransformKind=Symbol.for("TypeBox.Transform");IR.ReadonlyKind=Symbol.for("TypeBox.Readonly");IR.OptionalKind=Symbol.for("TypeBox.Optional");IR.Hint=Symbol.for("TypeBox.Hint");IR.Kind=Symbol.for("TypeBox.Kind")});var Sn=I(xte=>{"use strict";p();var EDa=xte&&xte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_Da=xte&&xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EDa(e,t,r)};Object.defineProperty(xte,"__esModule",{value:!0});_Da(x5e(),xte)});var vs=I(ui=>{"use strict";p();var vDa=ui&&ui.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),CDa=ui&&ui.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bDa=ui&&ui.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var ODa=Jn&&Jn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),LDa=Jn&&Jn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),BDa=Jn&&Jn.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=7&&r<=13||r===27||r===127)return!1}return!0}a(PCr,"IsControlCharacterFree");function lxi(t){return DCr(t)||zg(t)}a(lxi,"IsAdditionalProperties");function R5e(t){return si.IsUndefined(t)||si.IsBigInt(t)}a(R5e,"IsOptionalBigInt");function Zl(t){return si.IsUndefined(t)||si.IsNumber(t)}a(Zl,"IsOptionalNumber");function DCr(t){return si.IsUndefined(t)||si.IsBoolean(t)}a(DCr,"IsOptionalBoolean");function pl(t){return si.IsUndefined(t)||si.IsString(t)}a(pl,"IsOptionalString");function QDa(t){return si.IsUndefined(t)||si.IsString(t)&&PCr(t)&&cxi(t)}a(QDa,"IsOptionalPattern");function qDa(t){return si.IsUndefined(t)||si.IsString(t)&&PCr(t)}a(qDa,"IsOptionalFormat");function uxi(t){return si.IsUndefined(t)||zg(t)}a(uxi,"IsOptionalSchema");function jDa(t){return si.IsObject(t)&&t[j4.ReadonlyKind]==="Readonly"}a(jDa,"IsReadonly");function HDa(t){return si.IsObject(t)&&t[j4.OptionalKind]==="Optional"}a(HDa,"IsOptional");function dxi(t){return Vs(t,"Any")&&pl(t.$id)}a(dxi,"IsAny");function fxi(t){return Vs(t,"Argument")&&si.IsNumber(t.index)}a(fxi,"IsArgument");function pxi(t){return Vs(t,"Array")&&t.type==="array"&&pl(t.$id)&&zg(t.items)&&Zl(t.minItems)&&Zl(t.maxItems)&&DCr(t.uniqueItems)&&uxi(t.contains)&&Zl(t.minContains)&&Zl(t.maxContains)}a(pxi,"IsArray");function hxi(t){return Vs(t,"AsyncIterator")&&t.type==="AsyncIterator"&&pl(t.$id)&&zg(t.items)}a(hxi,"IsAsyncIterator");function mxi(t){return Vs(t,"BigInt")&&t.type==="bigint"&&pl(t.$id)&&R5e(t.exclusiveMaximum)&&R5e(t.exclusiveMinimum)&&R5e(t.maximum)&&R5e(t.minimum)&&R5e(t.multipleOf)}a(mxi,"IsBigInt");function gxi(t){return Vs(t,"Boolean")&&t.type==="boolean"&&pl(t.$id)}a(gxi,"IsBoolean");function Axi(t){return Vs(t,"Computed")&&si.IsString(t.target)&&si.IsArray(t.parameters)&&t.parameters.every(e=>zg(e))}a(Axi,"IsComputed");function yxi(t){return Vs(t,"Constructor")&&t.type==="Constructor"&&pl(t.$id)&&si.IsArray(t.parameters)&&t.parameters.every(e=>zg(e))&&zg(t.returns)}a(yxi,"IsConstructor");function Exi(t){return Vs(t,"Date")&&t.type==="Date"&&pl(t.$id)&&Zl(t.exclusiveMaximumTimestamp)&&Zl(t.exclusiveMinimumTimestamp)&&Zl(t.maximumTimestamp)&&Zl(t.minimumTimestamp)&&Zl(t.multipleOfTimestamp)}a(Exi,"IsDate");function _xi(t){return Vs(t,"Function")&&t.type==="Function"&&pl(t.$id)&&si.IsArray(t.parameters)&&t.parameters.every(e=>zg(e))&&zg(t.returns)}a(_xi,"IsFunction");function GDa(t){return Vs(t,"Import")&&si.HasPropertyKey(t,"$defs")&&si.IsObject(t.$defs)&&Sgt(t.$defs)&&si.HasPropertyKey(t,"$ref")&&si.IsString(t.$ref)&&t.$ref in t.$defs}a(GDa,"IsImport");function vxi(t){return Vs(t,"Integer")&&t.type==="integer"&&pl(t.$id)&&Zl(t.exclusiveMaximum)&&Zl(t.exclusiveMinimum)&&Zl(t.maximum)&&Zl(t.minimum)&&Zl(t.multipleOf)}a(vxi,"IsInteger");function Sgt(t){return si.IsObject(t)&&Object.entries(t).every(([e,r])=>PCr(e)&&zg(r))}a(Sgt,"IsProperties");function Cxi(t){return Vs(t,"Intersect")&&!(si.IsString(t.type)&&t.type!=="object")&&si.IsArray(t.allOf)&&t.allOf.every(e=>zg(e)&&!jxi(e))&&pl(t.type)&&(DCr(t.unevaluatedProperties)||uxi(t.unevaluatedProperties))&&pl(t.$id)}a(Cxi,"IsIntersect");function bxi(t){return Vs(t,"Iterator")&&t.type==="Iterator"&&pl(t.$id)&&zg(t.items)}a(bxi,"IsIterator");function Vs(t,e){return si.IsObject(t)&&j4.Kind in t&&t[j4.Kind]===e}a(Vs,"IsKindOf");function Sxi(t){return k5e(t)&&si.IsString(t.const)}a(Sxi,"IsLiteralString");function Txi(t){return k5e(t)&&si.IsNumber(t.const)}a(Txi,"IsLiteralNumber");function $Da(t){return k5e(t)&&si.IsBoolean(t.const)}a($Da,"IsLiteralBoolean");function k5e(t){return Vs(t,"Literal")&&pl(t.$id)&&Ixi(t.const)}a(k5e,"IsLiteral");function Ixi(t){return si.IsBoolean(t)||si.IsNumber(t)||si.IsString(t)}a(Ixi,"IsLiteralValue");function xxi(t){return Vs(t,"MappedKey")&&si.IsArray(t.keys)&&t.keys.every(e=>si.IsNumber(e)||si.IsString(e))}a(xxi,"IsMappedKey");function wxi(t){return Vs(t,"MappedResult")&&Sgt(t.properties)}a(wxi,"IsMappedResult");function Rxi(t){return Vs(t,"Never")&&si.IsObject(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(Rxi,"IsNever");function kxi(t){return Vs(t,"Not")&&zg(t.not)}a(kxi,"IsNot");function Pxi(t){return Vs(t,"Null")&&t.type==="null"&&pl(t.$id)}a(Pxi,"IsNull");function Dxi(t){return Vs(t,"Number")&&t.type==="number"&&pl(t.$id)&&Zl(t.exclusiveMaximum)&&Zl(t.exclusiveMinimum)&&Zl(t.maximum)&&Zl(t.minimum)&&Zl(t.multipleOf)}a(Dxi,"IsNumber");function Nxi(t){return Vs(t,"Object")&&t.type==="object"&&pl(t.$id)&&Sgt(t.properties)&&lxi(t.additionalProperties)&&Zl(t.minProperties)&&Zl(t.maxProperties)}a(Nxi,"IsObject");function Mxi(t){return Vs(t,"Promise")&&t.type==="Promise"&&pl(t.$id)&&zg(t.item)}a(Mxi,"IsPromise");function Oxi(t){return Vs(t,"Record")&&t.type==="object"&&pl(t.$id)&&lxi(t.additionalProperties)&&si.IsObject(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&cxi(r[0])&&si.IsObject(e.patternProperties)&&zg(e.patternProperties[r[0]])})(t)}a(Oxi,"IsRecord");function VDa(t){return si.IsObject(t)&&j4.Hint in t&&t[j4.Hint]==="Recursive"}a(VDa,"IsRecursive");function Lxi(t){return Vs(t,"Ref")&&pl(t.$id)&&si.IsString(t.$ref)}a(Lxi,"IsRef");function Bxi(t){return Vs(t,"RegExp")&&pl(t.$id)&&si.IsString(t.source)&&si.IsString(t.flags)&&Zl(t.maxLength)&&Zl(t.minLength)}a(Bxi,"IsRegExp");function Fxi(t){return Vs(t,"String")&&t.type==="string"&&pl(t.$id)&&Zl(t.minLength)&&Zl(t.maxLength)&&QDa(t.pattern)&&qDa(t.format)}a(Fxi,"IsString");function Uxi(t){return Vs(t,"Symbol")&&t.type==="symbol"&&pl(t.$id)}a(Uxi,"IsSymbol");function Qxi(t){return Vs(t,"TemplateLiteral")&&t.type==="string"&&si.IsString(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(Qxi,"IsTemplateLiteral");function qxi(t){return Vs(t,"This")&&pl(t.$id)&&si.IsString(t.$ref)}a(qxi,"IsThis");function jxi(t){return si.IsObject(t)&&j4.TransformKind in t}a(jxi,"IsTransform");function Hxi(t){return Vs(t,"Tuple")&&t.type==="array"&&pl(t.$id)&&si.IsNumber(t.minItems)&&si.IsNumber(t.maxItems)&&t.minItems===t.maxItems&&(si.IsUndefined(t.items)&&si.IsUndefined(t.additionalItems)&&t.minItems===0||si.IsArray(t.items)&&t.items.every(e=>zg(e)))}a(Hxi,"IsTuple");function Gxi(t){return Vs(t,"Undefined")&&t.type==="undefined"&&pl(t.$id)}a(Gxi,"IsUndefined");function WDa(t){return NCr(t)&&t.anyOf.every(e=>Sxi(e)||Txi(e))}a(WDa,"IsUnionLiteral");function NCr(t){return Vs(t,"Union")&&pl(t.$id)&&si.IsObject(t)&&si.IsArray(t.anyOf)&&t.anyOf.every(e=>zg(e))}a(NCr,"IsUnion");function $xi(t){return Vs(t,"Uint8Array")&&t.type==="Uint8Array"&&pl(t.$id)&&Zl(t.minByteLength)&&Zl(t.maxByteLength)}a($xi,"IsUint8Array");function Vxi(t){return Vs(t,"Unknown")&&pl(t.$id)}a(Vxi,"IsUnknown");function Wxi(t){return Vs(t,"Unsafe")}a(Wxi,"IsUnsafe");function zxi(t){return Vs(t,"Void")&&t.type==="void"&&pl(t.$id)}a(zxi,"IsVoid");function Yxi(t){return si.IsObject(t)&&j4.Kind in t&&si.IsString(t[j4.Kind])&&!UDa.includes(t[j4.Kind])}a(Yxi,"IsKind");function zg(t){return si.IsObject(t)&&(dxi(t)||fxi(t)||pxi(t)||gxi(t)||mxi(t)||hxi(t)||Axi(t)||yxi(t)||Exi(t)||_xi(t)||vxi(t)||Cxi(t)||bxi(t)||k5e(t)||xxi(t)||wxi(t)||Rxi(t)||kxi(t)||Pxi(t)||Dxi(t)||Nxi(t)||Mxi(t)||Oxi(t)||Lxi(t)||Bxi(t)||Fxi(t)||Uxi(t)||Qxi(t)||qxi(t)||Hxi(t)||Gxi(t)||NCr(t)||$xi(t)||Vxi(t)||Wxi(t)||zxi(t)||Yxi(t))}a(zg,"IsSchema")});var OCr=I(Jb=>{"use strict";p();var zDa=Jb&&Jb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),YDa=Jb&&Jb.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),MCr=Jb&&Jb.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(LCr,"__esModule",{value:!0});LCr.Increment=KDa;function KDa(t){return(parseInt(t)+1).toString()}a(KDa,"Increment")});var Zxi=I(wte=>{"use strict";p();var JDa=wte&&wte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ZDa=wte&&wte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JDa(e,t,r)};Object.defineProperty(wte,"__esModule",{value:!0});ZDa(Jxi(),wte)});var Xxi=I(Tp=>{"use strict";p();Object.defineProperty(Tp,"__esModule",{value:!0});Tp.PatternNeverExact=Tp.PatternStringExact=Tp.PatternNumberExact=Tp.PatternBooleanExact=Tp.PatternNever=Tp.PatternString=Tp.PatternNumber=Tp.PatternBoolean=void 0;Tp.PatternBoolean="(true|false)";Tp.PatternNumber="(0|[1-9][0-9]*)";Tp.PatternString="(.*)";Tp.PatternNever="(?!.*)";Tp.PatternBooleanExact=`^${Tp.PatternBoolean}$`;Tp.PatternNumberExact=`^${Tp.PatternNumber}$`;Tp.PatternStringExact=`^${Tp.PatternString}$`;Tp.PatternNeverExact=`^${Tp.PatternNever}$`});var P5e=I(Rte=>{"use strict";p();var XDa=Rte&&Rte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eNa=Rte&&Rte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&XDa(e,t,r)};Object.defineProperty(Rte,"__esModule",{value:!0});eNa(Xxi(),Rte)});var ewi=I(OG=>{"use strict";p();Object.defineProperty(OG,"__esModule",{value:!0});OG.Entries=tNa;OG.Clear=rNa;OG.Delete=nNa;OG.Has=iNa;OG.Set=oNa;OG.Get=sNa;var qge=new Map;function tNa(){return new Map(qge)}a(tNa,"Entries");function rNa(){return qge.clear()}a(rNa,"Clear");function nNa(t){return qge.delete(t)}a(nNa,"Delete");function iNa(t){return qge.has(t)}a(iNa,"Has");function oNa(t,e){qge.set(t,e)}a(oNa,"Set");function sNa(t){return qge.get(t)}a(sNa,"Get")});var twi=I(LG=>{"use strict";p();Object.defineProperty(LG,"__esModule",{value:!0});LG.Entries=aNa;LG.Clear=cNa;LG.Delete=lNa;LG.Has=uNa;LG.Set=dNa;LG.Get=fNa;var jge=new Map;function aNa(){return new Map(jge)}a(aNa,"Entries");function cNa(){return jge.clear()}a(cNa,"Clear");function lNa(t){return jge.delete(t)}a(lNa,"Delete");function uNa(t){return jge.has(t)}a(uNa,"Has");function dNa(t,e){jge.set(t,e)}a(dNa,"Set");function fNa(t){return jge.get(t)}a(fNa,"Get")});var Hge=I(xR=>{"use strict";p();var pNa=xR&&xR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hNa=xR&&xR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),rwi=xR&&xR.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(H4,"__esModule",{value:!0});H4.SetIncludes=nwi;H4.SetIsSubset=mNa;H4.SetDistinct=gNa;H4.SetIntersect=iwi;H4.SetUnion=ANa;H4.SetComplement=yNa;H4.SetIntersectMany=_Na;H4.SetUnionMany=vNa;function nwi(t,e){return t.includes(e)}a(nwi,"SetIncludes");function mNa(t,e){return t.every(r=>nwi(e,r))}a(mNa,"SetIsSubset");function gNa(t){return[...new Set(t)]}a(gNa,"SetDistinct");function iwi(t,e){return t.filter(r=>e.includes(r))}a(iwi,"SetIntersect");function ANa(t,e){return[...t,...e]}a(ANa,"SetUnion");function yNa(t,e){return t.filter(r=>!e.includes(r))}a(yNa,"SetComplement");function ENa(t,e){return t.reduce((r,n)=>iwi(r,n),e)}a(ENa,"SetIntersectManyResolve");function _Na(t){return t.length===1?t[0]:t.length>1?ENa(t.slice(1),t[0]):[]}a(_Na,"SetIntersectMany");function vNa(t){let e=[];for(let r of t)e.push(...r);return e}a(vNa,"SetUnionMany")});var D5e=I(kte=>{"use strict";p();var CNa=kte&&kte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bNa=kte&&kte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&CNa(e,t,r)};Object.defineProperty(kte,"__esModule",{value:!0});bNa(owi(),kte)});var swi=I(BCr=>{"use strict";p();Object.defineProperty(BCr,"__esModule",{value:!0});BCr.Any=INa;var SNa=t6(),TNa=Sn();function INa(t){return(0,SNa.CreateType)({[TNa.Kind]:"Any"},t)}a(INa,"Any")});var Gge=I(Pte=>{"use strict";p();var xNa=Pte&&Pte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wNa=Pte&&Pte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xNa(e,t,r)};Object.defineProperty(Pte,"__esModule",{value:!0});wNa(swi(),Pte)});var awi=I(FCr=>{"use strict";p();Object.defineProperty(FCr,"__esModule",{value:!0});FCr.Array=PNa;var RNa=Ii(),kNa=Sn();function PNa(t,e){return(0,RNa.CreateType)({[kNa.Kind]:"Array",type:"array",items:t},e)}a(PNa,"Array")});var $ge=I(Dte=>{"use strict";p();var DNa=Dte&&Dte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NNa=Dte&&Dte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&DNa(e,t,r)};Object.defineProperty(Dte,"__esModule",{value:!0});NNa(awi(),Dte)});var cwi=I(UCr=>{"use strict";p();Object.defineProperty(UCr,"__esModule",{value:!0});UCr.Argument=LNa;var MNa=Ii(),ONa=Sn();function LNa(t){return(0,MNa.CreateType)({[ONa.Kind]:"Argument",index:t})}a(LNa,"Argument")});var Tgt=I(Nte=>{"use strict";p();var BNa=Nte&&Nte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),FNa=Nte&&Nte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&BNa(e,t,r)};Object.defineProperty(Nte,"__esModule",{value:!0});FNa(cwi(),Nte)});var lwi=I(QCr=>{"use strict";p();Object.defineProperty(QCr,"__esModule",{value:!0});QCr.AsyncIterator=qNa;var UNa=Sn(),QNa=Ii();function qNa(t,e){return(0,QNa.CreateType)({[UNa.Kind]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(qNa,"AsyncIterator")});var Vge=I(Mte=>{"use strict";p();var jNa=Mte&&Mte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),HNa=Mte&&Mte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jNa(e,t,r)};Object.defineProperty(Mte,"__esModule",{value:!0});HNa(lwi(),Mte)});var uwi=I(qCr=>{"use strict";p();Object.defineProperty(qCr,"__esModule",{value:!0});qCr.Computed=VNa;var GNa=t6(),$Na=x5e();function VNa(t,e,r){return(0,GNa.CreateType)({[$Na.Kind]:"Computed",target:t,parameters:e},r)}a(VNa,"Computed")});var BG=I(Ote=>{"use strict";p();var WNa=Ote&&Ote.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zNa=Ote&&Ote.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&WNa(e,t,r)};Object.defineProperty(Ote,"__esModule",{value:!0});zNa(uwi(),Ote)});var Igt=I(jCr=>{"use strict";p();Object.defineProperty(jCr,"__esModule",{value:!0});jCr.Discard=KNa;function YNa(t,e){let{[e]:r,...n}=t;return n}a(YNa,"DiscardKey");function KNa(t,e){return e.reduce((r,n)=>YNa(r,n),t)}a(KNa,"Discard")});var n6=I(Lte=>{"use strict";p();var JNa=Lte&&Lte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ZNa=Lte&&Lte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JNa(e,t,r)};Object.defineProperty(Lte,"__esModule",{value:!0});ZNa(Igt(),Lte)});var dwi=I(HCr=>{"use strict";p();Object.defineProperty(HCr,"__esModule",{value:!0});HCr.Never=tMa;var XNa=Ii(),eMa=Sn();function tMa(t){return(0,XNa.CreateType)({[eMa.Kind]:"Never",not:{}},t)}a(tMa,"Never")});var Cm=I(Bte=>{"use strict";p();var rMa=Bte&&Bte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nMa=Bte&&Bte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rMa(e,t,r)};Object.defineProperty(Bte,"__esModule",{value:!0});nMa(dwi(),Bte)});var fwi=I(GCr=>{"use strict";p();Object.defineProperty(GCr,"__esModule",{value:!0});GCr.MappedKey=sMa;var iMa=Ii(),oMa=Sn();function sMa(t){return(0,iMa.CreateType)({[oMa.Kind]:"MappedKey",keys:t})}a(sMa,"MappedKey")});var VCr=I($Cr=>{"use strict";p();Object.defineProperty($Cr,"__esModule",{value:!0});$Cr.MappedResult=lMa;var aMa=Ii(),cMa=Sn();function lMa(t){return(0,aMa.CreateType)({[cMa.Kind]:"MappedResult",properties:t})}a(lMa,"MappedResult")});var pwi=I(WCr=>{"use strict";p();Object.defineProperty(WCr,"__esModule",{value:!0});WCr.Constructor=fMa;var uMa=Ii(),dMa=Sn();function fMa(t,e,r){return(0,uMa.CreateType)({[dMa.Kind]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(fMa,"Constructor")});var Wge=I(Fte=>{"use strict";p();var pMa=Fte&&Fte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hMa=Fte&&Fte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pMa(e,t,r)};Object.defineProperty(Fte,"__esModule",{value:!0});hMa(pwi(),Fte)});var hwi=I(zCr=>{"use strict";p();Object.defineProperty(zCr,"__esModule",{value:!0});zCr.Function=AMa;var mMa=Ii(),gMa=Sn();function AMa(t,e,r){return(0,mMa.CreateType)({[gMa.Kind]:"Function",type:"Function",parameters:t,returns:e},r)}a(AMa,"Function")});var FG=I(Ute=>{"use strict";p();var yMa=Ute&&Ute.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),EMa=Ute&&Ute.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yMa(e,t,r)};Object.defineProperty(Ute,"__esModule",{value:!0});EMa(hwi(),Ute)});var KCr=I(YCr=>{"use strict";p();Object.defineProperty(YCr,"__esModule",{value:!0});YCr.UnionCreate=CMa;var _Ma=Ii(),vMa=Sn();function CMa(t,e){return(0,_Ma.CreateType)({[vMa.Kind]:"Union",anyOf:t},e)}a(CMa,"UnionCreate")});var ywi=I(JCr=>{"use strict";p();Object.defineProperty(JCr,"__esModule",{value:!0});JCr.UnionEvaluated=PMa;var bMa=Ii(),SMa=Sn(),TMa=n6(),IMa=Cm(),xMa=G4(),mwi=KCr(),Awi=vs();function wMa(t){return t.some(e=>(0,Awi.IsOptional)(e))}a(wMa,"IsUnionOptional");function gwi(t){return t.map(e=>(0,Awi.IsOptional)(e)?RMa(e):e)}a(gwi,"RemoveOptionalFromRest");function RMa(t){return(0,TMa.Discard)(t,[SMa.OptionalKind])}a(RMa,"RemoveOptionalFromType");function kMa(t,e){return wMa(t)?(0,xMa.Optional)((0,mwi.UnionCreate)(gwi(t),e)):(0,mwi.UnionCreate)(gwi(t),e)}a(kMa,"ResolveUnion");function PMa(t,e){return t.length===1?(0,bMa.CreateType)(t[0],e):t.length===0?(0,IMa.Never)(e):kMa(t,e)}a(PMa,"UnionEvaluated")});var _wi=I(Ewi=>{"use strict";p();Object.defineProperty(Ewi,"__esModule",{value:!0});var ZSp=Sn()});var vwi=I(ZCr=>{"use strict";p();Object.defineProperty(ZCr,"__esModule",{value:!0});ZCr.Union=OMa;var DMa=Cm(),NMa=Ii(),MMa=KCr();function OMa(t,e){return t.length===0?(0,DMa.Never)(e):t.length===1?(0,NMa.CreateType)(t[0],e):(0,MMa.UnionCreate)(t,e)}a(OMa,"Union")});var Ip=I(i6=>{"use strict";p();var LMa=i6&&i6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XCr=i6&&i6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LMa(e,t,r)};Object.defineProperty(i6,"__esModule",{value:!0});XCr(ywi(),i6);XCr(_wi(),i6);XCr(vwi(),i6)});var xgt=I(zge=>{"use strict";p();Object.defineProperty(zge,"__esModule",{value:!0});zge.TemplateLiteralParserError=void 0;zge.TemplateLiteralParse=Qte;zge.TemplateLiteralParseExact=$Ma;var BMa=Nf(),N5e=class extends BMa.TypeBoxError{static{a(this,"TemplateLiteralParserError")}};zge.TemplateLiteralParserError=N5e;function FMa(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(FMa,"Unescape");function ebr(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(ebr,"IsNonEscaped");function o6(t,e){return ebr(t,e,"(")}a(o6,"IsOpenParen");function M5e(t,e){return ebr(t,e,")")}a(M5e,"IsCloseParen");function Cwi(t,e){return ebr(t,e,"|")}a(Cwi,"IsSeparator");function UMa(t){if(!(o6(t,0)&&M5e(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(Qte(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(Qte(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(HMa,"Or");function GMa(t){function e(o,s){if(!o6(o,s))throw new N5e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(Qte(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(GMa,"And");function Qte(t){return UMa(t)?Qte(QMa(t)):qMa(t)?HMa(t):jMa(t)?GMa(t):{type:"const",const:FMa(t)}}a(Qte,"TemplateLiteralParse");function $Ma(t){return Qte(t.slice(1,t.length-1))}a($Ma,"TemplateLiteralParseExact")});var tbr=I(Yge=>{"use strict";p();Object.defineProperty(Yge,"__esModule",{value:!0});Yge.TemplateLiteralFiniteError=void 0;Yge.IsTemplateLiteralExpressionFinite=Rgt;Yge.IsTemplateLiteralFinite=JMa;var VMa=xgt(),WMa=Nf(),wgt=class extends WMa.TypeBoxError{static{a(this,"TemplateLiteralFiniteError")}};Yge.TemplateLiteralFiniteError=wgt;function zMa(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="0"&&t.expr[1].type==="const"&&t.expr[1].const==="[1-9][0-9]*"}a(zMa,"IsNumberExpression");function YMa(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="true"&&t.expr[1].type==="const"&&t.expr[1].const==="false"}a(YMa,"IsBooleanExpression");function KMa(t){return t.type==="const"&&t.const===".*"}a(KMa,"IsStringExpression");function Rgt(t){return zMa(t)||KMa(t)?!1:YMa(t)?!0:t.type==="and"?t.expr.every(e=>Rgt(e)):t.type==="or"?t.expr.every(e=>Rgt(e)):t.type==="const"?!0:(()=>{throw new wgt("Unknown expression type")})()}a(Rgt,"IsTemplateLiteralExpressionFinite");function JMa(t){let e=(0,VMa.TemplateLiteralParseExact)(t.pattern);return Rgt(e)}a(JMa,"IsTemplateLiteralFinite")});var rbr=I(Kge=>{"use strict";p();Object.defineProperty(Kge,"__esModule",{value:!0});Kge.TemplateLiteralGenerateError=void 0;Kge.TemplateLiteralExpressionGenerate=Pgt;Kge.TemplateLiteralGenerate=iOa;var ZMa=tbr(),XMa=xgt(),eOa=Nf(),kgt=class extends eOa.TypeBoxError{static{a(this,"TemplateLiteralGenerateError")}};Kge.TemplateLiteralGenerateError=kgt;function*bwi(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of bwi(t.slice(1)))yield`${e}${r}`}a(bwi,"GenerateReduce");function*tOa(t){return yield*bwi(t.expr.map(e=>[...Pgt(e)]))}a(tOa,"GenerateAnd");function*rOa(t){for(let e of t.expr)yield*Pgt(e)}a(rOa,"GenerateOr");function*nOa(t){return yield t.const}a(nOa,"GenerateConst");function*Pgt(t){return t.type==="and"?yield*tOa(t):t.type==="or"?yield*rOa(t):t.type==="const"?yield*nOa(t):(()=>{throw new kgt("Unknown expression")})()}a(Pgt,"TemplateLiteralExpressionGenerate");function iOa(t){let e=(0,XMa.TemplateLiteralParseExact)(t.pattern);return(0,ZMa.IsTemplateLiteralExpressionFinite)(e)?[...Pgt(e)]:[]}a(iOa,"TemplateLiteralGenerate")});var Swi=I(nbr=>{"use strict";p();Object.defineProperty(nbr,"__esModule",{value:!0});nbr.Literal=aOa;var oOa=Ii(),sOa=Sn();function aOa(t,e){return(0,oOa.CreateType)({[sOa.Kind]:"Literal",const:t,type:typeof t},e)}a(aOa,"Literal")});var UE=I(qte=>{"use strict";p();var cOa=qte&&qte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lOa=qte&&qte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cOa(e,t,r)};Object.defineProperty(qte,"__esModule",{value:!0});lOa(Swi(),qte)});var Twi=I(ibr=>{"use strict";p();Object.defineProperty(ibr,"__esModule",{value:!0});ibr.Boolean=fOa;var uOa=Sn(),dOa=t6();function fOa(t){return(0,dOa.CreateType)({[uOa.Kind]:"Boolean",type:"boolean"},t)}a(fOa,"Boolean")});var O5e=I(jte=>{"use strict";p();var pOa=jte&&jte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hOa=jte&&jte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pOa(e,t,r)};Object.defineProperty(jte,"__esModule",{value:!0});hOa(Twi(),jte)});var Iwi=I(obr=>{"use strict";p();Object.defineProperty(obr,"__esModule",{value:!0});obr.BigInt=AOa;var mOa=Sn(),gOa=t6();function AOa(t){return(0,gOa.CreateType)({[mOa.Kind]:"BigInt",type:"bigint"},t)}a(AOa,"BigInt")});var Jge=I(Hte=>{"use strict";p();var yOa=Hte&&Hte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),EOa=Hte&&Hte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yOa(e,t,r)};Object.defineProperty(Hte,"__esModule",{value:!0});EOa(Iwi(),Hte)});var xwi=I(sbr=>{"use strict";p();Object.defineProperty(sbr,"__esModule",{value:!0});sbr.Number=COa;var _Oa=Ii(),vOa=Sn();function COa(t){return(0,_Oa.CreateType)({[vOa.Kind]:"Number",type:"number"},t)}a(COa,"Number")});var UG=I(Gte=>{"use strict";p();var bOa=Gte&&Gte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SOa=Gte&&Gte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bOa(e,t,r)};Object.defineProperty(Gte,"__esModule",{value:!0});SOa(xwi(),Gte)});var wwi=I(abr=>{"use strict";p();Object.defineProperty(abr,"__esModule",{value:!0});abr.String=xOa;var TOa=Ii(),IOa=Sn();function xOa(t){return(0,TOa.CreateType)({[IOa.Kind]:"String",type:"string"},t)}a(xOa,"String")});var QG=I($te=>{"use strict";p();var wOa=$te&&$te.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ROa=$te&&$te.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wOa(e,t,r)};Object.defineProperty($te,"__esModule",{value:!0});ROa(wwi(),$te)});var ubr=I(lbr=>{"use strict";p();Object.defineProperty(lbr,"__esModule",{value:!0});lbr.TemplateLiteralSyntax=FOa;var L5e=UE(),kOa=O5e(),POa=Jge(),DOa=UG(),NOa=QG(),MOa=Ip(),OOa=Cm();function*LOa(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield(0,kOa.Boolean)():e==="number"?yield(0,DOa.Number)():e==="bigint"?yield(0,POa.BigInt)():e==="string"?yield(0,NOa.String)():yield(()=>{let r=e.split("|").map(n=>(0,L5e.Literal)(n.trim()));return r.length===0?(0,OOa.Never)():r.length===1?r[0]:(0,MOa.UnionEvaluated)(r)})()}a(LOa,"FromUnion");function*BOa(t){if(t[1]!=="{"){let e=(0,L5e.Literal)("$"),r=cbr(t.slice(1));return yield*[e,...r]}for(let e=2;e{"use strict";p();Object.defineProperty(F5e,"__esModule",{value:!0});F5e.TemplateLiteralPatternError=void 0;F5e.TemplateLiteralPattern=jOa;var B5e=P5e(),UOa=Sn(),QOa=Nf(),qG=vs(),Dgt=class extends QOa.TypeBoxError{static{a(this,"TemplateLiteralPatternError")}};F5e.TemplateLiteralPatternError=Dgt;function qOa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(qOa,"Escape");function Rwi(t,e){return(0,qG.IsTemplateLiteral)(t)?t.pattern.slice(1,t.pattern.length-1):(0,qG.IsUnion)(t)?`(${t.anyOf.map(r=>Rwi(r,e)).join("|")})`:(0,qG.IsNumber)(t)?`${e}${B5e.PatternNumber}`:(0,qG.IsInteger)(t)?`${e}${B5e.PatternNumber}`:(0,qG.IsBigInt)(t)?`${e}${B5e.PatternNumber}`:(0,qG.IsString)(t)?`${e}${B5e.PatternString}`:(0,qG.IsLiteral)(t)?`${e}${qOa(t.const.toString())}`:(0,qG.IsBoolean)(t)?`${e}${B5e.PatternBoolean}`:(()=>{throw new Dgt(`Unexpected Kind '${t[UOa.Kind]}'`)})()}a(Rwi,"Visit");function jOa(t){return`^${t.map(e=>Rwi(e,"")).join("")}$`}a(jOa,"TemplateLiteralPattern")});var kwi=I(fbr=>{"use strict";p();Object.defineProperty(fbr,"__esModule",{value:!0});fbr.TemplateLiteralToUnion=VOa;var HOa=Ip(),GOa=UE(),$Oa=rbr();function VOa(t){let r=(0,$Oa.TemplateLiteralGenerate)(t).map(n=>(0,GOa.Literal)(n));return(0,HOa.UnionEvaluated)(r)}a(VOa,"TemplateLiteralToUnion")});var Dwi=I(pbr=>{"use strict";p();Object.defineProperty(pbr,"__esModule",{value:!0});pbr.TemplateLiteral=JOa;var WOa=Ii(),zOa=ubr(),Pwi=dbr(),YOa=Iv(),KOa=Sn();function JOa(t,e){let r=(0,YOa.IsString)(t)?(0,Pwi.TemplateLiteralPattern)((0,zOa.TemplateLiteralSyntax)(t)):(0,Pwi.TemplateLiteralPattern)(t);return(0,WOa.CreateType)({[KOa.Kind]:"TemplateLiteral",type:"string",pattern:r},e)}a(JOa,"TemplateLiteral")});var pD=I(ZT=>{"use strict";p();var ZOa=ZT&&ZT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vte=ZT&&ZT.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZOa(e,t,r)};Object.defineProperty(ZT,"__esModule",{value:!0});Vte(tbr(),ZT);Vte(rbr(),ZT);Vte(ubr(),ZT);Vte(xgt(),ZT);Vte(dbr(),ZT);Vte(kwi(),ZT);Vte(Dwi(),ZT)});var Ngt=I(hbr=>{"use strict";p();Object.defineProperty(hbr,"__esModule",{value:!0});hbr.IndexPropertyKeys=Nwi;var XOa=pD(),U5e=vs();function e5a(t){return(0,XOa.TemplateLiteralGenerate)(t).map(r=>r.toString())}a(e5a,"FromTemplateLiteral");function t5a(t){let e=[];for(let r of t)e.push(...Nwi(r));return e}a(t5a,"FromUnion");function r5a(t){return[t.toString()]}a(r5a,"FromLiteral");function Nwi(t){return[...new Set((0,U5e.IsTemplateLiteral)(t)?e5a(t):(0,U5e.IsUnion)(t)?t5a(t.anyOf):(0,U5e.IsLiteral)(t)?r5a(t.const):(0,U5e.IsNumber)(t)?["[number]"]:(0,U5e.IsInteger)(t)?["[number]"]:[])]}a(Nwi,"IndexPropertyKeys")});var gbr=I(mbr=>{"use strict";p();Object.defineProperty(mbr,"__esModule",{value:!0});mbr.IndexFromMappedResult=c5a;var n5a=bm(),i5a=Ngt(),o5a=hD();function s5a(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=(0,o5a.Index)(t,(0,i5a.IndexPropertyKeys)(e[o]),r);return n}a(s5a,"FromProperties");function a5a(t,e,r){return s5a(t,e.properties,r)}a(a5a,"FromMappedResult");function c5a(t,e,r){let n=a5a(t,e,r);return(0,n5a.MappedResult)(n)}a(c5a,"IndexFromMappedResult")});var Ogt=I(Zge=>{"use strict";p();Object.defineProperty(Zge,"__esModule",{value:!0});Zge.IndexFromPropertyKey=ybr;Zge.IndexFromPropertyKeys=Bwi;Zge.IndexFromComputed=C5a;Zge.Index=b5a;var l5a=Ii(),u5a=Nf(),Owi=BG(),Mgt=Cm(),d5a=XT(),Abr=Ip(),f5a=Ngt(),p5a=Ebr(),h5a=gbr(),Zb=vs();function Lwi(t,e){return t.map(r=>ybr(r,e))}a(Lwi,"FromRest");function m5a(t){return t.filter(e=>!(0,Zb.IsNever)(e))}a(m5a,"FromIntersectRest");function g5a(t,e){return(0,d5a.IntersectEvaluated)(m5a(Lwi(t,e)))}a(g5a,"FromIntersect");function A5a(t){return t.some(e=>(0,Zb.IsNever)(e))?[]:t}a(A5a,"FromUnionRest");function y5a(t,e){return(0,Abr.UnionEvaluated)(A5a(Lwi(t,e)))}a(y5a,"FromUnion");function E5a(t,e){return e in t?t[e]:e==="[number]"?(0,Abr.UnionEvaluated)(t):(0,Mgt.Never)()}a(E5a,"FromTuple");function _5a(t,e){return e==="[number]"?t:(0,Mgt.Never)()}a(_5a,"FromArray");function v5a(t,e){return e in t?t[e]:(0,Mgt.Never)()}a(v5a,"FromProperty");function ybr(t,e){return(0,Zb.IsIntersect)(t)?g5a(t.allOf,e):(0,Zb.IsUnion)(t)?y5a(t.anyOf,e):(0,Zb.IsTuple)(t)?E5a(t.items??[],e):(0,Zb.IsArray)(t)?_5a(t.items,e):(0,Zb.IsObject)(t)?v5a(t.properties,e):(0,Mgt.Never)()}a(ybr,"IndexFromPropertyKey");function Bwi(t,e){return e.map(r=>ybr(t,r))}a(Bwi,"IndexFromPropertyKeys");function Mwi(t,e){return(0,Abr.UnionEvaluated)(Bwi(t,e))}a(Mwi,"FromSchema");function C5a(t,e){return(0,Owi.Computed)("Index",[t,e])}a(C5a,"IndexFromComputed");function b5a(t,e,r){if((0,Zb.IsRef)(t)||(0,Zb.IsRef)(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!(0,Zb.IsSchema)(t)||!(0,Zb.IsSchema)(e))throw new u5a.TypeBoxError(n);return(0,Owi.Computed)("Index",[t,e])}return(0,Zb.IsMappedResult)(e)?(0,h5a.IndexFromMappedResult)(t,e,r):(0,Zb.IsMappedKey)(e)?(0,p5a.IndexFromMappedKey)(t,e,r):(0,l5a.CreateType)((0,Zb.IsSchema)(e)?Mwi(t,(0,f5a.IndexPropertyKeys)(e)):Mwi(t,e),r)}a(b5a,"Index")});var Ebr=I(_br=>{"use strict";p();Object.defineProperty(_br,"__esModule",{value:!0});_br.IndexFromMappedKey=k5a;var S5a=Ogt(),T5a=bm(),I5a=Yb();function x5a(t,e,r){return{[e]:(0,S5a.Index)(t,[e],(0,I5a.Clone)(r))}}a(x5a,"MappedIndexPropertyKey");function w5a(t,e,r){return e.reduce((n,o)=>({...n,...x5a(t,o,r)}),{})}a(w5a,"MappedIndexPropertyKeys");function R5a(t,e,r){return w5a(t,e.keys,r)}a(R5a,"MappedIndexProperties");function k5a(t,e,r){let n=R5a(t,e,r);return(0,T5a.MappedResult)(n)}a(k5a,"IndexFromMappedKey")});var hD=I($4=>{"use strict";p();var P5a=$4&&$4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Lgt=$4&&$4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&P5a(e,t,r)};Object.defineProperty($4,"__esModule",{value:!0});Lgt(Ebr(),$4);Lgt(gbr(),$4);Lgt(Ngt(),$4);Lgt(Ogt(),$4)});var Fwi=I(vbr=>{"use strict";p();Object.defineProperty(vbr,"__esModule",{value:!0});vbr.Iterator=M5a;var D5a=Ii(),N5a=Sn();function M5a(t,e){return(0,D5a.CreateType)({[N5a.Kind]:"Iterator",type:"Iterator",items:t},e)}a(M5a,"Iterator")});var Xge=I(Wte=>{"use strict";p();var O5a=Wte&&Wte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),L5a=Wte&&Wte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&O5a(e,t,r)};Object.defineProperty(Wte,"__esModule",{value:!0});L5a(Fwi(),Wte)});var Qwi=I(Bgt=>{"use strict";p();Object.defineProperty(Bgt,"__esModule",{value:!0});Bgt.Object=void 0;var B5a=Ii(),Uwi=Sn(),F5a=vs();function U5a(t){return globalThis.Object.keys(t).filter(e=>!(0,F5a.IsOptional)(t[e]))}a(U5a,"RequiredArray");function Q5a(t,e){let r=U5a(t),n=r.length>0?{[Uwi.Kind]:"Object",type:"object",required:r,properties:t}:{[Uwi.Kind]:"Object",type:"object",properties:t};return(0,B5a.CreateType)(n,e)}a(Q5a,"_Object");Bgt.Object=Q5a});var xv=I(zte=>{"use strict";p();var q5a=zte&&zte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),j5a=zte&&zte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&q5a(e,t,r)};Object.defineProperty(zte,"__esModule",{value:!0});j5a(Qwi(),zte)});var qwi=I(Cbr=>{"use strict";p();Object.defineProperty(Cbr,"__esModule",{value:!0});Cbr.Promise=$5a;var H5a=Ii(),G5a=Sn();function $5a(t,e){return(0,H5a.CreateType)({[G5a.Kind]:"Promise",type:"Promise",item:t},e)}a($5a,"Promise")});var Q5e=I(Yte=>{"use strict";p();var V5a=Yte&&Yte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),W5a=Yte&&Yte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&V5a(e,t,r)};Object.defineProperty(Yte,"__esModule",{value:!0});W5a(qwi(),Yte)});var Sbr=I(bbr=>{"use strict";p();Object.defineProperty(bbr,"__esModule",{value:!0});bbr.Readonly=e4a;var jwi=Ii(),Hwi=Sn(),z5a=n6(),Y5a=Tbr(),K5a=vs();function J5a(t){return(0,jwi.CreateType)((0,z5a.Discard)(t,[Hwi.ReadonlyKind]))}a(J5a,"RemoveReadonly");function Z5a(t){return(0,jwi.CreateType)({...t,[Hwi.ReadonlyKind]:"Readonly"})}a(Z5a,"AddReadonly");function X5a(t,e){return e===!1?J5a(t):Z5a(t)}a(X5a,"ReadonlyWithFlag");function e4a(t,e){let r=e??!0;return(0,K5a.IsMappedResult)(t)?(0,Y5a.ReadonlyFromMappedResult)(t,r):X5a(t,r)}a(e4a,"Readonly")});var Tbr=I(Ibr=>{"use strict";p();Object.defineProperty(Ibr,"__esModule",{value:!0});Ibr.ReadonlyFromMappedResult=o4a;var t4a=bm(),r4a=Sbr();function n4a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,r4a.Readonly)(t[n],e);return r}a(n4a,"FromProperties");function i4a(t,e){return n4a(t.properties,e)}a(i4a,"FromMappedResult");function o4a(t,e){let r=i4a(t,e);return(0,t4a.MappedResult)(r)}a(o4a,"ReadonlyFromMappedResult")});var HG=I(jG=>{"use strict";p();var s4a=jG&&jG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Gwi=jG&&jG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&s4a(e,t,r)};Object.defineProperty(jG,"__esModule",{value:!0});Gwi(Tbr(),jG);Gwi(Sbr(),jG)});var Vwi=I(xbr=>{"use strict";p();Object.defineProperty(xbr,"__esModule",{value:!0});xbr.Tuple=c4a;var a4a=Ii(),$wi=Sn();function c4a(t,e){return(0,a4a.CreateType)(t.length>0?{[$wi.Kind]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[$wi.Kind]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(c4a,"Tuple")});var s6=I(Kte=>{"use strict";p();var l4a=Kte&&Kte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),u4a=Kte&&Kte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&l4a(e,t,r)};Object.defineProperty(Kte,"__esModule",{value:!0});u4a(Vwi(),Kte)});var Zwi=I(Fgt=>{"use strict";p();Object.defineProperty(Fgt,"__esModule",{value:!0});Fgt.MappedFunctionReturnType=Jwi;Fgt.Mapped=k4a;var wbr=Sn(),Wwi=n6(),d4a=$ge(),f4a=Vge(),p4a=Wge(),h4a=FG(),m4a=hD(),g4a=XT(),A4a=Xge(),zwi=UE(),Ywi=xv(),y4a=G4(),E4a=Q5e(),_4a=HG(),v4a=s6(),C4a=Ip(),b4a=D5e(),S4a=VCr(),wv=vs();function Kwi(t,e){return t in e?wR(t,e[t]):(0,S4a.MappedResult)(e)}a(Kwi,"FromMappedResult");function T4a(t){return{[t]:(0,zwi.Literal)(t)}}a(T4a,"MappedKeyToKnownMappedResultProperties");function I4a(t){let e={};for(let r of t)e[r]=(0,zwi.Literal)(r);return e}a(I4a,"MappedKeyToUnknownMappedResultProperties");function x4a(t,e){return(0,b4a.SetIncludes)(e,t)?T4a(t):I4a(e)}a(x4a,"MappedKeyToMappedResultProperties");function w4a(t,e){let r=x4a(t,e);return Kwi(t,r)}a(w4a,"FromMappedKey");function q5e(t,e){return e.map(r=>wR(t,r))}a(q5e,"FromRest");function R4a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=wR(t,e[n]);return r}a(R4a,"FromProperties");function wR(t,e){let r={...e};return(0,wv.IsOptional)(e)?(0,y4a.Optional)(wR(t,(0,Wwi.Discard)(e,[wbr.OptionalKind]))):(0,wv.IsReadonly)(e)?(0,_4a.Readonly)(wR(t,(0,Wwi.Discard)(e,[wbr.ReadonlyKind]))):(0,wv.IsMappedResult)(e)?Kwi(t,e.properties):(0,wv.IsMappedKey)(e)?w4a(t,e.keys):(0,wv.IsConstructor)(e)?(0,p4a.Constructor)(q5e(t,e.parameters),wR(t,e.returns),r):(0,wv.IsFunction)(e)?(0,h4a.Function)(q5e(t,e.parameters),wR(t,e.returns),r):(0,wv.IsAsyncIterator)(e)?(0,f4a.AsyncIterator)(wR(t,e.items),r):(0,wv.IsIterator)(e)?(0,A4a.Iterator)(wR(t,e.items),r):(0,wv.IsIntersect)(e)?(0,g4a.Intersect)(q5e(t,e.allOf),r):(0,wv.IsUnion)(e)?(0,C4a.Union)(q5e(t,e.anyOf),r):(0,wv.IsTuple)(e)?(0,v4a.Tuple)(q5e(t,e.items??[]),r):(0,wv.IsObject)(e)?(0,Ywi.Object)(R4a(t,e.properties),r):(0,wv.IsArray)(e)?(0,d4a.Array)(wR(t,e.items),r):(0,wv.IsPromise)(e)?(0,E4a.Promise)(wR(t,e.item),r):e}a(wR,"FromSchemaType");function Jwi(t,e){let r={};for(let n of t)r[n]=wR(n,e);return r}a(Jwi,"MappedFunctionReturnType");function k4a(t,e,r){let n=(0,wv.IsSchema)(t)?(0,m4a.IndexPropertyKeys)(t):t,o=e({[wbr.Kind]:"MappedKey",keys:n}),s=Jwi(n,o);return(0,Ywi.Object)(s,r)}a(k4a,"Mapped")});var bm=I(a6=>{"use strict";p();var P4a=a6&&a6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Rbr=a6&&a6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&P4a(e,t,r)};Object.defineProperty(a6,"__esModule",{value:!0});Rbr(fwi(),a6);Rbr(VCr(),a6);Rbr(Zwi(),a6)});var Pbr=I(kbr=>{"use strict";p();Object.defineProperty(kbr,"__esModule",{value:!0});kbr.Optional=F4a;var Xwi=Ii(),eRi=Sn(),D4a=n6(),N4a=Dbr(),M4a=vs();function O4a(t){return(0,Xwi.CreateType)((0,D4a.Discard)(t,[eRi.OptionalKind]))}a(O4a,"RemoveOptional");function L4a(t){return(0,Xwi.CreateType)({...t,[eRi.OptionalKind]:"Optional"})}a(L4a,"AddOptional");function B4a(t,e){return e===!1?O4a(t):L4a(t)}a(B4a,"OptionalWithFlag");function F4a(t,e){let r=e??!0;return(0,M4a.IsMappedResult)(t)?(0,N4a.OptionalFromMappedResult)(t,r):B4a(t,r)}a(F4a,"Optional")});var Dbr=I(Nbr=>{"use strict";p();Object.defineProperty(Nbr,"__esModule",{value:!0});Nbr.OptionalFromMappedResult=H4a;var U4a=bm(),Q4a=Pbr();function q4a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,Q4a.Optional)(t[n],e);return r}a(q4a,"FromProperties");function j4a(t,e){return q4a(t.properties,e)}a(j4a,"FromMappedResult");function H4a(t,e){let r=j4a(t,e);return(0,U4a.MappedResult)(r)}a(H4a,"OptionalFromMappedResult")});var G4=I(GG=>{"use strict";p();var G4a=GG&&GG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),tRi=GG&&GG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&G4a(e,t,r)};Object.defineProperty(GG,"__esModule",{value:!0});tRi(Dbr(),GG);tRi(Pbr(),GG)});var Lbr=I(Obr=>{"use strict";p();Object.defineProperty(Obr,"__esModule",{value:!0});Obr.IntersectCreate=V4a;var $4a=Ii(),rRi=Sn(),Mbr=vs();function V4a(t,e={}){let r=t.every(o=>(0,Mbr.IsObject)(o)),n=(0,Mbr.IsSchema)(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return(0,$4a.CreateType)(e.unevaluatedProperties===!1||(0,Mbr.IsSchema)(e.unevaluatedProperties)||r?{...n,[rRi.Kind]:"Intersect",type:"object",allOf:t}:{...n,[rRi.Kind]:"Intersect",allOf:t},e)}a(V4a,"IntersectCreate")});var oRi=I(Fbr=>{"use strict";p();Object.defineProperty(Fbr,"__esModule",{value:!0});Fbr.IntersectEvaluated=tLa;var W4a=Sn(),z4a=Ii(),Y4a=n6(),K4a=Cm(),J4a=G4(),nRi=Lbr(),Bbr=vs();function Z4a(t){return t.every(e=>(0,Bbr.IsOptional)(e))}a(Z4a,"IsIntersectOptional");function X4a(t){return(0,Y4a.Discard)(t,[W4a.OptionalKind])}a(X4a,"RemoveOptionalFromType");function iRi(t){return t.map(e=>(0,Bbr.IsOptional)(e)?X4a(e):e)}a(iRi,"RemoveOptionalFromRest");function eLa(t,e){return Z4a(t)?(0,J4a.Optional)((0,nRi.IntersectCreate)(iRi(t),e)):(0,nRi.IntersectCreate)(iRi(t),e)}a(eLa,"ResolveIntersect");function tLa(t,e={}){if(t.length===1)return(0,z4a.CreateType)(t[0],e);if(t.length===0)return(0,K4a.Never)(e);if(t.some(r=>(0,Bbr.IsTransform)(r)))throw new Error("Cannot intersect transform types");return eLa(t,e)}a(tLa,"IntersectEvaluated")});var aRi=I(sRi=>{"use strict";p();Object.defineProperty(sRi,"__esModule",{value:!0});var Cxp=Sn()});var cRi=I(Ubr=>{"use strict";p();Object.defineProperty(Ubr,"__esModule",{value:!0});Ubr.Intersect=sLa;var rLa=Ii(),nLa=Cm(),iLa=Lbr(),oLa=vs();function sLa(t,e){if(t.length===1)return(0,rLa.CreateType)(t[0],e);if(t.length===0)return(0,nLa.Never)(e);if(t.some(r=>(0,oLa.IsTransform)(r)))throw new Error("Cannot intersect transform types");return(0,iLa.IntersectCreate)(t,e)}a(sLa,"Intersect")});var XT=I(c6=>{"use strict";p();var aLa=c6&&c6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qbr=c6&&c6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&aLa(e,t,r)};Object.defineProperty(c6,"__esModule",{value:!0});Qbr(oRi(),c6);Qbr(aRi(),c6);Qbr(cRi(),c6)});var lRi=I(qbr=>{"use strict";p();Object.defineProperty(qbr,"__esModule",{value:!0});qbr.Ref=dLa;var cLa=Nf(),lLa=Ii(),uLa=Sn();function dLa(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new cLa.TypeBoxError("Ref: $ref must be a string");return(0,lLa.CreateType)({[uLa.Kind]:"Ref",$ref:e},r)}a(dLa,"Ref")});var $G=I(Jte=>{"use strict";p();var fLa=Jte&&Jte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pLa=Jte&&Jte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fLa(e,t,r)};Object.defineProperty(Jte,"__esModule",{value:!0});pLa(lRi(),Jte)});var dRi=I(Gbr=>{"use strict";p();Object.defineProperty(Gbr,"__esModule",{value:!0});Gbr.Awaited=Hbr;var hLa=Ii(),jbr=BG(),mLa=XT(),gLa=Ip(),ALa=$G(),j5e=vs();function yLa(t,e){return(0,jbr.Computed)("Awaited",[(0,jbr.Computed)(t,e)])}a(yLa,"FromComputed");function ELa(t){return(0,jbr.Computed)("Awaited",[(0,ALa.Ref)(t)])}a(ELa,"FromRef");function _La(t){return(0,mLa.Intersect)(uRi(t))}a(_La,"FromIntersect");function vLa(t){return(0,gLa.Union)(uRi(t))}a(vLa,"FromUnion");function CLa(t){return Hbr(t)}a(CLa,"FromPromise");function uRi(t){return t.map(e=>Hbr(e))}a(uRi,"FromRest");function Hbr(t,e){return(0,hLa.CreateType)((0,j5e.IsComputed)(t)?yLa(t.target,t.parameters):(0,j5e.IsIntersect)(t)?_La(t.allOf):(0,j5e.IsUnion)(t)?vLa(t.anyOf):(0,j5e.IsPromise)(t)?CLa(t.item):(0,j5e.IsRef)(t)?ELa(t.$ref):t,e)}a(Hbr,"Awaited")});var H5e=I(Zte=>{"use strict";p();var bLa=Zte&&Zte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SLa=Zte&&Zte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bLa(e,t,r)};Object.defineProperty(Zte,"__esModule",{value:!0});SLa(dRi(),Zte)});var Qgt=I(Ugt=>{"use strict";p();Object.defineProperty(Ugt,"__esModule",{value:!0});Ugt.KeyOfPropertyKeys=Vbr;Ugt.KeyOfPattern=PLa;var fRi=D5e(),eAe=vs();function pRi(t){let e=[];for(let r of t)e.push(Vbr(r));return e}a(pRi,"FromRest");function TLa(t){let e=pRi(t);return(0,fRi.SetUnionMany)(e)}a(TLa,"FromIntersect");function ILa(t){let e=pRi(t);return(0,fRi.SetIntersectMany)(e)}a(ILa,"FromUnion");function xLa(t){return t.map((e,r)=>r.toString())}a(xLa,"FromTuple");function wLa(t){return["[number]"]}a(wLa,"FromArray");function RLa(t){return globalThis.Object.getOwnPropertyNames(t)}a(RLa,"FromProperties");function kLa(t){return $br?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(kLa,"FromPatternProperties");function Vbr(t){return(0,eAe.IsIntersect)(t)?TLa(t.allOf):(0,eAe.IsUnion)(t)?ILa(t.anyOf):(0,eAe.IsTuple)(t)?xLa(t.items??[]):(0,eAe.IsArray)(t)?wLa(t.items):(0,eAe.IsObject)(t)?RLa(t.properties):(0,eAe.IsRecord)(t)?kLa(t.patternProperties):[]}a(Vbr,"KeyOfPropertyKeys");var $br=!1;function PLa(t){$br=!0;let e=Vbr(t);return $br=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(PLa,"KeyOfPattern")});var Ybr=I(qgt=>{"use strict";p();Object.defineProperty(qgt,"__esModule",{value:!0});qgt.KeyOfPropertyKeysToRest=hRi;qgt.KeyOf=jLa;var DLa=Ii(),NLa=UE(),MLa=UG(),zbr=BG(),OLa=$G(),LLa=Qgt(),BLa=Ip(),FLa=Kbr(),Wbr=vs();function ULa(t,e){return(0,zbr.Computed)("KeyOf",[(0,zbr.Computed)(t,e)])}a(ULa,"FromComputed");function QLa(t){return(0,zbr.Computed)("KeyOf",[(0,OLa.Ref)(t)])}a(QLa,"FromRef");function qLa(t,e){let r=(0,LLa.KeyOfPropertyKeys)(t),n=hRi(r),o=(0,BLa.UnionEvaluated)(n);return(0,DLa.CreateType)(o,e)}a(qLa,"KeyOfFromType");function hRi(t){return t.map(e=>e==="[number]"?(0,MLa.Number)():(0,NLa.Literal)(e))}a(hRi,"KeyOfPropertyKeysToRest");function jLa(t,e){return(0,Wbr.IsComputed)(t)?ULa(t.target,t.parameters):(0,Wbr.IsRef)(t)?QLa(t.$ref):(0,Wbr.IsMappedResult)(t)?(0,FLa.KeyOfFromMappedResult)(t,e):qLa(t,e)}a(jLa,"KeyOf")});var Kbr=I(Jbr=>{"use strict";p();Object.defineProperty(Jbr,"__esModule",{value:!0});Jbr.KeyOfFromMappedResult=zLa;var HLa=bm(),GLa=Ybr(),$La=Yb();function VLa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,GLa.KeyOf)(t[n],(0,$La.Clone)(e));return r}a(VLa,"FromProperties");function WLa(t,e){return VLa(t.properties,e)}a(WLa,"FromMappedResult");function zLa(t,e){let r=WLa(t,e);return(0,HLa.MappedResult)(r)}a(zLa,"KeyOfFromMappedResult")});var mRi=I(Zbr=>{"use strict";p();Object.defineProperty(Zbr,"__esModule",{value:!0});Zbr.KeyOfPropertyEntries=JLa;var YLa=Ogt(),KLa=Qgt();function JLa(t){let e=(0,KLa.KeyOfPropertyKeys)(t),r=(0,YLa.IndexFromPropertyKeys)(t,e);return e.map((n,o)=>[e[o],r[o]])}a(JLa,"KeyOfPropertyEntries")});var mD=I(V4=>{"use strict";p();var ZLa=V4&&V4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jgt=V4&&V4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZLa(e,t,r)};Object.defineProperty(V4,"__esModule",{value:!0});jgt(Kbr(),V4);jgt(mRi(),V4);jgt(Qgt(),V4);jgt(Ybr(),V4)});var gRi=I(Xbr=>{"use strict";p();Object.defineProperty(Xbr,"__esModule",{value:!0});Xbr.Composite=lBa;var XLa=XT(),eBa=hD(),tBa=mD(),rBa=xv(),nBa=D5e(),iBa=vs();function oBa(t){let e=[];for(let r of t)e.push(...(0,tBa.KeyOfPropertyKeys)(r));return(0,nBa.SetDistinct)(e)}a(oBa,"CompositeKeys");function sBa(t){return t.filter(e=>!(0,iBa.IsNever)(e))}a(sBa,"FilterNever");function aBa(t,e){let r=[];for(let n of t)r.push(...(0,eBa.IndexFromPropertyKeys)(n,[e]));return sBa(r)}a(aBa,"CompositeProperty");function cBa(t,e){let r={};for(let n of e)r[n]=(0,XLa.IntersectEvaluated)(aBa(t,n));return r}a(cBa,"CompositeProperties");function lBa(t,e){let r=oBa(t),n=cBa(t,r);return(0,rBa.Object)(n,e)}a(lBa,"Composite")});var Hgt=I(Xte=>{"use strict";p();var uBa=Xte&&Xte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dBa=Xte&&Xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uBa(e,t,r)};Object.defineProperty(Xte,"__esModule",{value:!0});dBa(gRi(),Xte)});var ARi=I(e1r=>{"use strict";p();Object.defineProperty(e1r,"__esModule",{value:!0});e1r.Date=hBa;var fBa=Sn(),pBa=Ii();function hBa(t){return(0,pBa.CreateType)({[fBa.Kind]:"Date",type:"Date"},t)}a(hBa,"Date")});var G5e=I(ere=>{"use strict";p();var mBa=ere&&ere.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gBa=ere&&ere.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mBa(e,t,r)};Object.defineProperty(ere,"__esModule",{value:!0});gBa(ARi(),ere)});var yRi=I(t1r=>{"use strict";p();Object.defineProperty(t1r,"__esModule",{value:!0});t1r.Null=EBa;var ABa=Ii(),yBa=Sn();function EBa(t){return(0,ABa.CreateType)({[yBa.Kind]:"Null",type:"null"},t)}a(EBa,"Null")});var $5e=I(tre=>{"use strict";p();var _Ba=tre&&tre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vBa=tre&&tre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_Ba(e,t,r)};Object.defineProperty(tre,"__esModule",{value:!0});vBa(yRi(),tre)});var ERi=I(r1r=>{"use strict";p();Object.defineProperty(r1r,"__esModule",{value:!0});r1r.Symbol=SBa;var CBa=Ii(),bBa=Sn();function SBa(t){return(0,CBa.CreateType)({[bBa.Kind]:"Symbol",type:"symbol"},t)}a(SBa,"Symbol")});var V5e=I(rre=>{"use strict";p();var TBa=rre&&rre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),IBa=rre&&rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&TBa(e,t,r)};Object.defineProperty(rre,"__esModule",{value:!0});IBa(ERi(),rre)});var _Ri=I(n1r=>{"use strict";p();Object.defineProperty(n1r,"__esModule",{value:!0});n1r.Undefined=RBa;var xBa=Ii(),wBa=Sn();function RBa(t){return(0,xBa.CreateType)({[wBa.Kind]:"Undefined",type:"undefined"},t)}a(RBa,"Undefined")});var W5e=I(nre=>{"use strict";p();var kBa=nre&&nre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),PBa=nre&&nre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kBa(e,t,r)};Object.defineProperty(nre,"__esModule",{value:!0});PBa(_Ri(),nre)});var vRi=I(i1r=>{"use strict";p();Object.defineProperty(i1r,"__esModule",{value:!0});i1r.Uint8Array=MBa;var DBa=Ii(),NBa=Sn();function MBa(t){return(0,DBa.CreateType)({[NBa.Kind]:"Uint8Array",type:"Uint8Array"},t)}a(MBa,"Uint8Array")});var z5e=I(ire=>{"use strict";p();var OBa=ire&&ire.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),LBa=ire&&ire.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&OBa(e,t,r)};Object.defineProperty(ire,"__esModule",{value:!0});LBa(vRi(),ire)});var CRi=I(o1r=>{"use strict";p();Object.defineProperty(o1r,"__esModule",{value:!0});o1r.Unknown=UBa;var BBa=Ii(),FBa=Sn();function UBa(t){return(0,BBa.CreateType)({[FBa.Kind]:"Unknown"},t)}a(UBa,"Unknown")});var VG=I(ore=>{"use strict";p();var QBa=ore&&ore.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qBa=ore&&ore.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&QBa(e,t,r)};Object.defineProperty(ore,"__esModule",{value:!0});qBa(CRi(),ore)});var TRi=I(l1r=>{"use strict";p();Object.defineProperty(l1r,"__esModule",{value:!0});l1r.Const=e3a;var bRi=Gge(),jBa=Jge(),HBa=G5e(),GBa=FG(),s1r=UE(),$Ba=$5e(),SRi=xv(),VBa=V5e(),WBa=s6(),a1r=HG(),zBa=W5e(),YBa=z5e(),KBa=VG(),JBa=t6(),Xb=Iv();function ZBa(t){return t.map(e=>c1r(e,!1))}a(ZBa,"FromArray");function XBa(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=(0,a1r.Readonly)(c1r(t[r],!1));return e}a(XBa,"FromProperties");function Ggt(t,e){return e===!0?t:(0,a1r.Readonly)(t)}a(Ggt,"ConditionalReadonly");function c1r(t,e){return(0,Xb.IsAsyncIterator)(t)||(0,Xb.IsIterator)(t)?Ggt((0,bRi.Any)(),e):(0,Xb.IsArray)(t)?(0,a1r.Readonly)((0,WBa.Tuple)(ZBa(t))):(0,Xb.IsUint8Array)(t)?(0,YBa.Uint8Array)():(0,Xb.IsDate)(t)?(0,HBa.Date)():(0,Xb.IsObject)(t)?Ggt((0,SRi.Object)(XBa(t)),e):(0,Xb.IsFunction)(t)?Ggt((0,GBa.Function)([],(0,KBa.Unknown)()),e):(0,Xb.IsUndefined)(t)?(0,zBa.Undefined)():(0,Xb.IsNull)(t)?(0,$Ba.Null)():(0,Xb.IsSymbol)(t)?(0,VBa.Symbol)():(0,Xb.IsBigInt)(t)?(0,jBa.BigInt)():(0,Xb.IsNumber)(t)||(0,Xb.IsBoolean)(t)||(0,Xb.IsString)(t)?(0,s1r.Literal)(t):(0,SRi.Object)({})}a(c1r,"FromValue");function e3a(t,e){return(0,JBa.CreateType)(c1r(t,!0),e)}a(e3a,"Const")});var $gt=I(sre=>{"use strict";p();var t3a=sre&&sre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),r3a=sre&&sre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&t3a(e,t,r)};Object.defineProperty(sre,"__esModule",{value:!0});r3a(TRi(),sre)});var IRi=I(l6=>{"use strict";p();var n3a=l6&&l6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),i3a=l6&&l6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),o3a=l6&&l6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var u3a=are&&are.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),d3a=are&&are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&u3a(e,t,r)};Object.defineProperty(are,"__esModule",{value:!0});d3a(IRi(),are)});var xRi=I(u1r=>{"use strict";p();Object.defineProperty(u1r,"__esModule",{value:!0});u1r.Enum=g3a;var f3a=UE(),p3a=Sn(),h3a=Ip(),m3a=Iv();function g3a(t,e){if((0,m3a.IsUndefined)(t))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(t).filter(s=>isNaN(s)).map(s=>t[s]),o=[...new Set(r)].map(s=>(0,f3a.Literal)(s));return(0,h3a.Union)(o,{...e,[p3a.Hint]:"Enum"})}a(g3a,"Enum")});var Wgt=I(cre=>{"use strict";p();var A3a=cre&&cre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),y3a=cre&&cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&A3a(e,t,r)};Object.defineProperty(cre,"__esModule",{value:!0});y3a(xRi(),cre)});var y1r=I(lre=>{"use strict";p();Object.defineProperty(lre,"__esModule",{value:!0});lre.ExtendsResult=lre.ExtendsResolverError=void 0;lre.ExtendsCheck=aFa;var wRi=Gge(),E3a=FG(),m1r=UG(),f1r=QG(),_3a=VG(),RRi=pD(),tAe=P5e(),MRi=Sn(),v3a=Nf(),tt=OCr(),zgt=class extends v3a.TypeBoxError{static{a(this,"ExtendsResolverError")}};lre.ExtendsResolverError=zgt;var Lt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(Lt||(lre.ExtendsResult=Lt={}));function RR(t){return t===Lt.False?t:Lt.True}a(RR,"IntoBooleanResult");function rAe(t){throw new zgt(t)}a(rAe,"Throw");function Sm(t){return tt.TypeGuard.IsNever(t)||tt.TypeGuard.IsIntersect(t)||tt.TypeGuard.IsUnion(t)||tt.TypeGuard.IsUnknown(t)||tt.TypeGuard.IsAny(t)}a(Sm,"IsStructuralRight");function Tm(t,e){return tt.TypeGuard.IsNever(e)?BRi(t,e):tt.TypeGuard.IsIntersect(e)?Ygt(t,e):tt.TypeGuard.IsUnion(e)?A1r(t,e):tt.TypeGuard.IsUnknown(e)?qRi(t,e):tt.TypeGuard.IsAny(e)?g1r(t,e):rAe("StructuralRight")}a(Tm,"StructuralRight");function g1r(t,e){return Lt.True}a(g1r,"FromAnyRight");function C3a(t,e){return tt.TypeGuard.IsIntersect(e)?Ygt(t,e):tt.TypeGuard.IsUnion(e)&&e.anyOf.some(r=>tt.TypeGuard.IsAny(r)||tt.TypeGuard.IsUnknown(r))?Lt.True:tt.TypeGuard.IsUnion(e)?Lt.Union:tt.TypeGuard.IsUnknown(e)||tt.TypeGuard.IsAny(e)?Lt.True:Lt.Union}a(C3a,"FromAny");function b3a(t,e){return tt.TypeGuard.IsUnknown(t)?Lt.False:tt.TypeGuard.IsAny(t)?Lt.Union:tt.TypeGuard.IsNever(t)?Lt.True:Lt.False}a(b3a,"FromArrayRight");function S3a(t,e){return tt.TypeGuard.IsObject(e)&&Kgt(e)?Lt.True:Sm(e)?Tm(t,e):tt.TypeGuard.IsArray(e)?RR(hl(t.items,e.items)):Lt.False}a(S3a,"FromArray");function T3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsAsyncIterator(e)?RR(hl(t.items,e.items)):Lt.False}a(T3a,"FromAsyncIterator");function I3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsBigInt(e)?Lt.True:Lt.False}a(I3a,"FromBigInt");function ORi(t,e){return tt.TypeGuard.IsLiteralBoolean(t)||tt.TypeGuard.IsBoolean(t)?Lt.True:Lt.False}a(ORi,"FromBooleanRight");function x3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsBoolean(e)?Lt.True:Lt.False}a(x3a,"FromBoolean");function w3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsConstructor(e)?t.parameters.length>e.parameters.length?Lt.False:t.parameters.every((r,n)=>RR(hl(e.parameters[n],r))===Lt.True)?RR(hl(t.returns,e.returns)):Lt.False:Lt.False}a(w3a,"FromConstructor");function R3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsDate(e)?Lt.True:Lt.False}a(R3a,"FromDate");function k3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsFunction(e)?t.parameters.length>e.parameters.length?Lt.False:t.parameters.every((r,n)=>RR(hl(e.parameters[n],r))===Lt.True)?RR(hl(t.returns,e.returns)):Lt.False:Lt.False}a(k3a,"FromFunction");function LRi(t,e){return tt.TypeGuard.IsLiteral(t)&&tt.ValueGuard.IsNumber(t.const)||tt.TypeGuard.IsNumber(t)||tt.TypeGuard.IsInteger(t)?Lt.True:Lt.False}a(LRi,"FromIntegerRight");function P3a(t,e){return tt.TypeGuard.IsInteger(e)||tt.TypeGuard.IsNumber(e)?Lt.True:Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):Lt.False}a(P3a,"FromInteger");function Ygt(t,e){return e.allOf.every(r=>hl(t,r)===Lt.True)?Lt.True:Lt.False}a(Ygt,"FromIntersectRight");function D3a(t,e){return t.allOf.some(r=>hl(r,e)===Lt.True)?Lt.True:Lt.False}a(D3a,"FromIntersect");function N3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsIterator(e)?RR(hl(t.items,e.items)):Lt.False}a(N3a,"FromIterator");function M3a(t,e){return tt.TypeGuard.IsLiteral(e)&&e.const===t.const?Lt.True:Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsString(e)?QRi(t,e):tt.TypeGuard.IsNumber(e)?FRi(t,e):tt.TypeGuard.IsInteger(e)?LRi(t,e):tt.TypeGuard.IsBoolean(e)?ORi(t,e):Lt.False}a(M3a,"FromLiteral");function BRi(t,e){return Lt.False}a(BRi,"FromNeverRight");function O3a(t,e){return Lt.True}a(O3a,"FromNever");function kRi(t){let[e,r]=[t,0];for(;tt.TypeGuard.IsNot(e);)e=e.not,r+=1;return r%2===0?e:(0,_3a.Unknown)()}a(kRi,"UnwrapTNot");function L3a(t,e){return tt.TypeGuard.IsNot(t)?hl(kRi(t),e):tt.TypeGuard.IsNot(e)?hl(t,kRi(e)):rAe("Invalid fallthrough for Not")}a(L3a,"FromNot");function B3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsNull(e)?Lt.True:Lt.False}a(B3a,"FromNull");function FRi(t,e){return tt.TypeGuard.IsLiteralNumber(t)||tt.TypeGuard.IsNumber(t)||tt.TypeGuard.IsInteger(t)?Lt.True:Lt.False}a(FRi,"FromNumberRight");function F3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsInteger(e)||tt.TypeGuard.IsNumber(e)?Lt.True:Lt.False}a(F3a,"FromNumber");function e1(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(e1,"IsObjectPropertyCount");function PRi(t){return Kgt(t)}a(PRi,"IsObjectStringLike");function DRi(t){return e1(t,0)||e1(t,1)&&"description"in t.properties&&tt.TypeGuard.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(tt.TypeGuard.IsString(t.properties.description.anyOf[0])&&tt.TypeGuard.IsUndefined(t.properties.description.anyOf[1])||tt.TypeGuard.IsString(t.properties.description.anyOf[1])&&tt.TypeGuard.IsUndefined(t.properties.description.anyOf[0]))}a(DRi,"IsObjectSymbolLike");function d1r(t){return e1(t,0)}a(d1r,"IsObjectNumberLike");function NRi(t){return e1(t,0)}a(NRi,"IsObjectBooleanLike");function U3a(t){return e1(t,0)}a(U3a,"IsObjectBigIntLike");function Q3a(t){return e1(t,0)}a(Q3a,"IsObjectDateLike");function q3a(t){return Kgt(t)}a(q3a,"IsObjectUint8ArrayLike");function j3a(t){let e=(0,m1r.Number)();return e1(t,0)||e1(t,1)&&"length"in t.properties&&RR(hl(t.properties.length,e))===Lt.True}a(j3a,"IsObjectFunctionLike");function H3a(t){return e1(t,0)}a(H3a,"IsObjectConstructorLike");function Kgt(t){let e=(0,m1r.Number)();return e1(t,0)||e1(t,1)&&"length"in t.properties&&RR(hl(t.properties.length,e))===Lt.True}a(Kgt,"IsObjectArrayLike");function G3a(t){let e=(0,E3a.Function)([(0,wRi.Any)()],(0,wRi.Any)());return e1(t,0)||e1(t,1)&&"then"in t.properties&&RR(hl(t.properties.then,e))===Lt.True}a(G3a,"IsObjectPromiseLike");function URi(t,e){return hl(t,e)===Lt.False||tt.TypeGuard.IsOptional(t)&&!tt.TypeGuard.IsOptional(e)?Lt.False:Lt.True}a(URi,"Property");function QE(t,e){return tt.TypeGuard.IsUnknown(t)?Lt.False:tt.TypeGuard.IsAny(t)?Lt.Union:tt.TypeGuard.IsNever(t)||tt.TypeGuard.IsLiteralString(t)&&PRi(e)||tt.TypeGuard.IsLiteralNumber(t)&&d1r(e)||tt.TypeGuard.IsLiteralBoolean(t)&&NRi(e)||tt.TypeGuard.IsSymbol(t)&&DRi(e)||tt.TypeGuard.IsBigInt(t)&&U3a(e)||tt.TypeGuard.IsString(t)&&PRi(e)||tt.TypeGuard.IsSymbol(t)&&DRi(e)||tt.TypeGuard.IsNumber(t)&&d1r(e)||tt.TypeGuard.IsInteger(t)&&d1r(e)||tt.TypeGuard.IsBoolean(t)&&NRi(e)||tt.TypeGuard.IsUint8Array(t)&&q3a(e)||tt.TypeGuard.IsDate(t)&&Q3a(e)||tt.TypeGuard.IsConstructor(t)&&H3a(e)||tt.TypeGuard.IsFunction(t)&&j3a(e)?Lt.True:tt.TypeGuard.IsRecord(t)&&tt.TypeGuard.IsString(p1r(t))?e[MRi.Hint]==="Record"?Lt.True:Lt.False:tt.TypeGuard.IsRecord(t)&&tt.TypeGuard.IsNumber(p1r(t))&&e1(e,0)?Lt.True:Lt.False}a(QE,"FromObjectRight");function $3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!tt.TypeGuard.IsOptional(e.properties[r]))return Lt.False;if(tt.TypeGuard.IsOptional(e.properties[r]))return Lt.True;if(URi(t.properties[r],e.properties[r])===Lt.False)return Lt.False}return Lt.True})():Lt.False}a($3a,"FromObject");function V3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)&&G3a(e)?Lt.True:tt.TypeGuard.IsPromise(e)?RR(hl(t.item,e.item)):Lt.False}a(V3a,"FromPromise");function p1r(t){return tAe.PatternNumberExact in t.patternProperties?(0,m1r.Number)():tAe.PatternStringExact in t.patternProperties?(0,f1r.String)():rAe("Unknown record key pattern")}a(p1r,"RecordKey");function h1r(t){return tAe.PatternNumberExact in t.patternProperties?t.patternProperties[tAe.PatternNumberExact]:tAe.PatternStringExact in t.patternProperties?t.patternProperties[tAe.PatternStringExact]:rAe("Unable to get record value schema")}a(h1r,"RecordValue");function kR(t,e){let[r,n]=[p1r(e),h1r(e)];return tt.TypeGuard.IsLiteralString(t)&&tt.TypeGuard.IsNumber(r)&&RR(hl(t,n))===Lt.True?Lt.True:tt.TypeGuard.IsUint8Array(t)&&tt.TypeGuard.IsNumber(r)||tt.TypeGuard.IsString(t)&&tt.TypeGuard.IsNumber(r)||tt.TypeGuard.IsArray(t)&&tt.TypeGuard.IsNumber(r)?hl(t,n):tt.TypeGuard.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(URi(n,t.properties[o])===Lt.False)return Lt.False;return Lt.True})():Lt.False}a(kR,"FromRecordRight");function W3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?hl(h1r(t),h1r(e)):Lt.False}a(W3a,"FromRecord");function z3a(t,e){let r=tt.TypeGuard.IsRegExp(t)?(0,f1r.String)():t,n=tt.TypeGuard.IsRegExp(e)?(0,f1r.String)():e;return hl(r,n)}a(z3a,"FromRegExp");function QRi(t,e){return tt.TypeGuard.IsLiteral(t)&&tt.ValueGuard.IsString(t.const)||tt.TypeGuard.IsString(t)?Lt.True:Lt.False}a(QRi,"FromStringRight");function Y3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsString(e)?Lt.True:Lt.False}a(Y3a,"FromString");function K3a(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsSymbol(e)?Lt.True:Lt.False}a(K3a,"FromSymbol");function J3a(t,e){return tt.TypeGuard.IsTemplateLiteral(t)?hl((0,RRi.TemplateLiteralToUnion)(t),e):tt.TypeGuard.IsTemplateLiteral(e)?hl(t,(0,RRi.TemplateLiteralToUnion)(e)):rAe("Invalid fallthrough for TemplateLiteral")}a(J3a,"FromTemplateLiteral");function Z3a(t,e){return tt.TypeGuard.IsArray(e)&&t.items!==void 0&&t.items.every(r=>hl(r,e.items)===Lt.True)}a(Z3a,"IsArrayOfTuple");function X3a(t,e){return tt.TypeGuard.IsNever(t)?Lt.True:tt.TypeGuard.IsUnknown(t)?Lt.False:tt.TypeGuard.IsAny(t)?Lt.Union:Lt.False}a(X3a,"FromTupleRight");function eFa(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)&&Kgt(e)||tt.TypeGuard.IsArray(e)&&Z3a(t,e)?Lt.True:tt.TypeGuard.IsTuple(e)?tt.ValueGuard.IsUndefined(t.items)&&!tt.ValueGuard.IsUndefined(e.items)||!tt.ValueGuard.IsUndefined(t.items)&&tt.ValueGuard.IsUndefined(e.items)?Lt.False:tt.ValueGuard.IsUndefined(t.items)&&!tt.ValueGuard.IsUndefined(e.items)||t.items.every((r,n)=>hl(r,e.items[n])===Lt.True)?Lt.True:Lt.False:Lt.False}a(eFa,"FromTuple");function tFa(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsUint8Array(e)?Lt.True:Lt.False}a(tFa,"FromUint8Array");function rFa(t,e){return Sm(e)?Tm(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsRecord(e)?kR(t,e):tt.TypeGuard.IsVoid(e)?oFa(t,e):tt.TypeGuard.IsUndefined(e)?Lt.True:Lt.False}a(rFa,"FromUndefined");function A1r(t,e){return e.anyOf.some(r=>hl(t,r)===Lt.True)?Lt.True:Lt.False}a(A1r,"FromUnionRight");function nFa(t,e){return t.anyOf.every(r=>hl(r,e)===Lt.True)?Lt.True:Lt.False}a(nFa,"FromUnion");function qRi(t,e){return Lt.True}a(qRi,"FromUnknownRight");function iFa(t,e){return tt.TypeGuard.IsNever(e)?BRi(t,e):tt.TypeGuard.IsIntersect(e)?Ygt(t,e):tt.TypeGuard.IsUnion(e)?A1r(t,e):tt.TypeGuard.IsAny(e)?g1r(t,e):tt.TypeGuard.IsString(e)?QRi(t,e):tt.TypeGuard.IsNumber(e)?FRi(t,e):tt.TypeGuard.IsInteger(e)?LRi(t,e):tt.TypeGuard.IsBoolean(e)?ORi(t,e):tt.TypeGuard.IsArray(e)?b3a(t,e):tt.TypeGuard.IsTuple(e)?X3a(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsUnknown(e)?Lt.True:Lt.False}a(iFa,"FromUnknown");function oFa(t,e){return tt.TypeGuard.IsUndefined(t)||tt.TypeGuard.IsUndefined(t)?Lt.True:Lt.False}a(oFa,"FromVoidRight");function sFa(t,e){return tt.TypeGuard.IsIntersect(e)?Ygt(t,e):tt.TypeGuard.IsUnion(e)?A1r(t,e):tt.TypeGuard.IsUnknown(e)?qRi(t,e):tt.TypeGuard.IsAny(e)?g1r(t,e):tt.TypeGuard.IsObject(e)?QE(t,e):tt.TypeGuard.IsVoid(e)?Lt.True:Lt.False}a(sFa,"FromVoid");function hl(t,e){return tt.TypeGuard.IsTemplateLiteral(t)||tt.TypeGuard.IsTemplateLiteral(e)?J3a(t,e):tt.TypeGuard.IsRegExp(t)||tt.TypeGuard.IsRegExp(e)?z3a(t,e):tt.TypeGuard.IsNot(t)||tt.TypeGuard.IsNot(e)?L3a(t,e):tt.TypeGuard.IsAny(t)?C3a(t,e):tt.TypeGuard.IsArray(t)?S3a(t,e):tt.TypeGuard.IsBigInt(t)?I3a(t,e):tt.TypeGuard.IsBoolean(t)?x3a(t,e):tt.TypeGuard.IsAsyncIterator(t)?T3a(t,e):tt.TypeGuard.IsConstructor(t)?w3a(t,e):tt.TypeGuard.IsDate(t)?R3a(t,e):tt.TypeGuard.IsFunction(t)?k3a(t,e):tt.TypeGuard.IsInteger(t)?P3a(t,e):tt.TypeGuard.IsIntersect(t)?D3a(t,e):tt.TypeGuard.IsIterator(t)?N3a(t,e):tt.TypeGuard.IsLiteral(t)?M3a(t,e):tt.TypeGuard.IsNever(t)?O3a(t,e):tt.TypeGuard.IsNull(t)?B3a(t,e):tt.TypeGuard.IsNumber(t)?F3a(t,e):tt.TypeGuard.IsObject(t)?$3a(t,e):tt.TypeGuard.IsRecord(t)?W3a(t,e):tt.TypeGuard.IsString(t)?Y3a(t,e):tt.TypeGuard.IsSymbol(t)?K3a(t,e):tt.TypeGuard.IsTuple(t)?eFa(t,e):tt.TypeGuard.IsPromise(t)?V3a(t,e):tt.TypeGuard.IsUint8Array(t)?tFa(t,e):tt.TypeGuard.IsUndefined(t)?rFa(t,e):tt.TypeGuard.IsUnion(t)?nFa(t,e):tt.TypeGuard.IsUnknown(t)?iFa(t,e):tt.TypeGuard.IsVoid(t)?sFa(t,e):rAe(`Unknown left type operand '${t[MRi.Kind]}'`)}a(hl,"Visit");function aFa(t,e){return hl(t,e)}a(aFa,"ExtendsCheck")});var _1r=I(E1r=>{"use strict";p();Object.defineProperty(E1r,"__esModule",{value:!0});E1r.ExtendsFromMappedResult=pFa;var cFa=bm(),lFa=Jgt(),uFa=Yb();function dFa(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=(0,lFa.Extends)(t[c],e,r,n,(0,uFa.Clone)(o));return s}a(dFa,"FromProperties");function fFa(t,e,r,n,o){return dFa(t.properties,e,r,n,o)}a(fFa,"FromMappedResult");function pFa(t,e,r,n,o){let s=fFa(t,e,r,n,o);return(0,cFa.MappedResult)(s)}a(pFa,"ExtendsFromMappedResult")});var Jgt=I(C1r=>{"use strict";p();Object.defineProperty(C1r,"__esModule",{value:!0});C1r.Extends=yFa;var jRi=Ii(),hFa=Ip(),v1r=y1r(),mFa=b1r(),gFa=_1r(),HRi=vs();function AFa(t,e,r,n){let o=(0,v1r.ExtendsCheck)(t,e);return o===v1r.ExtendsResult.Union?(0,hFa.Union)([r,n]):o===v1r.ExtendsResult.True?r:n}a(AFa,"ExtendsResolve");function yFa(t,e,r,n,o){return(0,HRi.IsMappedResult)(t)?(0,gFa.ExtendsFromMappedResult)(t,e,r,n,o):(0,HRi.IsMappedKey)(t)?(0,jRi.CreateType)((0,mFa.ExtendsFromMappedKey)(t,e,r,n,o)):(0,jRi.CreateType)(AFa(t,e,r,n),o)}a(yFa,"Extends")});var b1r=I(S1r=>{"use strict";p();Object.defineProperty(S1r,"__esModule",{value:!0});S1r.ExtendsFromMappedKey=IFa;var EFa=bm(),_Fa=UE(),vFa=Jgt(),CFa=Yb();function bFa(t,e,r,n,o){return{[t]:(0,vFa.Extends)((0,_Fa.Literal)(t),e,r,n,(0,CFa.Clone)(o))}}a(bFa,"FromPropertyKey");function SFa(t,e,r,n,o){return t.reduce((s,c)=>({...s,...bFa(c,e,r,n,o)}),{})}a(SFa,"FromPropertyKeys");function TFa(t,e,r,n,o){return SFa(t.keys,e,r,n,o)}a(TFa,"FromMappedKey");function IFa(t,e,r,n,o){let s=TFa(t,e,r,n,o);return(0,EFa.MappedResult)(s)}a(IFa,"ExtendsFromMappedKey")});var I1r=I(T1r=>{"use strict";p();Object.defineProperty(T1r,"__esModule",{value:!0});T1r.ExtendsUndefinedCheck=Xgt;var Zgt=Sn();function xFa(t){return t.allOf.every(e=>Xgt(e))}a(xFa,"Intersect");function wFa(t){return t.anyOf.some(e=>Xgt(e))}a(wFa,"Union");function RFa(t){return!Xgt(t.not)}a(RFa,"Not");function Xgt(t){return t[Zgt.Kind]==="Intersect"?xFa(t):t[Zgt.Kind]==="Union"?wFa(t):t[Zgt.Kind]==="Not"?RFa(t):t[Zgt.Kind]==="Undefined"}a(Xgt,"ExtendsUndefinedCheck")});var ure=I(gD=>{"use strict";p();var kFa=gD&&gD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Y5e=gD&&gD.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kFa(e,t,r)};Object.defineProperty(gD,"__esModule",{value:!0});Y5e(y1r(),gD);Y5e(b1r(),gD);Y5e(_1r(),gD);Y5e(I1r(),gD);Y5e(Jgt(),gD)});var w1r=I(x1r=>{"use strict";p();Object.defineProperty(x1r,"__esModule",{value:!0});x1r.ExcludeFromTemplateLiteral=NFa;var PFa=eAt(),DFa=pD();function NFa(t,e){return(0,PFa.Exclude)((0,DFa.TemplateLiteralToUnion)(t),e)}a(NFa,"ExcludeFromTemplateLiteral")});var eAt=I(P1r=>{"use strict";p();Object.defineProperty(P1r,"__esModule",{value:!0});P1r.Exclude=UFa;var R1r=Ii(),MFa=Ip(),OFa=Cm(),tAt=ure(),LFa=D1r(),BFa=w1r(),k1r=vs();function FFa(t,e){let r=t.filter(n=>(0,tAt.ExtendsCheck)(n,e)===tAt.ExtendsResult.False);return r.length===1?r[0]:(0,MFa.Union)(r)}a(FFa,"ExcludeRest");function UFa(t,e,r={}){return(0,k1r.IsTemplateLiteral)(t)?(0,R1r.CreateType)((0,BFa.ExcludeFromTemplateLiteral)(t,e),r):(0,k1r.IsMappedResult)(t)?(0,R1r.CreateType)((0,LFa.ExcludeFromMappedResult)(t,e),r):(0,R1r.CreateType)((0,k1r.IsUnion)(t)?FFa(t.anyOf,e):(0,tAt.ExtendsCheck)(t,e)!==tAt.ExtendsResult.False?(0,OFa.Never)():t,r)}a(UFa,"Exclude")});var D1r=I(N1r=>{"use strict";p();Object.defineProperty(N1r,"__esModule",{value:!0});N1r.ExcludeFromMappedResult=GFa;var QFa=bm(),qFa=eAt();function jFa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,qFa.Exclude)(t[n],e);return r}a(jFa,"FromProperties");function HFa(t,e){return jFa(t.properties,e)}a(HFa,"FromMappedResult");function GFa(t,e){let r=HFa(t,e);return(0,QFa.MappedResult)(r)}a(GFa,"ExcludeFromMappedResult")});var rAt=I(u6=>{"use strict";p();var $Fa=u6&&u6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),M1r=u6&&u6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$Fa(e,t,r)};Object.defineProperty(u6,"__esModule",{value:!0});M1r(D1r(),u6);M1r(w1r(),u6);M1r(eAt(),u6)});var L1r=I(O1r=>{"use strict";p();Object.defineProperty(O1r,"__esModule",{value:!0});O1r.ExtractFromTemplateLiteral=zFa;var VFa=nAt(),WFa=pD();function zFa(t,e){return(0,VFa.Extract)((0,WFa.TemplateLiteralToUnion)(t),e)}a(zFa,"ExtractFromTemplateLiteral")});var nAt=I(U1r=>{"use strict";p();Object.defineProperty(U1r,"__esModule",{value:!0});U1r.Extract=e8a;var B1r=Ii(),YFa=Ip(),KFa=Cm(),iAt=ure(),JFa=Q1r(),ZFa=L1r(),F1r=vs();function XFa(t,e){let r=t.filter(n=>(0,iAt.ExtendsCheck)(n,e)!==iAt.ExtendsResult.False);return r.length===1?r[0]:(0,YFa.Union)(r)}a(XFa,"ExtractRest");function e8a(t,e,r){return(0,F1r.IsTemplateLiteral)(t)?(0,B1r.CreateType)((0,ZFa.ExtractFromTemplateLiteral)(t,e),r):(0,F1r.IsMappedResult)(t)?(0,B1r.CreateType)((0,JFa.ExtractFromMappedResult)(t,e),r):(0,B1r.CreateType)((0,F1r.IsUnion)(t)?XFa(t.anyOf,e):(0,iAt.ExtendsCheck)(t,e)!==iAt.ExtendsResult.False?t:(0,KFa.Never)(),r)}a(e8a,"Extract")});var Q1r=I(q1r=>{"use strict";p();Object.defineProperty(q1r,"__esModule",{value:!0});q1r.ExtractFromMappedResult=o8a;var t8a=bm(),r8a=nAt();function n8a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,r8a.Extract)(t[n],e);return r}a(n8a,"FromProperties");function i8a(t,e){return n8a(t.properties,e)}a(i8a,"FromMappedResult");function o8a(t,e){let r=i8a(t,e);return(0,t8a.MappedResult)(r)}a(o8a,"ExtractFromMappedResult")});var oAt=I(d6=>{"use strict";p();var s8a=d6&&d6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),j1r=d6&&d6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&s8a(e,t,r)};Object.defineProperty(d6,"__esModule",{value:!0});j1r(Q1r(),d6);j1r(L1r(),d6);j1r(nAt(),d6)});var GRi=I(f6=>{"use strict";p();var a8a=f6&&f6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),c8a=f6&&f6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),l8a=f6&&f6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var h8a=dre&&dre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),m8a=dre&&dre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&h8a(e,t,r)};Object.defineProperty(dre,"__esModule",{value:!0});m8a(GRi(),dre)});var $Ri=I(H1r=>{"use strict";p();Object.defineProperty(H1r,"__esModule",{value:!0});H1r.ReadonlyOptional=y8a;var g8a=HG(),A8a=G4();function y8a(t){return(0,g8a.Readonly)((0,A8a.Optional)(t))}a(y8a,"ReadonlyOptional")});var K5e=I(fre=>{"use strict";p();var E8a=fre&&fre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_8a=fre&&fre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&E8a(e,t,r)};Object.defineProperty(fre,"__esModule",{value:!0});_8a($Ri(),fre)});var KRi=I(nAe=>{"use strict";p();Object.defineProperty(nAe,"__esModule",{value:!0});nAe.Record=B8a;nAe.RecordPattern=$1r;nAe.RecordKey=F8a;nAe.RecordValue=U8a;var v8a=Ii(),WRi=Sn(),C8a=Cm(),b8a=UG(),zRi=xv(),VRi=QG(),S8a=Ip(),T8a=pD(),pre=P5e(),YRi=hD(),I8a=Iv(),W4=vs();function hre(t,e,r){return(0,v8a.CreateType)({[WRi.Kind]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(hre,"RecordCreateFromPattern");function G1r(t,e,r){let n={};for(let o of t)n[o]=e;return(0,zRi.Object)(n,{...r,[WRi.Hint]:"Record"})}a(G1r,"RecordCreateFromKeys");function x8a(t,e,r){return(0,T8a.IsTemplateLiteralFinite)(t)?G1r((0,YRi.IndexPropertyKeys)(t),e,r):hre(t.pattern,e,r)}a(x8a,"FromTemplateLiteralKey");function w8a(t,e,r){return G1r((0,YRi.IndexPropertyKeys)((0,S8a.Union)(t)),e,r)}a(w8a,"FromUnionKey");function R8a(t,e,r){return G1r([t.toString()],e,r)}a(R8a,"FromLiteralKey");function k8a(t,e,r){return hre(t.source,e,r)}a(k8a,"FromRegExpKey");function P8a(t,e,r){let n=(0,I8a.IsUndefined)(t.pattern)?pre.PatternStringExact:t.pattern;return hre(n,e,r)}a(P8a,"FromStringKey");function D8a(t,e,r){return hre(pre.PatternStringExact,e,r)}a(D8a,"FromAnyKey");function N8a(t,e,r){return hre(pre.PatternNeverExact,e,r)}a(N8a,"FromNeverKey");function M8a(t,e,r){return(0,zRi.Object)({true:e,false:e},r)}a(M8a,"FromBooleanKey");function O8a(t,e,r){return hre(pre.PatternNumberExact,e,r)}a(O8a,"FromIntegerKey");function L8a(t,e,r){return hre(pre.PatternNumberExact,e,r)}a(L8a,"FromNumberKey");function B8a(t,e,r={}){return(0,W4.IsUnion)(t)?w8a(t.anyOf,e,r):(0,W4.IsTemplateLiteral)(t)?x8a(t,e,r):(0,W4.IsLiteral)(t)?R8a(t.const,e,r):(0,W4.IsBoolean)(t)?M8a(t,e,r):(0,W4.IsInteger)(t)?O8a(t,e,r):(0,W4.IsNumber)(t)?L8a(t,e,r):(0,W4.IsRegExp)(t)?k8a(t,e,r):(0,W4.IsString)(t)?P8a(t,e,r):(0,W4.IsAny)(t)?D8a(t,e,r):(0,W4.IsNever)(t)?N8a(t,e,r):(0,C8a.Never)(r)}a(B8a,"Record");function $1r(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a($1r,"RecordPattern");function F8a(t){let e=$1r(t);return e===pre.PatternStringExact?(0,VRi.String)():e===pre.PatternNumberExact?(0,b8a.Number)():(0,VRi.String)({pattern:e})}a(F8a,"RecordKey");function U8a(t){return t.patternProperties[$1r(t)]}a(U8a,"RecordValue")});var iAe=I(mre=>{"use strict";p();var Q8a=mre&&mre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),q8a=mre&&mre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Q8a(e,t,r)};Object.defineProperty(mre,"__esModule",{value:!0});q8a(KRi(),mre)});var ZRi=I(z4=>{"use strict";p();var j8a=z4&&z4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),H8a=z4&&z4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),JRi=z4&&z4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o({...r,[n]:l6a(t,e[n])}),{})}a(u6a,"FromProperties");function oAe(t,e){return e.map(r=>AD(t,r))}a(oAe,"FromTypes");function AD(t,e){return t1.IsConstructor(e)?J8a(t,e):t1.IsFunction(e)?Z8a(t,e):t1.IsIntersect(e)?X8a(t,e):t1.IsUnion(e)?e6a(t,e):t1.IsTuple(e)?t6a(t,e):t1.IsArray(e)?r6a(t,e):t1.IsAsyncIterator(e)?n6a(t,e):t1.IsIterator(e)?i6a(t,e):t1.IsPromise(e)?o6a(t,e):t1.IsObject(e)?s6a(t,e):t1.IsRecord(e)?a6a(t,e):t1.IsArgument(e)?c6a(t,e):e}a(AD,"FromType");function d6a(t,e){return AD(e,(0,G8a.CloneType)(t))}a(d6a,"Instantiate")});var aAt=I(gre=>{"use strict";p();var f6a=gre&&gre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),p6a=gre&&gre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&f6a(e,t,r)};Object.defineProperty(gre,"__esModule",{value:!0});p6a(ZRi(),gre)});var XRi=I(W1r=>{"use strict";p();Object.defineProperty(W1r,"__esModule",{value:!0});W1r.Integer=g6a;var h6a=Ii(),m6a=Sn();function g6a(t){return(0,h6a.CreateType)({[m6a.Kind]:"Integer",type:"integer"},t)}a(g6a,"Integer")});var cAt=I(Are=>{"use strict";p();var A6a=Are&&Are.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),y6a=Are&&Are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&A6a(e,t,r)};Object.defineProperty(Are,"__esModule",{value:!0});y6a(XRi(),Are)});var Y1r=I(z1r=>{"use strict";p();Object.defineProperty(z1r,"__esModule",{value:!0});z1r.IntrinsicFromMappedKey=I6a;var E6a=bm(),_6a=yre(),v6a=UE(),C6a=Yb();function b6a(t,e,r){return{[t]:(0,_6a.Intrinsic)((0,v6a.Literal)(t),e,(0,C6a.Clone)(r))}}a(b6a,"MappedIntrinsicPropertyKey");function S6a(t,e,r){return t.reduce((o,s)=>({...o,...b6a(s,e,r)}),{})}a(S6a,"MappedIntrinsicPropertyKeys");function T6a(t,e,r){return S6a(t.keys,e,r)}a(T6a,"MappedIntrinsicProperties");function I6a(t,e,r){let n=T6a(t,e,r);return(0,E6a.MappedResult)(n)}a(I6a,"IntrinsicFromMappedKey")});var yre=I(K1r=>{"use strict";p();Object.defineProperty(K1r,"__esModule",{value:!0});K1r.Intrinsic=iki;var x6a=Ii(),lAt=pD(),w6a=Y1r(),eki=UE(),tki=Ip(),uAt=vs();function R6a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(R6a,"ApplyUncapitalize");function k6a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(k6a,"ApplyCapitalize");function P6a(t){return t.toUpperCase()}a(P6a,"ApplyUppercase");function D6a(t){return t.toLowerCase()}a(D6a,"ApplyLowercase");function N6a(t,e,r){let n=(0,lAt.TemplateLiteralParseExact)(t.pattern);if(!(0,lAt.IsTemplateLiteralExpressionFinite)(n))return{...t,pattern:rki(t.pattern,e)};let c=[...(0,lAt.TemplateLiteralExpressionGenerate)(n)].map(d=>(0,eki.Literal)(d)),l=nki(c,e),u=(0,tki.Union)(l);return(0,lAt.TemplateLiteral)([u],r)}a(N6a,"FromTemplateLiteral");function rki(t,e){return typeof t=="string"?e==="Uncapitalize"?R6a(t):e==="Capitalize"?k6a(t):e==="Uppercase"?P6a(t):e==="Lowercase"?D6a(t):t:t.toString()}a(rki,"FromLiteralValue");function nki(t,e){return t.map(r=>iki(r,e))}a(nki,"FromRest");function iki(t,e,r={}){return(0,uAt.IsMappedKey)(t)?(0,w6a.IntrinsicFromMappedKey)(t,e,r):(0,uAt.IsTemplateLiteral)(t)?N6a(t,e,r):(0,uAt.IsUnion)(t)?(0,tki.Union)(nki(t.anyOf,e),r):(0,uAt.IsLiteral)(t)?(0,eki.Literal)(rki(t.const,e),r):(0,x6a.CreateType)(t,r)}a(iki,"Intrinsic")});var oki=I(J1r=>{"use strict";p();Object.defineProperty(J1r,"__esModule",{value:!0});J1r.Capitalize=O6a;var M6a=yre();function O6a(t,e={}){return(0,M6a.Intrinsic)(t,"Capitalize",e)}a(O6a,"Capitalize")});var ski=I(Z1r=>{"use strict";p();Object.defineProperty(Z1r,"__esModule",{value:!0});Z1r.Lowercase=B6a;var L6a=yre();function B6a(t,e={}){return(0,L6a.Intrinsic)(t,"Lowercase",e)}a(B6a,"Lowercase")});var aki=I(X1r=>{"use strict";p();Object.defineProperty(X1r,"__esModule",{value:!0});X1r.Uncapitalize=U6a;var F6a=yre();function U6a(t,e={}){return(0,F6a.Intrinsic)(t,"Uncapitalize",e)}a(U6a,"Uncapitalize")});var cki=I(eSr=>{"use strict";p();Object.defineProperty(eSr,"__esModule",{value:!0});eSr.Uppercase=q6a;var Q6a=yre();function q6a(t,e={}){return(0,Q6a.Intrinsic)(t,"Uppercase",e)}a(q6a,"Uppercase")});var dAt=I(PR=>{"use strict";p();var j6a=PR&&PR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sAe=PR&&PR.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&j6a(e,t,r)};Object.defineProperty(PR,"__esModule",{value:!0});sAe(oki(),PR);sAe(Y1r(),PR);sAe(yre(),PR);sAe(ski(),PR);sAe(aki(),PR);sAe(cki(),PR)});var rSr=I(tSr=>{"use strict";p();Object.defineProperty(tSr,"__esModule",{value:!0});tSr.OmitFromMappedResult=z6a;var H6a=bm(),G6a=fAt(),$6a=Yb();function V6a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,G6a.Omit)(t[o],e,(0,$6a.Clone)(r));return n}a(V6a,"FromProperties");function W6a(t,e,r){return V6a(t.properties,e,r)}a(W6a,"FromMappedResult");function z6a(t,e,r){let n=W6a(t,e,r);return(0,H6a.MappedResult)(n)}a(z6a,"OmitFromMappedResult")});var fAt=I(oSr=>{"use strict";p();Object.defineProperty(oSr,"__esModule",{value:!0});oSr.Omit=u9a;var Y6a=Ii(),K6a=Igt(),J6a=x5e(),nSr=BG(),Z6a=UE(),X6a=hD(),e9a=XT(),lki=Ip(),uki=xv(),t9a=sSr(),r9a=rSr(),p6=vs(),n9a=Iv();function i9a(t,e){return t.map(r=>iSr(r,e))}a(i9a,"FromIntersect");function o9a(t,e){return t.map(r=>iSr(r,e))}a(o9a,"FromUnion");function s9a(t,e){let{[e]:r,...n}=t;return n}a(s9a,"FromProperty");function a9a(t,e){return e.reduce((r,n)=>s9a(r,n),t)}a(a9a,"FromProperties");function c9a(t,e,r){let n=(0,K6a.Discard)(t,[J6a.TransformKind,"$id","required","properties"]),o=a9a(r,e);return(0,uki.Object)(o,n)}a(c9a,"FromObject");function l9a(t){let e=t.reduce((r,n)=>(0,p6.IsLiteralValue)(n)?[...r,(0,Z6a.Literal)(n)]:r,[]);return(0,lki.Union)(e)}a(l9a,"UnionFromPropertyKeys");function iSr(t,e){return(0,p6.IsIntersect)(t)?(0,e9a.Intersect)(i9a(t.allOf,e)):(0,p6.IsUnion)(t)?(0,lki.Union)(o9a(t.anyOf,e)):(0,p6.IsObject)(t)?c9a(t,e,t.properties):(0,uki.Object)({})}a(iSr,"OmitResolve");function u9a(t,e,r){let n=(0,n9a.IsArray)(e)?l9a(e):e,o=(0,p6.IsSchema)(e)?(0,X6a.IndexPropertyKeys)(e):e,s=(0,p6.IsRef)(t),c=(0,p6.IsRef)(e);return(0,p6.IsMappedResult)(t)?(0,r9a.OmitFromMappedResult)(t,o,r):(0,p6.IsMappedKey)(e)?(0,t9a.OmitFromMappedKey)(t,e,r):s&&c?(0,nSr.Computed)("Omit",[t,n],r):!s&&c?(0,nSr.Computed)("Omit",[t,n],r):s&&!c?(0,nSr.Computed)("Omit",[t,n],r):(0,Y6a.CreateType)({...iSr(t,o),...r})}a(u9a,"Omit")});var sSr=I(aSr=>{"use strict";p();Object.defineProperty(aSr,"__esModule",{value:!0});aSr.OmitFromMappedKey=A9a;var d9a=bm(),f9a=fAt(),p9a=Yb();function h9a(t,e,r){return{[e]:(0,f9a.Omit)(t,[e],(0,p9a.Clone)(r))}}a(h9a,"FromPropertyKey");function m9a(t,e,r){return e.reduce((n,o)=>({...n,...h9a(t,o,r)}),{})}a(m9a,"FromPropertyKeys");function g9a(t,e,r){return m9a(t,e.keys,r)}a(g9a,"FromMappedKey");function A9a(t,e,r){let n=g9a(t,e,r);return(0,d9a.MappedResult)(n)}a(A9a,"OmitFromMappedKey")});var J5e=I(h6=>{"use strict";p();var y9a=h6&&h6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cSr=h6&&h6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&y9a(e,t,r)};Object.defineProperty(h6,"__esModule",{value:!0});cSr(sSr(),h6);cSr(rSr(),h6);cSr(fAt(),h6)});var uSr=I(lSr=>{"use strict";p();Object.defineProperty(lSr,"__esModule",{value:!0});lSr.PickFromMappedResult=S9a;var E9a=bm(),_9a=pAt(),v9a=Yb();function C9a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,_9a.Pick)(t[o],e,(0,v9a.Clone)(r));return n}a(C9a,"FromProperties");function b9a(t,e,r){return C9a(t.properties,e,r)}a(b9a,"FromMappedResult");function S9a(t,e,r){let n=b9a(t,e,r);return(0,E9a.MappedResult)(n)}a(S9a,"PickFromMappedResult")});var pAt=I(pSr=>{"use strict";p();Object.defineProperty(pSr,"__esModule",{value:!0});pSr.Pick=U9a;var T9a=Ii(),I9a=Igt(),dSr=BG(),x9a=XT(),w9a=UE(),dki=xv(),fki=Ip(),R9a=hD(),k9a=x5e(),m6=vs(),P9a=Iv(),D9a=hSr(),N9a=uSr();function M9a(t,e){return t.map(r=>fSr(r,e))}a(M9a,"FromIntersect");function O9a(t,e){return t.map(r=>fSr(r,e))}a(O9a,"FromUnion");function L9a(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(L9a,"FromProperties");function B9a(t,e,r){let n=(0,I9a.Discard)(t,[k9a.TransformKind,"$id","required","properties"]),o=L9a(r,e);return(0,dki.Object)(o,n)}a(B9a,"FromObject");function F9a(t){let e=t.reduce((r,n)=>(0,m6.IsLiteralValue)(n)?[...r,(0,w9a.Literal)(n)]:r,[]);return(0,fki.Union)(e)}a(F9a,"UnionFromPropertyKeys");function fSr(t,e){return(0,m6.IsIntersect)(t)?(0,x9a.Intersect)(M9a(t.allOf,e)):(0,m6.IsUnion)(t)?(0,fki.Union)(O9a(t.anyOf,e)):(0,m6.IsObject)(t)?B9a(t,e,t.properties):(0,dki.Object)({})}a(fSr,"PickResolve");function U9a(t,e,r){let n=(0,P9a.IsArray)(e)?F9a(e):e,o=(0,m6.IsSchema)(e)?(0,R9a.IndexPropertyKeys)(e):e,s=(0,m6.IsRef)(t),c=(0,m6.IsRef)(e);return(0,m6.IsMappedResult)(t)?(0,N9a.PickFromMappedResult)(t,o,r):(0,m6.IsMappedKey)(e)?(0,D9a.PickFromMappedKey)(t,e,r):s&&c?(0,dSr.Computed)("Pick",[t,n],r):!s&&c?(0,dSr.Computed)("Pick",[t,n],r):s&&!c?(0,dSr.Computed)("Pick",[t,n],r):(0,T9a.CreateType)({...fSr(t,o),...r})}a(U9a,"Pick")});var hSr=I(mSr=>{"use strict";p();Object.defineProperty(mSr,"__esModule",{value:!0});mSr.PickFromMappedKey=V9a;var Q9a=bm(),q9a=pAt(),j9a=Yb();function H9a(t,e,r){return{[e]:(0,q9a.Pick)(t,[e],(0,j9a.Clone)(r))}}a(H9a,"FromPropertyKey");function G9a(t,e,r){return e.reduce((n,o)=>({...n,...H9a(t,o,r)}),{})}a(G9a,"FromPropertyKeys");function $9a(t,e,r){return G9a(t,e.keys,r)}a($9a,"FromMappedKey");function V9a(t,e,r){let n=$9a(t,e,r);return(0,Q9a.MappedResult)(n)}a(V9a,"PickFromMappedKey")});var Z5e=I(g6=>{"use strict";p();var W9a=g6&&g6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gSr=g6&&g6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&W9a(e,t,r)};Object.defineProperty(g6,"__esModule",{value:!0});gSr(hSr(),g6);gSr(uSr(),g6);gSr(pAt(),g6)});var ySr=I(A6=>{"use strict";p();var z9a=A6&&A6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Y9a=A6&&A6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),K9a=A6&&A6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;omki(e))}a(pki,"FromRest");function mki(t){return Rv.IsComputed(t)?oUa(t.target,t.parameters):Rv.IsRef(t)?sUa(t.$ref):Rv.IsIntersect(t)?(0,X9a.Intersect)(pki(t.allOf)):Rv.IsUnion(t)?(0,eUa.Union)(pki(t.anyOf)):Rv.IsObject(t)?cUa(t,t.properties):Rv.IsBigInt(t)||Rv.IsBoolean(t)||Rv.IsInteger(t)||Rv.IsLiteral(t)||Rv.IsNull(t)||Rv.IsNumber(t)||Rv.IsString(t)||Rv.IsSymbol(t)||Rv.IsUndefined(t)?t:(0,hki.Object)({})}a(mki,"PartialResolve");function lUa(t,e){return Rv.IsMappedResult(t)?(0,iUa.PartialFromMappedResult)(t,e):(0,J9a.CreateType)({...mki(t),...e})}a(lUa,"Partial")});var ESr=I(_Sr=>{"use strict";p();Object.defineProperty(_Sr,"__esModule",{value:!0});_Sr.PartialFromMappedResult=mUa;var uUa=bm(),dUa=ySr(),fUa=Yb();function pUa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,dUa.Partial)(t[n],(0,fUa.Clone)(e));return r}a(pUa,"FromProperties");function hUa(t,e){return pUa(t.properties,e)}a(hUa,"FromMappedResult");function mUa(t,e){let r=hUa(t,e);return(0,uUa.MappedResult)(r)}a(mUa,"PartialFromMappedResult")});var X5e=I(WG=>{"use strict";p();var gUa=WG&&WG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gki=WG&&WG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gUa(e,t,r)};Object.defineProperty(WG,"__esModule",{value:!0});gki(ESr(),WG);gki(ySr(),WG)});var CSr=I(y6=>{"use strict";p();var AUa=y6&&y6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yUa=y6&&y6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),EUa=y6&&y6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ovki(e))}a(Aki,"FromRest");function vki(t){return kv.IsComputed(t)?TUa(t.target,t.parameters):kv.IsRef(t)?IUa(t.$ref):kv.IsIntersect(t)?(0,vUa.Intersect)(Aki(t.allOf)):kv.IsUnion(t)?(0,CUa.Union)(Aki(t.anyOf)):kv.IsObject(t)?wUa(t,t.properties):kv.IsBigInt(t)||kv.IsBoolean(t)||kv.IsInteger(t)||kv.IsLiteral(t)||kv.IsNull(t)||kv.IsNumber(t)||kv.IsString(t)||kv.IsSymbol(t)||kv.IsUndefined(t)?t:(0,yki.Object)({})}a(vki,"RequiredResolve");function RUa(t,e){return kv.IsMappedResult(t)?(0,SUa.RequiredFromMappedResult)(t,e):(0,_Ua.CreateType)({...vki(t),...e})}a(RUa,"Required")});var bSr=I(SSr=>{"use strict";p();Object.defineProperty(SSr,"__esModule",{value:!0});SSr.RequiredFromMappedResult=MUa;var kUa=bm(),PUa=CSr();function DUa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,PUa.Required)(t[n],e);return r}a(DUa,"FromProperties");function NUa(t,e){return DUa(t.properties,e)}a(NUa,"FromMappedResult");function MUa(t,e){let r=NUa(t,e);return(0,kUa.MappedResult)(r)}a(MUa,"RequiredFromMappedResult")});var e4e=I(zG=>{"use strict";p();var OUa=zG&&zG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Cki=zG&&zG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&OUa(e,t,r)};Object.defineProperty(zG,"__esModule",{value:!0});Cki(bSr(),zG);Cki(CSr(),zG)});var Iki=I(yD=>{"use strict";p();var LUa=yD&&yD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),BUa=yD&&yD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),FUa=yD&&yD.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;omy.IsRef(r)?ISr(t,r.$ref):n1(t,r))}a(r7a,"DereferenceParameters");function ISr(t,e){return e in t?my.IsRef(t[e])?ISr(t,t[e].$ref):n1(t,t[e]):(0,TSr.Never)()}a(ISr,"Dereference");function n7a(t){return(0,qUa.Awaited)(t[0])}a(n7a,"FromAwaited");function i7a(t){return(0,GUa.Index)(t[0],t[1])}a(i7a,"FromIndex");function o7a(t){return(0,zUa.KeyOf)(t[0])}a(o7a,"FromKeyOf");function s7a(t){return(0,ZUa.Partial)(t[0])}a(s7a,"FromPartial");function a7a(t){return(0,KUa.Omit)(t[0],t[1])}a(a7a,"FromOmit");function c7a(t){return(0,JUa.Pick)(t[0],t[1])}a(c7a,"FromPick");function l7a(t){return(0,XUa.Required)(t[0])}a(l7a,"FromRequired");function u7a(t,e,r){let n=r7a(t,r);return e==="Awaited"?n7a(n):e==="Index"?i7a(n):e==="KeyOf"?o7a(n):e==="Partial"?s7a(n):e==="Omit"?a7a(n):e==="Pick"?c7a(n):e==="Required"?l7a(n):(0,TSr.Never)()}a(u7a,"FromComputed");function d7a(t,e){return(0,QUa.Array)(n1(t,e))}a(d7a,"FromArray");function f7a(t,e){return(0,jUa.AsyncIterator)(n1(t,e))}a(f7a,"FromAsyncIterator");function p7a(t,e,r){return(0,HUa.Constructor)(t4e(t,e),n1(t,r))}a(p7a,"FromConstructor");function h7a(t,e,r){return(0,$Ua.Function)(t4e(t,e),n1(t,r))}a(h7a,"FromFunction");function m7a(t,e){return(0,VUa.Intersect)(t4e(t,e))}a(m7a,"FromIntersect");function g7a(t,e){return(0,WUa.Iterator)(n1(t,e))}a(g7a,"FromIterator");function A7a(t,e){return(0,YUa.Object)(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:n1(t,e[n])}),{}))}a(A7a,"FromObject");function y7a(t,e){let[r,n]=[n1(t,(0,Ski.RecordValue)(e)),(0,Ski.RecordPattern)(e)],o=(0,UUa.CloneType)(e);return o.patternProperties[n]=r,o}a(y7a,"FromRecord");function E7a(t,e){return my.IsRef(e)?{...ISr(t,e.$ref),[hAt.TransformKind]:e[hAt.TransformKind]}:e}a(E7a,"FromTransform");function _7a(t,e){return(0,e7a.Tuple)(t4e(t,e))}a(_7a,"FromTuple");function v7a(t,e){return(0,t7a.Union)(t4e(t,e))}a(v7a,"FromUnion");function t4e(t,e){return e.map(r=>n1(t,r))}a(t4e,"FromTypes");function n1(t,e){return my.IsOptional(e)?(0,r1.CreateType)(n1(t,(0,bki.Discard)(e,[hAt.OptionalKind])),e):my.IsReadonly(e)?(0,r1.CreateType)(n1(t,(0,bki.Discard)(e,[hAt.ReadonlyKind])),e):my.IsTransform(e)?(0,r1.CreateType)(E7a(t,e),e):my.IsArray(e)?(0,r1.CreateType)(d7a(t,e.items),e):my.IsAsyncIterator(e)?(0,r1.CreateType)(f7a(t,e.items),e):my.IsComputed(e)?(0,r1.CreateType)(u7a(t,e.target,e.parameters)):my.IsConstructor(e)?(0,r1.CreateType)(p7a(t,e.parameters,e.returns),e):my.IsFunction(e)?(0,r1.CreateType)(h7a(t,e.parameters,e.returns),e):my.IsIntersect(e)?(0,r1.CreateType)(m7a(t,e.allOf),e):my.IsIterator(e)?(0,r1.CreateType)(g7a(t,e.items),e):my.IsObject(e)?(0,r1.CreateType)(A7a(t,e.properties),e):my.IsRecord(e)?(0,r1.CreateType)(y7a(t,e)):my.IsTuple(e)?(0,r1.CreateType)(_7a(t,e.items||[]),e):my.IsUnion(e)?(0,r1.CreateType)(v7a(t,e.anyOf),e):e}a(n1,"FromType");function Tki(t,e){return e in t?n1(t,t[e]):(0,TSr.Never)()}a(Tki,"ComputeType");function C7a(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:Tki(t,r)}),{})}a(C7a,"ComputeModuleProperties")});var wki=I(r4e=>{"use strict";p();Object.defineProperty(r4e,"__esModule",{value:!0});r4e.TModule=void 0;r4e.Module=T7a;var xki=t6(),b7a=Sn(),S7a=Iki(),mAt=class{static{a(this,"TModule")}constructor(e){let r=(0,S7a.ComputeModuleProperties)(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:(0,xki.CreateType)(this.$defs[e],r)};return(0,xki.CreateType)({[b7a.Kind]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};r4e.TModule=mAt;function T7a(t){return new mAt(t)}a(T7a,"Module")});var gAt=I(Ere=>{"use strict";p();var I7a=Ere&&Ere.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),x7a=Ere&&Ere.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&I7a(e,t,r)};Object.defineProperty(Ere,"__esModule",{value:!0});x7a(wki(),Ere)});var Rki=I(xSr=>{"use strict";p();Object.defineProperty(xSr,"__esModule",{value:!0});xSr.Not=k7a;var w7a=Ii(),R7a=Sn();function k7a(t,e){return(0,w7a.CreateType)({[R7a.Kind]:"Not",not:t},e)}a(k7a,"Not")});var AAt=I(_re=>{"use strict";p();var P7a=_re&&_re.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),D7a=_re&&_re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&P7a(e,t,r)};Object.defineProperty(_re,"__esModule",{value:!0});D7a(Rki(),_re)});var kki=I(E6=>{"use strict";p();var N7a=E6&&E6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),M7a=E6&&E6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),O7a=E6&&E6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var Q7a=vre&&vre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),q7a=vre&&vre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Q7a(e,t,r)};Object.defineProperty(vre,"__esModule",{value:!0});q7a(kki(),vre)});var Dki=I(wSr=>{"use strict";p();Object.defineProperty(wSr,"__esModule",{value:!0});wSr.Recursive=V7a;var j7a=ygt(),H7a=Ii(),G7a=Iv(),Pki=Sn(),$7a=0;function V7a(t,e={}){(0,G7a.IsUndefined)(e.$id)&&(e.$id=`T${$7a++}`);let r=(0,j7a.CloneType)(t({[Pki.Kind]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,(0,H7a.CreateType)({[Pki.Hint]:"Recursive",...r},e)}a(V7a,"Recursive")});var EAt=I(Cre=>{"use strict";p();var W7a=Cre&&Cre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),z7a=Cre&&Cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&W7a(e,t,r)};Object.defineProperty(Cre,"__esModule",{value:!0});z7a(Dki(),Cre)});var Nki=I(RSr=>{"use strict";p();Object.defineProperty(RSr,"__esModule",{value:!0});RSr.RegExp=Z7a;var Y7a=Ii(),K7a=Iv(),J7a=Sn();function Z7a(t,e){let r=(0,K7a.IsString)(t)?new globalThis.RegExp(t):t;return(0,Y7a.CreateType)({[J7a.Kind]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(Z7a,"RegExp")});var _At=I(bre=>{"use strict";p();var X7a=bre&&bre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eQa=bre&&bre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&X7a(e,t,r)};Object.defineProperty(bre,"__esModule",{value:!0});eQa(Nki(),bre)});var Mki=I(PSr=>{"use strict";p();Object.defineProperty(PSr,"__esModule",{value:!0});PSr.Rest=rQa;var kSr=vs();function tQa(t){return(0,kSr.IsIntersect)(t)?t.allOf:(0,kSr.IsUnion)(t)?t.anyOf:(0,kSr.IsTuple)(t)?t.items??[]:[]}a(tQa,"RestResolve");function rQa(t){return tQa(t)}a(rQa,"Rest")});var vAt=I(Sre=>{"use strict";p();var nQa=Sre&&Sre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),iQa=Sre&&Sre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nQa(e,t,r)};Object.defineProperty(Sre,"__esModule",{value:!0});iQa(Mki(),Sre)});var Oki=I(_6=>{"use strict";p();var oQa=_6&&_6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sQa=_6&&_6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),aQa=_6&&_6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var fQa=Tre&&Tre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pQa=Tre&&Tre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fQa(e,t,r)};Object.defineProperty(Tre,"__esModule",{value:!0});pQa(Oki(),Tre)});var Bki=I(Lki=>{"use strict";p();Object.defineProperty(Lki,"__esModule",{value:!0})});var Uki=I(Fki=>{"use strict";p();Object.defineProperty(Fki,"__esModule",{value:!0});var k2p=Sn()});var qki=I(YG=>{"use strict";p();var hQa=YG&&YG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qki=YG&&YG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hQa(e,t,r)};Object.defineProperty(YG,"__esModule",{value:!0});Qki(Bki(),YG);Qki(Uki(),YG)});var Hki=I(jki=>{"use strict";p();Object.defineProperty(jki,"__esModule",{value:!0})});var Gki=I(Ire=>{"use strict";p();var mQa=Ire&&Ire.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gQa=Ire&&Ire.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mQa(e,t,r)};Object.defineProperty(Ire,"__esModule",{value:!0});gQa(Hki(),Ire)});var $ki=I(xre=>{"use strict";p();Object.defineProperty(xre,"__esModule",{value:!0});xre.TransformEncodeBuilder=xre.TransformDecodeBuilder=void 0;xre.Transform=yQa;var bAt=Sn(),AQa=vs(),SAt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new TAt(this.schema,e)}};xre.TransformDecodeBuilder=SAt;var TAt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[bAt.TransformKind].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[bAt.TransformKind].Decode(c)),"Decode")};return{...r,[bAt.TransformKind]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[bAt.TransformKind]:n}}Encode(e){return(0,AQa.IsTransform)(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};xre.TransformEncodeBuilder=TAt;function yQa(t){return new SAt(t)}a(yQa,"Transform")});var IAt=I(wre=>{"use strict";p();var EQa=wre&&wre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_Qa=wre&&wre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EQa(e,t,r)};Object.defineProperty(wre,"__esModule",{value:!0});_Qa($ki(),wre)});var Wki=I(DSr=>{"use strict";p();Object.defineProperty(DSr,"__esModule",{value:!0});DSr.Unsafe=CQa;var vQa=Ii(),Vki=Sn();function CQa(t={}){return(0,vQa.CreateType)({[Vki.Kind]:t[Vki.Kind]??"Unsafe"},t)}a(CQa,"Unsafe")});var n4e=I(Rre=>{"use strict";p();var bQa=Rre&&Rre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SQa=Rre&&Rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bQa(e,t,r)};Object.defineProperty(Rre,"__esModule",{value:!0});SQa(Wki(),Rre)});var zki=I(NSr=>{"use strict";p();Object.defineProperty(NSr,"__esModule",{value:!0});NSr.Void=xQa;var TQa=Ii(),IQa=Sn();function xQa(t){return(0,TQa.CreateType)({[IQa.Kind]:"Void",type:"void"},t)}a(xQa,"Void")});var xAt=I(kre=>{"use strict";p();var wQa=kre&&kre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),RQa=kre&&kre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wQa(e,t,r)};Object.defineProperty(kre,"__esModule",{value:!0});RQa(zki(),kre)});var OSr=I(RAt=>{"use strict";p();Object.defineProperty(RAt,"__esModule",{value:!0});RAt.JsonTypeBuilder=void 0;var kQa=Gge(),PQa=$ge(),DQa=O5e(),NQa=Hgt(),MQa=$gt(),OQa=Wgt(),LQa=rAt(),BQa=ure(),FQa=oAt(),UQa=hD(),QQa=cAt(),qQa=XT(),wAt=dAt(),jQa=mD(),HQa=UE(),GQa=bm(),$Qa=Cm(),VQa=AAt(),WQa=$5e(),zQa=gAt(),YQa=UG(),KQa=xv(),JQa=J5e(),ZQa=G4(),XQa=X5e(),eqa=Z5e(),tqa=HG(),rqa=K5e(),nqa=iAe(),iqa=EAt(),oqa=$G(),sqa=e4e(),aqa=vAt(),cqa=QG(),lqa=pD(),uqa=IAt(),dqa=s6(),fqa=Ip(),pqa=VG(),hqa=n4e(),MSr=class{static{a(this,"JsonTypeBuilder")}ReadonlyOptional(e){return(0,rqa.ReadonlyOptional)(e)}Readonly(e,r){return(0,tqa.Readonly)(e,r??!0)}Optional(e,r){return(0,ZQa.Optional)(e,r??!0)}Any(e){return(0,kQa.Any)(e)}Array(e,r){return(0,PQa.Array)(e,r)}Boolean(e){return(0,DQa.Boolean)(e)}Capitalize(e,r){return(0,wAt.Capitalize)(e,r)}Composite(e,r){return(0,NQa.Composite)(e,r)}Const(e,r){return(0,MQa.Const)(e,r)}Enum(e,r){return(0,OQa.Enum)(e,r)}Exclude(e,r,n){return(0,LQa.Exclude)(e,r,n)}Extends(e,r,n,o,s){return(0,BQa.Extends)(e,r,n,o,s)}Extract(e,r,n){return(0,FQa.Extract)(e,r,n)}Index(e,r,n){return(0,UQa.Index)(e,r,n)}Integer(e){return(0,QQa.Integer)(e)}Intersect(e,r){return(0,qQa.Intersect)(e,r)}KeyOf(e,r){return(0,jQa.KeyOf)(e,r)}Literal(e,r){return(0,HQa.Literal)(e,r)}Lowercase(e,r){return(0,wAt.Lowercase)(e,r)}Mapped(e,r,n){return(0,GQa.Mapped)(e,r,n)}Module(e){return(0,zQa.Module)(e)}Never(e){return(0,$Qa.Never)(e)}Not(e,r){return(0,VQa.Not)(e,r)}Null(e){return(0,WQa.Null)(e)}Number(e){return(0,YQa.Number)(e)}Object(e,r){return(0,KQa.Object)(e,r)}Omit(e,r,n){return(0,JQa.Omit)(e,r,n)}Partial(e,r){return(0,XQa.Partial)(e,r)}Pick(e,r,n){return(0,eqa.Pick)(e,r,n)}Record(e,r,n){return(0,nqa.Record)(e,r,n)}Recursive(e,r){return(0,iqa.Recursive)(e,r)}Ref(...e){return(0,oqa.Ref)(e[0],e[1])}Required(e,r){return(0,sqa.Required)(e,r)}Rest(e){return(0,aqa.Rest)(e)}String(e){return(0,cqa.String)(e)}TemplateLiteral(e,r){return(0,lqa.TemplateLiteral)(e,r)}Transform(e){return(0,uqa.Transform)(e)}Tuple(e,r){return(0,dqa.Tuple)(e,r)}Uncapitalize(e,r){return(0,wAt.Uncapitalize)(e,r)}Union(e,r){return(0,fqa.Union)(e,r)}Unknown(e){return(0,pqa.Unknown)(e)}Unsafe(e){return(0,hqa.Unsafe)(e)}Uppercase(e,r){return(0,wAt.Uppercase)(e,r)}};RAt.JsonTypeBuilder=MSr});var Yki=I(Ot=>{"use strict";p();Object.defineProperty(Ot,"__esModule",{value:!0});Ot.Rest=Ot.Required=Ot.RegExp=Ot.Ref=Ot.Recursive=Ot.Record=Ot.ReadonlyOptional=Ot.Readonly=Ot.Promise=Ot.Pick=Ot.Partial=Ot.Parameters=Ot.Optional=Ot.Omit=Ot.Object=Ot.Number=Ot.Null=Ot.Not=Ot.Never=Ot.Module=Ot.Mapped=Ot.Literal=Ot.KeyOf=Ot.Iterator=Ot.Uppercase=Ot.Lowercase=Ot.Uncapitalize=Ot.Capitalize=Ot.Intersect=Ot.Integer=Ot.Instantiate=Ot.InstanceType=Ot.Index=Ot.Function=Ot.Extract=Ot.Extends=Ot.Exclude=Ot.Enum=Ot.Date=Ot.ConstructorParameters=Ot.Constructor=Ot.Const=Ot.Composite=Ot.Boolean=Ot.BigInt=Ot.Awaited=Ot.AsyncIterator=Ot.Array=Ot.Argument=Ot.Any=void 0;Ot.Void=Ot.Unsafe=Ot.Unknown=Ot.Union=Ot.Undefined=Ot.Uint8Array=Ot.Tuple=Ot.Transform=Ot.TemplateLiteral=Ot.Symbol=Ot.String=Ot.ReturnType=void 0;var mqa=Gge();Object.defineProperty(Ot,"Any",{enumerable:!0,get:a(function(){return mqa.Any},"get")});var gqa=Tgt();Object.defineProperty(Ot,"Argument",{enumerable:!0,get:a(function(){return gqa.Argument},"get")});var Aqa=$ge();Object.defineProperty(Ot,"Array",{enumerable:!0,get:a(function(){return Aqa.Array},"get")});var yqa=Vge();Object.defineProperty(Ot,"AsyncIterator",{enumerable:!0,get:a(function(){return yqa.AsyncIterator},"get")});var Eqa=H5e();Object.defineProperty(Ot,"Awaited",{enumerable:!0,get:a(function(){return Eqa.Awaited},"get")});var _qa=Jge();Object.defineProperty(Ot,"BigInt",{enumerable:!0,get:a(function(){return _qa.BigInt},"get")});var vqa=O5e();Object.defineProperty(Ot,"Boolean",{enumerable:!0,get:a(function(){return vqa.Boolean},"get")});var Cqa=Hgt();Object.defineProperty(Ot,"Composite",{enumerable:!0,get:a(function(){return Cqa.Composite},"get")});var bqa=$gt();Object.defineProperty(Ot,"Const",{enumerable:!0,get:a(function(){return bqa.Const},"get")});var Sqa=Wge();Object.defineProperty(Ot,"Constructor",{enumerable:!0,get:a(function(){return Sqa.Constructor},"get")});var Tqa=Vgt();Object.defineProperty(Ot,"ConstructorParameters",{enumerable:!0,get:a(function(){return Tqa.ConstructorParameters},"get")});var Iqa=G5e();Object.defineProperty(Ot,"Date",{enumerable:!0,get:a(function(){return Iqa.Date},"get")});var xqa=Wgt();Object.defineProperty(Ot,"Enum",{enumerable:!0,get:a(function(){return xqa.Enum},"get")});var wqa=rAt();Object.defineProperty(Ot,"Exclude",{enumerable:!0,get:a(function(){return wqa.Exclude},"get")});var Rqa=ure();Object.defineProperty(Ot,"Extends",{enumerable:!0,get:a(function(){return Rqa.Extends},"get")});var kqa=oAt();Object.defineProperty(Ot,"Extract",{enumerable:!0,get:a(function(){return kqa.Extract},"get")});var Pqa=FG();Object.defineProperty(Ot,"Function",{enumerable:!0,get:a(function(){return Pqa.Function},"get")});var Dqa=hD();Object.defineProperty(Ot,"Index",{enumerable:!0,get:a(function(){return Dqa.Index},"get")});var Nqa=sAt();Object.defineProperty(Ot,"InstanceType",{enumerable:!0,get:a(function(){return Nqa.InstanceType},"get")});var Mqa=aAt();Object.defineProperty(Ot,"Instantiate",{enumerable:!0,get:a(function(){return Mqa.Instantiate},"get")});var Oqa=cAt();Object.defineProperty(Ot,"Integer",{enumerable:!0,get:a(function(){return Oqa.Integer},"get")});var Lqa=XT();Object.defineProperty(Ot,"Intersect",{enumerable:!0,get:a(function(){return Lqa.Intersect},"get")});var kAt=dAt();Object.defineProperty(Ot,"Capitalize",{enumerable:!0,get:a(function(){return kAt.Capitalize},"get")});Object.defineProperty(Ot,"Uncapitalize",{enumerable:!0,get:a(function(){return kAt.Uncapitalize},"get")});Object.defineProperty(Ot,"Lowercase",{enumerable:!0,get:a(function(){return kAt.Lowercase},"get")});Object.defineProperty(Ot,"Uppercase",{enumerable:!0,get:a(function(){return kAt.Uppercase},"get")});var Bqa=Xge();Object.defineProperty(Ot,"Iterator",{enumerable:!0,get:a(function(){return Bqa.Iterator},"get")});var Fqa=mD();Object.defineProperty(Ot,"KeyOf",{enumerable:!0,get:a(function(){return Fqa.KeyOf},"get")});var Uqa=UE();Object.defineProperty(Ot,"Literal",{enumerable:!0,get:a(function(){return Uqa.Literal},"get")});var Qqa=bm();Object.defineProperty(Ot,"Mapped",{enumerable:!0,get:a(function(){return Qqa.Mapped},"get")});var qqa=gAt();Object.defineProperty(Ot,"Module",{enumerable:!0,get:a(function(){return qqa.Module},"get")});var jqa=Cm();Object.defineProperty(Ot,"Never",{enumerable:!0,get:a(function(){return jqa.Never},"get")});var Hqa=AAt();Object.defineProperty(Ot,"Not",{enumerable:!0,get:a(function(){return Hqa.Not},"get")});var Gqa=$5e();Object.defineProperty(Ot,"Null",{enumerable:!0,get:a(function(){return Gqa.Null},"get")});var $qa=UG();Object.defineProperty(Ot,"Number",{enumerable:!0,get:a(function(){return $qa.Number},"get")});var Vqa=xv();Object.defineProperty(Ot,"Object",{enumerable:!0,get:a(function(){return Vqa.Object},"get")});var Wqa=J5e();Object.defineProperty(Ot,"Omit",{enumerable:!0,get:a(function(){return Wqa.Omit},"get")});var zqa=G4();Object.defineProperty(Ot,"Optional",{enumerable:!0,get:a(function(){return zqa.Optional},"get")});var Yqa=yAt();Object.defineProperty(Ot,"Parameters",{enumerable:!0,get:a(function(){return Yqa.Parameters},"get")});var Kqa=X5e();Object.defineProperty(Ot,"Partial",{enumerable:!0,get:a(function(){return Kqa.Partial},"get")});var Jqa=Z5e();Object.defineProperty(Ot,"Pick",{enumerable:!0,get:a(function(){return Jqa.Pick},"get")});var Zqa=Q5e();Object.defineProperty(Ot,"Promise",{enumerable:!0,get:a(function(){return Zqa.Promise},"get")});var Xqa=HG();Object.defineProperty(Ot,"Readonly",{enumerable:!0,get:a(function(){return Xqa.Readonly},"get")});var eja=K5e();Object.defineProperty(Ot,"ReadonlyOptional",{enumerable:!0,get:a(function(){return eja.ReadonlyOptional},"get")});var tja=iAe();Object.defineProperty(Ot,"Record",{enumerable:!0,get:a(function(){return tja.Record},"get")});var rja=EAt();Object.defineProperty(Ot,"Recursive",{enumerable:!0,get:a(function(){return rja.Recursive},"get")});var nja=$G();Object.defineProperty(Ot,"Ref",{enumerable:!0,get:a(function(){return nja.Ref},"get")});var ija=_At();Object.defineProperty(Ot,"RegExp",{enumerable:!0,get:a(function(){return ija.RegExp},"get")});var oja=e4e();Object.defineProperty(Ot,"Required",{enumerable:!0,get:a(function(){return oja.Required},"get")});var sja=vAt();Object.defineProperty(Ot,"Rest",{enumerable:!0,get:a(function(){return sja.Rest},"get")});var aja=CAt();Object.defineProperty(Ot,"ReturnType",{enumerable:!0,get:a(function(){return aja.ReturnType},"get")});var cja=QG();Object.defineProperty(Ot,"String",{enumerable:!0,get:a(function(){return cja.String},"get")});var lja=V5e();Object.defineProperty(Ot,"Symbol",{enumerable:!0,get:a(function(){return lja.Symbol},"get")});var uja=pD();Object.defineProperty(Ot,"TemplateLiteral",{enumerable:!0,get:a(function(){return uja.TemplateLiteral},"get")});var dja=IAt();Object.defineProperty(Ot,"Transform",{enumerable:!0,get:a(function(){return dja.Transform},"get")});var fja=s6();Object.defineProperty(Ot,"Tuple",{enumerable:!0,get:a(function(){return fja.Tuple},"get")});var pja=z5e();Object.defineProperty(Ot,"Uint8Array",{enumerable:!0,get:a(function(){return pja.Uint8Array},"get")});var hja=W5e();Object.defineProperty(Ot,"Undefined",{enumerable:!0,get:a(function(){return hja.Undefined},"get")});var mja=Ip();Object.defineProperty(Ot,"Union",{enumerable:!0,get:a(function(){return mja.Union},"get")});var gja=VG();Object.defineProperty(Ot,"Unknown",{enumerable:!0,get:a(function(){return gja.Unknown},"get")});var Aja=n4e();Object.defineProperty(Ot,"Unsafe",{enumerable:!0,get:a(function(){return Aja.Unsafe},"get")});var yja=xAt();Object.defineProperty(Ot,"Void",{enumerable:!0,get:a(function(){return yja.Void},"get")})});var Kki=I(PAt=>{"use strict";p();Object.defineProperty(PAt,"__esModule",{value:!0});PAt.JavaScriptTypeBuilder=void 0;var Eja=OSr(),_ja=Tgt(),vja=Vge(),Cja=H5e(),bja=Jge(),Sja=Wge(),Tja=Vgt(),Ija=G5e(),xja=FG(),wja=sAt(),Rja=aAt(),kja=Xge(),Pja=yAt(),Dja=Q5e(),Nja=_At(),Mja=CAt(),Oja=V5e(),Lja=z5e(),Bja=W5e(),Fja=xAt(),LSr=class extends Eja.JsonTypeBuilder{static{a(this,"JavaScriptTypeBuilder")}Argument(e){return(0,_ja.Argument)(e)}AsyncIterator(e,r){return(0,vja.AsyncIterator)(e,r)}Awaited(e,r){return(0,Cja.Awaited)(e,r)}BigInt(e){return(0,bja.BigInt)(e)}ConstructorParameters(e,r){return(0,Tja.ConstructorParameters)(e,r)}Constructor(e,r,n){return(0,Sja.Constructor)(e,r,n)}Date(e={}){return(0,Ija.Date)(e)}Function(e,r,n){return(0,xja.Function)(e,r,n)}InstanceType(e,r){return(0,wja.InstanceType)(e,r)}Instantiate(e,r){return(0,Rja.Instantiate)(e,r)}Iterator(e,r){return(0,kja.Iterator)(e,r)}Parameters(e,r){return(0,Pja.Parameters)(e,r)}Promise(e,r){return(0,Dja.Promise)(e,r)}RegExp(e,r){return(0,Nja.RegExp)(e,r)}ReturnType(e,r){return(0,Mja.ReturnType)(e,r)}Symbol(e){return(0,Oja.Symbol)(e)}Undefined(e){return(0,Bja.Undefined)(e)}Uint8Array(e){return(0,Lja.Uint8Array)(e)}Void(e){return(0,Fja.Void)(e)}};PAt.JavaScriptTypeBuilder=LSr});var Jki=I(i1=>{"use strict";p();var Uja=i1&&i1.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qja=i1&&i1.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),qja=i1&&i1.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var Vja=en&&en.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yn=en&&en.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Vja(e,t,r)};Object.defineProperty(en,"__esModule",{value:!0});yn(ICr(),en);yn(t6(),en);yn(Nf(),en);yn(OCr(),en);yn(Zxi(),en);yn(P5e(),en);yn(Hge(),en);yn(D5e(),en);yn(Sn(),en);yn(Gge(),en);yn($ge(),en);yn(Tgt(),en);yn(Vge(),en);yn(H5e(),en);yn(Jge(),en);yn(O5e(),en);yn(Hgt(),en);yn($gt(),en);yn(Wge(),en);yn(Vgt(),en);yn(G5e(),en);yn(Wgt(),en);yn(rAt(),en);yn(ure(),en);yn(oAt(),en);yn(FG(),en);yn(hD(),en);yn(sAt(),en);yn(aAt(),en);yn(cAt(),en);yn(XT(),en);yn(Xge(),en);yn(dAt(),en);yn(mD(),en);yn(UE(),en);yn(gAt(),en);yn(bm(),en);yn(Cm(),en);yn(AAt(),en);yn($5e(),en);yn(UG(),en);yn(xv(),en);yn(J5e(),en);yn(G4(),en);yn(yAt(),en);yn(X5e(),en);yn(Z5e(),en);yn(Q5e(),en);yn(HG(),en);yn(K5e(),en);yn(iAe(),en);yn(EAt(),en);yn($G(),en);yn(_At(),en);yn(e4e(),en);yn(vAt(),en);yn(CAt(),en);yn(qki(),en);yn(Gki(),en);yn(QG(),en);yn(V5e(),en);yn(pD(),en);yn(IAt(),en);yn(s6(),en);yn(z5e(),en);yn(W5e(),en);yn(Ip(),en);yn(VG(),en);yn(n4e(),en);yn(xAt(),en);yn(Jki(),en)});var Xki=I(DR=>{"use strict";p();var Wja=DR&&DR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zja=DR&&DR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Yja=DR&&DR.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var Jja=Y4&&Y4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Zja=Y4&&Y4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Xja=Y4&&Y4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(NAt,"__esModule",{value:!0});NAt.ContextItemOrigin=void 0;var rPi;(function(t){function e(r){return r==="request"||r==="update"}a(e,"is"),t.is=e})(rPi||(NAt.ContextItemOrigin=rPi={}))});var oPi=I(Nu=>{"use strict";p();Object.defineProperty(Nu,"__esModule",{value:!0});Nu.RangeSchema=Nu.WorkspaceFolder=Nu.VersionedTextDocumentIdentifier=Nu.TextEdit=Nu.TextDocumentItem=Nu.Range=Nu.Position=Nu.DocumentUri=Nu.Disposable=Nu.Command=Nu.CancellationTokenSource=Nu.CancellationToken=void 0;var MAt=DAt(),ED=ri();Object.defineProperty(Nu,"CancellationToken",{enumerable:!0,get:a(function(){return ED.CancellationToken},"get")});Object.defineProperty(Nu,"CancellationTokenSource",{enumerable:!0,get:a(function(){return ED.CancellationTokenSource},"get")});Object.defineProperty(Nu,"Command",{enumerable:!0,get:a(function(){return ED.Command},"get")});Object.defineProperty(Nu,"Disposable",{enumerable:!0,get:a(function(){return ED.Disposable},"get")});Object.defineProperty(Nu,"DocumentUri",{enumerable:!0,get:a(function(){return ED.DocumentUri},"get")});Object.defineProperty(Nu,"Position",{enumerable:!0,get:a(function(){return ED.Position},"get")});Object.defineProperty(Nu,"Range",{enumerable:!0,get:a(function(){return ED.Range},"get")});Object.defineProperty(Nu,"TextDocumentItem",{enumerable:!0,get:a(function(){return ED.TextDocumentItem},"get")});Object.defineProperty(Nu,"TextEdit",{enumerable:!0,get:a(function(){return ED.TextEdit},"get")});Object.defineProperty(Nu,"VersionedTextDocumentIdentifier",{enumerable:!0,get:a(function(){return ED.VersionedTextDocumentIdentifier},"get")});Object.defineProperty(Nu,"WorkspaceFolder",{enumerable:!0,get:a(function(){return ED.WorkspaceFolder},"get")});var iPi=MAt.Type.Object({line:MAt.Type.Integer({minimum:0}),character:MAt.Type.Integer({minimum:0})});Nu.RangeSchema=MAt.Type.Object({start:iPi,end:iPi})});var aPi=I(sPi=>{"use strict";p();Object.defineProperty(sPi,"__esModule",{value:!0})});var o4e=I(Mf=>{"use strict";p();var tHa=Mf&&Mf.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),i4e=Mf&&Mf.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tHa(e,t,r)};Object.defineProperty(Mf,"__esModule",{value:!0});Mf.TextEdit=Mf.Range=Mf.Position=Mf.Disposable=Mf.CancellationTokenSource=Mf.CancellationToken=void 0;var aAe=ri();Object.defineProperty(Mf,"CancellationToken",{enumerable:!0,get:a(function(){return aAe.CancellationToken},"get")});Object.defineProperty(Mf,"CancellationTokenSource",{enumerable:!0,get:a(function(){return aAe.CancellationTokenSource},"get")});Object.defineProperty(Mf,"Disposable",{enumerable:!0,get:a(function(){return aAe.Disposable},"get")});Object.defineProperty(Mf,"Position",{enumerable:!0,get:a(function(){return aAe.Position},"get")});Object.defineProperty(Mf,"Range",{enumerable:!0,get:a(function(){return aAe.Range},"get")});Object.defineProperty(Mf,"TextEdit",{enumerable:!0,get:a(function(){return aAe.TextEdit},"get")});i4e(Xki(),Mf);i4e(tPi(),Mf);i4e(nPi(),Mf);i4e(oPi(),Mf);i4e(aPi(),Mf)});var FSr=I(eI=>{"use strict";p();var rHa=eI&&eI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},cPi=eI&&eI.__param||function(t,e){return function(r,n){e(r,n,t)}},nHa=eI&&eI.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(eI,"__esModule",{value:!0});eI.CompletionNotifier=eI.ICompletionsNotifierService=void 0;var iHa=nHa(require("events")),oHa=nn(),sHa=bte(),aHa=o4e(),cHa=$g(),lHa=_5e(),OAt="CompletionRequested";eI.ICompletionsNotifierService=(0,oHa.createServiceIdentifier)("ICompletionsNotifierService");var BSr=class{static{a(this,"CompletionNotifier")}#e=new iHa.default;constructor(e,r){this.completionsPromiseQueue=e,this.completionsTelemetryService=r}notifyRequest(e,r,n,o,s){return this.#e.emit(OAt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=(0,cHa.telemetryCatch)(this.completionsTelemetryService,this.completionsPromiseQueue,e,`event.${OAt}`);return this.#e.on(OAt,r),aHa.Disposable.create(()=>this.#e.off(OAt,r))}};eI.CompletionNotifier=BSr;eI.CompletionNotifier=BSr=rHa([cPi(0,lHa.ICompletionsPromiseQueueService),cPi(1,sHa.ICompletionsTelemetryService)],BSr)});var USr=I(LAt=>{"use strict";p();Object.defineProperty(LAt,"__esModule",{value:!0});LAt.ICompletionsObservableWorkspace=void 0;var uHa=Gs();LAt.ICompletionsObservableWorkspace=(0,uHa.createDecorator)("ICompletionsObservableWorkspace")});var Dl=I(_D=>{"use strict";p();Object.defineProperty(_D,"__esModule",{value:!0});_D.logger=_D.Logger=_D.ICompletionsLogTargetService=_D.LogLevel=void 0;var dHa=nn(),fHa=bte(),pHa=$g(),Pre;(function(t){t[t.DEBUG=4]="DEBUG",t[t.INFO=3]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=1]="ERROR"})(Pre||(_D.LogLevel=Pre={}));_D.ICompletionsLogTargetService=(0,dHa.createServiceIdentifier)("ICompletionsLogTargetService");var BAt=class{static{a(this,"Logger")}constructor(e){this.category=e}log(e,r,...n){e.logIt(r,this.category,...n)}debug(e,...r){this.log(e,Pre.DEBUG,...r)}info(e,...r){this.log(e,Pre.INFO,...r)}warn(e,...r){this.log(e,Pre.WARN,...r)}error(e,...r){this.log(e,Pre.ERROR,...r)}exception(e,r,n){if(r instanceof Error&&r.name==="Canceled"&&r.message==="Canceled")return;let o=n;n.startsWith(".")&&(o=n.substring(1),n=`${this.category}${n}`),(0,pHa.telemetryException)(e.get(fHa.ICompletionsTelemetryService),r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e.get(_D.ICompletionsLogTargetService),Pre.ERROR,`${o}:`,s)}};_D.Logger=BAt;_D.logger=new BAt("default")});var uPi=I(KG=>{"use strict";p();Object.defineProperty(KG,"__esModule",{value:!0});KG.INotificationService=KG.NullNotificationService=KG.ProgressLocation=void 0;var hHa=nn(),mHa=YP(),lPi;(function(t){t[t.SourceControl=1]="SourceControl",t[t.Window=10]="Window",t[t.Notification=15]="Notification"})(lPi||(KG.ProgressLocation=lPi={}));var QSr=class{static{a(this,"NullNotificationService")}showInformationMessage(e,r,...n){return Promise.resolve(void 0)}showWarningMessage(e,...r){return Promise.resolve(void 0)}showQuotaExceededDialog(e){return Promise.resolve()}withProgress(e,r){return Promise.resolve(r({report:a(()=>{},"report")},mHa.CancellationToken.None))}};KG.NullNotificationService=QSr;KG.INotificationService=(0,hHa.createServiceIdentifier)("INotificationService")});var jSr=I(vD=>{"use strict";p();var gHa=vD&&vD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},AHa=vD&&vD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(vD,"__esModule",{value:!0});vD.ExtensionNotificationSender=vD.ICompletionsNotificationSender=void 0;var yHa=uPi(),EHa=nn();vD.ICompletionsNotificationSender=(0,EHa.createServiceIdentifier)("ICompletionsNotificationSender");var qSr=class{static{a(this,"ExtensionNotificationSender")}constructor(e){this.notificationService=e}async showWarningMessage(e,...r){let n=await this.notificationService.showWarningMessage(e,...r.map(o=>o.title));if(n!==void 0)return{title:n}}};vD.ExtensionNotificationSender=qSr;vD.ExtensionNotificationSender=qSr=gHa([AHa(0,yHa.INotificationService)],qSr)});var $Sr=I(CD=>{"use strict";p();var _Ha=CD&&CD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},HSr=CD&&CD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(CD,"__esModule",{value:!0});CD.UserErrorNotifier=CD.ICompletionsUserErrorNotifierService=void 0;var vHa=U4(),CHa=nn(),bHa=nd(),pPi=Dl(),SHa=jSr(),THa=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],dPi="Your proxy connection requires a trusted certificate. Please make sure the proxy certificate and any issuers are configured correctly and trusted by your operating system.",fPi="https://gh.io/copilot-network-errors";CD.ICompletionsUserErrorNotifierService=(0,CHa.createServiceIdentifier)("ICompletionsUserErrorNotifierService");var GSr=class{static{a(this,"UserErrorNotifier")}constructor(e,r,n){this._logTarget=e,this._notificationSender=r,this._env=n,this.notifiedErrorCodes=[]}notifyUser(e){if(!(e instanceof Error))return;let r=e;r.code&&THa.includes(r.code)&&!this.didNotifyBefore(r.code)&&(this.notifiedErrorCodes.push(r.code),this.displayCertificateErrorNotification(r))}async displayCertificateErrorNotification(e){new pPi.Logger("certificates").error(this._logTarget,`${dPi} Please visit ${fPi} to learn more. Original cause:`,e);let r={title:"Learn more"};return this._notificationSender.showWarningMessage(dPi,r).then(n=>{if(n?.title===r.title)return this._env.openExternal(bHa.URI.parse(fPi))})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};CD.UserErrorNotifier=GSr;CD.UserErrorNotifier=GSr=_Ha([HSr(0,pPi.ICompletionsLogTargetService),HSr(1,SHa.ICompletionsNotificationSender),HSr(2,vHa.IEnvService)],GSr)});var mh=I(cAe=>{"use strict";p();Object.defineProperty(cAe,"__esModule",{value:!0});cAe.NullExperimentationService=cAe.IExperimentationService=void 0;var IHa=nn(),xHa=Ic();cAe.IExperimentationService=(0,IHa.createServiceIdentifier)("IExperimentationService");var VSr=class{static{a(this,"NullExperimentationService")}constructor(){this._onDidTreatmentsChange=new xHa.Emitter,this.onDidTreatmentsChange=this._onDidTreatmentsChange.event}async hasTreatments(){return Promise.resolve()}async hasAccountBasedTreatments(){return Promise.resolve()}getTreatmentVariable(e){}async setCompletionsFilters(e){}};cAe.NullExperimentationService=VSr});var JG=I(o1=>{"use strict";p();Object.defineProperty(o1,"__esModule",{value:!0});o1.DEFAULT_PROMPT_ALLOCATION_PERCENT=o1.DEFAULT_SUFFIX_MATCH_THRESHOLD=o1.DEFAULT_NUM_SNIPPETS=o1.DEFAULT_MAX_PROMPT_LENGTH=o1.DEFAULT_MAX_COMPLETION_LENGTH=void 0;o1.normalizeLanguageId=RHa;o1.DEFAULT_MAX_COMPLETION_LENGTH=500;o1.DEFAULT_MAX_PROMPT_LENGTH=8192-o1.DEFAULT_MAX_COMPLETION_LENGTH;o1.DEFAULT_NUM_SNIPPETS=4;o1.DEFAULT_SUFFIX_MATCH_THRESHOLD=10;o1.DEFAULT_PROMPT_ALLOCATION_PERCENT={prefix:35,suffix:15,stableContext:35,volatileContext:15};var wHa={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function RHa(t){return t=t.toLowerCase(),wHa[t]??t}a(RHa,"normalizeLanguageId")});var hPi=I(WSr=>{"use strict";p();Object.defineProperty(WSr,"__esModule",{value:!0});WSr.getUserKind=PHa;function kHa(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(kHa,"findKnownOrg");function PHa(t){let e=t.organizationList??[];return kHa(e)??""}a(PHa,"getUserKind")});var s4e=I(K4=>{"use strict";p();Object.defineProperty(K4,"__esModule",{value:!0});K4.IEndpointProvider=K4.ModelSupportedEndpoint=void 0;K4.isEndpointEditToolName=MHa;K4.isChatModelInformation=OHa;K4.isEmbeddingModelInformation=LHa;K4.isCompletionModelInformation=BHa;var DHa=nn(),NHa=new Set(["find-replace","multi-find-replace","apply-patch","code-rewrite"]);function MHa(t){return NHa.has(t)}a(MHa,"isEndpointEditToolName");var mPi;(function(t){t.ChatCompletions="/chat/completions",t.Responses="/responses",t.WebSocketResponses="ws:/responses",t.Messages="/v1/messages"})(mPi||(K4.ModelSupportedEndpoint=mPi={}));function OHa(t){return t.capabilities.type==="chat"}a(OHa,"isChatModelInformation");function LHa(t){return t.capabilities.type==="embeddings"}a(LHa,"isEmbeddingModelInformation");function BHa(t){return t.capabilities.type==="completion"}a(BHa,"isCompletionModelInformation");K4.IEndpointProvider=(0,DHa.createServiceIdentifier)("IEndpointProvider")});var APi=I(zSr=>{"use strict";p();Object.defineProperty(zSr,"__esModule",{value:!0});zSr.getUserSelectedModelConfiguration=FHa;var gPi=LE();function FHa(t){let e=(0,gPi.getConfig)(t,gPi.ConfigKey.UserSelectedCompletionModel);return typeof e=="string"&&e.length>0?e:null}a(FHa,"getUserSelectedModelConfiguration")});var yPi=I(Z4=>{"use strict";p();Object.defineProperty(Z4,"__esModule",{value:!0});Z4.bytePairEncode=Z4.BinaryMap=Z4.binaryMapKey=void 0;var UHa=a((t,e,r)=>{let n=r-e,o=16777215>>>Math.max(0,(3-n)*8),s=(t[e+0]|t[e+1]<<8|t[e+2]<<16)&o,c=16777215>>>Math.min(31,Math.max(0,(6-n)*8)),l=(t[e+3]|t[e+4]<<8|t[e+5]<<16)&c;return s+16777216*l},"binaryMapKey");Z4.binaryMapKey=UHa;var YSr=class t{static{a(this,"BinaryMap")}constructor(){this.nested=new Map,this.final=new Map}get(e,r=0,n=e.length){let o=n<6+r,s=(0,Z4.binaryMapKey)(e,r,n);return o?this.final.get(s):this.nested.get(s)?.get(e,6+r,n)}set(e,r){let n=(0,Z4.binaryMapKey)(e,0,e.length);if(e.length<6){this.final.set(n,r);return}let s=this.nested.get(n);if(s instanceof t)s.set(e.subarray(6),r);else{let c=new t;c.set(e.subarray(6),r),this.nested.set(n,c)}}};Z4.BinaryMap=YSr;var J4=new Int32Array(128),Dv=new Int32Array(128);function QHa(t,e,r){if(r===1)return[e.get(t)];let n=2147483647,o=-1;for(;J4.length0&&(J4[Dv[o-1]]=c(o-1,1));for(let u=o+1;u{"use strict";p();Object.defineProperty(FAt,"__esModule",{value:!0});FAt.makeTextEncoder=void 0;var KSr=class{static{a(this,"UniversalTextEncoder")}constructor(){this.length=0,this.encoder=new TextEncoder}encode(e){let r=this.encoder.encode(e);return this.length=r.length,r}},JSr=class{static{a(this,"NodeTextEncoder")}constructor(){this.buffer=Buffer.alloc(256),this.length=0}encode(e){for(;;){if(this.length=this.buffer.write(e,"utf8"),this.lengthtypeof Buffer<"u"?new JSr:new KSr,"makeTextEncoder");FAt.makeTextEncoder=qHa});var _Pi=I(UAt=>{"use strict";p();Object.defineProperty(UAt,"__esModule",{value:!0});UAt.LRUCache=void 0;var ZSr=class{static{a(this,"LRUCache")}constructor(e){this.size=e,this.nodes=new Map}get(e){let r=this.nodes.get(e);if(r)return this.moveToHead(r),r.value}set(e,r){let n=this.nodes.get(e);if(n)n.value=r,this.moveToHead(n);else{let o=new XSr(e,r);this.nodes.set(e,o),this.addNode(o),this.nodes.size>this.size&&(this.nodes.delete(this.tail.key),this.removeNode(this.tail))}}moveToHead(e){this.removeNode(e),e.next=void 0,e.prev=void 0,this.addNode(e)}addNode(e){this.head&&(this.head.prev=e,e.next=this.head),this.tail||(this.tail=e),this.head=e}removeNode(e){e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev}};UAt.LRUCache=ZSr;var XSr=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.value=r}}});var tTr=I(qAt=>{"use strict";p();Object.defineProperty(qAt,"__esModule",{value:!0});qAt.TikTokenizer=void 0;var QAt=yPi(),jHa=EPi(),HHa=_Pi();function GHa(t){let e=new Map;try{let o=require("fs").readFileSync(t,"utf-8");return r(o),e}catch(n){throw new Error(`Failed to load from BPE encoder file stream: ${n}`)}function r(n){for(let o of n.split(/[\r\n]+/)){if(o.trim()==="")continue;let s=o.split(" ");if(s.length!==2)throw new Error("Invalid format in the BPE encoder file stream");let c=new Uint8Array(Buffer.from(s[0],"base64")),l=parseInt(s[1]);if(!isNaN(l))e.set(c,l);else throw new Error(`Can't parse ${s[1]} to integer`)}}a(r,"processBpeRanks")}a(GHa,"loadTikTokenBpe");function $Ha(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a($Ha,"escapeRegExp");var eTr=class{static{a(this,"TikTokenizer")}constructor(e,r,n,o=8192){this.textEncoder=(0,jHa.makeTextEncoder)(),this.textDecoder=new TextDecoder("utf-8"),this.cache=new HHa.LRUCache(o);let s=typeof e=="string"?GHa(e):e;this.init(s,r,n)}init(e,r,n){this.encoder=new QAt.BinaryMap;for(let[o,s]of e)this.encoder.set(o,s);this.regex=new RegExp(n,"gu"),this.specialTokensRegex=new RegExp(Array.from(r.keys()).map(o=>$Ha(o)).join("|")),this.specialTokensEncoder=r,this.decoder=new Map;for(let[o,s]of e)this.decoder.set(s,o);if(e.size!==this.decoder.size)throw new Error("Encoder and decoder sizes do not match");this.specialTokensDecoder=new Map;for(let[o,s]of r)this.specialTokensDecoder.set(s,o)}findNextSpecialToken(e,r,n){let o=r,s=null;if(n&&this.specialTokensRegex)for(;s=e.slice(o).match(this.specialTokensRegex),!(!s||n&&n.includes(s[0]));)o+=s.index+1;let c=s?o+s.index:e.length;return[s,c]}encode(e,r){let n=[],o=0;for(;;){let s,c;if([s,c]=this.findNextSpecialToken(e,o,r),c>o&&this.encodeByIndex(e,n,o,c),s){if(o=o+this.encodeSpecialToken(n,s),o>=e.length)break}else break}return n}encodeSpecialToken(e,r){let n=this.specialTokensEncoder?.get(r[0]);return e.push(n),r.index+r[0].length}encodeByIndex(e,r,n,o){let s,c=e.substring(n,o);for(this.regex.lastIndex=0;s=this.regex.exec(c);){let l=this.cache.get(s[0]);if(l)for(let u of l)r.push(u);else{let u=this.textEncoder.encode(s[0]),d=this.encoder.get(u,0,this.textEncoder.length);if(d!==void 0)r.push(d),this.cache.set(s[0],[d]);else{let f=(0,QAt.bytePairEncode)(u,this.encoder,this.textEncoder.length);for(let h of f)r.push(h);this.cache.set(s[0],f)}}}}encodeTrimSuffixByIndex(e,r,n,o,s,c,l){let u,d=e.substring(n,o);for(this.regex.lastIndex=0;u=this.regex.exec(d);){let f=u[0],h=this.cache.get(f);if(h)if(c+h.length<=s)c+=h.length,l+=f.length,r.push(...h);else{let m=s-c;c+=m,l+=f.length,r.push(...h.slice(0,m));break}else{let m=this.textEncoder.encode(f),g=this.encoder.get(m,0,m.length);if(g!==void 0)if(this.cache.set(f,[g]),c+1<=s)c++,l+=f.length,r.push(g);else break;else{let A=(0,QAt.bytePairEncode)(m,this.encoder,this.textEncoder.length);if(this.cache.set(f,A),c+A.length<=s){c+=A.length,l+=f.length;for(let y of A)r.push(y)}else{let y=s-c;c+=y,l+=f.length;for(let E=0;E=s)break}return{tokenCount:c,encodeLength:l}}encodeTrimSuffix(e,r,n){let o=[],s=0,c=0,l=0;for(;;){let d,f;if([d,f]=this.findNextSpecialToken(e,s,n),f>s){let{tokenCount:h,encodeLength:m}=this.encodeTrimSuffixByIndex(e,o,s,f,r,c,l);if(c=h,l=m,c>=r)break}if(d!==null){if(c++,c<=r&&(s=s+this.encodeSpecialToken(o,d),l+=d[0].length,s>=e.length)||c>=r)break}else break}let u=l===e.length?e:e.slice(0,l);return{tokenIds:o,text:u}}encodeTrimPrefix(e,r,n){let o=[],s=0,c=0,l=0,u=new Map;for(u.set(c,l);;){let m,g;if([m,g]=this.findNextSpecialToken(e,s,n),g>s){let A,y=e.substring(s,g);for(this.regex.lastIndex=0;A=this.regex.exec(y);){let E=A[0],_=this.cache.get(E);if(_)c+=_.length,l+=E.length,o.push(..._),u.set(c,l);else{let v=this.textEncoder.encode(E),b=this.encoder.get(v);if(b!==void 0)this.cache.set(E,[b]),c++,l+=E.length,o.push(b),u.set(c,l);else{let T=(0,QAt.bytePairEncode)(v,this.encoder,this.textEncoder.length);this.cache.set(E,T),c+=T.length,l+=E.length;for(let w of T)o.push(w);u.set(c,l)}}}}if(m!==null){if(s=s+this.encodeSpecialToken(o,m),c++,l+=m[0].length,u.set(c,l),s>=e.length)break}else break}if(c<=r)return{tokenIds:o,text:e};let d=c-r,f=0,h=0;for(let[m,g]of u)if(m>=d){f=m,h=g;break}if(f>r){let m=this.encode(e,n),g=m.slice(m.length-r);return{tokenIds:g,text:this.decode(g)}}return{tokenIds:o.slice(f),text:e.slice(h)}}decode(e){let r=[];for(let n of e){let o=[],s=this.decoder?.get(n);if(s!==void 0)o=Array.from(s);else{let c=this.specialTokensDecoder?.get(n);if(c!==void 0){let l=this.textEncoder.encode(c);o=Array.from(l.subarray(0,this.textEncoder.length))}}r.push(...o)}return this.textDecoder.decode(new Uint8Array(r))}};qAt.TikTokenizer=eTr});var kPi=I(Im=>{"use strict";p();Object.defineProperty(Im,"__esModule",{value:!0});Im.createTokenizer=Im.createByEncoderName=Im.createByModelName=Im.getRegexByModel=Im.getRegexByEncoder=Im.getSpecialTokensByModel=Im.getSpecialTokensByEncoder=Im.MODEL_TO_ENCODING=void 0;var VHa=tTr(),WHa=new Map([["gpt-4o-","o200k_base"],["gpt-4-","cl100k_base"],["gpt-3.5-turbo-","cl100k_base"],["gpt-35-turbo-","cl100k_base"]]);Im.MODEL_TO_ENCODING=new Map([["gpt-4o","o200k_base"],["gpt-4","cl100k_base"],["gpt-3.5-turbo","cl100k_base"],["text-davinci-003","p50k_base"],["text-davinci-002","p50k_base"],["text-davinci-001","r50k_base"],["text-curie-001","r50k_base"],["text-babbage-001","r50k_base"],["text-ada-001","r50k_base"],["davinci","r50k_base"],["curie","r50k_base"],["babbage","r50k_base"],["ada","r50k_base"],["code-davinci-002","p50k_base"],["code-davinci-001","p50k_base"],["code-cushman-002","p50k_base"],["code-cushman-001","p50k_base"],["davinci-codex","p50k_base"],["cushman-codex","p50k_base"],["text-davinci-edit-001","p50k_edit"],["code-davinci-edit-001","p50k_edit"],["text-embedding-ada-002","cl100k_base"],["text-similarity-davinci-001","r50k_base"],["text-similarity-curie-001","r50k_base"],["text-similarity-babbage-001","r50k_base"],["text-similarity-ada-001","r50k_base"],["text-search-davinci-doc-001","r50k_base"],["text-search-curie-doc-001","r50k_base"],["text-search-babbage-doc-001","r50k_base"],["text-search-ada-doc-001","r50k_base"],["code-search-babbage-code-001","r50k_base"],["code-search-ada-code-001","r50k_base"],["gpt2","gpt2"]]);var jAt="<|endoftext|>",vPi="<|fim_prefix|>",CPi="<|fim_middle|>",bPi="<|fim_suffix|>",SPi="<|endofprompt|>",a4e="'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+",TPi="(?:'s|'S|'t|'T|'re|'RE|'Re|'eR|'ve|'VE|'vE|'Ve|'m|'M|'ll|'lL|'Ll|'LL|'d|'D)|[^\\r\\n\\p{L}\\p{N}]?\\p{L}+|\\p{N}{1,3}| ?[^\\s\\p{L}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",zHa=[`[^\r +`:"",n.chromiumDetails?`${o}${JSON.stringify(zxi(n.chromiumDetails))} +`:"",r(n.cause,o+" "),...Array.isArray(n.errors)?n.errors.map(l=>r(l,o+" ")):[]].join("")}return a(r,"collect"),r(t,"").trim()}a(Wxi,"collectErrorMessages");function CDa(t,e=!1){let r=new Set;function n(o){if(!o||!["object","string"].includes(typeof o)||r.has(o))return"";r.add(o);let l=((typeof o=="string"?o:o.message||o.code||"").toString?.()||"").trim().split(` +`).join(" "),u=[...e&&o.chromiumDetails?[JSON.stringify(zxi(o.chromiumDetails))]:[],...o.cause?[n(o.cause)]:[],...Array.isArray(o.errors)?o.errors.map(d=>n(d)):[]].join(", ");return u?`${l}: ${u}`:l}return a(n,"collect"),n(t)}a(CDa,"collectSingleLineErrorMessage");function bDa(t){return t=t.replace(/(\b(?:PROXY|HTTPS?|SOCKS[45]?)\s+)[^\s]+@([^\s:\/]+)/gi,"$1@"),t=t.replace(/(\b(?:PROXY|HTTPS?|SOCKS[45]?)\s+)([a-zA-Z0-9][-a-zA-Z0-9.]*)/gi,"$1"),t=t.replace(/(\/\/)[^\s/]+@([^\s:\/]+)/g,"$1@"),t=t.replace(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g,""),t=t.replace(/(?"),t=t.replace(/(?"),t=t.replace(/\b([a-zA-Z0-9][-a-zA-Z0-9]*\.)+[a-zA-Z]{2,}\b/g,""),t}a(bDa,"sanitizeNetworkErrorForTelemetry");function zxi(t){if(!t||typeof t!="object")return{};if(t.is_request_error!==void 0&&t.session_state===void 0)return{is_request_error:t.is_request_error,network_process_crashed:t.network_process_crashed};let e={drain_error:t.drain_error,drain_description:t.drain_description,go_away_error:t.go_away_error,go_away_error_details:t.go_away_error_details,go_away_debug_data:t.go_away_debug_data,rst_stream_error:t.rst_stream_error,rst_stream_error_details:t.rst_stream_error_details,rst_stream_description:t.rst_stream_description,last_framer_error:t.last_framer_error,last_framer_error_details:t.last_framer_error_details,error_source:t.error_source,aliases_length:Array.isArray(t.aliases)?t.aliases.length:void 0};if(t.proxy){let n=[...String(t.proxy).matchAll(/([a-z][a-z0-9+.-]*):\/\//gi)].map(o=>o[1]);n.length>0&&(e.proxy_schemes=n)}if(t.in_flight_write&&typeof t.in_flight_write=="object"&&(e.in_flight_write={frame_type:t.in_flight_write.frame_type,frame_size:t.in_flight_write.frame_size,remaining_size:t.in_flight_write.remaining_size}),t.buffered_spdy_framer&&typeof t.buffered_spdy_framer=="object"&&(e.buffered_spdy_framer={frames_received:t.buffered_spdy_framer.frames_received,has_error:t.buffered_spdy_framer.has_error,message_fully_read:t.buffered_spdy_framer.message_fully_read}),t.session_state&&typeof t.session_state=="object"){let r=t.session_state;e.session_state={availability_state:r.availability_state,session_send_window:r.session_send_window,session_recv_window:r.session_recv_window,stream_initial_send_window:r.stream_initial_send_window,stream_initial_recv_window:r.stream_initial_recv_window,send_stalled_by_session_window:r.send_stalled_by_session_window,active_stream_count:r.active_stream_count,created_stream_count:r.created_stream_count,max_concurrent_streams:r.max_concurrent_streams,highest_stream_id_sent:r.highest_stream_id_sent,frames_sent:r.frames_sent,frames_received:r.frames_received,ping_in_flight:r.ping_in_flight,last_ping_sent_ms:r.last_ping_sent_ms,next_ping_id:r.next_ping_id,failed_ping_count:r.failed_ping_count,support_websocket:r.support_websocket,deprecate_http2_priorities:r.deprecate_http2_priorities,streams_initiated_count:r.streams_initiated_count,streams_abandoned_count:r.streams_abandoned_count,read_state:r.read_state,write_state:r.write_state,pending_create_stream_request_count:r.pending_create_stream_request_count,error:r.error,error_on_unavailable:r.error_on_unavailable,unacked_recv_window_bytes:r.unacked_recv_window_bytes,last_good_stream_id:r.last_good_stream_id,debug_stream_id:r.debug_stream_id,has_ping_based_connection_checking:r.has_ping_based_connection_checking,num_broken_connection_detection_requests:r.num_broken_connection_detection_requests,session_max_queued_capped_frames:r.session_max_queued_capped_frames,num_queued_capped_frames:r.num_queued_capped_frames,check_ping_status_pending:r.check_ping_status_pending,in_confirm_handshake:r.in_confirm_handshake,http2_end_stream_with_data_frame:r.http2_end_stream_with_data_frame,reused:r.reused,session_max_recv_window_size:r.session_max_recv_window_size,max_header_table_size:r.max_header_table_size,time_since_last_read_ms:r.time_since_last_read_ms,time_since_last_write_ms:r.time_since_last_write_ms,time_since_last_recv_window_update_ms:r.time_since_last_recv_window_update_ms}}if(t.tls_info&&typeof t.tls_info=="object"){let r=t.tls_info;e.tls_info={is_secure_connection:r.is_secure_connection,ssl_version:r.ssl_version,cipher_suite:r.cipher_suite,negotiated_alpn:r.negotiated_alpn,cert_status:r.cert_status,is_issued_by_known_root:r.is_issued_by_known_root,handshake_type:r.handshake_type,client_cert_sent:r.client_cert_sent,exchange_group:r.key_exchange_group,ct_compliance:r.ct_compliance,alps_negotiated:r.alps_negotiated}}if(t.socket_info&&typeof t.socket_info=="object"){let r=t.socket_info;e.socket_info={is_connected:r.is_connected,was_ever_used:r.was_ever_used,dns_lookup_duration_ms:r.dns_lookup_duration_ms,tcp_connect_duration_ms:r.tcp_connect_duration_ms,ssl_handshake_duration_ms:r.ssl_handshake_duration_ms,owned_socket:r.owned_socket,socket_reuse_type:r.socket_reuse_type}}return t.url_loader_error&&typeof t.url_loader_error=="object"&&(e.url_loader_error={is_request_error:t.url_loader_error.is_request_error,network_process_crashed:t.url_loader_error.network_process_crashed}),Array.isArray(t.active_stream_details)&&(e.active_stream_details=t.active_stream_details.map(r=>({stream_id:r.stream_id,io_state:r.io_state,type:r.type,priority:r.priority,send_window_size:r.send_window_size,recv_window_size:r.recv_window_size,max_recv_window_size:r.max_recv_window_size,unacked_recv_window_bytes:r.unacked_recv_window_bytes,send_stalled_by_flow_control:r.send_stalled_by_flow_control,raw_sent_bytes:r.raw_sent_bytes,raw_received_bytes:r.raw_received_bytes,recv_bytes:r.recv_bytes,pending_send_status:r.pending_send_status,response_state:r.response_state,pending_send_data_remaining:r.pending_send_data_remaining,request_time_ms:r.request_time_ms,response_time_ms:r.response_time_ms}))),Array.isArray(t.closed_stream_details)&&(e.closed_stream_details=t.closed_stream_details.map(r=>({stream_id:r.stream_id,io_state:r.io_state,type:r.type,priority:r.priority,send_window_size:r.send_window_size,recv_window_size:r.recv_window_size,max_recv_window_size:r.max_recv_window_size,unacked_recv_window_bytes:r.unacked_recv_window_bytes,send_stalled_by_flow_control:r.send_stalled_by_flow_control,raw_sent_bytes:r.raw_sent_bytes,raw_received_bytes:r.raw_received_bytes,recv_bytes:r.recv_bytes,pending_send_status:r.pending_send_status,response_state:r.response_state,pending_send_data_remaining:r.pending_send_data_remaining,request_time_ms:r.request_time_ms,response_time_ms:r.response_time_ms}))),e}a(zxi,"extractChromiumDetails");var Ogt=class{static{a(this,"LogMemory")}static{this._logs=[]}static{this._requestIds=[]}static{this.MAX_LOGS=50}static extractRequestIdFromMessage(e){let r=e.match(/request done: requestId: \[([0-9a-fA-F-]+)\] model deployment ID: \[/);if(r){let n=r[1];if(!this._requestIds.includes(n))return n}}static addLog(e,r){this._logs.length>=this.MAX_LOGS&&this._logs.shift(),this._logs.push(`${e}: ${r}`),this._requestIds.length>=this.MAX_LOGS&&this._requestIds.shift();let n=this.extractRequestIdFromMessage(r);n&&this._requestIds.push(n)}static getLogs(){return this._logs}static getRequestIds(){return this._requestIds}};yy.LogMemory=Ogt});var j5e=I(q5e=>{"use strict";p();Object.defineProperty(q5e,"__esModule",{value:!0});q5e.ICopilotTokenManager=void 0;q5e.nowSeconds=TDa;var SDa=nn();q5e.ICopilotTokenManager=(0,SDa.createServiceIdentifier)("ICopilotTokenManager");function TDa(){return Math.floor(Date.now()/1e3)}a(TDa,"nowSeconds")});var HE=I(Im=>{"use strict";p();var IDa=Im&&Im.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Lgt=Im&&Im.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Im,"__esModule",{value:!0});Im.BaseAuthenticationService=Im.IAuthenticationService=Im.MinimalModeError=Im.GITHUB_SCOPE_ALIGNED=Im.GITHUB_SCOPE_READ_USER=Im.GITHUB_SCOPE_USER_EMAIL=void 0;Im.authProviderId=NDa;var xDa=nn(),Bgt=Rc(),wDa=Ro(),RDa=D8(),Pte=Pl(),kDa=xp(),PDa=j5e(),DDa=uG();Im.GITHUB_SCOPE_USER_EMAIL=["user:email"];Im.GITHUB_SCOPE_READ_USER=["read:user"];Im.GITHUB_SCOPE_ALIGNED=["read:user","user:email","repo","workflow"];var YCr=class extends Error{static{a(this,"MinimalModeError")}constructor(){super("The authentication service is in minimal mode."),this.name="MinimalModeError"}};Im.MinimalModeError=YCr;Im.IAuthenticationService=(0,xDa.createServiceIdentifier)("IAuthenticationService");var KCr=class extends wDa.Disposable{static{a(this,"BaseAuthenticationService")}fireAuthenticationChange(e){let r=!!this.copilotToken;this._logService.info(`AuthenticationService: firing onDidAuthenticationChange from ${e}. Has token: ${r}`),this._onDidAuthenticationChange.fire()}fireCopilotTokenChange(e){this._logService.debug(`AuthenticationService: firing onDidCopilotTokenChange from ${e}.`),this._onDidCopilotTokenChange.fire()}constructor(e,r,n,o){super(),this._logService=e,this._tokenStore=r,this._tokenManager=n,this._configurationService=o,this._onDidAuthenticationChange=this._register(new Bgt.Emitter),this.onDidAuthenticationChange=this._onDidAuthenticationChange.event,this._onDidCopilotTokenChange=this._register(new Bgt.Emitter),this.onDidCopilotTokenChange=this._onDidCopilotTokenChange.event,this._onDidAccessTokenChange=this._register(new Bgt.Emitter),this.onDidAccessTokenChange=this._onDidAccessTokenChange.event,this._onDidAdoAuthenticationChange=this._register(new Bgt.Emitter),this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event,this._isMinimalMode=(0,RDa.derived)(s=>this._configurationService.getConfigObservable(Pte.ConfigKey.Shared.AuthPermissions).read(s)===Pte.AuthPermissionMode.Minimal),this._register(n.onDidCopilotTokenRefresh(()=>{this._logService.debug("Handling CopilotToken refresh."),this._handleAuthChangeEvent()}))}get isMinimalMode(){return this._isMinimalMode.get()}get anyGitHubSession(){return this._anyGitHubSession}get hasCopilotTokenSource(){return!!this._anyGitHubSession}get permissiveGitHubSession(){return this._permissiveGitHubSession}get anyAdoSession(){return this._anyAdoSession}get copilotToken(){return this._tokenStore.copilotToken}async getCopilotToken(e){try{let r=this._tokenStore.copilotToken,n=await this._tokenManager.getCopilotToken(e);return this._tokenStore.copilotToken=n,this._copilotTokenError=void 0,r?.token!==n.token&&this.fireCopilotTokenChange("getCopilotToken"),n}catch(r){let n=this._tokenStore.copilotToken;this._tokenStore.copilotToken=void 0;let o=this._copilotTokenError;throw this._copilotTokenError=r,n?this.fireCopilotTokenChange("getCopilotToken token lost"):o&&r&&o.message!==r.message&&this.fireCopilotTokenChange("getCopilotToken error change"),r}}resetCopilotToken(e){let r=!!this._tokenStore.copilotToken;this._tokenStore.copilotToken=void 0,this._tokenManager.resetCopilotToken(e),r&&this.fireCopilotTokenChange("resetCopilotToken")}async _handleAuthChangeEvent(){let e=this._anyGitHubSession,r=this._permissiveGitHubSession,n=this._anyAdoSession,o=await Promise.allSettled([this.getGitHubSession("any",{silent:!0}),this.getGitHubSession("permissive",{silent:!0}),this.getAnyAdoSession({silent:!0})]);for(let s of o)s.status==="rejected"&&this._logService.error(`Error getting a session: ${s.reason}`);if(e?.accessToken!==this._anyGitHubSession?.accessToken||r?.accessToken!==this._permissiveGitHubSession?.accessToken){this._onDidAccessTokenChange.fire(),this._logService.debug("Auth state changed (identity change), minting a new CopilotToken...");try{await this.getCopilotToken(!0)}catch{}this._logService.debug("Minted a new CopilotToken."),this.fireAuthenticationChange("handleAuthChangeEvent identity change");return}n?.accessToken!==this._anyAdoSession?.accessToken&&(this._logService.debug(`Ado auth state changed, firing event. Had token before: ${!!n?.accessToken}. Has token now: ${!!this._anyAdoSession?.accessToken}.`),this._onDidAdoAuthenticationChange.fire());try{await this.getCopilotToken()}catch{}this._logService.debug("Finished handling auth change event.")}};Im.BaseAuthenticationService=KCr;Im.BaseAuthenticationService=KCr=IDa([Lgt(0,kDa.ILogService),Lgt(1,DDa.ICopilotTokenStore),Lgt(2,PDa.ICopilotTokenManager),Lgt(3,Pte.IConfigurationService)],KCr);function NDa(t){return t.getConfig(Pte.ConfigKey.Shared.AuthProvider)===Pte.AuthProviderId.GitHubEnterprise?Pte.AuthProviderId.GitHubEnterprise:Pte.AuthProviderId.GitHub}a(NDa,"authProviderId")});var Fgt=I(JCr=>{"use strict";p();Object.defineProperty(JCr,"__esModule",{value:!0});JCr.onCopilotToken=MDa;function MDa(t,e){return t.onDidCopilotTokenChange(()=>{let r=t.copilotToken;r&&e(r)})}a(MDa,"onCopilotToken")});var XCr=I(yD=>{"use strict";p();var ODa=yD&&yD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},LDa=yD&&yD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(yD,"__esModule",{value:!0});yD.TelemetryUserConfig=yD.ICompletionsTelemetryUserConfigService=void 0;var BDa=HE(),FDa=nn(),UDa=Ro(),QDa=Fgt();function qDa(t){let e=t.getTokenValue("tid"),r=t.organizationList,n=t.enterpriseList,o=t.getTokenValue("sku");if(!e)return;let s={copilot_trackingId:e};return r&&(s.organizations_list=r.toString()),n&&(s.enterprise_list=n.toString()),o&&(s.sku=o),s}a(qDa,"propertiesFromCopilotToken");yD.ICompletionsTelemetryUserConfigService=(0,FDa.createServiceIdentifier)("ICompletionsTelemetryUserConfigService");var ZCr=class extends UDa.Disposable{static{a(this,"TelemetryUserConfig")}#e;constructor(e){super(),this.#e={},this.optedIn=!1,this.ftFlag="",this._register((0,QDa.onCopilotToken)(e,n=>this.updateFromToken(n)));let r=e.copilotToken;r&&this.updateFromToken(r)}getProperties(){return this.#e}get trackingId(){return this.#e.copilot_trackingId}updateFromToken(e){let r=qDa(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1",this.ftFlag=e.getTokenValue("ft")??"")}};yD.TelemetryUserConfig=ZCr;yD.TelemetryUserConfig=ZCr=ODa([LDa(0,BDa.IAuthenticationService)],ZCr)});var H5e=I(Jge=>{"use strict";p();Object.defineProperty(Jge,"__esModule",{value:!0});Jge.PromiseQueue=Jge.ICompletionsPromiseQueueService=void 0;var jDa=nn();Jge.ICompletionsPromiseQueueService=(0,jDa.createServiceIdentifier)("completionsPromiseQueueService");var ebr=class{static{a(this,"PromiseQueue")}constructor(){this.promises=new Set}register(e){this.promises.add(e),e.finally(()=>this.promises.delete(e))}async flush(){await Promise.allSettled(this.promises)}};Jge.PromiseQueue=ebr});var Yg=I(bd=>{"use strict";p();Object.defineProperty(bd,"__esModule",{value:!0});bd.TelemetryReporters=bd.ICompletionsTelemetryReporters=bd.CopilotTelemetryReporter=bd.TelemetryWithExp=bd.TelemetryData=bd.TelemetryStore=void 0;bd.telemetrizePromptLength=eNa;bd.now=Xge;bd.telemetry=lbr;bd.telemetryExpProblem=nNa;bd.telemetryRaw=oNa;bd.telemetryException=Jxi;bd.telemetryCatch=sNa;bd.telemetryError=aNa;bd.logEngineCompletion=lNa;bd.logEnginePrompt=uNa;var HDa=H4(),GDa=nn(),$Da=x0(),ibr=$s(),Ugt=Dte(),G4=qE(),VDa=sgt(),WDa=gy(),zDa=cgt(),YDa=wCr(),obr=XCr(),sbr=H5e(),rI;(function(t){t[t.Standard=0]="Standard",t[t.Enhanced=1]="Enhanced"})(rI||(bd.TelemetryStore=rI={}));(function(t){function e(r){return r===t.Enhanced}a(e,"isEnhanced"),t.isEnhanced=e})(rI||(bd.TelemetryStore=rI={}));function Zge(t){return t===rI.Enhanced}a(Zge,"isEnhanced");var KDa=["engine.prompt","engine.completion","ghostText.capturedAfterAccepted","ghostText.capturedAfterRejected"],G5e=8192,JDa=21,$4=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=[YDa.ExpServiceTelemetryNames.featuresTelemetryPropertyName]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},Xge())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=Xge())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(WDa.ICompletionsFeaturesService).getFallbackExpAndFilters();n.addToTelemetry(this),r.addToTelemetry(this)}extendWithEditorAgnosticFields(e){let r=e.get(HDa.IEnvService),n=e.get(G4.ICompletionsEditorAndPluginInfo);this.properties.editor_version=(0,G4.formatNameAndVersion)(n.getEditorInfo()),this.properties.editor_plugin_version=(0,G4.formatNameAndVersion)(n.getEditorPluginInfo()),this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${G4.BuildInfo.getVersion()}`,typeof process<"u"&&(this.properties.runtime_version=`node/${process.versions.node}`),this.properties.common_extname=n.getEditorPluginInfo().name,this.properties.common_extversion=n.getEditorPluginInfo().version,this.properties.common_vscodeversion=(0,G4.formatNameAndVersion)(n.getEditorInfo())}extendWithConfigProperties(e){let r=(0,G4.dumpForTelemetry)(e);r["copilot.build"]=G4.BuildInfo.getBuild(),r["copilot.buildType"]=G4.BuildInfo.getBuildType(),this.properties={...this.properties,...r}}extendWithRequestId(e){let r={headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetry=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromProperties(e,r){if(Zge(e))return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetry.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements);for(let e in this.measurements)isNaN(this.measurements[e])&&delete this.measurements[e]}multiplexProperties(){this.properties=t.multiplexProperties(this.properties)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}static multiplexProperties(e){let r={...e};for(let n in e){let o=e[n],s=o?.length??0;if(s>G5e){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+G5e;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(eNa,"telemetrizePromptLength");function Xge(){return performance.now()}a(Xge,"now");function tNa(t){return Math.floor(t/1e3)}a(tNa,"nowSeconds");function cbr(t){return t.get(obr.ICompletionsTelemetryUserConfigService).optedIn}a(cbr,"shouldSendEnhanced");function Yxi(t){return t.get(obr.ICompletionsTelemetryUserConfigService).ftFlag!==""}a(Yxi,"shouldSendFinetuningTelemetry");function lbr(t,e,r,n){return t.get(sbr.ICompletionsPromiseQueueService).register(rNa(t,e,Xge(),r?.extendedBy(),n))}a(lbr,"telemetry");async function rNa(t,e,r,n,o=rI.Standard){let s=t.get(Ugt.ICompletionsTelemetryService),c=t.get(ibr.IInstantiationService),l=n||$4.createAndMarkAsIssued({},{});await l.makeReadyForSending(t,o??!1,"IncludeExp",r),(!Zge(o)||c.invokeFunction(cbr))&&abr(s,o,e,l),Zge(o)&&KDa.includes(e)&&c.invokeFunction(Yxi)&&c.invokeFunction(XDa,o,e,l)}a(rNa,"_telemetry");function nNa(t,e){return t.get(sbr.ICompletionsPromiseQueueService).register(iNa(t,e,Xge()))}a(nNa,"telemetryExpProblem");async function iNa(t,e,r){let n=t.get(Ugt.ICompletionsTelemetryService),o="expProblem",s=$4.createAndMarkAsIssued(e,{});await s.makeReadyForSending(t,rI.Standard,"SkipExp",r),abr(n,rI.Standard,o,s)}a(iNa,"_telemetryExpProblem");function oNa(t,e,r,n){let o=t.get(Ugt.ICompletionsTelemetryService),s={...r,...Kxi(t)};abr(o,rI.Standard,e,{properties:s,measurements:n})}a(oNa,"telemetryRaw");function Kxi(t){let e=t.get(G4.ICompletionsEditorAndPluginInfo),r={unique_id:(0,$Da.generateUuid)(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:(0,G4.formatNameAndVersion)(e.getEditorInfo())};return{...t.get(obr.ICompletionsTelemetryUserConfigService).getProperties(),...r}}a(Kxi,"createRequiredProperties");function Jxi(t,e,r){return t.sendGHTelemetryException(e,r||"")}a(Jxi,"telemetryException");function sNa(t,e,r,n){let o=a(async(...s)=>{try{await r(...s)}catch(c){Jxi(t,c,n)}},"wrapped");return(...s)=>e.register(o(...s))}a(sNa,"telemetryCatch");function aNa(t,e,r,n){return t.get(sbr.ICompletionsPromiseQueueService).register(cNa(t,e,Xge(),r?.extendedBy(),n))}a(aNa,"telemetryError");async function cNa(t,e,r,n,o=rI.Standard){if(Zge(o)&&!cbr(t))return;let s=t.get(ibr.IInstantiationService),c=n||$4.createAndMarkAsIssued({},{});await c.makeReadyForSending(t,o,"IncludeExp",r),s.invokeFunction(ZDa,o,e,c)}a(cNa,"_telemetryError");function lNa(t,e,r,n,o){let s=$4.createAndMarkAsIssued({completionTextJson:JSON.stringify(e),choiceIndex:o.toString()});if(r.logprobs)for(let[c,l]of Object.entries(r.logprobs))s.properties["logprobs_"+c]=JSON.stringify(l)??"unset";return s.extendWithRequestId(n),lbr(t,"engine.completion",s,rI.Enhanced)}a(lNa,"logEngineCompletion");function uNa(t,e,r){let n={promptJson:JSON.stringify({prefix:e.prefix,context:e.context}),promptSuffixJson:JSON.stringify(e.suffix)};if(e.context){let s=r.properties["request.option.extra"]?JSON.parse(r.properties["request.option.extra"]):{};s.context=e.context,n["request.option.extra"]=JSON.stringify(s)}let o=r.extendedBy(n);return lbr(t,"engine.prompt",o,rI.Enhanced)}a(uNa,"logEnginePrompt");var rbr=class{static{a(this,"CopilotTelemetryReporter")}};bd.CopilotTelemetryReporter=rbr;bd.ICompletionsTelemetryReporters=(0,GDa.createServiceIdentifier)("ICompletionsTelemetryReporters");var nbr=class{static{a(this,"TelemetryReporters")}getReporter(e,r=rI.Standard){return Zge(r)?this.getEnhancedReporter(e):this.reporter}getEnhancedReporter(e){if(cbr(e))return this.reporterEnhanced}getFTReporter(e){}setReporter(e){this.reporter=e}setEnhancedReporter(e){this.reporterEnhanced=e}setFTReporter(e){this.reporterFT=e}async deactivate(){let e=[this.reporter,this.reporterEnhanced,this.reporterFT];this.reporter=this.reporterEnhanced=this.reporterFT=void 0,await Promise.all(e.map(r=>r?.dispose()))}};bd.TelemetryReporters=nbr});var Dte=I(ED=>{"use strict";p();var dNa=ED&&ED.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},fNa=ED&&ED.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(ED,"__esModule",{value:!0});ED.CompletionsTelemetryServiceBridge=ED.ICompletionsTelemetryService=void 0;var pNa=vm(),ubr=ECr(),hNa=nn(),$5e=Yg();ED.ICompletionsTelemetryService=(0,hNa.createServiceIdentifier)("completionsTelemetryService");var dbr=class{static{a(this,"CompletionsTelemetryServiceBridge")}constructor(e){this.telemetryService=e,this.reporter=void 0,this.enhancedReporter=void 0}sendGHTelemetryEvent(e,r,n,o){this.telemetryService.sendGHTelemetryEvent((0,ubr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??$5e.TelemetryStore.Standard)?.sendTelemetryEvent(e,r,n)}sendEnhancedGHTelemetryEvent(e,r,n,o){this.telemetryService.sendEnhancedGHTelemetryEvent((0,ubr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??$5e.TelemetryStore.Enhanced)?.sendTelemetryEvent(e,r,n)}sendGHTelemetryErrorEvent(e,r,n,o){this.telemetryService.sendGHTelemetryErrorEvent((0,ubr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??$5e.TelemetryStore.Enhanced)?.sendTelemetryErrorEvent(e,r,n)}sendGHTelemetryException(e,r,n){this.telemetryService.sendGHTelemetryException(e,r),e instanceof Error&&this.getSpyReporters(n??$5e.TelemetryStore.Enhanced)?.sendTelemetryException(e,void 0,void 0)}setSpyReporters(e,r){this.reporter=e,this.enhancedReporter=r}clearSpyReporters(){this.reporter=void 0,this.enhancedReporter=void 0}getSpyReporters(e){return $5e.TelemetryStore.isEnhanced(e)?this.enhancedReporter:this.reporter}};ED.CompletionsTelemetryServiceBridge=dbr;ED.CompletionsTelemetryServiceBridge=dbr=dNa([fNa(0,pNa.ITelemetryService)],dbr)});var Zxi=I(eAe=>{"use strict";p();Object.defineProperty(eAe,"__esModule",{value:!0});eAe.CopilotExtensionStatus=eAe.ICompletionsExtensionStatus=void 0;var mNa=nn();eAe.ICompletionsExtensionStatus=(0,mNa.createServiceIdentifier)("ICompletionsExtensionStatus");var fbr=class{static{a(this,"CopilotExtensionStatus")}constructor(e="Normal",r,n=!1,o){this.kind=e,this.message=r,this.busy=n,this.command=o}};eAe.CopilotExtensionStatus=fbr});var Qgt=I(_D=>{"use strict";p();Object.defineProperty(_D,"__esModule",{value:!0});_D.CopilotToken=void 0;_D.containsInternalOrg=Xxi;_D.containsVSCodeOrg=rwi;_D.validateTokenEnvelope=nwi;_D.isTokenEnvelope=vNa;_D.isErrorEnvelope=CNa;_D.isStandardErrorEnvelope=bNa;_D.createTestExtendedTokenInfo=SNa;var Qn=jG();function Xxi(t){return ewi(t)||twi(t)}a(Xxi,"containsInternalOrg");function ewi(t){let e=["4535c7beffc844b46bb1ed4aa04d759a"];for(let r of t)if(e.includes(r))return!0;return!1}a(ewi,"containsGitHubOrg");function twi(t){let e=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"];for(let r of t)if(e.includes(r))return!0;return!1}a(twi,"containsMicrosoftOrg");function rwi(t){let e=["551cca60ce19654d894e786220822482"];for(let r of t)if(e.includes(r))return!0;return!1}a(rwi,"containsVSCodeOrg");var pbr=class{static{a(this,"CopilotToken")}constructor(e){this._info=e,this.tokenMap=this.parseToken(e.token)}parseToken(e){let r=new Map,o=e?.split(":")[0]?.split(";");for(let s of o){let[c,l]=s.split("=");r.set(c,l)}return r}get token(){return this._info.token}get sku(){return this._info.sku}get isIndividual(){return this._info.individual??!1}get organizationList(){return this._info.organization_list||[]}get organizationLoginList(){return this._info.organization_login_list||[]}get enterpriseList(){return this._info.enterprise_list||[]}get endpoints(){return this._info.endpoints}get isInternal(){return Xxi(this.organizationList)}get isMicrosoftInternal(){return twi(this.organizationList)}get isGitHubInternal(){return ewi(this.organizationList)}get isFreeUser(){return this.sku==="free_limited_copilot"}get isNoAuthUser(){return this.sku==="no_auth_limited_copilot"}get isManagedPlan(){let e=this.copilotPlan;return e==="business"||e==="enterprise"}get isUsageBasedBilling(){return this._info.token_based_billing===!0}get isChatQuotaExceeded(){return this.isFreeUser&&(this._info.limited_user_quotas?.chat??1)<=0}get isCompletionsQuotaExceeded(){return this.isFreeUser&&(this._info.limited_user_quotas?.completions??1)<=0}get codeQuoteEnabled(){return this._info.code_quote_enabled??!1}get isVscodeTeamMember(){return this._info.isVscodeTeamMember||rwi(this.organizationList)}get codexAgentEnabled(){return this._info.codex_agent_enabled??!1}get copilotPlan(){if(this.isFreeUser)return"free";let e=this._info.copilot_plan;switch(e){case"individual":case"individual_pro":case"individual_max":case"business":case"enterprise":return e;default:return"individual"}}get rawCopilotPlan(){return this.isFreeUser?"free":this._info.copilot_plan??"individual"}get quotaInfo(){return{quota_snapshots:this._info.quota_snapshots,quota_reset_date:this._info.quota_reset_date}}get tokenBasedBilling(){return this._info.token_based_billing}get username(){return this._info.username}isTelemetryEnabled(){return this._isTelemetryEnabled===void 0&&(this._isTelemetryEnabled=this._info.telemetry==="enabled"),this._isTelemetryEnabled}isPublicSuggestionsEnabled(){return this._isPublicSuggestionsEnabled===void 0&&(this._isPublicSuggestionsEnabled=this._info.public_suggestions==="enabled"),this._isPublicSuggestionsEnabled}isCopilotIgnoreEnabled(){return this._info.copilotignore_enabled??!1}get isCopilotCodeReviewEnabled(){return this._info.code_review_enabled??this.getTokenValue("ccr")==="1"}isEditorPreviewFeaturesEnabled(){return this.getTokenValue("editor_preview_features")!=="0"}isBlackbirdExternalIndexingEnabled(){return this.getTokenValue("blackbird_external_indexing")==="1"}isMcpEnabled(){return this.getTokenValue("mcp")!=="0"}isClientBYOKEnabled(){return this.getTokenValue("client_byok")==="1"}getTokenValue(e){return this.tokenMap.get(e)}isExpandedClientSideIndexingEnabled(){return this._info.blackbird_clientside_indexing===!0}isFcv1(){return this.tokenMap.get("fcv1")==="1"}isSn(){return this.tokenMap.get("sn")==="1"}};_D.CopilotToken=pbr;var gNa=(0,Qn.vObj)({message:(0,Qn.vRequired)((0,Qn.vString)()),notification_id:(0,Qn.vRequired)((0,Qn.vString)()),title:(0,Qn.vRequired)((0,Qn.vString)()),url:(0,Qn.vRequired)((0,Qn.vString)())}),ANa=(0,Qn.vObj)({can_signup_for_limited:(0,Qn.vNullable)((0,Qn.vBoolean)()),error_details:(0,Qn.vRequired)(gNa),message:(0,Qn.vRequired)((0,Qn.vString)()),reason:(0,Qn.vString)()}),yNa=(0,Qn.vObj)({token:(0,Qn.vRequired)((0,Qn.vString)()),expires_at:(0,Qn.vRequired)((0,Qn.vNumber)()),refresh_in:(0,Qn.vRequired)((0,Qn.vNumber)()),sku:(0,Qn.vString)(),individual:(0,Qn.vBoolean)(),blackbird_clientside_indexing:(0,Qn.vBoolean)(),code_quote_enabled:(0,Qn.vBoolean)(),code_review_enabled:(0,Qn.vBoolean)(),codesearch:(0,Qn.vBoolean)(),copilotignore_enabled:(0,Qn.vBoolean)(),public_suggestions:(0,Qn.vEnum)("enabled","disabled","unconfigured"),telemetry:(0,Qn.vEnum)("enabled","disabled"),endpoints:(0,Qn.vObj)({api:(0,Qn.vString)(),"origin-tracker":(0,Qn.vString)(),proxy:(0,Qn.vString)(),telemetry:(0,Qn.vString)()}),enterprise_list:(0,Qn.vNullable)((0,Qn.vArray)((0,Qn.vNumber)())),limited_user_quotas:(0,Qn.vNullable)((0,Qn.vObj)({chat:(0,Qn.vRequired)((0,Qn.vNumber)()),completions:(0,Qn.vRequired)((0,Qn.vNumber)())})),limited_user_reset_date:(0,Qn.vNullable)((0,Qn.vNumber)()),organization_list:(0,Qn.vArray)((0,Qn.vString)())}),ENa=(0,Qn.vObj)({message:(0,Qn.vRequired)((0,Qn.vString)()),documentation_url:(0,Qn.vRequired)((0,Qn.vString)()),status:(0,Qn.vRequired)((0,Qn.vString)())}),_Na=(0,Qn.vObj)({token:(0,Qn.vRequired)((0,Qn.vString)()),expires_at:(0,Qn.vRequired)((0,Qn.vNumber)()),refresh_in:(0,Qn.vRequired)((0,Qn.vNumber)())});function nwi(t){let e=yNa.validate(t);if(e.error===void 0)return{valid:!0,strategy:"strict",envelope:e.content};let r=e.error.message,n=_Na.validate(t);return n.error===void 0?{valid:!0,strategy:"fallback",strictError:r,envelope:t}:{valid:!1,strategy:"failed",strictError:r,fallbackError:n.error.message}}a(nwi,"validateTokenEnvelope");function vNa(t){return nwi(t).valid}a(vNa,"isTokenEnvelope");function CNa(t){return ANa.validate(t).error===void 0}a(CNa,"isErrorEnvelope");function bNa(t){return ENa.validate(t).error===void 0}a(bNa,"isStandardErrorEnvelope");function SNa(t){return{token:"test-token",expires_at:0,refresh_in:0,sku:"free_limited_copilot",individual:!0,blackbird_clientside_indexing:!1,code_quote_enabled:!1,code_review_enabled:!1,codesearch:!1,copilotignore_enabled:!1,public_suggestions:"enabled",telemetry:"enabled",username:"testuser",isVscodeTeamMember:!1,copilot_plan:"free",organization_login_list:[],...t}}a(SNa,"createTestExtendedTokenInfo")});var tAe=I(nI=>{"use strict";p();var TNa=nI&&nI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},INa=nI&&nI.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(nI,"__esModule",{value:!0});nI.CopilotTokenManagerImpl=nI.ICompletionsCopilotTokenManager=nI.CopilotToken=void 0;var xNa=HE(),wNa=nn(),RNa=nl(),kNa=Ro(),PNa=Qgt();Object.defineProperty(nI,"CopilotToken",{enumerable:!0,get:a(function(){return PNa.CopilotToken},"get")});nI.ICompletionsCopilotTokenManager=(0,wNa.createServiceIdentifier)("ICompletionsCopilotTokenManager");var hbr=class extends kNa.Disposable{static{a(this,"CopilotTokenManagerImpl")}get token(){return this.tokenRefetcher.trigger(()=>this.updateCachedToken()),this._token}constructor(e=!1,r){super(),this.primed=e,this.authenticationService=r,this.tokenRefetcher=new RNa.ThrottledDelayer(5e3),this.updateCachedToken(),this._register(this.authenticationService.onDidCopilotTokenChange(()=>this.updateCachedToken()))}primeToken(){try{return this.getToken().then(()=>!0,()=>!1)}catch{return Promise.resolve(!1)}}async getToken(){return this.updateCachedToken()}async updateCachedToken(){return this._token=await this.authenticationService.getCopilotToken(),this._token}resetToken(e){this.authenticationService.resetCopilotToken()}getLastToken(){return this.authenticationService.copilotToken}};nI.CopilotTokenManagerImpl=hbr;nI.CopilotTokenManagerImpl=hbr=TNa([INa(1,xNa.IAuthenticationService)],hbr)});var qgt=I(rAe=>{"use strict";p();Object.defineProperty(rAe,"__esModule",{value:!0});rAe.NoOpCitationManager=rAe.ICompletionsCitationManager=void 0;var DNa=nn(),NNa=Ro();rAe.ICompletionsCitationManager=(0,DNa.createServiceIdentifier)("ICompletionsCitationManager");var mbr=class{static{a(this,"NoOpCitationManager")}register(){return NNa.Disposable.None}async handleIPCodeCitation(e){}};rAe.NoOpCitationManager=mbr});var Rv=I(Jg=>{"use strict";p();Object.defineProperty(Jg,"__esModule",{value:!0});Jg.HasPropertyKey=MNa;Jg.IsAsyncIterator=ONa;Jg.IsArray=gbr;Jg.IsBigInt=LNa;Jg.IsBoolean=BNa;Jg.IsDate=FNa;Jg.IsFunction=UNa;Jg.IsIterator=QNa;Jg.IsNull=qNa;Jg.IsNumber=jNa;Jg.IsObject=Abr;Jg.IsRegExp=HNa;Jg.IsString=GNa;Jg.IsSymbol=$Na;Jg.IsUint8Array=ybr;Jg.IsUndefined=VNa;function MNa(t,e){return e in t}a(MNa,"HasPropertyKey");function ONa(t){return Abr(t)&&!gbr(t)&&!ybr(t)&&Symbol.asyncIterator in t}a(ONa,"IsAsyncIterator");function gbr(t){return Array.isArray(t)}a(gbr,"IsArray");function LNa(t){return typeof t=="bigint"}a(LNa,"IsBigInt");function BNa(t){return typeof t=="boolean"}a(BNa,"IsBoolean");function FNa(t){return t instanceof globalThis.Date}a(FNa,"IsDate");function UNa(t){return typeof t=="function"}a(UNa,"IsFunction");function QNa(t){return Abr(t)&&!gbr(t)&&!ybr(t)&&Symbol.iterator in t}a(QNa,"IsIterator");function qNa(t){return t===null}a(qNa,"IsNull");function jNa(t){return typeof t=="number"}a(jNa,"IsNumber");function Abr(t){return typeof t=="object"&&t!==null}a(Abr,"IsObject");function HNa(t){return t instanceof globalThis.RegExp}a(HNa,"IsRegExp");function GNa(t){return typeof t=="string"}a(GNa,"IsString");function $Na(t){return typeof t=="symbol"}a($Na,"IsSymbol");function ybr(t){return t instanceof globalThis.Uint8Array}a(ybr,"IsUint8Array");function VNa(t){return t===void 0}a(VNa,"IsUndefined")});var Zb=I(d6=>{"use strict";p();var WNa=d6&&d6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zNa=d6&&d6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),YNa=d6&&d6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ojgt(e))}a(KNa,"ArrayType");function JNa(t){return new Date(t.getTime())}a(JNa,"DateType");function ZNa(t){return new Uint8Array(t)}a(ZNa,"Uint8ArrayType");function XNa(t){return new RegExp(t.source,t.flags)}a(XNa,"RegExpType");function eMa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=jgt(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=jgt(t[r]);return e}a(eMa,"ObjectType");function jgt(t){return V5e.IsArray(t)?KNa(t):V5e.IsDate(t)?JNa(t):V5e.IsUint8Array(t)?ZNa(t):V5e.IsRegExp(t)?XNa(t):V5e.IsObject(t)?eMa(t):t}a(jgt,"Visit");function tMa(t){return jgt(t)}a(tMa,"Clone")});var Ggt=I(Hgt=>{"use strict";p();Object.defineProperty(Hgt,"__esModule",{value:!0});Hgt.CloneRest=rMa;Hgt.CloneType=owi;var iwi=Zb();function rMa(t){return t.map(e=>owi(e))}a(rMa,"CloneRest");function owi(t,e){return e===void 0?(0,iwi.Clone)(t):(0,iwi.Clone)({...e,...t})}a(owi,"CloneType")});var Ebr=I(WG=>{"use strict";p();var nMa=WG&&WG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),swi=WG&&WG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nMa(e,t,r)};Object.defineProperty(WG,"__esModule",{value:!0});swi(Ggt(),WG);swi(Zb(),WG)});var $gt=I(ya=>{"use strict";p();Object.defineProperty(ya,"__esModule",{value:!0});ya.IsAsyncIterator=iMa;ya.IsIterator=oMa;ya.IsStandardObject=sMa;ya.IsInstanceObject=aMa;ya.IsPromise=cMa;ya.IsDate=lMa;ya.IsMap=uMa;ya.IsSet=dMa;ya.IsRegExp=fMa;ya.IsTypedArray=pMa;ya.IsInt8Array=hMa;ya.IsUint8Array=mMa;ya.IsUint8ClampedArray=gMa;ya.IsInt16Array=AMa;ya.IsUint16Array=yMa;ya.IsInt32Array=EMa;ya.IsUint32Array=_Ma;ya.IsFloat32Array=vMa;ya.IsFloat64Array=CMa;ya.IsBigInt64Array=bMa;ya.IsBigUint64Array=SMa;ya.HasPropertyKey=TMa;ya.IsObject=W5e;ya.IsArray=awi;ya.IsUndefined=cwi;ya.IsNull=lwi;ya.IsBoolean=uwi;ya.IsNumber=dwi;ya.IsInteger=IMa;ya.IsBigInt=fwi;ya.IsString=pwi;ya.IsFunction=hwi;ya.IsSymbol=mwi;ya.IsValueType=xMa;function iMa(t){return W5e(t)&&globalThis.Symbol.asyncIterator in t}a(iMa,"IsAsyncIterator");function oMa(t){return W5e(t)&&globalThis.Symbol.iterator in t}a(oMa,"IsIterator");function sMa(t){return W5e(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(sMa,"IsStandardObject");function aMa(t){return W5e(t)&&!awi(t)&&hwi(t.constructor)&&t.constructor.name!=="Object"}a(aMa,"IsInstanceObject");function cMa(t){return t instanceof globalThis.Promise}a(cMa,"IsPromise");function lMa(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(lMa,"IsDate");function uMa(t){return t instanceof globalThis.Map}a(uMa,"IsMap");function dMa(t){return t instanceof globalThis.Set}a(dMa,"IsSet");function fMa(t){return t instanceof globalThis.RegExp}a(fMa,"IsRegExp");function pMa(t){return globalThis.ArrayBuffer.isView(t)}a(pMa,"IsTypedArray");function hMa(t){return t instanceof globalThis.Int8Array}a(hMa,"IsInt8Array");function mMa(t){return t instanceof globalThis.Uint8Array}a(mMa,"IsUint8Array");function gMa(t){return t instanceof globalThis.Uint8ClampedArray}a(gMa,"IsUint8ClampedArray");function AMa(t){return t instanceof globalThis.Int16Array}a(AMa,"IsInt16Array");function yMa(t){return t instanceof globalThis.Uint16Array}a(yMa,"IsUint16Array");function EMa(t){return t instanceof globalThis.Int32Array}a(EMa,"IsInt32Array");function _Ma(t){return t instanceof globalThis.Uint32Array}a(_Ma,"IsUint32Array");function vMa(t){return t instanceof globalThis.Float32Array}a(vMa,"IsFloat32Array");function CMa(t){return t instanceof globalThis.Float64Array}a(CMa,"IsFloat64Array");function bMa(t){return t instanceof globalThis.BigInt64Array}a(bMa,"IsBigInt64Array");function SMa(t){return t instanceof globalThis.BigUint64Array}a(SMa,"IsBigUint64Array");function TMa(t,e){return e in t}a(TMa,"HasPropertyKey");function W5e(t){return t!==null&&typeof t=="object"}a(W5e,"IsObject");function awi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(awi,"IsArray");function cwi(t){return t===void 0}a(cwi,"IsUndefined");function lwi(t){return t===null}a(lwi,"IsNull");function uwi(t){return typeof t=="boolean"}a(uwi,"IsBoolean");function dwi(t){return typeof t=="number"}a(dwi,"IsNumber");function IMa(t){return globalThis.Number.isInteger(t)}a(IMa,"IsInteger");function fwi(t){return typeof t=="bigint"}a(fwi,"IsBigInt");function pwi(t){return typeof t=="string"}a(pwi,"IsString");function hwi(t){return typeof t=="function"}a(hwi,"IsFunction");function mwi(t){return typeof t=="symbol"}a(mwi,"IsSymbol");function xMa(t){return fwi(t)||uwi(t)||lwi(t)||dwi(t)||pwi(t)||mwi(t)||cwi(t)}a(xMa,"IsValueType")});var P0=I(Nte=>{"use strict";p();var wMa=Nte&&Nte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),RMa=Nte&&Nte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wMa(e,t,r)};Object.defineProperty(Nte,"__esModule",{value:!0});RMa($gt(),Nte)});var z5e=I(Wgt=>{"use strict";p();Object.defineProperty(Wgt,"__esModule",{value:!0});Wgt.TypeSystemPolicy=void 0;var Vgt=P0(),gwi;(function(t){t.InstanceMode="default",t.ExactOptionalPropertyTypes=!1,t.AllowArrayObject=!1,t.AllowNaN=!1,t.AllowNullVoid=!1;function e(c,l){return t.ExactOptionalPropertyTypes?l in c:c[l]!==void 0}a(e,"IsExactOptionalProperty"),t.IsExactOptionalProperty=e;function r(c){let l=(0,Vgt.IsObject)(c);return t.AllowArrayObject?l:l&&!(0,Vgt.IsArray)(c)}a(r,"IsObjectLike"),t.IsObjectLike=r;function n(c){return r(c)&&!(c instanceof Date)&&!(c instanceof Uint8Array)}a(n,"IsRecordLike"),t.IsRecordLike=n;function o(c){return t.AllowNaN?(0,Vgt.IsNumber)(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=(0,Vgt.IsUndefined)(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(gwi||(Wgt.TypeSystemPolicy=gwi={}))});var Awi=I(f6=>{"use strict";p();var kMa=f6&&f6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),PMa=f6&&f6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),DMa=f6&&f6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ozgt(e))}a(NMa,"ImmutableArray");function MMa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=zgt(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=zgt(t[r]);return globalThis.Object.freeze(e)}a(MMa,"ImmutableObject");function zgt(t){return Y5e.IsArray(t)?NMa(t):Y5e.IsDate(t)?t:Y5e.IsUint8Array(t)?t:Y5e.IsRegExp(t)?t:Y5e.IsObject(t)?MMa(t):t}a(zgt,"Immutable")});var Ii=I(_br=>{"use strict";p();Object.defineProperty(_br,"__esModule",{value:!0});_br.CreateType=FMa;var OMa=z5e(),LMa=Awi(),BMa=Zb();function FMa(t,e){let r=e!==void 0?{...e,...t}:t;switch(OMa.TypeSystemPolicy.InstanceMode){case"freeze":return(0,LMa.Immutable)(r);case"clone":return(0,BMa.Clone)(r);default:return r}}a(FMa,"CreateType")});var p6=I(Mte=>{"use strict";p();var UMa=Mte&&Mte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),QMa=Mte&&Mte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UMa(e,t,r)};Object.defineProperty(Mte,"__esModule",{value:!0});QMa(Ii(),Mte)});var Cbr=I(Ygt=>{"use strict";p();Object.defineProperty(Ygt,"__esModule",{value:!0});Ygt.TypeBoxError=void 0;var vbr=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};Ygt.TypeBoxError=vbr});var Ff=I(Ote=>{"use strict";p();var qMa=Ote&&Ote.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jMa=Ote&&Ote.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qMa(e,t,r)};Object.defineProperty(Ote,"__esModule",{value:!0});jMa(Cbr(),Ote)});var K5e=I(OR=>{"use strict";p();Object.defineProperty(OR,"__esModule",{value:!0});OR.Kind=OR.Hint=OR.OptionalKind=OR.ReadonlyKind=OR.TransformKind=void 0;OR.TransformKind=Symbol.for("TypeBox.Transform");OR.ReadonlyKind=Symbol.for("TypeBox.Readonly");OR.OptionalKind=Symbol.for("TypeBox.Optional");OR.Hint=Symbol.for("TypeBox.Hint");OR.Kind=Symbol.for("TypeBox.Kind")});var bn=I(Lte=>{"use strict";p();var HMa=Lte&&Lte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),GMa=Lte&&Lte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&HMa(e,t,r)};Object.defineProperty(Lte,"__esModule",{value:!0});GMa(K5e(),Lte)});var Es=I(li=>{"use strict";p();var $Ma=li&&li.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),VMa=li&&li.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),WMa=li&&li.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var oOa=Yn&&Yn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sOa=Yn&&Yn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),aOa=Yn&&Yn.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=7&&r<=13||r===27||r===127)return!1}return!0}a(Sbr,"IsControlCharacterFree");function tRi(t){return Tbr(t)||Zg(t)}a(tRi,"IsAdditionalProperties");function Z5e(t){return oi.IsUndefined(t)||oi.IsBigInt(t)}a(Z5e,"IsOptionalBigInt");function Xl(t){return oi.IsUndefined(t)||oi.IsNumber(t)}a(Xl,"IsOptionalNumber");function Tbr(t){return oi.IsUndefined(t)||oi.IsBoolean(t)}a(Tbr,"IsOptionalBoolean");function hl(t){return oi.IsUndefined(t)||oi.IsString(t)}a(hl,"IsOptionalString");function uOa(t){return oi.IsUndefined(t)||oi.IsString(t)&&Sbr(t)&&eRi(t)}a(uOa,"IsOptionalPattern");function dOa(t){return oi.IsUndefined(t)||oi.IsString(t)&&Sbr(t)}a(dOa,"IsOptionalFormat");function rRi(t){return oi.IsUndefined(t)||Zg(t)}a(rRi,"IsOptionalSchema");function fOa(t){return oi.IsObject(t)&&t[V4.ReadonlyKind]==="Readonly"}a(fOa,"IsReadonly");function pOa(t){return oi.IsObject(t)&&t[V4.OptionalKind]==="Optional"}a(pOa,"IsOptional");function nRi(t){return Ws(t,"Any")&&hl(t.$id)}a(nRi,"IsAny");function iRi(t){return Ws(t,"Argument")&&oi.IsNumber(t.index)}a(iRi,"IsArgument");function oRi(t){return Ws(t,"Array")&&t.type==="array"&&hl(t.$id)&&Zg(t.items)&&Xl(t.minItems)&&Xl(t.maxItems)&&Tbr(t.uniqueItems)&&rRi(t.contains)&&Xl(t.minContains)&&Xl(t.maxContains)}a(oRi,"IsArray");function sRi(t){return Ws(t,"AsyncIterator")&&t.type==="AsyncIterator"&&hl(t.$id)&&Zg(t.items)}a(sRi,"IsAsyncIterator");function aRi(t){return Ws(t,"BigInt")&&t.type==="bigint"&&hl(t.$id)&&Z5e(t.exclusiveMaximum)&&Z5e(t.exclusiveMinimum)&&Z5e(t.maximum)&&Z5e(t.minimum)&&Z5e(t.multipleOf)}a(aRi,"IsBigInt");function cRi(t){return Ws(t,"Boolean")&&t.type==="boolean"&&hl(t.$id)}a(cRi,"IsBoolean");function lRi(t){return Ws(t,"Computed")&&oi.IsString(t.target)&&oi.IsArray(t.parameters)&&t.parameters.every(e=>Zg(e))}a(lRi,"IsComputed");function uRi(t){return Ws(t,"Constructor")&&t.type==="Constructor"&&hl(t.$id)&&oi.IsArray(t.parameters)&&t.parameters.every(e=>Zg(e))&&Zg(t.returns)}a(uRi,"IsConstructor");function dRi(t){return Ws(t,"Date")&&t.type==="Date"&&hl(t.$id)&&Xl(t.exclusiveMaximumTimestamp)&&Xl(t.exclusiveMinimumTimestamp)&&Xl(t.maximumTimestamp)&&Xl(t.minimumTimestamp)&&Xl(t.multipleOfTimestamp)}a(dRi,"IsDate");function fRi(t){return Ws(t,"Function")&&t.type==="Function"&&hl(t.$id)&&oi.IsArray(t.parameters)&&t.parameters.every(e=>Zg(e))&&Zg(t.returns)}a(fRi,"IsFunction");function hOa(t){return Ws(t,"Import")&&oi.HasPropertyKey(t,"$defs")&&oi.IsObject(t.$defs)&&Kgt(t.$defs)&&oi.HasPropertyKey(t,"$ref")&&oi.IsString(t.$ref)&&t.$ref in t.$defs}a(hOa,"IsImport");function pRi(t){return Ws(t,"Integer")&&t.type==="integer"&&hl(t.$id)&&Xl(t.exclusiveMaximum)&&Xl(t.exclusiveMinimum)&&Xl(t.maximum)&&Xl(t.minimum)&&Xl(t.multipleOf)}a(pRi,"IsInteger");function Kgt(t){return oi.IsObject(t)&&Object.entries(t).every(([e,r])=>Sbr(e)&&Zg(r))}a(Kgt,"IsProperties");function hRi(t){return Ws(t,"Intersect")&&!(oi.IsString(t.type)&&t.type!=="object")&&oi.IsArray(t.allOf)&&t.allOf.every(e=>Zg(e)&&!MRi(e))&&hl(t.type)&&(Tbr(t.unevaluatedProperties)||rRi(t.unevaluatedProperties))&&hl(t.$id)}a(hRi,"IsIntersect");function mRi(t){return Ws(t,"Iterator")&&t.type==="Iterator"&&hl(t.$id)&&Zg(t.items)}a(mRi,"IsIterator");function Ws(t,e){return oi.IsObject(t)&&V4.Kind in t&&t[V4.Kind]===e}a(Ws,"IsKindOf");function gRi(t){return X5e(t)&&oi.IsString(t.const)}a(gRi,"IsLiteralString");function ARi(t){return X5e(t)&&oi.IsNumber(t.const)}a(ARi,"IsLiteralNumber");function mOa(t){return X5e(t)&&oi.IsBoolean(t.const)}a(mOa,"IsLiteralBoolean");function X5e(t){return Ws(t,"Literal")&&hl(t.$id)&&yRi(t.const)}a(X5e,"IsLiteral");function yRi(t){return oi.IsBoolean(t)||oi.IsNumber(t)||oi.IsString(t)}a(yRi,"IsLiteralValue");function ERi(t){return Ws(t,"MappedKey")&&oi.IsArray(t.keys)&&t.keys.every(e=>oi.IsNumber(e)||oi.IsString(e))}a(ERi,"IsMappedKey");function _Ri(t){return Ws(t,"MappedResult")&&Kgt(t.properties)}a(_Ri,"IsMappedResult");function vRi(t){return Ws(t,"Never")&&oi.IsObject(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(vRi,"IsNever");function CRi(t){return Ws(t,"Not")&&Zg(t.not)}a(CRi,"IsNot");function bRi(t){return Ws(t,"Null")&&t.type==="null"&&hl(t.$id)}a(bRi,"IsNull");function SRi(t){return Ws(t,"Number")&&t.type==="number"&&hl(t.$id)&&Xl(t.exclusiveMaximum)&&Xl(t.exclusiveMinimum)&&Xl(t.maximum)&&Xl(t.minimum)&&Xl(t.multipleOf)}a(SRi,"IsNumber");function TRi(t){return Ws(t,"Object")&&t.type==="object"&&hl(t.$id)&&Kgt(t.properties)&&tRi(t.additionalProperties)&&Xl(t.minProperties)&&Xl(t.maxProperties)}a(TRi,"IsObject");function IRi(t){return Ws(t,"Promise")&&t.type==="Promise"&&hl(t.$id)&&Zg(t.item)}a(IRi,"IsPromise");function xRi(t){return Ws(t,"Record")&&t.type==="object"&&hl(t.$id)&&tRi(t.additionalProperties)&&oi.IsObject(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&eRi(r[0])&&oi.IsObject(e.patternProperties)&&Zg(e.patternProperties[r[0]])})(t)}a(xRi,"IsRecord");function gOa(t){return oi.IsObject(t)&&V4.Hint in t&&t[V4.Hint]==="Recursive"}a(gOa,"IsRecursive");function wRi(t){return Ws(t,"Ref")&&hl(t.$id)&&oi.IsString(t.$ref)}a(wRi,"IsRef");function RRi(t){return Ws(t,"RegExp")&&hl(t.$id)&&oi.IsString(t.source)&&oi.IsString(t.flags)&&Xl(t.maxLength)&&Xl(t.minLength)}a(RRi,"IsRegExp");function kRi(t){return Ws(t,"String")&&t.type==="string"&&hl(t.$id)&&Xl(t.minLength)&&Xl(t.maxLength)&&uOa(t.pattern)&&dOa(t.format)}a(kRi,"IsString");function PRi(t){return Ws(t,"Symbol")&&t.type==="symbol"&&hl(t.$id)}a(PRi,"IsSymbol");function DRi(t){return Ws(t,"TemplateLiteral")&&t.type==="string"&&oi.IsString(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(DRi,"IsTemplateLiteral");function NRi(t){return Ws(t,"This")&&hl(t.$id)&&oi.IsString(t.$ref)}a(NRi,"IsThis");function MRi(t){return oi.IsObject(t)&&V4.TransformKind in t}a(MRi,"IsTransform");function ORi(t){return Ws(t,"Tuple")&&t.type==="array"&&hl(t.$id)&&oi.IsNumber(t.minItems)&&oi.IsNumber(t.maxItems)&&t.minItems===t.maxItems&&(oi.IsUndefined(t.items)&&oi.IsUndefined(t.additionalItems)&&t.minItems===0||oi.IsArray(t.items)&&t.items.every(e=>Zg(e)))}a(ORi,"IsTuple");function LRi(t){return Ws(t,"Undefined")&&t.type==="undefined"&&hl(t.$id)}a(LRi,"IsUndefined");function AOa(t){return Ibr(t)&&t.anyOf.every(e=>gRi(e)||ARi(e))}a(AOa,"IsUnionLiteral");function Ibr(t){return Ws(t,"Union")&&hl(t.$id)&&oi.IsObject(t)&&oi.IsArray(t.anyOf)&&t.anyOf.every(e=>Zg(e))}a(Ibr,"IsUnion");function BRi(t){return Ws(t,"Uint8Array")&&t.type==="Uint8Array"&&hl(t.$id)&&Xl(t.minByteLength)&&Xl(t.maxByteLength)}a(BRi,"IsUint8Array");function FRi(t){return Ws(t,"Unknown")&&hl(t.$id)}a(FRi,"IsUnknown");function URi(t){return Ws(t,"Unsafe")}a(URi,"IsUnsafe");function QRi(t){return Ws(t,"Void")&&t.type==="void"&&hl(t.$id)}a(QRi,"IsVoid");function qRi(t){return oi.IsObject(t)&&V4.Kind in t&&oi.IsString(t[V4.Kind])&&!lOa.includes(t[V4.Kind])}a(qRi,"IsKind");function Zg(t){return oi.IsObject(t)&&(nRi(t)||iRi(t)||oRi(t)||cRi(t)||aRi(t)||sRi(t)||lRi(t)||uRi(t)||dRi(t)||fRi(t)||pRi(t)||hRi(t)||mRi(t)||X5e(t)||ERi(t)||_Ri(t)||vRi(t)||CRi(t)||bRi(t)||SRi(t)||TRi(t)||IRi(t)||xRi(t)||wRi(t)||RRi(t)||kRi(t)||PRi(t)||DRi(t)||NRi(t)||ORi(t)||LRi(t)||Ibr(t)||BRi(t)||FRi(t)||URi(t)||QRi(t)||qRi(t))}a(Zg,"IsSchema")});var wbr=I(e1=>{"use strict";p();var yOa=e1&&e1.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),EOa=e1&&e1.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xbr=e1&&e1.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(Rbr,"__esModule",{value:!0});Rbr.Increment=_Oa;function _Oa(t){return(parseInt(t)+1).toString()}a(_Oa,"Increment")});var GRi=I(Bte=>{"use strict";p();var vOa=Bte&&Bte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),COa=Bte&&Bte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vOa(e,t,r)};Object.defineProperty(Bte,"__esModule",{value:!0});COa(HRi(),Bte)});var $Ri=I(wp=>{"use strict";p();Object.defineProperty(wp,"__esModule",{value:!0});wp.PatternNeverExact=wp.PatternStringExact=wp.PatternNumberExact=wp.PatternBooleanExact=wp.PatternNever=wp.PatternString=wp.PatternNumber=wp.PatternBoolean=void 0;wp.PatternBoolean="(true|false)";wp.PatternNumber="(0|[1-9][0-9]*)";wp.PatternString="(.*)";wp.PatternNever="(?!.*)";wp.PatternBooleanExact=`^${wp.PatternBoolean}$`;wp.PatternNumberExact=`^${wp.PatternNumber}$`;wp.PatternStringExact=`^${wp.PatternString}$`;wp.PatternNeverExact=`^${wp.PatternNever}$`});var e4e=I(Fte=>{"use strict";p();var bOa=Fte&&Fte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SOa=Fte&&Fte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bOa(e,t,r)};Object.defineProperty(Fte,"__esModule",{value:!0});SOa($Ri(),Fte)});var VRi=I(zG=>{"use strict";p();Object.defineProperty(zG,"__esModule",{value:!0});zG.Entries=TOa;zG.Clear=IOa;zG.Delete=xOa;zG.Has=wOa;zG.Set=ROa;zG.Get=kOa;var nAe=new Map;function TOa(){return new Map(nAe)}a(TOa,"Entries");function IOa(){return nAe.clear()}a(IOa,"Clear");function xOa(t){return nAe.delete(t)}a(xOa,"Delete");function wOa(t){return nAe.has(t)}a(wOa,"Has");function ROa(t,e){nAe.set(t,e)}a(ROa,"Set");function kOa(t){return nAe.get(t)}a(kOa,"Get")});var WRi=I(YG=>{"use strict";p();Object.defineProperty(YG,"__esModule",{value:!0});YG.Entries=POa;YG.Clear=DOa;YG.Delete=NOa;YG.Has=MOa;YG.Set=OOa;YG.Get=LOa;var iAe=new Map;function POa(){return new Map(iAe)}a(POa,"Entries");function DOa(){return iAe.clear()}a(DOa,"Clear");function NOa(t){return iAe.delete(t)}a(NOa,"Delete");function MOa(t){return iAe.has(t)}a(MOa,"Has");function OOa(t,e){iAe.set(t,e)}a(OOa,"Set");function LOa(t){return iAe.get(t)}a(LOa,"Get")});var oAe=I(LR=>{"use strict";p();var BOa=LR&&LR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),FOa=LR&&LR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),zRi=LR&&LR.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(W4,"__esModule",{value:!0});W4.SetIncludes=YRi;W4.SetIsSubset=UOa;W4.SetDistinct=QOa;W4.SetIntersect=KRi;W4.SetUnion=qOa;W4.SetComplement=jOa;W4.SetIntersectMany=GOa;W4.SetUnionMany=$Oa;function YRi(t,e){return t.includes(e)}a(YRi,"SetIncludes");function UOa(t,e){return t.every(r=>YRi(e,r))}a(UOa,"SetIsSubset");function QOa(t){return[...new Set(t)]}a(QOa,"SetDistinct");function KRi(t,e){return t.filter(r=>e.includes(r))}a(KRi,"SetIntersect");function qOa(t,e){return[...t,...e]}a(qOa,"SetUnion");function jOa(t,e){return t.filter(r=>!e.includes(r))}a(jOa,"SetComplement");function HOa(t,e){return t.reduce((r,n)=>KRi(r,n),e)}a(HOa,"SetIntersectManyResolve");function GOa(t){return t.length===1?t[0]:t.length>1?HOa(t.slice(1),t[0]):[]}a(GOa,"SetIntersectMany");function $Oa(t){let e=[];for(let r of t)e.push(...r);return e}a($Oa,"SetUnionMany")});var t4e=I(Ute=>{"use strict";p();var VOa=Ute&&Ute.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),WOa=Ute&&Ute.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&VOa(e,t,r)};Object.defineProperty(Ute,"__esModule",{value:!0});WOa(JRi(),Ute)});var ZRi=I(kbr=>{"use strict";p();Object.defineProperty(kbr,"__esModule",{value:!0});kbr.Any=KOa;var zOa=p6(),YOa=bn();function KOa(t){return(0,zOa.CreateType)({[YOa.Kind]:"Any"},t)}a(KOa,"Any")});var sAe=I(Qte=>{"use strict";p();var JOa=Qte&&Qte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ZOa=Qte&&Qte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JOa(e,t,r)};Object.defineProperty(Qte,"__esModule",{value:!0});ZOa(ZRi(),Qte)});var XRi=I(Pbr=>{"use strict";p();Object.defineProperty(Pbr,"__esModule",{value:!0});Pbr.Array=t5a;var XOa=Ii(),e5a=bn();function t5a(t,e){return(0,XOa.CreateType)({[e5a.Kind]:"Array",type:"array",items:t},e)}a(t5a,"Array")});var aAe=I(qte=>{"use strict";p();var r5a=qte&&qte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),n5a=qte&&qte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&r5a(e,t,r)};Object.defineProperty(qte,"__esModule",{value:!0});n5a(XRi(),qte)});var eki=I(Dbr=>{"use strict";p();Object.defineProperty(Dbr,"__esModule",{value:!0});Dbr.Argument=s5a;var i5a=Ii(),o5a=bn();function s5a(t){return(0,i5a.CreateType)({[o5a.Kind]:"Argument",index:t})}a(s5a,"Argument")});var Jgt=I(jte=>{"use strict";p();var a5a=jte&&jte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),c5a=jte&&jte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&a5a(e,t,r)};Object.defineProperty(jte,"__esModule",{value:!0});c5a(eki(),jte)});var tki=I(Nbr=>{"use strict";p();Object.defineProperty(Nbr,"__esModule",{value:!0});Nbr.AsyncIterator=d5a;var l5a=bn(),u5a=Ii();function d5a(t,e){return(0,u5a.CreateType)({[l5a.Kind]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(d5a,"AsyncIterator")});var cAe=I(Hte=>{"use strict";p();var f5a=Hte&&Hte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),p5a=Hte&&Hte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&f5a(e,t,r)};Object.defineProperty(Hte,"__esModule",{value:!0});p5a(tki(),Hte)});var rki=I(Mbr=>{"use strict";p();Object.defineProperty(Mbr,"__esModule",{value:!0});Mbr.Computed=g5a;var h5a=p6(),m5a=K5e();function g5a(t,e,r){return(0,h5a.CreateType)({[m5a.Kind]:"Computed",target:t,parameters:e},r)}a(g5a,"Computed")});var KG=I(Gte=>{"use strict";p();var A5a=Gte&&Gte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),y5a=Gte&&Gte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&A5a(e,t,r)};Object.defineProperty(Gte,"__esModule",{value:!0});y5a(rki(),Gte)});var Zgt=I(Obr=>{"use strict";p();Object.defineProperty(Obr,"__esModule",{value:!0});Obr.Discard=_5a;function E5a(t,e){let{[e]:r,...n}=t;return n}a(E5a,"DiscardKey");function _5a(t,e){return e.reduce((r,n)=>E5a(r,n),t)}a(_5a,"Discard")});var m6=I($te=>{"use strict";p();var v5a=$te&&$te.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),C5a=$te&&$te.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&v5a(e,t,r)};Object.defineProperty($te,"__esModule",{value:!0});C5a(Zgt(),$te)});var nki=I(Lbr=>{"use strict";p();Object.defineProperty(Lbr,"__esModule",{value:!0});Lbr.Never=T5a;var b5a=Ii(),S5a=bn();function T5a(t){return(0,b5a.CreateType)({[S5a.Kind]:"Never",not:{}},t)}a(T5a,"Never")});var xm=I(Vte=>{"use strict";p();var I5a=Vte&&Vte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),x5a=Vte&&Vte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&I5a(e,t,r)};Object.defineProperty(Vte,"__esModule",{value:!0});x5a(nki(),Vte)});var iki=I(Bbr=>{"use strict";p();Object.defineProperty(Bbr,"__esModule",{value:!0});Bbr.MappedKey=k5a;var w5a=Ii(),R5a=bn();function k5a(t){return(0,w5a.CreateType)({[R5a.Kind]:"MappedKey",keys:t})}a(k5a,"MappedKey")});var Ubr=I(Fbr=>{"use strict";p();Object.defineProperty(Fbr,"__esModule",{value:!0});Fbr.MappedResult=N5a;var P5a=Ii(),D5a=bn();function N5a(t){return(0,P5a.CreateType)({[D5a.Kind]:"MappedResult",properties:t})}a(N5a,"MappedResult")});var oki=I(Qbr=>{"use strict";p();Object.defineProperty(Qbr,"__esModule",{value:!0});Qbr.Constructor=L5a;var M5a=Ii(),O5a=bn();function L5a(t,e,r){return(0,M5a.CreateType)({[O5a.Kind]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(L5a,"Constructor")});var lAe=I(Wte=>{"use strict";p();var B5a=Wte&&Wte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),F5a=Wte&&Wte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&B5a(e,t,r)};Object.defineProperty(Wte,"__esModule",{value:!0});F5a(oki(),Wte)});var ski=I(qbr=>{"use strict";p();Object.defineProperty(qbr,"__esModule",{value:!0});qbr.Function=q5a;var U5a=Ii(),Q5a=bn();function q5a(t,e,r){return(0,U5a.CreateType)({[Q5a.Kind]:"Function",type:"Function",parameters:t,returns:e},r)}a(q5a,"Function")});var JG=I(zte=>{"use strict";p();var j5a=zte&&zte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),H5a=zte&&zte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&j5a(e,t,r)};Object.defineProperty(zte,"__esModule",{value:!0});H5a(ski(),zte)});var Hbr=I(jbr=>{"use strict";p();Object.defineProperty(jbr,"__esModule",{value:!0});jbr.UnionCreate=V5a;var G5a=Ii(),$5a=bn();function V5a(t,e){return(0,G5a.CreateType)({[$5a.Kind]:"Union",anyOf:t},e)}a(V5a,"UnionCreate")});var uki=I(Gbr=>{"use strict";p();Object.defineProperty(Gbr,"__esModule",{value:!0});Gbr.UnionEvaluated=t4a;var W5a=Ii(),z5a=bn(),Y5a=m6(),K5a=xm(),J5a=z4(),aki=Hbr(),lki=Es();function Z5a(t){return t.some(e=>(0,lki.IsOptional)(e))}a(Z5a,"IsUnionOptional");function cki(t){return t.map(e=>(0,lki.IsOptional)(e)?X5a(e):e)}a(cki,"RemoveOptionalFromRest");function X5a(t){return(0,Y5a.Discard)(t,[z5a.OptionalKind])}a(X5a,"RemoveOptionalFromType");function e4a(t,e){return Z5a(t)?(0,J5a.Optional)((0,aki.UnionCreate)(cki(t),e)):(0,aki.UnionCreate)(cki(t),e)}a(e4a,"ResolveUnion");function t4a(t,e){return t.length===1?(0,W5a.CreateType)(t[0],e):t.length===0?(0,K5a.Never)(e):e4a(t,e)}a(t4a,"UnionEvaluated")});var fki=I(dki=>{"use strict";p();Object.defineProperty(dki,"__esModule",{value:!0});var Mwp=bn()});var pki=I($br=>{"use strict";p();Object.defineProperty($br,"__esModule",{value:!0});$br.Union=o4a;var r4a=xm(),n4a=Ii(),i4a=Hbr();function o4a(t,e){return t.length===0?(0,r4a.Never)(e):t.length===1?(0,n4a.CreateType)(t[0],e):(0,i4a.UnionCreate)(t,e)}a(o4a,"Union")});var Rp=I(g6=>{"use strict";p();var s4a=g6&&g6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vbr=g6&&g6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&s4a(e,t,r)};Object.defineProperty(g6,"__esModule",{value:!0});Vbr(uki(),g6);Vbr(fki(),g6);Vbr(pki(),g6)});var Xgt=I(uAe=>{"use strict";p();Object.defineProperty(uAe,"__esModule",{value:!0});uAe.TemplateLiteralParserError=void 0;uAe.TemplateLiteralParse=Yte;uAe.TemplateLiteralParseExact=m4a;var a4a=Ff(),r4e=class extends a4a.TypeBoxError{static{a(this,"TemplateLiteralParserError")}};uAe.TemplateLiteralParserError=r4e;function c4a(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(c4a,"Unescape");function Wbr(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(Wbr,"IsNonEscaped");function A6(t,e){return Wbr(t,e,"(")}a(A6,"IsOpenParen");function n4e(t,e){return Wbr(t,e,")")}a(n4e,"IsCloseParen");function hki(t,e){return Wbr(t,e,"|")}a(hki,"IsSeparator");function l4a(t){if(!(A6(t,0)&&n4e(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(Yte(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(Yte(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(p4a,"Or");function h4a(t){function e(o,s){if(!A6(o,s))throw new r4e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(Yte(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(h4a,"And");function Yte(t){return l4a(t)?Yte(u4a(t)):d4a(t)?p4a(t):f4a(t)?h4a(t):{type:"const",const:c4a(t)}}a(Yte,"TemplateLiteralParse");function m4a(t){return Yte(t.slice(1,t.length-1))}a(m4a,"TemplateLiteralParseExact")});var zbr=I(dAe=>{"use strict";p();Object.defineProperty(dAe,"__esModule",{value:!0});dAe.TemplateLiteralFiniteError=void 0;dAe.IsTemplateLiteralExpressionFinite=tAt;dAe.IsTemplateLiteralFinite=v4a;var g4a=Xgt(),A4a=Ff(),eAt=class extends A4a.TypeBoxError{static{a(this,"TemplateLiteralFiniteError")}};dAe.TemplateLiteralFiniteError=eAt;function y4a(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="0"&&t.expr[1].type==="const"&&t.expr[1].const==="[1-9][0-9]*"}a(y4a,"IsNumberExpression");function E4a(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="true"&&t.expr[1].type==="const"&&t.expr[1].const==="false"}a(E4a,"IsBooleanExpression");function _4a(t){return t.type==="const"&&t.const===".*"}a(_4a,"IsStringExpression");function tAt(t){return y4a(t)||_4a(t)?!1:E4a(t)?!0:t.type==="and"?t.expr.every(e=>tAt(e)):t.type==="or"?t.expr.every(e=>tAt(e)):t.type==="const"?!0:(()=>{throw new eAt("Unknown expression type")})()}a(tAt,"IsTemplateLiteralExpressionFinite");function v4a(t){let e=(0,g4a.TemplateLiteralParseExact)(t.pattern);return tAt(e)}a(v4a,"IsTemplateLiteralFinite")});var Ybr=I(fAe=>{"use strict";p();Object.defineProperty(fAe,"__esModule",{value:!0});fAe.TemplateLiteralGenerateError=void 0;fAe.TemplateLiteralExpressionGenerate=nAt;fAe.TemplateLiteralGenerate=w4a;var C4a=zbr(),b4a=Xgt(),S4a=Ff(),rAt=class extends S4a.TypeBoxError{static{a(this,"TemplateLiteralGenerateError")}};fAe.TemplateLiteralGenerateError=rAt;function*mki(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of mki(t.slice(1)))yield`${e}${r}`}a(mki,"GenerateReduce");function*T4a(t){return yield*mki(t.expr.map(e=>[...nAt(e)]))}a(T4a,"GenerateAnd");function*I4a(t){for(let e of t.expr)yield*nAt(e)}a(I4a,"GenerateOr");function*x4a(t){return yield t.const}a(x4a,"GenerateConst");function*nAt(t){return t.type==="and"?yield*T4a(t):t.type==="or"?yield*I4a(t):t.type==="const"?yield*x4a(t):(()=>{throw new rAt("Unknown expression")})()}a(nAt,"TemplateLiteralExpressionGenerate");function w4a(t){let e=(0,b4a.TemplateLiteralParseExact)(t.pattern);return(0,C4a.IsTemplateLiteralExpressionFinite)(e)?[...nAt(e)]:[]}a(w4a,"TemplateLiteralGenerate")});var gki=I(Kbr=>{"use strict";p();Object.defineProperty(Kbr,"__esModule",{value:!0});Kbr.Literal=P4a;var R4a=Ii(),k4a=bn();function P4a(t,e){return(0,R4a.CreateType)({[k4a.Kind]:"Literal",const:t,type:typeof t},e)}a(P4a,"Literal")});var GE=I(Kte=>{"use strict";p();var D4a=Kte&&Kte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),N4a=Kte&&Kte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&D4a(e,t,r)};Object.defineProperty(Kte,"__esModule",{value:!0});N4a(gki(),Kte)});var Aki=I(Jbr=>{"use strict";p();Object.defineProperty(Jbr,"__esModule",{value:!0});Jbr.Boolean=L4a;var M4a=bn(),O4a=p6();function L4a(t){return(0,O4a.CreateType)({[M4a.Kind]:"Boolean",type:"boolean"},t)}a(L4a,"Boolean")});var i4e=I(Jte=>{"use strict";p();var B4a=Jte&&Jte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),F4a=Jte&&Jte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&B4a(e,t,r)};Object.defineProperty(Jte,"__esModule",{value:!0});F4a(Aki(),Jte)});var yki=I(Zbr=>{"use strict";p();Object.defineProperty(Zbr,"__esModule",{value:!0});Zbr.BigInt=q4a;var U4a=bn(),Q4a=p6();function q4a(t){return(0,Q4a.CreateType)({[U4a.Kind]:"BigInt",type:"bigint"},t)}a(q4a,"BigInt")});var pAe=I(Zte=>{"use strict";p();var j4a=Zte&&Zte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),H4a=Zte&&Zte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&j4a(e,t,r)};Object.defineProperty(Zte,"__esModule",{value:!0});H4a(yki(),Zte)});var Eki=I(Xbr=>{"use strict";p();Object.defineProperty(Xbr,"__esModule",{value:!0});Xbr.Number=V4a;var G4a=Ii(),$4a=bn();function V4a(t){return(0,G4a.CreateType)({[$4a.Kind]:"Number",type:"number"},t)}a(V4a,"Number")});var ZG=I(Xte=>{"use strict";p();var W4a=Xte&&Xte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),z4a=Xte&&Xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&W4a(e,t,r)};Object.defineProperty(Xte,"__esModule",{value:!0});z4a(Eki(),Xte)});var _ki=I(e1r=>{"use strict";p();Object.defineProperty(e1r,"__esModule",{value:!0});e1r.String=J4a;var Y4a=Ii(),K4a=bn();function J4a(t){return(0,Y4a.CreateType)({[K4a.Kind]:"String",type:"string"},t)}a(J4a,"String")});var XG=I(ere=>{"use strict";p();var Z4a=ere&&ere.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),X4a=ere&&ere.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Z4a(e,t,r)};Object.defineProperty(ere,"__esModule",{value:!0});X4a(_ki(),ere)});var n1r=I(r1r=>{"use strict";p();Object.defineProperty(r1r,"__esModule",{value:!0});r1r.TemplateLiteralSyntax=cLa;var o4e=GE(),eLa=i4e(),tLa=pAe(),rLa=ZG(),nLa=XG(),iLa=Rp(),oLa=xm();function*sLa(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield(0,eLa.Boolean)():e==="number"?yield(0,rLa.Number)():e==="bigint"?yield(0,tLa.BigInt)():e==="string"?yield(0,nLa.String)():yield(()=>{let r=e.split("|").map(n=>(0,o4e.Literal)(n.trim()));return r.length===0?(0,oLa.Never)():r.length===1?r[0]:(0,iLa.UnionEvaluated)(r)})()}a(sLa,"FromUnion");function*aLa(t){if(t[1]!=="{"){let e=(0,o4e.Literal)("$"),r=t1r(t.slice(1));return yield*[e,...r]}for(let e=2;e{"use strict";p();Object.defineProperty(a4e,"__esModule",{value:!0});a4e.TemplateLiteralPatternError=void 0;a4e.TemplateLiteralPattern=fLa;var s4e=e4e(),lLa=bn(),uLa=Ff(),e$=Es(),iAt=class extends uLa.TypeBoxError{static{a(this,"TemplateLiteralPatternError")}};a4e.TemplateLiteralPatternError=iAt;function dLa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(dLa,"Escape");function vki(t,e){return(0,e$.IsTemplateLiteral)(t)?t.pattern.slice(1,t.pattern.length-1):(0,e$.IsUnion)(t)?`(${t.anyOf.map(r=>vki(r,e)).join("|")})`:(0,e$.IsNumber)(t)?`${e}${s4e.PatternNumber}`:(0,e$.IsInteger)(t)?`${e}${s4e.PatternNumber}`:(0,e$.IsBigInt)(t)?`${e}${s4e.PatternNumber}`:(0,e$.IsString)(t)?`${e}${s4e.PatternString}`:(0,e$.IsLiteral)(t)?`${e}${dLa(t.const.toString())}`:(0,e$.IsBoolean)(t)?`${e}${s4e.PatternBoolean}`:(()=>{throw new iAt(`Unexpected Kind '${t[lLa.Kind]}'`)})()}a(vki,"Visit");function fLa(t){return`^${t.map(e=>vki(e,"")).join("")}$`}a(fLa,"TemplateLiteralPattern")});var Cki=I(o1r=>{"use strict";p();Object.defineProperty(o1r,"__esModule",{value:!0});o1r.TemplateLiteralToUnion=gLa;var pLa=Rp(),hLa=GE(),mLa=Ybr();function gLa(t){let r=(0,mLa.TemplateLiteralGenerate)(t).map(n=>(0,hLa.Literal)(n));return(0,pLa.UnionEvaluated)(r)}a(gLa,"TemplateLiteralToUnion")});var Ski=I(s1r=>{"use strict";p();Object.defineProperty(s1r,"__esModule",{value:!0});s1r.TemplateLiteral=vLa;var ALa=Ii(),yLa=n1r(),bki=i1r(),ELa=Rv(),_La=bn();function vLa(t,e){let r=(0,ELa.IsString)(t)?(0,bki.TemplateLiteralPattern)((0,yLa.TemplateLiteralSyntax)(t)):(0,bki.TemplateLiteralPattern)(t);return(0,ALa.CreateType)({[_La.Kind]:"TemplateLiteral",type:"string",pattern:r},e)}a(vLa,"TemplateLiteral")});var vD=I(iI=>{"use strict";p();var CLa=iI&&iI.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),tre=iI&&iI.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&CLa(e,t,r)};Object.defineProperty(iI,"__esModule",{value:!0});tre(zbr(),iI);tre(Ybr(),iI);tre(n1r(),iI);tre(Xgt(),iI);tre(i1r(),iI);tre(Cki(),iI);tre(Ski(),iI)});var oAt=I(a1r=>{"use strict";p();Object.defineProperty(a1r,"__esModule",{value:!0});a1r.IndexPropertyKeys=Tki;var bLa=vD(),c4e=Es();function SLa(t){return(0,bLa.TemplateLiteralGenerate)(t).map(r=>r.toString())}a(SLa,"FromTemplateLiteral");function TLa(t){let e=[];for(let r of t)e.push(...Tki(r));return e}a(TLa,"FromUnion");function ILa(t){return[t.toString()]}a(ILa,"FromLiteral");function Tki(t){return[...new Set((0,c4e.IsTemplateLiteral)(t)?SLa(t):(0,c4e.IsUnion)(t)?TLa(t.anyOf):(0,c4e.IsLiteral)(t)?ILa(t.const):(0,c4e.IsNumber)(t)?["[number]"]:(0,c4e.IsInteger)(t)?["[number]"]:[])]}a(Tki,"IndexPropertyKeys")});var l1r=I(c1r=>{"use strict";p();Object.defineProperty(c1r,"__esModule",{value:!0});c1r.IndexFromMappedResult=DLa;var xLa=wm(),wLa=oAt(),RLa=CD();function kLa(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=(0,RLa.Index)(t,(0,wLa.IndexPropertyKeys)(e[o]),r);return n}a(kLa,"FromProperties");function PLa(t,e,r){return kLa(t,e.properties,r)}a(PLa,"FromMappedResult");function DLa(t,e,r){let n=PLa(t,e,r);return(0,xLa.MappedResult)(n)}a(DLa,"IndexFromMappedResult")});var aAt=I(hAe=>{"use strict";p();Object.defineProperty(hAe,"__esModule",{value:!0});hAe.IndexFromPropertyKey=d1r;hAe.IndexFromPropertyKeys=Rki;hAe.IndexFromComputed=VLa;hAe.Index=WLa;var NLa=Ii(),MLa=Ff(),xki=KG(),sAt=xm(),OLa=oI(),u1r=Rp(),LLa=oAt(),BLa=f1r(),FLa=l1r(),t1=Es();function wki(t,e){return t.map(r=>d1r(r,e))}a(wki,"FromRest");function ULa(t){return t.filter(e=>!(0,t1.IsNever)(e))}a(ULa,"FromIntersectRest");function QLa(t,e){return(0,OLa.IntersectEvaluated)(ULa(wki(t,e)))}a(QLa,"FromIntersect");function qLa(t){return t.some(e=>(0,t1.IsNever)(e))?[]:t}a(qLa,"FromUnionRest");function jLa(t,e){return(0,u1r.UnionEvaluated)(qLa(wki(t,e)))}a(jLa,"FromUnion");function HLa(t,e){return e in t?t[e]:e==="[number]"?(0,u1r.UnionEvaluated)(t):(0,sAt.Never)()}a(HLa,"FromTuple");function GLa(t,e){return e==="[number]"?t:(0,sAt.Never)()}a(GLa,"FromArray");function $La(t,e){return e in t?t[e]:(0,sAt.Never)()}a($La,"FromProperty");function d1r(t,e){return(0,t1.IsIntersect)(t)?QLa(t.allOf,e):(0,t1.IsUnion)(t)?jLa(t.anyOf,e):(0,t1.IsTuple)(t)?HLa(t.items??[],e):(0,t1.IsArray)(t)?GLa(t.items,e):(0,t1.IsObject)(t)?$La(t.properties,e):(0,sAt.Never)()}a(d1r,"IndexFromPropertyKey");function Rki(t,e){return e.map(r=>d1r(t,r))}a(Rki,"IndexFromPropertyKeys");function Iki(t,e){return(0,u1r.UnionEvaluated)(Rki(t,e))}a(Iki,"FromSchema");function VLa(t,e){return(0,xki.Computed)("Index",[t,e])}a(VLa,"IndexFromComputed");function WLa(t,e,r){if((0,t1.IsRef)(t)||(0,t1.IsRef)(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!(0,t1.IsSchema)(t)||!(0,t1.IsSchema)(e))throw new MLa.TypeBoxError(n);return(0,xki.Computed)("Index",[t,e])}return(0,t1.IsMappedResult)(e)?(0,FLa.IndexFromMappedResult)(t,e,r):(0,t1.IsMappedKey)(e)?(0,BLa.IndexFromMappedKey)(t,e,r):(0,NLa.CreateType)((0,t1.IsSchema)(e)?Iki(t,(0,LLa.IndexPropertyKeys)(e)):Iki(t,e),r)}a(WLa,"Index")});var f1r=I(p1r=>{"use strict";p();Object.defineProperty(p1r,"__esModule",{value:!0});p1r.IndexFromMappedKey=eBa;var zLa=aAt(),YLa=wm(),KLa=Zb();function JLa(t,e,r){return{[e]:(0,zLa.Index)(t,[e],(0,KLa.Clone)(r))}}a(JLa,"MappedIndexPropertyKey");function ZLa(t,e,r){return e.reduce((n,o)=>({...n,...JLa(t,o,r)}),{})}a(ZLa,"MappedIndexPropertyKeys");function XLa(t,e,r){return ZLa(t,e.keys,r)}a(XLa,"MappedIndexProperties");function eBa(t,e,r){let n=XLa(t,e,r);return(0,YLa.MappedResult)(n)}a(eBa,"IndexFromMappedKey")});var CD=I(Y4=>{"use strict";p();var tBa=Y4&&Y4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cAt=Y4&&Y4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tBa(e,t,r)};Object.defineProperty(Y4,"__esModule",{value:!0});cAt(f1r(),Y4);cAt(l1r(),Y4);cAt(oAt(),Y4);cAt(aAt(),Y4)});var kki=I(h1r=>{"use strict";p();Object.defineProperty(h1r,"__esModule",{value:!0});h1r.Iterator=iBa;var rBa=Ii(),nBa=bn();function iBa(t,e){return(0,rBa.CreateType)({[nBa.Kind]:"Iterator",type:"Iterator",items:t},e)}a(iBa,"Iterator")});var mAe=I(rre=>{"use strict";p();var oBa=rre&&rre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sBa=rre&&rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&oBa(e,t,r)};Object.defineProperty(rre,"__esModule",{value:!0});sBa(kki(),rre)});var Dki=I(lAt=>{"use strict";p();Object.defineProperty(lAt,"__esModule",{value:!0});lAt.Object=void 0;var aBa=Ii(),Pki=bn(),cBa=Es();function lBa(t){return globalThis.Object.keys(t).filter(e=>!(0,cBa.IsOptional)(t[e]))}a(lBa,"RequiredArray");function uBa(t,e){let r=lBa(t),n=r.length>0?{[Pki.Kind]:"Object",type:"object",required:r,properties:t}:{[Pki.Kind]:"Object",type:"object",properties:t};return(0,aBa.CreateType)(n,e)}a(uBa,"_Object_");lAt.Object=uBa});var kv=I(nre=>{"use strict";p();var dBa=nre&&nre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fBa=nre&&nre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&dBa(e,t,r)};Object.defineProperty(nre,"__esModule",{value:!0});fBa(Dki(),nre)});var Nki=I(m1r=>{"use strict";p();Object.defineProperty(m1r,"__esModule",{value:!0});m1r.Promise=mBa;var pBa=Ii(),hBa=bn();function mBa(t,e){return(0,pBa.CreateType)({[hBa.Kind]:"Promise",type:"Promise",item:t},e)}a(mBa,"Promise")});var l4e=I(ire=>{"use strict";p();var gBa=ire&&ire.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ABa=ire&&ire.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gBa(e,t,r)};Object.defineProperty(ire,"__esModule",{value:!0});ABa(Nki(),ire)});var A1r=I(g1r=>{"use strict";p();Object.defineProperty(g1r,"__esModule",{value:!0});g1r.Readonly=SBa;var Mki=Ii(),Oki=bn(),yBa=m6(),EBa=y1r(),_Ba=Es();function vBa(t){return(0,Mki.CreateType)((0,yBa.Discard)(t,[Oki.ReadonlyKind]))}a(vBa,"RemoveReadonly");function CBa(t){return(0,Mki.CreateType)({...t,[Oki.ReadonlyKind]:"Readonly"})}a(CBa,"AddReadonly");function bBa(t,e){return e===!1?vBa(t):CBa(t)}a(bBa,"ReadonlyWithFlag");function SBa(t,e){let r=e??!0;return(0,_Ba.IsMappedResult)(t)?(0,EBa.ReadonlyFromMappedResult)(t,r):bBa(t,r)}a(SBa,"Readonly")});var y1r=I(E1r=>{"use strict";p();Object.defineProperty(E1r,"__esModule",{value:!0});E1r.ReadonlyFromMappedResult=RBa;var TBa=wm(),IBa=A1r();function xBa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,IBa.Readonly)(t[n],e);return r}a(xBa,"FromProperties");function wBa(t,e){return xBa(t.properties,e)}a(wBa,"FromMappedResult");function RBa(t,e){let r=wBa(t,e);return(0,TBa.MappedResult)(r)}a(RBa,"ReadonlyFromMappedResult")});var r$=I(t$=>{"use strict";p();var kBa=t$&&t$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Lki=t$&&t$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kBa(e,t,r)};Object.defineProperty(t$,"__esModule",{value:!0});Lki(y1r(),t$);Lki(A1r(),t$)});var Fki=I(_1r=>{"use strict";p();Object.defineProperty(_1r,"__esModule",{value:!0});_1r.Tuple=DBa;var PBa=Ii(),Bki=bn();function DBa(t,e){return(0,PBa.CreateType)(t.length>0?{[Bki.Kind]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[Bki.Kind]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(DBa,"Tuple")});var y6=I(ore=>{"use strict";p();var NBa=ore&&ore.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),MBa=ore&&ore.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&NBa(e,t,r)};Object.defineProperty(ore,"__esModule",{value:!0});MBa(Fki(),ore)});var Gki=I(uAt=>{"use strict";p();Object.defineProperty(uAt,"__esModule",{value:!0});uAt.MappedFunctionReturnType=Hki;uAt.Mapped=e3a;var v1r=bn(),Uki=m6(),OBa=aAe(),LBa=cAe(),BBa=lAe(),FBa=JG(),UBa=CD(),QBa=oI(),qBa=mAe(),Qki=GE(),qki=kv(),jBa=z4(),HBa=l4e(),GBa=r$(),$Ba=y6(),VBa=Rp(),WBa=t4e(),zBa=Ubr(),Pv=Es();function jki(t,e){return t in e?BR(t,e[t]):(0,zBa.MappedResult)(e)}a(jki,"FromMappedResult");function YBa(t){return{[t]:(0,Qki.Literal)(t)}}a(YBa,"MappedKeyToKnownMappedResultProperties");function KBa(t){let e={};for(let r of t)e[r]=(0,Qki.Literal)(r);return e}a(KBa,"MappedKeyToUnknownMappedResultProperties");function JBa(t,e){return(0,WBa.SetIncludes)(e,t)?YBa(t):KBa(e)}a(JBa,"MappedKeyToMappedResultProperties");function ZBa(t,e){let r=JBa(t,e);return jki(t,r)}a(ZBa,"FromMappedKey");function u4e(t,e){return e.map(r=>BR(t,r))}a(u4e,"FromRest");function XBa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=BR(t,e[n]);return r}a(XBa,"FromProperties");function BR(t,e){let r={...e};return(0,Pv.IsOptional)(e)?(0,jBa.Optional)(BR(t,(0,Uki.Discard)(e,[v1r.OptionalKind]))):(0,Pv.IsReadonly)(e)?(0,GBa.Readonly)(BR(t,(0,Uki.Discard)(e,[v1r.ReadonlyKind]))):(0,Pv.IsMappedResult)(e)?jki(t,e.properties):(0,Pv.IsMappedKey)(e)?ZBa(t,e.keys):(0,Pv.IsConstructor)(e)?(0,BBa.Constructor)(u4e(t,e.parameters),BR(t,e.returns),r):(0,Pv.IsFunction)(e)?(0,FBa.Function)(u4e(t,e.parameters),BR(t,e.returns),r):(0,Pv.IsAsyncIterator)(e)?(0,LBa.AsyncIterator)(BR(t,e.items),r):(0,Pv.IsIterator)(e)?(0,qBa.Iterator)(BR(t,e.items),r):(0,Pv.IsIntersect)(e)?(0,QBa.Intersect)(u4e(t,e.allOf),r):(0,Pv.IsUnion)(e)?(0,VBa.Union)(u4e(t,e.anyOf),r):(0,Pv.IsTuple)(e)?(0,$Ba.Tuple)(u4e(t,e.items??[]),r):(0,Pv.IsObject)(e)?(0,qki.Object)(XBa(t,e.properties),r):(0,Pv.IsArray)(e)?(0,OBa.Array)(BR(t,e.items),r):(0,Pv.IsPromise)(e)?(0,HBa.Promise)(BR(t,e.item),r):e}a(BR,"FromSchemaType");function Hki(t,e){let r={};for(let n of t)r[n]=BR(n,e);return r}a(Hki,"MappedFunctionReturnType");function e3a(t,e,r){let n=(0,Pv.IsSchema)(t)?(0,UBa.IndexPropertyKeys)(t):t,o=e({[v1r.Kind]:"MappedKey",keys:n}),s=Hki(n,o);return(0,qki.Object)(s,r)}a(e3a,"Mapped")});var wm=I(E6=>{"use strict";p();var t3a=E6&&E6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),C1r=E6&&E6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&t3a(e,t,r)};Object.defineProperty(E6,"__esModule",{value:!0});C1r(iki(),E6);C1r(Ubr(),E6);C1r(Gki(),E6)});var S1r=I(b1r=>{"use strict";p();Object.defineProperty(b1r,"__esModule",{value:!0});b1r.Optional=c3a;var $ki=Ii(),Vki=bn(),r3a=m6(),n3a=T1r(),i3a=Es();function o3a(t){return(0,$ki.CreateType)((0,r3a.Discard)(t,[Vki.OptionalKind]))}a(o3a,"RemoveOptional");function s3a(t){return(0,$ki.CreateType)({...t,[Vki.OptionalKind]:"Optional"})}a(s3a,"AddOptional");function a3a(t,e){return e===!1?o3a(t):s3a(t)}a(a3a,"OptionalWithFlag");function c3a(t,e){let r=e??!0;return(0,i3a.IsMappedResult)(t)?(0,n3a.OptionalFromMappedResult)(t,r):a3a(t,r)}a(c3a,"Optional")});var T1r=I(I1r=>{"use strict";p();Object.defineProperty(I1r,"__esModule",{value:!0});I1r.OptionalFromMappedResult=p3a;var l3a=wm(),u3a=S1r();function d3a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,u3a.Optional)(t[n],e);return r}a(d3a,"FromProperties");function f3a(t,e){return d3a(t.properties,e)}a(f3a,"FromMappedResult");function p3a(t,e){let r=f3a(t,e);return(0,l3a.MappedResult)(r)}a(p3a,"OptionalFromMappedResult")});var z4=I(n$=>{"use strict";p();var h3a=n$&&n$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Wki=n$&&n$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&h3a(e,t,r)};Object.defineProperty(n$,"__esModule",{value:!0});Wki(T1r(),n$);Wki(S1r(),n$)});var R1r=I(w1r=>{"use strict";p();Object.defineProperty(w1r,"__esModule",{value:!0});w1r.IntersectCreate=g3a;var m3a=Ii(),zki=bn(),x1r=Es();function g3a(t,e={}){let r=t.every(o=>(0,x1r.IsObject)(o)),n=(0,x1r.IsSchema)(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return(0,m3a.CreateType)(e.unevaluatedProperties===!1||(0,x1r.IsSchema)(e.unevaluatedProperties)||r?{...n,[zki.Kind]:"Intersect",type:"object",allOf:t}:{...n,[zki.Kind]:"Intersect",allOf:t},e)}a(g3a,"IntersectCreate")});var Jki=I(P1r=>{"use strict";p();Object.defineProperty(P1r,"__esModule",{value:!0});P1r.IntersectEvaluated=T3a;var A3a=bn(),y3a=Ii(),E3a=m6(),_3a=xm(),v3a=z4(),Yki=R1r(),k1r=Es();function C3a(t){return t.every(e=>(0,k1r.IsOptional)(e))}a(C3a,"IsIntersectOptional");function b3a(t){return(0,E3a.Discard)(t,[A3a.OptionalKind])}a(b3a,"RemoveOptionalFromType");function Kki(t){return t.map(e=>(0,k1r.IsOptional)(e)?b3a(e):e)}a(Kki,"RemoveOptionalFromRest");function S3a(t,e){return C3a(t)?(0,v3a.Optional)((0,Yki.IntersectCreate)(Kki(t),e)):(0,Yki.IntersectCreate)(Kki(t),e)}a(S3a,"ResolveIntersect");function T3a(t,e={}){if(t.length===1)return(0,y3a.CreateType)(t[0],e);if(t.length===0)return(0,_3a.Never)(e);if(t.some(r=>(0,k1r.IsTransform)(r)))throw new Error("Cannot intersect transform types");return S3a(t,e)}a(T3a,"IntersectEvaluated")});var Xki=I(Zki=>{"use strict";p();Object.defineProperty(Zki,"__esModule",{value:!0});var iPp=bn()});var ePi=I(D1r=>{"use strict";p();Object.defineProperty(D1r,"__esModule",{value:!0});D1r.Intersect=k3a;var I3a=Ii(),x3a=xm(),w3a=R1r(),R3a=Es();function k3a(t,e){if(t.length===1)return(0,I3a.CreateType)(t[0],e);if(t.length===0)return(0,x3a.Never)(e);if(t.some(r=>(0,R3a.IsTransform)(r)))throw new Error("Cannot intersect transform types");return(0,w3a.IntersectCreate)(t,e)}a(k3a,"Intersect")});var oI=I(_6=>{"use strict";p();var P3a=_6&&_6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),N1r=_6&&_6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&P3a(e,t,r)};Object.defineProperty(_6,"__esModule",{value:!0});N1r(Jki(),_6);N1r(Xki(),_6);N1r(ePi(),_6)});var tPi=I(M1r=>{"use strict";p();Object.defineProperty(M1r,"__esModule",{value:!0});M1r.Ref=O3a;var D3a=Ff(),N3a=Ii(),M3a=bn();function O3a(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new D3a.TypeBoxError("Ref: $ref must be a string");return(0,N3a.CreateType)({[M3a.Kind]:"Ref",$ref:e},r)}a(O3a,"Ref")});var i$=I(sre=>{"use strict";p();var L3a=sre&&sre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),B3a=sre&&sre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&L3a(e,t,r)};Object.defineProperty(sre,"__esModule",{value:!0});B3a(tPi(),sre)});var nPi=I(B1r=>{"use strict";p();Object.defineProperty(B1r,"__esModule",{value:!0});B1r.Awaited=L1r;var F3a=Ii(),O1r=KG(),U3a=oI(),Q3a=Rp(),q3a=i$(),d4e=Es();function j3a(t,e){return(0,O1r.Computed)("Awaited",[(0,O1r.Computed)(t,e)])}a(j3a,"FromComputed");function H3a(t){return(0,O1r.Computed)("Awaited",[(0,q3a.Ref)(t)])}a(H3a,"FromRef");function G3a(t){return(0,U3a.Intersect)(rPi(t))}a(G3a,"FromIntersect");function $3a(t){return(0,Q3a.Union)(rPi(t))}a($3a,"FromUnion");function V3a(t){return L1r(t)}a(V3a,"FromPromise");function rPi(t){return t.map(e=>L1r(e))}a(rPi,"FromRest");function L1r(t,e){return(0,F3a.CreateType)((0,d4e.IsComputed)(t)?j3a(t.target,t.parameters):(0,d4e.IsIntersect)(t)?G3a(t.allOf):(0,d4e.IsUnion)(t)?$3a(t.anyOf):(0,d4e.IsPromise)(t)?V3a(t.item):(0,d4e.IsRef)(t)?H3a(t.$ref):t,e)}a(L1r,"Awaited")});var f4e=I(are=>{"use strict";p();var W3a=are&&are.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),z3a=are&&are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&W3a(e,t,r)};Object.defineProperty(are,"__esModule",{value:!0});z3a(nPi(),are)});var fAt=I(dAt=>{"use strict";p();Object.defineProperty(dAt,"__esModule",{value:!0});dAt.KeyOfPropertyKeys=U1r;dAt.KeyOfPattern=tFa;var iPi=t4e(),gAe=Es();function oPi(t){let e=[];for(let r of t)e.push(U1r(r));return e}a(oPi,"FromRest");function Y3a(t){let e=oPi(t);return(0,iPi.SetUnionMany)(e)}a(Y3a,"FromIntersect");function K3a(t){let e=oPi(t);return(0,iPi.SetIntersectMany)(e)}a(K3a,"FromUnion");function J3a(t){return t.map((e,r)=>r.toString())}a(J3a,"FromTuple");function Z3a(t){return["[number]"]}a(Z3a,"FromArray");function X3a(t){return globalThis.Object.getOwnPropertyNames(t)}a(X3a,"FromProperties");function eFa(t){return F1r?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(eFa,"FromPatternProperties");function U1r(t){return(0,gAe.IsIntersect)(t)?Y3a(t.allOf):(0,gAe.IsUnion)(t)?K3a(t.anyOf):(0,gAe.IsTuple)(t)?J3a(t.items??[]):(0,gAe.IsArray)(t)?Z3a(t.items):(0,gAe.IsObject)(t)?X3a(t.properties):(0,gAe.IsRecord)(t)?eFa(t.patternProperties):[]}a(U1r,"KeyOfPropertyKeys");var F1r=!1;function tFa(t){F1r=!0;let e=U1r(t);return F1r=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(tFa,"KeyOfPattern")});var j1r=I(pAt=>{"use strict";p();Object.defineProperty(pAt,"__esModule",{value:!0});pAt.KeyOfPropertyKeysToRest=sPi;pAt.KeyOf=fFa;var rFa=Ii(),nFa=GE(),iFa=ZG(),q1r=KG(),oFa=i$(),sFa=fAt(),aFa=Rp(),cFa=H1r(),Q1r=Es();function lFa(t,e){return(0,q1r.Computed)("KeyOf",[(0,q1r.Computed)(t,e)])}a(lFa,"FromComputed");function uFa(t){return(0,q1r.Computed)("KeyOf",[(0,oFa.Ref)(t)])}a(uFa,"FromRef");function dFa(t,e){let r=(0,sFa.KeyOfPropertyKeys)(t),n=sPi(r),o=(0,aFa.UnionEvaluated)(n);return(0,rFa.CreateType)(o,e)}a(dFa,"KeyOfFromType");function sPi(t){return t.map(e=>e==="[number]"?(0,iFa.Number)():(0,nFa.Literal)(e))}a(sPi,"KeyOfPropertyKeysToRest");function fFa(t,e){return(0,Q1r.IsComputed)(t)?lFa(t.target,t.parameters):(0,Q1r.IsRef)(t)?uFa(t.$ref):(0,Q1r.IsMappedResult)(t)?(0,cFa.KeyOfFromMappedResult)(t,e):dFa(t,e)}a(fFa,"KeyOf")});var H1r=I(G1r=>{"use strict";p();Object.defineProperty(G1r,"__esModule",{value:!0});G1r.KeyOfFromMappedResult=yFa;var pFa=wm(),hFa=j1r(),mFa=Zb();function gFa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,hFa.KeyOf)(t[n],(0,mFa.Clone)(e));return r}a(gFa,"FromProperties");function AFa(t,e){return gFa(t.properties,e)}a(AFa,"FromMappedResult");function yFa(t,e){let r=AFa(t,e);return(0,pFa.MappedResult)(r)}a(yFa,"KeyOfFromMappedResult")});var aPi=I($1r=>{"use strict";p();Object.defineProperty($1r,"__esModule",{value:!0});$1r.KeyOfPropertyEntries=vFa;var EFa=aAt(),_Fa=fAt();function vFa(t){let e=(0,_Fa.KeyOfPropertyKeys)(t),r=(0,EFa.IndexFromPropertyKeys)(t,e);return e.map((n,o)=>[e[o],r[o]])}a(vFa,"KeyOfPropertyEntries")});var bD=I(K4=>{"use strict";p();var CFa=K4&&K4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hAt=K4&&K4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&CFa(e,t,r)};Object.defineProperty(K4,"__esModule",{value:!0});hAt(H1r(),K4);hAt(aPi(),K4);hAt(fAt(),K4);hAt(j1r(),K4)});var cPi=I(V1r=>{"use strict";p();Object.defineProperty(V1r,"__esModule",{value:!0});V1r.Composite=NFa;var bFa=oI(),SFa=CD(),TFa=bD(),IFa=kv(),xFa=t4e(),wFa=Es();function RFa(t){let e=[];for(let r of t)e.push(...(0,TFa.KeyOfPropertyKeys)(r));return(0,xFa.SetDistinct)(e)}a(RFa,"CompositeKeys");function kFa(t){return t.filter(e=>!(0,wFa.IsNever)(e))}a(kFa,"FilterNever");function PFa(t,e){let r=[];for(let n of t)r.push(...(0,SFa.IndexFromPropertyKeys)(n,[e]));return kFa(r)}a(PFa,"CompositeProperty");function DFa(t,e){let r={};for(let n of e)r[n]=(0,bFa.IntersectEvaluated)(PFa(t,n));return r}a(DFa,"CompositeProperties");function NFa(t,e){let r=RFa(t),n=DFa(t,r);return(0,IFa.Object)(n,e)}a(NFa,"Composite")});var mAt=I(cre=>{"use strict";p();var MFa=cre&&cre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),OFa=cre&&cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&MFa(e,t,r)};Object.defineProperty(cre,"__esModule",{value:!0});OFa(cPi(),cre)});var lPi=I(W1r=>{"use strict";p();Object.defineProperty(W1r,"__esModule",{value:!0});W1r.Date=FFa;var LFa=bn(),BFa=Ii();function FFa(t){return(0,BFa.CreateType)({[LFa.Kind]:"Date",type:"Date"},t)}a(FFa,"Date")});var p4e=I(lre=>{"use strict";p();var UFa=lre&&lre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),QFa=lre&&lre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UFa(e,t,r)};Object.defineProperty(lre,"__esModule",{value:!0});QFa(lPi(),lre)});var uPi=I(z1r=>{"use strict";p();Object.defineProperty(z1r,"__esModule",{value:!0});z1r.Null=HFa;var qFa=Ii(),jFa=bn();function HFa(t){return(0,qFa.CreateType)({[jFa.Kind]:"Null",type:"null"},t)}a(HFa,"Null")});var h4e=I(ure=>{"use strict";p();var GFa=ure&&ure.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Fa=ure&&ure.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&GFa(e,t,r)};Object.defineProperty(ure,"__esModule",{value:!0});$Fa(uPi(),ure)});var dPi=I(Y1r=>{"use strict";p();Object.defineProperty(Y1r,"__esModule",{value:!0});Y1r.Symbol=zFa;var VFa=Ii(),WFa=bn();function zFa(t){return(0,VFa.CreateType)({[WFa.Kind]:"Symbol",type:"symbol"},t)}a(zFa,"Symbol")});var m4e=I(dre=>{"use strict";p();var YFa=dre&&dre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),KFa=dre&&dre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&YFa(e,t,r)};Object.defineProperty(dre,"__esModule",{value:!0});KFa(dPi(),dre)});var fPi=I(K1r=>{"use strict";p();Object.defineProperty(K1r,"__esModule",{value:!0});K1r.Undefined=XFa;var JFa=Ii(),ZFa=bn();function XFa(t){return(0,JFa.CreateType)({[ZFa.Kind]:"Undefined",type:"undefined"},t)}a(XFa,"Undefined")});var g4e=I(fre=>{"use strict";p();var e8a=fre&&fre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),t8a=fre&&fre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&e8a(e,t,r)};Object.defineProperty(fre,"__esModule",{value:!0});t8a(fPi(),fre)});var pPi=I(J1r=>{"use strict";p();Object.defineProperty(J1r,"__esModule",{value:!0});J1r.Uint8Array=i8a;var r8a=Ii(),n8a=bn();function i8a(t){return(0,r8a.CreateType)({[n8a.Kind]:"Uint8Array",type:"Uint8Array"},t)}a(i8a,"Uint8Array")});var A4e=I(pre=>{"use strict";p();var o8a=pre&&pre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),s8a=pre&&pre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&o8a(e,t,r)};Object.defineProperty(pre,"__esModule",{value:!0});s8a(pPi(),pre)});var hPi=I(Z1r=>{"use strict";p();Object.defineProperty(Z1r,"__esModule",{value:!0});Z1r.Unknown=l8a;var a8a=Ii(),c8a=bn();function l8a(t){return(0,a8a.CreateType)({[c8a.Kind]:"Unknown"},t)}a(l8a,"Unknown")});var o$=I(hre=>{"use strict";p();var u8a=hre&&hre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),d8a=hre&&hre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&u8a(e,t,r)};Object.defineProperty(hre,"__esModule",{value:!0});d8a(hPi(),hre)});var APi=I(rSr=>{"use strict";p();Object.defineProperty(rSr,"__esModule",{value:!0});rSr.Const=S8a;var mPi=sAe(),f8a=pAe(),p8a=p4e(),h8a=JG(),X1r=GE(),m8a=h4e(),gPi=kv(),g8a=m4e(),A8a=y6(),eSr=r$(),y8a=g4e(),E8a=A4e(),_8a=o$(),v8a=p6(),r1=Rv();function C8a(t){return t.map(e=>tSr(e,!1))}a(C8a,"FromArray");function b8a(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=(0,eSr.Readonly)(tSr(t[r],!1));return e}a(b8a,"FromProperties");function gAt(t,e){return e===!0?t:(0,eSr.Readonly)(t)}a(gAt,"ConditionalReadonly");function tSr(t,e){return(0,r1.IsAsyncIterator)(t)||(0,r1.IsIterator)(t)?gAt((0,mPi.Any)(),e):(0,r1.IsArray)(t)?(0,eSr.Readonly)((0,A8a.Tuple)(C8a(t))):(0,r1.IsUint8Array)(t)?(0,E8a.Uint8Array)():(0,r1.IsDate)(t)?(0,p8a.Date)():(0,r1.IsObject)(t)?gAt((0,gPi.Object)(b8a(t)),e):(0,r1.IsFunction)(t)?gAt((0,h8a.Function)([],(0,_8a.Unknown)()),e):(0,r1.IsUndefined)(t)?(0,y8a.Undefined)():(0,r1.IsNull)(t)?(0,m8a.Null)():(0,r1.IsSymbol)(t)?(0,g8a.Symbol)():(0,r1.IsBigInt)(t)?(0,f8a.BigInt)():(0,r1.IsNumber)(t)||(0,r1.IsBoolean)(t)||(0,r1.IsString)(t)?(0,X1r.Literal)(t):(0,gPi.Object)({})}a(tSr,"FromValue");function S8a(t,e){return(0,v8a.CreateType)(tSr(t,!0),e)}a(S8a,"Const")});var AAt=I(mre=>{"use strict";p();var T8a=mre&&mre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),I8a=mre&&mre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&T8a(e,t,r)};Object.defineProperty(mre,"__esModule",{value:!0});I8a(APi(),mre)});var yPi=I(v6=>{"use strict";p();var x8a=v6&&v6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),w8a=v6&&v6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),R8a=v6&&v6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var M8a=gre&&gre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),O8a=gre&&gre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&M8a(e,t,r)};Object.defineProperty(gre,"__esModule",{value:!0});O8a(yPi(),gre)});var EPi=I(nSr=>{"use strict";p();Object.defineProperty(nSr,"__esModule",{value:!0});nSr.Enum=Q8a;var L8a=GE(),B8a=bn(),F8a=Rp(),U8a=Rv();function Q8a(t,e){if((0,U8a.IsUndefined)(t))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(t).filter(s=>isNaN(s)).map(s=>t[s]),o=[...new Set(r)].map(s=>(0,L8a.Literal)(s));return(0,F8a.Union)(o,{...e,[B8a.Hint]:"Enum"})}a(Q8a,"Enum")});var EAt=I(Are=>{"use strict";p();var q8a=Are&&Are.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),j8a=Are&&Are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&q8a(e,t,r)};Object.defineProperty(Are,"__esModule",{value:!0});j8a(EPi(),Are)});var dSr=I(yre=>{"use strict";p();Object.defineProperty(yre,"__esModule",{value:!0});yre.ExtendsResult=yre.ExtendsResolverError=void 0;yre.ExtendsCheck=P6a;var _Pi=sAe(),H8a=JG(),cSr=ZG(),oSr=XG(),G8a=o$(),vPi=vD(),AAe=e4e(),IPi=bn(),$8a=Ff(),rt=wbr(),_At=class extends $8a.TypeBoxError{static{a(this,"ExtendsResolverError")}};yre.ExtendsResolverError=_At;var Lt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(Lt||(yre.ExtendsResult=Lt={}));function FR(t){return t===Lt.False?t:Lt.True}a(FR,"IntoBooleanResult");function yAe(t){throw new _At(t)}a(yAe,"Throw");function Rm(t){return rt.TypeGuard.IsNever(t)||rt.TypeGuard.IsIntersect(t)||rt.TypeGuard.IsUnion(t)||rt.TypeGuard.IsUnknown(t)||rt.TypeGuard.IsAny(t)}a(Rm,"IsStructuralRight");function km(t,e){return rt.TypeGuard.IsNever(e)?RPi(t,e):rt.TypeGuard.IsIntersect(e)?vAt(t,e):rt.TypeGuard.IsUnion(e)?uSr(t,e):rt.TypeGuard.IsUnknown(e)?NPi(t,e):rt.TypeGuard.IsAny(e)?lSr(t,e):yAe("StructuralRight")}a(km,"StructuralRight");function lSr(t,e){return Lt.True}a(lSr,"FromAnyRight");function V8a(t,e){return rt.TypeGuard.IsIntersect(e)?vAt(t,e):rt.TypeGuard.IsUnion(e)&&e.anyOf.some(r=>rt.TypeGuard.IsAny(r)||rt.TypeGuard.IsUnknown(r))?Lt.True:rt.TypeGuard.IsUnion(e)?Lt.Union:rt.TypeGuard.IsUnknown(e)||rt.TypeGuard.IsAny(e)?Lt.True:Lt.Union}a(V8a,"FromAny");function W8a(t,e){return rt.TypeGuard.IsUnknown(t)?Lt.False:rt.TypeGuard.IsAny(t)?Lt.Union:rt.TypeGuard.IsNever(t)?Lt.True:Lt.False}a(W8a,"FromArrayRight");function z8a(t,e){return rt.TypeGuard.IsObject(e)&&CAt(e)?Lt.True:Rm(e)?km(t,e):rt.TypeGuard.IsArray(e)?FR(ml(t.items,e.items)):Lt.False}a(z8a,"FromArray");function Y8a(t,e){return Rm(e)?km(t,e):rt.TypeGuard.IsAsyncIterator(e)?FR(ml(t.items,e.items)):Lt.False}a(Y8a,"FromAsyncIterator");function K8a(t,e){return Rm(e)?km(t,e):rt.TypeGuard.IsObject(e)?$E(t,e):rt.TypeGuard.IsRecord(e)?UR(t,e):rt.TypeGuard.IsBigInt(e)?Lt.True:Lt.False}a(K8a,"FromBigInt");function xPi(t,e){return rt.TypeGuard.IsLiteralBoolean(t)||rt.TypeGuard.IsBoolean(t)?Lt.True:Lt.False}a(xPi,"FromBooleanRight");function J8a(t,e){return Rm(e)?km(t,e):rt.TypeGuard.IsObject(e)?$E(t,e):rt.TypeGuard.IsRecord(e)?UR(t,e):rt.TypeGuard.IsBoolean(e)?Lt.True:Lt.False}a(J8a,"FromBoolean");function Z8a(t,e){return Rm(e)?km(t,e):rt.TypeGuard.IsObject(e)?$E(t,e):rt.TypeGuard.IsConstructor(e)?t.parameters.length>e.parameters.length?Lt.False:t.parameters.every((r,n)=>FR(ml(e.parameters[n],r))===Lt.True)?FR(ml(t.returns,e.returns)):Lt.False:Lt.False}a(Z8a,"FromConstructor");function X8a(t,e){return Rm(e)?km(t,e):rt.TypeGuard.IsObject(e)?$E(t,e):rt.TypeGuard.IsRecord(e)?UR(t,e):rt.TypeGuard.IsDate(e)?Lt.True:Lt.False}a(X8a,"FromDate");function e6a(t,e){return Rm(e)?km(t,e):rt.TypeGuard.IsObject(e)?$E(t,e):rt.TypeGuard.IsFunction(e)?t.parameters.length>e.parameters.length?Lt.False:t.parameters.every((r,n)=>FR(ml(e.parameters[n],r))===Lt.True)?FR(ml(t.returns,e.returns)):Lt.False:Lt.False}a(e6a,"FromFunction");function wPi(t,e){return rt.TypeGuard.IsLiteral(t)&&rt.ValueGuard.IsNumber(t.const)||rt.TypeGuard.IsNumber(t)||rt.TypeGuard.IsInteger(t)?Lt.True:Lt.False}a(wPi,"FromIntegerRight");function t6a(t,e){return rt.TypeGuard.IsInteger(e)||rt.TypeGuard.IsNumber(e)?Lt.True:Rm(e)?km(t,e):rt.TypeGuard.IsObject(e)?$E(t,e):rt.TypeGuard.IsRecord(e)?UR(t,e):Lt.False}a(t6a,"FromInteger");function vAt(t,e){return e.allOf.every(r=>ml(t,r)===Lt.True)?Lt.True:Lt.False}a(vAt,"FromIntersectRight");function r6a(t,e){return t.allOf.some(r=>ml(r,e)===Lt.True)?Lt.True:Lt.False}a(r6a,"FromIntersect");function n6a(t,e){return Rm(e)?km(t,e):rt.TypeGuard.IsIterator(e)?FR(ml(t.items,e.items)):Lt.False}a(n6a,"FromIterator");function i6a(t,e){return rt.TypeGuard.IsLiteral(e)&&e.const===t.const?Lt.True:Rm(e)?km(t,e):rt.TypeGuard.IsObject(e)?$E(t,e):rt.TypeGuard.IsRecord(e)?UR(t,e):rt.TypeGuard.IsString(e)?DPi(t,e):rt.TypeGuard.IsNumber(e)?kPi(t,e):rt.TypeGuard.IsInteger(e)?wPi(t,e):rt.TypeGuard.IsBoolean(e)?xPi(t,e):Lt.False}a(i6a,"FromLiteral");function RPi(t,e){return Lt.False}a(RPi,"FromNeverRight");function o6a(t,e){return Lt.True}a(o6a,"FromNever");function CPi(t){let[e,r]=[t,0];for(;rt.TypeGuard.IsNot(e);)e=e.not,r+=1;return r%2===0?e:(0,G8a.Unknown)()}a(CPi,"UnwrapTNot");function s6a(t,e){return rt.TypeGuard.IsNot(t)?ml(CPi(t),e):rt.TypeGuard.IsNot(e)?ml(t,CPi(e)):yAe("Invalid fallthrough for Not")}a(s6a,"FromNot");function a6a(t,e){return Rm(e)?km(t,e):rt.TypeGuard.IsObject(e)?$E(t,e):rt.TypeGuard.IsRecord(e)?UR(t,e):rt.TypeGuard.IsNull(e)?Lt.True:Lt.False}a(a6a,"FromNull");function kPi(t,e){return rt.TypeGuard.IsLiteralNumber(t)||rt.TypeGuard.IsNumber(t)||rt.TypeGuard.IsInteger(t)?Lt.True:Lt.False}a(kPi,"FromNumberRight");function c6a(t,e){return Rm(e)?km(t,e):rt.TypeGuard.IsObject(e)?$E(t,e):rt.TypeGuard.IsRecord(e)?UR(t,e):rt.TypeGuard.IsInteger(e)||rt.TypeGuard.IsNumber(e)?Lt.True:Lt.False}a(c6a,"FromNumber");function n1(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(n1,"IsObjectPropertyCount");function bPi(t){return CAt(t)}a(bPi,"IsObjectStringLike");function SPi(t){return n1(t,0)||n1(t,1)&&"description"in t.properties&&rt.TypeGuard.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(rt.TypeGuard.IsString(t.properties.description.anyOf[0])&&rt.TypeGuard.IsUndefined(t.properties.description.anyOf[1])||rt.TypeGuard.IsString(t.properties.description.anyOf[1])&&rt.TypeGuard.IsUndefined(t.properties.description.anyOf[0]))}a(SPi,"IsObjectSymbolLike");function iSr(t){return n1(t,0)}a(iSr,"IsObjectNumberLike");function TPi(t){return n1(t,0)}a(TPi,"IsObjectBooleanLike");function l6a(t){return n1(t,0)}a(l6a,"IsObjectBigIntLike");function u6a(t){return n1(t,0)}a(u6a,"IsObjectDateLike");function d6a(t){return CAt(t)}a(d6a,"IsObjectUint8ArrayLike");function f6a(t){let e=(0,cSr.Number)();return n1(t,0)||n1(t,1)&&"length"in t.properties&&FR(ml(t.properties.length,e))===Lt.True}a(f6a,"IsObjectFunctionLike");function p6a(t){return n1(t,0)}a(p6a,"IsObjectConstructorLike");function CAt(t){let e=(0,cSr.Number)();return n1(t,0)||n1(t,1)&&"length"in t.properties&&FR(ml(t.properties.length,e))===Lt.True}a(CAt,"IsObjectArrayLike");function h6a(t){let e=(0,H8a.Function)([(0,_Pi.Any)()],(0,_Pi.Any)());return n1(t,0)||n1(t,1)&&"then"in t.properties&&FR(ml(t.properties.then,e))===Lt.True}a(h6a,"IsObjectPromiseLike");function PPi(t,e){return ml(t,e)===Lt.False||rt.TypeGuard.IsOptional(t)&&!rt.TypeGuard.IsOptional(e)?Lt.False:Lt.True}a(PPi,"Property");function $E(t,e){return rt.TypeGuard.IsUnknown(t)?Lt.False:rt.TypeGuard.IsAny(t)?Lt.Union:rt.TypeGuard.IsNever(t)||rt.TypeGuard.IsLiteralString(t)&&bPi(e)||rt.TypeGuard.IsLiteralNumber(t)&&iSr(e)||rt.TypeGuard.IsLiteralBoolean(t)&&TPi(e)||rt.TypeGuard.IsSymbol(t)&&SPi(e)||rt.TypeGuard.IsBigInt(t)&&l6a(e)||rt.TypeGuard.IsString(t)&&bPi(e)||rt.TypeGuard.IsSymbol(t)&&SPi(e)||rt.TypeGuard.IsNumber(t)&&iSr(e)||rt.TypeGuard.IsInteger(t)&&iSr(e)||rt.TypeGuard.IsBoolean(t)&&TPi(e)||rt.TypeGuard.IsUint8Array(t)&&d6a(e)||rt.TypeGuard.IsDate(t)&&u6a(e)||rt.TypeGuard.IsConstructor(t)&&p6a(e)||rt.TypeGuard.IsFunction(t)&&f6a(e)?Lt.True:rt.TypeGuard.IsRecord(t)&&rt.TypeGuard.IsString(sSr(t))?e[IPi.Hint]==="Record"?Lt.True:Lt.False:rt.TypeGuard.IsRecord(t)&&rt.TypeGuard.IsNumber(sSr(t))&&n1(e,0)?Lt.True:Lt.False}a($E,"FromObjectRight");function m6a(t,e){return Rm(e)?km(t,e):rt.TypeGuard.IsRecord(e)?UR(t,e):rt.TypeGuard.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!rt.TypeGuard.IsOptional(e.properties[r]))return Lt.False;if(rt.TypeGuard.IsOptional(e.properties[r]))return Lt.True;if(PPi(t.properties[r],e.properties[r])===Lt.False)return Lt.False}return Lt.True})():Lt.False}a(m6a,"FromObject");function g6a(t,e){return Rm(e)?km(t,e):rt.TypeGuard.IsObject(e)&&h6a(e)?Lt.True:rt.TypeGuard.IsPromise(e)?FR(ml(t.item,e.item)):Lt.False}a(g6a,"FromPromise");function sSr(t){return AAe.PatternNumberExact in t.patternProperties?(0,cSr.Number)():AAe.PatternStringExact in t.patternProperties?(0,oSr.String)():yAe("Unknown record key pattern")}a(sSr,"RecordKey");function aSr(t){return AAe.PatternNumberExact in t.patternProperties?t.patternProperties[AAe.PatternNumberExact]:AAe.PatternStringExact in t.patternProperties?t.patternProperties[AAe.PatternStringExact]:yAe("Unable to get record value schema")}a(aSr,"RecordValue");function UR(t,e){let[r,n]=[sSr(e),aSr(e)];return rt.TypeGuard.IsLiteralString(t)&&rt.TypeGuard.IsNumber(r)&&FR(ml(t,n))===Lt.True?Lt.True:rt.TypeGuard.IsUint8Array(t)&&rt.TypeGuard.IsNumber(r)||rt.TypeGuard.IsString(t)&&rt.TypeGuard.IsNumber(r)||rt.TypeGuard.IsArray(t)&&rt.TypeGuard.IsNumber(r)?ml(t,n):rt.TypeGuard.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(PPi(n,t.properties[o])===Lt.False)return Lt.False;return Lt.True})():Lt.False}a(UR,"FromRecordRight");function A6a(t,e){return Rm(e)?km(t,e):rt.TypeGuard.IsObject(e)?$E(t,e):rt.TypeGuard.IsRecord(e)?ml(aSr(t),aSr(e)):Lt.False}a(A6a,"FromRecord");function y6a(t,e){let r=rt.TypeGuard.IsRegExp(t)?(0,oSr.String)():t,n=rt.TypeGuard.IsRegExp(e)?(0,oSr.String)():e;return ml(r,n)}a(y6a,"FromRegExp");function DPi(t,e){return rt.TypeGuard.IsLiteral(t)&&rt.ValueGuard.IsString(t.const)||rt.TypeGuard.IsString(t)?Lt.True:Lt.False}a(DPi,"FromStringRight");function E6a(t,e){return Rm(e)?km(t,e):rt.TypeGuard.IsObject(e)?$E(t,e):rt.TypeGuard.IsRecord(e)?UR(t,e):rt.TypeGuard.IsString(e)?Lt.True:Lt.False}a(E6a,"FromString");function _6a(t,e){return Rm(e)?km(t,e):rt.TypeGuard.IsObject(e)?$E(t,e):rt.TypeGuard.IsRecord(e)?UR(t,e):rt.TypeGuard.IsSymbol(e)?Lt.True:Lt.False}a(_6a,"FromSymbol");function v6a(t,e){return rt.TypeGuard.IsTemplateLiteral(t)?ml((0,vPi.TemplateLiteralToUnion)(t),e):rt.TypeGuard.IsTemplateLiteral(e)?ml(t,(0,vPi.TemplateLiteralToUnion)(e)):yAe("Invalid fallthrough for TemplateLiteral")}a(v6a,"FromTemplateLiteral");function C6a(t,e){return rt.TypeGuard.IsArray(e)&&t.items!==void 0&&t.items.every(r=>ml(r,e.items)===Lt.True)}a(C6a,"IsArrayOfTuple");function b6a(t,e){return rt.TypeGuard.IsNever(t)?Lt.True:rt.TypeGuard.IsUnknown(t)?Lt.False:rt.TypeGuard.IsAny(t)?Lt.Union:Lt.False}a(b6a,"FromTupleRight");function S6a(t,e){return Rm(e)?km(t,e):rt.TypeGuard.IsObject(e)&&CAt(e)||rt.TypeGuard.IsArray(e)&&C6a(t,e)?Lt.True:rt.TypeGuard.IsTuple(e)?rt.ValueGuard.IsUndefined(t.items)&&!rt.ValueGuard.IsUndefined(e.items)||!rt.ValueGuard.IsUndefined(t.items)&&rt.ValueGuard.IsUndefined(e.items)?Lt.False:rt.ValueGuard.IsUndefined(t.items)&&!rt.ValueGuard.IsUndefined(e.items)||t.items.every((r,n)=>ml(r,e.items[n])===Lt.True)?Lt.True:Lt.False:Lt.False}a(S6a,"FromTuple");function T6a(t,e){return Rm(e)?km(t,e):rt.TypeGuard.IsObject(e)?$E(t,e):rt.TypeGuard.IsRecord(e)?UR(t,e):rt.TypeGuard.IsUint8Array(e)?Lt.True:Lt.False}a(T6a,"FromUint8Array");function I6a(t,e){return Rm(e)?km(t,e):rt.TypeGuard.IsObject(e)?$E(t,e):rt.TypeGuard.IsRecord(e)?UR(t,e):rt.TypeGuard.IsVoid(e)?R6a(t,e):rt.TypeGuard.IsUndefined(e)?Lt.True:Lt.False}a(I6a,"FromUndefined");function uSr(t,e){return e.anyOf.some(r=>ml(t,r)===Lt.True)?Lt.True:Lt.False}a(uSr,"FromUnionRight");function x6a(t,e){return t.anyOf.every(r=>ml(r,e)===Lt.True)?Lt.True:Lt.False}a(x6a,"FromUnion");function NPi(t,e){return Lt.True}a(NPi,"FromUnknownRight");function w6a(t,e){return rt.TypeGuard.IsNever(e)?RPi(t,e):rt.TypeGuard.IsIntersect(e)?vAt(t,e):rt.TypeGuard.IsUnion(e)?uSr(t,e):rt.TypeGuard.IsAny(e)?lSr(t,e):rt.TypeGuard.IsString(e)?DPi(t,e):rt.TypeGuard.IsNumber(e)?kPi(t,e):rt.TypeGuard.IsInteger(e)?wPi(t,e):rt.TypeGuard.IsBoolean(e)?xPi(t,e):rt.TypeGuard.IsArray(e)?W8a(t,e):rt.TypeGuard.IsTuple(e)?b6a(t,e):rt.TypeGuard.IsObject(e)?$E(t,e):rt.TypeGuard.IsUnknown(e)?Lt.True:Lt.False}a(w6a,"FromUnknown");function R6a(t,e){return rt.TypeGuard.IsUndefined(t)||rt.TypeGuard.IsUndefined(t)?Lt.True:Lt.False}a(R6a,"FromVoidRight");function k6a(t,e){return rt.TypeGuard.IsIntersect(e)?vAt(t,e):rt.TypeGuard.IsUnion(e)?uSr(t,e):rt.TypeGuard.IsUnknown(e)?NPi(t,e):rt.TypeGuard.IsAny(e)?lSr(t,e):rt.TypeGuard.IsObject(e)?$E(t,e):rt.TypeGuard.IsVoid(e)?Lt.True:Lt.False}a(k6a,"FromVoid");function ml(t,e){return rt.TypeGuard.IsTemplateLiteral(t)||rt.TypeGuard.IsTemplateLiteral(e)?v6a(t,e):rt.TypeGuard.IsRegExp(t)||rt.TypeGuard.IsRegExp(e)?y6a(t,e):rt.TypeGuard.IsNot(t)||rt.TypeGuard.IsNot(e)?s6a(t,e):rt.TypeGuard.IsAny(t)?V8a(t,e):rt.TypeGuard.IsArray(t)?z8a(t,e):rt.TypeGuard.IsBigInt(t)?K8a(t,e):rt.TypeGuard.IsBoolean(t)?J8a(t,e):rt.TypeGuard.IsAsyncIterator(t)?Y8a(t,e):rt.TypeGuard.IsConstructor(t)?Z8a(t,e):rt.TypeGuard.IsDate(t)?X8a(t,e):rt.TypeGuard.IsFunction(t)?e6a(t,e):rt.TypeGuard.IsInteger(t)?t6a(t,e):rt.TypeGuard.IsIntersect(t)?r6a(t,e):rt.TypeGuard.IsIterator(t)?n6a(t,e):rt.TypeGuard.IsLiteral(t)?i6a(t,e):rt.TypeGuard.IsNever(t)?o6a(t,e):rt.TypeGuard.IsNull(t)?a6a(t,e):rt.TypeGuard.IsNumber(t)?c6a(t,e):rt.TypeGuard.IsObject(t)?m6a(t,e):rt.TypeGuard.IsRecord(t)?A6a(t,e):rt.TypeGuard.IsString(t)?E6a(t,e):rt.TypeGuard.IsSymbol(t)?_6a(t,e):rt.TypeGuard.IsTuple(t)?S6a(t,e):rt.TypeGuard.IsPromise(t)?g6a(t,e):rt.TypeGuard.IsUint8Array(t)?T6a(t,e):rt.TypeGuard.IsUndefined(t)?I6a(t,e):rt.TypeGuard.IsUnion(t)?x6a(t,e):rt.TypeGuard.IsUnknown(t)?w6a(t,e):rt.TypeGuard.IsVoid(t)?k6a(t,e):yAe(`Unknown left type operand '${t[IPi.Kind]}'`)}a(ml,"Visit");function P6a(t,e){return ml(t,e)}a(P6a,"ExtendsCheck")});var pSr=I(fSr=>{"use strict";p();Object.defineProperty(fSr,"__esModule",{value:!0});fSr.ExtendsFromMappedResult=B6a;var D6a=wm(),N6a=bAt(),M6a=Zb();function O6a(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=(0,N6a.Extends)(t[c],e,r,n,(0,M6a.Clone)(o));return s}a(O6a,"FromProperties");function L6a(t,e,r,n,o){return O6a(t.properties,e,r,n,o)}a(L6a,"FromMappedResult");function B6a(t,e,r,n,o){let s=L6a(t,e,r,n,o);return(0,D6a.MappedResult)(s)}a(B6a,"ExtendsFromMappedResult")});var bAt=I(mSr=>{"use strict";p();Object.defineProperty(mSr,"__esModule",{value:!0});mSr.Extends=j6a;var MPi=Ii(),F6a=Rp(),hSr=dSr(),U6a=gSr(),Q6a=pSr(),OPi=Es();function q6a(t,e,r,n){let o=(0,hSr.ExtendsCheck)(t,e);return o===hSr.ExtendsResult.Union?(0,F6a.Union)([r,n]):o===hSr.ExtendsResult.True?r:n}a(q6a,"ExtendsResolve");function j6a(t,e,r,n,o){return(0,OPi.IsMappedResult)(t)?(0,Q6a.ExtendsFromMappedResult)(t,e,r,n,o):(0,OPi.IsMappedKey)(t)?(0,MPi.CreateType)((0,U6a.ExtendsFromMappedKey)(t,e,r,n,o)):(0,MPi.CreateType)(q6a(t,e,r,n),o)}a(j6a,"Extends")});var gSr=I(ASr=>{"use strict";p();Object.defineProperty(ASr,"__esModule",{value:!0});ASr.ExtendsFromMappedKey=K6a;var H6a=wm(),G6a=GE(),$6a=bAt(),V6a=Zb();function W6a(t,e,r,n,o){return{[t]:(0,$6a.Extends)((0,G6a.Literal)(t),e,r,n,(0,V6a.Clone)(o))}}a(W6a,"FromPropertyKey");function z6a(t,e,r,n,o){return t.reduce((s,c)=>({...s,...W6a(c,e,r,n,o)}),{})}a(z6a,"FromPropertyKeys");function Y6a(t,e,r,n,o){return z6a(t.keys,e,r,n,o)}a(Y6a,"FromMappedKey");function K6a(t,e,r,n,o){let s=Y6a(t,e,r,n,o);return(0,H6a.MappedResult)(s)}a(K6a,"ExtendsFromMappedKey")});var ESr=I(ySr=>{"use strict";p();Object.defineProperty(ySr,"__esModule",{value:!0});ySr.ExtendsUndefinedCheck=TAt;var SAt=bn();function J6a(t){return t.allOf.every(e=>TAt(e))}a(J6a,"Intersect");function Z6a(t){return t.anyOf.some(e=>TAt(e))}a(Z6a,"Union");function X6a(t){return!TAt(t.not)}a(X6a,"Not");function TAt(t){return t[SAt.Kind]==="Intersect"?J6a(t):t[SAt.Kind]==="Union"?Z6a(t):t[SAt.Kind]==="Not"?X6a(t):t[SAt.Kind]==="Undefined"}a(TAt,"ExtendsUndefinedCheck")});var Ere=I(SD=>{"use strict";p();var e9a=SD&&SD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),y4e=SD&&SD.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&e9a(e,t,r)};Object.defineProperty(SD,"__esModule",{value:!0});y4e(dSr(),SD);y4e(gSr(),SD);y4e(pSr(),SD);y4e(ESr(),SD);y4e(bAt(),SD)});var vSr=I(_Sr=>{"use strict";p();Object.defineProperty(_Sr,"__esModule",{value:!0});_Sr.ExcludeFromTemplateLiteral=n9a;var t9a=IAt(),r9a=vD();function n9a(t,e){return(0,t9a.Exclude)((0,r9a.TemplateLiteralToUnion)(t),e)}a(n9a,"ExcludeFromTemplateLiteral")});var IAt=I(SSr=>{"use strict";p();Object.defineProperty(SSr,"__esModule",{value:!0});SSr.Exclude=l9a;var CSr=Ii(),i9a=Rp(),o9a=xm(),xAt=Ere(),s9a=TSr(),a9a=vSr(),bSr=Es();function c9a(t,e){let r=t.filter(n=>(0,xAt.ExtendsCheck)(n,e)===xAt.ExtendsResult.False);return r.length===1?r[0]:(0,i9a.Union)(r)}a(c9a,"ExcludeRest");function l9a(t,e,r={}){return(0,bSr.IsTemplateLiteral)(t)?(0,CSr.CreateType)((0,a9a.ExcludeFromTemplateLiteral)(t,e),r):(0,bSr.IsMappedResult)(t)?(0,CSr.CreateType)((0,s9a.ExcludeFromMappedResult)(t,e),r):(0,CSr.CreateType)((0,bSr.IsUnion)(t)?c9a(t.anyOf,e):(0,xAt.ExtendsCheck)(t,e)!==xAt.ExtendsResult.False?(0,o9a.Never)():t,r)}a(l9a,"Exclude")});var TSr=I(ISr=>{"use strict";p();Object.defineProperty(ISr,"__esModule",{value:!0});ISr.ExcludeFromMappedResult=h9a;var u9a=wm(),d9a=IAt();function f9a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,d9a.Exclude)(t[n],e);return r}a(f9a,"FromProperties");function p9a(t,e){return f9a(t.properties,e)}a(p9a,"FromMappedResult");function h9a(t,e){let r=p9a(t,e);return(0,u9a.MappedResult)(r)}a(h9a,"ExcludeFromMappedResult")});var wAt=I(C6=>{"use strict";p();var m9a=C6&&C6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xSr=C6&&C6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&m9a(e,t,r)};Object.defineProperty(C6,"__esModule",{value:!0});xSr(TSr(),C6);xSr(vSr(),C6);xSr(IAt(),C6)});var RSr=I(wSr=>{"use strict";p();Object.defineProperty(wSr,"__esModule",{value:!0});wSr.ExtractFromTemplateLiteral=y9a;var g9a=RAt(),A9a=vD();function y9a(t,e){return(0,g9a.Extract)((0,A9a.TemplateLiteralToUnion)(t),e)}a(y9a,"ExtractFromTemplateLiteral")});var RAt=I(DSr=>{"use strict";p();Object.defineProperty(DSr,"__esModule",{value:!0});DSr.Extract=S9a;var kSr=Ii(),E9a=Rp(),_9a=xm(),kAt=Ere(),v9a=NSr(),C9a=RSr(),PSr=Es();function b9a(t,e){let r=t.filter(n=>(0,kAt.ExtendsCheck)(n,e)!==kAt.ExtendsResult.False);return r.length===1?r[0]:(0,E9a.Union)(r)}a(b9a,"ExtractRest");function S9a(t,e,r){return(0,PSr.IsTemplateLiteral)(t)?(0,kSr.CreateType)((0,C9a.ExtractFromTemplateLiteral)(t,e),r):(0,PSr.IsMappedResult)(t)?(0,kSr.CreateType)((0,v9a.ExtractFromMappedResult)(t,e),r):(0,kSr.CreateType)((0,PSr.IsUnion)(t)?b9a(t.anyOf,e):(0,kAt.ExtendsCheck)(t,e)!==kAt.ExtendsResult.False?t:(0,_9a.Never)(),r)}a(S9a,"Extract")});var NSr=I(MSr=>{"use strict";p();Object.defineProperty(MSr,"__esModule",{value:!0});MSr.ExtractFromMappedResult=R9a;var T9a=wm(),I9a=RAt();function x9a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,I9a.Extract)(t[n],e);return r}a(x9a,"FromProperties");function w9a(t,e){return x9a(t.properties,e)}a(w9a,"FromMappedResult");function R9a(t,e){let r=w9a(t,e);return(0,T9a.MappedResult)(r)}a(R9a,"ExtractFromMappedResult")});var PAt=I(b6=>{"use strict";p();var k9a=b6&&b6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),OSr=b6&&b6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&k9a(e,t,r)};Object.defineProperty(b6,"__esModule",{value:!0});OSr(NSr(),b6);OSr(RSr(),b6);OSr(RAt(),b6)});var LPi=I(S6=>{"use strict";p();var P9a=S6&&S6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),D9a=S6&&S6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),N9a=S6&&S6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var F9a=_re&&_re.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),U9a=_re&&_re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&F9a(e,t,r)};Object.defineProperty(_re,"__esModule",{value:!0});U9a(LPi(),_re)});var BPi=I(LSr=>{"use strict";p();Object.defineProperty(LSr,"__esModule",{value:!0});LSr.ReadonlyOptional=j9a;var Q9a=r$(),q9a=z4();function j9a(t){return(0,Q9a.Readonly)((0,q9a.Optional)(t))}a(j9a,"ReadonlyOptional")});var E4e=I(vre=>{"use strict";p();var H9a=vre&&vre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),G9a=vre&&vre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&H9a(e,t,r)};Object.defineProperty(vre,"__esModule",{value:!0});G9a(BPi(),vre)});var jPi=I(EAe=>{"use strict";p();Object.defineProperty(EAe,"__esModule",{value:!0});EAe.Record=aUa;EAe.RecordPattern=FSr;EAe.RecordKey=cUa;EAe.RecordValue=lUa;var $9a=Ii(),UPi=bn(),V9a=xm(),W9a=ZG(),QPi=kv(),FPi=XG(),z9a=Rp(),Y9a=vD(),Cre=e4e(),qPi=CD(),K9a=Rv(),J4=Es();function bre(t,e,r){return(0,$9a.CreateType)({[UPi.Kind]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(bre,"RecordCreateFromPattern");function BSr(t,e,r){let n={};for(let o of t)n[o]=e;return(0,QPi.Object)(n,{...r,[UPi.Hint]:"Record"})}a(BSr,"RecordCreateFromKeys");function J9a(t,e,r){return(0,Y9a.IsTemplateLiteralFinite)(t)?BSr((0,qPi.IndexPropertyKeys)(t),e,r):bre(t.pattern,e,r)}a(J9a,"FromTemplateLiteralKey");function Z9a(t,e,r){return BSr((0,qPi.IndexPropertyKeys)((0,z9a.Union)(t)),e,r)}a(Z9a,"FromUnionKey");function X9a(t,e,r){return BSr([t.toString()],e,r)}a(X9a,"FromLiteralKey");function eUa(t,e,r){return bre(t.source,e,r)}a(eUa,"FromRegExpKey");function tUa(t,e,r){let n=(0,K9a.IsUndefined)(t.pattern)?Cre.PatternStringExact:t.pattern;return bre(n,e,r)}a(tUa,"FromStringKey");function rUa(t,e,r){return bre(Cre.PatternStringExact,e,r)}a(rUa,"FromAnyKey");function nUa(t,e,r){return bre(Cre.PatternNeverExact,e,r)}a(nUa,"FromNeverKey");function iUa(t,e,r){return(0,QPi.Object)({true:e,false:e},r)}a(iUa,"FromBooleanKey");function oUa(t,e,r){return bre(Cre.PatternNumberExact,e,r)}a(oUa,"FromIntegerKey");function sUa(t,e,r){return bre(Cre.PatternNumberExact,e,r)}a(sUa,"FromNumberKey");function aUa(t,e,r={}){return(0,J4.IsUnion)(t)?Z9a(t.anyOf,e,r):(0,J4.IsTemplateLiteral)(t)?J9a(t,e,r):(0,J4.IsLiteral)(t)?X9a(t.const,e,r):(0,J4.IsBoolean)(t)?iUa(t,e,r):(0,J4.IsInteger)(t)?oUa(t,e,r):(0,J4.IsNumber)(t)?sUa(t,e,r):(0,J4.IsRegExp)(t)?eUa(t,e,r):(0,J4.IsString)(t)?tUa(t,e,r):(0,J4.IsAny)(t)?rUa(t,e,r):(0,J4.IsNever)(t)?nUa(t,e,r):(0,V9a.Never)(r)}a(aUa,"Record");function FSr(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(FSr,"RecordPattern");function cUa(t){let e=FSr(t);return e===Cre.PatternStringExact?(0,FPi.String)():e===Cre.PatternNumberExact?(0,W9a.Number)():(0,FPi.String)({pattern:e})}a(cUa,"RecordKey");function lUa(t){return t.patternProperties[FSr(t)]}a(lUa,"RecordValue")});var _Ae=I(Sre=>{"use strict";p();var uUa=Sre&&Sre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dUa=Sre&&Sre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uUa(e,t,r)};Object.defineProperty(Sre,"__esModule",{value:!0});dUa(jPi(),Sre)});var GPi=I(Z4=>{"use strict";p();var fUa=Z4&&Z4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pUa=Z4&&Z4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),HPi=Z4&&Z4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o({...r,[n]:NUa(t,e[n])}),{})}a(MUa,"FromProperties");function vAe(t,e){return e.map(r=>TD(t,r))}a(vAe,"FromTypes");function TD(t,e){return i1.IsConstructor(e)?vUa(t,e):i1.IsFunction(e)?CUa(t,e):i1.IsIntersect(e)?bUa(t,e):i1.IsUnion(e)?SUa(t,e):i1.IsTuple(e)?TUa(t,e):i1.IsArray(e)?IUa(t,e):i1.IsAsyncIterator(e)?xUa(t,e):i1.IsIterator(e)?wUa(t,e):i1.IsPromise(e)?RUa(t,e):i1.IsObject(e)?kUa(t,e):i1.IsRecord(e)?PUa(t,e):i1.IsArgument(e)?DUa(t,e):e}a(TD,"FromType");function OUa(t,e){return TD(e,(0,hUa.CloneType)(t))}a(OUa,"Instantiate")});var NAt=I(Tre=>{"use strict";p();var LUa=Tre&&Tre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),BUa=Tre&&Tre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LUa(e,t,r)};Object.defineProperty(Tre,"__esModule",{value:!0});BUa(GPi(),Tre)});var $Pi=I(QSr=>{"use strict";p();Object.defineProperty(QSr,"__esModule",{value:!0});QSr.Integer=QUa;var FUa=Ii(),UUa=bn();function QUa(t){return(0,FUa.CreateType)({[UUa.Kind]:"Integer",type:"integer"},t)}a(QUa,"Integer")});var MAt=I(Ire=>{"use strict";p();var qUa=Ire&&Ire.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jUa=Ire&&Ire.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qUa(e,t,r)};Object.defineProperty(Ire,"__esModule",{value:!0});jUa($Pi(),Ire)});var jSr=I(qSr=>{"use strict";p();Object.defineProperty(qSr,"__esModule",{value:!0});qSr.IntrinsicFromMappedKey=KUa;var HUa=wm(),GUa=xre(),$Ua=GE(),VUa=Zb();function WUa(t,e,r){return{[t]:(0,GUa.Intrinsic)((0,$Ua.Literal)(t),e,(0,VUa.Clone)(r))}}a(WUa,"MappedIntrinsicPropertyKey");function zUa(t,e,r){return t.reduce((o,s)=>({...o,...WUa(s,e,r)}),{})}a(zUa,"MappedIntrinsicPropertyKeys");function YUa(t,e,r){return zUa(t.keys,e,r)}a(YUa,"MappedIntrinsicProperties");function KUa(t,e,r){let n=YUa(t,e,r);return(0,HUa.MappedResult)(n)}a(KUa,"IntrinsicFromMappedKey")});var xre=I(HSr=>{"use strict";p();Object.defineProperty(HSr,"__esModule",{value:!0});HSr.Intrinsic=KPi;var JUa=Ii(),OAt=vD(),ZUa=jSr(),VPi=GE(),WPi=Rp(),LAt=Es();function XUa(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(XUa,"ApplyUncapitalize");function e7a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(e7a,"ApplyCapitalize");function t7a(t){return t.toUpperCase()}a(t7a,"ApplyUppercase");function r7a(t){return t.toLowerCase()}a(r7a,"ApplyLowercase");function n7a(t,e,r){let n=(0,OAt.TemplateLiteralParseExact)(t.pattern);if(!(0,OAt.IsTemplateLiteralExpressionFinite)(n))return{...t,pattern:zPi(t.pattern,e)};let c=[...(0,OAt.TemplateLiteralExpressionGenerate)(n)].map(d=>(0,VPi.Literal)(d)),l=YPi(c,e),u=(0,WPi.Union)(l);return(0,OAt.TemplateLiteral)([u],r)}a(n7a,"FromTemplateLiteral");function zPi(t,e){return typeof t=="string"?e==="Uncapitalize"?XUa(t):e==="Capitalize"?e7a(t):e==="Uppercase"?t7a(t):e==="Lowercase"?r7a(t):t:t.toString()}a(zPi,"FromLiteralValue");function YPi(t,e){return t.map(r=>KPi(r,e))}a(YPi,"FromRest");function KPi(t,e,r={}){return(0,LAt.IsMappedKey)(t)?(0,ZUa.IntrinsicFromMappedKey)(t,e,r):(0,LAt.IsTemplateLiteral)(t)?n7a(t,e,r):(0,LAt.IsUnion)(t)?(0,WPi.Union)(YPi(t.anyOf,e),r):(0,LAt.IsLiteral)(t)?(0,VPi.Literal)(zPi(t.const,e),r):(0,JUa.CreateType)(t,r)}a(KPi,"Intrinsic")});var JPi=I(GSr=>{"use strict";p();Object.defineProperty(GSr,"__esModule",{value:!0});GSr.Capitalize=o7a;var i7a=xre();function o7a(t,e={}){return(0,i7a.Intrinsic)(t,"Capitalize",e)}a(o7a,"Capitalize")});var ZPi=I($Sr=>{"use strict";p();Object.defineProperty($Sr,"__esModule",{value:!0});$Sr.Lowercase=a7a;var s7a=xre();function a7a(t,e={}){return(0,s7a.Intrinsic)(t,"Lowercase",e)}a(a7a,"Lowercase")});var XPi=I(VSr=>{"use strict";p();Object.defineProperty(VSr,"__esModule",{value:!0});VSr.Uncapitalize=l7a;var c7a=xre();function l7a(t,e={}){return(0,c7a.Intrinsic)(t,"Uncapitalize",e)}a(l7a,"Uncapitalize")});var e2i=I(WSr=>{"use strict";p();Object.defineProperty(WSr,"__esModule",{value:!0});WSr.Uppercase=d7a;var u7a=xre();function d7a(t,e={}){return(0,u7a.Intrinsic)(t,"Uppercase",e)}a(d7a,"Uppercase")});var BAt=I(QR=>{"use strict";p();var f7a=QR&&QR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),CAe=QR&&QR.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&f7a(e,t,r)};Object.defineProperty(QR,"__esModule",{value:!0});CAe(JPi(),QR);CAe(jSr(),QR);CAe(xre(),QR);CAe(ZPi(),QR);CAe(XPi(),QR);CAe(e2i(),QR)});var YSr=I(zSr=>{"use strict";p();Object.defineProperty(zSr,"__esModule",{value:!0});zSr.OmitFromMappedResult=y7a;var p7a=wm(),h7a=FAt(),m7a=Zb();function g7a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,h7a.Omit)(t[o],e,(0,m7a.Clone)(r));return n}a(g7a,"FromProperties");function A7a(t,e,r){return g7a(t.properties,e,r)}a(A7a,"FromMappedResult");function y7a(t,e,r){let n=A7a(t,e,r);return(0,p7a.MappedResult)(n)}a(y7a,"OmitFromMappedResult")});var FAt=I(ZSr=>{"use strict";p();Object.defineProperty(ZSr,"__esModule",{value:!0});ZSr.Omit=M7a;var E7a=Ii(),_7a=Zgt(),v7a=K5e(),KSr=KG(),C7a=GE(),b7a=CD(),S7a=oI(),t2i=Rp(),r2i=kv(),T7a=XSr(),I7a=YSr(),T6=Es(),x7a=Rv();function w7a(t,e){return t.map(r=>JSr(r,e))}a(w7a,"FromIntersect");function R7a(t,e){return t.map(r=>JSr(r,e))}a(R7a,"FromUnion");function k7a(t,e){let{[e]:r,...n}=t;return n}a(k7a,"FromProperty");function P7a(t,e){return e.reduce((r,n)=>k7a(r,n),t)}a(P7a,"FromProperties");function D7a(t,e,r){let n=(0,_7a.Discard)(t,[v7a.TransformKind,"$id","required","properties"]),o=P7a(r,e);return(0,r2i.Object)(o,n)}a(D7a,"FromObject");function N7a(t){let e=t.reduce((r,n)=>(0,T6.IsLiteralValue)(n)?[...r,(0,C7a.Literal)(n)]:r,[]);return(0,t2i.Union)(e)}a(N7a,"UnionFromPropertyKeys");function JSr(t,e){return(0,T6.IsIntersect)(t)?(0,S7a.Intersect)(w7a(t.allOf,e)):(0,T6.IsUnion)(t)?(0,t2i.Union)(R7a(t.anyOf,e)):(0,T6.IsObject)(t)?D7a(t,e,t.properties):(0,r2i.Object)({})}a(JSr,"OmitResolve");function M7a(t,e,r){let n=(0,x7a.IsArray)(e)?N7a(e):e,o=(0,T6.IsSchema)(e)?(0,b7a.IndexPropertyKeys)(e):e,s=(0,T6.IsRef)(t),c=(0,T6.IsRef)(e);return(0,T6.IsMappedResult)(t)?(0,I7a.OmitFromMappedResult)(t,o,r):(0,T6.IsMappedKey)(e)?(0,T7a.OmitFromMappedKey)(t,e,r):s&&c?(0,KSr.Computed)("Omit",[t,n],r):!s&&c?(0,KSr.Computed)("Omit",[t,n],r):s&&!c?(0,KSr.Computed)("Omit",[t,n],r):(0,E7a.CreateType)({...JSr(t,o),...r})}a(M7a,"Omit")});var XSr=I(eTr=>{"use strict";p();Object.defineProperty(eTr,"__esModule",{value:!0});eTr.OmitFromMappedKey=q7a;var O7a=wm(),L7a=FAt(),B7a=Zb();function F7a(t,e,r){return{[e]:(0,L7a.Omit)(t,[e],(0,B7a.Clone)(r))}}a(F7a,"FromPropertyKey");function U7a(t,e,r){return e.reduce((n,o)=>({...n,...F7a(t,o,r)}),{})}a(U7a,"FromPropertyKeys");function Q7a(t,e,r){return U7a(t,e.keys,r)}a(Q7a,"FromMappedKey");function q7a(t,e,r){let n=Q7a(t,e,r);return(0,O7a.MappedResult)(n)}a(q7a,"OmitFromMappedKey")});var _4e=I(I6=>{"use strict";p();var j7a=I6&&I6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),tTr=I6&&I6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&j7a(e,t,r)};Object.defineProperty(I6,"__esModule",{value:!0});tTr(XSr(),I6);tTr(YSr(),I6);tTr(FAt(),I6)});var nTr=I(rTr=>{"use strict";p();Object.defineProperty(rTr,"__esModule",{value:!0});rTr.PickFromMappedResult=z7a;var H7a=wm(),G7a=UAt(),$7a=Zb();function V7a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,G7a.Pick)(t[o],e,(0,$7a.Clone)(r));return n}a(V7a,"FromProperties");function W7a(t,e,r){return V7a(t.properties,e,r)}a(W7a,"FromMappedResult");function z7a(t,e,r){let n=W7a(t,e,r);return(0,H7a.MappedResult)(n)}a(z7a,"PickFromMappedResult")});var UAt=I(sTr=>{"use strict";p();Object.defineProperty(sTr,"__esModule",{value:!0});sTr.Pick=lQa;var Y7a=Ii(),K7a=Zgt(),iTr=KG(),J7a=oI(),Z7a=GE(),n2i=kv(),i2i=Rp(),X7a=CD(),eQa=K5e(),x6=Es(),tQa=Rv(),rQa=aTr(),nQa=nTr();function iQa(t,e){return t.map(r=>oTr(r,e))}a(iQa,"FromIntersect");function oQa(t,e){return t.map(r=>oTr(r,e))}a(oQa,"FromUnion");function sQa(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(sQa,"FromProperties");function aQa(t,e,r){let n=(0,K7a.Discard)(t,[eQa.TransformKind,"$id","required","properties"]),o=sQa(r,e);return(0,n2i.Object)(o,n)}a(aQa,"FromObject");function cQa(t){let e=t.reduce((r,n)=>(0,x6.IsLiteralValue)(n)?[...r,(0,Z7a.Literal)(n)]:r,[]);return(0,i2i.Union)(e)}a(cQa,"UnionFromPropertyKeys");function oTr(t,e){return(0,x6.IsIntersect)(t)?(0,J7a.Intersect)(iQa(t.allOf,e)):(0,x6.IsUnion)(t)?(0,i2i.Union)(oQa(t.anyOf,e)):(0,x6.IsObject)(t)?aQa(t,e,t.properties):(0,n2i.Object)({})}a(oTr,"PickResolve");function lQa(t,e,r){let n=(0,tQa.IsArray)(e)?cQa(e):e,o=(0,x6.IsSchema)(e)?(0,X7a.IndexPropertyKeys)(e):e,s=(0,x6.IsRef)(t),c=(0,x6.IsRef)(e);return(0,x6.IsMappedResult)(t)?(0,nQa.PickFromMappedResult)(t,o,r):(0,x6.IsMappedKey)(e)?(0,rQa.PickFromMappedKey)(t,e,r):s&&c?(0,iTr.Computed)("Pick",[t,n],r):!s&&c?(0,iTr.Computed)("Pick",[t,n],r):s&&!c?(0,iTr.Computed)("Pick",[t,n],r):(0,Y7a.CreateType)({...oTr(t,o),...r})}a(lQa,"Pick")});var aTr=I(cTr=>{"use strict";p();Object.defineProperty(cTr,"__esModule",{value:!0});cTr.PickFromMappedKey=gQa;var uQa=wm(),dQa=UAt(),fQa=Zb();function pQa(t,e,r){return{[e]:(0,dQa.Pick)(t,[e],(0,fQa.Clone)(r))}}a(pQa,"FromPropertyKey");function hQa(t,e,r){return e.reduce((n,o)=>({...n,...pQa(t,o,r)}),{})}a(hQa,"FromPropertyKeys");function mQa(t,e,r){return hQa(t,e.keys,r)}a(mQa,"FromMappedKey");function gQa(t,e,r){let n=mQa(t,e,r);return(0,uQa.MappedResult)(n)}a(gQa,"PickFromMappedKey")});var v4e=I(w6=>{"use strict";p();var AQa=w6&&w6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lTr=w6&&w6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&AQa(e,t,r)};Object.defineProperty(w6,"__esModule",{value:!0});lTr(aTr(),w6);lTr(nTr(),w6);lTr(UAt(),w6)});var dTr=I(R6=>{"use strict";p();var yQa=R6&&R6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),EQa=R6&&R6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),_Qa=R6&&R6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oa2i(e))}a(o2i,"FromRest");function a2i(t){return Dv.IsComputed(t)?RQa(t.target,t.parameters):Dv.IsRef(t)?kQa(t.$ref):Dv.IsIntersect(t)?(0,bQa.Intersect)(o2i(t.allOf)):Dv.IsUnion(t)?(0,SQa.Union)(o2i(t.anyOf)):Dv.IsObject(t)?DQa(t,t.properties):Dv.IsBigInt(t)||Dv.IsBoolean(t)||Dv.IsInteger(t)||Dv.IsLiteral(t)||Dv.IsNull(t)||Dv.IsNumber(t)||Dv.IsString(t)||Dv.IsSymbol(t)||Dv.IsUndefined(t)?t:(0,s2i.Object)({})}a(a2i,"PartialResolve");function NQa(t,e){return Dv.IsMappedResult(t)?(0,wQa.PartialFromMappedResult)(t,e):(0,vQa.CreateType)({...a2i(t),...e})}a(NQa,"Partial")});var fTr=I(pTr=>{"use strict";p();Object.defineProperty(pTr,"__esModule",{value:!0});pTr.PartialFromMappedResult=UQa;var MQa=wm(),OQa=dTr(),LQa=Zb();function BQa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,OQa.Partial)(t[n],(0,LQa.Clone)(e));return r}a(BQa,"FromProperties");function FQa(t,e){return BQa(t.properties,e)}a(FQa,"FromMappedResult");function UQa(t,e){let r=FQa(t,e);return(0,MQa.MappedResult)(r)}a(UQa,"PartialFromMappedResult")});var C4e=I(s$=>{"use strict";p();var QQa=s$&&s$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),c2i=s$&&s$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&QQa(e,t,r)};Object.defineProperty(s$,"__esModule",{value:!0});c2i(fTr(),s$);c2i(dTr(),s$)});var mTr=I(k6=>{"use strict";p();var qQa=k6&&k6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jQa=k6&&k6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),HQa=k6&&k6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;op2i(e))}a(l2i,"FromRest");function p2i(t){return Nv.IsComputed(t)?YQa(t.target,t.parameters):Nv.IsRef(t)?KQa(t.$ref):Nv.IsIntersect(t)?(0,$Qa.Intersect)(l2i(t.allOf)):Nv.IsUnion(t)?(0,VQa.Union)(l2i(t.anyOf)):Nv.IsObject(t)?ZQa(t,t.properties):Nv.IsBigInt(t)||Nv.IsBoolean(t)||Nv.IsInteger(t)||Nv.IsLiteral(t)||Nv.IsNull(t)||Nv.IsNumber(t)||Nv.IsString(t)||Nv.IsSymbol(t)||Nv.IsUndefined(t)?t:(0,u2i.Object)({})}a(p2i,"RequiredResolve");function XQa(t,e){return Nv.IsMappedResult(t)?(0,zQa.RequiredFromMappedResult)(t,e):(0,GQa.CreateType)({...p2i(t),...e})}a(XQa,"Required")});var gTr=I(ATr=>{"use strict";p();Object.defineProperty(ATr,"__esModule",{value:!0});ATr.RequiredFromMappedResult=iqa;var eqa=wm(),tqa=mTr();function rqa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,tqa.Required)(t[n],e);return r}a(rqa,"FromProperties");function nqa(t,e){return rqa(t.properties,e)}a(nqa,"FromMappedResult");function iqa(t,e){let r=nqa(t,e);return(0,eqa.MappedResult)(r)}a(iqa,"RequiredFromMappedResult")});var b4e=I(a$=>{"use strict";p();var oqa=a$&&a$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),h2i=a$&&a$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&oqa(e,t,r)};Object.defineProperty(a$,"__esModule",{value:!0});h2i(gTr(),a$);h2i(mTr(),a$)});var y2i=I(ID=>{"use strict";p();var sqa=ID&&ID.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aqa=ID&&ID.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),cqa=ID&&ID.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oEy.IsRef(r)?ETr(t,r.$ref):s1(t,r))}a(Iqa,"DereferenceParameters");function ETr(t,e){return e in t?Ey.IsRef(t[e])?ETr(t,t[e].$ref):s1(t,t[e]):(0,yTr.Never)()}a(ETr,"Dereference");function xqa(t){return(0,dqa.Awaited)(t[0])}a(xqa,"FromAwaited");function wqa(t){return(0,hqa.Index)(t[0],t[1])}a(wqa,"FromIndex");function Rqa(t){return(0,yqa.KeyOf)(t[0])}a(Rqa,"FromKeyOf");function kqa(t){return(0,Cqa.Partial)(t[0])}a(kqa,"FromPartial");function Pqa(t){return(0,_qa.Omit)(t[0],t[1])}a(Pqa,"FromOmit");function Dqa(t){return(0,vqa.Pick)(t[0],t[1])}a(Dqa,"FromPick");function Nqa(t){return(0,bqa.Required)(t[0])}a(Nqa,"FromRequired");function Mqa(t,e,r){let n=Iqa(t,r);return e==="Awaited"?xqa(n):e==="Index"?wqa(n):e==="KeyOf"?Rqa(n):e==="Partial"?kqa(n):e==="Omit"?Pqa(n):e==="Pick"?Dqa(n):e==="Required"?Nqa(n):(0,yTr.Never)()}a(Mqa,"FromComputed");function Oqa(t,e){return(0,uqa.Array)(s1(t,e))}a(Oqa,"FromArray");function Lqa(t,e){return(0,fqa.AsyncIterator)(s1(t,e))}a(Lqa,"FromAsyncIterator");function Bqa(t,e,r){return(0,pqa.Constructor)(S4e(t,e),s1(t,r))}a(Bqa,"FromConstructor");function Fqa(t,e,r){return(0,mqa.Function)(S4e(t,e),s1(t,r))}a(Fqa,"FromFunction");function Uqa(t,e){return(0,gqa.Intersect)(S4e(t,e))}a(Uqa,"FromIntersect");function Qqa(t,e){return(0,Aqa.Iterator)(s1(t,e))}a(Qqa,"FromIterator");function qqa(t,e){return(0,Eqa.Object)(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:s1(t,e[n])}),{}))}a(qqa,"FromObject");function jqa(t,e){let[r,n]=[s1(t,(0,g2i.RecordValue)(e)),(0,g2i.RecordPattern)(e)],o=(0,lqa.CloneType)(e);return o.patternProperties[n]=r,o}a(jqa,"FromRecord");function Hqa(t,e){return Ey.IsRef(e)?{...ETr(t,e.$ref),[QAt.TransformKind]:e[QAt.TransformKind]}:e}a(Hqa,"FromTransform");function Gqa(t,e){return(0,Sqa.Tuple)(S4e(t,e))}a(Gqa,"FromTuple");function $qa(t,e){return(0,Tqa.Union)(S4e(t,e))}a($qa,"FromUnion");function S4e(t,e){return e.map(r=>s1(t,r))}a(S4e,"FromTypes");function s1(t,e){return Ey.IsOptional(e)?(0,o1.CreateType)(s1(t,(0,m2i.Discard)(e,[QAt.OptionalKind])),e):Ey.IsReadonly(e)?(0,o1.CreateType)(s1(t,(0,m2i.Discard)(e,[QAt.ReadonlyKind])),e):Ey.IsTransform(e)?(0,o1.CreateType)(Hqa(t,e),e):Ey.IsArray(e)?(0,o1.CreateType)(Oqa(t,e.items),e):Ey.IsAsyncIterator(e)?(0,o1.CreateType)(Lqa(t,e.items),e):Ey.IsComputed(e)?(0,o1.CreateType)(Mqa(t,e.target,e.parameters)):Ey.IsConstructor(e)?(0,o1.CreateType)(Bqa(t,e.parameters,e.returns),e):Ey.IsFunction(e)?(0,o1.CreateType)(Fqa(t,e.parameters,e.returns),e):Ey.IsIntersect(e)?(0,o1.CreateType)(Uqa(t,e.allOf),e):Ey.IsIterator(e)?(0,o1.CreateType)(Qqa(t,e.items),e):Ey.IsObject(e)?(0,o1.CreateType)(qqa(t,e.properties),e):Ey.IsRecord(e)?(0,o1.CreateType)(jqa(t,e)):Ey.IsTuple(e)?(0,o1.CreateType)(Gqa(t,e.items||[]),e):Ey.IsUnion(e)?(0,o1.CreateType)($qa(t,e.anyOf),e):e}a(s1,"FromType");function A2i(t,e){return e in t?s1(t,t[e]):(0,yTr.Never)()}a(A2i,"ComputeType");function Vqa(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:A2i(t,r)}),{})}a(Vqa,"ComputeModuleProperties")});var _2i=I(T4e=>{"use strict";p();Object.defineProperty(T4e,"__esModule",{value:!0});T4e.TModule=void 0;T4e.Module=Yqa;var E2i=p6(),Wqa=bn(),zqa=y2i(),qAt=class{static{a(this,"TModule")}constructor(e){let r=(0,zqa.ComputeModuleProperties)(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:(0,E2i.CreateType)(this.$defs[e],r)};return(0,E2i.CreateType)({[Wqa.Kind]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};T4e.TModule=qAt;function Yqa(t){return new qAt(t)}a(Yqa,"Module")});var jAt=I(wre=>{"use strict";p();var Kqa=wre&&wre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Jqa=wre&&wre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Kqa(e,t,r)};Object.defineProperty(wre,"__esModule",{value:!0});Jqa(_2i(),wre)});var v2i=I(_Tr=>{"use strict";p();Object.defineProperty(_Tr,"__esModule",{value:!0});_Tr.Not=eja;var Zqa=Ii(),Xqa=bn();function eja(t,e){return(0,Zqa.CreateType)({[Xqa.Kind]:"Not",not:t},e)}a(eja,"Not")});var HAt=I(Rre=>{"use strict";p();var tja=Rre&&Rre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rja=Rre&&Rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tja(e,t,r)};Object.defineProperty(Rre,"__esModule",{value:!0});rja(v2i(),Rre)});var C2i=I(P6=>{"use strict";p();var nja=P6&&P6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ija=P6&&P6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),oja=P6&&P6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var uja=kre&&kre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dja=kre&&kre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uja(e,t,r)};Object.defineProperty(kre,"__esModule",{value:!0});dja(C2i(),kre)});var S2i=I(vTr=>{"use strict";p();Object.defineProperty(vTr,"__esModule",{value:!0});vTr.Recursive=gja;var fja=Ggt(),pja=Ii(),hja=Rv(),b2i=bn(),mja=0;function gja(t,e={}){(0,hja.IsUndefined)(e.$id)&&(e.$id=`T${mja++}`);let r=(0,fja.CloneType)(t({[b2i.Kind]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,(0,pja.CreateType)({[b2i.Hint]:"Recursive",...r},e)}a(gja,"Recursive")});var $At=I(Pre=>{"use strict";p();var Aja=Pre&&Pre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yja=Pre&&Pre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Aja(e,t,r)};Object.defineProperty(Pre,"__esModule",{value:!0});yja(S2i(),Pre)});var T2i=I(CTr=>{"use strict";p();Object.defineProperty(CTr,"__esModule",{value:!0});CTr.RegExp=Cja;var Eja=Ii(),_ja=Rv(),vja=bn();function Cja(t,e){let r=(0,_ja.IsString)(t)?new globalThis.RegExp(t):t;return(0,Eja.CreateType)({[vja.Kind]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(Cja,"RegExp")});var VAt=I(Dre=>{"use strict";p();var bja=Dre&&Dre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Sja=Dre&&Dre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bja(e,t,r)};Object.defineProperty(Dre,"__esModule",{value:!0});Sja(T2i(),Dre)});var I2i=I(STr=>{"use strict";p();Object.defineProperty(STr,"__esModule",{value:!0});STr.Rest=Ija;var bTr=Es();function Tja(t){return(0,bTr.IsIntersect)(t)?t.allOf:(0,bTr.IsUnion)(t)?t.anyOf:(0,bTr.IsTuple)(t)?t.items??[]:[]}a(Tja,"RestResolve");function Ija(t){return Tja(t)}a(Ija,"Rest")});var WAt=I(Nre=>{"use strict";p();var xja=Nre&&Nre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wja=Nre&&Nre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xja(e,t,r)};Object.defineProperty(Nre,"__esModule",{value:!0});wja(I2i(),Nre)});var x2i=I(D6=>{"use strict";p();var Rja=D6&&D6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kja=D6&&D6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Pja=D6&&D6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var Lja=Mre&&Mre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Bja=Mre&&Mre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Lja(e,t,r)};Object.defineProperty(Mre,"__esModule",{value:!0});Bja(x2i(),Mre)});var R2i=I(w2i=>{"use strict";p();Object.defineProperty(w2i,"__esModule",{value:!0})});var P2i=I(k2i=>{"use strict";p();Object.defineProperty(k2i,"__esModule",{value:!0});var fOp=bn()});var N2i=I(c$=>{"use strict";p();var Fja=c$&&c$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),D2i=c$&&c$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Fja(e,t,r)};Object.defineProperty(c$,"__esModule",{value:!0});D2i(R2i(),c$);D2i(P2i(),c$)});var O2i=I(M2i=>{"use strict";p();Object.defineProperty(M2i,"__esModule",{value:!0})});var L2i=I(Ore=>{"use strict";p();var Uja=Ore&&Ore.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qja=Ore&&Ore.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Uja(e,t,r)};Object.defineProperty(Ore,"__esModule",{value:!0});Qja(O2i(),Ore)});var B2i=I(Lre=>{"use strict";p();Object.defineProperty(Lre,"__esModule",{value:!0});Lre.TransformEncodeBuilder=Lre.TransformDecodeBuilder=void 0;Lre.Transform=jja;var YAt=bn(),qja=Es(),KAt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new JAt(this.schema,e)}};Lre.TransformDecodeBuilder=KAt;var JAt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[YAt.TransformKind].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[YAt.TransformKind].Decode(c)),"Decode")};return{...r,[YAt.TransformKind]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[YAt.TransformKind]:n}}Encode(e){return(0,qja.IsTransform)(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};Lre.TransformEncodeBuilder=JAt;function jja(t){return new KAt(t)}a(jja,"Transform")});var ZAt=I(Bre=>{"use strict";p();var Hja=Bre&&Bre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Gja=Bre&&Bre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Hja(e,t,r)};Object.defineProperty(Bre,"__esModule",{value:!0});Gja(B2i(),Bre)});var U2i=I(TTr=>{"use strict";p();Object.defineProperty(TTr,"__esModule",{value:!0});TTr.Unsafe=Vja;var $ja=Ii(),F2i=bn();function Vja(t={}){return(0,$ja.CreateType)({[F2i.Kind]:t[F2i.Kind]??"Unsafe"},t)}a(Vja,"Unsafe")});var I4e=I(Fre=>{"use strict";p();var Wja=Fre&&Fre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zja=Fre&&Fre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Wja(e,t,r)};Object.defineProperty(Fre,"__esModule",{value:!0});zja(U2i(),Fre)});var Q2i=I(ITr=>{"use strict";p();Object.defineProperty(ITr,"__esModule",{value:!0});ITr.Void=Jja;var Yja=Ii(),Kja=bn();function Jja(t){return(0,Yja.CreateType)({[Kja.Kind]:"Void",type:"void"},t)}a(Jja,"Void")});var XAt=I(Ure=>{"use strict";p();var Zja=Ure&&Ure.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xja=Ure&&Ure.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Zja(e,t,r)};Object.defineProperty(Ure,"__esModule",{value:!0});Xja(Q2i(),Ure)});var wTr=I(tyt=>{"use strict";p();Object.defineProperty(tyt,"__esModule",{value:!0});tyt.JsonTypeBuilder=void 0;var eHa=sAe(),tHa=aAe(),rHa=i4e(),nHa=mAt(),iHa=AAt(),oHa=EAt(),sHa=wAt(),aHa=Ere(),cHa=PAt(),lHa=CD(),uHa=MAt(),dHa=oI(),eyt=BAt(),fHa=bD(),pHa=GE(),hHa=wm(),mHa=xm(),gHa=HAt(),AHa=h4e(),yHa=jAt(),EHa=ZG(),_Ha=kv(),vHa=_4e(),CHa=z4(),bHa=C4e(),SHa=v4e(),THa=r$(),IHa=E4e(),xHa=_Ae(),wHa=$At(),RHa=i$(),kHa=b4e(),PHa=WAt(),DHa=XG(),NHa=vD(),MHa=ZAt(),OHa=y6(),LHa=Rp(),BHa=o$(),FHa=I4e(),xTr=class{static{a(this,"JsonTypeBuilder")}ReadonlyOptional(e){return(0,IHa.ReadonlyOptional)(e)}Readonly(e,r){return(0,THa.Readonly)(e,r??!0)}Optional(e,r){return(0,CHa.Optional)(e,r??!0)}Any(e){return(0,eHa.Any)(e)}Array(e,r){return(0,tHa.Array)(e,r)}Boolean(e){return(0,rHa.Boolean)(e)}Capitalize(e,r){return(0,eyt.Capitalize)(e,r)}Composite(e,r){return(0,nHa.Composite)(e,r)}Const(e,r){return(0,iHa.Const)(e,r)}Enum(e,r){return(0,oHa.Enum)(e,r)}Exclude(e,r,n){return(0,sHa.Exclude)(e,r,n)}Extends(e,r,n,o,s){return(0,aHa.Extends)(e,r,n,o,s)}Extract(e,r,n){return(0,cHa.Extract)(e,r,n)}Index(e,r,n){return(0,lHa.Index)(e,r,n)}Integer(e){return(0,uHa.Integer)(e)}Intersect(e,r){return(0,dHa.Intersect)(e,r)}KeyOf(e,r){return(0,fHa.KeyOf)(e,r)}Literal(e,r){return(0,pHa.Literal)(e,r)}Lowercase(e,r){return(0,eyt.Lowercase)(e,r)}Mapped(e,r,n){return(0,hHa.Mapped)(e,r,n)}Module(e){return(0,yHa.Module)(e)}Never(e){return(0,mHa.Never)(e)}Not(e,r){return(0,gHa.Not)(e,r)}Null(e){return(0,AHa.Null)(e)}Number(e){return(0,EHa.Number)(e)}Object(e,r){return(0,_Ha.Object)(e,r)}Omit(e,r,n){return(0,vHa.Omit)(e,r,n)}Partial(e,r){return(0,bHa.Partial)(e,r)}Pick(e,r,n){return(0,SHa.Pick)(e,r,n)}Record(e,r,n){return(0,xHa.Record)(e,r,n)}Recursive(e,r){return(0,wHa.Recursive)(e,r)}Ref(...e){return(0,RHa.Ref)(e[0],e[1])}Required(e,r){return(0,kHa.Required)(e,r)}Rest(e){return(0,PHa.Rest)(e)}String(e){return(0,DHa.String)(e)}TemplateLiteral(e,r){return(0,NHa.TemplateLiteral)(e,r)}Transform(e){return(0,MHa.Transform)(e)}Tuple(e,r){return(0,OHa.Tuple)(e,r)}Uncapitalize(e,r){return(0,eyt.Uncapitalize)(e,r)}Union(e,r){return(0,LHa.Union)(e,r)}Unknown(e){return(0,BHa.Unknown)(e)}Unsafe(e){return(0,FHa.Unsafe)(e)}Uppercase(e,r){return(0,eyt.Uppercase)(e,r)}};tyt.JsonTypeBuilder=xTr});var q2i=I(Ot=>{"use strict";p();Object.defineProperty(Ot,"__esModule",{value:!0});Ot.Rest=Ot.Required=Ot.RegExp=Ot.Ref=Ot.Recursive=Ot.Record=Ot.ReadonlyOptional=Ot.Readonly=Ot.Promise=Ot.Pick=Ot.Partial=Ot.Parameters=Ot.Optional=Ot.Omit=Ot.Object=Ot.Number=Ot.Null=Ot.Not=Ot.Never=Ot.Module=Ot.Mapped=Ot.Literal=Ot.KeyOf=Ot.Iterator=Ot.Uppercase=Ot.Lowercase=Ot.Uncapitalize=Ot.Capitalize=Ot.Intersect=Ot.Integer=Ot.Instantiate=Ot.InstanceType=Ot.Index=Ot.Function=Ot.Extract=Ot.Extends=Ot.Exclude=Ot.Enum=Ot.Date=Ot.ConstructorParameters=Ot.Constructor=Ot.Const=Ot.Composite=Ot.Boolean=Ot.BigInt=Ot.Awaited=Ot.AsyncIterator=Ot.Array=Ot.Argument=Ot.Any=void 0;Ot.Void=Ot.Unsafe=Ot.Unknown=Ot.Union=Ot.Undefined=Ot.Uint8Array=Ot.Tuple=Ot.Transform=Ot.TemplateLiteral=Ot.Symbol=Ot.String=Ot.ReturnType=void 0;var UHa=sAe();Object.defineProperty(Ot,"Any",{enumerable:!0,get:a(function(){return UHa.Any},"get")});var QHa=Jgt();Object.defineProperty(Ot,"Argument",{enumerable:!0,get:a(function(){return QHa.Argument},"get")});var qHa=aAe();Object.defineProperty(Ot,"Array",{enumerable:!0,get:a(function(){return qHa.Array},"get")});var jHa=cAe();Object.defineProperty(Ot,"AsyncIterator",{enumerable:!0,get:a(function(){return jHa.AsyncIterator},"get")});var HHa=f4e();Object.defineProperty(Ot,"Awaited",{enumerable:!0,get:a(function(){return HHa.Awaited},"get")});var GHa=pAe();Object.defineProperty(Ot,"BigInt",{enumerable:!0,get:a(function(){return GHa.BigInt},"get")});var $Ha=i4e();Object.defineProperty(Ot,"Boolean",{enumerable:!0,get:a(function(){return $Ha.Boolean},"get")});var VHa=mAt();Object.defineProperty(Ot,"Composite",{enumerable:!0,get:a(function(){return VHa.Composite},"get")});var WHa=AAt();Object.defineProperty(Ot,"Const",{enumerable:!0,get:a(function(){return WHa.Const},"get")});var zHa=lAe();Object.defineProperty(Ot,"Constructor",{enumerable:!0,get:a(function(){return zHa.Constructor},"get")});var YHa=yAt();Object.defineProperty(Ot,"ConstructorParameters",{enumerable:!0,get:a(function(){return YHa.ConstructorParameters},"get")});var KHa=p4e();Object.defineProperty(Ot,"Date",{enumerable:!0,get:a(function(){return KHa.Date},"get")});var JHa=EAt();Object.defineProperty(Ot,"Enum",{enumerable:!0,get:a(function(){return JHa.Enum},"get")});var ZHa=wAt();Object.defineProperty(Ot,"Exclude",{enumerable:!0,get:a(function(){return ZHa.Exclude},"get")});var XHa=Ere();Object.defineProperty(Ot,"Extends",{enumerable:!0,get:a(function(){return XHa.Extends},"get")});var eGa=PAt();Object.defineProperty(Ot,"Extract",{enumerable:!0,get:a(function(){return eGa.Extract},"get")});var tGa=JG();Object.defineProperty(Ot,"Function",{enumerable:!0,get:a(function(){return tGa.Function},"get")});var rGa=CD();Object.defineProperty(Ot,"Index",{enumerable:!0,get:a(function(){return rGa.Index},"get")});var nGa=DAt();Object.defineProperty(Ot,"InstanceType",{enumerable:!0,get:a(function(){return nGa.InstanceType},"get")});var iGa=NAt();Object.defineProperty(Ot,"Instantiate",{enumerable:!0,get:a(function(){return iGa.Instantiate},"get")});var oGa=MAt();Object.defineProperty(Ot,"Integer",{enumerable:!0,get:a(function(){return oGa.Integer},"get")});var sGa=oI();Object.defineProperty(Ot,"Intersect",{enumerable:!0,get:a(function(){return sGa.Intersect},"get")});var ryt=BAt();Object.defineProperty(Ot,"Capitalize",{enumerable:!0,get:a(function(){return ryt.Capitalize},"get")});Object.defineProperty(Ot,"Uncapitalize",{enumerable:!0,get:a(function(){return ryt.Uncapitalize},"get")});Object.defineProperty(Ot,"Lowercase",{enumerable:!0,get:a(function(){return ryt.Lowercase},"get")});Object.defineProperty(Ot,"Uppercase",{enumerable:!0,get:a(function(){return ryt.Uppercase},"get")});var aGa=mAe();Object.defineProperty(Ot,"Iterator",{enumerable:!0,get:a(function(){return aGa.Iterator},"get")});var cGa=bD();Object.defineProperty(Ot,"KeyOf",{enumerable:!0,get:a(function(){return cGa.KeyOf},"get")});var lGa=GE();Object.defineProperty(Ot,"Literal",{enumerable:!0,get:a(function(){return lGa.Literal},"get")});var uGa=wm();Object.defineProperty(Ot,"Mapped",{enumerable:!0,get:a(function(){return uGa.Mapped},"get")});var dGa=jAt();Object.defineProperty(Ot,"Module",{enumerable:!0,get:a(function(){return dGa.Module},"get")});var fGa=xm();Object.defineProperty(Ot,"Never",{enumerable:!0,get:a(function(){return fGa.Never},"get")});var pGa=HAt();Object.defineProperty(Ot,"Not",{enumerable:!0,get:a(function(){return pGa.Not},"get")});var hGa=h4e();Object.defineProperty(Ot,"Null",{enumerable:!0,get:a(function(){return hGa.Null},"get")});var mGa=ZG();Object.defineProperty(Ot,"Number",{enumerable:!0,get:a(function(){return mGa.Number},"get")});var gGa=kv();Object.defineProperty(Ot,"Object",{enumerable:!0,get:a(function(){return gGa.Object},"get")});var AGa=_4e();Object.defineProperty(Ot,"Omit",{enumerable:!0,get:a(function(){return AGa.Omit},"get")});var yGa=z4();Object.defineProperty(Ot,"Optional",{enumerable:!0,get:a(function(){return yGa.Optional},"get")});var EGa=GAt();Object.defineProperty(Ot,"Parameters",{enumerable:!0,get:a(function(){return EGa.Parameters},"get")});var _Ga=C4e();Object.defineProperty(Ot,"Partial",{enumerable:!0,get:a(function(){return _Ga.Partial},"get")});var vGa=v4e();Object.defineProperty(Ot,"Pick",{enumerable:!0,get:a(function(){return vGa.Pick},"get")});var CGa=l4e();Object.defineProperty(Ot,"Promise",{enumerable:!0,get:a(function(){return CGa.Promise},"get")});var bGa=r$();Object.defineProperty(Ot,"Readonly",{enumerable:!0,get:a(function(){return bGa.Readonly},"get")});var SGa=E4e();Object.defineProperty(Ot,"ReadonlyOptional",{enumerable:!0,get:a(function(){return SGa.ReadonlyOptional},"get")});var TGa=_Ae();Object.defineProperty(Ot,"Record",{enumerable:!0,get:a(function(){return TGa.Record},"get")});var IGa=$At();Object.defineProperty(Ot,"Recursive",{enumerable:!0,get:a(function(){return IGa.Recursive},"get")});var xGa=i$();Object.defineProperty(Ot,"Ref",{enumerable:!0,get:a(function(){return xGa.Ref},"get")});var wGa=VAt();Object.defineProperty(Ot,"RegExp",{enumerable:!0,get:a(function(){return wGa.RegExp},"get")});var RGa=b4e();Object.defineProperty(Ot,"Required",{enumerable:!0,get:a(function(){return RGa.Required},"get")});var kGa=WAt();Object.defineProperty(Ot,"Rest",{enumerable:!0,get:a(function(){return kGa.Rest},"get")});var PGa=zAt();Object.defineProperty(Ot,"ReturnType",{enumerable:!0,get:a(function(){return PGa.ReturnType},"get")});var DGa=XG();Object.defineProperty(Ot,"String",{enumerable:!0,get:a(function(){return DGa.String},"get")});var NGa=m4e();Object.defineProperty(Ot,"Symbol",{enumerable:!0,get:a(function(){return NGa.Symbol},"get")});var MGa=vD();Object.defineProperty(Ot,"TemplateLiteral",{enumerable:!0,get:a(function(){return MGa.TemplateLiteral},"get")});var OGa=ZAt();Object.defineProperty(Ot,"Transform",{enumerable:!0,get:a(function(){return OGa.Transform},"get")});var LGa=y6();Object.defineProperty(Ot,"Tuple",{enumerable:!0,get:a(function(){return LGa.Tuple},"get")});var BGa=A4e();Object.defineProperty(Ot,"Uint8Array",{enumerable:!0,get:a(function(){return BGa.Uint8Array},"get")});var FGa=g4e();Object.defineProperty(Ot,"Undefined",{enumerable:!0,get:a(function(){return FGa.Undefined},"get")});var UGa=Rp();Object.defineProperty(Ot,"Union",{enumerable:!0,get:a(function(){return UGa.Union},"get")});var QGa=o$();Object.defineProperty(Ot,"Unknown",{enumerable:!0,get:a(function(){return QGa.Unknown},"get")});var qGa=I4e();Object.defineProperty(Ot,"Unsafe",{enumerable:!0,get:a(function(){return qGa.Unsafe},"get")});var jGa=XAt();Object.defineProperty(Ot,"Void",{enumerable:!0,get:a(function(){return jGa.Void},"get")})});var j2i=I(nyt=>{"use strict";p();Object.defineProperty(nyt,"__esModule",{value:!0});nyt.JavaScriptTypeBuilder=void 0;var HGa=wTr(),GGa=Jgt(),$Ga=cAe(),VGa=f4e(),WGa=pAe(),zGa=lAe(),YGa=yAt(),KGa=p4e(),JGa=JG(),ZGa=DAt(),XGa=NAt(),e$a=mAe(),t$a=GAt(),r$a=l4e(),n$a=VAt(),i$a=zAt(),o$a=m4e(),s$a=A4e(),a$a=g4e(),c$a=XAt(),RTr=class extends HGa.JsonTypeBuilder{static{a(this,"JavaScriptTypeBuilder")}Argument(e){return(0,GGa.Argument)(e)}AsyncIterator(e,r){return(0,$Ga.AsyncIterator)(e,r)}Awaited(e,r){return(0,VGa.Awaited)(e,r)}BigInt(e){return(0,WGa.BigInt)(e)}ConstructorParameters(e,r){return(0,YGa.ConstructorParameters)(e,r)}Constructor(e,r,n){return(0,zGa.Constructor)(e,r,n)}Date(e={}){return(0,KGa.Date)(e)}Function(e,r,n){return(0,JGa.Function)(e,r,n)}InstanceType(e,r){return(0,ZGa.InstanceType)(e,r)}Instantiate(e,r){return(0,XGa.Instantiate)(e,r)}Iterator(e,r){return(0,e$a.Iterator)(e,r)}Parameters(e,r){return(0,t$a.Parameters)(e,r)}Promise(e,r){return(0,r$a.Promise)(e,r)}RegExp(e,r){return(0,n$a.RegExp)(e,r)}ReturnType(e,r){return(0,i$a.ReturnType)(e,r)}Symbol(e){return(0,o$a.Symbol)(e)}Undefined(e){return(0,a$a.Undefined)(e)}Uint8Array(e){return(0,s$a.Uint8Array)(e)}Void(e){return(0,c$a.Void)(e)}};nyt.JavaScriptTypeBuilder=RTr});var H2i=I(a1=>{"use strict";p();var l$a=a1&&a1.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),u$a=a1&&a1.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),d$a=a1&&a1.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var g$a=en&&en.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yn=en&&en.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&g$a(e,t,r)};Object.defineProperty(en,"__esModule",{value:!0});yn(Ebr(),en);yn(p6(),en);yn(Ff(),en);yn(wbr(),en);yn(GRi(),en);yn(e4e(),en);yn(oAe(),en);yn(t4e(),en);yn(bn(),en);yn(sAe(),en);yn(aAe(),en);yn(Jgt(),en);yn(cAe(),en);yn(f4e(),en);yn(pAe(),en);yn(i4e(),en);yn(mAt(),en);yn(AAt(),en);yn(lAe(),en);yn(yAt(),en);yn(p4e(),en);yn(EAt(),en);yn(wAt(),en);yn(Ere(),en);yn(PAt(),en);yn(JG(),en);yn(CD(),en);yn(DAt(),en);yn(NAt(),en);yn(MAt(),en);yn(oI(),en);yn(mAe(),en);yn(BAt(),en);yn(bD(),en);yn(GE(),en);yn(jAt(),en);yn(wm(),en);yn(xm(),en);yn(HAt(),en);yn(h4e(),en);yn(ZG(),en);yn(kv(),en);yn(_4e(),en);yn(z4(),en);yn(GAt(),en);yn(C4e(),en);yn(v4e(),en);yn(l4e(),en);yn(r$(),en);yn(E4e(),en);yn(_Ae(),en);yn($At(),en);yn(i$(),en);yn(VAt(),en);yn(b4e(),en);yn(WAt(),en);yn(zAt(),en);yn(N2i(),en);yn(L2i(),en);yn(XG(),en);yn(m4e(),en);yn(vD(),en);yn(ZAt(),en);yn(y6(),en);yn(A4e(),en);yn(g4e(),en);yn(Rp(),en);yn(o$(),en);yn(I4e(),en);yn(XAt(),en);yn(H2i(),en)});var $2i=I(qR=>{"use strict";p();var A$a=qR&&qR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),y$a=qR&&qR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),E$a=qR&&qR.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var v$a=X4&&X4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),C$a=X4&&X4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),b$a=X4&&X4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(oyt,"__esModule",{value:!0});oyt.ContextItemOrigin=void 0;var z2i;(function(t){function e(r){return r==="request"||r==="update"}a(e,"is"),t.is=e})(z2i||(oyt.ContextItemOrigin=z2i={}))});var J2i=I(Ou=>{"use strict";p();Object.defineProperty(Ou,"__esModule",{value:!0});Ou.RangeSchema=Ou.WorkspaceFolder=Ou.VersionedTextDocumentIdentifier=Ou.TextEdit=Ou.TextDocumentItem=Ou.Range=Ou.Position=Ou.DocumentUri=Ou.Disposable=Ou.Command=Ou.CancellationTokenSource=Ou.CancellationToken=void 0;var syt=iyt(),xD=ei();Object.defineProperty(Ou,"CancellationToken",{enumerable:!0,get:a(function(){return xD.CancellationToken},"get")});Object.defineProperty(Ou,"CancellationTokenSource",{enumerable:!0,get:a(function(){return xD.CancellationTokenSource},"get")});Object.defineProperty(Ou,"Command",{enumerable:!0,get:a(function(){return xD.Command},"get")});Object.defineProperty(Ou,"Disposable",{enumerable:!0,get:a(function(){return xD.Disposable},"get")});Object.defineProperty(Ou,"DocumentUri",{enumerable:!0,get:a(function(){return xD.DocumentUri},"get")});Object.defineProperty(Ou,"Position",{enumerable:!0,get:a(function(){return xD.Position},"get")});Object.defineProperty(Ou,"Range",{enumerable:!0,get:a(function(){return xD.Range},"get")});Object.defineProperty(Ou,"TextDocumentItem",{enumerable:!0,get:a(function(){return xD.TextDocumentItem},"get")});Object.defineProperty(Ou,"TextEdit",{enumerable:!0,get:a(function(){return xD.TextEdit},"get")});Object.defineProperty(Ou,"VersionedTextDocumentIdentifier",{enumerable:!0,get:a(function(){return xD.VersionedTextDocumentIdentifier},"get")});Object.defineProperty(Ou,"WorkspaceFolder",{enumerable:!0,get:a(function(){return xD.WorkspaceFolder},"get")});var K2i=syt.Type.Object({line:syt.Type.Integer({minimum:0}),character:syt.Type.Integer({minimum:0})});Ou.RangeSchema=syt.Type.Object({start:K2i,end:K2i})});var X2i=I(Z2i=>{"use strict";p();Object.defineProperty(Z2i,"__esModule",{value:!0})});var w4e=I(Uf=>{"use strict";p();var T$a=Uf&&Uf.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),x4e=Uf&&Uf.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&T$a(e,t,r)};Object.defineProperty(Uf,"__esModule",{value:!0});Uf.TextEdit=Uf.Range=Uf.Position=Uf.Disposable=Uf.CancellationTokenSource=Uf.CancellationToken=void 0;var bAe=ei();Object.defineProperty(Uf,"CancellationToken",{enumerable:!0,get:a(function(){return bAe.CancellationToken},"get")});Object.defineProperty(Uf,"CancellationTokenSource",{enumerable:!0,get:a(function(){return bAe.CancellationTokenSource},"get")});Object.defineProperty(Uf,"Disposable",{enumerable:!0,get:a(function(){return bAe.Disposable},"get")});Object.defineProperty(Uf,"Position",{enumerable:!0,get:a(function(){return bAe.Position},"get")});Object.defineProperty(Uf,"Range",{enumerable:!0,get:a(function(){return bAe.Range},"get")});Object.defineProperty(Uf,"TextEdit",{enumerable:!0,get:a(function(){return bAe.TextEdit},"get")});x4e($2i(),Uf);x4e(W2i(),Uf);x4e(Y2i(),Uf);x4e(J2i(),Uf);x4e(X2i(),Uf)});var PTr=I(sI=>{"use strict";p();var I$a=sI&&sI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},eDi=sI&&sI.__param||function(t,e){return function(r,n){e(r,n,t)}},x$a=sI&&sI.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sI,"__esModule",{value:!0});sI.CompletionNotifier=sI.ICompletionsNotifierService=void 0;var w$a=x$a(require("events")),R$a=nn(),k$a=Dte(),P$a=w4e(),D$a=Yg(),N$a=H5e(),ayt="CompletionRequested";sI.ICompletionsNotifierService=(0,R$a.createServiceIdentifier)("ICompletionsNotifierService");var kTr=class{static{a(this,"CompletionNotifier")}#e=new w$a.default;constructor(e,r){this.completionsPromiseQueue=e,this.completionsTelemetryService=r}notifyRequest(e,r,n,o,s){return this.#e.emit(ayt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=(0,D$a.telemetryCatch)(this.completionsTelemetryService,this.completionsPromiseQueue,e,`event.${ayt}`);return this.#e.on(ayt,r),P$a.Disposable.create(()=>this.#e.off(ayt,r))}};sI.CompletionNotifier=kTr;sI.CompletionNotifier=kTr=I$a([eDi(0,N$a.ICompletionsPromiseQueueService),eDi(1,k$a.ICompletionsTelemetryService)],kTr)});var DTr=I(cyt=>{"use strict";p();Object.defineProperty(cyt,"__esModule",{value:!0});cyt.ICompletionsObservableWorkspace=void 0;var M$a=$s();cyt.ICompletionsObservableWorkspace=(0,M$a.createDecorator)("ICompletionsObservableWorkspace")});var Dl=I(wD=>{"use strict";p();Object.defineProperty(wD,"__esModule",{value:!0});wD.logger=wD.Logger=wD.ICompletionsLogTargetService=wD.LogLevel=void 0;var O$a=nn(),L$a=Dte(),B$a=Yg(),Qre;(function(t){t[t.DEBUG=4]="DEBUG",t[t.INFO=3]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=1]="ERROR"})(Qre||(wD.LogLevel=Qre={}));wD.ICompletionsLogTargetService=(0,O$a.createServiceIdentifier)("ICompletionsLogTargetService");var lyt=class{static{a(this,"Logger")}constructor(e){this.category=e}log(e,r,...n){e.logIt(r,this.category,...n)}debug(e,...r){this.log(e,Qre.DEBUG,...r)}info(e,...r){this.log(e,Qre.INFO,...r)}warn(e,...r){this.log(e,Qre.WARN,...r)}error(e,...r){this.log(e,Qre.ERROR,...r)}exception(e,r,n){if(r instanceof Error&&r.name==="Canceled"&&r.message==="Canceled")return;let o=n;n.startsWith(".")&&(o=n.substring(1),n=`${this.category}${n}`),(0,B$a.telemetryException)(e.get(L$a.ICompletionsTelemetryService),r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e.get(wD.ICompletionsLogTargetService),Qre.ERROR,`${o}:`,s)}};wD.Logger=lyt;wD.logger=new lyt("default")});var rDi=I(l$=>{"use strict";p();Object.defineProperty(l$,"__esModule",{value:!0});l$.INotificationService=l$.NullNotificationService=l$.ProgressLocation=void 0;var F$a=nn(),U$a=n2(),tDi;(function(t){t[t.SourceControl=1]="SourceControl",t[t.Window=10]="Window",t[t.Notification=15]="Notification"})(tDi||(l$.ProgressLocation=tDi={}));var NTr=class{static{a(this,"NullNotificationService")}showInformationMessage(e,r,...n){return Promise.resolve(void 0)}showWarningMessage(e,...r){return Promise.resolve(void 0)}showQuotaExceededDialog(e){return Promise.resolve()}withProgress(e,r){return Promise.resolve(r({report:a(()=>{},"report")},U$a.CancellationToken.None))}};l$.NullNotificationService=NTr;l$.INotificationService=(0,F$a.createServiceIdentifier)("INotificationService")});var OTr=I(RD=>{"use strict";p();var Q$a=RD&&RD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},q$a=RD&&RD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(RD,"__esModule",{value:!0});RD.ExtensionNotificationSender=RD.ICompletionsNotificationSender=void 0;var j$a=rDi(),H$a=nn();RD.ICompletionsNotificationSender=(0,H$a.createServiceIdentifier)("ICompletionsNotificationSender");var MTr=class{static{a(this,"ExtensionNotificationSender")}constructor(e){this.notificationService=e}async showWarningMessage(e,...r){let n=await this.notificationService.showWarningMessage(e,...r.map(o=>o.title));if(n!==void 0)return{title:n}}};RD.ExtensionNotificationSender=MTr;RD.ExtensionNotificationSender=MTr=Q$a([q$a(0,j$a.INotificationService)],MTr)});var FTr=I(kD=>{"use strict";p();var G$a=kD&&kD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},LTr=kD&&kD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(kD,"__esModule",{value:!0});kD.UserErrorNotifier=kD.ICompletionsUserErrorNotifierService=void 0;var $$a=H4(),V$a=nn(),W$a=ad(),oDi=Dl(),z$a=OTr(),Y$a=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],nDi="Your proxy connection requires a trusted certificate. Please make sure the proxy certificate and any issuers are configured correctly and trusted by your operating system.",iDi="https://gh.io/copilot-network-errors";kD.ICompletionsUserErrorNotifierService=(0,V$a.createServiceIdentifier)("ICompletionsUserErrorNotifierService");var BTr=class{static{a(this,"UserErrorNotifier")}constructor(e,r,n){this._logTarget=e,this._notificationSender=r,this._env=n,this.notifiedErrorCodes=[]}notifyUser(e){if(!(e instanceof Error))return;let r=e;r.code&&Y$a.includes(r.code)&&!this.didNotifyBefore(r.code)&&(this.notifiedErrorCodes.push(r.code),this.displayCertificateErrorNotification(r))}async displayCertificateErrorNotification(e){new oDi.Logger("certificates").error(this._logTarget,`${nDi} Please visit ${iDi} to learn more. Original cause:`,e);let r={title:"Learn more"};return this._notificationSender.showWarningMessage(nDi,r).then(n=>{if(n?.title===r.title)return this._env.openExternal(W$a.URI.parse(iDi))})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};kD.UserErrorNotifier=BTr;kD.UserErrorNotifier=BTr=G$a([LTr(0,oDi.ICompletionsLogTargetService),LTr(1,z$a.ICompletionsNotificationSender),LTr(2,$$a.IEnvService)],BTr)});var yh=I(SAe=>{"use strict";p();Object.defineProperty(SAe,"__esModule",{value:!0});SAe.NullExperimentationService=SAe.IExperimentationService=void 0;var K$a=nn(),J$a=Rc();SAe.IExperimentationService=(0,K$a.createServiceIdentifier)("IExperimentationService");var UTr=class{static{a(this,"NullExperimentationService")}constructor(){this._onDidTreatmentsChange=new J$a.Emitter,this.onDidTreatmentsChange=this._onDidTreatmentsChange.event}async hasTreatments(){return Promise.resolve()}async hasAccountBasedTreatments(){return Promise.resolve()}getTreatmentVariable(e){}async setCompletionsFilters(e){}};SAe.NullExperimentationService=UTr});var u$=I(c1=>{"use strict";p();Object.defineProperty(c1,"__esModule",{value:!0});c1.DEFAULT_PROMPT_ALLOCATION_PERCENT=c1.DEFAULT_SUFFIX_MATCH_THRESHOLD=c1.DEFAULT_NUM_SNIPPETS=c1.DEFAULT_MAX_PROMPT_LENGTH=c1.DEFAULT_MAX_COMPLETION_LENGTH=void 0;c1.normalizeLanguageId=X$a;c1.DEFAULT_MAX_COMPLETION_LENGTH=500;c1.DEFAULT_MAX_PROMPT_LENGTH=8192-c1.DEFAULT_MAX_COMPLETION_LENGTH;c1.DEFAULT_NUM_SNIPPETS=4;c1.DEFAULT_SUFFIX_MATCH_THRESHOLD=10;c1.DEFAULT_PROMPT_ALLOCATION_PERCENT={prefix:35,suffix:15,stableContext:35,volatileContext:15};var Z$a={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function X$a(t){return t=t.toLowerCase(),Z$a[t]??t}a(X$a,"normalizeLanguageId")});var sDi=I(QTr=>{"use strict";p();Object.defineProperty(QTr,"__esModule",{value:!0});QTr.getUserKind=tVa;function eVa(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(eVa,"findKnownOrg");function tVa(t){let e=t.organizationList??[];return eVa(e)??""}a(tVa,"getUserKind")});var R4e=I(eL=>{"use strict";p();Object.defineProperty(eL,"__esModule",{value:!0});eL.IEndpointProvider=eL.ModelSupportedEndpoint=void 0;eL.isEndpointEditToolName=iVa;eL.isChatModelInformation=oVa;eL.isEmbeddingModelInformation=sVa;eL.isCompletionModelInformation=aVa;var rVa=nn(),nVa=new Set(["find-replace","multi-find-replace","apply-patch","code-rewrite"]);function iVa(t){return nVa.has(t)}a(iVa,"isEndpointEditToolName");var aDi;(function(t){t.ChatCompletions="/chat/completions",t.Responses="/responses",t.WebSocketResponses="ws:/responses",t.Messages="/v1/messages"})(aDi||(eL.ModelSupportedEndpoint=aDi={}));function oVa(t){return t.capabilities.type==="chat"}a(oVa,"isChatModelInformation");function sVa(t){return t.capabilities.type==="embeddings"}a(sVa,"isEmbeddingModelInformation");function aVa(t){return t.capabilities.type==="completion"}a(aVa,"isCompletionModelInformation");eL.IEndpointProvider=(0,rVa.createServiceIdentifier)("IEndpointProvider")});var lDi=I(qTr=>{"use strict";p();Object.defineProperty(qTr,"__esModule",{value:!0});qTr.getUserSelectedModelConfiguration=cVa;var cDi=qE();function cVa(t){let e=(0,cDi.getConfig)(t,cDi.ConfigKey.UserSelectedCompletionModel);return typeof e=="string"&&e.length>0?e:null}a(cVa,"getUserSelectedModelConfiguration")});var uDi=I(rL=>{"use strict";p();Object.defineProperty(rL,"__esModule",{value:!0});rL.bytePairEncode=rL.BinaryMap=rL.binaryMapKey=void 0;var lVa=a((t,e,r)=>{let n=r-e,o=16777215>>>Math.max(0,(3-n)*8),s=(t[e+0]|t[e+1]<<8|t[e+2]<<16)&o,c=16777215>>>Math.min(31,Math.max(0,(6-n)*8)),l=(t[e+3]|t[e+4]<<8|t[e+5]<<16)&c;return s+16777216*l},"binaryMapKey");rL.binaryMapKey=lVa;var jTr=class t{static{a(this,"BinaryMap")}constructor(){this.nested=new Map,this.final=new Map}get(e,r=0,n=e.length){let o=n<6+r,s=(0,rL.binaryMapKey)(e,r,n);return o?this.final.get(s):this.nested.get(s)?.get(e,6+r,n)}set(e,r){let n=(0,rL.binaryMapKey)(e,0,e.length);if(e.length<6){this.final.set(n,r);return}let s=this.nested.get(n);if(s instanceof t)s.set(e.subarray(6),r);else{let c=new t;c.set(e.subarray(6),r),this.nested.set(n,c)}}};rL.BinaryMap=jTr;var tL=new Int32Array(128),Ov=new Int32Array(128);function uVa(t,e,r){if(r===1)return[e.get(t)];let n=2147483647,o=-1;for(;tL.length0&&(tL[Ov[o-1]]=c(o-1,1));for(let u=o+1;u{"use strict";p();Object.defineProperty(uyt,"__esModule",{value:!0});uyt.makeTextEncoder=void 0;var HTr=class{static{a(this,"UniversalTextEncoder")}constructor(){this.length=0,this.encoder=new TextEncoder}encode(e){let r=this.encoder.encode(e);return this.length=r.length,r}},GTr=class{static{a(this,"NodeTextEncoder")}constructor(){this.buffer=Buffer.alloc(256),this.length=0}encode(e){for(;;){if(this.length=this.buffer.write(e,"utf8"),this.lengthtypeof Buffer<"u"?new GTr:new HTr,"makeTextEncoder");uyt.makeTextEncoder=dVa});var fDi=I(dyt=>{"use strict";p();Object.defineProperty(dyt,"__esModule",{value:!0});dyt.LRUCache=void 0;var $Tr=class{static{a(this,"LRUCache")}constructor(e){this.size=e,this.nodes=new Map}get(e){let r=this.nodes.get(e);if(r)return this.moveToHead(r),r.value}set(e,r){let n=this.nodes.get(e);if(n)n.value=r,this.moveToHead(n);else{let o=new VTr(e,r);this.nodes.set(e,o),this.addNode(o),this.nodes.size>this.size&&(this.nodes.delete(this.tail.key),this.removeNode(this.tail))}}moveToHead(e){this.removeNode(e),e.next=void 0,e.prev=void 0,this.addNode(e)}addNode(e){this.head&&(this.head.prev=e,e.next=this.head),this.tail||(this.tail=e),this.head=e}removeNode(e){e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev}};dyt.LRUCache=$Tr;var VTr=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.value=r}}});var zTr=I(pyt=>{"use strict";p();Object.defineProperty(pyt,"__esModule",{value:!0});pyt.TikTokenizer=void 0;var fyt=uDi(),fVa=dDi(),pVa=fDi();function hVa(t){let e=new Map;try{let o=require("fs").readFileSync(t,"utf-8");return r(o),e}catch(n){throw new Error(`Failed to load from BPE encoder file stream: ${n}`)}function r(n){for(let o of n.split(/[\r\n]+/)){if(o.trim()==="")continue;let s=o.split(" ");if(s.length!==2)throw new Error("Invalid format in the BPE encoder file stream");let c=new Uint8Array(Buffer.from(s[0],"base64")),l=parseInt(s[1]);if(!isNaN(l))e.set(c,l);else throw new Error(`Can't parse ${s[1]} to integer`)}}a(r,"processBpeRanks")}a(hVa,"loadTikTokenBpe");function mVa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(mVa,"escapeRegExp");var WTr=class{static{a(this,"TikTokenizer")}constructor(e,r,n,o=8192){this.textEncoder=(0,fVa.makeTextEncoder)(),this.textDecoder=new TextDecoder("utf-8"),this.cache=new pVa.LRUCache(o);let s=typeof e=="string"?hVa(e):e;this.init(s,r,n)}init(e,r,n){this.encoder=new fyt.BinaryMap;for(let[o,s]of e)this.encoder.set(o,s);this.regex=new RegExp(n,"gu"),this.specialTokensRegex=new RegExp(Array.from(r.keys()).map(o=>mVa(o)).join("|")),this.specialTokensEncoder=r,this.decoder=new Map;for(let[o,s]of e)this.decoder.set(s,o);if(e.size!==this.decoder.size)throw new Error("Encoder and decoder sizes do not match");this.specialTokensDecoder=new Map;for(let[o,s]of r)this.specialTokensDecoder.set(s,o)}findNextSpecialToken(e,r,n){let o=r,s=null;if(n&&this.specialTokensRegex)for(;s=e.slice(o).match(this.specialTokensRegex),!(!s||n&&n.includes(s[0]));)o+=s.index+1;let c=s?o+s.index:e.length;return[s,c]}encode(e,r){let n=[],o=0;for(;;){let s,c;if([s,c]=this.findNextSpecialToken(e,o,r),c>o&&this.encodeByIndex(e,n,o,c),s){if(o=o+this.encodeSpecialToken(n,s),o>=e.length)break}else break}return n}encodeSpecialToken(e,r){let n=this.specialTokensEncoder?.get(r[0]);return e.push(n),r.index+r[0].length}encodeByIndex(e,r,n,o){let s,c=e.substring(n,o);for(this.regex.lastIndex=0;s=this.regex.exec(c);){let l=this.cache.get(s[0]);if(l)for(let u of l)r.push(u);else{let u=this.textEncoder.encode(s[0]),d=this.encoder.get(u,0,this.textEncoder.length);if(d!==void 0)r.push(d),this.cache.set(s[0],[d]);else{let f=(0,fyt.bytePairEncode)(u,this.encoder,this.textEncoder.length);for(let h of f)r.push(h);this.cache.set(s[0],f)}}}}encodeTrimSuffixByIndex(e,r,n,o,s,c,l){let u,d=e.substring(n,o);for(this.regex.lastIndex=0;u=this.regex.exec(d);){let f=u[0],h=this.cache.get(f);if(h)if(c+h.length<=s)c+=h.length,l+=f.length,r.push(...h);else{let m=s-c;c+=m,l+=f.length,r.push(...h.slice(0,m));break}else{let m=this.textEncoder.encode(f),g=this.encoder.get(m,0,m.length);if(g!==void 0)if(this.cache.set(f,[g]),c+1<=s)c++,l+=f.length,r.push(g);else break;else{let A=(0,fyt.bytePairEncode)(m,this.encoder,this.textEncoder.length);if(this.cache.set(f,A),c+A.length<=s){c+=A.length,l+=f.length;for(let y of A)r.push(y)}else{let y=s-c;c+=y,l+=f.length;for(let E=0;E=s)break}return{tokenCount:c,encodeLength:l}}encodeTrimSuffix(e,r,n){let o=[],s=0,c=0,l=0;for(;;){let d,f;if([d,f]=this.findNextSpecialToken(e,s,n),f>s){let{tokenCount:h,encodeLength:m}=this.encodeTrimSuffixByIndex(e,o,s,f,r,c,l);if(c=h,l=m,c>=r)break}if(d!==null){if(c++,c<=r&&(s=s+this.encodeSpecialToken(o,d),l+=d[0].length,s>=e.length)||c>=r)break}else break}let u=l===e.length?e:e.slice(0,l);return{tokenIds:o,text:u}}encodeTrimPrefix(e,r,n){let o=[],s=0,c=0,l=0,u=new Map;for(u.set(c,l);;){let m,g;if([m,g]=this.findNextSpecialToken(e,s,n),g>s){let A,y=e.substring(s,g);for(this.regex.lastIndex=0;A=this.regex.exec(y);){let E=A[0],_=this.cache.get(E);if(_)c+=_.length,l+=E.length,o.push(..._),u.set(c,l);else{let v=this.textEncoder.encode(E),b=this.encoder.get(v);if(b!==void 0)this.cache.set(E,[b]),c++,l+=E.length,o.push(b),u.set(c,l);else{let T=(0,fyt.bytePairEncode)(v,this.encoder,this.textEncoder.length);this.cache.set(E,T),c+=T.length,l+=E.length;for(let w of T)o.push(w);u.set(c,l)}}}}if(m!==null){if(s=s+this.encodeSpecialToken(o,m),c++,l+=m[0].length,u.set(c,l),s>=e.length)break}else break}if(c<=r)return{tokenIds:o,text:e};let d=c-r,f=0,h=0;for(let[m,g]of u)if(m>=d){f=m,h=g;break}if(f>r){let m=this.encode(e,n),g=m.slice(m.length-r);return{tokenIds:g,text:this.decode(g)}}return{tokenIds:o.slice(f),text:e.slice(h)}}decode(e){let r=[];for(let n of e){let o=[],s=this.decoder?.get(n);if(s!==void 0)o=Array.from(s);else{let c=this.specialTokensDecoder?.get(n);if(c!==void 0){let l=this.textEncoder.encode(c);o=Array.from(l.subarray(0,this.textEncoder.length))}}r.push(...o)}return this.textDecoder.decode(new Uint8Array(r))}};pyt.TikTokenizer=WTr});var CDi=I(Pm=>{"use strict";p();Object.defineProperty(Pm,"__esModule",{value:!0});Pm.createTokenizer=Pm.createByEncoderName=Pm.createByModelName=Pm.getRegexByModel=Pm.getRegexByEncoder=Pm.getSpecialTokensByModel=Pm.getSpecialTokensByEncoder=Pm.MODEL_TO_ENCODING=void 0;var gVa=zTr(),AVa=new Map([["gpt-4o-","o200k_base"],["gpt-4-","cl100k_base"],["gpt-3.5-turbo-","cl100k_base"],["gpt-35-turbo-","cl100k_base"]]);Pm.MODEL_TO_ENCODING=new Map([["gpt-4o","o200k_base"],["gpt-4","cl100k_base"],["gpt-3.5-turbo","cl100k_base"],["text-davinci-003","p50k_base"],["text-davinci-002","p50k_base"],["text-davinci-001","r50k_base"],["text-curie-001","r50k_base"],["text-babbage-001","r50k_base"],["text-ada-001","r50k_base"],["davinci","r50k_base"],["curie","r50k_base"],["babbage","r50k_base"],["ada","r50k_base"],["code-davinci-002","p50k_base"],["code-davinci-001","p50k_base"],["code-cushman-002","p50k_base"],["code-cushman-001","p50k_base"],["davinci-codex","p50k_base"],["cushman-codex","p50k_base"],["text-davinci-edit-001","p50k_edit"],["code-davinci-edit-001","p50k_edit"],["text-embedding-ada-002","cl100k_base"],["text-similarity-davinci-001","r50k_base"],["text-similarity-curie-001","r50k_base"],["text-similarity-babbage-001","r50k_base"],["text-similarity-ada-001","r50k_base"],["text-search-davinci-doc-001","r50k_base"],["text-search-curie-doc-001","r50k_base"],["text-search-babbage-doc-001","r50k_base"],["text-search-ada-doc-001","r50k_base"],["code-search-babbage-code-001","r50k_base"],["code-search-ada-code-001","r50k_base"],["gpt2","gpt2"]]);var hyt="<|endoftext|>",pDi="<|fim_prefix|>",hDi="<|fim_middle|>",mDi="<|fim_suffix|>",gDi="<|endofprompt|>",k4e="'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+",ADi="(?:'s|'S|'t|'T|'re|'RE|'Re|'eR|'ve|'VE|'vE|'Ve|'m|'M|'ll|'lL|'Ll|'LL|'d|'D)|[^\\r\\n\\p{L}\\p{N}]?\\p{L}+|\\p{N}{1,3}| ?[^\\s\\p{L}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",yVa=[`[^\r \\p{L}\\p{N}]?[\\p{Lu}\\p{Lt}\\p{Lm}\\p{Lo}\\p{M}]*[\\p{Ll}\\p{Lm}\\p{Lo}\\p{M}]+(?:'s|'S|'t|'T|'re|'RE|'Re|'eR|'ve|'VE|'vE|'Ve|'m|'M|'ll|'lL|'Ll|'LL|'d|'D)?`,`[^\r -\\p{L}\\p{N}]?[\\p{Lu}\\p{Lt}\\p{Lm}\\p{Lo}\\p{M}]+[\\p{Ll}\\p{Lm}\\p{Lo}\\p{M}]*(?:'s|'S|'t|'T|'re|'RE|'Re|'eR|'ve|'VE|'vE|'Ve|'m|'M|'ll|'lL|'Ll|'LL|'d|'D)?`,"\\p{N}{1,3}"," ?[^\\s\\p{L}\\p{N}]+[\\r\\n/]*","\\s*[\\r\\n]+","\\s+(?!\\S)","\\s+"],IPi=zHa.join("|");function rTr(t){let e="";if(Im.MODEL_TO_ENCODING.has(t))e=Im.MODEL_TO_ENCODING.get(t);else for(let[r,n]of WHa)if(t.startsWith(r)){e=n;break}return e}a(rTr,"getEncoderFromModelName");async function YHa(t,e){let r=require("fs"),n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch file from ${t}. Status code: ${n.status}`);let o=await n.text();r.writeFileSync(e,o)}a(YHa,"fetchAndSaveFile");function nTr(t){let e=new Map([[jAt,50256]]);switch(t){case"o200k_base":e=new Map([[jAt,199999],[SPi,200018]]);break;case"cl100k_base":e=new Map([[jAt,100257],[vPi,100258],[CPi,100259],[bPi,100260],[SPi,100276]]);break;case"p50k_edit":e=new Map([[jAt,50256],[vPi,50281],[CPi,50282],[bPi,50283]]);break;default:break}return e}a(nTr,"getSpecialTokensByEncoder");Im.getSpecialTokensByEncoder=nTr;function KHa(t){let e=rTr(t);return nTr(e)}a(KHa,"getSpecialTokensByModel");Im.getSpecialTokensByModel=KHa;function xPi(t){switch(t){case"o200k_base":return IPi;case"cl100k_base":return TPi;default:break}return a4e}a(xPi,"getRegexByEncoder");Im.getRegexByEncoder=xPi;function JHa(t){let e=rTr(t);return xPi(e)}a(JHa,"getRegexByModel");Im.getRegexByModel=JHa;async function ZHa(t,e=null){return wPi(rTr(t),e)}a(ZHa,"createByModelName");Im.createByModelName=ZHa;async function wPi(t,e=null){let r,n,o=nTr(t);switch(t){case"o200k_base":r=IPi,n="https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken";break;case"cl100k_base":r=TPi,n="https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken";break;case"p50k_base":r=a4e,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"p50k_edit":r=a4e,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"r50k_base":r=a4e,n="https://openaipublic.blob.core.windows.net/encodings/r50k_base.tiktoken";break;case"gpt2":r=a4e,n="https://raw.githubusercontent.com/microsoft/Tokenizer/main/model/gpt2.tiktoken";break;default:throw new Error(`Doesn't support this encoder [${t}]`)}e!==null&&(o=new Map([...o,...e]));let s=require("fs"),c=require("path"),l=c.basename(n),u=c.resolve(__dirname,"..","model");s.existsSync(u)||s.mkdirSync(u,{recursive:!0});let d=c.resolve(u,l);return s.existsSync(d)||(console.log(`Downloading file from ${n}`),await YHa(n,d),console.log(`Saved file to ${d}`)),RPi(d,o,r)}a(wPi,"createByEncoderName");Im.createByEncoderName=wPi;function RPi(t,e,r,n=8192){return new VHa.TikTokenizer(t,e,r,n)}a(RPi,"createTokenizer");Im.createTokenizer=RPi});var iTr=I(xm=>{"use strict";p();Object.defineProperty(xm,"__esModule",{value:!0});xm.createTokenizer=xm.createByEncoderName=xm.createByModelName=xm.getSpecialTokensByModel=xm.getSpecialTokensByEncoder=xm.getRegexByModel=xm.getRegexByEncoder=xm.MODEL_TO_ENCODING=xm.TikTokenizer=void 0;var XHa=tTr();Object.defineProperty(xm,"TikTokenizer",{enumerable:!0,get:a(function(){return XHa.TikTokenizer},"get")});var ZG=kPi();Object.defineProperty(xm,"MODEL_TO_ENCODING",{enumerable:!0,get:a(function(){return ZG.MODEL_TO_ENCODING},"get")});Object.defineProperty(xm,"getRegexByEncoder",{enumerable:!0,get:a(function(){return ZG.getRegexByEncoder},"get")});Object.defineProperty(xm,"getRegexByModel",{enumerable:!0,get:a(function(){return ZG.getRegexByModel},"get")});Object.defineProperty(xm,"getSpecialTokensByEncoder",{enumerable:!0,get:a(function(){return ZG.getSpecialTokensByEncoder},"get")});Object.defineProperty(xm,"getSpecialTokensByModel",{enumerable:!0,get:a(function(){return ZG.getSpecialTokensByModel},"get")});Object.defineProperty(xm,"createByModelName",{enumerable:!0,get:a(function(){return ZG.createByModelName},"get")});Object.defineProperty(xm,"createByEncoderName",{enumerable:!0,get:a(function(){return ZG.createByEncoderName},"get")});Object.defineProperty(xm,"createTokenizer",{enumerable:!0,get:a(function(){return ZG.createTokenizer},"get")})});var DPi=I(gy=>{"use strict";p();Object.defineProperty(gy,"__esModule",{value:!0});gy.isReadable=tGa;gy.isReadableStream=PPi;gy.isReadableBufferedStream=rGa;gy.newWriteableStream=c4e;gy.consumeReadable=nGa;gy.peekReadable=iGa;gy.consumeStream=oGa;gy.listenStream=GAt;gy.peekStream=sGa;gy.toStream=aGa;gy.emptyStream=cGa;gy.toReadable=lGa;gy.transform=uGa;gy.prefixedReadable=dGa;gy.prefixedStream=fGa;var eGa=Rs(),HAt=Ro();function tGa(t){let e=t;return e?typeof e.read=="function":!1}a(tGa,"isReadable");function PPi(t){let e=t;return e?[e.on,e.pause,e.resume,e.destroy].every(r=>typeof r=="function"):!1}a(PPi,"isReadableStream");function rGa(t){let e=t;return e?PPi(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}a(rGa,"isReadableBufferedStream");function c4e(t,e){return new oTr(t,e)}a(c4e,"newWriteableStream");var oTr=class{static{a(this,"WriteableStreamImpl")}constructor(e,r){this.reducer=e,this.options=r,this.state={flowing:!1,ended:!1,destroyed:!1},this.buffer={data:[],error:[]},this.listeners={data:[],error:[],end:[]},this.pendingWritePromises=[]}pause(){this.state.destroyed||(this.state.flowing=!1)}resume(){this.state.destroyed||this.state.flowing||(this.state.flowing=!0,this.flowData(),this.flowErrors(),this.flowEnd())}write(e){if(!this.state.destroyed){if(this.state.flowing)this.emitData(e);else if(this.buffer.data.push(e),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(r=>this.pendingWritePromises.push(r))}}error(e){this.state.destroyed||(this.state.flowing?this.emitError(e):this.buffer.error.push(e))}end(e){this.state.destroyed||(typeof e<"u"&&this.write(e),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(e){this.listeners.data.slice(0).forEach(r=>r(e))}emitError(e){this.listeners.error.length===0?(0,eGa.onUnexpectedError)(e):this.listeners.error.slice(0).forEach(r=>r(e))}emitEnd(){this.listeners.end.slice(0).forEach(e=>e())}on(e,r){if(!this.state.destroyed)switch(e){case"data":this.listeners.data.push(r),this.resume();break;case"end":this.listeners.end.push(r),this.state.flowing&&this.flowEnd()&&this.destroy();break;case"error":this.listeners.error.push(r),this.state.flowing&&this.flowErrors();break}}removeListener(e,r){if(this.state.destroyed)return;let n;switch(e){case"data":n=this.listeners.data;break;case"end":n=this.listeners.end;break;case"error":n=this.listeners.error;break}if(n){let o=n.indexOf(r);o>=0&&n.splice(o,1)}}flowData(){if(this.buffer.data.length===0)return;if(typeof this.reducer=="function"){let r=this.reducer(this.buffer.data);this.emitData(r)}else for(let r of this.buffer.data)this.emitData(r);this.buffer.data.length=0;let e=[...this.pendingWritePromises];this.pendingWritePromises.length=0,e.forEach(r=>r())}flowErrors(){if(this.listeners.error.length>0){for(let e of this.buffer.error)this.emitError(e);this.buffer.error.length=0}}flowEnd(){return this.state.ended?(this.emitEnd(),this.listeners.end.length>0):!1}destroy(){this.state.destroyed||(this.state.destroyed=!0,this.state.ended=!0,this.buffer.data.length=0,this.buffer.error.length=0,this.listeners.data.length=0,this.listeners.error.length=0,this.listeners.end.length=0,this.pendingWritePromises.length=0)}};function nGa(t,e){let r=[],n;for(;(n=t.read())!==null;)r.push(n);return e(r)}a(nGa,"consumeReadable");function iGa(t,e,r){let n=[],o;for(;(o=t.read())!==null&&n.length0?e(n):{read:a(()=>{if(n.length>0)return n.shift();if(typeof o<"u"){let s=o;return o=void 0,s}return t.read()},"read")}}a(iGa,"peekReadable");function oGa(t,e){return new Promise((r,n)=>{let o=[];GAt(t,{onData:a(s=>{e&&o.push(s)},"onData"),onError:a(s=>{e?n(s):r(void 0)},"onError"),onEnd:a(()=>{r(e?e(o):void 0)},"onEnd")})})}a(oGa,"consumeStream");function GAt(t,e,r){t.on("error",n=>{r?.isCancellationRequested||e.onError(n)}),t.on("end",()=>{r?.isCancellationRequested||e.onEnd()}),t.on("data",n=>{r?.isCancellationRequested||e.onData(n)})}a(GAt,"listenStream");function sGa(t,e){return new Promise((r,n)=>{let o=new HAt.DisposableStore,s=[],c=a(d=>{if(s.push(d),s.length>e)return o.dispose(),t.pause(),r({stream:t,buffer:s,ended:!1})},"dataListener"),l=a(d=>(o.dispose(),n(d)),"errorListener"),u=a(()=>(o.dispose(),r({stream:t,buffer:s,ended:!0})),"endListener");o.add((0,HAt.toDisposable)(()=>t.removeListener("error",l))),t.on("error",l),o.add((0,HAt.toDisposable)(()=>t.removeListener("end",u))),t.on("end",u),o.add((0,HAt.toDisposable)(()=>t.removeListener("data",c))),t.on("data",c)})}a(sGa,"peekStream");function aGa(t,e){let r=c4e(e);return r.end(t),r}a(aGa,"toStream");function cGa(){let t=c4e(()=>{throw new Error("not supported")});return t.end(),t}a(cGa,"emptyStream");function lGa(t){let e=!1;return{read:a(()=>e?null:(e=!0,t),"read")}}a(lGa,"toReadable");function uGa(t,e,r){let n=c4e(r);return GAt(t,{onData:a(o=>n.write(e.data(o)),"onData"),onError:a(o=>n.error(e.error?e.error(o):o),"onError"),onEnd:a(()=>n.end(),"onEnd")}),n}a(uGa,"transform");function dGa(t,e,r){let n=!1;return{read:a(()=>{let o=e.read();return n?o:(n=!0,o!==null?r([t,o]):t)},"read")}}a(dGa,"prefixedReadable");function fGa(t,e,r){let n=!1,o=c4e(r);return GAt(e,{onData:a(s=>n?o.write(s):(n=!0,o.write(r([t,s]))),"onData"),onError:a(s=>o.error(s),"onError"),onEnd:a(()=>{n||(n=!0,o.write(t)),o.end()},"onEnd")}),o}a(fGa,"prefixedStream")});var e$=I(_c=>{"use strict";p();var pGa=_c&&_c.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hGa=_c&&_c.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mGa=_c&&_c.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;onew Uint8Array(256)),sTr,aTr,qE=class t{static{a(this,"VSBuffer")}static alloc(e){return l4e?new t(Buffer.allocUnsafe(e)):new t(new Uint8Array(e))}static wrap(e){return l4e&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new t(e)}static fromString(e,r){return!(r?.dontUseNodeBuffer||!1)&&l4e?new t(Buffer.from(e)):(sTr||(sTr=new TextEncoder),new t(sTr.encode(e)))}static fromByteArray(e){let r=t.alloc(e.length);for(let n=0,o=e.length;n"u"){r=0;for(let s=0,c=e.length;sr===e.buffer[n])}};_c.VSBuffer=qE;function OPi(t,e,r=0){let n=e.byteLength,o=t.byteLength;if(n===0)return 0;if(n===1)return t.indexOf(e[0],r);if(n>o-r)return-1;let s=AGa.value;s.fill(e.length);for(let d=0;d>>0|t[e+1]<<8>>>0}a(yGa,"readUInt16LE");function EGa(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255}a(EGa,"writeUInt16LE");function LPi(t,e){return t[e]*2**24+t[e+1]*2**16+t[e+2]*2**8+t[e+3]}a(LPi,"readUInt32BE");function BPi(t,e,r){t[r+3]=e,e=e>>>8,t[r+2]=e,e=e>>>8,t[r+1]=e,e=e>>>8,t[r]=e}a(BPi,"writeUInt32BE");function FPi(t,e){return t[e+0]<<0>>>0|t[e+1]<<8>>>0|t[e+2]<<16>>>0|t[e+3]<<24>>>0}a(FPi,"readUInt32LE");function UPi(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255,e=e>>>8,t[r+2]=e&255,e=e>>>8,t[r+3]=e&255}a(UPi,"writeUInt32LE");function QPi(t,e){return t[e]}a(QPi,"readUInt8");function qPi(t,e,r){t[r]=e}a(qPi,"writeUInt8");function _Ga(t){return XG.consumeReadable(t,e=>qE.concat(e))}a(_Ga,"readableToBuffer");function vGa(t){return XG.toReadable(t)}a(vGa,"bufferToReadable");function jPi(t){return XG.consumeStream(t,e=>qE.concat(e))}a(jPi,"streamToBuffer");async function CGa(t){return t.ended?qE.concat(t.buffer):qE.concat([...t.buffer,await jPi(t.stream)])}a(CGa,"bufferedStreamToBuffer");function bGa(t){return XG.toStream(t,e=>qE.concat(e))}a(bGa,"bufferToStream");function SGa(t){return XG.transform(t,{data:a(e=>typeof e=="string"?qE.fromString(e):qE.wrap(e),"data")},e=>qE.concat(e))}a(SGa,"streamToBufferReadableStream");function TGa(t){return XG.newWriteableStream(e=>qE.concat(e),t)}a(TGa,"newWriteableBufferStream");function IGa(t,e){return XG.prefixedReadable(t,e,r=>qE.concat(r))}a(IGa,"prefixedBufferReadable");function xGa(t,e){return XG.prefixedStream(t,e,r=>qE.concat(r))}a(xGa,"prefixedBufferStream");function wGa(t){let e=0,r=0,n=0,o=new Uint8Array(Math.floor(t.length/4*3)),s=a(l=>{switch(r){case 3:o[n++]=e|l,r=0;break;case 2:o[n++]=e|l>>>2,e=l<<6,r=3;break;case 1:o[n++]=e|l>>>4,e=l<<4,r=2;break;default:e=l<<2,r=1}},"append");for(let l=0;l=65&&u<=90)s(u-65);else if(u>=97&&u<=122)s(u-97+26);else if(u>=48&&u<=57)s(u-48+52);else if(u===43||u===45)s(62);else if(u===47||u===95)s(63);else{if(u===61)break;throw new SyntaxError(`Unexpected base64 character ${t[l]}`)}}let c=n;for(;r>0;)s(0);return qE.wrap(o).slice(0,c)}a(wGa,"decodeBase64");var RGa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kGa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function PGa({buffer:t},e=!0,r=!1){let n=r?kGa:RGa,o="",s=t.byteLength%3,c=0;for(;c>>2],o+=n[(l<<4|u>>>4)&63],o+=n[(u<<2|d>>>6)&63],o+=n[d&63]}if(s===1){let l=t[c+0];o+=n[l>>>2],o+=n[l<<4&63],e&&(o+="==")}else if(s===2){let l=t[c+0],u=t[c+1];o+=n[l>>>2],o+=n[(l<<4|u>>>4)&63],o+=n[u<<2&63],e&&(o+="=")}return o}a(PGa,"encodeBase64");var NPi="0123456789abcdef";function DGa({buffer:t}){let e="";for(let r=0;r>>4],e+=NPi[n&15]}return e}a(DGa,"encodeHex");function NGa(t){if(t.length%2!==0)throw new SyntaxError("Hex string must have an even length");let e=new Uint8Array(t.length>>1);for(let r=0;r>1]=MPi(t,r++)<<4|MPi(t,r++);return qE.wrap(e)}a(NGa,"decodeHex");function MPi(t,e){let r=t.charCodeAt(e);if(r>=48&&r<=57)return r-48;if(r>=97&&r<=102)return r-87;if(r>=65&&r<=70)return r-55;throw new SyntaxError(`Invalid hex character at position ${e}`)}a(MPi,"decodeHexChar")});var HPi=I($At=>{"use strict";p();Object.defineProperty($At,"__esModule",{value:!0});$At.readVariableLengthQuantity=OGa;$At.writeVariableLengthQuantity=LGa;var MGa=e$();function OGa(t,e){let r=0,n=0,o;do o=t.readUInt8(e+n),r|=(o&127)<>>=7,t!==0&&(r|=128),e.push(r)}while(t!==0);return MGa.VSBuffer.fromByteArray(e)}a(LGa,"writeVariableLengthQuantity")});var cTr=I(VAt=>{"use strict";p();Object.defineProperty(VAt,"__esModule",{value:!0});VAt.parseTikTokenBinary=void 0;var BGa=require("fs"),FGa=HPi(),UGa=e$(),QGa=a(t=>{let e=(0,BGa.readFileSync)(t),r=new Map;for(let n=0;n{"use strict";p();Object.defineProperty(WAt,"__esModule",{value:!0});WAt.CopilotPromptLoadFailure=void 0;var lTr=class extends Error{static{a(this,"CopilotPromptLoadFailure")}constructor(e,r){super(e,{cause:r}),this.code="CopilotPromptLoadFailure"}};WAt.CopilotPromptLoadFailure=lTr});var dTr=I(NR=>{"use strict";p();var qGa=NR&&NR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jGa=NR&&NR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),HGa=NR&&NR.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(MR,"__esModule",{value:!0});MR.ApproximateTokenizer=MR.TTokenizer=MR.TokenizerName=void 0;MR.setExternalTokenizerProvider=KGa;MR.getTokenizer=JGa;MR.ensureTokenizersLoaded=XGa;MR.resetTokenizersForTest=e$a;var fTr=iTr(),WGa=cTr(),zGa=uTr(),YGa=dTr(),bD;(function(t){t.cl100k="cl100k_base",t.o200k="o200k_base",t.mock="mock"})(bD||(MR.TokenizerName=bD={}));var lAe=new Map,Nre;function KGa(t){Nre||ZAt||(Nre=t)}a(KGa,"setExternalTokenizerProvider");function JGa(t=bD.o200k){if(Nre)try{return Nre.getTokenizer(t)}catch{}let e=lAe.get(t);return e!==void 0||(WPi(),e=lAe.get(bD.o200k),e!==void 0)?e:new JAt}a(JGa,"getTokenizer");var YAt=class t{static{a(this,"TTokenizer")}constructor(e){this._tokenizer=e}static async create(e){try{let r=(0,fTr.createTokenizer)((0,WGa.parseTikTokenBinary)((0,YGa.locateFile)(`${e}.tiktoken`)),(0,fTr.getSpecialTokensByEncoder)(e),(0,fTr.getRegexByEncoder)(e),32768);return new t(r)}catch(r){throw r instanceof Error?new zGa.CopilotPromptLoadFailure("Could not load tokenizer",r):r}}tokenize(e){return this._tokenizer.encode(e)}detokenize(e){return this._tokenizer.decode(e)}tokenLength(e){return this.tokenize(e).length}tokenizeStrings(e){return this.tokenize(e).map(n=>this.detokenize([n]))}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=4,o=1,s=Math.min(e.length,r*n),c=e.slice(-s),l=this.tokenize(c);for(;l.length{"use strict";p();Object.defineProperty(Dm,"__esModule",{value:!0});Dm.createTokenizer=Dm.createByEncoderName=Dm.createByModelName=Dm.getSpecialTokensByModel=Dm.getSpecialTokensByEncoder=Dm.getRegexByModel=Dm.getRegexByEncoder=Dm.MODEL_TO_ENCODING=Dm.TikTokenizer=void 0;var bVa=zTr();Object.defineProperty(Dm,"TikTokenizer",{enumerable:!0,get:a(function(){return bVa.TikTokenizer},"get")});var d$=CDi();Object.defineProperty(Dm,"MODEL_TO_ENCODING",{enumerable:!0,get:a(function(){return d$.MODEL_TO_ENCODING},"get")});Object.defineProperty(Dm,"getRegexByEncoder",{enumerable:!0,get:a(function(){return d$.getRegexByEncoder},"get")});Object.defineProperty(Dm,"getRegexByModel",{enumerable:!0,get:a(function(){return d$.getRegexByModel},"get")});Object.defineProperty(Dm,"getSpecialTokensByEncoder",{enumerable:!0,get:a(function(){return d$.getSpecialTokensByEncoder},"get")});Object.defineProperty(Dm,"getSpecialTokensByModel",{enumerable:!0,get:a(function(){return d$.getSpecialTokensByModel},"get")});Object.defineProperty(Dm,"createByModelName",{enumerable:!0,get:a(function(){return d$.createByModelName},"get")});Object.defineProperty(Dm,"createByEncoderName",{enumerable:!0,get:a(function(){return d$.createByEncoderName},"get")});Object.defineProperty(Dm,"createTokenizer",{enumerable:!0,get:a(function(){return d$.createTokenizer},"get")})});var SDi=I(_y=>{"use strict";p();Object.defineProperty(_y,"__esModule",{value:!0});_y.isReadable=TVa;_y.isReadableStream=bDi;_y.isReadableBufferedStream=IVa;_y.newWriteableStream=P4e;_y.consumeReadable=xVa;_y.peekReadable=wVa;_y.consumeStream=RVa;_y.listenStream=gyt;_y.peekStream=kVa;_y.toStream=PVa;_y.emptyStream=DVa;_y.toReadable=NVa;_y.transform=MVa;_y.prefixedReadable=OVa;_y.prefixedStream=LVa;var SVa=Rs(),myt=Ro();function TVa(t){let e=t;return e?typeof e.read=="function":!1}a(TVa,"isReadable");function bDi(t){let e=t;return e?[e.on,e.pause,e.resume,e.destroy].every(r=>typeof r=="function"):!1}a(bDi,"isReadableStream");function IVa(t){let e=t;return e?bDi(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}a(IVa,"isReadableBufferedStream");function P4e(t,e){return new ZTr(t,e)}a(P4e,"newWriteableStream");var ZTr=class{static{a(this,"WriteableStreamImpl")}constructor(e,r){this.reducer=e,this.options=r,this.state={flowing:!1,ended:!1,destroyed:!1},this.buffer={data:[],error:[]},this.listeners={data:[],error:[],end:[]},this.pendingWritePromises=[]}pause(){this.state.destroyed||(this.state.flowing=!1)}resume(){this.state.destroyed||this.state.flowing||(this.state.flowing=!0,this.flowData(),this.flowErrors(),this.flowEnd())}write(e){if(!this.state.destroyed){if(this.state.flowing)this.emitData(e);else if(this.buffer.data.push(e),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(r=>this.pendingWritePromises.push(r))}}error(e){this.state.destroyed||(this.state.flowing?this.emitError(e):this.buffer.error.push(e))}end(e){this.state.destroyed||(typeof e<"u"&&this.write(e),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(e){this.listeners.data.slice(0).forEach(r=>r(e))}emitError(e){this.listeners.error.length===0?(0,SVa.onUnexpectedError)(e):this.listeners.error.slice(0).forEach(r=>r(e))}emitEnd(){this.listeners.end.slice(0).forEach(e=>e())}on(e,r){if(!this.state.destroyed)switch(e){case"data":this.listeners.data.push(r),this.resume();break;case"end":this.listeners.end.push(r),this.state.flowing&&this.flowEnd()&&this.destroy();break;case"error":this.listeners.error.push(r),this.state.flowing&&this.flowErrors();break}}removeListener(e,r){if(this.state.destroyed)return;let n;switch(e){case"data":n=this.listeners.data;break;case"end":n=this.listeners.end;break;case"error":n=this.listeners.error;break}if(n){let o=n.indexOf(r);o>=0&&n.splice(o,1)}}flowData(){if(this.buffer.data.length===0)return;if(typeof this.reducer=="function"){let r=this.reducer(this.buffer.data);this.emitData(r)}else for(let r of this.buffer.data)this.emitData(r);this.buffer.data.length=0;let e=[...this.pendingWritePromises];this.pendingWritePromises.length=0,e.forEach(r=>r())}flowErrors(){if(this.listeners.error.length>0){for(let e of this.buffer.error)this.emitError(e);this.buffer.error.length=0}}flowEnd(){return this.state.ended?(this.emitEnd(),this.listeners.end.length>0):!1}destroy(){this.state.destroyed||(this.state.destroyed=!0,this.state.ended=!0,this.buffer.data.length=0,this.buffer.error.length=0,this.listeners.data.length=0,this.listeners.error.length=0,this.listeners.end.length=0,this.pendingWritePromises.length=0)}};function xVa(t,e){let r=[],n;for(;(n=t.read())!==null;)r.push(n);return e(r)}a(xVa,"consumeReadable");function wVa(t,e,r){let n=[],o;for(;(o=t.read())!==null&&n.length0?e(n):{read:a(()=>{if(n.length>0)return n.shift();if(typeof o<"u"){let s=o;return o=void 0,s}return t.read()},"read")}}a(wVa,"peekReadable");function RVa(t,e){return new Promise((r,n)=>{let o=[];gyt(t,{onData:a(s=>{e&&o.push(s)},"onData"),onError:a(s=>{e?n(s):r(void 0)},"onError"),onEnd:a(()=>{r(e?e(o):void 0)},"onEnd")})})}a(RVa,"consumeStream");function gyt(t,e,r){t.on("error",n=>{r?.isCancellationRequested||e.onError(n)}),t.on("end",()=>{r?.isCancellationRequested||e.onEnd()}),t.on("data",n=>{r?.isCancellationRequested||e.onData(n)})}a(gyt,"listenStream");function kVa(t,e){return new Promise((r,n)=>{let o=new myt.DisposableStore,s=[],c=a(d=>{if(s.push(d),s.length>e)return o.dispose(),t.pause(),r({stream:t,buffer:s,ended:!1})},"dataListener"),l=a(d=>(o.dispose(),n(d)),"errorListener"),u=a(()=>(o.dispose(),r({stream:t,buffer:s,ended:!0})),"endListener");o.add((0,myt.toDisposable)(()=>t.removeListener("error",l))),t.on("error",l),o.add((0,myt.toDisposable)(()=>t.removeListener("end",u))),t.on("end",u),o.add((0,myt.toDisposable)(()=>t.removeListener("data",c))),t.on("data",c)})}a(kVa,"peekStream");function PVa(t,e){let r=P4e(e);return r.end(t),r}a(PVa,"toStream");function DVa(){let t=P4e(()=>{throw new Error("not supported")});return t.end(),t}a(DVa,"emptyStream");function NVa(t){let e=!1;return{read:a(()=>e?null:(e=!0,t),"read")}}a(NVa,"toReadable");function MVa(t,e,r){let n=P4e(r);return gyt(t,{onData:a(o=>n.write(e.data(o)),"onData"),onError:a(o=>n.error(e.error?e.error(o):o),"onError"),onEnd:a(()=>n.end(),"onEnd")}),n}a(MVa,"transform");function OVa(t,e,r){let n=!1;return{read:a(()=>{let o=e.read();return n?o:(n=!0,o!==null?r([t,o]):t)},"read")}}a(OVa,"prefixedReadable");function LVa(t,e,r){let n=!1,o=P4e(r);return gyt(e,{onData:a(s=>n?o.write(s):(n=!0,o.write(r([t,s]))),"onData"),onError:a(s=>o.error(s),"onError"),onEnd:a(()=>{n||(n=!0,o.write(t)),o.end()},"onEnd")}),o}a(LVa,"prefixedStream")});var p$=I(bc=>{"use strict";p();var BVa=bc&&bc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),FVa=bc&&bc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),UVa=bc&&bc.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;onew Uint8Array(256)),XTr,eIr,VE=class t{static{a(this,"VSBuffer")}static alloc(e){return D4e?new t(Buffer.allocUnsafe(e)):new t(new Uint8Array(e))}static wrap(e){return D4e&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new t(e)}static fromString(e,r){return!(r?.dontUseNodeBuffer||!1)&&D4e?new t(Buffer.from(e)):(XTr||(XTr=new TextEncoder),new t(XTr.encode(e)))}static fromByteArray(e){let r=t.alloc(e.length);for(let n=0,o=e.length;n"u"){r=0;for(let s=0,c=e.length;sr===e.buffer[n])}};bc.VSBuffer=VE;function xDi(t,e,r=0){let n=e.byteLength,o=t.byteLength;if(n===0)return 0;if(n===1)return t.indexOf(e[0],r);if(n>o-r)return-1;let s=qVa.value;s.fill(e.length);for(let d=0;d>>0|t[e+1]<<8>>>0}a(jVa,"readUInt16LE");function HVa(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255}a(HVa,"writeUInt16LE");function wDi(t,e){return t[e]*2**24+t[e+1]*2**16+t[e+2]*2**8+t[e+3]}a(wDi,"readUInt32BE");function RDi(t,e,r){t[r+3]=e,e=e>>>8,t[r+2]=e,e=e>>>8,t[r+1]=e,e=e>>>8,t[r]=e}a(RDi,"writeUInt32BE");function kDi(t,e){return t[e+0]<<0>>>0|t[e+1]<<8>>>0|t[e+2]<<16>>>0|t[e+3]<<24>>>0}a(kDi,"readUInt32LE");function PDi(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255,e=e>>>8,t[r+2]=e&255,e=e>>>8,t[r+3]=e&255}a(PDi,"writeUInt32LE");function DDi(t,e){return t[e]}a(DDi,"readUInt8");function NDi(t,e,r){t[r]=e}a(NDi,"writeUInt8");function GVa(t){return f$.consumeReadable(t,e=>VE.concat(e))}a(GVa,"readableToBuffer");function $Va(t){return f$.toReadable(t)}a($Va,"bufferToReadable");function MDi(t){return f$.consumeStream(t,e=>VE.concat(e))}a(MDi,"streamToBuffer");async function VVa(t){return t.ended?VE.concat(t.buffer):VE.concat([...t.buffer,await MDi(t.stream)])}a(VVa,"bufferedStreamToBuffer");function WVa(t){return f$.toStream(t,e=>VE.concat(e))}a(WVa,"bufferToStream");function zVa(t){return f$.transform(t,{data:a(e=>typeof e=="string"?VE.fromString(e):VE.wrap(e),"data")},e=>VE.concat(e))}a(zVa,"streamToBufferReadableStream");function YVa(t){return f$.newWriteableStream(e=>VE.concat(e),t)}a(YVa,"newWriteableBufferStream");function KVa(t,e){return f$.prefixedReadable(t,e,r=>VE.concat(r))}a(KVa,"prefixedBufferReadable");function JVa(t,e){return f$.prefixedStream(t,e,r=>VE.concat(r))}a(JVa,"prefixedBufferStream");function ZVa(t){let e=0,r=0,n=0,o=new Uint8Array(Math.floor(t.length/4*3)),s=a(l=>{switch(r){case 3:o[n++]=e|l,r=0;break;case 2:o[n++]=e|l>>>2,e=l<<6,r=3;break;case 1:o[n++]=e|l>>>4,e=l<<4,r=2;break;default:e=l<<2,r=1}},"append");for(let l=0;l=65&&u<=90)s(u-65);else if(u>=97&&u<=122)s(u-97+26);else if(u>=48&&u<=57)s(u-48+52);else if(u===43||u===45)s(62);else if(u===47||u===95)s(63);else{if(u===61)break;throw new SyntaxError(`Unexpected base64 character ${t[l]}`)}}let c=n;for(;r>0;)s(0);return VE.wrap(o).slice(0,c)}a(ZVa,"decodeBase64");var XVa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",eWa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function tWa({buffer:t},e=!0,r=!1){let n=r?eWa:XVa,o="",s=t.byteLength%3,c=0;for(;c>>2],o+=n[(l<<4|u>>>4)&63],o+=n[(u<<2|d>>>6)&63],o+=n[d&63]}if(s===1){let l=t[c+0];o+=n[l>>>2],o+=n[l<<4&63],e&&(o+="==")}else if(s===2){let l=t[c+0],u=t[c+1];o+=n[l>>>2],o+=n[(l<<4|u>>>4)&63],o+=n[u<<2&63],e&&(o+="=")}return o}a(tWa,"encodeBase64");var TDi="0123456789abcdef";function rWa({buffer:t}){let e="";for(let r=0;r>>4],e+=TDi[n&15]}return e}a(rWa,"encodeHex");function nWa(t){if(t.length%2!==0)throw new SyntaxError("Hex string must have an even length");let e=new Uint8Array(t.length>>1);for(let r=0;r>1]=IDi(t,r++)<<4|IDi(t,r++);return VE.wrap(e)}a(nWa,"decodeHex");function IDi(t,e){let r=t.charCodeAt(e);if(r>=48&&r<=57)return r-48;if(r>=97&&r<=102)return r-87;if(r>=65&&r<=70)return r-55;throw new SyntaxError(`Invalid hex character at position ${e}`)}a(IDi,"decodeHexChar")});var ODi=I(Ayt=>{"use strict";p();Object.defineProperty(Ayt,"__esModule",{value:!0});Ayt.readVariableLengthQuantity=oWa;Ayt.writeVariableLengthQuantity=sWa;var iWa=p$();function oWa(t,e){let r=0,n=0,o;do o=t.readUInt8(e+n),r|=(o&127)<>>=7,t!==0&&(r|=128),e.push(r)}while(t!==0);return iWa.VSBuffer.fromByteArray(e)}a(sWa,"writeVariableLengthQuantity")});var tIr=I(yyt=>{"use strict";p();Object.defineProperty(yyt,"__esModule",{value:!0});yyt.parseTikTokenBinary=void 0;var aWa=require("fs"),cWa=ODi(),lWa=p$(),uWa=a(t=>{let e=(0,aWa.readFileSync)(t),r=new Map;for(let n=0;n{"use strict";p();Object.defineProperty(Eyt,"__esModule",{value:!0});Eyt.CopilotPromptLoadFailure=void 0;var rIr=class extends Error{static{a(this,"CopilotPromptLoadFailure")}constructor(e,r){super(e,{cause:r}),this.code="CopilotPromptLoadFailure"}};Eyt.CopilotPromptLoadFailure=rIr});var iIr=I(jR=>{"use strict";p();var dWa=jR&&jR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fWa=jR&&jR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pWa=jR&&jR.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(HR,"__esModule",{value:!0});HR.ApproximateTokenizer=HR.TTokenizer=HR.TokenizerName=void 0;HR.setExternalTokenizerProvider=_Wa;HR.getTokenizer=vWa;HR.ensureTokenizersLoaded=bWa;HR.resetTokenizersForTest=SWa;var oIr=JTr(),AWa=tIr(),yWa=nIr(),EWa=iIr(),PD;(function(t){t.cl100k="cl100k_base",t.o200k="o200k_base",t.mock="mock"})(PD||(HR.TokenizerName=PD={}));var TAe=new Map,jre;function _Wa(t){jre||Syt||(jre=t)}a(_Wa,"setExternalTokenizerProvider");function vWa(t=PD.o200k){if(jre)try{return jre.getTokenizer(t)}catch{}let e=TAe.get(t);return e!==void 0||(UDi(),e=TAe.get(PD.o200k),e!==void 0)?e:new byt}a(vWa,"getTokenizer");var vyt=class t{static{a(this,"TTokenizer")}constructor(e){this._tokenizer=e}static async create(e){try{let r=(0,oIr.createTokenizer)((0,AWa.parseTikTokenBinary)((0,EWa.locateFile)(`${e}.tiktoken`)),(0,oIr.getSpecialTokensByEncoder)(e),(0,oIr.getRegexByEncoder)(e),32768);return new t(r)}catch(r){throw r instanceof Error?new yWa.CopilotPromptLoadFailure("Could not load tokenizer",r):r}}tokenize(e){return this._tokenizer.encode(e)}detokenize(e){return this._tokenizer.decode(e)}tokenLength(e){return this.tokenize(e).length}tokenizeStrings(e){return this.tokenize(e).map(n=>this.detokenize([n]))}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=4,o=1,s=Math.min(e.length,r*n),c=e.slice(-s),l=this.tokenize(c);for(;l.length{let r=0;for(let n=0;nr.toString()).join(" ")}tokenizeStrings(e){return e.split(/\b/)}tokenLength(e){return this.tokenizeStrings(e).length}takeLastTokens(e,r){let n=this.tokenizeStrings(e).slice(-r);return{text:n.join(""),tokens:n.map(this.hash)}}takeFirstTokens(e,r){let n=this.tokenizeStrings(e).slice(0,r);return{text:n.join(""),tokens:n.map(this.hash)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` +`);return n.substring(o+1)}};HR.TTokenizer=vyt;var Cyt=class{static{a(this,"MockTokenizer")}constructor(){this.hash=e=>{let r=0;for(let n=0;nr.toString()).join(" ")}tokenizeStrings(e){return e.split(/\b/)}tokenLength(e){return this.tokenizeStrings(e).length}takeLastTokens(e,r){let n=this.tokenizeStrings(e).slice(-r);return{text:n.join(""),tokens:n.map(this.hash)}}takeFirstTokens(e,r){let n=this.tokenizeStrings(e).slice(0,r);return{text:n.join(""),tokens:n.map(this.hash)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` `)return n;let o=n.indexOf(` -`);return n.substring(o+1)}},ZGa={[bD.cl100k]:{python:3.99,typescript:4.54,typescriptreact:4.58,javascript:4.76,csharp:5.13,java:4.86,cpp:3.85,php:4.1,html:4.57,vue:4.22,go:3.93,dart:5.66,javascriptreact:4.81,css:3.37},[bD.o200k]:{python:4.05,typescript:4.12,typescriptreact:5.01,javascript:4.47,csharp:5.47,java:4.86,cpp:3.8,php:4.35,html:4.86,vue:4.3,go:4.21,dart:5.7,javascriptreact:4.83,css:3.33}},pTr=4,JAt=class{static{a(this,"ApproximateTokenizer")}constructor(e=bD.o200k,r){this.languageId=r,this.tokenizerName=e}tokenize(e){return this.tokenizeStrings(e).map(r=>{let n=0;for(let o=0;o{let n=[],o=r.toString();for(;o.length>0;){let s=o.slice(-pTr),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-pTr)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?ZGa[this.tokenizerName]?.[this.languageId]??4:4}tokenLength(e){return Math.ceil(e.length/this.getEffectiveTokenLength())}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(-Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeFirstTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(0,Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` +`);return n.substring(o+1)}},CWa={[PD.cl100k]:{python:3.99,typescript:4.54,typescriptreact:4.58,javascript:4.76,csharp:5.13,java:4.86,cpp:3.85,php:4.1,html:4.57,vue:4.22,go:3.93,dart:5.66,javascriptreact:4.81,css:3.37},[PD.o200k]:{python:4.05,typescript:4.12,typescriptreact:5.01,javascript:4.47,csharp:5.47,java:4.86,cpp:3.8,php:4.35,html:4.86,vue:4.3,go:4.21,dart:5.7,javascriptreact:4.83,css:3.33}},sIr=4,byt=class{static{a(this,"ApproximateTokenizer")}constructor(e=PD.o200k,r){this.languageId=r,this.tokenizerName=e}tokenize(e){return this.tokenizeStrings(e).map(r=>{let n=0;for(let o=0;o{let n=[],o=r.toString();for(;o.length>0;){let s=o.slice(-sIr),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-sIr)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?CWa[this.tokenizerName]?.[this.languageId]??4:4}tokenLength(e){return Math.ceil(e.length/this.getEffectiveTokenLength())}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(-Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeFirstTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(0,Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` `)return n;let o=n.indexOf(` -`);return n.substring(o+1)}};MR.ApproximateTokenizer=JAt;async function VPi(t){try{let e=await YAt.create(t);lAe.set(t,e)}catch{}}a(VPi,"setTokenizer");lAe.set(bD.mock,new KAt);var ZAt,zAt;function WPi(){if(Nre){let t=Nre;return zAt??=Promise.resolve().then(()=>t.ensureLoaded()).catch(()=>{zAt=void 0}),zAt}return ZAt??=Promise.all([VPi(bD.cl100k),VPi(bD.o200k)]).then(()=>{}),ZAt}a(WPi,"loadTokenizers");function XGa(){return WPi()}a(XGa,"ensureTokenizersLoaded");function e$a(){Nre=void 0,ZAt=void 0,zAt=void 0,lAe.clear(),lAe.set(bD.mock,new KAt)}a(e$a,"resetTokenizersForTest")});var Ore=I(Mre=>{"use strict";p();var t$a=Mre&&Mre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),r$a=Mre&&Mre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&t$a(e,t,r)};Object.defineProperty(Mre,"__esModule",{value:!0});r$a(zPi(),Mre)});var mTr=I(SD=>{"use strict";p();var n$a=SD&&SD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},u4e=SD&&SD.__param||function(t,e){return function(r,n){e(r,n,t)}},d4e;Object.defineProperty(SD,"__esModule",{value:!0});SD.AvailableModelsManager=SD.ICompletionsModelManagerService=void 0;var i$a=FE(),o$a=s4e(),s$a=nn(),a$a=Ro(),c$a=Gs(),l$a=APi(),u$a=Ore(),d$a=kvr(),f$a=fgt(),XAt=LE(),p$a=fy(),YPi=Dl();SD.ICompletionsModelManagerService=(0,s$a.createServiceIdentifier)("ICompletionsModelManagerService");var h$a="gpt-41-copilot",hTr=d4e=class extends a$a.Disposable{static{a(this,"AvailableModelsManager")}constructor(e=!0,r,n,o,s,c){super(),this._instantiationService=r,this._featuresService=n,this._endpointProvider=o,this._logService=c,this.fetchedModelData=[],this.customModels=[],this.editorPreviewFeaturesDisabled=!1,this._onDidChangeModels=this._register(new d$a.Emitter),this.onDidChangeModels=this._onDidChangeModels.event,e&&this._register((0,f$a.onCopilotToken)(s,()=>this.refreshAvailableModels()))}async refreshAvailableModels(){await this.refreshModels()}getDefaultModelId(){if(this.fetchedModelData){let e=d4e.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return h$a}async refreshModels(){let e=await this._endpointProvider.getAllCompletionModels(!0);e&&(this.fetchedModelData=e,this._onDidChangeModels.fire())}getGenericCompletionModels(){let e=d4e.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return d4e.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:u$a.TokenizerName.o200k}static filterCompletionModels(e,r){return e.filter(n=>n.capabilities.type==="completion").filter(n=>!r||n.preview===!1||n.preview===void 0)}static filterModelsWithEditorPreviewFeatures(e,r){return e.filter(n=>!r||n.preview===!1||n.preview===void 0)}static mapCompletionModels(e){return e.map(r=>({modelId:r.id,label:r.name,preview:!!r.preview,tokenizer:r.capabilities.tokenizer}))}getCurrentModelRequestInfo(e=void 0){let r=this.getDefaultModelId(),n=this._instantiationService.invokeFunction(l$a.getUserSelectedModelConfiguration);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&this._logService.logIt(YPi.LogLevel.INFO,`User selected model ${n} is not in the list of generic models: ${l.join(", ")}, falling back to default model.`),n=null),r===n&&(n=null)}let o=this._instantiationService.invokeFunction(XAt.getConfig,XAt.ConfigKey.DebugOverrideEngine)||this._instantiationService.invokeFunction(XAt.getConfig,XAt.ConfigKey.DebugOverrideEngineLegacy);if(o)return new t$(o,"override");let s=e?this._featuresService.customEngine(e):void 0,c=e?this._featuresService.customEngineTargetEngine(e):void 0;return n?s&&c&&n===c?new t$(s,"exp"):new t$(n,"modelpicker"):s?new t$(s,"exp"):this.customModels.length>0?new t$(this.customModels[0],"custommodel"):new t$(r,"default")}};SD.AvailableModelsManager=hTr;SD.AvailableModelsManager=hTr=d4e=n$a([u4e(1,c$a.IInstantiationService),u4e(2,p$a.ICompletionsFeaturesService),u4e(3,o$a.IEndpointProvider),u4e(4,i$a.IAuthenticationService),u4e(5,YPi.ICompletionsLogTargetService)],hTr);var t$=class{static{a(this,"ModelRequestInfo")}constructor(e,r){this.modelId=e,this.modelChoiceSource=r}get headers(){return{}}}});var ATr=I(gTr=>{"use strict";p();Object.defineProperty(gTr,"__esModule",{value:!0});gTr.getEngineRequestInfo=g$a;var m$a=mTr();function g$a(t,e=void 0){let r=t.get(m$a.ICompletionsModelManagerService),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(g$a,"getEngineRequestInfo")});var XPi=I(eyt=>{"use strict";p();Object.defineProperty(eyt,"__esModule",{value:!0});eyt.setupCompletionsExperimentationService=v$a;eyt.createCompletionsFilters=ZPi;var A$a=FE(),y$a=mh(),E$a=Gs(),KPi=hPi(),r$=LE(),_$a=ATr(),OR=L0t();function v$a(t){let e=t.get(A$a.IAuthenticationService),r=t.get(E$a.IInstantiationService),n=e.onDidCopilotTokenChange(()=>{r.invokeFunction(JPi,e.copilotToken)});return JPi(t,e.copilotToken),n}a(v$a,"setupCompletionsExperimentationService");function C$a(t){return r$.BuildInfo.getBuildType()===r$.BuildType.NIGHTLY?OR.Release.Nightly:OR.Release.Stable}a(C$a,"getPluginRelease");function JPi(t,e){let r=t.get(y$a.IExperimentationService),n=ZPi(t,e);r.setCompletionsFilters(n)}a(JPi,"updateCompletionsFilters");function ZPi(t,e){let r=new Map;if(r.set(OR.Filter.ExtensionRelease,C$a(t)),r.set(OR.Filter.CopilotOverrideEngine,(0,r$.getConfig)(t,r$.ConfigKey.DebugOverrideEngine)||(0,r$.getConfig)(t,r$.ConfigKey.DebugOverrideEngineLegacy)),r.set(OR.Filter.CopilotClientVersion,r$.BuildInfo.isProduction()?r$.BuildInfo.getVersion():"1.999.0"),e){let o=(0,KPi.getUserKind)(e),s=e.getTokenValue("ft")??"",c=e.getTokenValue("ol")??"",l=e.getTokenValue("cml")??"",u=e.getTokenValue("tid")??"";r.set(OR.Filter.CopilotUserKind,o),r.set(OR.Filter.CopilotCustomModel,s),r.set(OR.Filter.CopilotOrgs,c),r.set(OR.Filter.CopilotCustomModelNames,l),r.set(OR.Filter.CopilotTrackingId,u),r.set(OR.Filter.CopilotUserKind,(0,KPi.getUserKind)(e))}let n=(0,_$a.getEngineRequestInfo)(t).modelId;return r.set(OR.Filter.CopilotEngine,n),r}a(ZPi,"createCompletionsFilters")});var e2i=I(v6=>{"use strict";p();var b$a=v6&&v6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},yTr=v6&&v6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(v6,"__esModule",{value:!0});v6.Features=void 0;var S$a=Sp(),T$a=mh(),I$a=Gs(),uAe=JG(),x$a=Uge(),ETr=$g(),w$a=XPi(),La=M0t(),R$a=L0t(),_Tr=class{static{a(this,"Features")}constructor(e,r,n){this.instantiationService=e,this.experimentationService=r,this.copilotTokenManager=n,this.includeNeighboringFilesDefault=new Map,this.excludeRelatedFilesDefault=new Map}async updateExPValuesAndAssignments(e,r=ETr.TelemetryData.createAndMarkAsIssued()){if(r instanceof ETr.TelemetryWithExp)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let n=this.copilotTokenManager.token??await this.copilotTokenManager.getToken(),{filters:o,exp:s}=this.createExpConfigAndFilters(n);return new ETr.TelemetryWithExp(r.properties,r.measurements,r.issuedTime,{filters:o,exp:s})}async fetchTokenAndUpdateExPValuesAndAssignments(e,r){return await this.updateExPValuesAndAssignments(e,r)}createExpConfigAndFilters(e){let r={};for(let u of Object.values(La.ExpTreatmentVariables)){let d=this.experimentationService.getTreatmentVariable(u);d!==void 0&&(r[u]=d)}let n=Object.entries(r).map(([u,d])=>u+(d?"":"cf")),o=new La.ExpConfig(r,n.join(";")),s=this.instantiationService.invokeFunction(w$a.createCompletionsFilters,e),c={};for(let[u,d]of s.entries())c[u]=d;return{filters:new R$a.FilterSettings(c),exp:o}}async getFallbackExpAndFilters(){let e=this.copilotTokenManager.token??await this.copilotTokenManager.getToken();return this.createExpConfigAndFilters(e)}overrideBlockMode(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.OverrideBlockMode]||void 0}customEngine(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CustomEngine]??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CustomEngineTargetEngine]}suffixPercent(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.SuffixPercent]??uAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.SuffixMatchThreshold]??uAe.DEFAULT_SUFFIX_MATCH_THRESHOLD}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CppHeadersEnableSwitch]??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.RelatedFilesVSCodeCSharp]??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.RelatedFilesVSCodeTypeScript]??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.RelatedFilesVSCode]??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ContextProviders]??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e,r){let n=r.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ContextProviderTimeBudget]??150;return n||(this.getContextProviderExpSettings(e)?.timeBudget??150)}setIncludeNeighboringFilesDefault(e,r){this.includeNeighboringFilesDefault.set(e,r)}includeNeighboringFiles(e,r){return r.filtersAndExp.exp.variables[La.ExpTreatmentVariables.IncludeNeighboringFiles]??!1?!0:this.getContextProviderExpSettings(e)?.includeNeighboringFiles??this.includeNeighboringFilesDefault.get(e)??!1}setExcludeRelatedFilesDefault(e,r){this.excludeRelatedFilesDefault.set(e,r)}excludeRelatedFiles(e,r){return r.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ExcludeRelatedFiles]??!1?!0:this.getContextProviderExpSettings(e)?.excludeRelatedFiles??this.excludeRelatedFilesDefault.get(e)??!1}getContextProviderExpSettings(e){let r=this.experimentationService.getTreatmentVariable(`config.github.copilot.chat.contextprovider.${e}`);if(typeof r=="string")try{let n=JSON.parse(r),o=this.getProviderIDs(n);return delete n.id,delete n.ids,Object.assign({ids:o},{includeNeighboringFiles:!1,excludeRelatedFiles:!1,timeBudget:150},n)}catch{this.instantiationService.invokeFunction(o=>{o.get(S$a.ILogService).error(`Failed to parse context provider exp settings for language ${e}`)});return}else return}getProviderIDs(e){let r=[];if(typeof e.id=="string"&&e.id.length>0&&r.push(e.id),Array.isArray(e.ids))for(let n of e.ids)typeof n=="string"&&n.length>0&&r.push(n);return r}maxPromptCompletionTokens(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.MaxPromptCompletionTokens]??uAe.DEFAULT_MAX_PROMPT_LENGTH+uAe.DEFAULT_MAX_COMPLETION_LENGTH}stableContextPercent(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.StableContextPercent]??uAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.VolatileContextPercent]??uAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CppContextProviderParams]}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CSharpContextProviderParams]}javaContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.JavaContextProviderParams]}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.MultiLanguageContextProviderParams]}tsContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.TsContextProviderParams]}completionsDebounce(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CompletionsDebounce]}enableElectronFetcher(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ElectronFetcher]??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.FetchFetcher]??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.AsyncCompletionsTimeout]??200}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ProgressiveReveal]??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ModelAlwaysTerminatesSingleline]??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ProgressiveRevealLongLookaheadSize]??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ProgressiveRevealShortLookaheadSize]??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.MaxMultilineTokens]??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.MultilineAfterAcceptLines]??1}completionsDelay(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CompletionsDelay]??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.SingleLineUnlessAccepted]??!1}};v6.Features=_Tr;v6.Features=_Tr=b$a([yTr(0,I$a.IInstantiationService),yTr(1,T$a.IExperimentationService),yTr(2,x$a.ICompletionsCopilotTokenManager)],_Tr)});var n$=I(dAe=>{"use strict";p();Object.defineProperty(dAe,"__esModule",{value:!0});dAe.ICompletionsFileSystemService=dAe.FileType=void 0;var k$a=nn(),t2i;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(t2i||(dAe.FileType=t2i={}));dAe.ICompletionsFileSystemService=(0,k$a.createServiceIdentifier)("ICompletionsFileSystemService")});var vTr=I(tyt=>{"use strict";p();Object.defineProperty(tyt,"__esModule",{value:!0});tyt.knownLanguages=void 0;tyt.knownLanguages={abap:{extensions:[".abap"]},aspdotnet:{extensions:[".asax",".ascx",".ashx",".asmx",".aspx",".axd"]},bat:{extensions:[".bat",".cmd"]},bibtex:{extensions:[".bib",".bibtex"]},blade:{extensions:[".blade",".blade.php"]},BluespecSystemVerilog:{extensions:[".bsv"]},c:{extensions:[".c",".cats",".h",".h.in",".idc"]},csharp:{extensions:[".cake",".cs",".cs.pp",".csx",".linq"]},cpp:{extensions:[".c++",".cc",".cp",".cpp",".cppm",".cxx",".h",".h++",".hh",".hpp",".hxx",".idl",".inc",".inl",".ino",".ipp",".ixx",".rc",".re",".tcc",".tpp",".txx",".i"]},cobol:{extensions:[".cbl",".ccp",".cob",".cobol",".cpy"]},css:{extensions:[".css",".wxss"]},clojure:{extensions:[".bb",".boot",".cl2",".clj",".cljc",".cljs",".cljs.hl",".cljscm",".cljx",".edn",".hic"],filenames:["riemann.config"]},ql:{extensions:[".ql",".qll"]},coffeescript:{extensions:["._coffee",".cake",".cjsx",".coffee",".iced"],filenames:["Cakefile"]},cuda:{extensions:[".cu",".cuh"]},dart:{extensions:[".dart"]},dockerfile:{extensions:[".containerfile",".dockerfile"],filenames:["Containerfile","Dockerfile"]},dotenv:{extensions:[".env"],filenames:[".env",".env.ci",".env.dev",".env.development",".env.development.local",".env.example",".env.local",".env.prod",".env.production",".env.sample",".env.staging",".env.test",".env.testing"]},html:{extensions:[".ect",".ejs",".ejs.t",".jst",".hta",".htm",".html",".html.hl",".html5",".inc",".jsp",".njk",".tpl",".twig",".wxml",".xht",".xhtml",".phtml",".liquid"]},elixir:{extensions:[".ex",".exs"],filenames:["mix.lock"]},erlang:{extensions:[".app",".app.src",".erl",".es",".escript",".hrl",".xrl",".yrl"],filenames:["Emakefile","rebar.config","rebar.config.lock","rebar.lock"]},fsharp:{extensions:[".fs",".fsi",".fsx"]},go:{extensions:[".go"]},groovy:{extensions:[".gradle",".groovy",".grt",".gtpl",".gvy",".jenkinsfile"],filenames:["Jenkinsfile","Jenkinsfile"]},graphql:{extensions:[".gql",".graphql",".graphqls"]},terraform:{extensions:[".hcl",".nomad",".tf",".tfvars",".workflow"]},hlsl:{extensions:[".cginc",".fx",".fxh",".hlsl",".hlsli"]},erb:{extensions:[".erb",".erb.deface",".rhtml"]},razor:{extensions:[".cshtml",".razor"]},haml:{extensions:[".haml",".haml.deface"]},handlebars:{extensions:[".handlebars",".hbs"]},haskell:{extensions:[".hs",".hs-boot",".hsc"]},ini:{extensions:[".cfg",".cnf",".dof",".ini",".lektorproject",".prefs",".pro",".properties",".url"],filenames:[".buckconfig",".coveragerc",".flake8",".pylintrc","HOSTS","buildozer.spec","hosts","pylintrc","vlcrc"]},json:{extensions:[".4DForm",".4DProject",".JSON-tmLanguage",".avsc",".geojson",".gltf",".har",".ice",".json",".json.example",".jsonl",".mcmeta",".sarif",".tact",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","MODULE.bazel.lock","Package.resolved","Pipfile.lock","bun.lock","composer.lock","deno.lock","flake.lock","mcmod.info"]},jsonc:{extensions:[".code-snippets",".code-workspace",".jsonc",".sublime-build",".sublime-color-scheme",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[".babelrc",".devcontainer.json",".eslintrc.json",".jscsrc",".jshintrc",".jslintrc",".swcrc","api-extractor.json","argv.json","devcontainer.json","extensions.json","jsconfig.json","keybindings.json","language-configuration.json","launch.json","profiles.json","settings.json","tasks.json","tsconfig.json","tslint.json"]},java:{extensions:[".jav",".java",".jsh"]},javascript:{extensions:["._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".js",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib"],filenames:["Jakefile"]},julia:{extensions:[".jl"]},kotlin:{extensions:[".kt",".ktm",".kts"]},less:{extensions:[".less"]},lua:{extensions:[".fcgi",".lua",".luau",".nse",".p8",".pd_lua",".rbxs",".rockspec",".wlua"],filenames:[".luacheckrc"]},makefile:{extensions:[".d",".mak",".make",".makefile",".mk",".mkfile"],filenames:["BSDmakefile","GNUmakefile","Kbuild","Makefile","Makefile.am","Makefile.boot","Makefile.frag","Makefile.in","Makefile.inc","Makefile.wat","makefile","makefile.sco","mkfile"]},markdown:{extensions:[".livemd",".markdown",".md",".mdown",".mdwn",".mdx",".mkd",".mkdn",".mkdown",".ronn",".scd",".workbook"],filenames:["contents.lr"]},"objective-c":{extensions:[".h",".m"]},"objective-cpp":{extensions:[".mm"]},php:{extensions:[".aw",".ctp",".fcgi",".inc",".install",".module",".php",".php3",".php4",".php5",".phps",".phpt",".theme"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"]},perl:{extensions:[".al",".cgi",".fcgi",".perl",".ph",".pl",".plx",".pm",".psgi",".t"],filenames:[".latexmkrc","Makefile.PL","Rexfile","ack","cpanfile","latexmkrc"]},powershell:{extensions:[".ps1",".psd1",".psm1"]},pug:{extensions:[".jade",".pug"]},python:{extensions:[".cgi",".codon",".fcgi",".gyp",".gypi",".lmi",".py",".py3",".pyde",".pyi",".pyp",".pyt",".pyw",".rpy",".sage",".spec",".tac",".wsgi",".xpy"],filenames:[".gclient","DEPS","SConscript","SConstruct","wscript"]},r:{extensions:[".r",".rd",".rsx"],filenames:[".Rprofile","expr-dist"]},ruby:{extensions:[".builder",".eye",".fcgi",".gemspec",".god",".jbuilder",".mspec",".pluginspec",".podspec",".prawn",".rabl",".rake",".rb",".rbi",".rbuild",".rbw",".rbx",".ru",".ruby",".spec",".thor",".watchr"],filenames:[".irbrc",".pryrc",".simplecov","Appraisals","Berksfile","Brewfile","Buildfile","Capfile","Dangerfile","Deliverfile","Fastfile","Gemfile","Guardfile","Jarfile","Mavenfile","Podfile","Puppetfile","Rakefile","Snapfile","Steepfile","Thorfile","Vagrantfile","buildfile"]},rust:{extensions:[".rs",".rs.in"]},scss:{extensions:[".scss"]},sql:{extensions:[".cql",".ddl",".inc",".mysql",".prc",".sql",".tab",".udf",".viw"]},sass:{extensions:[".sass"]},scala:{extensions:[".kojo",".sbt",".sc",".scala"]},shellscript:{extensions:[".bash",".bats",".cgi",".command",".fcgi",".fish",".ksh",".sh",".sh.in",".tmux",".tool",".trigger",".zsh",".zsh-theme"],filenames:[".bash_aliases",".bash_functions",".bash_history",".bash_logout",".bash_profile",".bashrc",".cshrc",".envrc",".flaskenv",".kshrc",".login",".profile",".tmux.conf",".zlogin",".zlogout",".zprofile",".zshenv",".zshrc","9fs","PKGBUILD","bash_aliases","bash_logout","bash_profile","bashrc","cshrc","gradlew","kshrc","login","man","profile","tmux.conf","zlogin","zlogout","zprofile","zshenv","zshrc"]},slang:{extensions:[".fxc",".hlsl",".s",".slang",".slangh",".usf",".ush",".vfx"]},slim:{extensions:[".slim"]},solidity:{extensions:[".sol"]},stylus:{extensions:[".styl"]},svelte:{extensions:[".svelte"]},swift:{extensions:[".swift"]},systemverilog:{extensions:[".sv",".svh",".vh"]},typescriptreact:{extensions:[".tsx"]},latex:{extensions:[".aux",".bbx",".cbx",".cls",".dtx",".ins",".lbx",".ltx",".mkii",".mkiv",".mkvi",".sty",".tex",".toc"]},typescript:{extensions:[".cts",".mts",".ts"]},verilog:{extensions:[".v",".veo"]},vim:{extensions:[".vba",".vim",".vimrc",".vmb"],filenames:[".exrc",".gvimrc",".nvimrc",".vimrc","_vimrc","gvimrc","nvimrc","vimrc"]},vb:{extensions:[".vb",".vbhtml",".Dsr",".bas",".cls",".ctl",".frm",".vbs"]},vue:{extensions:[".nvue",".vue"]},xml:{extensions:[".adml",".admx",".ant",".axaml",".axml",".builds",".ccproj",".ccxml",".clixml",".cproject",".cscfg",".csdef",".csl",".csproj",".ct",".depproj",".dita",".ditamap",".ditaval",".dll.config",".dotsettings",".filters",".fsproj",".fxml",".glade",".gml",".gmx",".gpx",".grxml",".gst",".hzp",".iml",".ivy",".jelly",".jsproj",".kml",".launch",".mdpolicy",".mjml",".mod",".mojo",".mxml",".natvis",".ncl",".ndproj",".nproj",".nuspec",".odd",".osm",".pkgproj",".plist",".pluginspec",".proj",".props",".ps1xml",".psc1",".pt",".pubxml",".qhelp",".rdf",".res",".resx",".rss",".sch",".scxml",".sfproj",".shproj",".srdf",".storyboard",".sublime-snippet",".svg",".sw",".targets",".tml",".typ",".ui",".urdf",".ux",".vbproj",".vcxproj",".vsixmanifest",".vssettings",".vstemplate",".vxml",".wixproj",".workflow",".wsdl",".wsf",".wxi",".wxl",".wxs",".x3d",".xacro",".xaml",".xib",".xlf",".xliff",".xmi",".xml",".xml.dist",".xmp",".xproj",".xsd",".xspec",".xul",".zcml"],filenames:[".classpath",".cproject",".project","App.config","NuGet.config","Settings.StyleCop","Web.Debug.config","Web.Release.config","Web.config","packages.config"]},xsl:{extensions:[".xsl",".xslt"]},yaml:{extensions:[".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".clangd",".gemrc","CITATION.cff","glide.lock","pixi.lock","yarn.lock"]},javascriptreact:{extensions:[".jsx"]},legend:{extensions:[".pure"]}}});var n2i=I(i$=>{"use strict";p();Object.defineProperty(i$,"__esModule",{value:!0});i$.knownFileExtensions=i$.templateLanguageLimitations=i$.knownTemplateLanguageExtensions=void 0;var r2i=vTr();i$.knownTemplateLanguageExtensions=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"];i$.templateLanguageLimitations={".php":[".blade"]};i$.knownFileExtensions=Object.keys(r2i.knownLanguages).flatMap(t=>r2i.knownLanguages[t].extensions)});var o$=I(TD=>{"use strict";p();Object.defineProperty(TD,"__esModule",{value:!0});TD.makeFsUri=O$a;TD.validateUri=L$a;TD.normalizeUri=B$a;TD.fsPath=a2i;TD.getFsPath=c2i;TD.getFsUri=F$a;TD.joinPath=U$a;TD.basename=j$a;TD.dirname=H$a;var P$a=require("os"),D$a=require("path"),N$a=ZP(),f4e=nd();function o2i(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+o2i(t.substring(3)):t}}a(o2i,"decodeURIComponentGraceful");var i2i=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function M$a(t){return t.match(i2i)?t.replace(i2i,e=>o2i(e)):t}a(M$a,"percentDecode");function O$a(t){if(/^[A-Za-z][A-Za-z0-9+.-]+:/.test(t))throw new Error("Path must not contain a scheme");if(!t)throw new Error("Path must not be empty");return f4e.URI.file(t).toString()}a(O$a,"makeFsUri");function p4e(t){if(typeof t!="string"&&(t=t.uri),/^[A-Za-z]:\\/.test(t))throw new Error(`Could not parse <${t}>: Windows-style path`);try{let e=t.match(/^(?:([^:/?#]+?:)?\/\/)(\/\/.*)$/);return e?f4e.URI.parse(e[1]+e[2],!0):f4e.URI.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(p4e,"parseUri");function L$a(t){return p4e(t),t}a(L$a,"validateUri");function B$a(t){try{return p4e(t).toString()}catch{return t}}a(B$a,"normalizeUri");var s2i=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function a2i(t){let e=p4e(t);if(!s2i.has(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,P$a.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,D$a.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(a2i,"fsPath");function c2i(t){try{return a2i(t)}catch{return}}a(c2i,"getFsPath");function F$a(t){let e=c2i(t);if(e)return f4e.URI.file(e).toString()}a(F$a,"getFsUri");function U$a(t,...e){let r=f4e.URI.joinPath(p4e(t),...e.map(Q$a)).toString();return typeof t=="string"?r:{uri:r}}a(U$a,"joinPath");function Q$a(t){return q$a(t)?t.replaceAll("\\","/"):t}a(Q$a,"pathToURIPath");function q$a(t){return/^[^/\\]*\\/.test(t)}a(q$a,"isWinPath");function j$a(t){return M$a((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(j$a,"basename");function H$a(t){let e=(0,N$a.dirname)(p4e(t)),r;return s2i.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(H$a,"dirname")});var u2i=I(jE=>{"use strict";p();var G$a=jE&&jE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$$a=jE&&jE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),V$a=jE&&jE.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0&&CTr.knownFileExtensions.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=CTr.templateLanguageLimitations[e];return!n||n.includes(r)}detectLanguageId(e,r){if(fAe.has(e))return{languageId:fAe.get(e)[0],isGuess:!1};let n=bTr.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),fAe.has(e))return{languageId:fAe.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},TTr=class extends pAe{static{a(this,"GroupingLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){let r=this.delegate.detectLanguage(e),n=r.languageId;return n==="c"||n==="cpp"?new Lre("cpp",r.isGuess,r.fileExtension):r}},ITr=class extends pAe{static{a(this,"ClientProvidedLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){return e.uri.startsWith("untitled:")||e.uri.startsWith("vscode-notebook-cell:")?new Lre(e.languageId,!0,""):this.delegate.detectLanguage(e)}};jE.languageDetection=new TTr(new ITr(new STr));function Y$a({uri:t,languageId:e}){let r=jE.languageDetection.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(Y$a,"detectLanguage")});var mAe=I(hAe=>{"use strict";p();Object.defineProperty(hAe,"__esModule",{value:!0});hAe.CopilotTextDocument=hAe.LocationFactory=void 0;var K$a=u2i(),J$a=o$(),h4e=(_6t(),ba(epn)),s$=ebe(),xTr=class{static{a(this,"LocationFactory")}static{this.range=s$.Range.create.bind(s$.Range)}static{this.position=s$.Position.create.bind(s$.Position)}};hAe.LocationFactory=xTr;var wTr=class t{static{a(this,"CopilotTextDocument")}constructor(e,r,n){this.uri=e,this._textDocument=r,this.detectedLanguageId=n}static withChanges(e,r,n){let o=h4e.TextDocument.create(e.clientUri,e.clientLanguageId,n,e.getText());return h4e.TextDocument.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=h4e.TextDocument.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return h4e.TextDocument.update(r,e.map(n=>({text:n.newText,range:n.range})),this.version),new t(this.uri,r,this.detectedLanguageId)}static create(e,r,n,o,s=(0,K$a.detectLanguage)({uri:e,languageId:r})){return new t((0,J$a.normalizeUri)(e),h4e.TextDocument.create(e,r,n,o),s)}get clientUri(){return this._textDocument.uri}get clientLanguageId(){return this._textDocument.languageId}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){let r=typeof e=="number"?e:e.line;if(r<0||r>=this.lineCount)throw new RangeError("Illegal value for lineNumber");let n=s$.Range.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=s$.Range.create(s$.Position.create(r,0),s$.Position.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};hAe.CopilotTextDocument=wTr});var g4e=I((OMp,h2i)=>{"use strict";p();var RTr=Object.defineProperty,Z$a=Object.getOwnPropertyDescriptor,X$a=Object.getOwnPropertyNames,eVa=Object.prototype.hasOwnProperty,tVa=a((t,e)=>{for(var r in e)RTr(t,r,{get:e[r],enumerable:!0})},"__export"),rVa=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of X$a(e))!eVa.call(t,o)&&o!==r&&RTr(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=Z$a(e,o))||n.enumerable});return t},"__copyProps"),nVa=a(t=>rVa(RTr({},"__esModule",{value:!0}),t),"__toCommonJS"),f2i={};tVa(f2i,{config:a(()=>cVa,"config"),t:a(()=>p2i,"t")});h2i.exports=nVa(f2i);var iVa=require("fs"),oVa=require("fs/promises");async function sVa(t){if(t.protocol==="file:")return await(0,oVa.readFile)(t,"utf8");if(t.protocol==="http:"||t.protocol==="https:"){let e=await fetch(t.toString(),{headers:{"Accept-Encoding":"gzip, deflate",Accept:"application/json"},redirect:"follow"});if(!e.ok){let n=`Unexpected ${e.status} response while trying to read ${t}`;try{n+=`: ${await e.text()}`}catch{}throw new Error(n)}return await e.text()}throw new Error("Unsupported protocol")}a(sVa,"readFileFromUri");function aVa(t){return(0,iVa.readFileSync)(t,"utf8")}a(aVa,"readFileFromFsPath");var m4e;function cVa(t){if("contents"in t){typeof t.contents=="string"?m4e=JSON.parse(t.contents):m4e=t.contents;return}if("fsPath"in t){let e=aVa(t.fsPath),r=JSON.parse(e);m4e=d2i(r)?r.contents.bundle:r;return}if(t.uri){let e=t.uri;return typeof t.uri=="string"&&(e=new URL(t.uri)),new Promise((r,n)=>{sVa(e).then(o=>{try{let s=JSON.parse(o);m4e=d2i(s)?s.contents.bundle:s,r()}catch(s){n(s)}}).catch(o=>{n(o)})})}}a(cVa,"config");function p2i(...t){let e=t[0],r,n,o;if(typeof e=="string")r=e,n=e,t.splice(0,1),o=!t||typeof t[0]!="object"?t:t[0];else if(e instanceof Array){let c=t.slice(1);if(e.length!==c.length+1)throw new Error("expected a string as the first argument to l10n.t");let l=e[0];for(let u=1;u0&&(r+=`/${Array.isArray(e.comment)?e.comment.join(""):e.comment}`),o=e.args??{};let s=m4e?.[r];return s?typeof s=="string"?ryt(s,o):s.comment?ryt(s.message,o):ryt(n,o):ryt(n,o)}a(p2i,"t");var lVa=/{([^}]+)}/g;function ryt(t,e){return Object.keys(e).length===0?t:t.replace(lVa,(r,n)=>e[n]??r)}a(ryt,"format");function d2i(t){return typeof t?.contents?.bundle=="object"&&typeof t?.version=="string"}a(d2i,"isBuiltinExtension")});var Bre=I(Nv=>{"use strict";p();var uVa=Nv&&Nv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dVa=Nv&&Nv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fVa=Nv&&Nv.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot.ensureLoaded()).catch(()=>{_yt=void 0}),_yt}return Syt??=Promise.all([FDi(PD.cl100k),FDi(PD.o200k)]).then(()=>{}),Syt}a(UDi,"loadTokenizers");function bWa(){return UDi()}a(bWa,"ensureTokenizersLoaded");function SWa(){jre=void 0,Syt=void 0,_yt=void 0,TAe.clear(),TAe.set(PD.mock,new Cyt)}a(SWa,"resetTokenizersForTest")});var Gre=I(Hre=>{"use strict";p();var TWa=Hre&&Hre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),IWa=Hre&&Hre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&TWa(e,t,r)};Object.defineProperty(Hre,"__esModule",{value:!0});IWa(QDi(),Hre)});var cIr=I(DD=>{"use strict";p();var xWa=DD&&DD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},N4e=DD&&DD.__param||function(t,e){return function(r,n){e(r,n,t)}},M4e;Object.defineProperty(DD,"__esModule",{value:!0});DD.AvailableModelsManager=DD.ICompletionsModelManagerService=void 0;var wWa=HE(),RWa=R4e(),kWa=nn(),PWa=Ro(),DWa=$s(),NWa=lDi(),MWa=Gre(),OWa=bCr(),LWa=Fgt(),Tyt=qE(),BWa=gy(),qDi=Dl();DD.ICompletionsModelManagerService=(0,kWa.createServiceIdentifier)("ICompletionsModelManagerService");var FWa="gpt-41-copilot",aIr=M4e=class extends PWa.Disposable{static{a(this,"AvailableModelsManager")}constructor(e=!0,r,n,o,s,c){super(),this._instantiationService=r,this._featuresService=n,this._endpointProvider=o,this._logService=c,this.fetchedModelData=[],this.customModels=[],this.editorPreviewFeaturesDisabled=!1,this._onDidChangeModels=this._register(new OWa.Emitter),this.onDidChangeModels=this._onDidChangeModels.event,e&&this._register((0,LWa.onCopilotToken)(s,()=>this.refreshAvailableModels()))}async refreshAvailableModels(){await this.refreshModels()}getDefaultModelId(){if(this.fetchedModelData){let e=M4e.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return FWa}async refreshModels(){let e=await this._endpointProvider.getAllCompletionModels(!0);e&&(this.fetchedModelData=e,this._onDidChangeModels.fire())}getGenericCompletionModels(){let e=M4e.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return M4e.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:MWa.TokenizerName.o200k}static filterCompletionModels(e,r){return e.filter(n=>n.capabilities.type==="completion").filter(n=>!r||n.preview===!1||n.preview===void 0)}static filterModelsWithEditorPreviewFeatures(e,r){return e.filter(n=>!r||n.preview===!1||n.preview===void 0)}static mapCompletionModels(e){return e.map(r=>({modelId:r.id,label:r.name,preview:!!r.preview,tokenizer:r.capabilities.tokenizer}))}getCurrentModelRequestInfo(e=void 0){let r=this.getDefaultModelId(),n=this._instantiationService.invokeFunction(NWa.getUserSelectedModelConfiguration);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&this._logService.logIt(qDi.LogLevel.INFO,`User selected model ${n} is not in the list of generic models: ${l.join(", ")}, falling back to default model.`),n=null),r===n&&(n=null)}let o=this._instantiationService.invokeFunction(Tyt.getConfig,Tyt.ConfigKey.DebugOverrideEngine)||this._instantiationService.invokeFunction(Tyt.getConfig,Tyt.ConfigKey.DebugOverrideEngineLegacy);if(o)return new h$(o,"override");let s=e?this._featuresService.customEngine(e):void 0,c=e?this._featuresService.customEngineTargetEngine(e):void 0;return n?s&&c&&n===c?new h$(s,"exp"):new h$(n,"modelpicker"):s?new h$(s,"exp"):this.customModels.length>0?new h$(this.customModels[0],"custommodel"):new h$(r,"default")}};DD.AvailableModelsManager=aIr;DD.AvailableModelsManager=aIr=M4e=xWa([N4e(1,DWa.IInstantiationService),N4e(2,BWa.ICompletionsFeaturesService),N4e(3,RWa.IEndpointProvider),N4e(4,wWa.IAuthenticationService),N4e(5,qDi.ICompletionsLogTargetService)],aIr);var h$=class{static{a(this,"ModelRequestInfo")}constructor(e,r){this.modelId=e,this.modelChoiceSource=r}get headers(){return{}}}});var uIr=I(lIr=>{"use strict";p();Object.defineProperty(lIr,"__esModule",{value:!0});lIr.getEngineRequestInfo=QWa;var UWa=cIr();function QWa(t,e=void 0){let r=t.get(UWa.ICompletionsModelManagerService),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(QWa,"getEngineRequestInfo")});var $Di=I(Iyt=>{"use strict";p();Object.defineProperty(Iyt,"__esModule",{value:!0});Iyt.setupCompletionsExperimentationService=$Wa;Iyt.createCompletionsFilters=GDi;var qWa=HE(),jWa=yh(),HWa=$s(),jDi=sDi(),m$=qE(),GWa=uIr(),GR=cgt();function $Wa(t){let e=t.get(qWa.IAuthenticationService),r=t.get(HWa.IInstantiationService),n=e.onDidCopilotTokenChange(()=>{r.invokeFunction(HDi,e.copilotToken)});return HDi(t,e.copilotToken),n}a($Wa,"setupCompletionsExperimentationService");function VWa(t){return m$.BuildInfo.getBuildType()===m$.BuildType.NIGHTLY?GR.Release.Nightly:GR.Release.Stable}a(VWa,"getPluginRelease");function HDi(t,e){let r=t.get(jWa.IExperimentationService),n=GDi(t,e);r.setCompletionsFilters(n)}a(HDi,"updateCompletionsFilters");function GDi(t,e){let r=new Map;if(r.set(GR.Filter.ExtensionRelease,VWa(t)),r.set(GR.Filter.CopilotOverrideEngine,(0,m$.getConfig)(t,m$.ConfigKey.DebugOverrideEngine)||(0,m$.getConfig)(t,m$.ConfigKey.DebugOverrideEngineLegacy)),r.set(GR.Filter.CopilotClientVersion,m$.BuildInfo.isProduction()?m$.BuildInfo.getVersion():"1.999.0"),e){let o=(0,jDi.getUserKind)(e),s=e.getTokenValue("ft")??"",c=e.getTokenValue("ol")??"",l=e.getTokenValue("cml")??"",u=e.getTokenValue("tid")??"";r.set(GR.Filter.CopilotUserKind,o),r.set(GR.Filter.CopilotCustomModel,s),r.set(GR.Filter.CopilotOrgs,c),r.set(GR.Filter.CopilotCustomModelNames,l),r.set(GR.Filter.CopilotTrackingId,u),r.set(GR.Filter.CopilotUserKind,(0,jDi.getUserKind)(e))}let n=(0,GWa.getEngineRequestInfo)(t).modelId;return r.set(GR.Filter.CopilotEngine,n),r}a(GDi,"createCompletionsFilters")});var VDi=I(N6=>{"use strict";p();var WWa=N6&&N6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},dIr=N6&&N6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(N6,"__esModule",{value:!0});N6.Features=void 0;var zWa=xp(),YWa=yh(),KWa=$s(),IAe=u$(),JWa=tAe(),fIr=Yg(),ZWa=$Di(),La=sgt(),XWa=cgt(),pIr=class{static{a(this,"Features")}constructor(e,r,n){this.instantiationService=e,this.experimentationService=r,this.copilotTokenManager=n,this.includeNeighboringFilesDefault=new Map,this.excludeRelatedFilesDefault=new Map}async updateExPValuesAndAssignments(e,r=fIr.TelemetryData.createAndMarkAsIssued()){if(r instanceof fIr.TelemetryWithExp)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let n=this.copilotTokenManager.token??await this.copilotTokenManager.getToken(),{filters:o,exp:s}=this.createExpConfigAndFilters(n);return new fIr.TelemetryWithExp(r.properties,r.measurements,r.issuedTime,{filters:o,exp:s})}async fetchTokenAndUpdateExPValuesAndAssignments(e,r){return await this.updateExPValuesAndAssignments(e,r)}createExpConfigAndFilters(e){let r={};for(let u of Object.values(La.ExpTreatmentVariables)){let d=this.experimentationService.getTreatmentVariable(u);d!==void 0&&(r[u]=d)}let n=Object.entries(r).map(([u,d])=>u+(d?"":"cf")),o=new La.ExpConfig(r,n.join(";")),s=this.instantiationService.invokeFunction(ZWa.createCompletionsFilters,e),c={};for(let[u,d]of s.entries())c[u]=d;return{filters:new XWa.FilterSettings(c),exp:o}}async getFallbackExpAndFilters(){let e=this.copilotTokenManager.token??await this.copilotTokenManager.getToken();return this.createExpConfigAndFilters(e)}overrideBlockMode(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.OverrideBlockMode]||void 0}customEngine(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CustomEngine]??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CustomEngineTargetEngine]}suffixPercent(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.SuffixPercent]??IAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.SuffixMatchThreshold]??IAe.DEFAULT_SUFFIX_MATCH_THRESHOLD}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CppHeadersEnableSwitch]??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.RelatedFilesVSCodeCSharp]??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.RelatedFilesVSCodeTypeScript]??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.RelatedFilesVSCode]??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ContextProviders]??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e,r){let n=r.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ContextProviderTimeBudget]??150;return n||(this.getContextProviderExpSettings(e)?.timeBudget??150)}setIncludeNeighboringFilesDefault(e,r){this.includeNeighboringFilesDefault.set(e,r)}includeNeighboringFiles(e,r){return r.filtersAndExp.exp.variables[La.ExpTreatmentVariables.IncludeNeighboringFiles]??!1?!0:this.getContextProviderExpSettings(e)?.includeNeighboringFiles??this.includeNeighboringFilesDefault.get(e)??!1}setExcludeRelatedFilesDefault(e,r){this.excludeRelatedFilesDefault.set(e,r)}excludeRelatedFiles(e,r){return r.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ExcludeRelatedFiles]??!1?!0:this.getContextProviderExpSettings(e)?.excludeRelatedFiles??this.excludeRelatedFilesDefault.get(e)??!1}getContextProviderExpSettings(e){let r=this.experimentationService.getTreatmentVariable(`config.github.copilot.chat.contextprovider.${e}`);if(typeof r=="string")try{let n=JSON.parse(r),o=this.getProviderIDs(n);return delete n.id,delete n.ids,Object.assign({ids:o},{includeNeighboringFiles:!1,excludeRelatedFiles:!1,timeBudget:150},n)}catch{this.instantiationService.invokeFunction(o=>{o.get(zWa.ILogService).error(`Failed to parse context provider exp settings for language ${e}`)});return}else return}getProviderIDs(e){let r=[];if(typeof e.id=="string"&&e.id.length>0&&r.push(e.id),Array.isArray(e.ids))for(let n of e.ids)typeof n=="string"&&n.length>0&&r.push(n);return r}maxPromptCompletionTokens(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.MaxPromptCompletionTokens]??IAe.DEFAULT_MAX_PROMPT_LENGTH+IAe.DEFAULT_MAX_COMPLETION_LENGTH}stableContextPercent(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.StableContextPercent]??IAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.VolatileContextPercent]??IAe.DEFAULT_PROMPT_ALLOCATION_PERCENT.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CppContextProviderParams]}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CSharpContextProviderParams]}javaContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.JavaContextProviderParams]}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.MultiLanguageContextProviderParams]}tsContextProviderParams(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.TsContextProviderParams]}completionsDebounce(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CompletionsDebounce]}enableElectronFetcher(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ElectronFetcher]??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.FetchFetcher]??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.AsyncCompletionsTimeout]??200}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ProgressiveReveal]??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ModelAlwaysTerminatesSingleline]??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ProgressiveRevealLongLookaheadSize]??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.ProgressiveRevealShortLookaheadSize]??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.MaxMultilineTokens]??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.MultilineAfterAcceptLines]??1}completionsDelay(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.CompletionsDelay]??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables[La.ExpTreatmentVariables.SingleLineUnlessAccepted]??!1}};N6.Features=pIr;N6.Features=pIr=WWa([dIr(0,KWa.IInstantiationService),dIr(1,YWa.IExperimentationService),dIr(2,JWa.ICompletionsCopilotTokenManager)],pIr)});var g$=I(xAe=>{"use strict";p();Object.defineProperty(xAe,"__esModule",{value:!0});xAe.ICompletionsFileSystemService=xAe.FileType=void 0;var eza=nn(),WDi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(WDi||(xAe.FileType=WDi={}));xAe.ICompletionsFileSystemService=(0,eza.createServiceIdentifier)("ICompletionsFileSystemService")});var hIr=I(xyt=>{"use strict";p();Object.defineProperty(xyt,"__esModule",{value:!0});xyt.knownLanguages=void 0;xyt.knownLanguages={abap:{extensions:[".abap"]},aspdotnet:{extensions:[".asax",".ascx",".ashx",".asmx",".aspx",".axd"]},bat:{extensions:[".bat",".cmd"]},bibtex:{extensions:[".bib",".bibtex"]},blade:{extensions:[".blade",".blade.php"]},BluespecSystemVerilog:{extensions:[".bsv"]},c:{extensions:[".c",".cats",".h",".h.in",".idc"]},csharp:{extensions:[".cake",".cs",".cs.pp",".csx",".linq"]},cpp:{extensions:[".c++",".cc",".cp",".cpp",".cppm",".cxx",".h",".h++",".hh",".hpp",".hxx",".idl",".inc",".inl",".ino",".ipp",".ixx",".rc",".re",".tcc",".tpp",".txx",".i"]},cobol:{extensions:[".cbl",".ccp",".cob",".cobol",".cpy"]},css:{extensions:[".css",".wxss"]},clojure:{extensions:[".bb",".boot",".cl2",".clj",".cljc",".cljs",".cljs.hl",".cljscm",".cljx",".edn",".hic"],filenames:["riemann.config"]},ql:{extensions:[".ql",".qll"]},coffeescript:{extensions:["._coffee",".cake",".cjsx",".coffee",".iced"],filenames:["Cakefile"]},cuda:{extensions:[".cu",".cuh"]},dart:{extensions:[".dart"]},dockerfile:{extensions:[".containerfile",".dockerfile"],filenames:["Containerfile","Dockerfile"]},dotenv:{extensions:[".env"],filenames:[".env",".env.ci",".env.dev",".env.development",".env.development.local",".env.example",".env.local",".env.prod",".env.production",".env.sample",".env.staging",".env.test",".env.testing"]},html:{extensions:[".ect",".ejs",".ejs.t",".jst",".hta",".htm",".html",".html.hl",".html5",".inc",".jsp",".njk",".tpl",".twig",".wxml",".xht",".xhtml",".phtml",".liquid"]},elixir:{extensions:[".ex",".exs"],filenames:["mix.lock"]},erlang:{extensions:[".app",".app.src",".erl",".es",".escript",".hrl",".xrl",".yrl"],filenames:["Emakefile","rebar.config","rebar.config.lock","rebar.lock"]},fsharp:{extensions:[".fs",".fsi",".fsx"]},go:{extensions:[".go"]},groovy:{extensions:[".gradle",".groovy",".grt",".gtpl",".gvy",".jenkinsfile"],filenames:["Jenkinsfile","Jenkinsfile"]},graphql:{extensions:[".gql",".graphql",".graphqls"]},terraform:{extensions:[".hcl",".nomad",".tf",".tfvars",".workflow"]},hlsl:{extensions:[".cginc",".fx",".fxh",".hlsl",".hlsli"]},erb:{extensions:[".erb",".erb.deface",".rhtml"]},razor:{extensions:[".cshtml",".razor"]},haml:{extensions:[".haml",".haml.deface"]},handlebars:{extensions:[".handlebars",".hbs"]},haskell:{extensions:[".hs",".hs-boot",".hsc"]},ini:{extensions:[".cfg",".cnf",".dof",".ini",".lektorproject",".prefs",".pro",".properties",".url"],filenames:[".buckconfig",".coveragerc",".flake8",".pylintrc","HOSTS","buildozer.spec","hosts","pylintrc","vlcrc"]},json:{extensions:[".4DForm",".4DProject",".JSON-tmLanguage",".avsc",".geojson",".gltf",".har",".ice",".json",".json.example",".jsonl",".mcmeta",".sarif",".tact",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","MODULE.bazel.lock","Package.resolved","Pipfile.lock","bun.lock","composer.lock","deno.lock","flake.lock","mcmod.info"]},jsonc:{extensions:[".code-snippets",".code-workspace",".jsonc",".sublime-build",".sublime-color-scheme",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[".babelrc",".devcontainer.json",".eslintrc.json",".jscsrc",".jshintrc",".jslintrc",".swcrc","api-extractor.json","argv.json","devcontainer.json","extensions.json","jsconfig.json","keybindings.json","language-configuration.json","launch.json","profiles.json","settings.json","tasks.json","tsconfig.json","tslint.json"]},java:{extensions:[".jav",".java",".jsh"]},javascript:{extensions:["._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".js",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib"],filenames:["Jakefile"]},julia:{extensions:[".jl"]},kotlin:{extensions:[".kt",".ktm",".kts"]},less:{extensions:[".less"]},lua:{extensions:[".fcgi",".lua",".luau",".nse",".p8",".pd_lua",".rbxs",".rockspec",".wlua"],filenames:[".luacheckrc"]},makefile:{extensions:[".d",".mak",".make",".makefile",".mk",".mkfile"],filenames:["BSDmakefile","GNUmakefile","Kbuild","Makefile","Makefile.am","Makefile.boot","Makefile.frag","Makefile.in","Makefile.inc","Makefile.wat","makefile","makefile.sco","mkfile"]},markdown:{extensions:[".livemd",".markdown",".md",".mdown",".mdwn",".mdx",".mkd",".mkdn",".mkdown",".ronn",".scd",".workbook"],filenames:["contents.lr"]},"objective-c":{extensions:[".h",".m"]},"objective-cpp":{extensions:[".mm"]},php:{extensions:[".aw",".ctp",".fcgi",".inc",".install",".module",".php",".php3",".php4",".php5",".phps",".phpt",".theme"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"]},perl:{extensions:[".al",".cgi",".fcgi",".perl",".ph",".pl",".plx",".pm",".psgi",".t"],filenames:[".latexmkrc","Makefile.PL","Rexfile","ack","cpanfile","latexmkrc"]},powershell:{extensions:[".ps1",".psd1",".psm1"]},pug:{extensions:[".jade",".pug"]},python:{extensions:[".cgi",".codon",".fcgi",".gyp",".gypi",".lmi",".py",".py3",".pyde",".pyi",".pyp",".pyt",".pyw",".rpy",".sage",".spec",".tac",".wsgi",".xpy"],filenames:[".gclient","DEPS","SConscript","SConstruct","wscript"]},r:{extensions:[".r",".rd",".rsx"],filenames:[".Rprofile","expr-dist"]},ruby:{extensions:[".builder",".eye",".fcgi",".gemspec",".god",".jbuilder",".mspec",".pluginspec",".podspec",".prawn",".rabl",".rake",".rb",".rbi",".rbuild",".rbw",".rbx",".ru",".ruby",".spec",".thor",".watchr"],filenames:[".irbrc",".pryrc",".simplecov","Appraisals","Berksfile","Brewfile","Buildfile","Capfile","Dangerfile","Deliverfile","Fastfile","Gemfile","Guardfile","Jarfile","Mavenfile","Podfile","Puppetfile","Rakefile","Snapfile","Steepfile","Thorfile","Vagrantfile","buildfile"]},rust:{extensions:[".rs",".rs.in"]},scss:{extensions:[".scss"]},sql:{extensions:[".cql",".ddl",".inc",".mysql",".prc",".sql",".tab",".udf",".viw"]},sass:{extensions:[".sass"]},scala:{extensions:[".kojo",".sbt",".sc",".scala"]},shellscript:{extensions:[".bash",".bats",".cgi",".command",".fcgi",".fish",".ksh",".sh",".sh.in",".tmux",".tool",".trigger",".zsh",".zsh-theme"],filenames:[".bash_aliases",".bash_functions",".bash_history",".bash_logout",".bash_profile",".bashrc",".cshrc",".envrc",".flaskenv",".kshrc",".login",".profile",".tmux.conf",".zlogin",".zlogout",".zprofile",".zshenv",".zshrc","9fs","PKGBUILD","bash_aliases","bash_logout","bash_profile","bashrc","cshrc","gradlew","kshrc","login","man","profile","tmux.conf","zlogin","zlogout","zprofile","zshenv","zshrc"]},slang:{extensions:[".fxc",".hlsl",".s",".slang",".slangh",".usf",".ush",".vfx"]},slim:{extensions:[".slim"]},solidity:{extensions:[".sol"]},stylus:{extensions:[".styl"]},svelte:{extensions:[".svelte"]},swift:{extensions:[".swift"]},systemverilog:{extensions:[".sv",".svh",".vh"]},typescriptreact:{extensions:[".tsx"]},latex:{extensions:[".aux",".bbx",".cbx",".cls",".dtx",".ins",".lbx",".ltx",".mkii",".mkiv",".mkvi",".sty",".tex",".toc"]},typescript:{extensions:[".cts",".mts",".ts"]},verilog:{extensions:[".v",".veo"]},vim:{extensions:[".vba",".vim",".vimrc",".vmb"],filenames:[".exrc",".gvimrc",".nvimrc",".vimrc","_vimrc","gvimrc","nvimrc","vimrc"]},vb:{extensions:[".vb",".vbhtml",".Dsr",".bas",".cls",".ctl",".frm",".vbs"]},vue:{extensions:[".nvue",".vue"]},xml:{extensions:[".adml",".admx",".ant",".axaml",".axml",".builds",".ccproj",".ccxml",".clixml",".cproject",".cscfg",".csdef",".csl",".csproj",".ct",".depproj",".dita",".ditamap",".ditaval",".dll.config",".dotsettings",".filters",".fsproj",".fxml",".glade",".gml",".gmx",".gpx",".grxml",".gst",".hzp",".iml",".ivy",".jelly",".jsproj",".kml",".launch",".mdpolicy",".mjml",".mod",".mojo",".mxml",".natvis",".ncl",".ndproj",".nproj",".nuspec",".odd",".osm",".pkgproj",".plist",".pluginspec",".proj",".props",".ps1xml",".psc1",".pt",".pubxml",".qhelp",".rdf",".res",".resx",".rss",".sch",".scxml",".sfproj",".shproj",".srdf",".storyboard",".sublime-snippet",".svg",".sw",".targets",".tml",".typ",".ui",".urdf",".ux",".vbproj",".vcxproj",".vsixmanifest",".vssettings",".vstemplate",".vxml",".wixproj",".workflow",".wsdl",".wsf",".wxi",".wxl",".wxs",".x3d",".xacro",".xaml",".xib",".xlf",".xliff",".xmi",".xml",".xml.dist",".xmp",".xproj",".xsd",".xspec",".xul",".zcml"],filenames:[".classpath",".cproject",".project","App.config","NuGet.config","Settings.StyleCop","Web.Debug.config","Web.Release.config","Web.config","packages.config"]},xsl:{extensions:[".xsl",".xslt"]},yaml:{extensions:[".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".clangd",".gemrc","CITATION.cff","glide.lock","pixi.lock","yarn.lock"]},javascriptreact:{extensions:[".jsx"]},legend:{extensions:[".pure"]}}});var YDi=I(A$=>{"use strict";p();Object.defineProperty(A$,"__esModule",{value:!0});A$.knownFileExtensions=A$.templateLanguageLimitations=A$.knownTemplateLanguageExtensions=void 0;var zDi=hIr();A$.knownTemplateLanguageExtensions=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"];A$.templateLanguageLimitations={".php":[".blade"]};A$.knownFileExtensions=Object.keys(zDi.knownLanguages).flatMap(t=>zDi.knownLanguages[t].extensions)});var y$=I(ND=>{"use strict";p();Object.defineProperty(ND,"__esModule",{value:!0});ND.makeFsUri=oza;ND.validateUri=sza;ND.normalizeUri=aza;ND.fsPath=XDi;ND.getFsPath=eNi;ND.getFsUri=cza;ND.joinPath=lza;ND.basename=fza;ND.dirname=pza;var tza=require("os"),rza=require("path"),nza=s2(),O4e=ad();function JDi(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+JDi(t.substring(3)):t}}a(JDi,"decodeURIComponentGraceful");var KDi=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function iza(t){return t.match(KDi)?t.replace(KDi,e=>JDi(e)):t}a(iza,"percentDecode");function oza(t){if(/^[A-Za-z][A-Za-z0-9+.-]+:/.test(t))throw new Error("Path must not contain a scheme");if(!t)throw new Error("Path must not be empty");return O4e.URI.file(t).toString()}a(oza,"makeFsUri");function L4e(t){if(typeof t!="string"&&(t=t.uri),/^[A-Za-z]:\\/.test(t))throw new Error(`Could not parse <${t}>: Windows-style path`);try{let e=t.match(/^(?:([^:/?#]+?:)?\/\/)(\/\/.*)$/);return e?O4e.URI.parse(e[1]+e[2],!0):O4e.URI.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(L4e,"parseUri");function sza(t){return L4e(t),t}a(sza,"validateUri");function aza(t){try{return L4e(t).toString()}catch{return t}}a(aza,"normalizeUri");var ZDi=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function XDi(t){let e=L4e(t);if(!ZDi.has(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,tza.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,rza.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(XDi,"fsPath");function eNi(t){try{return XDi(t)}catch{return}}a(eNi,"getFsPath");function cza(t){let e=eNi(t);if(e)return O4e.URI.file(e).toString()}a(cza,"getFsUri");function lza(t,...e){let r=O4e.URI.joinPath(L4e(t),...e.map(uza)).toString();return typeof t=="string"?r:{uri:r}}a(lza,"joinPath");function uza(t){return dza(t)?t.replaceAll("\\","/"):t}a(uza,"pathToURIPath");function dza(t){return/^[^/\\]*\\/.test(t)}a(dza,"isWinPath");function fza(t){return iza((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(fza,"basename");function pza(t){let e=(0,nza.dirname)(L4e(t)),r;return ZDi.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(pza,"dirname")});var rNi=I(WE=>{"use strict";p();var hza=WE&&WE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mza=WE&&WE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),gza=WE&&WE.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0&&mIr.knownFileExtensions.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=mIr.templateLanguageLimitations[e];return!n||n.includes(r)}detectLanguageId(e,r){if(wAe.has(e))return{languageId:wAe.get(e)[0],isGuess:!1};let n=gIr.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),wAe.has(e))return{languageId:wAe.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},yIr=class extends RAe{static{a(this,"GroupingLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){let r=this.delegate.detectLanguage(e),n=r.languageId;return n==="c"||n==="cpp"?new $re("cpp",r.isGuess,r.fileExtension):r}},EIr=class extends RAe{static{a(this,"ClientProvidedLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){return e.uri.startsWith("untitled:")||e.uri.startsWith("vscode-notebook-cell:")?new $re(e.languageId,!0,""):this.delegate.detectLanguage(e)}};WE.languageDetection=new yIr(new EIr(new AIr));function Eza({uri:t,languageId:e}){let r=WE.languageDetection.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(Eza,"detectLanguage")});var PAe=I(kAe=>{"use strict";p();Object.defineProperty(kAe,"__esModule",{value:!0});kAe.CopilotTextDocument=kAe.LocationFactory=void 0;var _za=rNi(),vza=y$(),B4e=(G6t(),Qa(shn)),E$=_be(),_Ir=class{static{a(this,"LocationFactory")}static{this.range=E$.Range.create.bind(E$.Range)}static{this.position=E$.Position.create.bind(E$.Position)}};kAe.LocationFactory=_Ir;var vIr=class t{static{a(this,"CopilotTextDocument")}constructor(e,r,n){this.uri=e,this._textDocument=r,this.detectedLanguageId=n}static withChanges(e,r,n){let o=B4e.TextDocument.create(e.clientUri,e.clientLanguageId,n,e.getText());return B4e.TextDocument.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=B4e.TextDocument.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return B4e.TextDocument.update(r,e.map(n=>({text:n.newText,range:n.range})),this.version),new t(this.uri,r,this.detectedLanguageId)}static create(e,r,n,o,s=(0,_za.detectLanguage)({uri:e,languageId:r})){return new t((0,vza.normalizeUri)(e),B4e.TextDocument.create(e,r,n,o),s)}get clientUri(){return this._textDocument.uri}get clientLanguageId(){return this._textDocument.languageId}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){let r=typeof e=="number"?e:e.line;if(r<0||r>=this.lineCount)throw new RangeError("Illegal value for lineNumber");let n=E$.Range.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=E$.Range.create(E$.Position.create(r,0),E$.Position.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};kAe.CopilotTextDocument=vIr});var U4e=I((ALp,sNi)=>{"use strict";p();var CIr=Object.defineProperty,Cza=Object.getOwnPropertyDescriptor,bza=Object.getOwnPropertyNames,Sza=Object.prototype.hasOwnProperty,Tza=a((t,e)=>{for(var r in e)CIr(t,r,{get:e[r],enumerable:!0})},"__export"),Iza=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of bza(e))!Sza.call(t,o)&&o!==r&&CIr(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=Cza(e,o))||n.enumerable});return t},"__copyProps"),xza=a(t=>Iza(CIr({},"__esModule",{value:!0}),t),"__toCommonJS"),iNi={};Tza(iNi,{config:a(()=>Dza,"config"),t:a(()=>oNi,"t")});sNi.exports=xza(iNi);var wza=require("fs"),Rza=require("fs/promises");async function kza(t){if(t.protocol==="file:")return await(0,Rza.readFile)(t,"utf8");if(t.protocol==="http:"||t.protocol==="https:"){let e=await fetch(t.toString(),{headers:{"Accept-Encoding":"gzip, deflate",Accept:"application/json"},redirect:"follow"});if(!e.ok){let n=`Unexpected ${e.status} response while trying to read ${t}`;try{n+=`: ${await e.text()}`}catch{}throw new Error(n)}return await e.text()}throw new Error("Unsupported protocol")}a(kza,"readFileFromUri");function Pza(t){return(0,wza.readFileSync)(t,"utf8")}a(Pza,"readFileFromFsPath");var F4e;function Dza(t){if("contents"in t){typeof t.contents=="string"?F4e=JSON.parse(t.contents):F4e=t.contents;return}if("fsPath"in t){let e=Pza(t.fsPath),r=JSON.parse(e);F4e=nNi(r)?r.contents.bundle:r;return}if(t.uri){let e=t.uri;return typeof t.uri=="string"&&(e=new URL(t.uri)),new Promise((r,n)=>{kza(e).then(o=>{try{let s=JSON.parse(o);F4e=nNi(s)?s.contents.bundle:s,r()}catch(s){n(s)}}).catch(o=>{n(o)})})}}a(Dza,"config");function oNi(...t){let e=t[0],r,n,o;if(typeof e=="string")r=e,n=e,t.splice(0,1),o=!t||typeof t[0]!="object"?t:t[0];else if(e instanceof Array){let c=t.slice(1);if(e.length!==c.length+1)throw new Error("expected a string as the first argument to l10n.t");let l=e[0];for(let u=1;u0&&(r+=`/${Array.isArray(e.comment)?e.comment.join(""):e.comment}`),o=e.args??{};let s=F4e?.[r];return s?typeof s=="string"?wyt(s,o):s.comment?wyt(s.message,o):wyt(n,o):wyt(n,o)}a(oNi,"t");var Nza=/{([^}]+)}/g;function wyt(t,e){return Object.keys(e).length===0?t:t.replace(Nza,(r,n)=>e[n]??r)}a(wyt,"format");function nNi(t){return typeof t?.contents?.bundle=="object"&&typeof t?.version=="string"}a(nNi,"isBuiltinExtension")});var Vre=I(Lv=>{"use strict";p();var Mza=Lv&&Lv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Oza=Lv&&Lv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Lza=Lv&&Lv.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(PTr,"__esModule",{value:!0});PTr.isDocumentValid=yVa;var gVa=Bre(),AVa=nd();async function yVa(t,e){return await t.get(gVa.IIgnoreService).isCopilotIgnored(AVa.URI.parse(e.uri))?{status:"invalid",reason:"Document is blocked by repository policy"}:{status:"valid"}}a(yVa,"isDocumentValid")});var s1=I(ID=>{"use strict";p();var EVa=ID&&ID.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},m2i=ID&&ID.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(ID,"__esModule",{value:!0});ID.TextDocumentManager=ID.ICompletionsTextDocumentManagerService=void 0;var _Va=nn(),vVa=Gs(),CVa=n$(),g2i=DTr(),gAe=o$();ID.ICompletionsTextDocumentManagerService=(0,_Va.createServiceIdentifier)("ICompletionsTextDocumentManagerService");var NTr=class{static{a(this,"TextDocumentManager")}constructor(e,r){this.instantiationService=e,this.fileSystem=r}async textDocuments(){let e=this.getTextDocumentsUnsafe(),r=[];for(let n of e)(await this.instantiationService.invokeFunction(g2i.isDocumentValid,n)).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=(0,gAe.normalizeUri)(e.uri);return this.getTextDocumentsUnsafe().find(n=>n.uri===r)}async getTextDocument(e){return this.getTextDocumentWithValidation(e).then(r=>{if(r.status==="valid")return r.document})}async validateTextDocument(e){return await this.instantiationService.invokeFunction(g2i.isDocumentValid,e)}async getTextDocumentValidation(e){try{return await this.validateTextDocument(e)}catch{return this.notFoundResult(e)}}async getTextDocumentWithValidation(e){let r=this.getTextDocumentUnsafe(e);if(!r)return this.notFoundResult(e);let n=await this.validateTextDocument(e);return n.status==="valid"?{status:"valid",document:r}:n}notFoundResult({uri:e}){return{status:"notfound",message:`Document for URI could not be found: ${e}`}}async readTextDocumentFromDisk(e){try{if((await this.fileSystem.stat(e)).size>5*1024*1024)return}catch{return}return await this.fileSystem.readFileString(e)}getWorkspaceFolder(e){let r=(0,gAe.normalizeUri)(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith((0,gAe.normalizeUri)(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=(0,gAe.normalizeUri)(e.uri);for(let n of this.getWorkspaceFolders()){let o=(0,gAe.normalizeUri)(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return(0,gAe.basename)(r)}};ID.TextDocumentManager=NTr;ID.TextDocumentManager=NTr=EVa([m2i(0,vVa.IInstantiationService),m2i(1,CVa.ICompletionsFileSystemService)],NTr)});var LTr=I(xD=>{"use strict";p();var bVa=xD&&xD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},MTr=xD&&xD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(xD,"__esModule",{value:!0});xD.FileReader=xD.ICompletionsFileReaderService=void 0;var SVa=nn(),TVa=Gs(),IVa=n$(),xVa=mAe(),wVa=s1(),RVa=DTr(),kVa=o$();xD.ICompletionsFileReaderService=(0,SVa.createServiceIdentifier)("ICompletionsFileReaderService");var OTr=class{static{a(this,"FileReader")}constructor(e,r,n){this.documentManagerService=e,this.instantiationService=r,this.fileSystemService=n}getRelativePath(e){return this.documentManagerService.getRelativePath(e)??(0,kVa.basename)(e.uri)}getOrReadTextDocument(e){return this.readFile(e.uri)}getOrReadTextDocumentWithFakeClientProperties(e){return this.readFile(e.uri)}async readFile(e){let r=await this.documentManagerService.getTextDocumentWithValidation({uri:e});if(r.status!=="notfound")return r;try{if(await this.getFileSizeMB(e)>1)return{status:"notfound",message:"File too large"};let o=await this.doReadFile(e),s=await this.instantiationService.invokeFunction(RVa.isDocumentValid,{uri:e});return s.status==="valid"?{status:"valid",document:xVa.CopilotTextDocument.create(e,"UNKNOWN",-1,o)}:s}catch{return{status:"notfound",message:"File not found"}}}async doReadFile(e){return await this.fileSystemService.readFileString(e)}async getFileSizeMB(e){return(await this.fileSystemService.stat(e)).size/1024/1024}};xD.FileReader=OTr;xD.FileReader=OTr=bVa([MTr(0,wVa.ICompletionsTextDocumentManagerService),MTr(1,TVa.IInstantiationService),MTr(2,IVa.ICompletionsFileSystemService)],OTr)});var C6=I(nyt=>{"use strict";p();Object.defineProperty(nyt,"__esModule",{value:!0});nyt.LRUCacheMap=void 0;var BTr=class{static{a(this,"LRUCacheMap")}constructor(e=10){if(this.valueMap=new Map,e<1)throw new Error("Size limit must be at least 1");this.sizeLimit=e}set(e,r){if(this.has(e))this.valueMap.delete(e);else if(this.valueMap.size>=this.sizeLimit){let n=this.valueMap.keys().next().value;this.delete(n)}return this.valueMap.set(e,r),this}get(e){if(this.valueMap.has(e)){let r=this.valueMap.get(e);return this.valueMap.delete(e),this.valueMap.set(e,r),r}}delete(e){return this.valueMap.delete(e)}clear(){this.valueMap.clear()}get size(){return this.valueMap.size}keys(){return new Map(this.valueMap).keys()}values(){return new Map(this.valueMap).values()}entries(){return new Map(this.valueMap).entries()}[Symbol.iterator](){return this.entries()}has(e){return this.valueMap.has(e)}forEach(e,r){new Map(this.valueMap).forEach(e,r)}get[Symbol.toStringTag](){return"LRUCacheMap"}peek(e){return this.valueMap.get(e)}};nyt.LRUCacheMap=BTr});var y4e=I(A4e=>{"use strict";p();Object.defineProperty(A4e,"__esModule",{value:!0});A4e.Deferred=void 0;A4e.delay=PVa;var FTr=class{static{a(this,"Deferred")}constructor(){this.resolve=()=>{},this.reject=()=>{},this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}};A4e.Deferred=FTr;function PVa(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(PVa,"delay")});var A2i=I(AAe=>{"use strict";p();Object.defineProperty(AAe,"__esModule",{value:!0});AAe.ReplaySubject=AAe.Subject=void 0;var iyt=class{static{a(this,"Subject")}constructor(){this.observers=new Set}subscribe(e){return this.observers.add(e),()=>this.observers.delete(e)}next(e){for(let r of this.observers)r.next(e)}error(e){for(let r of this.observers)r.error?.(e)}complete(){for(let e of this.observers)e.complete?.()}};AAe.Subject=iyt;var UTr=class extends iyt{static{a(this,"ReplaySubject")}subscribe(e){let r=super.subscribe(e);return this._value!==void 0&&e.next(this._value),r}next(e){this._value=e,super.next(e)}};AAe.ReplaySubject=UTr});var jTr=I(wD=>{"use strict";p();var DVa=wD&&wD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},y2i=wD&&wD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(wD,"__esModule",{value:!0});wD.AsyncCompletionManager=wD.ICompletionsAsyncManagerService=void 0;var NVa=nn(),MVa=fy(),OVa=C6(),E2i=Dl(),LVa=y4e(),BVa=A2i(),Fre;(function(t){t[t.Completed=0]="Completed",t[t.Error=1]="Error",t[t.Pending=2]="Pending"})(Fre||(Fre={}));wD.ICompletionsAsyncManagerService=(0,NVa.createServiceIdentifier)("ICompletionsAsyncManagerService");var qTr=class{static{a(this,"AsyncCompletionManager")}#e;constructor(e,r){this.featuresService=e,this.logTarget=r,this.#e=new E2i.Logger("AsyncCompletionManager"),this.requests=new OVa.LRUCacheMap(100),this.mostRecentRequestId=""}clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(QTr(e,r,o))return!0;return!1}updateCompletion(e,r){let n=this.requests.get(e);n!==void 0&&(n.partialCompletionText=r,n.subject.next(n))}queueCompletionRequest(e,r,n,o,s){this.#e.debug(this.logTarget,`[${e}] Queueing async completion request:`,r.substring(r.lastIndexOf(` -`)+1));let c=new BVa.ReplaySubject;return this.requests.set(e,{state:Fre.Pending,cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c}),s.then(l=>{if(this.requests.delete(e),l.type!=="success"){this.#e.debug(this.logTarget,`[${e}] Request failed with`,l.reason),c.error(l.reason);return}let u={cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c,choice:l.value[0],result:l,state:Fre.Completed,allChoicesPromise:l.value[1]};this.requests.set(e,u),c.next(u),c.complete()}).catch(l=>{this.#e.error(this.logTarget,`[${e}] Request errored with`,l),this.requests.delete(e),c.error(l)})}getFirstMatchingRequestWithTimeout(e,r,n,o,s){let c=this.featuresService.asyncCompletionsTimeout(s);return c<0?(this.#e.debug(this.logTarget,`[${e}] Waiting for completions without timeout`),this.getFirstMatchingRequest(e,r,n,o)):(this.#e.debug(this.logTarget,`[${e}] Waiting for completions with timeout of ${c}ms`),Promise.race([this.getFirstMatchingRequest(e,r,n,o),new Promise(l=>setTimeout(()=>l(null),c))]).then(l=>{if(l===null){this.#e.debug(this.logTarget,`[${e}] Timed out waiting for completion`);return}return l}))}async getFirstMatchingRequest(e,r,n,o){o||(this.mostRecentRequestId=e);let s=!1,c=new LVa.Deferred,l=new Map,u=a(f=>()=>{let h=l.get(f);h!==void 0&&(h(),l.delete(f),!s&&l.size===0&&(s=!0,this.#e.debug(this.logTarget,`[${e}] No matching completions found`),c.resolve(void 0)))},"finishRequest"),d=a(f=>{if(QTr(r,n,f)){if(f.state===Fre.Completed){let h=r.substring(f.prefix.length),{completionText:m}=f.choice;if(!m.startsWith(h)||m.length<=h.length){u(f.headerRequestId)();return}m=m.substring(h.length),f.choice.telemetryData.measurements.foundOffset=h.length,this.#e.debug(this.logTarget,`[${e}] Found completion at offset ${h.length}: ${JSON.stringify(m)}`),c.resolve([{...f.choice,completionText:m},f.allChoicesPromise]),s=!0}}else this.cancelRequest(e,f),u(f.headerRequestId)()},"next");for(let[f,h]of this.requests)QTr(r,n,h)?l.set(f,h.subject.subscribe({next:d,error:u(f),complete:u(f)})):this.cancelRequest(e,h);return c.promise.finally(()=>{for(let f of l.values())f()})}cancelRequest(e,r){e===this.mostRecentRequestId&&r.state!==Fre.Completed&&(this.#e.debug(this.logTarget,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};wD.AsyncCompletionManager=qTr;wD.AsyncCompletionManager=qTr=DVa([y2i(0,MVa.ICompletionsFeaturesService),y2i(1,E2i.ICompletionsLogTargetService)],qTr);function QTr(t,e,r){if(r.prompt.suffix!==e.suffix||!t.startsWith(r.prefix))return!1;let n=t.substring(r.prefix.length);return r.state===Fre.Completed?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(QTr,"isCandidate")});var _2i=I(oyt=>{"use strict";p();Object.defineProperty(oyt,"__esModule",{value:!0});oyt.LRURadixTrie=void 0;var HTr=class{static{a(this,"LRURadixTrie")}constructor(e){this.maxSize=e,this.root=new E4e,this.leafNodes=new Set}set(e,r){let{node:n,remainingKey:o}=this.findClosestNode(e);if(o.length>0){for(let[s,c]of n.children)if(s.startsWith(o)){let l=s.slice(0,o.length),u=new E4e;n.removeChild(s),n.addChild(l,u),u.addChild(s.slice(l.length),c),n=u,o=o.slice(l.length);break}if(o.length>0){let s=new E4e;n.addChild(o,s),n=s}}n.value=r,this.leafNodes.add(n),this.leafNodes.size>this.maxSize&&this.evictLeastRecentlyUsed()}findAll(e){return this.findClosestNode(e).stack.map(({node:r,remainingKey:n})=>r.value!==void 0?{remainingKey:n,value:r.value}:void 0).filter(r=>r!==void 0)}delete(e){let{node:r,remainingKey:n}=this.findClosestNode(e);n.length>0||this.deleteNode(r)}findClosestNode(e){let r=!0,n=this.root,o=[{node:n,remainingKey:e}];for(;e.length>0&&r;){r=!1;for(let[s,c]of n.children)if(e.startsWith(s)){e=e.slice(s.length),o.unshift({node:c,remainingKey:e}),n=c,r=!0;break}}return{node:n,remainingKey:e,stack:o}}deleteNode(e){if(e.value=void 0,this.leafNodes.delete(e),e.parent===void 0||e.childCount>1)return;let{node:r,edge:n}=e.parent;if(e.childCount===1){let[s,c]=Array.from(e.children)[0];e.removeChild(s),r.removeChild(n),r.addChild(n+s,c);return}if(r.removeChild(n),r.parent===void 0)return;let o=r.parent;if(r.value===void 0&&r.childCount===1){let[s,c]=Array.from(r.children)[0],l=o.edge+s;r.removeChild(s),o.node.removeChild(o.edge),o.node.addChild(l,c)}}evictLeastRecentlyUsed(){let e=this.findLeastRecentlyUsed();e&&this.deleteNode(e)}findLeastRecentlyUsed(){let e;for(let r of this.leafNodes)(e===void 0||r.touched{"use strict";p();Object.defineProperty(yAe,"__esModule",{value:!0});yAe.CompletionsCache=yAe.ICompletionsCacheService=void 0;var FVa=nn(),v2i=_2i();yAe.ICompletionsCacheService=(0,FVa.createServiceIdentifier)("ICompletionsCacheService");var GTr=class{static{a(this,"CompletionsCache")}constructor(){this.cache=new v2i.LRURadixTrie(100)}findAll(e,r){return this.cache.findAll(e).flatMap(({remainingKey:n,value:o})=>o.content.filter(s=>s.suffix===r&&s.choice.completionText.startsWith(n)&&s.choice.completionText.length>n.length).map(s=>({...s.choice,completionText:s.choice.completionText.slice(n.length),telemetryData:s.choice.telemetryData.extendedBy({},{foundOffset:n.length})})))}append(e,r,n){let o=this.cache.findAll(e);if(o.length>0&&o[0].remainingKey===""){let s=o[0].value.content;this.cache.set(e,{content:[...s,{suffix:r,choice:n}]})}else this.cache.set(e,{content:[{suffix:r,choice:n}]})}clear(){this.cache=new v2i.LRURadixTrie(100)}};yAe.CompletionsCache=GTr});var C2i=I(EAe=>{"use strict";p();Object.defineProperty(EAe,"__esModule",{value:!0});EAe.BlockMode=void 0;EAe.shouldDoParsingTrimming=UVa;EAe.shouldDoServerTrimming=QVa;var Ure;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(Ure||(EAe.BlockMode=Ure={}));function UVa(t){return[Ure.Parsing,Ure.ParsingAndServer,Ure.MoreMultiline].includes(t)}a(UVa,"shouldDoParsingTrimming");function QVa(t){return[Ure.Server,Ure.ParsingAndServer].includes(t)}a(QVa,"shouldDoServerTrimming")});var Qre=I(tI=>{"use strict";p();var qVa=tI&&tI.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(tI,"__esModule",{value:!0});tI.WASMLanguage=void 0;tI.isSupportedLanguageId=HVa;tI.languageIdToWasmLanguage=YTr;tI.getLanguage=S2i;tI.parseTreeSitter=$Va;tI.parseTreeSitterIncludingVersion=T2i;tI.getBlockCloseToken=VVa;tI.queryPythonIsDocstring=YVa;var VTr=qVa(ale()),jVa=uTr(),b2i=dTr(),Ed;(function(t){t.Python="python",t.JavaScript="javascript",t.TypeScript="typescript",t.TSX="tsx",t.Go="go",t.Ruby="ruby",t.CSharp="c-sharp",t.Java="java",t.Php="php",t.Cpp="cpp"})(Ed||(tI.WASMLanguage=Ed={}));var WTr={python:Ed.Python,javascript:Ed.JavaScript,javascriptreact:Ed.JavaScript,jsx:Ed.JavaScript,typescript:Ed.TypeScript,typescriptreact:Ed.TSX,go:Ed.Go,ruby:Ed.Ruby,csharp:Ed.CSharp,java:Ed.Java,php:Ed.Php,c:Ed.Cpp,cpp:Ed.Cpp};function HVa(t){return t in WTr&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(HVa,"isSupportedLanguageId");function YTr(t){if(!(t in WTr))throw new Error(`Unrecognized language: ${t}`);return WTr[t]}a(YTr,"languageIdToWasmLanguage");var $Tr=new Map;async function GVa(t){let e;try{e=await(0,b2i.readFile)(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new jVa.CopilotPromptLoadFailure(`Could not load tree-sitter-${t}.wasm`,r):r}return VTr.default.Language.load(e)}a(GVa,"loadWasmLanguage");function S2i(t){let e=YTr(t);if(!$Tr.has(e)){let r=GVa(e);$Tr.set(e,r)}return $Tr.get(e)}a(S2i,"getLanguage");var zTr=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function $Va(t,e){return(await T2i(t,e))[0]}a($Va,"parseTreeSitter");async function T2i(t,e){await VTr.default.init({locateFile:a(s=>(0,b2i.locateFile)(s),"locateFile")});let r;try{r=new VTr.default}catch(s){throw s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&s.message.includes("table index is out of bounds")?new zTr(`Could not init Parse for language <${t}>`,s):s}let n=await S2i(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(T2i,"parseTreeSitterIncludingVersion");function VVa(t){switch(YTr(t)){case Ed.Python:return null;case Ed.JavaScript:case Ed.TypeScript:case Ed.TSX:case Ed.Go:case Ed.CSharp:case Ed.Java:case Ed.Php:case Ed.Cpp:return"}";case Ed.Ruby:return"end"}}a(VVa,"getBlockCloseToken");function WVa(t,e){let r=[];for(let n of t){if(!n[1]){let o=e.tree.getLanguage();n[1]=o.query(n[0])}r.push(...n[1].matches(e))}return r}a(WVa,"innerQuery");var zVa=[`[ +**Note:** Some files were excluded from the context due to content exclusion rules. Click [here](https://docs.github.com/en/copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot) to learn more.`);Lv.IIgnoreService=(0,Fza.createServiceIdentifier)("IIgnoreService");var bIr=class t{static{a(this,"NullIgnoreService")}static{this.Instance=new t}dispose(){}get isEnabled(){return!1}get isRegexExclusionsEnabled(){return!1}async init(){}async isCopilotIgnored(e){return!1}async asMinimatchPattern(){}};Lv.NullIgnoreService=bIr;async function Uza(t,e){let r=[];for(let n of e)await t.isCopilotIgnored(n)||r.push(n);return r}a(Uza,"filterIngoredResources")});var TIr=I(SIr=>{"use strict";p();Object.defineProperty(SIr,"__esModule",{value:!0});SIr.isDocumentValid=jza;var Qza=Vre(),qza=ad();async function jza(t,e){return await t.get(Qza.IIgnoreService).isCopilotIgnored(qza.URI.parse(e.uri))?{status:"invalid",reason:"Document is blocked by repository policy"}:{status:"valid"}}a(jza,"isDocumentValid")});var l1=I(MD=>{"use strict";p();var Hza=MD&&MD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},aNi=MD&&MD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(MD,"__esModule",{value:!0});MD.TextDocumentManager=MD.ICompletionsTextDocumentManagerService=void 0;var Gza=nn(),$za=$s(),Vza=g$(),cNi=TIr(),DAe=y$();MD.ICompletionsTextDocumentManagerService=(0,Gza.createServiceIdentifier)("ICompletionsTextDocumentManagerService");var IIr=class{static{a(this,"TextDocumentManager")}constructor(e,r){this.instantiationService=e,this.fileSystem=r}async textDocuments(){let e=this.getTextDocumentsUnsafe(),r=[];for(let n of e)(await this.instantiationService.invokeFunction(cNi.isDocumentValid,n)).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=(0,DAe.normalizeUri)(e.uri);return this.getTextDocumentsUnsafe().find(n=>n.uri===r)}async getTextDocument(e){return this.getTextDocumentWithValidation(e).then(r=>{if(r.status==="valid")return r.document})}async validateTextDocument(e){return await this.instantiationService.invokeFunction(cNi.isDocumentValid,e)}async getTextDocumentValidation(e){try{return await this.validateTextDocument(e)}catch{return this.notFoundResult(e)}}async getTextDocumentWithValidation(e){let r=this.getTextDocumentUnsafe(e);if(!r)return this.notFoundResult(e);let n=await this.validateTextDocument(e);return n.status==="valid"?{status:"valid",document:r}:n}notFoundResult({uri:e}){return{status:"notfound",message:`Document for URI could not be found: ${e}`}}async readTextDocumentFromDisk(e){try{if((await this.fileSystem.stat(e)).size>5*1024*1024)return}catch{return}return await this.fileSystem.readFileString(e)}getWorkspaceFolder(e){let r=(0,DAe.normalizeUri)(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith((0,DAe.normalizeUri)(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=(0,DAe.normalizeUri)(e.uri);for(let n of this.getWorkspaceFolders()){let o=(0,DAe.normalizeUri)(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return(0,DAe.basename)(r)}};MD.TextDocumentManager=IIr;MD.TextDocumentManager=IIr=Hza([aNi(0,$za.IInstantiationService),aNi(1,Vza.ICompletionsFileSystemService)],IIr)});var RIr=I(OD=>{"use strict";p();var Wza=OD&&OD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},xIr=OD&&OD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(OD,"__esModule",{value:!0});OD.FileReader=OD.ICompletionsFileReaderService=void 0;var zza=nn(),Yza=$s(),Kza=g$(),Jza=PAe(),Zza=l1(),Xza=TIr(),eYa=y$();OD.ICompletionsFileReaderService=(0,zza.createServiceIdentifier)("ICompletionsFileReaderService");var wIr=class{static{a(this,"FileReader")}constructor(e,r,n){this.documentManagerService=e,this.instantiationService=r,this.fileSystemService=n}getRelativePath(e){return this.documentManagerService.getRelativePath(e)??(0,eYa.basename)(e.uri)}getOrReadTextDocument(e){return this.readFile(e.uri)}getOrReadTextDocumentWithFakeClientProperties(e){return this.readFile(e.uri)}async readFile(e){let r=await this.documentManagerService.getTextDocumentWithValidation({uri:e});if(r.status!=="notfound")return r;try{if(await this.getFileSizeMB(e)>1)return{status:"notfound",message:"File too large"};let o=await this.doReadFile(e),s=await this.instantiationService.invokeFunction(Xza.isDocumentValid,{uri:e});return s.status==="valid"?{status:"valid",document:Jza.CopilotTextDocument.create(e,"UNKNOWN",-1,o)}:s}catch{return{status:"notfound",message:"File not found"}}}async doReadFile(e){return await this.fileSystemService.readFileString(e)}async getFileSizeMB(e){return(await this.fileSystemService.stat(e)).size/1024/1024}};OD.FileReader=wIr;OD.FileReader=wIr=Wza([xIr(0,Zza.ICompletionsTextDocumentManagerService),xIr(1,Yza.IInstantiationService),xIr(2,Kza.ICompletionsFileSystemService)],wIr)});var M6=I(Ryt=>{"use strict";p();Object.defineProperty(Ryt,"__esModule",{value:!0});Ryt.LRUCacheMap=void 0;var kIr=class{static{a(this,"LRUCacheMap")}constructor(e=10){if(this.valueMap=new Map,e<1)throw new Error("Size limit must be at least 1");this.sizeLimit=e}set(e,r){if(this.has(e))this.valueMap.delete(e);else if(this.valueMap.size>=this.sizeLimit){let n=this.valueMap.keys().next().value;this.delete(n)}return this.valueMap.set(e,r),this}get(e){if(this.valueMap.has(e)){let r=this.valueMap.get(e);return this.valueMap.delete(e),this.valueMap.set(e,r),r}}delete(e){return this.valueMap.delete(e)}clear(){this.valueMap.clear()}get size(){return this.valueMap.size}keys(){return new Map(this.valueMap).keys()}values(){return new Map(this.valueMap).values()}entries(){return new Map(this.valueMap).entries()}[Symbol.iterator](){return this.entries()}has(e){return this.valueMap.has(e)}forEach(e,r){new Map(this.valueMap).forEach(e,r)}get[Symbol.toStringTag](){return"LRUCacheMap"}peek(e){return this.valueMap.get(e)}};Ryt.LRUCacheMap=kIr});var q4e=I(Q4e=>{"use strict";p();Object.defineProperty(Q4e,"__esModule",{value:!0});Q4e.Deferred=void 0;Q4e.delay=tYa;var PIr=class{static{a(this,"Deferred")}constructor(){this.resolve=()=>{},this.reject=()=>{},this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}};Q4e.Deferred=PIr;function tYa(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(tYa,"delay")});var lNi=I(NAe=>{"use strict";p();Object.defineProperty(NAe,"__esModule",{value:!0});NAe.ReplaySubject=NAe.Subject=void 0;var kyt=class{static{a(this,"Subject")}constructor(){this.observers=new Set}subscribe(e){return this.observers.add(e),()=>this.observers.delete(e)}next(e){for(let r of this.observers)r.next(e)}error(e){for(let r of this.observers)r.error?.(e)}complete(){for(let e of this.observers)e.complete?.()}};NAe.Subject=kyt;var DIr=class extends kyt{static{a(this,"ReplaySubject")}subscribe(e){let r=super.subscribe(e);return this._value!==void 0&&e.next(this._value),r}next(e){this._value=e,super.next(e)}};NAe.ReplaySubject=DIr});var OIr=I(LD=>{"use strict";p();var rYa=LD&&LD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},uNi=LD&&LD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(LD,"__esModule",{value:!0});LD.AsyncCompletionManager=LD.ICompletionsAsyncManagerService=void 0;var nYa=nn(),iYa=gy(),oYa=M6(),dNi=Dl(),sYa=q4e(),aYa=lNi(),Wre;(function(t){t[t.Completed=0]="Completed",t[t.Error=1]="Error",t[t.Pending=2]="Pending"})(Wre||(Wre={}));LD.ICompletionsAsyncManagerService=(0,nYa.createServiceIdentifier)("ICompletionsAsyncManagerService");var MIr=class{static{a(this,"AsyncCompletionManager")}#e;constructor(e,r){this.featuresService=e,this.logTarget=r,this.#e=new dNi.Logger("AsyncCompletionManager"),this.requests=new oYa.LRUCacheMap(100),this.mostRecentRequestId=""}clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(NIr(e,r,o))return!0;return!1}updateCompletion(e,r){let n=this.requests.get(e);n!==void 0&&(n.partialCompletionText=r,n.subject.next(n))}queueCompletionRequest(e,r,n,o,s){this.#e.debug(this.logTarget,`[${e}] Queueing async completion request:`,r.substring(r.lastIndexOf(` +`)+1));let c=new aYa.ReplaySubject;return this.requests.set(e,{state:Wre.Pending,cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c}),s.then(l=>{if(this.requests.delete(e),l.type!=="success"){this.#e.debug(this.logTarget,`[${e}] Request failed with`,l.reason),c.error(l.reason);return}let u={cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c,choice:l.value[0],result:l,state:Wre.Completed,allChoicesPromise:l.value[1]};this.requests.set(e,u),c.next(u),c.complete()}).catch(l=>{this.#e.error(this.logTarget,`[${e}] Request errored with`,l),this.requests.delete(e),c.error(l)})}getFirstMatchingRequestWithTimeout(e,r,n,o,s){let c=this.featuresService.asyncCompletionsTimeout(s);return c<0?(this.#e.debug(this.logTarget,`[${e}] Waiting for completions without timeout`),this.getFirstMatchingRequest(e,r,n,o)):(this.#e.debug(this.logTarget,`[${e}] Waiting for completions with timeout of ${c}ms`),Promise.race([this.getFirstMatchingRequest(e,r,n,o),new Promise(l=>setTimeout(()=>l(null),c))]).then(l=>{if(l===null){this.#e.debug(this.logTarget,`[${e}] Timed out waiting for completion`);return}return l}))}async getFirstMatchingRequest(e,r,n,o){o||(this.mostRecentRequestId=e);let s=!1,c=new sYa.Deferred,l=new Map,u=a(f=>()=>{let h=l.get(f);h!==void 0&&(h(),l.delete(f),!s&&l.size===0&&(s=!0,this.#e.debug(this.logTarget,`[${e}] No matching completions found`),c.resolve(void 0)))},"finishRequest"),d=a(f=>{if(NIr(r,n,f)){if(f.state===Wre.Completed){let h=r.substring(f.prefix.length),{completionText:m}=f.choice;if(!m.startsWith(h)||m.length<=h.length){u(f.headerRequestId)();return}m=m.substring(h.length),f.choice.telemetryData.measurements.foundOffset=h.length,this.#e.debug(this.logTarget,`[${e}] Found completion at offset ${h.length}: ${JSON.stringify(m)}`),c.resolve([{...f.choice,completionText:m},f.allChoicesPromise]),s=!0}}else this.cancelRequest(e,f),u(f.headerRequestId)()},"next");for(let[f,h]of this.requests)NIr(r,n,h)?l.set(f,h.subject.subscribe({next:d,error:u(f),complete:u(f)})):this.cancelRequest(e,h);return c.promise.finally(()=>{for(let f of l.values())f()})}cancelRequest(e,r){e===this.mostRecentRequestId&&r.state!==Wre.Completed&&(this.#e.debug(this.logTarget,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};LD.AsyncCompletionManager=MIr;LD.AsyncCompletionManager=MIr=rYa([uNi(0,iYa.ICompletionsFeaturesService),uNi(1,dNi.ICompletionsLogTargetService)],MIr);function NIr(t,e,r){if(r.prompt.suffix!==e.suffix||!t.startsWith(r.prefix))return!1;let n=t.substring(r.prefix.length);return r.state===Wre.Completed?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(NIr,"isCandidate")});var fNi=I(Pyt=>{"use strict";p();Object.defineProperty(Pyt,"__esModule",{value:!0});Pyt.LRURadixTrie=void 0;var LIr=class{static{a(this,"LRURadixTrie")}constructor(e){this.maxSize=e,this.root=new j4e,this.leafNodes=new Set}set(e,r){let{node:n,remainingKey:o}=this.findClosestNode(e);if(o.length>0){for(let[s,c]of n.children)if(s.startsWith(o)){let l=s.slice(0,o.length),u=new j4e;n.removeChild(s),n.addChild(l,u),u.addChild(s.slice(l.length),c),n=u,o=o.slice(l.length);break}if(o.length>0){let s=new j4e;n.addChild(o,s),n=s}}n.value=r,this.leafNodes.add(n),this.leafNodes.size>this.maxSize&&this.evictLeastRecentlyUsed()}findAll(e){return this.findClosestNode(e).stack.map(({node:r,remainingKey:n})=>r.value!==void 0?{remainingKey:n,value:r.value}:void 0).filter(r=>r!==void 0)}delete(e){let{node:r,remainingKey:n}=this.findClosestNode(e);n.length>0||this.deleteNode(r)}findClosestNode(e){let r=!0,n=this.root,o=[{node:n,remainingKey:e}];for(;e.length>0&&r;){r=!1;for(let[s,c]of n.children)if(e.startsWith(s)){e=e.slice(s.length),o.unshift({node:c,remainingKey:e}),n=c,r=!0;break}}return{node:n,remainingKey:e,stack:o}}deleteNode(e){if(e.value=void 0,this.leafNodes.delete(e),e.parent===void 0||e.childCount>1)return;let{node:r,edge:n}=e.parent;if(e.childCount===1){let[s,c]=Array.from(e.children)[0];e.removeChild(s),r.removeChild(n),r.addChild(n+s,c);return}if(r.removeChild(n),r.parent===void 0)return;let o=r.parent;if(r.value===void 0&&r.childCount===1){let[s,c]=Array.from(r.children)[0],l=o.edge+s;r.removeChild(s),o.node.removeChild(o.edge),o.node.addChild(l,c)}}evictLeastRecentlyUsed(){let e=this.findLeastRecentlyUsed();e&&this.deleteNode(e)}findLeastRecentlyUsed(){let e;for(let r of this.leafNodes)(e===void 0||r.touched{"use strict";p();Object.defineProperty(MAe,"__esModule",{value:!0});MAe.CompletionsCache=MAe.ICompletionsCacheService=void 0;var cYa=nn(),pNi=fNi();MAe.ICompletionsCacheService=(0,cYa.createServiceIdentifier)("ICompletionsCacheService");var BIr=class{static{a(this,"CompletionsCache")}constructor(){this.cache=new pNi.LRURadixTrie(100)}findAll(e,r){return this.cache.findAll(e).flatMap(({remainingKey:n,value:o})=>o.content.filter(s=>s.suffix===r&&s.choice.completionText.startsWith(n)&&s.choice.completionText.length>n.length).map(s=>({...s.choice,completionText:s.choice.completionText.slice(n.length),telemetryData:s.choice.telemetryData.extendedBy({},{foundOffset:n.length})})))}append(e,r,n){let o=this.cache.findAll(e);if(o.length>0&&o[0].remainingKey===""){let s=o[0].value.content;this.cache.set(e,{content:[...s,{suffix:r,choice:n}]})}else this.cache.set(e,{content:[{suffix:r,choice:n}]})}clear(){this.cache=new pNi.LRURadixTrie(100)}};MAe.CompletionsCache=BIr});var hNi=I(OAe=>{"use strict";p();Object.defineProperty(OAe,"__esModule",{value:!0});OAe.BlockMode=void 0;OAe.shouldDoParsingTrimming=lYa;OAe.shouldDoServerTrimming=uYa;var zre;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(zre||(OAe.BlockMode=zre={}));function lYa(t){return[zre.Parsing,zre.ParsingAndServer,zre.MoreMultiline].includes(t)}a(lYa,"shouldDoParsingTrimming");function uYa(t){return[zre.Server,zre.ParsingAndServer].includes(t)}a(uYa,"shouldDoServerTrimming")});var Yre=I(aI=>{"use strict";p();var dYa=aI&&aI.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(aI,"__esModule",{value:!0});aI.WASMLanguage=void 0;aI.isSupportedLanguageId=pYa;aI.languageIdToWasmLanguage=jIr;aI.getLanguage=gNi;aI.parseTreeSitter=mYa;aI.parseTreeSitterIncludingVersion=ANi;aI.getBlockCloseToken=gYa;aI.queryPythonIsDocstring=EYa;var UIr=dYa(mle()),fYa=nIr(),mNi=iIr(),Sd;(function(t){t.Python="python",t.JavaScript="javascript",t.TypeScript="typescript",t.TSX="tsx",t.Go="go",t.Ruby="ruby",t.CSharp="c-sharp",t.Java="java",t.Php="php",t.Cpp="cpp"})(Sd||(aI.WASMLanguage=Sd={}));var QIr={python:Sd.Python,javascript:Sd.JavaScript,javascriptreact:Sd.JavaScript,jsx:Sd.JavaScript,typescript:Sd.TypeScript,typescriptreact:Sd.TSX,go:Sd.Go,ruby:Sd.Ruby,csharp:Sd.CSharp,java:Sd.Java,php:Sd.Php,c:Sd.Cpp,cpp:Sd.Cpp};function pYa(t){return t in QIr&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(pYa,"isSupportedLanguageId");function jIr(t){if(!(t in QIr))throw new Error(`Unrecognized language: ${t}`);return QIr[t]}a(jIr,"languageIdToWasmLanguage");var FIr=new Map;async function hYa(t){let e;try{e=await(0,mNi.readFile)(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new fYa.CopilotPromptLoadFailure(`Could not load tree-sitter-${t}.wasm`,r):r}return UIr.default.Language.load(e)}a(hYa,"loadWasmLanguage");function gNi(t){let e=jIr(t);if(!FIr.has(e)){let r=hYa(e);FIr.set(e,r)}return FIr.get(e)}a(gNi,"getLanguage");var qIr=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function mYa(t,e){return(await ANi(t,e))[0]}a(mYa,"parseTreeSitter");async function ANi(t,e){await UIr.default.init({locateFile:a(s=>(0,mNi.locateFile)(s),"locateFile")});let r;try{r=new UIr.default}catch(s){throw s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&s.message.includes("table index is out of bounds")?new qIr(`Could not init Parse for language <${t}>`,s):s}let n=await gNi(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(ANi,"parseTreeSitterIncludingVersion");function gYa(t){switch(jIr(t)){case Sd.Python:return null;case Sd.JavaScript:case Sd.TypeScript:case Sd.TSX:case Sd.Go:case Sd.CSharp:case Sd.Java:case Sd.Php:case Sd.Cpp:return"}";case Sd.Ruby:return"end"}}a(gYa,"getBlockCloseToken");function AYa(t,e){let r=[];for(let n of t){if(!n[1]){let o=e.tree.getLanguage();n[1]=o.query(n[0])}r.push(...n[1].matches(e))}return r}a(AYa,"innerQuery");var yYa=[`[ (class_definition (block (expression_statement (string)))) (function_definition (block (expression_statement (string)))) -]`];function YVa(t){return WVa([zVa],t).length===1}a(YVa,"queryPythonIsDocstring")});var nIr=I(bAe=>{"use strict";p();Object.defineProperty(bAe,"__esModule",{value:!0});bAe.StatementTree=bAe.StatementNode=void 0;var KVa=Qre(),RD=class{static{a(this,"StatementNode")}constructor(e){this.node=e,this.children=[],this.collapsed=!1}addChild(e){e.parent=this,e.nextSibling=void 0,this.children.length>0&&(this.children[this.children.length-1].nextSibling=e),this.children.push(e)}childrenFinished(){}containsStatement(e){return this.node.startIndex<=e.node.startIndex&&this.node.endIndex>=e.node.endIndex}statementAt(e){if(this.node.startIndex>e||this.node.endIndex(r=n.statementAt(e),r!==void 0)),r??this}collapse(){this.children.length=0,this.collapsed=!0}get description(){return`${this.node.type} ([${this.node.startPosition.row},${this.node.startPosition.column}]..[${this.node.endPosition.row},${this.node.endPosition.column}]): ${JSON.stringify(this.node.text.length>33?this.node.text.substring(0,15)+"..."+this.node.text.slice(-15):this.node.text)}`}dump(e="",r=""){let n=[`${e}${this.description}`];return this.children.forEach(o=>{n.push(o.dump(`${r}+- `,o.nextSibling===void 0?`${r} `:`${r}| `))}),n.join(` +]`];function EYa(t){return AYa([yYa],t).length===1}a(EYa,"queryPythonIsDocstring")});var KIr=I(UAe=>{"use strict";p();Object.defineProperty(UAe,"__esModule",{value:!0});UAe.StatementTree=UAe.StatementNode=void 0;var _Ya=Yre(),BD=class{static{a(this,"StatementNode")}constructor(e){this.node=e,this.children=[],this.collapsed=!1}addChild(e){e.parent=this,e.nextSibling=void 0,this.children.length>0&&(this.children[this.children.length-1].nextSibling=e),this.children.push(e)}childrenFinished(){}containsStatement(e){return this.node.startIndex<=e.node.startIndex&&this.node.endIndex>=e.node.endIndex}statementAt(e){if(this.node.startIndex>e||this.node.endIndex(r=n.statementAt(e),r!==void 0)),r??this}collapse(){this.children.length=0,this.collapsed=!0}get description(){return`${this.node.type} ([${this.node.startPosition.row},${this.node.startPosition.column}]..[${this.node.endPosition.row},${this.node.endPosition.column}]): ${JSON.stringify(this.node.text.length>33?this.node.text.substring(0,15)+"..."+this.node.text.slice(-15):this.node.text)}`}dump(e="",r=""){let n=[`${e}${this.description}`];return this.children.forEach(o=>{n.push(o.dump(`${r}+- `,o.nextSibling===void 0?`${r} `:`${r}| `))}),n.join(` `)}dumpPath(e="",r="",n=!1){if(this.parent){let o=this.parent.dumpPath(e,r,!0),s=o.length-o.lastIndexOf(` `)-1-r.length,c=" ".repeat(s),l=n?` ${r}${c}+- `:"";return o+this.description+l}else{let o=n?` -${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{static{a(this,"StatementTree")}static isSupported(e){return _Ae.languageIds.has(e)||vAe.languageIds.has(e)||v4e.languageIds.has(e)||CAe.languageIds.has(e)||C4e.languageIds.has(e)||b4e.languageIds.has(e)||S4e.languageIds.has(e)||T4e.languageIds.has(e)||I4e.languageIds.has(e)}static isTrimmedByDefault(e){return _Ae.languageIds.has(e)||vAe.languageIds.has(e)||CAe.languageIds.has(e)}static create(e,r,n,o){if(_Ae.languageIds.has(e))return new _Ae(e,r,n,o);if(vAe.languageIds.has(e))return new vAe(e,r,n,o);if(v4e.languageIds.has(e))return new v4e(e,r,n,o);if(CAe.languageIds.has(e))return new CAe(e,r,n,o);if(S4e.languageIds.has(e))return new S4e(e,r,n,o);if(C4e.languageIds.has(e))return new C4e(e,r,n,o);if(b4e.languageIds.has(e))return new b4e(e,r,n,o);if(T4e.languageIds.has(e))return new T4e(e,r,n,o);if(I4e.languageIds.has(e))return new I4e(e,r,n,o);throw new Error(`Unsupported languageId: ${e}`)}constructor(e,r,n,o){this.languageId=e,this.text=r,this.startOffset=n,this.endOffset=o,this.statements=[]}[Symbol.dispose](){this.tree&&(this.tree.delete(),this.tree=void 0)}clear(){this.statements.length=0}statementAt(e){let r;return this.statements.find(n=>(r=n.statementAt(e),r!==void 0)),r}async build(){let e=[];this.clear();let r=await this.parse();this.getStatementQuery(r).captures(r.rootNode,{startPosition:this.offsetToPosition(this.startOffset),endPosition:this.offsetToPosition(this.endOffset)}).forEach(o=>{let s=this.createNode(o.node);for(;e.length>0&&!e[0].containsStatement(s);)e.shift()?.childrenFinished();e.length>0?e[0].addChild(s):this.addStatement(s),e.unshift(s)}),e.forEach(o=>o.childrenFinished())}addStatement(e){e.parent=void 0,e.nextSibling=void 0,this.statements.length>0&&(this.statements[this.statements.length-1].nextSibling=e),this.statements.push(e)}async parse(){return this.tree||(this.tree=await(0,KVa.parseTreeSitter)(this.languageId,this.text)),this.tree}getStatementQuery(e){return this.getQuery(e.getLanguage(),this.getStatementQueryText())}getQuery(e,r){return e.query(r)}offsetToPosition(e){let r=this.text.slice(0,e).split(` +${r}+- `:"";return e+this.description+o}}};UAe.StatementNode=BD;var $R=class{static{a(this,"StatementTree")}static isSupported(e){return LAe.languageIds.has(e)||BAe.languageIds.has(e)||G4e.languageIds.has(e)||FAe.languageIds.has(e)||$4e.languageIds.has(e)||V4e.languageIds.has(e)||W4e.languageIds.has(e)||z4e.languageIds.has(e)||Y4e.languageIds.has(e)}static isTrimmedByDefault(e){return LAe.languageIds.has(e)||BAe.languageIds.has(e)||FAe.languageIds.has(e)}static create(e,r,n,o){if(LAe.languageIds.has(e))return new LAe(e,r,n,o);if(BAe.languageIds.has(e))return new BAe(e,r,n,o);if(G4e.languageIds.has(e))return new G4e(e,r,n,o);if(FAe.languageIds.has(e))return new FAe(e,r,n,o);if(W4e.languageIds.has(e))return new W4e(e,r,n,o);if($4e.languageIds.has(e))return new $4e(e,r,n,o);if(V4e.languageIds.has(e))return new V4e(e,r,n,o);if(z4e.languageIds.has(e))return new z4e(e,r,n,o);if(Y4e.languageIds.has(e))return new Y4e(e,r,n,o);throw new Error(`Unsupported languageId: ${e}`)}constructor(e,r,n,o){this.languageId=e,this.text=r,this.startOffset=n,this.endOffset=o,this.statements=[]}[Symbol.dispose](){this.tree&&(this.tree.delete(),this.tree=void 0)}clear(){this.statements.length=0}statementAt(e){let r;return this.statements.find(n=>(r=n.statementAt(e),r!==void 0)),r}async build(){let e=[];this.clear();let r=await this.parse();this.getStatementQuery(r).captures(r.rootNode,{startPosition:this.offsetToPosition(this.startOffset),endPosition:this.offsetToPosition(this.endOffset)}).forEach(o=>{let s=this.createNode(o.node);for(;e.length>0&&!e[0].containsStatement(s);)e.shift()?.childrenFinished();e.length>0?e[0].addChild(s):this.addStatement(s),e.unshift(s)}),e.forEach(o=>o.childrenFinished())}addStatement(e){e.parent=void 0,e.nextSibling=void 0,this.statements.length>0&&(this.statements[this.statements.length-1].nextSibling=e),this.statements.push(e)}async parse(){return this.tree||(this.tree=await(0,_Ya.parseTreeSitter)(this.languageId,this.text)),this.tree}getStatementQuery(e){return this.getQuery(e.getLanguage(),this.getStatementQueryText())}getQuery(e,r){return e.query(r)}offsetToPosition(e){let r=this.text.slice(0,e).split(` `),n=r.length-1,o=r[r.length-1].length;return{row:n,column:o}}dump(e=""){let r=[];return this.statements.forEach((n,o)=>{let s=`[${o}]`,c=" ".repeat(s.length);r.push(n.dump(`${e} ${s} `,`${e} ${c} `))}),r.join(` -`)}};bAe.StatementTree=LR;var syt=class t extends RD{static{a(this,"JSStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","generator_function_declaration","class_declaration","statement_block","if_statement","switch_statement","for_statement","for_in_statement","while_statement","do_statement","try_statement","with_statement","labeled_statement","method_definition","interface_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="statement_block"||this.children.length===2&&this.node.childForFieldName("alternative")!==null&&this.children[0].node.type!=="statement_block"&&this.children[1].node.type!=="statement_block"}},_Ae=class extends LR{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new syt(e)}getStatementQueryText(){return`[ +`)}};UAe.StatementTree=$R;var Dyt=class t extends BD{static{a(this,"JSStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","generator_function_declaration","class_declaration","statement_block","if_statement","switch_statement","for_statement","for_in_statement","while_statement","do_statement","try_statement","with_statement","labeled_statement","method_definition","interface_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="statement_block"||this.children.length===2&&this.node.childForFieldName("alternative")!==null&&this.children[0].node.type!=="statement_block"&&this.children[1].node.type!=="statement_block"}},LAe=class extends $R{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new Dyt(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -827,7 +827,7 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (labeled_statement) (method_definition) (field_definition) - ] @statement`}},vAe=class extends LR{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new syt(e)}getStatementQueryText(){return`[ + ] @statement`}},BAe=class extends $R{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new Dyt(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -850,7 +850,7 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (labeled_statement) (method_definition) (public_field_definition) - ] @statement`}},KTr=class t extends RD{static{a(this,"PyStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","for_statement","while_statement","try_statement","with_statement","function_definition","class_definition","decorated_definition","match_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"?!1:this.node.startPosition.row===this.node.endPosition.row}},v4e=class extends LR{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new KTr(e)}getStatementQueryText(){return`[ + ] @statement`}},HIr=class t extends BD{static{a(this,"PyStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","for_statement","while_statement","try_statement","with_statement","function_definition","class_definition","decorated_definition","match_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"?!1:this.node.startPosition.row===this.node.endPosition.row}},G4e=class extends $R{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new HIr(e)}getStatementQueryText(){return`[ (future_import_statement) (import_statement) (import_from_statement) @@ -876,24 +876,24 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (decorated_definition) (match_statement) (block) - ] @statement`}},JTr=class t extends RD{static{a(this,"GoStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","method_declaration","if_statement","for_statement","expression_switch_statement","type_switch_statement","select_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},CAe=class extends LR{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new JTr(e)}getStatementQueryText(){return`[ + ] @statement`}},GIr=class t extends BD{static{a(this,"GoStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","method_declaration","if_statement","for_statement","expression_switch_statement","type_switch_statement","select_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},FAe=class extends $R{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new GIr(e)}getStatementQueryText(){return`[ (package_clause) (function_declaration) (method_declaration) (import_declaration) (_statement) (block) - ] @statement`}},ZTr=class t extends RD{static{a(this,"PhpStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","else_clause","else_if_clause","for_statement","foreach_statement","while_statement","do_statement","switch_statement","try_statement","catch_clause","finally_clause","anonymous_function","compound_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},C4e=class extends LR{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new ZTr(e)}getStatementQueryText(){return`[ + ] @statement`}},$Ir=class t extends BD{static{a(this,"PhpStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","else_clause","else_if_clause","for_statement","foreach_statement","while_statement","do_statement","switch_statement","try_statement","catch_clause","finally_clause","anonymous_function","compound_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},$4e=class extends $R{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new $Ir(e)}getStatementQueryText(){return`[ (statement) (compound_statement) (method_declaration) (property_declaration) (const_declaration) (use_declaration) - ] @statement`}},XTr=class t extends RD{static{a(this,"RubyStatementNode")}static{this.compoundTypeNames=new Set(["if","case","while","until","for","begin","module","class","method"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},b4e=class extends LR{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new XTr(e)}getStatementQueryText(){return`[ + ] @statement`}},VIr=class t extends BD{static{a(this,"RubyStatementNode")}static{this.compoundTypeNames=new Set(["if","case","while","until","for","begin","module","class","method"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},V4e=class extends $R{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new VIr(e)}getStatementQueryText(){return`[ (_statement) (when) - ] @statement`}},eIr=class t extends RD{static{a(this,"JavaStatementNode")}static{this.compoundTypeNames=new Set(["block","do_statement","enhanced_for_statement","for_statement","if_statement","labeled_statement","switch_expression","synchronized_statement","try_statement","try_with_resources_statement","while_statement","interface_declaration","method_declaration","constructor_declaration","compact_constructor_declaration","class_declaration","annotation_type_declaration","static_initializer"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},S4e=class extends LR{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new eIr(e)}getStatementQueryText(){return`[ + ] @statement`}},WIr=class t extends BD{static{a(this,"JavaStatementNode")}static{this.compoundTypeNames=new Set(["block","do_statement","enhanced_for_statement","for_statement","if_statement","labeled_statement","switch_expression","synchronized_statement","try_statement","try_with_resources_statement","while_statement","interface_declaration","method_declaration","constructor_declaration","compact_constructor_declaration","class_declaration","annotation_type_declaration","static_initializer"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},W4e=class extends $R{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new WIr(e)}getStatementQueryText(){return`[ (statement) (field_declaration) (record_declaration) @@ -906,7 +906,7 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (block) (static_initializer) (constructor_declaration) - ] @statement`}},tIr=class t extends RD{static{a(this,"CSharpStatementNode")}static{this.compoundTypeNames=new Set(["block","checked_statement","class_declaration","constructor_declaration","destructor_declaration","do_statement","fixed_statement","for_statement","foreach_statement","if_statement","interface_declaration","lock_statement","method_declaration","struct_declaration","switch_statement","try_statement","unsafe_statement","while_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},T4e=class extends LR{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new tIr(e)}getStatementQueryText(){return`[ + ] @statement`}},zIr=class t extends BD{static{a(this,"CSharpStatementNode")}static{this.compoundTypeNames=new Set(["block","checked_statement","class_declaration","constructor_declaration","destructor_declaration","do_statement","fixed_statement","for_statement","foreach_statement","if_statement","interface_declaration","lock_statement","method_declaration","struct_declaration","switch_statement","try_statement","unsafe_statement","while_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},z4e=class extends $R{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new zIr(e)}getStatementQueryText(){return`[ (extern_alias_directive) (using_directive) (global_attribute) @@ -918,7 +918,7 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (declaration) (accessor_declaration) (block) - ] @statement`}},rIr=class t extends RD{static{a(this,"CStatementNode")}static{this.compoundTypeNames=new Set(["declaration","function_definition","enum_specifier","field_declaration_list","type_definition","compound_statement","if_statement","switch_statement","while_statement","for_statement","do_statement","preproc_if","preproc_ifdef","namespace_definition","class_specifier","field_declaration_list","concept_definition","template_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){(this.isSingleLineDeclarationStatement()||this.isSingleLineConceptDefinition())&&this.collapse()}isSingleLineDeclarationStatement(){return!(this.node.type!=="declaration"||this.node.startPosition.row!==this.node.endPosition.row)}isSingleLineConceptDefinition(){return!(this.node.type!=="concept_definition"||this.node.startPosition.row!==this.node.endPosition.row)}},I4e=class extends LR{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new rIr(e)}getStatementQueryText(){return`[ + ] @statement`}},YIr=class t extends BD{static{a(this,"CStatementNode")}static{this.compoundTypeNames=new Set(["declaration","function_definition","enum_specifier","field_declaration_list","type_definition","compound_statement","if_statement","switch_statement","while_statement","for_statement","do_statement","preproc_if","preproc_ifdef","namespace_definition","class_specifier","field_declaration_list","concept_definition","template_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){(this.isSingleLineDeclarationStatement()||this.isSingleLineConceptDefinition())&&this.collapse()}isSingleLineDeclarationStatement(){return!(this.node.type!=="declaration"||this.node.startPosition.row!==this.node.endPosition.row)}isSingleLineConceptDefinition(){return!(this.node.type!=="concept_definition"||this.node.startPosition.row!==this.node.endPosition.row)}},Y4e=class extends $R{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new YIr(e)}getStatementQueryText(){return`[ (declaration) (function_definition) (type_definition) @@ -955,30 +955,30 @@ ${r}+- `:"";return e+this.description+o}}};bAe.StatementNode=RD;var LR=class{sta (using_declaration) (alias_declaration) (static_assert_declaration) - ] @statement`}}});var SAe=I(kD=>{"use strict";p();Object.defineProperty(kD,"__esModule",{value:!0});kD.BlockPositionType=kD.TerseBlockTrimmer=kD.VerboseBlockTrimmer=kD.BlockTrimmer=void 0;kD.getBlockPositionType=JVa;var ayt=nIr(),x4e=class{static{a(this,"BlockTrimmer")}static isSupported(e){return ayt.StatementTree.isSupported(e)}static isTrimmedByDefault(e){return ayt.StatementTree.isTrimmedByDefault(e)}constructor(e,r,n){this.languageId=e,this.prefix=r,this.completion=n}async withParsedStatementTree(e){let r=ayt.StatementTree.create(this.languageId,this.prefix+this.completion,this.prefix.length,this.prefix.length+this.completion.length);await r.build();try{return await e(r)}finally{r[Symbol.dispose]()}}trimmedCompletion(e){return e===void 0?this.completion:this.completion.substring(0,e)}getStatementAtCursor(e){return e.statementAt(Math.max(this.prefix.length-1,0))??e.statements[0]}getContainingBlockOffset(e){let r;if(e&&this.isCompoundStatement(e))r=e;else if(e){let n=e.parent;for(;n&&!this.isCompoundStatement(n);)n=n.parent;r=n}if(r){let n=this.asCompletionOffset(r.node.endIndex);if(n&&this.completion.substring(n).trim()!=="")return n}}hasNonStatementContentAfter(e){if(!e||!e.nextSibling)return!1;let r=this.asCompletionOffset(e.node.endIndex),n=this.asCompletionOffset(e.nextSibling.node.startIndex);return this.completion.substring(Math.max(0,r??0),Math.max(0,n??0)).trim()!==""}asCompletionOffset(e){return e===void 0?void 0:e-this.prefix.length}isCompoundStatement(e){return e.isCompoundStatementType||e.children.length>0}};kD.BlockTrimmer=x4e;var iIr=class extends x4e{static{a(this,"VerboseBlockTrimmer")}constructor(e,r,n,o=10){super(e,r,n),this.lineLimit=o;let s=[...this.completion.matchAll(/\n/g)];s.length>=this.lineLimit&&this.lineLimit>0?this.offsetLimit=s[this.lineLimit-1].index:this.offsetLimit=void 0}async getCompletionTrimOffset(){return await this.withParsedStatementTree(e=>{let r=this.getStatementAtCursor(e),n=this.getContainingBlockOffset(r);return this.isWithinLimit(n)||(n=this.trimToBlankLine(n)),this.isWithinLimit(n)||(n=this.trimToStatement(r,n)),n})}isWithinLimit(e){return this.offsetLimit===void 0||e!==void 0&&e<=this.offsetLimit}trimToBlankLine(e){let r=[...this.trimmedCompletion(e).matchAll(/\r?\n\s*\r?\n/g)].reverse();for(;r.length>0&&!this.isWithinLimit(e);)e=r.pop().index;return e}trimToStatement(e,r){let n=this.prefix.length,o=this.prefix.length+(this.offsetLimit??this.completion.length),s=e,c=e?.nextSibling;for(;c&&c.node.endIndex<=o&&!this.hasNonStatementContentAfter(s);)s=c,c=c.nextSibling;return s&&s===e&&s.node.endIndex<=n&&(s=c),s&&s.node.endIndex>o?this.trimToStatement(s.children[0],this.asCompletionOffset(s.node.endIndex)):this.asCompletionOffset(s?.node?.endIndex)??r}};kD.VerboseBlockTrimmer=iIr;var oIr=class extends x4e{static{a(this,"TerseBlockTrimmer")}constructor(e,r,n,o=3,s=7){super(e,r,n),this.lineLimit=o,this.lookAhead=s;let c=[...this.completion.matchAll(/\n/g)],l=this.lineLimit+this.lookAhead;c.length>=this.lineLimit&&this.lineLimit>0&&(this.limitOffset=c[this.lineLimit-1].index),c.length>=l&&l>0&&(this.lookAheadOffset=c[l-1].index)}async getCompletionTrimOffset(){return await this.withParsedStatementTree(e=>{let r=e.statementAt(this.stmtStartPos()),n=this.getContainingBlockOffset(r);return n=this.trimAtFirstBlankLine(n),r&&(n=this.trimAtStatementChange(r,n)),this.limitOffset&&this.lookAheadOffset&&(n===void 0||n>this.lookAheadOffset)?this.limitOffset:n})}stmtStartPos(){let e=this.completion.match(/\S/);return e&&e.index!==void 0?this.prefix.length+e.index:Math.max(this.prefix.length-1,0)}trimAtFirstBlankLine(e){let r=[...this.trimmedCompletion(e).matchAll(/\r?\n\s*\r?\n/g)];for(;r.length>0&&(e===void 0||e>r[0].index);){let n=r.shift();if(this.completion.substring(0,n.index).trim()!=="")return n.index}return e}trimAtStatementChange(e,r){let n=this.prefix.length,o=this.prefix.length+(r??this.completion.length);if(e.node.endIndex>n&&this.isCompoundStatement(e))return e.nextSibling&&e.node.endIndexn&&s.node.endIndex{"use strict";p();var ZVa=PD&&PD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},I2i=PD&&PD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(PD,"__esModule",{value:!0});PD.ConfigBlockModeConfig=PD.ICompletionsBlockModeConfig=void 0;var XVa=nn(),eWa=Gs(),X4=C2i(),w2i=Qre(),x2i=LE(),tWa=fy(),rWa=SAe(),nWa=nIr();PD.ICompletionsBlockModeConfig=(0,XVa.createServiceIdentifier)("ICompletionsBlockModeConfig");var aIr=class{static{a(this,"ConfigBlockModeConfig")}constructor(e,r){this.instantiationService=e,this.featuresService=r}forLanguage(e,r){let n=this.featuresService.overrideBlockMode(r);if(n)return sIr(n,e);let o=this.featuresService.enableProgressiveReveal(r);return(this.instantiationService.invokeFunction(x2i.getConfig,x2i.ConfigKey.AlwaysRequestMultiline)??o)||rWa.BlockTrimmer.isTrimmedByDefault(e)?sIr(X4.BlockMode.MoreMultiline,e):e==="ruby"?X4.BlockMode.Parsing:(0,w2i.isSupportedLanguageId)(e)?X4.BlockMode.ParsingAndServer:X4.BlockMode.Server}};PD.ConfigBlockModeConfig=aIr;PD.ConfigBlockModeConfig=aIr=ZVa([I2i(0,eWa.IInstantiationService),I2i(1,tWa.ICompletionsFeaturesService)],aIr);function iWa(t){return[X4.BlockMode.Parsing,X4.BlockMode.ParsingAndServer,X4.BlockMode.MoreMultiline].includes(t)}a(iWa,"blockModeRequiresTreeSitter");function sIr(t,e){return t===X4.BlockMode.MoreMultiline&&nWa.StatementTree.isSupported(e)?t:iWa(t)&&!(0,w2i.isSupportedLanguageId)(e)?X4.BlockMode.Server:t}a(sIr,"toApplicableBlockMode")});var a$=I(cyt=>{"use strict";p();Object.defineProperty(cyt,"__esModule",{value:!0});cyt.ResultType=void 0;var R2i;(function(t){t[t.Network=0]="Network",t[t.Cache=1]="Cache",t[t.TypingAsSuggested=2]="TypingAsSuggested",t[t.Cycling=3]="Cycling",t[t.Async=4]="Async"})(R2i||(cyt.ResultType=R2i={}))});var uIr=I(TAe=>{"use strict";p();Object.defineProperty(TAe,"__esModule",{value:!0});TAe.CurrentGhostText=TAe.ICompletionsCurrentGhostText=void 0;var oWa=nn(),sWa=a$();TAe.ICompletionsCurrentGhostText=(0,oWa.createServiceIdentifier)("ICompletionsCurrentGhostText");var lIr=class{static{a(this,"CurrentGhostText")}constructor(){this.choices=[]}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==sWa.ResultType.TypingAsSuggested&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&k2i(this.choices[0].completionText,n))return aWa(this.choices,n)}hasAcceptedCurrentCompletion(e,r){let n=this.getRemainingPrefix(e,r);if(n===void 0)return!1;let o=n===this.choices?.[0].completionText,s=this.choices?.[0].finishReason;return o&&s==="stop"}getRemainingPrefix(e,r){if(!(this.prefix===void 0||this.suffix===void 0||this.choices.length===0)&&this.suffix===r&&e.startsWith(this.prefix))return e.substring(this.prefix.length)}};TAe.CurrentGhostText=lIr;function aWa(t,e){return t.filter(r=>k2i(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(aWa,"adjustChoicesStart");function k2i(t,e){return t.startsWith(e)&&t.length>e.length}a(k2i,"startsWithAndExceeds")});var P2i=I(S6=>{"use strict";p();var cWa=S6&&S6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},lWa=S6&&S6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(S6,"__esModule",{value:!0});S6.ChangeTracker=void 0;var uWa=s1(),dIr=class{static{a(this,"ChangeTracker")}get offset(){return this._offset}constructor(e,r,n){this._referenceCount=0,this._isDisposed=!1,this._offset=r,this._tracker=n.onDidChangeTextDocument(o=>{if(o.document.uri===e){for(let s of o.contentChanges)if(s.rangeOffset+s.rangeLength<=this.offset){let c=s.text.length-s.rangeLength;this._offset=this._offset+c}}})}push(e,r){if(this._isDisposed)throw new Error("Unable to push new actions to a disposed ChangeTracker");this._referenceCount++,setTimeout(()=>{e(),this._referenceCount--,this._referenceCount===0&&(this._tracker.dispose(),this._isDisposed=!0)},r)}};S6.ChangeTracker=dIr;S6.ChangeTracker=dIr=cWa([lWa(2,uWa.ICompletionsTextDocumentManagerService)],dIr)});var pIr=I(w4e=>{"use strict";p();Object.defineProperty(w4e,"__esModule",{value:!0});w4e.CompletionState=void 0;w4e.createCompletionState=dWa;var fIr=o4e(),lyt=class t{static{a(this,"CompletionState")}constructor(e,r,n=[],o,s,c){this._textDocument=e,this._position=r,this.originalPosition=o??fIr.Position.create(r.line,r.character),this.originalVersion=s??e.version,this.originalOffset=c??e.offsetAt(this.originalPosition),this._editsWithPosition=[...n]}get textDocument(){return this._textDocument}get position(){return this._position}get editsWithPosition(){return[...this._editsWithPosition]}updateState(e,r,n){return new t(e,r,n??this.editsWithPosition,this.originalPosition,this.originalVersion,this.originalOffset)}updatePosition(e){return this.updateState(this._textDocument,e)}addSelectedCompletionInfo(e){if(this.editsWithPosition.find(n=>n.source==="selectedCompletionInfo"))throw new Error("Selected completion info already applied");let r={range:e.range,newText:e.text};return this.applyEdits([r],!0)}applyEdits(e,r=!1){if(r&&e.length>1)throw new Error("Selected completion info should be a single edit");let n=this._textDocument,o=this._position,s=n.offsetAt(o),c=this.editsWithPosition;for(let{range:l,newText:u}of e){let d=n.getText(l),f=n.offsetAt(l.end);if(n=n.applyEdits([{range:l,newText:u}]),s{"use strict";p();Object.defineProperty(IAe,"__esModule",{value:!0});IAe.SpeculativeRequestCache=IAe.ICompletionsSpeculativeRequestCache=void 0;var fWa=nn(),pWa=C6();IAe.ICompletionsSpeculativeRequestCache=(0,fWa.createServiceIdentifier)("ICompletionsSpeculativeRequestCache");var hIr=class{static{a(this,"SpeculativeRequestCache")}constructor(){this.cache=new pWa.LRUCacheMap(100)}set(e,r){this.cache.set(e,r)}async request(e){let r=this.cache.get(e);r!==void 0&&(this.cache.delete(e),await r())}};IAe.SpeculativeRequestCache=hIr});var xAe=I(Mv=>{"use strict";p();Object.defineProperty(Mv,"__esModule",{value:!0});Mv.logger=Mv.GHOST_TEXT_CATEGORY=void 0;Mv.telemetryShown=mWa;Mv.telemetryAccepted=gWa;Mv.telemetryRejected=AWa;Mv.mkCanceledResultTelemetry=yWa;Mv.mkBasicResultTelemetry=EWa;Mv.handleGhostTextResultTelemetry=_Wa;Mv.resultTypeToString=mIr;var D2i=Dl(),qre=$g(),R4e=a$(),hWa=uyt();Mv.GHOST_TEXT_CATEGORY="ghostText";Mv.logger=new D2i.Logger("getCompletions");function mWa(t,e){t.get(hWa.ICompletionsSpeculativeRequestCache).request(e.clientCompletionId),e.telemetry.markAsDisplayed(),e.telemetry.properties.reason=mIr(e.resultType),(0,qre.telemetry)(t,"ghostText.shown",e.telemetry)}a(mWa,"telemetryShown");function gWa(t,e,r){let n=e+".accepted";(0,qre.telemetry)(t,n,r)}a(gWa,"telemetryAccepted");function AWa(t,e,r){let n=e+".rejected";(0,qre.telemetry)(t,n,r)}a(AWa,"telemetryRejected");function yWa(t,e={}){return{...e,telemetryBlob:t}}a(yWa,"mkCanceledResultTelemetry");function EWa(t){let e={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId};return t.properties.sku!==void 0&&(e.sku=t.properties.sku),t.properties.opportunityId!==void 0&&(e.opportunityId=t.properties.opportunityId),t.properties.organizations_list!==void 0&&(e.organizations_list=t.properties.organizations_list),t.properties.enterprise_list!==void 0&&(e.enterprise_list=t.properties.enterprise_list),t.properties.clientCompletionId!==void 0&&(e.clientCompletionId=t.properties.clientCompletionId),e}a(EWa,"mkBasicResultTelemetry");function _Wa(t,e){let r=t.get(D2i.ICompletionsLogTargetService);if(e.type!=="promptOnly"){if(e.type==="success"){let n=(0,qre.now)()-e.telemetryBlob.issuedTime,o=mIr(e.resultType),s=JSON.stringify(e.performanceMetrics),c={...e.telemetryData,reason:o,performanceMetrics:s},{foundOffset:l}=e.telemetryBlob.measurements,u=e.performanceMetrics?.map(([d,f])=>` -${f.toFixed(2)} ${d}`).join("")??"";return Mv.logger.debug(r,`ghostText produced from ${o} in ${Math.round(n)}ms with foundOffset ${l}${u}`),(0,qre.telemetryRaw)(t,"ghostText.produced",c,{timeToProduceMs:n,foundOffset:l}),e.value}if(Mv.logger.debug(r,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){(0,qre.telemetry)(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}(0,qre.telemetryRaw)(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(_Wa,"handleGhostTextResultTelemetry");function mIr(t){switch(t){case R4e.ResultType.Network:return"network";case R4e.ResultType.Cache:return"cache";case R4e.ResultType.Cycling:return"cycling";case R4e.ResultType.TypingAsSuggested:return"typingAsSuggested";case R4e.ResultType.Async:return"async"}}a(mIr,"resultTypeToString")});var O2i=I(wAe=>{"use strict";p();Object.defineProperty(wAe,"__esModule",{value:!0});wAe.getBlockParser=pyt;wAe.isEmptyBlockStart=SWa;wAe.isBlockBodyFinished=TWa;wAe.getNodeStart=IWa;var c$=Qre(),dyt=class{static{a(this,"BaseBlockParser")}constructor(e,r,n){this.languageId=e,this.nodeMatch=r,this.nodeTypesWithBlockOrStmtChild=n}async getNodeMatchAtPosition(e,r,n){let o=await(0,c$.parseTreeSitter)(this.languageId,e);try{let c=o.rootNode.descendantForIndex(r);for(;c;){let l=this.nodeMatch[c.type];if(l){if(!this.nodeTypesWithBlockOrStmtChild.has(c.type))break;let u=this.nodeTypesWithBlockOrStmtChild.get(c.type);if((u===""?c.namedChildren[0]:c.childForFieldName(u))?.type===l)break}c=c.parent}return c?n(c):void 0}finally{o.delete()}}getNextBlockAtPosition(e,r,n){return this.getNodeMatchAtPosition(e,r,o=>{let s=o.children.reverse().find(c=>c.type===this.nodeMatch[o.type]);if(s){if(this.languageId==="python"&&s.parent){let c=s.parent.type===":"?s.parent.parent:s.parent,l=c?.nextSibling;for(;l&&l.type==="comment";){let u=l.startPosition.row===s.endPosition.row&&l.startPosition.column>=s.endPosition.column,d=l.startPosition.row>c.endPosition.row&&l.startPosition.column>c.startPosition.column;if(u||d)s=l,l=l.nextSibling;else break}}if(!(s.endIndex>=s.tree.rootNode.endIndex-1&&(s.hasError||s.parent.hasError)))return n(s)}})}async isBlockBodyFinished(e,r,n){let o=(e+r).trimEnd(),s=await this.getNextBlockAtPosition(o,n,c=>c.endIndex);if(s!==void 0&&s0?c:void 0}}getNodeStart(e,r){let n=e.trimEnd();return this.getNodeMatchAtPosition(n,r,o=>o.startIndex)}},fyt=class extends dyt{static{a(this,"RegexBasedBlockParser")}constructor(e,r,n,o,s){super(e,o,s),this.blockEmptyMatch=r,this.lineMatch=n}isBlockStart(e){return this.lineMatch.test(e.trimStart())}async isBlockBodyEmpty(e,r){let n=await this.getNextBlockAtPosition(e,r,o=>{o.startIndex{"use strict";p();Object.defineProperty(FD,"__esModule",{value:!0});FD.BlockPositionType=FD.TerseBlockTrimmer=FD.VerboseBlockTrimmer=FD.BlockTrimmer=void 0;FD.getBlockPositionType=vYa;var Nyt=KIr(),K4e=class{static{a(this,"BlockTrimmer")}static isSupported(e){return Nyt.StatementTree.isSupported(e)}static isTrimmedByDefault(e){return Nyt.StatementTree.isTrimmedByDefault(e)}constructor(e,r,n){this.languageId=e,this.prefix=r,this.completion=n}async withParsedStatementTree(e){let r=Nyt.StatementTree.create(this.languageId,this.prefix+this.completion,this.prefix.length,this.prefix.length+this.completion.length);await r.build();try{return await e(r)}finally{r[Symbol.dispose]()}}trimmedCompletion(e){return e===void 0?this.completion:this.completion.substring(0,e)}getStatementAtCursor(e){return e.statementAt(Math.max(this.prefix.length-1,0))??e.statements[0]}getContainingBlockOffset(e){let r;if(e&&this.isCompoundStatement(e))r=e;else if(e){let n=e.parent;for(;n&&!this.isCompoundStatement(n);)n=n.parent;r=n}if(r){let n=this.asCompletionOffset(r.node.endIndex);if(n&&this.completion.substring(n).trim()!=="")return n}}hasNonStatementContentAfter(e){if(!e||!e.nextSibling)return!1;let r=this.asCompletionOffset(e.node.endIndex),n=this.asCompletionOffset(e.nextSibling.node.startIndex);return this.completion.substring(Math.max(0,r??0),Math.max(0,n??0)).trim()!==""}asCompletionOffset(e){return e===void 0?void 0:e-this.prefix.length}isCompoundStatement(e){return e.isCompoundStatementType||e.children.length>0}};FD.BlockTrimmer=K4e;var JIr=class extends K4e{static{a(this,"VerboseBlockTrimmer")}constructor(e,r,n,o=10){super(e,r,n),this.lineLimit=o;let s=[...this.completion.matchAll(/\n/g)];s.length>=this.lineLimit&&this.lineLimit>0?this.offsetLimit=s[this.lineLimit-1].index:this.offsetLimit=void 0}async getCompletionTrimOffset(){return await this.withParsedStatementTree(e=>{let r=this.getStatementAtCursor(e),n=this.getContainingBlockOffset(r);return this.isWithinLimit(n)||(n=this.trimToBlankLine(n)),this.isWithinLimit(n)||(n=this.trimToStatement(r,n)),n})}isWithinLimit(e){return this.offsetLimit===void 0||e!==void 0&&e<=this.offsetLimit}trimToBlankLine(e){let r=[...this.trimmedCompletion(e).matchAll(/\r?\n\s*\r?\n/g)].reverse();for(;r.length>0&&!this.isWithinLimit(e);)e=r.pop().index;return e}trimToStatement(e,r){let n=this.prefix.length,o=this.prefix.length+(this.offsetLimit??this.completion.length),s=e,c=e?.nextSibling;for(;c&&c.node.endIndex<=o&&!this.hasNonStatementContentAfter(s);)s=c,c=c.nextSibling;return s&&s===e&&s.node.endIndex<=n&&(s=c),s&&s.node.endIndex>o?this.trimToStatement(s.children[0],this.asCompletionOffset(s.node.endIndex)):this.asCompletionOffset(s?.node?.endIndex)??r}};FD.VerboseBlockTrimmer=JIr;var ZIr=class extends K4e{static{a(this,"TerseBlockTrimmer")}constructor(e,r,n,o=3,s=7){super(e,r,n),this.lineLimit=o,this.lookAhead=s;let c=[...this.completion.matchAll(/\n/g)],l=this.lineLimit+this.lookAhead;c.length>=this.lineLimit&&this.lineLimit>0&&(this.limitOffset=c[this.lineLimit-1].index),c.length>=l&&l>0&&(this.lookAheadOffset=c[l-1].index)}async getCompletionTrimOffset(){return await this.withParsedStatementTree(e=>{let r=e.statementAt(this.stmtStartPos()),n=this.getContainingBlockOffset(r);return n=this.trimAtFirstBlankLine(n),r&&(n=this.trimAtStatementChange(r,n)),this.limitOffset&&this.lookAheadOffset&&(n===void 0||n>this.lookAheadOffset)?this.limitOffset:n})}stmtStartPos(){let e=this.completion.match(/\S/);return e&&e.index!==void 0?this.prefix.length+e.index:Math.max(this.prefix.length-1,0)}trimAtFirstBlankLine(e){let r=[...this.trimmedCompletion(e).matchAll(/\r?\n\s*\r?\n/g)];for(;r.length>0&&(e===void 0||e>r[0].index);){let n=r.shift();if(this.completion.substring(0,n.index).trim()!=="")return n.index}return e}trimAtStatementChange(e,r){let n=this.prefix.length,o=this.prefix.length+(r??this.completion.length);if(e.node.endIndex>n&&this.isCompoundStatement(e))return e.nextSibling&&e.node.endIndexn&&s.node.endIndex{"use strict";p();var CYa=UD&&UD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},yNi=UD&&UD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(UD,"__esModule",{value:!0});UD.ConfigBlockModeConfig=UD.ICompletionsBlockModeConfig=void 0;var bYa=nn(),SYa=$s(),nL=hNi(),_Ni=Yre(),ENi=qE(),TYa=gy(),IYa=QAe(),xYa=KIr();UD.ICompletionsBlockModeConfig=(0,bYa.createServiceIdentifier)("ICompletionsBlockModeConfig");var exr=class{static{a(this,"ConfigBlockModeConfig")}constructor(e,r){this.instantiationService=e,this.featuresService=r}forLanguage(e,r){let n=this.featuresService.overrideBlockMode(r);if(n)return XIr(n,e);let o=this.featuresService.enableProgressiveReveal(r);return(this.instantiationService.invokeFunction(ENi.getConfig,ENi.ConfigKey.AlwaysRequestMultiline)??o)||IYa.BlockTrimmer.isTrimmedByDefault(e)?XIr(nL.BlockMode.MoreMultiline,e):e==="ruby"?nL.BlockMode.Parsing:(0,_Ni.isSupportedLanguageId)(e)?nL.BlockMode.ParsingAndServer:nL.BlockMode.Server}};UD.ConfigBlockModeConfig=exr;UD.ConfigBlockModeConfig=exr=CYa([yNi(0,SYa.IInstantiationService),yNi(1,TYa.ICompletionsFeaturesService)],exr);function wYa(t){return[nL.BlockMode.Parsing,nL.BlockMode.ParsingAndServer,nL.BlockMode.MoreMultiline].includes(t)}a(wYa,"blockModeRequiresTreeSitter");function XIr(t,e){return t===nL.BlockMode.MoreMultiline&&xYa.StatementTree.isSupported(e)?t:wYa(t)&&!(0,_Ni.isSupportedLanguageId)(e)?nL.BlockMode.Server:t}a(XIr,"toApplicableBlockMode")});var _$=I(Myt=>{"use strict";p();Object.defineProperty(Myt,"__esModule",{value:!0});Myt.ResultType=void 0;var vNi;(function(t){t[t.Network=0]="Network",t[t.Cache=1]="Cache",t[t.TypingAsSuggested=2]="TypingAsSuggested",t[t.Cycling=3]="Cycling",t[t.Async=4]="Async"})(vNi||(Myt.ResultType=vNi={}))});var nxr=I(qAe=>{"use strict";p();Object.defineProperty(qAe,"__esModule",{value:!0});qAe.CurrentGhostText=qAe.ICompletionsCurrentGhostText=void 0;var RYa=nn(),kYa=_$();qAe.ICompletionsCurrentGhostText=(0,RYa.createServiceIdentifier)("ICompletionsCurrentGhostText");var rxr=class{static{a(this,"CurrentGhostText")}constructor(){this.choices=[]}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==kYa.ResultType.TypingAsSuggested&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&CNi(this.choices[0].completionText,n))return PYa(this.choices,n)}hasAcceptedCurrentCompletion(e,r){let n=this.getRemainingPrefix(e,r);if(n===void 0)return!1;let o=n===this.choices?.[0].completionText,s=this.choices?.[0].finishReason;return o&&s==="stop"}getRemainingPrefix(e,r){if(!(this.prefix===void 0||this.suffix===void 0||this.choices.length===0)&&this.suffix===r&&e.startsWith(this.prefix))return e.substring(this.prefix.length)}};qAe.CurrentGhostText=rxr;function PYa(t,e){return t.filter(r=>CNi(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(PYa,"adjustChoicesStart");function CNi(t,e){return t.startsWith(e)&&t.length>e.length}a(CNi,"startsWithAndExceeds")});var bNi=I(L6=>{"use strict";p();var DYa=L6&&L6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},NYa=L6&&L6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(L6,"__esModule",{value:!0});L6.ChangeTracker=void 0;var MYa=l1(),ixr=class{static{a(this,"ChangeTracker")}get offset(){return this._offset}constructor(e,r,n){this._referenceCount=0,this._isDisposed=!1,this._offset=r,this._tracker=n.onDidChangeTextDocument(o=>{if(o.document.uri===e){for(let s of o.contentChanges)if(s.rangeOffset+s.rangeLength<=this.offset){let c=s.text.length-s.rangeLength;this._offset=this._offset+c}}})}push(e,r){if(this._isDisposed)throw new Error("Unable to push new actions to a disposed ChangeTracker");this._referenceCount++,setTimeout(()=>{e(),this._referenceCount--,this._referenceCount===0&&(this._tracker.dispose(),this._isDisposed=!0)},r)}};L6.ChangeTracker=ixr;L6.ChangeTracker=ixr=DYa([NYa(2,MYa.ICompletionsTextDocumentManagerService)],ixr)});var sxr=I(J4e=>{"use strict";p();Object.defineProperty(J4e,"__esModule",{value:!0});J4e.CompletionState=void 0;J4e.createCompletionState=OYa;var oxr=w4e(),Oyt=class t{static{a(this,"CompletionState")}constructor(e,r,n=[],o,s,c){this._textDocument=e,this._position=r,this.originalPosition=o??oxr.Position.create(r.line,r.character),this.originalVersion=s??e.version,this.originalOffset=c??e.offsetAt(this.originalPosition),this._editsWithPosition=[...n]}get textDocument(){return this._textDocument}get position(){return this._position}get editsWithPosition(){return[...this._editsWithPosition]}updateState(e,r,n){return new t(e,r,n??this.editsWithPosition,this.originalPosition,this.originalVersion,this.originalOffset)}updatePosition(e){return this.updateState(this._textDocument,e)}addSelectedCompletionInfo(e){if(this.editsWithPosition.find(n=>n.source==="selectedCompletionInfo"))throw new Error("Selected completion info already applied");let r={range:e.range,newText:e.text};return this.applyEdits([r],!0)}applyEdits(e,r=!1){if(r&&e.length>1)throw new Error("Selected completion info should be a single edit");let n=this._textDocument,o=this._position,s=n.offsetAt(o),c=this.editsWithPosition;for(let{range:l,newText:u}of e){let d=n.getText(l),f=n.offsetAt(l.end);if(n=n.applyEdits([{range:l,newText:u}]),s{"use strict";p();Object.defineProperty(jAe,"__esModule",{value:!0});jAe.SpeculativeRequestCache=jAe.ICompletionsSpeculativeRequestCache=void 0;var LYa=nn(),BYa=M6();jAe.ICompletionsSpeculativeRequestCache=(0,LYa.createServiceIdentifier)("ICompletionsSpeculativeRequestCache");var axr=class{static{a(this,"SpeculativeRequestCache")}constructor(){this.cache=new BYa.LRUCacheMap(100)}set(e,r){this.cache.set(e,r)}async request(e){let r=this.cache.get(e);r!==void 0&&(this.cache.delete(e),await r())}};jAe.SpeculativeRequestCache=axr});var HAe=I(Bv=>{"use strict";p();Object.defineProperty(Bv,"__esModule",{value:!0});Bv.logger=Bv.GHOST_TEXT_CATEGORY=void 0;Bv.telemetryShown=UYa;Bv.telemetryAccepted=QYa;Bv.telemetryRejected=qYa;Bv.mkCanceledResultTelemetry=jYa;Bv.mkBasicResultTelemetry=HYa;Bv.handleGhostTextResultTelemetry=GYa;Bv.resultTypeToString=cxr;var SNi=Dl(),Kre=Yg(),Z4e=_$(),FYa=Lyt();Bv.GHOST_TEXT_CATEGORY="ghostText";Bv.logger=new SNi.Logger("getCompletions");function UYa(t,e){t.get(FYa.ICompletionsSpeculativeRequestCache).request(e.clientCompletionId),e.telemetry.markAsDisplayed(),e.telemetry.properties.reason=cxr(e.resultType),(0,Kre.telemetry)(t,"ghostText.shown",e.telemetry)}a(UYa,"telemetryShown");function QYa(t,e,r){let n=e+".accepted";(0,Kre.telemetry)(t,n,r)}a(QYa,"telemetryAccepted");function qYa(t,e,r){let n=e+".rejected";(0,Kre.telemetry)(t,n,r)}a(qYa,"telemetryRejected");function jYa(t,e={}){return{...e,telemetryBlob:t}}a(jYa,"mkCanceledResultTelemetry");function HYa(t){let e={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId};return t.properties.sku!==void 0&&(e.sku=t.properties.sku),t.properties.opportunityId!==void 0&&(e.opportunityId=t.properties.opportunityId),t.properties.organizations_list!==void 0&&(e.organizations_list=t.properties.organizations_list),t.properties.enterprise_list!==void 0&&(e.enterprise_list=t.properties.enterprise_list),t.properties.clientCompletionId!==void 0&&(e.clientCompletionId=t.properties.clientCompletionId),e}a(HYa,"mkBasicResultTelemetry");function GYa(t,e){let r=t.get(SNi.ICompletionsLogTargetService);if(e.type!=="promptOnly"){if(e.type==="success"){let n=(0,Kre.now)()-e.telemetryBlob.issuedTime,o=cxr(e.resultType),s=JSON.stringify(e.performanceMetrics),c={...e.telemetryData,reason:o,performanceMetrics:s},{foundOffset:l}=e.telemetryBlob.measurements,u=e.performanceMetrics?.map(([d,f])=>` +${f.toFixed(2)} ${d}`).join("")??"";return Bv.logger.debug(r,`ghostText produced from ${o} in ${Math.round(n)}ms with foundOffset ${l}${u}`),(0,Kre.telemetryRaw)(t,"ghostText.produced",c,{timeToProduceMs:n,foundOffset:l}),e.value}if(Bv.logger.debug(r,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){(0,Kre.telemetry)(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}(0,Kre.telemetryRaw)(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(GYa,"handleGhostTextResultTelemetry");function cxr(t){switch(t){case Z4e.ResultType.Network:return"network";case Z4e.ResultType.Cache:return"cache";case Z4e.ResultType.Cycling:return"cycling";case Z4e.ResultType.TypingAsSuggested:return"typingAsSuggested";case Z4e.ResultType.Async:return"async"}}a(cxr,"resultTypeToString")});var xNi=I(GAe=>{"use strict";p();Object.defineProperty(GAe,"__esModule",{value:!0});GAe.getBlockParser=Uyt;GAe.isEmptyBlockStart=zYa;GAe.isBlockBodyFinished=YYa;GAe.getNodeStart=KYa;var v$=Yre(),Byt=class{static{a(this,"BaseBlockParser")}constructor(e,r,n){this.languageId=e,this.nodeMatch=r,this.nodeTypesWithBlockOrStmtChild=n}async getNodeMatchAtPosition(e,r,n){let o=await(0,v$.parseTreeSitter)(this.languageId,e);try{let c=o.rootNode.descendantForIndex(r);for(;c;){let l=this.nodeMatch[c.type];if(l){if(!this.nodeTypesWithBlockOrStmtChild.has(c.type))break;let u=this.nodeTypesWithBlockOrStmtChild.get(c.type);if((u===""?c.namedChildren[0]:c.childForFieldName(u))?.type===l)break}c=c.parent}return c?n(c):void 0}finally{o.delete()}}getNextBlockAtPosition(e,r,n){return this.getNodeMatchAtPosition(e,r,o=>{let s=o.children.reverse().find(c=>c.type===this.nodeMatch[o.type]);if(s){if(this.languageId==="python"&&s.parent){let c=s.parent.type===":"?s.parent.parent:s.parent,l=c?.nextSibling;for(;l&&l.type==="comment";){let u=l.startPosition.row===s.endPosition.row&&l.startPosition.column>=s.endPosition.column,d=l.startPosition.row>c.endPosition.row&&l.startPosition.column>c.startPosition.column;if(u||d)s=l,l=l.nextSibling;else break}}if(!(s.endIndex>=s.tree.rootNode.endIndex-1&&(s.hasError||s.parent.hasError)))return n(s)}})}async isBlockBodyFinished(e,r,n){let o=(e+r).trimEnd(),s=await this.getNextBlockAtPosition(o,n,c=>c.endIndex);if(s!==void 0&&s0?c:void 0}}getNodeStart(e,r){let n=e.trimEnd();return this.getNodeMatchAtPosition(n,r,o=>o.startIndex)}},Fyt=class extends Byt{static{a(this,"RegexBasedBlockParser")}constructor(e,r,n,o,s){super(e,o,s),this.blockEmptyMatch=r,this.lineMatch=n}isBlockStart(e){return this.lineMatch.test(e.trimStart())}async isBlockBodyEmpty(e,r){let n=await this.getNextBlockAtPosition(e,r,o=>{o.startIndex0&&/\s/.test(t.charAt(r-1));)r--;return r}a(M2i,"rewindToNearestNonWs");function N2i(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(N2i,"indent");function CWa(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=N2i(t,r),o=N2i(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(CWa,"outdented");var eL=class extends dyt{static{a(this,"TreeSitterBasedBlockParser")}constructor(e,r,n,o,s,c,l){super(e,r,n),this.startKeywords=o,this.blockNodeType=s,this.emptyStatementType=c,this.curlyBraceLanguage=l}isBlockEmpty(e,r){let n=e.text.trim();return this.curlyBraceLanguage&&(n.startsWith("{")&&(n=n.slice(1)),n.endsWith("}")&&(n=n.slice(0,-1)),n=n.trim()),!!(n.length===0||this.languageId==="python"&&(e.parent?.type==="class_definition"||e.parent?.type==="function_definition")&&e.children.length===1&&(0,c$.queryPythonIsDocstring)(e.parent))}async isEmptyBlockStart(e,r){if(r>e.length)throw new RangeError("Invalid offset");for(let s=r;sg.type===";")&&f.endIndex<=r}f=f.parent}}let c=null,l=null,u=null,d=s;for(;d!==null;){if(d.type===this.blockNodeType){l=d;break}if(this.nodeMatch[d.type]){u=d;break}if(d.type==="ERROR"){c=d;break}d=d.parent}if(l!==null){if(!l.parent||!this.nodeMatch[l.parent.type])return!1;if(this.languageId==="python"){let f=l.previousSibling;if(f!==null&&f.hasError&&(f.text.startsWith('"""')||f.text.startsWith("'''")))return!0}return this.isBlockEmpty(l,r)}if(c!==null){if(c.previousSibling?.type==="module"||c.previousSibling?.type==="internal_module"||c.previousSibling?.type==="def")return!0;if(this.languageId==="python"&&o>=14&&c.hasError&&(c.text.startsWith('"')||c.text.startsWith("'"))){let g=c.parent?.type;if(g==="function_definition"||g==="class_definition"||g==="module")return!0}let f=[...c.children].reverse(),h=f.find(g=>this.startKeywords.includes(g.type)),m=f.find(g=>g.type===this.blockNodeType);if(h){switch(this.languageId){case"python":{h.type==="try"&&s.type==="identifier"&&s.text.length>4&&(m=f.find(y=>y.hasError)?.children.find(y=>y.type==="block"));let g,A=0;for(let y of c.children){if(y.type===":"&&A===0){g=y;break}y.type==="("&&(A+=1),y.type===")"&&(A-=1)}if(g&&h.endIndex<=g.startIndex&&g.nextSibling){if(h.type==="def"){let y=g.nextSibling;if(y.type==='"'||y.type==="'"||y.type==="ERROR"&&(y.text==='"""'||y.text==="'''"))return!0}return!1}break}case"javascript":{if(h.type==="class")if(o<=13){if(f.find(E=>E.type==="formal_parameters"))return!0}else{let y=c.children;for(let E=0;Ey.type==="{");if(g&&g.startIndex>h.endIndex&&g.nextSibling!==null||f.find(y=>y.type==="do")&&h.type==="while"||h.type==="=>"&&h.nextSibling&&h.nextSibling.type!=="{")return!1;break}case"typescript":{let g=f.find(y=>y.type==="{");if(g&&g.startIndex>h.endIndex&&g.nextSibling!==null||f.find(y=>y.type==="do")&&h.type==="while"||h.type==="=>"&&h.nextSibling&&h.nextSibling.type!=="{")return!1;break}}return m&&m.startIndex>h.endIndex?this.isBlockEmpty(m,r):!0}}if(u!==null){let f=this.nodeMatch[u.type],h=u.children.slice().reverse().find(m=>m.type===f);if(h)return this.isBlockEmpty(h,r);if(this.nodeTypesWithBlockOrStmtChild.has(u.type)){let m=this.nodeTypesWithBlockOrStmtChild.get(u.type),g=m===""?u.children[0]:u.childForFieldName(m);if(g&&g.type!==this.blockNodeType&&g.type!==this.emptyStatementType)return!1}return!0}return!1}finally{n.delete()}}},bWa={python:new eL("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new eL("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new eL("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),tsx:new eL("typescriptreact",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new fyt("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new fyt("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map),"c-sharp":new eL("csharp",{},new Map([]),[],"block",null,!0),java:new eL("java",{},new Map([]),[],"block",null,!0),php:new eL("php",{},new Map([]),[],"block",null,!0),cpp:new eL("cpp",{},new Map([]),[],"block",null,!0)};function pyt(t){if(!(0,c$.isSupportedLanguageId)(t))throw new Error(`Language ${t} is not supported`);return bWa[(0,c$.languageIdToWasmLanguage)(t)]}a(pyt,"getBlockParser");async function SWa(t,e,r){return(0,c$.isSupportedLanguageId)(t)?pyt(t).isEmptyBlockStart(e,r):!1}a(SWa,"isEmptyBlockStart");async function TWa(t,e,r,n){if((0,c$.isSupportedLanguageId)(t))return pyt(t).isBlockBodyFinished(e,r,n)}a(TWa,"isBlockBodyFinished");async function IWa(t,e,r){if((0,c$.isSupportedLanguageId)(t))return pyt(t).getNodeStart(e,r)}a(IWa,"getNodeStart")});var gyt=I(l$=>{"use strict";p();Object.defineProperty(l$,"__esModule",{value:!0});l$.parsingBlockFinished=xWa;l$.isEmptyBlockStartUtil=wWa;l$.getNodeStartUtil=RWa;l$.contextIndentation=NWa;l$.contextIndentationFromText=L2i;l$.indentationBlockFinished=LWa;var gIr=O2i(),myt=mAe();function xWa(t,e){let r=t.getText(myt.LocationFactory.range(myt.LocationFactory.position(0,0),e)),n=t.offsetAt(e),o=t.detectedLanguageId;return s=>(0,gIr.isBlockBodyFinished)(o,r,s,n)}a(xWa,"parsingBlockFinished");function wWa(t,e){return(0,gIr.isEmptyBlockStart)(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(wWa,"isEmptyBlockStartUtil");async function RWa(t,e,r){let o=t.getText(myt.LocationFactory.range(myt.LocationFactory.position(0,0),e))+r,s=await(0,gIr.getNodeStart)(t.detectedLanguageId,o,t.offsetAt(e));if(s)return t.positionAt(s)}a(RWa,"getNodeStartUtil");var kWa=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),PWa=new RegExp(`^(${kWa.join("|")})`);function DWa(t){return PWa.test(t.trimLeft().toLowerCase())}a(DWa,"isContinuationLine");function hyt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(hyt,"indentationOfLine");function NWa(t,e){let r=t.getText(),n=t.offsetAt(e);return L2i(r,n,t.detectedLanguageId)}a(NWa,"contextIndentation");function L2i(t,e,r){let n=t.slice(0,e).split(` +`,e);return n<0&&(n=t.length),t.slice(r+1,n)}a($Ya,"getLineAtOffset");function INi(t,e){let r=e;for(;r>0&&/\s/.test(t.charAt(r-1));)r--;return r}a(INi,"rewindToNearestNonWs");function TNi(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(TNi,"indent");function VYa(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=TNi(t,r),o=TNi(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(VYa,"outdented");var iL=class extends Byt{static{a(this,"TreeSitterBasedBlockParser")}constructor(e,r,n,o,s,c,l){super(e,r,n),this.startKeywords=o,this.blockNodeType=s,this.emptyStatementType=c,this.curlyBraceLanguage=l}isBlockEmpty(e,r){let n=e.text.trim();return this.curlyBraceLanguage&&(n.startsWith("{")&&(n=n.slice(1)),n.endsWith("}")&&(n=n.slice(0,-1)),n=n.trim()),!!(n.length===0||this.languageId==="python"&&(e.parent?.type==="class_definition"||e.parent?.type==="function_definition")&&e.children.length===1&&(0,v$.queryPythonIsDocstring)(e.parent))}async isEmptyBlockStart(e,r){if(r>e.length)throw new RangeError("Invalid offset");for(let s=r;sg.type===";")&&f.endIndex<=r}f=f.parent}}let c=null,l=null,u=null,d=s;for(;d!==null;){if(d.type===this.blockNodeType){l=d;break}if(this.nodeMatch[d.type]){u=d;break}if(d.type==="ERROR"){c=d;break}d=d.parent}if(l!==null){if(!l.parent||!this.nodeMatch[l.parent.type])return!1;if(this.languageId==="python"){let f=l.previousSibling;if(f!==null&&f.hasError&&(f.text.startsWith('"""')||f.text.startsWith("'''")))return!0}return this.isBlockEmpty(l,r)}if(c!==null){if(c.previousSibling?.type==="module"||c.previousSibling?.type==="internal_module"||c.previousSibling?.type==="def")return!0;if(this.languageId==="python"&&o>=14&&c.hasError&&(c.text.startsWith('"')||c.text.startsWith("'"))){let g=c.parent?.type;if(g==="function_definition"||g==="class_definition"||g==="module")return!0}let f=[...c.children].reverse(),h=f.find(g=>this.startKeywords.includes(g.type)),m=f.find(g=>g.type===this.blockNodeType);if(h){switch(this.languageId){case"python":{h.type==="try"&&s.type==="identifier"&&s.text.length>4&&(m=f.find(y=>y.hasError)?.children.find(y=>y.type==="block"));let g,A=0;for(let y of c.children){if(y.type===":"&&A===0){g=y;break}y.type==="("&&(A+=1),y.type===")"&&(A-=1)}if(g&&h.endIndex<=g.startIndex&&g.nextSibling){if(h.type==="def"){let y=g.nextSibling;if(y.type==='"'||y.type==="'"||y.type==="ERROR"&&(y.text==='"""'||y.text==="'''"))return!0}return!1}break}case"javascript":{if(h.type==="class")if(o<=13){if(f.find(E=>E.type==="formal_parameters"))return!0}else{let y=c.children;for(let E=0;Ey.type==="{");if(g&&g.startIndex>h.endIndex&&g.nextSibling!==null||f.find(y=>y.type==="do")&&h.type==="while"||h.type==="=>"&&h.nextSibling&&h.nextSibling.type!=="{")return!1;break}case"typescript":{let g=f.find(y=>y.type==="{");if(g&&g.startIndex>h.endIndex&&g.nextSibling!==null||f.find(y=>y.type==="do")&&h.type==="while"||h.type==="=>"&&h.nextSibling&&h.nextSibling.type!=="{")return!1;break}}return m&&m.startIndex>h.endIndex?this.isBlockEmpty(m,r):!0}}if(u!==null){let f=this.nodeMatch[u.type],h=u.children.slice().reverse().find(m=>m.type===f);if(h)return this.isBlockEmpty(h,r);if(this.nodeTypesWithBlockOrStmtChild.has(u.type)){let m=this.nodeTypesWithBlockOrStmtChild.get(u.type),g=m===""?u.children[0]:u.childForFieldName(m);if(g&&g.type!==this.blockNodeType&&g.type!==this.emptyStatementType)return!1}return!0}return!1}finally{n.delete()}}},WYa={python:new iL("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new iL("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new iL("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),tsx:new iL("typescriptreact",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new Fyt("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new Fyt("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map),"c-sharp":new iL("csharp",{},new Map([]),[],"block",null,!0),java:new iL("java",{},new Map([]),[],"block",null,!0),php:new iL("php",{},new Map([]),[],"block",null,!0),cpp:new iL("cpp",{},new Map([]),[],"block",null,!0)};function Uyt(t){if(!(0,v$.isSupportedLanguageId)(t))throw new Error(`Language ${t} is not supported`);return WYa[(0,v$.languageIdToWasmLanguage)(t)]}a(Uyt,"getBlockParser");async function zYa(t,e,r){return(0,v$.isSupportedLanguageId)(t)?Uyt(t).isEmptyBlockStart(e,r):!1}a(zYa,"isEmptyBlockStart");async function YYa(t,e,r,n){if((0,v$.isSupportedLanguageId)(t))return Uyt(t).isBlockBodyFinished(e,r,n)}a(YYa,"isBlockBodyFinished");async function KYa(t,e,r){if((0,v$.isSupportedLanguageId)(t))return Uyt(t).getNodeStart(e,r)}a(KYa,"getNodeStart")});var jyt=I(C$=>{"use strict";p();Object.defineProperty(C$,"__esModule",{value:!0});C$.parsingBlockFinished=JYa;C$.isEmptyBlockStartUtil=ZYa;C$.getNodeStartUtil=XYa;C$.contextIndentation=nKa;C$.contextIndentationFromText=wNi;C$.indentationBlockFinished=sKa;var lxr=xNi(),qyt=PAe();function JYa(t,e){let r=t.getText(qyt.LocationFactory.range(qyt.LocationFactory.position(0,0),e)),n=t.offsetAt(e),o=t.detectedLanguageId;return s=>(0,lxr.isBlockBodyFinished)(o,r,s,n)}a(JYa,"parsingBlockFinished");function ZYa(t,e){return(0,lxr.isEmptyBlockStart)(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(ZYa,"isEmptyBlockStartUtil");async function XYa(t,e,r){let o=t.getText(qyt.LocationFactory.range(qyt.LocationFactory.position(0,0),e))+r,s=await(0,lxr.getNodeStart)(t.detectedLanguageId,o,t.offsetAt(e));if(s)return t.positionAt(s)}a(XYa,"getNodeStartUtil");var eKa=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),tKa=new RegExp(`^(${eKa.join("|")})`);function rKa(t){return tKa.test(t.trimLeft().toLowerCase())}a(rKa,"isContinuationLine");function Qyt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(Qyt,"indentationOfLine");function nKa(t,e){let r=t.getText(),n=t.offsetAt(e);return wNi(r,n,t.detectedLanguageId)}a(nKa,"contextIndentation");function wNi(t,e,r){let n=t.slice(0,e).split(` `),o=t.slice(e).split(` -`);function s(f,h,m){let g=h,A,y;for(;A===void 0&&g>=0&&g=0&&!f[g].trim().startsWith('"""');)g--;if(g>=0)for(A=void 0,g--;A===void 0&&g>=0;)A=hyt(f[g]),y=g,g--}}return[A,y]}a(s,"seekNonBlank");let[c,l]=s(n,n.length-1,-1),u=(()=>{if(!(c===void 0||l===void 0))for(let f=l-1;f>=0;f--){let h=hyt(n[f]);if(h!==void 0&&h=0&&g=0&&!f[g].trim().startsWith('"""');)g--;if(g>=0)for(A=void 0,g--;A===void 0&&g>=0;)A=Qyt(f[g]),y=g,g--}}return[A,y]}a(s,"seekNonBlank");let[c,l]=s(n,n.length-1,-1),u=(()=>{if(!(c===void 0||l===void 0))for(let f=l-1;f>=0;f--){let h=Qyt(n[f]);if(h!==void 0&&h{let n=OWa(r,t,e);return n==="continue"?void 0:n}}a(LWa,"indentationBlockFinished")});var k4e=I(Yg=>{"use strict";p();Object.defineProperty(Yg,"__esModule",{value:!0});Yg.languageMarkers=void 0;Yg.mdCodeBlockLangToLanguageId=BWa;Yg.isShebangLine=QWa;Yg.hasLanguageMarker=F2i;Yg.comment=U2i;Yg.commentBlockAsSingles=qWa;Yg.getLanguageMarker=jWa;Yg.getPathMarker=HWa;Yg.newLineEnded=GWa;Yg.getLanguage=$Wa;Yg.languageMarkers={abap:{lineComment:{start:'"',end:""},markdownLanguageIds:["abap","sap-abap"]},aspdotnet:{lineComment:{start:"<%--",end:"--%>"}},bat:{lineComment:{start:"REM",end:""}},bibtex:{lineComment:{start:"%",end:""},markdownLanguageIds:["bibtex"]},blade:{lineComment:{start:"#",end:""}},BluespecSystemVerilog:{lineComment:{start:"//",end:""}},c:{lineComment:{start:"//",end:""},markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";",end:""},markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["coffeescript","coffee","cson","iced"]},cpp:{lineComment:{start:"//",end:""},markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"]},csharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["csharp","cs"]},css:{lineComment:{start:"/*",end:"*/"}},cuda:{lineComment:{start:"//",end:""}},dart:{lineComment:{start:"//",end:""}},dockerfile:{lineComment:{start:"#",end:""},markdownLanguageIds:["dockerfile","docker"]},dotenv:{lineComment:{start:"#",end:""}},elixir:{lineComment:{start:"#",end:""}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%",end:""},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"]},go:{lineComment:{start:"//",end:""},markdownLanguageIds:["go","golang"]},graphql:{lineComment:{start:"#",end:""}},groovy:{lineComment:{start:"//",end:""}},haml:{lineComment:{start:"-#",end:""}},handlebars:{lineComment:{start:"{{!",end:"}}"},markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"]},haskell:{lineComment:{start:"--",end:""},markdownLanguageIds:["haskell","hs"]},hlsl:{lineComment:{start:"//",end:""}},html:{lineComment:{start:""},markdownLanguageIds:["html","xhtml"]},ini:{lineComment:{start:";",end:""}},java:{lineComment:{start:"//",end:""},markdownLanguageIds:["java","jsp"]},javascript:{lineComment:{start:"//",end:""},markdownLanguageIds:["javascript","js"]},javascriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},jsonc:{lineComment:{start:"//",end:""}},jsx:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#",end:""},markdownLanguageIds:["julia","jl"]},kotlin:{lineComment:{start:"//",end:""},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%",end:""},markdownLanguageIds:["tex"]},legend:{lineComment:{start:"//",end:""}},less:{lineComment:{start:"//",end:""}},lua:{lineComment:{start:"--",end:""},markdownLanguageIds:["lua","pluto"]},makefile:{lineComment:{start:"#",end:""},markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:"[]: #",end:""},markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec","mm","objc","obj-c"]},"objective-cpp":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#",end:""},markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//",end:""}},powershell:{lineComment:{start:"#",end:""},markdownLanguageIds:["powershell","ps","ps1"]},pug:{lineComment:{start:"//",end:""}},python:{lineComment:{start:"#",end:""},markdownLanguageIds:["python","py","gyp"]},ql:{lineComment:{start:"//",end:""}},r:{lineComment:{start:"#",end:""}},razor:{lineComment:{start:""},markdownLanguageIds:["cshtml","razor","razor-cshtml"]},ruby:{lineComment:{start:"#",end:""},markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"]},rust:{lineComment:{start:"//",end:""},markdownLanguageIds:["rust","rs"]},sass:{lineComment:{start:"//",end:""}},scala:{lineComment:{start:"//",end:""}},scss:{lineComment:{start:"//",end:""}},shellscript:{lineComment:{start:"#",end:""},markdownLanguageIds:["bash","sh","zsh"]},slang:{lineComment:{start:"//",end:""}},slim:{lineComment:{start:"/",end:""}},solidity:{lineComment:{start:"//",end:""},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--",end:""}},stylus:{lineComment:{start:"//",end:""}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//",end:""}},systemverilog:{lineComment:{start:"//",end:""}},terraform:{lineComment:{start:"#",end:""}},tex:{lineComment:{start:"%",end:""}},typescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["typescript","ts"]},typescriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["tsx"]},vb:{lineComment:{start:"'",end:""},markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//",end:""}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//",end:""}},xml:{lineComment:{start:""}},xsl:{lineComment:{start:""}},yaml:{lineComment:{start:"#",end:""},markdownLanguageIds:["yaml","yml"]}};var AIr={};for(let[t,e]of Object.entries(Yg.languageMarkers))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)AIr[r]=t;else AIr[t]=t;function BWa(t){return AIr[t]}a(BWa,"mdCodeBlockLangToLanguageId");var FWa={start:"//",end:""},UWa=["php","plaintext"],yIr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function QWa(t){return Object.values(yIr).includes(t.trim())}a(QWa,"isShebangLine");function F2i({source:t}){return t.startsWith("#!")||t.startsWith("{let n=oKa(r,t,e);return n==="continue"?void 0:n}}a(sKa,"indentationBlockFinished")});var X4e=I(Xg=>{"use strict";p();Object.defineProperty(Xg,"__esModule",{value:!0});Xg.languageMarkers=void 0;Xg.mdCodeBlockLangToLanguageId=aKa;Xg.isShebangLine=uKa;Xg.hasLanguageMarker=kNi;Xg.comment=PNi;Xg.commentBlockAsSingles=dKa;Xg.getLanguageMarker=fKa;Xg.getPathMarker=pKa;Xg.newLineEnded=hKa;Xg.getLanguage=mKa;Xg.languageMarkers={abap:{lineComment:{start:'"',end:""},markdownLanguageIds:["abap","sap-abap"]},aspdotnet:{lineComment:{start:"<%--",end:"--%>"}},bat:{lineComment:{start:"REM",end:""}},bibtex:{lineComment:{start:"%",end:""},markdownLanguageIds:["bibtex"]},blade:{lineComment:{start:"#",end:""}},BluespecSystemVerilog:{lineComment:{start:"//",end:""}},c:{lineComment:{start:"//",end:""},markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";",end:""},markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["coffeescript","coffee","cson","iced"]},cpp:{lineComment:{start:"//",end:""},markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"]},csharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["csharp","cs"]},css:{lineComment:{start:"/*",end:"*/"}},cuda:{lineComment:{start:"//",end:""}},dart:{lineComment:{start:"//",end:""}},dockerfile:{lineComment:{start:"#",end:""},markdownLanguageIds:["dockerfile","docker"]},dotenv:{lineComment:{start:"#",end:""}},elixir:{lineComment:{start:"#",end:""}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%",end:""},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"]},go:{lineComment:{start:"//",end:""},markdownLanguageIds:["go","golang"]},graphql:{lineComment:{start:"#",end:""}},groovy:{lineComment:{start:"//",end:""}},haml:{lineComment:{start:"-#",end:""}},handlebars:{lineComment:{start:"{{!",end:"}}"},markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"]},haskell:{lineComment:{start:"--",end:""},markdownLanguageIds:["haskell","hs"]},hlsl:{lineComment:{start:"//",end:""}},html:{lineComment:{start:""},markdownLanguageIds:["html","xhtml"]},ini:{lineComment:{start:";",end:""}},java:{lineComment:{start:"//",end:""},markdownLanguageIds:["java","jsp"]},javascript:{lineComment:{start:"//",end:""},markdownLanguageIds:["javascript","js"]},javascriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},jsonc:{lineComment:{start:"//",end:""}},jsx:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#",end:""},markdownLanguageIds:["julia","jl"]},kotlin:{lineComment:{start:"//",end:""},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%",end:""},markdownLanguageIds:["tex"]},legend:{lineComment:{start:"//",end:""}},less:{lineComment:{start:"//",end:""}},lua:{lineComment:{start:"--",end:""},markdownLanguageIds:["lua","pluto"]},makefile:{lineComment:{start:"#",end:""},markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:"[]: #",end:""},markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec","mm","objc","obj-c"]},"objective-cpp":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#",end:""},markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//",end:""}},powershell:{lineComment:{start:"#",end:""},markdownLanguageIds:["powershell","ps","ps1"]},pug:{lineComment:{start:"//",end:""}},python:{lineComment:{start:"#",end:""},markdownLanguageIds:["python","py","gyp"]},ql:{lineComment:{start:"//",end:""}},r:{lineComment:{start:"#",end:""}},razor:{lineComment:{start:""},markdownLanguageIds:["cshtml","razor","razor-cshtml"]},ruby:{lineComment:{start:"#",end:""},markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"]},rust:{lineComment:{start:"//",end:""},markdownLanguageIds:["rust","rs"]},sass:{lineComment:{start:"//",end:""}},scala:{lineComment:{start:"//",end:""}},scss:{lineComment:{start:"//",end:""}},shellscript:{lineComment:{start:"#",end:""},markdownLanguageIds:["bash","sh","zsh"]},slang:{lineComment:{start:"//",end:""}},slim:{lineComment:{start:"/",end:""}},solidity:{lineComment:{start:"//",end:""},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--",end:""}},stylus:{lineComment:{start:"//",end:""}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//",end:""}},systemverilog:{lineComment:{start:"//",end:""}},terraform:{lineComment:{start:"#",end:""}},tex:{lineComment:{start:"%",end:""}},typescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["typescript","ts"]},typescriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["tsx"]},vb:{lineComment:{start:"'",end:""},markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//",end:""}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//",end:""}},xml:{lineComment:{start:""}},xsl:{lineComment:{start:""}},yaml:{lineComment:{start:"#",end:""},markdownLanguageIds:["yaml","yml"]}};var uxr={};for(let[t,e]of Object.entries(Xg.languageMarkers))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)uxr[r]=t;else uxr[t]=t;function aKa(t){return uxr[t]}a(aKa,"mdCodeBlockLangToLanguageId");var cKa={start:"//",end:""},lKa=["php","plaintext"],dxr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function uKa(t){return Object.values(dxr).includes(t.trim())}a(uKa,"isShebangLine");function kNi({source:t}){return t.startsWith("#!")||t.startsWith("U2i(s,e)).join(` +`).map(s=>PNi(s,e)).join(` `);return r?o+` -`:o}a(qWa,"commentBlockAsSingles");function jWa(t){let{languageId:e}=t;return UWa.indexOf(e)===-1&&!F2i(t)?e in yIr?yIr[e]:`Language: ${e}`:""}a(jWa,"getLanguageMarker");function HWa(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(HWa,"getPathMarker");function GWa(t){return t===""||t.endsWith(` +`:o}a(dKa,"commentBlockAsSingles");function fKa(t){let{languageId:e}=t;return lKa.indexOf(e)===-1&&!kNi(t)?e in dxr?dxr[e]:`Language: ${e}`:""}a(fKa,"getLanguageMarker");function pKa(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(pKa,"getPathMarker");function hKa(t){return t===""||t.endsWith(` `)?t:t+` -`}a(GWa,"newLineEnded");function $Wa(t){return B2i(typeof t=="string"?t:"plaintext")}a($Wa,"getLanguage");function B2i(t){return Yg.languageMarkers[t]!==void 0?{languageId:t,...Yg.languageMarkers[t]}:{languageId:t,lineComment:{start:"//",end:""}}}a(B2i,"_getLanguage")});var _Ir=I(EIr=>{"use strict";p();Object.defineProperty(EIr,"__esModule",{value:!0});EIr.getCursorContext=zWa;var Q2i=Ore(),VWa={tokenizerName:Q2i.TokenizerName.o200k};function WWa(t){return{...VWa,...t}}a(WWa,"cursorContextOptions");function zWa(t,e={}){let r=WWa(e),n=(0,Q2i.getTokenizer)(r.tokenizerName);if(r.maxLineCount!==void 0&&r.maxLineCount<0)throw new Error("maxLineCount must be non-negative if defined");if(r.maxTokenLength!==void 0&&r.maxTokenLength<0)throw new Error("maxTokenLength must be non-negative if defined");if(r.maxLineCount===0||r.maxTokenLength===0)return{context:"",lineCount:0,tokenLength:0,tokenizerName:r.tokenizerName};let o=t.source.slice(0,t.offset);return r.maxLineCount!==void 0&&(o=o.split(` +`}a(hKa,"newLineEnded");function mKa(t){return RNi(typeof t=="string"?t:"plaintext")}a(mKa,"getLanguage");function RNi(t){return Xg.languageMarkers[t]!==void 0?{languageId:t,...Xg.languageMarkers[t]}:{languageId:t,lineComment:{start:"//",end:""}}}a(RNi,"_getLanguage")});var pxr=I(fxr=>{"use strict";p();Object.defineProperty(fxr,"__esModule",{value:!0});fxr.getCursorContext=yKa;var DNi=Gre(),gKa={tokenizerName:DNi.TokenizerName.o200k};function AKa(t){return{...gKa,...t}}a(AKa,"cursorContextOptions");function yKa(t,e={}){let r=AKa(e),n=(0,DNi.getTokenizer)(r.tokenizerName);if(r.maxLineCount!==void 0&&r.maxLineCount<0)throw new Error("maxLineCount must be non-negative if defined");if(r.maxTokenLength!==void 0&&r.maxTokenLength<0)throw new Error("maxTokenLength must be non-negative if defined");if(r.maxLineCount===0||r.maxTokenLength===0)return{context:"",lineCount:0,tokenLength:0,tokenizerName:r.tokenizerName};let o=t.source.slice(0,t.offset);return r.maxLineCount!==void 0&&(o=o.split(` `).slice(-r.maxLineCount).join(` `)),r.maxTokenLength!==void 0&&(o=n.takeLastLinesTokens(o,r.maxTokenLength)),{context:o,lineCount:o.split(` -`).length,tokenLength:n.tokenLength(o),tokenizerName:r.tokenizerName}}a(zWa,"getCursorContext")});var vIr=I(jre=>{"use strict";p();Object.defineProperty(jre,"__esModule",{value:!0});jre.SnippetSemantics=jre.SnippetProviderType=void 0;jre.announceSnippet=KWa;var q2i;(function(t){t.SimilarFiles="similar-files",t.Path="path"})(q2i||(jre.SnippetProviderType=q2i={}));var a1;(function(t){t.Function="function",t.Snippet="snippet",t.Snippets="snippets",t.Variable="variable",t.Parameter="parameter",t.Method="method",t.Class="class",t.Module="module",t.Alias="alias",t.Enum="enum member",t.Interface="interface"})(a1||(jre.SnippetSemantics=a1={}));var YWa={[a1.Function]:"function",[a1.Snippet]:"snippet",[a1.Snippets]:"snippets",[a1.Variable]:"variable",[a1.Parameter]:"parameter",[a1.Method]:"method",[a1.Class]:"class",[a1.Module]:"module",[a1.Alias]:"alias",[a1.Enum]:"enum member",[a1.Interface]:"interface"};function KWa(t){let e=YWa[t.semantics],r=[a1.Snippets].includes(t.semantics)?"these":"this";return{headline:t.relativePath?`Compare ${r} ${e} from ${t.relativePath}:`:`Compare ${r} ${e}:`,snippet:t.snippet}}a(KWa,"announceSnippet")});var TIr=I(Gre=>{"use strict";p();Object.defineProperty(Gre,"__esModule",{value:!0});Gre.WindowedMatcher=Gre.SortOptions=void 0;Gre.splitIntoWords=G2i;var j2i=vIr(),CIr=class{static{a(this,"FifoCache")}constructor(e){this.keys=[],this.cache={},this.size=e}put(e,r){if(this.cache[e]=r,this.keys.length>this.size){this.keys.push(e);let n=this.keys.shift()??"";delete this.cache[n]}}get(e){return this.cache[e]}},Hre;(function(t){t.Ascending="ascending",t.Descending="descending",t.None="none"})(Hre||(Gre.SortOptions=Hre={}));var bIr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=XWa.get(e.languageId)??ZWa}tokenize(e){return new Set(G2i(e).filter(r=>!this.stopsForLanguage.has(r)))}},H2i=new CIr(20),SIr=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new bIr(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r=Hre.Descending){return r===Hre.Ascending?e.sort((n,o)=>n.score>o.score?1:-1):r===Hre.Descending?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r=Hre.Descending){let n=[];if(e.source.length===0||(await this.referenceTokens).size===0)return n;let o=e.source.split(` -`),s=this.id()+":"+e.source,c=H2i.get(s)??[],l=c.length===0,u=l?o.map(d=>this.tokenizer.tokenize(d),this.tokenizer):[];for(let[d,[f,h]]of this.getWindowsDelineations(o).entries()){if(l){let A=new Set;u.slice(f,h).forEach(y=>y.forEach(E=>A.add(E),A)),c.push(A)}let m=c[d],g=this.similarityScore(m,await this.referenceTokens);if(n.length&&f>0&&n[n.length-1].endLine>f){n[n.length-1].scoree.length>0)}a(G2i,"splitIntoWords");var JWa=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),ZWa=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...JWa]),XWa=new Map([])});var IIr=I(BR=>{"use strict";p();Object.defineProperty(BR,"__esModule",{value:!0});BR.virtualNode=eza;BR.lineNode=tza;BR.blankNode=rza;BR.topNode=nza;BR.isBlank=iza;BR.isLine=oza;BR.isVirtual=$2i;BR.isTop=V2i;BR.cutTreeAfterLine=sza;BR.duplicateTree=aza;function eza(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(eza,"virtualNode");function tza(t,e,r,n,o){if(r==="")throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:t,lineNumber:e,sourceLine:r,subs:n,label:o}}a(tza,"lineNode");function rza(t){return{type:"blank",lineNumber:t,subs:[]}}a(rza,"blankNode");function nza(t){return{type:"top",indentation:-1,subs:t??[]}}a(nza,"topNode");function iza(t){return t.type==="blank"}a(iza,"isBlank");function oza(t){return t.type==="line"}a(oza,"isLine");function $2i(t){return t.type==="virtual"}a($2i,"isVirtual");function V2i(t){return t.type==="top"}a(V2i,"isTop");function sza(t,e){function r(n){if(!$2i(n)&&!V2i(n)&&n.lineNumber===e)return n.subs=[],!0;for(let o=0;o{"use strict";p();Object.defineProperty(tL,"__esModule",{value:!0});tL.clearLabels=cza;tL.clearLabelsIf=lza;tL.mapLabels=wIr;tL.resetLineNumbers=uza;tL.visitTree=P4e;tL.visitTreeConditionally=dza;tL.foldTree=fza;tL.rebuildTree=pza;var xIr=IIr();function cza(t){return P4e(t,e=>{e.label=void 0},"bottomUp"),t}a(cza,"clearLabels");function lza(t,e){return P4e(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(lza,"clearLabelsIf");function wIr(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>wIr(n,e));return{...t,subs:r,label:t.label?e(t.label):void 0}}case"blank":return{...t,label:t.label?e(t.label):void 0};case"top":return{...t,subs:t.subs.map(r=>wIr(r,e)),label:t.label?e(t.label):void 0}}}a(wIr,"mapLabels");function uza(t){let e=0;function r(n){!(0,xIr.isVirtual)(n)&&!(0,xIr.isTop)(n)&&(n.lineNumber=e,e++)}a(r,"visitor"),P4e(t,r,"topDown")}a(uza,"resetLineNumbers");function P4e(t,e,r){function n(o){r==="topDown"&&e(o),o.subs.forEach(s=>{n(s)}),r==="bottomUp"&&e(o)}a(n,"_visit"),n(t)}a(P4e,"visitTree");function dza(t,e,r){function n(o){if(r==="topDown"&&!e(o))return!1;let s=!0;return o.subs.forEach(c=>{s=s&&n(c)}),r==="bottomUp"&&(s=s&&e(o)),s}a(n,"_visit"),n(t)}a(dza,"visitTreeConditionally");function fza(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),P4e(t,s,n),o}a(fza,"foldTree");function pza(t,e,r){let n=a(s=>{if(r!==void 0&&r(s))return s;{let c=s.subs.map(n).filter(l=>l!==void 0);return s.subs=c,e(s)}},"rebuild"),o=n(t);return o!==void 0?o:(0,xIr.topNode)()}a(pza,"rebuildTree")});var Z2i=I(DD=>{"use strict";p();Object.defineProperty(DD,"__esModule",{value:!0});DD.parseRaw=W2i;DD.labelLines=z2i;DD.labelVirtualInherited=hza;DD.buildLabelRules=Y2i;DD.combineClosersAndOpeners=K2i;DD.groupBlocks=mza;DD.flattenVirtual=gza;DD.registerLanguageSpecificParser=Eza;DD.parseTree=_za;var Kg=IIr(),RAe=RIr();function W2i(t){let e=t.split(` -`),r=e.map(d=>d.match(/^\s*/)[0].length),n=e.map(d=>d.trimLeft());function o(d){let[f,h]=s(d+1,r[d]);return[(0,Kg.lineNode)(r[d],d,n[d],f),h]}a(o,"parseNode");function s(d,f){let h,m=[],g=d,A;for(;gf);)if(n[g]==="")A===void 0&&(A=g),g+=1;else{if(A!==void 0){for(let y=A;ys.matches(n.sourceLine));o&&(n.label=o.label)}}a(r,"visitor"),(0,RAe.visitTree)(t,r,"bottomUp")}a(z2i,"labelLines");function hza(t){function e(r){if((0,Kg.isVirtual)(r)&&r.label===void 0){let n=r.subs.filter(o=>!(0,Kg.isBlank)(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),(0,RAe.visitTree)(t,e,"bottomUp")}a(hza,"labelVirtualInherited");function Y2i(t){return Object.keys(t).map(e=>{let r;return t[e].test?r=a(n=>t[e].test(n),"matches"):r=t[e],{matches:r,label:e}})}a(Y2i,"buildLabelRules");function K2i(t){let e=a(function(n){if(n.subs.length===0||n.subs.findIndex(c=>c.label==="closer"||c.label==="opener")===-1)return n;let o=[],s;for(let c=0;cu.subs.push(d)),l.subs=[];else if(l.label==="closer"&&s!==void 0&&((0,Kg.isLine)(l)||(0,Kg.isVirtual)(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&(0,Kg.isBlank)(o[d]);)d-=1;if(s.subs.push(...o.splice(d+1)),l.subs.length>0){let f=s.subs.findIndex(A=>A.label!=="newVirtual"),h=s.subs.slice(0,f),m=s.subs.slice(f),g=m.length>0?[(0,Kg.virtualNode)(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),(0,Kg.isBlank)(l)||(s=l)}return n.subs=o,n},"rebuilder"),r=(0,RAe.rebuildTree)(t,e);return(0,RAe.clearLabelsIf)(t,n=>n==="newVirtual"),r}a(K2i,"combineClosersAndOpeners");function mza(t,e=Kg.isBlank,r){let n=a(function(o){if(o.subs.length<=1)return o;let s=[],c=[],l,u=!1;function d(f=!1){if(l!==void 0&&(s.length>0||!f)){let h=(0,Kg.virtualNode)(l,c,r);s.push(h)}else c.forEach(h=>s.push(h))}a(d,"flushBlockIntoNewSubs");for(let f=0;f{"use strict";p();Object.defineProperty(Ayt,"__esModule",{value:!0});Ayt.getBasicWindowDelineations=Cza;Ayt.getIndentationWindowsDelineations=bza;var X2i=RIr(),vza=Z2i();function Cza(t,e){let r=[],n=e.length;if(n===0)return[];if(n{if(c.type==="blank"){c.label={totalLength:1,firstLineAfter:c.lineNumber+1};return}let l=c.type==="line"?1:0,u=c.type==="line"?c.lineNumber+1:NaN;function d(A){return A===-1?u-l:c.subs[A].label.firstLineAfter-c.subs[A].label.totalLength}a(d,"getStartLine");function f(A,y){return A===0?y+1:c.subs[A-1].label.firstLineAfter}a(f,"getEndLine");let h=c.type==="line"?-1:0,m=c.type==="line"?1:0,g=0;for(let A=0;A=0&&hn){let y=d(h),E=f(A,y),_=g===A?E:f(g,y);for(r<=E-y&&o.push([y,_]);m>n;)m-=h===-1?c.type==="line"?1:0:c.subs[h].label.totalLength,h++}}if(hc[0]-l[0]||c[1]-l[1]).filter((c,l,u)=>l===0||c[0]!==u[l-1][0]||c[1]!==u[l-1][1])}a(bza,"getIndentationWindowsDelineations")});var tDi=I(D4e=>{"use strict";p();Object.defineProperty(D4e,"__esModule",{value:!0});D4e.FixedWindowSizeJaccardMatcher=void 0;D4e.computeScore=eDi;var Sza=_Ir(),Tza=TIr(),Iza=kIr(),PIr=class t extends Tza.WindowedMatcher{static{a(this,"FixedWindowSizeJaccardMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=e=>({to:a(r=>new t(r,e),"to")})}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return(0,Iza.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,Sza.getCursorContext)(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return eDi(e,r)}};D4e.FixedWindowSizeJaccardMatcher=PIr;function eDi(t,e){let r=new Set;return t.forEach(n=>{e.has(n)&&r.add(n)}),r.size/(t.size+e.size-r.size)}a(eDi,"computeScore")});var nDi=I(yyt=>{"use strict";p();Object.defineProperty(yyt,"__esModule",{value:!0});yyt.BlockTokenSubsetMatcher=void 0;var xza=Qre(),rDi=_Ir(),wza=TIr(),Rza=kIr(),DIr=class t extends wza.WindowedMatcher{static{a(this,"BlockTokenSubsetMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=e=>({to:a(r=>new t(r,e),"to")})}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return(0,Rza.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,rDi.getCursorContext)(e,{maxLineCount:this.windowLength})}get referenceTokens(){return this.createReferenceTokensForLanguage()}async createReferenceTokensForLanguage(){return this.referenceTokensCache?this.referenceTokensCache:(this.referenceTokensCache=t.syntaxAwareSupportsLanguage(this.referenceDoc.languageId)?await this.syntaxAwareReferenceTokens():await super.referenceTokens,this.referenceTokensCache)}async syntaxAwareReferenceTokens(){let e=(await this.getEnclosingMemberStart(this.referenceDoc.source,this.referenceDoc.offset))?.startIndex,r=this.referenceDoc.offset,n=e?this.referenceDoc.source.slice(e,r):(0,rDi.getCursorContext)(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return kza(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await(0,xza.parseTreeSitter)(this.referenceDoc.languageId,e);let o=n.rootNode.namedDescendantForIndex(r);for(;o&&!(t.isMember(o)||t.isBlock(o));)o=o.parent??void 0;return o}finally{n?.delete()}}static isMember(e){switch(e?.type){case"method_declaration":case"property_declaration":case"field_declaration":case"constructor_declaration":return!0;default:return!1}}static isBlock(e){switch(e?.type){case"class_declaration":case"struct_declaration":case"record_declaration":case"enum_declaration":case"interface_declaration":return!0;default:return!1}}};yyt.BlockTokenSubsetMatcher=DIr;function kza(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(kza,"computeScore")});var Eyt=I(ND=>{"use strict";p();Object.defineProperty(ND,"__esModule",{value:!0});ND.defaultCppSimilarFilesOptions=ND.nullSimilarFilesOptions=ND.conservativeFilesOptions=ND.defaultSimilarFilesOptions=void 0;ND.getSimilarSnippets=Fza;var Pza=tDi(),Dza=nDi(),Nza=0,Mza=60,Oza=4,Lza=1,iDi=20,oDi=1e4;ND.defaultSimilarFilesOptions={snippetLength:Mza,threshold:Nza,maxTopSnippets:Oza,maxCharPerFile:oDi,maxNumberOfFiles:iDi,maxSnippetsPerFile:Lza,useSubsetMatching:!1};ND.conservativeFilesOptions={snippetLength:10,threshold:.3,maxTopSnippets:1,maxCharPerFile:oDi,maxNumberOfFiles:iDi,maxSnippetsPerFile:1};ND.nullSimilarFilesOptions={snippetLength:0,threshold:1,maxTopSnippets:0,maxCharPerFile:0,maxNumberOfFiles:0,maxSnippetsPerFile:0};ND.defaultCppSimilarFilesOptions={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function Bza(t,e){return(e.useSubsetMatching?Dza.BlockTokenSubsetMatcher.FACTORY(e.snippetLength):Pza.FixedWindowSizeJaccardMatcher.FACTORY(e.snippetLength)).to(t)}a(Bza,"getMatcher");async function Fza(t,e,r){let n=Bza(t,r);return r.maxTopSnippets===0?[]:(await e.filter(s=>s.source.length0).slice(0,r.maxNumberOfFiles).reduce(async(s,c)=>(await s).concat((await n.findMatches(c,r.maxSnippetsPerFile)).map(l=>({relativePath:c.relativePath,...l}))),Promise.resolve([]))).filter(s=>s.score&&s.snippet&&s.score>r.threshold).sort((s,c)=>s.score-c.score).slice(-r.maxTopSnippets)}a(Fza,"getSimilarSnippets")});var aDi=I(_yt=>{"use strict";p();Object.defineProperty(_yt,"__esModule",{value:!0});_yt.getCppSimilarFilesOptions=Qza;_yt.getCppNumberOfSnippets=qza;var sDi=Eyt(),Uza=vyt();function Qza(t,e){return{...sDi.defaultCppSimilarFilesOptions,useSubsetMatching:(0,Uza.useSubsetMatching)(t,e)}}a(Qza,"getCppSimilarFilesOptions");function qza(t){return sDi.defaultCppSimilarFilesOptions.maxTopSnippets}a(qza,"getCppNumberOfSnippets")});var vyt=I(N4e=>{"use strict";p();Object.defineProperty(N4e,"__esModule",{value:!0});N4e.getSimilarFilesOptions=Vza;N4e.getNumberOfSnippets=zza;N4e.useSubsetMatching=uDi;var jza=JG(),Hza=Eyt(),cDi=LE(),Gza=M0t(),lDi=aDi(),$za=new Map([["cpp",lDi.getCppSimilarFilesOptions]]);function Vza(t,e,r){let n=$za.get(r);return n?n(t,e):{...Hza.defaultSimilarFilesOptions,useSubsetMatching:uDi(t,e)}}a(Vza,"getSimilarFilesOptions");var Wza=new Map([["cpp",lDi.getCppNumberOfSnippets]]);function zza(t,e){let r=Wza.get(e);return r?r(t):jza.DEFAULT_NUM_SNIPPETS}a(zza,"getNumberOfSnippets");function uDi(t,e){return(e.filtersAndExp.exp.variables[Gza.ExpTreatmentVariables.UseSubsetMatching]||(0,cDi.getConfig)(t,cDi.ConfigKey.UseSubsetMatching))??!1}a(uDi,"useSubsetMatching")});var M4e=I($re=>{"use strict";p();Object.defineProperty($re,"__esModule",{value:!0});$re.convertToAPIChoice=Zza;$re.getTemperatureForSamples=tYa;$re.getStops=nYa;$re.getTopP=iYa;$re.getMaxSolutionTokens=oYa;var Yza=T0(),Kza=JG(),dDi=Dl(),Jza=$g();function Zza(t,e,r,n,o,s,c){return(0,Jza.logEngineCompletion)(t,e,r,o,n),{completionText:e,meanLogProb:Xza(t,r),meanAlternativeLogProb:eYa(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:(0,Yza.generateUuid)(),finishReason:r.finish_reason}}a(Zza,"convertToAPIChoice");function Xza(t,e){if(e?.logprobs?.token_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--)r+=e.logprobs.token_logprobs[s],n+=1;return n>0?r/n:void 0}catch(r){dDi.logger.exception(t,r,"Error calculating mean prob")}}a(Xza,"calculateMeanLogProb");function eYa(t,e){if(e?.logprobs?.top_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--){let c={...e.logprobs.top_logprobs[s]};delete c[e.logprobs.tokens[s]],r+=Math.max(...Object.values(c)),n+=1}return n>0?r/n:void 0}catch(r){dDi.logger.exception(t,r,"Error calculating mean prob")}}a(eYa,"calculateMeanAlternativeLogProb");function tYa(t,e){return t.isRunningInTest()||e<=1?0:e<10?.2:e<20?.4:.8}a(tYa,"getTemperatureForSamples");var rYa={markdown:[` +`).length,tokenLength:n.tokenLength(o),tokenizerName:r.tokenizerName}}a(yKa,"getCursorContext")});var hxr=I(Jre=>{"use strict";p();Object.defineProperty(Jre,"__esModule",{value:!0});Jre.SnippetSemantics=Jre.SnippetProviderType=void 0;Jre.announceSnippet=_Ka;var NNi;(function(t){t.SimilarFiles="similar-files",t.Path="path"})(NNi||(Jre.SnippetProviderType=NNi={}));var u1;(function(t){t.Function="function",t.Snippet="snippet",t.Snippets="snippets",t.Variable="variable",t.Parameter="parameter",t.Method="method",t.Class="class",t.Module="module",t.Alias="alias",t.Enum="enum member",t.Interface="interface"})(u1||(Jre.SnippetSemantics=u1={}));var EKa={[u1.Function]:"function",[u1.Snippet]:"snippet",[u1.Snippets]:"snippets",[u1.Variable]:"variable",[u1.Parameter]:"parameter",[u1.Method]:"method",[u1.Class]:"class",[u1.Module]:"module",[u1.Alias]:"alias",[u1.Enum]:"enum member",[u1.Interface]:"interface"};function _Ka(t){let e=EKa[t.semantics],r=[u1.Snippets].includes(t.semantics)?"these":"this";return{headline:t.relativePath?`Compare ${r} ${e} from ${t.relativePath}:`:`Compare ${r} ${e}:`,snippet:t.snippet}}a(_Ka,"announceSnippet")});var yxr=I(Xre=>{"use strict";p();Object.defineProperty(Xre,"__esModule",{value:!0});Xre.WindowedMatcher=Xre.SortOptions=void 0;Xre.splitIntoWords=LNi;var MNi=hxr(),mxr=class{static{a(this,"FifoCache")}constructor(e){this.keys=[],this.cache={},this.size=e}put(e,r){if(this.cache[e]=r,this.keys.length>this.size){this.keys.push(e);let n=this.keys.shift()??"";delete this.cache[n]}}get(e){return this.cache[e]}},Zre;(function(t){t.Ascending="ascending",t.Descending="descending",t.None="none"})(Zre||(Xre.SortOptions=Zre={}));var gxr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=bKa.get(e.languageId)??CKa}tokenize(e){return new Set(LNi(e).filter(r=>!this.stopsForLanguage.has(r)))}},ONi=new mxr(20),Axr=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new gxr(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r=Zre.Descending){return r===Zre.Ascending?e.sort((n,o)=>n.score>o.score?1:-1):r===Zre.Descending?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r=Zre.Descending){let n=[];if(e.source.length===0||(await this.referenceTokens).size===0)return n;let o=e.source.split(` +`),s=this.id()+":"+e.source,c=ONi.get(s)??[],l=c.length===0,u=l?o.map(d=>this.tokenizer.tokenize(d),this.tokenizer):[];for(let[d,[f,h]]of this.getWindowsDelineations(o).entries()){if(l){let A=new Set;u.slice(f,h).forEach(y=>y.forEach(E=>A.add(E),A)),c.push(A)}let m=c[d],g=this.similarityScore(m,await this.referenceTokens);if(n.length&&f>0&&n[n.length-1].endLine>f){n[n.length-1].scoree.length>0)}a(LNi,"splitIntoWords");var vKa=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),CKa=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...vKa]),bKa=new Map([])});var Exr=I(VR=>{"use strict";p();Object.defineProperty(VR,"__esModule",{value:!0});VR.virtualNode=SKa;VR.lineNode=TKa;VR.blankNode=IKa;VR.topNode=xKa;VR.isBlank=wKa;VR.isLine=RKa;VR.isVirtual=BNi;VR.isTop=FNi;VR.cutTreeAfterLine=kKa;VR.duplicateTree=PKa;function SKa(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(SKa,"virtualNode");function TKa(t,e,r,n,o){if(r==="")throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:t,lineNumber:e,sourceLine:r,subs:n,label:o}}a(TKa,"lineNode");function IKa(t){return{type:"blank",lineNumber:t,subs:[]}}a(IKa,"blankNode");function xKa(t){return{type:"top",indentation:-1,subs:t??[]}}a(xKa,"topNode");function wKa(t){return t.type==="blank"}a(wKa,"isBlank");function RKa(t){return t.type==="line"}a(RKa,"isLine");function BNi(t){return t.type==="virtual"}a(BNi,"isVirtual");function FNi(t){return t.type==="top"}a(FNi,"isTop");function kKa(t,e){function r(n){if(!BNi(n)&&!FNi(n)&&n.lineNumber===e)return n.subs=[],!0;for(let o=0;o{"use strict";p();Object.defineProperty(oL,"__esModule",{value:!0});oL.clearLabels=DKa;oL.clearLabelsIf=NKa;oL.mapLabels=vxr;oL.resetLineNumbers=MKa;oL.visitTree=eLe;oL.visitTreeConditionally=OKa;oL.foldTree=LKa;oL.rebuildTree=BKa;var _xr=Exr();function DKa(t){return eLe(t,e=>{e.label=void 0},"bottomUp"),t}a(DKa,"clearLabels");function NKa(t,e){return eLe(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(NKa,"clearLabelsIf");function vxr(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>vxr(n,e));return{...t,subs:r,label:t.label?e(t.label):void 0}}case"blank":return{...t,label:t.label?e(t.label):void 0};case"top":return{...t,subs:t.subs.map(r=>vxr(r,e)),label:t.label?e(t.label):void 0}}}a(vxr,"mapLabels");function MKa(t){let e=0;function r(n){!(0,_xr.isVirtual)(n)&&!(0,_xr.isTop)(n)&&(n.lineNumber=e,e++)}a(r,"visitor"),eLe(t,r,"topDown")}a(MKa,"resetLineNumbers");function eLe(t,e,r){function n(o){r==="topDown"&&e(o),o.subs.forEach(s=>{n(s)}),r==="bottomUp"&&e(o)}a(n,"_visit"),n(t)}a(eLe,"visitTree");function OKa(t,e,r){function n(o){if(r==="topDown"&&!e(o))return!1;let s=!0;return o.subs.forEach(c=>{s=s&&n(c)}),r==="bottomUp"&&(s=s&&e(o)),s}a(n,"_visit"),n(t)}a(OKa,"visitTreeConditionally");function LKa(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),eLe(t,s,n),o}a(LKa,"foldTree");function BKa(t,e,r){let n=a(s=>{if(r!==void 0&&r(s))return s;{let c=s.subs.map(n).filter(l=>l!==void 0);return s.subs=c,e(s)}},"rebuild"),o=n(t);return o!==void 0?o:(0,_xr.topNode)()}a(BKa,"rebuildTree")});var GNi=I(QD=>{"use strict";p();Object.defineProperty(QD,"__esModule",{value:!0});QD.parseRaw=UNi;QD.labelLines=QNi;QD.labelVirtualInherited=FKa;QD.buildLabelRules=qNi;QD.combineClosersAndOpeners=jNi;QD.groupBlocks=UKa;QD.flattenVirtual=QKa;QD.registerLanguageSpecificParser=HKa;QD.parseTree=GKa;var eA=Exr(),$Ae=Cxr();function UNi(t){let e=t.split(` +`),r=e.map(d=>d.match(/^\s*/)[0].length),n=e.map(d=>d.trimLeft());function o(d){let[f,h]=s(d+1,r[d]);return[(0,eA.lineNode)(r[d],d,n[d],f),h]}a(o,"parseNode");function s(d,f){let h,m=[],g=d,A;for(;gf);)if(n[g]==="")A===void 0&&(A=g),g+=1;else{if(A!==void 0){for(let y=A;ys.matches(n.sourceLine));o&&(n.label=o.label)}}a(r,"visitor"),(0,$Ae.visitTree)(t,r,"bottomUp")}a(QNi,"labelLines");function FKa(t){function e(r){if((0,eA.isVirtual)(r)&&r.label===void 0){let n=r.subs.filter(o=>!(0,eA.isBlank)(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),(0,$Ae.visitTree)(t,e,"bottomUp")}a(FKa,"labelVirtualInherited");function qNi(t){return Object.keys(t).map(e=>{let r;return t[e].test?r=a(n=>t[e].test(n),"matches"):r=t[e],{matches:r,label:e}})}a(qNi,"buildLabelRules");function jNi(t){let e=a(function(n){if(n.subs.length===0||n.subs.findIndex(c=>c.label==="closer"||c.label==="opener")===-1)return n;let o=[],s;for(let c=0;cu.subs.push(d)),l.subs=[];else if(l.label==="closer"&&s!==void 0&&((0,eA.isLine)(l)||(0,eA.isVirtual)(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&(0,eA.isBlank)(o[d]);)d-=1;if(s.subs.push(...o.splice(d+1)),l.subs.length>0){let f=s.subs.findIndex(A=>A.label!=="newVirtual"),h=s.subs.slice(0,f),m=s.subs.slice(f),g=m.length>0?[(0,eA.virtualNode)(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),(0,eA.isBlank)(l)||(s=l)}return n.subs=o,n},"rebuilder"),r=(0,$Ae.rebuildTree)(t,e);return(0,$Ae.clearLabelsIf)(t,n=>n==="newVirtual"),r}a(jNi,"combineClosersAndOpeners");function UKa(t,e=eA.isBlank,r){let n=a(function(o){if(o.subs.length<=1)return o;let s=[],c=[],l,u=!1;function d(f=!1){if(l!==void 0&&(s.length>0||!f)){let h=(0,eA.virtualNode)(l,c,r);s.push(h)}else c.forEach(h=>s.push(h))}a(d,"flushBlockIntoNewSubs");for(let f=0;f{"use strict";p();Object.defineProperty(Hyt,"__esModule",{value:!0});Hyt.getBasicWindowDelineations=VKa;Hyt.getIndentationWindowsDelineations=WKa;var $Ni=Cxr(),$Ka=GNi();function VKa(t,e){let r=[],n=e.length;if(n===0)return[];if(n{if(c.type==="blank"){c.label={totalLength:1,firstLineAfter:c.lineNumber+1};return}let l=c.type==="line"?1:0,u=c.type==="line"?c.lineNumber+1:NaN;function d(A){return A===-1?u-l:c.subs[A].label.firstLineAfter-c.subs[A].label.totalLength}a(d,"getStartLine");function f(A,y){return A===0?y+1:c.subs[A-1].label.firstLineAfter}a(f,"getEndLine");let h=c.type==="line"?-1:0,m=c.type==="line"?1:0,g=0;for(let A=0;A=0&&hn){let y=d(h),E=f(A,y),_=g===A?E:f(g,y);for(r<=E-y&&o.push([y,_]);m>n;)m-=h===-1?c.type==="line"?1:0:c.subs[h].label.totalLength,h++}}if(hc[0]-l[0]||c[1]-l[1]).filter((c,l,u)=>l===0||c[0]!==u[l-1][0]||c[1]!==u[l-1][1])}a(WKa,"getIndentationWindowsDelineations")});var WNi=I(tLe=>{"use strict";p();Object.defineProperty(tLe,"__esModule",{value:!0});tLe.FixedWindowSizeJaccardMatcher=void 0;tLe.computeScore=VNi;var zKa=pxr(),YKa=yxr(),KKa=bxr(),Sxr=class t extends YKa.WindowedMatcher{static{a(this,"FixedWindowSizeJaccardMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=e=>({to:a(r=>new t(r,e),"to")})}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return(0,KKa.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,zKa.getCursorContext)(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return VNi(e,r)}};tLe.FixedWindowSizeJaccardMatcher=Sxr;function VNi(t,e){let r=new Set;return t.forEach(n=>{e.has(n)&&r.add(n)}),r.size/(t.size+e.size-r.size)}a(VNi,"computeScore")});var YNi=I(Gyt=>{"use strict";p();Object.defineProperty(Gyt,"__esModule",{value:!0});Gyt.BlockTokenSubsetMatcher=void 0;var JKa=Yre(),zNi=pxr(),ZKa=yxr(),XKa=bxr(),Txr=class t extends ZKa.WindowedMatcher{static{a(this,"BlockTokenSubsetMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=e=>({to:a(r=>new t(r,e),"to")})}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return(0,XKa.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,zNi.getCursorContext)(e,{maxLineCount:this.windowLength})}get referenceTokens(){return this.createReferenceTokensForLanguage()}async createReferenceTokensForLanguage(){return this.referenceTokensCache?this.referenceTokensCache:(this.referenceTokensCache=t.syntaxAwareSupportsLanguage(this.referenceDoc.languageId)?await this.syntaxAwareReferenceTokens():await super.referenceTokens,this.referenceTokensCache)}async syntaxAwareReferenceTokens(){let e=(await this.getEnclosingMemberStart(this.referenceDoc.source,this.referenceDoc.offset))?.startIndex,r=this.referenceDoc.offset,n=e?this.referenceDoc.source.slice(e,r):(0,zNi.getCursorContext)(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return eJa(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await(0,JKa.parseTreeSitter)(this.referenceDoc.languageId,e);let o=n.rootNode.namedDescendantForIndex(r);for(;o&&!(t.isMember(o)||t.isBlock(o));)o=o.parent??void 0;return o}finally{n?.delete()}}static isMember(e){switch(e?.type){case"method_declaration":case"property_declaration":case"field_declaration":case"constructor_declaration":return!0;default:return!1}}static isBlock(e){switch(e?.type){case"class_declaration":case"struct_declaration":case"record_declaration":case"enum_declaration":case"interface_declaration":return!0;default:return!1}}};Gyt.BlockTokenSubsetMatcher=Txr;function eJa(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(eJa,"computeScore")});var $yt=I(qD=>{"use strict";p();Object.defineProperty(qD,"__esModule",{value:!0});qD.defaultCppSimilarFilesOptions=qD.nullSimilarFilesOptions=qD.conservativeFilesOptions=qD.defaultSimilarFilesOptions=void 0;qD.getSimilarSnippets=cJa;var tJa=WNi(),rJa=YNi(),nJa=0,iJa=60,oJa=4,sJa=1,KNi=20,JNi=1e4;qD.defaultSimilarFilesOptions={snippetLength:iJa,threshold:nJa,maxTopSnippets:oJa,maxCharPerFile:JNi,maxNumberOfFiles:KNi,maxSnippetsPerFile:sJa,useSubsetMatching:!1};qD.conservativeFilesOptions={snippetLength:10,threshold:.3,maxTopSnippets:1,maxCharPerFile:JNi,maxNumberOfFiles:KNi,maxSnippetsPerFile:1};qD.nullSimilarFilesOptions={snippetLength:0,threshold:1,maxTopSnippets:0,maxCharPerFile:0,maxNumberOfFiles:0,maxSnippetsPerFile:0};qD.defaultCppSimilarFilesOptions={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function aJa(t,e){return(e.useSubsetMatching?rJa.BlockTokenSubsetMatcher.FACTORY(e.snippetLength):tJa.FixedWindowSizeJaccardMatcher.FACTORY(e.snippetLength)).to(t)}a(aJa,"getMatcher");async function cJa(t,e,r){let n=aJa(t,r);return r.maxTopSnippets===0?[]:(await e.filter(s=>s.source.length0).slice(0,r.maxNumberOfFiles).reduce(async(s,c)=>(await s).concat((await n.findMatches(c,r.maxSnippetsPerFile)).map(l=>({relativePath:c.relativePath,...l}))),Promise.resolve([]))).filter(s=>s.score&&s.snippet&&s.score>r.threshold).sort((s,c)=>s.score-c.score).slice(-r.maxTopSnippets)}a(cJa,"getSimilarSnippets")});var XNi=I(Vyt=>{"use strict";p();Object.defineProperty(Vyt,"__esModule",{value:!0});Vyt.getCppSimilarFilesOptions=uJa;Vyt.getCppNumberOfSnippets=dJa;var ZNi=$yt(),lJa=Wyt();function uJa(t,e){return{...ZNi.defaultCppSimilarFilesOptions,useSubsetMatching:(0,lJa.useSubsetMatching)(t,e)}}a(uJa,"getCppSimilarFilesOptions");function dJa(t){return ZNi.defaultCppSimilarFilesOptions.maxTopSnippets}a(dJa,"getCppNumberOfSnippets")});var Wyt=I(rLe=>{"use strict";p();Object.defineProperty(rLe,"__esModule",{value:!0});rLe.getSimilarFilesOptions=gJa;rLe.getNumberOfSnippets=yJa;rLe.useSubsetMatching=rMi;var fJa=u$(),pJa=$yt(),eMi=qE(),hJa=sgt(),tMi=XNi(),mJa=new Map([["cpp",tMi.getCppSimilarFilesOptions]]);function gJa(t,e,r){let n=mJa.get(r);return n?n(t,e):{...pJa.defaultSimilarFilesOptions,useSubsetMatching:rMi(t,e)}}a(gJa,"getSimilarFilesOptions");var AJa=new Map([["cpp",tMi.getCppNumberOfSnippets]]);function yJa(t,e){let r=AJa.get(e);return r?r(t):fJa.DEFAULT_NUM_SNIPPETS}a(yJa,"getNumberOfSnippets");function rMi(t,e){return(e.filtersAndExp.exp.variables[hJa.ExpTreatmentVariables.UseSubsetMatching]||(0,eMi.getConfig)(t,eMi.ConfigKey.UseSubsetMatching))??!1}a(rMi,"useSubsetMatching")});var nLe=I(ene=>{"use strict";p();Object.defineProperty(ene,"__esModule",{value:!0});ene.convertToAPIChoice=CJa;ene.getTemperatureForSamples=TJa;ene.getStops=xJa;ene.getTopP=wJa;ene.getMaxSolutionTokens=RJa;var EJa=x0(),_Ja=u$(),nMi=Dl(),vJa=Yg();function CJa(t,e,r,n,o,s,c){return(0,vJa.logEngineCompletion)(t,e,r,o,n),{completionText:e,meanLogProb:bJa(t,r),meanAlternativeLogProb:SJa(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:(0,EJa.generateUuid)(),finishReason:r.finish_reason}}a(CJa,"convertToAPIChoice");function bJa(t,e){if(e?.logprobs?.token_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--)r+=e.logprobs.token_logprobs[s],n+=1;return n>0?r/n:void 0}catch(r){nMi.logger.exception(t,r,"Error calculating mean prob")}}a(bJa,"calculateMeanLogProb");function SJa(t,e){if(e?.logprobs?.top_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--){let c={...e.logprobs.top_logprobs[s]};delete c[e.logprobs.tokens[s]],r+=Math.max(...Object.values(c)),n+=1}return n>0?r/n:void 0}catch(r){nMi.logger.exception(t,r,"Error calculating mean prob")}}a(SJa,"calculateMeanAlternativeLogProb");function TJa(t,e){return t.isRunningInTest()||e<=1?0:e<10?.2:e<20?.4:.8}a(TJa,"getTemperatureForSamples");var IJa={markdown:[` `],python:[` @@ -986,31 +986,31 @@ def `,` class `,` if `,` -#`]};function nYa(t){return rYa[t??""]??[` +#`]};function xJa(t){return IJa[t??""]??[` -`,"\n```"]}a(nYa,"getStops");function iYa(){return 1}a(iYa,"getTopP");function oYa(){return Kza.DEFAULT_MAX_COMPLETION_LENGTH}a(oYa,"getMaxSolutionTokens")});var rL=I(O4e=>{"use strict";p();Object.defineProperty(O4e,"__esModule",{value:!0});O4e.Fragment=pDi;O4e.jsx=fDi;O4e.jsxs=fDi;function fDi(t,e,r){let n=[];Array.isArray(e.children)?n=e.children:e.children&&(n=[e.children]);let o={...e,children:n};return r&&(o.key=r),{type:t,props:o}}a(fDi,"functionComponentFunction");function pDi(t){return{type:"f",children:t}}a(pDi,"fragmentFunction");pDi.isFragmentFunction=!0});var MD=I(NIr=>{"use strict";p();Object.defineProperty(NIr,"__esModule",{value:!0});NIr.es5ClassCompat=sYa;function sYa(t){return Object.assign(t,{apply:a(function(...r){if(r.length===0)return Reflect.construct(t,[]);{let n=r.length===1?[]:r[1];return Reflect.construct(t,n,r[0].constructor)}},"apply"),call:a(function(...r){if(r.length===0)return Reflect.construct(t,[]);{let[n,...o]=r;return Reflect.construct(t,o,n.constructor)}},"call")})}a(sYa,"es5ClassCompat")});var kAe=I(Wre=>{"use strict";p();var aYa=Wre&&Wre.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Vre;Object.defineProperty(Wre,"__esModule",{value:!0});Wre.Position=void 0;var Cyt=Rs(),cYa=MD(),MIr=Vre=class{static{a(this,"Position")}static Min(...e){if(e.length===0)throw new TypeError;let r=e[0];for(let n=1;ne.line?1:this._charactere._character?1:0}translate(e,r=0){if(e===null||r===null)throw(0,Cyt.illegalArgument)();let n;return typeof e>"u"?n=0:typeof e=="number"?n=e:(n=typeof e.lineDelta=="number"?e.lineDelta:0,r=typeof e.characterDelta=="number"?e.characterDelta:0),n===0&&r===0?this:new Vre(this.line+n,this.character+r)}with(e,r=this.character){if(e===null||r===null)throw(0,Cyt.illegalArgument)();let n;return typeof e>"u"?n=this.line:typeof e=="number"?n=e:(n=typeof e.line=="number"?e.line:this.line,r=typeof e.character=="number"?e.character:this.character),n===this.line&&r===this.character?this:new Vre(n,r)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};Wre.Position=MIr;Wre.Position=MIr=Vre=aYa([cYa.es5ClassCompat],MIr)});var nL=I(u$=>{"use strict";p();var lYa=u$&&u$.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},T6;Object.defineProperty(u$,"__esModule",{value:!0});u$.Range=void 0;u$.getDebugDescriptionOfRange=hDi;var uYa=Rs(),dYa=MD(),Ov=kAe(),OIr=T6=class{static{a(this,"Range")}static isRange(e){return e instanceof T6?!0:!e||typeof e!="object"?!1:Ov.Position.isPosition(e.start)&&Ov.Position.isPosition(e.end)}static of(e){if(e instanceof T6)return e;if(this.isRange(e))return new T6(e.start,e.end);throw new Error("Invalid argument, is NOT a range-like object")}get start(){return this._start}get end(){return this._end}constructor(e,r,n,o){let s,c;if(typeof e=="number"&&typeof r=="number"&&typeof n=="number"&&typeof o=="number"?(s=new Ov.Position(e,r),c=new Ov.Position(n,o)):Ov.Position.isPosition(e)&&Ov.Position.isPosition(r)&&(s=Ov.Position.of(e),c=Ov.Position.of(r)),!s||!c)throw new Error("Invalid arguments");s.isBefore(c)?(this._start=s,this._end=c):(this._start=c,this._end=s)}contains(e){return T6.isRange(e)?this.contains(e.start)&&this.contains(e.end):Ov.Position.isPosition(e)?!(Ov.Position.of(e).isBefore(this._start)||this._end.isBefore(e)):!1}isEqual(e){return this._start.isEqual(e._start)&&this._end.isEqual(e._end)}intersection(e){let r=Ov.Position.Max(e.start,this._start),n=Ov.Position.Min(e.end,this._end);if(!r.isAfter(n))return new T6(r,n)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;let r=Ov.Position.Min(e.start,this._start),n=Ov.Position.Max(e.end,this.end);return new T6(r,n)}get isEmpty(){return this._start.isEqual(this._end)}get isSingleLine(){return this._start.line===this._end.line}with(e,r=this.end){if(e===null||r===null)throw(0,uYa.illegalArgument)();let n;return e?Ov.Position.isPosition(e)?n=e:(n=e.start||this.start,r=e.end||this.end):n=this.start,n.isEqual(this._start)&&r.isEqual(this.end)?this:new T6(n,r)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return hDi(this)}};u$.Range=OIr;u$.Range=OIr=T6=lYa([dYa.es5ClassCompat],OIr);function hDi(t){return t.isEmpty?`[${t.start.line}:${t.start.character})`:`[${t.start.line}:${t.start.character} -> ${t.end.line}:${t.end.character})`}a(hDi,"getDebugDescriptionOfRange")});var BIr=I(c1=>{"use strict";p();var ADi=c1&&c1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(c1,"__esModule",{value:!0});c1.Diagnostic=c1.DiagnosticRelatedInformation=c1.DiagnosticSeverity=c1.DiagnosticTag=void 0;var mDi=Sl(),fYa=nd(),yDi=MD(),EDi=nL(),gDi;(function(t){t[t.Unnecessary=1]="Unnecessary",t[t.Deprecated=2]="Deprecated"})(gDi||(c1.DiagnosticTag=gDi={}));var byt;(function(t){t[t.Hint=3]="Hint",t[t.Information=2]="Information",t[t.Warning=1]="Warning",t[t.Error=0]="Error"})(byt||(c1.DiagnosticSeverity=byt={}));var Syt=class{static{a(this,"DiagnosticRelatedInformation")}static is(e){return e?typeof e.message=="string"&&e.location&&EDi.Range.isRange(e.location.range)&&fYa.URI.isUri(e.location.uri):!1}constructor(e,r){this.location=e,this.message=r}static isEqual(e,r){return e===r?!0:!e||!r?!1:e.message===r.message&&e.location.range.isEqual(r.location.range)&&e.location.uri.toString()===r.location.uri.toString()}};c1.DiagnosticRelatedInformation=Syt;c1.DiagnosticRelatedInformation=Syt=ADi([yDi.es5ClassCompat],Syt);var LIr=class{static{a(this,"Diagnostic")}constructor(e,r,n=byt.Error){if(!EDi.Range.isRange(e))throw new TypeError("range must be set");if(!r)throw new TypeError("message must be set");this.range=e,this.message=r,this.severity=n}toJSON(){return{severity:byt[this.severity],message:this.message,range:this.range,source:this.source,code:this.code}}static isEqual(e,r){return e===r?!0:!e||!r?!1:e.message===r.message&&e.severity===r.severity&&e.code===r.code&&e.severity===r.severity&&e.source===r.source&&e.range.isEqual(r.range)&&(0,mDi.equals)(e.tags,r.tags)&&(0,mDi.equals)(e.relatedInformation,r.relatedInformation,Syt.isEqual)}};c1.Diagnostic=LIr;c1.Diagnostic=LIr=ADi([yDi.es5ClassCompat],LIr)});var QIr=I(zre=>{"use strict";p();var pYa=zre&&zre.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},FIr;Object.defineProperty(zre,"__esModule",{value:!0});zre.Location=void 0;var hYa=nd(),mYa=MD(),gYa=kAe(),Tyt=nL(),UIr=FIr=class{static{a(this,"Location")}static isLocation(e){return e instanceof FIr?!0:e?Tyt.Range.isRange(e.range)&&hYa.URI.isUri(e.uri):!1}constructor(e,r){if(this.uri=e,r)if(Tyt.Range.isRange(r))this.range=Tyt.Range.of(r);else if(gYa.Position.isPosition(r))this.range=new Tyt.Range(r,r);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};zre.Location=UIr;zre.Location=UIr=FIr=pYa([mYa.es5ClassCompat],UIr)});var _Di=I(GIr=>{"use strict";p();Object.defineProperty(GIr,"__esModule",{value:!0});GIr.getKoreanAltChars=AYa;function AYa(t){let e=yYa(t);if(e&&e.length>0)return new Uint32Array(e)}a(AYa,"getKoreanAltChars");var l1=0,d$=new Uint32Array(10);function yYa(t){if(l1=0,iL(t,qIr,4352),l1>0||(iL(t,jIr,4449),l1>0)||(iL(t,HIr,4520),l1>0)||(iL(t,Yre,12593),l1))return d$.subarray(0,l1);if(t>=44032&&t<=55203){let e=t-44032,r=e%588,n=Math.floor(e/588),o=Math.floor(r/28),s=r%28-1;if(n=0&&(s0)return d$.subarray(0,l1)}}a(yYa,"disassembleKorean");function iL(t,e,r){t>=r&&t>8&&(d$[l1++]=t>>8&255),t>>16&&(d$[l1++]=t>>16&255))}a(EYa,"addCodesToBuffer");var qIr=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),jIr=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),HIr=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),Yre=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108])});var bDi=I(PAe=>{"use strict";p();Object.defineProperty(PAe,"__esModule",{value:!0});PAe.tryNormalizeToBase=void 0;PAe.normalizeNFC=vYa;PAe.normalizeNFD=vDi;var $Ir=zP(),_Ya=new $Ir.LRUCache(1e4);function vYa(t){return CDi(t,"NFC",_Ya)}a(vYa,"normalizeNFC");var CYa=new $Ir.LRUCache(1e4);function vDi(t){return CDi(t,"NFD",CYa)}a(vDi,"normalizeNFD");var bYa=/[^\u0000-\u0080]/;function CDi(t,e,r){if(!t)return t;let n=r.get(t);if(n)return n;let o;return bYa.test(t)?o=t.normalize(e):o=t,r.set(t,o),o}a(CDi,"normalize");PAe.tryNormalizeToBase=(function(){let t=new $Ir.LRUCache(1e4),e=/[\u0300-\u036f]/g;return function(r){let n=t.get(r);if(n)return n;let o=vDi(r).replace(e,""),s=(o.length===r.length?o:r).toLowerCase();return t.set(r,s),s}})()});var HDi=I(dc=>{"use strict";p();var SYa=dc&&dc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),TYa=dc&&dc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),IYa=dc&&dc.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0?[{start:0,end:e.length}]:[]:null}a(kDi,"_matchesPrefix");function PDi(t,e){if(t.length>e.length)return null;let r=e.toLowerCase().indexOf(t.toLowerCase());return r===-1?null:[{start:r,end:r+t.length}]}a(PDi,"matchesContiguousSubString");function RYa(t,e){if(t.length>e.length)return null;t=(0,wyt.tryNormalizeToBase)(t),e=(0,wyt.tryNormalizeToBase)(e);let r=e.indexOf(t);return r===-1?null:[{start:r,end:r+t.length}]}a(RYa,"matchesBaseContiguousSubString");function DDi(t,e){return t.length>e.length?null:zIr(t.toLowerCase(),e.toLowerCase(),0,0)}a(DDi,"matchesSubString");function zIr(t,e,r,n){if(r===t.length)return[];if(n===e.length)return null;if(t[r]===e[n]){let o=null;return(o=zIr(t,e,r+1,n+1))?rxr({start:n,end:n+1},o):null}return zIr(t,e,r,n+1)}a(zIr,"_matchesSubString");function exr(t){return 97<=t&&t<=122}a(exr,"isLower");function F4e(t){return 65<=t&&t<=90}a(F4e,"isUpper");function txr(t){return 48<=t&&t<=57}a(txr,"isNumber");function NDi(t){return t===32||t===9||t===10||t===13}a(NDi,"isWhitespace");var MDi=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(t=>MDi.add(t.charCodeAt(0)));function Ryt(t){return NDi(t)||MDi.has(t)}a(Ryt,"isWordSeparator");function SDi(t,e){return t===e||Ryt(t)&&Ryt(e)}a(SDi,"charactersMatch");var VIr=new Map;function TDi(t){if(VIr.has(t))return VIr.get(t);let e,r=(0,wYa.getKoreanAltChars)(t);return r&&(e=r),VIr.set(t,e),e}a(TDi,"getAlternateCodes");function ODi(t){return exr(t)||F4e(t)||txr(t)}a(ODi,"isAlphanumeric");function rxr(t,e){return e.length===0?e=[t]:t.end===e[0].start?e[0].start=t.start:e.unshift(t),e}a(rxr,"join");function LDi(t,e){for(let r=e;r0&&!ODi(t.charCodeAt(r-1)))return r}return t.length}a(LDi,"nextAnchor");function YIr(t,e,r,n){if(r===t.length)return[];if(n===e.length)return null;if(t[r]!==e[n].toLowerCase())return null;{let o=null,s=n+1;for(o=YIr(t,e,r+1,n+1);!o&&(s=LDi(e,s)).6}a(PYa,"isUpperCaseWord");function DYa(t){let{upperPercent:e,lowerPercent:r,alphaPercent:n,numericPercent:o}=t;return r>.2&&e<.8&&n>.6&&o<.2}a(DYa,"isCamelCaseWord");function NYa(t){let e=0,r=0,n=0,o=0;for(let s=0;s60&&(e=e.substring(0,60));let r=kYa(e);if(!DYa(r)){if(!PYa(r))return null;e=e.toLowerCase()}let n=null,o=0;for(t=t.toLowerCase();o0&&Ryt(t.charCodeAt(r-1)))return r;return t.length}a(BDi,"nextWord");var LYa=XIr(dc.matchesPrefix,nxr,PDi),BYa=XIr(dc.matchesPrefix,nxr,DDi),xDi=new xYa.LRUCache(1e4);function FYa(t,e,r=!1){if(typeof t!="string"||typeof e!="string")return null;let n=xDi.get(t);n||(n=new RegExp(ZIr.convertSimple2RegExpPattern(t),"i"),xDi.set(t,n));let o=n.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:r?BYa(t,e):LYa(t,e)}a(FYa,"matchesFuzzy");function UYa(t,e){let r=B4e(t,t.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?FDi(r):null}a(UYa,"matchesFuzzy2");function QYa(t,e,r,n,o,s){let c=Math.min(13,t.length);for(;r"u")return[];let e=[],r=t[1];for(let n=t.length-1;n>1;n--){let o=t[n]+r,s=e[e.length-1];s&&s.end===o?s.end=o+1:e.push({start:o,end:o+1})}return e}a(FDi,"createMatches");var p$=128;function ixr(){let t=[],e=[];for(let r=0;r<=p$;r++)e[r]=0;for(let r=0;r<=p$;r++)t.push(e.slice(0));return t}a(ixr,"initTable");function UDi(t){let e=[];for(let r=0;r<=t;r++)e[r]=0;return e}a(UDi,"initArr");var QDi=UDi(2*p$),JIr=UDi(2*p$),oL=ixr(),f$=ixr(),L4e=ixr(),qYa=!1;function WIr(t,e,r,n,o){function s(l,u,d=" "){for(;l.lengths(l,3)).join("|")} +`,"\n```"]}a(xJa,"getStops");function wJa(){return 1}a(wJa,"getTopP");function RJa(){return _Ja.DEFAULT_MAX_COMPLETION_LENGTH}a(RJa,"getMaxSolutionTokens")});var sL=I(iLe=>{"use strict";p();Object.defineProperty(iLe,"__esModule",{value:!0});iLe.Fragment=oMi;iLe.jsx=iMi;iLe.jsxs=iMi;function iMi(t,e,r){let n=[];Array.isArray(e.children)?n=e.children:e.children&&(n=[e.children]);let o={...e,children:n};return r&&(o.key=r),{type:t,props:o}}a(iMi,"functionComponentFunction");function oMi(t){return{type:"f",children:t}}a(oMi,"fragmentFunction");oMi.isFragmentFunction=!0});var jD=I(Ixr=>{"use strict";p();Object.defineProperty(Ixr,"__esModule",{value:!0});Ixr.es5ClassCompat=kJa;function kJa(t){return Object.assign(t,{apply:a(function(...r){if(r.length===0)return Reflect.construct(t,[]);{let n=r.length===1?[]:r[1];return Reflect.construct(t,n,r[0].constructor)}},"apply"),call:a(function(...r){if(r.length===0)return Reflect.construct(t,[]);{let[n,...o]=r;return Reflect.construct(t,o,n.constructor)}},"call")})}a(kJa,"es5ClassCompat")});var VAe=I(rne=>{"use strict";p();var PJa=rne&&rne.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},tne;Object.defineProperty(rne,"__esModule",{value:!0});rne.Position=void 0;var zyt=Rs(),DJa=jD(),xxr=tne=class{static{a(this,"Position")}static Min(...e){if(e.length===0)throw new TypeError;let r=e[0];for(let n=1;ne.line?1:this._charactere._character?1:0}translate(e,r=0){if(e===null||r===null)throw(0,zyt.illegalArgument)();let n;return typeof e>"u"?n=0:typeof e=="number"?n=e:(n=typeof e.lineDelta=="number"?e.lineDelta:0,r=typeof e.characterDelta=="number"?e.characterDelta:0),n===0&&r===0?this:new tne(this.line+n,this.character+r)}with(e,r=this.character){if(e===null||r===null)throw(0,zyt.illegalArgument)();let n;return typeof e>"u"?n=this.line:typeof e=="number"?n=e:(n=typeof e.line=="number"?e.line:this.line,r=typeof e.character=="number"?e.character:this.character),n===this.line&&r===this.character?this:new tne(n,r)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};rne.Position=xxr;rne.Position=xxr=tne=PJa([DJa.es5ClassCompat],xxr)});var aL=I(b$=>{"use strict";p();var NJa=b$&&b$.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},B6;Object.defineProperty(b$,"__esModule",{value:!0});b$.Range=void 0;b$.getDebugDescriptionOfRange=sMi;var MJa=Rs(),OJa=jD(),Fv=VAe(),wxr=B6=class{static{a(this,"Range")}static isRange(e){return e instanceof B6?!0:!e||typeof e!="object"?!1:Fv.Position.isPosition(e.start)&&Fv.Position.isPosition(e.end)}static of(e){if(e instanceof B6)return e;if(this.isRange(e))return new B6(e.start,e.end);throw new Error("Invalid argument, is NOT a range-like object")}get start(){return this._start}get end(){return this._end}constructor(e,r,n,o){let s,c;if(typeof e=="number"&&typeof r=="number"&&typeof n=="number"&&typeof o=="number"?(s=new Fv.Position(e,r),c=new Fv.Position(n,o)):Fv.Position.isPosition(e)&&Fv.Position.isPosition(r)&&(s=Fv.Position.of(e),c=Fv.Position.of(r)),!s||!c)throw new Error("Invalid arguments");s.isBefore(c)?(this._start=s,this._end=c):(this._start=c,this._end=s)}contains(e){return B6.isRange(e)?this.contains(e.start)&&this.contains(e.end):Fv.Position.isPosition(e)?!(Fv.Position.of(e).isBefore(this._start)||this._end.isBefore(e)):!1}isEqual(e){return this._start.isEqual(e._start)&&this._end.isEqual(e._end)}intersection(e){let r=Fv.Position.Max(e.start,this._start),n=Fv.Position.Min(e.end,this._end);if(!r.isAfter(n))return new B6(r,n)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;let r=Fv.Position.Min(e.start,this._start),n=Fv.Position.Max(e.end,this.end);return new B6(r,n)}get isEmpty(){return this._start.isEqual(this._end)}get isSingleLine(){return this._start.line===this._end.line}with(e,r=this.end){if(e===null||r===null)throw(0,MJa.illegalArgument)();let n;return e?Fv.Position.isPosition(e)?n=e:(n=e.start||this.start,r=e.end||this.end):n=this.start,n.isEqual(this._start)&&r.isEqual(this.end)?this:new B6(n,r)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return sMi(this)}};b$.Range=wxr;b$.Range=wxr=B6=NJa([OJa.es5ClassCompat],wxr);function sMi(t){return t.isEmpty?`[${t.start.line}:${t.start.character})`:`[${t.start.line}:${t.start.character} -> ${t.end.line}:${t.end.character})`}a(sMi,"getDebugDescriptionOfRange")});var kxr=I(d1=>{"use strict";p();var lMi=d1&&d1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(d1,"__esModule",{value:!0});d1.Diagnostic=d1.DiagnosticRelatedInformation=d1.DiagnosticSeverity=d1.DiagnosticTag=void 0;var aMi=Sl(),LJa=ad(),uMi=jD(),dMi=aL(),cMi;(function(t){t[t.Unnecessary=1]="Unnecessary",t[t.Deprecated=2]="Deprecated"})(cMi||(d1.DiagnosticTag=cMi={}));var Yyt;(function(t){t[t.Hint=3]="Hint",t[t.Information=2]="Information",t[t.Warning=1]="Warning",t[t.Error=0]="Error"})(Yyt||(d1.DiagnosticSeverity=Yyt={}));var Kyt=class{static{a(this,"DiagnosticRelatedInformation")}static is(e){return e?typeof e.message=="string"&&e.location&&dMi.Range.isRange(e.location.range)&&LJa.URI.isUri(e.location.uri):!1}constructor(e,r){this.location=e,this.message=r}static isEqual(e,r){return e===r?!0:!e||!r?!1:e.message===r.message&&e.location.range.isEqual(r.location.range)&&e.location.uri.toString()===r.location.uri.toString()}};d1.DiagnosticRelatedInformation=Kyt;d1.DiagnosticRelatedInformation=Kyt=lMi([uMi.es5ClassCompat],Kyt);var Rxr=class{static{a(this,"Diagnostic")}constructor(e,r,n=Yyt.Error){if(!dMi.Range.isRange(e))throw new TypeError("range must be set");if(!r)throw new TypeError("message must be set");this.range=e,this.message=r,this.severity=n}toJSON(){return{severity:Yyt[this.severity],message:this.message,range:this.range,source:this.source,code:this.code}}static isEqual(e,r){return e===r?!0:!e||!r?!1:e.message===r.message&&e.severity===r.severity&&e.code===r.code&&e.severity===r.severity&&e.source===r.source&&e.range.isEqual(r.range)&&(0,aMi.equals)(e.tags,r.tags)&&(0,aMi.equals)(e.relatedInformation,r.relatedInformation,Kyt.isEqual)}};d1.Diagnostic=Rxr;d1.Diagnostic=Rxr=lMi([uMi.es5ClassCompat],Rxr)});var Nxr=I(nne=>{"use strict";p();var BJa=nne&&nne.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Pxr;Object.defineProperty(nne,"__esModule",{value:!0});nne.Location=void 0;var FJa=ad(),UJa=jD(),QJa=VAe(),Jyt=aL(),Dxr=Pxr=class{static{a(this,"Location")}static isLocation(e){return e instanceof Pxr?!0:e?Jyt.Range.isRange(e.range)&&FJa.URI.isUri(e.uri):!1}constructor(e,r){if(this.uri=e,r)if(Jyt.Range.isRange(r))this.range=Jyt.Range.of(r);else if(QJa.Position.isPosition(r))this.range=new Jyt.Range(r,r);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};nne.Location=Dxr;nne.Location=Dxr=Pxr=BJa([UJa.es5ClassCompat],Dxr)});var fMi=I(Bxr=>{"use strict";p();Object.defineProperty(Bxr,"__esModule",{value:!0});Bxr.getKoreanAltChars=qJa;function qJa(t){let e=jJa(t);if(e&&e.length>0)return new Uint32Array(e)}a(qJa,"getKoreanAltChars");var f1=0,S$=new Uint32Array(10);function jJa(t){if(f1=0,cL(t,Mxr,4352),f1>0||(cL(t,Oxr,4449),f1>0)||(cL(t,Lxr,4520),f1>0)||(cL(t,ine,12593),f1))return S$.subarray(0,f1);if(t>=44032&&t<=55203){let e=t-44032,r=e%588,n=Math.floor(e/588),o=Math.floor(r/28),s=r%28-1;if(n=0&&(s0)return S$.subarray(0,f1)}}a(jJa,"disassembleKorean");function cL(t,e,r){t>=r&&t>8&&(S$[f1++]=t>>8&255),t>>16&&(S$[f1++]=t>>16&255))}a(HJa,"addCodesToBuffer");var Mxr=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),Oxr=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),Lxr=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),ine=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108])});var mMi=I(WAe=>{"use strict";p();Object.defineProperty(WAe,"__esModule",{value:!0});WAe.tryNormalizeToBase=void 0;WAe.normalizeNFC=$Ja;WAe.normalizeNFD=pMi;var Fxr=r2(),GJa=new Fxr.LRUCache(1e4);function $Ja(t){return hMi(t,"NFC",GJa)}a($Ja,"normalizeNFC");var VJa=new Fxr.LRUCache(1e4);function pMi(t){return hMi(t,"NFD",VJa)}a(pMi,"normalizeNFD");var WJa=/[^\u0000-\u0080]/;function hMi(t,e,r){if(!t)return t;let n=r.get(t);if(n)return n;let o;return WJa.test(t)?o=t.normalize(e):o=t,r.set(t,o),o}a(hMi,"normalize");WAe.tryNormalizeToBase=(function(){let t=new Fxr.LRUCache(1e4),e=/[\u0300-\u036f]/g;return function(r){let n=t.get(r);if(n)return n;let o=pMi(r).replace(e,""),s=(o.length===r.length?o:r).toLowerCase();return t.set(r,s),s}})()});var OMi=I(pc=>{"use strict";p();var zJa=pc&&pc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),YJa=pc&&pc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),KJa=pc&&pc.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0?[{start:0,end:e.length}]:[]:null}a(CMi,"_matchesPrefix");function bMi(t,e){if(t.length>e.length)return null;let r=e.toLowerCase().indexOf(t.toLowerCase());return r===-1?null:[{start:r,end:r+t.length}]}a(bMi,"matchesContiguousSubString");function XJa(t,e){if(t.length>e.length)return null;t=(0,eEt.tryNormalizeToBase)(t),e=(0,eEt.tryNormalizeToBase)(e);let r=e.indexOf(t);return r===-1?null:[{start:r,end:r+t.length}]}a(XJa,"matchesBaseContiguousSubString");function SMi(t,e){return t.length>e.length?null:qxr(t.toLowerCase(),e.toLowerCase(),0,0)}a(SMi,"matchesSubString");function qxr(t,e,r,n){if(r===t.length)return[];if(n===e.length)return null;if(t[r]===e[n]){let o=null;return(o=qxr(t,e,r+1,n+1))?Yxr({start:n,end:n+1},o):null}return qxr(t,e,r,n+1)}a(qxr,"_matchesSubString");function Wxr(t){return 97<=t&&t<=122}a(Wxr,"isLower");function aLe(t){return 65<=t&&t<=90}a(aLe,"isUpper");function zxr(t){return 48<=t&&t<=57}a(zxr,"isNumber");function TMi(t){return t===32||t===9||t===10||t===13}a(TMi,"isWhitespace");var IMi=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(t=>IMi.add(t.charCodeAt(0)));function tEt(t){return TMi(t)||IMi.has(t)}a(tEt,"isWordSeparator");function gMi(t,e){return t===e||tEt(t)&&tEt(e)}a(gMi,"charactersMatch");var Uxr=new Map;function AMi(t){if(Uxr.has(t))return Uxr.get(t);let e,r=(0,ZJa.getKoreanAltChars)(t);return r&&(e=r),Uxr.set(t,e),e}a(AMi,"getAlternateCodes");function xMi(t){return Wxr(t)||aLe(t)||zxr(t)}a(xMi,"isAlphanumeric");function Yxr(t,e){return e.length===0?e=[t]:t.end===e[0].start?e[0].start=t.start:e.unshift(t),e}a(Yxr,"join");function wMi(t,e){for(let r=e;r0&&!xMi(t.charCodeAt(r-1)))return r}return t.length}a(wMi,"nextAnchor");function jxr(t,e,r,n){if(r===t.length)return[];if(n===e.length)return null;if(t[r]!==e[n].toLowerCase())return null;{let o=null,s=n+1;for(o=jxr(t,e,r+1,n+1);!o&&(s=wMi(e,s)).6}a(tZa,"isUpperCaseWord");function rZa(t){let{upperPercent:e,lowerPercent:r,alphaPercent:n,numericPercent:o}=t;return r>.2&&e<.8&&n>.6&&o<.2}a(rZa,"isCamelCaseWord");function nZa(t){let e=0,r=0,n=0,o=0;for(let s=0;s60&&(e=e.substring(0,60));let r=eZa(e);if(!rZa(r)){if(!tZa(r))return null;e=e.toLowerCase()}let n=null,o=0;for(t=t.toLowerCase();o0&&tEt(t.charCodeAt(r-1)))return r;return t.length}a(RMi,"nextWord");var sZa=Vxr(pc.matchesPrefix,Kxr,bMi),aZa=Vxr(pc.matchesPrefix,Kxr,SMi),EMi=new JJa.LRUCache(1e4);function cZa(t,e,r=!1){if(typeof t!="string"||typeof e!="string")return null;let n=EMi.get(t);n||(n=new RegExp($xr.convertSimple2RegExpPattern(t),"i"),EMi.set(t,n));let o=n.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:r?aZa(t,e):sZa(t,e)}a(cZa,"matchesFuzzy");function lZa(t,e){let r=sLe(t,t.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?kMi(r):null}a(lZa,"matchesFuzzy2");function uZa(t,e,r,n,o,s){let c=Math.min(13,t.length);for(;r"u")return[];let e=[],r=t[1];for(let n=t.length-1;n>1;n--){let o=t[n]+r,s=e[e.length-1];s&&s.end===o?s.end=o+1:e.push({start:o,end:o+1})}return e}a(kMi,"createMatches");var I$=128;function Jxr(){let t=[],e=[];for(let r=0;r<=I$;r++)e[r]=0;for(let r=0;r<=I$;r++)t.push(e.slice(0));return t}a(Jxr,"initTable");function PMi(t){let e=[];for(let r=0;r<=t;r++)e[r]=0;return e}a(PMi,"initArr");var DMi=PMi(2*I$),Gxr=PMi(2*I$),lL=Jxr(),T$=Jxr(),oLe=Jxr(),dZa=!1;function Qxr(t,e,r,n,o){function s(l,u,d=" "){for(;l.lengths(l,3)).join("|")} `;for(let l=0;l<=r;l++)l===0?c+=" |":c+=`${e[l-1]}|`,c+=t[l].slice(0,o+1).map(u=>s(u.toString(),3)).join("|")+` -`;return c}a(WIr,"printTable");function jYa(t,e,r,n){t=t.substr(e),r=r.substr(n),console.log(WIr(f$,t,t.length,r,r.length)),console.log(WIr(L4e,t,t.length,r,r.length)),console.log(WIr(oL,t,t.length,r,r.length))}a(jYa,"printTables");function Iyt(t,e){if(e<0||e>=t.length)return!1;let r=t.codePointAt(e);switch(r){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!ZIr.isEmojiImprecise(r)}}a(Iyt,"isSeparatorAtPos");function wDi(t,e){if(e<0||e>=t.length)return!1;switch(t.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}a(wDi,"isWhitespaceAtPos");function xyt(t,e,r){return e[t]!==r[t]}a(xyt,"isUpperCaseAtPos");function qDi(t,e,r,n,o,s,c=!1){for(;ep$?p$:t.length,u=n.length>p$?p$:n.length;if(r>=l||s>=u||l-r>u-s||!qDi(e,r,l,o,s,u,!0))return;HYa(l,u,r,s,e,o);let d=1,f=1,h=r,m=s,g=[!1];for(d=1,h=r;hv,D=P?f$[d][f-1]+(oL[d][f-1]>0?-5:0):0,N=m>v+1&&oL[d][f-1]>0,L=N?f$[d][f-2]+(oL[d][f-2]>0?-5:0):0;if(N&&(!P||L>=D)&&(!R||L>=x))f$[d][f]=L,L4e[d][f]=3,oL[d][f]=0;else if(P&&(!R||D>=x))f$[d][f]=D,L4e[d][f]=2,oL[d][f]=0;else if(R)f$[d][f]=x,L4e[d][f]=1,oL[d][f]=oL[d-1][f-1]+1;else throw new Error("not possible")}}if(qYa&&jYa(t,r,n,s),!g[0]&&!c.firstMatchCanBeWeak)return;d--,f--;let A=[f$[d][f],s],y=0,E=0;for(;d>=1;){let v=f;do{let b=L4e[d][v];if(b===3)v=v-2;else if(b===2)v=v-1;else break}while(v>=1);y>1&&e[r+d-1]===o[s+f-1]&&!xyt(v+s-1,n,o)&&y+1>oL[d][v]&&(v=f),v===f?y++:y=1,E||(E=v),d--,f=v-1,A.push(f)}u-s===l&&c.boostFullMatch&&(A[0]+=2);let _=E-l;return A[0]-=_,A}a(B4e,"fuzzyScore");function HYa(t,e,r,n,o,s){let c=t-1,l=e-1;for(;c>=r&&l>=n;)o[c]===s[l]&&(JIr[c]=l,c--),l--}a(HYa,"_fillInMaxWordMatchPos");function GYa(t,e,r,n,o,s,c,l,u,d,f){if(e[r]!==s[c])return Number.MIN_SAFE_INTEGER;let h=1,m=!1;return c===r-n?h=t[r]===o[c]?7:5:xyt(c,o,s)&&(c===0||!xyt(c-1,o,s))?(h=t[r]===o[c]?7:5,m=!0):Iyt(s,c)&&(c===0||!Iyt(s,c-1))?h=5:(Iyt(s,c-1)||wDi(s,c-1))&&(h=5,m=!0),h>1&&r===n&&(f[0]=!0),m||(m=xyt(c,o,s)||Iyt(s,c-1)||wDi(s,c-1)),r===n?c>u&&(h-=m?3:5):d?h+=m?2:0:h+=m?0:1,c+1===l&&(h-=m?3:5),h}a(GYa,"_doScore");function $Ya(t,e,r,n,o,s,c){return jDi(t,e,r,n,o,s,!0,c)}a($Ya,"fuzzyScoreGracefulAggressive");function VYa(t,e,r,n,o,s,c){return jDi(t,e,r,n,o,s,!1,c)}a(VYa,"fuzzyScoreGraceful");function jDi(t,e,r,n,o,s,c,l){let u=B4e(t,e,r,n,o,s,l);if(u&&!c)return u;if(t.length>=3){let d=Math.min(7,t.length-1);for(let f=r+1;fu[0])&&(u=m))}}}return u}a(jDi,"fuzzyScoreWithPermutations");function WYa(t,e){if(e+1>=t.length)return;let r=t[e],n=t[e+1];if(r!==n)return t.slice(0,e)+n+r+t.slice(e+2)}a(WYa,"nextTypoPermutation")});var $Di=I(h$=>{"use strict";p();Object.defineProperty(h$,"__esModule",{value:!0});h$.escapeIcons=JYa;h$.markdownEscapeEscapedIcons=XYa;h$.stripIcons=tKa;h$.getCodiconAriaLabel=rKa;h$.parseLabelWithIcons=nKa;h$.matchesFuzzyIconAware=iKa;var GDi=HDi(),zYa=em(),sxr=R0r(),YYa="$(",axr=new RegExp(`\\$\\(${sxr.ThemeIcon.iconNameExpression}(?:${sxr.ThemeIcon.iconModifierExpression})?\\)`,"g"),KYa=new RegExp(`(\\\\)?${axr.source}`,"g");function JYa(t){return t.replace(KYa,(e,r)=>r?e:`\\${e}`)}a(JYa,"escapeIcons");var ZYa=new RegExp(`\\\\${axr.source}`,"g");function XYa(t){return t.replace(ZYa,e=>`\\${e}`)}a(XYa,"markdownEscapeEscapedIcons");var eKa=new RegExp(`(\\s)?(\\\\)?${axr.source}(\\s)?`,"g");function tKa(t){return t.indexOf(YYa)===-1?t:t.replace(eKa,(e,r,n,o)=>n?e:r||o||"")}a(tKa,"stripIcons");function rKa(t){return t?t.replace(/\$\((.*?)\)/g,(e,r)=>` ${r} `).trim():""}a(rKa,"getCodiconAriaLabel");var oxr=new RegExp(`\\$\\(${sxr.ThemeIcon.iconNameCharacter}+\\)`,"g");function nKa(t){oxr.lastIndex=0;let e="",r=[],n=0;for(;;){let o=oxr.lastIndex,s=oxr.exec(t),c=t.substring(o,s?.index);if(c.length>0){e+=c;for(let l=0;l{"use strict";p();Object.defineProperty(Ay,"__esModule",{value:!0});Ay.MarkdownString=void 0;Ay.isEmptyMarkdownString=VDi;Ay.isMarkdownString=WDi;Ay.markdownStringEqual=uKa;Ay.escapeMarkdownSyntaxTokens=Nyt;Ay.escapeMarkdownLinkLabel=dKa;Ay.appendEscapedMarkdownCodeBlockFence=zDi;Ay.appendEscapedMarkdownInlineCode=fKa;Ay.escapeDoubleQuotes=pKa;Ay.removeMarkdownEscapes=hKa;Ay.parseHrefAndDimensions=mKa;Ay.createMarkdownLink=YDi;Ay.createMarkdownCommandLink=gKa;Ay.createCommandUri=KDi;var oKa=Rs(),sKa=$Di(),aKa=tJ(),cKa=ZP(),lKa=em(),Pyt=nd(),Dyt=class t{static{a(this,"MarkdownString")}static lift(e){let r=new t(e.value,e);return r.uris=e.uris,r.baseUri=e.baseUri?Pyt.URI.revive(e.baseUri):void 0,r}constructor(e="",r=!1){if(this.value=e,typeof this.value!="string")throw(0,oKa.illegalArgument)("value");typeof r=="boolean"?(this.isTrusted=r,this.supportThemeIcons=!1,this.supportHtml=!1,this.supportAlertSyntax=!1):(this.isTrusted=r.isTrusted??void 0,this.supportThemeIcons=r.supportThemeIcons??!1,this.supportHtml=r.supportHtml??!1,this.supportAlertSyntax=r.supportAlertSyntax??!1)}appendText(e,r=0){return this.value+=Nyt(this.supportThemeIcons?(0,sKa.escapeIcons)(e):e).replace(/([ \t]+)/g,(n,o)=>" ".repeat(o.length)).replace(/\>/gm,"\\>").replace(/\n/g,r===1?`\\ +`;return c}a(Qxr,"printTable");function fZa(t,e,r,n){t=t.substr(e),r=r.substr(n),console.log(Qxr(T$,t,t.length,r,r.length)),console.log(Qxr(oLe,t,t.length,r,r.length)),console.log(Qxr(lL,t,t.length,r,r.length))}a(fZa,"printTables");function Zyt(t,e){if(e<0||e>=t.length)return!1;let r=t.codePointAt(e);switch(r){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!$xr.isEmojiImprecise(r)}}a(Zyt,"isSeparatorAtPos");function _Mi(t,e){if(e<0||e>=t.length)return!1;switch(t.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}a(_Mi,"isWhitespaceAtPos");function Xyt(t,e,r){return e[t]!==r[t]}a(Xyt,"isUpperCaseAtPos");function NMi(t,e,r,n,o,s,c=!1){for(;eI$?I$:t.length,u=n.length>I$?I$:n.length;if(r>=l||s>=u||l-r>u-s||!NMi(e,r,l,o,s,u,!0))return;pZa(l,u,r,s,e,o);let d=1,f=1,h=r,m=s,g=[!1];for(d=1,h=r;hv,D=P?T$[d][f-1]+(lL[d][f-1]>0?-5:0):0,N=m>v+1&&lL[d][f-1]>0,L=N?T$[d][f-2]+(lL[d][f-2]>0?-5:0):0;if(N&&(!P||L>=D)&&(!R||L>=x))T$[d][f]=L,oLe[d][f]=3,lL[d][f]=0;else if(P&&(!R||D>=x))T$[d][f]=D,oLe[d][f]=2,lL[d][f]=0;else if(R)T$[d][f]=x,oLe[d][f]=1,lL[d][f]=lL[d-1][f-1]+1;else throw new Error("not possible")}}if(dZa&&fZa(t,r,n,s),!g[0]&&!c.firstMatchCanBeWeak)return;d--,f--;let A=[T$[d][f],s],y=0,E=0;for(;d>=1;){let v=f;do{let b=oLe[d][v];if(b===3)v=v-2;else if(b===2)v=v-1;else break}while(v>=1);y>1&&e[r+d-1]===o[s+f-1]&&!Xyt(v+s-1,n,o)&&y+1>lL[d][v]&&(v=f),v===f?y++:y=1,E||(E=v),d--,f=v-1,A.push(f)}u-s===l&&c.boostFullMatch&&(A[0]+=2);let _=E-l;return A[0]-=_,A}a(sLe,"fuzzyScore");function pZa(t,e,r,n,o,s){let c=t-1,l=e-1;for(;c>=r&&l>=n;)o[c]===s[l]&&(Gxr[c]=l,c--),l--}a(pZa,"_fillInMaxWordMatchPos");function hZa(t,e,r,n,o,s,c,l,u,d,f){if(e[r]!==s[c])return Number.MIN_SAFE_INTEGER;let h=1,m=!1;return c===r-n?h=t[r]===o[c]?7:5:Xyt(c,o,s)&&(c===0||!Xyt(c-1,o,s))?(h=t[r]===o[c]?7:5,m=!0):Zyt(s,c)&&(c===0||!Zyt(s,c-1))?h=5:(Zyt(s,c-1)||_Mi(s,c-1))&&(h=5,m=!0),h>1&&r===n&&(f[0]=!0),m||(m=Xyt(c,o,s)||Zyt(s,c-1)||_Mi(s,c-1)),r===n?c>u&&(h-=m?3:5):d?h+=m?2:0:h+=m?0:1,c+1===l&&(h-=m?3:5),h}a(hZa,"_doScore");function mZa(t,e,r,n,o,s,c){return MMi(t,e,r,n,o,s,!0,c)}a(mZa,"fuzzyScoreGracefulAggressive");function gZa(t,e,r,n,o,s,c){return MMi(t,e,r,n,o,s,!1,c)}a(gZa,"fuzzyScoreGraceful");function MMi(t,e,r,n,o,s,c,l){let u=sLe(t,e,r,n,o,s,l);if(u&&!c)return u;if(t.length>=3){let d=Math.min(7,t.length-1);for(let f=r+1;fu[0])&&(u=m))}}}return u}a(MMi,"fuzzyScoreWithPermutations");function AZa(t,e){if(e+1>=t.length)return;let r=t[e],n=t[e+1];if(r!==n)return t.slice(0,e)+n+r+t.slice(e+2)}a(AZa,"nextTypoPermutation")});var BMi=I(x$=>{"use strict";p();Object.defineProperty(x$,"__esModule",{value:!0});x$.escapeIcons=vZa;x$.markdownEscapeEscapedIcons=bZa;x$.stripIcons=TZa;x$.getCodiconAriaLabel=IZa;x$.parseLabelWithIcons=xZa;x$.matchesFuzzyIconAware=wZa;var LMi=OMi(),yZa=om(),Xxr=egr(),EZa="$(",ewr=new RegExp(`\\$\\(${Xxr.ThemeIcon.iconNameExpression}(?:${Xxr.ThemeIcon.iconModifierExpression})?\\)`,"g"),_Za=new RegExp(`(\\\\)?${ewr.source}`,"g");function vZa(t){return t.replace(_Za,(e,r)=>r?e:`\\${e}`)}a(vZa,"escapeIcons");var CZa=new RegExp(`\\\\${ewr.source}`,"g");function bZa(t){return t.replace(CZa,e=>`\\${e}`)}a(bZa,"markdownEscapeEscapedIcons");var SZa=new RegExp(`(\\s)?(\\\\)?${ewr.source}(\\s)?`,"g");function TZa(t){return t.indexOf(EZa)===-1?t:t.replace(SZa,(e,r,n,o)=>n?e:r||o||"")}a(TZa,"stripIcons");function IZa(t){return t?t.replace(/\$\((.*?)\)/g,(e,r)=>` ${r} `).trim():""}a(IZa,"getCodiconAriaLabel");var Zxr=new RegExp(`\\$\\(${Xxr.ThemeIcon.iconNameCharacter}+\\)`,"g");function xZa(t){Zxr.lastIndex=0;let e="",r=[],n=0;for(;;){let o=Zxr.lastIndex,s=Zxr.exec(t),c=t.substring(o,s?.index);if(c.length>0){e+=c;for(let l=0;l{"use strict";p();Object.defineProperty(vy,"__esModule",{value:!0});vy.MarkdownString=void 0;vy.isEmptyMarkdownString=FMi;vy.isMarkdownString=UMi;vy.markdownStringEqual=MZa;vy.escapeMarkdownSyntaxTokens=oEt;vy.escapeMarkdownLinkLabel=OZa;vy.appendEscapedMarkdownCodeBlockFence=QMi;vy.appendEscapedMarkdownInlineCode=LZa;vy.escapeDoubleQuotes=BZa;vy.removeMarkdownEscapes=FZa;vy.parseHrefAndDimensions=UZa;vy.createMarkdownLink=qMi;vy.createMarkdownCommandLink=QZa;vy.createCommandUri=jMi;var RZa=Rs(),kZa=BMi(),PZa=dJ(),DZa=s2(),NZa=om(),nEt=ad(),iEt=class t{static{a(this,"MarkdownString")}static lift(e){let r=new t(e.value,e);return r.uris=e.uris,r.baseUri=e.baseUri?nEt.URI.revive(e.baseUri):void 0,r}constructor(e="",r=!1){if(this.value=e,typeof this.value!="string")throw(0,RZa.illegalArgument)("value");typeof r=="boolean"?(this.isTrusted=r,this.supportThemeIcons=!1,this.supportHtml=!1,this.supportAlertSyntax=!1):(this.isTrusted=r.isTrusted??void 0,this.supportThemeIcons=r.supportThemeIcons??!1,this.supportHtml=r.supportHtml??!1,this.supportAlertSyntax=r.supportAlertSyntax??!1)}appendText(e,r=0){return this.value+=oEt(this.supportThemeIcons?(0,kZa.escapeIcons)(e):e).replace(/([ \t]+)/g,(n,o)=>" ".repeat(o.length)).replace(/\>/gm,"\\>").replace(/\n/g,r===1?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,r){return this.value+=` -${zDi(r,e)} -`,this}appendLink(e,r,n){return this.value+="[",this.value+=this._escape(r,"]"),this.value+="](",this.value+=this._escape(String(e),")"),n&&(this.value+=` "${this._escape(this._escape(n,'"'),")")}"`),this.value+=")",this}_escape(e,r){let n=new RegExp((0,lKa.escapeRegExpCharacters)(r),"g");return e.replace(n,(o,s)=>e.charAt(s-1)!=="\\"?`\\${o}`:o)}};Ay.MarkdownString=Dyt;function VDi(t){return WDi(t)?!t.value:Array.isArray(t)?t.every(VDi):!0}a(VDi,"isEmptyMarkdownString");function WDi(t){return t instanceof Dyt?!0:t&&typeof t=="object"?typeof t.value=="string"&&(typeof t.isTrusted=="boolean"||typeof t.isTrusted=="object"||t.isTrusted===void 0)&&(typeof t.supportThemeIcons=="boolean"||t.supportThemeIcons===void 0)&&(typeof t.supportAlertSyntax=="boolean"||t.supportAlertSyntax===void 0):!1}a(WDi,"isMarkdownString");function uKa(t,e){return t===e?!0:!t||!e?!1:t.value===e.value&&t.isTrusted===e.isTrusted&&t.supportThemeIcons===e.supportThemeIcons&&t.supportHtml===e.supportHtml&&t.supportAlertSyntax===e.supportAlertSyntax&&(t.baseUri===e.baseUri||!!t.baseUri&&!!e.baseUri&&(0,cKa.isEqual)(Pyt.URI.from(t.baseUri),Pyt.URI.from(e.baseUri)))}a(uKa,"markdownStringEqual");function Nyt(t){return t.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}a(Nyt,"escapeMarkdownSyntaxTokens");function dKa(t){return t.replace(/[\\\]]/g,"\\$&")}a(dKa,"escapeMarkdownLinkLabel");function zDi(t,e){let r=t.match(/^`+/gm)?.reduce((o,s)=>o.length>s.length?o:s).length??0,n=r>=3?r+1:3;return[`${"`".repeat(n)}${e}`,t,`${"`".repeat(n)}`].join(` -`)}a(zDi,"appendEscapedMarkdownCodeBlockFence");function fKa(t){let e=Math.max(0,...(t.match(/`+/g)??[]).map(s=>s.length)),r="`".repeat(e+1),o=t.startsWith("`")||t.endsWith("`")?` ${t} `:t;return`${r}${o}${r}`}a(fKa,"appendEscapedMarkdownInlineCode");function pKa(t){return t.replace(/"/g,""")}a(pKa,"escapeDoubleQuotes");function hKa(t){return t&&t.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}a(hKa,"removeMarkdownEscapes");function mKa(t){let e=[],r=t.split("|").map(o=>o.trim());t=r[0];let n=r[1];if(n){let o=/height=(\d+)/.exec(n),s=/width=(\d+)/.exec(n),c=o?o[1]:"",l=s?s[1]:"",u=isFinite(parseInt(l)),d=isFinite(parseInt(c));u&&e.push(`width="${l}"`),d&&e.push(`height="${c}"`)}return{href:t,dimensions:e}}a(mKa,"parseHrefAndDimensions");function YDi(t,e,r,n=!0){return`[${n?Nyt(t):t}](${e}${r?` "${Nyt(r)}"`:""})`}a(YDi,"createMarkdownLink");function gKa(t,e=!0){let r=KDi(t.id,...t.arguments||[]).toString();return YDi(t.text,r,t.tooltip,e)}a(gKa,"createMarkdownCommandLink");function KDi(t,...e){return Pyt.URI.from({scheme:aKa.Schemas.command,path:t,query:e.length?encodeURIComponent(JSON.stringify(e)):void 0})}a(KDi,"createCommandUri")});var uxr=I(Kre=>{"use strict";p();var AKa=Kre&&Kre.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},cxr;Object.defineProperty(Kre,"__esModule",{value:!0});Kre.MarkdownString=void 0;var yKa=JDi(),EKa=MD(),lxr=cxr=class{static{a(this,"MarkdownString")}#e;static isMarkdownString(e){return e instanceof cxr?!0:!e||typeof e!="object"?!1:e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}constructor(e,r=!1){this.#e=new yKa.MarkdownString(e,{supportThemeIcons:r})}get value(){return this.#e.value}set value(e){this.#e.value=e}get isTrusted(){return this.#e.isTrusted}set isTrusted(e){this.#e.isTrusted=e}get supportThemeIcons(){return this.#e.supportThemeIcons}set supportThemeIcons(e){this.#e.supportThemeIcons=e}get supportHtml(){return this.#e.supportHtml}set supportHtml(e){this.#e.supportHtml=e}get supportAlertSyntax(){return this.#e.supportAlertSyntax}set supportAlertSyntax(e){this.#e.supportAlertSyntax=e}get baseUri(){return this.#e.baseUri}set baseUri(e){this.#e.baseUri=e}appendText(e){return this.#e.appendText(e),this}appendMarkdown(e){return this.#e.appendMarkdown(e),this}appendCodeblock(e,r){return this.#e.appendCodeblock(r??"",e),this}};Kre.MarkdownString=lxr;Kre.MarkdownString=lxr=cxr=AKa([EKa.es5ClassCompat],lxr)});var eNi=I(I6=>{"use strict";p();Object.defineProperty(I6,"__esModule",{value:!0});I6.Mimes=void 0;I6.getMediaOrTextMime=vKa;I6.getMediaMime=XDi;I6.getExtensionForMimeType=CKa;I6.normalizeMimeType=SKa;I6.isTextStreamMime=TKa;var ZDi=NA();I6.Mimes=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list",html:"text/html"});var _Ka={".css":"text/css",".csv":"text/csv",".htm":"text/html",".html":"text/html",".ics":"text/calendar",".js":"text/javascript",".mjs":"text/javascript",".txt":"text/plain",".xml":"text/xml"},dxr={".aac":"audio/x-aac",".avi":"video/x-msvideo",".bmp":"image/bmp",".flv":"video/x-flv",".gif":"image/gif",".ico":"image/x-icon",".jpe":["image/jpg","image/jpeg"],".jpeg":["image/jpg","image/jpeg"],".jpg":["image/jpg","image/jpeg"],".m1v":"video/mpeg",".m2a":"audio/mpeg",".m2v":"video/mpeg",".m3a":"audio/mpeg",".mid":"audio/midi",".midi":"audio/midi",".mk3d":"video/x-matroska",".mks":"video/x-matroska",".mkv":"video/x-matroska",".mov":"video/quicktime",".movie":"video/x-sgi-movie",".mp2":"audio/mpeg",".mp2a":"audio/mpeg",".mp3":"audio/mpeg",".mp4":"video/mp4",".mp4a":"audio/mp4",".mp4v":"video/mp4",".mpe":"video/mpeg",".mpeg":"video/mpeg",".mpg":"video/mpeg",".mpg4":"video/mp4",".mpga":"audio/mpeg",".oga":"audio/ogg",".ogg":"audio/ogg",".opus":"audio/opus",".ogv":"video/ogg",".png":"image/png",".psd":"image/vnd.adobe.photoshop",".qt":"video/quicktime",".spx":"audio/ogg",".svg":"image/svg+xml",".tga":"image/x-tga",".tif":"image/tiff",".tiff":"image/tiff",".wav":"audio/x-wav",".webm":"video/webm",".webp":"image/webp",".wma":"audio/x-ms-wma",".wmv":"video/x-ms-wmv",".woff":"application/font-woff"};function vKa(t){let e=(0,ZDi.extname)(t),r=_Ka[e.toLowerCase()];return r!==void 0?r:XDi(t)}a(vKa,"getMediaOrTextMime");function XDi(t){let e=(0,ZDi.extname)(t),r=dxr[e.toLowerCase()];return Array.isArray(r)?r[0]:r}a(XDi,"getMediaMime");function CKa(t){for(let e in dxr){let r=dxr[e];if(Array.isArray(r)?r.includes(t):r===t)return e}}a(CKa,"getExtensionForMimeType");var bKa=/^(.+)\/(.+?)(;.+)?$/;function SKa(t,e){let r=bKa.exec(t);return r?`${r[1].toLowerCase()}/${r[2].toLowerCase()}${r[3]??""}`:e?void 0:t}a(SKa,"normalizeMimeType");function TKa(t){return["application/vnd.code.notebook.stdout","application/vnd.code.notebook.stderr"].includes(t)}a(TKa,"isTextStreamMime")});var nNi=I(k0=>{"use strict";p();var IKa=k0&&k0.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},m$;Object.defineProperty(k0,"__esModule",{value:!0});k0.NotebookCellOutput=k0.NotebookCellOutputItem=k0.NotebookEdit=k0.NotebookData=k0.NotebookCellData=k0.NotebookRange=k0.NotebookCellKind=void 0;var xKa=MD(),tNi=Rs(),Myt=eNi(),wKa=T0(),rNi;(function(t){t[t.Markup=1]="Markup",t[t.Code=2]="Code"})(rNi||(k0.NotebookCellKind=rNi={}));var Jre=class t{static{a(this,"NotebookRange")}static isNotebookRange(e){return e instanceof t?!0:e?typeof e.start=="number"&&typeof e.end=="number":!1}get start(){return this._start}get end(){return this._end}get isEmpty(){return this._start===this._end}constructor(e,r){if(e<0)throw(0,tNi.illegalArgument)("start must be positive");if(r<0)throw(0,tNi.illegalArgument)("end must be positive");e<=r?(this._start=e,this._end=r):(this._start=r,this._end=e)}with(e){let r=this._start,n=this._end;return e.start!==void 0&&(r=e.start),e.end!==void 0&&(n=e.end),r===this._start&&n===this._end?this:new t(r,n)}};k0.NotebookRange=Jre;var fxr=class t{static{a(this,"NotebookCellData")}static validate(e){if(typeof e.kind!="number")throw new Error("NotebookCellData MUST have 'kind' property");if(typeof e.value!="string")throw new Error("NotebookCellData MUST have 'value' property");if(typeof e.languageId!="string")throw new Error("NotebookCellData MUST have 'languageId' property")}static isNotebookCellDataArray(e){return Array.isArray(e)&&e.every(r=>t.isNotebookCellData(r))}static isNotebookCellData(e){return!0}constructor(e,r,n,o,s,c,l){this.kind=e,this.value=r,this.languageId=n,this.mime=o,this.outputs=s??[],this.metadata=c,this.executionSummary=l,t.validate(this)}};k0.NotebookCellData=fxr;var pxr=class{static{a(this,"NotebookData")}constructor(e){this.cells=e}};k0.NotebookData=pxr;var hxr=m$=class{static{a(this,"NotebookEdit")}static isNotebookCellEdit(e){return e instanceof m$?!0:e?Jre.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,r){return new m$(e,r)}static insertCells(e,r){return new m$(new Jre(e,e),r)}static deleteCells(e){return new m$(e,[])}static updateCellMetadata(e,r){let n=new m$(new Jre(e,e),[]);return n.newCellMetadata=r,n}static updateNotebookMetadata(e){let r=new m$(new Jre(0,0),[]);return r.newNotebookMetadata=e,r}constructor(e,r){this.range=e,this.newCells=r}};k0.NotebookEdit=hxr;k0.NotebookEdit=hxr=m$=IKa([xKa.es5ClassCompat],hxr);var mxr=class t{static{a(this,"NotebookCellOutputItem")}static isNotebookCellOutputItem(e){return e instanceof t?!0:e?typeof e.mime=="string"&&e.data instanceof Uint8Array:!1}static error(e){let r={name:e.name,message:e.message,stack:e.stack};return t.json(r,"application/vnd.code.notebook.error")}static stdout(e){return t.text(e,"application/vnd.code.notebook.stdout")}static stderr(e){return t.text(e,"application/vnd.code.notebook.stderr")}static bytes(e,r="application/octet-stream"){return new t(e,r)}static#e=new TextEncoder;static text(e,r=Myt.Mimes.text){let n=t.#e.encode(String(e));return new t(n,r)}static json(e,r="text/x-json"){let n=JSON.stringify(e,void 0," ");return t.text(n,r)}constructor(e,r){this.data=e,this.mime=r;let n=(0,Myt.normalizeMimeType)(r,!0);if(!n)throw new Error(`INVALID mime type: ${r}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}};k0.NotebookCellOutputItem=mxr;var gxr=class t{static{a(this,"NotebookCellOutput")}static isNotebookCellOutput(e){return e instanceof t?!0:!e||typeof e!="object"?!1:typeof e.id=="string"&&Array.isArray(e.items)}static ensureUniqueMimeTypes(e,r=!1){let n=new Set,o=new Set;for(let s=0;s!o.has(c))}constructor(e,r,n){this.items=t.ensureUniqueMimeTypes(e,!0),typeof r=="string"?(this.id=r,this.metadata=n):(this.id=(0,wKa.generateUuid)(),this.metadata=r??n)}};k0.NotebookCellOutput=gxr});var oNi=I(A$=>{"use strict";p();var RKa=A$&&A$.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Axr;Object.defineProperty(A$,"__esModule",{value:!0});A$.Selection=void 0;A$.getDebugDescriptionOfSelection=iNi;var kKa=MD(),g$=kAe(),yxr=nL(),Exr=Axr=class extends yxr.Range{static{a(this,"Selection")}static isSelection(e){return e instanceof Axr?!0:!e||typeof e!="object"?!1:yxr.Range.isRange(e)&&g$.Position.isPosition(e.anchor)&&g$.Position.isPosition(e.active)&&typeof e.isReversed=="boolean"}get anchor(){return this._anchor}get active(){return this._active}constructor(e,r,n,o){let s,c;if(typeof e=="number"&&typeof r=="number"&&typeof n=="number"&&typeof o=="number"?(s=new g$.Position(e,r),c=new g$.Position(n,o)):g$.Position.isPosition(e)&&g$.Position.isPosition(r)&&(s=g$.Position.of(e),c=g$.Position.of(r)),!s||!c)throw new Error("Invalid arguments");super(s,c),this._anchor=s,this._active=c}get isReversed(){return this._anchor===this._end}toJSON(){return{start:this.start,end:this.end,active:this.active,anchor:this.anchor}}[Symbol.for("debug.description")](){return iNi(this)}};A$.Selection=Exr;A$.Selection=Exr=Axr=RKa([kKa.es5ClassCompat],Exr);function iNi(t){let e=(0,yxr.getDebugDescriptionOfRange)(t);return t.isEmpty||(t.active.isEqual(t.start)?e=`|${e}`:e=`${e}|`),e}a(iNi,"getDebugDescriptionOfSelection")});var vxr=I(Xre=>{"use strict";p();var PKa=Xre&&Xre.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Zre;Object.defineProperty(Xre,"__esModule",{value:!0});Xre.SnippetString=void 0;var DKa=MD(),_xr=Zre=class{static{a(this,"SnippetString")}static isSnippetString(e){return e instanceof Zre?!0:!e||typeof e!="object"?!1:typeof e.value=="string"}static _escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){this._tabstop=1,this.value=e||""}appendText(e){return this.value+=Zre._escape(e),this}appendTabstop(e=this._tabstop++){return this.value+="$",this.value+=e,this}appendPlaceholder(e,r=this._tabstop++){if(typeof e=="function"){let n=new Zre;n._tabstop=this._tabstop,e(n),this._tabstop=n._tabstop,e=n.value}else e=Zre._escape(e);return this.value+="${",this.value+=r,this.value+=":",this.value+=e,this.value+="}",this}appendChoice(e,r=this._tabstop++){let n=e.map(o=>o.replaceAll(/[|\\,]/g,"\\$&")).join(",");return this.value+="${",this.value+=r,this.value+="|",this.value+=n,this.value+="|}",this}appendVariable(e,r){if(typeof r=="function"){let n=new Zre;n._tabstop=this._tabstop,r(n),this._tabstop=n._tabstop,r=n.value}else typeof r=="string"&&(r=r.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=e,r&&(this.value+=":",this.value+=r),this.value+="}",this}};Xre.SnippetString=_xr;Xre.SnippetString=_xr=Zre=PKa([DKa.es5ClassCompat],_xr)});var bxr=I(Oyt=>{"use strict";p();Object.defineProperty(Oyt,"__esModule",{value:!0});Oyt.SnippetTextEdit=void 0;var NKa=vxr(),sNi=nL(),Cxr=class t{static{a(this,"SnippetTextEdit")}static isSnippetTextEdit(e){return e instanceof t?!0:e?sNi.Range.isRange(e.range)&&NKa.SnippetString.isSnippetString(e.snippet):!1}static replace(e,r){return new t(e,r)}static insert(e,r){return t.replace(new sNi.Range(e,e),r)}constructor(e,r){this.range=e,this.snippet=r}};Oyt.SnippetTextEdit=Cxr});var lNi=I(OD=>{"use strict";p();var MKa=OD&&OD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Sxr;Object.defineProperty(OD,"__esModule",{value:!0});OD.SymbolInformation=OD.SymbolTag=OD.SymbolKind=void 0;var OKa=MD(),aNi=QIr(),LKa=nL(),Txr;(function(t){t[t.File=0]="File",t[t.Module=1]="Module",t[t.Namespace=2]="Namespace",t[t.Package=3]="Package",t[t.Class=4]="Class",t[t.Method=5]="Method",t[t.Property=6]="Property",t[t.Field=7]="Field",t[t.Constructor=8]="Constructor",t[t.Enum=9]="Enum",t[t.Interface=10]="Interface",t[t.Function=11]="Function",t[t.Variable=12]="Variable",t[t.Constant=13]="Constant",t[t.String=14]="String",t[t.Number=15]="Number",t[t.Boolean=16]="Boolean",t[t.Array=17]="Array",t[t.Object=18]="Object",t[t.Key=19]="Key",t[t.Null=20]="Null",t[t.EnumMember=21]="EnumMember",t[t.Struct=22]="Struct",t[t.Event=23]="Event",t[t.Operator=24]="Operator",t[t.TypeParameter=25]="TypeParameter"})(Txr||(OD.SymbolKind=Txr={}));var cNi;(function(t){t[t.Deprecated=1]="Deprecated"})(cNi||(OD.SymbolTag=cNi={}));var Ixr=Sxr=class{static{a(this,"SymbolInformation")}static validate(e){if(!e.name)throw new Error("name must not be falsy")}constructor(e,r,n,o,s){this.name=e,this.kind=r,this.containerName=s,typeof n=="string"&&(this.containerName=n),o instanceof aNi.Location?this.location=o:n instanceof LKa.Range&&(this.location=new aNi.Location(o,n)),Sxr.validate(this)}toJSON(){return{name:this.name,kind:Txr[this.kind],location:this.location,containerName:this.containerName}}};OD.SymbolInformation=Ixr;OD.SymbolInformation=Ixr=Sxr=MKa([OKa.es5ClassCompat],Ixr)});var Rxr=I(x6=>{"use strict";p();var BKa=x6&&x6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ene;Object.defineProperty(x6,"__esModule",{value:!0});x6.TextEdit=x6.EndOfLine=void 0;var xxr=Rs(),FKa=MD(),uNi=kAe(),Lyt=nL(),dNi;(function(t){t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"})(dNi||(x6.EndOfLine=dNi={}));var wxr=ene=class{static{a(this,"TextEdit")}static isTextEdit(e){return e instanceof ene?!0:!e||typeof e!="object"?!1:Lyt.Range.isRange(e)&&typeof e.newText=="string"}static replace(e,r){return new ene(e,r)}static insert(e,r){return ene.replace(new Lyt.Range(e,e),r)}static delete(e){return ene.replace(e,"")}static setEndOfLine(e){let r=new ene(new Lyt.Range(new uNi.Position(0,0),new uNi.Position(0,0)),"");return r.newEol=e,r}get range(){return this._range}set range(e){if(e&&!Lyt.Range.isRange(e))throw(0,xxr.illegalArgument)("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw(0,xxr.illegalArgument)("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw(0,xxr.illegalArgument)("newEol");this._newEol=e}constructor(e,r){this._range=e,this._newText=r}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};x6.TextEdit=wxr;x6.TextEdit=wxr=ene=BKa([FKa.es5ClassCompat],wxr)});var bNi=I(xt=>{"use strict";p();Object.defineProperty(xt,"__esModule",{value:!0});xt.ChatResponseClearToPreviousToolInvocationReason=xt.ChatRequestEditedFileEventKind=xt.ChatInputNotificationSeverity=xt.ChatErrorLevel=xt.AISearchKeyword=xt.TextSearchMatch2=xt.ExcludeSettingOptions=xt.LanguageModelPromptTsxPart=xt.ChatImageMimeType=xt.LanguageModelDataPart2=xt.LanguageModelDataPart=xt.LanguageModelThinkingPart=xt.LanguageModelTextPart2=xt.LanguageModelPartAudience=xt.LanguageModelTextPart=xt.LanguageModelToolResult2=xt.LanguageModelToolResult=xt.ChatReferenceBinaryData=xt.ChatReferenceDiagnostic=xt.ChatRequestNotebookData=xt.ChatRequestEditorData=xt.ChatResponseTurn=xt.ChatRequestTurn2=xt.ChatRequestTurn=xt.ChatResponseQuestionCarouselPart=xt.ChatQuestion=xt.ChatQuestionType=xt.ChatResponseConfirmationPart=xt.ChatResponseWorkspaceEditPart=xt.ChatResponseNotebookEditPart=xt.ChatResponseTextEditPart=xt.ChatResponseMarkdownWithVulnerabilitiesPart=xt.ChatResponseCommandButtonPart=xt.ChatResponseCodeCitationPart=xt.ChatResponsePullRequestPart=xt.ChatResponseExtensionsPart=xt.ChatResponseMovePart=xt.ChatResponseReferencePart2=xt.ChatResponseReferencePart=xt.ChatResponseInfoPart=xt.ChatResponseWarningPart=xt.ChatResponseProgressPart2=xt.ChatResponseExternalEditPart=xt.ChatResponseHookPart=xt.ChatResponseThinkingProgressPart=xt.ChatResponseProgressPart=xt.ChatResponseAnchorPart=xt.ChatResponseFileTreePart=xt.ChatResponseCodeblockUriPart=xt.ChatResponseMarkdownPart=void 0;xt.McpHttpServerDefinition=xt.McpStdioServerDefinition=xt.ChatResource=xt.LanguageModelError=xt.ChatSessionStatus=xt.ChatResponseTurn2=xt.ChatSubagentToolInvocationData=xt.ChatToolInvocationPart=xt.McpToolInvocationContentData=xt.LanguageModelChatMessage=xt.LanguageModelChatToolMode=xt.LanguageModelChatMessageRole=xt.LanguageModelToolResultPart2=xt.LanguageModelToolResultPart=xt.LanguageModelToolCallPart=xt.LanguageModelToolMCPSource=xt.LanguageModelToolExtensionSource=void 0;var fNi=e$(),Qyt=uxr(),kxr=class{static{a(this,"ChatResponseMarkdownPart")}constructor(e){this.value=typeof e=="string"?new Qyt.MarkdownString(e):e}};xt.ChatResponseMarkdownPart=kxr;var Pxr=class{static{a(this,"ChatResponseCodeblockUriPart")}constructor(e,r,n){this.value=e,this.undoStopId=n}};xt.ChatResponseCodeblockUriPart=Pxr;var Dxr=class{static{a(this,"ChatResponseFileTreePart")}constructor(e,r){this.value=e,this.baseUri=r}};xt.ChatResponseFileTreePart=Dxr;var Nxr=class{static{a(this,"ChatResponseAnchorPart")}constructor(e,r){this.value=e,this.title=r}};xt.ChatResponseAnchorPart=Nxr;var Mxr=class{static{a(this,"ChatResponseProgressPart")}constructor(e){this.value=e}};xt.ChatResponseProgressPart=Mxr;var Oxr=class{static{a(this,"ChatResponseThinkingProgressPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};xt.ChatResponseThinkingProgressPart=Oxr;var Lxr=class{static{a(this,"ChatResponseHookPart")}constructor(e,r,n,o){this.hookType=e,this.stopReason=r,this.systemMessage=n,this.metadata=o}};xt.ChatResponseHookPart=Lxr;var Bxr=class{static{a(this,"ChatResponseExternalEditPart")}constructor(e,r){this.uris=e,this.callback=r,this.applied=new Promise(n=>{this.didGetApplied=n})}};xt.ChatResponseExternalEditPart=Bxr;var Fxr=class{static{a(this,"ChatResponseProgressPart2")}constructor(e,r){this.value=e,this.task=r}};xt.ChatResponseProgressPart2=Fxr;var Uxr=class{static{a(this,"ChatResponseWarningPart")}constructor(e){this.value=typeof e=="string"?new Qyt.MarkdownString(e):e}};xt.ChatResponseWarningPart=Uxr;var Qxr=class{static{a(this,"ChatResponseInfoPart")}constructor(e){this.value=typeof e=="string"?new Qyt.MarkdownString(e):e}};xt.ChatResponseInfoPart=Qxr;var qxr=class{static{a(this,"ChatResponseReferencePart")}constructor(e){this.value=e}};xt.ChatResponseReferencePart=qxr;var jxr=class{static{a(this,"ChatResponseReferencePart2")}constructor(e,r,n){this.value=e,this.iconPath=r,this.options=n}};xt.ChatResponseReferencePart2=jxr;var Hxr=class{static{a(this,"ChatResponseMovePart")}constructor(e,r){this.uri=e,this.range=r}};xt.ChatResponseMovePart=Hxr;var Gxr=class{static{a(this,"ChatResponseExtensionsPart")}constructor(e){this.extensions=e}};xt.ChatResponseExtensionsPart=Gxr;var $xr=class{static{a(this,"ChatResponsePullRequestPart")}constructor(e,r,n,o,s){"command"in e&&typeof e.command=="string"?this.command=e:(this.uri=e,this.command={title:"View Pull Request",command:"vscode.open",arguments:[e]}),this.title=r,this.description=n,this.author=o,this.linkTag=s}};xt.ChatResponsePullRequestPart=$xr;var Vxr=class{static{a(this,"ChatResponseCodeCitationPart")}constructor(e,r,n){this.value=e,this.license=r,this.snippet=n}};xt.ChatResponseCodeCitationPart=Vxr;var Wxr=class{static{a(this,"ChatResponseCommandButtonPart")}constructor(e){this.value=e}};xt.ChatResponseCommandButtonPart=Wxr;var zxr=class{static{a(this,"ChatResponseMarkdownWithVulnerabilitiesPart")}constructor(e,r){this.value=typeof e=="string"?new Qyt.MarkdownString(e):e,this.vulnerabilities=r}};xt.ChatResponseMarkdownWithVulnerabilitiesPart=zxr;var Yxr=class{static{a(this,"ChatResponseTextEditPart")}constructor(e,r){this.uri=e,r===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(r)?r:[r]}};xt.ChatResponseTextEditPart=Yxr;var Kxr=class{static{a(this,"ChatResponseNotebookEditPart")}constructor(e,r){this.uri=e,r===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(r)?r:[r]}};xt.ChatResponseNotebookEditPart=Kxr;var Jxr=class{static{a(this,"ChatResponseWorkspaceEditPart")}constructor(e){this.edits=e}};xt.ChatResponseWorkspaceEditPart=Jxr;var Zxr=class{static{a(this,"ChatResponseConfirmationPart")}constructor(e,r,n,o){this.title=e,this.message=r,this.data=n,this.buttons=o}};xt.ChatResponseConfirmationPart=Zxr;var pNi;(function(t){t[t.Text=1]="Text",t[t.SingleSelect=2]="SingleSelect",t[t.MultiSelect=3]="MultiSelect"})(pNi||(xt.ChatQuestionType=pNi={}));var Xxr=class{static{a(this,"ChatQuestion")}constructor(e,r,n,o){this.id=e,this.type=r,this.title=n,o&&(this.message=o.message,this.options=o.options,this.defaultValue=o.defaultValue,this.allowFreeformInput=o.allowFreeformInput)}};xt.ChatQuestion=Xxr;var ewr=class{static{a(this,"ChatResponseQuestionCarouselPart")}constructor(e,r){this.questions=e,this.allowSkip=r??!1}};xt.ChatResponseQuestionCarouselPart=ewr;var twr=class{static{a(this,"ChatRequestTurn")}constructor(e,r,n,o,s){this.prompt=e,this.command=r,this.references=n,this.participant=o,this.toolReferences=s}};xt.ChatRequestTurn=twr;var rwr=class{static{a(this,"ChatRequestTurn2")}constructor(e,r,n,o,s,c,l,u,d){this.prompt=e,this.command=r,this.references=n,this.participant=o,this.toolReferences=s,this.editedFileEvents=c,this.id=l,this.modelId=u,this.modeInstructions2=d}};xt.ChatRequestTurn2=rwr;var nwr=class{static{a(this,"ChatResponseTurn")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};xt.ChatResponseTurn=nwr;var iwr=class{static{a(this,"ChatRequestEditorData")}constructor(e,r,n,o){this.editor=e,this.document=r,this.selection=n,this.wholeRange=o}};xt.ChatRequestEditorData=iwr;var owr=class{static{a(this,"ChatRequestNotebookData")}constructor(e){this.cell=e}};xt.ChatRequestNotebookData=owr;var swr=class{static{a(this,"ChatReferenceDiagnostic")}constructor(e){this.diagnostics=e}};xt.ChatReferenceDiagnostic=swr;var awr=class{static{a(this,"ChatReferenceBinaryData")}constructor(e,r){this.mimeType=e,this.data=r}};xt.ChatReferenceBinaryData=awr;var cwr=class{static{a(this,"LanguageModelToolResult")}constructor(e){this.content=e}};xt.LanguageModelToolResult=cwr;var lwr=class{static{a(this,"LanguageModelToolResult2")}constructor(e){this.content=e}};xt.LanguageModelToolResult2=lwr;var Byt=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}};xt.LanguageModelTextPart=Byt;var hNi;(function(t){t[t.Assistant=0]="Assistant",t[t.User=1]="User",t[t.Extension=2]="Extension"})(hNi||(xt.LanguageModelPartAudience=hNi={}));var uwr=class extends Byt{static{a(this,"LanguageModelTextPart2")}constructor(e,r){super(e),this.audience=r}};xt.LanguageModelTextPart2=uwr;var dwr=class{static{a(this,"LanguageModelThinkingPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};xt.LanguageModelThinkingPart=dwr;var Fyt=class t{static{a(this,"LanguageModelDataPart")}constructor(e,r){this.mimeType=r,this.data=e}static image(e,r){return new t(e,r)}static json(e){let r=JSON.stringify(e,void 0," ");return new t(fNi.VSBuffer.fromString(r).buffer,"json")}static text(e){return new t(fNi.VSBuffer.fromString(e).buffer,"text/plain")}};xt.LanguageModelDataPart=Fyt;var fwr=class extends Fyt{static{a(this,"LanguageModelDataPart2")}constructor(e,r,n){super(e,r),this.audience=n}};xt.LanguageModelDataPart2=fwr;var mNi;(function(t){t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif",t.WEBP="image/webp",t.BMP="image/bmp"})(mNi||(xt.ChatImageMimeType=mNi={}));var pwr=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};xt.LanguageModelPromptTsxPart=pwr;var gNi;(function(t){t[t.None=1]="None",t[t.FilesExclude=2]="FilesExclude",t[t.SearchAndFilesExclude=3]="SearchAndFilesExclude"})(gNi||(xt.ExcludeSettingOptions=gNi={}));var hwr=class{static{a(this,"TextSearchMatch2")}constructor(e,r,n){this.uri=e,this.ranges=r,this.previewText=n}};xt.TextSearchMatch2=hwr;var mwr=class{static{a(this,"AISearchKeyword")}constructor(e){this.keyword=e}};xt.AISearchKeyword=mwr;var ANi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(ANi||(xt.ChatErrorLevel=ANi={}));var yNi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(yNi||(xt.ChatInputNotificationSeverity=yNi={}));var ENi;(function(t){t[t.Keep=1]="Keep",t[t.Undo=2]="Undo",t[t.UserModification=3]="UserModification"})(ENi||(xt.ChatRequestEditedFileEventKind=ENi={}));var _Ni;(function(t){t[t.NoReason=0]="NoReason",t[t.FilteredContentRetry=1]="FilteredContentRetry",t[t.CopyrightContentRetry=2]="CopyrightContentRetry"})(_Ni||(xt.ChatResponseClearToPreviousToolInvocationReason=_Ni={}));var gwr=class{static{a(this,"LanguageModelToolExtensionSource")}constructor(e,r){this.id=e,this.label=r}};xt.LanguageModelToolExtensionSource=gwr;var Awr=class{static{a(this,"LanguageModelToolMCPSource")}constructor(e,r,n){this.label=e,this.name=r,this.instructions=n}};xt.LanguageModelToolMCPSource=Awr;var ywr=class{static{a(this,"LanguageModelToolCallPart")}constructor(e,r,n){this.callId=e,this.name=r,this.input=n}};xt.LanguageModelToolCallPart=ywr;var Ewr=class{static{a(this,"LanguageModelToolResultPart")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};xt.LanguageModelToolResultPart=Ewr;var _wr=class{static{a(this,"LanguageModelToolResultPart2")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};xt.LanguageModelToolResultPart2=_wr;var Uyt;(function(t){t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.System=3]="System"})(Uyt||(xt.LanguageModelChatMessageRole=Uyt={}));var vNi;(function(t){t[t.Auto=1]="Auto",t[t.Required=2]="Required"})(vNi||(xt.LanguageModelChatToolMode=vNi={}));var vwr=class t{static{a(this,"LanguageModelChatMessage")}constructor(e,r,n){this.role=e,this.content=typeof r=="string"?[{type:"text",value:r}]:r,this.name=n}static User(e,r){return new t(Uyt.User,e,r)}static Assistant(e,r){return new t(Uyt.Assistant,e,r)}};xt.LanguageModelChatMessage=vwr;var Cwr=class{static{a(this,"McpToolInvocationContentData")}constructor(e,r){this.data=e,this.mimeType=r}};xt.McpToolInvocationContentData=Cwr;var bwr=class{static{a(this,"ChatToolInvocationPart")}constructor(e,r,n){this.toolName=e,this.toolCallId=r,this.isError=typeof n=="string"?!0:n}};xt.ChatToolInvocationPart=bwr;var Swr=class{static{a(this,"ChatSubagentToolInvocationData")}constructor(e,r,n,o){this.description=e,this.agentName=r,this.prompt=n,this.result=o}};xt.ChatSubagentToolInvocationData=Swr;var Twr=class{static{a(this,"ChatResponseTurn2")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};xt.ChatResponseTurn2=Twr;var CNi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress",t[t.NeedsInput=3]="NeedsInput"})(CNi||(xt.ChatSessionStatus=CNi={}));var Iwr=class t extends Error{static{a(this,"LanguageModelError")}static#e="LanguageModelError";static NotFound(e){return new t(e,t.NotFound.name)}static NoPermissions(e){return new t(e,t.NoPermissions.name)}static Blocked(e){return new t(e,t.Blocked.name)}constructor(e,r,n){super(e,{cause:n}),this.name=t.#e,this.code=r??""}};xt.LanguageModelError=Iwr;var xwr=class{static{a(this,"ChatResource")}constructor(e){this.uri=e}};xt.ChatResource=xwr;var wwr=class{static{a(this,"McpStdioServerDefinition")}constructor(e,r,n,o,s){this.label=e,this.command=r,this.args=n??[],this.env=o??{},this.version=s}};xt.McpStdioServerDefinition=wwr;var Rwr=class{static{a(this,"McpHttpServerDefinition")}constructor(e,r,n,o){this.label=e,this.uri=r,this.headers=n??{},this.version=o}};xt.McpHttpServerDefinition=Rwr});var INi=I(y$=>{"use strict";p();Object.defineProperty(y$,"__esModule",{value:!0});y$.TextDocumentChangeReason=y$.TextEditorSelectionChangeKind=y$.WorkspaceEdit=void 0;var UKa=Sl(),QKa=zP(),qKa=nL(),jKa=bxr(),HKa=Rxr(),kwr=class{static{a(this,"WorkspaceEdit")}constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,r,n,o){this._edits.push({_type:1,from:e,to:r,options:n,metadata:o})}createFile(e,r,n){this._edits.push({_type:1,from:void 0,to:e,options:r,metadata:n})}deleteFile(e,r,n){this._edits.push({_type:1,from:e,to:void 0,options:r,metadata:n})}replace(e,r,n,o){this._edits.push({_type:2,uri:e,edit:new HKa.TextEdit(r,n),metadata:o})}insert(e,r,n,o){this.replace(e,new qKa.Range(r,r),n,o)}delete(e,r,n){this.replace(e,r,"",n)}has(e){return this._edits.some(r=>r._type===2&&r.uri.toString()===e.toString())}set(e,r){if(r)for(let n of r){if(!n)continue;let o,s;Array.isArray(n)?(o=n[0],s=n[1]):o=n,jKa.SnippetTextEdit.isSnippetTextEdit(o)?this._edits.push({_type:6,uri:e,range:o.range,edit:o.snippet,metadata:s}):this._edits.push({_type:2,uri:e,edit:o,metadata:s})}else{for(let n=0;n{"use strict";p();Object.defineProperty(xp,"__esModule",{value:!0});xp.FileType=xp.ChatSessionStatus=xp.ChatLocation=xp.ChatVariableLevel=xp.ExtensionMode=xp.DiagnosticSeverity=xp.TextEditorRevealType=xp.TextEditorLineNumbersStyle=xp.TextEditorCursorStyle=xp.InteractiveEditorResponseFeedbackKind=void 0;var xNi;(function(t){t[t.Unhelpful=0]="Unhelpful",t[t.Helpful=1]="Helpful",t[t.Undone=2]="Undone",t[t.Accepted=3]="Accepted",t[t.Bug=4]="Bug"})(xNi||(xp.InteractiveEditorResponseFeedbackKind=xNi={}));var wNi;(function(t){t[t.Line=1]="Line",t[t.Block=2]="Block",t[t.Underline=3]="Underline",t[t.LineThin=4]="LineThin",t[t.BlockOutline=5]="BlockOutline",t[t.UnderlineThin=6]="UnderlineThin"})(wNi||(xp.TextEditorCursorStyle=wNi={}));var RNi;(function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.Relative=2]="Relative",t[t.Interval=3]="Interval"})(RNi||(xp.TextEditorLineNumbersStyle=RNi={}));var kNi;(function(t){t[t.Default=0]="Default",t[t.InCenter=1]="InCenter",t[t.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",t[t.AtTop=3]="AtTop"})(kNi||(xp.TextEditorRevealType=kNi={}));var PNi;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Information=2]="Information",t[t.Hint=3]="Hint"})(PNi||(xp.DiagnosticSeverity=PNi={}));var DNi;(function(t){t[t.Production=1]="Production",t[t.Development=2]="Development",t[t.Test=3]="Test"})(DNi||(xp.ExtensionMode=DNi={}));var NNi;(function(t){t[t.Short=1]="Short",t[t.Medium=2]="Medium",t[t.Full=3]="Full"})(NNi||(xp.ChatVariableLevel=NNi={}));var MNi;(function(t){t[t.Panel=1]="Panel",t[t.Terminal=2]="Terminal",t[t.Notebook=3]="Notebook",t[t.Editor=4]="Editor"})(MNi||(xp.ChatLocation=MNi={}));var ONi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress"})(ONi||(xp.ChatSessionStatus=ONi={}));var LNi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(LNi||(xp.FileType=LNi={}))});var UNi=I(Pwr=>{"use strict";p();Object.defineProperty(Pwr,"__esModule",{value:!0});Pwr.t=GKa;function GKa(...t){if(typeof t[0]=="string"){let e=t.shift(),r=!t||typeof t[0]!="object"?t:t[0];return FNi({message:e,args:r})}return FNi(t[0])}a(GKa,"t");function FNi(t){let{message:e,args:r}=t;return VKa(e,r??{})}a(FNi,"getMessage");var $Ka=/{([^}]+)}/g;function VKa(t,e){return t.replace($Ka,(r,n)=>e[n]??r)}a(VKa,"format2")});var jNi=I(E$=>{"use strict";p();Object.defineProperty(E$,"__esModule",{value:!0});E$.NewSymbolName=E$.NewSymbolNameTriggerKind=E$.NewSymbolNameTag=void 0;var QNi;(function(t){t[t.AIGenerated=1]="AIGenerated"})(QNi||(E$.NewSymbolNameTag=QNi={}));var qNi;(function(t){t[t.Invoke=0]="Invoke",t[t.Automatic=1]="Automatic"})(qNi||(E$.NewSymbolNameTriggerKind=qNi={}));var Dwr=class{static{a(this,"NewSymbolName")}constructor(e,r){this.newSymbolName=e,this.tags=r}};E$.NewSymbolName=Dwr});var GNi=I(qyt=>{"use strict";p();Object.defineProperty(qyt,"__esModule",{value:!0});qyt.TerminalShellExecutionCommandLineConfidence=void 0;var HNi;(function(t){t[t.Low=0]="Low",t[t.Medium=1]="Medium",t[t.High=2]="High"})(HNi||(qyt.TerminalShellExecutionCommandLineConfidence=HNi={}))});var $Ni=I(DAe=>{"use strict";p();Object.defineProperty(DAe,"__esModule",{value:!0});DAe.ThemeColor=DAe.ThemeIcon=void 0;var Nwr=class t{static{a(this,"ThemeIcon")}constructor(e,r){this.id=e,this.color=r}static isThemeIcon(e){return!(e instanceof t)}};DAe.ThemeIcon=Nwr;var Mwr=class{static{a(this,"ThemeColor")}constructor(e){this.id=e}};DAe.ThemeColor=Mwr});var P0=I((SLp,YNi)=>{"use strict";p();var WKa=YP(),zKa=Ic(),YKa=nd(),VNi=BIr(),KKa=QIr(),JKa=uxr(),U4e=nNi(),ZKa=kAe(),XKa=nL(),eJa=oNi(),tJa=vxr(),rJa=bxr(),WNi=lNi(),zNi=Rxr(),On=bNi(),Owr=INi(),_$=BNi(),nJa=UNi(),Lwr=jNi(),iJa=GNi(),oJa=$Ni(),sJa={Position:ZKa.Position,Range:XKa.Range,Selection:eJa.Selection,EventEmitter:zKa.Emitter,CancellationTokenSource:WKa.CancellationTokenSource,Diagnostic:VNi.Diagnostic,Location:KKa.Location,DiagnosticRelatedInformation:VNi.DiagnosticRelatedInformation,TextEdit:zNi.TextEdit,WorkspaceEdit:Owr.WorkspaceEdit,Uri:YKa.URI,MarkdownString:JKa.MarkdownString,DiagnosticSeverity:_$.DiagnosticSeverity,TextEditorCursorStyle:_$.TextEditorCursorStyle,TextEditorLineNumbersStyle:_$.TextEditorLineNumbersStyle,TextEditorRevealType:_$.TextEditorRevealType,EndOfLine:zNi.EndOfLine,l10n:{t:nJa.t},ExtensionMode:_$.ExtensionMode,ChatVariableLevel:_$.ChatVariableLevel,ChatResponseClearToPreviousToolInvocationReason:On.ChatResponseClearToPreviousToolInvocationReason,ChatResponseMarkdownPart:On.ChatResponseMarkdownPart,ChatResponseFileTreePart:On.ChatResponseFileTreePart,ChatResponseAnchorPart:On.ChatResponseAnchorPart,ChatResponseMovePart:On.ChatResponseMovePart,ChatResponseExtensionsPart:On.ChatResponseExtensionsPart,ChatResponseProgressPart:On.ChatResponseProgressPart,ChatResponseProgressPart2:On.ChatResponseProgressPart2,ChatResponseWarningPart:On.ChatResponseWarningPart,ChatResponseInfoPart:On.ChatResponseInfoPart,ChatResponseHookPart:On.ChatResponseHookPart,ChatResponseReferencePart:On.ChatResponseReferencePart,ChatResponseReferencePart2:On.ChatResponseReferencePart2,ChatResponseCodeCitationPart:On.ChatResponseCodeCitationPart,ChatResponseCommandButtonPart:On.ChatResponseCommandButtonPart,ChatResponseExternalEditPart:On.ChatResponseExternalEditPart,ChatResponseMarkdownWithVulnerabilitiesPart:On.ChatResponseMarkdownWithVulnerabilitiesPart,ChatResponseCodeblockUriPart:On.ChatResponseCodeblockUriPart,ChatResponseTextEditPart:On.ChatResponseTextEditPart,ChatResponseNotebookEditPart:On.ChatResponseNotebookEditPart,ChatResponseWorkspaceEditPart:On.ChatResponseWorkspaceEditPart,ChatResponseConfirmationPart:On.ChatResponseConfirmationPart,ChatQuestion:On.ChatQuestion,ChatQuestionType:On.ChatQuestionType,ChatResponseQuestionCarouselPart:On.ChatResponseQuestionCarouselPart,ChatRequestTurn:On.ChatRequestTurn,ChatResponseTurn:On.ChatResponseTurn,ChatRequestEditorData:On.ChatRequestEditorData,ChatRequestNotebookData:On.ChatRequestNotebookData,NewSymbolName:Lwr.NewSymbolName,NewSymbolNameTag:Lwr.NewSymbolNameTag,NewSymbolNameTriggerKind:Lwr.NewSymbolNameTriggerKind,ChatLocation:_$.ChatLocation,SymbolInformation:WNi.SymbolInformation,LanguageModelToolResult:On.LanguageModelToolResult,ExtendedLanguageModelToolResult:On.LanguageModelToolResult,LanguageModelToolResult2:On.LanguageModelToolResult2,LanguageModelPromptTsxPart:On.LanguageModelPromptTsxPart,LanguageModelTextPart:On.LanguageModelTextPart,LanguageModelDataPart:On.LanguageModelDataPart,LanguageModelToolExtensionSource:On.LanguageModelToolExtensionSource,LanguageModelToolMCPSource:On.LanguageModelToolMCPSource,ChatReferenceBinaryData:On.ChatReferenceBinaryData,ChatReferenceDiagnostic:On.ChatReferenceDiagnostic,TextSearchMatch2:On.TextSearchMatch2,AISearchKeyword:On.AISearchKeyword,ExcludeSettingOptions:On.ExcludeSettingOptions,NotebookCellKind:U4e.NotebookCellKind,NotebookRange:U4e.NotebookRange,NotebookEdit:U4e.NotebookEdit,NotebookCellData:U4e.NotebookCellData,NotebookData:U4e.NotebookData,ChatErrorLevel:On.ChatErrorLevel,ChatInputNotificationSeverity:On.ChatInputNotificationSeverity,TerminalShellExecutionCommandLineConfidence:iJa.TerminalShellExecutionCommandLineConfidence,ChatRequestEditedFileEventKind:On.ChatRequestEditedFileEventKind,ChatResponsePullRequestPart:On.ChatResponsePullRequestPart,LanguageModelTextPart2:On.LanguageModelTextPart2,LanguageModelDataPart2:On.LanguageModelDataPart2,LanguageModelThinkingPart:On.LanguageModelThinkingPart,LanguageModelPartAudience:On.LanguageModelPartAudience,ChatResponseThinkingProgressPart:On.ChatResponseThinkingProgressPart,LanguageModelToolCallPart:On.LanguageModelToolCallPart,LanguageModelToolResultPart:On.LanguageModelToolResultPart,LanguageModelToolResultPart2:On.LanguageModelToolResultPart2,LanguageModelChatMessageRole:On.LanguageModelChatMessageRole,LanguageModelChatMessage:On.LanguageModelChatMessage,LanguageModelChatToolMode:On.LanguageModelChatToolMode,TextEditorSelectionChangeKind:Owr.TextEditorSelectionChangeKind,TextDocumentChangeReason:Owr.TextDocumentChangeReason,ChatToolInvocationPart:On.ChatToolInvocationPart,ChatSubagentToolInvocationData:On.ChatSubagentToolInvocationData,McpToolInvocationContentData:On.McpToolInvocationContentData,ChatResponseTurn2:On.ChatResponseTurn2,ChatRequestTurn2:On.ChatRequestTurn2,LanguageModelError:On.LanguageModelError,SymbolKind:WNi.SymbolKind,SnippetString:tJa.SnippetString,SnippetTextEdit:rJa.SnippetTextEdit,FileType:_$.FileType,ChatSessionStatus:On.ChatSessionStatus,authentication:{getSession:a(async()=>{throw new Error("authentication.getSession not mocked in test")},"getSession")},McpHttpServerDefinition:On.McpHttpServerDefinition,McpStdioServerDefinition:On.McpStdioServerDefinition,ThemeIcon:oJa.ThemeIcon};YNi.exports=sJa});var KNi=I(NAe=>{"use strict";p();Object.defineProperty(NAe,"__esModule",{value:!0});NAe.UseData=NAe.UseState=void 0;var Bwr=class{static{a(this,"UseState")}constructor(e){this.states=e,this.currentIndex=0,this.stateChanged=!1}useState(e){let r=this.currentIndex;if(this.states[r]===void 0){let o=typeof e=="function"?e():e;this.states[r]=o}let n=a(o=>{let s=typeof o=="function"?o(this.states[r]):o;this.states[r]=s,this.stateChanged=!0},"setState");return this.currentIndex++,[this.states[r],n]}hasChanged(){return this.stateChanged}};NAe.UseState=Bwr;var Fwr=class{static{a(this,"UseData")}constructor(e){this.measureUpdateTime=e,this.consumers=[]}useData(e,r){this.consumers.push(n=>{if(e(n))return r(n)})}async updateData(e){if(this.consumers.length>0){let r=performance.now();for(let n of this.consumers)await n(e);this.measureUpdateTime(performance.now()-r)}}};NAe.UseData=Fwr});var ZNi=I(jyt=>{"use strict";p();Object.defineProperty(jyt,"__esModule",{value:!0});jyt.VirtualPromptReconciler=void 0;var JNi=KNi(),Uwr=class{static{a(this,"VirtualPromptReconciler")}constructor(e){this.lifecycleData=new Map,this.vTree=this.virtualizeElement(e,"$",0)}reconcile(e){if(!this.vTree)throw new Error("No tree to reconcile, make sure to pass a valid prompt");return e?.isCancellationRequested?this.vTree:(this.vTree=this.reconcileNode(this.vTree,"$",0,e),this.vTree)}reconcileNode(e,r,n,o){if(!e.children&&!e.lifecycle)return e;let s=e;if(e.lifecycle?.isRemountRequired()){let l=this.collectChildPaths(e);s=this.virtualizeElement(e.component,r,n);let u=this.collectChildPaths(s);this.cleanupState(l,u)}else if(e.children){let l=[];for(let u=0;u"u")){if(typeof e=="string"||typeof e=="number")return{name:typeof e,path:`${r}[${n}]`,props:{value:e},component:e};if(aJa(e.type)){let o=e.type(e.props.children),s=r!=="$"?`[${n}]`:"",c=`${r}${s}.${o.type}`,l=o.children.map((u,d)=>this.virtualizeElement(u,c,d));return this.ensureUniqueKeys(l),{name:o.type,path:c,children:l.flat().filter(u=>u!==void 0),component:e}}return this.virtualizeFunctionComponent(r,n,e,e.type)}}virtualizeFunctionComponent(e,r,n,o){let s=n.props.key?`["${n.props.key}"]`:`[${r}]`,c=`${e}${s}.${o.name}`,l=new qwr(this.getOrCreateLifecycleData(c)),u=o(n.props,l),h=(Array.isArray(u)?u:[u]).map((m,g)=>this.virtualizeElement(m,c,g)).flat().filter(m=>m!==void 0);return this.ensureUniqueKeys(h),{name:o.name,path:c,props:n.props,children:h,component:n,lifecycle:l}}ensureUniqueKeys(e){let r=new Map;for(let o of e){if(!o)continue;let s=o.props?.key;s&&r.set(s,(r.get(s)||0)+1)}let n=Array.from(r.entries()).filter(([o,s])=>s>1).map(([o])=>o);if(n.length>0)throw new Error(`Duplicate keys found: ${n.join(", ")}`)}collectChildPaths(e){let r=[];if(e?.children)for(let n of e.children)n&&(r.push(n.path),r.push(...this.collectChildPaths(n)));return r}cleanupState(e,r){for(let n of e)r.includes(n)||this.lifecycleData.delete(n)}getOrCreateLifecycleData(e){return this.lifecycleData.has(e)||this.lifecycleData.set(e,new Qwr([])),this.lifecycleData.get(e)}createPipe(){return{pump:a(async e=>{await this.pumpData(e)},"pump")}}async pumpData(e){if(!this.vTree)throw new Error("No tree to pump data into. Pumping data before initializing?");await this.recursivelyPumpData(e,this.vTree)}async recursivelyPumpData(e,r){if(!r)throw new Error("Can't pump data into undefined node.");await r.lifecycle?.dataHook.updateData(e);for(let n of r.children||[])await this.recursivelyPumpData(e,n)}};jyt.VirtualPromptReconciler=Uwr;var Qwr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},qwr=class{static{a(this,"PromptElementLifecycle")}constructor(e){this.lifecycleData=e,this.stateHook=new JNi.UseState(e.state),this.dataHook=new JNi.UseData(r=>{e._updateTimeMs=r})}useState(e){return this.stateHook.useState(e)}useData(e,r){this.dataHook.useData(e,r)}isRemountRequired(){return this.stateHook.hasChanged()}};function aJa(t){return typeof t=="function"&&"isFragmentFunction"in t}a(aJa,"isFragmentFunction")});var XNi=I(Hyt=>{"use strict";p();Object.defineProperty(Hyt,"__esModule",{value:!0});Hyt.VirtualPrompt=void 0;var cJa=ZNi(),jwr=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new cJa.VirtualPromptReconciler(e)}snapshotNode(e,r){if(!e)return;if(r?.isCancellationRequested)return"cancelled";let n=[];for(let o of e.children??[]){let s=this.snapshotNode(o,r);if(s==="cancelled")return"cancelled";s!==void 0&&n.push(s)}return{value:e.props?.value?.toString(),name:e.name,path:e.path,props:e.props,children:n,statistics:{updateDataTimeMs:e.lifecycle?.lifecycleData.getUpdateTimeMsAndReset()}}}snapshot(e){try{let r=this.reconciler.reconcile(e);if(e?.isCancellationRequested)return{snapshot:void 0,status:"cancelled"};if(!r)throw new Error("Invalid virtual prompt tree");let n=this.snapshotNode(r,e);return n==="cancelled"||e?.isCancellationRequested?{snapshot:void 0,status:"cancelled"}:{snapshot:n,status:"ok"}}catch(r){return{snapshot:void 0,status:"error",error:r}}}createPipe(){return this.reconciler.createPipe()}};Hyt.VirtualPrompt=jwr});var w6=I(Gyt=>{"use strict";p();Object.defineProperty(Gyt,"__esModule",{value:!0});Gyt.Text=lJa;Gyt.Chunk=uJa;function lJa(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(lJa,"Text");function uJa(t){return t.children}a(uJa,"Chunk")});var v$=I(R6=>{"use strict";p();Object.defineProperty(R6,"__esModule",{value:!0});R6.PerCompletionContextProviderStatistics=R6.ContextProviderStatistics=R6.ICompletionsContextProviderService=void 0;R6.componentStatisticsToPromptMatcher=pJa;var dJa=nn(),fJa=C6();R6.ICompletionsContextProviderService=(0,dJa.createServiceIdentifier)("ICompletionsContextProviderService");var Hwr=class{static{a(this,"ContextProviderStatistics")}constructor(e=()=>new $yt){this.createStatistics=e,this.statistics=new fJa.LRUCacheMap(25)}getStatisticsForCompletion(e){let r=this.statistics.get(e);if(r)return r;let n=this.createStatistics();return this.statistics.set(e,n),n}getPreviousStatisticsForCompletion(e){let r=Array.from(this.statistics.keys());for(let n=r.length-1;n>=0;n--){let o=r[n];if(o!==e)return this.statistics.peek(o)}}};R6.ContextProviderStatistics=Hwr;var $yt=class{static{a(this,"PerCompletionContextProviderStatistics")}constructor(){this._expectations=new Map,this._lastResolution=new Map,this._statistics=new Map,this.opportunityId=void 0}addExpectations(e,r){let n=this._expectations.get(e)??[];this._expectations.set(e,[...n,...r])}clearExpectations(){this._expectations.clear()}setLastResolution(e,r){this._lastResolution.set(e,r)}setOpportunityId(e){this.opportunityId=e}get(e){return this._statistics.get(e)}getAllUsageStatistics(){return this._statistics.entries()}computeMatch(e){try{for(let[r,n]of this._expectations){if(n.length===0)continue;let o=this._lastResolution.get(r)??"none";if(o==="none"||o==="error"){this._statistics.set(r,{usage:"none",resolution:o});continue}let s=[];for(let[d,f]of n){let h={id:d.id,type:d.type};if(d.origin&&(h.origin=d.origin),f==="content_excluded"){s.push({...h,usage:"none_content_excluded"});continue}let m=e.find(g=>g.source===d);m===void 0?s.push({...h,usage:"error"}):s.push({...h,usage:m.expectedTokens>0&&m.expectedTokens===m.actualTokens?"full":m.actualTokens>0?"partial":"none",expectedTokens:m.expectedTokens,actualTokens:m.actualTokens})}let l=s.reduce((d,f)=>f.usage==="full"?d+1:f.usage==="partial"?d+.5:d,0)/n.length,u=l===1?"full":l===0?"none":"partial";this._statistics.set(r,{resolution:o,usage:u,usageDetails:s})}}finally{this.clearExpectations(),this._lastResolution.clear()}}};R6.PerCompletionContextProviderStatistics=$yt;function pJa(t){return t.map(e=>{if(!(e.source===void 0||e.expectedTokens===void 0||e.actualTokens===void 0))return{source:e.source,expectedTokens:e.expectedTokens,actualTokens:e.actualTokens}}).filter(e=>e!==void 0)}a(pJa,"componentStatisticsToPromptMatcher")});var j4e=I(q4e=>{"use strict";p();Object.defineProperty(q4e,"__esModule",{value:!0});q4e.filterContextItemsByType=AJa;q4e.filterSupportedContextItems=yJa;q4e.addOrValidateContextItemsIDs=_Ja;var hJa=P0(),mJa=nd(),Gwr=T0(),gJa=o4e(),$wr=Dl(),Q4e;(function(t){function e(r){return!(r.importance!==void 0&&(typeof r.importance!="number"||!Number.isInteger(r.importance)||r.importance<0||r.importance>100)||r.id!==void 0&&typeof r.id!="string"||r.origin!==void 0&&!gJa.ContextItemOrigin.is(r.origin))}a(e,"is"),t.is=e})(Q4e||(Q4e={}));var Vwr;(function(t){function e(r){if(!Q4e.is(r))return!1;let n=r;return typeof n.name=="string"&&typeof n.value=="string"}a(e,"is"),t.is=e})(Vwr||(Vwr={}));var Wwr;(function(t){function e(r){if(!Q4e.is(r))return!1;let n=r;if(typeof n.uri!="string"||typeof n.value!="string")return!1;if(n.additionalUris===void 0)return!0;if(!Array.isArray(n.additionalUris))return!1;for(let o of n.additionalUris)if(typeof o!="string")return!1;return!0}a(e,"is"),t.is=e})(Wwr||(Wwr={}));var zwr;(function(t){function e(r){if(!Q4e.is(r))return!1;let n=r;if(!mJa.URI.isUri(n.uri)||!Array.isArray(n.values))return!1;for(let o of n.values)if(!(o instanceof hJa.Diagnostic))return!1;return!0}a(e,"is"),t.is=e})(zwr||(zwr={}));var Ywr;(function(t){function e(r){if(Vwr.is(r))return"Trait";if(Wwr.is(r))return"CodeSnippet";if(zwr.is(r))return"DiagnosticBag"}a(e,"is"),t.is=e})(Ywr||(Ywr={}));function AJa(t,e){return t.map(r=>{let n=r.data.filter(o=>o.type===e);return n.length>0?{...r,data:n}:void 0}).filter(r=>r!==void 0)}a(AJa,"filterContextItemsByType");function yJa(t){let e=[],r=0;return t.forEach(n=>{let o=Ywr.is(n);o!==void 0?e.push({...n,type:o}):r++}),[e,r]}a(yJa,"filterSupportedContextItems");function EJa(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(EJa,"validateContextItemId");function _Ja(t,e){let r=new Set,n=t.get($wr.ICompletionsLogTargetService),o=[];for(let s of e){let c=s.id??(0,Gwr.generateUuid)();if(!EJa(c)){let l=(0,Gwr.generateUuid)();$wr.logger.error(n,`Invalid context item ID ${c}, replacing with ${l}`),c=l}if(r.has(c)){let l=(0,Gwr.generateUuid)();$wr.logger.error(n,`Duplicate context item ID ${c}, replacing with ${l}`),c=l}r.add(c),o.push({...s,id:c})}return o}a(_Ja,"addOrValidateContextItemsIDs")});var Kwr=I(Vyt=>{"use strict";p();Object.defineProperty(Vyt,"__esModule",{value:!0});Vyt.getCodeSnippetsFromContextItems=TJa;Vyt.addRelativePathToCodeSnippets=IJa;var vJa=s1(),CJa=v$(),bJa=j4e(),SJa="content_excluded";async function TJa(t,e,r,n){let o=(0,bJa.filterContextItemsByType)(r,"CodeSnippet");if(o.length===0)return[];let s=new Set,c=o.flatMap(h=>h.data.map(m=>(s.add(m.uri),m.additionalUris?.forEach(g=>s.add(g)),{providerId:h.providerId,data:m}))),l=t.get(CJa.ICompletionsContextProviderService),u=t.get(vJa.ICompletionsTextDocumentManagerService),d=new Map;await Promise.all(Array.from(s).map(async h=>{d.set(h,await u.getTextDocumentValidation({uri:h}))}));let f=l.getStatisticsForCompletion(e);return c.filter(h=>{let g=[h.data.uri,...h.data.additionalUris??[]].every(A=>d.get(A)?.status==="valid");return g?f.addExpectations(h.providerId,[[h.data,"included"]]):f.addExpectations(h.providerId,[[h.data,SJa]]),g}).map(h=>h.data)}a(TJa,"getCodeSnippetsFromContextItems");function IJa(t,e){return e.map(r=>({snippet:r,relativePath:t.getRelativePath(r)}))}a(IJa,"addRelativePathToCodeSnippets")});var Jwr=I(Yyt=>{"use strict";p();Object.defineProperty(Yyt,"__esModule",{value:!0});Yyt.CodeSnippets=void 0;var Wyt=rL(),zyt=w6(),xJa=k6(),wJa=Kwr(),RJa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(xJa.isCompletionRequestData,d=>{d.codeSnippets!==r&&n(d.codeSnippets),d.document.uri!==o?.uri&&s(d.document)}),!r||r.length===0||!o)return;let c=(0,wJa.addRelativePathToCodeSnippets)(t.tdms,r),l=new Map;for(let d of c){let f=d.relativePath??d.snippet.uri,h=l.get(f);h===void 0&&(h=[],l.set(f,h)),h.push(d)}let u=[];for(let[d,f]of l.entries()){let h=f.filter(m=>m.snippet.value.length>0);h.length>0&&u.push({chunkElements:h.map(m=>m.snippet),importance:Math.max(...h.map(m=>m.snippet.importance??0)),uri:d})}if(u.length!==0)return u.sort((d,f)=>f.importance-d.importance),u.reverse(),u.map(d=>{let f=[];return f.push((0,Wyt.jsx)(zyt.Text,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push((0,Wyt.jsx)(zyt.Text,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&m{"use strict";p();Object.defineProperty(MAe,"__esModule",{value:!0});MAe.CompletionsContext=eMi;MAe.StableCompletionsContext=tMi;MAe.AdditionalCompletionsContext=rMi;MAe.isContextNode=kJa;function eMi(t){return t.children}a(eMi,"CompletionsContext");function tMi(t){return t.children}a(tMi,"StableCompletionsContext");function rMi(t){return t.children}a(rMi,"AdditionalCompletionsContext");function kJa(t){return t.name===eMi.name||t.name===tMi.name||t.name===rMi.name}a(kJa,"isContextNode")});var Xwr=I(G4e=>{"use strict";p();Object.defineProperty(G4e,"__esModule",{value:!0});G4e.SnapshotWalker=void 0;G4e.defaultTransformers=nMi;var PJa=w6(),Zwr=class{static{a(this,"SnapshotWalker")}constructor(e,r=nMi()){this.snapshot=e,this.transformers=r}walkSnapshot(e){this.walkSnapshotNode(this.snapshot,void 0,e,{})}walkSnapshotNode(e,r,n,o){let s=this.transformers.reduce((l,u)=>u(e,r,l),{...o});if(n(e,r,s))for(let l of e.children??[])this.walkSnapshotNode(l,e,n,s)}};G4e.SnapshotWalker=Zwr;function nMi(){return[(t,e,r)=>{r.weight===void 0&&(r.weight=1);let n=t.props?.weight??1,o=typeof n=="number"?Math.max(0,Math.min(1,n)):1;return{...r,weight:o*r.weight}},(t,e,r)=>{if(t.name===PJa.Chunk.name){let n=r.chunks?new Set(r.chunks):new Set;return n.add(t.path),{...r,chunks:n}}return r},(t,e,r)=>t.props?.source!==void 0?{...r,source:t.props.source}:r]}a(nMi,"defaultTransformers")});var iMi=I(eRr=>{"use strict";p();Object.defineProperty(eRr,"__esModule",{value:!0});eRr.findEditDistanceScore=DJa;function DJa(t,e){if(t.length===0||e.length===0)return{score:t.length+e.length};let r=Array.from({length:t.length}).map(()=>Array.from({length:e.length}).map(()=>0));for(let n=0;n{"use strict";p();Object.defineProperty(LD,"__esModule",{value:!0});LD.MAX_EDIT_DISTANCE_LENGTH=void 0;LD.CurrentFile=LJa;LD.BeforeCursor=nRr;LD.AfterCursor=iRr;LD.DocumentPrefix=BJa;LD.DocumentSuffix=FJa;var FR=rL(),OAe=w6(),NJa=JG(),MJa=iMi(),OJa=Ore(),tRr=k6();LD.MAX_EDIT_DISTANCE_LENGTH=50;function rRr(t){let e=t*4,r=t*.1;return Math.floor(e+r)}a(rRr,"approximateMaxCharacters");function LJa(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(tRr.isCompletionRequestData,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=rRr(c);return(0,FR.jsxs)(FR.Fragment,{children:[(0,FR.jsx)(nRr,{document:r,position:o,maxCharacters:m}),(0,FR.jsx)(iRr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(LJa,"CurrentFile");function nRr(t){if(t.document===void 0||t.position===void 0)return(0,FR.jsx)(OAe.Text,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),(0,FR.jsx)(OAe.Text,{children:e})}a(nRr,"BeforeCursor");function iRr(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return(0,FR.jsx)(OAe.Text,{});let o=t.document.getText({start:t.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}});o.length>t.maxCharacters&&(o=o.slice(0,t.maxCharacters));let s=o.replace(/^.*/,"").trimStart();if(s==="")return(0,FR.jsx)(OAe.Text,{});if(r===s)return(0,FR.jsx)(OAe.Text,{children:r});let c=s;if(r!==""){let l=(0,OJa.getTokenizer)(t.tokenizer),u=l.takeFirstTokens(s,LD.MAX_EDIT_DISTANCE_LENGTH),d=l.takeFirstTokens(r,LD.MAX_EDIT_DISTANCE_LENGTH);u.tokens.length>0&&d.tokens.length>0&&u.tokens[0]===d.tokens[0]&&100*(0,MJa.findEditDistanceScore)(u.tokens,d.tokens)?.score<(t.suffixMatchThreshold??NJa.DEFAULT_SUFFIX_MATCH_THRESHOLD)*u.tokens.length&&(c=r)}return c!==r&&n(c),(0,FR.jsx)(OAe.Text,{children:c})}a(iRr,"AfterCursor");function BJa(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(tRr.isCompletionRequestData,d=>{let f=d.document;(d.document.uri!==r?.uri||f.getText()!==r?.getText())&&n(f),d.position!==o&&s(d.position),d.maxPromptTokens!==c&&l(d.maxPromptTokens)});let u=rRr(c);return(0,FR.jsx)(nRr,{document:r,position:o,maxCharacters:u})}a(BJa,"DocumentPrefix");function FJa(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(tRr.isCompletionRequestData,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=rRr(c);return(0,FR.jsx)(iRr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(FJa,"DocumentSuffix")});var sRr=I(tne=>{"use strict";p();Object.defineProperty(tne,"__esModule",{value:!0});tne.WishlistElision=void 0;tne.makePrompt=UJa;tne.makePrefixPrompt=QJa;tne.makeContextPrompt=qJa;var oRr=class{static{a(this,"WishlistElision")}elide(e,r,n,o,s){if(r<=0)throw new Error("Prefix limit must be greater than 0");let[c,l]=this.preparePrefixBlocks(e,s),{elidedSuffix:u,adjustedPrefixTokenLimit:d}=this.elideSuffix(n,o,r,l,s),f=this.elidePrefix(c,d,l,s);return{blocks:[u,...f],cycles:1}}preparePrefixBlocks(e,r){let n=0,o=new Set;return[e.map((c,l)=>{let u=0,f=c.value.split(/([^\n]*\n+)/).filter(m=>m!=="").map(m=>{let g=r.tokenLength(m);return u+=g,n+=g,{line:m,componentPath:c.componentPath,tokens:g}}),h=c.componentPath;if(o.has(h))throw new Error(`Duplicate component path in prefix blocks: ${h}`);return o.add(h),{...c,tokens:u,markedForRemoval:!1,originalIndex:l,lines:f}}),n]}elideSuffix(e,r,n,o,s){let c=e.value;if(c.length===0||r<=0)return{elidedSuffix:{...e,tokens:0,elidedValue:"",elidedTokens:0},adjustedPrefixTokenLimit:n+Math.max(0,r)};o!f.markedForRemoval).flatMap(f=>f.lines);if(c.length===0)return[];let[l,u]=this.trimPrefixLinesToFit(c,r,o),d=u;return s.map(f=>{if(f.markedForRemoval)return d+f.tokens<=r&&!f.chunks?(d+=f.tokens,{...f,elidedValue:f.value,elidedTokens:f.tokens}):{...f,elidedValue:"",elidedTokens:0};let h=l.filter(g=>g.componentPath===f.componentPath&&g.line!=="").map(g=>g.line).join(""),m=f.tokens;return h!==f.value&&(m=h!==""?o.tokenLength(h):0),{...f,elidedValue:h,elidedTokens:m}})}removeLowWeightPrefixBlocks(e,r,n){let o=n;e.sort((s,c)=>s.weight-c.weight);for(let s of e){if(o<=r)break;if(s.weight!==1&&!(s.chunks&&s.markedForRemoval))if(s.chunks&&s.chunks.size>0)for(let c of e)!c.markedForRemoval&&c.chunks&&[...s.chunks].every(l=>c.chunks?.has(l))&&(c.markedForRemoval=!0,o-=c.tokens);else s.markedForRemoval=!0,o-=s.tokens}return e.sort((s,c)=>s.originalIndex-c.originalIndex)}trimPrefixLinesToFit(e,r,n){let o=0,s=[];for(let c=e.length-1;c>=0;c--){let l=e[c],u=l.tokens;if(o+u<=r)s.unshift(l),o+=u;else break}if(s.length===0){let c=e[e.length-1];if(c&&c.line.length>0){let u=n.takeLastTokens(c.line,r);return s.push({line:u.text,componentPath:c.componentPath,tokens:u.tokens.length}),[s,u.tokens.length]}let l=`Cannot fit prefix within limit of ${r} tokens`;throw new Error(l)}return[s,o]}};tne.WishlistElision=oRr;function UJa(t){return t.map(e=>e.elidedValue).join("")}a(UJa,"makePrompt");function QJa(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(QJa,"makePrefixPrompt");function qJa(t){if(t.length===0)return[];let e=new Map;for(let o of t)if(o.type==="context"&&o.index!==void 0){e.has(o.index)||e.set(o.index,[]);let s=o.elidedValue.trim();s.length>0&&e.get(o.index).push(s)}let r=Math.max(...Array.from(e.keys()),-1),n=[];for(let o=0;o<=r;o++){let s=e.get(o);if(s&&s.length>0){let c=s.join(` -`).trim();n.push(c)}else n.push("")}return n}a(qJa,"makeContextPrompt")});var lRr=I(C$=>{"use strict";p();Object.defineProperty(C$,"__esModule",{value:!0});C$.transformers=C$.CompletionsPromptRenderer=void 0;C$.normalizeLineEndings=cRr;var cMi=Xwr(),oMi=k4e(),sMi=Ore(),jJa=H4e(),Kyt=$4e(),aMi=sRr(),HJa=5,aRr=class{static{a(this,"CompletionsPromptRenderer")}constructor(){this.renderId=0,this.formatPrefix=aMi.makePrompt}render(e,r,n){let o=this.renderId++,s=performance.now();try{if(n?.isCancellationRequested)return{status:"cancelled"};let c=r.delimiter??"",l=r.tokenizer??sMi.TokenizerName.o200k,{prefixBlocks:u,suffixBlock:d,componentStatistics:f}=this.processSnapshot(e,c,r.languageId),{prefixTokenLimit:h,suffixTokenLimit:m}=this.getPromptLimits(d,r),g=performance.now(),A=new aMi.WishlistElision,{blocks:[y,...E]}=A.elide(u,h,d,m,(0,sMi.getTokenizer)(l)),_=performance.now(),v=this.formatPrefix(E),b=this.formatContext?this.formatContext(E):void 0,T=y.elidedValue,w=E.reduce((R,x)=>R+x.elidedTokens,0);return f.push(...GJa([...E,y])),{prefix:v,prefixTokens:w,suffix:T,suffixTokens:y.elidedTokens,context:b,status:"ok",metadata:{renderId:o,rendererName:"c",tokenizer:l,elisionTimeMs:_-g,renderTimeMs:performance.now()-s,componentStatistics:f,updateDataTimeMs:f.reduce((R,x)=>R+(x.updateDataTimeMs??0),0)}}}catch(c){return{status:"error",error:c}}}getPromptLimits(e,r){let n=e?.value??"",o=r.promptTokenLimit,s=r.suffixPercent;if(n.length===0||s===0)return{prefixTokenLimit:o,suffixTokenLimit:0};o=n.length>0?o-HJa:o;let c=Math.ceil(o*(s/100));return{prefixTokenLimit:o-c,suffixTokenLimit:c}}processSnapshot(e,r,n){let o=[],s=[],c=[],l=!1;if(new cMi.SnapshotWalker(e,C$.transformers).walkSnapshot((f,h,m)=>{if(f===e||(f.name===Kyt.CurrentFile.name&&(l=!0),f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.value===void 0||f.value===""))return!0;let g=m.chunks;if(m.type==="suffix")s.push({value:cRr(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let A=f.value.endsWith(r)?f.value:f.value+r,y=A;m.type==="prefix"?y=f.value:(0,oMi.isShebangLine)(f.value)?y=A:y=(0,oMi.commentBlockAsSingles)(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:cRr(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${Kyt.CurrentFile.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}};C$.CompletionsPromptRenderer=aRr;C$.transformers=[...(0,cMi.defaultTransformers)(),(t,e,r)=>(0,jJa.isContextNode)(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===Kyt.BeforeCursor.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===Kyt.AfterCursor.name?{...r,type:"suffix"}:r];function GJa(t){return t.map(e=>{let r={componentPath:e.componentPath};return e.tokens!==0&&(r.expectedTokens=e.tokens,r.actualTokens=e.elidedTokens),e.nodeStatistics.updateDataTimeMs!==void 0&&(r.updateDataTimeMs=e.nodeStatistics.updateDataTimeMs),e.source&&(r.source=e.source),r})}a(GJa,"computeComponentStatistics");function cRr(t){return t.replace(/\r\n?/g,` -`)}a(cRr,"normalizeLineEndings")});var Jyt=I(LAe=>{"use strict";p();Object.defineProperty(LAe,"__esModule",{value:!0});LAe.ILanguageContextProviderService=LAe.ProviderTarget=void 0;var $Ja=nn(),lMi;(function(t){t.NES="nes",t.Completions="completions"})(lMi||(LAe.ProviderTarget=lMi={}));LAe.ILanguageContextProviderService=(0,$Ja.createServiceIdentifier)("ILanguageContextProviderService")});var rne=I(BAe=>{"use strict";p();Object.defineProperty(BAe,"__esModule",{value:!0});BAe.RuntimeMode=BAe.ICompletionsRuntimeModeService=void 0;var VJa=nn();BAe.ICompletionsRuntimeModeService=(0,VJa.createServiceIdentifier)("completionsRuntimeModeService");var uRr=class t{static{a(this,"RuntimeMode")}constructor(e){this.flags=e}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:uMi(r,n),verboseLogging:zJa(r,n),testMode:e,simulation:WJa(n)})}isRunningInTest(){return this.flags.testMode}shouldFailForDebugPurposes(){return this.isRunningInTest()}isDebugEnabled(){return this.flags.debug}isVerboseLoggingEnabled(){return this.flags.verboseLogging}isRunningInSimulation(){return this.flags.simulation}};BAe.RuntimeMode=uRr;function uMi(t,e){return t.includes("--debug")||dRr(e,"DEBUG")}a(uMi,"determineDebugFlag");function WJa(t){return dRr(t,"SIMULATION")}a(WJa,"determineSimulationFlag");function zJa(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||dRr(e,"VERBOSE")||uMi(t,e)}a(zJa,"determineVerboseLoggingEnabled");function dRr(t,e){for(let r of["GH_COPILOT_","GITHUB_COPILOT_"]){let n=t[`${r}${e}`];if(n)return n==="1"||n?.toLowerCase()==="true"}return!1}a(dRr,"determineEnvFlagEnabled")});var hMi=I(V4e=>{"use strict";p();Object.defineProperty(V4e,"__esModule",{value:!0});V4e.eventToPromise=YJa;V4e.isArrayOfT=pMi;V4e.resolveAll=JJa;var dMi=y4e();async function YJa(t){let e=new dMi.Deferred,r=t(n=>{e.resolve(n),r.dispose()});return e.promise}a(YJa,"eventToPromise");async function KJa(t){if(t.isCancellationRequested)return;let e=new dMi.Deferred,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(KJa,"cancellationTokenToPromise");async function fMi(t,e){if(e){let r=KJa(e);await Promise.race([t,r])}else await t}a(fMi,"raceCancellation");function pMi(t){return Array.isArray(t)}a(pMi,"isArrayOfT");async function JJa(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await ZJa(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(JJa,"resolveAll");async function ZJa(t,e){let r;return t instanceof Promise?r=await XJa(t,e):r=await eZa(t,e),r}a(ZJa,"resolve");async function XJa(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{let s=await t;if(e?.isCancellationRequested)return;n={status:"full",resolutionTime:0,value:pMi(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await fMi(o,e),n.resolutionTime=performance.now()-r,n}a(XJa,"resolvePromise");async function eZa(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{for await(let s of t){if(e?.isCancellationRequested)return;n.status!=="partial"&&(n={status:"partial",resolutionTime:0,value:[]}),n.value.push(s)}e?.isCancellationRequested||(n.status!=="partial"?n={status:"full",resolutionTime:0,value:[]}:n.status="full")}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await fMi(o,e),n.resolutionTime=performance.now()-r,n}a(eZa,"resolveIterable")});var mMi=I(pRr=>{"use strict";p();Object.defineProperty(pRr,"__esModule",{value:!0});pRr.fillInCppVSCodeActiveExperiments=iZa;var tZa=fy(),fRr=Dl(),rZa={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},nZa="ms-vscode.cpptools";function iZa(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(nZa))&&oZa(t,r,n)}a(iZa,"fillInCppVSCodeActiveExperiments");function oZa(t,e,r){try{let n=t.get(tZa.ICompletionsFeaturesService),o=t.get(fRr.ICompletionsLogTargetService),s=rZa,c=n.cppContextProviderParams(r);if(c)try{s=JSON.parse(c)}catch(l){fRr.logger.error(o,"Failed to parse cppContextProviderParams",l)}else{let l=n.getContextProviderExpSettings("cpp")?.params;l&&(s={...l})}for(let[l,u]of Object.entries(s))e.set(l,u)}catch(n){fRr.logger.exception(t,n,"fillInCppActiveExperiments")}}a(oZa,"addActiveExperiments")});var AMi=I(hRr=>{"use strict";p();Object.defineProperty(hRr,"__esModule",{value:!0});hRr.fillInCSharpActiveExperiments=aZa;var sZa=fy(),gMi=Dl();function aZa(t,e,r){let n=t.get(sZa.ICompletionsFeaturesService),o=t.get(gMi.ICompletionsLogTargetService);try{let s=n.csharpContextProviderParams(r);if(s){let c=JSON.parse(s);for(let[l,u]of Object.entries(c))e.set(l,u)}else{let c=n.getContextProviderExpSettings("csharp")?.params;if(c)for(let[l,u]of Object.entries(c))e.set(l,u)}}catch(s){return gMi.logger.debug(o,"Failed to get the active C# experiments for the Context Provider API",s),!1}return!0}a(aZa,"fillInCSharpActiveExperiments")});var yMi=I(b$=>{"use strict";p();Object.defineProperty(b$,"__esModule",{value:!0});b$.multiLanguageContextProviderParamsDefault=void 0;b$.fillInMultiLanguageActiveExperiments=uZa;b$.getMultiLanguageContextProviderParamsFromActiveExperiments=pZa;var cZa=fy(),mRr=Dl(),lZa="fallbackContextProvider";b$.multiLanguageContextProviderParamsDefault={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function uZa(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(lZa))&&dZa(t,r,n)}a(uZa,"fillInMultiLanguageActiveExperiments");function dZa(t,e,r){try{let n=fZa(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){mRr.logger.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(dZa,"addActiveExperiments");function fZa(t,e){let r=b$.multiLanguageContextProviderParamsDefault,n=t.get(mRr.ICompletionsLogTargetService),s=t.get(cZa.ICompletionsFeaturesService).multiLanguageContextProviderParams(e);if(s)try{r=JSON.parse(s)}catch(c){mRr.logger.error(n,"Failed to parse multiLanguageContextProviderParams",c)}return r}a(fZa,"getMultiLanguageContextProviderParamsFromExp");function pZa(t){let e={...b$.multiLanguageContextProviderParamsDefault};return t.has("mlcpMaxContextItems")&&(e.mlcpMaxContextItems=Number(t.get("mlcpMaxContextItems"))),t.has("mlcpMaxSymbolMatches")&&(e.mlcpMaxSymbolMatches=Number(t.get("mlcpMaxSymbolMatches"))),t.has("mlcpEnableImports")&&(e.mlcpEnableImports=String(t.get("mlcpEnableImports"))==="true"),e}a(pZa,"getMultiLanguageContextProviderParamsFromActiveExperiments")});var _Mi=I(FAe=>{"use strict";p();Object.defineProperty(FAe,"__esModule",{value:!0});FAe.TS_CONTEXT_PROVIDER_ID=void 0;FAe.fillInTsActiveExperiments=mZa;var hZa=fy(),EMi=Dl();FAe.TS_CONTEXT_PROVIDER_ID="typescript-ai-context-provider";function mZa(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(FAe.TS_CONTEXT_PROVIDER_ID)))return!1;let o=t.get(EMi.ICompletionsLogTargetService),s=t.get(hZa.ICompletionsFeaturesService);try{let c=s.tsContextProviderParams(n);if(c){let l=JSON.parse(c);for(let[u,d]of Object.entries(l))r.set(u,d)}else{let l=s.getContextProviderExpSettings("typescript")?.params;if(l)for(let[u,d]of Object.entries(l))r.set(u,d)}}catch(c){return EMi.logger.debug(o,"Failed to get the active TypeScript experiments for the Context Provider API",c),!1}return!0}a(mZa,"fillInTsActiveExperiments")});var eEt=I(Nl=>{"use strict";p();var _Rr=Nl&&Nl.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},BD=Nl&&Nl.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Nl,"__esModule",{value:!0});Nl.DefaultDiagnosticSettings=Nl.CachedContextProviderRegistry=Nl.MutableContextProviderRegistry=Nl.CoreContextProviderRegistry=Nl.DefaultContextProvidersContainer=Nl.ICompletionsDefaultContextProviders=Nl.ICompletionsContextProviderRegistryService=void 0;Nl.telemetrizeContextItems=SZa;Nl.matchContextItems=TZa;Nl.useContextProviderAPI=xZa;Nl.getDefaultDiagnosticSettings=RZa;var gZa=ri(),vMi=Pl(),vRr=Jyt(),AZa=mh(),SMi=nn(),yZa=Rs(),CRr=Gs(),Zyt=LE(),TMi=fy(),EZa=C6(),P6=Dl(),bRr=rne(),CMi=hMi(),_Za=mMi(),vZa=AMi(),CZa=yMi(),bZa=_Mi(),bMi=j4e(),IMi=v$();Nl.ICompletionsContextProviderRegistryService=(0,SMi.createServiceIdentifier)("ICompletionsContextProviderRegistryService");Nl.ICompletionsDefaultContextProviders=(0,SMi.createServiceIdentifier)("ICompletionsDefaultContextProviders");var gRr=class{static{a(this,"DefaultContextProvidersContainer")}constructor(){this.ids=[]}add(e){this.ids.push(e)}getIds(){return this.ids}};Nl.DefaultContextProvidersContainer=gRr;var Xyt=class{static{a(this,"CoreContextProviderRegistry")}constructor(e,r,n,o,s,c){this.match=e,this.registryService=r,this.runtimeMode=n,this.instantiationService=o,this.logTarget=s,this.contextProviderStatistics=c}registerContextProvider(e){throw new Error("Should not be call. Use ILanguageContextProviderService")}unregisterContextProvider(e){throw new Error("Should not be call. Use ILanguageContextProviderService")}get providers(){return this.registryService.getAllProviders([vRr.ProviderTarget.Completions]).slice()}async resolveAllProviders(e,r,n,o,s,c){if(s?.isCancellationRequested)return P6.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];let l=new Map;this.instantiationService.invokeFunction(vZa.fillInCSharpActiveExperiments,l,o);let u=[],d=this.providers;if(d.length===0)return u;let f=await this.matchProviders(d,n,o),h=f.filter(w=>w[1]>0);if(f.filter(w=>w[1]<=0).forEach(([w,R])=>{let x={providerId:w.id,matchScore:R,resolution:"none",resolutionTimeMs:0,data:[]};u.push(x)}),h.length===0)return u;if(s?.isCancellationRequested)return P6.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];this.instantiationService.invokeFunction(_Za.fillInCppVSCodeActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(CZa.fillInMultiLanguageActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(bZa.fillInTsActiveExperiments,h.map(w=>w[0].id),l,o);let g=new gZa.CancellationTokenSource;if(s){let w=s.onCancellationRequested(R=>{g.cancel(),w.dispose()})}let A=this.runtimeMode.isDebugEnabled()&&!this.runtimeMode.isRunningInSimulation()?0:this.instantiationService.invokeFunction(wZa,n.languageId,o),y=A>0?Date.now()+A:Number.MAX_SAFE_INTEGER,E;A>0&&(E=setTimeout(()=>{g.cancel(),g.dispose()},A));let _=new Map,v={completionId:e,opportunityId:r,documentContext:n,activeExperiments:l,timeBudget:A,timeoutEnd:y,data:c};for(let[w]of h){let R=this.contextProviderStatistics.getPreviousStatisticsForCompletion(e)?.get(w.id);R&&(v.previousUsageStatistics=R);let x=w.resolver.resolve(v,g.token);_.set(w.id,x)}let b=this.contextProviderStatistics.getStatisticsForCompletion(e);b.setOpportunityId(r);let T=await(0,CMi.resolveAll)(_,g.token);E&&clearTimeout(E);for(let[w,R]of h){let x=T.get(w.id);if(x){if(x.status==="error")(0,yZa.isCancellationError)(x.reason)||P6.logger.error(this.logTarget,`Error resolving context from ${w.id}: `,x.reason),u.push({providerId:w.id,matchScore:R,resolution:x.status,resolutionTimeMs:x.resolutionTime,data:[]});else{let P=[...x.value??[]];if((x.status==="none"||x.status==="partial")&&(P6.logger.info(this.logTarget,`Context provider ${w.id} exceeded time budget of ${A}ms`),w.resolver.resolveOnTimeout))try{let q=w.resolver.resolveOnTimeout(v);(0,CMi.isArrayOfT)(q)?P.push(...q):q&&P.push(q),P.length>0&&(x.status="partial")}catch(q){P6.logger.error(this.logTarget,`Error in fallback logic for context provider ${w.id}: `,q)}let[D,N]=(0,bMi.filterSupportedContextItems)(P);N&&P6.logger.error(this.logTarget,`Dropped ${N} context items from ${w.id} due to invalid schema`);let L=this.instantiationService.invokeFunction(bMi.addOrValidateContextItemsIDs,D),B={providerId:w.id,matchScore:R,resolution:x.status,resolutionTimeMs:x.resolutionTime,data:L};u.push(B)}b.setLastResolution(w.id,x.status)}else P6.logger.error(this.logTarget,`Context provider ${w.id} not found in results`)}return u.sort((w,R)=>R.matchScore-w.matchScore)}async matchProviders(e,r,n){let o=this.instantiationService.invokeFunction(xMi,r.languageId,n),s=o.length===1&&o[0]==="*";return await Promise.all(e.map(async l=>{if(!s&&!o.includes(l.id))return[l,0];let u=await this.match(this.instantiationService,l.selector,r);return[l,u]}))}};Nl.CoreContextProviderRegistry=Xyt;Nl.CoreContextProviderRegistry=Xyt=_Rr([BD(1,vRr.ILanguageContextProviderService),BD(2,bRr.ICompletionsRuntimeModeService),BD(3,CRr.IInstantiationService),BD(4,P6.ICompletionsLogTargetService),BD(5,IMi.ICompletionsContextProviderService)],Xyt);var ARr=class extends Xyt{static{a(this,"MutableContextProviderRegistry")}constructor(e,r,n,o,s,c){super(e,r,n,o,s,c),this._providers=[]}registerContextProvider(e){if(e.id.includes(",")||e.id.includes("*"))throw new Error(`A context provider id cannot contain a comma or an asterisk. The id ${e.id} is invalid.`);if(this._providers.find(r=>r.id===e.id))throw new Error(`A context provider with id ${e.id} has already been registered`);this._providers.push(e)}unregisterContextProvider(e){this._providers=this._providers.filter(r=>r.id!==e)}get providers(){return this._providers.slice().concat(super.providers)}};Nl.MutableContextProviderRegistry=ARr;Nl.MutableContextProviderRegistry=ARr=_Rr([BD(1,vRr.ILanguageContextProviderService),BD(2,bRr.ICompletionsRuntimeModeService),BD(3,CRr.IInstantiationService),BD(4,P6.ICompletionsLogTargetService),BD(5,IMi.ICompletionsContextProviderService)],ARr);var yRr=class{static{a(this,"CachedContextProviderRegistry")}constructor(e,r,n){this._cachedContextItems=new EZa.LRUCacheMap(5),this.delegate=n.createInstance(e,r)}registerContextProvider(e){this.delegate.registerContextProvider(e)}unregisterContextProvider(e){this.delegate.unregisterContextProvider(e)}get providers(){return this.delegate.providers}async resolveAllProviders(e,r,n,o,s,c){let l=this._cachedContextItems.get(e);if(e&&l&&l.length>0)return l;let u=await this.delegate.resolveAllProviders(e,r,n,o,s,c);return u.length>0&&e&&this._cachedContextItems.set(e,u),u}};Nl.CachedContextProviderRegistry=yRr;Nl.CachedContextProviderRegistry=yRr=_Rr([BD(2,CRr.IInstantiationService)],yRr);function SZa(t,e,r){let n=t.getStatisticsForCompletion(e);return r.map(s=>{let{providerId:c,resolution:l,resolutionTimeMs:u,matchScore:d,data:f}=s,h=n.get(c),m=h?.usage??"none";(d<=0||l==="none"||l==="error")&&(m="none");let g={providerId:c,resolution:l,resolutionTimeMs:u,usage:m,usageDetails:h?.usageDetails,matched:d>0,numResolvedItems:f.length},A=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="full"||E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0,y=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0;return A!==void 0&&(g.numUsedItems=A),y!==void 0&&(g.numPartiallyUsedItems=y),g})}a(SZa,"telemetrizeContextItems");function TZa(t){return t.matchScore>0&&t.resolution!=="error"}a(TZa,"matchContextItems");function xMi(t,e,r){let n=IZa(t,e,r),o=(0,Zyt.getConfig)(t,Zyt.ConfigKey.ContextProviders)??[];if(n.length===1&&n[0]==="*"||o.length===1&&o[0]==="*")return["*"];let s=t.get(Nl.ICompletionsDefaultContextProviders).getIds();return Array.from(new Set([...s,...n,...o]))}a(xMi,"getActiveContextProviders");function IZa(t,e,r){if(t.get(bRr.ICompletionsRuntimeModeService).isDebugEnabled())return["*"];let n=t.get(TMi.ICompletionsFeaturesService),o=n.contextProviders(r),s=n.getContextProviderExpSettings(e);if(s!==void 0)for(let c of s.ids)o.includes(c)||o.push(c);return o}a(IZa,"getExpContextProviders");function xZa(t,e,r){return xMi(t,e,r).length>0}a(xZa,"useContextProviderAPI");function wZa(t,e,r){let n=(0,Zyt.getConfig)(t,Zyt.ConfigKey.ContextProviderTimeBudget);return n!==void 0&&typeof n=="number"?n:t.get(TMi.ICompletionsFeaturesService).contextProviderTimeBudget(e,r)}a(wZa,"getContextProviderTimeBudget");var ERr;(function(t){function e(n){if(n)try{let o=JSON.parse(n);if(o.warnings===void 0&&o.maxDiagnostics===void 0&&o.maxLineDistance===void 0)return;let s=r(o),c=typeof o.maxLineDistance=="number"&&o.maxLineDistance>=0?o.maxLineDistance:10,l=typeof o.maxDiagnostics=="number"&&o.maxDiagnostics>0?o.maxDiagnostics:5;return{warnings:s,maxLineDistance:c,maxDiagnostics:l}}catch{return}}a(e,"from"),t.from=e;function r(n){let o=n?.warnings;return o==="yes"||o==="no"||o==="yesIfNoErrors"?o:"no"}a(r,"getWarnings")})(ERr||(Nl.DefaultDiagnosticSettings=ERr={}));function RZa(t){let e=t.get(vMi.IConfigurationService),r=t.get(AZa.IExperimentationService),n=e.getExperimentBasedConfig(vMi.ConfigKey.TeamInternal.InlineCompletionsDefaultDiagnosticsOptions,r);if(typeof n=="string")return ERr.from(n)}a(RZa,"getDefaultDiagnosticSettings")});var tEt=I(FD=>{"use strict";p();var kZa=FD&&FD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},PZa=FD&&FD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(FD,"__esModule",{value:!0});FD.ContextProviderBridge=FD.ICompletionsContextProviderBridgeService=void 0;var DZa=nn(),NZa=C6(),MZa=eEt();FD.ICompletionsContextProviderBridgeService=(0,DZa.createServiceIdentifier)("ICompletionsContextProviderBridgeService");var SRr=class{static{a(this,"ContextProviderBridge")}constructor(e){this.contextProviderRegistry=e,this.scheduledResolutions=new NZa.LRUCacheMap(25)}schedule(e,r,n,o,s,c){let{textDocument:l,originalPosition:u,originalOffset:d,originalVersion:f,editsWithPosition:h}=e,m=this.contextProviderRegistry.resolveAllProviders(r,n,{uri:l.uri,languageId:l.detectedLanguageId,version:f,offset:d,position:u,proposedEdits:h.length>0?h:void 0},o,s,c?.data);this.scheduledResolutions.set(r,m)}async resolution(e){let r=this.scheduledResolutions.get(e);return r?await r:[]}};FD.ContextProviderBridge=SRr;FD.ContextProviderBridge=SRr=kZa([PZa(0,MZa.ICompletionsContextProviderRegistryService)],SRr)});var xRr=I(rEt=>{"use strict";p();Object.defineProperty(rEt,"__esModule",{value:!0});rEt.Diagnostics=void 0;var TRr=rL(),OZa=P0(),IRr=w6(),LZa=JG(),BZa=k6();function FZa(t){if(t.code!==void 0){if(typeof t.code=="string")return t.code;if(typeof t.code=="number")return t.code.toString();if(typeof t.code=="object"&&t.code!==null&&t.code.value)return t.code.value.toString()}}a(FZa,"getCode");function UZa(t,e){return t.getRelativePath({uri:e.uri.toString()})??e.uri.path}a(UZa,"getRelativePath");var QZa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(),[u,d]=e.useState();if(e.useData(BZa.isCompletionRequestData,h=>{h.diagnostics!==r&&n(h.diagnostics);let m=(0,LZa.normalizeLanguageId)(h.document.detectedLanguageId);m!==o&&s(m),h.position!==c&&l(h.position),h.document.uri!==u?.uri&&d(h.document)}),!r||r.length===0||!o)return;let f=r.filter(h=>h.values.length>0);if(f.length!==0)return f.sort((h,m)=>(m.importance??0)-(h.importance??0)),f.reverse(),f.map(h=>{let m=[];m.push((0,TRr.jsx)(IRr.Text,{source:h,children:`Consider the following ${o} diagnostics from ${UZa(t.tdms,h)}:`},h.id));let g=h.values;return u!==void 0&&u.uri.toString()===h.uri.toString()&&c!==void 0&&(g=h.values.slice(),g.sort((A,y)=>{let E=Math.abs(A.range.start.line-c.line),_=Math.abs(y.range.start.line-c.line);return E-_})),g.forEach(A=>{let y="",E=FZa(A);E!==void 0&&(y=` ${A.source?A.source.toUpperCase():""}${E}`);let _=A.range.start;m.push((0,TRr.jsx)(IRr.Text,{children:`${_.line+1}:${_.character+1} - ${OZa.DiagnosticSeverity[A.severity].toLowerCase()}${y}: ${A.message}`}))}),(0,TRr.jsx)(IRr.Chunk,{children:m})})},"Diagnostics");rEt.Diagnostics=QZa});var wRr=I(iEt=>{"use strict";p();Object.defineProperty(iEt,"__esModule",{value:!0});iEt.DocumentMarker=void 0;var nEt=rL(),wMi=w6(),RMi=k4e(),qZa=k6(),jZa=a((t,e)=>{let[r,n]=e.useState();if(e.useData(qZa.isCompletionRequestData,o=>{o.document.uri!==r?.uri&&n(o.document)}),r){let o=t.tdms.getRelativePath(r),s={uri:r.uri,source:r.getText(),relativePath:o,languageId:r.detectedLanguageId},c=t.tdms.findNotebook(r);return s.relativePath&&!c?(0,nEt.jsx)(HZa,{docInfo:s}):(0,nEt.jsx)(GZa,{docInfo:s})}},"DocumentMarker");iEt.DocumentMarker=jZa;var HZa=a(t=>(0,nEt.jsx)(wMi.Text,{children:(0,RMi.getPathMarker)(t.docInfo)}),"PathMarker"),GZa=a(t=>(0,nEt.jsx)(wMi.Text,{children:(0,RMi.getLanguageMarker)(t.docInfo)}),"LanguageMarker")});var RRr=I(W4e=>{"use strict";p();Object.defineProperty(W4e,"__esModule",{value:!0});W4e.RecentEdits=void 0;W4e.editIsTooCloseToCursor=DMi;var kMi=rL(),PMi=w6(),oEt=k4e(),$Za=k6();function DMi(t,e=!1,r=void 0,n){if(e&&(r===void 0||n===void 0))throw new Error("cursorLine and activeDocDistanceLimitFromCursor are required when filterByCursorLine is true");let o=t.startLine-1,s=t.endLine-1;return!!(e&&(Math.abs(o-r)<=n||Math.abs(s-r)<=n))}a(DMi,"editIsTooCloseToCursor");var VZa=a((t,e)=>{let[r,n]=e.useState();return e.useData($Za.isCompletionRequestData,async o=>{if(!o.document)return;let s=t.recentEditsProvider;if(s.isEnabled())s.start();else return;let c=s.config,l=s.getRecentEdits(),u=new Set,d=t.tdms,f=[];for(let m=l.length-1;m>=0&&!(f.length>=c.maxEdits);m--){let g=l[m];if(!await d.getTextDocument({uri:g.file}))continue;let A=!u.has(g.file);if(u.size+(A?1:0)>c.maxFiles)break;let E=g.file===o.document?.uri,_=E?o.position.line:void 0;if(DMi(g,E,_,c.activeDocDistanceLimitFromCursor))continue;let b=s.getEditSummary(g);if(b){u.add(g.file);let T=d.getRelativePath({uri:g.file});f.unshift((0,oEt.newLineEnded)(`File: ${T}`)+(0,oEt.newLineEnded)(b))}}if(f.length===0){n(void 0);return}let h=(0,oEt.newLineEnded)("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+(0,oEt.newLineEnded)("End of recent edits");n(h)}),r?(0,kMi.jsx)(PMi.Chunk,{children:(0,kMi.jsx)(PMi.Text,{children:r})}):void 0},"RecentEdits");W4e.RecentEdits=VZa});var NMi=I(sL=>{"use strict";p();Object.defineProperty(sL,"__esModule",{value:!0});sL.registerDocumentTracker=sL.accessTimes=void 0;sL.sortByAccessTimes=YZa;var WZa=C6(),zZa=s1();sL.accessTimes=new WZa.LRUCacheMap;function YZa(t){return[...t].sort((e,r)=>{let n=sL.accessTimes.get(e.uri)??0;return(sL.accessTimes.get(r.uri)??0)-n})}a(YZa,"sortByAccessTimes");var KZa=a(t=>t.get(zZa.ICompletionsTextDocumentManagerService).onDidFocusTextDocument(e=>{e.document&&sL.accessTimes.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");sL.registerDocumentTracker=KZa});var MMi=I(D6=>{"use strict";p();var JZa=D6&&D6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ZZa=D6&&D6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(D6,"__esModule",{value:!0});D6.OpenTabFiles=void 0;var XZa=NMi(),eXa=s1(),kRr=UAe(),PRr=class{static{a(this,"OpenTabFiles")}constructor(e){this.docManager=e}truncateDocs(e,r,n,o){let s=new Map,c=0;for(let l of e)if(!(c+l.getText().length>kRr.NeighborSource.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&(0,kRr.considerNeighborFile)(n,l.detectedLanguageId)&&(s.set(l.uri.toString(),{uri:l.uri.toString(),relativePath:this.docManager.getRelativePath(l),source:l.getText()}),c+=l.getText().length),s.size>=o))break;return s}async getNeighborFiles(e,r,n){let o=new Map,s=new Map;return o=this.truncateDocs((0,XZa.sortByAccessTimes)(await this.docManager.textDocuments()),e,r,n),s.set(kRr.NeighboringFileType.OpenTabs,Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};D6.OpenTabFiles=PRr;D6.OpenTabFiles=PRr=JZa([ZZa(0,eXa.ICompletionsTextDocumentManagerService)],PRr)});var OMi=I(DRr=>{"use strict";p();Object.defineProperty(DRr,"__esModule",{value:!0});DRr.shortCircuit=tXa;function tXa(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(tXa,"shortCircuit")});var dEt=I(Ml=>{"use strict";p();var rXa=Ml&&Ml.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},sEt=Ml&&Ml.__param||function(t,e){return function(r,n){e(r,n,t)}},NRr;Object.defineProperty(Ml,"__esModule",{value:!0});Ml.RelatedFilesProvider=Ml.ICompletionsRelatedFilesProviderService=Ml.relatedFilesLogger=Ml.PromiseExpirationCacheMap=Ml.EmptyRelatedFilesResponse=void 0;Ml.getRelatedFilesAndTraits=fXa;var nXa=Bre(),iXa=nn(),oXa=nd(),LRr=Gs(),sXa=n$(),aXa=C6(),uEt=Dl(),cXa=$g(),lXa=OMi();Ml.EmptyRelatedFilesResponse={entries:[],traits:[]};var aEt={entries:new Map,traits:[]},cEt=class extends aXa.LRUCacheMap{static{a(this,"PromiseExpirationCacheMap")}constructor(e,r=120*1e3){super(e),this.defaultEvictionTimeMs=r,this._cacheTimestamps=new Map}bumpRetryCount(e){let r=this._cacheTimestamps.get(e);return r?++r.retryCount:(this._cacheTimestamps.set(e,{timestamp:Date.now(),retryCount:0}),0)}has(e){return this.isValid(e)?super.has(e):(this.deleteExpiredEntry(e),!1)}get(e){let r=super.get(e);if(this.isValid(e))return r;this.deleteExpiredEntry(e)}set(e,r){let n=super.set(e,r);return this.isValid(e)||this._cacheTimestamps.set(e,{timestamp:Date.now(),retryCount:0}),n}clear(){super.clear(),this._cacheTimestamps.clear()}isValid(e){let r=this._cacheTimestamps.get(e);return r!==void 0&&Date.now()-r.timestampMl.relatedFilesLogger.exception(o,n,"isContentExcluded"))}return!0}static dropBOM(e){return e.charCodeAt(0)===65279?e.slice(1):e}};Ml.RelatedFilesProvider=MRr;Ml.RelatedFilesProvider=MRr=NRr=rXa([sEt(0,LRr.IInstantiationService),sEt(1,nXa.IIgnoreService),sEt(2,uEt.ICompletionsLogTargetService),sEt(3,sXa.ICompletionsFileSystemService)],MRr);var dXa=3,z4e=new cEt(uXa);async function LMi(t,e,r,n,o){let s=t.get(LRr.IInstantiationService),c=t.get(uEt.ICompletionsLogTargetService),l=performance.now(),u;try{u=await o.getRelatedFiles(e,r,n)}catch(f){s.invokeFunction(h=>Ml.relatedFilesLogger.exception(h,f,".getRelatedFiles")),u=void 0}u===void 0&&(z4e.bumpRetryCount(e.uri)>=dXa?u=aEt:u=void 0);let d=performance.now()-l;if(Ml.relatedFilesLogger.debug(c,u!==void 0?`Fetched ${[...u.entries.values()].map(f=>f.size).reduce((f,h)=>f+h,0)} related files for '${e.uri}' in ${d}ms.`:`Failing fetching files for '${e.uri}' in ${d}ms.`),u===void 0)throw new lEt;return u}a(LMi,"getRelatedFiles");var ORr=a(function(t,e,r,n,o){let s=`${e.uri}`;if(z4e.has(s))return z4e.get(s);let c=LMi(t,e,r,n,o);return c instanceof Promise&&(c=c.catch(l=>{throw z4e.delete(s),l})),z4e.set(s,c),c},"getRelatedFilesWithCacheAndTimeout");ORr=(0,lXa.shortCircuit)(ORr,200,aEt);async function fXa(t,e,r,n,o,s=!1){let c=t.get(LRr.IInstantiationService),l=t.get(uEt.ICompletionsLogTargetService),u=t.get(Ml.ICompletionsRelatedFilesProviderService),d=aEt;try{let f={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};d=s?await c.invokeFunction(LMi,f,r,n,u):await c.invokeFunction(ORr,f,r,n,u)}catch(f){d=aEt,f instanceof lEt&&c.invokeFunction(cXa.telemetry,"getRelatedFilesList",r)}return Ml.relatedFilesLogger.debug(l,d!=null?`Fetched following traits ${d.traits.map(f=>`{${f.name} : ${f.value}}`).join("")} for '${e.uri}'`:`Failing fecthing traits for '${e.uri}'.`),d}a(fXa,"getRelatedFilesAndTraits")});var UAe=I(S$=>{"use strict";p();Object.defineProperty(S$,"__esModule",{value:!0});S$.NeighborSource=S$.NeighboringFileType=void 0;S$.considerNeighborFile=AXa;S$.isIncludeNeighborFilesActive=yXa;var pXa=Gs(),BMi=JG(),UMi=fy(),hXa=Dl(),mXa=s1(),gXa=MMi(),fEt=dEt(),FMi;(function(t){t.None="none",t.OpenTabs="opentabs",t.CursorMostRecent="cursormostrecent",t.CursorMostCount="cursormostcount",t.WorkspaceSharingSameFolder="workspacesharingsamefolder",t.WorkspaceSmallestPathDist="workspacesmallestpathdist",t.OpenTabsAndCocommitted="opentabsandcocommitted",t.RelatedCSharp="related/csharp",t.RelatedCSharpRoslyn="related/csharproslyn",t.RelatedCpp="related/cpp",t.RelatedTypeScript="related/typescript",t.RelatedCppSemanticCodeContext="related/cppsemanticcodecontext",t.RelatedOther="related/other"})(FMi||(S$.NeighboringFileType=FMi={}));function AXa(t,e){return(0,BMi.normalizeLanguageId)(t)===(0,BMi.normalizeLanguageId)(e)}a(AXa,"considerNeighborFile");var BRr=class t{static{a(this,"NeighborSource")}static{this.MAX_NEIGHBOR_AGGREGATE_LENGTH=2e5}static{this.MAX_NEIGHBOR_FILES=20}static{this.EXCLUDED_NEIGHBORS=["node_modules","dist","site-packages"]}static defaultEmptyResult(){return{docs:new Map,neighborSource:new Map,traits:[]}}static reset(){t.instance=void 0}static async getNeighborFilesAndTraits(e,r,n,o,s,c,l){let u=e.get(UMi.ICompletionsFeaturesService),d=e.get(hXa.ICompletionsLogTargetService),f=e.get(pXa.IInstantiationService),h=e.get(mXa.ICompletionsTextDocumentManagerService);t.instance===void 0&&(t.instance=f.createInstance(gXa.OpenTabFiles));let m={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(u.excludeRelatedFiles(n,o))return m;let g=await h.getTextDocument({uri:r});if(!g)return fEt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: failed to get the document ${r}`),m;let A=h.getWorkspaceFolder(g);if(!A)return fEt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),m;let y=await f.invokeFunction(fEt.getRelatedFilesAndTraits,g,o,s,c,l);return y.entries.size===0?(fEt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`0 related files found for ${r}`),m.traits.push(...y.traits),m):(y.entries.forEach((E,_)=>{let v=[];E.forEach((b,T)=>{let w=t.getRelativePath(T,A.uri);if(!w||m.docs.has(T))return;let R={relativePath:w,uri:T,source:b};v.unshift(R),m.docs.set(T,R)}),v.length>0&&m.neighborSource.set(_,v.map(b=>b.uri.toString()))}),m.traits.push(...y.traits),m)}static basename(e){return decodeURIComponent(e.replace(/[#?].*$/,"").replace(/^.*[/:]/,""))}static getRelativePath(e,r){let n=r.toString().replace(/[#?].*/,"").replace(/\/?$/,"/");return e.toString().startsWith(n)?e.toString().slice(n.length):t.basename(e)}};S$.NeighborSource=BRr;function yXa(t,e,r){return t.get(UMi.ICompletionsFeaturesService).includeNeighboringFiles(e,r)}a(yXa,"isIncludeNeighborFilesActive")});var URr=I(pEt=>{"use strict";p();Object.defineProperty(pEt,"__esModule",{value:!0});pEt.SimilarFiles=void 0;var QAe=rL(),FRr=w6(),EXa=Eyt(),_Xa=vIr(),vXa=vyt(),CXa=k6(),bXa=qAe(),QMi=UAe(),SXa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(CXa.isCompletionRequestData,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=QMi.NeighborSource.defaultEmptyResult();u.turnOffSimilarFiles||(d=await t.instantiationService.invokeFunction(async h=>await QMi.NeighborSource.getNeighborFilesAndTraits(h,u.document.uri,u.document.detectedLanguageId,u.telemetryData,u.cancellationToken,u.data)));let f=await c(u.telemetryData,u.document,u,d);s(f)});async function c(u,d,f,h){let m=t.instantiationService.invokeFunction(bXa.getPromptOptions,u,d.detectedLanguageId);return(await l(m,u,d,f,h)).filter(A=>A.snippet.length>0).sort((A,y)=>A.score-y.score).map(A=>({...(0,_Xa.announceSnippet)(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||t.instantiationService.invokeFunction(vXa.getSimilarFilesOptions,d,f.detectedLanguageId),y=t.tdms.getRelativePath(f),E={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await(0,EXa.getSimilarSnippets)(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),(0,QAe.jsxs)(QAe.Fragment,{children:[...o.map((u,d)=>(0,QAe.jsx)(TXa,{snippet:u}))]})},"SimilarFiles");pEt.SimilarFiles=SXa;var TXa=a((t,e)=>(0,QAe.jsxs)(FRr.Chunk,{children:[(0,QAe.jsx)(FRr.Text,{children:t.snippet.headline}),(0,QAe.jsx)(FRr.Text,{children:t.snippet.snippet})]}),"SimilarFile")});var zMi=I(rI=>{"use strict";p();Object.defineProperty(rI,"__esModule",{value:!0});rI.getAllRecentEditsByTimestamp=IXa;rI.findChangeSpan=QRr;rI.getDiff=jMi;rI.unifiedDiff=HMi;rI.findReplaceDiff=GMi;rI.editsOverlap=$Mi;rI.updateEdits=VMi;rI.buildIncomingEdit=qRr;rI.trimOldFilesFromState=WMi;rI.recentEditsReducer=RXa;rI.summarizeEdit=kXa;function IXa(t){return Object.values(t).flatMap(e=>e.edits).sort((e,r)=>e.timestamp-r.timestamp)}a(IXa,"getAllRecentEditsByTimestamp");function QRr(t,e){let r=0;for(;r=r&&o>=r&&t[n]===e[o];)n--,o--;return r>n&&r>o?null:{start:r,endPrev:n,endNew:o}}a(QRr,"findChangeSpan");function jMi(t,e,r,n,o,s,c){let l=Math.max(0,n-c),u=Math.min(r.length,s+c+1);return{file:t,pre:l,post:u,before:e.slice(l,n),removed:e.slice(n,o+1),added:r.slice(n,s+1),after:r.slice(s+1,u)}}a(jMi,"getDiff");function xXa(t){return[...t.before,...t.removed,...t.added,...t.after].reduce((r,n)=>r+n.length+1,0)}a(xXa,"measureDiffSize");function HMi(t,e=!1,r=!1,n=!1){let o=[];o.push(`--- a/${t.file}`),o.push(`+++ b/${t.file}`);let s=t.before.length+t.removed.length+t.after.length,c=t.before.length+t.added.length+t.after.length;o.push(`@@ -${t.pre+1},${s} +${t.pre+1},${c} @@`);for(let l of t.before)o.push(" "+l);if(r)for(let l of t.added)o.push("+"+l);if(!e){let l=n?" --- IGNORE ---":"";for(let u of t.removed)o.push("-"+u+l)}if(!r)for(let l of t.added)o.push("+"+l);for(let l of t.after)o.push(" "+l);return o.join(` +${QMi(r,e)} +`,this}appendLink(e,r,n){return this.value+="[",this.value+=this._escape(r,"]"),this.value+="](",this.value+=this._escape(String(e),")"),n&&(this.value+=` "${this._escape(this._escape(n,'"'),")")}"`),this.value+=")",this}_escape(e,r){let n=new RegExp((0,NZa.escapeRegExpCharacters)(r),"g");return e.replace(n,(o,s)=>e.charAt(s-1)!=="\\"?`\\${o}`:o)}};vy.MarkdownString=iEt;function FMi(t){return UMi(t)?!t.value:Array.isArray(t)?t.every(FMi):!0}a(FMi,"isEmptyMarkdownString");function UMi(t){return t instanceof iEt?!0:t&&typeof t=="object"?typeof t.value=="string"&&(typeof t.isTrusted=="boolean"||typeof t.isTrusted=="object"||t.isTrusted===void 0)&&(typeof t.supportThemeIcons=="boolean"||t.supportThemeIcons===void 0)&&(typeof t.supportAlertSyntax=="boolean"||t.supportAlertSyntax===void 0):!1}a(UMi,"isMarkdownString");function MZa(t,e){return t===e?!0:!t||!e?!1:t.value===e.value&&t.isTrusted===e.isTrusted&&t.supportThemeIcons===e.supportThemeIcons&&t.supportHtml===e.supportHtml&&t.supportAlertSyntax===e.supportAlertSyntax&&(t.baseUri===e.baseUri||!!t.baseUri&&!!e.baseUri&&(0,DZa.isEqual)(nEt.URI.from(t.baseUri),nEt.URI.from(e.baseUri)))}a(MZa,"markdownStringEqual");function oEt(t){return t.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}a(oEt,"escapeMarkdownSyntaxTokens");function OZa(t){return t.replace(/[\\\]]/g,"\\$&")}a(OZa,"escapeMarkdownLinkLabel");function QMi(t,e){let r=t.match(/^`+/gm)?.reduce((o,s)=>o.length>s.length?o:s).length??0,n=r>=3?r+1:3;return[`${"`".repeat(n)}${e}`,t,`${"`".repeat(n)}`].join(` +`)}a(QMi,"appendEscapedMarkdownCodeBlockFence");function LZa(t){let e=Math.max(0,...(t.match(/`+/g)??[]).map(s=>s.length)),r="`".repeat(e+1),o=t.startsWith("`")||t.endsWith("`")?` ${t} `:t;return`${r}${o}${r}`}a(LZa,"appendEscapedMarkdownInlineCode");function BZa(t){return t.replace(/"/g,""")}a(BZa,"escapeDoubleQuotes");function FZa(t){return t&&t.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}a(FZa,"removeMarkdownEscapes");function UZa(t){let e=[],r=t.split("|").map(o=>o.trim());t=r[0];let n=r[1];if(n){let o=/height=(\d+)/.exec(n),s=/width=(\d+)/.exec(n),c=o?o[1]:"",l=s?s[1]:"",u=isFinite(parseInt(l)),d=isFinite(parseInt(c));u&&e.push(`width="${l}"`),d&&e.push(`height="${c}"`)}return{href:t,dimensions:e}}a(UZa,"parseHrefAndDimensions");function qMi(t,e,r,n=!0){return`[${n?oEt(t):t}](${e}${r?` "${oEt(r)}"`:""})`}a(qMi,"createMarkdownLink");function QZa(t,e=!0){let r=jMi(t.id,...t.arguments||[]).toString();return qMi(t.text,r,t.tooltip,e)}a(QZa,"createMarkdownCommandLink");function jMi(t,...e){return nEt.URI.from({scheme:PZa.Schemas.command,path:t,query:e.length?encodeURIComponent(JSON.stringify(e)):void 0})}a(jMi,"createCommandUri")});var nwr=I(one=>{"use strict";p();var qZa=one&&one.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},twr;Object.defineProperty(one,"__esModule",{value:!0});one.MarkdownString=void 0;var jZa=HMi(),HZa=jD(),rwr=twr=class{static{a(this,"MarkdownString")}#e;static isMarkdownString(e){return e instanceof twr?!0:!e||typeof e!="object"?!1:e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}constructor(e,r=!1){this.#e=new jZa.MarkdownString(e,{supportThemeIcons:r})}get value(){return this.#e.value}set value(e){this.#e.value=e}get isTrusted(){return this.#e.isTrusted}set isTrusted(e){this.#e.isTrusted=e}get supportThemeIcons(){return this.#e.supportThemeIcons}set supportThemeIcons(e){this.#e.supportThemeIcons=e}get supportHtml(){return this.#e.supportHtml}set supportHtml(e){this.#e.supportHtml=e}get supportAlertSyntax(){return this.#e.supportAlertSyntax}set supportAlertSyntax(e){this.#e.supportAlertSyntax=e}get baseUri(){return this.#e.baseUri}set baseUri(e){this.#e.baseUri=e}appendText(e){return this.#e.appendText(e),this}appendMarkdown(e){return this.#e.appendMarkdown(e),this}appendCodeblock(e,r){return this.#e.appendCodeblock(r??"",e),this}};one.MarkdownString=rwr;one.MarkdownString=rwr=twr=qZa([HZa.es5ClassCompat],rwr)});var VMi=I(F6=>{"use strict";p();Object.defineProperty(F6,"__esModule",{value:!0});F6.Mimes=void 0;F6.getMediaOrTextMime=$Za;F6.getMediaMime=$Mi;F6.getExtensionForMimeType=VZa;F6.normalizeMimeType=zZa;F6.isTextStreamMime=YZa;var GMi=LA();F6.Mimes=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list",html:"text/html"});var GZa={".css":"text/css",".csv":"text/csv",".htm":"text/html",".html":"text/html",".ics":"text/calendar",".js":"text/javascript",".mjs":"text/javascript",".txt":"text/plain",".xml":"text/xml"},iwr={".aac":"audio/x-aac",".avi":"video/x-msvideo",".bmp":"image/bmp",".flv":"video/x-flv",".gif":"image/gif",".ico":"image/x-icon",".jpe":["image/jpg","image/jpeg"],".jpeg":["image/jpg","image/jpeg"],".jpg":["image/jpg","image/jpeg"],".m1v":"video/mpeg",".m2a":"audio/mpeg",".m2v":"video/mpeg",".m3a":"audio/mpeg",".mid":"audio/midi",".midi":"audio/midi",".mk3d":"video/x-matroska",".mks":"video/x-matroska",".mkv":"video/x-matroska",".mov":"video/quicktime",".movie":"video/x-sgi-movie",".mp2":"audio/mpeg",".mp2a":"audio/mpeg",".mp3":"audio/mpeg",".mp4":"video/mp4",".mp4a":"audio/mp4",".mp4v":"video/mp4",".mpe":"video/mpeg",".mpeg":"video/mpeg",".mpg":"video/mpeg",".mpg4":"video/mp4",".mpga":"audio/mpeg",".oga":"audio/ogg",".ogg":"audio/ogg",".opus":"audio/opus",".ogv":"video/ogg",".png":"image/png",".psd":"image/vnd.adobe.photoshop",".qt":"video/quicktime",".spx":"audio/ogg",".svg":"image/svg+xml",".tga":"image/x-tga",".tif":"image/tiff",".tiff":"image/tiff",".wav":"audio/x-wav",".webm":"video/webm",".webp":"image/webp",".wma":"audio/x-ms-wma",".wmv":"video/x-ms-wmv",".woff":"application/font-woff"};function $Za(t){let e=(0,GMi.extname)(t),r=GZa[e.toLowerCase()];return r!==void 0?r:$Mi(t)}a($Za,"getMediaOrTextMime");function $Mi(t){let e=(0,GMi.extname)(t),r=iwr[e.toLowerCase()];return Array.isArray(r)?r[0]:r}a($Mi,"getMediaMime");function VZa(t){for(let e in iwr){let r=iwr[e];if(Array.isArray(r)?r.includes(t):r===t)return e}}a(VZa,"getExtensionForMimeType");var WZa=/^(.+)\/(.+?)(;.+)?$/;function zZa(t,e){let r=WZa.exec(t);return r?`${r[1].toLowerCase()}/${r[2].toLowerCase()}${r[3]??""}`:e?void 0:t}a(zZa,"normalizeMimeType");function YZa(t){return["application/vnd.code.notebook.stdout","application/vnd.code.notebook.stderr"].includes(t)}a(YZa,"isTextStreamMime")});var YMi=I(D0=>{"use strict";p();var KZa=D0&&D0.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},w$;Object.defineProperty(D0,"__esModule",{value:!0});D0.NotebookCellOutput=D0.NotebookCellOutputItem=D0.NotebookEdit=D0.NotebookData=D0.NotebookCellData=D0.NotebookRange=D0.NotebookCellKind=void 0;var JZa=jD(),WMi=Rs(),sEt=VMi(),ZZa=x0(),zMi;(function(t){t[t.Markup=1]="Markup",t[t.Code=2]="Code"})(zMi||(D0.NotebookCellKind=zMi={}));var sne=class t{static{a(this,"NotebookRange")}static isNotebookRange(e){return e instanceof t?!0:e?typeof e.start=="number"&&typeof e.end=="number":!1}get start(){return this._start}get end(){return this._end}get isEmpty(){return this._start===this._end}constructor(e,r){if(e<0)throw(0,WMi.illegalArgument)("start must be positive");if(r<0)throw(0,WMi.illegalArgument)("end must be positive");e<=r?(this._start=e,this._end=r):(this._start=r,this._end=e)}with(e){let r=this._start,n=this._end;return e.start!==void 0&&(r=e.start),e.end!==void 0&&(n=e.end),r===this._start&&n===this._end?this:new t(r,n)}};D0.NotebookRange=sne;var owr=class t{static{a(this,"NotebookCellData")}static validate(e){if(typeof e.kind!="number")throw new Error("NotebookCellData MUST have 'kind' property");if(typeof e.value!="string")throw new Error("NotebookCellData MUST have 'value' property");if(typeof e.languageId!="string")throw new Error("NotebookCellData MUST have 'languageId' property")}static isNotebookCellDataArray(e){return Array.isArray(e)&&e.every(r=>t.isNotebookCellData(r))}static isNotebookCellData(e){return!0}constructor(e,r,n,o,s,c,l){this.kind=e,this.value=r,this.languageId=n,this.mime=o,this.outputs=s??[],this.metadata=c,this.executionSummary=l,t.validate(this)}};D0.NotebookCellData=owr;var swr=class{static{a(this,"NotebookData")}constructor(e){this.cells=e}};D0.NotebookData=swr;var awr=w$=class{static{a(this,"NotebookEdit")}static isNotebookCellEdit(e){return e instanceof w$?!0:e?sne.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,r){return new w$(e,r)}static insertCells(e,r){return new w$(new sne(e,e),r)}static deleteCells(e){return new w$(e,[])}static updateCellMetadata(e,r){let n=new w$(new sne(e,e),[]);return n.newCellMetadata=r,n}static updateNotebookMetadata(e){let r=new w$(new sne(0,0),[]);return r.newNotebookMetadata=e,r}constructor(e,r){this.range=e,this.newCells=r}};D0.NotebookEdit=awr;D0.NotebookEdit=awr=w$=KZa([JZa.es5ClassCompat],awr);var cwr=class t{static{a(this,"NotebookCellOutputItem")}static isNotebookCellOutputItem(e){return e instanceof t?!0:e?typeof e.mime=="string"&&e.data instanceof Uint8Array:!1}static error(e){let r={name:e.name,message:e.message,stack:e.stack};return t.json(r,"application/vnd.code.notebook.error")}static stdout(e){return t.text(e,"application/vnd.code.notebook.stdout")}static stderr(e){return t.text(e,"application/vnd.code.notebook.stderr")}static bytes(e,r="application/octet-stream"){return new t(e,r)}static#e=new TextEncoder;static text(e,r=sEt.Mimes.text){let n=t.#e.encode(String(e));return new t(n,r)}static json(e,r="text/x-json"){let n=JSON.stringify(e,void 0," ");return t.text(n,r)}constructor(e,r){this.data=e,this.mime=r;let n=(0,sEt.normalizeMimeType)(r,!0);if(!n)throw new Error(`INVALID mime type: ${r}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}};D0.NotebookCellOutputItem=cwr;var lwr=class t{static{a(this,"NotebookCellOutput")}static isNotebookCellOutput(e){return e instanceof t?!0:!e||typeof e!="object"?!1:typeof e.id=="string"&&Array.isArray(e.items)}static ensureUniqueMimeTypes(e,r=!1){let n=new Set,o=new Set;for(let s=0;s!o.has(c))}constructor(e,r,n){this.items=t.ensureUniqueMimeTypes(e,!0),typeof r=="string"?(this.id=r,this.metadata=n):(this.id=(0,ZZa.generateUuid)(),this.metadata=r??n)}};D0.NotebookCellOutput=lwr});var JMi=I(k$=>{"use strict";p();var XZa=k$&&k$.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},uwr;Object.defineProperty(k$,"__esModule",{value:!0});k$.Selection=void 0;k$.getDebugDescriptionOfSelection=KMi;var eXa=jD(),R$=VAe(),dwr=aL(),fwr=uwr=class extends dwr.Range{static{a(this,"Selection")}static isSelection(e){return e instanceof uwr?!0:!e||typeof e!="object"?!1:dwr.Range.isRange(e)&&R$.Position.isPosition(e.anchor)&&R$.Position.isPosition(e.active)&&typeof e.isReversed=="boolean"}get anchor(){return this._anchor}get active(){return this._active}constructor(e,r,n,o){let s,c;if(typeof e=="number"&&typeof r=="number"&&typeof n=="number"&&typeof o=="number"?(s=new R$.Position(e,r),c=new R$.Position(n,o)):R$.Position.isPosition(e)&&R$.Position.isPosition(r)&&(s=R$.Position.of(e),c=R$.Position.of(r)),!s||!c)throw new Error("Invalid arguments");super(s,c),this._anchor=s,this._active=c}get isReversed(){return this._anchor===this._end}toJSON(){return{start:this.start,end:this.end,active:this.active,anchor:this.anchor}}[Symbol.for("debug.description")](){return KMi(this)}};k$.Selection=fwr;k$.Selection=fwr=uwr=XZa([eXa.es5ClassCompat],fwr);function KMi(t){let e=(0,dwr.getDebugDescriptionOfRange)(t);return t.isEmpty||(t.active.isEqual(t.start)?e=`|${e}`:e=`${e}|`),e}a(KMi,"getDebugDescriptionOfSelection")});var hwr=I(cne=>{"use strict";p();var tXa=cne&&cne.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ane;Object.defineProperty(cne,"__esModule",{value:!0});cne.SnippetString=void 0;var rXa=jD(),pwr=ane=class{static{a(this,"SnippetString")}static isSnippetString(e){return e instanceof ane?!0:!e||typeof e!="object"?!1:typeof e.value=="string"}static _escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){this._tabstop=1,this.value=e||""}appendText(e){return this.value+=ane._escape(e),this}appendTabstop(e=this._tabstop++){return this.value+="$",this.value+=e,this}appendPlaceholder(e,r=this._tabstop++){if(typeof e=="function"){let n=new ane;n._tabstop=this._tabstop,e(n),this._tabstop=n._tabstop,e=n.value}else e=ane._escape(e);return this.value+="${",this.value+=r,this.value+=":",this.value+=e,this.value+="}",this}appendChoice(e,r=this._tabstop++){let n=e.map(o=>o.replaceAll(/[|\\,]/g,"\\$&")).join(",");return this.value+="${",this.value+=r,this.value+="|",this.value+=n,this.value+="|}",this}appendVariable(e,r){if(typeof r=="function"){let n=new ane;n._tabstop=this._tabstop,r(n),this._tabstop=n._tabstop,r=n.value}else typeof r=="string"&&(r=r.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=e,r&&(this.value+=":",this.value+=r),this.value+="}",this}};cne.SnippetString=pwr;cne.SnippetString=pwr=ane=tXa([rXa.es5ClassCompat],pwr)});var gwr=I(aEt=>{"use strict";p();Object.defineProperty(aEt,"__esModule",{value:!0});aEt.SnippetTextEdit=void 0;var nXa=hwr(),ZMi=aL(),mwr=class t{static{a(this,"SnippetTextEdit")}static isSnippetTextEdit(e){return e instanceof t?!0:e?ZMi.Range.isRange(e.range)&&nXa.SnippetString.isSnippetString(e.snippet):!1}static replace(e,r){return new t(e,r)}static insert(e,r){return t.replace(new ZMi.Range(e,e),r)}constructor(e,r){this.range=e,this.snippet=r}};aEt.SnippetTextEdit=mwr});var tOi=I(HD=>{"use strict";p();var iXa=HD&&HD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Awr;Object.defineProperty(HD,"__esModule",{value:!0});HD.SymbolInformation=HD.SymbolTag=HD.SymbolKind=void 0;var oXa=jD(),XMi=Nxr(),sXa=aL(),ywr;(function(t){t[t.File=0]="File",t[t.Module=1]="Module",t[t.Namespace=2]="Namespace",t[t.Package=3]="Package",t[t.Class=4]="Class",t[t.Method=5]="Method",t[t.Property=6]="Property",t[t.Field=7]="Field",t[t.Constructor=8]="Constructor",t[t.Enum=9]="Enum",t[t.Interface=10]="Interface",t[t.Function=11]="Function",t[t.Variable=12]="Variable",t[t.Constant=13]="Constant",t[t.String=14]="String",t[t.Number=15]="Number",t[t.Boolean=16]="Boolean",t[t.Array=17]="Array",t[t.Object=18]="Object",t[t.Key=19]="Key",t[t.Null=20]="Null",t[t.EnumMember=21]="EnumMember",t[t.Struct=22]="Struct",t[t.Event=23]="Event",t[t.Operator=24]="Operator",t[t.TypeParameter=25]="TypeParameter"})(ywr||(HD.SymbolKind=ywr={}));var eOi;(function(t){t[t.Deprecated=1]="Deprecated"})(eOi||(HD.SymbolTag=eOi={}));var Ewr=Awr=class{static{a(this,"SymbolInformation")}static validate(e){if(!e.name)throw new Error("name must not be falsy")}constructor(e,r,n,o,s){this.name=e,this.kind=r,this.containerName=s,typeof n=="string"&&(this.containerName=n),o instanceof XMi.Location?this.location=o:n instanceof sXa.Range&&(this.location=new XMi.Location(o,n)),Awr.validate(this)}toJSON(){return{name:this.name,kind:ywr[this.kind],location:this.location,containerName:this.containerName}}};HD.SymbolInformation=Ewr;HD.SymbolInformation=Ewr=Awr=iXa([oXa.es5ClassCompat],Ewr)});var Cwr=I(U6=>{"use strict";p();var aXa=U6&&U6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},lne;Object.defineProperty(U6,"__esModule",{value:!0});U6.TextEdit=U6.EndOfLine=void 0;var _wr=Rs(),cXa=jD(),rOi=VAe(),cEt=aL(),nOi;(function(t){t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"})(nOi||(U6.EndOfLine=nOi={}));var vwr=lne=class{static{a(this,"TextEdit")}static isTextEdit(e){return e instanceof lne?!0:!e||typeof e!="object"?!1:cEt.Range.isRange(e)&&typeof e.newText=="string"}static replace(e,r){return new lne(e,r)}static insert(e,r){return lne.replace(new cEt.Range(e,e),r)}static delete(e){return lne.replace(e,"")}static setEndOfLine(e){let r=new lne(new cEt.Range(new rOi.Position(0,0),new rOi.Position(0,0)),"");return r.newEol=e,r}get range(){return this._range}set range(e){if(e&&!cEt.Range.isRange(e))throw(0,_wr.illegalArgument)("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw(0,_wr.illegalArgument)("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw(0,_wr.illegalArgument)("newEol");this._newEol=e}constructor(e,r){this._range=e,this._newText=r}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};U6.TextEdit=vwr;U6.TextEdit=vwr=lne=aXa([cXa.es5ClassCompat],vwr)});var mOi=I(It=>{"use strict";p();Object.defineProperty(It,"__esModule",{value:!0});It.ChatResponseClearToPreviousToolInvocationReason=It.ChatRequestEditedFileEventKind=It.ChatInputNotificationSeverity=It.ChatErrorLevel=It.AISearchKeyword=It.TextSearchMatch2=It.ExcludeSettingOptions=It.LanguageModelPromptTsxPart=It.ChatImageMimeType=It.LanguageModelDataPart2=It.LanguageModelDataPart=It.LanguageModelThinkingPart=It.LanguageModelTextPart2=It.LanguageModelPartAudience=It.LanguageModelTextPart=It.LanguageModelToolResult2=It.LanguageModelToolResult=It.ChatReferenceBinaryData=It.ChatReferenceDiagnostic=It.ChatRequestNotebookData=It.ChatRequestEditorData=It.ChatResponseTurn=It.ChatRequestTurn2=It.ChatRequestTurn=It.ChatResponseQuestionCarouselPart=It.ChatQuestion=It.ChatQuestionType=It.ChatResponseConfirmationPart=It.ChatResponseWorkspaceEditPart=It.ChatResponseNotebookEditPart=It.ChatResponseTextEditPart=It.ChatResponseMarkdownWithVulnerabilitiesPart=It.ChatResponseCommandButtonPart=It.ChatResponseCodeCitationPart=It.ChatResponsePullRequestPart=It.ChatResponseExtensionsPart=It.ChatResponseMovePart=It.ChatResponseReferencePart2=It.ChatResponseReferencePart=It.ChatResponseInfoPart=It.ChatResponseWarningPart=It.ChatResponseProgressPart2=It.ChatResponseExternalEditPart=It.ChatResponseHookPart=It.ChatResponseThinkingProgressPart=It.ChatResponseProgressPart=It.ChatResponseAnchorPart=It.ChatResponseFileTreePart=It.ChatResponseCodeblockUriPart=It.ChatResponseMarkdownPart=void 0;It.McpHttpServerDefinition=It.McpStdioServerDefinition=It.ChatResource=It.LanguageModelError=It.ChatSessionStatus=It.ChatResponseTurn2=It.ChatSubagentToolInvocationData=It.ChatToolInvocationPart=It.McpToolInvocationContentData=It.LanguageModelChatMessage=It.LanguageModelChatToolMode=It.LanguageModelChatMessageRole=It.LanguageModelToolResultPart2=It.LanguageModelToolResultPart=It.LanguageModelToolCallPart=It.LanguageModelToolMCPSource=It.LanguageModelToolExtensionSource=void 0;var iOi=p$(),fEt=nwr(),bwr=class{static{a(this,"ChatResponseMarkdownPart")}constructor(e){this.value=typeof e=="string"?new fEt.MarkdownString(e):e}};It.ChatResponseMarkdownPart=bwr;var Swr=class{static{a(this,"ChatResponseCodeblockUriPart")}constructor(e,r,n){this.value=e,this.undoStopId=n}};It.ChatResponseCodeblockUriPart=Swr;var Twr=class{static{a(this,"ChatResponseFileTreePart")}constructor(e,r){this.value=e,this.baseUri=r}};It.ChatResponseFileTreePart=Twr;var Iwr=class{static{a(this,"ChatResponseAnchorPart")}constructor(e,r){this.value=e,this.title=r}};It.ChatResponseAnchorPart=Iwr;var xwr=class{static{a(this,"ChatResponseProgressPart")}constructor(e){this.value=e}};It.ChatResponseProgressPart=xwr;var wwr=class{static{a(this,"ChatResponseThinkingProgressPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};It.ChatResponseThinkingProgressPart=wwr;var Rwr=class{static{a(this,"ChatResponseHookPart")}constructor(e,r,n,o){this.hookType=e,this.stopReason=r,this.systemMessage=n,this.metadata=o}};It.ChatResponseHookPart=Rwr;var kwr=class{static{a(this,"ChatResponseExternalEditPart")}constructor(e,r){this.uris=e,this.callback=r,this.applied=new Promise(n=>{this.didGetApplied=n})}};It.ChatResponseExternalEditPart=kwr;var Pwr=class{static{a(this,"ChatResponseProgressPart2")}constructor(e,r){this.value=e,this.task=r}};It.ChatResponseProgressPart2=Pwr;var Dwr=class{static{a(this,"ChatResponseWarningPart")}constructor(e){this.value=typeof e=="string"?new fEt.MarkdownString(e):e}};It.ChatResponseWarningPart=Dwr;var Nwr=class{static{a(this,"ChatResponseInfoPart")}constructor(e){this.value=typeof e=="string"?new fEt.MarkdownString(e):e}};It.ChatResponseInfoPart=Nwr;var Mwr=class{static{a(this,"ChatResponseReferencePart")}constructor(e){this.value=e}};It.ChatResponseReferencePart=Mwr;var Owr=class{static{a(this,"ChatResponseReferencePart2")}constructor(e,r,n){this.value=e,this.iconPath=r,this.options=n}};It.ChatResponseReferencePart2=Owr;var Lwr=class{static{a(this,"ChatResponseMovePart")}constructor(e,r){this.uri=e,this.range=r}};It.ChatResponseMovePart=Lwr;var Bwr=class{static{a(this,"ChatResponseExtensionsPart")}constructor(e){this.extensions=e}};It.ChatResponseExtensionsPart=Bwr;var Fwr=class{static{a(this,"ChatResponsePullRequestPart")}constructor(e,r,n,o,s){"command"in e&&typeof e.command=="string"?this.command=e:(this.uri=e,this.command={title:"View Pull Request",command:"vscode.open",arguments:[e]}),this.title=r,this.description=n,this.author=o,this.linkTag=s}};It.ChatResponsePullRequestPart=Fwr;var Uwr=class{static{a(this,"ChatResponseCodeCitationPart")}constructor(e,r,n){this.value=e,this.license=r,this.snippet=n}};It.ChatResponseCodeCitationPart=Uwr;var Qwr=class{static{a(this,"ChatResponseCommandButtonPart")}constructor(e){this.value=e}};It.ChatResponseCommandButtonPart=Qwr;var qwr=class{static{a(this,"ChatResponseMarkdownWithVulnerabilitiesPart")}constructor(e,r){this.value=typeof e=="string"?new fEt.MarkdownString(e):e,this.vulnerabilities=r}};It.ChatResponseMarkdownWithVulnerabilitiesPart=qwr;var jwr=class{static{a(this,"ChatResponseTextEditPart")}constructor(e,r){this.uri=e,r===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(r)?r:[r]}};It.ChatResponseTextEditPart=jwr;var Hwr=class{static{a(this,"ChatResponseNotebookEditPart")}constructor(e,r){this.uri=e,r===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(r)?r:[r]}};It.ChatResponseNotebookEditPart=Hwr;var Gwr=class{static{a(this,"ChatResponseWorkspaceEditPart")}constructor(e){this.edits=e}};It.ChatResponseWorkspaceEditPart=Gwr;var $wr=class{static{a(this,"ChatResponseConfirmationPart")}constructor(e,r,n,o){this.title=e,this.message=r,this.data=n,this.buttons=o}};It.ChatResponseConfirmationPart=$wr;var oOi;(function(t){t[t.Text=1]="Text",t[t.SingleSelect=2]="SingleSelect",t[t.MultiSelect=3]="MultiSelect"})(oOi||(It.ChatQuestionType=oOi={}));var Vwr=class{static{a(this,"ChatQuestion")}constructor(e,r,n,o){this.id=e,this.type=r,this.title=n,o&&(this.message=o.message,this.options=o.options,this.defaultValue=o.defaultValue,this.allowFreeformInput=o.allowFreeformInput)}};It.ChatQuestion=Vwr;var Wwr=class{static{a(this,"ChatResponseQuestionCarouselPart")}constructor(e,r){this.questions=e,this.allowSkip=r??!1}};It.ChatResponseQuestionCarouselPart=Wwr;var zwr=class{static{a(this,"ChatRequestTurn")}constructor(e,r,n,o,s){this.prompt=e,this.command=r,this.references=n,this.participant=o,this.toolReferences=s}};It.ChatRequestTurn=zwr;var Ywr=class{static{a(this,"ChatRequestTurn2")}constructor(e,r,n,o,s,c,l,u,d){this.prompt=e,this.command=r,this.references=n,this.participant=o,this.toolReferences=s,this.editedFileEvents=c,this.id=l,this.modelId=u,this.modeInstructions2=d}};It.ChatRequestTurn2=Ywr;var Kwr=class{static{a(this,"ChatResponseTurn")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};It.ChatResponseTurn=Kwr;var Jwr=class{static{a(this,"ChatRequestEditorData")}constructor(e,r,n,o){this.editor=e,this.document=r,this.selection=n,this.wholeRange=o}};It.ChatRequestEditorData=Jwr;var Zwr=class{static{a(this,"ChatRequestNotebookData")}constructor(e){this.cell=e}};It.ChatRequestNotebookData=Zwr;var Xwr=class{static{a(this,"ChatReferenceDiagnostic")}constructor(e){this.diagnostics=e}};It.ChatReferenceDiagnostic=Xwr;var eRr=class{static{a(this,"ChatReferenceBinaryData")}constructor(e,r){this.mimeType=e,this.data=r}};It.ChatReferenceBinaryData=eRr;var tRr=class{static{a(this,"LanguageModelToolResult")}constructor(e){this.content=e}};It.LanguageModelToolResult=tRr;var rRr=class{static{a(this,"LanguageModelToolResult2")}constructor(e){this.content=e}};It.LanguageModelToolResult2=rRr;var lEt=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}};It.LanguageModelTextPart=lEt;var sOi;(function(t){t[t.Assistant=0]="Assistant",t[t.User=1]="User",t[t.Extension=2]="Extension"})(sOi||(It.LanguageModelPartAudience=sOi={}));var nRr=class extends lEt{static{a(this,"LanguageModelTextPart2")}constructor(e,r){super(e),this.audience=r}};It.LanguageModelTextPart2=nRr;var iRr=class{static{a(this,"LanguageModelThinkingPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};It.LanguageModelThinkingPart=iRr;var uEt=class t{static{a(this,"LanguageModelDataPart")}constructor(e,r){this.mimeType=r,this.data=e}static image(e,r){return new t(e,r)}static json(e){let r=JSON.stringify(e,void 0," ");return new t(iOi.VSBuffer.fromString(r).buffer,"json")}static text(e){return new t(iOi.VSBuffer.fromString(e).buffer,"text/plain")}};It.LanguageModelDataPart=uEt;var oRr=class extends uEt{static{a(this,"LanguageModelDataPart2")}constructor(e,r,n){super(e,r),this.audience=n}};It.LanguageModelDataPart2=oRr;var aOi;(function(t){t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif",t.WEBP="image/webp",t.BMP="image/bmp"})(aOi||(It.ChatImageMimeType=aOi={}));var sRr=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};It.LanguageModelPromptTsxPart=sRr;var cOi;(function(t){t[t.None=1]="None",t[t.FilesExclude=2]="FilesExclude",t[t.SearchAndFilesExclude=3]="SearchAndFilesExclude"})(cOi||(It.ExcludeSettingOptions=cOi={}));var aRr=class{static{a(this,"TextSearchMatch2")}constructor(e,r,n){this.uri=e,this.ranges=r,this.previewText=n}};It.TextSearchMatch2=aRr;var cRr=class{static{a(this,"AISearchKeyword")}constructor(e){this.keyword=e}};It.AISearchKeyword=cRr;var lOi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(lOi||(It.ChatErrorLevel=lOi={}));var uOi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(uOi||(It.ChatInputNotificationSeverity=uOi={}));var dOi;(function(t){t[t.Keep=1]="Keep",t[t.Undo=2]="Undo",t[t.UserModification=3]="UserModification"})(dOi||(It.ChatRequestEditedFileEventKind=dOi={}));var fOi;(function(t){t[t.NoReason=0]="NoReason",t[t.FilteredContentRetry=1]="FilteredContentRetry",t[t.CopyrightContentRetry=2]="CopyrightContentRetry"})(fOi||(It.ChatResponseClearToPreviousToolInvocationReason=fOi={}));var lRr=class{static{a(this,"LanguageModelToolExtensionSource")}constructor(e,r){this.id=e,this.label=r}};It.LanguageModelToolExtensionSource=lRr;var uRr=class{static{a(this,"LanguageModelToolMCPSource")}constructor(e,r,n){this.label=e,this.name=r,this.instructions=n}};It.LanguageModelToolMCPSource=uRr;var dRr=class{static{a(this,"LanguageModelToolCallPart")}constructor(e,r,n){this.callId=e,this.name=r,this.input=n}};It.LanguageModelToolCallPart=dRr;var fRr=class{static{a(this,"LanguageModelToolResultPart")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};It.LanguageModelToolResultPart=fRr;var pRr=class{static{a(this,"LanguageModelToolResultPart2")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};It.LanguageModelToolResultPart2=pRr;var dEt;(function(t){t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.System=3]="System"})(dEt||(It.LanguageModelChatMessageRole=dEt={}));var pOi;(function(t){t[t.Auto=1]="Auto",t[t.Required=2]="Required"})(pOi||(It.LanguageModelChatToolMode=pOi={}));var hRr=class t{static{a(this,"LanguageModelChatMessage")}constructor(e,r,n){this.role=e,this.content=typeof r=="string"?[{type:"text",value:r}]:r,this.name=n}static User(e,r){return new t(dEt.User,e,r)}static Assistant(e,r){return new t(dEt.Assistant,e,r)}};It.LanguageModelChatMessage=hRr;var mRr=class{static{a(this,"McpToolInvocationContentData")}constructor(e,r){this.data=e,this.mimeType=r}};It.McpToolInvocationContentData=mRr;var gRr=class{static{a(this,"ChatToolInvocationPart")}constructor(e,r,n){this.toolName=e,this.toolCallId=r,this.isError=typeof n=="string"?!0:n}};It.ChatToolInvocationPart=gRr;var ARr=class{static{a(this,"ChatSubagentToolInvocationData")}constructor(e,r,n,o){this.description=e,this.agentName=r,this.prompt=n,this.result=o}};It.ChatSubagentToolInvocationData=ARr;var yRr=class{static{a(this,"ChatResponseTurn2")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};It.ChatResponseTurn2=yRr;var hOi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress",t[t.NeedsInput=3]="NeedsInput"})(hOi||(It.ChatSessionStatus=hOi={}));var ERr=class t extends Error{static{a(this,"LanguageModelError")}static#e="LanguageModelError";static NotFound(e){return new t(e,t.NotFound.name)}static NoPermissions(e){return new t(e,t.NoPermissions.name)}static Blocked(e){return new t(e,t.Blocked.name)}constructor(e,r,n){super(e,{cause:n}),this.name=t.#e,this.code=r??""}};It.LanguageModelError=ERr;var _Rr=class{static{a(this,"ChatResource")}constructor(e){this.uri=e}};It.ChatResource=_Rr;var vRr=class{static{a(this,"McpStdioServerDefinition")}constructor(e,r,n,o,s){this.label=e,this.command=r,this.args=n??[],this.env=o??{},this.version=s}};It.McpStdioServerDefinition=vRr;var CRr=class{static{a(this,"McpHttpServerDefinition")}constructor(e,r,n,o){this.label=e,this.uri=r,this.headers=n??{},this.version=o}};It.McpHttpServerDefinition=CRr});var yOi=I(P$=>{"use strict";p();Object.defineProperty(P$,"__esModule",{value:!0});P$.TextDocumentChangeReason=P$.TextEditorSelectionChangeKind=P$.WorkspaceEdit=void 0;var lXa=Sl(),uXa=r2(),dXa=aL(),fXa=gwr(),pXa=Cwr(),bRr=class{static{a(this,"WorkspaceEdit")}constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,r,n,o){this._edits.push({_type:1,from:e,to:r,options:n,metadata:o})}createFile(e,r,n){this._edits.push({_type:1,from:void 0,to:e,options:r,metadata:n})}deleteFile(e,r,n){this._edits.push({_type:1,from:e,to:void 0,options:r,metadata:n})}replace(e,r,n,o){this._edits.push({_type:2,uri:e,edit:new pXa.TextEdit(r,n),metadata:o})}insert(e,r,n,o){this.replace(e,new dXa.Range(r,r),n,o)}delete(e,r,n){this.replace(e,r,"",n)}has(e){return this._edits.some(r=>r._type===2&&r.uri.toString()===e.toString())}set(e,r){if(r)for(let n of r){if(!n)continue;let o,s;Array.isArray(n)?(o=n[0],s=n[1]):o=n,fXa.SnippetTextEdit.isSnippetTextEdit(o)?this._edits.push({_type:6,uri:e,range:o.range,edit:o.snippet,metadata:s}):this._edits.push({_type:2,uri:e,edit:o,metadata:s})}else{for(let n=0;n{"use strict";p();Object.defineProperty(kp,"__esModule",{value:!0});kp.FileType=kp.ChatSessionStatus=kp.ChatLocation=kp.ChatVariableLevel=kp.ExtensionMode=kp.DiagnosticSeverity=kp.TextEditorRevealType=kp.TextEditorLineNumbersStyle=kp.TextEditorCursorStyle=kp.InteractiveEditorResponseFeedbackKind=void 0;var EOi;(function(t){t[t.Unhelpful=0]="Unhelpful",t[t.Helpful=1]="Helpful",t[t.Undone=2]="Undone",t[t.Accepted=3]="Accepted",t[t.Bug=4]="Bug"})(EOi||(kp.InteractiveEditorResponseFeedbackKind=EOi={}));var _Oi;(function(t){t[t.Line=1]="Line",t[t.Block=2]="Block",t[t.Underline=3]="Underline",t[t.LineThin=4]="LineThin",t[t.BlockOutline=5]="BlockOutline",t[t.UnderlineThin=6]="UnderlineThin"})(_Oi||(kp.TextEditorCursorStyle=_Oi={}));var vOi;(function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.Relative=2]="Relative",t[t.Interval=3]="Interval"})(vOi||(kp.TextEditorLineNumbersStyle=vOi={}));var COi;(function(t){t[t.Default=0]="Default",t[t.InCenter=1]="InCenter",t[t.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",t[t.AtTop=3]="AtTop"})(COi||(kp.TextEditorRevealType=COi={}));var bOi;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Information=2]="Information",t[t.Hint=3]="Hint"})(bOi||(kp.DiagnosticSeverity=bOi={}));var SOi;(function(t){t[t.Production=1]="Production",t[t.Development=2]="Development",t[t.Test=3]="Test"})(SOi||(kp.ExtensionMode=SOi={}));var TOi;(function(t){t[t.Short=1]="Short",t[t.Medium=2]="Medium",t[t.Full=3]="Full"})(TOi||(kp.ChatVariableLevel=TOi={}));var IOi;(function(t){t[t.Panel=1]="Panel",t[t.Terminal=2]="Terminal",t[t.Notebook=3]="Notebook",t[t.Editor=4]="Editor"})(IOi||(kp.ChatLocation=IOi={}));var xOi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress"})(xOi||(kp.ChatSessionStatus=xOi={}));var wOi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(wOi||(kp.FileType=wOi={}))});var POi=I(SRr=>{"use strict";p();Object.defineProperty(SRr,"__esModule",{value:!0});SRr.t=hXa;function hXa(...t){if(typeof t[0]=="string"){let e=t.shift(),r=!t||typeof t[0]!="object"?t:t[0];return kOi({message:e,args:r})}return kOi(t[0])}a(hXa,"t");function kOi(t){let{message:e,args:r}=t;return gXa(e,r??{})}a(kOi,"getMessage");var mXa=/{([^}]+)}/g;function gXa(t,e){return t.replace(mXa,(r,n)=>e[n]??r)}a(gXa,"format2")});var MOi=I(D$=>{"use strict";p();Object.defineProperty(D$,"__esModule",{value:!0});D$.NewSymbolName=D$.NewSymbolNameTriggerKind=D$.NewSymbolNameTag=void 0;var DOi;(function(t){t[t.AIGenerated=1]="AIGenerated"})(DOi||(D$.NewSymbolNameTag=DOi={}));var NOi;(function(t){t[t.Invoke=0]="Invoke",t[t.Automatic=1]="Automatic"})(NOi||(D$.NewSymbolNameTriggerKind=NOi={}));var TRr=class{static{a(this,"NewSymbolName")}constructor(e,r){this.newSymbolName=e,this.tags=r}};D$.NewSymbolName=TRr});var LOi=I(pEt=>{"use strict";p();Object.defineProperty(pEt,"__esModule",{value:!0});pEt.TerminalShellExecutionCommandLineConfidence=void 0;var OOi;(function(t){t[t.Low=0]="Low",t[t.Medium=1]="Medium",t[t.High=2]="High"})(OOi||(pEt.TerminalShellExecutionCommandLineConfidence=OOi={}))});var BOi=I(zAe=>{"use strict";p();Object.defineProperty(zAe,"__esModule",{value:!0});zAe.ThemeColor=zAe.ThemeIcon=void 0;var IRr=class t{static{a(this,"ThemeIcon")}constructor(e,r){this.id=e,this.color=r}static isThemeIcon(e){return!(e instanceof t)}};zAe.ThemeIcon=IRr;var xRr=class{static{a(this,"ThemeColor")}constructor(e){this.id=e}};zAe.ThemeColor=xRr});var N0=I((s8p,qOi)=>{"use strict";p();var AXa=n2(),yXa=Rc(),EXa=ad(),FOi=kxr(),_Xa=Nxr(),vXa=nwr(),cLe=YMi(),CXa=VAe(),bXa=aL(),SXa=JMi(),TXa=hwr(),IXa=gwr(),UOi=tOi(),QOi=Cwr(),On=mOi(),wRr=yOi(),N$=ROi(),xXa=POi(),RRr=MOi(),wXa=LOi(),RXa=BOi(),kXa={Position:CXa.Position,Range:bXa.Range,Selection:SXa.Selection,EventEmitter:yXa.Emitter,CancellationTokenSource:AXa.CancellationTokenSource,Diagnostic:FOi.Diagnostic,Location:_Xa.Location,DiagnosticRelatedInformation:FOi.DiagnosticRelatedInformation,TextEdit:QOi.TextEdit,WorkspaceEdit:wRr.WorkspaceEdit,Uri:EXa.URI,MarkdownString:vXa.MarkdownString,DiagnosticSeverity:N$.DiagnosticSeverity,TextEditorCursorStyle:N$.TextEditorCursorStyle,TextEditorLineNumbersStyle:N$.TextEditorLineNumbersStyle,TextEditorRevealType:N$.TextEditorRevealType,EndOfLine:QOi.EndOfLine,l10n:{t:xXa.t},ExtensionMode:N$.ExtensionMode,ChatVariableLevel:N$.ChatVariableLevel,ChatResponseClearToPreviousToolInvocationReason:On.ChatResponseClearToPreviousToolInvocationReason,ChatResponseMarkdownPart:On.ChatResponseMarkdownPart,ChatResponseFileTreePart:On.ChatResponseFileTreePart,ChatResponseAnchorPart:On.ChatResponseAnchorPart,ChatResponseMovePart:On.ChatResponseMovePart,ChatResponseExtensionsPart:On.ChatResponseExtensionsPart,ChatResponseProgressPart:On.ChatResponseProgressPart,ChatResponseProgressPart2:On.ChatResponseProgressPart2,ChatResponseWarningPart:On.ChatResponseWarningPart,ChatResponseInfoPart:On.ChatResponseInfoPart,ChatResponseHookPart:On.ChatResponseHookPart,ChatResponseReferencePart:On.ChatResponseReferencePart,ChatResponseReferencePart2:On.ChatResponseReferencePart2,ChatResponseCodeCitationPart:On.ChatResponseCodeCitationPart,ChatResponseCommandButtonPart:On.ChatResponseCommandButtonPart,ChatResponseExternalEditPart:On.ChatResponseExternalEditPart,ChatResponseMarkdownWithVulnerabilitiesPart:On.ChatResponseMarkdownWithVulnerabilitiesPart,ChatResponseCodeblockUriPart:On.ChatResponseCodeblockUriPart,ChatResponseTextEditPart:On.ChatResponseTextEditPart,ChatResponseNotebookEditPart:On.ChatResponseNotebookEditPart,ChatResponseWorkspaceEditPart:On.ChatResponseWorkspaceEditPart,ChatResponseConfirmationPart:On.ChatResponseConfirmationPart,ChatQuestion:On.ChatQuestion,ChatQuestionType:On.ChatQuestionType,ChatResponseQuestionCarouselPart:On.ChatResponseQuestionCarouselPart,ChatRequestTurn:On.ChatRequestTurn,ChatResponseTurn:On.ChatResponseTurn,ChatRequestEditorData:On.ChatRequestEditorData,ChatRequestNotebookData:On.ChatRequestNotebookData,NewSymbolName:RRr.NewSymbolName,NewSymbolNameTag:RRr.NewSymbolNameTag,NewSymbolNameTriggerKind:RRr.NewSymbolNameTriggerKind,ChatLocation:N$.ChatLocation,SymbolInformation:UOi.SymbolInformation,LanguageModelToolResult:On.LanguageModelToolResult,ExtendedLanguageModelToolResult:On.LanguageModelToolResult,LanguageModelToolResult2:On.LanguageModelToolResult2,LanguageModelPromptTsxPart:On.LanguageModelPromptTsxPart,LanguageModelTextPart:On.LanguageModelTextPart,LanguageModelDataPart:On.LanguageModelDataPart,LanguageModelToolExtensionSource:On.LanguageModelToolExtensionSource,LanguageModelToolMCPSource:On.LanguageModelToolMCPSource,ChatReferenceBinaryData:On.ChatReferenceBinaryData,ChatReferenceDiagnostic:On.ChatReferenceDiagnostic,TextSearchMatch2:On.TextSearchMatch2,AISearchKeyword:On.AISearchKeyword,ExcludeSettingOptions:On.ExcludeSettingOptions,NotebookCellKind:cLe.NotebookCellKind,NotebookRange:cLe.NotebookRange,NotebookEdit:cLe.NotebookEdit,NotebookCellData:cLe.NotebookCellData,NotebookData:cLe.NotebookData,ChatErrorLevel:On.ChatErrorLevel,ChatInputNotificationSeverity:On.ChatInputNotificationSeverity,TerminalShellExecutionCommandLineConfidence:wXa.TerminalShellExecutionCommandLineConfidence,ChatRequestEditedFileEventKind:On.ChatRequestEditedFileEventKind,ChatResponsePullRequestPart:On.ChatResponsePullRequestPart,LanguageModelTextPart2:On.LanguageModelTextPart2,LanguageModelDataPart2:On.LanguageModelDataPart2,LanguageModelThinkingPart:On.LanguageModelThinkingPart,LanguageModelPartAudience:On.LanguageModelPartAudience,ChatResponseThinkingProgressPart:On.ChatResponseThinkingProgressPart,LanguageModelToolCallPart:On.LanguageModelToolCallPart,LanguageModelToolResultPart:On.LanguageModelToolResultPart,LanguageModelToolResultPart2:On.LanguageModelToolResultPart2,LanguageModelChatMessageRole:On.LanguageModelChatMessageRole,LanguageModelChatMessage:On.LanguageModelChatMessage,LanguageModelChatToolMode:On.LanguageModelChatToolMode,TextEditorSelectionChangeKind:wRr.TextEditorSelectionChangeKind,TextDocumentChangeReason:wRr.TextDocumentChangeReason,ChatToolInvocationPart:On.ChatToolInvocationPart,ChatSubagentToolInvocationData:On.ChatSubagentToolInvocationData,McpToolInvocationContentData:On.McpToolInvocationContentData,ChatResponseTurn2:On.ChatResponseTurn2,ChatRequestTurn2:On.ChatRequestTurn2,LanguageModelError:On.LanguageModelError,SymbolKind:UOi.SymbolKind,SnippetString:TXa.SnippetString,SnippetTextEdit:IXa.SnippetTextEdit,FileType:N$.FileType,ChatSessionStatus:On.ChatSessionStatus,authentication:{getSession:a(async()=>{throw new Error("authentication.getSession not mocked in test")},"getSession")},McpHttpServerDefinition:On.McpHttpServerDefinition,McpStdioServerDefinition:On.McpStdioServerDefinition,ThemeIcon:RXa.ThemeIcon};qOi.exports=kXa});var jOi=I(YAe=>{"use strict";p();Object.defineProperty(YAe,"__esModule",{value:!0});YAe.UseData=YAe.UseState=void 0;var kRr=class{static{a(this,"UseState")}constructor(e){this.states=e,this.currentIndex=0,this.stateChanged=!1}useState(e){let r=this.currentIndex;if(this.states[r]===void 0){let o=typeof e=="function"?e():e;this.states[r]=o}let n=a(o=>{let s=typeof o=="function"?o(this.states[r]):o;this.states[r]=s,this.stateChanged=!0},"setState");return this.currentIndex++,[this.states[r],n]}hasChanged(){return this.stateChanged}};YAe.UseState=kRr;var PRr=class{static{a(this,"UseData")}constructor(e){this.measureUpdateTime=e,this.consumers=[]}useData(e,r){this.consumers.push(n=>{if(e(n))return r(n)})}async updateData(e){if(this.consumers.length>0){let r=performance.now();for(let n of this.consumers)await n(e);this.measureUpdateTime(performance.now()-r)}}};YAe.UseData=PRr});var GOi=I(hEt=>{"use strict";p();Object.defineProperty(hEt,"__esModule",{value:!0});hEt.VirtualPromptReconciler=void 0;var HOi=jOi(),DRr=class{static{a(this,"VirtualPromptReconciler")}constructor(e){this.lifecycleData=new Map,this.vTree=this.virtualizeElement(e,"$",0)}reconcile(e){if(!this.vTree)throw new Error("No tree to reconcile, make sure to pass a valid prompt");return e?.isCancellationRequested?this.vTree:(this.vTree=this.reconcileNode(this.vTree,"$",0,e),this.vTree)}reconcileNode(e,r,n,o){if(!e.children&&!e.lifecycle)return e;let s=e;if(e.lifecycle?.isRemountRequired()){let l=this.collectChildPaths(e);s=this.virtualizeElement(e.component,r,n);let u=this.collectChildPaths(s);this.cleanupState(l,u)}else if(e.children){let l=[];for(let u=0;u"u")){if(typeof e=="string"||typeof e=="number")return{name:typeof e,path:`${r}[${n}]`,props:{value:e},component:e};if(PXa(e.type)){let o=e.type(e.props.children),s=r!=="$"?`[${n}]`:"",c=`${r}${s}.${o.type}`,l=o.children.map((u,d)=>this.virtualizeElement(u,c,d));return this.ensureUniqueKeys(l),{name:o.type,path:c,children:l.flat().filter(u=>u!==void 0),component:e}}return this.virtualizeFunctionComponent(r,n,e,e.type)}}virtualizeFunctionComponent(e,r,n,o){let s=n.props.key?`["${n.props.key}"]`:`[${r}]`,c=`${e}${s}.${o.name}`,l=new MRr(this.getOrCreateLifecycleData(c)),u=o(n.props,l),h=(Array.isArray(u)?u:[u]).map((m,g)=>this.virtualizeElement(m,c,g)).flat().filter(m=>m!==void 0);return this.ensureUniqueKeys(h),{name:o.name,path:c,props:n.props,children:h,component:n,lifecycle:l}}ensureUniqueKeys(e){let r=new Map;for(let o of e){if(!o)continue;let s=o.props?.key;s&&r.set(s,(r.get(s)||0)+1)}let n=Array.from(r.entries()).filter(([o,s])=>s>1).map(([o])=>o);if(n.length>0)throw new Error(`Duplicate keys found: ${n.join(", ")}`)}collectChildPaths(e){let r=[];if(e?.children)for(let n of e.children)n&&(r.push(n.path),r.push(...this.collectChildPaths(n)));return r}cleanupState(e,r){for(let n of e)r.includes(n)||this.lifecycleData.delete(n)}getOrCreateLifecycleData(e){return this.lifecycleData.has(e)||this.lifecycleData.set(e,new NRr([])),this.lifecycleData.get(e)}createPipe(){return{pump:a(async e=>{await this.pumpData(e)},"pump")}}async pumpData(e){if(!this.vTree)throw new Error("No tree to pump data into. Pumping data before initializing?");await this.recursivelyPumpData(e,this.vTree)}async recursivelyPumpData(e,r){if(!r)throw new Error("Can't pump data into undefined node.");await r.lifecycle?.dataHook.updateData(e);for(let n of r.children||[])await this.recursivelyPumpData(e,n)}};hEt.VirtualPromptReconciler=DRr;var NRr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},MRr=class{static{a(this,"PromptElementLifecycle")}constructor(e){this.lifecycleData=e,this.stateHook=new HOi.UseState(e.state),this.dataHook=new HOi.UseData(r=>{e._updateTimeMs=r})}useState(e){return this.stateHook.useState(e)}useData(e,r){this.dataHook.useData(e,r)}isRemountRequired(){return this.stateHook.hasChanged()}};function PXa(t){return typeof t=="function"&&"isFragmentFunction"in t}a(PXa,"isFragmentFunction")});var $Oi=I(mEt=>{"use strict";p();Object.defineProperty(mEt,"__esModule",{value:!0});mEt.VirtualPrompt=void 0;var DXa=GOi(),ORr=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new DXa.VirtualPromptReconciler(e)}snapshotNode(e,r){if(!e)return;if(r?.isCancellationRequested)return"cancelled";let n=[];for(let o of e.children??[]){let s=this.snapshotNode(o,r);if(s==="cancelled")return"cancelled";s!==void 0&&n.push(s)}return{value:e.props?.value?.toString(),name:e.name,path:e.path,props:e.props,children:n,statistics:{updateDataTimeMs:e.lifecycle?.lifecycleData.getUpdateTimeMsAndReset()}}}snapshot(e){try{let r=this.reconciler.reconcile(e);if(e?.isCancellationRequested)return{snapshot:void 0,status:"cancelled"};if(!r)throw new Error("Invalid virtual prompt tree");let n=this.snapshotNode(r,e);return n==="cancelled"||e?.isCancellationRequested?{snapshot:void 0,status:"cancelled"}:{snapshot:n,status:"ok"}}catch(r){return{snapshot:void 0,status:"error",error:r}}}createPipe(){return this.reconciler.createPipe()}};mEt.VirtualPrompt=ORr});var Q6=I(gEt=>{"use strict";p();Object.defineProperty(gEt,"__esModule",{value:!0});gEt.Text=NXa;gEt.Chunk=MXa;function NXa(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(NXa,"Text");function MXa(t){return t.children}a(MXa,"Chunk")});var M$=I(q6=>{"use strict";p();Object.defineProperty(q6,"__esModule",{value:!0});q6.PerCompletionContextProviderStatistics=q6.ContextProviderStatistics=q6.ICompletionsContextProviderService=void 0;q6.componentStatisticsToPromptMatcher=BXa;var OXa=nn(),LXa=M6();q6.ICompletionsContextProviderService=(0,OXa.createServiceIdentifier)("ICompletionsContextProviderService");var LRr=class{static{a(this,"ContextProviderStatistics")}constructor(e=()=>new AEt){this.createStatistics=e,this.statistics=new LXa.LRUCacheMap(25)}getStatisticsForCompletion(e){let r=this.statistics.get(e);if(r)return r;let n=this.createStatistics();return this.statistics.set(e,n),n}getPreviousStatisticsForCompletion(e){let r=Array.from(this.statistics.keys());for(let n=r.length-1;n>=0;n--){let o=r[n];if(o!==e)return this.statistics.peek(o)}}};q6.ContextProviderStatistics=LRr;var AEt=class{static{a(this,"PerCompletionContextProviderStatistics")}constructor(){this._expectations=new Map,this._lastResolution=new Map,this._statistics=new Map,this.opportunityId=void 0}addExpectations(e,r){let n=this._expectations.get(e)??[];this._expectations.set(e,[...n,...r])}clearExpectations(){this._expectations.clear()}setLastResolution(e,r){this._lastResolution.set(e,r)}setOpportunityId(e){this.opportunityId=e}get(e){return this._statistics.get(e)}getAllUsageStatistics(){return this._statistics.entries()}computeMatch(e){try{for(let[r,n]of this._expectations){if(n.length===0)continue;let o=this._lastResolution.get(r)??"none";if(o==="none"||o==="error"){this._statistics.set(r,{usage:"none",resolution:o});continue}let s=[];for(let[d,f]of n){let h={id:d.id,type:d.type};if(d.origin&&(h.origin=d.origin),f==="content_excluded"){s.push({...h,usage:"none_content_excluded"});continue}let m=e.find(g=>g.source===d);m===void 0?s.push({...h,usage:"error"}):s.push({...h,usage:m.expectedTokens>0&&m.expectedTokens===m.actualTokens?"full":m.actualTokens>0?"partial":"none",expectedTokens:m.expectedTokens,actualTokens:m.actualTokens})}let l=s.reduce((d,f)=>f.usage==="full"?d+1:f.usage==="partial"?d+.5:d,0)/n.length,u=l===1?"full":l===0?"none":"partial";this._statistics.set(r,{resolution:o,usage:u,usageDetails:s})}}finally{this.clearExpectations(),this._lastResolution.clear()}}};q6.PerCompletionContextProviderStatistics=AEt;function BXa(t){return t.map(e=>{if(!(e.source===void 0||e.expectedTokens===void 0||e.actualTokens===void 0))return{source:e.source,expectedTokens:e.expectedTokens,actualTokens:e.actualTokens}}).filter(e=>e!==void 0)}a(BXa,"componentStatisticsToPromptMatcher")});var dLe=I(uLe=>{"use strict";p();Object.defineProperty(uLe,"__esModule",{value:!0});uLe.filterContextItemsByType=qXa;uLe.filterSupportedContextItems=jXa;uLe.addOrValidateContextItemsIDs=GXa;var FXa=N0(),UXa=ad(),BRr=x0(),QXa=w4e(),FRr=Dl(),lLe;(function(t){function e(r){return!(r.importance!==void 0&&(typeof r.importance!="number"||!Number.isInteger(r.importance)||r.importance<0||r.importance>100)||r.id!==void 0&&typeof r.id!="string"||r.origin!==void 0&&!QXa.ContextItemOrigin.is(r.origin))}a(e,"is"),t.is=e})(lLe||(lLe={}));var URr;(function(t){function e(r){if(!lLe.is(r))return!1;let n=r;return typeof n.name=="string"&&typeof n.value=="string"}a(e,"is"),t.is=e})(URr||(URr={}));var QRr;(function(t){function e(r){if(!lLe.is(r))return!1;let n=r;if(typeof n.uri!="string"||typeof n.value!="string")return!1;if(n.additionalUris===void 0)return!0;if(!Array.isArray(n.additionalUris))return!1;for(let o of n.additionalUris)if(typeof o!="string")return!1;return!0}a(e,"is"),t.is=e})(QRr||(QRr={}));var qRr;(function(t){function e(r){if(!lLe.is(r))return!1;let n=r;if(!UXa.URI.isUri(n.uri)||!Array.isArray(n.values))return!1;for(let o of n.values)if(!(o instanceof FXa.Diagnostic))return!1;return!0}a(e,"is"),t.is=e})(qRr||(qRr={}));var jRr;(function(t){function e(r){if(URr.is(r))return"Trait";if(QRr.is(r))return"CodeSnippet";if(qRr.is(r))return"DiagnosticBag"}a(e,"is"),t.is=e})(jRr||(jRr={}));function qXa(t,e){return t.map(r=>{let n=r.data.filter(o=>o.type===e);return n.length>0?{...r,data:n}:void 0}).filter(r=>r!==void 0)}a(qXa,"filterContextItemsByType");function jXa(t){let e=[],r=0;return t.forEach(n=>{let o=jRr.is(n);o!==void 0?e.push({...n,type:o}):r++}),[e,r]}a(jXa,"filterSupportedContextItems");function HXa(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(HXa,"validateContextItemId");function GXa(t,e){let r=new Set,n=t.get(FRr.ICompletionsLogTargetService),o=[];for(let s of e){let c=s.id??(0,BRr.generateUuid)();if(!HXa(c)){let l=(0,BRr.generateUuid)();FRr.logger.error(n,`Invalid context item ID ${c}, replacing with ${l}`),c=l}if(r.has(c)){let l=(0,BRr.generateUuid)();FRr.logger.error(n,`Duplicate context item ID ${c}, replacing with ${l}`),c=l}r.add(c),o.push({...s,id:c})}return o}a(GXa,"addOrValidateContextItemsIDs")});var HRr=I(yEt=>{"use strict";p();Object.defineProperty(yEt,"__esModule",{value:!0});yEt.getCodeSnippetsFromContextItems=YXa;yEt.addRelativePathToCodeSnippets=KXa;var $Xa=l1(),VXa=M$(),WXa=dLe(),zXa="content_excluded";async function YXa(t,e,r,n){let o=(0,WXa.filterContextItemsByType)(r,"CodeSnippet");if(o.length===0)return[];let s=new Set,c=o.flatMap(h=>h.data.map(m=>(s.add(m.uri),m.additionalUris?.forEach(g=>s.add(g)),{providerId:h.providerId,data:m}))),l=t.get(VXa.ICompletionsContextProviderService),u=t.get($Xa.ICompletionsTextDocumentManagerService),d=new Map;await Promise.all(Array.from(s).map(async h=>{d.set(h,await u.getTextDocumentValidation({uri:h}))}));let f=l.getStatisticsForCompletion(e);return c.filter(h=>{let g=[h.data.uri,...h.data.additionalUris??[]].every(A=>d.get(A)?.status==="valid");return g?f.addExpectations(h.providerId,[[h.data,"included"]]):f.addExpectations(h.providerId,[[h.data,zXa]]),g}).map(h=>h.data)}a(YXa,"getCodeSnippetsFromContextItems");function KXa(t,e){return e.map(r=>({snippet:r,relativePath:t.getRelativePath(r)}))}a(KXa,"addRelativePathToCodeSnippets")});var GRr=I(vEt=>{"use strict";p();Object.defineProperty(vEt,"__esModule",{value:!0});vEt.CodeSnippets=void 0;var EEt=sL(),_Et=Q6(),JXa=j6(),ZXa=HRr(),XXa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(JXa.isCompletionRequestData,d=>{d.codeSnippets!==r&&n(d.codeSnippets),d.document.uri!==o?.uri&&s(d.document)}),!r||r.length===0||!o)return;let c=(0,ZXa.addRelativePathToCodeSnippets)(t.tdms,r),l=new Map;for(let d of c){let f=d.relativePath??d.snippet.uri,h=l.get(f);h===void 0&&(h=[],l.set(f,h)),h.push(d)}let u=[];for(let[d,f]of l.entries()){let h=f.filter(m=>m.snippet.value.length>0);h.length>0&&u.push({chunkElements:h.map(m=>m.snippet),importance:Math.max(...h.map(m=>m.snippet.importance??0)),uri:d})}if(u.length!==0)return u.sort((d,f)=>f.importance-d.importance),u.reverse(),u.map(d=>{let f=[];return f.push((0,EEt.jsx)(_Et.Text,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push((0,EEt.jsx)(_Et.Text,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&m{"use strict";p();Object.defineProperty(KAe,"__esModule",{value:!0});KAe.CompletionsContext=VOi;KAe.StableCompletionsContext=WOi;KAe.AdditionalCompletionsContext=zOi;KAe.isContextNode=eec;function VOi(t){return t.children}a(VOi,"CompletionsContext");function WOi(t){return t.children}a(WOi,"StableCompletionsContext");function zOi(t){return t.children}a(zOi,"AdditionalCompletionsContext");function eec(t){return t.name===VOi.name||t.name===WOi.name||t.name===zOi.name}a(eec,"isContextNode")});var VRr=I(pLe=>{"use strict";p();Object.defineProperty(pLe,"__esModule",{value:!0});pLe.SnapshotWalker=void 0;pLe.defaultTransformers=YOi;var tec=Q6(),$Rr=class{static{a(this,"SnapshotWalker")}constructor(e,r=YOi()){this.snapshot=e,this.transformers=r}walkSnapshot(e){this.walkSnapshotNode(this.snapshot,void 0,e,{})}walkSnapshotNode(e,r,n,o){let s=this.transformers.reduce((l,u)=>u(e,r,l),{...o});if(n(e,r,s))for(let l of e.children??[])this.walkSnapshotNode(l,e,n,s)}};pLe.SnapshotWalker=$Rr;function YOi(){return[(t,e,r)=>{r.weight===void 0&&(r.weight=1);let n=t.props?.weight??1,o=typeof n=="number"?Math.max(0,Math.min(1,n)):1;return{...r,weight:o*r.weight}},(t,e,r)=>{if(t.name===tec.Chunk.name){let n=r.chunks?new Set(r.chunks):new Set;return n.add(t.path),{...r,chunks:n}}return r},(t,e,r)=>t.props?.source!==void 0?{...r,source:t.props.source}:r]}a(YOi,"defaultTransformers")});var KOi=I(WRr=>{"use strict";p();Object.defineProperty(WRr,"__esModule",{value:!0});WRr.findEditDistanceScore=rec;function rec(t,e){if(t.length===0||e.length===0)return{score:t.length+e.length};let r=Array.from({length:t.length}).map(()=>Array.from({length:e.length}).map(()=>0));for(let n=0;n{"use strict";p();Object.defineProperty(GD,"__esModule",{value:!0});GD.MAX_EDIT_DISTANCE_LENGTH=void 0;GD.CurrentFile=sec;GD.BeforeCursor=KRr;GD.AfterCursor=JRr;GD.DocumentPrefix=aec;GD.DocumentSuffix=cec;var WR=sL(),JAe=Q6(),nec=u$(),iec=KOi(),oec=Gre(),zRr=j6();GD.MAX_EDIT_DISTANCE_LENGTH=50;function YRr(t){let e=t*4,r=t*.1;return Math.floor(e+r)}a(YRr,"approximateMaxCharacters");function sec(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(zRr.isCompletionRequestData,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=YRr(c);return(0,WR.jsxs)(WR.Fragment,{children:[(0,WR.jsx)(KRr,{document:r,position:o,maxCharacters:m}),(0,WR.jsx)(JRr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(sec,"CurrentFile");function KRr(t){if(t.document===void 0||t.position===void 0)return(0,WR.jsx)(JAe.Text,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),(0,WR.jsx)(JAe.Text,{children:e})}a(KRr,"BeforeCursor");function JRr(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return(0,WR.jsx)(JAe.Text,{});let o=t.document.getText({start:t.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}});o.length>t.maxCharacters&&(o=o.slice(0,t.maxCharacters));let s=o.replace(/^.*/,"").trimStart();if(s==="")return(0,WR.jsx)(JAe.Text,{});if(r===s)return(0,WR.jsx)(JAe.Text,{children:r});let c=s;if(r!==""){let l=(0,oec.getTokenizer)(t.tokenizer),u=l.takeFirstTokens(s,GD.MAX_EDIT_DISTANCE_LENGTH),d=l.takeFirstTokens(r,GD.MAX_EDIT_DISTANCE_LENGTH);u.tokens.length>0&&d.tokens.length>0&&u.tokens[0]===d.tokens[0]&&100*(0,iec.findEditDistanceScore)(u.tokens,d.tokens)?.score<(t.suffixMatchThreshold??nec.DEFAULT_SUFFIX_MATCH_THRESHOLD)*u.tokens.length&&(c=r)}return c!==r&&n(c),(0,WR.jsx)(JAe.Text,{children:c})}a(JRr,"AfterCursor");function aec(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(zRr.isCompletionRequestData,d=>{let f=d.document;(d.document.uri!==r?.uri||f.getText()!==r?.getText())&&n(f),d.position!==o&&s(d.position),d.maxPromptTokens!==c&&l(d.maxPromptTokens)});let u=YRr(c);return(0,WR.jsx)(KRr,{document:r,position:o,maxCharacters:u})}a(aec,"DocumentPrefix");function cec(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(zRr.isCompletionRequestData,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=YRr(c);return(0,WR.jsx)(JRr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(cec,"DocumentSuffix")});var XRr=I(une=>{"use strict";p();Object.defineProperty(une,"__esModule",{value:!0});une.WishlistElision=void 0;une.makePrompt=lec;une.makePrefixPrompt=uec;une.makeContextPrompt=dec;var ZRr=class{static{a(this,"WishlistElision")}elide(e,r,n,o,s){if(r<=0)throw new Error("Prefix limit must be greater than 0");let[c,l]=this.preparePrefixBlocks(e,s),{elidedSuffix:u,adjustedPrefixTokenLimit:d}=this.elideSuffix(n,o,r,l,s),f=this.elidePrefix(c,d,l,s);return{blocks:[u,...f],cycles:1}}preparePrefixBlocks(e,r){let n=0,o=new Set;return[e.map((c,l)=>{let u=0,f=c.value.split(/([^\n]*\n+)/).filter(m=>m!=="").map(m=>{let g=r.tokenLength(m);return u+=g,n+=g,{line:m,componentPath:c.componentPath,tokens:g}}),h=c.componentPath;if(o.has(h))throw new Error(`Duplicate component path in prefix blocks: ${h}`);return o.add(h),{...c,tokens:u,markedForRemoval:!1,originalIndex:l,lines:f}}),n]}elideSuffix(e,r,n,o,s){let c=e.value;if(c.length===0||r<=0)return{elidedSuffix:{...e,tokens:0,elidedValue:"",elidedTokens:0},adjustedPrefixTokenLimit:n+Math.max(0,r)};o!f.markedForRemoval).flatMap(f=>f.lines);if(c.length===0)return[];let[l,u]=this.trimPrefixLinesToFit(c,r,o),d=u;return s.map(f=>{if(f.markedForRemoval)return d+f.tokens<=r&&!f.chunks?(d+=f.tokens,{...f,elidedValue:f.value,elidedTokens:f.tokens}):{...f,elidedValue:"",elidedTokens:0};let h=l.filter(g=>g.componentPath===f.componentPath&&g.line!=="").map(g=>g.line).join(""),m=f.tokens;return h!==f.value&&(m=h!==""?o.tokenLength(h):0),{...f,elidedValue:h,elidedTokens:m}})}removeLowWeightPrefixBlocks(e,r,n){let o=n;e.sort((s,c)=>s.weight-c.weight);for(let s of e){if(o<=r)break;if(s.weight!==1&&!(s.chunks&&s.markedForRemoval))if(s.chunks&&s.chunks.size>0)for(let c of e)!c.markedForRemoval&&c.chunks&&[...s.chunks].every(l=>c.chunks?.has(l))&&(c.markedForRemoval=!0,o-=c.tokens);else s.markedForRemoval=!0,o-=s.tokens}return e.sort((s,c)=>s.originalIndex-c.originalIndex)}trimPrefixLinesToFit(e,r,n){let o=0,s=[];for(let c=e.length-1;c>=0;c--){let l=e[c],u=l.tokens;if(o+u<=r)s.unshift(l),o+=u;else break}if(s.length===0){let c=e[e.length-1];if(c&&c.line.length>0){let u=n.takeLastTokens(c.line,r);return s.push({line:u.text,componentPath:c.componentPath,tokens:u.tokens.length}),[s,u.tokens.length]}let l=`Cannot fit prefix within limit of ${r} tokens`;throw new Error(l)}return[s,o]}};une.WishlistElision=ZRr;function lec(t){return t.map(e=>e.elidedValue).join("")}a(lec,"makePrompt");function uec(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(uec,"makePrefixPrompt");function dec(t){if(t.length===0)return[];let e=new Map;for(let o of t)if(o.type==="context"&&o.index!==void 0){e.has(o.index)||e.set(o.index,[]);let s=o.elidedValue.trim();s.length>0&&e.get(o.index).push(s)}let r=Math.max(...Array.from(e.keys()),-1),n=[];for(let o=0;o<=r;o++){let s=e.get(o);if(s&&s.length>0){let c=s.join(` +`).trim();n.push(c)}else n.push("")}return n}a(dec,"makeContextPrompt")});var rkr=I(O$=>{"use strict";p();Object.defineProperty(O$,"__esModule",{value:!0});O$.transformers=O$.CompletionsPromptRenderer=void 0;O$.normalizeLineEndings=tkr;var e5i=VRr(),JOi=X4e(),ZOi=Gre(),fec=fLe(),CEt=hLe(),XOi=XRr(),pec=5,ekr=class{static{a(this,"CompletionsPromptRenderer")}constructor(){this.renderId=0,this.formatPrefix=XOi.makePrompt}render(e,r,n){let o=this.renderId++,s=performance.now();try{if(n?.isCancellationRequested)return{status:"cancelled"};let c=r.delimiter??"",l=r.tokenizer??ZOi.TokenizerName.o200k,{prefixBlocks:u,suffixBlock:d,componentStatistics:f}=this.processSnapshot(e,c,r.languageId),{prefixTokenLimit:h,suffixTokenLimit:m}=this.getPromptLimits(d,r),g=performance.now(),A=new XOi.WishlistElision,{blocks:[y,...E]}=A.elide(u,h,d,m,(0,ZOi.getTokenizer)(l)),_=performance.now(),v=this.formatPrefix(E),b=this.formatContext?this.formatContext(E):void 0,T=y.elidedValue,w=E.reduce((R,x)=>R+x.elidedTokens,0);return f.push(...hec([...E,y])),{prefix:v,prefixTokens:w,suffix:T,suffixTokens:y.elidedTokens,context:b,status:"ok",metadata:{renderId:o,rendererName:"c",tokenizer:l,elisionTimeMs:_-g,renderTimeMs:performance.now()-s,componentStatistics:f,updateDataTimeMs:f.reduce((R,x)=>R+(x.updateDataTimeMs??0),0)}}}catch(c){return{status:"error",error:c}}}getPromptLimits(e,r){let n=e?.value??"",o=r.promptTokenLimit,s=r.suffixPercent;if(n.length===0||s===0)return{prefixTokenLimit:o,suffixTokenLimit:0};o=n.length>0?o-pec:o;let c=Math.ceil(o*(s/100));return{prefixTokenLimit:o-c,suffixTokenLimit:c}}processSnapshot(e,r,n){let o=[],s=[],c=[],l=!1;if(new e5i.SnapshotWalker(e,O$.transformers).walkSnapshot((f,h,m)=>{if(f===e||(f.name===CEt.CurrentFile.name&&(l=!0),f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.value===void 0||f.value===""))return!0;let g=m.chunks;if(m.type==="suffix")s.push({value:tkr(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let A=f.value.endsWith(r)?f.value:f.value+r,y=A;m.type==="prefix"?y=f.value:(0,JOi.isShebangLine)(f.value)?y=A:y=(0,JOi.commentBlockAsSingles)(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:tkr(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${CEt.CurrentFile.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}};O$.CompletionsPromptRenderer=ekr;O$.transformers=[...(0,e5i.defaultTransformers)(),(t,e,r)=>(0,fec.isContextNode)(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===CEt.BeforeCursor.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===CEt.AfterCursor.name?{...r,type:"suffix"}:r];function hec(t){return t.map(e=>{let r={componentPath:e.componentPath};return e.tokens!==0&&(r.expectedTokens=e.tokens,r.actualTokens=e.elidedTokens),e.nodeStatistics.updateDataTimeMs!==void 0&&(r.updateDataTimeMs=e.nodeStatistics.updateDataTimeMs),e.source&&(r.source=e.source),r})}a(hec,"computeComponentStatistics");function tkr(t){return t.replace(/\r\n?/g,` +`)}a(tkr,"normalizeLineEndings")});var bEt=I(ZAe=>{"use strict";p();Object.defineProperty(ZAe,"__esModule",{value:!0});ZAe.ILanguageContextProviderService=ZAe.ProviderTarget=void 0;var mec=nn(),t5i;(function(t){t.NES="nes",t.Completions="completions"})(t5i||(ZAe.ProviderTarget=t5i={}));ZAe.ILanguageContextProviderService=(0,mec.createServiceIdentifier)("ILanguageContextProviderService")});var dne=I(XAe=>{"use strict";p();Object.defineProperty(XAe,"__esModule",{value:!0});XAe.RuntimeMode=XAe.ICompletionsRuntimeModeService=void 0;var gec=nn();XAe.ICompletionsRuntimeModeService=(0,gec.createServiceIdentifier)("completionsRuntimeModeService");var nkr=class t{static{a(this,"RuntimeMode")}constructor(e){this.flags=e}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:r5i(r,n),verboseLogging:yec(r,n),testMode:e,simulation:Aec(n)})}isRunningInTest(){return this.flags.testMode}shouldFailForDebugPurposes(){return this.isRunningInTest()}isDebugEnabled(){return this.flags.debug}isVerboseLoggingEnabled(){return this.flags.verboseLogging}isRunningInSimulation(){return this.flags.simulation}};XAe.RuntimeMode=nkr;function r5i(t,e){return t.includes("--debug")||ikr(e,"DEBUG")}a(r5i,"determineDebugFlag");function Aec(t){return ikr(t,"SIMULATION")}a(Aec,"determineSimulationFlag");function yec(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||ikr(e,"VERBOSE")||r5i(t,e)}a(yec,"determineVerboseLoggingEnabled");function ikr(t,e){for(let r of["GH_COPILOT_","GITHUB_COPILOT_"]){let n=t[`${r}${e}`];if(n)return n==="1"||n?.toLowerCase()==="true"}return!1}a(ikr,"determineEnvFlagEnabled")});var s5i=I(mLe=>{"use strict";p();Object.defineProperty(mLe,"__esModule",{value:!0});mLe.eventToPromise=Eec;mLe.isArrayOfT=o5i;mLe.resolveAll=vec;var n5i=q4e();async function Eec(t){let e=new n5i.Deferred,r=t(n=>{e.resolve(n),r.dispose()});return e.promise}a(Eec,"eventToPromise");async function _ec(t){if(t.isCancellationRequested)return;let e=new n5i.Deferred,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(_ec,"cancellationTokenToPromise");async function i5i(t,e){if(e){let r=_ec(e);await Promise.race([t,r])}else await t}a(i5i,"raceCancellation");function o5i(t){return Array.isArray(t)}a(o5i,"isArrayOfT");async function vec(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await Cec(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(vec,"resolveAll");async function Cec(t,e){let r;return t instanceof Promise?r=await bec(t,e):r=await Sec(t,e),r}a(Cec,"resolve");async function bec(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{let s=await t;if(e?.isCancellationRequested)return;n={status:"full",resolutionTime:0,value:o5i(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await i5i(o,e),n.resolutionTime=performance.now()-r,n}a(bec,"resolvePromise");async function Sec(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{for await(let s of t){if(e?.isCancellationRequested)return;n.status!=="partial"&&(n={status:"partial",resolutionTime:0,value:[]}),n.value.push(s)}e?.isCancellationRequested||(n.status!=="partial"?n={status:"full",resolutionTime:0,value:[]}:n.status="full")}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await i5i(o,e),n.resolutionTime=performance.now()-r,n}a(Sec,"resolveIterable")});var a5i=I(skr=>{"use strict";p();Object.defineProperty(skr,"__esModule",{value:!0});skr.fillInCppVSCodeActiveExperiments=wec;var Tec=gy(),okr=Dl(),Iec={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},xec="ms-vscode.cpptools";function wec(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(xec))&&Rec(t,r,n)}a(wec,"fillInCppVSCodeActiveExperiments");function Rec(t,e,r){try{let n=t.get(Tec.ICompletionsFeaturesService),o=t.get(okr.ICompletionsLogTargetService),s=Iec,c=n.cppContextProviderParams(r);if(c)try{s=JSON.parse(c)}catch(l){okr.logger.error(o,"Failed to parse cppContextProviderParams",l)}else{let l=n.getContextProviderExpSettings("cpp")?.params;l&&(s={...l})}for(let[l,u]of Object.entries(s))e.set(l,u)}catch(n){okr.logger.exception(t,n,"fillInCppActiveExperiments")}}a(Rec,"addActiveExperiments")});var l5i=I(akr=>{"use strict";p();Object.defineProperty(akr,"__esModule",{value:!0});akr.fillInCSharpActiveExperiments=Pec;var kec=gy(),c5i=Dl();function Pec(t,e,r){let n=t.get(kec.ICompletionsFeaturesService),o=t.get(c5i.ICompletionsLogTargetService);try{let s=n.csharpContextProviderParams(r);if(s){let c=JSON.parse(s);for(let[l,u]of Object.entries(c))e.set(l,u)}else{let c=n.getContextProviderExpSettings("csharp")?.params;if(c)for(let[l,u]of Object.entries(c))e.set(l,u)}}catch(s){return c5i.logger.debug(o,"Failed to get the active C# experiments for the Context Provider API",s),!1}return!0}a(Pec,"fillInCSharpActiveExperiments")});var u5i=I(L$=>{"use strict";p();Object.defineProperty(L$,"__esModule",{value:!0});L$.multiLanguageContextProviderParamsDefault=void 0;L$.fillInMultiLanguageActiveExperiments=Mec;L$.getMultiLanguageContextProviderParamsFromActiveExperiments=Bec;var Dec=gy(),ckr=Dl(),Nec="fallbackContextProvider";L$.multiLanguageContextProviderParamsDefault={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function Mec(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(Nec))&&Oec(t,r,n)}a(Mec,"fillInMultiLanguageActiveExperiments");function Oec(t,e,r){try{let n=Lec(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){ckr.logger.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(Oec,"addActiveExperiments");function Lec(t,e){let r=L$.multiLanguageContextProviderParamsDefault,n=t.get(ckr.ICompletionsLogTargetService),s=t.get(Dec.ICompletionsFeaturesService).multiLanguageContextProviderParams(e);if(s)try{r=JSON.parse(s)}catch(c){ckr.logger.error(n,"Failed to parse multiLanguageContextProviderParams",c)}return r}a(Lec,"getMultiLanguageContextProviderParamsFromExp");function Bec(t){let e={...L$.multiLanguageContextProviderParamsDefault};return t.has("mlcpMaxContextItems")&&(e.mlcpMaxContextItems=Number(t.get("mlcpMaxContextItems"))),t.has("mlcpMaxSymbolMatches")&&(e.mlcpMaxSymbolMatches=Number(t.get("mlcpMaxSymbolMatches"))),t.has("mlcpEnableImports")&&(e.mlcpEnableImports=String(t.get("mlcpEnableImports"))==="true"),e}a(Bec,"getMultiLanguageContextProviderParamsFromActiveExperiments")});var f5i=I(eye=>{"use strict";p();Object.defineProperty(eye,"__esModule",{value:!0});eye.TS_CONTEXT_PROVIDER_ID=void 0;eye.fillInTsActiveExperiments=Uec;var Fec=gy(),d5i=Dl();eye.TS_CONTEXT_PROVIDER_ID="typescript-ai-context-provider";function Uec(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(eye.TS_CONTEXT_PROVIDER_ID)))return!1;let o=t.get(d5i.ICompletionsLogTargetService),s=t.get(Fec.ICompletionsFeaturesService);try{let c=s.tsContextProviderParams(n);if(c){let l=JSON.parse(c);for(let[u,d]of Object.entries(l))r.set(u,d)}else{let l=s.getContextProviderExpSettings("typescript")?.params;if(l)for(let[u,d]of Object.entries(l))r.set(u,d)}}catch(c){return d5i.logger.debug(o,"Failed to get the active TypeScript experiments for the Context Provider API",c),!1}return!0}a(Uec,"fillInTsActiveExperiments")});var IEt=I(Nl=>{"use strict";p();var pkr=Nl&&Nl.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},$D=Nl&&Nl.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Nl,"__esModule",{value:!0});Nl.DefaultDiagnosticSettings=Nl.CachedContextProviderRegistry=Nl.MutableContextProviderRegistry=Nl.CoreContextProviderRegistry=Nl.DefaultContextProvidersContainer=Nl.ICompletionsDefaultContextProviders=Nl.ICompletionsContextProviderRegistryService=void 0;Nl.telemetrizeContextItems=zec;Nl.matchContextItems=Yec;Nl.useContextProviderAPI=Jec;Nl.getDefaultDiagnosticSettings=Xec;var Qec=ei(),p5i=Pl(),hkr=bEt(),qec=yh(),g5i=nn(),jec=Rs(),mkr=$s(),SEt=qE(),A5i=gy(),Hec=M6(),H6=Dl(),gkr=dne(),h5i=s5i(),Gec=a5i(),$ec=l5i(),Vec=u5i(),Wec=f5i(),m5i=dLe(),y5i=M$();Nl.ICompletionsContextProviderRegistryService=(0,g5i.createServiceIdentifier)("ICompletionsContextProviderRegistryService");Nl.ICompletionsDefaultContextProviders=(0,g5i.createServiceIdentifier)("ICompletionsDefaultContextProviders");var lkr=class{static{a(this,"DefaultContextProvidersContainer")}constructor(){this.ids=[]}add(e){this.ids.push(e)}getIds(){return this.ids}};Nl.DefaultContextProvidersContainer=lkr;var TEt=class{static{a(this,"CoreContextProviderRegistry")}constructor(e,r,n,o,s,c){this.match=e,this.registryService=r,this.runtimeMode=n,this.instantiationService=o,this.logTarget=s,this.contextProviderStatistics=c}registerContextProvider(e){throw new Error("Should not be call. Use ILanguageContextProviderService")}unregisterContextProvider(e){throw new Error("Should not be call. Use ILanguageContextProviderService")}get providers(){return this.registryService.getAllProviders([hkr.ProviderTarget.Completions]).slice()}async resolveAllProviders(e,r,n,o,s,c){if(s?.isCancellationRequested)return H6.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];let l=new Map;this.instantiationService.invokeFunction($ec.fillInCSharpActiveExperiments,l,o);let u=[],d=this.providers;if(d.length===0)return u;let f=await this.matchProviders(d,n,o),h=f.filter(w=>w[1]>0);if(f.filter(w=>w[1]<=0).forEach(([w,R])=>{let x={providerId:w.id,matchScore:R,resolution:"none",resolutionTimeMs:0,data:[]};u.push(x)}),h.length===0)return u;if(s?.isCancellationRequested)return H6.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];this.instantiationService.invokeFunction(Gec.fillInCppVSCodeActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(Vec.fillInMultiLanguageActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(Wec.fillInTsActiveExperiments,h.map(w=>w[0].id),l,o);let g=new Qec.CancellationTokenSource;if(s){let w=s.onCancellationRequested(R=>{g.cancel(),w.dispose()})}let A=this.runtimeMode.isDebugEnabled()&&!this.runtimeMode.isRunningInSimulation()?0:this.instantiationService.invokeFunction(Zec,n.languageId,o),y=A>0?Date.now()+A:Number.MAX_SAFE_INTEGER,E;A>0&&(E=setTimeout(()=>{g.cancel(),g.dispose()},A));let _=new Map,v={completionId:e,opportunityId:r,documentContext:n,activeExperiments:l,timeBudget:A,timeoutEnd:y,data:c};for(let[w]of h){let R=this.contextProviderStatistics.getPreviousStatisticsForCompletion(e)?.get(w.id);R&&(v.previousUsageStatistics=R);let x=w.resolver.resolve(v,g.token);_.set(w.id,x)}let b=this.contextProviderStatistics.getStatisticsForCompletion(e);b.setOpportunityId(r);let T=await(0,h5i.resolveAll)(_,g.token);E&&clearTimeout(E);for(let[w,R]of h){let x=T.get(w.id);if(x){if(x.status==="error")(0,jec.isCancellationError)(x.reason)||H6.logger.error(this.logTarget,`Error resolving context from ${w.id}: `,x.reason),u.push({providerId:w.id,matchScore:R,resolution:x.status,resolutionTimeMs:x.resolutionTime,data:[]});else{let P=[...x.value??[]];if((x.status==="none"||x.status==="partial")&&(H6.logger.info(this.logTarget,`Context provider ${w.id} exceeded time budget of ${A}ms`),w.resolver.resolveOnTimeout))try{let j=w.resolver.resolveOnTimeout(v);(0,h5i.isArrayOfT)(j)?P.push(...j):j&&P.push(j),P.length>0&&(x.status="partial")}catch(j){H6.logger.error(this.logTarget,`Error in fallback logic for context provider ${w.id}: `,j)}let[D,N]=(0,m5i.filterSupportedContextItems)(P);N&&H6.logger.error(this.logTarget,`Dropped ${N} context items from ${w.id} due to invalid schema`);let L=this.instantiationService.invokeFunction(m5i.addOrValidateContextItemsIDs,D),B={providerId:w.id,matchScore:R,resolution:x.status,resolutionTimeMs:x.resolutionTime,data:L};u.push(B)}b.setLastResolution(w.id,x.status)}else H6.logger.error(this.logTarget,`Context provider ${w.id} not found in results`)}return u.sort((w,R)=>R.matchScore-w.matchScore)}async matchProviders(e,r,n){let o=this.instantiationService.invokeFunction(E5i,r.languageId,n),s=o.length===1&&o[0]==="*";return await Promise.all(e.map(async l=>{if(!s&&!o.includes(l.id))return[l,0];let u=await this.match(this.instantiationService,l.selector,r);return[l,u]}))}};Nl.CoreContextProviderRegistry=TEt;Nl.CoreContextProviderRegistry=TEt=pkr([$D(1,hkr.ILanguageContextProviderService),$D(2,gkr.ICompletionsRuntimeModeService),$D(3,mkr.IInstantiationService),$D(4,H6.ICompletionsLogTargetService),$D(5,y5i.ICompletionsContextProviderService)],TEt);var ukr=class extends TEt{static{a(this,"MutableContextProviderRegistry")}constructor(e,r,n,o,s,c){super(e,r,n,o,s,c),this._providers=[]}registerContextProvider(e){if(e.id.includes(",")||e.id.includes("*"))throw new Error(`A context provider id cannot contain a comma or an asterisk. The id ${e.id} is invalid.`);if(this._providers.find(r=>r.id===e.id))throw new Error(`A context provider with id ${e.id} has already been registered`);this._providers.push(e)}unregisterContextProvider(e){this._providers=this._providers.filter(r=>r.id!==e)}get providers(){return this._providers.slice().concat(super.providers)}};Nl.MutableContextProviderRegistry=ukr;Nl.MutableContextProviderRegistry=ukr=pkr([$D(1,hkr.ILanguageContextProviderService),$D(2,gkr.ICompletionsRuntimeModeService),$D(3,mkr.IInstantiationService),$D(4,H6.ICompletionsLogTargetService),$D(5,y5i.ICompletionsContextProviderService)],ukr);var dkr=class{static{a(this,"CachedContextProviderRegistry")}constructor(e,r,n){this._cachedContextItems=new Hec.LRUCacheMap(5),this.delegate=n.createInstance(e,r)}registerContextProvider(e){this.delegate.registerContextProvider(e)}unregisterContextProvider(e){this.delegate.unregisterContextProvider(e)}get providers(){return this.delegate.providers}async resolveAllProviders(e,r,n,o,s,c){let l=this._cachedContextItems.get(e);if(e&&l&&l.length>0)return l;let u=await this.delegate.resolveAllProviders(e,r,n,o,s,c);return u.length>0&&e&&this._cachedContextItems.set(e,u),u}};Nl.CachedContextProviderRegistry=dkr;Nl.CachedContextProviderRegistry=dkr=pkr([$D(2,mkr.IInstantiationService)],dkr);function zec(t,e,r){let n=t.getStatisticsForCompletion(e);return r.map(s=>{let{providerId:c,resolution:l,resolutionTimeMs:u,matchScore:d,data:f}=s,h=n.get(c),m=h?.usage??"none";(d<=0||l==="none"||l==="error")&&(m="none");let g={providerId:c,resolution:l,resolutionTimeMs:u,usage:m,usageDetails:h?.usageDetails,matched:d>0,numResolvedItems:f.length},A=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="full"||E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0,y=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0;return A!==void 0&&(g.numUsedItems=A),y!==void 0&&(g.numPartiallyUsedItems=y),g})}a(zec,"telemetrizeContextItems");function Yec(t){return t.matchScore>0&&t.resolution!=="error"}a(Yec,"matchContextItems");function E5i(t,e,r){let n=Kec(t,e,r),o=(0,SEt.getConfig)(t,SEt.ConfigKey.ContextProviders)??[];if(n.length===1&&n[0]==="*"||o.length===1&&o[0]==="*")return["*"];let s=t.get(Nl.ICompletionsDefaultContextProviders).getIds();return Array.from(new Set([...s,...n,...o]))}a(E5i,"getActiveContextProviders");function Kec(t,e,r){if(t.get(gkr.ICompletionsRuntimeModeService).isDebugEnabled())return["*"];let n=t.get(A5i.ICompletionsFeaturesService),o=n.contextProviders(r),s=n.getContextProviderExpSettings(e);if(s!==void 0)for(let c of s.ids)o.includes(c)||o.push(c);return o}a(Kec,"getExpContextProviders");function Jec(t,e,r){return E5i(t,e,r).length>0}a(Jec,"useContextProviderAPI");function Zec(t,e,r){let n=(0,SEt.getConfig)(t,SEt.ConfigKey.ContextProviderTimeBudget);return n!==void 0&&typeof n=="number"?n:t.get(A5i.ICompletionsFeaturesService).contextProviderTimeBudget(e,r)}a(Zec,"getContextProviderTimeBudget");var fkr;(function(t){function e(n){if(n)try{let o=JSON.parse(n);if(o.warnings===void 0&&o.maxDiagnostics===void 0&&o.maxLineDistance===void 0)return;let s=r(o),c=typeof o.maxLineDistance=="number"&&o.maxLineDistance>=0?o.maxLineDistance:10,l=typeof o.maxDiagnostics=="number"&&o.maxDiagnostics>0?o.maxDiagnostics:5;return{warnings:s,maxLineDistance:c,maxDiagnostics:l}}catch{return}}a(e,"from"),t.from=e;function r(n){let o=n?.warnings;return o==="yes"||o==="no"||o==="yesIfNoErrors"?o:"no"}a(r,"getWarnings")})(fkr||(Nl.DefaultDiagnosticSettings=fkr={}));function Xec(t){let e=t.get(p5i.IConfigurationService),r=t.get(qec.IExperimentationService),n=e.getExperimentBasedConfig(p5i.ConfigKey.TeamInternal.InlineCompletionsDefaultDiagnosticsOptions,r);if(typeof n=="string")return fkr.from(n)}a(Xec,"getDefaultDiagnosticSettings")});var xEt=I(VD=>{"use strict";p();var etc=VD&&VD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ttc=VD&&VD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(VD,"__esModule",{value:!0});VD.ContextProviderBridge=VD.ICompletionsContextProviderBridgeService=void 0;var rtc=nn(),ntc=M6(),itc=IEt();VD.ICompletionsContextProviderBridgeService=(0,rtc.createServiceIdentifier)("ICompletionsContextProviderBridgeService");var Akr=class{static{a(this,"ContextProviderBridge")}constructor(e){this.contextProviderRegistry=e,this.scheduledResolutions=new ntc.LRUCacheMap(25)}schedule(e,r,n,o,s,c){let{textDocument:l,originalPosition:u,originalOffset:d,originalVersion:f,editsWithPosition:h}=e,m=this.contextProviderRegistry.resolveAllProviders(r,n,{uri:l.uri,languageId:l.detectedLanguageId,version:f,offset:d,position:u,proposedEdits:h.length>0?h:void 0},o,s,c?.data);this.scheduledResolutions.set(r,m)}async resolution(e){let r=this.scheduledResolutions.get(e);return r?await r:[]}};VD.ContextProviderBridge=Akr;VD.ContextProviderBridge=Akr=etc([ttc(0,itc.ICompletionsContextProviderRegistryService)],Akr)});var _kr=I(wEt=>{"use strict";p();Object.defineProperty(wEt,"__esModule",{value:!0});wEt.Diagnostics=void 0;var ykr=sL(),otc=N0(),Ekr=Q6(),stc=u$(),atc=j6();function ctc(t){if(t.code!==void 0){if(typeof t.code=="string")return t.code;if(typeof t.code=="number")return t.code.toString();if(typeof t.code=="object"&&t.code!==null&&t.code.value)return t.code.value.toString()}}a(ctc,"getCode");function ltc(t,e){return t.getRelativePath({uri:e.uri.toString()})??e.uri.path}a(ltc,"getRelativePath");var utc=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(),[u,d]=e.useState();if(e.useData(atc.isCompletionRequestData,h=>{h.diagnostics!==r&&n(h.diagnostics);let m=(0,stc.normalizeLanguageId)(h.document.detectedLanguageId);m!==o&&s(m),h.position!==c&&l(h.position),h.document.uri!==u?.uri&&d(h.document)}),!r||r.length===0||!o)return;let f=r.filter(h=>h.values.length>0);if(f.length!==0)return f.sort((h,m)=>(m.importance??0)-(h.importance??0)),f.reverse(),f.map(h=>{let m=[];m.push((0,ykr.jsx)(Ekr.Text,{source:h,children:`Consider the following ${o} diagnostics from ${ltc(t.tdms,h)}:`},h.id));let g=h.values;return u!==void 0&&u.uri.toString()===h.uri.toString()&&c!==void 0&&(g=h.values.slice(),g.sort((A,y)=>{let E=Math.abs(A.range.start.line-c.line),_=Math.abs(y.range.start.line-c.line);return E-_})),g.forEach(A=>{let y="",E=ctc(A);E!==void 0&&(y=` ${A.source?A.source.toUpperCase():""}${E}`);let _=A.range.start;m.push((0,ykr.jsx)(Ekr.Text,{children:`${_.line+1}:${_.character+1} - ${otc.DiagnosticSeverity[A.severity].toLowerCase()}${y}: ${A.message}`}))}),(0,ykr.jsx)(Ekr.Chunk,{children:m})})},"Diagnostics");wEt.Diagnostics=utc});var vkr=I(kEt=>{"use strict";p();Object.defineProperty(kEt,"__esModule",{value:!0});kEt.DocumentMarker=void 0;var REt=sL(),_5i=Q6(),v5i=X4e(),dtc=j6(),ftc=a((t,e)=>{let[r,n]=e.useState();if(e.useData(dtc.isCompletionRequestData,o=>{o.document.uri!==r?.uri&&n(o.document)}),r){let o=t.tdms.getRelativePath(r),s={uri:r.uri,source:r.getText(),relativePath:o,languageId:r.detectedLanguageId},c=t.tdms.findNotebook(r);return s.relativePath&&!c?(0,REt.jsx)(ptc,{docInfo:s}):(0,REt.jsx)(htc,{docInfo:s})}},"DocumentMarker");kEt.DocumentMarker=ftc;var ptc=a(t=>(0,REt.jsx)(_5i.Text,{children:(0,v5i.getPathMarker)(t.docInfo)}),"PathMarker"),htc=a(t=>(0,REt.jsx)(_5i.Text,{children:(0,v5i.getLanguageMarker)(t.docInfo)}),"LanguageMarker")});var Ckr=I(gLe=>{"use strict";p();Object.defineProperty(gLe,"__esModule",{value:!0});gLe.RecentEdits=void 0;gLe.editIsTooCloseToCursor=S5i;var C5i=sL(),b5i=Q6(),PEt=X4e(),mtc=j6();function S5i(t,e=!1,r=void 0,n){if(e&&(r===void 0||n===void 0))throw new Error("cursorLine and activeDocDistanceLimitFromCursor are required when filterByCursorLine is true");let o=t.startLine-1,s=t.endLine-1;return!!(e&&(Math.abs(o-r)<=n||Math.abs(s-r)<=n))}a(S5i,"editIsTooCloseToCursor");var gtc=a((t,e)=>{let[r,n]=e.useState();return e.useData(mtc.isCompletionRequestData,async o=>{if(!o.document)return;let s=t.recentEditsProvider;if(s.isEnabled())s.start();else return;let c=s.config,l=s.getRecentEdits(),u=new Set,d=t.tdms,f=[];for(let m=l.length-1;m>=0&&!(f.length>=c.maxEdits);m--){let g=l[m];if(!await d.getTextDocument({uri:g.file}))continue;let A=!u.has(g.file);if(u.size+(A?1:0)>c.maxFiles)break;let E=g.file===o.document?.uri,_=E?o.position.line:void 0;if(S5i(g,E,_,c.activeDocDistanceLimitFromCursor))continue;let b=s.getEditSummary(g);if(b){u.add(g.file);let T=d.getRelativePath({uri:g.file});f.unshift((0,PEt.newLineEnded)(`File: ${T}`)+(0,PEt.newLineEnded)(b))}}if(f.length===0){n(void 0);return}let h=(0,PEt.newLineEnded)("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+(0,PEt.newLineEnded)("End of recent edits");n(h)}),r?(0,C5i.jsx)(b5i.Chunk,{children:(0,C5i.jsx)(b5i.Text,{children:r})}):void 0},"RecentEdits");gLe.RecentEdits=gtc});var T5i=I(uL=>{"use strict";p();Object.defineProperty(uL,"__esModule",{value:!0});uL.registerDocumentTracker=uL.accessTimes=void 0;uL.sortByAccessTimes=Etc;var Atc=M6(),ytc=l1();uL.accessTimes=new Atc.LRUCacheMap;function Etc(t){return[...t].sort((e,r)=>{let n=uL.accessTimes.get(e.uri)??0;return(uL.accessTimes.get(r.uri)??0)-n})}a(Etc,"sortByAccessTimes");var _tc=a(t=>t.get(ytc.ICompletionsTextDocumentManagerService).onDidFocusTextDocument(e=>{e.document&&uL.accessTimes.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");uL.registerDocumentTracker=_tc});var I5i=I(G6=>{"use strict";p();var vtc=G6&&G6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Ctc=G6&&G6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(G6,"__esModule",{value:!0});G6.OpenTabFiles=void 0;var btc=T5i(),Stc=l1(),bkr=tye(),Skr=class{static{a(this,"OpenTabFiles")}constructor(e){this.docManager=e}truncateDocs(e,r,n,o){let s=new Map,c=0;for(let l of e)if(!(c+l.getText().length>bkr.NeighborSource.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&(0,bkr.considerNeighborFile)(n,l.detectedLanguageId)&&(s.set(l.uri.toString(),{uri:l.uri.toString(),relativePath:this.docManager.getRelativePath(l),source:l.getText()}),c+=l.getText().length),s.size>=o))break;return s}async getNeighborFiles(e,r,n){let o=new Map,s=new Map;return o=this.truncateDocs((0,btc.sortByAccessTimes)(await this.docManager.textDocuments()),e,r,n),s.set(bkr.NeighboringFileType.OpenTabs,Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};G6.OpenTabFiles=Skr;G6.OpenTabFiles=Skr=vtc([Ctc(0,Stc.ICompletionsTextDocumentManagerService)],Skr)});var x5i=I(Tkr=>{"use strict";p();Object.defineProperty(Tkr,"__esModule",{value:!0});Tkr.shortCircuit=Ttc;function Ttc(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(Ttc,"shortCircuit")});var BEt=I(Ml=>{"use strict";p();var Itc=Ml&&Ml.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},DEt=Ml&&Ml.__param||function(t,e){return function(r,n){e(r,n,t)}},Ikr;Object.defineProperty(Ml,"__esModule",{value:!0});Ml.RelatedFilesProvider=Ml.ICompletionsRelatedFilesProviderService=Ml.relatedFilesLogger=Ml.PromiseExpirationCacheMap=Ml.EmptyRelatedFilesResponse=void 0;Ml.getRelatedFilesAndTraits=Ltc;var xtc=Vre(),wtc=nn(),Rtc=ad(),Rkr=$s(),ktc=g$(),Ptc=M6(),LEt=Dl(),Dtc=Yg(),Ntc=x5i();Ml.EmptyRelatedFilesResponse={entries:[],traits:[]};var NEt={entries:new Map,traits:[]},MEt=class extends Ptc.LRUCacheMap{static{a(this,"PromiseExpirationCacheMap")}constructor(e,r=120*1e3){super(e),this.defaultEvictionTimeMs=r,this._cacheTimestamps=new Map}bumpRetryCount(e){let r=this._cacheTimestamps.get(e);return r?++r.retryCount:(this._cacheTimestamps.set(e,{timestamp:Date.now(),retryCount:0}),0)}has(e){return this.isValid(e)?super.has(e):(this.deleteExpiredEntry(e),!1)}get(e){let r=super.get(e);if(this.isValid(e))return r;this.deleteExpiredEntry(e)}set(e,r){let n=super.set(e,r);return this.isValid(e)||this._cacheTimestamps.set(e,{timestamp:Date.now(),retryCount:0}),n}clear(){super.clear(),this._cacheTimestamps.clear()}isValid(e){let r=this._cacheTimestamps.get(e);return r!==void 0&&Date.now()-r.timestampMl.relatedFilesLogger.exception(o,n,"isContentExcluded"))}return!0}static dropBOM(e){return e.charCodeAt(0)===65279?e.slice(1):e}};Ml.RelatedFilesProvider=xkr;Ml.RelatedFilesProvider=xkr=Ikr=Itc([DEt(0,Rkr.IInstantiationService),DEt(1,xtc.IIgnoreService),DEt(2,LEt.ICompletionsLogTargetService),DEt(3,ktc.ICompletionsFileSystemService)],xkr);var Otc=3,ALe=new MEt(Mtc);async function w5i(t,e,r,n,o){let s=t.get(Rkr.IInstantiationService),c=t.get(LEt.ICompletionsLogTargetService),l=performance.now(),u;try{u=await o.getRelatedFiles(e,r,n)}catch(f){s.invokeFunction(h=>Ml.relatedFilesLogger.exception(h,f,".getRelatedFiles")),u=void 0}u===void 0&&(ALe.bumpRetryCount(e.uri)>=Otc?u=NEt:u=void 0);let d=performance.now()-l;if(Ml.relatedFilesLogger.debug(c,u!==void 0?`Fetched ${[...u.entries.values()].map(f=>f.size).reduce((f,h)=>f+h,0)} related files for '${e.uri}' in ${d}ms.`:`Failing fetching files for '${e.uri}' in ${d}ms.`),u===void 0)throw new OEt;return u}a(w5i,"getRelatedFiles");var wkr=a(function(t,e,r,n,o){let s=`${e.uri}`;if(ALe.has(s))return ALe.get(s);let c=w5i(t,e,r,n,o);return c instanceof Promise&&(c=c.catch(l=>{throw ALe.delete(s),l})),ALe.set(s,c),c},"getRelatedFilesWithCacheAndTimeout");wkr=(0,Ntc.shortCircuit)(wkr,200,NEt);async function Ltc(t,e,r,n,o,s=!1){let c=t.get(Rkr.IInstantiationService),l=t.get(LEt.ICompletionsLogTargetService),u=t.get(Ml.ICompletionsRelatedFilesProviderService),d=NEt;try{let f={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};d=s?await c.invokeFunction(w5i,f,r,n,u):await c.invokeFunction(wkr,f,r,n,u)}catch(f){d=NEt,f instanceof OEt&&c.invokeFunction(Dtc.telemetry,"getRelatedFilesList",r)}return Ml.relatedFilesLogger.debug(l,d!=null?`Fetched following traits ${d.traits.map(f=>`{${f.name} : ${f.value}}`).join("")} for '${e.uri}'`:`Failing fecthing traits for '${e.uri}'.`),d}a(Ltc,"getRelatedFilesAndTraits")});var tye=I(B$=>{"use strict";p();Object.defineProperty(B$,"__esModule",{value:!0});B$.NeighborSource=B$.NeighboringFileType=void 0;B$.considerNeighborFile=qtc;B$.isIncludeNeighborFilesActive=jtc;var Btc=$s(),R5i=u$(),P5i=gy(),Ftc=Dl(),Utc=l1(),Qtc=I5i(),FEt=BEt(),k5i;(function(t){t.None="none",t.OpenTabs="opentabs",t.CursorMostRecent="cursormostrecent",t.CursorMostCount="cursormostcount",t.WorkspaceSharingSameFolder="workspacesharingsamefolder",t.WorkspaceSmallestPathDist="workspacesmallestpathdist",t.OpenTabsAndCocommitted="opentabsandcocommitted",t.RelatedCSharp="related/csharp",t.RelatedCSharpRoslyn="related/csharproslyn",t.RelatedCpp="related/cpp",t.RelatedTypeScript="related/typescript",t.RelatedCppSemanticCodeContext="related/cppsemanticcodecontext",t.RelatedOther="related/other"})(k5i||(B$.NeighboringFileType=k5i={}));function qtc(t,e){return(0,R5i.normalizeLanguageId)(t)===(0,R5i.normalizeLanguageId)(e)}a(qtc,"considerNeighborFile");var kkr=class t{static{a(this,"NeighborSource")}static{this.MAX_NEIGHBOR_AGGREGATE_LENGTH=2e5}static{this.MAX_NEIGHBOR_FILES=20}static{this.EXCLUDED_NEIGHBORS=["node_modules","dist","site-packages"]}static defaultEmptyResult(){return{docs:new Map,neighborSource:new Map,traits:[]}}static reset(){t.instance=void 0}static async getNeighborFilesAndTraits(e,r,n,o,s,c,l){let u=e.get(P5i.ICompletionsFeaturesService),d=e.get(Ftc.ICompletionsLogTargetService),f=e.get(Btc.IInstantiationService),h=e.get(Utc.ICompletionsTextDocumentManagerService);t.instance===void 0&&(t.instance=f.createInstance(Qtc.OpenTabFiles));let m={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(u.excludeRelatedFiles(n,o))return m;let g=await h.getTextDocument({uri:r});if(!g)return FEt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: failed to get the document ${r}`),m;let A=h.getWorkspaceFolder(g);if(!A)return FEt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),m;let y=await f.invokeFunction(FEt.getRelatedFilesAndTraits,g,o,s,c,l);return y.entries.size===0?(FEt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`0 related files found for ${r}`),m.traits.push(...y.traits),m):(y.entries.forEach((E,_)=>{let v=[];E.forEach((b,T)=>{let w=t.getRelativePath(T,A.uri);if(!w||m.docs.has(T))return;let R={relativePath:w,uri:T,source:b};v.unshift(R),m.docs.set(T,R)}),v.length>0&&m.neighborSource.set(_,v.map(b=>b.uri.toString()))}),m.traits.push(...y.traits),m)}static basename(e){return decodeURIComponent(e.replace(/[#?].*$/,"").replace(/^.*[/:]/,""))}static getRelativePath(e,r){let n=r.toString().replace(/[#?].*/,"").replace(/\/?$/,"/");return e.toString().startsWith(n)?e.toString().slice(n.length):t.basename(e)}};B$.NeighborSource=kkr;function jtc(t,e,r){return t.get(P5i.ICompletionsFeaturesService).includeNeighboringFiles(e,r)}a(jtc,"isIncludeNeighborFilesActive")});var Dkr=I(UEt=>{"use strict";p();Object.defineProperty(UEt,"__esModule",{value:!0});UEt.SimilarFiles=void 0;var rye=sL(),Pkr=Q6(),Htc=$yt(),Gtc=hxr(),$tc=Wyt(),Vtc=j6(),Wtc=nye(),D5i=tye(),ztc=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(Vtc.isCompletionRequestData,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=D5i.NeighborSource.defaultEmptyResult();u.turnOffSimilarFiles||(d=await t.instantiationService.invokeFunction(async h=>await D5i.NeighborSource.getNeighborFilesAndTraits(h,u.document.uri,u.document.detectedLanguageId,u.telemetryData,u.cancellationToken,u.data)));let f=await c(u.telemetryData,u.document,u,d);s(f)});async function c(u,d,f,h){let m=t.instantiationService.invokeFunction(Wtc.getPromptOptions,u,d.detectedLanguageId);return(await l(m,u,d,f,h)).filter(A=>A.snippet.length>0).sort((A,y)=>A.score-y.score).map(A=>({...(0,Gtc.announceSnippet)(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||t.instantiationService.invokeFunction($tc.getSimilarFilesOptions,d,f.detectedLanguageId),y=t.tdms.getRelativePath(f),E={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await(0,Htc.getSimilarSnippets)(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),(0,rye.jsxs)(rye.Fragment,{children:[...o.map((u,d)=>(0,rye.jsx)(Ytc,{snippet:u}))]})},"SimilarFiles");UEt.SimilarFiles=ztc;var Ytc=a((t,e)=>(0,rye.jsxs)(Pkr.Chunk,{children:[(0,rye.jsx)(Pkr.Text,{children:t.snippet.headline}),(0,rye.jsx)(Pkr.Text,{children:t.snippet.snippet})]}),"SimilarFile")});var Q5i=I(cI=>{"use strict";p();Object.defineProperty(cI,"__esModule",{value:!0});cI.getAllRecentEditsByTimestamp=Ktc;cI.findChangeSpan=Nkr;cI.getDiff=M5i;cI.unifiedDiff=O5i;cI.findReplaceDiff=L5i;cI.editsOverlap=B5i;cI.updateEdits=F5i;cI.buildIncomingEdit=Mkr;cI.trimOldFilesFromState=U5i;cI.recentEditsReducer=Xtc;cI.summarizeEdit=erc;function Ktc(t){return Object.values(t).flatMap(e=>e.edits).sort((e,r)=>e.timestamp-r.timestamp)}a(Ktc,"getAllRecentEditsByTimestamp");function Nkr(t,e){let r=0;for(;r=r&&o>=r&&t[n]===e[o];)n--,o--;return r>n&&r>o?null:{start:r,endPrev:n,endNew:o}}a(Nkr,"findChangeSpan");function M5i(t,e,r,n,o,s,c){let l=Math.max(0,n-c),u=Math.min(r.length,s+c+1);return{file:t,pre:l,post:u,before:e.slice(l,n),removed:e.slice(n,o+1),added:r.slice(n,s+1),after:r.slice(s+1,u)}}a(M5i,"getDiff");function Jtc(t){return[...t.before,...t.removed,...t.added,...t.after].reduce((r,n)=>r+n.length+1,0)}a(Jtc,"measureDiffSize");function O5i(t,e=!1,r=!1,n=!1){let o=[];o.push(`--- a/${t.file}`),o.push(`+++ b/${t.file}`);let s=t.before.length+t.removed.length+t.after.length,c=t.before.length+t.added.length+t.after.length;o.push(`@@ -${t.pre+1},${s} +${t.pre+1},${c} @@`);for(let l of t.before)o.push(" "+l);if(r)for(let l of t.added)o.push("+"+l);if(!e){let l=n?" --- IGNORE ---":"";for(let u of t.removed)o.push("-"+u+l)}if(!r)for(let l of t.added)o.push("+"+l);for(let l of t.after)o.push(" "+l);return o.join(` `)+` -`}a(HMi,"unifiedDiff");function wXa(t,e=!1){let{before:r,removed:n,added:o,after:s}=t,c=[];return c.push(">>>>>>> SEARCH"),c.push(...r),e?c.push("..."):c.push(...n),c.push(...s),c.push("======="),c.push(...r),c.push(...o),c.push(...s),c.push("<<<<<<<<< REPLACE"),c.join(` -`)}a(wXa,"aidersDiff");function GMi(t,e=!1){let{before:r,removed:n,added:o,after:s}=t,c=e?["..."]:n.map(f=>`${f} --- DO NOT REPLY WITH CODE FROM THIS LINE ---`),l=[...r,...c,...s],u=[...r,...o,...s],d=[];return d.push("--- User edited code: ---"),d.push(...l),c.length===0?d.push(`--- and added ${o.length} line${o.length===1?"":"s"} to make: ---`):o.length===0?d.push(`--- and deleted ${c.length} line${c.length===1?"":"s"} to make: ---`):d.push("--- and replaced it with: ---"),d.push(...u),d.push("--- End of edit ---"),d.join(` -`)}a(GMi,"findReplaceDiff");function qMi(t,e){for(let r of e){let n=t.slice(0,r.startLine),o=t.slice(r.endLine+1),s=r.diff.added?r.diff.added:[];t=[...n,...s,...o]}return t}a(qMi,"applyEditsToLines");function $Mi(t,e,r){let{added:n}=e.diff,o=e.startLine,s=e.startLine+n.length,c=t.startLine,l=t.endLine+1;return c<=s+r&&l>=o-r}a($Mi,"editsOverlap");function VMi(t,e,r,n,o){let s=[...e];if(s.length>0){let c=s[s.length-1];if($Mi(r,c,o.editMergeLineDistance)){let u=qMi(t.split(` -`),s.slice(0,-1)),d=QRr(u,n);d&&(r=qRr(r.file,u,n,d,o),s=[...s.slice(0,-1),r])}else s.push(r)}else s.push(r);if(s.length>o.maxEdits){let c=s.slice(0,s.length-o.maxEdits);s=s.slice(s.length-o.maxEdits,s.length),t=qMi(t.split(` +`}a(O5i,"unifiedDiff");function Ztc(t,e=!1){let{before:r,removed:n,added:o,after:s}=t,c=[];return c.push(">>>>>>> SEARCH"),c.push(...r),e?c.push("..."):c.push(...n),c.push(...s),c.push("======="),c.push(...r),c.push(...o),c.push(...s),c.push("<<<<<<<<< REPLACE"),c.join(` +`)}a(Ztc,"aidersDiff");function L5i(t,e=!1){let{before:r,removed:n,added:o,after:s}=t,c=e?["..."]:n.map(f=>`${f} --- DO NOT REPLY WITH CODE FROM THIS LINE ---`),l=[...r,...c,...s],u=[...r,...o,...s],d=[];return d.push("--- User edited code: ---"),d.push(...l),c.length===0?d.push(`--- and added ${o.length} line${o.length===1?"":"s"} to make: ---`):o.length===0?d.push(`--- and deleted ${c.length} line${c.length===1?"":"s"} to make: ---`):d.push("--- and replaced it with: ---"),d.push(...u),d.push("--- End of edit ---"),d.join(` +`)}a(L5i,"findReplaceDiff");function N5i(t,e){for(let r of e){let n=t.slice(0,r.startLine),o=t.slice(r.endLine+1),s=r.diff.added?r.diff.added:[];t=[...n,...s,...o]}return t}a(N5i,"applyEditsToLines");function B5i(t,e,r){let{added:n}=e.diff,o=e.startLine,s=e.startLine+n.length,c=t.startLine,l=t.endLine+1;return c<=s+r&&l>=o-r}a(B5i,"editsOverlap");function F5i(t,e,r,n,o){let s=[...e];if(s.length>0){let c=s[s.length-1];if(B5i(r,c,o.editMergeLineDistance)){let u=N5i(t.split(` +`),s.slice(0,-1)),d=Nkr(u,n);d&&(r=Mkr(r.file,u,n,d,o),s=[...s.slice(0,-1),r])}else s.push(r)}else s.push(r);if(s.length>o.maxEdits){let c=s.slice(0,s.length-o.maxEdits);s=s.slice(s.length-o.maxEdits,s.length),t=N5i(t.split(` `),c).join(` -`)}return{originalContent:t,edits:s}}a(VMi,"updateEdits");function qRr(t,e,r,n,o){let{start:s,endPrev:c,endNew:l}=n;if(!o||typeof o.diffContextLines!="number")throw new Error("Invalid configuration passed to buildIncomingEdit");let u=jMi(t,e,r,s,c,l,o.diffContextLines);return{file:t,startLine:s,endLine:c,diff:u,timestamp:performance.now()}}a(qRr,"buildIncomingEdit");function WMi(t,e){let r={...t},n=Object.entries(t).filter(([s])=>t[s].edits.length).sort(([s,c],[l,u])=>c.edits[c.edits.length-1].timestamp-u.edits[u.edits.length-1].timestamp),o=Math.max(0,n.length-e);if(o)for(let s=0;s2*1024*1024)return t;let o=t[e];if(!o)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};if(o.currentContent===r)return t;let s=o.currentContent.split(` +`)}return{originalContent:t,edits:s}}a(F5i,"updateEdits");function Mkr(t,e,r,n,o){let{start:s,endPrev:c,endNew:l}=n;if(!o||typeof o.diffContextLines!="number")throw new Error("Invalid configuration passed to buildIncomingEdit");let u=M5i(t,e,r,s,c,l,o.diffContextLines);return{file:t,startLine:s,endLine:c,diff:u,timestamp:performance.now()}}a(Mkr,"buildIncomingEdit");function U5i(t,e){let r={...t},n=Object.entries(t).filter(([s])=>t[s].edits.length).sort(([s,c],[l,u])=>c.edits[c.edits.length-1].timestamp-u.edits[u.edits.length-1].timestamp),o=Math.max(0,n.length-e);if(o)for(let s=0;s2*1024*1024)return t;let o=t[e];if(!o)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};if(o.currentContent===r)return t;let s=o.currentContent.split(` `),c=r.split(` -`),l=QRr(s,c);if(!l)return{...t,[e]:{...o,currentContent:r}};let u=qRr(e,s,c,l,n);if(xXa(u.diff)>n.maxCharsPerEdit)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};let{originalContent:d,edits:f}=VMi(o.originalContent,o.edits,u,c,n),h={...t,[e]:{originalContent:d,currentContent:r,edits:f}};return WMi(h,n.maxFiles)}a(RXa,"recentEditsReducer");function kXa(t,e){let r=t.diff.removed.filter(s=>s.trim().length>0),n=t.diff.added.filter(s=>s.trim().length>0),o;if(e.removeDeletedLines&&n.length===0)o=null;else if(r.length===0&&n.length===0)o=null;else if(r.join("").trim()===n.join("").trim())o=null;else if(t.diff.added.length>e.maxLinesPerEdit||t.diff.removed.length>e.maxLinesPerEdit)o=null;else if(e.summarizationFormat==="aiders-diff")o=wXa(t.diff);else if(e.summarizationFormat==="diff")o=HMi(t.diff,e.removeDeletedLines,e.insertionsBeforeDeletions,e.appendNoReplyMarker);else if(e.summarizationFormat==="find-replace")o=GMi(t.diff);else throw new Error(`Unknown summarization format: ${e.summarizationFormat}`);return o}a(kXa,"summarizeEdit")});var hEt=I(UD=>{"use strict";p();var PXa=UD&&UD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},DXa=UD&&UD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(UD,"__esModule",{value:!0});UD.FullRecentEditsProvider=UD.ICompletionsRecentEditsProviderService=void 0;var NXa=h4(),MXa=nn(),OXa=Ro(),LXa=C8(),BXa=USr(),jRr=zMi();UD.ICompletionsRecentEditsProviderService=(0,MXa.createServiceIdentifier)("ICompletionsRecentEditsProviderService");var FXa=Object.freeze({maxFiles:20,maxEdits:8,diffContextLines:3,editMergeLineDistance:1,maxCharsPerEdit:2e3,debounceTimeout:500,summarizationFormat:"diff",removeDeletedLines:!1,insertionsBeforeDeletions:!0,appendNoReplyMarker:!0,activeDocDistanceLimitFromCursor:100,maxLinesPerEdit:10}),HRr=class extends OXa.Disposable{static{a(this,"FullRecentEditsProvider")}constructor(e,r){super(),this.observableWorkspace=r,this._started=!1,this.recentEditMap={},this.recentEdits=[],this.recentEditSummaries=new WeakMap,this.debounceTimeouts={},this._config=e??Object.assign({},FXa)}get config(){return this._config}isEnabled(){return!0}getRecentEdits(){return this.recentEdits}getEditSummary(e){return this.recentEditSummaries.get(e)??null}updateRecentEdits(e,r){this.recentEditMap=(0,jRr.recentEditsReducer)(this.recentEditMap,e,r,this._config),this.recentEdits=(0,jRr.getAllRecentEditsByTimestamp)(this.recentEditMap),this.recentEdits.forEach(n=>{if(!this.recentEditSummaries.has(n)){let o=(0,jRr.summarizeEdit)(n,this._config);this.recentEditSummaries.set(n,o)}})}start(){this._started||(this._started=!0,(0,LXa.mapObservableArrayCached)(this,this.observableWorkspace.openDocuments,(e,r)=>{r.add((0,NXa.autorunWithChanges)(this,{value:e.value,selection:e.selection,languageId:e.languageId},n=>{if(n.value.changes.length>0){let o=n.value.previous?.value,s=n.value.value.value,c=e.id.toString();clearTimeout(this.debounceTimeouts[c]),!this.recentEditMap[c]&&o?this.updateRecentEdits(c,o):this._config.debounceTimeout===0?this.updateRecentEdits(c,s):this.debounceTimeouts[c]=setTimeout(()=>{this.updateRecentEdits(c,s)},this._config.debounceTimeout??500)}}))},e=>e.id).recomputeInitiallyAndOnChange(this._store))}};UD.FullRecentEditsProvider=HRr;UD.FullRecentEditsProvider=HRr=PXa([DXa(1,BXa.ICompletionsObservableWorkspace)],HRr)});var GRr=I(gEt=>{"use strict";p();Object.defineProperty(gEt,"__esModule",{value:!0});gEt.Traits=void 0;var mEt=rL(),YMi=w6(),UXa=JG(),QXa=k6(),qXa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(QXa.isCompletionRequestData,c=>{c.traits!==r&&n(c.traits);let l=(0,UXa.normalizeLanguageId)(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return(0,mEt.jsxs)(mEt.Fragment,{children:[(0,mEt.jsx)(YMi.Text,{children:`Consider this related information: -`}),...r.map(c=>(0,mEt.jsx)(YMi.Text,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");gEt.Traits=qXa});var ZMi=I($Rr=>{"use strict";p();Object.defineProperty($Rr,"__esModule",{value:!0});$Rr.splitContextCompletionsPrompt=JXa;var UR=rL(),jXa=Gs(),HXa=s1(),GXa=hEt(),$Xa=Jwr(),KMi=H4e(),JMi=$4e(),VXa=xRr(),WXa=wRr(),zXa=RRr(),YXa=URr(),KXa=GRr();function JXa(t){let e=t.get(jXa.IInstantiationService),r=t.get(HXa.ICompletionsTextDocumentManagerService),n=t.get(GXa.ICompletionsRecentEditsProviderService);return(0,UR.jsxs)(UR.Fragment,{children:[(0,UR.jsxs)(KMi.StableCompletionsContext,{children:[(0,UR.jsx)(WXa.DocumentMarker,{tdms:r,weight:.7}),(0,UR.jsx)(KXa.Traits,{weight:.6}),(0,UR.jsx)(VXa.Diagnostics,{tdms:r,weight:.65}),(0,UR.jsx)($Xa.CodeSnippets,{tdms:r,weight:.9}),(0,UR.jsx)(YXa.SimilarFiles,{tdms:r,instantiationService:e,weight:.8})]}),(0,UR.jsx)(JMi.DocumentSuffix,{weight:1}),(0,UR.jsx)(KMi.AdditionalCompletionsContext,{children:(0,UR.jsx)(zXa.RecentEdits,{tdms:r,recentEditsProvider:n,weight:.99})}),(0,UR.jsx)(JMi.DocumentPrefix,{weight:1})]})}a(JXa,"splitContextCompletionsPrompt")});var rOi=I(yEt=>{"use strict";p();Object.defineProperty(yEt,"__esModule",{value:!0});yEt.SplitContextPromptRenderer=void 0;var ZXa=Xwr(),XXa=H4e(),AEt=lRr(),XMi=$4e(),eOi=sRr(),tOi=0;function eec(){tOi=0}a(eec,"resetContextIndex");function tec(){return tOi++}a(tec,"getNextContextIndex");var VRr=class extends AEt.CompletionsPromptRenderer{static{a(this,"SplitContextPromptRenderer")}constructor(){super(...arguments),this.formatPrefix=eOi.makePrefixPrompt,this.formatContext=eOi.makeContextPrompt}processSnapshot(e,r){let n=[],o=[],s=[],c=!1;if(eec(),new ZXa.SnapshotWalker(e,rec).walkSnapshot((d,f,h)=>{if(d===e||(d.statistics.updateDataTimeMs&&d.statistics.updateDataTimeMs>0&&s.push({componentPath:d.path,updateDataTimeMs:d.statistics.updateDataTimeMs}),d.name===XMi.BeforeCursor.name&&(c=!0),d.value===void 0||d.value===""))return!0;let m=h.chunks,g=h.type;if(g==="suffix")o.push({value:(0,AEt.normalizeLineEndings)(d.value),type:"suffix",weight:h.weight,componentPath:d.path,nodeStatistics:d.statistics,chunks:m,source:h.source});else{let A=g==="prefix",y=A||d.value.endsWith(r)?d.value:d.value+r;n.push({type:A?"prefix":"context",value:(0,AEt.normalizeLineEndings)(y),weight:h.weight,componentPath:d.path,nodeStatistics:d.statistics,chunks:m,source:h.source,index:A?void 0:h.index})}return!0}),!c)throw new Error(`Node of type ${XMi.BeforeCursor.name} not found`);if(o.length>1)throw new Error("Only one suffix is allowed");let u=o.length===1?o[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:n,suffixBlock:u,componentStatistics:s}}};yEt.SplitContextPromptRenderer=VRr;var rec=[...AEt.transformers,(t,e,r)=>(0,XXa.isContextNode)(t)?{...r,index:tec()}:r]});var T$=I(N6=>{"use strict";p();Object.defineProperty(N6,"__esModule",{value:!0});N6.AbstractLanguageDiagnosticsService=N6.ILanguageDiagnosticsService=void 0;N6.rangeSpanningDiagnostics=oec;N6.isError=sec;N6.getDiagnosticsAtSelection=aec;var nec=nn(),iec=ZP(),WRr=P0();N6.ILanguageDiagnosticsService=(0,nec.createServiceIdentifier)("ILanguageDiagnosticService");var zRr=class{static{a(this,"AbstractLanguageDiagnosticsService")}waitForNewDiagnostics(e,r,n=5e3){let o,s,c;return new Promise(l=>{o=r.onCancellationRequested(()=>l([])),c=setTimeout(()=>l(this.getDiagnostics(e)),n),s=this.onDidChangeDiagnostics(u=>{for(let d of u.uris)if((0,iec.isEqual)(d,e)){l(this.getDiagnostics(e));break}})}).finally(()=>{o.dispose(),s.dispose(),clearTimeout(c)})}};N6.AbstractLanguageDiagnosticsService=zRr;function oec(t){return t.map(e=>e.range).reduce((e,r)=>e.union(r))}a(oec,"rangeSpanningDiagnostics");function sec(t){return t.severity===WRr.DiagnosticSeverity.Error}a(sec,"isError");function aec(t,e,r=[WRr.DiagnosticSeverity.Error,WRr.DiagnosticSeverity.Warning]){return t.find(n=>n.range.contains(e)&&r.includes(n.severity))}a(aec,"getDiagnosticsAtSelection")});var iOi=I(YRr=>{"use strict";p();Object.defineProperty(YRr,"__esModule",{value:!0});YRr.getDiagnosticsFromContextItems=dec;var cec=s1(),nOi=v$(),lec=j4e(),uec="content_excluded";async function dec(t,e,r){let n=(0,lec.filterContextItemsByType)(r,"DiagnosticBag");for(let h of n)fec(t,e,h.data,h.providerId);let o=new Set,s=[];for(let h of n)for(let m of h.data)o.add(m.uri.toString()),s.push({providerId:h.providerId,bag:m});if(s.length===0)return[];let c=t.get(nOi.ICompletionsContextProviderService),l=t.get(cec.ICompletionsTextDocumentManagerService),u=new Map;await Promise.all(Array.from(o).map(async h=>{u.set(h,await l.getTextDocumentValidation({uri:h}))}));let d=c.getStatisticsForCompletion(e);return s.filter(h=>{let m=u.get(h.bag.uri.toString())?.status==="valid";return m?d.addExpectations(h.providerId,[[h.bag,"included"]]):d.addExpectations(h.providerId,[[h.bag,uec]]),m}).map(h=>h.bag).sort((h,m)=>(h.importance??0)-(m.importance??0))}a(dec,"getDiagnosticsFromContextItems");function fec(t,e,r,n){let o=t.get(nOi.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(fec,"setupExpectationsForDiagnosticBags")});var oOi=I(EEt=>{"use strict";p();Object.defineProperty(EEt,"__esModule",{value:!0});EEt.getTraitsFromContextItems=gec;EEt.ReportTraitsTelemetry=Eec;var pec=$g(),hec=v$(),mec=j4e();function gec(t,e,r){let n=(0,mec.filterContextItemsByType)(r,"Trait");for(let s of n)Aec(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(gec,"getTraitsFromContextItems");function Aec(t,e,r,n){let o=t.get(hec.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(Aec,"setupExpectationsForTraits");var yec=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function Eec(t,e,r,n,o,s){if(r.length>0){let c={};c.detectedLanguageId=n,c.languageId=o;for(let u of r){let d=yec.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return(0,pec.telemetry)(t,e,l)}}a(Eec,"ReportTraitsTelemetry")});var k6=I(d1=>{"use strict";p();var lOi=d1&&d1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},u1=d1&&d1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(d1,"__esModule",{value:!0});d1.TestComponentsCompletionsPromptFactory=d1.ComponentsCompletionsPromptFactory=d1.PromptOrdering=void 0;d1.isCompletionRequestData=Fec;var aL=rL(),sOi=P0(),ekr=Dl(),uOi=Bre(),KRr=nd(),tkr=Gs(),dOi=bte(),aOi=XNi(),_ec=$g(),vec=s1(),Cec=Jwr(),bec=H4e(),Sec=lRr(),fOi=tEt(),Tec=$4e(),Iec=xRr(),xec=wRr(),wec=RRr(),Rec=URr(),kec=ZMi(),Pec=rOi(),Dec=GRr(),pOi=T$(),Nec=T0(),Y4e=eEt(),Mec=Kwr(),Oec=iOi(),cOi=oOi(),rkr=v$(),QD=qAe(),Lec=hEt(),Bec=UAe();function Fec(t){if(!t||typeof t!="object")return!1;let e=t;return!(!e.document||!e.position||e.position.line===void 0||e.position.character===void 0||!e.telemetryData)}a(Fec,"isCompletionRequestData");var I$;(function(t){t.Default="default",t.SplitContext="splitContext"})(I$||(d1.PromptOrdering=I$={}));var JRr={[I$.Default]:{promptFunction:hOi,renderer:Sec.CompletionsPromptRenderer},[I$.SplitContext]:{promptFunction:kec.splitContextCompletionsPrompt,renderer:Pec.SplitContextPromptRenderer}};function hOi(t){let e=t.get(vec.ICompletionsTextDocumentManagerService),r=t.get(tkr.IInstantiationService),n=t.get(Lec.ICompletionsRecentEditsProviderService);return(0,aL.jsxs)(aL.Fragment,{children:[(0,aL.jsxs)(bec.CompletionsContext,{children:[(0,aL.jsx)(xec.DocumentMarker,{tdms:e,weight:.7}),(0,aL.jsx)(Dec.Traits,{weight:.6}),(0,aL.jsx)(Iec.Diagnostics,{tdms:e,weight:.65}),(0,aL.jsx)(Cec.CodeSnippets,{tdms:e,weight:.9}),(0,aL.jsx)(Rec.SimilarFiles,{tdms:e,instantiationService:r,weight:.8}),(0,aL.jsx)(wec.RecentEdits,{tdms:e,recentEditsProvider:n,weight:.99})]}),(0,aL.jsx)(Tec.CurrentFile,{weight:1})]})}a(hOi,"defaultCompletionsPrompt");var _Et=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l,u,d){this.instantiationService=n,this.completionsTelemetryService=o,this.ignoreService=s,this.contextProviderBridge=c,this.logTarget=l,this.contextProviderStatistics=u,this.languageDiagnosticsService=d,this.promptOrdering=r??I$.Default,this.virtualPrompt=e??new aOi.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe(),this.renderer=this.getRenderer()}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}async createPromptUnsafe({completionId:e,completionState:r,telemetryData:n,promptOpts:o},s){let{maxPromptLength:c,suffixPercent:l,suffixMatchThreshold:u}=this.instantiationService.invokeFunction(QD.getPromptOptions,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?I$.SplitContext:I$.Default;this.setPromptOrdering(f);let h=performance.now(),{traits:m,codeSnippets:g,diagnostics:A,turnOffSimilarFiles:y,resolvedContextItems:E}=await this.resolveContext(e,r,n,s,o);if(await this.updateComponentData(r.textDocument,r.position,m,g,A,n,y,c,s,o,u,o?.tokenizer),s?.isCancellationRequested)return QD._promptCancelled;let _=this.virtualPrompt.snapshot(s),v=_.status;if(v==="cancelled")return QD._promptCancelled;if(v==="error")return this.errorPrompt(_.error);let b=this.renderer.render(_.snapshot,{delimiter:` -`,tokenizer:o?.tokenizer,promptTokenLimit:c,suffixPercent:l,languageId:r.textDocument.detectedLanguageId},s);if(b.status==="cancelled")return QD._promptCancelled;if(b.status==="error")return this.errorPrompt(b.error);let[T,w]=(0,QD.trimLastLine)(b.prefix),R={...b,prefix:T},x,P=r.textDocument.detectedLanguageId;if(this.instantiationService.invokeFunction(Y4e.useContextProviderAPI,P,n)){let N=(0,rkr.componentStatisticsToPromptMatcher)(b.metadata.componentStatistics);this.contextProviderStatistics.getStatisticsForCompletion(e).computeMatch(N),x=(0,Y4e.telemetrizeContextItems)(this.contextProviderStatistics,e,E),ekr.logger.debug(this.logTarget,`Context providers telemetry: '${JSON.stringify(x)}'`)}let D=performance.now();return this.resetIfEmpty(b),this.successPrompt(R,D,h,w,x)}async updateComponentData(e,r,n,o,s,c,l,u,d,f={},h,m){let g=this.createRequestData(e,r,c,d,f,u,n,o,s,l,h,m);await this.pipe.pump(g)}async resolveContext(e,r,n,o,s={}){let c=[],l,u,d,f=!1;if(this.instantiationService.invokeFunction(Y4e.useContextProviderAPI,r.textDocument.detectedLanguageId,n)){c=await this.contextProviderBridge.resolution(e);let{textDocument:m}=r,g=c.filter(Y4e.matchContextItems);this.instantiationService.invokeFunction(Uec,m.detectedLanguageId,g,n)||(f=!0),l=await this.instantiationService.invokeFunction(cOi.getTraitsFromContextItems,e,g),this.instantiationService.invokeFunction(cOi.ReportTraitsTelemetry,"contextProvider.traits",l,m.detectedLanguageId,m.detectedLanguageId,n),u=await this.instantiationService.invokeFunction(Mec.getCodeSnippetsFromContextItems,e,g,m.detectedLanguageId),d=await this.instantiationService.invokeFunction(Oec.getDiagnosticsFromContextItems,e,g)}let h=this.instantiationService.invokeFunction(Y4e.getDefaultDiagnosticSettings);return d=this.addDefaultDiagnosticBag(c,d,e,r,h),{traits:l,codeSnippets:u,diagnostics:d,turnOffSimilarFiles:f,resolvedContextItems:c}}async failFastPrompt(e,r,n,o){if(o?.isCancellationRequested)return QD._promptCancelled;if(await this.ignoreService.isCopilotIgnored(KRr.URI.parse(e.uri)))return QD._copilotContentExclusion;if((n>0?e.getText().length:e.offsetAt(r))0},computeTimeMs:r-n,trailingWs:o,neighborSource:new Map,metadata:e.metadata,contextProvidersTelemetry:s}}errorPrompt(e){return(0,_ec.telemetryException)(this.completionsTelemetryService,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),QD._promptError}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new aOi.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){let e=JRr[this.promptOrdering]?.promptFunction??hOi;return this.instantiationService.invokeFunction(e)}getRenderer(){let e=JRr[this.promptOrdering]??JRr[I$.Default];return new e.renderer}addDefaultDiagnosticBag(e,r,n,o,s){if(s===void 0)return r;let c=o.textDocument;if(r!==void 0&&r.some(_=>_.uri.toString()===c.uri))return r;let l=performance.now(),u=this.languageDiagnosticsService.getDiagnostics(KRr.URI.parse(c.uri));if(u.length===0)return r;let d=[],f=[],h=s.warnings==="yes"||s.warnings==="yesIfNoErrors",m=o.position;for(let _ of u)Math.abs(_.range.start.line-m.line)<=s.maxLineDistance&&(_.severity===sOi.DiagnosticSeverity.Error?d.push(_):_.severity===sOi.DiagnosticSeverity.Warning&&h&&f.push(_));let g=[...d,...s.warnings==="yes"||s.warnings==="yesIfNoErrors"&&d.length===0?f:[]];if(g.length===0)return r;g.sort((_,v)=>{let b=Math.abs(_.range.start.line-m.line),T=Math.abs(v.range.start.line-m.line);return b-T});let A={type:"DiagnosticBag",uri:KRr.URI.parse(c.uri),values:g.slice(0,s.maxDiagnostics),id:(0,Nec.generateUuid)()},y="copilot.chat.defaultDiagnostics",E=this.contextProviderStatistics.getStatisticsForCompletion(n);return E.addExpectations(y,[[A,"included"]]),e.push({providerId:y,matchScore:10,resolution:"full",resolutionTimeMs:performance.now()-l,data:[A]}),E.setLastResolution(y,"full"),r===void 0?[A]:(r.push(A),r)}};_Et=lOi([u1(2,tkr.IInstantiationService),u1(3,dOi.ICompletionsTelemetryService),u1(4,uOi.IIgnoreService),u1(5,fOi.ICompletionsContextProviderBridgeService),u1(6,ekr.ICompletionsLogTargetService),u1(7,rkr.ICompletionsContextProviderService),u1(8,pOi.ILanguageDiagnosticsService)],_Et);var ZRr=class extends _Et{static{a(this,"ComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l){super(void 0,void 0,e,r,n,o,s,c,l)}};d1.ComponentsCompletionsPromptFactory=ZRr;d1.ComponentsCompletionsPromptFactory=ZRr=lOi([u1(0,tkr.IInstantiationService),u1(1,dOi.ICompletionsTelemetryService),u1(2,uOi.IIgnoreService),u1(3,fOi.ICompletionsContextProviderBridgeService),u1(4,ekr.ICompletionsLogTargetService),u1(5,rkr.ICompletionsContextProviderService),u1(6,pOi.ILanguageDiagnosticsService)],ZRr);var XRr=class extends _Et{static{a(this,"TestComponentsCompletionsPromptFactory")}};d1.TestComponentsCompletionsPromptFactory=XRr;function Uec(t,e,r,n){let o=["cpp","c"];return(0,Bec.isIncludeNeighborFilesActive)(t,e,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(Uec,"similarFilesEnabled")});var ckr=I(HE=>{"use strict";p();var mOi=HE&&HE.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},gOi=HE&&HE.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(HE,"__esModule",{value:!0});HE.TestCompletionsPromptFactory=HE.CompletionsPromptFactory=HE.DEFAULT_PROMPT_TIMEOUT=HE.ICompletionsPromptFactoryService=void 0;var Qec=ri(),AOi=Gs(),nkr=qAe(),qec=k6(),jec=nn();HE.ICompletionsPromptFactoryService=(0,jec.createServiceIdentifier)("ICompletionsPromptFactoryService");var ikr=class{static{a(this,"SequentialCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){return this.lastPromise=this.promptAsync(e,r),this.lastPromise}async promptAsync(e,r){if(await this.lastPromise,r?.isCancellationRequested)return nkr._promptCancelled;try{return await this.delegate.prompt(e,r)}catch{return nkr._promptError}}};HE.DEFAULT_PROMPT_TIMEOUT=1200;var okr=class{static{a(this,"TimeoutHandlingCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){let n=new Qec.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(nkr._promptTimeout)},HE.DEFAULT_PROMPT_TIMEOUT)})])}},vEt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n){this.delegate=new ikr(new okr(n.createInstance(qec.TestComponentsCompletionsPromptFactory,e,r)))}prompt(e,r){return this.delegate.prompt(e,r)}};vEt=mOi([gOi(2,AOi.IInstantiationService)],vEt);var skr=class extends vEt{static{a(this,"CompletionsPromptFactory")}constructor(e){super(void 0,void 0,e)}};HE.CompletionsPromptFactory=skr;HE.CompletionsPromptFactory=skr=mOi([gOi(0,AOi.IInstantiationService)],skr);var akr=class extends vEt{static{a(this,"TestCompletionsPromptFactory")}};HE.TestCompletionsPromptFactory=akr});var qAe=I(gh=>{"use strict";p();Object.defineProperty(gh,"__esModule",{value:!0});gh.PromptResponse=gh._promptTimeout=gh._promptCancelled=gh._promptError=gh._copilotContentExclusion=gh._contextTooShort=gh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=gh.MIN_PROMPT_CHARS=void 0;gh.trimLastLine=Yec;gh.extractPrompt=Kec;gh.getPromptOptions=Xec;var Hec=k4e(),Gec=fy(),yOi=vyt(),$ec=M4e(),Vec=s1(),Wec=ckr(),zec=UAe();gh.MIN_PROMPT_CHARS=10;gh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=["scminput"];gh._contextTooShort={type:"contextTooShort"};gh._copilotContentExclusion={type:"copilotContentExclusion"};gh._promptError={type:"promptError"};gh._promptCancelled={type:"promptCancelled"};gh._promptTimeout={type:"promptTimeout"};var EOi;(function(t){function e(r){return r.type==="prompt"?[{header:"PREFIX",content:r.prompt.prefix},{header:"SUFFIX",content:r.prompt.suffix},{header:"CONTEXT",content:(r.prompt.context||[]).join(` +`),l=Nkr(s,c);if(!l)return{...t,[e]:{...o,currentContent:r}};let u=Mkr(e,s,c,l,n);if(Jtc(u.diff)>n.maxCharsPerEdit)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};let{originalContent:d,edits:f}=F5i(o.originalContent,o.edits,u,c,n),h={...t,[e]:{originalContent:d,currentContent:r,edits:f}};return U5i(h,n.maxFiles)}a(Xtc,"recentEditsReducer");function erc(t,e){let r=t.diff.removed.filter(s=>s.trim().length>0),n=t.diff.added.filter(s=>s.trim().length>0),o;if(e.removeDeletedLines&&n.length===0)o=null;else if(r.length===0&&n.length===0)o=null;else if(r.join("").trim()===n.join("").trim())o=null;else if(t.diff.added.length>e.maxLinesPerEdit||t.diff.removed.length>e.maxLinesPerEdit)o=null;else if(e.summarizationFormat==="aiders-diff")o=Ztc(t.diff);else if(e.summarizationFormat==="diff")o=O5i(t.diff,e.removeDeletedLines,e.insertionsBeforeDeletions,e.appendNoReplyMarker);else if(e.summarizationFormat==="find-replace")o=L5i(t.diff);else throw new Error(`Unknown summarization format: ${e.summarizationFormat}`);return o}a(erc,"summarizeEdit")});var QEt=I(WD=>{"use strict";p();var trc=WD&&WD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},rrc=WD&&WD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(WD,"__esModule",{value:!0});WD.FullRecentEditsProvider=WD.ICompletionsRecentEditsProviderService=void 0;var nrc=g4(),irc=nn(),orc=Ro(),src=D8(),arc=DTr(),Okr=Q5i();WD.ICompletionsRecentEditsProviderService=(0,irc.createServiceIdentifier)("ICompletionsRecentEditsProviderService");var crc=Object.freeze({maxFiles:20,maxEdits:8,diffContextLines:3,editMergeLineDistance:1,maxCharsPerEdit:2e3,debounceTimeout:500,summarizationFormat:"diff",removeDeletedLines:!1,insertionsBeforeDeletions:!0,appendNoReplyMarker:!0,activeDocDistanceLimitFromCursor:100,maxLinesPerEdit:10}),Lkr=class extends orc.Disposable{static{a(this,"FullRecentEditsProvider")}constructor(e,r){super(),this.observableWorkspace=r,this._started=!1,this.recentEditMap={},this.recentEdits=[],this.recentEditSummaries=new WeakMap,this.debounceTimeouts={},this._config=e??Object.assign({},crc)}get config(){return this._config}isEnabled(){return!0}getRecentEdits(){return this.recentEdits}getEditSummary(e){return this.recentEditSummaries.get(e)??null}updateRecentEdits(e,r){this.recentEditMap=(0,Okr.recentEditsReducer)(this.recentEditMap,e,r,this._config),this.recentEdits=(0,Okr.getAllRecentEditsByTimestamp)(this.recentEditMap),this.recentEdits.forEach(n=>{if(!this.recentEditSummaries.has(n)){let o=(0,Okr.summarizeEdit)(n,this._config);this.recentEditSummaries.set(n,o)}})}start(){this._started||(this._started=!0,(0,src.mapObservableArrayCached)(this,this.observableWorkspace.openDocuments,(e,r)=>{r.add((0,nrc.autorunWithChanges)(this,{value:e.value,selection:e.selection,languageId:e.languageId},n=>{if(n.value.changes.length>0){let o=n.value.previous?.value,s=n.value.value.value,c=e.id.toString();clearTimeout(this.debounceTimeouts[c]),!this.recentEditMap[c]&&o?this.updateRecentEdits(c,o):this._config.debounceTimeout===0?this.updateRecentEdits(c,s):this.debounceTimeouts[c]=setTimeout(()=>{this.updateRecentEdits(c,s)},this._config.debounceTimeout??500)}}))},e=>e.id).recomputeInitiallyAndOnChange(this._store))}};WD.FullRecentEditsProvider=Lkr;WD.FullRecentEditsProvider=Lkr=trc([rrc(1,arc.ICompletionsObservableWorkspace)],Lkr)});var Bkr=I(jEt=>{"use strict";p();Object.defineProperty(jEt,"__esModule",{value:!0});jEt.Traits=void 0;var qEt=sL(),q5i=Q6(),lrc=u$(),urc=j6(),drc=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(urc.isCompletionRequestData,c=>{c.traits!==r&&n(c.traits);let l=(0,lrc.normalizeLanguageId)(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return(0,qEt.jsxs)(qEt.Fragment,{children:[(0,qEt.jsx)(q5i.Text,{children:`Consider this related information: +`}),...r.map(c=>(0,qEt.jsx)(q5i.Text,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");jEt.Traits=drc});var G5i=I(Fkr=>{"use strict";p();Object.defineProperty(Fkr,"__esModule",{value:!0});Fkr.splitContextCompletionsPrompt=vrc;var zR=sL(),frc=$s(),prc=l1(),hrc=QEt(),mrc=GRr(),j5i=fLe(),H5i=hLe(),grc=_kr(),Arc=vkr(),yrc=Ckr(),Erc=Dkr(),_rc=Bkr();function vrc(t){let e=t.get(frc.IInstantiationService),r=t.get(prc.ICompletionsTextDocumentManagerService),n=t.get(hrc.ICompletionsRecentEditsProviderService);return(0,zR.jsxs)(zR.Fragment,{children:[(0,zR.jsxs)(j5i.StableCompletionsContext,{children:[(0,zR.jsx)(Arc.DocumentMarker,{tdms:r,weight:.7}),(0,zR.jsx)(_rc.Traits,{weight:.6}),(0,zR.jsx)(grc.Diagnostics,{tdms:r,weight:.65}),(0,zR.jsx)(mrc.CodeSnippets,{tdms:r,weight:.9}),(0,zR.jsx)(Erc.SimilarFiles,{tdms:r,instantiationService:e,weight:.8})]}),(0,zR.jsx)(H5i.DocumentSuffix,{weight:1}),(0,zR.jsx)(j5i.AdditionalCompletionsContext,{children:(0,zR.jsx)(yrc.RecentEdits,{tdms:r,recentEditsProvider:n,weight:.99})}),(0,zR.jsx)(H5i.DocumentPrefix,{weight:1})]})}a(vrc,"splitContextCompletionsPrompt")});var z5i=I(GEt=>{"use strict";p();Object.defineProperty(GEt,"__esModule",{value:!0});GEt.SplitContextPromptRenderer=void 0;var Crc=VRr(),brc=fLe(),HEt=rkr(),$5i=hLe(),V5i=XRr(),W5i=0;function Src(){W5i=0}a(Src,"resetContextIndex");function Trc(){return W5i++}a(Trc,"getNextContextIndex");var Ukr=class extends HEt.CompletionsPromptRenderer{static{a(this,"SplitContextPromptRenderer")}constructor(){super(...arguments),this.formatPrefix=V5i.makePrefixPrompt,this.formatContext=V5i.makeContextPrompt}processSnapshot(e,r){let n=[],o=[],s=[],c=!1;if(Src(),new Crc.SnapshotWalker(e,Irc).walkSnapshot((d,f,h)=>{if(d===e||(d.statistics.updateDataTimeMs&&d.statistics.updateDataTimeMs>0&&s.push({componentPath:d.path,updateDataTimeMs:d.statistics.updateDataTimeMs}),d.name===$5i.BeforeCursor.name&&(c=!0),d.value===void 0||d.value===""))return!0;let m=h.chunks,g=h.type;if(g==="suffix")o.push({value:(0,HEt.normalizeLineEndings)(d.value),type:"suffix",weight:h.weight,componentPath:d.path,nodeStatistics:d.statistics,chunks:m,source:h.source});else{let A=g==="prefix",y=A||d.value.endsWith(r)?d.value:d.value+r;n.push({type:A?"prefix":"context",value:(0,HEt.normalizeLineEndings)(y),weight:h.weight,componentPath:d.path,nodeStatistics:d.statistics,chunks:m,source:h.source,index:A?void 0:h.index})}return!0}),!c)throw new Error(`Node of type ${$5i.BeforeCursor.name} not found`);if(o.length>1)throw new Error("Only one suffix is allowed");let u=o.length===1?o[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:n,suffixBlock:u,componentStatistics:s}}};GEt.SplitContextPromptRenderer=Ukr;var Irc=[...HEt.transformers,(t,e,r)=>(0,brc.isContextNode)(t)?{...r,index:Trc()}:r]});var F$=I($6=>{"use strict";p();Object.defineProperty($6,"__esModule",{value:!0});$6.AbstractLanguageDiagnosticsService=$6.ILanguageDiagnosticsService=void 0;$6.rangeSpanningDiagnostics=Rrc;$6.isError=krc;$6.getDiagnosticsAtSelection=Prc;var xrc=nn(),wrc=s2(),Qkr=N0();$6.ILanguageDiagnosticsService=(0,xrc.createServiceIdentifier)("ILanguageDiagnosticService");var qkr=class{static{a(this,"AbstractLanguageDiagnosticsService")}waitForNewDiagnostics(e,r,n=5e3){let o,s,c;return new Promise(l=>{o=r.onCancellationRequested(()=>l([])),c=setTimeout(()=>l(this.getDiagnostics(e)),n),s=this.onDidChangeDiagnostics(u=>{for(let d of u.uris)if((0,wrc.isEqual)(d,e)){l(this.getDiagnostics(e));break}})}).finally(()=>{o.dispose(),s.dispose(),clearTimeout(c)})}};$6.AbstractLanguageDiagnosticsService=qkr;function Rrc(t){return t.map(e=>e.range).reduce((e,r)=>e.union(r))}a(Rrc,"rangeSpanningDiagnostics");function krc(t){return t.severity===Qkr.DiagnosticSeverity.Error}a(krc,"isError");function Prc(t,e,r=[Qkr.DiagnosticSeverity.Error,Qkr.DiagnosticSeverity.Warning]){return t.find(n=>n.range.contains(e)&&r.includes(n.severity))}a(Prc,"getDiagnosticsAtSelection")});var K5i=I(jkr=>{"use strict";p();Object.defineProperty(jkr,"__esModule",{value:!0});jkr.getDiagnosticsFromContextItems=Orc;var Drc=l1(),Y5i=M$(),Nrc=dLe(),Mrc="content_excluded";async function Orc(t,e,r){let n=(0,Nrc.filterContextItemsByType)(r,"DiagnosticBag");for(let h of n)Lrc(t,e,h.data,h.providerId);let o=new Set,s=[];for(let h of n)for(let m of h.data)o.add(m.uri.toString()),s.push({providerId:h.providerId,bag:m});if(s.length===0)return[];let c=t.get(Y5i.ICompletionsContextProviderService),l=t.get(Drc.ICompletionsTextDocumentManagerService),u=new Map;await Promise.all(Array.from(o).map(async h=>{u.set(h,await l.getTextDocumentValidation({uri:h}))}));let d=c.getStatisticsForCompletion(e);return s.filter(h=>{let m=u.get(h.bag.uri.toString())?.status==="valid";return m?d.addExpectations(h.providerId,[[h.bag,"included"]]):d.addExpectations(h.providerId,[[h.bag,Mrc]]),m}).map(h=>h.bag).sort((h,m)=>(h.importance??0)-(m.importance??0))}a(Orc,"getDiagnosticsFromContextItems");function Lrc(t,e,r,n){let o=t.get(Y5i.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(Lrc,"setupExpectationsForDiagnosticBags")});var J5i=I($Et=>{"use strict";p();Object.defineProperty($Et,"__esModule",{value:!0});$Et.getTraitsFromContextItems=Qrc;$Et.ReportTraitsTelemetry=Hrc;var Brc=Yg(),Frc=M$(),Urc=dLe();function Qrc(t,e,r){let n=(0,Urc.filterContextItemsByType)(r,"Trait");for(let s of n)qrc(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(Qrc,"getTraitsFromContextItems");function qrc(t,e,r,n){let o=t.get(Frc.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(qrc,"setupExpectationsForTraits");var jrc=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function Hrc(t,e,r,n,o,s){if(r.length>0){let c={};c.detectedLanguageId=n,c.languageId=o;for(let u of r){let d=jrc.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return(0,Brc.telemetry)(t,e,l)}}a(Hrc,"ReportTraitsTelemetry")});var j6=I(h1=>{"use strict";p();var t4i=h1&&h1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},p1=h1&&h1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(h1,"__esModule",{value:!0});h1.TestComponentsCompletionsPromptFactory=h1.ComponentsCompletionsPromptFactory=h1.PromptOrdering=void 0;h1.isCompletionRequestData=cnc;var dL=sL(),Z5i=N0(),Wkr=Dl(),r4i=Vre(),Hkr=ad(),zkr=$s(),n4i=Dte(),X5i=$Oi(),Grc=Yg(),$rc=l1(),Vrc=GRr(),Wrc=fLe(),zrc=rkr(),i4i=xEt(),Yrc=hLe(),Krc=_kr(),Jrc=vkr(),Zrc=Ckr(),Xrc=Dkr(),enc=G5i(),tnc=z5i(),rnc=Bkr(),o4i=F$(),nnc=x0(),yLe=IEt(),inc=HRr(),onc=K5i(),e4i=J5i(),Ykr=M$(),zD=nye(),snc=QEt(),anc=tye();function cnc(t){if(!t||typeof t!="object")return!1;let e=t;return!(!e.document||!e.position||e.position.line===void 0||e.position.character===void 0||!e.telemetryData)}a(cnc,"isCompletionRequestData");var U$;(function(t){t.Default="default",t.SplitContext="splitContext"})(U$||(h1.PromptOrdering=U$={}));var Gkr={[U$.Default]:{promptFunction:s4i,renderer:zrc.CompletionsPromptRenderer},[U$.SplitContext]:{promptFunction:enc.splitContextCompletionsPrompt,renderer:tnc.SplitContextPromptRenderer}};function s4i(t){let e=t.get($rc.ICompletionsTextDocumentManagerService),r=t.get(zkr.IInstantiationService),n=t.get(snc.ICompletionsRecentEditsProviderService);return(0,dL.jsxs)(dL.Fragment,{children:[(0,dL.jsxs)(Wrc.CompletionsContext,{children:[(0,dL.jsx)(Jrc.DocumentMarker,{tdms:e,weight:.7}),(0,dL.jsx)(rnc.Traits,{weight:.6}),(0,dL.jsx)(Krc.Diagnostics,{tdms:e,weight:.65}),(0,dL.jsx)(Vrc.CodeSnippets,{tdms:e,weight:.9}),(0,dL.jsx)(Xrc.SimilarFiles,{tdms:e,instantiationService:r,weight:.8}),(0,dL.jsx)(Zrc.RecentEdits,{tdms:e,recentEditsProvider:n,weight:.99})]}),(0,dL.jsx)(Yrc.CurrentFile,{weight:1})]})}a(s4i,"defaultCompletionsPrompt");var VEt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l,u,d){this.instantiationService=n,this.completionsTelemetryService=o,this.ignoreService=s,this.contextProviderBridge=c,this.logTarget=l,this.contextProviderStatistics=u,this.languageDiagnosticsService=d,this.promptOrdering=r??U$.Default,this.virtualPrompt=e??new X5i.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe(),this.renderer=this.getRenderer()}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}async createPromptUnsafe({completionId:e,completionState:r,telemetryData:n,promptOpts:o},s){let{maxPromptLength:c,suffixPercent:l,suffixMatchThreshold:u}=this.instantiationService.invokeFunction(zD.getPromptOptions,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?U$.SplitContext:U$.Default;this.setPromptOrdering(f);let h=performance.now(),{traits:m,codeSnippets:g,diagnostics:A,turnOffSimilarFiles:y,resolvedContextItems:E}=await this.resolveContext(e,r,n,s,o);if(await this.updateComponentData(r.textDocument,r.position,m,g,A,n,y,c,s,o,u,o?.tokenizer),s?.isCancellationRequested)return zD._promptCancelled;let _=this.virtualPrompt.snapshot(s),v=_.status;if(v==="cancelled")return zD._promptCancelled;if(v==="error")return this.errorPrompt(_.error);let b=this.renderer.render(_.snapshot,{delimiter:` +`,tokenizer:o?.tokenizer,promptTokenLimit:c,suffixPercent:l,languageId:r.textDocument.detectedLanguageId},s);if(b.status==="cancelled")return zD._promptCancelled;if(b.status==="error")return this.errorPrompt(b.error);let[T,w]=(0,zD.trimLastLine)(b.prefix),R={...b,prefix:T},x,P=r.textDocument.detectedLanguageId;if(this.instantiationService.invokeFunction(yLe.useContextProviderAPI,P,n)){let N=(0,Ykr.componentStatisticsToPromptMatcher)(b.metadata.componentStatistics);this.contextProviderStatistics.getStatisticsForCompletion(e).computeMatch(N),x=(0,yLe.telemetrizeContextItems)(this.contextProviderStatistics,e,E),Wkr.logger.debug(this.logTarget,`Context providers telemetry: '${JSON.stringify(x)}'`)}let D=performance.now();return this.resetIfEmpty(b),this.successPrompt(R,D,h,w,x)}async updateComponentData(e,r,n,o,s,c,l,u,d,f={},h,m){let g=this.createRequestData(e,r,c,d,f,u,n,o,s,l,h,m);await this.pipe.pump(g)}async resolveContext(e,r,n,o,s={}){let c=[],l,u,d,f=!1;if(this.instantiationService.invokeFunction(yLe.useContextProviderAPI,r.textDocument.detectedLanguageId,n)){c=await this.contextProviderBridge.resolution(e);let{textDocument:m}=r,g=c.filter(yLe.matchContextItems);this.instantiationService.invokeFunction(lnc,m.detectedLanguageId,g,n)||(f=!0),l=await this.instantiationService.invokeFunction(e4i.getTraitsFromContextItems,e,g),this.instantiationService.invokeFunction(e4i.ReportTraitsTelemetry,"contextProvider.traits",l,m.detectedLanguageId,m.detectedLanguageId,n),u=await this.instantiationService.invokeFunction(inc.getCodeSnippetsFromContextItems,e,g,m.detectedLanguageId),d=await this.instantiationService.invokeFunction(onc.getDiagnosticsFromContextItems,e,g)}let h=this.instantiationService.invokeFunction(yLe.getDefaultDiagnosticSettings);return d=this.addDefaultDiagnosticBag(c,d,e,r,h),{traits:l,codeSnippets:u,diagnostics:d,turnOffSimilarFiles:f,resolvedContextItems:c}}async failFastPrompt(e,r,n,o){if(o?.isCancellationRequested)return zD._promptCancelled;if(await this.ignoreService.isCopilotIgnored(Hkr.URI.parse(e.uri)))return zD._copilotContentExclusion;if((n>0?e.getText().length:e.offsetAt(r))0},computeTimeMs:r-n,trailingWs:o,neighborSource:new Map,metadata:e.metadata,contextProvidersTelemetry:s}}errorPrompt(e){return(0,Grc.telemetryException)(this.completionsTelemetryService,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),zD._promptError}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new X5i.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){let e=Gkr[this.promptOrdering]?.promptFunction??s4i;return this.instantiationService.invokeFunction(e)}getRenderer(){let e=Gkr[this.promptOrdering]??Gkr[U$.Default];return new e.renderer}addDefaultDiagnosticBag(e,r,n,o,s){if(s===void 0)return r;let c=o.textDocument;if(r!==void 0&&r.some(_=>_.uri.toString()===c.uri))return r;let l=performance.now(),u=this.languageDiagnosticsService.getDiagnostics(Hkr.URI.parse(c.uri));if(u.length===0)return r;let d=[],f=[],h=s.warnings==="yes"||s.warnings==="yesIfNoErrors",m=o.position;for(let _ of u)Math.abs(_.range.start.line-m.line)<=s.maxLineDistance&&(_.severity===Z5i.DiagnosticSeverity.Error?d.push(_):_.severity===Z5i.DiagnosticSeverity.Warning&&h&&f.push(_));let g=[...d,...s.warnings==="yes"||s.warnings==="yesIfNoErrors"&&d.length===0?f:[]];if(g.length===0)return r;g.sort((_,v)=>{let b=Math.abs(_.range.start.line-m.line),T=Math.abs(v.range.start.line-m.line);return b-T});let A={type:"DiagnosticBag",uri:Hkr.URI.parse(c.uri),values:g.slice(0,s.maxDiagnostics),id:(0,nnc.generateUuid)()},y="copilot.chat.defaultDiagnostics",E=this.contextProviderStatistics.getStatisticsForCompletion(n);return E.addExpectations(y,[[A,"included"]]),e.push({providerId:y,matchScore:10,resolution:"full",resolutionTimeMs:performance.now()-l,data:[A]}),E.setLastResolution(y,"full"),r===void 0?[A]:(r.push(A),r)}};VEt=t4i([p1(2,zkr.IInstantiationService),p1(3,n4i.ICompletionsTelemetryService),p1(4,r4i.IIgnoreService),p1(5,i4i.ICompletionsContextProviderBridgeService),p1(6,Wkr.ICompletionsLogTargetService),p1(7,Ykr.ICompletionsContextProviderService),p1(8,o4i.ILanguageDiagnosticsService)],VEt);var $kr=class extends VEt{static{a(this,"ComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l){super(void 0,void 0,e,r,n,o,s,c,l)}};h1.ComponentsCompletionsPromptFactory=$kr;h1.ComponentsCompletionsPromptFactory=$kr=t4i([p1(0,zkr.IInstantiationService),p1(1,n4i.ICompletionsTelemetryService),p1(2,r4i.IIgnoreService),p1(3,i4i.ICompletionsContextProviderBridgeService),p1(4,Wkr.ICompletionsLogTargetService),p1(5,Ykr.ICompletionsContextProviderService),p1(6,o4i.ILanguageDiagnosticsService)],$kr);var Vkr=class extends VEt{static{a(this,"TestComponentsCompletionsPromptFactory")}};h1.TestComponentsCompletionsPromptFactory=Vkr;function lnc(t,e,r,n){let o=["cpp","c"];return(0,anc.isIncludeNeighborFilesActive)(t,e,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(lnc,"similarFilesEnabled")});var tPr=I(zE=>{"use strict";p();var a4i=zE&&zE.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},c4i=zE&&zE.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(zE,"__esModule",{value:!0});zE.TestCompletionsPromptFactory=zE.CompletionsPromptFactory=zE.DEFAULT_PROMPT_TIMEOUT=zE.ICompletionsPromptFactoryService=void 0;var unc=ei(),l4i=$s(),Kkr=nye(),dnc=j6(),fnc=nn();zE.ICompletionsPromptFactoryService=(0,fnc.createServiceIdentifier)("ICompletionsPromptFactoryService");var Jkr=class{static{a(this,"SequentialCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){return this.lastPromise=this.promptAsync(e,r),this.lastPromise}async promptAsync(e,r){if(await this.lastPromise,r?.isCancellationRequested)return Kkr._promptCancelled;try{return await this.delegate.prompt(e,r)}catch{return Kkr._promptError}}};zE.DEFAULT_PROMPT_TIMEOUT=1200;var Zkr=class{static{a(this,"TimeoutHandlingCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){let n=new unc.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(Kkr._promptTimeout)},zE.DEFAULT_PROMPT_TIMEOUT)})])}},WEt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n){this.delegate=new Jkr(new Zkr(n.createInstance(dnc.TestComponentsCompletionsPromptFactory,e,r)))}prompt(e,r){return this.delegate.prompt(e,r)}};WEt=a4i([c4i(2,l4i.IInstantiationService)],WEt);var Xkr=class extends WEt{static{a(this,"CompletionsPromptFactory")}constructor(e){super(void 0,void 0,e)}};zE.CompletionsPromptFactory=Xkr;zE.CompletionsPromptFactory=Xkr=a4i([c4i(0,l4i.IInstantiationService)],Xkr);var ePr=class extends WEt{static{a(this,"TestCompletionsPromptFactory")}};zE.TestCompletionsPromptFactory=ePr});var nye=I(Eh=>{"use strict";p();Object.defineProperty(Eh,"__esModule",{value:!0});Eh.PromptResponse=Eh._promptTimeout=Eh._promptCancelled=Eh._promptError=Eh._copilotContentExclusion=Eh._contextTooShort=Eh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=Eh.MIN_PROMPT_CHARS=void 0;Eh.trimLastLine=Enc;Eh.extractPrompt=_nc;Eh.getPromptOptions=bnc;var pnc=X4e(),hnc=gy(),u4i=Wyt(),mnc=nLe(),gnc=l1(),Anc=tPr(),ync=tye();Eh.MIN_PROMPT_CHARS=10;Eh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=["scminput"];Eh._contextTooShort={type:"contextTooShort"};Eh._copilotContentExclusion={type:"copilotContentExclusion"};Eh._promptError={type:"promptError"};Eh._promptCancelled={type:"promptCancelled"};Eh._promptTimeout={type:"promptTimeout"};var d4i;(function(t){function e(r){return r.type==="prompt"?[{header:"PREFIX",content:r.prompt.prefix},{header:"SUFFIX",content:r.prompt.suffix},{header:"CONTEXT",content:(r.prompt.context||[]).join(` --- `)},{header:"FIM",content:"Is Fim enabled: "+r.prompt.isFimEnabled},{header:"TOKENS",content:`Prefix tokens: ${r.prompt.prefixTokens} Suffix tokens: ${r.prompt.suffixTokens}`},{header:"NEIGHBORS",content:Array.from(r.neighborSource.entries()).map(([n,o])=>`neighboring file type: ${n} @@ -1020,14 +1020,14 @@ ${o.join(", ")}`).join(` --- ${n.content} ---------------`).join(` -`):JSON.stringify(r,null," ")}a(e,"toString"),t.toString=e})(EOi||(gh.PromptResponse=EOi={}));function Yec(t){let e=t.split(` -`),r=e[e.length-1],n=r.length-r.trimEnd().length,o=t.slice(0,t.length-n),s=t.slice(o.length);return[r.length===n?o:t,s]}a(Yec,"trimLastLine");function Kec(t,e,r,n,o,s={}){let l=t.get(Vec.ICompletionsTextDocumentManagerService).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);return l&&u&&(r=Zec(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys(),t.get(Wec.ICompletionsPromptFactoryService).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:!0}},o)}a(Kec,"extractPrompt");function Jec(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:(0,Hec.commentBlockAsSingles)(n,e)}a(Jec,"addNeighboringCellsToPrompt");function Zec(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>Jec(l,r.document.detectedLanguageId)).join(` +`):JSON.stringify(r,null," ")}a(e,"toString"),t.toString=e})(d4i||(Eh.PromptResponse=d4i={}));function Enc(t){let e=t.split(` +`),r=e[e.length-1],n=r.length-r.trimEnd().length,o=t.slice(0,t.length-n),s=t.slice(o.length);return[r.length===n?o:t,s]}a(Enc,"trimLastLine");function _nc(t,e,r,n,o,s={}){let l=t.get(gnc.ICompletionsTextDocumentManagerService).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);return l&&u&&(r=Cnc(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys(),t.get(Anc.ICompletionsPromptFactoryService).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:!0}},o)}a(_nc,"extractPrompt");function vnc(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:(0,pnc.commentBlockAsSingles)(n,e)}a(vnc,"addNeighboringCellsToPrompt");function Cnc(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>vnc(l,r.document.detectedLanguageId)).join(` `)+` -`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(Zec,"applyEditsForNotebook");function Xec(t,e,r){let n=t.get(Gec.ICompletionsFeaturesService),s=n.maxPromptCompletionTokens(e)-(0,$ec.getMaxSolutionTokens)(),c=(0,yOi.getNumberOfSnippets)(e,r),l=(0,yOi.getSimilarFilesOptions)(t,e,r),u=n.suffixPercent(e),d=n.suffixMatchThreshold(e);if(u<0||u>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${u}`);if(d<0||d>100)throw new Error(`suffixMatchThreshold must be between 0 and 100, but was ${d}`);return{maxPromptLength:s,similarFilesOptions:l,numberOfSnippets:c,suffixPercent:u,suffixMatchThreshold:d}}a(Xec,"getPromptOptions")});var COi=I(x$=>{"use strict";p();Object.defineProperty(x$,"__esModule",{value:!0});x$.TypeSystem=x$.TypeSystemDuplicateFormat=x$.TypeSystemDuplicateTypeKind=void 0;var CEt=Hge(),etc=n4e(),ttc=Sn(),vOi=Nf(),bEt=class extends vOi.TypeBoxError{static{a(this,"TypeSystemDuplicateTypeKind")}constructor(e){super(`Duplicate type kind '${e}' detected`)}};x$.TypeSystemDuplicateTypeKind=bEt;var SEt=class extends vOi.TypeBoxError{static{a(this,"TypeSystemDuplicateFormat")}constructor(e){super(`Duplicate string format '${e}' detected`)}};x$.TypeSystemDuplicateFormat=SEt;var _Oi;(function(t){function e(n,o){if(CEt.TypeRegistry.Has(n))throw new bEt(n);return CEt.TypeRegistry.Set(n,o),(s={})=>(0,etc.Unsafe)({...s,[ttc.Kind]:n})}a(e,"Type"),t.Type=e;function r(n,o){if(CEt.FormatRegistry.Has(n))throw new SEt(n);return CEt.FormatRegistry.Set(n,o),n}a(r,"Format"),t.Format=r})(_Oi||(x$.TypeSystem=_Oi={}))});var lkr=I(w$=>{"use strict";p();var rtc=w$&&w$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bOi=w$&&w$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rtc(e,t,r)};Object.defineProperty(w$,"__esModule",{value:!0});bOi(T5e(),w$);bOi(COi(),w$)});var ukr=I(K4e=>{"use strict";p();Object.defineProperty(K4e,"__esModule",{value:!0});K4e.DefaultErrorFunction=SOi;K4e.SetErrorFunction=itc;K4e.GetErrorFunction=otc;var ntc=Sn(),qn=dkr();function SOi(t){switch(t.errorType){case qn.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case qn.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case qn.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case qn.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case qn.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case qn.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case qn.ValueErrorType.Array:return"Expected array";case qn.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case qn.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case qn.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case qn.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case qn.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case qn.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case qn.ValueErrorType.BigInt:return"Expected bigint";case qn.ValueErrorType.Boolean:return"Expected boolean";case qn.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case qn.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case qn.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case qn.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case qn.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case qn.ValueErrorType.Date:return"Expected Date";case qn.ValueErrorType.Function:return"Expected function";case qn.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case qn.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case qn.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case qn.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case qn.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case qn.ValueErrorType.Integer:return"Expected integer";case qn.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case qn.ValueErrorType.Intersect:return"Expected all values to match";case qn.ValueErrorType.Iterator:return"Expected Iterator";case qn.ValueErrorType.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case qn.ValueErrorType.Never:return"Never";case qn.ValueErrorType.Not:return"Value should not match";case qn.ValueErrorType.Null:return"Expected null";case qn.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case qn.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case qn.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case qn.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case qn.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case qn.ValueErrorType.Number:return"Expected number";case qn.ValueErrorType.Object:return"Expected object";case qn.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case qn.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case qn.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case qn.ValueErrorType.ObjectRequiredProperty:return"Expected required property";case qn.ValueErrorType.Promise:return"Expected Promise";case qn.ValueErrorType.RegExp:return"Expected string to match regular expression";case qn.ValueErrorType.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case qn.ValueErrorType.StringFormat:return`Expected string to match '${t.schema.format}' format`;case qn.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case qn.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case qn.ValueErrorType.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case qn.ValueErrorType.String:return"Expected string";case qn.ValueErrorType.Symbol:return"Expected symbol";case qn.ValueErrorType.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case qn.ValueErrorType.Tuple:return"Expected tuple";case qn.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case qn.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case qn.ValueErrorType.Uint8Array:return"Expected Uint8Array";case qn.ValueErrorType.Undefined:return"Expected undefined";case qn.ValueErrorType.Union:return"Expected union value";case qn.ValueErrorType.Void:return"Expected void";case qn.ValueErrorType.Kind:return`Expected kind '${t.schema[ntc.Kind]}'`;default:return"Unknown error type"}}a(SOi,"DefaultErrorFunction");var TOi=SOi;function itc(t){TOi=t}a(itc,"SetErrorFunction");function otc(){return TOi}a(otc,"GetErrorFunction")});var wOi=I(jAe=>{"use strict";p();Object.defineProperty(jAe,"__esModule",{value:!0});jAe.TypeDereferenceError=void 0;jAe.Pushref=ltc;jAe.Deref=xOi;var stc=Nf(),IOi=Sn(),atc=Egt(),TEt=class extends stc.TypeBoxError{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};jAe.TypeDereferenceError=TEt;function ctc(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new TEt(t);return xOi(r,e)}a(ctc,"Resolve");function ltc(t,e){return!(0,atc.IsString)(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(ltc,"Pushref");function xOi(t,e){return t[IOi.Kind]==="This"||t[IOi.Kind]==="Ref"?ctc(t,e):t}a(xOi,"Deref")});var qD=I(nne=>{"use strict";p();var utc=nne&&nne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dtc=nne&&nne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&utc(e,t,r)};Object.defineProperty(nne,"__esModule",{value:!0});dtc(wOi(),nne)});var DOi=I(J4e=>{"use strict";p();Object.defineProperty(J4e,"__esModule",{value:!0});J4e.ValueHashError=void 0;J4e.Hash=wtc;var jD=R0(),ftc=Nf(),IEt=class extends ftc.TypeBoxError{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}};J4e.ValueHashError=IEt;var nI;(function(t){t[t.Undefined=0]="Undefined",t[t.Null=1]="Null",t[t.Boolean=2]="Boolean",t[t.Number=3]="Number",t[t.String=4]="String",t[t.Object=5]="Object",t[t.Array=6]="Array",t[t.Date=7]="Date",t[t.Uint8Array=8]="Uint8Array",t[t.Symbol=9]="Symbol",t[t.BigInt=10]="BigInt"})(nI||(nI={}));var HAe=BigInt("14695981039346656037"),[ptc,htc]=[BigInt("1099511628211"),BigInt("18446744073709551616")],mtc=Array.from({length:256}).map((t,e)=>BigInt(e)),ROi=new Float64Array(1),kOi=new DataView(ROi.buffer),POi=new Uint8Array(ROi.buffer);function*gtc(t){let e=t===0?1:Math.ceil(Math.floor(Math.log2(t)+1)/8);for(let r=0;r>8*(e-1-r)&255}a(gtc,"NumberToBytes");function Atc(t){GE(nI.Array);for(let e of t)GAe(e)}a(Atc,"ArrayType");function ytc(t){GE(nI.Boolean),GE(t?1:0)}a(ytc,"BooleanType");function Etc(t){GE(nI.BigInt),kOi.setBigInt64(0,t);for(let e of POi)GE(e)}a(Etc,"BigIntType");function _tc(t){GE(nI.Date),GAe(t.getTime())}a(_tc,"DateType");function vtc(t){GE(nI.Null)}a(vtc,"NullType");function Ctc(t){GE(nI.Number),kOi.setFloat64(0,t);for(let e of POi)GE(e)}a(Ctc,"NumberType");function btc(t){GE(nI.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())GAe(e),GAe(t[e])}a(btc,"ObjectType");function Stc(t){GE(nI.String);for(let e=0;e{"use strict";p();var Rtc=ine&&ine.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ktc=ine&&ine.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Rtc(e,t,r)};Object.defineProperty(ine,"__esModule",{value:!0});ktc(DOi(),ine)});var pkr=I(tLe=>{"use strict";p();Object.defineProperty(tLe,"__esModule",{value:!0});tLe.ValueCheckUnknownTypeError=void 0;tLe.Check=Arc;var X4e=lkr(),fkr=qD(),Ptc=Z4e(),$Ae=Sn(),NOi=mD(),Dtc=ure(),eLe=Hge(),Ntc=Nf(),Mtc=Cm(),wm=R0(),Otc=vs(),xEt=class extends Ntc.TypeBoxError{static{a(this,"ValueCheckUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};tLe.ValueCheckUnknownTypeError=xEt;function Ltc(t){return t[$Ae.Kind]==="Any"||t[$Ae.Kind]==="Unknown"}a(Ltc,"IsAnyOrUnknown");function ia(t){return t!==void 0}a(ia,"IsDefined");function Btc(t,e,r){return!0}a(Btc,"FromAny");function Ftc(t,e,r){return!0}a(Ftc,"FromArgument");function Utc(t,e,r){if(!(0,wm.IsArray)(r)||ia(t.minItems)&&!(r.length>=t.minItems)||ia(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!Jg(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=(0,Ptc.Hash)(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(ia(t.contains)||(0,wm.IsNumber)(t.minContains)||(0,wm.IsNumber)(t.maxContains)))return!0;let n=ia(t.contains)?t.contains:(0,Mtc.Never)(),o=r.reduce((s,c)=>Jg(n,e,c)?s+1:s,0);return!(o===0||(0,wm.IsNumber)(t.minContains)&&ot.maxContains)}a(Utc,"FromArray");function Qtc(t,e,r){return(0,wm.IsAsyncIterator)(r)}a(Qtc,"FromAsyncIterator");function qtc(t,e,r){return!(!(0,wm.IsBigInt)(r)||ia(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ia(t.maximum)&&!(r<=t.maximum)||ia(t.minimum)&&!(r>=t.minimum)||ia(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(qtc,"FromBigInt");function jtc(t,e,r){return(0,wm.IsBoolean)(r)}a(jtc,"FromBoolean");function Htc(t,e,r){return Jg(t.returns,e,r.prototype)}a(Htc,"FromConstructor");function Gtc(t,e,r){return!(!(0,wm.IsDate)(r)||ia(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||ia(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||ia(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||ia(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(Gtc,"FromDate");function $tc(t,e,r){return(0,wm.IsFunction)(r)}a($tc,"FromFunction");function Vtc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Jg(o,[...e,...n],r)}a(Vtc,"FromImport");function Wtc(t,e,r){return!(!(0,wm.IsInteger)(r)||ia(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ia(t.maximum)&&!(r<=t.maximum)||ia(t.minimum)&&!(r>=t.minimum)||ia(t.multipleOf)&&r%t.multipleOf!==0)}a(Wtc,"FromInteger");function ztc(t,e,r){let n=t.allOf.every(o=>Jg(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp((0,NOi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if((0,Otc.IsSchema)(t.unevaluatedProperties)){let o=new RegExp((0,NOi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||Jg(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(ztc,"FromIntersect");function Ytc(t,e,r){return(0,wm.IsIterator)(r)}a(Ytc,"FromIterator");function Ktc(t,e,r){return r===t.const}a(Ktc,"FromLiteral");function Jtc(t,e,r){return!1}a(Jtc,"FromNever");function Ztc(t,e,r){return!Jg(t.not,e,r)}a(Ztc,"FromNot");function Xtc(t,e,r){return(0,wm.IsNull)(r)}a(Xtc,"FromNull");function erc(t,e,r){return!(!X4e.TypeSystemPolicy.IsNumberLike(r)||ia(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ia(t.minimum)&&!(r>=t.minimum)||ia(t.maximum)&&!(r<=t.maximum)||ia(t.multipleOf)&&r%t.multipleOf!==0)}a(erc,"FromNumber");function trc(t,e,r){if(!X4e.TypeSystemPolicy.IsObjectLike(r)||ia(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ia(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let n=Object.getOwnPropertyNames(t.properties);for(let o of n){let s=t.properties[o];if(t.required&&t.required.includes(o)){if(!Jg(s,e,r[o])||((0,Dtc.ExtendsUndefinedCheck)(s)||Ltc(s))&&!(o in r))return!1}else if(X4e.TypeSystemPolicy.IsExactOptionalProperty(r,o)&&!Jg(s,e,r[o]))return!1}if(t.additionalProperties===!1){let o=Object.getOwnPropertyNames(r);return t.required&&t.required.length===n.length&&o.length===n.length?!0:o.every(s=>n.includes(s))}else return typeof t.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(s=>n.includes(s)||Jg(t.additionalProperties,e,r[s])):!0}a(trc,"FromObject");function rrc(t,e,r){return(0,wm.IsPromise)(r)}a(rrc,"FromPromise");function nrc(t,e,r){if(!X4e.TypeSystemPolicy.IsRecordLike(r)||ia(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ia(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let[n,o]=Object.entries(t.patternProperties)[0],s=new RegExp(n),c=Object.entries(r).every(([d,f])=>s.test(d)?Jg(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:Jg(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(nrc,"FromRecord");function irc(t,e,r){return Jg((0,fkr.Deref)(t,e),e,r)}a(irc,"FromRef");function orc(t,e,r){let n=new RegExp(t.source,t.flags);return ia(t.minLength)&&!(r.length>=t.minLength)||ia(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(orc,"FromRegExp");function src(t,e,r){return!(0,wm.IsString)(r)||ia(t.minLength)&&!(r.length>=t.minLength)||ia(t.maxLength)&&!(r.length<=t.maxLength)||ia(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:ia(t.format)?eLe.FormatRegistry.Has(t.format)?eLe.FormatRegistry.Get(t.format)(r):!1:!0}a(src,"FromString");function arc(t,e,r){return(0,wm.IsSymbol)(r)}a(arc,"FromSymbol");function crc(t,e,r){return(0,wm.IsString)(r)&&new RegExp(t.pattern).test(r)}a(crc,"FromTemplateLiteral");function lrc(t,e,r){return Jg((0,fkr.Deref)(t,e),e,r)}a(lrc,"FromThis");function urc(t,e,r){if(!(0,wm.IsArray)(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nJg(n,e,r))}a(frc,"FromUnion");function prc(t,e,r){return!(!(0,wm.IsUint8Array)(r)||ia(t.maxByteLength)&&!(r.length<=t.maxByteLength)||ia(t.minByteLength)&&!(r.length>=t.minByteLength))}a(prc,"FromUint8Array");function hrc(t,e,r){return!0}a(hrc,"FromUnknown");function mrc(t,e,r){return X4e.TypeSystemPolicy.IsVoidLike(r)}a(mrc,"FromVoid");function grc(t,e,r){return eLe.TypeRegistry.Has(t[$Ae.Kind])?eLe.TypeRegistry.Get(t[$Ae.Kind])(t,r):!1}a(grc,"FromKind");function Jg(t,e,r){let n=ia(t.$id)?(0,fkr.Pushref)(t,e):e,o=t;switch(o[$Ae.Kind]){case"Any":return Btc(o,n,r);case"Argument":return Ftc(o,n,r);case"Array":return Utc(o,n,r);case"AsyncIterator":return Qtc(o,n,r);case"BigInt":return qtc(o,n,r);case"Boolean":return jtc(o,n,r);case"Constructor":return Htc(o,n,r);case"Date":return Gtc(o,n,r);case"Function":return $tc(o,n,r);case"Import":return Vtc(o,n,r);case"Integer":return Wtc(o,n,r);case"Intersect":return ztc(o,n,r);case"Iterator":return Ytc(o,n,r);case"Literal":return Ktc(o,n,r);case"Never":return Jtc(o,n,r);case"Not":return Ztc(o,n,r);case"Null":return Xtc(o,n,r);case"Number":return erc(o,n,r);case"Object":return trc(o,n,r);case"Promise":return rrc(o,n,r);case"Record":return nrc(o,n,r);case"Ref":return irc(o,n,r);case"RegExp":return orc(o,n,r);case"String":return src(o,n,r);case"Symbol":return arc(o,n,r);case"TemplateLiteral":return crc(o,n,r);case"This":return lrc(o,n,r);case"Tuple":return urc(o,n,r);case"Undefined":return drc(o,n,r);case"Union":return frc(o,n,r);case"Uint8Array":return prc(o,n,r);case"Unknown":return hrc(o,n,r);case"Void":return mrc(o,n,r);default:if(!eLe.TypeRegistry.Has(o[$Ae.Kind]))throw new xEt(o);return grc(o,n,r)}}a(Jg,"Visit");function Arc(...t){return t.length===3?Jg(t[0],t[1],t[2]):Jg(t[0],[],t[1])}a(Arc,"Check")});var iI=I(one=>{"use strict";p();var yrc=one&&one.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Erc=one&&one.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yrc(e,t,r)};Object.defineProperty(one,"__esModule",{value:!0});Erc(pkr(),one)});var dkr=I(O6=>{"use strict";p();Object.defineProperty(O6,"__esModule",{value:!0});O6.ValueErrorIterator=O6.ValueErrorsUnknownTypeError=O6.ValueErrorType=void 0;O6.Errors=snc;var rLe=lkr(),MOi=mD(),wEt=Hge(),_rc=I1r(),vrc=ukr(),Crc=Nf(),OOi=qD(),brc=Z4e(),Src=iI(),hkr=Sn(),Trc=Cm(),Ah=R0(),tn;(function(t){t[t.ArrayContains=0]="ArrayContains",t[t.ArrayMaxContains=1]="ArrayMaxContains",t[t.ArrayMaxItems=2]="ArrayMaxItems",t[t.ArrayMinContains=3]="ArrayMinContains",t[t.ArrayMinItems=4]="ArrayMinItems",t[t.ArrayUniqueItems=5]="ArrayUniqueItems",t[t.Array=6]="Array",t[t.AsyncIterator=7]="AsyncIterator",t[t.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",t[t.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",t[t.BigIntMaximum=10]="BigIntMaximum",t[t.BigIntMinimum=11]="BigIntMinimum",t[t.BigIntMultipleOf=12]="BigIntMultipleOf",t[t.BigInt=13]="BigInt",t[t.Boolean=14]="Boolean",t[t.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",t[t.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",t[t.DateMaximumTimestamp=17]="DateMaximumTimestamp",t[t.DateMinimumTimestamp=18]="DateMinimumTimestamp",t[t.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",t[t.Date=20]="Date",t[t.Function=21]="Function",t[t.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",t[t.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",t[t.IntegerMaximum=24]="IntegerMaximum",t[t.IntegerMinimum=25]="IntegerMinimum",t[t.IntegerMultipleOf=26]="IntegerMultipleOf",t[t.Integer=27]="Integer",t[t.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",t[t.Intersect=29]="Intersect",t[t.Iterator=30]="Iterator",t[t.Kind=31]="Kind",t[t.Literal=32]="Literal",t[t.Never=33]="Never",t[t.Not=34]="Not",t[t.Null=35]="Null",t[t.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",t[t.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",t[t.NumberMaximum=38]="NumberMaximum",t[t.NumberMinimum=39]="NumberMinimum",t[t.NumberMultipleOf=40]="NumberMultipleOf",t[t.Number=41]="Number",t[t.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",t[t.ObjectMaxProperties=43]="ObjectMaxProperties",t[t.ObjectMinProperties=44]="ObjectMinProperties",t[t.ObjectRequiredProperty=45]="ObjectRequiredProperty",t[t.Object=46]="Object",t[t.Promise=47]="Promise",t[t.RegExp=48]="RegExp",t[t.StringFormatUnknown=49]="StringFormatUnknown",t[t.StringFormat=50]="StringFormat",t[t.StringMaxLength=51]="StringMaxLength",t[t.StringMinLength=52]="StringMinLength",t[t.StringPattern=53]="StringPattern",t[t.String=54]="String",t[t.Symbol=55]="Symbol",t[t.TupleLength=56]="TupleLength",t[t.Tuple=57]="Tuple",t[t.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",t[t.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",t[t.Uint8Array=60]="Uint8Array",t[t.Undefined=61]="Undefined",t[t.Union=62]="Union",t[t.Void=63]="Void"})(tn||(O6.ValueErrorType=tn={}));var REt=class extends Crc.TypeBoxError{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};O6.ValueErrorsUnknownTypeError=REt;function M6(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(M6,"EscapeKey");function oa(t){return t!==void 0}a(oa,"IsDefined");var nLe=class{static{a(this,"ValueErrorIterator")}constructor(e){this.iterator=e}[Symbol.iterator](){return this.iterator}First(){let e=this.iterator.next();return e.done?void 0:e.value}};O6.ValueErrorIterator=nLe;function cn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:(0,vrc.GetErrorFunction)()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(cn,"Create");function*Irc(t,e,r,n){}a(Irc,"FromAny");function*xrc(t,e,r,n){}a(xrc,"FromArgument");function*wrc(t,e,r,n){if(!(0,Ah.IsArray)(n))return yield cn(tn.Array,t,r,n);oa(t.minItems)&&!(n.length>=t.minItems)&&(yield cn(tn.ArrayMinItems,t,r,n)),oa(t.maxItems)&&!(n.length<=t.maxItems)&&(yield cn(tn.ArrayMaxItems,t,r,n));for(let c=0;cZg(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield cn(tn.ArrayContains,t,r,n)),(0,Ah.IsNumber)(t.minContains)&&st.maxContains&&(yield cn(tn.ArrayMaxContains,t,r,n))}a(wrc,"FromArray");function*Rrc(t,e,r,n){(0,Ah.IsAsyncIterator)(n)||(yield cn(tn.AsyncIterator,t,r,n))}a(Rrc,"FromAsyncIterator");function*krc(t,e,r,n){if(!(0,Ah.IsBigInt)(n))return yield cn(tn.BigInt,t,r,n);oa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.BigIntExclusiveMinimum,t,r,n)),oa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.BigIntMaximum,t,r,n)),oa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.BigIntMinimum,t,r,n)),oa(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield cn(tn.BigIntMultipleOf,t,r,n))}a(krc,"FromBigInt");function*Prc(t,e,r,n){(0,Ah.IsBoolean)(n)||(yield cn(tn.Boolean,t,r,n))}a(Prc,"FromBoolean");function*Drc(t,e,r,n){yield*Zg(t.returns,e,r,n.prototype)}a(Drc,"FromConstructor");function*Nrc(t,e,r,n){if(!(0,Ah.IsDate)(n))return yield cn(tn.Date,t,r,n);oa(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield cn(tn.DateExclusiveMinimumTimestamp,t,r,n)),oa(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield cn(tn.DateMaximumTimestamp,t,r,n)),oa(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield cn(tn.DateMinimumTimestamp,t,r,n)),oa(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield cn(tn.DateMultipleOfTimestamp,t,r,n))}a(Nrc,"FromDate");function*Mrc(t,e,r,n){(0,Ah.IsFunction)(n)||(yield cn(tn.Function,t,r,n))}a(Mrc,"FromFunction");function*Orc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*Zg(s,[...e,...o],r,n)}a(Orc,"FromImport");function*Lrc(t,e,r,n){if(!(0,Ah.IsInteger)(n))return yield cn(tn.Integer,t,r,n);oa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.IntegerExclusiveMinimum,t,r,n)),oa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.IntegerMaximum,t,r,n)),oa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.IntegerMinimum,t,r,n)),oa(t.multipleOf)&&n%t.multipleOf!==0&&(yield cn(tn.IntegerMultipleOf,t,r,n))}a(Lrc,"FromInteger");function*Brc(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of Zg(s,e,r,n))o=!0,yield c;if(o)return yield cn(tn.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp((0,MOi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield cn(tn.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp((0,MOi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=Zg(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(Brc,"FromIntersect");function*Frc(t,e,r,n){(0,Ah.IsIterator)(n)||(yield cn(tn.Iterator,t,r,n))}a(Frc,"FromIterator");function*Urc(t,e,r,n){n!==t.const&&(yield cn(tn.Literal,t,r,n))}a(Urc,"FromLiteral");function*Qrc(t,e,r,n){yield cn(tn.Never,t,r,n)}a(Qrc,"FromNever");function*qrc(t,e,r,n){Zg(t.not,e,r,n).next().done===!0&&(yield cn(tn.Not,t,r,n))}a(qrc,"FromNot");function*jrc(t,e,r,n){(0,Ah.IsNull)(n)||(yield cn(tn.Null,t,r,n))}a(jrc,"FromNull");function*Hrc(t,e,r,n){if(!rLe.TypeSystemPolicy.IsNumberLike(n))return yield cn(tn.Number,t,r,n);oa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.NumberExclusiveMinimum,t,r,n)),oa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.NumberMaximum,t,r,n)),oa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.NumberMinimum,t,r,n)),oa(t.multipleOf)&&n%t.multipleOf!==0&&(yield cn(tn.NumberMultipleOf,t,r,n))}a(Hrc,"FromNumber");function*Grc(t,e,r,n){if(!rLe.TypeSystemPolicy.IsObjectLike(n))return yield cn(tn.Object,t,r,n);oa(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield cn(tn.ObjectMinProperties,t,r,n)),oa(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield cn(tn.ObjectMaxProperties,t,r,n));let o=Array.isArray(t.required)?t.required:[],s=Object.getOwnPropertyNames(t.properties),c=Object.getOwnPropertyNames(n);for(let l of o)c.includes(l)||(yield cn(tn.ObjectRequiredProperty,t.properties[l],`${r}/${M6(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield cn(tn.ObjectAdditionalProperties,t,`${r}/${M6(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*Zg(t.additionalProperties,e,`${r}/${M6(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*Zg(u,e,`${r}/${M6(l)}`,n[l]),(0,_rc.ExtendsUndefinedCheck)(t)&&!(l in n)&&(yield cn(tn.ObjectRequiredProperty,u,`${r}/${M6(l)}`,void 0))):rLe.TypeSystemPolicy.IsExactOptionalProperty(n,l)&&(yield*Zg(u,e,`${r}/${M6(l)}`,n[l]))}}a(Grc,"FromObject");function*$rc(t,e,r,n){(0,Ah.IsPromise)(n)||(yield cn(tn.Promise,t,r,n))}a($rc,"FromPromise");function*Vrc(t,e,r,n){if(!rLe.TypeSystemPolicy.IsRecordLike(n))return yield cn(tn.Object,t,r,n);oa(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield cn(tn.ObjectMinProperties,t,r,n)),oa(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield cn(tn.ObjectMaxProperties,t,r,n));let[o,s]=Object.entries(t.patternProperties)[0],c=new RegExp(o);for(let[l,u]of Object.entries(n))c.test(l)&&(yield*Zg(s,e,`${r}/${M6(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*Zg(t.additionalProperties,e,`${r}/${M6(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield cn(tn.ObjectAdditionalProperties,t,`${r}/${M6(l)}`,u)}}a(Vrc,"FromRecord");function*Wrc(t,e,r,n){yield*Zg((0,OOi.Deref)(t,e),e,r,n)}a(Wrc,"FromRef");function*zrc(t,e,r,n){if(!(0,Ah.IsString)(n))return yield cn(tn.String,t,r,n);if(oa(t.minLength)&&!(n.length>=t.minLength)&&(yield cn(tn.StringMinLength,t,r,n)),oa(t.maxLength)&&!(n.length<=t.maxLength)&&(yield cn(tn.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield cn(tn.RegExp,t,r,n)}a(zrc,"FromRegExp");function*Yrc(t,e,r,n){if(!(0,Ah.IsString)(n))return yield cn(tn.String,t,r,n);oa(t.minLength)&&!(n.length>=t.minLength)&&(yield cn(tn.StringMinLength,t,r,n)),oa(t.maxLength)&&!(n.length<=t.maxLength)&&(yield cn(tn.StringMaxLength,t,r,n)),(0,Ah.IsString)(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield cn(tn.StringPattern,t,r,n))),(0,Ah.IsString)(t.format)&&(wEt.FormatRegistry.Has(t.format)?wEt.FormatRegistry.Get(t.format)(n)||(yield cn(tn.StringFormat,t,r,n)):yield cn(tn.StringFormatUnknown,t,r,n))}a(Yrc,"FromString");function*Krc(t,e,r,n){(0,Ah.IsSymbol)(n)||(yield cn(tn.Symbol,t,r,n))}a(Krc,"FromSymbol");function*Jrc(t,e,r,n){if(!(0,Ah.IsString)(n))return yield cn(tn.String,t,r,n);new RegExp(t.pattern).test(n)||(yield cn(tn.StringPattern,t,r,n))}a(Jrc,"FromTemplateLiteral");function*Zrc(t,e,r,n){yield*Zg((0,OOi.Deref)(t,e),e,r,n)}a(Zrc,"FromThis");function*Xrc(t,e,r,n){if(!(0,Ah.IsArray)(n))return yield cn(tn.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield cn(tn.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield cn(tn.TupleLength,t,r,n);if(t.items)for(let o=0;onew nLe(Zg(s,e,r,n)));yield cn(tn.Union,t,r,n,o)}a(tnc,"FromUnion");function*rnc(t,e,r,n){if(!(0,Ah.IsUint8Array)(n))return yield cn(tn.Uint8Array,t,r,n);oa(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield cn(tn.Uint8ArrayMaxByteLength,t,r,n)),oa(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield cn(tn.Uint8ArrayMinByteLength,t,r,n))}a(rnc,"FromUint8Array");function*nnc(t,e,r,n){}a(nnc,"FromUnknown");function*inc(t,e,r,n){rLe.TypeSystemPolicy.IsVoidLike(n)||(yield cn(tn.Void,t,r,n))}a(inc,"FromVoid");function*onc(t,e,r,n){wEt.TypeRegistry.Get(t[hkr.Kind])(t,n)||(yield cn(tn.Kind,t,r,n))}a(onc,"FromKind");function*Zg(t,e,r,n){let o=oa(t.$id)?[...e,t]:e,s=t;switch(s[hkr.Kind]){case"Any":return yield*Irc(s,o,r,n);case"Argument":return yield*xrc(s,o,r,n);case"Array":return yield*wrc(s,o,r,n);case"AsyncIterator":return yield*Rrc(s,o,r,n);case"BigInt":return yield*krc(s,o,r,n);case"Boolean":return yield*Prc(s,o,r,n);case"Constructor":return yield*Drc(s,o,r,n);case"Date":return yield*Nrc(s,o,r,n);case"Function":return yield*Mrc(s,o,r,n);case"Import":return yield*Orc(s,o,r,n);case"Integer":return yield*Lrc(s,o,r,n);case"Intersect":return yield*Brc(s,o,r,n);case"Iterator":return yield*Frc(s,o,r,n);case"Literal":return yield*Urc(s,o,r,n);case"Never":return yield*Qrc(s,o,r,n);case"Not":return yield*qrc(s,o,r,n);case"Null":return yield*jrc(s,o,r,n);case"Number":return yield*Hrc(s,o,r,n);case"Object":return yield*Grc(s,o,r,n);case"Promise":return yield*$rc(s,o,r,n);case"Record":return yield*Vrc(s,o,r,n);case"Ref":return yield*Wrc(s,o,r,n);case"RegExp":return yield*zrc(s,o,r,n);case"String":return yield*Yrc(s,o,r,n);case"Symbol":return yield*Krc(s,o,r,n);case"TemplateLiteral":return yield*Jrc(s,o,r,n);case"This":return yield*Zrc(s,o,r,n);case"Tuple":return yield*Xrc(s,o,r,n);case"Undefined":return yield*enc(s,o,r,n);case"Union":return yield*tnc(s,o,r,n);case"Uint8Array":return yield*rnc(s,o,r,n);case"Unknown":return yield*nnc(s,o,r,n);case"Void":return yield*inc(s,o,r,n);default:if(!wEt.TypeRegistry.Has(s[hkr.Kind]))throw new REt(t);return yield*onc(s,o,r,n)}}a(Zg,"Visit");function snc(...t){let e=t.length===3?Zg(t[0],t[1],"",t[2]):Zg(t[0],[],"",t[1]);return new nLe(e)}a(snc,"Errors")});var VAe=I(R$=>{"use strict";p();var anc=R$&&R$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),LOi=R$&&R$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&anc(e,t,r)};Object.defineProperty(R$,"__esModule",{value:!0});LOi(dkr(),R$);LOi(ukr(),R$)});var qOi=I(L6=>{"use strict";p();var cnc=L6&&L6.__classPrivateFieldSet||function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},FOi=L6&&L6.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},mkr,kEt,UOi;Object.defineProperty(L6,"__esModule",{value:!0});L6.AssertError=void 0;L6.Assert=dnc;var QOi=VAe(),lnc=RCr(),unc=pkr(),PEt=class extends lnc.TypeBoxError{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),mkr.add(this),kEt.set(this,void 0),cnc(this,kEt,e,"f"),this.error=r}Errors(){return new QOi.ValueErrorIterator(FOi(this,mkr,"m",UOi).call(this))}};L6.AssertError=PEt;kEt=new WeakMap,mkr=new WeakSet,UOi=a(function*(){this.error&&(yield this.error),yield*FOi(this,kEt,"f")},"_AssertError_Iterator");function BOi(t,e,r){if(!(0,unc.Check)(t,e,r))throw new PEt((0,QOi.Errors)(t,e,r))}a(BOi,"AssertValue");function dnc(...t){return t.length===3?BOi(t[0],t[1],t[2]):BOi(t[0],[],t[1])}a(dnc,"Assert")});var DEt=I(sne=>{"use strict";p();var fnc=sne&&sne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pnc=sne&&sne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fnc(e,t,r)};Object.defineProperty(sne,"__esModule",{value:!0});pnc(qOi(),sne)});var jOi=I(gkr=>{"use strict";p();Object.defineProperty(gkr,"__esModule",{value:!0});gkr.Clone=WAe;var ane=R0();function hnc(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=WAe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=WAe(t[r]);return e}a(hnc,"FromObject");function mnc(t){return t.map(e=>WAe(e))}a(mnc,"FromArray");function gnc(t){return t.slice()}a(gnc,"FromTypedArray");function Anc(t){return new Map(WAe([...t.entries()]))}a(Anc,"FromMap");function ync(t){return new Set(WAe([...t.entries()]))}a(ync,"FromSet");function Enc(t){return new Date(t.toISOString())}a(Enc,"FromDate");function WAe(t){if((0,ane.IsArray)(t))return mnc(t);if((0,ane.IsDate)(t))return Enc(t);if((0,ane.IsTypedArray)(t))return gnc(t);if((0,ane.IsMap)(t))return Anc(t);if((0,ane.IsSet)(t))return ync(t);if((0,ane.IsObject)(t))return hnc(t);if((0,ane.IsValueType)(t))return t;throw new Error("ValueClone: Unable to clone value")}a(WAe,"Clone")});var HD=I(cne=>{"use strict";p();var _nc=cne&&cne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vnc=cne&&cne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_nc(e,t,r)};Object.defineProperty(cne,"__esModule",{value:!0});vnc(jOi(),cne)});var VOi=I(iLe=>{"use strict";p();Object.defineProperty(iLe,"__esModule",{value:!0});iLe.ValueCreateError=void 0;iLe.Create=cic;var Ba=R0(),Cnc=iI(),bnc=HD(),Akr=qD(),HOi=pD(),Snc=Hge(),GOi=Sn(),Tnc=Nf(),Inc=Egt(),f1=class extends Tnc.TypeBoxError{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};iLe.ValueCreateError=f1;function Xa(t){return(0,Inc.IsFunction)(t)?t():(0,bnc.Clone)(t)}a(Xa,"FromDefault");function xnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):{}}a(xnc,"FromAny");function wnc(t,e){return{}}a(wnc,"FromArgument");function Rnc(t,e){if(t.uniqueItems===!0&&!(0,Ba.HasPropertyKey)(t,"default"))throw new f1(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!(0,Ba.HasPropertyKey)(t,"default"))throw new f1(t,"Array with the contains constraint requires a default value");return"default"in t?Xa(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>oI(t.items,e)):[]}a(Rnc,"FromArray");function knc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):(async function*(){})()}a(knc,"FromAsyncIterator");function Pnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):BigInt(0)}a(Pnc,"FromBigInt");function Dnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):!1}a(Dnc,"FromBoolean");function Nnc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);{let r=oI(t.returns,e);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,o]of Object.entries(r)){let s=this;s[n]=o}}}:class{}}}a(Nnc,"FromConstructor");function Mnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(Mnc,"FromDate");function Onc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):()=>oI(t.returns,e)}a(Onc,"FromFunction");function Lnc(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return oI(n,[...e,...r])}a(Lnc,"FromImport");function Bnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.minimum!==void 0?t.minimum:0}a(Bnc,"FromInteger");function Fnc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);{let r=t.allOf.reduce((n,o)=>{let s=oI(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!(0,Cnc.Check)(t,e,r))throw new f1(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(Fnc,"FromIntersect");function Unc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):(function*(){})()}a(Unc,"FromIterator");function Qnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.const}a(Qnc,"FromLiteral");function qnc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"Never types cannot be created. Consider using a default value.")}a(qnc,"FromNever");function jnc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"Not types must have a default value")}a(jnc,"FromNot");function Hnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):null}a(Hnc,"FromNull");function Gnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.minimum!==void 0?t.minimum:0}a(Gnc,"FromNumber");function $nc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=oI(s,e));return n}}a($nc,"FromObject");function Vnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):Promise.resolve(oI(t.item,e))}a(Vnc,"FromPromise");function Wnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):{}}a(Wnc,"FromRecord");function znc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):oI((0,Akr.Deref)(t,e),e)}a(znc,"FromRef");function Ync(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"RegExp types cannot be created. Consider using a default value.")}a(Ync,"FromRegExp");function Knc(t,e){if(t.pattern!==void 0){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new f1(t,"String types with formats must specify a default value")}else return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(Knc,"FromString");function Jnc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(Jnc,"FromSymbol");function Znc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);if(!(0,HOi.IsTemplateLiteralFinite)(t))throw new f1(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return(0,HOi.TemplateLiteralGenerate)(t)[0]}a(Znc,"FromTemplateLiteral");function Xnc(t,e){if($Oi++>aic)throw new f1(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):oI((0,Akr.Deref)(t,e),e)}a(Xnc,"FromThis");function eic(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>oI(t.items[n],e))}a(eic,"FromTuple");function tic(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default)}a(tic,"FromUndefined");function ric(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return oI(t.anyOf[0],e)}a(ric,"FromUnion");function nic(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(nic,"FromUint8Array");function iic(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Xa(t.default):{}}a(iic,"FromUnknown");function oic(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default)}a(oic,"FromVoid");function sic(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Xa(t.default);throw new Error("User defined types must specify a default value")}a(sic,"FromKind");function oI(t,e){let r=(0,Akr.Pushref)(t,e),n=t;switch(n[GOi.Kind]){case"Any":return xnc(n,r);case"Argument":return wnc(n,r);case"Array":return Rnc(n,r);case"AsyncIterator":return knc(n,r);case"BigInt":return Pnc(n,r);case"Boolean":return Dnc(n,r);case"Constructor":return Nnc(n,r);case"Date":return Mnc(n,r);case"Function":return Onc(n,r);case"Import":return Lnc(n,r);case"Integer":return Bnc(n,r);case"Intersect":return Fnc(n,r);case"Iterator":return Unc(n,r);case"Literal":return Qnc(n,r);case"Never":return qnc(n,r);case"Not":return jnc(n,r);case"Null":return Hnc(n,r);case"Number":return Gnc(n,r);case"Object":return $nc(n,r);case"Promise":return Vnc(n,r);case"Record":return Wnc(n,r);case"Ref":return znc(n,r);case"RegExp":return Ync(n,r);case"String":return Knc(n,r);case"Symbol":return Jnc(n,r);case"TemplateLiteral":return Znc(n,r);case"This":return Xnc(n,r);case"Tuple":return eic(n,r);case"Undefined":return tic(n,r);case"Union":return ric(n,r);case"Uint8Array":return nic(n,r);case"Unknown":return iic(n,r);case"Void":return oic(n,r);default:if(!Snc.TypeRegistry.Has(n[GOi.Kind]))throw new f1(n,"Unknown type");return sic(n,r)}}a(oI,"Visit");var aic=512,$Oi=0;function cic(...t){return $Oi=0,t.length===2?oI(t[0],t[1]):oI(t[0],[])}a(cic,"Create")});var NEt=I(lne=>{"use strict";p();var lic=lne&&lne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uic=lne&&lne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lic(e,t,r)};Object.defineProperty(lne,"__esModule",{value:!0});uic(VOi(),lne)});var KOi=I(aLe=>{"use strict";p();Object.defineProperty(aLe,"__esModule",{value:!0});aLe.ValueCastError=void 0;aLe.Cast=YOi;var QR=R0(),dic=Nf(),MEt=Sn(),k$=NEt(),sI=iI(),une=HD(),sLe=qD(),oLe=class extends dic.TypeBoxError{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};aLe.ValueCastError=oLe;function WOi(t,e,r){if(t[MEt.Kind]==="Object"&&typeof r=="object"&&!(0,QR.IsNull)(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[MEt.Kind]==="Literal"&&u.const===r[l]?100:0,f=(0,sI.Check)(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[MEt.Kind]==="Union"){let o=t.anyOf.map(s=>(0,sLe.Deref)(s,e)).map(s=>WOi(s,e,r));return Math.max(...o)}else return(0,sI.Check)(t,e,r)?1:0}a(WOi,"ScoreUnion");function fic(t,e,r){let n=t.anyOf.map(c=>(0,sLe.Deref)(c,e)),[o,s]=[n[0],0];for(let c of n){let l=WOi(c,e,r);l>s&&(o=c,s=l)}return o}a(fic,"SelectUnion");function pic(t,e,r){if("default"in t)return typeof r=="function"?t.default:(0,une.Clone)(t.default);{let n=fic(t,e,r);return YOi(n,e,r)}}a(pic,"CastUnion");function hic(t,e,r){return(0,sI.Check)(t,e,r)?(0,une.Clone)(r):(0,k$.Create)(t,e)}a(hic,"DefaultClone");function mic(t,e,r){return(0,sI.Check)(t,e,r)?r:(0,k$.Create)(t,e)}a(mic,"Default");function gic(t,e,r){if((0,sI.Check)(t,e,r))return(0,une.Clone)(r);let n=(0,QR.IsArray)(r)?(0,une.Clone)(r):(0,k$.Create)(t,e),o=(0,QR.IsNumber)(t.minItems)&&n.lengthnull)]:n,c=((0,QR.IsNumber)(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>GD(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!(0,sI.Check)(t,e,l))throw new oLe(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(gic,"FromArray");function Aic(t,e,r){if((0,sI.Check)(t,e,r))return(0,k$.Create)(t,e);let n=new Set(t.returns.required||[]),o=a(function(){},"result");for(let[s,c]of Object.entries(t.returns.properties))!n.has(s)&&r.prototype[s]===void 0||(o.prototype[s]=GD(c,e,r.prototype[s]));return o}a(Aic,"FromConstructor");function yic(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return GD(o,[...e,...n],r)}a(yic,"FromImport");function zOi(t,e){return(0,QR.IsObject)(t)&&!(0,QR.IsObject)(e)||!(0,QR.IsObject)(t)&&(0,QR.IsObject)(e)?t:!(0,QR.IsObject)(t)||!(0,QR.IsObject)(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?zOi(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(zOi,"IntersectAssign");function Eic(t,e,r){if((0,sI.Check)(t,e,r))return r;let n=(0,k$.Create)(t,e),o=zOi(n,r);return(0,sI.Check)(t,e,o)?o:n}a(Eic,"FromIntersect");function _ic(t,e,r){throw new oLe(t,"Never types cannot be cast")}a(_ic,"FromNever");function vic(t,e,r){if((0,sI.Check)(t,e,r))return r;if(r===null||typeof r!="object")return(0,k$.Create)(t,e);let n=new Set(t.required||[]),o={};for(let[s,c]of Object.entries(t.properties))!n.has(s)&&r[s]===void 0||(o[s]=GD(c,e,r[s]));if(typeof t.additionalProperties=="object"){let s=Object.getOwnPropertyNames(t.properties);for(let c of Object.getOwnPropertyNames(r))s.includes(c)||(o[c]=GD(t.additionalProperties,e,r[c]))}return o}a(vic,"FromObject");function Cic(t,e,r){if((0,sI.Check)(t,e,r))return(0,une.Clone)(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return(0,k$.Create)(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=GD(o,e,l);return s}a(Cic,"FromRecord");function bic(t,e,r){return GD((0,sLe.Deref)(t,e),e,r)}a(bic,"FromRef");function Sic(t,e,r){return GD((0,sLe.Deref)(t,e),e,r)}a(Sic,"FromThis");function Tic(t,e,r){return(0,sI.Check)(t,e,r)?(0,une.Clone)(r):(0,QR.IsArray)(r)?t.items===void 0?[]:t.items.map((n,o)=>GD(n,e,r[o])):(0,k$.Create)(t,e)}a(Tic,"FromTuple");function Iic(t,e,r){return(0,sI.Check)(t,e,r)?(0,une.Clone)(r):pic(t,e,r)}a(Iic,"FromUnion");function GD(t,e,r){let n=(0,QR.IsString)(t.$id)?(0,sLe.Pushref)(t,e):e,o=t;switch(t[MEt.Kind]){case"Array":return gic(o,n,r);case"Constructor":return Aic(o,n,r);case"Import":return yic(o,n,r);case"Intersect":return Eic(o,n,r);case"Never":return _ic(o,n,r);case"Object":return vic(o,n,r);case"Record":return Cic(o,n,r);case"Ref":return bic(o,n,r);case"This":return Sic(o,n,r);case"Tuple":return Tic(o,n,r);case"Union":return Iic(o,n,r);case"Date":case"Symbol":case"Uint8Array":return hic(t,e,r);default:return mic(o,n,r)}}a(GD,"Visit");function YOi(...t){return t.length===3?GD(t[0],t[1],t[2]):GD(t[0],[],t[1])}a(YOi,"Cast")});var OEt=I(dne=>{"use strict";p();var xic=dne&&dne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wic=dne&&dne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xic(e,t,r)};Object.defineProperty(dne,"__esModule",{value:!0});wic(KOi(),dne)});var ZOi=I(Ekr=>{"use strict";p();Object.defineProperty(Ekr,"__esModule",{value:!0});Ekr.Clean=qic;var Ric=mD(),LEt=iI(),kic=HD(),ykr=qD(),JOi=Sn(),$D=R0(),BEt=vs();function Pic(t){return(0,BEt.IsKind)(t)&&t[JOi.Kind]!=="Unsafe"}a(Pic,"IsCheckable");function Dic(t,e,r){return(0,$D.IsArray)(r)?r.map(n=>p1(t.items,e,n)):r}a(Dic,"FromArray");function Nic(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return p1(o,[...e,...n],r)}a(Nic,"FromImport");function Mic(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>p1(l,e,(0,kic.Clone)(r))).reduce((l,u)=>(0,$D.IsObject)(u)?{...l,...u}:u,{});if(!(0,$D.IsObject)(r)||!(0,$D.IsObject)(s)||!(0,BEt.IsKind)(n))return s;let c=(0,Ric.KeyOfPropertyKeys)(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||(0,LEt.Check)(n,e,r[l])&&(s[l]=p1(n,e,r[l]));return s}a(Mic,"FromIntersect");function Oic(t,e,r){if(!(0,$D.IsObject)(r)||(0,$D.IsArray)(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if((0,$D.HasPropertyKey)(t.properties,o)){r[o]=p1(t.properties[o],e,r[o]);continue}if((0,BEt.IsKind)(n)&&(0,LEt.Check)(n,e,r[o])){r[o]=p1(n,e,r[o]);continue}delete r[o]}return r}a(Oic,"FromObject");function Lic(t,e,r){if(!(0,$D.IsObject)(r))return r;let n=t.additionalProperties,o=Object.getOwnPropertyNames(r),[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of o){if(l.test(u)){r[u]=p1(c,e,r[u]);continue}if((0,BEt.IsKind)(n)&&(0,LEt.Check)(n,e,r[u])){r[u]=p1(n,e,r[u]);continue}delete r[u]}return r}a(Lic,"FromRecord");function Bic(t,e,r){return p1((0,ykr.Deref)(t,e),e,r)}a(Bic,"FromRef");function Fic(t,e,r){return p1((0,ykr.Deref)(t,e),e,r)}a(Fic,"FromThis");function Uic(t,e,r){if(!(0,$D.IsArray)(r))return r;if((0,$D.IsUndefined)(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(Uic,"FromTuple");function Qic(t,e,r){for(let n of t.anyOf)if(Pic(n)&&(0,LEt.Check)(n,e,r))return p1(n,e,r);return r}a(Qic,"FromUnion");function p1(t,e,r){let n=(0,$D.IsString)(t.$id)?(0,ykr.Pushref)(t,e):e,o=t;switch(o[JOi.Kind]){case"Array":return Dic(o,n,r);case"Import":return Nic(o,n,r);case"Intersect":return Mic(o,n,r);case"Object":return Oic(o,n,r);case"Record":return Lic(o,n,r);case"Ref":return Bic(o,n,r);case"This":return Fic(o,n,r);case"Tuple":return Uic(o,n,r);case"Union":return Qic(o,n,r);default:return r}}a(p1,"Visit");function qic(...t){return t.length===3?p1(t[0],t[1],t[2]):p1(t[0],[],t[1])}a(qic,"Clean")});var FEt=I(fne=>{"use strict";p();var jic=fne&&fne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Hic=fne&&fne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jic(e,t,r)};Object.defineProperty(fne,"__esModule",{value:!0});Hic(ZOi(),fne)});var n5i=I(vkr=>{"use strict";p();Object.defineProperty(vkr,"__esModule",{value:!0});vkr.Convert=Ioc;var Gic=HD(),XOi=iI(),_kr=qD(),$ic=Sn(),Fa=R0();function UEt(t){return(0,Fa.IsString)(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(UEt,"IsStringNumeric");function Vic(t){return(0,Fa.IsBigInt)(t)||(0,Fa.IsBoolean)(t)||(0,Fa.IsNumber)(t)}a(Vic,"IsValueToString");function cLe(t){return t===!0||(0,Fa.IsNumber)(t)&&t===1||(0,Fa.IsBigInt)(t)&&t===BigInt("1")||(0,Fa.IsString)(t)&&(t.toLowerCase()==="true"||t==="1")}a(cLe,"IsValueTrue");function lLe(t){return t===!1||(0,Fa.IsNumber)(t)&&(t===0||Object.is(t,-0))||(0,Fa.IsBigInt)(t)&&t===BigInt("0")||(0,Fa.IsString)(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(lLe,"IsValueFalse");function Wic(t){return(0,Fa.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(Wic,"IsTimeStringWithTimeZone");function zic(t){return(0,Fa.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(zic,"IsTimeStringWithoutTimeZone");function Yic(t){return(0,Fa.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(Yic,"IsDateTimeStringWithTimeZone");function Kic(t){return(0,Fa.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(Kic,"IsDateTimeStringWithoutTimeZone");function Jic(t){return(0,Fa.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(Jic,"IsDateString");function Zic(t,e){let r=t5i(t);return r===e?r:t}a(Zic,"TryConvertLiteralString");function Xic(t,e){let r=r5i(t);return r===e?r:t}a(Xic,"TryConvertLiteralNumber");function eoc(t,e){let r=e5i(t);return r===e?r:t}a(eoc,"TryConvertLiteralBoolean");function toc(t,e){return(0,Fa.IsString)(t.const)?Zic(e,t.const):(0,Fa.IsNumber)(t.const)?Xic(e,t.const):(0,Fa.IsBoolean)(t.const)?eoc(e,t.const):e}a(toc,"TryConvertLiteral");function e5i(t){return cLe(t)?!0:lLe(t)?!1:t}a(e5i,"TryConvertBoolean");function roc(t){let e=a(r=>r.split(".")[0],"truncateInteger");return UEt(t)?BigInt(e(t)):(0,Fa.IsNumber)(t)?BigInt(Math.trunc(t)):lLe(t)?BigInt(0):cLe(t)?BigInt(1):t}a(roc,"TryConvertBigInt");function t5i(t){return(0,Fa.IsSymbol)(t)&&t.description!==void 0?t.description.toString():Vic(t)?t.toString():t}a(t5i,"TryConvertString");function r5i(t){return UEt(t)?parseFloat(t):cLe(t)?1:lLe(t)?0:t}a(r5i,"TryConvertNumber");function noc(t){return UEt(t)?parseInt(t):(0,Fa.IsNumber)(t)?Math.trunc(t):cLe(t)?1:lLe(t)?0:t}a(noc,"TryConvertInteger");function ioc(t){return(0,Fa.IsString)(t)&&t.toLowerCase()==="null"?null:t}a(ioc,"TryConvertNull");function ooc(t){return(0,Fa.IsString)(t)&&t==="undefined"?void 0:t}a(ooc,"TryConvertUndefined");function soc(t){return(0,Fa.IsDate)(t)?t:(0,Fa.IsNumber)(t)?new Date(t):cLe(t)?new Date(1):lLe(t)?new Date(0):UEt(t)?new Date(parseInt(t)):zic(t)?new Date(`1970-01-01T${t}.000Z`):Wic(t)?new Date(`1970-01-01T${t}`):Kic(t)?new Date(`${t}.000Z`):Yic(t)?new Date(t):Jic(t)?new Date(`${t}T00:00:00.000Z`):t}a(soc,"TryConvertDate");function aoc(t,e,r){return((0,Fa.IsArray)(r)?r:[r]).map(o=>VD(t.items,e,o))}a(aoc,"FromArray");function coc(t,e,r){return roc(r)}a(coc,"FromBigInt");function loc(t,e,r){return e5i(r)}a(loc,"FromBoolean");function uoc(t,e,r){return soc(r)}a(uoc,"FromDate");function doc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return VD(o,[...e,...n],r)}a(doc,"FromImport");function foc(t,e,r){return noc(r)}a(foc,"FromInteger");function poc(t,e,r){return t.allOf.reduce((n,o)=>VD(o,e,n),r)}a(poc,"FromIntersect");function hoc(t,e,r){return toc(t,r)}a(hoc,"FromLiteral");function moc(t,e,r){return ioc(r)}a(moc,"FromNull");function goc(t,e,r){return r5i(r)}a(goc,"FromNumber");function Aoc(t,e,r){if(!(0,Fa.IsObject)(r)||(0,Fa.IsArray)(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))(0,Fa.HasPropertyKey)(r,n)&&(r[n]=VD(t.properties[n],e,r[n]));return r}a(Aoc,"FromObject");function yoc(t,e,r){if(!((0,Fa.IsObject)(r)&&!(0,Fa.IsArray)(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=VD(s,e,l);return r}a(yoc,"FromRecord");function Eoc(t,e,r){return VD((0,_kr.Deref)(t,e),e,r)}a(Eoc,"FromRef");function _oc(t,e,r){return t5i(r)}a(_oc,"FromString");function voc(t,e,r){return(0,Fa.IsString)(r)||(0,Fa.IsNumber)(r)?Symbol(r):r}a(voc,"FromSymbol");function Coc(t,e,r){return VD((0,_kr.Deref)(t,e),e,r)}a(Coc,"FromThis");function boc(t,e,r){return(0,Fa.IsArray)(r)&&!(0,Fa.IsUndefined)(t.items)?r.map((o,s)=>s{"use strict";p();var xoc=pne&&pne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),woc=pne&&pne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xoc(e,t,r)};Object.defineProperty(pne,"__esModule",{value:!0});woc(n5i(),pne)});var a5i=I(hne=>{"use strict";p();Object.defineProperty(hne,"__esModule",{value:!0});hne.TransformDecodeError=hne.TransformDecodeCheckError=void 0;hne.TransformDecode=qoc;var Roc=T5e(),i5i=Sn(),o5i=Nf(),s5i=mD(),bkr=qD(),koc=iI(),B6=R0(),uLe=vs(),Ckr=class extends o5i.TypeBoxError{static{a(this,"TransformDecodeCheckError")}constructor(e,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=e,this.value=r,this.error=n}};hne.TransformDecodeCheckError=Ckr;var qEt=class extends o5i.TypeBoxError{static{a(this,"TransformDecodeError")}constructor(e,r,n,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=e,this.path=r,this.value=n,this.error=o}};hne.TransformDecodeError=qEt;function Yd(t,e,r){try{return(0,uLe.IsTransform)(t)?t[i5i.TransformKind].Decode(r):r}catch(n){throw new qEt(t,e,r,n)}}a(Yd,"Default");function Poc(t,e,r,n){return(0,B6.IsArray)(n)?Yd(t,r,n.map((o,s)=>WD(t.items,e,`${r}/${s}`,o))):Yd(t,r,n)}a(Poc,"FromArray");function Doc(t,e,r,n){if(!(0,B6.IsObject)(n)||(0,B6.IsValueType)(n))return Yd(t,r,n);let o=(0,s5i.KeyOfPropertyEntries)(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=WD(h,e,`${r}/${f}`,c[f]));if(!(0,uLe.IsTransform)(t.unevaluatedProperties))return Yd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=Yd(u,`${r}/${f}`,d[f]));return Yd(t,r,d)}a(Doc,"FromIntersect");function Noc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=WD(s,[...e,...o],r,n);return Yd(t,r,c)}a(Noc,"FromImport");function Moc(t,e,r,n){return Yd(t,r,WD(t.not,e,r,n))}a(Moc,"FromNot");function Ooc(t,e,r,n){if(!(0,B6.IsObject)(n))return Yd(t,r,n);let o=(0,s5i.KeyOfPropertyKeys)(t),s={...n};for(let d of o)(0,B6.HasPropertyKey)(s,d)&&((0,B6.IsUndefined)(s[d])&&(!(0,uLe.IsUndefined)(t.properties[d])||Roc.TypeSystemPolicy.IsExactOptionalProperty(s,d))||(s[d]=WD(t.properties[d],e,`${r}/${d}`,s[d])));if(!(0,uLe.IsSchema)(t.additionalProperties))return Yd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=Yd(l,`${r}/${d}`,u[d]));return Yd(t,r,u)}a(Ooc,"FromObject");function Loc(t,e,r,n){if(!(0,B6.IsObject)(n))return Yd(t,r,n);let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=new RegExp(o),c={...n};for(let f of Object.getOwnPropertyNames(n))s.test(f)&&(c[f]=WD(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!(0,uLe.IsSchema)(t.additionalProperties))return Yd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=Yd(u,`${r}/${f}`,d[f]));return Yd(t,r,d)}a(Loc,"FromRecord");function Boc(t,e,r,n){let o=(0,bkr.Deref)(t,e);return Yd(t,r,WD(o,e,r,n))}a(Boc,"FromRef");function Foc(t,e,r,n){let o=(0,bkr.Deref)(t,e);return Yd(t,r,WD(o,e,r,n))}a(Foc,"FromThis");function Uoc(t,e,r,n){return(0,B6.IsArray)(n)&&(0,B6.IsArray)(t.items)?Yd(t,r,t.items.map((o,s)=>WD(o,e,`${r}/${s}`,n[s]))):Yd(t,r,n)}a(Uoc,"FromTuple");function Qoc(t,e,r,n){for(let o of t.anyOf){if(!(0,koc.Check)(o,e,n))continue;let s=WD(o,e,r,n);return Yd(t,r,s)}return Yd(t,r,n)}a(Qoc,"FromUnion");function WD(t,e,r,n){let o=(0,bkr.Pushref)(t,e),s=t;switch(t[i5i.Kind]){case"Array":return Poc(s,o,r,n);case"Import":return Noc(s,o,r,n);case"Intersect":return Doc(s,o,r,n);case"Not":return Moc(s,o,r,n);case"Object":return Ooc(s,o,r,n);case"Record":return Loc(s,o,r,n);case"Ref":return Boc(s,o,r,n);case"Symbol":return Yd(s,r,n);case"This":return Foc(s,o,r,n);case"Tuple":return Uoc(s,o,r,n);case"Union":return Qoc(s,o,r,n);default:return Yd(s,r,n)}}a(WD,"Visit");function qoc(t,e,r){return WD(t,e,"",r)}a(qoc,"TransformDecode")});var f5i=I(mne=>{"use strict";p();Object.defineProperty(mne,"__esModule",{value:!0});mne.TransformEncodeError=mne.TransformEncodeCheckError=void 0;mne.TransformEncode=Xoc;var joc=T5e(),l5i=Sn(),u5i=Nf(),d5i=mD(),Tkr=qD(),c5i=iI(),P$=R0(),dLe=vs(),Skr=class extends u5i.TypeBoxError{static{a(this,"TransformEncodeCheckError")}constructor(e,r,n){super("The encoded value does not match the expected schema"),this.schema=e,this.value=r,this.error=n}};mne.TransformEncodeCheckError=Skr;var jEt=class extends u5i.TypeBoxError{static{a(this,"TransformEncodeError")}constructor(e,r,n,o){super(`${o instanceof Error?o.message:"Unknown error"}`),this.schema=e,this.path=r,this.value=n,this.error=o}};mne.TransformEncodeError=jEt;function yy(t,e,r){try{return(0,dLe.IsTransform)(t)?t[l5i.TransformKind].Encode(r):r}catch(n){throw new jEt(t,e,r,n)}}a(yy,"Default");function Hoc(t,e,r,n){let o=yy(t,r,n);return(0,P$.IsArray)(o)?o.map((s,c)=>zD(t.items,e,`${r}/${c}`,s)):o}a(Hoc,"FromArray");function Goc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=yy(t,r,n);return zD(s,[...e,...o],r,c)}a(Goc,"FromImport");function $oc(t,e,r,n){let o=yy(t,r,n);if(!(0,P$.IsObject)(n)||(0,P$.IsValueType)(n))return o;let s=(0,d5i.KeyOfPropertyEntries)(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=zD(m,e,`${r}/${h}`,l[h]));if(!(0,dLe.IsTransform)(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=yy(d,`${r}/${h}`,f[h]));return f}a($oc,"FromIntersect");function Voc(t,e,r,n){return yy(t.not,r,yy(t,r,n))}a(Voc,"FromNot");function Woc(t,e,r,n){let o=yy(t,r,n);if(!(0,P$.IsObject)(o))return o;let s=(0,d5i.KeyOfPropertyKeys)(t),c={...o};for(let f of s)(0,P$.HasPropertyKey)(c,f)&&((0,P$.IsUndefined)(c[f])&&(!(0,dLe.IsUndefined)(t.properties[f])||joc.TypeSystemPolicy.IsExactOptionalProperty(c,f))||(c[f]=zD(t.properties[f],e,`${r}/${f}`,c[f])));if(!(0,dLe.IsSchema)(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=yy(u,`${r}/${f}`,d[f]));return d}a(Woc,"FromObject");function zoc(t,e,r,n){let o=yy(t,r,n);if(!(0,P$.IsObject)(n))return o;let s=Object.getOwnPropertyNames(t.patternProperties)[0],c=new RegExp(s),l={...o};for(let h of Object.getOwnPropertyNames(n))c.test(h)&&(l[h]=zD(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!(0,dLe.IsSchema)(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=yy(d,`${r}/${h}`,f[h]));return f}a(zoc,"FromRecord");function Yoc(t,e,r,n){let o=(0,Tkr.Deref)(t,e),s=zD(o,e,r,n);return yy(t,r,s)}a(Yoc,"FromRef");function Koc(t,e,r,n){let o=(0,Tkr.Deref)(t,e),s=zD(o,e,r,n);return yy(t,r,s)}a(Koc,"FromThis");function Joc(t,e,r,n){let o=yy(t,r,n);return(0,P$.IsArray)(t.items)?t.items.map((s,c)=>zD(s,e,`${r}/${c}`,o[c])):[]}a(Joc,"FromTuple");function Zoc(t,e,r,n){for(let o of t.anyOf){if(!(0,c5i.Check)(o,e,n))continue;let s=zD(o,e,r,n);return yy(t,r,s)}for(let o of t.anyOf){let s=zD(o,e,r,n);if((0,c5i.Check)(t,e,s))return yy(t,r,s)}return yy(t,r,n)}a(Zoc,"FromUnion");function zD(t,e,r,n){let o=(0,Tkr.Pushref)(t,e),s=t;switch(t[l5i.Kind]){case"Array":return Hoc(s,o,r,n);case"Import":return Goc(s,o,r,n);case"Intersect":return $oc(s,o,r,n);case"Not":return Voc(s,o,r,n);case"Object":return Woc(s,o,r,n);case"Record":return zoc(s,o,r,n);case"Ref":return Yoc(s,o,r,n);case"This":return Koc(s,o,r,n);case"Tuple":return Joc(s,o,r,n);case"Union":return Zoc(s,o,r,n);default:return yy(s,r,n)}}a(zD,"Visit");function Xoc(t,e,r){return zD(t,e,"",r)}a(Xoc,"TransformEncode")});var p5i=I(wkr=>{"use strict";p();Object.defineProperty(wkr,"__esModule",{value:!0});wkr.HasTransform=Asc;var xkr=qD(),esc=Sn(),Rm=vs(),tsc=R0();function rsc(t,e){return(0,Rm.IsTransform)(t)||D0(t.items,e)}a(rsc,"FromArray");function nsc(t,e){return(0,Rm.IsTransform)(t)||D0(t.items,e)}a(nsc,"FromAsyncIterator");function isc(t,e){return(0,Rm.IsTransform)(t)||D0(t.returns,e)||t.parameters.some(r=>D0(r,e))}a(isc,"FromConstructor");function osc(t,e){return(0,Rm.IsTransform)(t)||D0(t.returns,e)||t.parameters.some(r=>D0(r,e))}a(osc,"FromFunction");function ssc(t,e){return(0,Rm.IsTransform)(t)||(0,Rm.IsTransform)(t.unevaluatedProperties)||t.allOf.some(r=>D0(r,e))}a(ssc,"FromIntersect");function asc(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return(0,Rm.IsTransform)(t)||D0(n,[...r,...e])}a(asc,"FromImport");function csc(t,e){return(0,Rm.IsTransform)(t)||D0(t.items,e)}a(csc,"FromIterator");function lsc(t,e){return(0,Rm.IsTransform)(t)||D0(t.not,e)}a(lsc,"FromNot");function usc(t,e){return(0,Rm.IsTransform)(t)||Object.values(t.properties).some(r=>D0(r,e))||(0,Rm.IsSchema)(t.additionalProperties)&&D0(t.additionalProperties,e)}a(usc,"FromObject");function dsc(t,e){return(0,Rm.IsTransform)(t)||D0(t.item,e)}a(dsc,"FromPromise");function fsc(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return(0,Rm.IsTransform)(t)||D0(n,e)||(0,Rm.IsSchema)(t.additionalProperties)&&(0,Rm.IsTransform)(t.additionalProperties)}a(fsc,"FromRecord");function psc(t,e){return(0,Rm.IsTransform)(t)?!0:D0((0,xkr.Deref)(t,e),e)}a(psc,"FromRef");function hsc(t,e){return(0,Rm.IsTransform)(t)?!0:D0((0,xkr.Deref)(t,e),e)}a(hsc,"FromThis");function msc(t,e){return(0,Rm.IsTransform)(t)||!(0,tsc.IsUndefined)(t.items)&&t.items.some(r=>D0(r,e))}a(msc,"FromTuple");function gsc(t,e){return(0,Rm.IsTransform)(t)||t.anyOf.some(r=>D0(r,e))}a(gsc,"FromUnion");function D0(t,e){let r=(0,xkr.Pushref)(t,e),n=t;if(t.$id&&Ikr.has(t.$id))return!1;switch(t.$id&&Ikr.add(t.$id),t[esc.Kind]){case"Array":return rsc(n,r);case"AsyncIterator":return nsc(n,r);case"Constructor":return isc(n,r);case"Function":return osc(n,r);case"Import":return asc(n,r);case"Intersect":return ssc(n,r);case"Iterator":return csc(n,r);case"Not":return lsc(n,r);case"Object":return usc(n,r);case"Promise":return dsc(n,r);case"Record":return fsc(n,r);case"Ref":return psc(n,r);case"This":return hsc(n,r);case"Tuple":return msc(n,r);case"Union":return gsc(n,r);default:return(0,Rm.IsTransform)(t)}}a(D0,"Visit");var Ikr=new Set;function Asc(t,e){return Ikr.clear(),D0(t,e)}a(Asc,"HasTransform")});var fLe=I(F6=>{"use strict";p();var ysc=F6&&F6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Rkr=F6&&F6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ysc(e,t,r)};Object.defineProperty(F6,"__esModule",{value:!0});Rkr(a5i(),F6);Rkr(f5i(),F6);Rkr(p5i(),F6)});var h5i=I(Pkr=>{"use strict";p();Object.defineProperty(Pkr,"__esModule",{value:!0});Pkr.Decode=vsc;var kkr=fLe(),Esc=iI(),_sc=VAe();function vsc(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]];if(!(0,Esc.Check)(e,r,n))throw new kkr.TransformDecodeCheckError(e,n,(0,_sc.Errors)(e,r,n).First());return(0,kkr.HasTransform)(e,r)?(0,kkr.TransformDecode)(e,r,n):n}a(vsc,"Decode")});var Dkr=I(gne=>{"use strict";p();var Csc=gne&&gne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bsc=gne&&gne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Csc(e,t,r)};Object.defineProperty(gne,"__esModule",{value:!0});bsc(h5i(),gne)});var g5i=I(Okr=>{"use strict";p();Object.defineProperty(Okr,"__esModule",{value:!0});Okr.Default=Bsc;var Ssc=iI(),m5i=HD(),Mkr=qD(),Tsc=Sn(),h1=R0(),Isc=vs();function U6(t,e){let r=(0,h1.HasPropertyKey)(t,"default")?t.default:void 0,n=(0,h1.IsFunction)(r)?r():(0,m5i.Clone)(r);return(0,h1.IsUndefined)(e)?n:(0,h1.IsObject)(e)&&(0,h1.IsObject)(n)?Object.assign(n,e):e}a(U6,"ValueOrDefault");function Nkr(t){return(0,Isc.IsKind)(t)&&"default"in t}a(Nkr,"HasDefaultProperty");function xsc(t,e,r){if((0,h1.IsArray)(r)){for(let o=0;o{let c=Lv(s,e,n);return(0,h1.IsObject)(c)?{...o,...c}:c},{})}a(ksc,"FromIntersect");function Psc(t,e,r){let n=U6(t,r);if(!(0,h1.IsObject)(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=Lv(t.properties[s],e,n[s]);(0,h1.IsUndefined)(c)||(n[s]=Lv(t.properties[s],e,n[s]))}if(!Nkr(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=Lv(t.additionalProperties,e,n[s]));return n}a(Psc,"FromObject");function Dsc(t,e,r){let n=U6(t,r);if(!(0,h1.IsObject)(n))return n;let o=t.additionalProperties,[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of Object.getOwnPropertyNames(n))l.test(u)&&Nkr(c)&&(n[u]=Lv(c,e,n[u]));if(!Nkr(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=Lv(o,e,n[u]));return n}a(Dsc,"FromRecord");function Nsc(t,e,r){return Lv((0,Mkr.Deref)(t,e),e,U6(t,r))}a(Nsc,"FromRef");function Msc(t,e,r){return Lv((0,Mkr.Deref)(t,e),e,r)}a(Msc,"FromThis");function Osc(t,e,r){let n=U6(t,r);if(!(0,h1.IsArray)(n)||(0,h1.IsUndefined)(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;c{"use strict";p();var Fsc=Ane&&Ane.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Usc=Ane&&Ane.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Fsc(e,t,r)};Object.defineProperty(Ane,"__esModule",{value:!0});Usc(g5i(),Ane)});var E5i=I(YD=>{"use strict";p();Object.defineProperty(YD,"__esModule",{value:!0});YD.ValuePointerRootDeleteError=YD.ValuePointerRootSetError=void 0;YD.Format=pLe;YD.Set=Qsc;YD.Delete=qsc;YD.Has=jsc;YD.Get=Hsc;var y5i=Nf(),GEt=class extends y5i.TypeBoxError{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}};YD.ValuePointerRootSetError=GEt;var $Et=class extends y5i.TypeBoxError{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};YD.ValuePointerRootDeleteError=$Et;function A5i(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(A5i,"Escape");function*pLe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;n{"use strict";p();var Gsc=cL&&cL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$sc=cL&&cL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Vsc=cL&&cL.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(Lkr,"__esModule",{value:!0});Lkr.Equal=WEt;var Q6=R0();function Wsc(t,e){if(!(0,Q6.IsObject)(e))return!1;let r=[...Object.keys(t),...Object.getOwnPropertySymbols(t)],n=[...Object.keys(e),...Object.getOwnPropertySymbols(e)];return r.length!==n.length?!1:r.every(o=>WEt(t[o],e[o]))}a(Wsc,"ObjectType");function zsc(t,e){return(0,Q6.IsDate)(e)&&t.getTime()===e.getTime()}a(zsc,"DateType");function Ysc(t,e){return!(0,Q6.IsArray)(e)||t.length!==e.length?!1:t.every((r,n)=>WEt(r,e[n]))}a(Ysc,"ArrayType");function Ksc(t,e){return!(0,Q6.IsTypedArray)(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>WEt(r,e[n]))}a(Ksc,"TypedArrayType");function Jsc(t,e){return t===e}a(Jsc,"ValueType");function WEt(t,e){if((0,Q6.IsDate)(t))return zsc(t,e);if((0,Q6.IsTypedArray)(t))return Ksc(t,e);if((0,Q6.IsArray)(t))return Ysc(t,e);if((0,Q6.IsObject)(t))return Wsc(t,e);if((0,Q6.IsValueType)(t))return Jsc(t,e);throw new Error("ValueEquals: Unable to compare value")}a(WEt,"Equal")});var S5i=I(Ey=>{"use strict";p();Object.defineProperty(Ey,"__esModule",{value:!0});Ey.ValueDiffError=Ey.Edit=Ey.Delete=Ey.Update=Ey.Insert=void 0;Ey.Diff=oac;Ey.Patch=cac;var lL=R0(),Fkr=VEt(),Ukr=HD(),Zsc=Bkr(),Xsc=Nf(),Qkr=UE(),qkr=xv(),jkr=QG(),v5i=VG(),eac=Ip();Ey.Insert=(0,qkr.Object)({type:(0,Qkr.Literal)("insert"),path:(0,jkr.String)(),value:(0,v5i.Unknown)()});Ey.Update=(0,qkr.Object)({type:(0,Qkr.Literal)("update"),path:(0,jkr.String)(),value:(0,v5i.Unknown)()});Ey.Delete=(0,qkr.Object)({type:(0,Qkr.Literal)("delete"),path:(0,jkr.String)()});Ey.Edit=(0,eac.Union)([Ey.Insert,Ey.Update,Ey.Delete]);var hLe=class extends Xsc.TypeBoxError{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};Ey.ValueDiffError=hLe;function zEt(t,e){return{type:"update",path:t,value:e}}a(zEt,"CreateUpdate");function C5i(t,e){return{type:"insert",path:t,value:e}}a(C5i,"CreateInsert");function b5i(t){return{type:"delete",path:t}}a(b5i,"CreateDelete");function _5i(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new hLe(t,"Cannot diff objects with symbols")}a(_5i,"AssertDiffable");function*tac(t,e,r){if(_5i(e),_5i(r),!(0,lL.IsStandardObject)(r))return yield zEt(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)(0,lL.HasPropertyKey)(e,s)||(yield C5i(`${t}/${s}`,r[s]));for(let s of n)(0,lL.HasPropertyKey)(r,s)&&((0,Zsc.Equal)(e,r)||(yield*YEt(`${t}/${s}`,e[s],r[s])));for(let s of n)(0,lL.HasPropertyKey)(r,s)||(yield b5i(`${t}/${s}`))}a(tac,"ObjectType");function*rac(t,e,r){if(!(0,lL.IsArray)(r))return yield zEt(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(sac,"IsRootUpdate");function aac(t){return t.length===0}a(aac,"IsIdentity");function cac(t,e){if(sac(e))return(0,Ukr.Clone)(e[0].value);if(aac(e))return(0,Ukr.Clone)(t);let r=(0,Ukr.Clone)(t);for(let n of e)switch(n.type){case"insert":{Fkr.ValuePointer.Set(r,n.path,n.value);break}case"update":{Fkr.ValuePointer.Set(r,n.path,n.value);break}case"delete":{Fkr.ValuePointer.Delete(r,n.path);break}}return r}a(cac,"Patch")});var Hkr=I(yne=>{"use strict";p();var lac=yne&&yne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uac=yne&&yne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lac(e,t,r)};Object.defineProperty(yne,"__esModule",{value:!0});uac(S5i(),yne)});var T5i=I($kr=>{"use strict";p();Object.defineProperty($kr,"__esModule",{value:!0});$kr.Encode=pac;var Gkr=fLe(),dac=iI(),fac=VAe();function pac(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=(0,Gkr.HasTransform)(e,r)?(0,Gkr.TransformEncode)(e,r,n):n;if(!(0,dac.Check)(e,r,o))throw new Gkr.TransformEncodeCheckError(e,o,(0,fac.Errors)(e,r,o).First());return o}a(pac,"Encode")});var Vkr=I(Ene=>{"use strict";p();var hac=Ene&&Ene.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mac=Ene&&Ene.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hac(e,t,r)};Object.defineProperty(Ene,"__esModule",{value:!0});mac(T5i(),Ene)});var Wkr=I(_ne=>{"use strict";p();var gac=_ne&&_ne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Aac=_ne&&_ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gac(e,t,r)};Object.defineProperty(_ne,"__esModule",{value:!0});Aac(Bkr(),_ne)});var x5i=I(gLe=>{"use strict";p();Object.defineProperty(gLe,"__esModule",{value:!0});gLe.ValueMutateError=void 0;gLe.Mutate=Sac;var KD=R0(),JEt=VEt(),zkr=HD(),yac=Nf();function KEt(t){return(0,KD.IsObject)(t)&&!(0,KD.IsArray)(t)}a(KEt,"IsStandardObject");var mLe=class extends yac.TypeBoxError{static{a(this,"ValueMutateError")}constructor(e){super(e)}};gLe.ValueMutateError=mLe;function Eac(t,e,r,n){if(!KEt(r))JEt.ValuePointer.Set(t,e,(0,zkr.Clone)(n));else{let o=Object.getOwnPropertyNames(r),s=Object.getOwnPropertyNames(n);for(let c of o)s.includes(c)||delete r[c];for(let c of s)o.includes(c)||(r[c]=null);for(let c of s)Ykr(t,`${e}/${c}`,r[c],n[c])}}a(Eac,"ObjectType");function _ac(t,e,r,n){if(!(0,KD.IsArray)(r))JEt.ValuePointer.Set(t,e,(0,zkr.Clone)(n));else{for(let o=0;o{"use strict";p();var Tac=vne&&vne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Iac=vne&&vne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Tac(e,t,r)};Object.defineProperty(vne,"__esModule",{value:!0});Iac(x5i(),vne)});var R5i=I(JD=>{"use strict";p();Object.defineProperty(JD,"__esModule",{value:!0});JD.ParseDefault=JD.ParseRegistry=JD.ParseError=void 0;JD.Parse=Oac;var xac=Nf(),ZEt=fLe(),wac=DEt(),Rac=OEt(),kac=FEt(),Pac=HD(),Dac=QEt(),Nac=HEt(),w5i=R0(),ALe=class extends xac.TypeBoxError{static{a(this,"ParseError")}constructor(e){super(e)}};JD.ParseError=ALe;var Jkr;(function(t){let e=new Map([["Assert",(s,c,l)=>((0,wac.Assert)(s,c,l),l)],["Cast",(s,c,l)=>(0,Rac.Cast)(s,c,l)],["Clean",(s,c,l)=>(0,kac.Clean)(s,c,l)],["Clone",(s,c,l)=>(0,Pac.Clone)(l)],["Convert",(s,c,l)=>(0,Dac.Convert)(s,c,l)],["Decode",(s,c,l)=>(0,ZEt.HasTransform)(s,c)?(0,ZEt.TransformDecode)(s,c,l):l],["Default",(s,c,l)=>(0,Nac.Default)(s,c,l)],["Encode",(s,c,l)=>(0,ZEt.HasTransform)(s,c)?(0,ZEt.TransformEncode)(s,c,l):l]]);function r(s){e.delete(s)}a(r,"Delete"),t.Delete=r;function n(s,c){e.set(s,c)}a(n,"Set"),t.Set=n;function o(s){return e.get(s)}a(o,"Get"),t.Get=o})(Jkr||(JD.ParseRegistry=Jkr={}));JD.ParseDefault=["Clone","Clean","Default","Convert","Assert","Decode"];function Mac(t,e,r,n){return t.reduce((o,s)=>{let c=Jkr.Get(s);if((0,w5i.IsUndefined)(c))throw new ALe(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(Mac,"ParseValue");function Oac(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?(0,w5i.IsArray)(t[0])?[t[0],t[1],[],t[2]]:[JD.ParseDefault,t[0],t[1],t[2]]:t.length===2?[JD.ParseDefault,t[0],[],t[1]]:(()=>{throw new ALe("Invalid Arguments")})();return Mac(e,r,n,o)}a(Oac,"Parse")});var Zkr=I(Cne=>{"use strict";p();var Lac=Cne&&Cne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Bac=Cne&&Cne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Lac(e,t,r)};Object.defineProperty(Cne,"__esModule",{value:!0});Bac(R5i(),Cne)});var P5i=I(Cs=>{"use strict";p();Object.defineProperty(Cs,"__esModule",{value:!0});Cs.Parse=Cs.Mutate=Cs.Hash=Cs.Equal=Cs.Encode=Cs.Edit=Cs.Patch=Cs.Diff=Cs.Default=Cs.Decode=Cs.Create=Cs.Convert=Cs.Clone=Cs.Clean=Cs.Check=Cs.Cast=Cs.Assert=Cs.ValueErrorIterator=Cs.Errors=void 0;var k5i=VAe();Object.defineProperty(Cs,"Errors",{enumerable:!0,get:a(function(){return k5i.Errors},"get")});Object.defineProperty(Cs,"ValueErrorIterator",{enumerable:!0,get:a(function(){return k5i.ValueErrorIterator},"get")});var Fac=DEt();Object.defineProperty(Cs,"Assert",{enumerable:!0,get:a(function(){return Fac.Assert},"get")});var Uac=OEt();Object.defineProperty(Cs,"Cast",{enumerable:!0,get:a(function(){return Uac.Cast},"get")});var Qac=iI();Object.defineProperty(Cs,"Check",{enumerable:!0,get:a(function(){return Qac.Check},"get")});var qac=FEt();Object.defineProperty(Cs,"Clean",{enumerable:!0,get:a(function(){return qac.Clean},"get")});var jac=HD();Object.defineProperty(Cs,"Clone",{enumerable:!0,get:a(function(){return jac.Clone},"get")});var Hac=QEt();Object.defineProperty(Cs,"Convert",{enumerable:!0,get:a(function(){return Hac.Convert},"get")});var Gac=NEt();Object.defineProperty(Cs,"Create",{enumerable:!0,get:a(function(){return Gac.Create},"get")});var $ac=Dkr();Object.defineProperty(Cs,"Decode",{enumerable:!0,get:a(function(){return $ac.Decode},"get")});var Vac=HEt();Object.defineProperty(Cs,"Default",{enumerable:!0,get:a(function(){return Vac.Default},"get")});var Xkr=Hkr();Object.defineProperty(Cs,"Diff",{enumerable:!0,get:a(function(){return Xkr.Diff},"get")});Object.defineProperty(Cs,"Patch",{enumerable:!0,get:a(function(){return Xkr.Patch},"get")});Object.defineProperty(Cs,"Edit",{enumerable:!0,get:a(function(){return Xkr.Edit},"get")});var Wac=Vkr();Object.defineProperty(Cs,"Encode",{enumerable:!0,get:a(function(){return Wac.Encode},"get")});var zac=Wkr();Object.defineProperty(Cs,"Equal",{enumerable:!0,get:a(function(){return zac.Equal},"get")});var Yac=Z4e();Object.defineProperty(Cs,"Hash",{enumerable:!0,get:a(function(){return Yac.Hash},"get")});var Kac=Kkr();Object.defineProperty(Cs,"Mutate",{enumerable:!0,get:a(function(){return Kac.Mutate},"get")});var Jac=Zkr();Object.defineProperty(Cs,"Parse",{enumerable:!0,get:a(function(){return Jac.Parse},"get")})});var D5i=I(uL=>{"use strict";p();var Zac=uL&&uL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xac=uL&&uL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ecc=uL&&uL.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var tcc=Vc&&Vc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xg=Vc&&Vc.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tcc(e,t,r)};Object.defineProperty(Vc,"__esModule",{value:!0});Vc.Value=Vc.ValueErrorIterator=Vc.ValueErrorType=void 0;var N5i=VAe();Object.defineProperty(Vc,"ValueErrorType",{enumerable:!0,get:a(function(){return N5i.ValueErrorType},"get")});Object.defineProperty(Vc,"ValueErrorIterator",{enumerable:!0,get:a(function(){return N5i.ValueErrorIterator},"get")});Xg(R0(),Vc);Xg(DEt(),Vc);Xg(OEt(),Vc);Xg(iI(),Vc);Xg(FEt(),Vc);Xg(HD(),Vc);Xg(QEt(),Vc);Xg(NEt(),Vc);Xg(Dkr(),Vc);Xg(HEt(),Vc);Xg(Hkr(),Vc);Xg(Vkr(),Vc);Xg(Wkr(),Vc);Xg(Z4e(),Vc);Xg(Kkr(),Vc);Xg(Zkr(),Vc);Xg(VEt(),Vc);Xg(fLe(),Vc);var rcc=D5i();Object.defineProperty(Vc,"Value",{enumerable:!0,get:a(function(){return rcc.Value},"get")})});var O5i=I(XEt=>{"use strict";p();Object.defineProperty(XEt,"__esModule",{value:!0});XEt.assertShape=void 0;var M5i=ePr(),ncc=a((t,e)=>{if(M5i.Value.Check(t,e))return e;let r=`Typebox schema validation failed: -${[...M5i.Value.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` -`)}`;throw new Error(r)},"assertShape");XEt.assertShape=ncc});var bne={};ki(bne,{CAPIClient:()=>lcc,RequestType:()=>B5i});async function acc(t){if(!t)return;let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),r=Math.floor(Date.now()/1e3).toString(),n=new TextEncoder().encode(r),o=await crypto.subtle.sign("HMAC",e,n),s=Array.from(new Uint8Array(o)).map(c=>c.toString(16).padStart(2,"0")).join("");return`${r}.${s}`}function ccc(t){return new Set(["ChatCompletions","ChatResponses","ChatMessages","CAPIEmbeddings","Models","RemoteAgent","CodeReviewAgent","RemoteAgentChat","ListSkills","SearchSkill","ModelPolicy","ListModel","AutoModels","CopilotSessionLogs","CopilotSessionDetails","CopilotSessions","CopilotAgentJob","CCAModelsList","CopilotCustomAgents","CopilotAgentMemory","ModelRouter"]).has(t)}var icc,tPr,yLe,occ,scc,B5i,lcc,Sne=ve(()=>{p();icc=class{static{a(this,"y")}async fetch(t,e){let r={method:e.method||"GET",headers:e.headers,signal:e.signal};e.json?(r.body=JSON.stringify(e.json),r.headers={"Content-Type":"application/json",...r.headers}):e.body&&(r.body=e.body);let n,o;e.timeout&&!e.signal&&(o=new AbortController,r.signal=o.signal,n=setTimeout(()=>{o.abort()},e.timeout));try{let s=await fetch(t,r);return n&&clearTimeout(n),s}catch(s){throw n&&clearTimeout(n),s}}async fetchWithPagination(t,e){let r=[],n=e.pageSize??20,o=e.startPage??1,s=!1;do{let c=e.buildUrl(t,n,o),l=await this.fetch(c,e);if(!l.ok)return r;let u=await l.json(),d=e.getItemsFromResponse(u);r.push(...d),s=d.length===n,o++}while(s);return r}createWebSocket(t,e){return{webSocket:new WebSocket(t)}}},tPr=class L5i{static{a(this,"h")}constructor(){this._telemetryBaseUrl="https://copilot-telemetry.githubusercontent.com",this._originTrackerUrl="https://origin-tracker.githubusercontent.com",this._dotcomAPIUrl=this._getDotComAPIUrl(),this._proxyBaseUrl=this._getProxyUrl(void 0),this._capiBaseUrl=this._getCAPIUrl(void 0)}updateDomains(e,r){let n=this._dotcomAPIUrl,o=this._capiBaseUrl,s=this._telemetryBaseUrl,c=this._proxyBaseUrl;return this._enterpriseUrlConfig!==r&&(this._enterpriseUrlConfig=r,this._dotcomAPIUrl=this._getDotComAPIUrl()),e?(this._proxyBaseUrl=this._getProxyUrl(e),this._capiBaseUrl=this._getCAPIUrl(e),this._telemetryBaseUrl=e.endpoints.telemetry||"https://copilot-telemetry.githubusercontent.com",e.endpoints["origin-tracker"]&&(this._originTrackerUrl=e.endpoints["origin-tracker"])):(this._capiBaseUrl="https://api.githubcopilot.com",this._telemetryBaseUrl="https://copilot-telemetry.githubusercontent.com"),{dotcomUrlChanged:n!==this._dotcomAPIUrl,capiUrlChanged:o!==this._capiBaseUrl,telemetryUrlChanged:s!==this._telemetryBaseUrl,proxyUrlChanged:c!==this._proxyBaseUrl}}_getDotComAPIUrl(){if(this._enterpriseUrlConfig)try{let e=new URL(this._enterpriseUrlConfig);return`${e.protocol}//api.${e.hostname}${e.port?":"+e.port:""}`}catch(e){return console.warn("Failed to parse enterprise URL config:",this._enterpriseUrlConfig,e),"https://api.github.com"}return"https://api.github.com"}_getCAPIUrl(e){return e&&e.endpoints.api||"https://api.githubcopilot.com"}_getProxyUrl(e){return e&&e.endpoints.proxy||L5i.DEFAULT_PROXY_BASE_URL}get proxyBaseURL(){return this._proxyBaseUrl}get capiBaseURL(){return this._capiBaseUrl}get capiChatURL(){return`${this._capiBaseUrl}/chat/completions`}get capiResponsesURL(){return`${this._capiBaseUrl}/responses`}get capiMessagesURL(){return`${this._capiBaseUrl}/v1/messages`}get capiEmbeddingsURL(){return`${this._capiBaseUrl}/embeddings`}get capiModelsURL(){return`${this._capiBaseUrl}/models`}get capiAutoModelURL(){return`${this.capiModelsURL}/session`}get capiModelRouterURL(){return`${this.capiAutoModelURL}/intent`}get embeddingsModelURL(){return`${this.embeddingsURL}/models`}get chunksURL(){return`${this.dotComAPIURL}/chunks`}get embeddingsURL(){return`${this.dotComAPIURL}/embeddings`}get embeddingsCodeSearchURL(){return`${this.dotComAPIURL}/embeddings/code/search`}get telemetryURL(){return`${this._telemetryBaseUrl}/telemetry`}get remoteAgentsURL(){return`${this._capiBaseUrl}/agents`}get listSkillsURL(){return`${this._capiBaseUrl}/skills`}get searchSkillURL(){return`${this._capiBaseUrl}/search`}get contentExclusionURL(){return`${this._dotcomAPIUrl}/copilot_internal/content_exclusion`}get copilotUserInfoURL(){return`${this._dotcomAPIUrl}/copilot_internal/user`}get tokenURL(){return this._dotcomAPIUrl+"/copilot_internal/v2/token"}get tokenNoAuthURL(){return`${this._dotcomAPIUrl}/copilot_internal/v2/nltoken`}get dotComAPIURL(){return this._dotcomAPIUrl}get originTrackerURL(){return this._originTrackerUrl}get chatAttachmentUploadURL(){return"https://uploads.github.com/copilot/chat/attachments"}get copilotAgentSessionsURL(){return`${this._capiBaseUrl}/agents/sessions`}get copilotAgentJobsURL(){return`${this._capiBaseUrl}/agents/swe`}get copilotAgentTasksURL(){return`${this._dotcomAPIUrl}/cmc_internal/api/agents`}get CCAModelsURL(){return`${this._capiBaseUrl}/agents/swe/models`}get copilotCustomAgentsURL(){return`${this._capiBaseUrl}/agents/swe/custom-agents`}get copilotAgentMemoryURL(){return`${this._capiBaseUrl}/agents/swe/internal/memory/v0`}};tPr.DEFAULT_PROXY_BASE_URL="https://copilot-proxy.githubusercontent.com",tPr.CAPI_MODEL_LAB_URL="https://api-model-lab.githubcopilot.com";yLe=tPr,occ=`The \u201C@vscode/copilot-api\u201D npm Module Terms and Conditions ("Terms") are a legal agreement between you (either as an individual or on behalf of an entity) and GitHub, Inc. regarding your use of \u201C@vscode/copilot-api\u201D npm library and associated documentation (collectively, the "Software"). By using the Software, you accept these Terms. Please read all of these Terms; in many cases, provisions set forth later in the Terms limit and qualify provisions set forth earlier in the Terms. If you do not accept these Terms, do not download, install, use, or copy the Software. +`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(Cnc,"applyEditsForNotebook");function bnc(t,e,r){let n=t.get(hnc.ICompletionsFeaturesService),s=n.maxPromptCompletionTokens(e)-(0,mnc.getMaxSolutionTokens)(),c=(0,u4i.getNumberOfSnippets)(e,r),l=(0,u4i.getSimilarFilesOptions)(t,e,r),u=n.suffixPercent(e),d=n.suffixMatchThreshold(e);if(u<0||u>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${u}`);if(d<0||d>100)throw new Error(`suffixMatchThreshold must be between 0 and 100, but was ${d}`);return{maxPromptLength:s,similarFilesOptions:l,numberOfSnippets:c,suffixPercent:u,suffixMatchThreshold:d}}a(bnc,"getPromptOptions")});var f4i=I(rPr=>{"use strict";p();Object.defineProperty(rPr,"__esModule",{value:!0});rPr.Evaluate=Snc;function Snc(...t){return new globalThis.Function(...t)}a(Snc,"Evaluate")});var m4i=I(Q$=>{"use strict";p();Object.defineProperty(Q$,"__esModule",{value:!0});Q$.TypeSystem=Q$.TypeSystemDuplicateFormat=Q$.TypeSystemDuplicateTypeKind=void 0;var zEt=oAe(),Tnc=I4e(),Inc=bn(),h4i=Ff(),YEt=class extends h4i.TypeBoxError{static{a(this,"TypeSystemDuplicateTypeKind")}constructor(e){super(`Duplicate type kind '${e}' detected`)}};Q$.TypeSystemDuplicateTypeKind=YEt;var KEt=class extends h4i.TypeBoxError{static{a(this,"TypeSystemDuplicateFormat")}constructor(e){super(`Duplicate string format '${e}' detected`)}};Q$.TypeSystemDuplicateFormat=KEt;var p4i;(function(t){function e(n,o){if(zEt.TypeRegistry.Has(n))throw new YEt(n);return zEt.TypeRegistry.Set(n,o),(s={})=>(0,Tnc.Unsafe)({...s,[Inc.Kind]:n})}a(e,"Type"),t.Type=e;function r(n,o){if(zEt.FormatRegistry.Has(n))throw new KEt(n);return zEt.FormatRegistry.Set(n,o),n}a(r,"Format"),t.Format=r})(p4i||(Q$.TypeSystem=p4i={}))});var iPr=I(V6=>{"use strict";p();var xnc=V6&&V6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nPr=V6&&V6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xnc(e,t,r)};Object.defineProperty(V6,"__esModule",{value:!0});nPr(f4i(),V6);nPr(z5e(),V6);nPr(m4i(),V6)});var oPr=I(ELe=>{"use strict";p();Object.defineProperty(ELe,"__esModule",{value:!0});ELe.DefaultErrorFunction=g4i;ELe.SetErrorFunction=Rnc;ELe.GetErrorFunction=knc;var wnc=bn(),qn=sPr();function g4i(t){switch(t.errorType){case qn.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case qn.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case qn.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case qn.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case qn.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case qn.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case qn.ValueErrorType.Array:return"Expected array";case qn.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case qn.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case qn.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case qn.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case qn.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case qn.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case qn.ValueErrorType.BigInt:return"Expected bigint";case qn.ValueErrorType.Boolean:return"Expected boolean";case qn.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case qn.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case qn.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case qn.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case qn.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case qn.ValueErrorType.Date:return"Expected Date";case qn.ValueErrorType.Function:return"Expected function";case qn.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case qn.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case qn.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case qn.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case qn.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case qn.ValueErrorType.Integer:return"Expected integer";case qn.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case qn.ValueErrorType.Intersect:return"Expected all values to match";case qn.ValueErrorType.Iterator:return"Expected Iterator";case qn.ValueErrorType.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case qn.ValueErrorType.Never:return"Never";case qn.ValueErrorType.Not:return"Value should not match";case qn.ValueErrorType.Null:return"Expected null";case qn.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case qn.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case qn.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case qn.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case qn.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case qn.ValueErrorType.Number:return"Expected number";case qn.ValueErrorType.Object:return"Expected object";case qn.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case qn.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case qn.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case qn.ValueErrorType.ObjectRequiredProperty:return"Expected required property";case qn.ValueErrorType.Promise:return"Expected Promise";case qn.ValueErrorType.RegExp:return"Expected string to match regular expression";case qn.ValueErrorType.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case qn.ValueErrorType.StringFormat:return`Expected string to match '${t.schema.format}' format`;case qn.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case qn.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case qn.ValueErrorType.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case qn.ValueErrorType.String:return"Expected string";case qn.ValueErrorType.Symbol:return"Expected symbol";case qn.ValueErrorType.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case qn.ValueErrorType.Tuple:return"Expected tuple";case qn.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case qn.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case qn.ValueErrorType.Uint8Array:return"Expected Uint8Array";case qn.ValueErrorType.Undefined:return"Expected undefined";case qn.ValueErrorType.Union:return"Expected union value";case qn.ValueErrorType.Void:return"Expected void";case qn.ValueErrorType.Kind:return`Expected kind '${t.schema[wnc.Kind]}'`;default:return"Unknown error type"}}a(g4i,"DefaultErrorFunction");var A4i=g4i;function Rnc(t){A4i=t}a(Rnc,"SetErrorFunction");function knc(){return A4i}a(knc,"GetErrorFunction")});var _4i=I(iye=>{"use strict";p();Object.defineProperty(iye,"__esModule",{value:!0});iye.TypeDereferenceError=void 0;iye.Pushref=Mnc;iye.Deref=E4i;var Pnc=Ff(),y4i=bn(),Dnc=$gt(),JEt=class extends Pnc.TypeBoxError{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};iye.TypeDereferenceError=JEt;function Nnc(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new JEt(t);return E4i(r,e)}a(Nnc,"Resolve");function Mnc(t,e){return!(0,Dnc.IsString)(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(Mnc,"Pushref");function E4i(t,e){return t[y4i.Kind]==="This"||t[y4i.Kind]==="Ref"?Nnc(t,e):t}a(E4i,"Deref")});var YD=I(fne=>{"use strict";p();var Onc=fne&&fne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Lnc=fne&&fne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Onc(e,t,r)};Object.defineProperty(fne,"__esModule",{value:!0});Lnc(_4i(),fne)});var S4i=I(_Le=>{"use strict";p();Object.defineProperty(_Le,"__esModule",{value:!0});_Le.ValueHashError=void 0;_Le.Hash=Xnc;var KD=P0(),Bnc=Ff(),ZEt=class extends Bnc.TypeBoxError{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}};_Le.ValueHashError=ZEt;var lI;(function(t){t[t.Undefined=0]="Undefined",t[t.Null=1]="Null",t[t.Boolean=2]="Boolean",t[t.Number=3]="Number",t[t.String=4]="String",t[t.Object=5]="Object",t[t.Array=6]="Array",t[t.Date=7]="Date",t[t.Uint8Array=8]="Uint8Array",t[t.Symbol=9]="Symbol",t[t.BigInt=10]="BigInt"})(lI||(lI={}));var oye=BigInt("14695981039346656037"),[Fnc,Unc]=[BigInt("1099511628211"),BigInt("18446744073709551616")],Qnc=Array.from({length:256}).map((t,e)=>BigInt(e)),v4i=new Float64Array(1),C4i=new DataView(v4i.buffer),b4i=new Uint8Array(v4i.buffer);function*qnc(t){let e=t===0?1:Math.ceil(Math.floor(Math.log2(t)+1)/8);for(let r=0;r>8*(e-1-r)&255}a(qnc,"NumberToBytes");function jnc(t){YE(lI.Array);for(let e of t)sye(e)}a(jnc,"ArrayType");function Hnc(t){YE(lI.Boolean),YE(t?1:0)}a(Hnc,"BooleanType");function Gnc(t){YE(lI.BigInt),C4i.setBigInt64(0,t);for(let e of b4i)YE(e)}a(Gnc,"BigIntType");function $nc(t){YE(lI.Date),sye(t.getTime())}a($nc,"DateType");function Vnc(t){YE(lI.Null)}a(Vnc,"NullType");function Wnc(t){YE(lI.Number),C4i.setFloat64(0,t);for(let e of b4i)YE(e)}a(Wnc,"NumberType");function znc(t){YE(lI.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())sye(e),sye(t[e])}a(znc,"ObjectType");function Ync(t){YE(lI.String);for(let e=0;e{"use strict";p();var eic=pne&&pne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),tic=pne&&pne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eic(e,t,r)};Object.defineProperty(pne,"__esModule",{value:!0});tic(S4i(),pne)});var cPr=I(SLe=>{"use strict";p();Object.defineProperty(SLe,"__esModule",{value:!0});SLe.ValueCheckUnknownTypeError=void 0;SLe.Check=jic;var CLe=iPr(),aPr=YD(),ric=vLe(),aye=bn(),T4i=bD(),nic=Ere(),bLe=oAe(),iic=Ff(),oic=xm(),Nm=P0(),sic=Es(),XEt=class extends iic.TypeBoxError{static{a(this,"ValueCheckUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};SLe.ValueCheckUnknownTypeError=XEt;function aic(t){return t[aye.Kind]==="Any"||t[aye.Kind]==="Unknown"}a(aic,"IsAnyOrUnknown");function oa(t){return t!==void 0}a(oa,"IsDefined");function cic(t,e,r){return!0}a(cic,"FromAny");function lic(t,e,r){return!0}a(lic,"FromArgument");function uic(t,e,r){if(!(0,Nm.IsArray)(r)||oa(t.minItems)&&!(r.length>=t.minItems)||oa(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!tA(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=(0,ric.Hash)(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(oa(t.contains)||(0,Nm.IsNumber)(t.minContains)||(0,Nm.IsNumber)(t.maxContains)))return!0;let n=oa(t.contains)?t.contains:(0,oic.Never)(),o=r.reduce((s,c)=>tA(n,e,c)?s+1:s,0);return!(o===0||(0,Nm.IsNumber)(t.minContains)&&ot.maxContains)}a(uic,"FromArray");function dic(t,e,r){return(0,Nm.IsAsyncIterator)(r)}a(dic,"FromAsyncIterator");function fic(t,e,r){return!(!(0,Nm.IsBigInt)(r)||oa(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||oa(t.maximum)&&!(r<=t.maximum)||oa(t.minimum)&&!(r>=t.minimum)||oa(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(fic,"FromBigInt");function pic(t,e,r){return(0,Nm.IsBoolean)(r)}a(pic,"FromBoolean");function hic(t,e,r){return tA(t.returns,e,r.prototype)}a(hic,"FromConstructor");function mic(t,e,r){return!(!(0,Nm.IsDate)(r)||oa(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||oa(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||oa(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||oa(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(mic,"FromDate");function gic(t,e,r){return(0,Nm.IsFunction)(r)}a(gic,"FromFunction");function Aic(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return tA(o,[...e,...n],r)}a(Aic,"FromImport");function yic(t,e,r){return!(!(0,Nm.IsInteger)(r)||oa(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||oa(t.maximum)&&!(r<=t.maximum)||oa(t.minimum)&&!(r>=t.minimum)||oa(t.multipleOf)&&r%t.multipleOf!==0)}a(yic,"FromInteger");function Eic(t,e,r){let n=t.allOf.every(o=>tA(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp((0,T4i.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if((0,sic.IsSchema)(t.unevaluatedProperties)){let o=new RegExp((0,T4i.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||tA(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(Eic,"FromIntersect");function _ic(t,e,r){return(0,Nm.IsIterator)(r)}a(_ic,"FromIterator");function vic(t,e,r){return r===t.const}a(vic,"FromLiteral");function Cic(t,e,r){return!1}a(Cic,"FromNever");function bic(t,e,r){return!tA(t.not,e,r)}a(bic,"FromNot");function Sic(t,e,r){return(0,Nm.IsNull)(r)}a(Sic,"FromNull");function Tic(t,e,r){return!(!CLe.TypeSystemPolicy.IsNumberLike(r)||oa(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||oa(t.minimum)&&!(r>=t.minimum)||oa(t.maximum)&&!(r<=t.maximum)||oa(t.multipleOf)&&r%t.multipleOf!==0)}a(Tic,"FromNumber");function Iic(t,e,r){if(!CLe.TypeSystemPolicy.IsObjectLike(r)||oa(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||oa(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let n=Object.getOwnPropertyNames(t.properties);for(let o of n){let s=t.properties[o];if(t.required&&t.required.includes(o)){if(!tA(s,e,r[o])||((0,nic.ExtendsUndefinedCheck)(s)||aic(s))&&!(o in r))return!1}else if(CLe.TypeSystemPolicy.IsExactOptionalProperty(r,o)&&!tA(s,e,r[o]))return!1}if(t.additionalProperties===!1){let o=Object.getOwnPropertyNames(r);return t.required&&t.required.length===n.length&&o.length===n.length?!0:o.every(s=>n.includes(s))}else return typeof t.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(s=>n.includes(s)||tA(t.additionalProperties,e,r[s])):!0}a(Iic,"FromObject");function xic(t,e,r){return(0,Nm.IsPromise)(r)}a(xic,"FromPromise");function wic(t,e,r){if(!CLe.TypeSystemPolicy.IsRecordLike(r)||oa(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||oa(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let[n,o]=Object.entries(t.patternProperties)[0],s=new RegExp(n),c=Object.entries(r).every(([d,f])=>s.test(d)?tA(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:tA(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(wic,"FromRecord");function Ric(t,e,r){return tA((0,aPr.Deref)(t,e),e,r)}a(Ric,"FromRef");function kic(t,e,r){let n=new RegExp(t.source,t.flags);return oa(t.minLength)&&!(r.length>=t.minLength)||oa(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(kic,"FromRegExp");function Pic(t,e,r){return!(0,Nm.IsString)(r)||oa(t.minLength)&&!(r.length>=t.minLength)||oa(t.maxLength)&&!(r.length<=t.maxLength)||oa(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:oa(t.format)?bLe.FormatRegistry.Has(t.format)?bLe.FormatRegistry.Get(t.format)(r):!1:!0}a(Pic,"FromString");function Dic(t,e,r){return(0,Nm.IsSymbol)(r)}a(Dic,"FromSymbol");function Nic(t,e,r){return(0,Nm.IsString)(r)&&new RegExp(t.pattern).test(r)}a(Nic,"FromTemplateLiteral");function Mic(t,e,r){return tA((0,aPr.Deref)(t,e),e,r)}a(Mic,"FromThis");function Oic(t,e,r){if(!(0,Nm.IsArray)(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;ntA(n,e,r))}a(Bic,"FromUnion");function Fic(t,e,r){return!(!(0,Nm.IsUint8Array)(r)||oa(t.maxByteLength)&&!(r.length<=t.maxByteLength)||oa(t.minByteLength)&&!(r.length>=t.minByteLength))}a(Fic,"FromUint8Array");function Uic(t,e,r){return!0}a(Uic,"FromUnknown");function Qic(t,e,r){return CLe.TypeSystemPolicy.IsVoidLike(r)}a(Qic,"FromVoid");function qic(t,e,r){return bLe.TypeRegistry.Has(t[aye.Kind])?bLe.TypeRegistry.Get(t[aye.Kind])(t,r):!1}a(qic,"FromKind");function tA(t,e,r){let n=oa(t.$id)?(0,aPr.Pushref)(t,e):e,o=t;switch(o[aye.Kind]){case"Any":return cic(o,n,r);case"Argument":return lic(o,n,r);case"Array":return uic(o,n,r);case"AsyncIterator":return dic(o,n,r);case"BigInt":return fic(o,n,r);case"Boolean":return pic(o,n,r);case"Constructor":return hic(o,n,r);case"Date":return mic(o,n,r);case"Function":return gic(o,n,r);case"Import":return Aic(o,n,r);case"Integer":return yic(o,n,r);case"Intersect":return Eic(o,n,r);case"Iterator":return _ic(o,n,r);case"Literal":return vic(o,n,r);case"Never":return Cic(o,n,r);case"Not":return bic(o,n,r);case"Null":return Sic(o,n,r);case"Number":return Tic(o,n,r);case"Object":return Iic(o,n,r);case"Promise":return xic(o,n,r);case"Record":return wic(o,n,r);case"Ref":return Ric(o,n,r);case"RegExp":return kic(o,n,r);case"String":return Pic(o,n,r);case"Symbol":return Dic(o,n,r);case"TemplateLiteral":return Nic(o,n,r);case"This":return Mic(o,n,r);case"Tuple":return Oic(o,n,r);case"Undefined":return Lic(o,n,r);case"Union":return Bic(o,n,r);case"Uint8Array":return Fic(o,n,r);case"Unknown":return Uic(o,n,r);case"Void":return Qic(o,n,r);default:if(!bLe.TypeRegistry.Has(o[aye.Kind]))throw new XEt(o);return qic(o,n,r)}}a(tA,"Visit");function jic(...t){return t.length===3?tA(t[0],t[1],t[2]):tA(t[0],[],t[1])}a(jic,"Check")});var uI=I(hne=>{"use strict";p();var Hic=hne&&hne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Gic=hne&&hne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Hic(e,t,r)};Object.defineProperty(hne,"__esModule",{value:!0});Gic(cPr(),hne)});var sPr=I(z6=>{"use strict";p();Object.defineProperty(z6,"__esModule",{value:!0});z6.ValueErrorIterator=z6.ValueErrorsUnknownTypeError=z6.ValueErrorType=void 0;z6.Errors=Poc;var TLe=iPr(),I4i=bD(),e_t=oAe(),$ic=ESr(),Vic=oPr(),Wic=Ff(),x4i=YD(),zic=vLe(),Yic=uI(),lPr=bn(),Kic=xm(),_h=P0(),tn;(function(t){t[t.ArrayContains=0]="ArrayContains",t[t.ArrayMaxContains=1]="ArrayMaxContains",t[t.ArrayMaxItems=2]="ArrayMaxItems",t[t.ArrayMinContains=3]="ArrayMinContains",t[t.ArrayMinItems=4]="ArrayMinItems",t[t.ArrayUniqueItems=5]="ArrayUniqueItems",t[t.Array=6]="Array",t[t.AsyncIterator=7]="AsyncIterator",t[t.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",t[t.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",t[t.BigIntMaximum=10]="BigIntMaximum",t[t.BigIntMinimum=11]="BigIntMinimum",t[t.BigIntMultipleOf=12]="BigIntMultipleOf",t[t.BigInt=13]="BigInt",t[t.Boolean=14]="Boolean",t[t.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",t[t.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",t[t.DateMaximumTimestamp=17]="DateMaximumTimestamp",t[t.DateMinimumTimestamp=18]="DateMinimumTimestamp",t[t.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",t[t.Date=20]="Date",t[t.Function=21]="Function",t[t.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",t[t.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",t[t.IntegerMaximum=24]="IntegerMaximum",t[t.IntegerMinimum=25]="IntegerMinimum",t[t.IntegerMultipleOf=26]="IntegerMultipleOf",t[t.Integer=27]="Integer",t[t.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",t[t.Intersect=29]="Intersect",t[t.Iterator=30]="Iterator",t[t.Kind=31]="Kind",t[t.Literal=32]="Literal",t[t.Never=33]="Never",t[t.Not=34]="Not",t[t.Null=35]="Null",t[t.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",t[t.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",t[t.NumberMaximum=38]="NumberMaximum",t[t.NumberMinimum=39]="NumberMinimum",t[t.NumberMultipleOf=40]="NumberMultipleOf",t[t.Number=41]="Number",t[t.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",t[t.ObjectMaxProperties=43]="ObjectMaxProperties",t[t.ObjectMinProperties=44]="ObjectMinProperties",t[t.ObjectRequiredProperty=45]="ObjectRequiredProperty",t[t.Object=46]="Object",t[t.Promise=47]="Promise",t[t.RegExp=48]="RegExp",t[t.StringFormatUnknown=49]="StringFormatUnknown",t[t.StringFormat=50]="StringFormat",t[t.StringMaxLength=51]="StringMaxLength",t[t.StringMinLength=52]="StringMinLength",t[t.StringPattern=53]="StringPattern",t[t.String=54]="String",t[t.Symbol=55]="Symbol",t[t.TupleLength=56]="TupleLength",t[t.Tuple=57]="Tuple",t[t.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",t[t.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",t[t.Uint8Array=60]="Uint8Array",t[t.Undefined=61]="Undefined",t[t.Union=62]="Union",t[t.Void=63]="Void"})(tn||(z6.ValueErrorType=tn={}));var t_t=class extends Wic.TypeBoxError{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};z6.ValueErrorsUnknownTypeError=t_t;function W6(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(W6,"EscapeKey");function sa(t){return t!==void 0}a(sa,"IsDefined");var ILe=class{static{a(this,"ValueErrorIterator")}constructor(e){this.iterator=e}[Symbol.iterator](){return this.iterator}First(){let e=this.iterator.next();return e.done?void 0:e.value}};z6.ValueErrorIterator=ILe;function cn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:(0,Vic.GetErrorFunction)()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(cn,"Create");function*Jic(t,e,r,n){}a(Jic,"FromAny");function*Zic(t,e,r,n){}a(Zic,"FromArgument");function*Xic(t,e,r,n){if(!(0,_h.IsArray)(n))return yield cn(tn.Array,t,r,n);sa(t.minItems)&&!(n.length>=t.minItems)&&(yield cn(tn.ArrayMinItems,t,r,n)),sa(t.maxItems)&&!(n.length<=t.maxItems)&&(yield cn(tn.ArrayMaxItems,t,r,n));for(let c=0;crA(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield cn(tn.ArrayContains,t,r,n)),(0,_h.IsNumber)(t.minContains)&&st.maxContains&&(yield cn(tn.ArrayMaxContains,t,r,n))}a(Xic,"FromArray");function*eoc(t,e,r,n){(0,_h.IsAsyncIterator)(n)||(yield cn(tn.AsyncIterator,t,r,n))}a(eoc,"FromAsyncIterator");function*toc(t,e,r,n){if(!(0,_h.IsBigInt)(n))return yield cn(tn.BigInt,t,r,n);sa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.BigIntExclusiveMinimum,t,r,n)),sa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.BigIntMaximum,t,r,n)),sa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.BigIntMinimum,t,r,n)),sa(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield cn(tn.BigIntMultipleOf,t,r,n))}a(toc,"FromBigInt");function*roc(t,e,r,n){(0,_h.IsBoolean)(n)||(yield cn(tn.Boolean,t,r,n))}a(roc,"FromBoolean");function*noc(t,e,r,n){yield*rA(t.returns,e,r,n.prototype)}a(noc,"FromConstructor");function*ioc(t,e,r,n){if(!(0,_h.IsDate)(n))return yield cn(tn.Date,t,r,n);sa(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield cn(tn.DateExclusiveMinimumTimestamp,t,r,n)),sa(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield cn(tn.DateMaximumTimestamp,t,r,n)),sa(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield cn(tn.DateMinimumTimestamp,t,r,n)),sa(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield cn(tn.DateMultipleOfTimestamp,t,r,n))}a(ioc,"FromDate");function*ooc(t,e,r,n){(0,_h.IsFunction)(n)||(yield cn(tn.Function,t,r,n))}a(ooc,"FromFunction");function*soc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*rA(s,[...e,...o],r,n)}a(soc,"FromImport");function*aoc(t,e,r,n){if(!(0,_h.IsInteger)(n))return yield cn(tn.Integer,t,r,n);sa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.IntegerExclusiveMinimum,t,r,n)),sa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.IntegerMaximum,t,r,n)),sa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.IntegerMinimum,t,r,n)),sa(t.multipleOf)&&n%t.multipleOf!==0&&(yield cn(tn.IntegerMultipleOf,t,r,n))}a(aoc,"FromInteger");function*coc(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of rA(s,e,r,n))o=!0,yield c;if(o)return yield cn(tn.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp((0,I4i.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield cn(tn.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp((0,I4i.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=rA(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(coc,"FromIntersect");function*loc(t,e,r,n){(0,_h.IsIterator)(n)||(yield cn(tn.Iterator,t,r,n))}a(loc,"FromIterator");function*uoc(t,e,r,n){n!==t.const&&(yield cn(tn.Literal,t,r,n))}a(uoc,"FromLiteral");function*doc(t,e,r,n){yield cn(tn.Never,t,r,n)}a(doc,"FromNever");function*foc(t,e,r,n){rA(t.not,e,r,n).next().done===!0&&(yield cn(tn.Not,t,r,n))}a(foc,"FromNot");function*poc(t,e,r,n){(0,_h.IsNull)(n)||(yield cn(tn.Null,t,r,n))}a(poc,"FromNull");function*hoc(t,e,r,n){if(!TLe.TypeSystemPolicy.IsNumberLike(n))return yield cn(tn.Number,t,r,n);sa(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield cn(tn.NumberExclusiveMinimum,t,r,n)),sa(t.maximum)&&!(n<=t.maximum)&&(yield cn(tn.NumberMaximum,t,r,n)),sa(t.minimum)&&!(n>=t.minimum)&&(yield cn(tn.NumberMinimum,t,r,n)),sa(t.multipleOf)&&n%t.multipleOf!==0&&(yield cn(tn.NumberMultipleOf,t,r,n))}a(hoc,"FromNumber");function*moc(t,e,r,n){if(!TLe.TypeSystemPolicy.IsObjectLike(n))return yield cn(tn.Object,t,r,n);sa(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield cn(tn.ObjectMinProperties,t,r,n)),sa(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield cn(tn.ObjectMaxProperties,t,r,n));let o=Array.isArray(t.required)?t.required:[],s=Object.getOwnPropertyNames(t.properties),c=Object.getOwnPropertyNames(n);for(let l of o)c.includes(l)||(yield cn(tn.ObjectRequiredProperty,t.properties[l],`${r}/${W6(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield cn(tn.ObjectAdditionalProperties,t,`${r}/${W6(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*rA(t.additionalProperties,e,`${r}/${W6(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*rA(u,e,`${r}/${W6(l)}`,n[l]),(0,$ic.ExtendsUndefinedCheck)(t)&&!(l in n)&&(yield cn(tn.ObjectRequiredProperty,u,`${r}/${W6(l)}`,void 0))):TLe.TypeSystemPolicy.IsExactOptionalProperty(n,l)&&(yield*rA(u,e,`${r}/${W6(l)}`,n[l]))}}a(moc,"FromObject");function*goc(t,e,r,n){(0,_h.IsPromise)(n)||(yield cn(tn.Promise,t,r,n))}a(goc,"FromPromise");function*Aoc(t,e,r,n){if(!TLe.TypeSystemPolicy.IsRecordLike(n))return yield cn(tn.Object,t,r,n);sa(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield cn(tn.ObjectMinProperties,t,r,n)),sa(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield cn(tn.ObjectMaxProperties,t,r,n));let[o,s]=Object.entries(t.patternProperties)[0],c=new RegExp(o);for(let[l,u]of Object.entries(n))c.test(l)&&(yield*rA(s,e,`${r}/${W6(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*rA(t.additionalProperties,e,`${r}/${W6(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield cn(tn.ObjectAdditionalProperties,t,`${r}/${W6(l)}`,u)}}a(Aoc,"FromRecord");function*yoc(t,e,r,n){yield*rA((0,x4i.Deref)(t,e),e,r,n)}a(yoc,"FromRef");function*Eoc(t,e,r,n){if(!(0,_h.IsString)(n))return yield cn(tn.String,t,r,n);if(sa(t.minLength)&&!(n.length>=t.minLength)&&(yield cn(tn.StringMinLength,t,r,n)),sa(t.maxLength)&&!(n.length<=t.maxLength)&&(yield cn(tn.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield cn(tn.RegExp,t,r,n)}a(Eoc,"FromRegExp");function*_oc(t,e,r,n){if(!(0,_h.IsString)(n))return yield cn(tn.String,t,r,n);sa(t.minLength)&&!(n.length>=t.minLength)&&(yield cn(tn.StringMinLength,t,r,n)),sa(t.maxLength)&&!(n.length<=t.maxLength)&&(yield cn(tn.StringMaxLength,t,r,n)),(0,_h.IsString)(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield cn(tn.StringPattern,t,r,n))),(0,_h.IsString)(t.format)&&(e_t.FormatRegistry.Has(t.format)?e_t.FormatRegistry.Get(t.format)(n)||(yield cn(tn.StringFormat,t,r,n)):yield cn(tn.StringFormatUnknown,t,r,n))}a(_oc,"FromString");function*voc(t,e,r,n){(0,_h.IsSymbol)(n)||(yield cn(tn.Symbol,t,r,n))}a(voc,"FromSymbol");function*Coc(t,e,r,n){if(!(0,_h.IsString)(n))return yield cn(tn.String,t,r,n);new RegExp(t.pattern).test(n)||(yield cn(tn.StringPattern,t,r,n))}a(Coc,"FromTemplateLiteral");function*boc(t,e,r,n){yield*rA((0,x4i.Deref)(t,e),e,r,n)}a(boc,"FromThis");function*Soc(t,e,r,n){if(!(0,_h.IsArray)(n))return yield cn(tn.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield cn(tn.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield cn(tn.TupleLength,t,r,n);if(t.items)for(let o=0;onew ILe(rA(s,e,r,n)));yield cn(tn.Union,t,r,n,o)}a(Ioc,"FromUnion");function*xoc(t,e,r,n){if(!(0,_h.IsUint8Array)(n))return yield cn(tn.Uint8Array,t,r,n);sa(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield cn(tn.Uint8ArrayMaxByteLength,t,r,n)),sa(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield cn(tn.Uint8ArrayMinByteLength,t,r,n))}a(xoc,"FromUint8Array");function*woc(t,e,r,n){}a(woc,"FromUnknown");function*Roc(t,e,r,n){TLe.TypeSystemPolicy.IsVoidLike(n)||(yield cn(tn.Void,t,r,n))}a(Roc,"FromVoid");function*koc(t,e,r,n){e_t.TypeRegistry.Get(t[lPr.Kind])(t,n)||(yield cn(tn.Kind,t,r,n))}a(koc,"FromKind");function*rA(t,e,r,n){let o=sa(t.$id)?[...e,t]:e,s=t;switch(s[lPr.Kind]){case"Any":return yield*Jic(s,o,r,n);case"Argument":return yield*Zic(s,o,r,n);case"Array":return yield*Xic(s,o,r,n);case"AsyncIterator":return yield*eoc(s,o,r,n);case"BigInt":return yield*toc(s,o,r,n);case"Boolean":return yield*roc(s,o,r,n);case"Constructor":return yield*noc(s,o,r,n);case"Date":return yield*ioc(s,o,r,n);case"Function":return yield*ooc(s,o,r,n);case"Import":return yield*soc(s,o,r,n);case"Integer":return yield*aoc(s,o,r,n);case"Intersect":return yield*coc(s,o,r,n);case"Iterator":return yield*loc(s,o,r,n);case"Literal":return yield*uoc(s,o,r,n);case"Never":return yield*doc(s,o,r,n);case"Not":return yield*foc(s,o,r,n);case"Null":return yield*poc(s,o,r,n);case"Number":return yield*hoc(s,o,r,n);case"Object":return yield*moc(s,o,r,n);case"Promise":return yield*goc(s,o,r,n);case"Record":return yield*Aoc(s,o,r,n);case"Ref":return yield*yoc(s,o,r,n);case"RegExp":return yield*Eoc(s,o,r,n);case"String":return yield*_oc(s,o,r,n);case"Symbol":return yield*voc(s,o,r,n);case"TemplateLiteral":return yield*Coc(s,o,r,n);case"This":return yield*boc(s,o,r,n);case"Tuple":return yield*Soc(s,o,r,n);case"Undefined":return yield*Toc(s,o,r,n);case"Union":return yield*Ioc(s,o,r,n);case"Uint8Array":return yield*xoc(s,o,r,n);case"Unknown":return yield*woc(s,o,r,n);case"Void":return yield*Roc(s,o,r,n);default:if(!e_t.TypeRegistry.Has(s[lPr.Kind]))throw new t_t(t);return yield*koc(s,o,r,n)}}a(rA,"Visit");function Poc(...t){let e=t.length===3?rA(t[0],t[1],"",t[2]):rA(t[0],[],"",t[1]);return new ILe(e)}a(Poc,"Errors")});var cye=I(q$=>{"use strict";p();var Doc=q$&&q$.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),w4i=q$&&q$.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Doc(e,t,r)};Object.defineProperty(q$,"__esModule",{value:!0});w4i(sPr(),q$);w4i(oPr(),q$)});var N4i=I(Y6=>{"use strict";p();var Noc=Y6&&Y6.__classPrivateFieldSet||function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},k4i=Y6&&Y6.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},uPr,r_t,P4i;Object.defineProperty(Y6,"__esModule",{value:!0});Y6.AssertError=void 0;Y6.Assert=Loc;var D4i=cye(),Moc=Cbr(),Ooc=cPr(),n_t=class extends Moc.TypeBoxError{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),uPr.add(this),r_t.set(this,void 0),Noc(this,r_t,e,"f"),this.error=r}Errors(){return new D4i.ValueErrorIterator(k4i(this,uPr,"m",P4i).call(this))}};Y6.AssertError=n_t;r_t=new WeakMap,uPr=new WeakSet,P4i=a(function*(){this.error&&(yield this.error),yield*k4i(this,r_t,"f")},"_AssertError_Iterator");function R4i(t,e,r){if(!(0,Ooc.Check)(t,e,r))throw new n_t((0,D4i.Errors)(t,e,r))}a(R4i,"AssertValue");function Loc(...t){return t.length===3?R4i(t[0],t[1],t[2]):R4i(t[0],[],t[1])}a(Loc,"Assert")});var i_t=I(mne=>{"use strict";p();var Boc=mne&&mne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Foc=mne&&mne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Boc(e,t,r)};Object.defineProperty(mne,"__esModule",{value:!0});Foc(N4i(),mne)});var M4i=I(dPr=>{"use strict";p();Object.defineProperty(dPr,"__esModule",{value:!0});dPr.Clone=lye;var gne=P0();function Uoc(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=lye(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=lye(t[r]);return e}a(Uoc,"FromObject");function Qoc(t){return t.map(e=>lye(e))}a(Qoc,"FromArray");function qoc(t){return t.slice()}a(qoc,"FromTypedArray");function joc(t){return new Map(lye([...t.entries()]))}a(joc,"FromMap");function Hoc(t){return new Set(lye([...t.entries()]))}a(Hoc,"FromSet");function Goc(t){return new Date(t.toISOString())}a(Goc,"FromDate");function lye(t){if((0,gne.IsArray)(t))return Qoc(t);if((0,gne.IsDate)(t))return Goc(t);if((0,gne.IsTypedArray)(t))return qoc(t);if((0,gne.IsMap)(t))return joc(t);if((0,gne.IsSet)(t))return Hoc(t);if((0,gne.IsObject)(t))return Uoc(t);if((0,gne.IsValueType)(t))return t;throw new Error("ValueClone: Unable to clone value")}a(lye,"Clone")});var JD=I(Ane=>{"use strict";p();var $oc=Ane&&Ane.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Voc=Ane&&Ane.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$oc(e,t,r)};Object.defineProperty(Ane,"__esModule",{value:!0});Voc(M4i(),Ane)});var F4i=I(xLe=>{"use strict";p();Object.defineProperty(xLe,"__esModule",{value:!0});xLe.ValueCreateError=void 0;xLe.Create=Nsc;var Ba=P0(),Woc=uI(),zoc=JD(),fPr=YD(),O4i=vD(),Yoc=oAe(),L4i=bn(),Koc=Ff(),Joc=$gt(),m1=class extends Koc.TypeBoxError{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};xLe.ValueCreateError=m1;function rc(t){return(0,Joc.IsFunction)(t)?t():(0,zoc.Clone)(t)}a(rc,"FromDefault");function Zoc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):{}}a(Zoc,"FromAny");function Xoc(t,e){return{}}a(Xoc,"FromArgument");function esc(t,e){if(t.uniqueItems===!0&&!(0,Ba.HasPropertyKey)(t,"default"))throw new m1(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!(0,Ba.HasPropertyKey)(t,"default"))throw new m1(t,"Array with the contains constraint requires a default value");return"default"in t?rc(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>dI(t.items,e)):[]}a(esc,"FromArray");function tsc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):(async function*(){})()}a(tsc,"FromAsyncIterator");function rsc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):BigInt(0)}a(rsc,"FromBigInt");function nsc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):!1}a(nsc,"FromBoolean");function isc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return rc(t.default);{let r=dI(t.returns,e);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,o]of Object.entries(r)){let s=this;s[n]=o}}}:class{}}}a(isc,"FromConstructor");function osc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(osc,"FromDate");function ssc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):()=>dI(t.returns,e)}a(ssc,"FromFunction");function asc(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return dI(n,[...e,...r])}a(asc,"FromImport");function csc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):t.minimum!==void 0?t.minimum:0}a(csc,"FromInteger");function lsc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return rc(t.default);{let r=t.allOf.reduce((n,o)=>{let s=dI(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!(0,Woc.Check)(t,e,r))throw new m1(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(lsc,"FromIntersect");function usc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):(function*(){})()}a(usc,"FromIterator");function dsc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):t.const}a(dsc,"FromLiteral");function fsc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return rc(t.default);throw new m1(t,"Never types cannot be created. Consider using a default value.")}a(fsc,"FromNever");function psc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return rc(t.default);throw new m1(t,"Not types must have a default value")}a(psc,"FromNot");function hsc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):null}a(hsc,"FromNull");function msc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):t.minimum!==void 0?t.minimum:0}a(msc,"FromNumber");function gsc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return rc(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=dI(s,e));return n}}a(gsc,"FromObject");function Asc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):Promise.resolve(dI(t.item,e))}a(Asc,"FromPromise");function ysc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):{}}a(ysc,"FromRecord");function Esc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):dI((0,fPr.Deref)(t,e),e)}a(Esc,"FromRef");function _sc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return rc(t.default);throw new m1(t,"RegExp types cannot be created. Consider using a default value.")}a(_sc,"FromRegExp");function vsc(t,e){if(t.pattern!==void 0){if((0,Ba.HasPropertyKey)(t,"default"))return rc(t.default);throw new m1(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if((0,Ba.HasPropertyKey)(t,"default"))return rc(t.default);throw new m1(t,"String types with formats must specify a default value")}else return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(vsc,"FromString");function Csc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(Csc,"FromSymbol");function bsc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return rc(t.default);if(!(0,O4i.IsTemplateLiteralFinite)(t))throw new m1(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return(0,O4i.TemplateLiteralGenerate)(t)[0]}a(bsc,"FromTemplateLiteral");function Ssc(t,e){if(B4i++>Dsc)throw new m1(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):dI((0,fPr.Deref)(t,e),e)}a(Ssc,"FromThis");function Tsc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>dI(t.items[n],e))}a(Tsc,"FromTuple");function Isc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return rc(t.default)}a(Isc,"FromUndefined");function xsc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return rc(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return dI(t.anyOf[0],e)}a(xsc,"FromUnion");function wsc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(wsc,"FromUint8Array");function Rsc(t,e){return(0,Ba.HasPropertyKey)(t,"default")?rc(t.default):{}}a(Rsc,"FromUnknown");function ksc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return rc(t.default)}a(ksc,"FromVoid");function Psc(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return rc(t.default);throw new Error("User defined types must specify a default value")}a(Psc,"FromKind");function dI(t,e){let r=(0,fPr.Pushref)(t,e),n=t;switch(n[L4i.Kind]){case"Any":return Zoc(n,r);case"Argument":return Xoc(n,r);case"Array":return esc(n,r);case"AsyncIterator":return tsc(n,r);case"BigInt":return rsc(n,r);case"Boolean":return nsc(n,r);case"Constructor":return isc(n,r);case"Date":return osc(n,r);case"Function":return ssc(n,r);case"Import":return asc(n,r);case"Integer":return csc(n,r);case"Intersect":return lsc(n,r);case"Iterator":return usc(n,r);case"Literal":return dsc(n,r);case"Never":return fsc(n,r);case"Not":return psc(n,r);case"Null":return hsc(n,r);case"Number":return msc(n,r);case"Object":return gsc(n,r);case"Promise":return Asc(n,r);case"Record":return ysc(n,r);case"Ref":return Esc(n,r);case"RegExp":return _sc(n,r);case"String":return vsc(n,r);case"Symbol":return Csc(n,r);case"TemplateLiteral":return bsc(n,r);case"This":return Ssc(n,r);case"Tuple":return Tsc(n,r);case"Undefined":return Isc(n,r);case"Union":return xsc(n,r);case"Uint8Array":return wsc(n,r);case"Unknown":return Rsc(n,r);case"Void":return ksc(n,r);default:if(!Yoc.TypeRegistry.Has(n[L4i.Kind]))throw new m1(n,"Unknown type");return Psc(n,r)}}a(dI,"Visit");var Dsc=512,B4i=0;function Nsc(...t){return B4i=0,t.length===2?dI(t[0],t[1]):dI(t[0],[])}a(Nsc,"Create")});var o_t=I(yne=>{"use strict";p();var Msc=yne&&yne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Osc=yne&&yne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Msc(e,t,r)};Object.defineProperty(yne,"__esModule",{value:!0});Osc(F4i(),yne)});var j4i=I(kLe=>{"use strict";p();Object.defineProperty(kLe,"__esModule",{value:!0});kLe.ValueCastError=void 0;kLe.Cast=q4i;var YR=P0(),Lsc=Ff(),s_t=bn(),j$=o_t(),fI=uI(),Ene=JD(),RLe=YD(),wLe=class extends Lsc.TypeBoxError{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};kLe.ValueCastError=wLe;function U4i(t,e,r){if(t[s_t.Kind]==="Object"&&typeof r=="object"&&!(0,YR.IsNull)(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[s_t.Kind]==="Literal"&&u.const===r[l]?100:0,f=(0,fI.Check)(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[s_t.Kind]==="Union"){let o=t.anyOf.map(s=>(0,RLe.Deref)(s,e)).map(s=>U4i(s,e,r));return Math.max(...o)}else return(0,fI.Check)(t,e,r)?1:0}a(U4i,"ScoreUnion");function Bsc(t,e,r){let n=t.anyOf.map(c=>(0,RLe.Deref)(c,e)),[o,s]=[n[0],0];for(let c of n){let l=U4i(c,e,r);l>s&&(o=c,s=l)}return o}a(Bsc,"SelectUnion");function Fsc(t,e,r){if("default"in t)return typeof r=="function"?t.default:(0,Ene.Clone)(t.default);{let n=Bsc(t,e,r);return q4i(n,e,r)}}a(Fsc,"CastUnion");function Usc(t,e,r){return(0,fI.Check)(t,e,r)?(0,Ene.Clone)(r):(0,j$.Create)(t,e)}a(Usc,"DefaultClone");function Qsc(t,e,r){return(0,fI.Check)(t,e,r)?r:(0,j$.Create)(t,e)}a(Qsc,"Default");function qsc(t,e,r){if((0,fI.Check)(t,e,r))return(0,Ene.Clone)(r);let n=(0,YR.IsArray)(r)?(0,Ene.Clone)(r):(0,j$.Create)(t,e),o=(0,YR.IsNumber)(t.minItems)&&n.lengthnull)]:n,c=((0,YR.IsNumber)(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>ZD(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!(0,fI.Check)(t,e,l))throw new wLe(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(qsc,"FromArray");function jsc(t,e,r){if((0,fI.Check)(t,e,r))return(0,j$.Create)(t,e);let n=new Set(t.returns.required||[]),o=a(function(){},"result");for(let[s,c]of Object.entries(t.returns.properties))!n.has(s)&&r.prototype[s]===void 0||(o.prototype[s]=ZD(c,e,r.prototype[s]));return o}a(jsc,"FromConstructor");function Hsc(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return ZD(o,[...e,...n],r)}a(Hsc,"FromImport");function Q4i(t,e){return(0,YR.IsObject)(t)&&!(0,YR.IsObject)(e)||!(0,YR.IsObject)(t)&&(0,YR.IsObject)(e)?t:!(0,YR.IsObject)(t)||!(0,YR.IsObject)(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?Q4i(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(Q4i,"IntersectAssign");function Gsc(t,e,r){if((0,fI.Check)(t,e,r))return r;let n=(0,j$.Create)(t,e),o=Q4i(n,r);return(0,fI.Check)(t,e,o)?o:n}a(Gsc,"FromIntersect");function $sc(t,e,r){throw new wLe(t,"Never types cannot be cast")}a($sc,"FromNever");function Vsc(t,e,r){if((0,fI.Check)(t,e,r))return r;if(r===null||typeof r!="object")return(0,j$.Create)(t,e);let n=new Set(t.required||[]),o={};for(let[s,c]of Object.entries(t.properties))!n.has(s)&&r[s]===void 0||(o[s]=ZD(c,e,r[s]));if(typeof t.additionalProperties=="object"){let s=Object.getOwnPropertyNames(t.properties);for(let c of Object.getOwnPropertyNames(r))s.includes(c)||(o[c]=ZD(t.additionalProperties,e,r[c]))}return o}a(Vsc,"FromObject");function Wsc(t,e,r){if((0,fI.Check)(t,e,r))return(0,Ene.Clone)(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return(0,j$.Create)(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=ZD(o,e,l);return s}a(Wsc,"FromRecord");function zsc(t,e,r){return ZD((0,RLe.Deref)(t,e),e,r)}a(zsc,"FromRef");function Ysc(t,e,r){return ZD((0,RLe.Deref)(t,e),e,r)}a(Ysc,"FromThis");function Ksc(t,e,r){return(0,fI.Check)(t,e,r)?(0,Ene.Clone)(r):(0,YR.IsArray)(r)?t.items===void 0?[]:t.items.map((n,o)=>ZD(n,e,r[o])):(0,j$.Create)(t,e)}a(Ksc,"FromTuple");function Jsc(t,e,r){return(0,fI.Check)(t,e,r)?(0,Ene.Clone)(r):Fsc(t,e,r)}a(Jsc,"FromUnion");function ZD(t,e,r){let n=(0,YR.IsString)(t.$id)?(0,RLe.Pushref)(t,e):e,o=t;switch(t[s_t.Kind]){case"Array":return qsc(o,n,r);case"Constructor":return jsc(o,n,r);case"Import":return Hsc(o,n,r);case"Intersect":return Gsc(o,n,r);case"Never":return $sc(o,n,r);case"Object":return Vsc(o,n,r);case"Record":return Wsc(o,n,r);case"Ref":return zsc(o,n,r);case"This":return Ysc(o,n,r);case"Tuple":return Ksc(o,n,r);case"Union":return Jsc(o,n,r);case"Date":case"Symbol":case"Uint8Array":return Usc(t,e,r);default:return Qsc(o,n,r)}}a(ZD,"Visit");function q4i(...t){return t.length===3?ZD(t[0],t[1],t[2]):ZD(t[0],[],t[1])}a(q4i,"Cast")});var a_t=I(_ne=>{"use strict";p();var Zsc=_ne&&_ne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xsc=_ne&&_ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Zsc(e,t,r)};Object.defineProperty(_ne,"__esModule",{value:!0});Xsc(j4i(),_ne)});var G4i=I(hPr=>{"use strict";p();Object.defineProperty(hPr,"__esModule",{value:!0});hPr.Clean=fac;var eac=bD(),c_t=uI(),tac=JD(),pPr=YD(),H4i=bn(),XD=P0(),l_t=Es();function rac(t){return(0,l_t.IsKind)(t)&&t[H4i.Kind]!=="Unsafe"}a(rac,"IsCheckable");function nac(t,e,r){return(0,XD.IsArray)(r)?r.map(n=>g1(t.items,e,n)):r}a(nac,"FromArray");function iac(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return g1(o,[...e,...n],r)}a(iac,"FromImport");function oac(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>g1(l,e,(0,tac.Clone)(r))).reduce((l,u)=>(0,XD.IsObject)(u)?{...l,...u}:u,{});if(!(0,XD.IsObject)(r)||!(0,XD.IsObject)(s)||!(0,l_t.IsKind)(n))return s;let c=(0,eac.KeyOfPropertyKeys)(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||(0,c_t.Check)(n,e,r[l])&&(s[l]=g1(n,e,r[l]));return s}a(oac,"FromIntersect");function sac(t,e,r){if(!(0,XD.IsObject)(r)||(0,XD.IsArray)(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if((0,XD.HasPropertyKey)(t.properties,o)){r[o]=g1(t.properties[o],e,r[o]);continue}if((0,l_t.IsKind)(n)&&(0,c_t.Check)(n,e,r[o])){r[o]=g1(n,e,r[o]);continue}delete r[o]}return r}a(sac,"FromObject");function aac(t,e,r){if(!(0,XD.IsObject)(r))return r;let n=t.additionalProperties,o=Object.getOwnPropertyNames(r),[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of o){if(l.test(u)){r[u]=g1(c,e,r[u]);continue}if((0,l_t.IsKind)(n)&&(0,c_t.Check)(n,e,r[u])){r[u]=g1(n,e,r[u]);continue}delete r[u]}return r}a(aac,"FromRecord");function cac(t,e,r){return g1((0,pPr.Deref)(t,e),e,r)}a(cac,"FromRef");function lac(t,e,r){return g1((0,pPr.Deref)(t,e),e,r)}a(lac,"FromThis");function uac(t,e,r){if(!(0,XD.IsArray)(r))return r;if((0,XD.IsUndefined)(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(uac,"FromTuple");function dac(t,e,r){for(let n of t.anyOf)if(rac(n)&&(0,c_t.Check)(n,e,r))return g1(n,e,r);return r}a(dac,"FromUnion");function g1(t,e,r){let n=(0,XD.IsString)(t.$id)?(0,pPr.Pushref)(t,e):e,o=t;switch(o[H4i.Kind]){case"Array":return nac(o,n,r);case"Import":return iac(o,n,r);case"Intersect":return oac(o,n,r);case"Object":return sac(o,n,r);case"Record":return aac(o,n,r);case"Ref":return cac(o,n,r);case"This":return lac(o,n,r);case"Tuple":return uac(o,n,r);case"Union":return dac(o,n,r);default:return r}}a(g1,"Visit");function fac(...t){return t.length===3?g1(t[0],t[1],t[2]):g1(t[0],[],t[1])}a(fac,"Clean")});var u_t=I(vne=>{"use strict";p();var pac=vne&&vne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hac=vne&&vne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pac(e,t,r)};Object.defineProperty(vne,"__esModule",{value:!0});hac(G4i(),vne)});var Y4i=I(gPr=>{"use strict";p();Object.defineProperty(gPr,"__esModule",{value:!0});gPr.Convert=Jac;var mac=JD(),$4i=uI(),mPr=YD(),gac=bn(),Fa=P0();function d_t(t){return(0,Fa.IsString)(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(d_t,"IsStringNumeric");function Aac(t){return(0,Fa.IsBigInt)(t)||(0,Fa.IsBoolean)(t)||(0,Fa.IsNumber)(t)}a(Aac,"IsValueToString");function PLe(t){return t===!0||(0,Fa.IsNumber)(t)&&t===1||(0,Fa.IsBigInt)(t)&&t===BigInt("1")||(0,Fa.IsString)(t)&&(t.toLowerCase()==="true"||t==="1")}a(PLe,"IsValueTrue");function DLe(t){return t===!1||(0,Fa.IsNumber)(t)&&(t===0||Object.is(t,-0))||(0,Fa.IsBigInt)(t)&&t===BigInt("0")||(0,Fa.IsString)(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(DLe,"IsValueFalse");function yac(t){return(0,Fa.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(yac,"IsTimeStringWithTimeZone");function Eac(t){return(0,Fa.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(Eac,"IsTimeStringWithoutTimeZone");function _ac(t){return(0,Fa.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(_ac,"IsDateTimeStringWithTimeZone");function vac(t){return(0,Fa.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(vac,"IsDateTimeStringWithoutTimeZone");function Cac(t){return(0,Fa.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(Cac,"IsDateString");function bac(t,e){let r=W4i(t);return r===e?r:t}a(bac,"TryConvertLiteralString");function Sac(t,e){let r=z4i(t);return r===e?r:t}a(Sac,"TryConvertLiteralNumber");function Tac(t,e){let r=V4i(t);return r===e?r:t}a(Tac,"TryConvertLiteralBoolean");function Iac(t,e){return(0,Fa.IsString)(t.const)?bac(e,t.const):(0,Fa.IsNumber)(t.const)?Sac(e,t.const):(0,Fa.IsBoolean)(t.const)?Tac(e,t.const):e}a(Iac,"TryConvertLiteral");function V4i(t){return PLe(t)?!0:DLe(t)?!1:t}a(V4i,"TryConvertBoolean");function xac(t){let e=a(r=>r.split(".")[0],"truncateInteger");return d_t(t)?BigInt(e(t)):(0,Fa.IsNumber)(t)?BigInt(Math.trunc(t)):DLe(t)?BigInt(0):PLe(t)?BigInt(1):t}a(xac,"TryConvertBigInt");function W4i(t){return(0,Fa.IsSymbol)(t)&&t.description!==void 0?t.description.toString():Aac(t)?t.toString():t}a(W4i,"TryConvertString");function z4i(t){return d_t(t)?parseFloat(t):PLe(t)?1:DLe(t)?0:t}a(z4i,"TryConvertNumber");function wac(t){return d_t(t)?parseInt(t):(0,Fa.IsNumber)(t)?Math.trunc(t):PLe(t)?1:DLe(t)?0:t}a(wac,"TryConvertInteger");function Rac(t){return(0,Fa.IsString)(t)&&t.toLowerCase()==="null"?null:t}a(Rac,"TryConvertNull");function kac(t){return(0,Fa.IsString)(t)&&t==="undefined"?void 0:t}a(kac,"TryConvertUndefined");function Pac(t){return(0,Fa.IsDate)(t)?t:(0,Fa.IsNumber)(t)?new Date(t):PLe(t)?new Date(1):DLe(t)?new Date(0):d_t(t)?new Date(parseInt(t)):Eac(t)?new Date(`1970-01-01T${t}.000Z`):yac(t)?new Date(`1970-01-01T${t}`):vac(t)?new Date(`${t}.000Z`):_ac(t)?new Date(t):Cac(t)?new Date(`${t}T00:00:00.000Z`):t}a(Pac,"TryConvertDate");function Dac(t,e,r){return((0,Fa.IsArray)(r)?r:[r]).map(o=>eN(t.items,e,o))}a(Dac,"FromArray");function Nac(t,e,r){return xac(r)}a(Nac,"FromBigInt");function Mac(t,e,r){return V4i(r)}a(Mac,"FromBoolean");function Oac(t,e,r){return Pac(r)}a(Oac,"FromDate");function Lac(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return eN(o,[...e,...n],r)}a(Lac,"FromImport");function Bac(t,e,r){return wac(r)}a(Bac,"FromInteger");function Fac(t,e,r){return t.allOf.reduce((n,o)=>eN(o,e,n),r)}a(Fac,"FromIntersect");function Uac(t,e,r){return Iac(t,r)}a(Uac,"FromLiteral");function Qac(t,e,r){return Rac(r)}a(Qac,"FromNull");function qac(t,e,r){return z4i(r)}a(qac,"FromNumber");function jac(t,e,r){if(!(0,Fa.IsObject)(r)||(0,Fa.IsArray)(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))(0,Fa.HasPropertyKey)(r,n)&&(r[n]=eN(t.properties[n],e,r[n]));return r}a(jac,"FromObject");function Hac(t,e,r){if(!((0,Fa.IsObject)(r)&&!(0,Fa.IsArray)(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=eN(s,e,l);return r}a(Hac,"FromRecord");function Gac(t,e,r){return eN((0,mPr.Deref)(t,e),e,r)}a(Gac,"FromRef");function $ac(t,e,r){return W4i(r)}a($ac,"FromString");function Vac(t,e,r){return(0,Fa.IsString)(r)||(0,Fa.IsNumber)(r)?Symbol(r):r}a(Vac,"FromSymbol");function Wac(t,e,r){return eN((0,mPr.Deref)(t,e),e,r)}a(Wac,"FromThis");function zac(t,e,r){return(0,Fa.IsArray)(r)&&!(0,Fa.IsUndefined)(t.items)?r.map((o,s)=>s{"use strict";p();var Zac=Cne&&Cne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xac=Cne&&Cne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Zac(e,t,r)};Object.defineProperty(Cne,"__esModule",{value:!0});Xac(Y4i(),Cne)});var X4i=I(bne=>{"use strict";p();Object.defineProperty(bne,"__esModule",{value:!0});bne.TransformDecodeError=bne.TransformDecodeCheckError=void 0;bne.TransformDecode=fcc;var ecc=z5e(),K4i=bn(),J4i=Ff(),Z4i=bD(),yPr=YD(),tcc=uI(),K6=P0(),NLe=Es(),APr=class extends J4i.TypeBoxError{static{a(this,"TransformDecodeCheckError")}constructor(e,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=e,this.value=r,this.error=n}};bne.TransformDecodeCheckError=APr;var p_t=class extends J4i.TypeBoxError{static{a(this,"TransformDecodeError")}constructor(e,r,n,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=e,this.path=r,this.value=n,this.error=o}};bne.TransformDecodeError=p_t;function ef(t,e,r){try{return(0,NLe.IsTransform)(t)?t[K4i.TransformKind].Decode(r):r}catch(n){throw new p_t(t,e,r,n)}}a(ef,"Default");function rcc(t,e,r,n){return(0,K6.IsArray)(n)?ef(t,r,n.map((o,s)=>tN(t.items,e,`${r}/${s}`,o))):ef(t,r,n)}a(rcc,"FromArray");function ncc(t,e,r,n){if(!(0,K6.IsObject)(n)||(0,K6.IsValueType)(n))return ef(t,r,n);let o=(0,Z4i.KeyOfPropertyEntries)(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=tN(h,e,`${r}/${f}`,c[f]));if(!(0,NLe.IsTransform)(t.unevaluatedProperties))return ef(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=ef(u,`${r}/${f}`,d[f]));return ef(t,r,d)}a(ncc,"FromIntersect");function icc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=tN(s,[...e,...o],r,n);return ef(t,r,c)}a(icc,"FromImport");function occ(t,e,r,n){return ef(t,r,tN(t.not,e,r,n))}a(occ,"FromNot");function scc(t,e,r,n){if(!(0,K6.IsObject)(n))return ef(t,r,n);let o=(0,Z4i.KeyOfPropertyKeys)(t),s={...n};for(let d of o)(0,K6.HasPropertyKey)(s,d)&&((0,K6.IsUndefined)(s[d])&&(!(0,NLe.IsUndefined)(t.properties[d])||ecc.TypeSystemPolicy.IsExactOptionalProperty(s,d))||(s[d]=tN(t.properties[d],e,`${r}/${d}`,s[d])));if(!(0,NLe.IsSchema)(t.additionalProperties))return ef(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=ef(l,`${r}/${d}`,u[d]));return ef(t,r,u)}a(scc,"FromObject");function acc(t,e,r,n){if(!(0,K6.IsObject)(n))return ef(t,r,n);let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=new RegExp(o),c={...n};for(let f of Object.getOwnPropertyNames(n))s.test(f)&&(c[f]=tN(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!(0,NLe.IsSchema)(t.additionalProperties))return ef(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=ef(u,`${r}/${f}`,d[f]));return ef(t,r,d)}a(acc,"FromRecord");function ccc(t,e,r,n){let o=(0,yPr.Deref)(t,e);return ef(t,r,tN(o,e,r,n))}a(ccc,"FromRef");function lcc(t,e,r,n){let o=(0,yPr.Deref)(t,e);return ef(t,r,tN(o,e,r,n))}a(lcc,"FromThis");function ucc(t,e,r,n){return(0,K6.IsArray)(n)&&(0,K6.IsArray)(t.items)?ef(t,r,t.items.map((o,s)=>tN(o,e,`${r}/${s}`,n[s]))):ef(t,r,n)}a(ucc,"FromTuple");function dcc(t,e,r,n){for(let o of t.anyOf){if(!(0,tcc.Check)(o,e,n))continue;let s=tN(o,e,r,n);return ef(t,r,s)}return ef(t,r,n)}a(dcc,"FromUnion");function tN(t,e,r,n){let o=(0,yPr.Pushref)(t,e),s=t;switch(t[K4i.Kind]){case"Array":return rcc(s,o,r,n);case"Import":return icc(s,o,r,n);case"Intersect":return ncc(s,o,r,n);case"Not":return occ(s,o,r,n);case"Object":return scc(s,o,r,n);case"Record":return acc(s,o,r,n);case"Ref":return ccc(s,o,r,n);case"Symbol":return ef(s,r,n);case"This":return lcc(s,o,r,n);case"Tuple":return ucc(s,o,r,n);case"Union":return dcc(s,o,r,n);default:return ef(s,r,n)}}a(tN,"Visit");function fcc(t,e,r){return tN(t,e,"",r)}a(fcc,"TransformDecode")});var iLi=I(Sne=>{"use strict";p();Object.defineProperty(Sne,"__esModule",{value:!0});Sne.TransformEncodeError=Sne.TransformEncodeCheckError=void 0;Sne.TransformEncode=Scc;var pcc=z5e(),tLi=bn(),rLi=Ff(),nLi=bD(),_Pr=YD(),eLi=uI(),H$=P0(),MLe=Es(),EPr=class extends rLi.TypeBoxError{static{a(this,"TransformEncodeCheckError")}constructor(e,r,n){super("The encoded value does not match the expected schema"),this.schema=e,this.value=r,this.error=n}};Sne.TransformEncodeCheckError=EPr;var h_t=class extends rLi.TypeBoxError{static{a(this,"TransformEncodeError")}constructor(e,r,n,o){super(`${o instanceof Error?o.message:"Unknown error"}`),this.schema=e,this.path=r,this.value=n,this.error=o}};Sne.TransformEncodeError=h_t;function Cy(t,e,r){try{return(0,MLe.IsTransform)(t)?t[tLi.TransformKind].Encode(r):r}catch(n){throw new h_t(t,e,r,n)}}a(Cy,"Default");function hcc(t,e,r,n){let o=Cy(t,r,n);return(0,H$.IsArray)(o)?o.map((s,c)=>rN(t.items,e,`${r}/${c}`,s)):o}a(hcc,"FromArray");function mcc(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=Cy(t,r,n);return rN(s,[...e,...o],r,c)}a(mcc,"FromImport");function gcc(t,e,r,n){let o=Cy(t,r,n);if(!(0,H$.IsObject)(n)||(0,H$.IsValueType)(n))return o;let s=(0,nLi.KeyOfPropertyEntries)(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=rN(m,e,`${r}/${h}`,l[h]));if(!(0,MLe.IsTransform)(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=Cy(d,`${r}/${h}`,f[h]));return f}a(gcc,"FromIntersect");function Acc(t,e,r,n){return Cy(t.not,r,Cy(t,r,n))}a(Acc,"FromNot");function ycc(t,e,r,n){let o=Cy(t,r,n);if(!(0,H$.IsObject)(o))return o;let s=(0,nLi.KeyOfPropertyKeys)(t),c={...o};for(let f of s)(0,H$.HasPropertyKey)(c,f)&&((0,H$.IsUndefined)(c[f])&&(!(0,MLe.IsUndefined)(t.properties[f])||pcc.TypeSystemPolicy.IsExactOptionalProperty(c,f))||(c[f]=rN(t.properties[f],e,`${r}/${f}`,c[f])));if(!(0,MLe.IsSchema)(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=Cy(u,`${r}/${f}`,d[f]));return d}a(ycc,"FromObject");function Ecc(t,e,r,n){let o=Cy(t,r,n);if(!(0,H$.IsObject)(n))return o;let s=Object.getOwnPropertyNames(t.patternProperties)[0],c=new RegExp(s),l={...o};for(let h of Object.getOwnPropertyNames(n))c.test(h)&&(l[h]=rN(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!(0,MLe.IsSchema)(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=Cy(d,`${r}/${h}`,f[h]));return f}a(Ecc,"FromRecord");function _cc(t,e,r,n){let o=(0,_Pr.Deref)(t,e),s=rN(o,e,r,n);return Cy(t,r,s)}a(_cc,"FromRef");function vcc(t,e,r,n){let o=(0,_Pr.Deref)(t,e),s=rN(o,e,r,n);return Cy(t,r,s)}a(vcc,"FromThis");function Ccc(t,e,r,n){let o=Cy(t,r,n);return(0,H$.IsArray)(t.items)?t.items.map((s,c)=>rN(s,e,`${r}/${c}`,o[c])):[]}a(Ccc,"FromTuple");function bcc(t,e,r,n){for(let o of t.anyOf){if(!(0,eLi.Check)(o,e,n))continue;let s=rN(o,e,r,n);return Cy(t,r,s)}for(let o of t.anyOf){let s=rN(o,e,r,n);if((0,eLi.Check)(t,e,s))return Cy(t,r,s)}return Cy(t,r,n)}a(bcc,"FromUnion");function rN(t,e,r,n){let o=(0,_Pr.Pushref)(t,e),s=t;switch(t[tLi.Kind]){case"Array":return hcc(s,o,r,n);case"Import":return mcc(s,o,r,n);case"Intersect":return gcc(s,o,r,n);case"Not":return Acc(s,o,r,n);case"Object":return ycc(s,o,r,n);case"Record":return Ecc(s,o,r,n);case"Ref":return _cc(s,o,r,n);case"This":return vcc(s,o,r,n);case"Tuple":return Ccc(s,o,r,n);case"Union":return bcc(s,o,r,n);default:return Cy(s,r,n)}}a(rN,"Visit");function Scc(t,e,r){return rN(t,e,"",r)}a(Scc,"TransformEncode")});var oLi=I(bPr=>{"use strict";p();Object.defineProperty(bPr,"__esModule",{value:!0});bPr.HasTransform=jcc;var CPr=YD(),Tcc=bn(),Mm=Es(),Icc=P0();function xcc(t,e){return(0,Mm.IsTransform)(t)||M0(t.items,e)}a(xcc,"FromArray");function wcc(t,e){return(0,Mm.IsTransform)(t)||M0(t.items,e)}a(wcc,"FromAsyncIterator");function Rcc(t,e){return(0,Mm.IsTransform)(t)||M0(t.returns,e)||t.parameters.some(r=>M0(r,e))}a(Rcc,"FromConstructor");function kcc(t,e){return(0,Mm.IsTransform)(t)||M0(t.returns,e)||t.parameters.some(r=>M0(r,e))}a(kcc,"FromFunction");function Pcc(t,e){return(0,Mm.IsTransform)(t)||(0,Mm.IsTransform)(t.unevaluatedProperties)||t.allOf.some(r=>M0(r,e))}a(Pcc,"FromIntersect");function Dcc(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return(0,Mm.IsTransform)(t)||M0(n,[...r,...e])}a(Dcc,"FromImport");function Ncc(t,e){return(0,Mm.IsTransform)(t)||M0(t.items,e)}a(Ncc,"FromIterator");function Mcc(t,e){return(0,Mm.IsTransform)(t)||M0(t.not,e)}a(Mcc,"FromNot");function Occ(t,e){return(0,Mm.IsTransform)(t)||Object.values(t.properties).some(r=>M0(r,e))||(0,Mm.IsSchema)(t.additionalProperties)&&M0(t.additionalProperties,e)}a(Occ,"FromObject");function Lcc(t,e){return(0,Mm.IsTransform)(t)||M0(t.item,e)}a(Lcc,"FromPromise");function Bcc(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return(0,Mm.IsTransform)(t)||M0(n,e)||(0,Mm.IsSchema)(t.additionalProperties)&&(0,Mm.IsTransform)(t.additionalProperties)}a(Bcc,"FromRecord");function Fcc(t,e){return(0,Mm.IsTransform)(t)?!0:M0((0,CPr.Deref)(t,e),e)}a(Fcc,"FromRef");function Ucc(t,e){return(0,Mm.IsTransform)(t)?!0:M0((0,CPr.Deref)(t,e),e)}a(Ucc,"FromThis");function Qcc(t,e){return(0,Mm.IsTransform)(t)||!(0,Icc.IsUndefined)(t.items)&&t.items.some(r=>M0(r,e))}a(Qcc,"FromTuple");function qcc(t,e){return(0,Mm.IsTransform)(t)||t.anyOf.some(r=>M0(r,e))}a(qcc,"FromUnion");function M0(t,e){let r=(0,CPr.Pushref)(t,e),n=t;if(t.$id&&vPr.has(t.$id))return!1;switch(t.$id&&vPr.add(t.$id),t[Tcc.Kind]){case"Array":return xcc(n,r);case"AsyncIterator":return wcc(n,r);case"Constructor":return Rcc(n,r);case"Function":return kcc(n,r);case"Import":return Dcc(n,r);case"Intersect":return Pcc(n,r);case"Iterator":return Ncc(n,r);case"Not":return Mcc(n,r);case"Object":return Occ(n,r);case"Promise":return Lcc(n,r);case"Record":return Bcc(n,r);case"Ref":return Fcc(n,r);case"This":return Ucc(n,r);case"Tuple":return Qcc(n,r);case"Union":return qcc(n,r);default:return(0,Mm.IsTransform)(t)}}a(M0,"Visit");var vPr=new Set;function jcc(t,e){return vPr.clear(),M0(t,e)}a(jcc,"HasTransform")});var OLe=I(J6=>{"use strict";p();var Hcc=J6&&J6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SPr=J6&&J6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Hcc(e,t,r)};Object.defineProperty(J6,"__esModule",{value:!0});SPr(X4i(),J6);SPr(iLi(),J6);SPr(oLi(),J6)});var sLi=I(IPr=>{"use strict";p();Object.defineProperty(IPr,"__esModule",{value:!0});IPr.Decode=Vcc;var TPr=OLe(),Gcc=uI(),$cc=cye();function Vcc(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]];if(!(0,Gcc.Check)(e,r,n))throw new TPr.TransformDecodeCheckError(e,n,(0,$cc.Errors)(e,r,n).First());return(0,TPr.HasTransform)(e,r)?(0,TPr.TransformDecode)(e,r,n):n}a(Vcc,"Decode")});var xPr=I(Tne=>{"use strict";p();var Wcc=Tne&&Tne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zcc=Tne&&Tne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Wcc(e,t,r)};Object.defineProperty(Tne,"__esModule",{value:!0});zcc(sLi(),Tne)});var cLi=I(kPr=>{"use strict";p();Object.defineProperty(kPr,"__esModule",{value:!0});kPr.Default=clc;var Ycc=uI(),aLi=JD(),RPr=YD(),Kcc=bn(),A1=P0(),Jcc=Es();function Z6(t,e){let r=(0,A1.HasPropertyKey)(t,"default")?t.default:void 0,n=(0,A1.IsFunction)(r)?r():(0,aLi.Clone)(r);return(0,A1.IsUndefined)(e)?n:(0,A1.IsObject)(e)&&(0,A1.IsObject)(n)?Object.assign(n,e):e}a(Z6,"ValueOrDefault");function wPr(t){return(0,Jcc.IsKind)(t)&&"default"in t}a(wPr,"HasDefaultProperty");function Zcc(t,e,r){if((0,A1.IsArray)(r)){for(let o=0;o{let c=Uv(s,e,n);return(0,A1.IsObject)(c)?{...o,...c}:c},{})}a(tlc,"FromIntersect");function rlc(t,e,r){let n=Z6(t,r);if(!(0,A1.IsObject)(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=Uv(t.properties[s],e,n[s]);(0,A1.IsUndefined)(c)||(n[s]=Uv(t.properties[s],e,n[s]))}if(!wPr(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=Uv(t.additionalProperties,e,n[s]));return n}a(rlc,"FromObject");function nlc(t,e,r){let n=Z6(t,r);if(!(0,A1.IsObject)(n))return n;let o=t.additionalProperties,[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of Object.getOwnPropertyNames(n))l.test(u)&&wPr(c)&&(n[u]=Uv(c,e,n[u]));if(!wPr(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=Uv(o,e,n[u]));return n}a(nlc,"FromRecord");function ilc(t,e,r){return Uv((0,RPr.Deref)(t,e),e,Z6(t,r))}a(ilc,"FromRef");function olc(t,e,r){return Uv((0,RPr.Deref)(t,e),e,r)}a(olc,"FromThis");function slc(t,e,r){let n=Z6(t,r);if(!(0,A1.IsArray)(n)||(0,A1.IsUndefined)(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;c{"use strict";p();var llc=Ine&&Ine.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ulc=Ine&&Ine.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&llc(e,t,r)};Object.defineProperty(Ine,"__esModule",{value:!0});ulc(cLi(),Ine)});var dLi=I(nN=>{"use strict";p();Object.defineProperty(nN,"__esModule",{value:!0});nN.ValuePointerRootDeleteError=nN.ValuePointerRootSetError=void 0;nN.Format=LLe;nN.Set=dlc;nN.Delete=flc;nN.Has=plc;nN.Get=hlc;var uLi=Ff(),g_t=class extends uLi.TypeBoxError{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}};nN.ValuePointerRootSetError=g_t;var A_t=class extends uLi.TypeBoxError{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};nN.ValuePointerRootDeleteError=A_t;function lLi(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(lLi,"Escape");function*LLe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;n{"use strict";p();var mlc=fL&&fL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),glc=fL&&fL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Alc=fL&&fL.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(PPr,"__esModule",{value:!0});PPr.Equal=E_t;var X6=P0();function ylc(t,e){if(!(0,X6.IsObject)(e))return!1;let r=[...Object.keys(t),...Object.getOwnPropertySymbols(t)],n=[...Object.keys(e),...Object.getOwnPropertySymbols(e)];return r.length!==n.length?!1:r.every(o=>E_t(t[o],e[o]))}a(ylc,"ObjectType");function Elc(t,e){return(0,X6.IsDate)(e)&&t.getTime()===e.getTime()}a(Elc,"DateType");function _lc(t,e){return!(0,X6.IsArray)(e)||t.length!==e.length?!1:t.every((r,n)=>E_t(r,e[n]))}a(_lc,"ArrayType");function vlc(t,e){return!(0,X6.IsTypedArray)(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>E_t(r,e[n]))}a(vlc,"TypedArrayType");function Clc(t,e){return t===e}a(Clc,"ValueType");function E_t(t,e){if((0,X6.IsDate)(t))return Elc(t,e);if((0,X6.IsTypedArray)(t))return vlc(t,e);if((0,X6.IsArray)(t))return _lc(t,e);if((0,X6.IsObject)(t))return ylc(t,e);if((0,X6.IsValueType)(t))return Clc(t,e);throw new Error("ValueEquals: Unable to compare value")}a(E_t,"Equal")});var gLi=I(by=>{"use strict";p();Object.defineProperty(by,"__esModule",{value:!0});by.ValueDiffError=by.Edit=by.Delete=by.Update=by.Insert=void 0;by.Diff=klc;by.Patch=Nlc;var pL=P0(),NPr=y_t(),MPr=JD(),blc=DPr(),Slc=Ff(),OPr=GE(),LPr=kv(),BPr=XG(),pLi=o$(),Tlc=Rp();by.Insert=(0,LPr.Object)({type:(0,OPr.Literal)("insert"),path:(0,BPr.String)(),value:(0,pLi.Unknown)()});by.Update=(0,LPr.Object)({type:(0,OPr.Literal)("update"),path:(0,BPr.String)(),value:(0,pLi.Unknown)()});by.Delete=(0,LPr.Object)({type:(0,OPr.Literal)("delete"),path:(0,BPr.String)()});by.Edit=(0,Tlc.Union)([by.Insert,by.Update,by.Delete]);var BLe=class extends Slc.TypeBoxError{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};by.ValueDiffError=BLe;function __t(t,e){return{type:"update",path:t,value:e}}a(__t,"CreateUpdate");function hLi(t,e){return{type:"insert",path:t,value:e}}a(hLi,"CreateInsert");function mLi(t){return{type:"delete",path:t}}a(mLi,"CreateDelete");function fLi(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new BLe(t,"Cannot diff objects with symbols")}a(fLi,"AssertDiffable");function*Ilc(t,e,r){if(fLi(e),fLi(r),!(0,pL.IsStandardObject)(r))return yield __t(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)(0,pL.HasPropertyKey)(e,s)||(yield hLi(`${t}/${s}`,r[s]));for(let s of n)(0,pL.HasPropertyKey)(r,s)&&((0,blc.Equal)(e,r)||(yield*v_t(`${t}/${s}`,e[s],r[s])));for(let s of n)(0,pL.HasPropertyKey)(r,s)||(yield mLi(`${t}/${s}`))}a(Ilc,"ObjectType");function*xlc(t,e,r){if(!(0,pL.IsArray)(r))return yield __t(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(Plc,"IsRootUpdate");function Dlc(t){return t.length===0}a(Dlc,"IsIdentity");function Nlc(t,e){if(Plc(e))return(0,MPr.Clone)(e[0].value);if(Dlc(e))return(0,MPr.Clone)(t);let r=(0,MPr.Clone)(t);for(let n of e)switch(n.type){case"insert":{NPr.ValuePointer.Set(r,n.path,n.value);break}case"update":{NPr.ValuePointer.Set(r,n.path,n.value);break}case"delete":{NPr.ValuePointer.Delete(r,n.path);break}}return r}a(Nlc,"Patch")});var FPr=I(xne=>{"use strict";p();var Mlc=xne&&xne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Olc=xne&&xne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Mlc(e,t,r)};Object.defineProperty(xne,"__esModule",{value:!0});Olc(gLi(),xne)});var ALi=I(QPr=>{"use strict";p();Object.defineProperty(QPr,"__esModule",{value:!0});QPr.Encode=Flc;var UPr=OLe(),Llc=uI(),Blc=cye();function Flc(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=(0,UPr.HasTransform)(e,r)?(0,UPr.TransformEncode)(e,r,n):n;if(!(0,Llc.Check)(e,r,o))throw new UPr.TransformEncodeCheckError(e,o,(0,Blc.Errors)(e,r,o).First());return o}a(Flc,"Encode")});var qPr=I(wne=>{"use strict";p();var Ulc=wne&&wne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qlc=wne&&wne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ulc(e,t,r)};Object.defineProperty(wne,"__esModule",{value:!0});Qlc(ALi(),wne)});var jPr=I(Rne=>{"use strict";p();var qlc=Rne&&Rne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jlc=Rne&&Rne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qlc(e,t,r)};Object.defineProperty(Rne,"__esModule",{value:!0});jlc(DPr(),Rne)});var ELi=I(ULe=>{"use strict";p();Object.defineProperty(ULe,"__esModule",{value:!0});ULe.ValueMutateError=void 0;ULe.Mutate=Ylc;var iN=P0(),b_t=y_t(),HPr=JD(),Hlc=Ff();function C_t(t){return(0,iN.IsObject)(t)&&!(0,iN.IsArray)(t)}a(C_t,"IsStandardObject");var FLe=class extends Hlc.TypeBoxError{static{a(this,"ValueMutateError")}constructor(e){super(e)}};ULe.ValueMutateError=FLe;function Glc(t,e,r,n){if(!C_t(r))b_t.ValuePointer.Set(t,e,(0,HPr.Clone)(n));else{let o=Object.getOwnPropertyNames(r),s=Object.getOwnPropertyNames(n);for(let c of o)s.includes(c)||delete r[c];for(let c of s)o.includes(c)||(r[c]=null);for(let c of s)GPr(t,`${e}/${c}`,r[c],n[c])}}a(Glc,"ObjectType");function $lc(t,e,r,n){if(!(0,iN.IsArray)(r))b_t.ValuePointer.Set(t,e,(0,HPr.Clone)(n));else{for(let o=0;o{"use strict";p();var Klc=kne&&kne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Jlc=kne&&kne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Klc(e,t,r)};Object.defineProperty(kne,"__esModule",{value:!0});Jlc(ELi(),kne)});var vLi=I(oN=>{"use strict";p();Object.defineProperty(oN,"__esModule",{value:!0});oN.ParseDefault=oN.ParseRegistry=oN.ParseError=void 0;oN.Parse=suc;var Zlc=Ff(),S_t=OLe(),Xlc=i_t(),euc=a_t(),tuc=u_t(),ruc=JD(),nuc=f_t(),iuc=m_t(),_Li=P0(),QLe=class extends Zlc.TypeBoxError{static{a(this,"ParseError")}constructor(e){super(e)}};oN.ParseError=QLe;var VPr;(function(t){let e=new Map([["Assert",(s,c,l)=>((0,Xlc.Assert)(s,c,l),l)],["Cast",(s,c,l)=>(0,euc.Cast)(s,c,l)],["Clean",(s,c,l)=>(0,tuc.Clean)(s,c,l)],["Clone",(s,c,l)=>(0,ruc.Clone)(l)],["Convert",(s,c,l)=>(0,nuc.Convert)(s,c,l)],["Decode",(s,c,l)=>(0,S_t.HasTransform)(s,c)?(0,S_t.TransformDecode)(s,c,l):l],["Default",(s,c,l)=>(0,iuc.Default)(s,c,l)],["Encode",(s,c,l)=>(0,S_t.HasTransform)(s,c)?(0,S_t.TransformEncode)(s,c,l):l]]);function r(s){e.delete(s)}a(r,"Delete"),t.Delete=r;function n(s,c){e.set(s,c)}a(n,"Set"),t.Set=n;function o(s){return e.get(s)}a(o,"Get"),t.Get=o})(VPr||(oN.ParseRegistry=VPr={}));oN.ParseDefault=["Clone","Clean","Default","Convert","Assert","Decode"];function ouc(t,e,r,n){return t.reduce((o,s)=>{let c=VPr.Get(s);if((0,_Li.IsUndefined)(c))throw new QLe(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(ouc,"ParseValue");function suc(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?(0,_Li.IsArray)(t[0])?[t[0],t[1],[],t[2]]:[oN.ParseDefault,t[0],t[1],t[2]]:t.length===2?[oN.ParseDefault,t[0],[],t[1]]:(()=>{throw new QLe("Invalid Arguments")})();return ouc(e,r,n,o)}a(suc,"Parse")});var WPr=I(Pne=>{"use strict";p();var auc=Pne&&Pne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cuc=Pne&&Pne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&auc(e,t,r)};Object.defineProperty(Pne,"__esModule",{value:!0});cuc(vLi(),Pne)});var bLi=I(_s=>{"use strict";p();Object.defineProperty(_s,"__esModule",{value:!0});_s.Parse=_s.Mutate=_s.Hash=_s.Equal=_s.Encode=_s.Edit=_s.Patch=_s.Diff=_s.Default=_s.Decode=_s.Create=_s.Convert=_s.Clone=_s.Clean=_s.Check=_s.Cast=_s.Assert=_s.ValueErrorIterator=_s.Errors=void 0;var CLi=cye();Object.defineProperty(_s,"Errors",{enumerable:!0,get:a(function(){return CLi.Errors},"get")});Object.defineProperty(_s,"ValueErrorIterator",{enumerable:!0,get:a(function(){return CLi.ValueErrorIterator},"get")});var luc=i_t();Object.defineProperty(_s,"Assert",{enumerable:!0,get:a(function(){return luc.Assert},"get")});var uuc=a_t();Object.defineProperty(_s,"Cast",{enumerable:!0,get:a(function(){return uuc.Cast},"get")});var duc=uI();Object.defineProperty(_s,"Check",{enumerable:!0,get:a(function(){return duc.Check},"get")});var fuc=u_t();Object.defineProperty(_s,"Clean",{enumerable:!0,get:a(function(){return fuc.Clean},"get")});var puc=JD();Object.defineProperty(_s,"Clone",{enumerable:!0,get:a(function(){return puc.Clone},"get")});var huc=f_t();Object.defineProperty(_s,"Convert",{enumerable:!0,get:a(function(){return huc.Convert},"get")});var muc=o_t();Object.defineProperty(_s,"Create",{enumerable:!0,get:a(function(){return muc.Create},"get")});var guc=xPr();Object.defineProperty(_s,"Decode",{enumerable:!0,get:a(function(){return guc.Decode},"get")});var Auc=m_t();Object.defineProperty(_s,"Default",{enumerable:!0,get:a(function(){return Auc.Default},"get")});var zPr=FPr();Object.defineProperty(_s,"Diff",{enumerable:!0,get:a(function(){return zPr.Diff},"get")});Object.defineProperty(_s,"Patch",{enumerable:!0,get:a(function(){return zPr.Patch},"get")});Object.defineProperty(_s,"Edit",{enumerable:!0,get:a(function(){return zPr.Edit},"get")});var yuc=qPr();Object.defineProperty(_s,"Encode",{enumerable:!0,get:a(function(){return yuc.Encode},"get")});var Euc=jPr();Object.defineProperty(_s,"Equal",{enumerable:!0,get:a(function(){return Euc.Equal},"get")});var _uc=vLe();Object.defineProperty(_s,"Hash",{enumerable:!0,get:a(function(){return _uc.Hash},"get")});var vuc=$Pr();Object.defineProperty(_s,"Mutate",{enumerable:!0,get:a(function(){return vuc.Mutate},"get")});var Cuc=WPr();Object.defineProperty(_s,"Parse",{enumerable:!0,get:a(function(){return Cuc.Parse},"get")})});var SLi=I(hL=>{"use strict";p();var buc=hL&&hL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Suc=hL&&hL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Tuc=hL&&hL.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var Iuc=zc&&zc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nA=zc&&zc.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Iuc(e,t,r)};Object.defineProperty(zc,"__esModule",{value:!0});zc.Value=zc.ValueErrorIterator=zc.ValueErrorType=void 0;var TLi=cye();Object.defineProperty(zc,"ValueErrorType",{enumerable:!0,get:a(function(){return TLi.ValueErrorType},"get")});Object.defineProperty(zc,"ValueErrorIterator",{enumerable:!0,get:a(function(){return TLi.ValueErrorIterator},"get")});nA(P0(),zc);nA(i_t(),zc);nA(a_t(),zc);nA(uI(),zc);nA(u_t(),zc);nA(JD(),zc);nA(f_t(),zc);nA(o_t(),zc);nA(xPr(),zc);nA(m_t(),zc);nA(FPr(),zc);nA(qPr(),zc);nA(jPr(),zc);nA(vLe(),zc);nA($Pr(),zc);nA(WPr(),zc);nA(y_t(),zc);nA(OLe(),zc);var xuc=SLi();Object.defineProperty(zc,"Value",{enumerable:!0,get:a(function(){return xuc.Value},"get")})});var xLi=I(T_t=>{"use strict";p();Object.defineProperty(T_t,"__esModule",{value:!0});T_t.assertShape=void 0;var ILi=YPr(),wuc=a((t,e)=>{if(ILi.Value.Check(t,e))return e;let r=`Typebox schema validation failed: +${[...ILi.Value.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` +`)}`;throw new Error(r)},"assertShape");T_t.assertShape=wuc});var Dne={};Ri(Dne,{CAPIClient:()=>Muc,RequestType:()=>RLi});async function Duc(t){if(!t)return;let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),r=Math.floor(Date.now()/1e3).toString(),n=new TextEncoder().encode(r),o=await crypto.subtle.sign("HMAC",e,n),s=Array.from(new Uint8Array(o)).map(c=>c.toString(16).padStart(2,"0")).join("");return`${r}.${s}`}function Nuc(t){return new Set(["ChatCompletions","ChatResponses","ChatMessages","CAPIEmbeddings","Models","RemoteAgent","CodeReviewAgent","RemoteAgentChat","ListSkills","SearchSkill","ModelPolicy","ListModel","AutoModels","CopilotSessionLogs","CopilotSessionDetails","CopilotSessions","CopilotAgentJob","CCAModelsList","CopilotCustomAgents","CopilotAgentMemory","ModelRouter"]).has(t)}var Ruc,KPr,qLe,kuc,Puc,RLi,Muc,Nne=Se(()=>{p();Ruc=class{static{a(this,"y")}async fetch(t,e){let r={method:e.method||"GET",headers:e.headers,signal:e.signal};e.json?(r.body=JSON.stringify(e.json),r.headers={"Content-Type":"application/json",...r.headers}):e.body&&(r.body=e.body);let n,o;e.timeout&&!e.signal&&(o=new AbortController,r.signal=o.signal,n=setTimeout(()=>{o.abort()},e.timeout));try{let s=await fetch(t,r);return n&&clearTimeout(n),s}catch(s){throw n&&clearTimeout(n),s}}async fetchWithPagination(t,e){let r=[],n=e.pageSize??20,o=e.startPage??1,s=!1;do{let c=e.buildUrl(t,n,o),l=await this.fetch(c,e);if(!l.ok)return r;let u=await l.json(),d=e.getItemsFromResponse(u);r.push(...d),s=d.length===n,o++}while(s);return r}createWebSocket(t,e){return{webSocket:new WebSocket(t)}}},KPr=class wLi{static{a(this,"h")}constructor(){this._telemetryBaseUrl="https://copilot-telemetry.githubusercontent.com",this._originTrackerUrl="https://origin-tracker.githubusercontent.com",this._dotcomAPIUrl=this._getDotComAPIUrl(),this._proxyBaseUrl=this._getProxyUrl(void 0),this._capiBaseUrl=this._getCAPIUrl(void 0)}updateDomains(e,r){let n=this._dotcomAPIUrl,o=this._capiBaseUrl,s=this._telemetryBaseUrl,c=this._proxyBaseUrl;return this._enterpriseUrlConfig!==r&&(this._enterpriseUrlConfig=r,this._dotcomAPIUrl=this._getDotComAPIUrl()),e?(this._proxyBaseUrl=this._getProxyUrl(e),this._capiBaseUrl=this._getCAPIUrl(e),this._telemetryBaseUrl=e.endpoints.telemetry||"https://copilot-telemetry.githubusercontent.com",e.endpoints["origin-tracker"]&&(this._originTrackerUrl=e.endpoints["origin-tracker"])):(this._capiBaseUrl="https://api.githubcopilot.com",this._telemetryBaseUrl="https://copilot-telemetry.githubusercontent.com"),{dotcomUrlChanged:n!==this._dotcomAPIUrl,capiUrlChanged:o!==this._capiBaseUrl,telemetryUrlChanged:s!==this._telemetryBaseUrl,proxyUrlChanged:c!==this._proxyBaseUrl}}_getDotComAPIUrl(){if(this._enterpriseUrlConfig)try{let e=new URL(this._enterpriseUrlConfig);return`${e.protocol}//api.${e.hostname}${e.port?":"+e.port:""}`}catch(e){return console.warn("Failed to parse enterprise URL config:",this._enterpriseUrlConfig,e),"https://api.github.com"}return"https://api.github.com"}_getCAPIUrl(e){return e&&e.endpoints.api||"https://api.githubcopilot.com"}_getProxyUrl(e){return e&&e.endpoints.proxy||wLi.DEFAULT_PROXY_BASE_URL}get proxyBaseURL(){return this._proxyBaseUrl}get capiBaseURL(){return this._capiBaseUrl}get capiChatURL(){return`${this._capiBaseUrl}/chat/completions`}get capiResponsesURL(){return`${this._capiBaseUrl}/responses`}get capiMessagesURL(){return`${this._capiBaseUrl}/v1/messages`}get capiEmbeddingsURL(){return`${this._capiBaseUrl}/embeddings`}get capiModelsURL(){return`${this._capiBaseUrl}/models`}get capiAutoModelURL(){return`${this.capiModelsURL}/session`}get capiModelRouterURL(){return`${this.capiAutoModelURL}/intent`}get embeddingsModelURL(){return`${this.embeddingsURL}/models`}get chunksURL(){return`${this.dotComAPIURL}/chunks`}get embeddingsURL(){return`${this.dotComAPIURL}/embeddings`}get embeddingsCodeSearchURL(){return`${this.dotComAPIURL}/embeddings/code/search`}get telemetryURL(){return`${this._telemetryBaseUrl}/telemetry`}get remoteAgentsURL(){return`${this._capiBaseUrl}/agents`}get listSkillsURL(){return`${this._capiBaseUrl}/skills`}get searchSkillURL(){return`${this._capiBaseUrl}/search`}get contentExclusionURL(){return`${this._dotcomAPIUrl}/copilot_internal/content_exclusion`}get copilotUserInfoURL(){return`${this._dotcomAPIUrl}/copilot_internal/user`}get tokenURL(){return this._dotcomAPIUrl+"/copilot_internal/v2/token"}get tokenNoAuthURL(){return`${this._dotcomAPIUrl}/copilot_internal/v2/nltoken`}get dotComAPIURL(){return this._dotcomAPIUrl}get originTrackerURL(){return this._originTrackerUrl}get chatAttachmentUploadURL(){return"https://uploads.github.com/copilot/chat/attachments"}get copilotAgentSessionsURL(){return`${this._capiBaseUrl}/agents/sessions`}get copilotAgentJobsURL(){return`${this._capiBaseUrl}/agents/swe`}get copilotAgentTasksURL(){return`${this._dotcomAPIUrl}/cmc_internal/api/agents`}get CCAModelsURL(){return`${this._capiBaseUrl}/agents/swe/models`}get copilotCustomAgentsURL(){return`${this._capiBaseUrl}/agents/swe/custom-agents`}get copilotAgentMemoryURL(){return`${this._capiBaseUrl}/agents/swe/internal/memory/v0`}};KPr.DEFAULT_PROXY_BASE_URL="https://copilot-proxy.githubusercontent.com",KPr.CAPI_MODEL_LAB_URL="https://api-model-lab.githubcopilot.com";qLe=KPr,kuc=`The \u201C@vscode/copilot-api\u201D npm Module Terms and Conditions ("Terms") are a legal agreement between you (either as an individual or on behalf of an entity) and GitHub, Inc. regarding your use of \u201C@vscode/copilot-api\u201D npm library and associated documentation (collectively, the "Software"). By using the Software, you accept these Terms. Please read all of these Terms; in many cases, provisions set forth later in the Terms limit and qualify provisions set forth earlier in the Terms. If you do not accept these Terms, do not download, install, use, or copy the Software. IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW. @@ -1069,52 +1069,52 @@ Subject to the foregoing clause (ii), GitHub will only be liable for slight negl This limitation applies to (a) anything related to the software, services, content (including code) on third party Internet sites, or third party applications; and (b) claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law. -It also applies even if GitHub knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.`,scc=`I have read and agree to the following license terms: +It also applies even if GitHub knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.`,Puc=`I have read and agree to the following license terms: -${occ} -`,B5i=(t=>(t.CopilotToken="CopilotToken",t.CopilotNLToken="CopilotNLToken",t.ChatCompletions="ChatCompletions",t.ChatResponses="ChatResponses",t.ChatMessages="ChatMessages",t.ProxyCompletions="ProxyCompletions",t.ProxyChatCompletions="ProxyChatCompletions",t.RemoteAgent="RemoteAgent",t.RemoteAgentChat="RemoteAgentChat",t.CodeReviewAgent="CodeReviewAgent",t.CAPIEmbeddings="CAPIEmbeddings",t.DotcomEmbeddings="DotcomEmbeddings",t.EmbeddingsModels="EmbeddingsModels",t.Models="Models",t.AutoModels="AutoModels",t.Chunks="Chunks",t.EmbeddingsCodeSearch="EmbeddingsCodeSearch",t.ListSkills="ListSkills",t.SearchSkill="SearchSkill",t.ContentExclusion="ContentExclusion",t.Telemetry="Telemetry",t.CopilotUserInfo="CopilotUserInfo",t.ModelPolicy="ModelPolicy",t.ListModel="ListModel",t.SnippyMatch="SnippyMatch",t.SnippyFilesForMatch="SnippyFlesForMatch",t.CodingGuidelines="CodingGuidelines",t.EmbeddingsIndex="EmbedingsIndex",t.ChatAttachmentUpload="ChatAttachmentUpload",t.CopilotSessionLogs="CopilotSessionLogs",t.CopilotSessionDetails="CopilotSessionDetails",t.CopilotSessions="CopilotSessions",t.CopilotAgentJob="CopilotAgentJob",t.CCAModelsList="CCAModelsList",t.CopilotCustomAgents="CopilotCustomAgents",t.CopilotCustomAgentsDetail="CopilotCustomAgentsDetail",t.OrgCustomInstructions="OrgCustomInstructions",t.CopilotAgentMemory="CopilotAgentMemory",t.CopilotAgentJobEnabled="CopilotAgentJobEnabled",t.AgentTask="AgentTask",t.ModelRouter="ModelRouter",t))(B5i||{});a(acc,"v");a(ccc,"_");lcc=class{static{a(this,"f")}constructor(t,e,r,n,o){if(this._extensionInfo=t,this._integrationId=o,this._licenseCheckSucceeded=!1,e&&e===scc&&(this._licenseCheckSucceeded=!0),this._domainService=new yLe,this._fetcherService=r??new icc,this._hmacSecret=n,this._integrationId==="vscode-chat"||this._integrationId==="code-oss")throw new Error(`Integration ID ${this._integrationId} is reserved and cannot be used.`)}updateDomains(t,e){return t&&t.sku&&(this._copilotSku=t.sku),this._domainService.updateDomains(t,e)}async makeRequest(t,e){let{type:r}=e;await this._mixinHeaders(t,e);let n={...t,callSite:t.callSite??r};switch(r){case"CopilotToken":return this._fetcherService.fetch(this._domainService.tokenURL,n);case"CopilotNLToken":return this._fetcherService.fetch(this._domainService.tokenNoAuthURL,n);case"ProxyCompletions":return this._fetcherService.fetch(`${this._domainService.proxyBaseURL}/v1/engines/gpt-4o-copilot/completions`,n);case"ProxyChatCompletions":return this._fetcherService.fetch(`${this._domainService.proxyBaseURL}/chat/completions`,n);case"RemoteAgent":return this._fetcherService.fetch(this._domainService.remoteAgentsURL,n);case"CodeReviewAgent":return this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/github-code-review`,n);case"CAPIEmbeddings":return this._fetcherService.fetch(this._domainService.capiEmbeddingsURL,n);case"DotcomEmbeddings":return this._fetcherService.fetch(this._domainService.embeddingsURL,n);case"EmbeddingsModels":return this._fetcherService.fetch(this._domainService.embeddingsModelURL,n);case"Chunks":return this._fetcherService.fetch(this._domainService.chunksURL,n);case"EmbeddingsCodeSearch":return this._fetcherService.fetch(this._domainService.embeddingsCodeSearchURL,n);case"ListSkills":return this._fetcherService.fetch(this._domainService.listSkillsURL,n);case"Telemetry":return this._fetcherService.fetch(this._domainService.telemetryURL,n);case"CopilotUserInfo":return this._fetcherService.fetch(this._domainService.copilotUserInfoURL,n);case"SnippyMatch":return this._fetcherService.fetch(`${this._domainService.originTrackerURL}/twirp/github.snippy.v1.SnippyAPI/Match`,n);case"SnippyFlesForMatch":return this._fetcherService.fetch(`${this._domainService.originTrackerURL}/twirp/github.snippy.v1.SnippyAPI/FilesForMatch`,n);case"EmbedingsIndex":if(!("repoWithOwner"in e))throw new Error("repoWithOwner is required for EmbeddingsIndex request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/repos/${e.repoWithOwner}/copilot_internal/embeddings_index`,n);case"CodingGuidelines":if(!("repoWithOwner"in e))throw new Error("repoWithOwner is required for CodingGuidelines request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/repos/${e.repoWithOwner}/copilot_internal/coding_guidelines`,n);case"AutoModels":return this._fetcherService.fetch(this._domainService.capiAutoModelURL,n);case"ModelRouter":return this._fetcherService.fetch(this._domainService.capiModelRouterURL,n);case"Models":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${yLe.CAPI_MODEL_LAB_URL}/models`,n):this._fetcherService.fetch(this._domainService.capiModelsURL,n);case"ChatCompletions":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${yLe.CAPI_MODEL_LAB_URL}/chat/completions`,n):this._fetcherService.fetch(this._domainService.capiChatURL,n);case"ChatResponses":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${yLe.CAPI_MODEL_LAB_URL}/responses`,n):this._fetcherService.fetch(this._domainService.capiResponsesURL,n);case"ChatMessages":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${yLe.CAPI_MODEL_LAB_URL}/v1/messages`,n):this._fetcherService.fetch(this._domainService.capiMessagesURL,n);case"ContentExclusion":if(!("repos"in e))throw new Error("Repos are required for ContentExclusion request");return this._fetcherService.fetch(this._prepareContentExclusionUrl(e.repos),n);case"RemoteAgentChat":return"slug"in e&&e.slug?this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/${e.slug}?chat`,n):this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/chat`,n);case"SearchSkill":if(!("slug"in e))throw new Error("Skill slug is required for SearchSkill request");return this._fetcherService.fetch(`${this._domainService.searchSkillURL}/${e.slug}`,n);case"ModelPolicy":if(!("modelId"in e))throw new Error("Model ID is required for ModelPolicy request");return this._fetcherService.fetch(`${this._domainService.capiModelsURL}/${e.modelId}/policy`,n);case"ListModel":if(!("modelId"in e))throw new Error("Model ID is required for ListModel request");return this._fetcherService.fetch(`${this._domainService.capiModelsURL}/${e.modelId}`,n);case"ChatAttachmentUpload":if(!("uploadName"in e)||!("mimeType"in e))throw new Error("uploadName and mimeType are required for ChatAttachmentUpload request");return this._fetcherService.fetch(`${this._domainService.chatAttachmentUploadURL}?name=${e.uploadName}&content_type=${e.mimeType}`,n);case"CopilotSessionLogs":if(!("sessionId"in e))throw new Error("sessionId is required for CopilotSessionLogs request");return this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/${e.sessionId}/logs`,n);case"CopilotSessionDetails":if(!("sessionId"in e))throw new Error("sessionId is required for CopilotSessionDetails request");return this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/${e.sessionId}`,n);case"CopilotSessions":let o={...n,getItemsFromResponse:a(s=>{let c=s;return c&&Array.isArray(c.sessions)?c.sessions:[]},"getItemsFromResponse"),buildUrl:a((s,c,l)=>{let u=new URL(s);return u.searchParams.set("page_size",c.toString()),u.searchParams.set("page_number",l.toString()),"resourceState"in e&&e.resourceState&&u.searchParams.set("resource_state",e.resourceState),"nwo"in e&&e.nwo&&u.searchParams.set("repo_nwo",e.nwo),u.toString()},"buildUrl")};return"prId"in e&&e.prId?this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/resource/pull/${e.prId}`,n):this._fetcherService.fetchWithPagination(this._domainService.copilotAgentSessionsURL,o);case"CopilotAgentJob":if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotAgentJob request");if("jobId"in e&&e.jobId){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}/${e.jobId}`,n)}if("sessionId"in e&&e.sessionId){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}/session/${e.sessionId}`,n)}if("payload"in e&&e.payload){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}`,n)}throw new Error("jobId or sessionId is required for CopilotAgentJob request");case"CCAModelsList":return this._fetcherService.fetch(this._domainService.CCAModelsURL,n);case"CopilotCustomAgents":{if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotCustomAgents request");let s=new URL(`${this._domainService.copilotCustomAgentsURL}/${e.owner}/${e.repo}`);return"target"in e&&e.target&&s.searchParams.set("target",e.target),"exclude_invalid_config"in e&&e.exclude_invalid_config!==void 0&&s.searchParams.set("exclude_invalid_config",e.exclude_invalid_config.toString()),"dedupe"in e&&e.dedupe!==void 0&&s.searchParams.set("dedupe",e.dedupe.toString()),"include_sources"in e&&e.include_sources&&s.searchParams.set("include_sources",e.include_sources.join(",")),this._fetcherService.fetch(s.toString(),n)}case"CopilotCustomAgentsDetail":{if(!("owner"in e)||!("repo"in e)||!("customAgentName"in e))throw new Error("owner, repo and customAgentName are required for CopilotCustomAgents request");let s=new URL(`${this._domainService.copilotCustomAgentsURL}/${e.owner}/${e.repo}/${e.customAgentName}`);return"version"in e&&e.version&&s.searchParams.set("version",e.version),this._fetcherService.fetch(s.toString(),n)}case"OrgCustomInstructions":if(!("orgLogin"in e))throw new Error("orgLogin is required for OrgCustomInstructions request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/copilot_internal/org_custom_instructions/${e.orgLogin}`,n);case"CopilotAgentMemory":{if(!("repo"in e))throw new Error("repo is required for CopilotAgentMemory request");let s="action"in e?e.action:"",c=`${this._domainService.copilotAgentMemoryURL}/${e.repo}`;return s&&(c+=`/${s}`,s==="recent"&&"limit"in e&&e.limit!==void 0&&(c+=`?limit=${e.limit}`)),this._fetcherService.fetch(c,n)}case"CopilotAgentJobEnabled":{if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotAgentJobEnabled request");return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/v1/jobs/${e.owner}/${e.repo}/enabled`,n)}case"AgentTask":return this._fetcherService.fetch(this._buildAgentTaskURL(e),n);default:throw new Error(`Unsupported request type: ${r}`)}}_buildAgentTaskURL(t){let e=this._domainService.copilotAgentTasksURL,{action:r,owner:n,repo:o,taskId:s,searchParams:c}=t,l=a(()=>{if(!s)throw new Error(`taskId is required for AgentTask action "${r}"`);return s},"l"),u=a(()=>{if(!n||!o)throw new Error(`owner and repo are required for AgentTask action "${r}"`);return{owner:n,repo:o}},"g"),d;switch(r){case"create":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks`;break}case"list":d="/tasks";break;case"list-for-repo":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks`;break}case"get":d=`/tasks/${l()}`;break;case"events":d=`/tasks/${l()}/events`;break;case"steer":d=`/tasks/${l()}/steer`;break;case"create-pr":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks/${l()}/pulls`;break}case"archive":d=`/tasks/${l()}/archive`;break;case"unarchive":d=`/tasks/${l()}/unarchive`;break;default:{let h=r;throw new Error(`Unsupported AgentTask action: ${h}`)}}let f=`${e}${d}`;if(c){let h=new URLSearchParams;for(let[g,A]of Object.entries(c))A!=null&&h.set(g,String(A));let m=h.toString();m&&(f+=`?${m}`)}return f}async createResponsesWebSocket(t){return await this._mixinHeaders(t,{type:"ChatResponses"}),this._fetcherService.createWebSocket(this._domainService.capiResponsesURL,t)}_prepareContentExclusionUrl(t){let e=t.join(","),r=new URL(this._domainService.contentExclusionURL);return t.length!==0&&r.searchParams.set("repos",e),r.searchParams.set("scope","repo"),r.toString()}async _mixinHeaders(t,e){if(!ccc(e.type))return;let r=t.headers||{};r["X-GitHub-Api-Version"]="2026-06-01",r["VScode-SessionId"]=this._extensionInfo.sessionId,r["VScode-MachineId"]=this._extensionInfo.machineId,r["Editor-Device-Id"]=this._extensionInfo.deviceId,r["Editor-Plugin-Version"]=`copilot-chat/${this._extensionInfo.version}`,r["Editor-Version"]=`vscode/${this._extensionInfo.vscodeVersion}`;let n="";t.suppressIntegrationId||(n="code-oss",this._integrationId&&this._hmacSecret?n=this._integrationId:this._copilotSku==="no_auth_limited_copilot"?n="vscode-nl":this._licenseCheckSucceeded&&this._extensionInfo.buildType==="prod"?n="vscode-chat":this._extensionInfo.buildType==="dev"&&this._hmacSecret&&(n="vscode-chat-dev"),r["Copilot-Integration-Id"]=n),n==="vscode-chat-dev"&&(r["Request-Hmac"]=await acc(this._hmacSecret)),t.headers=r}get copilotTelemetryURL(){return this._domainService.telemetryURL}get dotcomAPIURL(){return this._domainService.dotComAPIURL}get capiPingURL(){return`${this._domainService.capiBaseURL}/_ping`}get proxyBaseURL(){return this._domainService.proxyBaseURL}get originTrackerURL(){return this._domainService.originTrackerURL}get snippyMatchPath(){return"twirp/github.snippy.v1.SnippyAPI/Match"}get snippyFilesForMatchPath(){return"twirp/github.snippy.v1.SnippyAPI/FilesForMatch"}}});var _y=I(Bv=>{"use strict";p();Object.defineProperty(Bv,"__esModule",{value:!0});Bv.DestroyableStream=Bv.HeadersImpl=Bv.Response=Bv.NO_FETCH_TELEMETRY=Bv.IFetcherService=void 0;Bv.jsonVerboseError=dcc;Bv.isAbortError=F5i;Bv.safeGetHostname=fcc;var ucc=nn();Bv.IFetcherService=(0,ucc.createServiceIdentifier)("IFetcherService");Bv.NO_FETCH_TELEMETRY="NO_FETCH_TELEMETRY";var rPr=class t{static{a(this,"Response")}get bytesReceived(){return this._bytesReceived}constructor(e,r,n,o,s,c,l,u,d){this.status=e,this.statusText=r,this.headers=n,this.fetcher=s,this._reportEvent=c,this._internalId=l,this._hostname=u,this.cacheStatus=d,this.ok=this.status>=200&&this.status<300,this._bytesReceived=0;let f={transform:a((g,A)=>{this._bytesReceived+=g.length,A.enqueue(g)},"transform"),flush:a(()=>{this._reportEvent({internalId:this._internalId,timestamp:Date.now(),outcome:"success",phase:"responseStreaming",fetcher:this.fetcher,hostname:this._hostname,bytesReceived:this._bytesReceived})},"flush"),cancel:a(g=>{let A=g&&!F5i(g)?"error":"cancel";this._reportEvent({internalId:this._internalId,timestamp:Date.now(),outcome:A,phase:"responseStreaming",fetcher:this.fetcher,hostname:this._hostname,reason:g,bytesReceived:this._bytesReceived})},"cancel")},h=new TransformStream(f),m=o??new ReadableStream({start(g){g.close()}});this.body=new e_t(m.pipeThrough(h))}static fromText(e,r,n,o,s){return new t(e,r,n,new ReadableStream({start(c){c.enqueue(new TextEncoder().encode(o)),c.close()}}),s,()=>{},"in-memory","in-memory")}async text(){let e=[];for await(let s of this.body)e.push(s);let r=e.reduce((s,c)=>s+c.length,0),n=new Uint8Array(r),o=0;for(let s of e)n.set(s,o),o+=s.length;return new TextDecoder().decode(n)}async json(){return JSON.parse(await this.text())}};Bv.Response=rPr;var nPr=class t{static{a(this,"HeadersImpl")}constructor(e){this._record=e}static fromMap(e){return new t(Object.fromEntries(e))}get(e){let r=this._record[e];return Array.isArray(r)?r[0]:r??null}[Symbol.iterator](){let e=Object.keys(this._record),r=0;return{next:a(()=>{if(r>=e.length)return{done:!0,value:void 0};let n=e[r++];return{done:!1,value:[n,this.get(n)]}},"next")}}};Bv.HeadersImpl=nPr;var e_t=class t{static{a(this,"DestroyableStream")}constructor(e){this.stream=e}toReadableStream(){return this.stream}pipeThrough(e){let r=new t(this.stream.pipeThrough(e));return this.pipedHead=r,r}async*[Symbol.asyncIterator](){this.reader=this.stream.getReader();try{for(;;){let{done:e,value:r}=await this.reader.read();if(e)break;yield r}}finally{this.reader.releaseLock(),this.reader=void 0}}destroy(){return this.pipedHead?this.pipedHead.destroy():this.reader?this.reader.cancel():this.stream.cancel()}};Bv.DestroyableStream=e_t;async function dcc(t){let e=await t.text();try{return JSON.parse(e)}catch(r){let n=e.split(` +${kuc} +`,RLi=(t=>(t.CopilotToken="CopilotToken",t.CopilotNLToken="CopilotNLToken",t.ChatCompletions="ChatCompletions",t.ChatResponses="ChatResponses",t.ChatMessages="ChatMessages",t.ProxyCompletions="ProxyCompletions",t.ProxyChatCompletions="ProxyChatCompletions",t.RemoteAgent="RemoteAgent",t.RemoteAgentChat="RemoteAgentChat",t.CodeReviewAgent="CodeReviewAgent",t.CAPIEmbeddings="CAPIEmbeddings",t.DotcomEmbeddings="DotcomEmbeddings",t.EmbeddingsModels="EmbeddingsModels",t.Models="Models",t.AutoModels="AutoModels",t.Chunks="Chunks",t.EmbeddingsCodeSearch="EmbeddingsCodeSearch",t.ListSkills="ListSkills",t.SearchSkill="SearchSkill",t.ContentExclusion="ContentExclusion",t.Telemetry="Telemetry",t.CopilotUserInfo="CopilotUserInfo",t.ModelPolicy="ModelPolicy",t.ListModel="ListModel",t.SnippyMatch="SnippyMatch",t.SnippyFilesForMatch="SnippyFlesForMatch",t.CodingGuidelines="CodingGuidelines",t.EmbeddingsIndex="EmbedingsIndex",t.ChatAttachmentUpload="ChatAttachmentUpload",t.CopilotSessionLogs="CopilotSessionLogs",t.CopilotSessionDetails="CopilotSessionDetails",t.CopilotSessions="CopilotSessions",t.CopilotAgentJob="CopilotAgentJob",t.CCAModelsList="CCAModelsList",t.CopilotCustomAgents="CopilotCustomAgents",t.CopilotCustomAgentsDetail="CopilotCustomAgentsDetail",t.OrgCustomInstructions="OrgCustomInstructions",t.CopilotAgentMemory="CopilotAgentMemory",t.CopilotAgentJobEnabled="CopilotAgentJobEnabled",t.AgentTask="AgentTask",t.ModelRouter="ModelRouter",t))(RLi||{});a(Duc,"v");a(Nuc,"_");Muc=class{static{a(this,"f")}constructor(t,e,r,n,o){if(this._extensionInfo=t,this._integrationId=o,this._licenseCheckSucceeded=!1,e&&e===Puc&&(this._licenseCheckSucceeded=!0),this._domainService=new qLe,this._fetcherService=r??new Ruc,this._hmacSecret=n,this._integrationId==="vscode-chat"||this._integrationId==="code-oss")throw new Error(`Integration ID ${this._integrationId} is reserved and cannot be used.`)}updateDomains(t,e){return t&&t.sku&&(this._copilotSku=t.sku),this._domainService.updateDomains(t,e)}async makeRequest(t,e){let{type:r}=e;await this._mixinHeaders(t,e);let n={...t,callSite:t.callSite??r};switch(r){case"CopilotToken":return this._fetcherService.fetch(this._domainService.tokenURL,n);case"CopilotNLToken":return this._fetcherService.fetch(this._domainService.tokenNoAuthURL,n);case"ProxyCompletions":return this._fetcherService.fetch(`${this._domainService.proxyBaseURL}/v1/engines/gpt-4o-copilot/completions`,n);case"ProxyChatCompletions":return this._fetcherService.fetch(`${this._domainService.proxyBaseURL}/chat/completions`,n);case"RemoteAgent":return this._fetcherService.fetch(this._domainService.remoteAgentsURL,n);case"CodeReviewAgent":return this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/github-code-review`,n);case"CAPIEmbeddings":return this._fetcherService.fetch(this._domainService.capiEmbeddingsURL,n);case"DotcomEmbeddings":return this._fetcherService.fetch(this._domainService.embeddingsURL,n);case"EmbeddingsModels":return this._fetcherService.fetch(this._domainService.embeddingsModelURL,n);case"Chunks":return this._fetcherService.fetch(this._domainService.chunksURL,n);case"EmbeddingsCodeSearch":return this._fetcherService.fetch(this._domainService.embeddingsCodeSearchURL,n);case"ListSkills":return this._fetcherService.fetch(this._domainService.listSkillsURL,n);case"Telemetry":return this._fetcherService.fetch(this._domainService.telemetryURL,n);case"CopilotUserInfo":return this._fetcherService.fetch(this._domainService.copilotUserInfoURL,n);case"SnippyMatch":return this._fetcherService.fetch(`${this._domainService.originTrackerURL}/twirp/github.snippy.v1.SnippyAPI/Match`,n);case"SnippyFlesForMatch":return this._fetcherService.fetch(`${this._domainService.originTrackerURL}/twirp/github.snippy.v1.SnippyAPI/FilesForMatch`,n);case"EmbedingsIndex":if(!("repoWithOwner"in e))throw new Error("repoWithOwner is required for EmbeddingsIndex request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/repos/${e.repoWithOwner}/copilot_internal/embeddings_index`,n);case"CodingGuidelines":if(!("repoWithOwner"in e))throw new Error("repoWithOwner is required for CodingGuidelines request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/repos/${e.repoWithOwner}/copilot_internal/coding_guidelines`,n);case"AutoModels":return this._fetcherService.fetch(this._domainService.capiAutoModelURL,n);case"ModelRouter":return this._fetcherService.fetch(this._domainService.capiModelRouterURL,n);case"Models":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${qLe.CAPI_MODEL_LAB_URL}/models`,n):this._fetcherService.fetch(this._domainService.capiModelsURL,n);case"ChatCompletions":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${qLe.CAPI_MODEL_LAB_URL}/chat/completions`,n):this._fetcherService.fetch(this._domainService.capiChatURL,n);case"ChatResponses":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${qLe.CAPI_MODEL_LAB_URL}/responses`,n):this._fetcherService.fetch(this._domainService.capiResponsesURL,n);case"ChatMessages":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${qLe.CAPI_MODEL_LAB_URL}/v1/messages`,n):this._fetcherService.fetch(this._domainService.capiMessagesURL,n);case"ContentExclusion":if(!("repos"in e))throw new Error("Repos are required for ContentExclusion request");return this._fetcherService.fetch(this._prepareContentExclusionUrl(e.repos),n);case"RemoteAgentChat":return"slug"in e&&e.slug?this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/${e.slug}?chat`,n):this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/chat`,n);case"SearchSkill":if(!("slug"in e))throw new Error("Skill slug is required for SearchSkill request");return this._fetcherService.fetch(`${this._domainService.searchSkillURL}/${e.slug}`,n);case"ModelPolicy":if(!("modelId"in e))throw new Error("Model ID is required for ModelPolicy request");return this._fetcherService.fetch(`${this._domainService.capiModelsURL}/${e.modelId}/policy`,n);case"ListModel":if(!("modelId"in e))throw new Error("Model ID is required for ListModel request");return this._fetcherService.fetch(`${this._domainService.capiModelsURL}/${e.modelId}`,n);case"ChatAttachmentUpload":if(!("uploadName"in e)||!("mimeType"in e))throw new Error("uploadName and mimeType are required for ChatAttachmentUpload request");return this._fetcherService.fetch(`${this._domainService.chatAttachmentUploadURL}?name=${e.uploadName}&content_type=${e.mimeType}`,n);case"CopilotSessionLogs":if(!("sessionId"in e))throw new Error("sessionId is required for CopilotSessionLogs request");return this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/${e.sessionId}/logs`,n);case"CopilotSessionDetails":if(!("sessionId"in e))throw new Error("sessionId is required for CopilotSessionDetails request");return this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/${e.sessionId}`,n);case"CopilotSessions":let o={...n,getItemsFromResponse:a(s=>{let c=s;return c&&Array.isArray(c.sessions)?c.sessions:[]},"getItemsFromResponse"),buildUrl:a((s,c,l)=>{let u=new URL(s);return u.searchParams.set("page_size",c.toString()),u.searchParams.set("page_number",l.toString()),"resourceState"in e&&e.resourceState&&u.searchParams.set("resource_state",e.resourceState),"nwo"in e&&e.nwo&&u.searchParams.set("repo_nwo",e.nwo),u.toString()},"buildUrl")};return"prId"in e&&e.prId?this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/resource/pull/${e.prId}`,n):this._fetcherService.fetchWithPagination(this._domainService.copilotAgentSessionsURL,o);case"CopilotAgentJob":if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotAgentJob request");if("jobId"in e&&e.jobId){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}/${e.jobId}`,n)}if("sessionId"in e&&e.sessionId){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}/session/${e.sessionId}`,n)}if("payload"in e&&e.payload){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}`,n)}throw new Error("jobId or sessionId is required for CopilotAgentJob request");case"CCAModelsList":return this._fetcherService.fetch(this._domainService.CCAModelsURL,n);case"CopilotCustomAgents":{if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotCustomAgents request");let s=new URL(`${this._domainService.copilotCustomAgentsURL}/${e.owner}/${e.repo}`);return"target"in e&&e.target&&s.searchParams.set("target",e.target),"exclude_invalid_config"in e&&e.exclude_invalid_config!==void 0&&s.searchParams.set("exclude_invalid_config",e.exclude_invalid_config.toString()),"dedupe"in e&&e.dedupe!==void 0&&s.searchParams.set("dedupe",e.dedupe.toString()),"include_sources"in e&&e.include_sources&&s.searchParams.set("include_sources",e.include_sources.join(",")),this._fetcherService.fetch(s.toString(),n)}case"CopilotCustomAgentsDetail":{if(!("owner"in e)||!("repo"in e)||!("customAgentName"in e))throw new Error("owner, repo and customAgentName are required for CopilotCustomAgents request");let s=new URL(`${this._domainService.copilotCustomAgentsURL}/${e.owner}/${e.repo}/${e.customAgentName}`);return"version"in e&&e.version&&s.searchParams.set("version",e.version),this._fetcherService.fetch(s.toString(),n)}case"OrgCustomInstructions":if(!("orgLogin"in e))throw new Error("orgLogin is required for OrgCustomInstructions request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/copilot_internal/org_custom_instructions/${e.orgLogin}`,n);case"CopilotAgentMemory":{if(!("repo"in e))throw new Error("repo is required for CopilotAgentMemory request");let s="action"in e?e.action:"",c=`${this._domainService.copilotAgentMemoryURL}/${e.repo}`;return s&&(c+=`/${s}`,s==="recent"&&"limit"in e&&e.limit!==void 0&&(c+=`?limit=${e.limit}`)),this._fetcherService.fetch(c,n)}case"CopilotAgentJobEnabled":{if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotAgentJobEnabled request");return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/v1/jobs/${e.owner}/${e.repo}/enabled`,n)}case"AgentTask":return this._fetcherService.fetch(this._buildAgentTaskURL(e),n);default:throw new Error(`Unsupported request type: ${r}`)}}_buildAgentTaskURL(t){let e=this._domainService.copilotAgentTasksURL,{action:r,owner:n,repo:o,taskId:s,searchParams:c}=t,l=a(()=>{if(!s)throw new Error(`taskId is required for AgentTask action "${r}"`);return s},"l"),u=a(()=>{if(!n||!o)throw new Error(`owner and repo are required for AgentTask action "${r}"`);return{owner:n,repo:o}},"g"),d;switch(r){case"create":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks`;break}case"list":d="/tasks";break;case"list-for-repo":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks`;break}case"get":d=`/tasks/${l()}`;break;case"events":d=`/tasks/${l()}/events`;break;case"steer":d=`/tasks/${l()}/steer`;break;case"create-pr":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks/${l()}/pulls`;break}case"archive":d=`/tasks/${l()}/archive`;break;case"unarchive":d=`/tasks/${l()}/unarchive`;break;default:{let h=r;throw new Error(`Unsupported AgentTask action: ${h}`)}}let f=`${e}${d}`;if(c){let h=new URLSearchParams;for(let[g,A]of Object.entries(c))A!=null&&h.set(g,String(A));let m=h.toString();m&&(f+=`?${m}`)}return f}async createResponsesWebSocket(t){return await this._mixinHeaders(t,{type:"ChatResponses"}),this._fetcherService.createWebSocket(this._domainService.capiResponsesURL,t)}_prepareContentExclusionUrl(t){let e=t.join(","),r=new URL(this._domainService.contentExclusionURL);return t.length!==0&&r.searchParams.set("repos",e),r.searchParams.set("scope","repo"),r.toString()}async _mixinHeaders(t,e){if(!Nuc(e.type))return;let r=t.headers||{};r["X-GitHub-Api-Version"]="2026-06-01",r["VScode-SessionId"]=this._extensionInfo.sessionId,r["VScode-MachineId"]=this._extensionInfo.machineId,r["Editor-Device-Id"]=this._extensionInfo.deviceId,r["Editor-Plugin-Version"]=`copilot-chat/${this._extensionInfo.version}`,r["Editor-Version"]=`vscode/${this._extensionInfo.vscodeVersion}`;let n="";t.suppressIntegrationId||(n="code-oss",this._integrationId&&this._hmacSecret?n=this._integrationId:this._copilotSku==="no_auth_limited_copilot"?n="vscode-nl":this._licenseCheckSucceeded&&this._extensionInfo.buildType==="prod"?n="vscode-chat":this._extensionInfo.buildType==="dev"&&this._hmacSecret&&(n="vscode-chat-dev"),r["Copilot-Integration-Id"]=n),n==="vscode-chat-dev"&&(r["Request-Hmac"]=await Duc(this._hmacSecret)),t.headers=r}get copilotTelemetryURL(){return this._domainService.telemetryURL}get dotcomAPIURL(){return this._domainService.dotComAPIURL}get capiPingURL(){return`${this._domainService.capiBaseURL}/_ping`}get proxyBaseURL(){return this._domainService.proxyBaseURL}get originTrackerURL(){return this._domainService.originTrackerURL}get snippyMatchPath(){return"twirp/github.snippy.v1.SnippyAPI/Match"}get snippyFilesForMatchPath(){return"twirp/github.snippy.v1.SnippyAPI/FilesForMatch"}}});var Sy=I(Qv=>{"use strict";p();Object.defineProperty(Qv,"__esModule",{value:!0});Qv.DestroyableStream=Qv.HeadersImpl=Qv.Response=Qv.NO_FETCH_TELEMETRY=Qv.IFetcherService=void 0;Qv.jsonVerboseError=Luc;Qv.isAbortError=kLi;Qv.safeGetHostname=Buc;var Ouc=nn();Qv.IFetcherService=(0,Ouc.createServiceIdentifier)("IFetcherService");Qv.NO_FETCH_TELEMETRY="NO_FETCH_TELEMETRY";var JPr=class t{static{a(this,"Response")}get bytesReceived(){return this._bytesReceived}constructor(e,r,n,o,s,c,l,u,d){this.status=e,this.statusText=r,this.headers=n,this.fetcher=s,this._reportEvent=c,this._internalId=l,this._hostname=u,this.cacheStatus=d,this.ok=this.status>=200&&this.status<300,this._bytesReceived=0;let f={transform:a((g,A)=>{this._bytesReceived+=g.length,A.enqueue(g)},"transform"),flush:a(()=>{this._reportEvent({internalId:this._internalId,timestamp:Date.now(),outcome:"success",phase:"responseStreaming",fetcher:this.fetcher,hostname:this._hostname,bytesReceived:this._bytesReceived})},"flush"),cancel:a(g=>{let A=g&&!kLi(g)?"error":"cancel";this._reportEvent({internalId:this._internalId,timestamp:Date.now(),outcome:A,phase:"responseStreaming",fetcher:this.fetcher,hostname:this._hostname,reason:g,bytesReceived:this._bytesReceived})},"cancel")},h=new TransformStream(f),m=o??new ReadableStream({start(g){g.close()}});this.body=new I_t(m.pipeThrough(h))}static fromText(e,r,n,o,s){return new t(e,r,n,new ReadableStream({start(c){c.enqueue(new TextEncoder().encode(o)),c.close()}}),s,()=>{},"in-memory","in-memory")}async text(){let e=[];for await(let s of this.body)e.push(s);let r=e.reduce((s,c)=>s+c.length,0),n=new Uint8Array(r),o=0;for(let s of e)n.set(s,o),o+=s.length;return new TextDecoder().decode(n)}async json(){return JSON.parse(await this.text())}};Qv.Response=JPr;var ZPr=class t{static{a(this,"HeadersImpl")}constructor(e){this._record=e}static fromMap(e){return new t(Object.fromEntries(e))}get(e){let r=this._record[e];return Array.isArray(r)?r[0]:r??null}[Symbol.iterator](){let e=Object.keys(this._record),r=0;return{next:a(()=>{if(r>=e.length)return{done:!0,value:void 0};let n=e[r++];return{done:!1,value:[n,this.get(n)]}},"next")}}};Qv.HeadersImpl=ZPr;var I_t=class t{static{a(this,"DestroyableStream")}constructor(e){this.stream=e}toReadableStream(){return this.stream}pipeThrough(e){let r=new t(this.stream.pipeThrough(e));return this.pipedHead=r,r}async*[Symbol.asyncIterator](){this.reader=this.stream.getReader();try{for(;;){let{done:e,value:r}=await this.reader.read();if(e)break;yield r}}finally{this.reader.releaseLock(),this.reader=void 0}}destroy(){return this.pipedHead?this.pipedHead.destroy():this.reader?this.reader.cancel():this.stream.cancel()}};Qv.DestroyableStream=I_t;async function Luc(t){let e=await t.text();try{return JSON.parse(e)}catch(r){let n=e.split(` `),o=n.length>50?[...n.slice(0,25),"[...]",...n.slice(n.length-25)].join(` -`):e;throw r.message=`${r.message}. Response: ${o}`,r}}a(dcc,"jsonVerboseError");function F5i(t){return t&&t.name==="AbortError"}a(F5i,"isAbortError");function fcc(t){try{return new URL(t).hostname}catch{return"unknown"}}a(fcc,"safeGetHostname")});var U5i=I(zAe=>{"use strict";p();Object.defineProperty(zAe,"__esModule",{value:!0});zAe.INTEGRATION_ID=zAe.LICENSE_AGREEMENT=void 0;zAe.LICENSE_AGREEMENT=void 0;zAe.INTEGRATION_ID="code-oss"});var $E=I(YAe=>{"use strict";p();Object.defineProperty(YAe,"__esModule",{value:!0});YAe.ICAPIClientService=YAe.BaseCAPIClientService=void 0;var ELe=(Sne(),ba(bne)),pcc=nn(),hcc=_y(),mcc=U5i(),iPr=class extends ELe.CAPIClient{static{a(this,"BaseCAPIClientService")}constructor(e,r,n,o){super({machineId:o.machineId,deviceId:o.devDeviceId,sessionId:o.sessionId,vscodeVersion:o.vscodeVersion,buildType:o.getBuildType(),name:o.getName(),version:o.getVersion()},mcc.LICENSE_AGREEMENT,n,e,r)}makeRequest(e,r){return this.abExpContext&&(e.headers||(e.headers={}),e.headers["VScode-ABExpContext"]=this.abExpContext,e.headers["X-Copilot-Client-Exp-Assignment-Context"]=this.abExpContext),(r.type===ELe.RequestType.Telemetry||r.type===ELe.RequestType.ChatCompletions||r.type===ELe.RequestType.ChatMessages||r.type===ELe.RequestType.ChatResponses)&&(e.callSite=hcc.NO_FETCH_TELEMETRY),super.makeRequest(e,r)}};YAe.BaseCAPIClientService=iPr;YAe.ICAPIClientService=(0,pcc.createServiceIdentifier)("ICAPIClientService")});var r_t=I(t_t=>{"use strict";p();Object.defineProperty(t_t,"__esModule",{value:!0});t_t.getEndpointUrl=vcc;t_t.getLastKnownEndpoints=Ccc;var gcc=FE(),Acc=$E(),D$=LE(),ycc=rne(),Ecc=o$();function q5i(t){let e=t.get(Acc.ICAPIClientService);return{proxy:e.proxyBaseURL,"origin-tracker":e.originTrackerURL}}a(q5i,"getDefaultEndpoints");function Q5i(t,e,r){if(r!==void 0&&t.get(ycc.ICompletionsRuntimeModeService).isRunningInTest()){for(let n of r){let o=(0,D$.getConfig)(t,n);if(o)return o}return}for(let n of e){let o=(0,D$.getConfig)(t,n);if(o)return o}}a(Q5i,"urlConfigOverride");function _cc(t,e){switch(e){case"proxy":return Q5i(t,[D$.ConfigKey.DebugOverrideProxyUrl,D$.ConfigKey.DebugOverrideProxyUrlLegacy],[D$.ConfigKey.DebugTestOverrideProxyUrl,D$.ConfigKey.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!D$.BuildInfo.isProduction())return Q5i(t,[D$.ConfigKey.DebugSnippyOverrideUrl])}}a(_cc,"getEndpointOverrideUrl");function vcc(t,e,r,...n){let o=_cc(t,r)??(e.endpoints?e.endpoints[r]:void 0)??q5i(t)[r];return(0,Ecc.joinPath)(o,...n)}a(vcc,"getEndpointUrl");function Ccc(t){return t.get(gcc.IAuthenticationService).copilotToken?.endpoints??q5i(t)}a(Ccc,"getLastKnownEndpoints")});var sPr=I(_Le=>{"use strict";p();Object.defineProperty(_Le,"__esModule",{value:!0});_Le.Response=void 0;_Le.isAbortError=Scc;var bcc=_y();Object.defineProperty(_Le,"Response",{enumerable:!0,get:a(function(){return bcc.Response},"get")});var oPr=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function Scc(t){return!t||typeof t!="object"?!1:t instanceof oPr||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(Scc,"isAbortError")});var KAe=I(N0=>{"use strict";p();var Tcc=N0&&N0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Icc=N0&&N0.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},xcc=N0&&N0.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Tcc(e,t,r)},aPr=N0&&N0.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(N0,"__esModule",{value:!0});N0.Fetcher=N0.CompletionsFetcher=N0.ICompletionsFetcherService=void 0;N0.isInterruptedNetworkError=Pcc;xcc(sPr(),N0);var j5i=Pl(),wcc=_y(),Rcc=mh(),kcc=nn();N0.ICompletionsFetcherService=(0,kcc.createServiceIdentifier)("ICompletionsFetcherService");var cPr=class{static{a(this,"CompletionsFetcher")}constructor(e,r,n){this.configurationService=e,this.fetcherService=r,this.experimentationService=n}getImplementation(){return this}fetch(e,r){let n=this.configurationService.getExperimentBasedConfig(j5i.ConfigKey.CompletionsFetcher,this.experimentationService)||void 0,o=n?{...r,useFetcher:n}:r;return this.fetcherService.fetch(e,{...o,callSite:o.callSite??"completions-core"})}disconnectAll(){return this.fetcherService.disconnectAll()}};N0.CompletionsFetcher=cPr;N0.CompletionsFetcher=cPr=Icc([aPr(0,j5i.IConfigurationService),aPr(1,wcc.IFetcherService),aPr(2,Rcc.IExperimentationService)],cPr);var lPr=class{static{a(this,"Fetcher")}getImplementation(){return this}};N0.Fetcher=lPr;function Pcc(t){return t instanceof Error?t.message==="ERR_HTTP2_GOAWAY_SESSION"?!0:"code"in t?t.code==="ECONNRESET"||t.code==="ETIMEDOUT"||t.code==="ERR_HTTP2_INVALID_SESSION":!1:!1}a(Pcc,"isInterruptedNetworkError")});var H5i=I(JAe=>{"use strict";p();Object.defineProperty(JAe,"__esModule",{value:!0});JAe.FeatureName=JAe.OutputPaneShowCommand=void 0;JAe.OutputPaneShowCommand="codereferencing.showOutputPane2";JAe.FeatureName="code-referencing"});var vLe=I(n_t=>{"use strict";p();Object.defineProperty(n_t,"__esModule",{value:!0});n_t.codeReferenceLogger=void 0;var Dcc=Dl(),Ncc=H5i();n_t.codeReferenceLogger=new Dcc.Logger(Ncc.FeatureName)});var V5i=I(s_t=>{"use strict";p();Object.defineProperty(s_t,"__esModule",{value:!0});s_t.ConnectionState=void 0;var Mcc=Gs(),Occ=Dl(),Lcc=r_t(),Bcc=KAe(),CLe=vLe(),Fcc=3e3,uPr=2,G5i=256,$5i=Math.log(G5i)/Math.log(uPr)/uPr,ZD={connection:"disabled",maxAttempts:$5i,retryAttempts:0,initialWait:!1},i_t,o_t=[];function Ucc(){if(i_t)return i_t;function t(_){return o_t.push(_),()=>{let v=o_t.indexOf(_);v!==-1&&o_t.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of o_t)_()}a(e,"afterUpdateConnection");function r(_){ZD.connection!==_&&(ZD.connection=_,e())}a(r,"updateConnection");function n(){return ZD.connection==="connected"}a(n,"isConnected");function o(){return ZD.connection==="disconnected"}a(o,"isDisconnected");function s(){return ZD.connection==="retry"}a(s,"isRetrying");function c(){return ZD.connection==="disabled"}a(c,"isDisabled");function l(){r("connected"),h(!1)}a(l,"setConnected");function u(){r("disconnected")}a(u,"setDisconnected");function d(){r("retry")}a(d,"setRetrying");function f(){r("disabled")}a(f,"setDisabled");function h(_){ZD.initialWait!==_&&(ZD.initialWait=_)}a(h,"setInitialWait");function m(_,v=Fcc){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return ZD.initialWait}a(g,"isInitialWait");async function A(_,v){let b=_.get(Occ.ICompletionsLogTargetService),T=_.get(Bcc.ICompletionsFetcherService),w=_.get(Mcc.IInstantiationService);CLe.codeReferenceLogger.info(b,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);function R(x){if(x>G5i){CLe.codeReferenceLogger.info(b,"Max retry time reached, disabling."),f();return}let P=a(async()=>{ZD.retryAttempts=Math.min(ZD.retryAttempts+1,$5i);try{CLe.codeReferenceLogger.info(b,`Pinging service after ${x} second(s)`);let D=await T.fetch(new URL("_ping",w.invokeFunction(Lcc.getLastKnownEndpoints)["origin-tracker"]).href,{callSite:"snippy-ping",method:"GET",headers:{"content-type":"application/json"}});if(D.status!==200||!D.ok)R(x**2);else{CLe.codeReferenceLogger.info(b,"Successfully reconnected."),l();return}}catch{R(x**2)}},"tryAgain");setTimeout(()=>{P()},x*1e3)}a(R,"succeedOrRetry"),CLe.codeReferenceLogger.info(b,"Attempting to reconnect."),R(uPr)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),i_t={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},i_t}a(Ucc,"registerConnectionState");s_t.ConnectionState=Ucc()});var z5i=I(eA=>{"use strict";p();Object.defineProperty(eA,"__esModule",{value:!0});eA.ErrorMessages=eA.ErrorReasons=void 0;eA.getErrorType=W5i;eA.createErrorResponse=Qcc;eA.ErrorReasons={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"};eA.ErrorMessages={[eA.ErrorReasons.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[eA.ErrorReasons.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[eA.ErrorReasons.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function W5i(t){return t===401?eA.ErrorReasons.Unauthorized:t===400?eA.ErrorReasons.BadArguments:t===404?eA.ErrorReasons.NotFound:t===429?eA.ErrorReasons.RateLimit:t>=500&&t<600?eA.ErrorReasons.InternalError:t>=600?eA.ErrorReasons.ConnectionError:eA.ErrorReasons.Unknown}a(W5i,"getErrorType");function Qcc(t,e,r={}){return{kind:"failure",reason:W5i(Number(t)),code:Number(t),msg:e,meta:r}}a(Qcc,"createErrorResponse")});var mPr=I(dL=>{"use strict";p();Object.defineProperty(dL,"__esModule",{value:!0});dL.NoopTelemetryReporter=dL.snippyTelemetry=dL.matchNotificationTelemetry=dL.copilotOutputLogTelemetry=void 0;var qcc=Dl(),VE=$g(),jcc=vLe(),Hcc=/^[1-6][0-9][0-9]$/,Gcc=/([A-Z][a-z]+)/,$cc="code_referencing",ZAe=class{static{a(this,"CodeQuoteTelemetry")}constructor(e){this.baseKey=e}buildKey(...e){return[$cc,this.baseKey,...e].join(".")}},dPr=class extends ZAe{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({instantiationService:e}){let r=this.buildKey("open","count"),n=VE.TelemetryData.createAndMarkAsIssued();e.invokeFunction(VE.telemetry,r,n)}handleFocus({instantiationService:e}){let r=VE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("focus","count");e.invokeFunction(VE.telemetry,n,r)}handleWrite({instantiationService:e}){let r=VE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("write","count");e.invokeFunction(VE.telemetry,n,r)}};dL.copilotOutputLogTelemetry=new dPr;var fPr=class extends ZAe{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({instantiationService:e,actor:r}){let n=VE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");e.invokeFunction(VE.telemetry,o,n)}handleDismiss({instantiationService:e,actor:r}){let n=VE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");e.invokeFunction(VE.telemetry,o,n)}};dL.matchNotificationTelemetry=new fPr;var pPr=class extends ZAe{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({instantiationService:e,origin:r,reason:n}){let o=VE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(VE.telemetryError,this.buildKey("unexpectedError"),o)}handleCompletionMissing({instantiationService:e,origin:r,reason:n}){let o=VE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(VE.telemetryError,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({instantiationService:e,origin:r,reason:n,message:o}){if(!r.match(Hcc)){e.invokeFunction(l=>jcc.codeReferenceLogger.debug(l.get(qcc.ICompletionsLogTargetService),"Invalid status code, not sending telemetry",{origin:r}));return}let s=n.split(Gcc).filter(l=>!!l).join("_").toLowerCase(),c=VE.TelemetryData.createAndMarkAsIssued({message:o});e.invokeFunction(VE.telemetryError,this.buildKey(s,r),c)}};dL.snippyTelemetry=new pPr;var hPr=class extends ZAe{static{a(this,"NoopTelemetryReporter")}constructor(e=""){super(e)}telemetry(...e){}telemetryError(...e){}};dL.NoopTelemetryReporter=hPr});var Y5i=I(gPr=>{"use strict";p();Object.defineProperty(gPr,"__esModule",{value:!0});gPr.call=elc;var Vcc=Gs(),Wcc=Uge(),zcc=LE(),Ycc=Dl(),Kcc=r_t(),Jcc=KAe(),XAe=V5i(),yh=z5i(),Zcc=vLe(),Xcc=mPr();async function elc(t,e,r,n){let o,s=t.get(Ycc.ICompletionsLogTargetService),c=t.get(Vcc.IInstantiationService),l=t.get(Wcc.ICompletionsCopilotTokenManager);try{o=l.token??await l.getToken()}catch{return XAe.ConnectionState.setDisconnected(),(0,yh.createErrorResponse)(401,yh.ErrorMessages[yh.ErrorReasons.Unauthorized])}if(Zcc.codeReferenceLogger.info(s,`Calling ${e}`),XAe.ConnectionState.isRetrying())return(0,yh.createErrorResponse)(600,"Attempting to reconnect to the public code matching service.");if(XAe.ConnectionState.isDisconnected())return(0,yh.createErrorResponse)(601,"The public code matching service is offline.");let u;try{u=await c.invokeFunction(_=>_.get(Jcc.ICompletionsFetcherService).fetch((0,Kcc.getEndpointUrl)(_,o,"origin-tracker",e),{callSite:"snippy-network",method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...(0,zcc.editorVersionHeaders)(_)},signal:n}))}catch{return c.invokeFunction(XAe.ConnectionState.enableRetry),(0,yh.createErrorResponse)(602,"Network error detected. Check your internet connection.")}let d;try{d=await u.json()}catch(_){let v=_.message;throw Xcc.snippyTelemetry.handleUnexpectedError({instantiationService:c,origin:"snippyNetwork",reason:v}),_}if(u.ok)return{kind:"success",...d};let f={...d,code:Number(u.status)},{code:h,msg:m,meta:g}=f,A=Number(h),y=(0,yh.getErrorType)(A),E=m||"unknown error";switch(y){case yh.ErrorReasons.Unauthorized:return(0,yh.createErrorResponse)(h,yh.ErrorMessages[yh.ErrorReasons.Unauthorized],g);case yh.ErrorReasons.BadArguments:return(0,yh.createErrorResponse)(h,E,g);case yh.ErrorReasons.RateLimit:return c.invokeFunction(_=>XAe.ConnectionState.enableRetry(_,60*1e3)),(0,yh.createErrorResponse)(h,yh.ErrorMessages.RateLimitError,g);case yh.ErrorReasons.InternalError:return c.invokeFunction(_=>XAe.ConnectionState.enableRetry(_)),(0,yh.createErrorResponse)(h,yh.ErrorMessages[yh.ErrorReasons.InternalError],g);default:return(0,yh.createErrorResponse)(h,E,g)}}a(elc,"call")});var APr=I(m1=>{"use strict";p();Object.defineProperty(m1,"__esModule",{value:!0});m1.FileMatchResponse=m1.FileMatchRequest=m1.MatchResponse=m1.MatchRequest=m1.MatchError=void 0;var Ea=DAt();m1.MatchError=Ea.Type.Object({kind:Ea.Type.Literal("failure"),reason:Ea.Type.String(),code:Ea.Type.Number(),msg:Ea.Type.String(),meta:Ea.Type.Optional(Ea.Type.Any())});var tlc=Ea.Type.Object({matched_source:Ea.Type.String(),occurrences:Ea.Type.String(),capped:Ea.Type.Boolean(),cursor:Ea.Type.String(),github_url:Ea.Type.String()});m1.MatchRequest=Ea.Type.Object({source:Ea.Type.String()});var rlc=Ea.Type.Object({snippets:Ea.Type.Array(tlc)});m1.MatchResponse=Ea.Type.Union([rlc,m1.MatchError]);m1.FileMatchRequest=Ea.Type.Object({cursor:Ea.Type.String()});var nlc=Ea.Type.Object({commit_id:Ea.Type.String(),license:Ea.Type.String(),nwo:Ea.Type.String(),path:Ea.Type.String(),url:Ea.Type.String()}),ilc=Ea.Type.Object({has_next_page:Ea.Type.Boolean(),cursor:Ea.Type.String()}),olc=Ea.Type.Object({count:Ea.Type.Record(Ea.Type.String(),Ea.Type.String())}),slc=Ea.Type.Object({file_matches:Ea.Type.Array(nlc),page_info:ilc,license_stats:olc});m1.FileMatchResponse=Ea.Type.Union([slc,m1.MatchError])});var X5i=I(fL=>{"use strict";p();var alc=fL&&fL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),clc=fL&&fL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),K5i=fL&&fL.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(q6,"__esModule",{value:!0});q6.MinTokenLength=void 0;q6.lexemeLength=e4i;q6.offsetLastLexemes=flc;q6.hasMinLexemeLength=plc;var bLe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu");q6.MinTokenLength=65;function e4i(t){let e=0,r;bLe.lastIndex=0;do if(r=bLe.exec(t),r&&(e+=1),e>=q6.MinTokenLength)break;while(r);return e}a(e4i,"lexemeLength");function dlc(t,e){let r=0,n;bLe.lastIndex=0;do if(n=bLe.exec(t),n&&(r+=1,r>=e))return bLe.lastIndex;while(n);return t.length}a(dlc,"offsetFirstLexemes");function flc(t,e){let r=t.split("").reverse().join(""),n=dlc(r,e);return r.length-n}a(flc,"offsetLastLexemes");function plc(t){return e4i(t)>=q6.MinTokenLength}a(plc,"hasMinLexemeLength")});var a4i=I(j6=>{"use strict";p();var hlc=j6&&j6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mlc=j6&&j6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),o4i=j6&&j6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;on4i(E,()=>r4i.Match(E,f)));if(!h||i4i(h)||!h.snippets.length){yPr.codeReferenceLogger.info(s,"No match found");return}yPr.codeReferenceLogger.info(s,"Match found");let{snippets:m}=h,g=m.map(async E=>{let _=await o.invokeFunction(T=>n4i(T,()=>r4i.FilesForMatch(T,{cursor:E.cursor})));if(!_||i4i(_))return;let v=_.file_matches,b=_.license_stats;return{match:E,files:v,licenseStats:b}}),y=(await Promise.all(g)).filter(E=>E!==void 0);if(y.length)for(let E of y){let _=new Set(Object.keys(E.licenseStats?.count??{}));_.has("NOASSERTION")&&(_.delete("NOASSERTION"),_.add("unknown"));let v=Array.from(_).sort(),b=n,T=n+E.match.matched_source.length,w=u.positionAt(b),R=u.positionAt(T);await l.handleIPCodeCitation({inDocumentUri:e,offsetStart:b,offsetEnd:T,version:u.version,location:{start:w,end:R},matchingText:f,details:v.map(x=>({license:x,url:E.match.github_url}))})}}a(blc,"fetchCitations")});var p4i=I(N$=>{"use strict";p();Object.defineProperty(N$,"__esModule",{value:!0});N$.editDistance=l4i;N$.emptyLexDictionary=u4i;N$.reverseLexDictionary=d4i;N$.lexGeneratorWords=f4i;N$.lexicalAnalyzer=EPr;N$.lexEditDistance=Slc;function l4i(t,e,r=(n,o)=>n===o?0:1){if(e.length===0||t.length===0)return{distance:e.length,startOffset:0,endOffset:0};let n=new Array(e.length+1).fill(0),o=new Array(e.length+1).fill(0),s=new Array(t.length+1).fill(0),c=new Array(t.length+1).fill(0),l=e[0];for(let d=0;d0?d-1:0;for(let d=1;d0&&(yield e),e=o,n=s)}e.length>0&&(yield e)}a(f4i,"lexGeneratorWords");function EPr(t,e,r,n){let o=[],s=0;for(let c of r(t))n(c)&&(e.has(c)||e.set(c,e.size),o.push([e.get(c),s])),s+=c.length;return[o,e]}a(EPr,"lexicalAnalyzer");function c4i(t){return t!==" "}a(c4i,"notSingleSpace");function Slc(t,e,r=f4i){let[n,o]=EPr(t,u4i(),r,c4i),[s,c]=EPr(e,o,r,c4i);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=d4i(c),u=s.length,d=l[s[0][0]],f=l[s[u-1][0]];function h(y,E,_,v){if(v===0||v===u-1){let b=l[n[_][0]];return v===0&&b.endsWith(d)||v===u-1&&b.startsWith(f)?0:1}else return y===E?0:1}a(h,"compare");let m=l4i(n.map(y=>y[0]),s.map(y=>y[0]),h),g=n[m.startOffset][1],A=m.endOffset0&&t[A-1]===" "&&--A,{lexDistance:m.distance,startOffset:g,endOffset:A,haystackLexLength:n.length,needleLexLength:s.length}}a(Slc,"lexEditDistance")});var _Pr=I(Tne=>{"use strict";p();Object.defineProperty(Tne,"__esModule",{value:!0});Tne.PartialAcceptTriggerKind=void 0;Tne.computeCompCharLen=Tlc;Tne.countLines=Ilc;Tne.computeCompletionText=xlc;var h4i;(function(t){t[t.Unknown=0]="Unknown",t[t.Word=1]="Word",t[t.Line=2]="Line",t[t.Suggest=3]="Suggest"})(h4i||(Tne.PartialAcceptTriggerKind=h4i={}));function Tlc(t,e){return t.compType==="partial"?t.acceptedLength:e.length}a(Tlc,"computeCompCharLen");function Ilc(t){return t.length===0?0:t.split(` -`).length}a(Ilc,"countLines");function xlc(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(xlc,"computeCompletionText")});var S4i=I(d_t=>{"use strict";p();Object.defineProperty(d_t,"__esModule",{value:!0});d_t.postRejectionTasks=Ulc;d_t.postInsertionTasks=Qlc;var u_t=Gs(),A4i=bte(),wlc=Uge(),l_t=P2i(),Rlc=mgt(),klc=pIr(),y4i=LTr(),E4i=xAe(),tye=Dl(),m4i=gyt(),Plc=qAe(),Dlc=a4i(),g4i=p4i(),Nlc=_Pr(),M$=$g(),Mlc=s1(),_4i=_5e(),Olc=rne(),O$=new tye.Logger("postInsertion"),v4i=[{seconds:15,captureCode:!1,captureRejection:!1},{seconds:30,captureCode:!0,captureRejection:!0},{seconds:120,captureCode:!1,captureRejection:!1},{seconds:300,captureCode:!1,captureRejection:!1},{seconds:600,captureCode:!1,captureRejection:!1}],C4i=50,Llc=1500,Blc=.5,Flc=500,vPr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function b4i(t,e,r,n,o){let s=t.get(u_t.IInstantiationService),c=t.get(tye.ICompletionsLogTargetService),l=await t.get(y4i.ICompletionsFileReaderService).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(l.status!=="valid")return O$.info(c,`Could not get document for ${e}. Maybe it was closed by the editor.`),{prompt:{prefix:"",suffix:"",isFimEnabled:!1},capturedCode:"",terminationOffset:0};let u=l.document,d=u.getText(),f=d.substring(0,n),h=u.positionAt(n),m=await s.invokeFunction(Plc.extractPrompt,r.properties.headerRequestId,(0,klc.createCompletionState)(u,h),r),g=m.type==="prompt"?m.prompt:{prefix:f,suffix:"",isFimEnabled:!1};if(g.isFimEnabled&&o!==void 0){let A=d.substring(n,o);return g.suffix=d.substring(o),{prompt:g,capturedCode:A,terminationOffset:0}}else{let A=d.substring(n),y=(0,m4i.contextIndentationFromText)(f,n,u.detectedLanguageId),_=(0,m4i.indentationBlockFinished)(y,void 0)(A),v=Math.min(d.length,n+(_?_*2:Flc)),b=d.substring(n,v);return{prompt:g,capturedCode:b,terminationOffset:_??-1}}}a(b4i,"captureCode");function Ulc(t,e,r,n,o){let s=t.get(tye.ICompletionsLogTargetService),c=t.get(u_t.IInstantiationService),l=t.get(A4i.ICompletionsTelemetryService),u=t.get(_4i.ICompletionsPromiseQueueService);o.forEach(({completionText:m,completionTelemetryData:g})=>{O$.debug(s,`${e}.rejected choiceIndex: ${g.properties.choiceIndex}`),c.invokeFunction(E4i.telemetryRejected,e,g)});let d=c.createInstance(l_t.ChangeTracker,n,r-1),f=c.createInstance(l_t.ChangeTracker,n,r),h=a(async m=>{O$.debug(s,`Original offset: ${r}, Tracked offset: ${d.offset}`);let{completionTelemetryData:g}=o[0],{prompt:A,capturedCode:y,terminationOffset:E}=await c.invokeFunction(b4i,n,g,d.offset+1,f.offset),_={hypotheticalPromptJson:JSON.stringify({prefix:A.prefix,context:A.context}),hypotheticalPromptSuffixJson:JSON.stringify(A.suffix)},v=g.extendedBy({..._,capturedCodeJson:JSON.stringify(y)},{timeout:m.seconds,insertionOffset:r,trackedOffset:d.offset,terminationOffsetInCapturedCode:E});O$.debug(s,`${e}.capturedAfterRejected choiceIndex: ${g.properties.choiceIndex}`,v),c.invokeFunction(M$.telemetry,e+".capturedAfterRejected",v,M$.TelemetryStore.Enhanced)},"checkInCode");v4i.filter(m=>m.captureRejection).map(m=>d.push((0,M$.telemetryCatch)(l,u,()=>h(m),"postRejectionTasks"),m.seconds*1e3))}a(Ulc,"postRejectionTasks");function Qlc(t,e,r,n,o,s,c,l){let u=t.get(tye.ICompletionsLogTargetService),d=t.get(u_t.IInstantiationService),f=t.get(_4i.ICompletionsPromiseQueueService),h=t.get(A4i.ICompletionsTelemetryService),m=t.get(Olc.ICompletionsRuntimeModeService),g=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});O$.debug(u,`${e}.accepted choiceIndex: ${g.properties.choiceIndex}`),d.invokeFunction(E4i.telemetryAccepted,e,g);let A=r;r=(0,Nlc.computeCompletionText)(r,c);let y=r.trim(),E=d.createInstance(l_t.ChangeTracker,o,n),_=d.createInstance(l_t.ChangeTracker,o,n+r.length),v=a(async b=>{await d.invokeFunction(Glc,e,y,n,o,b,g,E,_)},"stillInCodeCheck");if(vPr.triggerPostInsertionSynchroneously&&m.isRunningInTest()){let b=v({seconds:0,captureCode:vPr.captureCode,captureRejection:vPr.captureRejection});f.register(b)}else v4i.map(b=>E.push((0,M$.telemetryCatch)(h,f,()=>v(b),"postInsertionTasks"),b.seconds*1e3));d.invokeFunction(b=>(0,M$.telemetryCatch)(h,f,qlc,"post insertion citation check")(b,o,A,r,n,l))}a(Qlc,"postInsertionTasks");async function qlc(t,e,r,n,o,s){let c=t.get(tye.ICompletionsLogTargetService),l=t.get(Mlc.ICompletionsTextDocumentManagerService),u=t.get(wlc.ICompletionsCopilotTokenManager),d=t.get(Rlc.ICompletionsCitationManager);if(!s||(s.ip_code_citations?.length??0)<1){if(u.getLastToken()?.getTokenValue("sn")==="1")return;await(0,Dlc.fetchCitations)(t,e,n,o);return}let f=await l.getTextDocument({uri:e});if(f){let h=CPr(f.getText(),n,C4i,o);h.stillInCodeHeuristic&&(o=h.foundOffset)}for(let h of s.ip_code_citations){let m=jlc(r.length,n.length,h.start_offset);if(m===void 0){O$.info(c,`Full completion for ${e} contains a reference matching public code, but the partially inserted text did not include the match.`);continue}let g=o+m,A=f?.positionAt(g),y=o+Hlc(r.length,n.length,h.stop_offset),E=f?.positionAt(y),_=A&&E?f?.getText({start:A,end:E}):"";await d.handleIPCodeCitation({inDocumentUri:e,offsetStart:g,offsetEnd:y,version:f?.version,location:A&&E?{start:A,end:E}:void 0,matchingText:_,details:h.details.citations})}}a(qlc,"citationCheck");function jlc(t,e,r){if(!(ee))return r}a(jlc,"computeCitationStart");function Hlc(t,e,r){return e{"use strict";p();Object.defineProperty(vy,"__esModule",{value:!0});vy.LastGhostText=vy.ICompletionsLastGhostText=void 0;vy.rejectLastShown=x4i;vy.setLastShown=zlc;vy.handleGhostTextShown=Ylc;vy.handleGhostTextPostInsert=Jlc;vy.handlePartialGhostTextPostInsert=Zlc;var $lc=nn(),T4i=Dl(),SPr=S4i(),f_t=_Pr(),I4i=a$(),TPr=xAe(),Vlc=new T4i.Logger("ghostText");vy.ICompletionsLastGhostText=(0,$lc.createServiceIdentifier)("ICompletionsLastGhostText");var bPr=class{static{a(this,"LastGhostText")}constructor(){this.#r=[],this.linesAccepted=0}#e;#t;#r;get position(){return this.#e}get shownCompletions(){return this.#r||[]}get uri(){return this.#t}resetState(){this.#t=void 0,this.#e=void 0,this.#r=[],this.resetPartialAcceptanceState()}setState({uri:e},r){this.#t=e,this.#e=r,this.#r=[]}resetPartialAcceptanceState(){this.partiallyAcceptedLength=0,this.totalLength=void 0,this.linesLeft=void 0,this.linesAccepted=0}};vy.LastGhostText=bPr;function Wlc(t){let e=[];return t.shownCompletions.forEach(r=>{if(r.displayText&&r.telemetry){let n,o;t.partiallyAcceptedLength?(n=r.displayText.substring(t.partiallyAcceptedLength-1),o=r.telemetry.extendedBy({compType:"partial"},{compCharLen:n.length})):(n=r.displayText,o=r.telemetry);let s={completionText:n,completionTelemetryData:o,offset:r.offset};e.push(s)}}),e}a(Wlc,"computeRejectedCompletions");function x4i(t,e){let r=t.get(vy.ICompletionsLastGhostText);if(!r.position||!r.uri)return;let n=Wlc(r);n.length>0&&(0,SPr.postRejectionTasks)(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(x4i,"rejectLastShown");function zlc(t,e,r,n){let o=t.get(vy.ICompletionsLastGhostText);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==I4i.ResultType.TypingAsSuggested&&x4i(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(zlc,"setLastShown");function Ylc(t,e){let r=t.get(T4i.ICompletionsLogTargetService),n=t.get(vy.ICompletionsLastGhostText);if(n.index=e.index,!n.shownCompletions.find(o=>o.index===e.index)&&(e.uri===n.uri&&n.position?.line===e.position.line&&n.position?.character===e.position.character&&n.shownCompletions.push(e),e.displayText)){let o=e.resultType!==I4i.ResultType.Network;Vlc.debug(r,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${o}`),e.telemetry.measurements.compCharLen=e.displayText.length,(0,TPr.telemetryShown)(t,e)}}a(Ylc,"handleGhostTextShown");function Klc(t,e,r){let n=t.get(vy.ICompletionsLastGhostText);n.linesLeft===void 0&&(n.linesAccepted=(0,f_t.countLines)(e.insertText.substring(0,r)),n.linesLeft=(0,f_t.countLines)(e.displayText));let o=(0,f_t.countLines)(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(Klc,"handleLineAcceptance");function Jlc(t,e){let r=t.get(vy.ICompletionsLastGhostText),n;return r.partiallyAcceptedLength?n={compType:"full",acceptedLength:(r.partiallyAcceptedLength||0)+e.displayText.length,acceptedLines:r.linesAccepted+(r.linesLeft??0)}:n={compType:"full",acceptedLength:e.displayText.length,acceptedLines:(0,f_t.countLines)(e.displayText)},r.resetState(),(0,SPr.postInsertionTasks)(t,TPr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,n,e.copilotAnnotations)}a(Jlc,"handleGhostTextPostInsert");function Zlc(t,e,r){let n=t.get(vy.ICompletionsLastGhostText);Klc(t,e,r);let o={compType:"partial",acceptedLength:n.partiallyAcceptedLength||0,acceptedLines:n.linesAccepted};return(0,SPr.postInsertionTasks)(t,TPr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(Zlc,"handlePartialGhostTextPostInsert")});var w4i=I(xPr=>{"use strict";p();Object.defineProperty(xPr,"__esModule",{value:!0});xPr.normalizeIndentCharacter=Xlc;function Xlc(t,e,r){function n(s,c,l){let u=new RegExp(`^(${c})+`,"g");return s.split(` +`):e;throw r.message=`${r.message}. Response: ${o}`,r}}a(Luc,"jsonVerboseError");function kLi(t){return t&&t.name==="AbortError"}a(kLi,"isAbortError");function Buc(t){try{return new URL(t).hostname}catch{return"unknown"}}a(Buc,"safeGetHostname")});var PLi=I(uye=>{"use strict";p();Object.defineProperty(uye,"__esModule",{value:!0});uye.INTEGRATION_ID=uye.LICENSE_AGREEMENT=void 0;uye.LICENSE_AGREEMENT=void 0;uye.INTEGRATION_ID="code-oss"});var KE=I(dye=>{"use strict";p();Object.defineProperty(dye,"__esModule",{value:!0});dye.ICAPIClientService=dye.BaseCAPIClientService=void 0;var jLe=(Nne(),Qa(Dne)),Fuc=nn(),Uuc=Sy(),Quc=PLi(),XPr=class extends jLe.CAPIClient{static{a(this,"BaseCAPIClientService")}constructor(e,r,n,o){super({machineId:o.machineId,deviceId:o.devDeviceId,sessionId:o.sessionId,vscodeVersion:o.vscodeVersion,buildType:o.getBuildType(),name:o.getName(),version:o.getVersion()},Quc.LICENSE_AGREEMENT,n,e,r)}makeRequest(e,r){return this.abExpContext&&(e.headers||(e.headers={}),e.headers["VScode-ABExpContext"]=this.abExpContext,e.headers["X-Copilot-Client-Exp-Assignment-Context"]=this.abExpContext),(r.type===jLe.RequestType.Telemetry||r.type===jLe.RequestType.ChatCompletions||r.type===jLe.RequestType.ChatMessages||r.type===jLe.RequestType.ChatResponses)&&(e.callSite=Uuc.NO_FETCH_TELEMETRY),super.makeRequest(e,r)}};dye.BaseCAPIClientService=XPr;dye.ICAPIClientService=(0,Fuc.createServiceIdentifier)("ICAPIClientService")});var w_t=I(x_t=>{"use strict";p();Object.defineProperty(x_t,"__esModule",{value:!0});x_t.getEndpointUrl=Vuc;x_t.getLastKnownEndpoints=Wuc;var quc=HE(),juc=KE(),G$=qE(),Huc=dne(),Guc=y$();function NLi(t){let e=t.get(juc.ICAPIClientService);return{proxy:e.proxyBaseURL,"origin-tracker":e.originTrackerURL}}a(NLi,"getDefaultEndpoints");function DLi(t,e,r){if(r!==void 0&&t.get(Huc.ICompletionsRuntimeModeService).isRunningInTest()){for(let n of r){let o=(0,G$.getConfig)(t,n);if(o)return o}return}for(let n of e){let o=(0,G$.getConfig)(t,n);if(o)return o}}a(DLi,"urlConfigOverride");function $uc(t,e){switch(e){case"proxy":return DLi(t,[G$.ConfigKey.DebugOverrideProxyUrl,G$.ConfigKey.DebugOverrideProxyUrlLegacy],[G$.ConfigKey.DebugTestOverrideProxyUrl,G$.ConfigKey.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!G$.BuildInfo.isProduction())return DLi(t,[G$.ConfigKey.DebugSnippyOverrideUrl])}}a($uc,"getEndpointOverrideUrl");function Vuc(t,e,r,...n){let o=$uc(t,r)??(e.endpoints?e.endpoints[r]:void 0)??NLi(t)[r];return(0,Guc.joinPath)(o,...n)}a(Vuc,"getEndpointUrl");function Wuc(t){return t.get(quc.IAuthenticationService).copilotToken?.endpoints??NLi(t)}a(Wuc,"getLastKnownEndpoints")});var t2r=I(HLe=>{"use strict";p();Object.defineProperty(HLe,"__esModule",{value:!0});HLe.Response=void 0;HLe.isAbortError=Yuc;var zuc=Sy();Object.defineProperty(HLe,"Response",{enumerable:!0,get:a(function(){return zuc.Response},"get")});var e2r=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function Yuc(t){return!t||typeof t!="object"?!1:t instanceof e2r||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(Yuc,"isAbortError")});var fye=I(O0=>{"use strict";p();var Kuc=O0&&O0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Juc=O0&&O0.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Zuc=O0&&O0.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Kuc(e,t,r)},r2r=O0&&O0.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(O0,"__esModule",{value:!0});O0.Fetcher=O0.CompletionsFetcher=O0.ICompletionsFetcherService=void 0;O0.isInterruptedNetworkError=rdc;Zuc(t2r(),O0);var MLi=Pl(),Xuc=Sy(),edc=yh(),tdc=nn();O0.ICompletionsFetcherService=(0,tdc.createServiceIdentifier)("ICompletionsFetcherService");var n2r=class{static{a(this,"CompletionsFetcher")}constructor(e,r,n){this.configurationService=e,this.fetcherService=r,this.experimentationService=n}getImplementation(){return this}fetch(e,r){let n=this.configurationService.getExperimentBasedConfig(MLi.ConfigKey.CompletionsFetcher,this.experimentationService)||void 0,o=n?{...r,useFetcher:n}:r;return this.fetcherService.fetch(e,{...o,callSite:o.callSite??"completions-core"})}disconnectAll(){return this.fetcherService.disconnectAll()}};O0.CompletionsFetcher=n2r;O0.CompletionsFetcher=n2r=Juc([r2r(0,MLi.IConfigurationService),r2r(1,Xuc.IFetcherService),r2r(2,edc.IExperimentationService)],n2r);var i2r=class{static{a(this,"Fetcher")}getImplementation(){return this}};O0.Fetcher=i2r;function rdc(t){return t instanceof Error?t.message==="ERR_HTTP2_GOAWAY_SESSION"?!0:"code"in t?t.code==="ECONNRESET"||t.code==="ETIMEDOUT"||t.code==="ERR_HTTP2_INVALID_SESSION":!1:!1}a(rdc,"isInterruptedNetworkError")});var OLi=I(pye=>{"use strict";p();Object.defineProperty(pye,"__esModule",{value:!0});pye.FeatureName=pye.OutputPaneShowCommand=void 0;pye.OutputPaneShowCommand="codereferencing.showOutputPane2";pye.FeatureName="code-referencing"});var GLe=I(R_t=>{"use strict";p();Object.defineProperty(R_t,"__esModule",{value:!0});R_t.codeReferenceLogger=void 0;var ndc=Dl(),idc=OLi();R_t.codeReferenceLogger=new ndc.Logger(idc.FeatureName)});var FLi=I(D_t=>{"use strict";p();Object.defineProperty(D_t,"__esModule",{value:!0});D_t.ConnectionState=void 0;var odc=$s(),sdc=Dl(),adc=w_t(),cdc=fye(),$Le=GLe(),ldc=3e3,o2r=2,LLi=256,BLi=Math.log(LLi)/Math.log(o2r)/o2r,sN={connection:"disabled",maxAttempts:BLi,retryAttempts:0,initialWait:!1},k_t,P_t=[];function udc(){if(k_t)return k_t;function t(_){return P_t.push(_),()=>{let v=P_t.indexOf(_);v!==-1&&P_t.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of P_t)_()}a(e,"afterUpdateConnection");function r(_){sN.connection!==_&&(sN.connection=_,e())}a(r,"updateConnection");function n(){return sN.connection==="connected"}a(n,"isConnected");function o(){return sN.connection==="disconnected"}a(o,"isDisconnected");function s(){return sN.connection==="retry"}a(s,"isRetrying");function c(){return sN.connection==="disabled"}a(c,"isDisabled");function l(){r("connected"),h(!1)}a(l,"setConnected");function u(){r("disconnected")}a(u,"setDisconnected");function d(){r("retry")}a(d,"setRetrying");function f(){r("disabled")}a(f,"setDisabled");function h(_){sN.initialWait!==_&&(sN.initialWait=_)}a(h,"setInitialWait");function m(_,v=ldc){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return sN.initialWait}a(g,"isInitialWait");async function A(_,v){let b=_.get(sdc.ICompletionsLogTargetService),T=_.get(cdc.ICompletionsFetcherService),w=_.get(odc.IInstantiationService);$Le.codeReferenceLogger.info(b,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);function R(x){if(x>LLi){$Le.codeReferenceLogger.info(b,"Max retry time reached, disabling."),f();return}let P=a(async()=>{sN.retryAttempts=Math.min(sN.retryAttempts+1,BLi);try{$Le.codeReferenceLogger.info(b,`Pinging service after ${x} second(s)`);let D=await T.fetch(new URL("_ping",w.invokeFunction(adc.getLastKnownEndpoints)["origin-tracker"]).href,{callSite:"snippy-ping",method:"GET",headers:{"content-type":"application/json"}});if(D.status!==200||!D.ok)R(x**2);else{$Le.codeReferenceLogger.info(b,"Successfully reconnected."),l();return}}catch{R(x**2)}},"tryAgain");setTimeout(()=>{P()},x*1e3)}a(R,"succeedOrRetry"),$Le.codeReferenceLogger.info(b,"Attempting to reconnect."),R(o2r)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),k_t={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},k_t}a(udc,"registerConnectionState");D_t.ConnectionState=udc()});var QLi=I(iA=>{"use strict";p();Object.defineProperty(iA,"__esModule",{value:!0});iA.ErrorMessages=iA.ErrorReasons=void 0;iA.getErrorType=ULi;iA.createErrorResponse=ddc;iA.ErrorReasons={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"};iA.ErrorMessages={[iA.ErrorReasons.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[iA.ErrorReasons.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[iA.ErrorReasons.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function ULi(t){return t===401?iA.ErrorReasons.Unauthorized:t===400?iA.ErrorReasons.BadArguments:t===404?iA.ErrorReasons.NotFound:t===429?iA.ErrorReasons.RateLimit:t>=500&&t<600?iA.ErrorReasons.InternalError:t>=600?iA.ErrorReasons.ConnectionError:iA.ErrorReasons.Unknown}a(ULi,"getErrorType");function ddc(t,e,r={}){return{kind:"failure",reason:ULi(Number(t)),code:Number(t),msg:e,meta:r}}a(ddc,"createErrorResponse")});var u2r=I(mL=>{"use strict";p();Object.defineProperty(mL,"__esModule",{value:!0});mL.NoopTelemetryReporter=mL.snippyTelemetry=mL.matchNotificationTelemetry=mL.copilotOutputLogTelemetry=void 0;var fdc=Dl(),JE=Yg(),pdc=GLe(),hdc=/^[1-6][0-9][0-9]$/,mdc=/([A-Z][a-z]+)/,gdc="code_referencing",hye=class{static{a(this,"CodeQuoteTelemetry")}constructor(e){this.baseKey=e}buildKey(...e){return[gdc,this.baseKey,...e].join(".")}},s2r=class extends hye{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({instantiationService:e}){let r=this.buildKey("open","count"),n=JE.TelemetryData.createAndMarkAsIssued();e.invokeFunction(JE.telemetry,r,n)}handleFocus({instantiationService:e}){let r=JE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("focus","count");e.invokeFunction(JE.telemetry,n,r)}handleWrite({instantiationService:e}){let r=JE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("write","count");e.invokeFunction(JE.telemetry,n,r)}};mL.copilotOutputLogTelemetry=new s2r;var a2r=class extends hye{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({instantiationService:e,actor:r}){let n=JE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");e.invokeFunction(JE.telemetry,o,n)}handleDismiss({instantiationService:e,actor:r}){let n=JE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");e.invokeFunction(JE.telemetry,o,n)}};mL.matchNotificationTelemetry=new a2r;var c2r=class extends hye{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({instantiationService:e,origin:r,reason:n}){let o=JE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(JE.telemetryError,this.buildKey("unexpectedError"),o)}handleCompletionMissing({instantiationService:e,origin:r,reason:n}){let o=JE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(JE.telemetryError,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({instantiationService:e,origin:r,reason:n,message:o}){if(!r.match(hdc)){e.invokeFunction(l=>pdc.codeReferenceLogger.debug(l.get(fdc.ICompletionsLogTargetService),"Invalid status code, not sending telemetry",{origin:r}));return}let s=n.split(mdc).filter(l=>!!l).join("_").toLowerCase(),c=JE.TelemetryData.createAndMarkAsIssued({message:o});e.invokeFunction(JE.telemetryError,this.buildKey(s,r),c)}};mL.snippyTelemetry=new c2r;var l2r=class extends hye{static{a(this,"NoopTelemetryReporter")}constructor(e=""){super(e)}telemetry(...e){}telemetryError(...e){}};mL.NoopTelemetryReporter=l2r});var qLi=I(d2r=>{"use strict";p();Object.defineProperty(d2r,"__esModule",{value:!0});d2r.call=Tdc;var Adc=$s(),ydc=tAe(),Edc=qE(),_dc=Dl(),vdc=w_t(),Cdc=fye(),mye=FLi(),vh=QLi(),bdc=GLe(),Sdc=u2r();async function Tdc(t,e,r,n){let o,s=t.get(_dc.ICompletionsLogTargetService),c=t.get(Adc.IInstantiationService),l=t.get(ydc.ICompletionsCopilotTokenManager);try{o=l.token??await l.getToken()}catch{return mye.ConnectionState.setDisconnected(),(0,vh.createErrorResponse)(401,vh.ErrorMessages[vh.ErrorReasons.Unauthorized])}if(bdc.codeReferenceLogger.info(s,`Calling ${e}`),mye.ConnectionState.isRetrying())return(0,vh.createErrorResponse)(600,"Attempting to reconnect to the public code matching service.");if(mye.ConnectionState.isDisconnected())return(0,vh.createErrorResponse)(601,"The public code matching service is offline.");let u;try{u=await c.invokeFunction(_=>_.get(Cdc.ICompletionsFetcherService).fetch((0,vdc.getEndpointUrl)(_,o,"origin-tracker",e),{callSite:"snippy-network",method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...(0,Edc.editorVersionHeaders)(_)},signal:n}))}catch{return c.invokeFunction(mye.ConnectionState.enableRetry),(0,vh.createErrorResponse)(602,"Network error detected. Check your internet connection.")}let d;try{d=await u.json()}catch(_){let v=_.message;throw Sdc.snippyTelemetry.handleUnexpectedError({instantiationService:c,origin:"snippyNetwork",reason:v}),_}if(u.ok)return{kind:"success",...d};let f={...d,code:Number(u.status)},{code:h,msg:m,meta:g}=f,A=Number(h),y=(0,vh.getErrorType)(A),E=m||"unknown error";switch(y){case vh.ErrorReasons.Unauthorized:return(0,vh.createErrorResponse)(h,vh.ErrorMessages[vh.ErrorReasons.Unauthorized],g);case vh.ErrorReasons.BadArguments:return(0,vh.createErrorResponse)(h,E,g);case vh.ErrorReasons.RateLimit:return c.invokeFunction(_=>mye.ConnectionState.enableRetry(_,60*1e3)),(0,vh.createErrorResponse)(h,vh.ErrorMessages.RateLimitError,g);case vh.ErrorReasons.InternalError:return c.invokeFunction(_=>mye.ConnectionState.enableRetry(_)),(0,vh.createErrorResponse)(h,vh.ErrorMessages[vh.ErrorReasons.InternalError],g);default:return(0,vh.createErrorResponse)(h,E,g)}}a(Tdc,"call")});var f2r=I(y1=>{"use strict";p();Object.defineProperty(y1,"__esModule",{value:!0});y1.FileMatchResponse=y1.FileMatchRequest=y1.MatchResponse=y1.MatchRequest=y1.MatchError=void 0;var Ea=iyt();y1.MatchError=Ea.Type.Object({kind:Ea.Type.Literal("failure"),reason:Ea.Type.String(),code:Ea.Type.Number(),msg:Ea.Type.String(),meta:Ea.Type.Optional(Ea.Type.Any())});var Idc=Ea.Type.Object({matched_source:Ea.Type.String(),occurrences:Ea.Type.String(),capped:Ea.Type.Boolean(),cursor:Ea.Type.String(),github_url:Ea.Type.String()});y1.MatchRequest=Ea.Type.Object({source:Ea.Type.String()});var xdc=Ea.Type.Object({snippets:Ea.Type.Array(Idc)});y1.MatchResponse=Ea.Type.Union([xdc,y1.MatchError]);y1.FileMatchRequest=Ea.Type.Object({cursor:Ea.Type.String()});var wdc=Ea.Type.Object({commit_id:Ea.Type.String(),license:Ea.Type.String(),nwo:Ea.Type.String(),path:Ea.Type.String(),url:Ea.Type.String()}),Rdc=Ea.Type.Object({has_next_page:Ea.Type.Boolean(),cursor:Ea.Type.String()}),kdc=Ea.Type.Object({count:Ea.Type.Record(Ea.Type.String(),Ea.Type.String())}),Pdc=Ea.Type.Object({file_matches:Ea.Type.Array(wdc),page_info:Rdc,license_stats:kdc});y1.FileMatchResponse=Ea.Type.Union([Pdc,y1.MatchError])});var $Li=I(gL=>{"use strict";p();var Ddc=gL&&gL.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ndc=gL&&gL.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jLi=gL&&gL.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(e9,"__esModule",{value:!0});e9.MinTokenLength=void 0;e9.lexemeLength=VLi;e9.offsetLastLexemes=Bdc;e9.hasMinLexemeLength=Fdc;var VLe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu");e9.MinTokenLength=65;function VLi(t){let e=0,r;VLe.lastIndex=0;do if(r=VLe.exec(t),r&&(e+=1),e>=e9.MinTokenLength)break;while(r);return e}a(VLi,"lexemeLength");function Ldc(t,e){let r=0,n;VLe.lastIndex=0;do if(n=VLe.exec(t),n&&(r+=1,r>=e))return VLe.lastIndex;while(n);return t.length}a(Ldc,"offsetFirstLexemes");function Bdc(t,e){let r=t.split("").reverse().join(""),n=Ldc(r,e);return r.length-n}a(Bdc,"offsetLastLexemes");function Fdc(t){return VLi(t)>=e9.MinTokenLength}a(Fdc,"hasMinLexemeLength")});var XLi=I(t9=>{"use strict";p();var Udc=t9&&t9.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qdc=t9&&t9.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),JLi=t9&&t9.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oYLi(E,()=>zLi.Match(E,f)));if(!h||KLi(h)||!h.snippets.length){p2r.codeReferenceLogger.info(s,"No match found");return}p2r.codeReferenceLogger.info(s,"Match found");let{snippets:m}=h,g=m.map(async E=>{let _=await o.invokeFunction(T=>YLi(T,()=>zLi.FilesForMatch(T,{cursor:E.cursor})));if(!_||KLi(_))return;let v=_.file_matches,b=_.license_stats;return{match:E,files:v,licenseStats:b}}),y=(await Promise.all(g)).filter(E=>E!==void 0);if(y.length)for(let E of y){let _=new Set(Object.keys(E.licenseStats?.count??{}));_.has("NOASSERTION")&&(_.delete("NOASSERTION"),_.add("unknown"));let v=Array.from(_).sort(),b=n,T=n+E.match.matched_source.length,w=u.positionAt(b),R=u.positionAt(T);await l.handleIPCodeCitation({inDocumentUri:e,offsetStart:b,offsetEnd:T,version:u.version,location:{start:w,end:R},matchingText:f,details:v.map(x=>({license:x,url:E.match.github_url}))})}}a(zdc,"fetchCitations")});var oBi=I($$=>{"use strict";p();Object.defineProperty($$,"__esModule",{value:!0});$$.editDistance=tBi;$$.emptyLexDictionary=rBi;$$.reverseLexDictionary=nBi;$$.lexGeneratorWords=iBi;$$.lexicalAnalyzer=h2r;$$.lexEditDistance=Ydc;function tBi(t,e,r=(n,o)=>n===o?0:1){if(e.length===0||t.length===0)return{distance:e.length,startOffset:0,endOffset:0};let n=new Array(e.length+1).fill(0),o=new Array(e.length+1).fill(0),s=new Array(t.length+1).fill(0),c=new Array(t.length+1).fill(0),l=e[0];for(let d=0;d0?d-1:0;for(let d=1;d0&&(yield e),e=o,n=s)}e.length>0&&(yield e)}a(iBi,"lexGeneratorWords");function h2r(t,e,r,n){let o=[],s=0;for(let c of r(t))n(c)&&(e.has(c)||e.set(c,e.size),o.push([e.get(c),s])),s+=c.length;return[o,e]}a(h2r,"lexicalAnalyzer");function eBi(t){return t!==" "}a(eBi,"notSingleSpace");function Ydc(t,e,r=iBi){let[n,o]=h2r(t,rBi(),r,eBi),[s,c]=h2r(e,o,r,eBi);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=nBi(c),u=s.length,d=l[s[0][0]],f=l[s[u-1][0]];function h(y,E,_,v){if(v===0||v===u-1){let b=l[n[_][0]];return v===0&&b.endsWith(d)||v===u-1&&b.startsWith(f)?0:1}else return y===E?0:1}a(h,"compare");let m=tBi(n.map(y=>y[0]),s.map(y=>y[0]),h),g=n[m.startOffset][1],A=m.endOffset0&&t[A-1]===" "&&--A,{lexDistance:m.distance,startOffset:g,endOffset:A,haystackLexLength:n.length,needleLexLength:s.length}}a(Ydc,"lexEditDistance")});var m2r=I(Mne=>{"use strict";p();Object.defineProperty(Mne,"__esModule",{value:!0});Mne.PartialAcceptTriggerKind=void 0;Mne.computeCompCharLen=Kdc;Mne.countLines=Jdc;Mne.computeCompletionText=Zdc;var sBi;(function(t){t[t.Unknown=0]="Unknown",t[t.Word=1]="Word",t[t.Line=2]="Line",t[t.Suggest=3]="Suggest"})(sBi||(Mne.PartialAcceptTriggerKind=sBi={}));function Kdc(t,e){return t.compType==="partial"?t.acceptedLength:e.length}a(Kdc,"computeCompCharLen");function Jdc(t){return t.length===0?0:t.split(` +`).length}a(Jdc,"countLines");function Zdc(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(Zdc,"computeCompletionText")});var gBi=I(B_t=>{"use strict";p();Object.defineProperty(B_t,"__esModule",{value:!0});B_t.postRejectionTasks=ufc;B_t.postInsertionTasks=dfc;var L_t=$s(),lBi=Dte(),Xdc=tAe(),O_t=bNi(),efc=qgt(),tfc=sxr(),uBi=RIr(),dBi=HAe(),Aye=Dl(),aBi=jyt(),rfc=nye(),nfc=XLi(),cBi=oBi(),ifc=m2r(),V$=Yg(),ofc=l1(),fBi=H5e(),sfc=dne(),W$=new Aye.Logger("postInsertion"),pBi=[{seconds:15,captureCode:!1,captureRejection:!1},{seconds:30,captureCode:!0,captureRejection:!0},{seconds:120,captureCode:!1,captureRejection:!1},{seconds:300,captureCode:!1,captureRejection:!1},{seconds:600,captureCode:!1,captureRejection:!1}],hBi=50,afc=1500,cfc=.5,lfc=500,g2r={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function mBi(t,e,r,n,o){let s=t.get(L_t.IInstantiationService),c=t.get(Aye.ICompletionsLogTargetService),l=await t.get(uBi.ICompletionsFileReaderService).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(l.status!=="valid")return W$.info(c,`Could not get document for ${e}. Maybe it was closed by the editor.`),{prompt:{prefix:"",suffix:"",isFimEnabled:!1},capturedCode:"",terminationOffset:0};let u=l.document,d=u.getText(),f=d.substring(0,n),h=u.positionAt(n),m=await s.invokeFunction(rfc.extractPrompt,r.properties.headerRequestId,(0,tfc.createCompletionState)(u,h),r),g=m.type==="prompt"?m.prompt:{prefix:f,suffix:"",isFimEnabled:!1};if(g.isFimEnabled&&o!==void 0){let A=d.substring(n,o);return g.suffix=d.substring(o),{prompt:g,capturedCode:A,terminationOffset:0}}else{let A=d.substring(n),y=(0,aBi.contextIndentationFromText)(f,n,u.detectedLanguageId),_=(0,aBi.indentationBlockFinished)(y,void 0)(A),v=Math.min(d.length,n+(_?_*2:lfc)),b=d.substring(n,v);return{prompt:g,capturedCode:b,terminationOffset:_??-1}}}a(mBi,"captureCode");function ufc(t,e,r,n,o){let s=t.get(Aye.ICompletionsLogTargetService),c=t.get(L_t.IInstantiationService),l=t.get(lBi.ICompletionsTelemetryService),u=t.get(fBi.ICompletionsPromiseQueueService);o.forEach(({completionText:m,completionTelemetryData:g})=>{W$.debug(s,`${e}.rejected choiceIndex: ${g.properties.choiceIndex}`),c.invokeFunction(dBi.telemetryRejected,e,g)});let d=c.createInstance(O_t.ChangeTracker,n,r-1),f=c.createInstance(O_t.ChangeTracker,n,r),h=a(async m=>{W$.debug(s,`Original offset: ${r}, Tracked offset: ${d.offset}`);let{completionTelemetryData:g}=o[0],{prompt:A,capturedCode:y,terminationOffset:E}=await c.invokeFunction(mBi,n,g,d.offset+1,f.offset),_={hypotheticalPromptJson:JSON.stringify({prefix:A.prefix,context:A.context}),hypotheticalPromptSuffixJson:JSON.stringify(A.suffix)},v=g.extendedBy({..._,capturedCodeJson:JSON.stringify(y)},{timeout:m.seconds,insertionOffset:r,trackedOffset:d.offset,terminationOffsetInCapturedCode:E});W$.debug(s,`${e}.capturedAfterRejected choiceIndex: ${g.properties.choiceIndex}`,v),c.invokeFunction(V$.telemetry,e+".capturedAfterRejected",v,V$.TelemetryStore.Enhanced)},"checkInCode");pBi.filter(m=>m.captureRejection).map(m=>d.push((0,V$.telemetryCatch)(l,u,()=>h(m),"postRejectionTasks"),m.seconds*1e3))}a(ufc,"postRejectionTasks");function dfc(t,e,r,n,o,s,c,l){let u=t.get(Aye.ICompletionsLogTargetService),d=t.get(L_t.IInstantiationService),f=t.get(fBi.ICompletionsPromiseQueueService),h=t.get(lBi.ICompletionsTelemetryService),m=t.get(sfc.ICompletionsRuntimeModeService),g=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});W$.debug(u,`${e}.accepted choiceIndex: ${g.properties.choiceIndex}`),d.invokeFunction(dBi.telemetryAccepted,e,g);let A=r;r=(0,ifc.computeCompletionText)(r,c);let y=r.trim(),E=d.createInstance(O_t.ChangeTracker,o,n),_=d.createInstance(O_t.ChangeTracker,o,n+r.length),v=a(async b=>{await d.invokeFunction(mfc,e,y,n,o,b,g,E,_)},"stillInCodeCheck");if(g2r.triggerPostInsertionSynchroneously&&m.isRunningInTest()){let b=v({seconds:0,captureCode:g2r.captureCode,captureRejection:g2r.captureRejection});f.register(b)}else pBi.map(b=>E.push((0,V$.telemetryCatch)(h,f,()=>v(b),"postInsertionTasks"),b.seconds*1e3));d.invokeFunction(b=>(0,V$.telemetryCatch)(h,f,ffc,"post insertion citation check")(b,o,A,r,n,l))}a(dfc,"postInsertionTasks");async function ffc(t,e,r,n,o,s){let c=t.get(Aye.ICompletionsLogTargetService),l=t.get(ofc.ICompletionsTextDocumentManagerService),u=t.get(Xdc.ICompletionsCopilotTokenManager),d=t.get(efc.ICompletionsCitationManager);if(!s||(s.ip_code_citations?.length??0)<1){if(u.getLastToken()?.getTokenValue("sn")==="1")return;await(0,nfc.fetchCitations)(t,e,n,o);return}let f=await l.getTextDocument({uri:e});if(f){let h=A2r(f.getText(),n,hBi,o);h.stillInCodeHeuristic&&(o=h.foundOffset)}for(let h of s.ip_code_citations){let m=pfc(r.length,n.length,h.start_offset);if(m===void 0){W$.info(c,`Full completion for ${e} contains a reference matching public code, but the partially inserted text did not include the match.`);continue}let g=o+m,A=f?.positionAt(g),y=o+hfc(r.length,n.length,h.stop_offset),E=f?.positionAt(y),_=A&&E?f?.getText({start:A,end:E}):"";await d.handleIPCodeCitation({inDocumentUri:e,offsetStart:g,offsetEnd:y,version:f?.version,location:A&&E?{start:A,end:E}:void 0,matchingText:_,details:h.details.citations})}}a(ffc,"citationCheck");function pfc(t,e,r){if(!(ee))return r}a(pfc,"computeCitationStart");function hfc(t,e,r){return e{"use strict";p();Object.defineProperty(Ty,"__esModule",{value:!0});Ty.LastGhostText=Ty.ICompletionsLastGhostText=void 0;Ty.rejectLastShown=EBi;Ty.setLastShown=Efc;Ty.handleGhostTextShown=_fc;Ty.handleGhostTextPostInsert=Cfc;Ty.handlePartialGhostTextPostInsert=bfc;var gfc=nn(),ABi=Dl(),E2r=gBi(),F_t=m2r(),yBi=_$(),_2r=HAe(),Afc=new ABi.Logger("ghostText");Ty.ICompletionsLastGhostText=(0,gfc.createServiceIdentifier)("ICompletionsLastGhostText");var y2r=class{static{a(this,"LastGhostText")}constructor(){this.#r=[],this.linesAccepted=0}#e;#t;#r;get position(){return this.#e}get shownCompletions(){return this.#r||[]}get uri(){return this.#t}resetState(){this.#t=void 0,this.#e=void 0,this.#r=[],this.resetPartialAcceptanceState()}setState({uri:e},r){this.#t=e,this.#e=r,this.#r=[]}resetPartialAcceptanceState(){this.partiallyAcceptedLength=0,this.totalLength=void 0,this.linesLeft=void 0,this.linesAccepted=0}};Ty.LastGhostText=y2r;function yfc(t){let e=[];return t.shownCompletions.forEach(r=>{if(r.displayText&&r.telemetry){let n,o;t.partiallyAcceptedLength?(n=r.displayText.substring(t.partiallyAcceptedLength-1),o=r.telemetry.extendedBy({compType:"partial"},{compCharLen:n.length})):(n=r.displayText,o=r.telemetry);let s={completionText:n,completionTelemetryData:o,offset:r.offset};e.push(s)}}),e}a(yfc,"computeRejectedCompletions");function EBi(t,e){let r=t.get(Ty.ICompletionsLastGhostText);if(!r.position||!r.uri)return;let n=yfc(r);n.length>0&&(0,E2r.postRejectionTasks)(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(EBi,"rejectLastShown");function Efc(t,e,r,n){let o=t.get(Ty.ICompletionsLastGhostText);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==yBi.ResultType.TypingAsSuggested&&EBi(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(Efc,"setLastShown");function _fc(t,e){let r=t.get(ABi.ICompletionsLogTargetService),n=t.get(Ty.ICompletionsLastGhostText);if(n.index=e.index,!n.shownCompletions.find(o=>o.index===e.index)&&(e.uri===n.uri&&n.position?.line===e.position.line&&n.position?.character===e.position.character&&n.shownCompletions.push(e),e.displayText)){let o=e.resultType!==yBi.ResultType.Network;Afc.debug(r,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${o}`),e.telemetry.measurements.compCharLen=e.displayText.length,(0,_2r.telemetryShown)(t,e)}}a(_fc,"handleGhostTextShown");function vfc(t,e,r){let n=t.get(Ty.ICompletionsLastGhostText);n.linesLeft===void 0&&(n.linesAccepted=(0,F_t.countLines)(e.insertText.substring(0,r)),n.linesLeft=(0,F_t.countLines)(e.displayText));let o=(0,F_t.countLines)(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(vfc,"handleLineAcceptance");function Cfc(t,e){let r=t.get(Ty.ICompletionsLastGhostText),n;return r.partiallyAcceptedLength?n={compType:"full",acceptedLength:(r.partiallyAcceptedLength||0)+e.displayText.length,acceptedLines:r.linesAccepted+(r.linesLeft??0)}:n={compType:"full",acceptedLength:e.displayText.length,acceptedLines:(0,F_t.countLines)(e.displayText)},r.resetState(),(0,E2r.postInsertionTasks)(t,_2r.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,n,e.copilotAnnotations)}a(Cfc,"handleGhostTextPostInsert");function bfc(t,e,r){let n=t.get(Ty.ICompletionsLastGhostText);vfc(t,e,r);let o={compType:"partial",acceptedLength:n.partiallyAcceptedLength||0,acceptedLines:n.linesAccepted};return(0,E2r.postInsertionTasks)(t,_2r.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(bfc,"handlePartialGhostTextPostInsert")});var _Bi=I(C2r=>{"use strict";p();Object.defineProperty(C2r,"__esModule",{value:!0});C2r.normalizeIndentCharacter=Sfc;function Sfc(t,e,r){function n(s,c,l){let u=new RegExp(`^(${c})+`,"g");return s.split(` `).map(d=>{let f=d.replace(u,""),h=d.length-f.length;return l(h)+f}).join(` `)}a(n,"replace");let o;if(t.tabSize===void 0||typeof t.tabSize=="string"?o=4:o=t.tabSize,t.insertSpaces===!1){let s=a(c=>n(c," ",l=>" ".repeat(Math.floor(l/o))+" ".repeat(l%o)),"r");e.displayText=s(e.displayText),e.completionText=s(e.completionText)}else if(t.insertSpaces===!0){let s=a(c=>n(c," ",l=>" ".repeat(l*o)),"r");if(e.displayText=s(e.displayText),e.completionText=s(e.completionText),r){let c=a(l=>{if(l==="")return l;let u=l.split(` -`)[0],d=u.length-u.trimStart().length,f=d%o;if(f!==0&&d>0){let h=" ".repeat(f);return n(l,h,m=>" ".repeat((Math.floor(m/o)+1)*o))}else return l},"re");e.displayText=c(e.displayText),e.completionText=c(e.completionText)}}return e}a(Xlc,"normalizeIndentCharacter")});var R4i=I(wPr=>{"use strict";p();Object.defineProperty(wPr,"__esModule",{value:!0});wPr.completionsFromGhostTextResults=nuc;var euc=T0(),p_t=mAe(),tuc=w4i(),ruc=a$();function nuc(t,e,r,n,o,s){let c=r.lineAt(n),l=t.map(u=>{let d=p_t.LocationFactory.range(p_t.LocationFactory.position(n.line,0),p_t.LocationFactory.position(n.line,n.character+u.suffixCoverage)),f="";if(o&&(u.completion=(0,tuc.normalizeIndentCharacter)(o,u.completion,c.isEmptyOrWhitespace)),c.isEmptyOrWhitespace&&(u.completion.displayNeedsWsOffset||u.completion.completionText.startsWith(c.text)))f=u.completion.completionText;else{let m=p_t.LocationFactory.range(d.start,n);f=r.getText(m)+u.completion.displayText}return{uuid:(0,euc.generateUuid)(),insertText:f,range:d,uri:r.uri,index:u.completion.completionIndex,telemetry:u.telemetry,displayText:u.completion.displayText,position:n,offset:r.offsetAt(n),resultType:e,copilotAnnotations:u.copilotAnnotations,clientCompletionId:u.clientCompletionId}});if(e===ruc.ResultType.TypingAsSuggested&&s!==void 0){let u=l.find(d=>d.index===s);if(u){let d=l.filter(f=>f.index!==s);l=[u,...d]}}return l}a(nuc,"completionsFromGhostTextResults")});var PPr=I(XD=>{"use strict";p();var iuc=XD&&XD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ouc=XD&&XD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),suc=XD&&XD.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ou.toString(16).padStart(2,"0")).join("");return`${r}.${l}`}a(auc,"createRequestHMAC");async function cuc(t){let e=typeof t=="string"?new TextEncoder().encode(t):t,r=await crypto.subtle.digest("SHA-256",e),n=new Uint8Array(r),o="";for(let s of n)o+=s.toString(16).padStart(2,"0");return o}a(cuc,"createSha256Hash");var RPr=new Map;function luc(t){if(RPr.has(t))return RPr.get(t);let e=uuc(t);return RPr.set(t,e),e}a(luc,"getCachedSha256Hash");function uuc(t){let e=new kPr;return e.update(t),e.digest()}a(uuc,"createSha256HashSyncInsecure");function L$(t,e=32){return t instanceof ArrayBuffer?(0,k4i.encodeHex)(k4i.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(L$,"toHexString");function pL(t,e){return(t>>>e|t<<32-e)>>>0}a(pL,"rightRotate");var kPr=class t{static{a(this,"StringSHA256Insecure")}static{this._k=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]}static{this._bigBlock32=new DataView(new ArrayBuffer(256))}constructor(){this._h0=1779033703,this._h1=3144134277,this._h2=1013904242,this._h3=2773480762,this._h4=1359893119,this._h5=2600822924,this._h6=528734635,this._h7=1541459225,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let r=e.length;if(r===0)return;let n=this._buff,o=this._buffLen,s=this._leftoverHighSurrogate,c,l;for(s!==0?(c=s,l=-1,s=0):(c=e.charCodeAt(0),l=0);;){let u=c;if(h_t.isHighSurrogate(c))if(l+1>>6,e[r++]=128|(n&63)>>>0):n<65536?(e[r++]=224|(n&61440)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0):(e[r++]=240|(n&1835008)>>>18,e[r++]=128|(n&258048)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0),r>=64&&(this._step(),r-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),r}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),L$(this._h0)+L$(this._h1)+L$(this._h2)+L$(this._h3)+L$(this._h4)+L$(this._h5)+L$(this._h6)+L$(this._h7)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let e=t._bigBlock32,r=this._buffDV,n=t._k;for(let m=0;m<64;m+=4)e.setUint32(m,r.getUint32(m,!1),!1);for(let m=16;m<64;m++){let g=m*4,A=e.getUint32((m-15)*4,!1),y=e.getUint32((m-2)*4,!1),E=pL(A,7)^pL(A,18)^A>>>3,_=pL(y,17)^pL(y,19)^y>>>10,v=e.getUint32((m-16)*4,!1),b=e.getUint32((m-7)*4,!1);e.setUint32(g,v+E+b+_>>>0,!1)}let o=this._h0,s=this._h1,c=this._h2,l=this._h3,u=this._h4,d=this._h5,f=this._h6,h=this._h7;for(let m=0;m<64;m++){let g=pL(u,6)^pL(u,11)^pL(u,25),A=u&d^~u&f,y=h+g+A+n[m]+e.getUint32(m*4,!1)>>>0,E=pL(o,2)^pL(o,13)^pL(o,22),_=o&s^o&c^s&c,v=E+_>>>0;h=f,f=d,d=u,u=l+y>>>0,l=c,c=s,s=o,o=y+v>>>0}this._h0=this._h0+o>>>0,this._h1=this._h1+s>>>0,this._h2=this._h2+c>>>0,this._h3=this._h3+l>>>0,this._h4=this._h4+u>>>0,this._h5=this._h5+d>>>0,this._h6=this._h6+f>>>0,this._h7=this._h7+h>>>0}}});var DPr=I(m_t=>{"use strict";p();Object.defineProperty(m_t,"__esModule",{value:!0});m_t.isInlineSuggestionFromTextAfterCursor=P4i;m_t.determineIsInlineSuggestionPosition=duc;function P4i(t){let e=fuc(t),r=puc(t);if(!(e&&!r))return e&&r}a(P4i,"isInlineSuggestionFromTextAfterCursor");function duc(t){let e=t.textAfterCursor();return P4i(e)}a(duc,"determineIsInlineSuggestionPosition");function fuc(t){return t.trim().length!==0}a(fuc,"isMiddleOfTheLineFromTextAfterCursor");function puc(t){let e=t.trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(e)}a(puc,"isValidMiddleOfTheLineFromTextAfterCursor")});var A_t=I(B$=>{"use strict";p();Object.defineProperty(B$,"__esModule",{value:!0});B$.NoOpStatusReporter=B$.StatusReporter=B$.ICompletionsStatusReporter=void 0;var huc=nn();B$.ICompletionsStatusReporter=(0,huc.createServiceIdentifier)("ICompletionsStatusReporter");var g_t=class{static{a(this,"StatusReporter")}#e=0;#t="Normal";#r;#n;#i=!0;get busy(){return this.#e>0}withProgress(e){return this.#t==="Warning"&&this.forceNormal(),this.#e++===0&&this.#o(),e().finally(()=>{--this.#e===0&&this.#o()})}forceStatus(e,r,n){this.#t===e&&this.#r===r&&!n&&!this.#n&&!this.#i||(this.#t=e,this.#r=r,this.#n=n,this.#i=!1,this.#o())}forceNormal(){this.#t!=="Inactive"&&this.forceStatus("Normal")}setError(e,r){this.forceStatus("Error",e,r)}setWarning(e){this.#t!=="Error"&&this.forceStatus("Warning",e)}setInactive(e){this.#t==="Error"||this.#t==="Warning"||this.forceStatus("Inactive",e)}clearInactive(){this.#t==="Inactive"&&this.forceStatus("Normal")}#o(){let e={kind:this.#t,message:this.#r,busy:this.busy,command:this.#n};this.didChange(e)}};B$.StatusReporter=g_t;var NPr=class extends g_t{static{a(this,"NoOpStatusReporter")}didChange(){}};B$.NoOpStatusReporter=NPr});var FPr=I(Cy=>{"use strict";p();Object.defineProperty(Cy,"__esModule",{value:!0});Cy.AdoRepoId=Cy.GithubRepoId=Cy.IGitService=void 0;Cy.getGitHubRepoInfoFromContext=Auc;Cy.getOrderedRepoInfosFromContext=yuc;Cy.getOrderedRemoteUrlsFromContext=OPr;Cy.parseRemoteUrl=LPr;Cy.toGithubNwo=D4i;Cy.toGithubWebUrl=Euc;Cy.getGithubRepoIdFromFetchUrl=BPr;Cy.getAdoRepoIdFromFetchUrl=N4i;Cy.normalizeFetchUrl=_uc;var muc=nn(),MPr=em(),guc=nd();Cy.IGitService=(0,muc.createServiceIdentifier)("IGitService");function Auc(t){for(let e of OPr(t))if(e){let r=BPr(e);if(r)return{id:r,remoteUrl:e}}}a(Auc,"getGitHubRepoInfoFromContext");function*yuc(t){for(let e of OPr(t)){let r=BPr(e)??N4i(e);r&&(yield{repoId:r,fetchUrl:e})}}a(yuc,"getOrderedRepoInfosFromContext");function OPr(t){let e=new Set;if(t.remoteFetchUrls?.length===1)return e.add(t.remoteFetchUrls[0]),e;let r=t.remotes.findIndex(o=>o===t.upstreamRemote);if(r!==-1){let o=t.remoteFetchUrls?.[r];o&&e.add(o)}let n=t.remotes.findIndex(o=>o==="origin");if(n!==-1){let o=t.remoteFetchUrls?.[n];o&&e.add(o)}for(let o of t.remoteFetchUrls??[])o&&e.add(o);return e}a(OPr,"getOrderedRemoteUrlsFromContext");function LPr(t){t=t.trim();try{if(/^[\w\d\-]+@/i.test(t)){let u=t.split(":");if(u.length!==2)return;t="ssh://"+u[0]+"/"+u[1]}let e=guc.URI.parse(t),r=e.authority,n=e.path;if(!((0,MPr.equalsIgnoreCase)(e.scheme,"ssh")||(0,MPr.equalsIgnoreCase)(e.scheme,"https")||(0,MPr.equalsIgnoreCase)(e.scheme,"http")))return;let o=r.split("@");if(o.length>2)return;let s=o.at(-1);if(!s)return;let c=s.toLowerCase().replace(/:\d+$/,"");return{host:c.replace(/^[\w\-]+-/,"").replace(/-[\w\-]+$/,""),rawHost:c,path:n}}catch{return}}a(LPr,"parseRemoteUrl");var y_t=class t{static{a(this,"GithubRepoId")}static parse(e){let r=e.split("/");if(r.length===2)return new t(r[0],r[1])}constructor(e,r,n="github.com"){this.org=e,this.repo=r,this.host=n,this.type="github"}toString(){return D4i(this)}};Cy.GithubRepoId=y_t;function D4i(t){return`${t.org}/${t.repo}`.toLowerCase()}a(D4i,"toGithubNwo");function Euc(t){return`https://${t.host}/${t.org}/${t.repo}`}a(Euc,"toGithubWebUrl");function BPr(t){let e=LPr(t);if(!e)return;let n=["github.com","ghe.com"].find(c=>e.host===c||e.host.endsWith("."+c));if(!n)return;let o=n==="ghe.com"?e.rawHost:"github.com",s=e.path.match(/^\/?([^/]+)\/([^/]+?)(\/|\.git\/?)?$/i);return s?new y_t(s[1],s[2],o):void 0}a(BPr,"getGithubRepoIdFromFetchUrl");var rye=class{static{a(this,"AdoRepoId")}constructor(e,r,n){this.org=e,this.project=r,this.repo=n,this.type="ado"}toString(){return`${this.org}/${this.project}/${this.repo}`.toLowerCase()}};Cy.AdoRepoId=rye;function N4i(t){let e=LPr(t);if(e){if(e.host==="dev.azure.com"){let r=e.path.match(/^\/?(?[^/]+)\/(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new rye(r.groups.org,r.groups.project,r.groups.repo):void 0}if(e.host==="ssh.dev.azure.com"){let r=e.path.match(/^\/?v3\/(?[^/]+)\/(?[^/]+?)\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new rye(r.groups.org,r.groups.project,r.groups.repo):void 0}if(e.host.endsWith(".visualstudio.com")){let r=e.host.match(/^(?[^\.]+)\.visualstudio\.com$/i);if(!r?.groups)return;let n=e.path.match(/^\/(v3\/)(?[^/]+?)\/(?[^/]+?)\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i)??e.path.match(/^\/?((?[^/]+?)\/)?(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return n?.groups?new rye(r.groups.org,n.groups.project,n.groups.repo):void 0}}}a(N4i,"getAdoRepoIdFromFetchUrl");function _uc(t){if(/^[\w\d\-]+@[\w\d\.\-]+:/.test(t))return t=t.replace(/([\w\d\-]+)@([\w\d\.\-]+):(.+)/,"https://$2/$3"),t;let e;try{e=new URL(t)}catch{return t}let r=e.pathname.match(/^\/scm\/scm\.git/),n=new URL("https://"+e.hostname+e.pathname);return!r&&/^\/scm\/[^/]/.test(n.pathname)&&(n.pathname=n.pathname.replace(/^\/scm\//,"/")),n.toString()}a(_uc,"normalizeFetchUrl")});var qPr=I(Ine=>{"use strict";p();Object.defineProperty(Ine,"__esModule",{value:!0});Ine.ComputationStatus=void 0;Ine.tryGetGitHubNWO=buc;Ine.extractRepoInfoInBackground=Suc;Ine.extractRepoInfo=M4i;var UPr=FPr(),vuc=n$(),Cuc=C6(),SLe=o$();function buc(t){if(t!==void 0&&t!==TLe.PENDING&&t.repoId?.type==="github")return(t.repoId.org+"/"+t.repoId.repo).toLowerCase()}a(buc,"tryGetGitHubNWO");function Suc(t,e){let r=(0,SLe.dirname)(e);return Tuc(t,r)}a(Suc,"extractRepoInfoInBackground");var Tuc=Ruc(M4i,1e4);async function M4i(t,e){let r=t.get(vuc.ICompletionsFileSystemService),n=(0,SLe.getFsUri)(e);if(!n)return;let o=await xuc(r,n);if(!o)return;let s=(0,SLe.joinPath)(o,".git","config"),c;try{c=await r.readFileString(s)}catch{return}let l=wuc(c)??"",u=Iuc(l),d={uri:o};return u===void 0?{baseFolder:d,url:l,hostname:"",pathname:"",repoId:void 0}:{baseFolder:d,url:l,hostname:u.host,pathname:u.path,repoId:u.repoId}}a(M4i,"extractRepoInfo");function Iuc(t){let e=(0,UPr.parseRemoteUrl)(t);if(!e)return;let r=(0,UPr.getGithubRepoIdFromFetchUrl)(t)??(0,UPr.getAdoRepoIdFromFetchUrl)(t);return{...e,repoId:r}}a(Iuc,"parseRepoUrl");async function xuc(t,e){let r=e+"_add_to_make_longer";for(;e!=="file:///"&&e.length{let c=JSON.stringify(s),l=r.get(c);if(l)return l.result;if(n.has(c))return TLe.PENDING;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new QPr(d)),n.delete(c)}),TLe.PENDING}}a(Ruc,"computeInBackgroundAndMemoize")});var L4i=I(jPr=>{"use strict";p();Object.defineProperty(jPr,"__esModule",{value:!0});jPr.isRepetitive=Puc;var kuc=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function Puc(t){let e=t.slice();return e.reverse(),O4i(e)||O4i(e.filter(r=>r.trim().length>0))}a(Puc,"isRepetitive");function O4i(t){let e=Duc(t);for(let r of kuc){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(Duc,"kmp_prefix_function")});var F4i=I(ILe=>{"use strict";p();Object.defineProperty(ILe,"__esModule",{value:!0});ILe.maybeSnipCompletionImpl=B4i;ILe.postProcessChoiceInContext=Fuc;ILe.checkSuffix=Uuc;var Nuc=Qre(),xne=$g(),Muc=L4i();function Ouc(t,e,r,n){let o="}";try{o=(0,Nuc.getBlockCloseToken)(e.detectedLanguageId)??"}"}catch{}return B4i({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(Ouc,"maybeSnipCompletion");function B4i(t,e,r,n){let o=Luc(r),s=o.lines;if(s.length===1)return r;for(let c=1;c=t.getLineCount()?void 0:t.getLineText(y),h!==void 0&&h.trim()==="")u++;else break}let m,g;for(;m=c+f+d,g=m>=s.length?void 0:s[m],g!==void 0&&g.trim()==="";)d++;let A=m===s.length-1;if(!g||!(h&&(A?h.startsWith(g)||g.startsWith(h):h===g&&g.trim()===n))){l=!1;break}}if(l)return s.slice(0,c).join(o.newLineCharacter)}return r}a(B4i,"maybeSnipCompletionImpl");function Luc(t){let e=t.includes(`\r +`)[0],d=u.length-u.trimStart().length,f=d%o;if(f!==0&&d>0){let h=" ".repeat(f);return n(l,h,m=>" ".repeat((Math.floor(m/o)+1)*o))}else return l},"re");e.displayText=c(e.displayText),e.completionText=c(e.completionText)}}return e}a(Sfc,"normalizeIndentCharacter")});var vBi=I(b2r=>{"use strict";p();Object.defineProperty(b2r,"__esModule",{value:!0});b2r.completionsFromGhostTextResults=wfc;var Tfc=x0(),U_t=PAe(),Ifc=_Bi(),xfc=_$();function wfc(t,e,r,n,o,s){let c=r.lineAt(n),l=t.map(u=>{let d=U_t.LocationFactory.range(U_t.LocationFactory.position(n.line,0),U_t.LocationFactory.position(n.line,n.character+u.suffixCoverage)),f="";if(o&&(u.completion=(0,Ifc.normalizeIndentCharacter)(o,u.completion,c.isEmptyOrWhitespace)),c.isEmptyOrWhitespace&&(u.completion.displayNeedsWsOffset||u.completion.completionText.startsWith(c.text)))f=u.completion.completionText;else{let m=U_t.LocationFactory.range(d.start,n);f=r.getText(m)+u.completion.displayText}return{uuid:(0,Tfc.generateUuid)(),insertText:f,range:d,uri:r.uri,index:u.completion.completionIndex,telemetry:u.telemetry,displayText:u.completion.displayText,position:n,offset:r.offsetAt(n),resultType:e,copilotAnnotations:u.copilotAnnotations,clientCompletionId:u.clientCompletionId}});if(e===xfc.ResultType.TypingAsSuggested&&s!==void 0){let u=l.find(d=>d.index===s);if(u){let d=l.filter(f=>f.index!==s);l=[u,...d]}}return l}a(wfc,"completionsFromGhostTextResults")});var I2r=I(aN=>{"use strict";p();var Rfc=aN&&aN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kfc=aN&&aN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Pfc=aN&&aN.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ou.toString(16).padStart(2,"0")).join("");return`${r}.${l}`}a(Dfc,"createRequestHMAC");async function Nfc(t){let e=typeof t=="string"?new TextEncoder().encode(t):t,r=await crypto.subtle.digest("SHA-256",e),n=new Uint8Array(r),o="";for(let s of n)o+=s.toString(16).padStart(2,"0");return o}a(Nfc,"createSha256Hash");var S2r=new Map;function Mfc(t){if(S2r.has(t))return S2r.get(t);let e=Ofc(t);return S2r.set(t,e),e}a(Mfc,"getCachedSha256Hash");function Ofc(t){let e=new T2r;return e.update(t),e.digest()}a(Ofc,"createSha256HashSyncInsecure");function z$(t,e=32){return t instanceof ArrayBuffer?(0,CBi.encodeHex)(CBi.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(z$,"toHexString");function AL(t,e){return(t>>>e|t<<32-e)>>>0}a(AL,"rightRotate");var T2r=class t{static{a(this,"StringSHA256Insecure")}static{this._k=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]}static{this._bigBlock32=new DataView(new ArrayBuffer(256))}constructor(){this._h0=1779033703,this._h1=3144134277,this._h2=1013904242,this._h3=2773480762,this._h4=1359893119,this._h5=2600822924,this._h6=528734635,this._h7=1541459225,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let r=e.length;if(r===0)return;let n=this._buff,o=this._buffLen,s=this._leftoverHighSurrogate,c,l;for(s!==0?(c=s,l=-1,s=0):(c=e.charCodeAt(0),l=0);;){let u=c;if(Q_t.isHighSurrogate(c))if(l+1>>6,e[r++]=128|(n&63)>>>0):n<65536?(e[r++]=224|(n&61440)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0):(e[r++]=240|(n&1835008)>>>18,e[r++]=128|(n&258048)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0),r>=64&&(this._step(),r-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),r}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),z$(this._h0)+z$(this._h1)+z$(this._h2)+z$(this._h3)+z$(this._h4)+z$(this._h5)+z$(this._h6)+z$(this._h7)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let e=t._bigBlock32,r=this._buffDV,n=t._k;for(let m=0;m<64;m+=4)e.setUint32(m,r.getUint32(m,!1),!1);for(let m=16;m<64;m++){let g=m*4,A=e.getUint32((m-15)*4,!1),y=e.getUint32((m-2)*4,!1),E=AL(A,7)^AL(A,18)^A>>>3,_=AL(y,17)^AL(y,19)^y>>>10,v=e.getUint32((m-16)*4,!1),b=e.getUint32((m-7)*4,!1);e.setUint32(g,v+E+b+_>>>0,!1)}let o=this._h0,s=this._h1,c=this._h2,l=this._h3,u=this._h4,d=this._h5,f=this._h6,h=this._h7;for(let m=0;m<64;m++){let g=AL(u,6)^AL(u,11)^AL(u,25),A=u&d^~u&f,y=h+g+A+n[m]+e.getUint32(m*4,!1)>>>0,E=AL(o,2)^AL(o,13)^AL(o,22),_=o&s^o&c^s&c,v=E+_>>>0;h=f,f=d,d=u,u=l+y>>>0,l=c,c=s,s=o,o=y+v>>>0}this._h0=this._h0+o>>>0,this._h1=this._h1+s>>>0,this._h2=this._h2+c>>>0,this._h3=this._h3+l>>>0,this._h4=this._h4+u>>>0,this._h5=this._h5+d>>>0,this._h6=this._h6+f>>>0,this._h7=this._h7+h>>>0}}});var x2r=I(q_t=>{"use strict";p();Object.defineProperty(q_t,"__esModule",{value:!0});q_t.isInlineSuggestionFromTextAfterCursor=bBi;q_t.determineIsInlineSuggestionPosition=Lfc;function bBi(t){let e=Bfc(t),r=Ffc(t);if(!(e&&!r))return e&&r}a(bBi,"isInlineSuggestionFromTextAfterCursor");function Lfc(t){let e=t.textAfterCursor();return bBi(e)}a(Lfc,"determineIsInlineSuggestionPosition");function Bfc(t){return t.trim().length!==0}a(Bfc,"isMiddleOfTheLineFromTextAfterCursor");function Ffc(t){let e=t.trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(e)}a(Ffc,"isValidMiddleOfTheLineFromTextAfterCursor")});var H_t=I(Y$=>{"use strict";p();Object.defineProperty(Y$,"__esModule",{value:!0});Y$.NoOpStatusReporter=Y$.StatusReporter=Y$.ICompletionsStatusReporter=void 0;var Ufc=nn();Y$.ICompletionsStatusReporter=(0,Ufc.createServiceIdentifier)("ICompletionsStatusReporter");var j_t=class{static{a(this,"StatusReporter")}#e=0;#t="Normal";#r;#n;#i=!0;get busy(){return this.#e>0}withProgress(e){return this.#t==="Warning"&&this.forceNormal(),this.#e++===0&&this.#o(),e().finally(()=>{--this.#e===0&&this.#o()})}forceStatus(e,r,n){this.#t===e&&this.#r===r&&!n&&!this.#n&&!this.#i||(this.#t=e,this.#r=r,this.#n=n,this.#i=!1,this.#o())}forceNormal(){this.#t!=="Inactive"&&this.forceStatus("Normal")}setError(e,r){this.forceStatus("Error",e,r)}setWarning(e){this.#t!=="Error"&&this.forceStatus("Warning",e)}setInactive(e){this.#t==="Error"||this.#t==="Warning"||this.forceStatus("Inactive",e)}clearInactive(){this.#t==="Inactive"&&this.forceStatus("Normal")}#o(){let e={kind:this.#t,message:this.#r,busy:this.busy,command:this.#n};this.didChange(e)}};Y$.StatusReporter=j_t;var w2r=class extends j_t{static{a(this,"NoOpStatusReporter")}didChange(){}};Y$.NoOpStatusReporter=w2r});var N2r=I(Iy=>{"use strict";p();Object.defineProperty(Iy,"__esModule",{value:!0});Iy.AdoRepoId=Iy.GithubRepoId=Iy.IGitService=void 0;Iy.getGitHubRepoInfoFromContext=jfc;Iy.getOrderedRepoInfosFromContext=Hfc;Iy.getOrderedRemoteUrlsFromContext=k2r;Iy.parseRemoteUrl=P2r;Iy.toGithubNwo=SBi;Iy.toGithubWebUrl=Gfc;Iy.getGithubRepoIdFromFetchUrl=D2r;Iy.getAdoRepoIdFromFetchUrl=TBi;Iy.normalizeFetchUrl=$fc;var Qfc=nn(),R2r=om(),qfc=ad();Iy.IGitService=(0,Qfc.createServiceIdentifier)("IGitService");function jfc(t){for(let e of k2r(t))if(e){let r=D2r(e);if(r)return{id:r,remoteUrl:e}}}a(jfc,"getGitHubRepoInfoFromContext");function*Hfc(t){for(let e of k2r(t)){let r=D2r(e)??TBi(e);r&&(yield{repoId:r,fetchUrl:e})}}a(Hfc,"getOrderedRepoInfosFromContext");function k2r(t){let e=new Set;if(t.remoteFetchUrls?.length===1)return e.add(t.remoteFetchUrls[0]),e;let r=t.remotes.findIndex(o=>o===t.upstreamRemote);if(r!==-1){let o=t.remoteFetchUrls?.[r];o&&e.add(o)}let n=t.remotes.findIndex(o=>o==="origin");if(n!==-1){let o=t.remoteFetchUrls?.[n];o&&e.add(o)}for(let o of t.remoteFetchUrls??[])o&&e.add(o);return e}a(k2r,"getOrderedRemoteUrlsFromContext");function P2r(t){t=t.trim();try{if(/^[\w\d\-]+@/i.test(t)){let u=t.split(":");if(u.length!==2)return;t="ssh://"+u[0]+"/"+u[1]}let e=qfc.URI.parse(t),r=e.authority,n=e.path;if(!((0,R2r.equalsIgnoreCase)(e.scheme,"ssh")||(0,R2r.equalsIgnoreCase)(e.scheme,"https")||(0,R2r.equalsIgnoreCase)(e.scheme,"http")))return;let o=r.split("@");if(o.length>2)return;let s=o.at(-1);if(!s)return;let c=s.toLowerCase().replace(/:\d+$/,"");return{host:c.replace(/^[\w\-]+-/,"").replace(/-[\w\-]+$/,""),rawHost:c,path:n}}catch{return}}a(P2r,"parseRemoteUrl");var G_t=class t{static{a(this,"GithubRepoId")}static parse(e){let r=e.split("/");if(r.length===2)return new t(r[0],r[1])}constructor(e,r,n="github.com"){this.org=e,this.repo=r,this.host=n,this.type="github"}toString(){return SBi(this)}};Iy.GithubRepoId=G_t;function SBi(t){return`${t.org}/${t.repo}`.toLowerCase()}a(SBi,"toGithubNwo");function Gfc(t){return`https://${t.host}/${t.org}/${t.repo}`}a(Gfc,"toGithubWebUrl");function D2r(t){let e=P2r(t);if(!e)return;let n=["github.com","ghe.com"].find(c=>e.host===c||e.host.endsWith("."+c));if(!n)return;let o=n==="ghe.com"?e.rawHost:"github.com",s=e.path.match(/^\/?([^/]+)\/([^/]+?)(\/|\.git\/?)?$/i);return s?new G_t(s[1],s[2],o):void 0}a(D2r,"getGithubRepoIdFromFetchUrl");var yye=class{static{a(this,"AdoRepoId")}constructor(e,r,n){this.org=e,this.project=r,this.repo=n,this.type="ado"}toString(){return`${this.org}/${this.project}/${this.repo}`.toLowerCase()}};Iy.AdoRepoId=yye;function TBi(t){let e=P2r(t);if(e){if(e.host==="dev.azure.com"){let r=e.path.match(/^\/?(?[^/]+)\/(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new yye(r.groups.org,r.groups.project,r.groups.repo):void 0}if(e.host==="ssh.dev.azure.com"){let r=e.path.match(/^\/?v3\/(?[^/]+)\/(?[^/]+?)\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new yye(r.groups.org,r.groups.project,r.groups.repo):void 0}if(e.host.endsWith(".visualstudio.com")){let r=e.host.match(/^(?[^\.]+)\.visualstudio\.com$/i);if(!r?.groups)return;let n=e.path.match(/^\/(v3\/)(?[^/]+?)\/(?[^/]+?)\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i)??e.path.match(/^\/?((?[^/]+?)\/)?(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return n?.groups?new yye(r.groups.org,n.groups.project,n.groups.repo):void 0}}}a(TBi,"getAdoRepoIdFromFetchUrl");function $fc(t){if(/^[\w\d\-]+@[\w\d\.\-]+:/.test(t))return t=t.replace(/([\w\d\-]+)@([\w\d\.\-]+):(.+)/,"https://$2/$3"),t;let e;try{e=new URL(t)}catch{return t}let r=e.pathname.match(/^\/scm\/scm\.git/),n=new URL("https://"+e.hostname+e.pathname);return!r&&/^\/scm\/[^/]/.test(n.pathname)&&(n.pathname=n.pathname.replace(/^\/scm\//,"/")),n.toString()}a($fc,"normalizeFetchUrl")});var L2r=I(One=>{"use strict";p();Object.defineProperty(One,"__esModule",{value:!0});One.ComputationStatus=void 0;One.tryGetGitHubNWO=zfc;One.extractRepoInfoInBackground=Yfc;One.extractRepoInfo=IBi;var M2r=N2r(),Vfc=g$(),Wfc=M6(),WLe=y$();function zfc(t){if(t!==void 0&&t!==zLe.PENDING&&t.repoId?.type==="github")return(t.repoId.org+"/"+t.repoId.repo).toLowerCase()}a(zfc,"tryGetGitHubNWO");function Yfc(t,e){let r=(0,WLe.dirname)(e);return Kfc(t,r)}a(Yfc,"extractRepoInfoInBackground");var Kfc=epc(IBi,1e4);async function IBi(t,e){let r=t.get(Vfc.ICompletionsFileSystemService),n=(0,WLe.getFsUri)(e);if(!n)return;let o=await Zfc(r,n);if(!o)return;let s=(0,WLe.joinPath)(o,".git","config"),c;try{c=await r.readFileString(s)}catch{return}let l=Xfc(c)??"",u=Jfc(l),d={uri:o};return u===void 0?{baseFolder:d,url:l,hostname:"",pathname:"",repoId:void 0}:{baseFolder:d,url:l,hostname:u.host,pathname:u.path,repoId:u.repoId}}a(IBi,"extractRepoInfo");function Jfc(t){let e=(0,M2r.parseRemoteUrl)(t);if(!e)return;let r=(0,M2r.getGithubRepoIdFromFetchUrl)(t)??(0,M2r.getAdoRepoIdFromFetchUrl)(t);return{...e,repoId:r}}a(Jfc,"parseRepoUrl");async function Zfc(t,e){let r=e+"_add_to_make_longer";for(;e!=="file:///"&&e.length{let c=JSON.stringify(s),l=r.get(c);if(l)return l.result;if(n.has(c))return zLe.PENDING;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new O2r(d)),n.delete(c)}),zLe.PENDING}}a(epc,"computeInBackgroundAndMemoize")});var wBi=I(B2r=>{"use strict";p();Object.defineProperty(B2r,"__esModule",{value:!0});B2r.isRepetitive=rpc;var tpc=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function rpc(t){let e=t.slice();return e.reverse(),xBi(e)||xBi(e.filter(r=>r.trim().length>0))}a(rpc,"isRepetitive");function xBi(t){let e=npc(t);for(let r of tpc){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(npc,"kmp_prefix_function")});var kBi=I(YLe=>{"use strict";p();Object.defineProperty(YLe,"__esModule",{value:!0});YLe.maybeSnipCompletionImpl=RBi;YLe.postProcessChoiceInContext=lpc;YLe.checkSuffix=upc;var ipc=Yre(),Lne=Yg(),opc=wBi();function spc(t,e,r,n){let o="}";try{o=(0,ipc.getBlockCloseToken)(e.detectedLanguageId)??"}"}catch{}return RBi({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(spc,"maybeSnipCompletion");function RBi(t,e,r,n){let o=apc(r),s=o.lines;if(s.length===1)return r;for(let c=1;c=t.getLineCount()?void 0:t.getLineText(y),h!==void 0&&h.trim()==="")u++;else break}let m,g;for(;m=c+f+d,g=m>=s.length?void 0:s[m],g!==void 0&&g.trim()==="";)d++;let A=m===s.length-1;if(!g||!(h&&(A?h.startsWith(g)||g.startsWith(h):h===g&&g.trim()===n))){l=!1;break}}if(l)return s.slice(0,c).join(o.newLineCharacter)}return r}a(RBi,"maybeSnipCompletionImpl");function apc(t){let e=t.includes(`\r `)?`\r `:` -`;return{lines:t.split(e),newLineCharacter:e}}a(Luc,"splitByNewLine");function Buc(t,e,r,n){let o="",s=e.line+1,c=n?r.trim():r;for(;o===""&&s0){if(r.completionText.indexOf(o)!==-1)return o.length;{let s=-1,c=0;for(let l of o){let u=r.completionText.indexOf(l,s+1);if(u>s)c++,s=u;else break}return c}}return 0}a(Uuc,"checkSuffix")});var j4i=I(F$=>{"use strict";p();Object.defineProperty(F$,"__esModule",{value:!0});F$.DocumentLogEntry=void 0;F$.serializeOffsetRange=Quc;F$.deserializeOffsetRange=quc;F$.serializeEdit=juc;F$.deserializeEdit=Huc;var U4i=kE(),q4i=hd(),Q4i;(function(t){function e(r){return!!r&&typeof r=="object"&&"id"in r&&"time"in r}a(e,"is"),t.is=e})(Q4i||(F$.DocumentLogEntry=Q4i={}));function Quc(t){return[t.start,t.endExclusive]}a(Quc,"serializeOffsetRange");function quc(t){return new q4i.OffsetRange(t[0],t[1])}a(quc,"deserializeOffsetRange");function juc(t){return t.replacements.map(e=>[e.replaceRange.start,e.replaceRange.endExclusive,e.newText])}a(juc,"serializeEdit");function Huc(t){return U4i.StringEdit.create(t.map(e=>U4i.StringReplacement.replace(new q4i.OffsetRange(e[0],e[1]),e[2])))}a(Huc,"deserializeEdit")});var nye=I(km=>{"use strict";p();Object.defineProperty(km,"__esModule",{value:!0});km.StatelessNextEditTelemetryBuilder=km.StatelessNextEditResult=km.NoNextEditReason=km.FilteredOutReason=km.StatelessNextEditDocument=km.StatelessNextEditRequest=km.RequestEditWindowWithCursorJump=km.RequestEditWindow=km.WithStatelessProviderTelemetry=void 0;var H4i=uw(),HPr=rd(),Guc=nl(),$uc=YP(),Vuc=kE(),Wuc=qT(),zuc=j4i(),Yuc=b0r(),GPr=class{static{a(this,"WithStatelessProviderTelemetry")}constructor(e,r){this.v=e,this.telemetryBuilder=r}};km.WithStatelessProviderTelemetry=GPr;var $Pr=class{static{a(this,"RequestEditWindow")}constructor(e){this.window=e}containsCursor(e){return this.window.containsRange(e)}};km.RequestEditWindow=$Pr;var VPr=class{static{a(this,"RequestEditWindowWithCursorJump")}constructor(e,r){this.window=e,this.originalWindow=r}containsCursor(e){return this.window.containsRange(e)||this.originalWindow.containsRange(e)}};km.RequestEditWindowWithCursorJump=VPr;var WPr=class t{static{a(this,"StatelessNextEditRequest")}static{this.ID=0}get result(){return this._result.p}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g){this.headerRequestId=e,this.opportunityId=r,this.documentBeforeEdits=n,this.documents=o,this.activeDocumentIdx=s,this.xtabEditHistory=c,this.firstEdit=l,this.expandedEditWindowNLines=u,this.isSpeculative=d,this.logContext=f,this.recordingBookmark=h,this.recording=m,this.providerRequestStartDateTime=g,this.seqid=String(++t.ID),this.cancellationTokenSource=new $uc.CancellationTokenSource,this.liveDependentants=0,this.fetchIssued=!1,this.intermediateUserEdit=Vuc.StringEdit.empty,this._result=new Guc.DeferredPromise,(0,HPr.assert)(o.length>0),(0,HPr.assert)(s>=0&&sr.id===e)!==void 0}getActiveDocument(){return this.documents[this.activeDocumentIdx]}serialize(){return{id:this.headerRequestId,documents:this.documents.map(e=>e.serialize()),activeDocumentIdx:this.activeDocumentIdx,recording:this.recording}}toString(){return this.toMarkdown()}toMarkdown(){return`### StatelessNextEditRequest +`;return{lines:t.split(e),newLineCharacter:e}}a(apc,"splitByNewLine");function cpc(t,e,r,n){let o="",s=e.line+1,c=n?r.trim():r;for(;o===""&&s0){if(r.completionText.indexOf(o)!==-1)return o.length;{let s=-1,c=0;for(let l of o){let u=r.completionText.indexOf(l,s+1);if(u>s)c++,s=u;else break}return c}}return 0}a(upc,"checkSuffix")});var MBi=I(K$=>{"use strict";p();Object.defineProperty(K$,"__esModule",{value:!0});K$.DocumentLogEntry=void 0;K$.serializeOffsetRange=dpc;K$.deserializeOffsetRange=fpc;K$.serializeEdit=ppc;K$.deserializeEdit=hpc;var PBi=ME(),NBi=Ed(),DBi;(function(t){function e(r){return!!r&&typeof r=="object"&&"id"in r&&"time"in r}a(e,"is"),t.is=e})(DBi||(K$.DocumentLogEntry=DBi={}));function dpc(t){return[t.start,t.endExclusive]}a(dpc,"serializeOffsetRange");function fpc(t){return new NBi.OffsetRange(t[0],t[1])}a(fpc,"deserializeOffsetRange");function ppc(t){return t.replacements.map(e=>[e.replaceRange.start,e.replaceRange.endExclusive,e.newText])}a(ppc,"serializeEdit");function hpc(t){return PBi.StringEdit.create(t.map(e=>PBi.StringReplacement.replace(new NBi.OffsetRange(e[0],e[1]),e[2])))}a(hpc,"deserializeEdit")});var Eye=I(Om=>{"use strict";p();Object.defineProperty(Om,"__esModule",{value:!0});Om.StatelessNextEditTelemetryBuilder=Om.StatelessNextEditResult=Om.NoNextEditReason=Om.FilteredOutReason=Om.StatelessNextEditDocument=Om.StatelessNextEditRequest=Om.RequestEditWindowWithCursorJump=Om.RequestEditWindow=Om.WithStatelessProviderTelemetry=void 0;var OBi=yw(),F2r=sd(),mpc=nl(),gpc=n2(),Apc=ME(),ypc=$T(),Epc=MBi(),_pc=z0r(),U2r=class{static{a(this,"WithStatelessProviderTelemetry")}constructor(e,r){this.v=e,this.telemetryBuilder=r}};Om.WithStatelessProviderTelemetry=U2r;var Q2r=class{static{a(this,"RequestEditWindow")}constructor(e){this.window=e}containsCursor(e){return this.window.containsRange(e)}};Om.RequestEditWindow=Q2r;var q2r=class{static{a(this,"RequestEditWindowWithCursorJump")}constructor(e,r){this.window=e,this.originalWindow=r}containsCursor(e){return this.window.containsRange(e)||this.originalWindow.containsRange(e)}};Om.RequestEditWindowWithCursorJump=q2r;var j2r=class t{static{a(this,"StatelessNextEditRequest")}static{this.ID=0}get result(){return this._result.p}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g){this.headerRequestId=e,this.opportunityId=r,this.documentBeforeEdits=n,this.documents=o,this.activeDocumentIdx=s,this.xtabEditHistory=c,this.firstEdit=l,this.expandedEditWindowNLines=u,this.isSpeculative=d,this.logContext=f,this.recordingBookmark=h,this.recording=m,this.providerRequestStartDateTime=g,this.seqid=String(++t.ID),this.cancellationTokenSource=new gpc.CancellationTokenSource,this.liveDependentants=0,this.fetchIssued=!1,this.intermediateUserEdit=Apc.StringEdit.empty,this._result=new mpc.DeferredPromise,(0,F2r.assert)(o.length>0),(0,F2r.assert)(s>=0&&sr.id===e)!==void 0}getActiveDocument(){return this.documents[this.activeDocumentIdx]}serialize(){return{id:this.headerRequestId,documents:this.documents.map(e=>e.serialize()),activeDocumentIdx:this.activeDocumentIdx,recording:this.recording}}toString(){return this.toMarkdown()}toMarkdown(){return`### StatelessNextEditRequest ${this.documents.map((r,n)=>` * [${n+1}/${this.documents.length}] ${n===this.activeDocumentIdx?"(active document) ":""}`+r.toMarkdown()).join(` -`)}`}};km.StatelessNextEditRequest=WPr;var zPr=class{static{a(this,"StatelessNextEditDocument")}constructor(e,r,n,o,s,c,l,u=void 0){this.id=e,this.workspaceRoot=r,this.languageId=n,this.documentLinesBeforeEdit=o,this.recentEdit=s,this.documentBeforeEdits=c,this.recentEdits=l,this.lastSelectionInAfterEdit=u,this.documentAfterEdits=new Wuc.StringText(this.recentEdits.apply(this.documentBeforeEdits.value)),this.documentAfterEditsLines=this.documentAfterEdits.getLines()}serialize(){return{id:this.id.uri,workspaceRoot:this.workspaceRoot?.toString(),languageId:this.languageId,documentLinesBeforeEdit:this.documentLinesBeforeEdit,recentEdit:this.recentEdit.serialize(),documentBeforeEdits:this.documentBeforeEdits.value,recentEdits:this.recentEdits.serialize(),lastSelectionInAfterEdit:this.lastSelectionInAfterEdit===void 0?void 0:(0,zuc.serializeOffsetRange)(this.lastSelectionInAfterEdit)}}toString(){return this.toMarkdown()}toMarkdown(){let e=[];return e.push(`StatelessNextEditDocument: **${this.id.uri}** +`)}`}};Om.StatelessNextEditRequest=j2r;var H2r=class{static{a(this,"StatelessNextEditDocument")}constructor(e,r,n,o,s,c,l,u=void 0){this.id=e,this.workspaceRoot=r,this.languageId=n,this.documentLinesBeforeEdit=o,this.recentEdit=s,this.documentBeforeEdits=c,this.recentEdits=l,this.lastSelectionInAfterEdit=u,this.documentAfterEdits=new ypc.StringText(this.recentEdits.apply(this.documentBeforeEdits.value)),this.documentAfterEditsLines=this.documentAfterEdits.getLines()}serialize(){return{id:this.id.uri,workspaceRoot:this.workspaceRoot?.toString(),languageId:this.languageId,documentLinesBeforeEdit:this.documentLinesBeforeEdit,recentEdit:this.recentEdit.serialize(),documentBeforeEdits:this.documentBeforeEdits.value,recentEdits:this.recentEdits.serialize(),lastSelectionInAfterEdit:this.lastSelectionInAfterEdit===void 0?void 0:(0,Epc.serializeOffsetRange)(this.lastSelectionInAfterEdit)}}toString(){return this.toMarkdown()}toMarkdown(){let e=[];return e.push(`StatelessNextEditDocument: **${this.id.uri}** `),e.push("```patch"),e.push(this.recentEdit.humanReadablePatch(this.documentLinesBeforeEdit)),e.push("```"),e.push(""),e.join(` -`)}};km.StatelessNextEditDocument=zPr;var G4i;(function(t){t.LowLogProbSuggestions="lowLogProbSuggestions",t.EnforcingNextEditOptions="enforcingNextEditOptions",t.PromptTooLarge="promptTooLarge",t.Uncategorized="uncategorized"})(G4i||(km.FilteredOutReason=G4i={}));var hL;(function(t){class e{static{a(this,"NoNextEditReason")}}class r extends e{static{a(this,"ActiveDocumentHasNoEdits")}constructor(){super(...arguments),this.kind="activeDocumentHasNoEdits"}toString(){return this.kind}}t.ActiveDocumentHasNoEdits=r;class n extends e{static{a(this,"NoSuggestions")}constructor(h,m,g,A){super(),this.documentBeforeEdits=h,this.window=m,this.nextCursorPosition=g,this.nextCursorDocumentId=A,this.kind="noSuggestions"}toString(){return this.kind}}t.NoSuggestions=n;class o extends e{static{a(this,"GotCancelled")}constructor(h){super(),this.message=h,this.kind="gotCancelled"}toString(){return`${this.kind}:${this.message}`}}t.GotCancelled=o;class s extends e{static{a(this,"FetchFailure")}constructor(h){super(),this.error=h,this.kind="fetchFailure"}toString(){return`${this.kind}:${this.error.message}`}}t.FetchFailure=s;class c extends e{static{a(this,"FilteredOut")}constructor(h){super(),this.message=h,this.kind="filteredOut"}toString(){return`${this.kind}:${this.message}`}}t.FilteredOut=c;class l extends e{static{a(this,"PromptTooLarge")}constructor(h){super(),this.message=h,this.kind="promptTooLarge"}toString(){return`${this.kind}:${this.message}`}}t.PromptTooLarge=l;class u extends e{static{a(this,"Uncategorized")}constructor(h){super(),this.error=h,this.kind="uncategorized"}toString(){return`${this.kind}:${this.error.message}`}}t.Uncategorized=u;class d extends e{static{a(this,"Unexpected")}constructor(h){super(),this.error=h,this.kind="unexpected"}toString(){return`${this.kind}:${this.error.message}`}}t.Unexpected=d})(hL||(km.NoNextEditReason=hL={}));var YPr=class t{static{a(this,"StatelessNextEditResult")}static noEdit(e,r){let n=H4i.Result.error(e),o=r.build(n);return new t(n,o)}static streaming(e){let r=H4i.Result.ok(void 0),n=e.build(r);return new t(r,n)}constructor(e,r){this.nextEdit=e,this.telemetry=r}};km.StatelessNextEditResult=YPr;var KPr=class{static{a(this,"StatelessNextEditTelemetryBuilder")}constructor(e){this._nextCursorPrediction={nextCursorLineError:void 0,nextCursorLineDistance:void 0,isCrossFile:void 0},this.startTime=Date.now(),this.requestUuid=e}build(e){let n=Date.now()-this.startTime,o=this._prompt?JSON.stringify(this._prompt.map(({role:f,content:h})=>({role:f,content:h}))):void 0,s=this._prompt?(0,Yuc.stringifyChatMessages)(this._prompt):void 0,c=s?.split(` -`).length,l=s?.length,u=e.isOk()?void 0:e.err.kind,d;return e.isError()&&(e.err instanceof hL.ActiveDocumentHasNoEdits||e.err instanceof hL.NoSuggestions||(e.err instanceof hL.GotCancelled||e.err instanceof hL.FilteredOut||e.err instanceof hL.PromptTooLarge?d=e.err.message:e.err instanceof hL.FetchFailure||e.err instanceof hL.Uncategorized||e.err instanceof hL.Unexpected?d=e.err.error.stack?e.err.error.stack:e.err.error.message:(0,HPr.assertNever)(e.err))),{hadStatelessNextEditProviderCall:!0,noNextEditReasonKind:u,noNextEditReasonMessage:d,statelessNextEditProviderDuration:n,logProbThreshold:this._logProbThreshold,mergeConflictExpanded:this._mergeConflictExpanded,nLinesOfCurrentFileInPrompt:this._nLinesOfCurrentFileInPrompt,modelName:this._modelName,prompt:o,promptLineCount:c,promptCharCount:l,isCursorAtEndOfLine:this._isCursorAtLineEnd,isInlineSuggestion:this._isInlineSuggestion,debounceTime:this._debounceTime,artificialDelay:this._artificialDelay,fetchStartedAt:this._fetchStartedAt,hadLowLogProbSuggestion:this._hadLowLogProbSuggestion,response:this._response,nEditsSuggested:this._nEditsSuggested,nextEditLogprob:this._nextEditLogProb,nextCursorPrediction:this._nextCursorPrediction,lineDistanceToMostRecentEdit:this._lineDistanceToMostRecentEdit,xtabAggressivenessLevel:this._xtabAggressivenessLevel,xtabUserHappinessScore:this._xtabUserHappinessScore,userAggressivenessSetting:this._userAggressivenessSetting,editIntent:this._editIntent,editIntentParseError:this._editIntentParseError,cursorJumpModelName:this._cursorJumpModelName,cursorJumpPrompt:this._cursorJumpPrompt?JSON.stringify(this._cursorJumpPrompt.map(({role:f,content:h})=>({role:f,content:h}))):void 0,cursorJumpResponse:this._cursorJumpResponse,nDiffsInPrompt:this._nDiffsInPrompt,diffTokensInPrompt:this._diffTokensInPrompt,nNeighborSnippetsComputed:this._nNeighborSnippetsComputed,nNeighborSnippetsInPrompt:this._nNeighborSnippetsInPrompt,neighborSnippetIndicesInPrompt:this._neighborSnippetIndicesInPrompt,lintErrors:this._lintErrors,terminalOutput:this._terminalOutput,similarFilesContext:this._similarFilesContext,modelConfig:this._modelConfig}}setLogProbThreshold(e){return this._logProbThreshold=e,this}setMergeConflictExpanded(e){return this._mergeConflictExpanded=e,this}setHadLowLogProbSuggestion(e){return this._hadLowLogProbSuggestion=e,this}setNLinesOfCurrentFileInPrompt(e){return this._nLinesOfCurrentFileInPrompt=e,this}setModelName(e){return this._modelName=e,this}setPrompt(e){return this._prompt=e,this}setIsCursorAtLineEnd(e){return this._isCursorAtLineEnd=e,this}setIsInlineSuggestion(e){return this._isInlineSuggestion=e,this}setDebounceTime(e){return this._debounceTime=e,this}setArtificialDelay(e){return this._artificialDelay=e,this}setFetchStartedAt(){return this._fetchStartedAt=Date.now(),this}get fetchStartedAt(){return this._fetchStartedAt}setResponse(e){return this._response=e.then(({response:r,ttft:n})=>{let o=Date.now()-this._fetchStartedAt,s=r.type;return{ttft:n,response:r,fetchTime:o,fetchResult:s}}),this}setCursorJumpModelName(e){return this._cursorJumpModelName=e,this}setCursorJumpPrompt(e){return this._cursorJumpPrompt=e,this}setCursorJumpResponse(e){return this._cursorJumpResponse=e,this}setNextEditLogProb(e){return this._nextEditLogProb=e,this}setNEditsSuggested(e){return this._nEditsSuggested=e,this}setLineDistanceToMostRecentEdit(e){return this._lineDistanceToMostRecentEdit=e,this}setNextCursorLineError(e){return this._nextCursorPrediction.nextCursorLineError=e,this}setNextCursorLineDistance(e){return this._nextCursorPrediction.nextCursorLineDistance=e,this}setNextCursorIsCrossFile(e){return this._nextCursorPrediction.isCrossFile=e,this}setXtabAggressivenessLevel(e){return this._xtabAggressivenessLevel=e,this}setXtabUserHappinessScore(e){return this._xtabUserHappinessScore=e,this}setUserAggressivenessSetting(e){return this._userAggressivenessSetting=e,this}setEditIntent(e){return this._editIntent=e,this}setEditIntentParseError(e){return this._editIntentParseError=e,this}setNDiffsInPrompt(e){return this._nDiffsInPrompt=e,this}setDiffTokensInPrompt(e){return this._diffTokensInPrompt=e,this}setNNeighborSnippetsComputed(e){return this._nNeighborSnippetsComputed=e,this}setNNeighborSnippetsInPrompt(e){return this._nNeighborSnippetsInPrompt=e,this}setNeighborSnippetIndicesInPrompt(e){return this._neighborSnippetIndicesInPrompt=JSON.stringify(e),this}setLintErrors(e){return this._lintErrors=e,this}setTerminalOutput(e){return this._terminalOutput=e,this}setSimilarFilesContext(e){return this._similarFilesContext=e,this}setModelConfig(e){return this._modelConfig=e,this}};km.StatelessNextEditTelemetryBuilder=KPr});var $4i=I(E_t=>{"use strict";p();Object.defineProperty(E_t,"__esModule",{value:!0});E_t.StreamCopilotAnnotations=void 0;var JPr=class{static{a(this,"StreamCopilotAnnotations")}constructor(){this.current={}}update(e){Object.entries(e).forEach(([r,n])=>{n.forEach(o=>this.update_namespace(r,o))})}update_namespace(e,r){this.current[e]||(this.current[e]=[]);let n=this.current[e],o=n.findIndex(s=>s.id===r.id);o>=0?n[o]=r:n.push(r)}for(e){return this.current[e]??[]}};E_t.StreamCopilotAnnotations=JPr});var __t=I(U$=>{"use strict";p();Object.defineProperty(U$,"__esModule",{value:!0});U$.ICompletionsFetchService=U$.CompletionsFetchError=U$.Completions=void 0;var Kuc=nn(),V4i;(function(t){class e{static{a(this,"RequestCancelled")}constructor(){this.kind="cancelled"}}t.RequestCancelled=e;class r{static{a(this,"UnsuccessfulResponse")}constructor(s,c,l,u){this.status=s,this.statusText=c,this.headers=l,this.text=u,this.kind="not-200-status"}}t.UnsuccessfulResponse=r;class n{static{a(this,"Unexpected")}constructor(s){this.error=s,this.kind="unexpected"}}t.Unexpected=n})(V4i||(U$.Completions=V4i={}));var ZPr=class extends Error{static{a(this,"CompletionsFetchError")}constructor(e,r,n){super(n),this.type=e,this.requestId=r}};U$.CompletionsFetchError=ZPr;U$.ICompletionsFetchService=(0,Kuc.createServiceIdentifier)("ICompletionsFetchService")});var xLe=I(iye=>{"use strict";p();Object.defineProperty(iye,"__esModule",{value:!0});iye.CacheType=iye.CustomDataPartMimeTypes=void 0;var W4i;(function(t){t.CacheControl="cache_control",t.StatefulMarker="stateful_marker",t.ThinkingData="thinking",t.ContextManagement="context_management",t.PhaseData="phase_data",t.Usage="usage"})(W4i||(iye.CustomDataPartMimeTypes=W4i={}));iye.CacheType="ephemeral"});var e2r=I(wLe=>{"use strict";p();Object.defineProperty(wLe,"__esModule",{value:!0});wLe.ThinkingDataContainer=void 0;wLe.rawPartAsThinkingData=Zuc;var Juc=Io(),z4i=xLe(),XPr=class extends Juc.PromptElement{static{a(this,"ThinkingDataContainer")}render(){let{thinking:e}=this.props,r={type:z4i.CustomDataPartMimeTypes.ThinkingData,thinking:e};return vscpp("opaque",{value:r,tokenUsage:e.tokens})}};wLe.ThinkingDataContainer=XPr;function Zuc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===z4i.CustomDataPartMimeTypes.ThinkingData&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(Zuc,"rawPartAsThinkingData")});var H6=I(WE=>{"use strict";p();Object.defineProperty(WE,"__esModule",{value:!0});WE.FilterReason=WE.FinishedCompletionReason=WE.ChatRole=WE.modelsWithoutResponsesContextManagement=WE.openAIContextManagementCompactionType=void 0;WE.isApiUsage=tdc;WE.nanoAiuToCredits=rdc;WE.getCAPITextPart=Z4i;WE.rawMessageToCAPI=X4i;var v_t=Io(),Xuc=lxe(),edc=e2r();function tdc(t){return typeof t.prompt_tokens=="number"&&typeof t.completion_tokens=="number"&&typeof t.total_tokens=="number"}a(tdc,"isApiUsage");function rdc(t){return typeof t=="number"&&t>=0?t/1e9:void 0}a(rdc,"nanoAiuToCredits");WE.openAIContextManagementCompactionType="compaction";WE.modelsWithoutResponsesContextManagement=new Set(["gpt-5","gpt-5.1","gpt-5.2"]);var Y4i;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(Y4i||(WE.ChatRole=Y4i={}));function Z4i(t){return Array.isArray(t)?t.map(e=>Z4i(e)).join(""):typeof t=="string"?t:typeof t=="object"&&"text"in t?t.text:""}a(Z4i,"getCAPITextPart");function X4i(t,e){if(Array.isArray(t))return t.map(n=>X4i(n,e));let r=(0,v_t.toMode)(v_t.OutputMode.OpenAI,t);if("copilot_references"in t&&(r.copilot_references=t.copilot_references),"copilot_confirmations"in t&&(r.copilot_confirmations=t.copilot_confirmations),typeof r.content=="string")r.content=r.content.trimEnd();else for(let n=0;nn.type===Xuc.ChatCompletionContentPartKind.CacheBreakpoint)&&(r.copilot_cache_control={type:"ephemeral"});for(let n of t.content)if(n.type===v_t.Raw.ChatCompletionContentPartKind.Opaque){let o=(0,edc.rawPartAsThinkingData)(n);e&&o&&e(r,o)}return r}a(X4i,"rawMessageToCAPI");var K4i;(function(t){t.Stop="stop",t.Length="length",t.FunctionCall="function_call",t.ToolCalls="tool_calls",t.ContentFilter="content_filter",t.ServerError="error",t.ClientTrimmed="client-trimmed",t.ClientIterationDone="Iteration Done",t.ClientDone="DONE"})(K4i||(WE.FinishedCompletionReason=K4i={}));var J4i;(function(t){t.Hate="hate",t.SelfHarm="self_harm",t.Sexual="sexual",t.Violence="violence",t.Copyright="snippy",t.Prompt="prompt"})(J4i||(WE.FilterReason=J4i={}))});var $6=I(G6=>{"use strict";p();Object.defineProperty(G6,"__esModule",{value:!0});G6.getRequestId=idc;G6.isCopilotAnnotation=odc;G6.isCodeCitationAnnotation=sdc;G6.isCopilotWebReference=adc;G6.isOpenAIContextManagementResponse=cdc;G6.isAnthropicContextManagementResponse=ldc;G6.isOpenAiFunctionTool=udc;var ndc=H6();function idc(t,e){let r=t.get("X-Copilot-Experiment")||"",n=t.get("x-copilot-api-exp-assignment-context")||"";return{headerRequestId:t.get("x-request-id")||"",gitHubRequestId:t.get("x-github-request-id")||"",completionId:e&&e.id?e.id:"",created:e&&e.created?e.created:0,serverExperiments:r&&n?`${r};${n}`:r||n,deploymentId:t.get("azureml-model-deployment")||""}}a(idc,"getRequestId");function odc(t){if(typeof t!="object"||t===null||!("details"in t))return!1;let{details:e}=t;return typeof e=="object"&&e!==null&&"type"in e&&"description"in e&&typeof e.type=="string"&&typeof e.description=="string"}a(odc,"isCopilotAnnotation");function sdc(t){if(typeof t!="object"||t===null||!("citations"in t))return!1;let{citations:e}=t;return typeof e=="object"&&e!==null&&"url"in e&&"license"in e&&typeof e.url=="string"&&typeof e.license=="string"}a(sdc,"isCodeCitationAnnotation");function adc(t){return typeof t=="object"&&!!t&&"title"in t&&"excerpt"in t&&"url"in t}a(adc,"isCopilotWebReference");function cdc(t){return"type"in t&&t.type===ndc.openAIContextManagementCompactionType}a(cdc,"isOpenAIContextManagementResponse");function ldc(t){return"applied_edits"in t}a(ldc,"isAnthropicContextManagementResponse");function udc(t){return t.function!==void 0}a(udc,"isOpenAiFunctionTool")});var eLi=I(eN=>{"use strict";p();Object.defineProperty(eN,"__esModule",{value:!0});eN.asyncIterableMap=ddc;eN.asyncIterableFilter=fdc;eN.asyncIterableMapFilter=pdc;eN.asyncIterableFromArray=hdc;eN.asyncIterableToArray=mdc;eN.asyncIterableConcat=gdc;eN.asyncIterableCount=Adc;eN.iterableMap=ydc;eN.iterableMapFilter=Edc;async function*ddc(t,e){for await(let r of t)yield e(r)}a(ddc,"asyncIterableMap");async function*fdc(t,e){for await(let r of t)await e(r)&&(yield r)}a(fdc,"asyncIterableFilter");async function*pdc(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(pdc,"asyncIterableMapFilter");async function*hdc(t){for(let e of t)yield Promise.resolve(e)}a(hdc,"asyncIterableFromArray");async function mdc(t){let e=[];for await(let r of t)e.push(r);return e}a(mdc,"asyncIterableToArray");async function*gdc(...t){for(let e of t)yield*e}a(gdc,"asyncIterableConcat");async function Adc(t){let e=0;for await(let r of t)e++;return e}a(Adc,"asyncIterableCount");function*ydc(t,e){for(let r of t)yield e(r)}a(ydc,"iterableMap");function*Edc(t,e){for(let r of t){let n=e(r);n!==void 0&&(yield n)}}a(Edc,"iterableMapFilter")});var tLi=I(t2r=>{"use strict";p();Object.defineProperty(t2r,"__esModule",{value:!0});t2r.getKey=vdc;function _dc(t,e){return t!==null&&typeof t=="object"&&e in t}a(_dc,"hasKey");function vdc(t,e){return _dc(t,e)?t[e]:void 0}a(vdc,"getKey")});var o2r=I(Pm=>{"use strict";p();var Cdc=Pm&&Pm.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Q$=Pm&&Pm.__param||function(t,e){return function(r,n){e(r,n,t)}},r2r;Object.defineProperty(Pm,"__esModule",{value:!0});Pm.LiveOpenAIFetcher=Pm.CMDQuotaExceeded=Pm.OpenAIFetcher=Pm.ICompletionsOpenAIFetcherService=Pm.CopilotUiKind=void 0;Pm.sanitizeRequestOptionTelemetry=aLi;Pm.postProcessChoices=cLi;var bdc=FE(),Sdc=$4i(),Tdc=U4(),kLe=__t(),Idc=$6(),rLi=gm(),xdc=nn(),wdc=rd(),Rdc=YP(),kdc=FO(),Pdc=T0(),Ddc=Gs(),Ndc=Uge(),Mdc=fgt(),nLi=LE(),Odc=eLi(),sLi=Dl(),Ldc=r_t(),iLi=KAe(),Bdc=A_t(),Fdc=qPr(),aI=$g(),Udc=y4e(),Qdc=rne(),RLe=tLi(),C_t=M4e(),tA=new sLi.Logger("fetchCompletions"),b_t;(function(t){t.GhostText="ghostText",t.Panel="synthesize"})(b_t||(Pm.CopilotUiKind=b_t={}));function qdc(t){let e=t.get("openai-processing-ms");return e?parseInt(e,10):0}a(qdc,"getProcessingTime");function jdc(t){switch(t){case b_t.GhostText:return"copilot-ghost";case b_t.Panel:return"copilot-panel"}}a(jdc,"uiKindToIntent");Pm.ICompletionsOpenAIFetcherService=(0,xdc.createServiceIdentifier)("ICompletionsOpenAIFetcherService");var S_t=class{static{a(this,"OpenAIFetcher")}};Pm.OpenAIFetcher=S_t;function Hdc(t,e,r,n){return(0,Ldc.getEndpointUrl)(t,e,"proxy","v1/engines",r,n)}a(Hdc,"getProxyEngineUrl");function aLi(t,e,r,n){for(let[o,s]of Object.entries(t)){if(r.includes(o))continue;let c=s;if(o==="extra"&&n){let l={...c};for(let u of n)delete l[u];c=l}e.properties[`request.option.${o}`]=JSON.stringify(c)??"undefined"}}a(aLi,"sanitizeRequestOptionTelemetry");function cLi(t){return(0,Odc.asyncIterableFilter)(t,e=>e.completionText.trim().length>0)}a(cLi,"postProcessChoices");Pm.CMDQuotaExceeded="github.copilot.completions.quotaExceeded";var n2r=r2r=class extends S_t{static{a(this,"LiveOpenAIFetcher")}#e;constructor(e,r,n,o,s,c,l,u){super(),this.instantiationService=e,this.runtimeModeService=r,this.logTargetService=n,this.copilotTokenManager=o,this.statusReporter=s,this.authenticationService=c,this.fetchService=l,this.envService=u}async fetchAndStreamCompletions(e,r,n,o){if(this.#e)return{type:"canceled",reason:this.#e};let s="completions",c=this.copilotTokenManager.token??await this.copilotTokenManager.getToken(),l={prompt:e.prompt.prefix,suffix:e.prompt.suffix,max_tokens:(0,C_t.getMaxSolutionTokens)(),temperature:(0,C_t.getTemperatureForSamples)(this.runtimeModeService,e.count),top_p:(0,C_t.getTopP)(),n:e.count,stop:(0,C_t.getStops)(e.languageId),stream:!0,extra:e.extra};{e.requestLogProbs&&(l.logprobs=2);let u=(0,Fdc.tryGetGitHubNWO)(e.repoInfo);if(u!==void 0&&(l.nwo=u),e.postOptions&&Object.assign(l,e.postOptions),e.prompt.context&&e.prompt.context.length>0&&(l.extra.context=e.prompt.context),await(0,Udc.delay)(0),o?.isCancellationRequested)return{type:"canceled",reason:"before fetch request"}}{let u=e.prompt,d=e.engineModelId,f=e.ourRequestId,h=r,m=e.uiKind,g=e.headers,A=this.instantiationService.invokeFunction(Hdc,c,d,s),y=h.extendedBy({endpoint:s,engineName:d,uiKind:m},(0,aI.telemetrizePromptLength)(u));aLi(l,y,["prompt","suffix"],["context"]),y.properties.headerRequestId=f,this.instantiationService.invokeFunction(aI.telemetry,"request.sent",y);let E=jdc(m),_;_={...g,...this.instantiationService.invokeFunction(nLi.editorVersionHeaders)},_["Openai-Organization"]="github-copilot",_["X-Request-Id"]=f,_["VScode-SessionId"]=this.envService.sessionId,_["VScode-MachineId"]=this.envService.machineId,_["X-GitHub-Api-Version"]=nLi.apiVersion,E&&(_["OpenAI-Intent"]=E);let v=new kdc.StopWatch,b=o??Rdc.CancellationToken.None,T=await this.fetchService.fetch(A,c.token,l,f,b,_).then(w=>w.isError()&&w.err instanceof kLe.Completions.Unexpected&&(0,iLi.isInterruptedNetworkError)(w.err.error)?(this.instantiationService.invokeFunction(aI.telemetry,"networking.disconnectAll"),this.fetchService.disconnectAll().then(()=>this.fetchService.fetch(A,c.token,l,f,b,_))):w);try{if(T.isError()){let x=T.err;if(x instanceof kLe.Completions.RequestCancelled)return this.instantiationService.invokeFunction(aI.telemetry,"networking.cancelRequest",aI.TelemetryData.createAndMarkAsIssued({headerRequestId:f})),this.instantiationService.invokeFunction(aI.telemetry,"request.cancel",y),{type:"canceled",reason:"during fetch request"};if(x instanceof kLe.Completions.UnsuccessfulResponse){let P=(0,Idc.getRequestId)(x.headers);y.extendWithRequestId(P),P.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(rLi.ITelemetryService).setSharedProperty("capi.assignmentcontext",P.serverExperiments));let D=v.elapsed();return y.measurements.totalTimeMs=D,y.properties.status=String(x.status),tA.info(this.logTargetService,`Request ${f} at <${A}> finished with ${x.status} status after ${D}ms`),tA.debug(this.logTargetService,"request.response properties",y.properties),tA.debug(this.logTargetService,"request.response measurements",y.measurements),tA.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(aI.telemetry,"request.response",y),this.handleError(this.statusReporter,y,{status:x.status,text:x.text,headers:x.headers},c)}else if(x instanceof kLe.Completions.Unexpected){let P=x.error;if((0,iLi.isAbortError)(P))throw this.instantiationService.invokeFunction(aI.telemetry,"request.cancel",y),P;this.statusReporter.setWarning((0,RLe.getKey)(P,"message")??"");let D=y.extendedBy({error:"Network exception"});this.instantiationService.invokeFunction(aI.telemetry,"request.shownWarning",D),y.properties.message=String((0,RLe.getKey)(P,"name")??""),y.properties.code=String((0,RLe.getKey)(P,"code")??""),y.properties.errno=String((0,RLe.getKey)(P,"errno")??""),y.properties.type=String((0,RLe.getKey)(P,"type")??"");let N=v.elapsed();throw y.measurements.totalTimeMs=N,tA.info(this.logTargetService,`Request ${f} at <${A}> rejected with ${String(P)} after ${N}ms`),tA.debug(this.logTargetService,"request.error properties",y.properties),tA.debug(this.logTargetService,"request.error measurements",y.measurements),this.instantiationService.invokeFunction(aI.telemetry,"request.error",y),P}else(0,wdc.assertNever)(x)}let w=T.val;{let x=w.requestId;y.extendWithRequestId(x),x.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(rLi.ITelemetryService).setSharedProperty("capi.assignmentcontext",x.serverExperiments));let P=v.elapsed();y.measurements.totalTimeMs=P;let D=200;tA.info(this.logTargetService,`Request ${f} at <${A}> finished with ${D} status after ${P}ms`),y.properties.status=String(D),tA.debug(this.logTargetService,"request.response properties",y.properties),tA.debug(this.logTargetService,"request.response measurements",y.measurements),tA.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(aI.telemetry,"request.response",y)}if(o?.isCancellationRequested){try{await w.destroy()}catch(x){this.instantiationService.invokeFunction(P=>tA.exception(P,x,"Error destroying stream"))}return{type:"canceled",reason:"after fetch request"}}let R=r2r.convertStreamToApiChoices(w,n,r,o);return{type:"success",choices:cLi(R),getProcessingTime:a(()=>qdc(w.headers),"getProcessingTime")}}finally{this.instantiationService.invokeFunction(aI.logEnginePrompt,u,y)}}}static async*convertStreamToApiChoices(e,r,n,o){let s=a((l,u,d,f,h)=>({choiceIndex:l,completionText:u,requestId:e.requestId,finishReason:d,tokens:f.chunks,numTokens:f.chunks.length,blockFinished:h,telemetryData:n,clientCompletionId:(0,Pdc.generateUuid)(),meanLogProb:void 0,meanAlternativeLogProb:void 0,copilotAnnotations:f.annotations.current}),"createAPIChoice"),c=[];try{for await(let l of e.stream){if(o?.isCancellationRequested)return;for(let u=0;u-1,y;if((m||A)&&(y=await r(f.accumulator.responseSoFar,{index:d,text:f.accumulator.responseSoFar,finished:m,requestId:e.requestId,telemetryData:n,annotations:f.accumulator.annotations,getAPIJsonData:a(()=>({text:f.accumulator.responseSoFar,tokens:f.accumulator.chunks,finish_reason:f.accumulator.finishReason??"stop",copilot_annotations:f.accumulator.annotations.current}),"getAPIJsonData")}),o?.isCancellationRequested))return;if(m&&(y===void 0||typeof y!="object"?y={yieldSolution:!0,continueStreaming:!1}:(y.yieldSolution=!0,y.continueStreaming=!1)),y!==void 0&&(typeof y=="number"||y.yieldSolution)){let E=m||typeof y=="number"||y!==void 0&&!y.continueStreaming;f.isFinished=E;let _=l.choices[u].finish_reason;_&&(f.accumulator.finishReason=_);let v=typeof y=="number"?y:y&&y.finishOffset!==void 0?y.finishOffset:void 0,b=v===void 0?f.accumulator.responseSoFar:f.accumulator.responseSoFar.slice(0,v);if(f.yielded||(f.yielded=!0,yield s(d,b,f.accumulator.finishReason??"stop",f.accumulator,v!==void 0)),o?.isCancellationRequested)return}}}for(let[l,u]of c.entries())if(!u.isFinished){if(await r(u.accumulator.responseSoFar,{index:l,text:u.accumulator.responseSoFar,finished:!0,requestId:e.requestId,telemetryData:n,annotations:u.accumulator.annotations,getAPIJsonData:a(()=>({text:u.accumulator.responseSoFar,tokens:u.accumulator.chunks,finish_reason:u.accumulator.finishReason??"stop",copilot_annotations:u.accumulator.annotations.current}),"getAPIJsonData")}),o?.isCancellationRequested)return;if(u.yielded)continue;if(u.yielded=!0,yield s(l,u.accumulator.responseSoFar,u.accumulator.finishReason??"stop",u.accumulator,!1),o?.isCancellationRequested)return}}finally{try{await e.destroy()}catch{}}}async handleError(e,r,n,o){let s=await n.text();if(n.status===402){this.#e="monthly free code completions exhausted",e.setError("Completions limit reached",{command:Pm.CMDQuotaExceeded,title:"Learn More"});let l=(0,Mdc.onCopilotToken)(this.authenticationService,u=>{this.#e=void 0,u.isCompletionsQuotaExceeded||(e.forceNormal(),l.dispose())});return{type:"failed",reason:this.#e}}if(n.status===466)return e.setError(s),tA.info(this.logTargetService,s),{type:"failed",reason:`client not supported: ${s}`};if(oLi(n)&&!n.headers.get("x-github-request-id")){let c=`Last response was a ${n.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;tA.error(this.logTargetService,c),e.setWarning(c),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else oLi(n)?(tA.warn(this.logTargetService,`Response status was ${n.status}:`,s),e.setWarning(`Last response was a ${n.status} error: ${s}`),r.properties.error=`Response status was ${n.status}: ${s}`):(e.setWarning(`Last response was a ${n.status} error`),r.properties.error=`Response status was ${n.status}`);return r.properties.status=String(n.status),this.instantiationService.invokeFunction(aI.telemetry,"request.shownWarning",r),n.status===401||n.status===403?(this.copilotTokenManager.resetToken(n.status),{type:"failed",reason:`token expired or invalid: ${n.status}`}):n.status===429?(setTimeout(()=>{this.#e=void 0},10*1e3),this.#e="rate limited",tA.warn(this.logTargetService,"Rate limited by server. Denying completions for the next 10 seconds."),{type:"failed",reason:this.#e}):n.status===499?(tA.info(this.logTargetService,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(tA.error(this.logTargetService,"Unhandled status from server:",n.status,s),{type:"failed",reason:`unhandled status from server: ${n.status} ${s}`})}};Pm.LiveOpenAIFetcher=n2r;Pm.LiveOpenAIFetcher=n2r=r2r=Cdc([Q$(0,Ddc.IInstantiationService),Q$(1,Qdc.ICompletionsRuntimeModeService),Q$(2,sLi.ICompletionsLogTargetService),Q$(3,Ndc.ICompletionsCopilotTokenManager),Q$(4,Bdc.ICompletionsStatusReporter),Q$(5,bdc.IAuthenticationService),Q$(6,kLe.ICompletionsFetchService),Q$(7,Tdc.IEnvService)],n2r);function oLi(t){return t.status>=400&&t.status<500}a(oLi,"isClientError");var i2r=class{static{a(this,"CompletionAccumulator")}constructor(){this._chunks=[],this._responseSoFar="",this._finishReason=null,this.annotations=new Sdc.StreamCopilotAnnotations}get responseSoFar(){return this._responseSoFar}get chunks(){return this._chunks}set finishReason(e){this._finishReason=e}get finishReason(){return this._finishReason}append(e){let r=e.text;r&&(this._chunks.push(r),this._responseSoFar=this._responseSoFar+r),e.copilot_annotations&&this.annotations.update(e.copilot_annotations)}}});var a2r=I(s2r=>{"use strict";p();Object.defineProperty(s2r,"__esModule",{value:!0});s2r.appendToCache=Gdc;function Gdc(t,e,r){t.append(e.prefix,e.prompt.suffix,r)}a(Gdc,"appendToCache")});var pLi=I(Kd=>{"use strict";p();var $dc=Kd&&Kd.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},wne=Kd&&Kd.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Kd,"__esModule",{value:!0});Kd.CompletionsFromNetwork=Kd.logger=void 0;Kd.postProcessChoices=T_t;Kd.makeGhostAPIChoice=fLi;Kd.telemetryPerformance=d2r;var PLe=nye(),Vdc=X_(),DLe=uw(),Wdc=rd(),zdc=qT(),Ydc=Gs(),lLi=LE(),Kdc=$Sr(),Jdc=fy(),dLi=Dl(),Zdc=sPr(),l2r=o2r(),Xdc=M4e(),efc=$g(),tfc=rne(),rfc=SAe(),c2r=a2r(),nfc=_4e(),uLi=a$(),tN=xAe();Kd.logger=new dLi.Logger("ghostText");var u2r=class{static{a(this,"CompletionsFromNetwork")}constructor(e,r,n,o,s,c,l){this.instantiationService=e,this.fetcherService=r,this.featuresService=n,this.runtimeMode=o,this.logTarget=s,this.completionsCacheService=c,this.userErrorNotifier=l}async getCompletionsFromNetwork(e,r,n,o,s){return this.genericGetCompletionsFromNetwork(e,r,n,o,s,"completions",async(c,l,u)=>{let f=await u[Symbol.asyncIterator]().next();if(f.done)return Kd.logger.debug(this.logTarget,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,tN.mkBasicResultTelemetry)(r)};if(n?.isCancellationRequested)return Kd.logger.debug(this.logTarget,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,tN.mkCanceledResultTelemetry)(r)};let h=f.value;if(h===void 0)return Kd.logger.debug(this.logTarget,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,tN.mkBasicResultTelemetry)(r)};this.instantiationService.invokeFunction(d2r,"performance",h,c,l),Kd.logger.debug(this.logTarget,`Awaited first result, id: ${h.choiceIndex}`);let m=T_t(h);m&&((0,c2r.appendToCache)(this.completionsCacheService,e,m),Kd.logger.debug(this.logTarget,`GhostText first completion (index ${m?.choiceIndex}): ${JSON.stringify(m?.completionText)}`));let g=(async()=>{let A=m!==void 0?[m]:[];for await(let y of u){if(y===void 0)continue;Kd.logger.debug(this.logTarget,`GhostText later completion (index ${y?.choiceIndex}): ${JSON.stringify(y.completionText)}`);let E=T_t(y,A);E&&(A.push(E),(0,c2r.appendToCache)(this.completionsCacheService,e,E))}})();return this.runtimeMode.isRunningInTest()&&await g,m?{type:"success",value:[fLi(m,{forceSingleLine:!1}),g],telemetryData:(0,tN.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:uLi.ResultType.Network}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:(0,tN.mkBasicResultTelemetry)(r)}})}async getAllCompletionsFromNetwork(e,r,n,o,s){return this.genericGetCompletionsFromNetwork(e,r,n,o,s,"all completions",async(c,l,u)=>{let d=[];for await(let f of u){if(n?.isCancellationRequested)return Kd.logger.debug(this.logTarget,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,tN.mkCanceledResultTelemetry)(r)};let h=T_t(f,d);h&&d.push(h)}if(d.length>0){for(let f of d)(0,c2r.appendToCache)(this.completionsCacheService,e,f);this.instantiationService.invokeFunction(d2r,"cyclingPerformance",d[0],c,l)}return{type:"success",value:[d,Promise.resolve()],telemetryData:(0,tN.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:uLi.ResultType.Cycling}})}async genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){let u=new PLe.StatelessNextEditTelemetryBuilder(e.ourRequestId),d=await this._genericGetCompletionsFromNetwork(e,r,n,o,u,c,l),f;switch(d.type){case"success":f=DLe.Result.ok(void 0);break;case"canceled":f=DLe.Result.error(new PLe.NoNextEditReason.GotCancelled(d.reason));break;case"empty":f=DLe.Result.error(new PLe.NoNextEditReason.NoSuggestions(new zdc.StringText(""),void 0));break;case"failed":f=DLe.Result.error(new PLe.NoNextEditReason.Uncategorized(Vdc.ErrorUtils.fromUnknown(d.reason)));break;case"abortedBeforeIssued":case"promptOnly":f=DLe.Result.error(new PLe.NoNextEditReason.GotCancelled(d.reason));break;default:(0,Wdc.assertNever)(d)}return s.setStatelessNextEditTelemetry(u.build(f)),d}async _genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){Kd.logger.debug(this.logTarget,`Getting ${c} from network`),r=r.extendedBy(),s.setModelName(e.engineModelId);let u=e.isCycling?3:1,d=(0,Xdc.getTemperatureForSamples)(this.runtimeMode,u),f={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:(0,lLi.shouldDoServerTrimming)(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},h={n:u,temperature:d,code_annotations:!1},m=this.featuresService.modelAlwaysTerminatesSingleline(r),g=e.blockMode===lLi.BlockMode.MoreMultiline&&rfc.BlockTrimmer.isSupported(e.languageId)&&!m;!e.multiline&&!g?h.stop=[` -`]:e.stop&&(h.stop=e.stop),e.maxTokens!==void 0&&(h.max_tokens=e.maxTokens);let A=Date.now(),y={endpoint:"completions",uiKind:l2r.CopilotUiKind.GhostText,temperature:JSON.stringify(d),n:JSON.stringify(u),stop:JSON.stringify(h.stop)??"unset",logit_bias:JSON.stringify(null)};Object.assign(r.properties,y);try{let E={prompt:e.prompt,languageId:e.languageId,repoInfo:e.repoInfo,ourRequestId:e.ourRequestId,engineModelId:e.engineModelId,count:u,uiKind:l2r.CopilotUiKind.GhostText,postOptions:h,headers:e.headers,extra:f},_=await this.fetcherService.fetchAndStreamCompletions(E,r,o,n);return _.type==="failed"?{type:"failed",reason:_.reason,telemetryData:(0,tN.mkBasicResultTelemetry)(r)}:_.type==="canceled"?(Kd.logger.debug(this.logTarget,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:_.reason,telemetryData:(0,tN.mkCanceledResultTelemetry)(r)}):l(A,_.getProcessingTime(),_.choices)}catch(E){if((0,Zdc.isAbortError)(E))return{type:"canceled",reason:"network request aborted",telemetryData:(0,tN.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(this.instantiationService.invokeFunction(_=>Kd.logger.exception(_,E,"Error on ghost text request")),this.userErrorNotifier.notifyUser(E),this.runtimeMode.shouldFailForDebugPurposes())throw E;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:(0,tN.mkBasicResultTelemetry)(r)}}}};Kd.CompletionsFromNetwork=u2r;Kd.CompletionsFromNetwork=u2r=$dc([wne(0,Ydc.IInstantiationService),wne(1,l2r.ICompletionsOpenAIFetcherService),wne(2,Jdc.ICompletionsFeaturesService),wne(3,tfc.ICompletionsRuntimeModeService),wne(4,dLi.ICompletionsLogTargetService),wne(5,nfc.ICompletionsCacheService),wne(6,Kdc.ICompletionsUserErrorNotifierService)],u2r);function T_t(t,e){if(e||(e=[]),t.completionText=t.completionText.trimEnd(),!!t.completionText&&e.findIndex(r=>r.completionText.trim()===t.completionText.trim())===-1)return t}a(T_t,"postProcessChoices");function fLi(t,e){let r={...t};if(e.forceSingleLine){let{completionText:n}=r,o=n.match(/^\r?\n/);o?r.completionText=o[0]+n.split(` +`)}};Om.StatelessNextEditDocument=H2r;var LBi;(function(t){t.LowLogProbSuggestions="lowLogProbSuggestions",t.EnforcingNextEditOptions="enforcingNextEditOptions",t.PromptTooLarge="promptTooLarge",t.Uncategorized="uncategorized"})(LBi||(Om.FilteredOutReason=LBi={}));var yL;(function(t){class e{static{a(this,"NoNextEditReason")}}class r extends e{static{a(this,"ActiveDocumentHasNoEdits")}constructor(){super(...arguments),this.kind="activeDocumentHasNoEdits"}toString(){return this.kind}}t.ActiveDocumentHasNoEdits=r;class n extends e{static{a(this,"NoSuggestions")}constructor(h,m,g,A){super(),this.documentBeforeEdits=h,this.window=m,this.nextCursorPosition=g,this.nextCursorDocumentId=A,this.kind="noSuggestions"}toString(){return this.kind}}t.NoSuggestions=n;class o extends e{static{a(this,"GotCancelled")}constructor(h){super(),this.message=h,this.kind="gotCancelled"}toString(){return`${this.kind}:${this.message}`}}t.GotCancelled=o;class s extends e{static{a(this,"FetchFailure")}constructor(h){super(),this.error=h,this.kind="fetchFailure"}toString(){return`${this.kind}:${this.error.message}`}}t.FetchFailure=s;class c extends e{static{a(this,"FilteredOut")}constructor(h){super(),this.message=h,this.kind="filteredOut"}toString(){return`${this.kind}:${this.message}`}}t.FilteredOut=c;class l extends e{static{a(this,"PromptTooLarge")}constructor(h){super(),this.message=h,this.kind="promptTooLarge"}toString(){return`${this.kind}:${this.message}`}}t.PromptTooLarge=l;class u extends e{static{a(this,"Uncategorized")}constructor(h){super(),this.error=h,this.kind="uncategorized"}toString(){return`${this.kind}:${this.error.message}`}}t.Uncategorized=u;class d extends e{static{a(this,"Unexpected")}constructor(h){super(),this.error=h,this.kind="unexpected"}toString(){return`${this.kind}:${this.error.message}`}}t.Unexpected=d})(yL||(Om.NoNextEditReason=yL={}));var G2r=class t{static{a(this,"StatelessNextEditResult")}static noEdit(e,r){let n=OBi.Result.error(e),o=r.build(n);return new t(n,o)}static streaming(e){let r=OBi.Result.ok(void 0),n=e.build(r);return new t(r,n)}constructor(e,r){this.nextEdit=e,this.telemetry=r}};Om.StatelessNextEditResult=G2r;var $2r=class{static{a(this,"StatelessNextEditTelemetryBuilder")}constructor(e){this._nextCursorPrediction={nextCursorLineError:void 0,nextCursorLineDistance:void 0,isCrossFile:void 0},this.startTime=Date.now(),this.requestUuid=e}build(e){let n=Date.now()-this.startTime,o=this._prompt?JSON.stringify(this._prompt.map(({role:f,content:h})=>({role:f,content:h}))):void 0,s=this._prompt?(0,_pc.stringifyChatMessages)(this._prompt):void 0,c=s?.split(` +`).length,l=s?.length,u=e.isOk()?void 0:e.err.kind,d;return e.isError()&&(e.err instanceof yL.ActiveDocumentHasNoEdits||e.err instanceof yL.NoSuggestions||(e.err instanceof yL.GotCancelled||e.err instanceof yL.FilteredOut||e.err instanceof yL.PromptTooLarge?d=e.err.message:e.err instanceof yL.FetchFailure||e.err instanceof yL.Uncategorized||e.err instanceof yL.Unexpected?d=e.err.error.stack?e.err.error.stack:e.err.error.message:(0,F2r.assertNever)(e.err))),{hadStatelessNextEditProviderCall:!0,noNextEditReasonKind:u,noNextEditReasonMessage:d,statelessNextEditProviderDuration:n,logProbThreshold:this._logProbThreshold,mergeConflictExpanded:this._mergeConflictExpanded,nLinesOfCurrentFileInPrompt:this._nLinesOfCurrentFileInPrompt,modelName:this._modelName,prompt:o,promptLineCount:c,promptCharCount:l,isCursorAtEndOfLine:this._isCursorAtLineEnd,isInlineSuggestion:this._isInlineSuggestion,debounceTime:this._debounceTime,artificialDelay:this._artificialDelay,fetchStartedAt:this._fetchStartedAt,hadLowLogProbSuggestion:this._hadLowLogProbSuggestion,response:this._response,nEditsSuggested:this._nEditsSuggested,nextEditLogprob:this._nextEditLogProb,nextCursorPrediction:this._nextCursorPrediction,lineDistanceToMostRecentEdit:this._lineDistanceToMostRecentEdit,xtabAggressivenessLevel:this._xtabAggressivenessLevel,xtabUserHappinessScore:this._xtabUserHappinessScore,userAggressivenessSetting:this._userAggressivenessSetting,editIntent:this._editIntent,editIntentParseError:this._editIntentParseError,cursorJumpModelName:this._cursorJumpModelName,cursorJumpPrompt:this._cursorJumpPrompt?JSON.stringify(this._cursorJumpPrompt.map(({role:f,content:h})=>({role:f,content:h}))):void 0,cursorJumpResponse:this._cursorJumpResponse,nDiffsInPrompt:this._nDiffsInPrompt,diffTokensInPrompt:this._diffTokensInPrompt,nNeighborSnippetsComputed:this._nNeighborSnippetsComputed,nNeighborSnippetsInPrompt:this._nNeighborSnippetsInPrompt,neighborSnippetIndicesInPrompt:this._neighborSnippetIndicesInPrompt,lintErrors:this._lintErrors,terminalOutput:this._terminalOutput,similarFilesContext:this._similarFilesContext,modelConfig:this._modelConfig}}setLogProbThreshold(e){return this._logProbThreshold=e,this}setMergeConflictExpanded(e){return this._mergeConflictExpanded=e,this}setHadLowLogProbSuggestion(e){return this._hadLowLogProbSuggestion=e,this}setNLinesOfCurrentFileInPrompt(e){return this._nLinesOfCurrentFileInPrompt=e,this}setModelName(e){return this._modelName=e,this}setPrompt(e){return this._prompt=e,this}setIsCursorAtLineEnd(e){return this._isCursorAtLineEnd=e,this}setIsInlineSuggestion(e){return this._isInlineSuggestion=e,this}setDebounceTime(e){return this._debounceTime=e,this}setArtificialDelay(e){return this._artificialDelay=e,this}setFetchStartedAt(){return this._fetchStartedAt=Date.now(),this}get fetchStartedAt(){return this._fetchStartedAt}setResponse(e){return this._response=e.then(({response:r,ttft:n})=>{let o=Date.now()-this._fetchStartedAt,s=r.type;return{ttft:n,response:r,fetchTime:o,fetchResult:s}}),this}setCursorJumpModelName(e){return this._cursorJumpModelName=e,this}setCursorJumpPrompt(e){return this._cursorJumpPrompt=e,this}setCursorJumpResponse(e){return this._cursorJumpResponse=e,this}setNextEditLogProb(e){return this._nextEditLogProb=e,this}setNEditsSuggested(e){return this._nEditsSuggested=e,this}setLineDistanceToMostRecentEdit(e){return this._lineDistanceToMostRecentEdit=e,this}setNextCursorLineError(e){return this._nextCursorPrediction.nextCursorLineError=e,this}setNextCursorLineDistance(e){return this._nextCursorPrediction.nextCursorLineDistance=e,this}setNextCursorIsCrossFile(e){return this._nextCursorPrediction.isCrossFile=e,this}setXtabAggressivenessLevel(e){return this._xtabAggressivenessLevel=e,this}setXtabUserHappinessScore(e){return this._xtabUserHappinessScore=e,this}setUserAggressivenessSetting(e){return this._userAggressivenessSetting=e,this}setEditIntent(e){return this._editIntent=e,this}setEditIntentParseError(e){return this._editIntentParseError=e,this}setNDiffsInPrompt(e){return this._nDiffsInPrompt=e,this}setDiffTokensInPrompt(e){return this._diffTokensInPrompt=e,this}setNNeighborSnippetsComputed(e){return this._nNeighborSnippetsComputed=e,this}setNNeighborSnippetsInPrompt(e){return this._nNeighborSnippetsInPrompt=e,this}setNeighborSnippetIndicesInPrompt(e){return this._neighborSnippetIndicesInPrompt=JSON.stringify(e),this}setLintErrors(e){return this._lintErrors=e,this}setTerminalOutput(e){return this._terminalOutput=e,this}setSimilarFilesContext(e){return this._similarFilesContext=e,this}setModelConfig(e){return this._modelConfig=e,this}};Om.StatelessNextEditTelemetryBuilder=$2r});var BBi=I($_t=>{"use strict";p();Object.defineProperty($_t,"__esModule",{value:!0});$_t.StreamCopilotAnnotations=void 0;var V2r=class{static{a(this,"StreamCopilotAnnotations")}constructor(){this.current={}}update(e){Object.entries(e).forEach(([r,n])=>{n.forEach(o=>this.update_namespace(r,o))})}update_namespace(e,r){this.current[e]||(this.current[e]=[]);let n=this.current[e],o=n.findIndex(s=>s.id===r.id);o>=0?n[o]=r:n.push(r)}for(e){return this.current[e]??[]}};$_t.StreamCopilotAnnotations=V2r});var V_t=I(J$=>{"use strict";p();Object.defineProperty(J$,"__esModule",{value:!0});J$.ICompletionsFetchService=J$.CompletionsFetchError=J$.Completions=void 0;var vpc=nn(),FBi;(function(t){class e{static{a(this,"RequestCancelled")}constructor(){this.kind="cancelled"}}t.RequestCancelled=e;class r{static{a(this,"UnsuccessfulResponse")}constructor(s,c,l,u){this.status=s,this.statusText=c,this.headers=l,this.text=u,this.kind="not-200-status"}}t.UnsuccessfulResponse=r;class n{static{a(this,"Unexpected")}constructor(s){this.error=s,this.kind="unexpected"}}t.Unexpected=n})(FBi||(J$.Completions=FBi={}));var W2r=class extends Error{static{a(this,"CompletionsFetchError")}constructor(e,r,n){super(n),this.type=e,this.requestId=r}};J$.CompletionsFetchError=W2r;J$.ICompletionsFetchService=(0,vpc.createServiceIdentifier)("ICompletionsFetchService")});var KLe=I(_ye=>{"use strict";p();Object.defineProperty(_ye,"__esModule",{value:!0});_ye.CacheType=_ye.CustomDataPartMimeTypes=void 0;var UBi;(function(t){t.CacheControl="cache_control",t.StatefulMarker="stateful_marker",t.ThinkingData="thinking",t.ContextManagement="context_management",t.PhaseData="phase_data",t.Usage="usage"})(UBi||(_ye.CustomDataPartMimeTypes=UBi={}));_ye.CacheType="ephemeral"});var Y2r=I(JLe=>{"use strict";p();Object.defineProperty(JLe,"__esModule",{value:!0});JLe.ThinkingDataContainer=void 0;JLe.rawPartAsThinkingData=bpc;var Cpc=Io(),QBi=KLe(),z2r=class extends Cpc.PromptElement{static{a(this,"ThinkingDataContainer")}render(){let{thinking:e}=this.props,r={type:QBi.CustomDataPartMimeTypes.ThinkingData,thinking:e};return vscpp("opaque",{value:r,tokenUsage:e.tokens})}};JLe.ThinkingDataContainer=z2r;function bpc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===QBi.CustomDataPartMimeTypes.ThinkingData&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(bpc,"rawPartAsThinkingData")});var r9=I(ZE=>{"use strict";p();Object.defineProperty(ZE,"__esModule",{value:!0});ZE.FilterReason=ZE.FinishedCompletionReason=ZE.ChatRole=ZE.modelsWithoutResponsesContextManagement=ZE.openAIContextManagementCompactionType=void 0;ZE.isApiUsage=Ipc;ZE.nanoAiuToCredits=xpc;ZE.getCAPITextPart=GBi;ZE.rawMessageToCAPI=$Bi;var W_t=Io(),Spc=Rxe(),Tpc=Y2r();function Ipc(t){return typeof t.prompt_tokens=="number"&&typeof t.completion_tokens=="number"&&typeof t.total_tokens=="number"}a(Ipc,"isApiUsage");function xpc(t){return typeof t=="number"&&t>=0?t/1e9:void 0}a(xpc,"nanoAiuToCredits");ZE.openAIContextManagementCompactionType="compaction";ZE.modelsWithoutResponsesContextManagement=new Set(["gpt-5","gpt-5.1","gpt-5.2"]);var qBi;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(qBi||(ZE.ChatRole=qBi={}));function GBi(t){return Array.isArray(t)?t.map(e=>GBi(e)).join(""):typeof t=="string"?t:typeof t=="object"&&"text"in t?t.text:""}a(GBi,"getCAPITextPart");function $Bi(t,e){if(Array.isArray(t))return t.map(n=>$Bi(n,e));let r=(0,W_t.toMode)(W_t.OutputMode.OpenAI,t);if("copilot_references"in t&&(r.copilot_references=t.copilot_references),"copilot_confirmations"in t&&(r.copilot_confirmations=t.copilot_confirmations),typeof r.content=="string")r.content=r.content.trimEnd();else for(let n=0;nn.type===Spc.ChatCompletionContentPartKind.CacheBreakpoint)&&(r.copilot_cache_control={type:"ephemeral"});for(let n of t.content)if(n.type===W_t.Raw.ChatCompletionContentPartKind.Opaque){let o=(0,Tpc.rawPartAsThinkingData)(n);e&&o&&e(r,o)}return r}a($Bi,"rawMessageToCAPI");var jBi;(function(t){t.Stop="stop",t.Length="length",t.FunctionCall="function_call",t.ToolCalls="tool_calls",t.ContentFilter="content_filter",t.ServerError="error",t.ClientTrimmed="client-trimmed",t.ClientIterationDone="Iteration Done",t.ClientDone="DONE"})(jBi||(ZE.FinishedCompletionReason=jBi={}));var HBi;(function(t){t.Hate="hate",t.SelfHarm="self_harm",t.Sexual="sexual",t.Violence="violence",t.Copyright="snippy",t.Prompt="prompt"})(HBi||(ZE.FilterReason=HBi={}))});var i9=I(n9=>{"use strict";p();Object.defineProperty(n9,"__esModule",{value:!0});n9.getRequestId=Rpc;n9.isCopilotAnnotation=kpc;n9.isCodeCitationAnnotation=Ppc;n9.isCopilotWebReference=Dpc;n9.isOpenAIContextManagementResponse=Npc;n9.isAnthropicContextManagementResponse=Mpc;n9.isOpenAiFunctionTool=Opc;var wpc=r9();function Rpc(t,e){let r=t.get("X-Copilot-Experiment")||"",n=t.get("x-copilot-api-exp-assignment-context")||"";return{headerRequestId:t.get("x-request-id")||"",gitHubRequestId:t.get("x-github-request-id")||"",completionId:e&&e.id?e.id:"",created:e&&e.created?e.created:0,serverExperiments:r&&n?`${r};${n}`:r||n,deploymentId:t.get("azureml-model-deployment")||""}}a(Rpc,"getRequestId");function kpc(t){if(typeof t!="object"||t===null||!("details"in t))return!1;let{details:e}=t;return typeof e=="object"&&e!==null&&"type"in e&&"description"in e&&typeof e.type=="string"&&typeof e.description=="string"}a(kpc,"isCopilotAnnotation");function Ppc(t){if(typeof t!="object"||t===null||!("citations"in t))return!1;let{citations:e}=t;return typeof e=="object"&&e!==null&&"url"in e&&"license"in e&&typeof e.url=="string"&&typeof e.license=="string"}a(Ppc,"isCodeCitationAnnotation");function Dpc(t){return typeof t=="object"&&!!t&&"title"in t&&"excerpt"in t&&"url"in t}a(Dpc,"isCopilotWebReference");function Npc(t){return"type"in t&&t.type===wpc.openAIContextManagementCompactionType}a(Npc,"isOpenAIContextManagementResponse");function Mpc(t){return"applied_edits"in t}a(Mpc,"isAnthropicContextManagementResponse");function Opc(t){return t.function!==void 0}a(Opc,"isOpenAiFunctionTool")});var VBi=I(cN=>{"use strict";p();Object.defineProperty(cN,"__esModule",{value:!0});cN.asyncIterableMap=Lpc;cN.asyncIterableFilter=Bpc;cN.asyncIterableMapFilter=Fpc;cN.asyncIterableFromArray=Upc;cN.asyncIterableToArray=Qpc;cN.asyncIterableConcat=qpc;cN.asyncIterableCount=jpc;cN.iterableMap=Hpc;cN.iterableMapFilter=Gpc;async function*Lpc(t,e){for await(let r of t)yield e(r)}a(Lpc,"asyncIterableMap");async function*Bpc(t,e){for await(let r of t)await e(r)&&(yield r)}a(Bpc,"asyncIterableFilter");async function*Fpc(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(Fpc,"asyncIterableMapFilter");async function*Upc(t){for(let e of t)yield Promise.resolve(e)}a(Upc,"asyncIterableFromArray");async function Qpc(t){let e=[];for await(let r of t)e.push(r);return e}a(Qpc,"asyncIterableToArray");async function*qpc(...t){for(let e of t)yield*e}a(qpc,"asyncIterableConcat");async function jpc(t){let e=0;for await(let r of t)e++;return e}a(jpc,"asyncIterableCount");function*Hpc(t,e){for(let r of t)yield e(r)}a(Hpc,"iterableMap");function*Gpc(t,e){for(let r of t){let n=e(r);n!==void 0&&(yield n)}}a(Gpc,"iterableMapFilter")});var WBi=I(K2r=>{"use strict";p();Object.defineProperty(K2r,"__esModule",{value:!0});K2r.getKey=Vpc;function $pc(t,e){return t!==null&&typeof t=="object"&&e in t}a($pc,"hasKey");function Vpc(t,e){return $pc(t,e)?t[e]:void 0}a(Vpc,"getKey")});var eDr=I(Lm=>{"use strict";p();var Wpc=Lm&&Lm.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Z$=Lm&&Lm.__param||function(t,e){return function(r,n){e(r,n,t)}},J2r;Object.defineProperty(Lm,"__esModule",{value:!0});Lm.LiveOpenAIFetcher=Lm.CMDQuotaExceeded=Lm.OpenAIFetcher=Lm.ICompletionsOpenAIFetcherService=Lm.CopilotUiKind=void 0;Lm.sanitizeRequestOptionTelemetry=XBi;Lm.postProcessChoices=e3i;var zpc=HE(),Ypc=BBi(),Kpc=H4(),XLe=V_t(),Jpc=i9(),zBi=vm(),Zpc=nn(),Xpc=sd(),ehc=n2(),thc=GO(),rhc=x0(),nhc=$s(),ihc=tAe(),ohc=Fgt(),YBi=qE(),shc=VBi(),ZBi=Dl(),ahc=w_t(),KBi=fye(),chc=H_t(),lhc=L2r(),pI=Yg(),uhc=q4e(),dhc=dne(),ZLe=WBi(),z_t=nLe(),oA=new ZBi.Logger("fetchCompletions"),Y_t;(function(t){t.GhostText="ghostText",t.Panel="synthesize"})(Y_t||(Lm.CopilotUiKind=Y_t={}));function fhc(t){let e=t.get("openai-processing-ms");return e?parseInt(e,10):0}a(fhc,"getProcessingTime");function phc(t){switch(t){case Y_t.GhostText:return"copilot-ghost";case Y_t.Panel:return"copilot-panel"}}a(phc,"uiKindToIntent");Lm.ICompletionsOpenAIFetcherService=(0,Zpc.createServiceIdentifier)("ICompletionsOpenAIFetcherService");var K_t=class{static{a(this,"OpenAIFetcher")}};Lm.OpenAIFetcher=K_t;function hhc(t,e,r,n){return(0,ahc.getEndpointUrl)(t,e,"proxy","v1/engines",r,n)}a(hhc,"getProxyEngineUrl");function XBi(t,e,r,n){for(let[o,s]of Object.entries(t)){if(r.includes(o))continue;let c=s;if(o==="extra"&&n){let l={...c};for(let u of n)delete l[u];c=l}e.properties[`request.option.${o}`]=JSON.stringify(c)??"undefined"}}a(XBi,"sanitizeRequestOptionTelemetry");function e3i(t){return(0,shc.asyncIterableFilter)(t,e=>e.completionText.trim().length>0)}a(e3i,"postProcessChoices");Lm.CMDQuotaExceeded="github.copilot.completions.quotaExceeded";var Z2r=J2r=class extends K_t{static{a(this,"LiveOpenAIFetcher")}#e;constructor(e,r,n,o,s,c,l,u){super(),this.instantiationService=e,this.runtimeModeService=r,this.logTargetService=n,this.copilotTokenManager=o,this.statusReporter=s,this.authenticationService=c,this.fetchService=l,this.envService=u}async fetchAndStreamCompletions(e,r,n,o){if(this.#e)return{type:"canceled",reason:this.#e};let s="completions",c=this.copilotTokenManager.token??await this.copilotTokenManager.getToken(),l={prompt:e.prompt.prefix,suffix:e.prompt.suffix,max_tokens:(0,z_t.getMaxSolutionTokens)(),temperature:(0,z_t.getTemperatureForSamples)(this.runtimeModeService,e.count),top_p:(0,z_t.getTopP)(),n:e.count,stop:(0,z_t.getStops)(e.languageId),stream:!0,extra:e.extra};{e.requestLogProbs&&(l.logprobs=2);let u=(0,lhc.tryGetGitHubNWO)(e.repoInfo);if(u!==void 0&&(l.nwo=u),e.postOptions&&Object.assign(l,e.postOptions),e.prompt.context&&e.prompt.context.length>0&&(l.extra.context=e.prompt.context),await(0,uhc.delay)(0),o?.isCancellationRequested)return{type:"canceled",reason:"before fetch request"}}{let u=e.prompt,d=e.engineModelId,f=e.ourRequestId,h=r,m=e.uiKind,g=e.headers,A=this.instantiationService.invokeFunction(hhc,c,d,s),y=h.extendedBy({endpoint:s,engineName:d,uiKind:m},(0,pI.telemetrizePromptLength)(u));XBi(l,y,["prompt","suffix"],["context"]),y.properties.headerRequestId=f,this.instantiationService.invokeFunction(pI.telemetry,"request.sent",y);let E=phc(m),_;_={...g,...this.instantiationService.invokeFunction(YBi.editorVersionHeaders)},_["Openai-Organization"]="github-copilot",_["X-Request-Id"]=f,_["VScode-SessionId"]=this.envService.sessionId,_["VScode-MachineId"]=this.envService.machineId,_["X-GitHub-Api-Version"]=YBi.apiVersion,E&&(_["OpenAI-Intent"]=E);let v=new thc.StopWatch,b=o??ehc.CancellationToken.None,T=await this.fetchService.fetch(A,c.token,l,f,b,_).then(w=>w.isError()&&w.err instanceof XLe.Completions.Unexpected&&(0,KBi.isInterruptedNetworkError)(w.err.error)?(this.instantiationService.invokeFunction(pI.telemetry,"networking.disconnectAll"),this.fetchService.disconnectAll().then(()=>this.fetchService.fetch(A,c.token,l,f,b,_))):w);try{if(T.isError()){let x=T.err;if(x instanceof XLe.Completions.RequestCancelled)return this.instantiationService.invokeFunction(pI.telemetry,"networking.cancelRequest",pI.TelemetryData.createAndMarkAsIssued({headerRequestId:f})),this.instantiationService.invokeFunction(pI.telemetry,"request.cancel",y),{type:"canceled",reason:"during fetch request"};if(x instanceof XLe.Completions.UnsuccessfulResponse){let P=(0,Jpc.getRequestId)(x.headers);y.extendWithRequestId(P),P.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(zBi.ITelemetryService).setSharedProperty("capi.assignmentcontext",P.serverExperiments));let D=v.elapsed();return y.measurements.totalTimeMs=D,y.properties.status=String(x.status),oA.info(this.logTargetService,`Request ${f} at <${A}> finished with ${x.status} status after ${D}ms`),oA.debug(this.logTargetService,"request.response properties",y.properties),oA.debug(this.logTargetService,"request.response measurements",y.measurements),oA.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(pI.telemetry,"request.response",y),this.handleError(this.statusReporter,y,{status:x.status,text:x.text,headers:x.headers},c)}else if(x instanceof XLe.Completions.Unexpected){let P=x.error;if((0,KBi.isAbortError)(P))throw this.instantiationService.invokeFunction(pI.telemetry,"request.cancel",y),P;this.statusReporter.setWarning((0,ZLe.getKey)(P,"message")??"");let D=y.extendedBy({error:"Network exception"});this.instantiationService.invokeFunction(pI.telemetry,"request.shownWarning",D),y.properties.message=String((0,ZLe.getKey)(P,"name")??""),y.properties.code=String((0,ZLe.getKey)(P,"code")??""),y.properties.errno=String((0,ZLe.getKey)(P,"errno")??""),y.properties.type=String((0,ZLe.getKey)(P,"type")??"");let N=v.elapsed();throw y.measurements.totalTimeMs=N,oA.info(this.logTargetService,`Request ${f} at <${A}> rejected with ${String(P)} after ${N}ms`),oA.debug(this.logTargetService,"request.error properties",y.properties),oA.debug(this.logTargetService,"request.error measurements",y.measurements),this.instantiationService.invokeFunction(pI.telemetry,"request.error",y),P}else(0,Xpc.assertNever)(x)}let w=T.val;{let x=w.requestId;y.extendWithRequestId(x),x.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(zBi.ITelemetryService).setSharedProperty("capi.assignmentcontext",x.serverExperiments));let P=v.elapsed();y.measurements.totalTimeMs=P;let D=200;oA.info(this.logTargetService,`Request ${f} at <${A}> finished with ${D} status after ${P}ms`),y.properties.status=String(D),oA.debug(this.logTargetService,"request.response properties",y.properties),oA.debug(this.logTargetService,"request.response measurements",y.measurements),oA.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(pI.telemetry,"request.response",y)}if(o?.isCancellationRequested){try{await w.destroy()}catch(x){this.instantiationService.invokeFunction(P=>oA.exception(P,x,"Error destroying stream"))}return{type:"canceled",reason:"after fetch request"}}let R=J2r.convertStreamToApiChoices(w,n,r,o);return{type:"success",choices:e3i(R),getProcessingTime:a(()=>fhc(w.headers),"getProcessingTime")}}finally{this.instantiationService.invokeFunction(pI.logEnginePrompt,u,y)}}}static async*convertStreamToApiChoices(e,r,n,o){let s=a((l,u,d,f,h)=>({choiceIndex:l,completionText:u,requestId:e.requestId,finishReason:d,tokens:f.chunks,numTokens:f.chunks.length,blockFinished:h,telemetryData:n,clientCompletionId:(0,rhc.generateUuid)(),meanLogProb:void 0,meanAlternativeLogProb:void 0,copilotAnnotations:f.annotations.current}),"createAPIChoice"),c=[];try{for await(let l of e.stream){if(o?.isCancellationRequested)return;for(let u=0;u-1,y;if((m||A)&&(y=await r(f.accumulator.responseSoFar,{index:d,text:f.accumulator.responseSoFar,finished:m,requestId:e.requestId,telemetryData:n,annotations:f.accumulator.annotations,getAPIJsonData:a(()=>({text:f.accumulator.responseSoFar,tokens:f.accumulator.chunks,finish_reason:f.accumulator.finishReason??"stop",copilot_annotations:f.accumulator.annotations.current}),"getAPIJsonData")}),o?.isCancellationRequested))return;if(m&&(y===void 0||typeof y!="object"?y={yieldSolution:!0,continueStreaming:!1}:(y.yieldSolution=!0,y.continueStreaming=!1)),y!==void 0&&(typeof y=="number"||y.yieldSolution)){let E=m||typeof y=="number"||y!==void 0&&!y.continueStreaming;f.isFinished=E;let _=l.choices[u].finish_reason;_&&(f.accumulator.finishReason=_);let v=typeof y=="number"?y:y&&y.finishOffset!==void 0?y.finishOffset:void 0,b=v===void 0?f.accumulator.responseSoFar:f.accumulator.responseSoFar.slice(0,v);if(f.yielded||(f.yielded=!0,yield s(d,b,f.accumulator.finishReason??"stop",f.accumulator,v!==void 0)),o?.isCancellationRequested)return}}}for(let[l,u]of c.entries())if(!u.isFinished){if(await r(u.accumulator.responseSoFar,{index:l,text:u.accumulator.responseSoFar,finished:!0,requestId:e.requestId,telemetryData:n,annotations:u.accumulator.annotations,getAPIJsonData:a(()=>({text:u.accumulator.responseSoFar,tokens:u.accumulator.chunks,finish_reason:u.accumulator.finishReason??"stop",copilot_annotations:u.accumulator.annotations.current}),"getAPIJsonData")}),o?.isCancellationRequested)return;if(u.yielded)continue;if(u.yielded=!0,yield s(l,u.accumulator.responseSoFar,u.accumulator.finishReason??"stop",u.accumulator,!1),o?.isCancellationRequested)return}}finally{try{await e.destroy()}catch{}}}async handleError(e,r,n,o){let s=await n.text();if(n.status===402){this.#e="monthly free code completions exhausted",e.setError("Completions limit reached",{command:Lm.CMDQuotaExceeded,title:"Learn More"});let l=(0,ohc.onCopilotToken)(this.authenticationService,u=>{this.#e=void 0,u.isCompletionsQuotaExceeded||(e.forceNormal(),l.dispose())});return{type:"failed",reason:this.#e}}if(n.status===466)return e.setError(s),oA.info(this.logTargetService,s),{type:"failed",reason:`client not supported: ${s}`};if(JBi(n)&&!n.headers.get("x-github-request-id")){let c=`Last response was a ${n.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;oA.error(this.logTargetService,c),e.setWarning(c),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else JBi(n)?(oA.warn(this.logTargetService,`Response status was ${n.status}:`,s),e.setWarning(`Last response was a ${n.status} error: ${s}`),r.properties.error=`Response status was ${n.status}: ${s}`):(e.setWarning(`Last response was a ${n.status} error`),r.properties.error=`Response status was ${n.status}`);return r.properties.status=String(n.status),this.instantiationService.invokeFunction(pI.telemetry,"request.shownWarning",r),n.status===401||n.status===403?(this.copilotTokenManager.resetToken(n.status),{type:"failed",reason:`token expired or invalid: ${n.status}`}):n.status===429?(setTimeout(()=>{this.#e=void 0},10*1e3),this.#e="rate limited",oA.warn(this.logTargetService,"Rate limited by server. Denying completions for the next 10 seconds."),{type:"failed",reason:this.#e}):n.status===499?(oA.info(this.logTargetService,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(oA.error(this.logTargetService,"Unhandled status from server:",n.status,s),{type:"failed",reason:`unhandled status from server: ${n.status} ${s}`})}};Lm.LiveOpenAIFetcher=Z2r;Lm.LiveOpenAIFetcher=Z2r=J2r=Wpc([Z$(0,nhc.IInstantiationService),Z$(1,dhc.ICompletionsRuntimeModeService),Z$(2,ZBi.ICompletionsLogTargetService),Z$(3,ihc.ICompletionsCopilotTokenManager),Z$(4,chc.ICompletionsStatusReporter),Z$(5,zpc.IAuthenticationService),Z$(6,XLe.ICompletionsFetchService),Z$(7,Kpc.IEnvService)],Z2r);function JBi(t){return t.status>=400&&t.status<500}a(JBi,"isClientError");var X2r=class{static{a(this,"CompletionAccumulator")}constructor(){this._chunks=[],this._responseSoFar="",this._finishReason=null,this.annotations=new Ypc.StreamCopilotAnnotations}get responseSoFar(){return this._responseSoFar}get chunks(){return this._chunks}set finishReason(e){this._finishReason=e}get finishReason(){return this._finishReason}append(e){let r=e.text;r&&(this._chunks.push(r),this._responseSoFar=this._responseSoFar+r),e.copilot_annotations&&this.annotations.update(e.copilot_annotations)}}});var rDr=I(tDr=>{"use strict";p();Object.defineProperty(tDr,"__esModule",{value:!0});tDr.appendToCache=mhc;function mhc(t,e,r){t.append(e.prefix,e.prompt.suffix,r)}a(mhc,"appendToCache")});var o3i=I(tf=>{"use strict";p();var ghc=tf&&tf.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Bne=tf&&tf.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(tf,"__esModule",{value:!0});tf.CompletionsFromNetwork=tf.logger=void 0;tf.postProcessChoices=J_t;tf.makeGhostAPIChoice=i3i;tf.telemetryPerformance=sDr;var eBe=Eye(),Ahc=nv(),tBe=yw(),yhc=sd(),Ehc=$T(),_hc=$s(),t3i=qE(),vhc=FTr(),Chc=gy(),n3i=Dl(),bhc=t2r(),iDr=eDr(),Shc=nLe(),Thc=Yg(),Ihc=dne(),xhc=QAe(),nDr=rDr(),whc=H4e(),r3i=_$(),lN=HAe();tf.logger=new n3i.Logger("ghostText");var oDr=class{static{a(this,"CompletionsFromNetwork")}constructor(e,r,n,o,s,c,l){this.instantiationService=e,this.fetcherService=r,this.featuresService=n,this.runtimeMode=o,this.logTarget=s,this.completionsCacheService=c,this.userErrorNotifier=l}async getCompletionsFromNetwork(e,r,n,o,s){return this.genericGetCompletionsFromNetwork(e,r,n,o,s,"completions",async(c,l,u)=>{let f=await u[Symbol.asyncIterator]().next();if(f.done)return tf.logger.debug(this.logTarget,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,lN.mkBasicResultTelemetry)(r)};if(n?.isCancellationRequested)return tf.logger.debug(this.logTarget,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,lN.mkCanceledResultTelemetry)(r)};let h=f.value;if(h===void 0)return tf.logger.debug(this.logTarget,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,lN.mkBasicResultTelemetry)(r)};this.instantiationService.invokeFunction(sDr,"performance",h,c,l),tf.logger.debug(this.logTarget,`Awaited first result, id: ${h.choiceIndex}`);let m=J_t(h);m&&((0,nDr.appendToCache)(this.completionsCacheService,e,m),tf.logger.debug(this.logTarget,`GhostText first completion (index ${m?.choiceIndex}): ${JSON.stringify(m?.completionText)}`));let g=(async()=>{let A=m!==void 0?[m]:[];for await(let y of u){if(y===void 0)continue;tf.logger.debug(this.logTarget,`GhostText later completion (index ${y?.choiceIndex}): ${JSON.stringify(y.completionText)}`);let E=J_t(y,A);E&&(A.push(E),(0,nDr.appendToCache)(this.completionsCacheService,e,E))}})();return this.runtimeMode.isRunningInTest()&&await g,m?{type:"success",value:[i3i(m,{forceSingleLine:!1}),g],telemetryData:(0,lN.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:r3i.ResultType.Network}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:(0,lN.mkBasicResultTelemetry)(r)}})}async getAllCompletionsFromNetwork(e,r,n,o,s){return this.genericGetCompletionsFromNetwork(e,r,n,o,s,"all completions",async(c,l,u)=>{let d=[];for await(let f of u){if(n?.isCancellationRequested)return tf.logger.debug(this.logTarget,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,lN.mkCanceledResultTelemetry)(r)};let h=J_t(f,d);h&&d.push(h)}if(d.length>0){for(let f of d)(0,nDr.appendToCache)(this.completionsCacheService,e,f);this.instantiationService.invokeFunction(sDr,"cyclingPerformance",d[0],c,l)}return{type:"success",value:[d,Promise.resolve()],telemetryData:(0,lN.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:r3i.ResultType.Cycling}})}async genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){let u=new eBe.StatelessNextEditTelemetryBuilder(e.ourRequestId),d=await this._genericGetCompletionsFromNetwork(e,r,n,o,u,c,l),f;switch(d.type){case"success":f=tBe.Result.ok(void 0);break;case"canceled":f=tBe.Result.error(new eBe.NoNextEditReason.GotCancelled(d.reason));break;case"empty":f=tBe.Result.error(new eBe.NoNextEditReason.NoSuggestions(new Ehc.StringText(""),void 0));break;case"failed":f=tBe.Result.error(new eBe.NoNextEditReason.Uncategorized(Ahc.ErrorUtils.fromUnknown(d.reason)));break;case"abortedBeforeIssued":case"promptOnly":f=tBe.Result.error(new eBe.NoNextEditReason.GotCancelled(d.reason));break;default:(0,yhc.assertNever)(d)}return s.setStatelessNextEditTelemetry(u.build(f)),d}async _genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){tf.logger.debug(this.logTarget,`Getting ${c} from network`),r=r.extendedBy(),s.setModelName(e.engineModelId);let u=e.isCycling?3:1,d=(0,Shc.getTemperatureForSamples)(this.runtimeMode,u),f={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:(0,t3i.shouldDoServerTrimming)(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},h={n:u,temperature:d,code_annotations:!1},m=this.featuresService.modelAlwaysTerminatesSingleline(r),g=e.blockMode===t3i.BlockMode.MoreMultiline&&xhc.BlockTrimmer.isSupported(e.languageId)&&!m;!e.multiline&&!g?h.stop=[` +`]:e.stop&&(h.stop=e.stop),e.maxTokens!==void 0&&(h.max_tokens=e.maxTokens);let A=Date.now(),y={endpoint:"completions",uiKind:iDr.CopilotUiKind.GhostText,temperature:JSON.stringify(d),n:JSON.stringify(u),stop:JSON.stringify(h.stop)??"unset",logit_bias:JSON.stringify(null)};Object.assign(r.properties,y);try{let E={prompt:e.prompt,languageId:e.languageId,repoInfo:e.repoInfo,ourRequestId:e.ourRequestId,engineModelId:e.engineModelId,count:u,uiKind:iDr.CopilotUiKind.GhostText,postOptions:h,headers:e.headers,extra:f},_=await this.fetcherService.fetchAndStreamCompletions(E,r,o,n);return _.type==="failed"?{type:"failed",reason:_.reason,telemetryData:(0,lN.mkBasicResultTelemetry)(r)}:_.type==="canceled"?(tf.logger.debug(this.logTarget,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:_.reason,telemetryData:(0,lN.mkCanceledResultTelemetry)(r)}):l(A,_.getProcessingTime(),_.choices)}catch(E){if((0,bhc.isAbortError)(E))return{type:"canceled",reason:"network request aborted",telemetryData:(0,lN.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(this.instantiationService.invokeFunction(_=>tf.logger.exception(_,E,"Error on ghost text request")),this.userErrorNotifier.notifyUser(E),this.runtimeMode.shouldFailForDebugPurposes())throw E;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:(0,lN.mkBasicResultTelemetry)(r)}}}};tf.CompletionsFromNetwork=oDr;tf.CompletionsFromNetwork=oDr=ghc([Bne(0,_hc.IInstantiationService),Bne(1,iDr.ICompletionsOpenAIFetcherService),Bne(2,Chc.ICompletionsFeaturesService),Bne(3,Ihc.ICompletionsRuntimeModeService),Bne(4,n3i.ICompletionsLogTargetService),Bne(5,whc.ICompletionsCacheService),Bne(6,vhc.ICompletionsUserErrorNotifierService)],oDr);function J_t(t,e){if(e||(e=[]),t.completionText=t.completionText.trimEnd(),!!t.completionText&&e.findIndex(r=>r.completionText.trim()===t.completionText.trim())===-1)return t}a(J_t,"postProcessChoices");function i3i(t,e){let r={...t};if(e.forceSingleLine){let{completionText:n}=r,o=n.match(/^\r?\n/);o?r.completionText=o[0]+n.split(` `)[1]:r.completionText=n.split(` -`)[0]}return r}a(fLi,"makeGhostAPIChoice");function d2r(t,e,r,n,o){let s=Date.now()-n,c=s-o,l=r.telemetryData.extendedBy({},{completionCharLen:r.completionText.length,requestTimeMs:s,processingTimeMs:o,deltaMs:c,meanLogProb:r.meanLogProb||NaN,meanAlternativeLogProb:r.meanAlternativeLogProb||NaN});l.extendWithRequestId(r.requestId),(0,efc.telemetry)(t,`ghostText.${e}`,l)}a(d2r,"telemetryPerformance")});var hLi=I(I_t=>{"use strict";p();Object.defineProperty(I_t,"__esModule",{value:!0});I_t.contextualFilterCharacterMap=void 0;I_t.contextualFilterCharacterMap={" ":1,"!":2,'"':3,"#":4,$:5,"%":6,"&":7,"'":8,"(":9,")":10,"*":11,"+":12,",":13,"-":14,".":15,"/":16,0:17,1:18,2:19,3:20,4:21,5:22,6:23,7:24,8:25,9:26,":":27,";":28,"<":29,"=":30,">":31,"?":32,"@":33,A:34,B:35,C:36,D:37,E:38,F:39,G:40,H:41,I:42,J:43,K:44,L:45,M:46,N:47,O:48,P:49,Q:50,R:51,S:52,T:53,U:54,V:55,W:56,X:57,Y:58,Z:59,"[":60,"\\":61,"]":62,"^":63,_:64,"`":65,a:66,b:67,c:68,d:69,e:70,f:71,g:72,h:73,i:74,j:75,k:76,l:77,m:78,n:79,o:80,p:81,q:82,r:83,s:84,t:85,u:86,v:87,w:88,x:89,y:90,z:91,"{":92,"|":93,"}":94,"~":95}});var mLi=I(f2r=>{"use strict";p();Object.defineProperty(f2r,"__esModule",{value:!0});f2r.multilineModelPredict=ifc;function ifc(t){let e;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>427.50000000000006?t[9]>13.500000000000002?t[121]>1e-35?e=-.3793786744885956:t[149]>1e-35?e=-.34717430705356905:e=-.26126834451035963:e=-.2431318366096852:t[5]>888.5000000000001?e=-.20600463586387135:e=-.2568037008471491:t[308]>1e-35?e=-.2363064824497454:t[8]>370.50000000000006?e=-.37470755210284723:e=-.321978453730494:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?e=-.26259136509758885:e=-.3096719634039438:t[4]>30.500000000000004?t[9]>18.500000000000004?e=-.34254903852890883:t[2]>98.50000000000001?e=-.41585250791146294:e=-.3673574858887241:t[9]>6.500000000000001?e=-.31688079287876225:t[31]>1e-35?e=-.29110977864003823:t[308]>1e-35?e=-.3201411739040839:e=-.36874023066055506:t[8]>691.5000000000001?t[82]>1e-35?e=-.41318393149040566:t[133]>1e-35?e=-.3741272613525161:t[32]>1e-35?e=-.4112378041027121:t[227]>1e-35?e=-.37726615155719356:t[10]>3.5000000000000004?e=-.3164502293560397:e=-.2930071546509045:t[9]>13.500000000000002?e=-.277366858539218:t[308]>1e-35?t[4]>10.500000000000002?e=-.30975610686807187:t[4]>1.5000000000000002?e=-.2549142136728043:e=-.3271325650785176:t[127]>1e-35?t[0]>1937.5000000000002?e=-.2533046188098832:e=-.325520883579:e=-.331628896481776;let r;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?t[9]>13.500000000000002?r=.031231253521808708:r=.05380836288014532:t[5]>423.00000000000006?t[8]>114.50000000000001?r=.06751619128429062:r=.09625089153176467:r=.027268163053989804:t[308]>1e-35?r=.060174483556283756:r=-.049062854038919135:t[3]>24.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?r=-.03969241799174589:r=.01086816842550381:t[31]>1e-35?r=-.003284694817583201:t[9]>6.500000000000001?t[4]>30.500000000000004?r=-.04224490699947552:r=-.011834162944360616:t[308]>1e-35?t[32]>1e-35?r=-.13448447971850278:r=-.019569456707046823:t[19]>1e-35?t[9]>1.5000000000000002?r=-.07256260662659254:t[4]>60.50000000000001?r=-.08227503453609311:r=-.020596416747563847:r=-.07396549241564149:t[8]>691.5000000000001?t[82]>1e-35?r=-.10046536995362734:t[133]>1e-35?r=-.06407649822752297:t[225]>1e-35?r=.08035785003303324:t[92]>1e-35?r=.018901360933204676:t[20]>1e-35?r=.05252546973665552:t[8]>2592.5000000000005?r=-.040543705016462955:r=-.011236043818320725:t[9]>17.500000000000004?r=.025560632674895334:t[308]>1e-35?t[0]>1847.5000000000002?r=.03527165701669741:r=-.0071847350825815035:t[127]>1e-35?r=.024373016379595405:t[9]>2.5000000000000004?r=-.0035090719709448288:r=-.03514829488063766;let n;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?n=.03848674861536988:t[5]>423.00000000000006?t[8]>114.50000000000001?t[9]>56.50000000000001?n=-.003764520033319488:n=.06570817919969299:t[4]>61.50000000000001?n=.028346156293069538:n=.0908154644362606:n=.02445594243234816:t[308]>1e-35?t[8]>65.50000000000001?n=.0019305229020073053:n=.09279357295883772:n=-.04458984161917124:t[3]>24.500000000000004?t[23]>1e-35?n=.0027405390271277013:t[4]>29.500000000000004?t[52]>1e-35?n=.044727478132905285:t[115]>1e-35?n=.10245804828855934:t[9]>17.500000000000004?n=-.03353173647469207:t[2]>98.50000000000001?n=-.10048106638102179:n=-.05484231104348874:t[31]>1e-35?n=.016807537467116516:t[9]>6.500000000000001?n=-.012113620535295137:t[4]>8.500000000000002?t[308]>1e-35?n=-.01882594250504289:n=-.05585658862796076:n=.04279591277938338:t[8]>691.5000000000001?t[82]>1e-35?n=-.09262278043707878:t[133]>1e-35?n=-.058454257768893625:t[32]>1e-35?n=-.09769348447126434:t[25]>1e-35?n=-.0725430043727677:t[122]>1e-35?n=-.10047841601578077:n=-.00580671054458958:t[9]>13.500000000000002?n=.021399199032818294:t[308]>1e-35?t[4]>10.500000000000002?n=-.0076376731757173515:n=.03394923033036848:t[127]>1e-35?n=.02070489091204209:n=-.02290162726126496;let o;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?o=.010230295672324606:o=.038540509248742805:t[8]>125.50000000000001?t[1]>49.50000000000001?o=.03086356292895467:o=.057128750867458604:t[5]>888.5000000000001?o=.07861602941396924:o=.030523262699070908:t[308]>1e-35?o=.048236117667577356:t[8]>370.50000000000006?o=-.05642125069212264:o=-.007232836777168195:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?o=.03640661467213915:o=-.005889820723907028:t[31]>1e-35?o=-.0009007166998276938:t[9]>6.500000000000001?o=-.022590340093882378:t[308]>1e-35?t[32]>1e-35?o=-.1215445089091064:o=-.01435612266219722:t[19]>1e-35?t[9]>1.5000000000000002?o=-.061555513040777825:t[4]>60.50000000000001?o=-.07053475504569347:o=-.013733369453963092:o=-.06302097189114152:t[227]>1e-35?o=-.05820440333190048:t[8]>683.5000000000001?t[82]>1e-35?o=-.08466979526809346:t[10]>24.500000000000004?o=-.017092159721119944:t[92]>1e-35?o=.03592901452463749:o=-.00359310519524756:t[5]>1809.5000000000002?t[243]>1e-35?o=-.03963116207386097:t[118]>1e-35?o=-.09483996283536394:t[217]>1e-35?o=-.03394542089519989:t[242]>1e-35?o=-.07985899422287938:o=.019706602160656964:t[9]>12.500000000000002?o=.014072998937735146:o=-.021156294523894684;let s;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?s=.009197756540516563:s=.03458896869535166:t[5]>5082.500000000001?s=.08265545468131008:t[131]>1e-35?s=.0740738432473315:s=.045159136632942756:t[8]>319.50000000000006?s=-.04653401534465376:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?s=-.011400839766681709:s=.11149800187510031:s=-.08683250977599462:s=.08355310136724753:t[4]>23.500000000000004?t[23]>1e-35?t[131]>1e-35?s=.040389083779932555:s=-.009887614274108602:t[52]>1e-35?s=.03705353499757327:t[9]>6.500000000000001?s=-.025401260429257562:t[2]>98.50000000000001?s=-.09237673187534504:s=-.04298556869281803:t[222]>1e-35?s=-.045221965895986184:t[8]>691.5000000000001?t[133]>1e-35?s=-.05435318330148897:t[128]>1e-35?s=-.08672907303184191:t[227]>1e-35?s=-.05568304584186561:t[122]>1e-35?s=-.09623059693538563:t[225]>1e-35?s=.07558331642202279:t[82]>1e-35?s=-.07360566227233566:s=-.005646164647395919:t[242]>1e-35?s=-.08203758341228108:t[9]>13.500000000000002?s=.018726123829696042:t[308]>1e-35?t[4]>10.500000000000002?s=-.011153942154062704:s=.03132858912391067:t[127]>1e-35?s=.021455228822345174:t[23]>1e-35?s=.01959966745346997:s=-.021764790177579325;let c;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>284.50000000000006?t[121]>1e-35?t[18]>1e-35?c=.07547602514276922:c=-.08529678832140396:c=.030314822344598043:t[5]>888.5000000000001?t[4]>61.50000000000001?c=.011143589009415464:c=.0654700456802118:c=.021794712646632755:t[308]>1e-35?c=.04231872551095028:c=-.034381999950549455:t[4]>23.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?c=-.03678981254332261:c=.010518160384496255:t[8]>825.5000000000001?c=-.04506534842082387:t[9]>38.50000000000001?c=.01004983052203438:c=-.030580958620701027:t[39]>1e-35?c=-.12802435021505382:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>6.500000000000001?c=.030426957004611704:c=-.0726407693060581:c=.017395521646964375:t[4]>7.500000000000001?t[0]>93.50000000000001?t[9]>7.500000000000001?c=-.008024349629981291:t[31]>1e-35?c=.01296539930850471:t[308]>1e-35?c=-.012855016509024084:c=-.04564527976851505:c=-.15681420504058596:t[10]>4.500000000000001?t[243]>1e-35?c=-.1012064426380198:c=-.0062808850924854194:c=.030706323726162416:t[9]>13.500000000000002?c=.017081636133736405:t[308]>1e-35?t[4]>10.500000000000002?c=-.009306613091760644:t[4]>1.5000000000000002?c=.03655523200850989:c=-.02671654212893341:t[127]>1e-35?c=.019261510468604387:c=-.017627818570628936;let l;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[308]>1e-35?l=.036100405995889276:l=.011709313297015793:t[0]>119.50000000000001?t[8]>125.50000000000001?l=.03622542297472574:l=.05595579157301536:l=-.02234751038146796:t[8]>319.50000000000006?l=-.040132029478400735:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?l=-.009306153573847916:l=.10058509567064988:l=-.0785668890966017:t[9]>28.500000000000004?l=-.04781977604130416:l=.09753292614937459:t[4]>23.500000000000004?t[131]>1e-35?l=.02372493254975127:t[148]>1e-35?l=.028103095989516644:t[4]>58.50000000000001?t[10]>1e-35?l=-.05000852203469597:l=.02922366846119705:t[23]>1e-35?l=-.0026335076988151292:l=-.03073993752935585:t[222]>1e-35?l=-.03867374428185713:t[32]>1e-35?l=-.07220729365053084:t[39]>1e-35?l=-.11624524614351733:t[8]>691.5000000000001?t[133]>1e-35?l=-.04836360271198036:t[8]>4968.500000000001?l=-.10873681915578029:t[149]>1e-35?l=-.11847484033769298:t[122]>1e-35?l=-.08916172460307559:t[82]>1e-35?l=-.06774726602152634:l=-.0033469147714351327:t[126]>1e-35?l=-.09474445392080015:t[8]>131.50000000000003?t[118]>1e-35?l=-.09002547031023511:l=.015475385187009489:t[25]>1e-35?l=-.08175501232759151:l=-.000429679055394914;let u;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?u=.021942996005324917:u=.042349138084484074:t[308]>1e-35?u=.036507270845732874:u=-.028981850556764995:t[3]>24.500000000000004?t[23]>1e-35?u=.00210930790963475:t[31]>1e-35?u=.006825358293027163:t[9]>6.500000000000001?u=-.013772084269062394:t[308]>1e-35?u=-.008307929099892574:t[19]>1e-35?u=-.027706313312904487:u=-.04891108984170914:t[134]>1e-35?u=-.0605730733844732:t[25]>1e-35?u=-.05347926493253117:t[227]>1e-35?u=-.049415829249003666:t[32]>1e-35?u=-.06807799662179595:t[308]>1e-35?t[4]>10.500000000000002?t[2]>13.500000000000002?u=-.00016302718260794637:u=-.10247095758122947:t[210]>1e-35?u=-.022149002072787024:t[95]>1e-35?u=.15222631630626304:u=.027393884520465712:t[9]>7.500000000000001?t[225]>1e-35?u=.13483346577752245:t[3]>9.500000000000002?t[243]>1e-35?u=-.045352728133789516:t[8]>683.5000000000001?u=.00474372227519902:u=.02635476098707525:t[92]>1e-35?u=.05659380819933452:t[105]>1e-35?u=.07431443210341222:t[186]>1e-35?u=.0915821133384904:u=-.016414750130401053:t[127]>1e-35?u=.011824693641866162:t[23]>1e-35?u=.0228468674288774:t[284]>1e-35?u=.06606936863302432:u=-.02872463273902358;let d;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>125.50000000000001?t[288]>1e-35?d=-.019844363904157558:t[1]>50.50000000000001?t[131]>1e-35?d=.044961338592245194:d=.003659599513761676:t[121]>1e-35?d=-.04057103630479994:d=.03158560697078578:t[0]>421.50000000000006?t[4]>61.50000000000001?d=-.0003708603406529278:d=.05331312264472391:d=.0006575958601218936:t[8]>319.50000000000006?d=-.034654694051901545:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?d=-.0076053515916517005:d=.09116695486305336:d=-.07137458699162028:d=.06633130654035282:t[4]>29.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?d=-.0308520802187302:d=.013156423968295541:t[115]>1e-35?d=.11581171687488252:t[52]>1e-35?t[10]>22.500000000000004?d=.12264179915175587:d=-.021905727233873535:t[8]>799.5000000000001?d=-.04181869575935412:d=-.023695901673350575:t[222]>1e-35?d=-.034612899265371776:t[8]>691.5000000000001?t[9]>98.50000000000001?d=-.06892116536821917:t[149]>1e-35?d=-.11194586444154514:t[133]>1e-35?d=-.04269583234000504:t[128]>1e-35?d=-.0644631966969502:t[8]>4968.500000000001?d=-.09650726096330133:d=-.004219129180139438:t[126]>1e-35?d=-.08038306745347751:t[5]>1809.5000000000002?d=.009265335288169993:t[9]>2.5000000000000004?d=.006447645462117438:d=-.021047132609551503;let f;t[13]>1e-35?t[3]>1.5000000000000002?t[9]>21.500000000000004?t[121]>1e-35?f=-.08436540015142402:t[8]>1861.5000000000002?f=-.01621425699342421:f=.01878613821895428:f=.031052879158242532:t[8]>319.50000000000006?f=-.031536619360997865:t[7]>3.5000000000000004?f=-.004510586962343298:f=.0596524941011746:t[4]>18.500000000000004?t[23]>1e-35?f=.004757490541310808:t[9]>6.500000000000001?f=-.008842393772207996:t[31]>1e-35?f=.0010536183837006993:t[308]>1e-35?f=-.008145882815435419:t[2]>98.50000000000001?f=-.08404937622173021:t[276]>1e-35?f=.0020072791321856663:t[19]>1e-35?f=-.023031820639490178:f=-.04553314326377875:t[8]>2134.5000000000005?f=-.02244583113572251:t[134]>1e-35?f=-.05592137394753121:t[308]>1e-35?t[49]>1e-35?f=.09989109704064947:t[4]>10.500000000000002?t[2]>13.500000000000002?f=-.00447733056482096:f=-.10191061664873849:f=.021765308380331864:t[9]>7.500000000000001?t[118]>1e-35?f=-.07570059131536411:t[243]>1e-35?f=-.040983393346598646:t[3]>9.500000000000002?f=.014763759061483812:t[92]>1e-35?f=.05136368898963024:f=-.008162398981149495:t[127]>1e-35?f=.013999119696708346:t[23]>1e-35?t[20]>1e-35?f=.14138985500120907:f=.008668274102844162:t[284]>1e-35?f=.06356484011042893:f=-.024781304572706303;let h;t[13]>1e-35?t[3]>8.500000000000002?t[8]>892.5000000000001?t[0]>384.50000000000006?h=.014387526569215037:t[8]>2266.5000000000005?h=-.1397298649743087:h=.007953931014097788:t[0]>119.50000000000001?t[4]>61.50000000000001?h=.0029819092211896296:t[218]>1e-35?h=.08450459375645737:h=.031646488019280654:h=-.03544960151460596:t[9]>9.500000000000002?h=-.026002317735915183:t[7]>1.5000000000000002?h=.005074258810794793:h=.0745247650477651:t[4]>29.500000000000004?t[131]>1e-35?h=.023269218675640847:t[148]>1e-35?h=.03812942399144545:t[115]>1e-35?h=.10512283476967227:h=-.02607307479736138:t[227]>1e-35?h=-.036576708299046294:t[101]>1e-35?h=.027948683650881864:t[149]>1e-35?h=-.08195628451594297:t[50]>1e-35?h=-.16997544922278504:t[8]>691.5000000000001?t[9]>101.50000000000001?h=-.06860333850762075:t[225]>1e-35?h=.06066641950951723:t[10]>22.500000000000004?t[1]>29.500000000000004?t[127]>1e-35?h=.028599705845427533:h=-.010746719511640914:t[0]>4877.500000000001?h=-.07251187886096228:h=-.021299712241446785:t[118]>1e-35?h=-.11902023760964736:h=15874469526809387e-21:t[8]>267.50000000000006?h=.01317292185402293:t[148]>1e-35?t[9]>20.500000000000004?h=.09614842415142123:h=.006049073167176467:t[189]>1e-35?h=.05562696451900713:h=-.006257541923837303;let m;t[13]>1e-35?t[9]>14.500000000000002?t[2]>11.500000000000002?t[1]>71.50000000000001?t[8]>1252.5000000000002?m=-.10069846585436666:m=-.010577995535809317:t[146]>1e-35?m=-.008877238274428668:t[280]>1e-35?m=.10076055897012692:t[6]>70.50000000000001?m=-.020603523042565547:t[7]>1.5000000000000002?m=.02819095420813202:m=-.1223354167911277:m=-.025073583348334844:t[8]>416.50000000000006?m=.01718560189149466:t[230]>1e-35?m=.12281803224342265:m=.03281276971308565:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?m=-.13070568109867683:t[4]>63.50000000000001?m=-.027221825262496814:m=.01530862490082352:t[9]>6.500000000000001?t[5]>4320.500000000001?t[2]>31.500000000000004?m=-.00605574271293711:m=.04739407327741249:m=-.012537528620315956:t[31]>1e-35?t[20]>1e-35?m=.1252215087035768:m=.003905888677601057:t[52]>1e-35?m=.045466299731038815:t[2]>100.50000000000001?m=-.07815624550168065:t[308]>1e-35?m=-.007715815250508057:t[276]>1e-35?t[9]>1.5000000000000002?m=-.03538265083203445:t[18]>1e-35?m=.1591211669800727:m=.015151475408241136:t[8]>557.5000000000001?m=-.04225569725456342:m=-.022455546324243267:t[308]>1e-35?m=.01325441736085826:t[197]>1e-35?m=.03752194600682512:t[225]>1e-35?m=.06583712394533976:m=-.005205289866839043;let g;t[13]>1e-35?t[9]>21.500000000000004?t[2]>12.500000000000002?g=.010264022580774884:g=-.02335958814489217:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?g=-.0936747137352166:t[0]>384.50000000000006?g=.019846244507320695:g=-.0751102554077272:g=-.026885329334203723:t[0]>966.5000000000001?t[10]>48.50000000000001?g=.11654906890054273:g=.0346250587613322:t[4]>39.50000000000001?g=-.08568002378645614:t[9]>16.500000000000004?g=-.12010535752923689:g=.021321923389033808:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?g=-.12056431231412057:t[131]>1e-35?g=.03652965550568472:g=.002563006128791669:t[9]>6.500000000000001?t[30]>1e-35?g=-.10141481732178981:g=-.003936457893178248:t[31]>1e-35?g=.008215898756249477:t[52]>1e-35?t[0]>4188.500000000001?g=.12972828769588213:g=-.003137412232297087:t[2]>100.50000000000001?g=-.0730872929087944:t[308]>1e-35?g=-.006958622747243333:t[35]>1e-35?t[0]>3707.5000000000005?g=.07934620723812878:g=-.018598568353702116:g=-.030635505446410763:t[128]>1e-35?g=-.06962290453843294:t[84]>1e-35?g=-.15290337844960322:t[308]>1e-35?t[8]>2543.5000000000005?g=-.034938657503885584:g=.016339322898966915:t[197]>1e-35?g=.03358907965870046:t[18]>1e-35?g=-.01754013791515288:g=-.0004944586067698557;let A;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?A=.005888790687820524:A=.0429676533834978:t[2]>7.500000000000001?t[0]>119.50000000000001?t[6]>79.50000000000001?A=-.0224319889201976:t[212]>1e-35?A=.06249587051783863:t[8]>963.5000000000001?t[8]>1156.5000000000002?A=.010357273289123324:A=-.029749145161304082:t[218]>1e-35?A=.06449336340743606:A=.018047654539345502:A=-.07350502390293116:A=-.019594829995832414:t[4]>39.50000000000001?A=-.019338083179859314:t[39]>1e-35?A=-.10427066919173111:t[222]>1e-35?t[0]>612.5000000000001?A=-.019197415255018464:A=-.0836562507048181:t[149]>1e-35?A=-.07679624472577429:t[32]>1e-35?A=-.05097506748590604:t[191]>1e-35?A=.04670476485250936:t[30]>1e-35?A=-.05313073892148652:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>8.500000000000002?A=.03930363008271334:A=-.06029171685615689:A=.016203086182431294:t[4]>7.500000000000001?A=-.013824248237085224:t[10]>4.500000000000001?t[94]>1e-35?A=-.09817668643367765:t[10]>40.50000000000001?A=-.023558078753593125:A=.0065113494780482326:t[8]>809.5000000000001?t[297]>1e-35?A=-.1352063548573715:A=.058203900441270634:A=-.035243959159285736:t[10]>59.50000000000001?t[1]>43.50000000000001?A=-.012552876807800442:A=.05991247777734298:A=.0035893102109330177;let y;t[13]>1e-35?t[9]>21.500000000000004?t[145]>1e-35?y=.03507251990078782:t[2]>14.500000000000002?y=.004905698363309292:t[8]>2421.5000000000005?y=-.10306119951984316:y=-.018951037816654928:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?y=-.08503171085833393:y=.015130974593044409:y=-.024425267075198206:y=.02624054905103126:t[4]>19.500000000000004?t[131]>1e-35?y=.02100191580704534:t[32]>1e-35?t[8]>2302.5000000000005?y=.09908783187786288:y=-.06920877329925636:t[8]>241.50000000000003?y=-.016756131804203496:t[9]>33.50000000000001?y=.04903179955263626:t[217]>1e-35?y=-.047416847619291644:y=-.0017200891991431119:t[39]>1e-35?y=-.10389927604977028:t[134]>1e-35?y=-.050480365434872866:t[178]>1e-35?y=-.05167855791556937:t[8]>2134.5000000000005?y=-.01663197335585307:t[242]>1e-35?y=-.05361323756615453:t[118]>1e-35?y=-.05299780866211368:t[10]>24.500000000000004?t[10]>55.50000000000001?t[8]>764.5000000000001?y=-.0016544848369620534:y=.04494144460483587:y=-.009283616456736156:t[121]>1e-35?t[0]>4463.500000000001?y=.051166688553608355:y=-.06623908820705383:t[84]>1e-35?y=-.12990936092409747:t[306]>1e-35?y=-.07020596855118943:t[49]>1e-35?y=.06272964802556856:t[192]>1e-35?y=.06540204627162581:y=.008277910531592885;let E;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?E=.003325460510319164:E=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?E=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?E=.0697359767152808:t[230]>1e-35?E=.06513506845651572:E=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?E=.013616385013146277:E=.04171540100223404:E=-.04360396575094823:t[212]>1e-35?E=.025945477945627522:E=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?E=-.07856453318384411:E=-.014803893522351739:t[39]>1e-35?E=-.09185452630751932:t[149]>1e-35?E=-.07122426086157027:t[134]>1e-35?E=-.04231052091434186:t[227]>1e-35?E=-.029815824273994197:t[50]>1e-35?E=-.15736496271211153:t[222]>1e-35?E=-.02360285356956629:t[128]>1e-35?E=-.03922080193836443:t[136]>1e-35?E=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?E=-.0029736170756835783:E=-.06482902102259112:t[84]>1e-35?E=-.11340924635708383:t[94]>1e-35?E=-.03635703457792193:t[118]>1e-35?E=-.058181913914186034:t[126]>1e-35?E=-.062030576241517366:t[116]>1e-35?E=-.045086301850604006:t[25]>1e-35?E=-.031665223656767286:t[203]>1e-35?E=-.009444685731407691:E=.0112265153772187;let _;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?_=.022717227245241684:_=-.049700413274686266:_=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?_=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?_=-.12263724050601095:_=.0070743478891288035:t[288]>1e-35?_=-.050439138582109:_=.0255701593657891:_=-.005812703740580558:t[6]>49.50000000000001?_=-.008542694147899113:_=.035147383686665:_=-.0960461939274094:t[32]>1e-35?_=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?_=-.01800870272656664:_=-.07817304234604389:t[30]>1e-35?_=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?_=.08778416018479411:_=-.026563982720830256:_=-.05296139548112329:t[50]>1e-35?_=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?_=-.036572140520852024:t[183]>1e-35?_=-.10766853736801459:_=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?_=.09513215942486053:_=-.03641865277445567:t[10]>59.50000000000001?_=.03177172388687933:t[39]>1e-35?_=-.10234241303898953:t[243]>1e-35?_=-.02966738115984321:t[190]>1e-35?_=-.04312785336449181:t[118]>1e-35?_=-.05808521194081524:_=.006720381600740378;let v;t[308]>1e-35?t[5]>423.00000000000006?t[133]>1e-35?v=-.046284053681928526:t[210]>1e-35?v=49778070699847876e-21:t[13]>1e-35?v=.03328070054739309:t[128]>1e-35?v=-.054790214922938896:t[126]>1e-35?v=-.08524792218532945:v=.014414055975542446:t[1]>38.50000000000001?v=-.07287851335872973:v=.005263371501687163:t[9]>7.500000000000001?t[21]>1e-35?t[10]>4.500000000000001?v=-.12459748864088374:v=-.004626323021331593:t[298]>1e-35?t[4]>64.50000000000001?v=.13044981041138526:t[9]>71.50000000000001?v=-.056068402282406865:t[9]>12.500000000000002?v=.038957722962512764:v=-.04598815982492169:t[8]>691.5000000000001?t[126]>1e-35?v=-.0852126122372075:t[225]>1e-35?v=.10082066771689505:t[1]>161.50000000000003?v=-.11609832500613824:t[3]>8.500000000000002?t[8]>1685.5000000000002?v=-.010835400874777133:v=.004607419973807752:v=-.016989075258564062:v=.009205417251698097:t[23]>1e-35?t[20]>1e-35?v=.10184317139657878:t[0]>5724.500000000001?v=-.1163666496650542:t[1]>106.50000000000001?v=.1303850608190687:t[129]>1e-35?v=.10745031509534769:v=.006166901738036226:t[31]>1e-35?v=.010177092833155127:t[13]>1e-35?t[0]>213.50000000000003?v=.005004582564506611:v=-.10481581731668346:t[19]>1e-35?v=-.009850706427306281:v=-.02608226348051303;let b;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?b=-.0024117174588695603:b=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?b=.04575380761203418:b=-.10025595041353463:t[15]>1e-35?b=.17705790384964004:b=.0073813837628615014:b=.07676373681392407:b=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?b=.07078572910026419:t[4]>23.500000000000004?b=.005513918674164821:b=.0206586476926392:t[0]>5269.500000000001?b=.07706773525822633:b=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?b=-.03204783603215824:b=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?b=-.0930246911392012:b=.011173087289703683:t[3]>24.500000000000004?b=.03281421918878597:b=.12449335091369843:t[204]>1e-35?b=.06634531187326123:b=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?b=-.041196758517013515:t[4]>7.500000000000001?b=-2942718111029724e-20:t[4]>6.500000000000001?b=.11953909558532852:b=.03188615019450534:t[122]>1e-35?b=-.0616037324662157:t[101]>1e-35?b=.027230889593349412:t[8]>4968.500000000001?b=-.1113986516540856:t[3]>2.5000000000000004?b=-.002045140426885727:t[129]>1e-35?b=.12641163374304432:b=.014909826232873194;let T;t[308]>1e-35?t[0]>7277.500000000001?T=-.09337446795435:t[5]>423.00000000000006?t[133]>1e-35?T=-.040884836258675006:t[210]>1e-35?T=-.0003719413278428804:t[13]>1e-35?T=.030287610160818174:T=.011174130013595384:t[1]>38.50000000000001?T=-.0662442170185784:T=.004332185707008564:t[9]>7.500000000000001?t[145]>1e-35?t[285]>1e-35?T=-.08092286307197555:T=.029866363328584986:t[21]>1e-35?t[10]>4.500000000000001?T=-.1155211149523894:T=-.0032903546638958538:t[149]>1e-35?T=-.03632198993199768:t[3]>9.500000000000002?t[8]>999.5000000000001?T=-.003507023626534306:t[128]>1e-35?t[4]>13.500000000000002?t[0]>3459.5000000000005?T=-.025416927789760076:T=.02777568919793122:T=-.10310351509769732:T=.013549608903688785:t[186]>1e-35?T=.08513865847420551:T=-.009306721292510369:t[31]>1e-35?T=.009780833952582307:t[23]>1e-35?T=.011143773934157629:t[210]>1e-35?T=.025354797285173356:t[17]>1e-35?t[10]>3.5000000000000004?T=-.04846287537743046:T=-.014647271080376757:t[2]>5.500000000000001?t[7]>57.50000000000001?T=-.034224938681445764:t[8]>1641.5000000000002?T=-.027298372075800673:t[191]>1e-35?t[10]>18.500000000000004?T=-.027950103994861836:T=.14575930827829034:T=-.007124740389354946:t[10]>22.500000000000004?T=.013173304107866726:T=-.11119620042551365;let w;t[131]>1e-35?w=.01892225243240137:t[308]>1e-35?t[5]>691.5000000000001?t[133]>1e-35?w=-.037118314390013646:t[1]>51.50000000000001?t[5]>3749.5000000000005?t[8]>58.50000000000001?w=-.022305242912035072:w=.024792895826340516:w=.013666137278072166:t[88]>1e-35?t[10]>27.500000000000004?w=.2080083584805785:w=.04247197078083379:t[10]>40.50000000000001?t[18]>1e-35?t[1]>27.500000000000004?w=.060783227455868206:w=-.056904865557409035:w=-.03278952553107572:t[192]>1e-35?w=.13117402617043625:w=.01647119888257836:w=-.01825870445636398:t[9]>6.500000000000001?t[298]>1e-35?w=.026536210945939682:t[8]>691.5000000000001?t[126]>1e-35?w=-.07927319604548912:t[10]>3.5000000000000004?t[21]>1e-35?w=-.11083976837572328:t[146]>1e-35?w=-.03359294484446772:w=-.0042815953591236475:t[190]>1e-35?w=-.09264239592903775:t[10]>1e-35?w=.022282638485105657:w=-.0205994057928458:t[5]>4918.500000000001?w=.03430715695199153:t[243]>1e-35?t[2]>57.50000000000001?w=.08935072241972036:w=-.03781647876237494:w=.0062655753179671515:t[31]>1e-35?w=.008603500300349887:t[230]>1e-35?w=.03350056932774173:t[23]>1e-35?t[241]>1e-35?w=.10277555508503314:w=.0017901817172993888:t[2]>98.50000000000001?w=-.05920081229672715:w=-.015722173275739208;let R;t[13]>1e-35?t[118]>1e-35?R=.07957905150112207:t[1]>125.50000000000001?R=-.0662620579858685:t[145]>1e-35?R=.029682040828779843:t[19]>1e-35?t[6]>15.500000000000002?R=-.0009597832580977798:R=-.081474760755753:t[212]>1e-35?R=.03637001492325179:R=.006912305498963309:t[32]>1e-35?R=-.03919900630910754:t[134]>1e-35?R=-.036225295529777886:t[4]>4.500000000000001?t[5]>384.50000000000006?t[204]>1e-35?R=.06671440854602108:t[136]>1e-35?R=-.07577364230133474:t[148]>1e-35?t[4]>7.500000000000001?R=.026430947016830915:R=-.04075501264495112:t[9]>93.50000000000001?R=-.04353169430417609:t[50]>1e-35?R=-.1411224537622882:t[17]>1e-35?t[49]>1e-35?R=.068392679163672:t[10]>1.5000000000000002?R=-.0209659792007492:R=-.0004393235559249831:t[133]>1e-35?t[9]>64.50000000000001?R=.07254524592323175:R=-.0319087835282534:R=.00037444813327793425:R=-.025138768151370408:t[243]>1e-35?R=-.050010891710502096:t[94]>1e-35?R=-.0817513550778599:t[122]>1e-35?R=-.061038875809822285:t[19]>1e-35?t[8]>1085.5000000000002?R=-.008408408775061623:t[2]>5.500000000000001?t[218]>1e-35?R=.1454877641381946:R=.053787998331240316:t[9]>33.50000000000001?R=.08602629796680285:R=-.03895127455803038:R=.008830878042315722;let x;t[131]>1e-35?x=.01687979707990516:t[8]>2915.5000000000005?t[297]>1e-35?x=.07473600489975568:t[0]>93.50000000000001?x=-.021596848506011502:x=-.13840802327735696:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?x=.10264284346448256:x=.031042487183181262:x=-.016653982936827776:t[4]>60.50000000000001?t[10]>75.50000000000001?x=.04226403420647408:t[10]>1e-35?t[0]>4733.500000000001?x=.006271403149804702:x=-.030013637555715046:t[0]>4449.500000000001?x=-.06556876058654929:x=.06437994816903034:t[32]>1e-35?x=-.043814577251655815:t[308]>1e-35?t[0]>7277.500000000001?x=-.09349726304052086:t[210]>1e-35?x=-.0035960132209098003:t[5]>691.5000000000001?t[133]>1e-35?x=-.029188394315052574:x=.017219308333820193:x=-.017378928852189585:t[9]>6.500000000000001?t[0]>2653.5000000000005?t[149]>1e-35?x=-.04428555753857688:x=.0001456106867817353:t[5]>213.50000000000003?x=.01740292726636365:x=-.011361718115556464:t[7]>4.500000000000001?t[0]>316.50000000000006?t[19]>1e-35?t[10]>54.50000000000001?x=.03410288911259329:t[121]>1e-35?x=-.06056527462120627:t[8]>2592.5000000000005?x=.12166808844363577:t[191]>1e-35?x=.11669879218998758:x=-.001664858391716235:x=-.01262927450503166:x=-.04506589951879664:t[227]>1e-35?x=-.08548904959752329:x=.02156080776537726;let P;t[306]>1e-35?t[149]>1e-35?P=-.1389218965136736:P=-.032218642644416894:t[13]>1e-35?P=.006465035217331847:t[50]>1e-35?P=-.1381687930130022:t[179]>1e-35?P=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?P=-.03262719498763048:P=.023342916702125613:t[191]>1e-35?P=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?P=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?P=-.09989343595668776:P=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?P=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?P=-.09165257825246746:t[9]>32.50000000000001?P=.02484870392366004:P=-.008499493096971395:t[8]>24.500000000000004?P=.02459679192828244:P=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?P=.0015644546318714849:P=-.06579524865022705:P=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?P=.03331853632960164:P=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?P=-.019091477207111116:P=.037878468575478504:t[94]>1e-35?P=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?P=.16919658785098224:t[243]>1e-35?P=-.06580584936754524:P=.01567555159935563:t[129]>1e-35?P=.06721746994993226:t[10]>32.50000000000001?P=-.046394462507797975:P=-.006436180519584767;let D;t[131]>1e-35?D=.015039096856208693:t[8]>779.5000000000001?t[145]>1e-35?D=.019122095523977856:t[298]>1e-35?D=.023828936462317443:t[1]>23.500000000000004?t[5]>384.50000000000006?t[7]>59.50000000000001?D=-.026094309429557913:t[204]>1e-35?D=.09163404305658318:t[1]>27.500000000000004?t[149]>1e-35?t[6]>34.50000000000001?D=.012643810980689466:D=-.07884161741497837:D=-.0025267379810891104:t[2]>43.50000000000001?t[0]>2860.5000000000005?D=.04493082949897325:D=.18046359750455776:t[7]>18.500000000000004?D=-.018667348656891496:D=.02584325784698236:D=-.045696524897545915:t[0]>3321.5000000000005?t[201]>1e-35?D=.04749240016989375:D=-.0333334578246718:t[5]>3276.5000000000005?D=.11330554740098908:t[7]>94.50000000000001?D=.1296600395033268:D=-.003576436308940934:t[15]>1e-35?t[183]>1e-35?D=-.13787130789142835:t[0]>1847.5000000000002?D=.017915229729920556:t[10]>23.500000000000004?t[10]>31.500000000000004?t[6]>7.500000000000001?D=.028856848462727104:D=-.11197632885851168:D=.08169801342016791:t[1]>22.500000000000004?D=-.021052888644970163:D=.019048604298876753:t[7]>4.500000000000001?D=-.002603328695276418:t[7]>1.5000000000000002?t[2]>5.500000000000001?D=.03432638833359197:D=-.0036767863082454973:t[1]>48.50000000000001?D=.03087375270128195:t[2]>3.5000000000000004?D=-.04219917149740248:D=.018818493993207935;let N;t[306]>1e-35?N=-.04076858123502297:t[13]>1e-35?t[1]>67.50000000000001?t[9]>14.500000000000002?t[9]>53.50000000000001?t[8]>1971.5000000000002?N=-.09091897542577475:N=.04042943082645558:t[218]>1e-35?N=.056254985867151:N=-.053848117950183044:N=.003881630017086845:t[5]>5152.500000000001?t[8]>857.5000000000001?t[6]>28.500000000000004?N=.021581808008986944:N=-.05639286496176611:N=.052838875036198954:t[5]>50.50000000000001?t[5]>4082.5000000000005?t[17]>1e-35?N=.023061479860228728:t[145]>1e-35?t[9]>10.500000000000002?N=.023885302967553288:N=.1617794086125622:t[212]>1e-35?N=.04504545345658806:t[3]>17.500000000000004?t[4]>45.50000000000001?N=-.03948072448245435:t[1]>47.50000000000001?t[9]>18.500000000000004?N=.01894935813286188:N=-.06449356357429188:N=.012297239104320094:t[1]>26.500000000000004?t[8]>33.50000000000001?N=-.034718828212885515:N=.0898976288814321:t[1]>17.500000000000004?N=-.15440137451988326:N=-.03864183216821465:N=.009988507307006308:N=-.08540311947043305:t[50]>1e-35?N=-.13323659732101975:t[134]>1e-35?N=-.031820386486894385:t[32]>1e-35?t[8]>2302.5000000000005?N=.08082476177379844:N=-.041665761903645876:t[179]>1e-35?N=-.12405023987936657:t[39]>1e-35?N=-.06247416524997478:t[138]>1e-35?N=-.10724031753676487:N=-.0005423122305122404;let L;t[308]>1e-35?L=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?L=.023223358334607133:L=-.04383410185346742:L=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?L=.023406489302867494:L=-.085521220804058:L=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?L=.028120059780969632:L=-.04211009474298743:t[294]>1e-35?L=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?L=-.0993035220737934:L=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?L=.029770210551187937:L=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?L=.06421359317599738:L=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?L=.024368404612215164:L=-.04045232374803373:t[131]>1e-35?L=.017372701982485795:t[120]>1e-35?L=.08812710275150198:t[18]>1e-35?t[90]>1e-35?L=.18451364351180236:t[7]>33.50000000000001?L=-.03850813130183531:t[195]>1e-35?L=.06966114053446336:t[3]>16.500000000000004?L=-.0012869181693341211:t[0]>4242.500000000001?L=-.054625548611291035:L=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?L=.006302103427145562:L=.13967622319898698:t[121]>1e-35?L=-.038798585213145644:t[5]>4544.500000000001?L=-.08050498033009466:L=-.002986974112681435;let B;t[0]>384.50000000000006?t[2]>101.50000000000001?t[1]>16.500000000000004?B=-.03461119351456781:B=.05659026566680352:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?B=-.12404435523286539:B=-.0034376913880382956:B=-.09821622245095822:t[131]>1e-35?t[9]>1.5000000000000002?B=.0037507103585310234:B=.03610387965829944:t[8]>999.5000000000001?t[9]>137.50000000000003?B=-.11985021663179699:t[0]>1847.5000000000002?t[126]>1e-35?B=-.04832024079663151:t[37]>1e-35?B=-.037103393468366934:B=-.004248086592531705:t[8]>3084.0000000000005?t[9]>43.50000000000001?B=.032539071163832034:t[5]>1643.5000000000002?B=.036408625378035665:t[0]>1500.5000000000002?B=-.1346358322854993:B=-.027586559522081014:t[3]>1e-35?t[190]>1e-35?B=-.1133991164577881:t[9]>52.50000000000001?B=-.024478640359723122:B=.03673777861098756:B=-.1037451237591819:t[230]>1e-35?t[9]>48.50000000000001?t[10]>20.500000000000004?B=.002583438691776944:B=.10773520810108106:t[9]>12.500000000000002?t[1]>16.500000000000004?B=-.02141222346712401:B=.06392462314316179:t[4]>12.500000000000002?B=.08700122294434816:t[8]>267.50000000000006?B=.056923170082743224:B=-.07716309825583327:t[32]>1e-35?B=-.03961343943752142:B=.002674914122888783:t[1]>42.50000000000001?B=-.05217539654421676:t[145]>1e-35?B=.09553630282946368:B=-.009424791262477729;let q;t[183]>1e-35?q=-.05753337139158443:t[308]>1e-35?q=.00562436671450989:t[9]>7.500000000000001?t[21]>1e-35?t[10]>8.500000000000002?q=-.10477869875380448:q=-.0070301869937306055:t[3]>9.500000000000002?t[8]>1765.5000000000002?t[0]>4571.500000000001?q=-.12526505173232894:t[10]>1e-35?t[9]>71.50000000000001?q=-.04442302951713574:q=.00012409888451734224:q=-.092199119633697:t[225]>1e-35?q=.13773072450201831:t[0]>2882.5000000000005?q=.0028540012229920533:t[298]>1e-35?q=.07134486044361629:q=.014297412329837425:t[145]>1e-35?q=.05608385321902638:t[92]>1e-35?q=.038298413603926135:t[107]>1e-35?t[2]>6.500000000000001?q=-.0039957800609801315:q=.0776927564241081:t[203]>1e-35?q=-.05502900859432093:t[105]>1e-35?q=.06062892720841595:q=-.009574839629252128:t[31]>1e-35?q=.009488858841144216:t[23]>1e-35?t[20]>1e-35?q=.08818126313644752:t[8]>161.50000000000003?q=.014353968957885408:q=-.022240738532827903:t[210]>1e-35?q=.024648862719806694:t[2]>5.500000000000001?t[4]>4.500000000000001?t[17]>1e-35?t[10]>16.500000000000004?q=-.043902062079383485:q=-.014741559220396223:q=-.00934935734853194:t[6]>32.50000000000001?q=.1514593126307404:q=.010771222510801532:t[10]>22.500000000000004?q=.01412495209334078:q=-.08576940379502533;let M;t[0]>384.50000000000006?t[84]>1e-35?M=-.06647690967306838:t[2]>101.50000000000001?M=-.024451334501552457:t[306]>1e-35?M=-.034517188927733505:t[131]>1e-35?t[9]>1.5000000000000002?M=.0031858381443673127:M=.032574927024450646:t[204]>1e-35?t[1]>62.50000000000001?M=-.08601340441214533:t[1]>29.500000000000004?M=.10487598629539963:t[8]>597.5000000000001?M=-.0786529133673238:M=.08689436600511559:t[8]>779.5000000000001?t[10]>2.5000000000000004?t[9]>100.50000000000001?M=-.04883600353740688:t[126]>1e-35?M=-.03794042763348827:M=-.003358871967539988:t[210]>1e-35?M=.054991356498447566:t[6]>19.500000000000004?M=-.007418396981635549:M=.018032606049498613:t[18]>1e-35?t[7]>35.50000000000001?t[2]>44.50000000000001?M=-.02143003429501711:M=-.09016000554055564:t[1]>19.500000000000004?t[1]>42.50000000000001?t[8]>17.500000000000004?M=-.006636355416244082:M=-.06483095743431454:t[4]>21.500000000000004?M=-.028975965946833545:M=.022012264796522657:M=-.06653648243193663:t[5]>4593.500000000001?M=.01753551428088607:t[217]>1e-35?M=-.028864824937700297:t[94]>1e-35?M=-.04885192273020658:t[279]>1e-35?M=.08105715462329498:t[121]>1e-35?M=-.04576676034750651:M=.004795141324949362:t[1]>42.50000000000001?M=-.047446619702809195:t[145]>1e-35?M=.08400495571952321:M=-.00854528836489364;let O;t[294]>1e-35?O=-.042529778074638265:t[266]>1e-35?O=-.1180276669679798:t[134]>1e-35?O=-.026818144353279623:t[183]>1e-35?O=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?O=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?O=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?O=-.03049646619610203:t[1]>50.50000000000001?O=.20634590755061122:O=.06956378103625731:t[0]>3770.5000000000005?O=-.07946414366134913:t[19]>1e-35?O=.17083312065604694:t[2]>21.500000000000004?O=-.02327981978127724:O=.129717297518715:t[145]>1e-35?O=.006891245076133524:O=-.0789123467863741:t[3]>99.50000000000001?O=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?O=.06447639919732716:O=-.05457561977645972:t[306]>1e-35?O=-.029995903305383882:t[191]>1e-35?O=.030596508110850414:t[242]>1e-35?O=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?O=.09518584795377832:O=-.018197744600833596:t[13]>1e-35?O=.006751790086127549:t[148]>1e-35?O=.01904174573618417:t[99]>1e-35?O=.025287735102561926:t[4]>14.500000000000002?O=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?O=-.09467943982430241:t[243]>1e-35?O=-.02521824751996268:O=.005437570718352172:O=-.022476214821960674;let j;t[0]>384.50000000000006?t[84]>1e-35?j=-.06088131453064195:t[147]>1e-35?j=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?j=.04219361472548491:j=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?j=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?j=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?j=-.11431764534511478:j=.013549717238356157:j=-.020987333767091276:t[6]>2.5000000000000004?j=-.02914877855133127:j=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?j=-.10087072787978416:t[37]>1e-35?j=-.030467397753331196:t[229]>1e-35?j=-.1017559811057469:t[4]>20.500000000000004?j=-.00413177742240167:t[20]>1e-35?j=.05213315982685969:j=.0037921635866823133:t[8]>51.50000000000001?j=.07327913092421544:t[6]>49.50000000000001?j=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?j=.02744420891894289:j=.11288946357194463:j=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?j=-.012329314369909049:j=.026816658655600168:j=-.0872405354618811:j=.007872673500247845:t[1]>42.50000000000001?j=-.04309044198258254:t[145]>1e-35?j=.07572529147860785:t[7]>5.500000000000001?j=-.013837187093264945:t[1]>17.500000000000004?j=.04208698439539668:j=-.06284346769019863;let Q;t[294]>1e-35?Q=-.0384794324818203:t[266]>1e-35?Q=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?Q=.07432960094940501:Q=-.035248735855751855:t[134]>1e-35?Q=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?Q=-.01706896375068821:Q=.08212247914968074:t[2]>59.50000000000001?Q=-.09546478958824225:t[6]>53.50000000000001?Q=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?Q=.02816463285971267:Q=.15449139016588445:Q=-.10199787406123524:Q=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?Q=-.13924786681478077:Q=-.0072772442570213335:t[39]>1e-35?Q=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?Q=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?Q=-.11174465335620831:Q=.00013144040097180107:Q=-.08493919336681105:t[42]>1e-35?Q=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?Q=-.015540659878839153:Q=-.14442609417300142:t[21]>1e-35?Q=-.025251979447574083:Q=.0023698372645272847:t[18]>1e-35?Q=.07269739695712212:t[8]>2592.5000000000005?Q=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?Q=-.01835130329646532:t[9]>45.50000000000001?Q=.02023047454629885:Q=.16469378262221102:Q=-.042975030085836426;let U;t[8]>2915.5000000000005?t[297]>1e-35?U=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?U=-.01034964686484714:U=-.07357437440667927:U=-.11987794734779106:t[298]>1e-35?t[8]>81.50000000000001?t[0]>3370.5000000000005?t[8]>155.50000000000003?t[8]>660.5000000000001?t[8]>2134.5000000000005?U=-.09476398869062203:t[9]>72.50000000000001?U=-.0757383854264379:U=.02806542779508718:U=-.05147742568418084:U=.10212721564444344:U=.0518263760642861:U=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?U=-.10669213185972036:U=.027050434286384796:t[302]>1e-35?U=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?U=.06354599160071946:t[1]>67.50000000000001?U=.05317447949011187:U=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?U=-.09369289448773599:t[0]>2215.5000000000005?U=.04077965380363924:t[0]>807.5000000000001?U=-.0591771776458298:U=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?U=-.016323380219241672:U=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?U=.03720704290087811:U=-.008730548158766654:t[4]>80.50000000000001?U=-.05346644687473197:U=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?U=.019984510398089086:U=-.03917825025861855:t[9]>170.50000000000003?U=-.09759719821334525:U=-.0023586682752856298;let Y;t[183]>1e-35?t[17]>1e-35?Y=.030100940443356424:t[10]>1.5000000000000002?Y=-.10861112216742408:Y=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?Y=-.032062878390325456:Y=-.10808232631806887:t[8]>1641.5000000000002?Y=-.06147013392655731:t[4]>12.500000000000002?Y=.03324767551088266:t[145]>1e-35?Y=.028851633810612017:Y=-.054871239091792784:t[134]>1e-35?Y=-.023813968121342108:t[266]>1e-35?Y=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?Y=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?Y=-.025350325484720576:Y=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?Y=.056817276537534815:Y=-.07674158463557636:Y=-.06335553143454145:t[1]>56.50000000000001?Y=.16390494217299284:Y=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?Y=.041717597065890205:Y=-.10357913492269129:t[10]>29.500000000000004?Y=.1365512866715726:Y=.020600048310575665:Y=.09708785634773187:Y=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?Y=-.03146213719547347:Y=.11784024316238083:Y=-.050940520532045355:Y=-.047988344143075616:t[191]>1e-35?Y=.028764654731460032:Y=.0011911575567860023;let W;t[294]>1e-35?t[10]>50.50000000000001?W=-.11630092297244568:t[0]>2432.5000000000005?t[0]>4199.500000000001?W=-.05103908560370243:W=.05002066201169583:W=-.09976646725732496:t[32]>1e-35?t[0]>4242.500000000001?W=-.0648838712201258:t[5]>3721.5000000000005?t[9]>4.500000000000001?W=.127983140816313:W=-.05436534163636867:W=-.024514536544596455:t[121]>1e-35?t[0]>4449.500000000001?t[4]>9.500000000000002?W=-.009504203657088933:t[8]>819.5000000000001?W=.18689664822602375:W=.03635576744011826:W=-.029862411809998525:t[223]>1e-35?W=-.06474496692999487:t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?W=-.09405026597863717:t[0]>4153.500000000001?W=.053577663326799765:W=-.05062127873995668:W=.06512222894425874:t[39]>1e-35?W=-.04985311717827547:t[51]>1e-35?W=-.04541229517934797:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?W=-.02860634573675884:W=.08863753005590103:W=.11158892111063744:t[0]>655.5000000000001?W=-.031005736641654926:W=-.1439827004505974:t[222]>1e-35?t[1]>11.500000000000002?t[0]>612.5000000000001?W=-.00843386136334982:W=-.05273594615999777:W=.1060183822015004:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?W=-.015774115523598486:W=.10147367091236065:W=-.048307000563071016:W=.002118376117677254;let V;t[8]>1014.5000000000001?t[9]>137.50000000000003?V=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?V=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?V=.07211107542565391:V=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?V=-.0751486415451188:t[1]>59.50000000000001?V=.13459005084554104:V=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?V=.06715575425741895:V=-.005895690393702183:t[8]>2915.5000000000005?V=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?V=-.00029068886245881074:V=.0613467393188786:t[148]>1e-35?V=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?V=.003887223773199377:V=-.08553893131979015:V=.025654192706396767:V=-.05651733979610658:V=-.02039913645229667:t[2]>7.500000000000001?V=-.1058450646728524:V=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?V=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?V=.1283258201586378:V=-.01718135372229775:V=-.07702452408491414:t[125]>1e-35?V=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?V=.04273051857848212:V=-.04533122948101463:t[2]>196.50000000000003?V=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?V=.0231032972703664:V=-.04807386814498683:V=.002729435991332102;let z;t[179]>1e-35?z=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?z=.026484626664041125:t[10]>1.5000000000000002?z=-.10187000872941615:z=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?z=.09574540795390041:z=-.06454986703691233:z=-.11411849349353141:t[266]>1e-35?z=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?z=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?z=-.04403391373512386:z=.1132928075412222:t[2]>47.50000000000001?z=-.09700191391838056:z=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?z=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?z=-.001668912999010927:z=-.02363511102970245:t[8]>58.50000000000001?z=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?z=.0911011436534449:t[1]>28.500000000000004?z=-.07192390493729035:z=.06913818091291246:z=-.012312625373699222:z=.06784496312307986:z=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?z=.0026564453057705273:z=-.025425772389361445:t[122]>1e-35?z=-.12046786388602149:t[0]>3183.5000000000005?z=.01162092842804907:t[91]>1e-35?z=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?z=-.0001647792543020228:z=-.023664538532907665:z=.01609078206180752;let ie;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ie=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ie=-.017696526862422682:ie=.1450050954613223:ie=-.05406930069823832:ie=-.08308700260259043:t[120]>1e-35?ie=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ie=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ie=.038431826961746934:ie=-.05937462906539856:t[9]>65.50000000000001?ie=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ie=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ie=-.09579030954062734:ie=.025064711572811746:ie=.02579440518821548:ie=.1044440128091862:ie=-.058348633139536844:ie=.07766788227934436:ie=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ie=.07463684068207214:ie=.18244269035484484:t[6]>39.50000000000001?ie=-.06050050067471004:ie=.05787759066913493:ie=.010783225857972171:ie=.1674891243602606:t[4]>9.500000000000002?ie=-.004814132027475892:ie=-.14543299413454813:ie=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ie=-.07634466313617769:ie=.0287825335169114:ie=-.06894721943300268:ie=-.00023988459059521937;let H;t[131]>1e-35?t[1]>93.50000000000001?H=-.05706887458825395:t[2]>1.5000000000000002?H=.011446637886629108:H=-.10616119878749211:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?H=.08424281276381033:t[3]>17.500000000000004?t[20]>1e-35?H=.11146885439601915:t[8]>61.50000000000001?t[0]>3530.5000000000005?t[9]>48.50000000000001?t[9]>61.50000000000001?H=.026278724448495064:H=.17053138400480508:t[0]>4463.500000000001?H=-.06482289890096041:H=.03026516489536295:H=-.031785170717683144:H=.1312690622980455:t[13]>1e-35?H=.14336922540461444:H=.03523850945454039:H=-.015407465968975714:t[39]>1e-35?H=-.054809635385158186:t[32]>1e-35?t[0]>4242.500000000001?H=-.0659975068798723:H=-.008386582621403979:t[4]>60.50000000000001?t[10]>75.50000000000001?t[3]>107.50000000000001?H=-.04225314193574262:t[3]>70.50000000000001?t[1]>29.500000000000004?H=.057409156184759516:H=.2024322059866388:H=-.030670938454461245:t[10]>1e-35?t[0]>4733.500000000001?H=.010648654146284154:t[308]>1e-35?H=.008728141696325391:t[4]>64.50000000000001?t[298]>1e-35?H=.12364025998551711:H=-.02247495081065243:t[1]>22.500000000000004?H=-.0726295464624251:H=.03481895086048152:t[0]>4331.500000000001?H=-.04775443357020673:H=.07172377425057568:t[2]>89.50000000000001?H=-.11782645274716962:H=.00010092665257989378;let re;t[147]>1e-35?re=-.041560228567115574:t[302]>1e-35?t[10]>47.50000000000001?re=.062292114082780084:t[10]>5.500000000000001?t[7]>22.500000000000004?re=-.016101990375700172:t[0]>2579.5000000000005?re=-.13045089661551845:re=-.02874367814784938:re=.025835149631944995:t[167]>1e-35?t[0]>3928.5000000000005?re=.17084176915326055:re=-.019195947948312853:t[222]>1e-35?t[30]>1e-35?t[1]>36.50000000000001?t[8]>45.50000000000001?t[8]>578.5000000000001?t[1]>67.50000000000001?re=.10591712319944074:re=-.024082167264285:re=.16497698867036126:re=-.04985066326861431:t[0]>1937.5000000000002?t[2]>16.500000000000004?re=-.021012910475524206:re=-.13058422554298485:t[0]>1102.5000000000002?re=.10955864175201457:re=-.03566689354348996:t[1]>11.500000000000002?re=-.02093884208606101:re=.09107244766183857:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?re=-.013861861436128482:re=.09756849802202777:t[224]>1e-35?t[1]>51.50000000000001?re=.10163873449625677:re=-.02779270277623805:t[1]>26.500000000000004?re=-.08035058228527389:re=.0005719695099064484:t[191]>1e-35?t[9]>9.500000000000002?re=-.007028075523033826:re=.0489470913925288:t[1]>61.50000000000001?t[132]>1e-35?re=.11230846723576784:t[0]>350.50000000000006?t[2]>1.5000000000000002?re=-.0032075580718124892:re=-.04442829143298883:re=-.06597073245775804:re=.0015594090939337751;let le;t[223]>1e-35?t[8]>668.5000000000001?le=-.12803889879260094:le=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?le=.08967966612917375:t[1]>39.50000000000001?le=-.059791671514498074:le=.05648934961902822:t[2]>59.50000000000001?le=-.08633234097449628:t[6]>53.50000000000001?le=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?le=.025606129643140924:le=.13835395886271978:le=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?le=-.09975506556937946:t[10]>36.50000000000001?le=-.09427724661655643:t[10]>24.500000000000004?le=.07329330653410447:le=-.02271182965807972:le=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?le=-.05082091374050816:le=.1687114435254966:t[0]>2314.5000000000005?le=-.06422664016383926:le=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?le=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?le=-.1274167728754332:le=.01308079126447365:t[4]>73.50000000000001?le=.13854015371106546:t[4]>48.50000000000001?le=-.03684255740123261:t[6]>45.50000000000001?le=.10329912215813097:t[10]>77.50000000000001?le=-.08630788656925215:le=.031022006843800853:t[1]>25.500000000000004?le=-.08278381528048026:le=.06664374548141594:t[84]>1e-35?le=-.05624227409079396:le=.00012184182357340415;let Le;t[179]>1e-35?Le=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Le=-.07595415373151816:Le=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Le=.022822510448266862:Le=.17491569312933697:Le=-.058362287133533565:t[2]>2.5000000000000004?Le=-.03633895806364428:Le=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Le=-.07294848747514579:Le=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Le=-.07009535282685533:t[8]>2640.0000000000005?Le=-.051761240111316276:t[131]>1e-35?Le=-.06245774419231631:Le=.03495606662854905:Le=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Le=.0015036626973581122:Le=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Le=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Le=.022343994371919224:Le=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Le=.07724450228328664:t[0]>3853.5000000000005?Le=-.15671707454435677:t[10]>28.500000000000004?Le=-.10179090671841723:Le=.014878216919760927:Le=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Le=.14054154485273487:Le=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Le=-.08632985141410315:Le=.005524157938954954:Le=-.08802502622523681:Le=-.0004649168897260341;let ge;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ge=-.007458687464321174:ge=-.09444966249102484:t[1]>23.500000000000004?ge=.08564129697360716:ge=-.07105002902845851:ge=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ge=-.10326216566705966:t[1]>26.500000000000004?ge=.0050539832484585365:ge=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ge=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ge=.05783632021087773:t[10]>17.500000000000004?ge=-.06720598671764105:t[1]>47.50000000000001?ge=.097495825172558:ge=-.013372242800584872:ge=-.06463226787713715:t[42]>1e-35?ge=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ge=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ge=.11051270080118503:ge=.027719462817590454:t[8]>597.5000000000001?ge=-.08441503592016869:ge=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ge=-.12190088985091102:ge=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ge=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ge=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ge=.016585157185448045:ge=-.11032043771149425:ge=.01586986028570486:t[8]>388.50000000000006?ge=-.10592413013261853:ge=.04930703248769364:t[13]>1e-35?ge=.003621937787920821:ge=-.0013786331198611841;let Ue;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Ue=.009769895322846493:Ue=-.10620052926943656:t[9]>19.500000000000004?Ue=.03781202525403449:t[9]>14.500000000000002?Ue=-.11485785321365344:t[9]>6.500000000000001?Ue=.07677177833073881:t[0]>4342.500000000001?Ue=-.07079285609687631:t[49]>1e-35?Ue=.06156814809246001:Ue=-.014788509042554625:Ue=-.032659201618470655:t[5]>5207.500000000001?Ue=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Ue=-.03094160322187924:t[1]>29.500000000000004?Ue=.09474646043921069:Ue=.023445783928231618:Ue=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Ue=-.07164443768784848:t[1]>29.500000000000004?Ue=.089473622509272:t[8]>597.5000000000001?Ue=-.08155349903101317:Ue=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Ue=-.004003900679358653:t[190]>1e-35?Ue=-.09236113461485262:t[8]>3198.5000000000005?Ue=-.0124130160451179:Ue=.018453070064009328:t[15]>1e-35?Ue=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Ue=-.0009580759587680961:Ue=-.03227283036698222:Ue=.01369287669536875:t[1]>50.50000000000001?Ue=-.04213060332500437:t[35]>1e-35?Ue=-.11508095777767471:t[190]>1e-35?Ue=-.08611884672400155:t[297]>1e-35?Ue=.05723551879433584:Ue=-.004829340082311461;let ke;t[183]>1e-35?ke=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?ke=-.11753465135886734:ke=-.007515490299047085:ke=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?ke=-.12371142493530439:t[1]>36.50000000000001?ke=.032189417575190435:ke=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?ke=-.0784518658439288:t[2]>54.50000000000001?ke=.12477882322370665:ke=.000313468482399738:ke=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?ke=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?ke=.0353146070135579:ke=-.06327619611098285:ke=.02813577701641991:ke=-.12354390728506215:t[34]>1e-35?ke=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?ke=-.01245803535276381:ke=-.07169472553475001:t[1]>11.500000000000002?ke=.12989984824561698:ke=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?ke=.010390226893521422:t[10]>14.500000000000002?ke=.16790888126487719:ke=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?ke=-.043398307129729134:ke=.09963544907820426:t[9]>30.500000000000004?ke=-.13540713124984502:t[9]>17.500000000000004?ke=.0509435850590757:ke=-.04761897852404613:t[4]>78.50000000000001?ke=.09197086656470652:ke=.0006771050176682337;let X;t[122]>1e-35?t[6]>36.50000000000001?X=.05686884451670743:X=-.05334759543084309:t[266]>1e-35?X=-.08603579519816038:t[157]>1e-35?X=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?X=-.0499592651503952:t[0]>725.5000000000001?X=.11780353905132664:X=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?X=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?X=-.03190157229022304:X=.07985197845805492:X=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?X=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?X=-.027174047777029083:X=.057117284879796476:t[3]>43.50000000000001?X=-.0016147040913107311:X=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?X=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?X=-.01466076988151239:X=.13375695925484857:X=-.04885873081899647:t[0]>5566.500000000001?X=.11086813028591343:t[8]>992.5000000000001?X=-.07622304217072383:X=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?X=.03285858361708423:X=-.12354858211764992:X=.0672788301823281:t[15]>1e-35?X=.08658836986585006:X=-.02741484278509758:t[290]>1e-35?X=-.08161310335133287:t[135]>1e-35?X=-.04824156054814152:X=.0009156904299554183;let ee;t[3]>7.500000000000001?ee=.0006791852818377787:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ee=.03642374718166293:ee=.16379973756366603:ee=-.03946685266127979:t[186]>1e-35?ee=.07618896623420895:t[96]>1e-35?ee=.0680272261319657:t[107]>1e-35?t[1]>48.50000000000001?ee=-.022822371600847505:ee=.0501405836324949:t[203]>1e-35?t[1]>77.50000000000001?ee=.044416424920571296:ee=-.0648450593196238:t[5]>3921.5000000000005?t[1]>110.50000000000001?ee=-.11110466767595227:t[9]>5.500000000000001?t[9]>52.50000000000001?t[1]>50.50000000000001?ee=.1061937286809567:t[7]>54.50000000000001?ee=.11487507743121311:t[8]>819.5000000000001?ee=-.07181278009001418:t[10]>25.500000000000004?ee=.13499019430369633:t[1]>31.500000000000004?ee=.09032979489780704:ee=-.12754166393372374:t[9]>37.50000000000001?ee=-.05093963635361407:ee=-.005026651151683848:t[9]>2.5000000000000004?ee=.07619735785573735:ee=.012363301341532136:t[26]>1e-35?ee=-.10685800454968203:t[8]>125.50000000000001?t[8]>446.50000000000006?t[0]>3842.5000000000005?ee=-.08783796894105043:t[282]>1e-35?t[1]>47.50000000000001?t[9]>40.50000000000001?ee=-.10764172927882483:ee=.01890760098464703:ee=.06573095405846417:t[8]>634.5000000000001?ee=-.00783575973273707:ee=-.050612689680229306:t[1]>22.500000000000004?ee=-.0016842490401359626:ee=.0738227088444087:ee=-.02663970950432175;let K;t[31]>1e-35?t[8]>17.500000000000004?K=.013678038624884814:t[1]>35.50000000000001?t[1]>51.50000000000001?K=.007191286124908192:K=-.09347881647636902:t[10]>1.5000000000000002?K=.07938758708008091:K=-.008702935600305113:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?K=.12321804057595996:K=-.018281109320672437:t[23]>1e-35?t[4]>62.50000000000001?K=-.04644244754790671:K=.024546310702263208:t[8]>862.5000000000001?t[0]>3429.5000000000005?t[4]>9.500000000000002?t[52]>1e-35?K=.0706108609273337:t[2]>40.50000000000001?K=-.028046629962303716:K=-.06497613993109329:K=.01076489668586676:t[1]>33.50000000000001?t[0]>966.5000000000001?t[2]>14.500000000000002?t[1]>38.50000000000001?K=-.03056331974267756:K=-.11886389712497057:K=.053364962175658184:t[8]>2233.5000000000005?K=-.0448152521157682:K=.1508651602190868:t[2]>33.50000000000001?t[0]>2882.5000000000005?t[0]>3183.5000000000005?K=.03818796510453344:K=.23673992112982362:K=.02858814226507374:t[10]>44.50000000000001?K=-.1125863771551199:K=.009129996952394916:t[1]>7.500000000000001?K=-.004374525302461639:K=-.07858519434925451:t[149]>1e-35?t[6]>23.500000000000004?K=.0005231594491642136:t[0]>4053.5000000000005?t[8]>660.5000000000001?K=-.13677189943034931:t[10]>2.5000000000000004?K=.039591891437078086:K=-.09312596849507347:K=-.02423172142089822:K=.0009836986075266283;let he;t[189]>1e-35?t[0]>5269.500000000001?he=-.103183298350443:t[2]>51.50000000000001?he=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?he=-.05186168947388339:he=.0496996365539082:t[10]>23.500000000000004?he=.1404445738719:t[93]>1e-35?he=.0027146310074558505:t[5]>3821.5000000000005?he=.002153033152069652:t[4]>2.5000000000000004?he=.007663539551317215:he=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?he=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?he=-.021479467709980358:he=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?he=.021660293256233334:he=-.0927396152303864:he=.0665074081601698:t[0]>1550.5000000000002?he=.08972407105958534:he=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?he=.06761927942466854:he=-.015762168112653286:t[17]>1e-35?he=.10311304131145381:he=-.017672785252336027:he=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?he=-.10638321435298535:he=.0007073011744385905:t[18]>1e-35?he=-.027056185501334325:t[145]>1e-35?he=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?he=.09762140519655171:t[9]>110.50000000000001?he=-.06581942957595835:t[6]>54.50000000000001?he=.04959634035251596:he=.0022616298654554207:he=-.007437620924990854;let Z;t[179]>1e-35?Z=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?Z=.1470294450403005:Z=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?Z=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?Z=.07965955447707423:t[10]>10.500000000000002?Z=-.09236156404262426:Z=.03396273196231458:Z=-.13246465021467432:Z=.07092822261735353:Z=-.08753829085942:Z=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?Z=.004705878789890202:Z=.13775378964952867:Z=-.04770928980587811:t[10]>29.500000000000004?Z=.011221519891071544:t[0]>3853.5000000000005?Z=.06365381191628273:Z=.15506252245336827:t[1]>37.50000000000001?Z=-.07254777021042061:Z=.026514587757252385:t[308]>1e-35?Z=.04115804816617256:t[10]>26.500000000000004?Z=.02077721353011946:t[5]>3548.5000000000005?Z=-.1280907116663952:Z=-.021974774274438:t[306]>1e-35?Z=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?Z=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?Z=-.005710865560475598:t[94]>1e-35?Z=-.06751507982853555:Z=.027250040757588703:t[9]>52.50000000000001?Z=.07060357924595577:Z=-.030297760713011795:Z=-.0006005400085266517;let ue;t[113]>1e-35?ue=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?ue=-.06996356565314456:ue=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?ue=-.08317707559926495:t[21]>1e-35?ue=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?ue=-.010538203005984922:ue=.08454819465349446:t[9]>124.50000000000001?ue=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?ue=-.08542251249346582:t[9]>50.50000000000001?ue=-.023428882537657472:ue=.010042500833979073:ue=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?ue=.03006025206979096:t[9]>108.50000000000001?ue=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?ue=.04222035773042132:ue=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?ue=-.07209095448054853:ue=.028065954981903313:ue=.08714651929917122:ue=-.006678820669279169:t[10]>40.50000000000001?ue=.006982396294941626:ue=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?ue=-.09351114982645548:t[4]>3.5000000000000004?ue=-.004837550129223451:ue=-.08324141237464677:t[303]>1e-35?ue=.10703037493990825:t[9]>156.50000000000003?ue=-.10803018621648303:t[116]>1e-35?ue=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?ue=.10261721665006701:ue=.018994509090668264:ue=.0011244262442038839;let qe;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?qe=-.08404263465005328:t[0]>3682.5000000000005?qe=.041259223920298876:t[1]>29.500000000000004?qe=-.09541257493441671:qe=.001482192721625409:qe=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?qe=-.08268996098437432:t[230]>1e-35?qe=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?qe=-913218977737457e-19:t[4]>10.500000000000002?qe=-.056334165674005156:t[127]>1e-35?qe=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?qe=-.04231200150318989:t[10]>42.50000000000001?qe=.10182973257894812:qe=.015934763950068445:qe=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?qe=-.041117068322885315:qe=.1167767830037126:qe=.13611206992387337:t[10]>41.50000000000001?qe=-.07120286010564107:qe=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?qe=-.07702290997669524:t[198]>1e-35?qe=.08776558554437136:qe=-.008290740324975692:t[2]>32.50000000000001?qe=.07198457624219955:qe=.005463113714361629:qe=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?qe=.03295785445437507:qe=.15140250150674536:qe=-.035613213948910254:t[186]>1e-35?qe=.06849425535860769:t[96]>1e-35?qe=.06028225812727254:qe=-.007582543288662308;let ne;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ne=.08396556264106572:ne=-.0562516995099192:ne=-.10593011018789432:t[183]>1e-35?t[15]>1e-35?ne=-.09705176473553752:t[7]>18.500000000000004?t[2]>37.50000000000001?ne=.0052017514017035915:ne=-.11194119432743639:ne=.03724337696163019:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?ne=-.025692451287403446:ne=-.09511862672123193:t[8]>1661.5000000000002?t[10]>37.50000000000001?ne=-.11892250746801664:t[10]>22.500000000000004?ne=.07548493166973796:ne=-.05973048107712209:t[4]>12.500000000000002?t[0]>4319.500000000001?t[10]>4.500000000000001?t[10]>37.50000000000001?ne=.13750699058082427:t[18]>1e-35?ne=.06535408879552801:ne=-.054118179035040674:ne=.1344282838979622:t[0]>3982.5000000000005?ne=-.10409582202467015:t[19]>1e-35?ne=.12672850705810795:t[8]>587.5000000000001?t[1]>35.50000000000001?ne=.012705935670766466:ne=.14149359442527545:ne=-.047977876173706004:t[20]>1e-35?ne=.057945228080337946:t[0]>3642.5000000000005?ne=-.008726535792122467:ne=-.08424769891378858:t[34]>1e-35?ne=-.0699329538228602:t[134]>1e-35?t[11]>1e-35?t[4]>15.500000000000002?t[0]>1187.5000000000002?ne=.01196849566739346:ne=.1614642278429876:ne=-.043022338150701625:t[3]>5.500000000000001?ne=-.03907848255033881:ne=.018280601026175593:ne=.0006654540402589085;let ce;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?ce=-.01386103677247845:ce=.11386694333005128:t[4]>27.500000000000004?ce=-.021862617610091336:t[2]>31.500000000000004?ce=.0828858469030438:ce=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?ce=.11303635767048735:ce=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?ce=-.04238798044549342:ce=.022091190130494303:t[5]>5082.500000000001?ce=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?ce=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?ce=-.04291104140431434:t[17]>1e-35?ce=.11256797532342613:ce=-.017206916368289193:ce=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?ce=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?ce=.03581712466863222:ce=.14770264307668884:t[8]>73.50000000000001?ce=-.13093289429740068:ce=.042461737442702936:t[52]>1e-35?ce=.0501831919044939:ce=-.010450249720465756:ce=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?ce=.0005381332165438493:ce=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?ce=.04849637311285226:ce=-.036671377119808564:t[0]>421.50000000000006?ce=.00020968499911058945:ce=.11636422423182405:ce=-.12687837788222575:ce=.0012774367867215346;let Ne;t[120]>1e-35?Ne=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Ne=-.042799574885345304:Ne=.07412430171193245:Ne=-.11248270469336048:t[193]>1e-35?Ne=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Ne=.028911612178122104:Ne=.12326369727728437:t[0]>4091.5000000000005?Ne=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ne=.1159839898100149:Ne=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Ne=-.0216343737351583:Ne=-.1220272260878369:t[2]>18.500000000000004?Ne=.09152924475072398:t[8]>55.50000000000001?Ne=.039508716651005665:Ne=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Ne=.06793009902674053:Ne=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Ne=-.04391068849624096:Ne=.04009967593394672:t[8]>1085.5000000000002?Ne=-.024773826356034825:Ne=-.13919707884246582:Ne=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Ne=-.11567917501901476:Ne=-.006813640337684114:t[3]>7.500000000000001?Ne=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Ne=-.001754586408351048:Ne=-.055422422450722056:Ne=-.06090032532532226:t[0]>5269.500000000001?Ne=.11787981735983527:Ne=-.00198119768540783:Ne=.00210412924303036;let we;t[294]>1e-35?t[10]>50.50000000000001?we=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?we=-.06063239096209816:we=.03317022411417386:we=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?we=-.013608609329298802:we=.09078000157330264:t[99]>1e-35?we=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?we=-.07536137260189814:we=.006253266595455118:t[10]>28.500000000000004?we=-.006106041147592768:t[9]>156.50000000000003?we=-.11828932797811101:t[94]>1e-35?we=-.02566078479505714:t[303]>1e-35?we=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?we=-.08401252789168523:t[5]>4244.500000000001?we=.026372887658499107:t[1]>16.500000000000004?we=-.027836756345634026:we=.09205362097909099:we=.00934612788718244:t[203]>1e-35?we=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?we=-.09580979052540028:t[1]>50.50000000000001?we=-.06402211827281554:we=.08342858760095972:t[2]>36.50000000000001?we=.008114897658204584:t[92]>1e-35?we=.09541587072672864:we=-.022342147210555434:we=-.01660492519175128:we=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?we=.15846731118501817:we=.039498507912023195:t[245]>1e-35?we=.07008718676813333:we=.0019806389728814727;let Be;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Be=-.01192072916082109:Be=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Be=.06874032717466054:t[4]>40.50000000000001?Be=-.07752510020707537:t[1]>76.50000000000001?Be=-.09944032260703917:t[8]>1381.5000000000002?Be=-.054466635810800745:t[1]>32.50000000000001?Be=.05974084520839573:Be=-.0384718740755954:Be=-.11374190719134032:t[0]>2151.5000000000005?Be=-.13703645155803298:Be=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Be=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Be=.013539805885738608:Be=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Be=.09941880179344399:Be=-.01608127391210995:Be=.08025226531247417:t[9]>67.50000000000001?Be=.13525448212444113:t[6]>61.50000000000001?Be=-.05511099182158894:t[94]>1e-35?Be=-.06821509831783572:t[128]>1e-35?Be=.11361314817714643:Be=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Be=-.09954181329804547:t[197]>1e-35?Be=.10102833149755386:t[188]>1e-35?Be=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Be=-.03781554214742005:Be=.09927933385592314:Be=-.020006000056720083:Be=-.10520473615957895:Be=-.12006990846253787:Be=-.00026111570975317574;let rt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[0]>1725.5000000000002?t[7]>14.500000000000002?t[2]>38.50000000000001?rt=-.019188245509744628:rt=-.13354864350075848:t[0]>2461.5000000000005?rt=.051885477468354396:rt=-.0833581968852119:rt=.08233441701532287:rt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?rt=.09926337893072812:rt=-.027753610497327715:t[0]>1972.5000000000002?rt=-.09780045823152517:rt=.032380915168504935:rt=.11502632261226381:t[17]>1e-35?rt=-.06094965899579662:t[10]>40.50000000000001?rt=-.07500475582440802:rt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?rt=-.09584538995220808:rt=-.00908705814304442:rt=.03203281520813893:t[10]>49.50000000000001?rt=-.03146271513986384:t[2]>63.50000000000001?rt=.13172001315536286:t[224]>1e-35?rt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?rt=.09521549382082259:rt=-.04414925613522197:t[0]>1847.5000000000002?rt=-.09118580379557353:rt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?rt=.03525144509943896:rt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?rt=-.04766112322938157:t[2]>10.500000000000002?rt=.0728516504357201:rt=-.05049625965272536:rt=-.10868663055825774:rt=.0005382613419948969;let st;t[147]>1e-35?t[1]>53.50000000000001?st=-.10615739288764095:t[0]>2604.5000000000005?t[0]>3629.5000000000005?st=-.030504020655417463:st=.07102458639110094:st=-.07058131985243714:t[302]>1e-35?t[10]>47.50000000000001?st=.055304563442710876:t[1]>53.50000000000001?st=.033723409577443623:t[8]>175.50000000000003?t[0]>2628.5000000000005?t[9]>40.50000000000001?st=-.1568835288372895:st=-.0279829124400056:st=.04493843959601833:st=-.11637042729644327:t[191]>1e-35?t[282]>1e-35?st=-.054133834303687026:t[9]>48.50000000000001?st=.11263810289007213:t[9]>9.500000000000002?st=-.02202034562838259:t[4]>45.50000000000001?st=-.03410927569045158:st=.04381615166534081:t[242]>1e-35?t[0]>3615.5000000000005?t[3]>19.500000000000004?t[1]>56.50000000000001?t[4]>28.500000000000004?st=-.029687297407295893:st=.10673602850001934:t[4]>42.50000000000001?st=.0036275562945108117:st=-.0760789221330622:st=-.10385623431741903:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?st=.08274426793676076:st=-.07076234425516396:st=.13890177606150175:st=-.019863286503635686:t[53]>1e-35?t[18]>1e-35?st=-.09250637750836187:st=-.0031531727902009026:t[2]>107.50000000000001?t[4]>91.50000000000001?t[1]>16.500000000000004?st=-.01897867921812603:st=.04890781705365262:st=-.11569892307597907:t[2]>106.50000000000001?st=.09032697440623969:st=.00047935919155035045;let _t;t[115]>1e-35?_t=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?_t=-.10131179514695865:t[8]>938.5000000000001?_t=.10203729808015481:_t=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?_t=.03574015165562999:_t=-.07763042506449493:_t=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?_t=.0665706259130275:_t=-.06586817559309924:_t=.11925564412287476:_t=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?_t=.046017146627455346:_t=-.08623321630086885:t[8]>1765.5000000000002?_t=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?_t=.11143827902215087:_t=-.01817808730473413:_t=.16980985030210127:_t=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?_t=.010168994879727824:_t=-.09099594488792513:t[9]>1.5000000000000002?_t=.0533459678147928:_t=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?_t=-.062346959148773695:t[1]>47.50000000000001?_t=-.0021578343835599316:t[2]>27.500000000000004?_t=.19567373210166172:_t=.07851555379116423:t[18]>1e-35?_t=.03711549097804649:t[8]>359.50000000000006?_t=.012492346746905587:t[4]>20.500000000000004?_t=.047511695735697544:_t=-.07999269063948773:_t=6802045404471004e-20;let Dt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Dt=.0011484728213539738:Dt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Dt=-.09828874964938798:t[8]>1586.5000000000002?Dt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Dt=.011938269926919522:Dt=.17541983715953954:t[19]>1e-35?Dt=.023002786011088672:Dt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Dt=.06508934844183291:Dt=-.10168553534835639:Dt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Dt=.021140806225203937:Dt=-.1167833342453639:t[2]>33.50000000000001?Dt=.13163585734056618:Dt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Dt=.06314479201263888:Dt=-.09639088327091713:t[10]>29.500000000000004?Dt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Dt=40577156464836036e-21:Dt=.12322387121810757:Dt=-.03697224045046014:t[1]>22.500000000000004?Dt=.016474835887320276:Dt=.16919298733903063:Dt=.07633203630214054:Dt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Dt=.14150493354700563:Dt=-.01831155354975749:t[1]>28.500000000000004?Dt=-.07952557178685365:t[10]>28.500000000000004?Dt=.0665695554984927:Dt=-.053640139319277094:Dt=.0004754840665898665;let $t;t[76]>1e-35?$t=-.06814884255939921:t[179]>1e-35?$t=-.06325743795510681:t[122]>1e-35?t[6]>36.50000000000001?$t=.05052338063261613:t[8]>626.5000000000001?t[1]>38.50000000000001?$t=.004193658608848433:$t=-.1066968975983452:t[8]>302.50000000000006?$t=.05476730110440451:$t=-.06382970920394895:t[218]>1e-35?t[2]>3.5000000000000004?t[6]>13.500000000000002?t[2]>19.500000000000004?t[0]>3200.5000000000005?t[4]>91.50000000000001?$t=-.12156071809840739:t[9]>21.500000000000004?t[5]>3883.5000000000005?t[8]>919.5000000000001?t[8]>1085.5000000000002?$t=.013555772109446666:$t=-.09856116699770784:$t=.0284329611813383:t[2]>52.50000000000001?$t=.04008708444763762:t[9]>29.500000000000004?$t=-.1289599546008197:$t=-.018566534248335896:t[8]>747.5000000000001?$t=.02236484980076122:$t=.1148871655157582:t[8]>3084.0000000000005?$t=-.05573875952902531:t[10]>17.500000000000004?t[2]>51.50000000000001?$t=.03164751204281298:$t=.11752140436184891:t[9]>42.50000000000001?$t=-.07180559595410106:t[22]>1e-35?$t=.09325040416256854:$t=-.016041122807939914:$t=-.02765708954618808:t[1]>30.500000000000004?t[1]>66.50000000000001?$t=-.010718250133458515:$t=.09818827994853763:$t=.010180038981174032:$t=-.039472162599295535:t[9]>170.50000000000003?$t=-.08536729235976731:t[189]>1e-35?t[0]>5269.500000000001?$t=-.08674788057474031:$t=.02077653508548371:$t=-.0003536561382007414;let Gt;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?Gt=.018337297491457794:Gt=-.05926206443180149:Gt=.024026520855881126:t[288]>1e-35?t[184]>1e-35?Gt=.10747078482128616:t[126]>1e-35?Gt=-.10550625192391357:t[7]>71.50000000000001?Gt=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?Gt=.1317396472229434:Gt=-.025035791351328947:Gt=-.0728334305864372:t[8]>963.5000000000001?Gt=.023642201723096064:Gt=.183010326734258:t[128]>1e-35?Gt=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?Gt=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?Gt=-.1088876900335281:Gt=.02758317023002635:Gt=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?Gt=-.01928020117446408:Gt=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?Gt=.07893723375925096:Gt=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?Gt=-.10301657587280551:Gt=.005787463140224318:Gt=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?Gt=-.019296977889522397:Gt=-.07274529751752634:t[1]>30.500000000000004?Gt=-.050368901143148286:Gt=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?Gt=.0015332402792773946:Gt=.09930153676749967:Gt=-.06370844564357069:Gt=.00042272155209927616;let Ie;t[71]>1e-35?t[4]>17.500000000000004?Ie=.12586844370423247:Ie=-.006791999603126354:t[222]>1e-35?t[1]>10.500000000000002?t[30]>1e-35?t[1]>36.50000000000001?t[9]>1.5000000000000002?t[10]>25.500000000000004?Ie=-.08474891624263797:t[8]>125.50000000000001?Ie=.08125086980439704:Ie=-.04082085238068532:t[0]>3863.5000000000005?Ie=.020481535807469208:Ie=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?Ie=-.019110200161573936:Ie=-.12387719685855114:t[0]>1102.5000000000002?Ie=.08376595701957407:Ie=-.031821919580524834:t[9]>4.500000000000001?Ie=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?Ie=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?Ie=.1349841206807871:Ie=.011864053595560297:t[1]>41.50000000000001?Ie=-.08203662486612544:t[2]>18.500000000000004?Ie=-.009541865642346947:Ie=.08345043168501759:t[2]>10.500000000000002?Ie=-.09585031818030947:Ie=.019432330487099865:Ie=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Ie=.11951517733981365:Ie=-.016651014735738538:t[1]>28.500000000000004?Ie=-.07410922545030711:t[10]>28.500000000000004?Ie=.05886430683844788:Ie=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?Ie=.04802269879144705:Ie=-.026208212831796737:t[4]>45.50000000000001?Ie=-.03227476944664786:Ie=.05124575625622705:Ie=.00020506696916003137;let F;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?F=-.03042091758483443:t[10]>14.500000000000002?F=.09816619204768777:F=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?F=-.02381165060401718:F=-.10950361804974783:F=.03538211665111128:t[212]>1e-35?t[19]>1e-35?F=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?F=-.06371052144380579:F=.0835500621252692:F=-.10408255929333915:t[1]>74.50000000000001?F=.13208968122712403:t[1]>64.50000000000001?F=-.04778844603644965:t[8]>51.50000000000001?t[8]>201.50000000000003?t[8]>660.5000000000001?t[6]>4.500000000000001?t[9]>5.500000000000001?t[1]>29.500000000000004?t[0]>3830.5000000000005?F=.09922816902423433:F=.016366955328796718:F=.1592412560903584:t[1]>39.50000000000001?F=.05409467990258923:F=-.08260633210459611:F=-.06307205775247567:t[9]>36.50000000000001?F=.040253940015648144:F=.14202568969471283:F=-.028761848341594044:F=.08994073058773508:t[0]>807.5000000000001?F=-.043427848826323195:F=.04573516446846493:t[20]>1e-35?t[188]>1e-35?F=-.0758877731600639:t[23]>1e-35?F=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?F=.08124700978741987:F=.013296063087086852:t[7]>5.500000000000001?F=-.01640196088612987:F=-.12685498840146067:F=-.0004940792382459551;let be;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?be=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?be=.08513773825688947:be=-.1184664832315282:be=.05676963535893477:be=.14263843210340613:be=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?be=-.10669720555606924:be=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?be=.0664744575868955:be=-.08469256188890871:be=-.026746678040592144:t[281]>1e-35?be=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?be=.012131807587207655:be=-.12776015795398743:be=.04320472481083551:be=.08390980661550446:t[10]>227.50000000000003?be=-.09771783809101153:t[10]>130.50000000000003?be=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?be=-.07610698254064358:t[8]>902.5000000000001?be=-.03136381213599649:t[131]>1e-35?be=.0704821739127936:t[224]>1e-35?be=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?be=.10431473040024908:t[8]>841.5000000000001?be=.07304745320500514:be=-.038011541882439825:be=-.01679746695007364:t[0]>3129.5000000000005?be=.05589952587431965:t[210]>1e-35?be=.06227198085800842:be=-.0011341890997947812:t[8]>740.5000000000001?be=.04817300084412584:be=-.000577001010789238;let Qe;t[187]>1e-35?t[6]>12.500000000000002?t[10]>8.500000000000002?t[10]>16.500000000000004?t[8]>234.50000000000003?t[4]>43.50000000000001?t[0]>4476.500000000001?Qe=-.10504730480402079:t[5]>3341.5000000000005?Qe=.11087894671081754:Qe=-.0406668834674614:Qe=.03308382165616109:t[8]>104.50000000000001?Qe=-.10431436764549162:Qe=.0073928337244891455:t[4]>34.50000000000001?Qe=-.10571751512748416:Qe=-.006081128814142983:t[13]>1e-35?Qe=.1299673566095023:t[4]>60.50000000000001?Qe=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?Qe=.04857126072645073:Qe=-.03431365358104773:t[4]>16.500000000000004?Qe=.04101865986596709:Qe=.16480274980378218:t[10]>26.500000000000004?Qe=.03673978504199255:t[10]>9.500000000000002?Qe=-.10996402743800027:t[308]>1e-35?Qe=.0553693735082498:Qe=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?Qe=.010902983761213922:Qe=.1325118659895645:Qe=-.064362945508595:t[1]>66.50000000000001?Qe=.033416767779331176:Qe=-.054080316225040496:t[42]>1e-35?Qe=-.07762364337810815:t[10]>1089.5000000000002?Qe=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?Qe=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?Qe=.0220102041325908:Qe=-.06516708740003069:Qe=.012833498905748267:t[224]>1e-35?Qe=-.007038418272997865:Qe=.00037666304316290967;let pe;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?pe=.07554189644995735:pe=-.052089349455904946:pe=-.10148206848169845:t[113]>1e-35?pe=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?pe=.07172653627995676:pe=-.07602959317610998:pe=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?pe=-.0399322883690891:pe=.06523495517476098:pe=-.10358715295743802:t[193]>1e-35?pe=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?pe=.015928764772252406:pe=.1341513061552287:pe=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?pe=-.033592997607280156:pe=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?pe=-.08402551858097379:pe=.017401984506038796:t[1]>25.500000000000004?pe=.13337205393591278:pe=-.01160208350090984:pe=.06708317942315471:t[8]>227.50000000000003?pe=-.08486943882418681:pe=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?pe=-.10496268177586783:pe=-.020921489532370493:pe=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?pe=.11639296062157028:pe=-.004275784356569115:t[32]>1e-35?pe=-.07297384970166025:pe=.006026841626381599:pe=.002034611134960428;let Se;t[248]>1e-35?Se=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Se=-.06455513326540585:t[1]>29.500000000000004?Se=.07718474591552532:t[4]>7.500000000000001?Se=.040139336931404826:Se=-.09685734690563386:Se=.00015327283570347363:t[9]>88.50000000000001?Se=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?Se=-.04077257804338707:Se=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?Se=.03778141591008941:Se=-.06459919920634845:Se=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?Se=.14063930759326346:t[0]>179.50000000000003?Se=.07287482250668585:t[8]>1180.5000000000002?Se=-.14419393112726253:t[10]>28.500000000000004?Se=-.07993142770099469:t[17]>1e-35?Se=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?Se=.05527969663610186:Se=-.10824385941441346:t[3]>11.500000000000002?Se=.12358502961047915:Se=-.017509147119622873:t[0]>74.50000000000001?Se=-.014907705458730486:t[8]>95.50000000000001?Se=-.02225118168342062:Se=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?Se=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?Se=.04962819555610421:Se=-.07213577821855309:Se=.09139529824708481:t[19]>1e-35?Se=.013439401088345224:Se=-.049274647207292056:Se=.10531673719686951;let Fe;t[40]>1e-35?t[0]>1937.5000000000002?Fe=-.06421671152073961:Fe=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Fe=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Fe=-.03520420769287065:t[8]>1085.5000000000002?Fe=-.019817352506127633:Fe=.11444439424520964:Fe=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Fe=-.010490117519863269:Fe=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Fe=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Fe=.06619344145920268:t[0]>4091.5000000000005?Fe=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Fe=.10016091391222309:Fe=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Fe=-.019511460451434884:Fe=-.11643672465055221:t[2]>18.500000000000004?Fe=.07848228087333317:t[8]>55.50000000000001?Fe=.032583027899956235:Fe=-.11209832692153521:t[11]>1e-35?Fe=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Fe=-.09996887746328006:t[9]>2.5000000000000004?Fe=.02157682011863397:Fe=-.05247727848991843:Fe=.07409150201483244:t[1]>38.50000000000001?Fe=-.11378466075449625:t[224]>1e-35?Fe=-.10741749127732923:t[1]>26.500000000000004?Fe=.07343136534146562:Fe=-.07013573628594773:t[25]>1e-35?Fe=-.04626669734164317:Fe=.05518333197956482:Fe=.00032434010867555516;let te;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?te=.026313251010808853:te=-.08997339150292381:te=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?te=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?te=.0905155504503746:t[8]>1049.5000000000002?te=-.062312558183394054:t[8]>719.5000000000001?te=.09583836191410239:t[0]>3719.5000000000005?te=-.0778097309430818:te=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?te=-.12920865648544927:t[0]>2699.5000000000005?te=-.07086587879041864:te=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?te=-.11377786322600797:te=-.009486325820117998:t[1]>55.50000000000001?te=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?te=-.07938291201004219:t[2]>36.50000000000001?te=.01520046732530246:te=.13649854049662832:te=-.07145015938528873:t[8]>407.50000000000006?te=-.00350257360822279:te=.11332047082193297:te=-.10060624458629897:te=.05429496612497562:t[8]>1446.5000000000002?te=.006073419197482838:te=-.08718676350883998:te=-.11532497988252638:te=.10766270463068293:t[34]>1e-35?te=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?te=-.0004109812623829506:te=.021601073497455662:te=-7343540098965853e-20;let Te;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?Te=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?Te=.05995640200798119:t[0]>3443.5000000000005?Te=-.14698883458733583:Te=-.030039164579240187:t[189]>1e-35?Te=-.06086763220538141:t[1]>86.50000000000001?Te=-.05096727866142538:t[4]>64.50000000000001?Te=.11240554253834577:t[4]>45.50000000000001?Te=-.030279760168394117:t[6]>45.50000000000001?Te=.10161088917815142:t[10]>77.50000000000001?Te=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?Te=-.06672020005240323:Te=.08831457502630258:t[8]>2592.5000000000005?Te=-.052617701047376654:t[10]>29.500000000000004?Te=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?Te=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?Te=-.064099222705728:Te=.044332487521538365:t[0]>2882.5000000000005?Te=.031099546885005065:Te=.12938467051623853:t[0]>4221.500000000001?Te=-.0928676413498701:t[9]>30.500000000000004?Te=-.05781824812803708:Te=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?Te=-.06648105454098469:Te=.05985487552383097:Te=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?Te=.05282385499619401:t[1]>66.50000000000001?Te=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?Te=.027885690791379255:Te=-.08407126408362446:Te=.014432924125571093:Te=-9903435845205118e-20;let Ge;t[76]>1e-35?Ge=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?Ge=.013633653464240465:Ge=-.10164319411983509:Ge=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?Ge=.00632864847804078:Ge=-.08393000368134668:Ge=.07870508617440916:t[284]>1e-35?Ge=.1092302727710421:Ge=-.0025505047582483234:t[248]>1e-35?Ge=.07101822393621864:t[274]>1e-35?Ge=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?Ge=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?Ge=.025081789181021243:Ge=-.014813325803582618:t[9]>33.50000000000001?Ge=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?Ge=.11926990418060353:Ge=.01852125513565268:Ge=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?Ge=-.1178464984373743:t[283]>1e-35?Ge=.043370859226927405:t[5]>4320.500000000001?Ge=-.01103141226366587:t[8]>1104.5000000000002?Ge=-.023053423988095886:Ge=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?Ge=.000579145585864887:Ge=.03389152834202143:t[128]>1e-35?Ge=-.14527722052568462:t[210]>1e-35?Ge=-.08915971541902741:t[7]>9.500000000000002?Ge=-.03307314577076116:t[18]>1e-35?Ge=-.05521712302023565:Ge=.009315605032770029:Ge=.0036332551852289933;let J;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?J=-.07583539600416284:t[188]>1e-35?J=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?J=-.011038193049597113:J=.08154028164397753:t[1]>85.50000000000001?J=.10259361975201933:J=.011640408330521594:J=-.00023319159023748508:t[92]>1e-35?J=.13771692859530546:J=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?J=.09967230141007705:t[30]>1e-35?J=-.08888529037551285:J=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?J=.08284665960761373:J=-.029292565021289504:t[7]>7.500000000000001?J=-.09945093355204493:J=-.008381393701708593:t[20]>1e-35?J=-.04218678460370465:t[10]>6.500000000000001?t[9]>2.5000000000000004?t[1]>13.500000000000002?t[8]>143.50000000000003?t[4]>7.500000000000001?t[2]>36.50000000000001?J=.07585582641438211:t[8]>284.50000000000006?J=-.029387993239886723:J=.07716738177321587:t[1]>18.500000000000004?J=.026745348497993746:J=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?J=.02337306890530338:J=-.10390355904767366:J=.07390521199638532:J=-.06788247515155237:J=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?J=-.06360325615644084:J=.04342192339836601:J=-.10598779152030145:J=.05253384605768211;let se;t[3]>7.500000000000001?t[157]>1e-35?se=-.07514182877923786:se=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?se=.028692053800951845:se=.14081686716133598:se=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?se=.0037139292567243084:se=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?se=.01202688580305612:se=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?se=.043935495082738626:se=-.05639305759669704:t[247]>1e-35?se=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?se=.10331836202616368:se=.0006926658459781341:t[96]>1e-35?se=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?se=-.0741403257305367:se=.022900127535540854:t[7]>3.5000000000000004?se=.038110741403836294:se=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?se=-.09552842289807008:t[1]>27.500000000000004?se=.012505935885798007:se=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?se=-.1046104767723845:se=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?se=.023466328488582572:se=.11730925774586994:se=-.04771965631104874:se=.17059689880751394:se=-.08181850955999449:t[26]>1e-35?se=-.12727482696678769:se=-.014343123272734182;let me;t[147]>1e-35?t[1]>53.50000000000001?me=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?me=-.02763546051134888:me=.06423344777499343:me=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?me=.049825139823021586:t[7]>22.500000000000004?me=-.01131680751379858:t[0]>2579.5000000000005?me=-.10673674485369694:me=-.015387212937189957:me=.04347325151148724:t[179]>1e-35?me=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?me=.0650355590939066:me=-.0473332870892226:me=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?me=.11139543329789044:t[126]>1e-35?me=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?me=.06370903833231022:t[10]>29.500000000000004?me=.03415223859607161:t[10]>3.5000000000000004?me=-.07415518117873297:me=-.0014119203473324082:me=.12617652343819508:t[9]>41.50000000000001?me=-.10311145857176976:t[8]>2757.5000000000005?me=-.08106484219011428:t[7]>71.50000000000001?me=-.09783384432091176:t[1]>88.50000000000001?me=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?me=-.008884084501608536:me=.061339437777743616:me=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?me=.01526664064166223:me=.13534828515415498:me=-.06985484465894776:me=.0005758961943178744;let Ce;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Ce=-.029152732370514342:Ce=.07173628916139178:t[1]>36.50000000000001?Ce=-.08859111297255318:Ce=.0018030071815630785:Ce=.13652461563759322:Ce=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Ce=-.07145140450454163:t[21]>1e-35?Ce=-.07422841663493233:Ce=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Ce=.11864240653986852:t[3]>33.50000000000001?Ce=-.08821209591953476:Ce=.05706392280054726:Ce=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Ce=.01953613016837112:Ce=-.059781039130025006:t[148]>1e-35?Ce=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Ce=.07207826841738371:t[202]>1e-35?Ce=.08163917539410503:Ce=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Ce=-.06858280496900336:Ce=-.1781828899516648:Ce=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Ce=.018232649414147116:Ce=-.04419781124222661:Ce=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Ce=.11452368095776105:Ce=-.036496437259924026:Ce=-.040445338739465486:Ce=.0816572651001145:Ce=-.08968914517368663:Ce=.0002826343082585516;let He;t[189]>1e-35?t[0]>5269.500000000001?He=-.08839493050459957:t[10]>85.50000000000001?He=.10046908365702462:t[8]>2592.5000000000005?He=-.09632233975926387:t[8]>2000.5000000000002?He=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?He=.035504970430426296:t[1]>31.500000000000004?He=-.1133764813142531:He=-.01138280942244812:t[8]>1125.5000000000002?He=.09800530246229806:He=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?He=.07316772160107896:He=-.059095014819051765:He=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?He=-.09150209066166894:t[8]>3084.0000000000005?He=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?He=-.04449234460408263:He=.05568837973347338:He=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?He=.12741077850267066:He=.007372371864985329:t[2]>39.50000000000001?He=.02295917234617787:He=.14966532083907075:t[1]>39.50000000000001?He=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?He=-.02511861881285652:t[1]>27.500000000000004?He=.08683660011672288:He=.02956214835267301:t[9]>15.500000000000002?He=-.016538805462996232:He=.04352738094981517:He=-.05561856645643868:t[9]>170.50000000000003?He=-.07996752635874248:t[179]>1e-35?He=-.09065975936933919:He=-.00042817975060427177;let $e;t[39]>1e-35?t[4]>25.500000000000004?$e=.03443173196222934:$e=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?$e=-.0013415395759330318:$e=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?$e=.002297618040307216:$e=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?$e=-.015297257305397608:$e=.09651828834062742:$e=-.06636003334371929:t[10]>11.500000000000002?$e=.17631616138309397:t[0]>1639.5000000000002?$e=3804386478092585e-20:$e=-.09099296398683193:$e=-.06874415876172972:t[0]>2151.5000000000005?$e=-.1311264883406766:$e=.00809052010141122:t[253]>1e-35?$e=-.06338558211939296:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?t[10]>10.500000000000002?t[0]>3615.5000000000005?$e=.045038497754638605:$e=-.07770167665661752:$e=-.08596294280650517:$e=.08538655727027213:$e=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?$e=.054627956617973275:t[1]>61.50000000000001?$e=-.11994465088415499:t[4]>8.500000000000002?$e=.06676200239406452:$e=-.027503148069376867:t[8]>676.5000000000001?$e=-.10363964928357075:t[4]>8.500000000000002?$e=-.07589816227175682:$e=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?$e=.009093153189012338:$e=-.06119765876605404:$e=.0004668642103528348;let et;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?et=-.10100794502567233:et=.08000205636470442:et=-.11945419826856896:t[113]>1e-35?et=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?et=.1224302423880318:et=-.01875566982911468:t[222]>1e-35?t[1]>8.500000000000002?t[1]>24.500000000000004?t[4]>3.5000000000000004?t[0]>725.5000000000001?t[0]>1682.5000000000002?t[0]>2860.5000000000005?et=.0019277012166729114:t[1]>28.500000000000004?et=-.054445821715687494:et=.045645722976713245:t[30]>1e-35?et=.13402660155331655:et=.008921176001777645:et=-.058547426505451076:et=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?et=-.13526418192218206:et=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?et=.0007263224246135398:et=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?et=-.11575657261278308:et=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?et=-.01995960178292952:et=.11216586049153021:et=-.10050961087149474:et=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?et=.10303451081526649:et=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?et=-.043799548968209395:et=-.12451444314954115:t[4]>12.500000000000002?et=-.03838117361958468:et=.06504990789767144:t[57]>1e-35?et=.06890006938293915:et=.0003914274695562949;let ct;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?ct=.004271749009686975:ct=-.10523878297127605:ct=.04633982158107851:ct=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?ct=-.08655730561951676:t[8]>919.5000000000001?ct=-.0676453705610183:t[7]>18.500000000000004?ct=-.027787974193650575:ct=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?ct=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?ct=-.03473877164537313:t[8]>719.5000000000001?ct=.10471053866934404:ct=.008236107678382981:t[4]>57.50000000000001?ct=.09412219478825269:t[10]>66.50000000000001?ct=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?ct=-.040681323751002293:ct=.06374650297561021:ct=.12884615227401788:t[10]>5.500000000000001?ct=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?ct=-.05474068967150784:ct=.03744700650806603:ct=-.07846396348680855:t[1]>42.50000000000001?ct=.018972315810821302:ct=.10953621007604744:t[5]>4439.500000000001?ct=.010999776705494586:t[1]>40.50000000000001?ct=-.12394200059775967:t[10]>2.5000000000000004?ct=.013528093962849453:ct=-.09222088417048682:ct=-.12662967149701485:ct=.09327296405849603:t[3]>99.50000000000001?ct=-.013581954439986752:ct=.0005526498251862075;let bt;t[187]>1e-35?t[243]>1e-35?bt=-.08392792551692502:t[10]>68.50000000000001?bt=.07871769409454053:t[10]>8.500000000000002?t[10]>16.500000000000004?t[2]>17.500000000000004?t[3]>31.500000000000004?t[91]>1e-35?t[10]>21.500000000000004?t[10]>33.50000000000001?t[10]>48.50000000000001?bt=-.0825306209711224:bt=.049559996084532945:bt=-.1064938580886302:bt=.03353240732240275:bt=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?bt=.16966001471529374:t[1]>57.50000000000001?bt=-.005772777673676247:bt=.09383677041525058:t[8]>747.5000000000001?bt=.054068175469351235:bt=-.049968216310277036:t[8]>753.5000000000001?bt=-.0679383555784074:t[4]>8.500000000000002?bt=-.059757341189735386:bt=.05701083682780414:bt=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?bt=.05820296128730006:bt=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?bt=.15340611616954566:bt=.04385036188666874:t[0]>4449.500000000001?bt=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?bt=.004840354641006495:bt=.09967827580276283:bt=.11605363537391578:t[9]>19.500000000000004?bt=-.0735831692725717:bt=.019973331823355176:t[306]>1e-35?t[149]>1e-35?bt=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?bt=-.02442182361342386:bt=.10334853004243093:bt=-.030431948680167104:bt=-956078595250818e-19;let ht;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?ht=-.040232505718244854:t[0]>3030.5000000000005?ht=.0634109586813073:ht=-.04043617034245621:ht=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?ht=-.007859096946435131:ht=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?ht=.05515771679628051:ht=-.04214471312668263:ht=-.09589322222261765:t[193]>1e-35?ht=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?ht=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?ht=-.08152604001147906:t[11]>1e-35?ht=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?ht=.13100930780107503:t[10]>25.500000000000004?ht=.05921074710011526:ht=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?ht=.0009447118243153454:ht=-.09820565036865991:ht=.057146909749745546:t[0]>2115.5000000000005?ht=-.12331216726611678:ht=.007281983677694285:t[2]>56.50000000000001?ht=.012310154675612615:ht=-.08873665774670461:t[6]>25.500000000000004?ht=.134708740821879:t[9]>5.500000000000001?ht=-.0805901581148979:t[224]>1e-35?ht=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?ht=.10842593386554122:t[2]>13.500000000000002?ht=.06466798320378395:ht=-.08578130788886655:ht=-.03590892078300114:ht=.0003499894043880708;let We;t[134]>1e-35?t[6]>50.50000000000001?t[0]>3601.5000000000005?We=.10839808814624702:We=-.028043875308180352:t[7]>30.500000000000004?t[8]>932.5000000000001?We=-.007478368069393829:We=-.09066751344326617:t[0]>3588.5000000000005?t[5]>4748.500000000001?We=.04035247751736232:t[0]>4255.500000000001?We=-.1310865624507367:t[0]>4004.5000000000005?We=.06647367311982634:We=-.08339693352955757:t[4]>10.500000000000002?t[1]>34.50000000000001?We=-.011618902907510411:We=.1114646660406691:t[10]>2.5000000000000004?t[0]>3072.5000000000005?We=.09356028223727986:We=-.03811765057032162:We=-.09456215497345526:t[280]>1e-35?t[7]>70.50000000000001?We=.10322956436499003:t[2]>22.500000000000004?t[1]>83.50000000000001?We=.1146142460964847:t[1]>62.50000000000001?We=-.09679869865322362:t[9]>71.50000000000001?We=-.07377580769927583:t[4]>19.500000000000004?t[0]>4571.500000000001?We=-.039046426387852974:We=.04558778688367152:We=.11220830937352602:t[7]>5.500000000000001?t[9]>17.500000000000004?t[8]>1067.5000000000002?We=.03261697816211156:t[15]>1e-35?We=.02586252542264368:t[2]>14.500000000000002?We=-.016420452667484604:We=-.1011799626006976:We=-.13787471318963773:t[6]>4.500000000000001?t[8]>427.50000000000006?t[10]>36.50000000000001?We=.010193588102560583:We=.11748729525930773:We=-.04468162226743652:We=-.028365274393617957:t[71]>1e-35?We=.05115139346588793:We=-.0001510425316936658;let ae;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ae=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ae=.020637047900190317:ae=-.1017300802134141:t[1]>23.500000000000004?t[9]>12.500000000000002?t[0]>2815.5000000000005?t[0]>3183.5000000000005?t[3]>23.500000000000004?t[3]>45.50000000000001?t[4]>48.50000000000001?ae=-.04632587527094407:ae=.08603684785510396:ae=-.05101401015448496:ae=.025466432054358498:ae=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ae=.020385355430046367:ae=.12032592051335252:ae=-.012387370292173013:t[2]>23.500000000000004?ae=-.12568545484492677:ae=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ae=.043528764484784536:ae=.14352071657196003:ae=-.009332833816977268:ae=.11186782227735846:ae=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ae=-.05649104643152564:ae=.03884200719305747:t[42]>1e-35?ae=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ae=-.04103416502526736:ae=.04881823954656287:t[4]>15.500000000000002?ae=.009342724662897898:t[0]>3969.5000000000005?ae=-.025637309961309498:ae=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ae=-.08185697075265091:t[0]>2215.5000000000005?ae=.030063975892297354:t[0]>807.5000000000001?ae=-.03924325550733229:ae=.0415330999189793:ae=-.00024374664461674863;let Re;t[3]>7.500000000000001?Re=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Re=.025798416259686565:Re=.13251610353146012:Re=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?Re=-.11098564237775424:Re=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?Re=.15347826616466054:t[3]>4.500000000000001?Re=.10379320730958941:Re=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?Re=.03159791088468647:Re=-.10612873364104258:Re=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?Re=-.02335760775001469:Re=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?Re=-.011164334474672973:Re=-.06594044410501655:t[207]>1e-35?Re=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?Re=-.01725821503981916:Re=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?Re=-.04226531631656534:Re=-.14409800530171432:Re=-.03245576341206398:t[8]>4214.500000000001?Re=.0895409165534886:t[247]>1e-35?Re=-.06506383629143335:t[118]>1e-35?Re=-.07214270121257443:t[8]>546.5000000000001?Re=-.004385020865473831:Re=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?Re=.046278501133958524:Re=-.030835570926968044:t[0]>493.50000000000006?Re=-.12794504651610425:Re=.009415039807550776;let Me;t[304]>1e-35?Me=-.04717777269217453:t[76]>1e-35?Me=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Me=-.09648224457374217:t[132]>1e-35?Me=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Me=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Me=.10838431695638147:t[230]>1e-35?Me=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Me=.050071316251979:Me=-.006356941111525215:t[6]>8.500000000000002?Me=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Me=.10217402850540398:Me=-.048840949025349197:Me=-.03668313197909846:t[7]>39.50000000000001?Me=-.0562642841496003:t[10]>2.5000000000000004?Me=.09749777369987417:Me=-.04848223121417616:t[0]>5453.500000000001?Me=.08316648226133942:Me=-.0261979698267618:t[212]>1e-35?Me=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Me=.04837009746506856:Me=-.09184360565631328:Me=.0032411047845613606:t[0]>4733.500000000001?Me=.0977378556864798:Me=.010776545559325588:Me=-.012483310473120218:Me=-.049284121449103935:Me=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Me=-.08380361910948711:Me=.07375088778585813:Me=-.1084864186071348:Me=.0007819503469605476;let ye;t[7]>17.500000000000004?t[115]>1e-35?ye=.08741852531696623:t[167]>1e-35?ye=.10078975495600809:ye=-.0018324767784017562:t[290]>1e-35?ye=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?ye=.1379733311640402:ye=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?ye=-.09360083033774169:ye=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?ye=-.015599362579530679:t[0]>4593.500000000001?ye=-.12029549262691491:ye=-.018917032256501397:ye=.04632831686576592:ye=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?ye=-.05894883236412263:ye=.05213944998315824:ye=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?ye=.07577412405680808:ye=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?ye=-.0277076900736147:t[1]>65.50000000000001?ye=-.023587471585763506:ye=.10184896592433082:ye=-.057699270527916825:ye=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?ye=.06566902102799584:t[10]>25.500000000000004?ye=-.07033633753181047:ye=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?ye=-.08108035861059537:ye=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?ye=-.12431182772561139:ye=.01886235886984271:ye=.0025579594894418116;let oe;t[8]>2915.5000000000005?t[101]>1e-35?oe=.08648323956719083:t[0]>93.50000000000001?t[196]>1e-35?oe=-.09509320772734361:t[4]>1.5000000000000002?t[5]>1106.5000000000002?t[5]>1191.5000000000002?t[283]>1e-35?oe=-.11268313808648661:t[10]>12.500000000000002?t[131]>1e-35?oe=.0687641681341721:t[10]>102.50000000000001?oe=-.09667920080214842:t[4]>15.500000000000002?t[8]>2992.5000000000005?t[1]>24.500000000000004?t[1]>71.50000000000001?oe=-.06762578396473291:t[10]>65.50000000000001?oe=-.05226727783610509:t[282]>1e-35?oe=.09911438410640917:t[19]>1e-35?oe=.06915156336429933:oe=-.006565637886508241:oe=-.08344300251849307:oe=-.0928863907927501:t[1]>60.50000000000001?t[2]>17.500000000000004?oe=.19428463865406298:oe=.016073883020956765:t[13]>1e-35?oe=.06864077097923665:oe=-.01388867527034731:t[0]>1847.5000000000002?oe=.004655280608161356:t[1]>40.50000000000001?oe=.031406054057765996:oe=.12798062439212832:oe=.09859670536264255:t[10]>2.5000000000000004?t[9]>68.50000000000001?oe=.08821759640665892:t[9]>32.50000000000001?t[8]>3960.0000000000005?t[1]>31.500000000000004?oe=-.0706095614785733:oe=.04227164041372561:oe=-.1056906923176064:t[2]>8.500000000000002?t[19]>1e-35?oe=-.07139533369873902:oe=.008952586782921625:oe=.06086212582180936:oe=-.0816938490403437:oe=-.051224901945956025:oe=-.10525399124186095:oe=.000270924147208224;let ze;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?ze=.029186512383291244:t[7]>1.5000000000000002?ze=-.14984127276725573:t[1]>40.50000000000001?ze=.032757060730648144:ze=-.07675575422749602:t[6]>8.500000000000002?ze=.10599766037117893:ze=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?ze=-.051394622947855385:ze=.03237141302699347:ze=.12526173027943244:ze=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?ze=-.07383912482657777:t[0]>5147.500000000001?ze=.07008813937042091:t[10]>38.50000000000001?ze=-.06779203808365307:ze=-.013782769999524498:ze=.0880038869117715:ze=-.12846294176070952:t[281]>1e-35?ze=-.06810806903850834:t[10]>227.50000000000003?ze=-.08937977001661111:t[10]>130.50000000000003?ze=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?ze=.011036530162093841:ze=-.11500797478569702:ze=.03702229366129399:ze=.07242026683784307:t[189]>1e-35?ze=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?ze=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?ze=-.02608892716555304:ze=.09609599320761308:t[9]>105.50000000000001?ze=-.06848127135991534:ze=.0023675721254089715:t[86]>1e-35?ze=-.11049635625500497:ze=-.004847764219432233;let at;t[125]>1e-35?t[0]>3969.5000000000005?at=-.09462233499115416:at=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?at=-.030700661288166148:at=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?at=.03149547314036763:at=-.08166208257451366:t[0]>5850.500000000001?at=-.10228136324773157:t[102]>1e-35?at=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?at=.01782894842128785:t[13]>1e-35?at=.002680190260979968:at=.1773965720476949:t[2]>72.50000000000001?at=.09090831938627947:t[1]>59.50000000000001?at=-.12297206702816128:t[0]>4977.500000000001?at=.09899015653118268:at=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?at=-.0675900954187773:at=.012336403425364092:at=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?at=-.02671721777458802:at=-.09242452991958029:t[284]>1e-35?at=-.08585691288582491:at=.013332890564324447:t[4]>14.500000000000002?at=-.005245022074799553:t[23]>1e-35?at=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?at=-.09289852307936758:t[116]>1e-35?at=-.09686573010015055:t[8]>804.5000000000001?at=.03812547148215318:at=.005162744968176633:t[9]>43.50000000000001?at=-.059246106396159376:at=.050370113808135275:at=.000794041852811028;let Vt;t[3]>7.500000000000001?Vt=.0004981426543104341:t[9]>114.50000000000001?Vt=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Vt=-.019061766497948867:Vt=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Vt=-.006044199577160493:Vt=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Vt=.11486607015912494:t[9]>16.500000000000004?Vt=-.08686820858087294:Vt=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Vt=-.022230207980026437:Vt=.1056683690528792:Vt=-.05859530800943035:Vt=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Vt=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Vt=-.05177544573528314:Vt=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Vt=.15159657923771555:Vt=-.0060542654587671055:t[9]>5.500000000000001?Vt=-.042808028205051786:t[1]>48.50000000000001?Vt=-.010449538258110742:Vt=.10026907521968294:Vt=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Vt=-.02272452389409874:Vt=-.11202691218244319:t[5]>1809.5000000000002?Vt=-.04460413584255906:Vt=.08196329474205256:t[10]>69.50000000000001?Vt=.10221481166238167:Vt=.0004063052701699382:t[243]>1e-35?Vt=-.07563941678849846:t[18]>1e-35?Vt=.02563513231103432:Vt=-.004740081147303786;let gr;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?gr=.057446442918106:gr=-.04404018270156349:gr=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?gr=-.05930486238817954:t[1]>29.500000000000004?gr=.06955866121256543:t[8]>597.5000000000001?gr=-.06538593556505168:gr=.06212512595497445:gr=.00021102929959182257:t[9]>90.50000000000001?gr=.0958061289119631:t[102]>1e-35?gr=.07172059675638813:t[1]>47.50000000000001?gr=-.03879798603977766:t[297]>1e-35?gr=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?gr=.003805910996312012:gr=.09304295674749524:t[11]>1e-35?t[18]>1e-35?gr=.11252376801858695:t[288]>1e-35?gr=-.10293901912180432:gr=.014669268837893872:t[1]>42.50000000000001?gr=-.05988274123836837:t[145]>1e-35?gr=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?gr=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?gr=-.03366718308159971:gr=.11936550608549797:t[1]>31.500000000000004?gr=-.07454716789539667:gr=.027859650621164217:t[10]>10.500000000000002?gr=-.11806374092321247:gr=-.03506042229223101:gr=-.0007080765837654515:t[10]>6.500000000000001?gr=-.028077713664996503:t[2]>7.500000000000001?gr=.15803724124216814:gr=.0351381284833169:gr=-.07877953381054767;let cr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?cr=.14144941521975005:cr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?cr=.10514088112381886:t[7]>18.500000000000004?cr=-.10370643555956745:cr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?cr=-.0508129468802936:t[224]>1e-35?cr=-.037816066368733595:t[10]>43.50000000000001?cr=.07793408602607932:cr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?cr=.036972453794202324:cr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?cr=.09475302525132188:cr=-.03580104945898193:cr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?cr=-.1282448778804823:cr=-.014395808269207212:cr=-.008940927190750592:cr=-.1459118815453748:t[0]>4897.500000000001?cr=-.09733068457286576:t[1]>57.50000000000001?cr=.06575271409540207:cr=-.019556422817450115:cr=-.10623959222984136:t[18]>1e-35?cr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?cr=.008125645893104896:cr=-.11084368630465868:cr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?cr=-.05854904579626861:t[4]>5.500000000000001?cr=.02985784951394175:cr=-.03247600140149334:cr=-.11152899295304973:cr=-.00035424577714215764;let Mr;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Mr=-.06563670567578264:Mr=.067656954313663:Mr=-.10388217548685377:t[8]>2302.5000000000005?Mr=.07190621943790435:t[4]>67.50000000000001?Mr=.060020507643618604:t[4]>38.50000000000001?Mr=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Mr=-.06568134366461277:t[8]>1075.5000000000002?Mr=-.004768057709758692:Mr=.11785959165999467:Mr=-.05080221682879267:Mr=.14814206127494542:Mr=-.07241946332311736:t[253]>1e-35?Mr=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Mr=-.02471195342450034:Mr=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Mr=-.10741850739482771:Mr=.010051635824944:Mr=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Mr=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Mr=-.08992396138178163:Mr=.010944365997007212:Mr=.06221307021813793:Mr=.1286024087559141:t[127]>1e-35?Mr=.06568148624531012:t[10]>40.50000000000001?Mr=-.07567979134643352:t[5]>5647.500000000001?Mr=.07594672895572069:Mr=-.018158016446439187:t[6]>55.50000000000001?Mr=.009293422430111872:t[4]>45.50000000000001?Mr=-.017749818406964022:t[2]>46.50000000000001?Mr=.01714136511113982:Mr=-724762291423549e-19;let Hr;t[1]>24.500000000000004?t[103]>1e-35?t[8]>48.50000000000001?t[17]>1e-35?Hr=-.048689215588703864:t[9]>27.500000000000004?t[0]>3916.5000000000005?Hr=.07084726276890757:Hr=-.11232323677722932:Hr=.04812773089510436:Hr=.11757502216780046:t[5]>1464.5000000000002?t[5]>1505.5000000000002?t[167]>1e-35?Hr=.07470606002425358:t[1]>53.50000000000001?t[132]>1e-35?Hr=.0879462816013881:Hr=-.002966662093626573:t[306]>1e-35?Hr=-.04588085188342676:Hr=.0031910005157084823:t[3]>10.500000000000002?t[10]>20.500000000000004?Hr=-.006600332774461143:Hr=.1272481351557754:Hr=-.09030973597154808:t[284]>1e-35?t[1]>38.50000000000001?t[10]>2.5000000000000004?Hr=.011884312066620044:Hr=.11678751052403374:t[4]>8.500000000000002?Hr=.03627129613273813:Hr=-.12132783497902287:Hr=-.006784372643244717:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Hr=-.06830131718398992:t[0]>5147.500000000001?Hr=.062360406249609306:t[4]>4.500000000000001?Hr=-.013162203864592055:Hr=-.07153029184927609:Hr=.07628618062271557:Hr=-.12085065687320373:t[190]>1e-35?Hr=-.045816889524231186:t[137]>1e-35?Hr=-.07956001795911584:t[199]>1e-35?t[0]>3853.5000000000005?Hr=.025895337822752502:Hr=-.06503949350616421:t[10]>227.50000000000003?Hr=-.09989456525790491:t[10]>130.50000000000003?Hr=.08616651057030683:Hr=.0001234981796706021;let Gr;t[8]>1014.5000000000001?t[9]>137.50000000000003?Gr=-.08778879924617534:t[8]>1022.5000000000001?t[285]>1e-35?t[9]>64.50000000000001?Gr=.04955806187281689:t[0]>3670.5000000000005?t[10]>32.50000000000001?Gr=-.141732381961068:Gr=-.0317152307496497:Gr=-.02074638849097191:t[0]>93.50000000000001?t[0]>3072.5000000000005?t[10]>100.50000000000001?t[4]>24.500000000000004?t[8]>1336.5000000000002?Gr=.12191801556691254:Gr=-.0003444689085397977:Gr=.005739668504631604:t[146]>1e-35?t[308]>1e-35?Gr=.015237524791728777:t[6]>61.50000000000001?t[4]>63.50000000000001?Gr=-.05676033995381961:Gr=.10933961076803381:t[4]>26.500000000000004?Gr=-.11667582544549814:t[8]>1765.5000000000002?Gr=.032174455312047705:Gr=-.0755016390126608:t[293]>1e-35?Gr=-.08234885407658332:t[9]>41.50000000000001?t[0]>3830.5000000000005?Gr=.026571311956824436:t[15]>1e-35?Gr=.06175459479851121:Gr=-.018778084411148754:t[9]>40.50000000000001?Gr=-.09420232889965811:Gr=-.004578248021263184:t[2]>1.5000000000000002?Gr=.005453714644971445:Gr=-.03907138175699279:Gr=-.055296364182154736:t[23]>1e-35?Gr=.036555134842143476:t[0]>4188.500000000001?t[6]>29.500000000000004?Gr=-.09358146510580179:Gr=.060524657996178094:Gr=-.11245101144669545:t[125]>1e-35?t[9]>1.5000000000000002?Gr=-.12698331085931538:Gr=.006059605604079918:t[2]>196.50000000000003?Gr=-.09451315810804783:Gr=.0011390147031687425;let Yt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?Yt=.05517359070460923:Yt=-.04758751221404857:Yt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?Yt=.1040436595565776:t[9]>21.500000000000004?Yt=.04032250517675179:t[107]>1e-35?Yt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?Yt=.1192453009230486:t[1]>51.50000000000001?Yt=.0443376336292195:Yt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?Yt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?Yt=-.08999822408398037:Yt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?Yt=-.061850439226075:Yt=.08849196353361093:Yt=.10536348167793089:t[92]>1e-35?Yt=.04894947712119185:t[9]>16.500000000000004?Yt=.05900227903883853:t[9]>5.500000000000001?Yt=-.11946594348916476:Yt=-.03652096348071964:t[1]>41.50000000000001?Yt=-.07411603110840567:Yt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?Yt=.08493634342741495:t[11]>1e-35?Yt=-.10899097825564363:Yt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?Yt=.08356655906359918:t[7]>25.500000000000004?Yt=-.09475076526194888:t[10]>5.500000000000001?Yt=-.01999406228763778:Yt=.06696212545889428:t[6]>20.500000000000004?Yt=.14713592661393468:Yt=.0459917279002218:Yt=.00027445928493734093;let _r;t[223]>1e-35?t[1]>31.500000000000004?t[8]>634.5000000000001?_r=-.06904501553217077:_r=.05696231672035904:_r=-.1124703178077813:t[99]>1e-35?t[1]>89.50000000000001?_r=-.05074261170009721:t[1]>57.50000000000001?t[8]>969.5000000000001?_r=-.011419256378538392:t[0]>3830.5000000000005?_r=.140315841503076:_r=.02403434913963024:t[1]>31.500000000000004?t[8]>65.50000000000001?t[2]>10.500000000000002?_r=-.04027822909411164:_r=.03176085103667189:_r=.06779515865838849:t[4]>15.500000000000002?_r=.0762878389015175:t[8]>175.50000000000003?t[0]>3030.5000000000005?t[8]>1041.5000000000002?_r=.06124039747298539:_r=-.04312732764434027:_r=.09161522761808062:_r=-.09663512235460074:t[280]>1e-35?t[6]>45.50000000000001?t[1]>46.50000000000001?_r=.11211681010488772:t[13]>1e-35?_r=.06725735814960367:_r=-.046744031455827846:t[10]>44.50000000000001?t[0]>3400.5000000000005?t[0]>4004.5000000000005?t[2]>22.500000000000004?_r=.11743605068905603:_r=-.011309033539148687:_r=-.07896094707523052:_r=.12862714793172117:t[10]>1.5000000000000002?t[8]>455.50000000000006?t[0]>4706.500000000001?_r=-.09218756798869711:t[10]>19.500000000000004?t[0]>1894.5000000000002?t[0]>3719.5000000000005?_r=.02836295848998302:_r=.12210680366745175:_r=-.058302317470509096:t[5]>4144.500000000001?_r=.06123341960495106:_r=-.03840046906926525:_r=-.05221474543453495:_r=.03988215485860711:_r=-.00033074684693083496;let $0=ofc(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+E+_+v+b+T+w+R+x+P+D+N+L+B+q+M+O+j+Q+U+Y+W+V+z+ie+H+re+le+Le+ge+Ue+ke+X+ee+K+he+Z+ue+qe+ne+ce+Ne+we+Be+rt+st+_t+Dt+$t+Gt+Ie+F+be+Qe+pe+Se+Fe+te+Te+Ge+J+se+me+Ce+He+$e+et+ct+bt+ht+We+ae+Re+Me+ye+oe+ze+at+Vt+gr+cr+Mr+Hr+Gr+Yt+_r);return[1-$0,$0]}a(ifc,"multilineModelPredict");function ofc(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(ofc,"sigmoid")});var ALi=I(j$=>{"use strict";p();Object.defineProperty(j$,"__esModule",{value:!0});j$.MultilineModelFeatures=j$.PromptFeatures=void 0;j$.hasComment=p2r;j$.requestMultilineScore=lfc;var q$=hLi(),sfc=mLi(),afc={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},gLi={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function p2r(t,e,r,n=!0){let o=t.split(` -`);if(n&&(o=o.filter(l=>l.trim().length>0)),Math.abs(e)>o.length||e>=o.length)return!1;e<0&&(e=o.length+e);let s=o[e];return(afc[r]??[]).some(l=>s.includes(l))}a(p2r,"hasComment");var NLe=class{static{a(this,"PromptFeatures")}constructor(e,r){let[n,o]=this.firstAndLast(e),s=this.firstAndLast(e.trimEnd());this.language=r,this.length=e.length,this.firstLineLength=n.length,this.lastLineLength=o.length,this.lastLineRstripLength=o.trimEnd().length,this.lastLineStripLength=o.trim().length,this.rstripLength=e.trimEnd().length,this.stripLength=e.trim().length,this.rstripLastLineLength=s[1].length,this.rstripLastLineStripLength=s[1].trim().length,this.secondToLastLineHasComment=p2r(e,-2,r),this.rstripSecondToLastLineHasComment=p2r(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` +`)[0]}return r}a(i3i,"makeGhostAPIChoice");function sDr(t,e,r,n,o){let s=Date.now()-n,c=s-o,l=r.telemetryData.extendedBy({},{completionCharLen:r.completionText.length,requestTimeMs:s,processingTimeMs:o,deltaMs:c,meanLogProb:r.meanLogProb||NaN,meanAlternativeLogProb:r.meanAlternativeLogProb||NaN});l.extendWithRequestId(r.requestId),(0,Thc.telemetry)(t,`ghostText.${e}`,l)}a(sDr,"telemetryPerformance")});var s3i=I(Z_t=>{"use strict";p();Object.defineProperty(Z_t,"__esModule",{value:!0});Z_t.contextualFilterCharacterMap=void 0;Z_t.contextualFilterCharacterMap={" ":1,"!":2,'"':3,"#":4,$:5,"%":6,"&":7,"'":8,"(":9,")":10,"*":11,"+":12,",":13,"-":14,".":15,"/":16,0:17,1:18,2:19,3:20,4:21,5:22,6:23,7:24,8:25,9:26,":":27,";":28,"<":29,"=":30,">":31,"?":32,"@":33,A:34,B:35,C:36,D:37,E:38,F:39,G:40,H:41,I:42,J:43,K:44,L:45,M:46,N:47,O:48,P:49,Q:50,R:51,S:52,T:53,U:54,V:55,W:56,X:57,Y:58,Z:59,"[":60,"\\":61,"]":62,"^":63,_:64,"`":65,a:66,b:67,c:68,d:69,e:70,f:71,g:72,h:73,i:74,j:75,k:76,l:77,m:78,n:79,o:80,p:81,q:82,r:83,s:84,t:85,u:86,v:87,w:88,x:89,y:90,z:91,"{":92,"|":93,"}":94,"~":95}});var a3i=I(aDr=>{"use strict";p();Object.defineProperty(aDr,"__esModule",{value:!0});aDr.multilineModelPredict=Rhc;function Rhc(t){let e;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>427.50000000000006?t[9]>13.500000000000002?t[121]>1e-35?e=-.3793786744885956:t[149]>1e-35?e=-.34717430705356905:e=-.26126834451035963:e=-.2431318366096852:t[5]>888.5000000000001?e=-.20600463586387135:e=-.2568037008471491:t[308]>1e-35?e=-.2363064824497454:t[8]>370.50000000000006?e=-.37470755210284723:e=-.321978453730494:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?e=-.26259136509758885:e=-.3096719634039438:t[4]>30.500000000000004?t[9]>18.500000000000004?e=-.34254903852890883:t[2]>98.50000000000001?e=-.41585250791146294:e=-.3673574858887241:t[9]>6.500000000000001?e=-.31688079287876225:t[31]>1e-35?e=-.29110977864003823:t[308]>1e-35?e=-.3201411739040839:e=-.36874023066055506:t[8]>691.5000000000001?t[82]>1e-35?e=-.41318393149040566:t[133]>1e-35?e=-.3741272613525161:t[32]>1e-35?e=-.4112378041027121:t[227]>1e-35?e=-.37726615155719356:t[10]>3.5000000000000004?e=-.3164502293560397:e=-.2930071546509045:t[9]>13.500000000000002?e=-.277366858539218:t[308]>1e-35?t[4]>10.500000000000002?e=-.30975610686807187:t[4]>1.5000000000000002?e=-.2549142136728043:e=-.3271325650785176:t[127]>1e-35?t[0]>1937.5000000000002?e=-.2533046188098832:e=-.325520883579:e=-.331628896481776;let r;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?t[9]>13.500000000000002?r=.031231253521808708:r=.05380836288014532:t[5]>423.00000000000006?t[8]>114.50000000000001?r=.06751619128429062:r=.09625089153176467:r=.027268163053989804:t[308]>1e-35?r=.060174483556283756:r=-.049062854038919135:t[3]>24.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?r=-.03969241799174589:r=.01086816842550381:t[31]>1e-35?r=-.003284694817583201:t[9]>6.500000000000001?t[4]>30.500000000000004?r=-.04224490699947552:r=-.011834162944360616:t[308]>1e-35?t[32]>1e-35?r=-.13448447971850278:r=-.019569456707046823:t[19]>1e-35?t[9]>1.5000000000000002?r=-.07256260662659254:t[4]>60.50000000000001?r=-.08227503453609311:r=-.020596416747563847:r=-.07396549241564149:t[8]>691.5000000000001?t[82]>1e-35?r=-.10046536995362734:t[133]>1e-35?r=-.06407649822752297:t[225]>1e-35?r=.08035785003303324:t[92]>1e-35?r=.018901360933204676:t[20]>1e-35?r=.05252546973665552:t[8]>2592.5000000000005?r=-.040543705016462955:r=-.011236043818320725:t[9]>17.500000000000004?r=.025560632674895334:t[308]>1e-35?t[0]>1847.5000000000002?r=.03527165701669741:r=-.0071847350825815035:t[127]>1e-35?r=.024373016379595405:t[9]>2.5000000000000004?r=-.0035090719709448288:r=-.03514829488063766;let n;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?n=.03848674861536988:t[5]>423.00000000000006?t[8]>114.50000000000001?t[9]>56.50000000000001?n=-.003764520033319488:n=.06570817919969299:t[4]>61.50000000000001?n=.028346156293069538:n=.0908154644362606:n=.02445594243234816:t[308]>1e-35?t[8]>65.50000000000001?n=.0019305229020073053:n=.09279357295883772:n=-.04458984161917124:t[3]>24.500000000000004?t[23]>1e-35?n=.0027405390271277013:t[4]>29.500000000000004?t[52]>1e-35?n=.044727478132905285:t[115]>1e-35?n=.10245804828855934:t[9]>17.500000000000004?n=-.03353173647469207:t[2]>98.50000000000001?n=-.10048106638102179:n=-.05484231104348874:t[31]>1e-35?n=.016807537467116516:t[9]>6.500000000000001?n=-.012113620535295137:t[4]>8.500000000000002?t[308]>1e-35?n=-.01882594250504289:n=-.05585658862796076:n=.04279591277938338:t[8]>691.5000000000001?t[82]>1e-35?n=-.09262278043707878:t[133]>1e-35?n=-.058454257768893625:t[32]>1e-35?n=-.09769348447126434:t[25]>1e-35?n=-.0725430043727677:t[122]>1e-35?n=-.10047841601578077:n=-.00580671054458958:t[9]>13.500000000000002?n=.021399199032818294:t[308]>1e-35?t[4]>10.500000000000002?n=-.0076376731757173515:n=.03394923033036848:t[127]>1e-35?n=.02070489091204209:n=-.02290162726126496;let o;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?o=.010230295672324606:o=.038540509248742805:t[8]>125.50000000000001?t[1]>49.50000000000001?o=.03086356292895467:o=.057128750867458604:t[5]>888.5000000000001?o=.07861602941396924:o=.030523262699070908:t[308]>1e-35?o=.048236117667577356:t[8]>370.50000000000006?o=-.05642125069212264:o=-.007232836777168195:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?o=.03640661467213915:o=-.005889820723907028:t[31]>1e-35?o=-.0009007166998276938:t[9]>6.500000000000001?o=-.022590340093882378:t[308]>1e-35?t[32]>1e-35?o=-.1215445089091064:o=-.01435612266219722:t[19]>1e-35?t[9]>1.5000000000000002?o=-.061555513040777825:t[4]>60.50000000000001?o=-.07053475504569347:o=-.013733369453963092:o=-.06302097189114152:t[227]>1e-35?o=-.05820440333190048:t[8]>683.5000000000001?t[82]>1e-35?o=-.08466979526809346:t[10]>24.500000000000004?o=-.017092159721119944:t[92]>1e-35?o=.03592901452463749:o=-.00359310519524756:t[5]>1809.5000000000002?t[243]>1e-35?o=-.03963116207386097:t[118]>1e-35?o=-.09483996283536394:t[217]>1e-35?o=-.03394542089519989:t[242]>1e-35?o=-.07985899422287938:o=.019706602160656964:t[9]>12.500000000000002?o=.014072998937735146:o=-.021156294523894684;let s;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?s=.009197756540516563:s=.03458896869535166:t[5]>5082.500000000001?s=.08265545468131008:t[131]>1e-35?s=.0740738432473315:s=.045159136632942756:t[8]>319.50000000000006?s=-.04653401534465376:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?s=-.011400839766681709:s=.11149800187510031:s=-.08683250977599462:s=.08355310136724753:t[4]>23.500000000000004?t[23]>1e-35?t[131]>1e-35?s=.040389083779932555:s=-.009887614274108602:t[52]>1e-35?s=.03705353499757327:t[9]>6.500000000000001?s=-.025401260429257562:t[2]>98.50000000000001?s=-.09237673187534504:s=-.04298556869281803:t[222]>1e-35?s=-.045221965895986184:t[8]>691.5000000000001?t[133]>1e-35?s=-.05435318330148897:t[128]>1e-35?s=-.08672907303184191:t[227]>1e-35?s=-.05568304584186561:t[122]>1e-35?s=-.09623059693538563:t[225]>1e-35?s=.07558331642202279:t[82]>1e-35?s=-.07360566227233566:s=-.005646164647395919:t[242]>1e-35?s=-.08203758341228108:t[9]>13.500000000000002?s=.018726123829696042:t[308]>1e-35?t[4]>10.500000000000002?s=-.011153942154062704:s=.03132858912391067:t[127]>1e-35?s=.021455228822345174:t[23]>1e-35?s=.01959966745346997:s=-.021764790177579325;let c;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>284.50000000000006?t[121]>1e-35?t[18]>1e-35?c=.07547602514276922:c=-.08529678832140396:c=.030314822344598043:t[5]>888.5000000000001?t[4]>61.50000000000001?c=.011143589009415464:c=.0654700456802118:c=.021794712646632755:t[308]>1e-35?c=.04231872551095028:c=-.034381999950549455:t[4]>23.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?c=-.03678981254332261:c=.010518160384496255:t[8]>825.5000000000001?c=-.04506534842082387:t[9]>38.50000000000001?c=.01004983052203438:c=-.030580958620701027:t[39]>1e-35?c=-.12802435021505382:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>6.500000000000001?c=.030426957004611704:c=-.0726407693060581:c=.017395521646964375:t[4]>7.500000000000001?t[0]>93.50000000000001?t[9]>7.500000000000001?c=-.008024349629981291:t[31]>1e-35?c=.01296539930850471:t[308]>1e-35?c=-.012855016509024084:c=-.04564527976851505:c=-.15681420504058596:t[10]>4.500000000000001?t[243]>1e-35?c=-.1012064426380198:c=-.0062808850924854194:c=.030706323726162416:t[9]>13.500000000000002?c=.017081636133736405:t[308]>1e-35?t[4]>10.500000000000002?c=-.009306613091760644:t[4]>1.5000000000000002?c=.03655523200850989:c=-.02671654212893341:t[127]>1e-35?c=.019261510468604387:c=-.017627818570628936;let l;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[308]>1e-35?l=.036100405995889276:l=.011709313297015793:t[0]>119.50000000000001?t[8]>125.50000000000001?l=.03622542297472574:l=.05595579157301536:l=-.02234751038146796:t[8]>319.50000000000006?l=-.040132029478400735:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?l=-.009306153573847916:l=.10058509567064988:l=-.0785668890966017:t[9]>28.500000000000004?l=-.04781977604130416:l=.09753292614937459:t[4]>23.500000000000004?t[131]>1e-35?l=.02372493254975127:t[148]>1e-35?l=.028103095989516644:t[4]>58.50000000000001?t[10]>1e-35?l=-.05000852203469597:l=.02922366846119705:t[23]>1e-35?l=-.0026335076988151292:l=-.03073993752935585:t[222]>1e-35?l=-.03867374428185713:t[32]>1e-35?l=-.07220729365053084:t[39]>1e-35?l=-.11624524614351733:t[8]>691.5000000000001?t[133]>1e-35?l=-.04836360271198036:t[8]>4968.500000000001?l=-.10873681915578029:t[149]>1e-35?l=-.11847484033769298:t[122]>1e-35?l=-.08916172460307559:t[82]>1e-35?l=-.06774726602152634:l=-.0033469147714351327:t[126]>1e-35?l=-.09474445392080015:t[8]>131.50000000000003?t[118]>1e-35?l=-.09002547031023511:l=.015475385187009489:t[25]>1e-35?l=-.08175501232759151:l=-.000429679055394914;let u;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?u=.021942996005324917:u=.042349138084484074:t[308]>1e-35?u=.036507270845732874:u=-.028981850556764995:t[3]>24.500000000000004?t[23]>1e-35?u=.00210930790963475:t[31]>1e-35?u=.006825358293027163:t[9]>6.500000000000001?u=-.013772084269062394:t[308]>1e-35?u=-.008307929099892574:t[19]>1e-35?u=-.027706313312904487:u=-.04891108984170914:t[134]>1e-35?u=-.0605730733844732:t[25]>1e-35?u=-.05347926493253117:t[227]>1e-35?u=-.049415829249003666:t[32]>1e-35?u=-.06807799662179595:t[308]>1e-35?t[4]>10.500000000000002?t[2]>13.500000000000002?u=-.00016302718260794637:u=-.10247095758122947:t[210]>1e-35?u=-.022149002072787024:t[95]>1e-35?u=.15222631630626304:u=.027393884520465712:t[9]>7.500000000000001?t[225]>1e-35?u=.13483346577752245:t[3]>9.500000000000002?t[243]>1e-35?u=-.045352728133789516:t[8]>683.5000000000001?u=.00474372227519902:u=.02635476098707525:t[92]>1e-35?u=.05659380819933452:t[105]>1e-35?u=.07431443210341222:t[186]>1e-35?u=.0915821133384904:u=-.016414750130401053:t[127]>1e-35?u=.011824693641866162:t[23]>1e-35?u=.0228468674288774:t[284]>1e-35?u=.06606936863302432:u=-.02872463273902358;let d;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>125.50000000000001?t[288]>1e-35?d=-.019844363904157558:t[1]>50.50000000000001?t[131]>1e-35?d=.044961338592245194:d=.003659599513761676:t[121]>1e-35?d=-.04057103630479994:d=.03158560697078578:t[0]>421.50000000000006?t[4]>61.50000000000001?d=-.0003708603406529278:d=.05331312264472391:d=.0006575958601218936:t[8]>319.50000000000006?d=-.034654694051901545:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?d=-.0076053515916517005:d=.09116695486305336:d=-.07137458699162028:d=.06633130654035282:t[4]>29.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?d=-.0308520802187302:d=.013156423968295541:t[115]>1e-35?d=.11581171687488252:t[52]>1e-35?t[10]>22.500000000000004?d=.12264179915175587:d=-.021905727233873535:t[8]>799.5000000000001?d=-.04181869575935412:d=-.023695901673350575:t[222]>1e-35?d=-.034612899265371776:t[8]>691.5000000000001?t[9]>98.50000000000001?d=-.06892116536821917:t[149]>1e-35?d=-.11194586444154514:t[133]>1e-35?d=-.04269583234000504:t[128]>1e-35?d=-.0644631966969502:t[8]>4968.500000000001?d=-.09650726096330133:d=-.004219129180139438:t[126]>1e-35?d=-.08038306745347751:t[5]>1809.5000000000002?d=.009265335288169993:t[9]>2.5000000000000004?d=.006447645462117438:d=-.021047132609551503;let f;t[13]>1e-35?t[3]>1.5000000000000002?t[9]>21.500000000000004?t[121]>1e-35?f=-.08436540015142402:t[8]>1861.5000000000002?f=-.01621425699342421:f=.01878613821895428:f=.031052879158242532:t[8]>319.50000000000006?f=-.031536619360997865:t[7]>3.5000000000000004?f=-.004510586962343298:f=.0596524941011746:t[4]>18.500000000000004?t[23]>1e-35?f=.004757490541310808:t[9]>6.500000000000001?f=-.008842393772207996:t[31]>1e-35?f=.0010536183837006993:t[308]>1e-35?f=-.008145882815435419:t[2]>98.50000000000001?f=-.08404937622173021:t[276]>1e-35?f=.0020072791321856663:t[19]>1e-35?f=-.023031820639490178:f=-.04553314326377875:t[8]>2134.5000000000005?f=-.02244583113572251:t[134]>1e-35?f=-.05592137394753121:t[308]>1e-35?t[49]>1e-35?f=.09989109704064947:t[4]>10.500000000000002?t[2]>13.500000000000002?f=-.00447733056482096:f=-.10191061664873849:f=.021765308380331864:t[9]>7.500000000000001?t[118]>1e-35?f=-.07570059131536411:t[243]>1e-35?f=-.040983393346598646:t[3]>9.500000000000002?f=.014763759061483812:t[92]>1e-35?f=.05136368898963024:f=-.008162398981149495:t[127]>1e-35?f=.013999119696708346:t[23]>1e-35?t[20]>1e-35?f=.14138985500120907:f=.008668274102844162:t[284]>1e-35?f=.06356484011042893:f=-.024781304572706303;let h;t[13]>1e-35?t[3]>8.500000000000002?t[8]>892.5000000000001?t[0]>384.50000000000006?h=.014387526569215037:t[8]>2266.5000000000005?h=-.1397298649743087:h=.007953931014097788:t[0]>119.50000000000001?t[4]>61.50000000000001?h=.0029819092211896296:t[218]>1e-35?h=.08450459375645737:h=.031646488019280654:h=-.03544960151460596:t[9]>9.500000000000002?h=-.026002317735915183:t[7]>1.5000000000000002?h=.005074258810794793:h=.0745247650477651:t[4]>29.500000000000004?t[131]>1e-35?h=.023269218675640847:t[148]>1e-35?h=.03812942399144545:t[115]>1e-35?h=.10512283476967227:h=-.02607307479736138:t[227]>1e-35?h=-.036576708299046294:t[101]>1e-35?h=.027948683650881864:t[149]>1e-35?h=-.08195628451594297:t[50]>1e-35?h=-.16997544922278504:t[8]>691.5000000000001?t[9]>101.50000000000001?h=-.06860333850762075:t[225]>1e-35?h=.06066641950951723:t[10]>22.500000000000004?t[1]>29.500000000000004?t[127]>1e-35?h=.028599705845427533:h=-.010746719511640914:t[0]>4877.500000000001?h=-.07251187886096228:h=-.021299712241446785:t[118]>1e-35?h=-.11902023760964736:h=15874469526809387e-21:t[8]>267.50000000000006?h=.01317292185402293:t[148]>1e-35?t[9]>20.500000000000004?h=.09614842415142123:h=.006049073167176467:t[189]>1e-35?h=.05562696451900713:h=-.006257541923837303;let m;t[13]>1e-35?t[9]>14.500000000000002?t[2]>11.500000000000002?t[1]>71.50000000000001?t[8]>1252.5000000000002?m=-.10069846585436666:m=-.010577995535809317:t[146]>1e-35?m=-.008877238274428668:t[280]>1e-35?m=.10076055897012692:t[6]>70.50000000000001?m=-.020603523042565547:t[7]>1.5000000000000002?m=.02819095420813202:m=-.1223354167911277:m=-.025073583348334844:t[8]>416.50000000000006?m=.01718560189149466:t[230]>1e-35?m=.12281803224342265:m=.03281276971308565:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?m=-.13070568109867683:t[4]>63.50000000000001?m=-.027221825262496814:m=.01530862490082352:t[9]>6.500000000000001?t[5]>4320.500000000001?t[2]>31.500000000000004?m=-.00605574271293711:m=.04739407327741249:m=-.012537528620315956:t[31]>1e-35?t[20]>1e-35?m=.1252215087035768:m=.003905888677601057:t[52]>1e-35?m=.045466299731038815:t[2]>100.50000000000001?m=-.07815624550168065:t[308]>1e-35?m=-.007715815250508057:t[276]>1e-35?t[9]>1.5000000000000002?m=-.03538265083203445:t[18]>1e-35?m=.1591211669800727:m=.015151475408241136:t[8]>557.5000000000001?m=-.04225569725456342:m=-.022455546324243267:t[308]>1e-35?m=.01325441736085826:t[197]>1e-35?m=.03752194600682512:t[225]>1e-35?m=.06583712394533976:m=-.005205289866839043;let g;t[13]>1e-35?t[9]>21.500000000000004?t[2]>12.500000000000002?g=.010264022580774884:g=-.02335958814489217:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?g=-.0936747137352166:t[0]>384.50000000000006?g=.019846244507320695:g=-.0751102554077272:g=-.026885329334203723:t[0]>966.5000000000001?t[10]>48.50000000000001?g=.11654906890054273:g=.0346250587613322:t[4]>39.50000000000001?g=-.08568002378645614:t[9]>16.500000000000004?g=-.12010535752923689:g=.021321923389033808:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?g=-.12056431231412057:t[131]>1e-35?g=.03652965550568472:g=.002563006128791669:t[9]>6.500000000000001?t[30]>1e-35?g=-.10141481732178981:g=-.003936457893178248:t[31]>1e-35?g=.008215898756249477:t[52]>1e-35?t[0]>4188.500000000001?g=.12972828769588213:g=-.003137412232297087:t[2]>100.50000000000001?g=-.0730872929087944:t[308]>1e-35?g=-.006958622747243333:t[35]>1e-35?t[0]>3707.5000000000005?g=.07934620723812878:g=-.018598568353702116:g=-.030635505446410763:t[128]>1e-35?g=-.06962290453843294:t[84]>1e-35?g=-.15290337844960322:t[308]>1e-35?t[8]>2543.5000000000005?g=-.034938657503885584:g=.016339322898966915:t[197]>1e-35?g=.03358907965870046:t[18]>1e-35?g=-.01754013791515288:g=-.0004944586067698557;let A;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?A=.005888790687820524:A=.0429676533834978:t[2]>7.500000000000001?t[0]>119.50000000000001?t[6]>79.50000000000001?A=-.0224319889201976:t[212]>1e-35?A=.06249587051783863:t[8]>963.5000000000001?t[8]>1156.5000000000002?A=.010357273289123324:A=-.029749145161304082:t[218]>1e-35?A=.06449336340743606:A=.018047654539345502:A=-.07350502390293116:A=-.019594829995832414:t[4]>39.50000000000001?A=-.019338083179859314:t[39]>1e-35?A=-.10427066919173111:t[222]>1e-35?t[0]>612.5000000000001?A=-.019197415255018464:A=-.0836562507048181:t[149]>1e-35?A=-.07679624472577429:t[32]>1e-35?A=-.05097506748590604:t[191]>1e-35?A=.04670476485250936:t[30]>1e-35?A=-.05313073892148652:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>8.500000000000002?A=.03930363008271334:A=-.06029171685615689:A=.016203086182431294:t[4]>7.500000000000001?A=-.013824248237085224:t[10]>4.500000000000001?t[94]>1e-35?A=-.09817668643367765:t[10]>40.50000000000001?A=-.023558078753593125:A=.0065113494780482326:t[8]>809.5000000000001?t[297]>1e-35?A=-.1352063548573715:A=.058203900441270634:A=-.035243959159285736:t[10]>59.50000000000001?t[1]>43.50000000000001?A=-.012552876807800442:A=.05991247777734298:A=.0035893102109330177;let y;t[13]>1e-35?t[9]>21.500000000000004?t[145]>1e-35?y=.03507251990078782:t[2]>14.500000000000002?y=.004905698363309292:t[8]>2421.5000000000005?y=-.10306119951984316:y=-.018951037816654928:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?y=-.08503171085833393:y=.015130974593044409:y=-.024425267075198206:y=.02624054905103126:t[4]>19.500000000000004?t[131]>1e-35?y=.02100191580704534:t[32]>1e-35?t[8]>2302.5000000000005?y=.09908783187786288:y=-.06920877329925636:t[8]>241.50000000000003?y=-.016756131804203496:t[9]>33.50000000000001?y=.04903179955263626:t[217]>1e-35?y=-.047416847619291644:y=-.0017200891991431119:t[39]>1e-35?y=-.10389927604977028:t[134]>1e-35?y=-.050480365434872866:t[178]>1e-35?y=-.05167855791556937:t[8]>2134.5000000000005?y=-.01663197335585307:t[242]>1e-35?y=-.05361323756615453:t[118]>1e-35?y=-.05299780866211368:t[10]>24.500000000000004?t[10]>55.50000000000001?t[8]>764.5000000000001?y=-.0016544848369620534:y=.04494144460483587:y=-.009283616456736156:t[121]>1e-35?t[0]>4463.500000000001?y=.051166688553608355:y=-.06623908820705383:t[84]>1e-35?y=-.12990936092409747:t[306]>1e-35?y=-.07020596855118943:t[49]>1e-35?y=.06272964802556856:t[192]>1e-35?y=.06540204627162581:y=.008277910531592885;let E;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?E=.003325460510319164:E=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?E=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?E=.0697359767152808:t[230]>1e-35?E=.06513506845651572:E=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?E=.013616385013146277:E=.04171540100223404:E=-.04360396575094823:t[212]>1e-35?E=.025945477945627522:E=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?E=-.07856453318384411:E=-.014803893522351739:t[39]>1e-35?E=-.09185452630751932:t[149]>1e-35?E=-.07122426086157027:t[134]>1e-35?E=-.04231052091434186:t[227]>1e-35?E=-.029815824273994197:t[50]>1e-35?E=-.15736496271211153:t[222]>1e-35?E=-.02360285356956629:t[128]>1e-35?E=-.03922080193836443:t[136]>1e-35?E=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?E=-.0029736170756835783:E=-.06482902102259112:t[84]>1e-35?E=-.11340924635708383:t[94]>1e-35?E=-.03635703457792193:t[118]>1e-35?E=-.058181913914186034:t[126]>1e-35?E=-.062030576241517366:t[116]>1e-35?E=-.045086301850604006:t[25]>1e-35?E=-.031665223656767286:t[203]>1e-35?E=-.009444685731407691:E=.0112265153772187;let _;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?_=.022717227245241684:_=-.049700413274686266:_=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?_=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?_=-.12263724050601095:_=.0070743478891288035:t[288]>1e-35?_=-.050439138582109:_=.0255701593657891:_=-.005812703740580558:t[6]>49.50000000000001?_=-.008542694147899113:_=.035147383686665:_=-.0960461939274094:t[32]>1e-35?_=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?_=-.01800870272656664:_=-.07817304234604389:t[30]>1e-35?_=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?_=.08778416018479411:_=-.026563982720830256:_=-.05296139548112329:t[50]>1e-35?_=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?_=-.036572140520852024:t[183]>1e-35?_=-.10766853736801459:_=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?_=.09513215942486053:_=-.03641865277445567:t[10]>59.50000000000001?_=.03177172388687933:t[39]>1e-35?_=-.10234241303898953:t[243]>1e-35?_=-.02966738115984321:t[190]>1e-35?_=-.04312785336449181:t[118]>1e-35?_=-.05808521194081524:_=.006720381600740378;let v;t[308]>1e-35?t[5]>423.00000000000006?t[133]>1e-35?v=-.046284053681928526:t[210]>1e-35?v=49778070699847876e-21:t[13]>1e-35?v=.03328070054739309:t[128]>1e-35?v=-.054790214922938896:t[126]>1e-35?v=-.08524792218532945:v=.014414055975542446:t[1]>38.50000000000001?v=-.07287851335872973:v=.005263371501687163:t[9]>7.500000000000001?t[21]>1e-35?t[10]>4.500000000000001?v=-.12459748864088374:v=-.004626323021331593:t[298]>1e-35?t[4]>64.50000000000001?v=.13044981041138526:t[9]>71.50000000000001?v=-.056068402282406865:t[9]>12.500000000000002?v=.038957722962512764:v=-.04598815982492169:t[8]>691.5000000000001?t[126]>1e-35?v=-.0852126122372075:t[225]>1e-35?v=.10082066771689505:t[1]>161.50000000000003?v=-.11609832500613824:t[3]>8.500000000000002?t[8]>1685.5000000000002?v=-.010835400874777133:v=.004607419973807752:v=-.016989075258564062:v=.009205417251698097:t[23]>1e-35?t[20]>1e-35?v=.10184317139657878:t[0]>5724.500000000001?v=-.1163666496650542:t[1]>106.50000000000001?v=.1303850608190687:t[129]>1e-35?v=.10745031509534769:v=.006166901738036226:t[31]>1e-35?v=.010177092833155127:t[13]>1e-35?t[0]>213.50000000000003?v=.005004582564506611:v=-.10481581731668346:t[19]>1e-35?v=-.009850706427306281:v=-.02608226348051303;let b;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?b=-.0024117174588695603:b=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?b=.04575380761203418:b=-.10025595041353463:t[15]>1e-35?b=.17705790384964004:b=.0073813837628615014:b=.07676373681392407:b=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?b=.07078572910026419:t[4]>23.500000000000004?b=.005513918674164821:b=.0206586476926392:t[0]>5269.500000000001?b=.07706773525822633:b=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?b=-.03204783603215824:b=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?b=-.0930246911392012:b=.011173087289703683:t[3]>24.500000000000004?b=.03281421918878597:b=.12449335091369843:t[204]>1e-35?b=.06634531187326123:b=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?b=-.041196758517013515:t[4]>7.500000000000001?b=-2942718111029724e-20:t[4]>6.500000000000001?b=.11953909558532852:b=.03188615019450534:t[122]>1e-35?b=-.0616037324662157:t[101]>1e-35?b=.027230889593349412:t[8]>4968.500000000001?b=-.1113986516540856:t[3]>2.5000000000000004?b=-.002045140426885727:t[129]>1e-35?b=.12641163374304432:b=.014909826232873194;let T;t[308]>1e-35?t[0]>7277.500000000001?T=-.09337446795435:t[5]>423.00000000000006?t[133]>1e-35?T=-.040884836258675006:t[210]>1e-35?T=-.0003719413278428804:t[13]>1e-35?T=.030287610160818174:T=.011174130013595384:t[1]>38.50000000000001?T=-.0662442170185784:T=.004332185707008564:t[9]>7.500000000000001?t[145]>1e-35?t[285]>1e-35?T=-.08092286307197555:T=.029866363328584986:t[21]>1e-35?t[10]>4.500000000000001?T=-.1155211149523894:T=-.0032903546638958538:t[149]>1e-35?T=-.03632198993199768:t[3]>9.500000000000002?t[8]>999.5000000000001?T=-.003507023626534306:t[128]>1e-35?t[4]>13.500000000000002?t[0]>3459.5000000000005?T=-.025416927789760076:T=.02777568919793122:T=-.10310351509769732:T=.013549608903688785:t[186]>1e-35?T=.08513865847420551:T=-.009306721292510369:t[31]>1e-35?T=.009780833952582307:t[23]>1e-35?T=.011143773934157629:t[210]>1e-35?T=.025354797285173356:t[17]>1e-35?t[10]>3.5000000000000004?T=-.04846287537743046:T=-.014647271080376757:t[2]>5.500000000000001?t[7]>57.50000000000001?T=-.034224938681445764:t[8]>1641.5000000000002?T=-.027298372075800673:t[191]>1e-35?t[10]>18.500000000000004?T=-.027950103994861836:T=.14575930827829034:T=-.007124740389354946:t[10]>22.500000000000004?T=.013173304107866726:T=-.11119620042551365;let w;t[131]>1e-35?w=.01892225243240137:t[308]>1e-35?t[5]>691.5000000000001?t[133]>1e-35?w=-.037118314390013646:t[1]>51.50000000000001?t[5]>3749.5000000000005?t[8]>58.50000000000001?w=-.022305242912035072:w=.024792895826340516:w=.013666137278072166:t[88]>1e-35?t[10]>27.500000000000004?w=.2080083584805785:w=.04247197078083379:t[10]>40.50000000000001?t[18]>1e-35?t[1]>27.500000000000004?w=.060783227455868206:w=-.056904865557409035:w=-.03278952553107572:t[192]>1e-35?w=.13117402617043625:w=.01647119888257836:w=-.01825870445636398:t[9]>6.500000000000001?t[298]>1e-35?w=.026536210945939682:t[8]>691.5000000000001?t[126]>1e-35?w=-.07927319604548912:t[10]>3.5000000000000004?t[21]>1e-35?w=-.11083976837572328:t[146]>1e-35?w=-.03359294484446772:w=-.0042815953591236475:t[190]>1e-35?w=-.09264239592903775:t[10]>1e-35?w=.022282638485105657:w=-.0205994057928458:t[5]>4918.500000000001?w=.03430715695199153:t[243]>1e-35?t[2]>57.50000000000001?w=.08935072241972036:w=-.03781647876237494:w=.0062655753179671515:t[31]>1e-35?w=.008603500300349887:t[230]>1e-35?w=.03350056932774173:t[23]>1e-35?t[241]>1e-35?w=.10277555508503314:w=.0017901817172993888:t[2]>98.50000000000001?w=-.05920081229672715:w=-.015722173275739208;let R;t[13]>1e-35?t[118]>1e-35?R=.07957905150112207:t[1]>125.50000000000001?R=-.0662620579858685:t[145]>1e-35?R=.029682040828779843:t[19]>1e-35?t[6]>15.500000000000002?R=-.0009597832580977798:R=-.081474760755753:t[212]>1e-35?R=.03637001492325179:R=.006912305498963309:t[32]>1e-35?R=-.03919900630910754:t[134]>1e-35?R=-.036225295529777886:t[4]>4.500000000000001?t[5]>384.50000000000006?t[204]>1e-35?R=.06671440854602108:t[136]>1e-35?R=-.07577364230133474:t[148]>1e-35?t[4]>7.500000000000001?R=.026430947016830915:R=-.04075501264495112:t[9]>93.50000000000001?R=-.04353169430417609:t[50]>1e-35?R=-.1411224537622882:t[17]>1e-35?t[49]>1e-35?R=.068392679163672:t[10]>1.5000000000000002?R=-.0209659792007492:R=-.0004393235559249831:t[133]>1e-35?t[9]>64.50000000000001?R=.07254524592323175:R=-.0319087835282534:R=.00037444813327793425:R=-.025138768151370408:t[243]>1e-35?R=-.050010891710502096:t[94]>1e-35?R=-.0817513550778599:t[122]>1e-35?R=-.061038875809822285:t[19]>1e-35?t[8]>1085.5000000000002?R=-.008408408775061623:t[2]>5.500000000000001?t[218]>1e-35?R=.1454877641381946:R=.053787998331240316:t[9]>33.50000000000001?R=.08602629796680285:R=-.03895127455803038:R=.008830878042315722;let x;t[131]>1e-35?x=.01687979707990516:t[8]>2915.5000000000005?t[297]>1e-35?x=.07473600489975568:t[0]>93.50000000000001?x=-.021596848506011502:x=-.13840802327735696:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?x=.10264284346448256:x=.031042487183181262:x=-.016653982936827776:t[4]>60.50000000000001?t[10]>75.50000000000001?x=.04226403420647408:t[10]>1e-35?t[0]>4733.500000000001?x=.006271403149804702:x=-.030013637555715046:t[0]>4449.500000000001?x=-.06556876058654929:x=.06437994816903034:t[32]>1e-35?x=-.043814577251655815:t[308]>1e-35?t[0]>7277.500000000001?x=-.09349726304052086:t[210]>1e-35?x=-.0035960132209098003:t[5]>691.5000000000001?t[133]>1e-35?x=-.029188394315052574:x=.017219308333820193:x=-.017378928852189585:t[9]>6.500000000000001?t[0]>2653.5000000000005?t[149]>1e-35?x=-.04428555753857688:x=.0001456106867817353:t[5]>213.50000000000003?x=.01740292726636365:x=-.011361718115556464:t[7]>4.500000000000001?t[0]>316.50000000000006?t[19]>1e-35?t[10]>54.50000000000001?x=.03410288911259329:t[121]>1e-35?x=-.06056527462120627:t[8]>2592.5000000000005?x=.12166808844363577:t[191]>1e-35?x=.11669879218998758:x=-.001664858391716235:x=-.01262927450503166:x=-.04506589951879664:t[227]>1e-35?x=-.08548904959752329:x=.02156080776537726;let P;t[306]>1e-35?t[149]>1e-35?P=-.1389218965136736:P=-.032218642644416894:t[13]>1e-35?P=.006465035217331847:t[50]>1e-35?P=-.1381687930130022:t[179]>1e-35?P=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?P=-.03262719498763048:P=.023342916702125613:t[191]>1e-35?P=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?P=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?P=-.09989343595668776:P=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?P=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?P=-.09165257825246746:t[9]>32.50000000000001?P=.02484870392366004:P=-.008499493096971395:t[8]>24.500000000000004?P=.02459679192828244:P=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?P=.0015644546318714849:P=-.06579524865022705:P=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?P=.03331853632960164:P=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?P=-.019091477207111116:P=.037878468575478504:t[94]>1e-35?P=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?P=.16919658785098224:t[243]>1e-35?P=-.06580584936754524:P=.01567555159935563:t[129]>1e-35?P=.06721746994993226:t[10]>32.50000000000001?P=-.046394462507797975:P=-.006436180519584767;let D;t[131]>1e-35?D=.015039096856208693:t[8]>779.5000000000001?t[145]>1e-35?D=.019122095523977856:t[298]>1e-35?D=.023828936462317443:t[1]>23.500000000000004?t[5]>384.50000000000006?t[7]>59.50000000000001?D=-.026094309429557913:t[204]>1e-35?D=.09163404305658318:t[1]>27.500000000000004?t[149]>1e-35?t[6]>34.50000000000001?D=.012643810980689466:D=-.07884161741497837:D=-.0025267379810891104:t[2]>43.50000000000001?t[0]>2860.5000000000005?D=.04493082949897325:D=.18046359750455776:t[7]>18.500000000000004?D=-.018667348656891496:D=.02584325784698236:D=-.045696524897545915:t[0]>3321.5000000000005?t[201]>1e-35?D=.04749240016989375:D=-.0333334578246718:t[5]>3276.5000000000005?D=.11330554740098908:t[7]>94.50000000000001?D=.1296600395033268:D=-.003576436308940934:t[15]>1e-35?t[183]>1e-35?D=-.13787130789142835:t[0]>1847.5000000000002?D=.017915229729920556:t[10]>23.500000000000004?t[10]>31.500000000000004?t[6]>7.500000000000001?D=.028856848462727104:D=-.11197632885851168:D=.08169801342016791:t[1]>22.500000000000004?D=-.021052888644970163:D=.019048604298876753:t[7]>4.500000000000001?D=-.002603328695276418:t[7]>1.5000000000000002?t[2]>5.500000000000001?D=.03432638833359197:D=-.0036767863082454973:t[1]>48.50000000000001?D=.03087375270128195:t[2]>3.5000000000000004?D=-.04219917149740248:D=.018818493993207935;let N;t[306]>1e-35?N=-.04076858123502297:t[13]>1e-35?t[1]>67.50000000000001?t[9]>14.500000000000002?t[9]>53.50000000000001?t[8]>1971.5000000000002?N=-.09091897542577475:N=.04042943082645558:t[218]>1e-35?N=.056254985867151:N=-.053848117950183044:N=.003881630017086845:t[5]>5152.500000000001?t[8]>857.5000000000001?t[6]>28.500000000000004?N=.021581808008986944:N=-.05639286496176611:N=.052838875036198954:t[5]>50.50000000000001?t[5]>4082.5000000000005?t[17]>1e-35?N=.023061479860228728:t[145]>1e-35?t[9]>10.500000000000002?N=.023885302967553288:N=.1617794086125622:t[212]>1e-35?N=.04504545345658806:t[3]>17.500000000000004?t[4]>45.50000000000001?N=-.03948072448245435:t[1]>47.50000000000001?t[9]>18.500000000000004?N=.01894935813286188:N=-.06449356357429188:N=.012297239104320094:t[1]>26.500000000000004?t[8]>33.50000000000001?N=-.034718828212885515:N=.0898976288814321:t[1]>17.500000000000004?N=-.15440137451988326:N=-.03864183216821465:N=.009988507307006308:N=-.08540311947043305:t[50]>1e-35?N=-.13323659732101975:t[134]>1e-35?N=-.031820386486894385:t[32]>1e-35?t[8]>2302.5000000000005?N=.08082476177379844:N=-.041665761903645876:t[179]>1e-35?N=-.12405023987936657:t[39]>1e-35?N=-.06247416524997478:t[138]>1e-35?N=-.10724031753676487:N=-.0005423122305122404;let L;t[308]>1e-35?L=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?L=.023223358334607133:L=-.04383410185346742:L=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?L=.023406489302867494:L=-.085521220804058:L=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?L=.028120059780969632:L=-.04211009474298743:t[294]>1e-35?L=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?L=-.0993035220737934:L=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?L=.029770210551187937:L=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?L=.06421359317599738:L=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?L=.024368404612215164:L=-.04045232374803373:t[131]>1e-35?L=.017372701982485795:t[120]>1e-35?L=.08812710275150198:t[18]>1e-35?t[90]>1e-35?L=.18451364351180236:t[7]>33.50000000000001?L=-.03850813130183531:t[195]>1e-35?L=.06966114053446336:t[3]>16.500000000000004?L=-.0012869181693341211:t[0]>4242.500000000001?L=-.054625548611291035:L=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?L=.006302103427145562:L=.13967622319898698:t[121]>1e-35?L=-.038798585213145644:t[5]>4544.500000000001?L=-.08050498033009466:L=-.002986974112681435;let B;t[0]>384.50000000000006?t[2]>101.50000000000001?t[1]>16.500000000000004?B=-.03461119351456781:B=.05659026566680352:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?B=-.12404435523286539:B=-.0034376913880382956:B=-.09821622245095822:t[131]>1e-35?t[9]>1.5000000000000002?B=.0037507103585310234:B=.03610387965829944:t[8]>999.5000000000001?t[9]>137.50000000000003?B=-.11985021663179699:t[0]>1847.5000000000002?t[126]>1e-35?B=-.04832024079663151:t[37]>1e-35?B=-.037103393468366934:B=-.004248086592531705:t[8]>3084.0000000000005?t[9]>43.50000000000001?B=.032539071163832034:t[5]>1643.5000000000002?B=.036408625378035665:t[0]>1500.5000000000002?B=-.1346358322854993:B=-.027586559522081014:t[3]>1e-35?t[190]>1e-35?B=-.1133991164577881:t[9]>52.50000000000001?B=-.024478640359723122:B=.03673777861098756:B=-.1037451237591819:t[230]>1e-35?t[9]>48.50000000000001?t[10]>20.500000000000004?B=.002583438691776944:B=.10773520810108106:t[9]>12.500000000000002?t[1]>16.500000000000004?B=-.02141222346712401:B=.06392462314316179:t[4]>12.500000000000002?B=.08700122294434816:t[8]>267.50000000000006?B=.056923170082743224:B=-.07716309825583327:t[32]>1e-35?B=-.03961343943752142:B=.002674914122888783:t[1]>42.50000000000001?B=-.05217539654421676:t[145]>1e-35?B=.09553630282946368:B=-.009424791262477729;let j;t[183]>1e-35?j=-.05753337139158443:t[308]>1e-35?j=.00562436671450989:t[9]>7.500000000000001?t[21]>1e-35?t[10]>8.500000000000002?j=-.10477869875380448:j=-.0070301869937306055:t[3]>9.500000000000002?t[8]>1765.5000000000002?t[0]>4571.500000000001?j=-.12526505173232894:t[10]>1e-35?t[9]>71.50000000000001?j=-.04442302951713574:j=.00012409888451734224:j=-.092199119633697:t[225]>1e-35?j=.13773072450201831:t[0]>2882.5000000000005?j=.0028540012229920533:t[298]>1e-35?j=.07134486044361629:j=.014297412329837425:t[145]>1e-35?j=.05608385321902638:t[92]>1e-35?j=.038298413603926135:t[107]>1e-35?t[2]>6.500000000000001?j=-.0039957800609801315:j=.0776927564241081:t[203]>1e-35?j=-.05502900859432093:t[105]>1e-35?j=.06062892720841595:j=-.009574839629252128:t[31]>1e-35?j=.009488858841144216:t[23]>1e-35?t[20]>1e-35?j=.08818126313644752:t[8]>161.50000000000003?j=.014353968957885408:j=-.022240738532827903:t[210]>1e-35?j=.024648862719806694:t[2]>5.500000000000001?t[4]>4.500000000000001?t[17]>1e-35?t[10]>16.500000000000004?j=-.043902062079383485:j=-.014741559220396223:j=-.00934935734853194:t[6]>32.50000000000001?j=.1514593126307404:j=.010771222510801532:t[10]>22.500000000000004?j=.01412495209334078:j=-.08576940379502533;let M;t[0]>384.50000000000006?t[84]>1e-35?M=-.06647690967306838:t[2]>101.50000000000001?M=-.024451334501552457:t[306]>1e-35?M=-.034517188927733505:t[131]>1e-35?t[9]>1.5000000000000002?M=.0031858381443673127:M=.032574927024450646:t[204]>1e-35?t[1]>62.50000000000001?M=-.08601340441214533:t[1]>29.500000000000004?M=.10487598629539963:t[8]>597.5000000000001?M=-.0786529133673238:M=.08689436600511559:t[8]>779.5000000000001?t[10]>2.5000000000000004?t[9]>100.50000000000001?M=-.04883600353740688:t[126]>1e-35?M=-.03794042763348827:M=-.003358871967539988:t[210]>1e-35?M=.054991356498447566:t[6]>19.500000000000004?M=-.007418396981635549:M=.018032606049498613:t[18]>1e-35?t[7]>35.50000000000001?t[2]>44.50000000000001?M=-.02143003429501711:M=-.09016000554055564:t[1]>19.500000000000004?t[1]>42.50000000000001?t[8]>17.500000000000004?M=-.006636355416244082:M=-.06483095743431454:t[4]>21.500000000000004?M=-.028975965946833545:M=.022012264796522657:M=-.06653648243193663:t[5]>4593.500000000001?M=.01753551428088607:t[217]>1e-35?M=-.028864824937700297:t[94]>1e-35?M=-.04885192273020658:t[279]>1e-35?M=.08105715462329498:t[121]>1e-35?M=-.04576676034750651:M=.004795141324949362:t[1]>42.50000000000001?M=-.047446619702809195:t[145]>1e-35?M=.08400495571952321:M=-.00854528836489364;let O;t[294]>1e-35?O=-.042529778074638265:t[266]>1e-35?O=-.1180276669679798:t[134]>1e-35?O=-.026818144353279623:t[183]>1e-35?O=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?O=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?O=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?O=-.03049646619610203:t[1]>50.50000000000001?O=.20634590755061122:O=.06956378103625731:t[0]>3770.5000000000005?O=-.07946414366134913:t[19]>1e-35?O=.17083312065604694:t[2]>21.500000000000004?O=-.02327981978127724:O=.129717297518715:t[145]>1e-35?O=.006891245076133524:O=-.0789123467863741:t[3]>99.50000000000001?O=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?O=.06447639919732716:O=-.05457561977645972:t[306]>1e-35?O=-.029995903305383882:t[191]>1e-35?O=.030596508110850414:t[242]>1e-35?O=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?O=.09518584795377832:O=-.018197744600833596:t[13]>1e-35?O=.006751790086127549:t[148]>1e-35?O=.01904174573618417:t[99]>1e-35?O=.025287735102561926:t[4]>14.500000000000002?O=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?O=-.09467943982430241:t[243]>1e-35?O=-.02521824751996268:O=.005437570718352172:O=-.022476214821960674;let U;t[0]>384.50000000000006?t[84]>1e-35?U=-.06088131453064195:t[147]>1e-35?U=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?U=.04219361472548491:U=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?U=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?U=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?U=-.11431764534511478:U=.013549717238356157:U=-.020987333767091276:t[6]>2.5000000000000004?U=-.02914877855133127:U=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?U=-.10087072787978416:t[37]>1e-35?U=-.030467397753331196:t[229]>1e-35?U=-.1017559811057469:t[4]>20.500000000000004?U=-.00413177742240167:t[20]>1e-35?U=.05213315982685969:U=.0037921635866823133:t[8]>51.50000000000001?U=.07327913092421544:t[6]>49.50000000000001?U=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?U=.02744420891894289:U=.11288946357194463:U=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?U=-.012329314369909049:U=.026816658655600168:U=-.0872405354618811:U=.007872673500247845:t[1]>42.50000000000001?U=-.04309044198258254:t[145]>1e-35?U=.07572529147860785:t[7]>5.500000000000001?U=-.013837187093264945:t[1]>17.500000000000004?U=.04208698439539668:U=-.06284346769019863;let q;t[294]>1e-35?q=-.0384794324818203:t[266]>1e-35?q=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?q=.07432960094940501:q=-.035248735855751855:t[134]>1e-35?q=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?q=-.01706896375068821:q=.08212247914968074:t[2]>59.50000000000001?q=-.09546478958824225:t[6]>53.50000000000001?q=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?q=.02816463285971267:q=.15449139016588445:q=-.10199787406123524:q=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?q=-.13924786681478077:q=-.0072772442570213335:t[39]>1e-35?q=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?q=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?q=-.11174465335620831:q=.00013144040097180107:q=-.08493919336681105:t[42]>1e-35?q=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?q=-.015540659878839153:q=-.14442609417300142:t[21]>1e-35?q=-.025251979447574083:q=.0023698372645272847:t[18]>1e-35?q=.07269739695712212:t[8]>2592.5000000000005?q=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?q=-.01835130329646532:t[9]>45.50000000000001?q=.02023047454629885:q=.16469378262221102:q=-.042975030085836426;let Q;t[8]>2915.5000000000005?t[297]>1e-35?Q=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?Q=-.01034964686484714:Q=-.07357437440667927:Q=-.11987794734779106:t[298]>1e-35?t[8]>81.50000000000001?t[0]>3370.5000000000005?t[8]>155.50000000000003?t[8]>660.5000000000001?t[8]>2134.5000000000005?Q=-.09476398869062203:t[9]>72.50000000000001?Q=-.0757383854264379:Q=.02806542779508718:Q=-.05147742568418084:Q=.10212721564444344:Q=.0518263760642861:Q=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?Q=-.10669213185972036:Q=.027050434286384796:t[302]>1e-35?Q=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?Q=.06354599160071946:t[1]>67.50000000000001?Q=.05317447949011187:Q=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?Q=-.09369289448773599:t[0]>2215.5000000000005?Q=.04077965380363924:t[0]>807.5000000000001?Q=-.0591771776458298:Q=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?Q=-.016323380219241672:Q=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?Q=.03720704290087811:Q=-.008730548158766654:t[4]>80.50000000000001?Q=-.05346644687473197:Q=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?Q=.019984510398089086:Q=-.03917825025861855:t[9]>170.50000000000003?Q=-.09759719821334525:Q=-.0023586682752856298;let Y;t[183]>1e-35?t[17]>1e-35?Y=.030100940443356424:t[10]>1.5000000000000002?Y=-.10861112216742408:Y=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?Y=-.032062878390325456:Y=-.10808232631806887:t[8]>1641.5000000000002?Y=-.06147013392655731:t[4]>12.500000000000002?Y=.03324767551088266:t[145]>1e-35?Y=.028851633810612017:Y=-.054871239091792784:t[134]>1e-35?Y=-.023813968121342108:t[266]>1e-35?Y=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?Y=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?Y=-.025350325484720576:Y=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?Y=.056817276537534815:Y=-.07674158463557636:Y=-.06335553143454145:t[1]>56.50000000000001?Y=.16390494217299284:Y=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?Y=.041717597065890205:Y=-.10357913492269129:t[10]>29.500000000000004?Y=.1365512866715726:Y=.020600048310575665:Y=.09708785634773187:Y=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?Y=-.03146213719547347:Y=.11784024316238083:Y=-.050940520532045355:Y=-.047988344143075616:t[191]>1e-35?Y=.028764654731460032:Y=.0011911575567860023;let W;t[294]>1e-35?t[10]>50.50000000000001?W=-.11630092297244568:t[0]>2432.5000000000005?t[0]>4199.500000000001?W=-.05103908560370243:W=.05002066201169583:W=-.09976646725732496:t[32]>1e-35?t[0]>4242.500000000001?W=-.0648838712201258:t[5]>3721.5000000000005?t[9]>4.500000000000001?W=.127983140816313:W=-.05436534163636867:W=-.024514536544596455:t[121]>1e-35?t[0]>4449.500000000001?t[4]>9.500000000000002?W=-.009504203657088933:t[8]>819.5000000000001?W=.18689664822602375:W=.03635576744011826:W=-.029862411809998525:t[223]>1e-35?W=-.06474496692999487:t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?W=-.09405026597863717:t[0]>4153.500000000001?W=.053577663326799765:W=-.05062127873995668:W=.06512222894425874:t[39]>1e-35?W=-.04985311717827547:t[51]>1e-35?W=-.04541229517934797:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?W=-.02860634573675884:W=.08863753005590103:W=.11158892111063744:t[0]>655.5000000000001?W=-.031005736641654926:W=-.1439827004505974:t[222]>1e-35?t[1]>11.500000000000002?t[0]>612.5000000000001?W=-.00843386136334982:W=-.05273594615999777:W=.1060183822015004:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?W=-.015774115523598486:W=.10147367091236065:W=-.048307000563071016:W=.002118376117677254;let V;t[8]>1014.5000000000001?t[9]>137.50000000000003?V=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?V=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?V=.07211107542565391:V=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?V=-.0751486415451188:t[1]>59.50000000000001?V=.13459005084554104:V=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?V=.06715575425741895:V=-.005895690393702183:t[8]>2915.5000000000005?V=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?V=-.00029068886245881074:V=.0613467393188786:t[148]>1e-35?V=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?V=.003887223773199377:V=-.08553893131979015:V=.025654192706396767:V=-.05651733979610658:V=-.02039913645229667:t[2]>7.500000000000001?V=-.1058450646728524:V=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?V=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?V=.1283258201586378:V=-.01718135372229775:V=-.07702452408491414:t[125]>1e-35?V=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?V=.04273051857848212:V=-.04533122948101463:t[2]>196.50000000000003?V=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?V=.0231032972703664:V=-.04807386814498683:V=.002729435991332102;let z;t[179]>1e-35?z=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?z=.026484626664041125:t[10]>1.5000000000000002?z=-.10187000872941615:z=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?z=.09574540795390041:z=-.06454986703691233:z=-.11411849349353141:t[266]>1e-35?z=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?z=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?z=-.04403391373512386:z=.1132928075412222:t[2]>47.50000000000001?z=-.09700191391838056:z=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?z=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?z=-.001668912999010927:z=-.02363511102970245:t[8]>58.50000000000001?z=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?z=.0911011436534449:t[1]>28.500000000000004?z=-.07192390493729035:z=.06913818091291246:z=-.012312625373699222:z=.06784496312307986:z=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?z=.0026564453057705273:z=-.025425772389361445:t[122]>1e-35?z=-.12046786388602149:t[0]>3183.5000000000005?z=.01162092842804907:t[91]>1e-35?z=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?z=-.0001647792543020228:z=-.023664538532907665:z=.01609078206180752;let ie;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ie=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ie=-.017696526862422682:ie=.1450050954613223:ie=-.05406930069823832:ie=-.08308700260259043:t[120]>1e-35?ie=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ie=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ie=.038431826961746934:ie=-.05937462906539856:t[9]>65.50000000000001?ie=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ie=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ie=-.09579030954062734:ie=.025064711572811746:ie=.02579440518821548:ie=.1044440128091862:ie=-.058348633139536844:ie=.07766788227934436:ie=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ie=.07463684068207214:ie=.18244269035484484:t[6]>39.50000000000001?ie=-.06050050067471004:ie=.05787759066913493:ie=.010783225857972171:ie=.1674891243602606:t[4]>9.500000000000002?ie=-.004814132027475892:ie=-.14543299413454813:ie=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ie=-.07634466313617769:ie=.0287825335169114:ie=-.06894721943300268:ie=-.00023988459059521937;let H;t[131]>1e-35?t[1]>93.50000000000001?H=-.05706887458825395:t[2]>1.5000000000000002?H=.011446637886629108:H=-.10616119878749211:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?H=.08424281276381033:t[3]>17.500000000000004?t[20]>1e-35?H=.11146885439601915:t[8]>61.50000000000001?t[0]>3530.5000000000005?t[9]>48.50000000000001?t[9]>61.50000000000001?H=.026278724448495064:H=.17053138400480508:t[0]>4463.500000000001?H=-.06482289890096041:H=.03026516489536295:H=-.031785170717683144:H=.1312690622980455:t[13]>1e-35?H=.14336922540461444:H=.03523850945454039:H=-.015407465968975714:t[39]>1e-35?H=-.054809635385158186:t[32]>1e-35?t[0]>4242.500000000001?H=-.0659975068798723:H=-.008386582621403979:t[4]>60.50000000000001?t[10]>75.50000000000001?t[3]>107.50000000000001?H=-.04225314193574262:t[3]>70.50000000000001?t[1]>29.500000000000004?H=.057409156184759516:H=.2024322059866388:H=-.030670938454461245:t[10]>1e-35?t[0]>4733.500000000001?H=.010648654146284154:t[308]>1e-35?H=.008728141696325391:t[4]>64.50000000000001?t[298]>1e-35?H=.12364025998551711:H=-.02247495081065243:t[1]>22.500000000000004?H=-.0726295464624251:H=.03481895086048152:t[0]>4331.500000000001?H=-.04775443357020673:H=.07172377425057568:t[2]>89.50000000000001?H=-.11782645274716962:H=.00010092665257989378;let te;t[147]>1e-35?te=-.041560228567115574:t[302]>1e-35?t[10]>47.50000000000001?te=.062292114082780084:t[10]>5.500000000000001?t[7]>22.500000000000004?te=-.016101990375700172:t[0]>2579.5000000000005?te=-.13045089661551845:te=-.02874367814784938:te=.025835149631944995:t[167]>1e-35?t[0]>3928.5000000000005?te=.17084176915326055:te=-.019195947948312853:t[222]>1e-35?t[30]>1e-35?t[1]>36.50000000000001?t[8]>45.50000000000001?t[8]>578.5000000000001?t[1]>67.50000000000001?te=.10591712319944074:te=-.024082167264285:te=.16497698867036126:te=-.04985066326861431:t[0]>1937.5000000000002?t[2]>16.500000000000004?te=-.021012910475524206:te=-.13058422554298485:t[0]>1102.5000000000002?te=.10955864175201457:te=-.03566689354348996:t[1]>11.500000000000002?te=-.02093884208606101:te=.09107244766183857:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?te=-.013861861436128482:te=.09756849802202777:t[224]>1e-35?t[1]>51.50000000000001?te=.10163873449625677:te=-.02779270277623805:t[1]>26.500000000000004?te=-.08035058228527389:te=.0005719695099064484:t[191]>1e-35?t[9]>9.500000000000002?te=-.007028075523033826:te=.0489470913925288:t[1]>61.50000000000001?t[132]>1e-35?te=.11230846723576784:t[0]>350.50000000000006?t[2]>1.5000000000000002?te=-.0032075580718124892:te=-.04442829143298883:te=-.06597073245775804:te=.0015594090939337751;let le;t[223]>1e-35?t[8]>668.5000000000001?le=-.12803889879260094:le=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?le=.08967966612917375:t[1]>39.50000000000001?le=-.059791671514498074:le=.05648934961902822:t[2]>59.50000000000001?le=-.08633234097449628:t[6]>53.50000000000001?le=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?le=.025606129643140924:le=.13835395886271978:le=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?le=-.09975506556937946:t[10]>36.50000000000001?le=-.09427724661655643:t[10]>24.500000000000004?le=.07329330653410447:le=-.02271182965807972:le=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?le=-.05082091374050816:le=.1687114435254966:t[0]>2314.5000000000005?le=-.06422664016383926:le=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?le=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?le=-.1274167728754332:le=.01308079126447365:t[4]>73.50000000000001?le=.13854015371106546:t[4]>48.50000000000001?le=-.03684255740123261:t[6]>45.50000000000001?le=.10329912215813097:t[10]>77.50000000000001?le=-.08630788656925215:le=.031022006843800853:t[1]>25.500000000000004?le=-.08278381528048026:le=.06664374548141594:t[84]>1e-35?le=-.05624227409079396:le=.00012184182357340415;let Le;t[179]>1e-35?Le=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Le=-.07595415373151816:Le=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Le=.022822510448266862:Le=.17491569312933697:Le=-.058362287133533565:t[2]>2.5000000000000004?Le=-.03633895806364428:Le=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Le=-.07294848747514579:Le=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Le=-.07009535282685533:t[8]>2640.0000000000005?Le=-.051761240111316276:t[131]>1e-35?Le=-.06245774419231631:Le=.03495606662854905:Le=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Le=.0015036626973581122:Le=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Le=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Le=.022343994371919224:Le=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Le=.07724450228328664:t[0]>3853.5000000000005?Le=-.15671707454435677:t[10]>28.500000000000004?Le=-.10179090671841723:Le=.014878216919760927:Le=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Le=.14054154485273487:Le=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Le=-.08632985141410315:Le=.005524157938954954:Le=-.08802502622523681:Le=-.0004649168897260341;let ge;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ge=-.007458687464321174:ge=-.09444966249102484:t[1]>23.500000000000004?ge=.08564129697360716:ge=-.07105002902845851:ge=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ge=-.10326216566705966:t[1]>26.500000000000004?ge=.0050539832484585365:ge=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ge=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ge=.05783632021087773:t[10]>17.500000000000004?ge=-.06720598671764105:t[1]>47.50000000000001?ge=.097495825172558:ge=-.013372242800584872:ge=-.06463226787713715:t[42]>1e-35?ge=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ge=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ge=.11051270080118503:ge=.027719462817590454:t[8]>597.5000000000001?ge=-.08441503592016869:ge=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ge=-.12190088985091102:ge=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ge=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ge=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ge=.016585157185448045:ge=-.11032043771149425:ge=.01586986028570486:t[8]>388.50000000000006?ge=-.10592413013261853:ge=.04930703248769364:t[13]>1e-35?ge=.003621937787920821:ge=-.0013786331198611841;let Oe;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Oe=.009769895322846493:Oe=-.10620052926943656:t[9]>19.500000000000004?Oe=.03781202525403449:t[9]>14.500000000000002?Oe=-.11485785321365344:t[9]>6.500000000000001?Oe=.07677177833073881:t[0]>4342.500000000001?Oe=-.07079285609687631:t[49]>1e-35?Oe=.06156814809246001:Oe=-.014788509042554625:Oe=-.032659201618470655:t[5]>5207.500000000001?Oe=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Oe=-.03094160322187924:t[1]>29.500000000000004?Oe=.09474646043921069:Oe=.023445783928231618:Oe=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Oe=-.07164443768784848:t[1]>29.500000000000004?Oe=.089473622509272:t[8]>597.5000000000001?Oe=-.08155349903101317:Oe=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Oe=-.004003900679358653:t[190]>1e-35?Oe=-.09236113461485262:t[8]>3198.5000000000005?Oe=-.0124130160451179:Oe=.018453070064009328:t[15]>1e-35?Oe=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Oe=-.0009580759587680961:Oe=-.03227283036698222:Oe=.01369287669536875:t[1]>50.50000000000001?Oe=-.04213060332500437:t[35]>1e-35?Oe=-.11508095777767471:t[190]>1e-35?Oe=-.08611884672400155:t[297]>1e-35?Oe=.05723551879433584:Oe=-.004829340082311461;let we;t[183]>1e-35?we=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?we=-.11753465135886734:we=-.007515490299047085:we=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?we=-.12371142493530439:t[1]>36.50000000000001?we=.032189417575190435:we=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?we=-.0784518658439288:t[2]>54.50000000000001?we=.12477882322370665:we=.000313468482399738:we=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?we=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?we=.0353146070135579:we=-.06327619611098285:we=.02813577701641991:we=-.12354390728506215:t[34]>1e-35?we=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?we=-.01245803535276381:we=-.07169472553475001:t[1]>11.500000000000002?we=.12989984824561698:we=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?we=.010390226893521422:t[10]>14.500000000000002?we=.16790888126487719:we=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?we=-.043398307129729134:we=.09963544907820426:t[9]>30.500000000000004?we=-.13540713124984502:t[9]>17.500000000000004?we=.0509435850590757:we=-.04761897852404613:t[4]>78.50000000000001?we=.09197086656470652:we=.0006771050176682337;let re;t[122]>1e-35?t[6]>36.50000000000001?re=.05686884451670743:re=-.05334759543084309:t[266]>1e-35?re=-.08603579519816038:t[157]>1e-35?re=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?re=-.0499592651503952:t[0]>725.5000000000001?re=.11780353905132664:re=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?re=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?re=-.03190157229022304:re=.07985197845805492:re=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?re=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?re=-.027174047777029083:re=.057117284879796476:t[3]>43.50000000000001?re=-.0016147040913107311:re=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?re=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?re=-.01466076988151239:re=.13375695925484857:re=-.04885873081899647:t[0]>5566.500000000001?re=.11086813028591343:t[8]>992.5000000000001?re=-.07622304217072383:re=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?re=.03285858361708423:re=-.12354858211764992:re=.0672788301823281:t[15]>1e-35?re=.08658836986585006:re=-.02741484278509758:t[290]>1e-35?re=-.08161310335133287:t[135]>1e-35?re=-.04824156054814152:re=.0009156904299554183;let ee;t[3]>7.500000000000001?ee=.0006791852818377787:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ee=.03642374718166293:ee=.16379973756366603:ee=-.03946685266127979:t[186]>1e-35?ee=.07618896623420895:t[96]>1e-35?ee=.0680272261319657:t[107]>1e-35?t[1]>48.50000000000001?ee=-.022822371600847505:ee=.0501405836324949:t[203]>1e-35?t[1]>77.50000000000001?ee=.044416424920571296:ee=-.0648450593196238:t[5]>3921.5000000000005?t[1]>110.50000000000001?ee=-.11110466767595227:t[9]>5.500000000000001?t[9]>52.50000000000001?t[1]>50.50000000000001?ee=.1061937286809567:t[7]>54.50000000000001?ee=.11487507743121311:t[8]>819.5000000000001?ee=-.07181278009001418:t[10]>25.500000000000004?ee=.13499019430369633:t[1]>31.500000000000004?ee=.09032979489780704:ee=-.12754166393372374:t[9]>37.50000000000001?ee=-.05093963635361407:ee=-.005026651151683848:t[9]>2.5000000000000004?ee=.07619735785573735:ee=.012363301341532136:t[26]>1e-35?ee=-.10685800454968203:t[8]>125.50000000000001?t[8]>446.50000000000006?t[0]>3842.5000000000005?ee=-.08783796894105043:t[282]>1e-35?t[1]>47.50000000000001?t[9]>40.50000000000001?ee=-.10764172927882483:ee=.01890760098464703:ee=.06573095405846417:t[8]>634.5000000000001?ee=-.00783575973273707:ee=-.050612689680229306:t[1]>22.500000000000004?ee=-.0016842490401359626:ee=.0738227088444087:ee=-.02663970950432175;let K;t[31]>1e-35?t[8]>17.500000000000004?K=.013678038624884814:t[1]>35.50000000000001?t[1]>51.50000000000001?K=.007191286124908192:K=-.09347881647636902:t[10]>1.5000000000000002?K=.07938758708008091:K=-.008702935600305113:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?K=.12321804057595996:K=-.018281109320672437:t[23]>1e-35?t[4]>62.50000000000001?K=-.04644244754790671:K=.024546310702263208:t[8]>862.5000000000001?t[0]>3429.5000000000005?t[4]>9.500000000000002?t[52]>1e-35?K=.0706108609273337:t[2]>40.50000000000001?K=-.028046629962303716:K=-.06497613993109329:K=.01076489668586676:t[1]>33.50000000000001?t[0]>966.5000000000001?t[2]>14.500000000000002?t[1]>38.50000000000001?K=-.03056331974267756:K=-.11886389712497057:K=.053364962175658184:t[8]>2233.5000000000005?K=-.0448152521157682:K=.1508651602190868:t[2]>33.50000000000001?t[0]>2882.5000000000005?t[0]>3183.5000000000005?K=.03818796510453344:K=.23673992112982362:K=.02858814226507374:t[10]>44.50000000000001?K=-.1125863771551199:K=.009129996952394916:t[1]>7.500000000000001?K=-.004374525302461639:K=-.07858519434925451:t[149]>1e-35?t[6]>23.500000000000004?K=.0005231594491642136:t[0]>4053.5000000000005?t[8]>660.5000000000001?K=-.13677189943034931:t[10]>2.5000000000000004?K=.039591891437078086:K=-.09312596849507347:K=-.02423172142089822:K=.0009836986075266283;let he;t[189]>1e-35?t[0]>5269.500000000001?he=-.103183298350443:t[2]>51.50000000000001?he=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?he=-.05186168947388339:he=.0496996365539082:t[10]>23.500000000000004?he=.1404445738719:t[93]>1e-35?he=.0027146310074558505:t[5]>3821.5000000000005?he=.002153033152069652:t[4]>2.5000000000000004?he=.007663539551317215:he=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?he=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?he=-.021479467709980358:he=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?he=.021660293256233334:he=-.0927396152303864:he=.0665074081601698:t[0]>1550.5000000000002?he=.08972407105958534:he=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?he=.06761927942466854:he=-.015762168112653286:t[17]>1e-35?he=.10311304131145381:he=-.017672785252336027:he=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?he=-.10638321435298535:he=.0007073011744385905:t[18]>1e-35?he=-.027056185501334325:t[145]>1e-35?he=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?he=.09762140519655171:t[9]>110.50000000000001?he=-.06581942957595835:t[6]>54.50000000000001?he=.04959634035251596:he=.0022616298654554207:he=-.007437620924990854;let X;t[179]>1e-35?X=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?X=.1470294450403005:X=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?X=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?X=.07965955447707423:t[10]>10.500000000000002?X=-.09236156404262426:X=.03396273196231458:X=-.13246465021467432:X=.07092822261735353:X=-.08753829085942:X=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?X=.004705878789890202:X=.13775378964952867:X=-.04770928980587811:t[10]>29.500000000000004?X=.011221519891071544:t[0]>3853.5000000000005?X=.06365381191628273:X=.15506252245336827:t[1]>37.50000000000001?X=-.07254777021042061:X=.026514587757252385:t[308]>1e-35?X=.04115804816617256:t[10]>26.500000000000004?X=.02077721353011946:t[5]>3548.5000000000005?X=-.1280907116663952:X=-.021974774274438:t[306]>1e-35?X=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?X=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?X=-.005710865560475598:t[94]>1e-35?X=-.06751507982853555:X=.027250040757588703:t[9]>52.50000000000001?X=.07060357924595577:X=-.030297760713011795:X=-.0006005400085266517;let de;t[113]>1e-35?de=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?de=-.06996356565314456:de=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?de=-.08317707559926495:t[21]>1e-35?de=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?de=-.010538203005984922:de=.08454819465349446:t[9]>124.50000000000001?de=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?de=-.08542251249346582:t[9]>50.50000000000001?de=-.023428882537657472:de=.010042500833979073:de=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?de=.03006025206979096:t[9]>108.50000000000001?de=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?de=.04222035773042132:de=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?de=-.07209095448054853:de=.028065954981903313:de=.08714651929917122:de=-.006678820669279169:t[10]>40.50000000000001?de=.006982396294941626:de=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?de=-.09351114982645548:t[4]>3.5000000000000004?de=-.004837550129223451:de=-.08324141237464677:t[303]>1e-35?de=.10703037493990825:t[9]>156.50000000000003?de=-.10803018621648303:t[116]>1e-35?de=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?de=.10261721665006701:de=.018994509090668264:de=.0011244262442038839;let qe;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?qe=-.08404263465005328:t[0]>3682.5000000000005?qe=.041259223920298876:t[1]>29.500000000000004?qe=-.09541257493441671:qe=.001482192721625409:qe=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?qe=-.08268996098437432:t[230]>1e-35?qe=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?qe=-913218977737457e-19:t[4]>10.500000000000002?qe=-.056334165674005156:t[127]>1e-35?qe=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?qe=-.04231200150318989:t[10]>42.50000000000001?qe=.10182973257894812:qe=.015934763950068445:qe=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?qe=-.041117068322885315:qe=.1167767830037126:qe=.13611206992387337:t[10]>41.50000000000001?qe=-.07120286010564107:qe=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?qe=-.07702290997669524:t[198]>1e-35?qe=.08776558554437136:qe=-.008290740324975692:t[2]>32.50000000000001?qe=.07198457624219955:qe=.005463113714361629:qe=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?qe=.03295785445437507:qe=.15140250150674536:qe=-.035613213948910254:t[186]>1e-35?qe=.06849425535860769:t[96]>1e-35?qe=.06028225812727254:qe=-.007582543288662308;let ne;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ne=.08396556264106572:ne=-.0562516995099192:ne=-.10593011018789432:t[183]>1e-35?t[15]>1e-35?ne=-.09705176473553752:t[7]>18.500000000000004?t[2]>37.50000000000001?ne=.0052017514017035915:ne=-.11194119432743639:ne=.03724337696163019:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?ne=-.025692451287403446:ne=-.09511862672123193:t[8]>1661.5000000000002?t[10]>37.50000000000001?ne=-.11892250746801664:t[10]>22.500000000000004?ne=.07548493166973796:ne=-.05973048107712209:t[4]>12.500000000000002?t[0]>4319.500000000001?t[10]>4.500000000000001?t[10]>37.50000000000001?ne=.13750699058082427:t[18]>1e-35?ne=.06535408879552801:ne=-.054118179035040674:ne=.1344282838979622:t[0]>3982.5000000000005?ne=-.10409582202467015:t[19]>1e-35?ne=.12672850705810795:t[8]>587.5000000000001?t[1]>35.50000000000001?ne=.012705935670766466:ne=.14149359442527545:ne=-.047977876173706004:t[20]>1e-35?ne=.057945228080337946:t[0]>3642.5000000000005?ne=-.008726535792122467:ne=-.08424769891378858:t[34]>1e-35?ne=-.0699329538228602:t[134]>1e-35?t[11]>1e-35?t[4]>15.500000000000002?t[0]>1187.5000000000002?ne=.01196849566739346:ne=.1614642278429876:ne=-.043022338150701625:t[3]>5.500000000000001?ne=-.03907848255033881:ne=.018280601026175593:ne=.0006654540402589085;let ue;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?ue=-.01386103677247845:ue=.11386694333005128:t[4]>27.500000000000004?ue=-.021862617610091336:t[2]>31.500000000000004?ue=.0828858469030438:ue=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?ue=.11303635767048735:ue=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?ue=-.04238798044549342:ue=.022091190130494303:t[5]>5082.500000000001?ue=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?ue=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?ue=-.04291104140431434:t[17]>1e-35?ue=.11256797532342613:ue=-.017206916368289193:ue=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?ue=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?ue=.03581712466863222:ue=.14770264307668884:t[8]>73.50000000000001?ue=-.13093289429740068:ue=.042461737442702936:t[52]>1e-35?ue=.0501831919044939:ue=-.010450249720465756:ue=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?ue=.0005381332165438493:ue=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?ue=.04849637311285226:ue=-.036671377119808564:t[0]>421.50000000000006?ue=.00020968499911058945:ue=.11636422423182405:ue=-.12687837788222575:ue=.0012774367867215346;let Ne;t[120]>1e-35?Ne=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Ne=-.042799574885345304:Ne=.07412430171193245:Ne=-.11248270469336048:t[193]>1e-35?Ne=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Ne=.028911612178122104:Ne=.12326369727728437:t[0]>4091.5000000000005?Ne=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ne=.1159839898100149:Ne=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Ne=-.0216343737351583:Ne=-.1220272260878369:t[2]>18.500000000000004?Ne=.09152924475072398:t[8]>55.50000000000001?Ne=.039508716651005665:Ne=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Ne=.06793009902674053:Ne=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Ne=-.04391068849624096:Ne=.04009967593394672:t[8]>1085.5000000000002?Ne=-.024773826356034825:Ne=-.13919707884246582:Ne=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Ne=-.11567917501901476:Ne=-.006813640337684114:t[3]>7.500000000000001?Ne=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Ne=-.001754586408351048:Ne=-.055422422450722056:Ne=-.06090032532532226:t[0]>5269.500000000001?Ne=.11787981735983527:Ne=-.00198119768540783:Ne=.00210412924303036;let Ie;t[294]>1e-35?t[10]>50.50000000000001?Ie=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?Ie=-.06063239096209816:Ie=.03317022411417386:Ie=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?Ie=-.013608609329298802:Ie=.09078000157330264:t[99]>1e-35?Ie=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?Ie=-.07536137260189814:Ie=.006253266595455118:t[10]>28.500000000000004?Ie=-.006106041147592768:t[9]>156.50000000000003?Ie=-.11828932797811101:t[94]>1e-35?Ie=-.02566078479505714:t[303]>1e-35?Ie=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?Ie=-.08401252789168523:t[5]>4244.500000000001?Ie=.026372887658499107:t[1]>16.500000000000004?Ie=-.027836756345634026:Ie=.09205362097909099:Ie=.00934612788718244:t[203]>1e-35?Ie=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?Ie=-.09580979052540028:t[1]>50.50000000000001?Ie=-.06402211827281554:Ie=.08342858760095972:t[2]>36.50000000000001?Ie=.008114897658204584:t[92]>1e-35?Ie=.09541587072672864:Ie=-.022342147210555434:Ie=-.01660492519175128:Ie=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?Ie=.15846731118501817:Ie=.039498507912023195:t[245]>1e-35?Ie=.07008718676813333:Ie=.0019806389728814727;let Be;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Be=-.01192072916082109:Be=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Be=.06874032717466054:t[4]>40.50000000000001?Be=-.07752510020707537:t[1]>76.50000000000001?Be=-.09944032260703917:t[8]>1381.5000000000002?Be=-.054466635810800745:t[1]>32.50000000000001?Be=.05974084520839573:Be=-.0384718740755954:Be=-.11374190719134032:t[0]>2151.5000000000005?Be=-.13703645155803298:Be=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Be=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Be=.013539805885738608:Be=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Be=.09941880179344399:Be=-.01608127391210995:Be=.08025226531247417:t[9]>67.50000000000001?Be=.13525448212444113:t[6]>61.50000000000001?Be=-.05511099182158894:t[94]>1e-35?Be=-.06821509831783572:t[128]>1e-35?Be=.11361314817714643:Be=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Be=-.09954181329804547:t[197]>1e-35?Be=.10102833149755386:t[188]>1e-35?Be=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Be=-.03781554214742005:Be=.09927933385592314:Be=-.020006000056720083:Be=-.10520473615957895:Be=-.12006990846253787:Be=-.00026111570975317574;let tt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[0]>1725.5000000000002?t[7]>14.500000000000002?t[2]>38.50000000000001?tt=-.019188245509744628:tt=-.13354864350075848:t[0]>2461.5000000000005?tt=.051885477468354396:tt=-.0833581968852119:tt=.08233441701532287:tt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?tt=.09926337893072812:tt=-.027753610497327715:t[0]>1972.5000000000002?tt=-.09780045823152517:tt=.032380915168504935:tt=.11502632261226381:t[17]>1e-35?tt=-.06094965899579662:t[10]>40.50000000000001?tt=-.07500475582440802:tt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?tt=-.09584538995220808:tt=-.00908705814304442:tt=.03203281520813893:t[10]>49.50000000000001?tt=-.03146271513986384:t[2]>63.50000000000001?tt=.13172001315536286:t[224]>1e-35?tt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?tt=.09521549382082259:tt=-.04414925613522197:t[0]>1847.5000000000002?tt=-.09118580379557353:tt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?tt=.03525144509943896:tt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?tt=-.04766112322938157:t[2]>10.500000000000002?tt=.0728516504357201:tt=-.05049625965272536:tt=-.10868663055825774:tt=.0005382613419948969;let st;t[147]>1e-35?t[1]>53.50000000000001?st=-.10615739288764095:t[0]>2604.5000000000005?t[0]>3629.5000000000005?st=-.030504020655417463:st=.07102458639110094:st=-.07058131985243714:t[302]>1e-35?t[10]>47.50000000000001?st=.055304563442710876:t[1]>53.50000000000001?st=.033723409577443623:t[8]>175.50000000000003?t[0]>2628.5000000000005?t[9]>40.50000000000001?st=-.1568835288372895:st=-.0279829124400056:st=.04493843959601833:st=-.11637042729644327:t[191]>1e-35?t[282]>1e-35?st=-.054133834303687026:t[9]>48.50000000000001?st=.11263810289007213:t[9]>9.500000000000002?st=-.02202034562838259:t[4]>45.50000000000001?st=-.03410927569045158:st=.04381615166534081:t[242]>1e-35?t[0]>3615.5000000000005?t[3]>19.500000000000004?t[1]>56.50000000000001?t[4]>28.500000000000004?st=-.029687297407295893:st=.10673602850001934:t[4]>42.50000000000001?st=.0036275562945108117:st=-.0760789221330622:st=-.10385623431741903:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?st=.08274426793676076:st=-.07076234425516396:st=.13890177606150175:st=-.019863286503635686:t[53]>1e-35?t[18]>1e-35?st=-.09250637750836187:st=-.0031531727902009026:t[2]>107.50000000000001?t[4]>91.50000000000001?t[1]>16.500000000000004?st=-.01897867921812603:st=.04890781705365262:st=-.11569892307597907:t[2]>106.50000000000001?st=.09032697440623969:st=.00047935919155035045;let _t;t[115]>1e-35?_t=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?_t=-.10131179514695865:t[8]>938.5000000000001?_t=.10203729808015481:_t=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?_t=.03574015165562999:_t=-.07763042506449493:_t=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?_t=.0665706259130275:_t=-.06586817559309924:_t=.11925564412287476:_t=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?_t=.046017146627455346:_t=-.08623321630086885:t[8]>1765.5000000000002?_t=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?_t=.11143827902215087:_t=-.01817808730473413:_t=.16980985030210127:_t=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?_t=.010168994879727824:_t=-.09099594488792513:t[9]>1.5000000000000002?_t=.0533459678147928:_t=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?_t=-.062346959148773695:t[1]>47.50000000000001?_t=-.0021578343835599316:t[2]>27.500000000000004?_t=.19567373210166172:_t=.07851555379116423:t[18]>1e-35?_t=.03711549097804649:t[8]>359.50000000000006?_t=.012492346746905587:t[4]>20.500000000000004?_t=.047511695735697544:_t=-.07999269063948773:_t=6802045404471004e-20;let kt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?kt=.0011484728213539738:kt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?kt=-.09828874964938798:t[8]>1586.5000000000002?kt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?kt=.011938269926919522:kt=.17541983715953954:t[19]>1e-35?kt=.023002786011088672:kt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?kt=.06508934844183291:kt=-.10168553534835639:kt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?kt=.021140806225203937:kt=-.1167833342453639:t[2]>33.50000000000001?kt=.13163585734056618:kt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?kt=.06314479201263888:kt=-.09639088327091713:t[10]>29.500000000000004?kt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?kt=40577156464836036e-21:kt=.12322387121810757:kt=-.03697224045046014:t[1]>22.500000000000004?kt=.016474835887320276:kt=.16919298733903063:kt=.07633203630214054:kt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?kt=.14150493354700563:kt=-.01831155354975749:t[1]>28.500000000000004?kt=-.07952557178685365:t[10]>28.500000000000004?kt=.0665695554984927:kt=-.053640139319277094:kt=.0004754840665898665;let Ht;t[76]>1e-35?Ht=-.06814884255939921:t[179]>1e-35?Ht=-.06325743795510681:t[122]>1e-35?t[6]>36.50000000000001?Ht=.05052338063261613:t[8]>626.5000000000001?t[1]>38.50000000000001?Ht=.004193658608848433:Ht=-.1066968975983452:t[8]>302.50000000000006?Ht=.05476730110440451:Ht=-.06382970920394895:t[218]>1e-35?t[2]>3.5000000000000004?t[6]>13.500000000000002?t[2]>19.500000000000004?t[0]>3200.5000000000005?t[4]>91.50000000000001?Ht=-.12156071809840739:t[9]>21.500000000000004?t[5]>3883.5000000000005?t[8]>919.5000000000001?t[8]>1085.5000000000002?Ht=.013555772109446666:Ht=-.09856116699770784:Ht=.0284329611813383:t[2]>52.50000000000001?Ht=.04008708444763762:t[9]>29.500000000000004?Ht=-.1289599546008197:Ht=-.018566534248335896:t[8]>747.5000000000001?Ht=.02236484980076122:Ht=.1148871655157582:t[8]>3084.0000000000005?Ht=-.05573875952902531:t[10]>17.500000000000004?t[2]>51.50000000000001?Ht=.03164751204281298:Ht=.11752140436184891:t[9]>42.50000000000001?Ht=-.07180559595410106:t[22]>1e-35?Ht=.09325040416256854:Ht=-.016041122807939914:Ht=-.02765708954618808:t[1]>30.500000000000004?t[1]>66.50000000000001?Ht=-.010718250133458515:Ht=.09818827994853763:Ht=.010180038981174032:Ht=-.039472162599295535:t[9]>170.50000000000003?Ht=-.08536729235976731:t[189]>1e-35?t[0]>5269.500000000001?Ht=-.08674788057474031:Ht=.02077653508548371:Ht=-.0003536561382007414;let F;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?F=.018337297491457794:F=-.05926206443180149:F=.024026520855881126:t[288]>1e-35?t[184]>1e-35?F=.10747078482128616:t[126]>1e-35?F=-.10550625192391357:t[7]>71.50000000000001?F=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?F=.1317396472229434:F=-.025035791351328947:F=-.0728334305864372:t[8]>963.5000000000001?F=.023642201723096064:F=.183010326734258:t[128]>1e-35?F=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?F=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?F=-.1088876900335281:F=.02758317023002635:F=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?F=-.01928020117446408:F=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?F=.07893723375925096:F=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?F=-.10301657587280551:F=.005787463140224318:F=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?F=-.019296977889522397:F=-.07274529751752634:t[1]>30.500000000000004?F=-.050368901143148286:F=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?F=.0015332402792773946:F=.09930153676749967:F=-.06370844564357069:F=.00042272155209927616;let se;t[71]>1e-35?t[4]>17.500000000000004?se=.12586844370423247:se=-.006791999603126354:t[222]>1e-35?t[1]>10.500000000000002?t[30]>1e-35?t[1]>36.50000000000001?t[9]>1.5000000000000002?t[10]>25.500000000000004?se=-.08474891624263797:t[8]>125.50000000000001?se=.08125086980439704:se=-.04082085238068532:t[0]>3863.5000000000005?se=.020481535807469208:se=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?se=-.019110200161573936:se=-.12387719685855114:t[0]>1102.5000000000002?se=.08376595701957407:se=-.031821919580524834:t[9]>4.500000000000001?se=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?se=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?se=.1349841206807871:se=.011864053595560297:t[1]>41.50000000000001?se=-.08203662486612544:t[2]>18.500000000000004?se=-.009541865642346947:se=.08345043168501759:t[2]>10.500000000000002?se=-.09585031818030947:se=.019432330487099865:se=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?se=.11951517733981365:se=-.016651014735738538:t[1]>28.500000000000004?se=-.07410922545030711:t[10]>28.500000000000004?se=.05886430683844788:se=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?se=.04802269879144705:se=-.026208212831796737:t[4]>45.50000000000001?se=-.03227476944664786:se=.05124575625622705:se=.00020506696916003137;let be;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?be=-.03042091758483443:t[10]>14.500000000000002?be=.09816619204768777:be=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?be=-.02381165060401718:be=-.10950361804974783:be=.03538211665111128:t[212]>1e-35?t[19]>1e-35?be=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?be=-.06371052144380579:be=.0835500621252692:be=-.10408255929333915:t[1]>74.50000000000001?be=.13208968122712403:t[1]>64.50000000000001?be=-.04778844603644965:t[8]>51.50000000000001?t[8]>201.50000000000003?t[8]>660.5000000000001?t[6]>4.500000000000001?t[9]>5.500000000000001?t[1]>29.500000000000004?t[0]>3830.5000000000005?be=.09922816902423433:be=.016366955328796718:be=.1592412560903584:t[1]>39.50000000000001?be=.05409467990258923:be=-.08260633210459611:be=-.06307205775247567:t[9]>36.50000000000001?be=.040253940015648144:be=.14202568969471283:be=-.028761848341594044:be=.08994073058773508:t[0]>807.5000000000001?be=-.043427848826323195:be=.04573516446846493:t[20]>1e-35?t[188]>1e-35?be=-.0758877731600639:t[23]>1e-35?be=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?be=.08124700978741987:be=.013296063087086852:t[7]>5.500000000000001?be=-.01640196088612987:be=-.12685498840146067:be=-.0004940792382459551;let Fe;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?Fe=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?Fe=.08513773825688947:Fe=-.1184664832315282:Fe=.05676963535893477:Fe=.14263843210340613:Fe=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?Fe=-.10669720555606924:Fe=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?Fe=.0664744575868955:Fe=-.08469256188890871:Fe=-.026746678040592144:t[281]>1e-35?Fe=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?Fe=.012131807587207655:Fe=-.12776015795398743:Fe=.04320472481083551:Fe=.08390980661550446:t[10]>227.50000000000003?Fe=-.09771783809101153:t[10]>130.50000000000003?Fe=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?Fe=-.07610698254064358:t[8]>902.5000000000001?Fe=-.03136381213599649:t[131]>1e-35?Fe=.0704821739127936:t[224]>1e-35?Fe=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?Fe=.10431473040024908:t[8]>841.5000000000001?Fe=.07304745320500514:Fe=-.038011541882439825:Fe=-.01679746695007364:t[0]>3129.5000000000005?Fe=.05589952587431965:t[210]>1e-35?Fe=.06227198085800842:Fe=-.0011341890997947812:t[8]>740.5000000000001?Fe=.04817300084412584:Fe=-.000577001010789238;let Ue;t[187]>1e-35?t[6]>12.500000000000002?t[10]>8.500000000000002?t[10]>16.500000000000004?t[8]>234.50000000000003?t[4]>43.50000000000001?t[0]>4476.500000000001?Ue=-.10504730480402079:t[5]>3341.5000000000005?Ue=.11087894671081754:Ue=-.0406668834674614:Ue=.03308382165616109:t[8]>104.50000000000001?Ue=-.10431436764549162:Ue=.0073928337244891455:t[4]>34.50000000000001?Ue=-.10571751512748416:Ue=-.006081128814142983:t[13]>1e-35?Ue=.1299673566095023:t[4]>60.50000000000001?Ue=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?Ue=.04857126072645073:Ue=-.03431365358104773:t[4]>16.500000000000004?Ue=.04101865986596709:Ue=.16480274980378218:t[10]>26.500000000000004?Ue=.03673978504199255:t[10]>9.500000000000002?Ue=-.10996402743800027:t[308]>1e-35?Ue=.0553693735082498:Ue=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?Ue=.010902983761213922:Ue=.1325118659895645:Ue=-.064362945508595:t[1]>66.50000000000001?Ue=.033416767779331176:Ue=-.054080316225040496:t[42]>1e-35?Ue=-.07762364337810815:t[10]>1089.5000000000002?Ue=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?Ue=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?Ue=.0220102041325908:Ue=-.06516708740003069:Ue=.012833498905748267:t[224]>1e-35?Ue=-.007038418272997865:Ue=.00037666304316290967;let me;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?me=.07554189644995735:me=-.052089349455904946:me=-.10148206848169845:t[113]>1e-35?me=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?me=.07172653627995676:me=-.07602959317610998:me=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?me=-.0399322883690891:me=.06523495517476098:me=-.10358715295743802:t[193]>1e-35?me=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?me=.015928764772252406:me=.1341513061552287:me=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?me=-.033592997607280156:me=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?me=-.08402551858097379:me=.017401984506038796:t[1]>25.500000000000004?me=.13337205393591278:me=-.01160208350090984:me=.06708317942315471:t[8]>227.50000000000003?me=-.08486943882418681:me=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?me=-.10496268177586783:me=-.020921489532370493:me=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?me=.11639296062157028:me=-.004275784356569115:t[32]>1e-35?me=-.07297384970166025:me=.006026841626381599:me=.002034611134960428;let Z;t[248]>1e-35?Z=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Z=-.06455513326540585:t[1]>29.500000000000004?Z=.07718474591552532:t[4]>7.500000000000001?Z=.040139336931404826:Z=-.09685734690563386:Z=.00015327283570347363:t[9]>88.50000000000001?Z=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?Z=-.04077257804338707:Z=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?Z=.03778141591008941:Z=-.06459919920634845:Z=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?Z=.14063930759326346:t[0]>179.50000000000003?Z=.07287482250668585:t[8]>1180.5000000000002?Z=-.14419393112726253:t[10]>28.500000000000004?Z=-.07993142770099469:t[17]>1e-35?Z=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?Z=.05527969663610186:Z=-.10824385941441346:t[3]>11.500000000000002?Z=.12358502961047915:Z=-.017509147119622873:t[0]>74.50000000000001?Z=-.014907705458730486:t[8]>95.50000000000001?Z=-.02225118168342062:Z=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?Z=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?Z=.04962819555610421:Z=-.07213577821855309:Z=.09139529824708481:t[19]>1e-35?Z=.013439401088345224:Z=-.049274647207292056:Z=.10531673719686951;let ve;t[40]>1e-35?t[0]>1937.5000000000002?ve=-.06421671152073961:ve=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?ve=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?ve=-.03520420769287065:t[8]>1085.5000000000002?ve=-.019817352506127633:ve=.11444439424520964:ve=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?ve=-.010490117519863269:ve=.08104430117757461:t[121]>1e-35?t[243]>1e-35?ve=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?ve=.06619344145920268:t[0]>4091.5000000000005?ve=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?ve=.10016091391222309:ve=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?ve=-.019511460451434884:ve=-.11643672465055221:t[2]>18.500000000000004?ve=.07848228087333317:t[8]>55.50000000000001?ve=.032583027899956235:ve=-.11209832692153521:t[11]>1e-35?ve=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?ve=-.09996887746328006:t[9]>2.5000000000000004?ve=.02157682011863397:ve=-.05247727848991843:ve=.07409150201483244:t[1]>38.50000000000001?ve=-.11378466075449625:t[224]>1e-35?ve=-.10741749127732923:t[1]>26.500000000000004?ve=.07343136534146562:ve=-.07013573628594773:t[25]>1e-35?ve=-.04626669734164317:ve=.05518333197956482:ve=.00032434010867555516;let Ge;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?Ge=.026313251010808853:Ge=-.08997339150292381:Ge=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?Ge=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?Ge=.0905155504503746:t[8]>1049.5000000000002?Ge=-.062312558183394054:t[8]>719.5000000000001?Ge=.09583836191410239:t[0]>3719.5000000000005?Ge=-.0778097309430818:Ge=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?Ge=-.12920865648544927:t[0]>2699.5000000000005?Ge=-.07086587879041864:Ge=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?Ge=-.11377786322600797:Ge=-.009486325820117998:t[1]>55.50000000000001?Ge=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?Ge=-.07938291201004219:t[2]>36.50000000000001?Ge=.01520046732530246:Ge=.13649854049662832:Ge=-.07145015938528873:t[8]>407.50000000000006?Ge=-.00350257360822279:Ge=.11332047082193297:Ge=-.10060624458629897:Ge=.05429496612497562:t[8]>1446.5000000000002?Ge=.006073419197482838:Ge=-.08718676350883998:Ge=-.11532497988252638:Ge=.10766270463068293:t[34]>1e-35?Ge=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?Ge=-.0004109812623829506:Ge=.021601073497455662:Ge=-7343540098965853e-20;let Qe;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?Qe=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?Qe=.05995640200798119:t[0]>3443.5000000000005?Qe=-.14698883458733583:Qe=-.030039164579240187:t[189]>1e-35?Qe=-.06086763220538141:t[1]>86.50000000000001?Qe=-.05096727866142538:t[4]>64.50000000000001?Qe=.11240554253834577:t[4]>45.50000000000001?Qe=-.030279760168394117:t[6]>45.50000000000001?Qe=.10161088917815142:t[10]>77.50000000000001?Qe=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?Qe=-.06672020005240323:Qe=.08831457502630258:t[8]>2592.5000000000005?Qe=-.052617701047376654:t[10]>29.500000000000004?Qe=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?Qe=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?Qe=-.064099222705728:Qe=.044332487521538365:t[0]>2882.5000000000005?Qe=.031099546885005065:Qe=.12938467051623853:t[0]>4221.500000000001?Qe=-.0928676413498701:t[9]>30.500000000000004?Qe=-.05781824812803708:Qe=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?Qe=-.06648105454098469:Qe=.05985487552383097:Qe=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?Qe=.05282385499619401:t[1]>66.50000000000001?Qe=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?Qe=.027885690791379255:Qe=-.08407126408362446:Qe=.014432924125571093:Qe=-9903435845205118e-20;let je;t[76]>1e-35?je=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?je=.013633653464240465:je=-.10164319411983509:je=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?je=.00632864847804078:je=-.08393000368134668:je=.07870508617440916:t[284]>1e-35?je=.1092302727710421:je=-.0025505047582483234:t[248]>1e-35?je=.07101822393621864:t[274]>1e-35?je=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?je=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?je=.025081789181021243:je=-.014813325803582618:t[9]>33.50000000000001?je=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?je=.11926990418060353:je=.01852125513565268:je=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?je=-.1178464984373743:t[283]>1e-35?je=.043370859226927405:t[5]>4320.500000000001?je=-.01103141226366587:t[8]>1104.5000000000002?je=-.023053423988095886:je=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?je=.000579145585864887:je=.03389152834202143:t[128]>1e-35?je=-.14527722052568462:t[210]>1e-35?je=-.08915971541902741:t[7]>9.500000000000002?je=-.03307314577076116:t[18]>1e-35?je=-.05521712302023565:je=.009315605032770029:je=.0036332551852289933;let J;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?J=-.07583539600416284:t[188]>1e-35?J=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?J=-.011038193049597113:J=.08154028164397753:t[1]>85.50000000000001?J=.10259361975201933:J=.011640408330521594:J=-.00023319159023748508:t[92]>1e-35?J=.13771692859530546:J=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?J=.09967230141007705:t[30]>1e-35?J=-.08888529037551285:J=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?J=.08284665960761373:J=-.029292565021289504:t[7]>7.500000000000001?J=-.09945093355204493:J=-.008381393701708593:t[20]>1e-35?J=-.04218678460370465:t[10]>6.500000000000001?t[9]>2.5000000000000004?t[1]>13.500000000000002?t[8]>143.50000000000003?t[4]>7.500000000000001?t[2]>36.50000000000001?J=.07585582641438211:t[8]>284.50000000000006?J=-.029387993239886723:J=.07716738177321587:t[1]>18.500000000000004?J=.026745348497993746:J=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?J=.02337306890530338:J=-.10390355904767366:J=.07390521199638532:J=-.06788247515155237:J=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?J=-.06360325615644084:J=.04342192339836601:J=-.10598779152030145:J=.05253384605768211;let ae;t[3]>7.500000000000001?t[157]>1e-35?ae=-.07514182877923786:ae=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ae=.028692053800951845:ae=.14081686716133598:ae=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?ae=.0037139292567243084:ae=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?ae=.01202688580305612:ae=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?ae=.043935495082738626:ae=-.05639305759669704:t[247]>1e-35?ae=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?ae=.10331836202616368:ae=.0006926658459781341:t[96]>1e-35?ae=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?ae=-.0741403257305367:ae=.022900127535540854:t[7]>3.5000000000000004?ae=.038110741403836294:ae=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?ae=-.09552842289807008:t[1]>27.500000000000004?ae=.012505935885798007:ae=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?ae=-.1046104767723845:ae=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?ae=.023466328488582572:ae=.11730925774586994:ae=-.04771965631104874:ae=.17059689880751394:ae=-.08181850955999449:t[26]>1e-35?ae=-.12727482696678769:ae=-.014343123272734182;let Ce;t[147]>1e-35?t[1]>53.50000000000001?Ce=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Ce=-.02763546051134888:Ce=.06423344777499343:Ce=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?Ce=.049825139823021586:t[7]>22.500000000000004?Ce=-.01131680751379858:t[0]>2579.5000000000005?Ce=-.10673674485369694:Ce=-.015387212937189957:Ce=.04347325151148724:t[179]>1e-35?Ce=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?Ce=.0650355590939066:Ce=-.0473332870892226:Ce=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?Ce=.11139543329789044:t[126]>1e-35?Ce=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?Ce=.06370903833231022:t[10]>29.500000000000004?Ce=.03415223859607161:t[10]>3.5000000000000004?Ce=-.07415518117873297:Ce=-.0014119203473324082:Ce=.12617652343819508:t[9]>41.50000000000001?Ce=-.10311145857176976:t[8]>2757.5000000000005?Ce=-.08106484219011428:t[7]>71.50000000000001?Ce=-.09783384432091176:t[1]>88.50000000000001?Ce=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?Ce=-.008884084501608536:Ce=.061339437777743616:Ce=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?Ce=.01526664064166223:Ce=.13534828515415498:Ce=-.06985484465894776:Ce=.0005758961943178744;let Re;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Re=-.029152732370514342:Re=.07173628916139178:t[1]>36.50000000000001?Re=-.08859111297255318:Re=.0018030071815630785:Re=.13652461563759322:Re=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Re=-.07145140450454163:t[21]>1e-35?Re=-.07422841663493233:Re=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Re=.11864240653986852:t[3]>33.50000000000001?Re=-.08821209591953476:Re=.05706392280054726:Re=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Re=.01953613016837112:Re=-.059781039130025006:t[148]>1e-35?Re=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Re=.07207826841738371:t[202]>1e-35?Re=.08163917539410503:Re=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Re=-.06858280496900336:Re=-.1781828899516648:Re=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Re=.018232649414147116:Re=-.04419781124222661:Re=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Re=.11452368095776105:Re=-.036496437259924026:Re=-.040445338739465486:Re=.0816572651001145:Re=-.08968914517368663:Re=.0002826343082585516;let $e;t[189]>1e-35?t[0]>5269.500000000001?$e=-.08839493050459957:t[10]>85.50000000000001?$e=.10046908365702462:t[8]>2592.5000000000005?$e=-.09632233975926387:t[8]>2000.5000000000002?$e=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?$e=.035504970430426296:t[1]>31.500000000000004?$e=-.1133764813142531:$e=-.01138280942244812:t[8]>1125.5000000000002?$e=.09800530246229806:$e=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?$e=.07316772160107896:$e=-.059095014819051765:$e=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?$e=-.09150209066166894:t[8]>3084.0000000000005?$e=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?$e=-.04449234460408263:$e=.05568837973347338:$e=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?$e=.12741077850267066:$e=.007372371864985329:t[2]>39.50000000000001?$e=.02295917234617787:$e=.14966532083907075:t[1]>39.50000000000001?$e=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?$e=-.02511861881285652:t[1]>27.500000000000004?$e=.08683660011672288:$e=.02956214835267301:t[9]>15.500000000000002?$e=-.016538805462996232:$e=.04352738094981517:$e=-.05561856645643868:t[9]>170.50000000000003?$e=-.07996752635874248:t[179]>1e-35?$e=-.09065975936933919:$e=-.00042817975060427177;let Ye;t[39]>1e-35?t[4]>25.500000000000004?Ye=.03443173196222934:Ye=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?Ye=-.0013415395759330318:Ye=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?Ye=.002297618040307216:Ye=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?Ye=-.015297257305397608:Ye=.09651828834062742:Ye=-.06636003334371929:t[10]>11.500000000000002?Ye=.17631616138309397:t[0]>1639.5000000000002?Ye=3804386478092585e-20:Ye=-.09099296398683193:Ye=-.06874415876172972:t[0]>2151.5000000000005?Ye=-.1311264883406766:Ye=.00809052010141122:t[253]>1e-35?Ye=-.06338558211939296:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?t[10]>10.500000000000002?t[0]>3615.5000000000005?Ye=.045038497754638605:Ye=-.07770167665661752:Ye=-.08596294280650517:Ye=.08538655727027213:Ye=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?Ye=.054627956617973275:t[1]>61.50000000000001?Ye=-.11994465088415499:t[4]>8.500000000000002?Ye=.06676200239406452:Ye=-.027503148069376867:t[8]>676.5000000000001?Ye=-.10363964928357075:t[4]>8.500000000000002?Ye=-.07589816227175682:Ye=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?Ye=.009093153189012338:Ye=-.06119765876605404:Ye=.0004668642103528348;let lt;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?lt=-.10100794502567233:lt=.08000205636470442:lt=-.11945419826856896:t[113]>1e-35?lt=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?lt=.1224302423880318:lt=-.01875566982911468:t[222]>1e-35?t[1]>8.500000000000002?t[1]>24.500000000000004?t[4]>3.5000000000000004?t[0]>725.5000000000001?t[0]>1682.5000000000002?t[0]>2860.5000000000005?lt=.0019277012166729114:t[1]>28.500000000000004?lt=-.054445821715687494:lt=.045645722976713245:t[30]>1e-35?lt=.13402660155331655:lt=.008921176001777645:lt=-.058547426505451076:lt=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?lt=-.13526418192218206:lt=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?lt=.0007263224246135398:lt=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?lt=-.11575657261278308:lt=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?lt=-.01995960178292952:lt=.11216586049153021:lt=-.10050961087149474:lt=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?lt=.10303451081526649:lt=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?lt=-.043799548968209395:lt=-.12451444314954115:t[4]>12.500000000000002?lt=-.03838117361958468:lt=.06504990789767144:t[57]>1e-35?lt=.06890006938293915:lt=.0003914274695562949;let yt;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?yt=.004271749009686975:yt=-.10523878297127605:yt=.04633982158107851:yt=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?yt=-.08655730561951676:t[8]>919.5000000000001?yt=-.0676453705610183:t[7]>18.500000000000004?yt=-.027787974193650575:yt=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?yt=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?yt=-.03473877164537313:t[8]>719.5000000000001?yt=.10471053866934404:yt=.008236107678382981:t[4]>57.50000000000001?yt=.09412219478825269:t[10]>66.50000000000001?yt=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?yt=-.040681323751002293:yt=.06374650297561021:yt=.12884615227401788:t[10]>5.500000000000001?yt=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?yt=-.05474068967150784:yt=.03744700650806603:yt=-.07846396348680855:t[1]>42.50000000000001?yt=.018972315810821302:yt=.10953621007604744:t[5]>4439.500000000001?yt=.010999776705494586:t[1]>40.50000000000001?yt=-.12394200059775967:t[10]>2.5000000000000004?yt=.013528093962849453:yt=-.09222088417048682:yt=-.12662967149701485:yt=.09327296405849603:t[3]>99.50000000000001?yt=-.013581954439986752:yt=.0005526498251862075;let $t;t[187]>1e-35?t[243]>1e-35?$t=-.08392792551692502:t[10]>68.50000000000001?$t=.07871769409454053:t[10]>8.500000000000002?t[10]>16.500000000000004?t[2]>17.500000000000004?t[3]>31.500000000000004?t[91]>1e-35?t[10]>21.500000000000004?t[10]>33.50000000000001?t[10]>48.50000000000001?$t=-.0825306209711224:$t=.049559996084532945:$t=-.1064938580886302:$t=.03353240732240275:$t=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?$t=.16966001471529374:t[1]>57.50000000000001?$t=-.005772777673676247:$t=.09383677041525058:t[8]>747.5000000000001?$t=.054068175469351235:$t=-.049968216310277036:t[8]>753.5000000000001?$t=-.0679383555784074:t[4]>8.500000000000002?$t=-.059757341189735386:$t=.05701083682780414:$t=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?$t=.05820296128730006:$t=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?$t=.15340611616954566:$t=.04385036188666874:t[0]>4449.500000000001?$t=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?$t=.004840354641006495:$t=.09967827580276283:$t=.11605363537391578:t[9]>19.500000000000004?$t=-.0735831692725717:$t=.019973331823355176:t[306]>1e-35?t[149]>1e-35?$t=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?$t=-.02442182361342386:$t=.10334853004243093:$t=-.030431948680167104:$t=-956078595250818e-19;let St;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?St=-.040232505718244854:t[0]>3030.5000000000005?St=.0634109586813073:St=-.04043617034245621:St=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?St=-.007859096946435131:St=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?St=.05515771679628051:St=-.04214471312668263:St=-.09589322222261765:t[193]>1e-35?St=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?St=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?St=-.08152604001147906:t[11]>1e-35?St=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?St=.13100930780107503:t[10]>25.500000000000004?St=.05921074710011526:St=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?St=.0009447118243153454:St=-.09820565036865991:St=.057146909749745546:t[0]>2115.5000000000005?St=-.12331216726611678:St=.007281983677694285:t[2]>56.50000000000001?St=.012310154675612615:St=-.08873665774670461:t[6]>25.500000000000004?St=.134708740821879:t[9]>5.500000000000001?St=-.0805901581148979:t[224]>1e-35?St=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?St=.10842593386554122:t[2]>13.500000000000002?St=.06466798320378395:St=-.08578130788886655:St=-.03590892078300114:St=.0003499894043880708;let We;t[134]>1e-35?t[6]>50.50000000000001?t[0]>3601.5000000000005?We=.10839808814624702:We=-.028043875308180352:t[7]>30.500000000000004?t[8]>932.5000000000001?We=-.007478368069393829:We=-.09066751344326617:t[0]>3588.5000000000005?t[5]>4748.500000000001?We=.04035247751736232:t[0]>4255.500000000001?We=-.1310865624507367:t[0]>4004.5000000000005?We=.06647367311982634:We=-.08339693352955757:t[4]>10.500000000000002?t[1]>34.50000000000001?We=-.011618902907510411:We=.1114646660406691:t[10]>2.5000000000000004?t[0]>3072.5000000000005?We=.09356028223727986:We=-.03811765057032162:We=-.09456215497345526:t[280]>1e-35?t[7]>70.50000000000001?We=.10322956436499003:t[2]>22.500000000000004?t[1]>83.50000000000001?We=.1146142460964847:t[1]>62.50000000000001?We=-.09679869865322362:t[9]>71.50000000000001?We=-.07377580769927583:t[4]>19.500000000000004?t[0]>4571.500000000001?We=-.039046426387852974:We=.04558778688367152:We=.11220830937352602:t[7]>5.500000000000001?t[9]>17.500000000000004?t[8]>1067.5000000000002?We=.03261697816211156:t[15]>1e-35?We=.02586252542264368:t[2]>14.500000000000002?We=-.016420452667484604:We=-.1011799626006976:We=-.13787471318963773:t[6]>4.500000000000001?t[8]>427.50000000000006?t[10]>36.50000000000001?We=.010193588102560583:We=.11748729525930773:We=-.04468162226743652:We=-.028365274393617957:t[71]>1e-35?We=.05115139346588793:We=-.0001510425316936658;let ce;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ce=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ce=.020637047900190317:ce=-.1017300802134141:t[1]>23.500000000000004?t[9]>12.500000000000002?t[0]>2815.5000000000005?t[0]>3183.5000000000005?t[3]>23.500000000000004?t[3]>45.50000000000001?t[4]>48.50000000000001?ce=-.04632587527094407:ce=.08603684785510396:ce=-.05101401015448496:ce=.025466432054358498:ce=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ce=.020385355430046367:ce=.12032592051335252:ce=-.012387370292173013:t[2]>23.500000000000004?ce=-.12568545484492677:ce=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ce=.043528764484784536:ce=.14352071657196003:ce=-.009332833816977268:ce=.11186782227735846:ce=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ce=-.05649104643152564:ce=.03884200719305747:t[42]>1e-35?ce=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ce=-.04103416502526736:ce=.04881823954656287:t[4]>15.500000000000002?ce=.009342724662897898:t[0]>3969.5000000000005?ce=-.025637309961309498:ce=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ce=-.08185697075265091:t[0]>2215.5000000000005?ce=.030063975892297354:t[0]>807.5000000000001?ce=-.03924325550733229:ce=.0415330999189793:ce=-.00024374664461674863;let Pe;t[3]>7.500000000000001?Pe=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Pe=.025798416259686565:Pe=.13251610353146012:Pe=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?Pe=-.11098564237775424:Pe=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?Pe=.15347826616466054:t[3]>4.500000000000001?Pe=.10379320730958941:Pe=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?Pe=.03159791088468647:Pe=-.10612873364104258:Pe=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?Pe=-.02335760775001469:Pe=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?Pe=-.011164334474672973:Pe=-.06594044410501655:t[207]>1e-35?Pe=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?Pe=-.01725821503981916:Pe=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?Pe=-.04226531631656534:Pe=-.14409800530171432:Pe=-.03245576341206398:t[8]>4214.500000000001?Pe=.0895409165534886:t[247]>1e-35?Pe=-.06506383629143335:t[118]>1e-35?Pe=-.07214270121257443:t[8]>546.5000000000001?Pe=-.004385020865473831:Pe=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?Pe=.046278501133958524:Pe=-.030835570926968044:t[0]>493.50000000000006?Pe=-.12794504651610425:Pe=.009415039807550776;let Me;t[304]>1e-35?Me=-.04717777269217453:t[76]>1e-35?Me=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Me=-.09648224457374217:t[132]>1e-35?Me=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Me=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Me=.10838431695638147:t[230]>1e-35?Me=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Me=.050071316251979:Me=-.006356941111525215:t[6]>8.500000000000002?Me=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Me=.10217402850540398:Me=-.048840949025349197:Me=-.03668313197909846:t[7]>39.50000000000001?Me=-.0562642841496003:t[10]>2.5000000000000004?Me=.09749777369987417:Me=-.04848223121417616:t[0]>5453.500000000001?Me=.08316648226133942:Me=-.0261979698267618:t[212]>1e-35?Me=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Me=.04837009746506856:Me=-.09184360565631328:Me=.0032411047845613606:t[0]>4733.500000000001?Me=.0977378556864798:Me=.010776545559325588:Me=-.012483310473120218:Me=-.049284121449103935:Me=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Me=-.08380361910948711:Me=.07375088778585813:Me=-.1084864186071348:Me=.0007819503469605476;let ye;t[7]>17.500000000000004?t[115]>1e-35?ye=.08741852531696623:t[167]>1e-35?ye=.10078975495600809:ye=-.0018324767784017562:t[290]>1e-35?ye=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?ye=.1379733311640402:ye=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?ye=-.09360083033774169:ye=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?ye=-.015599362579530679:t[0]>4593.500000000001?ye=-.12029549262691491:ye=-.018917032256501397:ye=.04632831686576592:ye=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?ye=-.05894883236412263:ye=.05213944998315824:ye=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?ye=.07577412405680808:ye=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?ye=-.0277076900736147:t[1]>65.50000000000001?ye=-.023587471585763506:ye=.10184896592433082:ye=-.057699270527916825:ye=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?ye=.06566902102799584:t[10]>25.500000000000004?ye=-.07033633753181047:ye=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?ye=-.08108035861059537:ye=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?ye=-.12431182772561139:ye=.01886235886984271:ye=.0025579594894418116;let oe;t[8]>2915.5000000000005?t[101]>1e-35?oe=.08648323956719083:t[0]>93.50000000000001?t[196]>1e-35?oe=-.09509320772734361:t[4]>1.5000000000000002?t[5]>1106.5000000000002?t[5]>1191.5000000000002?t[283]>1e-35?oe=-.11268313808648661:t[10]>12.500000000000002?t[131]>1e-35?oe=.0687641681341721:t[10]>102.50000000000001?oe=-.09667920080214842:t[4]>15.500000000000002?t[8]>2992.5000000000005?t[1]>24.500000000000004?t[1]>71.50000000000001?oe=-.06762578396473291:t[10]>65.50000000000001?oe=-.05226727783610509:t[282]>1e-35?oe=.09911438410640917:t[19]>1e-35?oe=.06915156336429933:oe=-.006565637886508241:oe=-.08344300251849307:oe=-.0928863907927501:t[1]>60.50000000000001?t[2]>17.500000000000004?oe=.19428463865406298:oe=.016073883020956765:t[13]>1e-35?oe=.06864077097923665:oe=-.01388867527034731:t[0]>1847.5000000000002?oe=.004655280608161356:t[1]>40.50000000000001?oe=.031406054057765996:oe=.12798062439212832:oe=.09859670536264255:t[10]>2.5000000000000004?t[9]>68.50000000000001?oe=.08821759640665892:t[9]>32.50000000000001?t[8]>3960.0000000000005?t[1]>31.500000000000004?oe=-.0706095614785733:oe=.04227164041372561:oe=-.1056906923176064:t[2]>8.500000000000002?t[19]>1e-35?oe=-.07139533369873902:oe=.008952586782921625:oe=.06086212582180936:oe=-.0816938490403437:oe=-.051224901945956025:oe=-.10525399124186095:oe=.000270924147208224;let Ke;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?Ke=.029186512383291244:t[7]>1.5000000000000002?Ke=-.14984127276725573:t[1]>40.50000000000001?Ke=.032757060730648144:Ke=-.07675575422749602:t[6]>8.500000000000002?Ke=.10599766037117893:Ke=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?Ke=-.051394622947855385:Ke=.03237141302699347:Ke=.12526173027943244:Ke=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Ke=-.07383912482657777:t[0]>5147.500000000001?Ke=.07008813937042091:t[10]>38.50000000000001?Ke=-.06779203808365307:Ke=-.013782769999524498:Ke=.0880038869117715:Ke=-.12846294176070952:t[281]>1e-35?Ke=-.06810806903850834:t[10]>227.50000000000003?Ke=-.08937977001661111:t[10]>130.50000000000003?Ke=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?Ke=.011036530162093841:Ke=-.11500797478569702:Ke=.03702229366129399:Ke=.07242026683784307:t[189]>1e-35?Ke=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?Ke=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?Ke=-.02608892716555304:Ke=.09609599320761308:t[9]>105.50000000000001?Ke=-.06848127135991534:Ke=.0023675721254089715:t[86]>1e-35?Ke=-.11049635625500497:Ke=-.004847764219432233;let at;t[125]>1e-35?t[0]>3969.5000000000005?at=-.09462233499115416:at=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?at=-.030700661288166148:at=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?at=.03149547314036763:at=-.08166208257451366:t[0]>5850.500000000001?at=-.10228136324773157:t[102]>1e-35?at=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?at=.01782894842128785:t[13]>1e-35?at=.002680190260979968:at=.1773965720476949:t[2]>72.50000000000001?at=.09090831938627947:t[1]>59.50000000000001?at=-.12297206702816128:t[0]>4977.500000000001?at=.09899015653118268:at=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?at=-.0675900954187773:at=.012336403425364092:at=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?at=-.02671721777458802:at=-.09242452991958029:t[284]>1e-35?at=-.08585691288582491:at=.013332890564324447:t[4]>14.500000000000002?at=-.005245022074799553:t[23]>1e-35?at=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?at=-.09289852307936758:t[116]>1e-35?at=-.09686573010015055:t[8]>804.5000000000001?at=.03812547148215318:at=.005162744968176633:t[9]>43.50000000000001?at=-.059246106396159376:at=.050370113808135275:at=.000794041852811028;let Gt;t[3]>7.500000000000001?Gt=.0004981426543104341:t[9]>114.50000000000001?Gt=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Gt=-.019061766497948867:Gt=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Gt=-.006044199577160493:Gt=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Gt=.11486607015912494:t[9]>16.500000000000004?Gt=-.08686820858087294:Gt=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Gt=-.022230207980026437:Gt=.1056683690528792:Gt=-.05859530800943035:Gt=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Gt=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Gt=-.05177544573528314:Gt=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Gt=.15159657923771555:Gt=-.0060542654587671055:t[9]>5.500000000000001?Gt=-.042808028205051786:t[1]>48.50000000000001?Gt=-.010449538258110742:Gt=.10026907521968294:Gt=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Gt=-.02272452389409874:Gt=-.11202691218244319:t[5]>1809.5000000000002?Gt=-.04460413584255906:Gt=.08196329474205256:t[10]>69.50000000000001?Gt=.10221481166238167:Gt=.0004063052701699382:t[243]>1e-35?Gt=-.07563941678849846:t[18]>1e-35?Gt=.02563513231103432:Gt=-.004740081147303786;let gr;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?gr=.057446442918106:gr=-.04404018270156349:gr=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?gr=-.05930486238817954:t[1]>29.500000000000004?gr=.06955866121256543:t[8]>597.5000000000001?gr=-.06538593556505168:gr=.06212512595497445:gr=.00021102929959182257:t[9]>90.50000000000001?gr=.0958061289119631:t[102]>1e-35?gr=.07172059675638813:t[1]>47.50000000000001?gr=-.03879798603977766:t[297]>1e-35?gr=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?gr=.003805910996312012:gr=.09304295674749524:t[11]>1e-35?t[18]>1e-35?gr=.11252376801858695:t[288]>1e-35?gr=-.10293901912180432:gr=.014669268837893872:t[1]>42.50000000000001?gr=-.05988274123836837:t[145]>1e-35?gr=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?gr=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?gr=-.03366718308159971:gr=.11936550608549797:t[1]>31.500000000000004?gr=-.07454716789539667:gr=.027859650621164217:t[10]>10.500000000000002?gr=-.11806374092321247:gr=-.03506042229223101:gr=-.0007080765837654515:t[10]>6.500000000000001?gr=-.028077713664996503:t[2]>7.500000000000001?gr=.15803724124216814:gr=.0351381284833169:gr=-.07877953381054767;let ar;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?ar=.14144941521975005:ar=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?ar=.10514088112381886:t[7]>18.500000000000004?ar=-.10370643555956745:ar=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?ar=-.0508129468802936:t[224]>1e-35?ar=-.037816066368733595:t[10]>43.50000000000001?ar=.07793408602607932:ar=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?ar=.036972453794202324:ar=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?ar=.09475302525132188:ar=-.03580104945898193:ar=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?ar=-.1282448778804823:ar=-.014395808269207212:ar=-.008940927190750592:ar=-.1459118815453748:t[0]>4897.500000000001?ar=-.09733068457286576:t[1]>57.50000000000001?ar=.06575271409540207:ar=-.019556422817450115:ar=-.10623959222984136:t[18]>1e-35?ar=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?ar=.008125645893104896:ar=-.11084368630465868:ar=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?ar=-.05854904579626861:t[4]>5.500000000000001?ar=.02985784951394175:ar=-.03247600140149334:ar=-.11152899295304973:ar=-.00035424577714215764;let Or;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Or=-.06563670567578264:Or=.067656954313663:Or=-.10388217548685377:t[8]>2302.5000000000005?Or=.07190621943790435:t[4]>67.50000000000001?Or=.060020507643618604:t[4]>38.50000000000001?Or=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Or=-.06568134366461277:t[8]>1075.5000000000002?Or=-.004768057709758692:Or=.11785959165999467:Or=-.05080221682879267:Or=.14814206127494542:Or=-.07241946332311736:t[253]>1e-35?Or=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Or=-.02471195342450034:Or=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Or=-.10741850739482771:Or=.010051635824944:Or=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Or=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Or=-.08992396138178163:Or=.010944365997007212:Or=.06221307021813793:Or=.1286024087559141:t[127]>1e-35?Or=.06568148624531012:t[10]>40.50000000000001?Or=-.07567979134643352:t[5]>5647.500000000001?Or=.07594672895572069:Or=-.018158016446439187:t[6]>55.50000000000001?Or=.009293422430111872:t[4]>45.50000000000001?Or=-.017749818406964022:t[2]>46.50000000000001?Or=.01714136511113982:Or=-724762291423549e-19;let Hr;t[1]>24.500000000000004?t[103]>1e-35?t[8]>48.50000000000001?t[17]>1e-35?Hr=-.048689215588703864:t[9]>27.500000000000004?t[0]>3916.5000000000005?Hr=.07084726276890757:Hr=-.11232323677722932:Hr=.04812773089510436:Hr=.11757502216780046:t[5]>1464.5000000000002?t[5]>1505.5000000000002?t[167]>1e-35?Hr=.07470606002425358:t[1]>53.50000000000001?t[132]>1e-35?Hr=.0879462816013881:Hr=-.002966662093626573:t[306]>1e-35?Hr=-.04588085188342676:Hr=.0031910005157084823:t[3]>10.500000000000002?t[10]>20.500000000000004?Hr=-.006600332774461143:Hr=.1272481351557754:Hr=-.09030973597154808:t[284]>1e-35?t[1]>38.50000000000001?t[10]>2.5000000000000004?Hr=.011884312066620044:Hr=.11678751052403374:t[4]>8.500000000000002?Hr=.03627129613273813:Hr=-.12132783497902287:Hr=-.006784372643244717:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Hr=-.06830131718398992:t[0]>5147.500000000001?Hr=.062360406249609306:t[4]>4.500000000000001?Hr=-.013162203864592055:Hr=-.07153029184927609:Hr=.07628618062271557:Hr=-.12085065687320373:t[190]>1e-35?Hr=-.045816889524231186:t[137]>1e-35?Hr=-.07956001795911584:t[199]>1e-35?t[0]>3853.5000000000005?Hr=.025895337822752502:Hr=-.06503949350616421:t[10]>227.50000000000003?Hr=-.09989456525790491:t[10]>130.50000000000003?Hr=.08616651057030683:Hr=.0001234981796706021;let Gr;t[8]>1014.5000000000001?t[9]>137.50000000000003?Gr=-.08778879924617534:t[8]>1022.5000000000001?t[285]>1e-35?t[9]>64.50000000000001?Gr=.04955806187281689:t[0]>3670.5000000000005?t[10]>32.50000000000001?Gr=-.141732381961068:Gr=-.0317152307496497:Gr=-.02074638849097191:t[0]>93.50000000000001?t[0]>3072.5000000000005?t[10]>100.50000000000001?t[4]>24.500000000000004?t[8]>1336.5000000000002?Gr=.12191801556691254:Gr=-.0003444689085397977:Gr=.005739668504631604:t[146]>1e-35?t[308]>1e-35?Gr=.015237524791728777:t[6]>61.50000000000001?t[4]>63.50000000000001?Gr=-.05676033995381961:Gr=.10933961076803381:t[4]>26.500000000000004?Gr=-.11667582544549814:t[8]>1765.5000000000002?Gr=.032174455312047705:Gr=-.0755016390126608:t[293]>1e-35?Gr=-.08234885407658332:t[9]>41.50000000000001?t[0]>3830.5000000000005?Gr=.026571311956824436:t[15]>1e-35?Gr=.06175459479851121:Gr=-.018778084411148754:t[9]>40.50000000000001?Gr=-.09420232889965811:Gr=-.004578248021263184:t[2]>1.5000000000000002?Gr=.005453714644971445:Gr=-.03907138175699279:Gr=-.055296364182154736:t[23]>1e-35?Gr=.036555134842143476:t[0]>4188.500000000001?t[6]>29.500000000000004?Gr=-.09358146510580179:Gr=.060524657996178094:Gr=-.11245101144669545:t[125]>1e-35?t[9]>1.5000000000000002?Gr=-.12698331085931538:Gr=.006059605604079918:t[2]>196.50000000000003?Gr=-.09451315810804783:Gr=.0011390147031687425;let zt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?zt=.05517359070460923:zt=-.04758751221404857:zt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?zt=.1040436595565776:t[9]>21.500000000000004?zt=.04032250517675179:t[107]>1e-35?zt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?zt=.1192453009230486:t[1]>51.50000000000001?zt=.0443376336292195:zt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?zt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?zt=-.08999822408398037:zt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?zt=-.061850439226075:zt=.08849196353361093:zt=.10536348167793089:t[92]>1e-35?zt=.04894947712119185:t[9]>16.500000000000004?zt=.05900227903883853:t[9]>5.500000000000001?zt=-.11946594348916476:zt=-.03652096348071964:t[1]>41.50000000000001?zt=-.07411603110840567:zt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?zt=.08493634342741495:t[11]>1e-35?zt=-.10899097825564363:zt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?zt=.08356655906359918:t[7]>25.500000000000004?zt=-.09475076526194888:t[10]>5.500000000000001?zt=-.01999406228763778:zt=.06696212545889428:t[6]>20.500000000000004?zt=.14713592661393468:zt=.0459917279002218:zt=.00027445928493734093;let _r;t[223]>1e-35?t[1]>31.500000000000004?t[8]>634.5000000000001?_r=-.06904501553217077:_r=.05696231672035904:_r=-.1124703178077813:t[99]>1e-35?t[1]>89.50000000000001?_r=-.05074261170009721:t[1]>57.50000000000001?t[8]>969.5000000000001?_r=-.011419256378538392:t[0]>3830.5000000000005?_r=.140315841503076:_r=.02403434913963024:t[1]>31.500000000000004?t[8]>65.50000000000001?t[2]>10.500000000000002?_r=-.04027822909411164:_r=.03176085103667189:_r=.06779515865838849:t[4]>15.500000000000002?_r=.0762878389015175:t[8]>175.50000000000003?t[0]>3030.5000000000005?t[8]>1041.5000000000002?_r=.06124039747298539:_r=-.04312732764434027:_r=.09161522761808062:_r=-.09663512235460074:t[280]>1e-35?t[6]>45.50000000000001?t[1]>46.50000000000001?_r=.11211681010488772:t[13]>1e-35?_r=.06725735814960367:_r=-.046744031455827846:t[10]>44.50000000000001?t[0]>3400.5000000000005?t[0]>4004.5000000000005?t[2]>22.500000000000004?_r=.11743605068905603:_r=-.011309033539148687:_r=-.07896094707523052:_r=.12862714793172117:t[10]>1.5000000000000002?t[8]>455.50000000000006?t[0]>4706.500000000001?_r=-.09218756798869711:t[10]>19.500000000000004?t[0]>1894.5000000000002?t[0]>3719.5000000000005?_r=.02836295848998302:_r=.12210680366745175:_r=-.058302317470509096:t[5]>4144.500000000001?_r=.06123341960495106:_r=-.03840046906926525:_r=-.05221474543453495:_r=.03988215485860711:_r=-.00033074684693083496;let W0=khc(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+E+_+v+b+T+w+R+x+P+D+N+L+B+j+M+O+U+q+Q+Y+W+V+z+ie+H+te+le+Le+ge+Oe+we+re+ee+K+he+X+de+qe+ne+ue+Ne+Ie+Be+tt+st+_t+kt+Ht+F+se+be+Fe+Ue+me+Z+ve+Ge+Qe+je+J+ae+Ce+Re+$e+Ye+lt+yt+$t+St+We+ce+Pe+Me+ye+oe+Ke+at+Gt+gr+ar+Or+Hr+Gr+zt+_r);return[1-W0,W0]}a(Rhc,"multilineModelPredict");function khc(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(khc,"sigmoid")});var l3i=I(eV=>{"use strict";p();Object.defineProperty(eV,"__esModule",{value:!0});eV.MultilineModelFeatures=eV.PromptFeatures=void 0;eV.hasComment=cDr;eV.requestMultilineScore=Mhc;var X$=s3i(),Phc=a3i(),Dhc={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},c3i={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function cDr(t,e,r,n=!0){let o=t.split(` +`);if(n&&(o=o.filter(l=>l.trim().length>0)),Math.abs(e)>o.length||e>=o.length)return!1;e<0&&(e=o.length+e);let s=o[e];return(Dhc[r]??[]).some(l=>s.includes(l))}a(cDr,"hasComment");var rBe=class{static{a(this,"PromptFeatures")}constructor(e,r){let[n,o]=this.firstAndLast(e),s=this.firstAndLast(e.trimEnd());this.language=r,this.length=e.length,this.firstLineLength=n.length,this.lastLineLength=o.length,this.lastLineRstripLength=o.trimEnd().length,this.lastLineStripLength=o.trim().length,this.rstripLength=e.trimEnd().length,this.stripLength=e.trim().length,this.rstripLastLineLength=s[1].length,this.rstripLastLineStripLength=s[1].trim().length,this.secondToLastLineHasComment=cDr(e,-2,r),this.rstripSecondToLastLineHasComment=cDr(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` `),this.lastChar=e.slice(-1),this.rstripLastChar=e.trimEnd().slice(-1),this.firstChar=e[0],this.lstripFirstChar=e.trimStart().slice(0,1)}firstAndLast(e){let r=e.split(` -`),n=r.length,o=r[0],s=r[n-1];return s===""&&n>1&&(s=r[n-2]),[o,s]}};j$.PromptFeatures=NLe;var x_t=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new NLe(e,n),this.suffixFeatures=new NLe(r,n)}constructFeatures(){let e=new Array(14).fill(0);e[0]=this.prefixFeatures.length,e[1]=this.prefixFeatures.firstLineLength,e[2]=this.prefixFeatures.lastLineLength,e[3]=this.prefixFeatures.lastLineRstripLength,e[4]=this.prefixFeatures.lastLineStripLength,e[5]=this.prefixFeatures.rstripLength,e[6]=this.prefixFeatures.rstripLastLineLength,e[7]=this.prefixFeatures.rstripLastLineStripLength,e[8]=this.suffixFeatures.length,e[9]=this.suffixFeatures.firstLineLength,e[10]=this.suffixFeatures.lastLineLength,e[11]=this.prefixFeatures.secondToLastLineHasComment?1:0,e[12]=this.prefixFeatures.rstripSecondToLastLineHasComment?1:0,e[13]=this.prefixFeatures.prefixEndsWithNewline?1:0;let r=new Array(Object.keys(gLi).length+1).fill(0);r[gLi[this.language]??0]=1;let n=new Array(Object.keys(q$.contextualFilterCharacterMap).length+1).fill(0);n[q$.contextualFilterCharacterMap[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(q$.contextualFilterCharacterMap).length+1).fill(0);o[q$.contextualFilterCharacterMap[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(q$.contextualFilterCharacterMap).length+1).fill(0);s[q$.contextualFilterCharacterMap[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(q$.contextualFilterCharacterMap).length+1).fill(0);return c[q$.contextualFilterCharacterMap[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};j$.MultilineModelFeatures=x_t;function cfc(t,e){return new x_t(t.prefix,t.suffix,e)}a(cfc,"constructMultilineFeatures");function lfc(t,e){let r=cfc(t,e).constructFeatures();return(0,sfc.multilineModelPredict)(r)[1]}a(lfc,"requestMultilineScore")});var yLi=I(V6=>{"use strict";p();var ufc=V6&&V6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},dfc=V6&&V6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(V6,"__esModule",{value:!0});V6.StreamedCompletionSplitter=void 0;var ffc=Gs(),pfc=M4e(),hfc=SAe(),h2r=class t{static{a(this,"StreamingCompletion")}constructor(e,r){this.index=e,this.documentPrefix=r,this.startOffset=0,this.text="",this.trimCount=0}updateText(e){this.text=e}get addedToPrefix(){return this.text.substring(0,this.startOffset)}get effectivePrefix(){return this.documentPrefix+this.addedToPrefix}get effectiveText(){return this.text.substring(this.startOffset)}get isFirstCompletion(){return this.trimCount===0}get firstNewlineOffset(){let e=[...this.text.matchAll(/\r?\n/g)];return e.length>0&&e[0].index===0&&e.shift(),e.length>0?e[0].index:-1}trimAt(e){let r=new t(this.index,this.documentPrefix);return r.startOffset=this.startOffset,r.text=this.text.substring(0,this.startOffset+e),r.trimCount=this.trimCount,this.startOffset+=e,this.trimCount++,r}},m2r=class{static{a(this,"StreamedCompletionSplitter")}constructor(e,r,n,o,s,c){this.prefix=e,this.languageId=r,this.initialSingleLine=n,this.trimmerLookahead=o,this.cacheFunction=s,this.instantiationService=c,this.lineLimit=3,this.completions=new Map}getFinishedCallback(){return async(e,r)=>{let n=r.index??0,o=this.getCompletion(n,e);if(o.isFirstCompletion&&this.initialSingleLine&&o.firstNewlineOffset>=0){let s={yieldSolution:!0,continueStreaming:!0,finishOffset:o.firstNewlineOffset};return o.trimAt(s.finishOffset),r.finished&&await this.trimAll(r,o),s}return r.finished?await this.trimAll(r,o):await this.trimOnce(r,o)}}getCompletion(e,r){let n=this.completions.get(e);return n||(n=new h2r(e,this.prefix),this.completions.set(e,n)),n.updateText(r),n}async trimOnce(e,r){let n=await this.trim(r);return n===void 0?{yieldSolution:!1,continueStreaming:!0}:r.isFirstCompletion?(r.trimAt(n),{yieldSolution:!0,continueStreaming:!0,finishOffset:n}):(this.cacheCompletion(e,r,n),{yieldSolution:!1,continueStreaming:!0})}async trimAll(e,r){let n,o;do n=await this.trim(r),r.isFirstCompletion?(o=n,r.trimAt(n??r.effectiveText.length)):this.cacheCompletion(e,r,n);while(n!==void 0);return o!==void 0?{yieldSolution:!0,continueStreaming:!0,finishOffset:o}:{yieldSolution:!1,continueStreaming:!0}}async trim(e){return await new hfc.TerseBlockTrimmer(this.languageId,e.effectivePrefix,e.effectiveText,this.lineLimit,this.trimmerLookahead).getCompletionTrimOffset()}cacheCompletion(e,r,n){let o=r.trimAt(n??r.effectiveText.length);if(o.effectiveText.trim()==="")return;let s=this.instantiationService.invokeFunction(pfc.convertToAPIChoice,o.effectiveText.trimEnd(),e.getAPIJsonData(),o.index,e.requestId,n!==void 0,e.telemetryData);s.copilotAnnotations=this.adjustedAnnotations(s,r,o),s.generatedChoiceIndex=o.trimCount,this.cacheFunction(o.addedToPrefix,s)}adjustedAnnotations(e,r,n){if(e.copilotAnnotations===void 0)return;let o=n.addedToPrefix.length,c=o+e.completionText.length>=r.text.length,l={};for(let[u,d]of Object.entries(e.copilotAnnotations)){let f=d.filter(h=>h.start_offset-o0).map(h=>{let m={...h};return m.start_offset-=o,m.stop_offset-=o,c||(m.stop_offset=Math.min(m.stop_offset,e.completionText.length)),m});f.length>0&&(l[u]=f)}return Object.keys(l).length>0?l:void 0}};V6.StreamedCompletionSplitter=m2r;V6.StreamedCompletionSplitter=m2r=ufc([dfc(5,ffc.IInstantiationService)],m2r)});var ILi=I(g2r=>{"use strict";p();Object.defineProperty(g2r,"__esModule",{value:!0});g2r.getGhostTextStrategy=vfc;var SLi=Gs(),ELi=Qre(),rN=LE(),TLi=fy(),w_t=gyt(),_Li=$g(),mfc=mAe(),MLe=SAe(),gfc=a2r(),Afc=_4e(),yfc=cIr(),Efc=ALi(),_fc=yLi(),vLi=20;function CLi(t){return e=>{let r=e?.split(` +`),n=r.length,o=r[0],s=r[n-1];return s===""&&n>1&&(s=r[n-2]),[o,s]}};eV.PromptFeatures=rBe;var X_t=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new rBe(e,n),this.suffixFeatures=new rBe(r,n)}constructFeatures(){let e=new Array(14).fill(0);e[0]=this.prefixFeatures.length,e[1]=this.prefixFeatures.firstLineLength,e[2]=this.prefixFeatures.lastLineLength,e[3]=this.prefixFeatures.lastLineRstripLength,e[4]=this.prefixFeatures.lastLineStripLength,e[5]=this.prefixFeatures.rstripLength,e[6]=this.prefixFeatures.rstripLastLineLength,e[7]=this.prefixFeatures.rstripLastLineStripLength,e[8]=this.suffixFeatures.length,e[9]=this.suffixFeatures.firstLineLength,e[10]=this.suffixFeatures.lastLineLength,e[11]=this.prefixFeatures.secondToLastLineHasComment?1:0,e[12]=this.prefixFeatures.rstripSecondToLastLineHasComment?1:0,e[13]=this.prefixFeatures.prefixEndsWithNewline?1:0;let r=new Array(Object.keys(c3i).length+1).fill(0);r[c3i[this.language]??0]=1;let n=new Array(Object.keys(X$.contextualFilterCharacterMap).length+1).fill(0);n[X$.contextualFilterCharacterMap[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(X$.contextualFilterCharacterMap).length+1).fill(0);o[X$.contextualFilterCharacterMap[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(X$.contextualFilterCharacterMap).length+1).fill(0);s[X$.contextualFilterCharacterMap[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(X$.contextualFilterCharacterMap).length+1).fill(0);return c[X$.contextualFilterCharacterMap[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};eV.MultilineModelFeatures=X_t;function Nhc(t,e){return new X_t(t.prefix,t.suffix,e)}a(Nhc,"constructMultilineFeatures");function Mhc(t,e){let r=Nhc(t,e).constructFeatures();return(0,Phc.multilineModelPredict)(r)[1]}a(Mhc,"requestMultilineScore")});var u3i=I(o9=>{"use strict";p();var Ohc=o9&&o9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Lhc=o9&&o9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(o9,"__esModule",{value:!0});o9.StreamedCompletionSplitter=void 0;var Bhc=$s(),Fhc=nLe(),Uhc=QAe(),lDr=class t{static{a(this,"StreamingCompletion")}constructor(e,r){this.index=e,this.documentPrefix=r,this.startOffset=0,this.text="",this.trimCount=0}updateText(e){this.text=e}get addedToPrefix(){return this.text.substring(0,this.startOffset)}get effectivePrefix(){return this.documentPrefix+this.addedToPrefix}get effectiveText(){return this.text.substring(this.startOffset)}get isFirstCompletion(){return this.trimCount===0}get firstNewlineOffset(){let e=[...this.text.matchAll(/\r?\n/g)];return e.length>0&&e[0].index===0&&e.shift(),e.length>0?e[0].index:-1}trimAt(e){let r=new t(this.index,this.documentPrefix);return r.startOffset=this.startOffset,r.text=this.text.substring(0,this.startOffset+e),r.trimCount=this.trimCount,this.startOffset+=e,this.trimCount++,r}},uDr=class{static{a(this,"StreamedCompletionSplitter")}constructor(e,r,n,o,s,c){this.prefix=e,this.languageId=r,this.initialSingleLine=n,this.trimmerLookahead=o,this.cacheFunction=s,this.instantiationService=c,this.lineLimit=3,this.completions=new Map}getFinishedCallback(){return async(e,r)=>{let n=r.index??0,o=this.getCompletion(n,e);if(o.isFirstCompletion&&this.initialSingleLine&&o.firstNewlineOffset>=0){let s={yieldSolution:!0,continueStreaming:!0,finishOffset:o.firstNewlineOffset};return o.trimAt(s.finishOffset),r.finished&&await this.trimAll(r,o),s}return r.finished?await this.trimAll(r,o):await this.trimOnce(r,o)}}getCompletion(e,r){let n=this.completions.get(e);return n||(n=new lDr(e,this.prefix),this.completions.set(e,n)),n.updateText(r),n}async trimOnce(e,r){let n=await this.trim(r);return n===void 0?{yieldSolution:!1,continueStreaming:!0}:r.isFirstCompletion?(r.trimAt(n),{yieldSolution:!0,continueStreaming:!0,finishOffset:n}):(this.cacheCompletion(e,r,n),{yieldSolution:!1,continueStreaming:!0})}async trimAll(e,r){let n,o;do n=await this.trim(r),r.isFirstCompletion?(o=n,r.trimAt(n??r.effectiveText.length)):this.cacheCompletion(e,r,n);while(n!==void 0);return o!==void 0?{yieldSolution:!0,continueStreaming:!0,finishOffset:o}:{yieldSolution:!1,continueStreaming:!0}}async trim(e){return await new Uhc.TerseBlockTrimmer(this.languageId,e.effectivePrefix,e.effectiveText,this.lineLimit,this.trimmerLookahead).getCompletionTrimOffset()}cacheCompletion(e,r,n){let o=r.trimAt(n??r.effectiveText.length);if(o.effectiveText.trim()==="")return;let s=this.instantiationService.invokeFunction(Fhc.convertToAPIChoice,o.effectiveText.trimEnd(),e.getAPIJsonData(),o.index,e.requestId,n!==void 0,e.telemetryData);s.copilotAnnotations=this.adjustedAnnotations(s,r,o),s.generatedChoiceIndex=o.trimCount,this.cacheFunction(o.addedToPrefix,s)}adjustedAnnotations(e,r,n){if(e.copilotAnnotations===void 0)return;let o=n.addedToPrefix.length,c=o+e.completionText.length>=r.text.length,l={};for(let[u,d]of Object.entries(e.copilotAnnotations)){let f=d.filter(h=>h.start_offset-o0).map(h=>{let m={...h};return m.start_offset-=o,m.stop_offset-=o,c||(m.stop_offset=Math.min(m.stop_offset,e.completionText.length)),m});f.length>0&&(l[u]=f)}return Object.keys(l).length>0?l:void 0}};o9.StreamedCompletionSplitter=uDr;o9.StreamedCompletionSplitter=uDr=Ohc([Lhc(5,Bhc.IInstantiationService)],uDr)});var y3i=I(dDr=>{"use strict";p();Object.defineProperty(dDr,"__esModule",{value:!0});dDr.getGhostTextStrategy=Vhc;var g3i=$s(),d3i=Yre(),uN=qE(),A3i=gy(),evt=jyt(),f3i=Yg(),Qhc=PAe(),nBe=QAe(),qhc=rDr(),jhc=H4e(),Hhc=txr(),Ghc=l3i(),$hc=u3i(),p3i=20;function h3i(t){return e=>{let r=e?.split(` `)??[];if(r.length>t+1)return r.slice(0,t+1).join(` -`).length}}a(CLi,"takeNLines");async function vfc(t,e,r,n,o,s,c){let l=t.get(SLi.IInstantiationService),u=t.get(TLi.ICompletionsFeaturesService),d=t.get(yfc.ICompletionsBlockModeConfig),f=u.multilineAfterAcceptLines(c),h=d.forLanguage(e.textDocument.detectedLanguageId,c);switch(h){case rN.BlockMode.Server:return s?{blockMode:rN.BlockMode.Parsing,requestMultiline:!0,finishedCb:CLi(f),stop:[` +`).length}}a(h3i,"takeNLines");async function Vhc(t,e,r,n,o,s,c){let l=t.get(g3i.IInstantiationService),u=t.get(A3i.ICompletionsFeaturesService),d=t.get(Hhc.ICompletionsBlockModeConfig),f=u.multilineAfterAcceptLines(c),h=d.forLanguage(e.textDocument.detectedLanguageId,c);switch(h){case uN.BlockMode.Server:return s?{blockMode:uN.BlockMode.Parsing,requestMultiline:!0,finishedCb:h3i(f),stop:[` -`],maxTokens:vLi*f}:{blockMode:rN.BlockMode.Server,requestMultiline:!0,finishedCb:a(m=>{},"finishedCb")};case rN.BlockMode.Parsing:case rN.BlockMode.ParsingAndServer:case rN.BlockMode.MoreMultiline:default:{let m;try{m=await l.invokeFunction(Cfc,h,e.textDocument,e.position,o,s,n)}catch{m={requestMultiline:!1}}if(!s&&m.requestMultiline&&u.singleLineUnlessAccepted(c)&&(m.requestMultiline=!1),m.requestMultiline){let g;return n.trailingWs.length>0&&!n.prompt.prefix.endsWith(n.trailingWs)?g=mfc.LocationFactory.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):g=e.position,{blockMode:h,requestMultiline:!0,...l.invokeFunction(bLi,h,e.textDocument,g,m.blockPosition,r,!0,n.prompt,c)}}if(s){let g={blockMode:rN.BlockMode.Parsing,requestMultiline:!0,finishedCb:CLi(f),stop:[` +`],maxTokens:p3i*f}:{blockMode:uN.BlockMode.Server,requestMultiline:!0,finishedCb:a(m=>{},"finishedCb")};case uN.BlockMode.Parsing:case uN.BlockMode.ParsingAndServer:case uN.BlockMode.MoreMultiline:default:{let m;try{m=await l.invokeFunction(Whc,h,e.textDocument,e.position,o,s,n)}catch{m={requestMultiline:!1}}if(!s&&m.requestMultiline&&u.singleLineUnlessAccepted(c)&&(m.requestMultiline=!1),m.requestMultiline){let g;return n.trailingWs.length>0&&!n.prompt.prefix.endsWith(n.trailingWs)?g=Qhc.LocationFactory.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):g=e.position,{blockMode:h,requestMultiline:!0,...l.invokeFunction(m3i,h,e.textDocument,g,m.blockPosition,r,!0,n.prompt,c)}}if(s){let g={blockMode:uN.BlockMode.Parsing,requestMultiline:!0,finishedCb:h3i(f),stop:[` -`],maxTokens:vLi*f};return h===rN.BlockMode.MoreMultiline&&(g.blockMode=rN.BlockMode.MoreMultiline),g}return{blockMode:h,requestMultiline:!1,...l.invokeFunction(bLi,h,e.textDocument,e.position,m.blockPosition,r,!1,n.prompt,c)}}}}a(vfc,"getGhostTextStrategy");function bLi(t,e,r,n,o,s,c,l,u){let d=t.get(TLi.ICompletionsFeaturesService),f=t.get(SLi.IInstantiationService);if(c&&e===rN.BlockMode.MoreMultiline&&MLe.BlockTrimmer.isSupported(r.detectedLanguageId)){let h=o===MLe.BlockPositionType.EmptyBlock||o===MLe.BlockPositionType.BlockEnd?d.longLookaheadSize(u):d.shortLookaheadSize(u),m=t.get(Afc.ICompletionsCacheService);return{finishedCb:f.createInstance(_fc.StreamedCompletionSplitter,s,r.detectedLanguageId,!1,h,(A,y)=>{let E={prefix:s+A,prompt:{...l,prefix:l.prefix+A}};(0,gfc.appendToCache)(m,E,y)}).getFinishedCallback(),maxTokens:d.maxMultilineTokens(u)}}return{finishedCb:c?(0,w_t.parsingBlockFinished)(r,n):h=>{}}}a(bLi,"buildFinishedCallback");async function Cfc(t,e,r,n,o,s,c){if(r.lineCount>=8e3)(0,_Li.telemetry)(t,"ghostText.longFileMultilineSkip",_Li.TelemetryData.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e===rN.BlockMode.MoreMultiline&&MLe.BlockTrimmer.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await(0,MLe.getBlockPositionType)(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&bfc(n,r))return{requestMultiline:!0};let u=!1;return!o&&(0,ELi.isSupportedLanguageId)(r.detectedLanguageId)?u=await(0,w_t.isEmptyBlockStartUtil)(r,n):o&&(0,ELi.isSupportedLanguageId)(r.detectedLanguageId)&&(u=await(0,w_t.isEmptyBlockStartUtil)(r,n)||await(0,w_t.isEmptyBlockStartUtil)(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=(0,Efc.requestMultilineScore)(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(Cfc,"shouldRequestMultiline");function bfc(t,e){return e.lineAt(t).text.trim().length===0}a(bfc,"isNewLine")});var DLi=I(qR=>{"use strict";p();var Sfc=qR&&qR.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},nN=qR&&qR.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(qR,"__esModule",{value:!0});qR.ForceMultiLine=qR.GhostTextComputer=void 0;qR.getGhostText=$fc;var wLi=Sp(),Tfc=gm(),Ifc=PPr(),xfc=T0(),RLi=Gs(),wfc=DPr(),Rfc=Ore(),kfc=o4e(),Pfc=FSr(),LLe=LE(),C2r=fy(),Dfc=Dl(),Nfc=KAe(),Mfc=ATr(),Ofc=A_t(),Lfc=tEt(),Bfc=v$(),Ffc=gyt(),A2r=qAe(),E2r=qPr(),y2r=F4i(),oye=$g(),R_t=mAe(),xLi=y4e(),Ufc=jTr(),Qfc=SAe(),qfc=_4e(),_2r=pLi(),kLi=uIr(),jfc=ILi(),H$=a$(),Eh=xAe(),Hfc={isCycling:!1,promptOnly:!1,isSpeculative:!1};function Gfc(t,e,r){let n=t.get(C2r.ICompletionsFeaturesService),o=(0,LLe.getConfig)(t,LLe.ConfigKey.CompletionsDebounce)??n.completionsDebounce(r)??e.debounceMs;if(o===void 0)return 0;let s=(0,oye.now)()-r.issuedTime;return Math.max(0,o-s)}a(Gfc,"getRemainingDebounceMs");function OLe(t,e,r){return r?.isCancellationRequested||e!==t.currentRequestId}a(OLe,"isCompletionRequestCancelled");var k_t=class{static{a(this,"GhostTextComputer")}constructor(e,r,n,o,s,c,l,u,d,f,h){this.instantiationService=e,this.telemetryService=r,this.notifierService=n,this.contextProviderBridge=o,this.currentGhostText=s,this.contextproviderStatistics=c,this.asyncCompletionManager=l,this.completionsFeaturesService=u,this.logTarget=d,this.statusReporter=f,this.logService=h}async getGhostText(e,r,n,o,s,c){let l=(0,xfc.generateUuid)();s.setHeaderRequestId(l);let u=c.createSubLogger(["GhostTextComputer#getGhostText"]);this.currentGhostText.currentRequestId=l;let d=await this.instantiationService.invokeFunction(Kfc,e.textDocument,l,n);await(0,Rfc.ensureTokenizersLoaded)().catch(()=>{});try{this.contextProviderBridge.schedule(e,l,n?.opportunityId??"",d,r,n),this.notifierService.notifyRequest(e,l,d,r,n);let f=await this.getGhostTextWithoutAbortHandling(e,l,d,r,n,o,s,u),h=this.contextproviderStatistics.getStatisticsForCompletion(l),m=n?.opportunityId??"unknown";for(let[g,A]of h.getAllUsageStatistics())this.telemetryService.sendMSFTTelemetryEvent("context-provider.completion-stats",{requestId:l,opportunityId:m,providerId:g,resolution:A.resolution,usage:A.usage,usageDetails:JSON.stringify(A.usageDetails)},{});return f}catch(f){if((0,Nfc.isAbortError)(f))return{type:"canceled",reason:"aborted at unknown location",telemetryData:(0,Eh.mkCanceledResultTelemetry)(d,{cancelledNetworkRequest:!0})};throw f}}async getGhostTextWithoutAbortHandling(e,r,n,o,s,c,l,u){let d=u.createSubLogger(["GhostTextComputer#getGhostTextWithoutAbortHandling"]),f=n.issuedTime,h=[];function m(v){let b=(0,oye.now)();h.push([v,b-f]),f=b}if(a(m,"recordPerformance"),m("telemetry"),OLe(this.currentGhostText,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};let g=Wfc(e.textDocument,e.position);if(g===void 0)return d.debug("Completions do not trigger in the middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};let A=this.instantiationService.invokeFunction(Mfc.getEngineRequestInfo,n),y={...Hfc,...s,tokenizer:A.tokenizer},E=await this.instantiationService.invokeFunction(A2r.extractPrompt,r,e,n,void 0,y);if(m("prompt"),c.setPrompt(A2r.PromptResponse.toString(E)),E.type==="copilotContentExclusion")return d.debug("Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};if(E.type==="contextTooShort")return d.debug("Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};if(E.type==="promptError")return d.debug("Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};if(y.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:E};if(E.type==="promptCancelled")return d.debug("Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};if(E.type==="promptTimeout")return d.debug("Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};if(E.prompt.prefix.length===0&&E.prompt.suffix.length===0)return d.debug("Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)};let _=this.instantiationService.invokeFunction(Gfc,y,n);return _>0&&(d.debug(`Debouncing ghost text request for ${_}ms`),await(0,xLi.delay)(_),OLe(this.currentGhostText,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:(0,Eh.mkBasicResultTelemetry)(n)}:this.statusReporter.withProgress(async()=>{let[v]=(0,A2r.trimLastLine)(e.textDocument.getText(R_t.LocationFactory.range(R_t.LocationFactory.position(0,0),e.position)));d.trace(`Starting ghost text computation, prefix length: ${v.length}`);let b=this.currentGhostText.hasAcceptedCurrentCompletion(v,E.prompt.suffix);d.trace(`hasAcceptedCurrentCompletion: ${b}`);let T=E.prompt,w=await this.instantiationService.invokeFunction(jfc.getGhostTextStrategy,e,v,E,g,b,n);m("strategy"),d.trace(`Ghost text strategy: blockMode=${w.blockMode}, requestMultiline=${w.requestMultiline}, stop=${w.stop}, maxTokens=${w.maxTokens}`);let R=this.instantiationService.invokeFunction(Vfc,v,T,w.requestMultiline);d.trace(`Local cache lookup: ${R?`found ${R[0].length} choices`:"no cached choices"}`),m("cache");let x=this.instantiationService.invokeFunction(E2r.extractRepoInfoInBackground,e.textDocument.uri),P={blockMode:w.blockMode,languageId:e.textDocument.detectedLanguageId,repoInfo:x,engineModelId:A.modelId,ourRequestId:r,prefix:v,prompt:E.prompt,multiline:w.requestMultiline,indentation:(0,Ffc.contextIndentation)(e.textDocument,e.position),isCycling:y.isCycling,headers:A.headers,stop:w.stop,maxTokens:w.maxTokens,afterAccept:b};P.headers={...P.headers,"X-Copilot-Async":"true","X-Copilot-Speculative":y.isSpeculative?"true":"false"};let D=this.instantiationService.invokeFunction(Zfc,e.textDocument,P,e.position,E,n,A,y);if(R===void 0&&!y.isCycling&&this.asyncCompletionManager.shouldWaitForAsyncCompletions(v,E.prompt)){d.trace("No cached choices, waiting for async completions from in-flight request");let U=await this.asyncCompletionManager.getFirstMatchingRequestWithTimeout(r,v,E.prompt,y.isSpeculative,D);if(m("asyncWait"),U){d.trace("Received choice from async completion");let Y=!w.requestMultiline;R=[[(0,_2r.makeGhostAPIChoice)(U[0],{forceSingleLine:Y})],H$.ResultType.Async]}else d.trace("No matching async completion found within timeout");if(OLe(this.currentGhostText,r,o))return d.debug("Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:(0,Eh.mkBasicResultTelemetry)(D)}}else d.trace("Skipping wait for async completions");let N=w.blockMode===LLe.BlockMode.MoreMultiline&&Qfc.BlockTrimmer.isSupported(e.textDocument.detectedLanguageId);if(R!==void 0&&(d.trace(`Post-processing ${R[0].length} cached choices, isMoreMultiline=${N}`),R[0]=R[0].map(U=>this.instantiationService.invokeFunction(y2r.postProcessChoiceInContext,e.textDocument,e.position,U,N,d)).filter(U=>U!==void 0)),R&&(R[1]===H$.ResultType.Cache||R[1]===H$.ResultType.TypingAsSuggested)&&(l.setIsFromCache(),c.markAsFromCache()),R!==void 0&&R[0].length===0)return d.trace(`Found empty inline suggestions locally via ${(0,Eh.resultTypeToString)(R[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:(0,Eh.mkBasicResultTelemetry)(D)};if(R!==void 0&&R[0].length>0&&(!y.isCycling||R[0].length>1))d.trace(`Found inline suggestions locally via ${(0,Eh.resultTypeToString)(R[1])}`);else{d.trace(`Going to network, isCycling=${y.isCycling}`);let U=this.instantiationService.createInstance(_2r.CompletionsFromNetwork);if(y.isCycling){d.trace("Fetching all completions for cycling request");let Y=await U.getAllCompletionsFromNetwork(P,D,o,w.finishedCb,l);if(Y.type==="success"){d.trace(`Cycling network request returned ${Y.value[0].length} choices`);let W=R?.[0]??[];Y.value[0].forEach(V=>{W.findIndex(z=>z.completionText.trim()===V.completionText.trim())===-1&&W.push(V)}),d.trace(`After deduplication: ${W.length} unique choices`),R=[W,H$.ResultType.Cycling]}else if(R===void 0)return Y}else{d.trace("Initiating network request for completions");let Y=a((ie,H)=>(this.asyncCompletionManager.updateCompletion(r,ie),w.finishedCb(ie,H)),"finishedCb"),W=new kfc.CancellationTokenSource,V=U.getCompletionsFromNetwork(P,D,W.token,Y,l);this.asyncCompletionManager.queueCompletionRequest(r,v,E.prompt,W,V);let z=await this.asyncCompletionManager.getFirstMatchingRequest(r,v,E.prompt,y.isSpeculative);if(z===void 0)return d.trace("Network request returned no results"),{type:"empty",reason:"received no results from async completions",telemetryData:(0,Eh.mkBasicResultTelemetry)(D)};d.trace("Received completion from network request"),R=[[z[0]],H$.ResultType.Async]}m("network")}if(R===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,Eh.mkBasicResultTelemetry)(D)};let[L,B]=R;d.trace(`Final choices: ${L.length} from ${(0,Eh.resultTypeToString)(B)}`);let q=L.map(U=>this.instantiationService.invokeFunction(y2r.postProcessChoiceInContext,e.textDocument,e.position,U,N,d)).filter(U=>U!==void 0);d.trace(`Post-processed to ${q.length} choices`);let M=this.instantiationService.invokeFunction(LLe.getConfig,LLe.ConfigKey.CompletionsDelay)??this.completionsFeaturesService.completionsDelay(n),O=(0,oye.now)()-n.issuedTime,j=Math.max(M-O,0);if(B!==H$.ResultType.TypingAsSuggested&&!y.isCycling&&j>0&&(d.debug(`Waiting ${j}ms before returning completion`),await(0,xLi.delay)(j),OLe(this.currentGhostText,r,o)))return d.debug("Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:(0,Eh.mkCanceledResultTelemetry)(D)};let Q=[];for(let U of q){let Y=Jfc(e.textDocument,P,U,D),W=g?(0,y2r.checkSuffix)(e.textDocument,e.position,U):0,z={completion:zfc(U.choiceIndex,U.completionText,E.trailingWs),telemetry:Y,isMiddleOfTheLine:g,suffixCoverage:W,copilotAnnotations:U.copilotAnnotations,clientCompletionId:U.clientCompletionId};Q.push(z)}return D.properties.clientCompletionId=Q[0]?.clientCompletionId,D.measurements.foundOffset=Q?.[0]?.telemetry?.measurements?.foundOffset??-1,d.debug(`Produced ${Q.length} results from ${(0,Eh.resultTypeToString)(B)} at ${D.measurements.foundOffset} offset`),OLe(this.currentGhostText,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:(0,Eh.mkCanceledResultTelemetry)(D)}:(y.isSpeculative||(d.trace("Updating current ghost text as request is not speculative"),this.currentGhostText.setGhostText(v,E.prompt.suffix,q,B)),l.setHeaderRequestId(q[0]?.requestId.headerRequestId??r),m("complete"),d.trace(`Ghost text computation complete, returning ${Q.length} results`),{type:"success",value:[Q,B],telemetryData:(0,Eh.mkBasicResultTelemetry)(D),telemetryBlob:D,resultType:B,performanceMetrics:h})})}};qR.GhostTextComputer=k_t;qR.GhostTextComputer=k_t=Sfc([nN(0,RLi.IInstantiationService),nN(1,Tfc.ITelemetryService),nN(2,Pfc.ICompletionsNotifierService),nN(3,Lfc.ICompletionsContextProviderBridgeService),nN(4,kLi.ICompletionsCurrentGhostText),nN(5,Bfc.ICompletionsContextProviderService),nN(6,Ufc.ICompletionsAsyncManagerService),nN(7,C2r.ICompletionsFeaturesService),nN(8,Dfc.ICompletionsLogTargetService),nN(9,Ofc.ICompletionsStatusReporter),nN(10,wLi.ILogService)],k_t);async function $fc(t,e,r,n,o,s,c){return t.get(RLi.IInstantiationService).createInstance(k_t).getGhostText(e,r,n,o,s,c)}a($fc,"getGhostText");function Vfc(t,e,r,n){let s=t.get(kLi.ICompletionsCurrentGhostText).getCompletionsForUserTyping(e,r.suffix),c=Yfc(t,e,r.suffix,n);if(s&&s.length>0){let l=(c??[]).filter(u=>!s.some(d=>d.completionText===u.completionText));return[s.concat(l),H$.ResultType.TypingAsSuggested]}if(c&&c.length>0)return[c,H$.ResultType.Cache]}a(Vfc,"getLocalInlineSuggestion");function Wfc(t,e){let n=t.lineAt(e).text.substring(e.character);return(0,wfc.isInlineSuggestionFromTextAfterCursor)(n)}a(Wfc,"isInlineSuggestion");var v2r=class t{static{a(this,"ForceMultiLine")}static{this.default=new t}constructor(e=!1){this.requestMultilineOverride=e}};qR.ForceMultiLine=v2r;function zfc(t,e,r){if(r.length>0){if(e.startsWith(r))return{completionIndex:t,completionText:e,displayText:e.substring(r.length),displayNeedsWsOffset:!1};{let n=e.substring(0,e.length-e.trimStart().length);return r.startsWith(n)?{completionIndex:t,completionText:e,displayText:e.trimStart(),displayNeedsWsOffset:!0}:{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}}else return{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}a(zfc,"adjustLeadingWhitespace");function Yfc(t,e,r,n){let o=t.get(wLi.ILogService).createSubLogger(["getCompletionsFromCache"]),s=t.get(qfc.ICompletionsCacheService).findAll(e,r);return s.length===0?(o.debug("Found no completions in cache"),[]):(o.debug(`Found ${s.length} completions in cache`),s.map(c=>(0,_2r.makeGhostAPIChoice)(c,{forceSingleLine:!n})))}a(Yfc,"getCompletionsFromCache");async function Kfc(t,e,r,n){let o=t.get(C2r.ICompletionsFeaturesService),s={headerRequestId:r};n?.opportunityId&&(s.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(s.completionsActive="true"),n?.isSpeculative&&(s.reason="speculative");let c=oye.TelemetryData.createAndMarkAsIssued(s);return await o.updateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},c)}a(Kfc,"createTelemetryWithExp");function Jfc(t,e,r,n){let o=r.requestId,s={choiceIndex:r.choiceIndex.toString(),clientCompletionId:r.clientCompletionId};r.generatedChoiceIndex!==void 0&&(s.originalChoiceIndex=s.choiceIndex,s.choiceIndex=(1e4*(r.generatedChoiceIndex+1)+r.choiceIndex).toString());let c={compCharLen:r.completionText.length,numLines:r.completionText.trim().split(` -`).length};r.meanLogProb&&(c.meanLogProb=r.meanLogProb),r.meanAlternativeLogProb&&(c.meanAlternativeLogProb=r.meanAlternativeLogProb);let l=r.telemetryData.extendedBy(s,c);return l.issuedTime=n.issuedTime,l.measurements.timeToProduceMs=performance.now()-n.issuedTime,PLi(l,t),l.extendWithRequestId(o),l}a(Jfc,"telemetryWithAddData");function Zfc(t,e,r,n,o,s,c,l){let u={languageId:e.detectedLanguageId};u.afterAccept=r.afterAccept.toString(),u.isSpeculative=l.isSpeculative.toString();let d=s.extendedBy(u);PLi(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===E2r.ComputationStatus.PENDING?"pending":"available",f!==void 0&&f!==E2r.ComputationStatus.PENDING&&(d.properties.gitRepoUrl=f.url,d.properties.gitRepoHost=f.hostname,f.repoId?.type==="github"?(d.properties.gitRepoOwner=f.repoId.org,d.properties.gitRepoName=f.repoId.repo):f.repoId?.type==="ado"&&(d.properties.gitRepoOwner=f.repoId.project,d.properties.gitRepoName=f.repoId.repo),d.properties.gitRepoPath=f.pathname),d.properties.engineName=c.modelId,d.properties.engineChoiceSource=c.engineChoiceSource,d.properties.isMultiline=JSON.stringify(r.multiline),d.properties.isCycling=JSON.stringify(r.isCycling);let h=e.lineAt(n.line),m=e.getText(R_t.LocationFactory.range(h.range.start,n)),g=e.getText(R_t.LocationFactory.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,Ifc.createSha256Hash)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...(0,oye.telemetrizePromptLength)(o.prompt),promptEndPos:e.offsetAt(n),promptComputeTimeMs:o.computeTimeMs};o.metadata&&(y.promptMetadata=JSON.stringify(o.metadata)),o.contextProvidersTelemetry&&(y.contextProviders=JSON.stringify(o.contextProvidersTelemetry));let _=d.extendedBy(y,E);return(0,oye.telemetry)(t,"ghostText.issued",_),d}a(Zfc,"telemetryIssued");function PLi(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(PLi,"addDocumentTelemetry")});var LLi=I(W6=>{"use strict";p();var Xfc=W6&&W6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},b2r=W6&&W6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(W6,"__esModule",{value:!0});W6.GhostText=void 0;var NLi=ri(),epc=Gs(),tpc=pIr(),rpc=R4i(),MLi=DLi(),npc=IPr(),ipc=a$(),opc=uyt(),OLi=xAe(),spc=Dl(),S2r=class{static{a(this,"GhostText")}constructor(e,r,n){this.instantiationService=e,this.logTargetService=r,this.speculativeRequestCache=n}async getInlineCompletions(e,r,n,o={},s,c,l){apc(this.logTargetService,e,r);let u=await this.getInlineCompletionsResult((0,tpc.createCompletionState)(e,r),n,o,s,c,l);return this.instantiationService.invokeFunction(OLi.handleGhostTextResultTelemetry,u)}async getInlineCompletionsResult(e,r,n={},o,s,c){let l=0;n.selectedCompletionInfo?.text&&!n.selectedCompletionInfo.text.includes(")")&&(e=e.addSelectedCompletionInfo(n.selectedCompletionInfo),l=e.position.character-n.selectedCompletionInfo.range.end.character);let u=await this.instantiationService.invokeFunction(MLi.getGhostText,e,r,n,o,s,c);if(u.type!=="success")return u;let[d,f]=u.value;if(r.isCancellationRequested)return{type:"canceled",reason:"after getGhostText",telemetryData:{telemetryBlob:u.telemetryBlob}};let h=this.instantiationService.invokeFunction(npc.setLastShown,e.textDocument,e.position,f),m=(0,rpc.completionsFromGhostTextResults)(d,f,e.textDocument,e.position,n.formattingOptions,h);if(m.length===0)return{type:"empty",reason:"no completions in final result",telemetryData:u.telemetryData};if(f!==ipc.ResultType.TypingAsSuggested){e=e.applyEdits([{newText:m[0].insertText,range:m[0].range}]);let A={isSpeculative:!0,opportunityId:n.opportunityId},y=a(()=>this.instantiationService.invokeFunction(MLi.getGhostText,e,void 0,A,o,s,c),"fn");this.speculativeRequestCache.set(m[0].clientCompletionId,y)}let g=m.map(A=>{let{start:y,end:E}=A.range,_=NLi.Range.create(y,NLi.Position.create(E.line,E.character-l));return{...A,range:_}});return{...u,value:g}}};W6.GhostText=S2r;W6.GhostText=S2r=Xfc([b2r(0,epc.IInstantiationService),b2r(1,spc.ICompletionsLogTargetService),b2r(2,opc.ICompletionsSpeculativeRequestCache)],S2r);function apc(t,e,r){let n=e.getText({start:{line:Math.max(r.line-1,0),character:0},end:r}),o=e.getText({start:r,end:{line:Math.min(r.line+2,e.lineCount-1),character:e.lineCount-1>r.line?0:r.character}});OLi.logger.debug(t,`Requesting for ${e.uri} at ${r.line}:${r.character}`,`between ${JSON.stringify(n)} and ${JSON.stringify(o)}.`)}a(apc,"logCompletionLocation")});var BLi=I(N_t=>{"use strict";p();Object.defineProperty(N_t,"__esModule",{value:!0});N_t.LocalFileSystem=void 0;var P_t=require("fs"),cpc=require("path"),D_t=n$(),T2r=o$(),I2r=class{static{a(this,"LocalFileSystem")}async readFileString(e){return(await P_t.promises.readFile((0,T2r.fsPath)(e))).toString()}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink((0,T2r.fsPath)(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=(0,T2r.fsPath)(e),n=await P_t.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,cpc.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await P_t.promises.lstat(e);if(r.isSymbolicLink())try{let n=await P_t.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=D_t.FileType.Unknown;return e.isFile()&&(o=D_t.FileType.File),e.isDirectory()&&(o=D_t.FileType.Directory),r.isSymbolicLink()&&n&&(o|=D_t.FileType.SymbolicLink),o}};N_t.LocalFileSystem=I2r});var qLi=I(z6=>{"use strict";p();var lpc=z6&&z6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},BLe=z6&&z6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(z6,"__esModule",{value:!0});z6.CompositeRelatedFilesProvider=void 0;var upc=Bre(),dpc=Gs(),sye=LE(),fpc=fy(),ppc=n$(),hpc=Dl(),FLe=UAe(),Rne=dEt(),FLi=["cpp","c","cuda-cpp"],ULi=["typescript","javascript","typescriptreact","javascriptreact"],QLi=["csharp"],mpc=new Map([...FLi.map(t=>[t,FLe.NeighboringFileType.RelatedCpp]),...ULi.map(t=>[t,FLe.NeighboringFileType.RelatedTypeScript]),...QLi.map(t=>[t,FLe.NeighboringFileType.RelatedCSharpRoslyn])]);function gpc(t){return mpc.get(t)??FLe.NeighboringFileType.RelatedOther}a(gpc,"getNeighboringFileType");var x2r=class extends Rne.RelatedFilesProvider{static{a(this,"CompositeRelatedFilesProvider")}constructor(e,r,n,o,s){super(e,r,o,s),this.featuresService=n,this.providers=new Map,this.telemetrySent=!1,this.reportedUnknownProviders=new Set}async getRelatedFilesResponse(e,r,n){let o=Date.now(),s=e.clientLanguageId.toLowerCase();if(gpc(s)===FLe.NeighboringFileType.RelatedOther&&!this.reportedUnknownProviders.has(s)&&(this.reportedUnknownProviders.add(s),Rne.relatedFilesLogger.warn(this.logTarget,`unknown language ${s}`)),this.relatedFilesTelemetry(r),Rne.relatedFilesLogger.debug(this.logTarget,`Fetching related files for ${e.uri}`),!this.isActive(s,r))return Rne.relatedFilesLogger.debug(this.logTarget,"language-server related-files experiment is not active."),Rne.EmptyRelatedFilesResponse;let l=this.providers.get(s);if(!l)return Rne.EmptyRelatedFilesResponse;try{return this.convert(e.uri,l,o,r,n)}catch{this.relatedFileNonresponseTelemetry(s,r);return}}async convert(e,r,n,o,s){s||(s={isCancellationRequested:!1,onCancellationRequested:a(()=>({dispose(){}}),"onCancellationRequested")});let c={entries:[],traits:[]},l=r.size>0;for(let u of r.values()){let d=await u.callback(e,{flags:{}},s);if(d){l=!1,c.entries.push(...d.entries),d.traits&&c.traits.push(...d.traits);for(let f of d.entries)for(let h of f.uris)Rne.relatedFilesLogger.debug(this.logTarget,h.toString())}}return this.performanceTelemetry(Date.now()-n,o),l?void 0:c}registerRelatedFilesProvider(e,r,n){let o=this.providers.get(r);o?o.set(e,{extensionId:e,languageId:r,callback:n}):this.providers.set(r,new Map([[e,{extensionId:e,languageId:r,callback:n}]]))}unregisterRelatedFilesProvider(e,r,n){let o=this.providers.get(r);if(o){let s=o.get(e);s&&s.callback===n&&o.delete(e)}}isActive(e,r){return QLi.includes(e)?this.featuresService.relatedFilesVSCodeCSharp(r)||this.instantiationService.invokeFunction(sye.getConfig,sye.ConfigKey.RelatedFilesVSCodeCSharp):ULi.includes(e)?this.featuresService.relatedFilesVSCodeTypeScript(r)||this.instantiationService.invokeFunction(sye.getConfig,sye.ConfigKey.RelatedFilesVSCodeTypeScript):FLi.includes(e)?this.featuresService.cppHeadersEnableSwitch(r):this.featuresService.relatedFilesVSCode(r)||this.instantiationService.invokeFunction(sye.getConfig,sye.ConfigKey.RelatedFilesVSCode)}relatedFilesTelemetry(e){}relatedFileNonresponseTelemetry(e,r){}performanceTelemetry(e,r){}};z6.CompositeRelatedFilesProvider=x2r;z6.CompositeRelatedFilesProvider=x2r=lpc([BLe(0,dpc.IInstantiationService),BLe(1,upc.IIgnoreService),BLe(2,fpc.ICompletionsFeaturesService),BLe(3,hpc.ICompletionsLogTargetService),BLe(4,ppc.ICompletionsFileSystemService)],x2r)});var M_t=I(kne=>{"use strict";p();Object.defineProperty(kne,"__esModule",{value:!0});kne.PositionOffsetTransformer=kne.PositionOffsetTransformerBase=void 0;kne.ensureDependenciesAreSet=Epc;var jLi=kE(),HLi=h5e(),Apc=Yut(),ypc=Tme(),GLi=Yut();Object.defineProperty(kne,"PositionOffsetTransformerBase",{enumerable:!0,get:a(function(){return GLi.PositionOffsetTransformerBase},"get")});Object.defineProperty(kne,"PositionOffsetTransformer",{enumerable:!0,get:a(function(){return GLi.PositionOffsetTransformer},"get")});(0,Apc._setPositionOffsetTransformerDependencies)({StringEdit:jLi.StringEdit,StringReplacement:jLi.StringReplacement,TextReplacement:HLi.TextReplacement,TextEdit:HLi.TextEdit,TextLength:ypc.TextLength});function Epc(){}a(Epc,"ensureDependenciesAreSet")});var L_t=I(O_t=>{"use strict";p();Object.defineProperty(O_t,"__esModule",{value:!0});O_t.RootedLineEdit=void 0;var $Li=NG(),_pc=M_t(),vpc=iN();(0,_pc.ensureDependenciesAreSet)();var w2r=class t{static{a(this,"RootedLineEdit")}static fromEdit(e){let r=$Li.LineEdit.fromStringEdit(e.edit,e.base);return new t(e.base,r)}constructor(e,r){this.base=e,this.edit=r}toString(){return this.edit.humanReadablePatch(this.base.getLines())}toEdit(){return this.edit.toEdit(this.base)}toRootedEdit(){return new vpc.RootedEdit(this.base,this.toEdit())}getEditedState(){let e=this.base.getLines();return this.edit.apply(e)}removeCommonSuffixPrefixLines(){let e=a(n=>!n.lineRange.isEmpty||n.newLines.length>0,"isNotEmptyEdit"),r=this.edit.replacements.map(n=>n.removeCommonSuffixPrefixLines(this.base)).filter(n=>e(n));return new t(this.base,new $Li.LineEdit(r))}};O_t.RootedLineEdit=w2r});var iN=I(G$=>{"use strict";p();Object.defineProperty(G$,"__esModule",{value:!0});G$.Edits=G$.SingleEdits=G$.RootedEdit=void 0;var VLi=rd(),Cpc=NG(),aye=kE(),WLi=k2r(),bpc=L_t(),ULe=class t{static{a(this,"RootedEdit")}static toLineEdit(e){return Cpc.LineEdit.fromStringEdit(e.edit,e.base)}constructor(e,r){this.base=e,this.edit=r}getEditedState(){return this.edit.applyOnText(this.base)}rebase(e){return(0,VLi.assertFn)(()=>null.base.equals(e.applyOnText(this.base))),(0,VLi.assertFn)(()=>null.edit.applyOnText(null.base).equals(this.edit.applyOnText(e.applyOnText(this.base)))),null}toString(){return bpc.RootedLineEdit.fromEdit(this).toString()}normalize(){return new t(this.base,this.edit.normalizeOnSource(this.base.value))}equals(e){return this.base.equals(e.base)&&this.edit.equals(e.edit)}};G$.RootedEdit=ULe;var R2r=class{static{a(this,"SingleEdits")}constructor(e){this.edits=e}compose(){return aye.StringEdit.compose(this.edits.map(e=>e.toEdit()))}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}toEdits(){return new B_t(aye.StringEdit,this.edits.map(e=>e.toEdit()))}};G$.SingleEdits=R2r;var B_t=class t{static{a(this,"Edits")}static single(e){return new t(aye.StringEdit,[e])}constructor(e,r){this._editType=e,this.edits=r}compose(){let e=new this._editType([]);for(let r of this.edits)e=e.compose(r);return e}add(e){return new t(this._editType,[...this.edits,e])}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}swap(e){let r=e,n=[];for(let o of this.edits){let s=aye.BaseStringEdit.trySwap(r,o);if(!s)return;n.push(s.e1),r=s.e2}return{edits:new t(aye.StringEdit,n),editLast:r}}serialize(){return this.edits.map(e=>(0,WLi.serializeStringEdit)(e))}static deserialize(e){return new t(aye.StringEdit,e.map(r=>(0,WLi.deserializeStringEdit)(r)))}toHumanReadablePatch(e){let r=e,n=[];for(let o of this.edits){let s=ULe.toLineEdit(new ULe(r,o));n.push(s.humanReadablePatch(r.getLines())),r=o.applyOnText(r)}return n.join(` +`],maxTokens:p3i*f};return h===uN.BlockMode.MoreMultiline&&(g.blockMode=uN.BlockMode.MoreMultiline),g}return{blockMode:h,requestMultiline:!1,...l.invokeFunction(m3i,h,e.textDocument,e.position,m.blockPosition,r,!1,n.prompt,c)}}}}a(Vhc,"getGhostTextStrategy");function m3i(t,e,r,n,o,s,c,l,u){let d=t.get(A3i.ICompletionsFeaturesService),f=t.get(g3i.IInstantiationService);if(c&&e===uN.BlockMode.MoreMultiline&&nBe.BlockTrimmer.isSupported(r.detectedLanguageId)){let h=o===nBe.BlockPositionType.EmptyBlock||o===nBe.BlockPositionType.BlockEnd?d.longLookaheadSize(u):d.shortLookaheadSize(u),m=t.get(jhc.ICompletionsCacheService);return{finishedCb:f.createInstance($hc.StreamedCompletionSplitter,s,r.detectedLanguageId,!1,h,(A,y)=>{let E={prefix:s+A,prompt:{...l,prefix:l.prefix+A}};(0,qhc.appendToCache)(m,E,y)}).getFinishedCallback(),maxTokens:d.maxMultilineTokens(u)}}return{finishedCb:c?(0,evt.parsingBlockFinished)(r,n):h=>{}}}a(m3i,"buildFinishedCallback");async function Whc(t,e,r,n,o,s,c){if(r.lineCount>=8e3)(0,f3i.telemetry)(t,"ghostText.longFileMultilineSkip",f3i.TelemetryData.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e===uN.BlockMode.MoreMultiline&&nBe.BlockTrimmer.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await(0,nBe.getBlockPositionType)(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&zhc(n,r))return{requestMultiline:!0};let u=!1;return!o&&(0,d3i.isSupportedLanguageId)(r.detectedLanguageId)?u=await(0,evt.isEmptyBlockStartUtil)(r,n):o&&(0,d3i.isSupportedLanguageId)(r.detectedLanguageId)&&(u=await(0,evt.isEmptyBlockStartUtil)(r,n)||await(0,evt.isEmptyBlockStartUtil)(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=(0,Ghc.requestMultilineScore)(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(Whc,"shouldRequestMultiline");function zhc(t,e){return e.lineAt(t).text.trim().length===0}a(zhc,"isNewLine")});var S3i=I(KR=>{"use strict";p();var Yhc=KR&&KR.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},dN=KR&&KR.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(KR,"__esModule",{value:!0});KR.ForceMultiLine=KR.GhostTextComputer=void 0;KR.getGhostText=gmc;var _3i=xp(),Khc=vm(),Jhc=I2r(),Zhc=x0(),v3i=$s(),Xhc=x2r(),emc=Gre(),tmc=w4e(),rmc=PTr(),oBe=qE(),ADr=gy(),nmc=Dl(),imc=fye(),omc=uIr(),smc=H_t(),amc=xEt(),cmc=M$(),lmc=jyt(),fDr=nye(),hDr=L2r(),pDr=kBi(),vye=Yg(),tvt=PAe(),E3i=q4e(),umc=OIr(),dmc=QAe(),fmc=H4e(),mDr=o3i(),C3i=nxr(),pmc=y3i(),tV=_$(),Ch=HAe(),hmc={isCycling:!1,promptOnly:!1,isSpeculative:!1};function mmc(t,e,r){let n=t.get(ADr.ICompletionsFeaturesService),o=(0,oBe.getConfig)(t,oBe.ConfigKey.CompletionsDebounce)??n.completionsDebounce(r)??e.debounceMs;if(o===void 0)return 0;let s=(0,vye.now)()-r.issuedTime;return Math.max(0,o-s)}a(mmc,"getRemainingDebounceMs");function iBe(t,e,r){return r?.isCancellationRequested||e!==t.currentRequestId}a(iBe,"isCompletionRequestCancelled");var rvt=class{static{a(this,"GhostTextComputer")}constructor(e,r,n,o,s,c,l,u,d,f,h){this.instantiationService=e,this.telemetryService=r,this.notifierService=n,this.contextProviderBridge=o,this.currentGhostText=s,this.contextproviderStatistics=c,this.asyncCompletionManager=l,this.completionsFeaturesService=u,this.logTarget=d,this.statusReporter=f,this.logService=h}async getGhostText(e,r,n,o,s,c){let l=(0,Zhc.generateUuid)();s.setHeaderRequestId(l);let u=c.createSubLogger(["GhostTextComputer#getGhostText"]);this.currentGhostText.currentRequestId=l;let d=await this.instantiationService.invokeFunction(vmc,e.textDocument,l,n);await(0,emc.ensureTokenizersLoaded)().catch(()=>{});try{this.contextProviderBridge.schedule(e,l,n?.opportunityId??"",d,r,n),this.notifierService.notifyRequest(e,l,d,r,n);let f=await this.getGhostTextWithoutAbortHandling(e,l,d,r,n,o,s,u),h=this.contextproviderStatistics.getStatisticsForCompletion(l),m=n?.opportunityId??"unknown";for(let[g,A]of h.getAllUsageStatistics())this.telemetryService.sendMSFTTelemetryEvent("context-provider.completion-stats",{requestId:l,opportunityId:m,providerId:g,resolution:A.resolution,usage:A.usage,usageDetails:JSON.stringify(A.usageDetails)},{});return f}catch(f){if((0,imc.isAbortError)(f))return{type:"canceled",reason:"aborted at unknown location",telemetryData:(0,Ch.mkCanceledResultTelemetry)(d,{cancelledNetworkRequest:!0})};throw f}}async getGhostTextWithoutAbortHandling(e,r,n,o,s,c,l,u){let d=u.createSubLogger(["GhostTextComputer#getGhostTextWithoutAbortHandling"]),f=n.issuedTime,h=[];function m(v){let b=(0,vye.now)();h.push([v,b-f]),f=b}if(a(m,"recordPerformance"),m("telemetry"),iBe(this.currentGhostText,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:(0,Ch.mkBasicResultTelemetry)(n)};let g=ymc(e.textDocument,e.position);if(g===void 0)return d.debug("Completions do not trigger in the middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:(0,Ch.mkBasicResultTelemetry)(n)};let A=this.instantiationService.invokeFunction(omc.getEngineRequestInfo,n),y={...hmc,...s,tokenizer:A.tokenizer},E=await this.instantiationService.invokeFunction(fDr.extractPrompt,r,e,n,void 0,y);if(m("prompt"),c.setPrompt(fDr.PromptResponse.toString(E)),E.type==="copilotContentExclusion")return d.debug("Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:(0,Ch.mkBasicResultTelemetry)(n)};if(E.type==="contextTooShort")return d.debug("Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:(0,Ch.mkBasicResultTelemetry)(n)};if(E.type==="promptError")return d.debug("Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:(0,Ch.mkBasicResultTelemetry)(n)};if(y.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:E};if(E.type==="promptCancelled")return d.debug("Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:(0,Ch.mkBasicResultTelemetry)(n)};if(E.type==="promptTimeout")return d.debug("Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:(0,Ch.mkBasicResultTelemetry)(n)};if(E.prompt.prefix.length===0&&E.prompt.suffix.length===0)return d.debug("Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:(0,Ch.mkBasicResultTelemetry)(n)};let _=this.instantiationService.invokeFunction(mmc,y,n);return _>0&&(d.debug(`Debouncing ghost text request for ${_}ms`),await(0,E3i.delay)(_),iBe(this.currentGhostText,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:(0,Ch.mkBasicResultTelemetry)(n)}:this.statusReporter.withProgress(async()=>{let[v]=(0,fDr.trimLastLine)(e.textDocument.getText(tvt.LocationFactory.range(tvt.LocationFactory.position(0,0),e.position)));d.trace(`Starting ghost text computation, prefix length: ${v.length}`);let b=this.currentGhostText.hasAcceptedCurrentCompletion(v,E.prompt.suffix);d.trace(`hasAcceptedCurrentCompletion: ${b}`);let T=E.prompt,w=await this.instantiationService.invokeFunction(pmc.getGhostTextStrategy,e,v,E,g,b,n);m("strategy"),d.trace(`Ghost text strategy: blockMode=${w.blockMode}, requestMultiline=${w.requestMultiline}, stop=${w.stop}, maxTokens=${w.maxTokens}`);let R=this.instantiationService.invokeFunction(Amc,v,T,w.requestMultiline);d.trace(`Local cache lookup: ${R?`found ${R[0].length} choices`:"no cached choices"}`),m("cache");let x=this.instantiationService.invokeFunction(hDr.extractRepoInfoInBackground,e.textDocument.uri),P={blockMode:w.blockMode,languageId:e.textDocument.detectedLanguageId,repoInfo:x,engineModelId:A.modelId,ourRequestId:r,prefix:v,prompt:E.prompt,multiline:w.requestMultiline,indentation:(0,lmc.contextIndentation)(e.textDocument,e.position),isCycling:y.isCycling,headers:A.headers,stop:w.stop,maxTokens:w.maxTokens,afterAccept:b};P.headers={...P.headers,"X-Copilot-Async":"true","X-Copilot-Speculative":y.isSpeculative?"true":"false"};let D=this.instantiationService.invokeFunction(bmc,e.textDocument,P,e.position,E,n,A,y);if(R===void 0&&!y.isCycling&&this.asyncCompletionManager.shouldWaitForAsyncCompletions(v,E.prompt)){d.trace("No cached choices, waiting for async completions from in-flight request");let Q=await this.asyncCompletionManager.getFirstMatchingRequestWithTimeout(r,v,E.prompt,y.isSpeculative,D);if(m("asyncWait"),Q){d.trace("Received choice from async completion");let Y=!w.requestMultiline;R=[[(0,mDr.makeGhostAPIChoice)(Q[0],{forceSingleLine:Y})],tV.ResultType.Async]}else d.trace("No matching async completion found within timeout");if(iBe(this.currentGhostText,r,o))return d.debug("Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:(0,Ch.mkBasicResultTelemetry)(D)}}else d.trace("Skipping wait for async completions");let N=w.blockMode===oBe.BlockMode.MoreMultiline&&dmc.BlockTrimmer.isSupported(e.textDocument.detectedLanguageId);if(R!==void 0&&(d.trace(`Post-processing ${R[0].length} cached choices, isMoreMultiline=${N}`),R[0]=R[0].map(Q=>this.instantiationService.invokeFunction(pDr.postProcessChoiceInContext,e.textDocument,e.position,Q,N,d)).filter(Q=>Q!==void 0)),R&&(R[1]===tV.ResultType.Cache||R[1]===tV.ResultType.TypingAsSuggested)&&(l.setIsFromCache(),c.markAsFromCache()),R!==void 0&&R[0].length===0)return d.trace(`Found empty inline suggestions locally via ${(0,Ch.resultTypeToString)(R[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:(0,Ch.mkBasicResultTelemetry)(D)};if(R!==void 0&&R[0].length>0&&(!y.isCycling||R[0].length>1))d.trace(`Found inline suggestions locally via ${(0,Ch.resultTypeToString)(R[1])}`);else{d.trace(`Going to network, isCycling=${y.isCycling}`);let Q=this.instantiationService.createInstance(mDr.CompletionsFromNetwork);if(y.isCycling){d.trace("Fetching all completions for cycling request");let Y=await Q.getAllCompletionsFromNetwork(P,D,o,w.finishedCb,l);if(Y.type==="success"){d.trace(`Cycling network request returned ${Y.value[0].length} choices`);let W=R?.[0]??[];Y.value[0].forEach(V=>{W.findIndex(z=>z.completionText.trim()===V.completionText.trim())===-1&&W.push(V)}),d.trace(`After deduplication: ${W.length} unique choices`),R=[W,tV.ResultType.Cycling]}else if(R===void 0)return Y}else{d.trace("Initiating network request for completions");let Y=a((ie,H)=>(this.asyncCompletionManager.updateCompletion(r,ie),w.finishedCb(ie,H)),"finishedCb"),W=new tmc.CancellationTokenSource,V=Q.getCompletionsFromNetwork(P,D,W.token,Y,l);this.asyncCompletionManager.queueCompletionRequest(r,v,E.prompt,W,V);let z=await this.asyncCompletionManager.getFirstMatchingRequest(r,v,E.prompt,y.isSpeculative);if(z===void 0)return d.trace("Network request returned no results"),{type:"empty",reason:"received no results from async completions",telemetryData:(0,Ch.mkBasicResultTelemetry)(D)};d.trace("Received completion from network request"),R=[[z[0]],tV.ResultType.Async]}m("network")}if(R===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,Ch.mkBasicResultTelemetry)(D)};let[L,B]=R;d.trace(`Final choices: ${L.length} from ${(0,Ch.resultTypeToString)(B)}`);let j=L.map(Q=>this.instantiationService.invokeFunction(pDr.postProcessChoiceInContext,e.textDocument,e.position,Q,N,d)).filter(Q=>Q!==void 0);d.trace(`Post-processed to ${j.length} choices`);let M=this.instantiationService.invokeFunction(oBe.getConfig,oBe.ConfigKey.CompletionsDelay)??this.completionsFeaturesService.completionsDelay(n),O=(0,vye.now)()-n.issuedTime,U=Math.max(M-O,0);if(B!==tV.ResultType.TypingAsSuggested&&!y.isCycling&&U>0&&(d.debug(`Waiting ${U}ms before returning completion`),await(0,E3i.delay)(U),iBe(this.currentGhostText,r,o)))return d.debug("Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:(0,Ch.mkCanceledResultTelemetry)(D)};let q=[];for(let Q of j){let Y=Cmc(e.textDocument,P,Q,D),W=g?(0,pDr.checkSuffix)(e.textDocument,e.position,Q):0,z={completion:Emc(Q.choiceIndex,Q.completionText,E.trailingWs),telemetry:Y,isMiddleOfTheLine:g,suffixCoverage:W,copilotAnnotations:Q.copilotAnnotations,clientCompletionId:Q.clientCompletionId};q.push(z)}return D.properties.clientCompletionId=q[0]?.clientCompletionId,D.measurements.foundOffset=q?.[0]?.telemetry?.measurements?.foundOffset??-1,d.debug(`Produced ${q.length} results from ${(0,Ch.resultTypeToString)(B)} at ${D.measurements.foundOffset} offset`),iBe(this.currentGhostText,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:(0,Ch.mkCanceledResultTelemetry)(D)}:(y.isSpeculative||(d.trace("Updating current ghost text as request is not speculative"),this.currentGhostText.setGhostText(v,E.prompt.suffix,j,B)),l.setHeaderRequestId(j[0]?.requestId.headerRequestId??r),m("complete"),d.trace(`Ghost text computation complete, returning ${q.length} results`),{type:"success",value:[q,B],telemetryData:(0,Ch.mkBasicResultTelemetry)(D),telemetryBlob:D,resultType:B,performanceMetrics:h})})}};KR.GhostTextComputer=rvt;KR.GhostTextComputer=rvt=Yhc([dN(0,v3i.IInstantiationService),dN(1,Khc.ITelemetryService),dN(2,rmc.ICompletionsNotifierService),dN(3,amc.ICompletionsContextProviderBridgeService),dN(4,C3i.ICompletionsCurrentGhostText),dN(5,cmc.ICompletionsContextProviderService),dN(6,umc.ICompletionsAsyncManagerService),dN(7,ADr.ICompletionsFeaturesService),dN(8,nmc.ICompletionsLogTargetService),dN(9,smc.ICompletionsStatusReporter),dN(10,_3i.ILogService)],rvt);async function gmc(t,e,r,n,o,s,c){return t.get(v3i.IInstantiationService).createInstance(rvt).getGhostText(e,r,n,o,s,c)}a(gmc,"getGhostText");function Amc(t,e,r,n){let s=t.get(C3i.ICompletionsCurrentGhostText).getCompletionsForUserTyping(e,r.suffix),c=_mc(t,e,r.suffix,n);if(s&&s.length>0){let l=(c??[]).filter(u=>!s.some(d=>d.completionText===u.completionText));return[s.concat(l),tV.ResultType.TypingAsSuggested]}if(c&&c.length>0)return[c,tV.ResultType.Cache]}a(Amc,"getLocalInlineSuggestion");function ymc(t,e){let n=t.lineAt(e).text.substring(e.character);return(0,Xhc.isInlineSuggestionFromTextAfterCursor)(n)}a(ymc,"isInlineSuggestion");var gDr=class t{static{a(this,"ForceMultiLine")}static{this.default=new t}constructor(e=!1){this.requestMultilineOverride=e}};KR.ForceMultiLine=gDr;function Emc(t,e,r){if(r.length>0){if(e.startsWith(r))return{completionIndex:t,completionText:e,displayText:e.substring(r.length),displayNeedsWsOffset:!1};{let n=e.substring(0,e.length-e.trimStart().length);return r.startsWith(n)?{completionIndex:t,completionText:e,displayText:e.trimStart(),displayNeedsWsOffset:!0}:{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}}else return{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}a(Emc,"adjustLeadingWhitespace");function _mc(t,e,r,n){let o=t.get(_3i.ILogService).createSubLogger(["getCompletionsFromCache"]),s=t.get(fmc.ICompletionsCacheService).findAll(e,r);return s.length===0?(o.debug("Found no completions in cache"),[]):(o.debug(`Found ${s.length} completions in cache`),s.map(c=>(0,mDr.makeGhostAPIChoice)(c,{forceSingleLine:!n})))}a(_mc,"getCompletionsFromCache");async function vmc(t,e,r,n){let o=t.get(ADr.ICompletionsFeaturesService),s={headerRequestId:r};n?.opportunityId&&(s.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(s.completionsActive="true"),n?.isSpeculative&&(s.reason="speculative");let c=vye.TelemetryData.createAndMarkAsIssued(s);return await o.updateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},c)}a(vmc,"createTelemetryWithExp");function Cmc(t,e,r,n){let o=r.requestId,s={choiceIndex:r.choiceIndex.toString(),clientCompletionId:r.clientCompletionId};r.generatedChoiceIndex!==void 0&&(s.originalChoiceIndex=s.choiceIndex,s.choiceIndex=(1e4*(r.generatedChoiceIndex+1)+r.choiceIndex).toString());let c={compCharLen:r.completionText.length,numLines:r.completionText.trim().split(` +`).length};r.meanLogProb&&(c.meanLogProb=r.meanLogProb),r.meanAlternativeLogProb&&(c.meanAlternativeLogProb=r.meanAlternativeLogProb);let l=r.telemetryData.extendedBy(s,c);return l.issuedTime=n.issuedTime,l.measurements.timeToProduceMs=performance.now()-n.issuedTime,b3i(l,t),l.extendWithRequestId(o),l}a(Cmc,"telemetryWithAddData");function bmc(t,e,r,n,o,s,c,l){let u={languageId:e.detectedLanguageId};u.afterAccept=r.afterAccept.toString(),u.isSpeculative=l.isSpeculative.toString();let d=s.extendedBy(u);b3i(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===hDr.ComputationStatus.PENDING?"pending":"available",f!==void 0&&f!==hDr.ComputationStatus.PENDING&&(d.properties.gitRepoUrl=f.url,d.properties.gitRepoHost=f.hostname,f.repoId?.type==="github"?(d.properties.gitRepoOwner=f.repoId.org,d.properties.gitRepoName=f.repoId.repo):f.repoId?.type==="ado"&&(d.properties.gitRepoOwner=f.repoId.project,d.properties.gitRepoName=f.repoId.repo),d.properties.gitRepoPath=f.pathname),d.properties.engineName=c.modelId,d.properties.engineChoiceSource=c.engineChoiceSource,d.properties.isMultiline=JSON.stringify(r.multiline),d.properties.isCycling=JSON.stringify(r.isCycling);let h=e.lineAt(n.line),m=e.getText(tvt.LocationFactory.range(h.range.start,n)),g=e.getText(tvt.LocationFactory.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,Jhc.createSha256Hash)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...(0,vye.telemetrizePromptLength)(o.prompt),promptEndPos:e.offsetAt(n),promptComputeTimeMs:o.computeTimeMs};o.metadata&&(y.promptMetadata=JSON.stringify(o.metadata)),o.contextProvidersTelemetry&&(y.contextProviders=JSON.stringify(o.contextProvidersTelemetry));let _=d.extendedBy(y,E);return(0,vye.telemetry)(t,"ghostText.issued",_),d}a(bmc,"telemetryIssued");function b3i(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(b3i,"addDocumentTelemetry")});var w3i=I(s9=>{"use strict";p();var Smc=s9&&s9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},yDr=s9&&s9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(s9,"__esModule",{value:!0});s9.GhostText=void 0;var T3i=ei(),Tmc=$s(),Imc=sxr(),xmc=vBi(),I3i=S3i(),wmc=v2r(),Rmc=_$(),kmc=Lyt(),x3i=HAe(),Pmc=Dl(),EDr=class{static{a(this,"GhostText")}constructor(e,r,n){this.instantiationService=e,this.logTargetService=r,this.speculativeRequestCache=n}async getInlineCompletions(e,r,n,o={},s,c,l){Dmc(this.logTargetService,e,r);let u=await this.getInlineCompletionsResult((0,Imc.createCompletionState)(e,r),n,o,s,c,l);return this.instantiationService.invokeFunction(x3i.handleGhostTextResultTelemetry,u)}async getInlineCompletionsResult(e,r,n={},o,s,c){let l=0;n.selectedCompletionInfo?.text&&!n.selectedCompletionInfo.text.includes(")")&&(e=e.addSelectedCompletionInfo(n.selectedCompletionInfo),l=e.position.character-n.selectedCompletionInfo.range.end.character);let u=await this.instantiationService.invokeFunction(I3i.getGhostText,e,r,n,o,s,c);if(u.type!=="success")return u;let[d,f]=u.value;if(r.isCancellationRequested)return{type:"canceled",reason:"after getGhostText",telemetryData:{telemetryBlob:u.telemetryBlob}};let h=this.instantiationService.invokeFunction(wmc.setLastShown,e.textDocument,e.position,f),m=(0,xmc.completionsFromGhostTextResults)(d,f,e.textDocument,e.position,n.formattingOptions,h);if(m.length===0)return{type:"empty",reason:"no completions in final result",telemetryData:u.telemetryData};if(f!==Rmc.ResultType.TypingAsSuggested){e=e.applyEdits([{newText:m[0].insertText,range:m[0].range}]);let A={isSpeculative:!0,opportunityId:n.opportunityId},y=a(()=>this.instantiationService.invokeFunction(I3i.getGhostText,e,void 0,A,o,s,c),"fn");this.speculativeRequestCache.set(m[0].clientCompletionId,y)}let g=m.map(A=>{let{start:y,end:E}=A.range,_=T3i.Range.create(y,T3i.Position.create(E.line,E.character-l));return{...A,range:_}});return{...u,value:g}}};s9.GhostText=EDr;s9.GhostText=EDr=Smc([yDr(0,Tmc.IInstantiationService),yDr(1,Pmc.ICompletionsLogTargetService),yDr(2,kmc.ICompletionsSpeculativeRequestCache)],EDr);function Dmc(t,e,r){let n=e.getText({start:{line:Math.max(r.line-1,0),character:0},end:r}),o=e.getText({start:r,end:{line:Math.min(r.line+2,e.lineCount-1),character:e.lineCount-1>r.line?0:r.character}});x3i.logger.debug(t,`Requesting for ${e.uri} at ${r.line}:${r.character}`,`between ${JSON.stringify(n)} and ${JSON.stringify(o)}.`)}a(Dmc,"logCompletionLocation")});var R3i=I(ovt=>{"use strict";p();Object.defineProperty(ovt,"__esModule",{value:!0});ovt.LocalFileSystem=void 0;var nvt=require("fs"),Nmc=require("path"),ivt=g$(),_Dr=y$(),vDr=class{static{a(this,"LocalFileSystem")}async readFileString(e){return(await nvt.promises.readFile((0,_Dr.fsPath)(e))).toString()}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink((0,_Dr.fsPath)(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=(0,_Dr.fsPath)(e),n=await nvt.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,Nmc.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await nvt.promises.lstat(e);if(r.isSymbolicLink())try{let n=await nvt.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=ivt.FileType.Unknown;return e.isFile()&&(o=ivt.FileType.File),e.isDirectory()&&(o=ivt.FileType.Directory),r.isSymbolicLink()&&n&&(o|=ivt.FileType.SymbolicLink),o}};ovt.LocalFileSystem=vDr});var N3i=I(a9=>{"use strict";p();var Mmc=a9&&a9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},sBe=a9&&a9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(a9,"__esModule",{value:!0});a9.CompositeRelatedFilesProvider=void 0;var Omc=Vre(),Lmc=$s(),Cye=qE(),Bmc=gy(),Fmc=g$(),Umc=Dl(),aBe=tye(),Fne=BEt(),k3i=["cpp","c","cuda-cpp"],P3i=["typescript","javascript","typescriptreact","javascriptreact"],D3i=["csharp"],Qmc=new Map([...k3i.map(t=>[t,aBe.NeighboringFileType.RelatedCpp]),...P3i.map(t=>[t,aBe.NeighboringFileType.RelatedTypeScript]),...D3i.map(t=>[t,aBe.NeighboringFileType.RelatedCSharpRoslyn])]);function qmc(t){return Qmc.get(t)??aBe.NeighboringFileType.RelatedOther}a(qmc,"getNeighboringFileType");var CDr=class extends Fne.RelatedFilesProvider{static{a(this,"CompositeRelatedFilesProvider")}constructor(e,r,n,o,s){super(e,r,o,s),this.featuresService=n,this.providers=new Map,this.telemetrySent=!1,this.reportedUnknownProviders=new Set}async getRelatedFilesResponse(e,r,n){let o=Date.now(),s=e.clientLanguageId.toLowerCase();if(qmc(s)===aBe.NeighboringFileType.RelatedOther&&!this.reportedUnknownProviders.has(s)&&(this.reportedUnknownProviders.add(s),Fne.relatedFilesLogger.warn(this.logTarget,`unknown language ${s}`)),this.relatedFilesTelemetry(r),Fne.relatedFilesLogger.debug(this.logTarget,`Fetching related files for ${e.uri}`),!this.isActive(s,r))return Fne.relatedFilesLogger.debug(this.logTarget,"language-server related-files experiment is not active."),Fne.EmptyRelatedFilesResponse;let l=this.providers.get(s);if(!l)return Fne.EmptyRelatedFilesResponse;try{return this.convert(e.uri,l,o,r,n)}catch{this.relatedFileNonresponseTelemetry(s,r);return}}async convert(e,r,n,o,s){s||(s={isCancellationRequested:!1,onCancellationRequested:a(()=>({dispose(){}}),"onCancellationRequested")});let c={entries:[],traits:[]},l=r.size>0;for(let u of r.values()){let d=await u.callback(e,{flags:{}},s);if(d){l=!1,c.entries.push(...d.entries),d.traits&&c.traits.push(...d.traits);for(let f of d.entries)for(let h of f.uris)Fne.relatedFilesLogger.debug(this.logTarget,h.toString())}}return this.performanceTelemetry(Date.now()-n,o),l?void 0:c}registerRelatedFilesProvider(e,r,n){let o=this.providers.get(r);o?o.set(e,{extensionId:e,languageId:r,callback:n}):this.providers.set(r,new Map([[e,{extensionId:e,languageId:r,callback:n}]]))}unregisterRelatedFilesProvider(e,r,n){let o=this.providers.get(r);if(o){let s=o.get(e);s&&s.callback===n&&o.delete(e)}}isActive(e,r){return D3i.includes(e)?this.featuresService.relatedFilesVSCodeCSharp(r)||this.instantiationService.invokeFunction(Cye.getConfig,Cye.ConfigKey.RelatedFilesVSCodeCSharp):P3i.includes(e)?this.featuresService.relatedFilesVSCodeTypeScript(r)||this.instantiationService.invokeFunction(Cye.getConfig,Cye.ConfigKey.RelatedFilesVSCodeTypeScript):k3i.includes(e)?this.featuresService.cppHeadersEnableSwitch(r):this.featuresService.relatedFilesVSCode(r)||this.instantiationService.invokeFunction(Cye.getConfig,Cye.ConfigKey.RelatedFilesVSCode)}relatedFilesTelemetry(e){}relatedFileNonresponseTelemetry(e,r){}performanceTelemetry(e,r){}};a9.CompositeRelatedFilesProvider=CDr;a9.CompositeRelatedFilesProvider=CDr=Mmc([sBe(0,Lmc.IInstantiationService),sBe(1,Omc.IIgnoreService),sBe(2,Bmc.ICompletionsFeaturesService),sBe(3,Umc.ICompletionsLogTargetService),sBe(4,Fmc.ICompletionsFileSystemService)],CDr)});var svt=I(Une=>{"use strict";p();Object.defineProperty(Une,"__esModule",{value:!0});Une.PositionOffsetTransformer=Une.PositionOffsetTransformerBase=void 0;Une.ensureDependenciesAreSet=Gmc;var M3i=ME(),O3i=B5e(),jmc=cdt(),Hmc=Bme(),L3i=cdt();Object.defineProperty(Une,"PositionOffsetTransformerBase",{enumerable:!0,get:a(function(){return L3i.PositionOffsetTransformerBase},"get")});Object.defineProperty(Une,"PositionOffsetTransformer",{enumerable:!0,get:a(function(){return L3i.PositionOffsetTransformer},"get")});(0,jmc._setPositionOffsetTransformerDependencies)({StringEdit:M3i.StringEdit,StringReplacement:M3i.StringReplacement,TextReplacement:O3i.TextReplacement,TextEdit:O3i.TextEdit,TextLength:Hmc.TextLength});function Gmc(){}a(Gmc,"ensureDependenciesAreSet")});var cvt=I(avt=>{"use strict";p();Object.defineProperty(avt,"__esModule",{value:!0});avt.RootedLineEdit=void 0;var B3i=VG(),$mc=svt(),Vmc=fN();(0,$mc.ensureDependenciesAreSet)();var bDr=class t{static{a(this,"RootedLineEdit")}static fromEdit(e){let r=B3i.LineEdit.fromStringEdit(e.edit,e.base);return new t(e.base,r)}constructor(e,r){this.base=e,this.edit=r}toString(){return this.edit.humanReadablePatch(this.base.getLines())}toEdit(){return this.edit.toEdit(this.base)}toRootedEdit(){return new Vmc.RootedEdit(this.base,this.toEdit())}getEditedState(){let e=this.base.getLines();return this.edit.apply(e)}removeCommonSuffixPrefixLines(){let e=a(n=>!n.lineRange.isEmpty||n.newLines.length>0,"isNotEmptyEdit"),r=this.edit.replacements.map(n=>n.removeCommonSuffixPrefixLines(this.base)).filter(n=>e(n));return new t(this.base,new B3i.LineEdit(r))}};avt.RootedLineEdit=bDr});var fN=I(rV=>{"use strict";p();Object.defineProperty(rV,"__esModule",{value:!0});rV.Edits=rV.SingleEdits=rV.RootedEdit=void 0;var F3i=sd(),Wmc=VG(),bye=ME(),U3i=TDr(),zmc=cvt(),cBe=class t{static{a(this,"RootedEdit")}static toLineEdit(e){return Wmc.LineEdit.fromStringEdit(e.edit,e.base)}constructor(e,r){this.base=e,this.edit=r}getEditedState(){return this.edit.applyOnText(this.base)}rebase(e){return(0,F3i.assertFn)(()=>null.base.equals(e.applyOnText(this.base))),(0,F3i.assertFn)(()=>null.edit.applyOnText(null.base).equals(this.edit.applyOnText(e.applyOnText(this.base)))),null}toString(){return zmc.RootedLineEdit.fromEdit(this).toString()}normalize(){return new t(this.base,this.edit.normalizeOnSource(this.base.value))}equals(e){return this.base.equals(e.base)&&this.edit.equals(e.edit)}};rV.RootedEdit=cBe;var SDr=class{static{a(this,"SingleEdits")}constructor(e){this.edits=e}compose(){return bye.StringEdit.compose(this.edits.map(e=>e.toEdit()))}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}toEdits(){return new lvt(bye.StringEdit,this.edits.map(e=>e.toEdit()))}};rV.SingleEdits=SDr;var lvt=class t{static{a(this,"Edits")}static single(e){return new t(bye.StringEdit,[e])}constructor(e,r){this._editType=e,this.edits=r}compose(){let e=new this._editType([]);for(let r of this.edits)e=e.compose(r);return e}add(e){return new t(this._editType,[...this.edits,e])}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}swap(e){let r=e,n=[];for(let o of this.edits){let s=bye.BaseStringEdit.trySwap(r,o);if(!s)return;n.push(s.e1),r=s.e2}return{edits:new t(bye.StringEdit,n),editLast:r}}serialize(){return this.edits.map(e=>(0,U3i.serializeStringEdit)(e))}static deserialize(e){return new t(bye.StringEdit,e.map(r=>(0,U3i.deserializeStringEdit)(r)))}toHumanReadablePatch(e){let r=e,n=[];for(let o of this.edits){let s=cBe.toLineEdit(new cBe(r,o));n.push(s.humanReadablePatch(r.getLines())),r=o.applyOnText(r)}return n.join(` --- -`)}};G$.Edits=B_t});var k2r=I(cye=>{"use strict";p();Object.defineProperty(cye,"__esModule",{value:!0});cye.serializeStringEdit=Ipc;cye.serializeSingleEdit=KLi;cye.deserializeStringEdit=xpc;cye.decomposeStringEdit=Rpc;var Spc=Rs(),YLi=kE(),Tpc=hd(),zLi=iN();function Ipc(t){return t.replacements.map(e=>KLi(e))}a(Ipc,"serializeStringEdit");function KLi(t){return[t.replaceRange.start,t.replaceRange.endExclusive,t.newText]}a(KLi,"serializeSingleEdit");function xpc(t){return new YLi.StringEdit(t.map(e=>wpc(e)))}a(xpc,"deserializeStringEdit");function wpc(t){return new YLi.StringReplacement(new Tpc.OffsetRange(t[0],t[1]),t[2])}a(wpc,"deserializeSingleEdit");function Rpc(t,e){if(e===void 0){let o=[],s=0;for(let c of t.replacements)o.push(c.delta(s)),s+=c.newText.length-c.replaceRange.length;return new zLi.SingleEdits(o)}if(t.replacements.length!==e.arrayLength)throw(0,Spc.illegalArgument)(`Number of edits ${t.replacements.length} does not match ${e.arrayLength}`);let r=[],n=t.replacements.slice();for(let o=0;o{"use strict";p();Object.defineProperty(F_t,"__esModule",{value:!0});F_t.DebugRecorderBookmark=void 0;var P2r=class{static{a(this,"DebugRecorderBookmark")}constructor(e){this.timeMs=e}};F_t.DebugRecorderBookmark=P2r});var tBi=I(Q_t=>{"use strict";p();Object.defineProperty(Q_t,"__esModule",{value:!0});Q_t.DebugRecorder=void 0;var ZLi=k2r(),kpc=JLi(),Ppc=h4(),Dpc=vMe(),U_t=Sl(),XLi=Ro(),Npc=tJ(),Mpc=C8(),Opc=NA(),eBi=T0(),Lpc=qT(),D2r=class extends XLi.Disposable{static{a(this,"DebugRecorder")}constructor(e,r=Dpc.now){super(),this._workspace=e,this.getNow=r,this._id=0,this._documentHistories=new Map,(0,Mpc.mapObservableArrayCached)(this,this._workspace.openDocuments,(n,o)=>{let s=this._workspace.getWorkspaceRoot(n.id);if(!s)return;if(!this._workspaceRoot)this._workspaceRoot=s;else if(this._workspaceRoot.toString()!==s.toString())return;let c=new N2r(s,n.id,n.value.get().value,this._id++,n.languageId.get(),()=>this.getTimestamp());this._documentHistories.set(c.docId,c),o.add((0,Ppc.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},l=>{l.languageId.changes.length>0&&(c.languageId=l.languageId.value);for(let u of l.value.changes)c.handleEdit(u);l.selection.changes.length>0&&c.handleSelections(l.selection.value)})),o.add((0,XLi.toDisposable)(()=>{this._documentHistories.delete(n.id)}))},n=>n.id).recomputeInitiallyAndOnChange(this._store)}getTimestamp(){let e=this.getNow();return this._lastTimestamp!==void 0&&e<=this._lastTimestamp&&(e=this._lastTimestamp+1),this._lastTimestamp=e,e}getRecentLog(e=void 0){if(!this._workspaceRoot)return;let r=[];r.push({entry:{documentType:"workspaceRecording@1.0",kind:"header",repoRootUri:this._workspaceRoot.toString(),time:this.getNow(),uuid:(0,eBi.generateUuid)()},sortTime:0});for(let n of this._documentHistories.values())r.push(...n.getDocumentLog(e));return r.sort((0,U_t.compareBy)(n=>n.sortTime,U_t.numberComparator)),r.map(n=>n.entry)}getLogInRange(e,r){if(!this._workspaceRoot)return;let n=[];n.push({entry:{documentType:"workspaceRecording@1.0",kind:"header",repoRootUri:this._workspaceRoot.toString(),time:this.getNow(),uuid:(0,eBi.generateUuid)()},sortTime:0});for(let o of this._documentHistories.values())n.push(...o.getDocumentLogInRange(e,r));return n.sort((0,U_t.compareBy)(o=>o.sortTime,U_t.numberComparator)),n.map(o=>o.entry)}createBookmark(){return new kpc.DebugRecorderBookmark(this.getNow())}};Q_t.DebugRecorder=D2r;var N2r=class{static{a(this,"DocumentHistory")}constructor(e,r,n,o,s,c){this.workspaceUri=e,this.docId=r,this.id=o,this.languageId=s,this.getNow=c,this._edits=[],this.relativePath=(()=>{let l=(0,Opc.relative)(this.workspaceUri.path,this.docId.path);return this.docId.toUri().scheme===Npc.Schemas.vscodeNotebookCell?`${l}#${this.docId.fragment}`:l})(),this._baseValue=new Lpc.StringText(n),this.creationTime=this.getNow(),this._baseValueTime=this.creationTime}handleSelections(e){this._edits.push({kind:"selections",selections:e,instant:this.getNow()})}handleEdit(e){e.isEmpty()||(this._edits.push({kind:"edit",edit:e,instant:this.getNow()}),this.cleanUpHistory())}cleanUpHistory(){let r=this.getNow()-3e5;for(;this._edits.length>0&&this._edits[0].instante.timeMs)break;if(o.kind==="selections"){let s=o.selections.map(c=>[c.start,c.endExclusive]);r.push({entry:{kind:"selectionChanged",id:this.id,selection:s,time:o.instant},sortTime:o.instant})}else n++,r.push({entry:{kind:"changed",id:this.id,v:n,edit:(0,ZLi.serializeStringEdit)(o.edit),time:o.instant},sortTime:o.instant})}return r}getDocumentLogInRange(e,r){let n=this._edits.filter(u=>u.instant>=e&&u.instant<=r);if(n.length===0)return[];let o=this._baseValue,s=this._baseValueTime;if(e>s)for(let u of this._edits){if(u.instant>=e)break;u.kind==="edit"&&(o=u.edit.applyOnText(o),s=u.instant)}let c=[];c.push({entry:{kind:"documentEncountered",id:this.id,relativePath:this.relativePath,time:this.creationTime},sortTime:this.creationTime});let l=1;c.push({entry:{kind:"setContent",id:this.id,v:l,content:o.value,time:s},sortTime:s}),c.push({entry:{kind:"opened",id:this.id,time:s},sortTime:s});for(let u of n)if(u.kind==="selections"){let d=u.selections.map(f=>[f.start,f.endExclusive]);c.push({entry:{kind:"selectionChanged",id:this.id,selection:d,time:u.instant},sortTime:u.instant})}else l++,c.push({entry:{kind:"changed",id:this.id,v:l,edit:(0,ZLi.serializeStringEdit)(u.edit),time:u.instant},sortTime:u.instant});return c}}});var rBi=I(q_t=>{"use strict";p();Object.defineProperty(q_t,"__esModule",{value:!0});q_t.CapturingToken=void 0;var M2r=class{static{a(this,"CapturingToken")}constructor(e,r,n,o,s,c,l){this.label=e,this.icon=r,this.subAgentInvocationId=n,this.subAgentName=o,this.chatSessionId=s,this.parentChatSessionId=c,this.debugLogLabel=l}};q_t.CapturingToken=M2r});var nBi=I(O2r=>{"use strict";p();Object.defineProperty(O2r,"__esModule",{value:!0});O2r.secondsToHumanReadableTime=Bpc;function Bpc(t){if(t<90)return`${t} seconds`;let e=Math.floor(t/60);if(t<=5400)return`${e} minutes`;let r=Math.floor(e/60),n=e%60,o=`${r} hours`;return n>0&&(o+=` ${n} minutes`),o}a(Bpc,"secondsToHumanReadableTime")});var jR=I(Jd=>{"use strict";p();var Fpc=Jd&&Jd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Upc=Jd&&Jd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Qpc=Jd&&Jd.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(Sye,"__esModule",{value:!0});Sye.serializeStringEdit=Jmc;Sye.serializeSingleEdit=j3i;Sye.deserializeStringEdit=Zmc;Sye.decomposeStringEdit=e0c;var Ymc=Rs(),q3i=ME(),Kmc=Ed(),Q3i=fN();function Jmc(t){return t.replacements.map(e=>j3i(e))}a(Jmc,"serializeStringEdit");function j3i(t){return[t.replaceRange.start,t.replaceRange.endExclusive,t.newText]}a(j3i,"serializeSingleEdit");function Zmc(t){return new q3i.StringEdit(t.map(e=>Xmc(e)))}a(Zmc,"deserializeStringEdit");function Xmc(t){return new q3i.StringReplacement(new Kmc.OffsetRange(t[0],t[1]),t[2])}a(Xmc,"deserializeSingleEdit");function e0c(t,e){if(e===void 0){let o=[],s=0;for(let c of t.replacements)o.push(c.delta(s)),s+=c.newText.length-c.replaceRange.length;return new Q3i.SingleEdits(o)}if(t.replacements.length!==e.arrayLength)throw(0,Ymc.illegalArgument)(`Number of edits ${t.replacements.length} does not match ${e.arrayLength}`);let r=[],n=t.replacements.slice();for(let o=0;o{"use strict";p();Object.defineProperty(uvt,"__esModule",{value:!0});uvt.DebugRecorderBookmark=void 0;var IDr=class{static{a(this,"DebugRecorderBookmark")}constructor(e){this.timeMs=e}};uvt.DebugRecorderBookmark=IDr});var W3i=I(fvt=>{"use strict";p();Object.defineProperty(fvt,"__esModule",{value:!0});fvt.DebugRecorder=void 0;var G3i=TDr(),t0c=H3i(),r0c=g4(),n0c=OMe(),dvt=Sl(),$3i=Ro(),i0c=dJ(),o0c=D8(),s0c=LA(),V3i=x0(),a0c=$T(),xDr=class extends $3i.Disposable{static{a(this,"DebugRecorder")}constructor(e,r=n0c.now){super(),this._workspace=e,this.getNow=r,this._id=0,this._documentHistories=new Map,(0,o0c.mapObservableArrayCached)(this,this._workspace.openDocuments,(n,o)=>{let s=this._workspace.getWorkspaceRoot(n.id);if(!s)return;if(!this._workspaceRoot)this._workspaceRoot=s;else if(this._workspaceRoot.toString()!==s.toString())return;let c=new wDr(s,n.id,n.value.get().value,this._id++,n.languageId.get(),()=>this.getTimestamp());this._documentHistories.set(c.docId,c),o.add((0,r0c.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},l=>{l.languageId.changes.length>0&&(c.languageId=l.languageId.value);for(let u of l.value.changes)c.handleEdit(u);l.selection.changes.length>0&&c.handleSelections(l.selection.value)})),o.add((0,$3i.toDisposable)(()=>{this._documentHistories.delete(n.id)}))},n=>n.id).recomputeInitiallyAndOnChange(this._store)}getTimestamp(){let e=this.getNow();return this._lastTimestamp!==void 0&&e<=this._lastTimestamp&&(e=this._lastTimestamp+1),this._lastTimestamp=e,e}getRecentLog(e=void 0){if(!this._workspaceRoot)return;let r=[];r.push({entry:{documentType:"workspaceRecording@1.0",kind:"header",repoRootUri:this._workspaceRoot.toString(),time:this.getNow(),uuid:(0,V3i.generateUuid)()},sortTime:0});for(let n of this._documentHistories.values())r.push(...n.getDocumentLog(e));return r.sort((0,dvt.compareBy)(n=>n.sortTime,dvt.numberComparator)),r.map(n=>n.entry)}getLogInRange(e,r){if(!this._workspaceRoot)return;let n=[];n.push({entry:{documentType:"workspaceRecording@1.0",kind:"header",repoRootUri:this._workspaceRoot.toString(),time:this.getNow(),uuid:(0,V3i.generateUuid)()},sortTime:0});for(let o of this._documentHistories.values())n.push(...o.getDocumentLogInRange(e,r));return n.sort((0,dvt.compareBy)(o=>o.sortTime,dvt.numberComparator)),n.map(o=>o.entry)}createBookmark(){return new t0c.DebugRecorderBookmark(this.getNow())}};fvt.DebugRecorder=xDr;var wDr=class{static{a(this,"DocumentHistory")}constructor(e,r,n,o,s,c){this.workspaceUri=e,this.docId=r,this.id=o,this.languageId=s,this.getNow=c,this._edits=[],this.relativePath=(()=>{let l=(0,s0c.relative)(this.workspaceUri.path,this.docId.path);return this.docId.toUri().scheme===i0c.Schemas.vscodeNotebookCell?`${l}#${this.docId.fragment}`:l})(),this._baseValue=new a0c.StringText(n),this.creationTime=this.getNow(),this._baseValueTime=this.creationTime}handleSelections(e){this._edits.push({kind:"selections",selections:e,instant:this.getNow()})}handleEdit(e){e.isEmpty()||(this._edits.push({kind:"edit",edit:e,instant:this.getNow()}),this.cleanUpHistory())}cleanUpHistory(){let r=this.getNow()-3e5;for(;this._edits.length>0&&this._edits[0].instante.timeMs)break;if(o.kind==="selections"){let s=o.selections.map(c=>[c.start,c.endExclusive]);r.push({entry:{kind:"selectionChanged",id:this.id,selection:s,time:o.instant},sortTime:o.instant})}else n++,r.push({entry:{kind:"changed",id:this.id,v:n,edit:(0,G3i.serializeStringEdit)(o.edit),time:o.instant},sortTime:o.instant})}return r}getDocumentLogInRange(e,r){let n=this._edits.filter(u=>u.instant>=e&&u.instant<=r);if(n.length===0)return[];let o=this._baseValue,s=this._baseValueTime;if(e>s)for(let u of this._edits){if(u.instant>=e)break;u.kind==="edit"&&(o=u.edit.applyOnText(o),s=u.instant)}let c=[];c.push({entry:{kind:"documentEncountered",id:this.id,relativePath:this.relativePath,time:this.creationTime},sortTime:this.creationTime});let l=1;c.push({entry:{kind:"setContent",id:this.id,v:l,content:o.value,time:s},sortTime:s}),c.push({entry:{kind:"opened",id:this.id,time:s},sortTime:s});for(let u of n)if(u.kind==="selections"){let d=u.selections.map(f=>[f.start,f.endExclusive]);c.push({entry:{kind:"selectionChanged",id:this.id,selection:d,time:u.instant},sortTime:u.instant})}else l++,c.push({entry:{kind:"changed",id:this.id,v:l,edit:(0,G3i.serializeStringEdit)(u.edit),time:u.instant},sortTime:u.instant});return c}}});var z3i=I(pvt=>{"use strict";p();Object.defineProperty(pvt,"__esModule",{value:!0});pvt.CapturingToken=void 0;var RDr=class{static{a(this,"CapturingToken")}constructor(e,r,n,o,s,c,l){this.label=e,this.icon=r,this.subAgentInvocationId=n,this.subAgentName=o,this.chatSessionId=s,this.parentChatSessionId=c,this.debugLogLabel=l}};pvt.CapturingToken=RDr});var Y3i=I(kDr=>{"use strict";p();Object.defineProperty(kDr,"__esModule",{value:!0});kDr.secondsToHumanReadableTime=c0c;function c0c(t){if(t<90)return`${t} seconds`;let e=Math.floor(t/60);if(t<=5400)return`${e} minutes`;let r=Math.floor(e/60),n=e%60,o=`${r} hours`;return n>0&&(o+=` ${n} minutes`),o}a(c0c,"secondsToHumanReadableTime")});var JR=I(rf=>{"use strict";p();var l0c=rf&&rf.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),u0c=rf&&rf.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),d0c=rf&&rf.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(mL,"__esModule",{value:!0});mL.PendingLoggedChatRequest=mL.IRequestLogger=mL.ChatRequestScheme=void 0;mL.resolveMarkdownContent=zpc;mL.resolveMarkdownIcon=Ypc;var cBi=jR(),Vpc=nn(),Wpc=hd(),L2r=class t{static{a(this,"ChatRequestScheme")}static{this.chatRequestScheme="ccreq"}static buildUri(e,r="markdown"){let n;return r==="markdown"?n="copilotmd":r==="json"?n="json":n="request.json",e.kind==="latest"?`${t.chatRequestScheme}:latest.${n}`:`${t.chatRequestScheme}:${e.id}.${n}`}static parseUri(e){if(e===this.buildUri({kind:"latest"},"markdown"))return{data:{kind:"latest"},format:"markdown"};if(e===this.buildUri({kind:"latest"},"json"))return{data:{kind:"latest"},format:"json"};if(e===this.buildUri({kind:"latest"},"rawrequest"))return{data:{kind:"latest"},format:"rawrequest"};let r=e.match(/ccreq:([^\s]+)\.copilotmd/);if(r)return{data:{kind:"request",id:r[1]},format:"markdown"};let n=e.match(/ccreq:([^\s]+)\.request\.json/);if(n)return{data:{kind:"request",id:n[1]},format:"rawrequest"};let o=e.match(/ccreq:([^\s]+)\.json/);if(o)return{data:{kind:"request",id:o[1]},format:"json"}}static findAllUris(e){let r=/(ccreq:[^\s]+\.(copilotmd|json|request\.json))/g;return[...e.matchAll(r)].map(n=>{let o=n[1];return{uri:o,range:new Wpc.OffsetRange(n.index,n.index+o.length)}})}};mL.ChatRequestScheme=L2r;mL.IRequestLogger=(0,Vpc.createServiceIdentifier)("IRequestLogger");function zpc(t){return typeof t.markdownContent=="function"?t.markdownContent():t.markdownContent}a(zpc,"resolveMarkdownContent");function Ypc(t){return typeof t.icon=="function"?t.icon():t.icon}a(Ypc,"resolveMarkdownIcon");var B2r=class{static{a(this,"AbstractPendingLoggedRequest")}constructor(e,r,n,o){this._logbook=e,this._debugName=r,this._chatEndpoint=n,this._chatParams=o,this._timeToFirstToken=void 0,this._time=new Date}markTimeToFirstToken(e){this._timeToFirstToken=e}resolveWithCancelation(){this._logbook.addEntry({type:"ChatMLCancelation",debugName:this._debugName,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata})}},F2r=class extends B2r{static{a(this,"PendingLoggedChatRequest")}constructor(e,r,n,o){super(e,r,n,o)}resolve(e,r){e.type===cBi.ChatFetchResponseType.Success?this._logbook.addEntry({type:"ChatMLSuccess",debugName:this._debugName,usage:e.usage,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,timeToFirstToken:this._timeToFirstToken,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata,result:e,deltas:r}):this._logbook.addEntry({type:e.type===cBi.ChatFetchResponseType.Canceled?"ChatMLCancelation":"ChatMLFailure",debugName:this._debugName,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,timeToFirstToken:this._timeToFirstToken,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata,result:e})}};mL.PendingLoggedChatRequest=F2r});var Q2r=I(uye=>{"use strict";p();Object.defineProperty(uye,"__esModule",{value:!0});uye.NullSnippyService=uye.ISnippyService=void 0;var Kpc=nn();uye.ISnippyService=(0,Kpc.createServiceIdentifier)("ISnippyService");var U2r=class{static{a(this,"NullSnippyService")}async handlePostInsertion(){}};uye.NullSnippyService=U2r});var H2r=I(dye=>{"use strict";p();Object.defineProperty(dye,"__esModule",{value:!0});dye.MovedText=dye.LinesDiff=void 0;var q2r=class{static{a(this,"LinesDiff")}constructor(e,r,n){this.changes=e,this.moves=r,this.hitTimeout=n}};dye.LinesDiff=q2r;var j2r=class t{static{a(this,"MovedText")}constructor(e,r){this.lineRangeMapping=e,this.changes=r}flip(){return new t(this.lineRangeMapping.flip(),this.changes.map(e=>e.flip()))}};dye.MovedText=j2r});var G_t=I(sN=>{"use strict";p();Object.defineProperty(sN,"__esModule",{value:!0});sN.RangeMapping=sN.DetailedLineRangeMapping=sN.LineRangeMapping=void 0;sN.lineRangeMappingFromRangeMappings=Zpc;sN.getLineRangeMapping=fBi;sN.lineRangeMappingFromChange=Xpc;var Jpc=Sl(),lBi=rd(),H_t=Rs(),g1=$2(),oN=q_(),gL=eh(),dBi=h5e(),QLe=class t{static{a(this,"LineRangeMapping")}static inverse(e,r,n){let o=[],s=1,c=1;for(let u of e){let d=new t(new g1.LineRange(s,u.original.startLineNumber),new g1.LineRange(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new g1.LineRange(s,r+1),new g1.LineRange(c,n+1));return l.modified.isEmpty||o.push(l),o}static clip(e,r,n){let o=[];for(let s of e){let c=s.original.intersect(r),l=s.modified.intersect(n);c&&!c.isEmpty&&l&&!l.isEmpty&&o.push(new t(c,l))}return o}constructor(e,r){this.original=e,this.modified=r}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new t(this.modified,this.original)}join(e){return new t(this.original.join(e.original),this.modified.join(e.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){let e=this.original.toInclusiveRange(),r=this.modified.toInclusiveRange();if(e&&r)return new Y6(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new H_t.BugIndicatingError("not a valid diff");return new Y6(new gL.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new gL.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new Y6(new gL.Range(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new gL.Range(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(uBi(this.original.endLineNumberExclusive,e)&&uBi(this.modified.endLineNumberExclusive,r))return new Y6(new gL.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new gL.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new Y6(gL.Range.fromPositions(new oN.Position(this.original.startLineNumber,1),fye(new oN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),gL.Range.fromPositions(new oN.Position(this.modified.startLineNumber,1),fye(new oN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new Y6(gL.Range.fromPositions(fye(new oN.Position(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),fye(new oN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),gL.Range.fromPositions(fye(new oN.Position(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),fye(new oN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new H_t.BugIndicatingError}};sN.LineRangeMapping=QLe;function fye(t,e){if(t.lineNumber<1)return new oN.Position(1,1);if(t.lineNumber>e.length)return new oN.Position(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new oN.Position(t.lineNumber,r.length+1):t}a(fye,"normalizePosition");function uBi(t,e){return t>=1&&t<=e.length}a(uBi,"isValidLineNumber");var qLe=class t extends QLe{static{a(this,"DetailedLineRangeMapping")}static toTextEdit(e,r){let n=[];for(let o of e)for(let s of o.innerChanges??[]){let c=s.toTextEdit(r);n.push(c)}return new dBi.TextEdit(n)}static fromRangeMappings(e){let r=g1.LineRange.join(e.map(o=>g1.LineRange.fromRangeInclusive(o.originalRange))),n=g1.LineRange.join(e.map(o=>g1.LineRange.fromRangeInclusive(o.modifiedRange)));return new t(r,n,e)}constructor(e,r,n){super(e,r),this.innerChanges=n}flip(){return new t(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new t(this.original,this.modified,[this.toRangeMapping()])}};sN.DetailedLineRangeMapping=qLe;var Y6=class t{static{a(this,"RangeMapping")}static fromEdit(e){let r=e.getNewRanges();return e.replacements.map((o,s)=>new t(o.range,r[s]))}static fromEditJoin(e){let r=e.getNewRanges(),n=e.replacements.map((o,s)=>new t(o.range,r[s]));return t.join(n)}static join(e){if(e.length===0)throw new H_t.BugIndicatingError("Cannot join an empty list of range mappings");let r=e[0];for(let n=1;n${this.modifiedRange.toString()}}`}flip(){return new t(this.modifiedRange,this.originalRange)}toTextEdit(e){let r=e.getValueOfRange(this.modifiedRange);return new dBi.TextReplacement(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};sN.RangeMapping=Y6;function Zpc(t,e,r,n=!1){let o=[];for(let s of(0,Jpc.groupAdjacentBy)(t.map(c=>fBi(c,e,r)),(c,l)=>c.original.intersectsOrTouches(l.original)||c.modified.intersectsOrTouches(l.modified))){let c=s[0],l=s[s.length-1];o.push(new qLe(c.original.join(l.original),c.modified.join(l.modified),s.map(u=>u.innerChanges[0])))}return(0,lBi.assertFn)(()=>!n&&o.length>0&&(o[0].modified.startLineNumber!==o[0].original.startLineNumber||r.length.lineCount-o[o.length-1].modified.endLineNumberExclusive!==e.length.lineCount-o[o.length-1].original.endLineNumberExclusive)?!1:(0,lBi.checkAdjacentItems)(o,(s,c)=>c.original.startLineNumber-s.original.endLineNumberExclusive===c.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExclusive=r.getLineLength(t.modifiedRange.startLineNumber)&&t.originalRange.startColumn-1>=e.getLineLength(t.originalRange.startLineNumber)&&t.originalRange.startLineNumber<=t.originalRange.endLineNumber+o&&t.modifiedRange.startLineNumber<=t.modifiedRange.endLineNumber+o&&(n=1);let s=new g1.LineRange(t.originalRange.startLineNumber+n,t.originalRange.endLineNumber+1+o),c=new g1.LineRange(t.modifiedRange.startLineNumber+n,t.modifiedRange.endLineNumber+1+o);return new qLe(s,c,[t])}a(fBi,"getLineRangeMapping");function Xpc(t){let e;t.originalEndLineNumber===0?e=new g1.LineRange(t.originalStartLineNumber+1,t.originalStartLineNumber+1):e=new g1.LineRange(t.originalStartLineNumber,t.originalEndLineNumber+1);let r;return t.modifiedEndLineNumber===0?r=new g1.LineRange(t.modifiedStartLineNumber+1,t.modifiedStartLineNumber+1):r=new g1.LineRange(t.modifiedStartLineNumber,t.modifiedEndLineNumber+1),new QLe(e,r)}a(Xpc,"lineRangeMappingFromChange")});var hye=I(HR=>{"use strict";p();Object.defineProperty(HR,"__esModule",{value:!0});HR.DateTimeout=HR.InfiniteTimeout=HR.OffsetPair=HR.SequenceDiff=HR.DiffAlgorithmResult=void 0;var ehc=Sl(),pBi=Rs(),pye=hd(),G2r=class t{static{a(this,"DiffAlgorithmResult")}static trivial(e,r){return new t([new jLe(pye.OffsetRange.ofLength(e.length),pye.OffsetRange.ofLength(r.length))],!1)}static trivialTimedOut(e,r){return new t([new jLe(pye.OffsetRange.ofLength(e.length),pye.OffsetRange.ofLength(r.length))],!0)}constructor(e,r){this.diffs=e,this.hitTimeout=r}};HR.DiffAlgorithmResult=G2r;var jLe=class t{static{a(this,"SequenceDiff")}static invert(e,r){let n=[];return(0,ehc.forEachAdjacent)(e,(o,s)=>{n.push(t.fromOffsetPairs(o?o.getEndExclusives():Pne.zero,s?s.getStarts():new Pne(r,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+r)))}),n}static fromOffsetPairs(e,r){return new t(new pye.OffsetRange(e.offset1,r.offset1),new pye.OffsetRange(e.offset2,r.offset2))}static assertSorted(e){let r;for(let n of e){if(r&&!(r.seq1Range.endExclusive<=n.seq1Range.start&&r.seq2Range.endExclusive<=n.seq2Range.start))throw new pBi.BugIndicatingError("Sequence diffs must be sorted");r=n}}constructor(e,r){this.seq1Range=e,this.seq2Range=r}swap(){return new t(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new t(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new t(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new t(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new t(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersectsOrTouches(e){return this.seq1Range.intersectsOrTouches(e.seq1Range)||this.seq2Range.intersectsOrTouches(e.seq2Range)}intersect(e){let r=this.seq1Range.intersect(e.seq1Range),n=this.seq2Range.intersect(e.seq2Range);if(!(!r||!n))return new t(r,n)}getStarts(){return new Pne(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Pne(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}};HR.SequenceDiff=jLe;var Pne=class t{static{a(this,"OffsetPair")}static{this.zero=new t(0,0)}static{this.max=new t(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)}constructor(e,r){this.offset1=e,this.offset2=r}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new t(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}};HR.OffsetPair=Pne;var $2r=class t{static{a(this,"InfiniteTimeout")}static{this.instance=new t}isValid(){return!0}};HR.InfiniteTimeout=$2r;var V2r=class{static{a(this,"DateTimeout")}constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new pBi.BugIndicatingError("timeout must be positive")}isValid(){return!(Date.now()-this.startTime!0,this.valid=!0}};HR.DateTimeout=V2r});var $_t=I(Dne=>{"use strict";p();Object.defineProperty(Dne,"__esModule",{value:!0});Dne.LineRangeFragment=Dne.Array2D=void 0;Dne.isSpace=thc;var W2r=class{static{a(this,"Array2D")}constructor(e,r){this.width=e,this.height=r,this.array=[],this.array=new Array(e*r)}get(e,r){return this.array[e+r*this.width]}set(e,r,n){this.array[e+r*this.width]=n}};Dne.Array2D=W2r;function thc(t){return t===32||t===9}a(thc,"isSpace");var z2r=class t{static{a(this,"LineRangeFragment")}static{this.chrKeys=new Map}static getKey(e){let r=this.chrKeys.get(e);return r===void 0&&(r=this.chrKeys.size,this.chrKeys.set(e,r)),r}constructor(e,r,n){this.range=e,this.lines=r,this.source=n,this.histogram=[];let o=0;for(let s=e.startLineNumber-1;s{"use strict";p();Object.defineProperty(V_t,"__esModule",{value:!0});V_t.DynamicProgrammingDiffing=void 0;var hBi=hd(),HLe=hye(),Y2r=$_t(),K2r=class{static{a(this,"DynamicProgrammingDiffing")}compute(e,r,n=HLe.InfiniteTimeout.instance,o){if(e.length===0||r.length===0)return HLe.DiffAlgorithmResult.trivial(e,r);let s=new Y2r.Array2D(e.length,r.length),c=new Y2r.Array2D(e.length,r.length),l=new Y2r.Array2D(e.length,r.length);for(let A=0;A0&&y>0&&c.get(A-1,y-1)===3&&(v+=l.get(A-1,y-1)),v+=o?o(A,y):1):v=-1;let b=Math.max(E,_,v);if(b===v){let T=A>0&&y>0?l.get(A-1,y-1):0;l.set(A,y,T+1),c.set(A,y,3)}else b===E?(l.set(A,y,0),c.set(A,y,1)):b===_&&(l.set(A,y,0),c.set(A,y,2));s.set(A,y,b)}let u=[],d=e.length,f=r.length;function h(A,y){(A+1!==d||y+1!==f)&&u.push(new HLe.SequenceDiff(new hBi.OffsetRange(A+1,d),new hBi.OffsetRange(y+1,f))),d=A,f=y}a(h,"reportDecreasingAligningPositions");let m=e.length-1,g=r.length-1;for(;m>=0&&g>=0;)c.get(m,g)===3?(h(m,g),m--,g--):c.get(m,g)===1?m--:g--;return h(-1,-1),u.reverse(),new HLe.DiffAlgorithmResult(u,!1)}};V_t.DynamicProgrammingDiffing=K2r});var eDr=I(z_t=>{"use strict";p();Object.defineProperty(z_t,"__esModule",{value:!0});z_t.MyersDiffAlgorithm=void 0;var gBi=hd(),GLe=hye(),J2r=class{static{a(this,"MyersDiffAlgorithm")}compute(e,r,n=GLe.InfiniteTimeout.instance){if(e.length===0||r.length===0)return GLe.DiffAlgorithmResult.trivial(e,r);let o=e,s=r;function c(y,E){for(;yo.length||w>s.length)continue;let R=c(T,w);u.set(f,R);let x=T===v?d.get(f+1):d.get(f-1);if(d.set(f,R!==T?new W_t(x,T,w,R-T):x),u.get(f)===o.length&&u.get(f)-f===s.length)break e}}let h=d.get(f),m=[],g=o.length,A=s.length;for(;;){let y=h?h.x+h.length:0,E=h?h.y+h.length:0;if((y!==g||E!==A)&&m.push(new GLe.SequenceDiff(new gBi.OffsetRange(y,g),new gBi.OffsetRange(E,A))),!h)break;g=h.x,A=h.y,h=h.prev}return m.reverse(),new GLe.DiffAlgorithmResult(m,!1)}};z_t.MyersDiffAlgorithm=J2r;var W_t=class{static{a(this,"SnakePath")}constructor(e,r,n,o){this.prev=e,this.x=r,this.y=n,this.length=o}},Z2r=class{static{a(this,"FastInt32Array")}constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,r){if(e<0){if(e=-e-1,e>=this.negativeArr.length){let n=this.negativeArr;this.negativeArr=new Int32Array(n.length*2),this.negativeArr.set(n)}this.negativeArr[e]=r}else{if(e>=this.positiveArr.length){let n=this.positiveArr;this.positiveArr=new Int32Array(n.length*2),this.positiveArr.set(n)}this.positiveArr[e]=r}}},X2r=class{static{a(this,"FastArrayNegativeIndices")}constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,r){e<0?(e=-e-1,this.negativeArr[e]=r):this.positiveArr[e]=r}}});var nDr=I(K_t=>{"use strict";p();Object.defineProperty(K_t,"__esModule",{value:!0});K_t.LinesSliceCharSequence=void 0;var tDr=xq(),Y_t=hd(),rhc=q_(),ABi=eh(),nhc=$_t(),rDr=class{static{a(this,"LinesSliceCharSequence")}constructor(e,r,n){this.lines=e,this.range=r,this.considerWhitespaceChanges=n,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let o=this.range.startLineNumber;o<=this.range.endLineNumber;o++){let s=e[o-1],c=0;o===this.range.startLineNumber&&this.range.startColumn>1&&(c=this.range.startColumn-1,s=s.substring(c)),this.lineStartOffsets.push(c);let l=0;if(!n){let d=s.trimStart();l=s.length-d.length,s=d.trimEnd()}this.trimmedWsLengthsByLineIdx.push(l);let u=o===this.range.endLineNumber?Math.min(this.range.endColumn-1-c-l,s.length):s.length;for(let d=0;dString.fromCharCode(r)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){let r=_Bi(e>0?this.elements[e-1]:-1),n=_Bi(es<=e),o=e-this.firstElementOffsetByLineIdx[n];return new rhc.Position(this.range.startLineNumber+n,1+this.lineStartOffsets[n]+o+(o===0&&r==="left"?0:this.trimmedWsLengthsByLineIdx[n]))}translateRange(e){let r=this.translateOffset(e.start,"right"),n=this.translateOffset(e.endExclusive,"left");return n.isBefore(r)?ABi.Range.fromPositions(n,n):ABi.Range.fromPositions(r,n)}findWordContaining(e){if(e<0||e>=this.elements.length||!mye(this.elements[e]))return;let r=e;for(;r>0&&mye(this.elements[r-1]);)r--;let n=e;for(;n=this.elements.length||!mye(this.elements[e]))return;let r=e;for(;r>0&&mye(this.elements[r-1])&&!yBi(this.elements[r]);)r--;let n=e;for(;no<=e.start)??0,n=(0,tDr.findFirstMonotonous)(this.firstElementOffsetByLineIdx,o=>e.endExclusive<=o)??this.elements.length;return new Y_t.OffsetRange(r,n)}};K_t.LinesSliceCharSequence=rDr;function mye(t){return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57}a(mye,"isWordChar");function yBi(t){return t>=65&&t<=90}a(yBi,"isUpperCase");var ihc={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function EBi(t){return ihc[t]}a(EBi,"getCategoryBoundaryScore");function _Bi(t){return t===10?8:t===13?7:(0,nhc.isSpace)(t)?6:t>=97&&t<=122?0:t>=65&&t<=90?1:t>=48&&t<=57?2:t===-1?3:t===44||t===59?5:4}a(_Bi,"getCategory")});var SBi=I(iDr=>{"use strict";p();Object.defineProperty(iDr,"__esModule",{value:!0});iDr.computeMovedLines=chc;var ohc=hye(),J_t=G_t(),AL=Sl(),$Le=xq(),shc=zP(),A1=$2(),vBi=nDr(),Z_t=$_t(),ahc=eDr(),CBi=eh();function chc(t,e,r,n,o,s){let{moves:c,excludedChanges:l}=uhc(t,e,r,s);if(!s.isValid())return[];let u=t.filter(f=>!l.has(f)),d=dhc(u,n,o,e,r,s);return(0,AL.pushMany)(c,d),c=fhc(c),c=c.filter(f=>{let h=f.original.toOffsetRange().slice(e).map(g=>g.trim());return h.join(` -`).length>=15&&lhc(h,g=>g.length>=2)>=2}),c=phc(t,c),c}a(chc,"computeMovedLines");function lhc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(lhc,"countWhere");function uhc(t,e,r,n){let o=[],s=t.filter(u=>u.modified.isEmpty&&u.original.length>=3).map(u=>new Z_t.LineRangeFragment(u.original,e,u)),c=new Set(t.filter(u=>u.original.isEmpty&&u.modified.length>=3).map(u=>new Z_t.LineRangeFragment(u.modified,r,u))),l=new Set;for(let u of s){let d=-1,f;for(let h of c){let m=u.computeSimilarity(h);m>d&&(d=m,f=h)}if(d>.9&&f&&(c.delete(f),o.push(new J_t.LineRangeMapping(u.range,f.range)),l.add(u.source),l.add(f.source)),!n.isValid())return{moves:o,excludedChanges:l}}return{moves:o,excludedChanges:l}}a(uhc,"computeMovesFromSimpleDeletionsToSimpleInsertions");function dhc(t,e,r,n,o,s){let c=[],l=new shc.SetMap;for(let m of t)for(let g=m.original.startLineNumber;gm.modified.startLineNumber,AL.numberComparator));for(let m of t){let g=[];for(let A=m.modified.startLineNumber;A{for(let T of g)if(T.originalLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive&&T.modifiedLineRange.endLineNumberExclusive+1===E.endLineNumberExclusive){T.originalLineRange=new A1.LineRange(T.originalLineRange.startLineNumber,v.endLineNumberExclusive),T.modifiedLineRange=new A1.LineRange(T.modifiedLineRange.startLineNumber,E.endLineNumberExclusive),_.push(T);return}let b={modifiedLineRange:E,originalLineRange:v};u.push(b),_.push(b)}),g=_}if(!s.isValid())return[]}u.sort((0,AL.reverseOrder)((0,AL.compareBy)(m=>m.modifiedLineRange.length,AL.numberComparator)));let d=new A1.LineRangeSet,f=new A1.LineRangeSet;for(let m of u){let g=m.modifiedLineRange.startLineNumber-m.originalLineRange.startLineNumber,A=d.subtractFrom(m.modifiedLineRange),y=f.subtractFrom(m.originalLineRange).getWithDelta(g),E=A.getIntersection(y);for(let _ of E.ranges){if(_.length<3)continue;let v=_,b=_.delta(-g);c.push(new J_t.LineRangeMapping(b,v)),d.addRange(v),f.addRange(b)}}c.sort((0,AL.compareBy)(m=>m.original.startLineNumber,AL.numberComparator));let h=new $Le.MonotonousArray(t);for(let m=0;mR.original.startLineNumber<=g.original.startLineNumber),y=(0,$Le.findLastMonotonous)(t,R=>R.modified.startLineNumber<=g.modified.startLineNumber),E=Math.max(g.original.startLineNumber-A.original.startLineNumber,g.modified.startLineNumber-y.modified.startLineNumber),_=h.findLastMonotonous(R=>R.original.startLineNumberR.modified.startLineNumbern.length||x>o.length||d.contains(x)||f.contains(R)||!bBi(n[R-1],o[x-1],s))break}T>0&&(f.addRange(new A1.LineRange(g.original.startLineNumber-T,g.original.startLineNumber)),d.addRange(new A1.LineRange(g.modified.startLineNumber-T,g.modified.startLineNumber)));let w;for(w=0;wn.length||x>o.length||d.contains(x)||f.contains(R)||!bBi(n[R-1],o[x-1],s))break}w>0&&(f.addRange(new A1.LineRange(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+w)),d.addRange(new A1.LineRange(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+w))),(T>0||w>0)&&(c[m]=new J_t.LineRangeMapping(new A1.LineRange(g.original.startLineNumber-T,g.original.endLineNumberExclusive+w),new A1.LineRange(g.modified.startLineNumber-T,g.modified.endLineNumberExclusive+w)))}return c}a(dhc,"computeUnchangedMoves");function bBi(t,e,r){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;let o=new ahc.MyersDiffAlgorithm().compute(new vBi.LinesSliceCharSequence([t],new CBi.Range(1,1,1,t.length),!1),new vBi.LinesSliceCharSequence([e],new CBi.Range(1,1,1,e.length),!1),r),s=0,c=ohc.SequenceDiff.invert(o.diffs,t.length);for(let f of c)f.seq1Range.forEach(h=>{(0,Z_t.isSpace)(t.charCodeAt(h))||s++});function l(f){let h=0;for(let m=0;me.length?t:e);return s/u>.6&&u>10}a(bBi,"areLinesSimilar");function fhc(t){if(t.length===0)return t;t.sort((0,AL.compareBy)(r=>r.original.startLineNumber,AL.numberComparator));let e=[t[0]];for(let r=1;r=0&&c>=0&&s+c<=2){e[e.length-1]=n.join(o);continue}e.push(o)}return e}a(fhc,"joinCloseConsecutiveMoves");function phc(t,e){let r=new $Le.MonotonousArray(t);return e=e.filter(n=>{let o=r.findLastMonotonous(l=>l.original.startLineNumberl.modified.startLineNumber{"use strict";p();Object.defineProperty(Nne,"__esModule",{value:!0});Nne.optimizeSequenceDiffs=mhc;Nne.removeShortMatches=Ahc;Nne.extendDiffsToEntireWordIfAppropriate=yhc;Nne.removeVeryShortMatchingLinesBetweenDiffs=_hc;Nne.removeVeryShortMatchingTextBetweenLongDiffs=vhc;var hhc=Sl(),yL=hd(),EL=hye();function mhc(t,e,r){let n=r;return n=TBi(t,e,n),n=TBi(t,e,n),n=ghc(t,e,n),n}a(mhc,"optimizeSequenceDiffs");function TBi(t,e,r){if(r.length===0)return r;let n=[];n.push(r[0]);for(let s=1;s0&&(l=l.delta(d))}o.push(l)}return n.length>0&&o.push(n[n.length-1]),o}a(TBi,"joinSequenceDiffsByShifting");function ghc(t,e,r){if(!t.getBoundaryScore||!e.getBoundaryScore)return r;for(let n=0;n0?r[n-1]:void 0,s=r[n],c=n+1=n.start&&t.seq2Range.start-c>=o.start&&r.isStronglyEqual(t.seq2Range.start-c,t.seq2Range.endExclusive-c)&&c<100;)c++;c--;let l=0;for(;t.seq1Range.start+ld&&(d=A,u=f)}return t.delta(u)}a(IBi,"shiftDiffToBetterPosition");function Ahc(t,e,r){let n=[];for(let o of r){let s=n[n.length-1];if(!s){n.push(o);continue}o.seq1Range.start-s.seq1Range.endExclusive<=2||o.seq2Range.start-s.seq2Range.endExclusive<=2?n[n.length-1]=new EL.SequenceDiff(s.seq1Range.join(o.seq1Range),s.seq2Range.join(o.seq2Range)):n.push(o)}return n}a(Ahc,"removeShortMatches");function yhc(t,e,r,n,o=!1){let s=EL.SequenceDiff.invert(r,t.length),c=[],l=new EL.OffsetPair(0,0);function u(f,h){if(f.offset10;){let v=s[0];if(!(v.seq1Range.intersects(A.seq1Range)||v.seq2Range.intersects(A.seq2Range)))break;let T=n(t,v.seq1Range.start),w=n(e,v.seq2Range.start),R=new EL.SequenceDiff(T,w),x=R.intersect(v);if(E+=x.seq1Range.length,_+=x.seq2Range.length,A=A.join(R),A.seq1Range.endExclusive>=v.seq1Range.endExclusive)s.shift();else break}(o&&E+_0;){let f=s.shift();f.seq1Range.isEmpty||(u(f.getStarts(),f),u(f.getEndExclusives().delta(-1),f))}return Ehc(r,c)}a(yhc,"extendDiffsToEntireWordIfAppropriate");function Ehc(t,e){let r=[];for(;t.length>0||e.length>0;){let n=t[0],o=e[0],s;n&&(!o||n.seq1Range.start0&&r[r.length-1].seq1Range.endExclusive>=s.seq1Range.start?r[r.length-1]=r[r.length-1].join(s):r.push(s)}return r}a(Ehc,"mergeSequenceDiffs");function _hc(t,e,r){let n=r;if(n.length===0)return n;let o=0,s;do{s=!1;let c=[n[0]];for(let l=1;l5||g.seq1Range.length+g.seq2Range.length>5)};a(f,"shouldJoinDiffs");let u=n[l],d=c[c.length-1];f(d,u)?(s=!0,c[c.length-1]=c[c.length-1].join(u)):c.push(u)}n=c}while(o++<10&&s);return n}a(_hc,"removeVeryShortMatchingLinesBetweenDiffs");function vhc(t,e,r){let n=r;if(n.length===0)return n;let o=0,s;do{s=!1;let l=[n[0]];for(let u=1;u5||y.length>500)return!1;let _=t.getText(y).trim();if(_.length>20||_.split(/\r\n|\r|\n/).length>1)return!1;let v=t.countLinesIn(g.seq1Range),b=g.seq1Range.length,T=e.countLinesIn(g.seq2Range),w=g.seq2Range.length,R=t.countLinesIn(A.seq1Range),x=A.seq1Range.length,P=e.countLinesIn(A.seq2Range),D=A.seq2Range.length,N=130;function L(B){return Math.min(B,N)}return a(L,"cap"),Math.pow(Math.pow(L(v*40+b),1.5)+Math.pow(L(T*40+w),1.5),1.5)+Math.pow(Math.pow(L(R*40+x),1.5)+Math.pow(L(P*40+D),1.5),1.5)>(N**1.5)**1.5*1.3};a(h,"shouldJoinDiffs");let d=n[u],f=l[l.length-1];h(f,d)?(s=!0,l[l.length-1]=l[l.length-1].join(d)):l.push(d)}n=l}while(o++<10&&s);let c=[];return(0,hhc.forEachWithNeighbors)(n,(l,u,d)=>{let f=u;function h(_){return _.length>0&&_.trim().length<=3&&u.seq1Range.length+u.seq2Range.length>100}a(h,"shouldMarkAsChanged");let m=t.extendToFullLines(u.seq1Range),g=t.getText(new yL.OffsetRange(m.start,u.seq1Range.start));h(g)&&(f=f.deltaStart(-g.length));let A=t.getText(new yL.OffsetRange(u.seq1Range.endExclusive,m.endExclusive));h(A)&&(f=f.deltaEnd(A.length));let y=EL.SequenceDiff.fromOffsetPairs(l?l.getEndExclusives():EL.OffsetPair.zero,d?d.getStarts():EL.OffsetPair.max),E=f.intersect(y);c.length>0&&E.getStarts().equals(c[c.length-1].getEndExclusives())?c[c.length-1]=c[c.length-1].join(E):c.push(E)}),c}a(vhc,"removeVeryShortMatchingTextBetweenLongDiffs")});var RBi=I(X_t=>{"use strict";p();Object.defineProperty(X_t,"__esModule",{value:!0});X_t.LineSequence=void 0;var oDr=class{static{a(this,"LineSequence")}constructor(e,r){this.trimmedHash=e,this.lines=r}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){let r=e===0?0:wBi(this.lines[e-1]),n=e===this.lines.length?0:wBi(this.lines[e]);return 1e3-(r+n)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` -`)}isStronglyEqual(e,r){return this.lines[e]===this.lines[r]}};X_t.LineSequence=oDr;function wBi(t){let e=0;for(;e{"use strict";p();Object.defineProperty(nvt,"__esModule",{value:!0});nvt.DefaultLinesDiffComputer=void 0;var Chc=Sl(),kBi=rd(),rvt=$2(),PBi=hd(),DBi=eh(),evt=qT(),tvt=H2r(),One=G_t(),_L=hye(),bhc=mBi(),Shc=eDr(),Thc=SBi(),Mne=xBi(),NBi=RBi(),MBi=nDr(),sDr=class{static{a(this,"DefaultLinesDiffComputer")}constructor(){this.dynamicProgrammingDiffing=new bhc.DynamicProgrammingDiffing,this.myersDiffingAlgorithm=new Shc.MyersDiffAlgorithm}computeDiff(e,r,n){if(e.length<=1&&(0,Chc.equals)(e,r,(x,P)=>x===P))return new tvt.LinesDiff([],[],!1);if(e.length===1&&e[0].length===0||r.length===1&&r[0].length===0)return new tvt.LinesDiff([new One.DetailedLineRangeMapping(new rvt.LineRange(1,e.length+1),new rvt.LineRange(1,r.length+1),[new One.RangeMapping(new DBi.Range(1,1,e.length,e[e.length-1].length+1),new DBi.Range(1,1,r.length,r[r.length-1].length+1))])],[],!1);let o=n.maxComputationTimeMs===0?_L.InfiniteTimeout.instance:new _L.DateTimeout(n.maxComputationTimeMs),s=!n.ignoreTrimWhitespace,c=new Map;function l(x){let P=c.get(x);return P===void 0&&(P=c.size,c.set(x,P)),P}a(l,"getOrCreateHash");let u=e.map(x=>l(x.trim())),d=r.map(x=>l(x.trim())),f=new NBi.LineSequence(u,e),h=new NBi.LineSequence(d,r),m=f.length+h.length<1700?this.dynamicProgrammingDiffing.compute(f,h,o,(x,P)=>e[x]===r[P]?r[P].length===0?.1:1+Math.log(1+r[P].length):.99):this.myersDiffingAlgorithm.compute(f,h,o),g=m.diffs,A=m.hitTimeout;g=(0,Mne.optimizeSequenceDiffs)(f,h,g),g=(0,Mne.removeVeryShortMatchingLinesBetweenDiffs)(f,h,g);let y=[],E=a(x=>{if(s)for(let P=0;Px.seq1Range.start-_===x.seq2Range.start-v);let P=x.seq1Range.start-_;E(P),_=x.seq1Range.endExclusive,v=x.seq2Range.endExclusive;let D=this.refineDiff(e,r,x,o,s,n);D.hitTimeout&&(A=!0);for(let N of D.mappings)y.push(N)}E(e.length-_);let b=new evt.ArrayText(e),T=new evt.ArrayText(r),w=(0,One.lineRangeMappingFromRangeMappings)(y,b,T),R=[];return n.computeMoves&&(R=this.computeMoves(w,e,r,u,d,o,s,n)),(0,kBi.assertFn)(()=>{function x(D,N){if(D.lineNumber<1||D.lineNumber>N.length)return!1;let L=N[D.lineNumber-1];return!(D.column<1||D.column>L.length+1)}a(x,"validatePosition");function P(D,N){return!(D.startLineNumber<1||D.startLineNumber>N.length+1||D.endLineNumberExclusive<1||D.endLineNumberExclusive>N.length+1)}a(P,"validateRange");for(let D of w){if(!D.innerChanges)return!1;for(let N of D.innerChanges)if(!(x(N.modifiedRange.getStartPosition(),r)&&x(N.modifiedRange.getEndPosition(),r)&&x(N.originalRange.getStartPosition(),e)&&x(N.originalRange.getEndPosition(),e)))return!1;if(!P(D.modified,r)||!P(D.original,e))return!1}return!0}),new tvt.LinesDiff(w,R,A)}computeMoves(e,r,n,o,s,c,l,u){return(0,Thc.computeMovedLines)(e,r,n,o,s,c).map(h=>{let m=this.refineDiff(r,n,new _L.SequenceDiff(h.original.toOffsetRange(),h.modified.toOffsetRange()),c,l,u),g=(0,One.lineRangeMappingFromRangeMappings)(m.mappings,new evt.ArrayText(r),new evt.ArrayText(n),!0);return new tvt.MovedText(h,g)})}refineDiff(e,r,n,o,s,c){let u=Ihc(n).toRangeMapping2(e,r),d=new MBi.LinesSliceCharSequence(e,u.originalRange,s),f=new MBi.LinesSliceCharSequence(r,u.modifiedRange,s),h=d.length+f.length<500?this.dynamicProgrammingDiffing.compute(d,f,o):this.myersDiffingAlgorithm.compute(d,f,o),m=!1,g=h.diffs;m&&_L.SequenceDiff.assertSorted(g),g=(0,Mne.optimizeSequenceDiffs)(d,f,g),m&&_L.SequenceDiff.assertSorted(g),g=(0,Mne.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findWordContaining(E)),m&&_L.SequenceDiff.assertSorted(g),c.extendToSubwords&&(g=(0,Mne.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findSubWordContaining(E),!0),m&&_L.SequenceDiff.assertSorted(g)),g=(0,Mne.removeShortMatches)(d,f,g),m&&_L.SequenceDiff.assertSorted(g),g=(0,Mne.removeVeryShortMatchingTextBetweenLongDiffs)(d,f,g),m&&_L.SequenceDiff.assertSorted(g);let A=g.map(y=>new One.RangeMapping(d.translateRange(y.seq1Range),f.translateRange(y.seq2Range)));return m&&One.RangeMapping.assertSorted(A),{mappings:A,hitTimeout:h.hitTimeout}}};nvt.DefaultLinesDiffComputer=sDr;function Ihc(t){return new One.LineRangeMapping(new rvt.LineRange(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new rvt.LineRange(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}a(Ihc,"toLineRangeMapping")});var cDr=I(Fv=>{"use strict";p();Object.defineProperty(Fv,"__esModule",{value:!0});Fv.EditDataWithIndex=Fv.maxImperfectAgreementLength=Fv.maxAgreementOffset=void 0;Fv.tryRebase=Phc;Fv.checkEditConsistency=LBi;Fv.tryRebaseStringEdits=Nhc;var xhc=iN(),whc=X_(),zE=kE(),gye=hd(),OBi=qT(),Rhc=aDr(),khc=!1;Fv.maxAgreementOffset=10;Fv.maxImperfectAgreementLength=5;var ivt=class{static{a(this,"EditDataWithIndex")}constructor(e){this.index=e}join(e){if(this.index===e.index)return this}};Fv.EditDataWithIndex=ivt;function Phc(t,e,r,n,o,s,c,l,u,d={maxImperfectAgreementLength:Fv.maxImperfectAgreementLength}){let f=Date.now();try{return Dhc(t,e,r,n,o,s,c,l,u,d)}catch(h){return u.trace(`Rebase error: ${whc.ErrorUtils.toString(h)}`),"error"}finally{u.trace(`Rebase duration: ${Date.now()-f}ms`)}}a(Phc,"tryRebase");function Dhc(t,e,r,n,o,s,c,l,u,d){if(!LBi(t,o,s,u,!0))return"inconsistentEdits";let f=o.removeCommonSuffixAndPrefix(t),h=c[0];if(e&&h&&!f.applyToOffsetRangeOrUndefined(e)?.containsRange(h))return"outsideEditWindow";if(n.lengthzE.AnnotatedStringEdit.create(E))),g=BBi(t,m,f,l,d);if(!g)return"rebaseFailed";let A=g.replacements.reduce((E,_)=>((E[_.data.index]||=[]).push(_),E),[]),y=[];for(let E=0;ER>0?s.substring(x[R-1].replaceRange.endExclusive,w.replaceRange.start)+w.newText:w.newText).join(""),T=zE.StringReplacement.replace(v,b);T.removeCommonSuffixAndPrefix(s).isEmpty||y.push({rebasedEdit:T,rebasedEditIndex:E})}return l==="strict"&&y.length>0&&new xhc.SingleEdits(r).apply(t)!==zE.StringEdit.create(y.map(E=>E.rebasedEdit)).apply(s)?(u.trace("Result consistency check failed"),"inconsistentEdits"):y}a(Dhc,"_tryRebase");function LBi(t,e,r,n,o=khc){if(!o)return!0;let s=e.apply(t)===r;return s||n.trace("Edit consistency check failed"),s}a(LBi,"checkEditConsistency");function Nhc(t,e,r,n,o={maxImperfectAgreementLength:Fv.maxImperfectAgreementLength}){return BBi(t,e.mapData(s=>new zE.VoidEditData),r,n,o)?.toStringEdit()}a(Nhc,"tryRebaseStringEdits");function BBi(t,e,r,n,o){let s=r.removeCommonSuffixAndPrefix(t),c=[],l=0,u=0,d=0;for(;uf.replaceRange.start){let g=t.substring(f.replaceRange.start,m.replaceRange.start),A=g+m.newText;A.endsWith(g)&&(m=new zE.AnnotatedStringReplacement(gye.OffsetRange.fromTo(f.replaceRange.start,m.replaceRange.endExclusive-g.length),A.substring(0,A.length-g.length),m.data))}else if(u===e.replacements.length-1&&m.replaceRange.endExclusive=f.newText.length){let g=0,A=0,y=f,E;for(;y&&m.replaceRange.containsRange(y.replaceRange);){if(A=Bhc(t,m,y,E,A,n,o),A===-1)return;g+=y.newText.length-y.replaceRange.length,E=y,y=s.replacements[++l]}c.push(new zE.AnnotatedStringReplacement(new gye.OffsetRange(m.replaceRange.start+d,m.replaceRange.endExclusive+d+g),m.newText,m.data)),u++,d+=g}else if(o.reverseAgreement&&h.replaceRange.equals(f.replaceRange)){let g=0,A;for(;uFv.maxAgreementOffset||b-g>0&&v.length>o.maxImperfectAgreementLength);if(b!==-1&&!T){g=b+v.length,A=y,u++;continue}let w=f.newText.substring(g);if(w.length>0&&v.startsWith(w)){let R=Math.max(0,w.length-_.length),x=y.newText.substring(R);x.length>0&&c.push(new zE.AnnotatedStringReplacement(gye.OffsetRange.emptyAt(f.replaceRange.start+d+f.newText.length),x,y.data)),g=f.newText.length,A=y,u++;break}return}if(g0&&!f.newText.substring(g).startsWith(E))return}l++,d+=f.newText.length-f.replaceRange.length}else return;else if(h.replaceRange.start",'""',"''","``"]);function Lhc(t){return Ohc.has(t)}a(Lhc,"isAutoClosePair");function Bhc(t,e,r,n,o,s,c){let l=r.newText,u=n?n.replaceRange.endExclusive:e.replaceRange.start;uFv.maxAgreementOffset||d>0&&r.newText.length>c.maxImperfectAgreementLength);return d!==-1&&!f?d+r.newText.length:c.absorbSubsequenceTyping&&Lhc(l)&&Mhc(l,e.newText.substring(o))?o:-1}a(Bhc,"agreementIndexOf");function Fhc(t,e,r,n,o){let s=t.split(/\r\n|\r|\n/),c=e.split(/\r\n|\r|\n/),u=new Rhc.DefaultLinesDiffComputer().computeDiff(s,c,o);if(u.hitTimeout)return;let d=new OBi.StringText(t),f=new OBi.StringText(e);return u.changes.map(h=>(h.innerChanges||[]).map(m=>{let g=d.getTransformer().getOffsetRange(m.originalRange),A=f.getValueOfRange(m.modifiedRange);return new zE.AnnotatedStringReplacement(g.delta(r),A,n)})).flat()}a(Fhc,"computeDiff")});var UBi=I(ovt=>{"use strict";p();Object.defineProperty(ovt,"__esModule",{value:!0});ovt.RejectionCollector=void 0;var Uhc=h4(),FBi=Ro(),Qhc=W2(),lDr=class extends FBi.Disposable{static{a(this,"RejectionCollector")}constructor(e,r){super(),this.workspace=e,this._garbageCollector=this._register(new fDr(20)),this._documentCaches=new Map,this._logger=r.createSubLogger(["NES","RejectionCollector"]),(0,Qhc.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=new uDr(n,this._garbageCollector,this._logger);this._documentCaches.set(s.doc.id,s),o.add((0,Uhc.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},c=>{for(let l of c.value.changes)s.handleEdit(l,c.value.value)})),o.add((0,FBi.toDisposable)(()=>{this._documentCaches.delete(n.id)}))}).recomputeInitiallyAndOnChange(this._store)}reject(e,r){let n=this._documentCaches.get(e);if(!n){this._logger.trace(`Rejecting, no document cache: ${r}`);return}let o=r.removeCommonSuffixAndPrefix(n.doc.value.get().value);this._logger.trace(`Rejecting: ${o}`),n.reject(o)}isRejected(e,r){let n=this._documentCaches.get(e);if(!n)return this._logger.trace(`Checking rejection, no document cache: ${r}`),!1;let o=r.removeCommonSuffixAndPrefix(n.doc.value.get().value),s=n.isRejected(o);return this._logger.trace(`Checking rejection, ${s?"rejected":"not rejected"}: ${o}`),s}clear(){this._garbageCollector.clear()}};ovt.RejectionCollector=lDr;var uDr=class{static{a(this,"DocumentRejectionTracker")}constructor(e,r,n){this.doc=e,this._garbageCollector=r,this._logger=n,this._rejectedEdits=new Set}handleEdit(e,r){for(let n of[...this._rejectedEdits])n.handleEdit(e,r)}reject(e){if(this.isRejected(e))return;let r=new dDr(e.toEdit(),()=>{this._logger.trace(`Evicting: ${e}`),this._rejectedEdits.delete(r)});this._rejectedEdits.add(r),this._garbageCollector.put(r)}isRejected(e){for(let r of this._rejectedEdits)if(r.isRejected(e))return!0;return!1}},dDr=class{static{a(this,"RejectedEdit")}constructor(e,r){this._edit=e,this._onDispose=r}handleEdit(e,r){let n=this._edit.tryRebase(e);n?this._edit=n.removeCommonSuffixAndPrefix(r.value):this.dispose()}isRejected(e){return this._edit.equals(e.toEdit())}dispose(){this._onDispose()}},fDr=class{static{a(this,"LRUGarbageCollector")}constructor(e){this._maxSize=e,this._disposables=[]}put(e){this._disposables.push(e),this._disposables.length>this._maxSize&&this._disposables.shift().dispose()}clear(){for(let e of this._disposables)e.dispose();this._disposables=[]}dispose(){this.clear()}}});var hDr=I(Aye=>{"use strict";p();Object.defineProperty(Aye,"__esModule",{value:!0});Aye.DisposablesLRUCache=Aye.LRUCache=void 0;var VLe=class{static{a(this,"Node")}constructor(e,r){this.prev=null,this.next=null,this.key=e,this.value=r}},svt=class{static{a(this,"LRUCache")}constructor(e=10){if(e<1)throw new Error("Cache size must be at least 1");this._capacity=e,this._cache=new Map,this._head=new VLe("",null),this._tail=new VLe("",null),this._head.next=this._tail,this._tail.prev=this._head}_addNode(e){e.prev=this._head,e.next=this._head.next,this._head.next.prev=e,this._head.next=e}_removeNode(e){let r=e.prev,n=e.next;r.next=n,n.prev=r}_moveToHead(e){this._removeNode(e),this._addNode(e)}_popTail(){let e=this._tail.prev;return this._removeNode(e),e}clear(){this._cache.clear(),this._head.next=this._tail,this._tail.prev=this._head}deleteKey(e){let r=this._cache.get(e);if(r)return this._removeNode(r),this._cache.delete(e),r.value}get(e){let r=this._cache.get(e);if(r)return this._moveToHead(r),r.value}keys(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push(r.key),r=r.next;return e}getValues(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push(r.value),r=r.next;return e}put(e,r){let n=this._cache.get(e);if(n)n.value=r,this._moveToHead(n);else if(n=new VLe(e,r),this._cache.set(e,n),this._addNode(n),this._cache.size>this._capacity){let o=this._popTail();return this._cache.delete(o.key),[o.key,o.value]}}entries(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push([r.key,r.value]),r=r.next;return e}};Aye.LRUCache=svt;var pDr=class{static{a(this,"DisposablesLRUCache")}constructor(e){this.actual=new svt(e)}dispose(){this.clear()}clear(){let e=this.actual.getValues();for(let r of e)r.dispose();this.actual.clear()}deleteKey(e){let r=this.actual.deleteKey(e);r&&r.dispose()}get(e){return this.actual.get(e)}keys(){return this.actual.keys()}getValues(){return this.actual.getValues()}put(e,r){let n=this.actual.put(e,r);n&&n[1].dispose()}};Aye.DisposablesLRUCache=pDr});var QBi=I(cvt=>{"use strict";p();Object.defineProperty(cvt,"__esModule",{value:!0});cvt.RebaseFailureInfo=void 0;var qhc=kE(),mDr=class{static{a(this,"RebaseFailureInfo")}constructor(e,r,n,o,s,c,l){this.originalDocument=e,this.editWindow=r,this.originalEdits=n,this.userEditSince=o,this.currentDocument=s,this.currentSelection=c,this.nesRebaseConfigs=l}toMarkdown(){let e=[];e.push("### Original Document"),e.push("```"),e.push(this.originalDocument),e.push("```"),e.push(""),e.push("### Suggested Edits");for(let r=0;r0&&(e.push(""),e.push(`### Cursor: ${this.currentSelection.map(r=>r.toString()).join(", ")}`)),e.push(""),e.push("### Document Intended After Suggested Edits"),e.push("```");try{let r=new qhc.StringEdit(this.originalEdits.slice()).apply(this.originalDocument);e.push(r)}catch{e.push("")}return e.push("```"),e.push(""),e.push("### Copy-Pasteable Test"),e.push("```typescript"),e.push(this._generateTest()),e.push("```"),e.join(` -`)}_generateTest(){let e=[];e.push("test('rebase failure (auto-generated)', () => {"),e.push(` const originalDocument = ${avt(this.originalDocument)};`),e.push(" const originalEdits = [");for(let o of this.originalEdits)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${avt(o.newText)}),`);e.push(" ];"),e.push(" const userEditSince = StringEdit.create([");for(let o of this.userEditSince.replacements)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${avt(o.newText)}),`);e.push(" ]);"),e.push(` const currentDocumentContent = ${avt(this.currentDocument)};`),this.editWindow?e.push(` const editWindow = new OffsetRange(${this.editWindow.start}, ${this.editWindow.endExclusive});`):e.push(" const editWindow = undefined;"),e.push(` const currentSelection = [${this.currentSelection.map(o=>`new OffsetRange(${o.start}, ${o.endExclusive})`).join(", ")}];`);let r=[];return this.nesRebaseConfigs.absorbSubsequenceTyping&&r.push(`absorbSubsequenceTyping: ${this.nesRebaseConfigs.absorbSubsequenceTyping}`),this.nesRebaseConfigs.reverseAgreement&&r.push(`reverseAgreement: ${this.nesRebaseConfigs.reverseAgreement}`),r.push(`maxImperfectAgreementLength: ${this.nesRebaseConfigs.maxImperfectAgreementLength}`),e.push(` const nesConfigs = { ${r.join(", ")} };`),e.push(""),e.push(" const logger = new TestLogService();"),e.push(" expect(userEditSince.apply(originalDocument)).toBe(currentDocumentContent);"),e.push(" expect(tryRebase(originalDocument, editWindow, originalEdits, [], userEditSince, currentDocumentContent, currentSelection, 'strict', logger, nesConfigs)).toMatchInlineSnapshot();"),e.push("});"),e.join(` -`)}};cvt.RebaseFailureInfo=mDr;function avt(t){return"`"+t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")+"`"}a(avt,"toBacktickLiteral")});var jBi=I(uvt=>{"use strict";p();Object.defineProperty(uvt,"__esModule",{value:!0});uvt.NextEditCache=void 0;var WLe=Pl(),jhc=h4(),Hhc=hDr(),qBi=Ro(),Ghc=C8(),lvt=cDr(),$hc=QBi(),gDr=class extends qBi.Disposable{static{a(this,"NextEditCache")}constructor(e,r,n,o){super(),this.workspace=e,this._logService=r,this._configService=n,this._expService=o,this._documentCaches=new Map,this._sharedCache=new Hhc.LRUCache(50),(0,Ghc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{let l=new ADr(this,s.id,s,this._sharedCache,this._logService);this._documentCaches.set(l.docId,l),c.add((0,jhc.autorunWithChanges)(this,{value:s.value},u=>{for(let d of u.value.changes)d.isEmpty()||l.handleEdit(d);if(this._configService.getExperimentBasedConfig(WLe.ConfigKey.Advanced.InlineEditsTriggerOnEditorChangeAfterSeconds,this._expService)!==void 0)for(let[d,f]of this._sharedCache.entries())f.docId!==s.id&&this._sharedCache.deleteKey(d)})),c.add((0,qBi.toDisposable)(()=>{this._documentCaches.delete(s.id)}))}).recomputeInitiallyAndOnChange(this._store)}setKthNextEdit(e,r,n,o,s,c,l,u,d){let f=this._documentCaches.get(e);if(f)return f.setKthNextEdit(r,n,o,c,l,s,u,d)}setNoNextEdit(e,r,n,o){let s=this._documentCaches.get(e);s&&s.setNoNextEdit(r,n,o)}_getNesRebaseConfigs(){let e=this._configService.getExperimentBasedConfig(WLe.ConfigKey.TeamInternal.InlineEditsMaxImperfectAgreementLength,this._expService);return{absorbSubsequenceTyping:this._configService.getExperimentBasedConfig(WLe.ConfigKey.TeamInternal.InlineEditsAbsorbSubsequenceTyping,this._expService),reverseAgreement:this._configService.getExperimentBasedConfig(WLe.ConfigKey.TeamInternal.InlineEditsReverseAgreement,this._expService),maxImperfectAgreementLength:typeof e=="number"?Math.max(0,e):e}}lookupNextEdit(e,r,n){let o=this._documentCaches.get(e);if(!o)return;let s=this._configService.getExperimentBasedConfig(WLe.ConfigKey.TeamInternal.InlineEditsCacheCursorDistanceCheck,this._expService)??!1;return o.lookupNextEdit(r,n,this._getNesRebaseConfigs(),s)}tryRebaseCacheEntry(e,r,n){let o=this._documentCaches.get(e.docId);return o?o.tryRebaseCacheEntry(e,r,n,this._getNesRebaseConfigs()):{edit:void 0}}rejectedNextEdit(e){this._sharedCache.getValues().filter(r=>r.source.headerRequestId===e).forEach(r=>r.rejected=!0)}isRejectedNextEdit(e,r,n){let o=this._documentCaches.get(e);return o?o.isRejectedNextEdit(r,n):!1}evictedCachedEdit(e){let r=this._documentCaches.get(e.docId);r&&r.evictedCachedEdit(e)}clear(){this._documentCaches.forEach(e=>e.clear()),this._sharedCache.clear()}};uvt.NextEditCache=gDr;var ADr=class{static{a(this,"DocumentEditCache")}constructor(e,r,n,o,s){this._nextEditCache=e,this.docId=r,this._doc=n,this._sharedCache=o,this._trackedCachedEdits=[],this._logger=s.createSubLogger(["NES","DocumentEditCache"])}handleEdit(e){let r=this._logger.createSubLogger("handleEdit");for(let n of this._trackedCachedEdits)n.userEditSince&&(n.userEditSince=n.userEditSince.compose(e),n.rebaseFailed=!1,(0,lvt.checkEditConsistency)(n.documentBeforeEdit.value,n.userEditSince,this._doc.value.get().value,r)||(n.userEditSince=void 0))}evictedCachedEdit(e){let r=this._trackedCachedEdits.indexOf(e);r!==-1&&this._trackedCachedEdits.splice(r,1)}clear(){this._trackedCachedEdits.length=0}setKthNextEdit(e,r,n,o,s,c,l,u){let d=this._getKey(e.value),f={docId:this.docId,edit:n,edits:o,detailedEdits:[],userEditSince:s,subsequentN:c,source:l,documentBeforeEdit:e,editWindow:r,originalEditWindow:u.originalEditWindow,cacheTime:Date.now(),isFromCursorJump:u.isFromCursorJump,cursorOffsetAtCacheTime:u.cursorOffset};s&&((0,lvt.checkEditConsistency)(f.documentBeforeEdit.value,s,this._doc.value.get().value,this._logger.createSubLogger("setKthNextEdit"))?this._trackedCachedEdits.unshift(f):f.userEditSince=void 0);let h=this._sharedCache.get(d);h&&this.evictedCachedEdit(h);let m=this._sharedCache.put(d,f);return m&&this._nextEditCache.evictedCachedEdit(m[1]),f}setNoNextEdit(e,r,n){let o=this._getKey(e.value),s={docId:this.docId,edit:void 0,edits:[],detailedEdits:[],source:n,documentBeforeEdit:e,editWindow:r,cacheTime:Date.now(),isFromCursorJump:!1},c=this._sharedCache.get(o);c&&this.evictedCachedEdit(c);let l=this._sharedCache.put(o,s);l&&this._nextEditCache.evictedCachedEdit(l[1])}lookupNextEdit(e,r,n,o=!1){let s=this._getKey(e.value),c=this._sharedCache.get(s);if(c){let l=c.editWindow,u=c.originalEditWindow,d=r[0],f=l?.containsRange(d),h=u?.containsRange(d);if(l&&!f&&!h)return;if(o&&c.edit&&(c.subsequentN===void 0||c.subsequentN===0)&&c.cursorOffsetAtCacheTime!==void 0&&d){let m=e.getTransformer(),g=m.getPosition(c.edit.replaceRange.start).lineNumber,A=m.getPosition(c.cursorOffsetAtCacheTime).lineNumber,y=m.getPosition(d.start).lineNumber;if(Math.abs(y-g)>Math.abs(A-g))return c.rejected=!0,c}return c}for(let l of this._trackedCachedEdits){let u=this.tryRebaseCacheEntry(l,e,r,n);if(u.edit)return u.edit}}tryRebaseCacheEntry(e,r,n,o){let s=this._logger.createSubLogger("tryRebaseCacheEntry");if(e.userEditSince&&!e.rebaseFailed){let c=e.edits||(e.edit?[e.edit]:[]),l=e.originalEditWindow?[e.editWindow,e.originalEditWindow]:[e.editWindow];for(let u of l){let d=(0,lvt.tryRebase)(e.documentBeforeEdit.value,u,c,e.detailedEdits,e.userEditSince,r.value,n,"strict",s,o);if(d==="rebaseFailed")return e.rebaseFailed=!0,{edit:void 0,failureInfo:new $hc.RebaseFailureInfo(e.documentBeforeEdit.value,u,c,e.userEditSince,r.value,n,o)};if(d==="inconsistentEdits"||d==="error")return e.userEditSince=void 0,{edit:void 0};if(d==="outsideEditWindow")continue;if(d.length)return!e.rejected&&this.isRejectedNextEdit(r,d[0].rebasedEdit)&&(e.rejected=!0),{edit:{...e,...d[0],baseCacheEntry:e}};if(!c.length)return{edit:e}}}return{edit:void 0}}isRejectedNextEdit(e,r){let n=this._logger.createSubLogger("isRejectedNextEdit"),o=r.removeCommonSuffixAndPrefix(e.value);for(let s of this._trackedCachedEdits.filter(c=>c.rejected)){if(!s.userEditSince)continue;let c=s.edits||(s.edit?[s.edit]:[]);if(!c.length)continue;let l=(0,lvt.tryRebase)(s.documentBeforeEdit.value,void 0,c,s.detailedEdits,s.userEditSince,e.value,[],"lenient",n);if(typeof l=="string")continue;if(l.some(d=>d.rebasedEdit.removeCommonSuffixAndPrefix(e.value).equals(o)))return n.trace("Found rejected edit that matches current edit"),!0}return!1}_getKey(e){return JSON.stringify([this.docId.uri,e])}}});var HBi=I(dvt=>{"use strict";p();Object.defineProperty(dvt,"__esModule",{value:!0});dvt.NextEditResult=void 0;var yDr=class{static{a(this,"NextEditResult")}constructor(e,r,n){this.requestId=e,this.source=r,this.result=n}};dvt.NextEditResult=yDr});var GBi=I(fvt=>{"use strict";p();Object.defineProperty(fvt,"__esModule",{value:!0});fvt.SpeculativeRequestManager=void 0;var Vhc=Ro(),EDr=class extends Vhc.Disposable{static{a(this,"SpeculativeRequestManager")}constructor(e){super(),this._logger=e,this._pending=null,this._scheduled=null}get pending(){return this._pending}setPending(e){this._pending&&this._pending.request!==e.request&&this._cancelPending("replaced"),this._pending=e}consumePending(){this._pending=null}schedule(e){this._scheduled=e}clearScheduled(){this._scheduled=null}consumeScheduled(e){if(this._scheduled?.headerRequestId!==e)return null;let r=this._scheduled;return this._scheduled=null,r}cancelAll(e){this._scheduled=null,this._cancelPending(e)}cancelIfMismatch(e,r,n){this._pending&&(this._pending.docId!==e||this._pending.postEditContent!==r)&&this._cancelPending(n)}onDocumentClosed(e){this._scheduled?.suggestion.result?.targetDocumentId===e&&(this._scheduled=null),this._pending?.docId===e&&this._cancelPending("documentClosed")}onActiveDocumentChanged(e,r){let n=this._pending;if(!n||n.docId!==e)return;if(r.length{"use strict";p();var Whc=cI&&cI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},zLe=cI&&cI.__param||function(t,e){return function(r,n){e(r,n,t)}},_Dr;Object.defineProperty(cI,"__esModule",{value:!0});cI.NextEditFetchRequest=cI.NextEditProvider=cI.NesOutcome=void 0;var zhc=require("path"),y1=Pl(),yye=iN(),JLe=L_t(),YLe=py(),Yhc=Zft(),wp=nye(),Khc=h4(),vDr=Sp(),Jhc=rBi(),Zhc=lye(),Xhc=Q2r(),emc=mh(),KLe=X_(),YE=uw(),$Bi=rd(),pvt=nl(),tmc=WJe(),SDr=Rs(),hvt=Ro(),VBi=W2(),WBi=FO(),rmc=KS(),ZBi=T0(),zBi=NG(),Lne=kE(),nmc=q_(),CDr=hd(),YBi=qT(),imc=cDr(),omc=UBi(),smc=jBi(),mvt=HBi(),amc=GBi();function cmc(t,e,r){if(!e)return t;let n=e.endExclusive,o=r.getTransformer(),s=o.getPosition(n),c=o.getOffset(s.with(void 0,1)),l=o.getOffset(s.with(void 0,o.getLineLength(s.lineNumber)+1)),u=o.getOffset(o.getPosition(t.start).delta(1)),d=o.getPosition(t.endExclusive).delta(-2),f=o.getOffset(d.column>1?d.with(void 0,o.getLineLength(d.lineNumber)+1):d);return new CDr.OffsetRange(Math.min(u,c),Math.max(f,l))}a(cmc,"computeReducedWindow");function KBi(t,e){let n=new JLe.RootedLineEdit(e,t).toEdit();return e.value.includes(`\r -`)?new Lne.StringEdit(n.replacements.map(o=>new Lne.StringReplacement(o.replaceRange,o.newText.replace(/\n/g,`\r -`)))):n}a(KBi,"convertLineEditToEdit");function JBi(t,e){return new tmc.CachedFunction(n=>{let o=t.find(s=>s.nextEditDoc.id===n);if(!o){for(let s=e.length-1;s>=0;s--){let c=e[s];if(c.docId===n&&c.kind==="edit"){let l=c.edit.getEditedState();return{baseDocState:l,docContents:l,editsSoFar:Lne.StringEdit.empty,nextEdits:[],docId:n}}}throw new SDr.BugIndicatingError}return{baseDocState:o.documentAfterEdits,docContents:o.documentAfterEdits,editsSoFar:Lne.StringEdit.empty,nextEdits:[],docId:n}})}a(JBi,"createDocStateLookupMap");var ZLe;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(ZLe||(cI.NesOutcome=ZLe={}));var bDr=_Dr=class extends hvt.Disposable{static{a(this,"NextEditProvider")}get lastRejectionTime(){return this._lastRejectionTime}get lastTriggerTime(){return this._lastTriggerTime}get lastOutcome(){return this._lastOutcome}constructor(e,r,n,o,s,c,l,u,d,f){super(),this._workspace=e,this._statelessNextEditProvider=r,this._historyContextProvider=n,this._xtabHistoryTracker=o,this._debugRecorder=s,this._configService=c,this._snippyService=l,this._logService=u,this._expService=d,this._requestLogger=f,this.ID=this._statelessNextEditProvider.ID,this._rejectionCollector=this._register(new omc.RejectionCollector(this._workspace,this._logService)),this._pendingStatelessNextEditRequest=null,this._lastShownTime=0,this._lastShownSuggestionId=void 0,this._lastRejectionTime=0,this._lastTriggerTime=0,this._shouldExpandEditWindow=!1,this._logger=this._logService.createSubLogger(["NES","NextEditProvider"]),this._nextEditCache=new smc.NextEditCache(this._workspace,this._logService,this._configService,this._expService),this._specManager=this._register(new amc.SpeculativeRequestManager(this._logger.createSubLogger("SpeculativeRequestManager"))),(0,VBi.mapObservableArrayCached)(this,this._workspace.openDocuments,(h,m)=>{m.add((0,VBi.runOnChange)(h.value,g=>{this._cancelPendingRequestDueToDocChange(h.id,g)})),m.add((0,hvt.toDisposable)(()=>this._specManager.onDocumentClosed(h.id)))}).recomputeInitiallyAndOnChange(this._store)}_cancelPendingRequestDueToDocChange(e,r){if(this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsAsyncCompletions,this._expService)||this._pendingStatelessNextEditRequest===null)return;let o=this._pendingStatelessNextEditRequest.getActiveDocument();o.id===e&&o.documentAfterEdits.value!==r.value&&this._pendingStatelessNextEditRequest.cancellationTokenSource.cancel()}async getNextEdit(e,r,n,o,s){let c=Date.now();this._lastTriggerTime=c;let l=new WBi.StopWatch,u=this._logger.createSubLogger(r.requestUuid.substring(4,8)).withExtraTarget(vDr.LogTarget.fromCallback((h,m)=>{n.trace(`[${Math.floor(l.elapsed()).toString().padStart(4," ")}ms] ${m}`)})),d=this._shouldExpandEditWindow;n.setStatelessNextEditProviderId(this._statelessNextEditProvider.ID);let f;try{f=await this._getNextEditCanThrow(e,r,c,d,u,n,o,s)}catch(h){throw n.setError(h),s.setNextEditProviderError(KLe.ErrorUtils.toString(h)),h}finally{s.markEndTime()}return this._lastNextEditResult=f,f}async _getNextEditCanThrow(e,r,n,o,s,c,l,u){let d=s.createSubLogger("_getNextEdit");d.trace(`invoked with trigger id = ${r.changeHint===void 0?"undefined":`uuid = ${r.changeHint.data.uuid}, reason = ${r.changeHint.data.reason}`}`);let f=this._workspace.getDocument(e);if(!f)throw d.trace(`Document "${e.baseName}" not found`),new SDr.BugIndicatingError(`Document "${e.baseName}" not found`);let h=f.value.get(),m=f.selection.get(),g=this.determineNesConfigs(u,c),A=this._nextEditCache.lookupNextEdit(e,h,m);if(A?.rejected){d.trace("cached edit was previously rejected"),u.setStatus("previouslyRejectedCache"),u.setWasPreviouslyRejected(),c.markAsPreviouslyRejected();let L=A.rebasedEdit??A.edit;return L&&this._rejectionCollector.reject(e,L),new mvt.NextEditResult(c.requestId,A.source,void 0)}let y,E,_,v,b=e,T=!1,w=!1,R=!1,x;if(A){d.trace("using cached edit");let L=A.rebasedEdit||A.edit;L&&(y={actualEdit:L,isFromCursorJump:A.isFromCursorJump}),T=!!A.rebasedEdit,w=A.subsequentN!==void 0&&A.subsequentN>0,R=A.source.isSpeculative,v=A.source,c.setIsCachedResult(A.source.log),E=h,u.setHeaderRequestId(v.headerRequestId),u.setIsFromCache(),u.setSubsequentEditOrder(A.rebasedEditIndex??A.subsequentN),c.recordingBookmark=v.log.recordingBookmark,x=A.baseCacheEntry??A}else{d.trace(`fetching next edit with shouldExpandEditWindow=${o}`);let L=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsDebounceUseCoreRequestTime,this._expService)?r.requestIssuedDateTime??void 0:void 0;v=new XLe(r.requestUuid,c,L,!1),u.setHeaderRequestId(v.headerRequestId);let B=f.value.get();d.trace("awaiting firstEdit promise");let q=await this.fetchNextEdit(v,f,g,o,d,u,l);d.trace("resolved firstEdit promise");let M=`First edit latency: ${Date.now()-this._lastTriggerTime} ms`;if(c.addLog(M),d.trace(M),q.isError())d.trace(`failed to fetch next edit ${q.err.toString()}`),u.setStatus(`noEdit:${q.err.kind}`),_=q.err;else if(b=q.val.docId??b,E=(b?this._workspace.getDocument(b):f).value.get(),b===f.id&&B.value!==E.value)d.trace("document changed while fetching next edit"),u.setStatus("docChanged"),c.setIsSkipped();else{let Q=q.val.rebasedEdit||q.val.edit;Q?(d.trace("fetch succeeded"),c.setResponseResults([Q]),y={actualEdit:Q,isFromCursorJump:q.val.isFromCursorJump},R=q.val.isFromSpeculativeRequest??!1,x=q.val.baseCacheEntry??q.val):(d.trace("empty edits"),u.setStatus("emptyEdits"))}}if(_ instanceof wp.NoNextEditReason.FetchFailure||_ instanceof wp.NoNextEditReason.Unexpected)throw d.trace(`has throwing error: ${_.error}`),_.error;if(_ instanceof wp.NoNextEditReason.NoSuggestions)if(_.nextCursorPosition===void 0)c.markAsNoSuggestions();else return u.setStatus("emptyEditsButHasNextCursorPosition"),new mvt.NextEditResult(c.requestId,v,{jumpToPosition:_.nextCursorPosition,targetDocumentId:_.nextCursorDocumentId,documentBeforeEdits:h,isFromCursorJump:!1,isSubsequentEdit:!1});else _ instanceof wp.NoNextEditReason.GotCancelled&&c.setIsSkipped();let P=new mvt.NextEditResult(c.requestId,v,void 0);if(!y)return d.trace("had no edit"),P;if(l.isCancellationRequested)return d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),P;if(this._rejectionCollector.isRejected(b,y.actualEdit)||E&&this._nextEditCache.isRejectedNextEdit(b,E,y.actualEdit))return d.trace("edit was previously rejected"),u.setStatus("previouslyRejected"),u.setWasPreviouslyRejected(),c.markAsPreviouslyRejected(),P;c.setResult(JLe.RootedLineEdit.fromEdit(new yye.RootedEdit(h,new Lne.StringEdit([y.actualEdit])))),(0,$Bi.assert)(E!==void 0,"should be defined if edit is defined"),u.setStatus("notAccepted");let D=new mvt.NextEditResult(c.requestId,v,{edit:y.actualEdit,isFromCursorJump:y.isFromCursorJump,documentBeforeEdits:E,targetDocumentId:b,isSubsequentEdit:w,cacheEntry:x});u.setHasNextEdit(!0);let N=this.computeMinimumResponseDelay({triggerTime:n,isRebasedCachedEdit:T,isSubsequentCachedEdit:w,isFromSpeculativeRequest:R,enforceCacheDelay:r.enforceCacheDelay},d);return N>0&&(await(0,pvt.timeout)(N),l.isCancellationRequested)?(d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),P):(d.trace("returning next edit result"),D)}determineNesConfigs(e,r){let n={isAsyncCompletions:this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsAsyncCompletions,this._expService)};return e.setNESConfigs({...n}),r.addCodeblockToLog(JSON.stringify(n,null," ")),n}_processDoc(e){let r=e.lastEdit.base.getLines(),n=e.lastEdits,o=JLe.RootedLineEdit.fromEdit(new yye.RootedEdit(e.lastEdit.base,e.lastEdits.compose())).removeCommonSuffixPrefixLines().edit,s=e.lastEdit.base,c=e.lastSelection,l=this._workspace.getWorkspaceRoot(e.docId),u=new wp.StatelessNextEditDocument(e.docId,l,e.languageId,r,o,s,n,c);return{recentEdit:e.lastEdit,nextEditDoc:u,documentAfterEdits:u.documentAfterEdits}}async fetchNextEdit(e,r,n,o,s,c,l){let u=r.id,d=s.createSubLogger("fetchNextEdit"),f=this._historyContextProvider.getHistoryContext(u);if(!f)return YE.Result.error(new wp.NoNextEditReason.Unexpected(new Error("DocumentMissingInHistoryContext")));let h=r.value.get(),m=r.selection.get(),g=e.log;g.setRecentEdit(f);let A=m.at(0),y=a(N=>!N.requestEditWindow||!A||N.requestEditWindow.containsCursor(A),"cursorInRequestEditWindow"),E=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value,_=!this._pendingStatelessNextEditRequest||y(this._pendingStatelessNextEditRequest),v=(E||n.isAsyncCompletions)&&_&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0,b=this._specManager.pending,T=b?.docId===u&&b?.postEditContent===h.value&&!b.request.cancellationTokenSource.token.isCancellationRequested&&y(b.request),w=T?b?.request:void 0,R=w??v;if(R){w?(d.trace(`reusing speculative pending request (opportunityId=${w.opportunityId}, headerRequestId=${w.headerRequestId})`),this._specManager.consumePending()):d.trace(`reusing in-flight pending request (opportunityId=${R.opportunityId}, headerRequestId=${R.headerRequestId})`);let N=w?T:E,L=w?"speculative":"async";if(N){let B=await this._joinNextEditRequest(R,L,c,g,l);return c.setStatelessNextEditTelemetry(B.telemetry),w?(await R.firstEdit.p).map(M=>({...M,isFromSpeculativeRequest:!0})):B.nextEdit.isError()?B.nextEdit:R.firstEdit.p}else{let B=await this._joinNextEditRequest(R,L,c,g,l),q=await R.firstEdit.p;if(q.isOk()&&q.val.edit){let j=this._nextEditCache.tryRebaseCacheEntry(q.val,h,m);if(j.edit)return c.setStatelessNextEditTelemetry(B.telemetry),YE.Result.ok(j.edit);this._logRebaseFailure(j.failureInfo,g)}if(l.isCancellationRequested)return d.trace("document changed after rebase failed"),c.setStatelessNextEditTelemetry(B.telemetry),YE.Result.error(new wp.NoNextEditReason.GotCancelled("afterFailedRebase"));let O=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0;if(O){d.trace("reusing 2nd existing next edit request after rebase failed");let j=await this._joinNextEditRequest(O,"async",c,g,l);return c.setStatelessNextEditTelemetry(j.telemetry),j.nextEdit.isError()?j.nextEdit:O.firstEdit.p}d.trace("creating new next edit request after rebase failed")}}let x=await this._executeNewNextEditRequest(e,r,f,n,o,d,c,l),P=x.nextEditRequest,D=x.nextEditResult;return c.setStatelessNextEditTelemetry(D.telemetry),D.nextEdit.isError()?D.nextEdit:P.firstEdit.p}async _joinNextEditRequest(e,r,n,o,s){n.setHeaderRequestId(e.headerRequestId),n.setReusedRequest(r),n.setRequest(e),o.setRequestInput(e),o.setIsReusedInFlightResult(e.logContext);let c=this._hookupCancellation(e,s);try{return await e.result}finally{c.dispose()}}_logRebaseFailure(e,r){e&&r.setRebaseFailure(e)}async _executeNewNextEditRequest(e,r,n,o,s,c,l,u){let d=r.id,f=c.createSubLogger("_executeNewNextEditRequest"),h=e.log;if(this._debugRecorder){let B=this._debugRecorder.createBookmark();h.recordingBookmark=B,l.setRequestBookmark(B)}let m=lmc(n.getDocumentAndIdx(d)),g=r.selection.get()[0],A=this._debugRecorder?.getRecentLog(),y=n.documents.map(B=>this._processDoc(B)),E=this._xtabHistoryTracker.getHistory(),_=new pvt.DeferredPromise,v=s?this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0,b=new wp.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,r.value.get(),y.map(B=>B.nextEditDoc),m.idx,E,_,v,!1,h,h.recordingBookmark,A,e.providerRequestStartDateTime),T;this._pendingStatelessNextEditRequest&&(this._pendingStatelessNextEditRequest.cancellationTokenSource.cancel(),this._pendingStatelessNextEditRequest=null,this._specManager.clearScheduled()),this._specManager.cancelIfMismatch(d,b.documentBeforeEdits.value,"superseded"),this._pendingStatelessNextEditRequest=b;let w=a(()=>{this._pendingStatelessNextEditRequest===b&&(this._pendingStatelessNextEditRequest=null)},"removeFromPending");l.setRequest(b),l.setStatus("requested"),h.setRequestInput(b);let R=this._hookupCancellation(b,u,o.isAsyncCompletions?(0,Khc.autorunWithChanges)(this,{value:r.value},B=>{B.value.changes.forEach(q=>{b.intermediateUserEdit&&!q.isEmpty()&&(b.intermediateUserEdit=b.intermediateUserEdit.compose(q),(0,imc.checkEditConsistency)(b.documentBeforeEdits.value,b.intermediateUserEdit,B.value.value.value,f)||(b.intermediateUserEdit=void 0))})}):void 0),x=JBi(y,E),P=this._statelessNextEditProvider.provideNextEdit(b,f,h,b.cancellationTokenSource.token),D=-1,N=a((B,q)=>{++D;let M=f.createSubLogger("processEdit");M.trace(`processing edit #${D} (starts at 0)`),M.trace("resetting shouldExpandEditWindow to false due to receiving an edit"),this._shouldExpandEditWindow=!1;let O=x.get(B.targetDocument??d),j=B.edit,Q=new zBi.LineEdit([j]),Y=KBi(Q,O.baseDocState).tryRebase(O.editsSoFar);if(Y===void 0){M.trace(`edit ${D} is undefined after rebasing`),_.isSettled||_.complete(YE.Result.error(new wp.NoNextEditReason.Uncategorized(new Error("Rebased edit is undefined"))));return}O.editsSoFar=O.editsSoFar.compose(Y);let W;if(Y.replacements.length===0)M.trace(`WARNING: ${D} has no edits`);else if(Y.replacements.length>1)M.trace(`WARNING: ${D} has ${Y.replacements.length} edits, but expected only 1`);else{let V=Y.replacements[0];O.nextEdits.push(V),W=this._nextEditCache.setKthNextEdit(O.docId,O.docContents,D===0?B.window:void 0,V,D,D===0?O.nextEdits:void 0,D===0?b.intermediateUserEdit:void 0,e,{isFromCursorJump:B.isFromCursorJump,originalEditWindow:B.originalWindow,cursorOffset:O.docId===d?g?.start:void 0}),M.trace(`populated cache for ${D}`)}return _.isSettled||(M.trace("resolving firstEdit promise"),h.setResult(new JLe.RootedLineEdit(O.docContents,Q)),_.complete(W?YE.Result.ok(W):YE.Result.error(new wp.NoNextEditReason.Unexpected(new Error("No cached edit"))))),O.docContents=Y.applyOnText(O.docContents),W},"processEdit"),L=a((B,q)=>{let M=f.createSubLogger("streamEnd");if(D===-1&&B instanceof wp.NoNextEditReason.NoSuggestions&&(M.trace("resetting shouldExpandEditWindow to false due to NoSuggestions"),this._shouldExpandEditWindow=!1),x.get(d).nextEdits.length)M.trace(`${x.get(d).nextEdits.length} edits returned`);else if(M.trace(`no edit, reason: ${B.kind}`),B instanceof wp.NoNextEditReason.NoSuggestions){let{documentBeforeEdits:Y,window:W}=B,V=W?cmc(W,g,Y):void 0;this._nextEditCache.setNoNextEdit(d,Y,V,e)}_.isSettled||_.complete(YE.Result.error(B));let j=x.get(d).nextEdits.length>0?YE.Result.ok(void 0):YE.Result.error(B),Q=new wp.StatelessNextEditResult(j,q);b.setResult(Q),R.dispose(),w();let U=this._specManager.consumeScheduled(b.headerRequestId);return U&&this._triggerSpeculativeRequest(U.suggestion),Q},"handleStreamEnd");try{let B=await P.next();if(B.done){let q=B.value.v;T=L(q,B.value.telemetryBuilder)}else{let q=B.value.v,M=B.value.telemetryBuilder;N(q,M),(async()=>{try{for(B=await P.next();!B.done;){let j=B.value.v;N(j,B.value.telemetryBuilder),this._specManager.consumeScheduled(b.headerRequestId),B=await P.next()}let O=B.value.v;L(O,B.value.telemetryBuilder)}catch(O){f.trace(`Error while streaming further edits: ${KLe.ErrorUtils.toString(O)}`);let j=new wp.NoNextEditReason.Unexpected(KLe.ErrorUtils.fromUnknown(O));L(j,M)}})(),T=new wp.StatelessNextEditResult(YE.Result.ok(void 0),M)}}catch(B){throw b.setResultError(B),B}return{nextEditRequest:b,nextEditResult:T}}_hookupCancellation(e,r,n){let o=new hvt.DisposableStore,s=!1,c=a(()=>{s||(s=!0,e.liveDependentants--)},"removeDependant"),l=o.add(new pvt.TimeoutTimer);return o.add(r.onCancellationRequested(()=>{if(c(),!(e.liveDependentants>0)){if(!e.fetchIssued){e.cancellationTokenSource.cancel(),n?.dispose();return}l.setIfNotSet(()=>{e.liveDependentants>0||(e.cancellationTokenSource.cancel(),n?.dispose())},1e3)}})),o.add((0,hvt.toDisposable)(()=>{c(),e.liveDependentants===0&&n?.dispose()})),e.liveDependentants++,o}computeMinimumResponseDelay({triggerTime:e,isRebasedCachedEdit:r,isSubsequentCachedEdit:n,isFromSpeculativeRequest:o,enforceCacheDelay:s},c){if(!s)return c.trace("[minimumDelay] no minimum delay enforced due to enforceCacheDelay being false"),0;let l=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsCacheDelay,this._expService),u=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsRebasedCacheDelay,this._expService),d=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsSubsequentCacheDelay,this._expService),f=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestDelay,this._expService),h=l;r&&u!==void 0?h=u:n&&d!==void 0?h=d:o&&f!==void 0&&(h=f);let m=Date.now()-e,g=Math.max(0,h-m);return c.trace(`[minimumDelay] expected delay: ${h}ms, effective delay: ${g}. isRebasedCachedEdit: ${r} (rebasedCacheDelay: ${u}), isSubsequentCachedEdit: ${n} (subsequentCacheDelay: ${d}), isFromSpeculativeRequest: ${o} (speculativeRequestDelay: ${f})`),g}handleShown(e){if(this._lastShownTime=Date.now(),this._lastShownSuggestionId=e.requestId,this._lastOutcome=void 0,this._specManager.clearScheduled(),this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequests,this._expService)===YLe.SpeculativeRequestsEnablement.On){let n=this._pendingStatelessNextEditRequest;n&&n.headerRequestId===e.source.headerRequestId?this._specManager.schedule({suggestion:e,headerRequestId:n.headerRequestId}):this._triggerSpeculativeRequest(e)}}async _triggerSpeculativeRequest(e){let r=e.result;if(!r?.edit)return;let n=r.targetDocumentId;if(!n)return;let o=new Yhc.InlineEditRequestLogContext(n.uri,0,void 0),s=new WBi.StopWatch,c=this._logger.createSubLogger("_triggerSpeculativeRequest").withExtraTarget(vDr.LogTarget.fromCallback((T,w)=>{o.trace(`[${Math.floor(s.elapsed()).toString().padStart(4," ")}ms] ${w}`)})),l=r.edit.replace(r.documentBeforeEdits.value),u=r.edit.removeCommonSuffixPrefix(r.documentBeforeEdits.value),d=u.replaceRange.start+u.newText.length,f=new CDr.OffsetRange(d,d),h=[f],m=new yye.RootedEdit(r.documentBeforeEdits,new Lne.StringEdit([r.edit])),g=new YBi.StringText(l),A=this._nextEditCache.lookupNextEdit(n,g,h),y=f;if(A)if(A.edit){c.trace("already have cached edit for post-edit state");return}else if(A.editWindow){c.trace("have cached no-suggestions entry for post-edit state, but it has an edit window. Checking if shifting selection based on cursor placement config can yield a cached edit");let T=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsCursorPlacement,this._expService);if(T===YLe.SpeculativeRequestsCursorPlacement.AfterEditWindow)if(c.trace("cursor placement config is AfterEditWindow, shifting selection to after edit window"),y=_Dr.shiftSelectionAfterEditWindow(g,A.editWindow),A=this._nextEditCache.lookupNextEdit(n,g,[y]),A?.edit){c.trace("already have cached edit for post-edit state (after shifting selection)");return}else c.trace("no cached edit even after shifting selection");else c.trace(`cursor placement config is ${T}, not shifting selection`)}else{c.trace("already have cached no-suggestions entry for post-edit state");return}if(this._pendingStatelessNextEditRequest?.documentBeforeEdits.value===l){c.trace("already have pending request for post-edit state");return}let E=this._specManager.pending;if(E?.docId===n&&E?.postEditContent===l){c.trace("already have speculative request for post-edit state");return}let _=this._workspace.getDocument(n);if(!_){c.trace("document not found for speculative request");return}let v=this._historyContextProvider.getHistoryContext(n);if(!v){c.trace("no history context for speculative request");return}let b=new XLe(`sp-${e.source.opportunityId}`,o,void 0,!0,`sp-${(0,ZBi.generateUuid)()}`);c.trace(`triggering speculative request for post-edit state (opportunityId=${b.opportunityId}, headerRequestId=${b.headerRequestId})`);try{let T=await this._createSpeculativeRequest(b,_,y,v,l,m,r.edit,{triggeredBySpeculativeRequest:e.source.isSpeculative,isSubsequentEdit:e.result?.isSubsequentEdit??!1},c);if(T){let w=r.documentBeforeEdits.value,R=w.slice(0,u.replaceRange.start),x=w.slice(u.replaceRange.endExclusive),P=u.newText;this._specManager.setPending({request:T,docId:n,postEditContent:l,trajectoryPrefix:R,trajectorySuffix:x,trajectoryNewText:P})}}catch(T){c.trace(`speculative request failed: ${KLe.ErrorUtils.toString(T)}`)}}async _createSpeculativeRequest(e,r,n,o,s,c,l,{triggeredBySpeculativeRequest:u,isSubsequentEdit:d},f){let h=r.id,m=this._debugRecorder?.getRecentLog(),g=e.log;g.setStatelessNextEditProviderId(this._statelessNextEditProvider.ID);let A=f.createSubLogger("_createSpeculativeRequest"),y=o.getDocumentAndIdx(h);if(!y){A.trace("active doc not found in history context");return}let E=new YBi.StringText(s),_=o.documents.map(N=>{if(N.docId!==h)return this._processDoc(N);{let L=this._workspace.getWorkspaceRoot(h),B=new Lne.StringEdit([l]),q=JLe.RootedLineEdit.fromEdit(new yye.RootedEdit(r.value.get(),B)).removeCommonSuffixPrefixLines().edit,M=new wp.StatelessNextEditDocument(h,L,N.languageId,r.value.get().getLines(),q,r.value.get(),yye.Edits.single(B),n);return{recentEdit:new yye.RootedEdit(r.value.get(),B),nextEditDoc:M,documentAfterEdits:E}}}),v=this._xtabHistoryTracker.getHistory(),b={kind:"edit",docId:h,edit:c};v.push(b);let T=new pvt.DeferredPromise,w=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines,this._expService),R;switch(w){case YLe.SpeculativeRequestsAutoExpandEditWindowLines.Off:R=void 0;break;case YLe.SpeculativeRequestsAutoExpandEditWindowLines.Always:R=this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService);break;case YLe.SpeculativeRequestsAutoExpandEditWindowLines.Smart:{R=u||d?this._configService.getExperimentBasedConfig(y1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0;break}default:(0,$Bi.assertNever)(w)}let x=new wp.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,E,_.map(N=>N.nextEditDoc),y.idx,v,T,R,!0,g,void 0,m,void 0);g.setRequestInput(x),A.trace("starting speculative provider call");let P=`NES | spec | ${(0,zhc.basename)(r.id.toUri().fsPath)} (v${r.version.get()})`,D=new Jhc.CapturingToken(P,void 0);return this._requestLogger.captureInvocation(D,async()=>{this._addLiveLogContextEntry(g,P);try{await this._runSpeculativeProviderCall(x,_,h,e,n.start,A)}catch(N){g.setError(N)}finally{g.markCompleted()}}),x}async _runSpeculativeProviderCall(e,r,n,o,s,c){let l=c.createSubLogger("_runSpeculativeProviderCall"),u=e.xtabEditHistory,d=JBi(r,u),f=o.log,h=this._statelessNextEditProvider.provideNextEdit(e,l,f,e.cancellationTokenSource.token),m=-1;try{let g=await h.next();g.done?(e.firstEdit.complete(YE.Result.error(g.value.v)),e.setResult(new wp.StatelessNextEditResult(YE.Result.error(g.value.v),g.value.telemetryBuilder)),f.markAsNoSuggestions(),l.trace("speculative request completed with no edits")):(async()=>{for(;!g.done;){++m;let A=g.value.v,y=d.get(A.targetDocument??n),E=A.edit,_=new zBi.LineEdit([E]),b=KBi(_,y.baseDocState).tryRebase(y.editsSoFar);if(b===void 0){l.trace(`speculative edit ${m} rebasing failed`),g=await h.next();continue}if(y.editsSoFar=y.editsSoFar.compose(b),b.replacements.length===1){let T=b.replacements[0];y.nextEdits.push(T);let w=this._nextEditCache.setKthNextEdit(y.docId,y.docContents,m===0?A.window:void 0,T,m,m===0?y.nextEdits:void 0,void 0,o,{isFromCursorJump:A.isFromCursorJump,originalEditWindow:A.originalWindow,cursorOffset:y.docId===n?s:void 0});!e.firstEdit.isSettled&&w&&(e.firstEdit.complete(YE.Result.ok(w)),e.setResult(new wp.StatelessNextEditResult(YE.Result.ok(void 0),g.value.telemetryBuilder)),f.setResponseResults([T])),l.trace(`cached speculative edit ${m}`)}y.docContents=b.applyOnText(y.docContents),g=await h.next()}})().finally(()=>{e.firstEdit.isSettled||(e.firstEdit.complete(YE.Result.error(new wp.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits")))),e.setResult(new wp.StatelessNextEditResult(YE.Result.error(new wp.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits"))),g.value.telemetryBuilder)),f.markAsNoSuggestions())}),l.trace(`speculative request completed with ${m+1} edits`)}catch(g){l.trace(`speculative provider call error: ${KLe.ErrorUtils.toString(g)}`)}}static shiftSelectionAfterEditWindow(e,r){let n=e.getTransformer(),o=n.getPosition(r.endExclusive-1),s=o.lineNumber+11e3&&r.result.edit&&(this._rejectionCollector.reject(e,r.result.edit),this._nextEditCache.rejectedNextEdit(r.source.headerRequestId)),this._lastRejectionTime=Date.now(),this._lastOutcome=ZLe.Rejected,this._statelessNextEditProvider.handleRejection?.()}handleIgnored(e,r,n){this._lastOutcome=ZLe.Ignored,this._lastShownSuggestionId===r.requestId&&!(n!==void 0)&&(this._specManager.cancelAll("ignoredDismissed"),this._statelessNextEditProvider.handleIgnored?.())}async runSnippy(e,r){r.result===void 0||r.result.edit===void 0||this._snippyService.handlePostInsertion(e.toUri(),r.result.documentBeforeEdits,r.result.edit)}_addLiveLogContextEntry(e,r){this._requestLogger.addEntry({type:"MarkdownContentRequest",debugName:r??e.getDebugName(),icon:a(()=>e.getIcon(),"icon"),startTimeMs:e.time,markdownContent:a(()=>e.toLogDocument(),"markdownContent"),onDidChange:e.onDidChange,isVisible:a(()=>e.includeInLogTree,"isVisible")})}clearCache(){this._nextEditCache.clear(),this._rejectionCollector.clear(),this._specManager.cancelAll("cacheCleared")}};cI.NextEditProvider=bDr;cI.NextEditProvider=bDr=_Dr=Whc([zLe(5,y1.IConfigurationService),zLe(6,Xhc.ISnippyService),zLe(7,vDr.ILogService),zLe(8,emc.IExperimentationService),zLe(9,Zhc.IRequestLogger)],bDr);function lmc(t){if(!t)throw new SDr.BugIndicatingError("expected value to be defined, but it was not");return t}a(lmc,"assertDefined");var XLe=class{static{a(this,"NextEditFetchRequest")}constructor(e,r,n,o,s=(0,ZBi.generateUuid)()){this.opportunityId=e,this.log=r,this.providerRequestStartDateTime=n,this.isSpeculative=o,this.headerRequestId=s}};cI.NextEditFetchRequest=XLe});var e3i=I(eBe=>{"use strict";p();Object.defineProperty(eBe,"__esModule",{value:!0});eBe.parseGitRemotes=umc;eBe.toGitUri=dmc;eBe.getUpstreamRemote=fmc;var TDr=class t{static{a(this,"GitConfigParser")}static{this._lineSeparator=/\r?\n/}static{this._propertyRegex=/^\s*(\w+)\s*=\s*"?([^"]+)"?$/}static{this._sectionRegex=/^\s*\[\s*([^\]]+?)\s*(\"[^"]+\")*\]\s*$/}static parse(e){let r={sections:[]},n={name:"DEFAULT",properties:{}},o=a(s=>{s&&r.sections.push(s)},"addSection");for(let s of e.split(t._lineSeparator)){let c=s.match(t._sectionRegex);if(c?.length===3){o(n),n={name:c[1],subSectionName:c[2]?.replaceAll('"',""),properties:{}};continue}let l=s.match(t._propertyRegex);l?.length===3&&!Object.keys(n.properties).includes(l[1])&&(n.properties[l[1]]=l[2])}return o(n),r.sections}};function umc(t){let e=[];for(let r of TDr.parse(t).filter(n=>n.name==="remote"))r.subSectionName&&e.push({name:r.subSectionName,fetchUrl:r.properties.url,pushUrl:r.properties.pushurl??r.properties.url,isReadOnly:!1});return e}a(umc,"parseGitRemotes");function dmc(t,e,r={}){let n={path:t.fsPath,ref:e};r.submoduleOf&&(n.submoduleOf=r.submoduleOf);let o=t.path;return r.replaceFileExtension?o=`${o}.git`:r.submoduleOf&&(o=`${o}.diff`),t.with({scheme:r.scheme??"git",path:o,query:JSON.stringify(n)})}a(dmc,"toGitUri");function fmc(t){let e=t.state.HEAD?.upstream?.remote;if(e)return t.state.remotes.find(r=>r.name===e)}a(fmc,"getUpstreamRemote")});var l3i=I(_h=>{"use strict";p();Object.defineProperty(_h,"__esModule",{value:!0});_h.GLOB_SPLIT=_h.GLOBSTAR=void 0;_h.getEmptyExpression=Amc;_h.splitGlobAware=wDr;_h.isEmptyPattern=Tmc;_h.match=kmc;_h.parse=s3i;_h.isRelativePattern=a3i;_h.getBasenameTerms=Pmc;_h.getPathTerms=Dmc;_h.patternsEquals=Omc;var pmc=Sl(),xDr=nl(),hmc=tHt(),mmc=zP(),$$=NA(),gmc=Rq(),tBe=em();function Amc(){return Object.create(null)}a(Amc,"getEmptyExpression");_h.GLOBSTAR="**";_h.GLOB_SPLIT="/";var gvt="[/\\\\]",Avt="[^/\\\\]",ymc=/\//g;function t3i(t,e){switch(t){case 0:return"";case 1:return`${Avt}*?`;default:return`(?:${gvt}|${Avt}+${gvt}${e?`|${gvt}${Avt}+`:""})*?`}}a(t3i,"starsToRegExp");function wDr(t,e){if(!t)return[];let r=[],n=!1,o=!1,s="";for(let c of t){switch(c){case e:if(!n&&!o){r.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}s+=c}return s&&r.push(s),r}a(wDr,"splitGlobAware");function o3i(t){if(!t)return"";let e="",r=wDr(t,_h.GLOB_SPLIT);if(r.every(n=>n===_h.GLOBSTAR))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===_h.GLOBSTAR){if(n)return;e+=t3i(2,s===r.length-1)}else{let c=!1,l="",u=!1,d="";for(let f of o){if(f!=="}"&&c){l+=f;continue}if(u&&(f!=="]"||!d)){let h;f==="-"?h=f:(f==="^"||f==="!")&&!d?h="^":f===_h.GLOB_SPLIT?h="":h=(0,tBe.escapeRegExpCharacters)(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${wDr(l,",").map(g=>o3i(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=Avt;continue;case"*":e+=t3i(1);continue;default:e+=(0,tBe.escapeRegExpCharacters)(f)}}su===d,endsWith:n?tBe.endsWithIgnoreCase:(u,d)=>u.endsWith(d),isEqualOrParent:a((u,d)=>(0,hmc.isEqualOrParent)(u,d,e.ignoreCase??!gmc.isLinux),"isEqualOrParent")},s=`${n?r.toLowerCase():r}_${!!e.trimForExclusions}_${n}`,c=r3i.get(s);if(c)return n3i(c,t,o);let l;return Emc.test(r)?c=Imc(r.substring(4),r,o):(l=_mc.exec(IDr(r,o)))?c=xmc(l[1],r,o):(e.trimForExclusions?Cmc:vmc).test(r)?c=wmc(r,o):(l=bmc.exec(IDr(r,o)))?c=i3i(l[1].substring(1),r,!0,o):(l=Smc.exec(IDr(r,o)))?c=i3i(l[1],r,!1,o):c=Rmc(r,o),r3i.set(s,c),n3i(c,t,o)}a(kDr,"parsePattern");function n3i(t,e,r){if(typeof e=="string")return t;let n=a(function(o,s){return r.isEqualOrParent(o,e.base)?t((0,tBe.ltrim)(o.substring(e.base.length),$$.sep),s):null},"wrappedPattern");return n.allBasenames=t.allBasenames,n.allPaths=t.allPaths,n.basenames=t.basenames,n.patterns=t.patterns,n}a(n3i,"wrapRelativePattern");function IDr(t,e){return e.trimForExclusions&&t.endsWith("/**")?t.substring(0,t.length-2):t}a(IDr,"trimForExclusions");function Imc(t,e,r){return function(n,o){return typeof n=="string"&&r.endsWith(n,t)?e:null}}a(Imc,"trivia1");function xmc(t,e,r){let n=`/${t}`,o=`\\${t}`,s=a(function(l,u){return typeof l!="string"?null:u?r.equals(u,t)?e:null:r.equals(l,t)||r.endsWith(l,n)||r.endsWith(l,o)?e:null},"parsedPattern"),c=[t];return s.basenames=c,s.patterns=[e],s.allBasenames=c,s}a(xmc,"trivia2");function wmc(t,e){let r=c3i(t.slice(1,-1).split(",").map(l=>kDr(l,e)).filter(l=>l!==aN),t),n=r.length;if(!n)return aN;if(n===1)return r[0];let o=a(function(l,u){for(let d=0,f=r.length;d!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(wmc,"trivia3");function i3i(t,e,r,n){let o=$$.sep===$$.posix.sep,s=o?t:t.replace(ymc,$$.sep),c=$$.sep+s,l=$$.posix.sep+t,u;return r?u=a(function(d,f){return typeof d=="string"&&(n.equals(d,s)||n.endsWith(d,c)||!o&&(n.equals(d,t)||n.endsWith(d,l)))?e:null},"parsedPattern"):u=a(function(d,f){return typeof d=="string"&&(n.equals(d,s)||!o&&n.equals(d,t))?e:null},"parsedPattern"),u.allPaths=[(r?"*/":"./")+t],u}a(i3i,"trivia4and5");function Rmc(t,e){try{let r=new RegExp(`^${o3i(t)}$`,e.ignoreCase?"i":void 0);return function(n){return r.lastIndex=0,typeof n=="string"&&r.test(n)?t:null}}catch{return aN}}a(Rmc,"toRegExp");function kmc(t,e,r){return!t||typeof e!="string"?!1:s3i(t,r)(e)}a(kmc,"match");function s3i(t,e={}){if(!t)return RDr;if(typeof t=="string"||a3i(t)){let r=kDr(t,e);if(r===aN)return RDr;let n=a(function(o,s){return!!r(o,s)},"resultPattern");return r.allBasenames&&(n.allBasenames=r.allBasenames),r.allPaths&&(n.allPaths=r.allPaths),n}return Nmc(t,e)}a(s3i,"parse");function a3i(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(a3i,"isRelativePattern");function Pmc(t){return t.allBasenames||[]}a(Pmc,"getBasenameTerms");function Dmc(t){return t.allPaths||[]}a(Dmc,"getPathTerms");function Nmc(t,e){let r=c3i(Object.getOwnPropertyNames(t).map(l=>Mmc(l,t[l],e)).filter(l=>l!==aN)),n=r.length;if(!n)return aN;if(!r.some(l=>!!l.requiresSiblings)){if(n===1)return r[0];let l=a(function(f,h){let m;for(let g=0,A=r.length;g{for(let g of m){let A=await g;if(typeof A=="string")return A}return null})():null},"resultExpression"),u=r.find(f=>!!f.allBasenames);u&&(l.allBasenames=u.allBasenames);let d=r.reduce((f,h)=>h.allPaths?f.concat(h.allPaths):f,[]);return d.length&&(l.allPaths=d),l}let o=a(function(l,u,d){let f,h;for(let m=0,g=r.length;m{for(let m of h){let g=await m;if(typeof g=="string")return g}return null})():null},"resultExpression"),s=r.find(l=>!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(Nmc,"parsedExpression");function Mmc(t,e,r){if(e===!1)return aN;let n=kDr(t,r);if(n===aN)return aN;if(typeof e=="boolean")return n;if(e){let o=e.when;if(typeof o=="string"){let s=a((c,l,u,d)=>{if(!d||!n(c,l))return null;let f=o.replace("$(basename)",()=>u),h=d(f);return(0,xDr.isThenable)(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(Mmc,"parseExpressionPattern");function c3i(t,e){let r=t.filter(l=>!!l.basenames);if(r.length<2)return t;let n=r.reduce((l,u)=>{let d=u.basenames;return d?l.concat(d):l},[]),o;if(e){o=[];for(let l=0,u=n.length;l{let d=u.patterns;return d?l.concat(d):l},[]);let s=a(function(l,u){if(typeof l!="string")return null;if(!u){let f;for(f=l.length;f>0;f--){let h=l.charCodeAt(f-1);if(h===47||h===92)break}u=l.substring(f)}let d=n.indexOf(u);return d!==-1?o[d]:null},"aggregate");s.basenames=n,s.patterns=o,s.allBasenames=n;let c=t.filter(l=>!l.basenames);return c.push(s),c}a(c3i,"aggregateBasenameMatches");function Omc(t,e){return(0,pmc.equals)(t,e,(r,n)=>typeof r=="string"&&typeof n=="string"?r===n:typeof r!="string"&&typeof n!="string"?r.base===n.base&&r.pattern===n.pattern:!1)}a(Omc,"patternsEquals")});var Evt=I(Ol=>{"use strict";p();var Lmc=Ol&&Ol.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Bmc=Ol&&Ol.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Fmc=Ol&&Ol.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o(0,u3i.isEqual)(r.uri,t)||r.uri.path===t.path||DDr(t,r))}a(PDr,"findNotebook");function DDr(t,e){if(t.scheme===rBe.Schemas.vscodeNotebookCell||t.scheme===rBe.Schemas.vscodeNotebookCellOutput){let r=e.getCells().findIndex(n=>(0,u3i.isEqual)(n.document.uri,t)||n.document.uri.fragment===t.fragment&&n.document.uri.path===t.path);if(r!==-1)return e.getCells()[r]}}a(DDr,"findCell");function Umc(t,e){if(t.scheme!==rBe.Schemas.vscodeNotebookCellOutput)return;let r=new URLSearchParams(t.query),[n,o]=d3i(t,e);if(!o||!o.outputs.length)return;let s=(r.get("outputIndex")?parseInt(r.get("outputIndex")||"",10):void 0)||0;if(!(s>o.outputs.length-1))return[n,o,o.outputs[s]]}a(Umc,"getNotebookCellOutput");function d3i(t,e){let r=PDr(t,e)||e.find(o=>o.uri.path===t.path);if(!r)return[void 0,void 0];let n=DDr(t,r);return n===void 0?[r,void 0]:[r,n]}a(d3i,"getNotebookAndCellFromUri");function Qmc(t){return t.scheme===rBe.Schemas.vscodeNotebookCell||t.scheme==="untitled"&&t.fragment.startsWith("notebook-chat-input")}a(Qmc,"isNotebookCellOrNotebookChatInput");function qmc(t){return t.scheme===rBe.Schemas.vscodeNotebookCell}a(qmc,"isNotebookCell");function jmc(t){return t.path.endsWith(".ipynb")}a(jmc,"isJupyterNotebookUri");function Hmc(t){return t.notebookType==="jupyter-notebook"}a(Hmc,"isJupyterNotebook");function Gmc(t,e={}){return JSON.stringify({cells:t.getCells().map(r=>({uri_fragment:e.cell_uri_fragment?r.document.uri.fragment:void 0,cell_type:r.kind,source:r.document.getText().split(/\r?\n/)}))})}a(Gmc,"serializeNotebookDocument");function $mc(t){try{let e=t.replace(/\n/g,""),n=/```(?:json)?(.+)/g.exec(e);if(n){let o=n[1],s=o.indexOf("```"),c=s===-1?o:o.substring(0,s);return JSON.parse(c)}}catch{}}a($mc,"extractNotebookOutline");function f3i(t){let e=t;return typeof e=="object"&&e!==null&&(typeof e.include=="string"||h3i(e.include))}a(f3i,"isDocumentExcludePattern");function p3i(t){let e=t;return typeof e=="object"&&e!==null&&typeof e.filenamePattern=="string"}a(p3i,"isFilenamePattern");function h3i(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(h3i,"isRelativePattern");function Vmc(t){let e=t;return!!e&&!!e.type&&!!e.displayName&&!!e.selector}a(Vmc,"isNotebookEditorContribution");function Wmc(t){let e=[];for(let[r,n]of Object.entries(t))n&&e.push({filenamePattern:r,viewType:n});return e}a(Wmc,"extractEditorAssociation");function m3i(t,e){if(typeof e=="string"&&Eye.match(e.toLowerCase(),(0,_ye.basename)(t.fsPath).toLowerCase()))return!0;if(f3i(e)){let r=e.include,n=e.exclude;if(!r)return!1;if(Eye.match(r,(0,_ye.basename)(t.fsPath).toLowerCase()))return!(n&&Eye.match(n,(0,_ye.basename)(t.fsPath).toLowerCase()))}return p3i(e)&&Eye.match(e.filenamePattern,(0,_ye.basename)(t.fsPath).toLowerCase())?!(e.excludeFileNamePattern&&Eye.match(e.excludeFileNamePattern,(0,_ye.basename)(t.fsPath).toLowerCase())):!1}a(m3i,"notebookSelectorMatches");function g3i(t,e){let r=[];for(let n of e)n.filenamePattern&&Eye.match(n.filenamePattern.toLowerCase(),(0,_ye.basename)(t.fsPath).toLowerCase())&&r.push({filenamePattern:n.filenamePattern,viewType:n.viewType});return r}a(g3i,"getNotebookEditorAssociations");function zmc(t,e,r,n){if(PDr(t,e))return!0;let o=r.filter(c=>c.selector.some(l=>m3i(t,l)));if(o.length===0)return!1;let s=g3i(t,n);for(let c of s)if(o.some(l=>l.type===c.viewType))return!0;return!!o.some(c=>(c.priority??yvt.default)===yvt.default)}a(zmc,"_hasSupportedNotebooks")});var C3i=I(M0=>{"use strict";p();var Ymc=M0&&M0.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Kmc=M0&&M0.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(M0,"__esModule",{value:!0});M0.TelemetrySender=M0.NextEditProviderTelemetryBuilder=M0.DiagnosticsTelemetryBuilder=M0.LlmNESTelemetryBuilder=M0.NES_GH_TELEMETRY_EVENT_NAME=void 0;var A3i=jR(),y3i=e3i(),Jmc=h4(),v3i=gm(),Zmc=Evt(),Xmc=nl(),_vt=Ro(),e0c=tJ(),E3i=C8(),_3i=P0();M0.NES_GH_TELEMETRY_EVENT_NAME="copilot-nes/provideInlineEdit";var vvt=class extends _vt.Disposable{static{a(this,"LlmNESTelemetryBuilder")}build(e){let r,n,o,s,c,l=!1,u,d,f;if(this._request){let g=this._request.getActiveDocument();r=this._request.documents.length,n=this._request.documents.reduce((y,E)=>y+E.recentEdits.edits.length,0),o=g.recentEdits.edits.length,s=g.languageId,c=g.documentAfterEditsLines.length,l=g.id.toUri().scheme===e0c.Schemas.vscodeNotebookCell||this._notebookService?.hasSupportedNotebooks(g.id.toUri())||!1,u=this._workspaceService===void 0?void 0:(0,Zmc.findNotebook)(g.id.toUri(),this._workspaceService.notebookDocuments)?.notebookType;let A=this._gitExtensionService?.getExtensionApi();if(A){let y=A.getRepository(_3i.Uri.parse(g.id.uri));if(y){let v=(0,y3i.getUpstreamRemote)(y);v?.fetchUrl&&(d=v.pushUrl||v.fetchUrl)}let E=new Set,_=[...new Set(this._request.documents.map(v=>A.getRepository(_3i.Uri.parse(v.id.uri))).filter(Boolean))];for(let v of _){let b=v?(0,y3i.getUpstreamRemote)(v):void 0;b?.fetchUrl&&E.add(b.fetchUrl),b?.pushUrl&&E.add(b.pushUrl)}f=[...E]}}let h;if(e&&this.editCollectingInfo!==void 0){let g=this.editCollectingInfo.originalDoc.value,A;if(this._debugRecorder&&this._requestBookmark){let y=this._debugRecorder.getRecentLog(),E=JSON.stringify(y)?.length||0;A={entries:E>200*1024?void 0:y,entriesSize:E,requestTime:this._requestBookmark.timeMs}}h={text:g.length>200*1024?void 0:g,textLength:g.length,selection:this.editCollectingInfo.originalSelection.map(y=>({start:y.start,endExclusive:y.endExclusive})),edits:this.editCollectingInfo.edits.map(y=>y.edit.replacements.map(E=>({time:y.time.toISOString(),start:E.replaceRange.start,endExclusive:E.replaceRange.endExclusive,newText:E.newText}))).flat(),tags:[],recording:A}}let m=this._statelessNextEditTelemetry?.fetchStartedAt===void 0?void 0:this._statelessNextEditTelemetry.fetchStartedAt-this._startTime;return{providerId:this._providerId,headerRequestId:this._headerRequestId,nextEditProviderDuration:this._duration,isFromCache:this._isFromCache,reusedRequest:this._reusedRequest,subsequentEditOrder:this._subsequentEditOrder,documentsCount:r,editsCount:n,activeDocumentEditsCount:o,activeDocumentLanguageId:s,activeDocumentOriginalLineCount:c,fetchStartedAfterMs:m,hasNextEdit:this._hasNextEdit,wasPreviouslyRejected:this._wasPreviouslyRejected,isNotebook:l,notebookType:u,status:this._status,nextEditProviderError:this._nextEditProviderError,alternativeAction:h,...this._statelessNextEditTelemetry,activeDocumentRepository:d,repositoryUrls:f,nesConfigs:this._nesConfigs}}get originalSelectionLine(){return this.editCollectingInfo?.originalSelectionLine}setRequestBookmark(e){this._requestBookmark=e}constructor(e,r,n,o,s,c,l){super(),this._gitExtensionService=e,this._notebookService=r,this._workspaceService=n,this._providerId=o,this._doc=s,this._debugRecorder=c,this._requestBookmark=l,this._isFromCache=!1,this._hasNextEdit=!1,this._wasPreviouslyRejected=!1,this._status="new",this._startTime=Date.now(),this._doc&&(this.editCollectingInfo={originalDoc:this._doc.value.get(),originalSelection:this._doc.selection.get(),originalSelectionLine:this._doc.primarySelectionLine.get(),edits:[]},this._store.add((0,Jmc.autorunWithChanges)(this,{value:this._doc.value},u=>{let d=new Date;u.value.changes.forEach(f=>{this.editCollectingInfo?.edits.push({time:d,edit:f})})})))}setNESConfigs(e){return this._nesConfigs=e,this}setHeaderRequestId(e){return this._headerRequestId=e,this}setIsFromCache(){return this._isFromCache=!0,this}setReusedRequest(e){return this._reusedRequest=e,this}setSubsequentEditOrder(e){return this._subsequentEditOrder=e,this}setRequest(e){return this._request=e,this}setStatelessNextEditTelemetry(e){return this._statelessNextEditTelemetry=e,this}setHasNextEdit(e){return this._hasNextEdit=e,this}setWasPreviouslyRejected(){return this._wasPreviouslyRejected=!0,this}markEndTime(){return this._duration=Date.now()-this._startTime,this}setStatus(e){return this._status=e,this}setNextEditProviderError(e){return this._nextEditProviderError=e,this}};M0.LlmNESTelemetryBuilder=vvt;var Cvt=class{static{a(this,"DiagnosticsTelemetryBuilder")}constructor(){this._droppedReasons=[]}build(){let e=this._droppedReasons.length>0?JSON.stringify(this._droppedReasons):void 0;return{diagnosticType:this._type,diagnosticDroppedReasons:e,diagnosticAlternativeImportsCount:this._diagnosticRunTelemetry?.alternativeImportsCount,diagnosticHasExistingSameFileImport:this._diagnosticRunTelemetry?.hasExistingSameFileImport,diagnosticIsLocalImport:this._diagnosticRunTelemetry?.isLocalImport,diagnosticDistanceToUnknownDiagnostic:this._diagnosticRunTelemetry?.distanceToUnknownDiagnostic,diagnosticDistanceToAlternativeDiagnostic:this._diagnosticRunTelemetry?.distanceToAlternativeDiagnostic,diagnosticHasAlternativeDiagnosticForSameRange:this._diagnosticRunTelemetry?.hasAlternativeDiagnosticForSameRange}}populate(e){this._droppedReasons.forEach(r=>e.addDroppedReason(r)),this._type&&e.setType(this._type),this._diagnosticRunTelemetry&&e.setDiagnosticRunTelemetry(this._diagnosticRunTelemetry)}setType(e){return this._type=e,this}addDroppedReason(e){return this._droppedReasons.push(e),this}setDiagnosticRunTelemetry(e){return this._diagnosticRunTelemetry=e,this}};M0.DiagnosticsTelemetryBuilder=Cvt;var NDr=class t extends _vt.Disposable{static{a(this,"NextEditProviderTelemetryBuilder")}static{this.providerIdToReqN=new Map}get isSent(){return this._isSent}markAsSent(){this._isSent=!0}build(e){let r=this._nesBuilder.build(e),n=this._diagnosticsBuilder.build();return{...r,...n,opportunityId:this._opportunityId||"",requestN:this._requestN,isShown:this._isShown,acceptance:this._acceptance,disposalReason:this._disposalReason,supersededByOpportunityId:this._supersededByOpportunityId,pickedNES:this._nesTypePicked,hadLlmNES:this._hadLlmNES,isMultilineEdit:this._isMultilineEdit,isEolDifferent:this._isEolDifferent,isActiveDocument:this._isActiveDocument,isNextEditorVisible:this._isNextEditorVisible,isNextEditorRangeVisible:this._isNextEditorRangeVisible,isNESForAnotherDoc:this._isNESForAnotherDoc,notebookId:this._notebookId,notebookCellLines:this._notebookCellLines,notebookCellMarkerCount:this._notebookCellMarkerCount,notebookCellMarkerIndex:this._notebookCellMarkerIndex,hadDiagnosticsNES:this._hadDiagnosticsNES,configIsDiagnosticsNESEnabled:this._configIsDiagnosticsNESEnabled,isNaturalLanguageDominated:this._isNaturalLanguageDominated,postProcessingOutcome:this._postProcessingOutcome,userTypingDisagreed:this._userTypingDisagreed}}get nesBuilder(){return this._nesBuilder}get diagnosticsBuilder(){return this._diagnosticsBuilder}constructor(e,r,n,o,s,c,l){super(),this.doc=s,this._isSent=!1,this._isShown=!1,this._acceptance="notAccepted",this._disposalReason=void 0,this._supersededByOpportunityId=void 0,this._userTypingDisagreed=void 0,this._notebookCellMarkerCount=0,this._notebookCellMarkerIndex=-1,this._isNESForAnotherDoc=!1,this._hadLlmNES=!1,this._hadDiagnosticsNES=!1,this._configIsDiagnosticsNESEnabled=!1,this._isNaturalLanguageDominated=!1;let u=t.providerIdToReqN.get(o)||0;this._requestN=++u,t.providerIdToReqN.set(o,u),this._nesBuilder=this._register(new vvt(e,r,n,o,s,c,l)),this._diagnosticsBuilder=new Cvt}setOpportunityId(e){return this._opportunityId=e,this}setAsShown(){return this._isShown=!0,this}setAcceptance(e){return this._acceptance=e,this}setDisposalReason(e){return this._disposalReason=e,this}setSupersededBy(e){return this._supersededByOpportunityId=e,this}setUserTypingDisagreed(e){return this._userTypingDisagreed=e,this}setPickedNESType(e){return this._nesTypePicked=e,this}setIsActiveDocument(e){return this._isActiveDocument=e,this}setNotebookCellMarkerCount(e){return this._notebookCellMarkerCount=e,this}setIsMultilineEdit(e){return this._isMultilineEdit=e,this}setIsEolDifferent(e){return this._isEolDifferent=e,this}setIsNextEditorVisible(e){return this._isNextEditorVisible=e,this}setIsNextEditorRangeVisible(e){return this._isNextEditorRangeVisible=e,this}setNotebookId(e){return this._notebookId=e,this}setNotebookCellLines(e){return this._notebookCellLines=e,this}setNotebookCellMarkerIndex(e){return this._notebookCellMarkerIndex=e,this}setIsNESForOtherEditor(e){return this._isNESForAnotherDoc=e,this}setHadLlmNES(e){return this._hadLlmNES=e,this}setHadDiagnosticsNES(e){return this._hadDiagnosticsNES=e,this}setStatus(e){return this._nesBuilder.setStatus(e),this}setConfigIsDiagnosticsNESEnabled(e){return this._configIsDiagnosticsNESEnabled=e,this}setIsNaturalLanguageDominated(e){return this._isNaturalLanguageDominated=e,this}setPostProcessingOutcome(e){let r=e.displayLocation?{label:e.displayLocation.label,range:e.displayLocation.range.toString()}:void 0;return this._postProcessingOutcome=JSON.stringify({suggestedEdit:e.edit.toString(),isInlineCompletion:e.isInlineCompletion,displayLocation:r}),this}};M0.NextEditProviderTelemetryBuilder=NDr;var MDr=class{static{a(this,"IdleDetector")}get isDisposed(){return this._store.isDisposed}constructor(e,r,n){this._onIdle=r,this._onUserJump=n,this._store=new _vt.DisposableStore,this._disposalTracker=new _vt.RefCountedDisposable(this._store),this._selectionSnapshots=new Map,this._lastEditTime=0;let o=5e3,s=this._store.add(new Xmc.RunOnceScheduler(()=>{this._onIdle(o)},o));this._idleScheduler=s;let c=!0;this._store.add((0,E3i.autorun)(u=>{if(e.onDidOpenDocumentChange.read(u),c){c=!1;return}this._lastEditTime=Date.now(),s.schedule()}));let l=!0;this._store.add((0,E3i.autorunHandleChanges)({owner:this,changeTracker:{createChangeSummary:a(()=>({removed:[]}),"createChangeSummary"),handleChange:a((u,d)=>(u.didChange(e.openDocuments)&&(d.removed=u.change.removed),!0),"handleChange")}},(u,d)=>{if(this._store.isDisposed)return;let f=e.openDocuments.read(u);for(let h of f)h.primarySelectionLine.read(u);if(l){l=!1;for(let h of f)this._selectionSnapshots.set(h.id.uri,h.primarySelectionLine.get());return}for(let h of d.removed)this._selectionSnapshots.delete(h.id.uri);if(!(Date.now()-this._lastEditTime<200))for(let h of f){let m=h.id.uri,g=h.primarySelectionLine.get();if(this._selectionSnapshots.get(m)!==g){this._selectionSnapshots.set(m,g),this._onUserJump(m,g);return}}}))}scheduleIdleTimer(){this._idleScheduler?.schedule()}acquire(){this._disposalTracker.acquire()}release(){this._disposalTracker.release()}forceDispose(){this._store.dispose()}},ODr=class{static{a(this,"TelemetrySender")}constructor(e,r){this._workspace=e,this._telemetryService=r,this._map=new Map}scheduleSendingEnhancedTelemetry(e,r){let n=this._map.get(e);n&&(n.builder!==r&&n.builder.dispose(),this._removeEntry(e,n));let o=setTimeout(()=>{this._enterIdleDetection(e,r)},120*1e3);this._map.set(e,{builder:r,timeout:o})}_enterIdleDetection(e,r){let n=this._workspace;if(!n){this._buildAndSendEnhancedTelemetry(e,r,{reason:"idle",details:{idleTimeoutMs:0}});return}this._idleDetector?this._idleDetector.acquire():this._idleDetector=new MDr(n,l=>this._sendAllPendingInIdlePhase({reason:"idle",details:{idleTimeoutMs:l}}),(l,u)=>this._sendAllPendingInIdlePhaseWithJump(l,u)),this._idleDetector.scheduleIdleTimer();let o=3e4,s=setTimeout(()=>{this._sendForEntry(e,{reason:"hard_cap",details:{hardCapTimeoutMs:o}})},o),c=this._map.get(e);c&&(c.hardCapTimeout=s)}_releaseIdleDetector(){this._idleDetector?.release(),this._idleDetector?.isDisposed&&(this._idleDetector=void 0)}_sendAllPendingInIdlePhase(e){let r=[];for(let[n,o]of this._map)o.hardCapTimeout!==void 0&&r.push(n);for(let n of r)this._sendForEntry(n,e)}_sendAllPendingInIdlePhaseWithJump(e,r){let n=[];for(let[o,s]of this._map)s.hardCapTimeout!==void 0&&n.push([o,s.builder]);for(let[o,s]of n){let c=s.doc?.id.uri,l=s.nesBuilder.originalSelectionLine,u=c!==void 0&&l!==void 0?{file:c,line:l}:void 0;this._sendForEntry(o,{reason:"user_jump",details:{from:u,to:{file:e,line:r}}})}}_sendForEntry(e,r){let n=this._map.get(e);if(!n)return;n.hardCapTimeout!==void 0&&(clearTimeout(n.hardCapTimeout),this._releaseIdleDetector()),this._map.delete(e);let o;try{o=n.builder.build(!0)}finally{n.builder.dispose()}this._doSendEnhancedTelemetry(o,r)}_removeEntry(e,r){clearTimeout(r.timeout),r.hardCapTimeout!==void 0&&(clearTimeout(r.hardCapTimeout),this._releaseIdleDetector()),this._map.delete(e)}_buildAndSendEnhancedTelemetry(e,r,n){let o;this._map.delete(e);try{o=r.build(!0)}finally{r.dispose()}this._doSendEnhancedTelemetry(o,n)}sendTelemetry(e,r){if(e){let o=this._map.get(e);o&&this._removeEntry(e,o)}let n=r.build(!0);r.isSent||(this._doSendTelemetry(n),r.markAsSent()),this._doSendEnhancedTelemetry(n,void 0)}sendTelemetryForBuilder(e){if(e.isSent)return;let r=e.build(!1);this._doSendTelemetry(r),e.markAsSent()}async _doSendTelemetry(e){let{opportunityId:r,headerRequestId:n,requestN:o,providerId:s,modelName:c,hadStatelessNextEditProviderCall:l,statelessNextEditProviderDuration:u,nextEditProviderDuration:d,isFromCache:f,reusedRequest:h,subsequentEditOrder:m,activeDocumentLanguageId:g,activeDocumentOriginalLineCount:A,nLinesOfCurrentFileInPrompt:y,wasPreviouslyRejected:E,isShown:_,isNotebook:v,notebookType:b,isNESForAnotherDoc:T,isActiveDocument:w,isEolDifferent:R,isMultilineEdit:x,isNextEditorRangeVisible:P,isNextEditorVisible:D,acceptance:N,disposalReason:L,logProbThreshold:B,documentsCount:q,editsCount:M,activeDocumentEditsCount:O,promptLineCount:j,promptCharCount:Q,hadLowLogProbSuggestion:U,nEditsSuggested:Y,lineDistanceToMostRecentEdit:W,isCursorAtEndOfLine:V,isInlineSuggestion:z,debounceTime:ie,artificialDelay:H,hasNextEdit:re,notebookCellMarkerCount:le,notebookCellMarkerIndex:Le,notebookId:ge,notebookCellLines:Ue,nextEditLogprob:ke,supersededByOpportunityId:X,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchStartedAfterMs:he,response:Z,configIsDiagnosticsNESEnabled:ue,isNaturalLanguageDominated:qe,diagnosticType:ne,diagnosticDroppedReasons:ce,diagnosticHasExistingSameFileImport:Ne,diagnosticIsLocalImport:we,diagnosticAlternativeImportsCount:Be,diagnosticDistanceToUnknownDiagnostic:rt,diagnosticDistanceToAlternativeDiagnostic:st,diagnosticHasAlternativeDiagnosticForSameRange:_t,hadDiagnosticsNES:Dt,hadLlmNES:$t,pickedNES:Gt,xtabAggressivenessLevel:Ie,xtabUserHappinessScore:F,userAggressivenessSetting:be,modelConfig:Qe}=e,pe,Se,Fe,te;if(Z!==void 0){let{response:Te,ttft:Ge,fetchResult:J,fetchTime:se}=await Z;Te.type===A3i.ChatFetchResponseType.Success&&(pe=Te.usage),Se=Ge,Fe=J,te=se}this._sendTelemetryToBoth({opportunityId:r,headerRequestId:n,providerId:s,modelName:c,activeDocumentLanguageId:g,mergeConflictExpanded:e.mergeConflictExpanded,acceptance:N,disposalReason:L,supersededByOpportunityId:X,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchResult:Fe,nextEditProviderError:e.nextEditProviderError,reusedRequest:h,diagnosticType:ne,diagnosticDroppedReasons:ce,pickedNES:Gt,notebookType:b,notebookId:ge,notebookCellLines:Ue,nextCursorLineError:e.nextCursorPrediction?.nextCursorLineError,xtabAggressivenessLevel:Ie,userAggressivenessSetting:be,modelConfig:Qe,neighborSnippetIndicesInPrompt:e.neighborSnippetIndicesInPrompt},{requestN:o,hadStatelessNextEditProviderCall:this._boolToNum(l),statelessNextEditProviderDuration:u,nextEditProviderDuration:d,isFromCache:this._boolToNum(f),subsequentEditOrder:m,activeDocumentOriginalLineCount:A,activeDocumentNLinesInPrompt:y,wasPreviouslyRejected:this._boolToNum(E),isShown:this._boolToNum(_),isNotebook:this._boolToNum(v),isNESForAnotherDoc:this._boolToNum(T),isActiveDocument:this._boolToNum(w),isEolDifferent:this._boolToNum(R),isMultilineEdit:this._boolToNum(x),isNextEditorRangeVisible:this._boolToNum(P),isNextEditorVisible:this._boolToNum(D),hasNotebookCellMarker:le>0?1:0,notebookCellMarkerCount:le,notebookCellMarkerIndex:Le,logProbThreshold:B,documentsCount:q,editsCount:M,activeDocumentEditsCount:O,promptLineCount:j,promptCharCount:Q,hadLowLogProbSuggestion:this._boolToNum(U),nEditsSuggested:Y,lineDistanceToMostRecentEdit:W,isCursorAtEndOfLine:this._boolToNum(V),isInlineSuggestion:this._boolToNum(z),debounceTime:ie,artificialDelay:H,fetchStartedAfterMs:he,ttft:Se,fetchTime:te,promptTokens:pe?.prompt_tokens,responseTokens:pe?.completion_tokens,cachedTokens:pe?.prompt_tokens_details?.cached_tokens,acceptedPredictionTokens:pe?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:pe?.completion_tokens_details?.rejected_prediction_tokens,hasNextEdit:this._boolToNum(re),userTypingDisagreed:this._boolToNum(e.userTypingDisagreed),nextEditLogprob:ke,hadDiagnosticsNES:this._boolToNum(Dt),hadLlmNES:this._boolToNum($t),configIsDiagnosticsNESEnabled:this._boolToNum(ue),isNaturalLanguageDominated:this._boolToNum(qe),diagnosticHasExistingSameFileImport:this._boolToNum(Ne),diagnosticIsLocalImport:this._boolToNum(we),diagnosticAlternativeImportsCount:Be,diagnosticDistanceToUnknownDiagnostic:rt,diagnosticDistanceToAlternativeDiagnostic:st,diagnosticHasAlternativeDiagnosticForSameRange:this._boolToNum(_t),nextCursorLineDistance:e.nextCursorPrediction?.nextCursorLineDistance,xtabUserHappinessScore:F,nDiffsInPrompt:e.nDiffsInPrompt,diffTokensInPrompt:e.diffTokensInPrompt,nNeighborSnippetsComputed:e.nNeighborSnippetsComputed,nNeighborSnippetsInPrompt:e.nNeighborSnippetsInPrompt})}_sendTelemetryToBoth(e,r){this._telemetryService.sendMSFTTelemetryEvent("provideInlineEdit",e,r),this._telemetryService.sendGHTelemetryEvent(M0.NES_GH_TELEMETRY_EVENT_NAME,e,r)}async _doSendEnhancedTelemetry(e,r){let{opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,status:l,modelName:u,prompt:d,response:f,alternativeAction:h,postProcessingOutcome:m,activeDocumentRepository:g,repositoryUrls:A,cursorJumpModelName:y,cursorJumpPrompt:E,cursorJumpResponse:_,lintErrors:v,terminalOutput:b,similarFilesContext:T,modelConfig:w,isFromCache:R}=e,x=f===void 0?f:await f,P=await T?.catch(()=>{}),D=x?.fetchResult;this._telemetryService.sendEnhancedGHTelemetryEvent(M0.NES_GH_TELEMETRY_EVENT_NAME,(0,v3i.multiplexProperties)({opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,suggestionStatus:l,modelName:u,prompt:d,modelResponse:x===void 0||x.response.type!==A3i.ChatFetchResponseType.Success?void 0:x.response.value,fetchResult:D,alternativeAction:h?JSON.stringify({...h,enhancedTelemetrySendingReason:r}):void 0,enhancedTelemetrySendingReason:!h&&r?JSON.stringify(r):void 0,postProcessingOutcome:m,activeDocumentRepository:g,repositories:JSON.stringify(A),cursorJumpModelName:y,cursorJumpPrompt:E,cursorJumpResponse:_,lintErrors:v,terminalOutput:b,similarFilesContext:P,modelConfig:w}),{isFromCache:this._boolToNum(R)})}_boolToNum(e){return e===void 0?void 0:e?1:0}dispose(){for(let e of this._map.values())clearTimeout(e.timeout),e.hardCapTimeout!==void 0&&clearTimeout(e.hardCapTimeout),e.builder.dispose();this._map.clear(),this._idleDetector&&(this._idleDetector.forceDispose(),this._idleDetector=void 0)}};M0.TelemetrySender=ODr;M0.TelemetrySender=ODr=Ymc([Kmc(1,v3i.ITelemetryService)],ODr)});var BDr=I(vye=>{"use strict";p();Object.defineProperty(vye,"__esModule",{value:!0});vye.NullPowerService=vye.IPowerService=void 0;var b3i=Ic(),t0c=Gs();vye.IPowerService=(0,t0c.createDecorator)("IPowerService");var LDr=class{static{a(this,"NullPowerService")}constructor(){this.onDidSuspend=b3i.Event.None,this.onDidResume=b3i.Event.None}acquirePowerSaveBlocker(){return{dispose:a(()=>{},"dispose")}}};vye.NullPowerService=LDr});var K6=I(V$=>{"use strict";p();Object.defineProperty(V$,"__esModule",{value:!0});V$.FetchStreamRecorder=V$.FetchStreamSource=V$.IChatMLFetcher=void 0;var r0c=nn(),n0c=nl();V$.IChatMLFetcher=(0,r0c.createServiceIdentifier)("IChatMLFetcher");var FDr=class{static{a(this,"FetchStreamSource")}get stream(){return this._stream.asyncIterable}constructor(){this._stream=new n0c.AsyncIterableSource,this._seenAnnotationTypes=new Set}pause(){this._paused??=[]}unpause(){let e=this._paused;if(e){this._paused=void 0;for(let r of e)r?this.update(r.text,r.delta):this.resolve()}}update(e,r){if(this._paused){this._paused.push({text:e,delta:r});return}r.codeVulnAnnotations&&(!((e.match(/(^|\n)```/g)?.length??0)%2===1)||e.match(/(^|\n)```\w*\s*$/))&&(r.codeVulnAnnotations=void 0),r.codeVulnAnnotations&&(r.codeVulnAnnotations=r.codeVulnAnnotations.filter(n=>!this._seenAnnotationTypes.has(n.details.type)),r.codeVulnAnnotations.forEach(n=>this._seenAnnotationTypes.add(n.details.type))),this._stream.emitOne({delta:r})}resolve(){if(this._paused){this._paused.push(void 0);return}this._stream.resolve()}reject(e){this._paused=void 0,this._stream.reject(e)}};V$.FetchStreamSource=FDr;var UDr=class{static{a(this,"FetchStreamRecorder")}get firstTokenEmittedTime(){return this._firstTokenEmittedTime}get outputChunkGapsMs(){return this._outputChunkGapsMs}constructor(e){this.deltas=[],this._outputChunkGapsMs=[],this.callback=async(r,n,o)=>{if(!!(o.text||o.beginToolCalls||typeof o.thinking?.text=="string"&&o.thinking?.text||o.thinking?.text?.length||o.copilotToolCalls||o.copilotToolCallStreamUpdates)){let l=Date.now();this._firstTokenEmittedTime===void 0?this._firstTokenEmittedTime=l:this._lastOutputChunkTime!==void 0&&this._outputChunkGapsMs.push(l-this._lastOutputChunkTime),this._lastOutputChunkTime=l}let c=e?await e(r,n,o):void 0;return this.deltas.push(o),c}}};V$.FetchStreamRecorder=UDr});var QDr=I(bvt=>{"use strict";p();Object.defineProperty(bvt,"__esModule",{value:!0});bvt.IChatQuotaService=void 0;var i0c=nn();bvt.IChatQuotaService=(0,i0c.createServiceIdentifier)("IChatQuotaService")});var qDr=I(Svt=>{"use strict";p();Object.defineProperty(Svt,"__esModule",{value:!0});Svt.IConversationOptions=void 0;var o0c=nn();Svt.IConversationOptions=(0,o0c.createServiceIdentifier)("ConversationOptions")});var nBe=I(Cye=>{"use strict";p();Object.defineProperty(Cye,"__esModule",{value:!0});Cye.getTextPart=a0c;Cye.toTextPart=S3i;Cye.toTextParts=c0c;Cye.roleToString=l0c;var Bne=Io(),s0c=rd();function a0c(t){return t?typeof t=="string"?t:Array.isArray(t)?t.map(e=>e.type===Bne.Raw.ChatCompletionContentPartKind.Text||e.type==="text"?e.text:"").join(""):t.type===Bne.Raw.ChatCompletionContentPartKind.Text?t.text:"":""}a(a0c,"getTextPart");function S3i(t){return{type:Bne.Raw.ChatCompletionContentPartKind.Text,text:t}}a(S3i,"toTextPart");function c0c(t){return[S3i(t)]}a(c0c,"toTextParts");function l0c(t){switch(t){case Bne.Raw.ChatRole.System:return"system";case Bne.Raw.ChatRole.User:return"user";case Bne.Raw.ChatRole.Assistant:return"assistant";case Bne.Raw.ChatRole.Tool:return"tool";default:(0,s0c.assertNever)(t,`unknown role (${t})`)}}a(l0c,"roleToString")});var HDr=I(bye=>{"use strict";p();Object.defineProperty(bye,"__esModule",{value:!0});bye.InteractionService=bye.IInteractionService=void 0;var u0c=nn(),T3i=T0();bye.IInteractionService=(0,u0c.createServiceIdentifier)("IInteractionService");var jDr=class{static{a(this,"InteractionService")}constructor(){this._interactionId=(0,T3i.generateUuid)()}startInteraction(){this._interactionId=(0,T3i.generateUuid)()}get interactionId(){return this._interactionId}};bye.InteractionService=jDr});var $Dr=I(Tvt=>{"use strict";p();Object.defineProperty(Tvt,"__esModule",{value:!0});Tvt.SSEParser=void 0;var GDr=class{static{a(this,"SSEParser")}constructor(e){this.dataBuffer="",this.eventTypeBuffer="",this.buffer=[],this.endedOnCR=!1,this.onEventHandler=e,this.decoder=new TextDecoder("utf-8")}getLastEventId(){return this.lastEventIdBuffer}getReconnectionTime(){return this.reconnectionTime}feed(e){if(e.length===0)return;let r=0;for(this.endedOnCR&&e[0]===10&&r++,this.endedOnCR=!1;r{"use strict";p();Object.defineProperty(EL,"__esModule",{value:!0});EL.PendingLoggedChatRequest=EL.IRequestLogger=EL.ChatRequestScheme=void 0;EL.resolveMarkdownContent=E0c;EL.resolveMarkdownIcon=_0c;var eFi=JR(),A0c=nn(),y0c=Ed(),PDr=class t{static{a(this,"ChatRequestScheme")}static{this.chatRequestScheme="ccreq"}static buildUri(e,r="markdown"){let n;return r==="markdown"?n="copilotmd":r==="json"?n="json":n="request.json",e.kind==="latest"?`${t.chatRequestScheme}:latest.${n}`:`${t.chatRequestScheme}:${e.id}.${n}`}static parseUri(e){if(e===this.buildUri({kind:"latest"},"markdown"))return{data:{kind:"latest"},format:"markdown"};if(e===this.buildUri({kind:"latest"},"json"))return{data:{kind:"latest"},format:"json"};if(e===this.buildUri({kind:"latest"},"rawrequest"))return{data:{kind:"latest"},format:"rawrequest"};let r=e.match(/ccreq:([^\s]+)\.copilotmd/);if(r)return{data:{kind:"request",id:r[1]},format:"markdown"};let n=e.match(/ccreq:([^\s]+)\.request\.json/);if(n)return{data:{kind:"request",id:n[1]},format:"rawrequest"};let o=e.match(/ccreq:([^\s]+)\.json/);if(o)return{data:{kind:"request",id:o[1]},format:"json"}}static findAllUris(e){let r=/(ccreq:[^\s]+\.(copilotmd|json|request\.json))/g;return[...e.matchAll(r)].map(n=>{let o=n[1];return{uri:o,range:new y0c.OffsetRange(n.index,n.index+o.length)}})}};EL.ChatRequestScheme=PDr;EL.IRequestLogger=(0,A0c.createServiceIdentifier)("IRequestLogger");function E0c(t){return typeof t.markdownContent=="function"?t.markdownContent():t.markdownContent}a(E0c,"resolveMarkdownContent");function _0c(t){return typeof t.icon=="function"?t.icon():t.icon}a(_0c,"resolveMarkdownIcon");var DDr=class{static{a(this,"AbstractPendingLoggedRequest")}constructor(e,r,n,o){this._logbook=e,this._debugName=r,this._chatEndpoint=n,this._chatParams=o,this._timeToFirstToken=void 0,this._time=new Date}markTimeToFirstToken(e){this._timeToFirstToken=e}resolveWithCancelation(){this._logbook.addEntry({type:"ChatMLCancelation",debugName:this._debugName,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata})}},NDr=class extends DDr{static{a(this,"PendingLoggedChatRequest")}constructor(e,r,n,o){super(e,r,n,o)}resolve(e,r){e.type===eFi.ChatFetchResponseType.Success?this._logbook.addEntry({type:"ChatMLSuccess",debugName:this._debugName,usage:e.usage,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,timeToFirstToken:this._timeToFirstToken,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata,result:e,deltas:r}):this._logbook.addEntry({type:e.type===eFi.ChatFetchResponseType.Canceled?"ChatMLCancelation":"ChatMLFailure",debugName:this._debugName,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,timeToFirstToken:this._timeToFirstToken,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata,result:e})}};EL.PendingLoggedChatRequest=NDr});var ODr=I(Iye=>{"use strict";p();Object.defineProperty(Iye,"__esModule",{value:!0});Iye.NullSnippyService=Iye.ISnippyService=void 0;var v0c=nn();Iye.ISnippyService=(0,v0c.createServiceIdentifier)("ISnippyService");var MDr=class{static{a(this,"NullSnippyService")}async handlePostInsertion(){}};Iye.NullSnippyService=MDr});var FDr=I(xye=>{"use strict";p();Object.defineProperty(xye,"__esModule",{value:!0});xye.MovedText=xye.LinesDiff=void 0;var LDr=class{static{a(this,"LinesDiff")}constructor(e,r,n){this.changes=e,this.moves=r,this.hitTimeout=n}};xye.LinesDiff=LDr;var BDr=class t{static{a(this,"MovedText")}constructor(e,r){this.lineRangeMapping=e,this.changes=r}flip(){return new t(this.lineRangeMapping.flip(),this.changes.map(e=>e.flip()))}};xye.MovedText=BDr});var gvt=I(hN=>{"use strict";p();Object.defineProperty(hN,"__esModule",{value:!0});hN.RangeMapping=hN.DetailedLineRangeMapping=hN.LineRangeMapping=void 0;hN.lineRangeMappingFromRangeMappings=b0c;hN.getLineRangeMapping=iFi;hN.lineRangeMappingFromChange=S0c;var C0c=Sl(),tFi=sd(),mvt=Rs(),E1=X2(),pN=$_(),_L=nh(),nFi=B5e(),lBe=class t{static{a(this,"LineRangeMapping")}static inverse(e,r,n){let o=[],s=1,c=1;for(let u of e){let d=new t(new E1.LineRange(s,u.original.startLineNumber),new E1.LineRange(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new E1.LineRange(s,r+1),new E1.LineRange(c,n+1));return l.modified.isEmpty||o.push(l),o}static clip(e,r,n){let o=[];for(let s of e){let c=s.original.intersect(r),l=s.modified.intersect(n);c&&!c.isEmpty&&l&&!l.isEmpty&&o.push(new t(c,l))}return o}constructor(e,r){this.original=e,this.modified=r}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new t(this.modified,this.original)}join(e){return new t(this.original.join(e.original),this.modified.join(e.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){let e=this.original.toInclusiveRange(),r=this.modified.toInclusiveRange();if(e&&r)return new c9(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new mvt.BugIndicatingError("not a valid diff");return new c9(new _L.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new _L.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new c9(new _L.Range(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new _L.Range(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(rFi(this.original.endLineNumberExclusive,e)&&rFi(this.modified.endLineNumberExclusive,r))return new c9(new _L.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new _L.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new c9(_L.Range.fromPositions(new pN.Position(this.original.startLineNumber,1),wye(new pN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),_L.Range.fromPositions(new pN.Position(this.modified.startLineNumber,1),wye(new pN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new c9(_L.Range.fromPositions(wye(new pN.Position(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),wye(new pN.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),_L.Range.fromPositions(wye(new pN.Position(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),wye(new pN.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new mvt.BugIndicatingError}};hN.LineRangeMapping=lBe;function wye(t,e){if(t.lineNumber<1)return new pN.Position(1,1);if(t.lineNumber>e.length)return new pN.Position(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new pN.Position(t.lineNumber,r.length+1):t}a(wye,"normalizePosition");function rFi(t,e){return t>=1&&t<=e.length}a(rFi,"isValidLineNumber");var uBe=class t extends lBe{static{a(this,"DetailedLineRangeMapping")}static toTextEdit(e,r){let n=[];for(let o of e)for(let s of o.innerChanges??[]){let c=s.toTextEdit(r);n.push(c)}return new nFi.TextEdit(n)}static fromRangeMappings(e){let r=E1.LineRange.join(e.map(o=>E1.LineRange.fromRangeInclusive(o.originalRange))),n=E1.LineRange.join(e.map(o=>E1.LineRange.fromRangeInclusive(o.modifiedRange)));return new t(r,n,e)}constructor(e,r,n){super(e,r),this.innerChanges=n}flip(){return new t(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new t(this.original,this.modified,[this.toRangeMapping()])}};hN.DetailedLineRangeMapping=uBe;var c9=class t{static{a(this,"RangeMapping")}static fromEdit(e){let r=e.getNewRanges();return e.replacements.map((o,s)=>new t(o.range,r[s]))}static fromEditJoin(e){let r=e.getNewRanges(),n=e.replacements.map((o,s)=>new t(o.range,r[s]));return t.join(n)}static join(e){if(e.length===0)throw new mvt.BugIndicatingError("Cannot join an empty list of range mappings");let r=e[0];for(let n=1;n${this.modifiedRange.toString()}}`}flip(){return new t(this.modifiedRange,this.originalRange)}toTextEdit(e){let r=e.getValueOfRange(this.modifiedRange);return new nFi.TextReplacement(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};hN.RangeMapping=c9;function b0c(t,e,r,n=!1){let o=[];for(let s of(0,C0c.groupAdjacentBy)(t.map(c=>iFi(c,e,r)),(c,l)=>c.original.intersectsOrTouches(l.original)||c.modified.intersectsOrTouches(l.modified))){let c=s[0],l=s[s.length-1];o.push(new uBe(c.original.join(l.original),c.modified.join(l.modified),s.map(u=>u.innerChanges[0])))}return(0,tFi.assertFn)(()=>!n&&o.length>0&&(o[0].modified.startLineNumber!==o[0].original.startLineNumber||r.length.lineCount-o[o.length-1].modified.endLineNumberExclusive!==e.length.lineCount-o[o.length-1].original.endLineNumberExclusive)?!1:(0,tFi.checkAdjacentItems)(o,(s,c)=>c.original.startLineNumber-s.original.endLineNumberExclusive===c.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExclusive=r.getLineLength(t.modifiedRange.startLineNumber)&&t.originalRange.startColumn-1>=e.getLineLength(t.originalRange.startLineNumber)&&t.originalRange.startLineNumber<=t.originalRange.endLineNumber+o&&t.modifiedRange.startLineNumber<=t.modifiedRange.endLineNumber+o&&(n=1);let s=new E1.LineRange(t.originalRange.startLineNumber+n,t.originalRange.endLineNumber+1+o),c=new E1.LineRange(t.modifiedRange.startLineNumber+n,t.modifiedRange.endLineNumber+1+o);return new uBe(s,c,[t])}a(iFi,"getLineRangeMapping");function S0c(t){let e;t.originalEndLineNumber===0?e=new E1.LineRange(t.originalStartLineNumber+1,t.originalStartLineNumber+1):e=new E1.LineRange(t.originalStartLineNumber,t.originalEndLineNumber+1);let r;return t.modifiedEndLineNumber===0?r=new E1.LineRange(t.modifiedStartLineNumber+1,t.modifiedStartLineNumber+1):r=new E1.LineRange(t.modifiedStartLineNumber,t.modifiedEndLineNumber+1),new lBe(e,r)}a(S0c,"lineRangeMappingFromChange")});var kye=I(ZR=>{"use strict";p();Object.defineProperty(ZR,"__esModule",{value:!0});ZR.DateTimeout=ZR.InfiniteTimeout=ZR.OffsetPair=ZR.SequenceDiff=ZR.DiffAlgorithmResult=void 0;var T0c=Sl(),oFi=Rs(),Rye=Ed(),UDr=class t{static{a(this,"DiffAlgorithmResult")}static trivial(e,r){return new t([new dBe(Rye.OffsetRange.ofLength(e.length),Rye.OffsetRange.ofLength(r.length))],!1)}static trivialTimedOut(e,r){return new t([new dBe(Rye.OffsetRange.ofLength(e.length),Rye.OffsetRange.ofLength(r.length))],!0)}constructor(e,r){this.diffs=e,this.hitTimeout=r}};ZR.DiffAlgorithmResult=UDr;var dBe=class t{static{a(this,"SequenceDiff")}static invert(e,r){let n=[];return(0,T0c.forEachAdjacent)(e,(o,s)=>{n.push(t.fromOffsetPairs(o?o.getEndExclusives():Qne.zero,s?s.getStarts():new Qne(r,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+r)))}),n}static fromOffsetPairs(e,r){return new t(new Rye.OffsetRange(e.offset1,r.offset1),new Rye.OffsetRange(e.offset2,r.offset2))}static assertSorted(e){let r;for(let n of e){if(r&&!(r.seq1Range.endExclusive<=n.seq1Range.start&&r.seq2Range.endExclusive<=n.seq2Range.start))throw new oFi.BugIndicatingError("Sequence diffs must be sorted");r=n}}constructor(e,r){this.seq1Range=e,this.seq2Range=r}swap(){return new t(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new t(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new t(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new t(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new t(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersectsOrTouches(e){return this.seq1Range.intersectsOrTouches(e.seq1Range)||this.seq2Range.intersectsOrTouches(e.seq2Range)}intersect(e){let r=this.seq1Range.intersect(e.seq1Range),n=this.seq2Range.intersect(e.seq2Range);if(!(!r||!n))return new t(r,n)}getStarts(){return new Qne(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Qne(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}};ZR.SequenceDiff=dBe;var Qne=class t{static{a(this,"OffsetPair")}static{this.zero=new t(0,0)}static{this.max=new t(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)}constructor(e,r){this.offset1=e,this.offset2=r}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new t(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}};ZR.OffsetPair=Qne;var QDr=class t{static{a(this,"InfiniteTimeout")}static{this.instance=new t}isValid(){return!0}};ZR.InfiniteTimeout=QDr;var qDr=class{static{a(this,"DateTimeout")}constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new oFi.BugIndicatingError("timeout must be positive")}isValid(){return!(Date.now()-this.startTime!0,this.valid=!0}};ZR.DateTimeout=qDr});var Avt=I(qne=>{"use strict";p();Object.defineProperty(qne,"__esModule",{value:!0});qne.LineRangeFragment=qne.Array2D=void 0;qne.isSpace=I0c;var jDr=class{static{a(this,"Array2D")}constructor(e,r){this.width=e,this.height=r,this.array=[],this.array=new Array(e*r)}get(e,r){return this.array[e+r*this.width]}set(e,r,n){this.array[e+r*this.width]=n}};qne.Array2D=jDr;function I0c(t){return t===32||t===9}a(I0c,"isSpace");var HDr=class t{static{a(this,"LineRangeFragment")}static{this.chrKeys=new Map}static getKey(e){let r=this.chrKeys.get(e);return r===void 0&&(r=this.chrKeys.size,this.chrKeys.set(e,r)),r}constructor(e,r,n){this.range=e,this.lines=r,this.source=n,this.histogram=[];let o=0;for(let s=e.startLineNumber-1;s{"use strict";p();Object.defineProperty(yvt,"__esModule",{value:!0});yvt.DynamicProgrammingDiffing=void 0;var sFi=Ed(),fBe=kye(),GDr=Avt(),$Dr=class{static{a(this,"DynamicProgrammingDiffing")}compute(e,r,n=fBe.InfiniteTimeout.instance,o){if(e.length===0||r.length===0)return fBe.DiffAlgorithmResult.trivial(e,r);let s=new GDr.Array2D(e.length,r.length),c=new GDr.Array2D(e.length,r.length),l=new GDr.Array2D(e.length,r.length);for(let A=0;A0&&y>0&&c.get(A-1,y-1)===3&&(v+=l.get(A-1,y-1)),v+=o?o(A,y):1):v=-1;let b=Math.max(E,_,v);if(b===v){let T=A>0&&y>0?l.get(A-1,y-1):0;l.set(A,y,T+1),c.set(A,y,3)}else b===E?(l.set(A,y,0),c.set(A,y,1)):b===_&&(l.set(A,y,0),c.set(A,y,2));s.set(A,y,b)}let u=[],d=e.length,f=r.length;function h(A,y){(A+1!==d||y+1!==f)&&u.push(new fBe.SequenceDiff(new sFi.OffsetRange(A+1,d),new sFi.OffsetRange(y+1,f))),d=A,f=y}a(h,"reportDecreasingAligningPositions");let m=e.length-1,g=r.length-1;for(;m>=0&&g>=0;)c.get(m,g)===3?(h(m,g),m--,g--):c.get(m,g)===1?m--:g--;return h(-1,-1),u.reverse(),new fBe.DiffAlgorithmResult(u,!1)}};yvt.DynamicProgrammingDiffing=$Dr});var YDr=I(_vt=>{"use strict";p();Object.defineProperty(_vt,"__esModule",{value:!0});_vt.MyersDiffAlgorithm=void 0;var cFi=Ed(),pBe=kye(),VDr=class{static{a(this,"MyersDiffAlgorithm")}compute(e,r,n=pBe.InfiniteTimeout.instance){if(e.length===0||r.length===0)return pBe.DiffAlgorithmResult.trivial(e,r);let o=e,s=r;function c(y,E){for(;yo.length||w>s.length)continue;let R=c(T,w);u.set(f,R);let x=T===v?d.get(f+1):d.get(f-1);if(d.set(f,R!==T?new Evt(x,T,w,R-T):x),u.get(f)===o.length&&u.get(f)-f===s.length)break e}}let h=d.get(f),m=[],g=o.length,A=s.length;for(;;){let y=h?h.x+h.length:0,E=h?h.y+h.length:0;if((y!==g||E!==A)&&m.push(new pBe.SequenceDiff(new cFi.OffsetRange(y,g),new cFi.OffsetRange(E,A))),!h)break;g=h.x,A=h.y,h=h.prev}return m.reverse(),new pBe.DiffAlgorithmResult(m,!1)}};_vt.MyersDiffAlgorithm=VDr;var Evt=class{static{a(this,"SnakePath")}constructor(e,r,n,o){this.prev=e,this.x=r,this.y=n,this.length=o}},WDr=class{static{a(this,"FastInt32Array")}constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,r){if(e<0){if(e=-e-1,e>=this.negativeArr.length){let n=this.negativeArr;this.negativeArr=new Int32Array(n.length*2),this.negativeArr.set(n)}this.negativeArr[e]=r}else{if(e>=this.positiveArr.length){let n=this.positiveArr;this.positiveArr=new Int32Array(n.length*2),this.positiveArr.set(n)}this.positiveArr[e]=r}}},zDr=class{static{a(this,"FastArrayNegativeIndices")}constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,r){e<0?(e=-e-1,this.negativeArr[e]=r):this.positiveArr[e]=r}}});var ZDr=I(Cvt=>{"use strict";p();Object.defineProperty(Cvt,"__esModule",{value:!0});Cvt.LinesSliceCharSequence=void 0;var KDr=Qq(),vvt=Ed(),x0c=$_(),lFi=nh(),w0c=Avt(),JDr=class{static{a(this,"LinesSliceCharSequence")}constructor(e,r,n){this.lines=e,this.range=r,this.considerWhitespaceChanges=n,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let o=this.range.startLineNumber;o<=this.range.endLineNumber;o++){let s=e[o-1],c=0;o===this.range.startLineNumber&&this.range.startColumn>1&&(c=this.range.startColumn-1,s=s.substring(c)),this.lineStartOffsets.push(c);let l=0;if(!n){let d=s.trimStart();l=s.length-d.length,s=d.trimEnd()}this.trimmedWsLengthsByLineIdx.push(l);let u=o===this.range.endLineNumber?Math.min(this.range.endColumn-1-c-l,s.length):s.length;for(let d=0;dString.fromCharCode(r)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){let r=fFi(e>0?this.elements[e-1]:-1),n=fFi(es<=e),o=e-this.firstElementOffsetByLineIdx[n];return new x0c.Position(this.range.startLineNumber+n,1+this.lineStartOffsets[n]+o+(o===0&&r==="left"?0:this.trimmedWsLengthsByLineIdx[n]))}translateRange(e){let r=this.translateOffset(e.start,"right"),n=this.translateOffset(e.endExclusive,"left");return n.isBefore(r)?lFi.Range.fromPositions(n,n):lFi.Range.fromPositions(r,n)}findWordContaining(e){if(e<0||e>=this.elements.length||!Pye(this.elements[e]))return;let r=e;for(;r>0&&Pye(this.elements[r-1]);)r--;let n=e;for(;n=this.elements.length||!Pye(this.elements[e]))return;let r=e;for(;r>0&&Pye(this.elements[r-1])&&!uFi(this.elements[r]);)r--;let n=e;for(;no<=e.start)??0,n=(0,KDr.findFirstMonotonous)(this.firstElementOffsetByLineIdx,o=>e.endExclusive<=o)??this.elements.length;return new vvt.OffsetRange(r,n)}};Cvt.LinesSliceCharSequence=JDr;function Pye(t){return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57}a(Pye,"isWordChar");function uFi(t){return t>=65&&t<=90}a(uFi,"isUpperCase");var R0c={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function dFi(t){return R0c[t]}a(dFi,"getCategoryBoundaryScore");function fFi(t){return t===10?8:t===13?7:(0,w0c.isSpace)(t)?6:t>=97&&t<=122?0:t>=65&&t<=90?1:t>=48&&t<=57?2:t===-1?3:t===44||t===59?5:4}a(fFi,"getCategory")});var gFi=I(XDr=>{"use strict";p();Object.defineProperty(XDr,"__esModule",{value:!0});XDr.computeMovedLines=N0c;var k0c=kye(),bvt=gvt(),vL=Sl(),hBe=Qq(),P0c=r2(),_1=X2(),pFi=ZDr(),Svt=Avt(),D0c=YDr(),hFi=nh();function N0c(t,e,r,n,o,s){let{moves:c,excludedChanges:l}=O0c(t,e,r,s);if(!s.isValid())return[];let u=t.filter(f=>!l.has(f)),d=L0c(u,n,o,e,r,s);return(0,vL.pushMany)(c,d),c=B0c(c),c=c.filter(f=>{let h=f.original.toOffsetRange().slice(e).map(g=>g.trim());return h.join(` +`).length>=15&&M0c(h,g=>g.length>=2)>=2}),c=F0c(t,c),c}a(N0c,"computeMovedLines");function M0c(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(M0c,"countWhere");function O0c(t,e,r,n){let o=[],s=t.filter(u=>u.modified.isEmpty&&u.original.length>=3).map(u=>new Svt.LineRangeFragment(u.original,e,u)),c=new Set(t.filter(u=>u.original.isEmpty&&u.modified.length>=3).map(u=>new Svt.LineRangeFragment(u.modified,r,u))),l=new Set;for(let u of s){let d=-1,f;for(let h of c){let m=u.computeSimilarity(h);m>d&&(d=m,f=h)}if(d>.9&&f&&(c.delete(f),o.push(new bvt.LineRangeMapping(u.range,f.range)),l.add(u.source),l.add(f.source)),!n.isValid())return{moves:o,excludedChanges:l}}return{moves:o,excludedChanges:l}}a(O0c,"computeMovesFromSimpleDeletionsToSimpleInsertions");function L0c(t,e,r,n,o,s){let c=[],l=new P0c.SetMap;for(let m of t)for(let g=m.original.startLineNumber;gm.modified.startLineNumber,vL.numberComparator));for(let m of t){let g=[];for(let A=m.modified.startLineNumber;A{for(let T of g)if(T.originalLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive&&T.modifiedLineRange.endLineNumberExclusive+1===E.endLineNumberExclusive){T.originalLineRange=new _1.LineRange(T.originalLineRange.startLineNumber,v.endLineNumberExclusive),T.modifiedLineRange=new _1.LineRange(T.modifiedLineRange.startLineNumber,E.endLineNumberExclusive),_.push(T);return}let b={modifiedLineRange:E,originalLineRange:v};u.push(b),_.push(b)}),g=_}if(!s.isValid())return[]}u.sort((0,vL.reverseOrder)((0,vL.compareBy)(m=>m.modifiedLineRange.length,vL.numberComparator)));let d=new _1.LineRangeSet,f=new _1.LineRangeSet;for(let m of u){let g=m.modifiedLineRange.startLineNumber-m.originalLineRange.startLineNumber,A=d.subtractFrom(m.modifiedLineRange),y=f.subtractFrom(m.originalLineRange).getWithDelta(g),E=A.getIntersection(y);for(let _ of E.ranges){if(_.length<3)continue;let v=_,b=_.delta(-g);c.push(new bvt.LineRangeMapping(b,v)),d.addRange(v),f.addRange(b)}}c.sort((0,vL.compareBy)(m=>m.original.startLineNumber,vL.numberComparator));let h=new hBe.MonotonousArray(t);for(let m=0;mR.original.startLineNumber<=g.original.startLineNumber),y=(0,hBe.findLastMonotonous)(t,R=>R.modified.startLineNumber<=g.modified.startLineNumber),E=Math.max(g.original.startLineNumber-A.original.startLineNumber,g.modified.startLineNumber-y.modified.startLineNumber),_=h.findLastMonotonous(R=>R.original.startLineNumberR.modified.startLineNumbern.length||x>o.length||d.contains(x)||f.contains(R)||!mFi(n[R-1],o[x-1],s))break}T>0&&(f.addRange(new _1.LineRange(g.original.startLineNumber-T,g.original.startLineNumber)),d.addRange(new _1.LineRange(g.modified.startLineNumber-T,g.modified.startLineNumber)));let w;for(w=0;wn.length||x>o.length||d.contains(x)||f.contains(R)||!mFi(n[R-1],o[x-1],s))break}w>0&&(f.addRange(new _1.LineRange(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+w)),d.addRange(new _1.LineRange(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+w))),(T>0||w>0)&&(c[m]=new bvt.LineRangeMapping(new _1.LineRange(g.original.startLineNumber-T,g.original.endLineNumberExclusive+w),new _1.LineRange(g.modified.startLineNumber-T,g.modified.endLineNumberExclusive+w)))}return c}a(L0c,"computeUnchangedMoves");function mFi(t,e,r){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;let o=new D0c.MyersDiffAlgorithm().compute(new pFi.LinesSliceCharSequence([t],new hFi.Range(1,1,1,t.length),!1),new pFi.LinesSliceCharSequence([e],new hFi.Range(1,1,1,e.length),!1),r),s=0,c=k0c.SequenceDiff.invert(o.diffs,t.length);for(let f of c)f.seq1Range.forEach(h=>{(0,Svt.isSpace)(t.charCodeAt(h))||s++});function l(f){let h=0;for(let m=0;me.length?t:e);return s/u>.6&&u>10}a(mFi,"areLinesSimilar");function B0c(t){if(t.length===0)return t;t.sort((0,vL.compareBy)(r=>r.original.startLineNumber,vL.numberComparator));let e=[t[0]];for(let r=1;r=0&&c>=0&&s+c<=2){e[e.length-1]=n.join(o);continue}e.push(o)}return e}a(B0c,"joinCloseConsecutiveMoves");function F0c(t,e){let r=new hBe.MonotonousArray(t);return e=e.filter(n=>{let o=r.findLastMonotonous(l=>l.original.startLineNumberl.modified.startLineNumber{"use strict";p();Object.defineProperty(jne,"__esModule",{value:!0});jne.optimizeSequenceDiffs=Q0c;jne.removeShortMatches=j0c;jne.extendDiffsToEntireWordIfAppropriate=H0c;jne.removeVeryShortMatchingLinesBetweenDiffs=$0c;jne.removeVeryShortMatchingTextBetweenLongDiffs=V0c;var U0c=Sl(),CL=Ed(),bL=kye();function Q0c(t,e,r){let n=r;return n=AFi(t,e,n),n=AFi(t,e,n),n=q0c(t,e,n),n}a(Q0c,"optimizeSequenceDiffs");function AFi(t,e,r){if(r.length===0)return r;let n=[];n.push(r[0]);for(let s=1;s0&&(l=l.delta(d))}o.push(l)}return n.length>0&&o.push(n[n.length-1]),o}a(AFi,"joinSequenceDiffsByShifting");function q0c(t,e,r){if(!t.getBoundaryScore||!e.getBoundaryScore)return r;for(let n=0;n0?r[n-1]:void 0,s=r[n],c=n+1=n.start&&t.seq2Range.start-c>=o.start&&r.isStronglyEqual(t.seq2Range.start-c,t.seq2Range.endExclusive-c)&&c<100;)c++;c--;let l=0;for(;t.seq1Range.start+ld&&(d=A,u=f)}return t.delta(u)}a(yFi,"shiftDiffToBetterPosition");function j0c(t,e,r){let n=[];for(let o of r){let s=n[n.length-1];if(!s){n.push(o);continue}o.seq1Range.start-s.seq1Range.endExclusive<=2||o.seq2Range.start-s.seq2Range.endExclusive<=2?n[n.length-1]=new bL.SequenceDiff(s.seq1Range.join(o.seq1Range),s.seq2Range.join(o.seq2Range)):n.push(o)}return n}a(j0c,"removeShortMatches");function H0c(t,e,r,n,o=!1){let s=bL.SequenceDiff.invert(r,t.length),c=[],l=new bL.OffsetPair(0,0);function u(f,h){if(f.offset10;){let v=s[0];if(!(v.seq1Range.intersects(A.seq1Range)||v.seq2Range.intersects(A.seq2Range)))break;let T=n(t,v.seq1Range.start),w=n(e,v.seq2Range.start),R=new bL.SequenceDiff(T,w),x=R.intersect(v);if(E+=x.seq1Range.length,_+=x.seq2Range.length,A=A.join(R),A.seq1Range.endExclusive>=v.seq1Range.endExclusive)s.shift();else break}(o&&E+_0;){let f=s.shift();f.seq1Range.isEmpty||(u(f.getStarts(),f),u(f.getEndExclusives().delta(-1),f))}return G0c(r,c)}a(H0c,"extendDiffsToEntireWordIfAppropriate");function G0c(t,e){let r=[];for(;t.length>0||e.length>0;){let n=t[0],o=e[0],s;n&&(!o||n.seq1Range.start0&&r[r.length-1].seq1Range.endExclusive>=s.seq1Range.start?r[r.length-1]=r[r.length-1].join(s):r.push(s)}return r}a(G0c,"mergeSequenceDiffs");function $0c(t,e,r){let n=r;if(n.length===0)return n;let o=0,s;do{s=!1;let c=[n[0]];for(let l=1;l5||g.seq1Range.length+g.seq2Range.length>5)};a(f,"shouldJoinDiffs");let u=n[l],d=c[c.length-1];f(d,u)?(s=!0,c[c.length-1]=c[c.length-1].join(u)):c.push(u)}n=c}while(o++<10&&s);return n}a($0c,"removeVeryShortMatchingLinesBetweenDiffs");function V0c(t,e,r){let n=r;if(n.length===0)return n;let o=0,s;do{s=!1;let l=[n[0]];for(let u=1;u5||y.length>500)return!1;let _=t.getText(y).trim();if(_.length>20||_.split(/\r\n|\r|\n/).length>1)return!1;let v=t.countLinesIn(g.seq1Range),b=g.seq1Range.length,T=e.countLinesIn(g.seq2Range),w=g.seq2Range.length,R=t.countLinesIn(A.seq1Range),x=A.seq1Range.length,P=e.countLinesIn(A.seq2Range),D=A.seq2Range.length,N=130;function L(B){return Math.min(B,N)}return a(L,"cap"),Math.pow(Math.pow(L(v*40+b),1.5)+Math.pow(L(T*40+w),1.5),1.5)+Math.pow(Math.pow(L(R*40+x),1.5)+Math.pow(L(P*40+D),1.5),1.5)>(N**1.5)**1.5*1.3};a(h,"shouldJoinDiffs");let d=n[u],f=l[l.length-1];h(f,d)?(s=!0,l[l.length-1]=l[l.length-1].join(d)):l.push(d)}n=l}while(o++<10&&s);let c=[];return(0,U0c.forEachWithNeighbors)(n,(l,u,d)=>{let f=u;function h(_){return _.length>0&&_.trim().length<=3&&u.seq1Range.length+u.seq2Range.length>100}a(h,"shouldMarkAsChanged");let m=t.extendToFullLines(u.seq1Range),g=t.getText(new CL.OffsetRange(m.start,u.seq1Range.start));h(g)&&(f=f.deltaStart(-g.length));let A=t.getText(new CL.OffsetRange(u.seq1Range.endExclusive,m.endExclusive));h(A)&&(f=f.deltaEnd(A.length));let y=bL.SequenceDiff.fromOffsetPairs(l?l.getEndExclusives():bL.OffsetPair.zero,d?d.getStarts():bL.OffsetPair.max),E=f.intersect(y);c.length>0&&E.getStarts().equals(c[c.length-1].getEndExclusives())?c[c.length-1]=c[c.length-1].join(E):c.push(E)}),c}a(V0c,"removeVeryShortMatchingTextBetweenLongDiffs")});var vFi=I(Tvt=>{"use strict";p();Object.defineProperty(Tvt,"__esModule",{value:!0});Tvt.LineSequence=void 0;var eNr=class{static{a(this,"LineSequence")}constructor(e,r){this.trimmedHash=e,this.lines=r}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){let r=e===0?0:_Fi(this.lines[e-1]),n=e===this.lines.length?0:_Fi(this.lines[e]);return 1e3-(r+n)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` +`)}isStronglyEqual(e,r){return this.lines[e]===this.lines[r]}};Tvt.LineSequence=eNr;function _Fi(t){let e=0;for(;e{"use strict";p();Object.defineProperty(Rvt,"__esModule",{value:!0});Rvt.DefaultLinesDiffComputer=void 0;var W0c=Sl(),CFi=sd(),wvt=X2(),bFi=Ed(),SFi=nh(),Ivt=$T(),xvt=FDr(),Gne=gvt(),SL=kye(),z0c=aFi(),Y0c=YDr(),K0c=gFi(),Hne=EFi(),TFi=vFi(),IFi=ZDr(),tNr=class{static{a(this,"DefaultLinesDiffComputer")}constructor(){this.dynamicProgrammingDiffing=new z0c.DynamicProgrammingDiffing,this.myersDiffingAlgorithm=new Y0c.MyersDiffAlgorithm}computeDiff(e,r,n){if(e.length<=1&&(0,W0c.equals)(e,r,(x,P)=>x===P))return new xvt.LinesDiff([],[],!1);if(e.length===1&&e[0].length===0||r.length===1&&r[0].length===0)return new xvt.LinesDiff([new Gne.DetailedLineRangeMapping(new wvt.LineRange(1,e.length+1),new wvt.LineRange(1,r.length+1),[new Gne.RangeMapping(new SFi.Range(1,1,e.length,e[e.length-1].length+1),new SFi.Range(1,1,r.length,r[r.length-1].length+1))])],[],!1);let o=n.maxComputationTimeMs===0?SL.InfiniteTimeout.instance:new SL.DateTimeout(n.maxComputationTimeMs),s=!n.ignoreTrimWhitespace,c=new Map;function l(x){let P=c.get(x);return P===void 0&&(P=c.size,c.set(x,P)),P}a(l,"getOrCreateHash");let u=e.map(x=>l(x.trim())),d=r.map(x=>l(x.trim())),f=new TFi.LineSequence(u,e),h=new TFi.LineSequence(d,r),m=f.length+h.length<1700?this.dynamicProgrammingDiffing.compute(f,h,o,(x,P)=>e[x]===r[P]?r[P].length===0?.1:1+Math.log(1+r[P].length):.99):this.myersDiffingAlgorithm.compute(f,h,o),g=m.diffs,A=m.hitTimeout;g=(0,Hne.optimizeSequenceDiffs)(f,h,g),g=(0,Hne.removeVeryShortMatchingLinesBetweenDiffs)(f,h,g);let y=[],E=a(x=>{if(s)for(let P=0;Px.seq1Range.start-_===x.seq2Range.start-v);let P=x.seq1Range.start-_;E(P),_=x.seq1Range.endExclusive,v=x.seq2Range.endExclusive;let D=this.refineDiff(e,r,x,o,s,n);D.hitTimeout&&(A=!0);for(let N of D.mappings)y.push(N)}E(e.length-_);let b=new Ivt.ArrayText(e),T=new Ivt.ArrayText(r),w=(0,Gne.lineRangeMappingFromRangeMappings)(y,b,T),R=[];return n.computeMoves&&(R=this.computeMoves(w,e,r,u,d,o,s,n)),(0,CFi.assertFn)(()=>{function x(D,N){if(D.lineNumber<1||D.lineNumber>N.length)return!1;let L=N[D.lineNumber-1];return!(D.column<1||D.column>L.length+1)}a(x,"validatePosition");function P(D,N){return!(D.startLineNumber<1||D.startLineNumber>N.length+1||D.endLineNumberExclusive<1||D.endLineNumberExclusive>N.length+1)}a(P,"validateRange");for(let D of w){if(!D.innerChanges)return!1;for(let N of D.innerChanges)if(!(x(N.modifiedRange.getStartPosition(),r)&&x(N.modifiedRange.getEndPosition(),r)&&x(N.originalRange.getStartPosition(),e)&&x(N.originalRange.getEndPosition(),e)))return!1;if(!P(D.modified,r)||!P(D.original,e))return!1}return!0}),new xvt.LinesDiff(w,R,A)}computeMoves(e,r,n,o,s,c,l,u){return(0,K0c.computeMovedLines)(e,r,n,o,s,c).map(h=>{let m=this.refineDiff(r,n,new SL.SequenceDiff(h.original.toOffsetRange(),h.modified.toOffsetRange()),c,l,u),g=(0,Gne.lineRangeMappingFromRangeMappings)(m.mappings,new Ivt.ArrayText(r),new Ivt.ArrayText(n),!0);return new xvt.MovedText(h,g)})}refineDiff(e,r,n,o,s,c){let u=J0c(n).toRangeMapping2(e,r),d=new IFi.LinesSliceCharSequence(e,u.originalRange,s),f=new IFi.LinesSliceCharSequence(r,u.modifiedRange,s),h=d.length+f.length<500?this.dynamicProgrammingDiffing.compute(d,f,o):this.myersDiffingAlgorithm.compute(d,f,o),m=!1,g=h.diffs;m&&SL.SequenceDiff.assertSorted(g),g=(0,Hne.optimizeSequenceDiffs)(d,f,g),m&&SL.SequenceDiff.assertSorted(g),g=(0,Hne.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findWordContaining(E)),m&&SL.SequenceDiff.assertSorted(g),c.extendToSubwords&&(g=(0,Hne.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findSubWordContaining(E),!0),m&&SL.SequenceDiff.assertSorted(g)),g=(0,Hne.removeShortMatches)(d,f,g),m&&SL.SequenceDiff.assertSorted(g),g=(0,Hne.removeVeryShortMatchingTextBetweenLongDiffs)(d,f,g),m&&SL.SequenceDiff.assertSorted(g);let A=g.map(y=>new Gne.RangeMapping(d.translateRange(y.seq1Range),f.translateRange(y.seq2Range)));return m&&Gne.RangeMapping.assertSorted(A),{mappings:A,hitTimeout:h.hitTimeout}}};Rvt.DefaultLinesDiffComputer=tNr;function J0c(t){return new Gne.LineRangeMapping(new wvt.LineRange(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new wvt.LineRange(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}a(J0c,"toLineRangeMapping")});var nNr=I(qv=>{"use strict";p();Object.defineProperty(qv,"__esModule",{value:!0});qv.EditDataWithIndex=qv.maxImperfectAgreementLength=qv.maxAgreementOffset=void 0;qv.tryRebase=rgc;qv.checkEditConsistency=wFi;qv.tryRebaseStringEdits=igc;var Z0c=fN(),X0c=nv(),XE=ME(),Dye=Ed(),xFi=$T(),egc=rNr(),tgc=!1;qv.maxAgreementOffset=10;qv.maxImperfectAgreementLength=5;var kvt=class{static{a(this,"EditDataWithIndex")}constructor(e){this.index=e}join(e){if(this.index===e.index)return this}};qv.EditDataWithIndex=kvt;function rgc(t,e,r,n,o,s,c,l,u,d={maxImperfectAgreementLength:qv.maxImperfectAgreementLength}){let f=Date.now();try{return ngc(t,e,r,n,o,s,c,l,u,d)}catch(h){return u.trace(`Rebase error: ${X0c.ErrorUtils.toString(h)}`),"error"}finally{u.trace(`Rebase duration: ${Date.now()-f}ms`)}}a(rgc,"tryRebase");function ngc(t,e,r,n,o,s,c,l,u,d){if(!wFi(t,o,s,u,!0))return"inconsistentEdits";let f=o.removeCommonSuffixAndPrefix(t),h=c[0];if(e&&h&&!f.applyToOffsetRangeOrUndefined(e)?.containsRange(h))return"outsideEditWindow";if(n.lengthXE.AnnotatedStringEdit.create(E))),g=RFi(t,m,f,l,d);if(!g)return"rebaseFailed";let A=g.replacements.reduce((E,_)=>((E[_.data.index]||=[]).push(_),E),[]),y=[];for(let E=0;ER>0?s.substring(x[R-1].replaceRange.endExclusive,w.replaceRange.start)+w.newText:w.newText).join(""),T=XE.StringReplacement.replace(v,b);T.removeCommonSuffixAndPrefix(s).isEmpty||y.push({rebasedEdit:T,rebasedEditIndex:E})}return l==="strict"&&y.length>0&&new Z0c.SingleEdits(r).apply(t)!==XE.StringEdit.create(y.map(E=>E.rebasedEdit)).apply(s)?(u.trace("Result consistency check failed"),"inconsistentEdits"):y}a(ngc,"_tryRebase");function wFi(t,e,r,n,o=tgc){if(!o)return!0;let s=e.apply(t)===r;return s||n.trace("Edit consistency check failed"),s}a(wFi,"checkEditConsistency");function igc(t,e,r,n,o={maxImperfectAgreementLength:qv.maxImperfectAgreementLength}){return RFi(t,e.mapData(s=>new XE.VoidEditData),r,n,o)?.toStringEdit()}a(igc,"tryRebaseStringEdits");function RFi(t,e,r,n,o){let s=r.removeCommonSuffixAndPrefix(t),c=[],l=0,u=0,d=0;for(;uf.replaceRange.start){let g=t.substring(f.replaceRange.start,m.replaceRange.start),A=g+m.newText;A.endsWith(g)&&(m=new XE.AnnotatedStringReplacement(Dye.OffsetRange.fromTo(f.replaceRange.start,m.replaceRange.endExclusive-g.length),A.substring(0,A.length-g.length),m.data))}else if(u===e.replacements.length-1&&m.replaceRange.endExclusive=f.newText.length){let g=0,A=0,y=f,E;for(;y&&m.replaceRange.containsRange(y.replaceRange);){if(A=cgc(t,m,y,E,A,n,o),A===-1)return;g+=y.newText.length-y.replaceRange.length,E=y,y=s.replacements[++l]}c.push(new XE.AnnotatedStringReplacement(new Dye.OffsetRange(m.replaceRange.start+d,m.replaceRange.endExclusive+d+g),m.newText,m.data)),u++,d+=g}else if(o.reverseAgreement&&h.replaceRange.equals(f.replaceRange)){let g=0,A;for(;uqv.maxAgreementOffset||b-g>0&&v.length>o.maxImperfectAgreementLength);if(b!==-1&&!T){g=b+v.length,A=y,u++;continue}let w=f.newText.substring(g);if(w.length>0&&v.startsWith(w)){let R=Math.max(0,w.length-_.length),x=y.newText.substring(R);x.length>0&&c.push(new XE.AnnotatedStringReplacement(Dye.OffsetRange.emptyAt(f.replaceRange.start+d+f.newText.length),x,y.data)),g=f.newText.length,A=y,u++;break}return}if(g0&&!f.newText.substring(g).startsWith(E))return}l++,d+=f.newText.length-f.replaceRange.length}else return;else if(h.replaceRange.start",'""',"''","``"]);function agc(t){return sgc.has(t)}a(agc,"isAutoClosePair");function cgc(t,e,r,n,o,s,c){let l=r.newText,u=n?n.replaceRange.endExclusive:e.replaceRange.start;uqv.maxAgreementOffset||d>0&&r.newText.length>c.maxImperfectAgreementLength);return d!==-1&&!f?d+r.newText.length:c.absorbSubsequenceTyping&&agc(l)&&ogc(l,e.newText.substring(o))?o:-1}a(cgc,"agreementIndexOf");function lgc(t,e,r,n,o){let s=t.split(/\r\n|\r|\n/),c=e.split(/\r\n|\r|\n/),u=new egc.DefaultLinesDiffComputer().computeDiff(s,c,o);if(u.hitTimeout)return;let d=new xFi.StringText(t),f=new xFi.StringText(e);return u.changes.map(h=>(h.innerChanges||[]).map(m=>{let g=d.getTransformer().getOffsetRange(m.originalRange),A=f.getValueOfRange(m.modifiedRange);return new XE.AnnotatedStringReplacement(g.delta(r),A,n)})).flat()}a(lgc,"computeDiff")});var PFi=I(Pvt=>{"use strict";p();Object.defineProperty(Pvt,"__esModule",{value:!0});Pvt.RejectionCollector=void 0;var ugc=g4(),kFi=Ro(),dgc=tD(),iNr=class extends kFi.Disposable{static{a(this,"RejectionCollector")}constructor(e,r){super(),this.workspace=e,this._garbageCollector=this._register(new aNr(20)),this._documentCaches=new Map,this._logger=r.createSubLogger(["NES","RejectionCollector"]),(0,dgc.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=new oNr(n,this._garbageCollector,this._logger);this._documentCaches.set(s.doc.id,s),o.add((0,ugc.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},c=>{for(let l of c.value.changes)s.handleEdit(l,c.value.value)})),o.add((0,kFi.toDisposable)(()=>{this._documentCaches.delete(n.id)}))}).recomputeInitiallyAndOnChange(this._store)}reject(e,r){let n=this._documentCaches.get(e);if(!n){this._logger.trace(`Rejecting, no document cache: ${r}`);return}let o=r.removeCommonSuffixAndPrefix(n.doc.value.get().value);this._logger.trace(`Rejecting: ${o}`),n.reject(o)}isRejected(e,r){let n=this._documentCaches.get(e);if(!n)return this._logger.trace(`Checking rejection, no document cache: ${r}`),!1;let o=r.removeCommonSuffixAndPrefix(n.doc.value.get().value),s=n.isRejected(o);return this._logger.trace(`Checking rejection, ${s?"rejected":"not rejected"}: ${o}`),s}clear(){this._garbageCollector.clear()}};Pvt.RejectionCollector=iNr;var oNr=class{static{a(this,"DocumentRejectionTracker")}constructor(e,r,n){this.doc=e,this._garbageCollector=r,this._logger=n,this._rejectedEdits=new Set}handleEdit(e,r){for(let n of[...this._rejectedEdits])n.handleEdit(e,r)}reject(e){if(this.isRejected(e))return;let r=new sNr(e.toEdit(),()=>{this._logger.trace(`Evicting: ${e}`),this._rejectedEdits.delete(r)});this._rejectedEdits.add(r),this._garbageCollector.put(r)}isRejected(e){for(let r of this._rejectedEdits)if(r.isRejected(e))return!0;return!1}},sNr=class{static{a(this,"RejectedEdit")}constructor(e,r){this._edit=e,this._onDispose=r}handleEdit(e,r){let n=this._edit.tryRebase(e);n?this._edit=n.removeCommonSuffixAndPrefix(r.value):this.dispose()}isRejected(e){return this._edit.equals(e.toEdit())}dispose(){this._onDispose()}},aNr=class{static{a(this,"LRUGarbageCollector")}constructor(e){this._maxSize=e,this._disposables=[]}put(e){this._disposables.push(e),this._disposables.length>this._maxSize&&this._disposables.shift().dispose()}clear(){for(let e of this._disposables)e.dispose();this._disposables=[]}dispose(){this.clear()}}});var lNr=I(Nye=>{"use strict";p();Object.defineProperty(Nye,"__esModule",{value:!0});Nye.DisposablesLRUCache=Nye.LRUCache=void 0;var mBe=class{static{a(this,"Node")}constructor(e,r){this.prev=null,this.next=null,this.key=e,this.value=r}},Dvt=class{static{a(this,"LRUCache")}constructor(e=10){if(e<1)throw new Error("Cache size must be at least 1");this._capacity=e,this._cache=new Map,this._head=new mBe("",null),this._tail=new mBe("",null),this._head.next=this._tail,this._tail.prev=this._head}_addNode(e){e.prev=this._head,e.next=this._head.next,this._head.next.prev=e,this._head.next=e}_removeNode(e){let r=e.prev,n=e.next;r.next=n,n.prev=r}_moveToHead(e){this._removeNode(e),this._addNode(e)}_popTail(){let e=this._tail.prev;return this._removeNode(e),e}clear(){this._cache.clear(),this._head.next=this._tail,this._tail.prev=this._head}deleteKey(e){let r=this._cache.get(e);if(r)return this._removeNode(r),this._cache.delete(e),r.value}get(e){let r=this._cache.get(e);if(r)return this._moveToHead(r),r.value}keys(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push(r.key),r=r.next;return e}getValues(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push(r.value),r=r.next;return e}put(e,r){let n=this._cache.get(e);if(n)n.value=r,this._moveToHead(n);else if(n=new mBe(e,r),this._cache.set(e,n),this._addNode(n),this._cache.size>this._capacity){let o=this._popTail();return this._cache.delete(o.key),[o.key,o.value]}}entries(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push([r.key,r.value]),r=r.next;return e}};Nye.LRUCache=Dvt;var cNr=class{static{a(this,"DisposablesLRUCache")}constructor(e){this.actual=new Dvt(e)}dispose(){this.clear()}clear(){let e=this.actual.getValues();for(let r of e)r.dispose();this.actual.clear()}deleteKey(e){let r=this.actual.deleteKey(e);r&&r.dispose()}get(e){return this.actual.get(e)}keys(){return this.actual.keys()}getValues(){return this.actual.getValues()}put(e,r){let n=this.actual.put(e,r);n&&n[1].dispose()}};Nye.DisposablesLRUCache=cNr});var DFi=I(Mvt=>{"use strict";p();Object.defineProperty(Mvt,"__esModule",{value:!0});Mvt.RebaseFailureInfo=void 0;var fgc=ME(),uNr=class{static{a(this,"RebaseFailureInfo")}constructor(e,r,n,o,s,c,l){this.originalDocument=e,this.editWindow=r,this.originalEdits=n,this.userEditSince=o,this.currentDocument=s,this.currentSelection=c,this.nesRebaseConfigs=l}toMarkdown(){let e=[];e.push("### Original Document"),e.push("```"),e.push(this.originalDocument),e.push("```"),e.push(""),e.push("### Suggested Edits");for(let r=0;r0&&(e.push(""),e.push(`### Cursor: ${this.currentSelection.map(r=>r.toString()).join(", ")}`)),e.push(""),e.push("### Document Intended After Suggested Edits"),e.push("```");try{let r=new fgc.StringEdit(this.originalEdits.slice()).apply(this.originalDocument);e.push(r)}catch{e.push("")}return e.push("```"),e.push(""),e.push("### Copy-Pasteable Test"),e.push("```typescript"),e.push(this._generateTest()),e.push("```"),e.join(` +`)}_generateTest(){let e=[];e.push("test('rebase failure (auto-generated)', () => {"),e.push(` const originalDocument = ${Nvt(this.originalDocument)};`),e.push(" const originalEdits = [");for(let o of this.originalEdits)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${Nvt(o.newText)}),`);e.push(" ];"),e.push(" const userEditSince = StringEdit.create([");for(let o of this.userEditSince.replacements)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${Nvt(o.newText)}),`);e.push(" ]);"),e.push(` const currentDocumentContent = ${Nvt(this.currentDocument)};`),this.editWindow?e.push(` const editWindow = new OffsetRange(${this.editWindow.start}, ${this.editWindow.endExclusive});`):e.push(" const editWindow = undefined;"),e.push(` const currentSelection = [${this.currentSelection.map(o=>`new OffsetRange(${o.start}, ${o.endExclusive})`).join(", ")}];`);let r=[];return this.nesRebaseConfigs.absorbSubsequenceTyping&&r.push(`absorbSubsequenceTyping: ${this.nesRebaseConfigs.absorbSubsequenceTyping}`),this.nesRebaseConfigs.reverseAgreement&&r.push(`reverseAgreement: ${this.nesRebaseConfigs.reverseAgreement}`),r.push(`maxImperfectAgreementLength: ${this.nesRebaseConfigs.maxImperfectAgreementLength}`),e.push(` const nesConfigs = { ${r.join(", ")} };`),e.push(""),e.push(" const logger = new TestLogService();"),e.push(" expect(userEditSince.apply(originalDocument)).toBe(currentDocumentContent);"),e.push(" expect(tryRebase(originalDocument, editWindow, originalEdits, [], userEditSince, currentDocumentContent, currentSelection, 'strict', logger, nesConfigs)).toMatchInlineSnapshot();"),e.push("});"),e.join(` +`)}};Mvt.RebaseFailureInfo=uNr;function Nvt(t){return"`"+t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")+"`"}a(Nvt,"toBacktickLiteral")});var MFi=I(Lvt=>{"use strict";p();Object.defineProperty(Lvt,"__esModule",{value:!0});Lvt.NextEditCache=void 0;var gBe=Pl(),pgc=g4(),hgc=lNr(),NFi=Ro(),mgc=D8(),Ovt=nNr(),ggc=DFi(),dNr=class extends NFi.Disposable{static{a(this,"NextEditCache")}constructor(e,r,n,o){super(),this.workspace=e,this._logService=r,this._configService=n,this._expService=o,this._documentCaches=new Map,this._sharedCache=new hgc.LRUCache(50),(0,mgc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{let l=new fNr(this,s.id,s,this._sharedCache,this._logService);this._documentCaches.set(l.docId,l),c.add((0,pgc.autorunWithChanges)(this,{value:s.value},u=>{for(let d of u.value.changes)d.isEmpty()||l.handleEdit(d);if(this._configService.getExperimentBasedConfig(gBe.ConfigKey.Advanced.InlineEditsTriggerOnEditorChangeAfterSeconds,this._expService)!==void 0)for(let[d,f]of this._sharedCache.entries())f.docId!==s.id&&this._sharedCache.deleteKey(d)})),c.add((0,NFi.toDisposable)(()=>{this._documentCaches.delete(s.id)}))}).recomputeInitiallyAndOnChange(this._store)}setKthNextEdit(e,r,n,o,s,c,l,u,d){let f=this._documentCaches.get(e);if(f)return f.setKthNextEdit(r,n,o,c,l,s,u,d)}setNoNextEdit(e,r,n,o){let s=this._documentCaches.get(e);s&&s.setNoNextEdit(r,n,o)}_getNesRebaseConfigs(){let e=this._configService.getExperimentBasedConfig(gBe.ConfigKey.TeamInternal.InlineEditsMaxImperfectAgreementLength,this._expService);return{absorbSubsequenceTyping:this._configService.getExperimentBasedConfig(gBe.ConfigKey.TeamInternal.InlineEditsAbsorbSubsequenceTyping,this._expService),reverseAgreement:this._configService.getExperimentBasedConfig(gBe.ConfigKey.TeamInternal.InlineEditsReverseAgreement,this._expService),maxImperfectAgreementLength:typeof e=="number"?Math.max(0,e):e}}lookupNextEdit(e,r,n){let o=this._documentCaches.get(e);if(!o)return;let s=this._configService.getExperimentBasedConfig(gBe.ConfigKey.TeamInternal.InlineEditsCacheCursorDistanceCheck,this._expService)??!1;return o.lookupNextEdit(r,n,this._getNesRebaseConfigs(),s)}tryRebaseCacheEntry(e,r,n){let o=this._documentCaches.get(e.docId);return o?o.tryRebaseCacheEntry(e,r,n,this._getNesRebaseConfigs()):{edit:void 0}}rejectedNextEdit(e){this._sharedCache.getValues().filter(r=>r.source.headerRequestId===e).forEach(r=>r.rejected=!0)}isRejectedNextEdit(e,r,n){let o=this._documentCaches.get(e);return o?o.isRejectedNextEdit(r,n):!1}evictedCachedEdit(e){let r=this._documentCaches.get(e.docId);r&&r.evictedCachedEdit(e)}clear(){this._documentCaches.forEach(e=>e.clear()),this._sharedCache.clear()}};Lvt.NextEditCache=dNr;var fNr=class{static{a(this,"DocumentEditCache")}constructor(e,r,n,o,s){this._nextEditCache=e,this.docId=r,this._doc=n,this._sharedCache=o,this._trackedCachedEdits=[],this._logger=s.createSubLogger(["NES","DocumentEditCache"])}handleEdit(e){let r=this._logger.createSubLogger("handleEdit");for(let n of this._trackedCachedEdits)n.userEditSince&&(n.userEditSince=n.userEditSince.compose(e),n.rebaseFailed=!1,(0,Ovt.checkEditConsistency)(n.documentBeforeEdit.value,n.userEditSince,this._doc.value.get().value,r)||(n.userEditSince=void 0))}evictedCachedEdit(e){let r=this._trackedCachedEdits.indexOf(e);r!==-1&&this._trackedCachedEdits.splice(r,1)}clear(){this._trackedCachedEdits.length=0}setKthNextEdit(e,r,n,o,s,c,l,u){let d=this._getKey(e.value),f={docId:this.docId,edit:n,edits:o,detailedEdits:[],userEditSince:s,subsequentN:c,source:l,documentBeforeEdit:e,editWindow:r,originalEditWindow:u.originalEditWindow,cacheTime:Date.now(),isFromCursorJump:u.isFromCursorJump,cursorOffsetAtCacheTime:u.cursorOffset};s&&((0,Ovt.checkEditConsistency)(f.documentBeforeEdit.value,s,this._doc.value.get().value,this._logger.createSubLogger("setKthNextEdit"))?this._trackedCachedEdits.unshift(f):f.userEditSince=void 0);let h=this._sharedCache.get(d);h&&this.evictedCachedEdit(h);let m=this._sharedCache.put(d,f);return m&&this._nextEditCache.evictedCachedEdit(m[1]),f}setNoNextEdit(e,r,n){let o=this._getKey(e.value),s={docId:this.docId,edit:void 0,edits:[],detailedEdits:[],source:n,documentBeforeEdit:e,editWindow:r,cacheTime:Date.now(),isFromCursorJump:!1},c=this._sharedCache.get(o);c&&this.evictedCachedEdit(c);let l=this._sharedCache.put(o,s);l&&this._nextEditCache.evictedCachedEdit(l[1])}lookupNextEdit(e,r,n,o=!1){let s=this._getKey(e.value),c=this._sharedCache.get(s);if(c){let l=c.editWindow,u=c.originalEditWindow,d=r[0],f=l?.containsRange(d),h=u?.containsRange(d);if(l&&!f&&!h)return;if(o&&c.edit&&(c.subsequentN===void 0||c.subsequentN===0)&&c.cursorOffsetAtCacheTime!==void 0&&d){let m=e.getTransformer(),g=m.getPosition(c.edit.replaceRange.start).lineNumber,A=m.getPosition(c.cursorOffsetAtCacheTime).lineNumber,y=m.getPosition(d.start).lineNumber;if(Math.abs(y-g)>Math.abs(A-g))return c.rejected=!0,c}return c}for(let l of this._trackedCachedEdits){let u=this.tryRebaseCacheEntry(l,e,r,n);if(u.edit)return u.edit}}tryRebaseCacheEntry(e,r,n,o){let s=this._logger.createSubLogger("tryRebaseCacheEntry");if(e.userEditSince&&!e.rebaseFailed){let c=e.edits||(e.edit?[e.edit]:[]),l=e.originalEditWindow?[e.editWindow,e.originalEditWindow]:[e.editWindow];for(let u of l){let d=(0,Ovt.tryRebase)(e.documentBeforeEdit.value,u,c,e.detailedEdits,e.userEditSince,r.value,n,"strict",s,o);if(d==="rebaseFailed")return e.rebaseFailed=!0,{edit:void 0,failureInfo:new ggc.RebaseFailureInfo(e.documentBeforeEdit.value,u,c,e.userEditSince,r.value,n,o)};if(d==="inconsistentEdits"||d==="error")return e.userEditSince=void 0,{edit:void 0};if(d==="outsideEditWindow")continue;if(d.length)return!e.rejected&&this.isRejectedNextEdit(r,d[0].rebasedEdit)&&(e.rejected=!0),{edit:{...e,...d[0],baseCacheEntry:e}};if(!c.length)return{edit:e}}}return{edit:void 0}}isRejectedNextEdit(e,r){let n=this._logger.createSubLogger("isRejectedNextEdit"),o=r.removeCommonSuffixAndPrefix(e.value);for(let s of this._trackedCachedEdits.filter(c=>c.rejected)){if(!s.userEditSince)continue;let c=s.edits||(s.edit?[s.edit]:[]);if(!c.length)continue;let l=(0,Ovt.tryRebase)(s.documentBeforeEdit.value,void 0,c,s.detailedEdits,s.userEditSince,e.value,[],"lenient",n);if(typeof l=="string")continue;if(l.some(d=>d.rebasedEdit.removeCommonSuffixAndPrefix(e.value).equals(o)))return n.trace("Found rejected edit that matches current edit"),!0}return!1}_getKey(e){return JSON.stringify([this.docId.uri,e])}}});var OFi=I(Bvt=>{"use strict";p();Object.defineProperty(Bvt,"__esModule",{value:!0});Bvt.NextEditResult=void 0;var pNr=class{static{a(this,"NextEditResult")}constructor(e,r,n){this.requestId=e,this.source=r,this.result=n}};Bvt.NextEditResult=pNr});var LFi=I(Fvt=>{"use strict";p();Object.defineProperty(Fvt,"__esModule",{value:!0});Fvt.SpeculativeRequestManager=void 0;var Agc=Ro(),hNr=class extends Agc.Disposable{static{a(this,"SpeculativeRequestManager")}constructor(e){super(),this._logger=e,this._pending=null,this._scheduled=null}get pending(){return this._pending}setPending(e){this._pending&&this._pending.request!==e.request&&this._cancelPending("replaced"),this._pending=e}consumePending(){this._pending=null}schedule(e){this._scheduled=e}clearScheduled(){this._scheduled=null}consumeScheduled(e){if(this._scheduled?.headerRequestId!==e)return null;let r=this._scheduled;return this._scheduled=null,r}cancelAll(e){this._scheduled=null,this._cancelPending(e)}cancelIfMismatch(e,r,n){this._pending&&(this._pending.docId!==e||this._pending.postEditContent!==r)&&this._cancelPending(n)}onDocumentClosed(e){this._scheduled?.suggestion.result?.targetDocumentId===e&&(this._scheduled=null),this._pending?.docId===e&&this._cancelPending("documentClosed")}onActiveDocumentChanged(e,r){let n=this._pending;if(!n||n.docId!==e)return;if(r.length{"use strict";p();var ygc=hI&&hI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ABe=hI&&hI.__param||function(t,e){return function(r,n){e(r,n,t)}},mNr;Object.defineProperty(hI,"__esModule",{value:!0});hI.NextEditFetchRequest=hI.NextEditProvider=hI.NesOutcome=void 0;var Egc=require("path"),v1=Pl(),Mye=fN(),_Be=cvt(),yBe=Ay(),_gc=dpt(),Pp=Eye(),vgc=g4(),gNr=xp(),Cgc=z3i(),bgc=Tye(),Sgc=ODr(),Tgc=yh(),EBe=nv(),e_=yw(),BFi=sd(),Uvt=nl(),Igc=vZe(),ENr=Rs(),Qvt=Ro(),FFi=tD(),UFi=GO(),xgc=nT(),GFi=x0(),QFi=VG(),$ne=ME(),wgc=$_(),ANr=Ed(),qFi=$T(),Rgc=nNr(),kgc=PFi(),Pgc=MFi(),qvt=OFi(),Dgc=LFi();function Ngc(t,e,r){if(!e)return t;let n=e.endExclusive,o=r.getTransformer(),s=o.getPosition(n),c=o.getOffset(s.with(void 0,1)),l=o.getOffset(s.with(void 0,o.getLineLength(s.lineNumber)+1)),u=o.getOffset(o.getPosition(t.start).delta(1)),d=o.getPosition(t.endExclusive).delta(-2),f=o.getOffset(d.column>1?d.with(void 0,o.getLineLength(d.lineNumber)+1):d);return new ANr.OffsetRange(Math.min(u,c),Math.max(f,l))}a(Ngc,"computeReducedWindow");function jFi(t,e){let n=new _Be.RootedLineEdit(e,t).toEdit();return e.value.includes(`\r +`)?new $ne.StringEdit(n.replacements.map(o=>new $ne.StringReplacement(o.replaceRange,o.newText.replace(/\n/g,`\r +`)))):n}a(jFi,"convertLineEditToEdit");function HFi(t,e){return new Igc.CachedFunction(n=>{let o=t.find(s=>s.nextEditDoc.id===n);if(!o){for(let s=e.length-1;s>=0;s--){let c=e[s];if(c.docId===n&&c.kind==="edit"){let l=c.edit.getEditedState();return{baseDocState:l,docContents:l,editsSoFar:$ne.StringEdit.empty,nextEdits:[],docId:n}}}throw new ENr.BugIndicatingError}return{baseDocState:o.documentAfterEdits,docContents:o.documentAfterEdits,editsSoFar:$ne.StringEdit.empty,nextEdits:[],docId:n}})}a(HFi,"createDocStateLookupMap");var vBe;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(vBe||(hI.NesOutcome=vBe={}));var yNr=mNr=class extends Qvt.Disposable{static{a(this,"NextEditProvider")}get lastRejectionTime(){return this._lastRejectionTime}get lastTriggerTime(){return this._lastTriggerTime}get lastOutcome(){return this._lastOutcome}constructor(e,r,n,o,s,c,l,u,d,f){super(),this._workspace=e,this._statelessNextEditProvider=r,this._historyContextProvider=n,this._xtabHistoryTracker=o,this._debugRecorder=s,this._configService=c,this._snippyService=l,this._logService=u,this._expService=d,this._requestLogger=f,this.ID=this._statelessNextEditProvider.ID,this._rejectionCollector=this._register(new kgc.RejectionCollector(this._workspace,this._logService)),this._pendingStatelessNextEditRequest=null,this._lastShownTime=0,this._lastShownSuggestionId=void 0,this._lastRejectionTime=0,this._lastTriggerTime=0,this._shouldExpandEditWindow=!1,this._logger=this._logService.createSubLogger(["NES","NextEditProvider"]),this._nextEditCache=new Pgc.NextEditCache(this._workspace,this._logService,this._configService,this._expService),this._specManager=this._register(new Dgc.SpeculativeRequestManager(this._logger.createSubLogger("SpeculativeRequestManager"))),(0,FFi.mapObservableArrayCached)(this,this._workspace.openDocuments,(h,m)=>{m.add((0,FFi.runOnChange)(h.value,g=>{this._cancelPendingRequestDueToDocChange(h.id,g)})),m.add((0,Qvt.toDisposable)(()=>this._specManager.onDocumentClosed(h.id)))}).recomputeInitiallyAndOnChange(this._store)}_cancelPendingRequestDueToDocChange(e,r){if(this._configService.getExperimentBasedConfig(v1.ConfigKey.TeamInternal.InlineEditsAsyncCompletions,this._expService)||this._pendingStatelessNextEditRequest===null)return;let o=this._pendingStatelessNextEditRequest.getActiveDocument();o.id===e&&o.documentAfterEdits.value!==r.value&&this._pendingStatelessNextEditRequest.cancellationTokenSource.cancel()}async getNextEdit(e,r,n,o,s){let c=Date.now();this._lastTriggerTime=c;let l=new UFi.StopWatch,u=this._logger.createSubLogger(r.requestUuid.substring(4,8)).withExtraTarget(gNr.LogTarget.fromCallback((h,m)=>{n.trace(`[${Math.floor(l.elapsed()).toString().padStart(4," ")}ms] ${m}`)})),d=this._shouldExpandEditWindow;n.setStatelessNextEditProviderId(this._statelessNextEditProvider.ID);let f;try{f=await this._getNextEditCanThrow(e,r,c,d,u,n,o,s)}catch(h){throw n.setError(h),s.setNextEditProviderError(EBe.ErrorUtils.toString(h)),h}finally{s.markEndTime()}return this._lastNextEditResult=f,f}async _getNextEditCanThrow(e,r,n,o,s,c,l,u){let d=s.createSubLogger("_getNextEdit");d.trace(`invoked with trigger id = ${r.changeHint===void 0?"undefined":`uuid = ${r.changeHint.data.uuid}, reason = ${r.changeHint.data.reason}`}`);let f=this._workspace.getDocument(e);if(!f)throw d.trace(`Document "${e.baseName}" not found`),new ENr.BugIndicatingError(`Document "${e.baseName}" not found`);let h=f.value.get(),m=f.selection.get(),g=this.determineNesConfigs(u,c),A=this._nextEditCache.lookupNextEdit(e,h,m);if(A?.rejected){d.trace("cached edit was previously rejected"),u.setStatus("previouslyRejectedCache"),u.setWasPreviouslyRejected(),c.markAsPreviouslyRejected();let L=A.rebasedEdit??A.edit;return L&&this._rejectionCollector.reject(e,L),new qvt.NextEditResult(c.requestId,A.source,void 0)}let y,E,_,v,b=e,T=!1,w=!1,R=!1,x;if(A){d.trace("using cached edit");let L=A.rebasedEdit||A.edit;L&&(y={actualEdit:L,isFromCursorJump:A.isFromCursorJump}),T=!!A.rebasedEdit,w=A.subsequentN!==void 0&&A.subsequentN>0,R=A.source.isSpeculative,v=A.source,c.setIsCachedResult(A.source.log),E=h,u.setHeaderRequestId(v.headerRequestId),u.setIsFromCache(),u.setSubsequentEditOrder(A.rebasedEditIndex??A.subsequentN),c.recordingBookmark=v.log.recordingBookmark,x=A.baseCacheEntry??A}else{d.trace(`fetching next edit with shouldExpandEditWindow=${o}`);let L=this._configService.getExperimentBasedConfig(v1.ConfigKey.TeamInternal.InlineEditsDebounceUseCoreRequestTime,this._expService)?r.requestIssuedDateTime??void 0:void 0;v=new CBe(r.requestUuid,c,L,!1),u.setHeaderRequestId(v.headerRequestId);let B=f.value.get();d.trace("awaiting firstEdit promise");let j=await this.fetchNextEdit(v,f,g,o,d,u,l);d.trace("resolved firstEdit promise");let M=`First edit latency: ${Date.now()-this._lastTriggerTime} ms`;if(c.addLog(M),d.trace(M),j.isError())d.trace(`failed to fetch next edit ${j.err.toString()}`),u.setStatus(`noEdit:${j.err.kind}`),_=j.err;else if(b=j.val.docId??b,E=(b?this._workspace.getDocument(b):f).value.get(),b===f.id&&B.value!==E.value)d.trace("document changed while fetching next edit"),u.setStatus("docChanged"),c.setIsSkipped();else{let q=j.val.rebasedEdit||j.val.edit;q?(d.trace("fetch succeeded"),c.setResponseResults([q]),y={actualEdit:q,isFromCursorJump:j.val.isFromCursorJump},R=j.val.isFromSpeculativeRequest??!1,x=j.val.baseCacheEntry??j.val):(d.trace("empty edits"),u.setStatus("emptyEdits"))}}if(_ instanceof Pp.NoNextEditReason.FetchFailure||_ instanceof Pp.NoNextEditReason.Unexpected)throw d.trace(`has throwing error: ${_.error}`),_.error;if(_ instanceof Pp.NoNextEditReason.NoSuggestions)if(_.nextCursorPosition===void 0)c.markAsNoSuggestions();else return u.setStatus("emptyEditsButHasNextCursorPosition"),new qvt.NextEditResult(c.requestId,v,{jumpToPosition:_.nextCursorPosition,targetDocumentId:_.nextCursorDocumentId,documentBeforeEdits:h,isFromCursorJump:!1,isSubsequentEdit:!1});else _ instanceof Pp.NoNextEditReason.GotCancelled&&c.setIsSkipped();let P=new qvt.NextEditResult(c.requestId,v,void 0);if(!y)return d.trace("had no edit"),P;if(l.isCancellationRequested)return d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),P;if(this._rejectionCollector.isRejected(b,y.actualEdit)||E&&this._nextEditCache.isRejectedNextEdit(b,E,y.actualEdit))return d.trace("edit was previously rejected"),u.setStatus("previouslyRejected"),u.setWasPreviouslyRejected(),c.markAsPreviouslyRejected(),P;c.setResult(_Be.RootedLineEdit.fromEdit(new Mye.RootedEdit(h,new $ne.StringEdit([y.actualEdit])))),(0,BFi.assert)(E!==void 0,"should be defined if edit is defined"),u.setStatus("notAccepted");let D=new qvt.NextEditResult(c.requestId,v,{edit:y.actualEdit,isFromCursorJump:y.isFromCursorJump,documentBeforeEdits:E,targetDocumentId:b,isSubsequentEdit:w,cacheEntry:x});u.setHasNextEdit(!0);let N=this.computeMinimumResponseDelay({triggerTime:n,isRebasedCachedEdit:T,isSubsequentCachedEdit:w,isFromSpeculativeRequest:R,enforceCacheDelay:r.enforceCacheDelay},d);return N>0&&(await(0,Uvt.timeout)(N),l.isCancellationRequested)?(d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),P):(d.trace("returning next edit result"),D)}determineNesConfigs(e,r){let n={isAsyncCompletions:this._configService.getExperimentBasedConfig(v1.ConfigKey.TeamInternal.InlineEditsAsyncCompletions,this._expService)};return e.setNESConfigs({...n}),r.addCodeblockToLog(JSON.stringify(n,null," ")),n}_processDoc(e){let r=e.lastEdit.base.getLines(),n=e.lastEdits,o=_Be.RootedLineEdit.fromEdit(new Mye.RootedEdit(e.lastEdit.base,e.lastEdits.compose())).removeCommonSuffixPrefixLines().edit,s=e.lastEdit.base,c=e.lastSelection,l=this._workspace.getWorkspaceRoot(e.docId),u=new Pp.StatelessNextEditDocument(e.docId,l,e.languageId,r,o,s,n,c);return{recentEdit:e.lastEdit,nextEditDoc:u,documentAfterEdits:u.documentAfterEdits}}async fetchNextEdit(e,r,n,o,s,c,l){let u=r.id,d=s.createSubLogger("fetchNextEdit"),f=this._historyContextProvider.getHistoryContext(u);if(!f)return e_.Result.error(new Pp.NoNextEditReason.Unexpected(new Error("DocumentMissingInHistoryContext")));let h=r.value.get(),m=r.selection.get(),g=e.log;g.setRecentEdit(f);let A=m.at(0),y=a(N=>!N.requestEditWindow||!A||N.requestEditWindow.containsCursor(A),"cursorInRequestEditWindow"),E=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value,_=!this._pendingStatelessNextEditRequest||y(this._pendingStatelessNextEditRequest),v=(E||n.isAsyncCompletions)&&_&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0,b=this._specManager.pending,T=b?.docId===u&&b?.postEditContent===h.value&&!b.request.cancellationTokenSource.token.isCancellationRequested&&y(b.request),w=T?b?.request:void 0,R=w??v;if(R){w?(d.trace(`reusing speculative pending request (opportunityId=${w.opportunityId}, headerRequestId=${w.headerRequestId})`),this._specManager.consumePending()):d.trace(`reusing in-flight pending request (opportunityId=${R.opportunityId}, headerRequestId=${R.headerRequestId})`);let N=w?T:E,L=w?"speculative":"async";if(N){let B=await this._joinNextEditRequest(R,L,c,g,l);return c.setStatelessNextEditTelemetry(B.telemetry),w?(await R.firstEdit.p).map(M=>({...M,isFromSpeculativeRequest:!0})):B.nextEdit.isError()?B.nextEdit:R.firstEdit.p}else{let B=await this._joinNextEditRequest(R,L,c,g,l),j=await R.firstEdit.p;if(j.isOk()&&j.val.edit){let U=this._nextEditCache.tryRebaseCacheEntry(j.val,h,m);if(U.edit)return c.setStatelessNextEditTelemetry(B.telemetry),e_.Result.ok(U.edit);this._logRebaseFailure(U.failureInfo,g)}if(l.isCancellationRequested)return d.trace("document changed after rebase failed"),c.setStatelessNextEditTelemetry(B.telemetry),e_.Result.error(new Pp.NoNextEditReason.GotCancelled("afterFailedRebase"));let O=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0;if(O){d.trace("reusing 2nd existing next edit request after rebase failed");let U=await this._joinNextEditRequest(O,"async",c,g,l);return c.setStatelessNextEditTelemetry(U.telemetry),U.nextEdit.isError()?U.nextEdit:O.firstEdit.p}d.trace("creating new next edit request after rebase failed")}}let x=await this._executeNewNextEditRequest(e,r,f,n,o,d,c,l),P=x.nextEditRequest,D=x.nextEditResult;return c.setStatelessNextEditTelemetry(D.telemetry),D.nextEdit.isError()?D.nextEdit:P.firstEdit.p}async _joinNextEditRequest(e,r,n,o,s){n.setHeaderRequestId(e.headerRequestId),n.setReusedRequest(r),n.setRequest(e),o.setRequestInput(e),o.setIsReusedInFlightResult(e.logContext);let c=this._hookupCancellation(e,s);try{return await e.result}finally{c.dispose()}}_logRebaseFailure(e,r){e&&r.setRebaseFailure(e)}async _executeNewNextEditRequest(e,r,n,o,s,c,l,u){let d=r.id,f=c.createSubLogger("_executeNewNextEditRequest"),h=e.log;if(this._debugRecorder){let B=this._debugRecorder.createBookmark();h.recordingBookmark=B,l.setRequestBookmark(B)}let m=Mgc(n.getDocumentAndIdx(d)),g=r.selection.get()[0],A=this._debugRecorder?.getRecentLog(),y=n.documents.map(B=>this._processDoc(B)),E=this._xtabHistoryTracker.getHistory(),_=new Uvt.DeferredPromise,v=s?this._configService.getExperimentBasedConfig(v1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0,b=new Pp.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,r.value.get(),y.map(B=>B.nextEditDoc),m.idx,E,_,v,!1,h,h.recordingBookmark,A,e.providerRequestStartDateTime),T;this._pendingStatelessNextEditRequest&&(this._pendingStatelessNextEditRequest.cancellationTokenSource.cancel(),this._pendingStatelessNextEditRequest=null,this._specManager.clearScheduled()),this._specManager.cancelIfMismatch(d,b.documentBeforeEdits.value,"superseded"),this._pendingStatelessNextEditRequest=b;let w=a(()=>{this._pendingStatelessNextEditRequest===b&&(this._pendingStatelessNextEditRequest=null)},"removeFromPending");l.setRequest(b),l.setStatus("requested"),h.setRequestInput(b);let R=this._hookupCancellation(b,u,o.isAsyncCompletions?(0,vgc.autorunWithChanges)(this,{value:r.value},B=>{B.value.changes.forEach(j=>{b.intermediateUserEdit&&!j.isEmpty()&&(b.intermediateUserEdit=b.intermediateUserEdit.compose(j),(0,Rgc.checkEditConsistency)(b.documentBeforeEdits.value,b.intermediateUserEdit,B.value.value.value,f)||(b.intermediateUserEdit=void 0))})}):void 0),x=HFi(y,E),P=this._statelessNextEditProvider.provideNextEdit(b,f,h,b.cancellationTokenSource.token),D=-1,N=a((B,j)=>{++D;let M=f.createSubLogger("processEdit");M.trace(`processing edit #${D} (starts at 0)`),M.trace("resetting shouldExpandEditWindow to false due to receiving an edit"),this._shouldExpandEditWindow=!1;let O=x.get(B.targetDocument??d),U=B.edit,q=new QFi.LineEdit([U]),Y=jFi(q,O.baseDocState).tryRebase(O.editsSoFar);if(Y===void 0){M.trace(`edit ${D} is undefined after rebasing`),_.isSettled||_.complete(e_.Result.error(new Pp.NoNextEditReason.Uncategorized(new Error("Rebased edit is undefined"))));return}O.editsSoFar=O.editsSoFar.compose(Y);let W;if(Y.replacements.length===0)M.trace(`WARNING: ${D} has no edits`);else if(Y.replacements.length>1)M.trace(`WARNING: ${D} has ${Y.replacements.length} edits, but expected only 1`);else{let V=Y.replacements[0];O.nextEdits.push(V),W=this._nextEditCache.setKthNextEdit(O.docId,O.docContents,D===0?B.window:void 0,V,D,D===0?O.nextEdits:void 0,D===0?b.intermediateUserEdit:void 0,e,{isFromCursorJump:B.isFromCursorJump,originalEditWindow:B.originalWindow,cursorOffset:O.docId===d?g?.start:void 0}),M.trace(`populated cache for ${D}`)}return _.isSettled||(M.trace("resolving firstEdit promise"),h.setResult(new _Be.RootedLineEdit(O.docContents,q)),_.complete(W?e_.Result.ok(W):e_.Result.error(new Pp.NoNextEditReason.Unexpected(new Error("No cached edit"))))),O.docContents=Y.applyOnText(O.docContents),W},"processEdit"),L=a((B,j)=>{let M=f.createSubLogger("streamEnd");if(D===-1&&B instanceof Pp.NoNextEditReason.NoSuggestions&&(M.trace("resetting shouldExpandEditWindow to false due to NoSuggestions"),this._shouldExpandEditWindow=!1),x.get(d).nextEdits.length)M.trace(`${x.get(d).nextEdits.length} edits returned`);else if(M.trace(`no edit, reason: ${B.kind}`),B instanceof Pp.NoNextEditReason.NoSuggestions){let{documentBeforeEdits:Y,window:W}=B,V=W?Ngc(W,g,Y):void 0;this._nextEditCache.setNoNextEdit(d,Y,V,e)}_.isSettled||_.complete(e_.Result.error(B));let U=x.get(d).nextEdits.length>0?e_.Result.ok(void 0):e_.Result.error(B),q=new Pp.StatelessNextEditResult(U,j);b.setResult(q),R.dispose(),w();let Q=this._specManager.consumeScheduled(b.headerRequestId);return Q&&this._triggerSpeculativeRequest(Q.suggestion),q},"handleStreamEnd");try{let B=await P.next();if(B.done){let j=B.value.v;T=L(j,B.value.telemetryBuilder)}else{let j=B.value.v,M=B.value.telemetryBuilder;N(j,M),(async()=>{try{for(B=await P.next();!B.done;){let U=B.value.v;N(U,B.value.telemetryBuilder),this._specManager.consumeScheduled(b.headerRequestId),B=await P.next()}let O=B.value.v;L(O,B.value.telemetryBuilder)}catch(O){f.trace(`Error while streaming further edits: ${EBe.ErrorUtils.toString(O)}`);let U=new Pp.NoNextEditReason.Unexpected(EBe.ErrorUtils.fromUnknown(O));L(U,M)}})(),T=new Pp.StatelessNextEditResult(e_.Result.ok(void 0),M)}}catch(B){throw b.setResultError(B),B}return{nextEditRequest:b,nextEditResult:T}}_hookupCancellation(e,r,n){let o=new Qvt.DisposableStore,s=!1,c=a(()=>{s||(s=!0,e.liveDependentants--)},"removeDependant"),l=o.add(new Uvt.TimeoutTimer);return o.add(r.onCancellationRequested(()=>{if(c(),!(e.liveDependentants>0)){if(!e.fetchIssued){e.cancellationTokenSource.cancel(),n?.dispose();return}l.setIfNotSet(()=>{e.liveDependentants>0||(e.cancellationTokenSource.cancel(),n?.dispose())},1e3)}})),o.add((0,Qvt.toDisposable)(()=>{c(),e.liveDependentants===0&&n?.dispose()})),e.liveDependentants++,o}computeMinimumResponseDelay({triggerTime:e,isRebasedCachedEdit:r,isSubsequentCachedEdit:n,isFromSpeculativeRequest:o,enforceCacheDelay:s},c){if(!s)return c.trace("[minimumDelay] no minimum delay enforced due to enforceCacheDelay being false"),0;let l=this._configService.getExperimentBasedConfig(v1.ConfigKey.TeamInternal.InlineEditsCacheDelay,this._expService),u=this._configService.getExperimentBasedConfig(v1.ConfigKey.TeamInternal.InlineEditsRebasedCacheDelay,this._expService),d=this._configService.getExperimentBasedConfig(v1.ConfigKey.TeamInternal.InlineEditsSubsequentCacheDelay,this._expService),f=this._configService.getExperimentBasedConfig(v1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestDelay,this._expService),h=l;r&&u!==void 0?h=u:n&&d!==void 0?h=d:o&&f!==void 0&&(h=f);let m=Date.now()-e,g=Math.max(0,h-m);return c.trace(`[minimumDelay] expected delay: ${h}ms, effective delay: ${g}. isRebasedCachedEdit: ${r} (rebasedCacheDelay: ${u}), isSubsequentCachedEdit: ${n} (subsequentCacheDelay: ${d}), isFromSpeculativeRequest: ${o} (speculativeRequestDelay: ${f})`),g}handleShown(e){if(this._lastShownTime=Date.now(),this._lastShownSuggestionId=e.requestId,this._lastOutcome=void 0,this._specManager.clearScheduled(),this._configService.getExperimentBasedConfig(v1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequests,this._expService)===yBe.SpeculativeRequestsEnablement.On){let n=this._pendingStatelessNextEditRequest;n&&n.headerRequestId===e.source.headerRequestId?this._specManager.schedule({suggestion:e,headerRequestId:n.headerRequestId}):this._triggerSpeculativeRequest(e)}}async _triggerSpeculativeRequest(e){let r=e.result;if(!r?.edit)return;let n=r.targetDocumentId;if(!n)return;let o=new _gc.InlineEditRequestLogContext(n.uri,0,void 0),s=new UFi.StopWatch,c=this._logger.createSubLogger("_triggerSpeculativeRequest").withExtraTarget(gNr.LogTarget.fromCallback((T,w)=>{o.trace(`[${Math.floor(s.elapsed()).toString().padStart(4," ")}ms] ${w}`)})),l=r.edit.replace(r.documentBeforeEdits.value),u=r.edit.removeCommonSuffixPrefix(r.documentBeforeEdits.value),d=u.replaceRange.start+u.newText.length,f=new ANr.OffsetRange(d,d),h=[f],m=new Mye.RootedEdit(r.documentBeforeEdits,new $ne.StringEdit([r.edit])),g=new qFi.StringText(l),A=this._nextEditCache.lookupNextEdit(n,g,h),y=f;if(A)if(A.edit){c.trace("already have cached edit for post-edit state");return}else if(A.editWindow){c.trace("have cached no-suggestions entry for post-edit state, but it has an edit window. Checking if shifting selection based on cursor placement config can yield a cached edit");let T=this._configService.getExperimentBasedConfig(v1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsCursorPlacement,this._expService);if(T===yBe.SpeculativeRequestsCursorPlacement.AfterEditWindow)if(c.trace("cursor placement config is AfterEditWindow, shifting selection to after edit window"),y=mNr.shiftSelectionAfterEditWindow(g,A.editWindow),A=this._nextEditCache.lookupNextEdit(n,g,[y]),A?.edit){c.trace("already have cached edit for post-edit state (after shifting selection)");return}else c.trace("no cached edit even after shifting selection");else c.trace(`cursor placement config is ${T}, not shifting selection`)}else{c.trace("already have cached no-suggestions entry for post-edit state");return}if(this._pendingStatelessNextEditRequest?.documentBeforeEdits.value===l){c.trace("already have pending request for post-edit state");return}let E=this._specManager.pending;if(E?.docId===n&&E?.postEditContent===l){c.trace("already have speculative request for post-edit state");return}let _=this._workspace.getDocument(n);if(!_){c.trace("document not found for speculative request");return}let v=this._historyContextProvider.getHistoryContext(n);if(!v){c.trace("no history context for speculative request");return}let b=new CBe(`sp-${e.source.opportunityId}`,o,void 0,!0,`sp-${(0,GFi.generateUuid)()}`);c.trace(`triggering speculative request for post-edit state (opportunityId=${b.opportunityId}, headerRequestId=${b.headerRequestId})`);try{let T=await this._createSpeculativeRequest(b,_,y,v,l,m,r.edit,{triggeredBySpeculativeRequest:e.source.isSpeculative,isSubsequentEdit:e.result?.isSubsequentEdit??!1},c);if(T){let w=r.documentBeforeEdits.value,R=w.slice(0,u.replaceRange.start),x=w.slice(u.replaceRange.endExclusive),P=u.newText;this._specManager.setPending({request:T,docId:n,postEditContent:l,trajectoryPrefix:R,trajectorySuffix:x,trajectoryNewText:P})}}catch(T){c.trace(`speculative request failed: ${EBe.ErrorUtils.toString(T)}`)}}async _createSpeculativeRequest(e,r,n,o,s,c,l,{triggeredBySpeculativeRequest:u,isSubsequentEdit:d},f){let h=r.id,m=this._debugRecorder?.getRecentLog(),g=e.log;g.setStatelessNextEditProviderId(this._statelessNextEditProvider.ID);let A=f.createSubLogger("_createSpeculativeRequest"),y=o.getDocumentAndIdx(h);if(!y){A.trace("active doc not found in history context");return}let E=new qFi.StringText(s),_=o.documents.map(N=>{if(N.docId!==h)return this._processDoc(N);{let L=this._workspace.getWorkspaceRoot(h),B=new $ne.StringEdit([l]),j=_Be.RootedLineEdit.fromEdit(new Mye.RootedEdit(r.value.get(),B)).removeCommonSuffixPrefixLines().edit,M=new Pp.StatelessNextEditDocument(h,L,N.languageId,r.value.get().getLines(),j,r.value.get(),Mye.Edits.single(B),n);return{recentEdit:new Mye.RootedEdit(r.value.get(),B),nextEditDoc:M,documentAfterEdits:E}}}),v=this._xtabHistoryTracker.getHistory(),b={kind:"edit",docId:h,edit:c};v.push(b);let T=new Uvt.DeferredPromise,w=this._configService.getExperimentBasedConfig(v1.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines,this._expService),R;switch(w){case yBe.SpeculativeRequestsAutoExpandEditWindowLines.Off:R=void 0;break;case yBe.SpeculativeRequestsAutoExpandEditWindowLines.Always:R=this._configService.getExperimentBasedConfig(v1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService);break;case yBe.SpeculativeRequestsAutoExpandEditWindowLines.Smart:{R=u||d?this._configService.getExperimentBasedConfig(v1.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0;break}default:(0,BFi.assertNever)(w)}let x=new Pp.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,E,_.map(N=>N.nextEditDoc),y.idx,v,T,R,!0,g,void 0,m,void 0);g.setRequestInput(x),A.trace("starting speculative provider call");let P=`NES | spec | ${(0,Egc.basename)(r.id.toUri().fsPath)} (v${r.version.get()})`,D=new Cgc.CapturingToken(P,void 0);return this._requestLogger.captureInvocation(D,async()=>{this._addLiveLogContextEntry(g,P);try{await this._runSpeculativeProviderCall(x,_,h,e,n.start,A)}catch(N){g.setError(N)}finally{g.markCompleted()}}),x}async _runSpeculativeProviderCall(e,r,n,o,s,c){let l=c.createSubLogger("_runSpeculativeProviderCall"),u=e.xtabEditHistory,d=HFi(r,u),f=o.log,h=this._statelessNextEditProvider.provideNextEdit(e,l,f,e.cancellationTokenSource.token),m=-1;try{let g=await h.next();g.done?(e.firstEdit.complete(e_.Result.error(g.value.v)),e.setResult(new Pp.StatelessNextEditResult(e_.Result.error(g.value.v),g.value.telemetryBuilder)),f.markAsNoSuggestions(),l.trace("speculative request completed with no edits")):(async()=>{for(;!g.done;){++m;let A=g.value.v,y=d.get(A.targetDocument??n),E=A.edit,_=new QFi.LineEdit([E]),b=jFi(_,y.baseDocState).tryRebase(y.editsSoFar);if(b===void 0){l.trace(`speculative edit ${m} rebasing failed`),g=await h.next();continue}if(y.editsSoFar=y.editsSoFar.compose(b),b.replacements.length===1){let T=b.replacements[0];y.nextEdits.push(T);let w=this._nextEditCache.setKthNextEdit(y.docId,y.docContents,m===0?A.window:void 0,T,m,m===0?y.nextEdits:void 0,void 0,o,{isFromCursorJump:A.isFromCursorJump,originalEditWindow:A.originalWindow,cursorOffset:y.docId===n?s:void 0});!e.firstEdit.isSettled&&w&&(e.firstEdit.complete(e_.Result.ok(w)),e.setResult(new Pp.StatelessNextEditResult(e_.Result.ok(void 0),g.value.telemetryBuilder)),f.setResponseResults([T])),l.trace(`cached speculative edit ${m}`)}y.docContents=b.applyOnText(y.docContents),g=await h.next()}})().finally(()=>{e.firstEdit.isSettled||(e.firstEdit.complete(e_.Result.error(new Pp.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits")))),e.setResult(new Pp.StatelessNextEditResult(e_.Result.error(new Pp.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits"))),g.value.telemetryBuilder)),f.markAsNoSuggestions())}),l.trace(`speculative request completed with ${m+1} edits`)}catch(g){l.trace(`speculative provider call error: ${EBe.ErrorUtils.toString(g)}`)}}static shiftSelectionAfterEditWindow(e,r){let n=e.getTransformer(),o=n.getPosition(r.endExclusive-1),s=o.lineNumber+11e3&&r.result.edit&&(this._rejectionCollector.reject(e,r.result.edit),this._nextEditCache.rejectedNextEdit(r.source.headerRequestId)),this._lastRejectionTime=Date.now(),this._lastOutcome=vBe.Rejected,this._statelessNextEditProvider.handleRejection?.()}handleIgnored(e,r,n){this._lastOutcome=vBe.Ignored,this._lastShownSuggestionId===r.requestId&&!(n!==void 0)&&(this._specManager.cancelAll("ignoredDismissed"),this._statelessNextEditProvider.handleIgnored?.())}async runSnippy(e,r){r.result===void 0||r.result.edit===void 0||this._snippyService.handlePostInsertion(e.toUri(),r.result.documentBeforeEdits,r.result.edit)}_addLiveLogContextEntry(e,r){this._requestLogger.addEntry({type:"MarkdownContentRequest",debugName:r??e.getDebugName(),icon:a(()=>e.getIcon(),"icon"),startTimeMs:e.time,markdownContent:a(()=>e.toLogDocument(),"markdownContent"),onDidChange:e.onDidChange,isVisible:a(()=>e.includeInLogTree,"isVisible")})}clearCache(){this._nextEditCache.clear(),this._rejectionCollector.clear(),this._specManager.cancelAll("cacheCleared")}};hI.NextEditProvider=yNr;hI.NextEditProvider=yNr=mNr=ygc([ABe(5,v1.IConfigurationService),ABe(6,Sgc.ISnippyService),ABe(7,gNr.ILogService),ABe(8,Tgc.IExperimentationService),ABe(9,bgc.IRequestLogger)],yNr);function Mgc(t){if(!t)throw new ENr.BugIndicatingError("expected value to be defined, but it was not");return t}a(Mgc,"assertDefined");var CBe=class{static{a(this,"NextEditFetchRequest")}constructor(e,r,n,o,s=(0,GFi.generateUuid)()){this.opportunityId=e,this.log=r,this.providerRequestStartDateTime=n,this.isSpeculative=o,this.headerRequestId=s}};hI.NextEditFetchRequest=CBe});var VFi=I(bBe=>{"use strict";p();Object.defineProperty(bBe,"__esModule",{value:!0});bBe.parseGitRemotes=Ogc;bBe.toGitUri=Lgc;bBe.getUpstreamRemote=Bgc;var _Nr=class t{static{a(this,"GitConfigParser")}static{this._lineSeparator=/\r?\n/}static{this._propertyRegex=/^\s*(\w+)\s*=\s*"?([^"]+)"?$/}static{this._sectionRegex=/^\s*\[\s*([^\]]+?)\s*(\"[^"]+\")*\]\s*$/}static parse(e){let r={sections:[]},n={name:"DEFAULT",properties:{}},o=a(s=>{s&&r.sections.push(s)},"addSection");for(let s of e.split(t._lineSeparator)){let c=s.match(t._sectionRegex);if(c?.length===3){o(n),n={name:c[1],subSectionName:c[2]?.replaceAll('"',""),properties:{}};continue}let l=s.match(t._propertyRegex);l?.length===3&&!Object.keys(n.properties).includes(l[1])&&(n.properties[l[1]]=l[2])}return o(n),r.sections}};function Ogc(t){let e=[];for(let r of _Nr.parse(t).filter(n=>n.name==="remote"))r.subSectionName&&e.push({name:r.subSectionName,fetchUrl:r.properties.url,pushUrl:r.properties.pushurl??r.properties.url,isReadOnly:!1});return e}a(Ogc,"parseGitRemotes");function Lgc(t,e,r={}){let n={path:t.fsPath,ref:e};r.submoduleOf&&(n.submoduleOf=r.submoduleOf);let o=t.path;return r.replaceFileExtension?o=`${o}.git`:r.submoduleOf&&(o=`${o}.diff`),t.with({scheme:r.scheme??"git",path:o,query:JSON.stringify(n)})}a(Lgc,"toGitUri");function Bgc(t){let e=t.state.HEAD?.upstream?.remote;if(e)return t.state.remotes.find(r=>r.name===e)}a(Bgc,"getUpstreamRemote")});var t8i=I(bh=>{"use strict";p();Object.defineProperty(bh,"__esModule",{value:!0});bh.GLOB_SPLIT=bh.GLOBSTAR=void 0;bh.getEmptyExpression=jgc;bh.splitGlobAware=bNr;bh.isEmptyPattern=Kgc;bh.match=tAc;bh.parse=ZFi;bh.isRelativePattern=XFi;bh.getBasenameTerms=rAc;bh.getPathTerms=nAc;bh.patternsEquals=sAc;var Fgc=Sl(),CNr=nl(),Ugc=WHt(),Qgc=r2(),nV=LA(),qgc=jq(),SBe=om();function jgc(){return Object.create(null)}a(jgc,"getEmptyExpression");bh.GLOBSTAR="**";bh.GLOB_SPLIT="/";var jvt="[/\\\\]",Hvt="[^/\\\\]",Hgc=/\//g;function WFi(t,e){switch(t){case 0:return"";case 1:return`${Hvt}*?`;default:return`(?:${jvt}|${Hvt}+${jvt}${e?`|${jvt}${Hvt}+`:""})*?`}}a(WFi,"starsToRegExp");function bNr(t,e){if(!t)return[];let r=[],n=!1,o=!1,s="";for(let c of t){switch(c){case e:if(!n&&!o){r.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}s+=c}return s&&r.push(s),r}a(bNr,"splitGlobAware");function JFi(t){if(!t)return"";let e="",r=bNr(t,bh.GLOB_SPLIT);if(r.every(n=>n===bh.GLOBSTAR))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===bh.GLOBSTAR){if(n)return;e+=WFi(2,s===r.length-1)}else{let c=!1,l="",u=!1,d="";for(let f of o){if(f!=="}"&&c){l+=f;continue}if(u&&(f!=="]"||!d)){let h;f==="-"?h=f:(f==="^"||f==="!")&&!d?h="^":f===bh.GLOB_SPLIT?h="":h=(0,SBe.escapeRegExpCharacters)(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${bNr(l,",").map(g=>JFi(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=Hvt;continue;case"*":e+=WFi(1);continue;default:e+=(0,SBe.escapeRegExpCharacters)(f)}}su===d,endsWith:n?SBe.endsWithIgnoreCase:(u,d)=>u.endsWith(d),isEqualOrParent:a((u,d)=>(0,Ugc.isEqualOrParent)(u,d,e.ignoreCase??!qgc.isLinux),"isEqualOrParent")},s=`${n?r.toLowerCase():r}_${!!e.trimForExclusions}_${n}`,c=zFi.get(s);if(c)return YFi(c,t,o);let l;return Ggc.test(r)?c=Jgc(r.substring(4),r,o):(l=$gc.exec(vNr(r,o)))?c=Zgc(l[1],r,o):(e.trimForExclusions?Wgc:Vgc).test(r)?c=Xgc(r,o):(l=zgc.exec(vNr(r,o)))?c=KFi(l[1].substring(1),r,!0,o):(l=Ygc.exec(vNr(r,o)))?c=KFi(l[1],r,!1,o):c=eAc(r,o),zFi.set(s,c),YFi(c,t,o)}a(TNr,"parsePattern");function YFi(t,e,r){if(typeof e=="string")return t;let n=a(function(o,s){return r.isEqualOrParent(o,e.base)?t((0,SBe.ltrim)(o.substring(e.base.length),nV.sep),s):null},"wrappedPattern");return n.allBasenames=t.allBasenames,n.allPaths=t.allPaths,n.basenames=t.basenames,n.patterns=t.patterns,n}a(YFi,"wrapRelativePattern");function vNr(t,e){return e.trimForExclusions&&t.endsWith("/**")?t.substring(0,t.length-2):t}a(vNr,"trimForExclusions");function Jgc(t,e,r){return function(n,o){return typeof n=="string"&&r.endsWith(n,t)?e:null}}a(Jgc,"trivia1");function Zgc(t,e,r){let n=`/${t}`,o=`\\${t}`,s=a(function(l,u){return typeof l!="string"?null:u?r.equals(u,t)?e:null:r.equals(l,t)||r.endsWith(l,n)||r.endsWith(l,o)?e:null},"parsedPattern"),c=[t];return s.basenames=c,s.patterns=[e],s.allBasenames=c,s}a(Zgc,"trivia2");function Xgc(t,e){let r=e8i(t.slice(1,-1).split(",").map(l=>TNr(l,e)).filter(l=>l!==mN),t),n=r.length;if(!n)return mN;if(n===1)return r[0];let o=a(function(l,u){for(let d=0,f=r.length;d!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(Xgc,"trivia3");function KFi(t,e,r,n){let o=nV.sep===nV.posix.sep,s=o?t:t.replace(Hgc,nV.sep),c=nV.sep+s,l=nV.posix.sep+t,u;return r?u=a(function(d,f){return typeof d=="string"&&(n.equals(d,s)||n.endsWith(d,c)||!o&&(n.equals(d,t)||n.endsWith(d,l)))?e:null},"parsedPattern"):u=a(function(d,f){return typeof d=="string"&&(n.equals(d,s)||!o&&n.equals(d,t))?e:null},"parsedPattern"),u.allPaths=[(r?"*/":"./")+t],u}a(KFi,"trivia4and5");function eAc(t,e){try{let r=new RegExp(`^${JFi(t)}$`,e.ignoreCase?"i":void 0);return function(n){return r.lastIndex=0,typeof n=="string"&&r.test(n)?t:null}}catch{return mN}}a(eAc,"toRegExp");function tAc(t,e,r){return!t||typeof e!="string"?!1:ZFi(t,r)(e)}a(tAc,"match");function ZFi(t,e={}){if(!t)return SNr;if(typeof t=="string"||XFi(t)){let r=TNr(t,e);if(r===mN)return SNr;let n=a(function(o,s){return!!r(o,s)},"resultPattern");return r.allBasenames&&(n.allBasenames=r.allBasenames),r.allPaths&&(n.allPaths=r.allPaths),n}return iAc(t,e)}a(ZFi,"parse");function XFi(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(XFi,"isRelativePattern");function rAc(t){return t.allBasenames||[]}a(rAc,"getBasenameTerms");function nAc(t){return t.allPaths||[]}a(nAc,"getPathTerms");function iAc(t,e){let r=e8i(Object.getOwnPropertyNames(t).map(l=>oAc(l,t[l],e)).filter(l=>l!==mN)),n=r.length;if(!n)return mN;if(!r.some(l=>!!l.requiresSiblings)){if(n===1)return r[0];let l=a(function(f,h){let m;for(let g=0,A=r.length;g{for(let g of m){let A=await g;if(typeof A=="string")return A}return null})():null},"resultExpression"),u=r.find(f=>!!f.allBasenames);u&&(l.allBasenames=u.allBasenames);let d=r.reduce((f,h)=>h.allPaths?f.concat(h.allPaths):f,[]);return d.length&&(l.allPaths=d),l}let o=a(function(l,u,d){let f,h;for(let m=0,g=r.length;m{for(let m of h){let g=await m;if(typeof g=="string")return g}return null})():null},"resultExpression"),s=r.find(l=>!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(iAc,"parsedExpression");function oAc(t,e,r){if(e===!1)return mN;let n=TNr(t,r);if(n===mN)return mN;if(typeof e=="boolean")return n;if(e){let o=e.when;if(typeof o=="string"){let s=a((c,l,u,d)=>{if(!d||!n(c,l))return null;let f=o.replace("$(basename)",()=>u),h=d(f);return(0,CNr.isThenable)(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(oAc,"parseExpressionPattern");function e8i(t,e){let r=t.filter(l=>!!l.basenames);if(r.length<2)return t;let n=r.reduce((l,u)=>{let d=u.basenames;return d?l.concat(d):l},[]),o;if(e){o=[];for(let l=0,u=n.length;l{let d=u.patterns;return d?l.concat(d):l},[]);let s=a(function(l,u){if(typeof l!="string")return null;if(!u){let f;for(f=l.length;f>0;f--){let h=l.charCodeAt(f-1);if(h===47||h===92)break}u=l.substring(f)}let d=n.indexOf(u);return d!==-1?o[d]:null},"aggregate");s.basenames=n,s.patterns=o,s.allBasenames=n;let c=t.filter(l=>!l.basenames);return c.push(s),c}a(e8i,"aggregateBasenameMatches");function sAc(t,e){return(0,Fgc.equals)(t,e,(r,n)=>typeof r=="string"&&typeof n=="string"?r===n:typeof r!="string"&&typeof n!="string"?r.base===n.base&&r.pattern===n.pattern:!1)}a(sAc,"patternsEquals")});var $vt=I(Ol=>{"use strict";p();var aAc=Ol&&Ol.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cAc=Ol&&Ol.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),lAc=Ol&&Ol.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o(0,r8i.isEqual)(r.uri,t)||r.uri.path===t.path||xNr(t,r))}a(INr,"findNotebook");function xNr(t,e){if(t.scheme===TBe.Schemas.vscodeNotebookCell||t.scheme===TBe.Schemas.vscodeNotebookCellOutput){let r=e.getCells().findIndex(n=>(0,r8i.isEqual)(n.document.uri,t)||n.document.uri.fragment===t.fragment&&n.document.uri.path===t.path);if(r!==-1)return e.getCells()[r]}}a(xNr,"findCell");function uAc(t,e){if(t.scheme!==TBe.Schemas.vscodeNotebookCellOutput)return;let r=new URLSearchParams(t.query),[n,o]=n8i(t,e);if(!o||!o.outputs.length)return;let s=(r.get("outputIndex")?parseInt(r.get("outputIndex")||"",10):void 0)||0;if(!(s>o.outputs.length-1))return[n,o,o.outputs[s]]}a(uAc,"getNotebookCellOutput");function n8i(t,e){let r=INr(t,e)||e.find(o=>o.uri.path===t.path);if(!r)return[void 0,void 0];let n=xNr(t,r);return n===void 0?[r,void 0]:[r,n]}a(n8i,"getNotebookAndCellFromUri");function dAc(t){return t.scheme===TBe.Schemas.vscodeNotebookCell||t.scheme==="untitled"&&t.fragment.startsWith("notebook-chat-input")}a(dAc,"isNotebookCellOrNotebookChatInput");function fAc(t){return t.scheme===TBe.Schemas.vscodeNotebookCell}a(fAc,"isNotebookCell");function pAc(t){return t.path.endsWith(".ipynb")}a(pAc,"isJupyterNotebookUri");function hAc(t){return t.notebookType==="jupyter-notebook"}a(hAc,"isJupyterNotebook");function mAc(t,e={}){return JSON.stringify({cells:t.getCells().map(r=>({uri_fragment:e.cell_uri_fragment?r.document.uri.fragment:void 0,cell_type:r.kind,source:r.document.getText().split(/\r?\n/)}))})}a(mAc,"serializeNotebookDocument");function gAc(t){try{let e=t.replace(/\n/g,""),n=/```(?:json)?(.+)/g.exec(e);if(n){let o=n[1],s=o.indexOf("```"),c=s===-1?o:o.substring(0,s);return JSON.parse(c)}}catch{}}a(gAc,"extractNotebookOutline");function i8i(t){let e=t;return typeof e=="object"&&e!==null&&(typeof e.include=="string"||s8i(e.include))}a(i8i,"isDocumentExcludePattern");function o8i(t){let e=t;return typeof e=="object"&&e!==null&&typeof e.filenamePattern=="string"}a(o8i,"isFilenamePattern");function s8i(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(s8i,"isRelativePattern");function AAc(t){let e=t;return!!e&&!!e.type&&!!e.displayName&&!!e.selector}a(AAc,"isNotebookEditorContribution");function yAc(t){let e=[];for(let[r,n]of Object.entries(t))n&&e.push({filenamePattern:r,viewType:n});return e}a(yAc,"extractEditorAssociation");function a8i(t,e){if(typeof e=="string"&&Oye.match(e.toLowerCase(),(0,Lye.basename)(t.fsPath).toLowerCase()))return!0;if(i8i(e)){let r=e.include,n=e.exclude;if(!r)return!1;if(Oye.match(r,(0,Lye.basename)(t.fsPath).toLowerCase()))return!(n&&Oye.match(n,(0,Lye.basename)(t.fsPath).toLowerCase()))}return o8i(e)&&Oye.match(e.filenamePattern,(0,Lye.basename)(t.fsPath).toLowerCase())?!(e.excludeFileNamePattern&&Oye.match(e.excludeFileNamePattern,(0,Lye.basename)(t.fsPath).toLowerCase())):!1}a(a8i,"notebookSelectorMatches");function c8i(t,e){let r=[];for(let n of e)n.filenamePattern&&Oye.match(n.filenamePattern.toLowerCase(),(0,Lye.basename)(t.fsPath).toLowerCase())&&r.push({filenamePattern:n.filenamePattern,viewType:n.viewType});return r}a(c8i,"getNotebookEditorAssociations");function EAc(t,e,r,n){if(INr(t,e))return!0;let o=r.filter(c=>c.selector.some(l=>a8i(t,l)));if(o.length===0)return!1;let s=c8i(t,n);for(let c of s)if(o.some(l=>l.type===c.viewType))return!0;return!!o.some(c=>(c.priority??Gvt.default)===Gvt.default)}a(EAc,"_hasSupportedNotebooks")});var h8i=I(L0=>{"use strict";p();var _Ac=L0&&L0.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},vAc=L0&&L0.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(L0,"__esModule",{value:!0});L0.TelemetrySender=L0.NextEditProviderTelemetryBuilder=L0.DiagnosticsTelemetryBuilder=L0.LlmNESTelemetryBuilder=L0.NES_GH_TELEMETRY_EVENT_NAME=void 0;var l8i=JR(),u8i=VFi(),CAc=g4(),p8i=vm(),bAc=$vt(),SAc=nl(),Vvt=Ro(),TAc=dJ(),d8i=D8(),f8i=N0();L0.NES_GH_TELEMETRY_EVENT_NAME="copilot-nes/provideInlineEdit";var Wvt=class extends Vvt.Disposable{static{a(this,"LlmNESTelemetryBuilder")}build(e){let r,n,o,s,c,l=!1,u,d,f;if(this._request){let g=this._request.getActiveDocument();r=this._request.documents.length,n=this._request.documents.reduce((y,E)=>y+E.recentEdits.edits.length,0),o=g.recentEdits.edits.length,s=g.languageId,c=g.documentAfterEditsLines.length,l=g.id.toUri().scheme===TAc.Schemas.vscodeNotebookCell||this._notebookService?.hasSupportedNotebooks(g.id.toUri())||!1,u=this._workspaceService===void 0?void 0:(0,bAc.findNotebook)(g.id.toUri(),this._workspaceService.notebookDocuments)?.notebookType;let A=this._gitExtensionService?.getExtensionApi();if(A){let y=A.getRepository(f8i.Uri.parse(g.id.uri));if(y){let v=(0,u8i.getUpstreamRemote)(y);v?.fetchUrl&&(d=v.pushUrl||v.fetchUrl)}let E=new Set,_=[...new Set(this._request.documents.map(v=>A.getRepository(f8i.Uri.parse(v.id.uri))).filter(Boolean))];for(let v of _){let b=v?(0,u8i.getUpstreamRemote)(v):void 0;b?.fetchUrl&&E.add(b.fetchUrl),b?.pushUrl&&E.add(b.pushUrl)}f=[...E]}}let h;if(e&&this.editCollectingInfo!==void 0){let g=this.editCollectingInfo.originalDoc.value,A;if(this._debugRecorder&&this._requestBookmark){let y=this._debugRecorder.getRecentLog(),E=JSON.stringify(y)?.length||0;A={entries:E>200*1024?void 0:y,entriesSize:E,requestTime:this._requestBookmark.timeMs}}h={text:g.length>200*1024?void 0:g,textLength:g.length,selection:this.editCollectingInfo.originalSelection.map(y=>({start:y.start,endExclusive:y.endExclusive})),edits:this.editCollectingInfo.edits.map(y=>y.edit.replacements.map(E=>({time:y.time.toISOString(),start:E.replaceRange.start,endExclusive:E.replaceRange.endExclusive,newText:E.newText}))).flat(),tags:[],recording:A}}let m=this._statelessNextEditTelemetry?.fetchStartedAt===void 0?void 0:this._statelessNextEditTelemetry.fetchStartedAt-this._startTime;return{providerId:this._providerId,headerRequestId:this._headerRequestId,nextEditProviderDuration:this._duration,isFromCache:this._isFromCache,reusedRequest:this._reusedRequest,subsequentEditOrder:this._subsequentEditOrder,documentsCount:r,editsCount:n,activeDocumentEditsCount:o,activeDocumentLanguageId:s,activeDocumentOriginalLineCount:c,fetchStartedAfterMs:m,hasNextEdit:this._hasNextEdit,wasPreviouslyRejected:this._wasPreviouslyRejected,isNotebook:l,notebookType:u,status:this._status,nextEditProviderError:this._nextEditProviderError,alternativeAction:h,...this._statelessNextEditTelemetry,activeDocumentRepository:d,repositoryUrls:f,nesConfigs:this._nesConfigs}}get originalSelectionLine(){return this.editCollectingInfo?.originalSelectionLine}setRequestBookmark(e){this._requestBookmark=e}constructor(e,r,n,o,s,c,l){super(),this._gitExtensionService=e,this._notebookService=r,this._workspaceService=n,this._providerId=o,this._doc=s,this._debugRecorder=c,this._requestBookmark=l,this._isFromCache=!1,this._hasNextEdit=!1,this._wasPreviouslyRejected=!1,this._status="new",this._startTime=Date.now(),this._doc&&(this.editCollectingInfo={originalDoc:this._doc.value.get(),originalSelection:this._doc.selection.get(),originalSelectionLine:this._doc.primarySelectionLine.get(),edits:[]},this._store.add((0,CAc.autorunWithChanges)(this,{value:this._doc.value},u=>{let d=new Date;u.value.changes.forEach(f=>{this.editCollectingInfo?.edits.push({time:d,edit:f})})})))}setNESConfigs(e){return this._nesConfigs=e,this}setHeaderRequestId(e){return this._headerRequestId=e,this}setIsFromCache(){return this._isFromCache=!0,this}setReusedRequest(e){return this._reusedRequest=e,this}setSubsequentEditOrder(e){return this._subsequentEditOrder=e,this}setRequest(e){return this._request=e,this}setStatelessNextEditTelemetry(e){return this._statelessNextEditTelemetry=e,this}setHasNextEdit(e){return this._hasNextEdit=e,this}setWasPreviouslyRejected(){return this._wasPreviouslyRejected=!0,this}markEndTime(){return this._duration=Date.now()-this._startTime,this}setStatus(e){return this._status=e,this}setNextEditProviderError(e){return this._nextEditProviderError=e,this}};L0.LlmNESTelemetryBuilder=Wvt;var zvt=class{static{a(this,"DiagnosticsTelemetryBuilder")}constructor(){this._droppedReasons=[]}build(){let e=this._droppedReasons.length>0?JSON.stringify(this._droppedReasons):void 0;return{diagnosticType:this._type,diagnosticDroppedReasons:e,diagnosticAlternativeImportsCount:this._diagnosticRunTelemetry?.alternativeImportsCount,diagnosticHasExistingSameFileImport:this._diagnosticRunTelemetry?.hasExistingSameFileImport,diagnosticIsLocalImport:this._diagnosticRunTelemetry?.isLocalImport,diagnosticDistanceToUnknownDiagnostic:this._diagnosticRunTelemetry?.distanceToUnknownDiagnostic,diagnosticDistanceToAlternativeDiagnostic:this._diagnosticRunTelemetry?.distanceToAlternativeDiagnostic,diagnosticHasAlternativeDiagnosticForSameRange:this._diagnosticRunTelemetry?.hasAlternativeDiagnosticForSameRange}}populate(e){this._droppedReasons.forEach(r=>e.addDroppedReason(r)),this._type&&e.setType(this._type),this._diagnosticRunTelemetry&&e.setDiagnosticRunTelemetry(this._diagnosticRunTelemetry)}setType(e){return this._type=e,this}addDroppedReason(e){return this._droppedReasons.push(e),this}setDiagnosticRunTelemetry(e){return this._diagnosticRunTelemetry=e,this}};L0.DiagnosticsTelemetryBuilder=zvt;var wNr=class t extends Vvt.Disposable{static{a(this,"NextEditProviderTelemetryBuilder")}static{this.providerIdToReqN=new Map}get isSent(){return this._isSent}markAsSent(){this._isSent=!0}build(e){let r=this._nesBuilder.build(e),n=this._diagnosticsBuilder.build();return{...r,...n,opportunityId:this._opportunityId||"",requestN:this._requestN,isShown:this._isShown,acceptance:this._acceptance,disposalReason:this._disposalReason,supersededByOpportunityId:this._supersededByOpportunityId,pickedNES:this._nesTypePicked,hadLlmNES:this._hadLlmNES,isMultilineEdit:this._isMultilineEdit,isEolDifferent:this._isEolDifferent,isActiveDocument:this._isActiveDocument,isNextEditorVisible:this._isNextEditorVisible,isNextEditorRangeVisible:this._isNextEditorRangeVisible,isNESForAnotherDoc:this._isNESForAnotherDoc,notebookId:this._notebookId,notebookCellLines:this._notebookCellLines,notebookCellMarkerCount:this._notebookCellMarkerCount,notebookCellMarkerIndex:this._notebookCellMarkerIndex,hadDiagnosticsNES:this._hadDiagnosticsNES,configIsDiagnosticsNESEnabled:this._configIsDiagnosticsNESEnabled,isNaturalLanguageDominated:this._isNaturalLanguageDominated,postProcessingOutcome:this._postProcessingOutcome,userTypingDisagreed:this._userTypingDisagreed}}get nesBuilder(){return this._nesBuilder}get diagnosticsBuilder(){return this._diagnosticsBuilder}constructor(e,r,n,o,s,c,l){super(),this.doc=s,this._isSent=!1,this._isShown=!1,this._acceptance="notAccepted",this._disposalReason=void 0,this._supersededByOpportunityId=void 0,this._userTypingDisagreed=void 0,this._notebookCellMarkerCount=0,this._notebookCellMarkerIndex=-1,this._isNESForAnotherDoc=!1,this._hadLlmNES=!1,this._hadDiagnosticsNES=!1,this._configIsDiagnosticsNESEnabled=!1,this._isNaturalLanguageDominated=!1;let u=t.providerIdToReqN.get(o)||0;this._requestN=++u,t.providerIdToReqN.set(o,u),this._nesBuilder=this._register(new Wvt(e,r,n,o,s,c,l)),this._diagnosticsBuilder=new zvt}setOpportunityId(e){return this._opportunityId=e,this}setAsShown(){return this._isShown=!0,this}setAcceptance(e){return this._acceptance=e,this}setDisposalReason(e){return this._disposalReason=e,this}setSupersededBy(e){return this._supersededByOpportunityId=e,this}setUserTypingDisagreed(e){return this._userTypingDisagreed=e,this}setPickedNESType(e){return this._nesTypePicked=e,this}setIsActiveDocument(e){return this._isActiveDocument=e,this}setNotebookCellMarkerCount(e){return this._notebookCellMarkerCount=e,this}setIsMultilineEdit(e){return this._isMultilineEdit=e,this}setIsEolDifferent(e){return this._isEolDifferent=e,this}setIsNextEditorVisible(e){return this._isNextEditorVisible=e,this}setIsNextEditorRangeVisible(e){return this._isNextEditorRangeVisible=e,this}setNotebookId(e){return this._notebookId=e,this}setNotebookCellLines(e){return this._notebookCellLines=e,this}setNotebookCellMarkerIndex(e){return this._notebookCellMarkerIndex=e,this}setIsNESForOtherEditor(e){return this._isNESForAnotherDoc=e,this}setHadLlmNES(e){return this._hadLlmNES=e,this}setHadDiagnosticsNES(e){return this._hadDiagnosticsNES=e,this}setStatus(e){return this._nesBuilder.setStatus(e),this}setConfigIsDiagnosticsNESEnabled(e){return this._configIsDiagnosticsNESEnabled=e,this}setIsNaturalLanguageDominated(e){return this._isNaturalLanguageDominated=e,this}setPostProcessingOutcome(e){let r=e.displayLocation?{label:e.displayLocation.label,range:e.displayLocation.range.toString()}:void 0;return this._postProcessingOutcome=JSON.stringify({suggestedEdit:e.edit.toString(),isInlineCompletion:e.isInlineCompletion,displayLocation:r}),this}};L0.NextEditProviderTelemetryBuilder=wNr;var RNr=class{static{a(this,"IdleDetector")}get isDisposed(){return this._store.isDisposed}constructor(e,r,n){this._onIdle=r,this._onUserJump=n,this._store=new Vvt.DisposableStore,this._disposalTracker=new Vvt.RefCountedDisposable(this._store),this._selectionSnapshots=new Map,this._lastEditTime=0;let o=5e3,s=this._store.add(new SAc.RunOnceScheduler(()=>{this._onIdle(o)},o));this._idleScheduler=s;let c=!0;this._store.add((0,d8i.autorun)(u=>{if(e.onDidOpenDocumentChange.read(u),c){c=!1;return}this._lastEditTime=Date.now(),s.schedule()}));let l=!0;this._store.add((0,d8i.autorunHandleChanges)({owner:this,changeTracker:{createChangeSummary:a(()=>({removed:[]}),"createChangeSummary"),handleChange:a((u,d)=>(u.didChange(e.openDocuments)&&(d.removed=u.change.removed),!0),"handleChange")}},(u,d)=>{if(this._store.isDisposed)return;let f=e.openDocuments.read(u);for(let h of f)h.primarySelectionLine.read(u);if(l){l=!1;for(let h of f)this._selectionSnapshots.set(h.id.uri,h.primarySelectionLine.get());return}for(let h of d.removed)this._selectionSnapshots.delete(h.id.uri);if(!(Date.now()-this._lastEditTime<200))for(let h of f){let m=h.id.uri,g=h.primarySelectionLine.get();if(this._selectionSnapshots.get(m)!==g){this._selectionSnapshots.set(m,g),this._onUserJump(m,g);return}}}))}scheduleIdleTimer(){this._idleScheduler?.schedule()}acquire(){this._disposalTracker.acquire()}release(){this._disposalTracker.release()}forceDispose(){this._store.dispose()}},kNr=class{static{a(this,"TelemetrySender")}constructor(e,r){this._workspace=e,this._telemetryService=r,this._map=new Map}scheduleSendingEnhancedTelemetry(e,r){let n=this._map.get(e);n&&(n.builder!==r&&n.builder.dispose(),this._removeEntry(e,n));let o=setTimeout(()=>{this._enterIdleDetection(e,r)},120*1e3);this._map.set(e,{builder:r,timeout:o})}_enterIdleDetection(e,r){let n=this._workspace;if(!n){this._buildAndSendEnhancedTelemetry(e,r,{reason:"idle",details:{idleTimeoutMs:0}});return}this._idleDetector?this._idleDetector.acquire():this._idleDetector=new RNr(n,l=>this._sendAllPendingInIdlePhase({reason:"idle",details:{idleTimeoutMs:l}}),(l,u)=>this._sendAllPendingInIdlePhaseWithJump(l,u)),this._idleDetector.scheduleIdleTimer();let o=3e4,s=setTimeout(()=>{this._sendForEntry(e,{reason:"hard_cap",details:{hardCapTimeoutMs:o}})},o),c=this._map.get(e);c&&(c.hardCapTimeout=s)}_releaseIdleDetector(){this._idleDetector?.release(),this._idleDetector?.isDisposed&&(this._idleDetector=void 0)}_sendAllPendingInIdlePhase(e){let r=[];for(let[n,o]of this._map)o.hardCapTimeout!==void 0&&r.push(n);for(let n of r)this._sendForEntry(n,e)}_sendAllPendingInIdlePhaseWithJump(e,r){let n=[];for(let[o,s]of this._map)s.hardCapTimeout!==void 0&&n.push([o,s.builder]);for(let[o,s]of n){let c=s.doc?.id.uri,l=s.nesBuilder.originalSelectionLine,u=c!==void 0&&l!==void 0?{file:c,line:l}:void 0;this._sendForEntry(o,{reason:"user_jump",details:{from:u,to:{file:e,line:r}}})}}_sendForEntry(e,r){let n=this._map.get(e);if(!n)return;n.hardCapTimeout!==void 0&&(clearTimeout(n.hardCapTimeout),this._releaseIdleDetector()),this._map.delete(e);let o;try{o=n.builder.build(!0)}finally{n.builder.dispose()}this._doSendEnhancedTelemetry(o,r)}_removeEntry(e,r){clearTimeout(r.timeout),r.hardCapTimeout!==void 0&&(clearTimeout(r.hardCapTimeout),this._releaseIdleDetector()),this._map.delete(e)}_buildAndSendEnhancedTelemetry(e,r,n){let o;this._map.delete(e);try{o=r.build(!0)}finally{r.dispose()}this._doSendEnhancedTelemetry(o,n)}sendTelemetry(e,r){if(e){let o=this._map.get(e);o&&this._removeEntry(e,o)}let n=r.build(!0);r.isSent||(this._doSendTelemetry(n),r.markAsSent()),this._doSendEnhancedTelemetry(n,void 0)}sendTelemetryForBuilder(e){if(e.isSent)return;let r=e.build(!1);this._doSendTelemetry(r),e.markAsSent()}async _doSendTelemetry(e){let{opportunityId:r,headerRequestId:n,requestN:o,providerId:s,modelName:c,hadStatelessNextEditProviderCall:l,statelessNextEditProviderDuration:u,nextEditProviderDuration:d,isFromCache:f,reusedRequest:h,subsequentEditOrder:m,activeDocumentLanguageId:g,activeDocumentOriginalLineCount:A,nLinesOfCurrentFileInPrompt:y,wasPreviouslyRejected:E,isShown:_,isNotebook:v,notebookType:b,isNESForAnotherDoc:T,isActiveDocument:w,isEolDifferent:R,isMultilineEdit:x,isNextEditorRangeVisible:P,isNextEditorVisible:D,acceptance:N,disposalReason:L,logProbThreshold:B,documentsCount:j,editsCount:M,activeDocumentEditsCount:O,promptLineCount:U,promptCharCount:q,hadLowLogProbSuggestion:Q,nEditsSuggested:Y,lineDistanceToMostRecentEdit:W,isCursorAtEndOfLine:V,isInlineSuggestion:z,debounceTime:ie,artificialDelay:H,hasNextEdit:te,notebookCellMarkerCount:le,notebookCellMarkerIndex:Le,notebookId:ge,notebookCellLines:Oe,nextEditLogprob:we,supersededByOpportunityId:re,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchStartedAfterMs:he,response:X,configIsDiagnosticsNESEnabled:de,isNaturalLanguageDominated:qe,diagnosticType:ne,diagnosticDroppedReasons:ue,diagnosticHasExistingSameFileImport:Ne,diagnosticIsLocalImport:Ie,diagnosticAlternativeImportsCount:Be,diagnosticDistanceToUnknownDiagnostic:tt,diagnosticDistanceToAlternativeDiagnostic:st,diagnosticHasAlternativeDiagnosticForSameRange:_t,hadDiagnosticsNES:kt,hadLlmNES:Ht,pickedNES:F,xtabAggressivenessLevel:se,xtabUserHappinessScore:be,userAggressivenessSetting:Fe,modelConfig:Ue}=e,me,Z,ve,Ge;if(X!==void 0){let{response:Qe,ttft:je,fetchResult:J,fetchTime:ae}=await X;Qe.type===l8i.ChatFetchResponseType.Success&&(me=Qe.usage),Z=je,ve=J,Ge=ae}this._sendTelemetryToBoth({opportunityId:r,headerRequestId:n,providerId:s,modelName:c,activeDocumentLanguageId:g,mergeConflictExpanded:e.mergeConflictExpanded,acceptance:N,disposalReason:L,supersededByOpportunityId:re,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchResult:ve,nextEditProviderError:e.nextEditProviderError,reusedRequest:h,diagnosticType:ne,diagnosticDroppedReasons:ue,pickedNES:F,notebookType:b,notebookId:ge,notebookCellLines:Oe,nextCursorLineError:e.nextCursorPrediction?.nextCursorLineError,xtabAggressivenessLevel:se,userAggressivenessSetting:Fe,modelConfig:Ue,neighborSnippetIndicesInPrompt:e.neighborSnippetIndicesInPrompt},{requestN:o,hadStatelessNextEditProviderCall:this._boolToNum(l),statelessNextEditProviderDuration:u,nextEditProviderDuration:d,isFromCache:this._boolToNum(f),subsequentEditOrder:m,activeDocumentOriginalLineCount:A,activeDocumentNLinesInPrompt:y,wasPreviouslyRejected:this._boolToNum(E),isShown:this._boolToNum(_),isNotebook:this._boolToNum(v),isNESForAnotherDoc:this._boolToNum(T),isActiveDocument:this._boolToNum(w),isEolDifferent:this._boolToNum(R),isMultilineEdit:this._boolToNum(x),isNextEditorRangeVisible:this._boolToNum(P),isNextEditorVisible:this._boolToNum(D),hasNotebookCellMarker:le>0?1:0,notebookCellMarkerCount:le,notebookCellMarkerIndex:Le,logProbThreshold:B,documentsCount:j,editsCount:M,activeDocumentEditsCount:O,promptLineCount:U,promptCharCount:q,hadLowLogProbSuggestion:this._boolToNum(Q),nEditsSuggested:Y,lineDistanceToMostRecentEdit:W,isCursorAtEndOfLine:this._boolToNum(V),isInlineSuggestion:this._boolToNum(z),debounceTime:ie,artificialDelay:H,fetchStartedAfterMs:he,ttft:Z,fetchTime:Ge,promptTokens:me?.prompt_tokens,responseTokens:me?.completion_tokens,cachedTokens:me?.prompt_tokens_details?.cached_tokens,acceptedPredictionTokens:me?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:me?.completion_tokens_details?.rejected_prediction_tokens,hasNextEdit:this._boolToNum(te),userTypingDisagreed:this._boolToNum(e.userTypingDisagreed),nextEditLogprob:we,hadDiagnosticsNES:this._boolToNum(kt),hadLlmNES:this._boolToNum(Ht),configIsDiagnosticsNESEnabled:this._boolToNum(de),isNaturalLanguageDominated:this._boolToNum(qe),diagnosticHasExistingSameFileImport:this._boolToNum(Ne),diagnosticIsLocalImport:this._boolToNum(Ie),diagnosticAlternativeImportsCount:Be,diagnosticDistanceToUnknownDiagnostic:tt,diagnosticDistanceToAlternativeDiagnostic:st,diagnosticHasAlternativeDiagnosticForSameRange:this._boolToNum(_t),nextCursorLineDistance:e.nextCursorPrediction?.nextCursorLineDistance,xtabUserHappinessScore:be,nDiffsInPrompt:e.nDiffsInPrompt,diffTokensInPrompt:e.diffTokensInPrompt,nNeighborSnippetsComputed:e.nNeighborSnippetsComputed,nNeighborSnippetsInPrompt:e.nNeighborSnippetsInPrompt})}_sendTelemetryToBoth(e,r){this._telemetryService.sendMSFTTelemetryEvent("provideInlineEdit",e,r),this._telemetryService.sendGHTelemetryEvent(L0.NES_GH_TELEMETRY_EVENT_NAME,e,r)}async _doSendEnhancedTelemetry(e,r){let{opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,status:l,modelName:u,prompt:d,response:f,alternativeAction:h,postProcessingOutcome:m,activeDocumentRepository:g,repositoryUrls:A,cursorJumpModelName:y,cursorJumpPrompt:E,cursorJumpResponse:_,lintErrors:v,terminalOutput:b,similarFilesContext:T,modelConfig:w,isFromCache:R}=e,x=f===void 0?f:await f,P=await T?.catch(()=>{}),D=x?.fetchResult;this._telemetryService.sendEnhancedGHTelemetryEvent(L0.NES_GH_TELEMETRY_EVENT_NAME,(0,p8i.multiplexProperties)({opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,suggestionStatus:l,modelName:u,prompt:d,modelResponse:x===void 0||x.response.type!==l8i.ChatFetchResponseType.Success?void 0:x.response.value,fetchResult:D,alternativeAction:h?JSON.stringify({...h,enhancedTelemetrySendingReason:r}):void 0,enhancedTelemetrySendingReason:!h&&r?JSON.stringify(r):void 0,postProcessingOutcome:m,activeDocumentRepository:g,repositories:JSON.stringify(A),cursorJumpModelName:y,cursorJumpPrompt:E,cursorJumpResponse:_,lintErrors:v,terminalOutput:b,similarFilesContext:P,modelConfig:w}),{isFromCache:this._boolToNum(R)})}_boolToNum(e){return e===void 0?void 0:e?1:0}dispose(){for(let e of this._map.values())clearTimeout(e.timeout),e.hardCapTimeout!==void 0&&clearTimeout(e.hardCapTimeout),e.builder.dispose();this._map.clear(),this._idleDetector&&(this._idleDetector.forceDispose(),this._idleDetector=void 0)}};L0.TelemetrySender=kNr;L0.TelemetrySender=kNr=_Ac([vAc(1,p8i.ITelemetryService)],kNr)});var DNr=I(Bye=>{"use strict";p();Object.defineProperty(Bye,"__esModule",{value:!0});Bye.NullPowerService=Bye.IPowerService=void 0;var m8i=Rc(),IAc=$s();Bye.IPowerService=(0,IAc.createDecorator)("IPowerService");var PNr=class{static{a(this,"NullPowerService")}constructor(){this.onDidSuspend=m8i.Event.None,this.onDidResume=m8i.Event.None}acquirePowerSaveBlocker(){return{dispose:a(()=>{},"dispose")}}};Bye.NullPowerService=PNr});var l9=I(iV=>{"use strict";p();Object.defineProperty(iV,"__esModule",{value:!0});iV.FetchStreamRecorder=iV.FetchStreamSource=iV.IChatMLFetcher=void 0;var xAc=nn(),wAc=nl();iV.IChatMLFetcher=(0,xAc.createServiceIdentifier)("IChatMLFetcher");var NNr=class{static{a(this,"FetchStreamSource")}get stream(){return this._stream.asyncIterable}constructor(){this._stream=new wAc.AsyncIterableSource,this._seenAnnotationTypes=new Set}pause(){this._paused??=[]}unpause(){let e=this._paused;if(e){this._paused=void 0;for(let r of e)r?this.update(r.text,r.delta):this.resolve()}}update(e,r){if(this._paused){this._paused.push({text:e,delta:r});return}r.codeVulnAnnotations&&(!((e.match(/(^|\n)```/g)?.length??0)%2===1)||e.match(/(^|\n)```\w*\s*$/))&&(r.codeVulnAnnotations=void 0),r.codeVulnAnnotations&&(r.codeVulnAnnotations=r.codeVulnAnnotations.filter(n=>!this._seenAnnotationTypes.has(n.details.type)),r.codeVulnAnnotations.forEach(n=>this._seenAnnotationTypes.add(n.details.type))),this._stream.emitOne({delta:r})}resolve(){if(this._paused){this._paused.push(void 0);return}this._stream.resolve()}reject(e){this._paused=void 0,this._stream.reject(e)}};iV.FetchStreamSource=NNr;var MNr=class{static{a(this,"FetchStreamRecorder")}get firstTokenEmittedTime(){return this._firstTokenEmittedTime}get outputChunkGapsMs(){return this._outputChunkGapsMs}constructor(e){this.deltas=[],this._outputChunkGapsMs=[],this.callback=async(r,n,o)=>{if(!!(o.text||o.beginToolCalls||typeof o.thinking?.text=="string"&&o.thinking?.text||o.thinking?.text?.length||o.copilotToolCalls||o.copilotToolCallStreamUpdates)){let l=Date.now();this._firstTokenEmittedTime===void 0?this._firstTokenEmittedTime=l:this._lastOutputChunkTime!==void 0&&this._outputChunkGapsMs.push(l-this._lastOutputChunkTime),this._lastOutputChunkTime=l}let c=e?await e(r,n,o):void 0;return this.deltas.push(o),c}}};iV.FetchStreamRecorder=MNr});var ONr=I(Yvt=>{"use strict";p();Object.defineProperty(Yvt,"__esModule",{value:!0});Yvt.IChatQuotaService=void 0;var RAc=nn();Yvt.IChatQuotaService=(0,RAc.createServiceIdentifier)("IChatQuotaService")});var LNr=I(Kvt=>{"use strict";p();Object.defineProperty(Kvt,"__esModule",{value:!0});Kvt.IConversationOptions=void 0;var kAc=nn();Kvt.IConversationOptions=(0,kAc.createServiceIdentifier)("ConversationOptions")});var IBe=I(Fye=>{"use strict";p();Object.defineProperty(Fye,"__esModule",{value:!0});Fye.getTextPart=DAc;Fye.toTextPart=g8i;Fye.toTextParts=NAc;Fye.roleToString=MAc;var Vne=Io(),PAc=sd();function DAc(t){return t?typeof t=="string"?t:Array.isArray(t)?t.map(e=>e.type===Vne.Raw.ChatCompletionContentPartKind.Text||e.type==="text"?e.text:"").join(""):t.type===Vne.Raw.ChatCompletionContentPartKind.Text?t.text:"":""}a(DAc,"getTextPart");function g8i(t){return{type:Vne.Raw.ChatCompletionContentPartKind.Text,text:t}}a(g8i,"toTextPart");function NAc(t){return[g8i(t)]}a(NAc,"toTextParts");function MAc(t){switch(t){case Vne.Raw.ChatRole.System:return"system";case Vne.Raw.ChatRole.User:return"user";case Vne.Raw.ChatRole.Assistant:return"assistant";case Vne.Raw.ChatRole.Tool:return"tool";default:(0,PAc.assertNever)(t,`unknown role (${t})`)}}a(MAc,"roleToString")});var FNr=I(Uye=>{"use strict";p();Object.defineProperty(Uye,"__esModule",{value:!0});Uye.InteractionService=Uye.IInteractionService=void 0;var OAc=nn(),A8i=x0();Uye.IInteractionService=(0,OAc.createServiceIdentifier)("IInteractionService");var BNr=class{static{a(this,"InteractionService")}constructor(){this._interactionId=(0,A8i.generateUuid)()}startInteraction(){this._interactionId=(0,A8i.generateUuid)()}get interactionId(){return this._interactionId}};Uye.InteractionService=BNr});var QNr=I(Jvt=>{"use strict";p();Object.defineProperty(Jvt,"__esModule",{value:!0});Jvt.SSEParser=void 0;var UNr=class{static{a(this,"SSEParser")}constructor(e){this.dataBuffer="",this.eventTypeBuffer="",this.buffer=[],this.endedOnCR=!1,this.onEventHandler=e,this.decoder=new TextDecoder("utf-8")}getLastEventId(){return this.lastEventIdBuffer}getReconnectionTime(){return this.reconnectionTime}feed(e){if(e.length===0)return;let r=0;for(this.endedOnCR&&e[0]===10&&r++,this.endedOnCR=!1;r{"use strict";p();Object.defineProperty(ho,"__esModule",{value:!0});ho.getModelCapabilityOverride=y0c;ho.getModelId=W$;ho.isHiddenModelA=E0c;ho.isHiddenModelB=VDr;ho.isHiddenModelE=Ivt;ho.isHiddenModelF=xvt;ho.isHiddenFamilyH=wvt;ho.isHiddenModelK=_0c;ho.isGpt54=WDr;ho.isGpt55=v0c;ho.isHiddenModelM=iBe;ho.isGpt53Codex=zDr;ho.isVSCModelA=Rvt;ho.isVSCModelB=kvt;ho.isVSCModelReplaceStringSet=oBe;ho.isVSCModelC=C0c;ho.isVSCModelD=b0c;ho.isGpt52CodexFamily=YDr;ho.isGpt52Family=KDr;ho.modelPrefersInstructionsInUserMessage=S0c;ho.modelPrefersInstructionsAfterHistory=T0c;ho.modelSupportsApplyPatch=I0c;ho.modelPrefersJsonNotebookRepresentation=x0c;ho.modelSupportsReplaceString=w0c;ho.modelSupportsMultiReplaceString=N3i;ho.modelCanUseReplaceStringExclusively=R0c;ho.modelShouldUseReplaceStringHealing=k0c;ho.modelCanUseMcpResultImageURL=P0c;ho.modelCanUseImageURL=D0c;ho.modelSupportsPDFDocuments=N0c;ho.modelCanUseApplyPatchExclusively=M0c;ho.modelNeedsStrongReplaceStringHint=O0c;ho.modelSupportsSimplifiedApplyPatchInstructions=L0c;ho.isAnthropicFamily=sBe;ho.isGeminiFamily=JDr;ho.isMinimaxFamily=Pvt;ho.isGpt5PlusFamily=Dvt;ho.isGptCodexFamily=B0c;ho.isGpt5Family=F0c;ho.isGptFamily=U0c;ho.isGpt51Family=Q0c;ho.getVerbosityForModelSync=q0c;ho.modelSupportsToolSearch=j0c;ho.modelSupportsContextEditing=H0c;var Nm=PPr(),d0c=Pl(),f0c=["a99dd17dfee04155d863268596b7f6dd36d0a6531cd326348dbe7416142a21a3","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95"],P3i=["1f48b3271e760c69ab2b17dcae5f5c661fa5b644c5976a8a99b23e05ae3cb6d6","ffc50c70661c227edf8daae6f8dbed2dd0645386c12d43bc7fc44da166e043bd","257c934076307881132be702a901618969591f0e11e1df51b22b1d4010f0a0d0"],I3i=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7"],x3i=["6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c"],w3i=["0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73"],R3i=["e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],k3i=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c","0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73","e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],p0c=["6013de0381f648b7f21518885c02b40b7583adfb33c6d9b64d3aed52c3934798"],h0c=["ab45e8474269b026f668d49860b36850122e18a50d5ea38f3fefdae08261865c","9542d5c077c2bc379f92be32272b14be8b94a8841323465db0d5b3d6f4f0dab0"],m0c=["0a4346f806b28b3ce94905c3ac56fcd5ee2337d8613161696aba52eb0c3551cc","2a7b79b0151aa44a0abee17adc0e18df1c07d8d15d7affa989c3b3afb6bee0a0","f3c2984127dd2db50a555194925ca0d55c3c7b676e889c9406b2e6875a67e29c","5a81e6aa7556585ba7c569881d1103683adc9e0124ff7952df423afba2f167b5"],D3i="a62e299160a1075d9973c28a7aa77f446c21c09887c7aa65c11022918cf83eda",g0c=["70fcded3f255d368e868cc807d8838a62108bfa5c86ce7d37966f58cda229e33"],A0c=["0902565c0c0fe145633a1f246ae551acc0f621249ef050428eba357fbd4655ee"];function y0c(t,e){return e.getConfig(d0c.ConfigKey.Advanced.ModelCapabilityOverrides)?.[t]}a(y0c,"getModelCapabilityOverride");function W$(t){return"id"in t?t.id:t.model}a(W$,"getModelId");function E0c(t){let e=(0,Nm.getCachedSha256Hash)(t.family);return f0c.includes(e)}a(E0c,"isHiddenModelA");function VDr(t){let e=(0,Nm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return P3i.includes(e)}a(VDr,"isHiddenModelB");function Ivt(t){let e=(0,Nm.getCachedSha256Hash)(t.family);return p0c.includes(e)}a(Ivt,"isHiddenModelE");function xvt(t){let e=(0,Nm.getCachedSha256Hash)(t.family);return h0c.includes(e)}a(xvt,"isHiddenModelF");function wvt(t){let e=(0,Nm.getCachedSha256Hash)(t.family);return g0c.includes(e)}a(wvt,"isHiddenFamilyH");function _0c(t){return(0,Nm.getCachedSha256Hash)(t.family)===D3i}a(_0c,"isHiddenModelK");function WDr(t){let e=(0,Nm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.4")||m0c.includes(e)}a(WDr,"isGpt54");function v0c(t){let e=(0,Nm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.5")||P3i.includes(e)}a(v0c,"isGpt55");function iBe(t){let e=(0,Nm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return A0c.includes(e)}a(iBe,"isHiddenModelM");function zDr(t){return(typeof t=="string"?t:t.family).startsWith("gpt-5.3-codex")}a(zDr,"isGpt53Codex");function Rvt(t){let e=(0,Nm.getCachedSha256Hash)(W$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return I3i.includes(e)||I3i.includes(r)}a(Rvt,"isVSCModelA");function kvt(t){let e=(0,Nm.getCachedSha256Hash)(W$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return x3i.includes(e)||x3i.includes(r)}a(kvt,"isVSCModelB");function oBe(t){let e=(0,Nm.getCachedSha256Hash)(W$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return k3i.includes(e)||k3i.includes(r)}a(oBe,"isVSCModelReplaceStringSet");function C0c(t){let e=(0,Nm.getCachedSha256Hash)(W$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return w3i.includes(e)||w3i.includes(r)}a(C0c,"isVSCModelC");function b0c(t){let e=(0,Nm.getCachedSha256Hash)(W$(t)),r=(0,Nm.getCachedSha256Hash)(t.family);return R3i.includes(e)||R3i.includes(r)}a(b0c,"isVSCModelD");function YDr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2-codex"}a(YDr,"isGpt52CodexFamily");function KDr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2"}a(KDr,"isGpt52Family");function S0c(t){return t.includes("claude-3.5-sonnet")}a(S0c,"modelPrefersInstructionsInUserMessage");function T0c(t){return t.includes("claude-3.5-sonnet")}a(T0c,"modelPrefersInstructionsAfterHistory");function I0c(t){return oBe(t)?!1:t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||YDr(t.family)||zDr(t.family)||Rvt(t)||kvt(t)||KDr(t.family)||WDr(t)||VDr(t)||iBe(t)}a(I0c,"modelSupportsApplyPatch");function x0c(t){return t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||YDr(t.family)||zDr(t.family)||KDr(t.family)||WDr(t)||VDr(t)||iBe(t)}a(x0c,"modelPrefersJsonNotebookRepresentation");function w0c(t){return JDr(t)||t.family.includes("grok-code")||N3i(t)||xvt(t)||Pvt(t)||wvt(t)}a(w0c,"modelSupportsReplaceString");function N3i(t){return sBe(t)||Ivt(t)||oBe(t)||Pvt(t)||wvt(t)}a(N3i,"modelSupportsMultiReplaceString");function R0c(t){return sBe(t)||t.family.includes("grok-code")||Ivt(t)||t.family.toLowerCase().includes("gemini-3")||oBe(t)||xvt(t)||Pvt(t)||wvt(t)}a(R0c,"modelCanUseReplaceStringExclusively");function k0c(t){return t.family.includes("gemini-2")}a(k0c,"modelShouldUseReplaceStringHealing");function P0c(t){return!sBe(t)&&!Ivt(t)}a(P0c,"modelCanUseMcpResultImageURL");function D0c(t){return!0}a(D0c,"modelCanUseImageURL");function N0c(t){return sBe(t)||Dvt(t)||iBe(t)}a(N0c,"modelSupportsPDFDocuments");function M0c(t){return oBe(t)?!1:Dvt(t)||Rvt(t)||kvt(t)}a(M0c,"modelCanUseApplyPatchExclusively");function O0c(t){return JDr(t)||xvt(t)}a(O0c,"modelNeedsStrongReplaceStringHint");function L0c(t){return Dvt(t)||Rvt(t)||kvt(t)}a(L0c,"modelSupportsSimplifiedApplyPatchInstructions");function sBe(t){return t.family.startsWith("claude")||t.family.startsWith("Anthropic")}a(sBe,"isAnthropicFamily");function JDr(t){let e=typeof t=="string"?t:t.family;return e.toLowerCase().startsWith("gemini")||(0,Nm.getCachedSha256Hash)(e)===D3i}a(JDr,"isGeminiFamily");function Pvt(t){return t.family.toLowerCase().includes("minimax")}a(Pvt,"isMinimaxFamily");function Dvt(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5"):!1}a(Dvt,"isGpt5PlusFamily");function B0c(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return!!e.startsWith("gpt-")&&e.includes("-codex")}a(B0c,"isGptCodexFamily");function F0c(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return e==="gpt-5"||e==="gpt-5-mini"||e==="gpt-5-codex"}a(F0c,"isGpt5Family");function U0c(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-"):!1}a(U0c,"isGptFamily");function Q0c(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5.1"):!1}a(Q0c,"isGpt51Family");function q0c(t){if(t.family==="gpt-5.1"||t.family==="gpt-5-mini")return"low"}a(q0c,"getVerbosityForModelSync");function j0c(t){let e=typeof t=="string"?t:W$(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s==="gpt-5-4"||s==="gpt-5-5"?!0:!s.startsWith("claude")||s.startsWith("claude-haiku")?!1:!(s.startsWith("claude-1")||s.startsWith("claude-2")||s.startsWith("claude-3")||s.startsWith("claude-instant")||s==="claude-sonnet-4"||s.startsWith("claude-sonnet-4-2")||s==="claude-opus-4"||s.startsWith("claude-opus-4-1")||s.startsWith("claude-opus-4-2"))},"matches");return n(e)||n(r)||iBe(r)}a(j0c,"modelSupportsToolSearch");function H0c(t){let e=typeof t=="string"?t:W$(t),r=typeof t=="string"?t:t.family,n=a(l=>l.toLowerCase().replace(/\./g,"-"),"normalize"),o=n(e),s=n(r);if(o.includes("1m")||s.includes("1m"))return!1;let c=a(l=>l.startsWith("claude-fable-5")||l.startsWith("claude-haiku-4-5")||l.startsWith("claude-sonnet-4-6")||l.startsWith("claude-sonnet-4-5")||l.startsWith("claude-sonnet-4")||l.startsWith("claude-opus-4-8")||l.startsWith("claude-opus-4-7")||l.startsWith("claude-opus-4-6")||l.startsWith("claude-opus-4-5")||l.startsWith("claude-opus-4-1")||l.startsWith("claude-opus-4"),"matches");return c(o)||c(s)}a(H0c,"modelSupportsContextEditing")});var Ovt=I(GR=>{"use strict";p();Object.defineProperty(GR,"__esModule",{value:!0});GR.CUSTOM_TOOL_SEARCH_NAME=void 0;GR.modelSupportsInterleavedThinking=$0c;GR.modelSupportsMemory=V0c;GR.isAnthropicContextEditingEnabled=W0c;GR.modelSupportsExtendedCacheTtl=M3i;GR.isExtendedCacheTtlEnabled=z0c;GR.isExtendedCacheTtlMessagesEnabled=Y0c;GR.buildContextManagement=O3i;GR.getContextManagementFromConfig=K0c;var Mvt=Pl(),Nvt=aBe(),G0c=jR();GR.CUSTOM_TOOL_SEARCH_NAME="tool_search";function $0c(t){let e=t.toLowerCase().replace(/\./g,"-");return e.startsWith("claude-sonnet-4-5")||e.startsWith("claude-sonnet-4")||e.startsWith("claude-haiku-4-5")||e.startsWith("claude-opus-4-5")}a($0c,"modelSupportsInterleavedThinking");function V0c(t){let e=typeof t=="string"?t:(0,Nvt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-fable-5")||s.startsWith("claude-haiku-4-5")||s.startsWith("claude-sonnet-4-6")||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-sonnet-4")||s.startsWith("claude-opus-4-8")||s.startsWith("claude-opus-4-7")||s.startsWith("claude-opus-4-6")||s.startsWith("claude-opus-4-5")||s.startsWith("claude-opus-4-1")||s.startsWith("claude-opus-4")},"matches");return n(e)||n(r)}a(V0c,"modelSupportsMemory");function W0c(t,e,r){return(typeof t=="string"?(0,Nvt.modelSupportsContextEditing)(t):t.supportsContextEditing??(0,Nvt.modelSupportsContextEditing)(t.model))?e.getExperimentBasedConfig(Mvt.ConfigKey.AnthropicContextEditingMode,r)!=="off":!1}a(W0c,"isAnthropicContextEditingEnabled");function M3i(t){let e=typeof t=="string"?t:(0,Nvt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-fable-5")||s.startsWith("claude-opus-4-8")||s.startsWith("claude-opus-4-7")||s.startsWith("claude-opus-4-6")||s.startsWith("claude-opus-4-5")||s.startsWith("claude-sonnet-4-6")||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-haiku-4-5")},"matches");return n(e)||n(r)}a(M3i,"modelSupportsExtendedCacheTtl");function z0c(t,e,r,n,o){return!M3i(t)||n!==G0c.ChatLocation.Agent||o?!1:e.getExperimentBasedConfig(Mvt.ConfigKey.Advanced.AnthropicExtendedCacheTtl,r)}a(z0c,"isExtendedCacheTtlEnabled");function Y0c(t,e,r){return t?e.getExperimentBasedConfig(Mvt.ConfigKey.Advanced.AnthropicExtendedCacheTtlMessages,r):!1}a(Y0c,"isExtendedCacheTtlMessagesEnabled");function O3i(t,e){if(t==="off")return;let r=[];return(t==="clear-thinking"||t==="clear-both")&&e&&r.push({type:"clear_thinking_20251015",keep:{type:"thinking_turns",value:1}}),(t==="clear-tooluse"||t==="clear-both")&&r.push({type:"clear_tool_uses_20250919",trigger:{type:"input_tokens",value:1e5},keep:{type:"tool_uses",value:3}}),r.length>0?{edits:r}:void 0}a(O3i,"buildContextManagement");function K0c(t,e,r){let n=t.getExperimentBasedConfig(Mvt.ConfigKey.AnthropicContextEditingMode,e);return O3i(n,r)}a(K0c,"getContextManagementFromConfig")});var ZDr=I(Lvt=>{"use strict";p();Object.defineProperty(Lvt,"__esModule",{value:!0});Lvt.IToolDeferralService=void 0;var J0c=nn();Lvt.IToolDeferralService=(0,J0c.createServiceIdentifier)("IToolDeferralService")});var rNr=I(KE=>{"use strict";p();var Z0c=KE&&KE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),X0c=KE&&KE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),egc=KE&&KE.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oUvt(n,r),e)}a(ngc,"arrayHash");function igc(t,e){return e=vL(181387,e),Object.keys(t).sort().reduce((r,n)=>(r=tNr(n,r),Uvt(t[n],r)),e)}a(igc,"objectHash");var ogc=a(t=>{if(typeof t=="string"&&t.length<250){let r=new Fvt;return r.update(t),Promise.resolve(r.digest())}let e;return typeof t=="string"?e=new TextEncoder().encode(t):t instanceof eNr.VSBuffer?e=t.buffer:e=t,crypto.subtle.digest("sha-1",e).then(Sye)},"hashAsync");KE.hashAsync=ogc;function XDr(t,e,r=32){let n=r-e,o=~((1<>>n)>>>0}a(XDr,"leftRotate");function Sye(t,e=32){return t instanceof ArrayBuffer?(0,eNr.encodeHex)(eNr.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(Sye,"toHexString");var Fvt=class t{static{a(this,"StringSHA1")}static{this._bigBlock32=new DataView(new ArrayBuffer(320))}constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let r=e.length;if(r===0)return;let n=this._buff,o=this._buffLen,s=this._leftoverHighSurrogate,c,l;for(s!==0?(c=s,l=-1,s=0):(c=e.charCodeAt(0),l=0);;){let u=c;if(Bvt.isHighSurrogate(c))if(l+1>>6,e[r++]=128|(n&63)>>>0):n<65536?(e[r++]=224|(n&61440)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0):(e[r++]=240|(n&1835008)>>>18,e[r++]=128|(n&258048)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0),r>=64&&(this._step(),r-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),r}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Sye(this._h0)+Sye(this._h1)+Sye(this._h2)+Sye(this._h3)+Sye(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let e=t._bigBlock32,r=this._buffDV;for(let h=0;h<64;h+=4)e.setUint32(h,r.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)e.setUint32(h,XDr(e.getUint32(h-12,!1)^e.getUint32(h-32,!1)^e.getUint32(h-56,!1)^e.getUint32(h-64,!1),1),!1);let n=this._h0,o=this._h1,s=this._h2,c=this._h3,l=this._h4,u,d,f;for(let h=0;h<80;h++)h<20?(u=o&s|~o&c,d=1518500249):h<40?(u=o^s^c,d=1859775393):h<60?(u=o&s|o&c|s&c,d=2400959708):(u=o^s^c,d=3395469782),f=XDr(n,5)+u+l+d+e.getUint32(h*4,!1)&4294967295,l=c,c=s,s=XDr(o,30),o=n,n=f;this._h0=this._h0+n&4294967295,this._h1=this._h1+o&4294967295,this._h2=this._h2+s&4294967295,this._h3=this._h3+c&4294967295,this._h4=this._h4+l&4294967295}};KE.StringSHA1=Fvt});var Tye=I(cBe=>{"use strict";p();Object.defineProperty(cBe,"__esModule",{value:!0});cBe.TelemetryData=void 0;cBe.eventPropertiesToSimpleObject=agc;var sgc=T0(),nNr=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=["VSCode.ABExp.Features","abexp.assignmentcontext"]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},Date.now())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=Date.now())}extendWithEditorAgnosticFields(e){this.properties.editor_version=e.getEditorInfo().format(),this.properties.editor_plugin_version=e.getEditorPluginInfo().format(),this.properties.client_machineid=e.machineId,this.properties.client_sessionid=e.sessionId,this.properties.copilot_version=`copilot/${e.getVersion()}`,this.properties.common_extname=e.getEditorPluginInfo().name,this.properties.common_extversion=e.getEditorPluginInfo().version,this.properties.common_vscodeversion=e.getEditorInfo().format()}extendWithConfigProperties(e,r,n){let o=e.dumpConfig();o["copilot.build"]=r.getBuild(),o["copilot.buildType"]=r.getBuildType(),n.trackingId&&(o["copilot.trackingId"]=n.trackingId),n.organizationsList&&(o.organizations_list=n.organizationsList),n.enterpriseList&&(o.enterprise_list=n.enterpriseList),this.properties={...this.properties,...o}}extendWithRequestId(e){let r={completionId:e.completionId,created:e.created.toString(),headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetry=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromPropertiesHack(e,r){if(e)return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetry.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}updateTimeSinceIssuedAndDisplayed(){let e=Date.now()-this.issuedTime;if(this.measurements.timeSinceIssuedMs===void 0&&(this.measurements.timeSinceIssuedMs=e),this.measurements.timeSinceDisplayedMs===void 0&&this.displayedTime!==void 0){let r=Date.now()-this.displayedTime;this.measurements.timeSinceDisplayedMs=r}}makeReadyForSending(e,r,n){this.extendWithConfigProperties(e,r,n),this.extendWithEditorAgnosticFields(r),this.sanitizeKeys(),this.updateTimeSinceIssuedAndDisplayed();for(let o in this.properties)this.properties[o]===void 0&&delete this.properties[o];cgc(r,this.properties)}};cBe.TelemetryData=nNr;function agc(t){if(!t)return;let e={};for(let r in t){let n=t[r];n&&(n.value?e[r]=n.value:e[r]=n)}return e}a(agc,"eventPropertiesToSimpleObject");function cgc(t,e){e.unique_id=(0,sgc.generateUuid)(),e.common_extname=t.getEditorPluginInfo().name,e.common_extversion=t.getEditorPluginInfo().version,e.common_vscodeversion=t.getEditorInfo().format()}a(cgc,"addRequiredProperties")});var L3i=I(iNr=>{"use strict";p();Object.defineProperty(iNr,"__esModule",{value:!0});iNr.extractThinkingDeltaFromChoice=dgc;function lgc(t){if(!t)return"";if(t.cot_summary)return t.cot_summary;if(t.reasoning_text)return t.reasoning_text;if(t.reasoning_content)return t.reasoning_content;if(t.reasoning)return t.reasoning;if(t.thinking)return t.thinking}a(lgc,"getThinkingDeltaText");function ugc(t){if(t){if(t.cot_id)return t.cot_id;if(t.reasoning_opaque)return t.reasoning_opaque;if(t.signature)return t.signature}}a(ugc,"getThinkingDeltaId");function dgc(t){let e=t.message||t.delta;if(!e)return;let r=ugc(e),n=lgc(e);if(e.reasoning_opaque)return{id:e.reasoning_opaque,text:n,encrypted:e.reasoning_opaque};if(r&&n)return{id:r,text:n};if(n)return{text:n};if(r)return{id:r}}a(dgc,"extractThinkingDeltaFromChoice")});var jvt=I(Fne=>{"use strict";p();Object.defineProperty(Fne,"__esModule",{value:!0});Fne.SSEProcessor=void 0;Fne.splitChunk=F3i;Fne.convertToAPIJsonData=hgc;Fne.sendCommunicationErrorTelemetry=Iye;var Qvt=Sp(),B3i=Tye(),fgc=L3i(),qvt=$6(),Mm=H6(),lBe=class t{static{a(this,"APIJsonDataStreaming")}constructor(e){this.model=e,this._text=[],this._newText=[]}get text(){return this._text}append(e){if(e.text){let r=t._removeCR(e.text);this._text.push(r),this._newText.push(r)}if(e.delta?.content){let r=t._removeCR(e.delta.content);this._text.push(r),this._newText.push(r)}if(e.delta?.function_call&&(e.delta.function_call.name||e.delta.function_call.arguments)){let r=t._removeCR(e.delta.function_call.arguments);this._text.push(r),this._newText.push(r)}}flush(){let e=this._newText.join("");return this._newText=[],e}static _removeCR(e){return e.replace(/\r$/g,"")}toJSON(){return{text:this._text,newText:this._newText}}},oNr=class{static{a(this,"StreamingToolCall")}constructor(){this.arguments=""}update(e){let r=!1;return e.id&&(this.id=e.id),e.function?.name&&(this.name=e.function.name),e.function?.arguments&&(this.arguments+=e.function.arguments,r=!0),r}},sNr=class{static{a(this,"StreamingToolCalls")}constructor(){this.toolCalls=[]}getToolCalls(){return this.toolCalls.map(e=>({name:e.name,arguments:e.arguments,id:e.id}))}hasToolCalls(){return this.toolCalls.length>0}update(e){let r=[];return e.delta?.tool_calls?.forEach(n=>{let o;n.id&&(o=this.toolCalls.find(c=>c.id===n.id)),o||(o=this.toolCalls.at(-1)),(!o||n.id&&o.id&&o.id!==n.id)&&(o=new oNr,this.toolCalls.push(o)),o.update(n)&&o.name&&r.push({name:o.name,arguments:o.arguments,id:o.id})}),r}};function F3i(t){let e=t.split(` -`),r=e.pop();return[e.filter(n=>n!==""),r]}a(F3i,"splitChunk");var aNr=class t{static{a(this,"SSEProcessor")}constructor(e,r,n,o,s,c){this.logService=e,this.telemetryService=r,this.expectedNumChoices=n,this.response=o,this.body=s,this.cancellationToken=c,this.requestId=(0,qvt.getRequestId)(this.response.headers),this.solutions={},this.completedFunctionCallIdxs=new Map,this.functionCalls={},this.toolCalls=new sNr,this.functionCallName=void 0}static async create(e,r,n,o,s){let c=o.body.pipeThrough(new TextDecoderStream);return new t(e,r,n,o,c,s)}async*processSSE(e=async()=>{}){try{if(this.expectedNumChoices>1)for await(let r of this.processSSEInner(e))(0,Mm.isApiUsage)(r)||(yield r);else{let r,n;for await(let o of this.processSSEInner(e))(0,Mm.isApiUsage)(o)?n=o:r=o;if(await this.maybeCancel("after receiving the completion, but maybe before we got the usage"))return;r&&(r.usage=n,yield r)}}finally{await this.cancel(),this.logService.info(`request done: requestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`)}}async*processSSEInner(e){let r="",n=!1,o=!0,s=!1;for await(let c of this.body){if(await this.maybeCancel("after awaiting body chunk"))return;let[l,u]=F3i(r+c.toString());r=u;for(let d of l){if(d.startsWith(":"))continue;let f=d.slice(5).trim();if(f==="[DONE]"){yield*this.finishSolutions();return}let h;try{h=JSON.parse(f)}catch{this.logService.error(`Error parsing JSON stream data for request id ${this.requestId.headerRequestId}:${d}`),Iye(this.telemetryService,`Error parsing JSON stream data for request id ${this.requestId.headerRequestId}:`,d);continue}if(h.usage&&(h.copilot_usage&&typeof h.copilot_usage.total_nano_aiu=="number"&&(h.usage.copilot_usage=h.copilot_usage),yield h.usage),h.copilot_confirmation&&pgc(h.copilot_confirmation)&&await e("",0,{text:"",copilotConfirmation:h.copilot_confirmation}),!h.choices){!h.copilot_references&&!h.copilot_confirmation&&(h.error!==void 0?(this.logService.error(`Error in response for request id ${this.requestId.headerRequestId}:${h.error.message}`),Iye(this.telemetryService,`Error in response for request id ${this.requestId.headerRequestId}:`,h.error.message),yield{index:0,finishOffset:void 0,solution:new lBe(h.model||""),reason:Mm.FinishedCompletionReason.ServerError,error:h.error,requestId:this.requestId}):(this.logService.error(`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`),Iye(this.telemetryService,`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`))),h.copilot_errors&&await e("",0,{text:"",copilotErrors:h.copilot_errors}),h.copilot_references&&await e("",0,{text:"",copilotReferences:h.copilot_references});continue}this.requestId.created===0&&(this.requestId=(0,qvt.getRequestId)(this.response.headers,h),this.requestId.created===0&&h.choices?.length&&(this.requestId.created=Math.floor(Date.now()/1e3)));for(let m=0;m(T?.vulnAnnotations&&(!Array.isArray(T.vulnAnnotations)||!T.vulnAnnotations.every(w=>(0,qvt.isCopilotAnnotation)(w)))&&(T.vulnAnnotations=void 0),T?.ipCodeCitations&&(!Array.isArray(T.ipCodeCitations)||!T.ipCodeCitations.every(qvt.isCodeCitationAnnotation))&&(T.ipCodeCitations=void 0),E=await e(y.text.join(""),g.index,{text:y.flush(),logprobs:g.logprobs,codeVulnAnnotations:T?.vulnAnnotations,ipCitations:T?.ipCodeCitations,copilotReferences:T?.references,copilotToolCalls:T?.toolCalls,copilotToolCallStreamUpdates:T?.toolCallStreamUpdates,_deprecatedCopilotFunctionCalls:T?.functionCalls,beginToolCalls:T?.beginToolCalls,copilotErrors:T?.errors,thinking:A??T?.thinking}),E!==void 0&&(n=!0),await this.maybeCancel("after awaiting finishedCb")),"emitSolution"),v=!0;if(g.delta?.tool_calls){if(!this.toolCalls.hasToolCalls()){let R=g.delta.tool_calls.at(0),x=R?.function?.name;if(x&&(y.text.length&&y.append({index:0,delta:{content:" "}}),await _({beginToolCalls:[{name:x,id:R?.id}]})))continue}let w=this.toolCalls.update(g);if(w.length&&await _({toolCallStreamUpdates:w}))continue}else if(g.delta?.copilot_annotations?.CodeVulnerability||g.delta?.copilot_annotations?.IPCodeCitations){if(await _()||!n&&(y.append(g),await _({vulnAnnotations:g.delta?.copilot_annotations?.CodeVulnerability,ipCodeCitations:g.delta?.copilot_annotations?.IPCodeCitations})))continue}else if(g.delta?.role==="function"){if(g.delta.content)try{let T=JSON.parse(g.delta.content);if(Array.isArray(T)&&await _({references:T}))continue}catch(T){this.logService.error(`Error parsing function references: ${JSON.stringify(T)}`)}}else if(g.delta?.function_call&&(g.delta.function_call.name||g.delta.function_call.arguments))o=!1,this.functionCallName??=g.delta.function_call.name,this.functionCalls[this.functionCallName]??=new lBe(h.model),this.functionCalls[this.functionCallName].append(g);else if((g.finish_reason===Mm.FinishedCompletionReason.FunctionCall||g.finish_reason===Mm.FinishedCompletionReason.Stop)&&this.functionCallName){let T=this.functionCalls[this.functionCallName],w={name:this.functionCallName,arguments:T.flush()};this.completedFunctionCallIdxs.set(g.index,"function");try{if(await _({functionCalls:[w]}))continue}catch(R){this.logService.error(R)}if(this.functionCalls[this.functionCallName]=null,this.functionCallName=void 0,g.finish_reason===Mm.FinishedCompletionReason.FunctionCall)continue}else v=!1;if((g.finish_reason===Mm.FinishedCompletionReason.ToolCalls||g.finish_reason===Mm.FinishedCompletionReason.Stop)&&this.toolCalls.hasToolCalls()){v=!0;let T=this.toolCalls.getToolCalls();this.completedFunctionCallIdxs.set(g.index,"tool");let w=T.length>0?T[0].id:void 0;try{if(await _({toolCalls:T,thinking:w&&s?{metadata:{toolId:w}}:void 0}))continue}catch(R){this.logService.error(R)}}if(!(!v&&(y.append(g),await _())||!(g.finish_reason||E!==void 0))){if(yield{solution:y,finishOffset:E,reason:g.finish_reason??Mm.FinishedCompletionReason.ClientTrimmed,filterReason:mgc(g),requestId:this.requestId,index:g.index},await this.maybeCancel("after yielding finished choice"))return;o&&(this.solutions[g.index]=null)}}}}for(let[c,l]of Object.entries(this.solutions)){let u=Number(c);if(l!==null&&(yield{solution:l,finishOffset:void 0,reason:Mm.FinishedCompletionReason.ClientIterationDone,requestId:this.requestId,index:u},await this.maybeCancel("after yielding after iteration done")))return}if(r.length>0&&!n)try{let c=JSON.parse(r);c.error!==void 0&&(this.logService.error(c.error,`Error in response: ${c.error.message}`),Iye(this.telemetryService,`Error in response: ${c.error.message}`,c.error))}catch{this.logService.error(`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`),Iye(this.telemetryService,`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`)}}async*finishSolutions(){for(let[e,r]of Object.entries(this.solutions)){let n=Number(e);if(r!==null){if(this.completedFunctionCallIdxs.has(n)){yield{solution:r,finishOffset:void 0,reason:this.completedFunctionCallIdxs.get(n)==="function"?Mm.FinishedCompletionReason.FunctionCall:Mm.FinishedCompletionReason.ToolCalls,requestId:this.requestId,index:n};continue}if(yield{solution:r,finishOffset:void 0,reason:Mm.FinishedCompletionReason.ClientDone,requestId:this.requestId,index:n},await this.maybeCancel("after yielding on DONE"))return}}}async maybeCancel(e){return this.cancellationToken?.isCancellationRequested?(this.logService.debug("Cancelled: "+e),await this.cancel(),!0):!1}async cancel(){await this.response.body.destroy()}logChoice(e){let r={...e};delete r.index,delete r.content_filter_results,delete r.content_filter_offsets,this.logService.trace(`choice ${JSON.stringify(r)}`)}};Fne.SSEProcessor=aNr;function pgc(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(pgc,"isCopilotConfirmation");function hgc(t){return{text:t.text.join(""),tokens:t.text}}a(hgc,"convertToAPIJsonData");function mgc(t){if(t.finish_reason===Mm.FinishedCompletionReason.ContentFilter){if(t.delta?.copilot_annotations?.TextCopyright)return Mm.FilterReason.Copyright;if(t.delta?.copilot_annotations?.Sexual||t.delta?.copilot_annotations?.SexualPattern)return Mm.FilterReason.Sexual;if(t.delta?.copilot_annotations?.Violence)return Mm.FilterReason.Violence;if(t.delta?.copilot_annotations?.HateSpeech||t.delta?.copilot_annotations?.HateSpeechPattern)return Mm.FilterReason.Hate;if(t.delta?.copilot_annotations?.SelfHarm)return Mm.FilterReason.SelfHarm;if(t.delta?.copilot_annotations?.PromptPromBlockList)return Mm.FilterReason.Prompt;if(t.content_filter_results){for(let e of Object.keys(t.content_filter_results))if(t.content_filter_results[e]?.filtered)return e}}}a(mgc,"choiceToFilterReason");function Iye(t,e,r){let n=[e,r],o=n.length>0?JSON.stringify(n):"no msg",s=B3i.TelemetryData.createAndMarkAsIssued({context:"fetch",level:Qvt.LogLevel[Qvt.LogLevel.Error],message:o});t.sendEnhancedGHTelemetryErrorEvent("log",s.properties,s.measurements);let c=B3i.TelemetryData.createAndMarkAsIssued({context:"fetch",level:Qvt.LogLevel[Qvt.LogLevel.Error],message:"[redacted]"});t.sendGHTelemetryErrorEvent("log",c.properties,c.measurements)}a(Iye,"sendCommunicationErrorTelemetry")});var fBe=I(xye=>{"use strict";p();Object.defineProperty(xye,"__esModule",{value:!0});xye.sendEngineMessagesLengthTelemetry=H3i;xye.sendEngineMessagesTelemetry=G3i;xye.sendResponsesApiCompactionTelemetry=xgc;xye.prepareChatCompletionForReturn=wgc;var ggc=Io(),q3i=rNr(),Gvt=zP(),j3i=T0(),Agc=nBe(),lNr=gm(),dBe=Tye(),ygc=H6(),Egc=jvt();function H3i(t,e,r,n,o){let s=n?"output":"input",c=r.properties.modelCallId;if(!c){o?.warn("[TELEMETRY] modelCallId not found in telemetryData, input/output messages cannot be linked");return}let l=e.map(f=>{let h={...f,content:typeof f.content=="string"?f.content.length:Array.isArray(f.content)?f.content.reduce((m,g)=>typeof g=="string"?m+g.length:g.type==="text"?m+(g.text?.length||0):m,0):0};return"tool_calls"in f&&f.tool_calls&&Array.isArray(f.tool_calls)&&(h.tool_calls=f.tool_calls.map(m=>({...m,function:m.function?{...m.function,arguments:typeof m.function.arguments=="string"?m.function.arguments.length:m.function.arguments}:m.function}))),h}),u={};for(let[f,h]of Object.entries(r.properties))if(f.startsWith("request.option.tools"))if(typeof h=="string")try{let m=JSON.parse(h);Array.isArray(m)?u[f]=m.length.toString():u[f]=h.length.toString()}catch{u[f]=h.length.toString()}else Array.isArray(h)?u[f]=h.length.toString():u[f]="0";else u[f]=h;let d=dBe.TelemetryData.createAndMarkAsIssued({...u,messagesJson:JSON.stringify(l),message_direction:s,modelCallId:c},r.measurements);t.sendEnhancedGHTelemetryEvent("engine.messages.length",(0,lNr.multiplexProperties)(d.properties),d.measurements),t.sendInternalMSFTTelemetryEvent("engine.messages.length",(0,lNr.multiplexProperties)(d.properties),d.measurements)}a(H3i,"sendEngineMessagesLengthTelemetry");var U3i=new Gvt.LRUCache(1e3),Q3i=new Gvt.LRUCache(500),uBe=new Gvt.LRUCache(1e3),Hvt={headerRequestId:null},cNr=new Gvt.LRUCache(100);function _gc(t){let e=uBe.get(t);if(e!==void 0){let r=e+1;return uBe.set(t,r),r}else return uBe.set(t,1),1}a(_gc,"updateHeaderRequestIdTracker");function vgc(t){let e=cNr.get(t);if(e!==void 0){let r=e+1;return cNr.set(t,r),r}else return cNr.set(t,1),1}a(vgc,"updateConversationTracker");function Cgc(t,e,r){let n={};for(let[h,m]of Object.entries(e.properties))h.startsWith("request.option.")&&(n[h]=m);if(Object.keys(n).length===0)return;let o=e.properties.conversationId||e.properties.sessionId||"unknown",s=e.properties.headerRequestId||"unknown",c=(0,q3i.hash)(n).toString(),l=Q3i.get(c);if(!l)l=(0,j3i.generateUuid)(),Q3i.set(c,l);else return l;let u=JSON.stringify(n),d=8e3,f=[];for(let h=0;h{"use strict";p();Object.defineProperty(pBe,"__esModule",{value:!0});pBe.CompactionDataContainer=void 0;pBe.rawPartAsCompactionData=kgc;var Rgc=Io(),$3i=xLe(),uNr=class extends Rgc.PromptElement{static{a(this,"CompactionDataContainer")}render(){let{compaction:e}=this.props,r={type:$3i.CustomDataPartMimeTypes.ContextManagement,compaction:e};return vscpp("opaque",{value:r})}};pBe.CompactionDataContainer=uNr;function kgc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===$3i.CustomDataPartMimeTypes.ContextManagement&&r.compaction&&typeof r.compaction=="object")return r.compaction}a(kgc,"rawPartAsCompactionData")});var z3i=I(hBe=>{"use strict";p();Object.defineProperty(hBe,"__esModule",{value:!0});hBe.PhaseDataContainer=void 0;hBe.rawPartAsPhaseData=Dgc;var Pgc=Io(),W3i=xLe(),dNr=class extends Pgc.PromptElement{static{a(this,"PhaseDataContainer")}render(){let{phase:e}=this.props,r={type:W3i.CustomDataPartMimeTypes.PhaseData,phase:e};return vscpp("opaque",{value:r})}};hBe.PhaseDataContainer=dNr;function Dgc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===W3i.CustomDataPartMimeTypes.PhaseData&&typeof r.phase=="string")return r.phase}a(Dgc,"rawPartAsPhaseData")});var J3i=I(CL=>{"use strict";p();Object.defineProperty(CL,"__esModule",{value:!0});CL.StatefulMarkerContainer=void 0;CL.rawPartAsStatefulMarker=K3i;CL.encodeStatefulMarker=Ngc;CL.decodeStatefulMarker=Mgc;CL.getAllStatefulMarkersAndIndicies=hNr;CL.getStatefulMarkerAndIndex=Ogc;CL.getIndexOfStatefulMarker=Lgc;var fNr=Io(),Y3i=xLe(),pNr=class extends fNr.PromptElement{static{a(this,"StatefulMarkerContainer")}render(){let{statefulMarker:e}=this.props,r={type:Y3i.CustomDataPartMimeTypes.StatefulMarker,value:e};return vscpp("opaque",{value:r})}};CL.StatefulMarkerContainer=pNr;function K3i(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===Y3i.CustomDataPartMimeTypes.StatefulMarker&&typeof r.value=="object")return r.value}a(K3i,"rawPartAsStatefulMarker");function Ngc(t,e){return new TextEncoder().encode(t+"\\"+e)}a(Ngc,"encodeStatefulMarker");function Mgc(t){let e=new TextDecoder().decode(t),[r,n]=e.split("\\");return{modelId:r,marker:n}}a(Mgc,"decodeStatefulMarker");function*hNr(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.role===fNr.Raw.ChatRole.Assistant){for(let n of r.content)if(n.type===fNr.Raw.ChatCompletionContentPartKind.Opaque){let o=K3i(n);o&&(yield{statefulMarker:o,index:e})}}}}a(hNr,"getAllStatefulMarkersAndIndicies");function Ogc(t,e){for(let r of hNr(e))if(r.statefulMarker.modelId===t)return{statefulMarker:r.statefulMarker.marker,index:r.index}}a(Ogc,"getStatefulMarkerAndIndex");function Lgc(t,e){for(let r of hNr(e))if(r.statefulMarker.marker===t)return r.index}a(Lgc,"getIndexOfStatefulMarker")});var eFi=I(J6=>{"use strict";p();var Bgc=J6&&J6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Fgc=J6&&J6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),X3i=J6&&J6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(ho,"__esModule",{value:!0});ho.getModelCapabilityOverride=HAc;ho.getModelId=oV;ho.isHiddenModelA=GAc;ho.isHiddenModelB=qNr;ho.isHiddenModelE=Zvt;ho.isHiddenModelF=Xvt;ho.isHiddenFamilyH=eCt;ho.isHiddenModelK=$Ac;ho.isGpt54=jNr;ho.isGpt55=VAc;ho.isHiddenModelM=xBe;ho.isGpt53Codex=HNr;ho.isVSCModelA=tCt;ho.isVSCModelB=rCt;ho.isVSCModelReplaceStringSet=wBe;ho.isVSCModelC=WAc;ho.isVSCModelD=zAc;ho.isGpt52CodexFamily=GNr;ho.isGpt52Family=$Nr;ho.modelPrefersInstructionsInUserMessage=YAc;ho.modelPrefersInstructionsAfterHistory=KAc;ho.modelSupportsApplyPatch=JAc;ho.modelPrefersJsonNotebookRepresentation=ZAc;ho.modelSupportsReplaceString=XAc;ho.modelSupportsMultiReplaceString=T8i;ho.modelCanUseReplaceStringExclusively=eyc;ho.modelShouldUseReplaceStringHealing=tyc;ho.modelCanUseMcpResultImageURL=ryc;ho.modelCanUseImageURL=nyc;ho.modelSupportsPDFDocuments=iyc;ho.modelCanUseApplyPatchExclusively=oyc;ho.modelNeedsStrongReplaceStringHint=syc;ho.modelSupportsSimplifiedApplyPatchInstructions=ayc;ho.isAnthropicFamily=RBe;ho.isGeminiFamily=VNr;ho.isMinimaxFamily=nCt;ho.isGpt5PlusFamily=iCt;ho.isGptCodexFamily=cyc;ho.isGpt5Family=lyc;ho.isGptFamily=uyc;ho.isGpt51Family=dyc;ho.getVerbosityForModelSync=fyc;ho.modelSupportsToolSearch=pyc;ho.modelSupportsContextEditing=hyc;var Fm=I2r(),LAc=Pl(),BAc=["a99dd17dfee04155d863268596b7f6dd36d0a6531cd326348dbe7416142a21a3","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95"],b8i=["1f48b3271e760c69ab2b17dcae5f5c661fa5b644c5976a8a99b23e05ae3cb6d6","ffc50c70661c227edf8daae6f8dbed2dd0645386c12d43bc7fc44da166e043bd","257c934076307881132be702a901618969591f0e11e1df51b22b1d4010f0a0d0"],y8i=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7"],E8i=["6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c"],_8i=["0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73"],v8i=["e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],C8i=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c","0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73","e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],FAc=["6013de0381f648b7f21518885c02b40b7583adfb33c6d9b64d3aed52c3934798"],UAc=["ab45e8474269b026f668d49860b36850122e18a50d5ea38f3fefdae08261865c","9542d5c077c2bc379f92be32272b14be8b94a8841323465db0d5b3d6f4f0dab0"],QAc=["0a4346f806b28b3ce94905c3ac56fcd5ee2337d8613161696aba52eb0c3551cc","2a7b79b0151aa44a0abee17adc0e18df1c07d8d15d7affa989c3b3afb6bee0a0","f3c2984127dd2db50a555194925ca0d55c3c7b676e889c9406b2e6875a67e29c","5a81e6aa7556585ba7c569881d1103683adc9e0124ff7952df423afba2f167b5"],S8i="a62e299160a1075d9973c28a7aa77f446c21c09887c7aa65c11022918cf83eda",qAc=["70fcded3f255d368e868cc807d8838a62108bfa5c86ce7d37966f58cda229e33"],jAc=["0902565c0c0fe145633a1f246ae551acc0f621249ef050428eba357fbd4655ee"];function HAc(t,e){return e.getConfig(LAc.ConfigKey.Advanced.ModelCapabilityOverrides)?.[t]}a(HAc,"getModelCapabilityOverride");function oV(t){return"id"in t?t.id:t.model}a(oV,"getModelId");function GAc(t){let e=(0,Fm.getCachedSha256Hash)(t.family);return BAc.includes(e)}a(GAc,"isHiddenModelA");function qNr(t){let e=(0,Fm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return b8i.includes(e)}a(qNr,"isHiddenModelB");function Zvt(t){let e=(0,Fm.getCachedSha256Hash)(t.family);return FAc.includes(e)}a(Zvt,"isHiddenModelE");function Xvt(t){let e=(0,Fm.getCachedSha256Hash)(t.family);return UAc.includes(e)}a(Xvt,"isHiddenModelF");function eCt(t){let e=(0,Fm.getCachedSha256Hash)(t.family);return qAc.includes(e)}a(eCt,"isHiddenFamilyH");function $Ac(t){return(0,Fm.getCachedSha256Hash)(t.family)===S8i}a($Ac,"isHiddenModelK");function jNr(t){let e=(0,Fm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.4")||QAc.includes(e)}a(jNr,"isGpt54");function VAc(t){let e=(0,Fm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.5")||b8i.includes(e)}a(VAc,"isGpt55");function xBe(t){let e=(0,Fm.getCachedSha256Hash)(typeof t=="string"?t:t.family);return jAc.includes(e)}a(xBe,"isHiddenModelM");function HNr(t){return(typeof t=="string"?t:t.family).startsWith("gpt-5.3-codex")}a(HNr,"isGpt53Codex");function tCt(t){let e=(0,Fm.getCachedSha256Hash)(oV(t)),r=(0,Fm.getCachedSha256Hash)(t.family);return y8i.includes(e)||y8i.includes(r)}a(tCt,"isVSCModelA");function rCt(t){let e=(0,Fm.getCachedSha256Hash)(oV(t)),r=(0,Fm.getCachedSha256Hash)(t.family);return E8i.includes(e)||E8i.includes(r)}a(rCt,"isVSCModelB");function wBe(t){let e=(0,Fm.getCachedSha256Hash)(oV(t)),r=(0,Fm.getCachedSha256Hash)(t.family);return C8i.includes(e)||C8i.includes(r)}a(wBe,"isVSCModelReplaceStringSet");function WAc(t){let e=(0,Fm.getCachedSha256Hash)(oV(t)),r=(0,Fm.getCachedSha256Hash)(t.family);return _8i.includes(e)||_8i.includes(r)}a(WAc,"isVSCModelC");function zAc(t){let e=(0,Fm.getCachedSha256Hash)(oV(t)),r=(0,Fm.getCachedSha256Hash)(t.family);return v8i.includes(e)||v8i.includes(r)}a(zAc,"isVSCModelD");function GNr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2-codex"}a(GNr,"isGpt52CodexFamily");function $Nr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2"}a($Nr,"isGpt52Family");function YAc(t){return t.includes("claude-3.5-sonnet")}a(YAc,"modelPrefersInstructionsInUserMessage");function KAc(t){return t.includes("claude-3.5-sonnet")}a(KAc,"modelPrefersInstructionsAfterHistory");function JAc(t){return wBe(t)?!1:t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||GNr(t.family)||HNr(t.family)||tCt(t)||rCt(t)||$Nr(t.family)||jNr(t)||qNr(t)||xBe(t)}a(JAc,"modelSupportsApplyPatch");function ZAc(t){return t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||GNr(t.family)||HNr(t.family)||$Nr(t.family)||jNr(t)||qNr(t)||xBe(t)}a(ZAc,"modelPrefersJsonNotebookRepresentation");function XAc(t){return VNr(t)||t.family.includes("grok-code")||T8i(t)||Xvt(t)||nCt(t)||eCt(t)}a(XAc,"modelSupportsReplaceString");function T8i(t){return RBe(t)||Zvt(t)||wBe(t)||nCt(t)||eCt(t)}a(T8i,"modelSupportsMultiReplaceString");function eyc(t){return RBe(t)||t.family.includes("grok-code")||Zvt(t)||t.family.toLowerCase().includes("gemini-3")||wBe(t)||Xvt(t)||nCt(t)||eCt(t)}a(eyc,"modelCanUseReplaceStringExclusively");function tyc(t){return t.family.includes("gemini-2")}a(tyc,"modelShouldUseReplaceStringHealing");function ryc(t){return!RBe(t)&&!Zvt(t)}a(ryc,"modelCanUseMcpResultImageURL");function nyc(t){return!0}a(nyc,"modelCanUseImageURL");function iyc(t){return RBe(t)||iCt(t)||xBe(t)}a(iyc,"modelSupportsPDFDocuments");function oyc(t){return wBe(t)?!1:iCt(t)||tCt(t)||rCt(t)}a(oyc,"modelCanUseApplyPatchExclusively");function syc(t){return VNr(t)||Xvt(t)}a(syc,"modelNeedsStrongReplaceStringHint");function ayc(t){return iCt(t)||tCt(t)||rCt(t)}a(ayc,"modelSupportsSimplifiedApplyPatchInstructions");function RBe(t){return t.family.startsWith("claude")||t.family.startsWith("Anthropic")}a(RBe,"isAnthropicFamily");function VNr(t){let e=typeof t=="string"?t:t.family;return e.toLowerCase().startsWith("gemini")||(0,Fm.getCachedSha256Hash)(e)===S8i}a(VNr,"isGeminiFamily");function nCt(t){return t.family.toLowerCase().includes("minimax")}a(nCt,"isMinimaxFamily");function iCt(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5"):!1}a(iCt,"isGpt5PlusFamily");function cyc(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return!!e.startsWith("gpt-")&&e.includes("-codex")}a(cyc,"isGptCodexFamily");function lyc(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return e==="gpt-5"||e==="gpt-5-mini"||e==="gpt-5-codex"}a(lyc,"isGpt5Family");function uyc(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-"):!1}a(uyc,"isGptFamily");function dyc(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5.1"):!1}a(dyc,"isGpt51Family");function fyc(t){if(t.family==="gpt-5.1"||t.family==="gpt-5-mini")return"low"}a(fyc,"getVerbosityForModelSync");function pyc(t){let e=typeof t=="string"?t:oV(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s==="gpt-5-4"||s==="gpt-5-5"?!0:!s.startsWith("claude")||s.startsWith("claude-haiku")?!1:!(s.startsWith("claude-1")||s.startsWith("claude-2")||s.startsWith("claude-3")||s.startsWith("claude-instant")||s==="claude-sonnet-4"||s.startsWith("claude-sonnet-4-2")||s==="claude-opus-4"||s.startsWith("claude-opus-4-1")||s.startsWith("claude-opus-4-2"))},"matches");return n(e)||n(r)||xBe(r)}a(pyc,"modelSupportsToolSearch");function hyc(t){let e=typeof t=="string"?t:oV(t),r=typeof t=="string"?t:t.family,n=a(l=>l.toLowerCase().replace(/\./g,"-"),"normalize"),o=n(e),s=n(r);if(o.includes("1m")||s.includes("1m"))return!1;let c=a(l=>l.startsWith("claude-fable-5")||l.startsWith("claude-haiku-4-5")||l.startsWith("claude-sonnet-4-6")||l.startsWith("claude-sonnet-4-5")||l.startsWith("claude-sonnet-4")||l.startsWith("claude-opus-4-8")||l.startsWith("claude-opus-4-7")||l.startsWith("claude-opus-4-6")||l.startsWith("claude-opus-4-5")||l.startsWith("claude-opus-4-1")||l.startsWith("claude-opus-4"),"matches");return c(o)||c(s)}a(hyc,"modelSupportsContextEditing")});var aCt=I(XR=>{"use strict";p();Object.defineProperty(XR,"__esModule",{value:!0});XR.CUSTOM_TOOL_SEARCH_NAME=void 0;XR.modelSupportsInterleavedThinking=gyc;XR.modelSupportsMemory=Ayc;XR.isAnthropicContextEditingEnabled=yyc;XR.modelSupportsExtendedCacheTtl=I8i;XR.isExtendedCacheTtlEnabled=Eyc;XR.isExtendedCacheTtlMessagesEnabled=_yc;XR.buildContextManagement=x8i;XR.getContextManagementFromConfig=vyc;var sCt=Pl(),oCt=kBe(),myc=JR();XR.CUSTOM_TOOL_SEARCH_NAME="tool_search";function gyc(t){let e=t.toLowerCase().replace(/\./g,"-");return e.startsWith("claude-sonnet-4-5")||e.startsWith("claude-sonnet-4")||e.startsWith("claude-haiku-4-5")||e.startsWith("claude-opus-4-5")}a(gyc,"modelSupportsInterleavedThinking");function Ayc(t){let e=typeof t=="string"?t:(0,oCt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-fable-5")||s.startsWith("claude-haiku-4-5")||s.startsWith("claude-sonnet-4-6")||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-sonnet-4")||s.startsWith("claude-opus-4-8")||s.startsWith("claude-opus-4-7")||s.startsWith("claude-opus-4-6")||s.startsWith("claude-opus-4-5")||s.startsWith("claude-opus-4-1")||s.startsWith("claude-opus-4")},"matches");return n(e)||n(r)}a(Ayc,"modelSupportsMemory");function yyc(t,e,r){return(typeof t=="string"?(0,oCt.modelSupportsContextEditing)(t):t.supportsContextEditing??(0,oCt.modelSupportsContextEditing)(t.model))?e.getExperimentBasedConfig(sCt.ConfigKey.AnthropicContextEditingMode,r)!=="off":!1}a(yyc,"isAnthropicContextEditingEnabled");function I8i(t){let e=typeof t=="string"?t:(0,oCt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-fable-5")||s.startsWith("claude-opus-4-8")||s.startsWith("claude-opus-4-7")||s.startsWith("claude-opus-4-6")||s.startsWith("claude-opus-4-5")||s.startsWith("claude-sonnet-4-6")||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-haiku-4-5")},"matches");return n(e)||n(r)}a(I8i,"modelSupportsExtendedCacheTtl");function Eyc(t,e,r,n,o){return!I8i(t)||n!==myc.ChatLocation.Agent||o?!1:e.getExperimentBasedConfig(sCt.ConfigKey.Advanced.AnthropicExtendedCacheTtl,r)}a(Eyc,"isExtendedCacheTtlEnabled");function _yc(t,e,r){return t?e.getExperimentBasedConfig(sCt.ConfigKey.Advanced.AnthropicExtendedCacheTtlMessages,r):!1}a(_yc,"isExtendedCacheTtlMessagesEnabled");function x8i(t,e){if(t==="off")return;let r=[];return(t==="clear-thinking"||t==="clear-both")&&e&&r.push({type:"clear_thinking_20251015",keep:{type:"thinking_turns",value:1}}),(t==="clear-tooluse"||t==="clear-both")&&r.push({type:"clear_tool_uses_20250919",trigger:{type:"input_tokens",value:1e5},keep:{type:"tool_uses",value:3}}),r.length>0?{edits:r}:void 0}a(x8i,"buildContextManagement");function vyc(t,e,r){let n=t.getExperimentBasedConfig(sCt.ConfigKey.AnthropicContextEditingMode,e);return x8i(n,r)}a(vyc,"getContextManagementFromConfig")});var WNr=I(cCt=>{"use strict";p();Object.defineProperty(cCt,"__esModule",{value:!0});cCt.IToolDeferralService=void 0;var Cyc=nn();cCt.IToolDeferralService=(0,Cyc.createServiceIdentifier)("IToolDeferralService")});var JNr=I(t_=>{"use strict";p();var byc=t_&&t_.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Syc=t_&&t_.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Tyc=t_&&t_.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;odCt(n,r),e)}a(wyc,"arrayHash");function Ryc(t,e){return e=TL(181387,e),Object.keys(t).sort().reduce((r,n)=>(r=KNr(n,r),dCt(t[n],r)),e)}a(Ryc,"objectHash");var kyc=a(t=>{if(typeof t=="string"&&t.length<250){let r=new uCt;return r.update(t),Promise.resolve(r.digest())}let e;return typeof t=="string"?e=new TextEncoder().encode(t):t instanceof YNr.VSBuffer?e=t.buffer:e=t,crypto.subtle.digest("sha-1",e).then(Qye)},"hashAsync");t_.hashAsync=kyc;function zNr(t,e,r=32){let n=r-e,o=~((1<>>n)>>>0}a(zNr,"leftRotate");function Qye(t,e=32){return t instanceof ArrayBuffer?(0,YNr.encodeHex)(YNr.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(Qye,"toHexString");var uCt=class t{static{a(this,"StringSHA1")}static{this._bigBlock32=new DataView(new ArrayBuffer(320))}constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let r=e.length;if(r===0)return;let n=this._buff,o=this._buffLen,s=this._leftoverHighSurrogate,c,l;for(s!==0?(c=s,l=-1,s=0):(c=e.charCodeAt(0),l=0);;){let u=c;if(lCt.isHighSurrogate(c))if(l+1>>6,e[r++]=128|(n&63)>>>0):n<65536?(e[r++]=224|(n&61440)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0):(e[r++]=240|(n&1835008)>>>18,e[r++]=128|(n&258048)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0),r>=64&&(this._step(),r-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),r}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Qye(this._h0)+Qye(this._h1)+Qye(this._h2)+Qye(this._h3)+Qye(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let e=t._bigBlock32,r=this._buffDV;for(let h=0;h<64;h+=4)e.setUint32(h,r.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)e.setUint32(h,zNr(e.getUint32(h-12,!1)^e.getUint32(h-32,!1)^e.getUint32(h-56,!1)^e.getUint32(h-64,!1),1),!1);let n=this._h0,o=this._h1,s=this._h2,c=this._h3,l=this._h4,u,d,f;for(let h=0;h<80;h++)h<20?(u=o&s|~o&c,d=1518500249):h<40?(u=o^s^c,d=1859775393):h<60?(u=o&s|o&c|s&c,d=2400959708):(u=o^s^c,d=3395469782),f=zNr(n,5)+u+l+d+e.getUint32(h*4,!1)&4294967295,l=c,c=s,s=zNr(o,30),o=n,n=f;this._h0=this._h0+n&4294967295,this._h1=this._h1+o&4294967295,this._h2=this._h2+s&4294967295,this._h3=this._h3+c&4294967295,this._h4=this._h4+l&4294967295}};t_.StringSHA1=uCt});var qye=I(PBe=>{"use strict";p();Object.defineProperty(PBe,"__esModule",{value:!0});PBe.TelemetryData=void 0;PBe.eventPropertiesToSimpleObject=Dyc;var Pyc=x0(),ZNr=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=["VSCode.ABExp.Features","abexp.assignmentcontext"]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},Date.now())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=Date.now())}extendWithEditorAgnosticFields(e){this.properties.editor_version=e.getEditorInfo().format(),this.properties.editor_plugin_version=e.getEditorPluginInfo().format(),this.properties.client_machineid=e.machineId,this.properties.client_sessionid=e.sessionId,this.properties.copilot_version=`copilot/${e.getVersion()}`,this.properties.common_extname=e.getEditorPluginInfo().name,this.properties.common_extversion=e.getEditorPluginInfo().version,this.properties.common_vscodeversion=e.getEditorInfo().format()}extendWithConfigProperties(e,r,n){let o=e.dumpConfig();o["copilot.build"]=r.getBuild(),o["copilot.buildType"]=r.getBuildType(),n.trackingId&&(o["copilot.trackingId"]=n.trackingId),n.organizationsList&&(o.organizations_list=n.organizationsList),n.enterpriseList&&(o.enterprise_list=n.enterpriseList),this.properties={...this.properties,...o}}extendWithRequestId(e){let r={completionId:e.completionId,created:e.created.toString(),headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetry=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromPropertiesHack(e,r){if(e)return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetry.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}updateTimeSinceIssuedAndDisplayed(){let e=Date.now()-this.issuedTime;if(this.measurements.timeSinceIssuedMs===void 0&&(this.measurements.timeSinceIssuedMs=e),this.measurements.timeSinceDisplayedMs===void 0&&this.displayedTime!==void 0){let r=Date.now()-this.displayedTime;this.measurements.timeSinceDisplayedMs=r}}makeReadyForSending(e,r,n){this.extendWithConfigProperties(e,r,n),this.extendWithEditorAgnosticFields(r),this.sanitizeKeys(),this.updateTimeSinceIssuedAndDisplayed();for(let o in this.properties)this.properties[o]===void 0&&delete this.properties[o];Nyc(r,this.properties)}};PBe.TelemetryData=ZNr;function Dyc(t){if(!t)return;let e={};for(let r in t){let n=t[r];n&&(n.value?e[r]=n.value:e[r]=n)}return e}a(Dyc,"eventPropertiesToSimpleObject");function Nyc(t,e){e.unique_id=(0,Pyc.generateUuid)(),e.common_extname=t.getEditorPluginInfo().name,e.common_extversion=t.getEditorPluginInfo().version,e.common_vscodeversion=t.getEditorInfo().format()}a(Nyc,"addRequiredProperties")});var w8i=I(XNr=>{"use strict";p();Object.defineProperty(XNr,"__esModule",{value:!0});XNr.extractThinkingDeltaFromChoice=Lyc;function Myc(t){if(!t)return"";if(t.cot_summary)return t.cot_summary;if(t.reasoning_text)return t.reasoning_text;if(t.reasoning_content)return t.reasoning_content;if(t.reasoning)return t.reasoning;if(t.thinking)return t.thinking}a(Myc,"getThinkingDeltaText");function Oyc(t){if(t){if(t.cot_id)return t.cot_id;if(t.reasoning_opaque)return t.reasoning_opaque;if(t.signature)return t.signature}}a(Oyc,"getThinkingDeltaId");function Lyc(t){let e=t.message||t.delta;if(!e)return;let r=Oyc(e),n=Myc(e);if(e.reasoning_opaque)return{id:e.reasoning_opaque,text:n,encrypted:e.reasoning_opaque};if(r&&n)return{id:r,text:n};if(n)return{text:n};if(r)return{id:r}}a(Lyc,"extractThinkingDeltaFromChoice")});var hCt=I(Wne=>{"use strict";p();Object.defineProperty(Wne,"__esModule",{value:!0});Wne.SSEProcessor=void 0;Wne.splitChunk=k8i;Wne.convertToAPIJsonData=Uyc;Wne.sendCommunicationErrorTelemetry=jye;var fCt=xp(),R8i=qye(),Byc=w8i(),pCt=i9(),Um=r9(),DBe=class t{static{a(this,"APIJsonDataStreaming")}constructor(e){this.model=e,this._text=[],this._newText=[]}get text(){return this._text}append(e){if(e.text){let r=t._removeCR(e.text);this._text.push(r),this._newText.push(r)}if(e.delta?.content){let r=t._removeCR(e.delta.content);this._text.push(r),this._newText.push(r)}if(e.delta?.function_call&&(e.delta.function_call.name||e.delta.function_call.arguments)){let r=t._removeCR(e.delta.function_call.arguments);this._text.push(r),this._newText.push(r)}}flush(){let e=this._newText.join("");return this._newText=[],e}static _removeCR(e){return e.replace(/\r$/g,"")}toJSON(){return{text:this._text,newText:this._newText}}},eMr=class{static{a(this,"StreamingToolCall")}constructor(){this.arguments=""}update(e){let r=!1;return e.id&&(this.id=e.id),e.function?.name&&(this.name=e.function.name),e.function?.arguments&&(this.arguments+=e.function.arguments,r=!0),r}},tMr=class{static{a(this,"StreamingToolCalls")}constructor(){this.toolCalls=[]}getToolCalls(){return this.toolCalls.map(e=>({name:e.name,arguments:e.arguments,id:e.id}))}hasToolCalls(){return this.toolCalls.length>0}update(e){let r=[];return e.delta?.tool_calls?.forEach(n=>{let o;n.id&&(o=this.toolCalls.find(c=>c.id===n.id)),o||(o=this.toolCalls.at(-1)),(!o||n.id&&o.id&&o.id!==n.id)&&(o=new eMr,this.toolCalls.push(o)),o.update(n)&&o.name&&r.push({name:o.name,arguments:o.arguments,id:o.id})}),r}};function k8i(t){let e=t.split(` +`),r=e.pop();return[e.filter(n=>n!==""),r]}a(k8i,"splitChunk");var rMr=class t{static{a(this,"SSEProcessor")}constructor(e,r,n,o,s,c){this.logService=e,this.telemetryService=r,this.expectedNumChoices=n,this.response=o,this.body=s,this.cancellationToken=c,this.requestId=(0,pCt.getRequestId)(this.response.headers),this.solutions={},this.completedFunctionCallIdxs=new Map,this.functionCalls={},this.toolCalls=new tMr,this.functionCallName=void 0}static async create(e,r,n,o,s){let c=o.body.pipeThrough(new TextDecoderStream);return new t(e,r,n,o,c,s)}async*processSSE(e=async()=>{}){try{if(this.expectedNumChoices>1)for await(let r of this.processSSEInner(e))(0,Um.isApiUsage)(r)||(yield r);else{let r,n;for await(let o of this.processSSEInner(e))(0,Um.isApiUsage)(o)?n=o:r=o;if(await this.maybeCancel("after receiving the completion, but maybe before we got the usage"))return;r&&(r.usage=n,yield r)}}finally{await this.cancel(),this.logService.info(`request done: requestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`)}}async*processSSEInner(e){let r="",n=!1,o=!0,s=!1;for await(let c of this.body){if(await this.maybeCancel("after awaiting body chunk"))return;let[l,u]=k8i(r+c.toString());r=u;for(let d of l){if(d.startsWith(":"))continue;let f=d.slice(5).trim();if(f==="[DONE]"){yield*this.finishSolutions();return}let h;try{h=JSON.parse(f)}catch{this.logService.error(`Error parsing JSON stream data for request id ${this.requestId.headerRequestId}:${d}`),jye(this.telemetryService,`Error parsing JSON stream data for request id ${this.requestId.headerRequestId}:`,d);continue}if(h.usage&&(h.copilot_usage&&typeof h.copilot_usage.total_nano_aiu=="number"&&(h.usage.copilot_usage=h.copilot_usage),yield h.usage),h.copilot_confirmation&&Fyc(h.copilot_confirmation)&&await e("",0,{text:"",copilotConfirmation:h.copilot_confirmation}),!h.choices){!h.copilot_references&&!h.copilot_confirmation&&(h.error!==void 0?(this.logService.error(`Error in response for request id ${this.requestId.headerRequestId}:${h.error.message}`),jye(this.telemetryService,`Error in response for request id ${this.requestId.headerRequestId}:`,h.error.message),yield{index:0,finishOffset:void 0,solution:new DBe(h.model||""),reason:Um.FinishedCompletionReason.ServerError,error:h.error,requestId:this.requestId}):(this.logService.error(`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`),jye(this.telemetryService,`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`))),h.copilot_errors&&await e("",0,{text:"",copilotErrors:h.copilot_errors}),h.copilot_references&&await e("",0,{text:"",copilotReferences:h.copilot_references});continue}this.requestId.created===0&&(this.requestId=(0,pCt.getRequestId)(this.response.headers,h),this.requestId.created===0&&h.choices?.length&&(this.requestId.created=Math.floor(Date.now()/1e3)));for(let m=0;m(T?.vulnAnnotations&&(!Array.isArray(T.vulnAnnotations)||!T.vulnAnnotations.every(w=>(0,pCt.isCopilotAnnotation)(w)))&&(T.vulnAnnotations=void 0),T?.ipCodeCitations&&(!Array.isArray(T.ipCodeCitations)||!T.ipCodeCitations.every(pCt.isCodeCitationAnnotation))&&(T.ipCodeCitations=void 0),E=await e(y.text.join(""),g.index,{text:y.flush(),logprobs:g.logprobs,codeVulnAnnotations:T?.vulnAnnotations,ipCitations:T?.ipCodeCitations,copilotReferences:T?.references,copilotToolCalls:T?.toolCalls,copilotToolCallStreamUpdates:T?.toolCallStreamUpdates,_deprecatedCopilotFunctionCalls:T?.functionCalls,beginToolCalls:T?.beginToolCalls,copilotErrors:T?.errors,thinking:A??T?.thinking}),E!==void 0&&(n=!0),await this.maybeCancel("after awaiting finishedCb")),"emitSolution"),v=!0;if(g.delta?.tool_calls){if(!this.toolCalls.hasToolCalls()){let R=g.delta.tool_calls.at(0),x=R?.function?.name;if(x&&(y.text.length&&y.append({index:0,delta:{content:" "}}),await _({beginToolCalls:[{name:x,id:R?.id}]})))continue}let w=this.toolCalls.update(g);if(w.length&&await _({toolCallStreamUpdates:w}))continue}else if(g.delta?.copilot_annotations?.CodeVulnerability||g.delta?.copilot_annotations?.IPCodeCitations){if(await _()||!n&&(y.append(g),await _({vulnAnnotations:g.delta?.copilot_annotations?.CodeVulnerability,ipCodeCitations:g.delta?.copilot_annotations?.IPCodeCitations})))continue}else if(g.delta?.role==="function"){if(g.delta.content)try{let T=JSON.parse(g.delta.content);if(Array.isArray(T)&&await _({references:T}))continue}catch(T){this.logService.error(`Error parsing function references: ${JSON.stringify(T)}`)}}else if(g.delta?.function_call&&(g.delta.function_call.name||g.delta.function_call.arguments))o=!1,this.functionCallName??=g.delta.function_call.name,this.functionCalls[this.functionCallName]??=new DBe(h.model),this.functionCalls[this.functionCallName].append(g);else if((g.finish_reason===Um.FinishedCompletionReason.FunctionCall||g.finish_reason===Um.FinishedCompletionReason.Stop)&&this.functionCallName){let T=this.functionCalls[this.functionCallName],w={name:this.functionCallName,arguments:T.flush()};this.completedFunctionCallIdxs.set(g.index,"function");try{if(await _({functionCalls:[w]}))continue}catch(R){this.logService.error(R)}if(this.functionCalls[this.functionCallName]=null,this.functionCallName=void 0,g.finish_reason===Um.FinishedCompletionReason.FunctionCall)continue}else v=!1;if((g.finish_reason===Um.FinishedCompletionReason.ToolCalls||g.finish_reason===Um.FinishedCompletionReason.Stop)&&this.toolCalls.hasToolCalls()){v=!0;let T=this.toolCalls.getToolCalls();this.completedFunctionCallIdxs.set(g.index,"tool");let w=T.length>0?T[0].id:void 0;try{if(await _({toolCalls:T,thinking:w&&s?{metadata:{toolId:w}}:void 0}))continue}catch(R){this.logService.error(R)}}if(!(!v&&(y.append(g),await _())||!(g.finish_reason||E!==void 0))){if(yield{solution:y,finishOffset:E,reason:g.finish_reason??Um.FinishedCompletionReason.ClientTrimmed,filterReason:Qyc(g),requestId:this.requestId,index:g.index},await this.maybeCancel("after yielding finished choice"))return;o&&(this.solutions[g.index]=null)}}}}for(let[c,l]of Object.entries(this.solutions)){let u=Number(c);if(l!==null&&(yield{solution:l,finishOffset:void 0,reason:Um.FinishedCompletionReason.ClientIterationDone,requestId:this.requestId,index:u},await this.maybeCancel("after yielding after iteration done")))return}if(r.length>0&&!n)try{let c=JSON.parse(r);c.error!==void 0&&(this.logService.error(c.error,`Error in response: ${c.error.message}`),jye(this.telemetryService,`Error in response: ${c.error.message}`,c.error))}catch{this.logService.error(`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`),jye(this.telemetryService,`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`)}}async*finishSolutions(){for(let[e,r]of Object.entries(this.solutions)){let n=Number(e);if(r!==null){if(this.completedFunctionCallIdxs.has(n)){yield{solution:r,finishOffset:void 0,reason:this.completedFunctionCallIdxs.get(n)==="function"?Um.FinishedCompletionReason.FunctionCall:Um.FinishedCompletionReason.ToolCalls,requestId:this.requestId,index:n};continue}if(yield{solution:r,finishOffset:void 0,reason:Um.FinishedCompletionReason.ClientDone,requestId:this.requestId,index:n},await this.maybeCancel("after yielding on DONE"))return}}}async maybeCancel(e){return this.cancellationToken?.isCancellationRequested?(this.logService.debug("Cancelled: "+e),await this.cancel(),!0):!1}async cancel(){await this.response.body.destroy()}logChoice(e){let r={...e};delete r.index,delete r.content_filter_results,delete r.content_filter_offsets,this.logService.trace(`choice ${JSON.stringify(r)}`)}};Wne.SSEProcessor=rMr;function Fyc(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(Fyc,"isCopilotConfirmation");function Uyc(t){return{text:t.text.join(""),tokens:t.text}}a(Uyc,"convertToAPIJsonData");function Qyc(t){if(t.finish_reason===Um.FinishedCompletionReason.ContentFilter){if(t.delta?.copilot_annotations?.TextCopyright)return Um.FilterReason.Copyright;if(t.delta?.copilot_annotations?.Sexual||t.delta?.copilot_annotations?.SexualPattern)return Um.FilterReason.Sexual;if(t.delta?.copilot_annotations?.Violence)return Um.FilterReason.Violence;if(t.delta?.copilot_annotations?.HateSpeech||t.delta?.copilot_annotations?.HateSpeechPattern)return Um.FilterReason.Hate;if(t.delta?.copilot_annotations?.SelfHarm)return Um.FilterReason.SelfHarm;if(t.delta?.copilot_annotations?.PromptPromBlockList)return Um.FilterReason.Prompt;if(t.content_filter_results){for(let e of Object.keys(t.content_filter_results))if(t.content_filter_results[e]?.filtered)return e}}}a(Qyc,"choiceToFilterReason");function jye(t,e,r){let n=[e,r],o=n.length>0?JSON.stringify(n):"no msg",s=R8i.TelemetryData.createAndMarkAsIssued({context:"fetch",level:fCt.LogLevel[fCt.LogLevel.Error],message:o});t.sendEnhancedGHTelemetryErrorEvent("log",s.properties,s.measurements);let c=R8i.TelemetryData.createAndMarkAsIssued({context:"fetch",level:fCt.LogLevel[fCt.LogLevel.Error],message:"[redacted]"});t.sendGHTelemetryErrorEvent("log",c.properties,c.measurements)}a(jye,"sendCommunicationErrorTelemetry")});var OBe=I(Hye=>{"use strict";p();Object.defineProperty(Hye,"__esModule",{value:!0});Hye.sendEngineMessagesLengthTelemetry=O8i;Hye.sendEngineMessagesTelemetry=L8i;Hye.sendResponsesApiCompactionTelemetry=Zyc;Hye.prepareChatCompletionForReturn=Xyc;var qyc=Io(),N8i=JNr(),gCt=r2(),M8i=x0(),jyc=IBe(),iMr=vm(),MBe=qye(),Hyc=r9(),Gyc=hCt();function O8i(t,e,r,n,o){let s=n?"output":"input",c=r.properties.modelCallId;if(!c){o?.warn("[TELEMETRY] modelCallId not found in telemetryData, input/output messages cannot be linked");return}let l=e.map(f=>{let h={...f,content:typeof f.content=="string"?f.content.length:Array.isArray(f.content)?f.content.reduce((m,g)=>typeof g=="string"?m+g.length:g.type==="text"?m+(g.text?.length||0):m,0):0};return"tool_calls"in f&&f.tool_calls&&Array.isArray(f.tool_calls)&&(h.tool_calls=f.tool_calls.map(m=>({...m,function:m.function?{...m.function,arguments:typeof m.function.arguments=="string"?m.function.arguments.length:m.function.arguments}:m.function}))),h}),u={};for(let[f,h]of Object.entries(r.properties))if(f.startsWith("request.option.tools"))if(typeof h=="string")try{let m=JSON.parse(h);Array.isArray(m)?u[f]=m.length.toString():u[f]=h.length.toString()}catch{u[f]=h.length.toString()}else Array.isArray(h)?u[f]=h.length.toString():u[f]="0";else u[f]=h;let d=MBe.TelemetryData.createAndMarkAsIssued({...u,messagesJson:JSON.stringify(l),message_direction:s,modelCallId:c},r.measurements);t.sendEnhancedGHTelemetryEvent("engine.messages.length",(0,iMr.multiplexProperties)(d.properties),d.measurements),t.sendInternalMSFTTelemetryEvent("engine.messages.length",(0,iMr.multiplexProperties)(d.properties),d.measurements)}a(O8i,"sendEngineMessagesLengthTelemetry");var P8i=new gCt.LRUCache(1e3),D8i=new gCt.LRUCache(500),NBe=new gCt.LRUCache(1e3),mCt={headerRequestId:null},nMr=new gCt.LRUCache(100);function $yc(t){let e=NBe.get(t);if(e!==void 0){let r=e+1;return NBe.set(t,r),r}else return NBe.set(t,1),1}a($yc,"updateHeaderRequestIdTracker");function Vyc(t){let e=nMr.get(t);if(e!==void 0){let r=e+1;return nMr.set(t,r),r}else return nMr.set(t,1),1}a(Vyc,"updateConversationTracker");function Wyc(t,e,r){let n={};for(let[h,m]of Object.entries(e.properties))h.startsWith("request.option.")&&(n[h]=m);if(Object.keys(n).length===0)return;let o=e.properties.conversationId||e.properties.sessionId||"unknown",s=e.properties.headerRequestId||"unknown",c=(0,N8i.hash)(n).toString(),l=D8i.get(c);if(!l)l=(0,M8i.generateUuid)(),D8i.set(c,l);else return l;let u=JSON.stringify(n),d=8e3,f=[];for(let h=0;h{"use strict";p();Object.defineProperty(LBe,"__esModule",{value:!0});LBe.CompactionDataContainer=void 0;LBe.rawPartAsCompactionData=tEc;var eEc=Io(),B8i=KLe(),oMr=class extends eEc.PromptElement{static{a(this,"CompactionDataContainer")}render(){let{compaction:e}=this.props,r={type:B8i.CustomDataPartMimeTypes.ContextManagement,compaction:e};return vscpp("opaque",{value:r})}};LBe.CompactionDataContainer=oMr;function tEc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===B8i.CustomDataPartMimeTypes.ContextManagement&&r.compaction&&typeof r.compaction=="object")return r.compaction}a(tEc,"rawPartAsCompactionData")});var Q8i=I(BBe=>{"use strict";p();Object.defineProperty(BBe,"__esModule",{value:!0});BBe.PhaseDataContainer=void 0;BBe.rawPartAsPhaseData=nEc;var rEc=Io(),U8i=KLe(),sMr=class extends rEc.PromptElement{static{a(this,"PhaseDataContainer")}render(){let{phase:e}=this.props,r={type:U8i.CustomDataPartMimeTypes.PhaseData,phase:e};return vscpp("opaque",{value:r})}};BBe.PhaseDataContainer=sMr;function nEc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===U8i.CustomDataPartMimeTypes.PhaseData&&typeof r.phase=="string")return r.phase}a(nEc,"rawPartAsPhaseData")});var H8i=I(IL=>{"use strict";p();Object.defineProperty(IL,"__esModule",{value:!0});IL.StatefulMarkerContainer=void 0;IL.rawPartAsStatefulMarker=j8i;IL.encodeStatefulMarker=iEc;IL.decodeStatefulMarker=oEc;IL.getAllStatefulMarkersAndIndicies=lMr;IL.getStatefulMarkerAndIndex=sEc;IL.getIndexOfStatefulMarker=aEc;var aMr=Io(),q8i=KLe(),cMr=class extends aMr.PromptElement{static{a(this,"StatefulMarkerContainer")}render(){let{statefulMarker:e}=this.props,r={type:q8i.CustomDataPartMimeTypes.StatefulMarker,value:e};return vscpp("opaque",{value:r})}};IL.StatefulMarkerContainer=cMr;function j8i(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===q8i.CustomDataPartMimeTypes.StatefulMarker&&typeof r.value=="object")return r.value}a(j8i,"rawPartAsStatefulMarker");function iEc(t,e){return new TextEncoder().encode(t+"\\"+e)}a(iEc,"encodeStatefulMarker");function oEc(t){let e=new TextDecoder().decode(t),[r,n]=e.split("\\");return{modelId:r,marker:n}}a(oEc,"decodeStatefulMarker");function*lMr(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.role===aMr.Raw.ChatRole.Assistant){for(let n of r.content)if(n.type===aMr.Raw.ChatCompletionContentPartKind.Opaque){let o=j8i(n);o&&(yield{statefulMarker:o,index:e})}}}}a(lMr,"getAllStatefulMarkersAndIndicies");function sEc(t,e){for(let r of lMr(e))if(r.statefulMarker.modelId===t)return{statefulMarker:r.statefulMarker.marker,index:r.index}}a(sEc,"getStatefulMarkerAndIndex");function aEc(t,e){for(let r of lMr(e))if(r.statefulMarker.marker===t)return r.index}a(aEc,"getIndexOfStatefulMarker")});var V8i=I(u9=>{"use strict";p();var cEc=u9&&u9.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lEc=u9&&u9.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),$8i=u9&&u9.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var qgc=Uv&&Uv.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},jgc=Uv&&Uv.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Uv,"__esModule",{value:!0});Uv.OpenAIResponsesProcessor=void 0;Uv.getResponsesApiCompactionThreshold=aFi;Uv.createResponsesRequestBody=rAc;Uv.getResponsesApiCompactionThresholdFromBody=nAc;Uv.responseApiInputToRawMessagesForLogging=pAc;Uv.processResponseFromChatEndpoint=CAc;Uv.sendCompletionOutputTelemetry=uFi;var Xi=Io(),CNr=Sl(),Hgc=nl(),Ggc=e$(),$gc=eF(),Vgc=$Dr(),bL=KS(),Wgc=T0(),tFi=jR(),Une=Pl(),zgc=Sp(),Z6=Ovt(),Ygc=$6(),Of=H6(),Kgc=ZDr(),ENr=fBe(),Jgc=X6(),Zgc=mh(),$vt=aBe(),bNr=V3i(),Xgc=z3i(),rFi=J3i(),eAc=e2r(),tAc=eFi();function aFi(t,e,r){if(t.getExperimentBasedConfig(Une.ConfigKey.ResponsesApiContextManagementEnabled,e)&&!Of.modelsWithoutResponsesContextManagement.has(r.family))return r.modelMaxPromptTokens>0?Math.floor(r.modelMaxPromptTokens*.9):5e4}a(aFi,"getResponsesApiCompactionThreshold");function rAc(t,e,r,n){let o=t.get(Une.IConfigurationService),s=t.get(Zgc.IExperimentationService),c=(0,$vt.getVerbosityForModelSync)(n),l=aFi(o,s,n),u=iAc(t,e),d=!!e.ignoreStatefulMarker||!!e.useWebSocket,f=!!e.modeChanged,h=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(q=>q.function.name===Z6.CUSTOM_TOOL_SEARCH_NAME),m=e.location===tFi.ChatLocation.Agent||e.location===tFi.ChatLocation.MessagesProxy,g=e.telemetryProperties?.subType?.startsWith("subagent")??!1,A=h&&m&&!g,y=A?t.get(Kgc.IToolDeferralService):void 0,E=[];if(e.requestOptions?.tools)for(let q of e.requestOptions.tools)!q.function.name||q.function.name.length===0||q.function.name===Z6.CUSTOM_TOOL_SEARCH_NAME||A&&!y.isNonDeferredTool(q.function.name)||E.push({...q.function,type:"function",strict:!1,parameters:q.function.parameters||{}});let _=[...E];A&&_.unshift({type:"tool_search",execution:"client",description:"Search for relevant tools by describing what you need. Returns tool definitions for tools matching your query.",parameters:{type:"object",properties:{query:{type:"string",description:"Natural language description of what tool capability you are looking for."}},required:["query"]}});let v=e.requestOptions?.tools?new Map(e.requestOptions.tools.map(q=>[q.function.name,q])):void 0,b=A?q=>!y.isNonDeferredTool(q):void 0,T={model:r,...oAc(r,e.messages,d,u,{toolsMap:v,shouldLoadToolFromToolSearch:b,modeChanged:f}),stream:!0,tools:_.length>0?_:void 0,max_output_tokens:e.postOptions.max_tokens,tool_choice:typeof e.postOptions.tool_choice=="object"?{type:"function",name:e.postOptions.tool_choice.function.name}:e.postOptions.tool_choice,top_logprobs:e.postOptions.logprobs?3:void 0,store:!1,text:c?{verbosity:c}:void 0};l!==void 0&&(T.context_management=[{type:Of.openAIContextManagementCompactionType,compact_threshold:l}]),T.truncation=o.getConfig(Une.ConfigKey.Advanced.UseResponsesApiTruncation)?"auto":"disabled";let w=e.modelCapabilities?.enableThinking===!1,R=o.getExperimentBasedConfig(Une.ConfigKey.ResponsesApiReasoningSummary,s),x=n.family==="gpt-5.3-codex-spark-preview"||w,P=o.getConfig(Une.ConfigKey.Advanced.ReasoningEffortOverride),D=n.supportsReasoningEffort?.length?P||e.modelCapabilities?.reasoningEffort||"medium":void 0,N=R==="off"||x?void 0:R,L=o.getExperimentBasedConfig(Une.ConfigKey.ResponsesApiPersistentCoTEnabled,s)&&((0,$vt.isGpt54)(n)||(0,$vt.isGpt55)(n)||(0,$vt.isHiddenModelM)(n));return(D||N||L)&&(T.reasoning={...D?{effort:D}:{},...N?{summary:N}:{},...L?{context:"all_turns"}:{}}),T.include=["reasoning.encrypted_content"],o.getExperimentBasedConfig(Une.ConfigKey.ResponsesApiPromptCacheKeyEnabled,s)&&e.conversationId&&(T.prompt_cache_key=`${e.conversationId}:${n.family}`),T}a(rAc,"createResponsesRequestBody");function nAc(t){let e=t.context_management;if(Array.isArray(e)){for(let r of e)if(r.type===Of.openAIContextManagementCompactionType&&typeof r.compact_threshold=="number")return r.compact_threshold}}a(nAc,"getResponsesApiCompactionThresholdFromBody");function iAc(t,e){if(e.ignoreStatefulMarker||!e.useWebSocket||!e.conversationId)return;let r=t.get(Jgc.IChatWebSocketManager),n=r.getSummarizedAtRoundId(e.conversationId);if(e.summarizedAtRoundId===n)return r.getStatefulMarker(e.conversationId)}a(iAc,"resolveWebSocketStatefulMarker");function oAc(t,e,r,n,o={}){let{toolsMap:s,shouldLoadToolFromToolSearch:c,modeChanged:l=!1}=o,u=aAc(e),d=u!==void 0?sAc(e[u]):void 0,f,h;if(n)h=(0,rFi.getIndexOfStatefulMarker)(n,e),h!==void 0&&(f=n);else if(!r){let E=(0,rFi.getStatefulMarkerAndIndex)(t,e);E&&(f=E.statefulMarker,h=E.index)}l&&(f=void 0,h=void 0);let m=new Set,g=new Set;if(h!==void 0||u!==void 0){for(let E of e)if(E.role===Xi.Raw.ChatRole.Assistant&&E.toolCalls)for(let _ of E.toolCalls)_.function.name===Z6.CUSTOM_TOOL_SEARCH_NAME&&m.add(_.id);else if(E.role===Xi.Raw.ChatRole.Tool&&E.toolCallId&&m.has(E.toolCallId)&&s){let _=E.content.filter(v=>v.type===Xi.Raw.ChatCompletionContentPartKind.Text).map(v=>v.text).join("");for(let v of nFi(_,s,c))g.add(v.name)}}h!==void 0?(e=e.slice(h+1),u!==void 0&&(u>h?e=e.slice(u-(h+1)):d&&(e=[d,...e]))):u!==void 0&&(e=e.slice(u));let y=[];for(let E of e)switch(E.role){case Xi.Raw.ChatRole.Assistant:if(E.content.length){y.push(...fAc(E.content)),y.push(...uAc(E.content));let _=E.content.map(cAc).filter(bL.isDefined);if(_.length){let v={role:"assistant",content:_,type:"message",phase:dAc(E.content)};y.push(v)}}if(E.toolCalls)for(let _ of E.toolCalls)if(_.function.name===Z6.CUSTOM_TOOL_SEARCH_NAME){m.add(_.id);let v={};try{v=JSON.parse(_.function.arguments||"{}")}catch{}y.push({type:"tool_search_call",execution:"client",call_id:_.id,status:"completed",arguments:v})}else{let v=g.has(_.function.name)?_.function.name:void 0;y.push({type:"function_call",name:_.function.name,arguments:_.function.arguments,call_id:_.id,...v?{namespace:v}:{}})}break;case Xi.Raw.ChatRole.Tool:if(E.toolCallId)if(m.has(E.toolCallId)){let _=E.content.filter(b=>b.type===Xi.Raw.ChatCompletionContentPartKind.Text).map(b=>b.text).join(""),v=s?nFi(_,s,c):[];for(let b of v)g.add(b.name);y.push({type:"tool_search_output",execution:"client",call_id:E.toolCallId,status:"completed",tools:v})}else{let _=E.content.filter(T=>T.type===Xi.Raw.ChatCompletionContentPartKind.Text).map(T=>T.text).join(""),v=E.content.filter(T=>T.type===Xi.Raw.ChatCompletionContentPartKind.Image).map(T=>({type:"input_image",detail:T.imageUrl.detail||"auto",image_url:T.imageUrl.url})),b=E.content.filter(T=>T.type===Xi.Raw.ChatCompletionContentPartKind.Document).map(cFi).filter(bL.isDefined);y.push({type:"function_call_output",call_id:E.toolCallId,output:_}),v.length&&y.push({role:"user",content:[{type:"input_text",text:"Image associated with the above tool call:"},...v]}),b.length&&y.push({role:"user",content:[{type:"input_text",text:"PDF associated with the above tool call:"},...b]})}break;case Xi.Raw.ChatRole.User:y.push({role:"user",content:E.content.map(iFi).filter(bL.isDefined)});break;case Xi.Raw.ChatRole.System:y.push({role:"system",content:E.content.map(iFi).filter(bL.isDefined)});break}return{input:y,previous_response_id:f}}a(oAc,"rawMessagesToResponseAPI");function nFi(t,e,r){let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(o=>typeof o=="string"&&o!==Z6.CUSTOM_TOOL_SEARCH_NAME&&e.has(o)&&r?.(o)===!0).map(o=>{let s=e.get(o);return{type:"function",name:s.function.name,description:s.function.description||"",defer_loading:!0,parameters:s.function.parameters||{type:"object",properties:{}},strict:!1}}):[]}a(nFi,"buildToolSearchOutputTools");function sAc(t){if(t.role!==Xi.Raw.ChatRole.Assistant)return;let e=t.content.filter(r=>r.type===Xi.Raw.ChatCompletionContentPartKind.Opaque&&(0,bNr.rawPartAsCompactionData)(r));if(e.length)return{role:Xi.Raw.ChatRole.Assistant,content:e}}a(sAc,"createCompactionRoundTripMessage");function aAc(t){for(let e=t.length-1;e>=0;e--){let r=t[e];for(let n of r.content)if(n.type===Xi.Raw.ChatCompletionContentPartKind.Opaque&&(0,bNr.rawPartAsCompactionData)(n))return e}}a(aAc,"getLatestCompactionMessageIndex");function cFi(t){if(t.documentData.mediaType==="application/pdf")return{type:"input_file",filename:"document.pdf",file_data:`data:${t.documentData.mediaType};base64,${t.documentData.data}`}}a(cFi,"rawDocumentToResponsesInputFile");function iFi(t){switch(t.type){case Xi.Raw.ChatCompletionContentPartKind.Text:return{type:"input_text",text:t.text};case Xi.Raw.ChatCompletionContentPartKind.Image:return{type:"input_image",detail:t.imageUrl.detail||"auto",image_url:t.imageUrl.url};case Xi.Raw.ChatCompletionContentPartKind.Document:return cFi(t);case Xi.Raw.ChatCompletionContentPartKind.Opaque:{let e=t.value;if(e.type==="input_text"||e.type==="input_image"||e.type==="input_file")return e}}}a(iFi,"rawContentToResponsesContent");function cAc(t){switch(t.type){case Xi.Raw.ChatCompletionContentPartKind.Text:if(t.text.trim())return{type:"output_text",text:t.text}}}a(cAc,"rawContentToResponsesAssistantContent");function lAc(t){return typeof t=="string"&&t.startsWith("rs")}a(lAc,"isResponsesReasoningId");function uAc(t){return(0,CNr.coalesce)(t.map(e=>{if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,eAc.rawPartAsThinkingData)(e);if(r&&r.encrypted&&lAc(r.id))return{type:"reasoning",id:r.id,summary:[],encrypted_content:r.encrypted}}}))}a(uAc,"extractThinkingData");function dAc(t){for(let e of t)if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,Xgc.rawPartAsPhaseData)(e);if(r)return r}}a(dAc,"extractPhaseData");function fAc(t){return(0,CNr.coalesce)(t.map(e=>{if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,bNr.rawPartAsCompactionData)(e);if(r)return{type:Of.openAIContextManagementCompactionType,id:r.id,encrypted_content:r.encrypted_content}}}))}a(fAc,"extractCompactionData");function pAc(t){let e=[],r=[],n=a(()=>{r.length>0&&e.push({role:Xi.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)})},"flushPendingFunctionCalls");t.instructions&&e.push({role:Xi.Raw.ChatRole.System,content:[{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:t.instructions}]});let o=typeof t.input=="string"?[{role:"user",content:t.input,type:"message"}]:t.input??[];for(let s of o)if("role"in s)switch(s.role){case"user":n(),e.push({role:Xi.Raw.ChatRole.User,content:yNr(s.content).map(Vvt).filter(bL.isDefined)});break;case"system":case"developer":n(),e.push({role:Xi.Raw.ChatRole.System,content:yNr(s.content).map(Vvt).filter(bL.isDefined)});break;case"assistant":n(),hAc(s)?e.push({role:Xi.Raw.ChatRole.Assistant,content:s.content.map(gAc).filter(bL.isDefined)}):mAc(s)&&e.push({role:Xi.Raw.ChatRole.Assistant,content:yNr(s.content).map(Vvt).filter(bL.isDefined)});break}else if("type"in s)switch(s.type){case"function_call":r.push({id:s.call_id,type:"function",function:{name:s.name,arguments:s.arguments}});break;case"function_call_output":{n();let c=AAc(s.output);e.push({role:Xi.Raw.ChatRole.Tool,content:c,toolCallId:s.call_id});break}case"reasoning":n(),e.push({role:Xi.Raw.ChatRole.Assistant,content:[{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:`Reasoning summary: ${s.summary.map(c=>c.text).join(` +`),e.info(`[responsesAPI] Dumping SSE stream to ${s}`),new fMr(s)}catch{return G8i}}a(dEc,"createResponsesStreamDumper")});var _Ct=I(jv=>{"use strict";p();var fEc=jv&&jv.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},pEc=jv&&jv.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(jv,"__esModule",{value:!0});jv.OpenAIResponsesProcessor=void 0;jv.getResponsesApiCompactionThreshold=X8i;jv.createResponsesRequestBody=xEc;jv.getResponsesApiCompactionThresholdFromBody=wEc;jv.responseApiInputToRawMessagesForLogging=FEc;jv.processResponseFromChatEndpoint=WEc;jv.sendCompletionOutputTelemetry=r6i;var Zi=Io(),AMr=Sl(),hEc=nl(),mEc=p$(),gEc=cF(),AEc=QNr(),xL=nT(),yEc=x0(),W8i=JR(),zne=Pl(),EEc=xp(),d9=aCt(),_Ec=i9(),Qf=r9(),vEc=WNr(),hMr=OBe(),CEc=f9(),bEc=yh(),ACt=kBe(),yMr=F8i(),SEc=Q8i(),z8i=H8i(),TEc=Y2r(),IEc=V8i();function X8i(t,e,r){if(t.getExperimentBasedConfig(zne.ConfigKey.ResponsesApiContextManagementEnabled,e)&&!Qf.modelsWithoutResponsesContextManagement.has(r.family))return r.modelMaxPromptTokens>0?Math.floor(r.modelMaxPromptTokens*.9):5e4}a(X8i,"getResponsesApiCompactionThreshold");function xEc(t,e,r,n){let o=t.get(zne.IConfigurationService),s=t.get(bEc.IExperimentationService),c=(0,ACt.getVerbosityForModelSync)(n),l=X8i(o,s,n),u=REc(t,e),d=!!e.ignoreStatefulMarker||!!e.useWebSocket,f=!!e.modeChanged,h=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(j=>j.function.name===d9.CUSTOM_TOOL_SEARCH_NAME),m=e.location===W8i.ChatLocation.Agent||e.location===W8i.ChatLocation.MessagesProxy,g=e.telemetryProperties?.subType?.startsWith("subagent")??!1,A=h&&m&&!g,y=A?t.get(vEc.IToolDeferralService):void 0,E=[];if(e.requestOptions?.tools)for(let j of e.requestOptions.tools)!j.function.name||j.function.name.length===0||j.function.name===d9.CUSTOM_TOOL_SEARCH_NAME||A&&!y.isNonDeferredTool(j.function.name)||E.push({...j.function,type:"function",strict:!1,parameters:j.function.parameters||{}});let _=[...E];A&&_.unshift({type:"tool_search",execution:"client",description:"Search for relevant tools by describing what you need. Returns tool definitions for tools matching your query.",parameters:{type:"object",properties:{query:{type:"string",description:"Natural language description of what tool capability you are looking for."}},required:["query"]}});let v=e.requestOptions?.tools?new Map(e.requestOptions.tools.map(j=>[j.function.name,j])):void 0,b=A?j=>!y.isNonDeferredTool(j):void 0,T={model:r,...kEc(r,e.messages,d,u,{toolsMap:v,shouldLoadToolFromToolSearch:b,modeChanged:f}),stream:!0,tools:_.length>0?_:void 0,max_output_tokens:e.postOptions.max_tokens,tool_choice:typeof e.postOptions.tool_choice=="object"?{type:"function",name:e.postOptions.tool_choice.function.name}:e.postOptions.tool_choice,top_logprobs:e.postOptions.logprobs?3:void 0,store:!1,text:c?{verbosity:c}:void 0};l!==void 0&&(T.context_management=[{type:Qf.openAIContextManagementCompactionType,compact_threshold:l}]),T.truncation=o.getConfig(zne.ConfigKey.Advanced.UseResponsesApiTruncation)?"auto":"disabled";let w=e.modelCapabilities?.enableThinking===!1,R=o.getExperimentBasedConfig(zne.ConfigKey.ResponsesApiReasoningSummary,s),x=n.family==="gpt-5.3-codex-spark-preview"||w,P=o.getConfig(zne.ConfigKey.Advanced.ReasoningEffortOverride),D=n.supportsReasoningEffort?.length?P||e.modelCapabilities?.reasoningEffort||"medium":void 0,N=R==="off"||x?void 0:R,L=o.getExperimentBasedConfig(zne.ConfigKey.ResponsesApiPersistentCoTEnabled,s)&&((0,ACt.isGpt54)(n)||(0,ACt.isGpt55)(n)||(0,ACt.isHiddenModelM)(n));return(D||N||L)&&(T.reasoning={...D?{effort:D}:{},...N?{summary:N}:{},...L?{context:"all_turns"}:{}}),T.include=["reasoning.encrypted_content"],o.getExperimentBasedConfig(zne.ConfigKey.ResponsesApiPromptCacheKeyEnabled,s)&&e.conversationId&&(T.prompt_cache_key=`${e.conversationId}:${n.family}`),T}a(xEc,"createResponsesRequestBody");function wEc(t){let e=t.context_management;if(Array.isArray(e)){for(let r of e)if(r.type===Qf.openAIContextManagementCompactionType&&typeof r.compact_threshold=="number")return r.compact_threshold}}a(wEc,"getResponsesApiCompactionThresholdFromBody");function REc(t,e){if(e.ignoreStatefulMarker||!e.useWebSocket||!e.conversationId)return;let r=t.get(CEc.IChatWebSocketManager),n=r.getSummarizedAtRoundId(e.conversationId);if(e.summarizedAtRoundId===n)return r.getStatefulMarker(e.conversationId)}a(REc,"resolveWebSocketStatefulMarker");function kEc(t,e,r,n,o={}){let{toolsMap:s,shouldLoadToolFromToolSearch:c,modeChanged:l=!1}=o,u=DEc(e),d=u!==void 0?PEc(e[u]):void 0,f,h;if(n)h=(0,z8i.getIndexOfStatefulMarker)(n,e),h!==void 0&&(f=n);else if(!r){let E=(0,z8i.getStatefulMarkerAndIndex)(t,e);E&&(f=E.statefulMarker,h=E.index)}l&&(f=void 0,h=void 0);let m=new Set,g=new Set;if(h!==void 0||u!==void 0){for(let E of e)if(E.role===Zi.Raw.ChatRole.Assistant&&E.toolCalls)for(let _ of E.toolCalls)_.function.name===d9.CUSTOM_TOOL_SEARCH_NAME&&m.add(_.id);else if(E.role===Zi.Raw.ChatRole.Tool&&E.toolCallId&&m.has(E.toolCallId)&&s){let _=E.content.filter(v=>v.type===Zi.Raw.ChatCompletionContentPartKind.Text).map(v=>v.text).join("");for(let v of Y8i(_,s,c))g.add(v.name)}}h!==void 0?(e=e.slice(h+1),u!==void 0&&(u>h?e=e.slice(u-(h+1)):d&&(e=[d,...e]))):u!==void 0&&(e=e.slice(u));let y=[];for(let E of e)switch(E.role){case Zi.Raw.ChatRole.Assistant:if(E.content.length){y.push(...BEc(E.content)),y.push(...OEc(E.content));let _=E.content.map(NEc).filter(xL.isDefined);if(_.length){let v={role:"assistant",content:_,type:"message",phase:LEc(E.content)};y.push(v)}}if(E.toolCalls)for(let _ of E.toolCalls)if(_.function.name===d9.CUSTOM_TOOL_SEARCH_NAME){m.add(_.id);let v={};try{v=JSON.parse(_.function.arguments||"{}")}catch{}y.push({type:"tool_search_call",execution:"client",call_id:_.id,status:"completed",arguments:v})}else{let v=g.has(_.function.name)?_.function.name:void 0;y.push({type:"function_call",name:_.function.name,arguments:_.function.arguments,call_id:_.id,...v?{namespace:v}:{}})}break;case Zi.Raw.ChatRole.Tool:if(E.toolCallId)if(m.has(E.toolCallId)){let _=E.content.filter(b=>b.type===Zi.Raw.ChatCompletionContentPartKind.Text).map(b=>b.text).join(""),v=s?Y8i(_,s,c):[];for(let b of v)g.add(b.name);y.push({type:"tool_search_output",execution:"client",call_id:E.toolCallId,status:"completed",tools:v})}else{let _=E.content.filter(T=>T.type===Zi.Raw.ChatCompletionContentPartKind.Text).map(T=>T.text).join(""),v=E.content.filter(T=>T.type===Zi.Raw.ChatCompletionContentPartKind.Image).map(T=>({type:"input_image",detail:T.imageUrl.detail||"auto",image_url:T.imageUrl.url})),b=E.content.filter(T=>T.type===Zi.Raw.ChatCompletionContentPartKind.Document).map(e6i).filter(xL.isDefined);y.push({type:"function_call_output",call_id:E.toolCallId,output:_}),v.length&&y.push({role:"user",content:[{type:"input_text",text:"Image associated with the above tool call:"},...v]}),b.length&&y.push({role:"user",content:[{type:"input_text",text:"PDF associated with the above tool call:"},...b]})}break;case Zi.Raw.ChatRole.User:y.push({role:"user",content:E.content.map(K8i).filter(xL.isDefined)});break;case Zi.Raw.ChatRole.System:y.push({role:"system",content:E.content.map(K8i).filter(xL.isDefined)});break}return{input:y,previous_response_id:f}}a(kEc,"rawMessagesToResponseAPI");function Y8i(t,e,r){let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(o=>typeof o=="string"&&o!==d9.CUSTOM_TOOL_SEARCH_NAME&&e.has(o)&&r?.(o)===!0).map(o=>{let s=e.get(o);return{type:"function",name:s.function.name,description:s.function.description||"",defer_loading:!0,parameters:s.function.parameters||{type:"object",properties:{}},strict:!1}}):[]}a(Y8i,"buildToolSearchOutputTools");function PEc(t){if(t.role!==Zi.Raw.ChatRole.Assistant)return;let e=t.content.filter(r=>r.type===Zi.Raw.ChatCompletionContentPartKind.Opaque&&(0,yMr.rawPartAsCompactionData)(r));if(e.length)return{role:Zi.Raw.ChatRole.Assistant,content:e}}a(PEc,"createCompactionRoundTripMessage");function DEc(t){for(let e=t.length-1;e>=0;e--){let r=t[e];for(let n of r.content)if(n.type===Zi.Raw.ChatCompletionContentPartKind.Opaque&&(0,yMr.rawPartAsCompactionData)(n))return e}}a(DEc,"getLatestCompactionMessageIndex");function e6i(t){if(t.documentData.mediaType==="application/pdf")return{type:"input_file",filename:"document.pdf",file_data:`data:${t.documentData.mediaType};base64,${t.documentData.data}`}}a(e6i,"rawDocumentToResponsesInputFile");function K8i(t){switch(t.type){case Zi.Raw.ChatCompletionContentPartKind.Text:return{type:"input_text",text:t.text};case Zi.Raw.ChatCompletionContentPartKind.Image:return{type:"input_image",detail:t.imageUrl.detail||"auto",image_url:t.imageUrl.url};case Zi.Raw.ChatCompletionContentPartKind.Document:return e6i(t);case Zi.Raw.ChatCompletionContentPartKind.Opaque:{let e=t.value;if(e.type==="input_text"||e.type==="input_image"||e.type==="input_file")return e}}}a(K8i,"rawContentToResponsesContent");function NEc(t){switch(t.type){case Zi.Raw.ChatCompletionContentPartKind.Text:if(t.text.trim())return{type:"output_text",text:t.text}}}a(NEc,"rawContentToResponsesAssistantContent");function MEc(t){return typeof t=="string"&&t.startsWith("rs")}a(MEc,"isResponsesReasoningId");function OEc(t){return(0,AMr.coalesce)(t.map(e=>{if(e.type===Zi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,TEc.rawPartAsThinkingData)(e);if(r&&r.encrypted&&MEc(r.id))return{type:"reasoning",id:r.id,summary:[],encrypted_content:r.encrypted}}}))}a(OEc,"extractThinkingData");function LEc(t){for(let e of t)if(e.type===Zi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,SEc.rawPartAsPhaseData)(e);if(r)return r}}a(LEc,"extractPhaseData");function BEc(t){return(0,AMr.coalesce)(t.map(e=>{if(e.type===Zi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,yMr.rawPartAsCompactionData)(e);if(r)return{type:Qf.openAIContextManagementCompactionType,id:r.id,encrypted_content:r.encrypted_content}}}))}a(BEc,"extractCompactionData");function FEc(t){let e=[],r=[],n=a(()=>{r.length>0&&e.push({role:Zi.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)})},"flushPendingFunctionCalls");t.instructions&&e.push({role:Zi.Raw.ChatRole.System,content:[{type:Zi.Raw.ChatCompletionContentPartKind.Text,text:t.instructions}]});let o=typeof t.input=="string"?[{role:"user",content:t.input,type:"message"}]:t.input??[];for(let s of o)if("role"in s)switch(s.role){case"user":n(),e.push({role:Zi.Raw.ChatRole.User,content:pMr(s.content).map(yCt).filter(xL.isDefined)});break;case"system":case"developer":n(),e.push({role:Zi.Raw.ChatRole.System,content:pMr(s.content).map(yCt).filter(xL.isDefined)});break;case"assistant":n(),UEc(s)?e.push({role:Zi.Raw.ChatRole.Assistant,content:s.content.map(qEc).filter(xL.isDefined)}):QEc(s)&&e.push({role:Zi.Raw.ChatRole.Assistant,content:pMr(s.content).map(yCt).filter(xL.isDefined)});break}else if("type"in s)switch(s.type){case"function_call":r.push({id:s.call_id,type:"function",function:{name:s.name,arguments:s.arguments}});break;case"function_call_output":{n();let c=jEc(s.output);e.push({role:Zi.Raw.ChatRole.Tool,content:c,toolCallId:s.call_id});break}case"reasoning":n(),e.push({role:Zi.Raw.ChatRole.Assistant,content:[{type:Zi.Raw.ChatCompletionContentPartKind.Text,text:`Reasoning summary: ${s.summary.map(c=>c.text).join(` -`)}`}]});break;default:{let c=s;if(c.type==="tool_search_call")r.push({id:c.call_id,type:"function",function:{name:Z6.CUSTOM_TOOL_SEARCH_NAME,arguments:JSON.stringify(c.arguments??{})}});else if(c.type==="tool_search_output"){n();let l=c.tools.map(u=>u.name);e.push({role:Xi.Raw.ChatRole.Tool,content:[{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:JSON.stringify(l)}],toolCallId:c.call_id})}break}}return r.length>0&&e.push({role:Xi.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)}),e}a(pAc,"responseApiInputToRawMessagesForLogging");function hAc(t){return"role"in t&&t.role==="assistant"&&"type"in t&&t.type==="message"&&"content"in t&&Array.isArray(t.content)}a(hAc,"isResponseOutputMessage");function mAc(t){return"role"in t&&t.role==="assistant"&&(!("type"in t)||t.type!=="message")}a(mAc,"isResponseInputItemMessage");function yNr(t){return typeof t=="string"?[{type:"input_text",text:t}]:t}a(yNr,"ensureContentArray");function Vvt(t){switch(t.type){case"input_text":return{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"input_image":return{type:Xi.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:t.image_url||"",detail:t.detail==="auto"?void 0:t.detail??void 0}};case"input_file":return{type:Xi.Raw.ChatCompletionContentPartKind.Opaque,value:`[File Input - Filename: ${t.filename||"unknown"}]`}}}a(Vvt,"responseContentToRawContent");function gAc(t){switch(t.type){case"output_text":return{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"refusal":return{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:`[Refusal: ${t.refusal}]`}}}a(gAc,"responseOutputToRawContent");function AAc(t){return typeof t=="string"?[{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:t}]:(0,CNr.coalesce)(t.map(Vvt))}a(AAc,"responseFunctionOutputToRawContents");function _Nr(t){return typeof t=="object"&&t!==null&&"type"in t&&String(t.type)===Of.openAIContextManagementCompactionType}a(_Nr,"isCompactionItem");function yAc(t){return"item"in t&&"output_index"in t&&typeof t.output_index=="number"}a(yAc,"hasOutputItem");function EAc(t){return"response"in t&&Array.isArray(t.response.output)}a(EAc,"hasResponseOutput");function _Ac(t){return t.output_index}a(_Ac,"getOutputItemIndex");function vNr(t){return _Nr(t)}a(vNr,"isCompactionOutputItem");function lFi(t,e){let r;for(let n=t.length-1;n>=0;n--){let o=t[n];if(vNr(o)){r={item:o,outputIndex:n};break}}if(e!==void 0){let n=t[e];if(n&&vNr(n)&&(!r||e>=r.outputIndex))return{item:n,outputIndex:e}}return r}a(lFi,"getLatestCompactionOutput");function vAc(t,e){let r=lFi(t,e);return r?t.filter((n,o)=>!vNr(n)||o===r.outputIndex):t}a(vAc,"keepLatestCompactionOutput");async function CAc(t,e,r,n,o,s,c,l){return new Hgc.AsyncIterableObject(async u=>{let d=n.headers.get("X-Request-ID")??(0,Wgc.generateUuid)(),f=n.headers.get("x-github-request-id")??"",{serverExperiments:h}=(0,Ygc.getRequestId)(n.headers),m=t.createInstance(Wvt,c,e,d,f,h,l),g=(0,tAc.createResponsesStreamDumper)(d,r),A=new Vgc.SSEParser(y=>{try{if(r.trace(`SSE: ${y.data}`),y.data==="[DONE]")return;let E=JSON.parse(y.data),_={type:y.type,...E};g.logEvent(_);let v=m.push(_,s);v&&(uFi(e,r,v,c),u.emitOne(v))}catch(E){u.reject(E)}});for await(let y of n.body)A.feed(y)},async()=>{await n.body.destroy()})}a(CAc,"processResponseFromChatEndpoint");function uFi(t,e,r,n){let o=(0,Of.rawMessageToCAPI)(r.message),s=n;r.usage&&(s=n.extendedBy({},{promptTokens:r.usage.prompt_tokens,completionTokens:r.usage.completion_tokens,totalTokens:r.usage.total_tokens,...r.usage.prompt_tokens_details&&{cachedTokens:r.usage.prompt_tokens_details.cached_tokens},...r.usage.completion_tokens_details&&{reasoningTokens:r.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:r.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:r.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,ENr.sendEngineMessagesTelemetry)(t,[o],s,!0,e)}a(uFi,"sendCompletionOutputTelemetry");function bAc(t){if(!t)return;let e=t.filter(c=>c.blocked),r=e.find(c=>c.source_type==="completion")??e[0];if(!r)return;let o=r.content_filter_raw?.find(c=>c.action==="BLOCK"&&c.result===!0)?.label?.toLowerCase()??"";if(o.includes("copyright"))return Of.FilterReason.Copyright;if(o.includes("selfharm")||o.includes("self_harm"))return Of.FilterReason.SelfHarm;if(o.includes("sexual"))return Of.FilterReason.Sexual;if(o.includes("violence"))return Of.FilterReason.Violence;if(o.includes("hate"))return Of.FilterReason.Hate;let s=r.content_filter_results??{};if(s.hate?.filtered)return Of.FilterReason.Hate;if(s.self_harm?.filtered)return Of.FilterReason.SelfHarm;if(s.sexual?.filtered)return Of.FilterReason.Sexual;if(s.violence?.filtered)return Of.FilterReason.Violence;if(s.protected_material_text?.filtered||s.protected_material_code?.filtered)return Of.FilterReason.Copyright;if(r.source_type==="prompt")return Of.FilterReason.Prompt}a(bAc,"extractFilterReasonFromContentFilters");function oFi(t){if(t)return{code:0,message:t.message??"",metadata:{code:t.code}}}a(oFi,"mapResponsesApiError");var Wvt=class{static{a(this,"OpenAIResponsesProcessor")}constructor(e,r,n,o,s,c,l){this.telemetryData=e,this.telemetryService=r,this.requestId=n,this.ghRequestId=o,this.serverExperiments=s,this.compactionThreshold=c,this.logService=l,this.textAccumulator="",this.hasReceivedReasoningSummary=!1,this.sawCompactionMessage=!1,this.toolCallInfo=new Map}getCompactionItemsInChunk(e){let r=[];if(yAc(e)&&_Nr(e.item)){let n=_Ac(e);r.push({item:e.item,outputIndex:n})}if(EAc(e))for(let n=0;n{this.textAccumulator+=s.text,r(this.textAccumulator,0,s)},"onProgress"),o=this.getCompactionItemsInChunk(e);if(e.type!=="response.completed")for(let{item:s,outputIndex:c}of o)this.captureCompactionItem(s,c,n);switch(e.type){case"error":return n({text:"",copilotErrors:[{agent:"openai",code:e.code||"unknown",message:e.message,type:"error",identifier:e.param||void 0}]});case"response.output_text.delta":{let s=e;this.lastTextDeltaOutputIndex!==void 0&&s.output_index!==this.lastTextDeltaOutputIndex&&n({text:` +`)}`}]});break;default:{let c=s;if(c.type==="tool_search_call")r.push({id:c.call_id,type:"function",function:{name:d9.CUSTOM_TOOL_SEARCH_NAME,arguments:JSON.stringify(c.arguments??{})}});else if(c.type==="tool_search_output"){n();let l=c.tools.map(u=>u.name);e.push({role:Zi.Raw.ChatRole.Tool,content:[{type:Zi.Raw.ChatCompletionContentPartKind.Text,text:JSON.stringify(l)}],toolCallId:c.call_id})}break}}return r.length>0&&e.push({role:Zi.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)}),e}a(FEc,"responseApiInputToRawMessagesForLogging");function UEc(t){return"role"in t&&t.role==="assistant"&&"type"in t&&t.type==="message"&&"content"in t&&Array.isArray(t.content)}a(UEc,"isResponseOutputMessage");function QEc(t){return"role"in t&&t.role==="assistant"&&(!("type"in t)||t.type!=="message")}a(QEc,"isResponseInputItemMessage");function pMr(t){return typeof t=="string"?[{type:"input_text",text:t}]:t}a(pMr,"ensureContentArray");function yCt(t){switch(t.type){case"input_text":return{type:Zi.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"input_image":return{type:Zi.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:t.image_url||"",detail:t.detail==="auto"?void 0:t.detail??void 0}};case"input_file":return{type:Zi.Raw.ChatCompletionContentPartKind.Opaque,value:`[File Input - Filename: ${t.filename||"unknown"}]`}}}a(yCt,"responseContentToRawContent");function qEc(t){switch(t.type){case"output_text":return{type:Zi.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"refusal":return{type:Zi.Raw.ChatCompletionContentPartKind.Text,text:`[Refusal: ${t.refusal}]`}}}a(qEc,"responseOutputToRawContent");function jEc(t){return typeof t=="string"?[{type:Zi.Raw.ChatCompletionContentPartKind.Text,text:t}]:(0,AMr.coalesce)(t.map(yCt))}a(jEc,"responseFunctionOutputToRawContents");function mMr(t){return typeof t=="object"&&t!==null&&"type"in t&&String(t.type)===Qf.openAIContextManagementCompactionType}a(mMr,"isCompactionItem");function HEc(t){return"item"in t&&"output_index"in t&&typeof t.output_index=="number"}a(HEc,"hasOutputItem");function GEc(t){return"response"in t&&Array.isArray(t.response.output)}a(GEc,"hasResponseOutput");function $Ec(t){return t.output_index}a($Ec,"getOutputItemIndex");function gMr(t){return mMr(t)}a(gMr,"isCompactionOutputItem");function t6i(t,e){let r;for(let n=t.length-1;n>=0;n--){let o=t[n];if(gMr(o)){r={item:o,outputIndex:n};break}}if(e!==void 0){let n=t[e];if(n&&gMr(n)&&(!r||e>=r.outputIndex))return{item:n,outputIndex:e}}return r}a(t6i,"getLatestCompactionOutput");function VEc(t,e){let r=t6i(t,e);return r?t.filter((n,o)=>!gMr(n)||o===r.outputIndex):t}a(VEc,"keepLatestCompactionOutput");async function WEc(t,e,r,n,o,s,c,l){return new hEc.AsyncIterableObject(async u=>{let d=n.headers.get("X-Request-ID")??(0,yEc.generateUuid)(),f=n.headers.get("x-github-request-id")??"",{serverExperiments:h}=(0,_Ec.getRequestId)(n.headers),m=t.createInstance(ECt,c,e,d,f,h,l),g=(0,IEc.createResponsesStreamDumper)(d,r),A=new AEc.SSEParser(y=>{try{if(r.trace(`SSE: ${y.data}`),y.data==="[DONE]")return;let E=JSON.parse(y.data),_={type:y.type,...E};g.logEvent(_);let v=m.push(_,s);v&&(r6i(e,r,v,c),u.emitOne(v))}catch(E){u.reject(E)}});for await(let y of n.body)A.feed(y)},async()=>{await n.body.destroy()})}a(WEc,"processResponseFromChatEndpoint");function r6i(t,e,r,n){let o=(0,Qf.rawMessageToCAPI)(r.message),s=n;r.usage&&(s=n.extendedBy({},{promptTokens:r.usage.prompt_tokens,completionTokens:r.usage.completion_tokens,totalTokens:r.usage.total_tokens,...r.usage.prompt_tokens_details&&{cachedTokens:r.usage.prompt_tokens_details.cached_tokens},...r.usage.completion_tokens_details&&{reasoningTokens:r.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:r.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:r.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,hMr.sendEngineMessagesTelemetry)(t,[o],s,!0,e)}a(r6i,"sendCompletionOutputTelemetry");function zEc(t){if(!t)return;let e=t.filter(c=>c.blocked),r=e.find(c=>c.source_type==="completion")??e[0];if(!r)return;let o=r.content_filter_raw?.find(c=>c.action==="BLOCK"&&c.result===!0)?.label?.toLowerCase()??"";if(o.includes("copyright"))return Qf.FilterReason.Copyright;if(o.includes("selfharm")||o.includes("self_harm"))return Qf.FilterReason.SelfHarm;if(o.includes("sexual"))return Qf.FilterReason.Sexual;if(o.includes("violence"))return Qf.FilterReason.Violence;if(o.includes("hate"))return Qf.FilterReason.Hate;let s=r.content_filter_results??{};if(s.hate?.filtered)return Qf.FilterReason.Hate;if(s.self_harm?.filtered)return Qf.FilterReason.SelfHarm;if(s.sexual?.filtered)return Qf.FilterReason.Sexual;if(s.violence?.filtered)return Qf.FilterReason.Violence;if(s.protected_material_text?.filtered||s.protected_material_code?.filtered)return Qf.FilterReason.Copyright;if(r.source_type==="prompt")return Qf.FilterReason.Prompt}a(zEc,"extractFilterReasonFromContentFilters");function J8i(t){if(t)return{code:0,message:t.message??"",metadata:{code:t.code}}}a(J8i,"mapResponsesApiError");var ECt=class{static{a(this,"OpenAIResponsesProcessor")}constructor(e,r,n,o,s,c,l){this.telemetryData=e,this.telemetryService=r,this.requestId=n,this.ghRequestId=o,this.serverExperiments=s,this.compactionThreshold=c,this.logService=l,this.textAccumulator="",this.hasReceivedReasoningSummary=!1,this.sawCompactionMessage=!1,this.toolCallInfo=new Map}getCompactionItemsInChunk(e){let r=[];if(HEc(e)&&mMr(e.item)){let n=$Ec(e);r.push({item:e.item,outputIndex:n})}if(GEc(e))for(let n=0;n{this.textAccumulator+=s.text,r(this.textAccumulator,0,s)},"onProgress"),o=this.getCompactionItemsInChunk(e);if(e.type!=="response.completed")for(let{item:s,outputIndex:c}of o)this.captureCompactionItem(s,c,n);switch(e.type){case"error":return n({text:"",copilotErrors:[{agent:"openai",code:e.code||"unknown",message:e.message,type:"error",identifier:e.param||void 0}]});case"response.output_text.delta":{let s=e;this.lastTextDeltaOutputIndex!==void 0&&s.output_index!==this.lastTextDeltaOutputIndex&&n({text:` -`}),this.lastTextDeltaOutputIndex=s.output_index;let c=new $gc.Lazy(()=>new TextEncoder().encode(s.delta));return n({text:s.delta,logprobs:s.logprobs&&{content:s.logprobs.map(l=>({...sFi(c,l),top_logprobs:l.top_logprobs?.map(u=>sFi(c,u))||[]}))}})}case"response.output_item.added":if(e.item.type==="function_call")this.toolCallInfo.set(e.output_index,{name:e.item.name,callId:e.item.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:e.item.name,id:e.item.call_id}]});else if(e.item.type.toString()==="tool_search_call"){let s=e.item;s.execution==="client"&&s.call_id&&(this.toolCallInfo.set(e.output_index,{name:Z6.CUSTOM_TOOL_SEARCH_NAME,callId:s.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:Z6.CUSTOM_TOOL_SEARCH_NAME,id:s.call_id}]}))}return;case"response.function_call_arguments.delta":{let s=this.toolCallInfo.get(e.output_index);s&&(s.arguments+=e.delta,n({text:"",copilotToolCallStreamUpdates:[{id:s.callId,name:s.name,arguments:s.arguments}]}));return}case"response.output_item.done":if(e.item.type==="function_call")this.toolCallInfo.delete(e.output_index),n({text:"",copilotToolCalls:[{id:e.item.call_id,name:e.item.name,arguments:e.item.arguments}],phase:e.item.phase});else if(e.item.type.toString()==="tool_search_call"){let s=e.item;s.execution==="client"&&s.call_id&&(this.toolCallInfo.delete(e.output_index),n({text:"",copilotToolCalls:[{id:s.call_id,name:Z6.CUSTOM_TOOL_SEARCH_NAME,arguments:JSON.stringify(s.arguments??{})}]}))}else e.item.type==="reasoning"?n({text:"",thinking:e.item.encrypted_content?{id:e.item.id,text:this.hasReceivedReasoningSummary?void 0:e.item.summary.map(s=>s.text),encrypted:e.item.encrypted_content}:void 0}):e.item.type==="message"&&n({text:"",phase:e.item.phase});return;case"response.reasoning_summary_text.delta":return this.hasReceivedReasoningSummary=!0,n({text:"",thinking:{id:e.item_id,text:e.delta}});case"response.reasoning_summary_part.done":return this.hasReceivedReasoningSummary=!0,n({text:"",thinking:{id:e.item_id}});case"response.completed":{let s=e,c=vAc(s.response.output,this.latestCompactionOutputIndex),l=lFi(c,this.latestCompactionOutputIndex),u=l?.item,d=this.latestCompactionItem;u&&(this.sawCompactionMessage=!0,this.latestCompactionOutputIndex=l.outputIndex);let f=u&&(!d||d.id!==u.id||d.encrypted_content!==u.encrypted_content);if(u&&(this.latestCompactionItem=u),this.compactionThreshold!==void 0&&this.sawCompactionMessage){let h=e.response.usage?.input_tokens??0,m=e.response.usage?.total_tokens??0;(0,ENr.sendResponsesApiCompactionTelemetry)(this.telemetryService,{outcome:"compaction_returned",headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,model:e.response.model},{compactThreshold:this.compactionThreshold,promptTokens:h,totalTokens:m}),this.logService.debug(`[responsesAPI_compaction] Compaction enabled. headerRequestId=${this.requestId}`)}else if(this.compactionThreshold!==void 0&&(e.response.usage?.input_tokens??0)>=this.compactionThreshold){let h=e.response.usage?.input_tokens??0,m=e.response.usage?.total_tokens??0;(0,ENr.sendResponsesApiCompactionTelemetry)(this.telemetryService,{outcome:"threshold_met_no_compaction",headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,model:e.response.model},{compactThreshold:this.compactionThreshold,promptTokens:h,totalTokens:m}),this.logService.debug(`[responsesAPI_compaction] Compaction enabled but context not compacted after threshold was met. headerRequestId=${this.requestId}, gitHubRequestId=${this.ghRequestId}, promptTokens=${h}, totalTokens=${m}`)}return n({text:"",statefulMarker:e.response.id,contextManagement:f?u:void 0}),{blockFinished:!0,choiceIndex:0,model:e.response.model,tokens:[],telemetryData:this.telemetryData,requestId:{headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,completionId:e.response.id,created:e.response.created_at,deploymentId:"",serverExperiments:this.serverExperiments},usage:{prompt_tokens:e.response.usage?.input_tokens??0,completion_tokens:e.response.usage?.output_tokens??0,total_tokens:e.response.usage?.total_tokens??0,prompt_tokens_details:{cached_tokens:e.response.usage?.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.response.usage?.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0},copilot_usage:s.copilot_usage?.total_nano_aiu!==void 0?s.copilot_usage:void 0},finishReason:Of.FinishedCompletionReason.Stop,message:{role:Xi.Raw.ChatRole.Assistant,content:c.map(h=>{if(h.type==="message")return{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:h.content.map(m=>m.type==="output_text"?m.text:m.refusal).join("")};if(h.type==="image_generation_call"&&h.result)return{type:Xi.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:h.result}}}).filter(bL.isDefined)}}}case"response.incomplete":{let s=e.response,c=s.incomplete_details?.reason,l,u;return c==="max_output_tokens"?l=Of.FinishedCompletionReason.Length:c==="content_filter"?(l=Of.FinishedCompletionReason.ContentFilter,u=bAc(s.content_filters)):l=Of.FinishedCompletionReason.ServerError,this.buildTerminalCompletion(s,l,{filterReason:u,error:oFi(s.error)})}case"response.failed":{let s=e.response;return this.buildTerminalCompletion(s,Of.FinishedCompletionReason.ServerError,{error:oFi(s.error)})}}}buildTerminalCompletion(e,r,n={}){let o=e.output??[];return{blockFinished:!0,choiceIndex:0,model:e.model,tokens:[],telemetryData:this.telemetryData,requestId:{headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,completionId:e.id,created:e.created_at,deploymentId:"",serverExperiments:this.serverExperiments},usage:e.usage?{prompt_tokens:e.usage.input_tokens??0,completion_tokens:e.usage.output_tokens??0,total_tokens:e.usage.total_tokens??0,prompt_tokens_details:{cached_tokens:e.usage.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.usage.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0}}:void 0,finishReason:r,filterReason:n.filterReason,error:n.error,message:{role:Xi.Raw.ChatRole.Assistant,content:o.map(s=>{if(s.type==="message")return{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:s.content.map(c=>c.type==="output_text"?c.text:c.refusal).join("")};if(s.type==="image_generation_call"&&s.result)return{type:Xi.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:s.result}}}).filter(bL.isDefined)}}}};Uv.OpenAIResponsesProcessor=Wvt;Uv.OpenAIResponsesProcessor=Wvt=qgc([jgc(6,zgc.ILogService)],Wvt);function sFi(t,e){let r=[];if(e.token){let n=new TextEncoder().encode(e.token),o=t.value,s=(0,Ggc.binaryIndexOf)(o,n);s!==-1&&(r=[s,s+n.length])}return{token:e.token,bytes:r,logprob:e.logprob}}a(sFi,"mapLogProp")});var dFi=I(Yvt=>{"use strict";p();Object.defineProperty(Yvt,"__esModule",{value:!0});Yvt.ChatWebSocketTelemetrySender=void 0;var SNr=class{static{a(this,"ChatWebSocketTelemetrySender")}static sendConnectedTelemetry(e,r){e.sendTelemetryEvent("websocket.connected",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId},{connectDurationMs:r.connectDurationMs})}static sendConnectErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.connectError",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId,error:r.error,responseStatusText:r.responseStatusText,networkError:r.networkError},{connectDurationMs:r.connectDurationMs,responseStatusCode:r.responseStatusCode})}static sendCloseTelemetry(e,r){e.sendTelemetryEvent("websocket.close",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,closeReason:r.closeReason,closeEventReason:r.closeEventReason,closeEventWasClean:r.closeEventWasClean},{hadActiveRequest:r.hadActiveRequest?1:0,closeCode:r.closeCode,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.error",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,error:r.error},{hadActiveRequest:r.hadActiveRequest?1:0,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendCloseDuringSetupTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.closeDuringSetup",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId,closeReason:r.closeReason,closeEventReason:r.closeEventReason,closeEventWasClean:r.closeEventWasClean},{closeCode:r.closeCode,connectDurationMs:r.connectDurationMs})}static sendRequestSentTelemetry(e,r){e.sendTelemetryEvent("websocket.requestSent",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId},{hadActiveRequest:r.hadActiveRequest?1:0,statefulMarkerMatched:r.statefulMarkerMatched?1:0,previousResponseIdUnset:r.previousResponseIdUnset?1:0,hasCompactionData:r.hasCompactionData?1:0,summarizedAtRoundIdSet:r.summarizedAtRoundIdSet?1:0,summarizedAtRoundIdMatched:r.summarizedAtRoundIdMatched?1:0,modeChanged:r.modeChanged===void 0?-1:r.modeChanged?1:0,compactionThreshold:r.compactionThreshold,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,sentMessageCharacters:r.sentMessageCharacters,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendMessageParseErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.messageParseError",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,error:r.error},{hadActiveRequest:r.hadActiveRequest?1:0,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,receivedMessageCharacters:r.receivedMessageCharacters,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendRequestOutcomeTelemetry(e,r){e.sendTelemetryEvent("websocket.requestOutcome",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,requestOutcome:r.requestOutcome,closeReason:r.closeReason,serverErrorMessage:r.serverErrorMessage,serverErrorCode:r.serverErrorCode},{hadActiveRequest:r.hadActiveRequest?1:0,statefulMarkerMatched:r.statefulMarkerMatched?1:0,previousResponseIdUnset:r.previousResponseIdUnset?1:0,hasCompactionData:r.hasCompactionData?1:0,summarizedAtRoundIdSet:r.summarizedAtRoundIdSet?1:0,summarizedAtRoundIdMatched:r.summarizedAtRoundIdMatched?1:0,modeChanged:r.modeChanged===void 0?-1:r.modeChanged?1:0,compactionThreshold:r.compactionThreshold,promptTokenCount:r.promptTokenCount,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,requestSentMessageCount:r.requestSentMessageCount,requestReceivedMessageCount:r.requestReceivedMessageCount,requestSentCharacters:r.requestSentCharacters,requestReceivedCharacters:r.requestReceivedCharacters,connectionDurationMs:r.connectionDurationMs,requestDurationMs:r.requestDurationMs,closeCode:r.closeCode})}};Yvt.ChatWebSocketTelemetrySender=SNr});var X6=I(E1=>{"use strict";p();var SAc=E1&&E1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Kvt=E1&&E1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(E1,"__esModule",{value:!0});E1.ChatWebSocketManager=E1.NullChatWebSocketManager=E1.IChatWebSocketManager=void 0;E1.isCAPIWebSocketError=RNr;var TAc=nn(),IAc=Rs(),Jvt=Ic(),fFi=Ro(),pFi=Pl(),xAc=$E(),wye=Sp(),wAc=gm(),RAc=_y(),kAc=zvt(),z$=dFi();E1.IChatWebSocketManager=(0,TAc.createServiceIdentifier)("IChatWebSocketManager");var TNr=class{static{a(this,"NullChatWebSocketManager")}getOrCreateConnection(e,r,n){throw new Error("WebSocket not available")}hasActiveConnection(e){return!1}getStatefulMarker(e){}getSummarizedAtRoundId(e){}closeConnection(e){}closeAll(){}};E1.NullChatWebSocketManager=TNr;function RNr(t){return t.type==="error"&&"error"in t&&typeof t.error?.code=="string"}a(RNr,"isCAPIWebSocketError");var PAc={"response.completed":"completed","response.failed":"response_failed","response.incomplete":"response_incomplete","response.cancelled":"response_cancelled",error:"upstream_error"};function DAc(t){return PAc[t.type]}a(DAc,"getStreamTerminatingOutcome");var INr=class extends fFi.Disposable{static{a(this,"ChatWebSocketManager")}constructor(e,r,n,o){super(),this._logService=e,this._capiClientService=r,this._telemetryService=n,this._configurationService=o,this._connections=new Map}getOrCreateConnection(e,r,n){let o=this._connections.get(e);if(o?.isOpen)return o;o&&(this._logService.debug(`[ChatWebSocketManager] Replacing closed connection for conversation ${e}`),o.dispose(),this._connections.delete(e));let s=new xNr(this._capiClientService,this._logService,this._telemetryService,this._configurationService,e,r,n);return this._logService.debug(`[ChatWebSocketManager] Creating new connection for conversation ${e}`),this._connections.set(e,s),s.onDidDispose(()=>{this._connections.get(e)===s&&this._connections.delete(e)}),s}hasActiveConnection(e){return!!this._connections.get(e)?.isOpen}getStatefulMarker(e){let r=this._connections.get(e);return r?.isOpen?r.statefulMarker:void 0}getSummarizedAtRoundId(e){let r=this._connections.get(e);return r?.isOpen?r.summarizedAtRoundId:void 0}closeConnection(e){let r=this._connections.get(e);r&&(r.hasActiveRequest?this._logService.warn(`[ChatWebSocketManager] Closing connection for conversation ${e} while turn ${r.turnId} still has an active request`):this._logService.debug(`[ChatWebSocketManager] Closing connection for conversation ${e}`),r.dispose(),this._connections.delete(e))}closeAll(){for(let e of this._connections.values())e.dispose();this._connections.clear()}dispose(){this.closeAll(),super.dispose()}};E1.ChatWebSocketManager=INr;E1.ChatWebSocketManager=INr=SAc([Kvt(0,wye.ILogService),Kvt(1,xAc.ICAPIClientService),Kvt(2,wAc.ITelemetryService),Kvt(3,pFi.IConfigurationService)],INr);function Zvt(t){switch(t){case 1e3:return"Normal Closure";case 1001:return"Going Away";case 1002:return"Protocol Error";case 1003:return"Unsupported Data";case 1005:return"No Status Received";case 1006:return"Abnormal Closure";case 1007:return"Invalid Payload";case 1008:return"Policy Violation";case 1009:return"Message Too Big";case 1010:return"Missing Extension";case 1011:return"Internal Error";case 1012:return"Service Restart";case 1013:return"Try Again Later";case 1014:return"Bad Gateway";case 1015:return"TLS Handshake Failed";default:return"Unknown"}}a(Zvt,"wsCloseCodeToString");var xNr=class extends fFi.Disposable{static{a(this,"ChatWebSocketConnection")}constructor(e,r,n,o,s,c,l){super(),this._capiClientService=e,this._logService=r,this._telemetryService=n,this._configurationService=o,this._conversationId=s,this._headers=c,this._initiatingRequestId=l,this._state=2,this._onDidDispose=this._register(new Jvt.Emitter),this.onDidDispose=this._onDidDispose.event,this._totalSentMessageCount=0,this._totalReceivedMessageCount=0,this._totalSentCharacters=0,this._totalReceivedCharacters=0,this._responseHeaders=new RAc.HeadersImpl({}),this._hadActiveRequest=!1}get isOpen(){return this._state===1&&!!this._ws}get hasActiveRequest(){return!!this._activeRequest}get turnId(){return this._turnId}get statefulMarker(){return this._statefulMarker}get summarizedAtRoundId(){return this._summarizedAtRoundId}get responseHeaders(){return this._responseHeaders}get responseStatusCode(){return this._responseStatusCode}get responseStatusText(){return this._responseStatusText}get gitHubRequestId(){return this._responseHeaders.get("x-github-request-id")||""}async connect(){if(this._state===1)return;this._state=0,this._connectStartTime=Date.now(),this._logService.debug(`[ChatWebSocketManager] Connecting WebSocket for conversation ${this._conversationId}`);let e=await this._capiClientService.createResponsesWebSocket({headers:this._headers});return new Promise((r,n)=>{let o=e.webSocket,s=a(()=>{u(),this._state=1,this._connectedTime=Date.now(),this._ws=o,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText,this._setupMessageHandlers(o);let d=this._connectedTime-(this._connectStartTime??this._connectedTime);this._logService.debug(`[ChatWebSocketManager] Connected for conversation ${this._conversationId}`),z$.ChatWebSocketTelemetrySender.sendConnectedTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,connectDurationMs:d}),r()},"onOpen"),c=a(d=>{u(),this._state=2,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText;let f=d.error?`${d.message}: ${(0,wye.collectSingleLineErrorMessage)(d.error)}`:d.message||"WebSocket error",h=d.error?.cause??e.networkError,m=h?(0,wye.collectSingleLineErrorMessage)(h):void 0,g=Date.now()-(this._connectStartTime??Date.now());this._logService.error(`[ChatWebSocketManager] Connection error for conversation ${this._conversationId}: ${f}${m?` (cause: ${m})`:""}`),z$.ChatWebSocketTelemetrySender.sendConnectErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,error:f,connectDurationMs:g,responseStatusCode:this._responseStatusCode,responseStatusText:this._responseStatusText,networkError:m}),n(new Error(f))},"onError"),l=a(d=>{u(),this._state=2,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText;let f=Date.now()-(this._connectStartTime??Date.now()),h=Zvt(d.code);this._logService.debug(`[ChatWebSocketManager] Connection closed during setup for conversation ${this._conversationId} (code: ${d.code} ${h}, reason: ${d.reason||""}, wasClean: ${d.wasClean})`),z$.ChatWebSocketTelemetrySender.sendCloseDuringSetupTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,closeCode:d.code,closeReason:h,closeEventReason:d.reason,closeEventWasClean:String(d.wasClean),connectDurationMs:f}),n(new Error("WebSocket closed during connection setup"))},"onClose"),u=a(()=>{o.removeEventListener("open",s),o.removeEventListener("error",c),o.removeEventListener("close",l)},"cleanup");o.addEventListener("open",s),o.addEventListener("error",c),o.addEventListener("close",l)})}_setupMessageHandlers(e){e.addEventListener("message",r=>{if(typeof r.data!="string")return;let n=r.data.length;this._totalReceivedMessageCount+=1,this._totalReceivedCharacters+=n;let o=Date.now()-(this._connectedTime??Date.now()),s;try{s=JSON.parse(r.data)}catch(c){let l=(0,wye.collectSingleLineErrorMessage)(c)||"Failed to parse websocket message";this._logService.error(`[ChatWebSocketManager] Failed to parse message for conversation ${this._conversationId} turn ${this._turnId}: ${l}`),z$.ChatWebSocketTelemetrySender.sendMessageParseErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,error:l,connectionDurationMs:o,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,receivedMessageCharacters:n,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters});return}!RNr(s)&&s.type==="response.completed"&&(this._statefulMarker=s.response.id,this._summarizedAtRoundId=this._activeRequest?.summarizedAtRoundId),this._activeRequest?.handleEvent(s)}),e.addEventListener("close",r=>{this._state=2;let n=Date.now()-(this._connectedTime??Date.now()),o=Zvt(r.code);this._logService.debug(`[ChatWebSocketManager] Connection closed for conversation ${this._conversationId} turn ${this._turnId} (code: ${r.code} ${o}, reason: ${r.reason||""}, wasClean: ${r.wasClean})`),z$.ChatWebSocketTelemetrySender.sendCloseTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,closeCode:r.code,closeReason:o,closeEventReason:r.reason,closeEventWasClean:String(r.wasClean),connectionDurationMs:n,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters});let s=this._pendingErrorMessage;this._pendingErrorMessage=void 0,this._activeRequest?.handleConnectionClose(r.code,r.reason,s),this._activeRequest=void 0}),e.addEventListener("error",r=>{let n=r.error?`${r.message}: ${(0,wye.collectSingleLineErrorMessage)(r.error)}`:r.message||"WebSocket error",o=Date.now()-(this._connectedTime??Date.now());this._logService.error(`[ChatWebSocketManager] Error for conversation ${this._conversationId} turn ${this._turnId}: ${n}`),z$.ChatWebSocketTelemetrySender.sendErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,error:n,connectionDurationMs:o,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters}),this._pendingErrorMessage??=n})}sendRequest(e,r,n){if(!this._ws||this._state!==1)throw new Error("WebSocket is not connected");let o=this._statefulMarker===e.previous_response_id,s=e.previous_response_id===void 0,c=e.input?.some(O=>O?.type==="compaction")??!1,l=r.summarizedAtRoundId!==void 0,u=r.summarizedAtRoundId===this._summarizedAtRoundId,d=(0,kAc.getResponsesApiCompactionThresholdFromBody)(e),f=this._statefulMarker?.slice(0,5).concat("...")??"",h=e.previous_response_id?.slice(0,5).concat("...")??"";o?this._logService.trace(`[ChatWebSocketManager] WebSocket stateful marker matches previous_response_id (${h}), summarizedAtRoundIdMatched: ${u}`):this._logService.debug(`[ChatWebSocketManager] WebSocket stateful marker (${f}) does not match previous_response_id (${h}), summarizedAtRoundIdMatched: ${u}`);let m=!!this._activeRequest;m?(this._logService.warn(`[ChatWebSocketManager] New request for conversation ${this._conversationId} turn ${r.turnId} while turn ${this._turnId} still has an active request`),this._activeRequest.handleSuperseded()):this._logService.debug(`[ChatWebSocketManager] New request for conversation ${this._conversationId} turn ${r.turnId} (previous turn: ${this._turnId})`);let g=this._turnId,A=r.turnId;this._previousTurnId=g,this._turnId=A,this._hadActiveRequest=m;let y=r.requestId,E=Date.now(),_=this._totalSentMessageCount,v=this._totalReceivedMessageCount,b=this._totalSentCharacters,T=this._totalReceivedCharacters,w=r.countTokens(),R=-1;w.then(O=>{R=O},()=>{R=-2});let x=new wNr(y,r.model,r.summarizedAtRoundId,this._configurationService,this._logService);x.onDidSettle(({outcome:O,closeCode:j,closeReason:Q,serverErrorMessage:U,serverErrorCode:Y})=>{this._activeRequest===x&&(this._activeRequest=void 0);let W=Date.now()-(this._connectedTime??Date.now()),V=Date.now()-E,z=this._totalSentMessageCount-_,ie=this._totalReceivedMessageCount-v,H=this._totalSentCharacters-b,re=this._totalReceivedCharacters-T;z$.ChatWebSocketTelemetrySender.sendRequestOutcomeTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:A,previousTurnId:g,hadActiveRequest:m,requestId:y,gitHubRequestId:this.gitHubRequestId,modelId:r.model,requestOutcome:O,statefulMarkerMatched:o,previousResponseIdUnset:s,hasCompactionData:c,summarizedAtRoundIdSet:l,summarizedAtRoundIdMatched:u,modeChanged:r.modeChanged,compactionThreshold:d,promptTokenCount:R,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,connectionDurationMs:W,requestDurationMs:V,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters,requestSentMessageCount:z,requestReceivedMessageCount:ie,requestSentCharacters:H,requestReceivedCharacters:re,closeCode:j,closeReason:Q,serverErrorMessage:U,serverErrorCode:Y})}),this._activeRequest=x;let P=n.onCancellationRequested(()=>{this._activeRequest===x&&(x.handleCancellation(),this._activeRequest=void 0)});x.done.finally(()=>P.dispose()).catch(()=>{});let{stream:D,...N}=e,L={type:"response.create",...N,initiator:r.userInitiated?"user":"agent"},B=JSON.stringify(L),q=B.length;this._totalSentMessageCount+=1,this._totalSentCharacters+=q;let M=Date.now()-(this._connectedTime??Date.now());return this._logService.debug(`[ChatWebSocketManager] Sending request for conversation ${this._conversationId} turn ${this._turnId} (totalSentMessageCount: ${this._totalSentMessageCount}, sentMessageCharacters: ${q})`),z$.ChatWebSocketTelemetrySender.sendRequestSentTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:A,previousTurnId:g,hadActiveRequest:m,requestId:y,gitHubRequestId:this.gitHubRequestId,modelId:r.model,statefulMarkerMatched:o,previousResponseIdUnset:s,hasCompactionData:c,summarizedAtRoundIdSet:l,summarizedAtRoundIdMatched:u,modeChanged:r.modeChanged,compactionThreshold:d,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,connectionDurationMs:M,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,sentMessageCharacters:q,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters}),this._ws.send(B),x}dispose(){this._activeRequest?.handleConnectionDisposed(),this._activeRequest=void 0,this._ws&&(this._ws.close(),this._ws=void 0),this._state=2,this._onDidDispose.fire(),super.dispose()}},wNr=class{static{a(this,"ChatWebSocketActiveRequest")}constructor(e,r,n,o,s){this.requestId=e,this.modelId=r,this.summarizedAtRoundId=n,this._configurationService=o,this._logService=s,this._onEvent=new Jvt.Emitter,this.onEvent=this._onEvent.event,this._onCAPIError=new Jvt.Emitter,this.onCAPIError=this._onCAPIError.event,this._onError=new Jvt.Emitter,this.onError=this._onError.event,this._firstEventSettled=!1,this._settled=!1,this.done=new Promise((c,l)=>{this._resolve=c,this._reject=l}),this.firstEvent=new Promise((c,l)=>{this._resolveFirstEvent=c,this._rejectFirstEvent=l})}onDidSettle(e){this._onDidSettle=e}handleEvent(e){if(this._settled)return;let r=this._configurationService.getConfig(pFi.ConfigKey.TeamInternal.DebugSimulateWebSocketResponse);if(r)try{e=JSON.parse(r),this._logService.info(`[ChatWebSocketManager] Simulating WebSocket response event: ${r}`)}catch(o){this._logService.error(`[ChatWebSocketManager] Failed to parse simulated WebSocket response: ${(0,wye.collectSingleLineErrorMessage)(o)}`)}if(this._firstEventSettled||(this._firstEventSettled=!0,this._resolveFirstEvent(e)),RNr(e)){this._finalizeCAPIError(e);return}this._onEvent.fire(e);let n=DAc(e);n&&this._finalizeSuccess(n)}handleConnectionClose(e,r,n){if(this._settled)return;let o=n?new Error(`${n} (close code: ${e} ${Zvt(e)}${r?`, reason: ${r}`:""})`):new Error(`WebSocket closed (code: ${e} ${Zvt(e)}${r?`, reason: ${r}`:""})`);this._finalizeError("connection_closed",o,e,r)}handleSuperseded(){this._settled||this._finalizeError("superseded",new Error("Request superseded by new request"))}handleCancellation(){this._settled||this._finalizeError("canceled",new IAc.CancellationError)}handleConnectionDisposed(){this._settled||this._finalizeError("connection_disposed",new Error("Connection disposed"))}_finalizeSuccess(e){this._settled=!0,this._onDidSettle?.({outcome:e}),this._resolve(),this._dispose()}_finalizeCAPIError(e){let{code:r,message:n}=e.error;this._onCAPIError.fire(e),this._settled=!0,this._onDidSettle?.({outcome:"error_response",serverErrorMessage:n,serverErrorCode:r}),this._reject(new Error(`${n} (${r})`)),this._dispose()}_finalizeError(e,r,n,o,s,c){this._firstEventSettled||(this._firstEventSettled=!0,this._rejectFirstEvent(r)),this._onError.fire(r),this._settled=!0,this._onDidSettle?.({outcome:e,closeCode:n,closeReason:o,serverErrorMessage:s,serverErrorCode:c}),this._reject(r),this._dispose()}_dispose(){this._onEvent.dispose(),this._onCAPIError.dispose(),this._onError.dispose()}}});var PNr=I(SL=>{"use strict";p();Object.defineProperty(SL,"__esModule",{value:!0});SL.getImageDimensions=NAc;SL.getImageDimensionsFromBytes=MAc;SL.getPngDimensions=hFi;SL.getGifDimensions=mFi;SL.getJpegDimensions=gFi;SL.getWebPDimensions=_Fi;SL.getMimeType=bFi;SL.extractImageAttributes=BAc;function NAc(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(bFi(e)){case"image/png":return hFi(e);case"image/gif":return mFi(e);case"image/jpeg":case"image/jpg":return gFi(e);case"image/webp":return _Fi(e);default:throw new Error("Unsupported image format")}}a(NAc,"getImageDimensions");function MAc(t,e){switch(OAc(e)){case"image/png":return AFi(t);case"image/gif":return yFi(t);case"image/jpeg":case"image/jpg":return EFi(t);case"image/webp":return vFi(t);default:throw new Error("Unsupported image format")}}a(MAc,"getImageDimensionsFromBytes");function hFi(t){return AFi(Xvt(t.slice(0,50)))}a(hFi,"getPngDimensions");function mFi(t){return yFi(Xvt(t.slice(0,50)))}a(mFi,"getGifDimensions");function gFi(t){return EFi(Xvt(t))}a(gFi,"getJpegDimensions");function AFi(t){if(!CFi(t,0,[137,80,78,71]))throw new Error("Not a valid PNG image.");let e=new DataView(t.buffer,t.byteOffset+16,8);return{width:e.getUint32(0,!1),height:e.getUint32(4,!1)}}a(AFi,"getPngDimensionsFromBytes");function yFi(t){if(!kNr(t,0,"GIF8"))throw new Error("Not a valid GIF image.");let e=new DataView(t.buffer,t.byteOffset+6,4);return{width:e.getUint16(0,!0),height:e.getUint16(2,!0)}}a(yFi,"getGifDimensionsFromBytes");function EFi(t){if(!CFi(t,0,[255,216]))throw new Error("Not a valid JPEG image.");let e=t.length,r=2;for(;r+3=65472&&n<=65474){let s=new DataView(t.buffer,t.byteOffset+r+5,4);return{height:s.getUint16(0,!1),width:s.getUint16(2,!1)}}r+=2+o}throw new Error("JPEG dimensions not found")}a(EFi,"getJpegDimensionsFromBytes");function _Fi(t){return vFi(Xvt(t))}a(_Fi,"getWebPDimensions");function vFi(t){if(!kNr(t,0,"RIFF")||!kNr(t,8,"WEBP"))throw new Error("Not a valid WebP image.");let e=LAc(t,12,4);if(e==="VP8 "){let r=(t[26]|t[27]<<8)&16383,n=(t[28]|t[29]<<8)&16383;return{width:r,height:n}}else if(e==="VP8L"){let r=(t[21]|t[22]<<8)&16383,n=(t[23]|t[24]<<8)&16383;return{width:r,height:n}}else if(e==="VP8X"){let r=((t[24]|t[25]<<8|t[26]<<16)&16777215)+1,n=((t[27]|t[28]<<8|t[29]<<16)&16777215)+1;return{width:r,height:n}}else throw new Error("Unsupported WebP format.")}a(vFi,"getWebPDimensionsFromBytes");function OAc(t){return t?.toLowerCase().split(";")[0].trim()}a(OAc,"normalizeMimeType");function Xvt(t){let e=atob(t);return Uint8Array.from(e,r=>r.codePointAt(0)??0)}a(Xvt,"base64ToBytes");function CFi(t,e,r){for(let n=0;n]+?)>?\)/,n=/{"use strict";p();Object.defineProperty(eCt,"__esModule",{value:!0});eCt.TokenizerType=void 0;var SFi;(function(t){t.CL100K="cl100k_base",t.O200K="o200k_base",t.Llama3="llama3"})(SFi||(eCt.TokenizerType=SFi={}))});var NNr=I(qne=>{"use strict";p();Object.defineProperty(qne,"__esModule",{value:!0});qne.WorkerWithRpcProxy=qne.RcpResponseHandler=void 0;qne.createRpcProxy=TFi;var FAc=require("worker_threads"),tCt=class{static{a(this,"RcpResponseHandler")}constructor(){this.nextId=1,this.handlers=new Map}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};qne.RcpResponseHandler=tCt;function TFi(t){let e={get:a((r,n)=>(typeof n=="string"&&!r[n]&&(r[n]=(...o)=>t(n,o)),r[n]),"get")};return new Proxy(Object.create(null),e)}a(TFi,"createRpcProxy");var DNr=class{static{a(this,"WorkerWithRpcProxy")}constructor(e,r,n){this.responseHandler=new tCt,this.worker=new FAc.Worker(e,r),this.worker.on("message",async o=>{if("fn"in o)try{let s=await n?.[o.fn].apply(n,o.args);this.worker.postMessage({id:o.id,res:s})}catch(s){this.worker.postMessage({id:o.id,err:s})}else this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=TFi((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}terminate(){this.worker.removeAllListeners(),this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};qne.WorkerWithRpcProxy=DNr});var IFi=I($R=>{"use strict";p();Object.defineProperty($R,"__esModule",{value:!0});$R.SlidingWindowAverage=$R.MovingAverage=$R.Counter=void 0;$R.clamp=QAc;$R.rot=qAc;$R.isPointWithinTriangle=jAc;$R.randomChance=HAc;var UAc=rd();function QAc(t,e,r){return Math.min(Math.max(t,e),r)}a(QAc,"clamp");function qAc(t,e){return(e+t%e)%e}a(qAc,"rot");var MNr=class{static{a(this,"Counter")}constructor(){this._next=0}getNext(){return this._next++}};$R.Counter=MNr;var ONr=class{static{a(this,"MovingAverage")}constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}};$R.MovingAverage=ONr;var LNr=class{static{a(this,"SlidingWindowAverage")}constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){let r=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=r,this._sum+=e,this._n=0&&w>=0&&T+w<1}a(jAc,"isPointWithinTriangle");function HAc(t){return(0,UAc.assert)(t>=0&&t<=1,"p must be between 0 and 1"),Math.random(){"use strict";p();Object.defineProperty(nCt,"__esModule",{value:!0});nCt.TikTokenImpl=void 0;var BNr=iTr(),rCt=IFi(),GAc=FO(),$Ac=cTr(),FNr=class t{static{a(this,"TikTokenImpl")}constructor(){this._values=[],this._stats={encodeDuration:new rCt.MovingAverage,textLength:new rCt.MovingAverage,callCount:0}}static get instance(){return this._instance||(this._instance=new t),this._instance}init(e,r,n){let o=this._values.length,s=n?$Ac.parseTikTokenBinary:c=>c;return this._values.push((0,BNr.createTokenizer)(s(e),(0,BNr.getSpecialTokensByEncoder)(r),(0,BNr.getRegexByEncoder)(r),64e3)),o}encode(e,r,n){let o=GAc.StopWatch.create(!0),s=this._values[e].encode(r,n);return this._stats.callCount+=1,this._stats.encodeDuration.update(o.elapsed()),this._stats.textLength.update(r.length),s}destroy(e){this._values[e]=void 0}resetStats(){let e=this._stats,r={callCount:e.callCount,encodeDuration:e.encodeDuration.value,textLength:e.textLength.value};return this._stats.encodeDuration=new rCt.MovingAverage,this._stats.textLength=new rCt.MovingAverage,this._stats.callCount=0,r}};nCt.TikTokenImpl=FNr});var K$=I(Rp=>{"use strict";p();var kFi=Rp&&Rp.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},PFi=Rp&&Rp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Rp,"__esModule",{value:!0});Rp.TokenizerProvider=Rp.BaseTokensPerName=Rp.BaseTokensPerMessage=Rp.BaseTokensPerCompletion=Rp.ITokenizerProvider=void 0;Rp.calculateImageTokenCost=jNr;Rp.estimateDocumentTokenCost=NFi;var Y$=Io(),VAc=hDr(),WAc=PNr(),zAc=nn(),wFi=Qne(),YAc=NNr(),KAc=rd(),RFi=eF(),UNr=Ro(),iCt=NA(),DFi=gm(),QNr=xFi();Rp.ITokenizerProvider=(0,zAc.createServiceIdentifier)("ITokenizerProvider");Rp.BaseTokensPerCompletion=3;Rp.BaseTokensPerMessage=3;Rp.BaseTokensPerName=1;var qNr=class{static{a(this,"TokenizerProvider")}constructor(e,r){this._cl100kTokenizer=new RFi.Lazy(()=>new oCt(e,(0,iCt.join)(__dirname,"./cl100k_base.tiktoken"),"cl100k_base",r)),this._o200kTokenizer=new RFi.Lazy(()=>new oCt(e,(0,iCt.join)(__dirname,"./o200k_base.tiktoken"),"o200k_base",r))}dispose(){this._cl100kTokenizer.rawValue?.dispose(),this._o200kTokenizer.rawValue?.dispose()}acquireTokenizer(e){switch(e.tokenizer){case wFi.TokenizerType.CL100K:return this._cl100kTokenizer.value;case wFi.TokenizerType.O200K:return this._o200kTokenizer.value;default:throw new Error(`Unknown tokenizer: ${e.tokenizer}`)}}};Rp.TokenizerProvider=qNr;Rp.TokenizerProvider=qNr=kFi([PFi(1,DFi.ITelemetryService)],qNr);var oCt=class extends UNr.Disposable{static{a(this,"BPETokenizer")}constructor(e,r,n,o){super(),this._useWorker=e,this._tokenFilePath=r,this._encoderName=n,this._telemetryService=o,this._cache=new VAc.LRUCache(5e3),this.baseTokensPerMessage=Rp.BaseTokensPerMessage,this.baseTokensPerName=Rp.BaseTokensPerName,this.mode=Y$.OutputMode.Raw}async countMessagesTokens(e){let r=Rp.BaseTokensPerMessage;for(let n of e)r+=await this.countMessageTokens(n);return r}async tokenize(e){return(await this.ensureTokenizer()).encode(e)}async tokenLength(e){if(typeof e=="string")return this._textTokenLength(e);switch(e.type){case Y$.Raw.ChatCompletionContentPartKind.Text:return this._textTokenLength(e.text);case Y$.Raw.ChatCompletionContentPartKind.Opaque:return e.tokenUsage||0;case Y$.Raw.ChatCompletionContentPartKind.Image:if(e.imageUrl.url.startsWith("data:image/"))try{return jNr(e.imageUrl.url,e.imageUrl.detail)}catch{return this._textTokenLength(e.imageUrl.url)}return this._textTokenLength(e.imageUrl.url);case Y$.Raw.ChatCompletionContentPartKind.CacheBreakpoint:return 0;case Y$.Raw.ChatCompletionContentPartKind.Document:return NFi(e.documentData.data);default:(0,KAc.assertNever)(e,`unknown content part (${JSON.stringify(e)})`)}}async _textTokenLength(e){if(!e)return 0;let r=this._cache.get(e);return r||(r=(await this.tokenize(e)).length,this._cache.put(e,r)),r}async countMessageTokens(e){return this.baseTokensPerMessage+await this.countMessageObjectTokens((0,Y$.toMode)(Y$.OutputMode.OpenAI,e))}async countToolTokens(e){let n=0;e.length&&(n+=16);let o=8;for(let s of e)n+=o,n+=await this.countObjectTokens({name:s.name,description:s.description,parameters:s.inputSchema});return Math.floor(n*1.1)}async countMessageObjectTokens(e){let r=0;for(let[n,o]of Object.entries(e))if(o){if(typeof o=="string")r+=await this.tokenLength(o);else if(o){let s=o;if(s.type==="text")r+=await this.tokenLength(s.text);else if(s.type==="image_url"&&s.image_url)if(s.image_url.url.startsWith("data:image/"))try{r+=jNr(s.image_url.url,s.image_url.detail)}catch{r+=await this.tokenLength(s.image_url.url)}else r+=await this.tokenLength(s.image_url.url);else{let c=await this.countMessageObjectTokens(o);n==="tool_calls"&&(c=Math.floor(c*1.5)),r+=c}}n==="name"&&o!==void 0&&(r+=this.baseTokensPerName)}return r}async countObjectTokens(e){let r=0;for(let[n,o]of Object.entries(e))o&&(r+=await this.tokenLength(n),typeof o=="string"?r+=await this.tokenLength(o):o&&(r+=await this.countMessageObjectTokens(o)));return r}ensureTokenizer(){return this._tokenizer??=this.doInitTokenizer(),this._tokenizer}async doInitTokenizer(){let e=(0,iCt.basename)(__dirname)==="dist";if(this._useWorker){let r=(0,iCt.join)(__dirname,"tikTokenizerWorker.js"),n=new YAc.WorkerWithRpcProxy(r,{name:`TikToken worker (${this._encoderName})`}),o=await n.proxy.init(this._tokenFilePath,this._encoderName,e),s=(0,UNr.toDisposable)(()=>{n.terminate(),this._store.deleteAndLeak(s),this._tokenizer=void 0}),c;return{encode:a((l,u)=>{let d=n.proxy.encode(o,l,u);return clearTimeout(c),c=setTimeout(()=>s.dispose(),15e3),Math.random()<1/1e3&&n.proxy.resetStats().then(f=>{this._telemetryService.sendMSFTTelemetryEvent("tokenizer.stats",void 0,f)}),d},"encode")}}else{let r=QNr.TikTokenImpl.instance.init(this._tokenFilePath,this._encoderName,e),n=(0,UNr.toDisposable)(()=>{QNr.TikTokenImpl.instance.destroy(r),this._store.deleteAndLeak(n),this._tokenizer=void 0});return this._store.add(n),{encode:a(async(o,s)=>QNr.TikTokenImpl.instance.encode(r,o,s),"encode")}}}};oCt=kFi([PFi(3,DFi.ITelemetryService)],oCt);function jNr(t,e){let{width:r,height:n}=(0,WAc.getImageDimensions)(t);if(e==="low")return 85;if(r>2048||n>2048){let c=2048/Math.max(r,n);r=Math.round(r*c),n=Math.round(n*c)}let o=768/Math.min(r,n);return r=Math.round(r*o),n=Math.round(n*o),Math.ceil(r/512)*Math.ceil(n/512)*170+85}a(jNr,"calculateImageTokenCost");function NFi(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(NFi,"estimateDocumentTokenCost")});var J$=I(sCt=>{"use strict";p();Object.defineProperty(sCt,"__esModule",{value:!0});sCt.IDomainService=void 0;var JAc=nn();sCt.IDomainService=(0,JAc.createServiceIdentifier)("IDomainService")});var aCt=I(Qv=>{"use strict";p();Object.defineProperty(Qv,"__esModule",{value:!0});Qv.HeaderContributors=Qv.IHeaderContributors=Qv.userAgentLibraryHeader=void 0;Qv.stringifyUrlOrRequestMetadata=syc;Qv.isCAPIRequestMetadata=GNr;Qv.isCAPIEndpoint=ayc;Qv.createCapiRequestBody=cyc;Qv.canRetryOnceNetworkError=OFi;Qv.postRequest=lyc;Qv.getRequest=uyc;var ZAc=nn(),XAc=Qne(),eyc=Rs(),tyc=$E(),ryc=gm(),nyc=_y(),iyc=H6();Qv.userAgentLibraryHeader="X-VSCode-User-Agent-Library-Version";var oyc=30*1e3;function syc(t){return typeof t=="string"?t:JSON.stringify(t)}a(syc,"stringifyUrlOrRequestMetadata");function GNr(t){return typeof t!="string"}a(GNr,"isCAPIRequestMetadata");function ayc(t){return GNr(t.urlOrRequestMetadata)}a(ayc,"isCAPIEndpoint");function cyc(t,e,r){let n={messages:(0,iyc.rawMessageToCAPI)(t.messages,r),model:e};return t.postOptions&&Object.assign(n,t.postOptions),n}a(cyc,"createCapiRequestBody");function MFi(t,e){let r=t.get(nyc.IFetcherService),n=t.get(ryc.ITelemetryService),o=t.get(tyc.ICAPIClientService),{requestType:s,endpointOrUrl:c,secretKey:l,intent:u,requestId:d,body:f,additionalHeaders:h,cancelToken:m,useFetcher:g,canRetryOnce:A=!0,location:y}=e,E=typeof c=="string"||"type"in c?{modelMaxPromptTokens:0,urlOrRequestMetadata:c,family:"",tokenizer:XAc.TokenizerType.O200K,acquireTokenizer:a(()=>{throw new Error("Method not implemented.")},"acquireTokenizer"),name:"",version:""}:c,_=e.interactionTypeOverride??u,v={...l?{Authorization:`Bearer ${l}`}:{},"X-Request-Id":d,"OpenAI-Intent":u,"X-GitHub-Api-Version":"2026-01-09",...h,...E.getExtraHeaders?E.getExtraHeaders(y,e.interactionTypeOverride):{}};v["X-Interaction-Type"]=_,v["X-Agent-Task-Id"]=d,E.interceptBody&&E.interceptBody(f);let b=E.getEndpointFetchOptions?.(),T={callSite:`network-request-${u}`,method:s,headers:v,json:f,timeout:oyc,useFetcher:g,suppressIntegrationId:b?.suppressIntegrationId};if(m){let w=r.makeAbortController();m.onCancellationRequested(()=>{n.sendGHTelemetryEvent("networking.cancelRequest",{headerRequestId:d}),w.abort()}),T.signal=w.signal}return GNr(E.urlOrRequestMetadata)?o.makeRequest(T,E.urlOrRequestMetadata):r.fetch(E.urlOrRequestMetadata,T).catch(R=>{if(A&&OFi(R))return n.sendGHTelemetryEvent("networking.disconnectAll"),r.disconnectAll().then(()=>r.fetch(E.urlOrRequestMetadata,T));throw r.isAbortError(R)?new eyc.CancellationError:R})}a(MFi,"networkRequest");function OFi(t){return["ECONNRESET","ETIMEDOUT","ERR_CONNECTION_RESET","ERR_NETWORK_CHANGED","ERR_HTTP2_INVALID_SESSION","ERR_HTTP2_STREAM_CANCEL","ERR_HTTP2_GOAWAY_SESSION","ERR_HTTP2_PROTOCOL_ERROR","ERR_FAILED"].includes(t?.code)}a(OFi,"canRetryOnceNetworkError");function lyc(t,e){return MFi(t,{...e,requestType:"POST"})}a(lyc,"postRequest");function uyc(t,e){return MFi(t,{...e,requestType:"GET"})}a(uyc,"getRequest");Qv.IHeaderContributors=(0,ZAc.createServiceIdentifier)("headerContributors");var HNr=class{static{a(this,"HeaderContributors")}constructor(){this.contributors=[]}add(e){this.contributors.push(e)}remove(e){let r=this.contributors.indexOf(e);r!==-1&&this.contributors.splice(r,1)}contributeHeaders(e){for(let r of this.contributors)r.contributeHeaderValues(e)}size(){return this.contributors.length}};Qv.HeaderContributors=HNr});var qFi=I(JE=>{"use strict";p();var dyc=JE&&JE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fyc=JE&&JE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pyc=JE&&JE.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=1e6){let e=t/1e6,r=Math.floor(e*10)/10;return r%1===0?`${r.toFixed(0)}M`:`${r.toFixed(1)}M`}else{if(t>9e5)return"1M";if(t>=1e3)return`${Math.round(t/1e3)}K`}return t.toString()}a(gyc,"formatTokenCount");function Ayc(t){return ml.t("In: {0} \xB7 Out: {1} AICs/1M tokens",LFi(t.default.inputPrice),LFi(t.default.outputPrice))}a(Ayc,"formatPricingLabel");var BFi=1e6;function yyc(t){if(!t)return;let e=t.batch_size??BFi,r=BFi/e,n=t.default;if(n&&n.input_price!==void 0&&n.output_price!==void 0){let o={inputPrice:n.input_price*r,outputPrice:n.output_price*r,cachePrice:n.cache_price!==void 0?n.cache_price*r:void 0,cacheWritePrice:n.cache_write_price!==void 0?n.cache_write_price*r:void 0,contextMax:n.context_max},s,c=t.long_context;if(c&&c.input_price!==void 0&&c.output_price!==void 0){let l={inputPrice:c.input_price*r,outputPrice:c.output_price*r,cachePrice:c.cache_price!==void 0?c.cache_price*r:void 0,cacheWritePrice:c.cache_write_price!==void 0?c.cache_write_price*r:void 0,contextMax:c.context_max};(l.inputPrice!==o.inputPrice||l.outputPrice!==o.outputPrice||l.cachePrice!==o.cachePrice||l.cacheWritePrice!==o.cacheWritePrice)&&(s=l)}return{default:o,longContext:s}}}a(yyc,"normalizeTokenPrices")});var r8i=I(by=>{"use strict";p();var Eyc=by&&by.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},jFi=by&&by.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(by,"__esModule",{value:!0});by.AnthropicMessagesProcessor=void 0;by.buildToolInputSchema=YFi;by.createMessagesRequestBody=Syc;by.rawMessagesToMessagesAPI=KFi;by.clearAllCacheControl=JFi;by.addToolsAndSystemCacheControl=ZFi;by.addMessagesApiCacheControl=XFi;by.processResponseFromMessagesEndpoint=xyc;by.processNonStreamingResponseFromMessagesEndpoint=t8i;var cN=Io(),GFi=nl(),_yc=$Dr(),$Nr=T0(),vyc=jR(),HFi=Pl(),$Fi=Sp(),Rye=Ovt(),VFi=$6(),mBe=H6(),Cyc=ZDr(),WFi=fBe(),byc=mh(),zFi=gm();function YFi(t){if(!t)return{type:"object",properties:{}};let{$schema:e,...r}=t;return{type:"object",properties:{},...r}}a(YFi,"buildToolInputSchema");function Syc(t,e,r,n){let o=t.get(HFi.IConfigurationService),s=t.get(byc.IExperimentationService),c=t.get(Cyc.IToolDeferralService),l=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(N=>N.function.name===Rye.CUSTOM_TOOL_SEARCH_NAME),u=[],d=[];if(e.requestOptions?.tools)for(let N of e.requestOptions.tools){if(!N.function.name||N.function.name.length===0)continue;let L=e.modelCapabilities?.enableToolSearch&&l&&!c.isNonDeferredTool(N.function.name),B={name:N.function.name,description:N.function.description||"",input_schema:YFi(N.function.parameters),...L?{defer_loading:!0}:{}};(L?d:u).push(B)}let f=[...u,...d],h=e.modelCapabilities?.reasoningEffort,m;if(e.modelCapabilities?.enableThinking){if(n.supportsAdaptiveThinking)m={type:"adaptive",display:"summarized"};else if(n.maxThinkingBudget&&n.minThinkingBudget){let L=e.postOptions.max_tokens??1024,B=n.minThinkingBudget??1024,q=16e30&&(!N||N.includes(q))&&(A=q)}}let y=e.modelCapabilities?.enableContextEditing&&(0,Rye.isAnthropicContextEditingEnabled)(n,o,s)?(0,Rye.getContextManagementFromConfig)(o,s,g):void 0,E=t.get($Fi.ILogService),_=t.get(zFi.ITelemetryService),v=f.length>0?new Set(f.map(N=>N.name)):void 0,b=KFi(e.messages,l?v:void 0),T=e.interactionTypeOverride==="conversation-subagent",w=(0,Rye.isExtendedCacheTtlEnabled)(n,o,s,e.location,T),R=w?"1h":void 0,P=(0,Rye.isExtendedCacheTtlMessagesEnabled)(w,o,s)?"1h":void 0;JFi(b),XFi(b,P),ZFi(f,b,R);let D=b.messages.at(-1);return D&&D.role==="assistant"&&(E.warn(`[messagesAPI] Trailing assistant message detected \u2014 appending synthetic user message to prevent prefill error. Total messages: ${b.messages.length}`),_.sendMSFTTelemetryEvent("messagesApi.trailingAssistantGuard",{model:r,location:vyc.ChatLocation.toString(e.location)},{messageCount:b.messages.length}),b.messages.push({role:"user",content:[{type:"text",text:"Please continue."}]})),{model:r,...b,stream:e.requestOptions?.stream??!0,tools:f.length>0?f:void 0,max_tokens:e.postOptions.max_tokens,thinking:m,...A?{output_config:{effort:A}}:{},...y?{context_management:y}:{}}}a(Syc,"createMessagesRequestBody");function KFi(t,e){let r=[],n=[],o=new Map;for(let c of t)switch(c.role){case cN.Raw.ChatRole.System:{n.push(...cCt(c.content).filter(l=>l.type==="text"));break}case cN.Raw.ChatRole.User:{let l=cCt(c.content);l.length>0&&r.push({role:"user",content:l});break}case cN.Raw.ChatRole.Assistant:{let l=cCt(c.content);if(c.toolCalls)for(let u of c.toolCalls){let d={};try{d=JSON.parse(u.function.arguments)}catch{}l.push({type:"tool_use",id:u.id,name:u.function.name,input:d}),o.set(u.id,u.function.name)}l.length>0&&r.push({role:"assistant",content:l});break}case cN.Raw.ChatRole.Tool:{if(c.toolCallId){let l=cCt(c.content),u=!1;for(let g of l)gBe(g)&&g.cache_control&&(u=!0,delete g.cache_control);let h=(e&&o.get(c.toolCallId)===Rye.CUSTOM_TOOL_SEARCH_NAME?Tyc(l,e):void 0)??l.filter(g=>(g.type==="text"||g.type==="image"||g.type==="document")&&!(g.type==="text"&&g.text.trim()==="")),m={type:"tool_result",tool_use_id:c.toolCallId,content:h.length>0?h:void 0};u&&(m.cache_control={type:"ephemeral"}),r.push({role:"user",content:[m]})}break}}let s=[];for(let c of r){let l=s[s.length-1];if(l&&l.role===c.role){let u=Array.isArray(l.content)?l.content:[{type:"text",text:l.content}],d=Array.isArray(c.content)?c.content:[{type:"text",text:c.content}];l.content=[...u,...d]}else s.push(c)}return{messages:s,...n.length?{system:n}:{}}}a(KFi,"rawMessagesToMessagesAPI");function Tyc(t,e){if(t.length!==1||t[0].type!=="text")return;let r;try{r=JSON.parse(t[0].text)}catch{return}if(Array.isArray(r))return r.filter(n=>typeof n=="string"&&(!e||e.has(n))).map(n=>({type:"tool_reference",tool_name:n}))}a(Tyc,"tryParseToolReferences");function cCt(t){let e=[],r=!1;for(let n of t){switch(n.type){case cN.Raw.ChatCompletionContentPartKind.Text:n.text.trim()&&e.push({type:"text",text:n.text});break;case cN.Raw.ChatCompletionContentPartKind.Image:{let o=n.imageUrl.url,s=o.match(/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/);s?e.push({type:"image",source:{type:"base64",media_type:s[1],data:s[2]}}):o.startsWith("https://")&&e.push({type:"image",source:{type:"url",url:o}});break}case cN.Raw.ChatCompletionContentPartKind.CacheBreakpoint:{let o=e.at(-1);o&&gBe(o)?o.cache_control={type:"ephemeral"}:r=!0;break}case cN.Raw.ChatCompletionContentPartKind.Document:{n.documentData.mediaType==="application/pdf"&&e.push({type:"document",source:{type:"base64",media_type:"application/pdf",data:n.documentData.data}});break}case cN.Raw.ChatCompletionContentPartKind.Opaque:{if(n.value&&typeof n.value=="object"&&"type"in n.value){let o=n.value;if(o.type==="thinking"&&o.thinking){let s=Array.isArray(o.thinking.text)?o.thinking.text.join(""):o.thinking.text;o.thinking.redacted&&o.thinking.encrypted?e.push({type:"redacted_thinking",data:o.thinking.encrypted}):o.thinking.encrypted&&e.push({type:"thinking",thinking:s||"",signature:o.thinking.encrypted})}}break}}if(r&&e.length>0){let o=e.at(-1);gBe(o)&&(o.cache_control={type:"ephemeral"},r=!1)}}return e}a(cCt,"rawContentToAnthropicContent");function gBe(t){return t.type!=="thinking"&&t.type!=="redacted_thinking"}a(gBe,"contentBlockSupportsCacheControl");function JFi(t){if(t.system)for(let e of t.system)delete e.cache_control;for(let e of t.messages)if(Array.isArray(e.content))for(let r of e.content)typeof r=="object"&&"cache_control"in r&&delete r.cache_control}a(JFi,"clearAllCacheControl");function ZFi(t,e,r){let n=r?{type:"ephemeral",ttl:r}:{type:"ephemeral"};for(let s=t.length-1;s>=0;s--)if(!t[s].defer_loading){t[s].cache_control=n;break}let o=e.system?.at(-1);o&&!o.cache_control&&(o.cache_control=n)}a(ZFi,"addToolsAndSystemCacheControl");function XFi(t,e){let r=t.messages,n=0;for(let o=r.length-1;o>=0&&n<2;o--){let s=r[o];Array.isArray(s.content)&&s.content.some(c=>typeof c=="object"&&gBe(c))&&(Iyc(s,e),n++)}}a(XFi,"addMessagesApiCacheControl");function Iyc(t,e){if(Array.isArray(t.content))for(let r=t.content.length-1;r>=0;r--){let n=t.content[r];if(typeof n=="object"&&gBe(n)){n.cache_control=e?{type:"ephemeral",ttl:e}:{type:"ephemeral"};return}}}a(Iyc,"markLastCacheableBlock");async function xyc(t,e,r,n,o,s){return(n.headers.get("content-type")??"").includes("text/event-stream")?new GFi.AsyncIterableObject(async l=>{let u=n.headers.get("X-Request-ID")??(0,$Nr.generateUuid)(),d=n.headers.get("x-github-request-id")??"",{serverExperiments:f}=(0,VFi.getRequestId)(n.headers),h=t.createInstance(lCt,s,u,d,f),m=new _yc.SSEParser(g=>{try{r.trace(`[messagesAPI]SSE: ${g.data}`);let A=g.data?.trim();if(!A||A==="[DONE]")return;let y=JSON.parse(A),E=y.type??g.type;if(!E)return;let _=h.push({...y,type:E},o);if(_){r.info(`[messagesAPI] message ${_.choiceIndex} returned. finish reason: [${_.finishReason}]`);let v=s.extendedBy({completionChoiceFinishReason:_.finishReason,headerRequestId:_.requestId.headerRequestId});e.sendGHTelemetryEvent("completion.finishReason",v.properties,v.measurements);let b=(0,mBe.rawMessageToCAPI)(_.message),T=s;_.usage&&(T=s.extendedBy({},{promptTokens:_.usage.prompt_tokens,completionTokens:_.usage.completion_tokens,totalTokens:_.usage.total_tokens,..._.usage.prompt_tokens_details&&{cachedTokens:_.usage.prompt_tokens_details.cached_tokens},..._.usage.completion_tokens_details&&{reasoningTokens:_.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:_.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:_.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,WFi.sendEngineMessagesTelemetry)(e,[b],T,!0,r),l.emitOne(_)}}catch(A){l.reject(A)}});for await(let g of n.body)m.feed(g)},async()=>{await n.body.destroy()}):t8i(e,r,n,o,s)}a(xyc,"processResponseFromMessagesEndpoint");function wyc(t){switch(t){case"refusal":return mBe.FinishedCompletionReason.ClientDone;case"max_tokens":case"model_context_window_exceeded":return mBe.FinishedCompletionReason.Length;default:return mBe.FinishedCompletionReason.Stop}}a(wyc,"mapStopReason");function e8i(t,e){let r=t.inputTokens+t.cacheCreationTokens+t.cacheReadTokens;return r0?{toolCalls:t.toolCalls.map(n=>({id:n.id,type:"function",function:{name:n.name,arguments:n.arguments}}))}:{}}}}a(e8i,"buildAnthropicCompletion");async function t8i(t,e,r,n,o){return new GFi.AsyncIterableObject(async s=>{let{headerRequestId:c,serverExperiments:l}=(0,VFi.getRequestId)(r.headers),u=c||(0,$Nr.generateUuid)(),d=r.headers.get("x-github-request-id")??"",f=await r.text(),h;try{h=JSON.parse(f)}catch(T){s.reject(new Error(`Failed to parse non-streaming Anthropic response: ${T instanceof Error?T.message:String(T)}`));return}if(h.type==="error"){s.reject(new Error(`Anthropic API error: ${h.error?.message??"Unknown error"}`));return}let m="",g=[];for(let T of h.content??[])switch(T.type){case"text":m+=T.text;break;case"tool_use":g.push({id:T.id,name:T.name,arguments:JSON.stringify(T.input)});break;case"thinking":case"redacted_thinking":break;default:{let w=T.type;e.warn(`[messagesAPI] non-streaming: unknown content_block type '${w}' for model ${h.model}`),t.sendMSFTTelemetryEvent("messagesApi.unknownContentBlock",{requestId:u,model:h.model,blockType:w});break}}let A={text:m,...g.length>0?{copilotToolCalls:g.map(T=>({id:T.id,name:T.name,arguments:T.arguments}))}:{}};await n(m,0,A),h.stop_reason==="refusal"&&(e.warn(`[messagesAPI] non-streaming: Refusal received for model ${h.model}`),t.sendMSFTTelemetryEvent("messagesApi.refusal",{requestId:u,model:h.model,category:"unknown"}));let y=h.usage,E=e8i({model:h.model,messageId:h.id,stopReason:h.stop_reason,textContent:m,toolCalls:g,inputTokens:y?.input_tokens??0,outputTokens:y?.output_tokens??0,cacheCreationTokens:y?.cache_creation_input_tokens??0,cacheCreation1hTokens:y?.cache_creation?.ephemeral_1h_input_tokens,cacheCreation5mTokens:y?.cache_creation?.ephemeral_5m_input_tokens,cacheReadTokens:y?.cache_read_input_tokens??0,thinkingTokens:y?.output_tokens_details?.thinking_tokens,requestId:u,ghRequestId:d,serverExperiments:l,telemetryData:o},e);e.info(`[messagesAPI] non-streaming message returned. finish reason: [${E.finishReason}]`);let _=o.extendedBy({completionChoiceFinishReason:E.finishReason,headerRequestId:E.requestId.headerRequestId});t.sendGHTelemetryEvent("completion.finishReason",_.properties,_.measurements);let v=(0,mBe.rawMessageToCAPI)(E.message),b=o;E.usage&&(b=o.extendedBy({},{promptTokens:E.usage.prompt_tokens,completionTokens:E.usage.completion_tokens,totalTokens:E.usage.total_tokens,...E.usage.prompt_tokens_details&&{cachedTokens:E.usage.prompt_tokens_details.cached_tokens},...E.usage.completion_tokens_details&&{reasoningTokens:E.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:E.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:E.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,WFi.sendEngineMessagesTelemetry)(t,[v],b,!0,e),s.emitOne(E)},async()=>{await r.body.destroy()})}a(t8i,"processNonStreamingResponseFromMessagesEndpoint");var lCt=class{static{a(this,"AnthropicMessagesProcessor")}constructor(e,r,n,o,s,c){this.telemetryData=e,this.requestId=r,this.ghRequestId=n,this.serverExperiments=o,this.logService=s,this.telemetryService=c,this.textAccumulator="",this.toolCallAccumulator=new Map,this.thinkingAccumulator=new Map,this.completedToolCalls=[],this.messageId="",this.model="",this.inputTokens=0,this.outputTokens=0,this.cacheCreationTokens=0,this.cacheReadTokens=0}extractIPCodeCitations(e){if(!e?.IPCodeCitations?.length)return[];let r=new Set,n=[];for(let o of e.IPCodeCitations){let s=o.citations;if(!s)continue;let{url:c,license:l,snippet:u}=s;typeof c!="string"||c.trim()===""||typeof l!="string"||l.trim()===""||typeof u!="string"||u.trim()===""||r.has(c)||(r.add(c),n.push({citations:{url:c,license:l,snippet:u}}))}return n.length>0&&this.logService.trace(`[messagesAPI] IP code citations found: ${n.length} unique citations`),n}push(e,r){let n=a(o=>{this.textAccumulator+=o.text,r(this.textAccumulator,0,o)},"onProgress");switch(e.type){case"message_start":e.message&&(this.messageId=e.message.id,this.model=e.message.model,this.inputTokens=e.message.usage.input_tokens??0,this.outputTokens=e.message.usage.output_tokens??0,this.cacheCreationTokens=e.message.usage.cache_creation_input_tokens??0,this.cacheCreation1hTokens=e.message.usage.cache_creation?.ephemeral_1h_input_tokens??this.cacheCreation1hTokens,this.cacheCreation5mTokens=e.message.usage.cache_creation?.ephemeral_5m_input_tokens??this.cacheCreation5mTokens,this.cacheReadTokens=e.message.usage.cache_read_input_tokens??0,this.thinkingTokens=e.message.usage.output_tokens_details?.thinking_tokens??this.thinkingTokens);return;case"content_block_start":if(e.content_block?.type==="tool_use"&&e.index!==void 0){let o=e.content_block.id||(0,$Nr.generateUuid)();this.toolCallAccumulator.set(e.index,{id:o,name:e.content_block.name||"",arguments:""}),this.textAccumulator.length&&n({text:" "}),n({text:"",beginToolCalls:[{name:e.content_block.name||"",id:o}]})}else if(e.content_block?.type==="thinking"&&e.index!==void 0)this.thinkingAccumulator.set(e.index,{thinking:"",signature:""});else if(e.content_block?.type==="redacted_thinking"&&e.index!==void 0){let o=e.content_block.data;n({text:"",thinking:{id:`thinking_${e.index}`,encrypted:o,redacted:!0}})}return;case"content_block_delta":if(e.delta){if(e.delta.type==="text_delta"&&e.delta.text){let o=this.extractIPCodeCitations(e.copilot_annotations);return o.length>0?n({text:e.delta.text,ipCitations:o}):n({text:e.delta.text})}else if(e.delta.type==="thinking_delta"&&e.delta.thinking&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);return o&&(o.thinking+=e.delta.thinking),n({text:"",thinking:{id:`thinking_${e.index}`,text:e.delta.thinking}})}else if(e.delta.type==="signature_delta"&&e.delta.signature&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.signature+=e.delta.signature)}else if(e.delta.type==="input_json_delta"&&e.delta.partial_json&&e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(o.arguments+=e.delta.partial_json,n({text:"",copilotToolCallStreamUpdates:[{id:o.id,name:o.name,arguments:o.arguments}]}))}}return;case"content_block_stop":if(e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(this.completedToolCalls.push(o),n({text:"",copilotToolCalls:[{id:o.id,name:o.name,arguments:o.arguments}]}),this.toolCallAccumulator.delete(e.index));let s=this.thinkingAccumulator.get(e.index);s&&s.signature&&(n({text:"",thinking:{id:`thinking_${e.index}`,encrypted:s.signature}}),this.thinkingAccumulator.delete(e.index))}return;case"message_delta":if(e.usage&&(this.outputTokens=e.usage.output_tokens,this.inputTokens=e.usage.input_tokens??this.inputTokens,this.cacheCreationTokens=e.usage.cache_creation_input_tokens??this.cacheCreationTokens,this.cacheCreation1hTokens=e.usage.cache_creation?.ephemeral_1h_input_tokens??this.cacheCreation1hTokens,this.cacheCreation5mTokens=e.usage.cache_creation?.ephemeral_5m_input_tokens??this.cacheCreation5mTokens,this.cacheReadTokens=e.usage.cache_read_input_tokens??this.cacheReadTokens,this.thinkingTokens=e.usage.output_tokens_details?.thinking_tokens??this.thinkingTokens),e.copilot_usage&&typeof e.copilot_usage.total_nano_aiu=="number"&&(this.copilotUsage=e.copilot_usage),e.context_management)return this.contextManagementResponse=e.context_management,n({text:"",contextManagement:e.context_management});e.delta?.stop_reason&&(this.stopReason=e.delta.stop_reason),e.delta?.stop_details&&(this.stopDetails=e.delta.stop_details);return;case"message_stop":{if(this.contextManagementResponse){let o=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_input_tokens||0),0),s=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_tool_uses||0),0),c=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_thinking_turns||0),0);this.logService.trace(`[messagesAPI] Anthropic context editing applied: cleared ${o} tokens, ${s} tool uses.`),this.telemetryService.sendMSFTTelemetryEvent("contextEditingApplied",{requestId:this.requestId,interactionId:this.requestId,model:this.model},{clearedTokens:o,clearedToolUses:s,clearedThinkingTurns:c})}if(this.stopReason==="refusal"){let o=this.stopDetails?.category??"unknown";this.logService.warn(`[messagesAPI] Refusal received: category='${o}' for model ${this.model}`),this.telemetryService.sendMSFTTelemetryEvent("messagesApi.refusal",{requestId:this.requestId,model:this.model,category:o})}return e8i({model:this.model,messageId:this.messageId,stopReason:this.stopReason,textContent:this.textAccumulator,toolCalls:this.completedToolCalls,inputTokens:this.inputTokens,outputTokens:this.outputTokens,cacheCreationTokens:this.cacheCreationTokens,cacheCreation1hTokens:this.cacheCreation1hTokens,cacheCreation5mTokens:this.cacheCreation5mTokens,cacheReadTokens:this.cacheReadTokens,thinkingTokens:this.thinkingTokens,requestId:this.requestId,ghRequestId:this.ghRequestId,serverExperiments:this.serverExperiments,telemetryData:this.telemetryData,copilotUsage:this.copilotUsage},this.logService)}case"error":{let o=e.error?.message||"Unknown error";return n({text:"",copilotErrors:[{agent:"anthropic",code:"unknown",message:o,type:"error",identifier:void 0}]})}}}};by.AnthropicMessagesProcessor=lCt;by.AnthropicMessagesProcessor=lCt=Eyc([jFi(4,$Fi.ILogService),jFi(5,zFi.ITelemetryService)],lCt)});var n8i=I(e9=>{"use strict";p();var Ryc=e9&&e9.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kyc=e9&&e9.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Pyc=e9&&e9.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=0;l--)if(t[l].role===jne.Raw.ChatRole.User){r=l;break}r===-1&&t.length>0&&(r=t.length-1);let n=0;for(let l=Math.max(r,0);le)throw new Error(Dyc.t("Too many images in request: {0} images provided, but the model supports a maximum of {1} images.",n,e));let s=e-n,c=new Map;for(let l=r-1;l>=0;l--)if(Array.isArray(t[l].content)){for(let u=t[l].content.length-1;u>=0;u--)if(t[l].content[u].type===jne.Raw.ChatCompletionContentPartKind.Image){let d=`${l}:${u}`;s>0?(c.set(d,!0),s--):c.set(d,!1)}}return t.map((l,u)=>u>=r||!Array.isArray(l.content)||!l.content.some(d=>d.type===jne.Raw.ChatCompletionContentPartKind.Image)?l:{...l,content:l.content.map((d,f)=>d.type!==jne.Raw.ChatCompletionContentPartKind.Image||c.get(`${u}:${f}`)?d:{type:jne.Raw.ChatCompletionContentPartKind.Text,text:Nyc})})}a(Myc,"filterHistoryImages")});var Gne=I(_1=>{"use strict";p();var c8i=_1&&_1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Om=_1&&_1.__param||function(t,e){return function(r,n){e(r,n,t)}},zNr;Object.defineProperty(_1,"__esModule",{value:!0});_1.RemoteAgentChatEndpoint=_1.ChatEndpoint=void 0;_1.defaultChatResponseProcessor=KNr;_1.defaultNonStreamChatResponseProcessor=A8i;var VNr=(Sne(),ba(bne)),i8i=Io(),Oyc=Qne(),l8i=nl(),o8i=zZe(),Lyc=T0(),u8i=Gs(),Byc=FE(),d8i=K6(),Fyc=jR(),Uyc=nBe(),Hne=Pl(),f8i=Sp(),s8i=Ovt(),Qyc=$6(),qyc=_y(),jyc=aCt(),Hyc=fBe(),p8i=X6(),Gyc=jvt(),h8i=mh(),$yc=gm(),m8i=K$(),Vyc=$E(),ABe=aBe(),g8i=J$(),yBe=s4e(),Wyc=qFi(),a8i=r8i(),WNr=zvt(),zyc=n8i();async function KNr(t,e,r,n,o,s,c){let u=(await Gyc.SSEProcessor.create(e,t,n,r,c)).processSSE(o);return l8i.AsyncIterableObject.map(u,f=>{let h=f.reason??"client-trimmed",m=s.extendedBy({completionChoiceFinishReason:h,headerRequestId:f.requestId.headerRequestId});return t.sendGHTelemetryEvent("completion.finishReason",m.properties,m.measurements),(0,Hyc.prepareChatCompletionForReturn)(t,e,f,s)})}a(KNr,"defaultChatResponseProcessor");async function A8i(t,e,r){let n=await t.text(),o=JSON.parse(n),s=[];for(let c=0;c<(o?.choices?.length||0);c++){let l=o.choices[c],u={role:l.message.role,content:l.message.content,name:l.message.name,toolCalls:l.message.toolCalls??l.message.tool_calls},d=(0,Uyc.getTextPart)(u.content),f=t.headers.get("X-Request-ID")??(0,Lyc.generateUuid)(),h=t.headers.get("x-github-request-id")??"",{serverExperiments:m}=(0,Qyc.getRequestId)(t.headers),g={blockFinished:!1,choiceIndex:c,model:o.model,filterReason:void 0,finishReason:l.finish_reason,message:u,usage:o.usage,tokens:[],requestId:{headerRequestId:f,gitHubRequestId:h,completionId:o.id,created:o.created,deploymentId:"",serverExperiments:m},telemetryData:r},A=[];for(let y of u.toolCalls??[])A.push({name:y.function?.name??"",arguments:y.function?.arguments??"",id:y.id??""});await e(d,c,{text:d,copilotToolCalls:A}),s.push(g)}return l8i.AsyncIterableObject.fromArray(s)}a(A8i,"defaultNonStreamChatResponseProcessor");var uCt=zNr=class{static{a(this,"ChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d){this.modelMetadata=e,this._domainService=r,this._chatMLFetcher=n,this._tokenizerProvider=o,this._instantiationService=s,this._configurationService=c,this._expService=l,this._chatWebSocketService=u,this._maxTokens=e.capabilities.limits?.max_prompt_tokens??8192,this._maxOutputTokens=e.capabilities.limits?.max_output_tokens??4096,this.model=e.id,this.modelProvider=e.vendor,this.name=e.name,this.version=e.version;let f=(0,ABe.getModelCapabilityOverride)(this.model,this._configurationService);this.family=f?.family??e.capabilities.family,this.tokenizer=e.capabilities.tokenizer??Oyc.TokenizerType.O200K,this.showInModelPicker=e.model_picker_enabled,this.isPremium=e.billing?.is_premium,this.multiplier=e.billing?.multiplier,this.restrictedToSkus=e.billing?.restricted_to;let h=(0,Wyc.normalizeTokenPrices)(e.billing?.token_prices);this.tokenPricing=h?{default:{inputPrice:h.default.inputPrice,outputPrice:h.default.outputPrice,cacheReadTokenPrice:h.default.cachePrice,cacheWriteTokenPrice:h.default.cacheWritePrice,contextMax:h.default.contextMax},longContext:h.longContext?{inputPrice:h.longContext.inputPrice,outputPrice:h.longContext.outputPrice,cacheReadTokenPrice:h.longContext.cachePrice,cacheWriteTokenPrice:h.longContext.cacheWritePrice,contextMax:h.longContext.contextMax}:void 0}:void 0,this.priceCategory=e.model_picker_price_category,this.modelPickerCategory=e.model_picker_category,this.isFallback=e.is_chat_fallback,this.supportsToolCalls=!!e.capabilities.supports.tool_calls,this.supportsVision=!!e.capabilities.supports.vision,this.supportsPrediction=!!e.capabilities.supports.prediction,this.supportsAdaptiveThinking=e.capabilities.supports.adaptive_thinking,this.minThinkingBudget=e.capabilities.supports.min_thinking_budget,this.maxThinkingBudget=e.capabilities.supports.max_thinking_budget,this.supportsReasoningEffort=e.capabilities.supports.reasoning_effort,this.supportsToolSearch=e.capabilities.supports.tool_search??(0,ABe.modelSupportsToolSearch)(this),this.supportsContextEditing=e.capabilities.supports.context_editing??(0,ABe.modelSupportsContextEditing)(this),this._supportsStreaming=!!e.capabilities.supports.streaming,this.customModel=e.custom_model,this.maxPromptImages=e.capabilities.limits?.vision?.max_prompt_images}getExtraHeaders(e,r){let n={...this.modelMetadata.requestHeaders};if(this.useMessagesApi){let o=this._configurationService.getConfig(Hne.ConfigKey.TeamInternal.ModelProviderPreference);o&&(n["X-Model-Provider-Preference"]=o)}return Object.assign(n,this.getAnthropicBetaHeader(e,r)),n}getAnthropicBetaHeader(e,r){if(!this.useMessagesApi)return{};let n=[];this.supportsAdaptiveThinking||n.push("interleaved-thinking-2025-05-14"),this.supportsToolSearch&&n.push("advanced-tool-use-2025-11-20"),(0,s8i.isAnthropicContextEditingEnabled)(this,this._configurationService,this._expService)&&n.push("context-management-2025-06-27");let o=r==="conversation-subagent";return(0,s8i.isExtendedCacheTtlEnabled)(this,this._configurationService,this._expService,e,o)&&n.push("extended-cache-ttl-2025-04-11"),n.length>0?{"anthropic-beta":n.join(",")}:{}}get modelMaxPromptTokens(){return this._maxTokens}get maxOutputTokens(){return this._maxOutputTokens}get urlOrRequestMetadata(){return this.modelMetadata.urlOrRequestMetadata??(this.useResponsesApi?{type:VNr.RequestType.ChatResponses}:this.useMessagesApi?{type:VNr.RequestType.ChatMessages}:{type:VNr.RequestType.ChatCompletions})}get useResponsesApi(){return this.modelMetadata.supported_endpoints&&!this.modelMetadata.supported_endpoints.includes(yBe.ModelSupportedEndpoint.ChatCompletions)&&this.modelMetadata.supported_endpoints.includes(yBe.ModelSupportedEndpoint.Responses)?!0:!!this.modelMetadata.supported_endpoints?.includes(yBe.ModelSupportedEndpoint.Responses)}get useWebSocketResponsesApi(){return!!this.modelMetadata.supported_endpoints?.includes(yBe.ModelSupportedEndpoint.WebSocketResponses)}get useMessagesApi(){return!!(this._configurationService.getExperimentBasedConfig(Hne.ConfigKey.UseAnthropicMessagesApi,this._expService)&&this.modelMetadata.supported_endpoints?.includes(yBe.ModelSupportedEndpoint.Messages))}get degradationReason(){return this.modelMetadata.warning_messages?.at(0)?.message??this.modelMetadata.info_messages?.at(0)?.message}get apiType(){return this.useResponsesApi?"responses":this.useMessagesApi?"messages":"chatCompletions"}interceptBody(e){if(e&&!this.supportsToolCalls&&delete e.tools,e&&!this._supportsStreaming&&(e.stream=!1),e?.messages&&(this.family.startsWith("o1")||this.model==="o1"||this.model==="o1-mini")){let r=e.messages.map(n=>n.role===i8i.OpenAI.ChatRole.System?{role:i8i.OpenAI.ChatRole.User,content:n.content}:n);e.messages=r}}createRequestBody(e){let r=this.getImageLimit();if(r!==void 0&&(e={...e,messages:this.validateAndFilterImages(e.messages,r)}),this.useResponsesApi){let n=this._instantiationService.invokeFunction(WNr.createResponsesRequestBody,e,this.model,this);return this.customizeResponsesBody(n)}else if(this.useMessagesApi){let n=this._instantiationService.invokeFunction(a8i.createMessagesRequestBody,e,this.model,this);return this.customizeMessagesBody(n)}else{let n=(0,jyc.createCapiRequestBody)(e,this.model,this.getCompletionsCallback());return this.customizeCapiBody(n,e)}}getImageLimit(){if(this.useMessagesApi&&(0,ABe.isAnthropicFamily)(this))return 20;if((0,ABe.isGeminiFamily)(this))return 10}validateAndFilterImages(e,r){return(0,zyc.filterHistoryImages)(e,r)}getCompletionsCallback(){}customizeMessagesBody(e){return e}customizeResponsesBody(e){return e}customizeCapiBody(e,r){if(!!r.requestOptions?.tools?.length&&this.family.toLowerCase().includes("gemini-3")){let o=this._configurationService.getExperimentBasedConfig(Hne.ConfigKey.TeamInternal.GeminiFunctionCallingMode,this._expService);o&&typeof e.tool_choice!="object"&&(e.tool_choice=o)}return this.family.toLowerCase().includes("gemini-3")&&this._configurationService.getExperimentBasedConfig(Hne.ConfigKey.EnableGemini3LowReasoningEffort,this._expService)&&(e.reasoning_effort="low"),e}async processResponseFromChatEndpoint(e,r,n,o,s,c,l){if(this.useResponsesApi){let u=(0,WNr.getResponsesApiCompactionThreshold)(this._configurationService,this._expService,this);return(0,WNr.processResponseFromChatEndpoint)(this._instantiationService,e,r,n,o,s,c,u)}else return this.useMessagesApi?(0,a8i.processResponseFromMessagesEndpoint)(this._instantiationService,e,r,n,s,c):this._supportsStreaming?KNr(e,r,n,o,s,c,l):A8i(n,s,c)}acquireTokenizer(){return this._tokenizerProvider.acquireTokenizer(this)}async makeChatRequest2(e,r){let n=e.useWebSocket??!!(e.turnId&&e.conversationId&&this.useWebSocketResponsesApi&&this._configurationService.getExperimentBasedConfig(Hne.ConfigKey.TeamInternal.ResponsesApiWebSocketEnabled,this._expService)),o=e.ignoreStatefulMarker??!(n&&e.conversationId&&e.turnId&&this._chatWebSocketService.hasActiveConnection(e.conversationId)),s=await this._makeChatRequest2({...e,useWebSocket:n,ignoreStatefulMarker:o},r);return s.type===Fyc.ChatFetchResponseType.InvalidStatefulMarker?this._makeChatRequest2({...e,useWebSocket:n,ignoreStatefulMarker:!0},r):s}async _makeChatRequest2(e,r){return this._chatMLFetcher.fetchOne({requestOptions:{},...e,endpoint:this},r)}async makeChatRequest(e,r,n,o,s,c,l,u,d){return this.makeChatRequest2({debugName:e,messages:r,finishedCb:n,location:s,source:c,requestOptions:l,userInitiatedRequest:u,telemetryProperties:d},o)}cloneWithTokenOverride(e){return this._instantiationService.createInstance(zNr,(0,o8i.mixin)((0,o8i.deepClone)(this.modelMetadata),{capabilities:{limits:{max_prompt_tokens:e}}}))}};_1.ChatEndpoint=uCt;_1.ChatEndpoint=uCt=zNr=c8i([Om(1,g8i.IDomainService),Om(2,d8i.IChatMLFetcher),Om(3,m8i.ITokenizerProvider),Om(4,u8i.IInstantiationService),Om(5,Hne.IConfigurationService),Om(6,h8i.IExperimentationService),Om(7,p8i.IChatWebSocketManager),Om(8,f8i.ILogService)],uCt);var YNr=class extends uCt{static{a(this,"RemoteAgentChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A){super(e,n,u,d,f,h,m,g,A),this._requestMetadata=r}processResponseFromChatEndpoint(e,r,n,o,s,c,l,u){return KNr(e,r,n,2,s,c,l)}get urlOrRequestMetadata(){return this._requestMetadata}};_1.RemoteAgentChatEndpoint=YNr;_1.RemoteAgentChatEndpoint=YNr=c8i([Om(2,g8i.IDomainService),Om(3,Vyc.ICAPIClientService),Om(4,qyc.IFetcherService),Om(5,$yc.ITelemetryService),Om(6,Byc.IAuthenticationService),Om(7,d8i.IChatMLFetcher),Om(8,m8i.ITokenizerProvider),Om(9,u8i.IInstantiationService),Om(10,Hne.IConfigurationService),Om(11,h8i.IExperimentationService),Om(12,p8i.IChatWebSocketManager),Om(13,f8i.ILogService)],YNr)});var y8i=I(uI=>{"use strict";p();var Yyc=uI&&uI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},lI=uI&&uI.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(uI,"__esModule",{value:!0});uI.CopilotUtilityChatEndpoint=uI.CopilotUtilitySmallChatEndpoint=uI.CopilotChatEndpoint=void 0;var Kyc=Gs(),Jyc=FE(),Zyc=K6(),Xyc=Pl(),eEc=U4(),tEc=Sp(),rEc=_y(),nEc=X6(),iEc=mh(),oEc=gm(),sEc=K$(),aEc=$E(),cEc=J$(),lEc=Gne(),EBe=class extends lEc.ChatEndpoint{static{a(this,"CopilotChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A){super(e,r,u,d,f,h,m,g,A)}getCompletionsCallback(){return(e,r)=>{r&&r.id&&(e.reasoning_opaque=r.id,e.reasoning_text=Array.isArray(r.text)?r.text.join(""):r.text)}}};uI.CopilotChatEndpoint=EBe;uI.CopilotChatEndpoint=EBe=Yyc([lI(1,cEc.IDomainService),lI(2,aEc.ICAPIClientService),lI(3,rEc.IFetcherService),lI(4,eEc.IEnvService),lI(5,oEc.ITelemetryService),lI(6,Jyc.IAuthenticationService),lI(7,Zyc.IChatMLFetcher),lI(8,sEc.ITokenizerProvider),lI(9,Kyc.IInstantiationService),lI(10,Xyc.IConfigurationService),lI(11,iEc.IExperimentationService),lI(12,nEc.IChatWebSocketManager),lI(13,tEc.ILogService)],EBe);var JNr=class t{static{a(this,"CopilotUtilitySmallChatEndpoint")}static{this.capiFamily="gpt-4o-mini"}static async resolve(e,r){let n=await e.getChatModelFromCapiFamily(t.capiFamily);return r.createInstance(EBe,n)}};uI.CopilotUtilitySmallChatEndpoint=JNr;var ZNr=class{static{a(this,"CopilotUtilityChatEndpoint")}static async resolve(e,r){let n=await e.getCopilotUtilityModel();return r.createInstance(EBe,n)}};uI.CopilotUtilityChatEndpoint=ZNr});var XNr=I(TL=>{"use strict";p();var uEc=TL&&TL.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},dI=TL&&TL.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(TL,"__esModule",{value:!0});TL.AutoChatEndpoint=void 0;TL.isAutoModel=xEc;var dEc=Gs(),fEc=FE(),pEc=K6(),hEc=Pl(),mEc=U4(),gEc=Sp(),AEc=_y(),yEc=X6(),EEc=mh(),_Ec=gm(),vEc=K$(),CEc=$E(),bEc=J$(),SEc=Gne(),TEc=y8i(),_Be=class extends TEc.CopilotChatEndpoint{static{a(this,"AutoChatEndpoint")}static{this.pseudoModelId="auto"}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_){super(IEc(e,r,n),s,c,l,u,d,f,h,m,g,A,y,E,_),this.discountRange=o}};TL.AutoChatEndpoint=_Be;TL.AutoChatEndpoint=_Be=uEc([dI(4,bEc.IDomainService),dI(5,CEc.ICAPIClientService),dI(6,AEc.IFetcherService),dI(7,mEc.IEnvService),dI(8,_Ec.ITelemetryService),dI(9,fEc.IAuthenticationService),dI(10,pEc.IChatMLFetcher),dI(11,vEc.ITokenizerProvider),dI(12,dEc.IInstantiationService),dI(13,hEc.IConfigurationService),dI(14,EEc.IExperimentationService),dI(15,yEc.IChatWebSocketManager),dI(16,gEc.ILogService)],_Be);function IEc(t,e,r){let n;t instanceof SEc.ChatEndpoint?n=t.modelMetadata:n={id:t.model,vendor:t.modelProvider,name:t.name,version:t.version,model_picker_enabled:t.showInModelPicker,is_chat_default:!0,is_chat_fallback:t.isFallback,capabilities:{type:"chat",family:t.family,tokenizer:t.tokenizer,limits:{max_prompt_tokens:t.modelMaxPromptTokens,max_output_tokens:t.maxOutputTokens},supports:{tool_calls:t.supportsToolCalls,vision:t.supportsVision,prediction:t.supportsPrediction,streaming:!0}},billing:t.isPremium!==void 0||t.multiplier!==void 0||t.restrictedToSkus!==void 0?{is_premium:t.isPremium??!1,multiplier:t.multiplier??0,restricted_to:t.restrictedToSkus}:void 0,custom_model:t.customModel};let o=t.multiplier!==void 0?Math.round(t.multiplier*(1-r)*100)/100:void 0;return{...n,warning_messages:void 0,model_picker_enabled:!0,info_messages:void 0,billing:{is_premium:n.billing?.is_premium,multiplier:o,restricted_to:n.billing?.restricted_to},requestHeaders:{...n.requestHeaders||{},"Copilot-Session-Token":e}}}a(IEc,"calculateAutoModelInfo");function xEc(t){return t&&(t.model===_Be.pseudoModelId||t instanceof _Be)?1:-1}a(xEc,"isAutoModel")});var tMr=I(vBe=>{"use strict";p();Object.defineProperty(vBe,"__esModule",{value:!0});vBe.getImageTelemetryEventMeasurements=wEc;vBe.getImageTelemetryMeasurementsFromMessages=REc;vBe.getImageTelemetryMeasurementsFromReferences=kEc;var b8i=PNr(),E8i="screenshot-focused-window";function S8i(){return{imageCount:0,totalImageBytes:0,maxImageBytes:0,maxImageWidth:0,maxImageHeight:0,maxImagePixels:0,totalImagePixels:0,imagePngCount:0,imageJpegCount:0,imageGifCount:0,imageWebpCount:0,imageUnknownMimeCount:0,imageClipboardCount:0,imageScreenshotCount:0,imageFileCount:0,imageUrlCount:0,imageUnknownSourceCount:0}}a(S8i,"createEmptyImageTelemetryMeasurements");function wEc(t){return t.imageCount>0?t:{}}a(wEc,"getImageTelemetryEventMeasurements");function REc(t){let e=S8i();for(let r of t??[])if(Array.isArray(r.content))for(let n of r.content){let o=UEc(n,"imageUrl"),s=eMr(o,"url");if(!s)continue;let c=PEc(s,eMr(o,"mediaType"));c&&T8i(e,c)}return e}a(REc,"getImageTelemetryMeasurementsFromMessages");function kEc(t){let e=S8i();for(let r of t??[]){let n=kye(r.value);if(!n)continue;let o=eMr(n,"mimeType");if(!o?.toLowerCase().startsWith("image/"))continue;let s=v8i(n.data)??v8i(n.value);T8i(e,{mimeType:o,byteLength:s?.byteLength??C8i(n.data)??C8i(n.value),dimensions:MEc(s,o),source:OEc(r,n)})}return e}a(kEc,"getImageTelemetryMeasurementsFromReferences");function T8i(t,e){t.imageCount++;let r=e.byteLength??0;switch(t.totalImageBytes+=r,t.maxImageBytes=Math.max(t.maxImageBytes,r),DEc(t,e.dimensions),I8i(e.mimeType)){case"png":t.imagePngCount++;break;case"jpeg":t.imageJpegCount++;break;case"gif":t.imageGifCount++;break;case"webp":t.imageWebpCount++;break;default:t.imageUnknownMimeCount++}switch(e.source){case"clipboard":t.imageClipboardCount++;break;case"screenshot":t.imageScreenshotCount++;break;case"file":t.imageFileCount++;break;case"url":t.imageUrlCount++;break;default:t.imageUnknownSourceCount++}}a(T8i,"addImageTelemetryInput");function PEc(t,e){if(!t.startsWith("data:"))return t.startsWith("https://")?{mimeType:e,source:"url"}:void 0;let r=/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/.exec(t);if(r)return{mimeType:e??r[1],byteLength:LEc(r[2]),dimensions:NEc(t),source:"unknown"}}a(PEc,"getImageTelemetryInputFromUrl");function DEc(t,e){if(!e||!_8i(e.width)||!_8i(e.height))return;let r=e.width*e.height;!Number.isFinite(r)||r<=0||(t.maxImageWidth=Math.max(t.maxImageWidth,e.width),t.maxImageHeight=Math.max(t.maxImageHeight,e.height),t.maxImagePixels=Math.max(t.maxImagePixels,r),t.totalImagePixels+=r)}a(DEc,"addImageDimensions");function _8i(t){return Number.isFinite(t)&&t>0}a(_8i,"isValidDimension");function NEc(t){try{return(0,b8i.getImageDimensions)(t)}catch{return}}a(NEc,"getImageDimensionsFromDataUrl");function MEc(t,e){let r=e?.toLowerCase().split(";")[0].trim();if(!(!t||I8i(r)==="unknown"))try{return(0,b8i.getImageDimensionsFromBytes)(t,r)}catch{return}}a(MEc,"getImageDimensionsFromBytes");function I8i(t){switch(t?.toLowerCase().split(";")[0].trim()){case"image/png":return"png";case"image/jpeg":case"image/jpg":return"jpeg";case"image/gif":return"gif";case"image/webp":return"webp";default:return"unknown"}}a(I8i,"normalizeMimeType");function OEc(t,e){return e.isPasted===!0?"clipboard":e.isURL===!0?"url":t.id===E8i||e.id===E8i?"screenshot":e.isURL===!1?"file":"unknown"}a(OEc,"getImageSourceFromReference");function LEc(t){let e=t.trim(),r=0;return e.endsWith("==")?r=2:e.endsWith("=")&&(r=1),Math.max(0,Math.floor(e.length*3/4)-r)}a(LEc,"getBase64ByteLength");function v8i(t){if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let e=kye(t);if(!e)return;let r=Object.keys(e);if(!r.length||!r.every(BEc))return;let n=[...r];n.sort((s,c)=>Number(s)-Number(c));let o=n.map(s=>e[s]);if(o.every(FEc))return new Uint8Array(o)}a(v8i,"getByteData");function BEc(t){let e=Number(t);return Number.isInteger(e)&&e>=0&&String(e)===t}a(BEc,"isArrayIndexKey");function FEc(t){return typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=255}a(FEc,"isByteValue");function C8i(t){if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))return t.byteLength;let r=kye(t)?.byteLength;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}a(C8i,"getByteLength");function UEc(t,e){return kye(kye(t)?.[e])}a(UEc,"getObjectProperty");function eMr(t,e){let r=kye(t)?.[e];return typeof r=="string"?r:void 0}a(eMr,"getStringProperty");function kye(t){return typeof t=="object"&&t!==null?t:void 0}a(kye,"asRecord")});var R8i=I(Pye=>{"use strict";p();Object.defineProperty(Pye,"__esModule",{value:!0});Pye.ChatFailKind=Pye.FetchResponseKind=void 0;var x8i;(function(t){t.Success="success",t.Failed="failed",t.Canceled="canceled"})(x8i||(Pye.FetchResponseKind=x8i={}));var w8i;(function(t){t.OffTopic="offTopic",t.TokenExpiredOrInvalid="tokenExpiredOrInvalid",t.ServerCanceled="serverCanceled",t.ClientNotSupported="clientNotSupported",t.RateLimited="rateLimited",t.QuotaExceeded="quotaExceeded",t.ExtensionBlocked="extensionBlocked",t.ServerError="serverError",t.ContentFilter="contentFilter",t.AgentUnauthorized="unauthorized",t.AgentFailedDependency="failedDependency",t.ValidationFailed="validationFailed",t.InvalidPreviousResponseId="invalidPreviousResponseId",t.NotFound="notFound",t.Unknown="unknown"})(w8i||(Pye.ChatFailKind=w8i={}))});var CBe=I(Mu=>{"use strict";p();Object.defineProperty(Mu,"__esModule",{value:!0});Mu.FILE_TOOL_NAMES=Mu.SHELL_TOOL_NAMES=Mu.TOOL_PARAM_COMMAND_MAX_LEN=Mu.GitHubCopilotAttr=Mu.CopilotCliSdkAttr=Mu.StdAttr=Mu.CopilotChatAttr=Mu.GenAiAttr=Mu.GenAiToolType=Mu.GenAiTokenType=Mu.GenAiProviderName=Mu.GenAiOperationName=void 0;Mu.GenAiOperationName={CHAT:"chat",INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool",EMBEDDINGS:"embeddings",CONTENT_EVENT:"content_event",EXECUTE_HOOK:"execute_hook"};Mu.GenAiProviderName={GITHUB:"github",OPENAI:"openai",ANTHROPIC:"anthropic",AZURE_AI_OPENAI:"azure.ai.openai",GEMINI:"gemini"};Mu.GenAiTokenType={INPUT:"input",OUTPUT:"output"};Mu.GenAiToolType={FUNCTION:"function",EXTENSION:"extension"};Mu.GenAiAttr={OPERATION_NAME:"gen_ai.operation.name",PROVIDER_NAME:"gen_ai.provider.name",REQUEST_MODEL:"gen_ai.request.model",REQUEST_TEMPERATURE:"gen_ai.request.temperature",REQUEST_MAX_TOKENS:"gen_ai.request.max_tokens",REQUEST_TOP_P:"gen_ai.request.top_p",REQUEST_FREQUENCY_PENALTY:"gen_ai.request.frequency_penalty",REQUEST_PRESENCE_PENALTY:"gen_ai.request.presence_penalty",REQUEST_SEED:"gen_ai.request.seed",REQUEST_STOP_SEQUENCES:"gen_ai.request.stop_sequences",REQUEST_STREAM:"gen_ai.request.stream",RESPONSE_MODEL:"gen_ai.response.model",RESPONSE_ID:"gen_ai.response.id",RESPONSE_FINISH_REASONS:"gen_ai.response.finish_reasons",RESPONSE_TIME_TO_FIRST_CHUNK:"gen_ai.response.time_to_first_chunk",USAGE_INPUT_TOKENS:"gen_ai.usage.input_tokens",USAGE_OUTPUT_TOKENS:"gen_ai.usage.output_tokens",USAGE_CACHE_READ_INPUT_TOKENS:"gen_ai.usage.cache_read.input_tokens",USAGE_CACHE_CREATION_INPUT_TOKENS:"gen_ai.usage.cache_creation.input_tokens",USAGE_REASONING_TOKENS:"gen_ai.usage.reasoning_tokens",USAGE_REASONING_OUTPUT_TOKENS:"gen_ai.usage.reasoning.output_tokens",CONVERSATION_ID:"gen_ai.conversation.id",OUTPUT_TYPE:"gen_ai.output.type",TOKEN_TYPE:"gen_ai.token.type",AGENT_NAME:"gen_ai.agent.name",AGENT_ID:"gen_ai.agent.id",AGENT_VERSION:"gen_ai.agent.version",AGENT_DESCRIPTION:"gen_ai.agent.description",TOOL_NAME:"gen_ai.tool.name",TOOL_TYPE:"gen_ai.tool.type",TOOL_CALL_ID:"gen_ai.tool.call.id",TOOL_DESCRIPTION:"gen_ai.tool.description",TOOL_CALL_ARGUMENTS:"gen_ai.tool.call.arguments",TOOL_CALL_RESULT:"gen_ai.tool.call.result",INPUT_MESSAGES:"gen_ai.input.messages",OUTPUT_MESSAGES:"gen_ai.output.messages",SYSTEM_INSTRUCTIONS:"gen_ai.system_instructions",TOOL_DEFINITIONS:"gen_ai.tool.definitions"};Mu.CopilotChatAttr={LOCATION:"copilot_chat.location",INTENT:"copilot_chat.intent",TURN_INDEX:"copilot_chat.turn.index",TURN_COUNT:"copilot_chat.turn_count",TOOL_CALL_ROUND:"copilot_chat.tool_call_round",API_TYPE:"copilot_chat.api_type",FETCHER:"copilot_chat.fetcher",DEBUG_NAME:"copilot_chat.debug_name",ENDPOINT_TYPE:"copilot_chat.endpoint_type",MAX_PROMPT_TOKENS:"copilot_chat.request.max_prompt_tokens",TIME_TO_FIRST_TOKEN:"copilot_chat.time_to_first_token",SESSION_ID:"copilot_chat.session_id",SERVER_REQUEST_ID:"copilot_chat.server_request_id",CANCELED:"copilot_chat.canceled",REASONING_CONTENT:"copilot_chat.reasoning_content",USER_REQUEST:"copilot_chat.user_request",REQUEST_OPTIONS:"copilot_chat.request.options",REQUEST_SHAPE:"copilot_chat.request.shape",PROMPT_CONTEXT:"copilot_chat.prompt_context",PROMPT_INSTRUCTIONS:"copilot_chat.prompt_instructions",CHAT_SESSION_ID:"copilot_chat.chat_session_id",PARENT_CHAT_SESSION_ID:"copilot_chat.parent_chat_session_id",DEBUG_LOG_LABEL:"copilot_chat.debug_log_label",MARKDOWN_CONTENT:"copilot_chat.markdown_content",EDIT_SOURCE:"copilot_chat.edit.source",EDIT_OUTCOME:"copilot_chat.edit.outcome",LANGUAGE_ID:"copilot_chat.language_id",TIME_DELAY_MS:"copilot_chat.time_delay_ms",HAS_REMAINING_EDITS:"copilot_chat.has_remaining_edits",REPO_HEAD_BRANCH_NAME:"copilot_chat.repo.head_branch_name",REPO_HEAD_COMMIT_HASH:"copilot_chat.repo.head_commit_hash",REPO_REMOTE_URL:"copilot_chat.repo.remote_url",FILE_RELATIVE_PATH:"copilot_chat.file.relative_path",HOOK_TYPE:"copilot_chat.hook_type",HOOK_INPUT:"copilot_chat.hook_input",HOOK_OUTPUT:"copilot_chat.hook_output",HOOK_RESULT_KIND:"copilot_chat.hook_result_kind",MODE_NAME:"copilot_chat.mode_name",TOTAL_COST_USD:"copilot_chat.total_cost_usd",COPILOT_USAGE_NANO_AIU:"copilot_chat.copilot_usage_nano_aiu"};Mu.StdAttr={ERROR_TYPE:"error.type",SERVER_ADDRESS:"server.address",SERVER_PORT:"server.port"};Mu.CopilotCliSdkAttr={HOOK_TYPE:"github.copilot.hook.type",HOOK_INVOCATION_ID:"github.copilot.hook.invocation_id"};Mu.GitHubCopilotAttr={AGENT_TYPE:"github.copilot.agent.type",CLOUD_BACKEND_VERSION:"github.copilot.cloud.backend_version",GIT_REPOSITORY:"github.copilot.git.repository",GIT_BRANCH:"github.copilot.git.branch",GIT_COMMIT_SHA:"github.copilot.git.commit_sha",GITHUB_ORG:"github.copilot.github.org",HOOK_DECISION:"github.copilot.hook.decision",HOOK_DURATION_SECONDS:"github.copilot.hook.duration",HOOK_TOOL_NAMES:"github.copilot.hook.tool_names",MCP_SERVER_NAME_HASH:"github.copilot.mcp.server.name_hash",MCP_SERVER_NAME:"github.copilot.mcp.server.name",TOOL_PARAM_COMMAND:"github.copilot.tool.parameters.command",TOOL_PARAM_FILE_PATH:"github.copilot.tool.parameters.file_path",TOOL_PARAM_EDIT_TYPE:"github.copilot.tool.parameters.edit_type",TOOL_PARAM_SKILL_NAME:"github.copilot.tool.parameters.skill_name",TOOL_PARAM_MCP_SERVER_NAME_HASH:"github.copilot.tool.parameters.mcp_server_name_hash",TOOL_PARAM_MCP_SERVER_NAME:"github.copilot.tool.parameters.mcp_server_name",TOOL_PARAM_MCP_TOOL_NAME:"github.copilot.tool.parameters.mcp_tool_name"};Mu.TOOL_PARAM_COMMAND_MAX_LEN=256;Mu.SHELL_TOOL_NAMES=new Set(["bash","powershell","local_shell","runInTerminal","run_in_terminal","Bash"]);Mu.FILE_TOOL_NAMES=new Set(["view","create","edit","str_replace","str_replace_editor","insert","readFile","createFile","replaceString","applyPatch","read_file","create_file","apply_patch","insert_edit_into_file","replace_string_in_file","multi_replace_string_in_file","edit_notebook_file","Read","Edit","MultiEdit","Write","NotebookEdit"])});var nMr=I(VR=>{"use strict";p();Object.defineProperty(VR,"__esModule",{value:!0});VR.truncateForOTel=QEc;VR.toInputMessages=qEc;VR.toOutputMessages=jEc;VR.toSystemInstructions=HEc;VR.extractTextFromContent=rMr;VR.collectSystemTextsFromRequestBody=GEc;VR.normalizeProviderMessages=$Ec;VR.toToolDefinitions=D8i;VR.stringifyToolDefinitionsForOTel=ZEc;VR.stringifyToolsRawForTelemetry=XEc;function QEc(t,e=0){if(e<=0||t.length<=e)return t;let r=`...[truncated, original ${t.length} chars]`;return e<=r.length?t.substring(0,e):t.substring(0,e-r.length)+r}a(QEc,"truncateForOTel");function qEc(t){return t.map(e=>{let r=[];if(e.role==="tool"&&e.tool_call_id)return r.push({type:"tool_call_response",id:e.tool_call_id,response:e.content??""}),{role:e.role,parts:r};if(e.content&&r.push({type:"text",content:e.content}),e.tool_calls)for(let n of e.tool_calls){let o;try{o=JSON.parse(n.function.arguments)}catch{o=n.function.arguments}r.push({type:"tool_call",id:n.id,name:n.function.name,arguments:o})}return{role:e.role,parts:r}})}a(qEc,"toInputMessages");function jEc(t){return t.map(e=>{let r=[],n=e.message;if(n?.content&&r.push({type:"text",content:n.content}),n?.tool_calls)for(let o of n.tool_calls){let s;try{s=JSON.parse(o.function.arguments)}catch{s=o.function.arguments}r.push({type:"tool_call",id:o.id,name:o.function.name,arguments:s})}return{role:n?.role??"assistant",parts:r,finish_reason:e.finish_reason}})}a(jEc,"toOutputMessages");function HEc(t){if(t===void 0)return;let r=(Array.isArray(t)?t:[t]).filter(n=>typeof n=="string"&&n.length>0).map(n=>({type:"text",content:n}));return r.length>0?r:void 0}a(HEc,"toSystemInstructions");function rMr(t){return typeof t=="string"?t:Array.isArray(t)?t.map(e=>{if(typeof e=="string")return e;if(e&&typeof e=="object"){let r=e;if(typeof r.text=="string")return r.text;if(typeof r.content=="string")return r.content}return""}).filter(e=>e.length>0).join(` -`):""}a(rMr,"extractTextFromContent");function GEc(t){let e=[],r=t.messages??t.input;if(r){for(let n of r)if(n.role==="system"){let o=rMr(n.content);o&&e.push(o)}}if(e.length===0){let n=rMr(t.system??t.instructions);n&&e.push(n)}return e}a(GEc,"collectSystemTextsFromRequestBody");function $Ec(t){return t.map(e=>{switch(e.type){case"function_call":return VEc(e);case"function_call_output":return WEc(e);case"tool_search_output":return zEc(e);case"reasoning":return YEc(e)}let n=e.role,o=[],s=e.content;if(n==="tool"&&typeof e.tool_call_id=="string")return o.push({type:"tool_call_response",id:e.tool_call_id,response:s??""}),{role:n,parts:o};if(typeof s=="string"&&s.length>0)o.push({type:"text",content:s});else if(Array.isArray(s))for(let l of s){if(!l||typeof l!="object")continue;let u=l;switch(u.type){case"text":case"input_text":case"output_text":typeof u.text=="string"&&o.push({type:"text",content:u.text});break;case"tool_use":o.push({type:"tool_call",id:String(u.id??""),name:String(u.name??""),arguments:u.input});break;case"tool_result":o.push({type:"tool_call_response",id:String(u.tool_use_id??""),response:u.content??""});break;case"thinking":typeof u.thinking=="string"&&o.push({type:"reasoning",content:u.thinking});break;default:o.push({type:"text",content:JSON.stringify(u)});break}}let c=e.tool_calls;if(Array.isArray(c))for(let l of c){if(!l||typeof l!="object")continue;let u=l,d=u.function;if(d){let f;try{f=typeof d.arguments=="string"?JSON.parse(d.arguments):d.arguments}catch{f=d.arguments}o.push({type:"tool_call",id:String(u.id??""),name:String(d.name??""),arguments:f})}}return{role:n,parts:o}})}a($Ec,"normalizeProviderMessages");function VEc(t){let e=t.arguments;if(typeof e=="string")try{e=JSON.parse(e)}catch{}return{role:"assistant",parts:[{type:"tool_call",id:String(t.call_id??t.id??""),name:String(t.name??""),arguments:e}]}}a(VEc,"normalizeResponsesFunctionCall");function WEc(t){let e=t.output,r;return typeof e=="string"?r=e:Array.isArray(e)?r=e.map(n=>n&&typeof n=="object"&&typeof n.text=="string"?n.text:JSON.stringify(n)).join(""):r=e??"",{role:"tool",parts:[{type:"tool_call_response",id:String(t.call_id??t.id??""),response:r}]}}a(WEc,"normalizeResponsesFunctionCallOutput");function zEc(t){let e=Object.prototype.hasOwnProperty.call(t,"tools")&&t.tools!==void 0,r={type:"tool_search_output",id:String(t.call_id??t.id??""),status:typeof t.status=="string"?t.status:void 0};return e&&(r.tools=t.tools),{role:"tool_search",parts:[r]}}a(zEc,"normalizeResponsesToolSearchOutput");function YEc(t){let e=[],r=t.summary;if(Array.isArray(r))for(let n of r)n&&typeof n=="object"&&typeof n.text=="string"&&e.push({type:"reasoning",content:n.text});else typeof r=="string"&&e.push({type:"reasoning",content:r});return typeof t.encrypted_content=="string"&&e.push({type:"reasoning",content:t.encrypted_content}),{role:"assistant",parts:e}}a(YEc,"normalizeResponsesReasoning");function D8i(t){if(!t||t.length===0)return;let e=[];for(let r of t){let n=r.function?.name??r.name;if(!n)continue;let o=r.function?.description??r.description,s=r.function?.parameters??r.parameters??r.input_schema??r.inputSchema;e.push({type:"function",name:n,description:o,parameters:s})}return e.length>0?e:void 0}a(D8i,"toToolDefinitions");var k8i=new WeakMap,P8i=new WeakMap,dCt,fCt;function KEc(t){return dCt!==void 0&&dCt===t?dCt:(dCt=t,t)}a(KEc,"internToolDefsString");function JEc(t){return fCt!==void 0&&fCt===t?fCt:(fCt=t,t)}a(JEc,"internToolsRawString");function ZEc(t){if(!t||t.length===0)return;let e=k8i.get(t);if(e!==void 0)return e;let r=D8i(t);if(!r)return;let n=KEc(JSON.stringify(r));return k8i.set(t,n),n}a(ZEc,"stringifyToolDefinitionsForOTel");function XEc(t){if(!t)return;let e=P8i.get(t);if(e!==void 0)return e;let r=JEc(JSON.stringify(t));return P8i.set(t,r),r}a(XEc,"stringifyToolsRawForTelemetry")});var iMr=I(pCt=>{"use strict";p();Object.defineProperty(pCt,"__esModule",{value:!0});pCt.resolveWorkspaceOTelMetadata=e_c;pCt.workspaceMetadataToOTelAttributes=r_c;var N8i=ZP(),M8i=FPr(),Z$=CBe();function e_c(t,e){let r=t.activeRepository?.get();return r?t_c(r,e):{}}a(e_c,"resolveWorkspaceOTelMetadata");function t_c(t,e){let r,n=Array.from((0,M8i.getOrderedRepoInfosFromContext)(t))[0];n?.fetchUrl&&(r=(0,M8i.normalizeFetchUrl)(n.fetchUrl));let o;return e&&(0,N8i.isEqualOrParent)(e,t.rootUri)&&(o=(0,N8i.relativePath)(t.rootUri,e)),{headBranchName:t.headBranchName,headCommitHash:t.headCommitHash,remoteUrl:r,fileRelativePath:o}}a(t_c,"buildWorkspaceMetadata");function r_c(t){if(!t)return{};let e={};if(t.headBranchName&&(e[Z$.CopilotChatAttr.REPO_HEAD_BRANCH_NAME]=t.headBranchName,e[Z$.GitHubCopilotAttr.GIT_BRANCH]=t.headBranchName),t.headCommitHash&&(e[Z$.CopilotChatAttr.REPO_HEAD_COMMIT_HASH]=t.headCommitHash,e[Z$.GitHubCopilotAttr.GIT_COMMIT_SHA]=t.headCommitHash),t.remoteUrl){e[Z$.CopilotChatAttr.REPO_REMOTE_URL]=t.remoteUrl,e[Z$.GitHubCopilotAttr.GIT_REPOSITORY]=t.remoteUrl;let r=n_c(t.remoteUrl);r&&(e[Z$.GitHubCopilotAttr.GITHUB_ORG]=r)}return t.fileRelativePath&&(e[Z$.CopilotChatAttr.FILE_RELATIVE_PATH]=t.fileRelativePath),e}a(r_c,"workspaceMetadataToOTelAttributes");function n_c(t){return t.match(/github\.com[/:]([^/]+)\/[^/]+\/?$/i)?.[1]}a(n_c,"extractGitHubOrg")});var O8i=I(WR=>{"use strict";p();Object.defineProperty(WR,"__esModule",{value:!0});WR.emitInferenceDetailsEvent=i_c;WR.emitSessionStartEvent=o_c;WR.emitToolCallEvent=s_c;WR.emitAgentTurnEvent=a_c;WR.emitEditFeedbackEvent=c_c;WR.emitEditHunkActionEvent=l_c;WR.emitInlineDoneEvent=u_c;WR.emitEditSurvivalEvent=d_c;WR.emitUserFeedbackEvent=f_c;WR.emitCloudSessionInvokeEvent=p_c;var Lm=CBe(),Dye=nMr(),hCt=iMr();function i_c(t,e,r,n){let o={"event.name":"gen_ai.client.inference.operation.details",[Lm.GenAiAttr.OPERATION_NAME]:Lm.GenAiOperationName.CHAT,[Lm.GenAiAttr.REQUEST_MODEL]:e.model};if(r&&(r.model&&(o[Lm.GenAiAttr.RESPONSE_MODEL]=r.model),r.id&&(o[Lm.GenAiAttr.RESPONSE_ID]=r.id),r.finishReasons&&(o[Lm.GenAiAttr.RESPONSE_FINISH_REASONS]=r.finishReasons),r.inputTokens!==void 0&&(o[Lm.GenAiAttr.USAGE_INPUT_TOKENS]=r.inputTokens),r.outputTokens!==void 0&&(o[Lm.GenAiAttr.USAGE_OUTPUT_TOKENS]=r.outputTokens)),e.temperature!==void 0&&(o[Lm.GenAiAttr.REQUEST_TEMPERATURE]=e.temperature),e.maxTokens!==void 0&&(o[Lm.GenAiAttr.REQUEST_MAX_TOKENS]=e.maxTokens),n&&(o[Lm.StdAttr.ERROR_TYPE]=n.type),t.config.captureContent){let s=t.config.maxAttributeSizeChars;if(e.messages!==void 0){let c=Array.isArray(e.messages)?e.messages:void 0;o[Lm.GenAiAttr.INPUT_MESSAGES]=(0,Dye.truncateForOTel)(JSON.stringify(c?(0,Dye.normalizeProviderMessages)(c):e.messages),s)}if(e.systemMessage!==void 0){let c=typeof e.systemMessage=="string"?e.systemMessage:JSON.stringify(e.systemMessage),l=(0,Dye.toSystemInstructions)(c);l!==void 0&&(o[Lm.GenAiAttr.SYSTEM_INSTRUCTIONS]=(0,Dye.truncateForOTel)(JSON.stringify(l),s))}if(e.tools!==void 0){let c=(0,Dye.stringifyToolsRawForTelemetry)(e.tools);c!==void 0&&(o[Lm.GenAiAttr.TOOL_DEFINITIONS]=(0,Dye.truncateForOTel)(c,s))}}t.emitLogRecord(`GenAI inference: ${e.model}`,o)}a(i_c,"emitInferenceDetailsEvent");function o_c(t,e,r,n){t.emitLogRecord("copilot_chat.session.start",{"event.name":"copilot_chat.session.start","session.id":e,[Lm.GenAiAttr.REQUEST_MODEL]:r,[Lm.GenAiAttr.AGENT_NAME]:n})}a(o_c,"emitSessionStartEvent");function s_c(t,e,r,n,o){t.emitLogRecord(`copilot_chat.tool.call: ${e}`,{"event.name":"copilot_chat.tool.call",[Lm.GenAiAttr.TOOL_NAME]:e,duration_ms:r,success:n,...o?{[Lm.StdAttr.ERROR_TYPE]:o}:{}})}a(s_c,"emitToolCallEvent");function a_c(t,e,r,n,o){t.emitLogRecord(`copilot_chat.agent.turn: ${e}`,{"event.name":"copilot_chat.agent.turn","turn.index":e,[Lm.GenAiAttr.USAGE_INPUT_TOKENS]:r,[Lm.GenAiAttr.USAGE_OUTPUT_TOKENS]:n,tool_call_count:o})}a(a_c,"emitAgentTurnEvent");function c_c(t,e,r,n,o,s,c,l,u){t.emitLogRecord(`copilot_chat.edit.feedback: ${e}`,{"event.name":"copilot_chat.edit.feedback",outcome:e,language_id:r,participant:n,request_id:o,edit_surface:s,has_remaining_edits:c,is_notebook:l,...(0,hCt.workspaceMetadataToOTelAttributes)(u)})}a(c_c,"emitEditFeedbackEvent");function l_c(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.edit.hunk.action: ${e}`,{"event.name":"copilot_chat.edit.hunk.action",outcome:e,language_id:r,request_id:n,line_count:o,lines_added:s,lines_removed:c,...(0,hCt.workspaceMetadataToOTelAttributes)(l)})}a(l_c,"emitEditHunkActionEvent");function u_c(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.inline.done: ${e?"accepted":"rejected"}`,{"event.name":"copilot_chat.inline.done",accepted:e,language_id:r,edit_count:n,edit_line_count:o,reply_type:s,is_notebook:c,...(0,hCt.workspaceMetadataToOTelAttributes)(l)})}a(u_c,"emitInlineDoneEvent");function d_c(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.edit.survival: ${e}`,{"event.name":"copilot_chat.edit.survival",edit_source:e,survival_rate_four_gram:r,survival_rate_no_revert:n,time_delay_ms:o,did_branch_change:s,request_id:c,...(0,hCt.workspaceMetadataToOTelAttributes)(l)})}a(d_c,"emitEditSurvivalEvent");function f_c(t,e,r,n,o){t.emitLogRecord(`copilot_chat.user.feedback: ${e}`,{"event.name":"copilot_chat.user.feedback",rating:e,participant:r,conversation_id:n,request_id:o})}a(f_c,"emitUserFeedbackEvent");function p_c(t,e,r,n){t.emitLogRecord(`copilot_chat.cloud.session.invoke: ${e}`,{"event.name":"copilot_chat.cloud.session.invoke",partner_agent:e,model:r,request_id:n})}a(p_c,"emitCloudSessionInvokeEvent")});var L8i=I(mCt=>{"use strict";p();Object.defineProperty(mCt,"__esModule",{value:!0});mCt.GenAiMetrics=void 0;var No=CBe(),oMr=class{static{a(this,"GenAiMetrics")}static recordOperationDuration(e,r,n){e.recordMetric("gen_ai.client.operation.duration",r,{[No.GenAiAttr.OPERATION_NAME]:n.operationName,[No.GenAiAttr.PROVIDER_NAME]:n.providerName,[No.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[No.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{},...n.serverAddress?{[No.StdAttr.SERVER_ADDRESS]:n.serverAddress}:{},...n.serverPort?{[No.StdAttr.SERVER_PORT]:n.serverPort}:{},...n.errorType?{[No.StdAttr.ERROR_TYPE]:n.errorType}:{}})}static recordTokenUsage(e,r,n,o){e.recordMetric("gen_ai.client.token.usage",r,{[No.GenAiAttr.OPERATION_NAME]:o.operationName,[No.GenAiAttr.PROVIDER_NAME]:o.providerName,[No.GenAiAttr.TOKEN_TYPE]:n,[No.GenAiAttr.REQUEST_MODEL]:o.requestModel,...o.responseModel?{[No.GenAiAttr.RESPONSE_MODEL]:o.responseModel}:{},...o.serverAddress?{[No.StdAttr.SERVER_ADDRESS]:o.serverAddress}:{}})}static recordToolCallCount(e,r,n){e.incrementCounter("copilot_chat.tool.call.count",1,{[No.GenAiAttr.TOOL_NAME]:r,success:n})}static recordToolCallDuration(e,r,n){e.recordMetric("copilot_chat.tool.call.duration",n,{[No.GenAiAttr.TOOL_NAME]:r})}static recordAgentDuration(e,r,n){e.recordMetric("copilot_chat.agent.invocation.duration",n,{[No.GenAiAttr.AGENT_NAME]:r})}static recordAgentTurnCount(e,r,n){e.recordMetric("copilot_chat.agent.turn.count",n,{[No.GenAiAttr.AGENT_NAME]:r})}static recordTimeToFirstToken(e,r,n){e.recordMetric("copilot_chat.time_to_first_token",n,{[No.GenAiAttr.REQUEST_MODEL]:r})}static recordTimeToFirstChunk(e,r,n){e.recordMetric("gen_ai.client.operation.time_to_first_chunk",r,{[No.GenAiAttr.OPERATION_NAME]:n.operationName,[No.GenAiAttr.PROVIDER_NAME]:n.providerName,[No.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[No.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{}})}static recordTimePerOutputChunk(e,r,n){e.recordMetric("gen_ai.client.operation.time_per_output_chunk",r,{[No.GenAiAttr.OPERATION_NAME]:n.operationName,[No.GenAiAttr.PROVIDER_NAME]:n.providerName,[No.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[No.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{}})}static incrementSessionCount(e){e.incrementCounter("copilot_chat.session.count")}static recordEditAcceptance(e,r,n,o){e.incrementCounter("copilot_chat.edit.acceptance.count",1,{[No.CopilotChatAttr.EDIT_SOURCE]:r,[No.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[No.CopilotChatAttr.LANGUAGE_ID]:o}:{}})}static recordChatEditOutcome(e,r,n,o,s){e.incrementCounter("copilot_chat.chat_edit.outcome.count",1,{[No.CopilotChatAttr.EDIT_SOURCE]:r,[No.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[No.CopilotChatAttr.LANGUAGE_ID]:o}:{},...s!==void 0?{[No.CopilotChatAttr.HAS_REMAINING_EDITS]:s}:{}})}static recordEditSurvivalFourGram(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.four_gram",n,{[No.CopilotChatAttr.EDIT_SOURCE]:r,[No.CopilotChatAttr.TIME_DELAY_MS]:o})}static recordEditSurvivalNoRevert(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.no_revert",n,{[No.CopilotChatAttr.EDIT_SOURCE]:r,[No.CopilotChatAttr.TIME_DELAY_MS]:o})}static incrementLinesOfCode(e,r,n,o){e.incrementCounter("copilot_chat.lines_of_code.count",o,{type:r,...n?{[No.CopilotChatAttr.LANGUAGE_ID]:n}:{}})}static incrementUserActionCount(e,r){e.incrementCounter("copilot_chat.user.action.count",1,{action:r})}static incrementUserFeedbackCount(e,r){e.incrementCounter("copilot_chat.user.feedback.count",1,{rating:r})}static incrementAgentEditResponseCount(e,r){e.incrementCounter("copilot_chat.agent.edit_response.count",1,{outcome:r})}static incrementAgentSummarizationCount(e,r){e.incrementCounter("copilot_chat.agent.summarization.count",1,{outcome:r})}static incrementPullRequestCount(e){e.incrementCounter("copilot_chat.pull_request.count")}static incrementCloudSessionCount(e,r,n){e.incrementCounter("copilot_chat.cloud.session.count",1,{partner_agent:r,...n?{[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n}:{}})}static incrementCloudPrReadyCount(e,r){e.incrementCounter("copilot_chat.cloud.pr_ready.count",1,r?{[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:r}:void 0)}static recordCloudOperation(e,r,n,o,s){e.incrementCounter("copilot_chat.cloud.operation.count",1,{operation:r,[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n,success:o}),s!==void 0&&e.recordMetric("copilot_chat.cloud.operation.duration",s,{operation:r,[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n})}static incrementCloudError(e,r,n,o){e.incrementCounter("copilot_chat.cloud.error.count",1,{operation:r,[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n,[No.StdAttr.ERROR_TYPE]:o})}};mCt.GenAiMetrics=oMr});var aMr=I(gCt=>{"use strict";p();Object.defineProperty(gCt,"__esModule",{value:!0});gCt.NoopOTelService=void 0;var B8i=Ic(),F8i={setAttribute(){},setAttributes(){},setStatus(){},recordException(){},addEvent(){},getSpanContext(){},end(){}},sMr=class{static{a(this,"NoopOTelService")}constructor(e){this.onDidCompleteSpan=B8i.Event.None,this.onDidEmitSpanEvent=B8i.Event.None,this.config=e}startSpan(e,r){return F8i}startActiveSpan(e,r,n){return n(F8i)}getActiveTraceContext(){}storeTraceContext(e,r){}getStoredTraceContext(e){}runWithTraceContext(e,r){return r()}recordMetric(e,r,n){}incrementCounter(e,r,n){}emitLogRecord(e,r){}async flush(){}async shutdown(){}injectCompletedSpan(e){}};gCt.NoopOTelService=sMr});var cMr=I($ne=>{"use strict";p();Object.defineProperty($ne,"__esModule",{value:!0});$ne.DEFAULT_OTLP_ENDPOINT=void 0;$ne.resolveOTelConfig=g_c;$ne.DEFAULT_OTLP_ENDPOINT="http://localhost:4318";function h_c(t){if(!t)return{};let e={};for(let r of t.split(",")){let n=r.indexOf("=");if(n>0){let o=r.substring(0,n).trim(),s=r.substring(n+1).trim();o&&(e[o]=s)}}return e}a(h_c,"parseResourceAttributes");function m_c(t,e){if(!t)return;let r=t.replace(/^["']|["']$/g,"");try{let n=new URL(r);return e==="grpc"?n.origin:n.href}catch{return}}a(m_c,"parseOtlpEndpoint");function g_c(t){let{env:e}=t;if(t.vscodeTelemetryLevel==="off")return U8i(t);let r=t.settingDbSpanExporter??!1,n=(bBe(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)||r,o=(bBe(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)===!0;if(!n)return U8i(t);let s;bBe(e.COPILOT_OTEL_ENABLED)===!0?s="envVar":t.settingEnabled===!0?s="setting":e.OTEL_EXPORTER_OTLP_ENDPOINT?s="otlpEndpointEnvVar":s="dbSpanExporterOnly";let l=(e.OTEL_EXPORTER_OTLP_PROTOCOL??e.COPILOT_OTEL_PROTOCOL)==="grpc"?"grpc":"http",u=e.COPILOT_OTEL_ENDPOINT??e.OTEL_EXPORTER_OTLP_ENDPOINT??t.settingOtlpEndpoint??$ne.DEFAULT_OTLP_ENDPOINT,d=m_c(u,l)??$ne.DEFAULT_OTLP_ENDPOINT,f=e.COPILOT_OTEL_FILE_EXPORTER_PATH??t.settingOutfile,h;f?h="file":t.settingExporterType?h=t.settingExporterType:h=l==="grpc"?"otlp-grpc":"otlp-http";let m=bBe(e.COPILOT_OTEL_CAPTURE_CONTENT)??t.settingCaptureContent??!1,g=A_c(e.COPILOT_OTEL_MAX_ATTRIBUTE_SIZE_CHARS)??t.settingMaxAttributeSizeChars??0,A=new Set(["trace","debug","info","warn","error"]),y=e.COPILOT_OTEL_LOG_LEVEL,E=y&&A.has(y)?y:"info",_=bBe(e.COPILOT_OTEL_HTTP_INSTRUMENTATION)??!1,v=e.OTEL_SERVICE_NAME??"copilot-chat",b=h_c(e.OTEL_RESOURCE_ATTRIBUTES);return Object.freeze({enabled:!0,enabledExplicitly:o,enabledVia:s,exporterType:h,otlpEndpoint:d,otlpProtocol:l,captureContent:m,maxAttributeSizeChars:g<0?0:g,fileExporterPath:f,dbSpanExporter:r,logLevel:E,httpInstrumentation:_,serviceName:v,serviceVersion:t.extensionVersion,sessionId:t.sessionId,resourceAttributes:b})}a(g_c,"resolveOTelConfig");function U8i(t){return Object.freeze({enabled:!1,enabledExplicitly:!1,enabledVia:"disabled",exporterType:"otlp-http",otlpEndpoint:"",otlpProtocol:"http",captureContent:!1,maxAttributeSizeChars:0,dbSpanExporter:!1,logLevel:"info",httpInstrumentation:!1,serviceName:"copilot-chat",serviceVersion:t.extensionVersion,sessionId:t.sessionId,resourceAttributes:{}})}a(U8i,"createDisabledConfig");function bBe(t){if(t!==void 0)return t==="true"||t==="1"}a(bBe,"envBool");function A_c(t){if(t===void 0||t==="")return;let e=Number(t);if(Number.isSafeInteger(e))return e}a(A_c,"parseMaxAttributeSizeChars")});var yCt=I(ACt=>{"use strict";p();Object.defineProperty(ACt,"__esModule",{value:!0});ACt.IOTelService=void 0;var y_c=nn();ACt.IOTelService=(0,y_c.createServiceIdentifier)("IOTelService")});var Q8i=I(lMr=>{"use strict";p();Object.defineProperty(lMr,"__esModule",{value:!0});lMr.normalizeResponseModel=E_c;function E_c(t,e){if(!e)return;if(!t)return e;let r=a(s=>s.replace(/\./g,"-").toLowerCase(),"canonical"),n=r(t),o=r(e);return n===o||n.startsWith(o+"-")?t:e}a(E_c,"normalizeResponseModel")});var H8i=I(Br=>{"use strict";p();Object.defineProperty(Br,"__esModule",{value:!0});Br.workspaceMetadataToOTelAttributes=Br.resolveWorkspaceOTelMetadata=Br.normalizeResponseModel=Br.IOTelService=Br.DEFAULT_OTLP_ENDPOINT=Br.resolveOTelConfig=Br.NoopOTelService=Br.truncateForOTel=Br.toToolDefinitions=Br.toSystemInstructions=Br.toOutputMessages=Br.toInputMessages=Br.stringifyToolsRawForTelemetry=Br.stringifyToolDefinitionsForOTel=Br.normalizeProviderMessages=Br.extractTextFromContent=Br.collectSystemTextsFromRequestBody=Br.GenAiMetrics=Br.emitUserFeedbackEvent=Br.emitToolCallEvent=Br.emitSessionStartEvent=Br.emitInlineDoneEvent=Br.emitInferenceDetailsEvent=Br.emitEditSurvivalEvent=Br.emitEditHunkActionEvent=Br.emitEditFeedbackEvent=Br.emitCloudSessionInvokeEvent=Br.emitAgentTurnEvent=Br.TOOL_PARAM_COMMAND_MAX_LEN=Br.StdAttr=Br.SHELL_TOOL_NAMES=Br.GitHubCopilotAttr=Br.GenAiToolType=Br.GenAiTokenType=Br.GenAiProviderName=Br.GenAiOperationName=Br.GenAiAttr=Br.FILE_TOOL_NAMES=Br.CopilotCliSdkAttr=Br.CopilotChatAttr=void 0;var zR=CBe();Object.defineProperty(Br,"CopilotChatAttr",{enumerable:!0,get:a(function(){return zR.CopilotChatAttr},"get")});Object.defineProperty(Br,"CopilotCliSdkAttr",{enumerable:!0,get:a(function(){return zR.CopilotCliSdkAttr},"get")});Object.defineProperty(Br,"FILE_TOOL_NAMES",{enumerable:!0,get:a(function(){return zR.FILE_TOOL_NAMES},"get")});Object.defineProperty(Br,"GenAiAttr",{enumerable:!0,get:a(function(){return zR.GenAiAttr},"get")});Object.defineProperty(Br,"GenAiOperationName",{enumerable:!0,get:a(function(){return zR.GenAiOperationName},"get")});Object.defineProperty(Br,"GenAiProviderName",{enumerable:!0,get:a(function(){return zR.GenAiProviderName},"get")});Object.defineProperty(Br,"GenAiTokenType",{enumerable:!0,get:a(function(){return zR.GenAiTokenType},"get")});Object.defineProperty(Br,"GenAiToolType",{enumerable:!0,get:a(function(){return zR.GenAiToolType},"get")});Object.defineProperty(Br,"GitHubCopilotAttr",{enumerable:!0,get:a(function(){return zR.GitHubCopilotAttr},"get")});Object.defineProperty(Br,"SHELL_TOOL_NAMES",{enumerable:!0,get:a(function(){return zR.SHELL_TOOL_NAMES},"get")});Object.defineProperty(Br,"StdAttr",{enumerable:!0,get:a(function(){return zR.StdAttr},"get")});Object.defineProperty(Br,"TOOL_PARAM_COMMAND_MAX_LEN",{enumerable:!0,get:a(function(){return zR.TOOL_PARAM_COMMAND_MAX_LEN},"get")});var IL=O8i();Object.defineProperty(Br,"emitAgentTurnEvent",{enumerable:!0,get:a(function(){return IL.emitAgentTurnEvent},"get")});Object.defineProperty(Br,"emitCloudSessionInvokeEvent",{enumerable:!0,get:a(function(){return IL.emitCloudSessionInvokeEvent},"get")});Object.defineProperty(Br,"emitEditFeedbackEvent",{enumerable:!0,get:a(function(){return IL.emitEditFeedbackEvent},"get")});Object.defineProperty(Br,"emitEditHunkActionEvent",{enumerable:!0,get:a(function(){return IL.emitEditHunkActionEvent},"get")});Object.defineProperty(Br,"emitEditSurvivalEvent",{enumerable:!0,get:a(function(){return IL.emitEditSurvivalEvent},"get")});Object.defineProperty(Br,"emitInferenceDetailsEvent",{enumerable:!0,get:a(function(){return IL.emitInferenceDetailsEvent},"get")});Object.defineProperty(Br,"emitInlineDoneEvent",{enumerable:!0,get:a(function(){return IL.emitInlineDoneEvent},"get")});Object.defineProperty(Br,"emitSessionStartEvent",{enumerable:!0,get:a(function(){return IL.emitSessionStartEvent},"get")});Object.defineProperty(Br,"emitToolCallEvent",{enumerable:!0,get:a(function(){return IL.emitToolCallEvent},"get")});Object.defineProperty(Br,"emitUserFeedbackEvent",{enumerable:!0,get:a(function(){return IL.emitUserFeedbackEvent},"get")});var __c=L8i();Object.defineProperty(Br,"GenAiMetrics",{enumerable:!0,get:a(function(){return __c.GenAiMetrics},"get")});var xL=nMr();Object.defineProperty(Br,"collectSystemTextsFromRequestBody",{enumerable:!0,get:a(function(){return xL.collectSystemTextsFromRequestBody},"get")});Object.defineProperty(Br,"extractTextFromContent",{enumerable:!0,get:a(function(){return xL.extractTextFromContent},"get")});Object.defineProperty(Br,"normalizeProviderMessages",{enumerable:!0,get:a(function(){return xL.normalizeProviderMessages},"get")});Object.defineProperty(Br,"stringifyToolDefinitionsForOTel",{enumerable:!0,get:a(function(){return xL.stringifyToolDefinitionsForOTel},"get")});Object.defineProperty(Br,"stringifyToolsRawForTelemetry",{enumerable:!0,get:a(function(){return xL.stringifyToolsRawForTelemetry},"get")});Object.defineProperty(Br,"toInputMessages",{enumerable:!0,get:a(function(){return xL.toInputMessages},"get")});Object.defineProperty(Br,"toOutputMessages",{enumerable:!0,get:a(function(){return xL.toOutputMessages},"get")});Object.defineProperty(Br,"toSystemInstructions",{enumerable:!0,get:a(function(){return xL.toSystemInstructions},"get")});Object.defineProperty(Br,"toToolDefinitions",{enumerable:!0,get:a(function(){return xL.toToolDefinitions},"get")});Object.defineProperty(Br,"truncateForOTel",{enumerable:!0,get:a(function(){return xL.truncateForOTel},"get")});var v_c=aMr();Object.defineProperty(Br,"NoopOTelService",{enumerable:!0,get:a(function(){return v_c.NoopOTelService},"get")});var q8i=cMr();Object.defineProperty(Br,"resolveOTelConfig",{enumerable:!0,get:a(function(){return q8i.resolveOTelConfig},"get")});Object.defineProperty(Br,"DEFAULT_OTLP_ENDPOINT",{enumerable:!0,get:a(function(){return q8i.DEFAULT_OTLP_ENDPOINT},"get")});var C_c=yCt();Object.defineProperty(Br,"IOTelService",{enumerable:!0,get:a(function(){return C_c.IOTelService},"get")});var b_c=Q8i();Object.defineProperty(Br,"normalizeResponseModel",{enumerable:!0,get:a(function(){return b_c.normalizeResponseModel},"get")});var j8i=iMr();Object.defineProperty(Br,"resolveWorkspaceOTelMetadata",{enumerable:!0,get:a(function(){return j8i.resolveWorkspaceOTelMetadata},"get")});Object.defineProperty(Br,"workspaceMetadataToOTelAttributes",{enumerable:!0,get:a(function(){return j8i.workspaceMetadataToOTelAttributes},"get")})});var fMr=I(X$=>{"use strict";p();Object.defineProperty(X$,"__esModule",{value:!0});X$.AbstractRequestLogger=void 0;X$.getCurrentCapturingToken=x_c;X$.storeCapturingTokenForCorrelation=w_c;X$.retrieveCapturingTokenByCorrelation=R_c;X$.runWithCapturingToken=k_c;var S_c=require("async_hooks"),T_c=lye(),I_c=Ro(),SBe=new S_c.AsyncLocalStorage,uMr=new Map;function x_c(){return SBe.getStore()}a(x_c,"getCurrentCapturingToken");function w_c(t){let e=SBe.getStore();e&&uMr.set(t,e)}a(w_c,"storeCapturingTokenForCorrelation");function R_c(t){let e=uMr.get(t);return e&&uMr.delete(t),e}a(R_c,"retrieveCapturingTokenByCorrelation");function k_c(t,e){return SBe.run(t,e)}a(k_c,"runWithCapturingToken");var dMr=class extends I_c.Disposable{static{a(this,"AbstractRequestLogger")}get promptRendererTracing(){return!1}captureInvocation(e,r){return SBe.run(e,()=>r())}logContentExclusionRules(e,r,n){}logChatRequest(e,r,n){return new T_c.PendingLoggedChatRequest(this,e,r,n)}enableWorkspaceEditTracing(){}disableWorkspaceEditTracing(){}get currentRequest(){return SBe.getStore()}};X$.AbstractRequestLogger=dMr});var G8i=I(pMr=>{"use strict";p();Object.defineProperty(pMr,"__esModule",{value:!0});pMr.isEncryptedThinkingDelta=P_c;function P_c(t){return t.encrypted!==void 0}a(P_c,"isEncryptedThinkingDelta")});var V8i=I(ECt=>{"use strict";p();Object.defineProperty(ECt,"__esModule",{value:!0});ECt.calculateLineRepetitionStats=N_c;ECt.isRepetitive=M_c;var D_c=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60},{max_token_sequence_length:60,last_tokens_to_consider:120}];function N_c(t){if(t.length===0)return{numberOfRepetitions:0,mostRepeatedLine:"",totalLines:0};let e=new Map,r=t.split(` -`);for(let s of r){if(s=s.trim(),s.length===0)continue;let c=e.get(s)||0;e.set(s,c+1)}let n="",o=0;for(let[s,c]of e.entries())c>o&&(o=c,n=s);return{numberOfRepetitions:o,mostRepeatedLine:n,totalLines:r.length}}a(N_c,"calculateLineRepetitionStats");function M_c(t){let e=t.slice();return e.reverse(),$8i(e)||$8i(e.filter(r=>r.trim().length>0))}a(M_c,"isRepetitive");function $8i(t){let e=O_c(t);for(let r of D_c){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(O_c,"kmp_prefix_function")});var hMr=I(wL=>{"use strict";p();var L_c=wL&&wL.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},eV=wL&&wL.__param||function(t,e){return function(r,n){e(r,n,t)}},YR;Object.defineProperty(wL,"__esModule",{value:!0});wL.OpenAIEndpoint=void 0;wL.isBYOKModel=z_c;var B_c=K6(),W8i=jR(),z8i=Pl(),F_c=J$(),U_c=Gne(),Q_c=Sp(),q_c=$6(),j_c=aCt(),H_c=X6(),G_c=mh(),$_c=K$(),V_c=Gs();function W_c(t){return t.type===W8i.ChatFetchResponseType.Failed&&t.streamError?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:JSON.stringify(t.streamError)}:t.type===W8i.ChatFetchResponseType.RateLimited?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:t.capiError?`Rate limit exceeded +`}),this.lastTextDeltaOutputIndex=s.output_index;let c=new gEc.Lazy(()=>new TextEncoder().encode(s.delta));return n({text:s.delta,logprobs:s.logprobs&&{content:s.logprobs.map(l=>({...Z8i(c,l),top_logprobs:l.top_logprobs?.map(u=>Z8i(c,u))||[]}))}})}case"response.output_item.added":if(e.item.type==="function_call")this.toolCallInfo.set(e.output_index,{name:e.item.name,callId:e.item.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:e.item.name,id:e.item.call_id}]});else if(e.item.type.toString()==="tool_search_call"){let s=e.item;s.execution==="client"&&s.call_id&&(this.toolCallInfo.set(e.output_index,{name:d9.CUSTOM_TOOL_SEARCH_NAME,callId:s.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:d9.CUSTOM_TOOL_SEARCH_NAME,id:s.call_id}]}))}return;case"response.function_call_arguments.delta":{let s=this.toolCallInfo.get(e.output_index);s&&(s.arguments+=e.delta,n({text:"",copilotToolCallStreamUpdates:[{id:s.callId,name:s.name,arguments:s.arguments}]}));return}case"response.output_item.done":if(e.item.type==="function_call")this.toolCallInfo.delete(e.output_index),n({text:"",copilotToolCalls:[{id:e.item.call_id,name:e.item.name,arguments:e.item.arguments}],phase:e.item.phase});else if(e.item.type.toString()==="tool_search_call"){let s=e.item;s.execution==="client"&&s.call_id&&(this.toolCallInfo.delete(e.output_index),n({text:"",copilotToolCalls:[{id:s.call_id,name:d9.CUSTOM_TOOL_SEARCH_NAME,arguments:JSON.stringify(s.arguments??{})}]}))}else e.item.type==="reasoning"?n({text:"",thinking:e.item.encrypted_content?{id:e.item.id,text:this.hasReceivedReasoningSummary?void 0:e.item.summary.map(s=>s.text),encrypted:e.item.encrypted_content}:void 0}):e.item.type==="message"&&n({text:"",phase:e.item.phase});return;case"response.reasoning_summary_text.delta":return this.hasReceivedReasoningSummary=!0,n({text:"",thinking:{id:e.item_id,text:e.delta}});case"response.reasoning_summary_part.done":return this.hasReceivedReasoningSummary=!0,n({text:"",thinking:{id:e.item_id}});case"response.completed":{let s=e,c=VEc(s.response.output,this.latestCompactionOutputIndex),l=t6i(c,this.latestCompactionOutputIndex),u=l?.item,d=this.latestCompactionItem;u&&(this.sawCompactionMessage=!0,this.latestCompactionOutputIndex=l.outputIndex);let f=u&&(!d||d.id!==u.id||d.encrypted_content!==u.encrypted_content);if(u&&(this.latestCompactionItem=u),this.compactionThreshold!==void 0&&this.sawCompactionMessage){let h=e.response.usage?.input_tokens??0,m=e.response.usage?.total_tokens??0;(0,hMr.sendResponsesApiCompactionTelemetry)(this.telemetryService,{outcome:"compaction_returned",headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,model:e.response.model},{compactThreshold:this.compactionThreshold,promptTokens:h,totalTokens:m}),this.logService.debug(`[responsesAPI_compaction] Compaction enabled. headerRequestId=${this.requestId}`)}else if(this.compactionThreshold!==void 0&&(e.response.usage?.input_tokens??0)>=this.compactionThreshold){let h=e.response.usage?.input_tokens??0,m=e.response.usage?.total_tokens??0;(0,hMr.sendResponsesApiCompactionTelemetry)(this.telemetryService,{outcome:"threshold_met_no_compaction",headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,model:e.response.model},{compactThreshold:this.compactionThreshold,promptTokens:h,totalTokens:m}),this.logService.debug(`[responsesAPI_compaction] Compaction enabled but context not compacted after threshold was met. headerRequestId=${this.requestId}, gitHubRequestId=${this.ghRequestId}, promptTokens=${h}, totalTokens=${m}`)}return n({text:"",statefulMarker:e.response.id,contextManagement:f?u:void 0}),{blockFinished:!0,choiceIndex:0,model:e.response.model,tokens:[],telemetryData:this.telemetryData,requestId:{headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,completionId:e.response.id,created:e.response.created_at,deploymentId:"",serverExperiments:this.serverExperiments},usage:{prompt_tokens:e.response.usage?.input_tokens??0,completion_tokens:e.response.usage?.output_tokens??0,total_tokens:e.response.usage?.total_tokens??0,prompt_tokens_details:{cached_tokens:e.response.usage?.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.response.usage?.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0},copilot_usage:s.copilot_usage?.total_nano_aiu!==void 0?s.copilot_usage:void 0},finishReason:Qf.FinishedCompletionReason.Stop,message:{role:Zi.Raw.ChatRole.Assistant,content:c.map(h=>{if(h.type==="message")return{type:Zi.Raw.ChatCompletionContentPartKind.Text,text:h.content.map(m=>m.type==="output_text"?m.text:m.refusal).join("")};if(h.type==="image_generation_call"&&h.result)return{type:Zi.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:h.result}}}).filter(xL.isDefined)}}}case"response.incomplete":{let s=e.response,c=s.incomplete_details?.reason,l,u;return c==="max_output_tokens"?l=Qf.FinishedCompletionReason.Length:c==="content_filter"?(l=Qf.FinishedCompletionReason.ContentFilter,u=zEc(s.content_filters)):l=Qf.FinishedCompletionReason.ServerError,this.buildTerminalCompletion(s,l,{filterReason:u,error:J8i(s.error)})}case"response.failed":{let s=e.response;return this.buildTerminalCompletion(s,Qf.FinishedCompletionReason.ServerError,{error:J8i(s.error)})}}}buildTerminalCompletion(e,r,n={}){let o=e.output??[];return{blockFinished:!0,choiceIndex:0,model:e.model,tokens:[],telemetryData:this.telemetryData,requestId:{headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,completionId:e.id,created:e.created_at,deploymentId:"",serverExperiments:this.serverExperiments},usage:e.usage?{prompt_tokens:e.usage.input_tokens??0,completion_tokens:e.usage.output_tokens??0,total_tokens:e.usage.total_tokens??0,prompt_tokens_details:{cached_tokens:e.usage.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.usage.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0}}:void 0,finishReason:r,filterReason:n.filterReason,error:n.error,message:{role:Zi.Raw.ChatRole.Assistant,content:o.map(s=>{if(s.type==="message")return{type:Zi.Raw.ChatCompletionContentPartKind.Text,text:s.content.map(c=>c.type==="output_text"?c.text:c.refusal).join("")};if(s.type==="image_generation_call"&&s.result)return{type:Zi.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:s.result}}}).filter(xL.isDefined)}}}};jv.OpenAIResponsesProcessor=ECt;jv.OpenAIResponsesProcessor=ECt=fEc([pEc(6,EEc.ILogService)],ECt);function Z8i(t,e){let r=[];if(e.token){let n=new TextEncoder().encode(e.token),o=t.value,s=(0,mEc.binaryIndexOf)(o,n);s!==-1&&(r=[s,s+n.length])}return{token:e.token,bytes:r,logprob:e.logprob}}a(Z8i,"mapLogProp")});var n6i=I(vCt=>{"use strict";p();Object.defineProperty(vCt,"__esModule",{value:!0});vCt.ChatWebSocketTelemetrySender=void 0;var EMr=class{static{a(this,"ChatWebSocketTelemetrySender")}static sendConnectedTelemetry(e,r){e.sendTelemetryEvent("websocket.connected",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId},{connectDurationMs:r.connectDurationMs})}static sendConnectErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.connectError",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId,error:r.error,responseStatusText:r.responseStatusText,networkError:r.networkError},{connectDurationMs:r.connectDurationMs,responseStatusCode:r.responseStatusCode})}static sendCloseTelemetry(e,r){e.sendTelemetryEvent("websocket.close",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,closeReason:r.closeReason,closeEventReason:r.closeEventReason,closeEventWasClean:r.closeEventWasClean},{hadActiveRequest:r.hadActiveRequest?1:0,closeCode:r.closeCode,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.error",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,error:r.error},{hadActiveRequest:r.hadActiveRequest?1:0,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendCloseDuringSetupTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.closeDuringSetup",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId,closeReason:r.closeReason,closeEventReason:r.closeEventReason,closeEventWasClean:r.closeEventWasClean},{closeCode:r.closeCode,connectDurationMs:r.connectDurationMs})}static sendRequestSentTelemetry(e,r){e.sendTelemetryEvent("websocket.requestSent",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId},{hadActiveRequest:r.hadActiveRequest?1:0,statefulMarkerMatched:r.statefulMarkerMatched?1:0,previousResponseIdUnset:r.previousResponseIdUnset?1:0,hasCompactionData:r.hasCompactionData?1:0,summarizedAtRoundIdSet:r.summarizedAtRoundIdSet?1:0,summarizedAtRoundIdMatched:r.summarizedAtRoundIdMatched?1:0,modeChanged:r.modeChanged===void 0?-1:r.modeChanged?1:0,compactionThreshold:r.compactionThreshold,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,sentMessageCharacters:r.sentMessageCharacters,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendMessageParseErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.messageParseError",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,error:r.error},{hadActiveRequest:r.hadActiveRequest?1:0,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,receivedMessageCharacters:r.receivedMessageCharacters,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendRequestOutcomeTelemetry(e,r){e.sendTelemetryEvent("websocket.requestOutcome",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,requestOutcome:r.requestOutcome,closeReason:r.closeReason,serverErrorMessage:r.serverErrorMessage,serverErrorCode:r.serverErrorCode},{hadActiveRequest:r.hadActiveRequest?1:0,statefulMarkerMatched:r.statefulMarkerMatched?1:0,previousResponseIdUnset:r.previousResponseIdUnset?1:0,hasCompactionData:r.hasCompactionData?1:0,summarizedAtRoundIdSet:r.summarizedAtRoundIdSet?1:0,summarizedAtRoundIdMatched:r.summarizedAtRoundIdMatched?1:0,modeChanged:r.modeChanged===void 0?-1:r.modeChanged?1:0,compactionThreshold:r.compactionThreshold,promptTokenCount:r.promptTokenCount,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,requestSentMessageCount:r.requestSentMessageCount,requestReceivedMessageCount:r.requestReceivedMessageCount,requestSentCharacters:r.requestSentCharacters,requestReceivedCharacters:r.requestReceivedCharacters,connectionDurationMs:r.connectionDurationMs,requestDurationMs:r.requestDurationMs,closeCode:r.closeCode})}};vCt.ChatWebSocketTelemetrySender=EMr});var f9=I(C1=>{"use strict";p();var YEc=C1&&C1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},CCt=C1&&C1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(C1,"__esModule",{value:!0});C1.ChatWebSocketManager=C1.NullChatWebSocketManager=C1.IChatWebSocketManager=void 0;C1.isCAPIWebSocketError=SMr;var KEc=nn(),JEc=Rs(),bCt=Rc(),i6i=Ro(),o6i=Pl(),ZEc=KE(),Gye=xp(),XEc=vm(),e_c=Sy(),t_c=_Ct(),sV=n6i();C1.IChatWebSocketManager=(0,KEc.createServiceIdentifier)("IChatWebSocketManager");var _Mr=class{static{a(this,"NullChatWebSocketManager")}getOrCreateConnection(e,r,n){throw new Error("WebSocket not available")}hasActiveConnection(e){return!1}getStatefulMarker(e){}getSummarizedAtRoundId(e){}closeConnection(e){}closeAll(){}};C1.NullChatWebSocketManager=_Mr;function SMr(t){return t.type==="error"&&"error"in t&&typeof t.error?.code=="string"}a(SMr,"isCAPIWebSocketError");var r_c={"response.completed":"completed","response.failed":"response_failed","response.incomplete":"response_incomplete","response.cancelled":"response_cancelled",error:"upstream_error"};function n_c(t){return r_c[t.type]}a(n_c,"getStreamTerminatingOutcome");var vMr=class extends i6i.Disposable{static{a(this,"ChatWebSocketManager")}constructor(e,r,n,o){super(),this._logService=e,this._capiClientService=r,this._telemetryService=n,this._configurationService=o,this._connections=new Map}getOrCreateConnection(e,r,n){let o=this._connections.get(e);if(o?.isOpen)return o;o&&(this._logService.debug(`[ChatWebSocketManager] Replacing closed connection for conversation ${e}`),o.dispose(),this._connections.delete(e));let s=new CMr(this._capiClientService,this._logService,this._telemetryService,this._configurationService,e,r,n);return this._logService.debug(`[ChatWebSocketManager] Creating new connection for conversation ${e}`),this._connections.set(e,s),s.onDidDispose(()=>{this._connections.get(e)===s&&this._connections.delete(e)}),s}hasActiveConnection(e){return!!this._connections.get(e)?.isOpen}getStatefulMarker(e){let r=this._connections.get(e);return r?.isOpen?r.statefulMarker:void 0}getSummarizedAtRoundId(e){let r=this._connections.get(e);return r?.isOpen?r.summarizedAtRoundId:void 0}closeConnection(e){let r=this._connections.get(e);r&&(r.hasActiveRequest?this._logService.warn(`[ChatWebSocketManager] Closing connection for conversation ${e} while turn ${r.turnId} still has an active request`):this._logService.debug(`[ChatWebSocketManager] Closing connection for conversation ${e}`),r.dispose(),this._connections.delete(e))}closeAll(){for(let e of this._connections.values())e.dispose();this._connections.clear()}dispose(){this.closeAll(),super.dispose()}};C1.ChatWebSocketManager=vMr;C1.ChatWebSocketManager=vMr=YEc([CCt(0,Gye.ILogService),CCt(1,ZEc.ICAPIClientService),CCt(2,XEc.ITelemetryService),CCt(3,o6i.IConfigurationService)],vMr);function SCt(t){switch(t){case 1e3:return"Normal Closure";case 1001:return"Going Away";case 1002:return"Protocol Error";case 1003:return"Unsupported Data";case 1005:return"No Status Received";case 1006:return"Abnormal Closure";case 1007:return"Invalid Payload";case 1008:return"Policy Violation";case 1009:return"Message Too Big";case 1010:return"Missing Extension";case 1011:return"Internal Error";case 1012:return"Service Restart";case 1013:return"Try Again Later";case 1014:return"Bad Gateway";case 1015:return"TLS Handshake Failed";default:return"Unknown"}}a(SCt,"wsCloseCodeToString");var CMr=class extends i6i.Disposable{static{a(this,"ChatWebSocketConnection")}constructor(e,r,n,o,s,c,l){super(),this._capiClientService=e,this._logService=r,this._telemetryService=n,this._configurationService=o,this._conversationId=s,this._headers=c,this._initiatingRequestId=l,this._state=2,this._onDidDispose=this._register(new bCt.Emitter),this.onDidDispose=this._onDidDispose.event,this._totalSentMessageCount=0,this._totalReceivedMessageCount=0,this._totalSentCharacters=0,this._totalReceivedCharacters=0,this._responseHeaders=new e_c.HeadersImpl({}),this._hadActiveRequest=!1}get isOpen(){return this._state===1&&!!this._ws}get hasActiveRequest(){return!!this._activeRequest}get turnId(){return this._turnId}get statefulMarker(){return this._statefulMarker}get summarizedAtRoundId(){return this._summarizedAtRoundId}get responseHeaders(){return this._responseHeaders}get responseStatusCode(){return this._responseStatusCode}get responseStatusText(){return this._responseStatusText}get gitHubRequestId(){return this._responseHeaders.get("x-github-request-id")||""}async connect(){if(this._state===1)return;this._state=0,this._connectStartTime=Date.now(),this._logService.debug(`[ChatWebSocketManager] Connecting WebSocket for conversation ${this._conversationId}`);let e=await this._capiClientService.createResponsesWebSocket({headers:this._headers});return new Promise((r,n)=>{let o=e.webSocket,s=a(()=>{u(),this._state=1,this._connectedTime=Date.now(),this._ws=o,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText,this._setupMessageHandlers(o);let d=this._connectedTime-(this._connectStartTime??this._connectedTime);this._logService.debug(`[ChatWebSocketManager] Connected for conversation ${this._conversationId}`),sV.ChatWebSocketTelemetrySender.sendConnectedTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,connectDurationMs:d}),r()},"onOpen"),c=a(d=>{u(),this._state=2,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText;let f=d.error?`${d.message}: ${(0,Gye.collectSingleLineErrorMessage)(d.error)}`:d.message||"WebSocket error",h=d.error?.cause??e.networkError,m=h?(0,Gye.collectSingleLineErrorMessage)(h):void 0,g=Date.now()-(this._connectStartTime??Date.now());this._logService.error(`[ChatWebSocketManager] Connection error for conversation ${this._conversationId}: ${f}${m?` (cause: ${m})`:""}`),sV.ChatWebSocketTelemetrySender.sendConnectErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,error:f,connectDurationMs:g,responseStatusCode:this._responseStatusCode,responseStatusText:this._responseStatusText,networkError:m}),n(new Error(f))},"onError"),l=a(d=>{u(),this._state=2,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText;let f=Date.now()-(this._connectStartTime??Date.now()),h=SCt(d.code);this._logService.debug(`[ChatWebSocketManager] Connection closed during setup for conversation ${this._conversationId} (code: ${d.code} ${h}, reason: ${d.reason||""}, wasClean: ${d.wasClean})`),sV.ChatWebSocketTelemetrySender.sendCloseDuringSetupTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,closeCode:d.code,closeReason:h,closeEventReason:d.reason,closeEventWasClean:String(d.wasClean),connectDurationMs:f}),n(new Error("WebSocket closed during connection setup"))},"onClose"),u=a(()=>{o.removeEventListener("open",s),o.removeEventListener("error",c),o.removeEventListener("close",l)},"cleanup");o.addEventListener("open",s),o.addEventListener("error",c),o.addEventListener("close",l)})}_setupMessageHandlers(e){e.addEventListener("message",r=>{if(typeof r.data!="string")return;let n=r.data.length;this._totalReceivedMessageCount+=1,this._totalReceivedCharacters+=n;let o=Date.now()-(this._connectedTime??Date.now()),s;try{s=JSON.parse(r.data)}catch(c){let l=(0,Gye.collectSingleLineErrorMessage)(c)||"Failed to parse websocket message";this._logService.error(`[ChatWebSocketManager] Failed to parse message for conversation ${this._conversationId} turn ${this._turnId}: ${l}`),sV.ChatWebSocketTelemetrySender.sendMessageParseErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,error:l,connectionDurationMs:o,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,receivedMessageCharacters:n,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters});return}!SMr(s)&&s.type==="response.completed"&&(this._statefulMarker=s.response.id,this._summarizedAtRoundId=this._activeRequest?.summarizedAtRoundId),this._activeRequest?.handleEvent(s)}),e.addEventListener("close",r=>{this._state=2;let n=Date.now()-(this._connectedTime??Date.now()),o=SCt(r.code);this._logService.debug(`[ChatWebSocketManager] Connection closed for conversation ${this._conversationId} turn ${this._turnId} (code: ${r.code} ${o}, reason: ${r.reason||""}, wasClean: ${r.wasClean})`),sV.ChatWebSocketTelemetrySender.sendCloseTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,closeCode:r.code,closeReason:o,closeEventReason:r.reason,closeEventWasClean:String(r.wasClean),connectionDurationMs:n,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters});let s=this._pendingErrorMessage;this._pendingErrorMessage=void 0,this._activeRequest?.handleConnectionClose(r.code,r.reason,s),this._activeRequest=void 0}),e.addEventListener("error",r=>{let n=r.error?`${r.message}: ${(0,Gye.collectSingleLineErrorMessage)(r.error)}`:r.message||"WebSocket error",o=Date.now()-(this._connectedTime??Date.now());this._logService.error(`[ChatWebSocketManager] Error for conversation ${this._conversationId} turn ${this._turnId}: ${n}`),sV.ChatWebSocketTelemetrySender.sendErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,error:n,connectionDurationMs:o,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters}),this._pendingErrorMessage??=n})}sendRequest(e,r,n){if(!this._ws||this._state!==1)throw new Error("WebSocket is not connected");let o=this._statefulMarker===e.previous_response_id,s=e.previous_response_id===void 0,c=e.input?.some(O=>O?.type==="compaction")??!1,l=r.summarizedAtRoundId!==void 0,u=r.summarizedAtRoundId===this._summarizedAtRoundId,d=(0,t_c.getResponsesApiCompactionThresholdFromBody)(e),f=this._statefulMarker?.slice(0,5).concat("...")??"",h=e.previous_response_id?.slice(0,5).concat("...")??"";o?this._logService.trace(`[ChatWebSocketManager] WebSocket stateful marker matches previous_response_id (${h}), summarizedAtRoundIdMatched: ${u}`):this._logService.debug(`[ChatWebSocketManager] WebSocket stateful marker (${f}) does not match previous_response_id (${h}), summarizedAtRoundIdMatched: ${u}`);let m=!!this._activeRequest;m?(this._logService.warn(`[ChatWebSocketManager] New request for conversation ${this._conversationId} turn ${r.turnId} while turn ${this._turnId} still has an active request`),this._activeRequest.handleSuperseded()):this._logService.debug(`[ChatWebSocketManager] New request for conversation ${this._conversationId} turn ${r.turnId} (previous turn: ${this._turnId})`);let g=this._turnId,A=r.turnId;this._previousTurnId=g,this._turnId=A,this._hadActiveRequest=m;let y=r.requestId,E=Date.now(),_=this._totalSentMessageCount,v=this._totalReceivedMessageCount,b=this._totalSentCharacters,T=this._totalReceivedCharacters,w=r.countTokens(),R=-1;w.then(O=>{R=O},()=>{R=-2});let x=new bMr(y,r.model,r.summarizedAtRoundId,this._configurationService,this._logService);x.onDidSettle(({outcome:O,closeCode:U,closeReason:q,serverErrorMessage:Q,serverErrorCode:Y})=>{this._activeRequest===x&&(this._activeRequest=void 0);let W=Date.now()-(this._connectedTime??Date.now()),V=Date.now()-E,z=this._totalSentMessageCount-_,ie=this._totalReceivedMessageCount-v,H=this._totalSentCharacters-b,te=this._totalReceivedCharacters-T;sV.ChatWebSocketTelemetrySender.sendRequestOutcomeTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:A,previousTurnId:g,hadActiveRequest:m,requestId:y,gitHubRequestId:this.gitHubRequestId,modelId:r.model,requestOutcome:O,statefulMarkerMatched:o,previousResponseIdUnset:s,hasCompactionData:c,summarizedAtRoundIdSet:l,summarizedAtRoundIdMatched:u,modeChanged:r.modeChanged,compactionThreshold:d,promptTokenCount:R,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,connectionDurationMs:W,requestDurationMs:V,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters,requestSentMessageCount:z,requestReceivedMessageCount:ie,requestSentCharacters:H,requestReceivedCharacters:te,closeCode:U,closeReason:q,serverErrorMessage:Q,serverErrorCode:Y})}),this._activeRequest=x;let P=n.onCancellationRequested(()=>{this._activeRequest===x&&(x.handleCancellation(),this._activeRequest=void 0)});x.done.finally(()=>P.dispose()).catch(()=>{});let{stream:D,...N}=e,L={type:"response.create",...N,initiator:r.userInitiated?"user":"agent"},B=JSON.stringify(L),j=B.length;this._totalSentMessageCount+=1,this._totalSentCharacters+=j;let M=Date.now()-(this._connectedTime??Date.now());return this._logService.debug(`[ChatWebSocketManager] Sending request for conversation ${this._conversationId} turn ${this._turnId} (totalSentMessageCount: ${this._totalSentMessageCount}, sentMessageCharacters: ${j})`),sV.ChatWebSocketTelemetrySender.sendRequestSentTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:A,previousTurnId:g,hadActiveRequest:m,requestId:y,gitHubRequestId:this.gitHubRequestId,modelId:r.model,statefulMarkerMatched:o,previousResponseIdUnset:s,hasCompactionData:c,summarizedAtRoundIdSet:l,summarizedAtRoundIdMatched:u,modeChanged:r.modeChanged,compactionThreshold:d,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,connectionDurationMs:M,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,sentMessageCharacters:j,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters}),this._ws.send(B),x}dispose(){this._activeRequest?.handleConnectionDisposed(),this._activeRequest=void 0,this._ws&&(this._ws.close(),this._ws=void 0),this._state=2,this._onDidDispose.fire(),super.dispose()}},bMr=class{static{a(this,"ChatWebSocketActiveRequest")}constructor(e,r,n,o,s){this.requestId=e,this.modelId=r,this.summarizedAtRoundId=n,this._configurationService=o,this._logService=s,this._onEvent=new bCt.Emitter,this.onEvent=this._onEvent.event,this._onCAPIError=new bCt.Emitter,this.onCAPIError=this._onCAPIError.event,this._onError=new bCt.Emitter,this.onError=this._onError.event,this._firstEventSettled=!1,this._settled=!1,this.done=new Promise((c,l)=>{this._resolve=c,this._reject=l}),this.firstEvent=new Promise((c,l)=>{this._resolveFirstEvent=c,this._rejectFirstEvent=l})}onDidSettle(e){this._onDidSettle=e}handleEvent(e){if(this._settled)return;let r=this._configurationService.getConfig(o6i.ConfigKey.TeamInternal.DebugSimulateWebSocketResponse);if(r)try{e=JSON.parse(r),this._logService.info(`[ChatWebSocketManager] Simulating WebSocket response event: ${r}`)}catch(o){this._logService.error(`[ChatWebSocketManager] Failed to parse simulated WebSocket response: ${(0,Gye.collectSingleLineErrorMessage)(o)}`)}if(this._firstEventSettled||(this._firstEventSettled=!0,this._resolveFirstEvent(e)),SMr(e)){this._finalizeCAPIError(e);return}this._onEvent.fire(e);let n=n_c(e);n&&this._finalizeSuccess(n)}handleConnectionClose(e,r,n){if(this._settled)return;let o=n?new Error(`${n} (close code: ${e} ${SCt(e)}${r?`, reason: ${r}`:""})`):new Error(`WebSocket closed (code: ${e} ${SCt(e)}${r?`, reason: ${r}`:""})`);this._finalizeError("connection_closed",o,e,r)}handleSuperseded(){this._settled||this._finalizeError("superseded",new Error("Request superseded by new request"))}handleCancellation(){this._settled||this._finalizeError("canceled",new JEc.CancellationError)}handleConnectionDisposed(){this._settled||this._finalizeError("connection_disposed",new Error("Connection disposed"))}_finalizeSuccess(e){this._settled=!0,this._onDidSettle?.({outcome:e}),this._resolve(),this._dispose()}_finalizeCAPIError(e){let{code:r,message:n}=e.error;this._onCAPIError.fire(e),this._settled=!0,this._onDidSettle?.({outcome:"error_response",serverErrorMessage:n,serverErrorCode:r}),this._reject(new Error(`${n} (${r})`)),this._dispose()}_finalizeError(e,r,n,o,s,c){this._firstEventSettled||(this._firstEventSettled=!0,this._rejectFirstEvent(r)),this._onError.fire(r),this._settled=!0,this._onDidSettle?.({outcome:e,closeCode:n,closeReason:o,serverErrorMessage:s,serverErrorCode:c}),this._reject(r),this._dispose()}_dispose(){this._onEvent.dispose(),this._onCAPIError.dispose(),this._onError.dispose()}}});var IMr=I(wL=>{"use strict";p();Object.defineProperty(wL,"__esModule",{value:!0});wL.getImageDimensions=i_c;wL.getImageDimensionsFromBytes=o_c;wL.getPngDimensions=s6i;wL.getGifDimensions=a6i;wL.getJpegDimensions=c6i;wL.getWebPDimensions=f6i;wL.getMimeType=m6i;wL.extractImageAttributes=c_c;function i_c(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(m6i(e)){case"image/png":return s6i(e);case"image/gif":return a6i(e);case"image/jpeg":case"image/jpg":return c6i(e);case"image/webp":return f6i(e);default:throw new Error("Unsupported image format")}}a(i_c,"getImageDimensions");function o_c(t,e){switch(s_c(e)){case"image/png":return l6i(t);case"image/gif":return u6i(t);case"image/jpeg":case"image/jpg":return d6i(t);case"image/webp":return p6i(t);default:throw new Error("Unsupported image format")}}a(o_c,"getImageDimensionsFromBytes");function s6i(t){return l6i(TCt(t.slice(0,50)))}a(s6i,"getPngDimensions");function a6i(t){return u6i(TCt(t.slice(0,50)))}a(a6i,"getGifDimensions");function c6i(t){return d6i(TCt(t))}a(c6i,"getJpegDimensions");function l6i(t){if(!h6i(t,0,[137,80,78,71]))throw new Error("Not a valid PNG image.");let e=new DataView(t.buffer,t.byteOffset+16,8);return{width:e.getUint32(0,!1),height:e.getUint32(4,!1)}}a(l6i,"getPngDimensionsFromBytes");function u6i(t){if(!TMr(t,0,"GIF8"))throw new Error("Not a valid GIF image.");let e=new DataView(t.buffer,t.byteOffset+6,4);return{width:e.getUint16(0,!0),height:e.getUint16(2,!0)}}a(u6i,"getGifDimensionsFromBytes");function d6i(t){if(!h6i(t,0,[255,216]))throw new Error("Not a valid JPEG image.");let e=t.length,r=2;for(;r+3=65472&&n<=65474){let s=new DataView(t.buffer,t.byteOffset+r+5,4);return{height:s.getUint16(0,!1),width:s.getUint16(2,!1)}}r+=2+o}throw new Error("JPEG dimensions not found")}a(d6i,"getJpegDimensionsFromBytes");function f6i(t){return p6i(TCt(t))}a(f6i,"getWebPDimensions");function p6i(t){if(!TMr(t,0,"RIFF")||!TMr(t,8,"WEBP"))throw new Error("Not a valid WebP image.");let e=a_c(t,12,4);if(e==="VP8 "){let r=(t[26]|t[27]<<8)&16383,n=(t[28]|t[29]<<8)&16383;return{width:r,height:n}}else if(e==="VP8L"){let r=(t[21]|t[22]<<8)&16383,n=(t[23]|t[24]<<8)&16383;return{width:r,height:n}}else if(e==="VP8X"){let r=((t[24]|t[25]<<8|t[26]<<16)&16777215)+1,n=((t[27]|t[28]<<8|t[29]<<16)&16777215)+1;return{width:r,height:n}}else throw new Error("Unsupported WebP format.")}a(p6i,"getWebPDimensionsFromBytes");function s_c(t){return t?.toLowerCase().split(";")[0].trim()}a(s_c,"normalizeMimeType");function TCt(t){let e=atob(t);return Uint8Array.from(e,r=>r.codePointAt(0)??0)}a(TCt,"base64ToBytes");function h6i(t,e,r){for(let n=0;n]+?)>?\)/,n=/{"use strict";p();Object.defineProperty(ICt,"__esModule",{value:!0});ICt.TokenizerType=void 0;var g6i;(function(t){t.CL100K="cl100k_base",t.O200K="o200k_base",t.Llama3="llama3"})(g6i||(ICt.TokenizerType=g6i={}))});var wMr=I(Kne=>{"use strict";p();Object.defineProperty(Kne,"__esModule",{value:!0});Kne.WorkerWithRpcProxy=Kne.RcpResponseHandler=void 0;Kne.createRpcProxy=A6i;var l_c=require("worker_threads"),xCt=class{static{a(this,"RcpResponseHandler")}constructor(){this.nextId=1,this.handlers=new Map}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};Kne.RcpResponseHandler=xCt;function A6i(t){let e={get:a((r,n)=>(typeof n=="string"&&!r[n]&&(r[n]=(...o)=>t(n,o)),r[n]),"get")};return new Proxy(Object.create(null),e)}a(A6i,"createRpcProxy");var xMr=class{static{a(this,"WorkerWithRpcProxy")}constructor(e,r,n){this.responseHandler=new xCt,this.worker=new l_c.Worker(e,r),this.worker.on("message",async o=>{if("fn"in o)try{let s=await n?.[o.fn].apply(n,o.args);this.worker.postMessage({id:o.id,res:s})}catch(s){this.worker.postMessage({id:o.id,err:s})}else this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=A6i((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}terminate(){this.worker.removeAllListeners(),this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};Kne.WorkerWithRpcProxy=xMr});var y6i=I(ek=>{"use strict";p();Object.defineProperty(ek,"__esModule",{value:!0});ek.SlidingWindowAverage=ek.MovingAverage=ek.Counter=void 0;ek.clamp=d_c;ek.rot=f_c;ek.isPointWithinTriangle=p_c;ek.randomChance=h_c;var u_c=sd();function d_c(t,e,r){return Math.min(Math.max(t,e),r)}a(d_c,"clamp");function f_c(t,e){return(e+t%e)%e}a(f_c,"rot");var RMr=class{static{a(this,"Counter")}constructor(){this._next=0}getNext(){return this._next++}};ek.Counter=RMr;var kMr=class{static{a(this,"MovingAverage")}constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}};ek.MovingAverage=kMr;var PMr=class{static{a(this,"SlidingWindowAverage")}constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){let r=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=r,this._sum+=e,this._n=0&&w>=0&&T+w<1}a(p_c,"isPointWithinTriangle");function h_c(t){return(0,u_c.assert)(t>=0&&t<=1,"p must be between 0 and 1"),Math.random(){"use strict";p();Object.defineProperty(RCt,"__esModule",{value:!0});RCt.TikTokenImpl=void 0;var DMr=JTr(),wCt=y6i(),m_c=GO(),g_c=tIr(),NMr=class t{static{a(this,"TikTokenImpl")}constructor(){this._values=[],this._stats={encodeDuration:new wCt.MovingAverage,textLength:new wCt.MovingAverage,callCount:0}}static get instance(){return this._instance||(this._instance=new t),this._instance}init(e,r,n){let o=this._values.length,s=n?g_c.parseTikTokenBinary:c=>c;return this._values.push((0,DMr.createTokenizer)(s(e),(0,DMr.getSpecialTokensByEncoder)(r),(0,DMr.getRegexByEncoder)(r),64e3)),o}encode(e,r,n){let o=m_c.StopWatch.create(!0),s=this._values[e].encode(r,n);return this._stats.callCount+=1,this._stats.encodeDuration.update(o.elapsed()),this._stats.textLength.update(r.length),s}destroy(e){this._values[e]=void 0}resetStats(){let e=this._stats,r={callCount:e.callCount,encodeDuration:e.encodeDuration.value,textLength:e.textLength.value};return this._stats.encodeDuration=new wCt.MovingAverage,this._stats.textLength=new wCt.MovingAverage,this._stats.callCount=0,r}};RCt.TikTokenImpl=NMr});var cV=I(Dp=>{"use strict";p();var C6i=Dp&&Dp.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},b6i=Dp&&Dp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Dp,"__esModule",{value:!0});Dp.TokenizerProvider=Dp.BaseTokensPerName=Dp.BaseTokensPerMessage=Dp.BaseTokensPerCompletion=Dp.ITokenizerProvider=void 0;Dp.calculateImageTokenCost=BMr;Dp.estimateDocumentTokenCost=T6i;var aV=Io(),A_c=lNr(),y_c=IMr(),E_c=nn(),_6i=Yne(),__c=wMr(),v_c=sd(),v6i=cF(),MMr=Ro(),kCt=LA(),S6i=vm(),OMr=E6i();Dp.ITokenizerProvider=(0,E_c.createServiceIdentifier)("ITokenizerProvider");Dp.BaseTokensPerCompletion=3;Dp.BaseTokensPerMessage=3;Dp.BaseTokensPerName=1;var LMr=class{static{a(this,"TokenizerProvider")}constructor(e,r){this._cl100kTokenizer=new v6i.Lazy(()=>new PCt(e,(0,kCt.join)(__dirname,"./cl100k_base.tiktoken"),"cl100k_base",r)),this._o200kTokenizer=new v6i.Lazy(()=>new PCt(e,(0,kCt.join)(__dirname,"./o200k_base.tiktoken"),"o200k_base",r))}dispose(){this._cl100kTokenizer.rawValue?.dispose(),this._o200kTokenizer.rawValue?.dispose()}acquireTokenizer(e){switch(e.tokenizer){case _6i.TokenizerType.CL100K:return this._cl100kTokenizer.value;case _6i.TokenizerType.O200K:return this._o200kTokenizer.value;default:throw new Error(`Unknown tokenizer: ${e.tokenizer}`)}}};Dp.TokenizerProvider=LMr;Dp.TokenizerProvider=LMr=C6i([b6i(1,S6i.ITelemetryService)],LMr);var PCt=class extends MMr.Disposable{static{a(this,"BPETokenizer")}constructor(e,r,n,o){super(),this._useWorker=e,this._tokenFilePath=r,this._encoderName=n,this._telemetryService=o,this._cache=new A_c.LRUCache(5e3),this.baseTokensPerMessage=Dp.BaseTokensPerMessage,this.baseTokensPerName=Dp.BaseTokensPerName,this.mode=aV.OutputMode.Raw}async countMessagesTokens(e){let r=Dp.BaseTokensPerMessage;for(let n of e)r+=await this.countMessageTokens(n);return r}async tokenize(e){return(await this.ensureTokenizer()).encode(e)}async tokenLength(e){if(typeof e=="string")return this._textTokenLength(e);switch(e.type){case aV.Raw.ChatCompletionContentPartKind.Text:return this._textTokenLength(e.text);case aV.Raw.ChatCompletionContentPartKind.Opaque:return e.tokenUsage||0;case aV.Raw.ChatCompletionContentPartKind.Image:if(e.imageUrl.url.startsWith("data:image/"))try{return BMr(e.imageUrl.url,e.imageUrl.detail)}catch{return this._textTokenLength(e.imageUrl.url)}return this._textTokenLength(e.imageUrl.url);case aV.Raw.ChatCompletionContentPartKind.CacheBreakpoint:return 0;case aV.Raw.ChatCompletionContentPartKind.Document:return T6i(e.documentData.data);default:(0,v_c.assertNever)(e,`unknown content part (${JSON.stringify(e)})`)}}async _textTokenLength(e){if(!e)return 0;let r=this._cache.get(e);return r||(r=(await this.tokenize(e)).length,this._cache.put(e,r)),r}async countMessageTokens(e){return this.baseTokensPerMessage+await this.countMessageObjectTokens((0,aV.toMode)(aV.OutputMode.OpenAI,e))}async countToolTokens(e){let n=0;e.length&&(n+=16);let o=8;for(let s of e)n+=o,n+=await this.countObjectTokens({name:s.name,description:s.description,parameters:s.inputSchema});return Math.floor(n*1.1)}async countMessageObjectTokens(e){let r=0;for(let[n,o]of Object.entries(e))if(o){if(typeof o=="string")r+=await this.tokenLength(o);else if(o){let s=o;if(s.type==="text")r+=await this.tokenLength(s.text);else if(s.type==="image_url"&&s.image_url)if(s.image_url.url.startsWith("data:image/"))try{r+=BMr(s.image_url.url,s.image_url.detail)}catch{r+=await this.tokenLength(s.image_url.url)}else r+=await this.tokenLength(s.image_url.url);else{let c=await this.countMessageObjectTokens(o);n==="tool_calls"&&(c=Math.floor(c*1.5)),r+=c}}n==="name"&&o!==void 0&&(r+=this.baseTokensPerName)}return r}async countObjectTokens(e){let r=0;for(let[n,o]of Object.entries(e))o&&(r+=await this.tokenLength(n),typeof o=="string"?r+=await this.tokenLength(o):o&&(r+=await this.countMessageObjectTokens(o)));return r}ensureTokenizer(){return this._tokenizer??=this.doInitTokenizer(),this._tokenizer}async doInitTokenizer(){let e=(0,kCt.basename)(__dirname)==="dist";if(this._useWorker){let r=(0,kCt.join)(__dirname,"tikTokenizerWorker.js"),n=new __c.WorkerWithRpcProxy(r,{name:`TikToken worker (${this._encoderName})`}),o=await n.proxy.init(this._tokenFilePath,this._encoderName,e),s=(0,MMr.toDisposable)(()=>{n.terminate(),this._store.deleteAndLeak(s),this._tokenizer=void 0}),c;return{encode:a((l,u)=>{let d=n.proxy.encode(o,l,u);return clearTimeout(c),c=setTimeout(()=>s.dispose(),15e3),Math.random()<1/1e3&&n.proxy.resetStats().then(f=>{this._telemetryService.sendMSFTTelemetryEvent("tokenizer.stats",void 0,f)}),d},"encode")}}else{let r=OMr.TikTokenImpl.instance.init(this._tokenFilePath,this._encoderName,e),n=(0,MMr.toDisposable)(()=>{OMr.TikTokenImpl.instance.destroy(r),this._store.deleteAndLeak(n),this._tokenizer=void 0});return this._store.add(n),{encode:a(async(o,s)=>OMr.TikTokenImpl.instance.encode(r,o,s),"encode")}}}};PCt=C6i([b6i(3,S6i.ITelemetryService)],PCt);function BMr(t,e){let{width:r,height:n}=(0,y_c.getImageDimensions)(t);if(e==="low")return 85;if(r>2048||n>2048){let c=2048/Math.max(r,n);r=Math.round(r*c),n=Math.round(n*c)}let o=768/Math.min(r,n);return r=Math.round(r*o),n=Math.round(n*o),Math.ceil(r/512)*Math.ceil(n/512)*170+85}a(BMr,"calculateImageTokenCost");function T6i(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(T6i,"estimateDocumentTokenCost")});var lV=I(DCt=>{"use strict";p();Object.defineProperty(DCt,"__esModule",{value:!0});DCt.IDomainService=void 0;var C_c=nn();DCt.IDomainService=(0,C_c.createServiceIdentifier)("IDomainService")});var NCt=I(Hv=>{"use strict";p();Object.defineProperty(Hv,"__esModule",{value:!0});Hv.HeaderContributors=Hv.IHeaderContributors=Hv.userAgentLibraryHeader=void 0;Hv.stringifyUrlOrRequestMetadata=P_c;Hv.isCAPIRequestMetadata=UMr;Hv.isCAPIEndpoint=D_c;Hv.createCapiRequestBody=N_c;Hv.canRetryOnceNetworkError=x6i;Hv.postRequest=M_c;Hv.getRequest=O_c;var b_c=nn(),S_c=Yne(),T_c=Rs(),I_c=KE(),x_c=vm(),w_c=Sy(),R_c=r9();Hv.userAgentLibraryHeader="X-VSCode-User-Agent-Library-Version";var k_c=30*1e3;function P_c(t){return typeof t=="string"?t:JSON.stringify(t)}a(P_c,"stringifyUrlOrRequestMetadata");function UMr(t){return typeof t!="string"}a(UMr,"isCAPIRequestMetadata");function D_c(t){return UMr(t.urlOrRequestMetadata)}a(D_c,"isCAPIEndpoint");function N_c(t,e,r){let n={messages:(0,R_c.rawMessageToCAPI)(t.messages,r),model:e};return t.postOptions&&Object.assign(n,t.postOptions),n}a(N_c,"createCapiRequestBody");function I6i(t,e){let r=t.get(w_c.IFetcherService),n=t.get(x_c.ITelemetryService),o=t.get(I_c.ICAPIClientService),{requestType:s,endpointOrUrl:c,secretKey:l,intent:u,requestId:d,body:f,additionalHeaders:h,cancelToken:m,useFetcher:g,canRetryOnce:A=!0,location:y}=e,E=typeof c=="string"||"type"in c?{modelMaxPromptTokens:0,urlOrRequestMetadata:c,family:"",tokenizer:S_c.TokenizerType.O200K,acquireTokenizer:a(()=>{throw new Error("Method not implemented.")},"acquireTokenizer"),name:"",version:""}:c,_=e.interactionTypeOverride??u,v={...l?{Authorization:`Bearer ${l}`}:{},"X-Request-Id":d,"OpenAI-Intent":u,"X-GitHub-Api-Version":"2026-01-09",...h,...E.getExtraHeaders?E.getExtraHeaders(y,e.interactionTypeOverride):{}};v["X-Interaction-Type"]=_,v["X-Agent-Task-Id"]=d,E.interceptBody&&E.interceptBody(f);let b=E.getEndpointFetchOptions?.(),T={callSite:`network-request-${u}`,method:s,headers:v,json:f,timeout:k_c,useFetcher:g,suppressIntegrationId:b?.suppressIntegrationId};if(m){let w=r.makeAbortController();m.onCancellationRequested(()=>{n.sendGHTelemetryEvent("networking.cancelRequest",{headerRequestId:d}),w.abort()}),T.signal=w.signal}return UMr(E.urlOrRequestMetadata)?o.makeRequest(T,E.urlOrRequestMetadata):r.fetch(E.urlOrRequestMetadata,T).catch(R=>{if(A&&x6i(R))return n.sendGHTelemetryEvent("networking.disconnectAll"),r.disconnectAll().then(()=>r.fetch(E.urlOrRequestMetadata,T));throw r.isAbortError(R)?new T_c.CancellationError:R})}a(I6i,"networkRequest");function x6i(t){return["ECONNRESET","ETIMEDOUT","ERR_CONNECTION_RESET","ERR_NETWORK_CHANGED","ERR_HTTP2_INVALID_SESSION","ERR_HTTP2_STREAM_CANCEL","ERR_HTTP2_GOAWAY_SESSION","ERR_HTTP2_PROTOCOL_ERROR","ERR_FAILED"].includes(t?.code)}a(x6i,"canRetryOnceNetworkError");function M_c(t,e){return I6i(t,{...e,requestType:"POST"})}a(M_c,"postRequest");function O_c(t,e){return I6i(t,{...e,requestType:"GET"})}a(O_c,"getRequest");Hv.IHeaderContributors=(0,b_c.createServiceIdentifier)("headerContributors");var FMr=class{static{a(this,"HeaderContributors")}constructor(){this.contributors=[]}add(e){this.contributors.push(e)}remove(e){let r=this.contributors.indexOf(e);r!==-1&&this.contributors.splice(r,1)}contributeHeaders(e){for(let r of this.contributors)r.contributeHeaderValues(e)}size(){return this.contributors.length}};Hv.HeaderContributors=FMr});var N6i=I(r_=>{"use strict";p();var L_c=r_&&r_.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),B_c=r_&&r_.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),F_c=r_&&r_.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=1e6){let e=t/1e6,r=Math.floor(e*10)/10;return r%1===0?`${r.toFixed(0)}M`:`${r.toFixed(1)}M`}else{if(t>9e5)return"1M";if(t>=1e3)return`${Math.round(t/1e3)}K`}return t.toString()}a(q_c,"formatTokenCount");function j_c(t){return gl.t("In: {0} \xB7 Out: {1} AICs/1M tokens",w6i(t.default.inputPrice),w6i(t.default.outputPrice))}a(j_c,"formatPricingLabel");var R6i=1e6;function H_c(t){if(!t)return;let e=t.batch_size??R6i,r=R6i/e,n=t.default;if(n&&n.input_price!==void 0&&n.output_price!==void 0){let o={inputPrice:n.input_price*r,outputPrice:n.output_price*r,cachePrice:n.cache_price!==void 0?n.cache_price*r:void 0,cacheWritePrice:n.cache_write_price!==void 0?n.cache_write_price*r:void 0,contextMax:n.context_max},s,c=t.long_context;if(c&&c.input_price!==void 0&&c.output_price!==void 0){let l={inputPrice:c.input_price*r,outputPrice:c.output_price*r,cachePrice:c.cache_price!==void 0?c.cache_price*r:void 0,cacheWritePrice:c.cache_write_price!==void 0?c.cache_write_price*r:void 0,contextMax:c.context_max};(l.inputPrice!==o.inputPrice||l.outputPrice!==o.outputPrice||l.cachePrice!==o.cachePrice||l.cacheWritePrice!==o.cacheWritePrice)&&(s=l)}return{default:o,longContext:s}}}a(H_c,"normalizeTokenPrices")});var z6i=I(xy=>{"use strict";p();var G_c=xy&&xy.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},M6i=xy&&xy.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(xy,"__esModule",{value:!0});xy.AnthropicMessagesProcessor=void 0;xy.buildToolInputSchema=q6i;xy.createMessagesRequestBody=Y_c;xy.rawMessagesToMessagesAPI=j6i;xy.clearAllCacheControl=H6i;xy.addToolsAndSystemCacheControl=G6i;xy.addMessagesApiCacheControl=$6i;xy.processResponseFromMessagesEndpoint=Z_c;xy.processNonStreamingResponseFromMessagesEndpoint=W6i;var gN=Io(),L6i=nl(),$_c=QNr(),QMr=x0(),V_c=JR(),O6i=Pl(),B6i=xp(),$ye=aCt(),F6i=i9(),FBe=r9(),W_c=WNr(),U6i=OBe(),z_c=yh(),Q6i=vm();function q6i(t){if(!t)return{type:"object",properties:{}};let{$schema:e,...r}=t;return{type:"object",properties:{},...r}}a(q6i,"buildToolInputSchema");function Y_c(t,e,r,n){let o=t.get(O6i.IConfigurationService),s=t.get(z_c.IExperimentationService),c=t.get(W_c.IToolDeferralService),l=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(N=>N.function.name===$ye.CUSTOM_TOOL_SEARCH_NAME),u=[],d=[];if(e.requestOptions?.tools)for(let N of e.requestOptions.tools){if(!N.function.name||N.function.name.length===0)continue;let L=e.modelCapabilities?.enableToolSearch&&l&&!c.isNonDeferredTool(N.function.name),B={name:N.function.name,description:N.function.description||"",input_schema:q6i(N.function.parameters),...L?{defer_loading:!0}:{}};(L?d:u).push(B)}let f=[...u,...d],h=e.modelCapabilities?.reasoningEffort,m;if(e.modelCapabilities?.enableThinking){if(n.supportsAdaptiveThinking)m={type:"adaptive",display:"summarized"};else if(n.maxThinkingBudget&&n.minThinkingBudget){let L=e.postOptions.max_tokens??1024,B=n.minThinkingBudget??1024,j=16e30&&(!N||N.includes(j))&&(A=j)}}let y=e.modelCapabilities?.enableContextEditing&&(0,$ye.isAnthropicContextEditingEnabled)(n,o,s)?(0,$ye.getContextManagementFromConfig)(o,s,g):void 0,E=t.get(B6i.ILogService),_=t.get(Q6i.ITelemetryService),v=f.length>0?new Set(f.map(N=>N.name)):void 0,b=j6i(e.messages,l?v:void 0),T=e.interactionTypeOverride==="conversation-subagent",w=(0,$ye.isExtendedCacheTtlEnabled)(n,o,s,e.location,T),R=w?"1h":void 0,P=(0,$ye.isExtendedCacheTtlMessagesEnabled)(w,o,s)?"1h":void 0;H6i(b),$6i(b,P),G6i(f,b,R);let D=b.messages.at(-1);return D&&D.role==="assistant"&&(E.warn(`[messagesAPI] Trailing assistant message detected \u2014 appending synthetic user message to prevent prefill error. Total messages: ${b.messages.length}`),_.sendMSFTTelemetryEvent("messagesApi.trailingAssistantGuard",{model:r,location:V_c.ChatLocation.toString(e.location)},{messageCount:b.messages.length}),b.messages.push({role:"user",content:[{type:"text",text:"Please continue."}]})),{model:r,...b,stream:e.requestOptions?.stream??!0,tools:f.length>0?f:void 0,max_tokens:e.postOptions.max_tokens,thinking:m,...A?{output_config:{effort:A}}:{},...y?{context_management:y}:{}}}a(Y_c,"createMessagesRequestBody");function j6i(t,e){let r=[],n=[],o=new Map;for(let c of t)switch(c.role){case gN.Raw.ChatRole.System:{n.push(...MCt(c.content).filter(l=>l.type==="text"));break}case gN.Raw.ChatRole.User:{let l=MCt(c.content);l.length>0&&r.push({role:"user",content:l});break}case gN.Raw.ChatRole.Assistant:{let l=MCt(c.content);if(c.toolCalls)for(let u of c.toolCalls){let d={};try{d=JSON.parse(u.function.arguments)}catch{}l.push({type:"tool_use",id:u.id,name:u.function.name,input:d}),o.set(u.id,u.function.name)}l.length>0&&r.push({role:"assistant",content:l});break}case gN.Raw.ChatRole.Tool:{if(c.toolCallId){let l=MCt(c.content),u=!1;for(let g of l)UBe(g)&&g.cache_control&&(u=!0,delete g.cache_control);let h=(e&&o.get(c.toolCallId)===$ye.CUSTOM_TOOL_SEARCH_NAME?K_c(l,e):void 0)??l.filter(g=>(g.type==="text"||g.type==="image"||g.type==="document")&&!(g.type==="text"&&g.text.trim()==="")),m={type:"tool_result",tool_use_id:c.toolCallId,content:h.length>0?h:void 0};u&&(m.cache_control={type:"ephemeral"}),r.push({role:"user",content:[m]})}break}}let s=[];for(let c of r){let l=s[s.length-1];if(l&&l.role===c.role){let u=Array.isArray(l.content)?l.content:[{type:"text",text:l.content}],d=Array.isArray(c.content)?c.content:[{type:"text",text:c.content}];l.content=[...u,...d]}else s.push(c)}return{messages:s,...n.length?{system:n}:{}}}a(j6i,"rawMessagesToMessagesAPI");function K_c(t,e){if(t.length!==1||t[0].type!=="text")return;let r;try{r=JSON.parse(t[0].text)}catch{return}if(Array.isArray(r))return r.filter(n=>typeof n=="string"&&(!e||e.has(n))).map(n=>({type:"tool_reference",tool_name:n}))}a(K_c,"tryParseToolReferences");function MCt(t){let e=[],r=!1;for(let n of t){switch(n.type){case gN.Raw.ChatCompletionContentPartKind.Text:n.text.trim()&&e.push({type:"text",text:n.text});break;case gN.Raw.ChatCompletionContentPartKind.Image:{let o=n.imageUrl.url,s=o.match(/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/);s?e.push({type:"image",source:{type:"base64",media_type:s[1],data:s[2]}}):o.startsWith("https://")&&e.push({type:"image",source:{type:"url",url:o}});break}case gN.Raw.ChatCompletionContentPartKind.CacheBreakpoint:{let o=e.at(-1);o&&UBe(o)?o.cache_control={type:"ephemeral"}:r=!0;break}case gN.Raw.ChatCompletionContentPartKind.Document:{n.documentData.mediaType==="application/pdf"&&e.push({type:"document",source:{type:"base64",media_type:"application/pdf",data:n.documentData.data}});break}case gN.Raw.ChatCompletionContentPartKind.Opaque:{if(n.value&&typeof n.value=="object"&&"type"in n.value){let o=n.value;if(o.type==="thinking"&&o.thinking){let s=Array.isArray(o.thinking.text)?o.thinking.text.join(""):o.thinking.text;o.thinking.redacted&&o.thinking.encrypted?e.push({type:"redacted_thinking",data:o.thinking.encrypted}):o.thinking.encrypted&&e.push({type:"thinking",thinking:s||"",signature:o.thinking.encrypted})}}break}}if(r&&e.length>0){let o=e.at(-1);UBe(o)&&(o.cache_control={type:"ephemeral"},r=!1)}}return e}a(MCt,"rawContentToAnthropicContent");function UBe(t){return t.type!=="thinking"&&t.type!=="redacted_thinking"}a(UBe,"contentBlockSupportsCacheControl");function H6i(t){if(t.system)for(let e of t.system)delete e.cache_control;for(let e of t.messages)if(Array.isArray(e.content))for(let r of e.content)typeof r=="object"&&"cache_control"in r&&delete r.cache_control}a(H6i,"clearAllCacheControl");function G6i(t,e,r){let n=r?{type:"ephemeral",ttl:r}:{type:"ephemeral"};for(let s=t.length-1;s>=0;s--)if(!t[s].defer_loading){t[s].cache_control=n;break}let o=e.system?.at(-1);o&&!o.cache_control&&(o.cache_control=n)}a(G6i,"addToolsAndSystemCacheControl");function $6i(t,e){let r=t.messages,n=0;for(let o=r.length-1;o>=0&&n<2;o--){let s=r[o];Array.isArray(s.content)&&s.content.some(c=>typeof c=="object"&&UBe(c))&&(J_c(s,e),n++)}}a($6i,"addMessagesApiCacheControl");function J_c(t,e){if(Array.isArray(t.content))for(let r=t.content.length-1;r>=0;r--){let n=t.content[r];if(typeof n=="object"&&UBe(n)){n.cache_control=e?{type:"ephemeral",ttl:e}:{type:"ephemeral"};return}}}a(J_c,"markLastCacheableBlock");async function Z_c(t,e,r,n,o,s){return(n.headers.get("content-type")??"").includes("text/event-stream")?new L6i.AsyncIterableObject(async l=>{let u=n.headers.get("X-Request-ID")??(0,QMr.generateUuid)(),d=n.headers.get("x-github-request-id")??"",{serverExperiments:f}=(0,F6i.getRequestId)(n.headers),h=t.createInstance(OCt,s,u,d,f),m=new $_c.SSEParser(g=>{try{r.trace(`[messagesAPI]SSE: ${g.data}`);let A=g.data?.trim();if(!A||A==="[DONE]")return;let y=JSON.parse(A),E=y.type??g.type;if(!E)return;let _=h.push({...y,type:E},o);if(_){r.info(`[messagesAPI] message ${_.choiceIndex} returned. finish reason: [${_.finishReason}]`);let v=s.extendedBy({completionChoiceFinishReason:_.finishReason,headerRequestId:_.requestId.headerRequestId});e.sendGHTelemetryEvent("completion.finishReason",v.properties,v.measurements);let b=(0,FBe.rawMessageToCAPI)(_.message),T=s;_.usage&&(T=s.extendedBy({},{promptTokens:_.usage.prompt_tokens,completionTokens:_.usage.completion_tokens,totalTokens:_.usage.total_tokens,..._.usage.prompt_tokens_details&&{cachedTokens:_.usage.prompt_tokens_details.cached_tokens},..._.usage.completion_tokens_details&&{reasoningTokens:_.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:_.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:_.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,U6i.sendEngineMessagesTelemetry)(e,[b],T,!0,r),l.emitOne(_)}}catch(A){l.reject(A)}});for await(let g of n.body)m.feed(g)},async()=>{await n.body.destroy()}):W6i(e,r,n,o,s)}a(Z_c,"processResponseFromMessagesEndpoint");function X_c(t){switch(t){case"refusal":return FBe.FinishedCompletionReason.ClientDone;case"max_tokens":case"model_context_window_exceeded":return FBe.FinishedCompletionReason.Length;default:return FBe.FinishedCompletionReason.Stop}}a(X_c,"mapStopReason");function V6i(t,e){let r=t.inputTokens+t.cacheCreationTokens+t.cacheReadTokens;return r0?{toolCalls:t.toolCalls.map(n=>({id:n.id,type:"function",function:{name:n.name,arguments:n.arguments}}))}:{}}}}a(V6i,"buildAnthropicCompletion");async function W6i(t,e,r,n,o){return new L6i.AsyncIterableObject(async s=>{let{headerRequestId:c,serverExperiments:l}=(0,F6i.getRequestId)(r.headers),u=c||(0,QMr.generateUuid)(),d=r.headers.get("x-github-request-id")??"",f=await r.text(),h;try{h=JSON.parse(f)}catch(T){s.reject(new Error(`Failed to parse non-streaming Anthropic response: ${T instanceof Error?T.message:String(T)}`));return}if(h.type==="error"){s.reject(new Error(`Anthropic API error: ${h.error?.message??"Unknown error"}`));return}let m="",g=[];for(let T of h.content??[])switch(T.type){case"text":m+=T.text;break;case"tool_use":g.push({id:T.id,name:T.name,arguments:JSON.stringify(T.input)});break;case"thinking":case"redacted_thinking":break;default:{let w=T.type;e.warn(`[messagesAPI] non-streaming: unknown content_block type '${w}' for model ${h.model}`),t.sendMSFTTelemetryEvent("messagesApi.unknownContentBlock",{requestId:u,model:h.model,blockType:w});break}}let A={text:m,...g.length>0?{copilotToolCalls:g.map(T=>({id:T.id,name:T.name,arguments:T.arguments}))}:{}};await n(m,0,A),h.stop_reason==="refusal"&&(e.warn(`[messagesAPI] non-streaming: Refusal received for model ${h.model}`),t.sendMSFTTelemetryEvent("messagesApi.refusal",{requestId:u,model:h.model,category:"unknown"}));let y=h.usage,E=V6i({model:h.model,messageId:h.id,stopReason:h.stop_reason,textContent:m,toolCalls:g,inputTokens:y?.input_tokens??0,outputTokens:y?.output_tokens??0,cacheCreationTokens:y?.cache_creation_input_tokens??0,cacheCreation1hTokens:y?.cache_creation?.ephemeral_1h_input_tokens,cacheCreation5mTokens:y?.cache_creation?.ephemeral_5m_input_tokens,cacheReadTokens:y?.cache_read_input_tokens??0,thinkingTokens:y?.output_tokens_details?.thinking_tokens,requestId:u,ghRequestId:d,serverExperiments:l,telemetryData:o},e);e.info(`[messagesAPI] non-streaming message returned. finish reason: [${E.finishReason}]`);let _=o.extendedBy({completionChoiceFinishReason:E.finishReason,headerRequestId:E.requestId.headerRequestId});t.sendGHTelemetryEvent("completion.finishReason",_.properties,_.measurements);let v=(0,FBe.rawMessageToCAPI)(E.message),b=o;E.usage&&(b=o.extendedBy({},{promptTokens:E.usage.prompt_tokens,completionTokens:E.usage.completion_tokens,totalTokens:E.usage.total_tokens,...E.usage.prompt_tokens_details&&{cachedTokens:E.usage.prompt_tokens_details.cached_tokens},...E.usage.completion_tokens_details&&{reasoningTokens:E.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:E.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:E.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,U6i.sendEngineMessagesTelemetry)(t,[v],b,!0,e),s.emitOne(E)},async()=>{await r.body.destroy()})}a(W6i,"processNonStreamingResponseFromMessagesEndpoint");var OCt=class{static{a(this,"AnthropicMessagesProcessor")}constructor(e,r,n,o,s,c){this.telemetryData=e,this.requestId=r,this.ghRequestId=n,this.serverExperiments=o,this.logService=s,this.telemetryService=c,this.textAccumulator="",this.toolCallAccumulator=new Map,this.thinkingAccumulator=new Map,this.completedToolCalls=[],this.messageId="",this.model="",this.inputTokens=0,this.outputTokens=0,this.cacheCreationTokens=0,this.cacheReadTokens=0}extractIPCodeCitations(e){if(!e?.IPCodeCitations?.length)return[];let r=new Set,n=[];for(let o of e.IPCodeCitations){let s=o.citations;if(!s)continue;let{url:c,license:l,snippet:u}=s;typeof c!="string"||c.trim()===""||typeof l!="string"||l.trim()===""||typeof u!="string"||u.trim()===""||r.has(c)||(r.add(c),n.push({citations:{url:c,license:l,snippet:u}}))}return n.length>0&&this.logService.trace(`[messagesAPI] IP code citations found: ${n.length} unique citations`),n}push(e,r){let n=a(o=>{this.textAccumulator+=o.text,r(this.textAccumulator,0,o)},"onProgress");switch(e.type){case"message_start":e.message&&(this.messageId=e.message.id,this.model=e.message.model,this.inputTokens=e.message.usage.input_tokens??0,this.outputTokens=e.message.usage.output_tokens??0,this.cacheCreationTokens=e.message.usage.cache_creation_input_tokens??0,this.cacheCreation1hTokens=e.message.usage.cache_creation?.ephemeral_1h_input_tokens??this.cacheCreation1hTokens,this.cacheCreation5mTokens=e.message.usage.cache_creation?.ephemeral_5m_input_tokens??this.cacheCreation5mTokens,this.cacheReadTokens=e.message.usage.cache_read_input_tokens??0,this.thinkingTokens=e.message.usage.output_tokens_details?.thinking_tokens??this.thinkingTokens);return;case"content_block_start":if(e.content_block?.type==="tool_use"&&e.index!==void 0){let o=e.content_block.id||(0,QMr.generateUuid)();this.toolCallAccumulator.set(e.index,{id:o,name:e.content_block.name||"",arguments:""}),this.textAccumulator.length&&n({text:" "}),n({text:"",beginToolCalls:[{name:e.content_block.name||"",id:o}]})}else if(e.content_block?.type==="thinking"&&e.index!==void 0)this.thinkingAccumulator.set(e.index,{thinking:"",signature:""});else if(e.content_block?.type==="redacted_thinking"&&e.index!==void 0){let o=e.content_block.data;n({text:"",thinking:{id:`thinking_${e.index}`,encrypted:o,redacted:!0}})}return;case"content_block_delta":if(e.delta){if(e.delta.type==="text_delta"&&e.delta.text){let o=this.extractIPCodeCitations(e.copilot_annotations);return o.length>0?n({text:e.delta.text,ipCitations:o}):n({text:e.delta.text})}else if(e.delta.type==="thinking_delta"&&e.delta.thinking&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);return o&&(o.thinking+=e.delta.thinking),n({text:"",thinking:{id:`thinking_${e.index}`,text:e.delta.thinking}})}else if(e.delta.type==="signature_delta"&&e.delta.signature&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.signature+=e.delta.signature)}else if(e.delta.type==="input_json_delta"&&e.delta.partial_json&&e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(o.arguments+=e.delta.partial_json,n({text:"",copilotToolCallStreamUpdates:[{id:o.id,name:o.name,arguments:o.arguments}]}))}}return;case"content_block_stop":if(e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(this.completedToolCalls.push(o),n({text:"",copilotToolCalls:[{id:o.id,name:o.name,arguments:o.arguments}]}),this.toolCallAccumulator.delete(e.index));let s=this.thinkingAccumulator.get(e.index);s&&s.signature&&(n({text:"",thinking:{id:`thinking_${e.index}`,encrypted:s.signature}}),this.thinkingAccumulator.delete(e.index))}return;case"message_delta":if(e.usage&&(this.outputTokens=e.usage.output_tokens,this.inputTokens=e.usage.input_tokens??this.inputTokens,this.cacheCreationTokens=e.usage.cache_creation_input_tokens??this.cacheCreationTokens,this.cacheCreation1hTokens=e.usage.cache_creation?.ephemeral_1h_input_tokens??this.cacheCreation1hTokens,this.cacheCreation5mTokens=e.usage.cache_creation?.ephemeral_5m_input_tokens??this.cacheCreation5mTokens,this.cacheReadTokens=e.usage.cache_read_input_tokens??this.cacheReadTokens,this.thinkingTokens=e.usage.output_tokens_details?.thinking_tokens??this.thinkingTokens),e.copilot_usage&&typeof e.copilot_usage.total_nano_aiu=="number"&&(this.copilotUsage=e.copilot_usage),e.context_management)return this.contextManagementResponse=e.context_management,n({text:"",contextManagement:e.context_management});e.delta?.stop_reason&&(this.stopReason=e.delta.stop_reason),e.delta?.stop_details&&(this.stopDetails=e.delta.stop_details);return;case"message_stop":{if(this.contextManagementResponse){let o=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_input_tokens||0),0),s=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_tool_uses||0),0),c=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_thinking_turns||0),0);this.logService.trace(`[messagesAPI] Anthropic context editing applied: cleared ${o} tokens, ${s} tool uses.`),this.telemetryService.sendMSFTTelemetryEvent("contextEditingApplied",{requestId:this.requestId,interactionId:this.requestId,model:this.model},{clearedTokens:o,clearedToolUses:s,clearedThinkingTurns:c})}if(this.stopReason==="refusal"){let o=this.stopDetails?.category??"unknown";this.logService.warn(`[messagesAPI] Refusal received: category='${o}' for model ${this.model}`),this.telemetryService.sendMSFTTelemetryEvent("messagesApi.refusal",{requestId:this.requestId,model:this.model,category:o})}return V6i({model:this.model,messageId:this.messageId,stopReason:this.stopReason,textContent:this.textAccumulator,toolCalls:this.completedToolCalls,inputTokens:this.inputTokens,outputTokens:this.outputTokens,cacheCreationTokens:this.cacheCreationTokens,cacheCreation1hTokens:this.cacheCreation1hTokens,cacheCreation5mTokens:this.cacheCreation5mTokens,cacheReadTokens:this.cacheReadTokens,thinkingTokens:this.thinkingTokens,requestId:this.requestId,ghRequestId:this.ghRequestId,serverExperiments:this.serverExperiments,telemetryData:this.telemetryData,copilotUsage:this.copilotUsage},this.logService)}case"error":{let o=e.error?.message||"Unknown error";return n({text:"",copilotErrors:[{agent:"anthropic",code:"unknown",message:o,type:"error",identifier:void 0}]})}}}};xy.AnthropicMessagesProcessor=OCt;xy.AnthropicMessagesProcessor=OCt=G_c([M6i(4,B6i.ILogService),M6i(5,Q6i.ITelemetryService)],OCt)});var Y6i=I(p9=>{"use strict";p();var evc=p9&&p9.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),tvc=p9&&p9.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),rvc=p9&&p9.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=0;l--)if(t[l].role===Jne.Raw.ChatRole.User){r=l;break}r===-1&&t.length>0&&(r=t.length-1);let n=0;for(let l=Math.max(r,0);le)throw new Error(nvc.t("Too many images in request: {0} images provided, but the model supports a maximum of {1} images.",n,e));let s=e-n,c=new Map;for(let l=r-1;l>=0;l--)if(Array.isArray(t[l].content)){for(let u=t[l].content.length-1;u>=0;u--)if(t[l].content[u].type===Jne.Raw.ChatCompletionContentPartKind.Image){let d=`${l}:${u}`;s>0?(c.set(d,!0),s--):c.set(d,!1)}}return t.map((l,u)=>u>=r||!Array.isArray(l.content)||!l.content.some(d=>d.type===Jne.Raw.ChatCompletionContentPartKind.Image)?l:{...l,content:l.content.map((d,f)=>d.type!==Jne.Raw.ChatCompletionContentPartKind.Image||c.get(`${u}:${f}`)?d:{type:Jne.Raw.ChatCompletionContentPartKind.Text,text:ivc})})}a(ovc,"filterHistoryImages")});var Xne=I(b1=>{"use strict";p();var e9i=b1&&b1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Qm=b1&&b1.__param||function(t,e){return function(r,n){e(r,n,t)}},HMr;Object.defineProperty(b1,"__esModule",{value:!0});b1.RemoteAgentChatEndpoint=b1.ChatEndpoint=void 0;b1.defaultChatResponseProcessor=$Mr;b1.defaultNonStreamChatResponseProcessor=l9i;var qMr=(Nne(),Qa(Dne)),K6i=Io(),svc=Yne(),t9i=nl(),J6i=CXe(),avc=x0(),r9i=$s(),cvc=HE(),n9i=l9(),lvc=JR(),uvc=IBe(),Zne=Pl(),i9i=xp(),Z6i=aCt(),dvc=i9(),fvc=Sy(),pvc=NCt(),hvc=OBe(),o9i=f9(),mvc=hCt(),s9i=yh(),gvc=vm(),a9i=cV(),Avc=KE(),QBe=kBe(),c9i=lV(),qBe=R4e(),yvc=N6i(),X6i=z6i(),jMr=_Ct(),Evc=Y6i();async function $Mr(t,e,r,n,o,s,c){let u=(await mvc.SSEProcessor.create(e,t,n,r,c)).processSSE(o);return t9i.AsyncIterableObject.map(u,f=>{let h=f.reason??"client-trimmed",m=s.extendedBy({completionChoiceFinishReason:h,headerRequestId:f.requestId.headerRequestId});return t.sendGHTelemetryEvent("completion.finishReason",m.properties,m.measurements),(0,hvc.prepareChatCompletionForReturn)(t,e,f,s)})}a($Mr,"defaultChatResponseProcessor");async function l9i(t,e,r){let n=await t.text(),o=JSON.parse(n),s=[];for(let c=0;c<(o?.choices?.length||0);c++){let l=o.choices[c],u={role:l.message.role,content:l.message.content,name:l.message.name,toolCalls:l.message.toolCalls??l.message.tool_calls},d=(0,uvc.getTextPart)(u.content),f=t.headers.get("X-Request-ID")??(0,avc.generateUuid)(),h=t.headers.get("x-github-request-id")??"",{serverExperiments:m}=(0,dvc.getRequestId)(t.headers),g={blockFinished:!1,choiceIndex:c,model:o.model,filterReason:void 0,finishReason:l.finish_reason,message:u,usage:o.usage,tokens:[],requestId:{headerRequestId:f,gitHubRequestId:h,completionId:o.id,created:o.created,deploymentId:"",serverExperiments:m},telemetryData:r},A=[];for(let y of u.toolCalls??[])A.push({name:y.function?.name??"",arguments:y.function?.arguments??"",id:y.id??""});await e(d,c,{text:d,copilotToolCalls:A}),s.push(g)}return t9i.AsyncIterableObject.fromArray(s)}a(l9i,"defaultNonStreamChatResponseProcessor");var LCt=HMr=class{static{a(this,"ChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d){this.modelMetadata=e,this._domainService=r,this._chatMLFetcher=n,this._tokenizerProvider=o,this._instantiationService=s,this._configurationService=c,this._expService=l,this._chatWebSocketService=u,this._maxTokens=e.capabilities.limits?.max_prompt_tokens??8192,this._maxOutputTokens=e.capabilities.limits?.max_output_tokens??4096,this.model=e.id,this.modelProvider=e.vendor,this.name=e.name,this.version=e.version;let f=(0,QBe.getModelCapabilityOverride)(this.model,this._configurationService);this.family=f?.family??e.capabilities.family,this.tokenizer=e.capabilities.tokenizer??svc.TokenizerType.O200K,this.showInModelPicker=e.model_picker_enabled,this.isPremium=e.billing?.is_premium,this.multiplier=e.billing?.multiplier,this.restrictedToSkus=e.billing?.restricted_to;let h=(0,yvc.normalizeTokenPrices)(e.billing?.token_prices);this.tokenPricing=h?{default:{inputPrice:h.default.inputPrice,outputPrice:h.default.outputPrice,cacheReadTokenPrice:h.default.cachePrice,cacheWriteTokenPrice:h.default.cacheWritePrice,contextMax:h.default.contextMax},longContext:h.longContext?{inputPrice:h.longContext.inputPrice,outputPrice:h.longContext.outputPrice,cacheReadTokenPrice:h.longContext.cachePrice,cacheWriteTokenPrice:h.longContext.cacheWritePrice,contextMax:h.longContext.contextMax}:void 0}:void 0,this.priceCategory=e.model_picker_price_category,this.modelPickerCategory=e.model_picker_category,this.isFallback=e.is_chat_fallback,this.supportsToolCalls=!!e.capabilities.supports.tool_calls,this.supportsVision=!!e.capabilities.supports.vision,this.supportsPrediction=!!e.capabilities.supports.prediction,this.supportsAdaptiveThinking=e.capabilities.supports.adaptive_thinking,this.minThinkingBudget=e.capabilities.supports.min_thinking_budget,this.maxThinkingBudget=e.capabilities.supports.max_thinking_budget,this.supportsReasoningEffort=e.capabilities.supports.reasoning_effort,this.supportsToolSearch=e.capabilities.supports.tool_search??(0,QBe.modelSupportsToolSearch)(this),this.supportsContextEditing=e.capabilities.supports.context_editing??(0,QBe.modelSupportsContextEditing)(this),this._supportsStreaming=!!e.capabilities.supports.streaming,this.customModel=e.custom_model,this.maxPromptImages=e.capabilities.limits?.vision?.max_prompt_images}getExtraHeaders(e,r){let n={...this.modelMetadata.requestHeaders};if(this.useMessagesApi){let o=this._configurationService.getConfig(Zne.ConfigKey.TeamInternal.ModelProviderPreference);o&&(n["X-Model-Provider-Preference"]=o)}return Object.assign(n,this.getAnthropicBetaHeader(e,r)),n}getAnthropicBetaHeader(e,r){if(!this.useMessagesApi)return{};let n=[];this.supportsAdaptiveThinking||n.push("interleaved-thinking-2025-05-14"),this.supportsToolSearch&&n.push("advanced-tool-use-2025-11-20"),(0,Z6i.isAnthropicContextEditingEnabled)(this,this._configurationService,this._expService)&&n.push("context-management-2025-06-27");let o=r==="conversation-subagent";return(0,Z6i.isExtendedCacheTtlEnabled)(this,this._configurationService,this._expService,e,o)&&n.push("extended-cache-ttl-2025-04-11"),n.length>0?{"anthropic-beta":n.join(",")}:{}}get modelMaxPromptTokens(){return this._maxTokens}get maxOutputTokens(){return this._maxOutputTokens}get urlOrRequestMetadata(){return this.modelMetadata.urlOrRequestMetadata??(this.useResponsesApi?{type:qMr.RequestType.ChatResponses}:this.useMessagesApi?{type:qMr.RequestType.ChatMessages}:{type:qMr.RequestType.ChatCompletions})}get useResponsesApi(){return this.modelMetadata.supported_endpoints&&!this.modelMetadata.supported_endpoints.includes(qBe.ModelSupportedEndpoint.ChatCompletions)&&this.modelMetadata.supported_endpoints.includes(qBe.ModelSupportedEndpoint.Responses)?!0:!!this.modelMetadata.supported_endpoints?.includes(qBe.ModelSupportedEndpoint.Responses)}get useWebSocketResponsesApi(){return!!this.modelMetadata.supported_endpoints?.includes(qBe.ModelSupportedEndpoint.WebSocketResponses)}get useMessagesApi(){return!!(this._configurationService.getExperimentBasedConfig(Zne.ConfigKey.UseAnthropicMessagesApi,this._expService)&&this.modelMetadata.supported_endpoints?.includes(qBe.ModelSupportedEndpoint.Messages))}get degradationReason(){return this.modelMetadata.warning_messages?.at(0)?.message??this.modelMetadata.info_messages?.at(0)?.message}get apiType(){return this.useResponsesApi?"responses":this.useMessagesApi?"messages":"chatCompletions"}interceptBody(e){if(e&&!this.supportsToolCalls&&delete e.tools,e&&!this._supportsStreaming&&(e.stream=!1),e?.messages&&(this.family.startsWith("o1")||this.model==="o1"||this.model==="o1-mini")){let r=e.messages.map(n=>n.role===K6i.OpenAI.ChatRole.System?{role:K6i.OpenAI.ChatRole.User,content:n.content}:n);e.messages=r}}createRequestBody(e){let r=this.getImageLimit();if(r!==void 0&&(e={...e,messages:this.validateAndFilterImages(e.messages,r)}),this.useResponsesApi){let n=this._instantiationService.invokeFunction(jMr.createResponsesRequestBody,e,this.model,this);return this.customizeResponsesBody(n)}else if(this.useMessagesApi){let n=this._instantiationService.invokeFunction(X6i.createMessagesRequestBody,e,this.model,this);return this.customizeMessagesBody(n)}else{let n=(0,pvc.createCapiRequestBody)(e,this.model,this.getCompletionsCallback());return this.customizeCapiBody(n,e)}}getImageLimit(){if(this.useMessagesApi&&(0,QBe.isAnthropicFamily)(this))return 20;if((0,QBe.isGeminiFamily)(this))return 10}validateAndFilterImages(e,r){return(0,Evc.filterHistoryImages)(e,r)}getCompletionsCallback(){}customizeMessagesBody(e){return e}customizeResponsesBody(e){return e}customizeCapiBody(e,r){if(!!r.requestOptions?.tools?.length&&this.family.toLowerCase().includes("gemini-3")){let o=this._configurationService.getExperimentBasedConfig(Zne.ConfigKey.TeamInternal.GeminiFunctionCallingMode,this._expService);o&&typeof e.tool_choice!="object"&&(e.tool_choice=o)}return this.family.toLowerCase().includes("gemini-3")&&this._configurationService.getExperimentBasedConfig(Zne.ConfigKey.EnableGemini3LowReasoningEffort,this._expService)&&(e.reasoning_effort="low"),e}async processResponseFromChatEndpoint(e,r,n,o,s,c,l){if(this.useResponsesApi){let u=(0,jMr.getResponsesApiCompactionThreshold)(this._configurationService,this._expService,this);return(0,jMr.processResponseFromChatEndpoint)(this._instantiationService,e,r,n,o,s,c,u)}else return this.useMessagesApi?(0,X6i.processResponseFromMessagesEndpoint)(this._instantiationService,e,r,n,s,c):this._supportsStreaming?$Mr(e,r,n,o,s,c,l):l9i(n,s,c)}acquireTokenizer(){return this._tokenizerProvider.acquireTokenizer(this)}async makeChatRequest2(e,r){let n=e.useWebSocket??!!(e.turnId&&e.conversationId&&this.useWebSocketResponsesApi&&this._configurationService.getExperimentBasedConfig(Zne.ConfigKey.TeamInternal.ResponsesApiWebSocketEnabled,this._expService)),o=e.ignoreStatefulMarker??!(n&&e.conversationId&&e.turnId&&this._chatWebSocketService.hasActiveConnection(e.conversationId)),s=await this._makeChatRequest2({...e,useWebSocket:n,ignoreStatefulMarker:o},r);return s.type===lvc.ChatFetchResponseType.InvalidStatefulMarker?this._makeChatRequest2({...e,useWebSocket:n,ignoreStatefulMarker:!0},r):s}async _makeChatRequest2(e,r){return this._chatMLFetcher.fetchOne({requestOptions:{},...e,endpoint:this},r)}async makeChatRequest(e,r,n,o,s,c,l,u,d){return this.makeChatRequest2({debugName:e,messages:r,finishedCb:n,location:s,source:c,requestOptions:l,userInitiatedRequest:u,telemetryProperties:d},o)}cloneWithTokenOverride(e){return this._instantiationService.createInstance(HMr,(0,J6i.mixin)((0,J6i.deepClone)(this.modelMetadata),{capabilities:{limits:{max_prompt_tokens:e}}}))}};b1.ChatEndpoint=LCt;b1.ChatEndpoint=LCt=HMr=e9i([Qm(1,c9i.IDomainService),Qm(2,n9i.IChatMLFetcher),Qm(3,a9i.ITokenizerProvider),Qm(4,r9i.IInstantiationService),Qm(5,Zne.IConfigurationService),Qm(6,s9i.IExperimentationService),Qm(7,o9i.IChatWebSocketManager),Qm(8,i9i.ILogService)],LCt);var GMr=class extends LCt{static{a(this,"RemoteAgentChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A){super(e,n,u,d,f,h,m,g,A),this._requestMetadata=r}processResponseFromChatEndpoint(e,r,n,o,s,c,l,u){return $Mr(e,r,n,2,s,c,l)}get urlOrRequestMetadata(){return this._requestMetadata}};b1.RemoteAgentChatEndpoint=GMr;b1.RemoteAgentChatEndpoint=GMr=e9i([Qm(2,c9i.IDomainService),Qm(3,Avc.ICAPIClientService),Qm(4,fvc.IFetcherService),Qm(5,gvc.ITelemetryService),Qm(6,cvc.IAuthenticationService),Qm(7,n9i.IChatMLFetcher),Qm(8,a9i.ITokenizerProvider),Qm(9,r9i.IInstantiationService),Qm(10,Zne.IConfigurationService),Qm(11,s9i.IExperimentationService),Qm(12,o9i.IChatWebSocketManager),Qm(13,i9i.ILogService)],GMr)});var u9i=I(gI=>{"use strict";p();var _vc=gI&&gI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},mI=gI&&gI.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(gI,"__esModule",{value:!0});gI.CopilotUtilityChatEndpoint=gI.CopilotUtilitySmallChatEndpoint=gI.CopilotChatEndpoint=void 0;var vvc=$s(),Cvc=HE(),bvc=l9(),Svc=Pl(),Tvc=H4(),Ivc=xp(),xvc=Sy(),wvc=f9(),Rvc=yh(),kvc=vm(),Pvc=cV(),Dvc=KE(),Nvc=lV(),Mvc=Xne(),jBe=class extends Mvc.ChatEndpoint{static{a(this,"CopilotChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A){super(e,r,u,d,f,h,m,g,A)}getCompletionsCallback(){return(e,r)=>{r&&r.id&&(e.reasoning_opaque=r.id,e.reasoning_text=Array.isArray(r.text)?r.text.join(""):r.text)}}};gI.CopilotChatEndpoint=jBe;gI.CopilotChatEndpoint=jBe=_vc([mI(1,Nvc.IDomainService),mI(2,Dvc.ICAPIClientService),mI(3,xvc.IFetcherService),mI(4,Tvc.IEnvService),mI(5,kvc.ITelemetryService),mI(6,Cvc.IAuthenticationService),mI(7,bvc.IChatMLFetcher),mI(8,Pvc.ITokenizerProvider),mI(9,vvc.IInstantiationService),mI(10,Svc.IConfigurationService),mI(11,Rvc.IExperimentationService),mI(12,wvc.IChatWebSocketManager),mI(13,Ivc.ILogService)],jBe);var VMr=class t{static{a(this,"CopilotUtilitySmallChatEndpoint")}static{this.capiFamily="gpt-4o-mini"}static async resolve(e,r){let n=await e.getChatModelFromCapiFamily(t.capiFamily);return r.createInstance(jBe,n)}};gI.CopilotUtilitySmallChatEndpoint=VMr;var WMr=class{static{a(this,"CopilotUtilityChatEndpoint")}static async resolve(e,r){let n=await e.getCopilotUtilityModel();return r.createInstance(jBe,n)}};gI.CopilotUtilityChatEndpoint=WMr});var zMr=I(RL=>{"use strict";p();var Ovc=RL&&RL.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},AI=RL&&RL.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(RL,"__esModule",{value:!0});RL.AutoChatEndpoint=void 0;RL.isAutoModel=Zvc;var Lvc=$s(),Bvc=HE(),Fvc=l9(),Uvc=Pl(),Qvc=H4(),qvc=xp(),jvc=Sy(),Hvc=f9(),Gvc=yh(),$vc=vm(),Vvc=cV(),Wvc=KE(),zvc=lV(),Yvc=Xne(),Kvc=u9i(),HBe=class extends Kvc.CopilotChatEndpoint{static{a(this,"AutoChatEndpoint")}static{this.pseudoModelId="auto"}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_){super(Jvc(e,r,n),s,c,l,u,d,f,h,m,g,A,y,E,_),this.discountRange=o}};RL.AutoChatEndpoint=HBe;RL.AutoChatEndpoint=HBe=Ovc([AI(4,zvc.IDomainService),AI(5,Wvc.ICAPIClientService),AI(6,jvc.IFetcherService),AI(7,Qvc.IEnvService),AI(8,$vc.ITelemetryService),AI(9,Bvc.IAuthenticationService),AI(10,Fvc.IChatMLFetcher),AI(11,Vvc.ITokenizerProvider),AI(12,Lvc.IInstantiationService),AI(13,Uvc.IConfigurationService),AI(14,Gvc.IExperimentationService),AI(15,Hvc.IChatWebSocketManager),AI(16,qvc.ILogService)],HBe);function Jvc(t,e,r){let n;t instanceof Yvc.ChatEndpoint?n=t.modelMetadata:n={id:t.model,vendor:t.modelProvider,name:t.name,version:t.version,model_picker_enabled:t.showInModelPicker,is_chat_default:!0,is_chat_fallback:t.isFallback,capabilities:{type:"chat",family:t.family,tokenizer:t.tokenizer,limits:{max_prompt_tokens:t.modelMaxPromptTokens,max_output_tokens:t.maxOutputTokens},supports:{tool_calls:t.supportsToolCalls,vision:t.supportsVision,prediction:t.supportsPrediction,streaming:!0}},billing:t.isPremium!==void 0||t.multiplier!==void 0||t.restrictedToSkus!==void 0?{is_premium:t.isPremium??!1,multiplier:t.multiplier??0,restricted_to:t.restrictedToSkus}:void 0,custom_model:t.customModel};let o=t.multiplier!==void 0?Math.round(t.multiplier*(1-r)*100)/100:void 0;return{...n,warning_messages:void 0,model_picker_enabled:!0,info_messages:void 0,billing:{is_premium:n.billing?.is_premium,multiplier:o,restricted_to:n.billing?.restricted_to},requestHeaders:{...n.requestHeaders||{},"Copilot-Session-Token":e}}}a(Jvc,"calculateAutoModelInfo");function Zvc(t){return t&&(t.model===HBe.pseudoModelId||t instanceof HBe)?1:-1}a(Zvc,"isAutoModel")});var KMr=I(GBe=>{"use strict";p();Object.defineProperty(GBe,"__esModule",{value:!0});GBe.getImageTelemetryEventMeasurements=Xvc;GBe.getImageTelemetryMeasurementsFromMessages=eCc;GBe.getImageTelemetryMeasurementsFromReferences=tCc;var m9i=IMr(),d9i="screenshot-focused-window";function g9i(){return{imageCount:0,totalImageBytes:0,maxImageBytes:0,maxImageWidth:0,maxImageHeight:0,maxImagePixels:0,totalImagePixels:0,imagePngCount:0,imageJpegCount:0,imageGifCount:0,imageWebpCount:0,imageUnknownMimeCount:0,imageClipboardCount:0,imageScreenshotCount:0,imageFileCount:0,imageUrlCount:0,imageUnknownSourceCount:0}}a(g9i,"createEmptyImageTelemetryMeasurements");function Xvc(t){return t.imageCount>0?t:{}}a(Xvc,"getImageTelemetryEventMeasurements");function eCc(t){let e=g9i();for(let r of t??[])if(Array.isArray(r.content))for(let n of r.content){let o=uCc(n,"imageUrl"),s=YMr(o,"url");if(!s)continue;let c=rCc(s,YMr(o,"mediaType"));c&&A9i(e,c)}return e}a(eCc,"getImageTelemetryMeasurementsFromMessages");function tCc(t){let e=g9i();for(let r of t??[]){let n=Vye(r.value);if(!n)continue;let o=YMr(n,"mimeType");if(!o?.toLowerCase().startsWith("image/"))continue;let s=p9i(n.data)??p9i(n.value);A9i(e,{mimeType:o,byteLength:s?.byteLength??h9i(n.data)??h9i(n.value),dimensions:oCc(s,o),source:sCc(r,n)})}return e}a(tCc,"getImageTelemetryMeasurementsFromReferences");function A9i(t,e){t.imageCount++;let r=e.byteLength??0;switch(t.totalImageBytes+=r,t.maxImageBytes=Math.max(t.maxImageBytes,r),nCc(t,e.dimensions),y9i(e.mimeType)){case"png":t.imagePngCount++;break;case"jpeg":t.imageJpegCount++;break;case"gif":t.imageGifCount++;break;case"webp":t.imageWebpCount++;break;default:t.imageUnknownMimeCount++}switch(e.source){case"clipboard":t.imageClipboardCount++;break;case"screenshot":t.imageScreenshotCount++;break;case"file":t.imageFileCount++;break;case"url":t.imageUrlCount++;break;default:t.imageUnknownSourceCount++}}a(A9i,"addImageTelemetryInput");function rCc(t,e){if(!t.startsWith("data:"))return t.startsWith("https://")?{mimeType:e,source:"url"}:void 0;let r=/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/.exec(t);if(r)return{mimeType:e??r[1],byteLength:aCc(r[2]),dimensions:iCc(t),source:"unknown"}}a(rCc,"getImageTelemetryInputFromUrl");function nCc(t,e){if(!e||!f9i(e.width)||!f9i(e.height))return;let r=e.width*e.height;!Number.isFinite(r)||r<=0||(t.maxImageWidth=Math.max(t.maxImageWidth,e.width),t.maxImageHeight=Math.max(t.maxImageHeight,e.height),t.maxImagePixels=Math.max(t.maxImagePixels,r),t.totalImagePixels+=r)}a(nCc,"addImageDimensions");function f9i(t){return Number.isFinite(t)&&t>0}a(f9i,"isValidDimension");function iCc(t){try{return(0,m9i.getImageDimensions)(t)}catch{return}}a(iCc,"getImageDimensionsFromDataUrl");function oCc(t,e){let r=e?.toLowerCase().split(";")[0].trim();if(!(!t||y9i(r)==="unknown"))try{return(0,m9i.getImageDimensionsFromBytes)(t,r)}catch{return}}a(oCc,"getImageDimensionsFromBytes");function y9i(t){switch(t?.toLowerCase().split(";")[0].trim()){case"image/png":return"png";case"image/jpeg":case"image/jpg":return"jpeg";case"image/gif":return"gif";case"image/webp":return"webp";default:return"unknown"}}a(y9i,"normalizeMimeType");function sCc(t,e){return e.isPasted===!0?"clipboard":e.isURL===!0?"url":t.id===d9i||e.id===d9i?"screenshot":e.isURL===!1?"file":"unknown"}a(sCc,"getImageSourceFromReference");function aCc(t){let e=t.trim(),r=0;return e.endsWith("==")?r=2:e.endsWith("=")&&(r=1),Math.max(0,Math.floor(e.length*3/4)-r)}a(aCc,"getBase64ByteLength");function p9i(t){if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let e=Vye(t);if(!e)return;let r=Object.keys(e);if(!r.length||!r.every(cCc))return;let n=[...r];n.sort((s,c)=>Number(s)-Number(c));let o=n.map(s=>e[s]);if(o.every(lCc))return new Uint8Array(o)}a(p9i,"getByteData");function cCc(t){let e=Number(t);return Number.isInteger(e)&&e>=0&&String(e)===t}a(cCc,"isArrayIndexKey");function lCc(t){return typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=255}a(lCc,"isByteValue");function h9i(t){if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))return t.byteLength;let r=Vye(t)?.byteLength;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}a(h9i,"getByteLength");function uCc(t,e){return Vye(Vye(t)?.[e])}a(uCc,"getObjectProperty");function YMr(t,e){let r=Vye(t)?.[e];return typeof r=="string"?r:void 0}a(YMr,"getStringProperty");function Vye(t){return typeof t=="object"&&t!==null?t:void 0}a(Vye,"asRecord")});var v9i=I(Wye=>{"use strict";p();Object.defineProperty(Wye,"__esModule",{value:!0});Wye.ChatFailKind=Wye.FetchResponseKind=void 0;var E9i;(function(t){t.Success="success",t.Failed="failed",t.Canceled="canceled"})(E9i||(Wye.FetchResponseKind=E9i={}));var _9i;(function(t){t.OffTopic="offTopic",t.TokenExpiredOrInvalid="tokenExpiredOrInvalid",t.ServerCanceled="serverCanceled",t.ClientNotSupported="clientNotSupported",t.RateLimited="rateLimited",t.QuotaExceeded="quotaExceeded",t.ExtensionBlocked="extensionBlocked",t.ServerError="serverError",t.ContentFilter="contentFilter",t.AgentUnauthorized="unauthorized",t.AgentFailedDependency="failedDependency",t.ValidationFailed="validationFailed",t.InvalidPreviousResponseId="invalidPreviousResponseId",t.NotFound="notFound",t.Unknown="unknown"})(_9i||(Wye.ChatFailKind=_9i={}))});var $Be=I(Lu=>{"use strict";p();Object.defineProperty(Lu,"__esModule",{value:!0});Lu.FILE_TOOL_NAMES=Lu.SHELL_TOOL_NAMES=Lu.TOOL_PARAM_COMMAND_MAX_LEN=Lu.GitHubCopilotAttr=Lu.CopilotCliSdkAttr=Lu.StdAttr=Lu.CopilotChatAttr=Lu.GenAiAttr=Lu.GenAiToolType=Lu.GenAiTokenType=Lu.GenAiProviderName=Lu.GenAiOperationName=void 0;Lu.GenAiOperationName={CHAT:"chat",INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool",EMBEDDINGS:"embeddings",CONTENT_EVENT:"content_event",EXECUTE_HOOK:"execute_hook"};Lu.GenAiProviderName={GITHUB:"github",OPENAI:"openai",ANTHROPIC:"anthropic",AZURE_AI_OPENAI:"azure.ai.openai",GEMINI:"gemini"};Lu.GenAiTokenType={INPUT:"input",OUTPUT:"output"};Lu.GenAiToolType={FUNCTION:"function",EXTENSION:"extension"};Lu.GenAiAttr={OPERATION_NAME:"gen_ai.operation.name",PROVIDER_NAME:"gen_ai.provider.name",REQUEST_MODEL:"gen_ai.request.model",REQUEST_TEMPERATURE:"gen_ai.request.temperature",REQUEST_MAX_TOKENS:"gen_ai.request.max_tokens",REQUEST_TOP_P:"gen_ai.request.top_p",REQUEST_FREQUENCY_PENALTY:"gen_ai.request.frequency_penalty",REQUEST_PRESENCE_PENALTY:"gen_ai.request.presence_penalty",REQUEST_SEED:"gen_ai.request.seed",REQUEST_STOP_SEQUENCES:"gen_ai.request.stop_sequences",REQUEST_STREAM:"gen_ai.request.stream",RESPONSE_MODEL:"gen_ai.response.model",RESPONSE_ID:"gen_ai.response.id",RESPONSE_FINISH_REASONS:"gen_ai.response.finish_reasons",RESPONSE_TIME_TO_FIRST_CHUNK:"gen_ai.response.time_to_first_chunk",USAGE_INPUT_TOKENS:"gen_ai.usage.input_tokens",USAGE_OUTPUT_TOKENS:"gen_ai.usage.output_tokens",USAGE_CACHE_READ_INPUT_TOKENS:"gen_ai.usage.cache_read.input_tokens",USAGE_CACHE_CREATION_INPUT_TOKENS:"gen_ai.usage.cache_creation.input_tokens",USAGE_REASONING_TOKENS:"gen_ai.usage.reasoning_tokens",USAGE_REASONING_OUTPUT_TOKENS:"gen_ai.usage.reasoning.output_tokens",CONVERSATION_ID:"gen_ai.conversation.id",OUTPUT_TYPE:"gen_ai.output.type",TOKEN_TYPE:"gen_ai.token.type",AGENT_NAME:"gen_ai.agent.name",AGENT_ID:"gen_ai.agent.id",AGENT_VERSION:"gen_ai.agent.version",AGENT_DESCRIPTION:"gen_ai.agent.description",TOOL_NAME:"gen_ai.tool.name",TOOL_TYPE:"gen_ai.tool.type",TOOL_CALL_ID:"gen_ai.tool.call.id",TOOL_DESCRIPTION:"gen_ai.tool.description",TOOL_CALL_ARGUMENTS:"gen_ai.tool.call.arguments",TOOL_CALL_RESULT:"gen_ai.tool.call.result",INPUT_MESSAGES:"gen_ai.input.messages",OUTPUT_MESSAGES:"gen_ai.output.messages",SYSTEM_INSTRUCTIONS:"gen_ai.system_instructions",TOOL_DEFINITIONS:"gen_ai.tool.definitions"};Lu.CopilotChatAttr={LOCATION:"copilot_chat.location",INTENT:"copilot_chat.intent",TURN_INDEX:"copilot_chat.turn.index",TURN_COUNT:"copilot_chat.turn_count",TOOL_CALL_ROUND:"copilot_chat.tool_call_round",API_TYPE:"copilot_chat.api_type",FETCHER:"copilot_chat.fetcher",DEBUG_NAME:"copilot_chat.debug_name",ENDPOINT_TYPE:"copilot_chat.endpoint_type",MAX_PROMPT_TOKENS:"copilot_chat.request.max_prompt_tokens",TIME_TO_FIRST_TOKEN:"copilot_chat.time_to_first_token",SESSION_ID:"copilot_chat.session_id",SERVER_REQUEST_ID:"copilot_chat.server_request_id",CANCELED:"copilot_chat.canceled",REASONING_CONTENT:"copilot_chat.reasoning_content",USER_REQUEST:"copilot_chat.user_request",REQUEST_OPTIONS:"copilot_chat.request.options",REQUEST_SHAPE:"copilot_chat.request.shape",PROMPT_CONTEXT:"copilot_chat.prompt_context",PROMPT_INSTRUCTIONS:"copilot_chat.prompt_instructions",CHAT_SESSION_ID:"copilot_chat.chat_session_id",PARENT_CHAT_SESSION_ID:"copilot_chat.parent_chat_session_id",DEBUG_LOG_LABEL:"copilot_chat.debug_log_label",MARKDOWN_CONTENT:"copilot_chat.markdown_content",EDIT_SOURCE:"copilot_chat.edit.source",EDIT_OUTCOME:"copilot_chat.edit.outcome",LANGUAGE_ID:"copilot_chat.language_id",TIME_DELAY_MS:"copilot_chat.time_delay_ms",HAS_REMAINING_EDITS:"copilot_chat.has_remaining_edits",REPO_HEAD_BRANCH_NAME:"copilot_chat.repo.head_branch_name",REPO_HEAD_COMMIT_HASH:"copilot_chat.repo.head_commit_hash",REPO_REMOTE_URL:"copilot_chat.repo.remote_url",FILE_RELATIVE_PATH:"copilot_chat.file.relative_path",HOOK_TYPE:"copilot_chat.hook_type",HOOK_INPUT:"copilot_chat.hook_input",HOOK_OUTPUT:"copilot_chat.hook_output",HOOK_RESULT_KIND:"copilot_chat.hook_result_kind",MODE_NAME:"copilot_chat.mode_name",TOTAL_COST_USD:"copilot_chat.total_cost_usd",COPILOT_USAGE_NANO_AIU:"copilot_chat.copilot_usage_nano_aiu"};Lu.StdAttr={ERROR_TYPE:"error.type",SERVER_ADDRESS:"server.address",SERVER_PORT:"server.port"};Lu.CopilotCliSdkAttr={HOOK_TYPE:"github.copilot.hook.type",HOOK_INVOCATION_ID:"github.copilot.hook.invocation_id"};Lu.GitHubCopilotAttr={AGENT_TYPE:"github.copilot.agent.type",CLOUD_BACKEND_VERSION:"github.copilot.cloud.backend_version",GIT_REPOSITORY:"github.copilot.git.repository",GIT_BRANCH:"github.copilot.git.branch",GIT_COMMIT_SHA:"github.copilot.git.commit_sha",GITHUB_ORG:"github.copilot.github.org",HOOK_DECISION:"github.copilot.hook.decision",HOOK_DURATION_SECONDS:"github.copilot.hook.duration",HOOK_TOOL_NAMES:"github.copilot.hook.tool_names",MCP_SERVER_NAME_HASH:"github.copilot.mcp.server.name_hash",MCP_SERVER_NAME:"github.copilot.mcp.server.name",TOOL_PARAM_COMMAND:"github.copilot.tool.parameters.command",TOOL_PARAM_FILE_PATH:"github.copilot.tool.parameters.file_path",TOOL_PARAM_EDIT_TYPE:"github.copilot.tool.parameters.edit_type",TOOL_PARAM_SKILL_NAME:"github.copilot.tool.parameters.skill_name",TOOL_PARAM_MCP_SERVER_NAME_HASH:"github.copilot.tool.parameters.mcp_server_name_hash",TOOL_PARAM_MCP_SERVER_NAME:"github.copilot.tool.parameters.mcp_server_name",TOOL_PARAM_MCP_TOOL_NAME:"github.copilot.tool.parameters.mcp_tool_name"};Lu.TOOL_PARAM_COMMAND_MAX_LEN=256;Lu.SHELL_TOOL_NAMES=new Set(["bash","powershell","local_shell","runInTerminal","run_in_terminal","Bash"]);Lu.FILE_TOOL_NAMES=new Set(["view","create","edit","str_replace","str_replace_editor","insert","readFile","createFile","replaceString","applyPatch","read_file","create_file","apply_patch","insert_edit_into_file","replace_string_in_file","multi_replace_string_in_file","edit_notebook_file","Read","Edit","MultiEdit","Write","NotebookEdit"])});var ZMr=I(tk=>{"use strict";p();Object.defineProperty(tk,"__esModule",{value:!0});tk.truncateForOTel=dCc;tk.toInputMessages=fCc;tk.toOutputMessages=pCc;tk.toSystemInstructions=hCc;tk.extractTextFromContent=JMr;tk.collectSystemTextsFromRequestBody=mCc;tk.normalizeProviderMessages=gCc;tk.toToolDefinitions=S9i;tk.stringifyToolDefinitionsForOTel=bCc;tk.stringifyToolsRawForTelemetry=SCc;function dCc(t,e=0){if(e<=0||t.length<=e)return t;let r=`...[truncated, original ${t.length} chars]`;return e<=r.length?t.substring(0,e):t.substring(0,e-r.length)+r}a(dCc,"truncateForOTel");function fCc(t){return t.map(e=>{let r=[];if(e.role==="tool"&&e.tool_call_id)return r.push({type:"tool_call_response",id:e.tool_call_id,response:e.content??""}),{role:e.role,parts:r};if(e.content&&r.push({type:"text",content:e.content}),e.tool_calls)for(let n of e.tool_calls){let o;try{o=JSON.parse(n.function.arguments)}catch{o=n.function.arguments}r.push({type:"tool_call",id:n.id,name:n.function.name,arguments:o})}return{role:e.role,parts:r}})}a(fCc,"toInputMessages");function pCc(t){return t.map(e=>{let r=[],n=e.message;if(n?.content&&r.push({type:"text",content:n.content}),n?.tool_calls)for(let o of n.tool_calls){let s;try{s=JSON.parse(o.function.arguments)}catch{s=o.function.arguments}r.push({type:"tool_call",id:o.id,name:o.function.name,arguments:s})}return{role:n?.role??"assistant",parts:r,finish_reason:e.finish_reason}})}a(pCc,"toOutputMessages");function hCc(t){if(t===void 0)return;let r=(Array.isArray(t)?t:[t]).filter(n=>typeof n=="string"&&n.length>0).map(n=>({type:"text",content:n}));return r.length>0?r:void 0}a(hCc,"toSystemInstructions");function JMr(t){return typeof t=="string"?t:Array.isArray(t)?t.map(e=>{if(typeof e=="string")return e;if(e&&typeof e=="object"){let r=e;if(typeof r.text=="string")return r.text;if(typeof r.content=="string")return r.content}return""}).filter(e=>e.length>0).join(` +`):""}a(JMr,"extractTextFromContent");function mCc(t){let e=[],r=t.messages??t.input;if(r){for(let n of r)if(n.role==="system"){let o=JMr(n.content);o&&e.push(o)}}if(e.length===0){let n=JMr(t.system??t.instructions);n&&e.push(n)}return e}a(mCc,"collectSystemTextsFromRequestBody");function gCc(t){return t.map(e=>{switch(e.type){case"function_call":return ACc(e);case"function_call_output":return yCc(e);case"tool_search_output":return ECc(e);case"reasoning":return _Cc(e)}let n=e.role,o=[],s=e.content;if(n==="tool"&&typeof e.tool_call_id=="string")return o.push({type:"tool_call_response",id:e.tool_call_id,response:s??""}),{role:n,parts:o};if(typeof s=="string"&&s.length>0)o.push({type:"text",content:s});else if(Array.isArray(s))for(let l of s){if(!l||typeof l!="object")continue;let u=l;switch(u.type){case"text":case"input_text":case"output_text":typeof u.text=="string"&&o.push({type:"text",content:u.text});break;case"tool_use":o.push({type:"tool_call",id:String(u.id??""),name:String(u.name??""),arguments:u.input});break;case"tool_result":o.push({type:"tool_call_response",id:String(u.tool_use_id??""),response:u.content??""});break;case"thinking":typeof u.thinking=="string"&&o.push({type:"reasoning",content:u.thinking});break;default:o.push({type:"text",content:JSON.stringify(u)});break}}let c=e.tool_calls;if(Array.isArray(c))for(let l of c){if(!l||typeof l!="object")continue;let u=l,d=u.function;if(d){let f;try{f=typeof d.arguments=="string"?JSON.parse(d.arguments):d.arguments}catch{f=d.arguments}o.push({type:"tool_call",id:String(u.id??""),name:String(d.name??""),arguments:f})}}return{role:n,parts:o}})}a(gCc,"normalizeProviderMessages");function ACc(t){let e=t.arguments;if(typeof e=="string")try{e=JSON.parse(e)}catch{}return{role:"assistant",parts:[{type:"tool_call",id:String(t.call_id??t.id??""),name:String(t.name??""),arguments:e}]}}a(ACc,"normalizeResponsesFunctionCall");function yCc(t){let e=t.output,r;return typeof e=="string"?r=e:Array.isArray(e)?r=e.map(n=>n&&typeof n=="object"&&typeof n.text=="string"?n.text:JSON.stringify(n)).join(""):r=e??"",{role:"tool",parts:[{type:"tool_call_response",id:String(t.call_id??t.id??""),response:r}]}}a(yCc,"normalizeResponsesFunctionCallOutput");function ECc(t){let e=Object.prototype.hasOwnProperty.call(t,"tools")&&t.tools!==void 0,r={type:"tool_search_output",id:String(t.call_id??t.id??""),status:typeof t.status=="string"?t.status:void 0};return e&&(r.tools=t.tools),{role:"tool_search",parts:[r]}}a(ECc,"normalizeResponsesToolSearchOutput");function _Cc(t){let e=[],r=t.summary;if(Array.isArray(r))for(let n of r)n&&typeof n=="object"&&typeof n.text=="string"&&e.push({type:"reasoning",content:n.text});else typeof r=="string"&&e.push({type:"reasoning",content:r});return typeof t.encrypted_content=="string"&&e.push({type:"reasoning",content:t.encrypted_content}),{role:"assistant",parts:e}}a(_Cc,"normalizeResponsesReasoning");function S9i(t){if(!t||t.length===0)return;let e=[];for(let r of t){let n=r.function?.name??r.name;if(!n)continue;let o=r.function?.description??r.description,s=r.function?.parameters??r.parameters??r.input_schema??r.inputSchema;e.push({type:"function",name:n,description:o,parameters:s})}return e.length>0?e:void 0}a(S9i,"toToolDefinitions");var C9i=new WeakMap,b9i=new WeakMap,BCt,FCt;function vCc(t){return BCt!==void 0&&BCt===t?BCt:(BCt=t,t)}a(vCc,"internToolDefsString");function CCc(t){return FCt!==void 0&&FCt===t?FCt:(FCt=t,t)}a(CCc,"internToolsRawString");function bCc(t){if(!t||t.length===0)return;let e=C9i.get(t);if(e!==void 0)return e;let r=S9i(t);if(!r)return;let n=vCc(JSON.stringify(r));return C9i.set(t,n),n}a(bCc,"stringifyToolDefinitionsForOTel");function SCc(t){if(!t)return;let e=b9i.get(t);if(e!==void 0)return e;let r=CCc(JSON.stringify(t));return b9i.set(t,r),r}a(SCc,"stringifyToolsRawForTelemetry")});var XMr=I(UCt=>{"use strict";p();Object.defineProperty(UCt,"__esModule",{value:!0});UCt.resolveWorkspaceOTelMetadata=TCc;UCt.workspaceMetadataToOTelAttributes=xCc;var T9i=s2(),I9i=N2r(),uV=$Be();function TCc(t,e){let r=t.activeRepository?.get();return r?ICc(r,e):{}}a(TCc,"resolveWorkspaceOTelMetadata");function ICc(t,e){let r,n=Array.from((0,I9i.getOrderedRepoInfosFromContext)(t))[0];n?.fetchUrl&&(r=(0,I9i.normalizeFetchUrl)(n.fetchUrl));let o;return e&&(0,T9i.isEqualOrParent)(e,t.rootUri)&&(o=(0,T9i.relativePath)(t.rootUri,e)),{headBranchName:t.headBranchName,headCommitHash:t.headCommitHash,remoteUrl:r,fileRelativePath:o}}a(ICc,"buildWorkspaceMetadata");function xCc(t){if(!t)return{};let e={};if(t.headBranchName&&(e[uV.CopilotChatAttr.REPO_HEAD_BRANCH_NAME]=t.headBranchName,e[uV.GitHubCopilotAttr.GIT_BRANCH]=t.headBranchName),t.headCommitHash&&(e[uV.CopilotChatAttr.REPO_HEAD_COMMIT_HASH]=t.headCommitHash,e[uV.GitHubCopilotAttr.GIT_COMMIT_SHA]=t.headCommitHash),t.remoteUrl){e[uV.CopilotChatAttr.REPO_REMOTE_URL]=t.remoteUrl,e[uV.GitHubCopilotAttr.GIT_REPOSITORY]=t.remoteUrl;let r=wCc(t.remoteUrl);r&&(e[uV.GitHubCopilotAttr.GITHUB_ORG]=r)}return t.fileRelativePath&&(e[uV.CopilotChatAttr.FILE_RELATIVE_PATH]=t.fileRelativePath),e}a(xCc,"workspaceMetadataToOTelAttributes");function wCc(t){return t.match(/github\.com[/:]([^/]+)\/[^/]+\/?$/i)?.[1]}a(wCc,"extractGitHubOrg")});var x9i=I(rk=>{"use strict";p();Object.defineProperty(rk,"__esModule",{value:!0});rk.emitInferenceDetailsEvent=RCc;rk.emitSessionStartEvent=kCc;rk.emitToolCallEvent=PCc;rk.emitAgentTurnEvent=DCc;rk.emitEditFeedbackEvent=NCc;rk.emitEditHunkActionEvent=MCc;rk.emitInlineDoneEvent=OCc;rk.emitEditSurvivalEvent=LCc;rk.emitUserFeedbackEvent=BCc;rk.emitCloudSessionInvokeEvent=FCc;var qm=$Be(),zye=ZMr(),QCt=XMr();function RCc(t,e,r,n){let o={"event.name":"gen_ai.client.inference.operation.details",[qm.GenAiAttr.OPERATION_NAME]:qm.GenAiOperationName.CHAT,[qm.GenAiAttr.REQUEST_MODEL]:e.model};if(r&&(r.model&&(o[qm.GenAiAttr.RESPONSE_MODEL]=r.model),r.id&&(o[qm.GenAiAttr.RESPONSE_ID]=r.id),r.finishReasons&&(o[qm.GenAiAttr.RESPONSE_FINISH_REASONS]=r.finishReasons),r.inputTokens!==void 0&&(o[qm.GenAiAttr.USAGE_INPUT_TOKENS]=r.inputTokens),r.outputTokens!==void 0&&(o[qm.GenAiAttr.USAGE_OUTPUT_TOKENS]=r.outputTokens)),e.temperature!==void 0&&(o[qm.GenAiAttr.REQUEST_TEMPERATURE]=e.temperature),e.maxTokens!==void 0&&(o[qm.GenAiAttr.REQUEST_MAX_TOKENS]=e.maxTokens),n&&(o[qm.StdAttr.ERROR_TYPE]=n.type),t.config.captureContent){let s=t.config.maxAttributeSizeChars;if(e.messages!==void 0){let c=Array.isArray(e.messages)?e.messages:void 0;o[qm.GenAiAttr.INPUT_MESSAGES]=(0,zye.truncateForOTel)(JSON.stringify(c?(0,zye.normalizeProviderMessages)(c):e.messages),s)}if(e.systemMessage!==void 0){let c=typeof e.systemMessage=="string"?e.systemMessage:JSON.stringify(e.systemMessage),l=(0,zye.toSystemInstructions)(c);l!==void 0&&(o[qm.GenAiAttr.SYSTEM_INSTRUCTIONS]=(0,zye.truncateForOTel)(JSON.stringify(l),s))}if(e.tools!==void 0){let c=(0,zye.stringifyToolsRawForTelemetry)(e.tools);c!==void 0&&(o[qm.GenAiAttr.TOOL_DEFINITIONS]=(0,zye.truncateForOTel)(c,s))}}t.emitLogRecord(`GenAI inference: ${e.model}`,o)}a(RCc,"emitInferenceDetailsEvent");function kCc(t,e,r,n){t.emitLogRecord("copilot_chat.session.start",{"event.name":"copilot_chat.session.start","session.id":e,[qm.GenAiAttr.REQUEST_MODEL]:r,[qm.GenAiAttr.AGENT_NAME]:n})}a(kCc,"emitSessionStartEvent");function PCc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.tool.call: ${e}`,{"event.name":"copilot_chat.tool.call",[qm.GenAiAttr.TOOL_NAME]:e,duration_ms:r,success:n,...o?{[qm.StdAttr.ERROR_TYPE]:o}:{}})}a(PCc,"emitToolCallEvent");function DCc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.agent.turn: ${e}`,{"event.name":"copilot_chat.agent.turn","turn.index":e,[qm.GenAiAttr.USAGE_INPUT_TOKENS]:r,[qm.GenAiAttr.USAGE_OUTPUT_TOKENS]:n,tool_call_count:o})}a(DCc,"emitAgentTurnEvent");function NCc(t,e,r,n,o,s,c,l,u){t.emitLogRecord(`copilot_chat.edit.feedback: ${e}`,{"event.name":"copilot_chat.edit.feedback",outcome:e,language_id:r,participant:n,request_id:o,edit_surface:s,has_remaining_edits:c,is_notebook:l,...(0,QCt.workspaceMetadataToOTelAttributes)(u)})}a(NCc,"emitEditFeedbackEvent");function MCc(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.edit.hunk.action: ${e}`,{"event.name":"copilot_chat.edit.hunk.action",outcome:e,language_id:r,request_id:n,line_count:o,lines_added:s,lines_removed:c,...(0,QCt.workspaceMetadataToOTelAttributes)(l)})}a(MCc,"emitEditHunkActionEvent");function OCc(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.inline.done: ${e?"accepted":"rejected"}`,{"event.name":"copilot_chat.inline.done",accepted:e,language_id:r,edit_count:n,edit_line_count:o,reply_type:s,is_notebook:c,...(0,QCt.workspaceMetadataToOTelAttributes)(l)})}a(OCc,"emitInlineDoneEvent");function LCc(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.edit.survival: ${e}`,{"event.name":"copilot_chat.edit.survival",edit_source:e,survival_rate_four_gram:r,survival_rate_no_revert:n,time_delay_ms:o,did_branch_change:s,request_id:c,...(0,QCt.workspaceMetadataToOTelAttributes)(l)})}a(LCc,"emitEditSurvivalEvent");function BCc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.user.feedback: ${e}`,{"event.name":"copilot_chat.user.feedback",rating:e,participant:r,conversation_id:n,request_id:o})}a(BCc,"emitUserFeedbackEvent");function FCc(t,e,r,n){t.emitLogRecord(`copilot_chat.cloud.session.invoke: ${e}`,{"event.name":"copilot_chat.cloud.session.invoke",partner_agent:e,model:r,request_id:n})}a(FCc,"emitCloudSessionInvokeEvent")});var w9i=I(qCt=>{"use strict";p();Object.defineProperty(qCt,"__esModule",{value:!0});qCt.GenAiMetrics=void 0;var No=$Be(),eOr=class{static{a(this,"GenAiMetrics")}static recordOperationDuration(e,r,n){e.recordMetric("gen_ai.client.operation.duration",r,{[No.GenAiAttr.OPERATION_NAME]:n.operationName,[No.GenAiAttr.PROVIDER_NAME]:n.providerName,[No.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[No.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{},...n.serverAddress?{[No.StdAttr.SERVER_ADDRESS]:n.serverAddress}:{},...n.serverPort?{[No.StdAttr.SERVER_PORT]:n.serverPort}:{},...n.errorType?{[No.StdAttr.ERROR_TYPE]:n.errorType}:{}})}static recordTokenUsage(e,r,n,o){e.recordMetric("gen_ai.client.token.usage",r,{[No.GenAiAttr.OPERATION_NAME]:o.operationName,[No.GenAiAttr.PROVIDER_NAME]:o.providerName,[No.GenAiAttr.TOKEN_TYPE]:n,[No.GenAiAttr.REQUEST_MODEL]:o.requestModel,...o.responseModel?{[No.GenAiAttr.RESPONSE_MODEL]:o.responseModel}:{},...o.serverAddress?{[No.StdAttr.SERVER_ADDRESS]:o.serverAddress}:{}})}static recordToolCallCount(e,r,n){e.incrementCounter("copilot_chat.tool.call.count",1,{[No.GenAiAttr.TOOL_NAME]:r,success:n})}static recordToolCallDuration(e,r,n){e.recordMetric("copilot_chat.tool.call.duration",n,{[No.GenAiAttr.TOOL_NAME]:r})}static recordAgentDuration(e,r,n){e.recordMetric("copilot_chat.agent.invocation.duration",n,{[No.GenAiAttr.AGENT_NAME]:r})}static recordAgentTurnCount(e,r,n){e.recordMetric("copilot_chat.agent.turn.count",n,{[No.GenAiAttr.AGENT_NAME]:r})}static recordTimeToFirstToken(e,r,n){e.recordMetric("copilot_chat.time_to_first_token",n,{[No.GenAiAttr.REQUEST_MODEL]:r})}static recordTimeToFirstChunk(e,r,n){e.recordMetric("gen_ai.client.operation.time_to_first_chunk",r,{[No.GenAiAttr.OPERATION_NAME]:n.operationName,[No.GenAiAttr.PROVIDER_NAME]:n.providerName,[No.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[No.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{}})}static recordTimePerOutputChunk(e,r,n){e.recordMetric("gen_ai.client.operation.time_per_output_chunk",r,{[No.GenAiAttr.OPERATION_NAME]:n.operationName,[No.GenAiAttr.PROVIDER_NAME]:n.providerName,[No.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[No.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{}})}static incrementSessionCount(e){e.incrementCounter("copilot_chat.session.count")}static recordEditAcceptance(e,r,n,o){e.incrementCounter("copilot_chat.edit.acceptance.count",1,{[No.CopilotChatAttr.EDIT_SOURCE]:r,[No.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[No.CopilotChatAttr.LANGUAGE_ID]:o}:{}})}static recordChatEditOutcome(e,r,n,o,s){e.incrementCounter("copilot_chat.chat_edit.outcome.count",1,{[No.CopilotChatAttr.EDIT_SOURCE]:r,[No.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[No.CopilotChatAttr.LANGUAGE_ID]:o}:{},...s!==void 0?{[No.CopilotChatAttr.HAS_REMAINING_EDITS]:s}:{}})}static recordEditSurvivalFourGram(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.four_gram",n,{[No.CopilotChatAttr.EDIT_SOURCE]:r,[No.CopilotChatAttr.TIME_DELAY_MS]:o})}static recordEditSurvivalNoRevert(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.no_revert",n,{[No.CopilotChatAttr.EDIT_SOURCE]:r,[No.CopilotChatAttr.TIME_DELAY_MS]:o})}static incrementLinesOfCode(e,r,n,o){e.incrementCounter("copilot_chat.lines_of_code.count",o,{type:r,...n?{[No.CopilotChatAttr.LANGUAGE_ID]:n}:{}})}static incrementUserActionCount(e,r){e.incrementCounter("copilot_chat.user.action.count",1,{action:r})}static incrementUserFeedbackCount(e,r){e.incrementCounter("copilot_chat.user.feedback.count",1,{rating:r})}static incrementAgentEditResponseCount(e,r){e.incrementCounter("copilot_chat.agent.edit_response.count",1,{outcome:r})}static incrementAgentSummarizationCount(e,r){e.incrementCounter("copilot_chat.agent.summarization.count",1,{outcome:r})}static incrementPullRequestCount(e){e.incrementCounter("copilot_chat.pull_request.count")}static incrementCloudSessionCount(e,r,n){e.incrementCounter("copilot_chat.cloud.session.count",1,{partner_agent:r,...n?{[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n}:{}})}static incrementCloudPrReadyCount(e,r){e.incrementCounter("copilot_chat.cloud.pr_ready.count",1,r?{[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:r}:void 0)}static recordCloudOperation(e,r,n,o,s){e.incrementCounter("copilot_chat.cloud.operation.count",1,{operation:r,[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n,success:o}),s!==void 0&&e.recordMetric("copilot_chat.cloud.operation.duration",s,{operation:r,[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n})}static incrementCloudError(e,r,n,o){e.incrementCounter("copilot_chat.cloud.error.count",1,{operation:r,[No.GitHubCopilotAttr.CLOUD_BACKEND_VERSION]:n,[No.StdAttr.ERROR_TYPE]:o})}};qCt.GenAiMetrics=eOr});var rOr=I(jCt=>{"use strict";p();Object.defineProperty(jCt,"__esModule",{value:!0});jCt.NoopOTelService=void 0;var R9i=Rc(),k9i={setAttribute(){},setAttributes(){},setStatus(){},recordException(){},addEvent(){},getSpanContext(){},end(){}},tOr=class{static{a(this,"NoopOTelService")}constructor(e){this.onDidCompleteSpan=R9i.Event.None,this.onDidEmitSpanEvent=R9i.Event.None,this.config=e}startSpan(e,r){return k9i}startActiveSpan(e,r,n){return n(k9i)}getActiveTraceContext(){}storeTraceContext(e,r){}getStoredTraceContext(e){}runWithTraceContext(e,r){return r()}recordMetric(e,r,n){}incrementCounter(e,r,n){}emitLogRecord(e,r){}async flush(){}async shutdown(){}injectCompletedSpan(e){}};jCt.NoopOTelService=tOr});var nOr=I(eie=>{"use strict";p();Object.defineProperty(eie,"__esModule",{value:!0});eie.DEFAULT_OTLP_ENDPOINT=void 0;eie.resolveOTelConfig=qCc;eie.DEFAULT_OTLP_ENDPOINT="http://localhost:4318";function UCc(t){if(!t)return{};let e={};for(let r of t.split(",")){let n=r.indexOf("=");if(n>0){let o=r.substring(0,n).trim(),s=r.substring(n+1).trim();o&&(e[o]=s)}}return e}a(UCc,"parseResourceAttributes");function QCc(t,e){if(!t)return;let r=t.replace(/^["']|["']$/g,"");try{let n=new URL(r);return e==="grpc"?n.origin:n.href}catch{return}}a(QCc,"parseOtlpEndpoint");function qCc(t){let{env:e}=t;if(t.vscodeTelemetryLevel==="off")return P9i(t);let r=t.settingDbSpanExporter??!1,n=(VBe(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)||r,o=(VBe(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)===!0;if(!n)return P9i(t);let s;VBe(e.COPILOT_OTEL_ENABLED)===!0?s="envVar":t.settingEnabled===!0?s="setting":e.OTEL_EXPORTER_OTLP_ENDPOINT?s="otlpEndpointEnvVar":s="dbSpanExporterOnly";let l=(e.OTEL_EXPORTER_OTLP_PROTOCOL??e.COPILOT_OTEL_PROTOCOL)==="grpc"?"grpc":"http",u=e.COPILOT_OTEL_ENDPOINT??e.OTEL_EXPORTER_OTLP_ENDPOINT??t.settingOtlpEndpoint??eie.DEFAULT_OTLP_ENDPOINT,d=QCc(u,l)??eie.DEFAULT_OTLP_ENDPOINT,f=e.COPILOT_OTEL_FILE_EXPORTER_PATH??t.settingOutfile,h;f?h="file":t.settingExporterType?h=t.settingExporterType:h=l==="grpc"?"otlp-grpc":"otlp-http";let m=VBe(e.COPILOT_OTEL_CAPTURE_CONTENT)??t.settingCaptureContent??!1,g=jCc(e.COPILOT_OTEL_MAX_ATTRIBUTE_SIZE_CHARS)??t.settingMaxAttributeSizeChars??0,A=new Set(["trace","debug","info","warn","error"]),y=e.COPILOT_OTEL_LOG_LEVEL,E=y&&A.has(y)?y:"info",_=VBe(e.COPILOT_OTEL_HTTP_INSTRUMENTATION)??!1,v=e.OTEL_SERVICE_NAME??"copilot-chat",b=UCc(e.OTEL_RESOURCE_ATTRIBUTES);return Object.freeze({enabled:!0,enabledExplicitly:o,enabledVia:s,exporterType:h,otlpEndpoint:d,otlpProtocol:l,captureContent:m,maxAttributeSizeChars:g<0?0:g,fileExporterPath:f,dbSpanExporter:r,logLevel:E,httpInstrumentation:_,serviceName:v,serviceVersion:t.extensionVersion,sessionId:t.sessionId,resourceAttributes:b})}a(qCc,"resolveOTelConfig");function P9i(t){return Object.freeze({enabled:!1,enabledExplicitly:!1,enabledVia:"disabled",exporterType:"otlp-http",otlpEndpoint:"",otlpProtocol:"http",captureContent:!1,maxAttributeSizeChars:0,dbSpanExporter:!1,logLevel:"info",httpInstrumentation:!1,serviceName:"copilot-chat",serviceVersion:t.extensionVersion,sessionId:t.sessionId,resourceAttributes:{}})}a(P9i,"createDisabledConfig");function VBe(t){if(t!==void 0)return t==="true"||t==="1"}a(VBe,"envBool");function jCc(t){if(t===void 0||t==="")return;let e=Number(t);if(Number.isSafeInteger(e))return e}a(jCc,"parseMaxAttributeSizeChars")});var GCt=I(HCt=>{"use strict";p();Object.defineProperty(HCt,"__esModule",{value:!0});HCt.IOTelService=void 0;var HCc=nn();HCt.IOTelService=(0,HCc.createServiceIdentifier)("IOTelService")});var D9i=I(iOr=>{"use strict";p();Object.defineProperty(iOr,"__esModule",{value:!0});iOr.normalizeResponseModel=GCc;function GCc(t,e){if(!e)return;if(!t)return e;let r=a(s=>s.replace(/\./g,"-").toLowerCase(),"canonical"),n=r(t),o=r(e);return n===o||n.startsWith(o+"-")?t:e}a(GCc,"normalizeResponseModel")});var O9i=I(Br=>{"use strict";p();Object.defineProperty(Br,"__esModule",{value:!0});Br.workspaceMetadataToOTelAttributes=Br.resolveWorkspaceOTelMetadata=Br.normalizeResponseModel=Br.IOTelService=Br.DEFAULT_OTLP_ENDPOINT=Br.resolveOTelConfig=Br.NoopOTelService=Br.truncateForOTel=Br.toToolDefinitions=Br.toSystemInstructions=Br.toOutputMessages=Br.toInputMessages=Br.stringifyToolsRawForTelemetry=Br.stringifyToolDefinitionsForOTel=Br.normalizeProviderMessages=Br.extractTextFromContent=Br.collectSystemTextsFromRequestBody=Br.GenAiMetrics=Br.emitUserFeedbackEvent=Br.emitToolCallEvent=Br.emitSessionStartEvent=Br.emitInlineDoneEvent=Br.emitInferenceDetailsEvent=Br.emitEditSurvivalEvent=Br.emitEditHunkActionEvent=Br.emitEditFeedbackEvent=Br.emitCloudSessionInvokeEvent=Br.emitAgentTurnEvent=Br.TOOL_PARAM_COMMAND_MAX_LEN=Br.StdAttr=Br.SHELL_TOOL_NAMES=Br.GitHubCopilotAttr=Br.GenAiToolType=Br.GenAiTokenType=Br.GenAiProviderName=Br.GenAiOperationName=Br.GenAiAttr=Br.FILE_TOOL_NAMES=Br.CopilotCliSdkAttr=Br.CopilotChatAttr=void 0;var nk=$Be();Object.defineProperty(Br,"CopilotChatAttr",{enumerable:!0,get:a(function(){return nk.CopilotChatAttr},"get")});Object.defineProperty(Br,"CopilotCliSdkAttr",{enumerable:!0,get:a(function(){return nk.CopilotCliSdkAttr},"get")});Object.defineProperty(Br,"FILE_TOOL_NAMES",{enumerable:!0,get:a(function(){return nk.FILE_TOOL_NAMES},"get")});Object.defineProperty(Br,"GenAiAttr",{enumerable:!0,get:a(function(){return nk.GenAiAttr},"get")});Object.defineProperty(Br,"GenAiOperationName",{enumerable:!0,get:a(function(){return nk.GenAiOperationName},"get")});Object.defineProperty(Br,"GenAiProviderName",{enumerable:!0,get:a(function(){return nk.GenAiProviderName},"get")});Object.defineProperty(Br,"GenAiTokenType",{enumerable:!0,get:a(function(){return nk.GenAiTokenType},"get")});Object.defineProperty(Br,"GenAiToolType",{enumerable:!0,get:a(function(){return nk.GenAiToolType},"get")});Object.defineProperty(Br,"GitHubCopilotAttr",{enumerable:!0,get:a(function(){return nk.GitHubCopilotAttr},"get")});Object.defineProperty(Br,"SHELL_TOOL_NAMES",{enumerable:!0,get:a(function(){return nk.SHELL_TOOL_NAMES},"get")});Object.defineProperty(Br,"StdAttr",{enumerable:!0,get:a(function(){return nk.StdAttr},"get")});Object.defineProperty(Br,"TOOL_PARAM_COMMAND_MAX_LEN",{enumerable:!0,get:a(function(){return nk.TOOL_PARAM_COMMAND_MAX_LEN},"get")});var kL=x9i();Object.defineProperty(Br,"emitAgentTurnEvent",{enumerable:!0,get:a(function(){return kL.emitAgentTurnEvent},"get")});Object.defineProperty(Br,"emitCloudSessionInvokeEvent",{enumerable:!0,get:a(function(){return kL.emitCloudSessionInvokeEvent},"get")});Object.defineProperty(Br,"emitEditFeedbackEvent",{enumerable:!0,get:a(function(){return kL.emitEditFeedbackEvent},"get")});Object.defineProperty(Br,"emitEditHunkActionEvent",{enumerable:!0,get:a(function(){return kL.emitEditHunkActionEvent},"get")});Object.defineProperty(Br,"emitEditSurvivalEvent",{enumerable:!0,get:a(function(){return kL.emitEditSurvivalEvent},"get")});Object.defineProperty(Br,"emitInferenceDetailsEvent",{enumerable:!0,get:a(function(){return kL.emitInferenceDetailsEvent},"get")});Object.defineProperty(Br,"emitInlineDoneEvent",{enumerable:!0,get:a(function(){return kL.emitInlineDoneEvent},"get")});Object.defineProperty(Br,"emitSessionStartEvent",{enumerable:!0,get:a(function(){return kL.emitSessionStartEvent},"get")});Object.defineProperty(Br,"emitToolCallEvent",{enumerable:!0,get:a(function(){return kL.emitToolCallEvent},"get")});Object.defineProperty(Br,"emitUserFeedbackEvent",{enumerable:!0,get:a(function(){return kL.emitUserFeedbackEvent},"get")});var $Cc=w9i();Object.defineProperty(Br,"GenAiMetrics",{enumerable:!0,get:a(function(){return $Cc.GenAiMetrics},"get")});var PL=ZMr();Object.defineProperty(Br,"collectSystemTextsFromRequestBody",{enumerable:!0,get:a(function(){return PL.collectSystemTextsFromRequestBody},"get")});Object.defineProperty(Br,"extractTextFromContent",{enumerable:!0,get:a(function(){return PL.extractTextFromContent},"get")});Object.defineProperty(Br,"normalizeProviderMessages",{enumerable:!0,get:a(function(){return PL.normalizeProviderMessages},"get")});Object.defineProperty(Br,"stringifyToolDefinitionsForOTel",{enumerable:!0,get:a(function(){return PL.stringifyToolDefinitionsForOTel},"get")});Object.defineProperty(Br,"stringifyToolsRawForTelemetry",{enumerable:!0,get:a(function(){return PL.stringifyToolsRawForTelemetry},"get")});Object.defineProperty(Br,"toInputMessages",{enumerable:!0,get:a(function(){return PL.toInputMessages},"get")});Object.defineProperty(Br,"toOutputMessages",{enumerable:!0,get:a(function(){return PL.toOutputMessages},"get")});Object.defineProperty(Br,"toSystemInstructions",{enumerable:!0,get:a(function(){return PL.toSystemInstructions},"get")});Object.defineProperty(Br,"toToolDefinitions",{enumerable:!0,get:a(function(){return PL.toToolDefinitions},"get")});Object.defineProperty(Br,"truncateForOTel",{enumerable:!0,get:a(function(){return PL.truncateForOTel},"get")});var VCc=rOr();Object.defineProperty(Br,"NoopOTelService",{enumerable:!0,get:a(function(){return VCc.NoopOTelService},"get")});var N9i=nOr();Object.defineProperty(Br,"resolveOTelConfig",{enumerable:!0,get:a(function(){return N9i.resolveOTelConfig},"get")});Object.defineProperty(Br,"DEFAULT_OTLP_ENDPOINT",{enumerable:!0,get:a(function(){return N9i.DEFAULT_OTLP_ENDPOINT},"get")});var WCc=GCt();Object.defineProperty(Br,"IOTelService",{enumerable:!0,get:a(function(){return WCc.IOTelService},"get")});var zCc=D9i();Object.defineProperty(Br,"normalizeResponseModel",{enumerable:!0,get:a(function(){return zCc.normalizeResponseModel},"get")});var M9i=XMr();Object.defineProperty(Br,"resolveWorkspaceOTelMetadata",{enumerable:!0,get:a(function(){return M9i.resolveWorkspaceOTelMetadata},"get")});Object.defineProperty(Br,"workspaceMetadataToOTelAttributes",{enumerable:!0,get:a(function(){return M9i.workspaceMetadataToOTelAttributes},"get")})});var aOr=I(dV=>{"use strict";p();Object.defineProperty(dV,"__esModule",{value:!0});dV.AbstractRequestLogger=void 0;dV.getCurrentCapturingToken=ZCc;dV.storeCapturingTokenForCorrelation=XCc;dV.retrieveCapturingTokenByCorrelation=ebc;dV.runWithCapturingToken=tbc;var YCc=require("async_hooks"),KCc=Tye(),JCc=Ro(),WBe=new YCc.AsyncLocalStorage,oOr=new Map;function ZCc(){return WBe.getStore()}a(ZCc,"getCurrentCapturingToken");function XCc(t){let e=WBe.getStore();e&&oOr.set(t,e)}a(XCc,"storeCapturingTokenForCorrelation");function ebc(t){let e=oOr.get(t);return e&&oOr.delete(t),e}a(ebc,"retrieveCapturingTokenByCorrelation");function tbc(t,e){return WBe.run(t,e)}a(tbc,"runWithCapturingToken");var sOr=class extends JCc.Disposable{static{a(this,"AbstractRequestLogger")}get promptRendererTracing(){return!1}captureInvocation(e,r){return WBe.run(e,()=>r())}logContentExclusionRules(e,r,n){}logChatRequest(e,r,n){return new KCc.PendingLoggedChatRequest(this,e,r,n)}enableWorkspaceEditTracing(){}disableWorkspaceEditTracing(){}get currentRequest(){return WBe.getStore()}};dV.AbstractRequestLogger=sOr});var L9i=I(cOr=>{"use strict";p();Object.defineProperty(cOr,"__esModule",{value:!0});cOr.isEncryptedThinkingDelta=rbc;function rbc(t){return t.encrypted!==void 0}a(rbc,"isEncryptedThinkingDelta")});var F9i=I($Ct=>{"use strict";p();Object.defineProperty($Ct,"__esModule",{value:!0});$Ct.calculateLineRepetitionStats=ibc;$Ct.isRepetitive=obc;var nbc=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60},{max_token_sequence_length:60,last_tokens_to_consider:120}];function ibc(t){if(t.length===0)return{numberOfRepetitions:0,mostRepeatedLine:"",totalLines:0};let e=new Map,r=t.split(` +`);for(let s of r){if(s=s.trim(),s.length===0)continue;let c=e.get(s)||0;e.set(s,c+1)}let n="",o=0;for(let[s,c]of e.entries())c>o&&(o=c,n=s);return{numberOfRepetitions:o,mostRepeatedLine:n,totalLines:r.length}}a(ibc,"calculateLineRepetitionStats");function obc(t){let e=t.slice();return e.reverse(),B9i(e)||B9i(e.filter(r=>r.trim().length>0))}a(obc,"isRepetitive");function B9i(t){let e=sbc(t);for(let r of nbc){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(sbc,"kmp_prefix_function")});var lOr=I(DL=>{"use strict";p();var abc=DL&&DL.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},fV=DL&&DL.__param||function(t,e){return function(r,n){e(r,n,t)}},ik;Object.defineProperty(DL,"__esModule",{value:!0});DL.OpenAIEndpoint=void 0;DL.isBYOKModel=Ebc;var cbc=l9(),U9i=JR(),Q9i=Pl(),lbc=lV(),ubc=Xne(),dbc=xp(),fbc=i9(),pbc=NCt(),hbc=f9(),mbc=yh(),gbc=cV(),Abc=$s();function ybc(t){return t.type===U9i.ChatFetchResponseType.Failed&&t.streamError?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:JSON.stringify(t.streamError)}:t.type===U9i.ChatFetchResponseType.RateLimited?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:t.capiError?`Rate limit exceeded -`+JSON.stringify(t.capiError):"Rate limit exceeded",rateLimitKey:"",retryAfter:void 0,isAuto:!1,capiError:t.capiError}:t}a(W_c,"hydrateBYOKErrorMessages");function z_c(t){return t?t instanceof _Ct||t.isExtensionContributed?1:t.customModel?2:-1:-1}a(z_c,"isBYOKModel");var _Ct=class extends U_c.ChatEndpoint{static{a(this,"OpenAIEndpoint")}static{YR=this}static{this._reservedHeaders=new Set(["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","date","dnt","expect","host","keep-alive","origin","permissions-policy","referer","te","trailer","transfer-encoding","upgrade","user-agent","via","forwarded","x-forwarded-for","x-forwarded-host","x-forwarded-proto","api-key","authorization","content-type","openai-intent","x-github-api-version","x-initiator","x-interaction-id","x-interaction-type","x-onbehalf-extension-id","x-request-id","x-vscode-user-agent-library-version"])}static{this._validHeaderNamePattern=/^[!#$%&'*+\-.0-9A-Z^_`a-z|~]+$/}static{this._maxHeaderNameLength=256}static{this._maxHeaderValueLength=8192}static{this._maxCustomHeaderCount=20}constructor(e,r,n,o,s,c,l,u,d,f,h){super(e,o,s,c,l,u,d,f,h),this._apiKey=r,this._modelUrl=n,this.instantiationService=l,this.logService=h,this.ownsAuthorization=!0,this._customHeaders=this._sanitizeCustomHeaders(e.requestHeaders)}_isReservedHeader(e){return YR._reservedHeaders.has(e)}_sanitizeCustomHeaders(e){if(!e)return{};let r=Object.entries(e);r.length>YR._maxCustomHeaderCount&&this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has ${r.length} custom headers, exceeding limit of ${YR._maxCustomHeaderCount}. Only first ${YR._maxCustomHeaderCount} will be processed.`);let n={},o=0;for(let[s,c]of r){if(o>=YR._maxCustomHeaderCount)break;let l=s.trim();if(!l){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has empty header name, skipping.`);continue}if(l.length>YR._maxHeaderNameLength){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has header name exceeding ${YR._maxHeaderNameLength} characters, skipping.`);continue}if(!YR._validHeaderNamePattern.test(l)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has invalid header name format: '${l}', Skipping.`);continue}let u=l.toLowerCase();if(this._isReservedHeader(u)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to override reserved header '${l}', skipping.`);continue}if(u.startsWith("proxy-")||u.startsWith("sec-")){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to set forbidden header pattern '${l}', skipping.`);continue}if(u==="x-http-method"||u==="x-http-method-override"||u==="x-method-override"){let f=["connect","trace","track"],h=String(c).toLowerCase().trim();if(f.includes(h)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to set forbidden method '${h}' in header '${l}', skipping.`);continue}}let d=this._sanitizeHeaderValue(c);if(d===void 0){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has invalid value for header '${l}': '${c}', skipping.`);continue}n[l]=d,o++}return n}_sanitizeHeaderValue(e){if(typeof e!="string")return;let r=e.trim();if(!(r.length>YR._maxHeaderValueLength)&&!/[\x00-\x1F\x7F]/.test(r)&&!/[\u200B-\u200D\u202A-\u202E\uFEFF]/.test(r))return r}createRequestBody(e){if(this.useResponsesApi){let r=!!this.modelMetadata.zeroDataRetentionEnabled;e.ignoreStatefulMarker=e.ignoreStatefulMarker||r;let n=super.createRequestBody(e);return n.store=!r,n.n=void 0,n.stream_options=void 0,this.modelMetadata.capabilities.supports.thinking||(n.reasoning=void 0,n.include=void 0),n.previous_response_id&&(!n.previous_response_id.startsWith("resp_")||r)&&(n.previous_response_id=void 0),this._applyReasoningEffort(n,e),n}else{if(this.useMessagesApi)return super.createRequestBody(e);{let r=!!this.modelMetadata.capabilities.supports.thinking,n=a((s,c)=>{if(c&&c.id){s.cot_id=c.id;let l=Array.isArray(c.text)?c.text.join(""):c.text;s.cot_summary=l,r&&(s.reasoning_content=l,s.reasoning=l)}},"callback"),o=(0,j_c.createCapiRequestBody)(e,this.model,n);return this._applyReasoningEffort(o,e),o}}}_applyReasoningEffort(e,r){let n=this.supportsReasoningEffort;if(!n?.length)return;let o=this.modelMetadata.reasoningEffortFormat??(this.useResponsesApi?"responses":"chat-completions"),c=this._configurationService.getConfig(z8i.ConfigKey.Advanced.ReasoningEffortOverride)||r.modelCapabilities?.reasoningEffort||e.reasoning?.effort||e.reasoning_effort,l=c&&n.includes(c)?c:void 0;if(e.reasoning){let{effort:u,...d}=e.reasoning;e.reasoning=Object.keys(d).length>0?d:void 0}e.reasoning_effort=void 0,l&&(o==="responses"?e.reasoning={...e.reasoning,effort:l}:e.reasoning_effort=l)}interceptBody(e){super.interceptBody(e),e?.tools?.length===0&&delete e.tools,e?.tools&&(e.tools=e.tools.map(r=>((0,q_c.isOpenAiFunctionTool)(r)&&r.function.parameters===void 0&&(r.function.parameters={type:"object",properties:{}}),r))),e&&(this.modelMetadata.capabilities.supports.thinking&&(delete e.temperature,!this.useMessagesApi&&!this.useResponsesApi&&(e.max_completion_tokens=e.max_tokens,delete e.max_tokens)),this.useMessagesApi||delete e.max_tokens,!this.useResponsesApi&&!this.useMessagesApi&&e.stream&&(e.stream_options={include_usage:!0}))}get urlOrRequestMetadata(){return this._modelUrl}getExtraHeaders(){let e={"Content-Type":"application/json"};this._modelUrl.includes("openai.azure")?e["api-key"]=this._apiKey:e.Authorization=`Bearer ${this._apiKey}`;for(let[r,n]of Object.entries(this._customHeaders))e[r]=n;return e}cloneWithTokenOverride(e){let r={...this.modelMetadata,maxInputTokens:e};return this.instantiationService.createInstance(YR,r,this._apiKey,this._modelUrl)}async makeChatRequest2(e,r){let n={...e,ignoreStatefulMarker:e.ignoreStatefulMarker??!1},o=await super.makeChatRequest2(n,r);return W_c(o)}};wL.OpenAIEndpoint=_Ct;wL.OpenAIEndpoint=_Ct=YR=L_c([eV(3,F_c.IDomainService),eV(4,B_c.IChatMLFetcher),eV(5,$_c.ITokenizerProvider),eV(6,V_c.IInstantiationService),eV(7,z8i.IConfigurationService),eV(8,G_c.IExperimentationService),eV(9,H_c.IChatWebSocketManager),eV(10,Q_c.ILogService)],_Ct)});var Y8i=I(lN=>{"use strict";p();Object.defineProperty(lN,"__esModule",{value:!0});lN.EXTENSION_ID=lN.agentsToCommands=lN.GITHUB_PLATFORM_AGENT=void 0;lN.getAgentForIntent=K_c;var Y_c=jR();lN.GITHUB_PLATFORM_AGENT="github.copilot-dynamic.platform";lN.agentsToCommands={editAgent:{explain:"explain",edit:"edit",review:"review",tests:"tests",fix:"fix",new:"new",newNotebook:"newNotebook",semanticSearch:"semanticSearch",setupTests:"setupTests",compact:"editAgent"},vscode:{search:"search"},terminal:{explain:"terminalExplain"},editor:{doc:"doc",fix:"fix",explain:"explain",review:"review",tests:"tests",edit:"edit",generate:"generate"}};function K_c(t,e){if(Object.keys(lN.agentsToCommands).includes(t))return{agent:t};for(let[r,n]of Object.entries(lN.agentsToCommands))if(!(e===Y_c.ChatLocation.Editor&&r!=="editor")&&Object.values(n).includes(t))return{agent:r,command:t}}a(K_c,"getAgentForIntent");lN.EXTENSION_ID="GitHub.copilot-chat"});var Z8i=I(vCt=>{"use strict";p();Object.defineProperty(vCt,"__esModule",{value:!0});vCt.ChatMLFetcherTelemetrySender=void 0;var K8i=XNr(),mMr=tMr(),J8i=hMr();function J_c(t){let e=t.properties.turnIndex;if(typeof e!="string")return;let r=Number(e);return Number.isFinite(r)?r:void 0}a(J_c,"getTurnFromBaseTelemetry");function gMr(t,e,r,n,o){t.sendTelemetryEvent(e,{github:!0,microsoft:!0},r,n),o.imageCount>0&&t.sendEnhancedGHTelemetryEvent(e,r,n)}a(gMr,"sendResponseTelemetryEvent");var AMr=class{static{a(this,"ChatMLFetcherTelemetrySender")}static sendSuccessTelemetry(e,{chatCompletion:r,baseTelemetry:n,userInitiatedRequest:o,interactionType:s,chatEndpointInfo:c,requestBody:l,maxResponseTokens:u,promptTokenCount:d,timeToFirstToken:f,timeToFirstTokenEmitted:h,hasImageMessages:m,imageTelemetryMeasurements:g,transport:A,fetcher:y,bytesReceived:E,suspendEventSeen:_,resumeEventSeen:v,modelCallId:b}){gMr(e,"response.success",{reason:r.finishReason,filterReason:r.filterReason,source:n?.properties.messageSource??"unknown",initiatorType:o?"user":"agent",requestKind:s,conversationId:n?.properties.conversationId,model:c?.model,modelInvoked:r.model,apiType:c?.apiType,requestId:r.requestId.headerRequestId,gitHubRequestId:r.requestId.gitHubRequestId,associatedRequestId:n?.properties.associatedRequestId,parentRequestId:n?.properties.parentRequestId,reasoningEffort:l.reasoning?.effort??l.output_config?.effort,reasoningSummary:l.reasoning?.summary,modelCallId:b,...n?.properties.subType?{subType:n.properties.subType}:{},...n?.properties.parentModelCallId?{parentModelCallId:n.properties.parentModelCallId}:{},...n?.properties.iterationNumber?{iterationNumber:n.properties.iterationNumber}:{},...y?{fetcher:y}:{},transport:A,...n?.properties.retryAfterError?{retryAfterError:n.properties.retryAfterError}:{},...n?.properties.retryAfterErrorGitHubRequestId?{retryAfterErrorGitHubRequestId:n.properties.retryAfterErrorGitHubRequestId}:{},...n?.properties.connectivityTestError?{connectivityTestError:n.properties.connectivityTestError}:{},...n?.properties.connectivityTestErrorGitHubRequestId?{connectivityTestErrorGitHubRequestId:n.properties.connectivityTestErrorGitHubRequestId}:{},...n?.properties.retryAfterFilterCategory?{retryAfterFilterCategory:n.properties.retryAfterFilterCategory}:{}},{turn:J_c(n),totalTokenMax:c?.modelMaxPromptTokens??-1,tokenCountMax:u,promptTokenCount:r.usage?.prompt_tokens,promptCacheTokenCount:r.usage?.prompt_tokens_details?.cached_tokens,promptCacheCreation1hTokenCount:r.usage?.prompt_tokens_details?.anthropic_cache_creation?.ephemeral_1h_input_tokens,promptCacheCreation5mTokenCount:r.usage?.prompt_tokens_details?.anthropic_cache_creation?.ephemeral_5m_input_tokens,clientPromptTokenCount:d,tokenCount:r.usage?.total_tokens,reasoningTokens:r.usage?.completion_tokens_details?.reasoning_tokens,acceptedPredictionTokens:r.usage?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:r.usage?.completion_tokens_details?.rejected_prediction_tokens,completionTokens:r.usage?.completion_tokens,timeToFirstToken:f,timeToFirstTokenEmitted:h,timeToComplete:Date.now()-n.issuedTime,issuedTime:n.issuedTime,isVisionRequest:m?1:-1,...(0,mMr.getImageTelemetryEventMeasurements)(g),isBYOK:(0,J8i.isBYOKModel)(c),isAuto:(0,K8i.isAutoModel)(c),bytesReceived:E,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0},g)}static sendCancellationTelemetry(e,{source:r,requestId:n,model:o,apiType:s,transport:c,interactionType:l,conversationId:u,associatedRequestId:d,parentRequestId:f,retryAfterError:h,retryAfterErrorGitHubRequestId:m,connectivityTestError:g,connectivityTestErrorGitHubRequestId:A,retryAfterFilterCategory:y,fetcher:E,suspendEventSeen:_,resumeEventSeen:v},{totalTokenMax:b,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:P,isVisionRequest:D,isBYOK:N,isAuto:L,bytesReceived:B,issuedTime:q,imageTelemetryMeasurements:M}){gMr(e,"response.cancelled",{apiType:s,source:r,requestId:n,model:o,requestKind:l,conversationId:u,associatedRequestId:d,parentRequestId:f,...E?{fetcher:E}:{},transport:c,...h?{retryAfterError:h}:{},...m?{retryAfterErrorGitHubRequestId:m}:{},...g?{connectivityTestError:g}:{},...A?{connectivityTestErrorGitHubRequestId:A}:{},...y?{retryAfterFilterCategory:y}:{}},{totalTokenMax:b,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:P,timeToComplete:P,issuedTime:q,isVisionRequest:D,...(0,mMr.getImageTelemetryEventMeasurements)(M),isBYOK:N,isAuto:L,bytesReceived:B,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0},M)}static sendResponseErrorTelemetry(e,{processed:r,telemetryProperties:n,chatEndpointInfo:o,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToFirstToken:u,isVisionRequest:d,imageTelemetryMeasurements:f,transport:h,interactionType:m,fetcher:g,bytesReceived:A,issuedTime:y,wasRetried:E,suspendEventSeen:_,resumeEventSeen:v}){gMr(e,"response.error",{type:r.type,reason:r.reasonDetail||r.reason,source:n?.messageSource??"unknown",requestKind:m,requestId:r.requestId,gitHubRequestId:r.serverRequestId,model:o.model,apiType:o.apiType,conversationId:n?.conversationId,reasoningEffort:s.reasoning?.effort??s.output_config?.effort,reasoningSummary:s.reasoning?.summary,...g?{fetcher:g}:{},transport:h,associatedRequestId:n?.associatedRequestId,parentRequestId:n?.parentRequestId,...n?.retryAfterError?{retryAfterError:n.retryAfterError}:{},...n?.retryAfterErrorGitHubRequestId?{retryAfterErrorGitHubRequestId:n.retryAfterErrorGitHubRequestId}:{},...n?.connectivityTestError?{connectivityTestError:n.connectivityTestError}:{},...n?.connectivityTestErrorGitHubRequestId?{connectivityTestErrorGitHubRequestId:n.connectivityTestErrorGitHubRequestId}:{},...n?.retryAfterFilterCategory?{retryAfterFilterCategory:n.retryAfterFilterCategory}:{}},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:c,tokenCountMax:l,timeToFirstToken:u,timeToComplete:Date.now()-y,issuedTime:y,isVisionRequest:d?1:-1,...(0,mMr.getImageTelemetryEventMeasurements)(f),isBYOK:(0,J8i.isBYOKModel)(o),isAuto:(0,K8i.isAutoModel)(o),wasRetried:E?1:0,bytesReceived:A,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0},f)}};vCt.ChatMLFetcherTelemetrySender=AMr});var s6i=I(pI=>{"use strict";p();var Z_c=pI&&pI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},qv=pI&&pI.__param||function(t,e){return function(r,n){e(r,n,t)}},CMr;Object.defineProperty(pI,"__esModule",{value:!0});pI.ChatMLFetcherImpl=pI.AbstractChatMLFetcher=void 0;pI.createTelemetryData=o6i;pI.locationToIntent=TCt;var X_c=Io(),evc=FE(),tvc=K6(),rvc=QDr(),zn=jR(),nvc=qDr(),TBe=nBe(),ivc=HDr(),tV=Pl(),ovc=$E(),CCt=XNr(),IBe=zvt(),svc=tMr(),bMr=Sp(),yMr=$6(),avc=_y(),bCt=aCt(),fI=H6(),X8i=fBe(),i6i=X6(),e6i=jvt(),gn=R8i(),on=H8i(),cvc=yCt(),lvc=lye(),EMr=fMr(),uvc=mh(),SMr=gm(),Mye=Tye(),dvc=G8i(),SCt=V8i(),fvc=X_(),t6i=nl(),r6i=Rs(),pvc=Ic(),hvc=Ro(),mvc=em(),_Mr=T0(),gvc=Gs(),n6i=hMr(),Avc=Y8i(),yvc=BDr(),Nye=Z8i(),ICt=class extends hvc.Disposable{static{a(this,"AbstractChatMLFetcher")}constructor(e){super(),this.options=e,this._onDidMakeChatMLRequest=this._register(new pvc.Emitter),this.onDidMakeChatMLRequest=this._onDidMakeChatMLRequest.event}preparePostOptions(e){return{temperature:this.options.temperature,top_p:this.options.topP,stream:!0,...e}}async fetchOne(e,r){let n=await this.fetchMany({...e,requestOptions:{...e.requestOptions,n:1}},r);return n.type===zn.ChatFetchResponseType.Success?{...n,value:n.value[0]}:n}};pI.AbstractChatMLFetcher=ICt;var TMr=class extends ICt{static{a(this,"ChatMLFetcherImpl")}static{CMr=this}static{this._maxConsecutiveWebSocketFallbacks=3}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y){super(d),this._fetcherService=e,this._telemetryService=r,this._requestLogger=n,this._logService=o,this._authenticationService=s,this._interactionService=c,this._chatQuotaService=l,this._capiClientService=u,this._configurationService=f,this._experimentationService=h,this._powerService=m,this._instantiationService=g,this._webSocketManager=A,this._otelService=y,this.connectivityCheckDelays=[1e3,1e4,1e4],this._consecutiveWebSocketRetryFallbacks=0}async fetchMany(e,r){let{debugName:n,endpoint:o,finishedCb:s,location:c,messages:l,requestOptions:u,source:d,telemetryProperties:f,userInitiatedRequest:h,interactionTypeOverride:m,conversationId:g,turnId:A,topLevelTurnId:y,useWebSocket:E,ignoreStatefulMarker:_}=e,v=m??TCt(c);E&&this._consecutiveWebSocketRetryFallbacks>=CMr._maxConsecutiveWebSocketFallbacks&&(this._logService.debug(`[ChatWebSocketManager] Disabling WebSocket for request due to ${this._consecutiveWebSocketRetryFallbacks} consecutive WebSocket failures with successful HTTP fallback.`),E=!1,_=!0),f||(f={}),f.messageSource||(f.messageSource=n);let b=E?"websocket":"http",T=f.requestId??f.messageId??(0,_Mr.generateUuid)(),w=o.maxOutputTokens;u?.prediction||(u={max_tokens:w,...u}),u.prediction?.content||delete u.prediction;let R=this.preparePostOptions(u),x=o.createRequestBody({...e,ignoreStatefulMarker:_,requestId:T,postOptions:R}),P=(0,svc.getImageTelemetryMeasurementsFromMessages)(l),D=Mye.TelemetryData.createAndMarkAsIssued({...f,...g?{conversationId:g}:{},headerRequestId:T,baseModel:o.model,uiKind:zn.ChatLocation.toString(c)}),N=this._requestLogger.logChatRequest(n,o,{messages:e.messages,model:o.model,ourRequestId:T,location:e.location,body:x,ignoreStatefulMarker:_,isConversationRequest:e.isConversationRequest,customMetadata:e.customMetadata}),L=-1,B=new tvc.FetchStreamRecorder(s),q=e.enableRetryOnError??e.enableRetryOnFilter,M=e.canRetryOnceWithoutRollback??!(e.enableRetryOnFilter||e.enableRetryOnError),O,j,Q,U,Y,W,V,z;try{let ie,H=Evc(e.messages,R,o,this._configurationService,this._experimentationService);if(!H.isValid)ie={type:gn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:gn.ChatFailKind.ValidationFailed,reason:H.reason};else{let ge,Ue=a(()=>ge??=o.acquireTokenizer().countMessagesTokens(l),"countTokens"),ke;try{ke=await this._authenticationService.getCopilotToken()}catch{}O=ke?.username??this._authenticationService.copilotToken?.username;let X=await this._fetchAndStreamChat(o,x,D,B.callback,u.secretKey,ke,e.location,T,R.n,r,Ue,h,E,A,g,f,e.useFetcher,M,m,e.summarizedAtRoundId,e.modeChanged);if(ie=X.result,j=X.fetcher,Q=X.bytesReceived,U=X.statusCode,Y=X.suspendEventSeen,W=X.resumeEventSeen,V=X.modelCallId,z=X.otelSpan,z?.setAttribute(on.GenAiAttr.AGENT_NAME,n),z){let he=(x.messages??x.input)?.filter(ne=>ne.role==="user"),Z=he?.[he.length-1];if(Z?.content){let ne=typeof Z.content=="string"?Z.content:JSON.stringify(Z.content);z.setAttribute(on.CopilotChatAttr.USER_REQUEST,(0,on.truncateForOTel)(ne,this._otelService.config.maxAttributeSizeChars))}let ue=(0,on.collectSystemTextsFromRequestBody)(x),qe=(0,on.toSystemInstructions)(ue);qe&&z.setAttribute(on.GenAiAttr.SYSTEM_INSTRUCTIONS,(0,on.truncateForOTel)(JSON.stringify(qe),this._otelService.config.maxAttributeSizeChars))}if(z){let K=x.messages??x.input;if(K){let qe=K.filter(ne=>ne.role!=="system");z.setAttribute(on.GenAiAttr.INPUT_MESSAGES,(0,on.truncateForOTel)(JSON.stringify((0,on.normalizeProviderMessages)(qe)),this._otelService.config.maxAttributeSizeChars))}let he=(0,on.stringifyToolDefinitionsForOTel)(x.tools);he&&z.setAttribute(on.GenAiAttr.TOOL_DEFINITIONS,(0,on.truncateForOTel)(he,this._otelService.config.maxAttributeSizeChars));let Z=_vc(x);Z&&z.setAttribute(on.CopilotChatAttr.REQUEST_OPTIONS,(0,on.truncateForOTel)(JSON.stringify(Z),this._otelService.config.maxAttributeSizeChars));let ue=vvc(x);ue&&z.setAttribute(on.CopilotChatAttr.REQUEST_SHAPE,(0,on.truncateForOTel)(JSON.stringify(ue),this._otelService.config.maxAttributeSizeChars))}L=await Ue();let ee=d?.extensionId??Avc.EXTENSION_ID;this._onDidMakeChatMLRequest.fire({messages:l,model:o.model,source:{extensionId:ee},tokenCount:L})}let re=Date.now()-D.issuedTime;N?.markTimeToFirstToken(re);let le,Le;switch(ie.type){case gn.FetchResponseKind.Success:{let ge=await this.processSuccessfulResponse(ie,l,P,x,T,w,L,re,B,D,o,h,v,b,j,Q,Y,W,V);if(ge.type===zn.ChatFetchResponseType.FilteredRetry){if(e.enableRetryOnFilter){B.callback("",0,{text:"",retryReason:ge.category});let Ue=ge.value[0];if(Ue){let ke=ge.category===fI.FilterReason.Copyright?`The previous response (copied below) was filtered due to being too similar to existing public code. Please suggest something similar in function that does not match public code. Here's the previous response: ${Ue} +`+JSON.stringify(t.capiError):"Rate limit exceeded",rateLimitKey:"",retryAfter:void 0,isAuto:!1,capiError:t.capiError}:t}a(ybc,"hydrateBYOKErrorMessages");function Ebc(t){return t?t instanceof VCt||t.isExtensionContributed?1:t.customModel?2:-1:-1}a(Ebc,"isBYOKModel");var VCt=class extends ubc.ChatEndpoint{static{a(this,"OpenAIEndpoint")}static{ik=this}static{this._reservedHeaders=new Set(["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","date","dnt","expect","host","keep-alive","origin","permissions-policy","referer","te","trailer","transfer-encoding","upgrade","user-agent","via","forwarded","x-forwarded-for","x-forwarded-host","x-forwarded-proto","api-key","authorization","content-type","openai-intent","x-github-api-version","x-initiator","x-interaction-id","x-interaction-type","x-onbehalf-extension-id","x-request-id","x-vscode-user-agent-library-version"])}static{this._validHeaderNamePattern=/^[!#$%&'*+\-.0-9A-Z^_`a-z|~]+$/}static{this._maxHeaderNameLength=256}static{this._maxHeaderValueLength=8192}static{this._maxCustomHeaderCount=20}constructor(e,r,n,o,s,c,l,u,d,f,h){super(e,o,s,c,l,u,d,f,h),this._apiKey=r,this._modelUrl=n,this.instantiationService=l,this.logService=h,this.ownsAuthorization=!0,this._customHeaders=this._sanitizeCustomHeaders(e.requestHeaders)}_isReservedHeader(e){return ik._reservedHeaders.has(e)}_sanitizeCustomHeaders(e){if(!e)return{};let r=Object.entries(e);r.length>ik._maxCustomHeaderCount&&this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has ${r.length} custom headers, exceeding limit of ${ik._maxCustomHeaderCount}. Only first ${ik._maxCustomHeaderCount} will be processed.`);let n={},o=0;for(let[s,c]of r){if(o>=ik._maxCustomHeaderCount)break;let l=s.trim();if(!l){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has empty header name, skipping.`);continue}if(l.length>ik._maxHeaderNameLength){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has header name exceeding ${ik._maxHeaderNameLength} characters, skipping.`);continue}if(!ik._validHeaderNamePattern.test(l)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has invalid header name format: '${l}', Skipping.`);continue}let u=l.toLowerCase();if(this._isReservedHeader(u)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to override reserved header '${l}', skipping.`);continue}if(u.startsWith("proxy-")||u.startsWith("sec-")){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to set forbidden header pattern '${l}', skipping.`);continue}if(u==="x-http-method"||u==="x-http-method-override"||u==="x-method-override"){let f=["connect","trace","track"],h=String(c).toLowerCase().trim();if(f.includes(h)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to set forbidden method '${h}' in header '${l}', skipping.`);continue}}let d=this._sanitizeHeaderValue(c);if(d===void 0){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has invalid value for header '${l}': '${c}', skipping.`);continue}n[l]=d,o++}return n}_sanitizeHeaderValue(e){if(typeof e!="string")return;let r=e.trim();if(!(r.length>ik._maxHeaderValueLength)&&!/[\x00-\x1F\x7F]/.test(r)&&!/[\u200B-\u200D\u202A-\u202E\uFEFF]/.test(r))return r}createRequestBody(e){if(this.useResponsesApi){let r=!!this.modelMetadata.zeroDataRetentionEnabled;e.ignoreStatefulMarker=e.ignoreStatefulMarker||r;let n=super.createRequestBody(e);return n.store=!r,n.n=void 0,n.stream_options=void 0,this.modelMetadata.capabilities.supports.thinking||(n.reasoning=void 0,n.include=void 0),n.previous_response_id&&(!n.previous_response_id.startsWith("resp_")||r)&&(n.previous_response_id=void 0),this._applyReasoningEffort(n,e),n}else{if(this.useMessagesApi)return super.createRequestBody(e);{let r=!!this.modelMetadata.capabilities.supports.thinking,n=a((s,c)=>{if(c&&c.id){s.cot_id=c.id;let l=Array.isArray(c.text)?c.text.join(""):c.text;s.cot_summary=l,r&&(s.reasoning_content=l,s.reasoning=l)}},"callback"),o=(0,pbc.createCapiRequestBody)(e,this.model,n);return this._applyReasoningEffort(o,e),o}}}_applyReasoningEffort(e,r){let n=this.supportsReasoningEffort;if(!n?.length)return;let o=this.modelMetadata.reasoningEffortFormat??(this.useResponsesApi?"responses":"chat-completions"),c=this._configurationService.getConfig(Q9i.ConfigKey.Advanced.ReasoningEffortOverride)||r.modelCapabilities?.reasoningEffort||e.reasoning?.effort||e.reasoning_effort,l=c&&n.includes(c)?c:void 0;if(e.reasoning){let{effort:u,...d}=e.reasoning;e.reasoning=Object.keys(d).length>0?d:void 0}e.reasoning_effort=void 0,l&&(o==="responses"?e.reasoning={...e.reasoning,effort:l}:e.reasoning_effort=l)}interceptBody(e){super.interceptBody(e),e?.tools?.length===0&&delete e.tools,e?.tools&&(e.tools=e.tools.map(r=>((0,fbc.isOpenAiFunctionTool)(r)&&r.function.parameters===void 0&&(r.function.parameters={type:"object",properties:{}}),r))),e&&(this.modelMetadata.capabilities.supports.thinking&&(delete e.temperature,!this.useMessagesApi&&!this.useResponsesApi&&(e.max_completion_tokens=e.max_tokens,delete e.max_tokens)),this.useMessagesApi||delete e.max_tokens,!this.useResponsesApi&&!this.useMessagesApi&&e.stream&&(e.stream_options={include_usage:!0}))}get urlOrRequestMetadata(){return this._modelUrl}getExtraHeaders(){let e={"Content-Type":"application/json"};this._modelUrl.includes("openai.azure")?e["api-key"]=this._apiKey:e.Authorization=`Bearer ${this._apiKey}`;for(let[r,n]of Object.entries(this._customHeaders))e[r]=n;return e}cloneWithTokenOverride(e){let r={...this.modelMetadata,maxInputTokens:e};return this.instantiationService.createInstance(ik,r,this._apiKey,this._modelUrl)}async makeChatRequest2(e,r){let n={...e,ignoreStatefulMarker:e.ignoreStatefulMarker??!1},o=await super.makeChatRequest2(n,r);return ybc(o)}};DL.OpenAIEndpoint=VCt;DL.OpenAIEndpoint=VCt=ik=abc([fV(3,lbc.IDomainService),fV(4,cbc.IChatMLFetcher),fV(5,gbc.ITokenizerProvider),fV(6,Abc.IInstantiationService),fV(7,Q9i.IConfigurationService),fV(8,mbc.IExperimentationService),fV(9,hbc.IChatWebSocketManager),fV(10,dbc.ILogService)],VCt)});var q9i=I(AN=>{"use strict";p();Object.defineProperty(AN,"__esModule",{value:!0});AN.EXTENSION_ID=AN.agentsToCommands=AN.GITHUB_PLATFORM_AGENT=void 0;AN.getAgentForIntent=vbc;var _bc=JR();AN.GITHUB_PLATFORM_AGENT="github.copilot-dynamic.platform";AN.agentsToCommands={editAgent:{explain:"explain",edit:"edit",review:"review",tests:"tests",fix:"fix",new:"new",newNotebook:"newNotebook",semanticSearch:"semanticSearch",setupTests:"setupTests",compact:"editAgent"},vscode:{search:"search"},terminal:{explain:"terminalExplain"},editor:{doc:"doc",fix:"fix",explain:"explain",review:"review",tests:"tests",edit:"edit",generate:"generate"}};function vbc(t,e){if(Object.keys(AN.agentsToCommands).includes(t))return{agent:t};for(let[r,n]of Object.entries(AN.agentsToCommands))if(!(e===_bc.ChatLocation.Editor&&r!=="editor")&&Object.values(n).includes(t))return{agent:r,command:t}}a(vbc,"getAgentForIntent");AN.EXTENSION_ID="GitHub.copilot-chat"});var G9i=I(WCt=>{"use strict";p();Object.defineProperty(WCt,"__esModule",{value:!0});WCt.ChatMLFetcherTelemetrySender=void 0;var j9i=zMr(),uOr=KMr(),H9i=lOr();function Cbc(t){let e=t.properties.turnIndex;if(typeof e!="string")return;let r=Number(e);return Number.isFinite(r)?r:void 0}a(Cbc,"getTurnFromBaseTelemetry");function dOr(t,e,r,n,o){t.sendTelemetryEvent(e,{github:!0,microsoft:!0},r,n),o.imageCount>0&&t.sendEnhancedGHTelemetryEvent(e,r,n)}a(dOr,"sendResponseTelemetryEvent");var fOr=class{static{a(this,"ChatMLFetcherTelemetrySender")}static sendSuccessTelemetry(e,{chatCompletion:r,baseTelemetry:n,userInitiatedRequest:o,interactionType:s,chatEndpointInfo:c,requestBody:l,maxResponseTokens:u,promptTokenCount:d,timeToFirstToken:f,timeToFirstTokenEmitted:h,hasImageMessages:m,imageTelemetryMeasurements:g,transport:A,fetcher:y,bytesReceived:E,suspendEventSeen:_,resumeEventSeen:v,modelCallId:b}){dOr(e,"response.success",{reason:r.finishReason,filterReason:r.filterReason,source:n?.properties.messageSource??"unknown",initiatorType:o?"user":"agent",requestKind:s,conversationId:n?.properties.conversationId,model:c?.model,modelInvoked:r.model,apiType:c?.apiType,requestId:r.requestId.headerRequestId,gitHubRequestId:r.requestId.gitHubRequestId,associatedRequestId:n?.properties.associatedRequestId,parentRequestId:n?.properties.parentRequestId,reasoningEffort:l.reasoning?.effort??l.output_config?.effort,reasoningSummary:l.reasoning?.summary,modelCallId:b,...n?.properties.subType?{subType:n.properties.subType}:{},...n?.properties.parentModelCallId?{parentModelCallId:n.properties.parentModelCallId}:{},...n?.properties.iterationNumber?{iterationNumber:n.properties.iterationNumber}:{},...y?{fetcher:y}:{},transport:A,...n?.properties.retryAfterError?{retryAfterError:n.properties.retryAfterError}:{},...n?.properties.retryAfterErrorGitHubRequestId?{retryAfterErrorGitHubRequestId:n.properties.retryAfterErrorGitHubRequestId}:{},...n?.properties.connectivityTestError?{connectivityTestError:n.properties.connectivityTestError}:{},...n?.properties.connectivityTestErrorGitHubRequestId?{connectivityTestErrorGitHubRequestId:n.properties.connectivityTestErrorGitHubRequestId}:{},...n?.properties.retryAfterFilterCategory?{retryAfterFilterCategory:n.properties.retryAfterFilterCategory}:{}},{turn:Cbc(n),totalTokenMax:c?.modelMaxPromptTokens??-1,tokenCountMax:u,promptTokenCount:r.usage?.prompt_tokens,promptCacheTokenCount:r.usage?.prompt_tokens_details?.cached_tokens,promptCacheCreation1hTokenCount:r.usage?.prompt_tokens_details?.anthropic_cache_creation?.ephemeral_1h_input_tokens,promptCacheCreation5mTokenCount:r.usage?.prompt_tokens_details?.anthropic_cache_creation?.ephemeral_5m_input_tokens,clientPromptTokenCount:d,tokenCount:r.usage?.total_tokens,reasoningTokens:r.usage?.completion_tokens_details?.reasoning_tokens,acceptedPredictionTokens:r.usage?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:r.usage?.completion_tokens_details?.rejected_prediction_tokens,completionTokens:r.usage?.completion_tokens,timeToFirstToken:f,timeToFirstTokenEmitted:h,timeToComplete:Date.now()-n.issuedTime,issuedTime:n.issuedTime,isVisionRequest:m?1:-1,...(0,uOr.getImageTelemetryEventMeasurements)(g),isBYOK:(0,H9i.isBYOKModel)(c),isAuto:(0,j9i.isAutoModel)(c),bytesReceived:E,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0},g)}static sendCancellationTelemetry(e,{source:r,requestId:n,model:o,apiType:s,transport:c,interactionType:l,conversationId:u,associatedRequestId:d,parentRequestId:f,retryAfterError:h,retryAfterErrorGitHubRequestId:m,connectivityTestError:g,connectivityTestErrorGitHubRequestId:A,retryAfterFilterCategory:y,fetcher:E,suspendEventSeen:_,resumeEventSeen:v},{totalTokenMax:b,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:P,isVisionRequest:D,isBYOK:N,isAuto:L,bytesReceived:B,issuedTime:j,imageTelemetryMeasurements:M}){dOr(e,"response.cancelled",{apiType:s,source:r,requestId:n,model:o,requestKind:l,conversationId:u,associatedRequestId:d,parentRequestId:f,...E?{fetcher:E}:{},transport:c,...h?{retryAfterError:h}:{},...m?{retryAfterErrorGitHubRequestId:m}:{},...g?{connectivityTestError:g}:{},...A?{connectivityTestErrorGitHubRequestId:A}:{},...y?{retryAfterFilterCategory:y}:{}},{totalTokenMax:b,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:P,timeToComplete:P,issuedTime:j,isVisionRequest:D,...(0,uOr.getImageTelemetryEventMeasurements)(M),isBYOK:N,isAuto:L,bytesReceived:B,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0},M)}static sendResponseErrorTelemetry(e,{processed:r,telemetryProperties:n,chatEndpointInfo:o,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToFirstToken:u,isVisionRequest:d,imageTelemetryMeasurements:f,transport:h,interactionType:m,fetcher:g,bytesReceived:A,issuedTime:y,wasRetried:E,suspendEventSeen:_,resumeEventSeen:v}){dOr(e,"response.error",{type:r.type,reason:r.reasonDetail||r.reason,source:n?.messageSource??"unknown",requestKind:m,requestId:r.requestId,gitHubRequestId:r.serverRequestId,model:o.model,apiType:o.apiType,conversationId:n?.conversationId,reasoningEffort:s.reasoning?.effort??s.output_config?.effort,reasoningSummary:s.reasoning?.summary,...g?{fetcher:g}:{},transport:h,associatedRequestId:n?.associatedRequestId,parentRequestId:n?.parentRequestId,...n?.retryAfterError?{retryAfterError:n.retryAfterError}:{},...n?.retryAfterErrorGitHubRequestId?{retryAfterErrorGitHubRequestId:n.retryAfterErrorGitHubRequestId}:{},...n?.connectivityTestError?{connectivityTestError:n.connectivityTestError}:{},...n?.connectivityTestErrorGitHubRequestId?{connectivityTestErrorGitHubRequestId:n.connectivityTestErrorGitHubRequestId}:{},...n?.retryAfterFilterCategory?{retryAfterFilterCategory:n.retryAfterFilterCategory}:{}},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:c,tokenCountMax:l,timeToFirstToken:u,timeToComplete:Date.now()-y,issuedTime:y,isVisionRequest:d?1:-1,...(0,uOr.getImageTelemetryEventMeasurements)(f),isBYOK:(0,H9i.isBYOKModel)(o),isAuto:(0,j9i.isAutoModel)(o),wasRetried:E?1:0,bytesReceived:A,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0},f)}};WCt.ChatMLFetcherTelemetrySender=fOr});var Z9i=I(EI=>{"use strict";p();var bbc=EI&&EI.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Gv=EI&&EI.__param||function(t,e){return function(r,n){e(r,n,t)}},AOr;Object.defineProperty(EI,"__esModule",{value:!0});EI.ChatMLFetcherImpl=EI.AbstractChatMLFetcher=void 0;EI.createTelemetryData=J9i;EI.locationToIntent=JCt;var Sbc=Io(),Tbc=HE(),Ibc=l9(),xbc=ONr(),Wn=JR(),wbc=LNr(),zBe=IBe(),Rbc=FNr(),pV=Pl(),kbc=KE(),zCt=zMr(),YBe=_Ct(),Pbc=KMr(),yOr=xp(),pOr=i9(),Dbc=Sy(),YCt=NCt(),yI=r9(),$9i=OBe(),K9i=f9(),V9i=hCt(),gn=v9i(),on=O9i(),Nbc=GCt(),Mbc=Tye(),hOr=aOr(),Obc=yh(),EOr=vm(),Kye=qye(),Lbc=L9i(),KCt=F9i(),Bbc=nv(),W9i=nl(),z9i=Rs(),Fbc=Rc(),Ubc=Ro(),Qbc=om(),mOr=x0(),qbc=$s(),Y9i=lOr(),jbc=q9i(),Hbc=DNr(),Yye=G9i(),ZCt=class extends Ubc.Disposable{static{a(this,"AbstractChatMLFetcher")}constructor(e){super(),this.options=e,this._onDidMakeChatMLRequest=this._register(new Fbc.Emitter),this.onDidMakeChatMLRequest=this._onDidMakeChatMLRequest.event}preparePostOptions(e){return{temperature:this.options.temperature,top_p:this.options.topP,stream:!0,...e}}async fetchOne(e,r){let n=await this.fetchMany({...e,requestOptions:{...e.requestOptions,n:1}},r);return n.type===Wn.ChatFetchResponseType.Success?{...n,value:n.value[0]}:n}};EI.AbstractChatMLFetcher=ZCt;var _Or=class extends ZCt{static{a(this,"ChatMLFetcherImpl")}static{AOr=this}static{this._maxConsecutiveWebSocketFallbacks=3}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y){super(d),this._fetcherService=e,this._telemetryService=r,this._requestLogger=n,this._logService=o,this._authenticationService=s,this._interactionService=c,this._chatQuotaService=l,this._capiClientService=u,this._configurationService=f,this._experimentationService=h,this._powerService=m,this._instantiationService=g,this._webSocketManager=A,this._otelService=y,this.connectivityCheckDelays=[1e3,1e4,1e4],this._consecutiveWebSocketRetryFallbacks=0}async fetchMany(e,r){let{debugName:n,endpoint:o,finishedCb:s,location:c,messages:l,requestOptions:u,source:d,telemetryProperties:f,userInitiatedRequest:h,interactionTypeOverride:m,conversationId:g,turnId:A,topLevelTurnId:y,useWebSocket:E,ignoreStatefulMarker:_}=e,v=m??JCt(c);E&&this._consecutiveWebSocketRetryFallbacks>=AOr._maxConsecutiveWebSocketFallbacks&&(this._logService.debug(`[ChatWebSocketManager] Disabling WebSocket for request due to ${this._consecutiveWebSocketRetryFallbacks} consecutive WebSocket failures with successful HTTP fallback.`),E=!1,_=!0),f||(f={}),f.messageSource||(f.messageSource=n);let b=E?"websocket":"http",T=f.requestId??f.messageId??(0,mOr.generateUuid)(),w=o.maxOutputTokens;u?.prediction||(u={max_tokens:w,...u}),u.prediction?.content||delete u.prediction;let R=this.preparePostOptions(u),x=o.createRequestBody({...e,ignoreStatefulMarker:_,requestId:T,postOptions:R}),P=(0,Pbc.getImageTelemetryMeasurementsFromMessages)(l),D=Kye.TelemetryData.createAndMarkAsIssued({...f,...g?{conversationId:g}:{},headerRequestId:T,baseModel:o.model,uiKind:Wn.ChatLocation.toString(c)}),N=this._requestLogger.logChatRequest(n,o,{messages:e.messages,model:o.model,ourRequestId:T,location:e.location,body:x,ignoreStatefulMarker:_,isConversationRequest:e.isConversationRequest,customMetadata:e.customMetadata}),L=-1,B=new Ibc.FetchStreamRecorder(s),j=e.enableRetryOnError??e.enableRetryOnFilter,M=e.canRetryOnceWithoutRollback??!(e.enableRetryOnFilter||e.enableRetryOnError),O,U,q,Q,Y,W,V,z;try{let ie,H=Gbc(e.messages,R,o,this._configurationService,this._experimentationService);if(!H.isValid)ie={type:gn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:gn.ChatFailKind.ValidationFailed,reason:H.reason};else{let ge,Oe=a(()=>ge??=o.acquireTokenizer().countMessagesTokens(l),"countTokens"),we;try{we=await this._authenticationService.getCopilotToken()}catch{}O=we?.username??this._authenticationService.copilotToken?.username;let re=await this._fetchAndStreamChat(o,x,D,B.callback,u.secretKey,we,e.location,T,R.n,r,Oe,h,E,A,g,f,e.useFetcher,M,m,e.summarizedAtRoundId,e.modeChanged);if(ie=re.result,U=re.fetcher,q=re.bytesReceived,Q=re.statusCode,Y=re.suspendEventSeen,W=re.resumeEventSeen,V=re.modelCallId,z=re.otelSpan,z?.setAttribute(on.GenAiAttr.AGENT_NAME,n),z){let he=(x.messages??x.input)?.filter(ne=>ne.role==="user"),X=he?.[he.length-1];if(X?.content){let ne=typeof X.content=="string"?X.content:JSON.stringify(X.content);z.setAttribute(on.CopilotChatAttr.USER_REQUEST,(0,on.truncateForOTel)(ne,this._otelService.config.maxAttributeSizeChars))}let de=(0,on.collectSystemTextsFromRequestBody)(x),qe=(0,on.toSystemInstructions)(de);qe&&z.setAttribute(on.GenAiAttr.SYSTEM_INSTRUCTIONS,(0,on.truncateForOTel)(JSON.stringify(qe),this._otelService.config.maxAttributeSizeChars))}if(z){let K=x.messages??x.input;if(K){let qe=K.filter(ne=>ne.role!=="system");z.setAttribute(on.GenAiAttr.INPUT_MESSAGES,(0,on.truncateForOTel)(JSON.stringify((0,on.normalizeProviderMessages)(qe)),this._otelService.config.maxAttributeSizeChars))}let he=(0,on.stringifyToolDefinitionsForOTel)(x.tools);he&&z.setAttribute(on.GenAiAttr.TOOL_DEFINITIONS,(0,on.truncateForOTel)(he,this._otelService.config.maxAttributeSizeChars));let X=$bc(x);X&&z.setAttribute(on.CopilotChatAttr.REQUEST_OPTIONS,(0,on.truncateForOTel)(JSON.stringify(X),this._otelService.config.maxAttributeSizeChars));let de=Vbc(x);de&&z.setAttribute(on.CopilotChatAttr.REQUEST_SHAPE,(0,on.truncateForOTel)(JSON.stringify(de),this._otelService.config.maxAttributeSizeChars))}L=await Oe();let ee=d?.extensionId??jbc.EXTENSION_ID;this._onDidMakeChatMLRequest.fire({messages:l,model:o.model,source:{extensionId:ee},tokenCount:L})}let te=Date.now()-D.issuedTime;N?.markTimeToFirstToken(te);let le,Le;switch(ie.type){case gn.FetchResponseKind.Success:{let ge=await this.processSuccessfulResponse(ie,l,P,x,T,w,L,te,B,D,o,h,v,b,U,q,Y,W,V);if(ge.type===Wn.ChatFetchResponseType.FilteredRetry){if(e.enableRetryOnFilter){B.callback("",0,{text:"",retryReason:ge.category});let Oe=ge.value[0];if(Oe){let we=ge.category===yI.FilterReason.Copyright?`The previous response (copied below) was filtered due to being too similar to existing public code. Please suggest something similar in function that does not match public code. Here's the previous response: ${Oe} -`:`The previous response (copied below) was filtered due to triggering our content safety filters, which looks for hateful, self-harm, sexual, or violent content. Please suggest something similar in content that does not trigger these filters. Here's the previous response: ${Ue} +`:`The previous response (copied below) was filtered due to triggering our content safety filters, which looks for hateful, self-harm, sexual, or violent content. Please suggest something similar in content that does not trigger these filters. Here's the previous response: ${Oe} -`,X=[...l,{role:X_c.Raw.ChatRole.User,content:(0,TBe.toTextParts)(ke)}],ee=await this.fetchMany({...e,debugName:"retry-"+n,messages:X,finishedCb:s,location:c,endpoint:o,source:d,requestOptions:u,userInitiatedRequest:!1,telemetryProperties:{...f,retryAfterFilterCategory:ge.category??"uncategorized"},enableRetryOnFilter:!1,canRetryOnceWithoutRollback:!1,enableRetryOnError:q},r);if(N?.resolve(ee,B.deltas),ee.type===zn.ChatFetchResponseType.Success)return ee}}return{type:zn.ChatFetchResponseType.Filtered,category:ge.category,reason:"Response got filtered.",requestId:ge.requestId,serverRequestId:ge.serverRequestId}}if(N?.resolve(ge,B.deltas),B.firstTokenEmittedTime!==void 0&&(Le=B.firstTokenEmittedTime-D.issuedTime),ge.type===zn.ChatFetchResponseType.Success&&ge.usage){typeof ge.usage.copilot_usage?.total_nano_aiu=="number"&&A&&v!=="conversation-background"&&this._chatQuotaService.setLastCopilotUsage(ge.usage.copilot_usage.total_nano_aiu,y??A),le=(0,on.normalizeResponseModel)(o.model,ge.resolvedModel);let Ue={operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le};ge.usage.prompt_tokens&&on.GenAiMetrics.recordTokenUsage(this._otelService,ge.usage.prompt_tokens,"input",Ue),ge.usage.completion_tokens&&on.GenAiMetrics.recordTokenUsage(this._otelService,ge.usage.completion_tokens,"output",Ue),z?.setAttributes({[on.GenAiAttr.USAGE_INPUT_TOKENS]:ge.usage.prompt_tokens??0,[on.GenAiAttr.USAGE_OUTPUT_TOKENS]:ge.usage.completion_tokens??0,[on.GenAiAttr.RESPONSE_MODEL]:le??o.model,[on.GenAiAttr.RESPONSE_ID]:ge.requestId,[on.GenAiAttr.RESPONSE_FINISH_REASONS]:["stop"],...ge.usage.prompt_tokens_details?.cached_tokens!==void 0?{[on.GenAiAttr.USAGE_CACHE_READ_INPUT_TOKENS]:ge.usage.prompt_tokens_details.cached_tokens}:{},...ge.usage.prompt_tokens_details?.cache_creation_input_tokens!==void 0?{[on.GenAiAttr.USAGE_CACHE_CREATION_INPUT_TOKENS]:ge.usage.prompt_tokens_details.cache_creation_input_tokens}:{},[on.CopilotChatAttr.TIME_TO_FIRST_TOKEN]:re,[on.GenAiAttr.REQUEST_STREAM]:!0,...Le!==void 0&&Le>0?{[on.GenAiAttr.RESPONSE_TIME_TO_FIRST_CHUNK]:Le/1e3}:{},...ge.serverRequestId?{[on.CopilotChatAttr.SERVER_REQUEST_ID]:ge.serverRequestId}:{},...ge.usage.completion_tokens_details?.reasoning_tokens?{[on.GenAiAttr.USAGE_REASONING_TOKENS]:ge.usage.completion_tokens_details.reasoning_tokens,[on.GenAiAttr.USAGE_REASONING_OUTPUT_TOKENS]:ge.usage.completion_tokens_details.reasoning_tokens}:{},...typeof ge.usage.copilot_usage?.total_nano_aiu=="number"?{[on.CopilotChatAttr.COPILOT_USAGE_NANO_AIU]:ge.usage.copilot_usage.total_nano_aiu}:{}})}if(z&&ge.type===zn.ChatFetchResponseType.Success){let Ue=B.deltas.map(K=>K.text).join(""),ke=B.deltas.filter(K=>K.copilotToolCalls?.length).flatMap(K=>K.copilotToolCalls.map(he=>({type:"tool_call",id:he.id,name:he.name,arguments:he.arguments}))),X=[];if(Ue&&X.push({type:"text",content:Ue}),X.push(...ke),X.length>0&&z.setAttribute(on.GenAiAttr.OUTPUT_MESSAGES,(0,on.truncateForOTel)(JSON.stringify([{role:"assistant",parts:X}]),this._otelService.config.maxAttributeSizeChars)),B.deltas.some(K=>K.thinking)){let he=B.deltas.filter(Z=>Z.thinking&&!(0,dvc.isEncryptedThinkingDelta)(Z.thinking)&&Z.thinking.text).map(Z=>{let ue=Z.thinking;return"encrypted"in ue?"":Array.isArray(ue.text)?ue.text.join(""):ue.text??""}).join("");z.setAttribute(on.CopilotChatAttr.REASONING_CONTENT,(0,on.truncateForOTel)(he||"[encrypted]",this._otelService.config.maxAttributeSizeChars))}}(0,on.emitInferenceDetailsEvent)(this._otelService,{model:o.model,temperature:u?.temperature,maxTokens:u?.max_tokens},ge.type===zn.ChatFetchResponseType.Success?{id:ge.requestId,model:(0,on.normalizeResponseModel)(o.model,ge.resolvedModel),finishReasons:["stop"],inputTokens:ge.usage?.prompt_tokens,outputTokens:ge.usage?.completion_tokens}:void 0),z?.end(),z=void 0,re>0&&on.GenAiMetrics.recordTimeToFirstToken(this._otelService,o.model,re/1e3),Le!==void 0&&Le>0&&on.GenAiMetrics.recordTimeToFirstChunk(this._otelService,Le/1e3,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le});for(let Ue of B.outputChunkGapsMs)on.GenAiMetrics.recordTimePerOutputChunk(this._otelService,Ue/1e3,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le});return E&&ge.type===zn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks=0),ge}case gn.FetchResponseKind.Canceled:return Nye.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:b,interactionType:v,conversationId:f.conversationId??g,associatedRequestId:f.associatedRequestId,parentRequestId:f.parentRequestId,retryAfterError:f.retryAfterError,retryAfterErrorGitHubRequestId:f.retryAfterErrorGitHubRequestId,connectivityTestError:f.connectivityTestError,connectivityTestErrorGitHubRequestId:f.connectivityTestErrorGitHubRequestId,retryAfterFilterCategory:f.retryAfterFilterCategory,fetcher:j,suspendEventSeen:Y,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:L,tokenCountMax:w,timeToFirstToken:re,timeToFirstTokenEmitted:D&&B.firstTokenEmittedTime?B.firstTokenEmittedTime-D.issuedTime:-1,timeToCancelled:Date.now()-D.issuedTime,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,n6i.isBYOKModel)(o),isAuto:(0,CCt.isAutoModel)(o),bytesReceived:Q,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}),N?.resolveWithCancelation(),z?.setAttributes({[on.GenAiAttr.RESPONSE_FINISH_REASONS]:["cancelled"],[on.CopilotChatAttr.CANCELED]:!0}),z?.end(),z=void 0,this.processCanceledResponse(ie,T,B,f);case gn.FetchResponseKind.Failed:{let ge=this.processFailedResponse(ie,T,(0,CCt.isAutoModel)(o)===1),ke=this._configurationService.getExperimentBasedConfig(tV.ConfigKey.TeamInternal.RetryServerErrorStatusCodes,this._experimentationService).split(",").map(K=>parseInt(K.trim(),10)),X=q&&U!==void 0&&ke.includes(U),ee=q&&E&&(ie.failKind===gn.ChatFailKind.ServerError||ie.failKind===gn.ChatFailKind.Unknown);if(X||ee){let{retryResult:K}=await this._retryAfterError({opts:e,processed:ge,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:re,transport:b,actualFetcher:j,bytesReceived:Q,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:P,retryReason:"server_error",debugNamePrefix:"retry-server-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:Y,resumeEventSeen:W,interactionType:v});if(K)return K}return Nye.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:ge,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToFirstToken:re,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:P,transport:b,interactionType:v,fetcher:j,bytesReceived:Q,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:Y,resumeEventSeen:W}),N?.resolve(ge),ge}}}catch(ie){z&&(z.setStatus(2,ie instanceof Error?ie.message:String(ie)),z.setAttribute(on.StdAttr.ERROR_TYPE,ie instanceof Error?ie.constructor.name:"Error"),z.setAttribute(on.GenAiAttr.RESPONSE_FINISH_REASONS,["error"]),z.recordException(ie),z.end());let H=Date.now()-D.issuedTime;ie.fetcherId&&(j=ie.fetcherId),ie.suspendEventSeen&&(Y=!0),ie.resumeEventSeen&&(W=!0);let re=this.processError(ie,T,ie.gitHubRequestId,O,(0,CCt.isAutoModel)(o)===1),le=q&&re.type===zn.ChatFetchResponseType.NetworkError&&this._configurationService.getExperimentBasedConfig(tV.ConfigKey.TeamInternal.RetryNetworkErrors,this._experimentationService),Le=q&&E&&(re.type===zn.ChatFetchResponseType.NetworkError||re.type===zn.ChatFetchResponseType.Failed);if(le||Le){let{retryResult:ge,connectivityTestError:Ue,connectivityTestErrorGitHubRequestId:ke}=await this._retryAfterError({opts:e,processed:re,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:H,transport:b,actualFetcher:j,bytesReceived:ie.bytesReceived,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:P,retryReason:"network_error",debugNamePrefix:"retry-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:Y,resumeEventSeen:W,interactionType:v});if(ge)return ge;f={...f,connectivityTestError:Ue,connectivityTestErrorGitHubRequestId:ke}}return re.type===zn.ChatFetchResponseType.Canceled?Nye.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:b,interactionType:v,conversationId:f.conversationId??g,associatedRequestId:f.associatedRequestId,parentRequestId:f.parentRequestId,retryAfterError:f.retryAfterError,retryAfterErrorGitHubRequestId:f.retryAfterErrorGitHubRequestId,connectivityTestError:f.connectivityTestError,connectivityTestErrorGitHubRequestId:f.connectivityTestErrorGitHubRequestId,retryAfterFilterCategory:f.retryAfterFilterCategory,fetcher:j,suspendEventSeen:Y,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:L,tokenCountMax:w,timeToFirstToken:void 0,timeToCancelled:H,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,n6i.isBYOKModel)(o),isAuto:(0,CCt.isAutoModel)(o),bytesReceived:ie.bytesReceived,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}):Nye.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:re,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToFirstToken:H,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:P,transport:b,interactionType:v,fetcher:j,bytesReceived:ie.bytesReceived,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:Y,resumeEventSeen:W}),N?.resolve(re),re}}async _checkNetworkConnectivity(e){let r=this.connectivityCheckDelays,n,o;for(let s of r){this._logService.info(`Waiting ${s}ms before pinging CAPI to check network connectivity...`),await new Promise(c=>setTimeout(c,s));try{let c=this._capiClientService.dotcomAPIURL!=="https://api.github.com",l=this._capiClientService.capiPingURL,u=await this._getAuthHeaders(c,l),d=await this._fetcherService.fetch(l,{headers:u,useFetcher:e,callSite:"capi-ping"});if(d.status>=200&&d.status<300)return this._logService.info("CAPI ping successful, proceeding with chat request retry..."),{retryRequest:!0,connectivityTestError:n,connectivityTestErrorGitHubRequestId:o};n=`Status ${d.status}: ${d.statusText}`,o=d.headers.get("x-github-request-id")??"",this._logService.info(`CAPI ping returned status ${d.status}, retrying ping...`)}catch(c){n=(0,bMr.collectSingleLineErrorMessage)(c,!0),o=void 0,this._logService.info(`CAPI ping failed with error, retrying ping: ${n}`)}}return{retryRequest:!1,connectivityTestError:n,connectivityTestErrorGitHubRequestId:o}}async _getAuthHeaders(e,r){let n={};if(e){let o="";if(r===this._capiClientService.dotcomAPIURL)o=this._authenticationService.anyGitHubSession?.accessToken||"";else try{o=(await this._authenticationService.getCopilotToken()).token}catch{o=""}n.Authorization=`Bearer ${o}`}return n}async _retryAfterError(e){let{opts:r,processed:n,telemetryProperties:o,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToError:u,transport:d,actualFetcher:f,bytesReceived:h,baseTelemetry:m,streamRecorder:g,imageTelemetryMeasurements:A,retryReason:y,debugNamePrefix:E,pendingLoggedChatRequest:_,token:v,usernameToScrub:b,suspendEventSeen:T,resumeEventSeen:w,interactionType:R}=e,x=["darwin","linux"].includes(process.platform)&&n.reason.indexOf("net::ERR_NETWORK_CHANGED")!==-1,P=this._configurationService.getExperimentBasedConfig(tV.ConfigKey.TeamInternal.FallbackNodeFetchOnNetworkProcessCrash,this._experimentationService),D=n.type===zn.ChatFetchResponseType.NetworkError&&n.isNetworkProcessCrash===!0&&P,N=x||D?"node-fetch":r.useFetcher;this._logService.info(`Retrying chat request with ${N||"default"} fetcher after: ${n.reasonDetail||n.reason}`);let L=await this._checkNetworkConnectivity(N),B=L.connectivityTestError?this.scrubErrorDetail(L.connectivityTestError,b):void 0,q=L.connectivityTestErrorGitHubRequestId;if(!L.retryRequest)return this._logService.info("Not retrying chat request as network connectivity could not be re-established."),{connectivityTestError:B,connectivityTestErrorGitHubRequestId:q};Nye.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:n,telemetryProperties:o,chatEndpointInfo:r.endpoint,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToFirstToken:u,isVisionRequest:this.filterImageMessages(r.messages),imageTelemetryMeasurements:A,transport:d,interactionType:R,fetcher:f,bytesReceived:h,issuedTime:m.issuedTime,wasRetried:!0,suspendEventSeen:T,resumeEventSeen:w}),g.callback("",0,{text:"",retryReason:y});let M=await this.fetchMany({...r,useWebSocket:!1,ignoreStatefulMarker:r.useWebSocket||r.ignoreStatefulMarker,debugName:E+r.debugName,userInitiatedRequest:!1,telemetryProperties:{...o,retryAfterError:n.reasonDetail||n.reason,retryAfterErrorGitHubRequestId:n.serverRequestId,connectivityTestError:B,connectivityTestErrorGitHubRequestId:q},enableRetryOnError:!1,useFetcher:N},v);return _?.resolve(M,g.deltas),r.useWebSocket&&M.type===zn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks++,this._logService.info(`[ChatWebSocketManager] WebSocket request failed with successful HTTP fallback (${this._consecutiveWebSocketRetryFallbacks} consecutive).`),r.conversationId&&this._webSocketManager.closeConnection(r.conversationId)),{retryResult:M,connectivityTestError:B,connectivityTestErrorGitHubRequestId:q}}async _fetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w){let x=this._configurationService.getExperimentBasedConfig(tV.ConfigKey.TeamInternal.ChatRequestPowerSaveBlocker,this._experimentationService)&&l!==zn.ChatLocation.Other?this._powerService.acquirePowerSaveBlocker():void 0,P=!1,D=!1,N=this._powerService.onDidSuspend(()=>{P=!0,this._logService.info(`System suspended during streaming request ${u} (${zn.ChatLocation.toString(l)})`)}),L=this._powerService.onDidResume(()=>{D=!0,this._logService.info(`System resumed during streaming request ${u} (${zn.ChatLocation.toString(l)})`)});try{return{...await this._doFetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w),suspendEventSeen:P||void 0,resumeEventSeen:D||void 0}}catch(B){throw P&&(B.suspendEventSeen=!0),D&&(B.resumeEventSeen=!0),B}finally{N.dispose(),L.dispose(),x?.dispose()}}async _doFetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w){if(f.isCancellationRequested)return{result:{type:gn.FetchResponseKind.Canceled,reason:"before fetch request"}};let R=typeof e.urlOrRequestMetadata=="string"?(()=>{try{return new URL(e.urlOrRequestMetadata).hostname}catch{return}})():void 0,x=(0,EMr.getCurrentCapturingToken)()?.chatSessionId,P=(0,EMr.getCurrentCapturingToken)()?.parentChatSessionId,D=(0,EMr.getCurrentCapturingToken)()?.debugLogLabel,N=this._otelService.startSpan(`chat ${e.model}`,{kind:2,attributes:{[on.GenAiAttr.OPERATION_NAME]:on.GenAiOperationName.CHAT,[on.GenAiAttr.PROVIDER_NAME]:on.GenAiProviderName.GITHUB,[on.GenAiAttr.REQUEST_MODEL]:e.model,[on.GenAiAttr.CONVERSATION_ID]:E?.requestId??u,[on.GenAiAttr.REQUEST_MAX_TOKENS]:r.max_tokens??r.max_output_tokens??r.max_completion_tokens??2048,...r.temperature!==void 0?{[on.GenAiAttr.REQUEST_TEMPERATURE]:r.temperature}:{},...r.top_p!==void 0?{[on.GenAiAttr.REQUEST_TOP_P]:r.top_p}:{},[on.CopilotChatAttr.MAX_PROMPT_TOKENS]:e.modelMaxPromptTokens,...R?{[on.StdAttr.SERVER_ADDRESS]:R}:{},...y?{[on.CopilotChatAttr.SESSION_ID]:y}:{},...x?{[on.CopilotChatAttr.CHAT_SESSION_ID]:x}:{},...P?{[on.CopilotChatAttr.PARENT_CHAT_SESSION_ID]:P}:{},...D?{[on.CopilotChatAttr.DEBUG_LOG_LABEL]:D}:{}}}),L=Date.now();try{if(this._logService.debug(`modelMaxPromptTokens ${e.modelMaxPromptTokens}`),this._logService.debug(`modelMaxResponseTokens ${r.max_tokens??2048}`),this._logService.debug(`chat model ${e.model}`),e.ownsAuthorization||(s??=c?.token),!s&&!e.ownsAuthorization){let q=(0,bCt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata);return this._logService.error(`Failed to send request to ${q} due to missing key`),(0,e6i.sendCommunicationErrorTelemetry)(this._telemetryService,`Failed to send request to ${q} due to missing key`),{result:{type:gn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:gn.ChatFailKind.TokenExpiredOrInvalid,reason:"key is missing"}}}return g&&A&&y?{...await this._doFetchViaWebSocket(e,r,n,o,s,l,u,A,y,f,h,m,E,b,T,w),otelSpan:N}:{...await this._doFetchViaHttp(e,r,n,o,s,l,u,d,f,m,E,_,v,b),otelSpan:N}}catch(B){throw N.setStatus(2,B instanceof Error?B.message:String(B)),N.setAttribute(on.StdAttr.ERROR_TYPE,B instanceof Error?B.constructor.name:"Error"),N.recordException(B),B}finally{let B=(Date.now()-L)/1e3;on.GenAiMetrics.recordOperationDuration(this._otelService,B,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:e.model})}}async _doFetchViaWebSocket(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E){let _=TCt(c),v=A??_,b={...s?{Authorization:`Bearer ${s}`}:{},"X-Request-Id":l,"OpenAI-Intent":_,"X-GitHub-Api-Version":"2025-05-01","X-Interaction-Id":this._interactionService.interactionId,...e.getExtraHeaders?e.getExtraHeaders(c,A):{}};b["X-Interaction-Type"]=v,b["X-Agent-Task-Id"]=l,r.messages?.some(M=>Array.isArray(M.content)?M.content.some(O=>"image_url"in O):!1)&&e.supportsVision&&(b["Copilot-Vision-Request"]="true");let T=this._webSocketManager.getOrCreateConnection(d,b,l);try{await T.connect()}catch(M){throw M.gitHubRequestId=T.gitHubRequestId,M}let w=(0,_Mr.generateUuid)(),R=Mye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:zn.ChatLocation.toString(c),transport:"websocket",...g,modelCallId:w},{maxTokenWindow:e.modelMaxPromptTokens}),x=(0,yMr.getRequestId)(T.responseHeaders);x.headerRequestId=l,R.extendWithRequestId(x),x.serverExperiments&&this._telemetryService.setSharedProperty("capi.assignmentcontext",x.serverExperiments);for(let[M,O]of Object.entries(r))if(!(M==="messages"||M==="input")){if(M==="tools"){R.properties[`request.option.${M}`]=(0,on.stringifyToolsRawForTelemetry)(O)??"undefined";continue}R.properties[`request.option.${M}`]=JSON.stringify(O)??"undefined"}this._telemetryService.sendGHTelemetryEvent("request.sent",R.properties,R.measurements),r.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,SMr.multiplexProperties)({headerRequestId:l,conversationId:d,messagesJson:(0,on.stringifyToolsRawForTelemetry)(r.tools)}),R.measurements);let P=Date.now(),D=T.sendRequest(r,{userInitiated:!!m,turnId:u,requestId:l,model:e.model,countTokens:h,tokenCountMax:e.maxOutputTokens,modelMaxPromptTokens:e.modelMaxPromptTokens,summarizedAtRoundId:y,modeChanged:E},f),N=n.extendedBy({modelCallId:w}),L=this._instantiationService.createInstance(IBe.OpenAIResponsesProcessor,N,this._telemetryService,x.headerRequestId,x.gitHubRequestId,x.serverExperiments,(0,IBe.getResponsesApiCompactionThresholdFromBody)(r)),B=new t6i.AsyncIterableObject(async M=>{try{await new Promise((j,Q)=>{D.onEvent(U=>{let Y=L.push(U,o);if(Y&&((0,IBe.sendCompletionOutputTelemetry)(this._telemetryService,this._logService,Y,N),M.emitOne(Y)),U.type==="response.completed"){let W=U.copilot_quota_snapshots;W&&typeof W=="object"&&this._chatQuotaService.processQuotaSnapshots(W)}}),D.onCAPIError(U=>{let Y=new Error(`${U.error.message} (${U.error.code})`);Y.gitHubRequestId=x.gitHubRequestId,Y.capiWebSocketError=U,Q(Y)}),D.onError(U=>{if(U.gitHubRequestId=x.gitHubRequestId,(0,r6i.isCancellationError)(U)){Q(U);return}let Y=R.extendedBy({error:U.message});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",Y.properties,Y.measurements);let W=Date.now()-P;R.measurements.totalTimeMs=W,R.properties.error=U.message,this._logService.debug(`request.error: [websocket], took ${W} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",R.properties,R.measurements),Q(U)}),D.done.then(j,Q)});let O=Date.now()-P;R.measurements.totalTimeMs=O,this._logService.debug(`request.response: [websocket], took ${O} ms`),this._telemetryService.sendGHTelemetryEvent("request.response",R.properties,R.measurements)}finally{let O=r.messages;if((!O||O.length===0)&&r.input)try{let j=(0,IBe.responseApiInputToRawMessagesForLogging)(r);O=(0,fI.rawMessageToCAPI)(j)}catch(j){this._logService.error("Failed to convert Response API input to messages for telemetry:",j),O=[]}(0,X8i.sendEngineMessagesTelemetry)(this._telemetryService,O??[],R,!1,this._logService)}}),q=await D.firstEvent;if(f.isCancellationRequested)return{result:{type:gn.FetchResponseKind.Canceled,reason:"after first WebSocket event"}};if((0,i6i.isCAPIWebSocketError)(q)){let M=Date.now()-P;return R.measurements.totalTimeMs=M,R.properties.error=`${q.error.message} (${q.error.code})`,this._logService.debug(`request.error: [websocket capi error], took ${M} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",R.properties,R.measurements),{result:await this._handleWebSocketCAPIError(q,x)}}return this._authenticationService.copilotToken?.isFreeUser&&this._authenticationService.copilotToken?.isChatQuotaExceeded&&this._authenticationService.resetCopilotToken(),{result:{type:gn.FetchResponseKind.Success,chatCompletions:B},modelCallId:w}}async _doFetchViaHttp(e,r,n,o,s,c,l,u,d,f,h,m,g,A){let y=(0,_Mr.generateUuid)(),E=await this._fetchWithInstrumentation(e,l,r,s,c,d,f,{...h,modelCallId:y},m,g,A);if(d.isCancellationRequested){try{await E.body.destroy()}catch(T){this._logService.error(T,"Error destroying stream"),this._telemetryService.sendGHTelemetryException(T,"Error destroying stream")}return{result:{type:gn.FetchResponseKind.Canceled,reason:"after fetch request"},fetcher:E.fetcher,bytesReceived:E.bytesReceived}}if(E.status===200&&this._authenticationService.copilotToken?.isFreeUser&&this._authenticationService.copilotToken?.isChatQuotaExceeded&&this._authenticationService.resetCopilotToken(),E.status!==200){let T=o6i(e,c,l);return this._logService.info("Request ID for failed request: "+l),{result:await this._handleError(T,E,l),fetcher:E.fetcher,bytesReceived:E.bytesReceived,statusCode:E.status}}let _=n.extendedBy({modelCallId:y}),v,b=E.headers.get("x-github-request-id")??"";try{let T=await e.processResponseFromChatEndpoint(this._telemetryService,this._logService,E,u??1,o,_,d,c);v=new t6i.AsyncIterableObject(async w=>{try{for await(let R of T)w.emitOne(R)}catch(R){throw R.fetcherId=E.fetcher,R.gitHubRequestId=b,R.bytesReceived=E.bytesReceived,R}})}catch(T){throw T.fetcherId=E.fetcher,T.gitHubRequestId=b,T.bytesReceived=E.bytesReceived,T}return E.headers.get("Copilot-Edits-Session")&&(this._authenticationService.speculativeDecodingEndpointToken=E.headers.get("Copilot-Edits-Session")??void 0),this._chatQuotaService.processQuotaHeaders(E.headers),{result:{type:gn.FetchResponseKind.Success,chatCompletions:v},fetcher:E.fetcher,bytesReceived:E.bytesReceived,modelCallId:y}}async _fetchWithInstrumentation(e,r,n,o,s,c,l,u,d,f,h){let m={"X-Interaction-Id":this._interactionService.interactionId,"X-Initiator":l?"user":"agent"};n.messages?.some(E=>Array.isArray(E.content)?E.content.some(_=>"image_url"in _):!1)&&e.supportsVision&&(m["Copilot-Vision-Request"]="true");let g=Mye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:zn.ChatLocation.toString(s),transport:"http",...u},{maxTokenWindow:e.modelMaxPromptTokens});for(let[E,_]of Object.entries(n))if(!(E==="messages"||E==="input")){if(E==="tools"){g.properties[`request.option.${E}`]=(0,on.stringifyToolsRawForTelemetry)(_)??"undefined";continue}g.properties[`request.option.${E}`]=JSON.stringify(_)??"undefined"}g.properties.headerRequestId=r,this._telemetryService.sendGHTelemetryEvent("request.sent",g.properties,g.measurements),n.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,SMr.multiplexProperties)({headerRequestId:r,conversationId:u?.conversationId,messagesJson:(0,on.stringifyToolsRawForTelemetry)(n.tools)}),g.measurements);let A=Date.now(),y=TCt(s);return this._instantiationService.invokeFunction(bCt.postRequest,{endpointOrUrl:e,secretKey:o,intent:y,requestId:r,body:n,additionalHeaders:m,cancelToken:c,useFetcher:d,canRetryOnce:f,location:s,interactionTypeOverride:h}).then(E=>{let _=E.headers.get("apim-request-id");_&&this._logService.debug(`APIM request id: ${_}`);let v=E.headers.get("x-github-request-id");v&&this._logService.debug(`GH request id: ${v}`);let b=(0,yMr.getRequestId)(E.headers);b.headerRequestId=b.headerRequestId||r,g.extendWithRequestId(b),b.serverExperiments&&this._telemetryService.setSharedProperty("capi.assignmentcontext",b.serverExperiments);let T=Date.now()-A;return g.measurements.totalTimeMs=T,this._logService.debug(`request.response: [${(0,bCt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata)}], took ${T} ms`),this._telemetryService.sendGHTelemetryEvent("request.response",g.properties,g.measurements),E}).catch(E=>{if(this._fetcherService.isAbortError(E))throw E;let _=g.extendedBy({error:"Network exception"});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",_.properties,_.measurements),g.properties.code=String(E.code??""),g.properties.errno=String(E.errno??""),g.properties.message=String(E.message??""),g.properties.type=String(E.type??"");let v=Date.now()-A;throw g.measurements.totalTimeMs=v,this._logService.debug(`request.response: [${(0,bCt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata)}] took ${v} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",g.properties,g.measurements),E}).finally(()=>{let E=n.messages;if((!E||E.length===0)&&n.input)try{let _=(0,IBe.responseApiInputToRawMessagesForLogging)(n);E=(0,fI.rawMessageToCAPI)(_)}catch(_){this._logService.error("Failed to convert Response API input to messages for telemetry:",_),E=[]}(0,X8i.sendEngineMessagesTelemetry)(this._telemetryService,E??[],g,!1,this._logService)})}async _handleError(e,r,n){let o=(0,yMr.getRequestId)(r.headers);n=o.headerRequestId||n,o.headerRequestId=n,this._chatQuotaService.processQuotaHeaders(r.headers),e.properties.error=`Response status was ${r.status}`,e.properties.status=String(r.status),this._telemetryService.sendGHTelemetryEvent("request.shownWarning",e.properties,e.measurements);let s=await r.text(),c;try{c=JSON.parse(s),c=c?.error??c}catch{}let l=`Server error: ${r.status}`,u=`${l} ${s}`;if(this._logService.error(u),400<=r.status&&r.status<500){if(r.status===400&&s.includes("off_topic"))return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.OffTopic,reason:"filtered as off_topic by intent classifier: message was not programming related"};if(r.status===401&&s.includes("authorize_url")&&c?.authorize_url)return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.AgentUnauthorized,reason:r.statusText||r.statusText,data:c};if(r.status===400&&c?.code==="previous_response_not_found")return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.InvalidPreviousResponseId,reason:c.message||"Invalid previous response ID",data:c};if(r.status===401||r.status===403)return this._authenticationService.resetCopilotToken(r.status),{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.TokenExpiredOrInvalid,reason:c?.message||`token expired or invalid: ${r.status}`};if(r.status===402){this._authenticationService.copilotToken?.isChatQuotaExceeded||(this._authenticationService.resetCopilotToken(r.status),await this._authenticationService.getCopilotToken());let d=r.headers.get("retry-after"),h=a(m=>{if(!m)return;let g=new Date(m);if(!isNaN(g.getDate()))return g;let A=parseInt(m,10);if(!isNaN(A))return new Date(Date.now()+A*1e3)},"convertToDate")(d);return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.QuotaExceeded,reason:c?.message??"Free tier quota exceeded",data:{capiError:c,retryAfter:h}}}if(r.status===404){let d;return c?d=JSON.stringify(c):d=s,{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.NotFound,reason:d}}if(r.status===422)return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ContentFilter,reason:`Filtered by Responsible AI Service +`,re=[...l,{role:Sbc.Raw.ChatRole.User,content:(0,zBe.toTextParts)(we)}],ee=await this.fetchMany({...e,debugName:"retry-"+n,messages:re,finishedCb:s,location:c,endpoint:o,source:d,requestOptions:u,userInitiatedRequest:!1,telemetryProperties:{...f,retryAfterFilterCategory:ge.category??"uncategorized"},enableRetryOnFilter:!1,canRetryOnceWithoutRollback:!1,enableRetryOnError:j},r);if(N?.resolve(ee,B.deltas),ee.type===Wn.ChatFetchResponseType.Success)return ee}}return{type:Wn.ChatFetchResponseType.Filtered,category:ge.category,reason:"Response got filtered.",requestId:ge.requestId,serverRequestId:ge.serverRequestId}}if(N?.resolve(ge,B.deltas),B.firstTokenEmittedTime!==void 0&&(Le=B.firstTokenEmittedTime-D.issuedTime),ge.type===Wn.ChatFetchResponseType.Success&&ge.usage){typeof ge.usage.copilot_usage?.total_nano_aiu=="number"&&A&&v!=="conversation-background"&&this._chatQuotaService.setLastCopilotUsage(ge.usage.copilot_usage.total_nano_aiu,y??A),le=(0,on.normalizeResponseModel)(o.model,ge.resolvedModel);let Oe={operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le};ge.usage.prompt_tokens&&on.GenAiMetrics.recordTokenUsage(this._otelService,ge.usage.prompt_tokens,"input",Oe),ge.usage.completion_tokens&&on.GenAiMetrics.recordTokenUsage(this._otelService,ge.usage.completion_tokens,"output",Oe),z?.setAttributes({[on.GenAiAttr.USAGE_INPUT_TOKENS]:ge.usage.prompt_tokens??0,[on.GenAiAttr.USAGE_OUTPUT_TOKENS]:ge.usage.completion_tokens??0,[on.GenAiAttr.RESPONSE_MODEL]:le??o.model,[on.GenAiAttr.RESPONSE_ID]:ge.requestId,[on.GenAiAttr.RESPONSE_FINISH_REASONS]:["stop"],...ge.usage.prompt_tokens_details?.cached_tokens!==void 0?{[on.GenAiAttr.USAGE_CACHE_READ_INPUT_TOKENS]:ge.usage.prompt_tokens_details.cached_tokens}:{},...ge.usage.prompt_tokens_details?.cache_creation_input_tokens!==void 0?{[on.GenAiAttr.USAGE_CACHE_CREATION_INPUT_TOKENS]:ge.usage.prompt_tokens_details.cache_creation_input_tokens}:{},[on.CopilotChatAttr.TIME_TO_FIRST_TOKEN]:te,[on.GenAiAttr.REQUEST_STREAM]:!0,...Le!==void 0&&Le>0?{[on.GenAiAttr.RESPONSE_TIME_TO_FIRST_CHUNK]:Le/1e3}:{},...ge.serverRequestId?{[on.CopilotChatAttr.SERVER_REQUEST_ID]:ge.serverRequestId}:{},...ge.usage.completion_tokens_details?.reasoning_tokens?{[on.GenAiAttr.USAGE_REASONING_TOKENS]:ge.usage.completion_tokens_details.reasoning_tokens,[on.GenAiAttr.USAGE_REASONING_OUTPUT_TOKENS]:ge.usage.completion_tokens_details.reasoning_tokens}:{},...typeof ge.usage.copilot_usage?.total_nano_aiu=="number"?{[on.CopilotChatAttr.COPILOT_USAGE_NANO_AIU]:ge.usage.copilot_usage.total_nano_aiu}:{}})}if(z&&ge.type===Wn.ChatFetchResponseType.Success){let Oe=B.deltas.map(K=>K.text).join(""),we=B.deltas.filter(K=>K.copilotToolCalls?.length).flatMap(K=>K.copilotToolCalls.map(he=>({type:"tool_call",id:he.id,name:he.name,arguments:he.arguments}))),re=[];if(Oe&&re.push({type:"text",content:Oe}),re.push(...we),re.length>0&&z.setAttribute(on.GenAiAttr.OUTPUT_MESSAGES,(0,on.truncateForOTel)(JSON.stringify([{role:"assistant",parts:re}]),this._otelService.config.maxAttributeSizeChars)),B.deltas.some(K=>K.thinking)){let he=B.deltas.filter(X=>X.thinking&&!(0,Lbc.isEncryptedThinkingDelta)(X.thinking)&&X.thinking.text).map(X=>{let de=X.thinking;return"encrypted"in de?"":Array.isArray(de.text)?de.text.join(""):de.text??""}).join("");z.setAttribute(on.CopilotChatAttr.REASONING_CONTENT,(0,on.truncateForOTel)(he||"[encrypted]",this._otelService.config.maxAttributeSizeChars))}}(0,on.emitInferenceDetailsEvent)(this._otelService,{model:o.model,temperature:u?.temperature,maxTokens:u?.max_tokens},ge.type===Wn.ChatFetchResponseType.Success?{id:ge.requestId,model:(0,on.normalizeResponseModel)(o.model,ge.resolvedModel),finishReasons:["stop"],inputTokens:ge.usage?.prompt_tokens,outputTokens:ge.usage?.completion_tokens}:void 0),z?.end(),z=void 0,te>0&&on.GenAiMetrics.recordTimeToFirstToken(this._otelService,o.model,te/1e3),Le!==void 0&&Le>0&&on.GenAiMetrics.recordTimeToFirstChunk(this._otelService,Le/1e3,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le});for(let Oe of B.outputChunkGapsMs)on.GenAiMetrics.recordTimePerOutputChunk(this._otelService,Oe/1e3,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:le});return E&&ge.type===Wn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks=0),ge}case gn.FetchResponseKind.Canceled:return Yye.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:b,interactionType:v,conversationId:f.conversationId??g,associatedRequestId:f.associatedRequestId,parentRequestId:f.parentRequestId,retryAfterError:f.retryAfterError,retryAfterErrorGitHubRequestId:f.retryAfterErrorGitHubRequestId,connectivityTestError:f.connectivityTestError,connectivityTestErrorGitHubRequestId:f.connectivityTestErrorGitHubRequestId,retryAfterFilterCategory:f.retryAfterFilterCategory,fetcher:U,suspendEventSeen:Y,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:L,tokenCountMax:w,timeToFirstToken:te,timeToFirstTokenEmitted:D&&B.firstTokenEmittedTime?B.firstTokenEmittedTime-D.issuedTime:-1,timeToCancelled:Date.now()-D.issuedTime,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,Y9i.isBYOKModel)(o),isAuto:(0,zCt.isAutoModel)(o),bytesReceived:q,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}),N?.resolveWithCancelation(),z?.setAttributes({[on.GenAiAttr.RESPONSE_FINISH_REASONS]:["cancelled"],[on.CopilotChatAttr.CANCELED]:!0}),z?.end(),z=void 0,this.processCanceledResponse(ie,T,B,f);case gn.FetchResponseKind.Failed:{let ge=this.processFailedResponse(ie,T,(0,zCt.isAutoModel)(o)===1),we=this._configurationService.getExperimentBasedConfig(pV.ConfigKey.TeamInternal.RetryServerErrorStatusCodes,this._experimentationService).split(",").map(K=>parseInt(K.trim(),10)),re=j&&Q!==void 0&&we.includes(Q),ee=j&&E&&(ie.failKind===gn.ChatFailKind.ServerError||ie.failKind===gn.ChatFailKind.Unknown);if(re||ee){let{retryResult:K}=await this._retryAfterError({opts:e,processed:ge,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:te,transport:b,actualFetcher:U,bytesReceived:q,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:P,retryReason:"server_error",debugNamePrefix:"retry-server-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:Y,resumeEventSeen:W,interactionType:v});if(K)return K}return Yye.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:ge,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToFirstToken:te,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:P,transport:b,interactionType:v,fetcher:U,bytesReceived:q,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:Y,resumeEventSeen:W}),N?.resolve(ge),ge}}}catch(ie){z&&(z.setStatus(2,ie instanceof Error?ie.message:String(ie)),z.setAttribute(on.StdAttr.ERROR_TYPE,ie instanceof Error?ie.constructor.name:"Error"),z.setAttribute(on.GenAiAttr.RESPONSE_FINISH_REASONS,["error"]),z.recordException(ie),z.end());let H=Date.now()-D.issuedTime;ie.fetcherId&&(U=ie.fetcherId),ie.suspendEventSeen&&(Y=!0),ie.resumeEventSeen&&(W=!0);let te=this.processError(ie,T,ie.gitHubRequestId,O,(0,zCt.isAutoModel)(o)===1),le=j&&te.type===Wn.ChatFetchResponseType.NetworkError&&this._configurationService.getExperimentBasedConfig(pV.ConfigKey.TeamInternal.RetryNetworkErrors,this._experimentationService),Le=j&&E&&(te.type===Wn.ChatFetchResponseType.NetworkError||te.type===Wn.ChatFetchResponseType.Failed);if(le||Le){let{retryResult:ge,connectivityTestError:Oe,connectivityTestErrorGitHubRequestId:we}=await this._retryAfterError({opts:e,processed:te,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:H,transport:b,actualFetcher:U,bytesReceived:ie.bytesReceived,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:P,retryReason:"network_error",debugNamePrefix:"retry-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:Y,resumeEventSeen:W,interactionType:v});if(ge)return ge;f={...f,connectivityTestError:Oe,connectivityTestErrorGitHubRequestId:we}}return te.type===Wn.ChatFetchResponseType.Canceled?Yye.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:b,interactionType:v,conversationId:f.conversationId??g,associatedRequestId:f.associatedRequestId,parentRequestId:f.parentRequestId,retryAfterError:f.retryAfterError,retryAfterErrorGitHubRequestId:f.retryAfterErrorGitHubRequestId,connectivityTestError:f.connectivityTestError,connectivityTestErrorGitHubRequestId:f.connectivityTestErrorGitHubRequestId,retryAfterFilterCategory:f.retryAfterFilterCategory,fetcher:U,suspendEventSeen:Y,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:L,tokenCountMax:w,timeToFirstToken:void 0,timeToCancelled:H,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,Y9i.isBYOKModel)(o),isAuto:(0,zCt.isAutoModel)(o),bytesReceived:ie.bytesReceived,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}):Yye.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:te,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToFirstToken:H,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:P,transport:b,interactionType:v,fetcher:U,bytesReceived:ie.bytesReceived,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:Y,resumeEventSeen:W}),N?.resolve(te),te}}async _checkNetworkConnectivity(e){let r=this.connectivityCheckDelays,n,o;for(let s of r){this._logService.info(`Waiting ${s}ms before pinging CAPI to check network connectivity...`),await new Promise(c=>setTimeout(c,s));try{let c=this._capiClientService.dotcomAPIURL!=="https://api.github.com",l=this._capiClientService.capiPingURL,u=await this._getAuthHeaders(c,l),d=await this._fetcherService.fetch(l,{headers:u,useFetcher:e,callSite:"capi-ping"});if(d.status>=200&&d.status<300)return this._logService.info("CAPI ping successful, proceeding with chat request retry..."),{retryRequest:!0,connectivityTestError:n,connectivityTestErrorGitHubRequestId:o};n=`Status ${d.status}: ${d.statusText}`,o=d.headers.get("x-github-request-id")??"",this._logService.info(`CAPI ping returned status ${d.status}, retrying ping...`)}catch(c){n=(0,yOr.collectSingleLineErrorMessage)(c,!0),o=void 0,this._logService.info(`CAPI ping failed with error, retrying ping: ${n}`)}}return{retryRequest:!1,connectivityTestError:n,connectivityTestErrorGitHubRequestId:o}}async _getAuthHeaders(e,r){let n={};if(e){let o="";if(r===this._capiClientService.dotcomAPIURL)o=this._authenticationService.anyGitHubSession?.accessToken||"";else try{o=(await this._authenticationService.getCopilotToken()).token}catch{o=""}n.Authorization=`Bearer ${o}`}return n}async _retryAfterError(e){let{opts:r,processed:n,telemetryProperties:o,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToError:u,transport:d,actualFetcher:f,bytesReceived:h,baseTelemetry:m,streamRecorder:g,imageTelemetryMeasurements:A,retryReason:y,debugNamePrefix:E,pendingLoggedChatRequest:_,token:v,usernameToScrub:b,suspendEventSeen:T,resumeEventSeen:w,interactionType:R}=e,x=["darwin","linux"].includes(process.platform)&&n.reason.indexOf("net::ERR_NETWORK_CHANGED")!==-1,P=this._configurationService.getExperimentBasedConfig(pV.ConfigKey.TeamInternal.FallbackNodeFetchOnNetworkProcessCrash,this._experimentationService),D=n.type===Wn.ChatFetchResponseType.NetworkError&&n.isNetworkProcessCrash===!0&&P,N=x||D?"node-fetch":r.useFetcher;this._logService.info(`Retrying chat request with ${N||"default"} fetcher after: ${n.reasonDetail||n.reason}`);let L=await this._checkNetworkConnectivity(N),B=L.connectivityTestError?this.scrubErrorDetail(L.connectivityTestError,b):void 0,j=L.connectivityTestErrorGitHubRequestId;if(!L.retryRequest)return this._logService.info("Not retrying chat request as network connectivity could not be re-established."),{connectivityTestError:B,connectivityTestErrorGitHubRequestId:j};Yye.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:n,telemetryProperties:o,chatEndpointInfo:r.endpoint,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToFirstToken:u,isVisionRequest:this.filterImageMessages(r.messages),imageTelemetryMeasurements:A,transport:d,interactionType:R,fetcher:f,bytesReceived:h,issuedTime:m.issuedTime,wasRetried:!0,suspendEventSeen:T,resumeEventSeen:w}),g.callback("",0,{text:"",retryReason:y});let M=await this.fetchMany({...r,useWebSocket:!1,ignoreStatefulMarker:r.useWebSocket||r.ignoreStatefulMarker,debugName:E+r.debugName,userInitiatedRequest:!1,telemetryProperties:{...o,retryAfterError:n.reasonDetail||n.reason,retryAfterErrorGitHubRequestId:n.serverRequestId,connectivityTestError:B,connectivityTestErrorGitHubRequestId:j},enableRetryOnError:!1,useFetcher:N},v);return _?.resolve(M,g.deltas),r.useWebSocket&&M.type===Wn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks++,this._logService.info(`[ChatWebSocketManager] WebSocket request failed with successful HTTP fallback (${this._consecutiveWebSocketRetryFallbacks} consecutive).`),r.conversationId&&this._webSocketManager.closeConnection(r.conversationId)),{retryResult:M,connectivityTestError:B,connectivityTestErrorGitHubRequestId:j}}async _fetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w){let x=this._configurationService.getExperimentBasedConfig(pV.ConfigKey.TeamInternal.ChatRequestPowerSaveBlocker,this._experimentationService)&&l!==Wn.ChatLocation.Other?this._powerService.acquirePowerSaveBlocker():void 0,P=!1,D=!1,N=this._powerService.onDidSuspend(()=>{P=!0,this._logService.info(`System suspended during streaming request ${u} (${Wn.ChatLocation.toString(l)})`)}),L=this._powerService.onDidResume(()=>{D=!0,this._logService.info(`System resumed during streaming request ${u} (${Wn.ChatLocation.toString(l)})`)});try{return{...await this._doFetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w),suspendEventSeen:P||void 0,resumeEventSeen:D||void 0}}catch(B){throw P&&(B.suspendEventSeen=!0),D&&(B.resumeEventSeen=!0),B}finally{N.dispose(),L.dispose(),x?.dispose()}}async _doFetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w){if(f.isCancellationRequested)return{result:{type:gn.FetchResponseKind.Canceled,reason:"before fetch request"}};let R=typeof e.urlOrRequestMetadata=="string"?(()=>{try{return new URL(e.urlOrRequestMetadata).hostname}catch{return}})():void 0,x=(0,hOr.getCurrentCapturingToken)()?.chatSessionId,P=(0,hOr.getCurrentCapturingToken)()?.parentChatSessionId,D=(0,hOr.getCurrentCapturingToken)()?.debugLogLabel,N=this._otelService.startSpan(`chat ${e.model}`,{kind:2,attributes:{[on.GenAiAttr.OPERATION_NAME]:on.GenAiOperationName.CHAT,[on.GenAiAttr.PROVIDER_NAME]:on.GenAiProviderName.GITHUB,[on.GenAiAttr.REQUEST_MODEL]:e.model,[on.GenAiAttr.CONVERSATION_ID]:E?.requestId??u,[on.GenAiAttr.REQUEST_MAX_TOKENS]:r.max_tokens??r.max_output_tokens??r.max_completion_tokens??2048,...r.temperature!==void 0?{[on.GenAiAttr.REQUEST_TEMPERATURE]:r.temperature}:{},...r.top_p!==void 0?{[on.GenAiAttr.REQUEST_TOP_P]:r.top_p}:{},[on.CopilotChatAttr.MAX_PROMPT_TOKENS]:e.modelMaxPromptTokens,...R?{[on.StdAttr.SERVER_ADDRESS]:R}:{},...y?{[on.CopilotChatAttr.SESSION_ID]:y}:{},...x?{[on.CopilotChatAttr.CHAT_SESSION_ID]:x}:{},...P?{[on.CopilotChatAttr.PARENT_CHAT_SESSION_ID]:P}:{},...D?{[on.CopilotChatAttr.DEBUG_LOG_LABEL]:D}:{}}}),L=Date.now();try{if(this._logService.debug(`modelMaxPromptTokens ${e.modelMaxPromptTokens}`),this._logService.debug(`modelMaxResponseTokens ${r.max_tokens??2048}`),this._logService.debug(`chat model ${e.model}`),e.ownsAuthorization||(s??=c?.token),!s&&!e.ownsAuthorization){let j=(0,YCt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata);return this._logService.error(`Failed to send request to ${j} due to missing key`),(0,V9i.sendCommunicationErrorTelemetry)(this._telemetryService,`Failed to send request to ${j} due to missing key`),{result:{type:gn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:gn.ChatFailKind.TokenExpiredOrInvalid,reason:"key is missing"}}}return g&&A&&y?{...await this._doFetchViaWebSocket(e,r,n,o,s,l,u,A,y,f,h,m,E,b,T,w),otelSpan:N}:{...await this._doFetchViaHttp(e,r,n,o,s,l,u,d,f,m,E,_,v,b),otelSpan:N}}catch(B){throw N.setStatus(2,B instanceof Error?B.message:String(B)),N.setAttribute(on.StdAttr.ERROR_TYPE,B instanceof Error?B.constructor.name:"Error"),N.recordException(B),B}finally{let B=(Date.now()-L)/1e3;on.GenAiMetrics.recordOperationDuration(this._otelService,B,{operationName:on.GenAiOperationName.CHAT,providerName:on.GenAiProviderName.GITHUB,requestModel:e.model})}}async _doFetchViaWebSocket(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E){let _=JCt(c),v=A??_,b={...s?{Authorization:`Bearer ${s}`}:{},"X-Request-Id":l,"OpenAI-Intent":_,"X-GitHub-Api-Version":"2025-05-01","X-Interaction-Id":this._interactionService.interactionId,...e.getExtraHeaders?e.getExtraHeaders(c,A):{}};b["X-Interaction-Type"]=v,b["X-Agent-Task-Id"]=l,r.messages?.some(M=>Array.isArray(M.content)?M.content.some(O=>"image_url"in O):!1)&&e.supportsVision&&(b["Copilot-Vision-Request"]="true");let T=this._webSocketManager.getOrCreateConnection(d,b,l);try{await T.connect()}catch(M){throw M.gitHubRequestId=T.gitHubRequestId,M}let w=(0,mOr.generateUuid)(),R=Kye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Wn.ChatLocation.toString(c),transport:"websocket",...g,modelCallId:w},{maxTokenWindow:e.modelMaxPromptTokens}),x=(0,pOr.getRequestId)(T.responseHeaders);x.headerRequestId=l,R.extendWithRequestId(x),x.serverExperiments&&this._telemetryService.setSharedProperty("capi.assignmentcontext",x.serverExperiments);for(let[M,O]of Object.entries(r))if(!(M==="messages"||M==="input")){if(M==="tools"){R.properties[`request.option.${M}`]=(0,on.stringifyToolsRawForTelemetry)(O)??"undefined";continue}R.properties[`request.option.${M}`]=JSON.stringify(O)??"undefined"}this._telemetryService.sendGHTelemetryEvent("request.sent",R.properties,R.measurements),r.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,EOr.multiplexProperties)({headerRequestId:l,conversationId:d,messagesJson:(0,on.stringifyToolsRawForTelemetry)(r.tools)}),R.measurements);let P=Date.now(),D=T.sendRequest(r,{userInitiated:!!m,turnId:u,requestId:l,model:e.model,countTokens:h,tokenCountMax:e.maxOutputTokens,modelMaxPromptTokens:e.modelMaxPromptTokens,summarizedAtRoundId:y,modeChanged:E},f),N=n.extendedBy({modelCallId:w}),L=this._instantiationService.createInstance(YBe.OpenAIResponsesProcessor,N,this._telemetryService,x.headerRequestId,x.gitHubRequestId,x.serverExperiments,(0,YBe.getResponsesApiCompactionThresholdFromBody)(r)),B=new W9i.AsyncIterableObject(async M=>{try{await new Promise((U,q)=>{D.onEvent(Q=>{let Y=L.push(Q,o);if(Y&&((0,YBe.sendCompletionOutputTelemetry)(this._telemetryService,this._logService,Y,N),M.emitOne(Y)),Q.type==="response.completed"){let W=Q.copilot_quota_snapshots;W&&typeof W=="object"&&this._chatQuotaService.processQuotaSnapshots(W)}}),D.onCAPIError(Q=>{let Y=new Error(`${Q.error.message} (${Q.error.code})`);Y.gitHubRequestId=x.gitHubRequestId,Y.capiWebSocketError=Q,q(Y)}),D.onError(Q=>{if(Q.gitHubRequestId=x.gitHubRequestId,(0,z9i.isCancellationError)(Q)){q(Q);return}let Y=R.extendedBy({error:Q.message});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",Y.properties,Y.measurements);let W=Date.now()-P;R.measurements.totalTimeMs=W,R.properties.error=Q.message,this._logService.debug(`request.error: [websocket], took ${W} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",R.properties,R.measurements),q(Q)}),D.done.then(U,q)});let O=Date.now()-P;R.measurements.totalTimeMs=O,this._logService.debug(`request.response: [websocket], took ${O} ms`),this._telemetryService.sendGHTelemetryEvent("request.response",R.properties,R.measurements)}finally{let O=r.messages;if((!O||O.length===0)&&r.input)try{let U=(0,YBe.responseApiInputToRawMessagesForLogging)(r);O=(0,yI.rawMessageToCAPI)(U)}catch(U){this._logService.error("Failed to convert Response API input to messages for telemetry:",U),O=[]}(0,$9i.sendEngineMessagesTelemetry)(this._telemetryService,O??[],R,!1,this._logService)}}),j=await D.firstEvent;if(f.isCancellationRequested)return{result:{type:gn.FetchResponseKind.Canceled,reason:"after first WebSocket event"}};if((0,K9i.isCAPIWebSocketError)(j)){let M=Date.now()-P;return R.measurements.totalTimeMs=M,R.properties.error=`${j.error.message} (${j.error.code})`,this._logService.debug(`request.error: [websocket capi error], took ${M} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",R.properties,R.measurements),{result:await this._handleWebSocketCAPIError(j,x)}}return this._authenticationService.copilotToken?.isFreeUser&&this._authenticationService.copilotToken?.isChatQuotaExceeded&&this._authenticationService.resetCopilotToken(),{result:{type:gn.FetchResponseKind.Success,chatCompletions:B},modelCallId:w}}async _doFetchViaHttp(e,r,n,o,s,c,l,u,d,f,h,m,g,A){let y=(0,mOr.generateUuid)(),E=await this._fetchWithInstrumentation(e,l,r,s,c,d,f,{...h,modelCallId:y},m,g,A);if(d.isCancellationRequested){try{await E.body.destroy()}catch(T){this._logService.error(T,"Error destroying stream"),this._telemetryService.sendGHTelemetryException(T,"Error destroying stream")}return{result:{type:gn.FetchResponseKind.Canceled,reason:"after fetch request"},fetcher:E.fetcher,bytesReceived:E.bytesReceived}}if(E.status===200&&this._authenticationService.copilotToken?.isFreeUser&&this._authenticationService.copilotToken?.isChatQuotaExceeded&&this._authenticationService.resetCopilotToken(),E.status!==200){let T=J9i(e,c,l);return this._logService.info("Request ID for failed request: "+l),{result:await this._handleError(T,E,l),fetcher:E.fetcher,bytesReceived:E.bytesReceived,statusCode:E.status}}let _=n.extendedBy({modelCallId:y}),v,b=E.headers.get("x-github-request-id")??"";try{let T=await e.processResponseFromChatEndpoint(this._telemetryService,this._logService,E,u??1,o,_,d,c);v=new W9i.AsyncIterableObject(async w=>{try{for await(let R of T)w.emitOne(R)}catch(R){throw R.fetcherId=E.fetcher,R.gitHubRequestId=b,R.bytesReceived=E.bytesReceived,R}})}catch(T){throw T.fetcherId=E.fetcher,T.gitHubRequestId=b,T.bytesReceived=E.bytesReceived,T}return E.headers.get("Copilot-Edits-Session")&&(this._authenticationService.speculativeDecodingEndpointToken=E.headers.get("Copilot-Edits-Session")??void 0),this._chatQuotaService.processQuotaHeaders(E.headers),{result:{type:gn.FetchResponseKind.Success,chatCompletions:v},fetcher:E.fetcher,bytesReceived:E.bytesReceived,modelCallId:y}}async _fetchWithInstrumentation(e,r,n,o,s,c,l,u,d,f,h){let m={"X-Interaction-Id":this._interactionService.interactionId,"X-Initiator":l?"user":"agent"};n.messages?.some(E=>Array.isArray(E.content)?E.content.some(_=>"image_url"in _):!1)&&e.supportsVision&&(m["Copilot-Vision-Request"]="true");let g=Kye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Wn.ChatLocation.toString(s),transport:"http",...u},{maxTokenWindow:e.modelMaxPromptTokens});for(let[E,_]of Object.entries(n))if(!(E==="messages"||E==="input")){if(E==="tools"){g.properties[`request.option.${E}`]=(0,on.stringifyToolsRawForTelemetry)(_)??"undefined";continue}g.properties[`request.option.${E}`]=JSON.stringify(_)??"undefined"}g.properties.headerRequestId=r,this._telemetryService.sendGHTelemetryEvent("request.sent",g.properties,g.measurements),n.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,EOr.multiplexProperties)({headerRequestId:r,conversationId:u?.conversationId,messagesJson:(0,on.stringifyToolsRawForTelemetry)(n.tools)}),g.measurements);let A=Date.now(),y=JCt(s);return this._instantiationService.invokeFunction(YCt.postRequest,{endpointOrUrl:e,secretKey:o,intent:y,requestId:r,body:n,additionalHeaders:m,cancelToken:c,useFetcher:d,canRetryOnce:f,location:s,interactionTypeOverride:h}).then(E=>{let _=E.headers.get("apim-request-id");_&&this._logService.debug(`APIM request id: ${_}`);let v=E.headers.get("x-github-request-id");v&&this._logService.debug(`GH request id: ${v}`);let b=(0,pOr.getRequestId)(E.headers);b.headerRequestId=b.headerRequestId||r,g.extendWithRequestId(b),b.serverExperiments&&this._telemetryService.setSharedProperty("capi.assignmentcontext",b.serverExperiments);let T=Date.now()-A;return g.measurements.totalTimeMs=T,this._logService.debug(`request.response: [${(0,YCt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata)}], took ${T} ms`),this._telemetryService.sendGHTelemetryEvent("request.response",g.properties,g.measurements),E}).catch(E=>{if(this._fetcherService.isAbortError(E))throw E;let _=g.extendedBy({error:"Network exception"});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",_.properties,_.measurements),g.properties.code=String(E.code??""),g.properties.errno=String(E.errno??""),g.properties.message=String(E.message??""),g.properties.type=String(E.type??"");let v=Date.now()-A;throw g.measurements.totalTimeMs=v,this._logService.debug(`request.response: [${(0,YCt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata)}] took ${v} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",g.properties,g.measurements),E}).finally(()=>{let E=n.messages;if((!E||E.length===0)&&n.input)try{let _=(0,YBe.responseApiInputToRawMessagesForLogging)(n);E=(0,yI.rawMessageToCAPI)(_)}catch(_){this._logService.error("Failed to convert Response API input to messages for telemetry:",_),E=[]}(0,$9i.sendEngineMessagesTelemetry)(this._telemetryService,E??[],g,!1,this._logService)})}async _handleError(e,r,n){let o=(0,pOr.getRequestId)(r.headers);n=o.headerRequestId||n,o.headerRequestId=n,this._chatQuotaService.processQuotaHeaders(r.headers),e.properties.error=`Response status was ${r.status}`,e.properties.status=String(r.status),this._telemetryService.sendGHTelemetryEvent("request.shownWarning",e.properties,e.measurements);let s=await r.text(),c;try{c=JSON.parse(s),c=c?.error??c}catch{}let l=`Server error: ${r.status}`,u=`${l} ${s}`;if(this._logService.error(u),400<=r.status&&r.status<500){if(r.status===400&&s.includes("off_topic"))return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.OffTopic,reason:"filtered as off_topic by intent classifier: message was not programming related"};if(r.status===401&&s.includes("authorize_url")&&c?.authorize_url)return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.AgentUnauthorized,reason:r.statusText||r.statusText,data:c};if(r.status===400&&c?.code==="previous_response_not_found")return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.InvalidPreviousResponseId,reason:c.message||"Invalid previous response ID",data:c};if(r.status===401||r.status===403)return this._authenticationService.resetCopilotToken(r.status),{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.TokenExpiredOrInvalid,reason:c?.message||`token expired or invalid: ${r.status}`};if(r.status===402){this._authenticationService.copilotToken?.isChatQuotaExceeded||(this._authenticationService.resetCopilotToken(r.status),await this._authenticationService.getCopilotToken());let d=r.headers.get("retry-after"),h=a(m=>{if(!m)return;let g=new Date(m);if(!isNaN(g.getDate()))return g;let A=parseInt(m,10);if(!isNaN(A))return new Date(Date.now()+A*1e3)},"convertToDate")(d);return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.QuotaExceeded,reason:c?.message??"Free tier quota exceeded",data:{capiError:c,retryAfter:h}}}if(r.status===404){let d;return c?d=JSON.stringify(c):d=s,{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.NotFound,reason:d}}if(r.status===422)return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ContentFilter,reason:`Filtered by Responsible AI Service -`+s};if(r.status===424)return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.AgentFailedDependency,reason:s};if(r.status===429){let d=s;return d=c?.message??c?.code,s.includes("extension_blocked")&&c?.code==="extension_blocked"&&c?.type==="rate_limit_error"?{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ExtensionBlocked,reason:"Extension blocked",data:{...c?.message,retryAfter:r.headers.get("retry-after")}}:{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.RateLimited,reason:d,data:{retryAfter:r.headers.get("retry-after"),rateLimitKey:r.headers.get("x-ratelimit-exceeded"),capiError:c}}}if(r.status===466)return this._logService.info(s),{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ClientNotSupported,reason:`client not supported: ${s}`};if(r.status===499)return this._logService.info("Cancelled by server"),{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ServerCanceled,reason:"canceled by server"}}else if(500<=r.status&&r.status<600)return r.status===503?{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.RateLimited,reason:"Upstream provider rate limit hit",data:{retryAfter:null,rateLimitKey:null,capiError:{code:"upstream_provider_rate_limit",message:s}}}:{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ServerError,reason:l};return this._logService.error(`Request Failed: ${r.status} ${s}`),(0,e6i.sendCommunicationErrorTelemetry)(this._telemetryService,"Unhandled status from server: "+r.status,s),{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.Unknown,reason:`Request Failed: ${r.status} ${s}`}}async processSuccessfulResponse(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b){let T=[];for await(let P of e.chatCompletions)Nye.ChatMLFetcherTelemetrySender.sendSuccessTelemetry(this._telemetryService,{chatCompletion:P,baseTelemetry:f,userInitiatedRequest:m,interactionType:g,chatEndpointInfo:h,requestBody:o,maxResponseTokens:c,promptTokenCount:l,timeToFirstToken:u,timeToFirstTokenEmitted:f&&d.firstTokenEmittedTime?d.firstTokenEmittedTime-f.issuedTime:-1,hasImageMessages:this.filterImageMessages(r),imageTelemetryMeasurements:n,transport:A,fetcher:y,bytesReceived:E,suspendEventSeen:_,resumeEventSeen:v,modelCallId:b}),this.isRepetitive(P,f?.properties)||T.push(P);let w=new Set([fI.FinishedCompletionReason.Stop,fI.FinishedCompletionReason.ClientTrimmed,fI.FinishedCompletionReason.FunctionCall,fI.FinishedCompletionReason.ToolCalls]),R=T.filter(P=>w.has(P.finishReason));if(R.length>=1)return{type:zn.ChatFetchResponseType.Success,resolvedModel:R[0].model,usage:R.length===1?R[0].usage:void 0,value:R.map(P=>(0,TBe.getTextPart)(P.message.content)),requestId:s,serverRequestId:R[0].requestId.headerRequestId,modelCallId:b};let x=T.at(0);switch(x?.finishReason){case fI.FinishedCompletionReason.ContentFilter:return{type:zn.ChatFetchResponseType.FilteredRetry,category:x.filterReason??fI.FilterReason.Copyright,reason:"Response got filtered.",value:T.map(P=>(0,TBe.getTextPart)(P.message.content)),requestId:s,serverRequestId:x.requestId.headerRequestId};case fI.FinishedCompletionReason.Length:return{type:zn.ChatFetchResponseType.Length,reason:"Response too long.",requestId:s,serverRequestId:x.requestId.headerRequestId,truncatedValue:(0,TBe.getTextPart)(x.message.content)};case fI.FinishedCompletionReason.ServerError:return{type:zn.ChatFetchResponseType.Failed,reason:"Server error. Stream terminated",requestId:s,serverRequestId:x.requestId.headerRequestId,streamError:x.error}}return{type:zn.ChatFetchResponseType.Unknown,reason:zn.RESPONSE_CONTAINED_NO_CHOICES,requestId:s,serverRequestId:x?.requestId.headerRequestId}}filterImageMessages(e){return e?.some(r=>Array.isArray(r.content)?r.content.some(n=>"imageUrl"in n):!1)}isRepetitive(e,r){let n=(0,SCt.calculateLineRepetitionStats)((0,TBe.getTextPart)(e.message.content)),o=(0,SCt.isRepetitive)(e.tokens);if(o){let s=Mye.TelemetryData.createAndMarkAsIssued();s.extendWithRequestId(e.requestId);let c=s.extendedBy(r);this._telemetryService.sendEnhancedGHTelemetryEvent("conversation.repetition.detected",c.properties,c.measurements)}return n.numberOfRepetitions>=10&&this._telemetryService.sendMSFTTelemetryEvent("conversation.repetition.detected",{requestId:e.requestId.headerRequestId,finishReason:e.finishReason},{numberOfRepetitions:n.numberOfRepetitions,lengthOfLine:n.mostRepeatedLine.length,totalLines:n.totalLines}),o}checkRepetitionInDeltas(e,r,n){let o=e.filter(u=>u.text?.length>0).map(u=>u.text).join("");if(!o||o.trim().length===0)return;let s=o.split(/\s+/).filter(u=>u.length>0),c=(0,SCt.calculateLineRepetitionStats)(o);if((0,SCt.isRepetitive)(s)){let d=Mye.TelemetryData.createAndMarkAsIssued().extendedBy(n);this._telemetryService.sendEnhancedGHTelemetryEvent("conversation.repetition.detected",d.properties,d.measurements)}c.numberOfRepetitions>=10&&this._telemetryService.sendMSFTTelemetryEvent("conversation.repetition.detected",{requestId:r,finishReason:"canceled"},{numberOfRepetitions:c.numberOfRepetitions,lengthOfLine:c.mostRepeatedLine.length,totalLines:c.totalLines})}processCanceledResponse(e,r,n,o){return n&&n.deltas.length>0&&this.checkRepetitionInDeltas(n.deltas,r,o),{type:zn.ChatFetchResponseType.Canceled,reason:e.reason,requestId:r,serverRequestId:void 0}}processFailedResponse(e,r,n){let o=e.modelRequestId?.gitHubRequestId,s=e.reason;if(e.failKind===gn.ChatFailKind.RateLimited)return{type:zn.ChatFetchResponseType.RateLimited,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,rateLimitKey:e.data?.rateLimitKey||"",isAuto:n,capiError:e.data?.capiError};if(e.failKind===gn.ChatFailKind.QuotaExceeded)return{type:zn.ChatFetchResponseType.QuotaExceeded,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,capiError:e.data?.capiError};if(e.failKind===gn.ChatFailKind.OffTopic)return{type:zn.ChatFetchResponseType.OffTopic,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.TokenExpiredOrInvalid||e.failKind===gn.ChatFailKind.ClientNotSupported||s.includes("Bad request: "))return{type:zn.ChatFetchResponseType.BadRequest,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.ServerError)return{type:zn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.ContentFilter)return{type:zn.ChatFetchResponseType.PromptFiltered,reason:s,category:fI.FilterReason.Prompt,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.AgentUnauthorized)return{type:zn.ChatFetchResponseType.AgentUnauthorized,reason:s,authorizationUrl:e.data.authorize_url,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.AgentFailedDependency)return{type:zn.ChatFetchResponseType.AgentFailedDependency,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.ExtensionBlocked){let c=typeof e.data?.retryAfter=="number"?e.data.retryAfter:300;return{type:zn.ChatFetchResponseType.ExtensionBlocked,reason:s,requestId:r,retryAfter:c,learnMoreLink:e.data?.learnMoreLink??"",serverRequestId:o}}return e.failKind===gn.ChatFailKind.NotFound?{type:zn.ChatFetchResponseType.NotFound,reason:s,requestId:r,serverRequestId:o}:e.failKind===gn.ChatFailKind.InvalidPreviousResponseId?{type:zn.ChatFetchResponseType.InvalidStatefulMarker,reason:s,requestId:r,serverRequestId:o}:{type:zn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o}}processError(e,r,n,o,s){let c=e?.capiWebSocketError;if(c)return this._handleWebSocketError(c,r,n,s);let l=this._fetcherService;if(l.isAbortError(e))return{type:zn.ChatFetchResponseType.Canceled,reason:"network request aborted",requestId:r,serverRequestId:n};if((0,r6i.isCancellationError)(e))return{type:zn.ChatFetchResponseType.Canceled,reason:"Got a cancellation error",requestId:r,serverRequestId:n};if(e&&(e instanceof Error&&e.message==="Premature close"||typeof e=="object"&&e.code==="ERR_STREAM_PREMATURE_CLOSE"))return{type:zn.ChatFetchResponseType.Canceled,reason:"Stream closed prematurely",requestId:r,serverRequestId:n};this._logService.error(fvc.ErrorUtils.fromUnknown(e),"Error on conversation request"),this._telemetryService.sendGHTelemetryException(e,"Error on conversation request");let u=l.getUserMessageForFetcherError(e),d=(0,bMr.collectSingleLineErrorMessage)(e,!0),f=this.scrubErrorDetail(d,o);if(l.isInternetDisconnectedError(e))return{type:zn.ChatFetchResponseType.NetworkError,reason:"It appears you're not connected to the internet, please check your network connection and try again.",reasonDetail:f,requestId:r,serverRequestId:n};if(l.isFetcherError(e)){let h=l.isNetworkProcessCrashedError(e);return{type:zn.ChatFetchResponseType.NetworkError,reason:u,reasonDetail:f,requestId:r,serverRequestId:n,...h?{isNetworkProcessCrash:!0}:{}}}else return{type:zn.ChatFetchResponseType.Failed,reason:"Error on conversation request. Check the log for more details.",reasonDetail:f,requestId:r,serverRequestId:n}}async _handleWebSocketCAPIError(e,r){let{code:n,message:o}=e.error,s={code:n,message:o},c=n.split(":")[0];return this._logService.error(`WebSocket CAPI error: ${o} (${n})`),c==="rate_limited"||c==="user_model_rate_limited"||c==="user_global_rate_limited"||c==="integration_rate_limited"||c==="model_overloaded"||c==="agent_mode_limit_exceeded"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.RateLimited,reason:o,data:{capiError:s}}:c==="quota_exceeded"||c==="free_quota_exceeded"||c==="overage_limit_reached"||c==="billing_not_configured"||c==="additional_spend_limit_reached"?(this._authenticationService.copilotToken?.isChatQuotaExceeded||(this._authenticationService.resetCopilotToken(402),await this._authenticationService.getCopilotToken()),{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.QuotaExceeded,reason:o,data:{capiError:s}}):n==="content_filter"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.ContentFilter,reason:o}:n==="not_found"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.NotFound,reason:o}:n==="request_too_large"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:n==="service_unavailable"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o}`}:n==="bad_request"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o||"WebSocket server error"}`}}_handleWebSocketError(e,r,n,o){let{code:s,message:c}=e.error,l={code:s,message:c},u=s.split(":")[0];return u==="rate_limited"||u==="user_model_rate_limited"||u==="user_global_rate_limited"||u==="integration_rate_limited"||u==="model_overloaded"||u==="agent_mode_limit_exceeded"?{type:zn.ChatFetchResponseType.RateLimited,reason:c,requestId:r,serverRequestId:n,retryAfter:void 0,rateLimitKey:"",isAuto:o,capiError:l}:u==="quota_exceeded"||u==="free_quota_exceeded"||u==="overage_limit_reached"||u==="billing_not_configured"||u==="additional_spend_limit_reached"?{type:zn.ChatFetchResponseType.QuotaExceeded,reason:c,requestId:r,serverRequestId:n,capiError:l,retryAfter:void 0}:s==="content_filter"?{type:zn.ChatFetchResponseType.PromptFiltered,reason:c,category:fI.FilterReason.Prompt,requestId:r,serverRequestId:n}:s==="not_found"?{type:zn.ChatFetchResponseType.NotFound,reason:c,requestId:r,serverRequestId:n}:s==="bad_request"?{type:zn.ChatFetchResponseType.BadRequest,reason:c,requestId:r,serverRequestId:n}:{type:zn.ChatFetchResponseType.Failed,reason:`Request Failed: ${s} ${c||"WebSocket server error"}`,requestId:r,serverRequestId:n}}scrubErrorDetail(e,r){if(r){let n=new RegExp((0,mvc.escapeRegExpCharacters)(r),"ig");e=e.replaceAll(n,"")}return e.replaceAll(/(?<=logged in as )(?!)[^\s]+/ig,"!!")}};pI.ChatMLFetcherImpl=TMr;pI.ChatMLFetcherImpl=TMr=CMr=Z_c([qv(0,avc.IFetcherService),qv(1,SMr.ITelemetryService),qv(2,lvc.IRequestLogger),qv(3,bMr.ILogService),qv(4,evc.IAuthenticationService),qv(5,ivc.IInteractionService),qv(6,rvc.IChatQuotaService),qv(7,ovc.ICAPIClientService),qv(8,nvc.IConversationOptions),qv(9,tV.IConfigurationService),qv(10,uvc.IExperimentationService),qv(11,yvc.IPowerService),qv(12,gvc.IInstantiationService),qv(13,i6i.IChatWebSocketManager),qv(14,cvc.IOTelService)],TMr);function Evc(t,e,r,n,o){if(t.length===0)return{isValid:!1,reason:vMr("No messages provided")};if(e?.max_tokens&&e?.max_tokens<1)return{isValid:!1,reason:vMr("Invalid response token parameter")};let s=/^[a-zA-Z0-9_-]+$/;return e?.functions?.some(c=>!c.name.match(s))||e?.function_call?.name&&!e.function_call.name.match(s)?{isValid:!1,reason:vMr("Function names must match ^[a-zA-Z0-9_-]+$")}:e?.tools&&e.tools.length>tV.HARD_TOOL_LIMIT&&!r.supportsToolSearch?{isValid:!1,reason:`Tool limit exceeded (${e.tools.length}/${tV.HARD_TOOL_LIMIT}). Click "Configure Tools" in the chat input to disable ${e.tools.length-tV.HARD_TOOL_LIMIT} tools and retry.`}:{isValid:!0,reason:""}}a(Evc,"isValidChatPayload");function vMr(t){return`Prompt failed validation with the reason: ${t}. Please file an issue.`}a(vMr,"asUnexpected");function o6i(t,e,r){return Mye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:zn.ChatLocation.toString(e),headerRequestId:r})}a(o6i,"createTelemetryData");function TCt(t){switch(t){case zn.ChatLocation.Panel:return"conversation-panel";case zn.ChatLocation.Editor:return"conversation-inline";case zn.ChatLocation.EditingSession:return"conversation-edits";case zn.ChatLocation.Notebook:return"conversation-notebook";case zn.ChatLocation.Terminal:return"conversation-terminal";case zn.ChatLocation.Other:return"conversation-other";case zn.ChatLocation.Agent:return"conversation-agent";case zn.ChatLocation.ResponsesProxy:return"responses-proxy";case zn.ChatLocation.MessagesProxy:return"messages-proxy"}}a(TCt,"locationToIntent");function _vc(t){let e={};for(let r of["tool_choice","reasoning","reasoning_effort","thinking","thinking_budget","output_config","response_format","text","truncation","context_management","frequency_penalty","presence_penalty","top_logprobs","logit_bias","store","stream","stream_options","prediction","seed","parallel_tool_calls","service_tier","metadata","verbosity","snippy","state","intent","intent_threshold","include"]){let n=t[r];n!==void 0&&(e[r]=n)}return Object.keys(e).length>0?e:void 0}a(_vc,"pickCacheRelevantRequestOptions");function vvc(t){let e={};return Array.isArray(t.input)?(e.api="responses",e.inputItemCount=t.input.length,e.inputItemTypes=t.input.map(r=>{if(r&&typeof r=="object"){let n=r.type;if(typeof n=="string")return n}return"unknown"})):Array.isArray(t.messages)&&(e.api="messages",e.messageCount=t.messages.length),typeof t.previous_response_id=="string"&&(e.hasPreviousResponseId=!0),Object.keys(e).length>0?e:void 0}a(vvc,"pickRequestShapeMetadata")});var xMr=I(Oye=>{"use strict";p();Object.defineProperty(Oye,"__esModule",{value:!0});Oye.NullSimilarFilesContextService=Oye.ISimilarFilesContextService=void 0;var Cvc=nn();Oye.ISimilarFilesContextService=(0,Cvc.createServiceIdentifier)("ISimilarFilesContextService");var IMr=class{static{a(this,"NullSimilarFilesContextService")}async compute(){}async getSnippetsForPrompt(){}};Oye.NullSimilarFilesContextService=IMr});var wMr=I(xCt=>{"use strict";p();Object.defineProperty(xCt,"__esModule",{value:!0});xCt.IDiffService=void 0;var bvc=nn();xCt.IDiffService=(0,bvc.createServiceIdentifier)("IDiffService")});var a6i=I(RMr=>{"use strict";p();Object.defineProperty(RMr,"__esModule",{value:!0});RMr.createProxyXtabEndpoint=xvc;var Svc=(Sne(),ba(bne)),Tvc=Qne(),Ivc=Gne();function xvc(t,e){let r={id:e??"copilot-nes-xtab",urlOrRequestMetadata:{type:Svc.RequestType.ProxyChatCompletions},name:"xtab-proxy",vendor:"xtab",model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"unknown",capabilities:{type:"chat",family:"xtab-proxy",tokenizer:Tvc.TokenizerType.O200K,limits:{max_prompt_tokens:12285,max_output_tokens:4096},supports:{streaming:!0,parallel_tool_calls:!1,tool_calls:!1,vision:!1,prediction:!0}}};return t.createInstance(Ivc.ChatEndpoint,r)}a(xvc,"createProxyXtabEndpoint")});var Vne=I(wCt=>{"use strict";p();Object.defineProperty(wCt,"__esModule",{value:!0});wCt.DocumentId=void 0;var wvc=WJe(),c6i=NA(),Rvc=nd(),kMr=class t{static{a(this,"DocumentId")}static{this._cache=new wvc.CachedFunction({getCacheKey:JSON.stringify},e=>new t(e.uri))}static create(e){return t._cache.get({uri:e})}constructor(e){this.uri=e,this._uri=Rvc.URI.parse(this.uri)}get path(){return this._uri.path}get fragment(){return this._uri.fragment}toString(){return this.uri}get baseName(){return(0,c6i.basename)(this.uri)}get extension(){return(0,c6i.extname)(this.uri)}toUri(){return this._uri}};wCt.DocumentId=kMr});var PMr=I(RCt=>{"use strict";p();Object.defineProperty(RCt,"__esModule",{value:!0});RCt.NextCursorLinePrediction=void 0;var l6i;(function(t){t.Jump="jump",t.OnlyWithEdit="onlyWithEdit"})(l6i||(RCt.NextCursorLinePrediction=l6i={}))});var kCt=I(rV=>{"use strict";p();Object.defineProperty(rV,"__esModule",{value:!0});rV.NullUndesiredModelsManager=rV.IUndesiredModelsManager=rV.IInlineEditsModelService=void 0;var u6i=nn(),kvc=Ic();rV.IInlineEditsModelService=(0,u6i.createServiceIdentifier)("IInlineEditsModelService");rV.IUndesiredModelsManager=(0,u6i.createServiceIdentifier)("IUndesiredModelsManager");var DMr=class{static{a(this,"NullUndesiredModelsManager")}constructor(){this.onDidChange=kvc.Event.None}isUndesiredModelId(e){return!1}addUndesiredModelId(e){return Promise.resolve()}removeUndesiredModelId(e){return Promise.resolve()}};rV.NullUndesiredModelsManager=DMr});var d6i=I(t9=>{"use strict";p();Object.defineProperty(t9,"__esModule",{value:!0});t9.IgnoreWhitespaceOnlyChanges=t9.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges=void 0;t9.editWouldDeleteWhatWasJustInserted=Pvc;t9.editIsDeletion=OMr;t9.editWouldDeleteWhatWasJustInserted2=Dvc;var NMr=class t{static{a(this,"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges")}static filterEdit(e,r){return r.filter(o=>!t._isWhitespaceOnlyChange(o,e.documentAfterEditsLines))}static _isWhitespaceOnlyChange(e,r){let n=e.lineRange.toOffsetRange().slice(r),o=e.newLines,s=o.length===0;if(s&&n.every(c=>c.trim()==="")||!s&&o.every(c=>c.trim()===""))return!0;if(n.length!==o.length)return!1;for(let c=0;c!t._isFormattingOnlyChange(e.documentAfterEditsLines,n))}static _isFormattingOnlyChange(e,r){let n=r.lineRange.toOffsetRange().slice(e).join("").replace(/\s/g,""),o=r.newLines.join("").replace(/\s/g,"");return n===o}};t9.IgnoreWhitespaceOnlyChanges=MMr;function Pvc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!OMr(r))return!1;for(let n=t.recentEdits.edits.length-1;n>=0;n--){let o=t.recentEdits.edits[n],s=r.tryRebase(o);if(!s)return!0;r=s}return!1}a(Pvc,"editWouldDeleteWhatWasJustInserted");function OMr(t){let e=t.replacements.reduce((n,o)=>n+o.replaceRange.length,0);return t.replacements.reduce((n,o)=>n+o.newText.length,0)===0&&e>0}a(OMr,"editIsDeletion");function Dvc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!OMr(r))return!1;let n=t.documentAfterEdits.value;for(let o=t.recentEdits.edits.length-1;o>=0;o--){let c=t.recentEdits.edits[o].inverse(n);if(c.equals(r))return!0;n=c.apply(n)}return!1}a(Dvc,"editWouldDeleteWhatWasJustInserted2")});var BMr=I(Lye=>{"use strict";p();Object.defineProperty(Lye,"__esModule",{value:!0});Lye.NulSimulationTestContext=Lye.ISimulationTestContext=void 0;var Nvc=nn();Lye.ISimulationTestContext=(0,Nvc.createServiceIdentifier)("ISimulationTestContext");var LMr=class{static{a(this,"NulSimulationTestContext")}constructor(){this.isInSimulationTests=!1}async writeFile(e,r,n){return""}};Lye.NulSimulationTestContext=LMr});var DCt=I(PCt=>{"use strict";p();Object.defineProperty(PCt,"__esModule",{value:!0});PCt.BaseAlternativeNotebookContentProvider=void 0;var FMr=class{static{a(this,"BaseAlternativeNotebookContentProvider")}constructor(e){this.kind=e}};PCt.BaseAlternativeNotebookContentProvider=FMr});var QMr=I(uN=>{"use strict";p();Object.defineProperty(uN,"__esModule",{value:!0});uN.DEFAULT_WORD_REGEXP=uN.USUAL_WORD_SEPARATORS=void 0;uN.ensureValidWordDefinition=f6i;uN.setDefaultGetWordAtTextConfig=Fvc;uN.getWordAtText=p6i;var Mvc=fjt(),Ovc=Ro(),Lvc=vue();uN.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Bvc(t=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(let r of uN.USUAL_WORD_SEPARATORS)t.indexOf(r)>=0||(e+="\\"+r);return e+="\\s]+)",new RegExp(e,"g")}a(Bvc,"createWordRegExp");uN.DEFAULT_WORD_REGEXP=Bvc();function f6i(t){let e=uN.DEFAULT_WORD_REGEXP;if(t&&t instanceof RegExp)if(t.global)e=t;else{let r="g";t.ignoreCase&&(r+="i"),t.multiline&&(r+="m"),t.unicode&&(r+="u"),e=new RegExp(t.source,r)}return e.lastIndex=0,e}a(f6i,"ensureValidWordDefinition");var UMr=new Lvc.LinkedList;UMr.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function Fvc(t){let e=UMr.unshift(t);return(0,Ovc.toDisposable)(e)}a(Fvc,"setDefaultGetWordAtTextConfig");function p6i(t,e,r,n,o){if(e=f6i(e),o||(o=Mvc.Iterable.first(UMr)),r.length>o.maxLen){let d=t-o.maxLen/2;return d<0?d=0:n+=d,r=r.substring(d,t+o.maxLen/2),p6i(t,e,r,n,o)}let s=Date.now(),c=t-1-n,l=-1,u=null;for(let d=1;!(Date.now()-s>=o.timeBudget);d++){let f=c-o.windowSize*d;e.lastIndex=Math.max(0,f);let h=Uvc(e,r,c,l);if(!h&&u||(u=h,f<=0))break;l=f}if(u){let d={word:u[0],startColumn:n+1+u.index,endColumn:n+1+u.index+u[0].length};return e.lastIndex=0,d}return null}a(p6i,"getWordAtText");function Uvc(t,e,r,n){let o;for(;o=t.exec(e);){let s=o.index||0;if(s<=r&&t.lastIndex>=r)return o;if(n>0&&s>n)return null}return null}a(Uvc,"_findRegexMatchEnclosingPosition")});var h6i=I(NCt=>{"use strict";p();Object.defineProperty(NCt,"__esModule",{value:!0});NCt.toUint8=Qvc;NCt.toUint32=qvc;function Qvc(t){return t<0?0:t>255?255:t|0}a(Qvc,"toUint8");function qvc(t){return t<0?0:t>4294967295?4294967295:t|0}a(qvc,"toUint32")});var m6i=I(nV=>{"use strict";p();Object.defineProperty(nV,"__esModule",{value:!0});nV.PrefixSumIndexOfResult=nV.ConstantTimePrefixSumComputer=nV.PrefixSumComputer=void 0;var jvc=Sl(),Bye=h6i(),qMr=class{static{a(this,"PrefixSumComputer")}constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}getCount(){return this.values.length}insertValues(e,r){e=(0,Bye.toUint32)(e);let n=this.values,o=this.prefixSum,s=r.length;return s===0?!1:(this.values=new Uint32Array(n.length+s),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+s),this.values.set(r,e),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,r){return e=(0,Bye.toUint32)(e),r=(0,Bye.toUint32)(r),this.values[e]===r?!1:(this.values[e]=r,e-1=n.length)return!1;let s=n.length-e;return r>=s&&(r=s),r===0?!1:(this.values=new Uint32Array(n.length-r),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+r),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=(0,Bye.toUint32)(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let r=this.prefixSumValidIndex[0]+1;r===0&&(this.prefixSum[0]=this.values[0],r++),e>=this.values.length&&(e=this.values.length-1);for(let n=r;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let r=0,n=this.values.length-1,o=0,s=0,c=0;for(;r<=n;)if(o=r+(n-r)/2|0,s=this.prefixSum[o],c=s-this.values[o],e=s)r=o+1;else break;return new Fye(o,e-c)}};nV.PrefixSumComputer=qMr;var jMr=class{static{a(this,"ConstantTimePrefixSumComputer")}constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();let r=this._indexBySum[e];if(r===void 0){let o=Math.max(0,this._values.length-1),s=o>0?this._prefixSum[o-1]:0;return new Fye(o,e-s)}let n=r>0?this._prefixSum[r-1]:0;return new Fye(r,e-n)}removeValues(e,r){this._values.splice(e,r),this._invalidate(e)}insertValues(e,r){this._values=(0,jvc.arrayInsert)(this._values,e,r),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,r=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=o+n;for(let s=0;s0?this._prefixSum[this._values.length-1]:0,this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,r){this._values[e]!==r&&(this._values[e]=r,this._invalidate(e))}};nV.ConstantTimePrefixSumComputer=jMr;var Fye=class{static{a(this,"PrefixSumIndexOfResult")}constructor(e,r){this.index=e,this.remainder=r,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=r}};nV.PrefixSumIndexOfResult=Fye});var GMr=I(MCt=>{"use strict";p();Object.defineProperty(MCt,"__esModule",{value:!0});MCt.PositionOffsetTransformer=void 0;var g6i=em(),A6i=kE(),Hvc=hd(),Gvc=m6i(),Wne=P0(),HMr=class{static{a(this,"PositionOffsetTransformer")}constructor(e){this._lines=(0,g6i.splitLines)(e),this._eol=e.charAt(this._lines[0].length)==="\r"?`\r +`+s};if(r.status===424)return{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.AgentFailedDependency,reason:s};if(r.status===429){let d=s;return d=c?.message??c?.code,s.includes("extension_blocked")&&c?.code==="extension_blocked"&&c?.type==="rate_limit_error"?{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ExtensionBlocked,reason:"Extension blocked",data:{...c?.message,retryAfter:r.headers.get("retry-after")}}:{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.RateLimited,reason:d,data:{retryAfter:r.headers.get("retry-after"),rateLimitKey:r.headers.get("x-ratelimit-exceeded"),capiError:c}}}if(r.status===466)return this._logService.info(s),{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ClientNotSupported,reason:`client not supported: ${s}`};if(r.status===499)return this._logService.info("Cancelled by server"),{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ServerCanceled,reason:"canceled by server"}}else if(500<=r.status&&r.status<600)return r.status===503?{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.RateLimited,reason:"Upstream provider rate limit hit",data:{retryAfter:null,rateLimitKey:null,capiError:{code:"upstream_provider_rate_limit",message:s}}}:{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.ServerError,reason:l};return this._logService.error(`Request Failed: ${r.status} ${s}`),(0,V9i.sendCommunicationErrorTelemetry)(this._telemetryService,"Unhandled status from server: "+r.status,s),{type:gn.FetchResponseKind.Failed,modelRequestId:o,failKind:gn.ChatFailKind.Unknown,reason:`Request Failed: ${r.status} ${s}`}}async processSuccessfulResponse(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b){let T=[];for await(let P of e.chatCompletions)Yye.ChatMLFetcherTelemetrySender.sendSuccessTelemetry(this._telemetryService,{chatCompletion:P,baseTelemetry:f,userInitiatedRequest:m,interactionType:g,chatEndpointInfo:h,requestBody:o,maxResponseTokens:c,promptTokenCount:l,timeToFirstToken:u,timeToFirstTokenEmitted:f&&d.firstTokenEmittedTime?d.firstTokenEmittedTime-f.issuedTime:-1,hasImageMessages:this.filterImageMessages(r),imageTelemetryMeasurements:n,transport:A,fetcher:y,bytesReceived:E,suspendEventSeen:_,resumeEventSeen:v,modelCallId:b}),this.isRepetitive(P,f?.properties)||T.push(P);let w=new Set([yI.FinishedCompletionReason.Stop,yI.FinishedCompletionReason.ClientTrimmed,yI.FinishedCompletionReason.FunctionCall,yI.FinishedCompletionReason.ToolCalls]),R=T.filter(P=>w.has(P.finishReason));if(R.length>=1)return{type:Wn.ChatFetchResponseType.Success,resolvedModel:R[0].model,usage:R.length===1?R[0].usage:void 0,value:R.map(P=>(0,zBe.getTextPart)(P.message.content)),requestId:s,serverRequestId:R[0].requestId.headerRequestId,modelCallId:b};let x=T.at(0);switch(x?.finishReason){case yI.FinishedCompletionReason.ContentFilter:return{type:Wn.ChatFetchResponseType.FilteredRetry,category:x.filterReason??yI.FilterReason.Copyright,reason:"Response got filtered.",value:T.map(P=>(0,zBe.getTextPart)(P.message.content)),requestId:s,serverRequestId:x.requestId.headerRequestId};case yI.FinishedCompletionReason.Length:return{type:Wn.ChatFetchResponseType.Length,reason:"Response too long.",requestId:s,serverRequestId:x.requestId.headerRequestId,truncatedValue:(0,zBe.getTextPart)(x.message.content)};case yI.FinishedCompletionReason.ServerError:return{type:Wn.ChatFetchResponseType.Failed,reason:"Server error. Stream terminated",requestId:s,serverRequestId:x.requestId.headerRequestId,streamError:x.error}}return{type:Wn.ChatFetchResponseType.Unknown,reason:Wn.RESPONSE_CONTAINED_NO_CHOICES,requestId:s,serverRequestId:x?.requestId.headerRequestId}}filterImageMessages(e){return e?.some(r=>Array.isArray(r.content)?r.content.some(n=>"imageUrl"in n):!1)}isRepetitive(e,r){let n=(0,KCt.calculateLineRepetitionStats)((0,zBe.getTextPart)(e.message.content)),o=(0,KCt.isRepetitive)(e.tokens);if(o){let s=Kye.TelemetryData.createAndMarkAsIssued();s.extendWithRequestId(e.requestId);let c=s.extendedBy(r);this._telemetryService.sendEnhancedGHTelemetryEvent("conversation.repetition.detected",c.properties,c.measurements)}return n.numberOfRepetitions>=10&&this._telemetryService.sendMSFTTelemetryEvent("conversation.repetition.detected",{requestId:e.requestId.headerRequestId,finishReason:e.finishReason},{numberOfRepetitions:n.numberOfRepetitions,lengthOfLine:n.mostRepeatedLine.length,totalLines:n.totalLines}),o}checkRepetitionInDeltas(e,r,n){let o=e.filter(u=>u.text?.length>0).map(u=>u.text).join("");if(!o||o.trim().length===0)return;let s=o.split(/\s+/).filter(u=>u.length>0),c=(0,KCt.calculateLineRepetitionStats)(o);if((0,KCt.isRepetitive)(s)){let d=Kye.TelemetryData.createAndMarkAsIssued().extendedBy(n);this._telemetryService.sendEnhancedGHTelemetryEvent("conversation.repetition.detected",d.properties,d.measurements)}c.numberOfRepetitions>=10&&this._telemetryService.sendMSFTTelemetryEvent("conversation.repetition.detected",{requestId:r,finishReason:"canceled"},{numberOfRepetitions:c.numberOfRepetitions,lengthOfLine:c.mostRepeatedLine.length,totalLines:c.totalLines})}processCanceledResponse(e,r,n,o){return n&&n.deltas.length>0&&this.checkRepetitionInDeltas(n.deltas,r,o),{type:Wn.ChatFetchResponseType.Canceled,reason:e.reason,requestId:r,serverRequestId:void 0}}processFailedResponse(e,r,n){let o=e.modelRequestId?.gitHubRequestId,s=e.reason;if(e.failKind===gn.ChatFailKind.RateLimited)return{type:Wn.ChatFetchResponseType.RateLimited,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,rateLimitKey:e.data?.rateLimitKey||"",isAuto:n,capiError:e.data?.capiError};if(e.failKind===gn.ChatFailKind.QuotaExceeded)return{type:Wn.ChatFetchResponseType.QuotaExceeded,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,capiError:e.data?.capiError};if(e.failKind===gn.ChatFailKind.OffTopic)return{type:Wn.ChatFetchResponseType.OffTopic,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.TokenExpiredOrInvalid||e.failKind===gn.ChatFailKind.ClientNotSupported||s.includes("Bad request: "))return{type:Wn.ChatFetchResponseType.BadRequest,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.ServerError)return{type:Wn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.ContentFilter)return{type:Wn.ChatFetchResponseType.PromptFiltered,reason:s,category:yI.FilterReason.Prompt,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.AgentUnauthorized)return{type:Wn.ChatFetchResponseType.AgentUnauthorized,reason:s,authorizationUrl:e.data.authorize_url,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.AgentFailedDependency)return{type:Wn.ChatFetchResponseType.AgentFailedDependency,reason:s,requestId:r,serverRequestId:o};if(e.failKind===gn.ChatFailKind.ExtensionBlocked){let c=typeof e.data?.retryAfter=="number"?e.data.retryAfter:300;return{type:Wn.ChatFetchResponseType.ExtensionBlocked,reason:s,requestId:r,retryAfter:c,learnMoreLink:e.data?.learnMoreLink??"",serverRequestId:o}}return e.failKind===gn.ChatFailKind.NotFound?{type:Wn.ChatFetchResponseType.NotFound,reason:s,requestId:r,serverRequestId:o}:e.failKind===gn.ChatFailKind.InvalidPreviousResponseId?{type:Wn.ChatFetchResponseType.InvalidStatefulMarker,reason:s,requestId:r,serverRequestId:o}:{type:Wn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o}}processError(e,r,n,o,s){let c=e?.capiWebSocketError;if(c)return this._handleWebSocketError(c,r,n,s);let l=this._fetcherService;if(l.isAbortError(e))return{type:Wn.ChatFetchResponseType.Canceled,reason:"network request aborted",requestId:r,serverRequestId:n};if((0,z9i.isCancellationError)(e))return{type:Wn.ChatFetchResponseType.Canceled,reason:"Got a cancellation error",requestId:r,serverRequestId:n};if(e&&(e instanceof Error&&e.message==="Premature close"||typeof e=="object"&&e.code==="ERR_STREAM_PREMATURE_CLOSE"))return{type:Wn.ChatFetchResponseType.Canceled,reason:"Stream closed prematurely",requestId:r,serverRequestId:n};this._logService.error(Bbc.ErrorUtils.fromUnknown(e),"Error on conversation request"),this._telemetryService.sendGHTelemetryException(e,"Error on conversation request");let u=l.getUserMessageForFetcherError(e),d=(0,yOr.collectSingleLineErrorMessage)(e,!0),f=this.scrubErrorDetail(d,o);if(l.isInternetDisconnectedError(e))return{type:Wn.ChatFetchResponseType.NetworkError,reason:"It appears you're not connected to the internet, please check your network connection and try again.",reasonDetail:f,requestId:r,serverRequestId:n};if(l.isFetcherError(e)){let h=l.isNetworkProcessCrashedError(e);return{type:Wn.ChatFetchResponseType.NetworkError,reason:u,reasonDetail:f,requestId:r,serverRequestId:n,...h?{isNetworkProcessCrash:!0}:{}}}else return{type:Wn.ChatFetchResponseType.Failed,reason:"Error on conversation request. Check the log for more details.",reasonDetail:f,requestId:r,serverRequestId:n}}async _handleWebSocketCAPIError(e,r){let{code:n,message:o}=e.error,s={code:n,message:o},c=n.split(":")[0];return this._logService.error(`WebSocket CAPI error: ${o} (${n})`),c==="rate_limited"||c==="user_model_rate_limited"||c==="user_global_rate_limited"||c==="integration_rate_limited"||c==="model_overloaded"||c==="agent_mode_limit_exceeded"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.RateLimited,reason:o,data:{capiError:s}}:c==="quota_exceeded"||c==="free_quota_exceeded"||c==="overage_limit_reached"||c==="billing_not_configured"||c==="additional_spend_limit_reached"?(this._authenticationService.copilotToken?.isChatQuotaExceeded||(this._authenticationService.resetCopilotToken(402),await this._authenticationService.getCopilotToken()),{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.QuotaExceeded,reason:o,data:{capiError:s}}):n==="content_filter"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.ContentFilter,reason:o}:n==="not_found"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.NotFound,reason:o}:n==="request_too_large"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:n==="service_unavailable"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o}`}:n==="bad_request"?{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:{type:gn.FetchResponseKind.Failed,modelRequestId:r,failKind:gn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o||"WebSocket server error"}`}}_handleWebSocketError(e,r,n,o){let{code:s,message:c}=e.error,l={code:s,message:c},u=s.split(":")[0];return u==="rate_limited"||u==="user_model_rate_limited"||u==="user_global_rate_limited"||u==="integration_rate_limited"||u==="model_overloaded"||u==="agent_mode_limit_exceeded"?{type:Wn.ChatFetchResponseType.RateLimited,reason:c,requestId:r,serverRequestId:n,retryAfter:void 0,rateLimitKey:"",isAuto:o,capiError:l}:u==="quota_exceeded"||u==="free_quota_exceeded"||u==="overage_limit_reached"||u==="billing_not_configured"||u==="additional_spend_limit_reached"?{type:Wn.ChatFetchResponseType.QuotaExceeded,reason:c,requestId:r,serverRequestId:n,capiError:l,retryAfter:void 0}:s==="content_filter"?{type:Wn.ChatFetchResponseType.PromptFiltered,reason:c,category:yI.FilterReason.Prompt,requestId:r,serverRequestId:n}:s==="not_found"?{type:Wn.ChatFetchResponseType.NotFound,reason:c,requestId:r,serverRequestId:n}:s==="bad_request"?{type:Wn.ChatFetchResponseType.BadRequest,reason:c,requestId:r,serverRequestId:n}:{type:Wn.ChatFetchResponseType.Failed,reason:`Request Failed: ${s} ${c||"WebSocket server error"}`,requestId:r,serverRequestId:n}}scrubErrorDetail(e,r){if(r){let n=new RegExp((0,Qbc.escapeRegExpCharacters)(r),"ig");e=e.replaceAll(n,"")}return e.replaceAll(/(?<=logged in as )(?!)[^\s]+/ig,"!!")}};EI.ChatMLFetcherImpl=_Or;EI.ChatMLFetcherImpl=_Or=AOr=bbc([Gv(0,Dbc.IFetcherService),Gv(1,EOr.ITelemetryService),Gv(2,Mbc.IRequestLogger),Gv(3,yOr.ILogService),Gv(4,Tbc.IAuthenticationService),Gv(5,Rbc.IInteractionService),Gv(6,xbc.IChatQuotaService),Gv(7,kbc.ICAPIClientService),Gv(8,wbc.IConversationOptions),Gv(9,pV.IConfigurationService),Gv(10,Obc.IExperimentationService),Gv(11,Hbc.IPowerService),Gv(12,qbc.IInstantiationService),Gv(13,K9i.IChatWebSocketManager),Gv(14,Nbc.IOTelService)],_Or);function Gbc(t,e,r,n,o){if(t.length===0)return{isValid:!1,reason:gOr("No messages provided")};if(e?.max_tokens&&e?.max_tokens<1)return{isValid:!1,reason:gOr("Invalid response token parameter")};let s=/^[a-zA-Z0-9_-]+$/;return e?.functions?.some(c=>!c.name.match(s))||e?.function_call?.name&&!e.function_call.name.match(s)?{isValid:!1,reason:gOr("Function names must match ^[a-zA-Z0-9_-]+$")}:e?.tools&&e.tools.length>pV.HARD_TOOL_LIMIT&&!r.supportsToolSearch?{isValid:!1,reason:`Tool limit exceeded (${e.tools.length}/${pV.HARD_TOOL_LIMIT}). Click "Configure Tools" in the chat input to disable ${e.tools.length-pV.HARD_TOOL_LIMIT} tools and retry.`}:{isValid:!0,reason:""}}a(Gbc,"isValidChatPayload");function gOr(t){return`Prompt failed validation with the reason: ${t}. Please file an issue.`}a(gOr,"asUnexpected");function J9i(t,e,r){return Kye.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Wn.ChatLocation.toString(e),headerRequestId:r})}a(J9i,"createTelemetryData");function JCt(t){switch(t){case Wn.ChatLocation.Panel:return"conversation-panel";case Wn.ChatLocation.Editor:return"conversation-inline";case Wn.ChatLocation.EditingSession:return"conversation-edits";case Wn.ChatLocation.Notebook:return"conversation-notebook";case Wn.ChatLocation.Terminal:return"conversation-terminal";case Wn.ChatLocation.Other:return"conversation-other";case Wn.ChatLocation.Agent:return"conversation-agent";case Wn.ChatLocation.ResponsesProxy:return"responses-proxy";case Wn.ChatLocation.MessagesProxy:return"messages-proxy"}}a(JCt,"locationToIntent");function $bc(t){let e={};for(let r of["tool_choice","reasoning","reasoning_effort","thinking","thinking_budget","output_config","response_format","text","truncation","context_management","frequency_penalty","presence_penalty","top_logprobs","logit_bias","store","stream","stream_options","prediction","seed","parallel_tool_calls","service_tier","metadata","verbosity","snippy","state","intent","intent_threshold","include"]){let n=t[r];n!==void 0&&(e[r]=n)}return Object.keys(e).length>0?e:void 0}a($bc,"pickCacheRelevantRequestOptions");function Vbc(t){let e={};return Array.isArray(t.input)?(e.api="responses",e.inputItemCount=t.input.length,e.inputItemTypes=t.input.map(r=>{if(r&&typeof r=="object"){let n=r.type;if(typeof n=="string")return n}return"unknown"})):Array.isArray(t.messages)&&(e.api="messages",e.messageCount=t.messages.length),typeof t.previous_response_id=="string"&&(e.hasPreviousResponseId=!0),Object.keys(e).length>0?e:void 0}a(Vbc,"pickRequestShapeMetadata")});var COr=I(Jye=>{"use strict";p();Object.defineProperty(Jye,"__esModule",{value:!0});Jye.NullSimilarFilesContextService=Jye.ISimilarFilesContextService=void 0;var Wbc=nn();Jye.ISimilarFilesContextService=(0,Wbc.createServiceIdentifier)("ISimilarFilesContextService");var vOr=class{static{a(this,"NullSimilarFilesContextService")}async compute(){}async getSnippetsForPrompt(){}};Jye.NullSimilarFilesContextService=vOr});var bOr=I(XCt=>{"use strict";p();Object.defineProperty(XCt,"__esModule",{value:!0});XCt.IDiffService=void 0;var zbc=nn();XCt.IDiffService=(0,zbc.createServiceIdentifier)("IDiffService")});var X9i=I(SOr=>{"use strict";p();Object.defineProperty(SOr,"__esModule",{value:!0});SOr.createProxyXtabEndpoint=Zbc;var Ybc=(Nne(),Qa(Dne)),Kbc=Yne(),Jbc=Xne();function Zbc(t,e){let r={id:e??"copilot-nes-xtab",urlOrRequestMetadata:{type:Ybc.RequestType.ProxyChatCompletions},name:"xtab-proxy",vendor:"xtab",model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"unknown",capabilities:{type:"chat",family:"xtab-proxy",tokenizer:Kbc.TokenizerType.O200K,limits:{max_prompt_tokens:12285,max_output_tokens:4096},supports:{streaming:!0,parallel_tool_calls:!1,tool_calls:!1,vision:!1,prediction:!0}}};return t.createInstance(Jbc.ChatEndpoint,r)}a(Zbc,"createProxyXtabEndpoint")});var tie=I(ebt=>{"use strict";p();Object.defineProperty(ebt,"__esModule",{value:!0});ebt.DocumentId=void 0;var Xbc=vZe(),eUi=LA(),e1c=ad(),TOr=class t{static{a(this,"DocumentId")}static{this._cache=new Xbc.CachedFunction({getCacheKey:JSON.stringify},e=>new t(e.uri))}static create(e){return t._cache.get({uri:e})}constructor(e){this.uri=e,this._uri=e1c.URI.parse(this.uri)}get path(){return this._uri.path}get fragment(){return this._uri.fragment}toString(){return this.uri}get baseName(){return(0,eUi.basename)(this.uri)}get extension(){return(0,eUi.extname)(this.uri)}toUri(){return this._uri}};ebt.DocumentId=TOr});var IOr=I(tbt=>{"use strict";p();Object.defineProperty(tbt,"__esModule",{value:!0});tbt.NextCursorLinePrediction=void 0;var tUi;(function(t){t.Jump="jump",t.OnlyWithEdit="onlyWithEdit"})(tUi||(tbt.NextCursorLinePrediction=tUi={}))});var rbt=I(hV=>{"use strict";p();Object.defineProperty(hV,"__esModule",{value:!0});hV.NullUndesiredModelsManager=hV.IUndesiredModelsManager=hV.IInlineEditsModelService=void 0;var rUi=nn(),t1c=Rc();hV.IInlineEditsModelService=(0,rUi.createServiceIdentifier)("IInlineEditsModelService");hV.IUndesiredModelsManager=(0,rUi.createServiceIdentifier)("IUndesiredModelsManager");var xOr=class{static{a(this,"NullUndesiredModelsManager")}constructor(){this.onDidChange=t1c.Event.None}isUndesiredModelId(e){return!1}addUndesiredModelId(e){return Promise.resolve()}removeUndesiredModelId(e){return Promise.resolve()}};hV.NullUndesiredModelsManager=xOr});var nUi=I(h9=>{"use strict";p();Object.defineProperty(h9,"__esModule",{value:!0});h9.IgnoreWhitespaceOnlyChanges=h9.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges=void 0;h9.editWouldDeleteWhatWasJustInserted=r1c;h9.editIsDeletion=kOr;h9.editWouldDeleteWhatWasJustInserted2=n1c;var wOr=class t{static{a(this,"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges")}static filterEdit(e,r){return r.filter(o=>!t._isWhitespaceOnlyChange(o,e.documentAfterEditsLines))}static _isWhitespaceOnlyChange(e,r){let n=e.lineRange.toOffsetRange().slice(r),o=e.newLines,s=o.length===0;if(s&&n.every(c=>c.trim()==="")||!s&&o.every(c=>c.trim()===""))return!0;if(n.length!==o.length)return!1;for(let c=0;c!t._isFormattingOnlyChange(e.documentAfterEditsLines,n))}static _isFormattingOnlyChange(e,r){let n=r.lineRange.toOffsetRange().slice(e).join("").replace(/\s/g,""),o=r.newLines.join("").replace(/\s/g,"");return n===o}};h9.IgnoreWhitespaceOnlyChanges=ROr;function r1c(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!kOr(r))return!1;for(let n=t.recentEdits.edits.length-1;n>=0;n--){let o=t.recentEdits.edits[n],s=r.tryRebase(o);if(!s)return!0;r=s}return!1}a(r1c,"editWouldDeleteWhatWasJustInserted");function kOr(t){let e=t.replacements.reduce((n,o)=>n+o.replaceRange.length,0);return t.replacements.reduce((n,o)=>n+o.newText.length,0)===0&&e>0}a(kOr,"editIsDeletion");function n1c(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!kOr(r))return!1;let n=t.documentAfterEdits.value;for(let o=t.recentEdits.edits.length-1;o>=0;o--){let c=t.recentEdits.edits[o].inverse(n);if(c.equals(r))return!0;n=c.apply(n)}return!1}a(n1c,"editWouldDeleteWhatWasJustInserted2")});var DOr=I(Zye=>{"use strict";p();Object.defineProperty(Zye,"__esModule",{value:!0});Zye.NulSimulationTestContext=Zye.ISimulationTestContext=void 0;var i1c=nn();Zye.ISimulationTestContext=(0,i1c.createServiceIdentifier)("ISimulationTestContext");var POr=class{static{a(this,"NulSimulationTestContext")}constructor(){this.isInSimulationTests=!1}async writeFile(e,r,n){return""}};Zye.NulSimulationTestContext=POr});var ibt=I(nbt=>{"use strict";p();Object.defineProperty(nbt,"__esModule",{value:!0});nbt.BaseAlternativeNotebookContentProvider=void 0;var NOr=class{static{a(this,"BaseAlternativeNotebookContentProvider")}constructor(e){this.kind=e}};nbt.BaseAlternativeNotebookContentProvider=NOr});var OOr=I(yN=>{"use strict";p();Object.defineProperty(yN,"__esModule",{value:!0});yN.DEFAULT_WORD_REGEXP=yN.USUAL_WORD_SEPARATORS=void 0;yN.ensureValidWordDefinition=iUi;yN.setDefaultGetWordAtTextConfig=l1c;yN.getWordAtText=oUi;var o1c=iHt(),s1c=Ro(),a1c=Due();yN.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function c1c(t=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(let r of yN.USUAL_WORD_SEPARATORS)t.indexOf(r)>=0||(e+="\\"+r);return e+="\\s]+)",new RegExp(e,"g")}a(c1c,"createWordRegExp");yN.DEFAULT_WORD_REGEXP=c1c();function iUi(t){let e=yN.DEFAULT_WORD_REGEXP;if(t&&t instanceof RegExp)if(t.global)e=t;else{let r="g";t.ignoreCase&&(r+="i"),t.multiline&&(r+="m"),t.unicode&&(r+="u"),e=new RegExp(t.source,r)}return e.lastIndex=0,e}a(iUi,"ensureValidWordDefinition");var MOr=new a1c.LinkedList;MOr.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function l1c(t){let e=MOr.unshift(t);return(0,s1c.toDisposable)(e)}a(l1c,"setDefaultGetWordAtTextConfig");function oUi(t,e,r,n,o){if(e=iUi(e),o||(o=o1c.Iterable.first(MOr)),r.length>o.maxLen){let d=t-o.maxLen/2;return d<0?d=0:n+=d,r=r.substring(d,t+o.maxLen/2),oUi(t,e,r,n,o)}let s=Date.now(),c=t-1-n,l=-1,u=null;for(let d=1;!(Date.now()-s>=o.timeBudget);d++){let f=c-o.windowSize*d;e.lastIndex=Math.max(0,f);let h=u1c(e,r,c,l);if(!h&&u||(u=h,f<=0))break;l=f}if(u){let d={word:u[0],startColumn:n+1+u.index,endColumn:n+1+u.index+u[0].length};return e.lastIndex=0,d}return null}a(oUi,"getWordAtText");function u1c(t,e,r,n){let o;for(;o=t.exec(e);){let s=o.index||0;if(s<=r&&t.lastIndex>=r)return o;if(n>0&&s>n)return null}return null}a(u1c,"_findRegexMatchEnclosingPosition")});var sUi=I(obt=>{"use strict";p();Object.defineProperty(obt,"__esModule",{value:!0});obt.toUint8=d1c;obt.toUint32=f1c;function d1c(t){return t<0?0:t>255?255:t|0}a(d1c,"toUint8");function f1c(t){return t<0?0:t>4294967295?4294967295:t|0}a(f1c,"toUint32")});var aUi=I(mV=>{"use strict";p();Object.defineProperty(mV,"__esModule",{value:!0});mV.PrefixSumIndexOfResult=mV.ConstantTimePrefixSumComputer=mV.PrefixSumComputer=void 0;var p1c=Sl(),Xye=sUi(),LOr=class{static{a(this,"PrefixSumComputer")}constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}getCount(){return this.values.length}insertValues(e,r){e=(0,Xye.toUint32)(e);let n=this.values,o=this.prefixSum,s=r.length;return s===0?!1:(this.values=new Uint32Array(n.length+s),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+s),this.values.set(r,e),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,r){return e=(0,Xye.toUint32)(e),r=(0,Xye.toUint32)(r),this.values[e]===r?!1:(this.values[e]=r,e-1=n.length)return!1;let s=n.length-e;return r>=s&&(r=s),r===0?!1:(this.values=new Uint32Array(n.length-r),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+r),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=(0,Xye.toUint32)(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let r=this.prefixSumValidIndex[0]+1;r===0&&(this.prefixSum[0]=this.values[0],r++),e>=this.values.length&&(e=this.values.length-1);for(let n=r;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let r=0,n=this.values.length-1,o=0,s=0,c=0;for(;r<=n;)if(o=r+(n-r)/2|0,s=this.prefixSum[o],c=s-this.values[o],e=s)r=o+1;else break;return new eEe(o,e-c)}};mV.PrefixSumComputer=LOr;var BOr=class{static{a(this,"ConstantTimePrefixSumComputer")}constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();let r=this._indexBySum[e];if(r===void 0){let o=Math.max(0,this._values.length-1),s=o>0?this._prefixSum[o-1]:0;return new eEe(o,e-s)}let n=r>0?this._prefixSum[r-1]:0;return new eEe(r,e-n)}removeValues(e,r){this._values.splice(e,r),this._invalidate(e)}insertValues(e,r){this._values=(0,p1c.arrayInsert)(this._values,e,r),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,r=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=o+n;for(let s=0;s0?this._prefixSum[this._values.length-1]:0,this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,r){this._values[e]!==r&&(this._values[e]=r,this._invalidate(e))}};mV.ConstantTimePrefixSumComputer=BOr;var eEe=class{static{a(this,"PrefixSumIndexOfResult")}constructor(e,r){this.index=e,this.remainder=r,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=r}};mV.PrefixSumIndexOfResult=eEe});var UOr=I(sbt=>{"use strict";p();Object.defineProperty(sbt,"__esModule",{value:!0});sbt.PositionOffsetTransformer=void 0;var cUi=om(),lUi=ME(),h1c=Ed(),m1c=aUi(),rie=N0(),FOr=class{static{a(this,"PositionOffsetTransformer")}constructor(e){this._lines=(0,cUi.splitLines)(e),this._eol=e.charAt(this._lines[0].length)==="\r"?`\r `:` -`;let r=new Uint32Array(this._lines.length);for(let n=0;n=0;n--){let o=r[n],s=this.toRange(o.replaceRange);this._acceptDeleteRange(s),this._acceptInsertText(s.start,o.newText)}}_acceptDeleteRange(e){if(e.start.line===e.end.line){if(e.start.character===e.end.character)return;this._setLineText(e.start.line,this._lines[e.start.line].substring(0,e.start.character)+this._lines[e.start.line].substring(e.end.character));return}this._setLineText(e.start.line,this._lines[e.start.line].substring(0,e.start.character)+this._lines[e.end.line].substring(e.end.character)),this._lines.splice(e.start.line+1,e.end.line-e.start.line),this._lineStarts.removeValues(e.start.line+1,e.end.line-e.start.line)}_acceptInsertText(e,r){if(r.length===0)return;let n=(0,g6i.splitLines)(r);if(n.length===1){this._setLineText(e.line,this._lines[e.line].substring(0,e.character)+n[0]+this._lines[e.line].substring(e.character));return}n[n.length-1]+=this._lines[e.line].substring(e.character),this._setLineText(e.line,this._lines[e.line].substring(0,e.character)+n[0]);let o=new Uint32Array(n.length-1);for(let s=1;snew Wne.TextEdit(this.validateRange(n.range),n.newText));return new A6i.StringEdit(r.map(n=>new A6i.StringReplacement(this.toOffsetRange(n.range),n.newText)))}toTextEdits(e){return e.replacements.map(r=>new Wne.TextEdit(this.toRange(r.replaceRange),r.newText))}validatePosition(e){if(!(e instanceof Wne.Position))throw new Error("Invalid argument");if(this._lines.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this._lines.length)r=this._lines.length-1,n=this._lines[r].length,o=!0;else{let s=this._lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new Wne.Position(r,n):e}validateRange(e){return new Wne.Range(this.validatePosition(e.start),this.validatePosition(e.end))}};MCt.PositionOffsetTransformer=HMr});var VMr=I(zne=>{"use strict";p();Object.defineProperty(zne,"__esModule",{value:!0});zne.SnapshotDocumentLine=zne.TextDocumentSnapshot=void 0;zne.isTextDocumentSnapshotJSON=Vvc;var OCt=KS(),E6i=nd(),y6i=QMr(),Uye=P0(),$vc=GMr();function Vvc(t){return!t||typeof t!="object"?!1:(0,E6i.isUriComponents)(t.uri)&&(0,OCt.isString)(t._text)&&(0,OCt.isString)(t.languageId)&&(0,OCt.isNumber)(t.version)&&(0,OCt.isNumber)(t.eol)}a(Vvc,"isTextDocumentSnapshotJSON");var $Mr=class t{static{a(this,"TextDocumentSnapshot")}static create(e){return new t(e,e.uri,e.getText(),e.languageId,e.eol,e.version)}static fromNewText(e,r){return new t(r instanceof t?r.document:r,r.uri,e,r.languageId,r.eol,r.version+1)}static fromJSON(e,r){return new t(e,E6i.URI.from(r.uri),r._text,r.languageId,r.eol,r.version)}get transformer(){return this._transformer||(this._transformer=new $vc.PositionOffsetTransformer(this._text)),this._transformer}get fileName(){return this.uri.fsPath}get isUntitled(){return this.uri.scheme==="untitled"}get lineCount(){return this.lines.length}get lines(){return this._lines||(this._lines=this._text.split(/\r\n|\r|\n/g)),this._lines}constructor(e,r,n,o,s,c){this._transformer=null,this._lines=null,this.document=e,this.uri=r,this._text=n,this.languageId=o,this.eol=s,this.version=c}lineAt(e){let r;if(e instanceof Uye.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return new LCt(r,this.lines[r],r===this.lines.length-1)}offsetAt(e){return this.version===this.document.version?this.document.offsetAt(e):(e=this.validatePosition(e),this.transformer.getOffset(e))}positionAt(e){return this.version===this.document.version?this.document.positionAt(e):(e=Math.floor(e),e=Math.max(0,e),this.transformer.getPosition(e))}getText(e){return e?this._getTextInRange(e):this._text}_getTextInRange(e){if(this.version===this.document.version)return this.document.getText(e);let r=this.validateRange(e);if(r.isEmpty)return"";let n=this.transformer.toOffsetRange(r);return this._text.substring(n.start,n.endExclusive)}getWordRangeAtPosition(e){let r=this.validatePosition(e),n=(0,y6i.getWordAtText)(r.character+1,y6i.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new Uye.Range(r.line,n.startColumn-1,r.line,n.endColumn-1)}validateRange(e){let r=this.validatePosition(e.start),n=this.validatePosition(e.end);return r===e.start&&n===e.end?e:new Uye.Range(r.line,r.character,n.line,n.character)}validatePosition(e){if(this._text.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this.lines.length)r=this.lines.length-1,n=this.lines[r].length,o=!0;else{let s=this.lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new Uye.Position(r,n):e}toJSON(){return{uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,eol:this.eol,_text:this._text}}};zne.TextDocumentSnapshot=$Mr;var LCt=class{static{a(this,"SnapshotDocumentLine")}constructor(e,r,n){this._line=e,this._text=r,this._isLastLine=n}get lineNumber(){return this._line}get text(){return this._text}get range(){return new Uye.Range(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new Uye.Range(this._line,0,this._line+1,0)}get firstNonWhitespaceCharacterIndex(){return/^(\s*)/.exec(this._text)[1].length}get isEmptyOrWhitespace(){return this.firstNonWhitespaceCharacterIndex===this._text.length}};zne.SnapshotDocumentLine=LCt});var UCt=I(FCt=>{"use strict";p();Object.defineProperty(FCt,"__esModule",{value:!0});FCt.AlternativeNotebookDocument=void 0;var _6i=QMr(),BCt=P0(),Wvc=GMr(),zvc=VMr(),WMr=class{static{a(this,"AlternativeNotebookDocument")}get transformer(){return this._transformer||(this._transformer=new Wvc.PositionOffsetTransformer(this._text)),this._transformer}getText(e){return e?this._getTextInRange(e):this._text}_getTextInRange(e){let r=this.validateRange(e);if(r.isEmpty)return"";let n=this.transformer.toOffsetRange(r);return this._text.substring(n.start,n.endExclusive)}constructor(e,r){this._text=e,this.notebook=r,this._transformer=null,this._lines=null}positionToOffset(e){return e=this.validatePosition(e),this.transformer.getOffset(e)}getWordRangeAtPosition(e){let r=this.validatePosition(e),n=(0,_6i.getWordAtText)(r.character+1,_6i.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new BCt.Range(r.line,n.startColumn-1,r.line,n.endColumn-1)}get lines(){return this._lines||(this._lines=this._text.split(/\r\n|\r|\n/g)),this._lines}get lineCount(){return this.lines.length}lineAt(e){let r;if(e instanceof BCt.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return new zvc.SnapshotDocumentLine(r,this.lines[r],r===this.lines.length-1)}offsetAt(e){return this.transformer.getOffset(e)}positionAt(e){return e=Math.floor(e),e=Math.max(0,e),this.transformer.getPosition(e)}validateRange(e){let r=this.validatePosition(e.start),n=this.validatePosition(e.end);return r===e.start&&n===e.end?e:new BCt.Range(r.line,r.character,n.line,n.character)}validatePosition(e){if(this._text.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this.lines.length)r=this.lines.length-1,n=this.lines[r].length,o=!0;else{let s=this.lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new BCt.Position(r,n):e}};FCt.AlternativeNotebookDocument=WMr});var QCt=I(Qye=>{"use strict";p();Object.defineProperty(Qye,"__esModule",{value:!0});Qye.isUri=Kvc;Qye.isLocation=zMr;Qye.toLocation=Jvc;Qye.isSymbolInformation=Zvc;var xBe=P0(),Yvc=nd();function Kvc(t){return Yvc.URI.isUri(t)}a(Kvc,"isUri");function zMr(t){return t&&typeof t=="object"&&"uri"in t&&"range"in t}a(zMr,"isLocation");function Jvc(t){if(zMr(t)&&Array.isArray(t.range)&&t.range.length===2){let e=t.range[0],r=t.range[1];return new xBe.Location(t.uri,new xBe.Range(new xBe.Position(e.line,e.character),new xBe.Position(r.line,r.character)))}else if(zMr(t)&&t.range instanceof xBe.Range)return t}a(Jvc,"toLocation");function Zvc(t){return t&&typeof t=="object"&&"name"in t&&"containerName"in t}a(Zvc,"isSymbolInformation")});var kBe=I(Sy=>{"use strict";p();Object.defineProperty(Sy,"__esModule",{value:!0});Sy.CellIdPatternRe=Sy.EOL=Sy.LineOfText=void 0;Sy.summarize=eCc;Sy.notebookCellToCellData=tCc;Sy.getCellIdMap=rCc;Sy.normalizeCellId=nCc;Sy.getNotebookId=iCc;Sy.getCellId=JMr;Sy.getDefaultLanguage=sCc;Sy.requestHasNotebookRefs=cCc;Sy.parseAndCleanStack=lCc;var v6i=QCt(),T6i=rNr(),Xvc=em(),C6i=nd(),KMr=P0(),YMr=class{static{a(this,"LineOfText")}constructor(e){this.__lineOfTextBrand=void 0,this.value=e.replace(/\r$/,"")}};Sy.LineOfText=YMr;Sy.EOL=` -`;function eCc(t){let e=t.kind===KMr.NotebookCellKind.Code?"code":"markdown",r=JMr(t),n=oCc(t.document);return{cell_type:e,id:r,language:t.document.languageId,source:n,index:t.index}}a(eCc,"summarize");function tCc(t){let e=new KMr.NotebookCellData(t.kind,t.document.getText(),t.document.languageId);return e.metadata=t.metadata,e.executionSummary=t.executionSummary,t.outputs.length&&(e.outputs=[...t.outputs]),e}a(tCc,"notebookCellToCellData");function rCc(t){let e=new Map;return t.getCells().forEach(r=>{e.set(JMr(r),r)}),e}a(rCc,"getCellIdMap");var b6i=new WeakMap,RBe=8,wBe="#VSC-";Sy.CellIdPatternRe=new RegExp(`(\\s+|^|\\b|\\W)(#VSC-[a-f0-9]{${RBe}})\\b`,"gi");function nCc(t){return t.startsWith(wBe)?t:t.startsWith("VSC-")?`#${t}`:t.startsWith("#V-")&&t.length===RBe+3?`${wBe}${t.substring(3)}`:t.toLowerCase().startsWith("vscode-")&&t.length===RBe+7?`${wBe}${t.substring(7)}`:t.startsWith("-")?`#VSC${t}`:t.length===RBe?`${wBe}${t}`:t}a(nCc,"normalizeCellId");var S6i=new WeakMap;function iCc(t){let e=S6i.get(t);if(e)return e;let r=new T6i.StringSHA1;return r.update(t.uri.toString()),e=r.digest(),S6i.set(t,e),e}a(iCc,"getNotebookId");function JMr(t){let e=b6i.get(t);if(e)return e;let r=new T6i.StringSHA1;return r.update(t.document.uri.toString()),e=`${wBe}${r.digest().substring(0,RBe)}`,b6i.set(t,e),e}a(JMr,"getCellId");function oCc(t){return t.lineCount===0?[]:new Array(t.lineCount).fill("").map((e,r)=>t.lineAt(r).text)}a(oCc,"getCellCode");function sCc(t){let e=t.getCells().find(r=>r.kind===KMr.NotebookCellKind.Code);if(e)return e.document.languageId;if(t.notebookType==="jupyter-notebook")return t.metadata?.language_info?.name||t.metadata?.kernelspec?.language||"python"}a(sCc,"getDefaultLanguage");var aCc=["jupyter","notebook","cell.","cells."," cell ","cells","notebook cell"];function cCc(t,e,r){let n=(t.prompt||"").toLowerCase();return r?.checkPromptAsWell&&aCc.some(o=>n.includes(o))?!0:t.references.some(o=>(0,v6i.isLocation)(o.value)?e.hasSupportedNotebooks(o.value.uri):(0,C6i.isUriComponents)(o.value)?e.hasSupportedNotebooks(C6i.URI.revive(o.value)):(0,v6i.isUri)(o.value)?e.hasSupportedNotebooks(o.value):!1)}a(cCc,"requestHasNotebookRefs");function lCc(t){try{let e=JSON.parse(t);return(0,Xvc.removeAnsiEscapeCodes)(e?.stack||e.message||"")||e.message||e.name||t}catch{return t}}a(lCc,"parseAndCleanStack")});var w6i=I(PBe=>{"use strict";p();Object.defineProperty(PBe,"__esModule",{value:!0});PBe.AlternativeJsonNotebookContentProvider=void 0;PBe.isJsonContent=hCc;var uCc=(zdr(),ba(RJn)),dCc=nl(),I6i=nd(),dN=P0(),fCc=DCt(),pCc=UCt(),qye=kBe(),x6i=4;function hCc(t){return!!(t.startsWith("{")||t.trim().startsWith("{")||(t.includes("{")||t.includes("}"))&&t.includes('"source":')&&t.includes('"cell_type":'))}a(hCc,"isJsonContent");var qCt=class extends pCc.AlternativeNotebookDocument{static{a(this,"AlternativeJsonDocument")}fromCellPosition(e,r){let n=(0,qye.getCellId)(e),o=this.getText(),s=" ",c=`"id": "${n}",`,l=o.indexOf('"source": [',o.indexOf(c)),u=this.positionAt(l).line+1,d=e.document.getText(new dN.Range(r.line,0,r.line,r.character)),f=`${s}${JSON.stringify(d).slice(0,-1)}`,h=r.line+u;return new dN.Position(h,f.length)}toCellPosition(e){throw new Error("Method not implemented.")}},ZMr=class extends fCc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeJsonNotebookContentProvider")}constructor(){super("json")}stripCellMarkers(e){return e}parseAlternateContent(e,r,n){return this.parseAlternateContentImpl(e,r,n)}getAlternativeDocumentFromText(e,r){return new qCt(e,r)}getAlternativeDocument(e,r){let o={cells:e.getCells().filter(c=>r?c.kind!==dN.NotebookCellKind.Markup:!0).map(c=>{let l=(0,qye.summarize)(c),u=mCc(c.document);return{cell_type:l.cell_type,id:l.id,metadata:{language:l.language},source:u}})},s=JSON.stringify(o,void 0,x6i);return new qCt(s,e)}getSummaryOfStructure(e,r,n){let o=["{",' "cells: ['],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,qye.summarize)(c);l.source.length&&l.source[0].trim().length?l.source=[l.source[0],s]:l.source.length&&l.source.some(d=>d.trim().length)?l.source=[s,l.source.filter(d=>d.trim().length)[0],s]:l.source=[s];let u=JSON.stringify(l,void 0,x6i).split(/\r?\n/).map(d=>` ${d}`);o.push(...u),o.push(",")}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.push(" ]"),o.push("}"),o.join(qye.EOL)}parseAlternateContentImpl(e,r,n){return new dCc.AsyncIterableObject(async o=>{let s=I6i.URI.isUri(e)?new Map:(0,qye.getCellIdMap)(e),c=new Set,l="",u=-1,d={index:-1,startOffset:-1,endOffset:-1,kind:dN.NotebookCellKind.Code,source:[]},f=I6i.URI.isUri(e)?"python":(0,qye.getDefaultLanguage)(e),h=a(g=>{d.language=d.language||f,d.id&&s.get(d.id)?.document.languageId===d.language?c.has(d.id)?d.id="":c.add(d.id):d.id="";let A=s.get(d.id);d.uri=A?.document.uri,d.kind=A?.kind||(d.language==="markdown"?dN.NotebookCellKind.Markup:dN.NotebookCellKind.Code),o.emitOne({index:d.index,type:"start",kind:d.kind,language:d.language,uri:d.uri,id:d.id}),d.source.forEach(y=>o.emitOne({index:d.index,type:"line",line:y})),o.emitOne({index:d.index,type:"end"})},"emitCell"),m=0;for await(let g of r){if(n.isCancellationRequested)break;let A=g.value;l+=A,(0,uCc.visit)(l,{onObjectEnd(y,E,_,v){m=y},onLiteralValue:a((y,E,_,v,b,T)=>{if(u>=E)return;let w=T();if(w.length<2||w.shift()!=="cells")return;let R=w.shift();if(typeof R!="number")return;let x=w.shift();if(u=E,d.index!==-1&&d.index!==R&&(h(E),d.startOffset=E,d.id=void 0,d.kind=dN.NotebookCellKind.Code,d.source=[],d.uri=void 0,d.language=void 0),d.index=R,x==="cell_type")d.kind=y==="code"?dN.NotebookCellKind.Code:dN.NotebookCellKind.Markup,d.kind===dN.NotebookCellKind.Markup&&(d.language="markdown");else if(x==="id")d.id=y;else if(x==="metadata"&&w[0]==="id")d.id=y;else if(x==="metadata"&&w[0]==="language")d.language=y,d.language==="markdown"&&(d.kind=dN.NotebookCellKind.Markup);else if(x==="source"&&w.length&&typeof w[0]=="number"){w[0]===0&&(d.startOffset=E);let P=typeof y=="string"?y:`${y||""}`;P.endsWith(` -`)&&(P=P.substr(0,P.length-1)),d.source.push(P)}},"onLiteralValue")})}d.index!==-1&&h(m)})}};PBe.AlternativeJsonNotebookContentProvider=ZMr;function mCc(t){if(t.lineCount===0)return[];if(t.lineCount===1)return[t.lineAt(0).text];let e=t.lineCount;return new Array(e).fill("").map((r,n)=>t.lineAt(n).text)}a(mCc,"getCellCode")});var eOr=I(iV=>{"use strict";p();Object.defineProperty(iV,"__esModule",{value:!0});iV.wellKnownLanguages=void 0;iV.getLanguage=R6i;iV.getLanguageForResource=yCc;var gCc=ZP(),ACc=Object.freeze({abap:{lineComment:{start:"'"},markdownLanguageIds:["abap","sap-abap"]},bat:{lineComment:{start:"REM"},alternativeLineComments:[{start:"::"}],aliases:["Batch","bat"],extensions:[".bat",".cmd"]},bibtex:{lineComment:{start:"%"},aliases:["BibTeX","bibtex"],extensions:[".bib"]},blade:{lineComment:{start:"#"}},c:{lineComment:{start:"//"},aliases:["C","c"],extensions:[".c",".i"],markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";"},aliases:["Clojure","clojure"],extensions:[".clj",".cljs",".cljc",".cljx",".clojure",".edn"],markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//"},aliases:["CoffeeScript","coffeescript","coffee"],extensions:[".coffee",".cson",".iced"],markdownLanguageIds:["coffeescript","coffee","cson","iced"],blockComment:["###","###"]},cpp:{lineComment:{start:"//"},aliases:["C++","Cpp","cpp"],extensions:[".cpp",".cc",".cxx",".c++",".hpp",".hh",".hxx",".h++",".h",".ii",".ino",".inl",".ipp",".ixx",".tpp",".txx",".hpp.in",".h.in"],markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"],blockComment:["/*","*/"]},csharp:{lineComment:{start:"//"},aliases:["C#","csharp"],extensions:[".cs",".csx",".cake"],markdownLanguageIds:["csharp","cs"],blockComment:["/*","*/"]},css:{lineComment:{start:"/*",end:"*/"},aliases:["CSS","css"],extensions:[".css"],blockComment:["/*","*/"]},dart:{lineComment:{start:"//"},aliases:["Dart"],extensions:[".dart"],blockComment:["/*","*/"]},dockerfile:{lineComment:{start:"#"},aliases:["Docker","Dockerfile","Containerfile"],extensions:[".dockerfile",".containerfile"],markdownLanguageIds:["dockerfile","docker"]},elixir:{lineComment:{start:"#"}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%"},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//"},aliases:["F#","FSharp","fsharp"],extensions:[".fs",".fsi",".fsx",".fsscript"],markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"],blockComment:["(*","*)"]},go:{lineComment:{start:"//"},aliases:["Go"],extensions:[".go"],markdownLanguageIds:["go","golang"],blockComment:["/*","*/"]},groovy:{lineComment:{start:"//"},aliases:["Groovy","groovy"],extensions:[".groovy",".gvy",".gradle",".jenkinsfile",".nf"],blockComment:["/*","*/"]},haml:{lineComment:{start:"-#"}},handlebars:{lineComment:{start:"{{!",end:"}}"},extensions:[".hbs",".handlebars"],markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"],blockComment:["{{!--","--}}"]},haskell:{lineComment:{start:"--"},markdownLanguageIds:["haskell","hs"]},html:{lineComment:{start:""},aliases:["HTML","htm","html","xhtml"],extensions:[".html",".htm",".shtml",".xhtml",".xht",".mdoc",".jsp",".asp",".aspx",".jshtm",".volt",".ejs",".rhtml"],markdownLanguageIds:["html","xhtml"],blockComment:[""]},ini:{lineComment:{start:";"},blockComment:[";"," "]},java:{lineComment:{start:"//"},extensions:[".java",".class"],markdownLanguageIds:["java","jsp"],blockComment:["/*","*/"]},javascript:{lineComment:{start:"//"},aliases:["JavaScript","javascript","js"],extensions:[".js",".es6",".mjs",".cjs",".pac"],markdownLanguageIds:["javascript","js"],blockComment:["/*","*/"]},javascriptreact:{lineComment:{start:"//"},aliases:["JavaScript JSX","JavaScript React","jsx"],extensions:[".jsx"],markdownLanguageIds:["jsx"]},json:{extensions:[".json"],lineComment:{start:"//"},blockComment:["/*","*/"]},jsonc:{lineComment:{start:"//"}},jsx:{lineComment:{start:"//"},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#"},aliases:["Julia","julia"],extensions:[".jl"],markdownLanguageIds:["julia","jl"],blockComment:["#=","=#"]},kotlin:{lineComment:{start:"//"},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%"},aliases:["LaTeX","latex"],extensions:[".tex",".ltx",".ctx"],markdownLanguageIds:["tex"]},less:{lineComment:{start:"//"},aliases:["Less","less"],extensions:[".less"],blockComment:["/*","*/"]},lua:{lineComment:{start:"--"},aliases:["Lua","lua"],extensions:[".lua"],markdownLanguageIds:["lua","pluto"],blockComment:["--[[","]]"]},makefile:{lineComment:{start:"#"},aliases:["Makefile","makefile"],extensions:[".mak",".mk"],markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:""},alternativeLineComments:[{start:"[]: #"}],aliases:["Markdown","markdown"],extensions:[".md",".mkd",".mdwn",".mdown",".markdown",".markdn",".mdtxt",".mdtext",".workbook"],markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//"},aliases:["Objective-C"],extensions:[".m"],markdownLanguageIds:["objectivec","mm","objc","obj-c"],blockComment:["/*","*/"]},"objective-cpp":{lineComment:{start:"//"},aliases:["Objective-C++"],extensions:[".mm"],markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#"},aliases:["Perl","perl"],extensions:[".pl",".pm",".pod",".t",".PL",".psgi"],markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//"},aliases:["PHP","php"],extensions:[".php",".php4",".php5",".phtml",".ctp"],blockComment:["/*","*/"]},powershell:{lineComment:{start:"#"},aliases:["PowerShell","powershell","ps","ps1"],extensions:[".ps1",".psm1",".psd1",".pssc",".psrc"],markdownLanguageIds:["powershell","ps","ps1"],blockComment:["<#","#>"]},pug:{lineComment:{start:"//"}},python:{lineComment:{start:"#"},aliases:["Python","py"],extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi",".pyi",".ipy",".pyt"],markdownLanguageIds:["python","py","gyp"],blockComment:['"""','"""']},ql:{lineComment:{start:"//"}},r:{lineComment:{start:"#"},aliases:["R","r"],extensions:[".r",".rhistory",".rprofile",".rt"]},razor:{lineComment:{start:""},aliases:["Razor","razor"],extensions:[".cshtml",".razor"],markdownLanguageIds:["cshtml","razor","razor-cshtml"],blockComment:[""]},ruby:{lineComment:{start:"#"},aliases:["Ruby","rb"],extensions:[".rb",".rbx",".rjs",".gemspec",".rake",".ru",".erb",".podspec",".rbi"],markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"],blockComment:["=begin","=end"]},rust:{lineComment:{start:"//"},aliases:["Rust","rust"],extensions:[".rs"],markdownLanguageIds:["rust","rs"],blockComment:["/*","*/"]},sass:{lineComment:{start:"//"}},scala:{lineComment:{start:"//"}},scss:{lineComment:{start:"//"},aliases:["SCSS","scss"],extensions:[".scss"],blockComment:["/*","*/"]},shellscript:{lineComment:{start:"#"},aliases:["Shell Script","shellscript","bash","fish","sh","zsh","ksh","csh"],extensions:[".sh",".bash",".bashrc",".bash_aliases",".bash_profile",".bash_login",".ebuild",".profile",".bash_logout",".xprofile",".xsession",".xsessionrc",".Xsession",".zsh",".zshrc",".zprofile",".zlogin",".zlogout",".zshenv",".zsh-theme",".fish",".ksh",".csh",".cshrc",".tcshrc",".yashrc",".yash_profile"],markdownLanguageIds:["bash","sh","zsh"]},slim:{lineComment:{start:"/"}},solidity:{lineComment:{start:"//"},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--"},aliases:["SQL"],extensions:[".sql",".dsql"],blockComment:["/*","*/"]},stylus:{lineComment:{start:"//"}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//"},aliases:["Swift","swift"],extensions:[".swift"],blockComment:["/*","*/"]},terraform:{lineComment:{start:"#"}},tex:{lineComment:{start:"%"},aliases:["TeX","tex"],extensions:[".sty",".cls",".bbx",".cbx"]},typescript:{lineComment:{start:"//"},aliases:["TypeScript","ts","typescript"],extensions:[".ts",".cts",".mts"],markdownLanguageIds:["typescript","ts"],blockComment:["/*","*/"]},typescriptreact:{lineComment:{start:"//"},aliases:["TypeScript JSX","TypeScript React","tsx"],extensions:[".tsx"],markdownLanguageIds:["tsx"],blockComment:["/*","*/"]},vb:{lineComment:{start:"'"},aliases:["Visual Basic","vb"],extensions:[".vb",".brs",".vbs",".bas",".vba"],markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//"}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//"},extensions:[".vue"]},xml:{lineComment:{start:""},aliases:["XML","xml"],extensions:[".xml",".xsd",".ascx",".atom",".axml",".axaml",".bpmn",".cpt",".csl",".csproj",".csproj.user",".dita",".ditamap",".dtd",".ent",".mod",".dtml",".fsproj",".fxml",".iml",".isml",".jmx",".launch",".menu",".mxml",".nuspec",".opml",".owl",".proj",".props",".pt",".publishsettings",".pubxml",".pubxml.user",".rbxlx",".rbxmx",".rdf",".rng",".rss",".shproj",".storyboard",".svg",".targets",".tld",".tmx",".vbproj",".vbproj.user",".vcxproj",".vcxproj.filters",".wsdl",".wxi",".wxl",".wxs",".xaml",".xbl",".xib",".xlf",".xliff",".xpdl",".xul",".xoml"],blockComment:[""]},xsl:{lineComment:{start:""},aliases:["XSL","xsl"],extensions:[".xsl",".xslt"]},yaml:{lineComment:{start:"#"},markdownLanguageIds:["yaml","yml"]}});iV.wellKnownLanguages=new Map(Object.entries(ACc).map(([t,e])=>[t,{languageId:t,...e}]));function R6i(t){return XMr(typeof t=="string"?t:typeof t>"u"?"plaintext":t.languageId)}a(R6i,"getLanguage");function XMr(t){return iV.wellKnownLanguages.get(t.toLowerCase())??{languageId:t,lineComment:{start:"//"}}}a(XMr,"_getLanguage");function yCc(t){let e=(0,gCc.extname)(t).toLowerCase();for(let r of iV.wellKnownLanguages.values())if(r.extensions?.includes(e))return r;return R6i("plaintext")}a(yCc,"getLanguageForResource")});var D6i=I(oV=>{"use strict";p();Object.defineProperty(oV,"__esModule",{value:!0});oV.AlternativeTextNotebookContentProvider=void 0;oV.generateCellTextMarker=nOr;oV.lineMightHaveCellMarker=iOr;oV.getBlockComment=Hye;oV.getLineCommentStart=Gye;var rOr=eOr(),ECc=QCt(),_Cc=xq(),jye=P0(),vCc=DCt(),CCc=UCt(),Bm=kBe();function nOr(t,e){let r=t.id?`[id=${t.id}] `:"";return`${e}%% vscode.cell ${r}[language=${t.language}]`}a(nOr,"generateCellTextMarker");function iOr(t){return t.toLowerCase().includes("vscode.cell")}a(iOr,"lineMightHaveCellMarker");var jCt=class extends CCc.AlternativeNotebookDocument{static{a(this,"AlternativeTextDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,Bm.summarize)(e),o=Gye(this.notebook),s=nOr(n,o),c=e.document.eol===jye.EndOfLine.LF?1:2,l=Hye(this.notebook),u=this.getText(),d=e.document.offsetAt(r),f=e.kind===jye.NotebookCellKind.Markup?l[0].length+c:0,h=u.indexOf(s)+s.length+c+f+d;return this.positionAt(h)}toCellPosition(e){let r=this.offsetAt(e),n=(0,_Cc.findLast)(this.cellOffsetMap,s=>s.sourceOffset<=r);if(!n)return;let o=n.cell.document.positionAt(r-n.sourceOffset);return{cell:n.cell,position:o}}},tOr=class extends vCc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeTextNotebookContentProvider")}constructor(){super("text")}stripCellMarkers(e){let r=e.split(Bm.EOL);return r.length&&iOr(r[0])?(r.shift(),r.join(Bm.EOL)):e}getSummaryOfStructure(e,r,n){let o=Hye(e),s=Gye(e),c=`${s} ${n}`,l=[];return e.getCells().forEach(u=>{if(r.includes(u)){let d=(0,Bm.summarize)(u);d.source.length&&d.source[0].trim().length?d.source=[d.source[0],c]:d.source.length&&d.source.some(f=>f.trim().length)?d.source=[c,d.source.filter(f=>f.trim().length)[0],c]:d.source=[c],l.push(k6i(d,s,o).content)}else(!l.length||l[l.length-1]!==c)&&l.push(c)}),l.join(Bm.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,ECc.isUri)(e),s=o?(0,Bm.getCellIdMap)(e):new Map,c=!1,l=!1,u=!1,d=!1,f=-1,h=Gye(o?e:void 0),m=Hye(o?e:void 0),g=o?(0,rOr.getLanguage)((0,Bm.getDefaultLanguage)(e)).languageId:void 0,A=new Set;for await(let y of r){if(n.isCancellationRequested)break;let E=y.value,_=E.startsWith(`${h}%% [`)&&E.trimEnd().endsWith("]"),v=E.startsWith(`${h}%% vscode.cell`),b=v||_?P6i(E,g):void 0;if((v||_)&&b?.language){u&&(u=!1);let T={index:-1,uri:void 0,language:void 0,kind:jye.NotebookCellKind.Code,emitted:!1,type:"start"};T.index=f+=1,T.emitted=!1,b.id&&s.get(b.id)?.document.languageId===b.language?A.has(b.id)?b.id="":A.add(b.id):b.id="";let w=s.get(b.id);T.id=b.id,T.language=b.language,T.uri=w?.document.uri,T.kind=w?.kind||(T.language==="markdown"?jye.NotebookCellKind.Markup:jye.NotebookCellKind.Code),c=T.language==="markdown",l=!1,d&&(yield{index:f-1,type:"end"}),d=!0,yield T;continue}d&&(c?l?E===m[1]?(l=!1,u=!0):yield{index:f,line:E,type:"line"}:E===m[0]?l=!0:yield{index:f,line:E,type:"line"}:yield{index:f,line:E,type:"line"})}d&&(yield{index:f,type:"end"})}getAlternativeDocumentFromText(e,r){let n=Hye(r),o=Gye(r),s=(0,Bm.getCellIdMap)(r),c=[],l=e.split(Bm.EOL),u=0;for(let d=0;dy.document.languageId===g.language&&!c.some(E=>E.cell===y));if(A){let y=u,E=Bm.EOL.length,_=g.language==="markdown",v=y+f.length+E+(_?n[0].length+E:0);c.push({offset:y,sourceOffset:v,cell:A})}}}u+=f.length+Bm.EOL.length}return new jCt(e,c,r)}getAlternativeDocument(e,r){let n=e.getCells().filter(d=>r?d.kind!==jye.NotebookCellKind.Markup:!0).map(d=>(0,Bm.summarize)(d)),o=Hye(e),s=Gye(e),c=n.map(d=>({...k6i(d,s,o),cell:e.cellAt(d.index)})),l=c.map(d=>d.content).join(Bm.EOL),u=c.map(d=>{let f=l.indexOf(d.content),h=f+d.prefix.length;return{offset:f,sourceOffset:h,cell:e.cellAt(d.cell.index)}});return new jCt(l,u,e)}};oV.AlternativeTextNotebookContentProvider=tOr;function k6i(t,e,r){let n=nOr(t,e),o=t.source.join(Bm.EOL),s=t.language==="markdown"?`${n}${Bm.EOL}${r[0]}${Bm.EOL}`:`${n}${Bm.EOL}`;return{content:t.language==="markdown"?`${s}${o}${Bm.EOL}${r[1]}`:`${s}${o}`,prefix:s}}a(k6i,"generateAlternativeCellTextContent");function Hye(t){return t?(0,rOr.getLanguage)((0,Bm.getDefaultLanguage)(t)).blockComment??["```","```"]:['"""','"""']}a(Hye,"getBlockComment");function Gye(t){return t&&(0,rOr.getLanguage)((0,Bm.getDefaultLanguage)(t)).lineComment.start||"#"}a(Gye,"getLineCommentStart");function P6i(t,e){let r=t.match(/\[id=(.+?)\]/),n=t.match(/\[language=(.+?)\]/);return n?{id:r?r[1].trim():"",language:n[1].trim()}:iOr(t)&&typeof e=="string"?{id:r?r[1].trim():"",language:e}:void 0}a(P6i,"extractCellParts")});var O6i=I(MBe=>{"use strict";p();Object.defineProperty(MBe,"__esModule",{value:!0});MBe.AlternativeXmlNotebookContentProvider=void 0;MBe.isXmlContent=M6i;var bCc=eOr(),SCc=QCt(),TCc=xq(),DBe=P0(),ICc=DCt(),xCc=UCt(),ZE=kBe(),NBe="`}a(oOr,"generateCellMarker");function M6i(t){return t.includes(NBe)||t.includes(sV)||t.includes(HCt)}a(M6i,"isXmlContent");var GCt=class extends xCc.AlternativeNotebookDocument{static{a(this,"AlternativeXmlDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,ZE.summarize)(e),o=oOr(n),s=e.document.eol===DBe.EndOfLine.LF?1:2,c=this.getText(),l=e.document.offsetAt(r),u=c.indexOf(o)+o.length+s+l;return this.positionAt(u)}toCellPosition(e){let r=this.offsetAt(e),n=(0,TCc.findLast)(this.cellOffsetMap,s=>s.offset<=r);if(!n)return;let o=n.cell.document.positionAt(r-n.offset);return{cell:n.cell,position:o}}},sOr=class extends ICc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeXmlNotebookContentProvider")}constructor(){super("xml")}stripCellMarkers(e){let r=e.split(ZE.EOL);return r.length&&(r[0].startsWith(NBe)||r[0].startsWith(HCt))&&r.shift(),r.length&&r[r.length-1].trim().endsWith(sV)&&(r[r.length-1]=r[r.length-1].substring(0,r[r.length-1].lastIndexOf(sV))),r.join(ZE.EOL)}getSummaryOfStructure(e,r,n){let o=[],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,ZE.summarize)(c);o.push(oOr(l)),l.source.length&&l.source[0].trim().length?(o.push(l.source[0]),o.push(s)):l.source.length&&l.source.some(u=>u.trim().length)?l.source=[s,l.source.filter(u=>u.trim().length)[0],s]:o.push(s),o.push(sV)}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.join(ZE.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,SCc.isUri)(e),s=o?(0,ZE.getCellIdMap)(e):new Map,c=-1,l=!1,u=new Set,d=!1,f,h=o?(0,bCc.getLanguage)((0,ZE.getDefaultLanguage)(e)).languageId:void 0;for await(let m of r){if(n.isCancellationRequested)break;let g=m.value;if((g.startsWith(NBe)||g.startsWith(HCt))&&(c<0||l||d&&f)){!l&&d&&f&&(f.line=f.line.substring(0,f.line.lastIndexOf(sV)),yield f,yield{type:"end",index:f.index}),d=!1,f=void 0,c+=1,l=!1;let A={type:"start",index:c,uri:void 0,language:void 0,kind:DBe.NotebookCellKind.Code},y=N6i(g,h);y.id&&s.get(y.id)?.document.languageId===y.language?u.has(y.id)?y.id="":u.add(y.id):y.id="";let E=s.get(y.id)?.document.languageId===y.language?s.get(y.id):void 0;A.id=y.id,A.language=y.language,A.uri=E?.document.uri,A.kind=E?.kind||(A.language==="markdown"?DBe.NotebookCellKind.Markup:DBe.NotebookCellKind.Code),yield A}else g.startsWith(sV)?(d&&f&&(yield f),l=!0,d=!1,f=void 0,yield{type:"end",index:c}):c>=0&&(d&&f&&(yield f,f=void 0),d=g.endsWith(sV),d?f={type:"line",index:c,line:g}:yield{type:"line",index:c,line:g})}}getAlternativeDocumentFromText(e,r){let n=(0,ZE.getCellIdMap)(r),o=[],s=e.split(ZE.EOL),c=0;for(let l=0;lh.document.languageId===d.language&&!o.some(m=>m.cell===h));if(f){let h=ZE.EOL.length,m=c+u.length+h;o.push({offset:m,cell:f})}}c+=u.length+ZE.EOL.length}return new GCt(e,o,r)}getAlternativeDocument(e,r){let o=e.getCells().filter(l=>r?l.kind!==DBe.NotebookCellKind.Markup:!0).map(l=>(0,ZE.summarize)(l)).map(l=>{let d=`${oOr(l)}${ZE.EOL}`;return{content:`${d}${l.source.join(ZE.EOL)}${ZE.EOL}${sV}`,prefix:d,cell:e.cellAt(l.index)}}),s=o.map(l=>l.content).join(ZE.EOL),c=o.map(l=>({offset:s.indexOf(l.content)+l.prefix.length,cell:l.cell}));return new GCt(s,c,e)}};MBe.AlternativeXmlNotebookContentProvider=sOr;function N6i(t,e){let r=t.match(/id="([^"]+)"/),n=t.match(/language="([^"]+)"/);if(!n){if(M6i(t)&&typeof e=="string")return{id:r?r[1].trim():"",language:e};throw new Error(`Invalid cell part in ${t}`)}return{id:r?r[1].trim():"",language:n[1].trim()}}a(N6i,"extractCellParts")});var Q6i=I(v1=>{"use strict";p();var RCc=v1&&v1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},L6i=v1&&v1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(v1,"__esModule",{value:!0});v1.AlternativeNotebookContentService=v1.IAlternativeNotebookContentService=void 0;v1.getAlternativeNotebookDocumentProvider=cOr;v1.inferAlternativeNotebookContentFormat=LCc;v1.getAltNotebookRange=BCc;var kCc=Evt(),PCc=nn(),DCc=P0(),B6i=Pl(),NCc=aBe(),MCc=mh(),F6i=w6i(),OCc=D6i(),U6i=O6i();function cOr(t){switch(t){case"xml":return new U6i.AlternativeXmlNotebookContentProvider;case"text":return new OCc.AlternativeTextNotebookContentProvider;case"json":return new F6i.AlternativeJsonNotebookContentProvider;default:throw new Error(`Unsupported kind '${t}'`)}}a(cOr,"getAlternativeNotebookDocumentProvider");function LCc(t){return(0,U6i.isXmlContent)(t)?"xml":(0,F6i.isJsonContent)(t)?"json":"text"}a(LCc,"inferAlternativeNotebookContentFormat");v1.IAlternativeNotebookContentService=(0,PCc.createServiceIdentifier)("IAlternativeNotebookContentService");var aOr=class{static{a(this,"AlternativeNotebookContentService")}constructor(e,r){this.configurationService=e,this.experimentationService=r}getFormat(e){return e&&(0,NCc.modelPrefersJsonNotebookRepresentation)(e)?"json":this.configurationService.getExperimentBasedConfig(B6i.ConfigKey.Advanced.NotebookAlternativeDocumentFormat,this.experimentationService)}create(e){return cOr(e)}};v1.AlternativeNotebookContentService=aOr;v1.AlternativeNotebookContentService=aOr=RCc([L6i(0,B6i.IConfigurationService),L6i(1,MCc.IExperimentationService)],aOr);function BCc(t,e,r,n){let o=(0,kCc.findCell)(e,r);if(!o)return;let s=cOr(n).getAlternativeDocument(r);return new DCc.Range(s.fromCellPosition(o,t.start),s.fromCellPosition(o,t.end))}a(BCc,"getAltNotebookRange")});var j6i=I(OBe=>{"use strict";p();Object.defineProperty(OBe,"__esModule",{value:!0});OBe.NotebookDocumentSnapshot=void 0;OBe.isNotebookDocumentSnapshotJSON=QCc;var $Ct=KS(),FCc=nd(),lOr=P0(),q6i=Q6i(),UCc=kBe();function QCc(t){return!t||typeof t!="object"?!1:t.type==="notebook"&&(0,FCc.isUriComponents)(t.uri)&&(0,$Ct.isString)(t._text)&&(0,$Ct.isString)(t.languageId)&&(0,$Ct.isNumber)(t.version)&&(0,$Ct.isString)(t.alternativeFormat)}a(QCc,"isNotebookDocumentSnapshotJSON");var uOr=class t{static{a(this,"NotebookDocumentSnapshot")}static create(e,r){let n=e.uri,o=e.version,s=(0,q6i.getAlternativeNotebookDocumentProvider)(r).getAlternativeDocument(e);return new t(e,n,o,r,s)}static fromNewText(e,r){let n=(0,q6i.getAlternativeNotebookDocumentProvider)(r.alternativeFormat).getAlternativeDocumentFromText(e,r.document);return new t(r.document,r.uri,r.version,r.alternativeFormat,n)}static fromJSON(e,r){return t.create(e,r.alternativeFormat)}constructor(e,r,n,o,s){this.alternativeFormat=o,this._alternativeDocument=s,this.type="notebook",this.document=e,this.uri=r,this.version=n,this.languageId=o==="text"?(0,UCc.getDefaultLanguage)(e)||"python":o}getText(e){return this._alternativeDocument.getText(e)}getSelection(){return new lOr.Selection(0,0,this.lineCount,0)}getWholeRange(){return new lOr.Range(0,0,this.lineCount,0)}get lines(){return this._alternativeDocument.lines}get lineCount(){return this._alternativeDocument.lineCount}lineAt(e){let r;if(e instanceof lOr.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return this._alternativeDocument.lineAt(r)}offsetAt(e){return this._alternativeDocument.offsetAt(e)}positionAt(e){return this._alternativeDocument.positionAt(e)}validateRange(e){return this._alternativeDocument.validateRange(e)}validatePosition(e){return this._alternativeDocument.validatePosition(e)}toJSON(){return{type:"notebook",uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,_text:this._alternativeDocument.getText(),alternativeFormat:this.alternativeFormat}}};OBe.NotebookDocumentSnapshot=uOr});var fOr=I(jv=>{"use strict";p();var qCc=jv&&jv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jCc=jv&&jv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),HCc=jv&&jv.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o"u"&&(r=this.getWorkspaceFolders().length>1);let c=(0,H6i.relativePath)(s,n);return r&&(c=`${this.getWorkspaceFolderName(s)}/${c}`),c}async openTextDocumentAndSnapshot(e){let r=await this.openTextDocument(e);return KCc.TextDocumentSnapshot.create(r)}async openNotebookDocumentAndSnapshot(e,r){let n=(0,GCc.findNotebook)(e,this.notebookDocuments)||await this.openNotebookDocument(e);return YCc.NotebookDocumentSnapshot.create(n,r)}getWorkspaceFolder(e){return this.getWorkspaceFolders().find(r=>H6i.extUriBiasedIgnorePathCase.isEqualOrParent(e,r))}};jv.AbstractWorkspaceService=VCt;function JCc(t,e){let r=t.getWorkspaceFolder(e);return r?WCc.posix.relative(r.path,e.path):e.path}a(JCc,"getWorkspaceFileDisplayPath");var dOr=class extends VCt{static{a(this,"NullWorkspaceService")}constructor(e=[],r=[],n=[]){super(),this.disposables=new VCc.DisposableStore,this.didOpenTextDocumentEmitter=this.disposables.add(new aV.Emitter),this.didCloseTextDocumentEmitter=this.disposables.add(new aV.Emitter),this.didOpenNotebookDocumentEmitter=this.disposables.add(new aV.Emitter),this.didCloseNotebookDocumentEmitter=this.disposables.add(new aV.Emitter),this.didChangeTextDocumentEmitter=this.disposables.add(new aV.Emitter),this.didChangeWorkspaceFoldersEmitter=this.disposables.add(new aV.Emitter),this.didChangeNotebookDocumentEmitter=this.disposables.add(new aV.Emitter),this.didChangeTextEditorSelectionEmitter=this.disposables.add(new aV.Emitter),this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event,this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event,this.onDidOpenNotebookDocument=this.didOpenNotebookDocumentEmitter.event,this.onDidCloseNotebookDocument=this.didCloseNotebookDocumentEmitter.event,this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event,this.onDidChangeWorkspaceFolders=this.didChangeWorkspaceFoldersEmitter.event,this.onDidChangeNotebookDocument=this.didChangeNotebookDocumentEmitter.event,this.onDidChangeTextEditorSelection=this.didChangeTextEditorSelectionEmitter.event,this._textDocuments=[],this._notebookDocuments=[],this.workspaceFolder=e,this._textDocuments=r,this._notebookDocuments=n}get textDocuments(){return this._textDocuments}showTextDocument(e){return Promise.resolve()}async openTextDocument(e){let r=this.textDocuments.find(n=>n.uri.toString()===e.toString());if(r)return r;throw new Error(`Unknown document: ${e}`)}async openNotebookDocument(e,r){if(typeof e=="string")throw new Error("Not implemented");{let n=this.notebookDocuments.find(o=>o.uri.toString()===e.toString());if(n)return n;throw new Error(`Unknown notebook: ${e}`)}}get notebookDocuments(){return this._notebookDocuments}getWorkspaceFolders(){return this.workspaceFolder}getWorkspaceFolderName(e){return"default"}ensureWorkspaceIsFullyLoaded(){return Promise.resolve()}showWorkspaceFolderPicker(){return Promise.resolve(void 0)}applyEdit(){return Promise.resolve(!0)}dispose(){this.disposables.dispose()}isResourceTrusted(e){return Promise.resolve(!0)}requestResourceTrust(e){return Promise.resolve(!0)}requestWorkspaceTrust(e){return Promise.resolve(!0)}};jv.NullWorkspaceService=dOr});var gOr=I(Yne=>{"use strict";p();Object.defineProperty(Yne,"__esModule",{value:!0});Yne.BatchedProcessor=Yne.TaskQueue=void 0;Yne.raceFilter=ZCc;var pOr=nl(),G6i=Rs(),hOr=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new pOr.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new pOr.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!0}),this._runIfNotRunning(),r.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;let e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new G6i.BugIndicatingError;this._runningTask=e.task;try{let r=await e.task();e.deferred.complete(r)}catch(r){e.deferred.error(r)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){let e=this._pendingTasks;this._pendingTasks=[];for(let r of e)r.setUndefinedWhenCleared?r.deferred.complete(void 0):r.deferred.error(new G6i.CancellationError)}};Yne.TaskQueue=hOr;var mOr=class{static{a(this,"BatchedProcessor")}constructor(e,r){this._fn=e,this._waitingTimeMs=r,this._queue=[],this._timeout=null}request(e){this._timeout===null&&(this._timeout=setTimeout(()=>this._flush(),this._waitingTimeMs));let r=new pOr.DeferredPromise;return this._queue.push({arg:e,promise:r}),r.p}async _flush(){let e=this._queue;this._queue=[],this._timeout=null;let r=e.map(o=>o.arg),n;try{n=await this._fn(r)}catch(o){for(let s of e)s.promise.error(o);return}for(let[o,s]of n.entries())e[o].promise.complete(s)}};Yne.BatchedProcessor=mOr;function ZCc(t,e){return new Promise((r,n)=>{if(t.length===0){r(void 0);return}let o=!1,s=t.length;for(let c of t)c.then(l=>{s--,o||(e(l)?(o=!0,r(l)):s===0&&r(void 0))}).catch(n)})}a(ZCc,"raceFilter")});var AOr=I($ye=>{"use strict";p();Object.defineProperty($ye,"__esModule",{value:!0});$ye.AsyncIterUtilsExt=$ye.AsyncIterUtils=void 0;var $6i;(function(t){async function*e(d,f){for await(let h of d)yield f(h)}a(e,"map"),t.map=e;async function*r(d,f,h){let m=d[Symbol.asyncIterator](),g;for(;!(g=await m.next()).done;)yield f(g.value);return h(g.value)}a(r,"mapWithReturn"),t.mapWithReturn=r;async function*n(d,f){for await(let h of d)f(h)&&(yield h)}a(n,"filter"),t.filter=n;async function o(d){let f=[];for await(let h of d)f.push(h);return f}a(o,"toArray"),t.toArray=o;async function*s(d){for(let f of d)yield f}a(s,"fromArray"),t.fromArray=s;async function*c(d,f){for(let h of d)yield h;return f}a(c,"fromArrayWithReturn"),t.fromArrayWithReturn=c;async function l(d){let f=d[Symbol.asyncIterator](),h=[],m;for(;!(m=await f.next()).done;)h.push(m.value);return[h,m.value]}a(l,"toArrayWithReturn"),t.toArrayWithReturn=l;async function u(d){let f=d[Symbol.asyncIterator](),h;do h=await f.next();while(!h.done);return h.value}a(u,"drainUntilReturn"),t.drainUntilReturn=u})($6i||($ye.AsyncIterUtils=$6i={}));var V6i;(function(t){async function*e(r){let n=null;for await(let o of r){n??="",n+=o;let s=n.split(/\r?\n/);n=s.pop()??"",yield*s}n!==null&&(yield n)}a(e,"splitLines"),t.splitLines=e})(V6i||($ye.AsyncIterUtilsExt=V6i={}))});var EOr=I(yOr=>{"use strict";p();Object.defineProperty(yOr,"__esModule",{value:!0});yOr.backwardCompatSetting=XCc;function XCc(t,e){return e(t)}a(XCc,"backwardCompatSetting")});var z6i=I(hI=>{"use strict";p();Object.defineProperty(hI,"__esModule",{value:!0});hI.LineWithTokens=hI.Token=void 0;hI.getOrDeduceSelectionFromLastEdit=tbc;hI.clipTokensToRange=W6i;hI.clipTokensToRangeAndAdjustOffsets=nbc;hI.removeTokensInRangeAndAdjustOffsets=ibc;hI.getTokensFromLogProbs=obc;hI.getTokensFromLinesWithTokens=sbc;hI.mergeOffsetRangesAtDistance=abc;var ebc=Rs(),Vye=hd();function tbc(t){let e=new Vye.OffsetRange(0,0);return t.lastSelectionInAfterEdit&&!t.lastSelectionInAfterEdit.equals(e)?t.documentAfterEdits.getTransformer().getRange(t.lastSelectionInAfterEdit):rbc(t)}a(tbc,"getOrDeduceSelectionFromLastEdit");function rbc(t){let e=t.recentEdits.edits.at(-1);if(e===void 0)return null;let r=e.replacements.at(-1);if(r===void 0)return null;let n=r.replaceRange,s=r.newText.length-n.length,c=n.endExclusive+s;return t.documentAfterEdits.getTransformer().getRange(new Vye.OffsetRange(c,c))}a(rbc,"deduceSelectionFromLastEdit");var WCt=class t{static{a(this,"Token")}get id(){return this.text+"_"+this.range.toString()}constructor(e,r,n){this.text=e,this.value=r,this.range=new Vye.OffsetRange(n,n+e.length)}equals(e){return this.range.equals(e.range)&&this.text===e.text}deltaOffset(e){return new t(this.text,this.value,this.range.start+e)}};hI.Token=WCt;function W6i(t,e){return t.filter(r=>e.intersects(r.range))}a(W6i,"clipTokensToRange");function nbc(t,e){return W6i(t,e).map(r=>r.deltaOffset(-e.start))}a(nbc,"clipTokensToRangeAndAdjustOffsets");function ibc(t,e){let r=[];for(let n of t)e.containsRange(n.range)||(n.range.start>e.start&&(n=n.deltaOffset(-e.length)),r.push(n));return r}a(ibc,"removeTokensInRangeAndAdjustOffsets");function obc(t,e){let r=e;return t.content.map(n=>{let o=new WCt(n.token,n.logprob,r);return r+=o.range.length,o})}a(obc,"getTokensFromLogProbs");var _Or=class t{static{a(this,"LineWithTokens")}static stringEquals(e,r){return e._text===r._text}static fromText(e,r){r=r??[];let n=[];for(;;){let o=e.indexOf(`\r +`;let r=new Uint32Array(this._lines.length);for(let n=0;n=0;n--){let o=r[n],s=this.toRange(o.replaceRange);this._acceptDeleteRange(s),this._acceptInsertText(s.start,o.newText)}}_acceptDeleteRange(e){if(e.start.line===e.end.line){if(e.start.character===e.end.character)return;this._setLineText(e.start.line,this._lines[e.start.line].substring(0,e.start.character)+this._lines[e.start.line].substring(e.end.character));return}this._setLineText(e.start.line,this._lines[e.start.line].substring(0,e.start.character)+this._lines[e.end.line].substring(e.end.character)),this._lines.splice(e.start.line+1,e.end.line-e.start.line),this._lineStarts.removeValues(e.start.line+1,e.end.line-e.start.line)}_acceptInsertText(e,r){if(r.length===0)return;let n=(0,cUi.splitLines)(r);if(n.length===1){this._setLineText(e.line,this._lines[e.line].substring(0,e.character)+n[0]+this._lines[e.line].substring(e.character));return}n[n.length-1]+=this._lines[e.line].substring(e.character),this._setLineText(e.line,this._lines[e.line].substring(0,e.character)+n[0]);let o=new Uint32Array(n.length-1);for(let s=1;snew rie.TextEdit(this.validateRange(n.range),n.newText));return new lUi.StringEdit(r.map(n=>new lUi.StringReplacement(this.toOffsetRange(n.range),n.newText)))}toTextEdits(e){return e.replacements.map(r=>new rie.TextEdit(this.toRange(r.replaceRange),r.newText))}validatePosition(e){if(!(e instanceof rie.Position))throw new Error("Invalid argument");if(this._lines.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this._lines.length)r=this._lines.length-1,n=this._lines[r].length,o=!0;else{let s=this._lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new rie.Position(r,n):e}validateRange(e){return new rie.Range(this.validatePosition(e.start),this.validatePosition(e.end))}};sbt.PositionOffsetTransformer=FOr});var qOr=I(nie=>{"use strict";p();Object.defineProperty(nie,"__esModule",{value:!0});nie.SnapshotDocumentLine=nie.TextDocumentSnapshot=void 0;nie.isTextDocumentSnapshotJSON=A1c;var abt=nT(),dUi=ad(),uUi=OOr(),tEe=N0(),g1c=UOr();function A1c(t){return!t||typeof t!="object"?!1:(0,dUi.isUriComponents)(t.uri)&&(0,abt.isString)(t._text)&&(0,abt.isString)(t.languageId)&&(0,abt.isNumber)(t.version)&&(0,abt.isNumber)(t.eol)}a(A1c,"isTextDocumentSnapshotJSON");var QOr=class t{static{a(this,"TextDocumentSnapshot")}static create(e){return new t(e,e.uri,e.getText(),e.languageId,e.eol,e.version)}static fromNewText(e,r){return new t(r instanceof t?r.document:r,r.uri,e,r.languageId,r.eol,r.version+1)}static fromJSON(e,r){return new t(e,dUi.URI.from(r.uri),r._text,r.languageId,r.eol,r.version)}get transformer(){return this._transformer||(this._transformer=new g1c.PositionOffsetTransformer(this._text)),this._transformer}get fileName(){return this.uri.fsPath}get isUntitled(){return this.uri.scheme==="untitled"}get lineCount(){return this.lines.length}get lines(){return this._lines||(this._lines=this._text.split(/\r\n|\r|\n/g)),this._lines}constructor(e,r,n,o,s,c){this._transformer=null,this._lines=null,this.document=e,this.uri=r,this._text=n,this.languageId=o,this.eol=s,this.version=c}lineAt(e){let r;if(e instanceof tEe.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return new cbt(r,this.lines[r],r===this.lines.length-1)}offsetAt(e){return this.version===this.document.version?this.document.offsetAt(e):(e=this.validatePosition(e),this.transformer.getOffset(e))}positionAt(e){return this.version===this.document.version?this.document.positionAt(e):(e=Math.floor(e),e=Math.max(0,e),this.transformer.getPosition(e))}getText(e){return e?this._getTextInRange(e):this._text}_getTextInRange(e){if(this.version===this.document.version)return this.document.getText(e);let r=this.validateRange(e);if(r.isEmpty)return"";let n=this.transformer.toOffsetRange(r);return this._text.substring(n.start,n.endExclusive)}getWordRangeAtPosition(e){let r=this.validatePosition(e),n=(0,uUi.getWordAtText)(r.character+1,uUi.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new tEe.Range(r.line,n.startColumn-1,r.line,n.endColumn-1)}validateRange(e){let r=this.validatePosition(e.start),n=this.validatePosition(e.end);return r===e.start&&n===e.end?e:new tEe.Range(r.line,r.character,n.line,n.character)}validatePosition(e){if(this._text.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this.lines.length)r=this.lines.length-1,n=this.lines[r].length,o=!0;else{let s=this.lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new tEe.Position(r,n):e}toJSON(){return{uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,eol:this.eol,_text:this._text}}};nie.TextDocumentSnapshot=QOr;var cbt=class{static{a(this,"SnapshotDocumentLine")}constructor(e,r,n){this._line=e,this._text=r,this._isLastLine=n}get lineNumber(){return this._line}get text(){return this._text}get range(){return new tEe.Range(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new tEe.Range(this._line,0,this._line+1,0)}get firstNonWhitespaceCharacterIndex(){return/^(\s*)/.exec(this._text)[1].length}get isEmptyOrWhitespace(){return this.firstNonWhitespaceCharacterIndex===this._text.length}};nie.SnapshotDocumentLine=cbt});var dbt=I(ubt=>{"use strict";p();Object.defineProperty(ubt,"__esModule",{value:!0});ubt.AlternativeNotebookDocument=void 0;var fUi=OOr(),lbt=N0(),y1c=UOr(),E1c=qOr(),jOr=class{static{a(this,"AlternativeNotebookDocument")}get transformer(){return this._transformer||(this._transformer=new y1c.PositionOffsetTransformer(this._text)),this._transformer}getText(e){return e?this._getTextInRange(e):this._text}_getTextInRange(e){let r=this.validateRange(e);if(r.isEmpty)return"";let n=this.transformer.toOffsetRange(r);return this._text.substring(n.start,n.endExclusive)}constructor(e,r){this._text=e,this.notebook=r,this._transformer=null,this._lines=null}positionToOffset(e){return e=this.validatePosition(e),this.transformer.getOffset(e)}getWordRangeAtPosition(e){let r=this.validatePosition(e),n=(0,fUi.getWordAtText)(r.character+1,fUi.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new lbt.Range(r.line,n.startColumn-1,r.line,n.endColumn-1)}get lines(){return this._lines||(this._lines=this._text.split(/\r\n|\r|\n/g)),this._lines}get lineCount(){return this.lines.length}lineAt(e){let r;if(e instanceof lbt.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return new E1c.SnapshotDocumentLine(r,this.lines[r],r===this.lines.length-1)}offsetAt(e){return this.transformer.getOffset(e)}positionAt(e){return e=Math.floor(e),e=Math.max(0,e),this.transformer.getPosition(e)}validateRange(e){let r=this.validatePosition(e.start),n=this.validatePosition(e.end);return r===e.start&&n===e.end?e:new lbt.Range(r.line,r.character,n.line,n.character)}validatePosition(e){if(this._text.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this.lines.length)r=this.lines.length-1,n=this.lines[r].length,o=!0;else{let s=this.lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new lbt.Position(r,n):e}};ubt.AlternativeNotebookDocument=jOr});var fbt=I(rEe=>{"use strict";p();Object.defineProperty(rEe,"__esModule",{value:!0});rEe.isUri=v1c;rEe.isLocation=HOr;rEe.toLocation=C1c;rEe.isSymbolInformation=b1c;var KBe=N0(),_1c=ad();function v1c(t){return _1c.URI.isUri(t)}a(v1c,"isUri");function HOr(t){return t&&typeof t=="object"&&"uri"in t&&"range"in t}a(HOr,"isLocation");function C1c(t){if(HOr(t)&&Array.isArray(t.range)&&t.range.length===2){let e=t.range[0],r=t.range[1];return new KBe.Location(t.uri,new KBe.Range(new KBe.Position(e.line,e.character),new KBe.Position(r.line,r.character)))}else if(HOr(t)&&t.range instanceof KBe.Range)return t}a(C1c,"toLocation");function b1c(t){return t&&typeof t=="object"&&"name"in t&&"containerName"in t}a(b1c,"isSymbolInformation")});var XBe=I(wy=>{"use strict";p();Object.defineProperty(wy,"__esModule",{value:!0});wy.CellIdPatternRe=wy.EOL=wy.LineOfText=void 0;wy.summarize=T1c;wy.notebookCellToCellData=I1c;wy.getCellIdMap=x1c;wy.normalizeCellId=w1c;wy.getNotebookId=R1c;wy.getCellId=VOr;wy.getDefaultLanguage=P1c;wy.requestHasNotebookRefs=N1c;wy.parseAndCleanStack=M1c;var pUi=fbt(),AUi=JNr(),S1c=om(),hUi=ad(),$Or=N0(),GOr=class{static{a(this,"LineOfText")}constructor(e){this.__lineOfTextBrand=void 0,this.value=e.replace(/\r$/,"")}};wy.LineOfText=GOr;wy.EOL=` +`;function T1c(t){let e=t.kind===$Or.NotebookCellKind.Code?"code":"markdown",r=VOr(t),n=k1c(t.document);return{cell_type:e,id:r,language:t.document.languageId,source:n,index:t.index}}a(T1c,"summarize");function I1c(t){let e=new $Or.NotebookCellData(t.kind,t.document.getText(),t.document.languageId);return e.metadata=t.metadata,e.executionSummary=t.executionSummary,t.outputs.length&&(e.outputs=[...t.outputs]),e}a(I1c,"notebookCellToCellData");function x1c(t){let e=new Map;return t.getCells().forEach(r=>{e.set(VOr(r),r)}),e}a(x1c,"getCellIdMap");var mUi=new WeakMap,ZBe=8,JBe="#VSC-";wy.CellIdPatternRe=new RegExp(`(\\s+|^|\\b|\\W)(#VSC-[a-f0-9]{${ZBe}})\\b`,"gi");function w1c(t){return t.startsWith(JBe)?t:t.startsWith("VSC-")?`#${t}`:t.startsWith("#V-")&&t.length===ZBe+3?`${JBe}${t.substring(3)}`:t.toLowerCase().startsWith("vscode-")&&t.length===ZBe+7?`${JBe}${t.substring(7)}`:t.startsWith("-")?`#VSC${t}`:t.length===ZBe?`${JBe}${t}`:t}a(w1c,"normalizeCellId");var gUi=new WeakMap;function R1c(t){let e=gUi.get(t);if(e)return e;let r=new AUi.StringSHA1;return r.update(t.uri.toString()),e=r.digest(),gUi.set(t,e),e}a(R1c,"getNotebookId");function VOr(t){let e=mUi.get(t);if(e)return e;let r=new AUi.StringSHA1;return r.update(t.document.uri.toString()),e=`${JBe}${r.digest().substring(0,ZBe)}`,mUi.set(t,e),e}a(VOr,"getCellId");function k1c(t){return t.lineCount===0?[]:new Array(t.lineCount).fill("").map((e,r)=>t.lineAt(r).text)}a(k1c,"getCellCode");function P1c(t){let e=t.getCells().find(r=>r.kind===$Or.NotebookCellKind.Code);if(e)return e.document.languageId;if(t.notebookType==="jupyter-notebook")return t.metadata?.language_info?.name||t.metadata?.kernelspec?.language||"python"}a(P1c,"getDefaultLanguage");var D1c=["jupyter","notebook","cell.","cells."," cell ","cells","notebook cell"];function N1c(t,e,r){let n=(t.prompt||"").toLowerCase();return r?.checkPromptAsWell&&D1c.some(o=>n.includes(o))?!0:t.references.some(o=>(0,pUi.isLocation)(o.value)?e.hasSupportedNotebooks(o.value.uri):(0,hUi.isUriComponents)(o.value)?e.hasSupportedNotebooks(hUi.URI.revive(o.value)):(0,pUi.isUri)(o.value)?e.hasSupportedNotebooks(o.value):!1)}a(N1c,"requestHasNotebookRefs");function M1c(t){try{let e=JSON.parse(t);return(0,S1c.removeAnsiEscapeCodes)(e?.stack||e.message||"")||e.message||e.name||t}catch{return t}}a(M1c,"parseAndCleanStack")});var _Ui=I(e3e=>{"use strict";p();Object.defineProperty(e3e,"__esModule",{value:!0});e3e.AlternativeJsonNotebookContentProvider=void 0;e3e.isJsonContent=U1c;var O1c=(ylr(),Qa(fWn)),L1c=nl(),yUi=ad(),EN=N0(),B1c=ibt(),F1c=dbt(),nEe=XBe(),EUi=4;function U1c(t){return!!(t.startsWith("{")||t.trim().startsWith("{")||(t.includes("{")||t.includes("}"))&&t.includes('"source":')&&t.includes('"cell_type":'))}a(U1c,"isJsonContent");var pbt=class extends F1c.AlternativeNotebookDocument{static{a(this,"AlternativeJsonDocument")}fromCellPosition(e,r){let n=(0,nEe.getCellId)(e),o=this.getText(),s=" ",c=`"id": "${n}",`,l=o.indexOf('"source": [',o.indexOf(c)),u=this.positionAt(l).line+1,d=e.document.getText(new EN.Range(r.line,0,r.line,r.character)),f=`${s}${JSON.stringify(d).slice(0,-1)}`,h=r.line+u;return new EN.Position(h,f.length)}toCellPosition(e){throw new Error("Method not implemented.")}},WOr=class extends B1c.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeJsonNotebookContentProvider")}constructor(){super("json")}stripCellMarkers(e){return e}parseAlternateContent(e,r,n){return this.parseAlternateContentImpl(e,r,n)}getAlternativeDocumentFromText(e,r){return new pbt(e,r)}getAlternativeDocument(e,r){let o={cells:e.getCells().filter(c=>r?c.kind!==EN.NotebookCellKind.Markup:!0).map(c=>{let l=(0,nEe.summarize)(c),u=Q1c(c.document);return{cell_type:l.cell_type,id:l.id,metadata:{language:l.language},source:u}})},s=JSON.stringify(o,void 0,EUi);return new pbt(s,e)}getSummaryOfStructure(e,r,n){let o=["{",' "cells: ['],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,nEe.summarize)(c);l.source.length&&l.source[0].trim().length?l.source=[l.source[0],s]:l.source.length&&l.source.some(d=>d.trim().length)?l.source=[s,l.source.filter(d=>d.trim().length)[0],s]:l.source=[s];let u=JSON.stringify(l,void 0,EUi).split(/\r?\n/).map(d=>` ${d}`);o.push(...u),o.push(",")}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.push(" ]"),o.push("}"),o.join(nEe.EOL)}parseAlternateContentImpl(e,r,n){return new L1c.AsyncIterableObject(async o=>{let s=yUi.URI.isUri(e)?new Map:(0,nEe.getCellIdMap)(e),c=new Set,l="",u=-1,d={index:-1,startOffset:-1,endOffset:-1,kind:EN.NotebookCellKind.Code,source:[]},f=yUi.URI.isUri(e)?"python":(0,nEe.getDefaultLanguage)(e),h=a(g=>{d.language=d.language||f,d.id&&s.get(d.id)?.document.languageId===d.language?c.has(d.id)?d.id="":c.add(d.id):d.id="";let A=s.get(d.id);d.uri=A?.document.uri,d.kind=A?.kind||(d.language==="markdown"?EN.NotebookCellKind.Markup:EN.NotebookCellKind.Code),o.emitOne({index:d.index,type:"start",kind:d.kind,language:d.language,uri:d.uri,id:d.id}),d.source.forEach(y=>o.emitOne({index:d.index,type:"line",line:y})),o.emitOne({index:d.index,type:"end"})},"emitCell"),m=0;for await(let g of r){if(n.isCancellationRequested)break;let A=g.value;l+=A,(0,O1c.visit)(l,{onObjectEnd(y,E,_,v){m=y},onLiteralValue:a((y,E,_,v,b,T)=>{if(u>=E)return;let w=T();if(w.length<2||w.shift()!=="cells")return;let R=w.shift();if(typeof R!="number")return;let x=w.shift();if(u=E,d.index!==-1&&d.index!==R&&(h(E),d.startOffset=E,d.id=void 0,d.kind=EN.NotebookCellKind.Code,d.source=[],d.uri=void 0,d.language=void 0),d.index=R,x==="cell_type")d.kind=y==="code"?EN.NotebookCellKind.Code:EN.NotebookCellKind.Markup,d.kind===EN.NotebookCellKind.Markup&&(d.language="markdown");else if(x==="id")d.id=y;else if(x==="metadata"&&w[0]==="id")d.id=y;else if(x==="metadata"&&w[0]==="language")d.language=y,d.language==="markdown"&&(d.kind=EN.NotebookCellKind.Markup);else if(x==="source"&&w.length&&typeof w[0]=="number"){w[0]===0&&(d.startOffset=E);let P=typeof y=="string"?y:`${y||""}`;P.endsWith(` +`)&&(P=P.substr(0,P.length-1)),d.source.push(P)}},"onLiteralValue")})}d.index!==-1&&h(m)})}};e3e.AlternativeJsonNotebookContentProvider=WOr;function Q1c(t){if(t.lineCount===0)return[];if(t.lineCount===1)return[t.lineAt(0).text];let e=t.lineCount;return new Array(e).fill("").map((r,n)=>t.lineAt(n).text)}a(Q1c,"getCellCode")});var YOr=I(gV=>{"use strict";p();Object.defineProperty(gV,"__esModule",{value:!0});gV.wellKnownLanguages=void 0;gV.getLanguage=vUi;gV.getLanguageForResource=H1c;var q1c=s2(),j1c=Object.freeze({abap:{lineComment:{start:"'"},markdownLanguageIds:["abap","sap-abap"]},bat:{lineComment:{start:"REM"},alternativeLineComments:[{start:"::"}],aliases:["Batch","bat"],extensions:[".bat",".cmd"]},bibtex:{lineComment:{start:"%"},aliases:["BibTeX","bibtex"],extensions:[".bib"]},blade:{lineComment:{start:"#"}},c:{lineComment:{start:"//"},aliases:["C","c"],extensions:[".c",".i"],markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";"},aliases:["Clojure","clojure"],extensions:[".clj",".cljs",".cljc",".cljx",".clojure",".edn"],markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//"},aliases:["CoffeeScript","coffeescript","coffee"],extensions:[".coffee",".cson",".iced"],markdownLanguageIds:["coffeescript","coffee","cson","iced"],blockComment:["###","###"]},cpp:{lineComment:{start:"//"},aliases:["C++","Cpp","cpp"],extensions:[".cpp",".cc",".cxx",".c++",".hpp",".hh",".hxx",".h++",".h",".ii",".ino",".inl",".ipp",".ixx",".tpp",".txx",".hpp.in",".h.in"],markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"],blockComment:["/*","*/"]},csharp:{lineComment:{start:"//"},aliases:["C#","csharp"],extensions:[".cs",".csx",".cake"],markdownLanguageIds:["csharp","cs"],blockComment:["/*","*/"]},css:{lineComment:{start:"/*",end:"*/"},aliases:["CSS","css"],extensions:[".css"],blockComment:["/*","*/"]},dart:{lineComment:{start:"//"},aliases:["Dart"],extensions:[".dart"],blockComment:["/*","*/"]},dockerfile:{lineComment:{start:"#"},aliases:["Docker","Dockerfile","Containerfile"],extensions:[".dockerfile",".containerfile"],markdownLanguageIds:["dockerfile","docker"]},elixir:{lineComment:{start:"#"}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%"},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//"},aliases:["F#","FSharp","fsharp"],extensions:[".fs",".fsi",".fsx",".fsscript"],markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"],blockComment:["(*","*)"]},go:{lineComment:{start:"//"},aliases:["Go"],extensions:[".go"],markdownLanguageIds:["go","golang"],blockComment:["/*","*/"]},groovy:{lineComment:{start:"//"},aliases:["Groovy","groovy"],extensions:[".groovy",".gvy",".gradle",".jenkinsfile",".nf"],blockComment:["/*","*/"]},haml:{lineComment:{start:"-#"}},handlebars:{lineComment:{start:"{{!",end:"}}"},extensions:[".hbs",".handlebars"],markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"],blockComment:["{{!--","--}}"]},haskell:{lineComment:{start:"--"},markdownLanguageIds:["haskell","hs"]},html:{lineComment:{start:""},aliases:["HTML","htm","html","xhtml"],extensions:[".html",".htm",".shtml",".xhtml",".xht",".mdoc",".jsp",".asp",".aspx",".jshtm",".volt",".ejs",".rhtml"],markdownLanguageIds:["html","xhtml"],blockComment:[""]},ini:{lineComment:{start:";"},blockComment:[";"," "]},java:{lineComment:{start:"//"},extensions:[".java",".class"],markdownLanguageIds:["java","jsp"],blockComment:["/*","*/"]},javascript:{lineComment:{start:"//"},aliases:["JavaScript","javascript","js"],extensions:[".js",".es6",".mjs",".cjs",".pac"],markdownLanguageIds:["javascript","js"],blockComment:["/*","*/"]},javascriptreact:{lineComment:{start:"//"},aliases:["JavaScript JSX","JavaScript React","jsx"],extensions:[".jsx"],markdownLanguageIds:["jsx"]},json:{extensions:[".json"],lineComment:{start:"//"},blockComment:["/*","*/"]},jsonc:{lineComment:{start:"//"}},jsx:{lineComment:{start:"//"},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#"},aliases:["Julia","julia"],extensions:[".jl"],markdownLanguageIds:["julia","jl"],blockComment:["#=","=#"]},kotlin:{lineComment:{start:"//"},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%"},aliases:["LaTeX","latex"],extensions:[".tex",".ltx",".ctx"],markdownLanguageIds:["tex"]},less:{lineComment:{start:"//"},aliases:["Less","less"],extensions:[".less"],blockComment:["/*","*/"]},lua:{lineComment:{start:"--"},aliases:["Lua","lua"],extensions:[".lua"],markdownLanguageIds:["lua","pluto"],blockComment:["--[[","]]"]},makefile:{lineComment:{start:"#"},aliases:["Makefile","makefile"],extensions:[".mak",".mk"],markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:""},alternativeLineComments:[{start:"[]: #"}],aliases:["Markdown","markdown"],extensions:[".md",".mkd",".mdwn",".mdown",".markdown",".markdn",".mdtxt",".mdtext",".workbook"],markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//"},aliases:["Objective-C"],extensions:[".m"],markdownLanguageIds:["objectivec","mm","objc","obj-c"],blockComment:["/*","*/"]},"objective-cpp":{lineComment:{start:"//"},aliases:["Objective-C++"],extensions:[".mm"],markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#"},aliases:["Perl","perl"],extensions:[".pl",".pm",".pod",".t",".PL",".psgi"],markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//"},aliases:["PHP","php"],extensions:[".php",".php4",".php5",".phtml",".ctp"],blockComment:["/*","*/"]},powershell:{lineComment:{start:"#"},aliases:["PowerShell","powershell","ps","ps1"],extensions:[".ps1",".psm1",".psd1",".pssc",".psrc"],markdownLanguageIds:["powershell","ps","ps1"],blockComment:["<#","#>"]},pug:{lineComment:{start:"//"}},python:{lineComment:{start:"#"},aliases:["Python","py"],extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi",".pyi",".ipy",".pyt"],markdownLanguageIds:["python","py","gyp"],blockComment:['"""','"""']},ql:{lineComment:{start:"//"}},r:{lineComment:{start:"#"},aliases:["R","r"],extensions:[".r",".rhistory",".rprofile",".rt"]},razor:{lineComment:{start:""},aliases:["Razor","razor"],extensions:[".cshtml",".razor"],markdownLanguageIds:["cshtml","razor","razor-cshtml"],blockComment:[""]},ruby:{lineComment:{start:"#"},aliases:["Ruby","rb"],extensions:[".rb",".rbx",".rjs",".gemspec",".rake",".ru",".erb",".podspec",".rbi"],markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"],blockComment:["=begin","=end"]},rust:{lineComment:{start:"//"},aliases:["Rust","rust"],extensions:[".rs"],markdownLanguageIds:["rust","rs"],blockComment:["/*","*/"]},sass:{lineComment:{start:"//"}},scala:{lineComment:{start:"//"}},scss:{lineComment:{start:"//"},aliases:["SCSS","scss"],extensions:[".scss"],blockComment:["/*","*/"]},shellscript:{lineComment:{start:"#"},aliases:["Shell Script","shellscript","bash","fish","sh","zsh","ksh","csh"],extensions:[".sh",".bash",".bashrc",".bash_aliases",".bash_profile",".bash_login",".ebuild",".profile",".bash_logout",".xprofile",".xsession",".xsessionrc",".Xsession",".zsh",".zshrc",".zprofile",".zlogin",".zlogout",".zshenv",".zsh-theme",".fish",".ksh",".csh",".cshrc",".tcshrc",".yashrc",".yash_profile"],markdownLanguageIds:["bash","sh","zsh"]},slim:{lineComment:{start:"/"}},solidity:{lineComment:{start:"//"},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--"},aliases:["SQL"],extensions:[".sql",".dsql"],blockComment:["/*","*/"]},stylus:{lineComment:{start:"//"}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//"},aliases:["Swift","swift"],extensions:[".swift"],blockComment:["/*","*/"]},terraform:{lineComment:{start:"#"}},tex:{lineComment:{start:"%"},aliases:["TeX","tex"],extensions:[".sty",".cls",".bbx",".cbx"]},typescript:{lineComment:{start:"//"},aliases:["TypeScript","ts","typescript"],extensions:[".ts",".cts",".mts"],markdownLanguageIds:["typescript","ts"],blockComment:["/*","*/"]},typescriptreact:{lineComment:{start:"//"},aliases:["TypeScript JSX","TypeScript React","tsx"],extensions:[".tsx"],markdownLanguageIds:["tsx"],blockComment:["/*","*/"]},vb:{lineComment:{start:"'"},aliases:["Visual Basic","vb"],extensions:[".vb",".brs",".vbs",".bas",".vba"],markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//"}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//"},extensions:[".vue"]},xml:{lineComment:{start:""},aliases:["XML","xml"],extensions:[".xml",".xsd",".ascx",".atom",".axml",".axaml",".bpmn",".cpt",".csl",".csproj",".csproj.user",".dita",".ditamap",".dtd",".ent",".mod",".dtml",".fsproj",".fxml",".iml",".isml",".jmx",".launch",".menu",".mxml",".nuspec",".opml",".owl",".proj",".props",".pt",".publishsettings",".pubxml",".pubxml.user",".rbxlx",".rbxmx",".rdf",".rng",".rss",".shproj",".storyboard",".svg",".targets",".tld",".tmx",".vbproj",".vbproj.user",".vcxproj",".vcxproj.filters",".wsdl",".wxi",".wxl",".wxs",".xaml",".xbl",".xib",".xlf",".xliff",".xpdl",".xul",".xoml"],blockComment:[""]},xsl:{lineComment:{start:""},aliases:["XSL","xsl"],extensions:[".xsl",".xslt"]},yaml:{lineComment:{start:"#"},markdownLanguageIds:["yaml","yml"]}});gV.wellKnownLanguages=new Map(Object.entries(j1c).map(([t,e])=>[t,{languageId:t,...e}]));function vUi(t){return zOr(typeof t=="string"?t:typeof t>"u"?"plaintext":t.languageId)}a(vUi,"getLanguage");function zOr(t){return gV.wellKnownLanguages.get(t.toLowerCase())??{languageId:t,lineComment:{start:"//"}}}a(zOr,"_getLanguage");function H1c(t){let e=(0,q1c.extname)(t).toLowerCase();for(let r of gV.wellKnownLanguages.values())if(r.extensions?.includes(e))return r;return vUi("plaintext")}a(H1c,"getLanguageForResource")});var SUi=I(AV=>{"use strict";p();Object.defineProperty(AV,"__esModule",{value:!0});AV.AlternativeTextNotebookContentProvider=void 0;AV.generateCellTextMarker=ZOr;AV.lineMightHaveCellMarker=XOr;AV.getBlockComment=oEe;AV.getLineCommentStart=sEe;var JOr=YOr(),G1c=fbt(),$1c=Qq(),iEe=N0(),V1c=ibt(),W1c=dbt(),jm=XBe();function ZOr(t,e){let r=t.id?`[id=${t.id}] `:"";return`${e}%% vscode.cell ${r}[language=${t.language}]`}a(ZOr,"generateCellTextMarker");function XOr(t){return t.toLowerCase().includes("vscode.cell")}a(XOr,"lineMightHaveCellMarker");var hbt=class extends W1c.AlternativeNotebookDocument{static{a(this,"AlternativeTextDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,jm.summarize)(e),o=sEe(this.notebook),s=ZOr(n,o),c=e.document.eol===iEe.EndOfLine.LF?1:2,l=oEe(this.notebook),u=this.getText(),d=e.document.offsetAt(r),f=e.kind===iEe.NotebookCellKind.Markup?l[0].length+c:0,h=u.indexOf(s)+s.length+c+f+d;return this.positionAt(h)}toCellPosition(e){let r=this.offsetAt(e),n=(0,$1c.findLast)(this.cellOffsetMap,s=>s.sourceOffset<=r);if(!n)return;let o=n.cell.document.positionAt(r-n.sourceOffset);return{cell:n.cell,position:o}}},KOr=class extends V1c.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeTextNotebookContentProvider")}constructor(){super("text")}stripCellMarkers(e){let r=e.split(jm.EOL);return r.length&&XOr(r[0])?(r.shift(),r.join(jm.EOL)):e}getSummaryOfStructure(e,r,n){let o=oEe(e),s=sEe(e),c=`${s} ${n}`,l=[];return e.getCells().forEach(u=>{if(r.includes(u)){let d=(0,jm.summarize)(u);d.source.length&&d.source[0].trim().length?d.source=[d.source[0],c]:d.source.length&&d.source.some(f=>f.trim().length)?d.source=[c,d.source.filter(f=>f.trim().length)[0],c]:d.source=[c],l.push(CUi(d,s,o).content)}else(!l.length||l[l.length-1]!==c)&&l.push(c)}),l.join(jm.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,G1c.isUri)(e),s=o?(0,jm.getCellIdMap)(e):new Map,c=!1,l=!1,u=!1,d=!1,f=-1,h=sEe(o?e:void 0),m=oEe(o?e:void 0),g=o?(0,JOr.getLanguage)((0,jm.getDefaultLanguage)(e)).languageId:void 0,A=new Set;for await(let y of r){if(n.isCancellationRequested)break;let E=y.value,_=E.startsWith(`${h}%% [`)&&E.trimEnd().endsWith("]"),v=E.startsWith(`${h}%% vscode.cell`),b=v||_?bUi(E,g):void 0;if((v||_)&&b?.language){u&&(u=!1);let T={index:-1,uri:void 0,language:void 0,kind:iEe.NotebookCellKind.Code,emitted:!1,type:"start"};T.index=f+=1,T.emitted=!1,b.id&&s.get(b.id)?.document.languageId===b.language?A.has(b.id)?b.id="":A.add(b.id):b.id="";let w=s.get(b.id);T.id=b.id,T.language=b.language,T.uri=w?.document.uri,T.kind=w?.kind||(T.language==="markdown"?iEe.NotebookCellKind.Markup:iEe.NotebookCellKind.Code),c=T.language==="markdown",l=!1,d&&(yield{index:f-1,type:"end"}),d=!0,yield T;continue}d&&(c?l?E===m[1]?(l=!1,u=!0):yield{index:f,line:E,type:"line"}:E===m[0]?l=!0:yield{index:f,line:E,type:"line"}:yield{index:f,line:E,type:"line"})}d&&(yield{index:f,type:"end"})}getAlternativeDocumentFromText(e,r){let n=oEe(r),o=sEe(r),s=(0,jm.getCellIdMap)(r),c=[],l=e.split(jm.EOL),u=0;for(let d=0;dy.document.languageId===g.language&&!c.some(E=>E.cell===y));if(A){let y=u,E=jm.EOL.length,_=g.language==="markdown",v=y+f.length+E+(_?n[0].length+E:0);c.push({offset:y,sourceOffset:v,cell:A})}}}u+=f.length+jm.EOL.length}return new hbt(e,c,r)}getAlternativeDocument(e,r){let n=e.getCells().filter(d=>r?d.kind!==iEe.NotebookCellKind.Markup:!0).map(d=>(0,jm.summarize)(d)),o=oEe(e),s=sEe(e),c=n.map(d=>({...CUi(d,s,o),cell:e.cellAt(d.index)})),l=c.map(d=>d.content).join(jm.EOL),u=c.map(d=>{let f=l.indexOf(d.content),h=f+d.prefix.length;return{offset:f,sourceOffset:h,cell:e.cellAt(d.cell.index)}});return new hbt(l,u,e)}};AV.AlternativeTextNotebookContentProvider=KOr;function CUi(t,e,r){let n=ZOr(t,e),o=t.source.join(jm.EOL),s=t.language==="markdown"?`${n}${jm.EOL}${r[0]}${jm.EOL}`:`${n}${jm.EOL}`;return{content:t.language==="markdown"?`${s}${o}${jm.EOL}${r[1]}`:`${s}${o}`,prefix:s}}a(CUi,"generateAlternativeCellTextContent");function oEe(t){return t?(0,JOr.getLanguage)((0,jm.getDefaultLanguage)(t)).blockComment??["```","```"]:['"""','"""']}a(oEe,"getBlockComment");function sEe(t){return t&&(0,JOr.getLanguage)((0,jm.getDefaultLanguage)(t)).lineComment.start||"#"}a(sEe,"getLineCommentStart");function bUi(t,e){let r=t.match(/\[id=(.+?)\]/),n=t.match(/\[language=(.+?)\]/);return n?{id:r?r[1].trim():"",language:n[1].trim()}:XOr(t)&&typeof e=="string"?{id:r?r[1].trim():"",language:e}:void 0}a(bUi,"extractCellParts")});var xUi=I(n3e=>{"use strict";p();Object.defineProperty(n3e,"__esModule",{value:!0});n3e.AlternativeXmlNotebookContentProvider=void 0;n3e.isXmlContent=IUi;var z1c=YOr(),Y1c=fbt(),K1c=Qq(),t3e=N0(),J1c=ibt(),Z1c=dbt(),n_=XBe(),r3e="`}a(e5r,"generateCellMarker");function IUi(t){return t.includes(r3e)||t.includes(yV)||t.includes(mbt)}a(IUi,"isXmlContent");var gbt=class extends Z1c.AlternativeNotebookDocument{static{a(this,"AlternativeXmlDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,n_.summarize)(e),o=e5r(n),s=e.document.eol===t3e.EndOfLine.LF?1:2,c=this.getText(),l=e.document.offsetAt(r),u=c.indexOf(o)+o.length+s+l;return this.positionAt(u)}toCellPosition(e){let r=this.offsetAt(e),n=(0,K1c.findLast)(this.cellOffsetMap,s=>s.offset<=r);if(!n)return;let o=n.cell.document.positionAt(r-n.offset);return{cell:n.cell,position:o}}},t5r=class extends J1c.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeXmlNotebookContentProvider")}constructor(){super("xml")}stripCellMarkers(e){let r=e.split(n_.EOL);return r.length&&(r[0].startsWith(r3e)||r[0].startsWith(mbt))&&r.shift(),r.length&&r[r.length-1].trim().endsWith(yV)&&(r[r.length-1]=r[r.length-1].substring(0,r[r.length-1].lastIndexOf(yV))),r.join(n_.EOL)}getSummaryOfStructure(e,r,n){let o=[],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,n_.summarize)(c);o.push(e5r(l)),l.source.length&&l.source[0].trim().length?(o.push(l.source[0]),o.push(s)):l.source.length&&l.source.some(u=>u.trim().length)?l.source=[s,l.source.filter(u=>u.trim().length)[0],s]:o.push(s),o.push(yV)}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.join(n_.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,Y1c.isUri)(e),s=o?(0,n_.getCellIdMap)(e):new Map,c=-1,l=!1,u=new Set,d=!1,f,h=o?(0,z1c.getLanguage)((0,n_.getDefaultLanguage)(e)).languageId:void 0;for await(let m of r){if(n.isCancellationRequested)break;let g=m.value;if((g.startsWith(r3e)||g.startsWith(mbt))&&(c<0||l||d&&f)){!l&&d&&f&&(f.line=f.line.substring(0,f.line.lastIndexOf(yV)),yield f,yield{type:"end",index:f.index}),d=!1,f=void 0,c+=1,l=!1;let A={type:"start",index:c,uri:void 0,language:void 0,kind:t3e.NotebookCellKind.Code},y=TUi(g,h);y.id&&s.get(y.id)?.document.languageId===y.language?u.has(y.id)?y.id="":u.add(y.id):y.id="";let E=s.get(y.id)?.document.languageId===y.language?s.get(y.id):void 0;A.id=y.id,A.language=y.language,A.uri=E?.document.uri,A.kind=E?.kind||(A.language==="markdown"?t3e.NotebookCellKind.Markup:t3e.NotebookCellKind.Code),yield A}else g.startsWith(yV)?(d&&f&&(yield f),l=!0,d=!1,f=void 0,yield{type:"end",index:c}):c>=0&&(d&&f&&(yield f,f=void 0),d=g.endsWith(yV),d?f={type:"line",index:c,line:g}:yield{type:"line",index:c,line:g})}}getAlternativeDocumentFromText(e,r){let n=(0,n_.getCellIdMap)(r),o=[],s=e.split(n_.EOL),c=0;for(let l=0;lh.document.languageId===d.language&&!o.some(m=>m.cell===h));if(f){let h=n_.EOL.length,m=c+u.length+h;o.push({offset:m,cell:f})}}c+=u.length+n_.EOL.length}return new gbt(e,o,r)}getAlternativeDocument(e,r){let o=e.getCells().filter(l=>r?l.kind!==t3e.NotebookCellKind.Markup:!0).map(l=>(0,n_.summarize)(l)).map(l=>{let d=`${e5r(l)}${n_.EOL}`;return{content:`${d}${l.source.join(n_.EOL)}${n_.EOL}${yV}`,prefix:d,cell:e.cellAt(l.index)}}),s=o.map(l=>l.content).join(n_.EOL),c=o.map(l=>({offset:s.indexOf(l.content)+l.prefix.length,cell:l.cell}));return new gbt(s,c,e)}};n3e.AlternativeXmlNotebookContentProvider=t5r;function TUi(t,e){let r=t.match(/id="([^"]+)"/),n=t.match(/language="([^"]+)"/);if(!n){if(IUi(t)&&typeof e=="string")return{id:r?r[1].trim():"",language:e};throw new Error(`Invalid cell part in ${t}`)}return{id:r?r[1].trim():"",language:n[1].trim()}}a(TUi,"extractCellParts")});var DUi=I(S1=>{"use strict";p();var eSc=S1&&S1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},wUi=S1&&S1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(S1,"__esModule",{value:!0});S1.AlternativeNotebookContentService=S1.IAlternativeNotebookContentService=void 0;S1.getAlternativeNotebookDocumentProvider=n5r;S1.inferAlternativeNotebookContentFormat=aSc;S1.getAltNotebookRange=cSc;var tSc=$vt(),rSc=nn(),nSc=N0(),RUi=Pl(),iSc=kBe(),oSc=yh(),kUi=_Ui(),sSc=SUi(),PUi=xUi();function n5r(t){switch(t){case"xml":return new PUi.AlternativeXmlNotebookContentProvider;case"text":return new sSc.AlternativeTextNotebookContentProvider;case"json":return new kUi.AlternativeJsonNotebookContentProvider;default:throw new Error(`Unsupported kind '${t}'`)}}a(n5r,"getAlternativeNotebookDocumentProvider");function aSc(t){return(0,PUi.isXmlContent)(t)?"xml":(0,kUi.isJsonContent)(t)?"json":"text"}a(aSc,"inferAlternativeNotebookContentFormat");S1.IAlternativeNotebookContentService=(0,rSc.createServiceIdentifier)("IAlternativeNotebookContentService");var r5r=class{static{a(this,"AlternativeNotebookContentService")}constructor(e,r){this.configurationService=e,this.experimentationService=r}getFormat(e){return e&&(0,iSc.modelPrefersJsonNotebookRepresentation)(e)?"json":this.configurationService.getExperimentBasedConfig(RUi.ConfigKey.Advanced.NotebookAlternativeDocumentFormat,this.experimentationService)}create(e){return n5r(e)}};S1.AlternativeNotebookContentService=r5r;S1.AlternativeNotebookContentService=r5r=eSc([wUi(0,RUi.IConfigurationService),wUi(1,oSc.IExperimentationService)],r5r);function cSc(t,e,r,n){let o=(0,tSc.findCell)(e,r);if(!o)return;let s=n5r(n).getAlternativeDocument(r);return new nSc.Range(s.fromCellPosition(o,t.start),s.fromCellPosition(o,t.end))}a(cSc,"getAltNotebookRange")});var MUi=I(i3e=>{"use strict";p();Object.defineProperty(i3e,"__esModule",{value:!0});i3e.NotebookDocumentSnapshot=void 0;i3e.isNotebookDocumentSnapshotJSON=dSc;var Abt=nT(),lSc=ad(),i5r=N0(),NUi=DUi(),uSc=XBe();function dSc(t){return!t||typeof t!="object"?!1:t.type==="notebook"&&(0,lSc.isUriComponents)(t.uri)&&(0,Abt.isString)(t._text)&&(0,Abt.isString)(t.languageId)&&(0,Abt.isNumber)(t.version)&&(0,Abt.isString)(t.alternativeFormat)}a(dSc,"isNotebookDocumentSnapshotJSON");var o5r=class t{static{a(this,"NotebookDocumentSnapshot")}static create(e,r){let n=e.uri,o=e.version,s=(0,NUi.getAlternativeNotebookDocumentProvider)(r).getAlternativeDocument(e);return new t(e,n,o,r,s)}static fromNewText(e,r){let n=(0,NUi.getAlternativeNotebookDocumentProvider)(r.alternativeFormat).getAlternativeDocumentFromText(e,r.document);return new t(r.document,r.uri,r.version,r.alternativeFormat,n)}static fromJSON(e,r){return t.create(e,r.alternativeFormat)}constructor(e,r,n,o,s){this.alternativeFormat=o,this._alternativeDocument=s,this.type="notebook",this.document=e,this.uri=r,this.version=n,this.languageId=o==="text"?(0,uSc.getDefaultLanguage)(e)||"python":o}getText(e){return this._alternativeDocument.getText(e)}getSelection(){return new i5r.Selection(0,0,this.lineCount,0)}getWholeRange(){return new i5r.Range(0,0,this.lineCount,0)}get lines(){return this._alternativeDocument.lines}get lineCount(){return this._alternativeDocument.lineCount}lineAt(e){let r;if(e instanceof i5r.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return this._alternativeDocument.lineAt(r)}offsetAt(e){return this._alternativeDocument.offsetAt(e)}positionAt(e){return this._alternativeDocument.positionAt(e)}validateRange(e){return this._alternativeDocument.validateRange(e)}validatePosition(e){return this._alternativeDocument.validatePosition(e)}toJSON(){return{type:"notebook",uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,_text:this._alternativeDocument.getText(),alternativeFormat:this.alternativeFormat}}};i3e.NotebookDocumentSnapshot=o5r});var a5r=I($v=>{"use strict";p();var fSc=$v&&$v.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pSc=$v&&$v.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),hSc=$v&&$v.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o"u"&&(r=this.getWorkspaceFolders().length>1);let c=(0,OUi.relativePath)(s,n);return r&&(c=`${this.getWorkspaceFolderName(s)}/${c}`),c}async openTextDocumentAndSnapshot(e){let r=await this.openTextDocument(e);return vSc.TextDocumentSnapshot.create(r)}async openNotebookDocumentAndSnapshot(e,r){let n=(0,mSc.findNotebook)(e,this.notebookDocuments)||await this.openNotebookDocument(e);return _Sc.NotebookDocumentSnapshot.create(n,r)}getWorkspaceFolder(e){return this.getWorkspaceFolders().find(r=>OUi.extUriBiasedIgnorePathCase.isEqualOrParent(e,r))}};$v.AbstractWorkspaceService=ybt;function CSc(t,e){let r=t.getWorkspaceFolder(e);return r?ySc.posix.relative(r.path,e.path):e.path}a(CSc,"getWorkspaceFileDisplayPath");var s5r=class extends ybt{static{a(this,"NullWorkspaceService")}constructor(e=[],r=[],n=[]){super(),this.disposables=new ASc.DisposableStore,this.didOpenTextDocumentEmitter=this.disposables.add(new EV.Emitter),this.didCloseTextDocumentEmitter=this.disposables.add(new EV.Emitter),this.didOpenNotebookDocumentEmitter=this.disposables.add(new EV.Emitter),this.didCloseNotebookDocumentEmitter=this.disposables.add(new EV.Emitter),this.didChangeTextDocumentEmitter=this.disposables.add(new EV.Emitter),this.didChangeWorkspaceFoldersEmitter=this.disposables.add(new EV.Emitter),this.didChangeNotebookDocumentEmitter=this.disposables.add(new EV.Emitter),this.didChangeTextEditorSelectionEmitter=this.disposables.add(new EV.Emitter),this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event,this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event,this.onDidOpenNotebookDocument=this.didOpenNotebookDocumentEmitter.event,this.onDidCloseNotebookDocument=this.didCloseNotebookDocumentEmitter.event,this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event,this.onDidChangeWorkspaceFolders=this.didChangeWorkspaceFoldersEmitter.event,this.onDidChangeNotebookDocument=this.didChangeNotebookDocumentEmitter.event,this.onDidChangeTextEditorSelection=this.didChangeTextEditorSelectionEmitter.event,this._textDocuments=[],this._notebookDocuments=[],this.workspaceFolder=e,this._textDocuments=r,this._notebookDocuments=n}get textDocuments(){return this._textDocuments}showTextDocument(e){return Promise.resolve()}async openTextDocument(e){let r=this.textDocuments.find(n=>n.uri.toString()===e.toString());if(r)return r;throw new Error(`Unknown document: ${e}`)}async openNotebookDocument(e,r){if(typeof e=="string")throw new Error("Not implemented");{let n=this.notebookDocuments.find(o=>o.uri.toString()===e.toString());if(n)return n;throw new Error(`Unknown notebook: ${e}`)}}get notebookDocuments(){return this._notebookDocuments}getWorkspaceFolders(){return this.workspaceFolder}getWorkspaceFolderName(e){return"default"}ensureWorkspaceIsFullyLoaded(){return Promise.resolve()}showWorkspaceFolderPicker(){return Promise.resolve(void 0)}applyEdit(){return Promise.resolve(!0)}dispose(){this.disposables.dispose()}isResourceTrusted(e){return Promise.resolve(!0)}requestResourceTrust(e){return Promise.resolve(!0)}requestWorkspaceTrust(e){return Promise.resolve(!0)}};$v.NullWorkspaceService=s5r});var d5r=I(iie=>{"use strict";p();Object.defineProperty(iie,"__esModule",{value:!0});iie.BatchedProcessor=iie.TaskQueue=void 0;iie.raceFilter=bSc;var c5r=nl(),LUi=Rs(),l5r=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new c5r.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new c5r.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!0}),this._runIfNotRunning(),r.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;let e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new LUi.BugIndicatingError;this._runningTask=e.task;try{let r=await e.task();e.deferred.complete(r)}catch(r){e.deferred.error(r)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){let e=this._pendingTasks;this._pendingTasks=[];for(let r of e)r.setUndefinedWhenCleared?r.deferred.complete(void 0):r.deferred.error(new LUi.CancellationError)}};iie.TaskQueue=l5r;var u5r=class{static{a(this,"BatchedProcessor")}constructor(e,r){this._fn=e,this._waitingTimeMs=r,this._queue=[],this._timeout=null}request(e){this._timeout===null&&(this._timeout=setTimeout(()=>this._flush(),this._waitingTimeMs));let r=new c5r.DeferredPromise;return this._queue.push({arg:e,promise:r}),r.p}async _flush(){let e=this._queue;this._queue=[],this._timeout=null;let r=e.map(o=>o.arg),n;try{n=await this._fn(r)}catch(o){for(let s of e)s.promise.error(o);return}for(let[o,s]of n.entries())e[o].promise.complete(s)}};iie.BatchedProcessor=u5r;function bSc(t,e){return new Promise((r,n)=>{if(t.length===0){r(void 0);return}let o=!1,s=t.length;for(let c of t)c.then(l=>{s--,o||(e(l)?(o=!0,r(l)):s===0&&r(void 0))}).catch(n)})}a(bSc,"raceFilter")});var f5r=I(aEe=>{"use strict";p();Object.defineProperty(aEe,"__esModule",{value:!0});aEe.AsyncIterUtilsExt=aEe.AsyncIterUtils=void 0;var BUi;(function(t){async function*e(d,f){for await(let h of d)yield f(h)}a(e,"map"),t.map=e;async function*r(d,f,h){let m=d[Symbol.asyncIterator](),g;for(;!(g=await m.next()).done;)yield f(g.value);return h(g.value)}a(r,"mapWithReturn"),t.mapWithReturn=r;async function*n(d,f){for await(let h of d)f(h)&&(yield h)}a(n,"filter"),t.filter=n;async function o(d){let f=[];for await(let h of d)f.push(h);return f}a(o,"toArray"),t.toArray=o;async function*s(d){for(let f of d)yield f}a(s,"fromArray"),t.fromArray=s;async function*c(d,f){for(let h of d)yield h;return f}a(c,"fromArrayWithReturn"),t.fromArrayWithReturn=c;async function l(d){let f=d[Symbol.asyncIterator](),h=[],m;for(;!(m=await f.next()).done;)h.push(m.value);return[h,m.value]}a(l,"toArrayWithReturn"),t.toArrayWithReturn=l;async function u(d){let f=d[Symbol.asyncIterator](),h;do h=await f.next();while(!h.done);return h.value}a(u,"drainUntilReturn"),t.drainUntilReturn=u})(BUi||(aEe.AsyncIterUtils=BUi={}));var FUi;(function(t){async function*e(r){let n=null;for await(let o of r){n??="",n+=o;let s=n.split(/\r?\n/);n=s.pop()??"",yield*s}n!==null&&(yield n)}a(e,"splitLines"),t.splitLines=e})(FUi||(aEe.AsyncIterUtilsExt=FUi={}))});var h5r=I(p5r=>{"use strict";p();Object.defineProperty(p5r,"__esModule",{value:!0});p5r.backwardCompatSetting=SSc;function SSc(t,e){return e(t)}a(SSc,"backwardCompatSetting")});var QUi=I(_I=>{"use strict";p();Object.defineProperty(_I,"__esModule",{value:!0});_I.LineWithTokens=_I.Token=void 0;_I.getOrDeduceSelectionFromLastEdit=ISc;_I.clipTokensToRange=UUi;_I.clipTokensToRangeAndAdjustOffsets=wSc;_I.removeTokensInRangeAndAdjustOffsets=RSc;_I.getTokensFromLogProbs=kSc;_I.getTokensFromLinesWithTokens=PSc;_I.mergeOffsetRangesAtDistance=DSc;var TSc=Rs(),cEe=Ed();function ISc(t){let e=new cEe.OffsetRange(0,0);return t.lastSelectionInAfterEdit&&!t.lastSelectionInAfterEdit.equals(e)?t.documentAfterEdits.getTransformer().getRange(t.lastSelectionInAfterEdit):xSc(t)}a(ISc,"getOrDeduceSelectionFromLastEdit");function xSc(t){let e=t.recentEdits.edits.at(-1);if(e===void 0)return null;let r=e.replacements.at(-1);if(r===void 0)return null;let n=r.replaceRange,s=r.newText.length-n.length,c=n.endExclusive+s;return t.documentAfterEdits.getTransformer().getRange(new cEe.OffsetRange(c,c))}a(xSc,"deduceSelectionFromLastEdit");var Ebt=class t{static{a(this,"Token")}get id(){return this.text+"_"+this.range.toString()}constructor(e,r,n){this.text=e,this.value=r,this.range=new cEe.OffsetRange(n,n+e.length)}equals(e){return this.range.equals(e.range)&&this.text===e.text}deltaOffset(e){return new t(this.text,this.value,this.range.start+e)}};_I.Token=Ebt;function UUi(t,e){return t.filter(r=>e.intersects(r.range))}a(UUi,"clipTokensToRange");function wSc(t,e){return UUi(t,e).map(r=>r.deltaOffset(-e.start))}a(wSc,"clipTokensToRangeAndAdjustOffsets");function RSc(t,e){let r=[];for(let n of t)e.containsRange(n.range)||(n.range.start>e.start&&(n=n.deltaOffset(-e.length)),r.push(n));return r}a(RSc,"removeTokensInRangeAndAdjustOffsets");function kSc(t,e){let r=e;return t.content.map(n=>{let o=new Ebt(n.token,n.logprob,r);return r+=o.range.length,o})}a(kSc,"getTokensFromLogProbs");var m5r=class t{static{a(this,"LineWithTokens")}static stringEquals(e,r){return e._text===r._text}static fromText(e,r){r=r??[];let n=[];for(;;){let o=e.indexOf(`\r `),s=e.indexOf(` `),c=o===-1?s:s===-1?o:Math.min(o,s),l=o!==-1?`\r `:s===-1?void 0:` `;if(l===void 0){n.push(new t(e,r,` -`));break}let u=c+l.length,d=e.substring(0,c),f=r.filter(h=>h.range.start0);n.push(new t(d,f,l)),e=e.substring(u),r=r.map(h=>h.deltaOffset(-u)).filter(h=>h.range.endExclusive>0)}return n}get text(){return this._text}get tokens(){return this._tokens}get length(){return this._text.length}get lengthWithEOL(){return this._text.length+this._eol.length}get eol(){return this._eol}constructor(e,r,n){this._text=e,this._tokens=r,this._eol=n}trim(){return this.trimStart().trimEnd()}trimStart(){let e=this._text.trimStart(),r=this._text.length-e.length,n=this._tokens.map(o=>o.deltaOffset(-r)).filter(o=>o.range.endExclusive>0);return new t(e,n,this._eol)}trimEnd(){let e=this._text.trimEnd(),r=this._tokens.filter(n=>n.range.starts.deltaOffset(-e)).filter(s=>s.range.endExclusive>0&&s.range.startr.equals(e.tokens[n]))}dropTokens(e){return new t(this._text,this._tokens.filter(r=>!e.some(n=>r.equals(n))),this._eol)}findTokens(e){return this._tokens.filter(e)}};hI.LineWithTokens=_Or;function sbc(t){let e=0,r=[];for(let s of t){let c=s.text+s.eol;r.push(...s.tokens.map(l=>l.deltaOffset(e))),e+=c.length}let n=[],o=new Set;for(let s of r)o.has(s.id)||(o.add(s.id),n.push(s));return n}a(sbc,"getTokensFromLinesWithTokens");function abc(t,e){if(e<0)throw new ebc.BugIndicatingError("Distance must be positive");let r=t.map(o=>new Vye.OffsetRange(o.start-e,o.endExclusive+e)),n=new Vye.OffsetRangeSet;for(let o of r)n.addRange(o);return n.ranges.map(o=>new Vye.OffsetRange(o.start+e,o.endExclusive-e))}a(abc,"mergeOffsetRangesAtDistance")});var Y6i=I(zCt=>{"use strict";p();Object.defineProperty(zCt,"__esModule",{value:!0});zCt.DelaySession=void 0;var vOr=class{static{a(this,"DelaySession")}constructor(e,r,n=Date.now()){this.baseDebounceTime=e,this.expectedTotalTime=r,this.providerInvocationTime=n,this.extraDebounce=0}setExtraDebounce(e){this.extraDebounce=e}setBaseDebounceTime(e){this.baseDebounceTime=e}setExpectedTotalTime(e){this.expectedTotalTime=e}getDebounceTime(){let r=(this.expectedTotalTime===void 0?this.baseDebounceTime:Math.min(this.baseDebounceTime,this.expectedTotalTime))+this.extraDebounce,n=Date.now()-this.providerInvocationTime;return Math.max(0,r-n)}getArtificialDelay(){if(this.expectedTotalTime===void 0)return 0;let e=Date.now()-this.providerInvocationTime;return Math.max(0,this.expectedTotalTime-e)}};zCt.DelaySession=vOr});var X6i=I(kp=>{"use strict";p();var cbc=kp&&kp.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},YCt=kp&&kp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(kp,"__esModule",{value:!0});kp.UserInteractionMonitor=kp.MAX_INTERACTIONS_STORED=kp.MAX_INTERACTIONS_CONSIDERED=kp.ActionKind=void 0;kp.getWindowWithIgnoredLimit=J6i;kp.getUserHappinessScore=Z6i;var Wye=Pl(),Kne=py(),lbc=Sp(),ubc=mh(),dbc=gm(),K6i=X_(),fbc=Y6i(),mI;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(mI||(kp.ActionKind=mI={}));kp.MAX_INTERACTIONS_CONSIDERED=10;kp.MAX_INTERACTIONS_STORED=30;function J6i(t,e){let{limitConsecutiveIgnored:r,limitTotalIgnored:n,ignoredLimit:o}=e;if(!r&&!n)return t.slice(-kp.MAX_INTERACTIONS_CONSIDERED);let s=[],c=0,l=0;for(let u=t.length-1;u>=0&&s.length=o&&(f=!0),n&&l>=o&&(f=!0),f)continue;c++,l++}else c=0;s.push(d)}return s.reverse(),s}a(J6i,"getWindowWithIgnoredLimit");function Z6i(t,e){if(t.length===0)return .5;let r=J6i(t,e);if(r.length===0)return .5;let n=0,o=0,s=0;for(let u=0;u0?n/o:.5,l=s/kp.MAX_INTERACTIONS_CONSIDERED;return .5+(c-.5)*l}a(Z6i,"getUserHappinessScore");var COr=class{static{a(this,"UserInteractionMonitor")}constructor(e,r,n,o){this._configurationService=e,this._experimentationService=r,this._logService=n,this._telemetryService=o,this._recentUserActionsForAggressiveness=[],this._recentUserActionsForTiming=[],this._lastActionWasAcceptance=!1}handleAcceptance(){this._recordUserAction(mI.Accepted)}handleRejection(){this._recordUserAction(mI.Rejected)}handleIgnored(){this._recordUserAction(mI.Ignored)}get wasLastActionAcceptance(){return this._lastActionWasAcceptance}_recordUserAction(e){let r=Date.now();this._lastActionWasAcceptance=e===mI.Accepted,this._recentUserActionsForAggressiveness.push({time:r,kind:e}),this._recentUserActionsForAggressiveness=this._recentUserActionsForAggressiveness.slice(-kp.MAX_INTERACTIONS_STORED),e!==mI.Ignored&&(this._recentUserActionsForTiming.push({time:r,kind:e}),this._recentUserActionsForTiming=this._recentUserActionsForTiming.slice(-kp.MAX_INTERACTIONS_CONSIDERED))}createDelaySession(e){let r=this._configurationService.getExperimentBasedConfig(Wye.ConfigKey.TeamInternal.InlineEditsDebounce,this._experimentationService),o=this._configurationService.getExperimentBasedConfig(Wye.ConfigKey.TeamInternal.InlineEditsBackoffDebounceEnabled,this._experimentationService)?this._getExpectedTotalTime(r):void 0;return new fbc.DelaySession(r,o,e)}_getExpectedTotalTime(e){let l=Date.now(),u=1;for(let f of this._recentUserActionsForTiming){let h=l-f.time;if(h>6e5)continue;let m=Math.exp(-h/6e5),g=f.kind===mI.Rejected?1.5:.8;u*=1+(g-1)*m}let d=e*u;return d=Math.min(3e3,Math.max(50,d)),d}getAggressivenessLevel(){let e=this._configurationService.getExperimentBasedConfig(Wye.ConfigKey.Advanced.InlineEditsAggressiveness,this._experimentationService),r=Kne.AggressivenessSetting.toLevel(e);if(r!==void 0)return{aggressivenessLevel:r,userHappinessScore:void 0};let n=this._configurationService.getExperimentBasedConfig(Wye.ConfigKey.TeamInternal.InlineEditsXtabAggressivenessLevel,this._experimentationService);if(n!==void 0)return{aggressivenessLevel:n,userHappinessScore:void 0};let o,s=this._getUserHappinessScoreConfiguration(),c=this._getUserHappinessScore(s);return c>=s.highThreshold?o=Kne.AggressivenessLevel.High:c>=s.mediumThreshold?o=Kne.AggressivenessLevel.Medium:o=Kne.AggressivenessLevel.Low,{aggressivenessLevel:o,userHappinessScore:c}}_getUserHappinessScoreConfiguration(){let e=Wye.ConfigKey.TeamInternal.InlineEditsUserHappinessScoreConfigurationString,r=this._configurationService.getExperimentBasedConfig(e,this._experimentationService);if(r===void 0)return Kne.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION;try{return(0,Kne.parseUserHappinessScoreConfigurationString)(r)}catch(n){return this._logService.error(n,"Failed to parse user happiness score configuration, using default config"),this._telemetryService.sendMSFTTelemetryEvent("incorrectNesAdaptiveAggressivenessConfig",{configName:e.id,errorMessage:K6i.ErrorUtils.toString(K6i.ErrorUtils.fromUnknown(n)),configValue:r}),Kne.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION}}_getUserHappinessScore(e){return Z6i(this._recentUserActionsForAggressiveness,e)}};kp.UserInteractionMonitor=COr;kp.UserInteractionMonitor=COr=cbc([YCt(0,Wye.IConfigurationService),YCt(1,ubc.IExperimentationService),YCt(2,lbc.ILogService),YCt(3,dbc.ITelemetryService)],COr)});var e9i=I(bOr=>{"use strict";p();Object.defineProperty(bOr,"__esModule",{value:!0});bOr.isImportStatement=pbc;function pbc(t,e){switch(e){case"java":return!!t.match(/^\s*import\s/);case"typescript":case"typescriptreact":case"javascript":case"javascriptreact":return!!t.match(/^\s*import[\s{*]|^\s*[var|const|let].*=\s*require\(/);case"php":return!!t.match(/^\s*use/);case"rust":return!!t.match(/^\s*use\s+[\w:{}, ]+\s*(as\s+\w+)?;/);case"python":return!!t.match(/^\s*from\s+[\w.]+\s+import\s+[\w, *]+$/)||!!t.match(/^\s*import\s+[\w, ]+$/);default:return!1}}a(pbc,"isImportStatement")});var n9i=I(KCt=>{"use strict";p();Object.defineProperty(KCt,"__esModule",{value:!0});KCt.IgnoreImportChangesAspect=void 0;var t9i=Q0t(),hbc=Sl(),r9i=e9i(),SOr=class t{static{a(this,"IgnoreImportChangesAspect")}static isImportChange(e,r,n){return e.newLines.some(o=>(0,r9i.isImportStatement)(o,r))||mbc(e,n).some(o=>(0,r9i.isImportStatement)(o,r))}static filterEdit(e,r,n=t9i.ImportChanges.None){if(n===t9i.ImportChanges.All)return r;let o=e.languageId,s=e.documentLinesBeforeEdit;return r.filter(l=>!t.isImportChange(l,o,s))}};KCt.IgnoreImportChangesAspect=SOr;function mbc(t,e){return(0,hbc.coalesce)(t.lineRange.mapToLineArray(r=>e[r-1]))}a(mbc,"getOldLines")});var IOr=I(JCt=>{"use strict";p();Object.defineProperty(JCt,"__esModule",{value:!0});JCt.FetchStreamError=void 0;var TOr=class extends Error{static{a(this,"FetchStreamError")}constructor(e){super("Fetch stream failed"),this.reason=e}};JCt.FetchStreamError=TOr});var i9i=I(ZCt=>{"use strict";p();Object.defineProperty(ZCt,"__esModule",{value:!0});ZCt.DiagnosticData=void 0;var gbc=ZP(),xOr=class{static{a(this,"DiagnosticData")}constructor(e,r,n,o,s,c){this.documentUri=e,this.message=r,this.severity=n,this.range=o,this.code=s,this.source=c}toString(){return`${this.severity.toUpperCase()}: ${this.message} (${this.range})`}equals(e){return(0,gbc.isEqual)(this.documentUri,e.documentUri)&&this.message===e.message&&this.severity===e.severity&&this.range.equals(e.range)&&this.code===e.code&&this.source===e.source}};ZCt.DiagnosticData=xOr});var cV=I(zye=>{"use strict";p();Object.defineProperty(zye,"__esModule",{value:!0});zye.ResponseTags=zye.PromptTags=void 0;var o9i;(function(t){t.CURSOR="<|cursor|>";function e(n){return{start:`<|${n}|>`,end:`<|/${n}|>`}}a(e,"createTag"),t.EDIT_WINDOW=e("code_to_edit"),t.AREA_AROUND=e("area_around_code_to_edit"),t.CURRENT_FILE=e("current_file_content"),t.CURSOR_LOCATION=e("cursor_location"),t.EDIT_HISTORY=e("edit_diff_history"),t.RECENT_FILES=e("recently_viewed_code_snippets"),t.RECENT_FILE=e("recently_viewed_code_snippet");function r(n){return e(n)}a(r,"createLintTag"),t.createLintTag=r})(o9i||(zye.PromptTags=o9i={}));var s9i;(function(t){t.NO_EDIT="",t.NO_CHANGE={start:""},t.EDIT={start:"",end:""},t.INSERT={start:"",end:""}})(s9i||(zye.ResponseTags=s9i={}))});var DOr=I(r9=>{"use strict";p();var Abc=r9&&r9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ybc=r9&&r9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(r9,"__esModule",{value:!0});r9.LintErrors=void 0;var Ebc=i9i(),KR=py(),_bc=T$(),vbc=Rs(),wOr=ZP(),Cbc=eh(),c9i=hd(),bbc=P0(),Sbc=cV(),kOr=class{static{a(this,"LintErrors")}constructor(e,r,n,o){this._documentId=e,this._document=r,this._langDiagService=n,this._xtabHistory=o}_diagnostics(e){let r=e?[[e,this._langDiagService.getDiagnostics(e)]]:this._langDiagService.getAllDiagnostics(),n=this._documentId.toUri();return r.map(o=>{let[s,c]=o;return c.map(l=>{let u=new Cbc.Range(l.range.start.line+1,l.range.start.character+1,l.range.end.line+1,l.range.end.character+1),d=(0,wOr.isEqual)(n,s)?ebt.fromPositions(u.getStartPosition(),this._document.cursorPosition):void 0;return new POr(s,l.message,l.severity===bbc.DiagnosticSeverity.Error?"error":"warning",d,u,this._document.transformer.getOffsetRange(u),l.code&&typeof l.code!="number"&&typeof l.code!="string"?l.code.value:l.code,l.source)})}).flat()}_getRelevantDiagnostics(e,r){let n=this._diagnostics(r);return n=wbc(n,e.maxLineDistance),n=a9i(n),n=ROr(n,e.warnings),n.slice(0,e.maxLints)}getFormattedLintErrors(e){let r=this._getRelevantDiagnostics(e,this._documentId.toUri()),n;if(e.nRecentFiles>0&&this._xtabHistory){let l=this._collectRecentFileUris(e.nRecentFiles),u=this._getRecentFileDiagnostics(l,e);n=[...r,...u].slice(0,e.maxLints)}else n=r;this._previousFormttedDiagnostics=n;let o=this._documentId.toUri(),s=n.map(l=>{let d=(0,wOr.isEqual)(l.documentUri,o)?e:{...e,showCode:KR.LintOptionShowCode.NO};return XCt(l,this._document.lines,d)}).join(` -`),c=Sbc.PromptTags.createLintTag(e.tagName);return`${c.start} +`));break}let u=c+l.length,d=e.substring(0,c),f=r.filter(h=>h.range.start0);n.push(new t(d,f,l)),e=e.substring(u),r=r.map(h=>h.deltaOffset(-u)).filter(h=>h.range.endExclusive>0)}return n}get text(){return this._text}get tokens(){return this._tokens}get length(){return this._text.length}get lengthWithEOL(){return this._text.length+this._eol.length}get eol(){return this._eol}constructor(e,r,n){this._text=e,this._tokens=r,this._eol=n}trim(){return this.trimStart().trimEnd()}trimStart(){let e=this._text.trimStart(),r=this._text.length-e.length,n=this._tokens.map(o=>o.deltaOffset(-r)).filter(o=>o.range.endExclusive>0);return new t(e,n,this._eol)}trimEnd(){let e=this._text.trimEnd(),r=this._tokens.filter(n=>n.range.starts.deltaOffset(-e)).filter(s=>s.range.endExclusive>0&&s.range.startr.equals(e.tokens[n]))}dropTokens(e){return new t(this._text,this._tokens.filter(r=>!e.some(n=>r.equals(n))),this._eol)}findTokens(e){return this._tokens.filter(e)}};_I.LineWithTokens=m5r;function PSc(t){let e=0,r=[];for(let s of t){let c=s.text+s.eol;r.push(...s.tokens.map(l=>l.deltaOffset(e))),e+=c.length}let n=[],o=new Set;for(let s of r)o.has(s.id)||(o.add(s.id),n.push(s));return n}a(PSc,"getTokensFromLinesWithTokens");function DSc(t,e){if(e<0)throw new TSc.BugIndicatingError("Distance must be positive");let r=t.map(o=>new cEe.OffsetRange(o.start-e,o.endExclusive+e)),n=new cEe.OffsetRangeSet;for(let o of r)n.addRange(o);return n.ranges.map(o=>new cEe.OffsetRange(o.start+e,o.endExclusive-e))}a(DSc,"mergeOffsetRangesAtDistance")});var qUi=I(_bt=>{"use strict";p();Object.defineProperty(_bt,"__esModule",{value:!0});_bt.DelaySession=void 0;var g5r=class{static{a(this,"DelaySession")}constructor(e,r,n=Date.now()){this.baseDebounceTime=e,this.expectedTotalTime=r,this.providerInvocationTime=n,this.extraDebounce=0}setExtraDebounce(e){this.extraDebounce=e}setBaseDebounceTime(e){this.baseDebounceTime=e}setExpectedTotalTime(e){this.expectedTotalTime=e}getDebounceTime(){let r=(this.expectedTotalTime===void 0?this.baseDebounceTime:Math.min(this.baseDebounceTime,this.expectedTotalTime))+this.extraDebounce,n=Date.now()-this.providerInvocationTime;return Math.max(0,r-n)}getArtificialDelay(){if(this.expectedTotalTime===void 0)return 0;let e=Date.now()-this.providerInvocationTime;return Math.max(0,this.expectedTotalTime-e)}};_bt.DelaySession=g5r});var $Ui=I(Np=>{"use strict";p();var NSc=Np&&Np.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},vbt=Np&&Np.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Np,"__esModule",{value:!0});Np.UserInteractionMonitor=Np.MAX_INTERACTIONS_STORED=Np.MAX_INTERACTIONS_CONSIDERED=Np.ActionKind=void 0;Np.getWindowWithIgnoredLimit=HUi;Np.getUserHappinessScore=GUi;var lEe=Pl(),oie=Ay(),MSc=xp(),OSc=yh(),LSc=vm(),jUi=nv(),BSc=qUi(),vI;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(vI||(Np.ActionKind=vI={}));Np.MAX_INTERACTIONS_CONSIDERED=10;Np.MAX_INTERACTIONS_STORED=30;function HUi(t,e){let{limitConsecutiveIgnored:r,limitTotalIgnored:n,ignoredLimit:o}=e;if(!r&&!n)return t.slice(-Np.MAX_INTERACTIONS_CONSIDERED);let s=[],c=0,l=0;for(let u=t.length-1;u>=0&&s.length=o&&(f=!0),n&&l>=o&&(f=!0),f)continue;c++,l++}else c=0;s.push(d)}return s.reverse(),s}a(HUi,"getWindowWithIgnoredLimit");function GUi(t,e){if(t.length===0)return .5;let r=HUi(t,e);if(r.length===0)return .5;let n=0,o=0,s=0;for(let u=0;u0?n/o:.5,l=s/Np.MAX_INTERACTIONS_CONSIDERED;return .5+(c-.5)*l}a(GUi,"getUserHappinessScore");var A5r=class{static{a(this,"UserInteractionMonitor")}constructor(e,r,n,o){this._configurationService=e,this._experimentationService=r,this._logService=n,this._telemetryService=o,this._recentUserActionsForAggressiveness=[],this._recentUserActionsForTiming=[],this._lastActionWasAcceptance=!1}handleAcceptance(){this._recordUserAction(vI.Accepted)}handleRejection(){this._recordUserAction(vI.Rejected)}handleIgnored(){this._recordUserAction(vI.Ignored)}get wasLastActionAcceptance(){return this._lastActionWasAcceptance}_recordUserAction(e){let r=Date.now();this._lastActionWasAcceptance=e===vI.Accepted,this._recentUserActionsForAggressiveness.push({time:r,kind:e}),this._recentUserActionsForAggressiveness=this._recentUserActionsForAggressiveness.slice(-Np.MAX_INTERACTIONS_STORED),e!==vI.Ignored&&(this._recentUserActionsForTiming.push({time:r,kind:e}),this._recentUserActionsForTiming=this._recentUserActionsForTiming.slice(-Np.MAX_INTERACTIONS_CONSIDERED))}createDelaySession(e){let r=this._configurationService.getExperimentBasedConfig(lEe.ConfigKey.TeamInternal.InlineEditsDebounce,this._experimentationService),o=this._configurationService.getExperimentBasedConfig(lEe.ConfigKey.TeamInternal.InlineEditsBackoffDebounceEnabled,this._experimentationService)?this._getExpectedTotalTime(r):void 0;return new BSc.DelaySession(r,o,e)}_getExpectedTotalTime(e){let l=Date.now(),u=1;for(let f of this._recentUserActionsForTiming){let h=l-f.time;if(h>6e5)continue;let m=Math.exp(-h/6e5),g=f.kind===vI.Rejected?1.5:.8;u*=1+(g-1)*m}let d=e*u;return d=Math.min(3e3,Math.max(50,d)),d}getAggressivenessLevel(){let e=this._configurationService.getExperimentBasedConfig(lEe.ConfigKey.Advanced.InlineEditsAggressiveness,this._experimentationService),r=oie.AggressivenessSetting.toLevel(e);if(r!==void 0)return{aggressivenessLevel:r,userHappinessScore:void 0};let n=this._configurationService.getExperimentBasedConfig(lEe.ConfigKey.TeamInternal.InlineEditsXtabAggressivenessLevel,this._experimentationService);if(n!==void 0)return{aggressivenessLevel:n,userHappinessScore:void 0};let o,s=this._getUserHappinessScoreConfiguration(),c=this._getUserHappinessScore(s);return c>=s.highThreshold?o=oie.AggressivenessLevel.High:c>=s.mediumThreshold?o=oie.AggressivenessLevel.Medium:o=oie.AggressivenessLevel.Low,{aggressivenessLevel:o,userHappinessScore:c}}_getUserHappinessScoreConfiguration(){let e=lEe.ConfigKey.TeamInternal.InlineEditsUserHappinessScoreConfigurationString,r=this._configurationService.getExperimentBasedConfig(e,this._experimentationService);if(r===void 0)return oie.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION;try{return(0,oie.parseUserHappinessScoreConfigurationString)(r)}catch(n){return this._logService.error(n,"Failed to parse user happiness score configuration, using default config"),this._telemetryService.sendMSFTTelemetryEvent("incorrectNesAdaptiveAggressivenessConfig",{configName:e.id,errorMessage:jUi.ErrorUtils.toString(jUi.ErrorUtils.fromUnknown(n)),configValue:r}),oie.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION}}_getUserHappinessScore(e){return GUi(this._recentUserActionsForAggressiveness,e)}};Np.UserInteractionMonitor=A5r;Np.UserInteractionMonitor=A5r=NSc([vbt(0,lEe.IConfigurationService),vbt(1,OSc.IExperimentationService),vbt(2,MSc.ILogService),vbt(3,LSc.ITelemetryService)],A5r)});var VUi=I(y5r=>{"use strict";p();Object.defineProperty(y5r,"__esModule",{value:!0});y5r.isImportStatement=FSc;function FSc(t,e){switch(e){case"java":return!!t.match(/^\s*import\s/);case"typescript":case"typescriptreact":case"javascript":case"javascriptreact":return!!t.match(/^\s*import[\s{*]|^\s*[var|const|let].*=\s*require\(/);case"php":return!!t.match(/^\s*use/);case"rust":return!!t.match(/^\s*use\s+[\w:{}, ]+\s*(as\s+\w+)?;/);case"python":return!!t.match(/^\s*from\s+[\w.]+\s+import\s+[\w, *]+$/)||!!t.match(/^\s*import\s+[\w, ]+$/);default:return!1}}a(FSc,"isImportStatement")});var YUi=I(Cbt=>{"use strict";p();Object.defineProperty(Cbt,"__esModule",{value:!0});Cbt.IgnoreImportChangesAspect=void 0;var WUi=fgt(),USc=Sl(),zUi=VUi(),E5r=class t{static{a(this,"IgnoreImportChangesAspect")}static isImportChange(e,r,n){return e.newLines.some(o=>(0,zUi.isImportStatement)(o,r))||QSc(e,n).some(o=>(0,zUi.isImportStatement)(o,r))}static filterEdit(e,r,n=WUi.ImportChanges.None){if(n===WUi.ImportChanges.All)return r;let o=e.languageId,s=e.documentLinesBeforeEdit;return r.filter(l=>!t.isImportChange(l,o,s))}};Cbt.IgnoreImportChangesAspect=E5r;function QSc(t,e){return(0,USc.coalesce)(t.lineRange.mapToLineArray(r=>e[r-1]))}a(QSc,"getOldLines")});var v5r=I(bbt=>{"use strict";p();Object.defineProperty(bbt,"__esModule",{value:!0});bbt.FetchStreamError=void 0;var _5r=class extends Error{static{a(this,"FetchStreamError")}constructor(e){super("Fetch stream failed"),this.reason=e}};bbt.FetchStreamError=_5r});var KUi=I(Sbt=>{"use strict";p();Object.defineProperty(Sbt,"__esModule",{value:!0});Sbt.DiagnosticData=void 0;var qSc=s2(),C5r=class{static{a(this,"DiagnosticData")}constructor(e,r,n,o,s,c){this.documentUri=e,this.message=r,this.severity=n,this.range=o,this.code=s,this.source=c}toString(){return`${this.severity.toUpperCase()}: ${this.message} (${this.range})`}equals(e){return(0,qSc.isEqual)(this.documentUri,e.documentUri)&&this.message===e.message&&this.severity===e.severity&&this.range.equals(e.range)&&this.code===e.code&&this.source===e.source}};Sbt.DiagnosticData=C5r});var _V=I(uEe=>{"use strict";p();Object.defineProperty(uEe,"__esModule",{value:!0});uEe.ResponseTags=uEe.PromptTags=void 0;var JUi;(function(t){t.CURSOR="<|cursor|>";function e(n){return{start:`<|${n}|>`,end:`<|/${n}|>`}}a(e,"createTag"),t.EDIT_WINDOW=e("code_to_edit"),t.AREA_AROUND=e("area_around_code_to_edit"),t.CURRENT_FILE=e("current_file_content"),t.CURSOR_LOCATION=e("cursor_location"),t.EDIT_HISTORY=e("edit_diff_history"),t.RECENT_FILES=e("recently_viewed_code_snippets"),t.RECENT_FILE=e("recently_viewed_code_snippet");function r(n){return e(n)}a(r,"createLintTag"),t.createLintTag=r})(JUi||(uEe.PromptTags=JUi={}));var ZUi;(function(t){t.NO_EDIT="",t.NO_CHANGE={start:""},t.EDIT={start:"",end:""},t.INSERT={start:"",end:""}})(ZUi||(uEe.ResponseTags=ZUi={}))});var x5r=I(m9=>{"use strict";p();var jSc=m9&&m9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},HSc=m9&&m9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(m9,"__esModule",{value:!0});m9.LintErrors=void 0;var GSc=KUi(),ok=Ay(),$Sc=F$(),VSc=Rs(),b5r=s2(),WSc=nh(),e7i=Ed(),zSc=N0(),YSc=_V(),T5r=class{static{a(this,"LintErrors")}constructor(e,r,n,o){this._documentId=e,this._document=r,this._langDiagService=n,this._xtabHistory=o}_diagnostics(e){let r=e?[[e,this._langDiagService.getDiagnostics(e)]]:this._langDiagService.getAllDiagnostics(),n=this._documentId.toUri();return r.map(o=>{let[s,c]=o;return c.map(l=>{let u=new WSc.Range(l.range.start.line+1,l.range.start.character+1,l.range.end.line+1,l.range.end.character+1),d=(0,b5r.isEqual)(n,s)?Ibt.fromPositions(u.getStartPosition(),this._document.cursorPosition):void 0;return new I5r(s,l.message,l.severity===zSc.DiagnosticSeverity.Error?"error":"warning",d,u,this._document.transformer.getOffsetRange(u),l.code&&typeof l.code!="number"&&typeof l.code!="string"?l.code.value:l.code,l.source)})}).flat()}_getRelevantDiagnostics(e,r){let n=this._diagnostics(r);return n=XSc(n,e.maxLineDistance),n=XUi(n),n=S5r(n,e.warnings),n.slice(0,e.maxLints)}getFormattedLintErrors(e){let r=this._getRelevantDiagnostics(e,this._documentId.toUri()),n;if(e.nRecentFiles>0&&this._xtabHistory){let l=this._collectRecentFileUris(e.nRecentFiles),u=this._getRecentFileDiagnostics(l,e);n=[...r,...u].slice(0,e.maxLints)}else n=r;this._previousFormttedDiagnostics=n;let o=this._documentId.toUri(),s=n.map(l=>{let d=(0,b5r.isEqual)(l.documentUri,o)?e:{...e,showCode:ok.LintOptionShowCode.NO};return Tbt(l,this._document.lines,d)}).join(` +`),c=YSc.PromptTags.createLintTag(e.tagName);return`${c.start} ${s} -${c.end}`}_collectRecentFileUris(e){if(!this._xtabHistory)return[];let r=[],n=new Set,o=this._documentId;for(let s=this._xtabHistory.length-1;s>=0;--s){let c=this._xtabHistory[s];if(!(c.docId===o||n.has(c.docId))&&(r.push(c.docId.toUri()),n.add(c.docId),r.length>=e))break}return r}_getRecentFileDiagnostics(e,r){let n=[];for(let o of e){let s=this._diagnostics(o);s=ROr(s,r.warnings),s=s.slice().sort((c,l)=>c.documentRange.startLineNumber-l.documentRange.startLineNumber),n.push(...s)}return n}lineNumberInPreviousFormattedPrompt(e,r){if(!this._previousFormttedDiagnostics)throw new vbc.BugIndicatingError("No previous formatted diagnostics available to check line number against.");let n=this._documentId.toUri();for(let o of this._previousFormttedDiagnostics){if(!(0,wOr.isEqual)(o.documentUri,n))continue;if(o.documentRange.getStartPosition().lineNumber-1===r)return!0;if(e.showCode===KR.LintOptionShowCode.NO)continue;if(l9i(o.documentRange,e).contains(r))return!0}return!1}getData(){let e={tagName:"telemetry",warnings:KR.LintOptionWarning.YES,showCode:KR.LintOptionShowCode.NO,maxLints:Number.MAX_SAFE_INTEGER,maxLineDistance:Number.MAX_SAFE_INTEGER,nRecentFiles:0},r=this._diagnostics(void 0);r=ROr(r,KR.LintOptionWarning.YES),r=a9i(r),r=r.slice(0,20);let n=r.map(o=>({uri:o.documentUri.toString(),line:o.documentRange.startLineNumber,column:o.documentRange.startColumn,endLine:o.documentRange.endLineNumber,endColumn:o.documentRange.endColumn,severity:o.severity,message:o.message,code:o.code,source:o.source,lineDistance:o.distance?.lineDistance,formatted:XCt(o,this._document.lines,e),formattedCode:XCt(o,this._document.lines,{...e,showCode:KR.LintOptionShowCode.YES}),formattedCodeWithSurrounding:XCt(o,this._document.lines,{...e,showCode:KR.LintOptionShowCode.YES_WITH_SURROUNDING})}));return JSON.stringify(n)}};r9.LintErrors=kOr;r9.LintErrors=kOr=Abc([ybc(2,_bc.ILanguageDiagnosticsService)],kOr);function XCt(t,e,r){let n=Tbc(t,t.documentRange);if(r.showCode===KR.LintOptionShowCode.NO)return n;let o=Ibc(t.documentRange,r,e);return n+` +${c.end}`}_collectRecentFileUris(e){if(!this._xtabHistory)return[];let r=[],n=new Set,o=this._documentId;for(let s=this._xtabHistory.length-1;s>=0;--s){let c=this._xtabHistory[s];if(!(c.docId===o||n.has(c.docId))&&(r.push(c.docId.toUri()),n.add(c.docId),r.length>=e))break}return r}_getRecentFileDiagnostics(e,r){let n=[];for(let o of e){let s=this._diagnostics(o);s=S5r(s,r.warnings),s=s.slice().sort((c,l)=>c.documentRange.startLineNumber-l.documentRange.startLineNumber),n.push(...s)}return n}lineNumberInPreviousFormattedPrompt(e,r){if(!this._previousFormttedDiagnostics)throw new VSc.BugIndicatingError("No previous formatted diagnostics available to check line number against.");let n=this._documentId.toUri();for(let o of this._previousFormttedDiagnostics){if(!(0,b5r.isEqual)(o.documentUri,n))continue;if(o.documentRange.getStartPosition().lineNumber-1===r)return!0;if(e.showCode===ok.LintOptionShowCode.NO)continue;if(t7i(o.documentRange,e).contains(r))return!0}return!1}getData(){let e={tagName:"telemetry",warnings:ok.LintOptionWarning.YES,showCode:ok.LintOptionShowCode.NO,maxLints:Number.MAX_SAFE_INTEGER,maxLineDistance:Number.MAX_SAFE_INTEGER,nRecentFiles:0},r=this._diagnostics(void 0);r=S5r(r,ok.LintOptionWarning.YES),r=XUi(r),r=r.slice(0,20);let n=r.map(o=>({uri:o.documentUri.toString(),line:o.documentRange.startLineNumber,column:o.documentRange.startColumn,endLine:o.documentRange.endLineNumber,endColumn:o.documentRange.endColumn,severity:o.severity,message:o.message,code:o.code,source:o.source,lineDistance:o.distance?.lineDistance,formatted:Tbt(o,this._document.lines,e),formattedCode:Tbt(o,this._document.lines,{...e,showCode:ok.LintOptionShowCode.YES}),formattedCodeWithSurrounding:Tbt(o,this._document.lines,{...e,showCode:ok.LintOptionShowCode.YES_WITH_SURROUNDING})}));return JSON.stringify(n)}};m9.LintErrors=T5r;m9.LintErrors=T5r=jSc([HSc(2,$Sc.ILanguageDiagnosticsService)],T5r);function Tbt(t,e,r){let n=KSc(t,t.documentRange);if(r.showCode===ok.LintOptionShowCode.NO)return n;let o=JSc(t.documentRange,r,e);return n+` `+o.join(` -`)}a(XCt,"formatSingleDiagnostic");function Tbc(t,e){let r="";t.code&&(r=` ${t.source?t.source.toUpperCase():""}${t.code}`);let n=e.getStartPosition();return`${n.lineNumber-1}:${n.column-1} - ${t.severity}${r}: ${t.message}`}a(Tbc,"formatDiagnosticMessage");function Ibc(t,e,r){let o=l9i(t,e).intersect(new c9i.OffsetRange(0,r.length));if(!o)return[];let s=[];for(let c=o.start;cr.distance?.lineDistance!==void 0&&r.distance.lineDistance<=e)}a(wbc,"filterDiagnosticsByDistance");function a9i(t){return t.slice().sort((e,r)=>e.distance===void 0&&r.distance===void 0?0:e.distance===void 0?1:r.distance===void 0?-1:ebt.compareFn(e.distance,r.distance))}a(a9i,"sortDiagnosticsByDistance");function ROr(t,e){switch(e){case KR.LintOptionWarning.NO:return t.filter(r=>r.severity==="error");case KR.LintOptionWarning.YES:return t.filter(r=>r.severity==="error"||r.severity==="warning");case KR.LintOptionWarning.YES_IF_NO_ERRORS:{let r=t.filter(n=>n.severity==="error");return r.length>0?r:t.filter(n=>n.severity==="error"||n.severity==="warning")}}}a(ROr,"filterDiagnosticsBySeverity");var ebt=class t{static{a(this,"CursorDistance")}static compareFn(e,r){return e.lineDistance!==r.lineDistance?e.lineDistance-r.lineDistance:e.columnDistance-r.columnDistance}static fromPositions(e,r){return new t(Math.abs(e.lineNumber-r.lineNumber),Math.abs(e.column-r.column))}constructor(e,r){this.lineDistance=e,this.columnDistance=r}},POr=class extends Ebc.DiagnosticData{static{a(this,"DiagnosticDataWithDistance")}constructor(e,r,n,o,s,c,l,u){super(e,r,n,c,l,u),this.distance=o,this.documentRange=s}}});var Yye=I(tbt=>{"use strict";p();Object.defineProperty(tbt,"__esModule",{value:!0});tbt.toUniquePath=kbc;tbt.countTokensForLines=Pbc;var Rbc=tJ();function kbc(t,e){let r=t.path,n=e===void 0?void 0:e.endsWith("/")?e:e+"/",o=n!==void 0&&r.startsWith(n)?r.substring(n.length):r;return t.toUri().scheme===Rbc.Schemas.vscodeNotebookCell?`${o}#${t.fragment}`:o}a(kbc,"toUniquePath");function Pbc(t,e){return t.reduce((r,n)=>r+e(n)+1,0)}a(Pbc,"countTokensForLines")});var u9i=I(NOr=>{"use strict";p();Object.defineProperty(NOr,"__esModule",{value:!0});NOr.getEditDiffHistory=Mbc;var Dbc=iN(),lV=Sl(),Nbc=Yye();function Mbc(t,e,r,n,{onlyForDocsInPrompt:o,maxTokens:s,nEntries:c,useRelativePaths:l}){let u=l?t.workspaceRoot?.path:void 0,d=e.slice().reverse(),f=s,h=0,m=[];for(let y of d){if(m.length>=c)break;if(y.kind==="visibleRanges"||o&&!r.has(y.docId))continue;let E=Obc(y,u);if(E===null)continue;let _=n(E);if(f-=_,f<0)break;h+=_,m.push(E)}let g=m.reverse(),A=g.join(` +`)}a(Tbt,"formatSingleDiagnostic");function KSc(t,e){let r="";t.code&&(r=` ${t.source?t.source.toUpperCase():""}${t.code}`);let n=e.getStartPosition();return`${n.lineNumber-1}:${n.column-1} - ${t.severity}${r}: ${t.message}`}a(KSc,"formatDiagnosticMessage");function JSc(t,e,r){let o=t7i(t,e).intersect(new e7i.OffsetRange(0,r.length));if(!o)return[];let s=[];for(let c=o.start;cr.distance?.lineDistance!==void 0&&r.distance.lineDistance<=e)}a(XSc,"filterDiagnosticsByDistance");function XUi(t){return t.slice().sort((e,r)=>e.distance===void 0&&r.distance===void 0?0:e.distance===void 0?1:r.distance===void 0?-1:Ibt.compareFn(e.distance,r.distance))}a(XUi,"sortDiagnosticsByDistance");function S5r(t,e){switch(e){case ok.LintOptionWarning.NO:return t.filter(r=>r.severity==="error");case ok.LintOptionWarning.YES:return t.filter(r=>r.severity==="error"||r.severity==="warning");case ok.LintOptionWarning.YES_IF_NO_ERRORS:{let r=t.filter(n=>n.severity==="error");return r.length>0?r:t.filter(n=>n.severity==="error"||n.severity==="warning")}}}a(S5r,"filterDiagnosticsBySeverity");var Ibt=class t{static{a(this,"CursorDistance")}static compareFn(e,r){return e.lineDistance!==r.lineDistance?e.lineDistance-r.lineDistance:e.columnDistance-r.columnDistance}static fromPositions(e,r){return new t(Math.abs(e.lineNumber-r.lineNumber),Math.abs(e.column-r.column))}constructor(e,r){this.lineDistance=e,this.columnDistance=r}},I5r=class extends GSc.DiagnosticData{static{a(this,"DiagnosticDataWithDistance")}constructor(e,r,n,o,s,c,l,u){super(e,r,n,c,l,u),this.distance=o,this.documentRange=s}}});var dEe=I(xbt=>{"use strict";p();Object.defineProperty(xbt,"__esModule",{value:!0});xbt.toUniquePath=tTc;xbt.countTokensForLines=rTc;var eTc=dJ();function tTc(t,e){let r=t.path,n=e===void 0?void 0:e.endsWith("/")?e:e+"/",o=n!==void 0&&r.startsWith(n)?r.substring(n.length):r;return t.toUri().scheme===eTc.Schemas.vscodeNotebookCell?`${o}#${t.fragment}`:o}a(tTc,"toUniquePath");function rTc(t,e){return t.reduce((r,n)=>r+e(n)+1,0)}a(rTc,"countTokensForLines")});var r7i=I(w5r=>{"use strict";p();Object.defineProperty(w5r,"__esModule",{value:!0});w5r.getEditDiffHistory=oTc;var nTc=fN(),vV=Sl(),iTc=dEe();function oTc(t,e,r,n,{onlyForDocsInPrompt:o,maxTokens:s,nEntries:c,useRelativePaths:l}){let u=l?t.workspaceRoot?.path:void 0,d=e.slice().reverse(),f=s,h=0,m=[];for(let y of d){if(m.length>=c)break;if(y.kind==="visibleRanges"||o&&!r.has(y.docId))continue;let E=sTc(y,u);if(E===null)continue;let _=n(E);if(f-=_,f<0)break;h+=_,m.push(E)}let g=m.reverse(),A=g.join(` `);return g.length>0&&(A+=` -`),{promptPiece:A,nDiffs:m.length,totalTokens:h}}a(Mbc,"getEditDiffHistory");function Obc(t,e){let r=[],n=Dbc.RootedEdit.toLineEdit(t.edit),o=t.edit.base.getLines();for(let u of(0,lV.groupAdjacentBy)(n.replacements,(d,f)=>d.lineRange.endLineNumberExclusive>=f.lineRange.startLineNumber)){let d=[],f=[],h=u[0].lineRange.startLineNumber;for(let g of u){if(hg.trim().length===0)&&f.every(g=>g.trim().length===0)||d.length===f.length&&d.every((g,A)=>g===f[A]))continue;let m=u[0].lineRange.startLineNumber-1;r.push(`@@ -${m},${d.length} +${m},${f.length} @@`),(0,lV.pushMany)(r,d.map(g=>`-${g}`)),(0,lV.pushMany)(r,f.map(g=>`+${g}`))}if(r.length===0)return null;let s=(0,Nbc.toUniquePath)(t.docId,e),c=[`--- ${s}`,`+++ ${s}`];return(0,lV.pushMany)(c,r),c.join(` -`)}a(Obc,"generateDocDiff")});var MOr=I(uV=>{"use strict";p();Object.defineProperty(uV,"__esModule",{value:!0});uV.count=Lbc;uV.findInsertionIndexInSortedArray=Bbc;uV.max=Fbc;uV.filterMap=Ubc;uV.min=Qbc;uV.batchArrayElements=qbc;function Lbc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(Lbc,"count");function Bbc(t,e,r){let n=0,o=t.length;for(;n>>1;r(t[s],e)?n=s+1:o=s}return n}a(Bbc,"findInsertionIndexInSortedArray");function Fbc(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n0&&(r=o)}return r}a(Fbc,"max");function Ubc(t,e){let r=[];for(let n of t){let o=e(n);o!=null&&r.push(o)}return r}a(Ubc,"filterMap");function Qbc(t){if(t.length===0)return 1/0;let e=t[0];for(let r=1;r{"use strict";p();var jbc=XE&&XE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Hbc=XE&&XE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Gbc=XE&&XE.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oQOr(A.entries)):d=p9i(e,t.id,c,l).map(A=>m9i(A));let{snippets:f,docsInPrompt:h}=v9i(d,n,o);r&&g9i(r,f,o.languageContext.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers);let m;return o.neighborFiles.enabled&&s&&s.length>0&&(m=A9i(s,f,h,o.neighborFiles.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers)),{codeSnippets:f.join(` +`),{promptPiece:A,nDiffs:m.length,totalTokens:h}}a(oTc,"getEditDiffHistory");function sTc(t,e){let r=[],n=nTc.RootedEdit.toLineEdit(t.edit),o=t.edit.base.getLines();for(let u of(0,vV.groupAdjacentBy)(n.replacements,(d,f)=>d.lineRange.endLineNumberExclusive>=f.lineRange.startLineNumber)){let d=[],f=[],h=u[0].lineRange.startLineNumber;for(let g of u){if(hg.trim().length===0)&&f.every(g=>g.trim().length===0)||d.length===f.length&&d.every((g,A)=>g===f[A]))continue;let m=u[0].lineRange.startLineNumber-1;r.push(`@@ -${m},${d.length} +${m},${f.length} @@`),(0,vV.pushMany)(r,d.map(g=>`-${g}`)),(0,vV.pushMany)(r,f.map(g=>`+${g}`))}if(r.length===0)return null;let s=(0,iTc.toUniquePath)(t.docId,e),c=[`--- ${s}`,`+++ ${s}`];return(0,vV.pushMany)(c,r),c.join(` +`)}a(sTc,"generateDocDiff")});var R5r=I(CV=>{"use strict";p();Object.defineProperty(CV,"__esModule",{value:!0});CV.count=aTc;CV.findInsertionIndexInSortedArray=cTc;CV.max=lTc;CV.filterMap=uTc;CV.min=dTc;CV.batchArrayElements=fTc;function aTc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(aTc,"count");function cTc(t,e,r){let n=0,o=t.length;for(;n>>1;r(t[s],e)?n=s+1:o=s}return n}a(cTc,"findInsertionIndexInSortedArray");function lTc(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n0&&(r=o)}return r}a(lTc,"max");function uTc(t,e){let r=[];for(let n of t){let o=e(n);o!=null&&r.push(o)}return r}a(uTc,"filterMap");function dTc(t){if(t.length===0)return 1/0;let e=t[0];for(let r=1;r{"use strict";p();var pTc=i_&&i_.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hTc=i_&&i_.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mTc=i_&&i_.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oO5r(A.entries)):d=o7i(e,t.id,c,l).map(A=>a7i(A));let{snippets:f,docsInPrompt:h}=p7i(d,n,o);r&&c7i(r,f,o.languageContext.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers);let m;return o.neighborFiles.enabled&&s&&s.length>0&&(m=l7i(s,f,h,o.neighborFiles.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers)),{codeSnippets:f.join(` -`),documents:h,neighborSnippetsResult:m}}a(Kbc,"getRecentCodeSnippets");function Jbc(t,e,r){switch(e){case OOr.IncludeLineNumbersOption.WithSpaceAfter:return t.map((n,o)=>`${r+o}| ${n}`);case OOr.IncludeLineNumbersOption.WithoutSpace:return t.map((n,o)=>`${r+o}|${n}`);case OOr.IncludeLineNumbersOption.None:return t;default:(0,Vbc.assertNever)(e)}}a(Jbc,"formatLinesWithLineNumbers");function rbt(t,e,r){let n=(0,FOr.toUniquePath)(t,void 0),o=r.truncated?`code_snippet_file_path: ${n} (truncated)`:`code_snippet_file_path: ${n}`,c=Jbc(e,r.includeLineNumbers,r.startLineOffset).join(` -`);return[d9i.PromptTags.RECENT_FILE.start,o,c,d9i.PromptTags.RECENT_FILE.end].join(` -`)}a(rbt,"formatCodeSnippet");function p9i(t,e,r,n){let o=[],s=new Set;for(let c=t.length-1;c>=0;--c){let l=t[c];if(!(!r&&l.kind==="visibleRanges")&&!(l.docId===e||s.has(l.docId))&&(o.push(l),s.add(l.docId),o.length>=n))break}return o}a(p9i,"collectRecentDocuments");function h9i(t,e,r,n){let o=[],s=new Map;for(let c=t.length-1;c>=0;--c){let l=t[c];if(!r&&l.kind==="visibleRanges"||l.docId===e)continue;let u=s.get(l.docId);if(u)u.push(l);else{if(o.length>=n)continue;o.push(l.docId),s.set(l.docId,[l])}}return o.map(c=>({docId:c,entries:s.get(c)}))}a(h9i,"collectRecentDocumentsGrouped");function Zbc(t,e,r){let{includeViewedFiles:n,nDocuments:o,clippingStrategy:s}=r.recentlyViewedDocuments;return s===BOr.RecentFileClippingStrategy.Proportional?h9i(e,t.id,n,o).map(u=>QOr(u.entries)):p9i(e,t.id,n,o).map(l=>m9i(l))}a(Zbc,"prepareRecentCodeSnippets");function UOr(t,e,r){if(t.length<=1)return t;let n=[t[0]],o=e(t[0].start),s=e(Math.max(t[0].start,t[0].endExclusive-1));for(let c=1;cr)break;n.push(l),o=f,s=h}return n}a(UOr,"selectFocalRangesWithinSpanCap");function m9i(t){if(t.kind==="edit"){let e=t.edit.edit.applyOnText(t.edit.base);return{id:t.docId,content:e,focalRanges:t.edit.edit.getNewRanges(),editEntryCount:1}}return{id:t.docId,content:t.documentContent,focalRanges:t.visibleRanges}}a(m9i,"historyEntryToCodeSnippet");function QOr(t){let e=t[0],r=e.kind==="edit"?e.edit.edit.applyOnText(e.edit.base):e.documentContent,n=[];for(let s of t)s.kind==="edit"&&n.push(s);let o=[];for(let s=0;s=0;l--)c=c.map(u=>n[l].edit.edit.applyToOffsetRange(u));o.push(...c)}return{id:e.docId,content:r,focalRanges:o.length>0?o:void 0,editEntryCount:Math.max(n.length,1)}}a(QOr,"historyEntriesToCodeSnippet");function g9i(t,e,r,n,o){let s=r;for(let c of t.items){if(c.onTimeout)continue;let l=c.context;if(l.kind===$bc.ContextKind.Snippet){let u=l.value,d=r-n(u);if(d<0)break;let f=LOr.DocumentId.create(l.uri.toString());e.push(rbt(f,u.split(/\r?\n/),{truncated:!1,includeLineNumbers:o,startLineOffset:0})),r=d}}return s-r}a(g9i,"appendLanguageContextSnippets");function A9i(t,e,r,n,o,s){let c=n,l=[];for(let d=t.length-1;d>=0;d--){let f=t[d],h=LOr.DocumentId.create(f.uri);if(r.has(h))continue;let m=n-o(f.snippet);m<0||(l.push({snippet:f,originalIndex:d}),r.add(h),n=m)}for(let d=l.length-1;d>=0;d--){let f=l[d].snippet;e.push(rbt(LOr.DocumentId.create(f.uri),f.snippet.split(/\r?\n/),{truncated:!1,includeLineNumbers:s,startLineOffset:f.lineRange.startLine}))}let u=l.map(d=>d.originalIndex).sort((d,f)=>d-f);return{nComputed:t.length,nIncluded:l.length,includedIndices:u,tokensConsumed:c-n}}a(A9i,"appendNeighborFileSnippets");function y9i(t,e,r,n,o,s,c){let l=n,u=[];for(let d of e){let f=l-(0,FOr.countTokensForLines)(d,o);if(f<0)break;u.push(...d),l=f}if(u.length>0){let d=u.length!==r;c.docsInPrompt.add(t.id),c.snippets.push(rbt(t.id,u,{truncated:d,includeLineNumbers:s,startLineOffset:0}))}return l}a(y9i,"clipFullDocument");function E9i(t,e,r,n){let o=t.getTransformer(),s=r*3,c=UOr(e,y=>o.getPosition(y).lineNumber,s);if(c.length===0)return;let l=Math.min(...c.map(y=>y.start)),u=Math.max(...c.map(y=>y.endExclusive-1)),d=o.getPosition(l).lineNumber,f=o.getPosition(u).lineNumber,h=t.getLines(),m=Math.floor((d-1)/r),g=Math.floor((f-1)/r),A=0;for(let y=m;y<=g;y++){let E=y*r,_=Math.min(E+r,h.length);A+=(0,FOr.countTokensForLines)(h.slice(E,_),n)}return A}a(E9i,"computeFocalPageCost");function _9i(t,e,r,n,o,s,c,l){if(n<=0)return;let u=t.content.getTransformer(),d=e*3,f=UOr(t.focalRanges,T=>u.getPosition(T).lineNumber,d);if(f.length===0)return n;let h=Math.min(...f.map(T=>T.start)),m=Math.max(...f.map(T=>T.endExclusive-1)),g=u.getPosition(h),A=u.getPosition(m),{firstPageIdx:y,lastPageIdxIncl:E,budgetLeft:_}=(0,Ybc.expandRangeToPageRange)(t.content.getLines(),new zbc.OffsetRange(g.lineNumber-1,A.lineNumber),e,n,o,!1,c);if(_===n||_<0)return;let v=y*e,b=t.content.getLines().slice(v,(E+1)*e);return l.docsInPrompt.add(t.id),l.snippets.push(rbt(t.id,b,{truncated:b.lengthE.focalRanges!==void 0&&E.focalRanges.length>0?E9i(E.content,E.focalRanges,n,e)??0:0),d=t.length,f=u.reduce((E,_)=>E+_,0);for(;d>0&&f>s;)d--,f-=u[d];if(d===0)return{snippets:[],docsInPrompt:new Set,tokensConsumed:0};let h=s-f,m=t.slice(0,d).map(E=>E.editEntryCount??1),g=m.reduce((E,_)=>E+_,0),A=m.map(E=>Math.floor(h*(E/g))),y=0;for(let E=0;E0)y=_9i(_,n,v.length,b,e,c,l,o)??b;else{let T=(0,f9i.batchArrayElements)(v,n);y=y9i(_,T,v.length,b,e,c,o)}}return{snippets:o.snippets.reverse(),docsInPrompt:o.docsInPrompt,tokensConsumed:s-y}}a(e1c,"buildCodeSnippetsWithProportionalBudget")});var nbt=I(Zd=>{"use strict";p();var t1c=Zd&&Zd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),r1c=Zd&&Zd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),n1c=Zd&&Zd.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o`${r+o}| ${n}`);case k5r.IncludeLineNumbersOption.WithoutSpace:return t.map((n,o)=>`${r+o}|${n}`);case k5r.IncludeLineNumbersOption.None:return t;default:(0,ATc.assertNever)(e)}}a(CTc,"formatLinesWithLineNumbers");function wbt(t,e,r){let n=(0,N5r.toUniquePath)(t,void 0),o=r.truncated?`code_snippet_file_path: ${n} (truncated)`:`code_snippet_file_path: ${n}`,c=CTc(e,r.includeLineNumbers,r.startLineOffset).join(` +`);return[n7i.PromptTags.RECENT_FILE.start,o,c,n7i.PromptTags.RECENT_FILE.end].join(` +`)}a(wbt,"formatCodeSnippet");function o7i(t,e,r,n){let o=[],s=new Set;for(let c=t.length-1;c>=0;--c){let l=t[c];if(!(!r&&l.kind==="visibleRanges")&&!(l.docId===e||s.has(l.docId))&&(o.push(l),s.add(l.docId),o.length>=n))break}return o}a(o7i,"collectRecentDocuments");function s7i(t,e,r,n){let o=[],s=new Map;for(let c=t.length-1;c>=0;--c){let l=t[c];if(!r&&l.kind==="visibleRanges"||l.docId===e)continue;let u=s.get(l.docId);if(u)u.push(l);else{if(o.length>=n)continue;o.push(l.docId),s.set(l.docId,[l])}}return o.map(c=>({docId:c,entries:s.get(c)}))}a(s7i,"collectRecentDocumentsGrouped");function bTc(t,e,r){let{includeViewedFiles:n,nDocuments:o,clippingStrategy:s}=r.recentlyViewedDocuments;return s===D5r.RecentFileClippingStrategy.Proportional?s7i(e,t.id,n,o).map(u=>O5r(u.entries)):o7i(e,t.id,n,o).map(l=>a7i(l))}a(bTc,"prepareRecentCodeSnippets");function M5r(t,e,r){if(t.length<=1)return t;let n=[t[0]],o=e(t[0].start),s=e(Math.max(t[0].start,t[0].endExclusive-1));for(let c=1;cr)break;n.push(l),o=f,s=h}return n}a(M5r,"selectFocalRangesWithinSpanCap");function a7i(t){if(t.kind==="edit"){let e=t.edit.edit.applyOnText(t.edit.base);return{id:t.docId,content:e,focalRanges:t.edit.edit.getNewRanges(),editEntryCount:1}}return{id:t.docId,content:t.documentContent,focalRanges:t.visibleRanges}}a(a7i,"historyEntryToCodeSnippet");function O5r(t){let e=t[0],r=e.kind==="edit"?e.edit.edit.applyOnText(e.edit.base):e.documentContent,n=[];for(let s of t)s.kind==="edit"&&n.push(s);let o=[];for(let s=0;s=0;l--)c=c.map(u=>n[l].edit.edit.applyToOffsetRange(u));o.push(...c)}return{id:e.docId,content:r,focalRanges:o.length>0?o:void 0,editEntryCount:Math.max(n.length,1)}}a(O5r,"historyEntriesToCodeSnippet");function c7i(t,e,r,n,o){let s=r;for(let c of t.items){if(c.onTimeout)continue;let l=c.context;if(l.kind===gTc.ContextKind.Snippet){let u=l.value,d=r-n(u);if(d<0)break;let f=P5r.DocumentId.create(l.uri.toString());e.push(wbt(f,u.split(/\r?\n/),{truncated:!1,includeLineNumbers:o,startLineOffset:0})),r=d}}return s-r}a(c7i,"appendLanguageContextSnippets");function l7i(t,e,r,n,o,s){let c=n,l=[];for(let d=t.length-1;d>=0;d--){let f=t[d],h=P5r.DocumentId.create(f.uri);if(r.has(h))continue;let m=n-o(f.snippet);m<0||(l.push({snippet:f,originalIndex:d}),r.add(h),n=m)}for(let d=l.length-1;d>=0;d--){let f=l[d].snippet;e.push(wbt(P5r.DocumentId.create(f.uri),f.snippet.split(/\r?\n/),{truncated:!1,includeLineNumbers:s,startLineOffset:f.lineRange.startLine}))}let u=l.map(d=>d.originalIndex).sort((d,f)=>d-f);return{nComputed:t.length,nIncluded:l.length,includedIndices:u,tokensConsumed:c-n}}a(l7i,"appendNeighborFileSnippets");function u7i(t,e,r,n,o,s,c){let l=n,u=[];for(let d of e){let f=l-(0,N5r.countTokensForLines)(d,o);if(f<0)break;u.push(...d),l=f}if(u.length>0){let d=u.length!==r;c.docsInPrompt.add(t.id),c.snippets.push(wbt(t.id,u,{truncated:d,includeLineNumbers:s,startLineOffset:0}))}return l}a(u7i,"clipFullDocument");function d7i(t,e,r,n){let o=t.getTransformer(),s=r*3,c=M5r(e,y=>o.getPosition(y).lineNumber,s);if(c.length===0)return;let l=Math.min(...c.map(y=>y.start)),u=Math.max(...c.map(y=>y.endExclusive-1)),d=o.getPosition(l).lineNumber,f=o.getPosition(u).lineNumber,h=t.getLines(),m=Math.floor((d-1)/r),g=Math.floor((f-1)/r),A=0;for(let y=m;y<=g;y++){let E=y*r,_=Math.min(E+r,h.length);A+=(0,N5r.countTokensForLines)(h.slice(E,_),n)}return A}a(d7i,"computeFocalPageCost");function f7i(t,e,r,n,o,s,c,l){if(n<=0)return;let u=t.content.getTransformer(),d=e*3,f=M5r(t.focalRanges,T=>u.getPosition(T).lineNumber,d);if(f.length===0)return n;let h=Math.min(...f.map(T=>T.start)),m=Math.max(...f.map(T=>T.endExclusive-1)),g=u.getPosition(h),A=u.getPosition(m),{firstPageIdx:y,lastPageIdxIncl:E,budgetLeft:_}=(0,_Tc.expandRangeToPageRange)(t.content.getLines(),new ETc.OffsetRange(g.lineNumber-1,A.lineNumber),e,n,o,!1,c);if(_===n||_<0)return;let v=y*e,b=t.content.getLines().slice(v,(E+1)*e);return l.docsInPrompt.add(t.id),l.snippets.push(wbt(t.id,b,{truncated:b.lengthE.focalRanges!==void 0&&E.focalRanges.length>0?d7i(E.content,E.focalRanges,n,e)??0:0),d=t.length,f=u.reduce((E,_)=>E+_,0);for(;d>0&&f>s;)d--,f-=u[d];if(d===0)return{snippets:[],docsInPrompt:new Set,tokensConsumed:0};let h=s-f,m=t.slice(0,d).map(E=>E.editEntryCount??1),g=m.reduce((E,_)=>E+_,0),A=m.map(E=>Math.floor(h*(E/g))),y=0;for(let E=0;E0)y=f7i(_,n,v.length,b,e,c,l,o)??b;else{let T=(0,i7i.batchArrayElements)(v,n);y=u7i(_,T,v.length,b,e,c,o)}}return{snippets:o.snippets.reverse(),docsInPrompt:o.docsInPrompt,tokensConsumed:s-y}}a(TTc,"buildCodeSnippetsWithProportionalBudget")});var Rbt=I(nf=>{"use strict";p();var ITc=nf&&nf.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xTc=nf&&nf.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),wTc=nf&&nf.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;of.add(P)),w=x.tokensConsumed;break}case"languageContext":{r&&(w=(0,LBe.appendLanguageContextSnippets)(r,u,T,n,o.recentlyViewedDocuments.includeLineNumbers));break}case"neighborFiles":{o.neighborFiles.enabled&&s&&s.length>0&&(h=(0,LBe.appendNeighborFileSnippets)(s,d,f,T,n,o.recentlyViewedDocuments.includeLineNumbers),w=h.tokensConsumed);break}case"diffHistory":{let R={...o.diffHistory,maxTokens:T},x=(0,I9i.getEditDiffHistory)(t,e,f,n,R);m=x.promptPiece,g=x.nDiffs,A=x.totalTokens,w=x.totalTokens;break}default:(0,obt.assertNever)(v)}E=Math.max(0,T-w)}return{codeSnippets:[...l,...u,...d].join(` +${o}`;break}let D=d.promptingStrategy!==eu.PromptingStrategy.Nes41Miniv3&&d.promptingStrategy!==eu.PromptingStrategy.Codexv21NesUnified&&d.promptingStrategy!==eu.PromptingStrategy.PatchBased01&&d.promptingStrategy!==eu.PromptingStrategy.PatchBased02&&d.promptingStrategy!==eu.PromptingStrategy.PatchBased02WithRecentLineNumbers&&d.promptingStrategy!==eu.PromptingStrategy.PatchBased02WithoutRecentLineNumbers?MTc(x):x;return{prompt:(OTc(v,D,d.languageContext.traitPosition)+T).trim(),nDiffsInPrompt:E,diffTokensInPrompt:_,neighborSnippetsResult:A}}a(PTc,"getUserPrompt");function DTc(t,e,r,n,o,s,c){NTc(c);let l=[],u=[],d=[],f=new Set;f.add(t.id);let h,m="",g=0,A=0,y=(0,o3e.prepareRecentCodeSnippets)(t,e,o),E=0;for(let v of c.order){let b=c.shares[v]??0,T=Math.max(0,Math.floor(E+c.totalTokens*b)),w=0;switch(v){case"recentlyViewedDocuments":{let R={...o,recentlyViewedDocuments:{...o.recentlyViewedDocuments,maxTokens:T}},x=(0,o3e.buildCodeSnippetsUsingPagedClipping)(y,n,R);l.push(...x.snippets),x.docsInPrompt.forEach(P=>f.add(P)),w=x.tokensConsumed;break}case"languageContext":{r&&(w=(0,o3e.appendLanguageContextSnippets)(r,u,T,n,o.recentlyViewedDocuments.includeLineNumbers));break}case"neighborFiles":{o.neighborFiles.enabled&&s&&s.length>0&&(h=(0,o3e.appendNeighborFileSnippets)(s,d,f,T,n,o.recentlyViewedDocuments.includeLineNumbers),w=h.tokensConsumed);break}case"diffHistory":{let R={...o.diffHistory,maxTokens:T},x=(0,y7i.getEditDiffHistory)(t,e,f,n,R);m=x.promptPiece,g=x.nDiffs,A=x.totalTokens,w=x.totalTokens;break}default:(0,Pbt.assertNever)(v)}E=Math.max(0,T-w)}return{codeSnippets:[...l,...u,...d].join(` -`),documents:f,neighborSnippetsResult:h,editDiffHistory:m,nDiffsInPrompt:g,diffTokensInPrompt:A}}a(a1c,"runGlobalBudgetCascade");function c1c(t){let e=new Set;for(let c of t.order){if(e.has(c))throw new Error(`globalBudget.order contains duplicate part '${c}'`);if(e.add(c),typeof t.shares[c]!="number")throw new Error(`globalBudget.shares is missing entry for '${c}'`)}let r=t.order.indexOf("recentlyViewedDocuments"),n=t.order.indexOf("neighborFiles");if(r!==-1&&n!==-1&&nc+t.shares[l],0);if(Math.abs(o-1)>.001)throw new Error(`globalBudget.shares across order must sum to ~1, got ${o}`)}a(c1c,"validateGlobalBudget");function l1c(t){return`\`\`\` +`),documents:f,neighborSnippetsResult:h,editDiffHistory:m,nDiffsInPrompt:g,diffTokensInPrompt:A}}a(DTc,"runGlobalBudgetCascade");function NTc(t){let e=new Set;for(let c of t.order){if(e.has(c))throw new Error(`globalBudget.order contains duplicate part '${c}'`);if(e.add(c),typeof t.shares[c]!="number")throw new Error(`globalBudget.shares is missing entry for '${c}'`)}let r=t.order.indexOf("recentlyViewedDocuments"),n=t.order.indexOf("neighborFiles");if(r!==-1&&n!==-1&&nc+t.shares[l],0);if(Math.abs(o-1)>.001)throw new Error(`globalBudget.shares across order must sum to ~1, got ${o}`)}a(NTc,"validateGlobalBudget");function MTc(t){return`\`\`\` ${t} -\`\`\``}a(l1c,"wrapInBackticks");function u1c(t,e,r){return r==="before"?S9i(t,e,2):S9i(e,t,2)}a(u1c,"addRelatedInformation");function S9i(t,e,r){let n=0;for(let s=t.length-1;s>=0&&t[s]===` +\`\`\``}a(MTc,"wrapInBackticks");function OTc(t,e,r){return r==="before"?g7i(t,e,2):g7i(e,t,2)}a(OTc,"addRelatedInformation");function g7i(t,e,r){let n=0;for(let s=t.length-1;s>=0&&t[s]===` `;s--)n++;for(let s=0;s, , or . If you are making an edit, start with and then provide the rewritten code window followed by . If you are inserting new code, start with and then provide only the new code that will be inserted at the cursor position followed by . If no changes are necessary, reply only with . Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;break;case Xl.PromptingStrategy.Nes41Miniv3:o=`The developer was working on a section of code within the tags <|code_to_edit|> in the file located at \`${e}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`<|cursor|>\`, please continue the developer's work. Update the <|code_to_edit|> section by predicting and completing the changes they would have made next. Start your response with or . If you are making an edit, start with and then provide the rewritten code window followed by . If no changes are necessary, reply only with . Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;break;case Xl.PromptingStrategy.Xtab275EditIntentShort:case Xl.PromptingStrategy.Xtab275EditIntent:case Xl.PromptingStrategy.Xtab275:o=n;break;case Xl.PromptingStrategy.XtabAggressiveness:o=`<|aggressive|>${r}<|/aggressive|>`;break;case Xl.PromptingStrategy.Xtab275Aggressiveness:o=`${n} -<|aggressive|>${r}<|/aggressive|>`;break;case Xl.PromptingStrategy.Xtab275AggressivenessHighLow:o=r===Xl.AggressivenessLevel.Medium?n:`${n} -<|aggressive|>${r}<|/aggressive|>`;break;case Xl.PromptingStrategy.PatchBased:o='Output a modified diff style format with the changes you want. Each change patch must start with `:` and then include some non empty "anchor lines" preceded by `-` and the new lines meant to replace them preceded by `+`. Put your changes in the order that makes the most sense, for example edits inside the code_to_edit region and near the user\'s <|cursor|> should always be prioritized. Output "" if you don\'t have a good edit candidate.';break;case Xl.PromptingStrategy.SimplifiedSystemPrompt:case Xl.PromptingStrategy.CopilotNesXtab:case void 0:o=`The developer was working on a section of code within the tags \`code_to_edit\` in the file located at \`${e}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`${vh.PromptTags.CURSOR}\`, please continue the developer's work. Update the \`code_to_edit\` section by predicting and completing the changes they would have made next. Provide the revised code that was between the \`${vh.PromptTags.EDIT_WINDOW.start}\` and \`${vh.PromptTags.EDIT_WINDOW.end}\` tags with the following format, but do not include the tags themselves. +`.repeat(o)+e).trim()}a(g7i,"appendWithNewLineIfNeeded");function LTc(t,e,r){let n=`The developer was working on a section of code within the tags \`code_to_edit\` in the file located at \`${e}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`${Sh.PromptTags.CURSOR}\`, please continue the developer's work. Update the \`code_to_edit\` section by predicting and completing the changes they would have made next. Provide the revised code that was between the \`${Sh.PromptTags.EDIT_WINDOW.start}\` and \`${Sh.PromptTags.EDIT_WINDOW.end}\` tags, but do not include the tags themselves. Avoid undoing or reverting the developer's last change unless there are obvious typos or errors. Don't include the line numbers or the form #| in your response. Do not skip any lines. Do not be lazy.`,o;switch(t){case eu.PromptingStrategy.PatchBased01:case eu.PromptingStrategy.Codexv21NesUnified:break;case eu.PromptingStrategy.PatchBased02:case eu.PromptingStrategy.PatchBased02WithRecentLineNumbers:case eu.PromptingStrategy.PatchBased02WithoutRecentLineNumbers:o="The developer was working on a section of code within the `current_file_content` - carefully note their `cursor_location` marked with `<|cursor|>`. Using the given `recently_viewed_code_snippets`, `current_file_content`, `edit_diff_history`, and `cursor_location`, please continue the developer's work. Output a modified diff format with a sequence of intuitive next changes, where each patch must start with `:`. Order changes by priority and flow; for instance, edits adjacent to the user's cursor should always be prioritized, followed by lines near the cursor, followed by lines farther away. If there are no good edit candidates, output the empty string \"\". Avoid undoing or reverting the developer's last change unless there are obvious typos or errors. Adhere meticulously to the diff format.";break;case eu.PromptingStrategy.UnifiedModel:o=`The developer was working on a section of code within the tags \`code_to_edit\` in the file located at \`${e}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`${Sh.PromptTags.CURSOR}\`, please continue the developer's work. Update the \`code_to_edit\` section by predicting and completing the changes they would have made next. Start your response with , , or . If you are making an edit, start with and then provide the rewritten code window followed by . If you are inserting new code, start with and then provide only the new code that will be inserted at the cursor position followed by . If no changes are necessary, reply only with . Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;break;case eu.PromptingStrategy.Nes41Miniv3:o=`The developer was working on a section of code within the tags <|code_to_edit|> in the file located at \`${e}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`<|cursor|>\`, please continue the developer's work. Update the <|code_to_edit|> section by predicting and completing the changes they would have made next. Start your response with or . If you are making an edit, start with and then provide the rewritten code window followed by . If no changes are necessary, reply only with . Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;break;case eu.PromptingStrategy.Xtab275EditIntentShort:case eu.PromptingStrategy.Xtab275EditIntent:case eu.PromptingStrategy.Xtab275:o=n;break;case eu.PromptingStrategy.XtabAggressiveness:o=`<|aggressive|>${r}<|/aggressive|>`;break;case eu.PromptingStrategy.Xtab275Aggressiveness:o=`${n} +<|aggressive|>${r}<|/aggressive|>`;break;case eu.PromptingStrategy.Xtab275AggressivenessHighLow:o=r===eu.AggressivenessLevel.Medium?n:`${n} +<|aggressive|>${r}<|/aggressive|>`;break;case eu.PromptingStrategy.PatchBased:o='Output a modified diff style format with the changes you want. Each change patch must start with `:` and then include some non empty "anchor lines" preceded by `-` and the new lines meant to replace them preceded by `+`. Put your changes in the order that makes the most sense, for example edits inside the code_to_edit region and near the user\'s <|cursor|> should always be prioritized. Output "" if you don\'t have a good edit candidate.';break;case eu.PromptingStrategy.SimplifiedSystemPrompt:case eu.PromptingStrategy.CopilotNesXtab:case void 0:o=`The developer was working on a section of code within the tags \`code_to_edit\` in the file located at \`${e}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`${Sh.PromptTags.CURSOR}\`, please continue the developer's work. Update the \`code_to_edit\` section by predicting and completing the changes they would have made next. Provide the revised code that was between the \`${Sh.PromptTags.EDIT_WINDOW.start}\` and \`${Sh.PromptTags.EDIT_WINDOW.end}\` tags with the following format, but do not include the tags themselves. \`\`\` // Your revised code goes here -\`\`\``;break;default:(0,obt.assertNever)(t)}return o===void 0?"":` +\`\`\``;break;default:(0,Pbt.assertNever)(t)}return o===void 0?"":` -${o}`}a(d1c,"getPostScript");function f1c(t){if(t===void 0)return"";let e=t.items.filter(n=>n.context.kind===i1c.ContextKind.Trait).map(n=>n.context);if(e.length===0)return"";let r=[];for(let n of e)r.push(`${n.name}: ${n.value}`);return`Consider this related information: +${o}`}a(LTc,"getPostScript");function BTc(t){if(t===void 0)return"";let e=t.items.filter(n=>n.context.kind===RTc.ContextKind.Trait).map(n=>n.context);if(e.length===0)return"";let r=[];for(let n of e)r.push(`${n.name}: ${n.value}`);return`Consider this related information: ${r.join(` -`)}`}a(f1c,"getRelatedInformation");function p1c(t,e,r){if(!t.length)return[0,0];let n=r*4,o=0,s=e?t.length-1:0;for(;o=t.length)break;return e?[s+1,t.length]:[0,s]}a(p1c,"truncateCode");Zd.N_LINES_ABOVE=2;Zd.N_LINES_BELOW=5;Zd.N_LINES_AS_CONTEXT=15;function x9i(t,e,r,n,o,s,c){let l=Math.ceil(t.length/r);function u(g){let A=g*r,y=Math.min(A+r,t.length),E=t.slice(A,y);return(0,GOr.countTokensForLines)(E,o)}a(u,"computeTokensForPage");let d=Math.floor(e.start/r),f=Math.floor((e.endExclusive-1)/r),h=n-(0,o1c.range)(d,f+1).reduce((g,A)=>g+u(A),0);if(h<0)return{firstPageIdx:d,lastPageIdxIncl:f,budgetLeft:h};let m=h;if(s){m=h;for(let g=d-1;g>=0&&m>0;--g){let A=u(g),y=m-A;if(y<0)break;d=g,m=y}for(let g=f+1;g0;++g){let A=u(g),y=m-A;if(y<0)break;f=g,m=y}}else{let g=Math.floor(h/2);m=g;for(let y=d-1;y>=0&&m>0;--y){let E=u(y),_=m-E;if(_<0)break;d=y,m=_}m=g+(c?m:0);for(let y=f+1;y0;++y){let E=u(y),_=m-E;if(_<0)break;f=y,m=_}}return{firstPageIdx:d,lastPageIdxIncl:f,budgetLeft:m}}a(x9i,"expandRangeToPageRange");function w9i(t,e,r,n,o){let s=t.slice(e.start,e.endExclusive),c=o.maxTokens-(0,GOr.countTokensForLines)(s,r);if(c<0)return jOr.Result.error("outOfBudget");let{firstPageIdx:l,lastPageIdxIncl:u}=x9i(t,e,n,c,r,o.prioritizeAboveCursor,o.useLeftoverBudgetFromAbove),d=l*n,f=(u+1)*n;return jOr.Result.ok(new T9i.OffsetRange(d,f))}a(w9i,"clipPreservingRange");var ibt=class{static{a(this,"ClippedDocument")}constructor(e,r){this.lines=e,this.keptRange=r}};Zd.ClippedDocument=ibt;function R9i(t,e,r,n,o,s){let c=w9i(t,r,n,o,s);if(c.isError())return c;let l=c.val,u=[...t.slice(l.start,r.start),...e,...t.slice(r.endExclusive,l.endExclusive)],d=new T9i.OffsetRange(l.start,l.start+u.length);return jOr.Result.ok(new ibt(u,d))}a(R9i,"createTaggedCurrentFileContentUsingPagedClipping");function qOr(t,e){switch(e){case Kye.IncludeLineNumbersOption.WithSpaceAfter:return t.map((r,n)=>`${n}| ${r}`);case Kye.IncludeLineNumbersOption.WithoutSpace:return t.map((r,n)=>`${n}|${r}`);case Kye.IncludeLineNumbersOption.None:return[...t];default:(0,obt.assertNever)(e)}}a(qOr,"addLineNumbers");function h1c(t,e,r,n,o,s){let c=b9i.StringEdit.single(b9i.StringReplacement.insert(t.cursorOffset,vh.PromptTags.CURSOR)).applyOnText(t.content).getLines(),l=qOr(c,s.includeLineNumbers.areaAroundCodeToEdit),u=l.slice(e.start,e.endExclusive),d=[vh.PromptTags.AREA_AROUND.start,...l.slice(r.start,e.start),vh.PromptTags.EDIT_WINDOW.start,...u,vh.PromptTags.EDIT_WINDOW.end,...l.slice(e.endExclusive,r.endExclusive),vh.PromptTags.AREA_AROUND.end],f=n.currentFile.includeCursorTag?c:t.lines,h=qOr(f,s.includeLineNumbers.currentFileContent),m=qOr(t.lines,s.includeLineNumbers.currentFileContent),g;if(n.currentFile.includeTags&&s.includeLineNumbers.currentFileContent===s.includeLineNumbers.areaAroundCodeToEdit)g=d;else{let y=h.slice(e.start,e.endExclusive);g=[...h.slice(r.start,e.start),...y,...h.slice(e.endExclusive,r.endExclusive)]}return R9i(m,g,r,o,n.pagedClipping.pageSize,n.currentFile).map(y=>({clippedTaggedCurrentDoc:y,areaAroundCodeToEdit:d.join(` -`)}))}a(h1c,"constructTaggedFile")});var k9i=I(JR=>{"use strict";p();Object.defineProperty(JR,"__esModule",{value:!0});JR.xtab275SystemPrompt=JR.simplifiedPrompt=JR.nes41Miniv3SystemPrompt=JR.unifiedModelSystemPrompt=JR.systemPromptTemplate=void 0;var dV=cV();JR.systemPromptTemplate=`Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the ${dV.PromptTags.EDIT_WINDOW.start} and ${dV.PromptTags.EDIT_WINDOW.end} tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. +`)}`}a(BTc,"getRelatedInformation");function FTc(t,e,r){if(!t.length)return[0,0];let n=r*4,o=0,s=e?t.length-1:0;for(;o=t.length)break;return e?[s+1,t.length]:[0,s]}a(FTc,"truncateCode");nf.N_LINES_ABOVE=2;nf.N_LINES_BELOW=5;nf.N_LINES_AS_CONTEXT=15;function E7i(t,e,r,n,o,s,c){let l=Math.ceil(t.length/r);function u(g){let A=g*r,y=Math.min(A+r,t.length),E=t.slice(A,y);return(0,U5r.countTokensForLines)(E,o)}a(u,"computeTokensForPage");let d=Math.floor(e.start/r),f=Math.floor((e.endExclusive-1)/r),h=n-(0,kTc.range)(d,f+1).reduce((g,A)=>g+u(A),0);if(h<0)return{firstPageIdx:d,lastPageIdxIncl:f,budgetLeft:h};let m=h;if(s){m=h;for(let g=d-1;g>=0&&m>0;--g){let A=u(g),y=m-A;if(y<0)break;d=g,m=y}for(let g=f+1;g0;++g){let A=u(g),y=m-A;if(y<0)break;f=g,m=y}}else{let g=Math.floor(h/2);m=g;for(let y=d-1;y>=0&&m>0;--y){let E=u(y),_=m-E;if(_<0)break;d=y,m=_}m=g+(c?m:0);for(let y=f+1;y0;++y){let E=u(y),_=m-E;if(_<0)break;f=y,m=_}}return{firstPageIdx:d,lastPageIdxIncl:f,budgetLeft:m}}a(E7i,"expandRangeToPageRange");function _7i(t,e,r,n,o){let s=t.slice(e.start,e.endExclusive),c=o.maxTokens-(0,U5r.countTokensForLines)(s,r);if(c<0)return B5r.Result.error("outOfBudget");let{firstPageIdx:l,lastPageIdxIncl:u}=E7i(t,e,n,c,r,o.prioritizeAboveCursor,o.useLeftoverBudgetFromAbove),d=l*n,f=(u+1)*n;return B5r.Result.ok(new A7i.OffsetRange(d,f))}a(_7i,"clipPreservingRange");var kbt=class{static{a(this,"ClippedDocument")}constructor(e,r){this.lines=e,this.keptRange=r}};nf.ClippedDocument=kbt;function v7i(t,e,r,n,o,s){let c=_7i(t,r,n,o,s);if(c.isError())return c;let l=c.val,u=[...t.slice(l.start,r.start),...e,...t.slice(r.endExclusive,l.endExclusive)],d=new A7i.OffsetRange(l.start,l.start+u.length);return B5r.Result.ok(new kbt(u,d))}a(v7i,"createTaggedCurrentFileContentUsingPagedClipping");function L5r(t,e){switch(e){case fEe.IncludeLineNumbersOption.WithSpaceAfter:return t.map((r,n)=>`${n}| ${r}`);case fEe.IncludeLineNumbersOption.WithoutSpace:return t.map((r,n)=>`${n}|${r}`);case fEe.IncludeLineNumbersOption.None:return[...t];default:(0,Pbt.assertNever)(e)}}a(L5r,"addLineNumbers");function UTc(t,e,r,n,o,s){let c=m7i.StringEdit.single(m7i.StringReplacement.insert(t.cursorOffset,Sh.PromptTags.CURSOR)).applyOnText(t.content).getLines(),l=L5r(c,s.includeLineNumbers.areaAroundCodeToEdit),u=l.slice(e.start,e.endExclusive),d=[Sh.PromptTags.AREA_AROUND.start,...l.slice(r.start,e.start),Sh.PromptTags.EDIT_WINDOW.start,...u,Sh.PromptTags.EDIT_WINDOW.end,...l.slice(e.endExclusive,r.endExclusive),Sh.PromptTags.AREA_AROUND.end],f=n.currentFile.includeCursorTag?c:t.lines,h=L5r(f,s.includeLineNumbers.currentFileContent),m=L5r(t.lines,s.includeLineNumbers.currentFileContent),g;if(n.currentFile.includeTags&&s.includeLineNumbers.currentFileContent===s.includeLineNumbers.areaAroundCodeToEdit)g=d;else{let y=h.slice(e.start,e.endExclusive);g=[...h.slice(r.start,e.start),...y,...h.slice(e.endExclusive,r.endExclusive)]}return v7i(m,g,r,o,n.pagedClipping.pageSize,n.currentFile).map(y=>({clippedTaggedCurrentDoc:y,areaAroundCodeToEdit:d.join(` +`)}))}a(UTc,"constructTaggedFile")});var C7i=I(sk=>{"use strict";p();Object.defineProperty(sk,"__esModule",{value:!0});sk.xtab275SystemPrompt=sk.simplifiedPrompt=sk.nes41Miniv3SystemPrompt=sk.unifiedModelSystemPrompt=sk.systemPromptTemplate=void 0;var bV=_V();sk.systemPromptTemplate=`Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the ${bV.PromptTags.EDIT_WINDOW.start} and ${bV.PromptTags.EDIT_WINDOW.end} tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. You have access to the following information to help you make informed suggestions: @@ -1225,9 +1225,9 @@ You have access to the following information to help you make informed suggestio - current_file_content: The content of the file the developer is currently working on, providing the broader context of the code. Line numbers in the form #| are included to help you understand the edit diff history. - edit_diff_history: A record of changes made to the code, helping you understand the evolution of the code and the developer's intentions. These changes are listed from oldest to latest. It's possible a lot of old edit diff history is entirely irrelevant to the developer's change. - area_around_code_to_edit: The context showing the code surrounding the section to be edited. -- cursor position marked as ${dV.PromptTags.CURSOR}: Indicates where the developer's cursor is currently located, which can be crucial for understanding what part of the code they are focusing on. +- cursor position marked as ${bV.PromptTags.CURSOR}: Indicates where the developer's cursor is currently located, which can be crucial for understanding what part of the code they are focusing on. -Your task is to predict and complete the changes the developer would have made next in the ${dV.PromptTags.EDIT_WINDOW.start} section. The developer may have stopped in the middle of typing. Your goal is to keep the developer on the path that you think they're following. Some examples include further implementing a class, method, or variable, or improving the quality of the code. Make sure the developer doesn't get distracted and ensure your suggestion is relevant. Consider what changes need to be made next, if any. If you think changes should be made, ask yourself if this is truly what needs to happen. If you are confident about it, then proceed with the changes. +Your task is to predict and complete the changes the developer would have made next in the ${bV.PromptTags.EDIT_WINDOW.start} section. The developer may have stopped in the middle of typing. Your goal is to keep the developer on the path that you think they're following. Some examples include further implementing a class, method, or variable, or improving the quality of the code. Make sure the developer doesn't get distracted and ensure your suggestion is relevant. Consider what changes need to be made next, if any. If you think changes should be made, ask yourself if this is truly what needs to happen. If you are confident about it, then proceed with the changes. # Steps @@ -1238,9 +1238,9 @@ Your task is to predict and complete the changes the developer would have made n # Output Format -- Provide only the revised code within the tags. If no changes are necessary, simply return the original code from within the ${dV.PromptTags.EDIT_WINDOW.start} and ${dV.PromptTags.EDIT_WINDOW.end} tags. +- Provide only the revised code within the tags. If no changes are necessary, simply return the original code from within the ${bV.PromptTags.EDIT_WINDOW.start} and ${bV.PromptTags.EDIT_WINDOW.end} tags. - There are line numbers in the form #| in the code displayed to you above, but these are just for your reference. Please do not include the numbers of the form #| in your response. -- Ensure that you do not output duplicate code that exists outside of these tags. The output should be the revised code that was between these tags and should not include the ${dV.PromptTags.EDIT_WINDOW.start} or ${dV.PromptTags.EDIT_WINDOW.end} tags. +- Ensure that you do not output duplicate code that exists outside of these tags. The output should be the revised code that was between these tags and should not include the ${bV.PromptTags.EDIT_WINDOW.start} or ${bV.PromptTags.EDIT_WINDOW.end} tags. \`\`\` // Your revised code goes here @@ -1250,7 +1250,7 @@ Your task is to predict and complete the changes the developer would have made n - Apologize with "Sorry, I can't assist with that." for requests that may breach Microsoft content guidelines. - Avoid undoing or reverting the developer's last change unless there are obvious typos or errors. -- Don't include the line numbers of the form #| in your response.`;JR.unifiedModelSystemPrompt=`Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the <|code_to_edit|> and <|/code_to_edit|> tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. +- Don't include the line numbers of the form #| in your response.`;sk.unifiedModelSystemPrompt=`Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the <|code_to_edit|> and <|/code_to_edit|> tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. You have access to the following information to help you make informed suggestions: @@ -1279,7 +1279,7 @@ Your task is to predict and complete the changes the developer would have made n # Notes - Apologize with "Sorry, I can't assist with that." for requests that may breach Microsoft content guidelines. -- Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;JR.nes41Miniv3SystemPrompt=`Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the <|code_to_edit|> and <|/code_to_edit|> tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. +- Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;sk.nes41Miniv3SystemPrompt=`Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the <|code_to_edit|> and <|/code_to_edit|> tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. You have access to the following information to help you make informed suggestions: @@ -1307,18 +1307,18 @@ Your task is to predict and complete the changes the developer would have made n # Notes - Apologize with "Sorry, I can't assist with that." for requests that may breach Microsoft content guidelines. -- Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;JR.simplifiedPrompt="Predict next code edit based on the context given by the user.";JR.xtab275SystemPrompt=`Predict the next code edit based on user context, following Microsoft content policies and avoiding copyright violations. If a request may breach guidelines, reply: "Sorry, I can't assist with that."`});var abt=I(fV=>{"use strict";p();Object.defineProperty(fV,"__esModule",{value:!0});fV.NullTerminalService=fV.ITerminalService=void 0;fV.isTerminalService=A1c;fV.isNullTerminalService=y1c;var m1c=nn(),sbt=Ic(),g1c=Ro();fV.ITerminalService=(0,m1c.createServiceIdentifier)("ITerminalService");var $Or=class t extends g1c.Disposable{static{a(this,"NullTerminalService")}constructor(){super(...arguments),this._onDidWriteTerminalData=this._register(new sbt.Emitter),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidChangeTerminalShellIntegration=this._register(new sbt.Emitter),this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidEndTerminalShellExecution=this._register(new sbt.Emitter),this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._onDidCloseTerminal=this._register(new sbt.Emitter),this.onDidCloseTerminal=this._onDidCloseTerminal.event}static{this.Instance=new t}get terminalBuffer(){return""}get terminalLastCommand(){}get terminalSelection(){return""}get terminalShellType(){return""}async getCwdForSession(e){return Promise.resolve(void 0)}async getCopilotTerminals(e){return Promise.resolve([])}getTerminalsWithSessionInfo(){throw new Error("Method not implemented.")}getToolTerminalForSession(e){throw new Error("Method not implemented.")}async associateTerminalWithSession(e,r,n){Promise.resolve()}createTerminal(e,r,n){return{}}get terminals(){return[]}getBufferForTerminal(e,r){return""}getBufferWithPid(e,r){return Promise.resolve("")}getLastCommandForTerminal(e){}contributePath(e,r,n,o){}removePathContribution(e){}};fV.NullTerminalService=$Or;function A1c(t){return t&&typeof t.createTerminal=="function"}a(A1c,"isTerminalService");function y1c(t){return t&&typeof t.createTerminal=="function"&&t.createTerminal()===void 0}a(y1c,"isNullTerminalService")});var P9i=I(n9=>{"use strict";p();var E1c=n9&&n9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},_1c=n9&&n9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(n9,"__esModule",{value:!0});n9.TerminalMonitor=void 0;var v1c=abt(),C1c=Ro(),BBe=2e3,VOr=class extends C1c.Disposable{static{a(this,"TerminalMonitor")}constructor(e){super(),this._terminalService=e,this._register(this._terminalService.onDidEndTerminalShellExecution(r=>{this._recordTerminalActivity(r)})),this._register(this._terminalService.onDidCloseTerminal(r=>{this._lastActivity?.terminal===r&&(this._lastActivity=void 0)}))}_recordTerminalActivity(e){let r=e.execution;this._lastActivity={terminal:e.terminal,terminalName:e.terminal.name,commandLine:r.commandLine?.value,cwd:b1c(r.cwd),exitCode:e.exitCode,timestamp:Date.now()}}getData(){let e=Date.now(),r=this._terminalService.terminals.length;if(!this._lastActivity)return JSON.stringify({terminalCount:r});let n=this._terminalService.getBufferForTerminal(this._lastActivity.terminal,BBe*2),o=e-this._lastActivity.timestamp,s={terminalName:this._lastActivity.terminalName,commandLine:this._lastActivity.commandLine,cwd:this._lastActivity.cwd,exitCode:this._lastActivity.exitCode,msAgo:o,buffer:n.length<=BBe?{fits:!0,content:n,length:n.length}:{fits:!1,contentStart:n.slice(0,BBe/2),contentEnd:n.slice(-BBe/2),length:n.length,truncatedChars:n.length-BBe},terminalCount:r};return JSON.stringify(s)}};n9.TerminalMonitor=VOr;n9.TerminalMonitor=VOr=E1c([_1c(0,v1c.ITerminalService)],VOr);function b1c(t){if(t!==void 0)return typeof t=="string"?t:t.fsPath}a(b1c,"formatCwd")});var D9i=I(cbt=>{"use strict";p();Object.defineProperty(cbt,"__esModule",{value:!0});cbt.CurrentDocument=void 0;var S1c=Rs(),WOr=class{static{a(this,"CurrentDocument")}constructor(e,r){this.content=e,this.cursorPosition=r,this.lines=e.getLines(),this.transformer=e.getTransformer(),this.cursorOffset=this.transformer.getOffset(r),this.cursorLineOffset=this.cursorPosition.lineNumber-1}lineWithCursor(){let e=this.lines.at(this.cursorLineOffset);if(e===void 0)throw new S1c.BugIndicatingError(`CurrentDocument#lineWithCursor: cursor is out of bounds: cursor: ${this.cursorLineOffset}, doc line count: ${this.lines.length}`);return e}textAfterCursor(){return this.lineWithCursor().substring(this.cursorPosition.column-1)}isCursorAtEndOfLine(){return this.textAfterCursor().match(/^\s*$/)!==null}};cbt.CurrentDocument=WOr});var L9i=I(lbt=>{"use strict";p();Object.defineProperty(lbt,"__esModule",{value:!0});lbt.getCurrentLine=I1c;lbt.isModelLineCompatible=x1c;var N9i=q_(),T1c=M_t();function I1c(t,e,r,n){let o=e+1,s=t.textLength.lineCount+1;if(o<1||o>s)return;let c=t.getOffset(new N9i.Position(o,1)),l=0;for(let A of r.replacements)if(A.replaceRange.endExclusive<=c)l+=A.newText.length-A.replaceRange.length;else{if(A.replaceRange.start=o.startOffset&&n.endOffset<=o.endOffset?R1c(n,o,e,r):!1}a(x1c,"isModelLineCompatible");var w1c=new Set(["()","[]","{}","<>",'""',"''","``"]);function R1c(t,e,r,n){return t.replaced.length>0?r===n?!0:t.startOffset===e.startOffset&&t.endOffset===e.endOffset&&t.replaced===e.replaced&&t.inserted.length>0&&O9i(t.inserted,e.inserted):O9i(t.inserted,e.inserted)}a(R1c,"isUserEditCompatibleWithModelEdit");function O9i(t,e){return e.startsWith(t)?!0:w1c.has(t)?k1c(t,e):!1}a(O9i,"isUserTypingCompatibleWithModelText");function k1c(t,e){let r=0;for(let n=0;n{"use strict";p();var P1c=fN&&fN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),D1c=fN&&fN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),N1c=fN&&fN.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o ${r}`);let d=(async function*(){let f=await o.next();for(;!f.done;)yield f.value,f=await o.next()})();return{editIntent:r,remainingLinesStream:d,parseError:n}}n=`unknownIntentValue:${c}`,e.warn(`Edit intent parse error: ${n} (using Xtab275EditIntentShort prompting strategy). Defaulting to High (always show). First line was: "${c.substring(0,100)}..."`);let u=(async function*(){yield s.value;let d=await o.next();for(;!d.done;)yield d.value,d=await o.next()})();return{editIntent:r,remainingLinesStream:u,parseError:n}}a(O1c,"parseEditIntentFromStreamShortName");async function L1c(t,e){let r="<|edit_intent|>",n="<|/edit_intent|>",o=ubt.EditIntent.High,s,c=t[Symbol.asyncIterator](),l=await c.next();if(l.done){s="emptyResponse",e.warn("Empty response stream, no edit_intent tag found");let m=(async function*(){})();return{editIntent:o,remainingLinesStream:m,parseError:s}}let u=l.value,d=u.indexOf(r),f=u.indexOf(n);if(d!==-1&&f!==-1&&f>d){let m=u.substring(d+r.length,f).trim().toLowerCase();["no_edit","low","medium","high"].includes(m)||(s=`unknownIntentValue:${m}`,e.warn(`Unknown edit_intent value: "${m}", defaulting to High`)),o=ubt.EditIntent.fromString(m),e.trace(`Parsed edit_intent from first line: "${m}" -> ${o}`);let A=u.substring(f+n.length),y=(async function*(){A.trim()!==""&&(yield A);let E=await c.next();for(;!E.done;)yield E.value,E=await c.next()})();return{editIntent:o,remainingLinesStream:y,parseError:s}}d!==-1&&f===-1?s="malformedTag:startWithoutEnd":d===-1&&f!==-1?s="malformedTag:endWithoutStart":s="noTagFound",e.warn(`Edit intent parse error: ${s} (using Xtab275EditIntent prompting strategy). Defaulting to High (always show). First line was: "${u.substring(0,100)}..."`);let h=(async function*(){yield u;let m=await c.next();for(;!m.done;)yield m.value,m=await c.next()})();return{editIntent:o,remainingLinesStream:h,parseError:s}}a(L1c,"parseEditIntentFromStreamTags")});var fbt=I(Jye=>{"use strict";p();Object.defineProperty(Jye,"__esModule",{value:!0});Jye.linesWithBackticksRemoved=F1c;Jye.constructMessages=U1c;Jye.charCount=Q1c;Jye.findMergeConflictMarkersRange=q1c;var YOr=Io(),B9i=nBe(),B1c=hd();async function*F1c(t){let e=-1,r;for await(let n of t)if(++e,r&&(yield r,r=void 0),n.match(/^```[a-z]*$/)){if(e===0)continue;r=n}else yield n}a(F1c,"linesWithBackticksRemoved");function U1c({systemMsg:t,userMsg:e}){return[{role:YOr.Raw.ChatRole.System,content:(0,B9i.toTextParts)(t)},{role:YOr.Raw.ChatRole.User,content:(0,B9i.toTextParts)(e)}]}a(U1c,"constructMessages");function Q1c(t){return t.reduce((r,n)=>r+n.content.reduce((o,s)=>o+(s.type===YOr.Raw.ChatCompletionContentPartKind.Text?s.text.length:0),0),0)}a(Q1c,"charCount");function q1c(t,e,r){for(let n=e.start;n>>>>>>"))return new B1c.OffsetRange(n,o+1)}}a(q1c,"findMergeConflictMarkersRange")});var Q9i=I(pV=>{"use strict";p();Object.defineProperty(pV,"__esModule",{value:!0});pV.ResponseParseResult=void 0;pV.handleEditWindowOnly=G1c;pV.handleCodeBlock=$1c;pV.handleEditWindowWithEditIntent=V1c;pV.handleUnifiedWithXml=W1c;var FBe=nye(),F9i=NG(),U9i=$2(),Zye=cV(),j1c=zOr(),H1c=fbt(),RL;(function(t){class e{static{a(this,"EditWindowLines")}constructor(s,c){this.lines=s,this.editIntentMetadata=c}}t.EditWindowLines=e;class r{static{a(this,"Done")}constructor(s){this.reason=s}}t.Done=r;class n{static{a(this,"DirectEdits")}constructor(s){this.stream=s}}t.DirectEdits=n})(RL||(pV.ResponseParseResult=RL={}));function G1c(t){return new RL.EditWindowLines(t)}a(G1c,"handleEditWindowOnly");function $1c(t){return new RL.EditWindowLines((0,H1c.linesWithBackticksRemoved)(t))}a($1c,"handleCodeBlock");async function V1c(t,e,r){let{editIntent:n,remainingLinesStream:o,parseError:s}=await(0,j1c.parseEditIntentFromStream)(t,e,r);return new RL.EditWindowLines(o,{intent:n,parseError:s})}a(V1c,"handleEditWindowWithEditIntent");async function W1c(t,e,r,n){let o=t[Symbol.asyncIterator](),s=await o.next();if(s.done)return new RL.Done(new FBe.NoNextEditReason.NoSuggestions(r,e.editWindow));let c=s.value.trim();if(c===Zye.ResponseTags.NO_CHANGE.start)return new RL.Done(new FBe.NoNextEditReason.NoSuggestions(r,e.editWindow));if(c===Zye.ResponseTags.INSERT.start)return new RL.DirectEdits(z1c(o,e,r));if(c===Zye.ResponseTags.EDIT.start){let l=Y1c(o);return new RL.EditWindowLines(l)}return new RL.Done(new FBe.NoNextEditReason.Unexpected(new Error(`unexpected tag ${c}`)))}a(W1c,"handleUnifiedWithXml");async function*z1c(t,e,r){let{editWindowLines:n,editWindowLineRange:o,cursorLineInEditWindowOffset:s,cursorColumnZeroBased:c,editWindow:l,originalEditWindow:u,targetDocument:d,isFromCursorJump:f}=e,h=await t.next();if(h.done||h.value.includes(Zye.ResponseTags.INSERT.end))return new FBe.NoNextEditReason.NoSuggestions(r,l);let m=n[s];yield{edit:new F9i.LineReplacement(new U9i.LineRange(o.start+s+1,o.start+s+2),[m.slice(0,c)+h.value+m.slice(c)]),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d};let A=[],y=await t.next();for(;!y.done&&!y.value.includes(Zye.ResponseTags.INSERT.end);)A.push(y.value),y=await t.next();let E=o.start+s+2;return yield{edit:new F9i.LineReplacement(new U9i.LineRange(E,E),A),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d},new FBe.NoNextEditReason.NoSuggestions(r,l)}a(z1c,"generateInsertEdits");async function*Y1c(t){let e=await t.next();for(;!e.done;){if(e.value.includes(Zye.ResponseTags.EDIT.end))return;yield e.value,e=await t.next()}}a(Y1c,"generateEditLines")});var q9i=I(i9=>{"use strict";p();var K1c=i9&&i9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ZR=i9&&i9.__param||function(t,e){return function(r,n){e(r,n,t)}},pbt;Object.defineProperty(i9,"__esModule",{value:!0});i9.XtabEndpoint=void 0;var J1c=FE(),Z1c=K6(),KOr=Pl(),X1c=$E(),eSc=J$(),tSc=Gne(),rSc=Sp(),nSc=_y(),iSc=X6(),oSc=mh(),sSc=gm(),aSc=K$(),cSc=Qne(),lSc=Gs(),JOr=class extends tSc.ChatEndpoint{static{a(this,"XtabEndpoint")}static{pbt=this}static{this.chatModelInfo={id:"xtab-4o-mini-finetuned",name:"xtab-4o-mini-finetuned",vendor:"xtab",model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"unknown",capabilities:{type:"chat",family:"xtab-4o-mini-finetuned",tokenizer:cSc.TokenizerType.O200K,limits:{max_prompt_tokens:12285,max_output_tokens:4096},supports:{streaming:!0,parallel_tool_calls:!1,tool_calls:!1,vision:!1,prediction:!0}}}}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y){let E=n?{...pbt.chatModelInfo,id:n}:pbt.chatModelInfo;super(E,s,f,h,m,o,g,A,y),this._url=e,this._apiKey=r,this._configService=o}get urlOrRequestMetadata(){return this._configService.getConfig(KOr.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl)||this._url}getExtraHeaders(){let e=this._configService.getConfig(KOr.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey)||this._apiKey;if(!e){let r=`Missing API key for custom URL (${this.urlOrRequestMetadata}). Provide the API key using vscode setting \`github.copilot.chat.advanced.inlineEdits.xtabProvider.apiKey\` or, if in simulations using \`--nes-api-key\` or \`--config-file\``;throw console.error(r),new Error(r)}return{Authorization:`Bearer ${e}`,"api-key":e}}};i9.XtabEndpoint=JOr;i9.XtabEndpoint=JOr=pbt=K1c([ZR(3,KOr.IConfigurationService),ZR(4,eSc.IDomainService),ZR(5,nSc.IFetcherService),ZR(6,X1c.ICAPIClientService),ZR(7,sSc.ITelemetryService),ZR(8,J1c.IAuthenticationService),ZR(9,Z1c.IChatMLFetcher),ZR(10,aSc.ITokenizerProvider),ZR(11,lSc.IInstantiationService),ZR(12,oSc.IExperimentationService),ZR(13,iSc.IChatWebSocketManager),ZR(14,rSc.ILogService)],JOr)});var hbt=I(Xye=>{"use strict";p();Object.defineProperty(Xye,"__esModule",{value:!0});Xye.NullProxyModelsService=Xye.IProxyModelsService=void 0;var uSc=nn(),dSc=Ic();Xye.IProxyModelsService=(0,uSc.createServiceIdentifier)("IProxyModelsService");var ZOr=class{static{a(this,"NullProxyModelsService")}constructor(){this.onModelListUpdated=dSc.Event.None}get models(){}get nesModels(){}get cursorJumpModels(){}get instantApplyModels(){}};Xye.NullProxyModelsService=ZOr});var j9i=I(rA=>{"use strict";p();var fSc=rA&&rA.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pSc=rA&&rA.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),hSc=rA&&rA.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},mSc=rA&&rA.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;otypeof g=="boolean"?g?gbt.IncludeLineNumbersOption.WithSpaceAfter:gbt.IncludeLineNumbersOption.None:g),f=new e5r.PromptPieces(e.currentDocument,e.editWindowLinesRange,e.areaAroundEditWindowLinesRange,e.activeDoc,e.xtabHistory,s.lines,c,e.langCtx,e.aggressivenessLevel,u,this.computeTokens,{...e.opts,includePostScript:!1,lintOptions:l,recentlyViewedDocuments:{...e.opts.recentlyViewedDocuments,includeLineNumbers:d}}),{prompt:h}=(0,e5r.getUserPrompt)(f),m=(0,wSc.constructMessages)({systemMsg:r,userMsg:h});return gI.Result.ok({messages:m,keptRange:s.keptRange})}async predictNextCursorPosition(e,r,n){let o=r.tracer.createSubLogger("predictNextCursorPosition"),s=this.buildCursorPredictionPrompt(e);if(s.isError())return o.trace(`Failed to construct tagged file: ${s.err.message}`),gI.Result.fromString(s.err.message);let{messages:c,keptRange:l}=s.val;r.telemetry.setCursorJumpPrompt(c),r.logContext.setCursorJumpPrompt(c,l);let u=this.determineModelName();r.telemetry.setCursorJumpModelName(u);let d=await this.resolveEndpoint(u,o);if(!d)return gI.Result.fromString("endpointNotResolved");let{endpoint:f,usesResponsesApi:h}=d,m=this.configService.getConfig(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionApiKey),g=this.configService.getExperimentBasedConfig(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionMaxResponseTokens,this.expService),A={max_tokens:h?Math.max(g,2048):g};m&&(A={...A,secretKey:m});let y=await f.makeChatRequest2({messages:c,debugName:"nes.nextCursorPosition",finishedCb:void 0,location:XOr.ChatLocation.Other,requestOptions:A},n);if(y.type!==XOr.ChatFetchResponseType.Success)return y.type===XOr.ChatFetchResponseType.NotFound&&(o.trace("Next cursor position prediction endpoint not found; disabling predictor for current session."),this.isDisabled=!0),gI.Result.fromString(`fetchError:${y.type}`);try{r.telemetry.setCursorJumpResponse(y.value);let E=y.value.trim();return this.parseResponse(E,l)}catch(E){return o.trace(`Failed to parse predicted line number from response '${y.value}': ${E}`),gI.Result.fromString(`failedToParseLine:"${y.value}". Error ${bSc.ErrorUtils.fromUnknown(E).message}`)}}async resolveEndpoint(e,r){if(this.configService.getConfig(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUseEndpointProvider)){let c=(await this.endpointProvider.getAllChatEndpoints()).find(u=>u.model===e||u.family===e);if(!c){r.trace(`Could not find endpoint for model '${e}' via endpoint provider`);return}let l=c.apiType==="responses";return{endpoint:c,usesResponsesApi:l}}let o=this.configService.getConfig(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUrl);return{endpoint:this.instaService.createInstance(ySc.ChatEndpoint,{id:e,name:"nes.nextCursorPosition",vendor:e,urlOrRequestMetadata:o||{type:gSc.RequestType.ProxyChatCompletions},model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"",capabilities:{type:"chat",family:"",tokenizer:SSc.TokenizerType.CL100K,limits:void 0,supports:{parallel_tool_calls:!1,tool_calls:!1,streaming:!0,vision:!1,prediction:!1,thinking:!1}}}),usesResponsesApi:!1}}determineModelName(){return this.configService.getExperimentBasedConfig(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionModelName,this.expService)??this.proxyModelsService.cursorJumpModels?.[0]?.name??RSc}determineLintOptions(){let e=this.configService.getConfig(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptions);if(e)return{...Abt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,...e};let r=this.configService.getExperimentBasedConfig(pN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptionsString,this.expService);return r?(0,Abt.parseLintOptionString)(r,Abt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS):Abt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS}parseResponse(e,r){let n=kSc(e),o=parseInt(n,10);if(!isNaN(o)&&String(o)===n)return this.parseSameFileLineNumber(o,r);let s=n.lastIndexOf(":");if(s<=0)return gI.Result.fromString("gotNaN");let c=n.substring(0,s),l=n.substring(s+1),u=parseInt(l,10);return isNaN(u)||u<0?gI.Result.fromString("crossFileInvalidLineNumber"):c.trim().length===0?gI.Result.fromString("crossFileEmptyFilePath"):gI.Result.ok({kind:"differentFile",filePath:c.trim(),lineNumber:u})}parseSameFileLineNumber(e,r){return e<0?gI.Result.fromString("negativeLineNumber"):e[\s\S]*?<\/think>\s*/g,"");return e.trimStart().startsWith("")&&(e=""),e.trim()}a(kSc,"stripThinkTags")});var Y9i=I(QBe=>{"use strict";p();Object.defineProperty(QBe,"__esModule",{value:!0});QBe.XtabPatchResponseHandler=void 0;QBe.tryRemoveDuplicateAdditions=z9i;var H9i=Vne(),UBe=py(),PSc=ogt(),G9i=nye(),DSc=X_(),NSc=Sl(),MSc=NA(),$9i=nd(),W9i=NG(),OSc=$2(),LSc=IOr(),BSc=Yye(),FSc=cV(),tEe=class t{static{a(this,"Patch")}constructor(e,r){this.filePath=e,this.lineNumZeroBased=r,this.removedLines=[],this.addedLines=[]}static ofLine(e){let r=e.match(/^(.+):(\d+)$/);if(!r)return null;let[,n,o]=r;return new t(n,parseInt(o,10))}static insertion(e,r){return new t(e,r)}addLine(e){let r=e.slice(1);return e.startsWith("-")?(this.removedLines.push(r),!0):e.startsWith("+")?(this.addedLines.push(r),!0):!1}toString(){return[`${this.filePath}:${this.lineNumZeroBased}`,...this.removedLines.map(e=>`-${e}`),...this.addedLines.map(e=>`+${e}`)].join(` -`)}};function r5r(t){return t.trim().length>1}a(r5r,"isMeaningfulLine");function z9i(t,e){let r=t.newLines;if(r.length===0)return;let n=t.lineRange.endLineNumberExclusive,o=e.lineRange.endLineNumberExclusive-1,s=Math.min(o+1,n+r.length),c=[];for(let l=n;l=1;l--){let u=r.slice(-l);if((0,NSc.equals)(u,c.slice(0,l)))return{kind:"suffix",newAdditions:r.slice(0,r.length-l),removedLines:u}}if(r[0]===c[0]&&r5r(r[0]))return{kind:"prefix",newAdditions:r.slice(1),removedLines:r.slice(0,1)};if(r.length>=3&&c.length>=2&&r5r(c[0])&&r5r(c[1])){let l=c[0],u=c[1];for(let d=1;d=1&&c.lineNumZeroBased===l&&c.filePath===u&&PSc.ResponseProcessor.isAdditiveEdit(c.removedLines[0],c.addedLines[0])}a(o,"isGhostTextPatch"),t.isGhostTextPatch=o;async function*s(c,l,u){let d=null,f=!0,h=!1;for await(let m of c){if(m.trim()===FSc.ResponseTags.NO_EDIT)break;if(d===null){d=tEe.ofLine(m);continue}if(d.addLine(m)){if(f&&!h&&l!==void 0&&u!==void 0&&d.addedLines.length===1&&d.removedLines.length>=1){if(o(d,l,u)){let g=tEe.insertion(d.filePath,d.lineNumZeroBased);g.removedLines=[...d.removedLines],g.addedLines=[...d.addedLines],yield g,d=tEe.insertion(d.filePath,d.lineNumZeroBased+1)}h=!0}continue}(d.removedLines.length>0||d.addedLines.length>0)&&(yield d),d=tEe.ofLine(m),f=!1}d&&(d.removedLines.length>0||d.addedLines.length>0)&&(yield d)}a(s,"extractEdits"),t.extractEdits=s})(V9i||(QBe.XtabPatchResponseHandler=V9i={}))});var pUi=I(Pp=>{"use strict";p();var QSc=Pp&&Pp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qSc=Pp&&Pp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jSc=Pp&&Pp.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},HSc=Pp&&Pp.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oMath.floor(e.length/4)}constructor(e,r,n,o,s,c,l,u,d,f,h){this.modelService=e,this.simulationCtx=r,this.instaService=n,this.workspaceService=o,this.diffService=s,this.configService=c,this.expService=l,this.langCtxService=u,this.langDiagService=d,this.ignoreService=f,this.similarFilesContextService=h,this.ID=o9.ID,this.forceUseDefaultModel=!1,this.userInteractionMonitor=this.instaService.createInstance(pTc.UserInteractionMonitor),this.terminalMonitor=this.instaService.createInstance(yTc.TerminalMonitor),this.nextCursorPredictor=this.instaService.createInstance(vTc.XtabNextCursorPredictor,o9.computeTokens)}handleAcceptance(){this.userInteractionMonitor.handleAcceptance()}handleRejection(){this.userInteractionMonitor.handleRejection()}handleIgnored(){this.userInteractionMonitor.handleIgnored()}async*provideNextEdit(e,r,n,o){let s=new Ds.StatelessNextEditTelemetryBuilder(e.headerRequestId);n.setProviderStartTime();try{if(e.xtabEditHistory.length===0){let h=new Ds.NoNextEditReason.ActiveDocumentHasNoEdits;return new Ds.WithStatelessProviderTelemetry(h,s.build(_bt.Result.error(h)))}let c=this.userInteractionMonitor.createDelaySession(e.providerRequestStartDateTime),l={tracer:r,logContext:n,telemetry:s},u=this.doGetNextEdit(e,c,l,o,AV.NotRetrying.INSTANCE),d=await u.next();for(;!d.done;)yield new Ds.WithStatelessProviderTelemetry(d.value,s.build(_bt.Result.ok(void 0))),d=await u.next();let f=d.value;return f instanceof Ds.NoNextEditReason.GotCancelled&&n.setIsSkipped(),new Ds.WithStatelessProviderTelemetry(f,s.build(_bt.Result.error(f)))}catch(c){let l=mV.ErrorUtils.fromUnknown(c),u=new Ds.NoNextEditReason.Unexpected(l);return new Ds.WithStatelessProviderTelemetry(u,s.build(_bt.Result.error(u)))}finally{n.setProviderEndTime()}}doGetNextEdit(e,r,n,o,s){return this.doGetNextEditWithSelection(e,(0,fTc.getOrDeduceSelectionFromLastEdit)(e.getActiveDocument()),r,n,o,s)}async*doGetNextEditWithSelection(e,r,n,o,s,c,l){let u=o.tracer.createSubLogger(["XtabProvider","doGetNextEditWithSelection"]),{logContext:d,telemetry:f}=o,h=e.getActiveDocument();if(r===null)return new Ds.NoNextEditReason.Uncategorized(new Error("NoSelection"));let{promptOptions:m,modelServiceConfig:g}=this.determineModelConfiguration(h);f.setModelConfig(JSON.stringify(g));let A=this.getEndpointWithLogging(m.modelName,d,f),y=new n5r.Position(r.endLineNumber,r.endColumn),E=new ETc.CurrentDocument(h.documentAfterEdits,y);this._configureDebounceTimings(e,E,m,f,n,u);let _=lUi(E),v=this.computeEditWindowLinesRange(E,e,u,f),b=Math.max(0,E.cursorLineOffset-v.start),T=E.transformer.getLineLength(v.endExclusive),w=E.transformer.getOffsetRange(new Cbt.Range(v.start+1,1,v.endExclusive,T+1));e.requestEditWindow=l?new Ds.RequestEditWindowWithCursorJump(w,l):new Ds.RequestEditWindow(w);let R=E.lines.slice(v.start,v.endExclusive),x=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabEditWindowMaxTokens,this.expService);if(x!==void 0&&(0,aUi.countTokensForLines)(R,o9.computeTokens)>x)return new Ds.NoNextEditReason.PromptTooLarge("editWindow");let D=!R.some(ke=>ke.includes(nUi.PromptTags.CURSOR)),N=(0,gV.constructTaggedFile)(E,v,_,m,o9.computeTokens,{includeLineNumbers:{areaAroundCodeToEdit:Go.IncludeLineNumbersOption.None,currentFileContent:m.currentFile.includeLineNumbers}});if(N.isError())return new Ds.NoNextEditReason.PromptTooLarge("currentFile");let{clippedTaggedCurrentDoc:L,areaAroundCodeToEdit:B}=N.val;f.setNLinesOfCurrentFileInPrompt(L.lines.length);let{aggressivenessLevel:q,userHappinessScore:M}=this.userInteractionMonitor.getAggressivenessLevel(),O=this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService);f.setUserAggressivenessSetting(O),f.setXtabAggressivenessLevel(q),M!==void 0&&f.setXtabUserHappinessScore(M);let j=await this.getAndProcessLanguageContext(e,n,h,y,m,{tracer:u,logContext:d,telemetry:f},s);if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterLanguageContextAwait");let Q=m.neighborFiles.enabled?await(0,hV.raceCancellation)((0,hV.raceTimeout)(this.similarFilesContextService.getSnippetsForPrompt(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset),n.getDebounceTime()),s):void 0;if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterNeighborSnippetsAwait");let U=new gTc.LintErrors(h.id,E,this.langDiagService,e.xtabEditHistory),Y=new gV.PromptPieces(E,v,_,h,e.xtabEditHistory,L.lines,B,j,q,U,o9.computeTokens,m,Q),{prompt:W,nDiffsInPrompt:V,diffTokensInPrompt:z,neighborSnippetsResult:ie}=(0,gV.getUserPrompt)(Y);f.setNDiffsInPrompt(V),f.setDiffTokensInPrompt(z),ie&&(f.setNNeighborSnippetsComputed(ie.nComputed),f.setNNeighborSnippetsInPrompt(ie.nIncluded),f.setNeighborSnippetIndicesInPrompt(ie.includedIndices));let H=Go.ResponseFormat.fromPromptingStrategy(m.promptingStrategy),re=this.getPredictedOutput(h,E.cursorLineOffset,R,b,H),le=(0,i5r.constructMessages)({systemMsg:uUi(m.promptingStrategy),userMsg:W});d.setPrompt(le),f.setPrompt(le);let Le=3e4*4;if((0,i5r.charCount)(le)>Le)return new Ds.NoNextEditReason.PromptTooLarge("final");if(await this.debounce(n,c,u,f,s),s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterDebounce");Promise.resolve().then(()=>{let ke=U.getData();f.setLintErrors(ke),d.setDiagnosticsData(ke);let X=this.terminalMonitor.getData();f.setTerminalOutput(X),d.setTerminalData(X)}),f.setSimilarFilesContext(this.similarFilesContextService.compute(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset)),e.fetchIssued=!0;let Ue={endpoint:A,modelServiceConfig:g,messages:le,clippedTaggedCurrentDoc:L,editWindowInfo:{editWindow:w,editWindowLines:R,cursorLineInEditWindowOffset:b,editWindowLineRange:v},promptPieces:Y,prediction:re,originalEditWindow:l};return yield*this.streamEditsWithFiltering(e,Ue,{shouldRemoveCursorTagFromResponse:D,responseFormat:H},{aggressivenessLevel:q,userHappinessScore:M},c,n,{tracer:u,logContext:d,telemetry:f},s)}_configureDebounceTimings(e,r,n,o,s,c){let l=r.isCursorAtEndOfLine();o.setIsCursorAtLineEnd(l);let u=(0,mTc.determineIsInlineSuggestionPosition)(r);if(o.setIsInlineSuggestion(!!u),e.isSpeculative)c.trace("No extra debounce applied for speculative request");else{let d=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsExtraDebounceInlineSuggestion,this.expService);u&&d>0?(c.trace("Debouncing for inline suggestion position"),s.setExtraDebounce(d)):l?(c.trace("Debouncing for cursor at end of line"),s.setExtraDebounce(this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsExtraDebounceEndOfLine,this.expService))):c.trace("No extra debounce applied")}(0,Hv.isAggressivenessStrategy)(n.promptingStrategy)||this._applyAggressivenessSettings(s,c)}_applyAggressivenessSettings(e,r){let n=this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService),s={[Hv.AggressivenessSetting.Low]:{minResponseConfigKey:di.ConfigKey.TeamInternal.InlineEditsAggressivenessLowMinResponseTimeMs},[Hv.AggressivenessSetting.Medium]:{minResponseConfigKey:di.ConfigKey.TeamInternal.InlineEditsAggressivenessMediumMinResponseTimeMs},[Hv.AggressivenessSetting.High]:{debounceConfigKey:di.ConfigKey.TeamInternal.InlineEditsAggressivenessHighDebounceMs},[Hv.AggressivenessSetting.Default]:void 0}[n];if(s){if(s.debounceConfigKey){let c=this.configService.getExperimentBasedConfig(s.debounceConfigKey,this.expService);e.setBaseDebounceTime(c),r.trace(`Aggressiveness ${n}: debounce set to ${c}ms`)}if(s.minResponseConfigKey){if(this.userInteractionMonitor.wasLastActionAcceptance){r.trace(`Aggressiveness ${n}: skipping min response time (last action was acceptance)`);return}let c=this.configService.getExperimentBasedConfig(s.minResponseConfigKey,this.expService);e.setExpectedTotalTime(c),r.trace(`Aggressiveness ${n}: min response time set to ${c}ms`)}}}getAndProcessLanguageContext(e,r,n,o,s,c,l){let u=this.configService.getConfig(di.ConfigKey.TeamInternal.InlineEditsLogContextRecorderEnabled);if(!s.languageContext.enabled&&!u)return Promise.resolve(void 0);let d=this.getLanguageContext(e,r,n,o,c,l);return u&&d.then(f=>{f&&c.logContext.setLanguageContext(f)}),s.languageContext.enabled?d:Promise.resolve(void 0)}async getLanguageContext(e,r,n,o,s,c){try{let l=this.workspaceService.textDocuments.find(v=>v.uri.toString()===n.id.uri);if(l===void 0||this.langCtxService.getContextProviders(l,sUi.ProviderTarget.NES).length<1)return;let d=r.getDebounceTime(),f=new dTc.Position(o.lineNumber-1,o.column-1),h={opportunityId:e.opportunityId,completionId:e.headerRequestId,documentContext:{uri:l.uri.toString(),languageId:l.languageId,version:l.version,offset:l.offsetAt(f),position:f},activeExperiments:new Map,timeBudget:d,timeoutEnd:Date.now()+d,source:"nes"},m=a(async v=>{let b=[v.uri,...v.additionalUris??[]];return!!await(0,nTc.raceFilter)(b.map(w=>this.ignoreService.isCopilotIgnored(w)),w=>w)},"isSnippetIgnored"),g=[],A=a(async()=>{let v=this.langCtxService.getContextItems(l,h,c);for await(let b of v)b.kind===J9i.ContextKind.Snippet&&await m(b)||g.push({context:b,timeStamp:Date.now(),onTimeout:!1})},"getContextPromise"),y=Date.now();if(await(0,hV.raceCancellation)((0,hV.raceTimeout)(A(),d),c),c.isCancellationRequested)return;let E=Date.now(),_=this.langCtxService.getContextItemsOnTimeout(l,h);for(let v of _)v.kind===J9i.ContextKind.Snippet&&await m(v)||g.push({context:v,timeStamp:E,onTimeout:!0});return{start:y,end:E,items:g}}catch(l){s.logContext.setError(mV.ErrorUtils.fromUnknown(l)),s.tracer.trace(`Failed to fetch language context: ${l}`);return}}async*streamEditsWithFiltering(e,r,n,o,s,c,l,u){let d=l.tracer.createSubLogger("streamEditsWithFiltering"),f={...l,tracer:d},h=this.streamEdits(e,r,n,o,s,c,f,u),m=0,g=await h.next();for(;!g.done;){let A=g.value.edit,[y,E]=this.filterEdit(e.getActiveDocument(),[A],r.modelServiceConfig.allowImportChanges??KSc.ImportChanges.None);y.length===0?d.trace(`Filtered out an edit: ${A.toString()} using ${E.join(", ")} filter(s)`):(d.trace(`Yielding an edit: ${A.toString()}`),yield g.value,m++),g=await h.next()}return m===0&&g.value instanceof Ds.NoNextEditReason.NoSuggestions?yield*this.doGetNextEditsWithCursorJump(e,r,c,l,u,s):g.value}async*streamEdits(e,r,n,o,s,c,l,u){let d=l.tracer.createSubLogger("streamEdits"),f=new oTc.CancellationTokenSource(u),h=f.token;try{return yield*this._streamEditsImpl(e,r,n,o,s,c,{...l,tracer:d},u,f,h)}finally{f.dispose()}}async _performFetch(e,r,n,o,s,c,l,u,d,f){let{tracer:h,logContext:m,telemetry:g}=f,A=this.configService.getExperimentBasedConfig(di.ConfigKey.NextEditSuggestionsFetcher,this.expService)||void 0,y=new GSc.FetchStreamSource,E=new sTc.StopWatch,_="",v,b=new hV.DeferredPromise;m.setHeaderRequestId(o),g.setFetchStartedAt(),m.setFetchStartTime();let T=e.makeChatRequest2({debugName:o9.ID,messages:r,finishedCb:a(async(P,D,N)=>{b.isSettled||b.complete(),v===void 0&&P!==""&&(v=E.elapsed(),m.addLog(`TTFT ${v} ms`)),y.update(P,N),_=P,m.setResponse(_)},"finishedCb"),location:Lf.ChatLocation.Other,source:void 0,requestOptions:{temperature:0,stream:!0,prediction:n},userInitiatedRequest:void 0,telemetryProperties:{requestId:o},useFetcher:A,customMetadata:{aggressivenessLevel:s.aggressivenessLevel,userHappinessScore:s.userHappinessScore}},d);g.setResponse(T.then(P=>({response:P,ttft:v}))),m.setFullResponse(T.then(P=>P.type===Lf.ChatFetchResponseType.Success?P.value:void 0)),T.then(P=>{P.type!==Lf.ChatFetchResponseType.Success?y.reject(new rUi.FetchStreamError(c5r(P))):y.resolve()}).catch(P=>{m.setError(mV.ErrorUtils.fromUnknown(P)),m.addLog("ChatMLFetcher fetch call threw -- this's UNEXPECTED!"),y.reject(mV.ErrorUtils.fromUnknown(P))}).finally(()=>{m.setFetchEndTime(),b.isSettled||b.complete(),m.setResponse(_)});let w=await Promise.race([b.p,T]);if(w&&w.type!==Lf.ChatFetchResponseType.Success)return w.type===Lf.ChatFetchResponseType.NotFound&&!this.forceUseDefaultModel?(this.forceUseDefaultModel=!0,yV.ModelNotFound.INSTANCE):w.type===Lf.ChatFetchResponseType.Unknown&&w.reason===Lf.RESPONSE_CONTAINED_NO_CHOICES?new yV.FetchFailure(new Ds.NoNextEditReason.NoSuggestions(u,l)):new yV.FetchFailure(c5r(w));let R=Z9i.AsyncIterUtilsExt.splitLines(Z9i.AsyncIterUtils.map(y.stream,P=>P.delta.text)),x=(async function*(){let P=0;for await(let D of R){let N=`Line ${P++} emitted with latency ${E.elapsed()} ms`;h.trace(N),yield c?D.replaceAll(nUi.PromptTags.CURSOR,""):D}})();return new yV.Lines(x,()=>_,E)}async*_streamEditsImpl(e,r,n,o,s,c,l,u,d,f){let{tracer:h,logContext:m,telemetry:g}=l,{endpoint:A,messages:y,clippedTaggedCurrentDoc:E,editWindowInfo:_,promptPieces:v,prediction:b,originalEditWindow:T}=r,{editWindow:w,editWindowLines:R,cursorLineInEditWindowOffset:x,editWindowLineRange:P}=_,D=e.getActiveDocument().id,N=await this._performFetch(A,y,b,e.headerRequestId,o,n.shouldRemoveCursorTagFromResponse,w,e.documentBeforeEdits,f,l);if(N instanceof yV.ModelNotFound)return yield*this.doGetNextEdit(e,c,l,u,s);if(N instanceof yV.FetchFailure)return N.reason;let{linesStream:L,getResponseSoFar:B,fetchRequestStopWatch:q}=N,M=s instanceof AV.Retrying&&s.reason==="cursorJump",O;try{switch(n.responseFormat){case Go.ResponseFormat.EditWindowOnly:{O=(0,Jne.handleEditWindowOnly)(L);break}case Go.ResponseFormat.CodeBlock:{O=(0,Jne.handleCodeBlock)(L);break}case Go.ResponseFormat.EditWindowWithEditIntent:case Go.ResponseFormat.EditWindowWithEditIntentShort:{let ie=n.responseFormat===Go.ResponseFormat.EditWindowWithEditIntentShort?oUi.EditIntentParseMode.ShortName:oUi.EditIntentParseMode.Tags;O=await(0,Jne.handleEditWindowWithEditIntent)(L,h,ie);break}case Go.ResponseFormat.CustomDiffPatch:{let ie=e.getActiveDocument(),H=v.currentDocument,le=H.lines[E.keptRange.endExclusive-1].length,Le=H.transformer.getOffsetRange(new Cbt.Range(E.keptRange.start+1,1,E.keptRange.endExclusive,le+1)),ge=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDuplicateAdditionsMode,this.expService),Ue=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchFastYieldLineWithCursor,this.expService);O=new Jne.ResponseParseResult.DirectEdits(CTc.XtabPatchResponseHandler.handleResponse(L,H,ie.id,ie.workspaceRoot,Le,h,ge,Ue));break}case Go.ResponseFormat.UnifiedWithXml:{O=await(0,Jne.handleUnifiedWithXml)(L,{editWindowLines:R,editWindowLineRange:P,cursorLineInEditWindowOffset:x,cursorColumnZeroBased:v.currentDocument.cursorPosition.column-1,editWindow:w,originalEditWindow:T,targetDocument:D,isFromCursorJump:M},e.documentBeforeEdits,h);break}default:(0,Zne.assertNever)(n.responseFormat)}if(O instanceof Jne.ResponseParseResult.Done)return O.reason;if(O instanceof Jne.ResponseParseResult.DirectEdits)return yield*O.stream;if(O.editIntentMetadata){let{intent:ie,parseError:H}=O.editIntentMetadata;if(g.setEditIntent(ie),H&&g.setEditIntentParseError(H),!Go.EditIntent.shouldShowEdit(ie,v.aggressivenessLevel))return h.trace(`Filtered out edit due to edit intent "${ie}" with aggressiveness "${v.aggressivenessLevel}"`),new Ds.NoNextEditReason.FilteredOut(`editIntent:${ie} aggressivenessLevel:${v.aggressivenessLevel}`)}let j=O.lines,Q={emitFastCursorLineChange:K9i.ResponseProcessor.mapEmitFastCursorLineChange(this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderEmitFastCursorLineChange,this.expService)),nLinesToConverge:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNNonSignificantLinesToConverge,this.expService),nSignificantLinesToConverge:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNSignificantLinesToConverge,this.expService)};h.trace(`starting to diff stream against edit window lines with latency ${q.elapsed()} ms`);let U=(0,iTc.backwardCompatSetting)(this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabEarlyCursorLineDivergenceCancellation,this.expService),ie=>{switch(ie){case!1:case void 0:return Hv.EarlyDivergenceCancellationMode.Off;case!0:return Hv.EarlyDivergenceCancellationMode.Cursor;case Hv.EarlyDivergenceCancellationMode.Off:case Hv.EarlyDivergenceCancellationMode.Cursor:case Hv.EarlyDivergenceCancellationMode.EditWindow:return ie;default:return Hv.EarlyDivergenceCancellationMode.Off}}),Y=!1,W=U===Hv.EarlyDivergenceCancellationMode.Off?j:TTc(j,x,e,P,R,d,l,ie=>{Y=ie},U),V=0,z=!1;for await(let ie of K9i.ResponseProcessor.diff(R,W,x,Q)){if(Y)break;h.trace(`ResponseProcessor streamed edit #${V} with latency ${q.elapsed()} ms`);let H=[];if(ie.lineRange.startLineNumber===ie.lineRange.endLineNumberExclusive||ie.newLines.length===0||ie.lineRange.endLineNumberExclusive-ie.lineRange.startLineNumber===1&&ie.newLines.length===1){let re=new vbt.LineReplacement(new tUi.LineRange(ie.lineRange.startLineNumber+P.start,ie.lineRange.endLineNumberExclusive+P.start),ie.newLines);H.push(re)}else{let re=R.slice(ie.lineRange.startLineNumber-1,ie.lineRange.endLineNumberExclusive-1).join(` -`),le=await this.diffService.computeDiff(re,ie.newLines.join(` -`),{ignoreTrimWhitespace:!1,maxComputationTimeMs:0,computeMoves:!1});h.trace(`Ran diff for #${V} with latency ${q.elapsed()} ms`);let Le=P.start+ie.lineRange.startLineNumber;for(let ge of le.changes){let Ue=new vbt.LineReplacement(new tUi.LineRange(Le+ge.original.startLineNumber-1,Le+ge.original.endLineNumberExclusive-1),ie.newLines.slice(ge.modified.startLineNumber-1,ge.modified.endLineNumberExclusive-1));H.push(Ue)}}m.setResponse(B());for(let re of H){if(h.trace(`extracting edit #${V}: ${re.toString()}`),!z){z=!0;let le=this.determineArtificialDelayMs(c,h,g);if(le&&(await(0,hV.timeout)(le),h.trace(`Artificial delay of ${le} ms completed`),u.isCancellationRequested))return new Ds.NoNextEditReason.GotCancelled("afterArtificialDelay")}yield{edit:re,isFromCursorJump:M,window:w,originalWindow:T,targetDocument:D},V++}}return Y?new Ds.NoNextEditReason.GotCancelled(U===Hv.EarlyDivergenceCancellationMode.Cursor?"cursorLineDiverged":"editWindowLineDiverged"):new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,w)}catch(j){return j instanceof rUi.FetchStreamError?j.reason:(m.setError(j),new Ds.NoNextEditReason.Unexpected(mV.ErrorUtils.fromUnknown(j)))}}async*doGetNextEditsWithCursorJump(e,r,n,o,s,c){let{tracer:l,telemetry:u}=o,{editWindowInfo:{editWindow:d},modelServiceConfig:f,promptPieces:h}=r,m=new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d),g=this.nextCursorPredictor.determineEnablement(f.supportsNextCursorLinePrediction);if(g===void 0||c instanceof AV.Retrying)return m;if(o5r(e))return l.trace("Skipping cursor prediction: user typed during request"),new Ds.NoNextEditReason.GotCancelled("beforeNextCursorPredictionFetchUserTyped");let A=await this.nextCursorPredictor.predictNextCursorPosition(h,o,s);if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetch");if(o5r(e))return l.trace("Skipping cursor prediction: user typed during prediction fetch"),new Ds.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetchUserTyped");if(A.isError())return l.trace(`Predicted next cursor line error: ${A.err.message}`),u.setNextCursorLineError(A.err.message),m;let y=A.val;if(y.kind==="differentFile")return yield*this.handleCrossFilePrediction(y,g,e,r,n,o,s);let E=y.lineNumber,_=E-h.currentDocument.cursorLineOffset;if(u.setNextCursorLineDistance(_),u.setNextCursorIsCrossFile(!1),l.trace(`Predicted next cursor line: ${E}`),E>=h.currentDocument.lines.length)return l.trace("Predicted next cursor line error: exceedsDocumentLines"),u.setNextCursorLineError("exceedsDocumentLines"),m;if(h.editWindowLinesRange.contains(E))return l.trace("Predicted next cursor line error: withinEditWindow"),u.setNextCursorLineError("withinEditWindow"),m;let v=E+1,b=h.activeDoc.documentAfterEditsLines.at(E),T=o9.getNextCursorColumn(b);switch(g){case ybt.NextCursorLinePrediction.Jump:{let w=new n5r.Position(v,T);return new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d,w)}case ybt.NextCursorLinePrediction.OnlyWithEdit:return yield*this.doGetNextEditWithSelection(e,new Cbt.Range(v,T,v,T),n,o,s,new AV.Retrying("cursorJump"),d);default:(0,Zne.assertNever)(g)}}async*handleCrossFilePrediction(e,r,n,o,s,c,l){let{tracer:u,telemetry:d}=c,{editWindowInfo:{editWindow:f},promptPieces:h}=o,m=h.activeDoc.workspaceRoot;if(!m&&!(0,X9i.isAbsolute)(e.filePath))return u.trace("Predicted cross-file cursor jump error: noWorkspaceRoot"),d.setNextCursorLineError("crossFile:noWorkspaceRoot"),new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f);let g=(0,X9i.isAbsolute)(e.filePath)?eUi.URI.file(e.filePath):eUi.URI.joinPath(m,e.filePath),A=zSc.DocumentId.create(g.toString()),y=e.lineNumber+1,E=new n5r.Position(y,1);switch(d.setNextCursorIsCrossFile(!0),u.trace(`Predicted cross-file cursor jump: ${e.filePath}:${e.lineNumber}`),r){case ybt.NextCursorLinePrediction.Jump:return new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A);case ybt.NextCursorLinePrediction.OnlyWithEdit:{let _;try{_=await this.workspaceService.openTextDocument(g)}catch(w){return u.trace(`Failed to open target file for cross-file edit: ${mV.ErrorUtils.fromUnknown(w).message}`),d.setNextCursorLineError("crossFile:failedToOpenFile"),new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A)}if(l.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocument");if(o5r(n))return u.trace("Skipping cross-file edit: user typed during openTextDocument"),new Ds.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocumentUserTyped");let v=new cTc.StringText(_.getText()),b=new Ds.StatelessNextEditDocument(A,h.activeDoc.workspaceRoot,JSc.LanguageId.create(_.languageId),v.getLines(),vbt.LineEdit.empty,v,new YSc.Edits(aTc.StringEdit,[])),T=new Ds.StatelessNextEditRequest(n.headerRequestId,n.opportunityId,v,[b],0,n.xtabEditHistory,new hV.DeferredPromise,n.expandedEditWindowNLines,n.isSpeculative,n.logContext,n.recordingBookmark,n.recording,n.providerRequestStartDateTime);return yield*this.doGetNextEditWithSelection(T,new Cbt.Range(y,1,y,1),s,c,l,new AV.Retrying("cursorJump"),f)}default:(0,Zne.assertNever)(r)}}computeEditWindowLinesRange(e,r,n,o){let s=e.lines,c=e.cursorLineOffset,l;if(this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderUseVaryingLinesAbove,this.expService)){l=0;for(let g=0;g<8;++g){let A=c-g;if(A<0)break;if(s[A].trim()!==""){l=g;break}}}else l=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesAbove,this.expService)??gV.N_LINES_ABOVE;let u;if(r.expandedEditWindowNLines!==void 0)n.trace(`Using expanded nLinesBelow: ${r.expandedEditWindowNLines}`),u=r.expandedEditWindowNLines;else{let m=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesBelow,this.expService);m!==void 0?(n.trace(`Using overridden nLinesBelow: ${m}`),u=m):(n.trace(`Using default nLinesBelow: ${gV.N_LINES_BELOW}`),u=gV.N_LINES_BELOW)}let d=Math.max(0,c-l),f=Math.min(s.length,c+u+1),h=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabMaxMergeConflictLines,this.expService);if(h){let m=new s5r.OffsetRange(d,f),g=(0,i5r.findMergeConflictMarkersRange)(s,m,h);if(g){let A=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabOnlyMergeConflictLines,this.expService);o.setMergeConflictExpanded(A?"only":"normal"),A?(n.trace(`Expanding edit window to include ONLY merge conflict markers: ${g.toString()}`),d=g.start,f=g.endExclusive):(n.trace(`Expanding edit window to include merge conflict markers: ${g.toString()}; edit window range [${d}, ${f})`),f=Math.max(f,g.endExclusive))}}return new s5r.OffsetRange(d,f)}determineModelConfiguration(e){if(this.forceUseDefaultModel){let s={modelName:void 0,...Go.DEFAULT_OPTIONS},c=this.modelService.defaultModelConfiguration();return{promptOptions:l5r(s,c),modelServiceConfig:c}}let r={modelName:void 0,promptingStrategy:void 0,currentFile:{maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileMaxTokens,this.expService),includeTags:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeTagsInCurrentFile,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeLineNumbersInCurrentFile,this.expService),includeCursorTag:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeCursorTagInCurrentFile,this.expService),prioritizeAboveCursor:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabPrioritizeAboveCursor,this.expService),useLeftoverBudgetFromAbove:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileUseLeftoverBudgetFromAbove,this.expService)},pagedClipping:{pageSize:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabPageSize,this.expService)},recentlyViewedDocuments:{nDocuments:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNRecentlyViewedDocuments,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedDocumentsMaxTokens,this.expService),includeViewedFiles:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeViewedFiles,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedIncludeLineNumbers,this.expService),clippingStrategy:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedClippingStrategy,this.expService),useLeftoverBudgetFromAbove:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedUseLeftoverBudgetFromAbove,this.expService)},languageContext:dUi(e.languageId,{enabled:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabled,this.expService),enabledLanguages:this.configService.getConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabledLanguages),enableAllContextProviders:this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.DiagnosticsContextProvider,this.expService)||this.configService.getExperimentBasedConfig(di.ConfigKey.Advanced.ChatSessionContextProvider,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextMaxTokens,this.expService),traitPosition:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextTraitsPosition,this.expService)}),neighborFiles:{enabled:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabIncludeNeighborFiles,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabNeighborFilesMaxTokens,this.expService)},diffHistory:{nEntries:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this.expService),maxTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffMaxTokens,this.expService),onlyForDocsInPrompt:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffOnlyForDocsInPrompt,this.expService),useRelativePaths:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabDiffUseRelativePaths,this.expService)},lintOptions:void 0,includePostScript:!0,globalBudget:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetEnabled,this.expService)?{totalTokens:this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetTotalTokens,this.expService),order:Go.GlobalBudgetOptions.DEFAULT_ORDER,shares:Go.GlobalBudgetOptions.DEFAULT_SHARES}:void 0},n=this.modelService.selectedModelConfiguration(),o=Go.applyStrategyConfig(n);return{promptOptions:l5r(r,o),modelServiceConfig:o}}getEndpointWithLogging(e,r,n){let o=this.getEndpoint(e);return r.setEndpointInfo(typeof o.urlOrRequestMetadata=="string"?o.urlOrRequestMetadata:JSON.stringify(o.urlOrRequestMetadata.type),o.model),n.setModelName(o.model),o}getEndpoint(e){let r=this.configService.getConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl),n=this.configService.getConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey);return r!==void 0&&n!==void 0?this.instaService.createInstance(_Tc.XtabEndpoint,r,n,e):(0,VSc.createProxyXtabEndpoint)(this.instaService,e)}getPredictedOutput(e,r,n,o,s){if(!this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderUsePrediction,this.expService))return;let l=s===Go.ResponseFormat.CustomDiffPatch?this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchModelPredictionKind,this.expService):Go.PatchModelPrediction.FilePath;return{type:"content",content:fUi(e,r,n,o,s,l)}}async debounce(e,r,n,o,s){if(this.simulationCtx.isInSimulationTests)return;if(r instanceof AV.Retrying){n.trace("Skipping debounce on retry");return}let c=e.getDebounceTime();n.trace(`Debouncing for ${c} ms`),o.setDebounceTime(c);try{await(0,hV.timeout)(c,s)}catch{}}determineArtificialDelayMs(e,r,n){if(this.simulationCtx.isInSimulationTests)return;let o=e.getArtificialDelay();if(!(o<=0))return r.trace(`Enforcing artificial delay of ${o} ms`),n.setArtificialDelay(o),o}filterEdit(e,r,n){let o=[l=>({filterName:"IgnoreImportChangesAspect",filteredEdits:hTc.IgnoreImportChangesAspect.filterEdit(e,l,n)}),l=>({filterName:"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges",filteredEdits:Ebt.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges.filterEdit(e,l)})];this.configService.getExperimentBasedConfig(di.ConfigKey.InlineEditsAllowWhitespaceOnlyChanges,this.expService)||o.push(l=>({filterName:"IgnoreWhitespaceOnlyChanges",filteredEdits:Ebt.IgnoreWhitespaceOnlyChanges.filterEdit(e,l)}));let s=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsUndoInsertionFiltering,this.expService);if(s!==void 0){let l;switch(s){case"v1":l=Ebt.editWouldDeleteWhatWasJustInserted;break;case"v2":l=Ebt.editWouldDeleteWhatWasJustInserted2;break;default:(0,Zne.assertNever)(s)}o.push(u=>({filterName:`UndoInsertionFiltering:${s}`,filteredEdits:l(e,new vbt.LineEdit(u))?[]:u}))}let c=this.configService.getExperimentBasedConfig(di.ConfigKey.TeamInternal.InlineEditsFilterOutEditsWithSubstrings,this.expService);if(c){let l=c.split(",").map(u=>u.trim()).filter(u=>u.length>0);o.push(u=>({filterName:"FilterOutEditsWithSubstrings",filteredEdits:cUi(u,l)}))}return o.reduce(([l,u],d)=>{let f=d(l);return f.filteredEdits.length===l.length?[l,u]:[f.filteredEdits,[...u,f.filterName]]},[r,[]])}static getNextCursorColumn(e){return(e?.match(/^(\s*)/)?.at(1)?.length??0)+1}};Pp.XtabProvider=a5r;Pp.XtabProvider=a5r=o9=jSc([hN(0,ZSc.IInlineEditsModelService),hN(1,eTc.ISimulationTestContext),hN(2,uTc.IInstantiationService),hN(3,rTc.IWorkspaceService),hN(4,$Sc.IDiffService),hN(5,di.IConfigurationService),hN(6,tTc.IExperimentationService),hN(7,sUi.ILanguageContextProviderService),hN(8,XSc.ILanguageDiagnosticsService),hN(9,WSc.IIgnoreService),hN(10,ATc.ISimilarFilesContextService)],a5r);function cUi(t,e){return t.filter(r=>r.newLines.every(n=>e.every(o=>!n.includes(o))))}a(cUi,"filterOutEditsWithSubstrings");function lUi(t){let e=t.cursorLineOffset,r=Math.max(0,e-gV.N_LINES_AS_CONTEXT),n=Math.min(t.lines.length,e+gV.N_LINES_AS_CONTEXT+1);return new s5r.OffsetRange(r,n)}a(lUi,"computeAreaAroundEditWindowLinesRange");function c5r(t){switch(t.type){case Lf.ChatFetchResponseType.Canceled:return new Ds.NoNextEditReason.GotCancelled("afterFetchCall");case Lf.ChatFetchResponseType.OffTopic:case Lf.ChatFetchResponseType.Filtered:case Lf.ChatFetchResponseType.PromptFiltered:case Lf.ChatFetchResponseType.Length:case Lf.ChatFetchResponseType.RateLimited:case Lf.ChatFetchResponseType.QuotaExceeded:case Lf.ChatFetchResponseType.ExtensionBlocked:case Lf.ChatFetchResponseType.AgentUnauthorized:case Lf.ChatFetchResponseType.AgentFailedDependency:case Lf.ChatFetchResponseType.InvalidStatefulMarker:return new Ds.NoNextEditReason.Uncategorized(mV.ErrorUtils.fromUnknown(t));case Lf.ChatFetchResponseType.BadRequest:case Lf.ChatFetchResponseType.NotFound:case Lf.ChatFetchResponseType.Failed:case Lf.ChatFetchResponseType.NetworkError:case Lf.ChatFetchResponseType.Unknown:return new Ds.NoNextEditReason.FetchFailure(mV.ErrorUtils.fromUnknown(t))}}a(c5r,"mapChatFetcherErrorToNoNextEditReason");function l5r(t,e){return{...t,modelName:e.modelName,promptingStrategy:e.promptingStrategy,includePostScript:e.includePostScript??t.includePostScript,currentFile:{...t.currentFile,...e.currentFile,includeTags:e.includeTagsInCurrentFile},recentlyViewedDocuments:{...t.recentlyViewedDocuments,...e.recentlyViewedDocuments},lintOptions:e.lintOptions?STc(t.lintOptions,e.lintOptions):t.lintOptions}}a(l5r,"overrideModelConfig");var bTc={...Go.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,maxLineDistance:10};function STc(t,e){return{...t??bTc,...e}}a(STc,"mergeLintOptions");function uUi(t){switch(t){case Go.PromptingStrategy.UnifiedModel:return qBe.unifiedModelSystemPrompt;case Go.PromptingStrategy.Codexv21NesUnified:case Go.PromptingStrategy.SimplifiedSystemPrompt:return qBe.simplifiedPrompt;case Go.PromptingStrategy.PatchBased:case Go.PromptingStrategy.PatchBased01:case Go.PromptingStrategy.PatchBased02:case Go.PromptingStrategy.PatchBased02WithRecentLineNumbers:case Go.PromptingStrategy.PatchBased02WithoutRecentLineNumbers:case Go.PromptingStrategy.Xtab275:case Go.PromptingStrategy.XtabAggressiveness:case Go.PromptingStrategy.Xtab275Aggressiveness:case Go.PromptingStrategy.Xtab275AggressivenessHighLow:case Go.PromptingStrategy.Xtab275EditIntent:case Go.PromptingStrategy.Xtab275EditIntentShort:return qBe.xtab275SystemPrompt;case Go.PromptingStrategy.Nes41Miniv3:return qBe.nes41Miniv3SystemPrompt;case Go.PromptingStrategy.CopilotNesXtab:case void 0:return qBe.systemPromptTemplate;default:(0,Zne.assertNever)(t)}}a(uUi,"pickSystemPrompt");function dUi(t,{enabled:e,enabledLanguages:r,maxTokens:n,enableAllContextProviders:o,traitPosition:s}){return t in r?{enabled:r[t],maxTokens:n,traitPosition:s}:o?{enabled:!0,maxTokens:n,traitPosition:s}:{enabled:e,maxTokens:n,traitPosition:s}}a(dUi,"determineLanguageContextOptions");function fUi(t,e,r,n,o,s){if(o===Go.ResponseFormat.UnifiedWithXml)return["",...r,""].join(` +- Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;sk.simplifiedPrompt="Predict next code edit based on the context given by the user.";sk.xtab275SystemPrompt=`Predict the next code edit based on user context, following Microsoft content policies and avoiding copyright violations. If a request may breach guidelines, reply: "Sorry, I can't assist with that."`});var Nbt=I(SV=>{"use strict";p();Object.defineProperty(SV,"__esModule",{value:!0});SV.NullTerminalService=SV.ITerminalService=void 0;SV.isTerminalService=jTc;SV.isNullTerminalService=HTc;var QTc=nn(),Dbt=Rc(),qTc=Ro();SV.ITerminalService=(0,QTc.createServiceIdentifier)("ITerminalService");var Q5r=class t extends qTc.Disposable{static{a(this,"NullTerminalService")}constructor(){super(...arguments),this._onDidWriteTerminalData=this._register(new Dbt.Emitter),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidChangeTerminalShellIntegration=this._register(new Dbt.Emitter),this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidEndTerminalShellExecution=this._register(new Dbt.Emitter),this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._onDidCloseTerminal=this._register(new Dbt.Emitter),this.onDidCloseTerminal=this._onDidCloseTerminal.event}static{this.Instance=new t}get terminalBuffer(){return""}get terminalLastCommand(){}get terminalSelection(){return""}get terminalShellType(){return""}async getCwdForSession(e){return Promise.resolve(void 0)}async getCopilotTerminals(e){return Promise.resolve([])}getTerminalsWithSessionInfo(){throw new Error("Method not implemented.")}getToolTerminalForSession(e){throw new Error("Method not implemented.")}async associateTerminalWithSession(e,r,n){Promise.resolve()}createTerminal(e,r,n){return{}}get terminals(){return[]}getBufferForTerminal(e,r){return""}getBufferWithPid(e,r){return Promise.resolve("")}getLastCommandForTerminal(e){}contributePath(e,r,n,o){}removePathContribution(e){}};SV.NullTerminalService=Q5r;function jTc(t){return t&&typeof t.createTerminal=="function"}a(jTc,"isTerminalService");function HTc(t){return t&&typeof t.createTerminal=="function"&&t.createTerminal()===void 0}a(HTc,"isNullTerminalService")});var b7i=I(g9=>{"use strict";p();var GTc=g9&&g9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},$Tc=g9&&g9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(g9,"__esModule",{value:!0});g9.TerminalMonitor=void 0;var VTc=Nbt(),WTc=Ro(),s3e=2e3,q5r=class extends WTc.Disposable{static{a(this,"TerminalMonitor")}constructor(e){super(),this._terminalService=e,this._register(this._terminalService.onDidEndTerminalShellExecution(r=>{this._recordTerminalActivity(r)})),this._register(this._terminalService.onDidCloseTerminal(r=>{this._lastActivity?.terminal===r&&(this._lastActivity=void 0)}))}_recordTerminalActivity(e){let r=e.execution;this._lastActivity={terminal:e.terminal,terminalName:e.terminal.name,commandLine:r.commandLine?.value,cwd:zTc(r.cwd),exitCode:e.exitCode,timestamp:Date.now()}}getData(){let e=Date.now(),r=this._terminalService.terminals.length;if(!this._lastActivity)return JSON.stringify({terminalCount:r});let n=this._terminalService.getBufferForTerminal(this._lastActivity.terminal,s3e*2),o=e-this._lastActivity.timestamp,s={terminalName:this._lastActivity.terminalName,commandLine:this._lastActivity.commandLine,cwd:this._lastActivity.cwd,exitCode:this._lastActivity.exitCode,msAgo:o,buffer:n.length<=s3e?{fits:!0,content:n,length:n.length}:{fits:!1,contentStart:n.slice(0,s3e/2),contentEnd:n.slice(-s3e/2),length:n.length,truncatedChars:n.length-s3e},terminalCount:r};return JSON.stringify(s)}};g9.TerminalMonitor=q5r;g9.TerminalMonitor=q5r=GTc([$Tc(0,VTc.ITerminalService)],q5r);function zTc(t){if(t!==void 0)return typeof t=="string"?t:t.fsPath}a(zTc,"formatCwd")});var S7i=I(Mbt=>{"use strict";p();Object.defineProperty(Mbt,"__esModule",{value:!0});Mbt.CurrentDocument=void 0;var YTc=Rs(),j5r=class{static{a(this,"CurrentDocument")}constructor(e,r){this.content=e,this.cursorPosition=r,this.lines=e.getLines(),this.transformer=e.getTransformer(),this.cursorOffset=this.transformer.getOffset(r),this.cursorLineOffset=this.cursorPosition.lineNumber-1}lineWithCursor(){let e=this.lines.at(this.cursorLineOffset);if(e===void 0)throw new YTc.BugIndicatingError(`CurrentDocument#lineWithCursor: cursor is out of bounds: cursor: ${this.cursorLineOffset}, doc line count: ${this.lines.length}`);return e}textAfterCursor(){return this.lineWithCursor().substring(this.cursorPosition.column-1)}isCursorAtEndOfLine(){return this.textAfterCursor().match(/^\s*$/)!==null}};Mbt.CurrentDocument=j5r});var w7i=I(Obt=>{"use strict";p();Object.defineProperty(Obt,"__esModule",{value:!0});Obt.getCurrentLine=JTc;Obt.isModelLineCompatible=ZTc;var T7i=$_(),KTc=svt();function JTc(t,e,r,n){let o=e+1,s=t.textLength.lineCount+1;if(o<1||o>s)return;let c=t.getOffset(new T7i.Position(o,1)),l=0;for(let A of r.replacements)if(A.replaceRange.endExclusive<=c)l+=A.newText.length-A.replaceRange.length;else{if(A.replaceRange.start=o.startOffset&&n.endOffset<=o.endOffset?eIc(n,o,e,r):!1}a(ZTc,"isModelLineCompatible");var XTc=new Set(["()","[]","{}","<>",'""',"''","``"]);function eIc(t,e,r,n){return t.replaced.length>0?r===n?!0:t.startOffset===e.startOffset&&t.endOffset===e.endOffset&&t.replaced===e.replaced&&t.inserted.length>0&&x7i(t.inserted,e.inserted):x7i(t.inserted,e.inserted)}a(eIc,"isUserEditCompatibleWithModelEdit");function x7i(t,e){return e.startsWith(t)?!0:XTc.has(t)?tIc(t,e):!1}a(x7i,"isUserTypingCompatibleWithModelText");function tIc(t,e){let r=0;for(let n=0;n{"use strict";p();var rIc=_N&&_N.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nIc=_N&&_N.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),iIc=_N&&_N.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o ${r}`);let d=(async function*(){let f=await o.next();for(;!f.done;)yield f.value,f=await o.next()})();return{editIntent:r,remainingLinesStream:d,parseError:n}}n=`unknownIntentValue:${c}`,e.warn(`Edit intent parse error: ${n} (using Xtab275EditIntentShort prompting strategy). Defaulting to High (always show). First line was: "${c.substring(0,100)}..."`);let u=(async function*(){yield s.value;let d=await o.next();for(;!d.done;)yield d.value,d=await o.next()})();return{editIntent:r,remainingLinesStream:u,parseError:n}}a(sIc,"parseEditIntentFromStreamShortName");async function aIc(t,e){let r="<|edit_intent|>",n="<|/edit_intent|>",o=Lbt.EditIntent.High,s,c=t[Symbol.asyncIterator](),l=await c.next();if(l.done){s="emptyResponse",e.warn("Empty response stream, no edit_intent tag found");let m=(async function*(){})();return{editIntent:o,remainingLinesStream:m,parseError:s}}let u=l.value,d=u.indexOf(r),f=u.indexOf(n);if(d!==-1&&f!==-1&&f>d){let m=u.substring(d+r.length,f).trim().toLowerCase();["no_edit","low","medium","high"].includes(m)||(s=`unknownIntentValue:${m}`,e.warn(`Unknown edit_intent value: "${m}", defaulting to High`)),o=Lbt.EditIntent.fromString(m),e.trace(`Parsed edit_intent from first line: "${m}" -> ${o}`);let A=u.substring(f+n.length),y=(async function*(){A.trim()!==""&&(yield A);let E=await c.next();for(;!E.done;)yield E.value,E=await c.next()})();return{editIntent:o,remainingLinesStream:y,parseError:s}}d!==-1&&f===-1?s="malformedTag:startWithoutEnd":d===-1&&f!==-1?s="malformedTag:endWithoutStart":s="noTagFound",e.warn(`Edit intent parse error: ${s} (using Xtab275EditIntent prompting strategy). Defaulting to High (always show). First line was: "${u.substring(0,100)}..."`);let h=(async function*(){yield u;let m=await c.next();for(;!m.done;)yield m.value,m=await c.next()})();return{editIntent:o,remainingLinesStream:h,parseError:s}}a(aIc,"parseEditIntentFromStreamTags")});var Fbt=I(pEe=>{"use strict";p();Object.defineProperty(pEe,"__esModule",{value:!0});pEe.linesWithBackticksRemoved=lIc;pEe.constructMessages=uIc;pEe.charCount=dIc;pEe.findMergeConflictMarkersRange=fIc;var G5r=Io(),R7i=IBe(),cIc=Ed();async function*lIc(t){let e=-1,r;for await(let n of t)if(++e,r&&(yield r,r=void 0),n.match(/^```[a-z]*$/)){if(e===0)continue;r=n}else yield n}a(lIc,"linesWithBackticksRemoved");function uIc({systemMsg:t,userMsg:e}){return[{role:G5r.Raw.ChatRole.System,content:(0,R7i.toTextParts)(t)},{role:G5r.Raw.ChatRole.User,content:(0,R7i.toTextParts)(e)}]}a(uIc,"constructMessages");function dIc(t){return t.reduce((r,n)=>r+n.content.reduce((o,s)=>o+(s.type===G5r.Raw.ChatCompletionContentPartKind.Text?s.text.length:0),0),0)}a(dIc,"charCount");function fIc(t,e,r){for(let n=e.start;n>>>>>>"))return new cIc.OffsetRange(n,o+1)}}a(fIc,"findMergeConflictMarkersRange")});var D7i=I(TV=>{"use strict";p();Object.defineProperty(TV,"__esModule",{value:!0});TV.ResponseParseResult=void 0;TV.handleEditWindowOnly=mIc;TV.handleCodeBlock=gIc;TV.handleEditWindowWithEditIntent=AIc;TV.handleUnifiedWithXml=yIc;var a3e=Eye(),k7i=VG(),P7i=X2(),hEe=_V(),pIc=H5r(),hIc=Fbt(),NL;(function(t){class e{static{a(this,"EditWindowLines")}constructor(s,c){this.lines=s,this.editIntentMetadata=c}}t.EditWindowLines=e;class r{static{a(this,"Done")}constructor(s){this.reason=s}}t.Done=r;class n{static{a(this,"DirectEdits")}constructor(s){this.stream=s}}t.DirectEdits=n})(NL||(TV.ResponseParseResult=NL={}));function mIc(t){return new NL.EditWindowLines(t)}a(mIc,"handleEditWindowOnly");function gIc(t){return new NL.EditWindowLines((0,hIc.linesWithBackticksRemoved)(t))}a(gIc,"handleCodeBlock");async function AIc(t,e,r){let{editIntent:n,remainingLinesStream:o,parseError:s}=await(0,pIc.parseEditIntentFromStream)(t,e,r);return new NL.EditWindowLines(o,{intent:n,parseError:s})}a(AIc,"handleEditWindowWithEditIntent");async function yIc(t,e,r,n){let o=t[Symbol.asyncIterator](),s=await o.next();if(s.done)return new NL.Done(new a3e.NoNextEditReason.NoSuggestions(r,e.editWindow));let c=s.value.trim();if(c===hEe.ResponseTags.NO_CHANGE.start)return new NL.Done(new a3e.NoNextEditReason.NoSuggestions(r,e.editWindow));if(c===hEe.ResponseTags.INSERT.start)return new NL.DirectEdits(EIc(o,e,r));if(c===hEe.ResponseTags.EDIT.start){let l=_Ic(o);return new NL.EditWindowLines(l)}return new NL.Done(new a3e.NoNextEditReason.Unexpected(new Error(`unexpected tag ${c}`)))}a(yIc,"handleUnifiedWithXml");async function*EIc(t,e,r){let{editWindowLines:n,editWindowLineRange:o,cursorLineInEditWindowOffset:s,cursorColumnZeroBased:c,editWindow:l,originalEditWindow:u,targetDocument:d,isFromCursorJump:f}=e,h=await t.next();if(h.done||h.value.includes(hEe.ResponseTags.INSERT.end))return new a3e.NoNextEditReason.NoSuggestions(r,l);let m=n[s];yield{edit:new k7i.LineReplacement(new P7i.LineRange(o.start+s+1,o.start+s+2),[m.slice(0,c)+h.value+m.slice(c)]),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d};let A=[],y=await t.next();for(;!y.done&&!y.value.includes(hEe.ResponseTags.INSERT.end);)A.push(y.value),y=await t.next();let E=o.start+s+2;return yield{edit:new k7i.LineReplacement(new P7i.LineRange(E,E),A),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d},new a3e.NoNextEditReason.NoSuggestions(r,l)}a(EIc,"generateInsertEdits");async function*_Ic(t){let e=await t.next();for(;!e.done;){if(e.value.includes(hEe.ResponseTags.EDIT.end))return;yield e.value,e=await t.next()}}a(_Ic,"generateEditLines")});var N7i=I(A9=>{"use strict";p();var vIc=A9&&A9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ak=A9&&A9.__param||function(t,e){return function(r,n){e(r,n,t)}},Ubt;Object.defineProperty(A9,"__esModule",{value:!0});A9.XtabEndpoint=void 0;var CIc=HE(),bIc=l9(),$5r=Pl(),SIc=KE(),TIc=lV(),IIc=Xne(),xIc=xp(),wIc=Sy(),RIc=f9(),kIc=yh(),PIc=vm(),DIc=cV(),NIc=Yne(),MIc=$s(),V5r=class extends IIc.ChatEndpoint{static{a(this,"XtabEndpoint")}static{Ubt=this}static{this.chatModelInfo={id:"xtab-4o-mini-finetuned",name:"xtab-4o-mini-finetuned",vendor:"xtab",model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"unknown",capabilities:{type:"chat",family:"xtab-4o-mini-finetuned",tokenizer:NIc.TokenizerType.O200K,limits:{max_prompt_tokens:12285,max_output_tokens:4096},supports:{streaming:!0,parallel_tool_calls:!1,tool_calls:!1,vision:!1,prediction:!0}}}}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y){let E=n?{...Ubt.chatModelInfo,id:n}:Ubt.chatModelInfo;super(E,s,f,h,m,o,g,A,y),this._url=e,this._apiKey=r,this._configService=o}get urlOrRequestMetadata(){return this._configService.getConfig($5r.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl)||this._url}getExtraHeaders(){let e=this._configService.getConfig($5r.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey)||this._apiKey;if(!e){let r=`Missing API key for custom URL (${this.urlOrRequestMetadata}). Provide the API key using vscode setting \`github.copilot.chat.advanced.inlineEdits.xtabProvider.apiKey\` or, if in simulations using \`--nes-api-key\` or \`--config-file\``;throw console.error(r),new Error(r)}return{Authorization:`Bearer ${e}`,"api-key":e}}};A9.XtabEndpoint=V5r;A9.XtabEndpoint=V5r=Ubt=vIc([ak(3,$5r.IConfigurationService),ak(4,TIc.IDomainService),ak(5,wIc.IFetcherService),ak(6,SIc.ICAPIClientService),ak(7,PIc.ITelemetryService),ak(8,CIc.IAuthenticationService),ak(9,bIc.IChatMLFetcher),ak(10,DIc.ITokenizerProvider),ak(11,MIc.IInstantiationService),ak(12,kIc.IExperimentationService),ak(13,RIc.IChatWebSocketManager),ak(14,xIc.ILogService)],V5r)});var Qbt=I(mEe=>{"use strict";p();Object.defineProperty(mEe,"__esModule",{value:!0});mEe.NullProxyModelsService=mEe.IProxyModelsService=void 0;var OIc=nn(),LIc=Rc();mEe.IProxyModelsService=(0,OIc.createServiceIdentifier)("IProxyModelsService");var W5r=class{static{a(this,"NullProxyModelsService")}constructor(){this.onModelListUpdated=LIc.Event.None}get models(){}get nesModels(){}get cursorJumpModels(){}get instantApplyModels(){}};mEe.NullProxyModelsService=W5r});var M7i=I(sA=>{"use strict";p();var BIc=sA&&sA.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),FIc=sA&&sA.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),UIc=sA&&sA.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},QIc=sA&&sA.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;otypeof g=="boolean"?g?jbt.IncludeLineNumbersOption.WithSpaceAfter:jbt.IncludeLineNumbersOption.None:g),f=new Y5r.PromptPieces(e.currentDocument,e.editWindowLinesRange,e.areaAroundEditWindowLinesRange,e.activeDoc,e.xtabHistory,s.lines,c,e.langCtx,e.aggressivenessLevel,u,this.computeTokens,{...e.opts,includePostScript:!1,lintOptions:l,recentlyViewedDocuments:{...e.opts.recentlyViewedDocuments,includeLineNumbers:d}}),{prompt:h}=(0,Y5r.getUserPrompt)(f),m=(0,XIc.constructMessages)({systemMsg:r,userMsg:h});return CI.Result.ok({messages:m,keptRange:s.keptRange})}async predictNextCursorPosition(e,r,n){let o=r.tracer.createSubLogger("predictNextCursorPosition"),s=this.buildCursorPredictionPrompt(e);if(s.isError())return o.trace(`Failed to construct tagged file: ${s.err.message}`),CI.Result.fromString(s.err.message);let{messages:c,keptRange:l}=s.val;r.telemetry.setCursorJumpPrompt(c),r.logContext.setCursorJumpPrompt(c,l);let u=this.determineModelName();r.telemetry.setCursorJumpModelName(u);let d=await this.resolveEndpoint(u,o);if(!d)return CI.Result.fromString("endpointNotResolved");let{endpoint:f,usesResponsesApi:h}=d,m=this.configService.getConfig(vN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionApiKey),g=this.configService.getExperimentBasedConfig(vN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionMaxResponseTokens,this.expService),A={max_tokens:h?Math.max(g,2048):g};m&&(A={...A,secretKey:m});let y=await f.makeChatRequest2({messages:c,debugName:"nes.nextCursorPosition",finishedCb:void 0,location:z5r.ChatLocation.Other,requestOptions:A},n);if(y.type!==z5r.ChatFetchResponseType.Success)return y.type===z5r.ChatFetchResponseType.NotFound&&(o.trace("Next cursor position prediction endpoint not found; disabling predictor for current session."),this.isDisabled=!0),CI.Result.fromString(`fetchError:${y.type}`);try{r.telemetry.setCursorJumpResponse(y.value);let E=y.value.trim();return this.parseResponse(E,l)}catch(E){return o.trace(`Failed to parse predicted line number from response '${y.value}': ${E}`),CI.Result.fromString(`failedToParseLine:"${y.value}". Error ${zIc.ErrorUtils.fromUnknown(E).message}`)}}async resolveEndpoint(e,r){if(this.configService.getConfig(vN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUseEndpointProvider)){let c=(await this.endpointProvider.getAllChatEndpoints()).find(u=>u.model===e||u.family===e);if(!c){r.trace(`Could not find endpoint for model '${e}' via endpoint provider`);return}let l=c.apiType==="responses";return{endpoint:c,usesResponsesApi:l}}let o=this.configService.getConfig(vN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUrl);return{endpoint:this.instaService.createInstance(HIc.ChatEndpoint,{id:e,name:"nes.nextCursorPosition",vendor:e,urlOrRequestMetadata:o||{type:qIc.RequestType.ProxyChatCompletions},model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"",capabilities:{type:"chat",family:"",tokenizer:YIc.TokenizerType.CL100K,limits:void 0,supports:{parallel_tool_calls:!1,tool_calls:!1,streaming:!0,vision:!1,prediction:!1,thinking:!1}}}),usesResponsesApi:!1}}determineModelName(){return this.configService.getExperimentBasedConfig(vN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionModelName,this.expService)??this.proxyModelsService.cursorJumpModels?.[0]?.name??exc}determineLintOptions(){let e=this.configService.getConfig(vN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptions);if(e)return{...Hbt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,...e};let r=this.configService.getExperimentBasedConfig(vN.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptionsString,this.expService);return r?(0,Hbt.parseLintOptionString)(r,Hbt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS):Hbt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS}parseResponse(e,r){let n=txc(e),o=parseInt(n,10);if(!isNaN(o)&&String(o)===n)return this.parseSameFileLineNumber(o,r);let s=n.lastIndexOf(":");if(s<=0)return CI.Result.fromString("gotNaN");let c=n.substring(0,s),l=n.substring(s+1),u=parseInt(l,10);return isNaN(u)||u<0?CI.Result.fromString("crossFileInvalidLineNumber"):c.trim().length===0?CI.Result.fromString("crossFileEmptyFilePath"):CI.Result.ok({kind:"differentFile",filePath:c.trim(),lineNumber:u})}parseSameFileLineNumber(e,r){return e<0?CI.Result.fromString("negativeLineNumber"):e[\s\S]*?<\/think>\s*/g,"");return e.trimStart().startsWith("")&&(e=""),e.trim()}a(txc,"stripThinkTags")});var q7i=I(l3e=>{"use strict";p();Object.defineProperty(l3e,"__esModule",{value:!0});l3e.XtabPatchResponseHandler=void 0;l3e.tryRemoveDuplicateAdditions=Q7i;var O7i=tie(),c3e=Ay(),rxc=Pgt(),L7i=Eye(),nxc=nv(),ixc=Sl(),oxc=LA(),B7i=ad(),U7i=VG(),sxc=X2(),axc=v5r(),cxc=dEe(),lxc=_V(),AEe=class t{static{a(this,"Patch")}constructor(e,r){this.filePath=e,this.lineNumZeroBased=r,this.removedLines=[],this.addedLines=[]}static ofLine(e){let r=e.match(/^(.+):(\d+)$/);if(!r)return null;let[,n,o]=r;return new t(n,parseInt(o,10))}static insertion(e,r){return new t(e,r)}addLine(e){let r=e.slice(1);return e.startsWith("-")?(this.removedLines.push(r),!0):e.startsWith("+")?(this.addedLines.push(r),!0):!1}toString(){return[`${this.filePath}:${this.lineNumZeroBased}`,...this.removedLines.map(e=>`-${e}`),...this.addedLines.map(e=>`+${e}`)].join(` +`)}};function J5r(t){return t.trim().length>1}a(J5r,"isMeaningfulLine");function Q7i(t,e){let r=t.newLines;if(r.length===0)return;let n=t.lineRange.endLineNumberExclusive,o=e.lineRange.endLineNumberExclusive-1,s=Math.min(o+1,n+r.length),c=[];for(let l=n;l=1;l--){let u=r.slice(-l);if((0,ixc.equals)(u,c.slice(0,l)))return{kind:"suffix",newAdditions:r.slice(0,r.length-l),removedLines:u}}if(r[0]===c[0]&&J5r(r[0]))return{kind:"prefix",newAdditions:r.slice(1),removedLines:r.slice(0,1)};if(r.length>=3&&c.length>=2&&J5r(c[0])&&J5r(c[1])){let l=c[0],u=c[1];for(let d=1;d=1&&c.lineNumZeroBased===l&&c.filePath===u&&rxc.ResponseProcessor.isAdditiveEdit(c.removedLines[0],c.addedLines[0])}a(o,"isGhostTextPatch"),t.isGhostTextPatch=o;async function*s(c,l,u){let d=null,f=!0,h=!1;for await(let m of c){if(m.trim()===lxc.ResponseTags.NO_EDIT)break;if(d===null){d=AEe.ofLine(m);continue}if(d.addLine(m)){if(f&&!h&&l!==void 0&&u!==void 0&&d.addedLines.length===1&&d.removedLines.length>=1){if(o(d,l,u)){let g=AEe.insertion(d.filePath,d.lineNumZeroBased);g.removedLines=[...d.removedLines],g.addedLines=[...d.addedLines],yield g,d=AEe.insertion(d.filePath,d.lineNumZeroBased+1)}h=!0}continue}(d.removedLines.length>0||d.addedLines.length>0)&&(yield d),d=AEe.ofLine(m),f=!1}d&&(d.removedLines.length>0||d.addedLines.length>0)&&(yield d)}a(s,"extractEdits"),t.extractEdits=s})(F7i||(l3e.XtabPatchResponseHandler=F7i={}))});var oQi=I(Mp=>{"use strict";p();var dxc=Mp&&Mp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fxc=Mp&&Mp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pxc=Mp&&Mp.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},hxc=Mp&&Mp.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oMath.floor(e.length/4)}constructor(e,r,n,o,s,c,l,u,d,f,h){this.modelService=e,this.simulationCtx=r,this.instaService=n,this.workspaceService=o,this.diffService=s,this.configService=c,this.expService=l,this.langCtxService=u,this.langDiagService=d,this.ignoreService=f,this.similarFilesContextService=h,this.ID=y9.ID,this.forceUseDefaultModel=!1,this.userInteractionMonitor=this.instaService.createInstance(Fxc.UserInteractionMonitor),this.terminalMonitor=this.instaService.createInstance(Hxc.TerminalMonitor),this.nextCursorPredictor=this.instaService.createInstance(Vxc.XtabNextCursorPredictor,y9.computeTokens)}handleAcceptance(){this.userInteractionMonitor.handleAcceptance()}handleRejection(){this.userInteractionMonitor.handleRejection()}handleIgnored(){this.userInteractionMonitor.handleIgnored()}async*provideNextEdit(e,r,n,o){let s=new Ds.StatelessNextEditTelemetryBuilder(e.headerRequestId);n.setProviderStartTime();try{if(e.xtabEditHistory.length===0){let h=new Ds.NoNextEditReason.ActiveDocumentHasNoEdits;return new Ds.WithStatelessProviderTelemetry(h,s.build(Vbt.Result.error(h)))}let c=this.userInteractionMonitor.createDelaySession(e.providerRequestStartDateTime),l={tracer:r,logContext:n,telemetry:s},u=this.doGetNextEdit(e,c,l,o,RV.NotRetrying.INSTANCE),d=await u.next();for(;!d.done;)yield new Ds.WithStatelessProviderTelemetry(d.value,s.build(Vbt.Result.ok(void 0))),d=await u.next();let f=d.value;return f instanceof Ds.NoNextEditReason.GotCancelled&&n.setIsSkipped(),new Ds.WithStatelessProviderTelemetry(f,s.build(Vbt.Result.error(f)))}catch(c){let l=xV.ErrorUtils.fromUnknown(c),u=new Ds.NoNextEditReason.Unexpected(l);return new Ds.WithStatelessProviderTelemetry(u,s.build(Vbt.Result.error(u)))}finally{n.setProviderEndTime()}}doGetNextEdit(e,r,n,o,s){return this.doGetNextEditWithSelection(e,(0,Bxc.getOrDeduceSelectionFromLastEdit)(e.getActiveDocument()),r,n,o,s)}async*doGetNextEditWithSelection(e,r,n,o,s,c,l){let u=o.tracer.createSubLogger(["XtabProvider","doGetNextEditWithSelection"]),{logContext:d,telemetry:f}=o,h=e.getActiveDocument();if(r===null)return new Ds.NoNextEditReason.Uncategorized(new Error("NoSelection"));let{promptOptions:m,modelServiceConfig:g}=this.determineModelConfiguration(h);f.setModelConfig(JSON.stringify(g));let A=this.getEndpointWithLogging(m.modelName,d,f),y=new Z5r.Position(r.endLineNumber,r.endColumn),E=new Gxc.CurrentDocument(h.documentAfterEdits,y);this._configureDebounceTimings(e,E,m,f,n,u);let _=tQi(E),v=this.computeEditWindowLinesRange(E,e,u,f),b=Math.max(0,E.cursorLineOffset-v.start),T=E.transformer.getLineLength(v.endExclusive),w=E.transformer.getOffsetRange(new zbt.Range(v.start+1,1,v.endExclusive,T+1));e.requestEditWindow=l?new Ds.RequestEditWindowWithCursorJump(w,l):new Ds.RequestEditWindow(w);let R=E.lines.slice(v.start,v.endExclusive),x=this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabEditWindowMaxTokens,this.expService);if(x!==void 0&&(0,X7i.countTokensForLines)(R,y9.computeTokens)>x)return new Ds.NoNextEditReason.PromptTooLarge("editWindow");let D=!R.some(we=>we.includes(Y7i.PromptTags.CURSOR)),N=(0,wV.constructTaggedFile)(E,v,_,m,y9.computeTokens,{includeLineNumbers:{areaAroundCodeToEdit:Go.IncludeLineNumbersOption.None,currentFileContent:m.currentFile.includeLineNumbers}});if(N.isError())return new Ds.NoNextEditReason.PromptTooLarge("currentFile");let{clippedTaggedCurrentDoc:L,areaAroundCodeToEdit:B}=N.val;f.setNLinesOfCurrentFileInPrompt(L.lines.length);let{aggressivenessLevel:j,userHappinessScore:M}=this.userInteractionMonitor.getAggressivenessLevel(),O=this.configService.getExperimentBasedConfig(ui.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService);f.setUserAggressivenessSetting(O),f.setXtabAggressivenessLevel(j),M!==void 0&&f.setXtabUserHappinessScore(M);let U=await this.getAndProcessLanguageContext(e,n,h,y,m,{tracer:u,logContext:d,telemetry:f},s);if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterLanguageContextAwait");let q=m.neighborFiles.enabled?await(0,IV.raceCancellation)((0,IV.raceTimeout)(this.similarFilesContextService.getSnippetsForPrompt(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset),n.getDebounceTime()),s):void 0;if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterNeighborSnippetsAwait");let Q=new qxc.LintErrors(h.id,E,this.langDiagService,e.xtabEditHistory),Y=new wV.PromptPieces(E,v,_,h,e.xtabEditHistory,L.lines,B,U,j,Q,y9.computeTokens,m,q),{prompt:W,nDiffsInPrompt:V,diffTokensInPrompt:z,neighborSnippetsResult:ie}=(0,wV.getUserPrompt)(Y);f.setNDiffsInPrompt(V),f.setDiffTokensInPrompt(z),ie&&(f.setNNeighborSnippetsComputed(ie.nComputed),f.setNNeighborSnippetsInPrompt(ie.nIncluded),f.setNeighborSnippetIndicesInPrompt(ie.includedIndices));let H=Go.ResponseFormat.fromPromptingStrategy(m.promptingStrategy),te=this.getPredictedOutput(h,E.cursorLineOffset,R,b,H),le=(0,X5r.constructMessages)({systemMsg:rQi(m.promptingStrategy),userMsg:W});d.setPrompt(le),f.setPrompt(le);let Le=3e4*4;if((0,X5r.charCount)(le)>Le)return new Ds.NoNextEditReason.PromptTooLarge("final");if(await this.debounce(n,c,u,f,s),s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterDebounce");Promise.resolve().then(()=>{let we=Q.getData();f.setLintErrors(we),d.setDiagnosticsData(we);let re=this.terminalMonitor.getData();f.setTerminalOutput(re),d.setTerminalData(re)}),f.setSimilarFilesContext(this.similarFilesContextService.compute(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset)),e.fetchIssued=!0;let Oe={endpoint:A,modelServiceConfig:g,messages:le,clippedTaggedCurrentDoc:L,editWindowInfo:{editWindow:w,editWindowLines:R,cursorLineInEditWindowOffset:b,editWindowLineRange:v},promptPieces:Y,prediction:te,originalEditWindow:l};return yield*this.streamEditsWithFiltering(e,Oe,{shouldRemoveCursorTagFromResponse:D,responseFormat:H},{aggressivenessLevel:j,userHappinessScore:M},c,n,{tracer:u,logContext:d,telemetry:f},s)}_configureDebounceTimings(e,r,n,o,s,c){let l=r.isCursorAtEndOfLine();o.setIsCursorAtLineEnd(l);let u=(0,Qxc.determineIsInlineSuggestionPosition)(r);if(o.setIsInlineSuggestion(!!u),e.isSpeculative)c.trace("No extra debounce applied for speculative request");else{let d=this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsExtraDebounceInlineSuggestion,this.expService);u&&d>0?(c.trace("Debouncing for inline suggestion position"),s.setExtraDebounce(d)):l?(c.trace("Debouncing for cursor at end of line"),s.setExtraDebounce(this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsExtraDebounceEndOfLine,this.expService))):c.trace("No extra debounce applied")}(0,Vv.isAggressivenessStrategy)(n.promptingStrategy)||this._applyAggressivenessSettings(s,c)}_applyAggressivenessSettings(e,r){let n=this.configService.getExperimentBasedConfig(ui.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService),s={[Vv.AggressivenessSetting.Low]:{minResponseConfigKey:ui.ConfigKey.TeamInternal.InlineEditsAggressivenessLowMinResponseTimeMs},[Vv.AggressivenessSetting.Medium]:{minResponseConfigKey:ui.ConfigKey.TeamInternal.InlineEditsAggressivenessMediumMinResponseTimeMs},[Vv.AggressivenessSetting.High]:{debounceConfigKey:ui.ConfigKey.TeamInternal.InlineEditsAggressivenessHighDebounceMs},[Vv.AggressivenessSetting.Default]:void 0}[n];if(s){if(s.debounceConfigKey){let c=this.configService.getExperimentBasedConfig(s.debounceConfigKey,this.expService);e.setBaseDebounceTime(c),r.trace(`Aggressiveness ${n}: debounce set to ${c}ms`)}if(s.minResponseConfigKey){if(this.userInteractionMonitor.wasLastActionAcceptance){r.trace(`Aggressiveness ${n}: skipping min response time (last action was acceptance)`);return}let c=this.configService.getExperimentBasedConfig(s.minResponseConfigKey,this.expService);e.setExpectedTotalTime(c),r.trace(`Aggressiveness ${n}: min response time set to ${c}ms`)}}}getAndProcessLanguageContext(e,r,n,o,s,c,l){let u=this.configService.getConfig(ui.ConfigKey.TeamInternal.InlineEditsLogContextRecorderEnabled);if(!s.languageContext.enabled&&!u)return Promise.resolve(void 0);let d=this.getLanguageContext(e,r,n,o,c,l);return u&&d.then(f=>{f&&c.logContext.setLanguageContext(f)}),s.languageContext.enabled?d:Promise.resolve(void 0)}async getLanguageContext(e,r,n,o,s,c){try{let l=this.workspaceService.textDocuments.find(v=>v.uri.toString()===n.id.uri);if(l===void 0||this.langCtxService.getContextProviders(l,Z7i.ProviderTarget.NES).length<1)return;let d=r.getDebounceTime(),f=new Lxc.Position(o.lineNumber-1,o.column-1),h={opportunityId:e.opportunityId,completionId:e.headerRequestId,documentContext:{uri:l.uri.toString(),languageId:l.languageId,version:l.version,offset:l.offsetAt(f),position:f},activeExperiments:new Map,timeBudget:d,timeoutEnd:Date.now()+d,source:"nes"},m=a(async v=>{let b=[v.uri,...v.additionalUris??[]];return!!await(0,wxc.raceFilter)(b.map(w=>this.ignoreService.isCopilotIgnored(w)),w=>w)},"isSnippetIgnored"),g=[],A=a(async()=>{let v=this.langCtxService.getContextItems(l,h,c);for await(let b of v)b.kind===H7i.ContextKind.Snippet&&await m(b)||g.push({context:b,timeStamp:Date.now(),onTimeout:!1})},"getContextPromise"),y=Date.now();if(await(0,IV.raceCancellation)((0,IV.raceTimeout)(A(),d),c),c.isCancellationRequested)return;let E=Date.now(),_=this.langCtxService.getContextItemsOnTimeout(l,h);for(let v of _)v.kind===H7i.ContextKind.Snippet&&await m(v)||g.push({context:v,timeStamp:E,onTimeout:!0});return{start:y,end:E,items:g}}catch(l){s.logContext.setError(xV.ErrorUtils.fromUnknown(l)),s.tracer.trace(`Failed to fetch language context: ${l}`);return}}async*streamEditsWithFiltering(e,r,n,o,s,c,l,u){let d=l.tracer.createSubLogger("streamEditsWithFiltering"),f={...l,tracer:d},h=this.streamEdits(e,r,n,o,s,c,f,u),m=0,g=await h.next();for(;!g.done;){let A=g.value.edit,[y,E]=this.filterEdit(e.getActiveDocument(),[A],r.modelServiceConfig.allowImportChanges??vxc.ImportChanges.None);y.length===0?d.trace(`Filtered out an edit: ${A.toString()} using ${E.join(", ")} filter(s)`):(d.trace(`Yielding an edit: ${A.toString()}`),yield g.value,m++),g=await h.next()}return m===0&&g.value instanceof Ds.NoNextEditReason.NoSuggestions?yield*this.doGetNextEditsWithCursorJump(e,r,c,l,u,s):g.value}async*streamEdits(e,r,n,o,s,c,l,u){let d=l.tracer.createSubLogger("streamEdits"),f=new kxc.CancellationTokenSource(u),h=f.token;try{return yield*this._streamEditsImpl(e,r,n,o,s,c,{...l,tracer:d},u,f,h)}finally{f.dispose()}}async _performFetch(e,r,n,o,s,c,l,u,d,f){let{tracer:h,logContext:m,telemetry:g}=f,A=this.configService.getExperimentBasedConfig(ui.ConfigKey.NextEditSuggestionsFetcher,this.expService)||void 0,y=new mxc.FetchStreamSource,E=new Pxc.StopWatch,_="",v,b=new IV.DeferredPromise;m.setHeaderRequestId(o),g.setFetchStartedAt(),m.setFetchStartTime();let T=e.makeChatRequest2({debugName:y9.ID,messages:r,finishedCb:a(async(P,D,N)=>{b.isSettled||b.complete(),v===void 0&&P!==""&&(v=E.elapsed(),m.addLog(`TTFT ${v} ms`)),y.update(P,N),_=P,m.setResponse(_)},"finishedCb"),location:qf.ChatLocation.Other,source:void 0,requestOptions:{temperature:0,stream:!0,prediction:n},userInitiatedRequest:void 0,telemetryProperties:{requestId:o},useFetcher:A,customMetadata:{aggressivenessLevel:s.aggressivenessLevel,userHappinessScore:s.userHappinessScore}},d);g.setResponse(T.then(P=>({response:P,ttft:v}))),m.setFullResponse(T.then(P=>P.type===qf.ChatFetchResponseType.Success?P.value:void 0)),T.then(P=>{P.type!==qf.ChatFetchResponseType.Success?y.reject(new z7i.FetchStreamError(n4r(P))):y.resolve()}).catch(P=>{m.setError(xV.ErrorUtils.fromUnknown(P)),m.addLog("ChatMLFetcher fetch call threw -- this's UNEXPECTED!"),y.reject(xV.ErrorUtils.fromUnknown(P))}).finally(()=>{m.setFetchEndTime(),b.isSettled||b.complete(),m.setResponse(_)});let w=await Promise.race([b.p,T]);if(w&&w.type!==qf.ChatFetchResponseType.Success)return w.type===qf.ChatFetchResponseType.NotFound&&!this.forceUseDefaultModel?(this.forceUseDefaultModel=!0,kV.ModelNotFound.INSTANCE):w.type===qf.ChatFetchResponseType.Unknown&&w.reason===qf.RESPONSE_CONTAINED_NO_CHOICES?new kV.FetchFailure(new Ds.NoNextEditReason.NoSuggestions(u,l)):new kV.FetchFailure(n4r(w));let R=G7i.AsyncIterUtilsExt.splitLines(G7i.AsyncIterUtils.map(y.stream,P=>P.delta.text)),x=(async function*(){let P=0;for await(let D of R){let N=`Line ${P++} emitted with latency ${E.elapsed()} ms`;h.trace(N),yield c?D.replaceAll(Y7i.PromptTags.CURSOR,""):D}})();return new kV.Lines(x,()=>_,E)}async*_streamEditsImpl(e,r,n,o,s,c,l,u,d,f){let{tracer:h,logContext:m,telemetry:g}=l,{endpoint:A,messages:y,clippedTaggedCurrentDoc:E,editWindowInfo:_,promptPieces:v,prediction:b,originalEditWindow:T}=r,{editWindow:w,editWindowLines:R,cursorLineInEditWindowOffset:x,editWindowLineRange:P}=_,D=e.getActiveDocument().id,N=await this._performFetch(A,y,b,e.headerRequestId,o,n.shouldRemoveCursorTagFromResponse,w,e.documentBeforeEdits,f,l);if(N instanceof kV.ModelNotFound)return yield*this.doGetNextEdit(e,c,l,u,s);if(N instanceof kV.FetchFailure)return N.reason;let{linesStream:L,getResponseSoFar:B,fetchRequestStopWatch:j}=N,M=s instanceof RV.Retrying&&s.reason==="cursorJump",O;try{switch(n.responseFormat){case Go.ResponseFormat.EditWindowOnly:{O=(0,sie.handleEditWindowOnly)(L);break}case Go.ResponseFormat.CodeBlock:{O=(0,sie.handleCodeBlock)(L);break}case Go.ResponseFormat.EditWindowWithEditIntent:case Go.ResponseFormat.EditWindowWithEditIntentShort:{let ie=n.responseFormat===Go.ResponseFormat.EditWindowWithEditIntentShort?J7i.EditIntentParseMode.ShortName:J7i.EditIntentParseMode.Tags;O=await(0,sie.handleEditWindowWithEditIntent)(L,h,ie);break}case Go.ResponseFormat.CustomDiffPatch:{let ie=e.getActiveDocument(),H=v.currentDocument,le=H.lines[E.keptRange.endExclusive-1].length,Le=H.transformer.getOffsetRange(new zbt.Range(E.keptRange.start+1,1,E.keptRange.endExclusive,le+1)),ge=this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabDuplicateAdditionsMode,this.expService),Oe=this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchFastYieldLineWithCursor,this.expService);O=new sie.ResponseParseResult.DirectEdits(Wxc.XtabPatchResponseHandler.handleResponse(L,H,ie.id,ie.workspaceRoot,Le,h,ge,Oe));break}case Go.ResponseFormat.UnifiedWithXml:{O=await(0,sie.handleUnifiedWithXml)(L,{editWindowLines:R,editWindowLineRange:P,cursorLineInEditWindowOffset:x,cursorColumnZeroBased:v.currentDocument.cursorPosition.column-1,editWindow:w,originalEditWindow:T,targetDocument:D,isFromCursorJump:M},e.documentBeforeEdits,h);break}default:(0,aie.assertNever)(n.responseFormat)}if(O instanceof sie.ResponseParseResult.Done)return O.reason;if(O instanceof sie.ResponseParseResult.DirectEdits)return yield*O.stream;if(O.editIntentMetadata){let{intent:ie,parseError:H}=O.editIntentMetadata;if(g.setEditIntent(ie),H&&g.setEditIntentParseError(H),!Go.EditIntent.shouldShowEdit(ie,v.aggressivenessLevel))return h.trace(`Filtered out edit due to edit intent "${ie}" with aggressiveness "${v.aggressivenessLevel}"`),new Ds.NoNextEditReason.FilteredOut(`editIntent:${ie} aggressivenessLevel:${v.aggressivenessLevel}`)}let U=O.lines,q={emitFastCursorLineChange:j7i.ResponseProcessor.mapEmitFastCursorLineChange(this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabProviderEmitFastCursorLineChange,this.expService)),nLinesToConverge:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabNNonSignificantLinesToConverge,this.expService),nSignificantLinesToConverge:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabNSignificantLinesToConverge,this.expService)};h.trace(`starting to diff stream against edit window lines with latency ${j.elapsed()} ms`);let Q=(0,Rxc.backwardCompatSetting)(this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabEarlyCursorLineDivergenceCancellation,this.expService),ie=>{switch(ie){case!1:case void 0:return Vv.EarlyDivergenceCancellationMode.Off;case!0:return Vv.EarlyDivergenceCancellationMode.Cursor;case Vv.EarlyDivergenceCancellationMode.Off:case Vv.EarlyDivergenceCancellationMode.Cursor:case Vv.EarlyDivergenceCancellationMode.EditWindow:return ie;default:return Vv.EarlyDivergenceCancellationMode.Off}}),Y=!1,W=Q===Vv.EarlyDivergenceCancellationMode.Off?U:Kxc(U,x,e,P,R,d,l,ie=>{Y=ie},Q),V=0,z=!1;for await(let ie of j7i.ResponseProcessor.diff(R,W,x,q)){if(Y)break;h.trace(`ResponseProcessor streamed edit #${V} with latency ${j.elapsed()} ms`);let H=[];if(ie.lineRange.startLineNumber===ie.lineRange.endLineNumberExclusive||ie.newLines.length===0||ie.lineRange.endLineNumberExclusive-ie.lineRange.startLineNumber===1&&ie.newLines.length===1){let te=new Wbt.LineReplacement(new W7i.LineRange(ie.lineRange.startLineNumber+P.start,ie.lineRange.endLineNumberExclusive+P.start),ie.newLines);H.push(te)}else{let te=R.slice(ie.lineRange.startLineNumber-1,ie.lineRange.endLineNumberExclusive-1).join(` +`),le=await this.diffService.computeDiff(te,ie.newLines.join(` +`),{ignoreTrimWhitespace:!1,maxComputationTimeMs:0,computeMoves:!1});h.trace(`Ran diff for #${V} with latency ${j.elapsed()} ms`);let Le=P.start+ie.lineRange.startLineNumber;for(let ge of le.changes){let Oe=new Wbt.LineReplacement(new W7i.LineRange(Le+ge.original.startLineNumber-1,Le+ge.original.endLineNumberExclusive-1),ie.newLines.slice(ge.modified.startLineNumber-1,ge.modified.endLineNumberExclusive-1));H.push(Oe)}}m.setResponse(B());for(let te of H){if(h.trace(`extracting edit #${V}: ${te.toString()}`),!z){z=!0;let le=this.determineArtificialDelayMs(c,h,g);if(le&&(await(0,IV.timeout)(le),h.trace(`Artificial delay of ${le} ms completed`),u.isCancellationRequested))return new Ds.NoNextEditReason.GotCancelled("afterArtificialDelay")}yield{edit:te,isFromCursorJump:M,window:w,originalWindow:T,targetDocument:D},V++}}return Y?new Ds.NoNextEditReason.GotCancelled(Q===Vv.EarlyDivergenceCancellationMode.Cursor?"cursorLineDiverged":"editWindowLineDiverged"):new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,w)}catch(U){return U instanceof z7i.FetchStreamError?U.reason:(m.setError(U),new Ds.NoNextEditReason.Unexpected(xV.ErrorUtils.fromUnknown(U)))}}async*doGetNextEditsWithCursorJump(e,r,n,o,s,c){let{tracer:l,telemetry:u}=o,{editWindowInfo:{editWindow:d},modelServiceConfig:f,promptPieces:h}=r,m=new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d),g=this.nextCursorPredictor.determineEnablement(f.supportsNextCursorLinePrediction);if(g===void 0||c instanceof RV.Retrying)return m;if(e4r(e))return l.trace("Skipping cursor prediction: user typed during request"),new Ds.NoNextEditReason.GotCancelled("beforeNextCursorPredictionFetchUserTyped");let A=await this.nextCursorPredictor.predictNextCursorPosition(h,o,s);if(s.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetch");if(e4r(e))return l.trace("Skipping cursor prediction: user typed during prediction fetch"),new Ds.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetchUserTyped");if(A.isError())return l.trace(`Predicted next cursor line error: ${A.err.message}`),u.setNextCursorLineError(A.err.message),m;let y=A.val;if(y.kind==="differentFile")return yield*this.handleCrossFilePrediction(y,g,e,r,n,o,s);let E=y.lineNumber,_=E-h.currentDocument.cursorLineOffset;if(u.setNextCursorLineDistance(_),u.setNextCursorIsCrossFile(!1),l.trace(`Predicted next cursor line: ${E}`),E>=h.currentDocument.lines.length)return l.trace("Predicted next cursor line error: exceedsDocumentLines"),u.setNextCursorLineError("exceedsDocumentLines"),m;if(h.editWindowLinesRange.contains(E))return l.trace("Predicted next cursor line error: withinEditWindow"),u.setNextCursorLineError("withinEditWindow"),m;let v=E+1,b=h.activeDoc.documentAfterEditsLines.at(E),T=y9.getNextCursorColumn(b);switch(g){case Gbt.NextCursorLinePrediction.Jump:{let w=new Z5r.Position(v,T);return new Ds.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d,w)}case Gbt.NextCursorLinePrediction.OnlyWithEdit:return yield*this.doGetNextEditWithSelection(e,new zbt.Range(v,T,v,T),n,o,s,new RV.Retrying("cursorJump"),d);default:(0,aie.assertNever)(g)}}async*handleCrossFilePrediction(e,r,n,o,s,c,l){let{tracer:u,telemetry:d}=c,{editWindowInfo:{editWindow:f},promptPieces:h}=o,m=h.activeDoc.workspaceRoot;if(!m&&!(0,$7i.isAbsolute)(e.filePath))return u.trace("Predicted cross-file cursor jump error: noWorkspaceRoot"),d.setNextCursorLineError("crossFile:noWorkspaceRoot"),new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f);let g=(0,$7i.isAbsolute)(e.filePath)?V7i.URI.file(e.filePath):V7i.URI.joinPath(m,e.filePath),A=Exc.DocumentId.create(g.toString()),y=e.lineNumber+1,E=new Z5r.Position(y,1);switch(d.setNextCursorIsCrossFile(!0),u.trace(`Predicted cross-file cursor jump: ${e.filePath}:${e.lineNumber}`),r){case Gbt.NextCursorLinePrediction.Jump:return new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A);case Gbt.NextCursorLinePrediction.OnlyWithEdit:{let _;try{_=await this.workspaceService.openTextDocument(g)}catch(w){return u.trace(`Failed to open target file for cross-file edit: ${xV.ErrorUtils.fromUnknown(w).message}`),d.setNextCursorLineError("crossFile:failedToOpenFile"),new Ds.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A)}if(l.isCancellationRequested)return new Ds.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocument");if(e4r(n))return u.trace("Skipping cross-file edit: user typed during openTextDocument"),new Ds.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocumentUserTyped");let v=new Nxc.StringText(_.getText()),b=new Ds.StatelessNextEditDocument(A,h.activeDoc.workspaceRoot,Cxc.LanguageId.create(_.languageId),v.getLines(),Wbt.LineEdit.empty,v,new _xc.Edits(Dxc.StringEdit,[])),T=new Ds.StatelessNextEditRequest(n.headerRequestId,n.opportunityId,v,[b],0,n.xtabEditHistory,new IV.DeferredPromise,n.expandedEditWindowNLines,n.isSpeculative,n.logContext,n.recordingBookmark,n.recording,n.providerRequestStartDateTime);return yield*this.doGetNextEditWithSelection(T,new zbt.Range(y,1,y,1),s,c,l,new RV.Retrying("cursorJump"),f)}default:(0,aie.assertNever)(r)}}computeEditWindowLinesRange(e,r,n,o){let s=e.lines,c=e.cursorLineOffset,l;if(this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabProviderUseVaryingLinesAbove,this.expService)){l=0;for(let g=0;g<8;++g){let A=c-g;if(A<0)break;if(s[A].trim()!==""){l=g;break}}}else l=this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesAbove,this.expService)??wV.N_LINES_ABOVE;let u;if(r.expandedEditWindowNLines!==void 0)n.trace(`Using expanded nLinesBelow: ${r.expandedEditWindowNLines}`),u=r.expandedEditWindowNLines;else{let m=this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesBelow,this.expService);m!==void 0?(n.trace(`Using overridden nLinesBelow: ${m}`),u=m):(n.trace(`Using default nLinesBelow: ${wV.N_LINES_BELOW}`),u=wV.N_LINES_BELOW)}let d=Math.max(0,c-l),f=Math.min(s.length,c+u+1),h=this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabMaxMergeConflictLines,this.expService);if(h){let m=new t4r.OffsetRange(d,f),g=(0,X5r.findMergeConflictMarkersRange)(s,m,h);if(g){let A=this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabOnlyMergeConflictLines,this.expService);o.setMergeConflictExpanded(A?"only":"normal"),A?(n.trace(`Expanding edit window to include ONLY merge conflict markers: ${g.toString()}`),d=g.start,f=g.endExclusive):(n.trace(`Expanding edit window to include merge conflict markers: ${g.toString()}; edit window range [${d}, ${f})`),f=Math.max(f,g.endExclusive))}}return new t4r.OffsetRange(d,f)}determineModelConfiguration(e){if(this.forceUseDefaultModel){let s={modelName:void 0,...Go.DEFAULT_OPTIONS},c=this.modelService.defaultModelConfiguration();return{promptOptions:i4r(s,c),modelServiceConfig:c}}let r={modelName:void 0,promptingStrategy:void 0,currentFile:{maxTokens:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileMaxTokens,this.expService),includeTags:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabIncludeTagsInCurrentFile,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabIncludeLineNumbersInCurrentFile,this.expService),includeCursorTag:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabIncludeCursorTagInCurrentFile,this.expService),prioritizeAboveCursor:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabPrioritizeAboveCursor,this.expService),useLeftoverBudgetFromAbove:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileUseLeftoverBudgetFromAbove,this.expService)},pagedClipping:{pageSize:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabPageSize,this.expService)},recentlyViewedDocuments:{nDocuments:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabNRecentlyViewedDocuments,this.expService),maxTokens:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedDocumentsMaxTokens,this.expService),includeViewedFiles:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabIncludeViewedFiles,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedIncludeLineNumbers,this.expService),clippingStrategy:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedClippingStrategy,this.expService),useLeftoverBudgetFromAbove:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedUseLeftoverBudgetFromAbove,this.expService)},languageContext:nQi(e.languageId,{enabled:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabled,this.expService),enabledLanguages:this.configService.getConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabledLanguages),enableAllContextProviders:this.configService.getExperimentBasedConfig(ui.ConfigKey.Advanced.DiagnosticsContextProvider,this.expService)||this.configService.getExperimentBasedConfig(ui.ConfigKey.Advanced.ChatSessionContextProvider,this.expService),maxTokens:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextMaxTokens,this.expService),traitPosition:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextTraitsPosition,this.expService)}),neighborFiles:{enabled:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabIncludeNeighborFiles,this.expService),maxTokens:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabNeighborFilesMaxTokens,this.expService)},diffHistory:{nEntries:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this.expService),maxTokens:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabDiffMaxTokens,this.expService),onlyForDocsInPrompt:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabDiffOnlyForDocsInPrompt,this.expService),useRelativePaths:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabDiffUseRelativePaths,this.expService)},lintOptions:void 0,includePostScript:!0,globalBudget:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetEnabled,this.expService)?{totalTokens:this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetTotalTokens,this.expService),order:Go.GlobalBudgetOptions.DEFAULT_ORDER,shares:Go.GlobalBudgetOptions.DEFAULT_SHARES}:void 0},n=this.modelService.selectedModelConfiguration(),o=Go.applyStrategyConfig(n);return{promptOptions:i4r(r,o),modelServiceConfig:o}}getEndpointWithLogging(e,r,n){let o=this.getEndpoint(e);return r.setEndpointInfo(typeof o.urlOrRequestMetadata=="string"?o.urlOrRequestMetadata:JSON.stringify(o.urlOrRequestMetadata.type),o.model),n.setModelName(o.model),o}getEndpoint(e){let r=this.configService.getConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl),n=this.configService.getConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey);return r!==void 0&&n!==void 0?this.instaService.createInstance($xc.XtabEndpoint,r,n,e):(0,Axc.createProxyXtabEndpoint)(this.instaService,e)}getPredictedOutput(e,r,n,o,s){if(!this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabProviderUsePrediction,this.expService))return;let l=s===Go.ResponseFormat.CustomDiffPatch?this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsXtabProviderPatchModelPredictionKind,this.expService):Go.PatchModelPrediction.FilePath;return{type:"content",content:iQi(e,r,n,o,s,l)}}async debounce(e,r,n,o,s){if(this.simulationCtx.isInSimulationTests)return;if(r instanceof RV.Retrying){n.trace("Skipping debounce on retry");return}let c=e.getDebounceTime();n.trace(`Debouncing for ${c} ms`),o.setDebounceTime(c);try{await(0,IV.timeout)(c,s)}catch{}}determineArtificialDelayMs(e,r,n){if(this.simulationCtx.isInSimulationTests)return;let o=e.getArtificialDelay();if(!(o<=0))return r.trace(`Enforcing artificial delay of ${o} ms`),n.setArtificialDelay(o),o}filterEdit(e,r,n){let o=[l=>({filterName:"IgnoreImportChangesAspect",filteredEdits:Uxc.IgnoreImportChangesAspect.filterEdit(e,l,n)}),l=>({filterName:"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges",filteredEdits:$bt.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges.filterEdit(e,l)})];this.configService.getExperimentBasedConfig(ui.ConfigKey.InlineEditsAllowWhitespaceOnlyChanges,this.expService)||o.push(l=>({filterName:"IgnoreWhitespaceOnlyChanges",filteredEdits:$bt.IgnoreWhitespaceOnlyChanges.filterEdit(e,l)}));let s=this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsUndoInsertionFiltering,this.expService);if(s!==void 0){let l;switch(s){case"v1":l=$bt.editWouldDeleteWhatWasJustInserted;break;case"v2":l=$bt.editWouldDeleteWhatWasJustInserted2;break;default:(0,aie.assertNever)(s)}o.push(u=>({filterName:`UndoInsertionFiltering:${s}`,filteredEdits:l(e,new Wbt.LineEdit(u))?[]:u}))}let c=this.configService.getExperimentBasedConfig(ui.ConfigKey.TeamInternal.InlineEditsFilterOutEditsWithSubstrings,this.expService);if(c){let l=c.split(",").map(u=>u.trim()).filter(u=>u.length>0);o.push(u=>({filterName:"FilterOutEditsWithSubstrings",filteredEdits:eQi(u,l)}))}return o.reduce(([l,u],d)=>{let f=d(l);return f.filteredEdits.length===l.length?[l,u]:[f.filteredEdits,[...u,f.filterName]]},[r,[]])}static getNextCursorColumn(e){return(e?.match(/^(\s*)/)?.at(1)?.length??0)+1}};Mp.XtabProvider=r4r;Mp.XtabProvider=r4r=y9=pxc([CN(0,bxc.IInlineEditsModelService),CN(1,Txc.ISimulationTestContext),CN(2,Oxc.IInstantiationService),CN(3,xxc.IWorkspaceService),CN(4,gxc.IDiffService),CN(5,ui.IConfigurationService),CN(6,Ixc.IExperimentationService),CN(7,Z7i.ILanguageContextProviderService),CN(8,Sxc.ILanguageDiagnosticsService),CN(9,yxc.IIgnoreService),CN(10,jxc.ISimilarFilesContextService)],r4r);function eQi(t,e){return t.filter(r=>r.newLines.every(n=>e.every(o=>!n.includes(o))))}a(eQi,"filterOutEditsWithSubstrings");function tQi(t){let e=t.cursorLineOffset,r=Math.max(0,e-wV.N_LINES_AS_CONTEXT),n=Math.min(t.lines.length,e+wV.N_LINES_AS_CONTEXT+1);return new t4r.OffsetRange(r,n)}a(tQi,"computeAreaAroundEditWindowLinesRange");function n4r(t){switch(t.type){case qf.ChatFetchResponseType.Canceled:return new Ds.NoNextEditReason.GotCancelled("afterFetchCall");case qf.ChatFetchResponseType.OffTopic:case qf.ChatFetchResponseType.Filtered:case qf.ChatFetchResponseType.PromptFiltered:case qf.ChatFetchResponseType.Length:case qf.ChatFetchResponseType.RateLimited:case qf.ChatFetchResponseType.QuotaExceeded:case qf.ChatFetchResponseType.ExtensionBlocked:case qf.ChatFetchResponseType.AgentUnauthorized:case qf.ChatFetchResponseType.AgentFailedDependency:case qf.ChatFetchResponseType.InvalidStatefulMarker:return new Ds.NoNextEditReason.Uncategorized(xV.ErrorUtils.fromUnknown(t));case qf.ChatFetchResponseType.BadRequest:case qf.ChatFetchResponseType.NotFound:case qf.ChatFetchResponseType.Failed:case qf.ChatFetchResponseType.NetworkError:case qf.ChatFetchResponseType.Unknown:return new Ds.NoNextEditReason.FetchFailure(xV.ErrorUtils.fromUnknown(t))}}a(n4r,"mapChatFetcherErrorToNoNextEditReason");function i4r(t,e){return{...t,modelName:e.modelName,promptingStrategy:e.promptingStrategy,includePostScript:e.includePostScript??t.includePostScript,currentFile:{...t.currentFile,...e.currentFile,includeTags:e.includeTagsInCurrentFile},recentlyViewedDocuments:{...t.recentlyViewedDocuments,...e.recentlyViewedDocuments},lintOptions:e.lintOptions?Yxc(t.lintOptions,e.lintOptions):t.lintOptions}}a(i4r,"overrideModelConfig");var zxc={...Go.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,maxLineDistance:10};function Yxc(t,e){return{...t??zxc,...e}}a(Yxc,"mergeLintOptions");function rQi(t){switch(t){case Go.PromptingStrategy.UnifiedModel:return u3e.unifiedModelSystemPrompt;case Go.PromptingStrategy.Codexv21NesUnified:case Go.PromptingStrategy.SimplifiedSystemPrompt:return u3e.simplifiedPrompt;case Go.PromptingStrategy.PatchBased:case Go.PromptingStrategy.PatchBased01:case Go.PromptingStrategy.PatchBased02:case Go.PromptingStrategy.PatchBased02WithRecentLineNumbers:case Go.PromptingStrategy.PatchBased02WithoutRecentLineNumbers:case Go.PromptingStrategy.Xtab275:case Go.PromptingStrategy.XtabAggressiveness:case Go.PromptingStrategy.Xtab275Aggressiveness:case Go.PromptingStrategy.Xtab275AggressivenessHighLow:case Go.PromptingStrategy.Xtab275EditIntent:case Go.PromptingStrategy.Xtab275EditIntentShort:return u3e.xtab275SystemPrompt;case Go.PromptingStrategy.Nes41Miniv3:return u3e.nes41Miniv3SystemPrompt;case Go.PromptingStrategy.CopilotNesXtab:case void 0:return u3e.systemPromptTemplate;default:(0,aie.assertNever)(t)}}a(rQi,"pickSystemPrompt");function nQi(t,{enabled:e,enabledLanguages:r,maxTokens:n,enableAllContextProviders:o,traitPosition:s}){return t in r?{enabled:r[t],maxTokens:n,traitPosition:s}:o?{enabled:!0,maxTokens:n,traitPosition:s}:{enabled:e,maxTokens:n,traitPosition:s}}a(nQi,"determineLanguageContextOptions");function iQi(t,e,r,n,o,s){if(o===Go.ResponseFormat.UnifiedWithXml)return["",...r,""].join(` `);if(o===Go.ResponseFormat.EditWindowOnly)return r.join(` `);if(o===Go.ResponseFormat.EditWindowWithEditIntent)return["<|edit_intent|>high<|/edit_intent|>",...r].join(` `);if(o===Go.ResponseFormat.EditWindowWithEditIntentShort)return["H",...r].join(` `);if(o===Go.ResponseFormat.CodeBlock)return["```",...r,"```"].join(` -`);if(o===Go.ResponseFormat.CustomDiffPatch){let c=t.workspaceRoot?.path,l=(0,aUi.toUniquePath)(t.id,c);if(s===Go.PatchModelPrediction.FilePath)return`${l}:`;let u=r[n];if(u===void 0)return`${l}:`;let d=`${l}:${e}`;switch(s){case Go.PatchModelPrediction.CurrentLine:return[d,`-${u}`].join(` +`);if(o===Go.ResponseFormat.CustomDiffPatch){let c=t.workspaceRoot?.path,l=(0,X7i.toUniquePath)(t.id,c);if(s===Go.PatchModelPrediction.FilePath)return`${l}:`;let u=r[n];if(u===void 0)return`${l}:`;let d=`${l}:${e}`;switch(s){case Go.PatchModelPrediction.CurrentLine:return[d,`-${u}`].join(` `);case Go.PatchModelPrediction.CurrentLineReplaced:return[d,`-${u}`,"+"].join(` `);case Go.PatchModelPrediction.CurrentLineCompleted:return[d,`-${u}`,`+${u}`].join(` -`);default:(0,Zne.assertNever)(s)}}else(0,Zne.assertNever)(o)}a(fUi,"getPredictionContents");async function*TTc(t,e,r,n,o,s,{tracer:c},l,u){let d=r.intermediateUserEdit;if(!d||d.isEmpty()){yield*t;return}let f=r.documentBeforeEdits.getTransformer(),h=d.apply(f.text),m=new lTc.PositionOffsetTransformer(h),g={currentDoc:h,currentTransformer:m},A=a(E=>{if(E>=o.length)return!1;switch(u){case Hv.EarlyDivergenceCancellationMode.Cursor:return E===e;case Hv.EarlyDivergenceCancellationMode.EditWindow:return!0}},"shouldCheckLine"),y=0;for await(let E of t){if(A(y)){let _=n.start+y,v=(0,iUi.getCurrentLine)(f,_,d,g);if(v!==void 0){let b=o[y];if(v!==b&&!(0,iUi.isModelLineCompatible)(b,v,E)){l(!0),c.trace(`Line ${y} DIVERGED (mode=${u}): model="${E}" current="${v}"`),s.cancel();return}}}yield E,y++}}a(TTc,"linesWithIntermediateEditDivergenceCheck")});var hUi=I(kL=>{"use strict";p();var ITc=kL&&kL.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},bbt=kL&&kL.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(kL,"__esModule",{value:!0});kL.StaticGitHubAuthenticationService=void 0;kL.setCopilotToken=PTc;var xTc=Pl(),wTc=Sp(),Sbt=FE(),RTc=E5e(),kTc=XH(),Tbt=class extends Sbt.BaseAuthenticationService{static{a(this,"StaticGitHubAuthenticationService")}constructor(e,r,n,o,s){super(r,n,o,s),this.tokenProvider=e;let c=this;this._anyGitHubSession=e?{get id(){return c.tokenProvider()},get accessToken(){return c.tokenProvider()},scopes:Sbt.GITHUB_SCOPE_USER_EMAIL,account:{id:"user",label:"User"}}:void 0,this._permissiveGitHubSession=e?{get id(){return c.tokenProvider()},get accessToken(){return c.tokenProvider()},scopes:Sbt.GITHUB_SCOPE_ALIGNED,account:{id:"user",label:"User"}}:void 0}get hasCopilotTokenSource(){return!0}async getGitHubSession(e,r){if(e==="permissive"){if(this.isMinimalMode){if(r.createIfNone||r.forceNewSession)throw new Sbt.MinimalModeError;return}return this._permissiveGitHubSession}else return this._anyGitHubSession}async getCopilotToken(e){return await super.getCopilotToken(e)}setCopilotToken(e){this._tokenStore.copilotToken=e,this.fireCopilotTokenChange("setCopilotToken")}getAnyAdoSession(e){return Promise.resolve(void 0)}getAdoAccessTokenBase64(e){return Promise.resolve(void 0)}};kL.StaticGitHubAuthenticationService=Tbt;kL.StaticGitHubAuthenticationService=Tbt=ITc([bbt(1,wTc.ILogService),bbt(2,kTc.ICopilotTokenStore),bbt(3,RTc.ICopilotTokenManager),bbt(4,xTc.IConfigurationService)],Tbt);function PTc(t,e){if(!(t instanceof Tbt))throw new Error("This function should only be used with StaticGitHubAuthenticationService");t.setCopilotToken(e)}a(PTc,"setCopilotToken")});var EUi=I(Gv=>{"use strict";p();Object.defineProperty(Gv,"__esModule",{value:!0});Gv.GraphQLErrorType=void 0;Gv.getErrorCode=AUi;Gv.derivePullRequestState=DTc;Gv.makeGitHubAPIRequest=yUi;Gv.makeGitHubGraphQLRequest=rEe;Gv.makeSearchGraphQLRequest=NTc;Gv.getPullRequestFromGlobalId=MTc;Gv.addPullRequestCommentGraphQLRequest=OTc;Gv.closePullRequest=LTc;Gv.makeGitHubAPIRequestWithPagination=BTc;Gv.getAssignableActorsWithSuggestedActors=FTc;Gv.getAssignableActorsWithAssignableUsers=UTc;function mUi(t){return typeof t=="object"&&t!==null}a(mUi,"isObject");var gUi;(function(t){t.Unprocessable="UNPROCESSABLE"})(gUi||(Gv.GraphQLErrorType=gUi={}));function AUi(t){if(!mUi(t))return;if(t.status!==void 0)return String(t.status);let e=t.networkError;if(mUi(e)&&e.statusCode!==void 0)return String(e.statusCode);let r=t.graphQLErrors;if(Array.isArray(r)&&r.length>0){let n=r[0];if(n){if(n.extensions?.code!==void 0)return String(n.extensions.code);if(n.type!==void 0)return String(n.type)}}if(t.code!==void 0)return String(t.code);if(typeof t.name=="string"&&t.name)return t.name}a(AUi,"getErrorCode");function DTc(t){let e=t.state?.toUpperCase();return e==="MERGED"?"merged":e==="CLOSED"?"closed":t.isDraft?"draft":"open"}a(DTc,"derivePullRequestState");async function yUi(t,e,r,n,o,s,c,l){let{body:u,version:d,type:f="json",userAgent:h,accept:m,additionalHeaders:g,returnStatusCodeOnError:A=!1,silent404:y=!1,callSite:E="github-api-rest"}=l??{},_={Accept:m??"application/vnd.github+json",...g};c&&(_.Authorization=`Bearer ${c}`),d&&(_["X-GitHub-Api-Version"]=d),h&&(_["User-Agent"]=h);let v=await t.fetch(`${n}/${o}`,{method:s,headers:_,body:u?JSON.stringify(u):void 0,callSite:E});if(!v.ok)return y&&v.status===404||e.error(`[GitHubAPI] ${s} ${n}/${o} - Status: ${v?.status}`),A?{status:v.status}:void 0;try{let b=f==="json"?await v.json():await v.text(),T=Number(v.headers.get("x-ratelimit-remaining")),w=`[RateLimit] REST rate limit remaining: ${T}, ${o}`;return T<1e3?(e.warn(w),r.sendMSFTTelemetryEvent("githubAPI.approachingRateLimit",{rateLimit:T.toString()})):e.debug(w),b}catch{return}}a(yUi,"makeGitHubAPIRequest");async function rEe(t,e,r,n,o,s,c,l="github-api-graphql"){let u={Accept:"application/vnd.github+json","Content-Type":"application/json"};s&&(u.Authorization=`Bearer ${s}`);let d=JSON.stringify({query:o,variables:c}),f=await t.fetch(`${n}/graphql`,{method:"POST",headers:u,body:d,callSite:l});if(!f.ok){e.debug(`[GitHubAPI] GraphQL request to ${n}/graphql failed with status ${f.status}`);return}try{let h=await f.json(),m=Number(f.headers.get("x-ratelimit-remaining")),g=`[RateLimit] GraphQL rate limit remaining: ${m}, query: ${o}`;return m<1e3?(e.warn(g),r.sendMSFTTelemetryEvent("githubAPI.approachingRateLimit",{rateLimit:m.toString()})):e.debug(g),h}catch{return}}a(rEe,"makeGitHubGraphQLRequest");async function NTc(t,e,r,n,o,s,c=20){let l=` +`);default:(0,aie.assertNever)(s)}}else(0,aie.assertNever)(o)}a(iQi,"getPredictionContents");async function*Kxc(t,e,r,n,o,s,{tracer:c},l,u){let d=r.intermediateUserEdit;if(!d||d.isEmpty()){yield*t;return}let f=r.documentBeforeEdits.getTransformer(),h=d.apply(f.text),m=new Mxc.PositionOffsetTransformer(h),g={currentDoc:h,currentTransformer:m},A=a(E=>{if(E>=o.length)return!1;switch(u){case Vv.EarlyDivergenceCancellationMode.Cursor:return E===e;case Vv.EarlyDivergenceCancellationMode.EditWindow:return!0}},"shouldCheckLine"),y=0;for await(let E of t){if(A(y)){let _=n.start+y,v=(0,K7i.getCurrentLine)(f,_,d,g);if(v!==void 0){let b=o[y];if(v!==b&&!(0,K7i.isModelLineCompatible)(b,v,E)){l(!0),c.trace(`Line ${y} DIVERGED (mode=${u}): model="${E}" current="${v}"`),s.cancel();return}}}yield E,y++}}a(Kxc,"linesWithIntermediateEditDivergenceCheck")});var sQi=I(ML=>{"use strict";p();var Jxc=ML&&ML.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Ybt=ML&&ML.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(ML,"__esModule",{value:!0});ML.StaticGitHubAuthenticationService=void 0;ML.setCopilotToken=rwc;var Zxc=Pl(),Xxc=xp(),Kbt=HE(),ewc=j5e(),twc=uG(),Jbt=class extends Kbt.BaseAuthenticationService{static{a(this,"StaticGitHubAuthenticationService")}constructor(e,r,n,o,s){super(r,n,o,s),this.tokenProvider=e;let c=this;this._anyGitHubSession=e?{get id(){return c.tokenProvider()},get accessToken(){return c.tokenProvider()},scopes:Kbt.GITHUB_SCOPE_USER_EMAIL,account:{id:"user",label:"User"}}:void 0,this._permissiveGitHubSession=e?{get id(){return c.tokenProvider()},get accessToken(){return c.tokenProvider()},scopes:Kbt.GITHUB_SCOPE_ALIGNED,account:{id:"user",label:"User"}}:void 0}get hasCopilotTokenSource(){return!0}async getGitHubSession(e,r){if(e==="permissive"){if(this.isMinimalMode){if(r.createIfNone||r.forceNewSession)throw new Kbt.MinimalModeError;return}return this._permissiveGitHubSession}else return this._anyGitHubSession}async getCopilotToken(e){return await super.getCopilotToken(e)}setCopilotToken(e){this._tokenStore.copilotToken=e,this.fireCopilotTokenChange("setCopilotToken")}getAnyAdoSession(e){return Promise.resolve(void 0)}getAdoAccessTokenBase64(e){return Promise.resolve(void 0)}};ML.StaticGitHubAuthenticationService=Jbt;ML.StaticGitHubAuthenticationService=Jbt=Jxc([Ybt(1,Xxc.ILogService),Ybt(2,twc.ICopilotTokenStore),Ybt(3,ewc.ICopilotTokenManager),Ybt(4,Zxc.IConfigurationService)],Jbt);function rwc(t,e){if(!(t instanceof Jbt))throw new Error("This function should only be used with StaticGitHubAuthenticationService");t.setCopilotToken(e)}a(rwc,"setCopilotToken")});var dQi=I(Wv=>{"use strict";p();Object.defineProperty(Wv,"__esModule",{value:!0});Wv.GraphQLErrorType=void 0;Wv.getErrorCode=lQi;Wv.derivePullRequestState=nwc;Wv.makeGitHubAPIRequest=uQi;Wv.makeGitHubGraphQLRequest=yEe;Wv.makeSearchGraphQLRequest=iwc;Wv.getPullRequestFromGlobalId=owc;Wv.addPullRequestCommentGraphQLRequest=swc;Wv.closePullRequest=awc;Wv.makeGitHubAPIRequestWithPagination=cwc;Wv.getAssignableActorsWithSuggestedActors=lwc;Wv.getAssignableActorsWithAssignableUsers=uwc;function aQi(t){return typeof t=="object"&&t!==null}a(aQi,"isObject");var cQi;(function(t){t.Unprocessable="UNPROCESSABLE"})(cQi||(Wv.GraphQLErrorType=cQi={}));function lQi(t){if(!aQi(t))return;if(t.status!==void 0)return String(t.status);let e=t.networkError;if(aQi(e)&&e.statusCode!==void 0)return String(e.statusCode);let r=t.graphQLErrors;if(Array.isArray(r)&&r.length>0){let n=r[0];if(n){if(n.extensions?.code!==void 0)return String(n.extensions.code);if(n.type!==void 0)return String(n.type)}}if(t.code!==void 0)return String(t.code);if(typeof t.name=="string"&&t.name)return t.name}a(lQi,"getErrorCode");function nwc(t){let e=t.state?.toUpperCase();return e==="MERGED"?"merged":e==="CLOSED"?"closed":t.isDraft?"draft":"open"}a(nwc,"derivePullRequestState");async function uQi(t,e,r,n,o,s,c,l){let{body:u,version:d,type:f="json",userAgent:h,accept:m,additionalHeaders:g,returnStatusCodeOnError:A=!1,silent404:y=!1,callSite:E="github-api-rest"}=l??{},_={Accept:m??"application/vnd.github+json",...g};c&&(_.Authorization=`Bearer ${c}`),d&&(_["X-GitHub-Api-Version"]=d),h&&(_["User-Agent"]=h);let v=await t.fetch(`${n}/${o}`,{method:s,headers:_,body:u?JSON.stringify(u):void 0,callSite:E});if(!v.ok)return y&&v.status===404||e.error(`[GitHubAPI] ${s} ${n}/${o} - Status: ${v?.status}`),A?{status:v.status}:void 0;try{let b=f==="json"?await v.json():await v.text(),T=Number(v.headers.get("x-ratelimit-remaining")),w=`[RateLimit] REST rate limit remaining: ${T}, ${o}`;return T<1e3?(e.warn(w),r.sendMSFTTelemetryEvent("githubAPI.approachingRateLimit",{rateLimit:T.toString()})):e.debug(w),b}catch{return}}a(uQi,"makeGitHubAPIRequest");async function yEe(t,e,r,n,o,s,c,l="github-api-graphql"){let u={Accept:"application/vnd.github+json","Content-Type":"application/json"};s&&(u.Authorization=`Bearer ${s}`);let d=JSON.stringify({query:o,variables:c}),f=await t.fetch(`${n}/graphql`,{method:"POST",headers:u,body:d,callSite:l});if(!f.ok){e.debug(`[GitHubAPI] GraphQL request to ${n}/graphql failed with status ${f.status}`);return}try{let h=await f.json(),m=Number(f.headers.get("x-ratelimit-remaining")),g=`[RateLimit] GraphQL rate limit remaining: ${m}, query: ${o}`;return m<1e3?(e.warn(g),r.sendMSFTTelemetryEvent("githubAPI.approachingRateLimit",{rateLimit:m.toString()})):e.debug(g),h}catch{return}}a(yEe,"makeGitHubGraphQLRequest");async function iwc(t,e,r,n,o,s,c=20){let l=` query FetchCopilotAgentPullRequests($searchQuery: String!, $first: Int!, $after: String) { search(query: $searchQuery, type: ISSUE, first: $first, after: $after) { nodes { @@ -1360,7 +1360,7 @@ Your task is to predict and complete the changes the developer would have made n issueCount } } - `;e.debug(`[FolderRepositoryManager+0] Fetch pull request category ${s}`);let d=await rEe(t,e,r,n,l,o,{searchQuery:s,first:c},"github-graphql-search-prs"),f=d?.data?.search?.nodes??[];return e.debug(`[GitHubAPI] FetchCopilotAgentPullRequests: host=${n}, searchQuery=${s}, resultCount=${f.length}, errors=${JSON.stringify(d?.errors)}`),f}a(NTc,"makeSearchGraphQLRequest");async function MTc(t,e,r,n,o,s){let c=` + `;e.debug(`[FolderRepositoryManager+0] Fetch pull request category ${s}`);let d=await yEe(t,e,r,n,l,o,{searchQuery:s,first:c},"github-graphql-search-prs"),f=d?.data?.search?.nodes??[];return e.debug(`[GitHubAPI] FetchCopilotAgentPullRequests: host=${n}, searchQuery=${s}, resultCount=${f.length}, errors=${JSON.stringify(d?.errors)}`),f}a(iwc,"makeSearchGraphQLRequest");async function owc(t,e,r,n,o,s){let c=` query GetPullRequestGlobal($globalId: ID!) { node(id: $globalId) { ... on PullRequest { @@ -1395,7 +1395,7 @@ Your task is to predict and complete the changes the developer would have made n } } } - `;e.debug(`[GitHubAPI] Fetch pull request by global ID ${s}`);let u=await rEe(t,e,r,n,c,o,{globalId:s},"github-graphql-get-pr-by-id"),d=u?.data?.node;if(e.debug(`[GitHubAPI] GetPullRequestGlobal: host=${n}, globalId=${s}, found=${!!d}, prNumber=${d?.number}, errors=${JSON.stringify(u?.errors)}`),!d){let f={requestFailed:String(u===void 0)},h=AUi(u?.errors?.[0]);h&&(f.errorCode=h),r.sendMSFTTelemetryErrorEvent("pr.getPullRequestFromGlobalIdFailed",f)}return d}a(MTc,"getPullRequestFromGlobalId");async function OTc(t,e,r,n,o,s,c){let l=` + `;e.debug(`[GitHubAPI] Fetch pull request by global ID ${s}`);let u=await yEe(t,e,r,n,c,o,{globalId:s},"github-graphql-get-pr-by-id"),d=u?.data?.node;if(e.debug(`[GitHubAPI] GetPullRequestGlobal: host=${n}, globalId=${s}, found=${!!d}, prNumber=${d?.number}, errors=${JSON.stringify(u?.errors)}`),!d){let f={requestFailed:String(u===void 0)},h=lQi(u?.errors?.[0]);h&&(f.errorCode=h),r.sendMSFTTelemetryErrorEvent("pr.getPullRequestFromGlobalIdFailed",f)}return d}a(owc,"getPullRequestFromGlobalId");async function swc(t,e,r,n,o,s,c){let l=` mutation AddPullRequestComment($pullRequestId: ID!, $body: String!) { addComment(input: {subjectId: $pullRequestId, body: $body}) { commentEdge { @@ -1411,7 +1411,7 @@ Your task is to predict and complete the changes the developer would have made n } } } - `;return e.debug(`[GitHubAPI] Adding comment to pull request ${s}`),(await rEe(t,e,r,n,l,o,{pullRequestId:s,body:c},"github-graphql-add-pr-comment"))?.data?.addComment?.commentEdge?.node||null}a(OTc,"addPullRequestCommentGraphQLRequest");async function LTc(t,e,r,n,o,s,c,l){e.debug(`[GitHubAPI] Closing pull request ${s}/${c}#${l}`);let u=await yUi(t,e,r,n,`repos/${s}/${c}/pulls/${l}`,"POST",o,{body:{state:"closed"},version:"2022-11-28",callSite:"github-rest-close-pr"}),d=u?.state==="closed";return d?e.debug(`[GitHubAPI] Successfully closed pull request ${s}/${c}#${l}`):e.error(`[GitHubAPI] Failed to close pull request ${s}/${c}#${l}. Its state is ${u?.state}`),d}a(LTc,"closePullRequest");async function BTc(t,e,r,n,o,s){let c=!1,l=[],u=20,d=1;do{let f=await t.fetch(`${r}/${n}?page_size=${u}&page_number=${d}&resource_state=draft,open&repo_nwo=${o}`,{headers:{Authorization:`Bearer ${s}`,Accept:"application/json"},callSite:"github-api-sessions"});if(!f.ok)return e.error(`[GitHubAPI] Failed to fetch sessions: ${f.status} ${f.statusText}`),l;let h=await f.json();l.push(...h.sessions),c=h.sessions.length===u,d++}while(c);return l}a(BTc,"makeGitHubAPIRequestWithPagination");async function FTc(t,e,r,n,o,s,c){let l=` + `;return e.debug(`[GitHubAPI] Adding comment to pull request ${s}`),(await yEe(t,e,r,n,l,o,{pullRequestId:s,body:c},"github-graphql-add-pr-comment"))?.data?.addComment?.commentEdge?.node||null}a(swc,"addPullRequestCommentGraphQLRequest");async function awc(t,e,r,n,o,s,c,l){e.debug(`[GitHubAPI] Closing pull request ${s}/${c}#${l}`);let u=await uQi(t,e,r,n,`repos/${s}/${c}/pulls/${l}`,"POST",o,{body:{state:"closed"},version:"2022-11-28",callSite:"github-rest-close-pr"}),d=u?.state==="closed";return d?e.debug(`[GitHubAPI] Successfully closed pull request ${s}/${c}#${l}`):e.error(`[GitHubAPI] Failed to close pull request ${s}/${c}#${l}. Its state is ${u?.state}`),d}a(awc,"closePullRequest");async function cwc(t,e,r,n,o,s){let c=!1,l=[],u=20,d=1;do{let f=await t.fetch(`${r}/${n}?page_size=${u}&page_number=${d}&resource_state=draft,open&repo_nwo=${o}`,{headers:{Authorization:`Bearer ${s}`,Accept:"application/json"},callSite:"github-api-sessions"});if(!f.ok)return e.error(`[GitHubAPI] Failed to fetch sessions: ${f.status} ${f.statusText}`),l;let h=await f.json();l.push(...h.sessions),c=h.sessions.length===u,d++}while(c);return l}a(cwc,"makeGitHubAPIRequestWithPagination");async function lwc(t,e,r,n,o,s,c){let l=` query GetSuggestedActors($owner: String!, $name: String!, $first: Int!, $after: String) { repository(owner: $owner, name: $name) { suggestedActors( @@ -1432,7 +1432,7 @@ Your task is to predict and complete the changes the developer would have made n } } } - `,u=[],d=null,f=!0;for(;f;){let m=await rEe(t,e,r,n,l,o,{owner:s,name:c,first:100,after:d},"github-graphql-suggested-actors");if(!m?.data?.repository?.suggestedActors)break;let g=m.data.repository.suggestedActors;u.push(...g.nodes),f=g.pageInfo.hasNextPage,d=g.pageInfo.endCursor}return u}a(FTc,"getAssignableActorsWithSuggestedActors");async function UTc(t,e,r,n,o,s,c){let l=` + `,u=[],d=null,f=!0;for(;f;){let m=await yEe(t,e,r,n,l,o,{owner:s,name:c,first:100,after:d},"github-graphql-suggested-actors");if(!m?.data?.repository?.suggestedActors)break;let g=m.data.repository.suggestedActors;u.push(...g.nodes),f=g.pageInfo.hasNextPage,d=g.pageInfo.endCursor}return u}a(lwc,"getAssignableActorsWithSuggestedActors");async function uwc(t,e,r,n,o,s,c){let l=` query GetAssignableUsers($owner: String!, $name: String!, $first: Int!, $after: String) { repository(owner: $owner, name: $name) { assignableUsers(first: $first, after: $after) { @@ -1449,27 +1449,27 @@ Your task is to predict and complete the changes the developer would have made n } } } - `,u=[],d=null,f=!0;for(;f;){let m=await rEe(t,e,r,n,l,o,{owner:s,name:c,first:100,after:d},"github-graphql-assignable-users");if(!m?.data?.repository?.assignableUsers)break;let g=m.data.repository.assignableUsers;u.push(...g.nodes),f=g.pageInfo.hasNextPage,d=g.pageInfo.endCursor}return u}a(UTc,"getAssignableActorsWithAssignableUsers")});var CUi=I(XR=>{"use strict";p();Object.defineProperty(XR,"__esModule",{value:!0});XR.BaseOctoKitService=XR.PermissiveAuthRequiredError=XR.VSCodeTeamId=XR.IOctoKitService=XR.IGithubRepositoryService=void 0;var vUi=nn(),_Ui=e$(),mN=EUi();XR.IGithubRepositoryService=(0,vUi.createServiceIdentifier)("IGithubRepositoryService");XR.IOctoKitService=(0,vUi.createServiceIdentifier)("IOctoKitService");XR.VSCodeTeamId=1682102;var u5r=class extends Error{static{a(this,"PermissiveAuthRequiredError")}constructor(){super("Permissive authentication is required"),this.name="PermissiveAuthRequiredError"}};XR.PermissiveAuthRequiredError=u5r;var d5r=class t{static{a(this,"BaseOctoKitService")}static{this._outageStatusCacheTTL=300*1e3}static{this._userReposScopeCacheTTL=300*1e3}constructor(e,r,n,o){this._capiClientService=e,this._fetcherService=r,this._logService=n,this._telemetryService=o}async getCurrentAuthedUserWithToken(e){return this._makeGHAPIRequest("user","GET",e,void 0,void 0,"github-rest-get-user")}async getGitHubOutageStatus(){let e=Date.now();if(this._cachedOutageStatus&&e-this._cachedOutageStatus.timestampl.headRefName===n)}async addPullRequestCommentWithToken(e,r,n){return(0,mN.addPullRequestCommentGraphQLRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,n,e,r)}async createPullRequestWithToken(e,r,n,o,s,c,l,u){let d=await this._makeGHAPIRequest(`repos/${e}/${r}/pulls`,"POST",u,{title:n,body:o,head:s,base:c,draft:l});if(!d?.html_url||typeof d.number!="number")throw new Error(`Failed to create pull request for ${e}/${r}`);return{url:d.html_url,number:d.number}}async getPullRequestFromSessionWithToken(e,r){return(0,mN.getPullRequestFromGlobalId)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,r,e)}async getPullRequestFilesWithToken(e,r,n,o){return await(0,mN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,`repos/${e}/${r}/pulls/${n}/files`,"GET",o,{version:"2022-11-28",callSite:"github-rest-get-pr-files"})||[]}async compareCommitsWithToken(e,r,n,o,s){let c=`repos/${e}/${r}/compare/${n}...${o}`,l=await(0,mN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,c,"GET",s,{version:"2022-11-28",callSite:"github-rest-compare-commits"});if(!l)return;let u=l,d=u.merge_base_commit?.sha??u.base_commit?.sha??n,f=u.commits?.[u.commits.length-1]?.sha??o;return{baseSha:d,headSha:f,files:u.files??[]}}async getRepositoryByIdWithToken(e,r){let n=await(0,mN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,`repositories/${e}`,"GET",r,{version:"2022-11-28",callSite:"github-rest-get-repository-by-id"});if(!n)return;let o=n;if(o.owner?.login&&o.name)return{owner:o.owner.login,name:o.name};if(o.full_name){let[s,c]=o.full_name.split("/");if(s&&c)return{owner:s,name:c}}}async closePullRequestWithToken(e,r,n,o){return(0,mN.closePullRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,o,e,r,n)}async getFileContentWithToken(e,r,n,o,s){let c=`repos/${e}/${r}/contents/${o}?ref=${encodeURIComponent(n)}`,l=await(0,mN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,c,"GET",s,{callSite:"github-rest-get-file-content"});if(!l||Array.isArray(l))throw new Error("Unable to fetch file content");let u=l;if(u.content&&u.encoding==="base64")return(0,_Ui.decodeBase64)(u.content.replace(/\n/g,"")).toString();if(u.sha){let d=await this.getBlobContentWithToken(e,r,u.sha,s);if(d)return d}return this._logService.error(`Failed to get file content for ${e}/${r}/${o} at ref ${n}`),""}async getUserOrganizationsWithToken(e,r=100){let n=await this._makeGHAPIRequest(`user/orgs?per_page=${r}`,"GET",e,void 0,void 0,"github-rest-get-user-orgs");return!n||!Array.isArray(n)?[]:n.map(o=>o.login)}async isUserMemberOfOrgWithToken(e,r){try{let n=await this._makeGHAPIRequest(`user/memberships/orgs/${encodeURIComponent(e)}`,"GET",r,void 0,void 0,"github-rest-check-org-membership");return n&&(n.state==="active"||n.state==="pending")}catch{return!1}}async getOrganizationRepositoriesWithToken(e,r,n=100){let o=await this._makeGHAPIRequest(`orgs/${e}/repos?per_page=${n}&sort=updated`,"GET",r,void 0,{silent404:!0},"github-rest-get-org-repos");return!o||!Array.isArray(o)||o.length===0?[]:o.map(s=>s.name)}async getUserRepositoriesWithToken(e,r){let n=r?.trim();if(n)return this.searchUserRepositoriesWithToken(e,n);let o=await this._makeGHAPIRequest("user/repos?per_page=100&sort=updated&affiliation=owner,collaborator,organization_member","GET",e,void 0,void 0,"github-rest-get-user-repos");return!o||!Array.isArray(o)?[]:o.filter(s=>s.permissions?.push).map(s=>({owner:s.owner.login,name:s.name}))}async searchUserRepositoriesWithToken(e,r){let n=await this._getUserReposSearchScope(e);if(!n)return[];let o=encodeURIComponent(`${r} in:name fork:true ${n}`),s=await this._makeGHAPIRequest(`search/repositories?q=${o}&sort=updated&per_page=100`,"GET",e,void 0,void 0,"github-rest-search-repos");return!s||!Array.isArray(s.items)?[]:s.items.filter(c=>c.permissions?.push).map(c=>({owner:c.owner.login,name:c.name}))}async _getUserReposSearchScope(e){let r=Date.now();if(this._cachedUserReposScope&&this._cachedUserReposScope.token===e&&r-this._cachedUserReposScope.timestamp{"use strict";p();Object.defineProperty(Ibt,"__esModule",{value:!0});Ibt.NullBaseOctoKitService=void 0;var QTc=CUi(),f5r=class extends QTc.BaseOctoKitService{static{a(this,"NullBaseOctoKitService")}async getGitHubOutageStatus(){return 0}async getCurrentAuthedUser(){}async getCurrentAuthedUserWithToken(e){return{id:0,avatar_url:"",login:"NullUser",name:"Null User"}}async _makeGHAPIRequest(e,r,n,o,s,c){}};Ibt.NullBaseOctoKitService=f5r});var xUi=I(Ll=>{"use strict";p();var Nbt=Ll&&Ll.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Ou=Ll&&Ll.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Ll,"__esModule",{value:!0});Ll.CopilotTokenManagerFromGitHubToken=Ll.CopilotTokenManagerFromDeviceId=Ll.RefreshableCopilotTokenManager=Ll.StaticExtendedTokenInfoCopilotTokenManager=Ll.FixedCopilotTokenManager=Ll.BaseCopilotTokenManager=Ll.tokenErrorString=void 0;Ll.createStaticGitHubTokenProvider=jTc;Ll.getOrCreateTestingCopilotTokenManager=HTc;var p5r=(Sne(),ba(bne)),qTc=Ic(),SUi=Ro(),xbt=Hft(),IUi=Pl(),Mbt=$E(),Obt=J$(),iEe=U4(),Lbt=bUi(),Bbt=Sp(),HBe=_y(),Fbt=gm(),TUi=Tye(),s9=hgt(),wbt=E5e();Ll.tokenErrorString='Tests: either GITHUB_PAT, GITHUB_OAUTH_TOKEN, or GITHUB_OAUTH_TOKEN+VSCODE_COPILOT_CHAT_TOKEN must be set unless running from an IS_SCENARIO_AUTOMATION environment. Run "npm run get_token" to get credentials.';function jTc(){let t=process.env.GITHUB_PAT,e=process.env.GITHUB_OAUTH_TOKEN;if(!(iEe.isScenarioAutomation&&!t&&!e))return()=>{if(t)return t;if(e)return e;throw new Error(Ll.tokenErrorString)}}a(jTc,"createStaticGitHubTokenProvider");function HTc(t){if(process.env.VSCODE_COPILOT_CHAT_TOKEN)return new xbt.SyncDescriptor(kbt,[process.env.VSCODE_COPILOT_CHAT_TOKEN]);if(process.env.GITHUB_OAUTH_TOKEN)return new xbt.SyncDescriptor(Dbt,[process.env.GITHUB_OAUTH_TOKEN,"unknown"]);if(process.env.GITHUB_PAT)return new xbt.SyncDescriptor(Rbt,[process.env.GITHUB_PAT]);if(iEe.isScenarioAutomation)return new xbt.SyncDescriptor(Pbt,[t]);throw new Error(Ll.tokenErrorString)}a(HTc,"getOrCreateTestingCopilotTokenManager");var nEe=class extends SUi.Disposable{static{a(this,"BaseCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(),this._baseOctokitservice=e,this._logService=r,this._telemetryService=n,this._domainService=o,this._capiClientService=s,this._fetcherService=c,this._envService=l,this._isDisposed=!1,this._copilotTokenRefreshEmitter=this._register(new qTc.Emitter),this.onDidCopilotTokenRefresh=this._copilotTokenRefreshEmitter.event,this._register((0,SUi.toDisposable)(()=>this._isDisposed=!0))}get copilotToken(){return this._copilotToken}set copilotToken(e){e!==this._copilotToken&&(this._copilotToken=e,this._copilotTokenRefreshEmitter.fire())}resetCopilotToken(e){e!==void 0&&this._telemetryService.sendGHTelemetryEvent("auth.reset_token_"+e),this._logService.debug(`Resetting copilot token on HTTP error ${e||"unknown"}`),this.copilotToken=void 0}async authFromGitHubToken(e,r){return this.doAuthFromGitHubTokenOrDevDeviceId({githubToken:e,ghUsername:r})}async authFromDevDeviceId(e){return this.doAuthFromGitHubTokenOrDevDeviceId({devDeviceId:e})}async doAuthFromGitHubTokenOrDevDeviceId(e){this._telemetryService.sendGHTelemetryEvent("auth.new_login");let r,n,o;try{"githubToken"in e?(o=e.ghUsername,[r,n]=await Promise.all([this.fetchCopilotTokenFromGitHubToken(e.githubToken),this.fetchCopilotUserInfo(e.githubToken)])):r=await this.fetchCopilotTokenFromDevDeviceId(e.devDeviceId)}catch(f){return this._logService.warn("Failed to get copilot token due to fetch throwing: "+(f.message||String(f))),{kind:"failure",reason:"RequestFailed",message:f.message||String(f)}}if(!r.ok){this._logService.warn(`Failed to get copilot token due to status ${r.status} ${r.statusText}`);let f=TUi.TelemetryData.createAndMarkAsIssued({status:r.status.toString(),status_text:r.statusText});if(this._telemetryService.sendGHTelemetryErrorEvent("auth.invalid_token",f.properties,f.measurements),r.status===401)return this._logService.warn("Failed to get copilot token due to 401 status"),this._telemetryService.sendGHTelemetryErrorEvent("auth.unknown_401"),{kind:"failure",reason:"HTTP401"}}if(r.kind==="error-envelope")return this._logService.warn(`Failed to get copilot token due to: ${r.body.error_details.message}`),this._telemetryService.sendGHTelemetryErrorEvent("auth.request_read_failed"),{kind:"failure",reason:"NotAuthorized",...r.body.error_details};if(r.kind==="error")return r.body.message?.startsWith("API rate limit exceeded")?(this._logService.warn("Failed to get copilot token due to exceeding API rate limit"),this._telemetryService.sendGHTelemetryErrorEvent("auth.rate_limited"),{kind:"failure",reason:"RateLimited"}):(this._logService.warn(`Failed to get copilot token due to: ${r.body.message}`),{kind:"failure",reason:"NotAuthorized"});if(r.kind==="parse-failed")return this._logService.warn(`Failed to get copilot token due to: ${r.parseError}`),this._telemetryService.sendGHTelemetryErrorEvent("auth.request_read_failed"),{kind:"failure",reason:"ParseFailed",message:r.parseError};let s=r.body,c=s.expires_at;s.expires_at=(0,wbt.nowSeconds)()+s.refresh_in+60;let l=o??"unknown",u={...s,copilot_plan:n?.copilot_plan??s.sku??"",quota_snapshots:n?.quota_snapshots,quota_reset_date:n?.quota_reset_date,codex_agent_enabled:n?.codex_agent_enabled,token_based_billing:n?.token_based_billing,organization_login_list:n?.organization_login_list??[],username:l,isVscodeTeamMember:(0,s9.containsVSCodeOrg)(s.organization_list??[])},d=TUi.TelemetryData.createAndMarkAsIssued({},{adjusted_expires_at:s.expires_at,expires_at:c,current_time:(0,wbt.nowSeconds)()});return this._telemetryService.sendGHTelemetryEvent("auth.new_token",d.properties,d.measurements),{kind:"success",...u}}async fetchCopilotTokenFromGitHubToken(e){let r={callSite:"copilot-token-github",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0},n=await this._capiClientService.makeRequest(r,{type:p5r.RequestType.CopilotToken});return this.parseTokenResponse(n)}async fetchCopilotTokenFromDevDeviceId(e){let r={callSite:"copilot-token-device",headers:{"X-GitHub-Api-Version":"2025-04-01","Editor-Device-Id":`${e}`},retryFallbacks:!0,expectJSON:!0},n=await this._capiClientService.makeRequest(r,{type:p5r.RequestType.CopilotNLToken});return this.parseTokenResponse(n)}async parseTokenResponse(e){let r={ok:e.ok,status:e.status,statusText:e.statusText},n;try{n=await(0,HBe.jsonVerboseError)(e)}catch(s){return{...r,body:void 0,kind:"parse-failed",parseError:s.message||String(s)}}let o=(0,s9.validateTokenEnvelope)(n);return o.valid?(this.sendTokenValidationTelemetry(o),{...r,body:o.envelope,kind:"token"}):(0,s9.isErrorEnvelope)(n)?{...r,body:n,kind:"error-envelope"}:(0,s9.isStandardErrorEnvelope)(n)?{...r,body:n,kind:"error"}:(this.sendTokenValidationTelemetry(o),{...r,body:void 0,kind:"parse-failed",parseError:"Response is not valid: "+JSON.stringify(n)})}sendTokenValidationTelemetry(e){e.strategy!=="strict"&&this._telemetryService.sendMSFTTelemetryEvent("copilotTokenFetching.validation",{strategy:e.strategy,strictError:e.strictError,fallbackError:e.fallbackError})}async fetchCopilotUserInfo(e){let r={callSite:"copilot-token-user-info",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0};return await(await this._capiClientService.makeRequest(r,{type:p5r.RequestType.CopilotUserInfo})).json()}};Ll.BaseCopilotTokenManager=nEe;var Rbt=class extends nEe{static{a(this,"FixedCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new Lbt.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l),this._completionsToken=e,this.copilotToken=(0,s9.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}set completionsToken(e){this._completionsToken=e,this.copilotToken=(0,s9.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}get completionsToken(){return this._completionsToken}async getCopilotToken(){return new s9.CopilotToken(this.copilotToken)}async checkCopilotToken(){return{status:"OK"}}};Ll.FixedCopilotTokenManager=Rbt;Ll.FixedCopilotTokenManager=Rbt=Nbt([Ou(1,Bbt.ILogService),Ou(2,Fbt.ITelemetryService),Ou(3,Mbt.ICAPIClientService),Ou(4,Obt.IDomainService),Ou(5,HBe.IFetcherService),Ou(6,iEe.IEnvService)],Rbt);var kbt=class extends nEe{static{a(this,"StaticExtendedTokenInfoCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new Lbt.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l);let u=Buffer.from(e,"base64").toString("utf8");this._initialToken=JSON.parse(u)}async getCopilotToken(){return this.copilotToken||(this.copilotToken={...this._initialToken}),new s9.CopilotToken(this._initialToken)}async checkCopilotToken(){return{status:"OK"}}};Ll.StaticExtendedTokenInfoCopilotTokenManager=kbt;Ll.StaticExtendedTokenInfoCopilotTokenManager=kbt=Nbt([Ou(1,Bbt.ILogService),Ou(2,Fbt.ITelemetryService),Ou(3,Mbt.ICAPIClientService),Ou(4,Obt.IDomainService),Ou(5,HBe.IFetcherService),Ou(6,iEe.IEnvService)],kbt);var jBe=class extends nEe{static{a(this,"RefreshableCopilotTokenManager")}async getCopilotToken(e){if(!this.copilotToken||this.copilotToken.expires_at<(0,wbt.nowSeconds)()+300||e){let r=await this.authenticateAndGetToken();if(r.kind==="failure")throw Error(`Failed to get copilot token: ${r.reason.toString()} ${r.message??""}`);this.copilotToken={...r}}return new s9.CopilotToken(this.copilotToken)}async checkCopilotToken(){if(!this.copilotToken||this.copilotToken.expires_at<(0,wbt.nowSeconds)()){let r=await this.authenticateAndGetToken();if(r.kind==="failure")return r;this.copilotToken={...r}}return{status:"OK"}}};Ll.RefreshableCopilotTokenManager=jBe;var Pbt=class extends jBe{static{a(this,"CopilotTokenManagerFromDeviceId")}constructor(e,r,n,o,s,c,l,u){super(new Lbt.NullBaseOctoKitService(s,c,r,n),r,n,o,s,c,l),this.deviceId=e,this.configurationService=u}async authenticateAndGetToken(){return this.authFromDevDeviceId(this.deviceId)}};Ll.CopilotTokenManagerFromDeviceId=Pbt;Ll.CopilotTokenManagerFromDeviceId=Pbt=Nbt([Ou(1,Bbt.ILogService),Ou(2,Fbt.ITelemetryService),Ou(3,Obt.IDomainService),Ou(4,Mbt.ICAPIClientService),Ou(5,HBe.IFetcherService),Ou(6,iEe.IEnvService),Ou(7,IUi.IConfigurationService)],Pbt);var Dbt=class extends jBe{static{a(this,"CopilotTokenManagerFromGitHubToken")}constructor(e,r,n,o,s,c,l,u,d){super(new Lbt.NullBaseOctoKitService(c,l,n,o),n,o,s,c,l,u),this.githubToken=e,this.githubUsername=r,this.configurationService=d}async authenticateAndGetToken(){return this.authFromGitHubToken(this.githubToken,this.githubUsername)}};Ll.CopilotTokenManagerFromGitHubToken=Dbt;Ll.CopilotTokenManagerFromGitHubToken=Dbt=Nbt([Ou(2,Bbt.ILogService),Ou(3,Fbt.ITelemetryService),Ou(4,Obt.IDomainService),Ou(5,Mbt.ICAPIClientService),Ou(6,HBe.IFetcherService),Ou(7,iEe.IEnvService),Ou(8,IUi.IConfigurationService)],Dbt)});var wUi=I(a9=>{"use strict";p();var GTc=a9&&a9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},h5r=a9&&a9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(a9,"__esModule",{value:!0});a9.ChatQuotaService=void 0;var $Tc=(Sne(),ba(bne)),VTc=Ic(),WTc=Ro(),zTc=FE(),YTc=$E(),KTc=Sp(),m5r=class extends WTc.Disposable{static{a(this,"ChatQuotaService")}constructor(e,r,n){super(),this._authService=e,this._logService=r,this._capiClientService=n,this._turnCredits=new Map,this._onDidChange=this._register(new VTc.Emitter),this.onDidChange=this._onDidChange.event,this._rateLimitInfo={session:void 0,weekly:void 0},this._register(this._authService.onDidCopilotTokenChange(()=>{this._processUserInfoQuotaSnapshot(this._authService.copilotToken?.quotaInfo)}))}get quotaInfo(){return this._quotaInfo}get rateLimitInfo(){return this._rateLimitInfo}get quotaExhausted(){return!this._quotaInfo||this._quotaInfo.additionalUsageEnabled?!1:this._quotaInfo.unlimited?!this._quotaInfo.hasQuota:this._quotaInfo.percentRemaining<=0}get additionalUsageEnabled(){return this._quotaInfo?this._quotaInfo.additionalUsageEnabled:!1}getCreditsForTurn(e){return this._turnCredits.get(e)}setLastCopilotUsage(e,r){let n=e/1e9;n>=0&&this._turnCredits.set(r,(this._turnCredits.get(r)??0)+n)}resetTurnCredits(e){this._turnCredits.delete(e)}clearQuota(){this._quotaInfo=void 0}processQuotaHeaders(e){let r=this._authService.copilotToken?.isFreeUser?e.get("x-quota-snapshot-chat"):e.get("x-quota-snapshot-premium_models")||e.get("x-quota-snapshot-premium_interactions");if(!r)return;let n=this._processHeaderValue(r);if(!n)return;this._quotaInfo=n,this._logService.trace(`[ChatQuota] processQuotaHeaders: ${JSON.stringify(n)}`);let o=e.get("x-usage-ratelimit-session"),s=e.get("x-usage-ratelimit-weekly");this._rateLimitInfo.session=o?this._processHeaderValue(o):void 0,this._rateLimitInfo.weekly=s?this._processHeaderValue(s):void 0,this._onDidChange.fire()}processQuotaSnapshots(e){let r=this._authService.copilotToken?.isFreeUser?e.chat:e.premium_models??e.premium_interactions;if(r)try{let n=parseInt(r.entitlement,10),o=r.reset_date?new Date(r.reset_date):(()=>{let s=new Date;return s.setMonth(s.getMonth()+1),s})();this._quotaInfo={quota:n,unlimited:n===-1,hasQuota:r.has_quota??!0,percentRemaining:r.percent_remaining,additionalUsageUsed:r.overage_count,additionalUsageEnabled:r.overage_permitted,resetDate:o},this._logService.trace(`[ChatQuota] processQuotaSnapshots: ${JSON.stringify(this._quotaInfo)}`),this._onDidChange.fire()}catch(n){console.error("Failed to process quota snapshots",n)}}async refreshQuota(){let e=this._authService.anyGitHubSession?.accessToken;if(e)try{let r={callSite:"copilot-quota-refresh",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0},o=await(await this._capiClientService.makeRequest(r,{type:$Tc.RequestType.CopilotUserInfo})).json();this._processUserInfoQuotaSnapshot(o),this._logService.trace("[ChatQuota] refreshQuota: fetched up-to-date quota data")}catch(r){this._logService.trace(`[ChatQuota] refreshQuota: failed to fetch quota data: ${r}`)}}_processHeaderValue(e){try{let r=new URLSearchParams(e),n=parseInt(r.get("ent")||"0",10),o=parseFloat(r.get("ov")||"0.0"),s=r.get("ovPerm")==="true",c=parseFloat(r.get("rem")||"0.0"),l=r.get("rst"),u;return l?u=new Date(l):(u=new Date,u.setMonth(u.getMonth()+1)),{quota:n,unlimited:n===-1,hasQuota:!0,percentRemaining:c,additionalUsageUsed:o,additionalUsageEnabled:s,resetDate:u}}catch(r){console.error("Failed to parse quota header",r);return}}_processUserInfoQuotaSnapshot(e){if(!e||!e.quota_snapshots||!e.quota_reset_date)return;let r=this._authService.copilotToken?.isFreeUser?e.quota_snapshots.chat:e.quota_snapshots.premium_interactions;this._quotaInfo={unlimited:r.unlimited,hasQuota:r.has_quota??!0,additionalUsageEnabled:r.overage_permitted,additionalUsageUsed:r.overage_count,quota:r.entitlement,resetDate:new Date(e.quota_reset_date),percentRemaining:r.percent_remaining},this._logService.trace(`[ChatQuota] processUserInfoQuotaSnapshot: ${JSON.stringify(this._quotaInfo)}`),this._onDidChange.fire()}};a9.ChatQuotaService=m5r;a9.ChatQuotaService=m5r=GTc([h5r(0,zTc.IAuthenticationService),h5r(1,KTc.ILogService),h5r(2,YTc.ICAPIClientService)],m5r)});var kUi=I(Ubt=>{"use strict";p();Object.defineProperty(Ubt,"__esModule",{value:!0});Ubt.DefaultsOnlyConfigurationService=void 0;var RUi=Pl(),g5r=class extends RUi.AbstractConfigurationService{static{a(this,"DefaultsOnlyConfigurationService")}getConfig(e){return this.getDefaultValue(e)}inspectConfig(e,r){return{defaultValue:this.getDefaultValue(e)}}setConfig(e,r,n){return Promise.resolve()}getNonExtensionConfig(e){}getExperimentBasedConfig(e,r,n){if(e.experimentName){let c=r.getTreatmentVariable(e.experimentName);if(c!==void 0)return c}let o=r.getTreatmentVariable(`copilotchat.config.${e.id}`);if(o!==void 0)return o;let s=r.getTreatmentVariable(`config.${e.fullyQualifiedId}`);if(s!==void 0)return s;if(e.fullyQualifiedOldId){let c=r.getTreatmentVariable(`copilotchat.config.${e.oldId}`);if(c!==void 0)return c;let l=r.getTreatmentVariable(`config.${e.fullyQualifiedOldId}`);if(l!==void 0)return l}return this.getDefaultValue(e)}updateExperimentBasedConfiguration(e){e.length!==0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a((r,n)=>{if(e.some(s=>s.startsWith(`config.${r}`)))return!0;let o=RUi.globalConfigRegistry.configs.get(r)?.fullyQualifiedOldId;return!!(o&&e.some(s=>s.startsWith(`config.${o}`)))},"affectsConfiguration")})}dumpConfig(){return{}}};Ubt.DefaultsOnlyConfigurationService=g5r});var DUi=I(Qbt=>{"use strict";p();Object.defineProperty(Qbt,"__esModule",{value:!0});Qbt.computeDiff=ZTc;Qbt.computeDiffSync=PUi;var JTc=aDr();async function ZTc(t,e,r){return PUi(t,e,r)}a(ZTc,"computeDiff");function PUi(t,e,r){let n=t.split(/\r\n|\r|\n/),o=e.split(/\r\n|\r|\n/),c=new JTc.DefaultLinesDiffComputer().computeDiff(n,o,r),l=c.changes.length>0?!1:t===e;function u(d){return d.map(f=>[f.original.startLineNumber,f.original.endLineNumberExclusive,f.modified.startLineNumber,f.modified.endLineNumberExclusive,f.innerChanges?.map(h=>[h.originalRange.startLineNumber,h.originalRange.startColumn,h.originalRange.endLineNumber,h.originalRange.endColumn,h.modifiedRange.startLineNumber,h.modifiedRange.startColumn,h.modifiedRange.endLineNumber,h.modifiedRange.endColumn])])}return a(u,"getLineChanges"),{identical:l,quitEarly:c.hitTimeout,changes:u(c.changes),moves:c.moves.map(d=>[d.lineRangeMapping.original.startLineNumber,d.lineRangeMapping.original.endLineNumberExclusive,d.lineRangeMapping.modified.startLineNumber,d.lineRangeMapping.modified.endLineNumberExclusive,u(d.changes)])}}a(PUi,"computeDiffSync")});var LUi=I(gN=>{"use strict";p();var XTc=gN&&gN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eIc=gN&&gN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),OUi=gN&&gN.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{let r=sIc([NUi.join(__dirname,"diffWorker.js"),NUi.join(__dirname,"../../../../dist/diffWorker.js")]);if(r===void 0)throw new Error("DiffServiceImpl: worker file not found");return new tIc.WorkerWithRpcProxy(r,{name:"Diff worker"})})}dispose(){this._worker.rawValue?.terminate()}async computeDiff(e,r,n){let o=this._useWorker?await this._worker.value.proxy.computeDiff(e,r,n):await oIc.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:E5r(o.changes),moves:o.moves.map(c=>new iIc.MovedText(new A5r.LineRangeMapping(new qbt.LineRange(c[0],c[1]),new qbt.LineRange(c[2],c[3])),E5r(c[4])))}}};gN.DiffServiceImpl=y5r;function E5r(t){return t.map(e=>new A5r.DetailedLineRangeMapping(new qbt.LineRange(e[0],e[1]),new qbt.LineRange(e[2],e[3]),e[4]?.map(r=>new A5r.RangeMapping(new MUi.Range(r[0],r[1],r[2],r[3]),new MUi.Range(r[4],r[5],r[6],r[7])))))}a(E5r,"toLineRangeMappings");function sIc(t){for(let e of t)if((0,nIc.existsSync)(e))return e}a(sIc,"firstExistingPath")});var FUi=I(c9=>{"use strict";p();var aIc=c9&&c9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},BUi=c9&&c9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(c9,"__esModule",{value:!0});c9.CAPIClientImpl=void 0;var cIc=U4(),lIc=_y(),uIc=$E(),_5r=class extends uIc.BaseCAPIClientService{static{a(this,"CAPIClientImpl")}constructor(e,r){super(process.env.HMAC_SECRET,process.env.VSCODE_COPILOT_INTEGRATION_ID,e,r)}};c9.CAPIClientImpl=_5r;c9.CAPIClientImpl=_5r=aIc([BUi(0,lIc.IFetcherService),BUi(1,cIc.IEnvService)],_5r)});var QUi=I(l9=>{"use strict";p();var dIc=l9&&l9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},v5r=l9&&l9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(l9,"__esModule",{value:!0});l9.DomainService=void 0;var fIc=Ic(),pIc=Ro(),hIc=XH(),oEe=Pl(),mIc=$E(),UUi="github-enterprise.uri",C5r=class extends pIc.Disposable{static{a(this,"DomainService")}constructor(e,r,n){super(),this._configurationService=e,this._tokenStore=r,this._capiClientService=n,this._onDidChangeDomains=this._register(new fIc.Emitter),this.onDidChangeDomains=this._onDidChangeDomains.event,this._register(this._configurationService.onDidChangeConfiguration(o=>this._onDidConfigChangeHandler(o))),this._processCopilotToken(this._tokenStore.copilotToken),this._register(this._tokenStore.onDidStoreUpdate(()=>this._processCopilotToken(this._tokenStore.copilotToken)))}_onDidConfigChangeHandler(e){(e.affectsConfiguration(`${oEe.CopilotConfigPrefix}.advanced`)||e.affectsConfiguration(UUi))&&this._processCAPIModuleChange(this._tokenStore.copilotToken)}_processCAPIModuleChange(e){let r=this._configurationService.getConfig(oEe.ConfigKey.Shared.DebugOverrideCAPIUrl);r&&r.endsWith("/")&&(r=r.slice(0,-1));let n=this._configurationService.getConfig(oEe.ConfigKey.Shared.DebugOverrideProxyUrl);n&&(n=n.replace(/\/$/,""));let o=this._configurationService.getConfig(oEe.ConfigKey.Shared.AuthProvider)===oEe.AuthProviderId.GitHubEnterprise?this._configurationService.getNonExtensionConfig(UUi):void 0,s={endpoints:{api:r||e?.endpoints?.api,proxy:n||e?.endpoints?.proxy,telemetry:e?.endpoints?.telemetry,"origin-tracker":e?.endpoints?.["origin-tracker"]},sku:e?.sku||"unknown"},c=this._capiClientService.updateDomains(s,o);(c.capiUrlChanged||c.proxyUrlChanged||c.telemetryUrlChanged||c.dotcomUrlChanged)&&this._onDidChangeDomains.fire({capiUrlChanged:c.capiUrlChanged,telemetryUrlChanged:c.telemetryUrlChanged,proxyUrlChanged:c.proxyUrlChanged,dotcomUrlChanged:c.dotcomUrlChanged})}_processCopilotToken(e){this._processCAPIModuleChange(e)}};l9.DomainService=C5r;l9.DomainService=C5r=dIc([v5r(0,oEe.IConfigurationService),v5r(1,hIc.ICopilotTokenStore),v5r(2,mIc.ICAPIClientService)],C5r)});var qUi=I(sEe=>{"use strict";p();Object.defineProperty(sEe,"__esModule",{value:!0});sEe.NullNativeEnvService=sEe.NullEnvService=void 0;var gIc=Ic(),AIc=nd(),jbt=U4(),yIc=c5e(),Hbt=class t extends jbt.AbstractEnvService{static{a(this,"NullEnvService")}constructor(){super(...arguments),this.language="en"}static{this.Instance=new t}get extensionId(){return"test-extension-id"}get vscodeVersion(){return"test-version"}get isActive(){return!0}get onDidChangeWindowState(){return gIc.Event.None}get sessionId(){return"test-session"}get machineId(){return"test-machine"}get devDeviceId(){return"test-dev-device"}get remoteName(){}get uiKind(){return"desktop"}get uriScheme(){return"code-null"}get appRoot(){return""}get shell(){return"zsh"}get OS(){return jbt.OperatingSystem.Linux}getEditorInfo(){return new jbt.NameAndVersion("simulation-tests-editor",yIc.packageJson.engines.vscode.match(/\d+\.\d+/)?.[0]??"1.89")}getEditorPluginInfo(){return new jbt.NameAndVersion("simulation-tests-plugin","2")}openExternal(e){return Promise.resolve(!1)}};sEe.NullEnvService=Hbt;var b5r=class extends Hbt{static{a(this,"NullNativeEnvService")}get userHome(){return AIc.URI.file("/home/testuser")}};sEe.NullNativeEnvService=b5r});var S5r=I(Gbt=>{"use strict";p();Object.defineProperty(Gbt,"__esModule",{value:!0});Gbt.IGitExtensionService=void 0;var EIc=nn();Gbt.IGitExtensionService=(0,EIc.createServiceIdentifier)("IGitExtensionService")});var jUi=I($bt=>{"use strict";p();Object.defineProperty($bt,"__esModule",{value:!0});$bt.NullGitExtensionService=void 0;var _Ic=Ic(),T5r=class{static{a(this,"NullGitExtensionService")}constructor(){this.onDidChange=_Ic.Event.None,this.extensionAvailable=!1}getExtensionApi(){}};$bt.NullGitExtensionService=T5r});var HUi=I(u9=>{"use strict";p();var vIc=u9&&u9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},CIc=u9&&u9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(u9,"__esModule",{value:!0});u9.ObservableGit=void 0;var bIc=Ro(),EV=W2(),SIc=S5r(),I5r=class extends bIc.Disposable{static{a(this,"ObservableGit")}constructor(e){super(),this._gitExtensionService=e,this._gitApi=(0,EV.observableFromEvent)(this,r=>this._gitExtensionService.onDidChange(r),()=>this._gitExtensionService.getExtensionApi()),this.branch=(0,EV.observableValue)("branchName",void 0),this.init()}async init(){let e=await(0,EV.waitForState)(this._gitApi);if(this._store.isDisposed)return;let r=(0,EV.observableFromEvent)(this,n=>e.onDidOpenRepository(n),()=>e.repositories??[]);await(0,EV.waitForState)(r,n=>n.length>0,void 0),!this._store.isDisposed&&(0,EV.mapObservableArrayCached)(this,r,(n,o)=>{let s=(0,EV.observableFromEvent)(c=>n.state.onDidChange(c),()=>n.state.HEAD?.name);o.add((0,EV.autorunWithStore)((c,l)=>{this.branch.set(s.read(c),void 0)}))},n=>n.rootUri.toString()).recomputeInitiallyAndOnChange(this._store)}};u9.ObservableGit=I5r;u9.ObservableGit=I5r=vIc([CIc(0,SIc.IGitExtensionService)],I5r)});var Wbt=I(Bl=>{"use strict";p();Object.defineProperty(Bl,"__esModule",{value:!0});Bl.lengthZero=void 0;Bl.lengthDiff=xIc;Bl.lengthIsZero=wIc;Bl.toLength=Xne;Bl.lengthToObj=RIc;Bl.lengthGetLineCount=kIc;Bl.lengthGetColumnCountIfZeroLineCount=PIc;Bl.lengthAdd=$Ui;Bl.sumLengths=DIc;Bl.lengthEquals=NIc;Bl.lengthDiffNonNegative=MIc;Bl.lengthLessThan=OIc;Bl.lengthLessThanEqual=LIc;Bl.lengthGreaterThanEqual=BIc;Bl.lengthToPosition=FIc;Bl.positionToLength=UIc;Bl.lengthsToRange=QIc;Bl.lengthOfRange=qIc;Bl.lengthCompare=jIc;Bl.lengthOfString=HIc;Bl.lengthOfStringObj=GIc;Bl.lengthHash=$Ic;Bl.lengthMax=VIc;var GUi=em(),TIc=q_(),IIc=eh(),Vbt=Tme();function xIc(t,e,r,n){return t!==r?Xne(r-t,n):Xne(0,n-e)}a(xIc,"lengthDiff");Bl.lengthZero=0;function wIc(t){return t===0}a(wIc,"lengthIsZero");var e_=2**26;function Xne(t,e){return t*e_+e}a(Xne,"toLength");function RIc(t){let e=t,r=Math.floor(e/e_),n=e-r*e_;return new Vbt.TextLength(r,n)}a(RIc,"lengthToObj");function kIc(t){return Math.floor(t/e_)}a(kIc,"lengthGetLineCount");function PIc(t){return t}a(PIc,"lengthGetColumnCountIfZeroLineCount");function $Ui(t,e){let r=t+e;return e>=e_&&(r=r-t%e_),r}a($Ui,"lengthAdd");function DIc(t,e){return t.reduce((r,n)=>$Ui(r,e(n)),Bl.lengthZero)}a(DIc,"sumLengths");function NIc(t,e){return t===e}a(NIc,"lengthEquals");function MIc(t,e){let r=t,n=e;if(n-r<=0)return Bl.lengthZero;let s=Math.floor(r/e_),c=Math.floor(n/e_),l=n-c*e_;if(s===c){let u=r-s*e_;return Xne(0,l-u)}else return Xne(c-s,l)}a(MIc,"lengthDiffNonNegative");function OIc(t,e){return t=e}a(BIc,"lengthGreaterThanEqual");function FIc(t){let e=t,r=Math.floor(e/e_),n=e-r*e_;return new TIc.Position(r+1,n+1)}a(FIc,"lengthToPosition");function UIc(t){return Xne(t.lineNumber-1,t.column-1)}a(UIc,"positionToLength");function QIc(t,e){let r=t,n=Math.floor(r/e_),o=r-n*e_,s=e,c=Math.floor(s/e_),l=s-c*e_;return new IIc.Range(n+1,o+1,c+1,l+1)}a(QIc,"lengthsToRange");function qIc(t){return t.startLineNumber===t.endLineNumber?new Vbt.TextLength(0,t.endColumn-t.startColumn):new Vbt.TextLength(t.endLineNumber-t.startLineNumber,t.endColumn-1)}a(qIc,"lengthOfRange");function jIc(t,e){return t-e}a(jIc,"lengthCompare");function HIc(t){let e=(0,GUi.splitLines)(t);return Xne(e.length-1,e[e.length-1].length)}a(HIc,"lengthOfString");function GIc(t){let e=(0,GUi.splitLines)(t);return new Vbt.TextLength(e.length-1,e[e.length-1].length)}a(GIc,"lengthOfStringObj");function $Ic(t){return t}a($Ic,"lengthHash");function VIc(t,e){return t>e?t:e}a(VIc,"lengthMax")});var R5r=I(zbt=>{"use strict";p();Object.defineProperty(zbt,"__esModule",{value:!0});zbt.TextEditInfo=void 0;var x5r=Wbt(),w5r=class{static{a(this,"TextEditInfo")}constructor(e,r,n){this.startOffset=e,this.endOffset=r,this.newLength=n}toString(){return`[${(0,x5r.lengthToObj)(this.startOffset)}...${(0,x5r.lengthToObj)(this.endOffset)}) -> ${(0,x5r.lengthToObj)(this.newLength)}`}};zbt.TextEditInfo=w5r});var WUi=I(k5r=>{"use strict";p();Object.defineProperty(k5r,"__esModule",{value:!0});k5r.combineTextEditInfos=YIc;var WIc=Sl(),O0=Wbt(),zIc=R5r();function YIc(t,e){if(t.length===0)return e;if(e.length===0)return t;let r=new WIc.ArrayQueue(VUi(t)),n=VUi(e);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let o=r.dequeue();function s(d){if(d===void 0){let h=r.takeWhile(m=>!0)||[];return o&&h.unshift(o),h}let f=[];for(;o&&!(0,O0.lengthIsZero)(d);){let[h,m]=o.splitAt(d);f.push(h),d=(0,O0.lengthDiffNonNegative)(h.lengthAfter,d),o=m??r.dequeue()}return(0,O0.lengthIsZero)(d)||f.push(new GBe(!1,d,d)),f}a(s,"nextS0ToS1MapWithS1LengthOf");let c=[];function l(d,f,h){if(c.length>0&&(0,O0.lengthEquals)(c[c.length-1].endOffset,d)){let m=c[c.length-1];c[c.length-1]=new zIc.TextEditInfo(m.startOffset,f,(0,O0.lengthAdd)(m.newLength,h))}else c.push({startOffset:d,endOffset:f,newLength:h})}a(l,"pushEdit");let u=O0.lengthZero;for(let d of n){let f=s(d.lengthBefore);if(d.modified){let h=(0,O0.sumLengths)(f,g=>g.lengthBefore),m=(0,O0.lengthAdd)(u,h);l(u,m,d.lengthAfter),u=m}else for(let h of f){let m=u;u=(0,O0.lengthAdd)(u,h.lengthBefore),h.modified&&l(m,u,h.lengthAfter)}}return c}a(YIc,"combineTextEditInfos");var GBe=class t{static{a(this,"LengthMapping")}constructor(e,r,n){this.modified=e,this.lengthBefore=r,this.lengthAfter=n}splitAt(e){let r=(0,O0.lengthDiffNonNegative)(e,this.lengthAfter);return(0,O0.lengthEquals)(r,O0.lengthZero)?[this,void 0]:this.modified?[new t(this.modified,this.lengthBefore,e),new t(this.modified,O0.lengthZero,r)]:[new t(this.modified,e,e),new t(this.modified,r,r)]}toString(){return`${this.modified?"M":"U"}:${(0,O0.lengthToObj)(this.lengthBefore)} -> ${(0,O0.lengthToObj)(this.lengthAfter)}`}};function VUi(t){let e=[],r=O0.lengthZero;for(let n of t){let o=(0,O0.lengthDiffNonNegative)(r,n.startOffset);(0,O0.lengthIsZero)(o)||e.push(new GBe(!1,o,o));let s=(0,O0.lengthDiffNonNegative)(n.startOffset,n.endOffset);e.push(new GBe(!0,s,n.newLength)),r=n.endOffset}return e}a(VUi,"toLengthMapping")});var YUi=I(aEe=>{"use strict";p();Object.defineProperty(aEe,"__esModule",{value:!0});aEe.SingleTextEditLength=aEe.TextLengthEdit=void 0;var KIc=eh(),zUi=Tme(),JIc=WUi(),$Be=Wbt(),ZIc=R5r(),P5r=class t{static{a(this,"TextLengthEdit")}static{this.empty=new t([])}static fromTextEdit(e){let r=e.replacements.map(n=>new VBe(n.range,zUi.TextLength.ofText(n.text)));return new t(r)}static _fromTextEditInfo(e){let r=e.map(n=>{let o=(0,$Be.lengthToObj)(n.newLength);return new VBe((0,$Be.lengthsToRange)(n.startOffset,n.endOffset),new zUi.TextLength(o.lineCount,o.columnCount))});return new t(r)}constructor(e){this.edits=e}_toTextEditInfo(){return this.edits.map(e=>new ZIc.TextEditInfo((0,$Be.toLength)(e.range.startLineNumber-1,e.range.startColumn-1),(0,$Be.toLength)(e.range.endLineNumber-1,e.range.endColumn-1),(0,$Be.toLength)(e.newLength.lineCount,e.newLength.columnCount)))}compose(e){let r=this._toTextEditInfo(),n=e._toTextEditInfo(),o=(0,JIc.combineTextEditInfos)(r,n);return t._fromTextEditInfo(o)}getRange(){if(this.edits.length!==0)return KIc.Range.fromPositions(this.edits[0].range.getStartPosition(),this.edits.at(-1).range.getEndPosition())}toString(){return`[${this.edits.join(", ")}]`}};aEe.TextLengthEdit=P5r;var VBe=class{static{a(this,"SingleTextEditLength")}constructor(e,r){this.range=e,this.newLength=r}toString(){return`{ range: ${this.range}, newLength: ${this.newLength} }`}};aEe.SingleTextEditLength=VBe});var KUi=I(cEe=>{"use strict";p();Object.defineProperty(cEe,"__esModule",{value:!0});cEe.DocumentHistory=cEe.HistoryContext=void 0;var XIc=rd(),exc=iN(),D5r=class{static{a(this,"HistoryContext")}constructor(e){this.documents=e,(0,XIc.assert)(e.length>0)}getMostRecentDocument(){return this.documents.at(-1)}getDocument(e){return this.documents.find(r=>r.docId===e)}getDocumentAndIdx(e){let r=this.documents.findIndex(n=>n.docId===e);if(r!==-1)return{doc:this.documents[r],idx:r}}};cEe.HistoryContext=D5r;var N5r=class{static{a(this,"DocumentHistory")}constructor(e,r,n,o,s){this.docId=e,this.languageId=r,this.base=n,this.lastEdits=o,this.lastSelection=s,this.lastEdit=new exc.RootedEdit(this.base,this.lastEdits.compose())}};cEe.DocumentHistory=N5r});var r7i=I(lEe=>{"use strict";p();Object.defineProperty(lEe,"__esModule",{value:!0});lEe.NesHistoryContextProvider=void 0;lEe.sum=zBe;lEe.editExtends=t7i;var JUi=Ro(),ZUi=W2(),txc=KS(),WBe=kE(),rxc=h5e(),nxc=qT(),Ybt=iN(),ixc=L_t(),XUi=YUi(),oxc=h4(),YBe=vMe(),e7i=KUi(),M5r=class extends JUi.Disposable{static{a(this,"NesHistoryContextProvider")}constructor(e,r){super(),this._documentState=new Map,this._lastDocuments=new L5r(50),this._register((0,ZUi.autorun)(n=>{n.readObservable(r.branch)!==void 0&&(this._lastGitCheckout=(0,YBe.now)(),this._documentState.forEach(s=>s.applyAllEdits()))})),(0,ZUi.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=n.selection.get().at(0),c=new O5r(n.id,n.value.get().value,n.languageId.get(),s);this._documentState.set(c.docId,c),s&&this._lastDocuments.push(c),o.add((0,oxc.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},l=>{l.languageId.changes.length>0&&(c.languageId=l.languageId.value);let u=this._isAwaitingGitCheckoutCooldown();for(let d of l.value.changes)this._lastDocuments.push(c),c.handleEdit(d,u);l.selection.changes.length>0&&(c.handleSelection(l.selection.value.at(0)),this._lastDocuments.push(c))})),o.add((0,JUi.toDisposable)(()=>{let l=this._documentState.get(n.id);l&&this._lastDocuments.remove(l),this._documentState.delete(n.id)}))},n=>n.id).recomputeInitiallyAndOnChange(this._store)}getHistoryContext(e){let r=this._documentState.get(e);if(!r||!this._lastDocuments.has(r))return;let n=[],o=!1,s=5;for(let c of this._lastDocuments.getItemsReversed()){let l=c.getRecentEdit(s);if(l!==void 0&&(l.editCount===0&&o||(c.docId===e&&(o=!0),n.push(l.history),s-=l.editCount,s<=0)))break}if(n.reverse(),!!n.some(c=>c.docId===e))return new e7i.HistoryContext(n)}_isAwaitingGitCheckoutCooldown(){if(!this._lastGitCheckout)return!1;let e=(0,YBe.now)()-this._lastGitCheckout<2*1e3;return e||(this._lastGitCheckout=void 0),e}};lEe.NesHistoryContextProvider=M5r;var O5r=class t{static{a(this,"DocumentState")}static{this.MAX_EDITED_LINES_PER_EDIT=10}static{this.MAX_EDITED_CHARS_PER_EDIT=5e3}constructor(e,r,n,o){this.docId=e,this.languageId=n,this._edits=[],this._isUserDocument=!1,this._baseValue=new nxc.StringText(r),this._currentValue=this._baseValue,this.handleSelection(o)}getSelection(){return this._selection}handleSelection(e){e&&(this._isUserDocument=!0),this._selection=e}handleEdit(e,r){if(e.isEmpty())return;this._currentValue=e.applyOnText(this._currentValue);let n=rxc.TextEdit.fromStringEdit(e,this._currentValue),o=XUi.TextLengthEdit.fromTextEdit(n);if(r){this._baseValue=this._currentValue,this._edits=[];return}function s(l){return zBe(l.replacements,u=>u.newText.length)}a(s,"editInsertSize");let c=this._edits.at(-1);c&&s(c.edit)<200&&t7i(e,c.edit)?(c.edit=c.edit.compose(e),c.textLengthEdit=c.textLengthEdit.compose(o),c.instant=(0,YBe.now)(),c.edit.isEmpty()&&this._edits.pop()):this._edits.push({edit:e,textLengthEdit:o,instant:(0,YBe.now)()})}getRecentEdit(e){if(!this._isUserDocument)return;let{editCount:r}=this._applyStaleEdits(e),n=new Ybt.Edits(WBe.StringEdit,this._edits.map(o=>o.edit));return{history:new e7i.DocumentHistory(this.docId,this.languageId,this._baseValue,n,this._selection),editCount:r}}applyAllEdits(){this._baseValue=this._currentValue,this._edits=[]}_applyStaleEdits(e){let r=this._currentValue,n=WBe.StringEdit.empty,o=XUi.TextLengthEdit.empty,s,c=0,l=WBe.StringEdit.empty;for(s=this._edits.length-1;s>=0;s--){let u=this._edits[s];if((0,YBe.now)()-u.instant>600*1e3)break;let d=u.textLengthEdit.compose(o),f=d.getRange();if((0,txc.assertType)(f,"we only compose non-empty Edits"),f.endLineNumber-f.startLineNumber>100)break;let h=zBe(u.textLengthEdit.edits,b=>b.range.endLineNumber-b.range.startLineNumber+b.newLength.lineCount);if(h>t.MAX_EDITED_LINES_PER_EDIT||zBe(u.edit.replacements,b=>b.newText.length)>t.MAX_EDITED_CHARS_PER_EDIT||zBe(u.edit.replacements,b=>b.replaceRange.length)>t.MAX_EDITED_CHARS_PER_EDIT)break;if(s===this._edits.length-1)l=u.edit;else{let b=WBe.StringEdit.trySwap(u.edit,l);if(b)l=b.e1;else{if(h>=2)break;l=u.edit.compose(l)}}r=u.edit.inverse(r.value).applyOnText(r);let y=u.edit.compose(n),E=Ybt.RootedEdit.toLineEdit(new Ybt.RootedEdit(r,y)),v=new ixc.RootedLineEdit(r,E).removeCommonSuffixPrefixLines().edit.replacements.length;if(v>e)break;c=v,n=y,o=d}for(let u=0;u<=s;u++){let d=this._edits[u];this._baseValue=d.edit.applyOnText(this._baseValue)}return this._edits=this._edits.slice(s+1),{editCount:c}}toString(){return new Ybt.Edits(WBe.StringEdit,this._edits.map(e=>e.edit)).toHumanReadablePatch(this._baseValue)}};function zBe(t,e){let r=0;for(let n of t)r+=e(n);return r}a(zBe,"sum");function t7i(t,e){let r=e.getNewRanges();return t.replacements.every(n=>sxc(n.replaceRange,r))}a(t7i,"editExtends");function sxc(t,e){return e.some(r=>t.start===r.endExclusive||t.endExclusive===r.start)}a(sxc,"doesTouch");var L5r=class{static{a(this,"FifoSet")}constructor(e){this.maxSize=e,this._arr=[]}push(e){let r=this._arr.indexOf(e);r!==-1?this._arr.splice(r,1):this._arr.length>=this.maxSize&&this._arr.shift(),this._arr.push(e)}remove(e){let r=this._arr.indexOf(e);r!==-1&&this._arr.splice(r,1)}getItemsReversed(){let e=[...this._arr];return e.reverse(),e}has(e){return this._arr.indexOf(e)!==-1}}});var o7i=I(AN=>{"use strict";p();var axc=AN&&AN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},n7i=AN&&AN.__param||function(t,e){return function(r,n){e(r,n,t)}},F5r;Object.defineProperty(AN,"__esModule",{value:!0});AN.NesXtabHistoryTracker=AN.XtabEditMergeStrategy=void 0;var U5r=rd(),cxc=Ro(),lxc=vue(),uxc=W2(),dxc=C8(),Jbt=Pl(),fxc=mh(),Kbt=iN(),d9=Uvr(),pxc=h4(),B5r=vMe(),Q5r;(function(t){t.sameStartLine={kind:d9.DiffHistoryMergeStrategy.SameStartLine};function e(o){return{kind:d9.DiffHistoryMergeStrategy.Proximity,lineGap:o}}a(e,"proximity"),t.proximity=e;function r(o,s){return{kind:d9.DiffHistoryMergeStrategy.Hybrid,lineGap:o,splitAfterMs:s}}a(r,"hybrid"),t.hybrid=r;function n(o,s,c){switch(o){case d9.DiffHistoryMergeStrategy.Proximity:return e(s);case d9.DiffHistoryMergeStrategy.Hybrid:return r(s,c);case d9.DiffHistoryMergeStrategy.SameStartLine:return t.sameStartLine;default:(0,U5r.assertNever)(o)}}a(n,"fromConfig"),t.fromConfig=n})(Q5r||(AN.XtabEditMergeStrategy=Q5r={}));function i7i(t,e,r){if(t.isEmpty()||e.isEmpty())return!1;for(let n of t.replacements)if(!e.replacements.some(s=>n.lineRange.distanceToRange(s.lineRange)<=r))return!1;return!0}a(i7i,"areLineEditsWithinProximity");var q5r=class extends cxc.Disposable{static{a(this,"NesXtabHistoryTracker")}static{F5r=this}static{this.MAX_HISTORY_SIZE=50}constructor(e,r,n,o){super(),this._configurationService=n,this._expService=o,this.idToEntry=new Map,this.history=new lxc.LinkedList,this.maxHistorySize=r??F5r.MAX_HISTORY_SIZE,this.mergeStrategy=(0,dxc.derived)(s=>Q5r.fromConfig(this._configurationService.getExperimentBasedConfigObservable(Jbt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeStrategy,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(Jbt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeLineGap,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(Jbt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeSplitAfterMs,this._expService).read(s))),(0,uxc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{c.add((0,pxc.autorunWithChanges)(this,{rootedEdits:s.value,visibleRanges:s.visibleRanges},l=>{l.rootedEdits.changes.length>0&&l.rootedEdits.previous!==void 0?this.handleEdits(s,l.rootedEdits):this.handleVisibleRangesChange(s,l.visibleRanges)}))},s=>s.id).recomputeInitiallyAndOnChange(this._store)}getHistory(){return[...this.history]}handleVisibleRangesChange(e,r){if(r.value.length===0)return;let n=this.idToEntry.get(e.id);if(n!==void 0){if(n.entry.kind==="edit")return;n.removeFromHistory()}let o={docId:e.id,kind:"visibleRanges",visibleRanges:r.value,documentContent:e.value.get()},s=this.history.push(o);this.idToEntry.set(e.id,{entry:o,removeFromHistory:s,lastEditTimestamp:(0,B5r.now)()}),this.compactHistory()}shouldMerge(e,r,n){let o=this.mergeStrategy.get();switch(o.kind){case d9.DiffHistoryMergeStrategy.SameStartLine:return!r.isEmpty()&&!e.isEmpty()&&e.replacements[0].lineRange.startLineNumber===r.replacements[0].lineRange.startLineNumber;case d9.DiffHistoryMergeStrategy.Proximity:return i7i(r,e,o.lineGap);case d9.DiffHistoryMergeStrategy.Hybrid:return(0,B5r.now)()-n<=o.splitAfterMs&&i7i(r,e,o.lineGap)}}handleEdits(e,r){(0,U5r.assert)(r.previous!==void 0,"Document has previous version"),(0,U5r.assert)(r.changes.length===1,`Expected 1 edit change but got ${r.changes.length}`);let n=r.changes[0];if(n.replacements.length===0)return;let o=this.idToEntry.get(e.id),s=r.previous,c=new Kbt.RootedEdit(s,n);if(o===void 0){this.pushToHistory(e.id,c);return}if(o.entry.kind==="visibleRanges"){o.removeFromHistory(),this.pushToHistory(e.id,c);return}let l=o.entry.edit,u=Kbt.RootedEdit.toLineEdit(l),d=Kbt.RootedEdit.toLineEdit(c);if(this.shouldMerge(u,d,o.lastEditTimestamp)){o.removeFromHistory();let f=l.edit.compose(n),h=new Kbt.RootedEdit(l.base,f);this.pushToHistory(e.id,h)}else this.pushToHistory(e.id,c)}pushToHistory(e,r){let n={docId:e,kind:"edit",edit:r},o=this.history.push(n);this.idToEntry.set(e,{entry:n,removeFromHistory:o,lastEditTimestamp:(0,B5r.now)()}),this.compactHistory()}compactHistory(){if(this.history.size>this.maxHistorySize){let e=this.history.shift();if(e!==void 0){let r=this.idToEntry.get(e.docId);r!==void 0&&e===r.entry&&this.idToEntry.delete(e.docId)}}}};AN.NesXtabHistoryTracker=q5r;AN.NesXtabHistoryTracker=q5r=F5r=axc([n7i(2,Jbt.IConfigurationService),n7i(3,fxc.IExperimentationService)],q5r)});var s7i=I(Zbt=>{"use strict";p();Object.defineProperty(Zbt,"__esModule",{value:!0});Zbt.IVSCodeExtensionContext=void 0;var hxc=nn();Zbt.IVSCodeExtensionContext=(0,hxc.createServiceIdentifier)("IVSCodeExtensionContext")});var h7i=I(EN=>{"use strict";p();var u7i=EN&&EN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},_V=EN&&EN.__param||function(t,e){return function(r,n){e(r,n,t)}},JBe;Object.defineProperty(EN,"__esModule",{value:!0});EN.UndesiredModels=EN.InlineEditsModelService=void 0;var mxc=MOr(),d7i=gOr(),a7i=X_(),gxc=Sl(),c7i=rd(),f7i=Ic(),p7i=Ro(),uEe=W2(),Axc=XH(),yN=Pl(),yxc=s7i(),Exc=Sp(),_xc=hbt(),vxc=mh(),Cxc=gm(),KBe=py(),bxc=kCt(),H5r=class extends p7i.Disposable{static{a(this,"InlineEditsModelService")}static{JBe=this}static{this.COPILOT_NES_XTAB_MODEL={modelName:"copilot-nes-xtab",promptingStrategy:KBe.PromptingStrategy.CopilotNesXtab,includeTagsInCurrentFile:!0,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_OCT={modelName:"copilot-nes-oct",promptingStrategy:KBe.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_CALLISTO={modelName:"nes-callisto",promptingStrategy:KBe.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}constructor(e,r,n,o,s,c,l){super(),this._tokenStore=e,this._proxyModelsService=r,this._undesiredModelsManager=n,this._configService=o,this._expService=s,this._telemetryService=c,this._logService=l,this._copilotTokenObs=(0,uEe.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken),this._fetchedModelsObs=(0,uEe.observableFromEvent)(this,this._proxyModelsService.onModelListUpdated,()=>this._proxyModelsService.nesModels),this._preferredModelNameObs=this._configService.getExperimentBasedConfigObservable(yN.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService),this._localModelConfigObs=this._configService.getConfigObservable(yN.ConfigKey.Advanced.InlineEditsXtabProviderModelConfiguration),this._expBasedModelConfigObs=this._configService.getExperimentBasedConfigObservable(yN.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString,this._expService),this._defaultModelConfigObs=this._configService.getExperimentBasedConfigObservable(yN.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString,this._expService),this._useSlashModelsObs=this._configService.getExperimentBasedConfigObservable(yN.ConfigKey.TeamInternal.InlineEditsUseSlashModels,this._expService),this._undesiredModelsObs=(0,uEe.observableFromEvent)(this,this._undesiredModelsManager.onDidChange,()=>this._undesiredModelsManager),this._setModelQueue=new d7i.TaskQueue,this._logger=l.createSubLogger(["NES","ModelsService"]);let u=this._logger.createSubLogger("constructor");this._modelsObs=(0,uEe.derived)(d=>(u.trace("computing models"),this.aggregateModels({copilotToken:this._copilotTokenObs.read(d),fetchedNesModels:this._fetchedModelsObs.read(d),localModelConfig:this._localModelConfigObs.read(d),modelConfigString:this._expBasedModelConfigObs.read(d),defaultModelConfigString:this._defaultModelConfigObs.read(d),useSlashModels:this._useSlashModelsObs.read(d)}))).recomputeInitiallyAndOnChange(this._store),this._currentModelObs=(0,uEe.derived)(d=>{u.trace("computing current model");let f=this._undesiredModelsObs.read(d);return this._pickModel({preferredModelName:this._preferredModelNameObs.read(d),models:this._modelsObs.read(d),undesiredModelsManager:f})}).recomputeInitiallyAndOnChange(this._store),this._modelInfoObs=(0,uEe.derived)(d=>(u.trace("computing model info"),{models:this._modelsObs.read(d),currentModelId:this._currentModelObs.read(d).modelName})).recomputeInitiallyAndOnChange(this._store),this.onModelListUpdated=f7i.Event.fromObservableLight(this._modelInfoObs)}get modelInfo(){let e=this._modelsObs.get().map(n=>({id:n.modelName,name:n.modelName})),r=this._currentModelObs.get();return{models:e,currentModelId:r.modelName}}setCurrentModelId(e){return this._setModelQueue.schedule(()=>this._setCurrentModelIdCore(e))}async _setCurrentModelIdCore(e){if(this._configService.getExperimentBasedConfig(yN.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService)===e)return;let o=this._currentModelObs.get(),s=this._modelsObs.get(),c=s.find(u=>u.modelName===e);if(c===void 0){this._logService.error(`New preferred model id ${e} not found in model list.`);return}o.source==="expConfig"&&await this._undesiredModelsManager.addUndesiredModelId(o.modelName),this._undesiredModelsManager.isUndesiredModelId(e)&&await this._undesiredModelsManager.removeUndesiredModelId(e);let l=this._pickModel({preferredModelName:"none",models:s,undesiredModelsManager:this._undesiredModelsManager});c.source==="expConfig"||e===l.modelName&&!s.some(u=>u.source==="expConfig")?(this._logger.trace(`New preferred model id ${e} is the same as the default model, resetting user setting.`),await this._configService.setConfig(yN.ConfigKey.Advanced.InlineEditsPreferredModel,"none")):(this._logger.trace(`New preferred model id ${e} is different from the default model, updating user setting to ${e}.`),await this._configService.setConfig(yN.ConfigKey.Advanced.InlineEditsPreferredModel,e))}aggregateModels({copilotToken:e,fetchedNesModels:r,localModelConfig:n,modelConfigString:o,defaultModelConfigString:s,useSlashModels:c}){let l=this._logger.createSubLogger("aggregateModels"),u=[];if(n&&(u.some(d=>d.modelName===n.modelName)?l.trace("Local model configuration already exists in the model list, skipping."):(l.trace(`Adding local model configuration: ${n.modelName}`),u.push({...n,source:"localConfig"}))),o){l.trace("Parsing modelConfigurationString...");let d=this.parseModelConfigString(o,yN.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString);d&&!u.some(f=>f.modelName===d.modelName)?(l.trace(`Adding model from modelConfigurationString: ${d.modelName}`),u.push({...d,source:"expConfig"})):l.trace("No valid model found in modelConfigurationString.")}if(c&&r&&r.length>0){l.trace(`Processing ${r.length} fetched models...`);let d=(0,mxc.filterMap)(r,f=>{if((0,KBe.isPromptingStrategy)(f.capabilities.promptStrategy)){if(u.some(h=>h.modelName===f.name)){l.trace(`Fetched model ${f.name} already exists in the model list, skipping.`);return}return{modelName:f.name,promptingStrategy:f.capabilities.promptStrategy,includeTagsInCurrentFile:!1,source:"fetched",lintOptions:void 0}}});l.trace(`Adding ${d.length} fetched models after filtering.`),(0,gxc.pushMany)(u,d)}else{l.trace(`adding built-in default model: useSlashModels ${c}, fetchedNesModels ${r?.length??"undefined"}`);let d=this.determineDefaultModel(e,s);d&&(u.some(f=>f.modelName===d.modelName)?l.trace("Default model configuration already exists in the model list, skipping."):(l.trace(`Adding default model configuration: ${d.modelName}`),u.push(d)))}return u}selectedModelConfiguration(){return j5r(this._currentModelObs.get())}defaultModelConfiguration(){let e=this._modelsObs.get();if(e&&e.length>0){let r=e.filter(n=>!this.isConfiguredModel(n));if(r.length>0)return j5r(r[0])}return j5r(this.determineDefaultModel(this._copilotTokenObs.get(),this._defaultModelConfigObs.get()))}isConfiguredModel(e){switch(e.source){case"localConfig":case"expConfig":case"expDefaultConfig":return!0;case"fetched":case"hardCodedDefault":return!1;default:(0,c7i.assertNever)(e.source)}}determineDefaultModel(e,r){if(r){let n=this.parseModelConfigString(r,yN.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString);if(n)return{...n,source:"expDefaultConfig"}}return e?.isFcv1()?JBe.COPILOT_NES_XTAB_MODEL:e?.isFreeUser||e?.isNoAuthUser?JBe.COPILOT_NES_CALLISTO:JBe.COPILOT_NES_OCT}_pickModel({preferredModelName:e,models:r,undesiredModelsManager:n}){let o=r.find(l=>l.source==="expConfig");if(o)if(n.isUndesiredModelId(o.modelName))this._logger.trace(`Exp-configured model ${o.modelName} is marked as undesired by the user. Skipping.`);else return o;if(e!=="none"){let l=r.find(u=>u.modelName===e);if(l)return l}(0,c7i.softAssert)(r.length>0,"InlineEdits model list should have at least one model");let c=r.at(0);return c||this.determineDefaultModel(this._copilotTokenObs.get(),this._defaultModelConfigObs.get())}parseModelConfigString(e,r){let n;try{let o=JSON.parse(e),s=KBe.MODEL_CONFIGURATION_VALIDATOR.validate(o);if(!s.error)return s.content;n=s.error.message}catch(o){n=a7i.ErrorUtils.toString(a7i.ErrorUtils.fromUnknown(o))}this._telemetryService.sendMSFTTelemetryEvent("incorrectNesModelConfig",{configName:r.id,errorMessage:n,configValue:e})}};EN.InlineEditsModelService=H5r;EN.InlineEditsModelService=H5r=JBe=u7i([_V(0,Axc.ICopilotTokenStore),_V(1,_xc.IProxyModelsService),_V(2,bxc.IUndesiredModelsManager),_V(3,yN.IConfigurationService),_V(4,vxc.IExperimentationService),_V(5,Cxc.ITelemetryService),_V(6,Exc.ILogService)],H5r);function j5r(t){let{source:e,...r}=t;return r}a(j5r,"toModelConfiguration");var l7i;(function(t){let e="copilot.chat.nextEdits.undesiredModelIds",r=class extends p7i.Disposable{static{a(this,"Manager")}constructor(o){super(),this._vscodeExtensionContext=o,this._onDidChange=this._register(new f7i.Emitter),this.onDidChange=this._onDidChange.event,this._queue=new d7i.TaskQueue}isUndesiredModelId(o){return this._getModels().includes(o)}addUndesiredModelId(o){return this._queue.schedule(async()=>{let s=this._getModels();s.includes(o)||(s.push(o),await this._setModels(s),this._onDidChange.fire())})}removeUndesiredModelId(o){return this._queue.schedule(async()=>{let s=this._getModels(),c=s.indexOf(o);c!==-1&&(s.splice(c,1),await this._setModels(s),this._onDidChange.fire())})}_getModels(){return this._vscodeExtensionContext.globalState.get(e)??[]}_setModels(o){return new Promise((s,c)=>{this._vscodeExtensionContext.globalState.update(e,o).then(s,c)})}};r=u7i([_V(0,yxc.IVSCodeExtensionContext)],r),t.Manager=r})(l7i||(EN.UndesiredModels=l7i={}))});var m7i=I(Xbt=>{"use strict";p();Object.defineProperty(Xbt,"__esModule",{value:!0});Xbt.NullLanguageContextProviderService=void 0;var Sxc=Ro(),G5r=class{static{a(this,"NullLanguageContextProviderService")}registerContextProvider(e,r){return Sxc.Disposable.None}getAllProviders(){return[]}getContextProviders(e){return[]}getContextItems(e,r,n){return{[Symbol.asyncIterator]:async function*(){}}}getContextItemsOnTimeout(e,r){return[]}};Xbt.NullLanguageContextProviderService=G5r});var g7i=I(e1t=>{"use strict";p();Object.defineProperty(e1t,"__esModule",{value:!0});e1t.TestLanguageDiagnosticsService=void 0;var Txc=Ic(),Ixc=zP(),xxc=T$(),$5r=class extends xxc.AbstractLanguageDiagnosticsService{static{a(this,"TestLanguageDiagnosticsService")}constructor(){super(...arguments),this.diagnosticsMap=new Ixc.ResourceMap,this._onDidChangeDiagnostics=new Txc.Emitter,this.onDidChangeDiagnostics=this._onDidChangeDiagnostics.event}setDiagnostics(e,r){this.diagnosticsMap.set(e,r),this._onDidChangeDiagnostics.fire({uris:[e]})}getDiagnostics(e){return this.diagnosticsMap.get(e)||[]}getAllDiagnostics(){return Array.from(this.diagnosticsMap.entries())}};e1t.TestLanguageDiagnosticsService=$5r});var A7i=I(r1t=>{"use strict";p();Object.defineProperty(r1t,"__esModule",{value:!0});r1t.ResponseStream=void 0;var wxc=X_(),t1t=uw(),Rxc=nl(),kxc=KS(),V5r=class t{static{a(this,"ResponseStream")}constructor(e,r,n,o){this.fetcherResponse=e,this.requestId=n,this.headers=o;let s=new Rxc.DeferredPromise;this.aggregatedStream=s.p,this.response=this.aggregatedStream.then(c=>{if(c.isError())return c;try{return t1t.Result.ok(t.aggregateCompletionsStream(c.val))}catch(l){return t1t.Result.error(l)}}),this.stream=Pxc(r,s)}async destroy(){await this.fetcherResponse.body.destroy()}static aggregateCompletionsStream(e){let r="",n=null,o=null,s;for(let d of e){let f=d.choices[0];r+=f.text??"",f.logprobs&&(o===null?o={tokens:[...f.logprobs.tokens],token_logprobs:[...f.logprobs.token_logprobs],text_offset:[...f.logprobs.text_offset],top_logprobs:[...f.logprobs.top_logprobs]}:(o.tokens.push(...f.logprobs.tokens),o.token_logprobs.push(...f.logprobs.token_logprobs),o.text_offset.push(...f.logprobs.text_offset),o.top_logprobs.push(...f.logprobs.top_logprobs))),d.usage&&(s===void 0?s={completion_tokens:d.usage.completion_tokens,prompt_tokens:d.usage.prompt_tokens,total_tokens:d.usage.total_tokens,completion_tokens_details:{audio_tokens:d.usage.completion_tokens_details.audio_tokens,reasoning_tokens:d.usage.completion_tokens_details.reasoning_tokens},prompt_tokens_details:{audio_tokens:d.usage.prompt_tokens_details.audio_tokens,reasoning_tokens:d.usage.prompt_tokens_details.reasoning_tokens}}:(s.completion_tokens+=d.usage.completion_tokens,s.prompt_tokens+=d.usage.prompt_tokens,s.total_tokens+=d.usage.total_tokens,s.completion_tokens_details.audio_tokens+=d.usage.completion_tokens_details.audio_tokens,s.completion_tokens_details.reasoning_tokens+=d.usage.completion_tokens_details.reasoning_tokens,s.prompt_tokens_details.audio_tokens+=d.usage.prompt_tokens_details.audio_tokens,s.prompt_tokens_details.reasoning_tokens+=d.usage.prompt_tokens_details.reasoning_tokens)),f.finish_reason&&((0,kxc.assertType)(n===null,"cannot already have finishReason if just seeing choice.finish_reason"),n=f.finish_reason)}if(e.length===0)throw new Error("Response is empty!");let c=e[0];return{choices:[{index:0,finish_reason:n,logprobs:o,text:r}],system_fingerprint:c.system_fingerprint,object:c.object,usage:s}}};r1t.ResponseStream=V5r;async function*Pxc(t,e){let r=[],n;try{for await(let o of t)r.push(o),yield o}catch(o){throw n=wxc.ErrorUtils.fromUnknown(o),n}finally{e.complete(n?t1t.Result.error(n):t1t.Result.ok(r))}}a(Pxc,"streamWithAggregation")});var y7i=I(W5r=>{"use strict";p();Object.defineProperty(W5r,"__esModule",{value:!0});W5r.jsonlStreamToCompletions=Dxc;async function*Dxc(t){for await(let e of t)if(e.trim()!=="data: [DONE]"&&e.startsWith("data: ")){let r=JSON.parse(e.substring(6));if(r.error)throw new Error(r.error.message);yield r}}a(Dxc,"jsonlStreamToCompletions")});var _7i=I(f9=>{"use strict";p();var Nxc=f9&&f9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},z5r=f9&&f9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(f9,"__esModule",{value:!0});f9.CompletionsFetchService=void 0;var Mxc=AOr(),E7i=X_(),eie=uw(),Oxc=I0r(),Lxc=FE(),Bxc=$6(),Fxc=_y(),Uxc=lye(),vV=__t(),Qxc=A7i(),qxc=y7i(),Y5r=class{static{a(this,"CompletionsFetchService")}constructor(e,r,n){this.authService=e,this.fetcherService=r,this.requestLogger=n}disconnectAll(){return this.fetcherService.disconnectAll()}async fetch(e,r,n,o,s,c){let l=Date.now();if(s.isCancellationRequested){let f=eie.Result.error(new vV.Completions.RequestCancelled);return this._logCompletionsRequest(e,n,o,l,f),f}let u={requestId:o,headers:this.getHeaders(o,r,c),body:JSON.stringify({...n,stream:!0})},d=await this._fetchFromUrl(e,u,s);if(d.isError())return this._logCompletionsRequest(e,n,o,l,d),d;if(d.val.status===200){let f=Mxc.AsyncIterUtilsExt.splitLines(d.val.body),h=(0,qxc.jsonlStreamToCompletions)(f),m=new Qxc.ResponseStream(d.val.response,h,d.val.requestId,d.val.headers),g=eie.Result.ok(m);return this._logCompletionsRequest(e,n,o,l,g),g}else{let f=new vV.Completions.UnsuccessfulResponse(d.val.status,d.val.statusText,d.val.headers,()=>Hxc(d.val.body).catch(()=>"")),h=eie.Result.error(f);return this._logCompletionsRequest(e,n,o,l,h),h}}async _fetchFromUrl(e,r,n){let o=this.fetcherService.makeAbortController(),s=n.onCancellationRequested(()=>{o.abort()});try{let c={headers:r.headers,body:r.body,signal:o.signal,method:"POST",callSite:"nes-completions"},l=await this.fetcherService.fetch(e,c);if(l.status===200&&this.authService.copilotToken?.isFreeUser&&this.authService.copilotToken?.isChatQuotaExceeded&&this.authService.resetCopilotToken(),l.status!==200)return l.status===402&&(this.authService.copilotToken?.isCompletionsQuotaExceeded||(this.authService.resetCopilotToken(l.status),await this.authService.getCopilotToken())),eie.Result.error(new vV.Completions.UnsuccessfulResponse(l.status,l.statusText,l.headers,()=>l.text().catch(()=>"")));let u=l.body.pipeThrough(new TextDecoderStream),d=jxc(u,s);return eie.Result.ok({status:l.status,statusText:l.statusText,headers:l.headers,body:d,requestId:(0,Bxc.getRequestId)(l.headers),response:l})}catch(c){if(s.dispose(),c instanceof Error&&c.message==="This operation was aborted")return eie.Result.error(new vV.Completions.RequestCancelled);let l=E7i.ErrorUtils.fromUnknown(c);return eie.Result.error(new vV.Completions.Unexpected(l))}}_logCompletionsRequest(e,r,n,o,s){if(s.isOk())s.val.response.then(l=>{let u=l.isOk()?"success":"failed";this._emitCompletionsLogEntry(e,r,n,o,u,l)});else{let c=s.err;c instanceof vV.Completions.RequestCancelled?this._emitCompletionsLogEntry(e,r,n,o,"cancelled",void 0):c instanceof vV.Completions.UnsuccessfulResponse?this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,`${c.status} ${c.statusText}`):c instanceof vV.Completions.Unexpected&&this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,c.error.message)}}_emitCompletionsLogEntry(e,r,n,o,s,c,l){let u=Date.now()-o,d=[];if(d.push("> \u{1F6A8} Note: This log may contain personal information such as the contents of your files. Please review the contents carefully before sharing."),d.push("# completions"),d.push(""),d.push("- [Metadata](#metadata)"),d.push("- [Prompt](#prompt)"),r.suffix&&d.push("- [Suffix](#suffix)"),d.push("- [Response](#response)"),d.push(""),d.push("## Metadata"),d.push("
"),d.push(`url              : ${e}`),d.push(`requestId        : ${n}`),d.push(`model            : ${r.model??"(default)"}`),d.push(`maxTokens        : ${r.max_tokens}`),d.push(`temperature      : ${r.temperature}`),d.push(`top_p            : ${r.top_p}`),d.push(`n                : ${r.n}`),d.push(`duration         : ${u}ms`),d.push("
"),d.push(""),d.push("## Prompt"),d.push("~~~"),d.push(r.prompt),d.push("~~~"),r.suffix&&(d.push(""),d.push("## Suffix"),d.push("~~~"),d.push(r.suffix),d.push("~~~")),d.push(""),d.push("## Response"),s==="cancelled")d.push("## CANCELED");else if(s==="failed")d.push(`## FAILED: ${l}`);else if(c)if(c.isOk()){let h=c.val,m=h.choices[0]?.text??"",g=h.choices[0]?.finish_reason??"unknown";d.push("~~~"),d.push(m||""),d.push("~~~"),d.push(""),d.push("
"),d.push(`finishReason     : ${g}`),h.usage&&(d.push(`promptTokens     : ${h.usage.prompt_tokens}`),d.push(`completionTokens : ${h.usage.completion_tokens}`),d.push(`totalTokens      : ${h.usage.total_tokens}`)),d.push("
")}else d.push(`## FAILED: stream error - ${c.err.message}`);let f=s==="success"?void 0:Oxc.Codicon.error;this.requestLogger.addEntry({type:"MarkdownContentRequest",debugName:"Completions Request",startTimeMs:o,icon:f,markdownContent:d.join(` -`)})}getHeaders(e,r,n={}){return{"Content-Type":"application/json","x-policy-id":"nil",Authorization:"Bearer "+r,"X-Request-Id":e,"X-GitHub-Api-Version":"2025-04-01",...n}}};f9.CompletionsFetchService=Y5r;f9.CompletionsFetchService=Y5r=Nxc([z5r(0,Lxc.IAuthenticationService),z5r(1,Fxc.IFetcherService),z5r(2,Uxc.IRequestLogger)],Y5r);async function*jxc(t,e){try{for await(let r of t)yield r}catch(r){throw E7i.ErrorUtils.fromUnknown(r)}finally{e.dispose()}}a(jxc,"streamWithCleanup");async function Hxc(t){let e=[];for await(let r of t)e.push(r);return e.join("")}a(Hxc,"collectAsyncIterableToString")});var C7i=I(n1t=>{"use strict";p();Object.defineProperty(n1t,"__esModule",{value:!0});n1t.WireTypes=void 0;var CV=RG(),v7i;(function(t){let e;(function(o){function s(c){return!!c&&typeof c=="object"&&typeof c.promptStrategy=="string"}a(s,"is"),o.is=s,o.validator=(0,CV.vObj)({promptStrategy:(0,CV.vString)()})})(e=t.Capabilities||(t.Capabilities={}));let r;(function(o){o.validator=(0,CV.vObj)({serviceType:(0,CV.vString)(),name:(0,CV.vString)(),provider:(0,CV.vString)(),capabilities:e.validator});function s(c){return!!c&&typeof c=="object"&&typeof c.serviceType=="string"&&typeof c.name=="string"&&typeof c.provider=="string"&&e.is(c.capabilities)}a(s,"is"),o.is=s})(r=t.Model||(t.Model={}));let n;(function(o){o.validator=(0,CV.vObj)({models:(0,CV.vArray)(r.validator)});function s(c){return!!c&&typeof c=="object"&&Array.isArray(c.models)&&c.models.every(r.is)}a(s,"is"),o.is=s})(n=t.ModelList||(t.ModelList={}))})(v7i||(n1t.WireTypes=v7i={}))});var S7i=I(p9=>{"use strict";p();var Gxc=p9&&p9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i1t=p9&&p9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(p9,"__esModule",{value:!0});p9.ProxyModelsService=void 0;var $xc=require("util"),K5r=X_(),Vxc=YP(),Wxc=Ic(),zxc=Ro(),b7i=W2(),Yxc=XH(),Kxc=$E(),Jxc=C7i(),Zxc=Sp(),Xxc=_y(),J5r=class extends zxc.Disposable{static{a(this,"ProxyModelsService")}constructor(e,r,n,o){super(),this._tokenStore=e,this._capiClient=r,this._fetchService=n,this._logService=o,this._onModelListUpdated=this._register(new Wxc.Emitter),this.onModelListUpdated=this._onModelListUpdated.event;let s=(0,b7i.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken);this._register((0,b7i.autorun)(c=>{let l=s.read(c),u=new Vxc.CancellationTokenSource;this._fetchLatestModels(l,u.token).then(d=>{d!==void 0&&(u.token.isCancellationRequested||(0,$xc.isDeepStrictEqual)(this._models,d)||(this._models=d,this._onModelListUpdated.fire()))}).catch(d=>{let f=K5r.ErrorUtils.fromUnknown(d);this._logService.error(f,"Failed to fetch models in autorun")}),c.store.add({dispose:a(()=>u.dispose(!0),"dispose")})}))}get models(){return this._models}get nesModels(){return this._models?.models.filter(e=>e.serviceType==="NESChat")}get cursorJumpModels(){return this._models?.models.filter(e=>e.serviceType==="CursorJumpChat")}get instantApplyModels(){return this._models?.models.filter(e=>e.serviceType==="InstantApplyChat")}async _fetchLatestModels(e,r){if(!e)return;let n=`${this._capiClient.proxyBaseURL}/models`,o=this._fetchService.makeAbortController(),s=r.onCancellationRequested(()=>o.abort()),c;try{c=await this._fetchService.fetch(n,{headers:{Authorization:`Bearer ${e.token}`},method:"GET",timeout:1e4,callSite:"proxy-models",signal:o.signal})}catch(l){let u=K5r.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to fetch model list");return}finally{s.dispose()}if(!c.ok){this._logService.error(`Failed to fetch model list: ${c.status} ${c.statusText}`);return}try{let l=await c.json(),u=Jxc.WireTypes.ModelList.validator.validate(l);if(u.error)throw new Error(`Invalid /models response data: ${u.error.message}`);return u.content}catch(l){let u=K5r.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to process /models response");return}}};p9.ProxyModelsService=J5r;p9.ProxyModelsService=J5r=Gxc([i1t(0,Yxc.ICopilotTokenStore),i1t(1,Kxc.ICAPIClientService),i1t(2,Xxc.IFetcherService),i1t(3,Zxc.ILogService)],J5r)});var T7i=I(o1t=>{"use strict";p();Object.defineProperty(o1t,"__esModule",{value:!0});o1t.NullRequestLogger=void 0;var ewc=fMr(),twc=Ic(),Z5r=class extends ewc.AbstractRequestLogger{static{a(this,"NullRequestLogger")}constructor(){super(...arguments),this.onDidChangeRequests=twc.Event.None}addPromptTrace(){}addEntry(e){}getRequests(){return[]}getRequestById(e){}logModelListCall(e,r,n){}logToolCall(e,r,n,o){}};o1t.NullRequestLogger=Z5r});var u1t=I(eu=>{"use strict";p();var a4r=eu&&eu.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},_N=eu&&eu.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(eu,"__esModule",{value:!0});eu.SimpleExperimentationService=eu.LogLevel=eu.TokenizerName=eu.ILanguageContextProviderService=eu.IIgnoreService=eu.IExperimentationService=eu.IEndpointProvider=eu.ICAPIClientService=eu.IAuthenticationService=void 0;eu.createNESProvider=zwc;eu.createInlineCompletionsProvider=Kwc;var rwc=Asi(),I7i=bte(),x7i=sIi(),w7i=Uge(),nwc=mgt(),R7i=FSr(),iwc=USr(),$v=LE(),k7i=$Sr(),owc=e2i(),swc=fy(),P7i=LTr(),awc=n$(),D7i=jTr(),N7i=_4e(),M7i=cIr(),O7i=uIr(),L7i=IPr(),e4r=uyt(),cwc=LLi(),lwc=BLi(),ZBe=Dl(),uwc=KAe(),dwc=jSr(),B7i=o2r(),F7i=mTr(),U7i=A_t(),Q7i=ckr(),q7i=tEt(),XBe=eEt(),j7i=v$(),H7i=hEt(),fwc=qLi(),pwc=dEt(),G7i=sCr(),$7i=s1(),V7i=_5e(),W7i=rne(),iQi=Ore();Object.defineProperty(eu,"TokenizerName",{enumerable:!0,get:a(function(){return iQi.TokenizerName},"get")});var hwc=tBi(),mwc=XBi(),t4r=C3i(),z7i=BDr(),gwc=s6i(),Y7i=xMr(),Awc=pUi(),c4r=FE();Object.defineProperty(eu,"IAuthenticationService",{enumerable:!0,get:a(function(){return c4r.IAuthenticationService},"get")});var ywc=E5e(),K7i=XH(),Ewc=hUi(),_wc=xUi(),vwc=K6(),Cwc=QDr(),bwc=wUi(),Swc=qDr(),J7i=HDr(),PL=Pl(),Twc=kUi(),Iwc=wMr(),xwc=LUi(),l4r=$E();Object.defineProperty(eu,"ICAPIClientService",{enumerable:!0,get:a(function(){return l4r.ICAPIClientService},"get")});var wwc=J$(),u4r=s4e();Object.defineProperty(eu,"IEndpointProvider",{enumerable:!0,get:a(function(){return u4r.IEndpointProvider},"get")});var oQi=FUi(),Rwc=QUi(),tie=U4(),kwc=qUi(),Pwc=S5r(),sQi=jUi(),e3e=Bre();Object.defineProperty(eu,"IIgnoreService",{enumerable:!0,get:a(function(){return e3e.IIgnoreService},"get")});var Dwc=Vne(),Nwc=Zft(),X5r=kCt(),Mwc=HUi(),Owc=r7i(),Lwc=o7i(),Bwc=h7i(),d4r=Jyt();Object.defineProperty(eu,"ILanguageContextProviderService",{enumerable:!0,get:a(function(){return d4r.ILanguageContextProviderService},"get")});var aQi=m7i(),cQi=T$(),lQi=g7i(),vN=Sp(),Fwc=__t(),Uwc=_7i(),f4r=_y(),Z7i=X6(),Qwc=aMr(),qwc=cMr(),jwc=yCt(),Hwc=hbt(),Gwc=S7i(),uQi=lye(),dQi=T7i(),X7i=BMr(),eQi=Q2r(),r3e=mh();Object.defineProperty(eu,"IExperimentationService",{enumerable:!0,get:a(function(){return r3e.IExperimentationService},"get")});var fQi=gm(),tQi=Tye(),$wc=Ivr(),rQi=abt(),nQi=K$(),r4r=fOr(),pQi=nn(),Vwc=YP(),t3e=Ic(),l1t=Ro(),Wwc=T0(),gi=Hft(),hQi=Gs(),rie;(function(t){t[t.Off=0]="Off",t[t.Trace=1]="Trace",t[t.Debug=2]="Debug",t[t.Info=3]="Info",t[t.Warning=4]="Warning",t[t.Error=5]="Error"})(rie||(eu.LogLevel=rie={}));function zwc(t){return Ywc(t).createInstance(n4r,t)}a(zwc,"createNESProvider");var n4r=class extends l1t.Disposable{static{a(this,"NESProvider")}constructor(e,r,n,o,s){super(),this._options=e,this._expService=n,this._configurationService=o,this._workspaceService=s;let c=r.createInstance(Awc.XtabProvider),l=r.createInstance(Mwc.ObservableGit),u=new Owc.NesHistoryContextProvider(this._options.workspace,l),d=this._configurationService.getExperimentBasedConfig(PL.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this._expService),f=new Lwc.NesXtabHistoryTracker(this._options.workspace,d,o,n);this._debugRecorder=this._register(new hwc.DebugRecorder(this._options.workspace)),this._nextEditProvider=r.createInstance(mwc.NextEditProvider,this._options.workspace,c,u,f,this._debugRecorder),this._telemetrySender=this._register(r.createInstance(t4r.TelemetrySender,this._options.workspace))}getId(){return this._nextEditProvider.ID}handleShown(e){e.telemetryBuilder.setAsShown(),this._nextEditProvider.handleShown(e.internalResult)}handleAcceptance(e){e.telemetryBuilder.setAcceptance("accepted"),e.telemetryBuilder.setStatus("accepted"),this._nextEditProvider.handleAcceptance(e.docId,e.internalResult),this.handleEndOfLifetime(e)}handleRejection(e){e.telemetryBuilder.setAcceptance("rejected"),e.telemetryBuilder.setStatus("rejected"),this._nextEditProvider.handleRejection(e.docId,e.internalResult),this.handleEndOfLifetime(e)}handleIgnored(e,r){r&&e.telemetryBuilder.setSupersededBy(r.requestUuid),this._nextEditProvider.handleIgnored(e.docId,e.internalResult,r?.internalResult),this.handleEndOfLifetime(e)}handleEndOfLifetime(e){try{this._telemetrySender.sendTelemetryForBuilder(e.telemetryBuilder)}finally{e.telemetryBuilder.dispose()}}async getNextEdit(e,r){let n=Dwc.DocumentId.create(e.toString()),o={triggerKind:1,selectedCompletionInfo:void 0,requestUuid:(0,Wwc.generateUuid)(),requestIssuedDateTime:Date.now(),earliestShownDateTime:Date.now()+200,enforceCacheDelay:!0},s=new Nwc.InlineEditRequestLogContext(e.toString(),1,o),c=this._options.workspace.getDocument(n);if(!c)throw new Error("DocumentNotFound");let l=new t4r.NextEditProviderTelemetryBuilder(new sQi.NullGitExtensionService,void 0,this._workspaceService,this._nextEditProvider.ID,c,this._debugRecorder,s.recordingBookmark);l.setOpportunityId(o.requestUuid);try{let u=await this._nextEditProvider.getNextEdit(n,o,s,r,l.nesBuilder);return{result:u.result?.edit?{newText:u.result.edit.newText,range:u.result.edit.replaceRange,...u.result.targetDocumentId?{targetDocumentUri:u.result.targetDocumentId.uri}:{}}:void 0,docId:n,requestUuid:o.requestUuid,internalResult:u,telemetryBuilder:l}}catch(u){try{this._telemetrySender.sendTelemetryForBuilder(l)}finally{l.dispose()}throw u}}updateTreatmentVariables(e){this._expService instanceof nie&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=PL.globalConfigRegistry.configs.get(`${PL.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}}};n4r=a4r([_N(1,hQi.IInstantiationService),_N(2,r3e.IExperimentationService),_N(3,PL.IConfigurationService),_N(4,r4r.IWorkspaceService)],n4r);function Ywc(t){let{fetcher:e,copilotTokenManager:r,telemetrySender:n,logTarget:o}=t,s=new pQi.InstantiationServiceBuilder;s.define(PL.IConfigurationService,new gi.SyncDescriptor(s1t,[t.configOverrides??new Map])),s.define(r3e.IExperimentationService,new gi.SyncDescriptor(nie,[t.waitForTreatmentVariables])),s.define(X7i.ISimulationTestContext,new gi.SyncDescriptor(X7i.NulSimulationTestContext)),s.define(r4r.IWorkspaceService,new gi.SyncDescriptor(r4r.NullWorkspaceService)),s.define(Iwc.IDiffService,new gi.SyncDescriptor(xwc.DiffServiceImpl,[!1])),s.define(vN.ILogService,new gi.SyncDescriptor(vN.LogServiceImpl,[[o||new vN.ConsoleLog(void 0,vN.LogLevel.Trace)]])),s.define(Pwc.IGitExtensionService,new gi.SyncDescriptor(sQi.NullGitExtensionService)),s.define(d4r.ILanguageContextProviderService,new gi.SyncDescriptor(aQi.NullLanguageContextProviderService)),s.define(cQi.ILanguageDiagnosticsService,t.languageDiagnosticsService||new gi.SyncDescriptor(lQi.TestLanguageDiagnosticsService)),s.define(e3e.IIgnoreService,new gi.SyncDescriptor(e3e.NullIgnoreService)),s.define(eQi.ISnippyService,new gi.SyncDescriptor(eQi.NullSnippyService)),s.define(wwc.IDomainService,new gi.SyncDescriptor(Rwc.DomainService)),s.define(l4r.ICAPIClientService,new gi.SyncDescriptor(oQi.CAPIClientImpl)),s.define(K7i.ICopilotTokenStore,new gi.SyncDescriptor(K7i.CopilotTokenStore)),s.define(tie.IEnvService,new gi.SyncDescriptor(kwc.NullEnvService)),s.define(f4r.IFetcherService,new gi.SyncDescriptor(a1t,[e])),s.define(fQi.ITelemetryService,new gi.SyncDescriptor(c1t,[n])),s.define(c4r.IAuthenticationService,new gi.SyncDescriptor(Ewc.StaticGitHubAuthenticationService,[(0,_wc.createStaticGitHubTokenProvider)()])),s.define(ywc.ICopilotTokenManager,r),s.define(z7i.IPowerService,new gi.SyncDescriptor(z7i.NullPowerService)),s.define(vwc.IChatMLFetcher,new gi.SyncDescriptor(gwc.ChatMLFetcherImpl)),s.define(Z7i.IChatWebSocketManager,new gi.SyncDescriptor(Z7i.NullChatWebSocketManager)),s.define(jwc.IOTelService,new Qwc.NoopOTelService((0,qwc.resolveOTelConfig)({env:{},extensionVersion:"0.0.0",sessionId:"chatlib"}))),s.define(Cwc.IChatQuotaService,new gi.SyncDescriptor(bwc.ChatQuotaService)),s.define(J7i.IInteractionService,new gi.SyncDescriptor(J7i.InteractionService)),s.define(uQi.IRequestLogger,new gi.SyncDescriptor(dQi.NullRequestLogger)),s.define(nQi.ITokenizerProvider,t.tokenizerProvider??new gi.SyncDescriptor(nQi.TokenizerProvider,[!1])),s.define(Swc.IConversationOptions,{_serviceBrand:void 0,maxResponseTokens:void 0,temperature:.1,topP:1,rejectionMessage:"Sorry, but I can only assist with programming related questions."}),s.define(Hwc.IProxyModelsService,new gi.SyncDescriptor(Gwc.ProxyModelsService)),s.define(X5r.IInlineEditsModelService,new gi.SyncDescriptor(Bwc.InlineEditsModelService)),s.define(X5r.IUndesiredModelsManager,t.undesiredModelsManager||new gi.SyncDescriptor(X5r.NullUndesiredModelsManager)),s.define(rQi.ITerminalService,t.terminalService||new gi.SyncDescriptor(rQi.NullTerminalService)),s.define(Y7i.ISimilarFilesContextService,new gi.SyncDescriptor(Y7i.NullSimilarFilesContextService)),s.define(u4r.IEndpointProvider,new i4r);let c=new $v.InMemoryConfigProvider(new $v.DefaultsOnlyConfigProvider);return t.configOverrides&&c.setOverrides(t.configOverrides),s.define($v.ICompletionsConfigProvider,c),s.seal()}a(Ywc,"setupServices");var s1t=class extends Twc.DefaultsOnlyConfigurationService{static{a(this,"OverridableConfigurationService")}constructor(e){super(),this._overrides=e}async setConfig(e,r,n){if(this._overrides.get(e.id)===r)return;r===void 0?this._overrides.delete(e.id):this._overrides.set(e.id,r);let s=e.fullyQualifiedId;this._onDidChangeConfiguration.fire({affectsConfiguration:a(c=>s===c||s.startsWith(c+".")||c.startsWith(s+"."),"affectsConfiguration")})}getConfig(e){if(this._overrides.has(e.id)){let r=this._overrides.get(e.id);if(e.validator){let n=e.validator.validate(r);return n.error?super.getConfig(e):n.content}return r}return super.getConfig(e)}getExperimentBasedConfig(e,r){if(this._overrides.has(e.id)){let n=this._overrides.get(e.id);if(e.validator){let o=e.validator.validate(n);return o.error?super.getExperimentBasedConfig(e,r):o.content}return n}return super.getExperimentBasedConfig(e,r)}inspectConfig(e){if(this._overrides.has(e.id)){let r=this._overrides.get(e.id);if(e.validator){let n=e.validator.validate(r);return n.error?super.inspectConfig(e):{defaultValue:n.content}}return{defaultValue:r}}return super.inspectConfig(e)}},i4r=class{static{a(this,"NullEndpointProvider")}constructor(){this.onDidModelsRefresh=t3e.Event.None}async getAllCompletionModels(){return[]}async getAllChatEndpoints(){return[]}async getChatEndpoint(){throw new Error("not implemented")}async getEmbeddingsEndpoint(){throw new Error("not implemented")}},nie=class extends l1t.Disposable{static{a(this,"SimpleExperimentationService")}constructor(e,r){if(super(),this._configurationService=r,this.variables={},this._onDidTreatmentsChange=this._register(new t3e.Emitter),this.onDidTreatmentsChange=this._onDidTreatmentsChange.event,e){let n;this.waitFor=new Promise(o=>{n=o}),this.resolveWaitFor=n}else this.waitFor=Promise.resolve(),this.resolveWaitFor=()=>{}}async hasTreatments(){return this.waitFor}getTreatmentVariable(e){return this.variables[e]}async setCompletionsFilters(e){}updateTreatmentVariables(e){let r=[];for(let[n,o]of Object.entries(e))this.variables[n]!==o&&(this.variables[n]=o,r.push(n));for(let n of Object.keys(this.variables))Object.hasOwn(e,n)||(delete this.variables[n],r.push(n));r.length>0&&(this._onDidTreatmentsChange.fire({affectedTreatmentVariables:r}),this._configurationService.updateExperimentBasedConfiguration(r)),this.resolveWaitFor()}};eu.SimpleExperimentationService=nie;eu.SimpleExperimentationService=nie=a4r([_N(1,PL.IConfigurationService)],nie);var a1t=class{static{a(this,"SingleFetcherService")}constructor(e){this._fetcher=e,this.onDidFetch=t3e.Event.None,this.onDidCompleteFetch=t3e.Event.None}fetchWithPagination(e,r){return this._fetcher.fetchWithPagination(e,r)}getUserAgentLibrary(){return this._fetcher.getUserAgentLibrary()}fetch(e,r){return this._fetcher.fetch(e,r)}createWebSocket(e,r){return{webSocket:new WebSocket(e,r),responseHeaders:new f4r.HeadersImpl({}),responseStatusCode:void 0,responseStatusText:void 0,networkError:void 0}}disconnectAll(){return this._fetcher.disconnectAll()}makeAbortController(){return this._fetcher.makeAbortController()}isAbortError(e){return this._fetcher.isAbortError(e)}isInternetDisconnectedError(e){return this._fetcher.isInternetDisconnectedError(e)}isFetcherError(e){return this._fetcher.isFetcherError(e)}isNetworkProcessCrashedError(e){return this._fetcher.isNetworkProcessCrashedError(e)}getUserMessageForFetcherError(e){return this._fetcher.getUserMessageForFetcherError(e)}},c1t=class{static{a(this,"SimpleTelemetryService")}constructor(e){this._telemetrySender=e}dispose(){}sendInternalMSFTTelemetryEvent(e,r,n){}sendMSFTTelemetryEvent(e,r,n){}sendMSFTTelemetryErrorEvent(e,r,n){}sendGHTelemetryEvent(e,r,n){this._telemetrySender.sendTelemetryEvent(e,(0,tQi.eventPropertiesToSimpleObject)(r),n)}sendGHTelemetryErrorEvent(e,r,n){}sendGHTelemetryException(e,r){}sendTelemetryEvent(e,r,n,o){}sendTelemetryErrorEvent(e,r,n,o){}setSharedProperty(e,r){}setAdditionalExpAssignments(e){}postEvent(e,r){}sendEnhancedGHTelemetryEvent(e,r,n){this._telemetrySender.sendEnhancedTelemetryEvent&&this._telemetrySender.sendEnhancedTelemetryEvent(e,(0,tQi.eventPropertiesToSimpleObject)(r),n)}sendEnhancedGHTelemetryErrorEvent(e,r,n){}};function Kwc(t){return t.tokenizerProvider&&(0,iQi.setExternalTokenizerProvider)(t.tokenizerProvider),Jwc(t).createInstance(o4r)}a(Kwc,"createInlineCompletionsProvider");var o4r=class extends l1t.Disposable{static{a(this,"InlineCompletionsProvider")}constructor(e,r,n,o,s,c){super(),this._insta=e,this._expService=r,this._speculativeRequestCache=n,this._logService=o,this._configurationService=s,this._completionsConfigProvider=c,this._register(e),this.ghostText=this._insta.createInstance(cwc.GhostText)}updateTreatmentVariables(e){this._expService instanceof nie&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=PL.globalConfigRegistry.configs.get(`${PL.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}this._completionsConfigProvider instanceof $v.InMemoryConfigProvider&&this._completionsConfigProvider.setCopilotSettings(Object.fromEntries(e))}async getInlineCompletions(e,r,n,o){let s=new t4r.LlmNESTelemetryBuilder(void 0,void 0,void 0,"ghostText",void 0);return await this.ghostText.getInlineCompletions(e,r,n??Vwc.CancellationToken.None,o,new rwc.GhostTextLogContext(e.uri,e.version,void 0),s,this._logService)}async inlineCompletionShown(e){return await this._speculativeRequestCache.request(e)}};o4r=a4r([_N(0,hQi.IInstantiationService),_N(1,r3e.IExperimentationService),_N(2,e4r.ICompletionsSpeculativeRequestCache),_N(3,vN.ILogService),_N(4,PL.IConfigurationService),_N(5,$v.ICompletionsConfigProvider)],o4r);var s4r=class{static{a(this,"UnwrappingTelemetrySender")}constructor(e){this.sender=e}sendTelemetryEvent(e,r,n){this.sender.sendTelemetryEvent(this.normalizeEventName(e),r,n)}sendEnhancedTelemetryEvent(e,r,n){this.sender.sendEnhancedTelemetryEvent&&this.sender.sendEnhancedTelemetryEvent(this.normalizeEventName(e),r,n)}normalizeEventName(e){let r=(0,$wc.unwrapEventNameFromPrefix)(e),n=r.match(/^[^/]+\/(.*)/);return n?n[1]:r}};function Jwc(t){let{fetcher:e,authService:r,statusHandler:n,documentManager:o,workspace:s,telemetrySender:c,urlOpener:l,editorSession:u}=t,d=t.logTarget||new vN.ConsoleLog(void 0,vN.LogLevel.Trace),f=new pQi.InstantiationServiceBuilder;f.define(ZBe.ICompletionsLogTargetService,new class{logIt(m,g,...A){d.logIt(this.toExternalLogLevel(m),g,...A)}toExternalLogLevel(m){switch(m){case ZBe.LogLevel.DEBUG:return rie.Debug;case ZBe.LogLevel.INFO:return rie.Info;case ZBe.LogLevel.WARN:return rie.Warning;case ZBe.LogLevel.ERROR:return rie.Error;default:return rie.Info}}}),f.define(c4r.IAuthenticationService,r),f.define(vN.ILogService,new gi.SyncDescriptor(vN.LogServiceImpl,[[d||new vN.ConsoleLog(void 0,vN.LogLevel.Trace)]])),f.define(e3e.IIgnoreService,t.ignoreService||new e3e.NullIgnoreService),f.define(fQi.ITelemetryService,new gi.SyncDescriptor(c1t,[new s4r(c)])),f.define(PL.IConfigurationService,new gi.SyncDescriptor(s1t,[t.configOverrides??new Map])),f.define(r3e.IExperimentationService,new gi.SyncDescriptor(nie,[t.waitForTreatmentVariables])),f.define(u4r.IEndpointProvider,t.endpointProvider),f.define(l4r.ICAPIClientService,t.capiClientService||new gi.SyncDescriptor(oQi.CAPIClientImpl)),f.define(f4r.IFetcherService,new gi.SyncDescriptor(a1t,[e])),f.define(I7i.ICompletionsTelemetryService,new gi.SyncDescriptor(I7i.CompletionsTelemetryServiceBridge)),f.define(W7i.ICompletionsRuntimeModeService,W7i.RuntimeMode.fromEnvironment(t.isRunningInTest??!1)),f.define(N7i.ICompletionsCacheService,new N7i.CompletionsCache);let h=new $v.InMemoryConfigProvider(new $v.DefaultsOnlyConfigProvider);return t.configOverrides&&h.setOverrides(t.configOverrides),f.define($v.ICompletionsConfigProvider,h),f.define(L7i.ICompletionsLastGhostText,new L7i.LastGhostText),f.define(O7i.ICompletionsCurrentGhostText,new O7i.CurrentGhostText),f.define(e4r.ICompletionsSpeculativeRequestCache,new e4r.SpeculativeRequestCache),f.define(dwc.ICompletionsNotificationSender,new class{async showWarningMessage(m,...g){return await t.notificationSender.showWarningMessage(m,...g)}}),f.define($v.ICompletionsEditorAndPluginInfo,new class{getEditorInfo(){return t.editorInfo}getEditorPluginInfo(){return t.editorPluginInfo}getRelatedPluginInfo(){return t.relatedPluginInfo}}),f.define(x7i.ICompletionsExtensionStatus,new x7i.CopilotExtensionStatus),f.define(swc.ICompletionsFeaturesService,new gi.SyncDescriptor(owc.Features)),f.define(iwc.ICompletionsObservableWorkspace,new class{get openDocuments(){return s.openDocuments}getWorkspaceRoot(m){return s.getWorkspaceRoot(m)}getFirstOpenDocument(){return s.getFirstOpenDocument()}getDocument(m){return s.getDocument(m)}}),f.define(U7i.ICompletionsStatusReporter,new class extends U7i.StatusReporter{didChange(m){n.didChange(m)}}),f.define(w7i.ICompletionsCopilotTokenManager,new gi.SyncDescriptor(w7i.CopilotTokenManagerImpl,[!1])),f.define($7i.ICompletionsTextDocumentManagerService,new gi.SyncDescriptor(class extends $7i.TextDocumentManager{constructor(){super(...arguments),this.onDidChangeTextDocument=o.onDidChangeTextDocument,this.onDidOpenTextDocument=o.onDidOpenTextDocument,this.onDidCloseTextDocument=o.onDidCloseTextDocument,this.onDidFocusTextDocument=o.onDidFocusTextDocument,this.onDidChangeWorkspaceFolders=o.onDidChangeWorkspaceFolders}getTextDocumentsUnsafe(){return o.getTextDocumentsUnsafe()}findNotebook(m){return o.findNotebook(m)}getWorkspaceFolders(){return o.getWorkspaceFolders()}})),f.define(P7i.ICompletionsFileReaderService,new gi.SyncDescriptor(P7i.FileReader)),f.define(M7i.ICompletionsBlockModeConfig,new gi.SyncDescriptor(M7i.ConfigBlockModeConfig)),f.define(G7i.ICompletionsTelemetryUserConfigService,new gi.SyncDescriptor(G7i.TelemetryUserConfig)),f.define(H7i.ICompletionsRecentEditsProviderService,new gi.SyncDescriptor(H7i.FullRecentEditsProvider,[void 0])),f.define(R7i.ICompletionsNotifierService,new gi.SyncDescriptor(R7i.CompletionNotifier)),f.define(B7i.ICompletionsOpenAIFetcherService,new gi.SyncDescriptor(B7i.LiveOpenAIFetcher)),f.define(Fwc.ICompletionsFetchService,new gi.SyncDescriptor(Uwc.CompletionsFetchService)),f.define(F7i.ICompletionsModelManagerService,new gi.SyncDescriptor(F7i.AvailableModelsManager,[!0])),f.define(D7i.ICompletionsAsyncManagerService,new gi.SyncDescriptor(D7i.AsyncCompletionManager)),f.define(q7i.ICompletionsContextProviderBridgeService,new gi.SyncDescriptor(q7i.ContextProviderBridge)),f.define(k7i.ICompletionsUserErrorNotifierService,new gi.SyncDescriptor(k7i.UserErrorNotifier)),f.define(pwc.ICompletionsRelatedFilesProviderService,new gi.SyncDescriptor(fwc.CompositeRelatedFilesProvider)),f.define(awc.ICompletionsFileSystemService,new lwc.LocalFileSystem),f.define(XBe.ICompletionsContextProviderRegistryService,new gi.SyncDescriptor(XBe.CachedContextProviderRegistry,[XBe.CoreContextProviderRegistry,(m,g,A)=>t.contextProviderMatch(g,A)])),f.define(V7i.ICompletionsPromiseQueueService,new V7i.PromiseQueue),f.define(nwc.ICompletionsCitationManager,new class{register(){return l1t.Disposable.None}async handleIPCodeCitation(m){if(t.citationHandler)return await t.citationHandler.handleIPCodeCitation(m)}}),f.define(j7i.ICompletionsContextProviderService,new j7i.ContextProviderStatistics),f.define(Q7i.ICompletionsPromptFactoryService,new gi.SyncDescriptor(Q7i.CompletionsPromptFactory)),f.define(uwc.ICompletionsFetcherService,new class{getImplementation(){return this}fetch(m,g){return e.fetch(m,g)}disconnectAll(){return e.disconnectAll()}}),f.define(XBe.ICompletionsDefaultContextProviders,new XBe.DefaultContextProvidersContainer),f.define(tie.IEnvService,new class{constructor(){this.language=void 0,this.sessionId=u.sessionId,this.machineId=u.machineId,this.devDeviceId=u.machineId,this.vscodeVersion=t.editorInfo.version,this.isActive=!0,this.onDidChangeWindowState=t3e.Event.None,this.remoteName=u.remoteName,this.uiKind=u.uiKind==="web"?"web":"desktop",this.OS=process.platform==="darwin"?tie.OperatingSystem.Macintosh:process.platform==="win32"?tie.OperatingSystem.Windows:tie.OperatingSystem.Linux,this.uriScheme="",this.extensionId=t.editorPluginInfo.name,this.appRoot=t.editorInfo.root??"",this.shell=""}isProduction(){return $v.BuildInfo.isProduction()}isPreRelease(){return $v.BuildInfo.isPreRelease()}isSimulation(){return t.isRunningInTest===!0}getBuildType(){return $v.BuildInfo.getBuildType()===$v.BuildType.DEV?"dev":"prod"}getVersion(){return $v.BuildInfo.getVersion()}getBuild(){return $v.BuildInfo.getBuild()}getName(){return t.editorInfo.name}getEditorInfo(){return new tie.NameAndVersion(t.editorInfo.name,t.editorInfo.version)}getEditorPluginInfo(){return new tie.NameAndVersion(t.editorPluginInfo.name,t.editorPluginInfo.version)}async openExternal(m){return await l.open(m.toString()),!0}}),f.define(d4r.ILanguageContextProviderService,t.languageContextProvider??new aQi.NullLanguageContextProviderService),f.define(cQi.ILanguageDiagnosticsService,t.languageDiagnosticsService||new gi.SyncDescriptor(lQi.TestLanguageDiagnosticsService)),f.define(uQi.IRequestLogger,new gi.SyncDescriptor(dQi.NullRequestLogger)),f.seal()}a(Jwc,"setupCompletionServices")});function qt(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r}function xe(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}var C1=ve(()=>{p();a(qt,"__classPrivateFieldSet");a(xe,"__classPrivateFieldGet")});var vEe,D1t=ve(()=>{p();vEe=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return vEe=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))},"uuid4")});function v9(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var u3e,CEe=ve(()=>{p();a(v9,"isAbortError");u3e=a(t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)},"castToError")});var fr,Ch,Ty,TV,bEe,SEe,TEe,IEe,xEe,wEe,REe,kEe,PEe,Bf=ve(()=>{p();CEe();fr=class extends Error{static{a(this,"AnthropicError")}},Ch=class t extends fr{static{a(this,"APIError")}constructor(e,r,n,o,s){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=o,this.requestID=o?.get("request-id"),this.error=r,this.type=s??null}static makeMessage(e,r,n){let o=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&o?`${e} ${o}`:e?`${e} status code (no body)`:o||"(no status code or body)"}static generate(e,r,n,o){if(!e||!o)return new TV({message:n,cause:u3e(r)});let s=r,c=s?.error?.type;return e===400?new SEe(e,s,n,o,c):e===401?new TEe(e,s,n,o,c):e===403?new IEe(e,s,n,o,c):e===404?new xEe(e,s,n,o,c):e===409?new wEe(e,s,n,o,c):e===422?new REe(e,s,n,o,c):e===429?new kEe(e,s,n,o,c):e>=500?new PEe(e,s,n,o,c):new t(e,s,n,o,c)}},Ty=class extends Ch{static{a(this,"APIUserAbortError")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},TV=class extends Ch{static{a(this,"APIConnectionError")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},bEe=class extends TV{static{a(this,"APIConnectionTimeoutError")}constructor({message:e}={}){super({message:e??"Request timed out."})}},SEe=class extends Ch{static{a(this,"BadRequestError")}},TEe=class extends Ch{static{a(this,"AuthenticationError")}},IEe=class extends Ch{static{a(this,"PermissionDeniedError")}},xEe=class extends Ch{static{a(this,"NotFoundError")}},wEe=class extends Ch{static{a(this,"ConflictError")}},REe=class extends Ch{static{a(this,"UnprocessableEntityError")}},kEe=class extends Ch{static{a(this,"RateLimitError")}},PEe=class extends Ch{static{a(this,"InternalServerError")}}});function N1t(t){return typeof t!="object"?{}:t??{}}function X4r(t){if(!t)return!0;for(let e in t)return!1;return!0}function zqi(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var WPc,Wqi,t_,Z4r,Yqi,M1t,NL=ve(()=>{p();Bf();WPc=/^[a-z][a-z0-9+.-]*:/i,Wqi=a(t=>WPc.test(t),"isAbsoluteURL"),t_=a(t=>(t_=Array.isArray,t_(t)),"isArray"),Z4r=t_;a(N1t,"maybeObj");a(X4r,"isEmptyObj");a(zqi,"hasOwn");Yqi=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new fr(`${t} must be an integer`);if(e<0)throw new fr(`${t} must be a positive integer`);return e},"validatePositiveInteger"),M1t=a(t=>{try{return JSON.parse(t)}catch{return}},"safeJSON")});var TN,DEe=ve(()=>{p();TN=a((t,e)=>new Promise(r=>{if(e?.aborted)return r();let n=a(()=>{clearTimeout(o),r()},"onAbort"),o=setTimeout(()=>{e?.removeEventListener("abort",n),r()},t);e?.addEventListener("abort",n,{once:!0})}),"sleep")});var ek,d3e=ve(()=>{p();ek="0.98.0"});function zPc(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function KPc(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let o=n[1]||0,s=n[2]||0,c=n[3]||0;return{browser:e,version:`${o}.${s}.${c}`}}}return null}var Xqi,YPc,Kqi,Jqi,Zqi,f3e,O1t=ve(()=>{p();d3e();Xqi=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","isRunningInBrowser");a(zPc,"getDetectedPlatform");YPc=a(()=>{let t=zPc();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ek,"X-Stainless-OS":Jqi(Deno.build.os),"X-Stainless-Arch":Kqi(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ek,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ek,"X-Stainless-OS":Jqi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Kqi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=KPc();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ek,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ek,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"getPlatformProperties");a(KPc,"getBrowserInfo");Kqi=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","normalizeArch"),Jqi=a(t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),"normalizePlatform"),f3e=a(()=>Zqi??(Zqi=YPc()),"getPlatformHeaders")});function eji(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function eLr(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function L1t(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return eLr({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function p3e(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function tji(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}var NEe=ve(()=>{p();a(eji,"getDefaultFetch");a(eLr,"makeReadableStream");a(L1t,"ReadableStreamFrom");a(p3e,"ReadableStreamToAsyncIterable");a(tji,"CancelReadableStream")});var rji,nji=ve(()=>{p();rji=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"FallbackEncoder")});var tLr,rLr,nLr,iji,iLr=ve(()=>{p();tLr="RFC3986",rLr=a(t=>String(t),"default_formatter"),nLr={RFC1738:a(t=>String(t).replace(/%20/g,"+"),"RFC1738"),RFC3986:rLr},iji="RFC1738"});function sji(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function sLr(t,e){if(t_(t)){let r=[];for(let n=0;n{p();iLr();NL();B1t=a((t,e)=>(B1t=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),B1t(t,e)),"has"),ML=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),oLr=1024,oji=a((t,e,r,n,o)=>{if(t.length===0)return t;let s=t;if(typeof t=="symbol"?s=Symbol.prototype.toString.call(t):typeof t!="string"&&(s=String(t)),r==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});let c="";for(let l=0;l=oLr?s.slice(l,l+oLr):s,d=[];for(let f=0;f=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===iji&&(h===40||h===41)){d[d.length]=u.charAt(f);continue}if(h<128){d[d.length]=ML[h];continue}if(h<2048){d[d.length]=ML[192|h>>6]+ML[128|h&63];continue}if(h<55296||h>=57344){d[d.length]=ML[224|h>>12]+ML[128|h>>6&63]+ML[128|h&63];continue}f+=1,h=65536+((h&1023)<<10|u.charCodeAt(f)&1023),d[d.length]=ML[240|h>>18]+ML[128|h>>12&63]+ML[128|h>>6&63]+ML[128|h&63]}c+=d.join("")}return c},"encode");a(sji,"is_buffer");a(sLr,"maybe_map")});function XPc(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function dji(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_){let v=t,b=_,T=0,w=!1;for(;(b=b.get(aLr))!==void 0&&!w;){let N=b.get(t);if(T+=1,typeof N<"u"){if(N===T)throw new RangeError("Cyclic object value");w=!0}typeof b.get(aLr)>"u"&&(T=0)}if(typeof d=="function"?v=d(e,v):v instanceof Date?v=m?.(v):r==="comma"&&t_(v)&&(v=sLr(v,function(N){return N instanceof Date?m?.(N):N})),v===null){if(s)return u&&!y?u(e,L0.encoder,E,"key",g):e;v=""}if(XPc(v)||sji(v)){if(u){let N=y?e:u(e,L0.encoder,E,"key",g);return[A?.(N)+"="+A?.(u(v,L0.encoder,E,"value",g))]}return[A?.(e)+"="+A?.(String(v))]}let R=[];if(typeof v>"u")return R;let x;if(r==="comma"&&t_(v))y&&u&&(v=sLr(v,u)),x=[{value:v.length>0?v.join(",")||null:void 0}];else if(t_(d))x=d;else{let N=Object.keys(v);x=f?N.sort(f):N}let P=l?String(e).replace(/\./g,"%2E"):String(e),D=n&&t_(v)&&v.length===1?P+"[]":P;if(o&&t_(v)&&v.length===0)return D+"[]";for(let N=0;N"u"?t.encodeDotInKeys?!0:L0.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:L0.addQueryPrefix,allowDots:c,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:L0.allowEmptyArrays,arrayFormat:s,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:L0.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?L0.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:L0.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:L0.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:L0.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:L0.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:L0.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:L0.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:L0.strictNullHandling}}function fji(t,e={}){let r=t,n=e2c(e),o,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):t_(n.filter)&&(s=n.filter,o=s);let c=[];if(typeof r!="object"||r===null)return"";let l=lji[n.arrayFormat],u=l==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);let d=new WeakMap;for(let m=0;m0?h+f:""}var lji,uji,cji,L0,aLr,pji=ve(()=>{p();aji();iLr();NL();lji={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},uji=a(function(t,e){Array.prototype.push.apply(t,t_(e)?e:[e])},"push_to_array"),L0={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:oji,encodeValuesOnly:!1,format:tLr,formatter:rLr,indices:!1,serializeDate(t){return(cji??(cji=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};a(XPc,"is_non_nullish_primitive");aLr={};a(dji,"inner_stringify");a(e2c,"normalize_stringify_options");a(fji,"stringify")});function hji(t){return fji(t,{arrayFormat:"brackets"})}var cLr=ve(()=>{p();pji();a(hji,"stringifyQuery")});function U1t(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new Wc(`Invalid token endpoint base URL "${t}": ${n}`)}if(e.protocol==="https:")return;let r=e.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(e.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1")))throw new Wc(`Refusing to send credential over non-https token endpoint "${t}"`)}async function Q1t(t,e){let r=await n2c(t),n;try{n=JSON.parse(r)}catch{throw new Wc(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,b1(r),e)}if(!n.access_token)throw new Wc(`Token endpoint response missing access_token: ${JSON.stringify(b1(n))}`,t.status,b1(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new Wc(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,b1(n),e);return n}function b1(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=lLr?t:t.slice(0,lLr)+`... <${t.length-lLr} more chars>`}return JSON.stringify(b1(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))r2c.has(r)&&(e[r]=n);return e}return null}async function q1t(t,e=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),n=t,o;try{n=await r.promises.realpath(t),o=await r.promises.stat(n)}catch{return}let s=o.mode&511;if(s&18)throw new Wc(`Credentials file at ${n} is group/world-writable (mode 0o${s.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(s&36)throw new Wc(`Credentials file at ${n} is group/world-readable (mode 0o${s.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);typeof process.getuid=="function"&&o.uid!==process.getuid()&&e(`credentials file at ${n} is owned by uid ${o.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function j1t(t,e){let r=await import("node:fs"),o=(await import("node:path")).dirname(t);await r.promises.mkdir(o,{recursive:!0,mode:448});let s=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let c=await r.promises.open(s,"w",384);try{await c.writeFile(JSON.stringify(e,null,2)),await c.sync()}finally{await c.close()}await r.promises.rename(s,t)}catch(c){throw await r.promises.unlink(s).catch(()=>{}),c}try{let c=await r.promises.open(o,"r");try{await c.sync()}finally{await c.close()}}catch{}}async function n2c(t){if(!t.body)return"";let e=t.body.getReader(),r=[],n=0;for(;;){let{done:s,value:c}=await e.read();if(s)break;if(n+c.length>mji){let l=mji-n;l>0&&r.push(c.subarray(0,l)),await e.cancel();break}r.push(c),n+=c.length}let o;if(r.length===1)o=r[0];else{o=new Uint8Array(r.reduce((c,l)=>c+l.length,0));let s=0;for(let c of r)o.set(c,s),s+=c.length}return new TextDecoder("utf-8").decode(o)}var gji,Aji,F1t,lie,yji,Eji,MEe,_ji,mji,lLr,r2c,Wc,OEe=ve(()=>{p();Bf();gji="urn:ietf:params:oauth:grant-type:jwt-bearer",Aji="refresh_token",F1t="/v1/oauth/token",lie="oauth-2025-04-20",yji="oidc-federation-2026-04-01",Eji=120,MEe=30,_ji=5,mji=1<<20;a(U1t,"requireSecureTokenEndpoint");a(Q1t,"parseTokenResponse");lLr=2e3,r2c=new Set(["error","error_description","error_uri"]);a(b1,"redactSensitive");a(q1t,"checkCredentialsFileSafety");a(j1t,"writeCredentialsFileAtomic");a(n2c,"readLimitedText");Wc=class extends fr{static{a(this,"WorkloadIdentityError")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}}});function IN(){return Math.floor(Date.now()/1e3)}var h3e=ve(()=>{p();a(IN,"nowAsSeconds")});var H1t,vji=ve(()=>{p();OEe();h3e();H1t=class{static{a(this,"TokenCache")}constructor(e,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=r}async getToken(){let e=this.nextForce;this.nextForce=!1;let r=this.cached;if(e||r==null)return(await this.refresh(e)).token;if(r.expiresAt==null)return r.token;let n=r.expiresAt-IN();return n>Eji?r.token:n>MEe?(this.backgroundRefresh(),r.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||IN()-this.lastAdvisoryError<_ji||this.doRefresh().catch(e=>{this.lastAdvisoryError=IN(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(r=>(this.cached=r,this.pendingRefresh=null,r),r=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}}});var _a,m3e=ve(()=>{p();_a=a(t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0},"readEnv")});function Sji(t){let e=0;for(let o of t)e+=o.length;let r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function LEe(t){let e;return(Cji??(e=new globalThis.TextEncoder,Cji=e.encode.bind(e)))(t)}function uLr(t){let e;return(bji??(e=new globalThis.TextDecoder,bji=e.decode.bind(e)))(t)}var Cji,bji,G1t=ve(()=>{p();a(Sji,"concatBytes");a(LEe,"encodeUTF8");a(uLr,"decodeUTF8")});var Tji=ve(()=>{p();Bf();G1t()});function g3e(){}function $1t(t,e,r){return!e||V1t[t]>V1t[r]?g3e:e[t].bind(e)}function gl(t){let e=t.logger,r=t.logLevel??"off";if(!e)return i2c;let n=Iji.get(e);if(n&&n[0]===r)return n[1];let o={error:$1t("error",e,r),warn:$1t("warn",e,r),info:$1t("info",e,r),debug:$1t("debug",e,r)};return Iji.set(e,[r,o]),o}var V1t,dLr,i2c,Iji,C9,b9=ve(()=>{p();NL();V1t={off:0,error:200,warn:300,info:400,debug:500},dLr=a((t,e,r)=>{if(t){if(zqi(V1t,t))return t;gl(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(V1t))}`)}},"parseLogLevel");a(g3e,"noop");a($1t,"makeLogFn");i2c={error:g3e,warn:g3e,info:g3e,debug:g3e},Iji=new WeakMap;a(gl,"loggerFor");C9=a(t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="api-key"||e.toLowerCase()==="x-api-key"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t),"formatRequestDetails")});var fLr=ve(()=>{p();NL();Tji();m3e();b9();D1t();DEe();cLr()});function xji(t){if(!t)throw new Error("profile name is empty");if(t==="."||t==="..")throw new Error(`profile name "${t}" is not allowed`);if(t.includes("/")||t.includes("\\"))throw new Error(`profile name "${t}" must not contain path separators`);if(!o2c.test(t))throw new Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var W1t,o2c,wji,Rji,pLr,s2c,kji,hLr=ve(()=>{p();O1t();fLr();W1t="1.0",o2c=/^[A-Za-z0-9_.-]+$/;a(xji,"validateProfileName");wji=a(async t=>{var e,r;let n=await pLr();if(n===null)return null;let o=t??await kji();if(o===null)return null;xji(o);let s=await import("node:fs"),l=(await import("node:path")).join(n,"configs",`${o}.json`),u;try{u=await s.promises.readFile(l,"utf-8")}catch(h){if(h?.code!=="ENOENT")throw new Error(`failed to read config file ${l}: ${h}`);u=null}if(u===null){let h=_a("ANTHROPIC_ORGANIZATION_ID"),m=_a("ANTHROPIC_IDENTITY_TOKEN_FILE"),g=_a("ANTHROPIC_FEDERATION_RULE_ID");return g&&h?{fromFile:!1,config:{organization_id:h,workspace_id:_a("ANTHROPIC_WORKSPACE_ID"),base_url:_a("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:g,service_account_id:_a("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:m?{source:"file",path:m}:void 0,scope:_a("ANTHROPIC_SCOPE")}}}:null}let d;try{d=JSON.parse(u)}catch(h){throw new Error(`failed to parse config file ${l}: ${h}`)}if(!d.authentication)throw new Error(`config file ${l} is missing "authentication"`);let f=d.authentication.type;if(f!=="oidc_federation"&&f!=="user_oauth")throw new Error(`authentication.type "${f}" is not a known authentication type`);if(d.organization_id??(d.organization_id=_a("ANTHROPIC_ORGANIZATION_ID")),d.workspace_id??(d.workspace_id=_a("ANTHROPIC_WORKSPACE_ID")),d.base_url??(d.base_url=_a("ANTHROPIC_BASE_URL")),(e=d.authentication).scope??(e.scope=_a("ANTHROPIC_SCOPE")),d.authentication.type==="oidc_federation"){if(!d.authentication.identity_token){let h=_a("ANTHROPIC_IDENTITY_TOKEN_FILE");h&&(d.authentication.identity_token={source:"file",path:h})}d.authentication.federation_rule_id||(d.authentication.federation_rule_id=_a("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=d.authentication).service_account_id??(r.service_account_id=_a("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:d,fromFile:!0}},"loadConfigWithSource"),Rji=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await pLr();if(!r)return null;let n=e??await kji();return n?(xji(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"getCredentialsPath"),pLr=a(async()=>{if(!s2c())return null;let t=await import("node:path"),e=_a("ANTHROPIC_CONFIG_DIR");if(e)return e;if(f3e()["X-Stainless-OS"]==="Windows"){let s=_a("APPDATA");if(s)return t.join(s,"Anthropic");let c=_a("USERPROFILE");return c?t.join(c,"AppData","Roaming","Anthropic"):null}let n=_a("XDG_CONFIG_HOME");if(n)return t.join(n,"anthropic");let o=_a("HOME");return o?t.join(o,".config","anthropic"):null},"getRootConfigPath"),s2c=a(()=>{let t=f3e()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"supportsLocalConfigFiles"),kji=a(async()=>{let t=await pLr();if(!t)return null;let e=_a("ANTHROPIC_PROFILE");if(e)return e;let r=await import("node:fs"),o=(await import("node:path")).join(t,"active_config");try{return(await r.promises.readFile(o,"utf-8")).trim()||"default"}catch(s){if(s?.code!=="ENOENT")throw new Error(`failed to read ${o}: ${s}`);return"default"}},"getActiveProfileName")});function mLr(t){if(!t)throw new fr("Identity token file path is empty");return async()=>{let e=await import("node:fs"),r;try{r=await e.promises.readFile(t,"utf-8")}catch(o){throw new fr(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new fr(`Identity token file at ${t} is empty`);return n}}function Pji(t){if(!t)throw new fr("Identity token value is empty");return()=>t}var Dji=ve(()=>{p();Bf();a(mLr,"identityTokenFromFile");a(Pji,"identityTokenFromValue")});function Nji(t){return async()=>{U1t(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new Wc(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:gji,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(r.service_account_id=t.serviceAccountId),t.workspaceId&&(r.workspace_id=t.workspaceId);let n=`${t.baseURL}${F1t}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${lie},${yji}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${ek} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new Wc(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=b1(u),f="";throw o.status===401&&(f=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new Wc(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await Q1t(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new Wc(`Token endpoint response missing required fields: ${JSON.stringify(b1(c))}`,o.status,b1(c),s);return{token:c.access_token,expiresAt:IN()+l}}}var Mji=ve(()=>{p();OEe();h3e();d3e();a(Nji,"oidcFederationProvider")});function Oji(t){return async e=>{let r=await import("node:fs");await q1t(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new Wc(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new Wc(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new Wc(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||IN()"");throw new Wc(`User OAuth refresh failed (HTTP ${f.status}): ${b1(E)}`,f.status,b1(E),h)}let m=await Q1t(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new Wc(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(b1(m))}`,f.status,b1(m),h);let A=IN()+g,y=m.refresh_token||l;return await j1t(t.credentialsPath,{...o,version:W1t,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}var Lji=ve(()=>{p();hLr();OEe();h3e();d3e();a(Oji,"userOAuthProvider")});function gLr(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=a2c(t,r,n,e),s={};return t.workspace_id&&t.authentication.type==="user_oauth"&&(s["anthropic-workspace-id"]=t.workspace_id),{provider:o,extraHeaders:s,baseURL:t.base_url||void 0}}async function Bji(t,e){let r=await wji(e);if(!r)return null;let{config:n,fromFile:o}=r,s=n.authentication.credentials_path||!o?n:{...n,authentication:{...n.authentication,credentials_path:await Rji(n,e)??void 0}};return gLr(s,t)}function a2c(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=c2c(o);if(!s)throw new Wc("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!o.federation_rule_id)throw new Wc("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!t.organization_id)throw new Wc("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=Nji({identityTokenProvider:s,federationRuleId:o.federation_rule_id,organizationId:t.organization_id,serviceAccountId:o.service_account_id,workspaceId:t.workspace_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent});return e?l2c(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new Wc("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return Oji({credentialsPath:e,clientId:t.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let o=t.authentication.type;throw new Wc(`authentication.type "${o}" is not a known authentication type`)}}}function c2c(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new Wc(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new Wc('identity_token.source "file" requires a non-empty path');return mLr(t.identity_token.path)}let e=_a("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return mLr(e);let r=_a("ANTHROPIC_IDENTITY_TOKEN");return r?Pji(r):null}function l2c(t,e,r,n){return async o=>{let s=await import("node:fs");await q1t(e,n);let c;try{let u=await s.promises.readFile(e,"utf-8");c=JSON.parse(u);let d=c?.access_token;if(d&&!o?.forceRefresh){let f=c?.expires_at;if(f==null||IN(){p();m3e();hLr();OEe();h3e();Dji();Mji();Lji();a(gLr,"resolveCredentialsFromConfig");a(Bji,"defaultCredentials");a(a2c,"buildProvider");a(c2c,"resolveIdentityTokenProvider");a(l2c,"cachedExchangeProvider")});function u2c(t,e){for(let o=e??0;o{p();C1();G1t();S9=class{static{a(this,"LineDecoder")}constructor(){yI.set(this,void 0),EI.set(this,void 0),qt(this,yI,new Uint8Array,"f"),qt(this,EI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?LEe(e):e;qt(this,yI,Sji([xe(this,yI,"f"),r]),"f");let n=[],o;for(;(o=u2c(xe(this,yI,"f"),xe(this,EI,"f")))!=null;){if(o.carriage&&xe(this,EI,"f")==null){qt(this,EI,o.index,"f");continue}if(xe(this,EI,"f")!=null&&(o.index!==xe(this,EI,"f")+1||o.carriage)){n.push(uLr(xe(this,yI,"f").subarray(0,xe(this,EI,"f")-1))),qt(this,yI,xe(this,yI,"f").subarray(xe(this,EI,"f")),"f"),qt(this,EI,null,"f");continue}let s=xe(this,EI,"f")!==null?o.preceding-1:o.preceding,c=uLr(xe(this,yI,"f").subarray(0,s));n.push(c),qt(this,yI,xe(this,yI,"f").subarray(o.index),"f"),qt(this,EI,null,"f")}return n}flush(){return xe(this,yI,"f").length?this.decode(` -`):[]}};yI=new WeakMap,EI=new WeakMap;S9.NEWLINE_CHARS=new Set([` -`,"\r"]);S9.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(u2c,"findNewlineIndex");a(Uji,"findDoubleNewlineIndex")});async function*d2c(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new fr("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new fr("Attempted to iterate over a response with no body");let r=new yLr,n=new S9,o=p3e(t.body);for await(let s of f2c(o))for(let c of n.decode(s)){let l=r.decode(c);l&&(yield l)}for(let s of n.flush()){let c=r.decode(s);c&&(yield c)}}async function*f2c(t){let e=new Uint8Array;for await(let r of t){if(r==null)continue;let n=r instanceof ArrayBuffer?new Uint8Array(r):typeof r=="string"?LEe(r):r,o=new Uint8Array(e.length+n.length);o.set(e),o.set(n,e.length),e=o;let s;for(;(s=Uji(e))!==-1;)yield e.slice(0,s),e=e.slice(s)}e.length>0&&(yield e)}function p2c(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}var A3e,OL,yLr,ELr=ve(()=>{p();C1();Bf();NEe();ALr();NEe();CEe();NL();G1t();b9();Bf();OL=class t{static{a(this,"Stream")}constructor(e,r,n){this.iterator=e,A3e.set(this,void 0),this.controller=r,qt(this,A3e,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?gl(n):console;async function*c(){if(o)throw new fr("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of d2c(e,r)){if(u.event==="completion")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event==="message_start"||u.event==="message_delta"||u.event==="message_stop"||u.event==="content_block_start"||u.event==="content_block_delta"||u.event==="content_block_stop"||u.event==="message"||u.event==="user.message"||u.event==="user.interrupt"||u.event==="user.tool_confirmation"||u.event==="user.custom_tool_result"||u.event==="user.tool_result"||u.event==="agent.message"||u.event==="agent.thinking"||u.event==="agent.tool_use"||u.event==="agent.tool_result"||u.event==="agent.mcp_tool_use"||u.event==="agent.mcp_tool_result"||u.event==="agent.custom_tool_use"||u.event==="agent.thread_context_compacted"||u.event==="session.status_running"||u.event==="session.status_idle"||u.event==="session.status_rescheduled"||u.event==="session.status_terminated"||u.event==="session.error"||u.event==="session.deleted"||u.event==="session.updated"||u.event==="span.model_request_start"||u.event==="span.model_request_end"||u.event==="span.outcome_evaluation_start"||u.event==="span.outcome_evaluation_ongoing"||u.event==="span.outcome_evaluation_end"||u.event==="user.define_outcome"||u.event==="agent.thread_message_received"||u.event==="agent.thread_message_sent"||u.event==="agent.session_thread_message_received"||u.event==="agent.session_thread_message_sent"||u.event==="session.thread_created"||u.event==="session.thread_status_created"||u.event==="session.thread_status_running"||u.event==="session.thread_status_idle"||u.event==="session.thread_status_rescheduled"||u.event==="session.thread_status_terminated")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event!=="ping"&&u.event==="error"){let d=M1t(u.data)??u.data,f=d?.error?.type;throw new Ch(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(v9(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}static fromReadableStream(e,r,n){let o=!1;async function*s(){let l=new S9,u=p3e(e);for await(let d of u)for(let f of l.decode(d))yield f;for(let d of l.flush())yield d}a(s,"iterLines");async function*c(){if(o)throw new fr("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of s())l||u&&(yield JSON.parse(u));l=!0}catch(u){if(v9(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}[(A3e=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),o=a(s=>({next:a(()=>{if(s.length===0){let c=n.next();e.push(c),r.push(c)}return s.shift()},"next")}),"teeIterator");return[new t(()=>o(e),this.controller,xe(this,A3e,"f")),new t(()=>o(r),this.controller,xe(this,A3e,"f"))]}toReadableStream(){let e=this,r;return eLr({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:o,done:s}=await r.next();if(s)return n.close();let c=LEe(JSON.stringify(o)+` -`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(d2c,"_iterSSEMessages");a(f2c,"iterSSEChunks");yLr=class{static{a(this,"SSEDecoder")}constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let s={event:this.event,data:this.data.join(` -`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[r,n,o]=p2c(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(p2c,"partition")});async function z1t(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return gl(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):OL.fromSSEResponse(r,e.controller);if(r.status===204)return null;if(e.options.__binaryResponse)return r;let u=r.headers.get("content-type")?.split(";")[0]?.trim();if(u?.includes("application/json")||u?.endsWith("+json")){if(r.headers.get("content-length")==="0")return;let m=await r.json();return _Lr(m,r)}return await r.text()})();return gl(t).debug(`[${n}] response parsed`,C9({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function _Lr(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("request-id"),enumerable:!1})}var vLr=ve(()=>{p();ELr();b9();a(z1t,"defaultParseResponse");a(_Lr,"addRequestID")});var y3e,uie,Y1t=ve(()=>{p();C1();vLr();uie=class t extends Promise{static{a(this,"APIPromise")}constructor(e,r,n=z1t){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,y3e.set(this,void 0),qt(this,y3e,e,"f")}_thenUnwrap(e){return new t(xe(this,y3e,"f"),this.responsePromise,async(r,n)=>_Lr(e(await this.parseResponse(r,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:r,request_id:r.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(xe(this,y3e,"f"),e))),this.parsedPromise}then(e,r){return this.parse().then(e,r)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};y3e=new WeakMap});var K1t,J1t,E3e,tk,va,_d=ve(()=>{p();C1();Bf();vLr();Y1t();NL();J1t=class{static{a(this,"AbstractPage")}constructor(e,r,n,o){K1t.set(this,void 0),qt(this,K1t,e,"f"),this.options=o,this.response=r,this.body=n}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new fr("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await xe(this,K1t,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(K1t=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},E3e=class extends uie{static{a(this,"PagePromise")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await z1t(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},tk=class extends J1t{static{a(this,"Page")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let r=this.first_id;return r?{...this.options,query:{...N1t(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...N1t(this.options.query),after_id:e}}:null}},va=class extends J1t{static{a(this,"PageCursor")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.next_page=n.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{...N1t(this.options.query),page:e}}:null}}});function die(t,e,r){return bLr(),new File(t,e??"unknown_file",r)}function _3e(t,e){let r=typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"";return e?r.split(/[\\/]/).pop()||void 0:r}function m2c(t){let e=typeof t=="function"?t:t.fetch,r=Qji.get(e);if(r)return r;let n=(async()=>{try{let o="Response"in e?e.Response:(await e("data:,")).constructor,s=new FormData;return s.toString()!==await new o(s).text()}catch{return!0}})();return Qji.set(e,n),n}var bLr,SLr,BEe,Qji,g2c,A2c,CLr,FEe=ve(()=>{p();NEe();bLr=a(()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},"checkFileSupport");a(die,"makeFile");a(_3e,"getName");SLr=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","isAsyncIterable"),BEe=a(async(t,e,r=!0)=>({...t,body:await g2c(t.body,e,r)}),"multipartFormRequestOptions"),Qji=new WeakMap;a(m2c,"supportsFormData");g2c=a(async(t,e,r=!0)=>{if(!await m2c(e))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(t||{}).map(([o,s])=>CLr(n,o,s,r))),n},"createForm"),A2c=a(t=>t instanceof Blob&&"name"in t,"isNamedBlob"),CLr=a(async(t,e,r,n)=>{if(r!==void 0){if(r==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")t.append(e,String(r));else if(r instanceof Response){let o={},s=r.headers.get("Content-Type");s&&(o={type:s}),t.append(e,die([await r.blob()],_3e(r,n),o))}else if(SLr(r))t.append(e,die([await new Response(L1t(r)).blob()],_3e(r,n)));else if(A2c(r))t.append(e,die([r],_3e(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>CLr(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>CLr(t,`${e}[${o}]`,s,n)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}},"addFormValue")});async function Z1t(t,e,r){if(bLr(),t=await t,e||(e=_3e(t,!0)),y2c(t))return t instanceof File&&e==null&&r==null?t:die([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(E2c(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),die(await TLr(o),e,r)}let n=await TLr(t);if(!r?.type){let o=n.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof o=="string"&&(r={...r,type:o})}return die(n,e,r)}async function TLr(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(qji(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(SLr(t))for await(let r of t)e.push(...await TLr(r));else{let r=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${_2c(t)}`)}return e}function _2c(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(r=>`"${r}"`).join(", ")}]`}var qji,y2c,E2c,jji=ve(()=>{p();FEe();FEe();qji=a(t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function","isBlobLike"),y2c=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&qji(t),"isFileLike"),E2c=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","isResponseLike");a(Z1t,"toFile");a(TLr,"getBytes");a(_2c,"propsForError")});var ILr=ve(()=>{p();jji()});var Hji=ve(()=>{p()});var Ai,Ul=ve(()=>{p();Ai=class{static{a(this,"APIResource")}constructor(e){this._client=e}}});function*C2c(t){if(!t)return;if(Gji in t){let{values:n,nulls:o}=t;yield*n.entries();for(let s of o)yield[s,null];return}let e=!1,r;t instanceof Headers?r=t.entries():Z4r(t)?r=t:(e=!0,r=Object.entries(t??{}));for(let n of r){let o=n[0];if(typeof o!="string")throw new TypeError("expected header name to be a string");let s=Z4r(n[1])?n[1]:[n[1]],c=!1;for(let l of s)l!==void 0&&(e&&!c&&(c=!0,yield[o,null]),yield[o,l])}}var Gji,vt,vc=ve(()=>{p();NL();Gji=Symbol.for("brand.privateNullableHeaders");a(C2c,"iterateHeaders");vt=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of C2c(n)){let l=s.toLowerCase();o.has(l)||(e.delete(s),o.add(l)),c===null?(e.delete(s),r.add(l)):(e.append(s,c),r.delete(l))}}return{[Gji]:!0,values:e,nulls:r}},"buildHeaders")});function X1t(t){return typeof t=="object"&&t!==null&&v3e in t}function xLr(t,e){let r=new Set;if(t)for(let n of t)X1t(n)&&r.add(n[v3e]);if(e){for(let n of e)if(X1t(n)&&r.add(n[v3e]),Array.isArray(n.content))for(let o of n.content)X1t(o)&&r.add(o[v3e])}return Array.from(r)}function eSt(t,e){let r=xLr(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function $ji(t){return X1t(t)?{"x-stainless-helper":t[v3e]}:{}}var v3e,C3e=ve(()=>{p();v3e=Symbol("anthropic.sdk.stainlessHelper");a(X1t,"wasCreatedByStainlessHelper");a(xLr,"collectStainlessHelpers");a(eSt,"stainlessHelperHeader");a($ji,"stainlessHelperHeaderFromFile")});function Wji(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var Vji,b2c,or,Ff=ve(()=>{p();Bf();a(Wji,"encodeURIPath");Vji=Object.freeze(Object.create(null)),b2c=a((t=Wji)=>a(function(r,...n){if(r.length===1)return r[0];let o=!1,s=[],c=r.reduce((f,h,m)=>{/[?#]/.test(h)&&(o=!0);let g=n[m],A=(o?encodeURIComponent:t)(""+g);return m!==n.length&&(g==null||typeof g=="object"&&g.toString===Object.getPrototypeOf(Object.getPrototypeOf(g.hasOwnProperty??Vji)??Vji)?.toString)&&(A=g+"",s.push({start:f.length+h.length,length:A.length,error:`Value of type ${Object.prototype.toString.call(g).slice(8,-1)} is not a valid path parameter`})),f+h+(m===n.length?"":A)},""),l=c.split(/[?#]/,1)[0],u=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,d;for(;(d=u.exec(l))!==null;)s.push({start:d.index,length:d[0].length,error:`Value "${d[0]}" can't be safely passed as a path parameter`});if(s.sort((f,h)=>f.start-h.start),s.length>0){let f=0,h=s.reduce((m,g)=>{let A=" ".repeat(g.start-f),y="^".repeat(g.length);return f=g.start+g.length,m+A+y},"");throw new fr(`Path parameters result in path with invalid segments: + `,u=[],d=null,f=!0;for(;f;){let m=await yEe(t,e,r,n,l,o,{owner:s,name:c,first:100,after:d},"github-graphql-assignable-users");if(!m?.data?.repository?.assignableUsers)break;let g=m.data.repository.assignableUsers;u.push(...g.nodes),f=g.pageInfo.hasNextPage,d=g.pageInfo.endCursor}return u}a(uwc,"getAssignableActorsWithAssignableUsers")});var hQi=I(ck=>{"use strict";p();Object.defineProperty(ck,"__esModule",{value:!0});ck.BaseOctoKitService=ck.PermissiveAuthRequiredError=ck.VSCodeTeamId=ck.IOctoKitService=ck.IGithubRepositoryService=void 0;var pQi=nn(),fQi=p$(),bN=dQi();ck.IGithubRepositoryService=(0,pQi.createServiceIdentifier)("IGithubRepositoryService");ck.IOctoKitService=(0,pQi.createServiceIdentifier)("IOctoKitService");ck.VSCodeTeamId=1682102;var o4r=class extends Error{static{a(this,"PermissiveAuthRequiredError")}constructor(){super("Permissive authentication is required"),this.name="PermissiveAuthRequiredError"}};ck.PermissiveAuthRequiredError=o4r;var s4r=class t{static{a(this,"BaseOctoKitService")}static{this._outageStatusCacheTTL=300*1e3}static{this._userReposScopeCacheTTL=300*1e3}constructor(e,r,n,o){this._capiClientService=e,this._fetcherService=r,this._logService=n,this._telemetryService=o}async getCurrentAuthedUserWithToken(e){return this._makeGHAPIRequest("user","GET",e,void 0,void 0,"github-rest-get-user")}async getGitHubOutageStatus(){let e=Date.now();if(this._cachedOutageStatus&&e-this._cachedOutageStatus.timestampl.headRefName===n)}async addPullRequestCommentWithToken(e,r,n){return(0,bN.addPullRequestCommentGraphQLRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,n,e,r)}async createPullRequestWithToken(e,r,n,o,s,c,l,u){let d=await this._makeGHAPIRequest(`repos/${e}/${r}/pulls`,"POST",u,{title:n,body:o,head:s,base:c,draft:l});if(!d?.html_url||typeof d.number!="number")throw new Error(`Failed to create pull request for ${e}/${r}`);return{url:d.html_url,number:d.number}}async getPullRequestFromSessionWithToken(e,r){return(0,bN.getPullRequestFromGlobalId)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,r,e)}async getPullRequestFilesWithToken(e,r,n,o){return await(0,bN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,`repos/${e}/${r}/pulls/${n}/files`,"GET",o,{version:"2022-11-28",callSite:"github-rest-get-pr-files"})||[]}async compareCommitsWithToken(e,r,n,o,s){let c=`repos/${e}/${r}/compare/${n}...${o}`,l=await(0,bN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,c,"GET",s,{version:"2022-11-28",callSite:"github-rest-compare-commits"});if(!l)return;let u=l,d=u.merge_base_commit?.sha??u.base_commit?.sha??n,f=u.commits?.[u.commits.length-1]?.sha??o;return{baseSha:d,headSha:f,files:u.files??[]}}async getRepositoryByIdWithToken(e,r){let n=await(0,bN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,`repositories/${e}`,"GET",r,{version:"2022-11-28",callSite:"github-rest-get-repository-by-id"});if(!n)return;let o=n;if(o.owner?.login&&o.name)return{owner:o.owner.login,name:o.name};if(o.full_name){let[s,c]=o.full_name.split("/");if(s&&c)return{owner:s,name:c}}}async closePullRequestWithToken(e,r,n,o){return(0,bN.closePullRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,o,e,r,n)}async getFileContentWithToken(e,r,n,o,s){let c=`repos/${e}/${r}/contents/${o}?ref=${encodeURIComponent(n)}`,l=await(0,bN.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,c,"GET",s,{callSite:"github-rest-get-file-content"});if(!l||Array.isArray(l))throw new Error("Unable to fetch file content");let u=l;if(u.content&&u.encoding==="base64")return(0,fQi.decodeBase64)(u.content.replace(/\n/g,"")).toString();if(u.sha){let d=await this.getBlobContentWithToken(e,r,u.sha,s);if(d)return d}return this._logService.error(`Failed to get file content for ${e}/${r}/${o} at ref ${n}`),""}async getUserOrganizationsWithToken(e,r=100){let n=await this._makeGHAPIRequest(`user/orgs?per_page=${r}`,"GET",e,void 0,void 0,"github-rest-get-user-orgs");return!n||!Array.isArray(n)?[]:n.map(o=>o.login)}async isUserMemberOfOrgWithToken(e,r){try{let n=await this._makeGHAPIRequest(`user/memberships/orgs/${encodeURIComponent(e)}`,"GET",r,void 0,void 0,"github-rest-check-org-membership");return n&&(n.state==="active"||n.state==="pending")}catch{return!1}}async getOrganizationRepositoriesWithToken(e,r,n=100){let o=await this._makeGHAPIRequest(`orgs/${e}/repos?per_page=${n}&sort=updated`,"GET",r,void 0,{silent404:!0},"github-rest-get-org-repos");return!o||!Array.isArray(o)||o.length===0?[]:o.map(s=>s.name)}async getUserRepositoriesWithToken(e,r){let n=r?.trim();if(n)return this.searchUserRepositoriesWithToken(e,n);let o=await this._makeGHAPIRequest("user/repos?per_page=100&sort=updated&affiliation=owner,collaborator,organization_member","GET",e,void 0,void 0,"github-rest-get-user-repos");return!o||!Array.isArray(o)?[]:o.filter(s=>s.permissions?.push).map(s=>({owner:s.owner.login,name:s.name}))}async searchUserRepositoriesWithToken(e,r){let n=await this._getUserReposSearchScope(e);if(!n)return[];let o=encodeURIComponent(`${r} in:name fork:true ${n}`),s=await this._makeGHAPIRequest(`search/repositories?q=${o}&sort=updated&per_page=100`,"GET",e,void 0,void 0,"github-rest-search-repos");return!s||!Array.isArray(s.items)?[]:s.items.filter(c=>c.permissions?.push).map(c=>({owner:c.owner.login,name:c.name}))}async _getUserReposSearchScope(e){let r=Date.now();if(this._cachedUserReposScope&&this._cachedUserReposScope.token===e&&r-this._cachedUserReposScope.timestamp{"use strict";p();Object.defineProperty(Zbt,"__esModule",{value:!0});Zbt.NullBaseOctoKitService=void 0;var dwc=hQi(),a4r=class extends dwc.BaseOctoKitService{static{a(this,"NullBaseOctoKitService")}async getGitHubOutageStatus(){return 0}async getCurrentAuthedUser(){}async getCurrentAuthedUserWithToken(e){return{id:0,avatar_url:"",login:"NullUser",name:"Null User"}}async _makeGHAPIRequest(e,r,n,o,s,c){}};Zbt.NullBaseOctoKitService=a4r});var EQi=I(Ll=>{"use strict";p();var o1t=Ll&&Ll.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Bu=Ll&&Ll.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Ll,"__esModule",{value:!0});Ll.CopilotTokenManagerFromGitHubToken=Ll.CopilotTokenManagerFromDeviceId=Ll.RefreshableCopilotTokenManager=Ll.StaticExtendedTokenInfoCopilotTokenManager=Ll.FixedCopilotTokenManager=Ll.BaseCopilotTokenManager=Ll.tokenErrorString=void 0;Ll.createStaticGitHubTokenProvider=pwc;Ll.getOrCreateTestingCopilotTokenManager=hwc;var c4r=(Nne(),Qa(Dne)),fwc=Rc(),gQi=Ro(),Xbt=rpt(),yQi=Pl(),s1t=KE(),a1t=lV(),_Ee=H4(),c1t=mQi(),l1t=xp(),f3e=Sy(),u1t=vm(),AQi=qye(),E9=Qgt(),e1t=j5e();Ll.tokenErrorString='Tests: either GITHUB_PAT, GITHUB_OAUTH_TOKEN, or GITHUB_OAUTH_TOKEN+VSCODE_COPILOT_CHAT_TOKEN must be set unless running from an IS_SCENARIO_AUTOMATION environment. Run "npm run get_token" to get credentials.';function pwc(){let t=process.env.GITHUB_PAT,e=process.env.GITHUB_OAUTH_TOKEN;if(!(_Ee.isScenarioAutomation&&!t&&!e))return()=>{if(t)return t;if(e)return e;throw new Error(Ll.tokenErrorString)}}a(pwc,"createStaticGitHubTokenProvider");function hwc(t){if(process.env.VSCODE_COPILOT_CHAT_TOKEN)return new Xbt.SyncDescriptor(r1t,[process.env.VSCODE_COPILOT_CHAT_TOKEN]);if(process.env.GITHUB_OAUTH_TOKEN)return new Xbt.SyncDescriptor(i1t,[process.env.GITHUB_OAUTH_TOKEN,"unknown"]);if(process.env.GITHUB_PAT)return new Xbt.SyncDescriptor(t1t,[process.env.GITHUB_PAT]);if(_Ee.isScenarioAutomation)return new Xbt.SyncDescriptor(n1t,[t]);throw new Error(Ll.tokenErrorString)}a(hwc,"getOrCreateTestingCopilotTokenManager");var EEe=class extends gQi.Disposable{static{a(this,"BaseCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(),this._baseOctokitservice=e,this._logService=r,this._telemetryService=n,this._domainService=o,this._capiClientService=s,this._fetcherService=c,this._envService=l,this._isDisposed=!1,this._copilotTokenRefreshEmitter=this._register(new fwc.Emitter),this.onDidCopilotTokenRefresh=this._copilotTokenRefreshEmitter.event,this._register((0,gQi.toDisposable)(()=>this._isDisposed=!0))}get copilotToken(){return this._copilotToken}set copilotToken(e){e!==this._copilotToken&&(this._copilotToken=e,this._copilotTokenRefreshEmitter.fire())}resetCopilotToken(e){e!==void 0&&this._telemetryService.sendGHTelemetryEvent("auth.reset_token_"+e),this._logService.debug(`Resetting copilot token on HTTP error ${e||"unknown"}`),this.copilotToken=void 0}async authFromGitHubToken(e,r){return this.doAuthFromGitHubTokenOrDevDeviceId({githubToken:e,ghUsername:r})}async authFromDevDeviceId(e){return this.doAuthFromGitHubTokenOrDevDeviceId({devDeviceId:e})}async doAuthFromGitHubTokenOrDevDeviceId(e){this._telemetryService.sendGHTelemetryEvent("auth.new_login");let r,n,o;try{"githubToken"in e?(o=e.ghUsername,[r,n]=await Promise.all([this.fetchCopilotTokenFromGitHubToken(e.githubToken),this.fetchCopilotUserInfo(e.githubToken)])):r=await this.fetchCopilotTokenFromDevDeviceId(e.devDeviceId)}catch(f){return this._logService.warn("Failed to get copilot token due to fetch throwing: "+(f.message||String(f))),{kind:"failure",reason:"RequestFailed",message:f.message||String(f)}}if(!r.ok){this._logService.warn(`Failed to get copilot token due to status ${r.status} ${r.statusText}`);let f=AQi.TelemetryData.createAndMarkAsIssued({status:r.status.toString(),status_text:r.statusText});if(this._telemetryService.sendGHTelemetryErrorEvent("auth.invalid_token",f.properties,f.measurements),r.status===401)return this._logService.warn("Failed to get copilot token due to 401 status"),this._telemetryService.sendGHTelemetryErrorEvent("auth.unknown_401"),{kind:"failure",reason:"HTTP401"}}if(r.kind==="error-envelope")return this._logService.warn(`Failed to get copilot token due to: ${r.body.error_details.message}`),this._telemetryService.sendGHTelemetryErrorEvent("auth.request_read_failed"),{kind:"failure",reason:"NotAuthorized",...r.body.error_details};if(r.kind==="error")return r.body.message?.startsWith("API rate limit exceeded")?(this._logService.warn("Failed to get copilot token due to exceeding API rate limit"),this._telemetryService.sendGHTelemetryErrorEvent("auth.rate_limited"),{kind:"failure",reason:"RateLimited"}):(this._logService.warn(`Failed to get copilot token due to: ${r.body.message}`),{kind:"failure",reason:"NotAuthorized"});if(r.kind==="parse-failed")return this._logService.warn(`Failed to get copilot token due to: ${r.parseError}`),this._telemetryService.sendGHTelemetryErrorEvent("auth.request_read_failed"),{kind:"failure",reason:"ParseFailed",message:r.parseError};let s=r.body,c=s.expires_at;s.expires_at=(0,e1t.nowSeconds)()+s.refresh_in+60;let l=o??"unknown",u={...s,copilot_plan:n?.copilot_plan??s.sku??"",quota_snapshots:n?.quota_snapshots,quota_reset_date:n?.quota_reset_date,codex_agent_enabled:n?.codex_agent_enabled,token_based_billing:n?.token_based_billing,organization_login_list:n?.organization_login_list??[],username:l,isVscodeTeamMember:(0,E9.containsVSCodeOrg)(s.organization_list??[])},d=AQi.TelemetryData.createAndMarkAsIssued({},{adjusted_expires_at:s.expires_at,expires_at:c,current_time:(0,e1t.nowSeconds)()});return this._telemetryService.sendGHTelemetryEvent("auth.new_token",d.properties,d.measurements),{kind:"success",...u}}async fetchCopilotTokenFromGitHubToken(e){let r={callSite:"copilot-token-github",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0},n=await this._capiClientService.makeRequest(r,{type:c4r.RequestType.CopilotToken});return this.parseTokenResponse(n)}async fetchCopilotTokenFromDevDeviceId(e){let r={callSite:"copilot-token-device",headers:{"X-GitHub-Api-Version":"2025-04-01","Editor-Device-Id":`${e}`},retryFallbacks:!0,expectJSON:!0},n=await this._capiClientService.makeRequest(r,{type:c4r.RequestType.CopilotNLToken});return this.parseTokenResponse(n)}async parseTokenResponse(e){let r={ok:e.ok,status:e.status,statusText:e.statusText},n;try{n=await(0,f3e.jsonVerboseError)(e)}catch(s){return{...r,body:void 0,kind:"parse-failed",parseError:s.message||String(s)}}let o=(0,E9.validateTokenEnvelope)(n);return o.valid?(this.sendTokenValidationTelemetry(o),{...r,body:o.envelope,kind:"token"}):(0,E9.isErrorEnvelope)(n)?{...r,body:n,kind:"error-envelope"}:(0,E9.isStandardErrorEnvelope)(n)?{...r,body:n,kind:"error"}:(this.sendTokenValidationTelemetry(o),{...r,body:void 0,kind:"parse-failed",parseError:"Response is not valid: "+JSON.stringify(n)})}sendTokenValidationTelemetry(e){e.strategy!=="strict"&&this._telemetryService.sendMSFTTelemetryEvent("copilotTokenFetching.validation",{strategy:e.strategy,strictError:e.strictError,fallbackError:e.fallbackError})}async fetchCopilotUserInfo(e){let r={callSite:"copilot-token-user-info",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0};return await(await this._capiClientService.makeRequest(r,{type:c4r.RequestType.CopilotUserInfo})).json()}};Ll.BaseCopilotTokenManager=EEe;var t1t=class extends EEe{static{a(this,"FixedCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new c1t.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l),this._completionsToken=e,this.copilotToken=(0,E9.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}set completionsToken(e){this._completionsToken=e,this.copilotToken=(0,E9.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}get completionsToken(){return this._completionsToken}async getCopilotToken(){return new E9.CopilotToken(this.copilotToken)}async checkCopilotToken(){return{status:"OK"}}};Ll.FixedCopilotTokenManager=t1t;Ll.FixedCopilotTokenManager=t1t=o1t([Bu(1,l1t.ILogService),Bu(2,u1t.ITelemetryService),Bu(3,s1t.ICAPIClientService),Bu(4,a1t.IDomainService),Bu(5,f3e.IFetcherService),Bu(6,_Ee.IEnvService)],t1t);var r1t=class extends EEe{static{a(this,"StaticExtendedTokenInfoCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new c1t.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l);let u=Buffer.from(e,"base64").toString("utf8");this._initialToken=JSON.parse(u)}async getCopilotToken(){return this.copilotToken||(this.copilotToken={...this._initialToken}),new E9.CopilotToken(this._initialToken)}async checkCopilotToken(){return{status:"OK"}}};Ll.StaticExtendedTokenInfoCopilotTokenManager=r1t;Ll.StaticExtendedTokenInfoCopilotTokenManager=r1t=o1t([Bu(1,l1t.ILogService),Bu(2,u1t.ITelemetryService),Bu(3,s1t.ICAPIClientService),Bu(4,a1t.IDomainService),Bu(5,f3e.IFetcherService),Bu(6,_Ee.IEnvService)],r1t);var d3e=class extends EEe{static{a(this,"RefreshableCopilotTokenManager")}async getCopilotToken(e){if(!this.copilotToken||this.copilotToken.expires_at<(0,e1t.nowSeconds)()+300||e){let r=await this.authenticateAndGetToken();if(r.kind==="failure")throw Error(`Failed to get copilot token: ${r.reason.toString()} ${r.message??""}`);this.copilotToken={...r}}return new E9.CopilotToken(this.copilotToken)}async checkCopilotToken(){if(!this.copilotToken||this.copilotToken.expires_at<(0,e1t.nowSeconds)()){let r=await this.authenticateAndGetToken();if(r.kind==="failure")return r;this.copilotToken={...r}}return{status:"OK"}}};Ll.RefreshableCopilotTokenManager=d3e;var n1t=class extends d3e{static{a(this,"CopilotTokenManagerFromDeviceId")}constructor(e,r,n,o,s,c,l,u){super(new c1t.NullBaseOctoKitService(s,c,r,n),r,n,o,s,c,l),this.deviceId=e,this.configurationService=u}async authenticateAndGetToken(){return this.authFromDevDeviceId(this.deviceId)}};Ll.CopilotTokenManagerFromDeviceId=n1t;Ll.CopilotTokenManagerFromDeviceId=n1t=o1t([Bu(1,l1t.ILogService),Bu(2,u1t.ITelemetryService),Bu(3,a1t.IDomainService),Bu(4,s1t.ICAPIClientService),Bu(5,f3e.IFetcherService),Bu(6,_Ee.IEnvService),Bu(7,yQi.IConfigurationService)],n1t);var i1t=class extends d3e{static{a(this,"CopilotTokenManagerFromGitHubToken")}constructor(e,r,n,o,s,c,l,u,d){super(new c1t.NullBaseOctoKitService(c,l,n,o),n,o,s,c,l,u),this.githubToken=e,this.githubUsername=r,this.configurationService=d}async authenticateAndGetToken(){return this.authFromGitHubToken(this.githubToken,this.githubUsername)}};Ll.CopilotTokenManagerFromGitHubToken=i1t;Ll.CopilotTokenManagerFromGitHubToken=i1t=o1t([Bu(2,l1t.ILogService),Bu(3,u1t.ITelemetryService),Bu(4,a1t.IDomainService),Bu(5,s1t.ICAPIClientService),Bu(6,f3e.IFetcherService),Bu(7,_Ee.IEnvService),Bu(8,yQi.IConfigurationService)],i1t)});var _Qi=I(_9=>{"use strict";p();var mwc=_9&&_9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},l4r=_9&&_9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(_9,"__esModule",{value:!0});_9.ChatQuotaService=void 0;var gwc=(Nne(),Qa(Dne)),Awc=Rc(),ywc=Ro(),Ewc=HE(),_wc=KE(),vwc=xp(),u4r=class extends ywc.Disposable{static{a(this,"ChatQuotaService")}constructor(e,r,n){super(),this._authService=e,this._logService=r,this._capiClientService=n,this._turnCredits=new Map,this._onDidChange=this._register(new Awc.Emitter),this.onDidChange=this._onDidChange.event,this._rateLimitInfo={session:void 0,weekly:void 0},this._register(this._authService.onDidCopilotTokenChange(()=>{this._processUserInfoQuotaSnapshot(this._authService.copilotToken?.quotaInfo)}))}get quotaInfo(){return this._quotaInfo}get rateLimitInfo(){return this._rateLimitInfo}get quotaExhausted(){return!this._quotaInfo||this._quotaInfo.additionalUsageEnabled?!1:this._quotaInfo.unlimited?!this._quotaInfo.hasQuota:this._quotaInfo.percentRemaining<=0}get additionalUsageEnabled(){return this._quotaInfo?this._quotaInfo.additionalUsageEnabled:!1}getCreditsForTurn(e){return this._turnCredits.get(e)}setLastCopilotUsage(e,r){let n=e/1e9;n>=0&&this._turnCredits.set(r,(this._turnCredits.get(r)??0)+n)}resetTurnCredits(e){this._turnCredits.delete(e)}clearQuota(){this._quotaInfo=void 0}processQuotaHeaders(e){let r=this._authService.copilotToken?.isFreeUser?e.get("x-quota-snapshot-chat"):e.get("x-quota-snapshot-premium_models")||e.get("x-quota-snapshot-premium_interactions");if(!r)return;let n=this._processHeaderValue(r);if(!n)return;this._quotaInfo=n,this._logService.trace(`[ChatQuota] processQuotaHeaders: ${JSON.stringify(n)}`);let o=e.get("x-usage-ratelimit-session"),s=e.get("x-usage-ratelimit-weekly");this._rateLimitInfo.session=o?this._processHeaderValue(o):void 0,this._rateLimitInfo.weekly=s?this._processHeaderValue(s):void 0,this._onDidChange.fire()}processQuotaSnapshots(e){let r=this._authService.copilotToken?.isFreeUser?e.chat:e.premium_models??e.premium_interactions;if(r)try{let n=parseInt(r.entitlement,10),o=r.reset_date?new Date(r.reset_date):(()=>{let s=new Date;return s.setMonth(s.getMonth()+1),s})();this._quotaInfo={quota:n,unlimited:n===-1,hasQuota:r.has_quota??!0,percentRemaining:r.percent_remaining,additionalUsageUsed:r.overage_count,additionalUsageEnabled:r.overage_permitted,resetDate:o},this._logService.trace(`[ChatQuota] processQuotaSnapshots: ${JSON.stringify(this._quotaInfo)}`),this._onDidChange.fire()}catch(n){console.error("Failed to process quota snapshots",n)}}async refreshQuota(){let e=this._authService.anyGitHubSession?.accessToken;if(e)try{let r={callSite:"copilot-quota-refresh",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0},o=await(await this._capiClientService.makeRequest(r,{type:gwc.RequestType.CopilotUserInfo})).json();this._processUserInfoQuotaSnapshot(o),this._logService.trace("[ChatQuota] refreshQuota: fetched up-to-date quota data")}catch(r){this._logService.trace(`[ChatQuota] refreshQuota: failed to fetch quota data: ${r}`)}}_processHeaderValue(e){try{let r=new URLSearchParams(e),n=parseInt(r.get("ent")||"0",10),o=parseFloat(r.get("ov")||"0.0"),s=r.get("ovPerm")==="true",c=parseFloat(r.get("rem")||"0.0"),l=r.get("rst"),u;return l?u=new Date(l):(u=new Date,u.setMonth(u.getMonth()+1)),{quota:n,unlimited:n===-1,hasQuota:!0,percentRemaining:c,additionalUsageUsed:o,additionalUsageEnabled:s,resetDate:u}}catch(r){console.error("Failed to parse quota header",r);return}}_processUserInfoQuotaSnapshot(e){if(!e||!e.quota_snapshots||!e.quota_reset_date)return;let r=this._authService.copilotToken?.isFreeUser?e.quota_snapshots.chat:e.quota_snapshots.premium_interactions;this._quotaInfo={unlimited:r.unlimited,hasQuota:r.has_quota??!0,additionalUsageEnabled:r.overage_permitted,additionalUsageUsed:r.overage_count,quota:r.entitlement,resetDate:new Date(e.quota_reset_date),percentRemaining:r.percent_remaining},this._logService.trace(`[ChatQuota] processUserInfoQuotaSnapshot: ${JSON.stringify(this._quotaInfo)}`),this._onDidChange.fire()}};_9.ChatQuotaService=u4r;_9.ChatQuotaService=u4r=mwc([l4r(0,Ewc.IAuthenticationService),l4r(1,vwc.ILogService),l4r(2,_wc.ICAPIClientService)],u4r)});var CQi=I(d1t=>{"use strict";p();Object.defineProperty(d1t,"__esModule",{value:!0});d1t.DefaultsOnlyConfigurationService=void 0;var vQi=Pl(),d4r=class extends vQi.AbstractConfigurationService{static{a(this,"DefaultsOnlyConfigurationService")}getConfig(e){return this.getDefaultValue(e)}inspectConfig(e,r){return{defaultValue:this.getDefaultValue(e)}}setConfig(e,r,n){return Promise.resolve()}getNonExtensionConfig(e){}getExperimentBasedConfig(e,r,n){if(e.experimentName){let c=r.getTreatmentVariable(e.experimentName);if(c!==void 0)return c}let o=r.getTreatmentVariable(`copilotchat.config.${e.id}`);if(o!==void 0)return o;let s=r.getTreatmentVariable(`config.${e.fullyQualifiedId}`);if(s!==void 0)return s;if(e.fullyQualifiedOldId){let c=r.getTreatmentVariable(`copilotchat.config.${e.oldId}`);if(c!==void 0)return c;let l=r.getTreatmentVariable(`config.${e.fullyQualifiedOldId}`);if(l!==void 0)return l}return this.getDefaultValue(e)}updateExperimentBasedConfiguration(e){e.length!==0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a((r,n)=>{if(e.some(s=>s.startsWith(`config.${r}`)))return!0;let o=vQi.globalConfigRegistry.configs.get(r)?.fullyQualifiedOldId;return!!(o&&e.some(s=>s.startsWith(`config.${o}`)))},"affectsConfiguration")})}dumpConfig(){return{}}};d1t.DefaultsOnlyConfigurationService=d4r});var SQi=I(f1t=>{"use strict";p();Object.defineProperty(f1t,"__esModule",{value:!0});f1t.computeDiff=bwc;f1t.computeDiffSync=bQi;var Cwc=rNr();async function bwc(t,e,r){return bQi(t,e,r)}a(bwc,"computeDiff");function bQi(t,e,r){let n=t.split(/\r\n|\r|\n/),o=e.split(/\r\n|\r|\n/),c=new Cwc.DefaultLinesDiffComputer().computeDiff(n,o,r),l=c.changes.length>0?!1:t===e;function u(d){return d.map(f=>[f.original.startLineNumber,f.original.endLineNumberExclusive,f.modified.startLineNumber,f.modified.endLineNumberExclusive,f.innerChanges?.map(h=>[h.originalRange.startLineNumber,h.originalRange.startColumn,h.originalRange.endLineNumber,h.originalRange.endColumn,h.modifiedRange.startLineNumber,h.modifiedRange.startColumn,h.modifiedRange.endLineNumber,h.modifiedRange.endColumn])])}return a(u,"getLineChanges"),{identical:l,quitEarly:c.hitTimeout,changes:u(c.changes),moves:c.moves.map(d=>[d.lineRangeMapping.original.startLineNumber,d.lineRangeMapping.original.endLineNumberExclusive,d.lineRangeMapping.modified.startLineNumber,d.lineRangeMapping.modified.endLineNumberExclusive,u(d.changes)])}}a(bQi,"computeDiffSync")});var wQi=I(SN=>{"use strict";p();var Swc=SN&&SN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Twc=SN&&SN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xQi=SN&&SN.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{let r=Pwc([TQi.join(__dirname,"diffWorker.js"),TQi.join(__dirname,"../../../../dist/diffWorker.js")]);if(r===void 0)throw new Error("DiffServiceImpl: worker file not found");return new Iwc.WorkerWithRpcProxy(r,{name:"Diff worker"})})}dispose(){this._worker.rawValue?.terminate()}async computeDiff(e,r,n){let o=this._useWorker?await this._worker.value.proxy.computeDiff(e,r,n):await kwc.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:h4r(o.changes),moves:o.moves.map(c=>new Rwc.MovedText(new f4r.LineRangeMapping(new p1t.LineRange(c[0],c[1]),new p1t.LineRange(c[2],c[3])),h4r(c[4])))}}};SN.DiffServiceImpl=p4r;function h4r(t){return t.map(e=>new f4r.DetailedLineRangeMapping(new p1t.LineRange(e[0],e[1]),new p1t.LineRange(e[2],e[3]),e[4]?.map(r=>new f4r.RangeMapping(new IQi.Range(r[0],r[1],r[2],r[3]),new IQi.Range(r[4],r[5],r[6],r[7])))))}a(h4r,"toLineRangeMappings");function Pwc(t){for(let e of t)if((0,wwc.existsSync)(e))return e}a(Pwc,"firstExistingPath")});var kQi=I(v9=>{"use strict";p();var Dwc=v9&&v9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},RQi=v9&&v9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(v9,"__esModule",{value:!0});v9.CAPIClientImpl=void 0;var Nwc=H4(),Mwc=Sy(),Owc=KE(),m4r=class extends Owc.BaseCAPIClientService{static{a(this,"CAPIClientImpl")}constructor(e,r){super(process.env.HMAC_SECRET,process.env.VSCODE_COPILOT_INTEGRATION_ID,e,r)}};v9.CAPIClientImpl=m4r;v9.CAPIClientImpl=m4r=Dwc([RQi(0,Mwc.IFetcherService),RQi(1,Nwc.IEnvService)],m4r)});var DQi=I(C9=>{"use strict";p();var Lwc=C9&&C9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},g4r=C9&&C9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(C9,"__esModule",{value:!0});C9.DomainService=void 0;var Bwc=Rc(),Fwc=Ro(),Uwc=uG(),vEe=Pl(),Qwc=KE(),PQi="github-enterprise.uri",A4r=class extends Fwc.Disposable{static{a(this,"DomainService")}constructor(e,r,n){super(),this._configurationService=e,this._tokenStore=r,this._capiClientService=n,this._onDidChangeDomains=this._register(new Bwc.Emitter),this.onDidChangeDomains=this._onDidChangeDomains.event,this._register(this._configurationService.onDidChangeConfiguration(o=>this._onDidConfigChangeHandler(o))),this._processCopilotToken(this._tokenStore.copilotToken),this._register(this._tokenStore.onDidStoreUpdate(()=>this._processCopilotToken(this._tokenStore.copilotToken)))}_onDidConfigChangeHandler(e){(e.affectsConfiguration(`${vEe.CopilotConfigPrefix}.advanced`)||e.affectsConfiguration(PQi))&&this._processCAPIModuleChange(this._tokenStore.copilotToken)}_processCAPIModuleChange(e){let r=this._configurationService.getConfig(vEe.ConfigKey.Shared.DebugOverrideCAPIUrl);r&&r.endsWith("/")&&(r=r.slice(0,-1));let n=this._configurationService.getConfig(vEe.ConfigKey.Shared.DebugOverrideProxyUrl);n&&(n=n.replace(/\/$/,""));let o=this._configurationService.getConfig(vEe.ConfigKey.Shared.AuthProvider)===vEe.AuthProviderId.GitHubEnterprise?this._configurationService.getNonExtensionConfig(PQi):void 0,s={endpoints:{api:r||e?.endpoints?.api,proxy:n||e?.endpoints?.proxy,telemetry:e?.endpoints?.telemetry,"origin-tracker":e?.endpoints?.["origin-tracker"]},sku:e?.sku||"unknown"},c=this._capiClientService.updateDomains(s,o);(c.capiUrlChanged||c.proxyUrlChanged||c.telemetryUrlChanged||c.dotcomUrlChanged)&&this._onDidChangeDomains.fire({capiUrlChanged:c.capiUrlChanged,telemetryUrlChanged:c.telemetryUrlChanged,proxyUrlChanged:c.proxyUrlChanged,dotcomUrlChanged:c.dotcomUrlChanged})}_processCopilotToken(e){this._processCAPIModuleChange(e)}};C9.DomainService=A4r;C9.DomainService=A4r=Lwc([g4r(0,vEe.IConfigurationService),g4r(1,Uwc.ICopilotTokenStore),g4r(2,Qwc.ICAPIClientService)],A4r)});var NQi=I(CEe=>{"use strict";p();Object.defineProperty(CEe,"__esModule",{value:!0});CEe.NullNativeEnvService=CEe.NullEnvService=void 0;var qwc=Rc(),jwc=ad(),h1t=H4(),Hwc=P5e(),m1t=class t extends h1t.AbstractEnvService{static{a(this,"NullEnvService")}constructor(){super(...arguments),this.language="en"}static{this.Instance=new t}get extensionId(){return"test-extension-id"}get vscodeVersion(){return"test-version"}get isActive(){return!0}get onDidChangeWindowState(){return qwc.Event.None}get sessionId(){return"test-session"}get machineId(){return"test-machine"}get devDeviceId(){return"test-dev-device"}get remoteName(){}get uiKind(){return"desktop"}get uriScheme(){return"code-null"}get appRoot(){return""}get shell(){return"zsh"}get OS(){return h1t.OperatingSystem.Linux}getEditorInfo(){return new h1t.NameAndVersion("simulation-tests-editor",Hwc.packageJson.engines.vscode.match(/\d+\.\d+/)?.[0]??"1.89")}getEditorPluginInfo(){return new h1t.NameAndVersion("simulation-tests-plugin","2")}openExternal(e){return Promise.resolve(!1)}};CEe.NullEnvService=m1t;var y4r=class extends m1t{static{a(this,"NullNativeEnvService")}get userHome(){return jwc.URI.file("/home/testuser")}};CEe.NullNativeEnvService=y4r});var E4r=I(g1t=>{"use strict";p();Object.defineProperty(g1t,"__esModule",{value:!0});g1t.IGitExtensionService=void 0;var Gwc=nn();g1t.IGitExtensionService=(0,Gwc.createServiceIdentifier)("IGitExtensionService")});var MQi=I(A1t=>{"use strict";p();Object.defineProperty(A1t,"__esModule",{value:!0});A1t.NullGitExtensionService=void 0;var $wc=Rc(),_4r=class{static{a(this,"NullGitExtensionService")}constructor(){this.onDidChange=$wc.Event.None,this.extensionAvailable=!1}getExtensionApi(){}};A1t.NullGitExtensionService=_4r});var OQi=I(b9=>{"use strict";p();var Vwc=b9&&b9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Wwc=b9&&b9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(b9,"__esModule",{value:!0});b9.ObservableGit=void 0;var zwc=Ro(),PV=tD(),Ywc=E4r(),v4r=class extends zwc.Disposable{static{a(this,"ObservableGit")}constructor(e){super(),this._gitExtensionService=e,this._gitApi=(0,PV.observableFromEvent)(this,r=>this._gitExtensionService.onDidChange(r),()=>this._gitExtensionService.getExtensionApi()),this.branch=(0,PV.observableValue)("branchName",void 0),this.init()}async init(){let e=await(0,PV.waitForState)(this._gitApi);if(this._store.isDisposed)return;let r=(0,PV.observableFromEvent)(this,n=>e.onDidOpenRepository(n),()=>e.repositories??[]);await(0,PV.waitForState)(r,n=>n.length>0,void 0),!this._store.isDisposed&&(0,PV.mapObservableArrayCached)(this,r,(n,o)=>{let s=(0,PV.observableFromEvent)(c=>n.state.onDidChange(c),()=>n.state.HEAD?.name);o.add((0,PV.autorunWithStore)((c,l)=>{this.branch.set(s.read(c),void 0)}))},n=>n.rootUri.toString()).recomputeInitiallyAndOnChange(this._store)}};b9.ObservableGit=v4r;b9.ObservableGit=v4r=Vwc([Wwc(0,Ywc.IGitExtensionService)],v4r)});var E1t=I(Bl=>{"use strict";p();Object.defineProperty(Bl,"__esModule",{value:!0});Bl.lengthZero=void 0;Bl.lengthDiff=Zwc;Bl.lengthIsZero=Xwc;Bl.toLength=cie;Bl.lengthToObj=eRc;Bl.lengthGetLineCount=tRc;Bl.lengthGetColumnCountIfZeroLineCount=rRc;Bl.lengthAdd=BQi;Bl.sumLengths=nRc;Bl.lengthEquals=iRc;Bl.lengthDiffNonNegative=oRc;Bl.lengthLessThan=sRc;Bl.lengthLessThanEqual=aRc;Bl.lengthGreaterThanEqual=cRc;Bl.lengthToPosition=lRc;Bl.positionToLength=uRc;Bl.lengthsToRange=dRc;Bl.lengthOfRange=fRc;Bl.lengthCompare=pRc;Bl.lengthOfString=hRc;Bl.lengthOfStringObj=mRc;Bl.lengthHash=gRc;Bl.lengthMax=ARc;var LQi=om(),Kwc=$_(),Jwc=nh(),y1t=Bme();function Zwc(t,e,r,n){return t!==r?cie(r-t,n):cie(0,n-e)}a(Zwc,"lengthDiff");Bl.lengthZero=0;function Xwc(t){return t===0}a(Xwc,"lengthIsZero");var o_=2**26;function cie(t,e){return t*o_+e}a(cie,"toLength");function eRc(t){let e=t,r=Math.floor(e/o_),n=e-r*o_;return new y1t.TextLength(r,n)}a(eRc,"lengthToObj");function tRc(t){return Math.floor(t/o_)}a(tRc,"lengthGetLineCount");function rRc(t){return t}a(rRc,"lengthGetColumnCountIfZeroLineCount");function BQi(t,e){let r=t+e;return e>=o_&&(r=r-t%o_),r}a(BQi,"lengthAdd");function nRc(t,e){return t.reduce((r,n)=>BQi(r,e(n)),Bl.lengthZero)}a(nRc,"sumLengths");function iRc(t,e){return t===e}a(iRc,"lengthEquals");function oRc(t,e){let r=t,n=e;if(n-r<=0)return Bl.lengthZero;let s=Math.floor(r/o_),c=Math.floor(n/o_),l=n-c*o_;if(s===c){let u=r-s*o_;return cie(0,l-u)}else return cie(c-s,l)}a(oRc,"lengthDiffNonNegative");function sRc(t,e){return t=e}a(cRc,"lengthGreaterThanEqual");function lRc(t){let e=t,r=Math.floor(e/o_),n=e-r*o_;return new Kwc.Position(r+1,n+1)}a(lRc,"lengthToPosition");function uRc(t){return cie(t.lineNumber-1,t.column-1)}a(uRc,"positionToLength");function dRc(t,e){let r=t,n=Math.floor(r/o_),o=r-n*o_,s=e,c=Math.floor(s/o_),l=s-c*o_;return new Jwc.Range(n+1,o+1,c+1,l+1)}a(dRc,"lengthsToRange");function fRc(t){return t.startLineNumber===t.endLineNumber?new y1t.TextLength(0,t.endColumn-t.startColumn):new y1t.TextLength(t.endLineNumber-t.startLineNumber,t.endColumn-1)}a(fRc,"lengthOfRange");function pRc(t,e){return t-e}a(pRc,"lengthCompare");function hRc(t){let e=(0,LQi.splitLines)(t);return cie(e.length-1,e[e.length-1].length)}a(hRc,"lengthOfString");function mRc(t){let e=(0,LQi.splitLines)(t);return new y1t.TextLength(e.length-1,e[e.length-1].length)}a(mRc,"lengthOfStringObj");function gRc(t){return t}a(gRc,"lengthHash");function ARc(t,e){return t>e?t:e}a(ARc,"lengthMax")});var S4r=I(_1t=>{"use strict";p();Object.defineProperty(_1t,"__esModule",{value:!0});_1t.TextEditInfo=void 0;var C4r=E1t(),b4r=class{static{a(this,"TextEditInfo")}constructor(e,r,n){this.startOffset=e,this.endOffset=r,this.newLength=n}toString(){return`[${(0,C4r.lengthToObj)(this.startOffset)}...${(0,C4r.lengthToObj)(this.endOffset)}) -> ${(0,C4r.lengthToObj)(this.newLength)}`}};_1t.TextEditInfo=b4r});var UQi=I(T4r=>{"use strict";p();Object.defineProperty(T4r,"__esModule",{value:!0});T4r.combineTextEditInfos=_Rc;var yRc=Sl(),B0=E1t(),ERc=S4r();function _Rc(t,e){if(t.length===0)return e;if(e.length===0)return t;let r=new yRc.ArrayQueue(FQi(t)),n=FQi(e);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let o=r.dequeue();function s(d){if(d===void 0){let h=r.takeWhile(m=>!0)||[];return o&&h.unshift(o),h}let f=[];for(;o&&!(0,B0.lengthIsZero)(d);){let[h,m]=o.splitAt(d);f.push(h),d=(0,B0.lengthDiffNonNegative)(h.lengthAfter,d),o=m??r.dequeue()}return(0,B0.lengthIsZero)(d)||f.push(new p3e(!1,d,d)),f}a(s,"nextS0ToS1MapWithS1LengthOf");let c=[];function l(d,f,h){if(c.length>0&&(0,B0.lengthEquals)(c[c.length-1].endOffset,d)){let m=c[c.length-1];c[c.length-1]=new ERc.TextEditInfo(m.startOffset,f,(0,B0.lengthAdd)(m.newLength,h))}else c.push({startOffset:d,endOffset:f,newLength:h})}a(l,"pushEdit");let u=B0.lengthZero;for(let d of n){let f=s(d.lengthBefore);if(d.modified){let h=(0,B0.sumLengths)(f,g=>g.lengthBefore),m=(0,B0.lengthAdd)(u,h);l(u,m,d.lengthAfter),u=m}else for(let h of f){let m=u;u=(0,B0.lengthAdd)(u,h.lengthBefore),h.modified&&l(m,u,h.lengthAfter)}}return c}a(_Rc,"combineTextEditInfos");var p3e=class t{static{a(this,"LengthMapping")}constructor(e,r,n){this.modified=e,this.lengthBefore=r,this.lengthAfter=n}splitAt(e){let r=(0,B0.lengthDiffNonNegative)(e,this.lengthAfter);return(0,B0.lengthEquals)(r,B0.lengthZero)?[this,void 0]:this.modified?[new t(this.modified,this.lengthBefore,e),new t(this.modified,B0.lengthZero,r)]:[new t(this.modified,e,e),new t(this.modified,r,r)]}toString(){return`${this.modified?"M":"U"}:${(0,B0.lengthToObj)(this.lengthBefore)} -> ${(0,B0.lengthToObj)(this.lengthAfter)}`}};function FQi(t){let e=[],r=B0.lengthZero;for(let n of t){let o=(0,B0.lengthDiffNonNegative)(r,n.startOffset);(0,B0.lengthIsZero)(o)||e.push(new p3e(!1,o,o));let s=(0,B0.lengthDiffNonNegative)(n.startOffset,n.endOffset);e.push(new p3e(!0,s,n.newLength)),r=n.endOffset}return e}a(FQi,"toLengthMapping")});var qQi=I(bEe=>{"use strict";p();Object.defineProperty(bEe,"__esModule",{value:!0});bEe.SingleTextEditLength=bEe.TextLengthEdit=void 0;var vRc=nh(),QQi=Bme(),CRc=UQi(),h3e=E1t(),bRc=S4r(),I4r=class t{static{a(this,"TextLengthEdit")}static{this.empty=new t([])}static fromTextEdit(e){let r=e.replacements.map(n=>new m3e(n.range,QQi.TextLength.ofText(n.text)));return new t(r)}static _fromTextEditInfo(e){let r=e.map(n=>{let o=(0,h3e.lengthToObj)(n.newLength);return new m3e((0,h3e.lengthsToRange)(n.startOffset,n.endOffset),new QQi.TextLength(o.lineCount,o.columnCount))});return new t(r)}constructor(e){this.edits=e}_toTextEditInfo(){return this.edits.map(e=>new bRc.TextEditInfo((0,h3e.toLength)(e.range.startLineNumber-1,e.range.startColumn-1),(0,h3e.toLength)(e.range.endLineNumber-1,e.range.endColumn-1),(0,h3e.toLength)(e.newLength.lineCount,e.newLength.columnCount)))}compose(e){let r=this._toTextEditInfo(),n=e._toTextEditInfo(),o=(0,CRc.combineTextEditInfos)(r,n);return t._fromTextEditInfo(o)}getRange(){if(this.edits.length!==0)return vRc.Range.fromPositions(this.edits[0].range.getStartPosition(),this.edits.at(-1).range.getEndPosition())}toString(){return`[${this.edits.join(", ")}]`}};bEe.TextLengthEdit=I4r;var m3e=class{static{a(this,"SingleTextEditLength")}constructor(e,r){this.range=e,this.newLength=r}toString(){return`{ range: ${this.range}, newLength: ${this.newLength} }`}};bEe.SingleTextEditLength=m3e});var jQi=I(SEe=>{"use strict";p();Object.defineProperty(SEe,"__esModule",{value:!0});SEe.DocumentHistory=SEe.HistoryContext=void 0;var SRc=sd(),TRc=fN(),x4r=class{static{a(this,"HistoryContext")}constructor(e){this.documents=e,(0,SRc.assert)(e.length>0)}getMostRecentDocument(){return this.documents.at(-1)}getDocument(e){return this.documents.find(r=>r.docId===e)}getDocumentAndIdx(e){let r=this.documents.findIndex(n=>n.docId===e);if(r!==-1)return{doc:this.documents[r],idx:r}}};SEe.HistoryContext=x4r;var w4r=class{static{a(this,"DocumentHistory")}constructor(e,r,n,o,s){this.docId=e,this.languageId=r,this.base=n,this.lastEdits=o,this.lastSelection=s,this.lastEdit=new TRc.RootedEdit(this.base,this.lastEdits.compose())}};SEe.DocumentHistory=w4r});var zQi=I(TEe=>{"use strict";p();Object.defineProperty(TEe,"__esModule",{value:!0});TEe.NesHistoryContextProvider=void 0;TEe.sum=A3e;TEe.editExtends=WQi;var HQi=Ro(),GQi=tD(),IRc=nT(),g3e=ME(),xRc=B5e(),wRc=$T(),v1t=fN(),RRc=cvt(),$Qi=qQi(),kRc=g4(),y3e=OMe(),VQi=jQi(),R4r=class extends HQi.Disposable{static{a(this,"NesHistoryContextProvider")}constructor(e,r){super(),this._documentState=new Map,this._lastDocuments=new P4r(50),this._register((0,GQi.autorun)(n=>{n.readObservable(r.branch)!==void 0&&(this._lastGitCheckout=(0,y3e.now)(),this._documentState.forEach(s=>s.applyAllEdits()))})),(0,GQi.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=n.selection.get().at(0),c=new k4r(n.id,n.value.get().value,n.languageId.get(),s);this._documentState.set(c.docId,c),s&&this._lastDocuments.push(c),o.add((0,kRc.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},l=>{l.languageId.changes.length>0&&(c.languageId=l.languageId.value);let u=this._isAwaitingGitCheckoutCooldown();for(let d of l.value.changes)this._lastDocuments.push(c),c.handleEdit(d,u);l.selection.changes.length>0&&(c.handleSelection(l.selection.value.at(0)),this._lastDocuments.push(c))})),o.add((0,HQi.toDisposable)(()=>{let l=this._documentState.get(n.id);l&&this._lastDocuments.remove(l),this._documentState.delete(n.id)}))},n=>n.id).recomputeInitiallyAndOnChange(this._store)}getHistoryContext(e){let r=this._documentState.get(e);if(!r||!this._lastDocuments.has(r))return;let n=[],o=!1,s=5;for(let c of this._lastDocuments.getItemsReversed()){let l=c.getRecentEdit(s);if(l!==void 0&&(l.editCount===0&&o||(c.docId===e&&(o=!0),n.push(l.history),s-=l.editCount,s<=0)))break}if(n.reverse(),!!n.some(c=>c.docId===e))return new VQi.HistoryContext(n)}_isAwaitingGitCheckoutCooldown(){if(!this._lastGitCheckout)return!1;let e=(0,y3e.now)()-this._lastGitCheckout<2*1e3;return e||(this._lastGitCheckout=void 0),e}};TEe.NesHistoryContextProvider=R4r;var k4r=class t{static{a(this,"DocumentState")}static{this.MAX_EDITED_LINES_PER_EDIT=10}static{this.MAX_EDITED_CHARS_PER_EDIT=5e3}constructor(e,r,n,o){this.docId=e,this.languageId=n,this._edits=[],this._isUserDocument=!1,this._baseValue=new wRc.StringText(r),this._currentValue=this._baseValue,this.handleSelection(o)}getSelection(){return this._selection}handleSelection(e){e&&(this._isUserDocument=!0),this._selection=e}handleEdit(e,r){if(e.isEmpty())return;this._currentValue=e.applyOnText(this._currentValue);let n=xRc.TextEdit.fromStringEdit(e,this._currentValue),o=$Qi.TextLengthEdit.fromTextEdit(n);if(r){this._baseValue=this._currentValue,this._edits=[];return}function s(l){return A3e(l.replacements,u=>u.newText.length)}a(s,"editInsertSize");let c=this._edits.at(-1);c&&s(c.edit)<200&&WQi(e,c.edit)?(c.edit=c.edit.compose(e),c.textLengthEdit=c.textLengthEdit.compose(o),c.instant=(0,y3e.now)(),c.edit.isEmpty()&&this._edits.pop()):this._edits.push({edit:e,textLengthEdit:o,instant:(0,y3e.now)()})}getRecentEdit(e){if(!this._isUserDocument)return;let{editCount:r}=this._applyStaleEdits(e),n=new v1t.Edits(g3e.StringEdit,this._edits.map(o=>o.edit));return{history:new VQi.DocumentHistory(this.docId,this.languageId,this._baseValue,n,this._selection),editCount:r}}applyAllEdits(){this._baseValue=this._currentValue,this._edits=[]}_applyStaleEdits(e){let r=this._currentValue,n=g3e.StringEdit.empty,o=$Qi.TextLengthEdit.empty,s,c=0,l=g3e.StringEdit.empty;for(s=this._edits.length-1;s>=0;s--){let u=this._edits[s];if((0,y3e.now)()-u.instant>600*1e3)break;let d=u.textLengthEdit.compose(o),f=d.getRange();if((0,IRc.assertType)(f,"we only compose non-empty Edits"),f.endLineNumber-f.startLineNumber>100)break;let h=A3e(u.textLengthEdit.edits,b=>b.range.endLineNumber-b.range.startLineNumber+b.newLength.lineCount);if(h>t.MAX_EDITED_LINES_PER_EDIT||A3e(u.edit.replacements,b=>b.newText.length)>t.MAX_EDITED_CHARS_PER_EDIT||A3e(u.edit.replacements,b=>b.replaceRange.length)>t.MAX_EDITED_CHARS_PER_EDIT)break;if(s===this._edits.length-1)l=u.edit;else{let b=g3e.StringEdit.trySwap(u.edit,l);if(b)l=b.e1;else{if(h>=2)break;l=u.edit.compose(l)}}r=u.edit.inverse(r.value).applyOnText(r);let y=u.edit.compose(n),E=v1t.RootedEdit.toLineEdit(new v1t.RootedEdit(r,y)),v=new RRc.RootedLineEdit(r,E).removeCommonSuffixPrefixLines().edit.replacements.length;if(v>e)break;c=v,n=y,o=d}for(let u=0;u<=s;u++){let d=this._edits[u];this._baseValue=d.edit.applyOnText(this._baseValue)}return this._edits=this._edits.slice(s+1),{editCount:c}}toString(){return new v1t.Edits(g3e.StringEdit,this._edits.map(e=>e.edit)).toHumanReadablePatch(this._baseValue)}};function A3e(t,e){let r=0;for(let n of t)r+=e(n);return r}a(A3e,"sum");function WQi(t,e){let r=e.getNewRanges();return t.replacements.every(n=>PRc(n.replaceRange,r))}a(WQi,"editExtends");function PRc(t,e){return e.some(r=>t.start===r.endExclusive||t.endExclusive===r.start)}a(PRc,"doesTouch");var P4r=class{static{a(this,"FifoSet")}constructor(e){this.maxSize=e,this._arr=[]}push(e){let r=this._arr.indexOf(e);r!==-1?this._arr.splice(r,1):this._arr.length>=this.maxSize&&this._arr.shift(),this._arr.push(e)}remove(e){let r=this._arr.indexOf(e);r!==-1&&this._arr.splice(r,1)}getItemsReversed(){let e=[...this._arr];return e.reverse(),e}has(e){return this._arr.indexOf(e)!==-1}}});var JQi=I(TN=>{"use strict";p();var DRc=TN&&TN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},YQi=TN&&TN.__param||function(t,e){return function(r,n){e(r,n,t)}},N4r;Object.defineProperty(TN,"__esModule",{value:!0});TN.NesXtabHistoryTracker=TN.XtabEditMergeStrategy=void 0;var M4r=sd(),NRc=Ro(),MRc=Due(),ORc=tD(),LRc=D8(),b1t=Pl(),BRc=yh(),C1t=fN(),S9=DCr(),FRc=g4(),D4r=OMe(),O4r;(function(t){t.sameStartLine={kind:S9.DiffHistoryMergeStrategy.SameStartLine};function e(o){return{kind:S9.DiffHistoryMergeStrategy.Proximity,lineGap:o}}a(e,"proximity"),t.proximity=e;function r(o,s){return{kind:S9.DiffHistoryMergeStrategy.Hybrid,lineGap:o,splitAfterMs:s}}a(r,"hybrid"),t.hybrid=r;function n(o,s,c){switch(o){case S9.DiffHistoryMergeStrategy.Proximity:return e(s);case S9.DiffHistoryMergeStrategy.Hybrid:return r(s,c);case S9.DiffHistoryMergeStrategy.SameStartLine:return t.sameStartLine;default:(0,M4r.assertNever)(o)}}a(n,"fromConfig"),t.fromConfig=n})(O4r||(TN.XtabEditMergeStrategy=O4r={}));function KQi(t,e,r){if(t.isEmpty()||e.isEmpty())return!1;for(let n of t.replacements)if(!e.replacements.some(s=>n.lineRange.distanceToRange(s.lineRange)<=r))return!1;return!0}a(KQi,"areLineEditsWithinProximity");var L4r=class extends NRc.Disposable{static{a(this,"NesXtabHistoryTracker")}static{N4r=this}static{this.MAX_HISTORY_SIZE=50}constructor(e,r,n,o){super(),this._configurationService=n,this._expService=o,this.idToEntry=new Map,this.history=new MRc.LinkedList,this.maxHistorySize=r??N4r.MAX_HISTORY_SIZE,this.mergeStrategy=(0,LRc.derived)(s=>O4r.fromConfig(this._configurationService.getExperimentBasedConfigObservable(b1t.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeStrategy,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(b1t.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeLineGap,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(b1t.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeSplitAfterMs,this._expService).read(s))),(0,ORc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{c.add((0,FRc.autorunWithChanges)(this,{rootedEdits:s.value,visibleRanges:s.visibleRanges},l=>{l.rootedEdits.changes.length>0&&l.rootedEdits.previous!==void 0?this.handleEdits(s,l.rootedEdits):this.handleVisibleRangesChange(s,l.visibleRanges)}))},s=>s.id).recomputeInitiallyAndOnChange(this._store)}getHistory(){return[...this.history]}handleVisibleRangesChange(e,r){if(r.value.length===0)return;let n=this.idToEntry.get(e.id);if(n!==void 0){if(n.entry.kind==="edit")return;n.removeFromHistory()}let o={docId:e.id,kind:"visibleRanges",visibleRanges:r.value,documentContent:e.value.get()},s=this.history.push(o);this.idToEntry.set(e.id,{entry:o,removeFromHistory:s,lastEditTimestamp:(0,D4r.now)()}),this.compactHistory()}shouldMerge(e,r,n){let o=this.mergeStrategy.get();switch(o.kind){case S9.DiffHistoryMergeStrategy.SameStartLine:return!r.isEmpty()&&!e.isEmpty()&&e.replacements[0].lineRange.startLineNumber===r.replacements[0].lineRange.startLineNumber;case S9.DiffHistoryMergeStrategy.Proximity:return KQi(r,e,o.lineGap);case S9.DiffHistoryMergeStrategy.Hybrid:return(0,D4r.now)()-n<=o.splitAfterMs&&KQi(r,e,o.lineGap)}}handleEdits(e,r){(0,M4r.assert)(r.previous!==void 0,"Document has previous version"),(0,M4r.assert)(r.changes.length===1,`Expected 1 edit change but got ${r.changes.length}`);let n=r.changes[0];if(n.replacements.length===0)return;let o=this.idToEntry.get(e.id),s=r.previous,c=new C1t.RootedEdit(s,n);if(o===void 0){this.pushToHistory(e.id,c);return}if(o.entry.kind==="visibleRanges"){o.removeFromHistory(),this.pushToHistory(e.id,c);return}let l=o.entry.edit,u=C1t.RootedEdit.toLineEdit(l),d=C1t.RootedEdit.toLineEdit(c);if(this.shouldMerge(u,d,o.lastEditTimestamp)){o.removeFromHistory();let f=l.edit.compose(n),h=new C1t.RootedEdit(l.base,f);this.pushToHistory(e.id,h)}else this.pushToHistory(e.id,c)}pushToHistory(e,r){let n={docId:e,kind:"edit",edit:r},o=this.history.push(n);this.idToEntry.set(e,{entry:n,removeFromHistory:o,lastEditTimestamp:(0,D4r.now)()}),this.compactHistory()}compactHistory(){if(this.history.size>this.maxHistorySize){let e=this.history.shift();if(e!==void 0){let r=this.idToEntry.get(e.docId);r!==void 0&&e===r.entry&&this.idToEntry.delete(e.docId)}}}};TN.NesXtabHistoryTracker=L4r;TN.NesXtabHistoryTracker=L4r=N4r=DRc([YQi(2,b1t.IConfigurationService),YQi(3,BRc.IExperimentationService)],L4r)});var ZQi=I(S1t=>{"use strict";p();Object.defineProperty(S1t,"__esModule",{value:!0});S1t.IVSCodeExtensionContext=void 0;var URc=nn();S1t.IVSCodeExtensionContext=(0,URc.createServiceIdentifier)("IVSCodeExtensionContext")});var sqi=I(xN=>{"use strict";p();var rqi=xN&&xN.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},DV=xN&&xN.__param||function(t,e){return function(r,n){e(r,n,t)}},_3e;Object.defineProperty(xN,"__esModule",{value:!0});xN.UndesiredModels=xN.InlineEditsModelService=void 0;var QRc=R5r(),nqi=d5r(),XQi=nv(),qRc=Sl(),eqi=sd(),iqi=Rc(),oqi=Ro(),IEe=tD(),jRc=uG(),IN=Pl(),HRc=ZQi(),GRc=xp(),$Rc=Qbt(),VRc=yh(),WRc=vm(),E3e=Ay(),zRc=rbt(),F4r=class extends oqi.Disposable{static{a(this,"InlineEditsModelService")}static{_3e=this}static{this.COPILOT_NES_XTAB_MODEL={modelName:"copilot-nes-xtab",promptingStrategy:E3e.PromptingStrategy.CopilotNesXtab,includeTagsInCurrentFile:!0,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_OCT={modelName:"copilot-nes-oct",promptingStrategy:E3e.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_CALLISTO={modelName:"nes-callisto",promptingStrategy:E3e.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}constructor(e,r,n,o,s,c,l){super(),this._tokenStore=e,this._proxyModelsService=r,this._undesiredModelsManager=n,this._configService=o,this._expService=s,this._telemetryService=c,this._logService=l,this._copilotTokenObs=(0,IEe.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken),this._fetchedModelsObs=(0,IEe.observableFromEvent)(this,this._proxyModelsService.onModelListUpdated,()=>this._proxyModelsService.nesModels),this._preferredModelNameObs=this._configService.getExperimentBasedConfigObservable(IN.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService),this._localModelConfigObs=this._configService.getConfigObservable(IN.ConfigKey.Advanced.InlineEditsXtabProviderModelConfiguration),this._expBasedModelConfigObs=this._configService.getExperimentBasedConfigObservable(IN.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString,this._expService),this._defaultModelConfigObs=this._configService.getExperimentBasedConfigObservable(IN.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString,this._expService),this._useSlashModelsObs=this._configService.getExperimentBasedConfigObservable(IN.ConfigKey.TeamInternal.InlineEditsUseSlashModels,this._expService),this._undesiredModelsObs=(0,IEe.observableFromEvent)(this,this._undesiredModelsManager.onDidChange,()=>this._undesiredModelsManager),this._setModelQueue=new nqi.TaskQueue,this._logger=l.createSubLogger(["NES","ModelsService"]);let u=this._logger.createSubLogger("constructor");this._modelsObs=(0,IEe.derived)(d=>(u.trace("computing models"),this.aggregateModels({copilotToken:this._copilotTokenObs.read(d),fetchedNesModels:this._fetchedModelsObs.read(d),localModelConfig:this._localModelConfigObs.read(d),modelConfigString:this._expBasedModelConfigObs.read(d),defaultModelConfigString:this._defaultModelConfigObs.read(d),useSlashModels:this._useSlashModelsObs.read(d)}))).recomputeInitiallyAndOnChange(this._store),this._currentModelObs=(0,IEe.derived)(d=>{u.trace("computing current model");let f=this._undesiredModelsObs.read(d);return this._pickModel({preferredModelName:this._preferredModelNameObs.read(d),models:this._modelsObs.read(d),undesiredModelsManager:f})}).recomputeInitiallyAndOnChange(this._store),this._modelInfoObs=(0,IEe.derived)(d=>(u.trace("computing model info"),{models:this._modelsObs.read(d),currentModelId:this._currentModelObs.read(d).modelName})).recomputeInitiallyAndOnChange(this._store),this.onModelListUpdated=iqi.Event.fromObservableLight(this._modelInfoObs)}get modelInfo(){let e=this._modelsObs.get().map(n=>({id:n.modelName,name:n.modelName})),r=this._currentModelObs.get();return{models:e,currentModelId:r.modelName}}setCurrentModelId(e){return this._setModelQueue.schedule(()=>this._setCurrentModelIdCore(e))}async _setCurrentModelIdCore(e){if(this._configService.getExperimentBasedConfig(IN.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService)===e)return;let o=this._currentModelObs.get(),s=this._modelsObs.get(),c=s.find(u=>u.modelName===e);if(c===void 0){this._logService.error(`New preferred model id ${e} not found in model list.`);return}o.source==="expConfig"&&await this._undesiredModelsManager.addUndesiredModelId(o.modelName),this._undesiredModelsManager.isUndesiredModelId(e)&&await this._undesiredModelsManager.removeUndesiredModelId(e);let l=this._pickModel({preferredModelName:"none",models:s,undesiredModelsManager:this._undesiredModelsManager});c.source==="expConfig"||e===l.modelName&&!s.some(u=>u.source==="expConfig")?(this._logger.trace(`New preferred model id ${e} is the same as the default model, resetting user setting.`),await this._configService.setConfig(IN.ConfigKey.Advanced.InlineEditsPreferredModel,"none")):(this._logger.trace(`New preferred model id ${e} is different from the default model, updating user setting to ${e}.`),await this._configService.setConfig(IN.ConfigKey.Advanced.InlineEditsPreferredModel,e))}aggregateModels({copilotToken:e,fetchedNesModels:r,localModelConfig:n,modelConfigString:o,defaultModelConfigString:s,useSlashModels:c}){let l=this._logger.createSubLogger("aggregateModels"),u=[];if(n&&(u.some(d=>d.modelName===n.modelName)?l.trace("Local model configuration already exists in the model list, skipping."):(l.trace(`Adding local model configuration: ${n.modelName}`),u.push({...n,source:"localConfig"}))),o){l.trace("Parsing modelConfigurationString...");let d=this.parseModelConfigString(o,IN.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString);d&&!u.some(f=>f.modelName===d.modelName)?(l.trace(`Adding model from modelConfigurationString: ${d.modelName}`),u.push({...d,source:"expConfig"})):l.trace("No valid model found in modelConfigurationString.")}if(c&&r&&r.length>0){l.trace(`Processing ${r.length} fetched models...`);let d=(0,QRc.filterMap)(r,f=>{if((0,E3e.isPromptingStrategy)(f.capabilities.promptStrategy)){if(u.some(h=>h.modelName===f.name)){l.trace(`Fetched model ${f.name} already exists in the model list, skipping.`);return}return{modelName:f.name,promptingStrategy:f.capabilities.promptStrategy,includeTagsInCurrentFile:!1,source:"fetched",lintOptions:void 0}}});l.trace(`Adding ${d.length} fetched models after filtering.`),(0,qRc.pushMany)(u,d)}else{l.trace(`adding built-in default model: useSlashModels ${c}, fetchedNesModels ${r?.length??"undefined"}`);let d=this.determineDefaultModel(e,s);d&&(u.some(f=>f.modelName===d.modelName)?l.trace("Default model configuration already exists in the model list, skipping."):(l.trace(`Adding default model configuration: ${d.modelName}`),u.push(d)))}return u}selectedModelConfiguration(){return B4r(this._currentModelObs.get())}defaultModelConfiguration(){let e=this._modelsObs.get();if(e&&e.length>0){let r=e.filter(n=>!this.isConfiguredModel(n));if(r.length>0)return B4r(r[0])}return B4r(this.determineDefaultModel(this._copilotTokenObs.get(),this._defaultModelConfigObs.get()))}isConfiguredModel(e){switch(e.source){case"localConfig":case"expConfig":case"expDefaultConfig":return!0;case"fetched":case"hardCodedDefault":return!1;default:(0,eqi.assertNever)(e.source)}}determineDefaultModel(e,r){if(r){let n=this.parseModelConfigString(r,IN.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString);if(n)return{...n,source:"expDefaultConfig"}}return e?.isFcv1()?_3e.COPILOT_NES_XTAB_MODEL:e?.isFreeUser||e?.isNoAuthUser?_3e.COPILOT_NES_CALLISTO:_3e.COPILOT_NES_OCT}_pickModel({preferredModelName:e,models:r,undesiredModelsManager:n}){let o=r.find(l=>l.source==="expConfig");if(o)if(n.isUndesiredModelId(o.modelName))this._logger.trace(`Exp-configured model ${o.modelName} is marked as undesired by the user. Skipping.`);else return o;if(e!=="none"){let l=r.find(u=>u.modelName===e);if(l)return l}(0,eqi.softAssert)(r.length>0,"InlineEdits model list should have at least one model");let c=r.at(0);return c||this.determineDefaultModel(this._copilotTokenObs.get(),this._defaultModelConfigObs.get())}parseModelConfigString(e,r){let n;try{let o=JSON.parse(e),s=E3e.MODEL_CONFIGURATION_VALIDATOR.validate(o);if(!s.error)return s.content;n=s.error.message}catch(o){n=XQi.ErrorUtils.toString(XQi.ErrorUtils.fromUnknown(o))}this._telemetryService.sendMSFTTelemetryEvent("incorrectNesModelConfig",{configName:r.id,errorMessage:n,configValue:e})}};xN.InlineEditsModelService=F4r;xN.InlineEditsModelService=F4r=_3e=rqi([DV(0,jRc.ICopilotTokenStore),DV(1,$Rc.IProxyModelsService),DV(2,zRc.IUndesiredModelsManager),DV(3,IN.IConfigurationService),DV(4,VRc.IExperimentationService),DV(5,WRc.ITelemetryService),DV(6,GRc.ILogService)],F4r);function B4r(t){let{source:e,...r}=t;return r}a(B4r,"toModelConfiguration");var tqi;(function(t){let e="copilot.chat.nextEdits.undesiredModelIds",r=class extends oqi.Disposable{static{a(this,"Manager")}constructor(o){super(),this._vscodeExtensionContext=o,this._onDidChange=this._register(new iqi.Emitter),this.onDidChange=this._onDidChange.event,this._queue=new nqi.TaskQueue}isUndesiredModelId(o){return this._getModels().includes(o)}addUndesiredModelId(o){return this._queue.schedule(async()=>{let s=this._getModels();s.includes(o)||(s.push(o),await this._setModels(s),this._onDidChange.fire())})}removeUndesiredModelId(o){return this._queue.schedule(async()=>{let s=this._getModels(),c=s.indexOf(o);c!==-1&&(s.splice(c,1),await this._setModels(s),this._onDidChange.fire())})}_getModels(){return this._vscodeExtensionContext.globalState.get(e)??[]}_setModels(o){return new Promise((s,c)=>{this._vscodeExtensionContext.globalState.update(e,o).then(s,c)})}};r=rqi([DV(0,HRc.IVSCodeExtensionContext)],r),t.Manager=r})(tqi||(xN.UndesiredModels=tqi={}))});var aqi=I(T1t=>{"use strict";p();Object.defineProperty(T1t,"__esModule",{value:!0});T1t.NullLanguageContextProviderService=void 0;var YRc=Ro(),U4r=class{static{a(this,"NullLanguageContextProviderService")}registerContextProvider(e,r){return YRc.Disposable.None}getAllProviders(){return[]}getContextProviders(e){return[]}getContextItems(e,r,n){return{[Symbol.asyncIterator]:async function*(){}}}getContextItemsOnTimeout(e,r){return[]}};T1t.NullLanguageContextProviderService=U4r});var cqi=I(I1t=>{"use strict";p();Object.defineProperty(I1t,"__esModule",{value:!0});I1t.TestLanguageDiagnosticsService=void 0;var KRc=Rc(),JRc=r2(),ZRc=F$(),Q4r=class extends ZRc.AbstractLanguageDiagnosticsService{static{a(this,"TestLanguageDiagnosticsService")}constructor(){super(...arguments),this.diagnosticsMap=new JRc.ResourceMap,this._onDidChangeDiagnostics=new KRc.Emitter,this.onDidChangeDiagnostics=this._onDidChangeDiagnostics.event}setDiagnostics(e,r){this.diagnosticsMap.set(e,r),this._onDidChangeDiagnostics.fire({uris:[e]})}getDiagnostics(e){return this.diagnosticsMap.get(e)||[]}getAllDiagnostics(){return Array.from(this.diagnosticsMap.entries())}};I1t.TestLanguageDiagnosticsService=Q4r});var lqi=I(w1t=>{"use strict";p();Object.defineProperty(w1t,"__esModule",{value:!0});w1t.ResponseStream=void 0;var XRc=nv(),x1t=yw(),ekc=nl(),tkc=nT(),q4r=class t{static{a(this,"ResponseStream")}constructor(e,r,n,o){this.fetcherResponse=e,this.requestId=n,this.headers=o;let s=new ekc.DeferredPromise;this.aggregatedStream=s.p,this.response=this.aggregatedStream.then(c=>{if(c.isError())return c;try{return x1t.Result.ok(t.aggregateCompletionsStream(c.val))}catch(l){return x1t.Result.error(l)}}),this.stream=rkc(r,s)}async destroy(){await this.fetcherResponse.body.destroy()}static aggregateCompletionsStream(e){let r="",n=null,o=null,s;for(let d of e){let f=d.choices[0];r+=f.text??"",f.logprobs&&(o===null?o={tokens:[...f.logprobs.tokens],token_logprobs:[...f.logprobs.token_logprobs],text_offset:[...f.logprobs.text_offset],top_logprobs:[...f.logprobs.top_logprobs]}:(o.tokens.push(...f.logprobs.tokens),o.token_logprobs.push(...f.logprobs.token_logprobs),o.text_offset.push(...f.logprobs.text_offset),o.top_logprobs.push(...f.logprobs.top_logprobs))),d.usage&&(s===void 0?s={completion_tokens:d.usage.completion_tokens,prompt_tokens:d.usage.prompt_tokens,total_tokens:d.usage.total_tokens,completion_tokens_details:{audio_tokens:d.usage.completion_tokens_details.audio_tokens,reasoning_tokens:d.usage.completion_tokens_details.reasoning_tokens},prompt_tokens_details:{audio_tokens:d.usage.prompt_tokens_details.audio_tokens,reasoning_tokens:d.usage.prompt_tokens_details.reasoning_tokens}}:(s.completion_tokens+=d.usage.completion_tokens,s.prompt_tokens+=d.usage.prompt_tokens,s.total_tokens+=d.usage.total_tokens,s.completion_tokens_details.audio_tokens+=d.usage.completion_tokens_details.audio_tokens,s.completion_tokens_details.reasoning_tokens+=d.usage.completion_tokens_details.reasoning_tokens,s.prompt_tokens_details.audio_tokens+=d.usage.prompt_tokens_details.audio_tokens,s.prompt_tokens_details.reasoning_tokens+=d.usage.prompt_tokens_details.reasoning_tokens)),f.finish_reason&&((0,tkc.assertType)(n===null,"cannot already have finishReason if just seeing choice.finish_reason"),n=f.finish_reason)}if(e.length===0)throw new Error("Response is empty!");let c=e[0];return{choices:[{index:0,finish_reason:n,logprobs:o,text:r}],system_fingerprint:c.system_fingerprint,object:c.object,usage:s}}};w1t.ResponseStream=q4r;async function*rkc(t,e){let r=[],n;try{for await(let o of t)r.push(o),yield o}catch(o){throw n=XRc.ErrorUtils.fromUnknown(o),n}finally{e.complete(n?x1t.Result.error(n):x1t.Result.ok(r))}}a(rkc,"streamWithAggregation")});var uqi=I(j4r=>{"use strict";p();Object.defineProperty(j4r,"__esModule",{value:!0});j4r.jsonlStreamToCompletions=nkc;async function*nkc(t){for await(let e of t)if(e.trim()!=="data: [DONE]"&&e.startsWith("data: ")){let r=JSON.parse(e.substring(6));if(r.error)throw new Error(r.error.message);yield r}}a(nkc,"jsonlStreamToCompletions")});var fqi=I(T9=>{"use strict";p();var ikc=T9&&T9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},H4r=T9&&T9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(T9,"__esModule",{value:!0});T9.CompletionsFetchService=void 0;var okc=f5r(),dqi=nv(),lie=yw(),skc=J0r(),akc=HE(),ckc=i9(),lkc=Sy(),ukc=Tye(),NV=V_t(),dkc=lqi(),fkc=uqi(),G4r=class{static{a(this,"CompletionsFetchService")}constructor(e,r,n){this.authService=e,this.fetcherService=r,this.requestLogger=n}disconnectAll(){return this.fetcherService.disconnectAll()}async fetch(e,r,n,o,s,c){let l=Date.now();if(s.isCancellationRequested){let f=lie.Result.error(new NV.Completions.RequestCancelled);return this._logCompletionsRequest(e,n,o,l,f),f}let u={requestId:o,headers:this.getHeaders(o,r,c),body:JSON.stringify({...n,stream:!0})},d=await this._fetchFromUrl(e,u,s);if(d.isError())return this._logCompletionsRequest(e,n,o,l,d),d;if(d.val.status===200){let f=okc.AsyncIterUtilsExt.splitLines(d.val.body),h=(0,fkc.jsonlStreamToCompletions)(f),m=new dkc.ResponseStream(d.val.response,h,d.val.requestId,d.val.headers),g=lie.Result.ok(m);return this._logCompletionsRequest(e,n,o,l,g),g}else{let f=new NV.Completions.UnsuccessfulResponse(d.val.status,d.val.statusText,d.val.headers,()=>hkc(d.val.body).catch(()=>"")),h=lie.Result.error(f);return this._logCompletionsRequest(e,n,o,l,h),h}}async _fetchFromUrl(e,r,n){let o=this.fetcherService.makeAbortController(),s=n.onCancellationRequested(()=>{o.abort()});try{let c={headers:r.headers,body:r.body,signal:o.signal,method:"POST",callSite:"nes-completions"},l=await this.fetcherService.fetch(e,c);if(l.status===200&&this.authService.copilotToken?.isFreeUser&&this.authService.copilotToken?.isChatQuotaExceeded&&this.authService.resetCopilotToken(),l.status!==200)return l.status===402&&(this.authService.copilotToken?.isCompletionsQuotaExceeded||(this.authService.resetCopilotToken(l.status),await this.authService.getCopilotToken())),lie.Result.error(new NV.Completions.UnsuccessfulResponse(l.status,l.statusText,l.headers,()=>l.text().catch(()=>"")));let u=l.body.pipeThrough(new TextDecoderStream),d=pkc(u,s);return lie.Result.ok({status:l.status,statusText:l.statusText,headers:l.headers,body:d,requestId:(0,ckc.getRequestId)(l.headers),response:l})}catch(c){if(s.dispose(),c instanceof Error&&c.message==="This operation was aborted")return lie.Result.error(new NV.Completions.RequestCancelled);let l=dqi.ErrorUtils.fromUnknown(c);return lie.Result.error(new NV.Completions.Unexpected(l))}}_logCompletionsRequest(e,r,n,o,s){if(s.isOk())s.val.response.then(l=>{let u=l.isOk()?"success":"failed";this._emitCompletionsLogEntry(e,r,n,o,u,l)});else{let c=s.err;c instanceof NV.Completions.RequestCancelled?this._emitCompletionsLogEntry(e,r,n,o,"cancelled",void 0):c instanceof NV.Completions.UnsuccessfulResponse?this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,`${c.status} ${c.statusText}`):c instanceof NV.Completions.Unexpected&&this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,c.error.message)}}_emitCompletionsLogEntry(e,r,n,o,s,c,l){let u=Date.now()-o,d=[];if(d.push("> \u{1F6A8} Note: This log may contain personal information such as the contents of your files. Please review the contents carefully before sharing."),d.push("# completions"),d.push(""),d.push("- [Metadata](#metadata)"),d.push("- [Prompt](#prompt)"),r.suffix&&d.push("- [Suffix](#suffix)"),d.push("- [Response](#response)"),d.push(""),d.push("## Metadata"),d.push("
"),d.push(`url              : ${e}`),d.push(`requestId        : ${n}`),d.push(`model            : ${r.model??"(default)"}`),d.push(`maxTokens        : ${r.max_tokens}`),d.push(`temperature      : ${r.temperature}`),d.push(`top_p            : ${r.top_p}`),d.push(`n                : ${r.n}`),d.push(`duration         : ${u}ms`),d.push("
"),d.push(""),d.push("## Prompt"),d.push("~~~"),d.push(r.prompt),d.push("~~~"),r.suffix&&(d.push(""),d.push("## Suffix"),d.push("~~~"),d.push(r.suffix),d.push("~~~")),d.push(""),d.push("## Response"),s==="cancelled")d.push("## CANCELED");else if(s==="failed")d.push(`## FAILED: ${l}`);else if(c)if(c.isOk()){let h=c.val,m=h.choices[0]?.text??"",g=h.choices[0]?.finish_reason??"unknown";d.push("~~~"),d.push(m||""),d.push("~~~"),d.push(""),d.push("
"),d.push(`finishReason     : ${g}`),h.usage&&(d.push(`promptTokens     : ${h.usage.prompt_tokens}`),d.push(`completionTokens : ${h.usage.completion_tokens}`),d.push(`totalTokens      : ${h.usage.total_tokens}`)),d.push("
")}else d.push(`## FAILED: stream error - ${c.err.message}`);let f=s==="success"?void 0:skc.Codicon.error;this.requestLogger.addEntry({type:"MarkdownContentRequest",debugName:"Completions Request",startTimeMs:o,icon:f,markdownContent:d.join(` +`)})}getHeaders(e,r,n={}){return{"Content-Type":"application/json","x-policy-id":"nil",Authorization:"Bearer "+r,"X-Request-Id":e,"X-GitHub-Api-Version":"2025-04-01",...n}}};T9.CompletionsFetchService=G4r;T9.CompletionsFetchService=G4r=ikc([H4r(0,akc.IAuthenticationService),H4r(1,lkc.IFetcherService),H4r(2,ukc.IRequestLogger)],G4r);async function*pkc(t,e){try{for await(let r of t)yield r}catch(r){throw dqi.ErrorUtils.fromUnknown(r)}finally{e.dispose()}}a(pkc,"streamWithCleanup");async function hkc(t){let e=[];for await(let r of t)e.push(r);return e.join("")}a(hkc,"collectAsyncIterableToString")});var hqi=I(R1t=>{"use strict";p();Object.defineProperty(R1t,"__esModule",{value:!0});R1t.WireTypes=void 0;var MV=jG(),pqi;(function(t){let e;(function(o){function s(c){return!!c&&typeof c=="object"&&typeof c.promptStrategy=="string"}a(s,"is"),o.is=s,o.validator=(0,MV.vObj)({promptStrategy:(0,MV.vString)()})})(e=t.Capabilities||(t.Capabilities={}));let r;(function(o){o.validator=(0,MV.vObj)({serviceType:(0,MV.vString)(),name:(0,MV.vString)(),provider:(0,MV.vString)(),capabilities:e.validator});function s(c){return!!c&&typeof c=="object"&&typeof c.serviceType=="string"&&typeof c.name=="string"&&typeof c.provider=="string"&&e.is(c.capabilities)}a(s,"is"),o.is=s})(r=t.Model||(t.Model={}));let n;(function(o){o.validator=(0,MV.vObj)({models:(0,MV.vArray)(r.validator)});function s(c){return!!c&&typeof c=="object"&&Array.isArray(c.models)&&c.models.every(r.is)}a(s,"is"),o.is=s})(n=t.ModelList||(t.ModelList={}))})(pqi||(R1t.WireTypes=pqi={}))});var gqi=I(I9=>{"use strict";p();var mkc=I9&&I9.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},k1t=I9&&I9.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(I9,"__esModule",{value:!0});I9.ProxyModelsService=void 0;var gkc=require("util"),$4r=nv(),Akc=n2(),ykc=Rc(),Ekc=Ro(),mqi=tD(),_kc=uG(),vkc=KE(),Ckc=hqi(),bkc=xp(),Skc=Sy(),V4r=class extends Ekc.Disposable{static{a(this,"ProxyModelsService")}constructor(e,r,n,o){super(),this._tokenStore=e,this._capiClient=r,this._fetchService=n,this._logService=o,this._onModelListUpdated=this._register(new ykc.Emitter),this.onModelListUpdated=this._onModelListUpdated.event;let s=(0,mqi.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken);this._register((0,mqi.autorun)(c=>{let l=s.read(c),u=new Akc.CancellationTokenSource;this._fetchLatestModels(l,u.token).then(d=>{d!==void 0&&(u.token.isCancellationRequested||(0,gkc.isDeepStrictEqual)(this._models,d)||(this._models=d,this._onModelListUpdated.fire()))}).catch(d=>{let f=$4r.ErrorUtils.fromUnknown(d);this._logService.error(f,"Failed to fetch models in autorun")}),c.store.add({dispose:a(()=>u.dispose(!0),"dispose")})}))}get models(){return this._models}get nesModels(){return this._models?.models.filter(e=>e.serviceType==="NESChat")}get cursorJumpModels(){return this._models?.models.filter(e=>e.serviceType==="CursorJumpChat")}get instantApplyModels(){return this._models?.models.filter(e=>e.serviceType==="InstantApplyChat")}async _fetchLatestModels(e,r){if(!e)return;let n=`${this._capiClient.proxyBaseURL}/models`,o=this._fetchService.makeAbortController(),s=r.onCancellationRequested(()=>o.abort()),c;try{c=await this._fetchService.fetch(n,{headers:{Authorization:`Bearer ${e.token}`},method:"GET",timeout:1e4,callSite:"proxy-models",signal:o.signal})}catch(l){let u=$4r.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to fetch model list");return}finally{s.dispose()}if(!c.ok){this._logService.error(`Failed to fetch model list: ${c.status} ${c.statusText}`);return}try{let l=await c.json(),u=Ckc.WireTypes.ModelList.validator.validate(l);if(u.error)throw new Error(`Invalid /models response data: ${u.error.message}`);return u.content}catch(l){let u=$4r.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to process /models response");return}}};I9.ProxyModelsService=V4r;I9.ProxyModelsService=V4r=mkc([k1t(0,_kc.ICopilotTokenStore),k1t(1,vkc.ICAPIClientService),k1t(2,Skc.IFetcherService),k1t(3,bkc.ILogService)],V4r)});var Aqi=I(P1t=>{"use strict";p();Object.defineProperty(P1t,"__esModule",{value:!0});P1t.NullRequestLogger=void 0;var Tkc=aOr(),Ikc=Rc(),W4r=class extends Tkc.AbstractRequestLogger{static{a(this,"NullRequestLogger")}constructor(){super(...arguments),this.onDidChangeRequests=Ikc.Event.None}addPromptTrace(){}addEntry(e){}getRequests(){return[]}getRequestById(e){}logModelListCall(e,r,n){}logToolCall(e,r,n,o){}};P1t.NullRequestLogger=W4r});var L1t=I(tu=>{"use strict";p();var rLr=tu&&tu.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},wN=tu&&tu.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(tu,"__esModule",{value:!0});tu.SimpleExperimentationService=tu.LogLevel=tu.TokenizerName=tu.ILanguageContextProviderService=tu.IIgnoreService=tu.IExperimentationService=tu.IEndpointProvider=tu.ICAPIClientService=tu.IAuthenticationService=void 0;tu.createNESProvider=EPc;tu.createInlineCompletionsProvider=vPc;var xkc=nai(),yqi=Dte(),Eqi=Zxi(),_qi=tAe(),wkc=qgt(),vqi=PTr(),Rkc=DTr(),zv=qE(),Cqi=FTr(),kkc=VDi(),Pkc=gy(),bqi=RIr(),Dkc=g$(),Sqi=OIr(),Tqi=H4e(),Iqi=txr(),xqi=nxr(),wqi=v2r(),Y4r=Lyt(),Nkc=w3i(),Mkc=R3i(),v3e=Dl(),Okc=fye(),Lkc=OTr(),Rqi=eDr(),kqi=cIr(),Pqi=H_t(),Dqi=tPr(),Nqi=xEt(),C3e=IEt(),Mqi=M$(),Oqi=QEt(),Bkc=N3i(),Fkc=BEt(),Lqi=XCr(),Bqi=l1(),Fqi=H5e(),Uqi=dne(),Kqi=Gre();Object.defineProperty(tu,"TokenizerName",{enumerable:!0,get:a(function(){return Kqi.TokenizerName},"get")});var Ukc=W3i(),Qkc=$Fi(),K4r=h8i(),Qqi=DNr(),qkc=Z9i(),qqi=COr(),jkc=oQi(),nLr=HE();Object.defineProperty(tu,"IAuthenticationService",{enumerable:!0,get:a(function(){return nLr.IAuthenticationService},"get")});var Hkc=j5e(),jqi=uG(),Gkc=sQi(),$kc=EQi(),Vkc=l9(),Wkc=ONr(),zkc=_Qi(),Ykc=LNr(),Hqi=FNr(),OL=Pl(),Kkc=CQi(),Jkc=bOr(),Zkc=wQi(),iLr=KE();Object.defineProperty(tu,"ICAPIClientService",{enumerable:!0,get:a(function(){return iLr.ICAPIClientService},"get")});var Xkc=lV(),oLr=R4e();Object.defineProperty(tu,"IEndpointProvider",{enumerable:!0,get:a(function(){return oLr.IEndpointProvider},"get")});var Jqi=kQi(),ePc=DQi(),uie=H4(),tPc=NQi(),rPc=E4r(),Zqi=MQi(),b3e=Vre();Object.defineProperty(tu,"IIgnoreService",{enumerable:!0,get:a(function(){return b3e.IIgnoreService},"get")});var nPc=tie(),iPc=dpt(),z4r=rbt(),oPc=OQi(),sPc=zQi(),aPc=JQi(),cPc=sqi(),sLr=bEt();Object.defineProperty(tu,"ILanguageContextProviderService",{enumerable:!0,get:a(function(){return sLr.ILanguageContextProviderService},"get")});var Xqi=aqi(),eji=F$(),tji=cqi(),RN=xp(),lPc=V_t(),uPc=fqi(),aLr=Sy(),Gqi=f9(),dPc=rOr(),fPc=nOr(),pPc=GCt(),hPc=Qbt(),mPc=gqi(),rji=Tye(),nji=Aqi(),$qi=DOr(),Vqi=ODr(),T3e=yh();Object.defineProperty(tu,"IExperimentationService",{enumerable:!0,get:a(function(){return T3e.IExperimentationService},"get")});var iji=vm(),Wqi=qye(),gPc=ECr(),zqi=Nbt(),Yqi=cV(),J4r=a5r(),oji=nn(),APc=n2(),S3e=Rc(),O1t=Ro(),yPc=x0(),gi=rpt(),sji=$s(),die;(function(t){t[t.Off=0]="Off",t[t.Trace=1]="Trace",t[t.Debug=2]="Debug",t[t.Info=3]="Info",t[t.Warning=4]="Warning",t[t.Error=5]="Error"})(die||(tu.LogLevel=die={}));function EPc(t){return _Pc(t).createInstance(Z4r,t)}a(EPc,"createNESProvider");var Z4r=class extends O1t.Disposable{static{a(this,"NESProvider")}constructor(e,r,n,o,s){super(),this._options=e,this._expService=n,this._configurationService=o,this._workspaceService=s;let c=r.createInstance(jkc.XtabProvider),l=r.createInstance(oPc.ObservableGit),u=new sPc.NesHistoryContextProvider(this._options.workspace,l),d=this._configurationService.getExperimentBasedConfig(OL.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this._expService),f=new aPc.NesXtabHistoryTracker(this._options.workspace,d,o,n);this._debugRecorder=this._register(new Ukc.DebugRecorder(this._options.workspace)),this._nextEditProvider=r.createInstance(Qkc.NextEditProvider,this._options.workspace,c,u,f,this._debugRecorder),this._telemetrySender=this._register(r.createInstance(K4r.TelemetrySender,this._options.workspace))}getId(){return this._nextEditProvider.ID}handleShown(e){e.telemetryBuilder.setAsShown(),this._nextEditProvider.handleShown(e.internalResult)}handleAcceptance(e){e.telemetryBuilder.setAcceptance("accepted"),e.telemetryBuilder.setStatus("accepted"),this._nextEditProvider.handleAcceptance(e.docId,e.internalResult),this.handleEndOfLifetime(e)}handleRejection(e){e.telemetryBuilder.setAcceptance("rejected"),e.telemetryBuilder.setStatus("rejected"),this._nextEditProvider.handleRejection(e.docId,e.internalResult),this.handleEndOfLifetime(e)}handleIgnored(e,r){r&&e.telemetryBuilder.setSupersededBy(r.requestUuid),this._nextEditProvider.handleIgnored(e.docId,e.internalResult,r?.internalResult),this.handleEndOfLifetime(e)}handleEndOfLifetime(e){try{this._telemetrySender.sendTelemetryForBuilder(e.telemetryBuilder)}finally{e.telemetryBuilder.dispose()}}async getNextEdit(e,r){let n=nPc.DocumentId.create(e.toString()),o={triggerKind:1,selectedCompletionInfo:void 0,requestUuid:(0,yPc.generateUuid)(),requestIssuedDateTime:Date.now(),earliestShownDateTime:Date.now()+200,enforceCacheDelay:!0},s=new iPc.InlineEditRequestLogContext(e.toString(),1,o),c=this._options.workspace.getDocument(n);if(!c)throw new Error("DocumentNotFound");let l=new K4r.NextEditProviderTelemetryBuilder(new Zqi.NullGitExtensionService,void 0,this._workspaceService,this._nextEditProvider.ID,c,this._debugRecorder,s.recordingBookmark);l.setOpportunityId(o.requestUuid);try{let u=await this._nextEditProvider.getNextEdit(n,o,s,r,l.nesBuilder);return{result:u.result?.edit?{newText:u.result.edit.newText,range:u.result.edit.replaceRange,...u.result.targetDocumentId?{targetDocumentUri:u.result.targetDocumentId.uri}:{}}:void 0,docId:n,requestUuid:o.requestUuid,internalResult:u,telemetryBuilder:l}}catch(u){try{this._telemetrySender.sendTelemetryForBuilder(l)}finally{l.dispose()}throw u}}updateTreatmentVariables(e){this._expService instanceof fie&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=OL.globalConfigRegistry.configs.get(`${OL.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}}};Z4r=rLr([wN(1,sji.IInstantiationService),wN(2,T3e.IExperimentationService),wN(3,OL.IConfigurationService),wN(4,J4r.IWorkspaceService)],Z4r);function _Pc(t){let{fetcher:e,copilotTokenManager:r,telemetrySender:n,logTarget:o}=t,s=new oji.InstantiationServiceBuilder;s.define(OL.IConfigurationService,new gi.SyncDescriptor(D1t,[t.configOverrides??new Map])),s.define(T3e.IExperimentationService,new gi.SyncDescriptor(fie,[t.waitForTreatmentVariables])),s.define($qi.ISimulationTestContext,new gi.SyncDescriptor($qi.NulSimulationTestContext)),s.define(J4r.IWorkspaceService,new gi.SyncDescriptor(J4r.NullWorkspaceService)),s.define(Jkc.IDiffService,new gi.SyncDescriptor(Zkc.DiffServiceImpl,[!1])),s.define(RN.ILogService,new gi.SyncDescriptor(RN.LogServiceImpl,[[o||new RN.ConsoleLog(void 0,RN.LogLevel.Trace)]])),s.define(rPc.IGitExtensionService,new gi.SyncDescriptor(Zqi.NullGitExtensionService)),s.define(sLr.ILanguageContextProviderService,new gi.SyncDescriptor(Xqi.NullLanguageContextProviderService)),s.define(eji.ILanguageDiagnosticsService,t.languageDiagnosticsService||new gi.SyncDescriptor(tji.TestLanguageDiagnosticsService)),s.define(b3e.IIgnoreService,new gi.SyncDescriptor(b3e.NullIgnoreService)),s.define(Vqi.ISnippyService,new gi.SyncDescriptor(Vqi.NullSnippyService)),s.define(Xkc.IDomainService,new gi.SyncDescriptor(ePc.DomainService)),s.define(iLr.ICAPIClientService,new gi.SyncDescriptor(Jqi.CAPIClientImpl)),s.define(jqi.ICopilotTokenStore,new gi.SyncDescriptor(jqi.CopilotTokenStore)),s.define(uie.IEnvService,new gi.SyncDescriptor(tPc.NullEnvService)),s.define(aLr.IFetcherService,new gi.SyncDescriptor(N1t,[e])),s.define(iji.ITelemetryService,new gi.SyncDescriptor(M1t,[n])),s.define(nLr.IAuthenticationService,new gi.SyncDescriptor(Gkc.StaticGitHubAuthenticationService,[(0,$kc.createStaticGitHubTokenProvider)()])),s.define(Hkc.ICopilotTokenManager,r),s.define(Qqi.IPowerService,new gi.SyncDescriptor(Qqi.NullPowerService)),s.define(Vkc.IChatMLFetcher,new gi.SyncDescriptor(qkc.ChatMLFetcherImpl)),s.define(Gqi.IChatWebSocketManager,new gi.SyncDescriptor(Gqi.NullChatWebSocketManager)),s.define(pPc.IOTelService,new dPc.NoopOTelService((0,fPc.resolveOTelConfig)({env:{},extensionVersion:"0.0.0",sessionId:"chatlib"}))),s.define(Wkc.IChatQuotaService,new gi.SyncDescriptor(zkc.ChatQuotaService)),s.define(Hqi.IInteractionService,new gi.SyncDescriptor(Hqi.InteractionService)),s.define(rji.IRequestLogger,new gi.SyncDescriptor(nji.NullRequestLogger)),s.define(Yqi.ITokenizerProvider,t.tokenizerProvider??new gi.SyncDescriptor(Yqi.TokenizerProvider,[!1])),s.define(Ykc.IConversationOptions,{_serviceBrand:void 0,maxResponseTokens:void 0,temperature:.1,topP:1,rejectionMessage:"Sorry, but I can only assist with programming related questions."}),s.define(hPc.IProxyModelsService,new gi.SyncDescriptor(mPc.ProxyModelsService)),s.define(z4r.IInlineEditsModelService,new gi.SyncDescriptor(cPc.InlineEditsModelService)),s.define(z4r.IUndesiredModelsManager,t.undesiredModelsManager||new gi.SyncDescriptor(z4r.NullUndesiredModelsManager)),s.define(zqi.ITerminalService,t.terminalService||new gi.SyncDescriptor(zqi.NullTerminalService)),s.define(qqi.ISimilarFilesContextService,new gi.SyncDescriptor(qqi.NullSimilarFilesContextService)),s.define(oLr.IEndpointProvider,new X4r);let c=new zv.InMemoryConfigProvider(new zv.DefaultsOnlyConfigProvider);return t.configOverrides&&c.setOverrides(t.configOverrides),s.define(zv.ICompletionsConfigProvider,c),s.seal()}a(_Pc,"setupServices");var D1t=class extends Kkc.DefaultsOnlyConfigurationService{static{a(this,"OverridableConfigurationService")}constructor(e){super(),this._overrides=e}async setConfig(e,r,n){if(this._overrides.get(e.id)===r)return;r===void 0?this._overrides.delete(e.id):this._overrides.set(e.id,r);let s=e.fullyQualifiedId;this._onDidChangeConfiguration.fire({affectsConfiguration:a(c=>s===c||s.startsWith(c+".")||c.startsWith(s+"."),"affectsConfiguration")})}getConfig(e){if(this._overrides.has(e.id)){let r=this._overrides.get(e.id);if(e.validator){let n=e.validator.validate(r);return n.error?super.getConfig(e):n.content}return r}return super.getConfig(e)}getExperimentBasedConfig(e,r){if(this._overrides.has(e.id)){let n=this._overrides.get(e.id);if(e.validator){let o=e.validator.validate(n);return o.error?super.getExperimentBasedConfig(e,r):o.content}return n}return super.getExperimentBasedConfig(e,r)}inspectConfig(e){if(this._overrides.has(e.id)){let r=this._overrides.get(e.id);if(e.validator){let n=e.validator.validate(r);return n.error?super.inspectConfig(e):{defaultValue:n.content}}return{defaultValue:r}}return super.inspectConfig(e)}},X4r=class{static{a(this,"NullEndpointProvider")}constructor(){this.onDidModelsRefresh=S3e.Event.None}async getAllCompletionModels(){return[]}async getAllChatEndpoints(){return[]}async getChatEndpoint(){throw new Error("not implemented")}async getEmbeddingsEndpoint(){throw new Error("not implemented")}},fie=class extends O1t.Disposable{static{a(this,"SimpleExperimentationService")}constructor(e,r){if(super(),this._configurationService=r,this.variables={},this._onDidTreatmentsChange=this._register(new S3e.Emitter),this.onDidTreatmentsChange=this._onDidTreatmentsChange.event,e){let n;this.waitFor=new Promise(o=>{n=o}),this.resolveWaitFor=n}else this.waitFor=Promise.resolve(),this.resolveWaitFor=()=>{}}async hasTreatments(){return this.waitFor}getTreatmentVariable(e){return this.variables[e]}async setCompletionsFilters(e){}updateTreatmentVariables(e){let r=[];for(let[n,o]of Object.entries(e))this.variables[n]!==o&&(this.variables[n]=o,r.push(n));for(let n of Object.keys(this.variables))Object.hasOwn(e,n)||(delete this.variables[n],r.push(n));r.length>0&&(this._onDidTreatmentsChange.fire({affectedTreatmentVariables:r}),this._configurationService.updateExperimentBasedConfiguration(r)),this.resolveWaitFor()}};tu.SimpleExperimentationService=fie;tu.SimpleExperimentationService=fie=rLr([wN(1,OL.IConfigurationService)],fie);var N1t=class{static{a(this,"SingleFetcherService")}constructor(e){this._fetcher=e,this.onDidFetch=S3e.Event.None,this.onDidCompleteFetch=S3e.Event.None}fetchWithPagination(e,r){return this._fetcher.fetchWithPagination(e,r)}getUserAgentLibrary(){return this._fetcher.getUserAgentLibrary()}fetch(e,r){return this._fetcher.fetch(e,r)}createWebSocket(e,r){return{webSocket:new WebSocket(e,r),responseHeaders:new aLr.HeadersImpl({}),responseStatusCode:void 0,responseStatusText:void 0,networkError:void 0}}disconnectAll(){return this._fetcher.disconnectAll()}makeAbortController(){return this._fetcher.makeAbortController()}isAbortError(e){return this._fetcher.isAbortError(e)}isInternetDisconnectedError(e){return this._fetcher.isInternetDisconnectedError(e)}isFetcherError(e){return this._fetcher.isFetcherError(e)}isNetworkProcessCrashedError(e){return this._fetcher.isNetworkProcessCrashedError(e)}getUserMessageForFetcherError(e){return this._fetcher.getUserMessageForFetcherError(e)}},M1t=class{static{a(this,"SimpleTelemetryService")}constructor(e){this._telemetrySender=e}dispose(){}sendInternalMSFTTelemetryEvent(e,r,n){}sendMSFTTelemetryEvent(e,r,n){}sendMSFTTelemetryErrorEvent(e,r,n){}sendGHTelemetryEvent(e,r,n){this._telemetrySender.sendTelemetryEvent(e,(0,Wqi.eventPropertiesToSimpleObject)(r),n)}sendGHTelemetryErrorEvent(e,r,n){}sendGHTelemetryException(e,r){}sendTelemetryEvent(e,r,n,o){}sendTelemetryErrorEvent(e,r,n,o){}setSharedProperty(e,r){}setAdditionalExpAssignments(e){}postEvent(e,r){}sendEnhancedGHTelemetryEvent(e,r,n){this._telemetrySender.sendEnhancedTelemetryEvent&&this._telemetrySender.sendEnhancedTelemetryEvent(e,(0,Wqi.eventPropertiesToSimpleObject)(r),n)}sendEnhancedGHTelemetryErrorEvent(e,r,n){}};function vPc(t){return t.tokenizerProvider&&(0,Kqi.setExternalTokenizerProvider)(t.tokenizerProvider),CPc(t).createInstance(eLr)}a(vPc,"createInlineCompletionsProvider");var eLr=class extends O1t.Disposable{static{a(this,"InlineCompletionsProvider")}constructor(e,r,n,o,s,c){super(),this._insta=e,this._expService=r,this._speculativeRequestCache=n,this._logService=o,this._configurationService=s,this._completionsConfigProvider=c,this._register(e),this.ghostText=this._insta.createInstance(Nkc.GhostText)}updateTreatmentVariables(e){this._expService instanceof fie&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=OL.globalConfigRegistry.configs.get(`${OL.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}this._completionsConfigProvider instanceof zv.InMemoryConfigProvider&&this._completionsConfigProvider.setCopilotSettings(Object.fromEntries(e))}async getInlineCompletions(e,r,n,o){let s=new K4r.LlmNESTelemetryBuilder(void 0,void 0,void 0,"ghostText",void 0);return await this.ghostText.getInlineCompletions(e,r,n??APc.CancellationToken.None,o,new xkc.GhostTextLogContext(e.uri,e.version,void 0),s,this._logService)}async inlineCompletionShown(e){return await this._speculativeRequestCache.request(e)}};eLr=rLr([wN(0,sji.IInstantiationService),wN(1,T3e.IExperimentationService),wN(2,Y4r.ICompletionsSpeculativeRequestCache),wN(3,RN.ILogService),wN(4,OL.IConfigurationService),wN(5,zv.ICompletionsConfigProvider)],eLr);var tLr=class{static{a(this,"UnwrappingTelemetrySender")}constructor(e){this.sender=e}sendTelemetryEvent(e,r,n){this.sender.sendTelemetryEvent(this.normalizeEventName(e),r,n)}sendEnhancedTelemetryEvent(e,r,n){this.sender.sendEnhancedTelemetryEvent&&this.sender.sendEnhancedTelemetryEvent(this.normalizeEventName(e),r,n)}normalizeEventName(e){let r=(0,gPc.unwrapEventNameFromPrefix)(e),n=r.match(/^[^/]+\/(.*)/);return n?n[1]:r}};function CPc(t){let{fetcher:e,authService:r,statusHandler:n,documentManager:o,workspace:s,telemetrySender:c,urlOpener:l,editorSession:u}=t,d=t.logTarget||new RN.ConsoleLog(void 0,RN.LogLevel.Trace),f=new oji.InstantiationServiceBuilder;f.define(v3e.ICompletionsLogTargetService,new class{logIt(m,g,...A){d.logIt(this.toExternalLogLevel(m),g,...A)}toExternalLogLevel(m){switch(m){case v3e.LogLevel.DEBUG:return die.Debug;case v3e.LogLevel.INFO:return die.Info;case v3e.LogLevel.WARN:return die.Warning;case v3e.LogLevel.ERROR:return die.Error;default:return die.Info}}}),f.define(nLr.IAuthenticationService,r),f.define(RN.ILogService,new gi.SyncDescriptor(RN.LogServiceImpl,[[d||new RN.ConsoleLog(void 0,RN.LogLevel.Trace)]])),f.define(b3e.IIgnoreService,t.ignoreService||new b3e.NullIgnoreService),f.define(iji.ITelemetryService,new gi.SyncDescriptor(M1t,[new tLr(c)])),f.define(OL.IConfigurationService,new gi.SyncDescriptor(D1t,[t.configOverrides??new Map])),f.define(T3e.IExperimentationService,new gi.SyncDescriptor(fie,[t.waitForTreatmentVariables])),f.define(oLr.IEndpointProvider,t.endpointProvider),f.define(iLr.ICAPIClientService,t.capiClientService||new gi.SyncDescriptor(Jqi.CAPIClientImpl)),f.define(aLr.IFetcherService,new gi.SyncDescriptor(N1t,[e])),f.define(yqi.ICompletionsTelemetryService,new gi.SyncDescriptor(yqi.CompletionsTelemetryServiceBridge)),f.define(Uqi.ICompletionsRuntimeModeService,Uqi.RuntimeMode.fromEnvironment(t.isRunningInTest??!1)),f.define(Tqi.ICompletionsCacheService,new Tqi.CompletionsCache);let h=new zv.InMemoryConfigProvider(new zv.DefaultsOnlyConfigProvider);return t.configOverrides&&h.setOverrides(t.configOverrides),f.define(zv.ICompletionsConfigProvider,h),f.define(wqi.ICompletionsLastGhostText,new wqi.LastGhostText),f.define(xqi.ICompletionsCurrentGhostText,new xqi.CurrentGhostText),f.define(Y4r.ICompletionsSpeculativeRequestCache,new Y4r.SpeculativeRequestCache),f.define(Lkc.ICompletionsNotificationSender,new class{async showWarningMessage(m,...g){return await t.notificationSender.showWarningMessage(m,...g)}}),f.define(zv.ICompletionsEditorAndPluginInfo,new class{getEditorInfo(){return t.editorInfo}getEditorPluginInfo(){return t.editorPluginInfo}getRelatedPluginInfo(){return t.relatedPluginInfo}}),f.define(Eqi.ICompletionsExtensionStatus,new Eqi.CopilotExtensionStatus),f.define(Pkc.ICompletionsFeaturesService,new gi.SyncDescriptor(kkc.Features)),f.define(Rkc.ICompletionsObservableWorkspace,new class{get openDocuments(){return s.openDocuments}getWorkspaceRoot(m){return s.getWorkspaceRoot(m)}getFirstOpenDocument(){return s.getFirstOpenDocument()}getDocument(m){return s.getDocument(m)}}),f.define(Pqi.ICompletionsStatusReporter,new class extends Pqi.StatusReporter{didChange(m){n.didChange(m)}}),f.define(_qi.ICompletionsCopilotTokenManager,new gi.SyncDescriptor(_qi.CopilotTokenManagerImpl,[!1])),f.define(Bqi.ICompletionsTextDocumentManagerService,new gi.SyncDescriptor(class extends Bqi.TextDocumentManager{constructor(){super(...arguments),this.onDidChangeTextDocument=o.onDidChangeTextDocument,this.onDidOpenTextDocument=o.onDidOpenTextDocument,this.onDidCloseTextDocument=o.onDidCloseTextDocument,this.onDidFocusTextDocument=o.onDidFocusTextDocument,this.onDidChangeWorkspaceFolders=o.onDidChangeWorkspaceFolders}getTextDocumentsUnsafe(){return o.getTextDocumentsUnsafe()}findNotebook(m){return o.findNotebook(m)}getWorkspaceFolders(){return o.getWorkspaceFolders()}})),f.define(bqi.ICompletionsFileReaderService,new gi.SyncDescriptor(bqi.FileReader)),f.define(Iqi.ICompletionsBlockModeConfig,new gi.SyncDescriptor(Iqi.ConfigBlockModeConfig)),f.define(Lqi.ICompletionsTelemetryUserConfigService,new gi.SyncDescriptor(Lqi.TelemetryUserConfig)),f.define(Oqi.ICompletionsRecentEditsProviderService,new gi.SyncDescriptor(Oqi.FullRecentEditsProvider,[void 0])),f.define(vqi.ICompletionsNotifierService,new gi.SyncDescriptor(vqi.CompletionNotifier)),f.define(Rqi.ICompletionsOpenAIFetcherService,new gi.SyncDescriptor(Rqi.LiveOpenAIFetcher)),f.define(lPc.ICompletionsFetchService,new gi.SyncDescriptor(uPc.CompletionsFetchService)),f.define(kqi.ICompletionsModelManagerService,new gi.SyncDescriptor(kqi.AvailableModelsManager,[!0])),f.define(Sqi.ICompletionsAsyncManagerService,new gi.SyncDescriptor(Sqi.AsyncCompletionManager)),f.define(Nqi.ICompletionsContextProviderBridgeService,new gi.SyncDescriptor(Nqi.ContextProviderBridge)),f.define(Cqi.ICompletionsUserErrorNotifierService,new gi.SyncDescriptor(Cqi.UserErrorNotifier)),f.define(Fkc.ICompletionsRelatedFilesProviderService,new gi.SyncDescriptor(Bkc.CompositeRelatedFilesProvider)),f.define(Dkc.ICompletionsFileSystemService,new Mkc.LocalFileSystem),f.define(C3e.ICompletionsContextProviderRegistryService,new gi.SyncDescriptor(C3e.CachedContextProviderRegistry,[C3e.CoreContextProviderRegistry,(m,g,A)=>t.contextProviderMatch(g,A)])),f.define(Fqi.ICompletionsPromiseQueueService,new Fqi.PromiseQueue),f.define(wkc.ICompletionsCitationManager,new class{register(){return O1t.Disposable.None}async handleIPCodeCitation(m){if(t.citationHandler)return await t.citationHandler.handleIPCodeCitation(m)}}),f.define(Mqi.ICompletionsContextProviderService,new Mqi.ContextProviderStatistics),f.define(Dqi.ICompletionsPromptFactoryService,new gi.SyncDescriptor(Dqi.CompletionsPromptFactory)),f.define(Okc.ICompletionsFetcherService,new class{getImplementation(){return this}fetch(m,g){return e.fetch(m,g)}disconnectAll(){return e.disconnectAll()}}),f.define(C3e.ICompletionsDefaultContextProviders,new C3e.DefaultContextProvidersContainer),f.define(uie.IEnvService,new class{constructor(){this.language=void 0,this.sessionId=u.sessionId,this.machineId=u.machineId,this.devDeviceId=u.machineId,this.vscodeVersion=t.editorInfo.version,this.isActive=!0,this.onDidChangeWindowState=S3e.Event.None,this.remoteName=u.remoteName,this.uiKind=u.uiKind==="web"?"web":"desktop",this.OS=process.platform==="darwin"?uie.OperatingSystem.Macintosh:process.platform==="win32"?uie.OperatingSystem.Windows:uie.OperatingSystem.Linux,this.uriScheme="",this.extensionId=t.editorPluginInfo.name,this.appRoot=t.editorInfo.root??"",this.shell=""}isProduction(){return zv.BuildInfo.isProduction()}isPreRelease(){return zv.BuildInfo.isPreRelease()}isSimulation(){return t.isRunningInTest===!0}getBuildType(){return zv.BuildInfo.getBuildType()===zv.BuildType.DEV?"dev":"prod"}getVersion(){return zv.BuildInfo.getVersion()}getBuild(){return zv.BuildInfo.getBuild()}getName(){return t.editorInfo.name}getEditorInfo(){return new uie.NameAndVersion(t.editorInfo.name,t.editorInfo.version)}getEditorPluginInfo(){return new uie.NameAndVersion(t.editorPluginInfo.name,t.editorPluginInfo.version)}async openExternal(m){return await l.open(m.toString()),!0}}),f.define(sLr.ILanguageContextProviderService,t.languageContextProvider??new Xqi.NullLanguageContextProviderService),f.define(eji.ILanguageDiagnosticsService,t.languageDiagnosticsService||new gi.SyncDescriptor(tji.TestLanguageDiagnosticsService)),f.define(rji.IRequestLogger,new gi.SyncDescriptor(nji.NullRequestLogger)),f.seal()}a(CPc,"setupCompletionServices")});function Qt(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r}function Te(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}var x1=Se(()=>{p();a(Qt,"__classPrivateFieldSet");a(Te,"__classPrivateFieldGet")});var QEe,iSt=Se(()=>{p();QEe=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return QEe=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))},"uuid4")});function D9(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var M3e,qEe=Se(()=>{p();a(D9,"isAbortError");M3e=a(t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)},"castToError")});var fr,Th,Ry,LV,jEe,HEe,GEe,$Ee,VEe,WEe,zEe,YEe,KEe,jf=Se(()=>{p();qEe();fr=class extends Error{static{a(this,"AnthropicError")}},Th=class t extends fr{static{a(this,"APIError")}constructor(e,r,n,o,s){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=o,this.requestID=o?.get("request-id"),this.error=r,this.type=s??null}static makeMessage(e,r,n){let o=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&o?`${e} ${o}`:e?`${e} status code (no body)`:o||"(no status code or body)"}static generate(e,r,n,o){if(!e||!o)return new LV({message:n,cause:M3e(r)});let s=r,c=s?.error?.type;return e===400?new HEe(e,s,n,o,c):e===401?new GEe(e,s,n,o,c):e===403?new $Ee(e,s,n,o,c):e===404?new VEe(e,s,n,o,c):e===409?new WEe(e,s,n,o,c):e===422?new zEe(e,s,n,o,c):e===429?new YEe(e,s,n,o,c):e>=500?new KEe(e,s,n,o,c):new t(e,s,n,o,c)}},Ry=class extends Th{static{a(this,"APIUserAbortError")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},LV=class extends Th{static{a(this,"APIConnectionError")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},jEe=class extends LV{static{a(this,"APIConnectionTimeoutError")}constructor({message:e}={}){super({message:e??"Request timed out."})}},HEe=class extends Th{static{a(this,"BadRequestError")}},GEe=class extends Th{static{a(this,"AuthenticationError")}},$Ee=class extends Th{static{a(this,"PermissionDeniedError")}},VEe=class extends Th{static{a(this,"NotFoundError")}},WEe=class extends Th{static{a(this,"ConflictError")}},zEe=class extends Th{static{a(this,"UnprocessableEntityError")}},YEe=class extends Th{static{a(this,"RateLimitError")}},KEe=class extends Th{static{a(this,"InternalServerError")}}});function oSt(t){return typeof t!="object"?{}:t??{}}function XLr(t){if(!t)return!0;for(let e in t)return!1;return!0}function UHi(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var SNc,FHi,s_,ZLr,QHi,sSt,BL=Se(()=>{p();jf();SNc=/^[a-z][a-z0-9+.-]*:/i,FHi=a(t=>SNc.test(t),"isAbsoluteURL"),s_=a(t=>(s_=Array.isArray,s_(t)),"isArray"),ZLr=s_;a(oSt,"maybeObj");a(XLr,"isEmptyObj");a(UHi,"hasOwn");QHi=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new fr(`${t} must be an integer`);if(e<0)throw new fr(`${t} must be a positive integer`);return e},"validatePositiveInteger"),sSt=a(t=>{try{return JSON.parse(t)}catch{return}},"safeJSON")});var NN,JEe=Se(()=>{p();NN=a((t,e)=>new Promise(r=>{if(e?.aborted)return r();let n=a(()=>{clearTimeout(o),r()},"onAbort"),o=setTimeout(()=>{e?.removeEventListener("abort",n),r()},t);e?.addEventListener("abort",n,{once:!0})}),"sleep")});var uk,O3e=Se(()=>{p();uk="0.98.0"});function TNc(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function xNc(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let o=n[1]||0,s=n[2]||0,c=n[3]||0;return{browser:e,version:`${o}.${s}.${c}`}}}return null}var GHi,INc,qHi,jHi,HHi,L3e,aSt=Se(()=>{p();O3e();GHi=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","isRunningInBrowser");a(TNc,"getDetectedPlatform");INc=a(()=>{let t=TNc();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":uk,"X-Stainless-OS":jHi(Deno.build.os),"X-Stainless-Arch":qHi(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":uk,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":uk,"X-Stainless-OS":jHi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":qHi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=xNc();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":uk,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":uk,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"getPlatformProperties");a(xNc,"getBrowserInfo");qHi=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","normalizeArch"),jHi=a(t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),"normalizePlatform"),L3e=a(()=>HHi??(HHi=INc()),"getPlatformHeaders")});function $Hi(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function eBr(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function cSt(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return eBr({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function B3e(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function VHi(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}var ZEe=Se(()=>{p();a($Hi,"getDefaultFetch");a(eBr,"makeReadableStream");a(cSt,"ReadableStreamFrom");a(B3e,"ReadableStreamToAsyncIterable");a(VHi,"CancelReadableStream")});var WHi,zHi=Se(()=>{p();WHi=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"FallbackEncoder")});var tBr,rBr,nBr,YHi,iBr=Se(()=>{p();tBr="RFC3986",rBr=a(t=>String(t),"default_formatter"),nBr={RFC1738:a(t=>String(t).replace(/%20/g,"+"),"RFC1738"),RFC3986:rBr},YHi="RFC1738"});function JHi(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function sBr(t,e){if(s_(t)){let r=[];for(let n=0;n{p();iBr();BL();lSt=a((t,e)=>(lSt=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),lSt(t,e)),"has"),FL=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),oBr=1024,KHi=a((t,e,r,n,o)=>{if(t.length===0)return t;let s=t;if(typeof t=="symbol"?s=Symbol.prototype.toString.call(t):typeof t!="string"&&(s=String(t)),r==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});let c="";for(let l=0;l=oBr?s.slice(l,l+oBr):s,d=[];for(let f=0;f=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===YHi&&(h===40||h===41)){d[d.length]=u.charAt(f);continue}if(h<128){d[d.length]=FL[h];continue}if(h<2048){d[d.length]=FL[192|h>>6]+FL[128|h&63];continue}if(h<55296||h>=57344){d[d.length]=FL[224|h>>12]+FL[128|h>>6&63]+FL[128|h&63];continue}f+=1,h=65536+((h&1023)<<10|u.charCodeAt(f)&1023),d[d.length]=FL[240|h>>18]+FL[128|h>>12&63]+FL[128|h>>6&63]+FL[128|h&63]}c+=d.join("")}return c},"encode");a(JHi,"is_buffer");a(sBr,"maybe_map")});function kNc(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function rGi(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_){let v=t,b=_,T=0,w=!1;for(;(b=b.get(aBr))!==void 0&&!w;){let N=b.get(t);if(T+=1,typeof N<"u"){if(N===T)throw new RangeError("Cyclic object value");w=!0}typeof b.get(aBr)>"u"&&(T=0)}if(typeof d=="function"?v=d(e,v):v instanceof Date?v=m?.(v):r==="comma"&&s_(v)&&(v=sBr(v,function(N){return N instanceof Date?m?.(N):N})),v===null){if(s)return u&&!y?u(e,F0.encoder,E,"key",g):e;v=""}if(kNc(v)||JHi(v)){if(u){let N=y?e:u(e,F0.encoder,E,"key",g);return[A?.(N)+"="+A?.(u(v,F0.encoder,E,"value",g))]}return[A?.(e)+"="+A?.(String(v))]}let R=[];if(typeof v>"u")return R;let x;if(r==="comma"&&s_(v))y&&u&&(v=sBr(v,u)),x=[{value:v.length>0?v.join(",")||null:void 0}];else if(s_(d))x=d;else{let N=Object.keys(v);x=f?N.sort(f):N}let P=l?String(e).replace(/\./g,"%2E"):String(e),D=n&&s_(v)&&v.length===1?P+"[]":P;if(o&&s_(v)&&v.length===0)return D+"[]";for(let N=0;N"u"?t.encodeDotInKeys?!0:F0.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:F0.addQueryPrefix,allowDots:c,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:F0.allowEmptyArrays,arrayFormat:s,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:F0.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?F0.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:F0.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:F0.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:F0.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:F0.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:F0.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:F0.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:F0.strictNullHandling}}function nGi(t,e={}){let r=t,n=PNc(e),o,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):s_(n.filter)&&(s=n.filter,o=s);let c=[];if(typeof r!="object"||r===null)return"";let l=eGi[n.arrayFormat],u=l==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);let d=new WeakMap;for(let m=0;m0?h+f:""}var eGi,tGi,XHi,F0,aBr,iGi=Se(()=>{p();ZHi();iBr();BL();eGi={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},tGi=a(function(t,e){Array.prototype.push.apply(t,s_(e)?e:[e])},"push_to_array"),F0={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:KHi,encodeValuesOnly:!1,format:tBr,formatter:rBr,indices:!1,serializeDate(t){return(XHi??(XHi=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};a(kNc,"is_non_nullish_primitive");aBr={};a(rGi,"inner_stringify");a(PNc,"normalize_stringify_options");a(nGi,"stringify")});function oGi(t){return nGi(t,{arrayFormat:"brackets"})}var cBr=Se(()=>{p();iGi();a(oGi,"stringifyQuery")});function dSt(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new Yc(`Invalid token endpoint base URL "${t}": ${n}`)}if(e.protocol==="https:")return;let r=e.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(e.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1")))throw new Yc(`Refusing to send credential over non-https token endpoint "${t}"`)}async function fSt(t,e){let r=await MNc(t),n;try{n=JSON.parse(r)}catch{throw new Yc(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,w1(r),e)}if(!n.access_token)throw new Yc(`Token endpoint response missing access_token: ${JSON.stringify(w1(n))}`,t.status,w1(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new Yc(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,w1(n),e);return n}function w1(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=lBr?t:t.slice(0,lBr)+`... <${t.length-lBr} more chars>`}return JSON.stringify(w1(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))NNc.has(r)&&(e[r]=n);return e}return null}async function pSt(t,e=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),n=t,o;try{n=await r.promises.realpath(t),o=await r.promises.stat(n)}catch{return}let s=o.mode&511;if(s&18)throw new Yc(`Credentials file at ${n} is group/world-writable (mode 0o${s.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(s&36)throw new Yc(`Credentials file at ${n} is group/world-readable (mode 0o${s.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);typeof process.getuid=="function"&&o.uid!==process.getuid()&&e(`credentials file at ${n} is owned by uid ${o.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function hSt(t,e){let r=await import("node:fs"),o=(await import("node:path")).dirname(t);await r.promises.mkdir(o,{recursive:!0,mode:448});let s=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let c=await r.promises.open(s,"w",384);try{await c.writeFile(JSON.stringify(e,null,2)),await c.sync()}finally{await c.close()}await r.promises.rename(s,t)}catch(c){throw await r.promises.unlink(s).catch(()=>{}),c}try{let c=await r.promises.open(o,"r");try{await c.sync()}finally{await c.close()}}catch{}}async function MNc(t){if(!t.body)return"";let e=t.body.getReader(),r=[],n=0;for(;;){let{done:s,value:c}=await e.read();if(s)break;if(n+c.length>sGi){let l=sGi-n;l>0&&r.push(c.subarray(0,l)),await e.cancel();break}r.push(c),n+=c.length}let o;if(r.length===1)o=r[0];else{o=new Uint8Array(r.reduce((c,l)=>c+l.length,0));let s=0;for(let c of r)o.set(c,s),s+=c.length}return new TextDecoder("utf-8").decode(o)}var aGi,cGi,uSt,yie,lGi,uGi,XEe,dGi,sGi,lBr,NNc,Yc,e_e=Se(()=>{p();jf();aGi="urn:ietf:params:oauth:grant-type:jwt-bearer",cGi="refresh_token",uSt="/v1/oauth/token",yie="oauth-2025-04-20",lGi="oidc-federation-2026-04-01",uGi=120,XEe=30,dGi=5,sGi=1<<20;a(dSt,"requireSecureTokenEndpoint");a(fSt,"parseTokenResponse");lBr=2e3,NNc=new Set(["error","error_description","error_uri"]);a(w1,"redactSensitive");a(pSt,"checkCredentialsFileSafety");a(hSt,"writeCredentialsFileAtomic");a(MNc,"readLimitedText");Yc=class extends fr{static{a(this,"WorkloadIdentityError")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}}});function MN(){return Math.floor(Date.now()/1e3)}var F3e=Se(()=>{p();a(MN,"nowAsSeconds")});var mSt,fGi=Se(()=>{p();e_e();F3e();mSt=class{static{a(this,"TokenCache")}constructor(e,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=r}async getToken(){let e=this.nextForce;this.nextForce=!1;let r=this.cached;if(e||r==null)return(await this.refresh(e)).token;if(r.expiresAt==null)return r.token;let n=r.expiresAt-MN();return n>uGi?r.token:n>XEe?(this.backgroundRefresh(),r.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||MN()-this.lastAdvisoryError{this.lastAdvisoryError=MN(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(r=>(this.cached=r,this.pendingRefresh=null,r),r=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}}});var _a,U3e=Se(()=>{p();_a=a(t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0},"readEnv")});function mGi(t){let e=0;for(let o of t)e+=o.length;let r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function t_e(t){let e;return(pGi??(e=new globalThis.TextEncoder,pGi=e.encode.bind(e)))(t)}function uBr(t){let e;return(hGi??(e=new globalThis.TextDecoder,hGi=e.decode.bind(e)))(t)}var pGi,hGi,gSt=Se(()=>{p();a(mGi,"concatBytes");a(t_e,"encodeUTF8");a(uBr,"decodeUTF8")});var gGi=Se(()=>{p();jf();gSt()});function Q3e(){}function ASt(t,e,r){return!e||ySt[t]>ySt[r]?Q3e:e[t].bind(e)}function Al(t){let e=t.logger,r=t.logLevel??"off";if(!e)return ONc;let n=AGi.get(e);if(n&&n[0]===r)return n[1];let o={error:ASt("error",e,r),warn:ASt("warn",e,r),info:ASt("info",e,r),debug:ASt("debug",e,r)};return AGi.set(e,[r,o]),o}var ySt,dBr,ONc,AGi,N9,M9=Se(()=>{p();BL();ySt={off:0,error:200,warn:300,info:400,debug:500},dBr=a((t,e,r)=>{if(t){if(UHi(ySt,t))return t;Al(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(ySt))}`)}},"parseLogLevel");a(Q3e,"noop");a(ASt,"makeLogFn");ONc={error:Q3e,warn:Q3e,info:Q3e,debug:Q3e},AGi=new WeakMap;a(Al,"loggerFor");N9=a(t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="api-key"||e.toLowerCase()==="x-api-key"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t),"formatRequestDetails")});var fBr=Se(()=>{p();BL();gGi();U3e();M9();iSt();JEe();cBr()});function yGi(t){if(!t)throw new Error("profile name is empty");if(t==="."||t==="..")throw new Error(`profile name "${t}" is not allowed`);if(t.includes("/")||t.includes("\\"))throw new Error(`profile name "${t}" must not contain path separators`);if(!LNc.test(t))throw new Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var ESt,LNc,EGi,_Gi,pBr,BNc,vGi,hBr=Se(()=>{p();aSt();fBr();ESt="1.0",LNc=/^[A-Za-z0-9_.-]+$/;a(yGi,"validateProfileName");EGi=a(async t=>{var e,r;let n=await pBr();if(n===null)return null;let o=t??await vGi();if(o===null)return null;yGi(o);let s=await import("node:fs"),l=(await import("node:path")).join(n,"configs",`${o}.json`),u;try{u=await s.promises.readFile(l,"utf-8")}catch(h){if(h?.code!=="ENOENT")throw new Error(`failed to read config file ${l}: ${h}`);u=null}if(u===null){let h=_a("ANTHROPIC_ORGANIZATION_ID"),m=_a("ANTHROPIC_IDENTITY_TOKEN_FILE"),g=_a("ANTHROPIC_FEDERATION_RULE_ID");return g&&h?{fromFile:!1,config:{organization_id:h,workspace_id:_a("ANTHROPIC_WORKSPACE_ID"),base_url:_a("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:g,service_account_id:_a("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:m?{source:"file",path:m}:void 0,scope:_a("ANTHROPIC_SCOPE")}}}:null}let d;try{d=JSON.parse(u)}catch(h){throw new Error(`failed to parse config file ${l}: ${h}`)}if(!d.authentication)throw new Error(`config file ${l} is missing "authentication"`);let f=d.authentication.type;if(f!=="oidc_federation"&&f!=="user_oauth")throw new Error(`authentication.type "${f}" is not a known authentication type`);if(d.organization_id??(d.organization_id=_a("ANTHROPIC_ORGANIZATION_ID")),d.workspace_id??(d.workspace_id=_a("ANTHROPIC_WORKSPACE_ID")),d.base_url??(d.base_url=_a("ANTHROPIC_BASE_URL")),(e=d.authentication).scope??(e.scope=_a("ANTHROPIC_SCOPE")),d.authentication.type==="oidc_federation"){if(!d.authentication.identity_token){let h=_a("ANTHROPIC_IDENTITY_TOKEN_FILE");h&&(d.authentication.identity_token={source:"file",path:h})}d.authentication.federation_rule_id||(d.authentication.federation_rule_id=_a("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=d.authentication).service_account_id??(r.service_account_id=_a("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:d,fromFile:!0}},"loadConfigWithSource"),_Gi=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await pBr();if(!r)return null;let n=e??await vGi();return n?(yGi(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"getCredentialsPath"),pBr=a(async()=>{if(!BNc())return null;let t=await import("node:path"),e=_a("ANTHROPIC_CONFIG_DIR");if(e)return e;if(L3e()["X-Stainless-OS"]==="Windows"){let s=_a("APPDATA");if(s)return t.join(s,"Anthropic");let c=_a("USERPROFILE");return c?t.join(c,"AppData","Roaming","Anthropic"):null}let n=_a("XDG_CONFIG_HOME");if(n)return t.join(n,"anthropic");let o=_a("HOME");return o?t.join(o,".config","anthropic"):null},"getRootConfigPath"),BNc=a(()=>{let t=L3e()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"supportsLocalConfigFiles"),vGi=a(async()=>{let t=await pBr();if(!t)return null;let e=_a("ANTHROPIC_PROFILE");if(e)return e;let r=await import("node:fs"),o=(await import("node:path")).join(t,"active_config");try{return(await r.promises.readFile(o,"utf-8")).trim()||"default"}catch(s){if(s?.code!=="ENOENT")throw new Error(`failed to read ${o}: ${s}`);return"default"}},"getActiveProfileName")});function mBr(t){if(!t)throw new fr("Identity token file path is empty");return async()=>{let e=await import("node:fs"),r;try{r=await e.promises.readFile(t,"utf-8")}catch(o){throw new fr(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new fr(`Identity token file at ${t} is empty`);return n}}function CGi(t){if(!t)throw new fr("Identity token value is empty");return()=>t}var bGi=Se(()=>{p();jf();a(mBr,"identityTokenFromFile");a(CGi,"identityTokenFromValue")});function SGi(t){return async()=>{dSt(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new Yc(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:aGi,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(r.service_account_id=t.serviceAccountId),t.workspaceId&&(r.workspace_id=t.workspaceId);let n=`${t.baseURL}${uSt}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${yie},${lGi}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${uk} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new Yc(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=w1(u),f="";throw o.status===401&&(f=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new Yc(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await fSt(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new Yc(`Token endpoint response missing required fields: ${JSON.stringify(w1(c))}`,o.status,w1(c),s);return{token:c.access_token,expiresAt:MN()+l}}}var TGi=Se(()=>{p();e_e();F3e();O3e();a(SGi,"oidcFederationProvider")});function IGi(t){return async e=>{let r=await import("node:fs");await pSt(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new Yc(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new Yc(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new Yc(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||MN()"");throw new Yc(`User OAuth refresh failed (HTTP ${f.status}): ${w1(E)}`,f.status,w1(E),h)}let m=await fSt(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new Yc(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(w1(m))}`,f.status,w1(m),h);let A=MN()+g,y=m.refresh_token||l;return await hSt(t.credentialsPath,{...o,version:ESt,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}var xGi=Se(()=>{p();hBr();e_e();F3e();O3e();a(IGi,"userOAuthProvider")});function gBr(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=FNc(t,r,n,e),s={};return t.workspace_id&&t.authentication.type==="user_oauth"&&(s["anthropic-workspace-id"]=t.workspace_id),{provider:o,extraHeaders:s,baseURL:t.base_url||void 0}}async function wGi(t,e){let r=await EGi(e);if(!r)return null;let{config:n,fromFile:o}=r,s=n.authentication.credentials_path||!o?n:{...n,authentication:{...n.authentication,credentials_path:await _Gi(n,e)??void 0}};return gBr(s,t)}function FNc(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=UNc(o);if(!s)throw new Yc("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!o.federation_rule_id)throw new Yc("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!t.organization_id)throw new Yc("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=SGi({identityTokenProvider:s,federationRuleId:o.federation_rule_id,organizationId:t.organization_id,serviceAccountId:o.service_account_id,workspaceId:t.workspace_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent});return e?QNc(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new Yc("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return IGi({credentialsPath:e,clientId:t.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let o=t.authentication.type;throw new Yc(`authentication.type "${o}" is not a known authentication type`)}}}function UNc(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new Yc(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new Yc('identity_token.source "file" requires a non-empty path');return mBr(t.identity_token.path)}let e=_a("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return mBr(e);let r=_a("ANTHROPIC_IDENTITY_TOKEN");return r?CGi(r):null}function QNc(t,e,r,n){return async o=>{let s=await import("node:fs");await pSt(e,n);let c;try{let u=await s.promises.readFile(e,"utf-8");c=JSON.parse(u);let d=c?.access_token;if(d&&!o?.forceRefresh){let f=c?.expires_at;if(f==null||MN(){p();U3e();hBr();e_e();F3e();bGi();TGi();xGi();a(gBr,"resolveCredentialsFromConfig");a(wGi,"defaultCredentials");a(FNc,"buildProvider");a(UNc,"resolveIdentityTokenProvider");a(QNc,"cachedExchangeProvider")});function qNc(t,e){for(let o=e??0;o{p();x1();gSt();O9=class{static{a(this,"LineDecoder")}constructor(){SI.set(this,void 0),TI.set(this,void 0),Qt(this,SI,new Uint8Array,"f"),Qt(this,TI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?t_e(e):e;Qt(this,SI,mGi([Te(this,SI,"f"),r]),"f");let n=[],o;for(;(o=qNc(Te(this,SI,"f"),Te(this,TI,"f")))!=null;){if(o.carriage&&Te(this,TI,"f")==null){Qt(this,TI,o.index,"f");continue}if(Te(this,TI,"f")!=null&&(o.index!==Te(this,TI,"f")+1||o.carriage)){n.push(uBr(Te(this,SI,"f").subarray(0,Te(this,TI,"f")-1))),Qt(this,SI,Te(this,SI,"f").subarray(Te(this,TI,"f")),"f"),Qt(this,TI,null,"f");continue}let s=Te(this,TI,"f")!==null?o.preceding-1:o.preceding,c=uBr(Te(this,SI,"f").subarray(0,s));n.push(c),Qt(this,SI,Te(this,SI,"f").subarray(o.index),"f"),Qt(this,TI,null,"f")}return n}flush(){return Te(this,SI,"f").length?this.decode(` +`):[]}};SI=new WeakMap,TI=new WeakMap;O9.NEWLINE_CHARS=new Set([` +`,"\r"]);O9.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(qNc,"findNewlineIndex");a(kGi,"findDoubleNewlineIndex")});async function*jNc(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new fr("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new fr("Attempted to iterate over a response with no body");let r=new yBr,n=new O9,o=B3e(t.body);for await(let s of HNc(o))for(let c of n.decode(s)){let l=r.decode(c);l&&(yield l)}for(let s of n.flush()){let c=r.decode(s);c&&(yield c)}}async function*HNc(t){let e=new Uint8Array;for await(let r of t){if(r==null)continue;let n=r instanceof ArrayBuffer?new Uint8Array(r):typeof r=="string"?t_e(r):r,o=new Uint8Array(e.length+n.length);o.set(e),o.set(n,e.length),e=o;let s;for(;(s=kGi(e))!==-1;)yield e.slice(0,s),e=e.slice(s)}e.length>0&&(yield e)}function GNc(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}var q3e,UL,yBr,EBr=Se(()=>{p();x1();jf();ZEe();ABr();ZEe();qEe();BL();gSt();M9();jf();UL=class t{static{a(this,"Stream")}constructor(e,r,n){this.iterator=e,q3e.set(this,void 0),this.controller=r,Qt(this,q3e,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?Al(n):console;async function*c(){if(o)throw new fr("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of jNc(e,r)){if(u.event==="completion")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event==="message_start"||u.event==="message_delta"||u.event==="message_stop"||u.event==="content_block_start"||u.event==="content_block_delta"||u.event==="content_block_stop"||u.event==="message"||u.event==="user.message"||u.event==="user.interrupt"||u.event==="user.tool_confirmation"||u.event==="user.custom_tool_result"||u.event==="user.tool_result"||u.event==="agent.message"||u.event==="agent.thinking"||u.event==="agent.tool_use"||u.event==="agent.tool_result"||u.event==="agent.mcp_tool_use"||u.event==="agent.mcp_tool_result"||u.event==="agent.custom_tool_use"||u.event==="agent.thread_context_compacted"||u.event==="session.status_running"||u.event==="session.status_idle"||u.event==="session.status_rescheduled"||u.event==="session.status_terminated"||u.event==="session.error"||u.event==="session.deleted"||u.event==="session.updated"||u.event==="span.model_request_start"||u.event==="span.model_request_end"||u.event==="span.outcome_evaluation_start"||u.event==="span.outcome_evaluation_ongoing"||u.event==="span.outcome_evaluation_end"||u.event==="user.define_outcome"||u.event==="agent.thread_message_received"||u.event==="agent.thread_message_sent"||u.event==="agent.session_thread_message_received"||u.event==="agent.session_thread_message_sent"||u.event==="session.thread_created"||u.event==="session.thread_status_created"||u.event==="session.thread_status_running"||u.event==="session.thread_status_idle"||u.event==="session.thread_status_rescheduled"||u.event==="session.thread_status_terminated")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event!=="ping"&&u.event==="error"){let d=sSt(u.data)??u.data,f=d?.error?.type;throw new Th(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(D9(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}static fromReadableStream(e,r,n){let o=!1;async function*s(){let l=new O9,u=B3e(e);for await(let d of u)for(let f of l.decode(d))yield f;for(let d of l.flush())yield d}a(s,"iterLines");async function*c(){if(o)throw new fr("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of s())l||u&&(yield JSON.parse(u));l=!0}catch(u){if(D9(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}[(q3e=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),o=a(s=>({next:a(()=>{if(s.length===0){let c=n.next();e.push(c),r.push(c)}return s.shift()},"next")}),"teeIterator");return[new t(()=>o(e),this.controller,Te(this,q3e,"f")),new t(()=>o(r),this.controller,Te(this,q3e,"f"))]}toReadableStream(){let e=this,r;return eBr({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:o,done:s}=await r.next();if(s)return n.close();let c=t_e(JSON.stringify(o)+` +`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(jNc,"_iterSSEMessages");a(HNc,"iterSSEChunks");yBr=class{static{a(this,"SSEDecoder")}constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let s={event:this.event,data:this.data.join(` +`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[r,n,o]=GNc(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(GNc,"partition")});async function _St(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return Al(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):UL.fromSSEResponse(r,e.controller);if(r.status===204)return null;if(e.options.__binaryResponse)return r;let u=r.headers.get("content-type")?.split(";")[0]?.trim();if(u?.includes("application/json")||u?.endsWith("+json")){if(r.headers.get("content-length")==="0")return;let m=await r.json();return _Br(m,r)}return await r.text()})();return Al(t).debug(`[${n}] response parsed`,N9({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function _Br(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("request-id"),enumerable:!1})}var vBr=Se(()=>{p();EBr();M9();a(_St,"defaultParseResponse");a(_Br,"addRequestID")});var j3e,Eie,vSt=Se(()=>{p();x1();vBr();Eie=class t extends Promise{static{a(this,"APIPromise")}constructor(e,r,n=_St){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,j3e.set(this,void 0),Qt(this,j3e,e,"f")}_thenUnwrap(e){return new t(Te(this,j3e,"f"),this.responsePromise,async(r,n)=>_Br(e(await this.parseResponse(r,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:r,request_id:r.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(Te(this,j3e,"f"),e))),this.parsedPromise}then(e,r){return this.parse().then(e,r)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};j3e=new WeakMap});var CSt,bSt,H3e,dk,va,Td=Se(()=>{p();x1();jf();vBr();vSt();BL();bSt=class{static{a(this,"AbstractPage")}constructor(e,r,n,o){CSt.set(this,void 0),Qt(this,CSt,e,"f"),this.options=o,this.response=r,this.body=n}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new fr("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await Te(this,CSt,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(CSt=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},H3e=class extends Eie{static{a(this,"PagePromise")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await _St(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},dk=class extends bSt{static{a(this,"Page")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let r=this.first_id;return r?{...this.options,query:{...oSt(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...oSt(this.options.query),after_id:e}}:null}},va=class extends bSt{static{a(this,"PageCursor")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.next_page=n.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{...oSt(this.options.query),page:e}}:null}}});function _ie(t,e,r){return bBr(),new File(t,e??"unknown_file",r)}function G3e(t,e){let r=typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"";return e?r.split(/[\\/]/).pop()||void 0:r}function VNc(t){let e=typeof t=="function"?t:t.fetch,r=PGi.get(e);if(r)return r;let n=(async()=>{try{let o="Response"in e?e.Response:(await e("data:,")).constructor,s=new FormData;return s.toString()!==await new o(s).text()}catch{return!0}})();return PGi.set(e,n),n}var bBr,SBr,r_e,PGi,WNc,zNc,CBr,n_e=Se(()=>{p();ZEe();bBr=a(()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},"checkFileSupport");a(_ie,"makeFile");a(G3e,"getName");SBr=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","isAsyncIterable"),r_e=a(async(t,e,r=!0)=>({...t,body:await WNc(t.body,e,r)}),"multipartFormRequestOptions"),PGi=new WeakMap;a(VNc,"supportsFormData");WNc=a(async(t,e,r=!0)=>{if(!await VNc(e))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(t||{}).map(([o,s])=>CBr(n,o,s,r))),n},"createForm"),zNc=a(t=>t instanceof Blob&&"name"in t,"isNamedBlob"),CBr=a(async(t,e,r,n)=>{if(r!==void 0){if(r==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")t.append(e,String(r));else if(r instanceof Response){let o={},s=r.headers.get("Content-Type");s&&(o={type:s}),t.append(e,_ie([await r.blob()],G3e(r,n),o))}else if(SBr(r))t.append(e,_ie([await new Response(cSt(r)).blob()],G3e(r,n)));else if(zNc(r))t.append(e,_ie([r],G3e(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>CBr(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>CBr(t,`${e}[${o}]`,s,n)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}},"addFormValue")});async function SSt(t,e,r){if(bBr(),t=await t,e||(e=G3e(t,!0)),YNc(t))return t instanceof File&&e==null&&r==null?t:_ie([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(KNc(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),_ie(await TBr(o),e,r)}let n=await TBr(t);if(!r?.type){let o=n.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof o=="string"&&(r={...r,type:o})}return _ie(n,e,r)}async function TBr(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(DGi(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(SBr(t))for await(let r of t)e.push(...await TBr(r));else{let r=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${JNc(t)}`)}return e}function JNc(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(r=>`"${r}"`).join(", ")}]`}var DGi,YNc,KNc,NGi=Se(()=>{p();n_e();n_e();DGi=a(t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function","isBlobLike"),YNc=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&DGi(t),"isFileLike"),KNc=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","isResponseLike");a(SSt,"toFile");a(TBr,"getBytes");a(JNc,"propsForError")});var IBr=Se(()=>{p();NGi()});var MGi=Se(()=>{p()});var Ai,Ul=Se(()=>{p();Ai=class{static{a(this,"APIResource")}constructor(e){this._client=e}}});function*XNc(t){if(!t)return;if(OGi in t){let{values:n,nulls:o}=t;yield*n.entries();for(let s of o)yield[s,null];return}let e=!1,r;t instanceof Headers?r=t.entries():ZLr(t)?r=t:(e=!0,r=Object.entries(t??{}));for(let n of r){let o=n[0];if(typeof o!="string")throw new TypeError("expected header name to be a string");let s=ZLr(n[1])?n[1]:[n[1]],c=!1;for(let l of s)l!==void 0&&(e&&!c&&(c=!0,yield[o,null]),yield[o,l])}}var OGi,Et,Sc=Se(()=>{p();BL();OGi=Symbol.for("brand.privateNullableHeaders");a(XNc,"iterateHeaders");Et=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of XNc(n)){let l=s.toLowerCase();o.has(l)||(e.delete(s),o.add(l)),c===null?(e.delete(s),r.add(l)):(e.append(s,c),r.delete(l))}}return{[OGi]:!0,values:e,nulls:r}},"buildHeaders")});function TSt(t){return typeof t=="object"&&t!==null&&$3e in t}function xBr(t,e){let r=new Set;if(t)for(let n of t)TSt(n)&&r.add(n[$3e]);if(e){for(let n of e)if(TSt(n)&&r.add(n[$3e]),Array.isArray(n.content))for(let o of n.content)TSt(o)&&r.add(o[$3e])}return Array.from(r)}function ISt(t,e){let r=xBr(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function LGi(t){return TSt(t)?{"x-stainless-helper":t[$3e]}:{}}var $3e,V3e=Se(()=>{p();$3e=Symbol("anthropic.sdk.stainlessHelper");a(TSt,"wasCreatedByStainlessHelper");a(xBr,"collectStainlessHelpers");a(ISt,"stainlessHelperHeader");a(LGi,"stainlessHelperHeaderFromFile")});function FGi(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var BGi,eMc,or,Hf=Se(()=>{p();jf();a(FGi,"encodeURIPath");BGi=Object.freeze(Object.create(null)),eMc=a((t=FGi)=>a(function(r,...n){if(r.length===1)return r[0];let o=!1,s=[],c=r.reduce((f,h,m)=>{/[?#]/.test(h)&&(o=!0);let g=n[m],A=(o?encodeURIComponent:t)(""+g);return m!==n.length&&(g==null||typeof g=="object"&&g.toString===Object.getPrototypeOf(Object.getPrototypeOf(g.hasOwnProperty??BGi)??BGi)?.toString)&&(A=g+"",s.push({start:f.length+h.length,length:A.length,error:`Value of type ${Object.prototype.toString.call(g).slice(8,-1)} is not a valid path parameter`})),f+h+(m===n.length?"":A)},""),l=c.split(/[?#]/,1)[0],u=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,d;for(;(d=u.exec(l))!==null;)s.push({start:d.index,length:d[0].length,error:`Value "${d[0]}" can't be safely passed as a path parameter`});if(s.sort((f,h)=>f.start-h.start),s.length>0){let f=0,h=s.reduce((m,g)=>{let A=" ".repeat(g.start-f),y="^".repeat(g.length);return f=g.start+g.length,m+A+y},"");throw new fr(`Path parameters result in path with invalid segments: ${s.map(m=>m.error).join(` `)} ${c} -${h}`)}return c},"path"),"createPathTagFunction"),or=b2c(Wji)});var UEe,wLr=ve(()=>{p();Ul();_d();vc();C3e();FEe();Ff();UEe=class extends Ai{static{a(this,"Files")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",tk,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/files/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/files/${e}/content?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/files/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,r){let{betas:n,...o}=e;return this._client.post("/v1/files?beta=true",BEe({body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},$ji(o.file),r?.headers])},this._client))}}});var QEe,RLr=ve(()=>{p();Ul();_d();vc();Ff();QEe=class extends Ai{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/models/${e}?beta=true`,{...n,headers:vt([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models?beta=true",tk,{query:o,...r,headers:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var qEe,kLr=ve(()=>{p();Ul();_d();vc();Ff();qEe=class extends Ai{static{a(this,"UserProfiles")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/user_profiles?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/user_profiles/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",va,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}}});var Yji=I(tSt=>{"use strict";p();Object.defineProperty(tSt,"__esModule",{value:!0});tSt.timingSafeEqual=void 0;function zji(t,e=""){if(!t)throw new Error(e)}a(zji,"assert");function x2c(t,e){if(t.byteLength!==e.byteLength)return!1;t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),zji(t instanceof DataView),zji(e instanceof DataView);let r=t.byteLength,n=0,o=-1;for(;++o{"use strict";p();var w2c=_I&&_I.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)o.hasOwnProperty(s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(_I,"__esModule",{value:!0});var Um=256,PLr=(function(){function t(e){e===void 0&&(e="="),this._paddingCharacter=e}return a(t,"Coder"),t.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(e*8+5)/6|0},t.prototype.encode=function(e){for(var r="",n=0;n>>18&63),r+=this._encodeByte(o>>>12&63),r+=this._encodeByte(o>>>6&63),r+=this._encodeByte(o>>>0&63)}var s=e.length-n;if(s>0){var o=e[n]<<16|(s===2?e[n+1]<<8:0);r+=this._encodeByte(o>>>18&63),r+=this._encodeByte(o>>>12&63),s===2?r+=this._encodeByte(o>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},t.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(e*6+7)/8|0},t.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},t.prototype.decode=function(e){if(e.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(e),n=e.length-r,o=new Uint8Array(this.maxDecodedLength(n)),s=0,c=0,l=0,u=0,d=0,f=0,h=0;c>>4,o[s++]=d<<4|f>>>2,o[s++]=f<<6|h,l|=u&Um,l|=d&Um,l|=f&Um,l|=h&Um;if(c>>4,l|=u&Um,l|=d&Um),c>>2,l|=f&Um),c>>8&6,r+=51-e>>>8&-75,r+=61-e>>>8&-15,r+=62-e>>>8&3,String.fromCharCode(r)},t.prototype._decodeChar=function(e){var r=Um;return r+=(42-e&e-44)>>>8&-Um+e-43+62,r+=(46-e&e-48)>>>8&-Um+e-47+63,r+=(47-e&e-58)>>>8&-Um+e-48+52,r+=(64-e&e-91)>>>8&-Um+e-65+0,r+=(96-e&e-123)>>>8&-Um+e-97+26,r},t.prototype._getPaddingLength=function(e){var r=0;if(this._paddingCharacter){for(var n=e.length-1;n>=0&&e[n]===this._paddingCharacter;n--)r++;if(e.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},t})();_I.Coder=PLr;var b3e=new PLr;function R2c(t){return b3e.encode(t)}a(R2c,"encode");_I.encode=R2c;function k2c(t){return b3e.decode(t)}a(k2c,"decode");_I.decode=k2c;var Kji=(function(t){w2c(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"URLSafeCoder"),e.prototype._encodeByte=function(r){var n=r;return n+=65,n+=25-r>>>8&6,n+=51-r>>>8&-75,n+=61-r>>>8&-13,n+=62-r>>>8&49,String.fromCharCode(n)},e.prototype._decodeChar=function(r){var n=Um;return n+=(44-r&r-46)>>>8&-Um+r-45+62,n+=(94-r&r-96)>>>8&-Um+r-95+63,n+=(47-r&r-58)>>>8&-Um+r-48+52,n+=(64-r&r-91)>>>8&-Um+r-65+0,n+=(96-r&r-123)>>>8&-Um+r-97+26,n},e})(PLr);_I.URLSafeCoder=Kji;var Jji=new Kji;function P2c(t){return Jji.encode(t)}a(P2c,"encodeURLSafe");_I.encodeURLSafe=P2c;function D2c(t){return Jji.decode(t)}a(D2c,"decodeURLSafe");_I.decodeURLSafe=D2c;_I.encodedLength=function(t){return b3e.encodedLength(t)};_I.maxDecodedLength=function(t){return b3e.maxDecodedLength(t)};_I.decodedLength=function(t){return b3e.decodedLength(t)}});var eHi=I((Xji,rSt)=>{p();(function(t,e){var r={};e(r);var n=r.default;for(var o in r)n[o]=r[o];typeof rSt=="object"&&typeof rSt.exports=="object"?rSt.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(Xji,function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(h,m,g,A,y){for(var E,_,v,b,T,w,R,x,P,D,N,L,B;y>=64;){for(E=m[0],_=m[1],v=m[2],b=m[3],T=m[4],w=m[5],R=m[6],x=m[7],D=0;D<16;D++)N=A+D*4,h[D]=(g[N]&255)<<24|(g[N+1]&255)<<16|(g[N+2]&255)<<8|g[N+3]&255;for(D=16;D<64;D++)P=h[D-2],L=(P>>>17|P<<15)^(P>>>19|P<<13)^P>>>10,P=h[D-15],B=(P>>>7|P<<25)^(P>>>18|P<<14)^P>>>3,h[D]=(L+h[D-7]|0)+(B+h[D-16]|0);for(D=0;D<64;D++)L=(((T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7))+(T&w^~T&R)|0)+(x+(e[D]+h[D]|0)|0)|0,B=((E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10))+(E&_^E&v^_&v)|0,x=R,R=w,w=T,T=b+L|0,b=v,v=_,_=E,E=L+B|0;m[0]+=E,m[1]+=_,m[2]+=v,m[3]+=b,m[4]+=T,m[5]+=w,m[6]+=R,m[7]+=x,A+=64,y-=64}return A}a(r,"hashBlocks");var n=(function(){function h(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return a(h,"Hash"),h.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},h.prototype.clean=function(){for(var m=0;m0){for(;this.bufferLength<64&&g>0;)this.buffer[this.bufferLength++]=m[A++],g--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(g>=64&&(A=r(this.temp,this.state,m,A,g),g%=64);g>0;)this.buffer[this.bufferLength++]=m[A++],g--;return this},h.prototype.finish=function(m){if(!this.finished){var g=this.bytesHashed,A=this.bufferLength,y=g/536870912|0,E=g<<3,_=g%64<56?64:128;this.buffer[A]=128;for(var v=A+1;v<_-8;v++)this.buffer[v]=0;this.buffer[_-8]=y>>>24&255,this.buffer[_-7]=y>>>16&255,this.buffer[_-6]=y>>>8&255,this.buffer[_-5]=y>>>0&255,this.buffer[_-4]=E>>>24&255,this.buffer[_-3]=E>>>16&255,this.buffer[_-2]=E>>>8&255,this.buffer[_-1]=E>>>0&255,r(this.temp,this.state,this.buffer,0,_),this.finished=!0}for(var v=0;v<8;v++)m[v*4+0]=this.state[v]>>>24&255,m[v*4+1]=this.state[v]>>>16&255,m[v*4+2]=this.state[v]>>>8&255,m[v*4+3]=this.state[v]>>>0&255;return this},h.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},h.prototype._saveState=function(m){for(var g=0;gthis.blockSize)new n().update(m).finish(g).clean();else for(var A=0;A1&&m.update(h),g&&m.update(g),m.update(A),m.finish(h),A[0]++}a(l,"fillBuffer");var u=new Uint8Array(t.digestLength);function d(h,m,g,A){m===void 0&&(m=u),A===void 0&&(A=32);for(var y=new Uint8Array([1]),E=c(m,h),_=new o(E),v=new Uint8Array(_.digestLength),b=v.length,T=new Uint8Array(A),w=0;w>>24&255,_[1]=R>>>16&255,_[2]=R>>>8&255,_[3]=R>>>0&255,y.reset(),y.update(m),y.update(_),y.finish(b);for(var x=0;x{"use strict";p();Object.defineProperty(jEe,"__esModule",{value:!0});jEe.Webhook=jEe.WebhookVerificationError=void 0;var N2c=Yji(),tHi=Zji(),M2c=eHi(),rHi=300,DLr=class t extends Error{static{a(this,"ExtendableError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="ExtendableError",this.stack=new Error(e).stack}},IV=class t extends DLr{static{a(this,"WebhookVerificationError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};jEe.WebhookVerificationError=IV;var nSt=class t{static{a(this,"Webhook")}constructor(e,r){if(!e)throw new Error("Secret can't be empty.");if(r?.format==="raw")e instanceof Uint8Array?this.key=e:this.key=Uint8Array.from(e,n=>n.charCodeAt(0));else{if(typeof e!="string")throw new Error("Expected secret to be of type string");e.startsWith(t.prefix)&&(e=e.substring(t.prefix.length)),this.key=tHi.decode(e)}}verify(e,r){let n={};for(let m of Object.keys(r))n[m.toLowerCase()]=r[m];let o=n["webhook-id"],s=n["webhook-signature"],c=n["webhook-timestamp"];if(!s||!o||!c)throw new IV("Missing required headers");let l=this.verifyTimestamp(c),d=this.sign(o,l,e).split(",")[1],f=s.split(" "),h=new globalThis.TextEncoder;for(let m of f){let[g,A]=m.split(",");if(g==="v1"&&(0,N2c.timingSafeEqual)(h.encode(A),h.encode(d)))return JSON.parse(e.toString())}throw new IV("No matching signature found")}sign(e,r,n){if(typeof n!="string")if(n.constructor.name==="Buffer")n=n.toString();else throw new Error("Expected payload to be of type string or Buffer.");let o=new TextEncoder,s=Math.floor(r.getTime()/1e3),c=o.encode(`${e}.${s}.${n}`);return`v1,${tHi.encode(M2c.hmac(this.key,c))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new IV("Invalid Signature Headers");if(r-n>rHi)throw new IV("Message timestamp too old");if(n>r+rHi)throw new IV("Message timestamp too new");return new Date(n*1e3)}};jEe.Webhook=nSt;nSt.prefix="whsec_"});var iHi,HEe,NLr=ve(()=>{p();Ul();iHi=de(nHi(),1),HEe=class extends Ai{static{a(this,"Webhooks")}unwrap(e,{headers:r,key:n}){if(r!==void 0){let o=n===void 0?this._client.webhookKey:n;if(o===null)throw new Error("Webhook key must not be null in order to unwrap");new iHi.Webhook(o).verify(e,r)}return JSON.parse(e)}}});var GEe,MLr=ve(()=>{p();Ul();_d();vc();Ff();GEe=class extends Ai{static{a(this,"Versions")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/agents/${e}/versions?beta=true`,va,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var fie,OLr=ve(()=>{p();Ul();MLr();MLr();_d();vc();Ff();fie=class extends Ai{static{a(this,"Agents")}constructor(){super(...arguments),this.versions=new GEe(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get(or`/v1/agents/${e}?beta=true`,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/agents/${e}?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/agents?beta=true",va,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/agents/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};fie.Versions=GEe});function pie(t,e){if(!t)return()=>{};if(t.aborted)return e.abort(),()=>{};let r=a(()=>e.abort(),"onAbort");return t.addEventListener("abort",r),()=>t.removeEventListener("abort",r)}var iSt=ve(()=>{p();a(pie,"linkAbort")});function xV(t,e){return t instanceof Ch&&t.status===e}function oHi(t){return t instanceof Ch&&typeof t.status=="number"&&t.status>=400&&t.status<500}function wV(t){return oHi(t)&&!xV(t,408)&&!xV(t,409)&&!xV(t,429)}function sHi(t,e,r){return Math.min(e*2**t,r)}function LLr(t,e){return t+Math.random()*(e-t)}function aHi(t){return t*(1-Math.random()*.25)}var S3e=ve(()=>{p();Bf();a(xV,"isStatus");a(oHi,"is4xx");a(wV,"isFatal4xx");a(sHi,"backoff");a(LLr,"jitter");a(aHi,"applyJitter")});function oSt(t,{authToken:e,helper:r}){if(!e)throw new fr(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(e)}`);let n=t,o=n._options.defaultHeaders,s=n._authState?.extraHeaders,c=s?Object.fromEntries(Object.entries(s).filter(([u])=>{let d=u.toLowerCase();return d!=="authorization"&&d!=="x-api-key"})):void 0,l=vt([c,o,{"x-stainless-helper":r}]);return t.withOptions({apiKey:null,authToken:e,baseURL:t.baseURL,credentials:void 0,defaultHeaders:l})}var BLr=ve(()=>{p();Bf();vc();a(oSt,"copyClientForHelper")});function q2c(t){return sHi(t,U2c,Q2c)}function j2c(){let e=globalThis.process?.env?.HOSTNAME;return e?`${e}-${vEe()}`:vEe()}var $Ee,sSt,rk,aSt,cSt,lSt,T3e,I3e,VEe,F2c,U2c,Q2c,RV,uSt=ve(()=>{p();C1();Bf();b9();DEe();D1t();iSt();vc();S3e();BLr();S3e();F2c=999,U2c=1e3,Q2c=6e4,RV=class{static{a(this,"WorkPoller")}constructor(e){$Ee.set(this,void 0),sSt.set(this,!1),rk.set(this,void 0),aSt.set(this,void 0),cSt.set(this,void 0),lSt.set(this,void 0),T3e.set(this,void 0),I3e.set(this,void 0),VEe.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.workerId=e.workerId??j2c(),qt(this,$Ee,oSt(e.client,{authToken:e.environmentKey,helper:"environments-work-poller"}),"f"),qt(this,cSt,e.autoStop??!0,"f"),qt(this,lSt,e.drain??!1,"f"),qt(this,T3e,e.blockMs===void 0?F2c:e.blockMs,"f"),qt(this,I3e,e.reclaimOlderThanMs??null,"f"),qt(this,VEe,e.requestOptions,"f"),qt(this,rk,new AbortController,"f"),qt(this,aSt,pie(e.signal,xe(this,rk,"f")),"f")}get signal(){return xe(this,rk,"f").signal}abort(){xe(this,rk,"f").abort()}async*[($Ee=new WeakMap,sSt=new WeakMap,rk=new WeakMap,aSt=new WeakMap,cSt=new WeakMap,lSt=new WeakMap,T3e=new WeakMap,I3e=new WeakMap,VEe=new WeakMap,Symbol.asyncIterator)](){if(xe(this,sSt,"f"))throw new fr("Cannot iterate over a consumed WorkPoller");qt(this,sSt,!0,"f");let e=gl(this.client);e.info("poller starting",{component:"work-poller",environment_id:this.environmentId});try{let r=0;for(;!xe(this,rk,"f").signal.aborted;){let n;try{n=await xe(this,$Ee,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...xe(this,T3e,"f")!==null?{block_ms:xe(this,T3e,"f")}:{},...xe(this,I3e,"f")!==null?{reclaim_older_than_ms:xe(this,I3e,"f")}:{}},{headers:vt([xe(this,VEe,"f")?.headers]),signal:xe(this,rk,"f").signal})}catch(o){if(xe(this,rk,"f").signal.aborted)return;if(wV(o))throw e.error("poll failed permanently, stopping poller",{error:String(o)}),o;let s=aHi(q2c(r));e.warn("poll failed, backing off",{error:String(o),backoff_ms:s}),r++,await TN(s,xe(this,rk,"f").signal);continue}if(r=0,n==null){if(xe(this,lSt,"f"))return;await TN(LLr(1e3,3e3),xe(this,rk,"f").signal);continue}e.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:n.id,work_type:n.data.type});try{await xe(this,$Ee,"f").beta.environments.work.ack(n.id,{environment_id:n.environment_id},{headers:vt([xe(this,VEe,"f")?.headers]),signal:xe(this,rk,"f").signal})}catch(o){e.error("ack failed",{work_id:n.id,error:String(o)});continue}try{yield n}finally{if(xe(this,cSt,"f"))try{await xe(this,$Ee,"f").beta.environments.work.stop(n.id,{environment_id:n.environment_id},{headers:vt([xe(this,VEe,"f")?.headers])})}catch(o){xV(o,409)||e.warn("stop failed",{work_id:n.id,error:String(o)})}}}}finally{xe(this,aSt,"f").call(this)}}};a(q2c,"backoff");a(j2c,"defaultWorkerId")});var WEe,kV,zEe,dSt,cHi=ve(()=>{p();C1();dSt=class{static{a(this,"AsyncQueue")}constructor(){WEe.set(this,[]),kV.set(this,[]),zEe.set(this,!1)}push(e){if(xe(this,zEe,"f"))return!1;let r=xe(this,kV,"f").shift();return r?r({done:!1,value:e}):xe(this,WEe,"f").push(e),!0}close(){if(!xe(this,zEe,"f"))for(qt(this,zEe,!0,"f");xe(this,kV,"f").length>0;)xe(this,kV,"f").shift()({done:!0,value:void 0})}next(e){return xe(this,WEe,"f").length>0?Promise.resolve({done:!1,value:xe(this,WEe,"f").shift()}):xe(this,zEe,"f")||e?.aborted?Promise.resolve({done:!0,value:void 0}):new Promise(r=>{let n=a(s=>{e?.removeEventListener("abort",o),r(s)},"waiter"),o=a(()=>{let s=xe(this,kV,"f").indexOf(n);s>=0&&xe(this,kV,"f").splice(s,1),r({done:!0,value:void 0})},"onAbort");xe(this,kV,"f").push(n),e?.addEventListener("abort",o,{once:!0})})}tryShift(){return xe(this,WEe,"f").shift()}};WEe=new WeakMap,kV=new WeakMap,zEe=new WeakMap});var _o,hie=ve(()=>{p();_o=class extends Error{static{a(this,"ToolError")}constructor(e){let r=typeof e=="string"?e:e.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=e}}});function FLr(t){return"name"in t?t.name:t.mcp_server_name}function H2c(t){return t instanceof _o?t.content:`Error: ${t instanceof Error?t.message:String(t)}`}async function lHi(t,e,r){try{let n=t.parse?t.parse(e):e;return{content:await t.run(n,r),isError:!1}}catch(n){return{content:H2c(n),isError:!0}}}var uHi=ve(()=>{p();hie();a(FLr,"toolName");a(H2c,"toolErrorContent");a(lHi,"runRunnableTool")});function AHi(t){return t.type==="session.status_idle"&&t.stop_reason?.type==="end_turn"}function Y2c(t,e,r){return t.type==="agent.custom_tool_use"?{type:"user.custom_tool_result",custom_tool_use_id:t.id,is_error:e,content:r}:{type:"user.tool_result",tool_use_id:t.id,is_error:e,content:r}}function K2c(t){if(typeof t=="string")return[{type:"text",text:t||"(no output)"}];let e=t.map(r=>r.type==="text"?{type:"text",text:r.text||"(no output)"}:r.type==="image"||r.type==="document"?r:r.type==="search_result"?{type:"search_result",source:r.source,title:r.title,content:r.content.map(n=>({type:"text",text:n.text})),citations:{enabled:r.citations?.enabled??!1}}:{type:"text",text:JSON.stringify(r)});return e.length>0?e:[{type:"text",text:"(no output)"}]}var B0,fSt,Iy,pSt,w3e,mSt,r_,YEe,LL,mie,T9,R3e,KEe,hSt,yHi,dHi,fHi,pHi,ULr,x3e,QLr,hHi,EHi,G2c,mHi,$2c,V2c,W2c,gHi,z2c,PV,gSt=ve(()=>{p();C1();Bf();b9();DEe();S3e();iSt();cHi();vc();uHi();G2c="SessionToolRunner",mHi=500,$2c=1e4,V2c=12e4,W2c=3e4,gHi=3,z2c=6e4;a(AHi,"isEndTurnIdle");PV=class{static{a(this,"SessionToolRunner")}constructor(e,r){B0.add(this),fSt.set(this,!1),Iy.set(this,void 0),pSt.set(this,void 0),w3e.set(this,void 0),mSt.set(this,void 0),r_.set(this,void 0),YEe.set(this,new Set),LL.set(this,new Set),mie.set(this,new dSt),T9.set(this,0),R3e.set(this,null),KEe.set(this,void 0),this.client=r.client,this.sessionId=e,this.tools=r.tools,this.maxIdleMs=r.maxIdleMs??z2c,qt(this,r_,gl(r.client),"f"),qt(this,mSt,new Map(r.tools.map(n=>[FLr(n),n])),"f"),qt(this,Iy,new AbortController,"f"),qt(this,pSt,pie(r.signal,xe(this,Iy,"f")),"f"),qt(this,w3e,r.requestOptions,"f")}get signal(){return xe(this,Iy,"f").signal}abort(){xe(this,Iy,"f").abort()}async*[(fSt=new WeakMap,Iy=new WeakMap,pSt=new WeakMap,w3e=new WeakMap,mSt=new WeakMap,r_=new WeakMap,YEe=new WeakMap,LL=new WeakMap,mie=new WeakMap,T9=new WeakMap,R3e=new WeakMap,KEe=new WeakMap,B0=new WeakSet,Symbol.asyncIterator)](){if(xe(this,fSt,"f"))throw new fr("Cannot iterate over a consumed SessionToolRunner");qt(this,fSt,!0,"f"),xe(this,r_,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let e=xe(this,B0,"m",yHi).call(this).catch(r=>{xe(this,Iy,"f").signal.aborted||xe(this,r_,"f").error("stream loop failed",{error:String(r)}),xe(this,Iy,"f").abort()});try{for(;;){let n=await xe(this,mie,"f").next(xe(this,Iy,"f").signal);if(n.done)break;yield n.value}await e;let r;for(;(r=xe(this,mie,"f").tryShift())!==void 0;)yield r}finally{xe(this,Iy,"f").abort(),xe(this,B0,"m",x3e).call(this),await e;try{await xe(this,B0,"m",EHi).call(this)}catch(r){xe(this,r_,"f").warn("drain failed",{error:String(r)})}xe(this,mie,"f").close();for(let r of this.tools)try{await r.close?.()}catch(n){xe(this,r_,"f").warn("tool.close failed",{tool:FLr(r),error:String(n)})}xe(this,pSt,"f").call(this)}}};hSt=a(function(){return{...xe(this,w3e,"f"),headers:vt([{"x-stainless-helper":G2c},xe(this,w3e,"f")?.headers]),signal:xe(this,Iy,"f").signal}},"_SessionToolRunner_requestOptions"),yHi=a(async function(){let e=xe(this,Iy,"f"),r=mHi;for(;!e.signal.aborted;){try{let n=await this.client.beta.sessions.events.stream(this.sessionId,{},xe(this,B0,"m",hSt).call(this));await xe(this,B0,"m",dHi).call(this);for await(let o of n)if(r=mHi,await xe(this,B0,"m",pHi).call(this,o))return}catch(n){if(e.signal.throwIfAborted(),wV(n))throw xe(this,r_,"f").error("permanent stream failure, shutting down",{error:String(n)}),e.abort(),n;xe(this,r_,"f").warn("stream disconnected, reconnecting",{error:String(n),backoff_ms:r})}e.signal.throwIfAborted(),await TN(r,e.signal),r=Math.min(r*2,$2c)}},"_SessionToolRunner_streamLoop"),dHi=a(async function(){let e=xe(this,Iy,"f"),r=[],n=!1;try{for await(let s of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},xe(this,B0,"m",hSt).call(this)))xe(this,B0,"m",fHi).call(this,s,r),n=AHi(s)}catch(s){e.signal.throwIfAborted(),xe(this,r_,"f").warn("reconcile list failed",{error:String(s)});for(let c of r)xe(this,YEe,"f").delete(c.id);return}let o=r.filter(s=>!xe(this,LL,"f").has(s.id));n&&o.length===0?xe(this,B0,"m",ULr).call(this):xe(this,B0,"m",x3e).call(this);for(let s of o)await xe(this,B0,"m",QLr).call(this,s)},"_SessionToolRunner_reconcile"),fHi=a(function(e,r){e.type==="agent.tool_use"||e.type==="agent.custom_tool_use"?(xe(this,YEe,"f").add(e.id),xe(this,LL,"f").has(e.id)||r.push(e)):e.type==="user.tool_result"?xe(this,LL,"f").add(e.tool_use_id):e.type==="user.custom_tool_result"&&xe(this,LL,"f").add(e.custom_tool_use_id)},"_SessionToolRunner_ingestHistory"),pHi=a(async function(e){switch(AHi(e)?xe(this,B0,"m",ULr).call(this):xe(this,B0,"m",x3e).call(this),e.type){case"agent.tool_use":case"agent.custom_tool_use":return xe(this,YEe,"f").has(e.id)||(xe(this,YEe,"f").add(e.id),await xe(this,B0,"m",QLr).call(this,e)),!1;case"user.tool_result":return xe(this,LL,"f").add(e.tool_use_id),!1;case"user.custom_tool_result":return xe(this,LL,"f").add(e.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return xe(this,r_,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),xe(this,Iy,"f").abort(),!0;default:return!1}},"_SessionToolRunner_handleStreamEvent"),ULr=a(function(){xe(this,B0,"m",x3e).call(this),!(this.maxIdleMs<=0)&&qt(this,KEe,setTimeout(()=>{xe(this,r_,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),xe(this,Iy,"f").abort()},this.maxIdleMs),"f")},"_SessionToolRunner_armIdleTimer"),x3e=a(function(){xe(this,KEe,"f")!==void 0&&(clearTimeout(xe(this,KEe,"f")),qt(this,KEe,void 0,"f"))},"_SessionToolRunner_disarmIdleTimer"),QLr=a(async function(e){var r,n;if(!xe(this,LL,"f").has(e.id)){xe(this,r_,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),qt(this,T9,(r=xe(this,T9,"f"),r++,r),"f");try{let o=xe(this,mSt,"f").get(e.name);if(!o){xe(this,r_,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),xe(this,mie,"f").push({event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1});return}let s,c,l=new AbortController,u=pie(xe(this,Iy,"f").signal,l),d=setTimeout(()=>l.abort(),V2c);try{let m=await lHi(o,e.input,{toolUse:e,toolUseBlock:e,signal:l.signal});s=m.content,c=m.isError}finally{clearTimeout(d),u()}let f=Y2c(e,c,K2c(s)),h=await xe(this,B0,"m",hHi).call(this,f,e.id);xe(this,mie,"f").push({event:e,result:f,toolUseId:e.id,name:e.name,isError:c,posted:h})}finally{qt(this,T9,(n=xe(this,T9,"f"),n--,n),"f"),xe(this,T9,"f")===0&&xe(this,R3e,"f")?.call(this)}}},"_SessionToolRunner_execute"),hHi=a(async function(e,r){let n=xe(this,Iy,"f"),o;for(let s=0;sqt(this,R3e,e,"f")),TN(W2c)]),qt(this,R3e,null,"f"),xe(this,T9,"f")>0&&xe(this,r_,"f").warn("drain timeout exceeded"))},"_SessionToolRunner_drain");a(Y2c,"buildResultEvent");a(K2c,"toSessionContent")});var _Hi=ve(()=>{p();fLr()});function gie(t){if(t.inputSchema.type!=="object")throw new Error(`JSON schema for tool "${t.name}" must be an object, but got ${t.inputSchema.type}`);return{type:"custom",name:t.name,input_schema:t.inputSchema,description:t.description,run:t.run,parse:a(e=>e,"parse"),...t.close?{close:t.close}:{}}}var vHi=ve(()=>{p();qLr();_Hi();a(gie,"betaTool")});function JEe(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}var jLr=ve(()=>{p();a(JEe,"promiseWithResolvers")});async function Z2c(t){try{return await vI.realpath(t)}catch{return t}}async function X2c(t){let e=[],r=t;for(;;){let n;try{n=await vI.realpath(r)}catch{let o=!1;try{o=(await vI.lstat(r)).isSymbolicLink()}catch{}if(o){r=F0.resolve(F0.dirname(r),await vI.readlink(r));continue}let s=F0.dirname(r);if(s===r)return t;e.push(F0.basename(r)),r=s;continue}return e.length?F0.join(n,...e.reverse()):n}}async function bHi(t,e,r){let n=r?.allowOutside??!1;if(F0.isAbsolute(e)){if(!n)throw new _o(`absolute path ${JSON.stringify(e)} not permitted`);return F0.resolve(e)}let o=await Z2c(F0.resolve(t)),s=F0.resolve(o,e);if(n)return s;let c=await X2c(s),l=o.endsWith(F0.sep)?o:o+F0.sep;if(c!==o&&!c.startsWith(l))throw new _o(`path ${JSON.stringify(e)} escapes workdir`);return c}async function HLr(t,e){let r=F0.dirname(t),n=F0.join(r,`.tmp-${process.pid}-${(0,CHi.randomUUID)()}`),o;try{o=await vI.open(n,"wx",J2c),await o.writeFile(e,"utf-8"),await o.sync(),await o.close(),o=void 0,await vI.rename(n,t)}catch(s){throw o&&await o.close().catch(()=>{}),await vI.unlink(n).catch(()=>{}),s}}function P3e(t,e){switch(t?.code){case"ENOENT":return`${e}: no such file or directory`;case"EACCES":case"EPERM":return`${e}: permission denied`;case"ENOTDIR":return`${e}: not a directory`;case"EISDIR":return`${e}: is a directory`;case"ELOOP":return`${e}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${e}: file name too long`;case"ENOSPC":return`${e}: no space left on device`;case"EMFILE":case"ENFILE":return`${e}: too many open files`;default:return`${e}: ${t instanceof Error?t.message:String(t)}`}}var vI,F0,CHi,k3e,J2c,GLr=ve(()=>{p();vI=de(require("node:fs/promises"),1),F0=de(require("node:path"),1),CHi=require("node:crypto");hie();k3e=493,J2c=420;a(Z2c,"realpathOrSelf");a(X2c,"canonicalize");a(bHi,"confineToRoot");a(HLr,"atomicWriteFile");a(P3e,"fsErrorMessage")});async function RHi(t){let{client:e,sessionId:r}=t;if(!e||!r)return async()=>{};let n=gl(e),o=await e.beta.sessions.retrieve(r),s=xy.resolve(t.workdir,"skills"),c=[];for(let l of o.agent.skills)try{let u=await VLr(e,l.skill_id,l.version),d=await e.beta.skills.versions.retrieve(u,{skill_id:l.skill_id}),f=xy.basename(d.name.trim());(f===""||f==="."||f==="..")&&(f=l.skill_id);let h=xy.resolve(s,f);if(h!==s&&!h.startsWith(s+xy.sep)){n.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:d.name});continue}let m=await e.beta.skills.versions.download(u,{skill_id:l.skill_id});await S1.rm(h,{recursive:!0,force:!0}),await S1.mkdir(h,{recursive:!0,mode:k3e}),c.push(h),await WLr(m,h),n.info("downloaded skill",{component:"agent-tool-context",skill_id:l.skill_id,version:u,dest:h})}catch(u){n.warn("failed to download skill",{component:"agent-tool-context",skill_id:l.skill_id,error:String(u)})}return async()=>{for(let l of c)await S1.rm(l,{recursive:!0,force:!0}).catch(u=>{n.warn("failed to clean up skill",{component:"agent-tool-context",dest:l,error:String(u)})})}}async function VLr(t,e,r){if(/^\d+$/.test(r))return r;let n;for await(let o of t.beta.skills.versions.list(e))/^\d+$/.test(o.version)&&(n===void 0||BigInt(o.version)>BigInt(n))&&(n=o.version);if(n===void 0)throw new fr(`skill ${JSON.stringify(e)} has no concrete version to resolve ${JSON.stringify(r)} against`);return n}function tDc(t){for(let e of t.split(` -`)){let r=e.trim();if(r&&(xy.isAbsolute(r)||r.split(/[\\/]/).includes("..")))throw new fr(`refusing to extract unsafe archive member: ${r}`)}}function rDc(t){for(let e of t.split(` -`)){let r=e.trimStart()[0];if(r==="l"||r==="h"||r==="b"||r==="c"||r==="p"||r==="s")throw new fr("refusing to extract archive with symlink/hardlink/device member")}}async function $Lr(t,e){try{let{stdout:r}=await eDc(t,e);return r}catch(r){throw r!=null&&typeof r=="object"&&r.code==="ENOENT"?new fr(`skill extraction requires the \`${t}\` command, but it was not found on PATH`):r}}function nDc(t){let e,r=!1;for(let n of t.split(` -`)){let o=n.trim().split("/").filter(c=>c!==""&&c!==".");if(o.length===0)continue;let s=o[0];if(e===void 0)e=s;else if(s!==e)return"";o.length>1&&(r=!0)}return e!==void 0&&r?e:""}async function WLr(t,e){let r=xy.join(e,`.skill-archive-${process.pid}-${Date.now()}`);if(!t.body)throw new fr("skill download response had no body");await(0,wHi.pipeline)(xHi.Readable.fromWeb(t.body),SHi.createWriteStream(r));let n=xy.join(xy.dirname(e),`.skill-stage-${process.pid}-${Date.now()}`);try{let o=await iDc(r,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,c=s?"unzip":"tar",l=await $Lr(c,s?["-Z1",r]:["-tf",r]);tDc(l),rDc(await $Lr(c,s?["-Z",r]:["-tvf",r]));let u=nDc(l);await S1.mkdir(n,{recursive:!0,mode:k3e}),await $Lr(c,s?["-oq",r,"-d",n]:["-xf",r,"-C",n]);let d=u?xy.join(n,u):n;for(let f of await S1.readdir(d))await S1.rename(xy.join(d,f),xy.join(e,f))}finally{await S1.rm(r,{force:!0}),await S1.rm(n,{recursive:!0,force:!0})}}async function iDc(t,e){let r=await S1.open(t,"r");try{let n=Buffer.alloc(e),{bytesRead:o}=await r.read(n,0,e,0);return n.subarray(0,o)}finally{await r.close()}}var S1,SHi,xy,THi,IHi,xHi,wHi,eDc,kHi=ve(()=>{p();S1=de(require("node:fs/promises"),1),SHi=de(require("node:fs"),1),xy=de(require("node:path"),1),THi=require("node:child_process"),IHi=require("node:util"),xHi=require("node:stream"),wHi=require("node:stream/promises");Bf();b9();GLr();eDc=(0,IHi.promisify)(THi.execFile);a(RHi,"setupSkills");a(VLr,"resolveSkillVersion");a(tDc,"assertSafeMemberNames");a(rDc,"assertNoSpecialMembers");a($Lr,"runArchiveTool");a(nDc,"archiveTopDir");a(WLr,"extractSkillArchive");a(iDc,"readHead")});var HHi={};ki(HHi,{BashSession:()=>ySt,betaAgentToolset20260401:()=>lDc,betaBashTool:()=>BHi,betaEditTool:()=>QHi,betaGlobTool:()=>qHi,betaGrepTool:()=>jHi,betaReadTool:()=>FHi,betaWriteTool:()=>UHi,extractSkillArchive:()=>WLr,resolvePath:()=>ZEe,resolveSkillVersion:()=>VLr,setupSkills:()=>RHi});function lDc(t){return[BHi(t),FHi(t),UHi(t),QHi(t),qHi(t),jHi(t)]}function ZEe(t,e){return bHi(t.workdir,e,{allowOutside:t.unrestrictedPaths??!1})}function uDc(){let t={};for(let[e,r]of Object.entries(process.env))e.startsWith("ANTHROPIC_")||(t[e]=r);return t}function BHi(t){let e,r=Promise.resolve();return gie({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:a(async({command:n,restart:o,timeout_ms:s},c)=>{let l=r,u=JEe();r=u.promise;try{await l}catch{}try{if(o&&(e?.close(),e=void 0),!n){if(o)return"bash session restarted";throw new _o("bash: command is required")}e??(e=new ySt(t.workdir,t.env));try{let{output:d,exitCode:f}=await e.exec(n,{timeoutMs:s??LHi,signal:c?.signal});if(f!==0)throw new _o(d||`exit ${f}`);return d}catch(d){throw d instanceof _o?d:(e.close(),e=void 0,new _o(`bash: ${d instanceof Error?d.message:String(d)}`))}}finally{u.resolve()}},"run"),close:a(()=>{e?.close(),e=void 0},"close")})}function FHi(t){return gie({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:a(async({file_path:e,view_range:r})=>{if(!e)throw new _o("read: file_path is required");let n=await ZEe(t,e),o;try{let f=await n_.stat(n);if(!f.isFile())throw new _o(`read: ${e} is not a regular file`);if(f.size>YLr)throw new _o(`read: ${e} is ${f.size} bytes, exceeds ${YLr}-byte limit. Use bash (head/tail/sed) to read a slice.`);o=await n_.readFile(n,"utf8")}catch(f){throw f instanceof _o?f:new _o(`read: ${P3e(f,e)}`)}if(!r)return o;if(r.length!==2)throw new _o("read: view_range must be [start_line, end_line]");let[s,c]=r,l=o.split(` +${h}`)}return c},"path"),"createPathTagFunction"),or=eMc(FGi)});var i_e,wBr=Se(()=>{p();Ul();Td();Sc();V3e();n_e();Hf();i_e=class extends Ai{static{a(this,"Files")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",dk,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/files/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/files/${e}/content?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/files/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,r){let{betas:n,...o}=e;return this._client.post("/v1/files?beta=true",r_e({body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},LGi(o.file),r?.headers])},this._client))}}});var o_e,RBr=Se(()=>{p();Ul();Td();Sc();Hf();o_e=class extends Ai{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/models/${e}?beta=true`,{...n,headers:Et([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models?beta=true",dk,{query:o,...r,headers:Et([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var s_e,kBr=Se(()=>{p();Ul();Td();Sc();Hf();s_e=class extends Ai{static{a(this,"UserProfiles")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/user_profiles?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/user_profiles/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",va,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}}});var QGi=I(xSt=>{"use strict";p();Object.defineProperty(xSt,"__esModule",{value:!0});xSt.timingSafeEqual=void 0;function UGi(t,e=""){if(!t)throw new Error(e)}a(UGi,"assert");function iMc(t,e){if(t.byteLength!==e.byteLength)return!1;t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),UGi(t instanceof DataView),UGi(e instanceof DataView);let r=t.byteLength,n=0,o=-1;for(;++o{"use strict";p();var oMc=II&&II.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)o.hasOwnProperty(s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(II,"__esModule",{value:!0});var Gm=256,PBr=(function(){function t(e){e===void 0&&(e="="),this._paddingCharacter=e}return a(t,"Coder"),t.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(e*8+5)/6|0},t.prototype.encode=function(e){for(var r="",n=0;n>>18&63),r+=this._encodeByte(o>>>12&63),r+=this._encodeByte(o>>>6&63),r+=this._encodeByte(o>>>0&63)}var s=e.length-n;if(s>0){var o=e[n]<<16|(s===2?e[n+1]<<8:0);r+=this._encodeByte(o>>>18&63),r+=this._encodeByte(o>>>12&63),s===2?r+=this._encodeByte(o>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},t.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(e*6+7)/8|0},t.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},t.prototype.decode=function(e){if(e.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(e),n=e.length-r,o=new Uint8Array(this.maxDecodedLength(n)),s=0,c=0,l=0,u=0,d=0,f=0,h=0;c>>4,o[s++]=d<<4|f>>>2,o[s++]=f<<6|h,l|=u&Gm,l|=d&Gm,l|=f&Gm,l|=h&Gm;if(c>>4,l|=u&Gm,l|=d&Gm),c>>2,l|=f&Gm),c>>8&6,r+=51-e>>>8&-75,r+=61-e>>>8&-15,r+=62-e>>>8&3,String.fromCharCode(r)},t.prototype._decodeChar=function(e){var r=Gm;return r+=(42-e&e-44)>>>8&-Gm+e-43+62,r+=(46-e&e-48)>>>8&-Gm+e-47+63,r+=(47-e&e-58)>>>8&-Gm+e-48+52,r+=(64-e&e-91)>>>8&-Gm+e-65+0,r+=(96-e&e-123)>>>8&-Gm+e-97+26,r},t.prototype._getPaddingLength=function(e){var r=0;if(this._paddingCharacter){for(var n=e.length-1;n>=0&&e[n]===this._paddingCharacter;n--)r++;if(e.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},t})();II.Coder=PBr;var W3e=new PBr;function sMc(t){return W3e.encode(t)}a(sMc,"encode");II.encode=sMc;function aMc(t){return W3e.decode(t)}a(aMc,"decode");II.decode=aMc;var qGi=(function(t){oMc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"URLSafeCoder"),e.prototype._encodeByte=function(r){var n=r;return n+=65,n+=25-r>>>8&6,n+=51-r>>>8&-75,n+=61-r>>>8&-13,n+=62-r>>>8&49,String.fromCharCode(n)},e.prototype._decodeChar=function(r){var n=Gm;return n+=(44-r&r-46)>>>8&-Gm+r-45+62,n+=(94-r&r-96)>>>8&-Gm+r-95+63,n+=(47-r&r-58)>>>8&-Gm+r-48+52,n+=(64-r&r-91)>>>8&-Gm+r-65+0,n+=(96-r&r-123)>>>8&-Gm+r-97+26,n},e})(PBr);II.URLSafeCoder=qGi;var jGi=new qGi;function cMc(t){return jGi.encode(t)}a(cMc,"encodeURLSafe");II.encodeURLSafe=cMc;function lMc(t){return jGi.decode(t)}a(lMc,"decodeURLSafe");II.decodeURLSafe=lMc;II.encodedLength=function(t){return W3e.encodedLength(t)};II.maxDecodedLength=function(t){return W3e.maxDecodedLength(t)};II.decodedLength=function(t){return W3e.decodedLength(t)}});var $Gi=I((GGi,wSt)=>{p();(function(t,e){var r={};e(r);var n=r.default;for(var o in r)n[o]=r[o];typeof wSt=="object"&&typeof wSt.exports=="object"?wSt.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(GGi,function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(h,m,g,A,y){for(var E,_,v,b,T,w,R,x,P,D,N,L,B;y>=64;){for(E=m[0],_=m[1],v=m[2],b=m[3],T=m[4],w=m[5],R=m[6],x=m[7],D=0;D<16;D++)N=A+D*4,h[D]=(g[N]&255)<<24|(g[N+1]&255)<<16|(g[N+2]&255)<<8|g[N+3]&255;for(D=16;D<64;D++)P=h[D-2],L=(P>>>17|P<<15)^(P>>>19|P<<13)^P>>>10,P=h[D-15],B=(P>>>7|P<<25)^(P>>>18|P<<14)^P>>>3,h[D]=(L+h[D-7]|0)+(B+h[D-16]|0);for(D=0;D<64;D++)L=(((T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7))+(T&w^~T&R)|0)+(x+(e[D]+h[D]|0)|0)|0,B=((E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10))+(E&_^E&v^_&v)|0,x=R,R=w,w=T,T=b+L|0,b=v,v=_,_=E,E=L+B|0;m[0]+=E,m[1]+=_,m[2]+=v,m[3]+=b,m[4]+=T,m[5]+=w,m[6]+=R,m[7]+=x,A+=64,y-=64}return A}a(r,"hashBlocks");var n=(function(){function h(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return a(h,"Hash"),h.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},h.prototype.clean=function(){for(var m=0;m0){for(;this.bufferLength<64&&g>0;)this.buffer[this.bufferLength++]=m[A++],g--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(g>=64&&(A=r(this.temp,this.state,m,A,g),g%=64);g>0;)this.buffer[this.bufferLength++]=m[A++],g--;return this},h.prototype.finish=function(m){if(!this.finished){var g=this.bytesHashed,A=this.bufferLength,y=g/536870912|0,E=g<<3,_=g%64<56?64:128;this.buffer[A]=128;for(var v=A+1;v<_-8;v++)this.buffer[v]=0;this.buffer[_-8]=y>>>24&255,this.buffer[_-7]=y>>>16&255,this.buffer[_-6]=y>>>8&255,this.buffer[_-5]=y>>>0&255,this.buffer[_-4]=E>>>24&255,this.buffer[_-3]=E>>>16&255,this.buffer[_-2]=E>>>8&255,this.buffer[_-1]=E>>>0&255,r(this.temp,this.state,this.buffer,0,_),this.finished=!0}for(var v=0;v<8;v++)m[v*4+0]=this.state[v]>>>24&255,m[v*4+1]=this.state[v]>>>16&255,m[v*4+2]=this.state[v]>>>8&255,m[v*4+3]=this.state[v]>>>0&255;return this},h.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},h.prototype._saveState=function(m){for(var g=0;gthis.blockSize)new n().update(m).finish(g).clean();else for(var A=0;A1&&m.update(h),g&&m.update(g),m.update(A),m.finish(h),A[0]++}a(l,"fillBuffer");var u=new Uint8Array(t.digestLength);function d(h,m,g,A){m===void 0&&(m=u),A===void 0&&(A=32);for(var y=new Uint8Array([1]),E=c(m,h),_=new o(E),v=new Uint8Array(_.digestLength),b=v.length,T=new Uint8Array(A),w=0;w>>24&255,_[1]=R>>>16&255,_[2]=R>>>8&255,_[3]=R>>>0&255,y.reset(),y.update(m),y.update(_),y.finish(b);for(var x=0;x{"use strict";p();Object.defineProperty(a_e,"__esModule",{value:!0});a_e.Webhook=a_e.WebhookVerificationError=void 0;var uMc=QGi(),VGi=HGi(),dMc=$Gi(),WGi=300,DBr=class t extends Error{static{a(this,"ExtendableError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="ExtendableError",this.stack=new Error(e).stack}},BV=class t extends DBr{static{a(this,"WebhookVerificationError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};a_e.WebhookVerificationError=BV;var RSt=class t{static{a(this,"Webhook")}constructor(e,r){if(!e)throw new Error("Secret can't be empty.");if(r?.format==="raw")e instanceof Uint8Array?this.key=e:this.key=Uint8Array.from(e,n=>n.charCodeAt(0));else{if(typeof e!="string")throw new Error("Expected secret to be of type string");e.startsWith(t.prefix)&&(e=e.substring(t.prefix.length)),this.key=VGi.decode(e)}}verify(e,r){let n={};for(let m of Object.keys(r))n[m.toLowerCase()]=r[m];let o=n["webhook-id"],s=n["webhook-signature"],c=n["webhook-timestamp"];if(!s||!o||!c)throw new BV("Missing required headers");let l=this.verifyTimestamp(c),d=this.sign(o,l,e).split(",")[1],f=s.split(" "),h=new globalThis.TextEncoder;for(let m of f){let[g,A]=m.split(",");if(g==="v1"&&(0,uMc.timingSafeEqual)(h.encode(A),h.encode(d)))return JSON.parse(e.toString())}throw new BV("No matching signature found")}sign(e,r,n){if(typeof n!="string")if(n.constructor.name==="Buffer")n=n.toString();else throw new Error("Expected payload to be of type string or Buffer.");let o=new TextEncoder,s=Math.floor(r.getTime()/1e3),c=o.encode(`${e}.${s}.${n}`);return`v1,${VGi.encode(dMc.hmac(this.key,c))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new BV("Invalid Signature Headers");if(r-n>WGi)throw new BV("Message timestamp too old");if(n>r+WGi)throw new BV("Message timestamp too new");return new Date(n*1e3)}};a_e.Webhook=RSt;RSt.prefix="whsec_"});var YGi,c_e,NBr=Se(()=>{p();Ul();YGi=fe(zGi(),1),c_e=class extends Ai{static{a(this,"Webhooks")}unwrap(e,{headers:r,key:n}){if(r!==void 0){let o=n===void 0?this._client.webhookKey:n;if(o===null)throw new Error("Webhook key must not be null in order to unwrap");new YGi.Webhook(o).verify(e,r)}return JSON.parse(e)}}});var l_e,MBr=Se(()=>{p();Ul();Td();Sc();Hf();l_e=class extends Ai{static{a(this,"Versions")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/agents/${e}/versions?beta=true`,va,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var vie,OBr=Se(()=>{p();Ul();MBr();MBr();Td();Sc();Hf();vie=class extends Ai{static{a(this,"Agents")}constructor(){super(...arguments),this.versions=new l_e(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get(or`/v1/agents/${e}?beta=true`,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/agents/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/agents?beta=true",va,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/agents/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};vie.Versions=l_e});function Cie(t,e){if(!t)return()=>{};if(t.aborted)return e.abort(),()=>{};let r=a(()=>e.abort(),"onAbort");return t.addEventListener("abort",r),()=>t.removeEventListener("abort",r)}var kSt=Se(()=>{p();a(Cie,"linkAbort")});function FV(t,e){return t instanceof Th&&t.status===e}function KGi(t){return t instanceof Th&&typeof t.status=="number"&&t.status>=400&&t.status<500}function UV(t){return KGi(t)&&!FV(t,408)&&!FV(t,409)&&!FV(t,429)}function JGi(t,e,r){return Math.min(e*2**t,r)}function LBr(t,e){return t+Math.random()*(e-t)}function ZGi(t){return t*(1-Math.random()*.25)}var z3e=Se(()=>{p();jf();a(FV,"isStatus");a(KGi,"is4xx");a(UV,"isFatal4xx");a(JGi,"backoff");a(LBr,"jitter");a(ZGi,"applyJitter")});function PSt(t,{authToken:e,helper:r}){if(!e)throw new fr(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(e)}`);let n=t,o=n._options.defaultHeaders,s=n._authState?.extraHeaders,c=s?Object.fromEntries(Object.entries(s).filter(([u])=>{let d=u.toLowerCase();return d!=="authorization"&&d!=="x-api-key"})):void 0,l=Et([c,o,{"x-stainless-helper":r}]);return t.withOptions({apiKey:null,authToken:e,baseURL:t.baseURL,credentials:void 0,defaultHeaders:l})}var BBr=Se(()=>{p();jf();Sc();a(PSt,"copyClientForHelper")});function yMc(t){return JGi(t,gMc,AMc)}function EMc(){let e=globalThis.process?.env?.HOSTNAME;return e?`${e}-${QEe()}`:QEe()}var u_e,DSt,fk,NSt,MSt,OSt,Y3e,K3e,d_e,mMc,gMc,AMc,QV,LSt=Se(()=>{p();x1();jf();M9();JEe();iSt();kSt();Sc();z3e();BBr();z3e();mMc=999,gMc=1e3,AMc=6e4,QV=class{static{a(this,"WorkPoller")}constructor(e){u_e.set(this,void 0),DSt.set(this,!1),fk.set(this,void 0),NSt.set(this,void 0),MSt.set(this,void 0),OSt.set(this,void 0),Y3e.set(this,void 0),K3e.set(this,void 0),d_e.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.workerId=e.workerId??EMc(),Qt(this,u_e,PSt(e.client,{authToken:e.environmentKey,helper:"environments-work-poller"}),"f"),Qt(this,MSt,e.autoStop??!0,"f"),Qt(this,OSt,e.drain??!1,"f"),Qt(this,Y3e,e.blockMs===void 0?mMc:e.blockMs,"f"),Qt(this,K3e,e.reclaimOlderThanMs??null,"f"),Qt(this,d_e,e.requestOptions,"f"),Qt(this,fk,new AbortController,"f"),Qt(this,NSt,Cie(e.signal,Te(this,fk,"f")),"f")}get signal(){return Te(this,fk,"f").signal}abort(){Te(this,fk,"f").abort()}async*[(u_e=new WeakMap,DSt=new WeakMap,fk=new WeakMap,NSt=new WeakMap,MSt=new WeakMap,OSt=new WeakMap,Y3e=new WeakMap,K3e=new WeakMap,d_e=new WeakMap,Symbol.asyncIterator)](){if(Te(this,DSt,"f"))throw new fr("Cannot iterate over a consumed WorkPoller");Qt(this,DSt,!0,"f");let e=Al(this.client);e.info("poller starting",{component:"work-poller",environment_id:this.environmentId});try{let r=0;for(;!Te(this,fk,"f").signal.aborted;){let n;try{n=await Te(this,u_e,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...Te(this,Y3e,"f")!==null?{block_ms:Te(this,Y3e,"f")}:{},...Te(this,K3e,"f")!==null?{reclaim_older_than_ms:Te(this,K3e,"f")}:{}},{headers:Et([Te(this,d_e,"f")?.headers]),signal:Te(this,fk,"f").signal})}catch(o){if(Te(this,fk,"f").signal.aborted)return;if(UV(o))throw e.error("poll failed permanently, stopping poller",{error:String(o)}),o;let s=ZGi(yMc(r));e.warn("poll failed, backing off",{error:String(o),backoff_ms:s}),r++,await NN(s,Te(this,fk,"f").signal);continue}if(r=0,n==null){if(Te(this,OSt,"f"))return;await NN(LBr(1e3,3e3),Te(this,fk,"f").signal);continue}e.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:n.id,work_type:n.data.type});try{await Te(this,u_e,"f").beta.environments.work.ack(n.id,{environment_id:n.environment_id},{headers:Et([Te(this,d_e,"f")?.headers]),signal:Te(this,fk,"f").signal})}catch(o){e.error("ack failed",{work_id:n.id,error:String(o)});continue}try{yield n}finally{if(Te(this,MSt,"f"))try{await Te(this,u_e,"f").beta.environments.work.stop(n.id,{environment_id:n.environment_id},{headers:Et([Te(this,d_e,"f")?.headers])})}catch(o){FV(o,409)||e.warn("stop failed",{work_id:n.id,error:String(o)})}}}}finally{Te(this,NSt,"f").call(this)}}};a(yMc,"backoff");a(EMc,"defaultWorkerId")});var f_e,qV,p_e,BSt,XGi=Se(()=>{p();x1();BSt=class{static{a(this,"AsyncQueue")}constructor(){f_e.set(this,[]),qV.set(this,[]),p_e.set(this,!1)}push(e){if(Te(this,p_e,"f"))return!1;let r=Te(this,qV,"f").shift();return r?r({done:!1,value:e}):Te(this,f_e,"f").push(e),!0}close(){if(!Te(this,p_e,"f"))for(Qt(this,p_e,!0,"f");Te(this,qV,"f").length>0;)Te(this,qV,"f").shift()({done:!0,value:void 0})}next(e){return Te(this,f_e,"f").length>0?Promise.resolve({done:!1,value:Te(this,f_e,"f").shift()}):Te(this,p_e,"f")||e?.aborted?Promise.resolve({done:!0,value:void 0}):new Promise(r=>{let n=a(s=>{e?.removeEventListener("abort",o),r(s)},"waiter"),o=a(()=>{let s=Te(this,qV,"f").indexOf(n);s>=0&&Te(this,qV,"f").splice(s,1),r({done:!0,value:void 0})},"onAbort");Te(this,qV,"f").push(n),e?.addEventListener("abort",o,{once:!0})})}tryShift(){return Te(this,f_e,"f").shift()}};f_e=new WeakMap,qV=new WeakMap,p_e=new WeakMap});var _o,bie=Se(()=>{p();_o=class extends Error{static{a(this,"ToolError")}constructor(e){let r=typeof e=="string"?e:e.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=e}}});function FBr(t){return"name"in t?t.name:t.mcp_server_name}function _Mc(t){return t instanceof _o?t.content:`Error: ${t instanceof Error?t.message:String(t)}`}async function e$i(t,e,r){try{let n=t.parse?t.parse(e):e;return{content:await t.run(n,r),isError:!1}}catch(n){return{content:_Mc(n),isError:!0}}}var t$i=Se(()=>{p();bie();a(FBr,"toolName");a(_Mc,"toolErrorContent");a(e$i,"runRunnableTool")});function c$i(t){return t.type==="session.status_idle"&&t.stop_reason?.type==="end_turn"}function IMc(t,e,r){return t.type==="agent.custom_tool_use"?{type:"user.custom_tool_result",custom_tool_use_id:t.id,is_error:e,content:r}:{type:"user.tool_result",tool_use_id:t.id,is_error:e,content:r}}function xMc(t){if(typeof t=="string")return[{type:"text",text:t||"(no output)"}];let e=t.map(r=>r.type==="text"?{type:"text",text:r.text||"(no output)"}:r.type==="image"||r.type==="document"?r:r.type==="search_result"?{type:"search_result",source:r.source,title:r.title,content:r.content.map(n=>({type:"text",text:n.text})),citations:{enabled:r.citations?.enabled??!1}}:{type:"text",text:JSON.stringify(r)});return e.length>0?e:[{type:"text",text:"(no output)"}]}var U0,FSt,ky,USt,Z3e,qSt,a_,h_e,QL,Sie,L9,X3e,m_e,QSt,l$i,r$i,n$i,i$i,UBr,J3e,QBr,o$i,u$i,vMc,s$i,CMc,bMc,SMc,a$i,TMc,jV,jSt=Se(()=>{p();x1();jf();M9();JEe();z3e();kSt();XGi();Sc();t$i();vMc="SessionToolRunner",s$i=500,CMc=1e4,bMc=12e4,SMc=3e4,a$i=3,TMc=6e4;a(c$i,"isEndTurnIdle");jV=class{static{a(this,"SessionToolRunner")}constructor(e,r){U0.add(this),FSt.set(this,!1),ky.set(this,void 0),USt.set(this,void 0),Z3e.set(this,void 0),qSt.set(this,void 0),a_.set(this,void 0),h_e.set(this,new Set),QL.set(this,new Set),Sie.set(this,new BSt),L9.set(this,0),X3e.set(this,null),m_e.set(this,void 0),this.client=r.client,this.sessionId=e,this.tools=r.tools,this.maxIdleMs=r.maxIdleMs??TMc,Qt(this,a_,Al(r.client),"f"),Qt(this,qSt,new Map(r.tools.map(n=>[FBr(n),n])),"f"),Qt(this,ky,new AbortController,"f"),Qt(this,USt,Cie(r.signal,Te(this,ky,"f")),"f"),Qt(this,Z3e,r.requestOptions,"f")}get signal(){return Te(this,ky,"f").signal}abort(){Te(this,ky,"f").abort()}async*[(FSt=new WeakMap,ky=new WeakMap,USt=new WeakMap,Z3e=new WeakMap,qSt=new WeakMap,a_=new WeakMap,h_e=new WeakMap,QL=new WeakMap,Sie=new WeakMap,L9=new WeakMap,X3e=new WeakMap,m_e=new WeakMap,U0=new WeakSet,Symbol.asyncIterator)](){if(Te(this,FSt,"f"))throw new fr("Cannot iterate over a consumed SessionToolRunner");Qt(this,FSt,!0,"f"),Te(this,a_,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let e=Te(this,U0,"m",l$i).call(this).catch(r=>{Te(this,ky,"f").signal.aborted||Te(this,a_,"f").error("stream loop failed",{error:String(r)}),Te(this,ky,"f").abort()});try{for(;;){let n=await Te(this,Sie,"f").next(Te(this,ky,"f").signal);if(n.done)break;yield n.value}await e;let r;for(;(r=Te(this,Sie,"f").tryShift())!==void 0;)yield r}finally{Te(this,ky,"f").abort(),Te(this,U0,"m",J3e).call(this),await e;try{await Te(this,U0,"m",u$i).call(this)}catch(r){Te(this,a_,"f").warn("drain failed",{error:String(r)})}Te(this,Sie,"f").close();for(let r of this.tools)try{await r.close?.()}catch(n){Te(this,a_,"f").warn("tool.close failed",{tool:FBr(r),error:String(n)})}Te(this,USt,"f").call(this)}}};QSt=a(function(){return{...Te(this,Z3e,"f"),headers:Et([{"x-stainless-helper":vMc},Te(this,Z3e,"f")?.headers]),signal:Te(this,ky,"f").signal}},"_SessionToolRunner_requestOptions"),l$i=a(async function(){let e=Te(this,ky,"f"),r=s$i;for(;!e.signal.aborted;){try{let n=await this.client.beta.sessions.events.stream(this.sessionId,{},Te(this,U0,"m",QSt).call(this));await Te(this,U0,"m",r$i).call(this);for await(let o of n)if(r=s$i,await Te(this,U0,"m",i$i).call(this,o))return}catch(n){if(e.signal.throwIfAborted(),UV(n))throw Te(this,a_,"f").error("permanent stream failure, shutting down",{error:String(n)}),e.abort(),n;Te(this,a_,"f").warn("stream disconnected, reconnecting",{error:String(n),backoff_ms:r})}e.signal.throwIfAborted(),await NN(r,e.signal),r=Math.min(r*2,CMc)}},"_SessionToolRunner_streamLoop"),r$i=a(async function(){let e=Te(this,ky,"f"),r=[],n=!1;try{for await(let s of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},Te(this,U0,"m",QSt).call(this)))Te(this,U0,"m",n$i).call(this,s,r),n=c$i(s)}catch(s){e.signal.throwIfAborted(),Te(this,a_,"f").warn("reconcile list failed",{error:String(s)});for(let c of r)Te(this,h_e,"f").delete(c.id);return}let o=r.filter(s=>!Te(this,QL,"f").has(s.id));n&&o.length===0?Te(this,U0,"m",UBr).call(this):Te(this,U0,"m",J3e).call(this);for(let s of o)await Te(this,U0,"m",QBr).call(this,s)},"_SessionToolRunner_reconcile"),n$i=a(function(e,r){e.type==="agent.tool_use"||e.type==="agent.custom_tool_use"?(Te(this,h_e,"f").add(e.id),Te(this,QL,"f").has(e.id)||r.push(e)):e.type==="user.tool_result"?Te(this,QL,"f").add(e.tool_use_id):e.type==="user.custom_tool_result"&&Te(this,QL,"f").add(e.custom_tool_use_id)},"_SessionToolRunner_ingestHistory"),i$i=a(async function(e){switch(c$i(e)?Te(this,U0,"m",UBr).call(this):Te(this,U0,"m",J3e).call(this),e.type){case"agent.tool_use":case"agent.custom_tool_use":return Te(this,h_e,"f").has(e.id)||(Te(this,h_e,"f").add(e.id),await Te(this,U0,"m",QBr).call(this,e)),!1;case"user.tool_result":return Te(this,QL,"f").add(e.tool_use_id),!1;case"user.custom_tool_result":return Te(this,QL,"f").add(e.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return Te(this,a_,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),Te(this,ky,"f").abort(),!0;default:return!1}},"_SessionToolRunner_handleStreamEvent"),UBr=a(function(){Te(this,U0,"m",J3e).call(this),!(this.maxIdleMs<=0)&&Qt(this,m_e,setTimeout(()=>{Te(this,a_,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),Te(this,ky,"f").abort()},this.maxIdleMs),"f")},"_SessionToolRunner_armIdleTimer"),J3e=a(function(){Te(this,m_e,"f")!==void 0&&(clearTimeout(Te(this,m_e,"f")),Qt(this,m_e,void 0,"f"))},"_SessionToolRunner_disarmIdleTimer"),QBr=a(async function(e){var r,n;if(!Te(this,QL,"f").has(e.id)){Te(this,a_,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),Qt(this,L9,(r=Te(this,L9,"f"),r++,r),"f");try{let o=Te(this,qSt,"f").get(e.name);if(!o){Te(this,a_,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),Te(this,Sie,"f").push({event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1});return}let s,c,l=new AbortController,u=Cie(Te(this,ky,"f").signal,l),d=setTimeout(()=>l.abort(),bMc);try{let m=await e$i(o,e.input,{toolUse:e,toolUseBlock:e,signal:l.signal});s=m.content,c=m.isError}finally{clearTimeout(d),u()}let f=IMc(e,c,xMc(s)),h=await Te(this,U0,"m",o$i).call(this,f,e.id);Te(this,Sie,"f").push({event:e,result:f,toolUseId:e.id,name:e.name,isError:c,posted:h})}finally{Qt(this,L9,(n=Te(this,L9,"f"),n--,n),"f"),Te(this,L9,"f")===0&&Te(this,X3e,"f")?.call(this)}}},"_SessionToolRunner_execute"),o$i=a(async function(e,r){let n=Te(this,ky,"f"),o;for(let s=0;sQt(this,X3e,e,"f")),NN(SMc)]),Qt(this,X3e,null,"f"),Te(this,L9,"f")>0&&Te(this,a_,"f").warn("drain timeout exceeded"))},"_SessionToolRunner_drain");a(IMc,"buildResultEvent");a(xMc,"toSessionContent")});var d$i=Se(()=>{p();fBr()});function Tie(t){if(t.inputSchema.type!=="object")throw new Error(`JSON schema for tool "${t.name}" must be an object, but got ${t.inputSchema.type}`);return{type:"custom",name:t.name,input_schema:t.inputSchema,description:t.description,run:t.run,parse:a(e=>e,"parse"),...t.close?{close:t.close}:{}}}var f$i=Se(()=>{p();qBr();d$i();a(Tie,"betaTool")});function g_e(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}var jBr=Se(()=>{p();a(g_e,"promiseWithResolvers")});async function RMc(t){try{return await xI.realpath(t)}catch{return t}}async function kMc(t){let e=[],r=t;for(;;){let n;try{n=await xI.realpath(r)}catch{let o=!1;try{o=(await xI.lstat(r)).isSymbolicLink()}catch{}if(o){r=Q0.resolve(Q0.dirname(r),await xI.readlink(r));continue}let s=Q0.dirname(r);if(s===r)return t;e.push(Q0.basename(r)),r=s;continue}return e.length?Q0.join(n,...e.reverse()):n}}async function h$i(t,e,r){let n=r?.allowOutside??!1;if(Q0.isAbsolute(e)){if(!n)throw new _o(`absolute path ${JSON.stringify(e)} not permitted`);return Q0.resolve(e)}let o=await RMc(Q0.resolve(t)),s=Q0.resolve(o,e);if(n)return s;let c=await kMc(s),l=o.endsWith(Q0.sep)?o:o+Q0.sep;if(c!==o&&!c.startsWith(l))throw new _o(`path ${JSON.stringify(e)} escapes workdir`);return c}async function HBr(t,e){let r=Q0.dirname(t),n=Q0.join(r,`.tmp-${process.pid}-${(0,p$i.randomUUID)()}`),o;try{o=await xI.open(n,"wx",wMc),await o.writeFile(e,"utf-8"),await o.sync(),await o.close(),o=void 0,await xI.rename(n,t)}catch(s){throw o&&await o.close().catch(()=>{}),await xI.unlink(n).catch(()=>{}),s}}function tFe(t,e){switch(t?.code){case"ENOENT":return`${e}: no such file or directory`;case"EACCES":case"EPERM":return`${e}: permission denied`;case"ENOTDIR":return`${e}: not a directory`;case"EISDIR":return`${e}: is a directory`;case"ELOOP":return`${e}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${e}: file name too long`;case"ENOSPC":return`${e}: no space left on device`;case"EMFILE":case"ENFILE":return`${e}: too many open files`;default:return`${e}: ${t instanceof Error?t.message:String(t)}`}}var xI,Q0,p$i,eFe,wMc,GBr=Se(()=>{p();xI=fe(require("node:fs/promises"),1),Q0=fe(require("node:path"),1),p$i=require("node:crypto");bie();eFe=493,wMc=420;a(RMc,"realpathOrSelf");a(kMc,"canonicalize");a(h$i,"confineToRoot");a(HBr,"atomicWriteFile");a(tFe,"fsErrorMessage")});async function _$i(t){let{client:e,sessionId:r}=t;if(!e||!r)return async()=>{};let n=Al(e),o=await e.beta.sessions.retrieve(r),s=Py.resolve(t.workdir,"skills"),c=[];for(let l of o.agent.skills)try{let u=await VBr(e,l.skill_id,l.version),d=await e.beta.skills.versions.retrieve(u,{skill_id:l.skill_id}),f=Py.basename(d.name.trim());(f===""||f==="."||f==="..")&&(f=l.skill_id);let h=Py.resolve(s,f);if(h!==s&&!h.startsWith(s+Py.sep)){n.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:d.name});continue}let m=await e.beta.skills.versions.download(u,{skill_id:l.skill_id});await R1.rm(h,{recursive:!0,force:!0}),await R1.mkdir(h,{recursive:!0,mode:eFe}),c.push(h),await WBr(m,h),n.info("downloaded skill",{component:"agent-tool-context",skill_id:l.skill_id,version:u,dest:h})}catch(u){n.warn("failed to download skill",{component:"agent-tool-context",skill_id:l.skill_id,error:String(u)})}return async()=>{for(let l of c)await R1.rm(l,{recursive:!0,force:!0}).catch(u=>{n.warn("failed to clean up skill",{component:"agent-tool-context",dest:l,error:String(u)})})}}async function VBr(t,e,r){if(/^\d+$/.test(r))return r;let n;for await(let o of t.beta.skills.versions.list(e))/^\d+$/.test(o.version)&&(n===void 0||BigInt(o.version)>BigInt(n))&&(n=o.version);if(n===void 0)throw new fr(`skill ${JSON.stringify(e)} has no concrete version to resolve ${JSON.stringify(r)} against`);return n}function DMc(t){for(let e of t.split(` +`)){let r=e.trim();if(r&&(Py.isAbsolute(r)||r.split(/[\\/]/).includes("..")))throw new fr(`refusing to extract unsafe archive member: ${r}`)}}function NMc(t){for(let e of t.split(` +`)){let r=e.trimStart()[0];if(r==="l"||r==="h"||r==="b"||r==="c"||r==="p"||r==="s")throw new fr("refusing to extract archive with symlink/hardlink/device member")}}async function $Br(t,e){try{let{stdout:r}=await PMc(t,e);return r}catch(r){throw r!=null&&typeof r=="object"&&r.code==="ENOENT"?new fr(`skill extraction requires the \`${t}\` command, but it was not found on PATH`):r}}function MMc(t){let e,r=!1;for(let n of t.split(` +`)){let o=n.trim().split("/").filter(c=>c!==""&&c!==".");if(o.length===0)continue;let s=o[0];if(e===void 0)e=s;else if(s!==e)return"";o.length>1&&(r=!0)}return e!==void 0&&r?e:""}async function WBr(t,e){let r=Py.join(e,`.skill-archive-${process.pid}-${Date.now()}`);if(!t.body)throw new fr("skill download response had no body");await(0,E$i.pipeline)(y$i.Readable.fromWeb(t.body),m$i.createWriteStream(r));let n=Py.join(Py.dirname(e),`.skill-stage-${process.pid}-${Date.now()}`);try{let o=await OMc(r,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,c=s?"unzip":"tar",l=await $Br(c,s?["-Z1",r]:["-tf",r]);DMc(l),NMc(await $Br(c,s?["-Z",r]:["-tvf",r]));let u=MMc(l);await R1.mkdir(n,{recursive:!0,mode:eFe}),await $Br(c,s?["-oq",r,"-d",n]:["-xf",r,"-C",n]);let d=u?Py.join(n,u):n;for(let f of await R1.readdir(d))await R1.rename(Py.join(d,f),Py.join(e,f))}finally{await R1.rm(r,{force:!0}),await R1.rm(n,{recursive:!0,force:!0})}}async function OMc(t,e){let r=await R1.open(t,"r");try{let n=Buffer.alloc(e),{bytesRead:o}=await r.read(n,0,e,0);return n.subarray(0,o)}finally{await r.close()}}var R1,m$i,Py,g$i,A$i,y$i,E$i,PMc,v$i=Se(()=>{p();R1=fe(require("node:fs/promises"),1),m$i=fe(require("node:fs"),1),Py=fe(require("node:path"),1),g$i=require("node:child_process"),A$i=require("node:util"),y$i=require("node:stream"),E$i=require("node:stream/promises");jf();M9();GBr();PMc=(0,A$i.promisify)(g$i.execFile);a(_$i,"setupSkills");a(VBr,"resolveSkillVersion");a(DMc,"assertSafeMemberNames");a(NMc,"assertNoSpecialMembers");a($Br,"runArchiveTool");a(MMc,"archiveTopDir");a(WBr,"extractSkillArchive");a(OMc,"readHead")});var M$i={};Ri(M$i,{BashSession:()=>GSt,betaAgentToolset20260401:()=>QMc,betaBashTool:()=>w$i,betaEditTool:()=>P$i,betaGlobTool:()=>D$i,betaGrepTool:()=>N$i,betaReadTool:()=>R$i,betaWriteTool:()=>k$i,extractSkillArchive:()=>WBr,resolvePath:()=>A_e,resolveSkillVersion:()=>VBr,setupSkills:()=>_$i});function QMc(t){return[w$i(t),R$i(t),k$i(t),P$i(t),D$i(t),N$i(t)]}function A_e(t,e){return h$i(t.workdir,e,{allowOutside:t.unrestrictedPaths??!1})}function qMc(){let t={};for(let[e,r]of Object.entries(process.env))e.startsWith("ANTHROPIC_")||(t[e]=r);return t}function w$i(t){let e,r=Promise.resolve();return Tie({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:a(async({command:n,restart:o,timeout_ms:s},c)=>{let l=r,u=g_e();r=u.promise;try{await l}catch{}try{if(o&&(e?.close(),e=void 0),!n){if(o)return"bash session restarted";throw new _o("bash: command is required")}e??(e=new GSt(t.workdir,t.env));try{let{output:d,exitCode:f}=await e.exec(n,{timeoutMs:s??x$i,signal:c?.signal});if(f!==0)throw new _o(d||`exit ${f}`);return d}catch(d){throw d instanceof _o?d:(e.close(),e=void 0,new _o(`bash: ${d instanceof Error?d.message:String(d)}`))}}finally{u.resolve()}},"run"),close:a(()=>{e?.close(),e=void 0},"close")})}function R$i(t){return Tie({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:a(async({file_path:e,view_range:r})=>{if(!e)throw new _o("read: file_path is required");let n=await A_e(t,e),o;try{let f=await c_.stat(n);if(!f.isFile())throw new _o(`read: ${e} is not a regular file`);if(f.size>YBr)throw new _o(`read: ${e} is ${f.size} bytes, exceeds ${YBr}-byte limit. Use bash (head/tail/sed) to read a slice.`);o=await c_.readFile(n,"utf8")}catch(f){throw f instanceof _o?f:new _o(`read: ${tFe(f,e)}`)}if(!r)return o;if(r.length!==2)throw new _o("read: view_range must be [start_line, end_line]");let[s,c]=r,l=o.split(` `),u=Math.max(0,s-1),d=c>0?c:l.length;return l.slice(u,d).join(` -`)},"run")})}function UHi(t){return gie({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:a(async({file_path:e,content:r})=>{if(!e)throw new _o("write: file_path is required");let n=await ZEe(t,e);try{await n_.mkdir(Uf.dirname(n),{recursive:!0,mode:k3e}),await HLr(n,r??"")}catch(o){throw new _o(`write: ${P3e(o,e)}`)}return`wrote ${Buffer.byteLength(r??"")} bytes to ${e}`},"run")})}function QHi(t){return gie({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:a(async({file_path:e,old_string:r,new_string:n,replace_all:o})=>{if(!e)throw new _o("edit: file_path is required");if(!r)throw new _o("edit: old_string is required");let s=await ZEe(t,e),c;try{let d=await n_.stat(s);if(!d.isFile())throw new _o(`edit: ${e} is not a regular file`);if(d.size>DHi)throw new _o(`edit: ${e} is ${d.size} bytes, exceeds ${DHi}-byte limit. Use bash (sed/awk) to edit a large file.`);c=await n_.readFile(s,"utf8")}catch(d){throw d instanceof _o?d:new _o(`edit: ${P3e(d,e)}`)}let l=c.split(r).length-1;if(l===0)throw new _o(`edit: old_string not found in ${e}`);let u;if(o)u=c.split(r).join(n);else{if(l>1)throw new _o(`edit: old_string appears ${l} times in ${e} (must be unique)`);u=c.replace(r,()=>n)}try{await HLr(s,u)}catch(d){throw new _o(`edit: write: ${P3e(d,e)}`)}return`edited ${e} (${o?l:1} replacement(s))`},"run")})}function qHi(t){return gie({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:a(async({pattern:e,path:r})=>{if(!e)throw new _o("glob: pattern is required");let n=Uf.resolve(t.workdir),o=e;if(Uf.isAbsolute(e)){if(!t.unrestrictedPaths)throw new _o("glob: absolute pattern not permitted");n=Uf.parse(e).root,o=Uf.relative(n,e)}else r&&(n=await ZEe(t,r));if(!t.unrestrictedPaths&&o.split(/[\\/]/).includes(".."))throw new _o('glob: ".." is not permitted in the pattern');let s=[];try{for await(let c of cDc(o,{cwd:n,withFileTypes:!0,exclude:a(l=>l.name===".git"||l.name==="node_modules","exclude")})){if(!c.isFile())continue;let l=Uf.join(c.parentPath,c.name);if(!t.unrestrictedPaths&&!pDc(n,l))continue;let u=0;try{u=(await n_.stat(l)).mtimeMs}catch{}s.push({path:l,mtime:u})}}catch(c){throw new _o(`glob: ${c instanceof Error?c.message:String(c)}`)}return s.length===0?"no matches":(s.sort((c,l)=>l.mtime-c.mtime),s.slice(0,sDc).map(c=>c.path).join(` -`))},"run")})}function jHi(t){return gie({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:a(async({pattern:e,path:r},n)=>{if(!e)throw new _o("grep: pattern is required");let o=Uf.resolve(t.workdir);r&&(o=await ZEe(t,r));let s=await ADc();return s?dDc(s,e,o,n?.signal):fDc(e,o,n?.signal)},"run")})}function dDc(t,e,r,n){return new Promise((o,s)=>{let c=KLr.spawn(t,["-n","--no-heading","-e",e,"--",r],{...n?{signal:n}:{}}),l="",u="",d=!1;c.stdout.on("data",f=>{d||(l+=f,l.length>N3e&&(d=!0,l=l.slice(0,N3e),c.kill("SIGKILL")))}),c.stderr.on("data",f=>u+=f),c.on("close",f=>{if(n?.aborted)return s(new _o("grep: aborted"));if(d)return o(l+` -[output truncated at ${N3e} bytes]`);if(f===0)return o(l);if(f===1)return o("no matches");s(new _o(`grep: rg failed: ${u||`exit ${f}`}`))}),c.on("error",f=>{if(n?.aborted)return s(new _o("grep: aborted"));s(new _o(`grep: rg failed: ${f.message}`))})})}async function fDc(t,e,r){let n;try{n=new RegExp(t)}catch(u){throw new _o(`grep: invalid regex: ${u instanceof Error?u.message:String(u)}`)}let o=[],s=N3e,c=a(u=>(s-=u.length+1,s<0?(o.push(`[output truncated at ${N3e} bytes]`),!1):(o.push(u),!0)),"push");if((await n_.stat(e).catch(()=>null))?.isFile()?await NHi(e,n,c):await gDc(e,"",u=>NHi(Uf.join(e,u),n,c),r),r?.aborted)throw new _o("grep: aborted");return o.length===0?"no matches":o.join(` -`)}async function NHi(t,e,r){let n=ESt.createReadStream(t,{encoding:"utf8"}),o=OHi.createInterface({input:n,crlfDelay:1/0}),s=0;try{for await(let c of o)if(s++,!(c.length>oDc)&&e.test(c)&&!r(`${t}:${s}:${c}`))return!1}catch{}finally{n.destroy()}return!0}function pDc(t,e){let r=Uf.relative(t,e);return r===""||!r.startsWith(".."+Uf.sep)&&r!==".."&&!Uf.isAbsolute(r)}async function gDc(t,e,r,n){let o=mDc;async function s(c,l){if(l>hDc)return!0;if(n?.aborted)return!1;let u;try{u=await n_.readdir(Uf.join(t,c),{withFileTypes:!0})}catch{return!0}for(let d of u){if(d.name===".git"||d.name==="node_modules")continue;if(o--<=0||n?.aborted)return!1;let f=c?Uf.join(c,d.name):d.name;if(d.isDirectory()){if(!await s(f,l+1))return!1}else if(d.isFile()&&await r(f)===!1)return!1}return!0}a(s,"inner"),await s(e,0)}async function ADc(){let t=(process.env.PATH??"").split(Uf.delimiter);for(let e of t){let r=Uf.join(e,"rg");try{return await n_.access(r,ESt.constants.X_OK),r}catch{}}return null}var n_,ESt,Uf,KLr,MHi,OHi,ASt,Wv,T1,D3e,Aie,nk,zLr,PHi,LHi,YLr,DHi,N3e,oDc,sDc,aDc,cDc,ySt,hDc,mDc,GHi=ve(()=>{p();C1();n_=de(require("node:fs/promises"),1),ESt=de(require("node:fs"),1),Uf=de(require("node:path"),1),KLr=de(require("node:child_process"),1),MHi=de(require("node:crypto"),1),OHi=de(require("node:readline"),1);Bf();hie();vHi();jLr();GLr();kHi();PHi=100*1024,LHi=12e4,YLr=256*1024,DHi=YLr,N3e=100*1024,oDc=2e3,sDc=200,aDc=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,cDc=n_.glob;a(lDc,"betaAgentToolset20260401");a(ZEe,"resolvePath");a(uDc,"scrubbedShellEnv");ySt=class{static{a(this,"BashSession")}constructor(e,r=uDc()){ASt.add(this),Wv.set(this,void 0),T1.set(this,""),D3e.set(this,!1),Aie.set(this,!1),nk.set(this,null),qt(this,Wv,KLr.spawn("/bin/bash",["--noprofile","--norc"],{cwd:e,env:{...r,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),xe(this,Wv,"f").stdout.setEncoding("utf8"),xe(this,Wv,"f").stderr.setEncoding("utf8"),xe(this,Wv,"f").stdout.on("data",n=>xe(this,ASt,"m",zLr).call(this,n)),xe(this,Wv,"f").stderr.on("data",n=>xe(this,ASt,"m",zLr).call(this,n)),xe(this,Wv,"f").once("close",()=>{qt(this,Aie,!0,"f");let n=xe(this,nk,"f");qt(this,nk,null,"f"),n?.resolve()})}get closed(){return xe(this,Aie,"f")}async exec(e,r={}){if(xe(this,Aie,"f"))throw new fr("bash session terminated");let n=r.timeoutMs??LHi,o=r.signal;if(o?.aborted)throw new fr("bash command aborted");qt(this,T1,"","f"),qt(this,D3e,!1,"f");let s=`__ANT_CMD_${MHi.randomUUID()}_DONE__`,c=`${s.slice(0,8)}''${s.slice(8)}`,l=`{ ${e} +`)},"run")})}function k$i(t){return Tie({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:a(async({file_path:e,content:r})=>{if(!e)throw new _o("write: file_path is required");let n=await A_e(t,e);try{await c_.mkdir(Gf.dirname(n),{recursive:!0,mode:eFe}),await HBr(n,r??"")}catch(o){throw new _o(`write: ${tFe(o,e)}`)}return`wrote ${Buffer.byteLength(r??"")} bytes to ${e}`},"run")})}function P$i(t){return Tie({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:a(async({file_path:e,old_string:r,new_string:n,replace_all:o})=>{if(!e)throw new _o("edit: file_path is required");if(!r)throw new _o("edit: old_string is required");let s=await A_e(t,e),c;try{let d=await c_.stat(s);if(!d.isFile())throw new _o(`edit: ${e} is not a regular file`);if(d.size>b$i)throw new _o(`edit: ${e} is ${d.size} bytes, exceeds ${b$i}-byte limit. Use bash (sed/awk) to edit a large file.`);c=await c_.readFile(s,"utf8")}catch(d){throw d instanceof _o?d:new _o(`edit: ${tFe(d,e)}`)}let l=c.split(r).length-1;if(l===0)throw new _o(`edit: old_string not found in ${e}`);let u;if(o)u=c.split(r).join(n);else{if(l>1)throw new _o(`edit: old_string appears ${l} times in ${e} (must be unique)`);u=c.replace(r,()=>n)}try{await HBr(s,u)}catch(d){throw new _o(`edit: write: ${tFe(d,e)}`)}return`edited ${e} (${o?l:1} replacement(s))`},"run")})}function D$i(t){return Tie({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:a(async({pattern:e,path:r})=>{if(!e)throw new _o("glob: pattern is required");let n=Gf.resolve(t.workdir),o=e;if(Gf.isAbsolute(e)){if(!t.unrestrictedPaths)throw new _o("glob: absolute pattern not permitted");n=Gf.parse(e).root,o=Gf.relative(n,e)}else r&&(n=await A_e(t,r));if(!t.unrestrictedPaths&&o.split(/[\\/]/).includes(".."))throw new _o('glob: ".." is not permitted in the pattern');let s=[];try{for await(let c of UMc(o,{cwd:n,withFileTypes:!0,exclude:a(l=>l.name===".git"||l.name==="node_modules","exclude")})){if(!c.isFile())continue;let l=Gf.join(c.parentPath,c.name);if(!t.unrestrictedPaths&&!GMc(n,l))continue;let u=0;try{u=(await c_.stat(l)).mtimeMs}catch{}s.push({path:l,mtime:u})}}catch(c){throw new _o(`glob: ${c instanceof Error?c.message:String(c)}`)}return s.length===0?"no matches":(s.sort((c,l)=>l.mtime-c.mtime),s.slice(0,BMc).map(c=>c.path).join(` +`))},"run")})}function N$i(t){return Tie({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:a(async({pattern:e,path:r},n)=>{if(!e)throw new _o("grep: pattern is required");let o=Gf.resolve(t.workdir);r&&(o=await A_e(t,r));let s=await zMc();return s?jMc(s,e,o,n?.signal):HMc(e,o,n?.signal)},"run")})}function jMc(t,e,r,n){return new Promise((o,s)=>{let c=KBr.spawn(t,["-n","--no-heading","-e",e,"--",r],{...n?{signal:n}:{}}),l="",u="",d=!1;c.stdout.on("data",f=>{d||(l+=f,l.length>nFe&&(d=!0,l=l.slice(0,nFe),c.kill("SIGKILL")))}),c.stderr.on("data",f=>u+=f),c.on("close",f=>{if(n?.aborted)return s(new _o("grep: aborted"));if(d)return o(l+` +[output truncated at ${nFe} bytes]`);if(f===0)return o(l);if(f===1)return o("no matches");s(new _o(`grep: rg failed: ${u||`exit ${f}`}`))}),c.on("error",f=>{if(n?.aborted)return s(new _o("grep: aborted"));s(new _o(`grep: rg failed: ${f.message}`))})})}async function HMc(t,e,r){let n;try{n=new RegExp(t)}catch(u){throw new _o(`grep: invalid regex: ${u instanceof Error?u.message:String(u)}`)}let o=[],s=nFe,c=a(u=>(s-=u.length+1,s<0?(o.push(`[output truncated at ${nFe} bytes]`),!1):(o.push(u),!0)),"push");if((await c_.stat(e).catch(()=>null))?.isFile()?await S$i(e,n,c):await WMc(e,"",u=>S$i(Gf.join(e,u),n,c),r),r?.aborted)throw new _o("grep: aborted");return o.length===0?"no matches":o.join(` +`)}async function S$i(t,e,r){let n=$St.createReadStream(t,{encoding:"utf8"}),o=I$i.createInterface({input:n,crlfDelay:1/0}),s=0;try{for await(let c of o)if(s++,!(c.length>LMc)&&e.test(c)&&!r(`${t}:${s}:${c}`))return!1}catch{}finally{n.destroy()}return!0}function GMc(t,e){let r=Gf.relative(t,e);return r===""||!r.startsWith(".."+Gf.sep)&&r!==".."&&!Gf.isAbsolute(r)}async function WMc(t,e,r,n){let o=VMc;async function s(c,l){if(l>$Mc)return!0;if(n?.aborted)return!1;let u;try{u=await c_.readdir(Gf.join(t,c),{withFileTypes:!0})}catch{return!0}for(let d of u){if(d.name===".git"||d.name==="node_modules")continue;if(o--<=0||n?.aborted)return!1;let f=c?Gf.join(c,d.name):d.name;if(d.isDirectory()){if(!await s(f,l+1))return!1}else if(d.isFile()&&await r(f)===!1)return!1}return!0}a(s,"inner"),await s(e,0)}async function zMc(){let t=(process.env.PATH??"").split(Gf.delimiter);for(let e of t){let r=Gf.join(e,"rg");try{return await c_.access(r,$St.constants.X_OK),r}catch{}}return null}var c_,$St,Gf,KBr,T$i,I$i,HSt,Kv,k1,rFe,Iie,pk,zBr,C$i,x$i,YBr,b$i,nFe,LMc,BMc,FMc,UMc,GSt,$Mc,VMc,O$i=Se(()=>{p();x1();c_=fe(require("node:fs/promises"),1),$St=fe(require("node:fs"),1),Gf=fe(require("node:path"),1),KBr=fe(require("node:child_process"),1),T$i=fe(require("node:crypto"),1),I$i=fe(require("node:readline"),1);jf();bie();f$i();jBr();GBr();v$i();C$i=100*1024,x$i=12e4,YBr=256*1024,b$i=YBr,nFe=100*1024,LMc=2e3,BMc=200,FMc=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,UMc=c_.glob;a(QMc,"betaAgentToolset20260401");a(A_e,"resolvePath");a(qMc,"scrubbedShellEnv");GSt=class{static{a(this,"BashSession")}constructor(e,r=qMc()){HSt.add(this),Kv.set(this,void 0),k1.set(this,""),rFe.set(this,!1),Iie.set(this,!1),pk.set(this,null),Qt(this,Kv,KBr.spawn("/bin/bash",["--noprofile","--norc"],{cwd:e,env:{...r,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),Te(this,Kv,"f").stdout.setEncoding("utf8"),Te(this,Kv,"f").stderr.setEncoding("utf8"),Te(this,Kv,"f").stdout.on("data",n=>Te(this,HSt,"m",zBr).call(this,n)),Te(this,Kv,"f").stderr.on("data",n=>Te(this,HSt,"m",zBr).call(this,n)),Te(this,Kv,"f").once("close",()=>{Qt(this,Iie,!0,"f");let n=Te(this,pk,"f");Qt(this,pk,null,"f"),n?.resolve()})}get closed(){return Te(this,Iie,"f")}async exec(e,r={}){if(Te(this,Iie,"f"))throw new fr("bash session terminated");let n=r.timeoutMs??x$i,o=r.signal;if(o?.aborted)throw new fr("bash command aborted");Qt(this,k1,"","f"),Qt(this,rFe,!1,"f");let s=`__ANT_CMD_${T$i.randomUUID()}_DONE__`,c=`${s.slice(0,8)}''${s.slice(8)}`,l=`{ ${e} } &1; printf '\\n${c}%d\\n' $? -`;if(xe(this,Wv,"f").stdin.write(l),xe(this,T1,"f").indexOf(s)<0){let{promise:g,resolve:A}=JEe();qt(this,nk,{sentinel:s,resolve:A},"f");let y,E;try{await Promise.race([g,new Promise((_,v)=>{y=setTimeout(()=>v(new fr(`bash command timed out after ${n}ms`)),n)}),new Promise((_,v)=>{o&&(E=a(()=>v(new fr("bash command aborted")),"onAbort"),o.addEventListener("abort",E,{once:!0}))})])}finally{y&&clearTimeout(y),E&&o&&o.removeEventListener("abort",E),qt(this,nk,null,"f")}}let u=xe(this,T1,"f").indexOf(s);if(u<0)throw new fr("bash session terminated");let f=xe(this,T1,"f").slice(u+s.length).match(/^(-?\d+)/),h=f?parseInt(f[1],10):-1,m=xe(this,T1,"f").slice(0,u).replace(aDc,"").replace(/\n+$/,"");return xe(this,D3e,"f")&&(m=`[output truncated] -${m}`),{output:m,exitCode:h}}close(){if(xe(this,Aie,"f"))return;qt(this,Aie,!0,"f");let e=xe(this,nk,"f");qt(this,nk,null,"f"),e?.resolve(),xe(this,Wv,"f").stdout.destroy(),xe(this,Wv,"f").stderr.destroy(),xe(this,Wv,"f").stdin.destroy();try{process.kill(-xe(this,Wv,"f").pid,"SIGKILL")}catch{xe(this,Wv,"f").kill("SIGKILL")}xe(this,Wv,"f").unref()}};Wv=new WeakMap,T1=new WeakMap,D3e=new WeakMap,Aie=new WeakMap,nk=new WeakMap,ASt=new WeakSet,zLr=a(function(e){if(qt(this,T1,xe(this,T1,"f")+e,"f"),xe(this,T1,"f").length>PHi&&(qt(this,T1,xe(this,T1,"f").slice(xe(this,T1,"f").length-PHi),"f"),qt(this,D3e,!0,"f")),xe(this,nk,"f")&&xe(this,T1,"f").indexOf(xe(this,nk,"f").sentinel)>=0){let r=xe(this,nk,"f");qt(this,nk,null,"f"),r.resolve()}},"_BashSession_append");a(BHi,"betaBashTool");a(FHi,"betaReadTool");a(UHi,"betaWriteTool");a(QHi,"betaEditTool");a(qHi,"betaGlobTool");a(jHi,"betaGrepTool");a(dDc,"runRipgrep");a(fDc,"runWalkGrep");a(NHi,"grepFile");a(pDc,"isWithin");hDc=40,mDc=5e4;a(gDc,"walk");a(ADc,"findRg")});async function EDc(t,e,r,n){try{await t.beta.environments.work.stop(e.id,{environment_id:e.environment_id,force:!0},{...n,headers:vt([n?.headers])})}catch(o){xV(o,409)||r.error("force-stop on exit failed",{work_id:e.id,error:String(o)})}}async function _Dc(t,e,r,n,o){let s=$Hi,c=yDc,l=a(async()=>{try{let u=await t.beta.environments.work.heartbeat(e.id,{environment_id:e.environment_id,expected_last_heartbeat:c},{...o,headers:vt([o?.headers]),signal:r.signal});c=u.last_heartbeat,u.ttl_seconds>0&&(s=Math.max(1e3,Math.min(u.ttl_seconds*1e3/2,$Hi))),(u.state==="stopping"||u.state==="stopped")&&(n.info("heartbeat signals shutdown",{work_id:e.id,state:u.state}),r.abort()),u.lease_extended||(n.warn("lease not extended, shutting down",{work_id:e.id}),r.abort())}catch(u){if(r.signal.throwIfAborted(),wV(u))throw n.error("permanent heartbeat failure",{work_id:e.id,error:String(u)}),r.abort(),u;n.warn("transient heartbeat failure",{work_id:e.id,error:String(u)})}},"beat");for(await l();!r.signal.aborted;)await TN(s,r.signal),r.signal.throwIfAborted(),await l()}var _St,M3e,JLr,$Hi,yDc,XEe,ZLr=ve(()=>{p();C1();Bf();b9();m3e();DEe();S3e();iSt();vc();gSt();uSt();BLr();$Hi=3e4,yDc="NO_HEARTBEAT",XEe=class{static{a(this,"EnvironmentWorker")}constructor(e){_St.add(this),M3e.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.tools=e.tools,this.workdir=e.workdir??process.cwd(),this.unrestrictedPaths=e.unrestrictedPaths,this.maxIdleMs=e.maxIdleMs,this.workerId=e.workerId,this.requestOptions=e.requestOptions,qt(this,M3e,e.signal,"f")}async run(e){let{environmentId:r,environmentKey:n}=this;if(r===void 0||n===void 0)throw new fr("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let o=e??xe(this,M3e,"f"),s=new RV({client:this.client,environmentId:r,environmentKey:n,...this.workerId!==void 0?{workerId:this.workerId}:{},...o?{signal:o}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let c of s)await xe(this,_St,"m",JLr).call(this,c,n,s.signal)}async handleItem(e){let r=e?.workId??_a("ANTHROPIC_WORK_ID"),n=e?.environmentId??_a("ANTHROPIC_ENVIRONMENT_ID"),o=e?.sessionId??_a("ANTHROPIC_SESSION_ID"),s=e?.environmentKey??this.environmentKey??_a("ANTHROPIC_ENVIRONMENT_KEY");if(!r)throw new fr("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!n)throw new fr("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!o)throw new fr("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!s)throw new fr("handleItem: environmentKey is required \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let c={id:r,environment_id:n,data:{type:"session",id:o}};await xe(this,_St,"m",JLr).call(this,c,s,e?.signal??xe(this,M3e,"f"))}};M3e=new WeakMap,_St=new WeakSet,JLr=a(async function(e,r,n){let o=gl(this.client),s=oSt(this.client,{authToken:r,helper:"environments-worker"}),c=e.data.id,l={workdir:this.workdir,client:this.client,sessionId:c,...this.unrestrictedPaths!==void 0?{unrestrictedPaths:this.unrestrictedPaths}:{}},u=await Promise.resolve().then(()=>(GHi(),HHi)),d=a(async()=>{},"cleanupSkills");try{d=await u.setupSkills(l)}catch(A){o.warn("skill setup failed",{session_id:c,work_id:e.id,error:String(A)})}let f=typeof this.tools=="function"?this.tools(l):this.tools??u.betaAgentToolset20260401(l),h=new AbortController,m=pie(n,h),g=_Dc(s,e,h,o,this.requestOptions).catch(A=>{h.signal.aborted||o.error("heartbeat loop failed",{work_id:e.id,error:String(A)}),h.abort()});try{let A=new PV(c,{client:s,tools:f,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:h.signal});for await(let y of A);}finally{h.abort(),m(),await g,await d().catch(A=>{o.warn("skill cleanup failed",{session_id:c,work_id:e.id,error:String(A)})}),await EDc(s,e,o,this.requestOptions)}},"_EnvironmentWorker_handleItem");a(EDc,"forceStop");a(_Dc,"heartbeatLoop")});var DV,XLr=ve(()=>{p();Ul();_d();vc();Ff();uSt();ZLr();uSt();ZLr();DV=class extends Ai{static{a(this,"Work")}retrieve(e,r,n){let{environment_id:o,betas:s}=r;return this._client.get(or`/v1/environments/${o}/work/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{environment_id:o,betas:s,...c}=r;return this._client.post(or`/v1/environments/${o}/work/${e}?beta=true`,{body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/environments/${e}/work?beta=true`,va,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}ack(e,r,n){let{environment_id:o,betas:s}=r;return this._client.post(or`/v1/environments/${o}/work/${e}/ack?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}heartbeat(e,r,n){let{environment_id:o,desired_ttl_seconds:s,expected_last_heartbeat:c,betas:l}=r;return this._client.post(or`/v1/environments/${o}/work/${e}/heartbeat?beta=true`,{query:{desired_ttl_seconds:s,expected_last_heartbeat:c},...n,headers:vt([{"anthropic-beta":[...l??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poll(e,r={},n){let{betas:o,"Anthropic-Worker-ID":s,...c}=r??{};return this._client.get(or`/v1/environments/${e}/work/poll?beta=true`,{query:c,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"Anthropic-Worker-ID":s}:void 0},n?.headers])})}stats(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/environments/${e}/work/stats?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stop(e,r,n){let{environment_id:o,betas:s,...c}=r;return this._client.post(or`/v1/environments/${o}/work/${e}/stop?beta=true`,{body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poller(e){return new RV({...e,client:this._client})}worker(e){return new XEe({...e,client:this._client})}};DV.WorkPoller=RV;DV.EnvironmentWorker=XEe});var yie,eBr=ve(()=>{p();Ul();XLr();XLr();_d();vc();Ff();yie=class extends Ai{static{a(this,"Environments")}constructor(){super(...arguments),this.work=new DV(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/environments/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/environments/${e}?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/environments?beta=true",va,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/environments/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/environments/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};yie.Work=DV});var e_e,tBr=ve(()=>{p();Ul();_d();vc();Ff();e_e=class extends Ai{static{a(this,"Memories")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post(or`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(or`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{memory_store_id:o,view:s,betas:c,...l}=r;return this._client.post(or`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:vt([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/memory_stores/${e}/memories?beta=true`,va,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{memory_store_id:o,expected_content_sha256:s,betas:c}=r;return this._client.delete(or`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:vt([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var t_e,rBr=ve(()=>{p();Ul();_d();vc();Ff();t_e=class extends Ai{static{a(this,"MemoryVersions")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(or`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/memory_stores/${e}/memory_versions?beta=true`,va,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}redact(e,r,n){let{memory_store_id:o,betas:s}=r;return this._client.post(or`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var NV,nBr=ve(()=>{p();Ul();tBr();tBr();rBr();rBr();_d();vc();Ff();NV=class extends Ai{static{a(this,"MemoryStores")}constructor(){super(...arguments),this.memories=new e_e(this._client),this.memoryVersions=new t_e(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/memory_stores/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",va,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/memory_stores/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};NV.Memories=e_e;NV.MemoryVersions=t_e});var r_e=ve(()=>{p();Bf()});var n_e,iBr=ve(()=>{p();Bf();NEe();ALr();n_e=class t{static{a(this,"JSONLDecoder")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new S9;for await(let r of this.iterator)for(let n of e.decode(r))yield JSON.parse(n);for(let r of e.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,r){if(!e.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new fr("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new fr("Attempted to iterate over a response with no body");return new t(p3e(e.body),r)}}});var i_e,oBr=ve(()=>{p();Ul();_d();vc();iBr();r_e();Ff();i_e=class extends Ai{static{a(this,"Batches")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/messages/batches?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/messages/batches/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",tk,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/messages/batches/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,r={},n){let o=await this.retrieve(e);if(!o.results_url)throw new fr(`No batch \`results_url\`; Has it finished processing? ${o.processing_status} - ${o.id}`);let{betas:s}=r??{};return this._client.get(o.results_url,{...n,headers:vt([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>n_e.fromResponse(l.response,l.controller))}}});var vSt,sBr=ve(()=>{p();vSt={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function VHi(t){return t?.output_format??t?.output_config?.format}function aBr(t,e,r){let n=VHi(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>{if(o.type==="text"){let s=Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return o}),parsed_output:null}:cBr(t,e,r)}function cBr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=xDc(e,s.text);n===null&&(n=c);let l=Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1});return Object.defineProperty(l,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),c},enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function xDc(t,e){let r=VHi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new fr(`Failed to parse structured output: ${n}`)}}var lBr=ve(()=>{p();Bf();a(VHi,"getOutputFormat");a(aBr,"maybeParseBetaMessage");a(cBr,"parseBetaMessage");a(xDc,"parseBetaOutputFormat")});var wDc,o_e,RDc,kDc,CSt,uBr=ve(()=>{p();wDc=a(t=>{let e=0,r=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),o_e(t);break;case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),o_e(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),o_e(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),o_e(t);break;case"delimiter":return t=t.slice(0,t.length-1),o_e(t);break}return t},"strip"),RDc=a(t=>{let e=[];return t.map(r=>{r.type==="brace"&&(r.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(r=>{r==="}"?t.push({type:"brace",value:"}"}):r==="]"&&t.push({type:"paren",value:"]"})}),t},"unstrip"),kDc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"generate"),CSt=a(t=>JSON.parse(kDc(RDc(o_e(wDc(t))))),"partialParse")});var dBr=ve(()=>{p();ELr()});function KHi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var ik,MV,s_e,O3e,bSt,L3e,B3e,SSt,F3e,I9,U3e,TSt,ISt,Eie,xSt,wSt,Q3e,fBr,WHi,RSt,pBr,hBr,mBr,zHi,YHi,kSt,JHi=ve(()=>{p();C1();uBr();r_e();CEe();dBr();lBr();YHi="__json_buf";a(KHi,"tracksToolInput");kSt=class t{static{a(this,"BetaMessageStream")}constructor(e,r){ik.add(this),this.messages=[],this.receivedMessages=[],MV.set(this,void 0),s_e.set(this,null),this.controller=new AbortController,O3e.set(this,void 0),bSt.set(this,()=>{}),L3e.set(this,()=>{}),B3e.set(this,void 0),SSt.set(this,()=>{}),F3e.set(this,()=>{}),I9.set(this,{}),U3e.set(this,!1),TSt.set(this,!1),ISt.set(this,!1),Eie.set(this,!1),xSt.set(this,void 0),wSt.set(this,void 0),Q3e.set(this,void 0),RSt.set(this,n=>{if(qt(this,TSt,!0,"f"),v9(n)&&(n=new Ty),n instanceof Ty)return qt(this,ISt,!0,"f"),this._emit("abort",n);if(n instanceof fr)return this._emit("error",n);if(n instanceof Error){let o=new fr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new fr(String(n)))}),qt(this,O3e,new Promise((n,o)=>{qt(this,bSt,n,"f"),qt(this,L3e,o,"f")}),"f"),qt(this,B3e,new Promise((n,o)=>{qt(this,SSt,n,"f"),qt(this,F3e,o,"f")}),"f"),xe(this,O3e,"f").catch(()=>{}),xe(this,B3e,"f").catch(()=>{}),qt(this,s_e,e,"f"),qt(this,Q3e,r?.logger??console,"f")}get response(){return xe(this,xSt,"f")}get request_id(){return xe(this,wSt,"f")}async withResponse(){qt(this,Eie,!0,"f");let e=await xe(this,O3e,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return qt(s,s_e,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},xe(this,RSt,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{xe(this,ik,"m",pBr).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)xe(this,ik,"m",hBr).call(this,u);if(l.controller.signal?.aborted)throw new Ty;xe(this,ik,"m",mBr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(qt(this,xSt,e,"f"),qt(this,wSt,e?.headers.get("request-id"),"f"),xe(this,bSt,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,U3e,"f")}get errored(){return xe(this,TSt,"f")}get aborted(){return xe(this,ISt,"f")}abort(){this.controller.abort()}on(e,r){return(xe(this,I9,"f")[e]||(xe(this,I9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=xe(this,I9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(xe(this,I9,"f")[e]||(xe(this,I9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{qt(this,Eie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){qt(this,Eie,!0,"f"),await xe(this,B3e,"f")}get currentMessage(){return xe(this,MV,"f")}async finalMessage(){return await this.done(),xe(this,ik,"m",fBr).call(this)}async finalText(){return await this.done(),xe(this,ik,"m",WHi).call(this)}_emit(e,...r){if(xe(this,U3e,"f"))return;e==="end"&&(qt(this,U3e,!0,"f"),xe(this,SSt,"f").call(this));let n=xe(this,I9,"f")[e];if(n&&(xe(this,I9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!xe(this,Eie,"f")&&!n?.length&&Promise.reject(o),xe(this,L3e,"f").call(this,o),xe(this,F3e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!xe(this,Eie,"f")&&!n?.length&&Promise.reject(o),xe(this,L3e,"f").call(this,o),xe(this,F3e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,ik,"m",fBr).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{xe(this,ik,"m",pBr).call(this),this._connected(null);let s=OL.fromReadableStream(e,this.controller);for await(let c of s)xe(this,ik,"m",hBr).call(this,c);if(s.controller.signal?.aborted)throw new Ty;xe(this,ik,"m",mBr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(MV=new WeakMap,s_e=new WeakMap,O3e=new WeakMap,bSt=new WeakMap,L3e=new WeakMap,B3e=new WeakMap,SSt=new WeakMap,F3e=new WeakMap,I9=new WeakMap,U3e=new WeakMap,TSt=new WeakMap,ISt=new WeakMap,Eie=new WeakMap,xSt=new WeakMap,wSt=new WeakMap,Q3e=new WeakMap,RSt=new WeakMap,ik=new WeakSet,fBr=a(function(){if(this.receivedMessages.length===0)throw new fr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_BetaMessageStream_getFinalMessage"),WHi=a(function(){if(this.receivedMessages.length===0)throw new fr("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(n=>n.type==="text").map(n=>n.text);if(r.length===0)throw new fr("stream ended without producing a content block with type=text");return r.join(" ")},"_BetaMessageStream_getFinalText"),pBr=a(function(){this.ended||qt(this,MV,void 0,"f")},"_BetaMessageStream_beginRequest"),hBr=a(function(r){if(this.ended)return;let n=xe(this,ik,"m",zHi).call(this,r);switch(this._emit("streamEvent",r,n),r.type){case"content_block_delta":{let o=n.content.at(-1);switch(r.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",r.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",r.delta.citation,o.citations??[]);break}case"input_json_delta":{KHi(o)&&o.input&&this._emit("inputJson",r.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",r.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}case"compaction_delta":{o.type==="compaction"&&o.content&&this._emit("compaction",o.content);break}default:r.delta}break}case"message_stop":{this._addMessageParam(n),this._addMessage(aBr(n,xe(this,s_e,"f"),{logger:xe(this,Q3e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{qt(this,MV,n,"f");break}case"content_block_start":case"message_delta":break}},"_BetaMessageStream_addStreamEvent"),mBr=a(function(){if(this.ended)throw new fr("stream has ended, this shouldn't happen");let r=xe(this,MV,"f");if(!r)throw new fr("request ended without sending any chunks");return qt(this,MV,void 0,"f"),aBr(r,xe(this,s_e,"f"),{logger:xe(this,Q3e,"f")})},"_BetaMessageStream_endRequest"),zHi=a(function(r){let n=xe(this,MV,"f");if(r.type==="message_start"){if(n)throw new fr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new fr(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return n;case"message_delta":return n.container=r.delta.container,n.stop_reason=r.delta.stop_reason,n.stop_sequence=r.delta.stop_sequence,n.usage.output_tokens=r.usage.output_tokens,n.context_management=r.context_management,r.usage.input_tokens!=null&&(n.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(n.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(n.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(n.usage.server_tool_use=r.usage.server_tool_use),r.usage.iterations!=null&&(n.usage.iterations=r.usage.iterations),n;case"content_block_start":return n.content.push(r.content_block),n;case"content_block_delta":{let o=n.content.at(r.index);switch(r.delta.type){case"text_delta":{o?.type==="text"&&(n.content[r.index]={...o,text:(o.text||"")+r.delta.text});break}case"citations_delta":{o?.type==="text"&&(n.content[r.index]={...o,citations:[...o.citations??[],r.delta.citation]});break}case"input_json_delta":{if(o&&KHi(o)){let s=o[YHi]||"";s+=r.delta.partial_json;let c={...o};if(Object.defineProperty(c,YHi,{value:s,enumerable:!1,writable:!0}),s)try{c.input=CSt(s)}catch(l){let u=new fr(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${l}. JSON: ${s}`);xe(this,RSt,"f").call(this,u)}n.content[r.index]=c}break}case"thinking_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,thinking:o.thinking+r.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,signature:r.delta.signature});break}case"compaction_delta":{o?.type==="compaction"&&(n.content[r.index]={...o,content:(o.content||"")+r.delta.content});break}default:r.delta}return n}case"content_block_stop":return n}},"_BetaMessageStream_accumulateMessage"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((s,c)=>r.push({resolve:s,reject:c})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new OL(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var ZHi,XHi=ve(()=>{p();ZHi=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: +`;if(Te(this,Kv,"f").stdin.write(l),Te(this,k1,"f").indexOf(s)<0){let{promise:g,resolve:A}=g_e();Qt(this,pk,{sentinel:s,resolve:A},"f");let y,E;try{await Promise.race([g,new Promise((_,v)=>{y=setTimeout(()=>v(new fr(`bash command timed out after ${n}ms`)),n)}),new Promise((_,v)=>{o&&(E=a(()=>v(new fr("bash command aborted")),"onAbort"),o.addEventListener("abort",E,{once:!0}))})])}finally{y&&clearTimeout(y),E&&o&&o.removeEventListener("abort",E),Qt(this,pk,null,"f")}}let u=Te(this,k1,"f").indexOf(s);if(u<0)throw new fr("bash session terminated");let f=Te(this,k1,"f").slice(u+s.length).match(/^(-?\d+)/),h=f?parseInt(f[1],10):-1,m=Te(this,k1,"f").slice(0,u).replace(FMc,"").replace(/\n+$/,"");return Te(this,rFe,"f")&&(m=`[output truncated] +${m}`),{output:m,exitCode:h}}close(){if(Te(this,Iie,"f"))return;Qt(this,Iie,!0,"f");let e=Te(this,pk,"f");Qt(this,pk,null,"f"),e?.resolve(),Te(this,Kv,"f").stdout.destroy(),Te(this,Kv,"f").stderr.destroy(),Te(this,Kv,"f").stdin.destroy();try{process.kill(-Te(this,Kv,"f").pid,"SIGKILL")}catch{Te(this,Kv,"f").kill("SIGKILL")}Te(this,Kv,"f").unref()}};Kv=new WeakMap,k1=new WeakMap,rFe=new WeakMap,Iie=new WeakMap,pk=new WeakMap,HSt=new WeakSet,zBr=a(function(e){if(Qt(this,k1,Te(this,k1,"f")+e,"f"),Te(this,k1,"f").length>C$i&&(Qt(this,k1,Te(this,k1,"f").slice(Te(this,k1,"f").length-C$i),"f"),Qt(this,rFe,!0,"f")),Te(this,pk,"f")&&Te(this,k1,"f").indexOf(Te(this,pk,"f").sentinel)>=0){let r=Te(this,pk,"f");Qt(this,pk,null,"f"),r.resolve()}},"_BashSession_append");a(w$i,"betaBashTool");a(R$i,"betaReadTool");a(k$i,"betaWriteTool");a(P$i,"betaEditTool");a(D$i,"betaGlobTool");a(N$i,"betaGrepTool");a(jMc,"runRipgrep");a(HMc,"runWalkGrep");a(S$i,"grepFile");a(GMc,"isWithin");$Mc=40,VMc=5e4;a(WMc,"walk");a(zMc,"findRg")});async function KMc(t,e,r,n){try{await t.beta.environments.work.stop(e.id,{environment_id:e.environment_id,force:!0},{...n,headers:Et([n?.headers])})}catch(o){FV(o,409)||r.error("force-stop on exit failed",{work_id:e.id,error:String(o)})}}async function JMc(t,e,r,n,o){let s=L$i,c=YMc,l=a(async()=>{try{let u=await t.beta.environments.work.heartbeat(e.id,{environment_id:e.environment_id,expected_last_heartbeat:c},{...o,headers:Et([o?.headers]),signal:r.signal});c=u.last_heartbeat,u.ttl_seconds>0&&(s=Math.max(1e3,Math.min(u.ttl_seconds*1e3/2,L$i))),(u.state==="stopping"||u.state==="stopped")&&(n.info("heartbeat signals shutdown",{work_id:e.id,state:u.state}),r.abort()),u.lease_extended||(n.warn("lease not extended, shutting down",{work_id:e.id}),r.abort())}catch(u){if(r.signal.throwIfAborted(),UV(u))throw n.error("permanent heartbeat failure",{work_id:e.id,error:String(u)}),r.abort(),u;n.warn("transient heartbeat failure",{work_id:e.id,error:String(u)})}},"beat");for(await l();!r.signal.aborted;)await NN(s,r.signal),r.signal.throwIfAborted(),await l()}var VSt,iFe,JBr,L$i,YMc,y_e,ZBr=Se(()=>{p();x1();jf();M9();U3e();JEe();z3e();kSt();Sc();jSt();LSt();BBr();L$i=3e4,YMc="NO_HEARTBEAT",y_e=class{static{a(this,"EnvironmentWorker")}constructor(e){VSt.add(this),iFe.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.tools=e.tools,this.workdir=e.workdir??process.cwd(),this.unrestrictedPaths=e.unrestrictedPaths,this.maxIdleMs=e.maxIdleMs,this.workerId=e.workerId,this.requestOptions=e.requestOptions,Qt(this,iFe,e.signal,"f")}async run(e){let{environmentId:r,environmentKey:n}=this;if(r===void 0||n===void 0)throw new fr("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let o=e??Te(this,iFe,"f"),s=new QV({client:this.client,environmentId:r,environmentKey:n,...this.workerId!==void 0?{workerId:this.workerId}:{},...o?{signal:o}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let c of s)await Te(this,VSt,"m",JBr).call(this,c,n,s.signal)}async handleItem(e){let r=e?.workId??_a("ANTHROPIC_WORK_ID"),n=e?.environmentId??_a("ANTHROPIC_ENVIRONMENT_ID"),o=e?.sessionId??_a("ANTHROPIC_SESSION_ID"),s=e?.environmentKey??this.environmentKey??_a("ANTHROPIC_ENVIRONMENT_KEY");if(!r)throw new fr("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!n)throw new fr("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!o)throw new fr("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!s)throw new fr("handleItem: environmentKey is required \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let c={id:r,environment_id:n,data:{type:"session",id:o}};await Te(this,VSt,"m",JBr).call(this,c,s,e?.signal??Te(this,iFe,"f"))}};iFe=new WeakMap,VSt=new WeakSet,JBr=a(async function(e,r,n){let o=Al(this.client),s=PSt(this.client,{authToken:r,helper:"environments-worker"}),c=e.data.id,l={workdir:this.workdir,client:this.client,sessionId:c,...this.unrestrictedPaths!==void 0?{unrestrictedPaths:this.unrestrictedPaths}:{}},u=await Promise.resolve().then(()=>(O$i(),M$i)),d=a(async()=>{},"cleanupSkills");try{d=await u.setupSkills(l)}catch(A){o.warn("skill setup failed",{session_id:c,work_id:e.id,error:String(A)})}let f=typeof this.tools=="function"?this.tools(l):this.tools??u.betaAgentToolset20260401(l),h=new AbortController,m=Cie(n,h),g=JMc(s,e,h,o,this.requestOptions).catch(A=>{h.signal.aborted||o.error("heartbeat loop failed",{work_id:e.id,error:String(A)}),h.abort()});try{let A=new jV(c,{client:s,tools:f,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:h.signal});for await(let y of A);}finally{h.abort(),m(),await g,await d().catch(A=>{o.warn("skill cleanup failed",{session_id:c,work_id:e.id,error:String(A)})}),await KMc(s,e,o,this.requestOptions)}},"_EnvironmentWorker_handleItem");a(KMc,"forceStop");a(JMc,"heartbeatLoop")});var HV,XBr=Se(()=>{p();Ul();Td();Sc();Hf();LSt();ZBr();LSt();ZBr();HV=class extends Ai{static{a(this,"Work")}retrieve(e,r,n){let{environment_id:o,betas:s}=r;return this._client.get(or`/v1/environments/${o}/work/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{environment_id:o,betas:s,...c}=r;return this._client.post(or`/v1/environments/${o}/work/${e}?beta=true`,{body:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/environments/${e}/work?beta=true`,va,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}ack(e,r,n){let{environment_id:o,betas:s}=r;return this._client.post(or`/v1/environments/${o}/work/${e}/ack?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}heartbeat(e,r,n){let{environment_id:o,desired_ttl_seconds:s,expected_last_heartbeat:c,betas:l}=r;return this._client.post(or`/v1/environments/${o}/work/${e}/heartbeat?beta=true`,{query:{desired_ttl_seconds:s,expected_last_heartbeat:c},...n,headers:Et([{"anthropic-beta":[...l??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poll(e,r={},n){let{betas:o,"Anthropic-Worker-ID":s,...c}=r??{};return this._client.get(or`/v1/environments/${e}/work/poll?beta=true`,{query:c,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"Anthropic-Worker-ID":s}:void 0},n?.headers])})}stats(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/environments/${e}/work/stats?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stop(e,r,n){let{environment_id:o,betas:s,...c}=r;return this._client.post(or`/v1/environments/${o}/work/${e}/stop?beta=true`,{body:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poller(e){return new QV({...e,client:this._client})}worker(e){return new y_e({...e,client:this._client})}};HV.WorkPoller=QV;HV.EnvironmentWorker=y_e});var xie,e3r=Se(()=>{p();Ul();XBr();XBr();Td();Sc();Hf();xie=class extends Ai{static{a(this,"Environments")}constructor(){super(...arguments),this.work=new HV(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/environments/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/environments/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/environments?beta=true",va,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/environments/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/environments/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};xie.Work=HV});var E_e,t3r=Se(()=>{p();Ul();Td();Sc();Hf();E_e=class extends Ai{static{a(this,"Memories")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post(or`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(or`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{memory_store_id:o,view:s,betas:c,...l}=r;return this._client.post(or`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:Et([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/memory_stores/${e}/memories?beta=true`,va,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{memory_store_id:o,expected_content_sha256:s,betas:c}=r;return this._client.delete(or`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:Et([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var __e,r3r=Se(()=>{p();Ul();Td();Sc();Hf();__e=class extends Ai{static{a(this,"MemoryVersions")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(or`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/memory_stores/${e}/memory_versions?beta=true`,va,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}redact(e,r,n){let{memory_store_id:o,betas:s}=r;return this._client.post(or`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var GV,n3r=Se(()=>{p();Ul();t3r();t3r();r3r();r3r();Td();Sc();Hf();GV=class extends Ai{static{a(this,"MemoryStores")}constructor(){super(...arguments),this.memories=new E_e(this._client),this.memoryVersions=new __e(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/memory_stores/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",va,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/memory_stores/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};GV.Memories=E_e;GV.MemoryVersions=__e});var v_e=Se(()=>{p();jf()});var C_e,i3r=Se(()=>{p();jf();ZEe();ABr();C_e=class t{static{a(this,"JSONLDecoder")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new O9;for await(let r of this.iterator)for(let n of e.decode(r))yield JSON.parse(n);for(let r of e.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,r){if(!e.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new fr("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new fr("Attempted to iterate over a response with no body");return new t(B3e(e.body),r)}}});var b_e,o3r=Se(()=>{p();Ul();Td();Sc();i3r();v_e();Hf();b_e=class extends Ai{static{a(this,"Batches")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/messages/batches?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/messages/batches/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",dk,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/messages/batches/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,r={},n){let o=await this.retrieve(e);if(!o.results_url)throw new fr(`No batch \`results_url\`; Has it finished processing? ${o.processing_status} - ${o.id}`);let{betas:s}=r??{};return this._client.get(o.results_url,{...n,headers:Et([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>C_e.fromResponse(l.response,l.controller))}}});var WSt,s3r=Se(()=>{p();WSt={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function B$i(t){return t?.output_format??t?.output_config?.format}function a3r(t,e,r){let n=B$i(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>{if(o.type==="text"){let s=Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return o}),parsed_output:null}:c3r(t,e,r)}function c3r(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=iOc(e,s.text);n===null&&(n=c);let l=Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1});return Object.defineProperty(l,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),c},enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function iOc(t,e){let r=B$i(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new fr(`Failed to parse structured output: ${n}`)}}var l3r=Se(()=>{p();jf();a(B$i,"getOutputFormat");a(a3r,"maybeParseBetaMessage");a(c3r,"parseBetaMessage");a(iOc,"parseBetaOutputFormat")});var oOc,S_e,sOc,aOc,zSt,u3r=Se(()=>{p();oOc=a(t=>{let e=0,r=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),S_e(t);break;case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),S_e(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),S_e(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),S_e(t);break;case"delimiter":return t=t.slice(0,t.length-1),S_e(t);break}return t},"strip"),sOc=a(t=>{let e=[];return t.map(r=>{r.type==="brace"&&(r.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(r=>{r==="}"?t.push({type:"brace",value:"}"}):r==="]"&&t.push({type:"paren",value:"]"})}),t},"unstrip"),aOc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"generate"),zSt=a(t=>JSON.parse(aOc(sOc(S_e(oOc(t))))),"partialParse")});var d3r=Se(()=>{p();EBr()});function q$i(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var hk,$V,T_e,oFe,YSt,sFe,aFe,KSt,cFe,B9,lFe,JSt,ZSt,wie,XSt,eTt,uFe,f3r,F$i,tTt,p3r,h3r,m3r,U$i,Q$i,rTt,j$i=Se(()=>{p();x1();u3r();v_e();qEe();d3r();l3r();Q$i="__json_buf";a(q$i,"tracksToolInput");rTt=class t{static{a(this,"BetaMessageStream")}constructor(e,r){hk.add(this),this.messages=[],this.receivedMessages=[],$V.set(this,void 0),T_e.set(this,null),this.controller=new AbortController,oFe.set(this,void 0),YSt.set(this,()=>{}),sFe.set(this,()=>{}),aFe.set(this,void 0),KSt.set(this,()=>{}),cFe.set(this,()=>{}),B9.set(this,{}),lFe.set(this,!1),JSt.set(this,!1),ZSt.set(this,!1),wie.set(this,!1),XSt.set(this,void 0),eTt.set(this,void 0),uFe.set(this,void 0),tTt.set(this,n=>{if(Qt(this,JSt,!0,"f"),D9(n)&&(n=new Ry),n instanceof Ry)return Qt(this,ZSt,!0,"f"),this._emit("abort",n);if(n instanceof fr)return this._emit("error",n);if(n instanceof Error){let o=new fr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new fr(String(n)))}),Qt(this,oFe,new Promise((n,o)=>{Qt(this,YSt,n,"f"),Qt(this,sFe,o,"f")}),"f"),Qt(this,aFe,new Promise((n,o)=>{Qt(this,KSt,n,"f"),Qt(this,cFe,o,"f")}),"f"),Te(this,oFe,"f").catch(()=>{}),Te(this,aFe,"f").catch(()=>{}),Qt(this,T_e,e,"f"),Qt(this,uFe,r?.logger??console,"f")}get response(){return Te(this,XSt,"f")}get request_id(){return Te(this,eTt,"f")}async withResponse(){Qt(this,wie,!0,"f");let e=await Te(this,oFe,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return Qt(s,T_e,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},Te(this,tTt,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{Te(this,hk,"m",p3r).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)Te(this,hk,"m",h3r).call(this,u);if(l.controller.signal?.aborted)throw new Ry;Te(this,hk,"m",m3r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(Qt(this,XSt,e,"f"),Qt(this,eTt,e?.headers.get("request-id"),"f"),Te(this,YSt,"f").call(this,e),this._emit("connect"))}get ended(){return Te(this,lFe,"f")}get errored(){return Te(this,JSt,"f")}get aborted(){return Te(this,ZSt,"f")}abort(){this.controller.abort()}on(e,r){return(Te(this,B9,"f")[e]||(Te(this,B9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=Te(this,B9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(Te(this,B9,"f")[e]||(Te(this,B9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{Qt(this,wie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){Qt(this,wie,!0,"f"),await Te(this,aFe,"f")}get currentMessage(){return Te(this,$V,"f")}async finalMessage(){return await this.done(),Te(this,hk,"m",f3r).call(this)}async finalText(){return await this.done(),Te(this,hk,"m",F$i).call(this)}_emit(e,...r){if(Te(this,lFe,"f"))return;e==="end"&&(Qt(this,lFe,!0,"f"),Te(this,KSt,"f").call(this));let n=Te(this,B9,"f")[e];if(n&&(Te(this,B9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!Te(this,wie,"f")&&!n?.length&&Promise.reject(o),Te(this,sFe,"f").call(this,o),Te(this,cFe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!Te(this,wie,"f")&&!n?.length&&Promise.reject(o),Te(this,sFe,"f").call(this,o),Te(this,cFe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",Te(this,hk,"m",f3r).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{Te(this,hk,"m",p3r).call(this),this._connected(null);let s=UL.fromReadableStream(e,this.controller);for await(let c of s)Te(this,hk,"m",h3r).call(this,c);if(s.controller.signal?.aborted)throw new Ry;Te(this,hk,"m",m3r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[($V=new WeakMap,T_e=new WeakMap,oFe=new WeakMap,YSt=new WeakMap,sFe=new WeakMap,aFe=new WeakMap,KSt=new WeakMap,cFe=new WeakMap,B9=new WeakMap,lFe=new WeakMap,JSt=new WeakMap,ZSt=new WeakMap,wie=new WeakMap,XSt=new WeakMap,eTt=new WeakMap,uFe=new WeakMap,tTt=new WeakMap,hk=new WeakSet,f3r=a(function(){if(this.receivedMessages.length===0)throw new fr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_BetaMessageStream_getFinalMessage"),F$i=a(function(){if(this.receivedMessages.length===0)throw new fr("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(n=>n.type==="text").map(n=>n.text);if(r.length===0)throw new fr("stream ended without producing a content block with type=text");return r.join(" ")},"_BetaMessageStream_getFinalText"),p3r=a(function(){this.ended||Qt(this,$V,void 0,"f")},"_BetaMessageStream_beginRequest"),h3r=a(function(r){if(this.ended)return;let n=Te(this,hk,"m",U$i).call(this,r);switch(this._emit("streamEvent",r,n),r.type){case"content_block_delta":{let o=n.content.at(-1);switch(r.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",r.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",r.delta.citation,o.citations??[]);break}case"input_json_delta":{q$i(o)&&o.input&&this._emit("inputJson",r.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",r.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}case"compaction_delta":{o.type==="compaction"&&o.content&&this._emit("compaction",o.content);break}default:r.delta}break}case"message_stop":{this._addMessageParam(n),this._addMessage(a3r(n,Te(this,T_e,"f"),{logger:Te(this,uFe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{Qt(this,$V,n,"f");break}case"content_block_start":case"message_delta":break}},"_BetaMessageStream_addStreamEvent"),m3r=a(function(){if(this.ended)throw new fr("stream has ended, this shouldn't happen");let r=Te(this,$V,"f");if(!r)throw new fr("request ended without sending any chunks");return Qt(this,$V,void 0,"f"),a3r(r,Te(this,T_e,"f"),{logger:Te(this,uFe,"f")})},"_BetaMessageStream_endRequest"),U$i=a(function(r){let n=Te(this,$V,"f");if(r.type==="message_start"){if(n)throw new fr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new fr(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return n;case"message_delta":return n.container=r.delta.container,n.stop_reason=r.delta.stop_reason,n.stop_sequence=r.delta.stop_sequence,n.usage.output_tokens=r.usage.output_tokens,n.context_management=r.context_management,r.usage.input_tokens!=null&&(n.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(n.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(n.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(n.usage.server_tool_use=r.usage.server_tool_use),r.usage.iterations!=null&&(n.usage.iterations=r.usage.iterations),n;case"content_block_start":return n.content.push(r.content_block),n;case"content_block_delta":{let o=n.content.at(r.index);switch(r.delta.type){case"text_delta":{o?.type==="text"&&(n.content[r.index]={...o,text:(o.text||"")+r.delta.text});break}case"citations_delta":{o?.type==="text"&&(n.content[r.index]={...o,citations:[...o.citations??[],r.delta.citation]});break}case"input_json_delta":{if(o&&q$i(o)){let s=o[Q$i]||"";s+=r.delta.partial_json;let c={...o};if(Object.defineProperty(c,Q$i,{value:s,enumerable:!1,writable:!0}),s)try{c.input=zSt(s)}catch(l){let u=new fr(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${l}. JSON: ${s}`);Te(this,tTt,"f").call(this,u)}n.content[r.index]=c}break}case"thinking_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,thinking:o.thinking+r.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,signature:r.delta.signature});break}case"compaction_delta":{o?.type==="compaction"&&(n.content[r.index]={...o,content:(o.content||"")+r.delta.content});break}default:r.delta}return n}case"content_block_stop":return n}},"_BetaMessageStream_accumulateMessage"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((s,c)=>r.push({resolve:s,reject:c})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new UL(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var H$i,G$i=Se(()=>{p();H$i=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: 1. Task Overview The user's core request and success criteria Any clarifications or constraints they specified @@ -1491,65 +1491,65 @@ User preferences or style requirements Domain-specific details that aren't obvious Any promises made to the user Be concise but complete\u2014err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task. -Wrap your summary in tags.`});async function DDc(t,e=t.messages.at(-1),r){if(!e||e.role!=="assistant"||!e.content||typeof e.content=="string")return null;let n=e.content.filter(s=>s.type==="tool_use");return n.length===0?null:{role:"user",content:await Promise.all(n.map(async s=>{let c=t.tools.find(l=>("name"in l?l.name:l.mcp_server_name)===s.name);if(!c||!("run"in c))return{type:"tool_result",tool_use_id:s.id,content:`Error: Tool '${s.name}' not found`,is_error:!0};try{let l=s.input;"parse"in c&&c.parse&&(l=c.parse(l));let u=await c.run(l,{toolUse:s,toolUseBlock:s,signal:r?.signal});return{type:"tool_result",tool_use_id:s.id,content:u}}catch(l){return{type:"tool_result",tool_use_id:s.id,content:l instanceof _o?l.content:`Error: ${l instanceof Error?l.message:String(l)}`,is_error:!0}}}))}}var q3e,a_e,_ie,U0,I1,CI,x9,OV,j3e,eGi,gBr,c_e,ABr=ve(()=>{p();C1();hie();Bf();vc();jLr();XHi();C3e();c_e=class{static{a(this,"BetaToolRunner")}constructor(e,r,n){q3e.add(this),this.client=e,a_e.set(this,!1),_ie.set(this,!1),U0.set(this,void 0),I1.set(this,void 0),CI.set(this,void 0),x9.set(this,void 0),OV.set(this,void 0),j3e.set(this,0),qt(this,U0,{params:{...r,messages:structuredClone(r.messages)}},"f");let s=["BetaToolRunner",...xLr(r.tools,r.messages)].join(", ");qt(this,I1,{...n,headers:vt([{"x-stainless-helper":s},n?.headers])},"f"),qt(this,OV,JEe(),"f"),r.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(a_e=new WeakMap,_ie=new WeakMap,U0=new WeakMap,I1=new WeakMap,CI=new WeakMap,x9=new WeakMap,OV=new WeakMap,j3e=new WeakMap,q3e=new WeakSet,eGi=a(async function(){let r=xe(this,U0,"f").params.compactionControl;if(!r||!r.enabled)return!1;let n=0;if(xe(this,CI,"f")!==void 0)try{let d=await xe(this,CI,"f");n=d.usage.input_tokens+(d.usage.cache_creation_input_tokens??0)+(d.usage.cache_read_input_tokens??0)+d.usage.output_tokens}catch{return!1}let o=r.contextTokenThreshold??1e5;if(nh.type!=="tool_use");f.length===0?l.pop():d.content=f}}let u=await this.client.beta.messages.create({model:s,messages:[...l,{role:"user",content:[{type:"text",text:c}]}],max_tokens:xe(this,U0,"f").params.max_tokens},{signal:xe(this,I1,"f").signal,headers:vt([xe(this,I1,"f").headers,{"x-stainless-helper":"compaction"}])});if(u.content[0]?.type!=="text")throw new fr("Expected text response for compaction");return xe(this,U0,"f").params.messages=[{role:"user",content:u.content}],!0},"_BetaToolRunner_checkAndCompact"),Symbol.asyncIterator)](){var e;if(xe(this,a_e,"f"))throw new fr("Cannot iterate over a consumed stream");qt(this,a_e,!0,"f"),qt(this,_ie,!0,"f"),qt(this,x9,void 0,"f");try{for(;;){let r;try{if(xe(this,U0,"f").params.max_iterations&&xe(this,j3e,"f")>=xe(this,U0,"f").params.max_iterations)break;qt(this,_ie,!1,"f"),qt(this,x9,void 0,"f"),qt(this,j3e,(e=xe(this,j3e,"f"),e++,e),"f"),qt(this,CI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=xe(this,U0,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},xe(this,I1,"f")),qt(this,CI,r.finalMessage(),"f"),xe(this,CI,"f").catch(()=>{}),yield r):(qt(this,CI,this.client.beta.messages.create({...s,stream:!1},xe(this,I1,"f")),"f"),yield xe(this,CI,"f")),!await xe(this,q3e,"m",eGi).call(this)){if(!xe(this,_ie,"f")){let{role:u,content:d}=await xe(this,CI,"f");xe(this,U0,"f").params.messages.push({role:u,content:d})}let l=await xe(this,q3e,"m",gBr).call(this,xe(this,U0,"f").params.messages.at(-1));if(l)xe(this,U0,"f").params.messages.push(l);else if(!xe(this,_ie,"f"))break}}finally{r&&r.abort()}}if(!xe(this,CI,"f"))throw new fr("ToolRunner concluded without a message from the server");xe(this,OV,"f").resolve(await xe(this,CI,"f"))}catch(r){throw qt(this,a_e,!1,"f"),xe(this,OV,"f").promise.catch(()=>{}),xe(this,OV,"f").reject(r),qt(this,OV,JEe(),"f"),r}}setMessagesParams(e){typeof e=="function"?xe(this,U0,"f").params=e(xe(this,U0,"f").params):xe(this,U0,"f").params=e,qt(this,_ie,!0,"f"),qt(this,x9,void 0,"f")}setRequestOptions(e){typeof e=="function"?qt(this,I1,e(xe(this,I1,"f")),"f"):qt(this,I1,{...xe(this,I1,"f"),...e},"f")}async generateToolResponse(e=xe(this,I1,"f").signal){let r=await xe(this,CI,"f")??this.params.messages.at(-1);return r?xe(this,q3e,"m",gBr).call(this,r,e):null}done(){return xe(this,OV,"f").promise}async runUntilDone(){if(!xe(this,a_e,"f"))for await(let e of this);return this.done()}get params(){return xe(this,U0,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};gBr=a(async function(e,r=xe(this,I1,"f").signal){return xe(this,x9,"f")!==void 0?xe(this,x9,"f"):(qt(this,x9,DDc(xe(this,U0,"f").params,e,{...xe(this,I1,"f"),signal:r}),"f"),xe(this,x9,"f"))},"_BetaToolRunner_generateToolResponse");a(DDc,"generateToolResponse")});function rGi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new fr("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:e,...r}=t;return{...r,output_config:{...t.output_config,format:e}}}var tGi,NDc,w9,yBr=ve(()=>{p();r_e();oBr();Ul();sBr();vc();C3e();lBr();JHi();ABr();hie();oBr();ABr();hie();tGi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},NDc=["claude-mythos-preview","claude-opus-4-6"],w9=class extends Ai{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new i_e(this._client)}create(e,r){let n=rGi(e),{betas:o,...s}=n;s.model in tGi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${tGi[s.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),NDc.includes(s.model)&&s.thinking&&s.thinking.type==="enabled"&&console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let c=this._client._options.timeout;if(!s.stream&&c==null){let u=vSt[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=eSt(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:vt([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:vt([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>cBr(n,e,{logger:this._client.logger??console}))}stream(e,r){return kSt.createMessage(this,e,r)}countTokens(e,r){let n=rGi(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:vt([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new c_e(this._client,e,r)}};a(rGi,"transformOutputFormat");w9.Batches=i_e;w9.BetaToolRunner=c_e;w9.ToolError=_o});var vie,EBr=ve(()=>{p();Ul();_d();vc();Ff();gSt();gSt();vie=class extends Ai{static{a(this,"Events")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/sessions/${e}/events?beta=true`,va,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}toolRunner(e,r){return new PV(e,{...r,client:this._client})}};vie.SessionToolRunner=PV});var l_e,_Br=ve(()=>{p();Ul();_d();vc();Ff();l_e=class extends Ai{static{a(this,"Resources")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(or`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.post(or`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/sessions/${e}/resources?beta=true`,va,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{session_id:o,betas:s}=r;return this._client.delete(or`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var u_e,vBr=ve(()=>{p();Ul();_d();vc();Ff();u_e=class extends Ai{static{a(this,"Events")}list(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.getAPIList(or`/v1/sessions/${o}/threads/${e}/events?beta=true`,va,{query:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(or`/v1/sessions/${o}/threads/${e}/stream?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}}});var Cie,CBr=ve(()=>{p();Ul();vBr();vBr();_d();vc();Ff();Cie=class extends Ai{static{a(this,"Threads")}constructor(){super(...arguments),this.events=new u_e(this._client)}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(or`/v1/sessions/${o}/threads/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/sessions/${e}/threads?beta=true`,va,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{session_id:o,betas:s}=r;return this._client.post(or`/v1/sessions/${o}/threads/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Cie.Events=u_e});var R9,bBr=ve(()=>{p();Ul();EBr();EBr();_Br();_Br();CBr();CBr();_d();vc();Ff();R9=class extends Ai{static{a(this,"Sessions")}constructor(){super(...arguments),this.events=new vie(this._client),this.resources=new l_e(this._client),this.threads=new Cie(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/sessions/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/sessions?beta=true",va,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/sessions/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/sessions/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};R9.Events=vie;R9.Resources=l_e;R9.Threads=Cie});var d_e,SBr=ve(()=>{p();Ul();_d();vc();FEe();Ff();d_e=class extends Ai{static{a(this,"Versions")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(or`/v1/skills/${e}/versions?beta=true`,BEe({body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])},this._client))}retrieve(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get(or`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/skills/${e}/versions?beta=true`,va,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}delete(e,r,n){let{skill_id:o,betas:s}=r;return this._client.delete(or`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}download(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get(or`/v1/skills/${o}/versions/${e}/content?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}}});var bie,TBr=ve(()=>{p();Ul();SBr();SBr();_d();vc();FEe();Ff();bie=class extends Ai{static{a(this,"Skills")}constructor(){super(...arguments),this.versions=new d_e(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",BEe({body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])},this._client,!1))}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/skills/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/skills?beta=true",va,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/skills/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};bie.Versions=d_e});var f_e,IBr=ve(()=>{p();Ul();_d();vc();Ff();f_e=class extends Ai{static{a(this,"Credentials")}create(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{vault_id:o,betas:s}=r;return this._client.get(or`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{vault_id:o,betas:s,...c}=r;return this._client.post(or`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/vaults/${e}/credentials?beta=true`,va,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{vault_id:o,betas:s}=r;return this._client.delete(or`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post(or`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}mcpOAuthValidate(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post(or`/v1/vaults/${o}/credentials/${e}/mcp_oauth_validate?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Sie,xBr=ve(()=>{p();Ul();IBr();IBr();_d();vc();Ff();Sie=class extends Ai{static{a(this,"Vaults")}constructor(){super(...arguments),this.credentials=new f_e(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/vaults/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/vaults?beta=true",va,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/vaults/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/vaults/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Sie.Credentials=f_e});var iA,wBr=ve(()=>{p();Ul();wLr();wLr();RLr();RLr();kLr();kLr();NLr();NLr();OLr();OLr();eBr();eBr();nBr();nBr();yBr();yBr();bBr();bBr();TBr();TBr();xBr();xBr();iA=class extends Ai{static{a(this,"Beta")}constructor(){super(...arguments),this.models=new QEe(this._client),this.messages=new w9(this._client),this.agents=new fie(this._client),this.environments=new yie(this._client),this.sessions=new R9(this._client),this.vaults=new Sie(this._client),this.memoryStores=new NV(this._client),this.files=new UEe(this._client),this.skills=new bie(this._client),this.webhooks=new HEe(this._client),this.userProfiles=new qEe(this._client)}};iA.Models=QEe;iA.Messages=w9;iA.Agents=fie;iA.Environments=yie;iA.Sessions=R9;iA.Vaults=Sie;iA.MemoryStores=NV;iA.Files=UEe;iA.Skills=bie;iA.Webhooks=HEe;iA.UserProfiles=qEe});var Tie,RBr=ve(()=>{p();Ul();vc();Tie=class extends Ai{static{a(this,"Completions")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...r,headers:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}}});function nGi(t){return t?.output_config?.format}function kBr(t,e,r){let n=nGi(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>o.type==="text"?Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1}):o),parsed_output:null}:PBr(t,e,r)}function PBr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=GDc(e,s.text);return n===null&&(n=c),Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function GDc(t,e){let r=nGi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new fr(`Failed to parse structured output: ${n}`)}}var DBr=ve(()=>{p();Bf();a(nGi,"getOutputFormat");a(kBr,"maybeParseMessage");a(PBr,"parseMessage");a(GDc,"parseOutputFormat")});function aGi(t){return t.type==="tool_use"||t.type==="server_tool_use"}var ok,LV,p_e,H3e,PSt,G3e,$3e,DSt,V3e,k9,W3e,NSt,MSt,Iie,OSt,LSt,z3e,NBr,iGi,MBr,OBr,LBr,BBr,oGi,sGi,BSt,cGi=ve(()=>{p();C1();CEe();r_e();dBr();uBr();DBr();sGi="__json_buf";a(aGi,"tracksToolInput");BSt=class t{static{a(this,"MessageStream")}constructor(e,r){ok.add(this),this.messages=[],this.receivedMessages=[],LV.set(this,void 0),p_e.set(this,null),this.controller=new AbortController,H3e.set(this,void 0),PSt.set(this,()=>{}),G3e.set(this,()=>{}),$3e.set(this,void 0),DSt.set(this,()=>{}),V3e.set(this,()=>{}),k9.set(this,{}),W3e.set(this,!1),NSt.set(this,!1),MSt.set(this,!1),Iie.set(this,!1),OSt.set(this,void 0),LSt.set(this,void 0),z3e.set(this,void 0),MBr.set(this,n=>{if(qt(this,NSt,!0,"f"),v9(n)&&(n=new Ty),n instanceof Ty)return qt(this,MSt,!0,"f"),this._emit("abort",n);if(n instanceof fr)return this._emit("error",n);if(n instanceof Error){let o=new fr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new fr(String(n)))}),qt(this,H3e,new Promise((n,o)=>{qt(this,PSt,n,"f"),qt(this,G3e,o,"f")}),"f"),qt(this,$3e,new Promise((n,o)=>{qt(this,DSt,n,"f"),qt(this,V3e,o,"f")}),"f"),xe(this,H3e,"f").catch(()=>{}),xe(this,$3e,"f").catch(()=>{}),qt(this,p_e,e,"f"),qt(this,z3e,r?.logger??console,"f")}get response(){return xe(this,OSt,"f")}get request_id(){return xe(this,LSt,"f")}async withResponse(){qt(this,Iie,!0,"f");let e=await xe(this,H3e,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return qt(s,p_e,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},xe(this,MBr,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{xe(this,ok,"m",OBr).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)xe(this,ok,"m",LBr).call(this,u);if(l.controller.signal?.aborted)throw new Ty;xe(this,ok,"m",BBr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(qt(this,OSt,e,"f"),qt(this,LSt,e?.headers.get("request-id"),"f"),xe(this,PSt,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,W3e,"f")}get errored(){return xe(this,NSt,"f")}get aborted(){return xe(this,MSt,"f")}abort(){this.controller.abort()}on(e,r){return(xe(this,k9,"f")[e]||(xe(this,k9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=xe(this,k9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(xe(this,k9,"f")[e]||(xe(this,k9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{qt(this,Iie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){qt(this,Iie,!0,"f"),await xe(this,$3e,"f")}get currentMessage(){return xe(this,LV,"f")}async finalMessage(){return await this.done(),xe(this,ok,"m",NBr).call(this)}async finalText(){return await this.done(),xe(this,ok,"m",iGi).call(this)}_emit(e,...r){if(xe(this,W3e,"f"))return;e==="end"&&(qt(this,W3e,!0,"f"),xe(this,DSt,"f").call(this));let n=xe(this,k9,"f")[e];if(n&&(xe(this,k9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!xe(this,Iie,"f")&&!n?.length&&Promise.reject(o),xe(this,G3e,"f").call(this,o),xe(this,V3e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!xe(this,Iie,"f")&&!n?.length&&Promise.reject(o),xe(this,G3e,"f").call(this,o),xe(this,V3e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,ok,"m",NBr).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{xe(this,ok,"m",OBr).call(this),this._connected(null);let s=OL.fromReadableStream(e,this.controller);for await(let c of s)xe(this,ok,"m",LBr).call(this,c);if(s.controller.signal?.aborted)throw new Ty;xe(this,ok,"m",BBr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(LV=new WeakMap,p_e=new WeakMap,H3e=new WeakMap,PSt=new WeakMap,G3e=new WeakMap,$3e=new WeakMap,DSt=new WeakMap,V3e=new WeakMap,k9=new WeakMap,W3e=new WeakMap,NSt=new WeakMap,MSt=new WeakMap,Iie=new WeakMap,OSt=new WeakMap,LSt=new WeakMap,z3e=new WeakMap,MBr=new WeakMap,ok=new WeakSet,NBr=a(function(){if(this.receivedMessages.length===0)throw new fr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_MessageStream_getFinalMessage"),iGi=a(function(){if(this.receivedMessages.length===0)throw new fr("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(n=>n.type==="text").map(n=>n.text);if(r.length===0)throw new fr("stream ended without producing a content block with type=text");return r.join(" ")},"_MessageStream_getFinalText"),OBr=a(function(){this.ended||qt(this,LV,void 0,"f")},"_MessageStream_beginRequest"),LBr=a(function(r){if(this.ended)return;let n=xe(this,ok,"m",oGi).call(this,r);switch(this._emit("streamEvent",r,n),r.type){case"content_block_delta":{let o=n.content.at(-1);switch(r.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",r.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",r.delta.citation,o.citations??[]);break}case"input_json_delta":{aGi(o)&&o.input&&this._emit("inputJson",r.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",r.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}default:r.delta}break}case"message_stop":{this._addMessageParam(n),this._addMessage(kBr(n,xe(this,p_e,"f"),{logger:xe(this,z3e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{qt(this,LV,n,"f");break}case"content_block_start":case"message_delta":break}},"_MessageStream_addStreamEvent"),BBr=a(function(){if(this.ended)throw new fr("stream has ended, this shouldn't happen");let r=xe(this,LV,"f");if(!r)throw new fr("request ended without sending any chunks");return qt(this,LV,void 0,"f"),kBr(r,xe(this,p_e,"f"),{logger:xe(this,z3e,"f")})},"_MessageStream_endRequest"),oGi=a(function(r){let n=xe(this,LV,"f");if(r.type==="message_start"){if(n)throw new fr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new fr(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return n;case"message_delta":return n.stop_reason=r.delta.stop_reason,n.stop_sequence=r.delta.stop_sequence,n.usage.output_tokens=r.usage.output_tokens,r.usage.input_tokens!=null&&(n.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(n.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(n.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(n.usage.server_tool_use=r.usage.server_tool_use),n;case"content_block_start":return n.content.push({...r.content_block}),n;case"content_block_delta":{let o=n.content.at(r.index);switch(r.delta.type){case"text_delta":{o?.type==="text"&&(n.content[r.index]={...o,text:(o.text||"")+r.delta.text});break}case"citations_delta":{o?.type==="text"&&(n.content[r.index]={...o,citations:[...o.citations??[],r.delta.citation]});break}case"input_json_delta":{if(o&&aGi(o)){let s=o[sGi]||"";s+=r.delta.partial_json;let c={...o};Object.defineProperty(c,sGi,{value:s,enumerable:!1,writable:!0}),s&&(c.input=CSt(s)),n.content[r.index]=c}break}case"thinking_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,thinking:o.thinking+r.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,signature:r.delta.signature});break}default:r.delta}return n}case"content_block_stop":return n}},"_MessageStream_accumulateMessage"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((s,c)=>r.push({resolve:s,reject:c})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new OL(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var h_e,FBr=ve(()=>{p();Ul();_d();vc();iBr();r_e();Ff();h_e=class extends Ai{static{a(this,"Batches")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get(or`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",tk,{query:e,...r})}delete(e,r){return this._client.delete(or`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post(or`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new fr(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:vt([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>n_e.fromResponse(s.response,s.controller))}}});var BV,lGi,VDc,UBr=ve(()=>{p();Ul();vc();C3e();cGi();DBr();FBr();FBr();sBr();BV=class extends Ai{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new h_e(this._client)}create(e,r){e.model in lGi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${lGi[e.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),VDc.includes(e.model)&&e.thinking&&e.thinking.type==="enabled"&&console.warn(`Using Claude with ${e.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let n=this._client._options.timeout;if(!e.stream&&n==null){let s=vSt[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=eSt(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:vt([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>PBr(n,e,{logger:this._client.logger??console}))}stream(e,r){return BSt.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},lGi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026"},VDc=["claude-mythos-preview","claude-opus-4-6"];BV.Batches=h_e});var xie,QBr=ve(()=>{p();Ul();_d();vc();Ff();xie=class extends Ai{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/models/${e}`,{...n,headers:vt([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models",tk,{query:o,...r,headers:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var uGi=ve(()=>{p();Hji();wBr();RBr();UBr();QBr()});var qBr,jBr,FSt,dGi,fGi,pGi,Qf,BL,HBr=ve(()=>{p();C1();D1t();NL();DEe();CEe();O1t();NEe();nji();cLr();d3e();Bf();OEe();vji();Fji();_d();ILr();uGi();Y1t();RBr();QBr();wBr();UBr();O1t();vc();m3e();b9();NL();fGi="\\n\\nHuman:",pGi="\\n\\nAssistant:",Qf=class{static{a(this,"BaseAnthropic")}get credentials(){return this._authState.provider}constructor({baseURL:e=_a("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,webhookKey:o=_a("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...s}={}){if(qBr.add(this),this._requestAuthFlags=new WeakMap,FSt.set(this,void 0),r===void 0&&(r=s.profile!=null?null:_a("ANTHROPIC_API_KEY")??null),n===void 0&&(n=s.profile!=null?null:_a("ANTHROPIC_AUTH_TOKEN")??null),s.profile!=null&&(s.credentials!=null||s.config!=null))throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let c={apiKey:r,authToken:n,webhookKey:o,...s,baseURL:e||"https://api.anthropic.com"};if(!c.dangerouslyAllowBrowser&&Xqi())throw new fr(`It looks like you're running in a browser-like environment. +Wrap your summary in tags.`});async function lOc(t,e=t.messages.at(-1),r){if(!e||e.role!=="assistant"||!e.content||typeof e.content=="string")return null;let n=e.content.filter(s=>s.type==="tool_use");return n.length===0?null:{role:"user",content:await Promise.all(n.map(async s=>{let c=t.tools.find(l=>("name"in l?l.name:l.mcp_server_name)===s.name);if(!c||!("run"in c))return{type:"tool_result",tool_use_id:s.id,content:`Error: Tool '${s.name}' not found`,is_error:!0};try{let l=s.input;"parse"in c&&c.parse&&(l=c.parse(l));let u=await c.run(l,{toolUse:s,toolUseBlock:s,signal:r?.signal});return{type:"tool_result",tool_use_id:s.id,content:u}}catch(l){return{type:"tool_result",tool_use_id:s.id,content:l instanceof _o?l.content:`Error: ${l instanceof Error?l.message:String(l)}`,is_error:!0}}}))}}var dFe,I_e,Rie,q0,P1,wI,F9,VV,fFe,$$i,g3r,x_e,A3r=Se(()=>{p();x1();bie();jf();Sc();jBr();G$i();V3e();x_e=class{static{a(this,"BetaToolRunner")}constructor(e,r,n){dFe.add(this),this.client=e,I_e.set(this,!1),Rie.set(this,!1),q0.set(this,void 0),P1.set(this,void 0),wI.set(this,void 0),F9.set(this,void 0),VV.set(this,void 0),fFe.set(this,0),Qt(this,q0,{params:{...r,messages:structuredClone(r.messages)}},"f");let s=["BetaToolRunner",...xBr(r.tools,r.messages)].join(", ");Qt(this,P1,{...n,headers:Et([{"x-stainless-helper":s},n?.headers])},"f"),Qt(this,VV,g_e(),"f"),r.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(I_e=new WeakMap,Rie=new WeakMap,q0=new WeakMap,P1=new WeakMap,wI=new WeakMap,F9=new WeakMap,VV=new WeakMap,fFe=new WeakMap,dFe=new WeakSet,$$i=a(async function(){let r=Te(this,q0,"f").params.compactionControl;if(!r||!r.enabled)return!1;let n=0;if(Te(this,wI,"f")!==void 0)try{let d=await Te(this,wI,"f");n=d.usage.input_tokens+(d.usage.cache_creation_input_tokens??0)+(d.usage.cache_read_input_tokens??0)+d.usage.output_tokens}catch{return!1}let o=r.contextTokenThreshold??1e5;if(nh.type!=="tool_use");f.length===0?l.pop():d.content=f}}let u=await this.client.beta.messages.create({model:s,messages:[...l,{role:"user",content:[{type:"text",text:c}]}],max_tokens:Te(this,q0,"f").params.max_tokens},{signal:Te(this,P1,"f").signal,headers:Et([Te(this,P1,"f").headers,{"x-stainless-helper":"compaction"}])});if(u.content[0]?.type!=="text")throw new fr("Expected text response for compaction");return Te(this,q0,"f").params.messages=[{role:"user",content:u.content}],!0},"_BetaToolRunner_checkAndCompact"),Symbol.asyncIterator)](){var e;if(Te(this,I_e,"f"))throw new fr("Cannot iterate over a consumed stream");Qt(this,I_e,!0,"f"),Qt(this,Rie,!0,"f"),Qt(this,F9,void 0,"f");try{for(;;){let r;try{if(Te(this,q0,"f").params.max_iterations&&Te(this,fFe,"f")>=Te(this,q0,"f").params.max_iterations)break;Qt(this,Rie,!1,"f"),Qt(this,F9,void 0,"f"),Qt(this,fFe,(e=Te(this,fFe,"f"),e++,e),"f"),Qt(this,wI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=Te(this,q0,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},Te(this,P1,"f")),Qt(this,wI,r.finalMessage(),"f"),Te(this,wI,"f").catch(()=>{}),yield r):(Qt(this,wI,this.client.beta.messages.create({...s,stream:!1},Te(this,P1,"f")),"f"),yield Te(this,wI,"f")),!await Te(this,dFe,"m",$$i).call(this)){if(!Te(this,Rie,"f")){let{role:u,content:d}=await Te(this,wI,"f");Te(this,q0,"f").params.messages.push({role:u,content:d})}let l=await Te(this,dFe,"m",g3r).call(this,Te(this,q0,"f").params.messages.at(-1));if(l)Te(this,q0,"f").params.messages.push(l);else if(!Te(this,Rie,"f"))break}}finally{r&&r.abort()}}if(!Te(this,wI,"f"))throw new fr("ToolRunner concluded without a message from the server");Te(this,VV,"f").resolve(await Te(this,wI,"f"))}catch(r){throw Qt(this,I_e,!1,"f"),Te(this,VV,"f").promise.catch(()=>{}),Te(this,VV,"f").reject(r),Qt(this,VV,g_e(),"f"),r}}setMessagesParams(e){typeof e=="function"?Te(this,q0,"f").params=e(Te(this,q0,"f").params):Te(this,q0,"f").params=e,Qt(this,Rie,!0,"f"),Qt(this,F9,void 0,"f")}setRequestOptions(e){typeof e=="function"?Qt(this,P1,e(Te(this,P1,"f")),"f"):Qt(this,P1,{...Te(this,P1,"f"),...e},"f")}async generateToolResponse(e=Te(this,P1,"f").signal){let r=await Te(this,wI,"f")??this.params.messages.at(-1);return r?Te(this,dFe,"m",g3r).call(this,r,e):null}done(){return Te(this,VV,"f").promise}async runUntilDone(){if(!Te(this,I_e,"f"))for await(let e of this);return this.done()}get params(){return Te(this,q0,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};g3r=a(async function(e,r=Te(this,P1,"f").signal){return Te(this,F9,"f")!==void 0?Te(this,F9,"f"):(Qt(this,F9,lOc(Te(this,q0,"f").params,e,{...Te(this,P1,"f"),signal:r}),"f"),Te(this,F9,"f"))},"_BetaToolRunner_generateToolResponse");a(lOc,"generateToolResponse")});function W$i(t){if(!t.output_format)return t;if(t.output_config?.format)throw new fr("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:e,...r}=t;return{...r,output_config:{...t.output_config,format:e}}}var V$i,uOc,U9,y3r=Se(()=>{p();v_e();o3r();Ul();s3r();Sc();V3e();l3r();j$i();A3r();bie();o3r();A3r();bie();V$i={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},uOc=["claude-mythos-preview","claude-opus-4-6"],U9=class extends Ai{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new b_e(this._client)}create(e,r){let n=W$i(e),{betas:o,...s}=n;s.model in V$i&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${V$i[s.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),uOc.includes(s.model)&&s.thinking&&s.thinking.type==="enabled"&&console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let c=this._client._options.timeout;if(!s.stream&&c==null){let u=WSt[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=ISt(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:Et([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:Et([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>c3r(n,e,{logger:this._client.logger??console}))}stream(e,r){return rTt.createMessage(this,e,r)}countTokens(e,r){let n=W$i(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:Et([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new x_e(this._client,e,r)}};a(W$i,"transformOutputFormat");U9.Batches=b_e;U9.BetaToolRunner=x_e;U9.ToolError=_o});var kie,E3r=Se(()=>{p();Ul();Td();Sc();Hf();jSt();jSt();kie=class extends Ai{static{a(this,"Events")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/sessions/${e}/events?beta=true`,va,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}toolRunner(e,r){return new jV(e,{...r,client:this._client})}};kie.SessionToolRunner=jV});var w_e,_3r=Se(()=>{p();Ul();Td();Sc();Hf();w_e=class extends Ai{static{a(this,"Resources")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(or`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.post(or`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/sessions/${e}/resources?beta=true`,va,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{session_id:o,betas:s}=r;return this._client.delete(or`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var R_e,v3r=Se(()=>{p();Ul();Td();Sc();Hf();R_e=class extends Ai{static{a(this,"Events")}list(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.getAPIList(or`/v1/sessions/${o}/threads/${e}/events?beta=true`,va,{query:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(or`/v1/sessions/${o}/threads/${e}/stream?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}}});var Pie,C3r=Se(()=>{p();Ul();v3r();v3r();Td();Sc();Hf();Pie=class extends Ai{static{a(this,"Threads")}constructor(){super(...arguments),this.events=new R_e(this._client)}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(or`/v1/sessions/${o}/threads/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/sessions/${e}/threads?beta=true`,va,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{session_id:o,betas:s}=r;return this._client.post(or`/v1/sessions/${o}/threads/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Pie.Events=R_e});var Q9,b3r=Se(()=>{p();Ul();E3r();E3r();_3r();_3r();C3r();C3r();Td();Sc();Hf();Q9=class extends Ai{static{a(this,"Sessions")}constructor(){super(...arguments),this.events=new kie(this._client),this.resources=new w_e(this._client),this.threads=new Pie(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/sessions/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/sessions?beta=true",va,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/sessions/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/sessions/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Q9.Events=kie;Q9.Resources=w_e;Q9.Threads=Pie});var k_e,S3r=Se(()=>{p();Ul();Td();Sc();n_e();Hf();k_e=class extends Ai{static{a(this,"Versions")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(or`/v1/skills/${e}/versions?beta=true`,r_e({body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])},this._client))}retrieve(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get(or`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/skills/${e}/versions?beta=true`,va,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}delete(e,r,n){let{skill_id:o,betas:s}=r;return this._client.delete(or`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}download(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get(or`/v1/skills/${o}/versions/${e}/content?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}}});var Die,T3r=Se(()=>{p();Ul();S3r();S3r();Td();Sc();n_e();Hf();Die=class extends Ai{static{a(this,"Skills")}constructor(){super(...arguments),this.versions=new k_e(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",r_e({body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])},this._client,!1))}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/skills/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/skills?beta=true",va,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/skills/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};Die.Versions=k_e});var P_e,I3r=Se(()=>{p();Ul();Td();Sc();Hf();P_e=class extends Ai{static{a(this,"Credentials")}create(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{vault_id:o,betas:s}=r;return this._client.get(or`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{vault_id:o,betas:s,...c}=r;return this._client.post(or`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(or`/v1/vaults/${e}/credentials?beta=true`,va,{query:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{vault_id:o,betas:s}=r;return this._client.delete(or`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post(or`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}mcpOAuthValidate(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post(or`/v1/vaults/${o}/credentials/${e}/mcp_oauth_validate?beta=true`,{...n,headers:Et([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Nie,x3r=Se(()=>{p();Ul();I3r();I3r();Td();Sc();Hf();Nie=class extends Ai{static{a(this,"Vaults")}constructor(){super(...arguments),this.credentials=new P_e(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/vaults/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(or`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/vaults?beta=true",va,{query:o,...r,headers:Et([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(or`/v1/vaults/${e}?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(or`/v1/vaults/${e}/archive?beta=true`,{...n,headers:Et([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Nie.Credentials=P_e});var aA,w3r=Se(()=>{p();Ul();wBr();wBr();RBr();RBr();kBr();kBr();NBr();NBr();OBr();OBr();e3r();e3r();n3r();n3r();y3r();y3r();b3r();b3r();T3r();T3r();x3r();x3r();aA=class extends Ai{static{a(this,"Beta")}constructor(){super(...arguments),this.models=new o_e(this._client),this.messages=new U9(this._client),this.agents=new vie(this._client),this.environments=new xie(this._client),this.sessions=new Q9(this._client),this.vaults=new Nie(this._client),this.memoryStores=new GV(this._client),this.files=new i_e(this._client),this.skills=new Die(this._client),this.webhooks=new c_e(this._client),this.userProfiles=new s_e(this._client)}};aA.Models=o_e;aA.Messages=U9;aA.Agents=vie;aA.Environments=xie;aA.Sessions=Q9;aA.Vaults=Nie;aA.MemoryStores=GV;aA.Files=i_e;aA.Skills=Die;aA.Webhooks=c_e;aA.UserProfiles=s_e});var Mie,R3r=Se(()=>{p();Ul();Sc();Mie=class extends Ai{static{a(this,"Completions")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...r,headers:Et([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}}});function z$i(t){return t?.output_config?.format}function k3r(t,e,r){let n=z$i(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>o.type==="text"?Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1}):o),parsed_output:null}:P3r(t,e,r)}function P3r(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=vOc(e,s.text);return n===null&&(n=c),Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function vOc(t,e){let r=z$i(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new fr(`Failed to parse structured output: ${n}`)}}var D3r=Se(()=>{p();jf();a(z$i,"getOutputFormat");a(k3r,"maybeParseMessage");a(P3r,"parseMessage");a(vOc,"parseOutputFormat")});function Z$i(t){return t.type==="tool_use"||t.type==="server_tool_use"}var mk,WV,D_e,pFe,nTt,hFe,mFe,iTt,gFe,q9,AFe,oTt,sTt,Oie,aTt,cTt,yFe,N3r,Y$i,M3r,O3r,L3r,B3r,K$i,J$i,lTt,X$i=Se(()=>{p();x1();qEe();v_e();d3r();u3r();D3r();J$i="__json_buf";a(Z$i,"tracksToolInput");lTt=class t{static{a(this,"MessageStream")}constructor(e,r){mk.add(this),this.messages=[],this.receivedMessages=[],WV.set(this,void 0),D_e.set(this,null),this.controller=new AbortController,pFe.set(this,void 0),nTt.set(this,()=>{}),hFe.set(this,()=>{}),mFe.set(this,void 0),iTt.set(this,()=>{}),gFe.set(this,()=>{}),q9.set(this,{}),AFe.set(this,!1),oTt.set(this,!1),sTt.set(this,!1),Oie.set(this,!1),aTt.set(this,void 0),cTt.set(this,void 0),yFe.set(this,void 0),M3r.set(this,n=>{if(Qt(this,oTt,!0,"f"),D9(n)&&(n=new Ry),n instanceof Ry)return Qt(this,sTt,!0,"f"),this._emit("abort",n);if(n instanceof fr)return this._emit("error",n);if(n instanceof Error){let o=new fr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new fr(String(n)))}),Qt(this,pFe,new Promise((n,o)=>{Qt(this,nTt,n,"f"),Qt(this,hFe,o,"f")}),"f"),Qt(this,mFe,new Promise((n,o)=>{Qt(this,iTt,n,"f"),Qt(this,gFe,o,"f")}),"f"),Te(this,pFe,"f").catch(()=>{}),Te(this,mFe,"f").catch(()=>{}),Qt(this,D_e,e,"f"),Qt(this,yFe,r?.logger??console,"f")}get response(){return Te(this,aTt,"f")}get request_id(){return Te(this,cTt,"f")}async withResponse(){Qt(this,Oie,!0,"f");let e=await Te(this,pFe,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return Qt(s,D_e,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},Te(this,M3r,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{Te(this,mk,"m",O3r).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)Te(this,mk,"m",L3r).call(this,u);if(l.controller.signal?.aborted)throw new Ry;Te(this,mk,"m",B3r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(Qt(this,aTt,e,"f"),Qt(this,cTt,e?.headers.get("request-id"),"f"),Te(this,nTt,"f").call(this,e),this._emit("connect"))}get ended(){return Te(this,AFe,"f")}get errored(){return Te(this,oTt,"f")}get aborted(){return Te(this,sTt,"f")}abort(){this.controller.abort()}on(e,r){return(Te(this,q9,"f")[e]||(Te(this,q9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=Te(this,q9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(Te(this,q9,"f")[e]||(Te(this,q9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{Qt(this,Oie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){Qt(this,Oie,!0,"f"),await Te(this,mFe,"f")}get currentMessage(){return Te(this,WV,"f")}async finalMessage(){return await this.done(),Te(this,mk,"m",N3r).call(this)}async finalText(){return await this.done(),Te(this,mk,"m",Y$i).call(this)}_emit(e,...r){if(Te(this,AFe,"f"))return;e==="end"&&(Qt(this,AFe,!0,"f"),Te(this,iTt,"f").call(this));let n=Te(this,q9,"f")[e];if(n&&(Te(this,q9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!Te(this,Oie,"f")&&!n?.length&&Promise.reject(o),Te(this,hFe,"f").call(this,o),Te(this,gFe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!Te(this,Oie,"f")&&!n?.length&&Promise.reject(o),Te(this,hFe,"f").call(this,o),Te(this,gFe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",Te(this,mk,"m",N3r).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{Te(this,mk,"m",O3r).call(this),this._connected(null);let s=UL.fromReadableStream(e,this.controller);for await(let c of s)Te(this,mk,"m",L3r).call(this,c);if(s.controller.signal?.aborted)throw new Ry;Te(this,mk,"m",B3r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(WV=new WeakMap,D_e=new WeakMap,pFe=new WeakMap,nTt=new WeakMap,hFe=new WeakMap,mFe=new WeakMap,iTt=new WeakMap,gFe=new WeakMap,q9=new WeakMap,AFe=new WeakMap,oTt=new WeakMap,sTt=new WeakMap,Oie=new WeakMap,aTt=new WeakMap,cTt=new WeakMap,yFe=new WeakMap,M3r=new WeakMap,mk=new WeakSet,N3r=a(function(){if(this.receivedMessages.length===0)throw new fr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_MessageStream_getFinalMessage"),Y$i=a(function(){if(this.receivedMessages.length===0)throw new fr("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(n=>n.type==="text").map(n=>n.text);if(r.length===0)throw new fr("stream ended without producing a content block with type=text");return r.join(" ")},"_MessageStream_getFinalText"),O3r=a(function(){this.ended||Qt(this,WV,void 0,"f")},"_MessageStream_beginRequest"),L3r=a(function(r){if(this.ended)return;let n=Te(this,mk,"m",K$i).call(this,r);switch(this._emit("streamEvent",r,n),r.type){case"content_block_delta":{let o=n.content.at(-1);switch(r.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",r.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",r.delta.citation,o.citations??[]);break}case"input_json_delta":{Z$i(o)&&o.input&&this._emit("inputJson",r.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",r.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}default:r.delta}break}case"message_stop":{this._addMessageParam(n),this._addMessage(k3r(n,Te(this,D_e,"f"),{logger:Te(this,yFe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{Qt(this,WV,n,"f");break}case"content_block_start":case"message_delta":break}},"_MessageStream_addStreamEvent"),B3r=a(function(){if(this.ended)throw new fr("stream has ended, this shouldn't happen");let r=Te(this,WV,"f");if(!r)throw new fr("request ended without sending any chunks");return Qt(this,WV,void 0,"f"),k3r(r,Te(this,D_e,"f"),{logger:Te(this,yFe,"f")})},"_MessageStream_endRequest"),K$i=a(function(r){let n=Te(this,WV,"f");if(r.type==="message_start"){if(n)throw new fr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new fr(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return n;case"message_delta":return n.stop_reason=r.delta.stop_reason,n.stop_sequence=r.delta.stop_sequence,n.usage.output_tokens=r.usage.output_tokens,r.usage.input_tokens!=null&&(n.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(n.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(n.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(n.usage.server_tool_use=r.usage.server_tool_use),n;case"content_block_start":return n.content.push({...r.content_block}),n;case"content_block_delta":{let o=n.content.at(r.index);switch(r.delta.type){case"text_delta":{o?.type==="text"&&(n.content[r.index]={...o,text:(o.text||"")+r.delta.text});break}case"citations_delta":{o?.type==="text"&&(n.content[r.index]={...o,citations:[...o.citations??[],r.delta.citation]});break}case"input_json_delta":{if(o&&Z$i(o)){let s=o[J$i]||"";s+=r.delta.partial_json;let c={...o};Object.defineProperty(c,J$i,{value:s,enumerable:!1,writable:!0}),s&&(c.input=zSt(s)),n.content[r.index]=c}break}case"thinking_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,thinking:o.thinking+r.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,signature:r.delta.signature});break}default:r.delta}return n}case"content_block_stop":return n}},"_MessageStream_accumulateMessage"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((s,c)=>r.push({resolve:s,reject:c})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new UL(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var N_e,F3r=Se(()=>{p();Ul();Td();Sc();i3r();v_e();Hf();N_e=class extends Ai{static{a(this,"Batches")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get(or`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",dk,{query:e,...r})}delete(e,r){return this._client.delete(or`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post(or`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new fr(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:Et([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>C_e.fromResponse(s.response,s.controller))}}});var zV,eVi,bOc,U3r=Se(()=>{p();Ul();Sc();V3e();X$i();D3r();F3r();F3r();s3r();zV=class extends Ai{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new N_e(this._client)}create(e,r){e.model in eVi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${eVi[e.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),bOc.includes(e.model)&&e.thinking&&e.thinking.type==="enabled"&&console.warn(`Using Claude with ${e.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let n=this._client._options.timeout;if(!e.stream&&n==null){let s=WSt[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=ISt(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:Et([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>P3r(n,e,{logger:this._client.logger??console}))}stream(e,r){return lTt.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},eVi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026"},bOc=["claude-mythos-preview","claude-opus-4-6"];zV.Batches=N_e});var Lie,Q3r=Se(()=>{p();Ul();Td();Sc();Hf();Lie=class extends Ai{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(or`/v1/models/${e}`,{...n,headers:Et([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models",dk,{query:o,...r,headers:Et([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var tVi=Se(()=>{p();MGi();w3r();R3r();U3r();Q3r()});var q3r,j3r,uTt,rVi,nVi,iVi,$f,qL,H3r=Se(()=>{p();x1();iSt();BL();JEe();qEe();aSt();ZEe();zHi();cBr();O3e();jf();e_e();fGi();RGi();Td();IBr();tVi();vSt();R3r();Q3r();w3r();U3r();aSt();Sc();U3e();M9();BL();nVi="\\n\\nHuman:",iVi="\\n\\nAssistant:",$f=class{static{a(this,"BaseAnthropic")}get credentials(){return this._authState.provider}constructor({baseURL:e=_a("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,webhookKey:o=_a("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...s}={}){if(q3r.add(this),this._requestAuthFlags=new WeakMap,uTt.set(this,void 0),r===void 0&&(r=s.profile!=null?null:_a("ANTHROPIC_API_KEY")??null),n===void 0&&(n=s.profile!=null?null:_a("ANTHROPIC_AUTH_TOKEN")??null),s.profile!=null&&(s.credentials!=null||s.config!=null))throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let c={apiKey:r,authToken:n,webhookKey:o,...s,baseURL:e||"https://api.anthropic.com"};if(!c.dangerouslyAllowBrowser&&GHi())throw new fr(`It looks like you're running in a browser-like environment. This is disabled by default, as it risks exposing your secret API credentials to attackers. If you understand the risks and have appropriate mitigations in place, you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g., new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); -`);this.baseURL=c.baseURL,this._baseURLIsExplicit=s.__baseURLIsExplicit??!!e,this.timeout=c.timeout??jBr.DEFAULT_TIMEOUT,this.logger=c.logger??console;let l="warn";this.logLevel=l,this.logLevel=dLr(c.logLevel,"ClientOptions.logLevel",this)??dLr(_a("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??l,this.fetchOptions=c.fetchOptions,this.maxRetries=c.maxRetries??2,this.fetch=c.fetch??eji(),qt(this,FSt,rji,"f");let u=_a("ANTHROPIC_CUSTOM_HEADERS");if(u){let f={};for(let h of u.split(` -`)){let m=h.indexOf(":");m>=0&&(f[h.substring(0,m).trim()]=h.substring(m+1).trim())}c.defaultHeaders={...f,...c.defaultHeaders}}let d=s.__auth;if(delete c.__auth,delete c.__baseURLIsExplicit,this._options=c,this.apiKey=typeof r=="string"?r:null,this.authToken=n,this.webhookKey=o,d)this._authState=d,!this._baseURLIsExplicit&&d.baseURL&&(this.baseURL=d.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let f=c.credentials??null;if(f)this._authState.provider=f,this._authState.tokenCache=this._makeTokenCache(f);else if(c.config!=null){let h=gLr(c.config,this._credentialResolverOptions());this._authState.provider=h.provider,this._authState.tokenCache=this._makeTokenCache(h.provider),this._authState.extraHeaders=h.extraHeaders,this._applyCredentialBaseURL(h.baseURL)}else c.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(c.profile):this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let r=e.replace(/\/+$/,"");this._authState.baseURL=r,this._baseURLIsExplicit||(this.baseURL=r)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this.fetch,userAgent:this.getUserAgent(),onCacheWriteError:a(e=>{gl(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{gl(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new H1t(e,r=>{gl(this).debug("advisory token refresh failed; serving cached token",r)})}withOptions(e){let r="credentials"in e||"config"in e||"profile"in e,n="apiKey"in e||"authToken"in e||r,o={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...r?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:n?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(o)}async _resolveDefaultCredentials(e){try{let r=await Bji(this._credentialResolverOptions(),e);if(r)this._authState.provider=r.provider,this._authState.tokenCache=this._makeTokenCache(r.provider),this._authState.extraHeaders=r.extraHeaders,this._applyCredentialBaseURL(r.baseURL);else if(e!=null)throw new fr(`Profile "${e}" could not be resolved (no /configs/${e}.json found).`)}catch(r){this._authState.error=r}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:r}){if(!(e.get("x-api-key")||e.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&e.get("x-api-key"))&&!r.has("x-api-key")&&!(this.authToken&&e.get("authorization"))&&!r.has("authorization"))throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(e){let r=this._requestAuthFlags.get(e);return r||(r={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,r)),r}async authHeaders(e){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let r=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,vt([{Authorization:`Bearer ${r}`}])}return vt([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return vt([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return vt([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return hji(e)}getUserAgent(){return`${this.constructor.name}/JS ${ek}`}defaultIdempotencyKey(){return`stainless-node-retry-${vEe()}`}makeStatusError(e,r,n,o){return Ch.generate(e,r,n,o)}buildURL(e,r,n){let o=!xe(this,qBr,"m",dGi).call(this)&&n||this.baseURL,s=Wqi(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!X4r(c)||!X4r(l))&&(r={...l,...c,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(s.search=this.stringifyQuery(r)),s.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new fr("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(e){}async prepareRequest(e,{url:r,options:n}){if(this._authState.tokenCache&&this.apiKey==null){let o=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[c,l]of Object.entries(this._authState.extraHeaders))o.has(c)||o.set(c,l);o.get("anthropic-beta")?.split(",").map(c=>c.trim())?.includes(lie)||o.append("anthropic-beta",lie),e.headers=o}}get(e,r){return this.methodRequest("get",e,r)}post(e,r){return this.methodRequest("post",e,r)}patch(e,r){return this.methodRequest("patch",e,r)}put(e,r){return this.methodRequest("put",e,r)}delete(e,r){return this.methodRequest("delete",e,r)}methodRequest(e,r,n){return this.request(Promise.resolve(n).then(o=>({method:e,path:r,...o})))}request(e,r=null){return new uie(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){let o=await e,s=o.maxRetries??this.maxRetries;r==null&&(r=s,this._requestAuthFlags.delete(o)),await this.prepareOptions(o);let{req:c,url:l,timeout:u}=await this.buildRequest(o,{retryCount:s-r});await this.prepareRequest(c,{url:l,options:o});let d="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),f=n===void 0?"":`, retryOf: ${n}`,h=Date.now();if(gl(this).debug(`[${d}] sending request`,C9({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new Ty;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(u3e),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new Ty;let v=v9(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return gl(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),gl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,C9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw gl(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),gl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,C9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new bEe:new TV({cause:g})}let y=[...g.headers.entries()].filter(([_])=>_==="request-id").map(([_,v])=>", "+_+": "+JSON.stringify(v)).join(""),E=`[${d}${f}${y}] ${c.method} ${l} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${A-h}ms`;if(!g.ok){let _=await this.shouldRetry(g,o);if(r&&_){let x=`retrying, ${r} attempts remaining`;return await tji(g.body),gl(this).info(`${E} - ${x}`),gl(this).debug(`[${d}] response error (${x})`,C9({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),this.retryRequest(o,r,n??d,g.headers)}let v=_?"error; no more retries left":"error; not retryable";gl(this).info(`${E} - ${v}`);let b=await g.text().catch(x=>u3e(x).message),T=M1t(b),w=T?void 0:b;throw gl(this).debug(`[${d}] response error (${v})`,C9({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,message:w,durationMs:Date.now()-h})),this.makeStatusError(g.status,T,w,g.headers)}return gl(this).info(E),gl(this).debug(`[${d}] response start`,C9({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),{response:g,options:o,controller:m,requestLogID:d,retryOfRequestLogID:n,startTime:h}}getAPIList(e,r,n){return this.requestAPIList(r,n&&"then"in n?n.then(o=>({method:"get",path:e,...o})):{method:"get",path:e,...n})}requestAPIList(e,r){let n=this.makeRequest(r,null,void 0);return new E3e(this,n,e)}async fetchWithTimeout(e,r,n,o){let{signal:s,method:c,...l}=r||{},u=this._makeAbort(o);s&&s.addEventListener("abort",u,{once:!0});let d=setTimeout(u,n),f=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,h={signal:o.signal,...f?{duplex:"half"}:{},method:"GET",...l};c&&(h.method=c.toUpperCase());try{return await this.fetch.call(void 0,e,h)}finally{clearTimeout(d)}}async shouldRetry(e,r){let n=this._authFlags(r);if(e.status===401&&this._authState.tokenCache&&n.usedTokenCache&&!n.didRefreshFor401)return n.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let o=e.headers.get("x-should-retry");return o==="true"?!0:o==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,r,n,o){let s,c=o?.get("retry-after-ms");if(c){let u=parseFloat(c);Number.isNaN(u)||(s=u)}let l=o?.get("retry-after");if(l&&!s){let u=parseFloat(l);Number.isNaN(u)?s=Date.parse(l)-Date.now():s=u*1e3}if(s===void 0){let u=e.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(r,u)}return await TN(s),this.makeRequest(e,r-1,n)}calculateDefaultRetryTimeoutMillis(e,r){let s=r-e,c=Math.min(.5*Math.pow(2,s),8),l=1-Math.random()*.25;return c*l*1e3}calculateNonstreamingTimeout(e,r){if(36e5*e/128e3>6e5||r!=null&&e>r)throw new fr("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(e,{retryCount:r=0}={}){let n={...e},{method:o,path:s,query:c,defaultBaseURL:l}=n;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let u=this.buildURL(s,c,l);"timeout"in n&&Yqi("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:d,body:f}=this.buildBody({options:n}),h=await this.buildHeaders({options:e,method:o,bodyHeaders:d,retryCount:r});return{req:{method:o,headers:h,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&f instanceof globalThis.ReadableStream&&{duplex:"half"},...f&&{body:f},...this.fetchOptions??{},...n.fetchOptions??{}},url:u,timeout:n.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:n,retryCount:o}){let s={};this.idempotencyHeader&&r!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);let c=vt([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...f3e(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(c),c.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:r}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=vt([r]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:L1t(e)}:typeof e=="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:xe(this,FSt,"f").call(this,{body:e,headers:n})}};jBr=Qf,FSt=new WeakMap,qBr=new WeakSet,dGi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"_BaseAnthropic_baseURLOverridden");Qf.Anthropic=jBr;Qf.HUMAN_PROMPT=fGi;Qf.AI_PROMPT=pGi;Qf.DEFAULT_TIMEOUT=6e5;Qf.AnthropicError=fr;Qf.APIError=Ch;Qf.APIConnectionError=TV;Qf.APIConnectionTimeoutError=bEe;Qf.APIUserAbortError=Ty;Qf.NotFoundError=xEe;Qf.ConflictError=wEe;Qf.RateLimitError=kEe;Qf.BadRequestError=SEe;Qf.AuthenticationError=TEe;Qf.InternalServerError=PEe;Qf.PermissionDeniedError=IEe;Qf.UnprocessableEntityError=REe;Qf.toFile=Z1t;BL=class extends Qf{static{a(this,"Anthropic")}constructor(){super(...arguments),this.completions=new Tie(this),this.messages=new BV(this),this.models=new xie(this),this.beta=new iA(this)}};BL.Completions=Tie;BL.Messages=BV;BL.Models=xie;BL.Beta=iA});var qLr=ve(()=>{p();HBr();ILr();Y1t();HBr();_d();Bf()});var b3r=I((pFh,AWi)=>{p();var dFe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,xLc=typeof AbortController=="function",RTt=xLc?AbortController:class{static{a(this,"AbortController")}constructor(){this.signal=new hWi}abort(){this.signal.dispatchEvent("abort")}},wLc=typeof AbortSignal=="function",RLc=typeof RTt.AbortSignal=="function",hWi=wLc?AbortSignal:RLc?RTt.AbortController:class{static{a(this,"AbortSignal")}constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(e){if(e==="abort"){this.aborted=!0;let r={type:e,target:this};this.onabort(r),this._listeners.forEach(n=>n(r),this)}}onabort(){}addEventListener(e,r){e==="abort"&&this._listeners.push(r)}removeEventListener(e,r){e==="abort"&&(this._listeners=this._listeners.filter(n=>n!==r))}},v3r=new Set,y3r=a((t,e)=>{let r=`LRU_CACHE_OPTION_${t}`;kTt(r)&&C3r(r,`${t} option`,`options.${e}`,D_e)},"deprecatedOption"),E3r=a((t,e)=>{let r=`LRU_CACHE_METHOD_${t}`;if(kTt(r)){let{prototype:n}=D_e,{get:o}=Object.getOwnPropertyDescriptor(n,t);C3r(r,`${t} method`,`cache.${e}()`,o)}},"deprecatedMethod"),kLc=a((t,e)=>{let r=`LRU_CACHE_PROPERTY_${t}`;if(kTt(r)){let{prototype:n}=D_e,{get:o}=Object.getOwnPropertyDescriptor(n,t);C3r(r,`${t} property`,`cache.${e}`,o)}},"deprecatedProperty"),mWi=a((...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},"emitWarning"),kTt=a(t=>!v3r.has(t),"shouldWarn"),C3r=a((t,e,r,n)=>{v3r.add(t);let o=`The ${e} is deprecated. Please use ${r} instead.`;mWi(o,"DeprecationWarning",t,n)},"warn"),Die=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),gWi=a(t=>Die(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?P_e:null:null,"getUintArray"),P_e=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},_3r=class{static{a(this,"Stack")}constructor(e){if(e===0)return[];let r=gWi(e);this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},D_e=class t{static{a(this,"LRUCache")}constructor(e={}){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,sizeCalculation:A,fetchMethod:y,fetchContext:E,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:v}=e,{length:b,maxAge:T,stale:w}=e instanceof t?{}:e;if(r!==0&&!Die(r))throw new TypeError("max option must be a nonnegative integer");let R=r?gWi(r):Array;if(!R)throw new Error("invalid max value: "+r);if(this.max=r,this.maxSize=g,this.sizeCalculation=A||b,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=y||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=E,!this.fetchMethod&&E!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(r).fill(null),this.valList=new Array(r).fill(null),this.next=new R(r),this.prev=new R(r),this.head=0,this.tail=0,this.free=new _3r(r),this.initialFill=1,this.size=0,typeof d=="function"&&(this.dispose=d),typeof f=="function"?(this.disposeAfter=f,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!_,this.maxSize!==0){if(!Die(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!w,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=Die(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||T||0,this.ttl){if(!Die(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let x="LRU_CACHE_UNBOUNDED";kTt(x)&&(v3r.add(x),mWi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,t))}w&&y3r("stale","allowStale"),T&&y3r("maxAge","ttl"),b&&y3r("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new P_e(this.max),this.starts=new P_e(this.max),this.setItemTTL=(n,o,s=dFe.now())=>{if(this.starts[n]=o!==0?s:0,this.ttls[n]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.isStale(n)&&this.delete(this.keyList[n])},o+1);c.unref&&c.unref()}},this.updateItemAge=n=>{this.starts[n]=this.ttls[n]!==0?dFe.now():0};let e=0,r=a(()=>{let n=dFe.now();if(this.ttlResolution>0){e=n;let o=setTimeout(()=>e=0,this.ttlResolution);o.unref&&o.unref()}return n},"getNow");this.getRemainingTTL=n=>{let o=this.keyMap.get(n);return o===void 0?0:this.ttls[o]===0||this.starts[o]===0?1/0:this.starts[o]+this.ttls[o]-(e||r())},this.isStale=n=>this.ttls[n]!==0&&this.starts[n]!==0&&(e||r())-this.starts[n]>this.ttls[n]}updateItemAge(e){}setItemTTL(e,r,n){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new P_e(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,r,n,o)=>{if(!Die(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(r,e),!Die(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer)");return n},this.addItemSize=(e,r)=>{this.sizes[e]=r;let n=this.maxSize-this.sizes[e];for(;this.calculatedSize>n;)this.evict(!0);this.calculatedSize+=this.sizes[e]}}removeItemSize(e){}addItemSize(e,r){}requireSize(e,r,n,o){if(n||o)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let r=this.tail;!(!this.isValidIndex(r)||((e||!this.isStale(r))&&(yield r),r===this.head));)r=this.prev[r]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let r=this.head;!(!this.isValidIndex(r)||((e||!this.isStale(r))&&(yield r),r===this.tail));)r=this.next[r]}isValidIndex(e){return this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())yield[this.keyList[e],this.valList[e]]}*rentries(){for(let e of this.rindexes())yield[this.keyList[e],this.valList[e]]}*keys(){for(let e of this.indexes())yield this.keyList[e]}*rkeys(){for(let e of this.rindexes())yield this.keyList[e]}*values(){for(let e of this.indexes())yield this.valList[e]}*rvalues(){for(let e of this.rindexes())yield this.valList[e]}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let n of this.indexes())if(e(this.valList[n],this.keyList[n],this))return this.get(this.keyList[n],r)}forEach(e,r=this){for(let n of this.indexes())e.call(r,this.valList[n],this.keyList[n],this)}rforEach(e,r=this){for(let n of this.rindexes())e.call(r,this.valList[n],this.keyList[n],this)}get prune(){return E3r("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(let r of this.rindexes({allowStale:!0}))this.isStale(r)&&(this.delete(this.keyList[r]),e=!0);return e}dump(){let e=[];for(let r of this.indexes({allowStale:!0})){let n=this.keyList[r],o=this.valList[r],c={value:this.isBackgroundFetch(o)?o.__staleWhileFetching:o};if(this.ttls){c.ttl=this.ttls[r];let l=dFe.now()-this.starts[r];c.start=Math.floor(Date.now()-l)}this.sizes&&(c.size=this.sizes[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=dFe.now()-o}this.set(r,n.value,n)}}dispose(e,r,n){}set(e,r,{ttl:n=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL}={}){if(c=this.requireSize(e,r,c,l),this.maxSize&&c>this.maxSize)return this;let d=this.size===0?void 0:this.keyMap.get(e);if(d===void 0)d=this.newIndex(),this.keyList[d]=e,this.valList[d]=r,this.keyMap.set(e,d),this.next[this.tail]=d,this.prev[d]=this.tail,this.tail=d,this.size++,this.addItemSize(d,c),u=!1;else{let f=this.valList[d];r!==f&&(this.isBackgroundFetch(f)?f.__abortController.abort():s||(this.dispose(f,e,"set"),this.disposeAfter&&this.disposed.push([f,e,"set"])),this.removeItemSize(d),this.valList[d]=r,this.addItemSize(d,c)),this.moveToTail(d)}if(n!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(d,n,o),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let r=this.head,n=this.keyList[r],o=this.valList[r];return this.isBackgroundFetch(o)?o.__abortController.abort():(this.dispose(o,n,"evict"),this.disposeAfter&&this.disposed.push([o,n,"evict"])),this.removeItemSize(r),e&&(this.keyList[r]=null,this.valList[r]=null,this.free.push(r)),this.head=this.next[r],this.keyMap.delete(n),this.size--,r}has(e,{updateAgeOnHas:r=this.updateAgeOnHas}={}){let n=this.keyMap.get(e);return n!==void 0&&!this.isStale(n)?(r&&this.updateItemAge(n),!0):!1}peek(e,{allowStale:r=this.allowStale}={}){let n=this.keyMap.get(e);if(n!==void 0&&(r||!this.isStale(n))){let o=this.valList[n];return this.isBackgroundFetch(o)?o.__staleWhileFetching:o}}backgroundFetch(e,r,n,o){let s=r===void 0?void 0:this.valList[r];if(this.isBackgroundFetch(s))return s;let c=new RTt,l={signal:c.signal,options:n,context:o},u=a(m=>(c.signal.aborted||this.set(e,m,l.options),m),"cb"),d=a(m=>{if(this.valList[r]===h&&(!n.noDeleteOnFetchRejection||h.__staleWhileFetching===void 0?this.delete(e):this.valList[r]=h.__staleWhileFetching),h.__returned===h)throw m},"eb"),f=a(m=>m(this.fetchMethod(e,s,l)),"pcall"),h=new Promise(f).then(u,d);return h.__abortController=c,h.__staleWhileFetching=s,h.__returned=null,r===void 0?(this.set(e,h,l.options),r=this.keyMap.get(e)):this.valList[r]=h,h}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,fetchContext:h=this.fetchContext,forceRefresh:m=!1}={}){if(!this.fetchMethod)return this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o});let g={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:d,noDeleteOnFetchRejection:f},A=this.keyMap.get(e);if(A===void 0){let y=this.backgroundFetch(e,A,g,h);return y.__returned=y}else{let y=this.valList[A];if(this.isBackgroundFetch(y))return r&&y.__staleWhileFetching!==void 0?y.__staleWhileFetching:y.__returned=y;if(!m&&!this.isStale(A))return this.moveToTail(A),n&&this.updateItemAge(A),y;let E=this.backgroundFetch(e,A,g,h);return r&&E.__staleWhileFetching!==void 0?E.__staleWhileFetching:E.__returned=E}}get(e,{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet}={}){let s=this.keyMap.get(e);if(s!==void 0){let c=this.valList[s],l=this.isBackgroundFetch(c);return this.isStale(s)?l?r?c.__staleWhileFetching:void 0:(o||this.delete(e),r?c:void 0):l?void 0:(this.moveToTail(s),n&&this.updateItemAge(s),c)}}connect(e,r){this.prev[r]=e,this.next[e]=r}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return E3r("del","delete"),this.delete}delete(e){let r=!1;if(this.size!==0){let n=this.keyMap.get(e);if(n!==void 0)if(r=!0,this.size===1)this.clear();else{this.removeItemSize(n);let o=this.valList[n];this.isBackgroundFetch(o)?o.__abortController.abort():(this.dispose(o,e,"delete"),this.disposeAfter&&this.disposed.push([o,e,"delete"])),this.keyMap.delete(e),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return r}clear(){for(let e of this.rindexes({allowStale:!0})){let r=this.valList[e];if(this.isBackgroundFetch(r))r.__abortController.abort();else{let n=this.keyList[e];this.dispose(r,n,"delete"),this.disposeAfter&&this.disposed.push([r,n,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return E3r("reset","clear"),this.clear}get length(){return kLc("length","size"),this.size}static get AbortController(){return RTt}static get AbortSignal(){return hWi}};AWi.exports=D_e});var I3r=I((gFh,yWi)=>{"use strict";p();var fFe=class extends Error{static{a(this,"FetchBaseError")}constructor(e,r,n){super(e),this.type=r,this._name=n}get name(){return this._name}get[Symbol.toStringTag](){return this._name}},S3r=class extends fFe{static{a(this,"FetchError")}constructor(e,r,n){super(e,r,"FetchError"),n&&(this.code=n.code,this.errno=n.errno,this.erroredSysCall=n.syscall)}},T3r=class extends fFe{static{a(this,"AbortError")}constructor(e,r="aborted"){super(e,r,"AbortError")}};yWi.exports={FetchBaseError:fFe,FetchError:S3r,AbortError:T3r}});var N9=I((EFh,_Wi)=>{"use strict";p();var{constants:{MAX_LENGTH:PLc}}=require("buffer"),{pipeline:PTt,PassThrough:DLc}=require("stream"),{promisify:NLc}=require("util"),{createGunzip:MLc,createInflate:OLc,createBrotliDecompress:LLc,constants:{Z_SYNC_FLUSH:EWi}}=require("zlib"),BLc=EP()("helix-fetch:utils"),FLc=NLc(PTt),ULc=a((t,e)=>t===204||t===304||+e["content-length"]==0?!1:/^\s*(?:(x-)?deflate|(x-)?gzip|br)\s*$/.test(e["content-encoding"]),"canDecode"),QLc=a((t,e,r,n)=>{if(!ULc(t,e))return r;let o=a(s=>{s&&(BLc(`encountered error while decoding stream: ${s}`),n(s))},"cb");switch(e["content-encoding"].trim()){case"gzip":case"x-gzip":return PTt(r,MLc({flush:EWi,finishFlush:EWi}),o);case"deflate":case"x-deflate":return PTt(r,OLc(),o);case"br":return PTt(r,LLc(),o);default:return r}},"decodeStream"),qLc=a(t=>{if(!t||typeof t!="object"||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},"isPlainObject"),DTt=a((t,e)=>{if(Buffer.isBuffer(t))return t.length;switch(typeof t){case"string":return t.length*2;case"boolean":return 4;case"number":return 8;case"symbol":return Symbol.keyFor(t)?Symbol.keyFor(t).length*2:(t.toString().length-8)*2;case"object":return Array.isArray(t)?jLc(t,e):HLc(t,e);default:return 0}},"calcSize"),jLc=a((t,e)=>(e.add(t),t.map(r=>e.has(r)?0:DTt(r,e)).reduce((r,n)=>r+n,0)),"calcArraySize"),HLc=a((t,e)=>{if(t==null)return 0;e.add(t);let r=0,n=[];for(let o in t)n.push(o);return n.push(...Object.getOwnPropertySymbols(t)),n.forEach(o=>{if(r+=DTt(o,e),typeof t[o]=="object"&&t[o]!==null){if(e.has(t[o]))return;e.add(t[o])}r+=DTt(t[o],e)}),r},"calcObjectSize"),GLc=a(t=>DTt(t,new WeakSet),"sizeof"),$Lc=a(async t=>{let e=new DLc,r=0,n=[];return e.on("data",o=>{if(r+o.length>PLc)throw new Error("Buffer.constants.MAX_SIZE exceeded");n.push(o),r+=o.length}),await FLc(t,e),Buffer.concat(n,r)},"streamToBuffer");_Wi.exports={decodeStream:QLc,isPlainObject:qLc,sizeof:GLc,streamToBuffer:$Lc}});var MTt=I((CFh,SWi)=>{"use strict";p();var{PassThrough:vWi,Readable:M9}=require("stream"),{types:{isAnyArrayBuffer:bWi}}=require("util"),{FetchError:VLc,FetchBaseError:WLc}=I3r(),{streamToBuffer:zLc}=N9(),YLc=Buffer.alloc(0),lk=Symbol("Body internals"),KLc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),CWi=a(async t=>{if(t[lk].disturbed)throw new TypeError("Already read");if(t[lk].error)throw new TypeError(`Stream had error: ${t[lk].error.message}`);t[lk].disturbed=!0;let{stream:e}=t[lk];return e===null?YLc:zLc(e)},"consume"),NTt=class{static{a(this,"Body")}constructor(e){let r;e==null?r=null:e instanceof URLSearchParams?r=M9.from(e.toString()):e instanceof M9?r=e:Buffer.isBuffer(e)?r=M9.from(e):bWi(e)?r=M9.from(Buffer.from(e)):typeof e=="string"||e instanceof String?r=M9.from(e):r=M9.from(String(e)),this[lk]={stream:r,disturbed:!1,error:null},e instanceof M9&&r.on("error",n=>{let o=n instanceof WLc?n:new VLc(`Invalid response body while trying to fetch ${this.url}: ${n.message}`,"system",n);this[lk].error=o})}get body(){return this[lk].stream}get bodyUsed(){return this[lk].disturbed}async buffer(){return CWi(this)}async arrayBuffer(){return KLc(await this.buffer())}async text(){return(await CWi(this)).toString()}async json(){return JSON.parse(await this.text())}};Object.defineProperties(NTt.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var JLc=a(t=>{if(t[lk].disturbed)throw new TypeError("Cannot clone: already read");let{stream:e}=t[lk],r=e;if(e instanceof M9){r=new vWi;let n=new vWi;e.pipe(r),e.pipe(n),t[lk].stream=n}return r},"cloneStream"),ZLc=a(t=>t===null?null:typeof t=="string"?"text/plain; charset=utf-8":t instanceof URLSearchParams?"application/x-www-form-urlencoded; charset=utf-8":Buffer.isBuffer(t)||bWi(t)||t instanceof M9?null:"text/plain; charset=utf-8","guessContentType");SWi.exports={Body:NTt,cloneStream:JLc,guessContentType:ZLc}});var N_e=I((TFh,wWi)=>{"use strict";p();var{validateHeaderName:TWi,validateHeaderValue:IWi}=require("http"),{isPlainObject:XLc}=N9(),O9=Symbol("Headers internals"),pFe=a(t=>{let e=typeof t!="string"?String(t):t;if(typeof TWi=="function")TWi(e);else if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(e)){let r=new TypeError(`Header name must be a valid HTTP token [${e}]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),r}return e.toLowerCase()},"normalizeName"),xWi=a((t,e)=>{let r=typeof t!="string"?String(t):t;if(typeof IWi=="function")IWi(e,r);else if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(r)){let n=new TypeError(`Invalid character in header content ["${e}"]`);throw Object.defineProperty(n,"code",{value:"ERR_INVALID_CHAR"}),n}return r},"normalizeValue"),OTt=class t{static{a(this,"Headers")}constructor(e={}){if(this[O9]={map:new Map},e instanceof t)e.forEach((r,n)=>{this.append(n,r)});else if(Array.isArray(e))e.forEach(([r,n])=>{this.append(r,n)});else if(XLc(e))for(let[r,n]of Object.entries(e))this.append(r,n)}set(e,r){this[O9].map.set(pFe(e),xWi(r,e))}has(e){return this[O9].map.has(pFe(e))}get(e){let r=this[O9].map.get(pFe(e));return r===void 0?null:r}append(e,r){let n=pFe(e),o=xWi(r,e),s=this[O9].map.get(n);this[O9].map.set(n,s?`${s}, ${o}`:o)}delete(e){this[O9].map.delete(pFe(e))}forEach(e,r){for(let n of this.keys())e.call(r,this.get(n),n)}keys(){return Array.from(this[O9].map.keys()).sort()}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return this.constructor.name}plain(){return Object.fromEntries(this[O9].map)}};Object.defineProperties(OTt.prototype,["append","delete","entries","forEach","get","has","keys","set","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));wWi.exports={Headers:OTt}});var x3r=I((wFh,RWi)=>{"use strict";p();var{EventEmitter:eBc}=require("events"),NN=Symbol("AbortSignal internals"),M_e=class{static{a(this,"AbortSignal")}constructor(){this[NN]={eventEmitter:new eBc,onabort:null,aborted:!1}}get aborted(){return this[NN].aborted}get onabort(){return this[NN].onabort}set onabort(e){this[NN].onabort=e}get[Symbol.toStringTag](){return this.constructor.name}removeEventListener(e,r){this[NN].eventEmitter.removeListener(e,r)}addEventListener(e,r){this[NN].eventEmitter.on(e,r)}dispatchEvent(e){let r={type:e,target:this},n=`on${e}`;typeof this[NN][n]=="function"&&this[n](r),this[NN].eventEmitter.emit(e,r)}fire(){this[NN].aborted=!0,this.dispatchEvent("abort")}};Object.defineProperties(M_e.prototype,{addEventListener:{enumerable:!0},removeEventListener:{enumerable:!0},dispatchEvent:{enumerable:!0},aborted:{enumerable:!0},onabort:{enumerable:!0}});var BTt=class extends M_e{static{a(this,"TimeoutSignal")}constructor(e){if(!Number.isInteger(e))throw new TypeError(`Expected an integer, got ${typeof e}`);super(),this[NN].timerId=setTimeout(()=>{this.fire()},e)}clear(){clearTimeout(this[NN].timerId)}};Object.defineProperties(BTt.prototype,{clear:{enumerable:!0}});var LTt=Symbol("AbortController internals"),FTt=class{static{a(this,"AbortController")}constructor(){this[LTt]={signal:new M_e}}get signal(){return this[LTt].signal}get[Symbol.toStringTag](){return this.constructor.name}abort(){this[LTt].signal.aborted||this[LTt].signal.fire()}};Object.defineProperties(FTt.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});RWi.exports={AbortController:FTt,AbortSignal:M_e,TimeoutSignal:BTt}});var hFe=I((PFh,DWi)=>{"use strict";p();var{randomBytes:tBc}=require("crypto"),{Readable:rBc}=require("stream"),R3r=a(t=>typeof t=="object"&&["arrayBuffer","stream","text","slice","constructor"].map(e=>typeof t[e]).filter(e=>e!=="function").length===0&&typeof t.type=="string"&&typeof t.size=="number"&&/^(Blob|File)$/.test(t[Symbol.toStringTag]),"isBlob"),nBc=a(t=>t!=null&&typeof t=="object"&&["append","delete","get","getAll","has","set","keys","values","entries","constructor"].map(e=>typeof t[e]).filter(e=>e!=="function").length===0&&t[Symbol.toStringTag]==="FormData","isFormData"),kWi=a(t=>`--${t}--\r +`);this.baseURL=c.baseURL,this._baseURLIsExplicit=s.__baseURLIsExplicit??!!e,this.timeout=c.timeout??j3r.DEFAULT_TIMEOUT,this.logger=c.logger??console;let l="warn";this.logLevel=l,this.logLevel=dBr(c.logLevel,"ClientOptions.logLevel",this)??dBr(_a("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??l,this.fetchOptions=c.fetchOptions,this.maxRetries=c.maxRetries??2,this.fetch=c.fetch??$Hi(),Qt(this,uTt,WHi,"f");let u=_a("ANTHROPIC_CUSTOM_HEADERS");if(u){let f={};for(let h of u.split(` +`)){let m=h.indexOf(":");m>=0&&(f[h.substring(0,m).trim()]=h.substring(m+1).trim())}c.defaultHeaders={...f,...c.defaultHeaders}}let d=s.__auth;if(delete c.__auth,delete c.__baseURLIsExplicit,this._options=c,this.apiKey=typeof r=="string"?r:null,this.authToken=n,this.webhookKey=o,d)this._authState=d,!this._baseURLIsExplicit&&d.baseURL&&(this.baseURL=d.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let f=c.credentials??null;if(f)this._authState.provider=f,this._authState.tokenCache=this._makeTokenCache(f);else if(c.config!=null){let h=gBr(c.config,this._credentialResolverOptions());this._authState.provider=h.provider,this._authState.tokenCache=this._makeTokenCache(h.provider),this._authState.extraHeaders=h.extraHeaders,this._applyCredentialBaseURL(h.baseURL)}else c.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(c.profile):this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let r=e.replace(/\/+$/,"");this._authState.baseURL=r,this._baseURLIsExplicit||(this.baseURL=r)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this.fetch,userAgent:this.getUserAgent(),onCacheWriteError:a(e=>{Al(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{Al(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new mSt(e,r=>{Al(this).debug("advisory token refresh failed; serving cached token",r)})}withOptions(e){let r="credentials"in e||"config"in e||"profile"in e,n="apiKey"in e||"authToken"in e||r,o={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...r?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:n?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(o)}async _resolveDefaultCredentials(e){try{let r=await wGi(this._credentialResolverOptions(),e);if(r)this._authState.provider=r.provider,this._authState.tokenCache=this._makeTokenCache(r.provider),this._authState.extraHeaders=r.extraHeaders,this._applyCredentialBaseURL(r.baseURL);else if(e!=null)throw new fr(`Profile "${e}" could not be resolved (no /configs/${e}.json found).`)}catch(r){this._authState.error=r}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:r}){if(!(e.get("x-api-key")||e.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&e.get("x-api-key"))&&!r.has("x-api-key")&&!(this.authToken&&e.get("authorization"))&&!r.has("authorization"))throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(e){let r=this._requestAuthFlags.get(e);return r||(r={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,r)),r}async authHeaders(e){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let r=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,Et([{Authorization:`Bearer ${r}`}])}return Et([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return Et([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return Et([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return oGi(e)}getUserAgent(){return`${this.constructor.name}/JS ${uk}`}defaultIdempotencyKey(){return`stainless-node-retry-${QEe()}`}makeStatusError(e,r,n,o){return Th.generate(e,r,n,o)}buildURL(e,r,n){let o=!Te(this,q3r,"m",rVi).call(this)&&n||this.baseURL,s=FHi(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!XLr(c)||!XLr(l))&&(r={...l,...c,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(s.search=this.stringifyQuery(r)),s.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new fr("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(e){}async prepareRequest(e,{url:r,options:n}){if(this._authState.tokenCache&&this.apiKey==null){let o=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[c,l]of Object.entries(this._authState.extraHeaders))o.has(c)||o.set(c,l);o.get("anthropic-beta")?.split(",").map(c=>c.trim())?.includes(yie)||o.append("anthropic-beta",yie),e.headers=o}}get(e,r){return this.methodRequest("get",e,r)}post(e,r){return this.methodRequest("post",e,r)}patch(e,r){return this.methodRequest("patch",e,r)}put(e,r){return this.methodRequest("put",e,r)}delete(e,r){return this.methodRequest("delete",e,r)}methodRequest(e,r,n){return this.request(Promise.resolve(n).then(o=>({method:e,path:r,...o})))}request(e,r=null){return new Eie(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){let o=await e,s=o.maxRetries??this.maxRetries;r==null&&(r=s,this._requestAuthFlags.delete(o)),await this.prepareOptions(o);let{req:c,url:l,timeout:u}=await this.buildRequest(o,{retryCount:s-r});await this.prepareRequest(c,{url:l,options:o});let d="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),f=n===void 0?"":`, retryOf: ${n}`,h=Date.now();if(Al(this).debug(`[${d}] sending request`,N9({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new Ry;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(M3e),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new Ry;let v=D9(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return Al(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),Al(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,N9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw Al(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),Al(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,N9({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new jEe:new LV({cause:g})}let y=[...g.headers.entries()].filter(([_])=>_==="request-id").map(([_,v])=>", "+_+": "+JSON.stringify(v)).join(""),E=`[${d}${f}${y}] ${c.method} ${l} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${A-h}ms`;if(!g.ok){let _=await this.shouldRetry(g,o);if(r&&_){let x=`retrying, ${r} attempts remaining`;return await VHi(g.body),Al(this).info(`${E} - ${x}`),Al(this).debug(`[${d}] response error (${x})`,N9({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),this.retryRequest(o,r,n??d,g.headers)}let v=_?"error; no more retries left":"error; not retryable";Al(this).info(`${E} - ${v}`);let b=await g.text().catch(x=>M3e(x).message),T=sSt(b),w=T?void 0:b;throw Al(this).debug(`[${d}] response error (${v})`,N9({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,message:w,durationMs:Date.now()-h})),this.makeStatusError(g.status,T,w,g.headers)}return Al(this).info(E),Al(this).debug(`[${d}] response start`,N9({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),{response:g,options:o,controller:m,requestLogID:d,retryOfRequestLogID:n,startTime:h}}getAPIList(e,r,n){return this.requestAPIList(r,n&&"then"in n?n.then(o=>({method:"get",path:e,...o})):{method:"get",path:e,...n})}requestAPIList(e,r){let n=this.makeRequest(r,null,void 0);return new H3e(this,n,e)}async fetchWithTimeout(e,r,n,o){let{signal:s,method:c,...l}=r||{},u=this._makeAbort(o);s&&s.addEventListener("abort",u,{once:!0});let d=setTimeout(u,n),f=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,h={signal:o.signal,...f?{duplex:"half"}:{},method:"GET",...l};c&&(h.method=c.toUpperCase());try{return await this.fetch.call(void 0,e,h)}finally{clearTimeout(d)}}async shouldRetry(e,r){let n=this._authFlags(r);if(e.status===401&&this._authState.tokenCache&&n.usedTokenCache&&!n.didRefreshFor401)return n.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let o=e.headers.get("x-should-retry");return o==="true"?!0:o==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,r,n,o){let s,c=o?.get("retry-after-ms");if(c){let u=parseFloat(c);Number.isNaN(u)||(s=u)}let l=o?.get("retry-after");if(l&&!s){let u=parseFloat(l);Number.isNaN(u)?s=Date.parse(l)-Date.now():s=u*1e3}if(s===void 0){let u=e.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(r,u)}return await NN(s),this.makeRequest(e,r-1,n)}calculateDefaultRetryTimeoutMillis(e,r){let s=r-e,c=Math.min(.5*Math.pow(2,s),8),l=1-Math.random()*.25;return c*l*1e3}calculateNonstreamingTimeout(e,r){if(36e5*e/128e3>6e5||r!=null&&e>r)throw new fr("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(e,{retryCount:r=0}={}){let n={...e},{method:o,path:s,query:c,defaultBaseURL:l}=n;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let u=this.buildURL(s,c,l);"timeout"in n&&QHi("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:d,body:f}=this.buildBody({options:n}),h=await this.buildHeaders({options:e,method:o,bodyHeaders:d,retryCount:r});return{req:{method:o,headers:h,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&f instanceof globalThis.ReadableStream&&{duplex:"half"},...f&&{body:f},...this.fetchOptions??{},...n.fetchOptions??{}},url:u,timeout:n.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:n,retryCount:o}){let s={};this.idempotencyHeader&&r!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);let c=Et([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...L3e(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(c),c.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:r}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=Et([r]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:cSt(e)}:typeof e=="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:Te(this,uTt,"f").call(this,{body:e,headers:n})}};j3r=$f,uTt=new WeakMap,q3r=new WeakSet,rVi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"_BaseAnthropic_baseURLOverridden");$f.Anthropic=j3r;$f.HUMAN_PROMPT=nVi;$f.AI_PROMPT=iVi;$f.DEFAULT_TIMEOUT=6e5;$f.AnthropicError=fr;$f.APIError=Th;$f.APIConnectionError=LV;$f.APIConnectionTimeoutError=jEe;$f.APIUserAbortError=Ry;$f.NotFoundError=VEe;$f.ConflictError=WEe;$f.RateLimitError=YEe;$f.BadRequestError=HEe;$f.AuthenticationError=GEe;$f.InternalServerError=KEe;$f.PermissionDeniedError=$Ee;$f.UnprocessableEntityError=zEe;$f.toFile=SSt;qL=class extends $f{static{a(this,"Anthropic")}constructor(){super(...arguments),this.completions=new Mie(this),this.messages=new zV(this),this.models=new Lie(this),this.beta=new aA(this)}};qL.Completions=Mie;qL.Messages=zV;qL.Models=Lie;qL.Beta=aA});var qBr=Se(()=>{p();H3r();IBr();vSt();H3r();Td();jf()});var wFr=I((i7h,gYi)=>{p();var LFe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,gFc=typeof AbortController=="function",XTt=gFc?AbortController:class{static{a(this,"AbortController")}constructor(){this.signal=new pYi}abort(){this.signal.dispatchEvent("abort")}},AFc=typeof AbortSignal=="function",yFc=typeof XTt.AbortSignal=="function",pYi=AFc?AbortSignal:yFc?XTt.AbortController:class{static{a(this,"AbortSignal")}constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(e){if(e==="abort"){this.aborted=!0;let r={type:e,target:this};this.onabort(r),this._listeners.forEach(n=>n(r),this)}}onabort(){}addEventListener(e,r){e==="abort"&&this._listeners.push(r)}removeEventListener(e,r){e==="abort"&&(this._listeners=this._listeners.filter(n=>n!==r))}},IFr=new Set,bFr=a((t,e)=>{let r=`LRU_CACHE_OPTION_${t}`;eIt(r)&&xFr(r,`${t} option`,`options.${e}`,J_e)},"deprecatedOption"),SFr=a((t,e)=>{let r=`LRU_CACHE_METHOD_${t}`;if(eIt(r)){let{prototype:n}=J_e,{get:o}=Object.getOwnPropertyDescriptor(n,t);xFr(r,`${t} method`,`cache.${e}()`,o)}},"deprecatedMethod"),EFc=a((t,e)=>{let r=`LRU_CACHE_PROPERTY_${t}`;if(eIt(r)){let{prototype:n}=J_e,{get:o}=Object.getOwnPropertyDescriptor(n,t);xFr(r,`${t} property`,`cache.${e}`,o)}},"deprecatedProperty"),hYi=a((...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},"emitWarning"),eIt=a(t=>!IFr.has(t),"shouldWarn"),xFr=a((t,e,r,n)=>{IFr.add(t);let o=`The ${e} is deprecated. Please use ${r} instead.`;hYi(o,"DeprecationWarning",t,n)},"warn"),jie=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),mYi=a(t=>jie(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?K_e:null:null,"getUintArray"),K_e=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},TFr=class{static{a(this,"Stack")}constructor(e){if(e===0)return[];let r=mYi(e);this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},J_e=class t{static{a(this,"LRUCache")}constructor(e={}){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,sizeCalculation:A,fetchMethod:y,fetchContext:E,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:v}=e,{length:b,maxAge:T,stale:w}=e instanceof t?{}:e;if(r!==0&&!jie(r))throw new TypeError("max option must be a nonnegative integer");let R=r?mYi(r):Array;if(!R)throw new Error("invalid max value: "+r);if(this.max=r,this.maxSize=g,this.sizeCalculation=A||b,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=y||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=E,!this.fetchMethod&&E!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(r).fill(null),this.valList=new Array(r).fill(null),this.next=new R(r),this.prev=new R(r),this.head=0,this.tail=0,this.free=new TFr(r),this.initialFill=1,this.size=0,typeof d=="function"&&(this.dispose=d),typeof f=="function"?(this.disposeAfter=f,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!_,this.maxSize!==0){if(!jie(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!w,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=jie(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||T||0,this.ttl){if(!jie(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let x="LRU_CACHE_UNBOUNDED";eIt(x)&&(IFr.add(x),hYi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,t))}w&&bFr("stale","allowStale"),T&&bFr("maxAge","ttl"),b&&bFr("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new K_e(this.max),this.starts=new K_e(this.max),this.setItemTTL=(n,o,s=LFe.now())=>{if(this.starts[n]=o!==0?s:0,this.ttls[n]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.isStale(n)&&this.delete(this.keyList[n])},o+1);c.unref&&c.unref()}},this.updateItemAge=n=>{this.starts[n]=this.ttls[n]!==0?LFe.now():0};let e=0,r=a(()=>{let n=LFe.now();if(this.ttlResolution>0){e=n;let o=setTimeout(()=>e=0,this.ttlResolution);o.unref&&o.unref()}return n},"getNow");this.getRemainingTTL=n=>{let o=this.keyMap.get(n);return o===void 0?0:this.ttls[o]===0||this.starts[o]===0?1/0:this.starts[o]+this.ttls[o]-(e||r())},this.isStale=n=>this.ttls[n]!==0&&this.starts[n]!==0&&(e||r())-this.starts[n]>this.ttls[n]}updateItemAge(e){}setItemTTL(e,r,n){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new K_e(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,r,n,o)=>{if(!jie(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(r,e),!jie(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer)");return n},this.addItemSize=(e,r)=>{this.sizes[e]=r;let n=this.maxSize-this.sizes[e];for(;this.calculatedSize>n;)this.evict(!0);this.calculatedSize+=this.sizes[e]}}removeItemSize(e){}addItemSize(e,r){}requireSize(e,r,n,o){if(n||o)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let r=this.tail;!(!this.isValidIndex(r)||((e||!this.isStale(r))&&(yield r),r===this.head));)r=this.prev[r]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let r=this.head;!(!this.isValidIndex(r)||((e||!this.isStale(r))&&(yield r),r===this.tail));)r=this.next[r]}isValidIndex(e){return this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())yield[this.keyList[e],this.valList[e]]}*rentries(){for(let e of this.rindexes())yield[this.keyList[e],this.valList[e]]}*keys(){for(let e of this.indexes())yield this.keyList[e]}*rkeys(){for(let e of this.rindexes())yield this.keyList[e]}*values(){for(let e of this.indexes())yield this.valList[e]}*rvalues(){for(let e of this.rindexes())yield this.valList[e]}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let n of this.indexes())if(e(this.valList[n],this.keyList[n],this))return this.get(this.keyList[n],r)}forEach(e,r=this){for(let n of this.indexes())e.call(r,this.valList[n],this.keyList[n],this)}rforEach(e,r=this){for(let n of this.rindexes())e.call(r,this.valList[n],this.keyList[n],this)}get prune(){return SFr("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(let r of this.rindexes({allowStale:!0}))this.isStale(r)&&(this.delete(this.keyList[r]),e=!0);return e}dump(){let e=[];for(let r of this.indexes({allowStale:!0})){let n=this.keyList[r],o=this.valList[r],c={value:this.isBackgroundFetch(o)?o.__staleWhileFetching:o};if(this.ttls){c.ttl=this.ttls[r];let l=LFe.now()-this.starts[r];c.start=Math.floor(Date.now()-l)}this.sizes&&(c.size=this.sizes[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=LFe.now()-o}this.set(r,n.value,n)}}dispose(e,r,n){}set(e,r,{ttl:n=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL}={}){if(c=this.requireSize(e,r,c,l),this.maxSize&&c>this.maxSize)return this;let d=this.size===0?void 0:this.keyMap.get(e);if(d===void 0)d=this.newIndex(),this.keyList[d]=e,this.valList[d]=r,this.keyMap.set(e,d),this.next[this.tail]=d,this.prev[d]=this.tail,this.tail=d,this.size++,this.addItemSize(d,c),u=!1;else{let f=this.valList[d];r!==f&&(this.isBackgroundFetch(f)?f.__abortController.abort():s||(this.dispose(f,e,"set"),this.disposeAfter&&this.disposed.push([f,e,"set"])),this.removeItemSize(d),this.valList[d]=r,this.addItemSize(d,c)),this.moveToTail(d)}if(n!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(d,n,o),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let r=this.head,n=this.keyList[r],o=this.valList[r];return this.isBackgroundFetch(o)?o.__abortController.abort():(this.dispose(o,n,"evict"),this.disposeAfter&&this.disposed.push([o,n,"evict"])),this.removeItemSize(r),e&&(this.keyList[r]=null,this.valList[r]=null,this.free.push(r)),this.head=this.next[r],this.keyMap.delete(n),this.size--,r}has(e,{updateAgeOnHas:r=this.updateAgeOnHas}={}){let n=this.keyMap.get(e);return n!==void 0&&!this.isStale(n)?(r&&this.updateItemAge(n),!0):!1}peek(e,{allowStale:r=this.allowStale}={}){let n=this.keyMap.get(e);if(n!==void 0&&(r||!this.isStale(n))){let o=this.valList[n];return this.isBackgroundFetch(o)?o.__staleWhileFetching:o}}backgroundFetch(e,r,n,o){let s=r===void 0?void 0:this.valList[r];if(this.isBackgroundFetch(s))return s;let c=new XTt,l={signal:c.signal,options:n,context:o},u=a(m=>(c.signal.aborted||this.set(e,m,l.options),m),"cb"),d=a(m=>{if(this.valList[r]===h&&(!n.noDeleteOnFetchRejection||h.__staleWhileFetching===void 0?this.delete(e):this.valList[r]=h.__staleWhileFetching),h.__returned===h)throw m},"eb"),f=a(m=>m(this.fetchMethod(e,s,l)),"pcall"),h=new Promise(f).then(u,d);return h.__abortController=c,h.__staleWhileFetching=s,h.__returned=null,r===void 0?(this.set(e,h,l.options),r=this.keyMap.get(e)):this.valList[r]=h,h}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,fetchContext:h=this.fetchContext,forceRefresh:m=!1}={}){if(!this.fetchMethod)return this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o});let g={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:d,noDeleteOnFetchRejection:f},A=this.keyMap.get(e);if(A===void 0){let y=this.backgroundFetch(e,A,g,h);return y.__returned=y}else{let y=this.valList[A];if(this.isBackgroundFetch(y))return r&&y.__staleWhileFetching!==void 0?y.__staleWhileFetching:y.__returned=y;if(!m&&!this.isStale(A))return this.moveToTail(A),n&&this.updateItemAge(A),y;let E=this.backgroundFetch(e,A,g,h);return r&&E.__staleWhileFetching!==void 0?E.__staleWhileFetching:E.__returned=E}}get(e,{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet}={}){let s=this.keyMap.get(e);if(s!==void 0){let c=this.valList[s],l=this.isBackgroundFetch(c);return this.isStale(s)?l?r?c.__staleWhileFetching:void 0:(o||this.delete(e),r?c:void 0):l?void 0:(this.moveToTail(s),n&&this.updateItemAge(s),c)}}connect(e,r){this.prev[r]=e,this.next[e]=r}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return SFr("del","delete"),this.delete}delete(e){let r=!1;if(this.size!==0){let n=this.keyMap.get(e);if(n!==void 0)if(r=!0,this.size===1)this.clear();else{this.removeItemSize(n);let o=this.valList[n];this.isBackgroundFetch(o)?o.__abortController.abort():(this.dispose(o,e,"delete"),this.disposeAfter&&this.disposed.push([o,e,"delete"])),this.keyMap.delete(e),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return r}clear(){for(let e of this.rindexes({allowStale:!0})){let r=this.valList[e];if(this.isBackgroundFetch(r))r.__abortController.abort();else{let n=this.keyList[e];this.dispose(r,n,"delete"),this.disposeAfter&&this.disposed.push([r,n,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return SFr("reset","clear"),this.clear}get length(){return EFc("length","size"),this.size}static get AbortController(){return XTt}static get AbortSignal(){return pYi}};gYi.exports=J_e});var PFr=I((a7h,AYi)=>{"use strict";p();var BFe=class extends Error{static{a(this,"FetchBaseError")}constructor(e,r,n){super(e),this.type=r,this._name=n}get name(){return this._name}get[Symbol.toStringTag](){return this._name}},RFr=class extends BFe{static{a(this,"FetchError")}constructor(e,r,n){super(e,r,"FetchError"),n&&(this.code=n.code,this.errno=n.errno,this.erroredSysCall=n.syscall)}},kFr=class extends BFe{static{a(this,"AbortError")}constructor(e,r="aborted"){super(e,r,"AbortError")}};AYi.exports={FetchBaseError:BFe,FetchError:RFr,AbortError:kFr}});var $9=I((u7h,EYi)=>{"use strict";p();var{constants:{MAX_LENGTH:_Fc}}=require("buffer"),{pipeline:tIt,PassThrough:vFc}=require("stream"),{promisify:CFc}=require("util"),{createGunzip:bFc,createInflate:SFc,createBrotliDecompress:TFc,constants:{Z_SYNC_FLUSH:yYi}}=require("zlib"),IFc=wP()("helix-fetch:utils"),xFc=CFc(tIt),wFc=a((t,e)=>t===204||t===304||+e["content-length"]==0?!1:/^\s*(?:(x-)?deflate|(x-)?gzip|br)\s*$/.test(e["content-encoding"]),"canDecode"),RFc=a((t,e,r,n)=>{if(!wFc(t,e))return r;let o=a(s=>{s&&(IFc(`encountered error while decoding stream: ${s}`),n(s))},"cb");switch(e["content-encoding"].trim()){case"gzip":case"x-gzip":return tIt(r,bFc({flush:yYi,finishFlush:yYi}),o);case"deflate":case"x-deflate":return tIt(r,SFc(),o);case"br":return tIt(r,TFc(),o);default:return r}},"decodeStream"),kFc=a(t=>{if(!t||typeof t!="object"||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},"isPlainObject"),rIt=a((t,e)=>{if(Buffer.isBuffer(t))return t.length;switch(typeof t){case"string":return t.length*2;case"boolean":return 4;case"number":return 8;case"symbol":return Symbol.keyFor(t)?Symbol.keyFor(t).length*2:(t.toString().length-8)*2;case"object":return Array.isArray(t)?PFc(t,e):DFc(t,e);default:return 0}},"calcSize"),PFc=a((t,e)=>(e.add(t),t.map(r=>e.has(r)?0:rIt(r,e)).reduce((r,n)=>r+n,0)),"calcArraySize"),DFc=a((t,e)=>{if(t==null)return 0;e.add(t);let r=0,n=[];for(let o in t)n.push(o);return n.push(...Object.getOwnPropertySymbols(t)),n.forEach(o=>{if(r+=rIt(o,e),typeof t[o]=="object"&&t[o]!==null){if(e.has(t[o]))return;e.add(t[o])}r+=rIt(t[o],e)}),r},"calcObjectSize"),NFc=a(t=>rIt(t,new WeakSet),"sizeof"),MFc=a(async t=>{let e=new vFc,r=0,n=[];return e.on("data",o=>{if(r+o.length>_Fc)throw new Error("Buffer.constants.MAX_SIZE exceeded");n.push(o),r+=o.length}),await xFc(t,e),Buffer.concat(n,r)},"streamToBuffer");EYi.exports={decodeStream:RFc,isPlainObject:kFc,sizeof:NFc,streamToBuffer:MFc}});var iIt=I((p7h,bYi)=>{"use strict";p();var{PassThrough:_Yi,Readable:V9}=require("stream"),{types:{isAnyArrayBuffer:CYi}}=require("util"),{FetchError:OFc,FetchBaseError:LFc}=PFr(),{streamToBuffer:BFc}=$9(),FFc=Buffer.alloc(0),yk=Symbol("Body internals"),UFc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),vYi=a(async t=>{if(t[yk].disturbed)throw new TypeError("Already read");if(t[yk].error)throw new TypeError(`Stream had error: ${t[yk].error.message}`);t[yk].disturbed=!0;let{stream:e}=t[yk];return e===null?FFc:BFc(e)},"consume"),nIt=class{static{a(this,"Body")}constructor(e){let r;e==null?r=null:e instanceof URLSearchParams?r=V9.from(e.toString()):e instanceof V9?r=e:Buffer.isBuffer(e)?r=V9.from(e):CYi(e)?r=V9.from(Buffer.from(e)):typeof e=="string"||e instanceof String?r=V9.from(e):r=V9.from(String(e)),this[yk]={stream:r,disturbed:!1,error:null},e instanceof V9&&r.on("error",n=>{let o=n instanceof LFc?n:new OFc(`Invalid response body while trying to fetch ${this.url}: ${n.message}`,"system",n);this[yk].error=o})}get body(){return this[yk].stream}get bodyUsed(){return this[yk].disturbed}async buffer(){return vYi(this)}async arrayBuffer(){return UFc(await this.buffer())}async text(){return(await vYi(this)).toString()}async json(){return JSON.parse(await this.text())}};Object.defineProperties(nIt.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var QFc=a(t=>{if(t[yk].disturbed)throw new TypeError("Cannot clone: already read");let{stream:e}=t[yk],r=e;if(e instanceof V9){r=new _Yi;let n=new _Yi;e.pipe(r),e.pipe(n),t[yk].stream=n}return r},"cloneStream"),qFc=a(t=>t===null?null:typeof t=="string"?"text/plain; charset=utf-8":t instanceof URLSearchParams?"application/x-www-form-urlencoded; charset=utf-8":Buffer.isBuffer(t)||CYi(t)||t instanceof V9?null:"text/plain; charset=utf-8","guessContentType");bYi.exports={Body:nIt,cloneStream:QFc,guessContentType:qFc}});var Z_e=I((g7h,xYi)=>{"use strict";p();var{validateHeaderName:SYi,validateHeaderValue:TYi}=require("http"),{isPlainObject:jFc}=$9(),W9=Symbol("Headers internals"),FFe=a(t=>{let e=typeof t!="string"?String(t):t;if(typeof SYi=="function")SYi(e);else if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(e)){let r=new TypeError(`Header name must be a valid HTTP token [${e}]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),r}return e.toLowerCase()},"normalizeName"),IYi=a((t,e)=>{let r=typeof t!="string"?String(t):t;if(typeof TYi=="function")TYi(e,r);else if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(r)){let n=new TypeError(`Invalid character in header content ["${e}"]`);throw Object.defineProperty(n,"code",{value:"ERR_INVALID_CHAR"}),n}return r},"normalizeValue"),oIt=class t{static{a(this,"Headers")}constructor(e={}){if(this[W9]={map:new Map},e instanceof t)e.forEach((r,n)=>{this.append(n,r)});else if(Array.isArray(e))e.forEach(([r,n])=>{this.append(r,n)});else if(jFc(e))for(let[r,n]of Object.entries(e))this.append(r,n)}set(e,r){this[W9].map.set(FFe(e),IYi(r,e))}has(e){return this[W9].map.has(FFe(e))}get(e){let r=this[W9].map.get(FFe(e));return r===void 0?null:r}append(e,r){let n=FFe(e),o=IYi(r,e),s=this[W9].map.get(n);this[W9].map.set(n,s?`${s}, ${o}`:o)}delete(e){this[W9].map.delete(FFe(e))}forEach(e,r){for(let n of this.keys())e.call(r,this.get(n),n)}keys(){return Array.from(this[W9].map.keys()).sort()}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return this.constructor.name}plain(){return Object.fromEntries(this[W9].map)}};Object.defineProperties(oIt.prototype,["append","delete","entries","forEach","get","has","keys","set","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));xYi.exports={Headers:oIt}});var DFr=I((E7h,wYi)=>{"use strict";p();var{EventEmitter:HFc}=require("events"),qN=Symbol("AbortSignal internals"),X_e=class{static{a(this,"AbortSignal")}constructor(){this[qN]={eventEmitter:new HFc,onabort:null,aborted:!1}}get aborted(){return this[qN].aborted}get onabort(){return this[qN].onabort}set onabort(e){this[qN].onabort=e}get[Symbol.toStringTag](){return this.constructor.name}removeEventListener(e,r){this[qN].eventEmitter.removeListener(e,r)}addEventListener(e,r){this[qN].eventEmitter.on(e,r)}dispatchEvent(e){let r={type:e,target:this},n=`on${e}`;typeof this[qN][n]=="function"&&this[n](r),this[qN].eventEmitter.emit(e,r)}fire(){this[qN].aborted=!0,this.dispatchEvent("abort")}};Object.defineProperties(X_e.prototype,{addEventListener:{enumerable:!0},removeEventListener:{enumerable:!0},dispatchEvent:{enumerable:!0},aborted:{enumerable:!0},onabort:{enumerable:!0}});var aIt=class extends X_e{static{a(this,"TimeoutSignal")}constructor(e){if(!Number.isInteger(e))throw new TypeError(`Expected an integer, got ${typeof e}`);super(),this[qN].timerId=setTimeout(()=>{this.fire()},e)}clear(){clearTimeout(this[qN].timerId)}};Object.defineProperties(aIt.prototype,{clear:{enumerable:!0}});var sIt=Symbol("AbortController internals"),cIt=class{static{a(this,"AbortController")}constructor(){this[sIt]={signal:new X_e}}get signal(){return this[sIt].signal}get[Symbol.toStringTag](){return this.constructor.name}abort(){this[sIt].signal.aborted||this[sIt].signal.fire()}};Object.defineProperties(cIt.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});wYi.exports={AbortController:cIt,AbortSignal:X_e,TimeoutSignal:aIt}});var UFe=I((C7h,PYi)=>{"use strict";p();var{randomBytes:GFc}=require("crypto"),{Readable:$Fc}=require("stream"),MFr=a(t=>typeof t=="object"&&["arrayBuffer","stream","text","slice","constructor"].map(e=>typeof t[e]).filter(e=>e!=="function").length===0&&typeof t.type=="string"&&typeof t.size=="number"&&/^(Blob|File)$/.test(t[Symbol.toStringTag]),"isBlob"),VFc=a(t=>t!=null&&typeof t=="object"&&["append","delete","get","getAll","has","set","keys","values","entries","constructor"].map(e=>typeof t[e]).filter(e=>e!=="function").length===0&&t[Symbol.toStringTag]==="FormData","isFormData"),RYi=a(t=>`--${t}--\r \r -`,"getFooter"),PWi=a((t,e,r)=>{let n="";return n+=`--${t}\r -`,n+=`Content-Disposition: form-data; name="${e}"`,R3r(r)&&(n+=`; filename="${r.name}"\r +`,"getFooter"),kYi=a((t,e,r)=>{let n="";return n+=`--${t}\r +`,n+=`Content-Disposition: form-data; name="${e}"`,MFr(r)&&(n+=`; filename="${r.name}"\r `,n+=`Content-Type: ${r.type||"application/octet-stream"}`),`${n}\r \r -`},"getHeader");async function*iBc(t,e){for(let[r,n]of t)yield PWi(e,r,n),R3r(n)?yield*n.stream():yield n,yield`\r -`;yield kWi(e)}a(iBc,"formDataIterator");var oBc=a((t,e)=>{let r=0;for(let[n,o]of t)r+=Buffer.byteLength(PWi(e,n,o)),r+=R3r(o)?o.size:Buffer.byteLength(String(o)),r+=Buffer.byteLength(`\r -`);return r+=Buffer.byteLength(kWi(e)),r},"getFormDataLength"),w3r=class{static{a(this,"FormDataSerializer")}constructor(e){this.fd=e,this.boundary=tBc(8).toString("hex")}length(){return typeof this._length>"u"&&(this._length=oBc(this.fd,this.boundary)),this._length}contentType(){return`multipart/form-data; boundary=${this.boundary}`}stream(){return rBc.from(iBc(this.fd,this.boundary))}};DWi.exports={isFormData:nBc,FormDataSerializer:w3r}});var MWi=I((OFh,NWi)=>{"use strict";p();var{AbortSignal:MFh}=x3r(),{Body:sBc,cloneStream:aBc,guessContentType:cBc}=MTt(),{Headers:lBc}=N_e(),{isPlainObject:uBc}=N9(),{isFormData:dBc,FormDataSerializer:fBc}=hFe(),pBc=20,HV=Symbol("Request internals"),UTt=class t extends sBc{static{a(this,"Request")}constructor(e,r={}){let n=e instanceof t?e:null,o=n?new URL(n.url):new URL(e),s=r.method||n&&n.method||"GET";if(s=s.toUpperCase(),(r.body!=null||n&&n.body!==null)&&["GET","HEAD"].includes(s))throw new TypeError("Request with GET/HEAD method cannot have body");let c=r.body||(n&&n.body?aBc(n):null),l=new lBc(r.headers||n&&n.headers||{});if(dBc(c)&&!l.has("content-type")){let h=new fBc(c);c=h.stream(),l.set("content-type",h.contentType()),!l.has("transfer-encoding")&&!l.has("content-length")&&l.set("content-length",h.length())}if(!l.has("content-type"))if(uBc(c))c=JSON.stringify(c),l.set("content-type","application/json");else{let h=cBc(c);h&&l.set("content-type",h)}super(c);let u=n?n.signal:null;"signal"in r&&(u=r.signal);let d=r.redirect||n&&n.redirect||"follow";if(!["follow","error","manual"].includes(d))throw new TypeError(`'${d}' is not a valid redirect option`);let f=r.cache||n&&n.cache||"default";if(!["default","no-store","reload","no-cache","force-cache","only-if-cached"].includes(f))throw new TypeError(`'${f}' is not a valid cache option`);this[HV]={init:{...r},method:s,redirect:d,cache:f,headers:l,parsedURL:o,signal:u},r.follow===void 0?!n||n.follow===void 0?this.follow=pBc:this.follow=n.follow:this.follow=r.follow,this.counter=r.counter||n&&n.counter||0,r.compress===void 0?!n||n.compress===void 0?this.compress=!0:this.compress=n.compress:this.compress=r.compress,r.decode===void 0?!n||n.decode===void 0?this.decode=!0:this.decode=n.decode:this.decode=r.decode}get method(){return this[HV].method}get url(){return this[HV].parsedURL.toString()}get headers(){return this[HV].headers}get redirect(){return this[HV].redirect}get cache(){return this[HV].cache}get signal(){return this[HV].signal}clone(){return new t(this)}get init(){return this[HV].init}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(UTt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},cache:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}});NWi.exports={Request:UTt}});var k3r=I((FFh,OWi)=>{"use strict";p();var{Body:hBc,cloneStream:mBc,guessContentType:gBc}=MTt(),{Headers:ABc}=N_e(),{isPlainObject:yBc}=N9(),{isFormData:EBc,FormDataSerializer:_Bc}=hFe(),MN=Symbol("Response internals"),QTt=class t extends hBc{static{a(this,"Response")}constructor(e=null,r={}){let n=new ABc(r.headers),o=e;if(EBc(o)&&!n.has("content-type")){let s=new _Bc(o);o=s.stream(),n.set("content-type",s.contentType()),!n.has("transfer-encoding")&&!n.has("content-length")&&n.set("content-length",s.length())}if(o!==null&&!n.has("content-type"))if(yBc(o))o=JSON.stringify(o),n.set("content-type","application/json");else{let s=gBc(o);s&&n.set("content-type",s)}super(o),this[MN]={url:r.url,status:r.status||200,statusText:r.statusText||"",headers:n,httpVersion:r.httpVersion,decoded:r.decoded,counter:r.counter}}get url(){return this[MN].url||""}get status(){return this[MN].status}get statusText(){return this[MN].statusText}get ok(){return this[MN].status>=200&&this[MN].status<300}get redirected(){return this[MN].counter>0}get headers(){return this[MN].headers}get httpVersion(){return this[MN].httpVersion}get decoded(){return this[MN].decoded}static redirect(e,r=302){if(![301,302,303,307,308].includes(r))throw new RangeError("Invalid status code");return new t(null,{headers:{location:new URL(e).toString()},status:r})}clone(){if(this.bodyUsed)throw new TypeError("Cannot clone: already read");return new t(mBc(this),{...this[MN]})}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(QTt.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});OWi.exports={Response:QTt}});var BWi=I((jFh,LWi)=>{"use strict";p();var vBc=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),CBc=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),bBc=new Set([500,502,503,504]),SBc={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},TBc={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function Nie(t){let e=parseInt(t,10);return isFinite(e)?e:0}a(Nie,"toNumberOrZero");function IBc(t){return t?bBc.has(t.status):!0}a(IBc,"isErrorResponse");function P3r(t){let e={};if(!t)return e;let r=t.trim().split(/,/);for(let n of r){let[o,s]=n.split(/=/,2);e[o.trim()]=s===void 0?!0:s.trim().replace(/^"|"$/g,"")}return e}a(P3r,"parseCacheControl");function xBc(t){let e=[];for(let r in t){let n=t[r];e.push(n===!0?r:r+"="+n)}if(e.length)return e.join(", ")}a(xBc,"formatCacheControl");LWi.exports=class{static{a(this,"CachePolicy")}constructor(e,r,{shared:n,cacheHeuristic:o,immutableMinTimeToLive:s,ignoreCargoCult:c,_fromObject:l}={}){if(l){this._fromObject(l);return}if(!r||!r.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=n!==!1,this._cacheHeuristic=o!==void 0?o:.1,this._immutableMinTtl=s!==void 0?s:24*3600*1e3,this._status="status"in r?r.status:200,this._resHeaders=r.headers,this._rescc=P3r(r.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=r.headers.vary?e.headers:null,this._reqcc=P3r(e.headers["cache-control"]),c&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":xBc(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),r.headers["cache-control"]==null&&/no-cache/.test(r.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&CBc.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||vBc.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);let r=P3r(e.headers["cache-control"]);return r["no-cache"]||/no-cache/.test(e.headers.pragma)||r["max-age"]&&this.age()>r["max-age"]||r["min-fresh"]&&this.timeToLive()<1e3*r["min-fresh"]||this.stale()&&!(r["max-stale"]&&!this._rescc["must-revalidate"]&&(r["max-stale"]===!0||r["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(e,!1)}_requestMatches(e,r){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||r&&e.method==="HEAD")&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let r=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let n of r)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){let r={};for(let n in e)SBc[n]||(r[n]=e[n]);if(e.connection){let n=e.connection.trim().split(/\s*,\s*/);for(let o of n)delete r[o]}if(r.warning){let n=r.warning.split(/,/).filter(o=>!/^\s*1[0-9][0-9]/.test(o));n.length?r.warning=n.join(",").trim():delete r.warning}return r}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),r=this.age();return r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(r)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),r=(this.now()-this._responseTime)/1e3;return e+r}_ageValue(){return Nie(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return Nie(this._rescc["s-maxage"])}if(this._rescc["max-age"])return Nie(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,r=this.date();if(this._resHeaders.expires){let n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||nn)return Math.max(e,(r-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),r=e+Nie(this._rescc["stale-if-error"]),n=e+Nie(this._rescc["stale-while-revalidate"]);return Math.max(0,e,r,n)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+Nie(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+Nie(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let r=this._copyWithoutHopByHopHeaders(e.headers);if(delete r["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete r["if-none-match"],delete r["if-modified-since"],r;if(this._resHeaders.etag&&(r["if-none-match"]=r["if-none-match"]?`${r["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),r["accept-ranges"]||r["if-match"]||r["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete r["if-modified-since"],r["if-none-match"]){let o=r["if-none-match"].split(/,/).filter(s=>!/^\s*W\//.test(s));o.length?r["if-none-match"]=o.join(",").trim():delete r["if-none-match"]}}else this._resHeaders["last-modified"]&&!r["if-modified-since"]&&(r["if-modified-since"]=this._resHeaders["last-modified"]);return r}revalidatedPolicy(e,r){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&IBc(r))return{modified:!1,matches:!1,policy:this};if(!r||!r.headers)throw Error("Response headers missing");let n=!1;if(r.status!==void 0&&r.status!=304?n=!1:r.headers.etag&&!/^\s*W\//.test(r.headers.etag)?n=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag:this._resHeaders.etag&&r.headers.etag?n=this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?n=this._resHeaders["last-modified"]===r.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!r.headers.etag&&!r.headers["last-modified"]&&(n=!0),!n)return{policy:new this.constructor(e,r),modified:r.status!=304,matches:!1};let o={};for(let c in this._resHeaders)o[c]=c in r.headers&&!TBc[c]?r.headers[c]:this._resHeaders[c];let s=Object.assign({},r,{status:this._status,method:this._method,headers:o});return{policy:new this.constructor(e,s,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}});var qWi=I(($Fh,QWi)=>{"use strict";p();var wBc=BWi(),{Headers:RBc}=N_e(),FWi=a(t=>({url:t.url,method:t.method,headers:t.headers.plain()}),"convertRequest"),UWi=a(t=>({status:t.status,headers:t.headers.plain()}),"convertResponse"),D3r=class{static{a(this,"CachePolicyWrapper")}constructor(e,r,n){this.policy=new wBc(FWi(e),UWi(r),n)}storable(){return this.policy.storable()}satisfiesWithoutRevalidation(e){return this.policy.satisfiesWithoutRevalidation(FWi(e))}responseHeaders(e){return new RBc(this.policy.responseHeaders(UWi(e)))}timeToLive(){return this.policy.timeToLive()}};QWi.exports=D3r});var GWi=I((zFh,HWi)=>{"use strict";p();var{Readable:kBc}=require("stream"),{Headers:jWi}=N_e(),{Response:PBc}=k3r(),GV=Symbol("CacheableResponse internals"),DBc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),N3r=class t extends PBc{static{a(this,"CacheableResponse")}constructor(e,r){super(e,r);let n=new jWi(r.headers);this[GV]={headers:n,bufferedBody:e}}get headers(){return this[GV].headers}set headers(e){if(e instanceof jWi)this[GV].headers=e;else throw new TypeError("instance of Headers expected")}get body(){return kBc.from(this[GV].bufferedBody)}get bodyUsed(){return!1}async buffer(){return this[GV].bufferedBody}async arrayBuffer(){return DBc(this[GV].bufferedBody)}async text(){return this[GV].bufferedBody.toString()}async json(){return JSON.parse(await this.text())}clone(){let{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l}=this;return new t(this[GV].bufferedBody,{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l})}get[Symbol.toStringTag](){return this.constructor.name}},NBc=a(async t=>{let e=await t.buffer(),{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u}=t;return new N3r(e,{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u})},"cacheableResponse");HWi.exports={cacheableResponse:NBc}});var qTt=I((JFh,$Wi)=>{"use strict";p();var M3r=class extends Error{static{a(this,"RequestAbortedError")}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};$Wi.exports={RequestAbortedError:M3r}});var KWi=I((e8h,YWi)=>{"use strict";p();var WWi=require("http"),zWi=require("https"),{Readable:MBc}=require("stream"),L9=EP()("helix-fetch:h1"),{RequestAbortedError:VWi}=qTt(),{decodeStream:OBc}=N9(),LBc=a((t,e)=>{let{h1:r,options:{h1:n,rejectUnauthorized:o}}=t;return e==="https:"?r.httpsAgent?r.httpsAgent:n||typeof o=="boolean"?(r.httpsAgent=new zWi.Agent(typeof o=="boolean"?{...n||{},rejectUnauthorized:o}:n),r.httpsAgent):void 0:r.httpAgent?r.httpAgent:n?(r.httpAgent=new WWi.Agent(n),r.httpAgent):void 0},"getAgent"),BBc=a(t=>{t.h1={}},"setupContext"),FBc=a(async({h1:t})=>{t.httpAgent&&(L9("resetContext: destroying httpAgent"),t.httpAgent.destroy(),delete t.httpAgent),t.httpsAgent&&(L9("resetContext: destroying httpsAgent"),t.httpsAgent.destroy(),delete t.httpsAgent)},"resetContext"),UBc=a((t,e,r)=>{let{statusCode:n,statusMessage:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u}=t,d=e?OBc(n,u,t,r):t;return{statusCode:n,statusText:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u,readable:d,decoded:!!(e&&d!==t)}},"createResponse"),QBc=a(async(t,e,r)=>{let{request:n}=e.protocol==="https:"?zWi:WWi,o=LBc(t,e.protocol),s={...r,agent:o},{socket:c,body:l}=s;return c&&(delete s.socket,c.assigned||(c.assigned=!0,o?s.agent=new Proxy(o,{get:a((u,d)=>d==="createConnection"&&!c.inUse?(f,h)=>{L9(`agent reusing socket #${c.id} (${c.servername})`),c.inUse=!0,h(null,c)}:u[d],"get")}):s.createConnection=(u,d)=>{L9(`reusing socket #${c.id} (${c.servername})`),c.inUse=!0,d(null,c)})),new Promise((u,d)=>{L9(`${s.method} ${e.href}`);let f,{signal:h}=s,m=a(()=>{h.removeEventListener("abort",m),c&&!c.inUse&&(L9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),d(new VWi),f&&f.abort()},"onAbortSignal");if(h){if(h.aborted){d(new VWi);return}h.addEventListener("abort",m)}f=n(e,s),f.once("response",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(L9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),u(UBc(g,s.decode,d))}),f.once("error",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(L9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),f.aborted||(L9(`${s.method} ${e.href} failed with: ${g.message}`),f.abort(),d(g))}),l instanceof MBc?l.pipe(f):(l&&f.write(l),f.end())})},"h1Request");YWi.exports={request:QBc,setupContext:BBc,resetContext:FBc}});var ezi=I((n8h,XWi)=>{"use strict";p();var{connect:qBc,constants:jBc}=require("http2"),{Readable:HBc}=require("stream"),vd=EP()("helix-fetch:h2"),{RequestAbortedError:JWi}=qTt(),{decodeStream:GBc}=N9(),{NGHTTP2_CANCEL:mFe}=jBc,$Bc=300*1e3,VBc=5e3,WBc=a(t=>{t.h2={sessionCache:{}}},"setupContext"),zBc=a(async({h2:t})=>Promise.all(Object.values(t.sessionCache).map(e=>new Promise(r=>{e.on("close",r),vd(`resetContext: destroying session (socket #${e.socket&&e.socket.id}, ${e.socket&&e.socket.servername})`),e.destroy()}))),"resetContext"),ZWi=a((t,e,r,n=()=>{})=>{let o={...t},s=o[":status"];delete o[":status"];let c=r?GBc(s,t,e,n):e;return{statusCode:s,statusText:"",httpVersion:"2.0",httpVersionMajor:2,httpVersionMinor:0,headers:o,readable:c,decoded:!!(r&&c!==e)}},"createResponse"),YBc=a((t,e,r,n,o,s)=>{let{options:{h2:{pushPromiseHandler:c,pushHandler:l,pushedStreamIdleTimeout:u=VBc}}}=t,d=o[":path"],f=`${e}${d}`;vd(`received PUSH_PROMISE: ${f}, stream #${n.id}, headers: ${JSON.stringify(o)}, flags: ${s}`),c&&c(f,o,a(()=>{n.close(mFe)},"rejectPush")),n.on("push",(h,m)=>{vd(`received push headers for ${e}${d}, stream #${n.id}, headers: ${JSON.stringify(h)}, flags: ${m}`),n.setTimeout(u,()=>{vd(`closing pushed stream #${n.id} after ${u} ms of inactivity`),n.close(mFe)}),l&&l(f,o,ZWi(h,n,r))}),n.on("aborted",()=>{vd(`pushed stream #${n.id} aborted`)}),n.on("error",h=>{vd(`pushed stream #${n.id} encountered error: ${h}`)}),n.on("frameError",(h,m,g)=>{vd(`pushed stream #${n.id} encountered frameError: type: ${h}, code: ${m}, id: ${g}`)})},"handlePush"),KBc=a(async(t,e,r)=>{let{origin:n,pathname:o,search:s,hash:c}=e,l=`${o}${s}${c}`,{options:{h2:u={}},h2:{sessionCache:d}}=t,{idleSessionTimeout:f=$Bc,pushPromiseHandler:h,pushHandler:m}=u,g={...r},{method:A,headers:y,socket:E,body:_,decode:v}=g;return E&&delete g.socket,y.host&&(y[":authority"]=y.host,delete y.host),new Promise((b,T)=>{let w=d[n];if(!w||w.closed||w.destroyed){let N=!(t.options.rejectUnauthorized===!1||u.rejectUnauthorized===!1),L={...u,rejectUnauthorized:N};E&&!E.inUse&&(L.createConnection=()=>(vd(`reusing socket #${E.id} (${E.servername})`),E.inUse=!0,E)),w=qBc(n,{...L,settings:{enablePush:!!(h||m)}}),w.setMaxListeners(1e3),w.setTimeout(f,()=>{vd(`closing session ${n} after ${f} ms of inactivity`),w.close()}),w.once("connect",()=>{vd(`session ${n} established`),vd(`caching session ${n}`),d[n]=w}),w.on("localSettings",q=>{vd(`session ${n} localSettings: ${JSON.stringify(q)}`)}),w.on("remoteSettings",q=>{vd(`session ${n} remoteSettings: ${JSON.stringify(q)}`)}),w.once("close",()=>{vd(`session ${n} closed`),d[n]===w&&(vd(`discarding cached session ${n}`),delete d[n])}),w.once("error",q=>{vd(`session ${n} encountered error: ${q}`),d[n]===w&&(vd(`discarding cached session ${n}`),delete d[n])}),w.on("frameError",(q,M,O)=>{vd(`session ${n} encountered frameError: type: ${q}, code: ${M}, id: ${O}`)}),w.once("goaway",(q,M,O)=>{vd(`session ${n} received GOAWAY frame: errorCode: ${q}, lastStreamID: ${M}, opaqueData: ${O?O.toString():void 0}`)}),w.on("stream",(q,M,O)=>{YBc(t,n,v,q,M,O)})}else E&&E.id!==w.socket.id&&!E.inUse&&(vd(`discarding redundant socket used for ALPN: #${E.id} ${E.servername}`),E.destroy());vd(`${A} ${e.host}${l}`);let R,{signal:x}=g,P=a(()=>{x.removeEventListener("abort",P),T(new JWi),R&&R.close(mFe)},"onAbortSignal");if(x){if(x.aborted){T(new JWi);return}x.addEventListener("abort",P)}let D=a(N=>{vd(`session ${n} encountered error during ${g.method} ${e.href}: ${N}`),T(N)},"onSessionError");w.once("error",D),R=w.request({":method":A,":path":l,...y}),R.once("response",N=>{w.off("error",D),x&&x.removeEventListener("abort",P),b(ZWi(N,R,g.decode,T))}),R.once("error",N=>{w.off("error",D),x&&x.removeEventListener("abort",P),R.rstCode!==mFe&&(vd(`${g.method} ${e.href} failed with: ${N.message}`),R.close(mFe),T(N))}),R.once("frameError",(N,L,B)=>{w.off("error",D),vd(`encountered frameError during ${g.method} ${e.href}: type: ${N}, code: ${L}, id: ${B}`)}),R.on("push",(N,L)=>{vd(`received 'push' event: headers: ${JSON.stringify(N)}, flags: ${L}`)}),_ instanceof HBc?_.pipe(R):(_&&R.write(_),R.end())})},"request");XWi.exports={request:KBc,setupContext:WBc,resetContext:zBc}});var rzi=I((s8h,tzi)=>{"use strict";p();var{EventEmitter:JBc}=require("events"),ZBc=a(()=>{let t={},e=new JBc;return e.setMaxListeners(0),{acquire:a(r=>new Promise(n=>{if(!t[r]){t[r]=!0,n();return}let o=a(s=>{t[r]||(t[r]=!0,e.removeListener(r,o),n(s))},"tryAcquire");e.on(r,o)}),"acquire"),release:a((r,n)=>{Reflect.deleteProperty(t,r),setImmediate(()=>e.emit(r,n))},"release")}},"lock");tzi.exports=ZBc});var nzi=I((l8h,XBc)=>{XBc.exports={name:"@adobe/helix-fetch",version:"3.1.1",description:"Light-weight Fetch implementation transparently supporting both HTTP/1(.1) and HTTP/2",main:"src/index.js",scripts:{test:"nyc mocha",lint:"./node_modules/.bin/eslint .","semantic-release":"semantic-release"},mocha:{timeout:"5000",recursive:"true",reporter:"mocha-multi-reporters","reporter-options":"configFile=.mocha-multi.json"},engines:{node:">=12.0"},types:"src/index.d.ts",exports:{import:"./src/index.mjs",require:"./src/index.js"},repository:{type:"git",url:"https://github.com/adobe/helix-fetch"},author:"",license:"Apache-2.0",bugs:{url:"https://github.com/adobe/helix-fetch/issues"},homepage:"https://github.com/adobe/helix-fetch#readme",keywords:["fetch","whatwg","Fetch API","http","https","http2","h2","promise","async","request","RFC 7234","7234","caching","cache"],dependencies:{debug:"4.3.4","http-cache-semantics":"^4.1.1","lru-cache":"7.13.1"},devDependencies:{"@adobe/eslint-config-helix":"1.3.2","@semantic-release/changelog":"6.0.1","@semantic-release/git":"10.0.1",chai:"4.3.6","chai-as-promised":"7.1.1","chai-bytes":"0.1.2","chai-iterator":"3.0.2",eslint:"8.21.0","eslint-plugin-header":"3.1.1","eslint-plugin-import":"2.26.0","formdata-node":"4.3.3","lint-staged":"13.0.3",mocha:"10.0.0","mocha-multi-reporters":"1.5.1",nock:"13.2.9",nyc:"15.1.0","parse-cache-control":"1.0.1",pem:"1.14.6",proxy:"^1.0.2","semantic-release":"19.0.3",sinon:"14.0.0","stream-buffers":"3.0.2",tunnel:"^0.0.6"},"lint-staged":{"*.js":"eslint"},config:{commitizen:{path:"node_modules/cz-conventional-changelog"},ghooks:{"pre-commit":"npx lint-staged"}}}});var czi=I((u8h,azi)=>{"use strict";p();var{Readable:e3c}=require("stream"),t3c=require("tls"),{types:{isAnyArrayBuffer:r3c}}=require("util"),n3c=b3r(),O3r=EP()("helix-fetch:core"),{RequestAbortedError:jTt}=qTt(),L3r=KWi(),HTt=ezi(),i3c=rzi(),{isPlainObject:o3c}=N9(),{isFormData:s3c,FormDataSerializer:a3c}=hFe(),{version:c3c}=nzi(),B3r="h2",F3r="h2c",U3r="http/1.0",Mie="http/1.1",l3c=100,u3c=3600*1e3,d3c=[B3r,Mie,U3r],f3c=`helix-fetch/${c3c}`,p3c={method:"GET",compress:!0,decode:!0},izi=0,ozi=i3c(),szi=a((t,e)=>new Promise((r,n)=>{let{signal:o}=e,s,c=a(()=>{o.removeEventListener("abort",c);let d=new jTt;n(d),s&&s.destroy(d)},"onAbortSignal");if(o){if(o.aborted){n(new jTt);return}o.addEventListener("abort",c)}let l=+t.port||443,u=a(d=>{o&&o.removeEventListener("abort",c),d instanceof jTt||(O3r(`connecting to ${t.hostname}:${l} failed with: ${d.message}`),n(d))},"onError");s=t3c.connect(l,t.hostname,e),s.once("secureConnect",()=>{o&&o.removeEventListener("abort",c),s.off("error",u),izi+=1,s.id=izi,s.secureConnecting=!1,O3r(`established TLS connection: #${s.id} (${s.servername})`),r(s)}),s.once("error",u)}),"connectTLS"),h3c=a(async(t,e)=>{let r=await ozi.acquire(t.origin);try{return r||(r=await szi(t,e)),r}finally{ozi.release(t.origin,r)}},"connect"),m3c=a(async(t,e,r)=>{let n=`${e.protocol}//${e.host}`,o=t.alpnCache.get(n);if(o)return{protocol:o};switch(e.protocol){case"http:":return o=Mie,t.alpnCache.set(n,o),{protocol:o};case"http2:":return o=F3r,t.alpnCache.set(n,o),{protocol:o};case"https:":break;default:throw new TypeError(`unsupported protocol: ${e.protocol}`)}let{options:{rejectUnauthorized:s,h1:c={},h2:l={}}}=t,u=!(s===!1||c.rejectUnauthorized===!1||l.rejectUnauthorized===!1),d={servername:e.hostname,ALPNProtocols:t.alpnProtocols,signal:r,rejectUnauthorized:u};t.options.ca&&(d.ca=t.options.ca);let f=await h3c(e,d);return o=f.alpnProtocol,o||(o=Mie),t.alpnCache.set(n,o),{protocol:o,socket:f}},"determineProtocol"),g3c=a(t=>{let e={};return Object.keys(t).forEach(r=>{e[r.toLowerCase()]=t[r]}),e},"sanitizeHeaders"),A3c=a(async(t,e,r,n)=>{let o=e.protocol==="https:",s;e.port?s=e.port:o?s=443:s=80;let c={...r,host:e.host,hostname:e.hostname,port:s},l=await t(c);if(o){let d={...c,ALPNProtocols:n};d.socket=l,d.servername=c.host;let f=await szi(e,d);return{protocol:f.alpnProtocol||Mie,socket:f}}return{protocol:l.alpnProtocol||Mie,socket:l}},"getProtocolAndSocketFromFactory"),y3c=a(async(t,e,r)=>{let n=new URL(e),o={...p3c,...r||{}};typeof o.method=="string"&&(o.method=o.method.toUpperCase()),o.headers=g3c(o.headers||{}),o.headers.host===void 0&&(o.headers.host=n.host),t.userAgent&&o.headers["user-agent"]===void 0&&(o.headers["user-agent"]=t.userAgent);let s;if(o.body instanceof URLSearchParams)s="application/x-www-form-urlencoded; charset=utf-8",o.body=o.body.toString();else if(s3c(o.body)){let d=new a3c(o.body);s=d.contentType(),o.body=d.stream(),o.headers["transfer-encoding"]===void 0&&o.headers["content-length"]===void 0&&(o.headers["content-length"]=String(d.length()))}else typeof o.body=="string"||o.body instanceof String?s="text/plain; charset=utf-8":o3c(o.body)?(o.body=JSON.stringify(o.body),s="application/json"):r3c(o.body)&&(o.body=Buffer.from(o.body));o.headers["content-type"]===void 0&&s!==void 0&&(o.headers["content-type"]=s),o.body!=null&&(o.body instanceof e3c||(!(typeof o.body=="string"||o.body instanceof String)&&!Buffer.isBuffer(o.body)&&(o.body=String(o.body)),o.headers["transfer-encoding"]===void 0&&o.headers["content-length"]===void 0&&(o.headers["content-length"]=String(Buffer.isBuffer(o.body)?o.body.length:Buffer.byteLength(o.body,"utf-8"))))),o.headers.accept===void 0&&(o.headers.accept="*/*"),o.body==null&&["POST","PUT"].includes(o.method)&&(o.headers["content-length"]="0"),o.compress&&o.headers["accept-encoding"]===void 0&&(o.headers["accept-encoding"]="gzip,deflate,br");let{signal:c}=o,{protocol:l,socket:u=null}=t.socketFactory?await A3c(t.socketFactory,n,o,t.alpnProtocols):await m3c(t,n,c);switch(O3r(`${n.host} -> ${l}`),l){case B3r:try{return await HTt.request(t,n,u?{...o,socket:u}:o)}catch(d){let{code:f,message:h}=d;throw f==="ERR_HTTP2_ERROR"&&h==="Protocol error"&&t.alpnCache.delete(`${n.protocol}//${n.host}`),d}case F3r:return HTt.request(t,new URL(`http://${n.host}${n.pathname}${n.hash}${n.search}`),u?{...o,socket:u}:o);case U3r:case Mie:return L3r.request(t,n,u?{...o,socket:u}:o);default:throw new TypeError(`unsupported protocol: ${l}`)}},"request"),E3c=a(async t=>(t.alpnCache.clear(),Promise.all([L3r.resetContext(t),HTt.resetContext(t)])),"resetContext"),_3c=a(t=>{let{options:{alpnProtocols:e=d3c,alpnCacheTTL:r=u3c,alpnCacheSize:n=l3c,userAgent:o=f3c,socketFactory:s}}=t;t.alpnProtocols=e,t.alpnCache=new n3c({max:n,ttl:r}),t.userAgent=o,t.socketFactory=s,L3r.setupContext(t),HTt.setupContext(t)},"setupContext");azi.exports={request:y3c,setupContext:_3c,resetContext:E3c,RequestAbortedError:jTt,ALPN_HTTP2:B3r,ALPN_HTTP2C:F3r,ALPN_HTTP1_1:Mie,ALPN_HTTP1_0:U3r}});var uzi=I((p8h,lzi)=>{"use strict";p();var v3c=EP()("helix-fetch:core"),{request:C3c,setupContext:b3c,resetContext:S3c,RequestAbortedError:T3c,ALPN_HTTP2:I3c,ALPN_HTTP2C:x3c,ALPN_HTTP1_1:w3c,ALPN_HTTP1_0:R3c}=czi(),Q3r=class t{static{a(this,"RequestContext")}constructor(e){this.options={...e||{}},b3c(this)}api(){return{request:a(async(e,r)=>this.request(e,r),"request"),context:a((e={})=>new t(e).api(),"context"),setCA:a(e=>this.setCA(e),"setCA"),reset:a(async()=>this.reset(),"reset"),RequestAbortedError:T3c,ALPN_HTTP2:I3c,ALPN_HTTP2C:x3c,ALPN_HTTP1_1:w3c,ALPN_HTTP1_0:R3c}}async request(e,r){return C3c(this,e,r)}setCA(e){this.options.ca=e}async reset(){return v3c("resetting context"),S3c(this)}};lzi.exports=new Q3r().api()});var mzi=I((g8h,hzi)=>{"use strict";p();var{EventEmitter:k3c}=require("events"),{Readable:gFe}=require("stream"),q3r=EP()("helix-fetch"),P3c=b3r(),{Body:D3c}=MTt(),{Headers:$3r}=N_e(),{Request:Oie}=MWi(),{Response:H3r}=k3r(),{FetchBaseError:N3c,FetchError:AFe,AbortError:GTt}=I3r(),{AbortController:M3c,AbortSignal:O3c,TimeoutSignal:L3c}=x3r(),B3c=qWi(),{cacheableResponse:F3c}=GWi(),{sizeof:U3c}=N9(),{isFormData:Q3c}=hFe(),{context:q3c,RequestAbortedError:j3c}=uzi(),dzi=["GET","HEAD"],H3c=500,G3c=100*1024*1024,j3r="push",fzi=a(async(t,e,r)=>{let{request:n}=t.context,o=e instanceof Oie&&typeof r>"u"?e:new Oie(e,r),{method:s,body:c,signal:l,compress:u,decode:d,follow:f,redirect:h,init:{body:m}}=o,g;if(l&&l.aborted){let w=new GTt("The operation was aborted.");throw o.init.body instanceof gFe&&o.init.body.destroy(w),w}try{g=await n(o.url,{...r,method:s,headers:o.headers.plain(),body:m&&!(m instanceof gFe)&&!Q3c(m)?m:c,compress:u,decode:d,follow:f,redirect:h,signal:l})}catch(w){throw m instanceof gFe&&m.destroy(w),w instanceof TypeError?w:w instanceof j3c?new GTt("The operation was aborted."):new AFe(w.message,"system",w)}let A=a(()=>{l.removeEventListener("abort",A);let w=new GTt("The operation was aborted.");o.init.body instanceof gFe&&o.init.body.destroy(w),g.readable.emit("error",w)},"abortHandler");l&&l.addEventListener("abort",A);let{statusCode:y,statusText:E,httpVersion:_,headers:v,readable:b,decoded:T}=g;if([301,302,303,307,308].includes(y)){let{location:w}=v,R=w==null?null:new URL(w,o.url);switch(o.redirect){case"manual":break;case"error":throw l&&l.removeEventListener("abort",A),new AFe(`uri requested responds with a redirect, redirect mode is set to 'error': ${o.url}`,"no-redirect");case"follow":{if(R===null)break;if(o.counter>=o.follow)throw l&&l.removeEventListener("abort",A),new AFe(`maximum redirect reached at: ${o.url}`,"max-redirect");let x={headers:new $3r(o.headers),follow:o.follow,compress:o.compress,decode:o.decode,counter:o.counter+1,method:o.method,body:o.body,signal:o.signal};if(y!==303&&o.body&&o.init.body instanceof gFe)throw l&&l.removeEventListener("abort",A),new AFe("Cannot follow redirect with body being a readable stream","unsupported-redirect");return(y===303||(y===301||y===302)&&o.method==="POST")&&(x.method="GET",x.body=void 0,x.headers.delete("content-length")),l&&l.removeEventListener("abort",A),fzi(t,new Oie(R,x))}default:}}return l&&(b.once("end",()=>{l.removeEventListener("abort",A)}),b.once("error",()=>{l.removeEventListener("abort",A)})),new H3r(b,{url:o.url,status:y,statusText:E,headers:v,httpVersion:_,decoded:T,counter:o.counter})},"fetch"),pzi=a(async(t,e,r)=>{if(t.options.maxCacheSize===0||!dzi.includes(e.method))return r;let n=new B3c(e,r,{shared:!1});if(n.storable()){let o=await F3c(r);return t.cache.set(e.url,{policy:n,response:o},n.timeToLive()),o}else return r},"cacheResponse"),$3c=a(async(t,e,r)=>{let n=new Oie(e,r);if(t.options.maxCacheSize!==0&&dzi.includes(n.method)&&!["no-store","reload"].includes(n.cache)){let{policy:c,response:l}=t.cache.get(n.url)||{};if(c&&c.satisfiesWithoutRevalidation(n)){l.headers=new $3r(c.responseHeaders(l));let u=l.clone();return u.fromCache=!0,u}}let s=await fzi(t,n);return n.cache!=="no-store"?pzi(t,n,s):s},"cachingFetch"),V3c=a((t,e={})=>{let r=new URL(t);if(typeof e!="object"||Array.isArray(e))throw new TypeError("qs: object expected");return Object.entries(e).forEach(([n,o])=>{Array.isArray(o)?o.forEach(s=>r.searchParams.append(n,s)):r.searchParams.append(n,o)}),r.href},"createUrl"),W3c=a(t=>new L3c(t),"timeoutSignal"),G3r=class t{static{a(this,"FetchContext")}constructor(e){this.options={...e};let{maxCacheSize:r}=this.options,n=typeof r=="number"&&r>=0?r:G3c,o=H3c;n===0&&(n=1,o=1);let s=a(({response:l},u)=>U3c(l),"sizeCalculation");this.cache=new P3c({max:o,maxSize:n,sizeCalculation:s}),this.eventEmitter=new k3c,this.options.h2=this.options.h2||{},typeof this.options.h2.enablePush>"u"&&(this.options.h2.enablePush=!0);let{enablePush:c}=this.options.h2;c&&(this.options.h2.pushPromiseHandler=(l,u,d)=>{let f={...u};Object.keys(f).filter(h=>h.startsWith(":")).forEach(h=>delete f[h]),this.pushPromiseHandler(l,f,d)},this.options.h2.pushHandler=(l,u,d)=>{let f={...u};Object.keys(f).filter(_=>_.startsWith(":")).forEach(_=>delete f[_]);let{statusCode:h,statusText:m,httpVersion:g,headers:A,readable:y,decoded:E}=d;this.pushHandler(l,f,new H3r(y,{url:l,status:h,statusText:m,headers:A,httpVersion:g,decoded:E}))}),this.context=q3c(this.options)}api(){return{fetch:a(async(e,r)=>this.fetch(e,r),"fetch"),Body:D3c,Headers:$3r,Request:Oie,Response:H3r,AbortController:M3c,AbortSignal:O3c,FetchBaseError:N3c,FetchError:AFe,AbortError:GTt,context:a((e={})=>new t(e).api(),"context"),setCA:a(e=>this.setCA(e),"setCA"),noCache:a((e={})=>new t({...e,maxCacheSize:0}).api(),"noCache"),h1:a((e={})=>new t({...e,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),"h1"),keepAlive:a((e={})=>new t({...e,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),"keepAlive"),h1NoCache:a((e={})=>new t({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),"h1NoCache"),keepAliveNoCache:a((e={})=>new t({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),"keepAliveNoCache"),reset:a(async()=>this.context.reset(),"reset"),onPush:a(e=>this.onPush(e),"onPush"),offPush:a(e=>this.offPush(e),"offPush"),createUrl:V3c,timeoutSignal:W3c,clearCache:a(()=>this.clearCache(),"clearCache"),cacheStats:a(()=>this.cacheStats(),"cacheStats"),ALPN_HTTP2:this.context.ALPN_HTTP2,ALPN_HTTP2C:this.context.ALPN_HTTP2C,ALPN_HTTP1_1:this.context.ALPN_HTTP1_1,ALPN_HTTP1_0:this.context.ALPN_HTTP1_0}}async fetch(e,r){return $3c(this,e,r)}setCA(e){this.options.ca=e,this.context.setCA(e)}onPush(e){return this.eventEmitter.on(j3r,e)}offPush(e){return this.eventEmitter.off(j3r,e)}clearCache(){this.cache.clear()}cacheStats(){return{size:this.cache.calculatedSize,count:this.cache.size}}pushPromiseHandler(e,r,n){q3r(`received server push promise: ${e}, headers: ${JSON.stringify(r)}`);let o=new Oie(e,{headers:r}),{policy:s}=this.cache.get(e)||{};s&&s.satisfiesWithoutRevalidation(o)&&(q3r(`already cached, reject push promise: ${e}, headers: ${JSON.stringify(r)}`),n())}async pushHandler(e,r,n){q3r(`caching resource pushed by server: ${e}, reqHeaders: ${JSON.stringify(r)}, status: ${n.status}, respHeaders: ${JSON.stringify(n.headers)}`);let o=await pzi(this,new Oie(e,{headers:r}),n);this.eventEmitter.emit(j3r,e,o)}};hzi.exports=new G3r().api()});var Azi=I((E8h,gzi)=>{"use strict";p();gzi.exports=mzi()});var Uzi=I((CUh,Fzi)=>{"use strict";p();function Bzi(t,e,r){let n=e[r];if(t==null&&n.required===!1)return;if(t==null)throw new TypeError(`Required parameter \`${n.name}\` missing`);let o=typeof t;if(n.type&&o!==n.type){if(n.required===!1&&e.slice(r).some(s=>s.type===o))return!1;throw new TypeError(`Invalid type for parameter \`${n.name}\`, expected \`${n.type}\` but found \`${typeof t}\``)}return!0}a(Bzi,"validateParameter");function _Fc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(_Fc,"hasOwnProperty");function vFc(t,e){return function(){let r=Array.prototype.slice.call(arguments),n=[];for(let s=0,c=0;s{n.push((l,u)=>{if(l)return c(l);s(u)}),t.apply(this,n)});t.apply(this,n)}}a(vFc,"defineOperation");Fzi.exports={defineOperation:vFc,validateParameter:Bzi}});var J3r=I((TUh,jzi)=>{"use strict";p();var Q_e=W6e()("kerberos"),U_e=Q_e.KerberosClient,Qzi=Q_e.KerberosServer,VV=Uzi().defineOperation,CFc=1,bFc=2,SFc=4,TFc=8,IFc=16,xFc=32,wFc=64,RFc=128,kFc=256,qzi=0,PFc=9,DFc=6;U_e.prototype.step=VV(U_e.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);U_e.prototype.wrap=VV(U_e.prototype.wrap,[{name:"challenge",type:"string"},{name:"options",type:"object"},{name:"callback",type:"function",required:!1}]);U_e.prototype.unwrap=VV(U_e.prototype.unwrap,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);Qzi.prototype.step=VV(Qzi.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);var NFc=VV(Q_e.checkPassword,[{name:"username",type:"string"},{name:"password",type:"string"},{name:"service",type:"string"},{name:"defaultRealm",type:"string",required:!1},{name:"callback",type:"function",required:!1}]),MFc=VV(Q_e.principalDetails,[{name:"service",type:"string"},{name:"hostname",type:"string"},{name:"callback",type:"function",required:!1}]),OFc=VV(Q_e.initializeClient,[{name:"service",type:"string"},{name:"options",type:"object",default:{mechOID:qzi}},{name:"callback",type:"function",required:!1}]),LFc=VV(Q_e.initializeServer,[{name:"service",type:"string"},{name:"callback",type:"function",required:!1}]);jzi.exports={initializeClient:OFc,initializeServer:LFc,principalDetails:MFc,checkPassword:NFc,GSS_C_DELEG_FLAG:CFc,GSS_C_MUTUAL_FLAG:bFc,GSS_C_REPLAY_FLAG:SFc,GSS_C_SEQUENCE_FLAG:TFc,GSS_C_CONF_FLAG:IFc,GSS_C_INTEG_FLAG:xFc,GSS_C_ANON_FLAG:wFc,GSS_C_PROT_READY_FLAG:RFc,GSS_C_TRANS_FLAG:kFc,GSS_C_NO_OID:qzi,GSS_MECH_OID_KRB5:PFc,GSS_MECH_OID_SPNEGO:DFc}});var Hzi=I((xUh,BFc)=>{BFc.exports={name:"kerberos",version:"2.2.0",description:"Kerberos library for Node.js",main:"lib/index.js",files:["lib","src","binding.gyp","HISTORY.md","README.md"],repository:{type:"git",url:"https://github.com/mongodb-js/kerberos.git"},keywords:["kerberos","security","authentication"],author:{name:"The MongoDB NodeJS Team",email:"dbx-node@mongodb.com"},bugs:{url:"https://jira.mongodb.org/projects/NODE/issues/"},dependencies:{bindings:"^1.5.0","node-addon-api":"^6.1.0","prebuild-install":"^7.1.2"},devDependencies:{"@types/node":"^22.2.0",chai:"^4.4.1","chai-string":"^1.5.0",chalk:"^4.1.2","clang-format":"^1.8.0","dmd-clear":"^0.1.2",eslint:"^9.9.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","jsdoc-to-markdown":"^8.0.3",mocha:"^10.7.3",mongodb:"^6.8.0","node-gyp":"^10.1.0",prebuild:"^13.0.0",prettier:"^3.3.3",request:"^2.88.2"},overrides:{prebuild:{"node-gyp":"$node-gyp"}},scripts:{install:"prebuild-install --runtime napi || node-gyp rebuild","format-cxx":"clang-format -i 'src/**/*'","format-js":"ESLINT_USE_FLAT_CONFIG=false eslint lib test --fix","check:lint":"ESLINT_USE_FLAT_CONFIG=false eslint lib test",precommit:"check-clang-format",docs:"jsdoc2md --template etc/README.hbs --plugin dmd-clear --files lib/kerberos.js > README.md",test:"mocha test",prebuild:"prebuild --runtime napi --strip --verbose --all"},engines:{node:">=12.9.0"},binary:{napi_versions:[4]},license:"Apache-2.0",readmeFilename:"README.md"}});var $zi=I((wUh,Gzi)=>{"use strict";p();var FFc=require("dns"),UFc=J3r(),Z3r=class{static{a(this,"MongoAuthProcess")}constructor(e,r,n,o){o=o||{},this.host=e,this.port=r,this.serviceName=n||o.gssapiServiceName||"mongodb",this.canonicalizeHostName=typeof o.gssapiCanonicalizeHostName=="boolean"?o.gssapiCanonicalizeHostName:!1,this._transition=QFc(this),this.retries=10}init(e,r,n){let o=this;this.username=e,this.password=r;function s(c,l,u){if(!c)return u();FFc.resolveCname(l,(d,f)=>{if(d)return u(d);Array.isArray(f)&&f.length>0&&(o.host=f[0]),u()})}a(s,"performGssapiCanonicalizeHostName"),s(this.canonicalizeHostName,this.host,c=>{if(c)return n(c);let l={};r!=null&&Object.assign(l,{user:e,password:r});let u=process.platform==="win32"?`${this.serviceName}/${this.host}`:`${this.serviceName}@${this.host}`;UFc.initializeClient(u,l,(d,f)=>{if(d)return n(d,null);o.client=f,n(null,f)})})}transition(e,r){if(this._transition==null)return r(new Error("Transition finished"));this._transition(e,r)}};function QFc(t){return(e,r)=>{t.client.step("",(n,o)=>{if(n)return r(n);t._transition=qFc(t),r(null,o)})}}a(QFc,"firstTransition");function qFc(t){return(e,r)=>{t.client.step(e,(n,o)=>{if(n&&t.retries===0)return r(n);if(n)return t.retries=t.retries-1,t.transition(e,r);t._transition=jFc(t),r(null,o||"")})}}a(qFc,"secondTransition");function jFc(t){return(e,r)=>{t.client.unwrap(e,(n,o)=>{if(n)return r(n,!1);t.client.wrap(o,{user:t.username},(s,c)=>{if(s)return r(s,!1);t._transition=HFc(t),r(null,c)})})}}a(jFc,"thirdTransition");function HFc(t){return(e,r)=>{t._transition=null,r(null,!0)}}a(HFc,"fourthTransition");Gzi.exports={MongoAuthProcess:Z3r}});var Wzi=I((PUh,_Fe)=>{"use strict";p();var Vzi=J3r();_Fe.exports=Vzi;_Fe.exports.Kerberos=Vzi;_Fe.exports.version=Hzi().version;_Fe.exports.processes={MongoAuthProcess:$zi().MongoAuthProcess}});var _oo={};ki(_oo,{AbortError:()=>R1,DirectConnectError:()=>mk,DirectConnectTransport:()=>t6r,EXIT_REASONS:()=>C9c,HOOK_EVENTS:()=>ywt,InMemorySessionStore:()=>r8r,SYSTEM_PROMPT_DYNAMIC_BOUNDARY:()=>b9c,createSdkMcpServer:()=>tZc,deleteSession:()=>trl,filterEscalatingDefaultMode:()=>Qtl,foldSessionSummary:()=>pZi,forkSession:()=>rrl,getSessionInfo:()=>Ztl,getSessionMessages:()=>Ktl,getSubagentMessages:()=>srl,importSessionToStore:()=>nrl,listSessions:()=>Jtl,listSubagents:()=>orl,parseDirectConnectUrl:()=>iZc,query:()=>ztl,renameSession:()=>Xtl,resolveSettings:()=>jtl,startup:()=>Ytl,tagSession:()=>erl,tool:()=>eZc});function q8c(t){return this[t]}function $8c(t,e){this[t]=G8c.bind(null,e)}function t8r(t=_9c){let e=new AbortController;return(0,cZi.setMaxListeners)(t,e.signal),e}function lZi(t,e,r){return new Promise((n,o)=>{if(e?.aborted){r?.throwOnAbort||r?.abortError?o(r.abortError?.()??Error("aborted")):n();return}let s=setTimeout((l,u,d)=>{l?.removeEventListener("abort",u),d()},t,e,c,n);function c(){clearTimeout(s),r?.throwOnAbort||r?.abortError?o(r.abortError?.()??Error("aborted")):n()}a(c,"G"),e?.addEventListener("abort",c,{once:!0}),r?.unref&&s.unref()})}function v9c(t,e){t(Error(e))}function Vie(t,e,r){let n,o=new Promise((s,c)=>{n=setTimeout(v9c,e,c,r),typeof n=="object"&&n.unref?.()});return Promise.race([t,o]).finally(()=>{n!==void 0&&clearTimeout(n)})}function T6r(t,e){if(t.type!=="user"||t.isMeta===!0||t.isCompactSummary===!0)return;let r=t.message;if(!r)return;let n=r.content,o=[];if(typeof n=="string")o.push(n);else if(Array.isArray(n)){for(let s of n)if(!(!s||typeof s!="object")){if(s.type==="tool_result")return;s.type==="text"&&typeof s.text=="string"&&o.push(s.text)}}for(let s of o){let c=s.replaceAll(` -`," ").trim();if(!c)continue;let l=T9c.exec(c);if(l){e.commandFallback||(e.commandFallback=l[1]);continue}let u=/([\s\S]*?)<\/bash-input>/.exec(c);if(u)return`! ${u[1].trim()}`;if(!S9c.test(c))return c.length>200&&(c=c.slice(0,200).trim()+"\u2026"),c}}function pZi(t,e,r,n){let o=n?.mtime??t?.mtime??0,s=t!==void 0?{sessionId:t.sessionId,mtime:o,data:{...t.data}}:{sessionId:e.sessionId,mtime:o,data:{}},c=s.data;for(let l of r){let u=R9c(l.timestamp);if(c.isSidechain===void 0&&(c.isSidechain=l.isSidechain===!0),c.createdAt===void 0&&u!==void 0&&(c.createdAt=u),c.cwd===void 0){let d=l.cwd;typeof d=="string"&&d&&(c.cwd=d)}k9c(c,l);for(let[d,f]of Object.entries(I9c)){let h=l[d];typeof h=="string"&&(c[f]=h)}if(l.type==="tag"){let d=l.tag;typeof d=="string"&&d?c.tag=d:delete c.tag}}return s}function x9c(t,e){let r=t.data;if(r.isSidechain===!0)return null;let n=YV(r.firstPromptLocked===!0?r.firstPrompt:r.commandFallback)||void 0,o=YV(r.customTitle)||YV(r.aiTitle)||void 0,s=o||YV(r.lastPrompt)||YV(r.summaryHint)||n;return s?{sessionId:t.sessionId,summary:s,lastModified:t.mtime,fileSize:void 0,customTitle:o,firstPrompt:n,gitBranch:YV(r.gitBranch)||void 0,cwd:YV(r.cwd)||e||void 0,tag:YV(r.tag)||void 0,createdAt:w9c(r.createdAt)}:null}function YV(t){return typeof t=="string"?t:void 0}function w9c(t){return typeof t=="number"?t:void 0}function R9c(t){if(typeof t!="string")return;let e=Date.parse(t);return Number.isNaN(e)?void 0:e}function k9c(t,e){if(t.firstPromptLocked)return;let r={commandFallback:t.commandFallback??""},n=T6r(e,r);r.commandFallback&&!t.commandFallback&&(t.commandFallback=r.commandFallback),n!==void 0&&(t.firstPrompt=n,t.firstPromptLocked=!0)}function hZi(){return process.versions.bun!==void 0}function s_(t){if(!t)return!1;if(typeof t=="boolean")return t;let e=String(t).toLowerCase().trim();return["1","true","yes","on"].includes(e)}function D8e(){let t=new Set;return{subscribe(e){return t.add(e),()=>{t.delete(e)}},emit(...e){let r;for(let n of t)try{n(...e)}catch(o){(r??=[]).push(o)}if(r)throw r.length===1?r[0]:AggregateError(r,"Signal listener(s) threw")},clear(){t.clear()}}}function B9c(t){var e=O9c.call(t,bFe),r=t[bFe];try{t[bFe]=void 0;var n=!0}catch{}var o=L9c.call(t);return n&&(e?t[bFe]=r:delete t[bFe]),o}function q9c(t){return Q9c.call(t)}function $9c(t){return t==null?t===void 0?G9c:H9c:MYi&&MYi in Object(t)?F9c(t):j9c(t)}function V9c(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function J9c(t){if(!z9(t))return!1;var e=N8e(t);return e==z9c||e==Y9c||e==W9c||e==K9c}function X9c(t){return!!OYi&&OYi in t}function nUc(t){if(t!=null){try{return rUc.call(t)}catch{}try{return t+""}catch{}}return""}function fUc(t){if(!z9(t)||eUc(t))return!1;var e=I6r(t)?dUc:sUc;return e.test(iUc(t))}function hUc(t,e){return t?.[e]}function gUc(t,e){var r=mUc(t,e);return pUc(r)?r:void 0}function yUc(){this.__data__=n8e?n8e(null):{},this.size=0}function _Uc(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function TUc(t){var e=this.__data__;if(n8e){var r=e[t];return r===CUc?void 0:r}return SUc.call(e,t)?e[t]:void 0}function RUc(t){var e=this.__data__;return n8e?e[t]!==void 0:wUc.call(e,t)}function DUc(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n8e&&e===void 0?PUc:e,this}function Ove(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1}function VUc(t,e){var r=this.__data__,n=_wt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Lve(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let o=n[1]||0,s=n[2]||0,c=n[3]||0;return{browser:e,version:`${o}.${s}.${c}`}}}return null}function y7c(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function CZi(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function bZi(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return CZi({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function P6r(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function E7c(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}function v7c(t){return Object.entries(t).filter(([e,r])=>typeof r<"u").map(([e,r])=>{if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")return`${encodeURIComponent(e)}=${encodeURIComponent(r)}`;if(r===null)return`${encodeURIComponent(e)}=`;throw new Ri(`Cannot stringify type ${typeof r}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}function TZi(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new nu(`Invalid token endpoint base URL "${t}": ${n}`)}if(e.protocol==="https:")return;let r=e.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(e.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1")))throw new nu(`Refusing to send credential over non-https token endpoint "${t}"`)}async function IZi(t,e){let r=await w7c(t),n;try{n=JSON.parse(r)}catch{throw new nu(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,gk(r),e)}if(!n.access_token)throw new nu(`Token endpoint response missing access_token: ${JSON.stringify(gk(n))}`,t.status,gk(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new nu(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,gk(n),e);return n}function gk(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=bFr?t:t.slice(0,bFr)+`... <${t.length-bFr} more chars>`}return JSON.stringify(gk(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))x7c.has(r)&&(e[r]=n);return e}return null}async function xZi(t,e=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),n=t,o;try{n=await r.promises.realpath(t),o=await r.promises.stat(n)}catch{return}let s=o.mode&511;if(s&18)throw new nu(`Credentials file at ${n} is group/world-writable (mode 0o${s.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(s&36)throw new nu(`Credentials file at ${n} is group/world-readable (mode 0o${s.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);typeof process.getuid=="function"&&o.uid!==process.getuid()&&e(`credentials file at ${n} is owned by uid ${o.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function wZi(t,e){let r=await import("node:fs"),n=(await import("node:path")).dirname(t);await r.promises.mkdir(n,{recursive:!0,mode:448});let o=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await r.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(e,null,2)),await s.sync()}finally{await s.close()}await r.promises.rename(o,t)}catch(s){throw await r.promises.unlink(o).catch(()=>{}),s}try{let s=await r.promises.open(n,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function w7c(t){if(!t.body)return"";let e=t.body.getReader(),r=[],n=0;for(;;){let{done:s,value:c}=await e.read();if(s)break;if(n+c.length>jYi){let l=jYi-n;l>0&&r.push(c.subarray(0,l)),await e.cancel();break}r.push(c),n+=c.length}let o;if(r.length===1)o=r[0];else{o=new Uint8Array(r.reduce((c,l)=>c+l.length,0));let s=0;for(let c of r)o.set(c,s),s+=c.length}return new TextDecoder("utf-8").decode(o)}function Wie(){return Math.floor(Date.now()/1e3)}function R7c(t){let e=0;for(let o of t)e+=o.length;let r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function N6r(t){let e;return(HYi??(e=new globalThis.TextEncoder,HYi=e.encode.bind(e)))(t)}function $Yi(t){let e;return(GYi??(e=new globalThis.TextDecoder,GYi=e.decode.bind(e)))(t)}function GFe(){}function _It(t,e,r){return!e||rxt[t]>rxt[r]?GFe:e[t].bind(e)}function oA(t){let e=t.logger,r=t.logLevel??"off";if(!e)return k7c;let n=WYi.get(e);if(n&&n[0]===r)return n[1];let o={error:_It("error",e,r),warn:_It("warn",e,r),info:_It("info",e,r),debug:_It("debug",e,r)};return WYi.set(e,[r,o]),o}function kZi(t){if(!t)throw Error("profile name is empty");if(t==="."||t==="..")throw Error(`profile name "${t}" is not allowed`);if(t.includes("/")||t.includes("\\"))throw Error(`profile name "${t}" must not contain path separators`);if(!P7c.test(t))throw Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}function zYi(t){if(!t)throw new Ri("Identity token file path is empty");return async()=>{let e=await import("node:fs"),r;try{r=await e.promises.readFile(t,"utf-8")}catch(o){throw new Ri(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new Ri(`Identity token file at ${t} is empty`);return n}}function O7c(t){if(!t)throw new Ri("Identity token value is empty");return()=>t}function L7c(t){return async()=>{TZi(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16384)throw new nu(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:C7c,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(r.service_account_id=t.serviceAccountId),t.workspaceId&&(r.workspace_id=t.workspaceId);let n=`${t.baseURL}${SZi}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${txt},${S7c}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${nW} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new nu(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=gk(u),f="";throw o.status===401&&(f=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new nu(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await IZi(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new nu(`Token endpoint response missing required fields: ${JSON.stringify(gk(c))}`,o.status,gk(c),s);return{token:c.access_token,expiresAt:Wie()+l}}}function B7c(t){return async e=>{let r=await import("node:fs");await xZi(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new nu(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new nu(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new nu(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||Wie()"");throw new nu(`User OAuth refresh failed (HTTP ${f.status}): ${gk(E)}`,f.status,gk(E),h)}let m=await IZi(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new nu(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(gk(m))}`,f.status,gk(m),h);let A=Wie()+g,y=m.refresh_token||l;return await wZi(t.credentialsPath,{...o,version:RZi,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}function DZi(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=U7c(t,r,n,e),s={};return t.workspace_id&&t.authentication.type==="user_oauth"&&(s["anthropic-workspace-id"]=t.workspace_id),{provider:o,extraHeaders:s,baseURL:t.base_url||void 0}}async function F7c(t,e){let r=await D7c(e);if(!r)return null;let{config:n,fromFile:o}=r,s=n.authentication.credentials_path||!o?n:{...n,authentication:{...n.authentication,credentials_path:await N7c(n,e)??void 0}};return DZi(s,t)}function U7c(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=Q7c(o);if(!s)throw new nu("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!o.federation_rule_id)throw new nu("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!t.organization_id)throw new nu("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=L7c({identityTokenProvider:s,federationRuleId:o.federation_rule_id,organizationId:t.organization_id,serviceAccountId:o.service_account_id,workspaceId:t.workspace_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent});return e?q7c(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new nu("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return B7c({credentialsPath:e,clientId:t.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let o=t.authentication.type;throw new nu(`authentication.type "${o}" is not a known authentication type`)}}}function Q7c(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new nu(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new nu('identity_token.source "file" requires a non-empty path');return zYi(t.identity_token.path)}let e=tu("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return zYi(e);let r=tu("ANTHROPIC_IDENTITY_TOKEN");return r?O7c(r):null}function q7c(t,e,r,n){return async o=>{let s=await import("node:fs");await xZi(e,n);let c;try{let u=await s.promises.readFile(e,"utf-8");c=JSON.parse(u);let d=c?.access_token;if(d&&!o?.forceRefresh){let f=c?.expires_at;if(f==null||Wie()0&&(yield e)}function V7c(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}async function NZi(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return oA(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):Xie.fromSSEResponse(r,e.controller);if(r.status===204)return null;if(e.options.__binaryResponse)return r;let l=r.headers.get("content-type")?.split(";")[0]?.trim();if(l?.includes("application/json")||l?.endsWith("+json")){if(r.headers.get("content-length")==="0")return;let u=await r.json();return MZi(u,r)}return await r.text()})();return oA(t).debug(`[${n}] response parsed`,Gie({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function MZi(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("request-id"),enumerable:!1})}function sve(t,e,r){return OZi(),new File(t,e??"unknown_file",r)}function QIt(t,e){let r=typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"";return e?r.split(/[\\/]/).pop()||void 0:r}function W7c(t){let e=typeof t=="function"?t:t.fetch,r=YYi.get(e);if(r)return r;let n=(async()=>{try{let o="Response"in e?e.Response:(await e("data:,")).constructor,s=new FormData;return s.toString()!==await new o(s).text()}catch{return!0}})();return YYi.set(e,n),n}async function Z7c(t,e,r){if(OZi(),t=await t,e||(e=QIt(t,!0)),K7c(t))return t instanceof File&&e==null&&r==null?t:sve([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(J7c(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),sve(await u8r(o),e,r)}let n=await u8r(t);if(!r?.type){let o=n.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof o=="string"&&(r={...r,type:o})}return sve(n,e,r)}async function u8r(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(BZi(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(LZi(t))for await(let r of t)e.push(...await u8r(r));else{let r=t?.constructor?.name;throw Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${X7c(t)}`)}return e}function X7c(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(e=>`"${e}"`).join(", ")}]`}function*eQc(t){if(!t)return;if(FZi in t){let{values:n,nulls:o}=t;yield*n.entries();for(let s of o)yield[s,null];return}let e=!1,r;t instanceof Headers?r=t.entries():BYi(t)?r=t:(e=!0,r=Object.entries(t??{}));for(let n of r){let o=n[0];if(typeof o!="string")throw TypeError("expected header name to be a string");let s=BYi(n[1])?n[1]:[n[1]],c=!1;for(let l of s)l!==void 0&&(e&&!c&&(c=!0,yield[o,null]),yield[o,l])}}function UZi(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}function qIt(t){return typeof t=="object"&&t!==null&&XFe in t}function QZi(t,e){let r=new Set;if(t)for(let n of t)qIt(n)&&r.add(n[XFe]);if(e){for(let n of e)if(qIt(n)&&r.add(n[XFe]),Array.isArray(n.content))for(let o of n.content)qIt(o)&&r.add(o[XFe])}return Array.from(r)}function qZi(t,e){let r=QZi(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function rQc(t){return qIt(t)?{"x-stainless-helper":t[XFe]}:{}}function HZi(t){return t?.output_format??t?.output_config?.format}function JYi(t,e,r){let n=HZi(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>{if(o.type==="text"){let s=Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return o}),parsed_output:null}:GZi(t,e,r)}function GZi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=nQc(e,s.text);n===null&&(n=c);let l=Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1});return Object.defineProperty(l,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),c},enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function nQc(t,e){let r=HZi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ri(`Failed to parse structured output: ${n}`)}}function tKi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}function nKi(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}}async function lQc(t,e=t.messages.at(-1),r){if(!e||e.role!=="assistant"||!e.content||typeof e.content=="string")return null;let n=e.content.filter(o=>o.type==="tool_use");return n.length===0?null:{role:"user",content:await Promise.all(n.map(async o=>{let s=t.tools.find(c=>("name"in c?c.name:c.mcp_server_name)===o.name);if(!s||!("run"in s))return{type:"tool_result",tool_use_id:o.id,content:`Error: Tool '${o.name}' not found`,is_error:!0};try{let c=o.input;"parse"in s&&s.parse&&(c=s.parse(c));let l=await s.run(c,{toolUseBlock:o,signal:r?.signal});return{type:"tool_result",tool_use_id:o.id,content:l}}catch(c){return{type:"tool_result",tool_use_id:o.id,content:c instanceof hxt?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function oKi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new Ri("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:e,...r}=t;return{...r,output_config:{...t.output_config,format:e}}}function VZi(t){return t?.output_config?.format}function sKi(t,e,r){let n=VZi(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>o.type==="text"?Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1}):o),parsed_output:null}:WZi(t,e,r)}function WZi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=dQc(e,s.text);return n===null&&(n=c),Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function dQc(t,e){let r=VZi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ri(`Failed to parse structured output: ${n}`)}}function uKi(t){return t.type==="tool_use"||t.type==="server_tool_use"}function M8e(t){return t instanceof Error?t:Error(String(t))}function HIt(t){return t instanceof Error?t.message:String(t)}function PI(t){if(t&&typeof t=="object"&&"code"in t&&typeof t.code=="string")return t.code}function O8e(t){return PI(t)==="ENOENT"}function YZi(t){return PI(t)==="EISDIR"}function mQc(t){let e=PI(t);return e==="ENOENT"||e==="EACCES"||e==="EPERM"||e==="ENOTDIR"||e==="ELOOP"||e==="EROFS"}async function yQc(t,e,r){let n=`${t}.tmp.${(0,ZZi.randomBytes)(4).toString("hex")}`;try{await(0,jL.writeFile)(n,e,{encoding:"utf8",mode:r});try{await(0,jL.rename)(n,t)}catch(o){let s=PI(o);if(s!==void 0&&gQc.has(s)){try{await(0,jL.copyFile)(n,t)}catch(c){throw AQc.has(PI(c)??"")&&await(0,jL.unlink)(t).catch(()=>{}),c}await(0,jL.unlink)(n).catch(()=>{})}else throw o}}catch(o){throw await(0,jL.unlink)(n).catch(()=>{}),o}}function bxt(){return EQc.getStore()??new g8r}function XZi(){if(K_e)return K_e;if(!s_(process.env.DEBUG_CLAUDE_AGENT_SDK))return zie=null,K_e=Promise.resolve(),K_e;let t=(0,m8r.join)(Fve(),"debug");return zie=(0,m8r.join)(t,`sdk-${(0,KZi.randomUUID)()}.txt`),process.stderr.write(`SDK debug logs: ${zie} -`),K_e=bxt().mkdir(t).catch(()=>{}),K_e}function _Qc(){return XZi(),zie??null}function pk(t){if(zie===null)return;let e=`${new Date().toISOString()} ${t} -`;XZi().then(()=>{zie&&bxt().append(zie,e).catch(()=>{})})}function vQc(){this.__data__=new vwt,this.size=0}function bQc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function TQc(t){return this.__data__.get(t)}function xQc(t){return this.__data__.has(t)}function kQc(t,e){var r=this.__data__;if(r instanceof vwt){var n=r.__data__;if(!AZi||n.length-1&&t%1==0&&t-1&&t%1==0&&t<=nqc}function Rqc(t){return Qve(t)&&U6r(t.length)&&!!Cd[N8e(t)]}function Pqc(t){return function(e){return t(e)}}function Fqc(t,e){var r=lW(t),n=!r&&l8e(t),o=!r&&!n&&F6r(t),s=!r&&!n&&!o&&iXi(t),c=r||n||o||s,l=c?qQc(t.length,String):[],u=l.length;for(var d in t)(e||Bqc.call(t,d))&&!(c&&(d=="length"||o&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||bwt(d,u)))&&l.push(d);return l}function qqc(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Qqc;return t===r}function jqc(t,e){return function(r){return t(e(r))}}function Gqc(t){return t!=null&&U6r(t.length)&&!I6r(t)}function $qc(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function Yqc(t){if(!z9(t))return Vqc(t);var e=oXi(t),r=[];for(var n in t)n=="constructor"&&(e||!zqc.call(t,n))||r.push(n);return r}function Jqc(t){return Q6r(t)?Uqc(t,!0):Kqc(t)}function Xqc(t,e){if(e)return t.slice();var r=t.length,n=yKi?yKi(r):new t.constructor(r);return t.copy(n),n}function ejc(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r{let y=u;u=null,y&&f(y.join(""))})}return a(g,"N"),{write(A){if(o){f(A);return}s.push(A),c+=A.length,m(),(s.length>=r||c>=n)&&g()},flush:h,dispose(){h()}}}function dHc(t){return typeof t=="function"?t:Symbol.asyncDispose in t?()=>t[Symbol.asyncDispose]():()=>t[Symbol.dispose]()}function pHc(t){return fHc.register(t)}function mHc(t){let e=[],r=t.match(/^MCP server ["']([^"']+)["']/);if(r&&r[1])e.push("mcp"),e.push(r[1].toLowerCase());else{let s=t.match(/^([^:[]+):/);s&&s[1]&&e.push(s[1].trim().toLowerCase())}let n=t.match(/^\[([^\]]+)]/);n&&n[1]&&e.push(n[1].trim().toLowerCase()),t.toLowerCase().includes("1p event:")&&e.push("1p");let o=t.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(o&&o[1]){let s=o[1].trim().toLowerCase();s.length<30&&!s.includes(" ")&&e.push(s)}return Array.from(new Set(e))}function gHc(t,e){return e?t.length===0?!1:e.isExclusive?!t.some(r=>e.exclude.includes(r)):t.some(r=>e.include.includes(r)):!0}function AHc(t,e){if(!e)return!0;let r=mHc(t);return gHc(r,e)}function yHc(t){return/^[\\/]{2}/.test(t)}function EHc(t){return t.startsWith("\\\\?\\UNC\\")?"\\\\"+t.slice(8):t.startsWith("\\\\?\\")&&t.length>=7&&t[5]===":"?t.slice(4):t}function bKi(t){try{return EHc(hXi.realpathSync.native(t))}catch{return null}}function _Hc(t,e){let r=(0,HL.resolve)(e).toLowerCase(),n=(0,HL.resolve)(t).toLowerCase();if((0,HL.dirname)(n)===r||n.startsWith(r+HL.sep))return!0;let o=bKi(e)?.toLowerCase();if(o==null)return!1;let s=bKi((0,HL.dirname)((0,HL.resolve)(t)))?.toLowerCase();return s==null?!0:s===o||s.startsWith(o+HL.sep)}function mXi(t,e){if(yHc(e))return{resolvedPath:e,isSymlink:!1,isCanonical:!1};try{let r=t.lstatSync(e);if(r.isFIFO()||r.isSocket()||r.isCharacterDevice()||r.isBlockDevice())return{resolvedPath:e,isSymlink:!1,isCanonical:!1};let n=t.realpathSync(e);return{resolvedPath:n,isSymlink:n!==e,isCanonical:!0}}catch{return{resolvedPath:e,isSymlink:!1,isCanonical:!1}}}function DI(){return CHc}function bHc(t,e){t.destroyed||t.write(e)}function SHc(t){bHc(process.stderr,t)}function THc(t){return t.charAt(0).toUpperCase()+t.slice(1)}function IHc(t,e,r=e+"s"){return t===1?e:r}function xHc(t,e){let r=t.indexOf(e);return r===-1?t:t.slice(0,r)}function PHc(t){return kHc.map(e=>({id:e.id,confidence:e.confidence,re:new RegExp(e.source,t?(e.flags??"").replace("g","")+"g":e.flags??"")}))}function DHc(t){IKi??=PHc(!0);for(let e of IKi)t=t.replace(e.re,(r,n)=>{if(typeof n!="string")return"[REDACTED]";let o=n.length>=2&&(n[0]==='"'||n[0]==="'")&&n.at(-1)===n[0]?n[0]:"",s=r.lastIndexOf(n);return`${r.slice(0,s)}${o}[REDACTED]${o}${r.slice(s+n.length)}`});return t}function Twt(){return typeof process<"u"&&Array.isArray(process.argv)?process.argv:[]}function LHc(t){if(!v8r()||typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let e=OHc();return AHc(t,e)}async function yXi(t,e,r=FHc){if(UFe<0?UFe=await(0,l_.stat)(t).then(n=>n.size).catch(()=>0):UFe+=e,!(UFe<=r||OFr)){OFr=!0;try{let n=t.endsWith(".txt")?`${t.slice(0,-4)}.1.txt`:`${t}.1`;try{await(0,l_.rename)(t,n)}catch(o){O8e(o)||(await(0,l_.unlink)(n).catch(()=>{}),await(0,l_.rename)(t,n).catch(()=>(0,l_.unlink)(t).catch(()=>{})))}UFe=0}finally{OFr=!1}}}function EXi(t){return C8r=(0,soe.join)(t,`${pXi()}.txt`),C8r}async function UHc(t,e,r,n){t&&await(0,l_.mkdir)(e,{recursive:!0}).catch(()=>{});let o=r;try{await(0,l_.appendFile)(r,n)}catch(s){if(!YZi(s))throw s;o=EXi(r),await(0,l_.appendFile)(o,n)}await yXi(o,Buffer.byteLength(n)).catch(b8r),vXi()}function b8r(){}function QHc(){if(!OIt){let t=null;OIt=uHc({writeFn:a(e=>{let r=_Xi(),n=(0,soe.dirname)(r),o=t!==n;if(t=n,v8r()){if(o)try{DI().mkdirSync(n)}catch{}let s=r;try{DI().appendFileSync(r,e)}catch(c){if(!YZi(c))throw c;s=EXi(r),DI().appendFileSync(s,e)}yXi(s,Buffer.byteLength(e)).catch(b8r),vXi();return}MFr=MFr.then(UHc.bind(null,o,n,r,e)).catch(b8r)},"writeFn"),flushIntervalMs:1e3,maxBufferSize:100,immediateMode:v8r()}),pHc(async()=>{OIt?.dispose(),await MFr})}return OIt}function ru(t,{level:e}={level:"debug"}){if(_8r[e]<_8r[NHc()]||!LHc(t))return;BHc&&t.includes(` -`)&&(t=Qm(t));let r=`${new Date().toISOString()} [${e.toUpperCase()}] ${DHc(t.trim())} -`;if(gXi()){SHc(r);return}QHc().write(r)}function _Xi(){return AXi()??C8r??process.env.CLAUDE_CODE_DEBUG_LOGS_DIR??(0,soe.join)(Fve(),"debug",`${pXi()}.txt`)}function jHc(){return qHc}function Qm(t,e,r){let n=[];try{let c=ef(n,rf`JSON.stringify(${t})`,0);return JSON.stringify(t,e,r)}catch(c){var o=c,s=1}finally{tf(n,o,s)}}function HHc(t){return JSON.parse(t)}function uW(t,e){let r=[];try{let s=ef(r,rf`structuredClone(${t})`,0);return structuredClone(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}}function GHc(t){let e=t.trim();return e.startsWith("{")&&e.endsWith("}")}function $Hc(t,e){let r={...t};if(e){let n=e.enabled===!0&&e.failIfUnavailable===void 0?{...e,failIfUnavailable:!0}:e,o=r.settings;if(o&&!GHc(o))throw Error("Cannot use both a settings file path and the sandbox option. Include the sandbox configuration in your settings file instead.");let s={sandbox:n};if(o)try{s={...GN(o),sandbox:n}}catch{}r.settings=Qm(s)}return r}function WHc(){for(let t of xxt)if(!t.killed)if(process.platform==="win32")try{t.stdin.end()}catch{}else t.kill("SIGTERM")}function zHc(t){xxt.add(t),!xKi&&(xKi=!0,process.on("exit",WHc))}function YHc(t){return![".js",".mjs",".tsx",".ts",".jsx"].some(e=>t.endsWith(e))}function KHc(t,e){return(0,dZi.existsSync)(t)?e?`Claude Code native binary at ${t} exists but failed to launch.`:`Claude Code executable at ${t} exists but failed to launch.`:e?`Claude Code native binary not found at ${t}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${t}. Is options.pathToClaudeCodeExecutable set?`}function JHc(){if(process.platform!=="linux")return!1;let t=typeof process.report?.getReport=="function"?process.report.getReport():null;return t!=null&&t.header?.glibcVersionRuntime===void 0}function ZHc(t,e=process.platform,r=process.arch,n=CXi.existsSync,o=JHc()){let s=e==="win32"?".exe":"",c=(e==="android"?[`${J_e}-linux-${r}-android`]:e==="linux"?o?[`${J_e}-linux-${r}-musl`,`${J_e}-linux-${r}`]:[`${J_e}-linux-${r}`,`${J_e}-linux-${r}-musl`]:[`${J_e}-${e}-${r}`]).map(l=>`${l}/claude${s}`);for(let l of c)try{let u=t(l);if(n(u))return u}catch{}return null}function XHc(){return{eventQueue:[],sink:null}}function V6r(t,e){let r=eGc;if(r.sink===null){r.eventQueue.push({eventName:t,metadata:e,async:!1});return}r.sink.logEvent(t,e)}function bXi(t){V6r("tengu_feature_ok",{feature_name:t})}function SXi(t,e,r){V6r("tengu_feature_bad",{feature_name:t,error_code:e,...r})}function tGc(t,e,r){V6r("tengu_feature_sad",{feature_name:t,error_code:e,...r})}async function q9(t,e,r){try{let n=await e();return bXi(t),n}catch(n){throw SXi(t,r?.(n)??"error"),n}}function nGc(t){let e=t,r="",n=0,o=10;for(;e!==r&&n=o)throw Error(`Unicode sanitization reached maximum iterations (${o}) for input: ${t.slice(0,100)}`);return e}function t8e(t){if(typeof t=="string")return nGc(t);if(Array.isArray(t))return t.map(t8e);if(t!==null&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[t8e(r)]=t8e(n);return e}return t}function iGc(){return process.platform==="win32"}function sGc(t){let e=LFr.get(t);if(e!==void 0)return e;let r=process.env.SYSTEMROOT||"C:\\Windows",n=(0,kXi.join)(r,"System32","where.exe");try{let o=(0,RXi.execFileSync)(n,[t],{stdio:"pipe",encoding:"utf8",timeout:oGc,windowsHide:!0,env:process.env}).trim().split(/\r?\n/).filter(Boolean),s=process.cwd();for(let c of o)if(!_Hc(c,s))return LFr.set(t,c),c;return null}catch(o){return aGc(o)&&LFr.set(t,null),null}}function aGc(t){if(t===null||typeof t!="object")return!1;let e="status"in t?t.status:void 0,r="signal"in t?t.signal:void 0,n="code"in t?t.code:void 0;return e===1&&!r&&!n}function cGc(t){return!iGc()||t.includes("/")||t.includes("\\")?t:sGc(t)}async function L8e(t){let e=cGc("git");if(e===null)return[];try{let{stdout:r}=await lGc(e,["worktree","list","--porcelain"],{cwd:t,timeout:5e3});return r?r.split(` -`).filter(n=>n.startsWith("worktree ")).map(n=>n.slice(9).normalize("NFC")):[]}catch{return[]}}function uGc(t){let e=0;for(let r=0;ro&&(n=PXi(t.slice(u,d)),o=l);break}d++}c=d+1}}return n}async function R8r(t,e){let r=(0,IXi.createWriteStream)(t,{mode:384});try{for(let n of e)r.write(JSON.stringify(n)+` -`)||await(0,w8r.once)(r,"drain");r.end(),await(0,w8r.once)(r,"finish")}catch(n){throw r.destroy(),n}}function DXi(t){let e=0,r={commandFallback:""};for(;e=0?t.slice(e,n):t.slice(e);if(e=n>=0?n+1:t.length,!(!o.includes('"type":"user"')&&!o.includes('"type": "user"'))&&!o.includes('"tool_result"')&&!(o.includes('"isMeta":true')||o.includes('"isMeta": true'))&&!(o.includes('"isCompactSummary":true')||o.includes('"isCompactSummary": true')))try{let s=JSON.parse(o),c=T6r(s,r);if(c!==void 0)return c}catch{continue}}return r.commandFallback}function fGc(t){let e={commandFallback:""};for(let r of t){if(typeof r!="object"||r===null)continue;let n=T6r(r,e);if(n!==void 0)return n}return e.commandFallback}async function NXi(t){try{let e=await(0,UN.open)(t,"r");try{let r=await e.stat(),n=Buffer.allocUnsafe($9),o=await e.read(n,0,$9,0);if(o.bytesRead===0)return null;let s=n.toString("utf8",0,o.bytesRead),c=Math.max(0,r.size-$9),l=s;if(c>0){let u=await e.read(n,0,$9,c);l=n.toString("utf8",0,u.bytesRead)}return{mtime:r.mtime.getTime(),size:r.size,head:s,tail:l}}finally{await e.close()}}catch{return null}}function pGc(t){return Math.abs(uGc(t)).toString(36)}function B8e(t){let e=t.replace(/[^a-zA-Z0-9]/g,"-");return e.length<=u8e?e:`${e.slice(0,u8e)}-${pGc(t)}`}function hW(){return(0,mve.join)(Fve(),"projects")}function hGc(t){return(0,mve.join)(hW(),B8e(t))}async function F8e(t){try{return(await(0,UN.realpath)(t)).normalize("NFC")}catch{return t.normalize("NFC")}}async function BN(t){let e=hGc(t),r=[];try{await(0,UN.readdir)(e),r.push(e)}catch{}let n=B8e(t);if(n.length<=u8e)return r;let o=n.slice(0,u8e)+"-",s=hW();try{for(let c of await(0,UN.readdir)(s,{withFileTypes:!0})){if(!c.isDirectory()||!c.name.startsWith(o))continue;let l=(0,mve.join)(s,c.name);l!==e&&r.push(l)}}catch{}return r}async function Iwt(t,e){let r=`${t}.jsonl`;async function n(c,l){let u=(0,mve.join)(c,r);try{let d=await(0,UN.stat)(u);if(d.size>0)return{filePath:u,projectPath:l,fileSize:d.size}}catch{}}if(a(n,"Y"),e){let c=await F8e(e);for(let u of await BN(c)){let d=await n(u,c);if(d)return d}let l;try{l=await L8e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await BN(u)){let f=await n(d,u);if(f)return f}return}let o=hW(),s;try{s=await(0,UN.readdir)(o)}catch{return}for(let c of s){let l=await n((0,mve.join)(o,c),void 0);if(l)return l}}function yGc(){return AGc??=Buffer.from('"compact_boundary"')}function MXi(t){try{let e=JSON.parse(t);return e.type!=="system"||e.subtype!=="compact_boundary"?null:{hasPreservedSegment:!!(e.compactMetadata?.preservedSegment||e.compactMetadata?.preservedMessages)}}catch{return null}}function Yie(t,e,r,n){let o=n-r;if(!(o<=0)){if(t.len+o>t.buf.length){let s=Buffer.allocUnsafe(Math.min(Math.max(t.buf.length*2,t.len+o),t.cap));t.buf.copy(s,0,0,t.len),t.buf=s}e.copy(t.buf,t.len,r,n),t.len+=o}}function Rxt(t,e,r,n){return n-r>=e.length&&t.compare(e,0,e.length,r,r+e.length)===0}function CGc(t,e,r){if(t.straddleSnapCarryLen=0,t.straddleSnapTailEnd=0,t.carryLen===0)return 0;let n=t.carryBuf,o=e.indexOf(d8e);if(o===-1||o>=r)return 0;let s=o+1;if(Rxt(n,kxt,0,t.carryLen))t.straddleSnapCarryLen=t.carryLen,t.straddleSnapTailEnd=s,t.lastSnapSrc=null;else{if(t.carryLen=s&&nt.lastSnapBuf.length)&&(t.lastSnapBuf=Buffer.allocUnsafe(t.lastSnapLen)),e.copy(t.lastSnapBuf,0,n,o),t.lastSnapSrc=t.lastSnapBuf):t.straddleSnapCarryLen>0&&(t.lastSnapLen=t.straddleSnapCarryLen+t.straddleSnapTailEnd,(t.lastSnapBuf===void 0||t.lastSnapLen>t.lastSnapBuf.length)&&(t.lastSnapBuf=Buffer.allocUnsafe(t.lastSnapLen)),t.carryBuf.copy(t.lastSnapBuf,0,0,t.straddleSnapCarryLen),r.copy(t.lastSnapBuf,t.straddleSnapCarryLen,0,t.straddleSnapTailEnd),t.lastSnapSrc=t.lastSnapBuf)}function TGc(t,e,r){t.carryLen=e.length-r,t.carryLen>0&&((t.carryBuf===void 0||t.carryLen>t.carryBuf.length)&&(t.carryBuf=Buffer.allocUnsafe(t.carryLen)),e.copy(t.carryBuf,0,r,e.length))}function IGc(t){if(t.carryLen>0){let e=t.carryBuf;Rxt(e,kxt,0,t.carryLen)?(t.lastSnapSrc=e,t.lastSnapLen=t.carryLen):Yie(t.out,e,0,t.carryLen)}t.lastSnapSrc&&(t.out.len>0&&t.out.buf[t.out.len-1]!==d8e&&Yie(t.out,_Gc,0,1),Yie(t.out,t.lastSnapSrc,0,t.lastSnapLen))}async function xGc(t,e){let r=yGc(),n=mGc,o={out:{buf:Buffer.allocUnsafe(Math.min(e,8388608)),len:0,cap:e+1},boundaryStartOffset:0,hasPreservedSegment:!1,lastSnapSrc:null,lastSnapLen:0,lastSnapBuf:void 0,bufFileOff:0,carryLen:0,carryBuf:void 0,straddleSnapCarryLen:0,straddleSnapTailEnd:0},s=Buffer.allocUnsafe(n),c=await(0,UN.open)(t,"r");try{let l=0;for(;l0){let m=o.carryLen+(u-d);f=Buffer.allocUnsafe(m),o.carryBuf.copy(f,0,0,o.carryLen),s.copy(f,o.carryLen,d,u)}else f=s.subarray(d,u);let h=bGc(o,f,r);SGc(o,f,s,h.lastSnapStart,h.lastSnapEnd),TGc(o,f,h.trailStart),o.bufFileOff+=h.trailStart}IGc(o)}finally{await c.close()}return{boundaryStartOffset:o.boundaryStartOffset,postBoundaryBuf:o.out.buf.subarray(0,o.out.len),hasPreservedSegment:o.hasPreservedSegment}}async function wGc(t,e){try{return e>gGc&&!s_(process.env.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP)?(await xGc(t,e)).postBoundaryBuf:await(0,TXi.readFile)(t)}catch{return null}}function RGc(t){let e=[];try{let o=ef(e,rf`parseTranscriptEntries(${t.length} bytes)`,0),s=[],c=10,l=t.length,u=0;for(;u=d)continue;let h=t.toString("utf-8",f,d);try{let m=HHc(h),g=m.type;(g==="user"||g==="assistant"||g==="progress"||g==="system"||g==="attachment")&&typeof m.uuid=="string"&&s.push(m)}catch{}}return s}catch(o){var r=o,n=1}finally{tf(e,r,n)}}function kGc(t){let e=new Map;for(let m of t)e.set(m.uuid,m);for(let m of e.values()){if(m.type!=="system"||m.subtype!=="compact_boundary")continue;let g=m.compactMetadata?.preservedMessages,A=m.compactMetadata?.preservedSegment;if(g){if(g.uuids.length===0||g.uuids.some(v=>!e.has(v)))continue;let y=g.anchorUuid;for(let v of g.uuids){let b=e.get(v);e.set(v,{...b,parentUuid:y}),y=v}let E=g.uuids[0],_=g.uuids.at(-1);for(let[v,b]of e)b.parentUuid===g.anchorUuid&&v!==E&&e.set(v,{...b,parentUuid:_})}else if(A){let y=e.get(A.headUuid);y&&e.set(A.headUuid,{...y,parentUuid:A.anchorUuid});for(let[E,_]of e)_.parentUuid===A.anchorUuid&&E!==A.headUuid&&e.set(E,{..._,parentUuid:A.tailUuid})}}let r=new Map;for(let m=0;m!n.has(m.uuid)),s=[];for(let m of o){let g=m,A=new Set;for(;g&&!A.has(g.uuid);){if(A.add(g.uuid),g.type==="user"||g.type==="assistant"){s.push(g);break}g=g.parentUuid?e.get(g.parentUuid):void 0}}if(s.length===0)return[];let c=s.filter(m=>!m.isSidechain&&!m.teamName&&!m.isMeta),l=a(m=>m.reduce((g,A)=>(r.get(A.uuid)??-1)>(r.get(g.uuid)??-1)?A:g),"U"),u=c.length>0?l(c):l(s),d=[],f=new Set,h=e.get(u.uuid);for(;h&&!f.has(h.uuid);)f.add(h.uuid),d.push(h),h=h.parentUuid?e.get(h.parentUuid):void 0;return d.reverse(),DGc(e,d,f)}function FFr(t){if(t.type!=="assistant")return;let e=t.message;if(typeof e!="object"||e===null)return;let r=e.id;return typeof r=="string"?r:void 0}function PGc(t){if(t.type!=="user"||!t.parentUuid)return!1;let e=t.message;if(typeof e!="object"||e===null)return!1;let r=e.content;return Array.isArray(r)?r.some(n=>typeof n=="object"&&n!==null&&n.type==="tool_result"):!1}function DGc(t,e,r){let n=e.filter(h=>h.type==="assistant");if(n.length===0)return e;let o=new Map;for(let h of n){let m=FFr(h);m&&o.set(m,h)}let s=new Map,c=new Map;for(let h of t.values()){let m=FFr(h);if(m){let g=s.get(m);g?g.push(h):s.set(m,[h])}else if(PGc(h)){let g=h.parentUuid,A=c.get(g);A?A.push(h):c.set(g,[h])}}let l=new Set,u=new Map,d=0;for(let h of n){let m=FFr(h);if(!m||l.has(m))continue;l.add(m);let g=s.get(m)??[h],A=g.filter(b=>!r.has(b.uuid)),y=[];for(let b of g){let T=c.get(b.uuid);if(T)for(let w of T)r.has(w.uuid)||y.push(w)}if(A.length===0&&y.length===0)continue;let E=a((b,T)=>(b.timestamp??"").localeCompare(T.timestamp??""),"D");A.sort(E),y.sort(E);let _=o.get(m),v=[...A,...y];for(let b of v)r.add(b.uuid);d+=v.length,u.set(_.uuid,v)}if(d===0)return e;let f=[];for(let h of e){f.push(h);let m=u.get(h.uuid);m&&f.push(...m)}return f}function NGc(t,e){if(!(t.type==="user"||t.type==="assistant")){if(!(t.type==="system"&&e))return!1}return!(t.isMeta||t.isSidechain||t.teamName)}function OXi(t,e){return{type:t.type,uuid:t.uuid,session_id:t.sessionId,message:t.message,parent_tool_use_id:e??null,timestamp:t.timestamp}}function LXi(t,e){let r=e?.offset??0;return e?.limit!==void 0&&e.limit>0?t.slice(r,r+e.limit):r>0?t.slice(r):t}function MGc(t,e){let r=[];for(let n of t){if(typeof n!="object"||n===null)continue;let o=n,s=o.type;(s==="user"||s==="assistant"||s==="progress"||s==="system"||s==="attachment")&&typeof o.uuid=="string"&&r.push(o)}return BXi(r,e)}function BXi(t,e){let r=kGc(t),n=e?.includeSystemMessages??!1,o=r.filter(s=>NGc(s,n)).map(s=>OXi(s));return LXi(o,e)}async function OGc(t,e){if(!bh(t))return[];let r=await Iwt(t,e?.dir);if(!r)return[];let n=await wGc(r.filePath,r.fileSize);return n?BXi(RGc(n),e):[]}function xwt(t,e,r){let{head:n,tail:o,mtime:s,size:c}=e,l=n.indexOf(` -`),u=l>=0?n.slice(0,l):n;if(u.includes('"isSidechain":true')||u.includes('"isSidechain": true'))return null;let d=hk(o,"customTitle")||hk(n,"customTitle")||hk(o,"aiTitle")||hk(n,"aiTitle")||void 0,f=DXi(n)||void 0,h=BFr(n,"timestamp"),m;if(h){let v=Date.parse(h);Number.isNaN(v)||(m=v)}let g=d||hk(o,"lastPrompt")||hk(o,"summary")||f;if(!g)return null;let A=hk(o,"gitBranch")||BFr(n,"gitBranch")||void 0,y=BFr(n,"cwd")||r||void 0,E=o.split(` -`).findLast(v=>v.includes('"type":"tag"')&&v.includes('"tag":"')),_=E&&hk(E,"tag")||void 0;return{sessionId:t,summary:g,lastModified:s,fileSize:c,customTitle:d,firstPrompt:f,gitBranch:A,cwd:y,tag:_,createdAt:m}}async function YFe(t,e,r){let n;try{n=await(0,qve.readdir)(t)}catch{return[]}return(await Promise.all(n.map(async o=>{if(!o.endsWith(".jsonl"))return null;let s=bh(o.slice(0,-6));if(!s)return null;let c=(0,jve.join)(t,o);if(!e)return{sessionId:s,filePath:c,mtime:0,projectPath:r};try{let l=await(0,qve.stat)(c);return{sessionId:s,filePath:c,mtime:l.mtime.getTime(),projectPath:r}}catch{return null}}))).filter(o=>o!==null)}async function FXi(t){let e=await NXi(t.filePath);if(!e)return null;let r=xwt(t.sessionId,e,t.projectPath);return r?(t.mtime&&(r.lastModified=t.mtime),r):null}function BGc(t,e){return e.mtime!==t.mtime?e.mtime-t.mtime:e.sessionIdt.sessionId?1:0}async function FGc(t,e,r){t.sort(BGc);let n=[],o=e&&e>0?e:1/0,s=0,c=new Set;for(let l=0;ls.lastModified)&&r.set(o.sessionId,o)}let n=[...r.values()];return n.sort((o,s)=>s.lastModified!==o.lastModified?s.lastModified-o.lastModified:s.sessionIdo.sessionId?1:0),n}async function QGc(t,e,r){let n=await F8e(t),o;if(e)try{o=await L8e(n)}catch{o=[]}else o=[];if(o.length<=1){let h=[];for(let m of await BN(n))h.push(...await YFe(m,r,n));return h}let s=hW(),c=process.platform==="win32",l=o.map(h=>{let m=B8e(h);return{path:h,prefix:c?m.toLowerCase():m}});l.sort((h,m)=>m.prefix.length-h.prefix.length);let u;try{u=await(0,qve.readdir)(s,{withFileTypes:!0})}catch{let h=[];for(let m of await BN(n))h.push(...await YFe(m,r,n));return h}let d=[],f=new Set;for(let h of await BN(n)){let m=(0,jve.basename)(h);f.add(c?m.toLowerCase():m),d.push(...await YFe(h,r,n))}for(let h of u){if(!h.isDirectory())continue;let m=c?h.name.toLowerCase():h.name;if(!f.has(m)){for(let{path:g,prefix:A}of l)if(m===A||A.length>=u8e&&m.startsWith(A+"-")){f.add(m),d.push(...await YFe((0,jve.join)(s,h.name),r,g));break}}}return d}async function qGc(t){let e=hW(),r;try{r=await(0,qve.readdir)(e,{withFileTypes:!0})}catch{return[]}return(await Promise.all(r.filter(n=>n.isDirectory()).map(n=>YFe((0,jve.join)(e,n.name),t)))).flat()}async function jGc(t){let{dir:e,limit:r,offset:n,includeWorktrees:o}=t??{},s=n??0,c=r!==void 0&&r>0||s>0,l=e?await QGc(e,o??!0,c):await qGc(c);return c?FGc(l,r,s):UGc(l)}async function HGc(t,e={}){let r=bh(t);if(!r)return;let n=await Iwt(r,e.dir);if(!n)return;let o=await NXi(n.filePath);if(o)return xwt(r,o,n.projectPath)??void 0}async function GGc(t,e,r={}){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);if(!e.trim())throw Error("title must be non-empty");let n=Qm({type:"custom-title",customTitle:e.trim(),sessionId:t})+` -`;await UXi(t,n,r)}async function $Gc(t,e,r={}){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);if(e!==null){let o=t8e(e).trim();if(!o)throw Error("tag must be non-empty (use null to clear)");e=o}let n=Qm({type:"tag",tag:e??"",sessionId:t})+` -`;await UXi(t,n,r)}async function VGc(t,e={}){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);for(let r of await WGc(e)){let n=(0,Kie.join)(r,`${t}.jsonl`),o;try{({size:o}=await(0,GL.stat)(n))}catch(s){let c=PI(s);if(c==="ENOENT"||c==="ENOTDIR")continue;throw s}if(o!==0){await(0,GL.rm)(n,{force:!0}),await(0,GL.rm)((0,Kie.join)(r,t),{recursive:!0,force:!0});return}}throw Error(e.dir?`Session ${t} not found in project directory for ${e.dir}`:`Session ${t} not found in any project directory`)}async function WGc(t){if(t.dir){let r=await F8e(t.dir),n=await BN(r),o;try{o=await L8e(r)}catch{o=[]}for(let s of o)s!==r&&n.push(...await BN(s));return n}let e=hW();try{return(await(0,GL.readdir)(e,{withFileTypes:!0})).filter(r=>r.isDirectory()||r.isSymbolicLink()).map(r=>(0,Kie.join)(e,r.name))}catch{return[]}}async function UXi(t,e,r){let n=`${t}.jsonl`;if(r.dir){let c=await F8e(r.dir);for(let u of await BN(c))if(await UFr((0,Kie.join)(u,n),e))return;let l;try{l=await L8e(c)}catch{l=[]}for(let u of l)if(u!==c){for(let d of await BN(u))if(await UFr((0,Kie.join)(d,n),e))return}throw Error(`Session ${t} not found in project directory for ${r.dir}`)}let o=hW(),s;try{s=await(0,GL.readdir)(o)}catch{throw Error(`Session ${t} not found (no projects directory)`)}for(let c of s)if(await UFr((0,Kie.join)(o,c,n),e))return;throw Error(`Session ${t} not found in any project directory`)}async function UFr(t,e){let r;try{r=await(0,GL.open)(t,k8r.constants.O_WRONLY|k8r.constants.O_APPEND)}catch(n){let o=PI(n);if(o==="ENOENT"||o==="ENOTDIR")return!1;throw n}try{let{size:n}=await r.stat();if(n===0)return!1;let o=process.platform==="win32"?n:void 0;return await r.write(e,o,"utf8"),!0}finally{await r.close()}}async function zGc(t,e){let r=`${t}.jsonl`;async function n(c){try{let l=await bxt().readBytes((0,Pxt.join)(c,r));return l.length===0?null:{buf:l,projectDir:c}}catch{return null}}if(a(n,"Y"),e){let c=await F8e(e);for(let u of await BN(c)){let d=await n(u);if(d)return d}let l;try{l=await L8e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await BN(u)){let f=await n(d);if(f)return f}return null}let o=hW(),s;try{s=await bxt().list(o)}catch{return null}for(let c of s){let l=await n((0,Pxt.join)(o,c));if(l)return l}return null}function KGc(t,e){let r=[],n=[],o=10,s=t.length,c=0;for(;c=l)continue;let d=t.toString("utf-8",u,l);try{QXi(GN(d),e,r,n)}catch{}}return{transcript:r,contentReplacements:n}}function JGc(t,e){let r=[],n=[];for(let o of t)typeof o!="object"||o===null||QXi(o,e,r,n);return{transcript:r,contentReplacements:n}}function QXi(t,e,r,n){YGc.has(t.type)&&typeof t.uuid=="string"?r.push(t):t.type==="content-replacement"&&t.sessionId===e&&Array.isArray(t.replacements)&&n.push(...t.replacements)}async function ZGc(t,e={}){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);if(e.upToMessageId&&!bh(e.upToMessageId))throw Error(`Invalid upToMessageId: ${e.upToMessageId}`);let r=await zGc(t,e.dir);if(!r)throw Error(e.dir?`Session ${t} not found in project directory for ${e.dir}`:`Session ${t} not found`);let{entries:n,forkedSessionId:o}=XGc(r.buf,t,e);return await R8r((0,Pxt.join)(r.projectDir,`${o}.jsonl`),n),{sessionId:o}}function XGc(t,e,r){let n=KGc(t,e);return qXi(n,e,r,()=>{let o=t.length,s=t.toString("utf-8",0,Math.min(o,$9)),c=t.toString("utf-8",Math.max(0,o-$9));return hk(c,"customTitle")||hk(s,"customTitle")||hk(c,"aiTitle")||hk(s,"aiTitle")||DXi(s)})}function e$c(t,e,r){let n=JGc(t,e);return qXi(n,e,r,()=>t$c(t))}function t$c(t){let e,r;for(let n of t){if(typeof n!="object"||n===null)continue;let o=n;typeof o.customTitle=="string"&&o.customTitle&&(e=o.customTitle),typeof o.aiTitle=="string"&&o.aiTitle&&(r=o.aiTitle)}return e||r||fGc(t)||void 0}function qXi(t,e,r,n){let o=t.transcript.filter(m=>!m.isSidechain);if(o.length===0)throw Error(`Session ${e} has no messages to fork`);if(r.upToMessageId){let m=o.findIndex(g=>g.uuid===r.upToMessageId);if(m===-1)throw Error(`Message ${r.upToMessageId} not found in session ${e}`);o=o.slice(0,m+1)}let s=new Map;for(let m of o)s.set(m.uuid,(0,KFe.randomUUID)());let c=o.filter(m=>m.type!=="progress");if(c.length===0)throw Error(`Session ${e} has no messages to fork`);let l=new Map;for(let m of o)l.set(m.uuid,m);let u=(0,KFe.randomUUID)(),d=new Date().toISOString(),f=[];for(let m=0;m0&&f.push({type:"content-replacement",sessionId:u,replacements:t.contentReplacements,uuid:(0,KFe.randomUUID)(),timestamp:d});let h=r.title?.trim();return h||(h=`${n()||"Forked session"} (fork)`),f.push({type:"custom-title",sessionId:u,customTitle:h,uuid:(0,KFe.randomUUID)(),timestamp:d}),{entries:f,forkedSessionId:u}}async function jXi(t,e){let r=await Iwt(t,e);if(!r)return null;let n=r.filePath.replace(/\.jsonl$/,"");return(0,Dxt.join)(n,"subagents")}async function HXi(t){let e=[];async function r(n){let o;try{o=await(0,f8e.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o)if(s.isFile()&&s.name.startsWith("agent-")&&s.name.endsWith(".jsonl")){let c=s.name.slice(6,-6);e.push({agentId:c,filePath:(0,Dxt.join)(n,s.name)})}else s.isDirectory()&&await r((0,Dxt.join)(n,s.name))}return a(r,"J"),await r(t),e}function r$c(t){let e=[],r=10,n=t.length,o=0;for(;o=s)continue;let l=t.toString("utf-8",c,s);try{let u=GN(l),d=u.type;(d==="user"||d==="assistant")&&typeof u.uuid=="string"&&e.push(u)}catch{}}return e}function n$c(t){if(t.length===0)return[];let e=new Map;for(let c of t)e.set(c.uuid,c);let r=t.findLast(c=>c.type==="user"||c.type==="assistant");if(!r)return[];let n=[],o=new Set,s=r;for(;s&&!o.has(s.uuid);)o.add(s.uuid),n.push(s),s=s.parentUuid?e.get(s.parentUuid):void 0;return n.reverse(),n}async function i$c(t,e){if(!bh(t))return[];let r=await jXi(t,e?.dir);return r?(await HXi(r)).map(n=>n.agentId):[]}async function o$c(t,e,r){if(!bh(t))return[];if(!e)return[];let n=await jXi(t,r?.dir);if(!n)return[];let o=(await HXi(n)).find(l=>l.agentId===e);if(!o)return[];let s;try{s=await(0,f8e.readFile)(o.filePath)}catch{return[]}let c;try{let l=o.filePath.replace(/\.jsonl$/,".meta.json");c=GN(await(0,f8e.readFile)(l,"utf-8")).toolUseId}catch{}return GXi(s,r,c)}function GXi(t,e,r){if(t.length===0)return[];let n=r$c(t),o=n$c(n).filter(s=>s.type==="user"||s.type==="assistant").map(s=>OXi(s,r));return LXi(o,e)}function WXi(t,e){let r=0;for(let n of t)r+=+!!e(n);return r}function zXi(t){return[...new Set(t)]}function s$c(){return"prod"}function f$c(){let t=process.env.CLAUDE_LOCAL_OAUTH_API_BASE?.replace(/\/$/,"")??"http://localhost:8000",e=process.env.CLAUDE_LOCAL_OAUTH_APPS_BASE?.replace(/\/$/,"")??"http://localhost:4000",r=process.env.CLAUDE_LOCAL_OAUTH_CONSOLE_BASE?.replace(/\/$/,"")??"http://localhost:3000";return{BASE_API_URL:t,CONSOLE_AUTHORIZE_URL:`${r}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${e}/oauth/authorize`,CLAUDE_AI_ORIGIN:e,TOKEN_URL:`${t}/v1/oauth/token`,API_KEY_URL:`${t}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${t}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${r}/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code`,CLAUDEAI_SUCCESS_URL:`${r}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${r}/oauth/code/callback`,CLIENT_ID:"22422756-60c9-4084-8eb7-27705fd5cf9a",OAUTH_FILE_SUFFIX:"-local-oauth",MCP_PROXY_URL:"http://localhost:8205",MCP_PROXY_PATH:"/v1/toolbox/shttp/mcp/{server_id}"}}function h$c(){let t=(()=>{switch(s$c()){case"local":return f$c();case"staging":return d$c??RKi;case"prod":return RKi}})(),e=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(e){let n=e.replace(/\/$/,"");if(!p$c.includes(n))throw Error("CLAUDE_CODE_CUSTOM_OAUTH_URL is not an approved endpoint.");t={...t,BASE_API_URL:n,CONSOLE_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_ORIGIN:n,TOKEN_URL:`${n}/v1/oauth/token`,API_KEY_URL:`${n}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${n}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,CLAUDEAI_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${n}/oauth/code/callback`,OAUTH_FILE_SUFFIX:"-custom-oauth"}}let r=process.env.CLAUDE_CODE_OAUTH_CLIENT_ID;return r&&(t={...t,CLIENT_ID:r}),t}function g$c(t=""){let e=process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR,r=e!==void 0?!e:!process.env.CLAUDE_CONFIG_DIR,n=e!==void 0?e.normalize("NFC"):Fve(),o=r?"":`-${(0,$Xi.createHash)("sha256").update(n).digest("hex").substring(0,8)}`;return`Claude Code${h$c().OAUTH_FILE_SUFFIX}${t}${o}`}function y$c(){if(process.platform==="win32")return"claude-code-user";let t;try{t=process.env.USER||(0,VXi.userInfo)().username}catch{t="claude-code-user"}return A$c.test(t)?t:"claude-code-user"}function P8r(){return _$c}function ln(t,e){let r=P8r(),n=D8r({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===p8e?void 0:p8e].filter(o=>!!o)});t.common.issues.push(n)}function Zo(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:a((s,c)=>{let{message:l}=t;return s.code==="invalid_enum_value"?{message:l??c.defaultError}:typeof c.data>"u"?{message:l??n??c.defaultError}:s.code!=="invalid_type"?{message:c.defaultError}:{message:l??r??c.defaultError}},"errorMap"),description:o}}function JXi(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function B$c(t){return new RegExp(`^${JXi(t)}$`)}function F$c(t){let e=`${KXi}T${JXi(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function U$c(t,e){return!!((e==="v4"||!e)&&k$c.test(t)||(e==="v6"||!e)&&D$c.test(t))}function Q$c(t,e){if(!I$c.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function q$c(t,e){return!!((e==="v4"||!e)&&P$c.test(t)||(e==="v6"||!e)&&N$c.test(t))}function j$c(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return s%c/10**o}function tve(t){if(t instanceof NI){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Ek.create(tve(n))}return new NI({...t._def,shape:a(()=>e,"shape")})}else return t instanceof dW?new dW({...t._def,type:tve(t.element)}):t instanceof Ek?Ek.create(tve(t.unwrap())):t instanceof K9?K9.create(tve(t.unwrap())):t instanceof Y9?Y9.create(t.items.map(e=>tve(e))):t}function M8r(t,e){let r=tW(t),n=tW(e);if(t===e)return{valid:!0,data:t};if(r===kn.object&&n===kn.object){let o=hc.objectKeys(e),s=hc.objectKeys(t).filter(l=>o.indexOf(l)!==-1),c={...t,...e};for(let l of s){let u=M8r(t[l],e[l]);if(!u.valid)return{valid:!1};c[l]=u.data}return{valid:!0,data:c}}else if(r===kn.array&&n===kn.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;sr?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}function Xv(t){return t&&Object.assign(Lxt,t),Lxt}function G$c(t){return t}function $$c(t){return t}function V$c(t){}function W$c(t){throw Error()}function z$c(t){}function Y6r(t){let e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,n])=>e.indexOf(+r)===-1).map(([r,n])=>n)}function Vr(t,e="|"){return t.map(r=>us(r)).join(e)}function reo(t,e){return typeof e=="bigint"?e.toString():e}function wwt(t){return{get value(){{let e=t();return Object.defineProperty(this,"value",{value:e}),e}throw Error("cached value already set")}}}function aoe(t){return t==null}function Rwt(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function neo(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return s%c/10**o}function zc(t,e,r){Object.defineProperty(t,e,{get(){{let n=r();return t[e]=n,n}throw Error("cached value already set")},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function K6r(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Y$c(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function K$c(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;se,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:a(()=>e.error,"error")}:e}function eVc(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}function us(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function seo(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function tVc(t,e){let r={},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw Error(`Unrecognized key: "${o}"`);e[o]&&(r[o]=n.shape[o])}return $N(t,{...t._zod.def,shape:r,checks:[]})}function rVc(t,e){let r={...t._zod.def.shape},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw Error(`Unrecognized key: "${o}"`);e[o]&&delete r[o]}return $N(t,{...t._zod.def,shape:r,checks:[]})}function nVc(t,e){if(!T8e(e))throw Error("Invalid input to extend: expected a plain object");let r={...t._zod.def,get shape(){let n={...t._zod.def.shape,...e};return K6r(this,"shape",n),n},checks:[]};return $N(t,r)}function iVc(t,e){return $N(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return K6r(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function oVc(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=t?new t({type:"optional",innerType:n[s]}):n[s])}else for(let s in n)o[s]=t?new t({type:"optional",innerType:n[s]}):n[s];return $N(e,{...e._zod.def,shape:o,checks:[]})}function sVc(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return $N(e,{...e._zod.def,shape:o,checks:[]})}function ave(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function ZFe(t){return typeof t=="string"?t:t?.message}function qN(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=ZFe(t.inst?._zod.def?.error?.(t))??ZFe(e?.error?.(t))??ZFe(r.customError?.(t))??ZFe(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,!e?.reportInput&&delete n.input,n}function kwt(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Pwt(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function leo(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function aVc(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function X6r(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}function e9r(t,e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>o({issues:l}));else if(c.code==="invalid_key")o({issues:c.issues});else if(c.code==="invalid_element")o({issues:c.issues});else if(c.path.length===0)n._errors.push(r(c));else{let l=n,u=0;for(;u{var l,u;for(let d of s.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(f=>o({issues:f},d.path));else if(d.code==="invalid_key")o({issues:d.issues},d.path);else if(d.code==="invalid_element")o({issues:d.issues},d.path);else{let f=[...c,...d.path];if(f.length===0){n.errors.push(r(d));continue}let h=n,m=0;for(;mn.path.length-o.path.length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${feo(n.path)}`);return e.join(` -`)}function beo(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}function Neo(t){return typeof t.precision=="number"?t.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":t.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${t.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Meo(t){return new RegExp(`^${Neo(t)}$`)}function Oeo(t){let e=Neo({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Peo}T(?:${n})$`)}function MKi(t,e,r){t.issues.length&&e.issues.push(...Ak(r,t.issues))}function l9r(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function Pto(t){if(!s9r.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return l9r(r)}function Mto(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}function OKi(t,e,r){t.issues.length&&e.issues.push(...Ak(r,t.issues)),e.value[r]=t.value}function LIt(t,e,r){t.issues.length&&e.issues.push(...Ak(r,t.issues)),e.value[r]=t.value}function LKi(t,e,r,n){t.issues.length?n[r]===void 0?r in n?e.value[r]=void 0:e.value[r]=t.value:e.issues.push(...Ak(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function BKi(t,e,r,n){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>qN(s,n,Xv())))}),e}function F8r(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(T8e(t)&&T8e(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let c=F8r(t[s],e[s]);if(!c.valid)return{valid:!1,mergeErrorPath:[s,...c.mergeErrorPath]};o[s]=c.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;nqN(l,c,Xv()))})),e.issues.length&&(Bxt.has(typeof n)?r.issues.push(...Ak(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>qN(l,c,Xv()))})),r.value.set(t.value,e.value)}function QKi(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function qKi(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function jKi(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function HKi(t,e,r){return ave(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}function GKi(t){return t.value=Object.freeze(t.value),t}function $Ki(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(leo(o))}}function EVc(){return{localeError:yVc()}}function vVc(){return{localeError:_Vc()}}function VKi(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}function bVc(){return{localeError:CVc()}}function TVc(){return{localeError:SVc()}}function xVc(){return{localeError:IVc()}}function RVc(){return{localeError:wVc()}}function pro(){return{localeError:PVc()}}function MVc(){return{localeError:NVc()}}function LVc(){return{localeError:OVc()}}function FVc(){return{localeError:BVc()}}function QVc(){return{localeError:UVc()}}function jVc(){return{localeError:qVc()}}function GVc(){return{localeError:HVc()}}function VVc(){return{localeError:$Vc()}}function zVc(){return{localeError:WVc()}}function KVc(){return{localeError:YVc()}}function ZVc(){return{localeError:JVc()}}function eWc(){return{localeError:XVc()}}function rWc(){return{localeError:tWc()}}function iWc(){return{localeError:nWc()}}function sWc(){return{localeError:oWc()}}function cWc(){return{localeError:aWc()}}function uWc(){return{localeError:lWc()}}function fWc(){return{localeError:dWc()}}function hWc(){return{localeError:pWc()}}function gWc(){return{localeError:mWc()}}function yWc(){return{localeError:AWc()}}function _Wc(){return{localeError:EWc()}}function WKi(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}function CWc(){return{localeError:vWc()}}function SWc(){return{localeError:bWc()}}function IWc(){return{localeError:TWc()}}function wWc(){return{localeError:xWc()}}function kWc(){return{localeError:RWc()}}function NWc(){return{localeError:DWc()}}function OWc(){return{localeError:MWc()}}function BWc(){return{localeError:LWc()}}function UWc(){return{localeError:FWc()}}function qWc(){return{localeError:QWc()}}function HWc(){return{localeError:jWc()}}function E9r(){return new I8e}function gro(t,e){return new t({type:"string",...xr(e)})}function Aro(t,e){return new t({type:"string",coerce:!0,...xr(e)})}function _9r(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...xr(e)})}function jxt(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...xr(e)})}function v9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...xr(e)})}function C9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...xr(e)})}function b9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...xr(e)})}function S9r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...xr(e)})}function T9r(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...xr(e)})}function I9r(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...xr(e)})}function x9r(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...xr(e)})}function w9r(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...xr(e)})}function R9r(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...xr(e)})}function k9r(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...xr(e)})}function P9r(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...xr(e)})}function D9r(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...xr(e)})}function N9r(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...xr(e)})}function M9r(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...xr(e)})}function O9r(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...xr(e)})}function L9r(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...xr(e)})}function B9r(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...xr(e)})}function F9r(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...xr(e)})}function U9r(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...xr(e)})}function Q9r(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...xr(e)})}function Ero(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...xr(e)})}function _ro(t,e){return new t({type:"string",format:"date",check:"string_format",...xr(e)})}function vro(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...xr(e)})}function Cro(t,e){return new t({type:"string",format:"duration",check:"string_format",...xr(e)})}function bro(t,e){return new t({type:"number",checks:[],...xr(e)})}function Sro(t,e){return new t({type:"number",coerce:!0,checks:[],...xr(e)})}function Tro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...xr(e)})}function Iro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...xr(e)})}function xro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...xr(e)})}function wro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...xr(e)})}function Rro(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...xr(e)})}function kro(t,e){return new t({type:"boolean",...xr(e)})}function Pro(t,e){return new t({type:"boolean",coerce:!0,...xr(e)})}function Dro(t,e){return new t({type:"bigint",...xr(e)})}function Nro(t,e){return new t({type:"bigint",coerce:!0,...xr(e)})}function Mro(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...xr(e)})}function Oro(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...xr(e)})}function Lro(t,e){return new t({type:"symbol",...xr(e)})}function Bro(t,e){return new t({type:"undefined",...xr(e)})}function Fro(t,e){return new t({type:"null",...xr(e)})}function Uro(t){return new t({type:"any"})}function Hxt(t){return new t({type:"unknown"})}function Qro(t,e){return new t({type:"never",...xr(e)})}function qro(t,e){return new t({type:"void",...xr(e)})}function jro(t,e){return new t({type:"date",...xr(e)})}function Hro(t,e){return new t({type:"date",coerce:!0,...xr(e)})}function Gro(t,e){return new t({type:"nan",...xr(e)})}function noe(t,e){return new a9r({check:"less_than",...xr(e),value:t,inclusive:!1})}function FN(t,e){return new a9r({check:"less_than",...xr(e),value:t,inclusive:!0})}function ioe(t,e){return new c9r({check:"greater_than",...xr(e),value:t,inclusive:!1})}function RI(t,e){return new c9r({check:"greater_than",...xr(e),value:t,inclusive:!0})}function $ro(t){return ioe(0,t)}function Vro(t){return noe(0,t)}function Wro(t){return FN(0,t)}function zro(t){return RI(0,t)}function x8e(t,e){return new Veo({check:"multiple_of",...xr(e),value:t})}function Owt(t,e){return new Yeo({check:"max_size",...xr(e),maximum:t})}function w8e(t,e){return new Keo({check:"min_size",...xr(e),minimum:t})}function q9r(t,e){return new Jeo({check:"size_equals",...xr(e),size:t})}function Lwt(t,e){return new Zeo({check:"max_length",...xr(e),maximum:t})}function kve(t,e){return new Xeo({check:"min_length",...xr(e),minimum:t})}function Bwt(t,e){return new eto({check:"length_equals",...xr(e),length:t})}function j9r(t,e){return new tto({check:"string_format",format:"regex",...xr(e),pattern:t})}function H9r(t){return new rto({check:"string_format",format:"lowercase",...xr(t)})}function G9r(t){return new nto({check:"string_format",format:"uppercase",...xr(t)})}function $9r(t,e){return new ito({check:"string_format",format:"includes",...xr(e),includes:t})}function V9r(t,e){return new oto({check:"string_format",format:"starts_with",...xr(e),prefix:t})}function W9r(t,e){return new sto({check:"string_format",format:"ends_with",...xr(e),suffix:t})}function Yro(t,e,r){return new ato({check:"property",property:t,schema:e,...xr(r)})}function z9r(t,e){return new cto({check:"mime_type",mime:t,...xr(e)})}function loe(t){return new lto({check:"overwrite",tx:t})}function Y9r(t){return loe(e=>e.normalize(t))}function K9r(){return loe(t=>t.trim())}function J9r(){return loe(t=>t.toLowerCase())}function Z9r(){return loe(t=>t.toUpperCase())}function X9r(t,e,r){return new t({type:"array",element:e,...xr(r)})}function GWc(t,e,r){return new t({type:"union",options:e,...xr(r)})}function $Wc(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...xr(n)})}function VWc(t,e,r){return new t({type:"intersection",left:e,right:r})}function Kro(t,e,r,n){let o=r instanceof Co;return new t({type:"tuple",items:e,rest:o?r:null,...xr(o?n:r)})}function WWc(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...xr(n)})}function zWc(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...xr(n)})}function YWc(t,e,r){return new t({type:"set",valueType:e,...xr(r)})}function KWc(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...xr(r)})}function JWc(t,e,r){return new t({type:"enum",entries:e,...xr(r)})}function ZWc(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...xr(r)})}function Jro(t,e){return new t({type:"file",...xr(e)})}function XWc(t,e){return new t({type:"transform",transform:e})}function ezc(t,e){return new t({type:"optional",innerType:e})}function tzc(t,e){return new t({type:"nullable",innerType:e})}function rzc(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}function nzc(t,e,r){return new t({type:"nonoptional",innerType:e,...xr(r)})}function izc(t,e){return new t({type:"success",innerType:e})}function ozc(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function szc(t,e,r){return new t({type:"pipe",in:e,out:r})}function azc(t,e){return new t({type:"readonly",innerType:e})}function czc(t,e,r){return new t({type:"template_literal",parts:e,...xr(r)})}function lzc(t,e){return new t({type:"lazy",getter:e})}function uzc(t,e){return new t({type:"promise",innerType:e})}function Zro(t,e,r){let n=xr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function Xro(t,e,r){return new t({type:"custom",check:"custom",fn:e,...xr(r)})}function eno(t,e){let r=xr(e),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(m=>typeof m=="string"?m.toLowerCase():m),o=o.map(m=>typeof m=="string"?m.toLowerCase():m));let s=new Set(n),c=new Set(o),l=t.Pipe??A9r,u=t.Boolean??d9r,d=t.String??q8e,f=new(t.Transform??g9r)({type:"transform",transform:a((m,g)=>{let A=m;return r.case!=="sensitive"&&(A=A.toLowerCase()),s.has(A)?!0:c.has(A)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...c],input:g.value,inst:f}),{})},"transform"),error:r.error}),h=new l({type:"pipe",in:new d({type:"string",error:r.error}),out:f,error:r.error});return new l({type:"pipe",in:h,out:new u({type:"boolean",error:r.error}),error:r.error})}function tno(t,e,r,n={}){let o=xr(n),s={...xr(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:c=>r.test(c),...o};return r instanceof RegExp&&(s.pattern=r),new t(s)}function rno(t){return new Gxt({type:"function",input:Array.isArray(t?.input)?Kro(Mwt,t?.input):t?.input??X9r(p9r,Hxt(qxt)),output:t?.output??Hxt(qxt)})}function eUr(t,e){if(t instanceof I8e){let n=new R8e(e),o={};for(let l of t._idmap.entries()){let[u,d]=l;n.process(d)}let s={},c={registry:t,uri:e?.uri||(l=>l),defs:o};for(let l of t._idmap.entries()){let[u,d]=l;s[u]=n.emit(d,{...e,external:c})}if(Object.keys(o).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:o}}return{schemas:s}}let r=new R8e(e);return r.process(t),r.emit(t,e)}function q0(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;switch(n.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return q0(n.element,r);case"object":{for(let o in n.shape)if(q0(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(q0(o,r))return!0;return!1}case"intersection":return q0(n.left,r)||q0(n.right,r);case"tuple":{for(let o of n.items)if(q0(o,r))return!0;return!!(n.rest&&q0(n.rest,r))}case"record":return q0(n.keyType,r)||q0(n.valueType,r);case"map":return q0(n.keyType,r)||q0(n.valueType,r);case"set":return q0(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return q0(n.innerType,r);case"lazy":return q0(n.getter(),r);case"default":return q0(n.innerType,r);case"prefault":return q0(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return q0(n.in,r)||q0(n.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${n.type}`)}function zKi(t,e){let r={type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},...Ws.normalizeParams(e)};return new pzc(r)}function VL(t){return!!t._zod}function nve(t){let e=Object.values(t);if(e.length===0)return zKi({});let r=e.every(VL),n=e.every(o=>!VL(o));if(r)return zKi(t);if(n)return H$c(t);throw Error("Mixed Zod versions detected in object shape.")}function r8e(t,e){return VL(t)?Dwt(t,e):t.safeParse(e)}async function qFr(t,e){return VL(t)?await Nwt(t,e):await t.safeParseAsync(e)}function j8e(t){if(!t)return;let e;if(VL(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function QFe(t){if(t){if(typeof t=="object"){let e=t,r=t;if(!e._def&&!r._zod){let n=Object.values(t);if(n.length>0&&n.every(o=>typeof o=="object"&&o!==null&&(o._def!==void 0||o._zod!==void 0||typeof o.parse=="function")))return nve(t)}}if(VL(t)){let e=t._zod?.def;if(e&&(e.type==="object"||e.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function jFr(t){if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0){let e=t.issues[0];if(e&&typeof e=="object"&&"message"in e)return String(e.message)}try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function hzc(t){return t.description}function mzc(t){if(VL(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function nno(t){if(VL(t)){let n=t._zod?.def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}}let e=t._def;if(e){if(e.value!==void 0)return e.value;if(Array.isArray(e.values)&&e.values.length>0)return e.values[0]}let r=t.value;if(r!==void 0)return r}function ino(t){return Ero(rUr,t)}function ono(t){return _ro(nUr,t)}function sno(t){return vro(iUr,t)}function ano(t){return Cro(oUr,t)}function It(t){return gro(Fwt,t)}function Azc(t){return _9r(aUr,t)}function yzc(t){return jxt($xt,t)}function Ezc(t){return v9r(W9,t)}function _zc(t){return C9r(W9,t)}function vzc(t){return b9r(W9,t)}function Czc(t){return S9r(W9,t)}function bzc(t){return T9r(cUr,t)}function Szc(t){return I9r(lUr,t)}function Tzc(t){return x9r(uUr,t)}function Izc(t){return w9r(dUr,t)}function xzc(t){return R9r(fUr,t)}function wzc(t){return k9r(pUr,t)}function Rzc(t){return P9r(hUr,t)}function kzc(t){return D9r(mUr,t)}function Pzc(t){return N9r(gUr,t)}function Dzc(t){return M9r(AUr,t)}function Nzc(t){return O9r(yUr,t)}function Mzc(t){return L9r(EUr,t)}function Ozc(t){return B9r(_Ur,t)}function Lzc(t){return F9r(vUr,t)}function Bzc(t){return U9r(CUr,t)}function Fzc(t){return Q9r(bUr,t)}function Uzc(t,e,r={}){return tno(pno,t,e,r)}function Nc(t){return bro(Uwt,t)}function U8r(t){return Tro(Hve,t)}function Qzc(t){return Iro(Hve,t)}function qzc(t){return xro(Hve,t)}function jzc(t){return wro(Hve,t)}function Hzc(t){return Rro(Hve,t)}function j0(t){return kro(Qwt,t)}function Gzc(t){return Dro(qwt,t)}function $zc(t){return Mro(SUr,t)}function Vzc(t){return Oro(SUr,t)}function Wzc(t){return Lro(hno,t)}function zzc(t){return Bro(mno,t)}function TUr(t){return Fro(gno,t)}function Yzc(){return Uro(Ano)}function of(){return Hxt(yno)}function jwt(t){return Qro(Eno,t)}function Kzc(t){return qro(_no,t)}function Jzc(t){return jro(IUr,t)}function Ca(t,e){return X9r(vno,t,e)}function Zzc(t){let e=t._zod.def.shape;return ti(Object.keys(e))}function Tn(t,e){let r={type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},...Ws.normalizeParams(e)};return new Hwt(r)}function Xzc(t,e){return new Hwt({type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},catchall:jwt(),...Ws.normalizeParams(e)})}function Kv(t,e){return new Hwt({type:"object",get shape(){return Ws.assignProp(this,"shape",{...t}),this.shape},catchall:of(),...Ws.normalizeParams(e)})}function ou(t,e){return new xUr({type:"union",options:t,...Ws.normalizeParams(e)})}function wUr(t,e,r){return new Cno({type:"union",options:e,discriminator:t,...Ws.normalizeParams(r)})}function Gwt(t,e){return new bno({type:"intersection",left:t,right:e})}function eYc(t,e,r){let n=e instanceof Co,o=n?r:e;return new Sno({type:"tuple",items:t,rest:n?e:null,...Ws.normalizeParams(o)})}function iu(t,e,r){return new RUr({type:"record",keyType:t,valueType:e,...Ws.normalizeParams(r)})}function tYc(t,e,r){return new RUr({type:"record",keyType:ou([t,jwt()]),valueType:e,...Ws.normalizeParams(r)})}function rYc(t,e,r){return new Tno({type:"map",keyType:t,valueType:e,...Ws.normalizeParams(r)})}function nYc(t,e){return new Ino({type:"set",valueType:t,...Ws.normalizeParams(e)})}function N1(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new k8e({type:"enum",entries:r,...Ws.normalizeParams(e)})}function iYc(t,e){return new k8e({type:"enum",entries:t,...Ws.normalizeParams(e)})}function ti(t,e){return new xno({type:"literal",values:Array.isArray(t)?t:[t],...Ws.normalizeParams(e)})}function oYc(t){return Jro(wno,t)}function PUr(t){return new kUr({type:"transform",transform:t})}function bd(t){return new DUr({type:"optional",innerType:t})}function Vxt(t){return new Rno({type:"nullable",innerType:t})}function sYc(t){return bd(Vxt(t))}function Pno(t,e){return new kno({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function Nno(t,e){return new Dno({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function Mno(t,e){return new NUr({type:"nonoptional",innerType:t,...Ws.normalizeParams(e)})}function aYc(t){return new Ono({type:"success",innerType:t})}function Bno(t,e){return new Lno({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function cYc(t){return Gro(Fno,t)}function Wxt(t,e){return new MUr({type:"pipe",in:t,out:e})}function Qno(t){return new Uno({type:"readonly",innerType:t})}function lYc(t,e){return new qno({type:"template_literal",parts:t,...Ws.normalizeParams(e)})}function Hno(t){return new jno({type:"lazy",getter:t})}function uYc(t){return new Gno({type:"promise",innerType:t})}function $no(t,e){let r=new Sh({check:"custom",...Ws.normalizeParams(e)});return r._zod.check=t,r}function Vno(t,e){return Zro($wt,t??(()=>!0),e)}function Wno(t,e={}){return Xro($wt,t,e)}function zno(t,e){let r=$no(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Ws.issue(o,n.value,r._zod.def));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(Ws.issue(s))}},t(n.value,n)),e);return r}function dYc(t,e={error:`Input not instance of ${t.name}`}){let r=new $wt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...Ws.normalizeParams(e)});return r._zod.bag.Class=t,r}function pYc(t){let e=Hno(()=>ou([It(t),Nc(),j0(),TUr(),Ca(e),iu(It(),e)]));return e}function OUr(t,e){return Wxt(PUr(t),e)}function mYc(t){Xv({customError:t})}function gYc(){return Xv().customError}function AYc(t){return Aro(Fwt,t)}function yYc(t){return Sro(Uwt,t)}function EYc(t){return Pro(Qwt,t)}function _Yc(t){return Nro(qwt,t)}function vYc(t){return Hro(IUr,t)}function KKc(t){if(t.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function JKc(t){if(t.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}function Hie(t){return t==="completed"||t==="failed"||t==="cancelled"}function pio(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function Al(t,e,r,n,o){t[e]=r,pio(t,e,n,o)}function D1(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?hio(e,t.currentPath):e.join("/")}}function oJc(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==Cr.ZodAny&&(r.items=Dc(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&Al(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&Al(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(Al(r,"minItems",t.exactLength.value,t.exactLength.message,e),Al(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function sJc(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?Al(r,"minimum",n.value,n.message,e):Al(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Al(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Al(r,"maximum",n.value,n.message,e):Al(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Al(r,"maximum",n.value,n.message,e));break;case"multipleOf":Al(r,"multipleOf",n.value,n.message,e);break}return r}function aJc(){return{type:"boolean"}}function mio(t,e){return Dc(t.type._def,e)}function gio(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,s)=>gio(t,e,o))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return lJc(t,e)}}function uJc(t,e){return{...Dc(t.innerType._def,e),default:t.defaultValue()}}function dJc(t,e){return e.effectStrategy==="input"?Dc(t.schema._def,e):D1(e)}function fJc(t){return{type:"string",enum:Array.from(t.values)}}function hJc(t,e){let r=[Dc(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Dc(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(s=>{if(pJc(s))o.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let c=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:l,...u}=s;c=u}else n=void 0;o.push(c)}}),o.length?{allOf:o,...n}:void 0}function mJc(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}function Aio(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":Al(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":Al(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":LN(r,"email",n.message,e);break;case"format:idn-email":LN(r,"idn-email",n.message,e);break;case"pattern:zod":Yv(r,ON.email,n.message,e);break}break;case"url":LN(r,"uri",n.message,e);break;case"uuid":LN(r,"uuid",n.message,e);break;case"regex":Yv(r,n.regex,n.message,e);break;case"cuid":Yv(r,ON.cuid,n.message,e);break;case"cuid2":Yv(r,ON.cuid2,n.message,e);break;case"startsWith":Yv(r,RegExp(`^${GFr(n.value,e)}`),n.message,e);break;case"endsWith":Yv(r,RegExp(`${GFr(n.value,e)}$`),n.message,e);break;case"datetime":LN(r,"date-time",n.message,e);break;case"date":LN(r,"date",n.message,e);break;case"time":LN(r,"time",n.message,e);break;case"duration":LN(r,"duration",n.message,e);break;case"length":Al(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),Al(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{Yv(r,RegExp(GFr(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&LN(r,"ipv4",n.message,e),n.version!=="v4"&&LN(r,"ipv6",n.message,e);break}case"base64url":Yv(r,ON.base64url,n.message,e);break;case"jwt":Yv(r,ON.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&Yv(r,ON.ipv4Cidr,n.message,e),n.version!=="v4"&&Yv(r,ON.ipv6Cidr,n.message,e);break}case"emoji":Yv(r,ON.emoji(),n.message,e);break;case"ulid":{Yv(r,ON.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{LN(r,"binary",n.message,e);break}case"contentEncoding:base64":{Al(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{Yv(r,ON.base64,n.message,e);break}}break}case"nanoid":Yv(r,ON.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function GFr(t,e){return e.patternStrategy==="escape"?AJc(t):t}function AJc(t){let e="";for(let r=0;ro.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&n.errorMessages&&{errorMessage:{format:r}}})):Al(t,"format",e,r,n)}function Yv(t,e,r,n){t.pattern||t.allOf?.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:JKi(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):Al(t,"pattern",JKi(e,n),r,n)}function JKi(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=r.i?t.source.toLowerCase():t.source,o="",s=!1,c=!1,l=!1;for(let u=0;u{let r=0;for(let[n,o]of t)r+=Buffer.byteLength(kYi(e,n,o)),r+=MFr(o)?o.size:Buffer.byteLength(String(o)),r+=Buffer.byteLength(`\r +`);return r+=Buffer.byteLength(RYi(e)),r},"getFormDataLength"),NFr=class{static{a(this,"FormDataSerializer")}constructor(e){this.fd=e,this.boundary=GFc(8).toString("hex")}length(){return typeof this._length>"u"&&(this._length=zFc(this.fd,this.boundary)),this._length}contentType(){return`multipart/form-data; boundary=${this.boundary}`}stream(){return $Fc.from(WFc(this.fd,this.boundary))}};PYi.exports={isFormData:VFc,FormDataSerializer:NFr}});var NYi=I((I7h,DYi)=>{"use strict";p();var{AbortSignal:T7h}=DFr(),{Body:YFc,cloneStream:KFc,guessContentType:JFc}=iIt(),{Headers:ZFc}=Z_e(),{isPlainObject:XFc}=$9(),{isFormData:e8c,FormDataSerializer:t8c}=UFe(),r8c=20,eW=Symbol("Request internals"),lIt=class t extends YFc{static{a(this,"Request")}constructor(e,r={}){let n=e instanceof t?e:null,o=n?new URL(n.url):new URL(e),s=r.method||n&&n.method||"GET";if(s=s.toUpperCase(),(r.body!=null||n&&n.body!==null)&&["GET","HEAD"].includes(s))throw new TypeError("Request with GET/HEAD method cannot have body");let c=r.body||(n&&n.body?KFc(n):null),l=new ZFc(r.headers||n&&n.headers||{});if(e8c(c)&&!l.has("content-type")){let h=new t8c(c);c=h.stream(),l.set("content-type",h.contentType()),!l.has("transfer-encoding")&&!l.has("content-length")&&l.set("content-length",h.length())}if(!l.has("content-type"))if(XFc(c))c=JSON.stringify(c),l.set("content-type","application/json");else{let h=JFc(c);h&&l.set("content-type",h)}super(c);let u=n?n.signal:null;"signal"in r&&(u=r.signal);let d=r.redirect||n&&n.redirect||"follow";if(!["follow","error","manual"].includes(d))throw new TypeError(`'${d}' is not a valid redirect option`);let f=r.cache||n&&n.cache||"default";if(!["default","no-store","reload","no-cache","force-cache","only-if-cached"].includes(f))throw new TypeError(`'${f}' is not a valid cache option`);this[eW]={init:{...r},method:s,redirect:d,cache:f,headers:l,parsedURL:o,signal:u},r.follow===void 0?!n||n.follow===void 0?this.follow=r8c:this.follow=n.follow:this.follow=r.follow,this.counter=r.counter||n&&n.counter||0,r.compress===void 0?!n||n.compress===void 0?this.compress=!0:this.compress=n.compress:this.compress=r.compress,r.decode===void 0?!n||n.decode===void 0?this.decode=!0:this.decode=n.decode:this.decode=r.decode}get method(){return this[eW].method}get url(){return this[eW].parsedURL.toString()}get headers(){return this[eW].headers}get redirect(){return this[eW].redirect}get cache(){return this[eW].cache}get signal(){return this[eW].signal}clone(){return new t(this)}get init(){return this[eW].init}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(lIt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},cache:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}});DYi.exports={Request:lIt}});var OFr=I((R7h,MYi)=>{"use strict";p();var{Body:n8c,cloneStream:i8c,guessContentType:o8c}=iIt(),{Headers:s8c}=Z_e(),{isPlainObject:a8c}=$9(),{isFormData:c8c,FormDataSerializer:l8c}=UFe(),jN=Symbol("Response internals"),uIt=class t extends n8c{static{a(this,"Response")}constructor(e=null,r={}){let n=new s8c(r.headers),o=e;if(c8c(o)&&!n.has("content-type")){let s=new l8c(o);o=s.stream(),n.set("content-type",s.contentType()),!n.has("transfer-encoding")&&!n.has("content-length")&&n.set("content-length",s.length())}if(o!==null&&!n.has("content-type"))if(a8c(o))o=JSON.stringify(o),n.set("content-type","application/json");else{let s=o8c(o);s&&n.set("content-type",s)}super(o),this[jN]={url:r.url,status:r.status||200,statusText:r.statusText||"",headers:n,httpVersion:r.httpVersion,decoded:r.decoded,counter:r.counter}}get url(){return this[jN].url||""}get status(){return this[jN].status}get statusText(){return this[jN].statusText}get ok(){return this[jN].status>=200&&this[jN].status<300}get redirected(){return this[jN].counter>0}get headers(){return this[jN].headers}get httpVersion(){return this[jN].httpVersion}get decoded(){return this[jN].decoded}static redirect(e,r=302){if(![301,302,303,307,308].includes(r))throw new RangeError("Invalid status code");return new t(null,{headers:{location:new URL(e).toString()},status:r})}clone(){if(this.bodyUsed)throw new TypeError("Cannot clone: already read");return new t(i8c(this),{...this[jN]})}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(uIt.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});MYi.exports={Response:uIt}});var LYi=I((N7h,OYi)=>{"use strict";p();var u8c=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),d8c=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),f8c=new Set([500,502,503,504]),p8c={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},h8c={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function Hie(t){let e=parseInt(t,10);return isFinite(e)?e:0}a(Hie,"toNumberOrZero");function m8c(t){return t?f8c.has(t.status):!0}a(m8c,"isErrorResponse");function LFr(t){let e={};if(!t)return e;let r=t.trim().split(/,/);for(let n of r){let[o,s]=n.split(/=/,2);e[o.trim()]=s===void 0?!0:s.trim().replace(/^"|"$/g,"")}return e}a(LFr,"parseCacheControl");function g8c(t){let e=[];for(let r in t){let n=t[r];e.push(n===!0?r:r+"="+n)}if(e.length)return e.join(", ")}a(g8c,"formatCacheControl");OYi.exports=class{static{a(this,"CachePolicy")}constructor(e,r,{shared:n,cacheHeuristic:o,immutableMinTimeToLive:s,ignoreCargoCult:c,_fromObject:l}={}){if(l){this._fromObject(l);return}if(!r||!r.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=n!==!1,this._cacheHeuristic=o!==void 0?o:.1,this._immutableMinTtl=s!==void 0?s:24*3600*1e3,this._status="status"in r?r.status:200,this._resHeaders=r.headers,this._rescc=LFr(r.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=r.headers.vary?e.headers:null,this._reqcc=LFr(e.headers["cache-control"]),c&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":g8c(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),r.headers["cache-control"]==null&&/no-cache/.test(r.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&d8c.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||u8c.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);let r=LFr(e.headers["cache-control"]);return r["no-cache"]||/no-cache/.test(e.headers.pragma)||r["max-age"]&&this.age()>r["max-age"]||r["min-fresh"]&&this.timeToLive()<1e3*r["min-fresh"]||this.stale()&&!(r["max-stale"]&&!this._rescc["must-revalidate"]&&(r["max-stale"]===!0||r["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(e,!1)}_requestMatches(e,r){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||r&&e.method==="HEAD")&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let r=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let n of r)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){let r={};for(let n in e)p8c[n]||(r[n]=e[n]);if(e.connection){let n=e.connection.trim().split(/\s*,\s*/);for(let o of n)delete r[o]}if(r.warning){let n=r.warning.split(/,/).filter(o=>!/^\s*1[0-9][0-9]/.test(o));n.length?r.warning=n.join(",").trim():delete r.warning}return r}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),r=this.age();return r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(r)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),r=(this.now()-this._responseTime)/1e3;return e+r}_ageValue(){return Hie(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return Hie(this._rescc["s-maxage"])}if(this._rescc["max-age"])return Hie(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,r=this.date();if(this._resHeaders.expires){let n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||nn)return Math.max(e,(r-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),r=e+Hie(this._rescc["stale-if-error"]),n=e+Hie(this._rescc["stale-while-revalidate"]);return Math.max(0,e,r,n)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+Hie(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+Hie(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let r=this._copyWithoutHopByHopHeaders(e.headers);if(delete r["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete r["if-none-match"],delete r["if-modified-since"],r;if(this._resHeaders.etag&&(r["if-none-match"]=r["if-none-match"]?`${r["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),r["accept-ranges"]||r["if-match"]||r["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete r["if-modified-since"],r["if-none-match"]){let o=r["if-none-match"].split(/,/).filter(s=>!/^\s*W\//.test(s));o.length?r["if-none-match"]=o.join(",").trim():delete r["if-none-match"]}}else this._resHeaders["last-modified"]&&!r["if-modified-since"]&&(r["if-modified-since"]=this._resHeaders["last-modified"]);return r}revalidatedPolicy(e,r){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&m8c(r))return{modified:!1,matches:!1,policy:this};if(!r||!r.headers)throw Error("Response headers missing");let n=!1;if(r.status!==void 0&&r.status!=304?n=!1:r.headers.etag&&!/^\s*W\//.test(r.headers.etag)?n=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag:this._resHeaders.etag&&r.headers.etag?n=this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?n=this._resHeaders["last-modified"]===r.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!r.headers.etag&&!r.headers["last-modified"]&&(n=!0),!n)return{policy:new this.constructor(e,r),modified:r.status!=304,matches:!1};let o={};for(let c in this._resHeaders)o[c]=c in r.headers&&!h8c[c]?r.headers[c]:this._resHeaders[c];let s=Object.assign({},r,{status:this._status,method:this._method,headers:o});return{policy:new this.constructor(e,s,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}});var QYi=I((L7h,UYi)=>{"use strict";p();var A8c=LYi(),{Headers:y8c}=Z_e(),BYi=a(t=>({url:t.url,method:t.method,headers:t.headers.plain()}),"convertRequest"),FYi=a(t=>({status:t.status,headers:t.headers.plain()}),"convertResponse"),BFr=class{static{a(this,"CachePolicyWrapper")}constructor(e,r,n){this.policy=new A8c(BYi(e),FYi(r),n)}storable(){return this.policy.storable()}satisfiesWithoutRevalidation(e){return this.policy.satisfiesWithoutRevalidation(BYi(e))}responseHeaders(e){return new y8c(this.policy.responseHeaders(FYi(e)))}timeToLive(){return this.policy.timeToLive()}};UYi.exports=BFr});var HYi=I((U7h,jYi)=>{"use strict";p();var{Readable:E8c}=require("stream"),{Headers:qYi}=Z_e(),{Response:_8c}=OFr(),tW=Symbol("CacheableResponse internals"),v8c=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),FFr=class t extends _8c{static{a(this,"CacheableResponse")}constructor(e,r){super(e,r);let n=new qYi(r.headers);this[tW]={headers:n,bufferedBody:e}}get headers(){return this[tW].headers}set headers(e){if(e instanceof qYi)this[tW].headers=e;else throw new TypeError("instance of Headers expected")}get body(){return E8c.from(this[tW].bufferedBody)}get bodyUsed(){return!1}async buffer(){return this[tW].bufferedBody}async arrayBuffer(){return v8c(this[tW].bufferedBody)}async text(){return this[tW].bufferedBody.toString()}async json(){return JSON.parse(await this.text())}clone(){let{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l}=this;return new t(this[tW].bufferedBody,{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l})}get[Symbol.toStringTag](){return this.constructor.name}},C8c=a(async t=>{let e=await t.buffer(),{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u}=t;return new FFr(e,{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u})},"cacheableResponse");jYi.exports={cacheableResponse:C8c}});var dIt=I((j7h,GYi)=>{"use strict";p();var UFr=class extends Error{static{a(this,"RequestAbortedError")}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};GYi.exports={RequestAbortedError:UFr}});var YYi=I(($7h,zYi)=>{"use strict";p();var VYi=require("http"),WYi=require("https"),{Readable:b8c}=require("stream"),z9=wP()("helix-fetch:h1"),{RequestAbortedError:$Yi}=dIt(),{decodeStream:S8c}=$9(),T8c=a((t,e)=>{let{h1:r,options:{h1:n,rejectUnauthorized:o}}=t;return e==="https:"?r.httpsAgent?r.httpsAgent:n||typeof o=="boolean"?(r.httpsAgent=new WYi.Agent(typeof o=="boolean"?{...n||{},rejectUnauthorized:o}:n),r.httpsAgent):void 0:r.httpAgent?r.httpAgent:n?(r.httpAgent=new VYi.Agent(n),r.httpAgent):void 0},"getAgent"),I8c=a(t=>{t.h1={}},"setupContext"),x8c=a(async({h1:t})=>{t.httpAgent&&(z9("resetContext: destroying httpAgent"),t.httpAgent.destroy(),delete t.httpAgent),t.httpsAgent&&(z9("resetContext: destroying httpsAgent"),t.httpsAgent.destroy(),delete t.httpsAgent)},"resetContext"),w8c=a((t,e,r)=>{let{statusCode:n,statusMessage:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u}=t,d=e?S8c(n,u,t,r):t;return{statusCode:n,statusText:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u,readable:d,decoded:!!(e&&d!==t)}},"createResponse"),R8c=a(async(t,e,r)=>{let{request:n}=e.protocol==="https:"?WYi:VYi,o=T8c(t,e.protocol),s={...r,agent:o},{socket:c,body:l}=s;return c&&(delete s.socket,c.assigned||(c.assigned=!0,o?s.agent=new Proxy(o,{get:a((u,d)=>d==="createConnection"&&!c.inUse?(f,h)=>{z9(`agent reusing socket #${c.id} (${c.servername})`),c.inUse=!0,h(null,c)}:u[d],"get")}):s.createConnection=(u,d)=>{z9(`reusing socket #${c.id} (${c.servername})`),c.inUse=!0,d(null,c)})),new Promise((u,d)=>{z9(`${s.method} ${e.href}`);let f,{signal:h}=s,m=a(()=>{h.removeEventListener("abort",m),c&&!c.inUse&&(z9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),d(new $Yi),f&&f.abort()},"onAbortSignal");if(h){if(h.aborted){d(new $Yi);return}h.addEventListener("abort",m)}f=n(e,s),f.once("response",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(z9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),u(w8c(g,s.decode,d))}),f.once("error",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(z9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),f.aborted||(z9(`${s.method} ${e.href} failed with: ${g.message}`),f.abort(),d(g))}),l instanceof b8c?l.pipe(f):(l&&f.write(l),f.end())})},"h1Request");zYi.exports={request:R8c,setupContext:I8c,resetContext:x8c}});var XYi=I((z7h,ZYi)=>{"use strict";p();var{connect:k8c,constants:P8c}=require("http2"),{Readable:D8c}=require("stream"),Id=wP()("helix-fetch:h2"),{RequestAbortedError:KYi}=dIt(),{decodeStream:N8c}=$9(),{NGHTTP2_CANCEL:QFe}=P8c,M8c=300*1e3,O8c=5e3,L8c=a(t=>{t.h2={sessionCache:{}}},"setupContext"),B8c=a(async({h2:t})=>Promise.all(Object.values(t.sessionCache).map(e=>new Promise(r=>{e.on("close",r),Id(`resetContext: destroying session (socket #${e.socket&&e.socket.id}, ${e.socket&&e.socket.servername})`),e.destroy()}))),"resetContext"),JYi=a((t,e,r,n=()=>{})=>{let o={...t},s=o[":status"];delete o[":status"];let c=r?N8c(s,t,e,n):e;return{statusCode:s,statusText:"",httpVersion:"2.0",httpVersionMajor:2,httpVersionMinor:0,headers:o,readable:c,decoded:!!(r&&c!==e)}},"createResponse"),F8c=a((t,e,r,n,o,s)=>{let{options:{h2:{pushPromiseHandler:c,pushHandler:l,pushedStreamIdleTimeout:u=O8c}}}=t,d=o[":path"],f=`${e}${d}`;Id(`received PUSH_PROMISE: ${f}, stream #${n.id}, headers: ${JSON.stringify(o)}, flags: ${s}`),c&&c(f,o,a(()=>{n.close(QFe)},"rejectPush")),n.on("push",(h,m)=>{Id(`received push headers for ${e}${d}, stream #${n.id}, headers: ${JSON.stringify(h)}, flags: ${m}`),n.setTimeout(u,()=>{Id(`closing pushed stream #${n.id} after ${u} ms of inactivity`),n.close(QFe)}),l&&l(f,o,JYi(h,n,r))}),n.on("aborted",()=>{Id(`pushed stream #${n.id} aborted`)}),n.on("error",h=>{Id(`pushed stream #${n.id} encountered error: ${h}`)}),n.on("frameError",(h,m,g)=>{Id(`pushed stream #${n.id} encountered frameError: type: ${h}, code: ${m}, id: ${g}`)})},"handlePush"),U8c=a(async(t,e,r)=>{let{origin:n,pathname:o,search:s,hash:c}=e,l=`${o}${s}${c}`,{options:{h2:u={}},h2:{sessionCache:d}}=t,{idleSessionTimeout:f=M8c,pushPromiseHandler:h,pushHandler:m}=u,g={...r},{method:A,headers:y,socket:E,body:_,decode:v}=g;return E&&delete g.socket,y.host&&(y[":authority"]=y.host,delete y.host),new Promise((b,T)=>{let w=d[n];if(!w||w.closed||w.destroyed){let N=!(t.options.rejectUnauthorized===!1||u.rejectUnauthorized===!1),L={...u,rejectUnauthorized:N};E&&!E.inUse&&(L.createConnection=()=>(Id(`reusing socket #${E.id} (${E.servername})`),E.inUse=!0,E)),w=k8c(n,{...L,settings:{enablePush:!!(h||m)}}),w.setMaxListeners(1e3),w.setTimeout(f,()=>{Id(`closing session ${n} after ${f} ms of inactivity`),w.close()}),w.once("connect",()=>{Id(`session ${n} established`),Id(`caching session ${n}`),d[n]=w}),w.on("localSettings",j=>{Id(`session ${n} localSettings: ${JSON.stringify(j)}`)}),w.on("remoteSettings",j=>{Id(`session ${n} remoteSettings: ${JSON.stringify(j)}`)}),w.once("close",()=>{Id(`session ${n} closed`),d[n]===w&&(Id(`discarding cached session ${n}`),delete d[n])}),w.once("error",j=>{Id(`session ${n} encountered error: ${j}`),d[n]===w&&(Id(`discarding cached session ${n}`),delete d[n])}),w.on("frameError",(j,M,O)=>{Id(`session ${n} encountered frameError: type: ${j}, code: ${M}, id: ${O}`)}),w.once("goaway",(j,M,O)=>{Id(`session ${n} received GOAWAY frame: errorCode: ${j}, lastStreamID: ${M}, opaqueData: ${O?O.toString():void 0}`)}),w.on("stream",(j,M,O)=>{F8c(t,n,v,j,M,O)})}else E&&E.id!==w.socket.id&&!E.inUse&&(Id(`discarding redundant socket used for ALPN: #${E.id} ${E.servername}`),E.destroy());Id(`${A} ${e.host}${l}`);let R,{signal:x}=g,P=a(()=>{x.removeEventListener("abort",P),T(new KYi),R&&R.close(QFe)},"onAbortSignal");if(x){if(x.aborted){T(new KYi);return}x.addEventListener("abort",P)}let D=a(N=>{Id(`session ${n} encountered error during ${g.method} ${e.href}: ${N}`),T(N)},"onSessionError");w.once("error",D),R=w.request({":method":A,":path":l,...y}),R.once("response",N=>{w.off("error",D),x&&x.removeEventListener("abort",P),b(JYi(N,R,g.decode,T))}),R.once("error",N=>{w.off("error",D),x&&x.removeEventListener("abort",P),R.rstCode!==QFe&&(Id(`${g.method} ${e.href} failed with: ${N.message}`),R.close(QFe),T(N))}),R.once("frameError",(N,L,B)=>{w.off("error",D),Id(`encountered frameError during ${g.method} ${e.href}: type: ${N}, code: ${L}, id: ${B}`)}),R.on("push",(N,L)=>{Id(`received 'push' event: headers: ${JSON.stringify(N)}, flags: ${L}`)}),_ instanceof D8c?_.pipe(R):(_&&R.write(_),R.end())})},"request");ZYi.exports={request:U8c,setupContext:L8c,resetContext:B8c}});var tKi=I((J7h,eKi)=>{"use strict";p();var{EventEmitter:Q8c}=require("events"),q8c=a(()=>{let t={},e=new Q8c;return e.setMaxListeners(0),{acquire:a(r=>new Promise(n=>{if(!t[r]){t[r]=!0,n();return}let o=a(s=>{t[r]||(t[r]=!0,e.removeListener(r,o),n(s))},"tryAcquire");e.on(r,o)}),"acquire"),release:a((r,n)=>{Reflect.deleteProperty(t,r),setImmediate(()=>e.emit(r,n))},"release")}},"lock");eKi.exports=q8c});var rKi=I((eQh,j8c)=>{j8c.exports={name:"@adobe/helix-fetch",version:"3.1.1",description:"Light-weight Fetch implementation transparently supporting both HTTP/1(.1) and HTTP/2",main:"src/index.js",scripts:{test:"nyc mocha",lint:"./node_modules/.bin/eslint .","semantic-release":"semantic-release"},mocha:{timeout:"5000",recursive:"true",reporter:"mocha-multi-reporters","reporter-options":"configFile=.mocha-multi.json"},engines:{node:">=12.0"},types:"src/index.d.ts",exports:{import:"./src/index.mjs",require:"./src/index.js"},repository:{type:"git",url:"https://github.com/adobe/helix-fetch"},author:"",license:"Apache-2.0",bugs:{url:"https://github.com/adobe/helix-fetch/issues"},homepage:"https://github.com/adobe/helix-fetch#readme",keywords:["fetch","whatwg","Fetch API","http","https","http2","h2","promise","async","request","RFC 7234","7234","caching","cache"],dependencies:{debug:"4.3.4","http-cache-semantics":"^4.1.1","lru-cache":"7.13.1"},devDependencies:{"@adobe/eslint-config-helix":"1.3.2","@semantic-release/changelog":"6.0.1","@semantic-release/git":"10.0.1",chai:"4.3.6","chai-as-promised":"7.1.1","chai-bytes":"0.1.2","chai-iterator":"3.0.2",eslint:"8.21.0","eslint-plugin-header":"3.1.1","eslint-plugin-import":"2.26.0","formdata-node":"4.3.3","lint-staged":"13.0.3",mocha:"10.0.0","mocha-multi-reporters":"1.5.1",nock:"13.2.9",nyc:"15.1.0","parse-cache-control":"1.0.1",pem:"1.14.6",proxy:"^1.0.2","semantic-release":"19.0.3",sinon:"14.0.0","stream-buffers":"3.0.2",tunnel:"^0.0.6"},"lint-staged":{"*.js":"eslint"},config:{commitizen:{path:"node_modules/cz-conventional-changelog"},ghooks:{"pre-commit":"npx lint-staged"}}}});var aKi=I((tQh,sKi)=>{"use strict";p();var{Readable:H8c}=require("stream"),G8c=require("tls"),{types:{isAnyArrayBuffer:$8c}}=require("util"),V8c=wFr(),QFr=wP()("helix-fetch:core"),{RequestAbortedError:fIt}=dIt(),qFr=YYi(),pIt=XYi(),W8c=tKi(),{isPlainObject:z8c}=$9(),{isFormData:Y8c,FormDataSerializer:K8c}=UFe(),{version:J8c}=rKi(),jFr="h2",HFr="h2c",GFr="http/1.0",Gie="http/1.1",Z8c=100,X8c=3600*1e3,e6c=[jFr,Gie,GFr],t6c=`helix-fetch/${J8c}`,r6c={method:"GET",compress:!0,decode:!0},nKi=0,iKi=W8c(),oKi=a((t,e)=>new Promise((r,n)=>{let{signal:o}=e,s,c=a(()=>{o.removeEventListener("abort",c);let d=new fIt;n(d),s&&s.destroy(d)},"onAbortSignal");if(o){if(o.aborted){n(new fIt);return}o.addEventListener("abort",c)}let l=+t.port||443,u=a(d=>{o&&o.removeEventListener("abort",c),d instanceof fIt||(QFr(`connecting to ${t.hostname}:${l} failed with: ${d.message}`),n(d))},"onError");s=G8c.connect(l,t.hostname,e),s.once("secureConnect",()=>{o&&o.removeEventListener("abort",c),s.off("error",u),nKi+=1,s.id=nKi,s.secureConnecting=!1,QFr(`established TLS connection: #${s.id} (${s.servername})`),r(s)}),s.once("error",u)}),"connectTLS"),n6c=a(async(t,e)=>{let r=await iKi.acquire(t.origin);try{return r||(r=await oKi(t,e)),r}finally{iKi.release(t.origin,r)}},"connect"),i6c=a(async(t,e,r)=>{let n=`${e.protocol}//${e.host}`,o=t.alpnCache.get(n);if(o)return{protocol:o};switch(e.protocol){case"http:":return o=Gie,t.alpnCache.set(n,o),{protocol:o};case"http2:":return o=HFr,t.alpnCache.set(n,o),{protocol:o};case"https:":break;default:throw new TypeError(`unsupported protocol: ${e.protocol}`)}let{options:{rejectUnauthorized:s,h1:c={},h2:l={}}}=t,u=!(s===!1||c.rejectUnauthorized===!1||l.rejectUnauthorized===!1),d={servername:e.hostname,ALPNProtocols:t.alpnProtocols,signal:r,rejectUnauthorized:u};t.options.ca&&(d.ca=t.options.ca);let f=await n6c(e,d);return o=f.alpnProtocol,o||(o=Gie),t.alpnCache.set(n,o),{protocol:o,socket:f}},"determineProtocol"),o6c=a(t=>{let e={};return Object.keys(t).forEach(r=>{e[r.toLowerCase()]=t[r]}),e},"sanitizeHeaders"),s6c=a(async(t,e,r,n)=>{let o=e.protocol==="https:",s;e.port?s=e.port:o?s=443:s=80;let c={...r,host:e.host,hostname:e.hostname,port:s},l=await t(c);if(o){let d={...c,ALPNProtocols:n};d.socket=l,d.servername=c.host;let f=await oKi(e,d);return{protocol:f.alpnProtocol||Gie,socket:f}}return{protocol:l.alpnProtocol||Gie,socket:l}},"getProtocolAndSocketFromFactory"),a6c=a(async(t,e,r)=>{let n=new URL(e),o={...r6c,...r||{}};typeof o.method=="string"&&(o.method=o.method.toUpperCase()),o.headers=o6c(o.headers||{}),o.headers.host===void 0&&(o.headers.host=n.host),t.userAgent&&o.headers["user-agent"]===void 0&&(o.headers["user-agent"]=t.userAgent);let s;if(o.body instanceof URLSearchParams)s="application/x-www-form-urlencoded; charset=utf-8",o.body=o.body.toString();else if(Y8c(o.body)){let d=new K8c(o.body);s=d.contentType(),o.body=d.stream(),o.headers["transfer-encoding"]===void 0&&o.headers["content-length"]===void 0&&(o.headers["content-length"]=String(d.length()))}else typeof o.body=="string"||o.body instanceof String?s="text/plain; charset=utf-8":z8c(o.body)?(o.body=JSON.stringify(o.body),s="application/json"):$8c(o.body)&&(o.body=Buffer.from(o.body));o.headers["content-type"]===void 0&&s!==void 0&&(o.headers["content-type"]=s),o.body!=null&&(o.body instanceof H8c||(!(typeof o.body=="string"||o.body instanceof String)&&!Buffer.isBuffer(o.body)&&(o.body=String(o.body)),o.headers["transfer-encoding"]===void 0&&o.headers["content-length"]===void 0&&(o.headers["content-length"]=String(Buffer.isBuffer(o.body)?o.body.length:Buffer.byteLength(o.body,"utf-8"))))),o.headers.accept===void 0&&(o.headers.accept="*/*"),o.body==null&&["POST","PUT"].includes(o.method)&&(o.headers["content-length"]="0"),o.compress&&o.headers["accept-encoding"]===void 0&&(o.headers["accept-encoding"]="gzip,deflate,br");let{signal:c}=o,{protocol:l,socket:u=null}=t.socketFactory?await s6c(t.socketFactory,n,o,t.alpnProtocols):await i6c(t,n,c);switch(QFr(`${n.host} -> ${l}`),l){case jFr:try{return await pIt.request(t,n,u?{...o,socket:u}:o)}catch(d){let{code:f,message:h}=d;throw f==="ERR_HTTP2_ERROR"&&h==="Protocol error"&&t.alpnCache.delete(`${n.protocol}//${n.host}`),d}case HFr:return pIt.request(t,new URL(`http://${n.host}${n.pathname}${n.hash}${n.search}`),u?{...o,socket:u}:o);case GFr:case Gie:return qFr.request(t,n,u?{...o,socket:u}:o);default:throw new TypeError(`unsupported protocol: ${l}`)}},"request"),c6c=a(async t=>(t.alpnCache.clear(),Promise.all([qFr.resetContext(t),pIt.resetContext(t)])),"resetContext"),l6c=a(t=>{let{options:{alpnProtocols:e=e6c,alpnCacheTTL:r=X8c,alpnCacheSize:n=Z8c,userAgent:o=t6c,socketFactory:s}}=t;t.alpnProtocols=e,t.alpnCache=new V8c({max:n,ttl:r}),t.userAgent=o,t.socketFactory=s,qFr.setupContext(t),pIt.setupContext(t)},"setupContext");sKi.exports={request:a6c,setupContext:l6c,resetContext:c6c,RequestAbortedError:fIt,ALPN_HTTP2:jFr,ALPN_HTTP2C:HFr,ALPN_HTTP1_1:Gie,ALPN_HTTP1_0:GFr}});var lKi=I((iQh,cKi)=>{"use strict";p();var u6c=wP()("helix-fetch:core"),{request:d6c,setupContext:f6c,resetContext:p6c,RequestAbortedError:h6c,ALPN_HTTP2:m6c,ALPN_HTTP2C:g6c,ALPN_HTTP1_1:A6c,ALPN_HTTP1_0:y6c}=aKi(),$Fr=class t{static{a(this,"RequestContext")}constructor(e){this.options={...e||{}},f6c(this)}api(){return{request:a(async(e,r)=>this.request(e,r),"request"),context:a((e={})=>new t(e).api(),"context"),setCA:a(e=>this.setCA(e),"setCA"),reset:a(async()=>this.reset(),"reset"),RequestAbortedError:h6c,ALPN_HTTP2:m6c,ALPN_HTTP2C:g6c,ALPN_HTTP1_1:A6c,ALPN_HTTP1_0:y6c}}async request(e,r){return d6c(this,e,r)}setCA(e){this.options.ca=e}async reset(){return u6c("resetting context"),p6c(this)}};cKi.exports=new $Fr().api()});var hKi=I((aQh,pKi)=>{"use strict";p();var{EventEmitter:E6c}=require("events"),{Readable:qFe}=require("stream"),VFr=wP()("helix-fetch"),_6c=wFr(),{Body:v6c}=iIt(),{Headers:KFr}=Z_e(),{Request:$ie}=NYi(),{Response:zFr}=OFr(),{FetchBaseError:C6c,FetchError:jFe,AbortError:hIt}=PFr(),{AbortController:b6c,AbortSignal:S6c,TimeoutSignal:T6c}=DFr(),I6c=QYi(),{cacheableResponse:x6c}=HYi(),{sizeof:w6c}=$9(),{isFormData:R6c}=UFe(),{context:k6c,RequestAbortedError:P6c}=lKi(),uKi=["GET","HEAD"],D6c=500,N6c=100*1024*1024,WFr="push",dKi=a(async(t,e,r)=>{let{request:n}=t.context,o=e instanceof $ie&&typeof r>"u"?e:new $ie(e,r),{method:s,body:c,signal:l,compress:u,decode:d,follow:f,redirect:h,init:{body:m}}=o,g;if(l&&l.aborted){let w=new hIt("The operation was aborted.");throw o.init.body instanceof qFe&&o.init.body.destroy(w),w}try{g=await n(o.url,{...r,method:s,headers:o.headers.plain(),body:m&&!(m instanceof qFe)&&!R6c(m)?m:c,compress:u,decode:d,follow:f,redirect:h,signal:l})}catch(w){throw m instanceof qFe&&m.destroy(w),w instanceof TypeError?w:w instanceof P6c?new hIt("The operation was aborted."):new jFe(w.message,"system",w)}let A=a(()=>{l.removeEventListener("abort",A);let w=new hIt("The operation was aborted.");o.init.body instanceof qFe&&o.init.body.destroy(w),g.readable.emit("error",w)},"abortHandler");l&&l.addEventListener("abort",A);let{statusCode:y,statusText:E,httpVersion:_,headers:v,readable:b,decoded:T}=g;if([301,302,303,307,308].includes(y)){let{location:w}=v,R=w==null?null:new URL(w,o.url);switch(o.redirect){case"manual":break;case"error":throw l&&l.removeEventListener("abort",A),new jFe(`uri requested responds with a redirect, redirect mode is set to 'error': ${o.url}`,"no-redirect");case"follow":{if(R===null)break;if(o.counter>=o.follow)throw l&&l.removeEventListener("abort",A),new jFe(`maximum redirect reached at: ${o.url}`,"max-redirect");let x={headers:new KFr(o.headers),follow:o.follow,compress:o.compress,decode:o.decode,counter:o.counter+1,method:o.method,body:o.body,signal:o.signal};if(y!==303&&o.body&&o.init.body instanceof qFe)throw l&&l.removeEventListener("abort",A),new jFe("Cannot follow redirect with body being a readable stream","unsupported-redirect");return(y===303||(y===301||y===302)&&o.method==="POST")&&(x.method="GET",x.body=void 0,x.headers.delete("content-length")),l&&l.removeEventListener("abort",A),dKi(t,new $ie(R,x))}default:}}return l&&(b.once("end",()=>{l.removeEventListener("abort",A)}),b.once("error",()=>{l.removeEventListener("abort",A)})),new zFr(b,{url:o.url,status:y,statusText:E,headers:v,httpVersion:_,decoded:T,counter:o.counter})},"fetch"),fKi=a(async(t,e,r)=>{if(t.options.maxCacheSize===0||!uKi.includes(e.method))return r;let n=new I6c(e,r,{shared:!1});if(n.storable()){let o=await x6c(r);return t.cache.set(e.url,{policy:n,response:o},n.timeToLive()),o}else return r},"cacheResponse"),M6c=a(async(t,e,r)=>{let n=new $ie(e,r);if(t.options.maxCacheSize!==0&&uKi.includes(n.method)&&!["no-store","reload"].includes(n.cache)){let{policy:c,response:l}=t.cache.get(n.url)||{};if(c&&c.satisfiesWithoutRevalidation(n)){l.headers=new KFr(c.responseHeaders(l));let u=l.clone();return u.fromCache=!0,u}}let s=await dKi(t,n);return n.cache!=="no-store"?fKi(t,n,s):s},"cachingFetch"),O6c=a((t,e={})=>{let r=new URL(t);if(typeof e!="object"||Array.isArray(e))throw new TypeError("qs: object expected");return Object.entries(e).forEach(([n,o])=>{Array.isArray(o)?o.forEach(s=>r.searchParams.append(n,s)):r.searchParams.append(n,o)}),r.href},"createUrl"),L6c=a(t=>new T6c(t),"timeoutSignal"),YFr=class t{static{a(this,"FetchContext")}constructor(e){this.options={...e};let{maxCacheSize:r}=this.options,n=typeof r=="number"&&r>=0?r:N6c,o=D6c;n===0&&(n=1,o=1);let s=a(({response:l},u)=>w6c(l),"sizeCalculation");this.cache=new _6c({max:o,maxSize:n,sizeCalculation:s}),this.eventEmitter=new E6c,this.options.h2=this.options.h2||{},typeof this.options.h2.enablePush>"u"&&(this.options.h2.enablePush=!0);let{enablePush:c}=this.options.h2;c&&(this.options.h2.pushPromiseHandler=(l,u,d)=>{let f={...u};Object.keys(f).filter(h=>h.startsWith(":")).forEach(h=>delete f[h]),this.pushPromiseHandler(l,f,d)},this.options.h2.pushHandler=(l,u,d)=>{let f={...u};Object.keys(f).filter(_=>_.startsWith(":")).forEach(_=>delete f[_]);let{statusCode:h,statusText:m,httpVersion:g,headers:A,readable:y,decoded:E}=d;this.pushHandler(l,f,new zFr(y,{url:l,status:h,statusText:m,headers:A,httpVersion:g,decoded:E}))}),this.context=k6c(this.options)}api(){return{fetch:a(async(e,r)=>this.fetch(e,r),"fetch"),Body:v6c,Headers:KFr,Request:$ie,Response:zFr,AbortController:b6c,AbortSignal:S6c,FetchBaseError:C6c,FetchError:jFe,AbortError:hIt,context:a((e={})=>new t(e).api(),"context"),setCA:a(e=>this.setCA(e),"setCA"),noCache:a((e={})=>new t({...e,maxCacheSize:0}).api(),"noCache"),h1:a((e={})=>new t({...e,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),"h1"),keepAlive:a((e={})=>new t({...e,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),"keepAlive"),h1NoCache:a((e={})=>new t({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),"h1NoCache"),keepAliveNoCache:a((e={})=>new t({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),"keepAliveNoCache"),reset:a(async()=>this.context.reset(),"reset"),onPush:a(e=>this.onPush(e),"onPush"),offPush:a(e=>this.offPush(e),"offPush"),createUrl:O6c,timeoutSignal:L6c,clearCache:a(()=>this.clearCache(),"clearCache"),cacheStats:a(()=>this.cacheStats(),"cacheStats"),ALPN_HTTP2:this.context.ALPN_HTTP2,ALPN_HTTP2C:this.context.ALPN_HTTP2C,ALPN_HTTP1_1:this.context.ALPN_HTTP1_1,ALPN_HTTP1_0:this.context.ALPN_HTTP1_0}}async fetch(e,r){return M6c(this,e,r)}setCA(e){this.options.ca=e,this.context.setCA(e)}onPush(e){return this.eventEmitter.on(WFr,e)}offPush(e){return this.eventEmitter.off(WFr,e)}clearCache(){this.cache.clear()}cacheStats(){return{size:this.cache.calculatedSize,count:this.cache.size}}pushPromiseHandler(e,r,n){VFr(`received server push promise: ${e}, headers: ${JSON.stringify(r)}`);let o=new $ie(e,{headers:r}),{policy:s}=this.cache.get(e)||{};s&&s.satisfiesWithoutRevalidation(o)&&(VFr(`already cached, reject push promise: ${e}, headers: ${JSON.stringify(r)}`),n())}async pushHandler(e,r,n){VFr(`caching resource pushed by server: ${e}, reqHeaders: ${JSON.stringify(r)}, status: ${n.status}, respHeaders: ${JSON.stringify(n.headers)}`);let o=await fKi(this,new $ie(e,{headers:r}),n);this.eventEmitter.emit(WFr,e,o)}};pKi.exports=new YFr().api()});var gKi=I((uQh,mKi)=>{"use strict";p();mKi.exports=hKi()});var FKi=I((pHh,BKi)=>{"use strict";p();function LKi(t,e,r){let n=e[r];if(t==null&&n.required===!1)return;if(t==null)throw new TypeError(`Required parameter \`${n.name}\` missing`);let o=typeof t;if(n.type&&o!==n.type){if(n.required===!1&&e.slice(r).some(s=>s.type===o))return!1;throw new TypeError(`Invalid type for parameter \`${n.name}\`, expected \`${n.type}\` but found \`${typeof t}\``)}return!0}a(LKi,"validateParameter");function l9c(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(l9c,"hasOwnProperty");function u9c(t,e){return function(){let r=Array.prototype.slice.call(arguments),n=[];for(let s=0,c=0;s{n.push((l,u)=>{if(l)return c(l);s(u)}),t.apply(this,n)});t.apply(this,n)}}a(u9c,"defineOperation");BKi.exports={defineOperation:u9c,validateParameter:LKi}});var r8r=I((gHh,qKi)=>{"use strict";p();var ove=E9e()("kerberos"),ive=ove.KerberosClient,UKi=ove.KerberosServer,nW=FKi().defineOperation,d9c=1,f9c=2,p9c=4,h9c=8,m9c=16,g9c=32,A9c=64,y9c=128,E9c=256,QKi=0,_9c=9,v9c=6;ive.prototype.step=nW(ive.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);ive.prototype.wrap=nW(ive.prototype.wrap,[{name:"challenge",type:"string"},{name:"options",type:"object"},{name:"callback",type:"function",required:!1}]);ive.prototype.unwrap=nW(ive.prototype.unwrap,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);UKi.prototype.step=nW(UKi.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);var C9c=nW(ove.checkPassword,[{name:"username",type:"string"},{name:"password",type:"string"},{name:"service",type:"string"},{name:"defaultRealm",type:"string",required:!1},{name:"callback",type:"function",required:!1}]),b9c=nW(ove.principalDetails,[{name:"service",type:"string"},{name:"hostname",type:"string"},{name:"callback",type:"function",required:!1}]),S9c=nW(ove.initializeClient,[{name:"service",type:"string"},{name:"options",type:"object",default:{mechOID:QKi}},{name:"callback",type:"function",required:!1}]),T9c=nW(ove.initializeServer,[{name:"service",type:"string"},{name:"callback",type:"function",required:!1}]);qKi.exports={initializeClient:S9c,initializeServer:T9c,principalDetails:b9c,checkPassword:C9c,GSS_C_DELEG_FLAG:d9c,GSS_C_MUTUAL_FLAG:f9c,GSS_C_REPLAY_FLAG:p9c,GSS_C_SEQUENCE_FLAG:h9c,GSS_C_CONF_FLAG:m9c,GSS_C_INTEG_FLAG:g9c,GSS_C_ANON_FLAG:A9c,GSS_C_PROT_READY_FLAG:y9c,GSS_C_TRANS_FLAG:E9c,GSS_C_NO_OID:QKi,GSS_MECH_OID_KRB5:_9c,GSS_MECH_OID_SPNEGO:v9c}});var jKi=I((yHh,I9c)=>{I9c.exports={name:"kerberos",version:"2.2.0",description:"Kerberos library for Node.js",main:"lib/index.js",files:["lib","src","binding.gyp","HISTORY.md","README.md"],repository:{type:"git",url:"https://github.com/mongodb-js/kerberos.git"},keywords:["kerberos","security","authentication"],author:{name:"The MongoDB NodeJS Team",email:"dbx-node@mongodb.com"},bugs:{url:"https://jira.mongodb.org/projects/NODE/issues/"},dependencies:{bindings:"^1.5.0","node-addon-api":"^6.1.0","prebuild-install":"^7.1.2"},devDependencies:{"@types/node":"^22.2.0",chai:"^4.4.1","chai-string":"^1.5.0",chalk:"^4.1.2","clang-format":"^1.8.0","dmd-clear":"^0.1.2",eslint:"^9.9.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","jsdoc-to-markdown":"^8.0.3",mocha:"^10.7.3",mongodb:"^6.8.0","node-gyp":"^10.1.0",prebuild:"^13.0.0",prettier:"^3.3.3",request:"^2.88.2"},overrides:{prebuild:{"node-gyp":"$node-gyp"}},scripts:{install:"prebuild-install --runtime napi || node-gyp rebuild","format-cxx":"clang-format -i 'src/**/*'","format-js":"ESLINT_USE_FLAT_CONFIG=false eslint lib test --fix","check:lint":"ESLINT_USE_FLAT_CONFIG=false eslint lib test",precommit:"check-clang-format",docs:"jsdoc2md --template etc/README.hbs --plugin dmd-clear --files lib/kerberos.js > README.md",test:"mocha test",prebuild:"prebuild --runtime napi --strip --verbose --all"},engines:{node:">=12.9.0"},binary:{napi_versions:[4]},license:"Apache-2.0",readmeFilename:"README.md"}});var GKi=I((EHh,HKi)=>{"use strict";p();var x9c=require("dns"),w9c=r8r(),n8r=class{static{a(this,"MongoAuthProcess")}constructor(e,r,n,o){o=o||{},this.host=e,this.port=r,this.serviceName=n||o.gssapiServiceName||"mongodb",this.canonicalizeHostName=typeof o.gssapiCanonicalizeHostName=="boolean"?o.gssapiCanonicalizeHostName:!1,this._transition=R9c(this),this.retries=10}init(e,r,n){let o=this;this.username=e,this.password=r;function s(c,l,u){if(!c)return u();x9c.resolveCname(l,(d,f)=>{if(d)return u(d);Array.isArray(f)&&f.length>0&&(o.host=f[0]),u()})}a(s,"performGssapiCanonicalizeHostName"),s(this.canonicalizeHostName,this.host,c=>{if(c)return n(c);let l={};r!=null&&Object.assign(l,{user:e,password:r});let u=process.platform==="win32"?`${this.serviceName}/${this.host}`:`${this.serviceName}@${this.host}`;w9c.initializeClient(u,l,(d,f)=>{if(d)return n(d,null);o.client=f,n(null,f)})})}transition(e,r){if(this._transition==null)return r(new Error("Transition finished"));this._transition(e,r)}};function R9c(t){return(e,r)=>{t.client.step("",(n,o)=>{if(n)return r(n);t._transition=k9c(t),r(null,o)})}}a(R9c,"firstTransition");function k9c(t){return(e,r)=>{t.client.step(e,(n,o)=>{if(n&&t.retries===0)return r(n);if(n)return t.retries=t.retries-1,t.transition(e,r);t._transition=P9c(t),r(null,o||"")})}}a(k9c,"secondTransition");function P9c(t){return(e,r)=>{t.client.unwrap(e,(n,o)=>{if(n)return r(n,!1);t.client.wrap(o,{user:t.username},(s,c)=>{if(s)return r(s,!1);t._transition=D9c(t),r(null,c)})})}}a(P9c,"thirdTransition");function D9c(t){return(e,r)=>{t._transition=null,r(null,!0)}}a(D9c,"fourthTransition");HKi.exports={MongoAuthProcess:n8r}});var VKi=I((CHh,$Fe)=>{"use strict";p();var $Ki=r8r();$Fe.exports=$Ki;$Fe.exports.Kerberos=$Ki;$Fe.exports.version=jKi().version;$Fe.exports.processes={MongoAuthProcess:GKi().MongoAuthProcess}});var Eao={};Ri(Eao,{AbortError:()=>M1,DirectConnectError:()=>Sk,DirectConnectTransport:()=>s9r,EXIT_REASONS:()=>pQc,HOOK_EVENTS:()=>jwt,InMemorySessionStore:()=>a6r,SYSTEM_PROMPT_DYNAMIC_BOUNDARY:()=>hQc,createSdkMcpServer:()=>Vel,deleteSession:()=>Vil,filterEscalatingDefaultMode:()=>Pil,foldSessionSummary:()=>feo,forkSession:()=>Wil,getSessionInfo:()=>Hil,getSessionMessages:()=>qil,getSubagentMessages:()=>Jil,importSessionToStore:()=>zil,listSessions:()=>jil,listSubagents:()=>Kil,parseDirectConnectUrl:()=>Yel,query:()=>Uil,renameSession:()=>Gil,resolveSettings:()=>Nil,startup:()=>Qil,tagSession:()=>$il,tool:()=>$el});function DUc(t){return this[t]}function LUc(t,e){this[t]=OUc.bind(null,e)}function s6r(t=dQc){let e=new AbortController;return(0,aeo.setMaxListeners)(t,e.signal),e}function ceo(t,e,r){return new Promise((n,o)=>{if(e?.aborted){r?.throwOnAbort||r?.abortError?o(r.abortError?.()??Error("aborted")):n();return}let s=setTimeout((l,u,d)=>{l?.removeEventListener("abort",u),d()},t,e,c,n);function c(){clearTimeout(s),r?.throwOnAbort||r?.abortError?o(r.abortError?.()??Error("aborted")):n()}a(c,"G"),e?.addEventListener("abort",c,{once:!0}),r?.unref&&s.unref()})}function fQc(t,e){t(Error(e))}function roe(t,e,r){let n,o=new Promise((s,c)=>{n=setTimeout(fQc,e,c,r),typeof n=="object"&&n.unref?.()});return Promise.race([t,o]).finally(()=>{n!==void 0&&clearTimeout(n)})}function k9r(t,e){if(t.type!=="user"||t.isMeta===!0||t.isCompactSummary===!0)return;let r=t.message;if(!r)return;let n=r.content,o=[];if(typeof n=="string")o.push(n);else if(Array.isArray(n)){for(let s of n)if(!(!s||typeof s!="object")){if(s.type==="tool_result")return;s.type==="text"&&typeof s.text=="string"&&o.push(s.text)}}for(let s of o){let c=s.replaceAll(` +`," ").trim();if(!c)continue;let l=gQc.exec(c);if(l){e.commandFallback||(e.commandFallback=l[1]);continue}let u=/([\s\S]*?)<\/bash-input>/.exec(c);if(u)return`! ${u[1].trim()}`;if(!mQc.test(c))return c.length>200&&(c=c.slice(0,200).trim()+"\u2026"),c}}function feo(t,e,r,n){let o=n?.mtime??t?.mtime??0,s=t!==void 0?{sessionId:t.sessionId,mtime:o,data:{...t.data}}:{sessionId:e.sessionId,mtime:o,data:{}},c=s.data;for(let l of r){let u=_Qc(l.timestamp);if(c.isSidechain===void 0&&(c.isSidechain=l.isSidechain===!0),c.createdAt===void 0&&u!==void 0&&(c.createdAt=u),c.cwd===void 0){let d=l.cwd;typeof d=="string"&&d&&(c.cwd=d)}vQc(c,l);for(let[d,f]of Object.entries(AQc)){let h=l[d];typeof h=="string"&&(c[f]=h)}if(l.type==="tag"){let d=l.tag;typeof d=="string"&&d?c.tag=d:delete c.tag}}return s}function yQc(t,e){let r=t.data;if(r.isSidechain===!0)return null;let n=aW(r.firstPromptLocked===!0?r.firstPrompt:r.commandFallback)||void 0,o=aW(r.customTitle)||aW(r.aiTitle)||void 0,s=o||aW(r.lastPrompt)||aW(r.summaryHint)||n;return s?{sessionId:t.sessionId,summary:s,lastModified:t.mtime,fileSize:void 0,customTitle:o,firstPrompt:n,gitBranch:aW(r.gitBranch)||void 0,cwd:aW(r.cwd)||e||void 0,tag:aW(r.tag)||void 0,createdAt:EQc(r.createdAt)}:null}function aW(t){return typeof t=="string"?t:void 0}function EQc(t){return typeof t=="number"?t:void 0}function _Qc(t){if(typeof t!="string")return;let e=Date.parse(t);return Number.isNaN(e)?void 0:e}function vQc(t,e){if(t.firstPromptLocked)return;let r={commandFallback:t.commandFallback??""},n=k9r(e,r);r.commandFallback&&!t.commandFallback&&(t.commandFallback=r.commandFallback),n!==void 0&&(t.firstPrompt=n,t.firstPromptLocked=!0)}function peo(){return process.versions.bun!==void 0}function d_(t){if(!t)return!1;if(typeof t=="boolean")return t;let e=String(t).toLowerCase().trim();return["1","true","yes","on"].includes(e)}function n6e(){let t=new Set;return{subscribe(e){return t.add(e),()=>{t.delete(e)}},emit(...e){let r;for(let n of t)try{n(...e)}catch(o){(r??=[]).push(o)}if(r)throw r.length===1?r[0]:AggregateError(r,"Signal listener(s) threw")},clear(){t.clear()}}}function wQc(t){var e=IQc.call(t,zFe),r=t[zFe];try{t[zFe]=void 0;var n=!0}catch{}var o=xQc.call(t);return n&&(e?t[zFe]=r:delete t[zFe]),o}function DQc(t){return PQc.call(t)}function LQc(t){return t==null?t===void 0?OQc:MQc:NJi&&NJi in Object(t)?RQc(t):NQc(t)}function BQc(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function jQc(t){if(!sU(t))return!1;var e=i6e(t);return e==UQc||e==QQc||e==FQc||e==qQc}function GQc(t){return!!MJi&&MJi in t}function zQc(t){if(t!=null){try{return WQc.call(t)}catch{}try{return t+""}catch{}}return""}function nqc(t){if(!sU(t)||$Qc(t))return!1;var e=P9r(t)?rqc:JQc;return e.test(YQc(t))}function oqc(t,e){return t?.[e]}function aqc(t,e){var r=sqc(t,e);return iqc(r)?r:void 0}function lqc(){this.__data__=w8e?w8e(null):{},this.size=0}function dqc(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function gqc(t){var e=this.__data__;if(w8e){var r=e[t];return r===pqc?void 0:r}return mqc.call(e,t)?e[t]:void 0}function _qc(t){var e=this.__data__;return w8e?e[t]!==void 0:Eqc.call(e,t)}function bqc(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=w8e&&e===void 0?Cqc:e,this}function tCe(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1}function Bqc(t,e){var r=this.__data__,n=Gwt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function rCe(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let o=n[1]||0,s=n[2]||0,c=n[3]||0;return{browser:e,version:`${o}.${s}.${c}`}}}return null}function ljc(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function veo(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function Ceo(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return veo({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function L9r(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function ujc(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}function fjc(t){return Object.entries(t).filter(([e,r])=>typeof r<"u").map(([e,r])=>{if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")return`${encodeURIComponent(e)}=${encodeURIComponent(r)}`;if(r===null)return`${encodeURIComponent(e)}=`;throw new wi(`Cannot stringify type ${typeof r}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}function Seo(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new iu(`Invalid token endpoint base URL "${t}": ${n}`)}if(e.protocol==="https:")return;let r=e.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(e.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1")))throw new iu(`Refusing to send credential over non-https token endpoint "${t}"`)}async function Teo(t,e){let r=await Ejc(t),n;try{n=JSON.parse(r)}catch{throw new iu(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,Tk(r),e)}if(!n.access_token)throw new iu(`Token endpoint response missing access_token: ${JSON.stringify(Tk(n))}`,t.status,Tk(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new iu(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,Tk(n),e);return n}function Tk(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=w8r?t:t.slice(0,w8r)+`... <${t.length-w8r} more chars>`}return JSON.stringify(Tk(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))yjc.has(r)&&(e[r]=n);return e}return null}async function Ieo(t,e=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),n=t,o;try{n=await r.promises.realpath(t),o=await r.promises.stat(n)}catch{return}let s=o.mode&511;if(s&18)throw new iu(`Credentials file at ${n} is group/world-writable (mode 0o${s.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(s&36)throw new iu(`Credentials file at ${n} is group/world-readable (mode 0o${s.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);typeof process.getuid=="function"&&o.uid!==process.getuid()&&e(`credentials file at ${n} is owned by uid ${o.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function xeo(t,e){let r=await import("node:fs"),n=(await import("node:path")).dirname(t);await r.promises.mkdir(n,{recursive:!0,mode:448});let o=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await r.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(e,null,2)),await s.sync()}finally{await s.close()}await r.promises.rename(o,t)}catch(s){throw await r.promises.unlink(o).catch(()=>{}),s}try{let s=await r.promises.open(n,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function Ejc(t){if(!t.body)return"";let e=t.body.getReader(),r=[],n=0;for(;;){let{done:s,value:c}=await e.read();if(s)break;if(n+c.length>qJi){let l=qJi-n;l>0&&r.push(c.subarray(0,l)),await e.cancel();break}r.push(c),n+=c.length}let o;if(r.length===1)o=r[0];else{o=new Uint8Array(r.reduce((c,l)=>c+l.length,0));let s=0;for(let c of r)o.set(c,s),s+=c.length}return new TextDecoder("utf-8").decode(o)}function noe(){return Math.floor(Date.now()/1e3)}function _jc(t){let e=0;for(let o of t)e+=o.length;let r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function F9r(t){let e;return(jJi??(e=new globalThis.TextEncoder,jJi=e.encode.bind(e)))(t)}function GJi(t){let e;return(HJi??(e=new globalThis.TextDecoder,HJi=e.decode.bind(e)))(t)}function m8e(){}function GIt(t,e,r){return!e||Ixt[t]>Ixt[r]?m8e:e[t].bind(e)}function cA(t){let e=t.logger,r=t.logLevel??"off";if(!e)return vjc;let n=VJi.get(e);if(n&&n[0]===r)return n[1];let o={error:GIt("error",e,r),warn:GIt("warn",e,r),info:GIt("info",e,r),debug:GIt("debug",e,r)};return VJi.set(e,[r,o]),o}function Reo(t){if(!t)throw Error("profile name is empty");if(t==="."||t==="..")throw Error(`profile name "${t}" is not allowed`);if(t.includes("/")||t.includes("\\"))throw Error(`profile name "${t}" must not contain path separators`);if(!Cjc.test(t))throw Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}function WJi(t){if(!t)throw new wi("Identity token file path is empty");return async()=>{let e=await import("node:fs"),r;try{r=await e.promises.readFile(t,"utf-8")}catch(o){throw new wi(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new wi(`Identity token file at ${t} is empty`);return n}}function Ijc(t){if(!t)throw new wi("Identity token value is empty");return()=>t}function xjc(t){return async()=>{Seo(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16384)throw new iu(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:pjc,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(r.service_account_id=t.serviceAccountId),t.workspaceId&&(r.workspace_id=t.workspaceId);let n=`${t.baseURL}${beo}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${Txt},${mjc}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${mW} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new iu(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=Tk(u),f="";throw o.status===401&&(f=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new iu(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await Teo(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new iu(`Token endpoint response missing required fields: ${JSON.stringify(Tk(c))}`,o.status,Tk(c),s);return{token:c.access_token,expiresAt:noe()+l}}}function wjc(t){return async e=>{let r=await import("node:fs");await Ieo(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new iu(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new iu(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new iu(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||noe()"");throw new iu(`User OAuth refresh failed (HTTP ${f.status}): ${Tk(E)}`,f.status,Tk(E),h)}let m=await Teo(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new iu(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(Tk(m))}`,f.status,Tk(m),h);let A=noe()+g,y=m.refresh_token||l;return await xeo(t.credentialsPath,{...o,version:weo,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}function Peo(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=kjc(t,r,n,e),s={};return t.workspace_id&&t.authentication.type==="user_oauth"&&(s["anthropic-workspace-id"]=t.workspace_id),{provider:o,extraHeaders:s,baseURL:t.base_url||void 0}}async function Rjc(t,e){let r=await bjc(e);if(!r)return null;let{config:n,fromFile:o}=r,s=n.authentication.credentials_path||!o?n:{...n,authentication:{...n.authentication,credentials_path:await Sjc(n,e)??void 0}};return Peo(s,t)}function kjc(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=Pjc(o);if(!s)throw new iu("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!o.federation_rule_id)throw new iu("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!t.organization_id)throw new iu("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=xjc({identityTokenProvider:s,federationRuleId:o.federation_rule_id,organizationId:t.organization_id,serviceAccountId:o.service_account_id,workspaceId:t.workspace_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent});return e?Djc(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new iu("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return wjc({credentialsPath:e,clientId:t.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let o=t.authentication.type;throw new iu(`authentication.type "${o}" is not a known authentication type`)}}}function Pjc(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new iu(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new iu('identity_token.source "file" requires a non-empty path');return WJi(t.identity_token.path)}let e=ru("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return WJi(e);let r=ru("ANTHROPIC_IDENTITY_TOKEN");return r?Ijc(r):null}function Djc(t,e,r,n){return async o=>{let s=await import("node:fs");await Ieo(e,n);let c;try{let u=await s.promises.readFile(e,"utf-8");c=JSON.parse(u);let d=c?.access_token;if(d&&!o?.forceRefresh){let f=c?.expires_at;if(f==null||noe()0&&(yield e)}function Bjc(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}async function Deo(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return cA(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):loe.fromSSEResponse(r,e.controller);if(r.status===204)return null;if(e.options.__binaryResponse)return r;let l=r.headers.get("content-type")?.split(";")[0]?.trim();if(l?.includes("application/json")||l?.endsWith("+json")){if(r.headers.get("content-length")==="0")return;let u=await r.json();return Neo(u,r)}return await r.text()})();return cA(t).debug(`[${n}] response parsed`,eoe({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function Neo(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("request-id"),enumerable:!1})}function Ive(t,e,r){return Meo(),new File(t,e??"unknown_file",r)}function uxt(t,e){let r=typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"";return e?r.split(/[\\/]/).pop()||void 0:r}function Fjc(t){let e=typeof t=="function"?t:t.fetch,r=zJi.get(e);if(r)return r;let n=(async()=>{try{let o="Response"in e?e.Response:(await e("data:,")).constructor,s=new FormData;return s.toString()!==await new o(s).text()}catch{return!0}})();return zJi.set(e,n),n}async function Hjc(t,e,r){if(Meo(),t=await t,e||(e=uxt(t,!0)),qjc(t))return t instanceof File&&e==null&&r==null?t:Ive([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(jjc(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),Ive(await m6r(o),e,r)}let n=await m6r(t);if(!r?.type){let o=n.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof o=="string"&&(r={...r,type:o})}return Ive(n,e,r)}async function m6r(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(Leo(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(Oeo(t))for await(let r of t)e.push(...await m6r(r));else{let r=t?.constructor?.name;throw Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${Gjc(t)}`)}return e}function Gjc(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(e=>`"${e}"`).join(", ")}]`}function*$jc(t){if(!t)return;if(Beo in t){let{values:n,nulls:o}=t;yield*n.entries();for(let s of o)yield[s,null];return}let e=!1,r;t instanceof Headers?r=t.entries():LJi(t)?r=t:(e=!0,r=Object.entries(t??{}));for(let n of r){let o=n[0];if(typeof o!="string")throw TypeError("expected header name to be a string");let s=LJi(n[1])?n[1]:[n[1]],c=!1;for(let l of s)l!==void 0&&(e&&!c&&(c=!0,yield[o,null]),yield[o,l])}}function Feo(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}function dxt(t){return typeof t=="object"&&t!==null&&S8e in t}function Ueo(t,e){let r=new Set;if(t)for(let n of t)dxt(n)&&r.add(n[S8e]);if(e){for(let n of e)if(dxt(n)&&r.add(n[S8e]),Array.isArray(n.content))for(let o of n.content)dxt(o)&&r.add(o[S8e])}return Array.from(r)}function Qeo(t,e){let r=Ueo(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function Wjc(t){return dxt(t)?{"x-stainless-helper":t[S8e]}:{}}function jeo(t){return t?.output_format??t?.output_config?.format}function KJi(t,e,r){let n=jeo(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>{if(o.type==="text"){let s=Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return o}),parsed_output:null}:Heo(t,e,r)}function Heo(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=zjc(e,s.text);n===null&&(n=c);let l=Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1});return Object.defineProperty(l,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),c},enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function zjc(t,e){let r=jeo(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new wi(`Failed to parse structured output: ${n}`)}}function eZi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}function rZi(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}}async function eHc(t,e=t.messages.at(-1),r){if(!e||e.role!=="assistant"||!e.content||typeof e.content=="string")return null;let n=e.content.filter(o=>o.type==="tool_use");return n.length===0?null:{role:"user",content:await Promise.all(n.map(async o=>{let s=t.tools.find(c=>("name"in c?c.name:c.mcp_server_name)===o.name);if(!s||!("run"in s))return{type:"tool_result",tool_use_id:o.id,content:`Error: Tool '${o.name}' not found`,is_error:!0};try{let c=o.input;"parse"in s&&s.parse&&(c=s.parse(c));let l=await s.run(c,{toolUseBlock:o,signal:r?.signal});return{type:"tool_result",tool_use_id:o.id,content:l}}catch(c){return{type:"tool_result",tool_use_id:o.id,content:c instanceof Fxt?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function iZi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new wi("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:e,...r}=t;return{...r,output_config:{...t.output_config,format:e}}}function $eo(t){return t?.output_config?.format}function oZi(t,e,r){let n=$eo(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>o.type==="text"?Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1}):o),parsed_output:null}:Veo(t,e,r)}function Veo(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=rHc(e,s.text);return n===null&&(n=c),Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function rHc(t,e){let r=$eo(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new wi(`Failed to parse structured output: ${n}`)}}function lZi(t){return t.type==="tool_use"||t.type==="server_tool_use"}function o6e(t){return t instanceof Error?t:Error(String(t))}function pxt(t){return t instanceof Error?t.message:String(t)}function BI(t){if(t&&typeof t=="object"&&"code"in t&&typeof t.code=="string")return t.code}function s6e(t){return BI(t)==="ENOENT"}function zeo(t){return BI(t)==="EISDIR"}function sHc(t){let e=BI(t);return e==="ENOENT"||e==="EACCES"||e==="EPERM"||e==="ENOTDIR"||e==="ELOOP"||e==="EROFS"}async function lHc(t,e,r){let n=`${t}.tmp.${(0,Jeo.randomBytes)(4).toString("hex")}`;try{await(0,WL.writeFile)(n,e,{encoding:"utf8",mode:r});try{await(0,WL.rename)(n,t)}catch(o){let s=BI(o);if(s!==void 0&&aHc.has(s)){try{await(0,WL.copyFile)(n,t)}catch(c){throw cHc.has(BI(c)??"")&&await(0,WL.unlink)(t).catch(()=>{}),c}await(0,WL.unlink)(n).catch(()=>{})}else throw o}}catch(o){throw await(0,WL.unlink)(n).catch(()=>{}),o}}function Wxt(){return uHc.getStore()??new v6r}function Zeo(){if(gve)return gve;if(!d_(process.env.DEBUG_CLAUDE_AGENT_SDK))return ioe=null,gve=Promise.resolve(),gve;let t=(0,_6r.join)(iCe(),"debug");return ioe=(0,_6r.join)(t,`sdk-${(0,Yeo.randomUUID)()}.txt`),process.stderr.write(`SDK debug logs: ${ioe} +`),gve=Wxt().mkdir(t).catch(()=>{}),gve}function dHc(){return Zeo(),ioe??null}function Ck(t){if(ioe===null)return;let e=`${new Date().toISOString()} ${t} +`;Zeo().then(()=>{ioe&&Wxt().append(ioe,e).catch(()=>{})})}function fHc(){this.__data__=new $wt,this.size=0}function hHc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function gHc(t){return this.__data__.get(t)}function yHc(t){return this.__data__.has(t)}function vHc(t,e){var r=this.__data__;if(r instanceof $wt){var n=r.__data__;if(!geo||n.length<_Hc-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new N9r(n)}return r.set(t,e),this.size=r.size,this}function oCe(t){var e=this.__data__=new $wt(t);this.size=e.size}function THc(t,e,r){e=="__proto__"&&zxt?zxt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function wHc(t,e,r){var n=t[e];(!(xHc.call(t,e)&&Hwt(n,r))||r===void 0&&!(e in t))&&j9r(t,e,r)}function RHc(t,e,r,n){var o=!r;r||(r={});for(var s=-1,c=e.length;++s-1&&t%1==0&&t-1&&t%1==0&&t<=zHc}function _Gc(t){return sCe(t)&&G9r(t.length)&&!!xd[i6e(t)]}function CGc(t){return function(e){return t(e)}}function RGc(t,e){var r=vW(t),n=!r&&M8e(t),o=!r&&!n&&H9r(t),s=!r&&!n&&!o&&nto(t),c=r||n||o||s,l=c?DHc(t.length,String):[],u=l.length;for(var d in t)(e||wGc.call(t,d))&&!(c&&(d=="length"||o&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Wwt(d,u)))&&l.push(d);return l}function DGc(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||PGc;return t===r}function NGc(t,e){return function(r){return t(e(r))}}function OGc(t){return t!=null&&G9r(t.length)&&!P9r(t)}function LGc(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function QGc(t){if(!sU(t))return BGc(t);var e=ito(t),r=[];for(var n in t)n=="constructor"&&(e||!UGc.call(t,n))||r.push(n);return r}function jGc(t){return $9r(t)?kGc(t,!0):qGc(t)}function GGc(t,e){if(e)return t.slice();var r=t.length,n=AZi?AZi(r):new t.constructor(r);return t.copy(n),n}function $Gc(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r{let y=u;u=null,y&&f(y.join(""))})}return a(g,"N"),{write(A){if(o){f(A);return}s.push(A),c+=A.length,m(),(s.length>=r||c>=n)&&g()},flush:h,dispose(){h()}}}function rVc(t){return typeof t=="function"?t:Symbol.asyncDispose in t?()=>t[Symbol.asyncDispose]():()=>t[Symbol.dispose]()}function iVc(t){return nVc.register(t)}function sVc(t){let e=[],r=t.match(/^MCP server ["']([^"']+)["']/);if(r&&r[1])e.push("mcp"),e.push(r[1].toLowerCase());else{let s=t.match(/^([^:[]+):/);s&&s[1]&&e.push(s[1].trim().toLowerCase())}let n=t.match(/^\[([^\]]+)]/);n&&n[1]&&e.push(n[1].trim().toLowerCase()),t.toLowerCase().includes("1p event:")&&e.push("1p");let o=t.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(o&&o[1]){let s=o[1].trim().toLowerCase();s.length<30&&!s.includes(" ")&&e.push(s)}return Array.from(new Set(e))}function aVc(t,e){return e?t.length===0?!1:e.isExclusive?!t.some(r=>e.exclude.includes(r)):t.some(r=>e.include.includes(r)):!0}function cVc(t,e){if(!e)return!0;let r=sVc(t);return aVc(r,e)}function lVc(t){return/^[\\/]{2}/.test(t)}function uVc(t){return t.startsWith("\\\\?\\UNC\\")?"\\\\"+t.slice(8):t.startsWith("\\\\?\\")&&t.length>=7&&t[5]===":"?t.slice(4):t}function CZi(t){try{return uVc(pto.realpathSync.native(t))}catch{return null}}function dVc(t,e){let r=(0,zL.resolve)(e).toLowerCase(),n=(0,zL.resolve)(t).toLowerCase();if((0,zL.dirname)(n)===r||n.startsWith(r+zL.sep))return!0;let o=CZi(e)?.toLowerCase();if(o==null)return!1;let s=CZi((0,zL.dirname)((0,zL.resolve)(t)))?.toLowerCase();return s==null?!0:s===o||s.startsWith(o+zL.sep)}function hto(t,e){if(lVc(e))return{resolvedPath:e,isSymlink:!1,isCanonical:!1};try{let r=t.lstatSync(e);if(r.isFIFO()||r.isSocket()||r.isCharacterDevice()||r.isBlockDevice())return{resolvedPath:e,isSymlink:!1,isCanonical:!1};let n=t.realpathSync(e);return{resolvedPath:n,isSymlink:n!==e,isCanonical:!0}}catch{return{resolvedPath:e,isSymlink:!1,isCanonical:!1}}}function FI(){return pVc}function hVc(t,e){t.destroyed||t.write(e)}function mVc(t){hVc(process.stderr,t)}function gVc(t){return t.charAt(0).toUpperCase()+t.slice(1)}function AVc(t,e,r=e+"s"){return t===1?e:r}function yVc(t,e){let r=t.indexOf(e);return r===-1?t:t.slice(0,r)}function CVc(t){return vVc.map(e=>({id:e.id,confidence:e.confidence,re:new RegExp(e.source,t?(e.flags??"").replace("g","")+"g":e.flags??"")}))}function bVc(t){TZi??=CVc(!0);for(let e of TZi)t=t.replace(e.re,(r,n)=>{if(typeof n!="string")return"[REDACTED]";let o=n.length>=2&&(n[0]==='"'||n[0]==="'")&&n.at(-1)===n[0]?n[0]:"",s=r.lastIndexOf(n);return`${r.slice(0,s)}${o}[REDACTED]${o}${r.slice(s+n.length)}`});return t}function Ywt(){return typeof process<"u"&&Array.isArray(process.argv)?process.argv:[]}function xVc(t){if(!I6r()||typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let e=IVc();return cVc(t,e)}async function Ato(t,e,r=RVc){if(u8e<0?u8e=await(0,h_.stat)(t).then(n=>n.size).catch(()=>0):u8e+=e,!(u8e<=r||Q8r)){Q8r=!0;try{let n=t.endsWith(".txt")?`${t.slice(0,-4)}.1.txt`:`${t}.1`;try{await(0,h_.rename)(t,n)}catch(o){s6e(o)||(await(0,h_.unlink)(n).catch(()=>{}),await(0,h_.rename)(t,n).catch(()=>(0,h_.unlink)(t).catch(()=>{})))}u8e=0}finally{Q8r=!1}}}function yto(t){return x6r=(0,goe.join)(t,`${fto()}.txt`),x6r}async function kVc(t,e,r,n){t&&await(0,h_.mkdir)(e,{recursive:!0}).catch(()=>{});let o=r;try{await(0,h_.appendFile)(r,n)}catch(s){if(!zeo(s))throw s;o=yto(r),await(0,h_.appendFile)(o,n)}await Ato(o,Buffer.byteLength(n)).catch(w6r),_to()}function w6r(){}function PVc(){if(!oxt){let t=null;oxt=tVc({writeFn:a(e=>{let r=Eto(),n=(0,goe.dirname)(r),o=t!==n;if(t=n,I6r()){if(o)try{FI().mkdirSync(n)}catch{}let s=r;try{FI().appendFileSync(r,e)}catch(c){if(!zeo(c))throw c;s=yto(r),FI().appendFileSync(s,e)}Ato(s,Buffer.byteLength(e)).catch(w6r),_to();return}U8r=U8r.then(kVc.bind(null,o,n,r,e)).catch(w6r)},"writeFn"),flushIntervalMs:1e3,maxBufferSize:100,immediateMode:I6r()}),iVc(async()=>{oxt?.dispose(),await U8r})}return oxt}function nu(t,{level:e}={level:"debug"}){if(T6r[e]t.endsWith(e))}function qVc(t,e){return(0,ueo.existsSync)(t)?e?`Claude Code native binary at ${t} exists but failed to launch.`:`Claude Code executable at ${t} exists but failed to launch.`:e?`Claude Code native binary not found at ${t}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${t}. Is options.pathToClaudeCodeExecutable set?`}function jVc(){if(process.platform!=="linux")return!1;let t=typeof process.report?.getReport=="function"?process.report.getReport():null;return t!=null&&t.header?.glibcVersionRuntime===void 0}function HVc(t,e=process.platform,r=process.arch,n=vto.existsSync,o=jVc()){let s=e==="win32"?".exe":"",c=(e==="android"?[`${Ave}-linux-${r}-android`]:e==="linux"?o?[`${Ave}-linux-${r}-musl`,`${Ave}-linux-${r}`]:[`${Ave}-linux-${r}`,`${Ave}-linux-${r}-musl`]:[`${Ave}-${e}-${r}`]).map(l=>`${l}/claude${s}`);for(let l of c)try{let u=t(l);if(n(u))return u}catch{}return null}function GVc(){return{eventQueue:[],sink:null}}function J9r(t,e){let r=$Vc;if(r.sink===null){r.eventQueue.push({eventName:t,metadata:e,async:!1});return}r.sink.logEvent(t,e)}function Cto(t){J9r("tengu_feature_ok",{feature_name:t})}function bto(t,e,r){J9r("tengu_feature_bad",{feature_name:t,error_code:e,...r})}function VVc(t,e,r){J9r("tengu_feature_sad",{feature_name:t,error_code:e,...r})}async function X9(t,e,r){try{let n=await e();return Cto(t),n}catch(n){throw bto(t,r?.(n)??"error"),n}}function zVc(t){let e=t,r="",n=0,o=10;for(;e!==r&&n=o)throw Error(`Unicode sanitization reached maximum iterations (${o}) for input: ${t.slice(0,100)}`);return e}function I8e(t){if(typeof t=="string")return zVc(t);if(Array.isArray(t))return t.map(I8e);if(t!==null&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[I8e(r)]=I8e(n);return e}return t}function YVc(){return process.platform==="win32"}function JVc(t){let e=q8r.get(t);if(e!==void 0)return e;let r=process.env.SYSTEMROOT||"C:\\Windows",n=(0,Rto.join)(r,"System32","where.exe");try{let o=(0,wto.execFileSync)(n,[t],{stdio:"pipe",encoding:"utf8",timeout:KVc,windowsHide:!0,env:process.env}).trim().split(/\r?\n/).filter(Boolean),s=process.cwd();for(let c of o)if(!dVc(c,s))return q8r.set(t,c),c;return null}catch(o){return ZVc(o)&&q8r.set(t,null),null}}function ZVc(t){if(t===null||typeof t!="object")return!1;let e="status"in t?t.status:void 0,r="signal"in t?t.signal:void 0,n="code"in t?t.code:void 0;return e===1&&!r&&!n}function XVc(t){return!YVc()||t.includes("/")||t.includes("\\")?t:JVc(t)}async function a6e(t){let e=XVc("git");if(e===null)return[];try{let{stdout:r}=await eWc(e,["worktree","list","--porcelain"],{cwd:t,timeout:5e3});return r?r.split(` +`).filter(n=>n.startsWith("worktree ")).map(n=>n.slice(9).normalize("NFC")):[]}catch{return[]}}function tWc(t){let e=0;for(let r=0;ro&&(n=kto(t.slice(u,d)),o=l);break}d++}c=d+1}}return n}async function M6r(t,e){let r=(0,Tto.createWriteStream)(t,{mode:384});try{for(let n of e)r.write(JSON.stringify(n)+` +`)||await(0,N6r.once)(r,"drain");r.end(),await(0,N6r.once)(r,"finish")}catch(n){throw r.destroy(),n}}function Pto(t){let e=0,r={commandFallback:""};for(;e=0?t.slice(e,n):t.slice(e);if(e=n>=0?n+1:t.length,!(!o.includes('"type":"user"')&&!o.includes('"type": "user"'))&&!o.includes('"tool_result"')&&!(o.includes('"isMeta":true')||o.includes('"isMeta": true'))&&!(o.includes('"isCompactSummary":true')||o.includes('"isCompactSummary": true')))try{let s=JSON.parse(o),c=k9r(s,r);if(c!==void 0)return c}catch{continue}}return r.commandFallback}function nWc(t){let e={commandFallback:""};for(let r of t){if(typeof r!="object"||r===null)continue;let n=k9r(r,e);if(n!==void 0)return n}return e.commandFallback}async function Dto(t){try{let e=await(0,WN.open)(t,"r");try{let r=await e.stat(),n=Buffer.allocUnsafe(nU),o=await e.read(n,0,nU,0);if(o.bytesRead===0)return null;let s=n.toString("utf8",0,o.bytesRead),c=Math.max(0,r.size-nU),l=s;if(c>0){let u=await e.read(n,0,nU,c);l=n.toString("utf8",0,u.bytesRead)}return{mtime:r.mtime.getTime(),size:r.size,head:s,tail:l}}finally{await e.close()}}catch{return null}}function iWc(t){return Math.abs(tWc(t)).toString(36)}function c6e(t){let e=t.replace(/[^a-zA-Z0-9]/g,"-");return e.length<=O8e?e:`${e.slice(0,O8e)}-${iWc(t)}`}function IW(){return(0,Ove.join)(iCe(),"projects")}function oWc(t){return(0,Ove.join)(IW(),c6e(t))}async function l6e(t){try{return(await(0,WN.realpath)(t)).normalize("NFC")}catch{return t.normalize("NFC")}}async function $N(t){let e=oWc(t),r=[];try{await(0,WN.readdir)(e),r.push(e)}catch{}let n=c6e(t);if(n.length<=O8e)return r;let o=n.slice(0,O8e)+"-",s=IW();try{for(let c of await(0,WN.readdir)(s,{withFileTypes:!0})){if(!c.isDirectory()||!c.name.startsWith(o))continue;let l=(0,Ove.join)(s,c.name);l!==e&&r.push(l)}}catch{}return r}async function Kwt(t,e){let r=`${t}.jsonl`;async function n(c,l){let u=(0,Ove.join)(c,r);try{let d=await(0,WN.stat)(u);if(d.size>0)return{filePath:u,projectPath:l,fileSize:d.size}}catch{}}if(a(n,"Y"),e){let c=await l6e(e);for(let u of await $N(c)){let d=await n(u,c);if(d)return d}let l;try{l=await a6e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await $N(u)){let f=await n(d,u);if(f)return f}return}let o=IW(),s;try{s=await(0,WN.readdir)(o)}catch{return}for(let c of s){let l=await n((0,Ove.join)(o,c),void 0);if(l)return l}}function lWc(){return cWc??=Buffer.from('"compact_boundary"')}function Nto(t){try{let e=JSON.parse(t);return e.type!=="system"||e.subtype!=="compact_boundary"?null:{hasPreservedSegment:!!(e.compactMetadata?.preservedSegment||e.compactMetadata?.preservedMessages)}}catch{return null}}function ooe(t,e,r,n){let o=n-r;if(!(o<=0)){if(t.len+o>t.buf.length){let s=Buffer.allocUnsafe(Math.min(Math.max(t.buf.length*2,t.len+o),t.cap));t.buf.copy(s,0,0,t.len),t.buf=s}e.copy(t.buf,t.len,r,n),t.len+=o}}function Xxt(t,e,r,n){return n-r>=e.length&&t.compare(e,0,e.length,r,r+e.length)===0}function pWc(t,e,r){if(t.straddleSnapCarryLen=0,t.straddleSnapTailEnd=0,t.carryLen===0)return 0;let n=t.carryBuf,o=e.indexOf(L8e);if(o===-1||o>=r)return 0;let s=o+1;if(Xxt(n,ewt,0,t.carryLen))t.straddleSnapCarryLen=t.carryLen,t.straddleSnapTailEnd=s,t.lastSnapSrc=null;else{if(t.carryLen=s&&nt.lastSnapBuf.length)&&(t.lastSnapBuf=Buffer.allocUnsafe(t.lastSnapLen)),e.copy(t.lastSnapBuf,0,n,o),t.lastSnapSrc=t.lastSnapBuf):t.straddleSnapCarryLen>0&&(t.lastSnapLen=t.straddleSnapCarryLen+t.straddleSnapTailEnd,(t.lastSnapBuf===void 0||t.lastSnapLen>t.lastSnapBuf.length)&&(t.lastSnapBuf=Buffer.allocUnsafe(t.lastSnapLen)),t.carryBuf.copy(t.lastSnapBuf,0,0,t.straddleSnapCarryLen),r.copy(t.lastSnapBuf,t.straddleSnapCarryLen,0,t.straddleSnapTailEnd),t.lastSnapSrc=t.lastSnapBuf)}function gWc(t,e,r){t.carryLen=e.length-r,t.carryLen>0&&((t.carryBuf===void 0||t.carryLen>t.carryBuf.length)&&(t.carryBuf=Buffer.allocUnsafe(t.carryLen)),e.copy(t.carryBuf,0,r,e.length))}function AWc(t){if(t.carryLen>0){let e=t.carryBuf;Xxt(e,ewt,0,t.carryLen)?(t.lastSnapSrc=e,t.lastSnapLen=t.carryLen):ooe(t.out,e,0,t.carryLen)}t.lastSnapSrc&&(t.out.len>0&&t.out.buf[t.out.len-1]!==L8e&&ooe(t.out,dWc,0,1),ooe(t.out,t.lastSnapSrc,0,t.lastSnapLen))}async function yWc(t,e){let r=lWc(),n=sWc,o={out:{buf:Buffer.allocUnsafe(Math.min(e,8388608)),len:0,cap:e+1},boundaryStartOffset:0,hasPreservedSegment:!1,lastSnapSrc:null,lastSnapLen:0,lastSnapBuf:void 0,bufFileOff:0,carryLen:0,carryBuf:void 0,straddleSnapCarryLen:0,straddleSnapTailEnd:0},s=Buffer.allocUnsafe(n),c=await(0,WN.open)(t,"r");try{let l=0;for(;l0){let m=o.carryLen+(u-d);f=Buffer.allocUnsafe(m),o.carryBuf.copy(f,0,0,o.carryLen),s.copy(f,o.carryLen,d,u)}else f=s.subarray(d,u);let h=hWc(o,f,r);mWc(o,f,s,h.lastSnapStart,h.lastSnapEnd),gWc(o,f,h.trailStart),o.bufFileOff+=h.trailStart}AWc(o)}finally{await c.close()}return{boundaryStartOffset:o.boundaryStartOffset,postBoundaryBuf:o.out.buf.subarray(0,o.out.len),hasPreservedSegment:o.hasPreservedSegment}}async function EWc(t,e){try{return e>aWc&&!d_(process.env.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP)?(await yWc(t,e)).postBoundaryBuf:await(0,Sto.readFile)(t)}catch{return null}}function _Wc(t){let e=[];try{let o=sf(e,cf`parseTranscriptEntries(${t.length} bytes)`,0),s=[],c=10,l=t.length,u=0;for(;u=d)continue;let h=t.toString("utf-8",f,d);try{let m=MVc(h),g=m.type;(g==="user"||g==="assistant"||g==="progress"||g==="system"||g==="attachment")&&typeof m.uuid=="string"&&s.push(m)}catch{}}return s}catch(o){var r=o,n=1}finally{af(e,r,n)}}function vWc(t){let e=new Map;for(let m of t)e.set(m.uuid,m);for(let m of e.values()){if(m.type!=="system"||m.subtype!=="compact_boundary")continue;let g=m.compactMetadata?.preservedMessages,A=m.compactMetadata?.preservedSegment;if(g){if(g.uuids.length===0||g.uuids.some(v=>!e.has(v)))continue;let y=g.anchorUuid;for(let v of g.uuids){let b=e.get(v);e.set(v,{...b,parentUuid:y}),y=v}let E=g.uuids[0],_=g.uuids.at(-1);for(let[v,b]of e)b.parentUuid===g.anchorUuid&&v!==E&&e.set(v,{...b,parentUuid:_})}else if(A){let y=e.get(A.headUuid);y&&e.set(A.headUuid,{...y,parentUuid:A.anchorUuid});for(let[E,_]of e)_.parentUuid===A.anchorUuid&&E!==A.headUuid&&e.set(E,{..._,parentUuid:A.tailUuid})}}let r=new Map;for(let m=0;m!n.has(m.uuid)),s=[];for(let m of o){let g=m,A=new Set;for(;g&&!A.has(g.uuid);){if(A.add(g.uuid),g.type==="user"||g.type==="assistant"){s.push(g);break}g=g.parentUuid?e.get(g.parentUuid):void 0}}if(s.length===0)return[];let c=s.filter(m=>!m.isSidechain&&!m.teamName&&!m.isMeta),l=a(m=>m.reduce((g,A)=>(r.get(A.uuid)??-1)>(r.get(g.uuid)??-1)?A:g),"U"),u=c.length>0?l(c):l(s),d=[],f=new Set,h=e.get(u.uuid);for(;h&&!f.has(h.uuid);)f.add(h.uuid),d.push(h),h=h.parentUuid?e.get(h.parentUuid):void 0;return d.reverse(),bWc(e,d,f)}function H8r(t){if(t.type!=="assistant")return;let e=t.message;if(typeof e!="object"||e===null)return;let r=e.id;return typeof r=="string"?r:void 0}function CWc(t){if(t.type!=="user"||!t.parentUuid)return!1;let e=t.message;if(typeof e!="object"||e===null)return!1;let r=e.content;return Array.isArray(r)?r.some(n=>typeof n=="object"&&n!==null&&n.type==="tool_result"):!1}function bWc(t,e,r){let n=e.filter(h=>h.type==="assistant");if(n.length===0)return e;let o=new Map;for(let h of n){let m=H8r(h);m&&o.set(m,h)}let s=new Map,c=new Map;for(let h of t.values()){let m=H8r(h);if(m){let g=s.get(m);g?g.push(h):s.set(m,[h])}else if(CWc(h)){let g=h.parentUuid,A=c.get(g);A?A.push(h):c.set(g,[h])}}let l=new Set,u=new Map,d=0;for(let h of n){let m=H8r(h);if(!m||l.has(m))continue;l.add(m);let g=s.get(m)??[h],A=g.filter(b=>!r.has(b.uuid)),y=[];for(let b of g){let T=c.get(b.uuid);if(T)for(let w of T)r.has(w.uuid)||y.push(w)}if(A.length===0&&y.length===0)continue;let E=a((b,T)=>(b.timestamp??"").localeCompare(T.timestamp??""),"D");A.sort(E),y.sort(E);let _=o.get(m),v=[...A,...y];for(let b of v)r.add(b.uuid);d+=v.length,u.set(_.uuid,v)}if(d===0)return e;let f=[];for(let h of e){f.push(h);let m=u.get(h.uuid);m&&f.push(...m)}return f}function SWc(t,e){if(!(t.type==="user"||t.type==="assistant")){if(!(t.type==="system"&&e))return!1}return!(t.isMeta||t.isSidechain||t.teamName)}function Mto(t,e){return{type:t.type,uuid:t.uuid,session_id:t.sessionId,message:t.message,parent_tool_use_id:e??null,timestamp:t.timestamp}}function Oto(t,e){let r=e?.offset??0;return e?.limit!==void 0&&e.limit>0?t.slice(r,r+e.limit):r>0?t.slice(r):t}function TWc(t,e){let r=[];for(let n of t){if(typeof n!="object"||n===null)continue;let o=n,s=o.type;(s==="user"||s==="assistant"||s==="progress"||s==="system"||s==="attachment")&&typeof o.uuid=="string"&&r.push(o)}return Lto(r,e)}function Lto(t,e){let r=vWc(t),n=e?.includeSystemMessages??!1,o=r.filter(s=>SWc(s,n)).map(s=>Mto(s));return Oto(o,e)}async function IWc(t,e){if(!Ih(t))return[];let r=await Kwt(t,e?.dir);if(!r)return[];let n=await EWc(r.filePath,r.fileSize);return n?Lto(_Wc(n),e):[]}function Jwt(t,e,r){let{head:n,tail:o,mtime:s,size:c}=e,l=n.indexOf(` +`),u=l>=0?n.slice(0,l):n;if(u.includes('"isSidechain":true')||u.includes('"isSidechain": true'))return null;let d=bk(o,"customTitle")||bk(n,"customTitle")||bk(o,"aiTitle")||bk(n,"aiTitle")||void 0,f=Pto(n)||void 0,h=j8r(n,"timestamp"),m;if(h){let v=Date.parse(h);Number.isNaN(v)||(m=v)}let g=d||bk(o,"lastPrompt")||bk(o,"summary")||f;if(!g)return null;let A=bk(o,"gitBranch")||j8r(n,"gitBranch")||void 0,y=j8r(n,"cwd")||r||void 0,E=o.split(` +`).findLast(v=>v.includes('"type":"tag"')&&v.includes('"tag":"')),_=E&&bk(E,"tag")||void 0;return{sessionId:t,summary:g,lastModified:s,fileSize:c,customTitle:d,firstPrompt:f,gitBranch:A,cwd:y,tag:_,createdAt:m}}async function _8e(t,e,r){let n;try{n=await(0,aCe.readdir)(t)}catch{return[]}return(await Promise.all(n.map(async o=>{if(!o.endsWith(".jsonl"))return null;let s=Ih(o.slice(0,-6));if(!s)return null;let c=(0,cCe.join)(t,o);if(!e)return{sessionId:s,filePath:c,mtime:0,projectPath:r};try{let l=await(0,aCe.stat)(c);return{sessionId:s,filePath:c,mtime:l.mtime.getTime(),projectPath:r}}catch{return null}}))).filter(o=>o!==null)}async function Bto(t){let e=await Dto(t.filePath);if(!e)return null;let r=Jwt(t.sessionId,e,t.projectPath);return r?(t.mtime&&(r.lastModified=t.mtime),r):null}function wWc(t,e){return e.mtime!==t.mtime?e.mtime-t.mtime:e.sessionIdt.sessionId?1:0}async function RWc(t,e,r){t.sort(wWc);let n=[],o=e&&e>0?e:1/0,s=0,c=new Set;for(let l=0;ls.lastModified)&&r.set(o.sessionId,o)}let n=[...r.values()];return n.sort((o,s)=>s.lastModified!==o.lastModified?s.lastModified-o.lastModified:s.sessionIdo.sessionId?1:0),n}async function PWc(t,e,r){let n=await l6e(t),o;if(e)try{o=await a6e(n)}catch{o=[]}else o=[];if(o.length<=1){let h=[];for(let m of await $N(n))h.push(...await _8e(m,r,n));return h}let s=IW(),c=process.platform==="win32",l=o.map(h=>{let m=c6e(h);return{path:h,prefix:c?m.toLowerCase():m}});l.sort((h,m)=>m.prefix.length-h.prefix.length);let u;try{u=await(0,aCe.readdir)(s,{withFileTypes:!0})}catch{let h=[];for(let m of await $N(n))h.push(...await _8e(m,r,n));return h}let d=[],f=new Set;for(let h of await $N(n)){let m=(0,cCe.basename)(h);f.add(c?m.toLowerCase():m),d.push(...await _8e(h,r,n))}for(let h of u){if(!h.isDirectory())continue;let m=c?h.name.toLowerCase():h.name;if(!f.has(m)){for(let{path:g,prefix:A}of l)if(m===A||A.length>=O8e&&m.startsWith(A+"-")){f.add(m),d.push(...await _8e((0,cCe.join)(s,h.name),r,g));break}}}return d}async function DWc(t){let e=IW(),r;try{r=await(0,aCe.readdir)(e,{withFileTypes:!0})}catch{return[]}return(await Promise.all(r.filter(n=>n.isDirectory()).map(n=>_8e((0,cCe.join)(e,n.name),t)))).flat()}async function NWc(t){let{dir:e,limit:r,offset:n,includeWorktrees:o}=t??{},s=n??0,c=r!==void 0&&r>0||s>0,l=e?await PWc(e,o??!0,c):await DWc(c);return c?RWc(l,r,s):kWc(l)}async function MWc(t,e={}){let r=Ih(t);if(!r)return;let n=await Kwt(r,e.dir);if(!n)return;let o=await Dto(n.filePath);if(o)return Jwt(r,o,n.projectPath)??void 0}async function OWc(t,e,r={}){if(!Ih(t))throw Error(`Invalid sessionId: ${t}`);if(!e.trim())throw Error("title must be non-empty");let n=$m({type:"custom-title",customTitle:e.trim(),sessionId:t})+` +`;await Fto(t,n,r)}async function LWc(t,e,r={}){if(!Ih(t))throw Error(`Invalid sessionId: ${t}`);if(e!==null){let o=I8e(e).trim();if(!o)throw Error("tag must be non-empty (use null to clear)");e=o}let n=$m({type:"tag",tag:e??"",sessionId:t})+` +`;await Fto(t,n,r)}async function BWc(t,e={}){if(!Ih(t))throw Error(`Invalid sessionId: ${t}`);for(let r of await FWc(e)){let n=(0,soe.join)(r,`${t}.jsonl`),o;try{({size:o}=await(0,YL.stat)(n))}catch(s){let c=BI(s);if(c==="ENOENT"||c==="ENOTDIR")continue;throw s}if(o!==0){await(0,YL.rm)(n,{force:!0}),await(0,YL.rm)((0,soe.join)(r,t),{recursive:!0,force:!0});return}}throw Error(e.dir?`Session ${t} not found in project directory for ${e.dir}`:`Session ${t} not found in any project directory`)}async function FWc(t){if(t.dir){let r=await l6e(t.dir),n=await $N(r),o;try{o=await a6e(r)}catch{o=[]}for(let s of o)s!==r&&n.push(...await $N(s));return n}let e=IW();try{return(await(0,YL.readdir)(e,{withFileTypes:!0})).filter(r=>r.isDirectory()||r.isSymbolicLink()).map(r=>(0,soe.join)(e,r.name))}catch{return[]}}async function Fto(t,e,r){let n=`${t}.jsonl`;if(r.dir){let c=await l6e(r.dir);for(let u of await $N(c))if(await G8r((0,soe.join)(u,n),e))return;let l;try{l=await a6e(c)}catch{l=[]}for(let u of l)if(u!==c){for(let d of await $N(u))if(await G8r((0,soe.join)(d,n),e))return}throw Error(`Session ${t} not found in project directory for ${r.dir}`)}let o=IW(),s;try{s=await(0,YL.readdir)(o)}catch{throw Error(`Session ${t} not found (no projects directory)`)}for(let c of s)if(await G8r((0,soe.join)(o,c,n),e))return;throw Error(`Session ${t} not found in any project directory`)}async function G8r(t,e){let r;try{r=await(0,YL.open)(t,O6r.constants.O_WRONLY|O6r.constants.O_APPEND)}catch(n){let o=BI(n);if(o==="ENOENT"||o==="ENOTDIR")return!1;throw n}try{let{size:n}=await r.stat();if(n===0)return!1;let o=process.platform==="win32"?n:void 0;return await r.write(e,o,"utf8"),!0}finally{await r.close()}}async function UWc(t,e){let r=`${t}.jsonl`;async function n(c){try{let l=await Wxt().readBytes((0,twt.join)(c,r));return l.length===0?null:{buf:l,projectDir:c}}catch{return null}}if(a(n,"Y"),e){let c=await l6e(e);for(let u of await $N(c)){let d=await n(u);if(d)return d}let l;try{l=await a6e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await $N(u)){let f=await n(d);if(f)return f}return null}let o=IW(),s;try{s=await Wxt().list(o)}catch{return null}for(let c of s){let l=await n((0,twt.join)(o,c));if(l)return l}return null}function qWc(t,e){let r=[],n=[],o=10,s=t.length,c=0;for(;c=l)continue;let d=t.toString("utf-8",u,l);try{Uto(ZN(d),e,r,n)}catch{}}return{transcript:r,contentReplacements:n}}function jWc(t,e){let r=[],n=[];for(let o of t)typeof o!="object"||o===null||Uto(o,e,r,n);return{transcript:r,contentReplacements:n}}function Uto(t,e,r,n){QWc.has(t.type)&&typeof t.uuid=="string"?r.push(t):t.type==="content-replacement"&&t.sessionId===e&&Array.isArray(t.replacements)&&n.push(...t.replacements)}async function HWc(t,e={}){if(!Ih(t))throw Error(`Invalid sessionId: ${t}`);if(e.upToMessageId&&!Ih(e.upToMessageId))throw Error(`Invalid upToMessageId: ${e.upToMessageId}`);let r=await UWc(t,e.dir);if(!r)throw Error(e.dir?`Session ${t} not found in project directory for ${e.dir}`:`Session ${t} not found`);let{entries:n,forkedSessionId:o}=GWc(r.buf,t,e);return await M6r((0,twt.join)(r.projectDir,`${o}.jsonl`),n),{sessionId:o}}function GWc(t,e,r){let n=qWc(t,e);return Qto(n,e,r,()=>{let o=t.length,s=t.toString("utf-8",0,Math.min(o,nU)),c=t.toString("utf-8",Math.max(0,o-nU));return bk(c,"customTitle")||bk(s,"customTitle")||bk(c,"aiTitle")||bk(s,"aiTitle")||Pto(s)})}function $Wc(t,e,r){let n=jWc(t,e);return Qto(n,e,r,()=>VWc(t))}function VWc(t){let e,r;for(let n of t){if(typeof n!="object"||n===null)continue;let o=n;typeof o.customTitle=="string"&&o.customTitle&&(e=o.customTitle),typeof o.aiTitle=="string"&&o.aiTitle&&(r=o.aiTitle)}return e||r||nWc(t)||void 0}function Qto(t,e,r,n){let o=t.transcript.filter(m=>!m.isSidechain);if(o.length===0)throw Error(`Session ${e} has no messages to fork`);if(r.upToMessageId){let m=o.findIndex(g=>g.uuid===r.upToMessageId);if(m===-1)throw Error(`Message ${r.upToMessageId} not found in session ${e}`);o=o.slice(0,m+1)}let s=new Map;for(let m of o)s.set(m.uuid,(0,v8e.randomUUID)());let c=o.filter(m=>m.type!=="progress");if(c.length===0)throw Error(`Session ${e} has no messages to fork`);let l=new Map;for(let m of o)l.set(m.uuid,m);let u=(0,v8e.randomUUID)(),d=new Date().toISOString(),f=[];for(let m=0;m0&&f.push({type:"content-replacement",sessionId:u,replacements:t.contentReplacements,uuid:(0,v8e.randomUUID)(),timestamp:d});let h=r.title?.trim();return h||(h=`${n()||"Forked session"} (fork)`),f.push({type:"custom-title",sessionId:u,customTitle:h,uuid:(0,v8e.randomUUID)(),timestamp:d}),{entries:f,forkedSessionId:u}}async function qto(t,e){let r=await Kwt(t,e);if(!r)return null;let n=r.filePath.replace(/\.jsonl$/,"");return(0,rwt.join)(n,"subagents")}async function jto(t){let e=[];async function r(n){let o;try{o=await(0,B8e.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o)if(s.isFile()&&s.name.startsWith("agent-")&&s.name.endsWith(".jsonl")){let c=s.name.slice(6,-6);e.push({agentId:c,filePath:(0,rwt.join)(n,s.name)})}else s.isDirectory()&&await r((0,rwt.join)(n,s.name))}return a(r,"J"),await r(t),e}function WWc(t){let e=[],r=10,n=t.length,o=0;for(;o=s)continue;let l=t.toString("utf-8",c,s);try{let u=ZN(l),d=u.type;(d==="user"||d==="assistant")&&typeof u.uuid=="string"&&e.push(u)}catch{}}return e}function zWc(t){if(t.length===0)return[];let e=new Map;for(let c of t)e.set(c.uuid,c);let r=t.findLast(c=>c.type==="user"||c.type==="assistant");if(!r)return[];let n=[],o=new Set,s=r;for(;s&&!o.has(s.uuid);)o.add(s.uuid),n.push(s),s=s.parentUuid?e.get(s.parentUuid):void 0;return n.reverse(),n}async function YWc(t,e){if(!Ih(t))return[];let r=await qto(t,e?.dir);return r?(await jto(r)).map(n=>n.agentId):[]}async function KWc(t,e,r){if(!Ih(t))return[];if(!e)return[];let n=await qto(t,r?.dir);if(!n)return[];let o=(await jto(n)).find(l=>l.agentId===e);if(!o)return[];let s;try{s=await(0,B8e.readFile)(o.filePath)}catch{return[]}let c;try{let l=o.filePath.replace(/\.jsonl$/,".meta.json");c=ZN(await(0,B8e.readFile)(l,"utf-8")).toolUseId}catch{}return Hto(s,r,c)}function Hto(t,e,r){if(t.length===0)return[];let n=WWc(t),o=zWc(n).filter(s=>s.type==="user"||s.type==="assistant").map(s=>Mto(s,r));return Oto(o,e)}function Vto(t,e){let r=0;for(let n of t)r+=+!!e(n);return r}function Wto(t){return[...new Set(t)]}function JWc(){return"prod"}function nzc(){let t=process.env.CLAUDE_LOCAL_OAUTH_API_BASE?.replace(/\/$/,"")??"http://localhost:8000",e=process.env.CLAUDE_LOCAL_OAUTH_APPS_BASE?.replace(/\/$/,"")??"http://localhost:4000",r=process.env.CLAUDE_LOCAL_OAUTH_CONSOLE_BASE?.replace(/\/$/,"")??"http://localhost:3000";return{BASE_API_URL:t,CONSOLE_AUTHORIZE_URL:`${r}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${e}/oauth/authorize`,CLAUDE_AI_ORIGIN:e,TOKEN_URL:`${t}/v1/oauth/token`,API_KEY_URL:`${t}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${t}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${r}/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code`,CLAUDEAI_SUCCESS_URL:`${r}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${r}/oauth/code/callback`,CLIENT_ID:"22422756-60c9-4084-8eb7-27705fd5cf9a",OAUTH_FILE_SUFFIX:"-local-oauth",MCP_PROXY_URL:"http://localhost:8205",MCP_PROXY_PATH:"/v1/toolbox/shttp/mcp/{server_id}"}}function ozc(){let t=(()=>{switch(JWc()){case"local":return nzc();case"staging":return rzc??wZi;case"prod":return wZi}})(),e=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(e){let n=e.replace(/\/$/,"");if(!izc.includes(n))throw Error("CLAUDE_CODE_CUSTOM_OAUTH_URL is not an approved endpoint.");t={...t,BASE_API_URL:n,CONSOLE_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_ORIGIN:n,TOKEN_URL:`${n}/v1/oauth/token`,API_KEY_URL:`${n}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${n}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,CLAUDEAI_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${n}/oauth/code/callback`,OAUTH_FILE_SUFFIX:"-custom-oauth"}}let r=process.env.CLAUDE_CODE_OAUTH_CLIENT_ID;return r&&(t={...t,CLIENT_ID:r}),t}function azc(t=""){let e=process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR,r=e!==void 0?!e:!process.env.CLAUDE_CONFIG_DIR,n=e!==void 0?e.normalize("NFC"):iCe(),o=r?"":`-${(0,Gto.createHash)("sha256").update(n).digest("hex").substring(0,8)}`;return`Claude Code${ozc().OAUTH_FILE_SUFFIX}${t}${o}`}function lzc(){if(process.platform==="win32")return"claude-code-user";let t;try{t=process.env.USER||(0,$to.userInfo)().username}catch{t="claude-code-user"}return czc.test(t)?t:"claude-code-user"}function L6r(){return dzc}function un(t,e){let r=L6r(),n=B6r({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===F8e?void 0:F8e].filter(o=>!!o)});t.common.issues.push(n)}function Jo(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:a((s,c)=>{let{message:l}=t;return s.code==="invalid_enum_value"?{message:l??c.defaultError}:typeof c.data>"u"?{message:l??n??c.defaultError}:s.code!=="invalid_type"?{message:c.defaultError}:{message:l??r??c.defaultError}},"errorMap"),description:o}}function Kto(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function wzc(t){return new RegExp(`^${Kto(t)}$`)}function Rzc(t){let e=`${Yto}T${Kto(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function kzc(t,e){return!!((e==="v4"||!e)&&vzc.test(t)||(e==="v6"||!e)&&bzc.test(t))}function Pzc(t,e){if(!Azc.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function Dzc(t,e){return!!((e==="v4"||!e)&&Czc.test(t)||(e==="v6"||!e)&&Szc.test(t))}function Nzc(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return s%c/10**o}function vve(t){if(t instanceof UI){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=wk.create(vve(n))}return new UI({...t._def,shape:a(()=>e,"shape")})}else return t instanceof bW?new bW({...t._def,type:vve(t.element)}):t instanceof wk?wk.create(vve(t.unwrap())):t instanceof cU?cU.create(vve(t.unwrap())):t instanceof aU?aU.create(t.items.map(e=>vve(e))):t}function U6r(t,e){let r=pW(t),n=pW(e);if(t===e)return{valid:!0,data:t};if(r===Rn.object&&n===Rn.object){let o=mc.objectKeys(e),s=mc.objectKeys(t).filter(l=>o.indexOf(l)!==-1),c={...t,...e};for(let l of s){let u=U6r(t[l],e[l]);if(!u.valid)return{valid:!1};c[l]=u.data}return{valid:!0,data:c}}else if(r===Rn.array&&n===Rn.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;sr?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}function rC(t){return t&&Object.assign(swt,t),swt}function Ozc(t){return t}function Lzc(t){return t}function Bzc(t){}function Fzc(t){throw Error()}function Uzc(t){}function eUr(t){let e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,n])=>e.indexOf(+r)===-1).map(([r,n])=>n)}function Vr(t,e="|"){return t.map(r=>ls(r)).join(e)}function tro(t,e){return typeof e=="bigint"?e.toString():e}function Zwt(t){return{get value(){{let e=t();return Object.defineProperty(this,"value",{value:e}),e}throw Error("cached value already set")}}}function Aoe(t){return t==null}function Xwt(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function rro(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return s%c/10**o}function Kc(t,e,r){Object.defineProperty(t,e,{get(){{let n=r();return t[e]=n,n}throw Error("cached value already set")},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function tUr(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Qzc(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function qzc(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;se,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:a(()=>e.error,"error")}:e}function $zc(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}function ls(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function oro(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function Vzc(t,e){let r={},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw Error(`Unrecognized key: "${o}"`);e[o]&&(r[o]=n.shape[o])}return XN(t,{...t._zod.def,shape:r,checks:[]})}function Wzc(t,e){let r={...t._zod.def.shape},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw Error(`Unrecognized key: "${o}"`);e[o]&&delete r[o]}return XN(t,{...t._zod.def,shape:r,checks:[]})}function zzc(t,e){if(!K8e(e))throw Error("Invalid input to extend: expected a plain object");let r={...t._zod.def,get shape(){let n={...t._zod.def.shape,...e};return tUr(this,"shape",n),n},checks:[]};return XN(t,r)}function Yzc(t,e){return XN(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return tUr(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function Kzc(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=t?new t({type:"optional",innerType:n[s]}):n[s])}else for(let s in n)o[s]=t?new t({type:"optional",innerType:n[s]}):n[s];return XN(e,{...e._zod.def,shape:o,checks:[]})}function Jzc(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return XN(e,{...e._zod.def,shape:o,checks:[]})}function xve(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function b8e(t){return typeof t=="string"?t:t?.message}function YN(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=b8e(t.inst?._zod.def?.error?.(t))??b8e(e?.error?.(t))??b8e(r.customError?.(t))??b8e(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,!e?.reportInput&&delete n.input,n}function eRt(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function tRt(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function cro(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function Zzc(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function iUr(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}function oUr(t,e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>o({issues:l}));else if(c.code==="invalid_key")o({issues:c.issues});else if(c.code==="invalid_element")o({issues:c.issues});else if(c.path.length===0)n._errors.push(r(c));else{let l=n,u=0;for(;u{var l,u;for(let d of s.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(f=>o({issues:f},d.path));else if(d.code==="invalid_key")o({issues:d.issues},d.path);else if(d.code==="invalid_element")o({issues:d.issues},d.path);else{let f=[...c,...d.path];if(f.length===0){n.errors.push(r(d));continue}let h=n,m=0;for(;mn.path.length-o.path.length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${dro(n.path)}`);return e.join(` +`)}function Cro(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}function Dro(t){return typeof t.precision=="number"?t.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":t.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${t.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Nro(t){return new RegExp(`^${Dro(t)}$`)}function Mro(t){let e=Dro({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${kro}T(?:${n})$`)}function NZi(t,e,r){t.issues.length&&e.issues.push(...Ik(r,t.issues))}function hUr(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function kno(t){if(!dUr.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return hUr(r)}function Nno(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}function MZi(t,e,r){t.issues.length&&e.issues.push(...Ik(r,t.issues)),e.value[r]=t.value}function sxt(t,e,r){t.issues.length&&e.issues.push(...Ik(r,t.issues)),e.value[r]=t.value}function OZi(t,e,r,n){t.issues.length?n[r]===void 0?r in n?e.value[r]=void 0:e.value[r]=t.value:e.issues.push(...Ik(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function LZi(t,e,r,n){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>YN(s,n,rC())))}),e}function H6r(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(K8e(t)&&K8e(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let c=H6r(t[s],e[s]);if(!c.valid)return{valid:!1,mergeErrorPath:[s,...c.mergeErrorPath]};o[s]=c.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;nYN(l,c,rC()))})),e.issues.length&&(awt.has(typeof n)?r.issues.push(...Ik(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>YN(l,c,rC()))})),r.value.set(t.value,e.value)}function UZi(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function QZi(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function qZi(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function jZi(t,e,r){return xve(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}function HZi(t){return t.value=Object.freeze(t.value),t}function GZi(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(cro(o))}}function uYc(){return{localeError:lYc()}}function fYc(){return{localeError:dYc()}}function $Zi(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}function hYc(){return{localeError:pYc()}}function gYc(){return{localeError:mYc()}}function yYc(){return{localeError:AYc()}}function _Yc(){return{localeError:EYc()}}function fio(){return{localeError:CYc()}}function TYc(){return{localeError:SYc()}}function xYc(){return{localeError:IYc()}}function RYc(){return{localeError:wYc()}}function PYc(){return{localeError:kYc()}}function NYc(){return{localeError:DYc()}}function OYc(){return{localeError:MYc()}}function BYc(){return{localeError:LYc()}}function UYc(){return{localeError:FYc()}}function qYc(){return{localeError:QYc()}}function HYc(){return{localeError:jYc()}}function $Yc(){return{localeError:GYc()}}function WYc(){return{localeError:VYc()}}function YYc(){return{localeError:zYc()}}function JYc(){return{localeError:KYc()}}function XYc(){return{localeError:ZYc()}}function tKc(){return{localeError:eKc()}}function nKc(){return{localeError:rKc()}}function oKc(){return{localeError:iKc()}}function aKc(){return{localeError:sKc()}}function lKc(){return{localeError:cKc()}}function dKc(){return{localeError:uKc()}}function VZi(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}function pKc(){return{localeError:fKc()}}function mKc(){return{localeError:hKc()}}function AKc(){return{localeError:gKc()}}function EKc(){return{localeError:yKc()}}function vKc(){return{localeError:_Kc()}}function SKc(){return{localeError:bKc()}}function IKc(){return{localeError:TKc()}}function wKc(){return{localeError:xKc()}}function kKc(){return{localeError:RKc()}}function DKc(){return{localeError:PKc()}}function MKc(){return{localeError:NKc()}}function SUr(){return new J8e}function mio(t,e){return new t({type:"string",...xr(e)})}function gio(t,e){return new t({type:"string",coerce:!0,...xr(e)})}function TUr(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...xr(e)})}function fwt(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...xr(e)})}function IUr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...xr(e)})}function xUr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...xr(e)})}function wUr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...xr(e)})}function RUr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...xr(e)})}function kUr(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...xr(e)})}function PUr(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...xr(e)})}function DUr(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...xr(e)})}function NUr(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...xr(e)})}function MUr(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...xr(e)})}function OUr(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...xr(e)})}function LUr(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...xr(e)})}function BUr(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...xr(e)})}function FUr(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...xr(e)})}function UUr(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...xr(e)})}function QUr(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...xr(e)})}function qUr(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...xr(e)})}function jUr(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...xr(e)})}function HUr(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...xr(e)})}function GUr(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...xr(e)})}function $Ur(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...xr(e)})}function yio(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...xr(e)})}function Eio(t,e){return new t({type:"string",format:"date",check:"string_format",...xr(e)})}function _io(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...xr(e)})}function vio(t,e){return new t({type:"string",format:"duration",check:"string_format",...xr(e)})}function Cio(t,e){return new t({type:"number",checks:[],...xr(e)})}function bio(t,e){return new t({type:"number",coerce:!0,checks:[],...xr(e)})}function Sio(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...xr(e)})}function Tio(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...xr(e)})}function Iio(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...xr(e)})}function xio(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...xr(e)})}function wio(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...xr(e)})}function Rio(t,e){return new t({type:"boolean",...xr(e)})}function kio(t,e){return new t({type:"boolean",coerce:!0,...xr(e)})}function Pio(t,e){return new t({type:"bigint",...xr(e)})}function Dio(t,e){return new t({type:"bigint",coerce:!0,...xr(e)})}function Nio(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...xr(e)})}function Mio(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...xr(e)})}function Oio(t,e){return new t({type:"symbol",...xr(e)})}function Lio(t,e){return new t({type:"undefined",...xr(e)})}function Bio(t,e){return new t({type:"null",...xr(e)})}function Fio(t){return new t({type:"any"})}function pwt(t){return new t({type:"unknown"})}function Uio(t,e){return new t({type:"never",...xr(e)})}function Qio(t,e){return new t({type:"void",...xr(e)})}function qio(t,e){return new t({type:"date",...xr(e)})}function jio(t,e){return new t({type:"date",coerce:!0,...xr(e)})}function Hio(t,e){return new t({type:"nan",...xr(e)})}function poe(t,e){return new fUr({check:"less_than",...xr(e),value:t,inclusive:!1})}function VN(t,e){return new fUr({check:"less_than",...xr(e),value:t,inclusive:!0})}function hoe(t,e){return new pUr({check:"greater_than",...xr(e),value:t,inclusive:!1})}function OI(t,e){return new pUr({check:"greater_than",...xr(e),value:t,inclusive:!0})}function Gio(t){return hoe(0,t)}function $io(t){return poe(0,t)}function Vio(t){return VN(0,t)}function Wio(t){return OI(0,t)}function Z8e(t,e){return new $ro({check:"multiple_of",...xr(e),value:t})}function oRt(t,e){return new zro({check:"max_size",...xr(e),maximum:t})}function X8e(t,e){return new Yro({check:"min_size",...xr(e),minimum:t})}function VUr(t,e){return new Kro({check:"size_equals",...xr(e),size:t})}function sRt(t,e){return new Jro({check:"max_length",...xr(e),maximum:t})}function Kve(t,e){return new Zro({check:"min_length",...xr(e),minimum:t})}function aRt(t,e){return new Xro({check:"length_equals",...xr(e),length:t})}function WUr(t,e){return new eno({check:"string_format",format:"regex",...xr(e),pattern:t})}function zUr(t){return new tno({check:"string_format",format:"lowercase",...xr(t)})}function YUr(t){return new rno({check:"string_format",format:"uppercase",...xr(t)})}function KUr(t,e){return new nno({check:"string_format",format:"includes",...xr(e),includes:t})}function JUr(t,e){return new ino({check:"string_format",format:"starts_with",...xr(e),prefix:t})}function ZUr(t,e){return new ono({check:"string_format",format:"ends_with",...xr(e),suffix:t})}function zio(t,e,r){return new sno({check:"property",property:t,schema:e,...xr(r)})}function XUr(t,e){return new ano({check:"mime_type",mime:t,...xr(e)})}function Eoe(t){return new cno({check:"overwrite",tx:t})}function e7r(t){return Eoe(e=>e.normalize(t))}function t7r(){return Eoe(t=>t.trim())}function r7r(){return Eoe(t=>t.toLowerCase())}function n7r(){return Eoe(t=>t.toUpperCase())}function i7r(t,e,r){return new t({type:"array",element:e,...xr(r)})}function OKc(t,e,r){return new t({type:"union",options:e,...xr(r)})}function LKc(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...xr(n)})}function BKc(t,e,r){return new t({type:"intersection",left:e,right:r})}function Yio(t,e,r,n){let o=r instanceof Co;return new t({type:"tuple",items:e,rest:o?r:null,...xr(o?n:r)})}function FKc(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...xr(n)})}function UKc(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...xr(n)})}function QKc(t,e,r){return new t({type:"set",valueType:e,...xr(r)})}function qKc(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...xr(r)})}function jKc(t,e,r){return new t({type:"enum",entries:e,...xr(r)})}function HKc(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...xr(r)})}function Kio(t,e){return new t({type:"file",...xr(e)})}function GKc(t,e){return new t({type:"transform",transform:e})}function $Kc(t,e){return new t({type:"optional",innerType:e})}function VKc(t,e){return new t({type:"nullable",innerType:e})}function WKc(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}function zKc(t,e,r){return new t({type:"nonoptional",innerType:e,...xr(r)})}function YKc(t,e){return new t({type:"success",innerType:e})}function KKc(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function JKc(t,e,r){return new t({type:"pipe",in:e,out:r})}function ZKc(t,e){return new t({type:"readonly",innerType:e})}function XKc(t,e,r){return new t({type:"template_literal",parts:e,...xr(r)})}function eJc(t,e){return new t({type:"lazy",getter:e})}function tJc(t,e){return new t({type:"promise",innerType:e})}function Jio(t,e,r){let n=xr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function Zio(t,e,r){return new t({type:"custom",check:"custom",fn:e,...xr(r)})}function Xio(t,e){let r=xr(e),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(m=>typeof m=="string"?m.toLowerCase():m),o=o.map(m=>typeof m=="string"?m.toLowerCase():m));let s=new Set(n),c=new Set(o),l=t.Pipe??CUr,u=t.Boolean??gUr,d=t.String??f6e,f=new(t.Transform??vUr)({type:"transform",transform:a((m,g)=>{let A=m;return r.case!=="sensitive"&&(A=A.toLowerCase()),s.has(A)?!0:c.has(A)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...c],input:g.value,inst:f}),{})},"transform"),error:r.error}),h=new l({type:"pipe",in:new d({type:"string",error:r.error}),out:f,error:r.error});return new l({type:"pipe",in:h,out:new u({type:"boolean",error:r.error}),error:r.error})}function eoo(t,e,r,n={}){let o=xr(n),s={...xr(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:c=>r.test(c),...o};return r instanceof RegExp&&(s.pattern=r),new t(s)}function too(t){return new hwt({type:"function",input:Array.isArray(t?.input)?Yio(iRt,t?.input):t?.input??i7r(yUr,pwt(dwt)),output:t?.output??pwt(dwt)})}function o7r(t,e){if(t instanceof J8e){let n=new e6e(e),o={};for(let l of t._idmap.entries()){let[u,d]=l;n.process(d)}let s={},c={registry:t,uri:e?.uri||(l=>l),defs:o};for(let l of t._idmap.entries()){let[u,d]=l;s[u]=n.emit(d,{...e,external:c})}if(Object.keys(o).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:o}}return{schemas:s}}let r=new e6e(e);return r.process(t),r.emit(t,e)}function H0(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;switch(n.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return H0(n.element,r);case"object":{for(let o in n.shape)if(H0(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(H0(o,r))return!0;return!1}case"intersection":return H0(n.left,r)||H0(n.right,r);case"tuple":{for(let o of n.items)if(H0(o,r))return!0;return!!(n.rest&&H0(n.rest,r))}case"record":return H0(n.keyType,r)||H0(n.valueType,r);case"map":return H0(n.keyType,r)||H0(n.valueType,r);case"set":return H0(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return H0(n.innerType,r);case"lazy":return H0(n.getter(),r);case"default":return H0(n.innerType,r);case"prefault":return H0(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return H0(n.in,r)||H0(n.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${n.type}`)}function WZi(t,e){let r={type:"object",get shape(){return zs.assignProp(this,"shape",{...t}),this.shape},...zs.normalizeParams(e)};return new iJc(r)}function JL(t){return!!t._zod}function bve(t){let e=Object.values(t);if(e.length===0)return WZi({});let r=e.every(JL),n=e.every(o=>!JL(o));if(r)return WZi(t);if(n)return Mzc(t);throw Error("Mixed Zod versions detected in object shape.")}function x8e(t,e){return JL(t)?rRt(t,e):t.safeParse(e)}async function V8r(t,e){return JL(t)?await nRt(t,e):await t.safeParseAsync(e)}function p6e(t){if(!t)return;let e;if(JL(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function d8e(t){if(t){if(typeof t=="object"){let e=t,r=t;if(!e._def&&!r._zod){let n=Object.values(t);if(n.length>0&&n.every(o=>typeof o=="object"&&o!==null&&(o._def!==void 0||o._zod!==void 0||typeof o.parse=="function")))return bve(t)}}if(JL(t)){let e=t._zod?.def;if(e&&(e.type==="object"||e.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function W8r(t){if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0){let e=t.issues[0];if(e&&typeof e=="object"&&"message"in e)return String(e.message)}try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function oJc(t){return t.description}function sJc(t){if(JL(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function roo(t){if(JL(t)){let n=t._zod?.def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}}let e=t._def;if(e){if(e.value!==void 0)return e.value;if(Array.isArray(e.values)&&e.values.length>0)return e.values[0]}let r=t.value;if(r!==void 0)return r}function noo(t){return yio(a7r,t)}function ioo(t){return Eio(c7r,t)}function ooo(t){return _io(l7r,t)}function soo(t){return vio(u7r,t)}function Tt(t){return mio(cRt,t)}function cJc(t){return TUr(f7r,t)}function lJc(t){return fwt(mwt,t)}function uJc(t){return IUr(oU,t)}function dJc(t){return xUr(oU,t)}function fJc(t){return wUr(oU,t)}function pJc(t){return RUr(oU,t)}function hJc(t){return kUr(p7r,t)}function mJc(t){return PUr(h7r,t)}function gJc(t){return DUr(m7r,t)}function AJc(t){return NUr(g7r,t)}function yJc(t){return MUr(A7r,t)}function EJc(t){return OUr(y7r,t)}function _Jc(t){return LUr(E7r,t)}function vJc(t){return BUr(_7r,t)}function CJc(t){return FUr(v7r,t)}function bJc(t){return UUr(C7r,t)}function SJc(t){return QUr(b7r,t)}function TJc(t){return qUr(S7r,t)}function IJc(t){return jUr(T7r,t)}function xJc(t){return HUr(I7r,t)}function wJc(t){return GUr(x7r,t)}function RJc(t){return $Ur(w7r,t)}function kJc(t,e,r={}){return eoo(foo,t,e,r)}function Lc(t){return Cio(lRt,t)}function G6r(t){return Sio(lCe,t)}function PJc(t){return Tio(lCe,t)}function DJc(t){return Iio(lCe,t)}function NJc(t){return xio(lCe,t)}function MJc(t){return wio(lCe,t)}function G0(t){return Rio(uRt,t)}function OJc(t){return Pio(dRt,t)}function LJc(t){return Nio(R7r,t)}function BJc(t){return Mio(R7r,t)}function FJc(t){return Oio(poo,t)}function UJc(t){return Lio(hoo,t)}function k7r(t){return Bio(moo,t)}function QJc(){return Fio(goo)}function uf(){return pwt(Aoo)}function fRt(t){return Uio(yoo,t)}function qJc(t){return Qio(Eoo,t)}function jJc(t){return qio(P7r,t)}function Ca(t,e){return i7r(_oo,t,e)}function HJc(t){let e=t._zod.def.shape;return Xn(Object.keys(e))}function Sn(t,e){let r={type:"object",get shape(){return zs.assignProp(this,"shape",{...t}),this.shape},...zs.normalizeParams(e)};return new pRt(r)}function GJc(t,e){return new pRt({type:"object",get shape(){return zs.assignProp(this,"shape",{...t}),this.shape},catchall:fRt(),...zs.normalizeParams(e)})}function Xv(t,e){return new pRt({type:"object",get shape(){return zs.assignProp(this,"shape",{...t}),this.shape},catchall:uf(),...zs.normalizeParams(e)})}function su(t,e){return new D7r({type:"union",options:t,...zs.normalizeParams(e)})}function N7r(t,e,r){return new voo({type:"union",options:e,discriminator:t,...zs.normalizeParams(r)})}function hRt(t,e){return new Coo({type:"intersection",left:t,right:e})}function $Jc(t,e,r){let n=e instanceof Co,o=n?r:e;return new boo({type:"tuple",items:t,rest:n?e:null,...zs.normalizeParams(o)})}function ou(t,e,r){return new M7r({type:"record",keyType:t,valueType:e,...zs.normalizeParams(r)})}function VJc(t,e,r){return new M7r({type:"record",keyType:su([t,fRt()]),valueType:e,...zs.normalizeParams(r)})}function WJc(t,e,r){return new Soo({type:"map",keyType:t,valueType:e,...zs.normalizeParams(r)})}function zJc(t,e){return new Too({type:"set",valueType:t,...zs.normalizeParams(e)})}function F1(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new t6e({type:"enum",entries:r,...zs.normalizeParams(e)})}function YJc(t,e){return new t6e({type:"enum",entries:t,...zs.normalizeParams(e)})}function Xn(t,e){return new Ioo({type:"literal",values:Array.isArray(t)?t:[t],...zs.normalizeParams(e)})}function KJc(t){return Kio(xoo,t)}function L7r(t){return new O7r({type:"transform",transform:t})}function wd(t){return new B7r({type:"optional",innerType:t})}function gwt(t){return new woo({type:"nullable",innerType:t})}function JJc(t){return wd(gwt(t))}function koo(t,e){return new Roo({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function Doo(t,e){return new Poo({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function Noo(t,e){return new F7r({type:"nonoptional",innerType:t,...zs.normalizeParams(e)})}function ZJc(t){return new Moo({type:"success",innerType:t})}function Loo(t,e){return new Ooo({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function XJc(t){return Hio(Boo,t)}function Awt(t,e){return new U7r({type:"pipe",in:t,out:e})}function Uoo(t){return new Foo({type:"readonly",innerType:t})}function eZc(t,e){return new Qoo({type:"template_literal",parts:t,...zs.normalizeParams(e)})}function joo(t){return new qoo({type:"lazy",getter:t})}function tZc(t){return new Hoo({type:"promise",innerType:t})}function Goo(t,e){let r=new xh({check:"custom",...zs.normalizeParams(e)});return r._zod.check=t,r}function $oo(t,e){return Jio(mRt,t??(()=>!0),e)}function Voo(t,e={}){return Zio(mRt,t,e)}function Woo(t,e){let r=Goo(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(zs.issue(o,n.value,r._zod.def));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(zs.issue(s))}},t(n.value,n)),e);return r}function rZc(t,e={error:`Input not instance of ${t.name}`}){let r=new mRt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...zs.normalizeParams(e)});return r._zod.bag.Class=t,r}function iZc(t){let e=joo(()=>su([Tt(t),Lc(),G0(),k7r(),Ca(e),ou(Tt(),e)]));return e}function Q7r(t,e){return Awt(L7r(t),e)}function sZc(t){rC({customError:t})}function aZc(){return rC().customError}function cZc(t){return gio(cRt,t)}function lZc(t){return bio(lRt,t)}function uZc(t){return kio(uRt,t)}function dZc(t){return Dio(dRt,t)}function fZc(t){return jio(P7r,t)}function qXc(t){if(t.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function jXc(t){if(t.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}function Xie(t){return t==="completed"||t==="failed"||t==="cancelled"}function fso(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function yl(t,e,r,n,o){t[e]=r,fso(t,e,n,o)}function B1(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?pso(e,t.currentPath):e.join("/")}}function KXc(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==Cr.ZodAny&&(r.items=Oc(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&yl(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&yl(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(yl(r,"minItems",t.exactLength.value,t.exactLength.message,e),yl(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function JXc(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?yl(r,"minimum",n.value,n.message,e):yl(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),yl(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?yl(r,"maximum",n.value,n.message,e):yl(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),yl(r,"maximum",n.value,n.message,e));break;case"multipleOf":yl(r,"multipleOf",n.value,n.message,e);break}return r}function ZXc(){return{type:"boolean"}}function hso(t,e){return Oc(t.type._def,e)}function mso(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,s)=>mso(t,e,o))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return eel(t,e)}}function tel(t,e){return{...Oc(t.innerType._def,e),default:t.defaultValue()}}function rel(t,e){return e.effectStrategy==="input"?Oc(t.schema._def,e):B1(e)}function nel(t){return{type:"string",enum:Array.from(t.values)}}function oel(t,e){let r=[Oc(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Oc(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(s=>{if(iel(s))o.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let c=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:l,...u}=s;c=u}else n=void 0;o.push(c)}}),o.length?{allOf:o,...n}:void 0}function sel(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}function gso(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":yl(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":yl(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":GN(r,"email",n.message,e);break;case"format:idn-email":GN(r,"idn-email",n.message,e);break;case"pattern:zod":Zv(r,HN.email,n.message,e);break}break;case"url":GN(r,"uri",n.message,e);break;case"uuid":GN(r,"uuid",n.message,e);break;case"regex":Zv(r,n.regex,n.message,e);break;case"cuid":Zv(r,HN.cuid,n.message,e);break;case"cuid2":Zv(r,HN.cuid2,n.message,e);break;case"startsWith":Zv(r,RegExp(`^${Y8r(n.value,e)}`),n.message,e);break;case"endsWith":Zv(r,RegExp(`${Y8r(n.value,e)}$`),n.message,e);break;case"datetime":GN(r,"date-time",n.message,e);break;case"date":GN(r,"date",n.message,e);break;case"time":GN(r,"time",n.message,e);break;case"duration":GN(r,"duration",n.message,e);break;case"length":yl(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),yl(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{Zv(r,RegExp(Y8r(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&GN(r,"ipv4",n.message,e),n.version!=="v4"&&GN(r,"ipv6",n.message,e);break}case"base64url":Zv(r,HN.base64url,n.message,e);break;case"jwt":Zv(r,HN.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&Zv(r,HN.ipv4Cidr,n.message,e),n.version!=="v4"&&Zv(r,HN.ipv6Cidr,n.message,e);break}case"emoji":Zv(r,HN.emoji(),n.message,e);break;case"ulid":{Zv(r,HN.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{GN(r,"binary",n.message,e);break}case"contentEncoding:base64":{yl(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{Zv(r,HN.base64,n.message,e);break}}break}case"nanoid":Zv(r,HN.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function Y8r(t,e){return e.patternStrategy==="escape"?cel(t):t}function cel(t){let e="";for(let r=0;ro.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&n.errorMessages&&{errorMessage:{format:r}}})):yl(t,"format",e,r,n)}function Zv(t,e,r,n){t.pattern||t.allOf?.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:KZi(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):yl(t,"pattern",KZi(e,n),r,n)}function KZi(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=r.i?t.source.toLowerCase():t.source,o="",s=!1,c=!1,l=!1;for(let u=0;u({...n,[o]:Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",o]})??D1(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===Cr.ZodString&&t.keyType._def.checks?.length){let{type:n,...o}=Aio(t.keyType._def,e);return{...r,propertyNames:o}}else{if(t.keyType?._def.typeName===Cr.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===Cr.ZodBranded&&t.keyType._def.type._def.typeName===Cr.ZodString&&t.keyType._def.type._def.checks?.length){let{type:n,...o}=mio(t.keyType._def,e);return{...r,propertyNames:o}}}return r}function yJc(t,e){if(e.mapStrategy==="record")return yio(t,e);let r=Dc(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||D1(e),n=Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||D1(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function EJc(t){let e=t.values,r=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),n=Array.from(new Set(r.map(o=>typeof o)));return{type:n.length===1?n[0]==="string"?"string":"number":["string","number"],enum:r}}function _Jc(t){return t.target==="openAi"?void 0:{not:D1({...t,currentPath:[...t.currentPath,"not"]})}}function vJc(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}function CJc(t,e){if(e.target==="openApi3")return ZKi(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in Xxt&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,s)=>{let c=Xxt[s._def.typeName];return c&&!o.includes(c)?[...o,c]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((o,s)=>{let c=typeof s._def.value;switch(c){case"string":case"number":case"boolean":return[...o,c];case"bigint":return[...o,"integer"];case"object":if(s._def.value===null)return[...o,"null"];default:return o}},[]);if(n.length===r.length){let o=n.filter((s,c,l)=>l.indexOf(s)===c);return{type:o.length>1?o:o[0],enum:r.reduce((s,c)=>s.includes(c._def.value)?s:[...s,c._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(s=>!n.includes(s))],[])};return ZKi(t,e)}function bJc(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Xxt[t.innerType._def.typeName],nullable:!0}:{type:[Xxt[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=Dc(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=Dc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function SJc(t,e){let r={type:"number"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",pio(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?Al(r,"minimum",n.value,n.message,e):Al(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Al(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Al(r,"maximum",n.value,n.message,e):Al(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Al(r,"maximum",n.value,n.message,e));break;case"multipleOf":Al(r,"multipleOf",n.value,n.message,e);break}return r}function TJc(t,e){let r=e.target==="openAi",n={type:"object",properties:{}},o=[],s=t.shape();for(let l in s){let u=s[l];if(u===void 0||u._def===void 0)continue;let d=xJc(u);d&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),d=!1);let f=Dc(u._def,{...e,currentPath:[...e.currentPath,"properties",l],propertyPath:[...e.currentPath,"properties",l]});f!==void 0&&(n.properties[l]=f,!d&&o.push(l))}o.length&&(n.required=o);let c=IJc(t,e);return c!==void 0&&(n.additionalProperties=c),n}function IJc(t,e){if(t.catchall._def.typeName!=="ZodNever")return Dc(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function xJc(t){try{return t.isOptional()}catch{return!0}}function kJc(t,e){return Dc(t.type._def,e)}function PJc(t,e){let r={type:"array",uniqueItems:!0,items:Dc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&Al(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&Al(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}function DJc(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>Dc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:Dc(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>Dc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function NJc(t){return{not:D1(t)}}function MJc(t){return D1(t)}function Dc(t,e,r=!1){let n=e.seen.get(t);if(e.override){let l=e.override?.(t,e,n,r);if(l!==rJc)return l}if(n&&!r){let l=BJc(n,e);if(l!==void 0)return l}let o={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,o);let s=LJc(t,t.typeName,e),c=typeof s=="function"?Dc(s(),e):s;if(c&&FJc(t,e,c),e.postProcess){let l=e.postProcess(c,t,e);return o.jsonSchema=c,l}return o.jsonSchema=c,c}function QJc(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function XKi(t,e){return VL(t)?eUr(t,{target:QJc(e?.target),io:e?.pipeStrategy??"input"}):UJc(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function eJi(t){let e=j8e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=nno(e);if(typeof r!="string")throw Error("Schema method literal must be a string");return r}function tJi(t,e){let r=r8e(t,e);if(!r.success)throw r.error;return r.data}function rJi(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function jJc(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let c=r[o];rJi(c)&&rJi(s)?r[o]={...c,...s}:r[o]=s}return r}function $Jc(){let t=new HJc.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return GJc.default(t),t}function VJc(t,e,r){if(!t)throw Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function WJc(t,e,r){if(!t)throw Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}function nJi(t){return!!t&&typeof t=="object"&&Eio in t}function zJc(t){return t[Eio]?.complete}function KJc(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!YJc.test(t)){let r=t.split("").filter(n=>!/[A-Za-z0-9._-]/.test(n)).filter((n,o,s)=>s.indexOf(n)===o);return e.push(`Tool name contains invalid characters: ${r.map(n=>`"${n}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}function JJc(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function oJi(t){let e=KJc(t);return JJc(t,e.warnings),e.isValid}function _io(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function vio(t){return"_def"in t||"_zod"in t||_io(t)}function e6r(t){return typeof t!="object"||t===null||vio(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(_io)}function sJi(t){if(t){if(e6r(t))return nve(t);if(!vio(t))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function XJc(t){let e=j8e(t);return e?Object.entries(e).map(([r,n])=>{let o=hzc(n),s=mzc(n);return{name:r,description:o,required:!s}}):[]}function XV(t){let e=j8e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=nno(e);if(typeof r=="string")return r;throw Error("Schema method literal must be a string")}function aJi(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}function eZc(t,e,r,n,o){let s={};return o?.searchHint&&(s["anthropic/searchHint"]=o.searchHint),o?.alwaysLoad&&(s["anthropic/alwaysLoad"]=!0),{name:t,description:e,inputSchema:r,handler:n,annotations:o?.annotations,_meta:Object.keys(s).length>0?s:void 0}}function tZc(t){let e=new X8r({name:t.name,version:t.version??"1.0.0"},{capabilities:{tools:t.tools?{}:void 0},instructions:t.instructions});return t.tools&&t.tools.forEach(r=>{for(let n of Object.values(r.inputSchema)){if(!rZc(n))continue;let o=n.description;o&&!V9.has(n)&&V9.add(n,{description:o})}e.registerTool(r.name,{description:r.description,inputSchema:r.inputSchema,annotations:r.annotations,_meta:t.alwaysLoad?{"anthropic/alwaysLoad":!0,...r._meta}:r._meta},r.handler)}),{type:"sdk",name:t.name,instance:e}}function rZc(t){return typeof t=="object"&&t!==null&&"_zod"in t}function wr(t){let e;return()=>e??=t()}function iZc(t){if(t.startsWith("cc://")){let n=t.slice(5),o=new URL(`http://${n}`),s=o.pathname.slice(1)||void 0;return{serverUrl:`http://${o.host}`,authToken:s}}if(t.startsWith("cc+unix://"))throw new mk("Unix socket connect (cc+unix://) is not supported by the SDK transport");let e=/^https?:\/\//i.test(t)?t:`http://${t}`,r=new URL(e);return{serverUrl:`${r.protocol}//${r.host}`,authToken:void 0}}async function oZc(t){let e={"content-type":"application/json"};t.authToken&&(e.authorization=`Bearer ${t.authToken}`);let r={};t.cwd&&(r.cwd=t.cwd),t.sessionKey&&(r.session_key=t.sessionKey),t.permissionMode&&(r.permission_mode=t.permissionMode);let n;try{n=await fetch(`${t.serverUrl}/sessions`,{method:"POST",headers:e,body:Qm(r)})}catch(s){throw new mk(`Failed to connect to server at ${t.serverUrl}: ${s instanceof Error?s.message:String(s)}`,"session_create_failed")}if(!n.ok){let s=await n.text().catch(()=>"");throw new mk(`Failed to create session: ${n.status} ${n.statusText}${s?` \u2014 ${s}`:""}`,"session_create_failed")}let o=nZc().safeParse(await n.json());if(!o.success)throw new mk(`Invalid session response: ${o.error.message}`,"session_create_invalid_response");return{sessionId:o.data.session_id,wsUrl:o.data.ws_url,workDir:o.data.work_dir}}async function lJi(t,e,r){let n={};r&&(n.authorization=`Bearer ${r}`);try{await fetch(`${t}/sessions/${e}`,{method:"DELETE",headers:n})}catch{}}function r6r(t,e,r){let n=sZc();if(!n)return;let o={timestamp:new Date().toISOString(),level:t,event:e,data:r??{}},s=DI(),c=Qm(o)+` -`;try{s.appendFileSync(n,c)}catch{try{s.mkdirSync((0,bio.dirname)(n)),s.appendFileSync(n,c)}catch{}}}function sZc(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}function aZc(t){let{buffer:e,bytesRead:r}=DI().readSync(t,{length:4096});return r===0?"utf8":r>=2&&e[0]===255&&e[1]===254?"utf16le":(r>=3&&e[0]===239&&e[1]===187&&e[2]===191,"utf8")}function cZc(t){let e=0,r=0;for(let n=0;n0&&t[n-1]==="\r"?e++:r++);return e>r?"CRLF":"LF"}function lZc(t){let e=DI(),{resolvedPath:r,isSymlink:n}=mXi(e,t);n&&ru(`Reading through symlink: ${t} -> ${r}`);let o=aZc(r),s=e.readFileSync(r,{encoding:o}),c=cZc(s.slice(0,4096));return{content:s.replaceAll(`\r +]`;continue}o+=n[u],n[u]==="\\"?s=!0:c&&n[u]==="]"?c=!1:!c&&n[u]==="["&&(c=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return o}function Aso(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===Cr.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((n,o)=>({...n,[o]:Oc(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",o]})??B1(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:Oc(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===Cr.ZodString&&t.keyType._def.checks?.length){let{type:n,...o}=gso(t.keyType._def,e);return{...r,propertyNames:o}}else{if(t.keyType?._def.typeName===Cr.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===Cr.ZodBranded&&t.keyType._def.type._def.typeName===Cr.ZodString&&t.keyType._def.type._def.checks?.length){let{type:n,...o}=hso(t.keyType._def,e);return{...r,propertyNames:o}}}return r}function lel(t,e){if(e.mapStrategy==="record")return Aso(t,e);let r=Oc(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||B1(e),n=Oc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||B1(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function uel(t){let e=t.values,r=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),n=Array.from(new Set(r.map(o=>typeof o)));return{type:n.length===1?n[0]==="string"?"string":"number":["string","number"],enum:r}}function del(t){return t.target==="openAi"?void 0:{not:B1({...t,currentPath:[...t.currentPath,"not"]})}}function fel(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}function pel(t,e){if(e.target==="openApi3")return JZi(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in bwt&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,s)=>{let c=bwt[s._def.typeName];return c&&!o.includes(c)?[...o,c]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((o,s)=>{let c=typeof s._def.value;switch(c){case"string":case"number":case"boolean":return[...o,c];case"bigint":return[...o,"integer"];case"object":if(s._def.value===null)return[...o,"null"];default:return o}},[]);if(n.length===r.length){let o=n.filter((s,c,l)=>l.indexOf(s)===c);return{type:o.length>1?o:o[0],enum:r.reduce((s,c)=>s.includes(c._def.value)?s:[...s,c._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(s=>!n.includes(s))],[])};return JZi(t,e)}function hel(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:bwt[t.innerType._def.typeName],nullable:!0}:{type:[bwt[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=Oc(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=Oc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function mel(t,e){let r={type:"number"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",fso(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?yl(r,"minimum",n.value,n.message,e):yl(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),yl(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?yl(r,"maximum",n.value,n.message,e):yl(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),yl(r,"maximum",n.value,n.message,e));break;case"multipleOf":yl(r,"multipleOf",n.value,n.message,e);break}return r}function gel(t,e){let r=e.target==="openAi",n={type:"object",properties:{}},o=[],s=t.shape();for(let l in s){let u=s[l];if(u===void 0||u._def===void 0)continue;let d=yel(u);d&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),d=!1);let f=Oc(u._def,{...e,currentPath:[...e.currentPath,"properties",l],propertyPath:[...e.currentPath,"properties",l]});f!==void 0&&(n.properties[l]=f,!d&&o.push(l))}o.length&&(n.required=o);let c=Ael(t,e);return c!==void 0&&(n.additionalProperties=c),n}function Ael(t,e){if(t.catchall._def.typeName!=="ZodNever")return Oc(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function yel(t){try{return t.isOptional()}catch{return!0}}function vel(t,e){return Oc(t.type._def,e)}function Cel(t,e){let r={type:"array",uniqueItems:!0,items:Oc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&yl(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&yl(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}function bel(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>Oc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:Oc(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>Oc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function Sel(t){return{not:B1(t)}}function Tel(t){return B1(t)}function Oc(t,e,r=!1){let n=e.seen.get(t);if(e.override){let l=e.override?.(t,e,n,r);if(l!==WXc)return l}if(n&&!r){let l=wel(n,e);if(l!==void 0)return l}let o={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,o);let s=xel(t,t.typeName,e),c=typeof s=="function"?Oc(s(),e):s;if(c&&Rel(t,e,c),e.postProcess){let l=e.postProcess(c,t,e);return o.jsonSchema=c,l}return o.jsonSchema=c,c}function Pel(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function ZZi(t,e){return JL(t)?o7r(t,{target:Pel(e?.target),io:e?.pipeStrategy??"input"}):kel(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function XZi(t){let e=p6e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=roo(e);if(typeof r!="string")throw Error("Schema method literal must be a string");return r}function eXi(t,e){let r=x8e(t,e);if(!r.success)throw r.error;return r.data}function tXi(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Nel(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let c=r[o];tXi(c)&&tXi(s)?r[o]={...c,...s}:r[o]=s}return r}function Lel(){let t=new Mel.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Oel.default(t),t}function Bel(t,e,r){if(!t)throw Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function Fel(t,e,r){if(!t)throw Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}function rXi(t){return!!t&&typeof t=="object"&&yso in t}function Uel(t){return t[yso]?.complete}function qel(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!Qel.test(t)){let r=t.split("").filter(n=>!/[A-Za-z0-9._-]/.test(n)).filter((n,o,s)=>s.indexOf(n)===o);return e.push(`Tool name contains invalid characters: ${r.map(n=>`"${n}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}function jel(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function iXi(t){let e=qel(t);return jel(t,e.warnings),e.isValid}function Eso(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function _so(t){return"_def"in t||"_zod"in t||Eso(t)}function o9r(t){return typeof t!="object"||t===null||_so(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(Eso)}function oXi(t){if(t){if(o9r(t))return bve(t);if(!_so(t))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function Gel(t){let e=p6e(t);return e?Object.entries(e).map(([r,n])=>{let o=oJc(n),s=sJc(n);return{name:r,description:o,required:!s}}):[]}function dW(t){let e=p6e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=roo(e);if(typeof r=="string")return r;throw Error("Schema method literal must be a string")}function sXi(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}function $el(t,e,r,n,o){let s={};return o?.searchHint&&(s["anthropic/searchHint"]=o.searchHint),o?.alwaysLoad&&(s["anthropic/alwaysLoad"]=!0),{name:t,description:e,inputSchema:r,handler:n,annotations:o?.annotations,_meta:Object.keys(s).length>0?s:void 0}}function Vel(t){let e=new i9r({name:t.name,version:t.version??"1.0.0"},{capabilities:{tools:t.tools?{}:void 0},instructions:t.instructions});return t.tools&&t.tools.forEach(r=>{for(let n of Object.values(r.inputSchema)){if(!Wel(n))continue;let o=n.description;o&&!iU.has(n)&&iU.add(n,{description:o})}e.registerTool(r.name,{description:r.description,inputSchema:r.inputSchema,annotations:r.annotations,_meta:t.alwaysLoad?{"anthropic/alwaysLoad":!0,...r._meta}:r._meta},r.handler)}),{type:"sdk",name:t.name,instance:e}}function Wel(t){return typeof t=="object"&&t!==null&&"_zod"in t}function wr(t){let e;return()=>e??=t()}function Yel(t){if(t.startsWith("cc://")){let n=t.slice(5),o=new URL(`http://${n}`),s=o.pathname.slice(1)||void 0;return{serverUrl:`http://${o.host}`,authToken:s}}if(t.startsWith("cc+unix://"))throw new Sk("Unix socket connect (cc+unix://) is not supported by the SDK transport");let e=/^https?:\/\//i.test(t)?t:`http://${t}`,r=new URL(e);return{serverUrl:`${r.protocol}//${r.host}`,authToken:void 0}}async function Kel(t){let e={"content-type":"application/json"};t.authToken&&(e.authorization=`Bearer ${t.authToken}`);let r={};t.cwd&&(r.cwd=t.cwd),t.sessionKey&&(r.session_key=t.sessionKey),t.permissionMode&&(r.permission_mode=t.permissionMode);let n;try{n=await fetch(`${t.serverUrl}/sessions`,{method:"POST",headers:e,body:$m(r)})}catch(s){throw new Sk(`Failed to connect to server at ${t.serverUrl}: ${s instanceof Error?s.message:String(s)}`,"session_create_failed")}if(!n.ok){let s=await n.text().catch(()=>"");throw new Sk(`Failed to create session: ${n.status} ${n.statusText}${s?` \u2014 ${s}`:""}`,"session_create_failed")}let o=zel().safeParse(await n.json());if(!o.success)throw new Sk(`Invalid session response: ${o.error.message}`,"session_create_invalid_response");return{sessionId:o.data.session_id,wsUrl:o.data.ws_url,workDir:o.data.work_dir}}async function cXi(t,e,r){let n={};r&&(n.authorization=`Bearer ${r}`);try{await fetch(`${t}/sessions/${e}`,{method:"DELETE",headers:n})}catch{}}function a9r(t,e,r){let n=Jel();if(!n)return;let o={timestamp:new Date().toISOString(),level:t,event:e,data:r??{}},s=FI(),c=$m(o)+` +`;try{s.appendFileSync(n,c)}catch{try{s.mkdirSync((0,Cso.dirname)(n)),s.appendFileSync(n,c)}catch{}}}function Jel(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}function Zel(t){let{buffer:e,bytesRead:r}=FI().readSync(t,{length:4096});return r===0?"utf8":r>=2&&e[0]===255&&e[1]===254?"utf16le":(r>=3&&e[0]===239&&e[1]===187&&e[2]===191,"utf8")}function Xel(t){let e=0,r=0;for(let n=0;n0&&t[n-1]==="\r"?e++:r++);return e>r?"CRLF":"LF"}function etl(t){let e=FI(),{resolvedPath:r,isSymlink:n}=hto(e,t);n&&nu(`Reading through symlink: ${t} -> ${r}`);let o=Zel(r),s=e.readFileSync(r,{encoding:o}),c=Xel(s.slice(0,4096));return{content:s.replaceAll(`\r `,` -`),encoding:o,lineEndings:c}}function Ywt(t){return lZc(t).content}function Sio(t){return t.startsWith("\uFEFF")?t.slice(1):t}function pZc(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),ewt.default.platform==="darwin"?uZc(t):ewt.default.platform==="win32"?dZc(t):fZc(t)}function hZc(){return process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC?"essential-traffic":process.env.DISABLE_TELEMETRY||s_(process.env.DO_NOT_TRACK)?"no-telemetry":"default"}function mZc(){return hZc()==="essential-traffic"}function AZc(t){$Fr.length>=gZc&&$Fr.shift(),$Fr.push(t)}function Tio(t){let e=M8e(t);try{if(s_(process.env.CLAUDE_CODE_USE_BEDROCK)||s_(process.env.CLAUDE_CODE_USE_VERTEX)||s_(process.env.CLAUDE_CODE_USE_FOUNDRY)||s_(process.env.CLAUDE_CODE_USE_ANTHROPIC_AWS)||s_(process.env.CLAUDE_CODE_USE_MANTLE)||process.env.DISABLE_ERROR_REPORTING||mZc())return;let r={error:e.stack||e.message,timestamp:new Date().toISOString()};if(AZc(r),mJi===null){yZc.push({type:"error",error:e});return}mJi.logError(e)}catch{}}function _Zc(t,e,r=100){let n=new o6r({max:r}),o=a((...s)=>{let c=e(...s),l=n.get(c);if(l!==void 0)return l;let u=t(...s);return n.set(c,u),u},"X");return o.cache={clear:a(()=>n.clear(),"clear"),size:a(()=>n.size,"size"),delete:a(s=>n.delete(s),"delete"),get:a(s=>n.peek(s),"get"),has:a(s=>n.has(s),"has")},o}function Rio(t,e){try{return{ok:!0,value:JSON.parse(Sio(t))}}catch(r){return e&&Tio(r),{ok:!1}}}function NZc(){let t=G.object({type:G.literal("command").describe("Shell command hook type"),command:G.string().describe("Shell command to execute"),args:G.array(G.string()).optional().describe("Argument list for exec form. When present, `command` is resolved as an executable and spawned directly with these arguments \u2014 no shell. Path placeholders like ${CLAUDE_PLUGIN_ROOT} are substituted per-element as plain strings, so paths with quotes, $, or backticks never reach a shell parser. When absent, `command` runs through a shell (bash on POSIX, PowerShell on Windows without Git Bash)."),if:jFe(),shell:G.enum(DZc).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:G.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:G.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:G.string().min(1).optional().describe("@internal Custom prefix for the system-reminder shown to the model when an asyncRewake hook exits with code 2. The hook output is appended after this prefix."),rewakeSummary:G.string().min(1).optional().describe('@internal One-line summary shown to the user in the terminal when an asyncRewake hook exits with code 2. Defaults to "Stop hook feedback".')}),e=G.object({type:G.literal("prompt").describe("LLM prompt hook type"),prompt:G.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:jFe(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:G.string().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-4-6"). If not specified, uses the default small fast model.'),continueOnBlock:G.boolean().optional().describe(`Sets the continue value for the decision:"block" produced when ok is false. Default false (turn ends). Whether continue:true lets the turn proceed depends on the event's decision:"block" semantics. On PostToolUse, the reason is fed back to Claude and the turn continues.`),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),r=G.object({type:G.literal("mcp_tool").describe("MCP tool hook type"),server:G.string().describe("Name of an already-configured MCP server to invoke"),tool:G.string().describe("Name of the tool on that server to call"),input:G.record(G.string(),G.unknown()).optional().describe('Arguments passed to the MCP tool. String values support ${path} interpolation from the hook input JSON (e.g. "${tool_input.file_path}").'),if:jFe(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),n=G.object({type:G.literal("http").describe("HTTP hook type"),url:G.string().url().describe("URL to POST the hook input JSON to"),if:jFe(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific request"),headers:G.record(G.string(),G.string()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:G.array(G.string()).optional().describe("Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),o=G.object({type:G.literal("agent").describe("Agentic verifier hook type"),prompt:G.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:jFe(),timeout:G.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:G.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-4-6"). If not specified, uses Haiku.'),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:t,PromptHookSchema:e,HttpHookSchema:n,AgentHookSchema:o,McpToolHookSchema:r}}function zZc(t){return Nio.has(t.toLowerCase())?!1:WZc.test(t)?!0:VZc.test(t)}function AXc(t){let e=mXc();return t.flatMap((r,n)=>{let o=e.safeParse(r);if(o.success)return[o.data];let s=gXc().safeParse(r).data?.name,c=o.error.issues.map(l=>`${l.path.join(".")}: ${l.message}`).join(", ");return s?(ru(`Stubbing unparseable marketplace plugin entry (${s}): ${c}`,{level:"warn"}),[{name:s,source:{source:"unsupported"},strict:!0}]):(ru(`Dropping unparseable marketplace plugin entry (index ${n}): ${c}`,{level:"warn"}),[])})}function jio(){return wXc.filter(t=>Zwt[t].buildGate())}function RXc(t){let e={};for(let r of t)e={...e,...Zwt[r].shape()};return e}function kXc(t){let e={};for(let r of t)e={...e,...Zwt[r].permissionsShape?.()};return e}function PXc(t){let e=[];for(let r of t)e.push(...Zwt[r].permissionModes?.()??[]);return e}function DXc(t){let e=t.split("__"),[r,n,...o]=e;if(r!=="mcp"||!n)return null;let s=o.length>0?o.join("__"):void 0;return{serverName:n,toolName:s}}function X_e(t){return Object.hasOwn(vJi,t)?vJi[t]:t}function NXc(t){return t.replaceAll("\\(","(").replaceAll("\\)",")").replaceAll("\\\\","\\")}function MXc(t){let e=OXc(t,"(");if(e===-1)return{toolName:X_e(t)};let r=LXc(t,")");if(r===-1||r<=e)return{toolName:X_e(t)};if(r!==t.length-1)return{toolName:X_e(t)};let n=t.substring(0,e),o=t.substring(e+1,r);if(!n)return{toolName:X_e(t)};if(o===""||o==="*")return{toolName:X_e(n)};let s=NXc(o);return{toolName:X_e(n),ruleContent:s}}function OXc(t,e){for(let r=0;r=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function LXc(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]===e){let n=0,o=r-1;for(;o>=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function BXc(t){return iwt.filePatternTools.includes(t)}function FXc(t){return iwt.bashPrefixTools.includes(t)}function UXc(t){return Object.hasOwn(iwt.customValidation,t)?iwt.customValidation[t]:void 0}function Gio(t,e){let r=0,n=e-1;for(;n>=0&&t[n]==="\\";)r++,n--;return r%2!==0}function WFr(t,e){let r=0;for(let n=0;n0?{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${n.toolName}" without parentheses, or use "mcp__${o.serverName}__*" for all tools`,examples:[`mcp__${o.serverName}`,`mcp__${o.serverName}__*`,o.toolName&&o.toolName!=="*"?`mcp__${o.serverName}__${o.toolName}`:void 0].filter(Boolean)}:{valid:!0};if(!n.toolName||n.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(!n.toolName.includes("_")&&n.toolName[0]!==n.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${THc(String(n.toolName))}"`};let s=UXc(n.toolName);if(s&&n.ruleContent!==void 0){let c=s(n.ruleContent);if(!c.valid)return c}if(FXc(n.toolName)&&n.ruleContent!==void 0){let c=n.ruleContent;if(c.includes(":*")&&!c.endsWith(":*"))return{valid:!1,error:"The :* pattern must be at the end",suggestion:"Move :* to the end for prefix matching, or use * for wildcard matching",examples:["Bash(npm run:*) - prefix matching (legacy)","Bash(npm run *) - wildcard matching"]};if(c===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]}}if(BXc(n.toolName)&&n.ruleContent!==void 0){let c=n.ruleContent;if(c.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${n.toolName}(*.ts) - matches .ts files`,`${n.toolName}(src/**) - matches all files in src`,`${n.toolName}(**/*.test.ts) - matches test files`]};if(c.includes("*")&&!c.match(/^\*|\*$|\*\*|\/\*|\*\.|\*\)/)&&!c.includes("**"))return{valid:!1,error:"Wildcard placement might be incorrect",suggestion:"Wildcards are typically used at path boundaries",examples:[`${n.toolName}(*.js) - all .js files`,`${n.toolName}(src/*) - all files directly in src`,`${n.toolName}(src/**) - all files recursively in src`]}}return{valid:!0}}function Vio(t){return G.object({allow:G.array(zFr()).optional().describe("List of permission rules for allowed operations"),deny:G.array(zFr()).optional().describe("List of permission rules for denied operations"),ask:G.array(zFr()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:G.enum([...s7r,...PXc(t)]).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:G.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),...kXc(t),additionalDirectories:G.array(G.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}function GXc(t){return G.object({$schema:G.literal(xXc).optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:G.string().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:G.string().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:G.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:G.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:G.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),policyHelper:HXc().optional().describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),...s_(process.env.CLAUDE_CODE_ENABLE_XAA)&&{xaaIdp:G.object({issuer:G.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:G.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:G.number().int().positive().optional().describe("Fixed loopback callback port for the IdP OIDC login. Only needed if the IdP does not honor RFC 8252 port-any matching.")}).optional().describe("XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.")},fileSuggestion:G.object({type:G.literal("command"),command:G.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:G.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:G.object({enabled:G.boolean().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:G.number().int().positive().optional().describe("Minutes of continuous use before the reminder fires (default 120). Re-fires every interval until you take a break."),breakThresholdMinutes:G.number().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 15)"),message:G.string().optional().describe("Custom reminder text. Leave unset for a rotating set of friendly nudges.")}).optional().describe("@internal Opt-in break reminder. When enabled, shows a dismissible nudge after sustained continuous use. Never blocks \u2014 just a friendly heads-up."),quietHours:G.object({enabled:G.boolean().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:G.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "22:00")').optional().describe('Start of the quiet-hours window, 24-hour local time "HH:MM".'),end:G.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "07:00")').optional().describe('End of the quiet-hours window, 24-hour local time "HH:MM". May be earlier than start for an overnight range.')}).optional().describe("@internal Opt-in quiet hours. When enabled, shows a single soft nudge per session while inside the configured local-time window. Never blocks."),cleanupPeriodDays:G.number().int().positive().optional().describe("Number of days to retain chat transcripts before automatic cleanup (default: 30). Minimum 1. Use a large value for long retention; use --no-session-persistence to disable transcript writes entirely."),skillListingMaxDescChars:G.number().int().positive().optional().describe("Per-skill description character cap in the skill listing sent to Claude (default: 1536). Descriptions longer than this are truncated. Raise to opt in to higher per-turn context cost."),skillListingBudgetFraction:G.number().gt(0).lte(1).optional().describe("Fraction of the context window (in characters) reserved for the skill listing sent to Claude (default: 0.01 = 1%). When the listing exceeds this, descriptions are shortened to fit. Raise to opt in to higher per-turn context cost."),wslInheritsWindowsSettings:G.boolean().optional().describe("When set to true in either admin-only Windows source \u2014 the HKLM SOFTWARE/Policies/ClaudeCode registry key or C:/Program Files/ClaudeCode/managed-settings.json \u2014 WSL reads managed settings from the full Windows policy chain (HKLM, C:/Program Files/ClaudeCode via DrvFs, HKCU) in addition to /etc/claude-code. Windows sources take priority. The flag is also required in HKCU itself for HKCU policy to apply on WSL (double opt-in: admin enables the chain, user confirms HKCU). On native Windows the flag has no effect."),env:qXc().optional().describe("Environment variables to set for Claude Code sessions"),attribution:G.object({commit:G.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:G.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution.")}).optional().describe("Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set."),includeCoAuthoredBy:G.boolean().optional().describe("Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)"),includeGitInstructions:G.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:Vio(t).optional().describe("Tool usage permissions configuration"),model:G.string().optional().describe("Override the default model used by Claude Code"),availableModels:G.array(G.string()).optional().describe('Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.'),modelOverrides:G.record(G.string(),G.string()).optional().describe('Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.'),enableAllProjectMcpServers:G.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:G.array(G.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:G.array(G.string()).optional().describe("List of rejected MCP servers from .mcp.json"),skillOverrides:G.record(G.string(),G.enum(["on","name-only","user-invocable-only","off"])).optional().describe('Per-skill listing overrides keyed by skill name. "name-only" lists the skill without its description; "user-invocable-only" hides it from the model but keeps /name; "off" hides it from both. Absent = on.'),allowedMcpServers:G.array(Wio()).optional().describe("Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:G.array(zio()).optional().describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:rwt().optional().describe("Custom commands to run before/after tool executions"),worktree:G.object({symlinkDirectories:G.array(G.string()).optional().describe('Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"'),sparsePaths:G.array(G.string()).optional().describe("Directories to include when creating worktrees, via git sparse-checkout (cone mode). Dramatically faster in large monorepos \u2014 only the listed paths are written to disk."),baseRef:G.enum(["fresh","head"]).optional().describe("Which ref new worktrees branch from. 'fresh' (default) branches from origin/ for a clean tree. 'head' branches from your current local HEAD so unpushed commits and feature-branch state are present. Applies to --worktree, EnterWorktree, and agent isolation."),bgIsolation:G.enum(["worktree","none"]).optional().catch(void 0).describe("Isolation mode for background sessions in this repo. 'worktree' (default) blocks Edit/Write in the main checkout until EnterWorktree is called. 'none' lets background jobs edit the working copy directly.")}).optional().describe("Git worktree configuration for --worktree flag."),disableAllHooks:G.boolean().optional().describe("Disable all hooks and statusLine execution"),disableAgentView:G.boolean().optional().describe("Disable agent view (`claude agents`, `--bg`, /background, the on-demand daemon). Typically set in managed settings. Equivalent to CLAUDE_CODE_DISABLE_AGENT_VIEW=1."),disableRemoteControl:G.boolean().optional().describe("Disable Remote Control (claude.ai/code, `claude remote-control`, `--remote-control`/`--rc`, auto-start, and the in-session toggle). Typically set in managed settings."),disableWorkflows:G.boolean().optional().describe("Disable the Workflows feature (also via CLAUDE_CODE_DISABLE_WORKFLOWS)."),enableWorkflows:G.boolean().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowKeywordTriggerEnabled:G.boolean().optional().describe('Enable the "workflow"/"workflows" keyword trigger that opts a prompt into the Workflow tool. Set to false to type the word without triggering a workflow. Default: true.'),disableSkillShellExecution:G.boolean().optional().describe("Disable inline shell execution in skills and custom slash commands from user, project, or plugin sources. Commands are replaced with a placeholder instead of being run."),defaultShell:G.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),allowManagedHooksOnly:G.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowedHttpHookUrls:G.array(G.string()).optional().describe('Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).'),httpHookAllowedEnvVars:G.array(G.string()).optional().describe("Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers)."),allowManagedPermissionRulesOnly:G.boolean().optional().describe("When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored."),allowManagedMcpServersOnly:G.boolean().optional().describe("When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies."),allowAllClaudeAiMcps:G.boolean().optional().describe("When true (and set in managed settings), claude.ai cloud MCP connectors load alongside managed-mcp.json instead of being suppressed by its exclusive-control lockdown. Default off preserves the lockdown. Read from managed settings only."),strictPluginOnlyCustomization:G.preprocess(e=>Array.isArray(e)?e.filter(r=>CJi.includes(r)):e,G.union([G.boolean(),G.array(G.enum(CJi))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. Composes with strictKnownMarketplaces for end-to-end admin control \u2014 plugins gated by marketplace allowlist, everything else blocked here.'),statusLine:G.object({type:G.literal("command"),command:G.string(),padding:G.number().optional(),refreshInterval:G.number().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:G.boolean().optional().describe("Hide the built-in `-- INSERT --` / `-- VISUAL --` indicator below the prompt. Use this when your status line script renders `vim.mode` itself.")}).optional().describe("Custom status line display configuration"),prUrlTemplate:G.string().optional().describe('URL template for PR links in the footer badge and inline messages. Placeholders: {host} {owner} {repo} {number} {url}. Example: "https://reviews.example.com/{owner}/{repo}/pull/{number}"'),subagentStatusLine:G.object({type:G.literal("command"),command:G.string()}).optional().describe("Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:G.record(G.string(),G.union([G.array(G.string()),G.boolean(),G.undefined()])).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints. Settings precedence is user < project < local < flag < policy, so to disable a plugin that project settings enable, set it to false in .claude/settings.local.json \u2014 setting false in ~/.claude/settings.json is overridden by the project.'),extraKnownMarketplaces:G.record(G.string(),jXc()).check(e=>{for(let[r,n]of Object.entries(e.value))n.source.source==="settings"&&n.source.name!==r&&e.issues.push({code:"custom",input:n.source.name,path:[r,"source","name"],message:`Settings-sourced marketplace name must match its extraKnownMarketplaces key (got key "${r}" but source.name "${n.source.name}")`})}).optional().describe("Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources."),strictKnownMarketplaces:G.array(nwt()).optional().describe("Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem. Note: this is a policy gate only \u2014 it does NOT register marketplaces. To pre-register allowed marketplaces for users, also set extraKnownMarketplaces."),blockedMarketplaces:G.array(nwt()).optional().describe("Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem."),pluginSuggestionMarketplaces:G.array(G.string()).optional().describe("Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips), in addition to the official marketplace. Only honored when set in managed settings (policy scope); the key is ignored in user, project, and local settings. A name only takes effect when the marketplace is registered on the machine AND its registered source is also declared in managed settings, either as the extraKnownMarketplaces entry for that name or as an entry of strictKnownMarketplaces. A marketplace registered from a different source under an allowlisted name is ignored."),forceLoginMethod:G.enum(["claudeai","console"]).optional().describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing'),parentSettingsBehavior:G.enum(["first-wins","merge"]).optional().describe(`Controls whether the SDK parent tier (Options.managedSettings / --managed-settings) layers under this admin tier. "first-wins" (default): parent is dropped \u2014 admin tiers are the only policy source. "merge": parent's restrictive-only-filtered settings union under the admin winner. Has no effect when no admin tier exists (parent applies as the sole policy tier, still filtered restrictive-only).`),forceLoginOrgUUID:G.union([G.string(),G.array(G.string())]).optional().describe("Organization UUID to require for OAuth login. Accepts a single UUID string or an array of UUIDs (any one is permitted). When set in managed settings, login fails if the authenticated account does not belong to a listed organization."),forceRemoteSettingsRefresh:G.boolean().optional().describe("When set in managed settings, the CLI blocks startup until remote managed settings are freshly fetched, and exits if the fetch fails"),otelHeadersHelper:G.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:G.string().optional().describe("Controls the output style for assistant responses"),viewMode:G.enum(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:G.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:G.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:SZc().optional(),feedbackSurveyRate:G.number().min(0).max(1).optional().describe("Probability (0\u20131) that the session quality survey appears when eligible. 0.05 is a reasonable starting point."),spinnerTipsEnabled:G.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:G.object({mode:G.enum(["append","replace"]),verbs:G.array(G.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:G.object({excludeDefault:G.boolean().optional(),tips:G.array(G.string())}).optional().describe("Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false)."),syntaxHighlightingDisabled:G.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),terminalTitleFromRename:G.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),alwaysThinkingEnabled:G.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:G.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),ultracode:G.boolean().optional().catch(void 0).describe("Enable ultracode for the session: xhigh effort plus standing dynamic-workflow orchestration. Session-scoped \u2014 typically provided via --settings or the apply_flag_settings control request; interactive toggles never persist it. Requires workflows to be enabled and an xhigh-capable model."),autoCompactWindow:G.number().int().min(1e5).max(1e6).optional().catch(void 0).describe("Auto-compact window size"),advisorModel:G.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:G.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:G.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:G.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),awaySummaryEnabled:G.boolean().optional().describe("@internal When false, the session recap (shown when you return after being away for 5+ minutes) is disabled. When absent or true, recap is enabled. Hidden from public SDK types until external launch."),showClearContextOnPlanAccept:G.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),agent:G.string().optional().describe("Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model."),companyAnnouncements:G.array(G.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:G.record(G.string(),G.object({mcpServers:G.record(G.string(),G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.array(G.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.array(G.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")})).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:G.object({defaultEnvironmentId:G.string().optional().describe("Default environment ID to use for remote sessions")}).optional().describe("Remote session configuration"),autoUpdatesChannel:G.enum(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:G.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),plansDirectory:G.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:G.enum(["default","fullscreen"]).optional().describe('Terminal UI renderer. "fullscreen" uses the flicker-free alt-screen renderer with virtualized scrollback (equivalent to CLAUDE_CODE_NO_FLICKER=1). "default" uses the classic main-screen renderer.'),voice:G.object({enabled:G.boolean().optional(),mode:G.enum(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:G.boolean().optional().describe("Submit the prompt when hold-to-talk is released (hold mode only)")}).optional().describe("Voice mode settings (hold-to-talk / tap-to-toggle dictation)"),channelsEnabled:G.boolean().optional().describe("Managed-org opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). claude.ai Teams/Enterprise: default off. Console: default on unless managed settings exist. Set true to allow; users then select servers via --channels."),allowedChannelPlugins:G.array(G.object({marketplace:G.string(),plugin:G.string()})).optional().describe("Managed-org allowlist of channel plugins. When set, replaces the default Anthropic allowlist \u2014 admins decide which plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true."),prefersReducedMotion:G.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),doneMeansMerged:G.boolean().optional().describe("@internal When true, Claude keeps working until the PR is ready for you to merge, a cron/Monitor is armed to resume later, or it hands you a self-contained next step."),autoMemoryEnabled:G.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:G.string().optional().describe("Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects//memory/."),autoDreamEnabled:G.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:G.boolean().optional().describe("Request API-side thinking summaries and show them in the conversation and in the transcript view (ctrl+o). Set explicitly to override the default for your install."),skipDangerousModePermissionPrompt:G.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:G.boolean().optional().describe("@internal Whether the user has accepted the multi-agent workflow usage warning. Until set, auto permission mode prompts before running a workflow."),disableAutoMode:G.enum(["disable"]).optional().describe("Disable auto mode"),sshConfigs:G.array(G.object({id:G.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:G.string().describe("Display name for the SSH connection"),sshHost:G.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:G.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:G.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:G.string().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh [dir]`.")})).optional().describe("SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members."),claudeMd:G.string().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:G.array(G.string()).optional().describe('Glob patterns or absolute paths of CLAUDE.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/CLAUDE.md", "**/code/CLAUDE.md", "**/some-dir/.claude/rules/**"'),pluginTrustMessage:G.string().optional().describe('Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").'),theme:G.union([G.enum(RZc),G.string().startsWith("custom:").transform(e=>e)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:G.enum(IZc).optional().catch(void 0).describe("Key binding mode for the prompt input"),verbose:G.boolean().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:G.enum(TZc).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:G.boolean().optional().describe("Automatically compact conversation when context fills"),autoScrollEnabled:G.boolean().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),fileCheckpointingEnabled:G.boolean().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:G.boolean().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:G.boolean().optional().describe("Stamp each assistant message with its arrival time"),terminalProgressBarEnabled:G.boolean().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:G.boolean().optional().describe("Enable the todo / task tracking panel"),teammateMode:G.enum(xZc).optional().catch(void 0).describe("How spawned teammates execute (tmux, in-process, auto)"),remoteControlAtStartup:G.boolean().optional().describe("Start Remote Control bridge automatically each session"),isolatePeerMachines:G.boolean().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:G.enum(["transient","ask"]).optional().describe("When no background service is running: 'transient' spawns one for this login session; 'ask' offers to install it persistently"),autoUploadSessions:G.boolean().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:G.boolean().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:G.boolean().optional().describe("Allow Claude to push proactive mobile notifications"),...RXc(t)}).passthrough()}function WXc(t){let e=$Xc.find(n=>n.matches(t));if(!e)return null;let r={...e.tip};return t.code==="invalid_value"&&t.enumValues&&!r.suggestion&&(r.suggestion=`Valid values: ${t.enumValues.map(n=>`"${n}"`).join(", ")}`),!r.docLink&&t.path&&(r.docLink=VXc[xHc(t.path,".")]),r}function bJi(t){return t.code==="invalid_type"}function SJi(t){return t.code==="invalid_value"}function zXc(t){return t.code==="unrecognized_keys"}function TJi(t){return t.code==="too_small"}function lve(t){return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":typeof t}function IJi(t){let e=t.match(/received (\w+)/);return e?e[1]:void 0}function K8e(t,e){return t.issues.map(r=>{let n=r.path.map(String).join("."),o=r.message,s,c,l,u,d;if(SJi(r))c=r.values.map(h=>String(h)),l=c.join(" | "),u=void 0,d=void 0;else if(bJi(r)){l=r.expected;let h=IJi(r.message);u=h??lve(r.input),d=h??lve(r.input)}else TJi(r)?l=String(r.minimum):r.code==="custom"&&"params"in r&&(u=r.params.received,d=u);let f=WXc({path:n,code:r.code,expected:l,received:u,enumValues:c,message:r.message,value:u});if(SJi(r))s=c?.map(h=>`"${h}"`).join(", "),o=`Invalid value. Expected one of: ${s}`;else if(bJi(r)){let h=IJi(r.message)??lve(r.input);r.expected==="object"&&h==="null"&&n===""?o="Invalid or malformed JSON":o=`Expected ${r.expected}, but received ${h}`}else if(zXc(r)){let h=r.keys.join(", ");o=`Unrecognized ${IHc(r.keys.length,"field")}: ${h}`}else TJi(r)&&(o=`Number must be greater than or equal to ${r.minimum}`,s=String(r.minimum));return{file:e,path:n,message:o,expected:s,invalidValue:d,suggestion:f?.suggestion,docLink:f?.docLink}})}function YXc(t,e){if(!t||typeof t!="object")return[];let r=t;if(!r.permissions||typeof r.permissions!="object")return[];let n=r.permissions,o=[];for(let s of["allow","deny","ask"]){let c=n[s];Array.isArray(c)&&(n[s]=c.filter(l=>{if(typeof l!="string")return o.push({file:e,path:`permissions.${s}`,message:`Non-string value in ${s} array was removed`,severity:"warning",invalidValue:l}),!1;let u=$io(l);if(!u.valid){let d=`Invalid permission rule "${l}" was skipped: ${u.error}`;return u.suggestion&&(d+=`. ${u.suggestion}`),o.push({file:e,path:`permissions.${s}`,message:d,severity:"warning",invalidValue:l}),!1}return!0}))}return o}function JXc(t,e){if(!t||typeof t!="object")return[];let r=t;if(!("hooks"in r))return[];if(r.hooks===null||typeof r.hooks!="object"||Array.isArray(r.hooks)){let s=lve(r.hooks);return delete r.hooks,[{file:e,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${s}. This field was ignored.`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"}]}let n=r.hooks,o=[];for(let s of Object.keys(n)){if(!KXc.has(s)){delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Unknown hook event "${s}" was ignored. Valid events: ${ywt.join(", ")}`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"});continue}if(!Array.isArray(n[s])){let c=lve(n[s]);delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Hook event "${s}" must be an array of matchers; received ${c}. This entry was ignored.`,severity:"warning",invalidValue:c,docLink:"https://code.claude.com/docs/en/hooks"})}}return o.length>0&&Object.keys(n).length===0&&delete r.hooks,o}function XXc(t,e){if(!t||typeof t!="object")return[];let r=t,n=[];for(let{key:o,schema:s}of ZXc){if(!(o in r))continue;if(!Array.isArray(r[o])){let u=r[o];delete r[o],n.push({file:e,path:o,message:`"${o}" must be an array; received ${lve(u)}. This field was ignored.`,severity:"warning",invalidValue:u});continue}let c=r[o],l=[];for(let u=0;u{try{(0,Jio.execFile)(t,e,{encoding:"utf-8",timeout:rel},(n,o)=>{r({stdout:o??"",code:n?1:0})})}catch{r({stdout:"",code:1})}})}function oel(){return(async()=>{if(process.platform==="darwin"){let t=nel(),e=(await Promise.all(t.map(async({path:r,label:n})=>{if(!(0,Zio.existsSync)(r))return{stdout:"",label:n,ok:!1};let{stdout:o,code:s}=await HFe(eel,[...tel,r]);return{stdout:o,label:n,ok:s===0&&!!o}}))).find(r=>r.ok);return{plistStdouts:e?[{stdout:e.stdout,label:e.label}]:[],hklmStdout:null,hkcuStdout:null}}if(process.platform==="win32"){let t=`${process.env.SYSTEMROOT||"C:\\Windows"}\\System32\\reg.exe`,[e,r]=await Promise.all([HFe(t,["query",u6r,"/v",ove]),HFe(t,["query",d6r,"/v",ove])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:r.code===0?r.stdout:null}}if(Kio()){let[t,e]=await Promise.all([HFe(wJi,["query",u6r,"/v",ove]),HFe(wJi,["query",d6r,"/v",ove])]);return{plistStdouts:null,hklmStdout:t.code===0?t.stdout:null,hkcuStdout:e.code===0?e.stdout:null}}return{plistStdouts:null,hklmStdout:null,hkcuStdout:null}})()}function sel(){return iel}function ael(){swt||(swt=(async()=>{let t=Date.now(),e=sel()??oel(),{mdm:r,hkcu:n,wslInherits:o}=fel(await e);Xio=r,eoo=n,too=o;let s=Date.now()-t;if(ru(`MDM settings load completed in ${s}ms`),Object.keys(r.settings).length>0){ru(`MDM settings found: ${Object.keys(r.settings).join(", ")}`);try{r6r("info","mdm_settings_loaded",{duration_ms:s,key_count:Object.keys(r.settings).length,error_count:r.errors.length})}catch{}}})())}async function cel(){swt||ael(),await swt}function lel(){return Xio??rW}function uel(){return eoo??rW}function del(){return too}function YFr(t,e){let r=uW(Kwt(t,!1));if(!r||typeof r!="object")return{settings:{},errors:[]};let n=Wve(r,e),o=Vve().safeParse(r);if(!o.success){let s=K8e(o.error,e);return{settings:{},errors:[...n,...s]}}return{settings:o.data,errors:n}}function RJi(t,e="Settings"){let r=t.split(/\r?\n/),n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`^\\s+${n}\\s+REG_(?:EXPAND_)?SZ\\s+(.*)$`,"i");for(let s of r){let c=s.match(o);if(c&&c[1])return c[1].trimEnd()}return null}function fel(t){let e=[];if(t.plistStdouts&&t.plistStdouts.length>0){let{stdout:c,label:l}=t.plistStdouts[0],u=YFr(c,l),{wslInheritsWindowsSettings:d,...f}=u.settings;if(Object.keys(f).length>0)return{mdm:u,hkcu:rW,wslInherits:!1};e.push(...u.errors)}let r=null;if(t.hklmStdout){let c=RJi(t.hklmStdout);c&&(r=YFr(c,`Registry: ${u6r}\\${ove}`))}r&&e.push(...r.errors);let n=e.length>0?{settings:{},errors:e}:rW,o=Kio(),s=!1;if(o&&(s=r?.settings.wslInheritsWindowsSettings===!0||hel(),!s))return{mdm:n,hkcu:rW,wslInherits:!1};if(r){let{wslInheritsWindowsSettings:c,...l}=r.settings;if(Object.keys(l).length>0)return{mdm:r,hkcu:rW,wslInherits:s}}if(pel(s))return{mdm:n,hkcu:rW,wslInherits:s};if(t.hkcuStdout){let c=RJi(t.hkcuStdout);if(c){let l=YFr(c,`Registry: ${d6r}\\${ove}`);if(!o||l.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:u,...d}=l.settings;return{mdm:n,hkcu:{settings:d,errors:l.errors},wslInherits:s}}if(l.errors.length>0)return{mdm:n,hkcu:{settings:{},errors:l.errors},wslInherits:s}}}return{mdm:n,hkcu:rW,wslInherits:s}}function pel(t){return t&&PJi(owt)?!0:PJi(P8e())}function kJi(t){let e=uW(Kwt(Ywt(t),!1));if(!e||typeof e!="object")return!1;Wve(e,t);let{wslInheritsWindowsSettings:r,...n}=e;return Object.keys(n).length>0}function hel(){function t(e){try{let r=Kwt(Ywt(e),!1);return!!r&&typeof r=="object"&&"wslInheritsWindowsSettings"in r&&r.wslInheritsWindowsSettings===!0}catch{return!1}}if(a(t,"$"),t((0,Jie.join)(owt,"managed-settings.json")))return!0;try{let e=(0,Jie.join)(owt,"managed-settings.d");for(let r of DI().readdirSync(e))if((r.isFile()||r.isSymbolicLink())&&r.name.endsWith(".json")&&!r.name.startsWith(".")&&t((0,Jie.join)(e,r.name)))return!0}catch{}return!1}function PJi(t){try{if(kJi((0,Jie.join)(t,"managed-settings.json")))return!0}catch{}try{let e=(0,Jie.join)(t,"managed-settings.d"),r=DI().readdirSync(e);for(let n of r)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(".json")||n.name.startsWith(".")))try{if(kJi((0,Jie.join)(e,n.name)))return!0}catch{}}catch{}return!1}function mel(t,e,r){(r!==void 0&&!Ewt(t[e],r)||r===void 0&&!(e in t))&&B6r(t,e,r)}function gel(t){return function(e,r,n){for(var o=-1,s=Object(e),c=n(e),l=c.length;l--;){var u=c[t?l:++o];if(r(s[u],u,s)===!1)break}return e}}function _el(t){return Qve(t)&&Q6r(t)}function xel(t){if(!Qve(t)||N8e(t)!=Cel)return!1;var e=lXi(t);if(e===null)return!0;var r=Tel.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&roo.call(r)==Iel}function Rel(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function kel(t){return UQc(t,sXi(t))}function Del(t,e,r,n,o,s,c){var l=p6r(t,r),u=p6r(e,r),d=c.get(u);if(d){f6r(t,r,d);return}var f=s?s(l,u,r+"",t,e,c):void 0,h=f===void 0;if(h){var m=lW(u),g=!m&&F6r(u),A=!m&&!g&&iXi(u);f=u,m||g||A?lW(l)?f=l:vel(l)?f=tjc(l):g?(h=!1,f=cXi(u,!0)):A?(h=!1,f=ljc(u,!0)):f=[]:wel(u)||l8e(u)?(f=l,l8e(l)?f=Pel(l):(!z9(l)||I6r(l))&&(f=pjc(u))):h=!1}h&&(c.set(u,f),o(f,u,n,s,c),c.delete(u)),f6r(t,r,f)}function noo(t,e,r,n,o){t!==e&&Eel(e,function(s,c){if(o||(o=new DQc),z9(s))Nel(t,e,c,r,noo,n,o);else{var l=n?n(p6r(t,c),s,c+"",t,e,o):void 0;l===void 0&&(l=s),f6r(t,c,l)}},sXi)}function Oel(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Bel(t,e,r){return e=DJi(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,s=DJi(n.length-e,0),c=Array(s);++o0){if(++e>=jel)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function zel(t,e){return ooo(ioo(t,e,dXi),t+"")}function Kel(t,e,r){if(!z9(r))return!1;var n=typeof e;return(n=="number"?Q6r(r)&&bwt(e,r.length):n=="string"&&e in r)?Ewt(r[e],t):!1}function Zel(t){return Yel(function(e,r){var n=-1,o=r.length,s=o>1?r[o-1]:void 0,c=o>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(o--,s):void 0,c&&Jel(r[0],r[1],c)&&(s=o<3?void 0:s,o=1),e=Object(e);++n0&&r(l)?e>1?soo(l,e-1,r,n,o):njc(o,l):n||(o[o.length]=l)}return o}function utl(t){var e=t==null?0:t.length;return e?ltl(t,1):[]}function ftl(t){return ooo(ioo(t,void 0,dtl),t+"")}function Atl(){return void 0??(0,aoo.join)(Fve(),mtl)}function ytl(){try{let t=Ywt(Atl()),e=GN(Sio(t));return!e||typeof e!="object"||Array.isArray(e)?null:e}catch{return null}}function Etl(){if(!void 0&>l!==!0)return null;if(JFr)return JFr;let t=ytl();return t?(JFr=t,$6r(),t):null}function c7r(t){let e=new Set(t.allowedSources);return e.add("flagSettings"),e.add("policySettings"),IXc.filter(r=>e.has(r))}function _tl(){return(0,ky.join)(P8e(),"managed-settings.json")}function coo(t){if(Jwt()==="wsl"&&t.wslInherits?.()){let e=ZFr(owt);if(e.settings)return e;let r=ZFr(P8e());return{settings:r.settings,errors:[...e.errors,...r.errors]}}return ZFr(P8e())}function ZFr(t){let e=[],r={},n=!1,{settings:o,errors:s}=awt((0,ky.join)(t,"managed-settings.json"));e.push(...s),o&&Object.keys(o).length>0&&(r=oW(r,o,sW),n=!0);let c=(0,ky.join)(t,"managed-settings.d");try{let d=DI().readdirSync(c).filter(f=>(f.isFile()||f.isSymbolicLink())&&f.name.endsWith(".json")&&!f.name.startsWith(".")).map(f=>f.name).sort();for(let f of d){let{settings:h,errors:m}=awt((0,ky.join)(c,f));e.push(...m),h&&Object.keys(h).length>0&&(r=oW(r,h,sW),n=!0)}}catch(d){let f=PI(d);f!=="ENOENT"&&f!=="ENOTDIR"&&ru(`managed-settings.d read failed: ${d}`,{level:"error"})}let{wslInheritsWindowsSettings:l,...u}=r;return{settings:n&&Object.keys(u).length>0?r:null,errors:e}}function vtl(t,e){O8e(t)?ru(`Broken symlink or missing file encountered for settings.json at path: ${e}`):ru(`settings file read failed at ${e}: ${t}`,{level:"error"})}function awt(t,e){let r=Kjc(t);if(r)return{settings:r.settings?uW(r.settings):null,errors:r.errors};let n=Ctl(t,e);return Jjc(t,n),{settings:n.settings?uW(n.settings):null,errors:n.errors}}function loo(t){if(!t.mdm)return{settings:null,errors:[]};let e=t.mdm();return{settings:Object.keys(e.settings).length>0?e.settings:null,errors:e.errors}}function uoo(t){let e=t?.remote?t.remote():Etl();if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=uW(e),n=Wve(r,"remote managed settings"),o=Vve().safeParse(r);return o.success?{settings:Object.keys(o.data).length>0?o.data:null,errors:n}:{settings:null,errors:[...n,...K8e(o.error,"remote managed settings")]}}function doo(t){let e=t.parentManaged;if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=uW(e),n=Wve(r,"parent managed settings"),o=Vve().safeParse(r);return o.success?Object.keys(o.data).length>0?{settings:o.data,errors:n}:{settings:null,errors:n}:{settings:null,errors:[...n,...K8e(o.error,"parent managed settings")]}}function foo(t){let e=t.flagInline;if(!e)return{settings:null,errors:[]};let r=uW(e),n=Wve(r,"SDK inline settings"),o=Vve().safeParse(r);return o.success?{settings:o.data,errors:n}:{settings:null,errors:[...n,...K8e(o.error,"SDK inline settings")]}}function Ctl(t,e){try{let r;if(e!==void 0)r=e;else{let{resolvedPath:c}=mXi(DI(),t);r=Ywt(c)}if(r.trim()==="")return{settings:{},errors:[]};let n=uW(Kwt(r,!1)),o=Wve(n,t),s=Vve().safeParse(n);if(!s.success){let c=K8e(s.error,t);return{settings:null,errors:[...o,...c]}}return{settings:s.data,errors:o}}catch(r){return vtl(r,t),{settings:null,errors:[]}}}function MJi(t,e){switch(t){case"userSettings":return(0,ky.resolve)(Fve());case"policySettings":case"projectSettings":case"localSettings":return(0,ky.resolve)(e.cwd);case"flagSettings":return e.flagPath?(0,ky.dirname)((0,ky.resolve)(e.flagPath)):(0,ky.resolve)(e.cwd)}}function btl(t){return t.coworkPlugins||s_(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS)?"cowork_settings.json":"settings.json"}function cwt(t,e){switch(t){case"userSettings":return(0,ky.join)(MJi(t,e),btl(e));case"projectSettings":case"localSettings":return(0,ky.join)(MJi(t,e),Stl(t));case"policySettings":return _tl();case"flagSettings":return e.flagPath}}function Stl(t){switch(t){case"projectSettings":return(0,ky.join)(".claude","settings.json");case"localSettings":return(0,ky.join)(".claude","settings.local.json")}}function poo(t,e){let r=Wjc(t);if(r!==void 0)return r;let n=Rtl(t,e);return zjc(t,n),n}function Ttl(t){return!t||t.parentSettingsBehavior==="merge"}function Itl(t,e){let r={};t.allowManagedHooksOnly===!0&&(r.allowManagedHooksOnly=!0),t.allowManagedMcpServersOnly===!0&&(r.allowManagedMcpServersOnly=!0),t.allowManagedPermissionRulesOnly===!0&&(r.allowManagedPermissionRulesOnly=!0);let n=t.strictPluginOnlyCustomization;if((n===!0||Array.isArray(n)&&n.length>0)&&(r.strictPluginOnlyCustomization=n),t.deniedMcpServers&&(r.deniedMcpServers=t.deniedMcpServers),e.forceLoginOrgUUID===void 0&&t.forceLoginOrgUUID&&(r.forceLoginOrgUUID=t.forceLoginOrgUUID),e.allowedMcpServers===void 0&&t.allowedMcpServers&&(r.allowedMcpServers=t.allowedMcpServers),t.permissions){let o=KFr(t.permissions,["deny","ask"]);if(t.permissions.disableBypassPermissionsMode==="disable"&&(o.disableBypassPermissionsMode="disable"),e.allowManagedPermissionRulesOnly!==!0){let{allow:s,additionalDirectories:c}=t.permissions;s&&e.sandbox?.network?.allowManagedDomainsOnly!==!0&&(o.allow=s),c&&(o.additionalDirectories=c)}Object.keys(o).length>0&&(r.permissions=o)}if(t.sandbox){let{network:o,filesystem:s}=t.sandbox,c={};if(t.sandbox.enabled===!0&&(c.enabled=!0),t.sandbox.failIfUnavailable===!0&&(c.failIfUnavailable=!0),t.sandbox.allowUnsandboxedCommands===!1&&(c.allowUnsandboxedCommands=!1),t.sandbox.autoAllowBashIfSandboxed===!1&&(c.autoAllowBashIfSandboxed=!1),o){let l=KFr(o,["deniedDomains"]);o.allowManagedDomainsOnly===!0&&(l.allowManagedDomainsOnly=!0),e.sandbox?.network?.allowManagedDomainsOnly!==!0&&o.allowedDomains&&(l.allowedDomains=o.allowedDomains),Object.keys(l).length>0&&(c.network=l)}if(s){let l=KFr(s,["denyRead","denyWrite"]);s.allowManagedReadPathsOnly===!0&&(l.allowManagedReadPathsOnly=!0),e.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&s.allowRead&&(l.allowRead=s.allowRead),Object.keys(l).length>0&&(c.filesystem=l)}Object.keys(c).length>0&&(r.sandbox=c)}return r}function xtl(t){if(t.helper?.())return"helper";if(uoo(t).settings)return"remote";if(loo(t).settings)return Jwt()==="macos"?"plist":"hklm";if((t.file?.()??coo(t)).settings)return"file";if(doo(t).settings)return"parent";let e=t.hkcu?.();return e&&Object.keys(e.settings).length>0?"hkcu":null}function wtl(t){let e=[],{settings:r,errors:n}=uoo(t);e.push(...n);let{settings:o,errors:s}=loo(t);e.push(...s);let{settings:c,errors:l}=t.file?.()??coo(t);e.push(...l);let{settings:u,errors:d}=doo(t);e.push(...d);let f=[r,o,c].filter(A=>A!==null),h=f[0]??null,m={allowManagedPermissionRulesOnly:f.some(A=>A.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:f.find(A=>A.forceLoginOrgUUID!==void 0)?.forceLoginOrgUUID,allowedMcpServers:f.find(A=>A.allowedMcpServers!==void 0)?.allowedMcpServers,sandbox:{network:{allowManagedDomainsOnly:f.some(A=>A.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:f.some(A=>A.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},g=u&&Ttl(h)?Itl(u,m):null;return{tiers:f,admin:h,parentSlice:g,errors:e}}function hoo(t){let e=t.helper?.();if(e)return{settings:e,errors:t.helperWarnings?.()??[]};let{admin:r,parentSlice:n,errors:o}=wtl(t);if(!r&&!n){let s=t.hkcu?.();return s&&Object.keys(s.settings).length>0?{settings:s.settings,errors:[...o,...s.errors]}:{settings:null,errors:[...o,...s?.errors??[]]}}return{settings:oW({},n??{},r??{},sW),errors:o}}function Rtl(t,e){if(t==="policySettings")return hoo(e).settings;let r=cwt(t,e),{settings:n}=r?awt(r,t==="flagSettings"?e.flagExpectedContent:void 0):{settings:null};if(t==="flagSettings"){let{settings:o}=foo(e);if(o)return oW(n||{},o,sW)}return n}function ktl(t,e){return zXi([...t,...e])}function sW(t,e){if(Array.isArray(t)&&Array.isArray(e))return ktl(t,e)}function Ptl(t){if(XFr)return{settings:{},errors:[]};let e=Date.now();r6r("info","settings_load_started"),XFr=!0;try{let r=Xjc(),n={};r&&(n=oW(n,r,sW));let o=[],s=new Set,c=new Set;for(let l of c7r(t)){if(l==="policySettings"){let{settings:d,errors:f}=hoo(t);d&&(n=oW(n,d,sW));for(let h of f){let m=`${h.file}:${h.path}:${h.message}`;s.has(m)||(s.add(m),o.push(h))}continue}let u=cwt(l,t);if(u){let d=(0,ky.resolve)(u);if(!c.has(d)){c.add(d);let{settings:f,errors:h}=awt(u,l==="flagSettings"?t.flagExpectedContent:void 0);for(let m of h){let g=`${m.file}:${m.path}:${m.message}`;s.has(g)||(s.add(g),o.push(m))}f&&(n=oW(n,f,sW))}}if(l==="flagSettings"){let{settings:d,errors:f}=foo(t);for(let h of f){let m=`${h.file}:${h.path}:${h.message}`;s.has(m)||(s.add(m),o.push(h))}d&&(n=oW(n,d,sW))}}return r6r("info","settings_load_completed",{duration_ms:Date.now()-e,source_count:c.size,error_count:o.length}),{settings:n,errors:o}}finally{XFr=!1}}function Dtl(t){let e=$jc();if(e!==null)return e;let r=Ptl(t);return Vjc(r),r}function Ntl(t){let{settings:e}=Dtl(t);return e||{}}function Mtl(t){$6r();let e=[];for(let r of c7r(t)){let n=poo(r,t);n&&Object.keys(n).length>0&&e.push({source:r,settings:n})}return{effective:Ntl(t),sources:e}}function Otl(t,e){let r=c7r(e);for(let n=r.length-1;n>=0;n--){let o=r[n];if(poo(o,e)?.[t]!==void 0)return o}return null}function Qtl(t){let e=t.effective.permissions?.defaultMode;if(!e||!Ftl.has(e))return t.effective;for(let r=t.sources.length-1;r>=0;r--){let n=t.sources[r];if(n.settings.permissions?.defaultMode!==void 0){if(Utl.has(n.source)){let{defaultMode:o,...s}=t.effective.permissions??{};return{...t.effective,permissions:s}}return t.effective}}return t.effective}async function qtl(t={}){await cel();let e={cwd:(0,Cio.resolve)(t.cwd??DI().cwd()),allowedSources:(t.settingSources??Btl).map(r=>Ltl[r]),parentManaged:t.managedSettings??null,flagInline:null,flagPath:void 0,mdm:lel,hkcu:uel,wslInherits:del,...t.serverManagedSettings!==void 0&&{remote:a(()=>t.serverManagedSettings,"remote")}};try{let{effective:r,sources:n}=Mtl(e),o=xtl(e)??void 0,s=n.map(({source:l,settings:u})=>({source:OJi[l],settings:u,path:l==="policySettings"?void 0:cwt(l,e),...l==="policySettings"&&{policyOrigin:o}})),c={};for(let l of Object.keys(r)){let u=Otl(l,e);u&&(c[l]={source:OJi[u],path:u==="policySettings"?void 0:cwt(u,e),...u==="policySettings"&&{policyOrigin:o}})}return{effective:r,provenance:c,sources:s}}finally{$6r()}}async function jtl(t){return qtl(t)}async function Htl(t,e){try{await(0,a_.copyFile)(t,e)}catch(r){if(!O8e(r))throw r}}async function Gtl(t,e){if(!t)return;let r=t;try{let n=GN(t);n?.claudeAiOauth?.refreshToken&&(delete n.claudeAiOauth.refreshToken,r=Qm(n))}catch{}await(0,a_.writeFile)(e,r,{mode:384})}function $tl(){if(process.platform!=="darwin")return Promise.resolve(void 0);let t=g$c(m$c);return new Promise(e=>{(0,iZi.execFile)("security",["find-generic-password","-a",y$c(),"-w","-s",t],{encoding:"utf-8",timeout:5e3},(r,n)=>e(r?void 0:n.trim()||void 0))})}async function moo(t,e,r,n,o=6e4){if(!bh(e))return;let s=bk(r),c=await Vie(t.load({projectKey:s,sessionId:e}),o,`SessionStore.load() timed out after ${o}ms for session ${e}`);if(!c||c.length===0)return;let l=(0,pc.join)((0,uve.tmpdir)(),`claude-resume-${(0,gwt.randomUUID)()}`);try{let u=(0,pc.join)(l,"projects",s);await(0,a_.mkdir)(u,{recursive:!0});let d=(0,pc.join)(u,`${e}.jsonl`);await R8r(d,c);let f=n?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,h=f??(0,pc.join)((0,uve.homedir)(),".claude"),m;try{m=await(0,a_.readFile)((0,pc.join)(h,".credentials.json"),"utf-8")}catch(g){if(!O8e(g))throw g}if(!f&&!(n??process.env).ANTHROPIC_API_KEY&&!(n??process.env).CLAUDE_CODE_OAUTH_TOKEN&&(m=await $tl()??m),await Gtl(m,(0,pc.join)(l,".credentials.json")),await Htl((0,pc.join)(f??(0,uve.homedir)(),".claude.json"),(0,pc.join)(l,".claude.json")),t.listSubkeys){let g=(0,pc.join)(u,e),A=await Vie(t.listSubkeys({projectKey:s,sessionId:e}),o,`SessionStore.listSubkeys() timed out after ${o}ms for session ${e}`);for(let y of A){let E=(0,pc.resolve)(g,y+".jsonl");if(!y||(0,pc.isAbsolute)(y)||y.split(/[\\/]/).includes("..")||!E.startsWith(g+pc.sep)){ru(`[SessionStore] skipping unsafe subpath from listSubkeys: ${y}`,{level:"warn"});continue}let _=await Vie(t.load({projectKey:s,sessionId:e,subpath:y}),o,`SessionStore.load() timed out after ${o}ms for session ${e} subpath ${y}`);if(!_||_.length===0)continue;let v=[],b=[];for(let T of _)g6r(T)?v.push(T):b.push(T);if(b.length>0&&(await(0,a_.mkdir)((0,pc.dirname)(E),{recursive:!0}),await R8r(E,b)),v.length>0){let T=v.at(-1),w=(0,pc.resolve)(g,y+".meta.json");await(0,a_.mkdir)((0,pc.dirname)(w),{recursive:!0});let{type:R,...x}=T;await(0,a_.writeFile)(w,Qm(x),{mode:384})}}}return l}catch(u){throw await lwt(l),u}}function h6r(t,e,r,n){let{systemPrompt:o,settings:s,managedSettings:c,settingSources:l,sandbox:u,...d}=t??{},f,h,m;o===void 0?f="":typeof o=="string"||Array.isArray(o)?f=o:o.type==="preset"&&(h=o.append,m=o.excludeDynamicSections),process.env.CLAUDE_AGENT_SDK_VERSION="0.3.159";let{abortController:g=t8r(),additionalDirectories:A=[],agent:y,agents:E,allowedTools:_=[],betas:v,canUseTool:b,continue:T,cwd:w,debug:R,debugFile:x,disallowedTools:P=[],tools:D,env:N,executable:L=hZi()?"bun":"node",executableArgs:B=[],extraArgs:q={},fallbackModel:M,enableFileCheckpointing:O,toolConfig:j,forkSession:Q,hooks:U,includeHookEvents:Y,includePartialMessages:W,forwardSubagentText:V,onElicitation:z,persistSession:ie,sessionStore:H,sessionStoreFlush:re,thinking:le,effort:Le,maxThinkingTokens:ge,maxTurns:Ue,maxBudgetUsd:ke,taskBudget:X,mcpServers:ee,model:K,outputFormat:he,permissionMode:Z="default",allowDangerouslySkipPermissions:ue=!1,permissionPromptToolName:qe,plugins:ne,getOAuthToken:ce,getHostAuthToken:Ne,workload:we,resume:Be,resumeSessionAt:rt,sessionId:st,skills:_t,stderr:Dt,strictMcpConfig:$t}=d;if(H&&ie===!1)throw Error("sessionStore cannot be used with persistSession: false -- the storage adapter requires local writes to mirror from. Use CLAUDE_CONFIG_DIR=/tmp for ephemeral local writes with external mirroring.");if(H&&T&&!Be&&!H.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");if(H&&O)throw Error("enableFileCheckpointing is not yet supported with sessionStore (backup blobs are not mirrored, so rewindFiles() fails after a store-backed resume).");H&&d.spawnClaudeCodeProcess&&ru("sessionStore with custom spawnClaudeCodeProcess: ensure the subprocess CLAUDE_CONFIG_DIR matches the parent (same path, same separators) or transcript_mirror frames will be dropped.",{level:"warn"});let Gt=d.pathToClaudeCodeExecutable;if(!Gt){let Ge=(0,aZi.fileURLToPath)(importMetaUrlShim),J=(0,oZi.createRequire)(Ge),se=ZHc(me=>J.resolve(me));if(!se)throw Error(`Native CLI binary for ${process.platform}-${process.arch} not found. Reinstall @anthropic-ai/claude-agent-sdk without --omit=optional, or set options.pathToClaudeCodeExecutable.`);Gt=se}let Ie=he?.type==="json_schema"?he.schema:void 0,F=N?{...N}:{...process.env};F.CLAUDE_CODE_ENTRYPOINT||(F.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),F.CLAUDE_AGENT_SDK_VERSION||(F.CLAUDE_AGENT_SDK_VERSION="0.3.159"),O&&(F.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true"),ce&&(F.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1"),Ne&&(F.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1"),j?.askUserQuestion?.previewFormat&&(F.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=j.askUserQuestion.previewFormat);let be={};if(wKi.propagation.inject(wKi.context.active(),be),"traceparent"in be)for(let Ge of["TRACEPARENT","TRACESTATE"])Ge in(N??{})||delete F[Ge];for(let[Ge,J]of Object.entries(be)){let se=Ge.toUpperCase();se in(N??{})||(F[se]=J)}let Qe={},pe=new Map;if(ee)for(let[Ge,J]of Object.entries(ee))J.type==="sdk"&&J.instance?pe.set(Ge,J.instance):Qe[Ge]=J;let Se;if(le)switch(le.type){case"adaptive":Se={type:"adaptive",display:le.display};break;case"enabled":Se={type:"enabled",budgetTokens:le.budgetTokens,display:le.display};break;case"disabled":Se={type:"disabled"};break}else ge!==void 0&&(Se=ge===0?{type:"disabled"}:{type:"enabled",budgetTokens:ge});r&&(F.CLAUDE_CONFIG_DIR=r,process.platform==="win32"&&(F.CLAUDE_SECURESTORAGE_CONFIG_DIR=N?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??N?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??""));let Fe=new S8r({abortController:g,additionalDirectories:A,agent:y,betas:v,cwd:w,debug:R,debugFile:x,executable:L,executableArgs:B,extraArgs:we?{...q,workload:we}:q,pathToClaudeCodeExecutable:Gt,env:F,forkSession:Q,stderr:Dt,thinkingConfig:Se,effort:Le,maxTurns:Ue,maxBudgetUsd:ke,taskBudget:X,model:K,fallbackModel:M,jsonSchema:Ie,permissionMode:Z,allowDangerouslySkipPermissions:ue,permissionPromptToolName:qe,continueConversation:H?void 0:T,resume:Be,resumeSessionAt:rt,sessionId:st,settings:typeof s=="object"?Qm(s):s,managedSettings:c?Qm(c):void 0,settingSources:l,skills:_t,allowedTools:_,disallowedTools:P,tools:D,mcpServers:Qe,strictMcpConfig:$t,canUseTool:!!b,hooks:!!U,includeHookEvents:Y,includePartialMessages:W,persistSession:ie,sessionMirror:!!H,plugins:ne,sandbox:u,spawnClaudeCodeProcess:d.spawnClaudeCodeProcess,deferSpawn:n}),te={systemPrompt:f,appendSystemPrompt:h,planModeInstructions:d.planModeInstructions,appendSubagentSystemPrompt:d.appendSubagentSystemPrompt,toolAliases:d.toolAliases,excludeDynamicSections:m,agents:E,title:d.title,skills:_t,webSearchIsolationExemptMcpServers:d.webSearchIsolationExemptMcpServers,promptSuggestions:d.promptSuggestions,agentProgressSummaries:d.agentProgressSummaries,forwardSubagentText:V},Te=new I8r(Fe,e,b,U,g,pe,Ie,te,z,ce,Ne);if(H){let Ge=a(()=>(0,pc.join)(F.CLAUDE_CONFIG_DIR??(0,pc.join)((0,uve.homedir)(),".claude"),"projects"),"S6"),J=re==="eager",se=new x8r(async(me,Ce)=>{let He=UJi(me,Ge());He?await H.append(He,Ce):ru(`[SessionStore] dropping mirror frame: filePath ${me} is not under ${Ge()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},void 0,(me,Ce)=>{let He=UJi(me,Ge());He&&Te.reportMirrorError(He,Ce.message)},J?0:W6r,J?0:z6r);Te.setTranscriptMirrorBatcher(se)}return{queryInstance:Te,transport:Fe,abortController:g,processEnv:F}}function m6r(t,e,r,n){typeof r=="string"?e.write(Qm({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:r}]},parent_tool_use_id:null})+` -`):t.streamInput(r).catch(o=>n.abort(o))}async function lwt(t){for(let e=0;;e++)try{return await(0,a_.rm)(t,{recursive:!0,force:!0})}catch(r){if(e>=4||!Vtl.has(PI(r)??""))return;await lZi((e+1)*100)}}function Wtl(t,e){t.waitForExit().catch(()=>{}).finally(()=>lwt(e))}function ztl({prompt:t,options:e}){if((e?.resume||e?.continue)&&e?.sessionStore){let{queryInstance:s,transport:c,abortController:l,processEnv:u}=h6r({...e},typeof t=="string",void 0,!0),d=(0,pc.resolve)(e.cwd??"."),f=e.sessionStore,h=e.loadTimeoutMs??6e4,m=e.resume;return(async()=>{if(m||(m=(await Vie(f.listSessions(bk(d)),h,`SessionStore.listSessions() timed out after ${h}ms`)).slice().sort((g,A)=>A.mtime-g.mtime)[0]?.sessionId),!!m)return moo(f,m,d,e.env,e.loadTimeoutMs)})().then(g=>{if(g){c.updateResume(m);let A={CLAUDE_CONFIG_DIR:g};if(process.platform==="win32"){let y=e.env?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??e.env?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??"";A.CLAUDE_SECURESTORAGE_CONFIG_DIR=y,u.CLAUDE_SECURESTORAGE_CONFIG_DIR=y}c.updateEnv(A),u.CLAUDE_CONFIG_DIR=g,s.addCleanupCallback(()=>Wtl(c,g))}s.isClosed()||c.spawn()}).catch(g=>{let A=M8e(g);c.spawnAbort(A),s.setError(A)}),m6r(s,c,t,l),s}let{queryInstance:r,transport:n,abortController:o}=h6r(e,typeof t=="string");return m6r(r,n,t,o),r}async function Ytl({options:t,initializeTimeoutMs:e=6e4}={}){let r,n=t?.resume;if((n||t?.continue)&&t?.sessionStore){let l=(0,pc.resolve)(t.cwd??".");if(!n){if(!t.sessionStore.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");let u=t.loadTimeoutMs??6e4;n=(await Vie(t.sessionStore.listSessions(bk(l)),u,`SessionStore.listSessions() timed out after ${u}ms`)).slice().sort((d,f)=>f.mtime-d.mtime)[0]?.sessionId}n&&(r=await moo(t.sessionStore,n,l,t.env,t.loadTimeoutMs))}let o,s,c;try{let l=a(function(){m||(m=!0,h.close())},"z"),u=h6r(r&&n&&n!==t?.resume?{...t,resume:n}:t,!1,r);o=u.queryInstance;let{transport:d,abortController:f}=u;s=d;let h=u.queryInstance;if(r){let g=r;h.addCleanupCallback(()=>{c=d.waitForExit().catch(()=>{}).then(()=>lwt(g))})}await Vie(h.initializationResult(),e,`Subprocess initialization did not complete within ${e}ms \u2014 check authentication and network connectivity`);let m=!1;return{query(g){if(m)throw Error("WarmQuery.query() can only be called once");m=!0;try{m6r(h,d,g,f)}catch(A){throw h.close(),A}return typeof g=="string"&&h.setIsSingleUserTurn(!0),h},close:l,async[Symbol.asyncDispose](){m=!0,h.close(),await c}}}catch(l){if(o?.close(),r&&!c){let u=s;c=(u?u.waitForExit().catch(()=>{}):Promise.resolve()).then(()=>lwt(r))}throw await c,l}}async function Ktl(t,e){return e?.sessionStore?lrl(e.sessionStore,t,e):OGc(t,e)}async function Jtl(t){return t?.sessionStore?arl(t.sessionStore,t):jGc(t)}async function Ztl(t,e){return e?.sessionStore?url(e.sessionStore,t,e):HGc(t,e)}async function Xtl(t,e,r){return r?.sessionStore?drl(r.sessionStore,t,e,r.dir):GGc(t,e,r)}async function erl(t,e,r){return r?.sessionStore?frl(r.sessionStore,t,e,r.dir):$Gc(t,e,r)}async function trl(t,e){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);if(e?.sessionStore){if(!e.sessionStore.delete)return;let r=bk(e.dir);await e.sessionStore.delete({projectKey:r,sessionId:t});return}return VGc(t,e)}async function rrl(t,e){return e?.sessionStore?prl(e.sessionStore,t,e):ZGc(t,e)}async function nrl(t,e,r){if(!bh(t))throw Error(`Invalid sessionId: ${t}`);let n=await Iwt(t,r?.dir);if(!n)throw Error(`Session ${t} not found`);let o=bk(r?.dir),s=r?.batchSize&&r.batchSize>0?r.batchSize:W6r;if(await LJi(n.filePath,{projectKey:o,sessionId:t},e,s),r?.includeSubagents===!1)return;let c=n.filePath.replace(/\.jsonl$/,""),l=(0,pc.join)(c,"subagents");for(let u of await irl(l)){let d=(0,pc.relative)(c,u).split(pc.sep);d[d.length-1]=d.at(-1).replace(/\.jsonl$/,"");let f={projectKey:o,sessionId:t,subpath:d.join("/")};await LJi(u,f,e,s);let h=u.replace(/\.jsonl$/,".meta.json");try{let m=GN(await(0,a_.readFile)(h,"utf8"));await e.append(f,[{type:"agent_metadata",...m}])}catch(m){if(!O8e(m))throw m}}}async function LJi(t,e,r,n){let o=(0,sZi.createInterface)({input:(0,Awt.createReadStream)(t,{encoding:"utf8"}),crlfDelay:1/0}),s=[],c=0;for await(let l of o)l&&(s.push(GN(l)),c+=l.length,(s.length>=n||c>=z6r)&&(await r.append(e,s),s=[],c=0));s.length>0&&await r.append(e,s)}async function irl(t){let e=[];async function r(n){let o;try{o=await(0,a_.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o){let c=(0,pc.join)(n,s.name);s.isDirectory()?await r(c):s.isFile()&&s.name.endsWith(".jsonl")&&e.push(c)}}return a(r,"J"),await r(t),e}async function orl(t,e){return e?.sessionStore?hrl(e.sessionStore,t,e.dir):i$c(t,e)}async function srl(t,e,r){return r?.sessionStore?mrl(r.sessionStore,t,e,r):o$c(t,e,r)}function goo(t){let e=(0,pc.resolve)(t??"."),r;try{r=(0,Awt.realpathSync)(e)}catch{r=e}return r.normalize("NFC")}function bk(t){return B8e(goo(t))}function Aoo(t){return t.map(e=>Qm(e)).join(` +`),encoding:o,lineEndings:c}}function ERt(t){return etl(t).content}function bso(t){return t.startsWith("\uFEFF")?t.slice(1):t}function itl(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),Swt.default.platform==="darwin"?ttl(t):Swt.default.platform==="win32"?rtl(t):ntl(t)}function otl(){return process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC?"essential-traffic":process.env.DISABLE_TELEMETRY||d_(process.env.DO_NOT_TRACK)?"no-telemetry":"default"}function stl(){return otl()==="essential-traffic"}function ctl(t){K8r.length>=atl&&K8r.shift(),K8r.push(t)}function Sso(t){let e=o6e(t);try{if(d_(process.env.CLAUDE_CODE_USE_BEDROCK)||d_(process.env.CLAUDE_CODE_USE_VERTEX)||d_(process.env.CLAUDE_CODE_USE_FOUNDRY)||d_(process.env.CLAUDE_CODE_USE_ANTHROPIC_AWS)||d_(process.env.CLAUDE_CODE_USE_MANTLE)||process.env.DISABLE_ERROR_REPORTING||stl())return;let r={error:e.stack||e.message,timestamp:new Date().toISOString()};if(ctl(r),hXi===null){ltl.push({type:"error",error:e});return}hXi.logError(e)}catch{}}function dtl(t,e,r=100){let n=new u9r({max:r}),o=a((...s)=>{let c=e(...s),l=n.get(c);if(l!==void 0)return l;let u=t(...s);return n.set(c,u),u},"X");return o.cache={clear:a(()=>n.clear(),"clear"),size:a(()=>n.size,"size"),delete:a(s=>n.delete(s),"delete"),get:a(s=>n.peek(s),"get"),has:a(s=>n.has(s),"has")},o}function wso(t,e){try{return{ok:!0,value:JSON.parse(bso(t))}}catch(r){return e&&Sso(r),{ok:!1}}}function Stl(){let t=G.object({type:G.literal("command").describe("Shell command hook type"),command:G.string().describe("Shell command to execute"),args:G.array(G.string()).optional().describe("Argument list for exec form. When present, `command` is resolved as an executable and spawned directly with these arguments \u2014 no shell. Path placeholders like ${CLAUDE_PLUGIN_ROOT} are substituted per-element as plain strings, so paths with quotes, $, or backticks never reach a shell parser. When absent, `command` runs through a shell (bash on POSIX, PowerShell on Windows without Git Bash)."),if:p8e(),shell:G.enum(btl).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:G.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:G.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:G.string().min(1).optional().describe("@internal Custom prefix for the system-reminder shown to the model when an asyncRewake hook exits with code 2. The hook output is appended after this prefix."),rewakeSummary:G.string().min(1).optional().describe('@internal One-line summary shown to the user in the terminal when an asyncRewake hook exits with code 2. Defaults to "Stop hook feedback".')}),e=G.object({type:G.literal("prompt").describe("LLM prompt hook type"),prompt:G.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:p8e(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:G.string().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-4-6"). If not specified, uses the default small fast model.'),continueOnBlock:G.boolean().optional().describe(`Sets the continue value for the decision:"block" produced when ok is false. Default false (turn ends). Whether continue:true lets the turn proceed depends on the event's decision:"block" semantics. On PostToolUse, the reason is fed back to Claude and the turn continues.`),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),r=G.object({type:G.literal("mcp_tool").describe("MCP tool hook type"),server:G.string().describe("Name of an already-configured MCP server to invoke"),tool:G.string().describe("Name of the tool on that server to call"),input:G.record(G.string(),G.unknown()).optional().describe('Arguments passed to the MCP tool. String values support ${path} interpolation from the hook input JSON (e.g. "${tool_input.file_path}").'),if:p8e(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),n=G.object({type:G.literal("http").describe("HTTP hook type"),url:G.string().url().describe("URL to POST the hook input JSON to"),if:p8e(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific request"),headers:G.record(G.string(),G.string()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:G.array(G.string()).optional().describe("Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),o=G.object({type:G.literal("agent").describe("Agentic verifier hook type"),prompt:G.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:p8e(),timeout:G.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:G.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-4-6"). If not specified, uses Haiku.'),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:t,PromptHookSchema:e,HttpHookSchema:n,AgentHookSchema:o,McpToolHookSchema:r}}function Utl(t){return Dso.has(t.toLowerCase())?!1:Ftl.test(t)?!0:Btl.test(t)}function crl(t){let e=srl();return t.flatMap((r,n)=>{let o=e.safeParse(r);if(o.success)return[o.data];let s=arl().safeParse(r).data?.name,c=o.error.issues.map(l=>`${l.path.join(".")}: ${l.message}`).join(", ");return s?(nu(`Stubbing unparseable marketplace plugin entry (${s}): ${c}`,{level:"warn"}),[{name:s,source:{source:"unsupported"},strict:!0}]):(nu(`Dropping unparseable marketplace plugin entry (index ${n}): ${c}`,{level:"warn"}),[])})}function qso(){return Erl.filter(t=>CRt[t].buildGate())}function _rl(t){let e={};for(let r of t)e={...e,...CRt[r].shape()};return e}function vrl(t){let e={};for(let r of t)e={...e,...CRt[r].permissionsShape?.()};return e}function Crl(t){let e=[];for(let r of t)e.push(...CRt[r].permissionModes?.()??[]);return e}function brl(t){let e=t.split("__"),[r,n,...o]=e;if(r!=="mcp"||!n)return null;let s=o.length>0?o.join("__"):void 0;return{serverName:n,toolName:s}}function Eve(t){return Object.hasOwn(_Xi,t)?_Xi[t]:t}function Srl(t){return t.replaceAll("\\(","(").replaceAll("\\)",")").replaceAll("\\\\","\\")}function Trl(t){let e=Irl(t,"(");if(e===-1)return{toolName:Eve(t)};let r=xrl(t,")");if(r===-1||r<=e)return{toolName:Eve(t)};if(r!==t.length-1)return{toolName:Eve(t)};let n=t.substring(0,e),o=t.substring(e+1,r);if(!n)return{toolName:Eve(t)};if(o===""||o==="*")return{toolName:Eve(n)};let s=Srl(o);return{toolName:Eve(n),ruleContent:s}}function Irl(t,e){for(let r=0;r=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function xrl(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]===e){let n=0,o=r-1;for(;o>=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function wrl(t){return wwt.filePatternTools.includes(t)}function Rrl(t){return wwt.bashPrefixTools.includes(t)}function krl(t){return Object.hasOwn(wwt.customValidation,t)?wwt.customValidation[t]:void 0}function Hso(t,e){let r=0,n=e-1;for(;n>=0&&t[n]==="\\";)r++,n--;return r%2!==0}function Z8r(t,e){let r=0;for(let n=0;n0?{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${n.toolName}" without parentheses, or use "mcp__${o.serverName}__*" for all tools`,examples:[`mcp__${o.serverName}`,`mcp__${o.serverName}__*`,o.toolName&&o.toolName!=="*"?`mcp__${o.serverName}__${o.toolName}`:void 0].filter(Boolean)}:{valid:!0};if(!n.toolName||n.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(!n.toolName.includes("_")&&n.toolName[0]!==n.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${gVc(String(n.toolName))}"`};let s=krl(n.toolName);if(s&&n.ruleContent!==void 0){let c=s(n.ruleContent);if(!c.valid)return c}if(Rrl(n.toolName)&&n.ruleContent!==void 0){let c=n.ruleContent;if(c.includes(":*")&&!c.endsWith(":*"))return{valid:!1,error:"The :* pattern must be at the end",suggestion:"Move :* to the end for prefix matching, or use * for wildcard matching",examples:["Bash(npm run:*) - prefix matching (legacy)","Bash(npm run *) - wildcard matching"]};if(c===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]}}if(wrl(n.toolName)&&n.ruleContent!==void 0){let c=n.ruleContent;if(c.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${n.toolName}(*.ts) - matches .ts files`,`${n.toolName}(src/**) - matches all files in src`,`${n.toolName}(**/*.test.ts) - matches test files`]};if(c.includes("*")&&!c.match(/^\*|\*$|\*\*|\/\*|\*\.|\*\)/)&&!c.includes("**"))return{valid:!1,error:"Wildcard placement might be incorrect",suggestion:"Wildcards are typically used at path boundaries",examples:[`${n.toolName}(*.js) - all .js files`,`${n.toolName}(src/*) - all files directly in src`,`${n.toolName}(src/**) - all files recursively in src`]}}return{valid:!0}}function $so(t){return G.object({allow:G.array(X8r()).optional().describe("List of permission rules for allowed operations"),deny:G.array(X8r()).optional().describe("List of permission rules for denied operations"),ask:G.array(X8r()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:G.enum([...dQr,...Crl(t)]).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:G.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),...vrl(t),additionalDirectories:G.array(G.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}function Orl(t){return G.object({$schema:G.literal(yrl).optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:G.string().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:G.string().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:G.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:G.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:G.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),policyHelper:Mrl().optional().describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),...d_(process.env.CLAUDE_CODE_ENABLE_XAA)&&{xaaIdp:G.object({issuer:G.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:G.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:G.number().int().positive().optional().describe("Fixed loopback callback port for the IdP OIDC login. Only needed if the IdP does not honor RFC 8252 port-any matching.")}).optional().describe("XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.")},fileSuggestion:G.object({type:G.literal("command"),command:G.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:G.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:G.object({enabled:G.boolean().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:G.number().int().positive().optional().describe("Minutes of continuous use before the reminder fires (default 120). Re-fires every interval until you take a break."),breakThresholdMinutes:G.number().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 15)"),message:G.string().optional().describe("Custom reminder text. Leave unset for a rotating set of friendly nudges.")}).optional().describe("@internal Opt-in break reminder. When enabled, shows a dismissible nudge after sustained continuous use. Never blocks \u2014 just a friendly heads-up."),quietHours:G.object({enabled:G.boolean().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:G.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "22:00")').optional().describe('Start of the quiet-hours window, 24-hour local time "HH:MM".'),end:G.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "07:00")').optional().describe('End of the quiet-hours window, 24-hour local time "HH:MM". May be earlier than start for an overnight range.')}).optional().describe("@internal Opt-in quiet hours. When enabled, shows a single soft nudge per session while inside the configured local-time window. Never blocks."),cleanupPeriodDays:G.number().int().positive().optional().describe("Number of days to retain chat transcripts before automatic cleanup (default: 30). Minimum 1. Use a large value for long retention; use --no-session-persistence to disable transcript writes entirely."),skillListingMaxDescChars:G.number().int().positive().optional().describe("Per-skill description character cap in the skill listing sent to Claude (default: 1536). Descriptions longer than this are truncated. Raise to opt in to higher per-turn context cost."),skillListingBudgetFraction:G.number().gt(0).lte(1).optional().describe("Fraction of the context window (in characters) reserved for the skill listing sent to Claude (default: 0.01 = 1%). When the listing exceeds this, descriptions are shortened to fit. Raise to opt in to higher per-turn context cost."),wslInheritsWindowsSettings:G.boolean().optional().describe("When set to true in either admin-only Windows source \u2014 the HKLM SOFTWARE/Policies/ClaudeCode registry key or C:/Program Files/ClaudeCode/managed-settings.json \u2014 WSL reads managed settings from the full Windows policy chain (HKLM, C:/Program Files/ClaudeCode via DrvFs, HKCU) in addition to /etc/claude-code. Windows sources take priority. The flag is also required in HKCU itself for HKCU policy to apply on WSL (double opt-in: admin enables the chain, user confirms HKCU). On native Windows the flag has no effect."),env:Drl().optional().describe("Environment variables to set for Claude Code sessions"),attribution:G.object({commit:G.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:G.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution.")}).optional().describe("Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set."),includeCoAuthoredBy:G.boolean().optional().describe("Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)"),includeGitInstructions:G.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:$so(t).optional().describe("Tool usage permissions configuration"),model:G.string().optional().describe("Override the default model used by Claude Code"),availableModels:G.array(G.string()).optional().describe('Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.'),modelOverrides:G.record(G.string(),G.string()).optional().describe('Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.'),enableAllProjectMcpServers:G.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:G.array(G.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:G.array(G.string()).optional().describe("List of rejected MCP servers from .mcp.json"),skillOverrides:G.record(G.string(),G.enum(["on","name-only","user-invocable-only","off"])).optional().describe('Per-skill listing overrides keyed by skill name. "name-only" lists the skill without its description; "user-invocable-only" hides it from the model but keeps /name; "off" hides it from both. Absent = on.'),allowedMcpServers:G.array(Vso()).optional().describe("Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:G.array(Wso()).optional().describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:Iwt().optional().describe("Custom commands to run before/after tool executions"),worktree:G.object({symlinkDirectories:G.array(G.string()).optional().describe('Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"'),sparsePaths:G.array(G.string()).optional().describe("Directories to include when creating worktrees, via git sparse-checkout (cone mode). Dramatically faster in large monorepos \u2014 only the listed paths are written to disk."),baseRef:G.enum(["fresh","head"]).optional().describe("Which ref new worktrees branch from. 'fresh' (default) branches from origin/ for a clean tree. 'head' branches from your current local HEAD so unpushed commits and feature-branch state are present. Applies to --worktree, EnterWorktree, and agent isolation."),bgIsolation:G.enum(["worktree","none"]).optional().catch(void 0).describe("Isolation mode for background sessions in this repo. 'worktree' (default) blocks Edit/Write in the main checkout until EnterWorktree is called. 'none' lets background jobs edit the working copy directly.")}).optional().describe("Git worktree configuration for --worktree flag."),disableAllHooks:G.boolean().optional().describe("Disable all hooks and statusLine execution"),disableAgentView:G.boolean().optional().describe("Disable agent view (`claude agents`, `--bg`, /background, the on-demand daemon). Typically set in managed settings. Equivalent to CLAUDE_CODE_DISABLE_AGENT_VIEW=1."),disableRemoteControl:G.boolean().optional().describe("Disable Remote Control (claude.ai/code, `claude remote-control`, `--remote-control`/`--rc`, auto-start, and the in-session toggle). Typically set in managed settings."),disableWorkflows:G.boolean().optional().describe("Disable the Workflows feature (also via CLAUDE_CODE_DISABLE_WORKFLOWS)."),enableWorkflows:G.boolean().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowKeywordTriggerEnabled:G.boolean().optional().describe('Enable the "workflow"/"workflows" keyword trigger that opts a prompt into the Workflow tool. Set to false to type the word without triggering a workflow. Default: true.'),disableSkillShellExecution:G.boolean().optional().describe("Disable inline shell execution in skills and custom slash commands from user, project, or plugin sources. Commands are replaced with a placeholder instead of being run."),defaultShell:G.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),allowManagedHooksOnly:G.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowedHttpHookUrls:G.array(G.string()).optional().describe('Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).'),httpHookAllowedEnvVars:G.array(G.string()).optional().describe("Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers)."),allowManagedPermissionRulesOnly:G.boolean().optional().describe("When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored."),allowManagedMcpServersOnly:G.boolean().optional().describe("When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies."),allowAllClaudeAiMcps:G.boolean().optional().describe("When true (and set in managed settings), claude.ai cloud MCP connectors load alongside managed-mcp.json instead of being suppressed by its exclusive-control lockdown. Default off preserves the lockdown. Read from managed settings only."),strictPluginOnlyCustomization:G.preprocess(e=>Array.isArray(e)?e.filter(r=>vXi.includes(r)):e,G.union([G.boolean(),G.array(G.enum(vXi))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. Composes with strictKnownMarketplaces for end-to-end admin control \u2014 plugins gated by marketplace allowlist, everything else blocked here.'),statusLine:G.object({type:G.literal("command"),command:G.string(),padding:G.number().optional(),refreshInterval:G.number().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:G.boolean().optional().describe("Hide the built-in `-- INSERT --` / `-- VISUAL --` indicator below the prompt. Use this when your status line script renders `vim.mode` itself.")}).optional().describe("Custom status line display configuration"),prUrlTemplate:G.string().optional().describe('URL template for PR links in the footer badge and inline messages. Placeholders: {host} {owner} {repo} {number} {url}. Example: "https://reviews.example.com/{owner}/{repo}/pull/{number}"'),subagentStatusLine:G.object({type:G.literal("command"),command:G.string()}).optional().describe("Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:G.record(G.string(),G.union([G.array(G.string()),G.boolean(),G.undefined()])).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints. Settings precedence is user < project < local < flag < policy, so to disable a plugin that project settings enable, set it to false in .claude/settings.local.json \u2014 setting false in ~/.claude/settings.json is overridden by the project.'),extraKnownMarketplaces:G.record(G.string(),Nrl()).check(e=>{for(let[r,n]of Object.entries(e.value))n.source.source==="settings"&&n.source.name!==r&&e.issues.push({code:"custom",input:n.source.name,path:[r,"source","name"],message:`Settings-sourced marketplace name must match its extraKnownMarketplaces key (got key "${r}" but source.name "${n.source.name}")`})}).optional().describe("Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources."),strictKnownMarketplaces:G.array(xwt()).optional().describe("Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem. Note: this is a policy gate only \u2014 it does NOT register marketplaces. To pre-register allowed marketplaces for users, also set extraKnownMarketplaces."),blockedMarketplaces:G.array(xwt()).optional().describe("Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem."),pluginSuggestionMarketplaces:G.array(G.string()).optional().describe("Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips), in addition to the official marketplace. Only honored when set in managed settings (policy scope); the key is ignored in user, project, and local settings. A name only takes effect when the marketplace is registered on the machine AND its registered source is also declared in managed settings, either as the extraKnownMarketplaces entry for that name or as an entry of strictKnownMarketplaces. A marketplace registered from a different source under an allowlisted name is ignored."),forceLoginMethod:G.enum(["claudeai","console"]).optional().describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing'),parentSettingsBehavior:G.enum(["first-wins","merge"]).optional().describe(`Controls whether the SDK parent tier (Options.managedSettings / --managed-settings) layers under this admin tier. "first-wins" (default): parent is dropped \u2014 admin tiers are the only policy source. "merge": parent's restrictive-only-filtered settings union under the admin winner. Has no effect when no admin tier exists (parent applies as the sole policy tier, still filtered restrictive-only).`),forceLoginOrgUUID:G.union([G.string(),G.array(G.string())]).optional().describe("Organization UUID to require for OAuth login. Accepts a single UUID string or an array of UUIDs (any one is permitted). When set in managed settings, login fails if the authenticated account does not belong to a listed organization."),forceRemoteSettingsRefresh:G.boolean().optional().describe("When set in managed settings, the CLI blocks startup until remote managed settings are freshly fetched, and exits if the fetch fails"),otelHeadersHelper:G.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:G.string().optional().describe("Controls the output style for assistant responses"),viewMode:G.enum(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:G.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:G.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:mtl().optional(),feedbackSurveyRate:G.number().min(0).max(1).optional().describe("Probability (0\u20131) that the session quality survey appears when eligible. 0.05 is a reasonable starting point."),spinnerTipsEnabled:G.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:G.object({mode:G.enum(["append","replace"]),verbs:G.array(G.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:G.object({excludeDefault:G.boolean().optional(),tips:G.array(G.string())}).optional().describe("Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false)."),syntaxHighlightingDisabled:G.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),terminalTitleFromRename:G.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),alwaysThinkingEnabled:G.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:G.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),ultracode:G.boolean().optional().catch(void 0).describe("Enable ultracode for the session: xhigh effort plus standing dynamic-workflow orchestration. Session-scoped \u2014 typically provided via --settings or the apply_flag_settings control request; interactive toggles never persist it. Requires workflows to be enabled and an xhigh-capable model."),autoCompactWindow:G.number().int().min(1e5).max(1e6).optional().catch(void 0).describe("Auto-compact window size"),advisorModel:G.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:G.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:G.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:G.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),awaySummaryEnabled:G.boolean().optional().describe("@internal When false, the session recap (shown when you return after being away for 5+ minutes) is disabled. When absent or true, recap is enabled. Hidden from public SDK types until external launch."),showClearContextOnPlanAccept:G.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),agent:G.string().optional().describe("Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model."),companyAnnouncements:G.array(G.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:G.record(G.string(),G.object({mcpServers:G.record(G.string(),G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.array(G.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.array(G.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")})).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:G.object({defaultEnvironmentId:G.string().optional().describe("Default environment ID to use for remote sessions")}).optional().describe("Remote session configuration"),autoUpdatesChannel:G.enum(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:G.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),plansDirectory:G.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:G.enum(["default","fullscreen"]).optional().describe('Terminal UI renderer. "fullscreen" uses the flicker-free alt-screen renderer with virtualized scrollback (equivalent to CLAUDE_CODE_NO_FLICKER=1). "default" uses the classic main-screen renderer.'),voice:G.object({enabled:G.boolean().optional(),mode:G.enum(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:G.boolean().optional().describe("Submit the prompt when hold-to-talk is released (hold mode only)")}).optional().describe("Voice mode settings (hold-to-talk / tap-to-toggle dictation)"),channelsEnabled:G.boolean().optional().describe("Managed-org opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). claude.ai Teams/Enterprise: default off. Console: default on unless managed settings exist. Set true to allow; users then select servers via --channels."),allowedChannelPlugins:G.array(G.object({marketplace:G.string(),plugin:G.string()})).optional().describe("Managed-org allowlist of channel plugins. When set, replaces the default Anthropic allowlist \u2014 admins decide which plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true."),prefersReducedMotion:G.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),doneMeansMerged:G.boolean().optional().describe("@internal When true, Claude keeps working until the PR is ready for you to merge, a cron/Monitor is armed to resume later, or it hands you a self-contained next step."),autoMemoryEnabled:G.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:G.string().optional().describe("Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects//memory/."),autoDreamEnabled:G.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:G.boolean().optional().describe("Request API-side thinking summaries and show them in the conversation and in the transcript view (ctrl+o). Set explicitly to override the default for your install."),skipDangerousModePermissionPrompt:G.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:G.boolean().optional().describe("@internal Whether the user has accepted the multi-agent workflow usage warning. Until set, auto permission mode prompts before running a workflow."),disableAutoMode:G.enum(["disable"]).optional().describe("Disable auto mode"),sshConfigs:G.array(G.object({id:G.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:G.string().describe("Display name for the SSH connection"),sshHost:G.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:G.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:G.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:G.string().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh [dir]`.")})).optional().describe("SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members."),claudeMd:G.string().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:G.array(G.string()).optional().describe('Glob patterns or absolute paths of CLAUDE.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/CLAUDE.md", "**/code/CLAUDE.md", "**/some-dir/.claude/rules/**"'),pluginTrustMessage:G.string().optional().describe('Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").'),theme:G.union([G.enum(_tl),G.string().startsWith("custom:").transform(e=>e)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:G.enum(Atl).optional().catch(void 0).describe("Key binding mode for the prompt input"),verbose:G.boolean().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:G.enum(gtl).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:G.boolean().optional().describe("Automatically compact conversation when context fills"),autoScrollEnabled:G.boolean().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),fileCheckpointingEnabled:G.boolean().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:G.boolean().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:G.boolean().optional().describe("Stamp each assistant message with its arrival time"),terminalProgressBarEnabled:G.boolean().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:G.boolean().optional().describe("Enable the todo / task tracking panel"),teammateMode:G.enum(ytl).optional().catch(void 0).describe("How spawned teammates execute (tmux, in-process, auto)"),remoteControlAtStartup:G.boolean().optional().describe("Start Remote Control bridge automatically each session"),isolatePeerMachines:G.boolean().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:G.enum(["transient","ask"]).optional().describe("When no background service is running: 'transient' spawns one for this login session; 'ask' offers to install it persistently"),autoUploadSessions:G.boolean().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:G.boolean().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:G.boolean().optional().describe("Allow Claude to push proactive mobile notifications"),..._rl(t)}).passthrough()}function Frl(t){let e=Lrl.find(n=>n.matches(t));if(!e)return null;let r={...e.tip};return t.code==="invalid_value"&&t.enumValues&&!r.suggestion&&(r.suggestion=`Valid values: ${t.enumValues.map(n=>`"${n}"`).join(", ")}`),!r.docLink&&t.path&&(r.docLink=Brl[yVc(t.path,".")]),r}function CXi(t){return t.code==="invalid_type"}function bXi(t){return t.code==="invalid_value"}function Url(t){return t.code==="unrecognized_keys"}function SXi(t){return t.code==="too_small"}function Rve(t){return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":typeof t}function TXi(t){let e=t.match(/received (\w+)/);return e?e[1]:void 0}function v6e(t,e){return t.issues.map(r=>{let n=r.path.map(String).join("."),o=r.message,s,c,l,u,d;if(bXi(r))c=r.values.map(h=>String(h)),l=c.join(" | "),u=void 0,d=void 0;else if(CXi(r)){l=r.expected;let h=TXi(r.message);u=h??Rve(r.input),d=h??Rve(r.input)}else SXi(r)?l=String(r.minimum):r.code==="custom"&&"params"in r&&(u=r.params.received,d=u);let f=Frl({path:n,code:r.code,expected:l,received:u,enumValues:c,message:r.message,value:u});if(bXi(r))s=c?.map(h=>`"${h}"`).join(", "),o=`Invalid value. Expected one of: ${s}`;else if(CXi(r)){let h=TXi(r.message)??Rve(r.input);r.expected==="object"&&h==="null"&&n===""?o="Invalid or malformed JSON":o=`Expected ${r.expected}, but received ${h}`}else if(Url(r)){let h=r.keys.join(", ");o=`Unrecognized ${AVc(r.keys.length,"field")}: ${h}`}else SXi(r)&&(o=`Number must be greater than or equal to ${r.minimum}`,s=String(r.minimum));return{file:e,path:n,message:o,expected:s,invalidValue:d,suggestion:f?.suggestion,docLink:f?.docLink}})}function Qrl(t,e){if(!t||typeof t!="object")return[];let r=t;if(!r.permissions||typeof r.permissions!="object")return[];let n=r.permissions,o=[];for(let s of["allow","deny","ask"]){let c=n[s];Array.isArray(c)&&(n[s]=c.filter(l=>{if(typeof l!="string")return o.push({file:e,path:`permissions.${s}`,message:`Non-string value in ${s} array was removed`,severity:"warning",invalidValue:l}),!1;let u=Gso(l);if(!u.valid){let d=`Invalid permission rule "${l}" was skipped: ${u.error}`;return u.suggestion&&(d+=`. ${u.suggestion}`),o.push({file:e,path:`permissions.${s}`,message:d,severity:"warning",invalidValue:l}),!1}return!0}))}return o}function jrl(t,e){if(!t||typeof t!="object")return[];let r=t;if(!("hooks"in r))return[];if(r.hooks===null||typeof r.hooks!="object"||Array.isArray(r.hooks)){let s=Rve(r.hooks);return delete r.hooks,[{file:e,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${s}. This field was ignored.`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"}]}let n=r.hooks,o=[];for(let s of Object.keys(n)){if(!qrl.has(s)){delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Unknown hook event "${s}" was ignored. Valid events: ${jwt.join(", ")}`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"});continue}if(!Array.isArray(n[s])){let c=Rve(n[s]);delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Hook event "${s}" must be an array of matchers; received ${c}. This entry was ignored.`,severity:"warning",invalidValue:c,docLink:"https://code.claude.com/docs/en/hooks"})}}return o.length>0&&Object.keys(n).length===0&&delete r.hooks,o}function Grl(t,e){if(!t||typeof t!="object")return[];let r=t,n=[];for(let{key:o,schema:s}of Hrl){if(!(o in r))continue;if(!Array.isArray(r[o])){let u=r[o];delete r[o],n.push({file:e,path:o,message:`"${o}" must be an array; received ${Rve(u)}. This field was ignored.`,severity:"warning",invalidValue:u});continue}let c=r[o],l=[];for(let u=0;u{try{(0,Kso.execFile)(t,e,{encoding:"utf-8",timeout:Wrl},(n,o)=>{r({stdout:o??"",code:n?1:0})})}catch{r({stdout:"",code:1})}})}function Krl(){return(async()=>{if(process.platform==="darwin"){let t=zrl(),e=(await Promise.all(t.map(async({path:r,label:n})=>{if(!(0,Jso.existsSync)(r))return{stdout:"",label:n,ok:!1};let{stdout:o,code:s}=await h8e($rl,[...Vrl,r]);return{stdout:o,label:n,ok:s===0&&!!o}}))).find(r=>r.ok);return{plistStdouts:e?[{stdout:e.stdout,label:e.label}]:[],hklmStdout:null,hkcuStdout:null}}if(process.platform==="win32"){let t=`${process.env.SYSTEMROOT||"C:\\Windows"}\\System32\\reg.exe`,[e,r]=await Promise.all([h8e(t,["query",m9r,"/v",Tve]),h8e(t,["query",g9r,"/v",Tve])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:r.code===0?r.stdout:null}}if(Yso()){let[t,e]=await Promise.all([h8e(xXi,["query",m9r,"/v",Tve]),h8e(xXi,["query",g9r,"/v",Tve])]);return{plistStdouts:null,hklmStdout:t.code===0?t.stdout:null,hkcuStdout:e.code===0?e.stdout:null}}return{plistStdouts:null,hklmStdout:null,hkcuStdout:null}})()}function Jrl(){return Yrl}function Zrl(){kwt||(kwt=(async()=>{let t=Date.now(),e=Jrl()??Krl(),{mdm:r,hkcu:n,wslInherits:o}=nnl(await e);Zso=r,Xso=n,eao=o;let s=Date.now()-t;if(nu(`MDM settings load completed in ${s}ms`),Object.keys(r.settings).length>0){nu(`MDM settings found: ${Object.keys(r.settings).join(", ")}`);try{a9r("info","mdm_settings_loaded",{duration_ms:s,key_count:Object.keys(r.settings).length,error_count:r.errors.length})}catch{}}})())}async function Xrl(){kwt||Zrl(),await kwt}function enl(){return Zso??hW}function tnl(){return Xso??hW}function rnl(){return eao}function e6r(t,e){let r=CW(_Rt(t,!1));if(!r||typeof r!="object")return{settings:{},errors:[]};let n=pCe(r,e),o=fCe().safeParse(r);if(!o.success){let s=v6e(o.error,e);return{settings:{},errors:[...n,...s]}}return{settings:o.data,errors:n}}function wXi(t,e="Settings"){let r=t.split(/\r?\n/),n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`^\\s+${n}\\s+REG_(?:EXPAND_)?SZ\\s+(.*)$`,"i");for(let s of r){let c=s.match(o);if(c&&c[1])return c[1].trimEnd()}return null}function nnl(t){let e=[];if(t.plistStdouts&&t.plistStdouts.length>0){let{stdout:c,label:l}=t.plistStdouts[0],u=e6r(c,l),{wslInheritsWindowsSettings:d,...f}=u.settings;if(Object.keys(f).length>0)return{mdm:u,hkcu:hW,wslInherits:!1};e.push(...u.errors)}let r=null;if(t.hklmStdout){let c=wXi(t.hklmStdout);c&&(r=e6r(c,`Registry: ${m9r}\\${Tve}`))}r&&e.push(...r.errors);let n=e.length>0?{settings:{},errors:e}:hW,o=Yso(),s=!1;if(o&&(s=r?.settings.wslInheritsWindowsSettings===!0||onl(),!s))return{mdm:n,hkcu:hW,wslInherits:!1};if(r){let{wslInheritsWindowsSettings:c,...l}=r.settings;if(Object.keys(l).length>0)return{mdm:r,hkcu:hW,wslInherits:s}}if(inl(s))return{mdm:n,hkcu:hW,wslInherits:s};if(t.hkcuStdout){let c=wXi(t.hkcuStdout);if(c){let l=e6r(c,`Registry: ${g9r}\\${Tve}`);if(!o||l.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:u,...d}=l.settings;return{mdm:n,hkcu:{settings:d,errors:l.errors},wslInherits:s}}if(l.errors.length>0)return{mdm:n,hkcu:{settings:{},errors:l.errors},wslInherits:s}}}return{mdm:n,hkcu:hW,wslInherits:s}}function inl(t){return t&&kXi(Rwt)?!0:kXi(r6e())}function RXi(t){let e=CW(_Rt(ERt(t),!1));if(!e||typeof e!="object")return!1;pCe(e,t);let{wslInheritsWindowsSettings:r,...n}=e;return Object.keys(n).length>0}function onl(){function t(e){try{let r=_Rt(ERt(e),!1);return!!r&&typeof r=="object"&&"wslInheritsWindowsSettings"in r&&r.wslInheritsWindowsSettings===!0}catch{return!1}}if(a(t,"$"),t((0,aoe.join)(Rwt,"managed-settings.json")))return!0;try{let e=(0,aoe.join)(Rwt,"managed-settings.d");for(let r of FI().readdirSync(e))if((r.isFile()||r.isSymbolicLink())&&r.name.endsWith(".json")&&!r.name.startsWith(".")&&t((0,aoe.join)(e,r.name)))return!0}catch{}return!1}function kXi(t){try{if(RXi((0,aoe.join)(t,"managed-settings.json")))return!0}catch{}try{let e=(0,aoe.join)(t,"managed-settings.d"),r=FI().readdirSync(e);for(let n of r)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(".json")||n.name.startsWith(".")))try{if(RXi((0,aoe.join)(e,n.name)))return!0}catch{}}catch{}return!1}function snl(t,e,r){(r!==void 0&&!Hwt(t[e],r)||r===void 0&&!(e in t))&&j9r(t,e,r)}function anl(t){return function(e,r,n){for(var o=-1,s=Object(e),c=n(e),l=c.length;l--;){var u=c[t?l:++o];if(r(s[u],u,s)===!1)break}return e}}function dnl(t){return sCe(t)&&$9r(t)}function ynl(t){if(!sCe(t)||i6e(t)!=pnl)return!1;var e=cto(t);if(e===null)return!0;var r=gnl.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&tao.call(r)==Anl}function _nl(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function vnl(t){return kHc(t,oto(t))}function bnl(t,e,r,n,o,s,c){var l=y9r(t,r),u=y9r(e,r),d=c.get(u);if(d){A9r(t,r,d);return}var f=s?s(l,u,r+"",t,e,c):void 0,h=f===void 0;if(h){var m=vW(u),g=!m&&H9r(u),A=!m&&!g&&nto(u);f=u,m||g||A?vW(l)?f=l:fnl(l)?f=VGc(l):g?(h=!1,f=ato(u,!0)):A?(h=!1,f=e$c(u,!0)):f=[]:Enl(u)||M8e(u)?(f=l,M8e(l)?f=Cnl(l):(!sU(l)||P9r(l))&&(f=i$c(u))):h=!1}h&&(c.set(u,f),o(f,u,n,s,c),c.delete(u)),A9r(t,r,f)}function rao(t,e,r,n,o){t!==e&&unl(e,function(s,c){if(o||(o=new bHc),sU(s))Snl(t,e,c,r,rao,n,o);else{var l=n?n(y9r(t,c),s,c+"",t,e,o):void 0;l===void 0&&(l=s),A9r(t,c,l)}},oto)}function Inl(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function wnl(t,e,r){return e=PXi(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,s=PXi(n.length-e,0),c=Array(s);++o0){if(++e>=Nnl)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Unl(t,e){return iao(nao(t,e,uto),t+"")}function qnl(t,e,r){if(!sU(r))return!1;var n=typeof e;return(n=="number"?$9r(r)&&Wwt(e,r.length):n=="string"&&e in r)?Hwt(r[e],t):!1}function Hnl(t){return Qnl(function(e,r){var n=-1,o=r.length,s=o>1?r[o-1]:void 0,c=o>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(o--,s):void 0,c&&jnl(r[0],r[1],c)&&(s=o<3?void 0:s,o=1),e=Object(e);++n0&&r(l)?e>1?oao(l,e-1,r,n,o):zGc(o,l):n||(o[o.length]=l)}return o}function til(t){var e=t==null?0:t.length;return e?eil(t,1):[]}function nil(t){return iao(nao(t,void 0,ril),t+"")}function cil(){return void 0??(0,sao.join)(iCe(),sil)}function lil(){try{let t=ERt(cil()),e=ZN(bso(t));return!e||typeof e!="object"||Array.isArray(e)?null:e}catch{return null}}function uil(){if(!void 0&&ail!==!0)return null;if(r6r)return r6r;let t=lil();return t?(r6r=t,K9r(),t):null}function pQr(t){let e=new Set(t.allowedSources);return e.add("flagSettings"),e.add("policySettings"),Arl.filter(r=>e.has(r))}function dil(){return(0,My.join)(r6e(),"managed-settings.json")}function aao(t){if(vRt()==="wsl"&&t.wslInherits?.()){let e=n6r(Rwt);if(e.settings)return e;let r=n6r(r6e());return{settings:r.settings,errors:[...e.errors,...r.errors]}}return n6r(r6e())}function n6r(t){let e=[],r={},n=!1,{settings:o,errors:s}=Pwt((0,My.join)(t,"managed-settings.json"));e.push(...s),o&&Object.keys(o).length>0&&(r=AW(r,o,yW),n=!0);let c=(0,My.join)(t,"managed-settings.d");try{let d=FI().readdirSync(c).filter(f=>(f.isFile()||f.isSymbolicLink())&&f.name.endsWith(".json")&&!f.name.startsWith(".")).map(f=>f.name).sort();for(let f of d){let{settings:h,errors:m}=Pwt((0,My.join)(c,f));e.push(...m),h&&Object.keys(h).length>0&&(r=AW(r,h,yW),n=!0)}}catch(d){let f=BI(d);f!=="ENOENT"&&f!=="ENOTDIR"&&nu(`managed-settings.d read failed: ${d}`,{level:"error"})}let{wslInheritsWindowsSettings:l,...u}=r;return{settings:n&&Object.keys(u).length>0?r:null,errors:e}}function fil(t,e){s6e(t)?nu(`Broken symlink or missing file encountered for settings.json at path: ${e}`):nu(`settings file read failed at ${e}: ${t}`,{level:"error"})}function Pwt(t,e){let r=q$c(t);if(r)return{settings:r.settings?CW(r.settings):null,errors:r.errors};let n=pil(t,e);return j$c(t,n),{settings:n.settings?CW(n.settings):null,errors:n.errors}}function cao(t){if(!t.mdm)return{settings:null,errors:[]};let e=t.mdm();return{settings:Object.keys(e.settings).length>0?e.settings:null,errors:e.errors}}function lao(t){let e=t?.remote?t.remote():uil();if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=CW(e),n=pCe(r,"remote managed settings"),o=fCe().safeParse(r);return o.success?{settings:Object.keys(o.data).length>0?o.data:null,errors:n}:{settings:null,errors:[...n,...v6e(o.error,"remote managed settings")]}}function uao(t){let e=t.parentManaged;if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=CW(e),n=pCe(r,"parent managed settings"),o=fCe().safeParse(r);return o.success?Object.keys(o.data).length>0?{settings:o.data,errors:n}:{settings:null,errors:n}:{settings:null,errors:[...n,...v6e(o.error,"parent managed settings")]}}function dao(t){let e=t.flagInline;if(!e)return{settings:null,errors:[]};let r=CW(e),n=pCe(r,"SDK inline settings"),o=fCe().safeParse(r);return o.success?{settings:o.data,errors:n}:{settings:null,errors:[...n,...v6e(o.error,"SDK inline settings")]}}function pil(t,e){try{let r;if(e!==void 0)r=e;else{let{resolvedPath:c}=hto(FI(),t);r=ERt(c)}if(r.trim()==="")return{settings:{},errors:[]};let n=CW(_Rt(r,!1)),o=pCe(n,t),s=fCe().safeParse(n);if(!s.success){let c=v6e(s.error,t);return{settings:null,errors:[...o,...c]}}return{settings:s.data,errors:o}}catch(r){return fil(r,t),{settings:null,errors:[]}}}function NXi(t,e){switch(t){case"userSettings":return(0,My.resolve)(iCe());case"policySettings":case"projectSettings":case"localSettings":return(0,My.resolve)(e.cwd);case"flagSettings":return e.flagPath?(0,My.dirname)((0,My.resolve)(e.flagPath)):(0,My.resolve)(e.cwd)}}function hil(t){return t.coworkPlugins||d_(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS)?"cowork_settings.json":"settings.json"}function Dwt(t,e){switch(t){case"userSettings":return(0,My.join)(NXi(t,e),hil(e));case"projectSettings":case"localSettings":return(0,My.join)(NXi(t,e),mil(t));case"policySettings":return dil();case"flagSettings":return e.flagPath}}function mil(t){switch(t){case"projectSettings":return(0,My.join)(".claude","settings.json");case"localSettings":return(0,My.join)(".claude","settings.local.json")}}function fao(t,e){let r=F$c(t);if(r!==void 0)return r;let n=_il(t,e);return U$c(t,n),n}function gil(t){return!t||t.parentSettingsBehavior==="merge"}function Ail(t,e){let r={};t.allowManagedHooksOnly===!0&&(r.allowManagedHooksOnly=!0),t.allowManagedMcpServersOnly===!0&&(r.allowManagedMcpServersOnly=!0),t.allowManagedPermissionRulesOnly===!0&&(r.allowManagedPermissionRulesOnly=!0);let n=t.strictPluginOnlyCustomization;if((n===!0||Array.isArray(n)&&n.length>0)&&(r.strictPluginOnlyCustomization=n),t.deniedMcpServers&&(r.deniedMcpServers=t.deniedMcpServers),e.forceLoginOrgUUID===void 0&&t.forceLoginOrgUUID&&(r.forceLoginOrgUUID=t.forceLoginOrgUUID),e.allowedMcpServers===void 0&&t.allowedMcpServers&&(r.allowedMcpServers=t.allowedMcpServers),t.permissions){let o=t6r(t.permissions,["deny","ask"]);if(t.permissions.disableBypassPermissionsMode==="disable"&&(o.disableBypassPermissionsMode="disable"),e.allowManagedPermissionRulesOnly!==!0){let{allow:s,additionalDirectories:c}=t.permissions;s&&e.sandbox?.network?.allowManagedDomainsOnly!==!0&&(o.allow=s),c&&(o.additionalDirectories=c)}Object.keys(o).length>0&&(r.permissions=o)}if(t.sandbox){let{network:o,filesystem:s}=t.sandbox,c={};if(t.sandbox.enabled===!0&&(c.enabled=!0),t.sandbox.failIfUnavailable===!0&&(c.failIfUnavailable=!0),t.sandbox.allowUnsandboxedCommands===!1&&(c.allowUnsandboxedCommands=!1),t.sandbox.autoAllowBashIfSandboxed===!1&&(c.autoAllowBashIfSandboxed=!1),o){let l=t6r(o,["deniedDomains"]);o.allowManagedDomainsOnly===!0&&(l.allowManagedDomainsOnly=!0),e.sandbox?.network?.allowManagedDomainsOnly!==!0&&o.allowedDomains&&(l.allowedDomains=o.allowedDomains),Object.keys(l).length>0&&(c.network=l)}if(s){let l=t6r(s,["denyRead","denyWrite"]);s.allowManagedReadPathsOnly===!0&&(l.allowManagedReadPathsOnly=!0),e.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&s.allowRead&&(l.allowRead=s.allowRead),Object.keys(l).length>0&&(c.filesystem=l)}Object.keys(c).length>0&&(r.sandbox=c)}return r}function yil(t){if(t.helper?.())return"helper";if(lao(t).settings)return"remote";if(cao(t).settings)return vRt()==="macos"?"plist":"hklm";if((t.file?.()??aao(t)).settings)return"file";if(uao(t).settings)return"parent";let e=t.hkcu?.();return e&&Object.keys(e.settings).length>0?"hkcu":null}function Eil(t){let e=[],{settings:r,errors:n}=lao(t);e.push(...n);let{settings:o,errors:s}=cao(t);e.push(...s);let{settings:c,errors:l}=t.file?.()??aao(t);e.push(...l);let{settings:u,errors:d}=uao(t);e.push(...d);let f=[r,o,c].filter(A=>A!==null),h=f[0]??null,m={allowManagedPermissionRulesOnly:f.some(A=>A.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:f.find(A=>A.forceLoginOrgUUID!==void 0)?.forceLoginOrgUUID,allowedMcpServers:f.find(A=>A.allowedMcpServers!==void 0)?.allowedMcpServers,sandbox:{network:{allowManagedDomainsOnly:f.some(A=>A.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:f.some(A=>A.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},g=u&&gil(h)?Ail(u,m):null;return{tiers:f,admin:h,parentSlice:g,errors:e}}function pao(t){let e=t.helper?.();if(e)return{settings:e,errors:t.helperWarnings?.()??[]};let{admin:r,parentSlice:n,errors:o}=Eil(t);if(!r&&!n){let s=t.hkcu?.();return s&&Object.keys(s.settings).length>0?{settings:s.settings,errors:[...o,...s.errors]}:{settings:null,errors:[...o,...s?.errors??[]]}}return{settings:AW({},n??{},r??{},yW),errors:o}}function _il(t,e){if(t==="policySettings")return pao(e).settings;let r=Dwt(t,e),{settings:n}=r?Pwt(r,t==="flagSettings"?e.flagExpectedContent:void 0):{settings:null};if(t==="flagSettings"){let{settings:o}=dao(e);if(o)return AW(n||{},o,yW)}return n}function vil(t,e){return Wto([...t,...e])}function yW(t,e){if(Array.isArray(t)&&Array.isArray(e))return vil(t,e)}function Cil(t){if(i6r)return{settings:{},errors:[]};let e=Date.now();a9r("info","settings_load_started"),i6r=!0;try{let r=G$c(),n={};r&&(n=AW(n,r,yW));let o=[],s=new Set,c=new Set;for(let l of pQr(t)){if(l==="policySettings"){let{settings:d,errors:f}=pao(t);d&&(n=AW(n,d,yW));for(let h of f){let m=`${h.file}:${h.path}:${h.message}`;s.has(m)||(s.add(m),o.push(h))}continue}let u=Dwt(l,t);if(u){let d=(0,My.resolve)(u);if(!c.has(d)){c.add(d);let{settings:f,errors:h}=Pwt(u,l==="flagSettings"?t.flagExpectedContent:void 0);for(let m of h){let g=`${m.file}:${m.path}:${m.message}`;s.has(g)||(s.add(g),o.push(m))}f&&(n=AW(n,f,yW))}}if(l==="flagSettings"){let{settings:d,errors:f}=dao(t);for(let h of f){let m=`${h.file}:${h.path}:${h.message}`;s.has(m)||(s.add(m),o.push(h))}d&&(n=AW(n,d,yW))}}return a9r("info","settings_load_completed",{duration_ms:Date.now()-e,source_count:c.size,error_count:o.length}),{settings:n,errors:o}}finally{i6r=!1}}function bil(t){let e=L$c();if(e!==null)return e;let r=Cil(t);return B$c(r),r}function Sil(t){let{settings:e}=bil(t);return e||{}}function Til(t){K9r();let e=[];for(let r of pQr(t)){let n=fao(r,t);n&&Object.keys(n).length>0&&e.push({source:r,settings:n})}return{effective:Sil(t),sources:e}}function Iil(t,e){let r=pQr(e);for(let n=r.length-1;n>=0;n--){let o=r[n];if(fao(o,e)?.[t]!==void 0)return o}return null}function Pil(t){let e=t.effective.permissions?.defaultMode;if(!e||!Ril.has(e))return t.effective;for(let r=t.sources.length-1;r>=0;r--){let n=t.sources[r];if(n.settings.permissions?.defaultMode!==void 0){if(kil.has(n.source)){let{defaultMode:o,...s}=t.effective.permissions??{};return{...t.effective,permissions:s}}return t.effective}}return t.effective}async function Dil(t={}){await Xrl();let e={cwd:(0,vso.resolve)(t.cwd??FI().cwd()),allowedSources:(t.settingSources??wil).map(r=>xil[r]),parentManaged:t.managedSettings??null,flagInline:null,flagPath:void 0,mdm:enl,hkcu:tnl,wslInherits:rnl,...t.serverManagedSettings!==void 0&&{remote:a(()=>t.serverManagedSettings,"remote")}};try{let{effective:r,sources:n}=Til(e),o=yil(e)??void 0,s=n.map(({source:l,settings:u})=>({source:MXi[l],settings:u,path:l==="policySettings"?void 0:Dwt(l,e),...l==="policySettings"&&{policyOrigin:o}})),c={};for(let l of Object.keys(r)){let u=Iil(l,e);u&&(c[l]={source:MXi[u],path:u==="policySettings"?void 0:Dwt(u,e),...u==="policySettings"&&{policyOrigin:o}})}return{effective:r,provenance:c,sources:s}}finally{K9r()}}async function Nil(t){return Dil(t)}async function Mil(t,e){try{await(0,f_.copyFile)(t,e)}catch(r){if(!s6e(r))throw r}}async function Oil(t,e){if(!t)return;let r=t;try{let n=ZN(t);n?.claudeAiOauth?.refreshToken&&(delete n.claudeAiOauth.refreshToken,r=$m(n))}catch{}await(0,f_.writeFile)(e,r,{mode:384})}function Lil(){if(process.platform!=="darwin")return Promise.resolve(void 0);let t=azc(szc);return new Promise(e=>{(0,neo.execFile)("security",["find-generic-password","-a",lzc(),"-w","-s",t],{encoding:"utf-8",timeout:5e3},(r,n)=>e(r?void 0:n.trim()||void 0))})}async function hao(t,e,r,n,o=6e4){if(!Ih(e))return;let s=Dk(r),c=await roe(t.load({projectKey:s,sessionId:e}),o,`SessionStore.load() timed out after ${o}ms for session ${e}`);if(!c||c.length===0)return;let l=(0,hc.join)((0,kve.tmpdir)(),`claude-resume-${(0,Qwt.randomUUID)()}`);try{let u=(0,hc.join)(l,"projects",s);await(0,f_.mkdir)(u,{recursive:!0});let d=(0,hc.join)(u,`${e}.jsonl`);await M6r(d,c);let f=n?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,h=f??(0,hc.join)((0,kve.homedir)(),".claude"),m;try{m=await(0,f_.readFile)((0,hc.join)(h,".credentials.json"),"utf-8")}catch(g){if(!s6e(g))throw g}if(!f&&!(n??process.env).ANTHROPIC_API_KEY&&!(n??process.env).CLAUDE_CODE_OAUTH_TOKEN&&(m=await Lil()??m),await Oil(m,(0,hc.join)(l,".credentials.json")),await Mil((0,hc.join)(f??(0,kve.homedir)(),".claude.json"),(0,hc.join)(l,".claude.json")),t.listSubkeys){let g=(0,hc.join)(u,e),A=await roe(t.listSubkeys({projectKey:s,sessionId:e}),o,`SessionStore.listSubkeys() timed out after ${o}ms for session ${e}`);for(let y of A){let E=(0,hc.resolve)(g,y+".jsonl");if(!y||(0,hc.isAbsolute)(y)||y.split(/[\\/]/).includes("..")||!E.startsWith(g+hc.sep)){nu(`[SessionStore] skipping unsafe subpath from listSubkeys: ${y}`,{level:"warn"});continue}let _=await roe(t.load({projectKey:s,sessionId:e,subpath:y}),o,`SessionStore.load() timed out after ${o}ms for session ${e} subpath ${y}`);if(!_||_.length===0)continue;let v=[],b=[];for(let T of _)v9r(T)?v.push(T):b.push(T);if(b.length>0&&(await(0,f_.mkdir)((0,hc.dirname)(E),{recursive:!0}),await M6r(E,b)),v.length>0){let T=v.at(-1),w=(0,hc.resolve)(g,y+".meta.json");await(0,f_.mkdir)((0,hc.dirname)(w),{recursive:!0});let{type:R,...x}=T;await(0,f_.writeFile)(w,$m(x),{mode:384})}}}return l}catch(u){throw await Nwt(l),u}}function E9r(t,e,r,n){let{systemPrompt:o,settings:s,managedSettings:c,settingSources:l,sandbox:u,...d}=t??{},f,h,m;o===void 0?f="":typeof o=="string"||Array.isArray(o)?f=o:o.type==="preset"&&(h=o.append,m=o.excludeDynamicSections),process.env.CLAUDE_AGENT_SDK_VERSION="0.3.159";let{abortController:g=s6r(),additionalDirectories:A=[],agent:y,agents:E,allowedTools:_=[],betas:v,canUseTool:b,continue:T,cwd:w,debug:R,debugFile:x,disallowedTools:P=[],tools:D,env:N,executable:L=peo()?"bun":"node",executableArgs:B=[],extraArgs:j={},fallbackModel:M,enableFileCheckpointing:O,toolConfig:U,forkSession:q,hooks:Q,includeHookEvents:Y,includePartialMessages:W,forwardSubagentText:V,onElicitation:z,persistSession:ie,sessionStore:H,sessionStoreFlush:te,thinking:le,effort:Le,maxThinkingTokens:ge,maxTurns:Oe,maxBudgetUsd:we,taskBudget:re,mcpServers:ee,model:K,outputFormat:he,permissionMode:X="default",allowDangerouslySkipPermissions:de=!1,permissionPromptToolName:qe,plugins:ne,getOAuthToken:ue,getHostAuthToken:Ne,workload:Ie,resume:Be,resumeSessionAt:tt,sessionId:st,skills:_t,stderr:kt,strictMcpConfig:Ht}=d;if(H&&ie===!1)throw Error("sessionStore cannot be used with persistSession: false -- the storage adapter requires local writes to mirror from. Use CLAUDE_CONFIG_DIR=/tmp for ephemeral local writes with external mirroring.");if(H&&T&&!Be&&!H.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");if(H&&O)throw Error("enableFileCheckpointing is not yet supported with sessionStore (backup blobs are not mirrored, so rewindFiles() fails after a store-backed resume).");H&&d.spawnClaudeCodeProcess&&nu("sessionStore with custom spawnClaudeCodeProcess: ensure the subprocess CLAUDE_CONFIG_DIR matches the parent (same path, same separators) or transcript_mirror frames will be dropped.",{level:"warn"});let F=d.pathToClaudeCodeExecutable;if(!F){let je=(0,seo.fileURLToPath)(importMetaUrlShim),J=(0,ieo.createRequire)(je),ae=HVc(Ce=>J.resolve(Ce));if(!ae)throw Error(`Native CLI binary for ${process.platform}-${process.arch} not found. Reinstall @anthropic-ai/claude-agent-sdk without --omit=optional, or set options.pathToClaudeCodeExecutable.`);F=ae}let se=he?.type==="json_schema"?he.schema:void 0,be=N?{...N}:{...process.env};be.CLAUDE_CODE_ENTRYPOINT||(be.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),be.CLAUDE_AGENT_SDK_VERSION||(be.CLAUDE_AGENT_SDK_VERSION="0.3.159"),O&&(be.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true"),ue&&(be.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1"),Ne&&(be.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1"),U?.askUserQuestion?.previewFormat&&(be.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=U.askUserQuestion.previewFormat);let Fe={};if(xZi.propagation.inject(xZi.context.active(),Fe),"traceparent"in Fe)for(let je of["TRACEPARENT","TRACESTATE"])je in(N??{})||delete be[je];for(let[je,J]of Object.entries(Fe)){let ae=je.toUpperCase();ae in(N??{})||(be[ae]=J)}let Ue={},me=new Map;if(ee)for(let[je,J]of Object.entries(ee))J.type==="sdk"&&J.instance?me.set(je,J.instance):Ue[je]=J;let Z;if(le)switch(le.type){case"adaptive":Z={type:"adaptive",display:le.display};break;case"enabled":Z={type:"enabled",budgetTokens:le.budgetTokens,display:le.display};break;case"disabled":Z={type:"disabled"};break}else ge!==void 0&&(Z=ge===0?{type:"disabled"}:{type:"enabled",budgetTokens:ge});r&&(be.CLAUDE_CONFIG_DIR=r,process.platform==="win32"&&(be.CLAUDE_SECURESTORAGE_CONFIG_DIR=N?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??N?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??""));let ve=new R6r({abortController:g,additionalDirectories:A,agent:y,betas:v,cwd:w,debug:R,debugFile:x,executable:L,executableArgs:B,extraArgs:Ie?{...j,workload:Ie}:j,pathToClaudeCodeExecutable:F,env:be,forkSession:q,stderr:kt,thinkingConfig:Z,effort:Le,maxTurns:Oe,maxBudgetUsd:we,taskBudget:re,model:K,fallbackModel:M,jsonSchema:se,permissionMode:X,allowDangerouslySkipPermissions:de,permissionPromptToolName:qe,continueConversation:H?void 0:T,resume:Be,resumeSessionAt:tt,sessionId:st,settings:typeof s=="object"?$m(s):s,managedSettings:c?$m(c):void 0,settingSources:l,skills:_t,allowedTools:_,disallowedTools:P,tools:D,mcpServers:Ue,strictMcpConfig:Ht,canUseTool:!!b,hooks:!!Q,includeHookEvents:Y,includePartialMessages:W,persistSession:ie,sessionMirror:!!H,plugins:ne,sandbox:u,spawnClaudeCodeProcess:d.spawnClaudeCodeProcess,deferSpawn:n}),Ge={systemPrompt:f,appendSystemPrompt:h,planModeInstructions:d.planModeInstructions,appendSubagentSystemPrompt:d.appendSubagentSystemPrompt,toolAliases:d.toolAliases,excludeDynamicSections:m,agents:E,title:d.title,skills:_t,webSearchIsolationExemptMcpServers:d.webSearchIsolationExemptMcpServers,promptSuggestions:d.promptSuggestions,agentProgressSummaries:d.agentProgressSummaries,forwardSubagentText:V},Qe=new P6r(ve,e,b,Q,g,me,se,Ge,z,ue,Ne);if(H){let je=a(()=>(0,hc.join)(be.CLAUDE_CONFIG_DIR??(0,hc.join)((0,kve.homedir)(),".claude"),"projects"),"S6"),J=te==="eager",ae=new D6r(async(Ce,Re)=>{let $e=FXi(Ce,je());$e?await H.append($e,Re):nu(`[SessionStore] dropping mirror frame: filePath ${Ce} is not under ${je()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},void 0,(Ce,Re)=>{let $e=FXi(Ce,je());$e&&Qe.reportMirrorError($e,Re.message)},J?0:Z9r,J?0:X9r);Qe.setTranscriptMirrorBatcher(ae)}return{queryInstance:Qe,transport:ve,abortController:g,processEnv:be}}function _9r(t,e,r,n){typeof r=="string"?e.write($m({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:r}]},parent_tool_use_id:null})+` +`):t.streamInput(r).catch(o=>n.abort(o))}async function Nwt(t){for(let e=0;;e++)try{return await(0,f_.rm)(t,{recursive:!0,force:!0})}catch(r){if(e>=4||!Bil.has(BI(r)??""))return;await ceo((e+1)*100)}}function Fil(t,e){t.waitForExit().catch(()=>{}).finally(()=>Nwt(e))}function Uil({prompt:t,options:e}){if((e?.resume||e?.continue)&&e?.sessionStore){let{queryInstance:s,transport:c,abortController:l,processEnv:u}=E9r({...e},typeof t=="string",void 0,!0),d=(0,hc.resolve)(e.cwd??"."),f=e.sessionStore,h=e.loadTimeoutMs??6e4,m=e.resume;return(async()=>{if(m||(m=(await roe(f.listSessions(Dk(d)),h,`SessionStore.listSessions() timed out after ${h}ms`)).slice().sort((g,A)=>A.mtime-g.mtime)[0]?.sessionId),!!m)return hao(f,m,d,e.env,e.loadTimeoutMs)})().then(g=>{if(g){c.updateResume(m);let A={CLAUDE_CONFIG_DIR:g};if(process.platform==="win32"){let y=e.env?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??e.env?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??"";A.CLAUDE_SECURESTORAGE_CONFIG_DIR=y,u.CLAUDE_SECURESTORAGE_CONFIG_DIR=y}c.updateEnv(A),u.CLAUDE_CONFIG_DIR=g,s.addCleanupCallback(()=>Fil(c,g))}s.isClosed()||c.spawn()}).catch(g=>{let A=o6e(g);c.spawnAbort(A),s.setError(A)}),_9r(s,c,t,l),s}let{queryInstance:r,transport:n,abortController:o}=E9r(e,typeof t=="string");return _9r(r,n,t,o),r}async function Qil({options:t,initializeTimeoutMs:e=6e4}={}){let r,n=t?.resume;if((n||t?.continue)&&t?.sessionStore){let l=(0,hc.resolve)(t.cwd??".");if(!n){if(!t.sessionStore.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");let u=t.loadTimeoutMs??6e4;n=(await roe(t.sessionStore.listSessions(Dk(l)),u,`SessionStore.listSessions() timed out after ${u}ms`)).slice().sort((d,f)=>f.mtime-d.mtime)[0]?.sessionId}n&&(r=await hao(t.sessionStore,n,l,t.env,t.loadTimeoutMs))}let o,s,c;try{let l=a(function(){m||(m=!0,h.close())},"z"),u=E9r(r&&n&&n!==t?.resume?{...t,resume:n}:t,!1,r);o=u.queryInstance;let{transport:d,abortController:f}=u;s=d;let h=u.queryInstance;if(r){let g=r;h.addCleanupCallback(()=>{c=d.waitForExit().catch(()=>{}).then(()=>Nwt(g))})}await roe(h.initializationResult(),e,`Subprocess initialization did not complete within ${e}ms \u2014 check authentication and network connectivity`);let m=!1;return{query(g){if(m)throw Error("WarmQuery.query() can only be called once");m=!0;try{_9r(h,d,g,f)}catch(A){throw h.close(),A}return typeof g=="string"&&h.setIsSingleUserTurn(!0),h},close:l,async[Symbol.asyncDispose](){m=!0,h.close(),await c}}}catch(l){if(o?.close(),r&&!c){let u=s;c=(u?u.waitForExit().catch(()=>{}):Promise.resolve()).then(()=>Nwt(r))}throw await c,l}}async function qil(t,e){return e?.sessionStore?eol(e.sessionStore,t,e):IWc(t,e)}async function jil(t){return t?.sessionStore?Zil(t.sessionStore,t):NWc(t)}async function Hil(t,e){return e?.sessionStore?tol(e.sessionStore,t,e):MWc(t,e)}async function Gil(t,e,r){return r?.sessionStore?rol(r.sessionStore,t,e,r.dir):OWc(t,e,r)}async function $il(t,e,r){return r?.sessionStore?nol(r.sessionStore,t,e,r.dir):LWc(t,e,r)}async function Vil(t,e){if(!Ih(t))throw Error(`Invalid sessionId: ${t}`);if(e?.sessionStore){if(!e.sessionStore.delete)return;let r=Dk(e.dir);await e.sessionStore.delete({projectKey:r,sessionId:t});return}return BWc(t,e)}async function Wil(t,e){return e?.sessionStore?iol(e.sessionStore,t,e):HWc(t,e)}async function zil(t,e,r){if(!Ih(t))throw Error(`Invalid sessionId: ${t}`);let n=await Kwt(t,r?.dir);if(!n)throw Error(`Session ${t} not found`);let o=Dk(r?.dir),s=r?.batchSize&&r.batchSize>0?r.batchSize:Z9r;if(await OXi(n.filePath,{projectKey:o,sessionId:t},e,s),r?.includeSubagents===!1)return;let c=n.filePath.replace(/\.jsonl$/,""),l=(0,hc.join)(c,"subagents");for(let u of await Yil(l)){let d=(0,hc.relative)(c,u).split(hc.sep);d[d.length-1]=d.at(-1).replace(/\.jsonl$/,"");let f={projectKey:o,sessionId:t,subpath:d.join("/")};await OXi(u,f,e,s);let h=u.replace(/\.jsonl$/,".meta.json");try{let m=ZN(await(0,f_.readFile)(h,"utf8"));await e.append(f,[{type:"agent_metadata",...m}])}catch(m){if(!s6e(m))throw m}}}async function OXi(t,e,r,n){let o=(0,oeo.createInterface)({input:(0,qwt.createReadStream)(t,{encoding:"utf8"}),crlfDelay:1/0}),s=[],c=0;for await(let l of o)l&&(s.push(ZN(l)),c+=l.length,(s.length>=n||c>=X9r)&&(await r.append(e,s),s=[],c=0));s.length>0&&await r.append(e,s)}async function Yil(t){let e=[];async function r(n){let o;try{o=await(0,f_.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o){let c=(0,hc.join)(n,s.name);s.isDirectory()?await r(c):s.isFile()&&s.name.endsWith(".jsonl")&&e.push(c)}}return a(r,"J"),await r(t),e}async function Kil(t,e){return e?.sessionStore?ool(e.sessionStore,t,e.dir):YWc(t,e)}async function Jil(t,e,r){return r?.sessionStore?sol(r.sessionStore,t,e,r):KWc(t,e,r)}function mao(t){let e=(0,hc.resolve)(t??"."),r;try{r=(0,qwt.realpathSync)(e)}catch{r=e}return r.normalize("NFC")}function Dk(t){return c6e(mao(t))}function gao(t){return t.map(e=>$m(e)).join(` `)+` -`}function BJi(t,e,r){return e!==void 0&&e>0?t.slice(r,r+e):r>0?t.slice(r):t}function g6r(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="agent_metadata"}async function arl(t,e){let r=goo(e.dir),n=B8e(r),o=e.offset??0,s=e.limit;if(t.listSessionSummaries){let u=await t.listSessionSummaries(n),d=t.listSessions?new Map((await t.listSessions(n)).map(g=>[g.sessionId,g])):void 0,f=[];for(let g of u){let A=d?.get(g.sessionId);if(d&&!A)continue;let y=A!==void 0&&g.mtimeA.sessionId));for(let[A,y]of d)g.has(A)||f.push({sessionId:A,mtime:y.mtime})}else ru("listSessionSummaries without listSessions: gap-fill skipped; sessions lacking a sidecar will be omitted");f.sort((g,A)=>A.mtime-g.mtime);let h=BJi(f,s,o),m=h.filter(g=>g.info===void 0);if(m.length>0){let g=await FJi(t,m,e.dir,r),A=new Map(g.map(y=>[y.sessionId,y]));for(let y of h)y.info===void 0&&(y.info=A.get(y.sessionId)??null)}return h.flatMap(g=>g.info?[g.info]:[])}if(!t.listSessions)throw Error("sessionStore.listSessions is not implemented -- cannot list sessions. Provide a store with a listSessions() method.");let c=(await t.listSessions(n)).slice().sort((u,d)=>d.mtime-u.mtime),l=BJi(c,s,o);return FJi(t,l,e.dir,r)}async function FJi(t,e,r,n){return(await Promise.allSettled(e.map(async o=>{let s=await Eoo(t,o.sessionId,r);if(!s)return null;let c=xwt(o.sessionId,yoo(s,o.mtime),n);return c?{...c,lastModified:o.mtime}:null}))).flatMap((o,s)=>{let c=e[s];return o.status==="fulfilled"?o.value?[o.value]:[]:[{sessionId:c.sessionId,summary:"",lastModified:c.mtime}]})}function yoo(t,e){let r=Buffer.from(t,"utf-8"),n=r.length,o=r.subarray(0,$9).toString("utf-8"),s=n>$9?r.subarray(n-$9).toString("utf-8"):o;return{mtime:e,size:n,head:o,tail:s}}function crl(t){let e=t.trimEnd(),r=e.slice(e.lastIndexOf(` -`)+1);try{let n=GN(r);if(typeof n=="object"&&n!==null&&"timestamp"in n&&typeof n.timestamp=="string"){let o=Date.parse(n.timestamp);if(!Number.isNaN(o))return o}}catch{}return Date.now()}async function Eoo(t,e,r){let n=bk(r),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?null:Aoo(o)}async function lrl(t,e,r){if(!bh(e))return[];let n=bk(r.dir),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?[]:MGc(o,{limit:r.limit,offset:r.offset,includeSystemMessages:r.includeSystemMessages})}async function url(t,e,r){if(!bh(e))return;let n=await Eoo(t,e,r.dir);if(!n)return;let o=yoo(n,crl(n));return xwt(e,o)??void 0}async function drl(t,e,r,n){if(!bh(e))throw Error(`Invalid sessionId: ${e}`);if(!r.trim())throw Error("title must be non-empty");let o=bk(n);await t.append({projectKey:o,sessionId:e},[{type:"custom-title",customTitle:r.trim(),sessionId:e,uuid:(0,gwt.randomUUID)(),timestamp:new Date().toISOString()}])}async function frl(t,e,r,n){if(!bh(e))throw Error(`Invalid sessionId: ${e}`);if(r!==null){let s=t8e(r).trim();if(!s)throw Error("tag must be non-empty (use null to clear)");r=s}let o=bk(n);await t.append({projectKey:o,sessionId:e},[{type:"tag",tag:r??"",sessionId:e,uuid:(0,gwt.randomUUID)(),timestamp:new Date().toISOString()}])}async function prl(t,e,r){if(!bh(e))throw Error(`Invalid sessionId: ${e}`);if(r.upToMessageId&&!bh(r.upToMessageId))throw Error(`Invalid upToMessageId: ${r.upToMessageId}`);let n=bk(r.dir),o=await t.load({projectKey:n,sessionId:e});if(!o||o.length===0)throw Error(`Session ${e} not found`);let{entries:s,forkedSessionId:c}=e$c(o,e,r);return await t.append({projectKey:n,sessionId:c},s),{sessionId:c}}async function hrl(t,e,r){if(!bh(e))return[];if(!t.listSubkeys)throw Error("sessionStore.listSubkeys is not implemented -- cannot list subagents. Provide a store with a listSubkeys() method.");let n=bk(r),o=await t.listSubkeys({projectKey:n,sessionId:e}),s=new Set;for(let c of o){if(!c.startsWith("subagents/"))continue;let l=c.split("/").at(-1);l.startsWith("agent-")&&s.add(l.slice(6))}return[...s]}async function mrl(t,e,r,n){if(!bh(e))return[];if(!r)return[];let o=bk(n.dir),s=`subagents/agent-${r}`;if(t.listSubkeys){let f=await t.listSubkeys({projectKey:o,sessionId:e}),h=`agent-${r}`,m=f.find(g=>g.startsWith("subagents/")&&g.split("/").at(-1)===h);if(!m)return[];s=m}let c=await t.load({projectKey:o,sessionId:e,subpath:s});if(!c||c.length===0)return[];let l=c.findLast(g6r),u=typeof l?.toolUseId=="string"?l.toolUseId:void 0,d=c.filter(f=>!g6r(f));return d.length===0?[]:GXi(Buffer.from(Aoo(d)),{limit:n.limit,offset:n.offset},u)}function UJi(t,e){let r=(0,pc.relative)(e,t),n=r.split(pc.sep);if(n[0]===".."||(0,pc.isAbsolute)(r)||n.length<2)return null;let o=n[0],s=n[1];if(n.length===2&&s.endsWith(".jsonl"))return{projectKey:o,sessionId:s.replace(/\.jsonl$/,"")};if(n.length>=4){let c=n.slice(2),l=c.length-1;return c[l]=c.at(-1).replace(/\.jsonl$/,""),{projectKey:o,sessionId:s,subpath:c.join("/")}}return null}var QJi,iZi,gwt,Awt,a_,oZi,uve,pc,sZi,aZi,cZi,uZi,dZi,fZi,yZi,EZi,KZi,m8r,JZi,sA,ZZi,jL,y8r,fXi,Txt,l_,soe,vo,G0,hXi,HL,CXi,TXi,w8r,IXi,UN,mve,xXi,wXi,RXi,kXi,qve,jve,k8r,GL,Kie,KFe,Pxt,f8e,Dxt,$Xi,VXi,Cio,Jie,bio,nf,n7r,ewt,kio,Pio,o7r,s6r,Yio,Jio,Zio,ky,aoo,B8c,F8c,e8r,U8c,Q8c,j8c,H8c,A6r,Ht,G8c,WL,V8c,W8c,z8c,ef,tf,Y8c,K8c,J8c,qJi,Z8c,Dve,X8c,y6r,e6c,Nve,t6c,r6c,jJi,uwt,n6c,HJi,i6c,GJi,o6c,dwt,$Ji,E6r,_6r,VJi,v6r,WJi,zJi,s6c,YJi,a6c,c6c,l6c,u6c,d6c,f6c,p6c,h6c,m6c,g6c,A6c,y6c,E6c,_6c,v6c,C6c,b6c,S6c,GIt,NYi,Ns,mc,pW,fwt,T6c,KJi,JJi,$It,I6c,HN,x6c,w6c,ZJi,R6c,pwt,hwt,C6r,mwt,b6r,k6c,XJi,P6c,D6c,N6c,M6c,O6c,L6c,B6c,F6c,U6c,Q6c,q6c,j6c,H6c,G6c,$6c,S6r,V6c,W6c,z6c,Y6c,eZi,tZi,K6c,J6c,Z6c,X6c,e9c,rZi,t9c,r9c,n9c,i9c,o9c,s9c,a9c,c9c,l9c,u9c,d9c,f9c,p9c,h9c,m9c,g9c,nZi,A9c,y9c,E9c,_9c,ywt,C9c,b9c,S9c,T9c,I9c,r8r,R1,P9c,mZi,D9c,N9c,Mve,M9c,cW,gZi,O9c,L9c,bFe,F9c,U9c,Q9c,j9c,H9c,G9c,MYi,N8e,z9,W9c,z9c,Y9c,K9c,I6r,Z9c,CFr,OYi,eUc,tUc,rUc,iUc,oUc,sUc,aUc,cUc,lUc,uUc,dUc,pUc,mUc,x6r,AUc,n8e,EUc,vUc,CUc,bUc,SUc,IUc,xUc,wUc,kUc,PUc,NUc,LYi,OUc,Ewt,_wt,FUc,UUc,qUc,HUc,$Uc,WUc,vwt,zUc,AZi,KUc,ZUc,Cwt,t7c,n7c,o7c,a7c,w6r,c7c,Py,Fve,AKh,_Zi,n8r,Ri,Jv,kI,dve,VIt,WIt,zIt,YIt,KIt,JIt,ZIt,XIt,ext,l7c,u7c,i8r,BYi,f7c,vZi,p7c,nW,h7c,g7c,UYi,QYi,qYi,k6r,_7c,C7c,b7c,SZi,txt,S7c,T7c,D6r,I7c,jYi,bFr,x7c,nu,s8r,tu,HYi,GYi,rxt,VYi,k7c,WYi,Gie,RZi,P7c,D7c,N7c,M6r,M7c,PZi,xI,wI,Zie,SFe,Xie,a8r,$Fe,nxt,vIt,ixt,c8r,eoe,c_,OZi,LZi,O6r,YYi,z7c,Y7c,l8r,BZi,K7c,J7c,Sd,FZi,mr,KYi,tQc,$n,oxt,XFe,sxt,axt,cxt,lxt,o8e,uxt,dxt,fve,fxt,pxt,jZi,iQc,eve,oQc,sQc,$Zi,dk,KV,W_e,TFe,CIt,IFe,xFe,bIt,wFe,U9,RFe,SIt,TIt,Qie,IIt,xIt,kFe,SFr,ZYi,wIt,TFr,IFr,xFr,XYi,eKi,d8r,hxt,aQc,cQc,PFe,z_e,qie,Q0,w1,II,G9,JV,DFe,rKi,f8r,mxt,iKi,uQc,toe,gxt,Axt,pve,yxt,s8e,Ext,a8e,k1,_xt,fk,ZV,Y_e,NFe,RIt,MFe,OFe,kIt,LFe,Q9,BFe,PIt,DIt,jie,NIt,MIt,FFe,wFr,aKi,RFr,kFr,PFr,DFr,cKi,lKi,p8r,vxt,c8e,dKi,fQc,Cxt,h8r,L6r,jIt,zZi,pQc,hQc,Mp,hve,gQc,AQc,g8r,EQc,zie,K_e,CQc,SQc,IQc,wQc,RQc,PQc,DQc,NQc,Sxt,B6r,OQc,LQc,eXi,UQc,qQc,Qve,HQc,fKi,tXi,$Qc,VQc,WQc,l8e,zQc,lW,VFe,KQc,rXi,pKi,JQc,hKi,ZQc,XQc,F6r,eqc,tqc,bwt,nqc,U6r,oqc,sqc,aqc,cqc,lqc,uqc,dqc,fqc,pqc,hqc,mqc,gqc,Aqc,yqc,Eqc,_qc,vqc,Cqc,bqc,Sqc,Tqc,Iqc,xqc,wqc,Cd,kqc,Dqc,WFe,nXi,e8e,Nqc,NFr,Mqc,A8r,mKi,Oqc,iXi,Lqc,Bqc,Uqc,Qqc,oXi,Hqc,Q6r,Vqc,Wqc,zqc,Kqc,sXi,zFe,aXi,gKi,Zqc,AKi,yKi,cXi,tjc,njc,ijc,lXi,ojc,EKi,ajc,ljc,_Ki,ujc,djc,pjc,hjc,q6r,gjc,Ajc,Ejc,_jc,Cjc,bjc,Sjc,Tjc,Ijc,wjc,Rjc,vKi,CKi,kjc,Djc,Swt,Mjc,j6r,Bjc,Ujc,qjc,Hjc,dXi,H6r,Ixt,Yjc,G6r,Zjc,tHc,nHc,iHc,oHc,yKh,sHc,EKh,aHc,_Kh,cHc,vKh,lHc,CKh,E8r,fHc,hHc,vHc,CHc,bKh,SKh,wHc,SKi,TKi,RHc,kHc,IKi,_8r,NHc,MHc,v8r,OHc,gXi,AXi,BHc,FHc,OIt,MFr,UFe,OFr,C8r,vXi,TKh,qHc,rf,GN,VHc,xxt,xKi,S8r,J_e,wxt,eGc,T8r,I8r,W6r,z6r,rGc,x8r,wKi,LFr,oGc,lGc,$9,dGc,u8e,mGc,gGc,AGc,kxt,EGc,d8e,_Gc,vGc,LGc,YGc,a$c,YXi,c$c,l$c,u$c,xKh,RKi,d$c,p$c,m$c,A$c,hc,kKi,kn,tW,hr,yk,E$c,p8e,_$c,D8r,Zv,eo,JFe,P1,PKi,DKi,gve,Nxt,Zn,_k,NKi,Ms,v$c,C$c,b$c,S$c,T$c,I$c,x$c,w$c,R$c,QFr,k$c,P$c,D$c,N$c,M$c,O$c,KXi,L$c,Ave,h8e,m8e,g8e,A8e,y8e,yve,Eve,E8e,aW,$L,_8e,dW,NI,_ve,j9,N8r,vve,Y9,O8r,v8e,C8e,L8r,Cve,bve,Sve,Tve,roe,QN,Ek,K9,Ive,xve,b8e,Mxt,Oxt,wve,wKh,Cr,RKh,kKh,PKh,DKh,NKh,MKh,OKh,LKh,BKh,FKh,UKh,QKh,qKh,jKh,H$c,HKh,GKh,$Kh,VKh,WKh,zKh,YKh,KKh,JKh,ZKh,XKh,eJh,tJh,rJh,nJh,iJh,oJh,sJh,aJh,XXi,eeo,teo,fW,Lxt,Ws,J6r,ieo,X$c,Bxt,oeo,aeo,ceo,B8r,ueo,Z6r,U8e,t9r,Fxt,r9r,Uxt,n9r,Dwt,i9r,Nwt,o9r,heo,meo,geo,Aeo,yeo,Eeo,_eo,cVc,veo,Rve,lVc,uVc,dVc,Ceo,fVc,pVc,hVc,mVc,gVc,Seo,Teo,Ieo,xeo,weo,s9r,Reo,AVc,keo,Peo,Deo,Leo,Beo,Feo,Ueo,Qeo,qeo,jeo,Heo,Geo,Sh,$eo,a9r,c9r,Veo,Weo,zeo,Yeo,Keo,Jeo,Zeo,Xeo,eto,Q8e,tto,rto,nto,ito,oto,sto,ato,cto,lto,Qxt,uto,Co,q8e,Lu,dto,fto,pto,hto,mto,gto,Ato,yto,Eto,_to,vto,Cto,bto,Sto,Tto,Ito,xto,wto,Rto,kto,Dto,Nto,Oto,Lto,u9r,Bto,d9r,f9r,Fto,Uto,Qto,qto,jto,qxt,Hto,Gto,$to,p9r,h9r,m9r,Vto,Wto,Mwt,zto,Yto,Kto,Jto,Zto,Xto,g9r,ero,tro,rro,nro,iro,oro,sro,aro,A9r,cro,lro,uro,dro,fro,y9r,yVc,_Vc,CVc,SVc,IVc,wVc,kVc,PVc,DVc,NVc,OVc,BVc,UVc,qVc,HVc,$Vc,WVc,YVc,JVc,XVc,tWc,nWc,oWc,aWc,lWc,dWc,pWc,mWc,AWc,EWc,vWc,bWc,TWc,xWc,RWc,PWc,DWc,MWc,LWc,FWc,QWc,jWc,hro,mro,I8e,V9,yro,Gxt,R8e,dzc,fzc,pzc,G,tUr,rUr,nUr,iUr,oUr,cno,gzc,H8e,lno,uno,dno,fno,Os,sUr,Fwt,Td,aUr,$xt,W9,cUr,lUr,uUr,dUr,fUr,pUr,hUr,mUr,gUr,AUr,yUr,EUr,_Ur,vUr,CUr,bUr,pno,Uwt,Hve,Qwt,qwt,SUr,hno,mno,gno,Ano,yno,Eno,_no,IUr,vno,Hwt,xUr,Cno,bno,Sno,RUr,Tno,Ino,k8e,xno,wno,kUr,DUr,Rno,kno,Dno,NUr,Ono,Lno,Fno,MUr,Uno,qno,jno,Gno,$wt,fYc,hYc,Yno,CYc,Kno,Jno,bYc,$ie,Vwt,H0,Zno,Xno,cJh,SYc,TYc,LUr,MI,G8e,IYc,Dy,vk,Ck,Ny,Wwt,eio,YKi,tio,xYc,BUr,FIt,Bi,FUr,wYc,lJh,uJh,UUr,RYc,QUr,kYc,$8e,Pve,rio,PYc,DYc,NYc,MYc,OYc,LYc,nio,BYc,FYc,iio,qUr,UYc,QYc,jUr,qYc,V8e,W8e,jYc,z8e,zwt,HYc,zxt,HUr,GUr,$Ur,dJh,VUr,WUr,zUr,GYc,oio,sio,YUr,aio,Y8e,Gve,cio,$Yc,Q8r,VYc,q8r,WYc,KUr,zYc,j8r,YYc,KYc,JYc,ZYc,XYc,eKc,tKc,rKc,nKc,iKc,H8r,oKc,sKc,G8r,JUr,ZUr,XUr,aKc,cKc,lKc,e7r,uKc,dKc,fKc,pKc,hKc,lio,$8r,mKc,t7r,fJh,gKc,Yxt,AKc,pJh,Kxt,yKc,uio,EKc,_Kc,vKc,CKc,bKc,SKc,TKc,Jxt,IKc,xKc,wKc,r7r,dio,RKc,kKc,PKc,DKc,NKc,MKc,OKc,LKc,BKc,FKc,UKc,QKc,qKc,jKc,HKc,GKc,$Kc,VKc,Zxt,WKc,zKc,YKc,V8r,ZKc,XKc,eJc,fio,tJc,hJh,mJh,gJh,AJh,yJh,EJh,fi,W8r,rJc,KKi,nJc,iJc,hio,cJc,lJc,pJc,HFr,ON,gJc,Xxt,ZKi,wJc,RJc,OJc,LJc,BJc,FJc,UJc,qJc,z8r,HJc,GJc,Y8r,K8r,J8r,Eio,iJi,YJc,Z8r,X8r,ZJc,qFe,cJi,nZc,mk,t6r,uJi,_Jh,vJh,dJi,fJi,pJi,hJi,iW,i7r,ive,uZc,dZc,fZc,CJh,gZc,$Fr,yZc,mJi,bJh,Z_e,Iio,n6r,xio,twt,gJi,EZc,eW,wio,cve,i6r,o6r,vZc,AJi,Kwt,Jwt,TJh,IJh,xJh,P8e,wJh,CZc,bZc,SZc,TZc,IZc,xZc,wZc,RZc,RJh,s7r,kZc,PZc,kJh,PJh,DZc,jFe,MZc,OZc,rwt,DJh,NJh,$ve,mW,LZc,BZc,Dio,FZc,UZc,QZc,qZc,jZc,HZc,GZc,$Zc,a6r,MJh,Nio,VZc,WZc,jN,ooe,yJi,c6r,l6r,Mio,a7r,YZc,OJh,KZc,JZc,ZZc,XZc,eXc,Oio,Lio,tXc,EJi,rXc,nXc,Bio,iXc,oXc,_Ji,sXc,aXc,Fio,cXc,Uio,lXc,uXc,dXc,nwt,VFr,Qio,fXc,pXc,hXc,mXc,gXc,LJh,qio,yXc,EXc,_Xc,vXc,CXc,bXc,SXc,BJh,TXc,FJh,IXc,xXc,wXc,UIt,Zwt,vJi,Hio,UJh,QJh,iwt,zFr,qXc,qJh,jXc,Wio,zio,HXc,CJi,Vve,H9,$Xc,VXc,jJh,KXc,ZXc,xJi,u6r,d6r,ove,eel,tel,rel,wJi,owt,iel,rW,Xio,eoo,too,swt,f6r,Ael,yel,Eel,vel,Cel,bel,Sel,roo,Tel,Iel,wel,p6r,Pel,Nel,Mel,Lel,DJi,ioo,Uel,Qel,qel,jel,Hel,Gel,Vel,Wel,ooo,Yel,Jel,Xel,etl,oW,rtl,itl,stl,NJi,ctl,ltl,dtl,ptl,htl,KFr,mtl,JFr,gtl,XFr,Ltl,OJi,Btl,Ftl,Utl,Vtl,voo=ve(()=>{p();QJi=require("node:module"),iZi=require("child_process"),gwt=require("crypto"),Awt=require("fs"),a_=require("fs/promises"),oZi=require("module"),uve=require("os"),pc=require("path"),sZi=require("readline"),aZi=require("url"),cZi=require("events"),uZi=require("child_process"),dZi=require("fs"),fZi=require("readline"),yZi=require("os"),EZi=require("path"),KZi=require("crypto"),m8r=require("path"),JZi=require("async_hooks"),sA=require("fs/promises"),ZZi=require("crypto"),jL=require("fs/promises"),y8r=require("fs"),fXi=require("process"),Txt=require("crypto"),l_=require("fs/promises"),soe=require("path"),vo=de(require("fs"),1),G0=require("fs/promises"),hXi=require("fs"),HL=require("path"),CXi=require("fs"),TXi=require("fs/promises"),w8r=require("events"),IXi=require("fs"),UN=require("fs/promises"),mve=require("path"),xXi=require("child_process"),wXi=require("util"),RXi=require("child_process"),kXi=require("path"),qve=require("fs/promises"),jve=require("path"),k8r=require("fs"),GL=require("fs/promises"),Kie=require("path"),KFe=require("crypto"),Pxt=require("path"),f8e=require("fs/promises"),Dxt=require("path"),$Xi=require("crypto"),VXi=require("os"),Cio=require("path"),Jie=require("path"),bio=require("path"),nf=de(require("node:path"),1),n7r=de(require("node:os"),1),ewt=de(require("node:process"),1),kio=require("path"),Pio=require("fs/promises"),o7r=require("os"),s6r=require("path"),Yio=require("os"),Jio=require("child_process"),Zio=require("fs"),ky=require("path"),aoo=require("path"),B8c=Object.create,{getPrototypeOf:F8c,defineProperty:e8r,getOwnPropertyNames:U8c}=Object,Q8c=Object.prototype.hasOwnProperty;a(q8c,"a_");A6r=a((t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var o=e?j8c??=new WeakMap:H8c??=new WeakMap,s=o.get(t);if(s)return s}r=t!=null?B8c(F8c(t)):{};let c=e||!t||!t.__esModule?e8r(r,"default",{value:t,enumerable:!0}):r;for(let l of U8c(t))Q8c.call(c,l)||e8r(c,l,{get:q8c.bind(t,l),enumerable:!0});return n&&o.set(t,c),c},"DG"),Ht=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"I"),G8c=a(t=>t,"$k");a($8c,"Qk");WL=a((t,e)=>{for(var r in e)e8r(t,r,{get:e[r],enumerable:!0,configurable:!0,set:$8c.bind(e,r)})},"M4"),V8c=(0,QJi.createRequire)(importMetaUrlShim),W8c=Symbol.dispose||Symbol.for("Symbol.dispose"),z8c=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),ef=a((t,e,r)=>{if(e!=null){if(typeof e!="object"&&typeof e!="function")throw TypeError('Object expected to be assigned to "using" declaration');var n;if(r&&(n=e[z8c]),n===void 0&&(n=e[W8c]),typeof n!="function")throw TypeError("Object not disposable");t.push([r,n,e])}else r&&t.push([r]);return e},"Z$"),tf=a((t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(c,l,u,d){return d=Error(u),d.name="SuppressedError",d.error=c,d.suppressed=l,d},o=a(c=>e=r?new n(c,e,"An error was suppressed during disposal"):(r=!0,c),"X"),s=a(c=>{for(;c=t.pop();)try{var l=c[1]&&c[1].call(c[2]);if(c[0])return Promise.resolve(l).then(s,u=>(o(u),s()))}catch(u){o(u)}if(r)throw e},"W");return s()},"M$"),Y8c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t._globalThis=void 0,t._globalThis=typeof globalThis=="object"?globalThis:global}),K8c=Ht(t=>{var e=t&&t.__createBinding||(Object.create?function(n,o,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:a(function(){return o[s]},"get")})}:function(n,o,s,c){c===void 0&&(c=s),n[c]=o[s]}),r=t&&t.__exportStar||function(n,o){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(Y8c(),t)}),J8c=Ht(t=>{var e=t&&t.__createBinding||(Object.create?function(n,o,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:a(function(){return o[s]},"get")})}:function(n,o,s,c){c===void 0&&(c=s),n[c]=o[s]}),r=t&&t.__exportStar||function(n,o){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(K8c(),t)}),qJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.9.0"}),Z8c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;var e=qJi(),r=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function n(o){let s=new Set([o]),c=new Set,l=o.match(r);if(!l)return()=>!1;let u={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};if(u.prerelease!=null)return function(h){return h===o};function d(h){return c.add(h),!1}a(d,"W");function f(h){return s.add(h),!0}return a(f,"G"),function(h){if(s.has(h))return!0;if(c.has(h))return!1;let m=h.match(r);if(!m)return d(h);let g={major:+m[1],minor:+m[2],patch:+m[3],prerelease:m[4]};return g.prerelease!=null||u.major!==g.major?d(h):u.major===0?u.minor===g.minor&&u.patch<=g.patch?f(h):d(h):u.minor<=g.minor?f(h):d(h)}}a(n,"b2"),t._makeCompatibilityCheck=n,t.isCompatible=n(e.VERSION)}),Dve=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;var e=J8c(),r=qJi(),n=Z8c(),o=r.VERSION.split(".")[0],s=Symbol.for(`opentelemetry.js.api.${o}`),c=e._globalThis;function l(f,h,m,g=!1){var A;let y=c[s]=(A=c[s])!==null&&A!==void 0?A:{version:r.VERSION};if(!g&&y[f]){let E=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${f}`);return m.error(E.stack||E.message),!1}if(y.version!==r.VERSION){let E=Error(`@opentelemetry/api: Registration of version v${y.version} for ${f} does not match previously registered API v${r.VERSION}`);return m.error(E.stack||E.message),!1}return y[f]=h,m.debug(`@opentelemetry/api: Registered a global for ${f} v${r.VERSION}.`),!0}a(l,"ex"),t.registerGlobal=l;function u(f){var h,m;let g=(h=c[s])===null||h===void 0?void 0:h.version;if(!(!g||!(0,n.isCompatible)(g)))return(m=c[s])===null||m===void 0?void 0:m[f]}a(u,"$y"),t.getGlobal=u;function d(f,h){h.debug(`@opentelemetry/api: Unregistering a global for ${f} v${r.VERSION}.`);let m=c[s];m&&delete m[f]}a(d,"Qy"),t.unregisterGlobal=d}),X8c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;var e=Dve();class r{static{a(this,"T2")}constructor(s){this._namespace=s.namespace||"DiagComponentLogger"}debug(...s){return n("debug",this._namespace,s)}error(...s){return n("error",this._namespace,s)}info(...s){return n("info",this._namespace,s)}warn(...s){return n("warn",this._namespace,s)}verbose(...s){return n("verbose",this._namespace,s)}}t.DiagComponentLogger=r;function n(o,s,c){let l=(0,e.getGlobal)("diag");if(l)return c.unshift(s),l[o](...c)}a(n,"lQ")}),y6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagLogLevel=void 0;var e;(function(r){r[r.NONE=0]="NONE",r[r.ERROR=30]="ERROR",r[r.WARN=50]="WARN",r[r.INFO=60]="INFO",r[r.DEBUG=70]="DEBUG",r[r.VERBOSE=80]="VERBOSE",r[r.ALL=9999]="ALL"})(e=t.DiagLogLevel||(t.DiagLogLevel={}))}),e6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;var e=y6r();function r(n,o){ne.DiagLogLevel.ALL&&(n=e.DiagLogLevel.ALL),o=o||{};function s(c,l){let u=o[c];return typeof u=="function"&&n>=l?u.bind(o):function(){}}return a(s,"J"),{error:s("error",e.DiagLogLevel.ERROR),warn:s("warn",e.DiagLogLevel.WARN),info:s("info",e.DiagLogLevel.INFO),debug:s("debug",e.DiagLogLevel.DEBUG),verbose:s("verbose",e.DiagLogLevel.VERBOSE)}}a(r,"Gy"),t.createLogLevelDiagLogger=r}),Nve=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;var e=X8c(),r=e6c(),n=y6r(),o=Dve(),s="diag";class c{static{a(this,"kU")}constructor(){function u(h){return function(...m){let g=(0,o.getGlobal)("diag");if(g)return g[h](...m)}}a(u,"$");let d=this,f=a((h,m={logLevel:n.DiagLogLevel.INFO})=>{var g,A,y;if(h===d){let v=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return d.error((g=v.stack)!==null&&g!==void 0?g:v.message),!1}typeof m=="number"&&(m={logLevel:m});let E=(0,o.getGlobal)("diag"),_=(0,r.createLogLevelDiagLogger)((A=m.logLevel)!==null&&A!==void 0?A:n.DiagLogLevel.INFO,h);if(E&&!m.suppressOverrideMessage){let v=(y=Error().stack)!==null&&y!==void 0?y:"";E.warn(`Current logger will be overwritten from ${v}`),_.warn(`Current logger will overwrite one already registered from ${v}`)}return(0,o.registerGlobal)("diag",_,d,!0)},"J");d.setLogger=f,d.disable=()=>{(0,o.unregisterGlobal)(s,d)},d.createComponentLogger=h=>new e.DiagComponentLogger(h),d.verbose=u("verbose"),d.debug=u("debug"),d.info=u("info"),d.warn=u("warn"),d.error=u("error")}static instance(){return this._instance||(this._instance=new c),this._instance}}t.DiagAPI=c}),t6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaggageImpl=void 0;class e{static{a(this,"P8")}constructor(n){this._entries=n?new Map(n):new Map}getEntry(n){let o=this._entries.get(n);if(o)return Object.assign({},o)}getAllEntries(){return Array.from(this._entries.entries()).map(([n,o])=>[n,o])}setEntry(n,o){let s=new e(this._entries);return s._entries.set(n,o),s}removeEntry(n){let o=new e(this._entries);return o._entries.delete(n),o}removeEntries(...n){let o=new e(this._entries);for(let s of n)o._entries.delete(s);return o}clear(){return new e}}t.BaggageImpl=e}),r6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")}),jJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;var e=Nve(),r=t6c(),n=r6c(),o=e.DiagAPI.instance();function s(l={}){return new r.BaggageImpl(new Map(Object.entries(l)))}a(s,"Ny"),t.createBaggage=s;function c(l){return typeof l!="string"&&(o.error(`Cannot create baggage metadata from unknown type: ${typeof l}`),l=""),{__TYPE__:n.baggageEntryMetadataSymbol,toString(){return l}}}a(c,"wy"),t.baggageEntryMetadataFromString=c}),uwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ROOT_CONTEXT=t.createContextKey=void 0;function e(n){return Symbol.for(n)}a(e,"Dy"),t.createContextKey=e;class r{static{a(this,"DX")}constructor(o){let s=this;s._currentContext=o?new Map(o):new Map,s.getValue=c=>s._currentContext.get(c),s.setValue=(c,l)=>{let u=new r(s._currentContext);return u._currentContext.set(c,l),u},s.deleteValue=c=>{let l=new r(s._currentContext);return l._currentContext.delete(c),l}}}t.ROOT_CONTEXT=new r}),n6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagConsoleLogger=void 0;var e=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class r{static{a(this,"QD")}constructor(){function o(s){return function(...c){if(console){let l=console[s];if(typeof l!="function"&&(l=console.log),typeof l=="function")return l.apply(console,c)}}}a(o,"$");for(let s=0;s{Object.defineProperty(t,"__esModule",{value:!0}),t.createNoopMeter=t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=t.NOOP_OBSERVABLE_GAUGE_METRIC=t.NOOP_OBSERVABLE_COUNTER_METRIC=t.NOOP_UP_DOWN_COUNTER_METRIC=t.NOOP_HISTOGRAM_METRIC=t.NOOP_GAUGE_METRIC=t.NOOP_COUNTER_METRIC=t.NOOP_METER=t.NoopObservableUpDownCounterMetric=t.NoopObservableGaugeMetric=t.NoopObservableCounterMetric=t.NoopObservableMetric=t.NoopHistogramMetric=t.NoopGaugeMetric=t.NoopUpDownCounterMetric=t.NoopCounterMetric=t.NoopMetric=t.NoopMeter=void 0;class e{static{a(this,"CU")}constructor(){}createGauge(g,A){return t.NOOP_GAUGE_METRIC}createHistogram(g,A){return t.NOOP_HISTOGRAM_METRIC}createCounter(g,A){return t.NOOP_COUNTER_METRIC}createUpDownCounter(g,A){return t.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(g,A){return t.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(g,A){return t.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(g,A){return t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(g,A){}removeBatchObservableCallback(g){}}t.NoopMeter=e;class r{static{a(this,"E8")}}t.NoopMetric=r;class n extends r{static{a(this,"TU")}add(g,A){}}t.NoopCounterMetric=n;class o extends r{static{a(this,"xU")}add(g,A){}}t.NoopUpDownCounterMetric=o;class s extends r{static{a(this,"yU")}record(g,A){}}t.NoopGaugeMetric=s;class c extends r{static{a(this,"fU")}record(g,A){}}t.NoopHistogramMetric=c;class l{static{a(this,"pQ")}addCallback(g){}removeCallback(g){}}t.NoopObservableMetric=l;class u extends l{static{a(this,"gU")}}t.NoopObservableCounterMetric=u;class d extends l{static{a(this,"hU")}}t.NoopObservableGaugeMetric=d;class f extends l{static{a(this,"uU")}}t.NoopObservableUpDownCounterMetric=f,t.NOOP_METER=new e,t.NOOP_COUNTER_METRIC=new n,t.NOOP_GAUGE_METRIC=new s,t.NOOP_HISTOGRAM_METRIC=new c,t.NOOP_UP_DOWN_COUNTER_METRIC=new o,t.NOOP_OBSERVABLE_COUNTER_METRIC=new u,t.NOOP_OBSERVABLE_GAUGE_METRIC=new d,t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new f;function h(){return t.NOOP_METER}a(h,"Zy"),t.createNoopMeter=h}),i6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueType=void 0;var e;(function(r){r[r.INT=0]="INT",r[r.DOUBLE=1]="DOUBLE"})(e=t.ValueType||(t.ValueType={}))}),GJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTextMapSetter=t.defaultTextMapGetter=void 0,t.defaultTextMapGetter={get(e,r){if(e!=null)return e[r]},keys(e){return e==null?[]:Object.keys(e)}},t.defaultTextMapSetter={set(e,r,n){e!=null&&(e[r]=n)}}}),o6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;var e=uwt();class r{static{a(this,"ZD")}active(){return e.ROOT_CONTEXT}with(o,s,c,...l){return s.call(c,...l)}bind(o,s){return s}enable(){return this}disable(){return this}}t.NoopContextManager=r}),dwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;var e=o6c(),r=Dve(),n=Nve(),o="context",s=new e.NoopContextManager;class c{static{a(this,"iU")}constructor(){}static getInstance(){return this._instance||(this._instance=new c),this._instance}setGlobalContextManager(u){return(0,r.registerGlobal)(o,u,n.DiagAPI.instance())}active(){return this._getContextManager().active()}with(u,d,f,...h){return this._getContextManager().with(u,d,f,...h)}bind(u,d){return this._getContextManager().bind(u,d)}_getContextManager(){return(0,r.getGlobal)(o)||s}disable(){this._getContextManager().disable(),(0,r.unregisterGlobal)(o,n.DiagAPI.instance())}}t.ContextAPI=c}),$Ji=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceFlags=void 0;var e;(function(r){r[r.NONE=0]="NONE",r[r.SAMPLED=1]="SAMPLED"})(e=t.TraceFlags||(t.TraceFlags={}))}),E6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;var e=$Ji();t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:e.TraceFlags.NONE}}),_6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;var e=E6r();class r{static{a(this,"SD")}constructor(o=e.INVALID_SPAN_CONTEXT){this._spanContext=o}spanContext(){return this._spanContext}setAttribute(o,s){return this}setAttributes(o){return this}addEvent(o,s){return this}addLink(o){return this}addLinks(o){return this}setStatus(o){return this}updateName(o){return this}end(o){}isRecording(){return!1}recordException(o,s){}}t.NonRecordingSpan=r}),VJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;var e=uwt(),r=_6r(),n=dwt(),o=(0,e.createContextKey)("OpenTelemetry Context Key SPAN");function s(h){return h.getValue(o)||void 0}a(s,"tU"),t.getSpan=s;function c(){return s(n.ContextAPI.getInstance().active())}a(c,"my"),t.getActiveSpan=c;function l(h,m){return h.setValue(o,m)}a(l,"TD"),t.setSpan=l;function u(h){return h.deleteValue(o)}a(u,"ly"),t.deleteSpan=u;function d(h,m){return l(h,new r.NonRecordingSpan(m))}a(d,"cy"),t.setSpanContext=d;function f(h){var m;return(m=s(h))===null||m===void 0?void 0:m.spanContext()}a(f,"py"),t.getSpanContext=f}),v6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;var e=E6r(),r=_6r(),n=/^([0-9a-f]{32})$/i,o=/^[0-9a-f]{16}$/i;function s(d){return n.test(d)&&d!==e.INVALID_TRACEID}a(s,"gD"),t.isValidTraceId=s;function c(d){return o.test(d)&&d!==e.INVALID_SPANID}a(c,"hD"),t.isValidSpanId=c;function l(d){return s(d.traceId)&&c(d.spanId)}a(l,"ey"),t.isSpanContextValid=l;function u(d){return new r.NonRecordingSpan(d)}a(u,"$f"),t.wrapSpanContext=u}),WJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;var e=dwt(),r=VJi(),n=_6r(),o=v6r(),s=e.ContextAPI.getInstance();class c{static{a(this,"cD")}startSpan(d,f,h=s.active()){if(f?.root)return new n.NonRecordingSpan;let m=h&&(0,r.getSpanContext)(h);return l(m)&&(0,o.isSpanContextValid)(m)?new n.NonRecordingSpan(m):new n.NonRecordingSpan}startActiveSpan(d,f,h,m){let g,A,y;if(arguments.length<2)return;arguments.length===2?y=f:arguments.length===3?(g=f,y=h):(g=f,A=h,y=m);let E=A??s.active(),_=this.startSpan(d,g,E),v=(0,r.setSpan)(E,_);return s.with(v,y,void 0,_)}}t.NoopTracer=c;function l(u){return typeof u=="object"&&typeof u.spanId=="string"&&typeof u.traceId=="string"&&typeof u.traceFlags=="number"}a(l,"Gf")}),zJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;var e=WJi(),r=new e.NoopTracer;class n{static{a(this,"iD")}constructor(s,c,l,u){this._provider=s,this.name=c,this.version=l,this.options=u}startSpan(s,c,l){return this._getTracer().startSpan(s,c,l)}startActiveSpan(s,c,l,u){let d=this._getTracer();return Reflect.apply(d.startActiveSpan,d,arguments)}_getTracer(){if(this._delegate)return this._delegate;let s=this._provider.getDelegateTracer(this.name,this.version,this.options);return s?(this._delegate=s,this._delegate):r}}t.ProxyTracer=n}),s6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;var e=WJi();class r{static{a(this,"oD")}getTracer(o,s,c){return new e.NoopTracer}}t.NoopTracerProvider=r}),YJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;var e=zJi(),r=s6c(),n=new r.NoopTracerProvider;class o{static{a(this,"eD")}getTracer(c,l,u){var d;return(d=this.getDelegateTracer(c,l,u))!==null&&d!==void 0?d:new e.ProxyTracer(this,c,l,u)}getDelegate(){var c;return(c=this._delegate)!==null&&c!==void 0?c:n}setDelegate(c){this._delegate=c}getDelegateTracer(c,l,u){var d;return(d=this._delegate)===null||d===void 0?void 0:d.getTracer(c,l,u)}}t.ProxyTracerProvider=o}),a6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SamplingDecision=void 0;var e;(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(e=t.SamplingDecision||(t.SamplingDecision={}))}),c6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanKind=void 0;var e;(function(r){r[r.INTERNAL=0]="INTERNAL",r[r.SERVER=1]="SERVER",r[r.CLIENT=2]="CLIENT",r[r.PRODUCER=3]="PRODUCER",r[r.CONSUMER=4]="CONSUMER"})(e=t.SpanKind||(t.SpanKind={}))}),l6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanStatusCode=void 0;var e;(function(r){r[r.UNSET=0]="UNSET",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR"})(e=t.SpanStatusCode||(t.SpanStatusCode={}))}),u6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateValue=t.validateKey=void 0;var e="[_0-9a-z-*/]",r=`[a-z]${e}{0,255}`,n=`[a-z0-9]${e}{0,240}@[a-z]${e}{0,13}`,o=new RegExp(`^(?:${r}|${n})$`),s=/^[ -~]{0,255}[!-~]$/,c=/,|=/;function l(d){return o.test(d)}a(l,"Lf"),t.validateKey=l;function u(d){return s.test(d)&&!c.test(d)}a(u,"jf"),t.validateValue=u}),d6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;var e=u6c(),r=32,n=512,o=",",s="=";class c{static{a(this,"UH")}constructor(u){this._internalState=new Map,u&&this._parse(u)}set(u,d){let f=this._clone();return f._internalState.has(u)&&f._internalState.delete(u),f._internalState.set(u,d),f}unset(u){let d=this._clone();return d._internalState.delete(u),d}get(u){return this._internalState.get(u)}serialize(){return this._keys().reduce((u,d)=>(u.push(d+s+this.get(d)),u),[]).join(o)}_parse(u){u.length>n||(this._internalState=u.split(o).reverse().reduce((d,f)=>{let h=f.trim(),m=h.indexOf(s);if(m!==-1){let g=h.slice(0,m),A=h.slice(m+1,f.length);(0,e.validateKey)(g)&&(0,e.validateValue)(A)&&d.set(g,A)}return d},new Map),this._internalState.size>r&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,r))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let u=new c;return u._internalState=new Map(this._internalState),u}}t.TraceStateImpl=c}),f6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;var e=d6c();function r(n){return new e.TraceStateImpl(n)}a(r,"Pf"),t.createTraceState=r}),p6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0;var e=dwt();t.context=e.ContextAPI.getInstance()}),h6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0;var e=Nve();t.diag=e.DiagAPI.instance()}),m6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;var e=HJi();class r{static{a(this,"HH")}getMeter(o,s,c){return e.NOOP_METER}}t.NoopMeterProvider=r,t.NOOP_METER_PROVIDER=new r}),g6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;var e=m6c(),r=Dve(),n=Nve(),o="metrics";class s{static{a(this,"VH")}constructor(){}static getInstance(){return this._instance||(this._instance=new s),this._instance}setGlobalMeterProvider(l){return(0,r.registerGlobal)(o,l,n.DiagAPI.instance())}getMeterProvider(){return(0,r.getGlobal)(o)||e.NOOP_METER_PROVIDER}getMeter(l,u,d){return this.getMeterProvider().getMeter(l,u,d)}disable(){(0,r.unregisterGlobal)(o,n.DiagAPI.instance())}}t.MetricsAPI=s}),A6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0;var e=g6c();t.metrics=e.MetricsAPI.getInstance()}),y6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTextMapPropagator=void 0;class e{static{a(this,"fF")}inject(n,o){}extract(n,o){return n}fields(){return[]}}t.NoopTextMapPropagator=e}),E6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;var e=dwt(),r=uwt(),n=(0,r.createContextKey)("OpenTelemetry Baggage Key");function o(u){return u.getValue(n)||void 0}a(o,"mF"),t.getBaggage=o;function s(){return o(e.ContextAPI.getInstance().active())}a(s,"xf"),t.getActiveBaggage=s;function c(u,d){return u.setValue(n,d)}a(c,"yf"),t.setBaggage=c;function l(u){return u.deleteValue(n)}a(l,"ff"),t.deleteBaggage=l}),_6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;var e=Dve(),r=y6c(),n=GJi(),o=E6c(),s=jJi(),c=Nve(),l="propagation",u=new r.NoopTextMapPropagator;class d{static{a(this,"wH")}constructor(){this.createBaggage=s.createBaggage,this.getBaggage=o.getBaggage,this.getActiveBaggage=o.getActiveBaggage,this.setBaggage=o.setBaggage,this.deleteBaggage=o.deleteBaggage}static getInstance(){return this._instance||(this._instance=new d),this._instance}setGlobalPropagator(h){return(0,e.registerGlobal)(l,h,c.DiagAPI.instance())}inject(h,m,g=n.defaultTextMapSetter){return this._getGlobalPropagator().inject(h,m,g)}extract(h,m,g=n.defaultTextMapGetter){return this._getGlobalPropagator().extract(h,m,g)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,e.unregisterGlobal)(l,c.DiagAPI.instance())}_getGlobalPropagator(){return(0,e.getGlobal)(l)||u}}t.PropagationAPI=d}),v6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0;var e=_6c();t.propagation=e.PropagationAPI.getInstance()}),C6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;var e=Dve(),r=YJi(),n=v6r(),o=VJi(),s=Nve(),c="trace";class l{static{a(this,"FH")}constructor(){this._proxyTracerProvider=new r.ProxyTracerProvider,this.wrapSpanContext=n.wrapSpanContext,this.isSpanContextValid=n.isSpanContextValid,this.deleteSpan=o.deleteSpan,this.getSpan=o.getSpan,this.getActiveSpan=o.getActiveSpan,this.getSpanContext=o.getSpanContext,this.setSpan=o.setSpan,this.setSpanContext=o.setSpanContext}static getInstance(){return this._instance||(this._instance=new l),this._instance}setGlobalTracerProvider(d){let f=(0,e.registerGlobal)(c,this._proxyTracerProvider,s.DiagAPI.instance());return f&&this._proxyTracerProvider.setDelegate(d),f}getTracerProvider(){return(0,e.getGlobal)(c)||this._proxyTracerProvider}getTracer(d,f){return this.getTracerProvider().getTracer(d,f)}disable(){(0,e.unregisterGlobal)(c,s.DiagAPI.instance()),this._proxyTracerProvider=new r.ProxyTracerProvider}}t.TraceAPI=l}),b6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0;var e=C6c();t.trace=e.TraceAPI.getInstance()}),S6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=t.propagation=t.metrics=t.diag=t.context=t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=t.isValidSpanId=t.isValidTraceId=t.isSpanContextValid=t.createTraceState=t.TraceFlags=t.SpanStatusCode=t.SpanKind=t.SamplingDecision=t.ProxyTracerProvider=t.ProxyTracer=t.defaultTextMapSetter=t.defaultTextMapGetter=t.ValueType=t.createNoopMeter=t.DiagLogLevel=t.DiagConsoleLogger=t.ROOT_CONTEXT=t.createContextKey=t.baggageEntryMetadataFromString=void 0;var e=jJi();Object.defineProperty(t,"baggageEntryMetadataFromString",{enumerable:!0,get:a(function(){return e.baggageEntryMetadataFromString},"get")});var r=uwt();Object.defineProperty(t,"createContextKey",{enumerable:!0,get:a(function(){return r.createContextKey},"get")}),Object.defineProperty(t,"ROOT_CONTEXT",{enumerable:!0,get:a(function(){return r.ROOT_CONTEXT},"get")});var n=n6c();Object.defineProperty(t,"DiagConsoleLogger",{enumerable:!0,get:a(function(){return n.DiagConsoleLogger},"get")});var o=y6r();Object.defineProperty(t,"DiagLogLevel",{enumerable:!0,get:a(function(){return o.DiagLogLevel},"get")});var s=HJi();Object.defineProperty(t,"createNoopMeter",{enumerable:!0,get:a(function(){return s.createNoopMeter},"get")});var c=i6c();Object.defineProperty(t,"ValueType",{enumerable:!0,get:a(function(){return c.ValueType},"get")});var l=GJi();Object.defineProperty(t,"defaultTextMapGetter",{enumerable:!0,get:a(function(){return l.defaultTextMapGetter},"get")}),Object.defineProperty(t,"defaultTextMapSetter",{enumerable:!0,get:a(function(){return l.defaultTextMapSetter},"get")});var u=zJi();Object.defineProperty(t,"ProxyTracer",{enumerable:!0,get:a(function(){return u.ProxyTracer},"get")});var d=YJi();Object.defineProperty(t,"ProxyTracerProvider",{enumerable:!0,get:a(function(){return d.ProxyTracerProvider},"get")});var f=a6c();Object.defineProperty(t,"SamplingDecision",{enumerable:!0,get:a(function(){return f.SamplingDecision},"get")});var h=c6c();Object.defineProperty(t,"SpanKind",{enumerable:!0,get:a(function(){return h.SpanKind},"get")});var m=l6c();Object.defineProperty(t,"SpanStatusCode",{enumerable:!0,get:a(function(){return m.SpanStatusCode},"get")});var g=$Ji();Object.defineProperty(t,"TraceFlags",{enumerable:!0,get:a(function(){return g.TraceFlags},"get")});var A=f6c();Object.defineProperty(t,"createTraceState",{enumerable:!0,get:a(function(){return A.createTraceState},"get")});var y=v6r();Object.defineProperty(t,"isSpanContextValid",{enumerable:!0,get:a(function(){return y.isSpanContextValid},"get")}),Object.defineProperty(t,"isValidTraceId",{enumerable:!0,get:a(function(){return y.isValidTraceId},"get")}),Object.defineProperty(t,"isValidSpanId",{enumerable:!0,get:a(function(){return y.isValidSpanId},"get")});var E=E6r();Object.defineProperty(t,"INVALID_SPANID",{enumerable:!0,get:a(function(){return E.INVALID_SPANID},"get")}),Object.defineProperty(t,"INVALID_TRACEID",{enumerable:!0,get:a(function(){return E.INVALID_TRACEID},"get")}),Object.defineProperty(t,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:a(function(){return E.INVALID_SPAN_CONTEXT},"get")});var _=p6c();Object.defineProperty(t,"context",{enumerable:!0,get:a(function(){return _.context},"get")});var v=h6c();Object.defineProperty(t,"diag",{enumerable:!0,get:a(function(){return v.diag},"get")});var b=A6c();Object.defineProperty(t,"metrics",{enumerable:!0,get:a(function(){return b.metrics},"get")});var T=v6c();Object.defineProperty(t,"propagation",{enumerable:!0,get:a(function(){return T.propagation},"get")});var w=b6c();Object.defineProperty(t,"trace",{enumerable:!0,get:a(function(){return w.trace},"get")}),t.default={context:_.context,diag:v.diag,metrics:b.metrics,propagation:T.propagation,trace:w.trace}}),GIt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{static{a(this,"BW")}}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{static{a(this,"K9")}constructor(v){if(super(),!t.IDENTIFIER.test(v))throw Error("CodeGen: name must be a valid identifier");this.str=v}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class n extends e{static{a(this,"B4")}constructor(v){super(),this._items=typeof v=="string"?[v]:v}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let v=this._items[0];return v===""||v==='""'}get str(){var v;return(v=this._str)!==null&&v!==void 0?v:this._str=this._items.reduce((b,T)=>`${b}${T}`,"")}get names(){var v;return(v=this._names)!==null&&v!==void 0?v:this._names=this._items.reduce((b,T)=>(T instanceof r&&(b[T.str]=(b[T.str]||0)+1),b),{})}}t._Code=n,t.nil=new n("");function o(_,...v){let b=[_[0]],T=0;for(;T{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;var e=GIt();class r extends Error{static{a(this,"Dj")}constructor(d){super(`CodeGen: "code" for ${d} not defined`),this.value=d.value}}var n;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(n||(t.UsedValueState=n={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class o{static{a(this,"KB")}constructor({prefixes:d,parent:f}={}){this._names={},this._prefixes=d,this._parent=f}toName(d){return d instanceof e.Name?d:this.name(d)}name(d){return new e.Name(this._newName(d))}_newName(d){let f=this._names[d]||this._nameGroup(d);return`${d}${f.index++}`}_nameGroup(d){var f,h;if(!((h=(f=this._parent)===null||f===void 0?void 0:f._prefixes)===null||h===void 0)&&h.has(d)||this._prefixes&&!this._prefixes.has(d))throw Error(`CodeGen: prefix "${d}" is not allowed in this scope`);return this._names[d]={prefix:d,index:0}}}t.Scope=o;class s extends e.Name{static{a(this,"qB")}constructor(d,f){super(f),this.prefix=d}setValue(d,{property:f,itemIndex:h}){this.value=d,this.scopePath=e._`.${new e.Name(f)}[${h}]`}}t.ValueScopeName=s;var c=e._`\n`;class l extends o{static{a(this,"Fj")}constructor(d){super(d),this._values={},this._scope=d.scope,this.opts={...d,_n:d.lines?c:e.nil}}get(){return this._scope}name(d){return new s(d,this._newName(d))}value(d,f){var h;if(f.ref===void 0)throw Error("CodeGen: ref must be passed in value");let m=this.toName(d),{prefix:g}=m,A=(h=f.key)!==null&&h!==void 0?h:f.ref,y=this._values[g];if(y){let v=y.get(A);if(v)return v}else y=this._values[g]=new Map;y.set(A,m);let E=this._scope[g]||(this._scope[g]=[]),_=E.length;return E[_]=f.ref,m.setValue(f,{property:g,itemIndex:_}),m}getValue(d,f){let h=this._values[d];if(h)return h.get(f)}scopeRefs(d,f=this._values){return this._reduceValues(f,h=>{if(h.scopePath===void 0)throw Error(`CodeGen: name "${h}" has no value`);return e._`${d}${h.scopePath}`})}scopeCode(d=this._values,f,h){return this._reduceValues(d,m=>{if(m.value===void 0)throw Error(`CodeGen: name "${m}" has no value`);return m.value.code},f,h)}_reduceValues(d,f,h={},m){let g=e.nil;for(let A in d){let y=d[A];if(!y)continue;let E=h[A]=h[A]||new Map;y.forEach(_=>{if(E.has(_))return;E.set(_,n.Started);let v=f(_);if(v){let b=this.opts.es5?t.varKinds.var:t.varKinds.const;g=e._`${g}${b} ${_} = ${v};${this.opts._n}`}else if(v=m?.(_))g=e._`${g}${v}${this.opts._n}`;else throw new r(_);E.set(_,n.Completed)})}return g}}t.ValueScope=l}),Ns=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;var e=GIt(),r=NYi(),n=GIt();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return n._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return n.str},"get")}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:a(function(){return n.strConcat},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return n.nil},"get")}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:a(function(){return n.getProperty},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return n.stringify},"get")}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:a(function(){return n.regexpCode},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return n.Name},"get")});var o=NYi();Object.defineProperty(t,"Scope",{enumerable:!0,get:a(function(){return o.Scope},"get")}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:a(function(){return o.ValueScope},"get")}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:a(function(){return o.ValueScopeName},"get")}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:a(function(){return o.varKinds},"get")}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class s{static{a(this,"y1")}optimizeNodes(){return this}optimizeNames(H,re){return this}}class c extends s{static{a(this,"Lj")}constructor(H,re,le){super(),this.varKind=H,this.name=re,this.rhs=le}render({es5:H,_n:re}){let le=H?r.varKinds.var:this.varKind,Le=this.rhs===void 0?"":` = ${this.rhs}`;return`${le} ${this.name}${Le};`+re}optimizeNames(H,re){if(H[this.name.str])return this.rhs&&(this.rhs=M(this.rhs,H,re)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class l extends s{static{a(this,"NB")}constructor(H,re,le){super(),this.lhs=H,this.rhs=re,this.sideEffects=le}render({_n:H}){return`${this.lhs} = ${this.rhs};`+H}optimizeNames(H,re){if(!(this.lhs instanceof e.Name&&!H[this.lhs.str]&&!this.sideEffects))return this.rhs=M(this.rhs,H,re),this}get names(){let H=this.lhs instanceof e.Name?{}:{...this.lhs.names};return q(H,this.rhs)}}class u extends l{static{a(this,"jj")}constructor(H,re,le,Le){super(H,le,Le),this.op=re}render({_n:H}){return`${this.lhs} ${this.op}= ${this.rhs};`+H}}class d extends s{static{a(this,"Aj")}constructor(H){super(),this.label=H,this.names={}}render({_n:H}){return`${this.label}:`+H}}class f extends s{static{a(this,"Ij")}constructor(H){super(),this.label=H,this.names={}}render({_n:H}){return`break${this.label?` ${this.label}`:""};`+H}}class h extends s{static{a(this,"Rj")}constructor(H){super(),this.error=H}render({_n:H}){return`throw ${this.error};`+H}get names(){return this.error.names}}class m extends s{static{a(this,"Pj")}constructor(H){super(),this.code=H}render({_n:H}){return`${this.code};`+H}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(H,re){return this.code=M(this.code,H,re),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class g extends s{static{a(this,"LW")}constructor(H=[]){super(),this.nodes=H}render(H){return this.nodes.reduce((re,le)=>re+le.render(H),"")}optimizeNodes(){let{nodes:H}=this,re=H.length;for(;re--;){let le=H[re].optimizeNodes();Array.isArray(le)?H.splice(re,1,...le):le?H[re]=le:H.splice(re,1)}return H.length>0?this:void 0}optimizeNames(H,re){let{nodes:le}=this,Le=le.length;for(;Le--;){let ge=le[Le];ge.optimizeNames(H,re)||(O(H,ge.names),le.splice(Le,1))}return le.length>0?this:void 0}get names(){return this.nodes.reduce((H,re)=>B(H,re.names),{})}}class A extends g{static{a(this,"f1")}render(H){return"{"+H._n+super.render(H)+"}"+H._n}}class y extends g{static{a(this,"Ej")}}class E extends A{static{a(this,"RJ")}}E.kind="else";class _ extends A{static{a(this,"e4")}constructor(H,re){super(re),this.condition=H}render(H){let re=`if(${this.condition})`+super.render(H);return this.else&&(re+="else "+this.else.render(H)),re}optimizeNodes(){super.optimizeNodes();let H=this.condition;if(H===!0)return this.nodes;let re=this.else;if(re){let le=re.optimizeNodes();re=this.else=Array.isArray(le)?new E(le):le}if(re)return H===!1?re instanceof _?re:re.nodes:this.nodes.length?this:new _(j(H),re instanceof _?[re]:re.nodes);if(!(H===!1||!this.nodes.length))return this}optimizeNames(H,re){var le;if(this.else=(le=this.else)===null||le===void 0?void 0:le.optimizeNames(H,re),!!(super.optimizeNames(H,re)||this.else))return this.condition=M(this.condition,H,re),this}get names(){let H=super.names;return q(H,this.condition),this.else&&B(H,this.else.names),H}}_.kind="if";class v extends A{static{a(this,"q9")}}v.kind="for";class b extends v{static{a(this,"bj")}constructor(H){super(),this.iteration=H}render(H){return`for(${this.iteration})`+super.render(H)}optimizeNames(H,re){if(super.optimizeNames(H,re))return this.iteration=M(this.iteration,H,re),this}get names(){return B(super.names,this.iteration.names)}}class T extends v{static{a(this,"_j")}constructor(H,re,le,Le){super(),this.varKind=H,this.name=re,this.from=le,this.to=Le}render(H){let re=H.es5?r.varKinds.var:this.varKind,{name:le,from:Le,to:ge}=this;return`for(${re} ${le}=${Le}; ${le}<${ge}; ${le}++)`+super.render(H)}get names(){let H=q(super.names,this.from);return q(H,this.to)}}class w extends v{static{a(this,"BB")}constructor(H,re,le,Le){super(),this.loop=H,this.varKind=re,this.name=le,this.iterable=Le}render(H){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(H)}optimizeNames(H,re){if(super.optimizeNames(H,re))return this.iterable=M(this.iterable,H,re),this}get names(){return B(super.names,this.iterable.names)}}class R extends A{static{a(this,"wW")}constructor(H,re,le){super(),this.name=H,this.args=re,this.async=le}render(H){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(H)}}R.kind="func";class x extends g{static{a(this,"OW")}render(H){return"return "+super.render(H)}}x.kind="return";class P extends A{static{a(this,"kj")}render(H){let re="try"+super.render(H);return this.catch&&(re+=this.catch.render(H)),this.finally&&(re+=this.finally.render(H)),re}optimizeNodes(){var H,re;return super.optimizeNodes(),(H=this.catch)===null||H===void 0||H.optimizeNodes(),(re=this.finally)===null||re===void 0||re.optimizeNodes(),this}optimizeNames(H,re){var le,Le;return super.optimizeNames(H,re),(le=this.catch)===null||le===void 0||le.optimizeNames(H,re),(Le=this.finally)===null||Le===void 0||Le.optimizeNames(H,re),this}get names(){let H=super.names;return this.catch&&B(H,this.catch.names),this.finally&&B(H,this.finally.names),H}}class D extends A{static{a(this,"DW")}constructor(H){super(),this.error=H}render(H){return`catch(${this.error})`+super.render(H)}}D.kind="catch";class N extends A{static{a(this,"FW")}render(H){return"finally"+super.render(H)}}N.kind="finally";class L{static{a(this,"Sj")}constructor(H,re={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...re,_n:re.lines?` -`:""},this._extScope=H,this._scope=new r.Scope({parent:H}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(H){return this._scope.name(H)}scopeName(H){return this._extScope.name(H)}scopeValue(H,re){let le=this._extScope.value(H,re);return(this._values[le.prefix]||(this._values[le.prefix]=new Set)).add(le),le}getScopeValue(H,re){return this._extScope.getValue(H,re)}scopeRefs(H){return this._extScope.scopeRefs(H,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(H,re,le,Le){let ge=this._scope.toName(re);return le!==void 0&&Le&&(this._constants[ge.str]=le),this._leafNode(new c(H,ge,le)),ge}const(H,re,le){return this._def(r.varKinds.const,H,re,le)}let(H,re,le){return this._def(r.varKinds.let,H,re,le)}var(H,re,le){return this._def(r.varKinds.var,H,re,le)}assign(H,re,le){return this._leafNode(new l(H,re,le))}add(H,re){return this._leafNode(new u(H,t.operators.ADD,re))}code(H){return typeof H=="function"?H():H!==e.nil&&this._leafNode(new m(H)),this}object(...H){let re=["{"];for(let[le,Le]of H)re.length>1&&re.push(","),re.push(le),(le!==Le||this.opts.es5)&&(re.push(":"),(0,e.addCodeArg)(re,Le));return re.push("}"),new e._Code(re)}if(H,re,le){if(this._blockNode(new _(H)),re&&le)this.code(re).else().code(le).endIf();else if(re)this.code(re).endIf();else if(le)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(H){return this._elseNode(new _(H))}else(){return this._elseNode(new E)}endIf(){return this._endBlockNode(_,E)}_for(H,re){return this._blockNode(H),re&&this.code(re).endFor(),this}for(H,re){return this._for(new b(H),re)}forRange(H,re,le,Le,ge=this.opts.es5?r.varKinds.var:r.varKinds.let){let Ue=this._scope.toName(H);return this._for(new T(ge,Ue,re,le),()=>Le(Ue))}forOf(H,re,le,Le=r.varKinds.const){let ge=this._scope.toName(H);if(this.opts.es5){let Ue=re instanceof e.Name?re:this.var("_arr",re);return this.forRange("_i",0,e._`${Ue}.length`,ke=>{this.var(ge,e._`${Ue}[${ke}]`),le(ge)})}return this._for(new w("of",Le,ge,re),()=>le(ge))}forIn(H,re,le,Le=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(H,e._`Object.keys(${re})`,le);let ge=this._scope.toName(H);return this._for(new w("in",Le,ge,re),()=>le(ge))}endFor(){return this._endBlockNode(v)}label(H){return this._leafNode(new d(H))}break(H){return this._leafNode(new f(H))}return(H){let re=new x;if(this._blockNode(re),this.code(H),re.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(x)}try(H,re,le){if(!re&&!le)throw Error('CodeGen: "try" without "catch" and "finally"');let Le=new P;if(this._blockNode(Le),this.code(H),re){let ge=this.name("e");this._currNode=Le.catch=new D(ge),re(ge)}return le&&(this._currNode=Le.finally=new N,this.code(le)),this._endBlockNode(D,N)}throw(H){return this._leafNode(new h(H))}block(H,re){return this._blockStarts.push(this._nodes.length),H&&this.code(H).endBlock(re),this}endBlock(H){let re=this._blockStarts.pop();if(re===void 0)throw Error("CodeGen: not in self-balancing block");let le=this._nodes.length-re;if(le<0||H!==void 0&&le!==H)throw Error(`CodeGen: wrong number of nodes: ${le} vs ${H} expected`);return this._nodes.length=re,this}func(H,re=e.nil,le,Le){return this._blockNode(new R(H,re,le)),Le&&this.code(Le).endFunc(),this}endFunc(){return this._endBlockNode(R)}optimize(H=1){for(;H-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(H){return this._currNode.nodes.push(H),this}_blockNode(H){this._currNode.nodes.push(H),this._nodes.push(H)}_endBlockNode(H,re){let le=this._currNode;if(le instanceof H||re&&le instanceof re)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${re?`${H.kind}/${re.kind}`:H.kind}"`)}_elseNode(H){let re=this._currNode;if(!(re instanceof _))throw Error('CodeGen: "else" without "if"');return this._currNode=re.else=H,this}get _root(){return this._nodes[0]}get _currNode(){let H=this._nodes;return H[H.length-1]}set _currNode(H){let re=this._nodes;re[re.length-1]=H}}t.CodeGen=L;function B(ie,H){for(let re in H)ie[re]=(ie[re]||0)+(H[re]||0);return ie}a(B,"v0");function q(ie,H){return H instanceof e._CodeOrName?B(ie,H.names):ie}a(q,"ZW");function M(ie,H,re){if(ie instanceof e.Name)return le(ie);if(!Le(ie))return ie;return new e._Code(ie._items.reduce((ge,Ue)=>(Ue instanceof e.Name&&(Ue=le(Ue)),Ue instanceof e._Code?ge.push(...Ue._items):ge.push(Ue),ge),[]));function le(ge){let Ue=re[ge.str];return Ue===void 0||H[ge.str]!==1?ge:(delete H[ge.str],Ue)}function Le(ge){return ge instanceof e._Code&&ge._items.some(Ue=>Ue instanceof e.Name&&H[Ue.str]===1&&re[Ue.str]!==void 0)}}a(M,"V9");function O(ie,H){for(let re in H)ie[re]=(ie[re]||0)-(H[re]||0)}a(O,"dp");function j(ie){return typeof ie=="boolean"||typeof ie=="number"||ie===null?!ie:e._`!${z(ie)}`}a(j,"vj"),t.not=j;var Q=V(t.operators.AND);function U(...ie){return ie.reduce(Q)}a(U,"np"),t.and=U;var Y=V(t.operators.OR);function W(...ie){return ie.reduce(Y)}a(W,"op"),t.or=W;function V(ie){return(H,re)=>H===e.nil?re:re===e.nil?H:e._`${z(H)} ${ie} ${z(re)}`}a(V,"Cj");function z(ie){return ie instanceof e.Name?ie:e._`(${ie})`}a(z,"zB")}),mc=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;var e=Ns(),r=GIt();function n(R){let x={};for(let P of R)x[P]=!0;return x}a(n,"$d"),t.toHash=n;function o(R,x){return typeof x=="boolean"?x:Object.keys(x).length===0?!0:(s(R,x),!c(x,R.self.RULES.all))}a(o,"Qd"),t.alwaysValidSchema=o;function s(R,x=R.schema){let{opts:P,self:D}=R;if(!P.strictSchema||typeof x=="boolean")return;let N=D.RULES.keywords;for(let L in x)N[L]||w(R,`unknown keyword: "${L}"`)}a(s,"fj"),t.checkUnknownRules=s;function c(R,x){if(typeof R=="boolean")return!R;for(let P in R)if(x[P])return!0;return!1}a(c,"gj"),t.schemaHasRules=c;function l(R,x){if(typeof R=="boolean")return!R;for(let P in R)if(P!=="$ref"&&x.all[P])return!0;return!1}a(l,"Jd"),t.schemaHasRulesButRef=l;function u({topSchemaRef:R,schemaPath:x},P,D,N){if(!N){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return e._`${P}`}return e._`${R}${x}${(0,e.getProperty)(D)}`}a(u,"Xd"),t.schemaRefOrVal=u;function d(R){return m(decodeURIComponent(R))}a(d,"Yd"),t.unescapeFragment=d;function f(R){return encodeURIComponent(h(R))}a(f,"Wd"),t.escapeFragment=f;function h(R){return typeof R=="number"?`${R}`:R.replace(/~/g,"~0").replace(/\//g,"~1")}a(h,"OB"),t.escapeJsonPointer=h;function m(R){return R.replace(/~1/g,"/").replace(/~0/g,"~")}a(m,"hj"),t.unescapeJsonPointer=m;function g(R,x){if(Array.isArray(R))for(let P of R)x(P);else x(R)}a(g,"Gd"),t.eachItem=g;function A({mergeNames:R,mergeToName:x,mergeValues:P,resultToName:D}){return(N,L,B,q)=>{let M=B===void 0?L:B instanceof e.Name?(L instanceof e.Name?R(N,L,B):x(N,L,B),B):L instanceof e.Name?(x(N,B,L),L):P(L,B);return q===e.Name&&!(M instanceof e.Name)?D(N,M):M}}a(A,"xj"),t.mergeEvaluated={props:A({mergeNames:a((R,x,P)=>R.if(e._`${P} !== true && ${x} !== undefined`,()=>{R.if(e._`${x} === true`,()=>R.assign(P,!0),()=>R.assign(P,e._`${P} || {}`).code(e._`Object.assign(${P}, ${x})`))}),"mergeNames"),mergeToName:a((R,x,P)=>R.if(e._`${P} !== true`,()=>{x===!0?R.assign(P,!0):(R.assign(P,e._`${P} || {}`),E(R,P,x))}),"mergeToName"),mergeValues:a((R,x)=>R===!0?!0:{...R,...x},"mergeValues"),resultToName:y}),items:A({mergeNames:a((R,x,P)=>R.if(e._`${P} !== true && ${x} !== undefined`,()=>R.assign(P,e._`${x} === true ? true : ${P} > ${x} ? ${P} : ${x}`)),"mergeNames"),mergeToName:a((R,x,P)=>R.if(e._`${P} !== true`,()=>R.assign(P,x===!0?!0:e._`${P} > ${x} ? ${P} : ${x}`)),"mergeToName"),mergeValues:a((R,x)=>R===!0?!0:Math.max(R,x),"mergeValues"),resultToName:a((R,x)=>R.var("items",x),"resultToName")})};function y(R,x){if(x===!0)return R.var("props",!0);let P=R.var("props",e._`{}`);return x!==void 0&&E(R,P,x),P}a(y,"uj"),t.evaluatedPropsToName=y;function E(R,x,P){Object.keys(P).forEach(D=>R.assign(e._`${x}${(0,e.getProperty)(D)}`,!0))}a(E,"DB"),t.setEvaluated=E;var _={};function v(R,x){return R.scopeValue("func",{ref:x,code:_[x.code]||(_[x.code]=new r._Code(x.code))})}a(v,"Ud"),t.useFunc=v;var b;(function(R){R[R.Num=0]="Num",R[R.Str=1]="Str"})(b||(t.Type=b={}));function T(R,x,P){if(R instanceof e.Name){let D=x===b.Num;return P?D?e._`"[" + ${R} + "]"`:e._`"['" + ${R} + "']"`:D?e._`"/" + ${R}`:e._`"/" + ${R}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(R).toString():"/"+h(R)}a(T,"Hd"),t.getErrorPath=T;function w(R,x,P=R.opts.strictSchema){if(P){if(x=`strict mode: ${x}`,P===!0)throw Error(x);R.self.logger.warn(x)}}a(w,"mj"),t.checkStrictMode=w}),pW=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};t.default=r}),fwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;var e=Ns(),r=mc(),n=pW();t.keywordError={message:a(({keyword:E})=>e.str`must pass "${E}" keyword validation`,"message")},t.keyword$DataError={message:a(({keyword:E,schemaType:_})=>_?e.str`"${E}" keyword must be ${_} ($data)`:e.str`"${E}" keyword is invalid ($data)`,"message")};function o(E,_=t.keywordError,v,b){let{it:T}=E,{gen:w,compositeRule:R,allErrors:x}=T,P=h(E,_,v);b??(R||x)?u(w,P):d(T,e._`[${P}]`)}a(o,"bd"),t.reportError=o;function s(E,_=t.keywordError,v){let{it:b}=E,{gen:T,compositeRule:w,allErrors:R}=b,x=h(E,_,v);u(T,x),!(w||R)&&d(b,n.default.vErrors)}a(s,"_d"),t.reportExtraError=s;function c(E,_){E.assign(n.default.errors,_),E.if(e._`${n.default.vErrors} !== null`,()=>E.if(_,()=>E.assign(e._`${n.default.vErrors}.length`,_),()=>E.assign(n.default.vErrors,null)))}a(c,"kd"),t.resetErrorsCount=c;function l({gen:E,keyword:_,schemaValue:v,data:b,errsCount:T,it:w}){if(T===void 0)throw Error("ajv implementation error");let R=E.name("err");E.forRange("i",T,n.default.errors,x=>{E.const(R,e._`${n.default.vErrors}[${x}]`),E.if(e._`${R}.instancePath === undefined`,()=>E.assign(e._`${R}.instancePath`,(0,e.strConcat)(n.default.instancePath,w.errorPath))),E.assign(e._`${R}.schemaPath`,e.str`${w.errSchemaPath}/${_}`),w.opts.verbose&&(E.assign(e._`${R}.schema`,v),E.assign(e._`${R}.data`,b))})}a(l,"Sd"),t.extendErrors=l;function u(E,_){let v=E.const("err",_);E.if(e._`${n.default.vErrors} === null`,()=>E.assign(n.default.vErrors,e._`[${v}]`),e._`${n.default.vErrors}.push(${v})`),E.code(e._`${n.default.errors}++`)}a(u,"dj");function d(E,_){let{gen:v,validateName:b,schemaEnv:T}=E;T.$async?v.throw(e._`new ${E.ValidationError}(${_})`):(v.assign(e._`${b}.errors`,_),v.return(!1))}a(d,"ij");var f={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function h(E,_,v){let{createErrors:b}=E.it;return b===!1?e._`{}`:m(E,_,v)}a(h,"nj");function m(E,_,v={}){let{gen:b,it:T}=E,w=[g(T,v),A(E,v)];return y(E,_,w),b.object(...w)}a(m,"vd");function g({errorPath:E},{instancePath:_}){let v=_?e.str`${E}${(0,r.getErrorPath)(_,r.Type.Str)}`:E;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,v)]}a(g,"Cd");function A({keyword:E,it:{errSchemaPath:_}},{schemaPath:v,parentSchema:b}){let T=b?_:e.str`${_}/${E}`;return v&&(T=e.str`${T}${(0,r.getErrorPath)(v,r.Type.Str)}`),[f.schemaPath,T]}a(A,"Td");function y(E,{params:_,message:v},b){let{keyword:T,data:w,schemaValue:R,it:x}=E,{opts:P,propertyName:D,topSchemaRef:N,schemaPath:L}=x;b.push([f.keyword,T],[f.params,typeof _=="function"?_(E):_||e._`{}`]),P.messages&&b.push([f.message,typeof v=="function"?v(E):v]),P.verbose&&b.push([f.schema,R],[f.parentSchema,e._`${N}${L}`],[n.default.data,w]),D&&b.push([f.propertyName,D])}a(y,"xd")}),T6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;var e=fwt(),r=Ns(),n=pW(),o={message:"boolean schema is false"};function s(u){let{gen:d,schema:f,validateName:h}=u;f===!1?l(u,!1):typeof f=="object"&&f.$async===!0?d.return(n.default.data):(d.assign(r._`${h}.errors`,null),d.return(!0))}a(s,"pd"),t.topBoolOrEmptySchema=s;function c(u,d){let{gen:f,schema:h}=u;h===!1?(f.var(d,!1),l(u)):f.var(d,!0)}a(c,"dd"),t.boolOrEmptySchema=c;function l(u,d){let{gen:f,data:h}=u,m={gen:f,keyword:"false schema",data:h,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,e.reportError)(m,o,void 0,d)}a(l,"tj")}),KJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;var e=["string","number","integer","boolean","null","object","array"],r=new Set(e);function n(s){return typeof s=="string"&&r.has(s)}a(n,"od"),t.isJSONType=n;function o(){let s={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...s,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},s.number,s.string,s.array,s.object],post:{rules:[]},all:{},keywords:{}}}a(o,"td"),t.getRules=o}),JJi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0;function e({schema:o,self:s},c){let l=s.RULES.types[c];return l&&l!==!0&&r(o,l)}a(e,"sd"),t.schemaHasRulesForType=e;function r(o,s){return s.rules.some(c=>n(o,c))}a(r,"JA"),t.shouldUseGroup=r;function n(o,s){var c;return o[s.keyword]!==void 0||((c=s.definition.implements)===null||c===void 0?void 0:c.some(l=>o[l]!==void 0))}a(n,"XA"),t.shouldUseRule=n}),$It=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;var e=KJi(),r=JJi(),n=fwt(),o=Ns(),s=mc(),c;(function(b){b[b.Correct=0]="Correct",b[b.Wrong=1]="Wrong"})(c||(t.DataType=c={}));function l(b){let T=u(b.type);if(T.includes("null")){if(b.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!T.length&&b.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');b.nullable===!0&&T.push("null")}return T}a(l,"Yi"),t.getSchemaTypes=l;function u(b){let T=Array.isArray(b)?b:b?[b]:[];if(T.every(e.isJSONType))return T;throw Error("type must be JSONType or JSONType[]: "+T.join(","))}a(u,"UA"),t.getJSONTypes=u;function d(b,T){let{gen:w,data:R,opts:x}=b,P=h(T,x.coerceTypes),D=T.length>0&&!(P.length===0&&T.length===1&&(0,r.schemaHasRulesForType)(b,T[0]));if(D){let N=y(T,R,x.strictNumbers,c.Wrong);w.if(N,()=>{P.length?m(b,T,P):_(b)})}return D}a(d,"Wi"),t.coerceAndCheckDataType=d;var f=new Set(["string","number","integer","boolean","null"]);function h(b,T){return T?b.filter(w=>f.has(w)||T==="array"&&w==="array"):[]}a(h,"Gi");function m(b,T,w){let{gen:R,data:x,opts:P}=b,D=R.let("dataType",o._`typeof ${x}`),N=R.let("coerced",o._`undefined`);P.coerceTypes==="array"&&R.if(o._`${D} == 'object' && Array.isArray(${x}) && ${x}.length == 1`,()=>R.assign(x,o._`${x}[0]`).assign(D,o._`typeof ${x}`).if(y(T,x,P.strictNumbers),()=>R.assign(N,x))),R.if(o._`${N} !== undefined`);for(let B of w)(f.has(B)||B==="array"&&P.coerceTypes==="array")&&L(B);R.else(),_(b),R.endIf(),R.if(o._`${N} !== undefined`,()=>{R.assign(x,N),g(b,N)});function L(B){switch(B){case"string":R.elseIf(o._`${D} == "number" || ${D} == "boolean"`).assign(N,o._`"" + ${x}`).elseIf(o._`${x} === null`).assign(N,o._`""`);return;case"number":R.elseIf(o._`${D} == "boolean" || ${x} === null +`}function LXi(t,e,r){return e!==void 0&&e>0?t.slice(r,r+e):r>0?t.slice(r):t}function v9r(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="agent_metadata"}async function Zil(t,e){let r=mao(e.dir),n=c6e(r),o=e.offset??0,s=e.limit;if(t.listSessionSummaries){let u=await t.listSessionSummaries(n),d=t.listSessions?new Map((await t.listSessions(n)).map(g=>[g.sessionId,g])):void 0,f=[];for(let g of u){let A=d?.get(g.sessionId);if(d&&!A)continue;let y=A!==void 0&&g.mtimeA.sessionId));for(let[A,y]of d)g.has(A)||f.push({sessionId:A,mtime:y.mtime})}else nu("listSessionSummaries without listSessions: gap-fill skipped; sessions lacking a sidecar will be omitted");f.sort((g,A)=>A.mtime-g.mtime);let h=LXi(f,s,o),m=h.filter(g=>g.info===void 0);if(m.length>0){let g=await BXi(t,m,e.dir,r),A=new Map(g.map(y=>[y.sessionId,y]));for(let y of h)y.info===void 0&&(y.info=A.get(y.sessionId)??null)}return h.flatMap(g=>g.info?[g.info]:[])}if(!t.listSessions)throw Error("sessionStore.listSessions is not implemented -- cannot list sessions. Provide a store with a listSessions() method.");let c=(await t.listSessions(n)).slice().sort((u,d)=>d.mtime-u.mtime),l=LXi(c,s,o);return BXi(t,l,e.dir,r)}async function BXi(t,e,r,n){return(await Promise.allSettled(e.map(async o=>{let s=await yao(t,o.sessionId,r);if(!s)return null;let c=Jwt(o.sessionId,Aao(s,o.mtime),n);return c?{...c,lastModified:o.mtime}:null}))).flatMap((o,s)=>{let c=e[s];return o.status==="fulfilled"?o.value?[o.value]:[]:[{sessionId:c.sessionId,summary:"",lastModified:c.mtime}]})}function Aao(t,e){let r=Buffer.from(t,"utf-8"),n=r.length,o=r.subarray(0,nU).toString("utf-8"),s=n>nU?r.subarray(n-nU).toString("utf-8"):o;return{mtime:e,size:n,head:o,tail:s}}function Xil(t){let e=t.trimEnd(),r=e.slice(e.lastIndexOf(` +`)+1);try{let n=ZN(r);if(typeof n=="object"&&n!==null&&"timestamp"in n&&typeof n.timestamp=="string"){let o=Date.parse(n.timestamp);if(!Number.isNaN(o))return o}}catch{}return Date.now()}async function yao(t,e,r){let n=Dk(r),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?null:gao(o)}async function eol(t,e,r){if(!Ih(e))return[];let n=Dk(r.dir),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?[]:TWc(o,{limit:r.limit,offset:r.offset,includeSystemMessages:r.includeSystemMessages})}async function tol(t,e,r){if(!Ih(e))return;let n=await yao(t,e,r.dir);if(!n)return;let o=Aao(n,Xil(n));return Jwt(e,o)??void 0}async function rol(t,e,r,n){if(!Ih(e))throw Error(`Invalid sessionId: ${e}`);if(!r.trim())throw Error("title must be non-empty");let o=Dk(n);await t.append({projectKey:o,sessionId:e},[{type:"custom-title",customTitle:r.trim(),sessionId:e,uuid:(0,Qwt.randomUUID)(),timestamp:new Date().toISOString()}])}async function nol(t,e,r,n){if(!Ih(e))throw Error(`Invalid sessionId: ${e}`);if(r!==null){let s=I8e(r).trim();if(!s)throw Error("tag must be non-empty (use null to clear)");r=s}let o=Dk(n);await t.append({projectKey:o,sessionId:e},[{type:"tag",tag:r??"",sessionId:e,uuid:(0,Qwt.randomUUID)(),timestamp:new Date().toISOString()}])}async function iol(t,e,r){if(!Ih(e))throw Error(`Invalid sessionId: ${e}`);if(r.upToMessageId&&!Ih(r.upToMessageId))throw Error(`Invalid upToMessageId: ${r.upToMessageId}`);let n=Dk(r.dir),o=await t.load({projectKey:n,sessionId:e});if(!o||o.length===0)throw Error(`Session ${e} not found`);let{entries:s,forkedSessionId:c}=$Wc(o,e,r);return await t.append({projectKey:n,sessionId:c},s),{sessionId:c}}async function ool(t,e,r){if(!Ih(e))return[];if(!t.listSubkeys)throw Error("sessionStore.listSubkeys is not implemented -- cannot list subagents. Provide a store with a listSubkeys() method.");let n=Dk(r),o=await t.listSubkeys({projectKey:n,sessionId:e}),s=new Set;for(let c of o){if(!c.startsWith("subagents/"))continue;let l=c.split("/").at(-1);l.startsWith("agent-")&&s.add(l.slice(6))}return[...s]}async function sol(t,e,r,n){if(!Ih(e))return[];if(!r)return[];let o=Dk(n.dir),s=`subagents/agent-${r}`;if(t.listSubkeys){let f=await t.listSubkeys({projectKey:o,sessionId:e}),h=`agent-${r}`,m=f.find(g=>g.startsWith("subagents/")&&g.split("/").at(-1)===h);if(!m)return[];s=m}let c=await t.load({projectKey:o,sessionId:e,subpath:s});if(!c||c.length===0)return[];let l=c.findLast(v9r),u=typeof l?.toolUseId=="string"?l.toolUseId:void 0,d=c.filter(f=>!v9r(f));return d.length===0?[]:Hto(Buffer.from(gao(d)),{limit:n.limit,offset:n.offset},u)}function FXi(t,e){let r=(0,hc.relative)(e,t),n=r.split(hc.sep);if(n[0]===".."||(0,hc.isAbsolute)(r)||n.length<2)return null;let o=n[0],s=n[1];if(n.length===2&&s.endsWith(".jsonl"))return{projectKey:o,sessionId:s.replace(/\.jsonl$/,"")};if(n.length>=4){let c=n.slice(2),l=c.length-1;return c[l]=c.at(-1).replace(/\.jsonl$/,""),{projectKey:o,sessionId:s,subpath:c.join("/")}}return null}var UXi,neo,Qwt,qwt,f_,ieo,kve,hc,oeo,seo,aeo,leo,ueo,deo,Aeo,yeo,Yeo,_6r,Keo,lA,Jeo,WL,b6r,dto,Yxt,h_,goe,vo,V0,pto,zL,vto,Sto,N6r,Tto,WN,Ove,Ito,xto,wto,Rto,aCe,cCe,O6r,YL,soe,v8e,twt,B8e,rwt,Gto,$to,vso,aoe,Cso,lf,cQr,Swt,Rso,kso,uQr,d9r,zso,Kso,Jso,My,sao,wUc,RUc,o6r,kUc,PUc,NUc,MUc,C9r,jt,OUc,ZL,BUc,FUc,UUc,sf,af,QUc,qUc,jUc,QXi,HUc,Zve,GUc,b9r,$Uc,Xve,VUc,WUc,qXi,Mwt,zUc,jXi,YUc,HXi,KUc,Owt,GXi,S9r,T9r,$Xi,I9r,VXi,WXi,JUc,zXi,ZUc,XUc,e7c,t7c,r7c,n7c,i7c,o7c,s7c,a7c,c7c,l7c,u7c,d7c,f7c,p7c,h7c,m7c,hxt,DJi,Ns,gc,TW,Lwt,g7c,YXi,KXi,mxt,A7c,JN,y7c,E7c,JXi,_7c,Bwt,Fwt,x9r,Uwt,w9r,v7c,ZXi,C7c,b7c,S7c,T7c,I7c,x7c,w7c,R7c,k7c,P7c,D7c,N7c,M7c,O7c,L7c,R9r,B7c,F7c,U7c,Q7c,XXi,eeo,q7c,j7c,H7c,G7c,$7c,teo,V7c,W7c,z7c,Y7c,K7c,J7c,Z7c,X7c,eQc,tQc,rQc,nQc,iQc,oQc,sQc,aQc,reo,cQc,lQc,uQc,dQc,jwt,pQc,hQc,mQc,gQc,AQc,a6r,M1,CQc,heo,bQc,SQc,eCe,TQc,_W,meo,IQc,xQc,zFe,RQc,kQc,PQc,NQc,MQc,OQc,NJi,i6e,sU,FQc,UQc,QQc,qQc,P9r,HQc,x8r,MJi,$Qc,VQc,WQc,YQc,KQc,JQc,ZQc,XQc,eqc,tqc,rqc,iqc,sqc,D9r,cqc,w8e,uqc,fqc,pqc,hqc,mqc,Aqc,yqc,Eqc,vqc,Cqc,Sqc,OJi,Iqc,Hwt,Gwt,Rqc,kqc,Dqc,Mqc,Lqc,Fqc,$wt,Uqc,geo,qqc,Hqc,Vwt,Vqc,zqc,Kqc,Zqc,N9r,Xqc,Oy,iCe,Stm,Eeo,c6r,wi,eC,LI,Pve,gxt,Axt,yxt,Ext,_xt,vxt,Cxt,bxt,Sxt,ejc,tjc,l6r,LJi,njc,_eo,ijc,mW,ojc,ajc,FJi,UJi,QJi,O9r,djc,pjc,hjc,beo,Txt,mjc,gjc,B9r,Ajc,qJi,w8r,yjc,iu,d6r,ru,jJi,HJi,Ixt,$Ji,vjc,VJi,eoe,weo,Cjc,bjc,Sjc,U9r,Tjc,keo,NI,MI,coe,YFe,loe,f6r,g8e,xxt,$It,wxt,p6r,uoe,p_,Meo,Oeo,Q9r,zJi,Ujc,Qjc,h6r,Leo,qjc,jjc,Rd,Beo,mr,YJi,Vjc,$n,Rxt,S8e,kxt,Pxt,Dxt,Nxt,k8e,Mxt,Oxt,Dve,Lxt,Bxt,qeo,Yjc,_ve,Kjc,Jjc,Geo,_k,cW,pve,KFe,VIt,JFe,ZFe,WIt,XFe,J9,e8e,zIt,YIt,Kie,KIt,JIt,t8e,R8r,JJi,ZIt,k8r,P8r,D8r,ZJi,XJi,g6r,Fxt,Zjc,Xjc,r8e,hve,Jie,j0,N1,DI,rU,lW,n8e,tZi,A6r,Uxt,nZi,tHc,doe,Qxt,qxt,Nve,jxt,P8e,Hxt,D8e,O1,Gxt,vk,uW,mve,i8e,XIt,o8e,s8e,ext,a8e,Z9,c8e,txt,rxt,Zie,nxt,ixt,l8e,N8r,sZi,M8r,O8r,L8r,B8r,aZi,cZi,y6r,$xt,N8e,uZi,nHc,Vxt,E6r,q9r,fxt,Weo,iHc,oHc,Bp,Mve,aHc,cHc,v6r,uHc,ioe,gve,pHc,mHc,AHc,EHc,_Hc,CHc,bHc,SHc,zxt,j9r,IHc,xHc,Xeo,kHc,DHc,sCe,MHc,dZi,eto,LHc,BHc,FHc,M8e,UHc,vW,A8e,qHc,tto,fZi,jHc,pZi,HHc,GHc,H9r,$Hc,VHc,Wwt,zHc,G9r,KHc,JHc,ZHc,XHc,eGc,tGc,rGc,nGc,iGc,oGc,sGc,aGc,cGc,lGc,uGc,dGc,fGc,pGc,hGc,mGc,gGc,AGc,yGc,EGc,xd,vGc,bGc,y8e,rto,T8e,SGc,F8r,TGc,C6r,hZi,IGc,nto,xGc,wGc,kGc,PGc,ito,MGc,$9r,BGc,FGc,UGc,qGc,oto,E8e,sto,mZi,HGc,gZi,AZi,ato,VGc,zGc,YGc,cto,KGc,yZi,ZGc,e$c,EZi,t$c,r$c,i$c,o$c,V9r,a$c,c$c,u$c,d$c,p$c,h$c,m$c,g$c,A$c,E$c,_$c,_Zi,vZi,v$c,b$c,zwt,T$c,W9r,w$c,k$c,D$c,M$c,uto,z9r,Kxt,Q$c,Y9r,H$c,V$c,z$c,Y$c,K$c,Ttm,J$c,Itm,Z$c,xtm,X$c,wtm,eVc,Rtm,S6r,nVc,oVc,fVc,pVc,ktm,Ptm,EVc,bZi,SZi,_Vc,vVc,TZi,T6r,SVc,TVc,I6r,IVc,mto,gto,wVc,RVc,oxt,U8r,u8e,Q8r,x6r,_to,Dtm,DVc,cf,ZN,BVc,Jxt,IZi,R6r,Ave,Zxt,$Vc,k6r,P6r,Z9r,X9r,WVc,D6r,xZi,q8r,KVc,eWc,nU,rWc,O8e,sWc,aWc,cWc,ewt,uWc,L8e,dWc,fWc,xWc,QWc,ZWc,zto,XWc,ezc,tzc,Mtm,wZi,rzc,izc,szc,czc,mc,RZi,Rn,pW,hr,xk,uzc,F8e,dzc,B6r,tC,Xi,C8e,L1,kZi,PZi,Lve,nwt,Kn,Rk,DZi,Ms,fzc,pzc,hzc,mzc,gzc,Azc,yzc,Ezc,_zc,$8r,vzc,Czc,bzc,Szc,Tzc,Izc,Yto,xzc,Bve,U8e,Q8e,q8e,j8e,H8e,Fve,Uve,G8e,EW,KL,$8e,bW,UI,Qve,eU,F6r,qve,aU,Q6r,V8e,W8e,q6r,jve,Hve,Gve,$ve,foe,zN,wk,cU,Vve,Wve,z8e,iwt,owt,zve,Otm,Cr,Ltm,Btm,Ftm,Utm,Qtm,qtm,jtm,Htm,Gtm,$tm,Vtm,Wtm,ztm,Ytm,Mzc,Ktm,Jtm,Ztm,Xtm,erm,trm,rrm,nrm,irm,orm,srm,arm,crm,lrm,urm,drm,frm,prm,hrm,Zto,Xto,ero,SW,swt,zs,rUr,nro,Gzc,awt,iro,sro,aro,j6r,lro,nUr,u6e,sUr,cwt,aUr,lwt,cUr,rRt,lUr,nRt,uUr,pro,hro,mro,gro,Aro,yro,Ero,Xzc,_ro,Yve,eYc,tYc,rYc,vro,nYc,iYc,oYc,sYc,aYc,bro,Sro,Tro,Iro,xro,dUr,wro,cYc,Rro,kro,Pro,Oro,Lro,Bro,Fro,Uro,Qro,qro,jro,Hro,xh,Gro,fUr,pUr,$ro,Vro,Wro,zro,Yro,Kro,Jro,Zro,Xro,d6e,eno,tno,rno,nno,ino,ono,sno,ano,cno,uwt,lno,Co,f6e,Qu,uno,dno,fno,pno,hno,mno,gno,Ano,yno,Eno,_no,vno,Cno,bno,Sno,Tno,Ino,xno,wno,Rno,Pno,Dno,Mno,Ono,mUr,Lno,gUr,AUr,Bno,Fno,Uno,Qno,qno,dwt,jno,Hno,Gno,yUr,EUr,_Ur,$no,Vno,iRt,Wno,zno,Yno,Kno,Jno,Zno,vUr,Xno,eio,tio,rio,nio,iio,oio,sio,CUr,aio,cio,lio,uio,dio,bUr,lYc,dYc,pYc,mYc,AYc,EYc,vYc,CYc,bYc,SYc,IYc,wYc,kYc,DYc,MYc,LYc,FYc,QYc,jYc,GYc,VYc,zYc,KYc,ZYc,eKc,rKc,iKc,sKc,cKc,uKc,fKc,hKc,gKc,yKc,_Kc,CKc,bKc,TKc,xKc,RKc,PKc,NKc,pio,hio,J8e,iU,Aio,hwt,e6e,rJc,nJc,iJc,G,s7r,a7r,c7r,l7r,u7r,aoo,aJc,h6e,coo,loo,uoo,doo,Os,d7r,cRt,kd,f7r,mwt,oU,p7r,h7r,m7r,g7r,A7r,y7r,E7r,_7r,v7r,C7r,b7r,S7r,T7r,I7r,x7r,w7r,foo,lRt,lCe,uRt,dRt,R7r,poo,hoo,moo,goo,Aoo,yoo,Eoo,P7r,_oo,pRt,D7r,voo,Coo,boo,M7r,Soo,Too,t6e,Ioo,xoo,O7r,B7r,woo,Roo,Poo,F7r,Moo,Ooo,Boo,U7r,Foo,Qoo,qoo,Hoo,mRt,nZc,oZc,zoo,pZc,Yoo,Koo,hZc,toe,gRt,$0,Joo,Zoo,mrm,mZc,gZc,q7r,QI,m6e,AZc,Ly,kk,Pk,By,ARt,Xoo,zZi,eso,yZc,j7r,cxt,Li,H7r,EZc,grm,Arm,G7r,_Zc,$7r,vZc,g6e,Jve,tso,CZc,bZc,SZc,TZc,IZc,xZc,rso,wZc,RZc,nso,V7r,kZc,PZc,W7r,DZc,A6e,y6e,NZc,E6e,yRt,MZc,ywt,z7r,Y7r,K7r,yrm,J7r,Z7r,X7r,OZc,iso,oso,eQr,sso,_6e,uCe,aso,LZc,$6r,BZc,V6r,FZc,tQr,UZc,W6r,QZc,qZc,jZc,HZc,GZc,$Zc,VZc,WZc,zZc,YZc,z6r,KZc,JZc,Y6r,rQr,nQr,iQr,ZZc,XZc,eXc,oQr,tXc,rXc,nXc,iXc,oXc,cso,K6r,sXc,sQr,Erm,aXc,Ewt,cXc,_rm,_wt,lXc,lso,uXc,dXc,fXc,pXc,hXc,mXc,gXc,vwt,AXc,yXc,EXc,aQr,uso,_Xc,vXc,CXc,bXc,SXc,TXc,IXc,xXc,wXc,RXc,kXc,PXc,DXc,NXc,MXc,OXc,LXc,BXc,Cwt,FXc,UXc,QXc,J6r,HXc,GXc,$Xc,dso,VXc,vrm,Crm,brm,Srm,Trm,Irm,fi,Z6r,WXc,YZi,zXc,YXc,pso,XXc,eel,iel,z8r,HN,ael,bwt,JZi,Eel,_el,Iel,xel,wel,Rel,kel,Del,X6r,Mel,Oel,e9r,t9r,r9r,yso,nXi,Qel,n9r,i9r,Hel,f8e,aXi,zel,Sk,s9r,lXi,xrm,wrm,uXi,dXi,fXi,pXi,gW,lQr,Sve,ttl,rtl,ntl,Rrm,atl,K8r,ltl,hXi,krm,yve,Tso,c9r,Iso,Twt,mXi,utl,fW,xso,wve,l9r,u9r,ftl,gXi,_Rt,vRt,Drm,Nrm,Mrm,r6e,Orm,ptl,htl,mtl,gtl,Atl,ytl,Etl,_tl,Lrm,dQr,vtl,Ctl,Brm,Frm,btl,p8e,Ttl,Itl,Iwt,Urm,Qrm,dCe,xW,xtl,wtl,Pso,Rtl,ktl,Ptl,Dtl,Ntl,Mtl,Otl,Ltl,f9r,qrm,Dso,Btl,Ftl,KN,moe,AXi,p9r,h9r,Nso,fQr,Qtl,jrm,qtl,jtl,Htl,Gtl,$tl,Mso,Oso,Vtl,yXi,Wtl,ztl,Lso,Ytl,Ktl,EXi,Jtl,Ztl,Bso,Xtl,Fso,erl,trl,rrl,xwt,J8r,Uso,nrl,irl,orl,srl,arl,Hrm,Qso,lrl,url,drl,frl,prl,hrl,mrl,Grm,grl,$rm,Arl,yrl,Erl,lxt,CRt,_Xi,jso,Vrm,Wrm,wwt,X8r,Drl,zrm,Nrl,Vso,Wso,Mrl,vXi,fCe,tU,Lrl,Brl,Yrm,qrl,Hrl,IXi,m9r,g9r,Tve,$rl,Vrl,Wrl,xXi,Rwt,Yrl,hW,Zso,Xso,eao,kwt,A9r,cnl,lnl,unl,fnl,pnl,hnl,mnl,tao,gnl,Anl,Enl,y9r,Cnl,Snl,Tnl,xnl,PXi,nao,knl,Pnl,Dnl,Nnl,Mnl,Onl,Bnl,Fnl,iao,Qnl,jnl,Gnl,$nl,AW,Wnl,Ynl,Jnl,DXi,Xnl,eil,ril,iil,oil,t6r,sil,r6r,ail,i6r,xil,MXi,wil,Ril,kil,Bil,_ao=Se(()=>{p();UXi=require("node:module"),neo=require("child_process"),Qwt=require("crypto"),qwt=require("fs"),f_=require("fs/promises"),ieo=require("module"),kve=require("os"),hc=require("path"),oeo=require("readline"),seo=require("url"),aeo=require("events"),leo=require("child_process"),ueo=require("fs"),deo=require("readline"),Aeo=require("os"),yeo=require("path"),Yeo=require("crypto"),_6r=require("path"),Keo=require("async_hooks"),lA=require("fs/promises"),Jeo=require("crypto"),WL=require("fs/promises"),b6r=require("fs"),dto=require("process"),Yxt=require("crypto"),h_=require("fs/promises"),goe=require("path"),vo=fe(require("fs"),1),V0=require("fs/promises"),pto=require("fs"),zL=require("path"),vto=require("fs"),Sto=require("fs/promises"),N6r=require("events"),Tto=require("fs"),WN=require("fs/promises"),Ove=require("path"),Ito=require("child_process"),xto=require("util"),wto=require("child_process"),Rto=require("path"),aCe=require("fs/promises"),cCe=require("path"),O6r=require("fs"),YL=require("fs/promises"),soe=require("path"),v8e=require("crypto"),twt=require("path"),B8e=require("fs/promises"),rwt=require("path"),Gto=require("crypto"),$to=require("os"),vso=require("path"),aoe=require("path"),Cso=require("path"),lf=fe(require("node:path"),1),cQr=fe(require("node:os"),1),Swt=fe(require("node:process"),1),Rso=require("path"),kso=require("fs/promises"),uQr=require("os"),d9r=require("path"),zso=require("os"),Kso=require("child_process"),Jso=require("fs"),My=require("path"),sao=require("path"),wUc=Object.create,{getPrototypeOf:RUc,defineProperty:o6r,getOwnPropertyNames:kUc}=Object,PUc=Object.prototype.hasOwnProperty;a(DUc,"a_");C9r=a((t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var o=e?NUc??=new WeakMap:MUc??=new WeakMap,s=o.get(t);if(s)return s}r=t!=null?wUc(RUc(t)):{};let c=e||!t||!t.__esModule?o6r(r,"default",{value:t,enumerable:!0}):r;for(let l of kUc(t))PUc.call(c,l)||o6r(c,l,{get:DUc.bind(t,l),enumerable:!0});return n&&o.set(t,c),c},"DG"),jt=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"I"),OUc=a(t=>t,"$k");a(LUc,"Qk");ZL=a((t,e)=>{for(var r in e)o6r(t,r,{get:e[r],enumerable:!0,configurable:!0,set:LUc.bind(e,r)})},"M4"),BUc=(0,UXi.createRequire)(importMetaUrlShim),FUc=Symbol.dispose||Symbol.for("Symbol.dispose"),UUc=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),sf=a((t,e,r)=>{if(e!=null){if(typeof e!="object"&&typeof e!="function")throw TypeError('Object expected to be assigned to "using" declaration');var n;if(r&&(n=e[UUc]),n===void 0&&(n=e[FUc]),typeof n!="function")throw TypeError("Object not disposable");t.push([r,n,e])}else r&&t.push([r]);return e},"Z$"),af=a((t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(c,l,u,d){return d=Error(u),d.name="SuppressedError",d.error=c,d.suppressed=l,d},o=a(c=>e=r?new n(c,e,"An error was suppressed during disposal"):(r=!0,c),"X"),s=a(c=>{for(;c=t.pop();)try{var l=c[1]&&c[1].call(c[2]);if(c[0])return Promise.resolve(l).then(s,u=>(o(u),s()))}catch(u){o(u)}if(r)throw e},"W");return s()},"M$"),QUc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t._globalThis=void 0,t._globalThis=typeof globalThis=="object"?globalThis:global}),qUc=jt(t=>{var e=t&&t.__createBinding||(Object.create?function(n,o,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:a(function(){return o[s]},"get")})}:function(n,o,s,c){c===void 0&&(c=s),n[c]=o[s]}),r=t&&t.__exportStar||function(n,o){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(QUc(),t)}),jUc=jt(t=>{var e=t&&t.__createBinding||(Object.create?function(n,o,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:a(function(){return o[s]},"get")})}:function(n,o,s,c){c===void 0&&(c=s),n[c]=o[s]}),r=t&&t.__exportStar||function(n,o){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(qUc(),t)}),QXi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.9.0"}),HUc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;var e=QXi(),r=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function n(o){let s=new Set([o]),c=new Set,l=o.match(r);if(!l)return()=>!1;let u={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};if(u.prerelease!=null)return function(h){return h===o};function d(h){return c.add(h),!1}a(d,"W");function f(h){return s.add(h),!0}return a(f,"G"),function(h){if(s.has(h))return!0;if(c.has(h))return!1;let m=h.match(r);if(!m)return d(h);let g={major:+m[1],minor:+m[2],patch:+m[3],prerelease:m[4]};return g.prerelease!=null||u.major!==g.major?d(h):u.major===0?u.minor===g.minor&&u.patch<=g.patch?f(h):d(h):u.minor<=g.minor?f(h):d(h)}}a(n,"b2"),t._makeCompatibilityCheck=n,t.isCompatible=n(e.VERSION)}),Zve=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;var e=jUc(),r=QXi(),n=HUc(),o=r.VERSION.split(".")[0],s=Symbol.for(`opentelemetry.js.api.${o}`),c=e._globalThis;function l(f,h,m,g=!1){var A;let y=c[s]=(A=c[s])!==null&&A!==void 0?A:{version:r.VERSION};if(!g&&y[f]){let E=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${f}`);return m.error(E.stack||E.message),!1}if(y.version!==r.VERSION){let E=Error(`@opentelemetry/api: Registration of version v${y.version} for ${f} does not match previously registered API v${r.VERSION}`);return m.error(E.stack||E.message),!1}return y[f]=h,m.debug(`@opentelemetry/api: Registered a global for ${f} v${r.VERSION}.`),!0}a(l,"ex"),t.registerGlobal=l;function u(f){var h,m;let g=(h=c[s])===null||h===void 0?void 0:h.version;if(!(!g||!(0,n.isCompatible)(g)))return(m=c[s])===null||m===void 0?void 0:m[f]}a(u,"$y"),t.getGlobal=u;function d(f,h){h.debug(`@opentelemetry/api: Unregistering a global for ${f} v${r.VERSION}.`);let m=c[s];m&&delete m[f]}a(d,"Qy"),t.unregisterGlobal=d}),GUc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;var e=Zve();class r{static{a(this,"T2")}constructor(s){this._namespace=s.namespace||"DiagComponentLogger"}debug(...s){return n("debug",this._namespace,s)}error(...s){return n("error",this._namespace,s)}info(...s){return n("info",this._namespace,s)}warn(...s){return n("warn",this._namespace,s)}verbose(...s){return n("verbose",this._namespace,s)}}t.DiagComponentLogger=r;function n(o,s,c){let l=(0,e.getGlobal)("diag");if(l)return c.unshift(s),l[o](...c)}a(n,"lQ")}),b9r=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagLogLevel=void 0;var e;(function(r){r[r.NONE=0]="NONE",r[r.ERROR=30]="ERROR",r[r.WARN=50]="WARN",r[r.INFO=60]="INFO",r[r.DEBUG=70]="DEBUG",r[r.VERBOSE=80]="VERBOSE",r[r.ALL=9999]="ALL"})(e=t.DiagLogLevel||(t.DiagLogLevel={}))}),$Uc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;var e=b9r();function r(n,o){ne.DiagLogLevel.ALL&&(n=e.DiagLogLevel.ALL),o=o||{};function s(c,l){let u=o[c];return typeof u=="function"&&n>=l?u.bind(o):function(){}}return a(s,"J"),{error:s("error",e.DiagLogLevel.ERROR),warn:s("warn",e.DiagLogLevel.WARN),info:s("info",e.DiagLogLevel.INFO),debug:s("debug",e.DiagLogLevel.DEBUG),verbose:s("verbose",e.DiagLogLevel.VERBOSE)}}a(r,"Gy"),t.createLogLevelDiagLogger=r}),Xve=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;var e=GUc(),r=$Uc(),n=b9r(),o=Zve(),s="diag";class c{static{a(this,"kU")}constructor(){function u(h){return function(...m){let g=(0,o.getGlobal)("diag");if(g)return g[h](...m)}}a(u,"$");let d=this,f=a((h,m={logLevel:n.DiagLogLevel.INFO})=>{var g,A,y;if(h===d){let v=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return d.error((g=v.stack)!==null&&g!==void 0?g:v.message),!1}typeof m=="number"&&(m={logLevel:m});let E=(0,o.getGlobal)("diag"),_=(0,r.createLogLevelDiagLogger)((A=m.logLevel)!==null&&A!==void 0?A:n.DiagLogLevel.INFO,h);if(E&&!m.suppressOverrideMessage){let v=(y=Error().stack)!==null&&y!==void 0?y:"";E.warn(`Current logger will be overwritten from ${v}`),_.warn(`Current logger will overwrite one already registered from ${v}`)}return(0,o.registerGlobal)("diag",_,d,!0)},"J");d.setLogger=f,d.disable=()=>{(0,o.unregisterGlobal)(s,d)},d.createComponentLogger=h=>new e.DiagComponentLogger(h),d.verbose=u("verbose"),d.debug=u("debug"),d.info=u("info"),d.warn=u("warn"),d.error=u("error")}static instance(){return this._instance||(this._instance=new c),this._instance}}t.DiagAPI=c}),VUc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaggageImpl=void 0;class e{static{a(this,"P8")}constructor(n){this._entries=n?new Map(n):new Map}getEntry(n){let o=this._entries.get(n);if(o)return Object.assign({},o)}getAllEntries(){return Array.from(this._entries.entries()).map(([n,o])=>[n,o])}setEntry(n,o){let s=new e(this._entries);return s._entries.set(n,o),s}removeEntry(n){let o=new e(this._entries);return o._entries.delete(n),o}removeEntries(...n){let o=new e(this._entries);for(let s of n)o._entries.delete(s);return o}clear(){return new e}}t.BaggageImpl=e}),WUc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")}),qXi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;var e=Xve(),r=VUc(),n=WUc(),o=e.DiagAPI.instance();function s(l={}){return new r.BaggageImpl(new Map(Object.entries(l)))}a(s,"Ny"),t.createBaggage=s;function c(l){return typeof l!="string"&&(o.error(`Cannot create baggage metadata from unknown type: ${typeof l}`),l=""),{__TYPE__:n.baggageEntryMetadataSymbol,toString(){return l}}}a(c,"wy"),t.baggageEntryMetadataFromString=c}),Mwt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ROOT_CONTEXT=t.createContextKey=void 0;function e(n){return Symbol.for(n)}a(e,"Dy"),t.createContextKey=e;class r{static{a(this,"DX")}constructor(o){let s=this;s._currentContext=o?new Map(o):new Map,s.getValue=c=>s._currentContext.get(c),s.setValue=(c,l)=>{let u=new r(s._currentContext);return u._currentContext.set(c,l),u},s.deleteValue=c=>{let l=new r(s._currentContext);return l._currentContext.delete(c),l}}}t.ROOT_CONTEXT=new r}),zUc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagConsoleLogger=void 0;var e=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class r{static{a(this,"QD")}constructor(){function o(s){return function(...c){if(console){let l=console[s];if(typeof l!="function"&&(l=console.log),typeof l=="function")return l.apply(console,c)}}}a(o,"$");for(let s=0;s{Object.defineProperty(t,"__esModule",{value:!0}),t.createNoopMeter=t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=t.NOOP_OBSERVABLE_GAUGE_METRIC=t.NOOP_OBSERVABLE_COUNTER_METRIC=t.NOOP_UP_DOWN_COUNTER_METRIC=t.NOOP_HISTOGRAM_METRIC=t.NOOP_GAUGE_METRIC=t.NOOP_COUNTER_METRIC=t.NOOP_METER=t.NoopObservableUpDownCounterMetric=t.NoopObservableGaugeMetric=t.NoopObservableCounterMetric=t.NoopObservableMetric=t.NoopHistogramMetric=t.NoopGaugeMetric=t.NoopUpDownCounterMetric=t.NoopCounterMetric=t.NoopMetric=t.NoopMeter=void 0;class e{static{a(this,"CU")}constructor(){}createGauge(g,A){return t.NOOP_GAUGE_METRIC}createHistogram(g,A){return t.NOOP_HISTOGRAM_METRIC}createCounter(g,A){return t.NOOP_COUNTER_METRIC}createUpDownCounter(g,A){return t.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(g,A){return t.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(g,A){return t.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(g,A){return t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(g,A){}removeBatchObservableCallback(g){}}t.NoopMeter=e;class r{static{a(this,"E8")}}t.NoopMetric=r;class n extends r{static{a(this,"TU")}add(g,A){}}t.NoopCounterMetric=n;class o extends r{static{a(this,"xU")}add(g,A){}}t.NoopUpDownCounterMetric=o;class s extends r{static{a(this,"yU")}record(g,A){}}t.NoopGaugeMetric=s;class c extends r{static{a(this,"fU")}record(g,A){}}t.NoopHistogramMetric=c;class l{static{a(this,"pQ")}addCallback(g){}removeCallback(g){}}t.NoopObservableMetric=l;class u extends l{static{a(this,"gU")}}t.NoopObservableCounterMetric=u;class d extends l{static{a(this,"hU")}}t.NoopObservableGaugeMetric=d;class f extends l{static{a(this,"uU")}}t.NoopObservableUpDownCounterMetric=f,t.NOOP_METER=new e,t.NOOP_COUNTER_METRIC=new n,t.NOOP_GAUGE_METRIC=new s,t.NOOP_HISTOGRAM_METRIC=new c,t.NOOP_UP_DOWN_COUNTER_METRIC=new o,t.NOOP_OBSERVABLE_COUNTER_METRIC=new u,t.NOOP_OBSERVABLE_GAUGE_METRIC=new d,t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new f;function h(){return t.NOOP_METER}a(h,"Zy"),t.createNoopMeter=h}),YUc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueType=void 0;var e;(function(r){r[r.INT=0]="INT",r[r.DOUBLE=1]="DOUBLE"})(e=t.ValueType||(t.ValueType={}))}),HXi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTextMapSetter=t.defaultTextMapGetter=void 0,t.defaultTextMapGetter={get(e,r){if(e!=null)return e[r]},keys(e){return e==null?[]:Object.keys(e)}},t.defaultTextMapSetter={set(e,r,n){e!=null&&(e[r]=n)}}}),KUc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;var e=Mwt();class r{static{a(this,"ZD")}active(){return e.ROOT_CONTEXT}with(o,s,c,...l){return s.call(c,...l)}bind(o,s){return s}enable(){return this}disable(){return this}}t.NoopContextManager=r}),Owt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;var e=KUc(),r=Zve(),n=Xve(),o="context",s=new e.NoopContextManager;class c{static{a(this,"iU")}constructor(){}static getInstance(){return this._instance||(this._instance=new c),this._instance}setGlobalContextManager(u){return(0,r.registerGlobal)(o,u,n.DiagAPI.instance())}active(){return this._getContextManager().active()}with(u,d,f,...h){return this._getContextManager().with(u,d,f,...h)}bind(u,d){return this._getContextManager().bind(u,d)}_getContextManager(){return(0,r.getGlobal)(o)||s}disable(){this._getContextManager().disable(),(0,r.unregisterGlobal)(o,n.DiagAPI.instance())}}t.ContextAPI=c}),GXi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceFlags=void 0;var e;(function(r){r[r.NONE=0]="NONE",r[r.SAMPLED=1]="SAMPLED"})(e=t.TraceFlags||(t.TraceFlags={}))}),S9r=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;var e=GXi();t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:e.TraceFlags.NONE}}),T9r=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;var e=S9r();class r{static{a(this,"SD")}constructor(o=e.INVALID_SPAN_CONTEXT){this._spanContext=o}spanContext(){return this._spanContext}setAttribute(o,s){return this}setAttributes(o){return this}addEvent(o,s){return this}addLink(o){return this}addLinks(o){return this}setStatus(o){return this}updateName(o){return this}end(o){}isRecording(){return!1}recordException(o,s){}}t.NonRecordingSpan=r}),$Xi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;var e=Mwt(),r=T9r(),n=Owt(),o=(0,e.createContextKey)("OpenTelemetry Context Key SPAN");function s(h){return h.getValue(o)||void 0}a(s,"tU"),t.getSpan=s;function c(){return s(n.ContextAPI.getInstance().active())}a(c,"my"),t.getActiveSpan=c;function l(h,m){return h.setValue(o,m)}a(l,"TD"),t.setSpan=l;function u(h){return h.deleteValue(o)}a(u,"ly"),t.deleteSpan=u;function d(h,m){return l(h,new r.NonRecordingSpan(m))}a(d,"cy"),t.setSpanContext=d;function f(h){var m;return(m=s(h))===null||m===void 0?void 0:m.spanContext()}a(f,"py"),t.getSpanContext=f}),I9r=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;var e=S9r(),r=T9r(),n=/^([0-9a-f]{32})$/i,o=/^[0-9a-f]{16}$/i;function s(d){return n.test(d)&&d!==e.INVALID_TRACEID}a(s,"gD"),t.isValidTraceId=s;function c(d){return o.test(d)&&d!==e.INVALID_SPANID}a(c,"hD"),t.isValidSpanId=c;function l(d){return s(d.traceId)&&c(d.spanId)}a(l,"ey"),t.isSpanContextValid=l;function u(d){return new r.NonRecordingSpan(d)}a(u,"$f"),t.wrapSpanContext=u}),VXi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;var e=Owt(),r=$Xi(),n=T9r(),o=I9r(),s=e.ContextAPI.getInstance();class c{static{a(this,"cD")}startSpan(d,f,h=s.active()){if(f?.root)return new n.NonRecordingSpan;let m=h&&(0,r.getSpanContext)(h);return l(m)&&(0,o.isSpanContextValid)(m)?new n.NonRecordingSpan(m):new n.NonRecordingSpan}startActiveSpan(d,f,h,m){let g,A,y;if(arguments.length<2)return;arguments.length===2?y=f:arguments.length===3?(g=f,y=h):(g=f,A=h,y=m);let E=A??s.active(),_=this.startSpan(d,g,E),v=(0,r.setSpan)(E,_);return s.with(v,y,void 0,_)}}t.NoopTracer=c;function l(u){return typeof u=="object"&&typeof u.spanId=="string"&&typeof u.traceId=="string"&&typeof u.traceFlags=="number"}a(l,"Gf")}),WXi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;var e=VXi(),r=new e.NoopTracer;class n{static{a(this,"iD")}constructor(s,c,l,u){this._provider=s,this.name=c,this.version=l,this.options=u}startSpan(s,c,l){return this._getTracer().startSpan(s,c,l)}startActiveSpan(s,c,l,u){let d=this._getTracer();return Reflect.apply(d.startActiveSpan,d,arguments)}_getTracer(){if(this._delegate)return this._delegate;let s=this._provider.getDelegateTracer(this.name,this.version,this.options);return s?(this._delegate=s,this._delegate):r}}t.ProxyTracer=n}),JUc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;var e=VXi();class r{static{a(this,"oD")}getTracer(o,s,c){return new e.NoopTracer}}t.NoopTracerProvider=r}),zXi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;var e=WXi(),r=JUc(),n=new r.NoopTracerProvider;class o{static{a(this,"eD")}getTracer(c,l,u){var d;return(d=this.getDelegateTracer(c,l,u))!==null&&d!==void 0?d:new e.ProxyTracer(this,c,l,u)}getDelegate(){var c;return(c=this._delegate)!==null&&c!==void 0?c:n}setDelegate(c){this._delegate=c}getDelegateTracer(c,l,u){var d;return(d=this._delegate)===null||d===void 0?void 0:d.getTracer(c,l,u)}}t.ProxyTracerProvider=o}),ZUc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SamplingDecision=void 0;var e;(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(e=t.SamplingDecision||(t.SamplingDecision={}))}),XUc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanKind=void 0;var e;(function(r){r[r.INTERNAL=0]="INTERNAL",r[r.SERVER=1]="SERVER",r[r.CLIENT=2]="CLIENT",r[r.PRODUCER=3]="PRODUCER",r[r.CONSUMER=4]="CONSUMER"})(e=t.SpanKind||(t.SpanKind={}))}),e7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanStatusCode=void 0;var e;(function(r){r[r.UNSET=0]="UNSET",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR"})(e=t.SpanStatusCode||(t.SpanStatusCode={}))}),t7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateValue=t.validateKey=void 0;var e="[_0-9a-z-*/]",r=`[a-z]${e}{0,255}`,n=`[a-z0-9]${e}{0,240}@[a-z]${e}{0,13}`,o=new RegExp(`^(?:${r}|${n})$`),s=/^[ -~]{0,255}[!-~]$/,c=/,|=/;function l(d){return o.test(d)}a(l,"Lf"),t.validateKey=l;function u(d){return s.test(d)&&!c.test(d)}a(u,"jf"),t.validateValue=u}),r7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;var e=t7c(),r=32,n=512,o=",",s="=";class c{static{a(this,"UH")}constructor(u){this._internalState=new Map,u&&this._parse(u)}set(u,d){let f=this._clone();return f._internalState.has(u)&&f._internalState.delete(u),f._internalState.set(u,d),f}unset(u){let d=this._clone();return d._internalState.delete(u),d}get(u){return this._internalState.get(u)}serialize(){return this._keys().reduce((u,d)=>(u.push(d+s+this.get(d)),u),[]).join(o)}_parse(u){u.length>n||(this._internalState=u.split(o).reverse().reduce((d,f)=>{let h=f.trim(),m=h.indexOf(s);if(m!==-1){let g=h.slice(0,m),A=h.slice(m+1,f.length);(0,e.validateKey)(g)&&(0,e.validateValue)(A)&&d.set(g,A)}return d},new Map),this._internalState.size>r&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,r))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let u=new c;return u._internalState=new Map(this._internalState),u}}t.TraceStateImpl=c}),n7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;var e=r7c();function r(n){return new e.TraceStateImpl(n)}a(r,"Pf"),t.createTraceState=r}),i7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0;var e=Owt();t.context=e.ContextAPI.getInstance()}),o7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0;var e=Xve();t.diag=e.DiagAPI.instance()}),s7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;var e=jXi();class r{static{a(this,"HH")}getMeter(o,s,c){return e.NOOP_METER}}t.NoopMeterProvider=r,t.NOOP_METER_PROVIDER=new r}),a7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;var e=s7c(),r=Zve(),n=Xve(),o="metrics";class s{static{a(this,"VH")}constructor(){}static getInstance(){return this._instance||(this._instance=new s),this._instance}setGlobalMeterProvider(l){return(0,r.registerGlobal)(o,l,n.DiagAPI.instance())}getMeterProvider(){return(0,r.getGlobal)(o)||e.NOOP_METER_PROVIDER}getMeter(l,u,d){return this.getMeterProvider().getMeter(l,u,d)}disable(){(0,r.unregisterGlobal)(o,n.DiagAPI.instance())}}t.MetricsAPI=s}),c7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0;var e=a7c();t.metrics=e.MetricsAPI.getInstance()}),l7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTextMapPropagator=void 0;class e{static{a(this,"fF")}inject(n,o){}extract(n,o){return n}fields(){return[]}}t.NoopTextMapPropagator=e}),u7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;var e=Owt(),r=Mwt(),n=(0,r.createContextKey)("OpenTelemetry Baggage Key");function o(u){return u.getValue(n)||void 0}a(o,"mF"),t.getBaggage=o;function s(){return o(e.ContextAPI.getInstance().active())}a(s,"xf"),t.getActiveBaggage=s;function c(u,d){return u.setValue(n,d)}a(c,"yf"),t.setBaggage=c;function l(u){return u.deleteValue(n)}a(l,"ff"),t.deleteBaggage=l}),d7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;var e=Zve(),r=l7c(),n=HXi(),o=u7c(),s=qXi(),c=Xve(),l="propagation",u=new r.NoopTextMapPropagator;class d{static{a(this,"wH")}constructor(){this.createBaggage=s.createBaggage,this.getBaggage=o.getBaggage,this.getActiveBaggage=o.getActiveBaggage,this.setBaggage=o.setBaggage,this.deleteBaggage=o.deleteBaggage}static getInstance(){return this._instance||(this._instance=new d),this._instance}setGlobalPropagator(h){return(0,e.registerGlobal)(l,h,c.DiagAPI.instance())}inject(h,m,g=n.defaultTextMapSetter){return this._getGlobalPropagator().inject(h,m,g)}extract(h,m,g=n.defaultTextMapGetter){return this._getGlobalPropagator().extract(h,m,g)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,e.unregisterGlobal)(l,c.DiagAPI.instance())}_getGlobalPropagator(){return(0,e.getGlobal)(l)||u}}t.PropagationAPI=d}),f7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0;var e=d7c();t.propagation=e.PropagationAPI.getInstance()}),p7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;var e=Zve(),r=zXi(),n=I9r(),o=$Xi(),s=Xve(),c="trace";class l{static{a(this,"FH")}constructor(){this._proxyTracerProvider=new r.ProxyTracerProvider,this.wrapSpanContext=n.wrapSpanContext,this.isSpanContextValid=n.isSpanContextValid,this.deleteSpan=o.deleteSpan,this.getSpan=o.getSpan,this.getActiveSpan=o.getActiveSpan,this.getSpanContext=o.getSpanContext,this.setSpan=o.setSpan,this.setSpanContext=o.setSpanContext}static getInstance(){return this._instance||(this._instance=new l),this._instance}setGlobalTracerProvider(d){let f=(0,e.registerGlobal)(c,this._proxyTracerProvider,s.DiagAPI.instance());return f&&this._proxyTracerProvider.setDelegate(d),f}getTracerProvider(){return(0,e.getGlobal)(c)||this._proxyTracerProvider}getTracer(d,f){return this.getTracerProvider().getTracer(d,f)}disable(){(0,e.unregisterGlobal)(c,s.DiagAPI.instance()),this._proxyTracerProvider=new r.ProxyTracerProvider}}t.TraceAPI=l}),h7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0;var e=p7c();t.trace=e.TraceAPI.getInstance()}),m7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=t.propagation=t.metrics=t.diag=t.context=t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=t.isValidSpanId=t.isValidTraceId=t.isSpanContextValid=t.createTraceState=t.TraceFlags=t.SpanStatusCode=t.SpanKind=t.SamplingDecision=t.ProxyTracerProvider=t.ProxyTracer=t.defaultTextMapSetter=t.defaultTextMapGetter=t.ValueType=t.createNoopMeter=t.DiagLogLevel=t.DiagConsoleLogger=t.ROOT_CONTEXT=t.createContextKey=t.baggageEntryMetadataFromString=void 0;var e=qXi();Object.defineProperty(t,"baggageEntryMetadataFromString",{enumerable:!0,get:a(function(){return e.baggageEntryMetadataFromString},"get")});var r=Mwt();Object.defineProperty(t,"createContextKey",{enumerable:!0,get:a(function(){return r.createContextKey},"get")}),Object.defineProperty(t,"ROOT_CONTEXT",{enumerable:!0,get:a(function(){return r.ROOT_CONTEXT},"get")});var n=zUc();Object.defineProperty(t,"DiagConsoleLogger",{enumerable:!0,get:a(function(){return n.DiagConsoleLogger},"get")});var o=b9r();Object.defineProperty(t,"DiagLogLevel",{enumerable:!0,get:a(function(){return o.DiagLogLevel},"get")});var s=jXi();Object.defineProperty(t,"createNoopMeter",{enumerable:!0,get:a(function(){return s.createNoopMeter},"get")});var c=YUc();Object.defineProperty(t,"ValueType",{enumerable:!0,get:a(function(){return c.ValueType},"get")});var l=HXi();Object.defineProperty(t,"defaultTextMapGetter",{enumerable:!0,get:a(function(){return l.defaultTextMapGetter},"get")}),Object.defineProperty(t,"defaultTextMapSetter",{enumerable:!0,get:a(function(){return l.defaultTextMapSetter},"get")});var u=WXi();Object.defineProperty(t,"ProxyTracer",{enumerable:!0,get:a(function(){return u.ProxyTracer},"get")});var d=zXi();Object.defineProperty(t,"ProxyTracerProvider",{enumerable:!0,get:a(function(){return d.ProxyTracerProvider},"get")});var f=ZUc();Object.defineProperty(t,"SamplingDecision",{enumerable:!0,get:a(function(){return f.SamplingDecision},"get")});var h=XUc();Object.defineProperty(t,"SpanKind",{enumerable:!0,get:a(function(){return h.SpanKind},"get")});var m=e7c();Object.defineProperty(t,"SpanStatusCode",{enumerable:!0,get:a(function(){return m.SpanStatusCode},"get")});var g=GXi();Object.defineProperty(t,"TraceFlags",{enumerable:!0,get:a(function(){return g.TraceFlags},"get")});var A=n7c();Object.defineProperty(t,"createTraceState",{enumerable:!0,get:a(function(){return A.createTraceState},"get")});var y=I9r();Object.defineProperty(t,"isSpanContextValid",{enumerable:!0,get:a(function(){return y.isSpanContextValid},"get")}),Object.defineProperty(t,"isValidTraceId",{enumerable:!0,get:a(function(){return y.isValidTraceId},"get")}),Object.defineProperty(t,"isValidSpanId",{enumerable:!0,get:a(function(){return y.isValidSpanId},"get")});var E=S9r();Object.defineProperty(t,"INVALID_SPANID",{enumerable:!0,get:a(function(){return E.INVALID_SPANID},"get")}),Object.defineProperty(t,"INVALID_TRACEID",{enumerable:!0,get:a(function(){return E.INVALID_TRACEID},"get")}),Object.defineProperty(t,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:a(function(){return E.INVALID_SPAN_CONTEXT},"get")});var _=i7c();Object.defineProperty(t,"context",{enumerable:!0,get:a(function(){return _.context},"get")});var v=o7c();Object.defineProperty(t,"diag",{enumerable:!0,get:a(function(){return v.diag},"get")});var b=c7c();Object.defineProperty(t,"metrics",{enumerable:!0,get:a(function(){return b.metrics},"get")});var T=f7c();Object.defineProperty(t,"propagation",{enumerable:!0,get:a(function(){return T.propagation},"get")});var w=h7c();Object.defineProperty(t,"trace",{enumerable:!0,get:a(function(){return w.trace},"get")}),t.default={context:_.context,diag:v.diag,metrics:b.metrics,propagation:T.propagation,trace:w.trace}}),hxt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{static{a(this,"BW")}}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{static{a(this,"K9")}constructor(v){if(super(),!t.IDENTIFIER.test(v))throw Error("CodeGen: name must be a valid identifier");this.str=v}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class n extends e{static{a(this,"B4")}constructor(v){super(),this._items=typeof v=="string"?[v]:v}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let v=this._items[0];return v===""||v==='""'}get str(){var v;return(v=this._str)!==null&&v!==void 0?v:this._str=this._items.reduce((b,T)=>`${b}${T}`,"")}get names(){var v;return(v=this._names)!==null&&v!==void 0?v:this._names=this._items.reduce((b,T)=>(T instanceof r&&(b[T.str]=(b[T.str]||0)+1),b),{})}}t._Code=n,t.nil=new n("");function o(_,...v){let b=[_[0]],T=0;for(;T{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;var e=hxt();class r extends Error{static{a(this,"Dj")}constructor(d){super(`CodeGen: "code" for ${d} not defined`),this.value=d.value}}var n;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(n||(t.UsedValueState=n={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class o{static{a(this,"KB")}constructor({prefixes:d,parent:f}={}){this._names={},this._prefixes=d,this._parent=f}toName(d){return d instanceof e.Name?d:this.name(d)}name(d){return new e.Name(this._newName(d))}_newName(d){let f=this._names[d]||this._nameGroup(d);return`${d}${f.index++}`}_nameGroup(d){var f,h;if(!((h=(f=this._parent)===null||f===void 0?void 0:f._prefixes)===null||h===void 0)&&h.has(d)||this._prefixes&&!this._prefixes.has(d))throw Error(`CodeGen: prefix "${d}" is not allowed in this scope`);return this._names[d]={prefix:d,index:0}}}t.Scope=o;class s extends e.Name{static{a(this,"qB")}constructor(d,f){super(f),this.prefix=d}setValue(d,{property:f,itemIndex:h}){this.value=d,this.scopePath=e._`.${new e.Name(f)}[${h}]`}}t.ValueScopeName=s;var c=e._`\n`;class l extends o{static{a(this,"Fj")}constructor(d){super(d),this._values={},this._scope=d.scope,this.opts={...d,_n:d.lines?c:e.nil}}get(){return this._scope}name(d){return new s(d,this._newName(d))}value(d,f){var h;if(f.ref===void 0)throw Error("CodeGen: ref must be passed in value");let m=this.toName(d),{prefix:g}=m,A=(h=f.key)!==null&&h!==void 0?h:f.ref,y=this._values[g];if(y){let v=y.get(A);if(v)return v}else y=this._values[g]=new Map;y.set(A,m);let E=this._scope[g]||(this._scope[g]=[]),_=E.length;return E[_]=f.ref,m.setValue(f,{property:g,itemIndex:_}),m}getValue(d,f){let h=this._values[d];if(h)return h.get(f)}scopeRefs(d,f=this._values){return this._reduceValues(f,h=>{if(h.scopePath===void 0)throw Error(`CodeGen: name "${h}" has no value`);return e._`${d}${h.scopePath}`})}scopeCode(d=this._values,f,h){return this._reduceValues(d,m=>{if(m.value===void 0)throw Error(`CodeGen: name "${m}" has no value`);return m.value.code},f,h)}_reduceValues(d,f,h={},m){let g=e.nil;for(let A in d){let y=d[A];if(!y)continue;let E=h[A]=h[A]||new Map;y.forEach(_=>{if(E.has(_))return;E.set(_,n.Started);let v=f(_);if(v){let b=this.opts.es5?t.varKinds.var:t.varKinds.const;g=e._`${g}${b} ${_} = ${v};${this.opts._n}`}else if(v=m?.(_))g=e._`${g}${v}${this.opts._n}`;else throw new r(_);E.set(_,n.Completed)})}return g}}t.ValueScope=l}),Ns=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;var e=hxt(),r=DJi(),n=hxt();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return n._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return n.str},"get")}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:a(function(){return n.strConcat},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return n.nil},"get")}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:a(function(){return n.getProperty},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return n.stringify},"get")}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:a(function(){return n.regexpCode},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return n.Name},"get")});var o=DJi();Object.defineProperty(t,"Scope",{enumerable:!0,get:a(function(){return o.Scope},"get")}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:a(function(){return o.ValueScope},"get")}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:a(function(){return o.ValueScopeName},"get")}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:a(function(){return o.varKinds},"get")}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class s{static{a(this,"y1")}optimizeNodes(){return this}optimizeNames(H,te){return this}}class c extends s{static{a(this,"Lj")}constructor(H,te,le){super(),this.varKind=H,this.name=te,this.rhs=le}render({es5:H,_n:te}){let le=H?r.varKinds.var:this.varKind,Le=this.rhs===void 0?"":` = ${this.rhs}`;return`${le} ${this.name}${Le};`+te}optimizeNames(H,te){if(H[this.name.str])return this.rhs&&(this.rhs=M(this.rhs,H,te)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class l extends s{static{a(this,"NB")}constructor(H,te,le){super(),this.lhs=H,this.rhs=te,this.sideEffects=le}render({_n:H}){return`${this.lhs} = ${this.rhs};`+H}optimizeNames(H,te){if(!(this.lhs instanceof e.Name&&!H[this.lhs.str]&&!this.sideEffects))return this.rhs=M(this.rhs,H,te),this}get names(){let H=this.lhs instanceof e.Name?{}:{...this.lhs.names};return j(H,this.rhs)}}class u extends l{static{a(this,"jj")}constructor(H,te,le,Le){super(H,le,Le),this.op=te}render({_n:H}){return`${this.lhs} ${this.op}= ${this.rhs};`+H}}class d extends s{static{a(this,"Aj")}constructor(H){super(),this.label=H,this.names={}}render({_n:H}){return`${this.label}:`+H}}class f extends s{static{a(this,"Ij")}constructor(H){super(),this.label=H,this.names={}}render({_n:H}){return`break${this.label?` ${this.label}`:""};`+H}}class h extends s{static{a(this,"Rj")}constructor(H){super(),this.error=H}render({_n:H}){return`throw ${this.error};`+H}get names(){return this.error.names}}class m extends s{static{a(this,"Pj")}constructor(H){super(),this.code=H}render({_n:H}){return`${this.code};`+H}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(H,te){return this.code=M(this.code,H,te),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class g extends s{static{a(this,"LW")}constructor(H=[]){super(),this.nodes=H}render(H){return this.nodes.reduce((te,le)=>te+le.render(H),"")}optimizeNodes(){let{nodes:H}=this,te=H.length;for(;te--;){let le=H[te].optimizeNodes();Array.isArray(le)?H.splice(te,1,...le):le?H[te]=le:H.splice(te,1)}return H.length>0?this:void 0}optimizeNames(H,te){let{nodes:le}=this,Le=le.length;for(;Le--;){let ge=le[Le];ge.optimizeNames(H,te)||(O(H,ge.names),le.splice(Le,1))}return le.length>0?this:void 0}get names(){return this.nodes.reduce((H,te)=>B(H,te.names),{})}}class A extends g{static{a(this,"f1")}render(H){return"{"+H._n+super.render(H)+"}"+H._n}}class y extends g{static{a(this,"Ej")}}class E extends A{static{a(this,"RJ")}}E.kind="else";class _ extends A{static{a(this,"e4")}constructor(H,te){super(te),this.condition=H}render(H){let te=`if(${this.condition})`+super.render(H);return this.else&&(te+="else "+this.else.render(H)),te}optimizeNodes(){super.optimizeNodes();let H=this.condition;if(H===!0)return this.nodes;let te=this.else;if(te){let le=te.optimizeNodes();te=this.else=Array.isArray(le)?new E(le):le}if(te)return H===!1?te instanceof _?te:te.nodes:this.nodes.length?this:new _(U(H),te instanceof _?[te]:te.nodes);if(!(H===!1||!this.nodes.length))return this}optimizeNames(H,te){var le;if(this.else=(le=this.else)===null||le===void 0?void 0:le.optimizeNames(H,te),!!(super.optimizeNames(H,te)||this.else))return this.condition=M(this.condition,H,te),this}get names(){let H=super.names;return j(H,this.condition),this.else&&B(H,this.else.names),H}}_.kind="if";class v extends A{static{a(this,"q9")}}v.kind="for";class b extends v{static{a(this,"bj")}constructor(H){super(),this.iteration=H}render(H){return`for(${this.iteration})`+super.render(H)}optimizeNames(H,te){if(super.optimizeNames(H,te))return this.iteration=M(this.iteration,H,te),this}get names(){return B(super.names,this.iteration.names)}}class T extends v{static{a(this,"_j")}constructor(H,te,le,Le){super(),this.varKind=H,this.name=te,this.from=le,this.to=Le}render(H){let te=H.es5?r.varKinds.var:this.varKind,{name:le,from:Le,to:ge}=this;return`for(${te} ${le}=${Le}; ${le}<${ge}; ${le}++)`+super.render(H)}get names(){let H=j(super.names,this.from);return j(H,this.to)}}class w extends v{static{a(this,"BB")}constructor(H,te,le,Le){super(),this.loop=H,this.varKind=te,this.name=le,this.iterable=Le}render(H){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(H)}optimizeNames(H,te){if(super.optimizeNames(H,te))return this.iterable=M(this.iterable,H,te),this}get names(){return B(super.names,this.iterable.names)}}class R extends A{static{a(this,"wW")}constructor(H,te,le){super(),this.name=H,this.args=te,this.async=le}render(H){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(H)}}R.kind="func";class x extends g{static{a(this,"OW")}render(H){return"return "+super.render(H)}}x.kind="return";class P extends A{static{a(this,"kj")}render(H){let te="try"+super.render(H);return this.catch&&(te+=this.catch.render(H)),this.finally&&(te+=this.finally.render(H)),te}optimizeNodes(){var H,te;return super.optimizeNodes(),(H=this.catch)===null||H===void 0||H.optimizeNodes(),(te=this.finally)===null||te===void 0||te.optimizeNodes(),this}optimizeNames(H,te){var le,Le;return super.optimizeNames(H,te),(le=this.catch)===null||le===void 0||le.optimizeNames(H,te),(Le=this.finally)===null||Le===void 0||Le.optimizeNames(H,te),this}get names(){let H=super.names;return this.catch&&B(H,this.catch.names),this.finally&&B(H,this.finally.names),H}}class D extends A{static{a(this,"DW")}constructor(H){super(),this.error=H}render(H){return`catch(${this.error})`+super.render(H)}}D.kind="catch";class N extends A{static{a(this,"FW")}render(H){return"finally"+super.render(H)}}N.kind="finally";class L{static{a(this,"Sj")}constructor(H,te={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...te,_n:te.lines?` +`:""},this._extScope=H,this._scope=new r.Scope({parent:H}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(H){return this._scope.name(H)}scopeName(H){return this._extScope.name(H)}scopeValue(H,te){let le=this._extScope.value(H,te);return(this._values[le.prefix]||(this._values[le.prefix]=new Set)).add(le),le}getScopeValue(H,te){return this._extScope.getValue(H,te)}scopeRefs(H){return this._extScope.scopeRefs(H,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(H,te,le,Le){let ge=this._scope.toName(te);return le!==void 0&&Le&&(this._constants[ge.str]=le),this._leafNode(new c(H,ge,le)),ge}const(H,te,le){return this._def(r.varKinds.const,H,te,le)}let(H,te,le){return this._def(r.varKinds.let,H,te,le)}var(H,te,le){return this._def(r.varKinds.var,H,te,le)}assign(H,te,le){return this._leafNode(new l(H,te,le))}add(H,te){return this._leafNode(new u(H,t.operators.ADD,te))}code(H){return typeof H=="function"?H():H!==e.nil&&this._leafNode(new m(H)),this}object(...H){let te=["{"];for(let[le,Le]of H)te.length>1&&te.push(","),te.push(le),(le!==Le||this.opts.es5)&&(te.push(":"),(0,e.addCodeArg)(te,Le));return te.push("}"),new e._Code(te)}if(H,te,le){if(this._blockNode(new _(H)),te&&le)this.code(te).else().code(le).endIf();else if(te)this.code(te).endIf();else if(le)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(H){return this._elseNode(new _(H))}else(){return this._elseNode(new E)}endIf(){return this._endBlockNode(_,E)}_for(H,te){return this._blockNode(H),te&&this.code(te).endFor(),this}for(H,te){return this._for(new b(H),te)}forRange(H,te,le,Le,ge=this.opts.es5?r.varKinds.var:r.varKinds.let){let Oe=this._scope.toName(H);return this._for(new T(ge,Oe,te,le),()=>Le(Oe))}forOf(H,te,le,Le=r.varKinds.const){let ge=this._scope.toName(H);if(this.opts.es5){let Oe=te instanceof e.Name?te:this.var("_arr",te);return this.forRange("_i",0,e._`${Oe}.length`,we=>{this.var(ge,e._`${Oe}[${we}]`),le(ge)})}return this._for(new w("of",Le,ge,te),()=>le(ge))}forIn(H,te,le,Le=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(H,e._`Object.keys(${te})`,le);let ge=this._scope.toName(H);return this._for(new w("in",Le,ge,te),()=>le(ge))}endFor(){return this._endBlockNode(v)}label(H){return this._leafNode(new d(H))}break(H){return this._leafNode(new f(H))}return(H){let te=new x;if(this._blockNode(te),this.code(H),te.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(x)}try(H,te,le){if(!te&&!le)throw Error('CodeGen: "try" without "catch" and "finally"');let Le=new P;if(this._blockNode(Le),this.code(H),te){let ge=this.name("e");this._currNode=Le.catch=new D(ge),te(ge)}return le&&(this._currNode=Le.finally=new N,this.code(le)),this._endBlockNode(D,N)}throw(H){return this._leafNode(new h(H))}block(H,te){return this._blockStarts.push(this._nodes.length),H&&this.code(H).endBlock(te),this}endBlock(H){let te=this._blockStarts.pop();if(te===void 0)throw Error("CodeGen: not in self-balancing block");let le=this._nodes.length-te;if(le<0||H!==void 0&&le!==H)throw Error(`CodeGen: wrong number of nodes: ${le} vs ${H} expected`);return this._nodes.length=te,this}func(H,te=e.nil,le,Le){return this._blockNode(new R(H,te,le)),Le&&this.code(Le).endFunc(),this}endFunc(){return this._endBlockNode(R)}optimize(H=1){for(;H-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(H){return this._currNode.nodes.push(H),this}_blockNode(H){this._currNode.nodes.push(H),this._nodes.push(H)}_endBlockNode(H,te){let le=this._currNode;if(le instanceof H||te&&le instanceof te)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${te?`${H.kind}/${te.kind}`:H.kind}"`)}_elseNode(H){let te=this._currNode;if(!(te instanceof _))throw Error('CodeGen: "else" without "if"');return this._currNode=te.else=H,this}get _root(){return this._nodes[0]}get _currNode(){let H=this._nodes;return H[H.length-1]}set _currNode(H){let te=this._nodes;te[te.length-1]=H}}t.CodeGen=L;function B(ie,H){for(let te in H)ie[te]=(ie[te]||0)+(H[te]||0);return ie}a(B,"v0");function j(ie,H){return H instanceof e._CodeOrName?B(ie,H.names):ie}a(j,"ZW");function M(ie,H,te){if(ie instanceof e.Name)return le(ie);if(!Le(ie))return ie;return new e._Code(ie._items.reduce((ge,Oe)=>(Oe instanceof e.Name&&(Oe=le(Oe)),Oe instanceof e._Code?ge.push(...Oe._items):ge.push(Oe),ge),[]));function le(ge){let Oe=te[ge.str];return Oe===void 0||H[ge.str]!==1?ge:(delete H[ge.str],Oe)}function Le(ge){return ge instanceof e._Code&&ge._items.some(Oe=>Oe instanceof e.Name&&H[Oe.str]===1&&te[Oe.str]!==void 0)}}a(M,"V9");function O(ie,H){for(let te in H)ie[te]=(ie[te]||0)-(H[te]||0)}a(O,"dp");function U(ie){return typeof ie=="boolean"||typeof ie=="number"||ie===null?!ie:e._`!${z(ie)}`}a(U,"vj"),t.not=U;var q=V(t.operators.AND);function Q(...ie){return ie.reduce(q)}a(Q,"np"),t.and=Q;var Y=V(t.operators.OR);function W(...ie){return ie.reduce(Y)}a(W,"op"),t.or=W;function V(ie){return(H,te)=>H===e.nil?te:te===e.nil?H:e._`${z(H)} ${ie} ${z(te)}`}a(V,"Cj");function z(ie){return ie instanceof e.Name?ie:e._`(${ie})`}a(z,"zB")}),gc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;var e=Ns(),r=hxt();function n(R){let x={};for(let P of R)x[P]=!0;return x}a(n,"$d"),t.toHash=n;function o(R,x){return typeof x=="boolean"?x:Object.keys(x).length===0?!0:(s(R,x),!c(x,R.self.RULES.all))}a(o,"Qd"),t.alwaysValidSchema=o;function s(R,x=R.schema){let{opts:P,self:D}=R;if(!P.strictSchema||typeof x=="boolean")return;let N=D.RULES.keywords;for(let L in x)N[L]||w(R,`unknown keyword: "${L}"`)}a(s,"fj"),t.checkUnknownRules=s;function c(R,x){if(typeof R=="boolean")return!R;for(let P in R)if(x[P])return!0;return!1}a(c,"gj"),t.schemaHasRules=c;function l(R,x){if(typeof R=="boolean")return!R;for(let P in R)if(P!=="$ref"&&x.all[P])return!0;return!1}a(l,"Jd"),t.schemaHasRulesButRef=l;function u({topSchemaRef:R,schemaPath:x},P,D,N){if(!N){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return e._`${P}`}return e._`${R}${x}${(0,e.getProperty)(D)}`}a(u,"Xd"),t.schemaRefOrVal=u;function d(R){return m(decodeURIComponent(R))}a(d,"Yd"),t.unescapeFragment=d;function f(R){return encodeURIComponent(h(R))}a(f,"Wd"),t.escapeFragment=f;function h(R){return typeof R=="number"?`${R}`:R.replace(/~/g,"~0").replace(/\//g,"~1")}a(h,"OB"),t.escapeJsonPointer=h;function m(R){return R.replace(/~1/g,"/").replace(/~0/g,"~")}a(m,"hj"),t.unescapeJsonPointer=m;function g(R,x){if(Array.isArray(R))for(let P of R)x(P);else x(R)}a(g,"Gd"),t.eachItem=g;function A({mergeNames:R,mergeToName:x,mergeValues:P,resultToName:D}){return(N,L,B,j)=>{let M=B===void 0?L:B instanceof e.Name?(L instanceof e.Name?R(N,L,B):x(N,L,B),B):L instanceof e.Name?(x(N,B,L),L):P(L,B);return j===e.Name&&!(M instanceof e.Name)?D(N,M):M}}a(A,"xj"),t.mergeEvaluated={props:A({mergeNames:a((R,x,P)=>R.if(e._`${P} !== true && ${x} !== undefined`,()=>{R.if(e._`${x} === true`,()=>R.assign(P,!0),()=>R.assign(P,e._`${P} || {}`).code(e._`Object.assign(${P}, ${x})`))}),"mergeNames"),mergeToName:a((R,x,P)=>R.if(e._`${P} !== true`,()=>{x===!0?R.assign(P,!0):(R.assign(P,e._`${P} || {}`),E(R,P,x))}),"mergeToName"),mergeValues:a((R,x)=>R===!0?!0:{...R,...x},"mergeValues"),resultToName:y}),items:A({mergeNames:a((R,x,P)=>R.if(e._`${P} !== true && ${x} !== undefined`,()=>R.assign(P,e._`${x} === true ? true : ${P} > ${x} ? ${P} : ${x}`)),"mergeNames"),mergeToName:a((R,x,P)=>R.if(e._`${P} !== true`,()=>R.assign(P,x===!0?!0:e._`${P} > ${x} ? ${P} : ${x}`)),"mergeToName"),mergeValues:a((R,x)=>R===!0?!0:Math.max(R,x),"mergeValues"),resultToName:a((R,x)=>R.var("items",x),"resultToName")})};function y(R,x){if(x===!0)return R.var("props",!0);let P=R.var("props",e._`{}`);return x!==void 0&&E(R,P,x),P}a(y,"uj"),t.evaluatedPropsToName=y;function E(R,x,P){Object.keys(P).forEach(D=>R.assign(e._`${x}${(0,e.getProperty)(D)}`,!0))}a(E,"DB"),t.setEvaluated=E;var _={};function v(R,x){return R.scopeValue("func",{ref:x,code:_[x.code]||(_[x.code]=new r._Code(x.code))})}a(v,"Ud"),t.useFunc=v;var b;(function(R){R[R.Num=0]="Num",R[R.Str=1]="Str"})(b||(t.Type=b={}));function T(R,x,P){if(R instanceof e.Name){let D=x===b.Num;return P?D?e._`"[" + ${R} + "]"`:e._`"['" + ${R} + "']"`:D?e._`"/" + ${R}`:e._`"/" + ${R}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(R).toString():"/"+h(R)}a(T,"Hd"),t.getErrorPath=T;function w(R,x,P=R.opts.strictSchema){if(P){if(x=`strict mode: ${x}`,P===!0)throw Error(x);R.self.logger.warn(x)}}a(w,"mj"),t.checkStrictMode=w}),TW=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};t.default=r}),Lwt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;var e=Ns(),r=gc(),n=TW();t.keywordError={message:a(({keyword:E})=>e.str`must pass "${E}" keyword validation`,"message")},t.keyword$DataError={message:a(({keyword:E,schemaType:_})=>_?e.str`"${E}" keyword must be ${_} ($data)`:e.str`"${E}" keyword is invalid ($data)`,"message")};function o(E,_=t.keywordError,v,b){let{it:T}=E,{gen:w,compositeRule:R,allErrors:x}=T,P=h(E,_,v);b??(R||x)?u(w,P):d(T,e._`[${P}]`)}a(o,"bd"),t.reportError=o;function s(E,_=t.keywordError,v){let{it:b}=E,{gen:T,compositeRule:w,allErrors:R}=b,x=h(E,_,v);u(T,x),!(w||R)&&d(b,n.default.vErrors)}a(s,"_d"),t.reportExtraError=s;function c(E,_){E.assign(n.default.errors,_),E.if(e._`${n.default.vErrors} !== null`,()=>E.if(_,()=>E.assign(e._`${n.default.vErrors}.length`,_),()=>E.assign(n.default.vErrors,null)))}a(c,"kd"),t.resetErrorsCount=c;function l({gen:E,keyword:_,schemaValue:v,data:b,errsCount:T,it:w}){if(T===void 0)throw Error("ajv implementation error");let R=E.name("err");E.forRange("i",T,n.default.errors,x=>{E.const(R,e._`${n.default.vErrors}[${x}]`),E.if(e._`${R}.instancePath === undefined`,()=>E.assign(e._`${R}.instancePath`,(0,e.strConcat)(n.default.instancePath,w.errorPath))),E.assign(e._`${R}.schemaPath`,e.str`${w.errSchemaPath}/${_}`),w.opts.verbose&&(E.assign(e._`${R}.schema`,v),E.assign(e._`${R}.data`,b))})}a(l,"Sd"),t.extendErrors=l;function u(E,_){let v=E.const("err",_);E.if(e._`${n.default.vErrors} === null`,()=>E.assign(n.default.vErrors,e._`[${v}]`),e._`${n.default.vErrors}.push(${v})`),E.code(e._`${n.default.errors}++`)}a(u,"dj");function d(E,_){let{gen:v,validateName:b,schemaEnv:T}=E;T.$async?v.throw(e._`new ${E.ValidationError}(${_})`):(v.assign(e._`${b}.errors`,_),v.return(!1))}a(d,"ij");var f={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function h(E,_,v){let{createErrors:b}=E.it;return b===!1?e._`{}`:m(E,_,v)}a(h,"nj");function m(E,_,v={}){let{gen:b,it:T}=E,w=[g(T,v),A(E,v)];return y(E,_,w),b.object(...w)}a(m,"vd");function g({errorPath:E},{instancePath:_}){let v=_?e.str`${E}${(0,r.getErrorPath)(_,r.Type.Str)}`:E;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,v)]}a(g,"Cd");function A({keyword:E,it:{errSchemaPath:_}},{schemaPath:v,parentSchema:b}){let T=b?_:e.str`${_}/${E}`;return v&&(T=e.str`${T}${(0,r.getErrorPath)(v,r.Type.Str)}`),[f.schemaPath,T]}a(A,"Td");function y(E,{params:_,message:v},b){let{keyword:T,data:w,schemaValue:R,it:x}=E,{opts:P,propertyName:D,topSchemaRef:N,schemaPath:L}=x;b.push([f.keyword,T],[f.params,typeof _=="function"?_(E):_||e._`{}`]),P.messages&&b.push([f.message,typeof v=="function"?v(E):v]),P.verbose&&b.push([f.schema,R],[f.parentSchema,e._`${N}${L}`],[n.default.data,w]),D&&b.push([f.propertyName,D])}a(y,"xd")}),g7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;var e=Lwt(),r=Ns(),n=TW(),o={message:"boolean schema is false"};function s(u){let{gen:d,schema:f,validateName:h}=u;f===!1?l(u,!1):typeof f=="object"&&f.$async===!0?d.return(n.default.data):(d.assign(r._`${h}.errors`,null),d.return(!0))}a(s,"pd"),t.topBoolOrEmptySchema=s;function c(u,d){let{gen:f,schema:h}=u;h===!1?(f.var(d,!1),l(u)):f.var(d,!0)}a(c,"dd"),t.boolOrEmptySchema=c;function l(u,d){let{gen:f,data:h}=u,m={gen:f,keyword:"false schema",data:h,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,e.reportError)(m,o,void 0,d)}a(l,"tj")}),YXi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;var e=["string","number","integer","boolean","null","object","array"],r=new Set(e);function n(s){return typeof s=="string"&&r.has(s)}a(n,"od"),t.isJSONType=n;function o(){let s={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...s,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},s.number,s.string,s.array,s.object],post:{rules:[]},all:{},keywords:{}}}a(o,"td"),t.getRules=o}),KXi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0;function e({schema:o,self:s},c){let l=s.RULES.types[c];return l&&l!==!0&&r(o,l)}a(e,"sd"),t.schemaHasRulesForType=e;function r(o,s){return s.rules.some(c=>n(o,c))}a(r,"JA"),t.shouldUseGroup=r;function n(o,s){var c;return o[s.keyword]!==void 0||((c=s.definition.implements)===null||c===void 0?void 0:c.some(l=>o[l]!==void 0))}a(n,"XA"),t.shouldUseRule=n}),mxt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;var e=YXi(),r=KXi(),n=Lwt(),o=Ns(),s=gc(),c;(function(b){b[b.Correct=0]="Correct",b[b.Wrong=1]="Wrong"})(c||(t.DataType=c={}));function l(b){let T=u(b.type);if(T.includes("null")){if(b.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!T.length&&b.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');b.nullable===!0&&T.push("null")}return T}a(l,"Yi"),t.getSchemaTypes=l;function u(b){let T=Array.isArray(b)?b:b?[b]:[];if(T.every(e.isJSONType))return T;throw Error("type must be JSONType or JSONType[]: "+T.join(","))}a(u,"UA"),t.getJSONTypes=u;function d(b,T){let{gen:w,data:R,opts:x}=b,P=h(T,x.coerceTypes),D=T.length>0&&!(P.length===0&&T.length===1&&(0,r.schemaHasRulesForType)(b,T[0]));if(D){let N=y(T,R,x.strictNumbers,c.Wrong);w.if(N,()=>{P.length?m(b,T,P):_(b)})}return D}a(d,"Wi"),t.coerceAndCheckDataType=d;var f=new Set(["string","number","integer","boolean","null"]);function h(b,T){return T?b.filter(w=>f.has(w)||T==="array"&&w==="array"):[]}a(h,"Gi");function m(b,T,w){let{gen:R,data:x,opts:P}=b,D=R.let("dataType",o._`typeof ${x}`),N=R.let("coerced",o._`undefined`);P.coerceTypes==="array"&&R.if(o._`${D} == 'object' && Array.isArray(${x}) && ${x}.length == 1`,()=>R.assign(x,o._`${x}[0]`).assign(D,o._`typeof ${x}`).if(y(T,x,P.strictNumbers),()=>R.assign(N,x))),R.if(o._`${N} !== undefined`);for(let B of w)(f.has(B)||B==="array"&&P.coerceTypes==="array")&&L(B);R.else(),_(b),R.endIf(),R.if(o._`${N} !== undefined`,()=>{R.assign(x,N),g(b,N)});function L(B){switch(B){case"string":R.elseIf(o._`${D} == "number" || ${D} == "boolean"`).assign(N,o._`"" + ${x}`).elseIf(o._`${x} === null`).assign(N,o._`""`);return;case"number":R.elseIf(o._`${D} == "boolean" || ${x} === null || (${D} == "string" && ${x} && ${x} == +${x})`).assign(N,o._`+${x}`);return;case"integer":R.elseIf(o._`${D} === "boolean" || ${x} === null || (${D} === "string" && ${x} && ${x} == +${x} && !(${x} % 1))`).assign(N,o._`+${x}`);return;case"boolean":R.elseIf(o._`${x} === "false" || ${x} === 0 || ${x} === null`).assign(N,!1).elseIf(o._`${x} === "true" || ${x} === 1`).assign(N,!0);return;case"null":R.elseIf(o._`${x} === "" || ${x} === 0 || ${x} === false`),R.assign(N,null);return;case"array":R.elseIf(o._`${D} === "string" || ${D} === "number" - || ${D} === "boolean" || ${x} === null`).assign(N,o._`[${x}]`)}}a(L,"H")}a(m,"Ui");function g({gen:b,parentData:T,parentDataProperty:w},R){b.if(o._`${T} !== undefined`,()=>b.assign(o._`${T}[${w}]`,R))}a(g,"Hi");function A(b,T,w,R=c.Correct){let x=R===c.Correct?o.operators.EQ:o.operators.NEQ,P;switch(b){case"null":return o._`${T} ${x} null`;case"array":P=o._`Array.isArray(${T})`;break;case"object":P=o._`${T} && typeof ${T} == "object" && !Array.isArray(${T})`;break;case"integer":P=D(o._`!(${T} % 1) && !isNaN(${T})`);break;case"number":P=D();break;default:return o._`typeof ${T} ${x} ${b}`}return R===c.Correct?P:(0,o.not)(P);function D(N=o.nil){return(0,o.and)(o._`typeof ${T} == "number"`,N,w?o._`isFinite(${T})`:o.nil)}}a(A,"LB"),t.checkDataType=A;function y(b,T,w,R){if(b.length===1)return A(b[0],T,w,R);let x,P=(0,s.toHash)(b);if(P.array&&P.object){let D=o._`typeof ${T} != "object"`;x=P.null?D:o._`!${T} || ${D}`,delete P.null,delete P.array,delete P.object}else x=o.nil;P.number&&delete P.integer;for(let D in P)x=(0,o.and)(x,A(D,T,w,R));return x}a(y,"jB"),t.checkDataTypes=y;var E={message:a(({schema:b})=>`must be ${b}`,"message"),params:a(({schema:b,schemaValue:T})=>typeof b=="string"?o._`{type: ${b}}`:o._`{type: ${T}}`,"params")};function _(b){let T=v(b);(0,n.reportError)(T,E)}a(_,"AB"),t.reportTypeError=_;function v(b){let{gen:T,data:w,schema:R}=b,x=(0,s.schemaRefOrVal)(b,R,"type");return{gen:T,keyword:"type",data:w,schema:R.type,schemaCode:x,schemaValue:x,parentSchema:R,params:{},it:b}}a(v,"qi")}),I6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;var e=Ns(),r=mc();function n(s,c){let{properties:l,items:u}=s.schema;if(c==="object"&&l)for(let d in l)o(s,d,l[d].default);else c==="array"&&Array.isArray(u)&&u.forEach((d,f)=>o(s,f,d.default))}a(n,"Fi"),t.assignDefaults=n;function o(s,c,l){let{gen:u,compositeRule:d,data:f,opts:h}=s;if(l===void 0)return;let m=e._`${f}${(0,e.getProperty)(c)}`;if(d){(0,r.checkStrictMode)(s,`default is ignored for: ${m}`);return}let g=e._`${m} === undefined`;h.useDefaults==="empty"&&(g=e._`${g} || ${m} === null || ${m} === ""`),u.if(g,e._`${m} = ${(0,e.stringify)(l)}`)}a(o,"VA")}),HN=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;var e=Ns(),r=mc(),n=pW(),o=mc();function s(b,T){let{gen:w,data:R,it:x}=b;w.if(h(w,R,T,x.opts.ownProperties),()=>{b.setParams({missingProperty:e._`${T}`},!0),b.error()})}a(s,"Mi"),t.checkReportMissingProp=s;function c({gen:b,data:T,it:{opts:w}},R,x){return(0,e.or)(...R.map(P=>(0,e.and)(h(b,T,P,w.ownProperties),e._`${x} = ${P}`)))}a(c,"Li"),t.checkMissingProp=c;function l(b,T){b.setParams({missingProperty:T},!0),b.error()}a(l,"ji"),t.reportMissingProp=l;function u(b){return b.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:e._`Object.prototype.hasOwnProperty`})}a(u,"wA"),t.hasPropFunc=u;function d(b,T,w){return e._`${u(b)}.call(${T}, ${w})`}a(d,"RB"),t.isOwnProperty=d;function f(b,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} !== undefined`;return R?e._`${x} && ${d(b,T,w)}`:x}a(f,"Ai"),t.propertyInData=f;function h(b,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} === undefined`;return R?(0,e.or)(x,(0,e.not)(d(b,T,w))):x}a(h,"PB"),t.noPropertyInData=h;function m(b){return b?Object.keys(b).filter(T=>T!=="__proto__"):[]}a(m,"OA"),t.allSchemaProperties=m;function g(b,T){return m(T).filter(w=>!(0,r.alwaysValidSchema)(b,T[w]))}a(g,"Ii"),t.schemaProperties=g;function A({schemaCode:b,data:T,it:{gen:w,topSchemaRef:R,schemaPath:x,errorPath:P},it:D},N,L,B){let q=B?e._`${b}, ${T}, ${R}${x}`:T,M=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,P)],[n.default.parentData,D.parentData],[n.default.parentDataProperty,D.parentDataProperty],[n.default.rootData,n.default.rootData]];D.opts.dynamicRef&&M.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);let O=e._`${q}, ${w.object(...M)}`;return L!==e.nil?e._`${N}.call(${L}, ${O})`:e._`${N}(${O})`}a(A,"Ri"),t.callValidateCode=A;var y=e._`new RegExp`;function E({gen:b,it:{opts:T}},w){let R=T.unicodeRegExp?"u":"",{regExp:x}=T.code,P=x(w,R);return b.scopeValue("pattern",{key:P.toString(),ref:P,code:e._`${x.code==="new RegExp"?y:(0,o.useFunc)(b,x)}(${w}, ${R})`})}a(E,"Ei"),t.usePattern=E;function _(b){let{gen:T,data:w,keyword:R,it:x}=b,P=T.name("valid");if(x.allErrors){let N=T.let("valid",!0);return D(()=>T.assign(N,!1)),N}return T.var(P,!0),D(()=>T.break()),P;function D(N){let L=T.const("len",e._`${w}.length`);T.forRange("i",0,L,B=>{b.subschema({keyword:R,dataProp:B,dataPropType:r.Type.Num},P),T.if((0,e.not)(P),N)})}}a(_,"bi"),t.validateArray=_;function v(b){let{gen:T,schema:w,keyword:R,it:x}=b;if(!Array.isArray(w))throw Error("ajv implementation error");if(w.some(N=>(0,r.alwaysValidSchema)(x,N))&&!x.opts.unevaluated)return;let P=T.let("valid",!1),D=T.name("_valid");T.block(()=>w.forEach((N,L)=>{let B=b.subschema({keyword:R,schemaProp:L,compositeRule:!0},D);T.assign(P,e._`${P} || ${D}`),!b.mergeValidEvaluated(B,D)&&T.if((0,e.not)(P))})),b.result(P,()=>b.reset(),()=>b.error(!0))}a(v,"_i"),t.validateUnion=v}),x6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;var e=Ns(),r=pW(),n=HN(),o=fwt();function s(g,A){let{gen:y,keyword:E,schema:_,parentSchema:v,it:b}=g,T=A.macro.call(b.self,_,v,b),w=f(y,E,T);b.opts.validateSchema!==!1&&b.self.validateSchema(T,!0);let R=y.name("valid");g.subschema({schema:T,schemaPath:e.nil,errSchemaPath:`${b.errSchemaPath}/${E}`,topSchemaRef:w,compositeRule:!0},R),g.pass(R,()=>g.error(!0))}a(s,"pi"),t.macroKeywordCode=s;function c(g,A){var y;let{gen:E,keyword:_,schema:v,parentSchema:b,$data:T,it:w}=g;d(w,A);let R=!T&&A.compile?A.compile.call(w.self,v,b,w):A.validate,x=f(E,_,R),P=E.let("valid");g.block$data(P,D),g.ok((y=A.valid)!==null&&y!==void 0?y:P);function D(){if(A.errors===!1)B(),A.modifying&&l(g),q(()=>g.error());else{let M=A.async?N():L();A.modifying&&l(g),q(()=>u(g,M))}}a(D,"z");function N(){let M=E.let("ruleErrs",null);return E.try(()=>B(e._`await `),O=>E.assign(P,!1).if(e._`${O} instanceof ${w.ValidationError}`,()=>E.assign(M,e._`${O}.errors`),()=>E.throw(O))),M}a(N,"N");function L(){let M=e._`${x}.errors`;return E.assign(M,null),B(e.nil),M}a(L,"w");function B(M=A.async?e._`await `:e.nil){let O=w.opts.passContext?r.default.this:r.default.self,j=!("compile"in A&&!T||A.schema===!1);E.assign(P,e._`${M}${(0,n.callValidateCode)(g,x,O,j)}`,A.modifying)}a(B,"O");function q(M){var O;E.if((0,e.not)((O=A.valid)!==null&&O!==void 0?O:P),M)}a(q,"D")}a(c,"di"),t.funcKeywordCode=c;function l(g){let{gen:A,data:y,it:E}=g;A.if(E.parentData,()=>A.assign(y,e._`${E.parentData}[${E.parentDataProperty}]`))}a(l,"ZA");function u(g,A){let{gen:y}=g;y.if(e._`Array.isArray(${A})`,()=>{y.assign(r.default.vErrors,e._`${r.default.vErrors} === null ? ${A} : ${r.default.vErrors}.concat(${A})`).assign(r.default.errors,e._`${r.default.vErrors}.length`),(0,o.extendErrors)(g)},()=>g.error())}a(u,"ii");function d({schemaEnv:g},A){if(A.async&&!g.$async)throw Error("async keyword in sync schema")}a(d,"ni");function f(g,A,y){if(y===void 0)throw Error(`keyword "${A}" failed to compile`);return g.scopeValue("keyword",typeof y=="function"?{ref:y}:{ref:y,code:(0,e.stringify)(y)})}a(f,"MA");function h(g,A,y=!1){return!A.length||A.some(E=>E==="array"?Array.isArray(g):E==="object"?g&&typeof g=="object"&&!Array.isArray(g):typeof g==E||y&&typeof g>"u")}a(h,"ri"),t.validSchemaType=h;function m({schema:g,opts:A,self:y,errSchemaPath:E},_,v){if(Array.isArray(_.keyword)?!_.keyword.includes(v):_.keyword!==v)throw Error("ajv implementation error");let b=_.dependencies;if(b?.some(T=>!Object.prototype.hasOwnProperty.call(g,T)))throw Error(`parent schema must have dependencies of ${v}: ${b.join(",")}`);if(_.validateSchema&&!_.validateSchema(g[v])){let T=`keyword "${v}" value is invalid at path "${E}": `+y.errorsText(_.validateSchema.errors);if(A.validateSchema==="log")y.logger.error(T);else throw Error(T)}}a(m,"oi"),t.validateKeywordUsage=m}),w6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;var e=Ns(),r=mc();function n(c,{keyword:l,schemaProp:u,schema:d,schemaPath:f,errSchemaPath:h,topSchemaRef:m}){if(l!==void 0&&d!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(l!==void 0){let g=c.schema[l];return u===void 0?{schema:g,schemaPath:e._`${c.schemaPath}${(0,e.getProperty)(l)}`,errSchemaPath:`${c.errSchemaPath}/${l}`}:{schema:g[u],schemaPath:e._`${c.schemaPath}${(0,e.getProperty)(l)}${(0,e.getProperty)(u)}`,errSchemaPath:`${c.errSchemaPath}/${l}/${(0,r.escapeFragment)(u)}`}}if(d!==void 0){if(f===void 0||h===void 0||m===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:d,schemaPath:f,topSchemaRef:m,errSchemaPath:h}}throw Error('either "keyword" or "schema" must be passed')}a(n,"ei"),t.getSubschema=n;function o(c,l,{dataProp:u,dataPropType:d,data:f,dataTypes:h,propertyName:m}){if(f!==void 0&&u!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:g}=l;if(u!==void 0){let{errorPath:y,dataPathArr:E,opts:_}=l,v=g.let("data",e._`${l.data}${(0,e.getProperty)(u)}`,!0);A(v),c.errorPath=e.str`${y}${(0,r.getErrorPath)(u,d,_.jsPropertySyntax)}`,c.parentDataProperty=e._`${u}`,c.dataPathArr=[...E,c.parentDataProperty]}if(f!==void 0){let y=f instanceof e.Name?f:g.let("data",f,!0);A(y),m!==void 0&&(c.propertyName=m)}h&&(c.dataTypes=h);function A(y){c.data=y,c.dataLevel=l.dataLevel+1,c.dataTypes=[],l.definedProperties=new Set,c.parentData=l.data,c.dataNames=[...l.dataNames,y]}a(A,"H")}a(o,"$n"),t.extendSubschemaData=o;function s(c,{jtdDiscriminator:l,jtdMetadata:u,compositeRule:d,createErrors:f,allErrors:h}){d!==void 0&&(c.compositeRule=d),f!==void 0&&(c.createErrors=f),h!==void 0&&(c.allErrors=h),c.jtdDiscriminator=l,c.jtdMetadata=u}a(s,"Qn"),t.extendSubschemaMode=s}),ZJi=Ht((t,e)=>{e.exports=a(function r(n,o){if(n===o)return!0;if(n&&o&&typeof n=="object"&&typeof o=="object"){if(n.constructor!==o.constructor)return!1;var s,c,l;if(Array.isArray(n)){if(s=n.length,s!=o.length)return!1;for(c=s;c--!==0;)if(!r(n[c],o[c]))return!1;return!0}if(n.constructor===RegExp)return n.source===o.source&&n.flags===o.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===o.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===o.toString();if(l=Object.keys(n),s=l.length,s!==Object.keys(o).length)return!1;for(c=s;c--!==0;)if(!Object.prototype.hasOwnProperty.call(o,l[c]))return!1;for(c=s;c--!==0;){var u=l[c];if(!r(n[u],o[u]))return!1}return!0}return n!==n&&o!==o},"$")}),R6c=Ht((t,e)=>{var r=e.exports=function(s,c,l){typeof c=="function"&&(l=c,c={}),l=c.cb||l;var u=typeof l=="function"?l:l.pre||function(){},d=l.post||function(){};n(c,u,d,s,"",s)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function n(s,c,l,u,d,f,h,m,g,A){if(u&&typeof u=="object"&&!Array.isArray(u)){c(u,d,f,h,m,g,A);for(var y in u){var E=u[y];if(Array.isArray(E)){if(y in r.arrayKeywords)for(var _=0;_{Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;var e=mc(),r=ZJi(),n=R6c(),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(E,_=!0){return typeof E=="boolean"?!0:_===!0?!l(E):_?u(E)<=_:!1}a(s,"Kn"),t.inlineRef=s;var c=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(E){for(let _ in E){if(c.has(_))return!0;let v=E[_];if(Array.isArray(v)&&v.some(l)||typeof v=="object"&&l(v))return!0}return!1}a(l,"bB");function u(E){let _=0;for(let v in E){if(v==="$ref")return 1/0;if(_++,!o.has(v)&&(typeof E[v]=="object"&&(0,e.eachItem)(E[v],b=>_+=u(b)),_===1/0))return 1/0}return _}a(u,"SA");function d(E,_="",v){v!==!1&&(_=m(_));let b=E.parse(_);return f(E,b)}a(d,"vA"),t.getFullPath=d;function f(E,_){return E.serialize(_).split("#")[0]+"#"}a(f,"CA"),t._getFullPath=f;var h=/#\/?$/;function m(E){return E?E.replace(h,""):""}a(m,"N9"),t.normalizeId=m;function g(E,_,v){return v=m(v),E.resolve(_,v)}a(g,"Bn"),t.resolveUrl=g;var A=/^[a-z_][-a-z0-9._]*$/i;function y(E,_){if(typeof E=="boolean")return{};let{schemaId:v,uriResolver:b}=this.opts,T=m(E[v]||_),w={"":T},R=d(b,T,!1),x={},P=new Set;return n(E,{allKeys:!0},(L,B,q,M)=>{if(M===void 0)return;let O=R+B,j=w[M];typeof L[v]=="string"&&(j=Q.call(this,L[v])),U.call(this,L.$anchor),U.call(this,L.$dynamicAnchor),w[B]=j;function Q(Y){let W=this.opts.uriResolver.resolve;if(Y=m(j?W(j,Y):Y),P.has(Y))throw N(Y);P.add(Y);let V=this.refs[Y];return typeof V=="string"&&(V=this.refs[V]),typeof V=="object"?D(L,V.schema,Y):Y!==m(O)&&(Y[0]==="#"?(D(L,x[Y],Y),x[Y]=L):this.refs[Y]=O),Y}a(Q,"M");function U(Y){if(typeof Y=="string"){if(!A.test(Y))throw Error(`invalid anchor "${Y}"`);Q.call(this,`#${Y}`)}}a(U,"j")}),x;function D(L,B,q){if(B!==void 0&&!r(L,B))throw N(q)}function N(L){return Error(`reference "${L}" resolves to more than one schema`)}}a(y,"Nn"),t.getSchemaRefs=y}),hwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;var e=T6c(),r=$It(),n=JJi(),o=$It(),s=I6c(),c=x6c(),l=w6c(),u=Ns(),d=pW(),f=pwt(),h=mc(),m=fwt();function g(ee){if(R(ee)&&(P(ee),w(ee))){_(ee);return}A(ee,()=>(0,e.topBoolOrEmptySchema)(ee))}a(g,"jn"),t.validateFunctionCode=g;function A({gen:ee,validateName:K,schema:he,schemaEnv:Z,opts:ue},qe){ue.code.es5?ee.func(K,u._`${d.default.data}, ${d.default.valCxt}`,Z.$async,()=>{ee.code(u._`"use strict"; ${b(he,ue)}`),E(ee,ue),ee.code(qe)}):ee.func(K,u._`${d.default.data}, ${y(ue)}`,Z.$async,()=>ee.code(b(he,ue)).code(qe))}a(A,"mA");function y(ee){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${ee.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}a(y,"An");function E(ee,K){ee.if(d.default.valCxt,()=>{ee.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),ee.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),ee.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),ee.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),K.dynamicRef&&ee.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{ee.var(d.default.instancePath,u._`""`),ee.var(d.default.parentData,u._`undefined`),ee.var(d.default.parentDataProperty,u._`undefined`),ee.var(d.default.rootData,d.default.data),K.dynamicRef&&ee.var(d.default.dynamicAnchors,u._`{}`)})}a(E,"In");function _(ee){let{schema:K,opts:he,gen:Z}=ee;A(ee,()=>{he.$comment&&K.$comment&&M(ee),L(ee),Z.let(d.default.vErrors,null),Z.let(d.default.errors,0),he.unevaluated&&v(ee),D(ee),O(ee)})}a(_,"Rn");function v(ee){let{gen:K,validateName:he}=ee;ee.evaluated=K.const("evaluated",u._`${he}.evaluated`),K.if(u._`${ee.evaluated}.dynamicProps`,()=>K.assign(u._`${ee.evaluated}.props`,u._`undefined`)),K.if(u._`${ee.evaluated}.dynamicItems`,()=>K.assign(u._`${ee.evaluated}.items`,u._`undefined`))}a(v,"Pn");function b(ee,K){let he=typeof ee=="object"&&ee[K.schemaId];return he&&(K.code.source||K.code.process)?u._`/*# sourceURL=${he} */`:u.nil}a(b,"fA");function T(ee,K){if(R(ee)&&(P(ee),w(ee))){x(ee,K);return}(0,e.boolOrEmptySchema)(ee,K)}a(T,"En");function w({schema:ee,self:K}){if(typeof ee=="boolean")return!ee;for(let he in ee)if(K.RULES.all[he])return!0;return!1}a(w,"lA");function R(ee){return typeof ee.schema!="boolean"}a(R,"cA");function x(ee,K){let{schema:he,gen:Z,opts:ue}=ee;ue.$comment&&he.$comment&&M(ee),B(ee),q(ee);let qe=Z.const("_errs",d.default.errors);D(ee,qe),Z.var(K,u._`${qe} === ${d.default.errors}`)}a(x,"bn");function P(ee){(0,h.checkUnknownRules)(ee),N(ee)}a(P,"pA");function D(ee,K){if(ee.opts.jtd)return Q(ee,[],!1,K);let he=(0,r.getSchemaTypes)(ee.schema),Z=(0,r.coerceAndCheckDataType)(ee,he);Q(ee,he,!Z,K)}a(D,"dA");function N(ee){let{schema:K,errSchemaPath:he,opts:Z,self:ue}=ee;K.$ref&&Z.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(K,ue.RULES)&&ue.logger.warn(`$ref: keywords ignored in schema at path "${he}"`)}a(N,"_n");function L(ee){let{schema:K,opts:he}=ee;K.default!==void 0&&he.useDefaults&&he.strictSchema&&(0,h.checkStrictMode)(ee,"default is ignored in the schema root")}a(L,"kn");function B(ee){let K=ee.schema[ee.opts.schemaId];K&&(ee.baseId=(0,f.resolveUrl)(ee.opts.uriResolver,ee.baseId,K))}a(B,"Sn");function q(ee){if(ee.schema.$async&&!ee.schemaEnv.$async)throw Error("async schema in sync schema")}a(q,"vn");function M({gen:ee,schemaEnv:K,schema:he,errSchemaPath:Z,opts:ue}){let qe=he.$comment;if(ue.$comment===!0)ee.code(u._`${d.default.self}.logger.log(${qe})`);else if(typeof ue.$comment=="function"){let ne=u.str`${Z}/$comment`,ce=ee.scopeValue("root",{ref:K.root});ee.code(u._`${d.default.self}.opts.$comment(${qe}, ${ne}, ${ce}.schema)`)}}a(M,"iA");function O(ee){let{gen:K,schemaEnv:he,validateName:Z,ValidationError:ue,opts:qe}=ee;he.$async?K.if(u._`${d.default.errors} === 0`,()=>K.return(d.default.data),()=>K.throw(u._`new ${ue}(${d.default.vErrors})`)):(K.assign(u._`${Z}.errors`,d.default.vErrors),qe.unevaluated&&j(ee),K.return(u._`${d.default.errors} === 0`))}a(O,"Cn");function j({gen:ee,evaluated:K,props:he,items:Z}){he instanceof u.Name&&ee.assign(u._`${K}.props`,he),Z instanceof u.Name&&ee.assign(u._`${K}.items`,Z)}a(j,"Tn");function Q(ee,K,he,Z){let{gen:ue,schema:qe,data:ne,allErrors:ce,opts:Ne,self:we}=ee,{RULES:Be}=we;if(qe.$ref&&(Ne.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(qe,Be))){ue.block(()=>ge(ee,"$ref",Be.all.$ref.definition));return}Ne.jtd||Y(ee,K),ue.block(()=>{for(let st of Be.rules)rt(st);rt(Be.post)});function rt(st){(0,n.shouldUseGroup)(qe,st)&&(st.type?(ue.if((0,o.checkDataType)(st.type,ne,Ne.strictNumbers)),U(ee,st),K.length===1&&K[0]===st.type&&he&&(ue.else(),(0,o.reportTypeError)(ee)),ue.endIf()):U(ee,st),ce||ue.if(u._`${d.default.errors} === ${Z||0}`))}a(rt,"B")}a(Q,"gA");function U(ee,K){let{gen:he,schema:Z,opts:{useDefaults:ue}}=ee;ue&&(0,s.assignDefaults)(ee,K.type),he.block(()=>{for(let qe of K.rules)(0,n.shouldUseRule)(Z,qe)&&ge(ee,qe.keyword,qe.definition,K.type)})}a(U,"hA");function Y(ee,K){ee.schemaEnv.meta||!ee.opts.strictTypes||(W(ee,K),!ee.opts.allowUnionTypes&&V(ee,K),z(ee,ee.dataTypes))}a(Y,"xn");function W(ee,K){if(K.length){if(!ee.dataTypes.length){ee.dataTypes=K;return}K.forEach(he=>{H(ee.dataTypes,he)||le(ee,`type "${he}" not allowed by context "${ee.dataTypes.join(",")}"`)}),re(ee,K)}}a(W,"yn");function V(ee,K){K.length>1&&!(K.length===2&&K.includes("null"))&&le(ee,"use allowUnionTypes to allow union type keyword")}a(V,"fn");function z(ee,K){let he=ee.self.RULES.all;for(let Z in he){let ue=he[Z];if(typeof ue=="object"&&(0,n.shouldUseRule)(ee.schema,ue)){let{type:qe}=ue.definition;qe.length&&!qe.some(ne=>ie(K,ne))&&le(ee,`missing type "${qe.join(",")}" for keyword "${Z}"`)}}}a(z,"gn");function ie(ee,K){return ee.includes(K)||K==="number"&&ee.includes("integer")}a(ie,"hn");function H(ee,K){return ee.includes(K)||K==="integer"&&ee.includes("number")}a(H,"nA");function re(ee,K){let he=[];for(let Z of ee.dataTypes)H(K,Z)?he.push(Z):K.includes("integer")&&Z==="number"&&he.push("integer");ee.dataTypes=he}a(re,"un");function le(ee,K){let he=ee.schemaEnv.baseId+ee.errSchemaPath;K+=` at "${he}" (strictTypes)`,(0,h.checkStrictMode)(ee,K,ee.opts.strictTypes)}a(le,"SB");class Le{static{a(this,"vB")}constructor(K,he,Z){if((0,c.validateKeywordUsage)(K,he,Z),this.gen=K.gen,this.allErrors=K.allErrors,this.keyword=Z,this.data=K.data,this.schema=K.schema[Z],this.$data=he.$data&&K.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(K,this.schema,Z,this.$data),this.schemaType=he.schemaType,this.parentSchema=K.schema,this.params={},this.it=K,this.def=he,this.$data)this.schemaCode=K.gen.const("vSchema",X(this.$data,K));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,he.schemaType,he.allowUndefined))throw Error(`${Z} value must be ${JSON.stringify(he.schemaType)}`);("code"in he?he.trackErrors:he.errors!==!1)&&(this.errsCount=K.gen.const("_errs",d.default.errors))}result(K,he,Z){this.failResult((0,u.not)(K),he,Z)}failResult(K,he,Z){this.gen.if(K),Z?Z():this.error(),he?(this.gen.else(),he(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(K,he){this.failResult((0,u.not)(K),void 0,he)}fail(K){if(K===void 0){this.error(),!this.allErrors&&this.gen.if(!1);return}this.gen.if(K),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(K){if(!this.$data)return this.fail(K);let{schemaCode:he}=this;this.fail(u._`${he} !== undefined && (${(0,u.or)(this.invalid$data(),K)})`)}error(K,he,Z){if(he){this.setParams(he),this._error(K,Z),this.setParams({});return}this._error(K,Z)}_error(K,he){(K?m.reportExtraError:m.reportError)(this,this.def.error,he)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(K){this.allErrors||this.gen.if(K)}setParams(K,he){he?Object.assign(this.params,K):this.params=K}block$data(K,he,Z=u.nil){this.gen.block(()=>{this.check$data(K,Z),he()})}check$data(K=u.nil,he=u.nil){if(!this.$data)return;let{gen:Z,schemaCode:ue,schemaType:qe,def:ne}=this;Z.if((0,u.or)(u._`${ue} === undefined`,he)),K!==u.nil&&Z.assign(K,!0),(qe.length||ne.validateSchema)&&(Z.elseIf(this.invalid$data()),this.$dataError(),K!==u.nil&&Z.assign(K,!1)),Z.else()}invalid$data(){let{gen:K,schemaCode:he,schemaType:Z,def:ue,it:qe}=this;return(0,u.or)(ne(),ce());function ne(){if(Z.length){if(!(he instanceof u.Name))throw Error("ajv implementation error");let Ne=Array.isArray(Z)?Z:[Z];return u._`${(0,o.checkDataTypes)(Ne,he,qe.opts.strictNumbers,o.DataType.Wrong)}`}return u.nil}function ce(){if(ue.validateSchema){let Ne=K.scopeValue("validate$data",{ref:ue.validateSchema});return u._`!${Ne}(${he})`}return u.nil}}subschema(K,he){let Z=(0,l.getSubschema)(this.it,K);(0,l.extendSubschemaData)(Z,this.it,K),(0,l.extendSubschemaMode)(Z,K);let ue={...this.it,...Z,items:void 0,props:void 0};return T(ue,he),ue}mergeEvaluated(K,he){let{it:Z,gen:ue}=this;Z.opts.unevaluated&&(Z.props!==!0&&K.props!==void 0&&(Z.props=h.mergeEvaluated.props(ue,K.props,Z.props,he)),Z.items!==!0&&K.items!==void 0&&(Z.items=h.mergeEvaluated.items(ue,K.items,Z.items,he)))}mergeValidEvaluated(K,he){let{it:Z,gen:ue}=this;if(Z.opts.unevaluated&&(Z.props!==!0||Z.items!==!0))return ue.if(he,()=>this.mergeEvaluated(K,u.Name)),!0}}t.KeywordCxt=Le;function ge(ee,K,he,Z){let ue=new Le(ee,he,K);"code"in he?he.code(ue,Z):ue.$data&&he.validate?(0,c.funcKeywordCode)(ue,he):"macro"in he?(0,c.macroKeywordCode)(ue,he):(he.compile||he.validate)&&(0,c.funcKeywordCode)(ue,he)}a(ge,"rA");var Ue=/^\/(?:[^~]|~0|~1)*$/,ke=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function X(ee,{dataLevel:K,dataNames:he,dataPathArr:Z}){let ue,qe;if(ee==="")return d.default.rootData;if(ee[0]==="/"){if(!Ue.test(ee))throw Error(`Invalid JSON-pointer: ${ee}`);ue=ee,qe=d.default.rootData}else{let we=ke.exec(ee);if(!we)throw Error(`Invalid JSON-pointer: ${ee}`);let Be=+we[1];if(ue=we[2],ue==="#"){if(Be>=K)throw Error(Ne("property/index",Be));return Z[K-Be]}if(Be>K)throw Error(Ne("data",Be));if(qe=he[K-Be],!ue)return qe}let ne=qe,ce=ue.split("/");for(let we of ce)we&&(qe=u._`${qe}${(0,u.getProperty)((0,h.unescapeJsonPointer)(we))}`,ne=u._`${ne} && ${qe}`);return ne;function Ne(we,Be){return`Cannot access ${we} ${Be} levels up, current level is ${K}`}}a(X,"oA"),t.getData=X}),C6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});class e extends Error{static{a(this,"sA")}constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}t.default=e}),mwt=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pwt();class r extends Error{static{a(this,"$I")}constructor(o,s,c,l){super(l||`can't resolve reference ${c} from id ${s}`),this.missingRef=(0,e.resolveUrl)(o,s,c),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(o,this.missingRef))}}t.default=r}),b6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;var e=Ns(),r=C6r(),n=pW(),o=pwt(),s=mc(),c=hwt();class l{static{a(this,"CJ")}constructor(v){var b;this.refs={},this.dynamicAnchors={};let T;typeof v.schema=="object"&&(T=v.schema),this.schema=v.schema,this.schemaId=v.schemaId,this.root=v.root||this,this.baseId=(b=v.baseId)!==null&&b!==void 0?b:(0,o.normalizeId)(T?.[v.schemaId||"$id"]),this.schemaPath=v.schemaPath,this.localRefs=v.localRefs,this.meta=v.meta,this.$async=T?.$async,this.refs={}}}t.SchemaEnv=l;function u(_){let v=h.call(this,_);if(v)return v;let b=(0,o.getFullPath)(this.opts.uriResolver,_.root.baseId),{es5:T,lines:w}=this.opts.code,{ownProperties:R}=this.opts,x=new e.CodeGen(this.scope,{es5:T,lines:w,ownProperties:R}),P;_.$async&&(P=x.scopeValue("Error",{ref:r.default,code:e._`require("ajv/dist/runtime/validation_error").default`}));let D=x.scopeName("validate");_.validateName=D;let N={gen:x,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:x.scopeValue("schema",this.opts.code.source===!0?{ref:_.schema,code:(0,e.stringify)(_.schema)}:{ref:_.schema}),validateName:D,ValidationError:P,schema:_.schema,schemaEnv:_,rootId:b,baseId:_.baseId||b,schemaPath:e.nil,errSchemaPath:_.schemaPath||(this.opts.jtd?"":"#"),errorPath:e._`""`,opts:this.opts,self:this},L;try{this._compilations.add(_),(0,c.validateFunctionCode)(N),x.optimize(this.opts.code.optimize);let B=x.toString();L=`${x.scopeRefs(n.default.scope)}return ${B}`,this.opts.code.process&&(L=this.opts.code.process(L,_));let q=Function(`${n.default.self}`,`${n.default.scope}`,L)(this,this.scope.get());if(this.scope.value(D,{ref:q}),q.errors=null,q.schema=_.schema,q.schemaEnv=_,_.$async&&(q.$async=!0),this.opts.code.source===!0&&(q.source={validateName:D,validateCode:B,scopeValues:x._values}),this.opts.unevaluated){let{props:M,items:O}=N;q.evaluated={props:M instanceof e.Name?void 0:M,items:O instanceof e.Name?void 0:O,dynamicProps:M instanceof e.Name,dynamicItems:O instanceof e.Name},q.source&&(q.source.evaluated=(0,e.stringify)(q.evaluated))}return _.validate=q,_}catch(B){throw delete _.validate,delete _.validateName,L&&this.logger.error("Error compiling schema, function code:",L),B}finally{this._compilations.delete(_)}}a(u,"xB"),t.compileSchema=u;function d(_,v,b){var T;b=(0,o.resolveUrl)(this.opts.uriResolver,v,b);let w=_.refs[b];if(w)return w;let R=g.call(this,_,b);if(R===void 0){let x=(T=_.localRefs)===null||T===void 0?void 0:T[b],{schemaId:P}=this.opts;x&&(R=new l({schema:x,schemaId:P,root:_,baseId:v}))}if(R!==void 0)return _.refs[b]=f.call(this,R)}a(d,"tn"),t.resolveRef=d;function f(_){return(0,o.inlineRef)(_.schema,this.opts.inlineRefs)?_.schema:_.validate?_:u.call(this,_)}a(f,"an");function h(_){for(let v of this._compilations)if(m(v,_))return v}a(h,"XI"),t.getCompilingSchema=h;function m(_,v){return _.schema===v.schema&&_.root===v.root&&_.baseId===v.baseId}a(m,"sn");function g(_,v){let b;for(;typeof(b=this.refs[v])=="string";)v=b;return b||this.schemas[v]||A.call(this,_,v)}a(g,"en");function A(_,v){let b=this.opts.uriResolver.parse(v),T=(0,o._getFullPath)(this.opts.uriResolver,b),w=(0,o.getFullPath)(this.opts.uriResolver,_.baseId,void 0);if(Object.keys(_.schema).length>0&&T===w)return E.call(this,b,_);let R=(0,o.normalizeId)(T),x=this.refs[R]||this.schemas[R];if(typeof x=="string"){let P=A.call(this,_,x);return typeof P?.schema!="object"?void 0:E.call(this,b,P)}if(typeof x?.schema=="object"){if(x.validate||u.call(this,x),R===(0,o.normalizeId)(v)){let{schema:P}=x,{schemaId:D}=this.opts,N=P[D];return N&&(w=(0,o.resolveUrl)(this.opts.uriResolver,w,N)),new l({schema:P,schemaId:D,root:_,baseId:w})}return E.call(this,b,x)}}a(A,"EW"),t.resolveSchema=A;var y=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function E(_,{baseId:v,schema:b,root:T}){var w;if(((w=_.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(let P of _.fragment.slice(1).split("/")){if(typeof b=="boolean")return;let D=b[(0,s.unescapeFragment)(P)];if(D===void 0)return;b=D;let N=typeof b=="object"&&b[this.opts.schemaId];!y.has(P)&&N&&(v=(0,o.resolveUrl)(this.opts.uriResolver,v,N))}let R;if(typeof b!="boolean"&&b.$ref&&!(0,s.schemaHasRulesButRef)(b,this.RULES)){let P=(0,o.resolveUrl)(this.opts.uriResolver,v,b.$ref);R=A.call(this,T,P)}let{schemaId:x}=this.opts;if(R=R||new l({schema:b,schemaId:x,root:T,baseId:v}),R.schema!==R.root.schema)return R}a(E,"TB")}),k6c=Ht((t,e)=>{e.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),XJi=Ht((t,e)=>{var r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),n=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),o=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),s=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),c=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function l(x){let P="",D=0,N=0;for(N=0;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";P+=x[N];break}for(N+=1;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";P+=x[N]}return P}a(l,"fB");var u=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function d(x){return x.length=0,!0}a(d,"UI");function f(x,P,D){if(x.length){let N=l(x);if(N!=="")P.push(N);else return D.error=!0,!1;x.length=0}return!0}a(f,"Kr");function h(x){let P=0,D={error:!1,address:"",zone:""},N=[],L=[],B=!1,q=!1,M=f;for(let O=0;O7){D.error=!0;break}O>0&&x[O-1]===":"&&(B=!0),N.push(":");continue}else if(j==="%"){if(!M(L,N,D))break;M=d}else{L.push(j);continue}}return L.length&&(M===d?D.zone=L.join(""):q?N.push(L.join("")):N.push(l(L))),D.address=N.join(""),D}a(h,"qr");function m(x){if(g(x,":")<2)return{host:x,isIPV6:!1};let P=h(x);if(P.error)return{host:x,isIPV6:!1};{let{address:D,address:N}=P;return P.zone&&(D+="%"+P.zone,N+="%25"+P.zone),{host:D,isIPV6:!0,escapedHost:N}}}a(m,"qI");function g(x,P){let D=0;for(let N=0;Ny[N])}a(v,"VI");function b(x,P=!1){if(x.indexOf("%")===-1)return x;let D="";for(let N=0;N{var{isUUID:r}=XJi(),n=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,o=["http","https","ws","wss","urn","urn:uuid"];function s(x){return o.indexOf(x)!==-1}a(s,"Ar");function c(x){return x.secure===!0?!0:x.secure===!1?!1:x.scheme?x.scheme.length===3&&(x.scheme[0]==="w"||x.scheme[0]==="W")&&(x.scheme[1]==="s"||x.scheme[1]==="S")&&(x.scheme[2]==="s"||x.scheme[2]==="S"):!1}a(c,"hB");function l(x){return x.host||(x.error=x.error||"HTTP URIs must have a host."),x}a(l,"zI");function u(x){let P=String(x.scheme).toLowerCase()==="https";return(x.port===(P?443:80)||x.port==="")&&(x.port=void 0),x.path||(x.path="/"),x}a(u,"NI");function d(x){return x.secure=c(x),x.resourceName=(x.path||"/")+(x.query?"?"+x.query:""),x.path=void 0,x.query=void 0,x}a(d,"Ir");function f(x){if((x.port===(c(x)?443:80)||x.port==="")&&(x.port=void 0),typeof x.secure=="boolean"&&(x.scheme=x.secure?"wss":"ws",x.secure=void 0),x.resourceName){let[P,D]=x.resourceName.split("?");x.path=P&&P!=="/"?P:void 0,x.query=D,x.resourceName=void 0}return x.fragment=void 0,x}a(f,"Rr");function h(x,P){if(!x.path)return x.error="URN can not be parsed",x;let D=x.path.match(n);if(D){let N=P.scheme||x.scheme||"urn";x.nid=D[1].toLowerCase(),x.nss=D[2];let L=`${N}:${P.nid||x.nid}`,B=R(L);x.path=void 0,B&&(x=B.parse(x,P))}else x.error=x.error||"URN can not be parsed.";return x}a(h,"Pr");function m(x,P){if(x.nid===void 0)throw Error("URN without nid cannot be serialized");let D=P.scheme||x.scheme||"urn",N=x.nid.toLowerCase(),L=`${D}:${P.nid||N}`,B=R(L);B&&(x=B.serialize(x,P));let q=x,M=x.nss;return q.path=`${N||P.nid}:${M}`,P.skipEscape=!0,q}a(m,"Er");function g(x,P){let D=x;return D.uuid=D.nss,D.nss=void 0,!P.tolerant&&(!D.uuid||!r(D.uuid))&&(D.error=D.error||"UUID is not valid."),D}a(g,"br");function A(x){let P=x;return P.nss=(x.uuid||"").toLowerCase(),P}a(A,"_r");var y={scheme:"http",domainHost:!0,parse:l,serialize:u},E={scheme:"https",domainHost:y.domainHost,parse:l,serialize:u},_={scheme:"ws",domainHost:!0,parse:d,serialize:f},v={scheme:"wss",domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},b={scheme:"urn",parse:h,serialize:m,skipNormalize:!0},T={scheme:"urn:uuid",parse:g,serialize:A,skipNormalize:!0},w={http:y,https:E,ws:_,wss:v,urn:b,"urn:uuid":T};Object.setPrototypeOf(w,null);function R(x){return x&&(w[x]||w[x.toLowerCase()])||void 0}a(R,"uB"),e.exports={wsIsSecure:c,SCHEMES:w,isValidSchemeName:s,getSchemeHandler:R}}),D6c=Ht((t,e)=>{var{normalizeIPv6:r,removeDotSegments:n,recomposeAuthority:o,normalizePercentEncoding:s,normalizePathEncoding:c,escapePreservingEscapes:l,reescapeHostDelimiters:u,isIPv4:d,nonSimpleDomain:f}=XJi(),{SCHEMES:h,getSchemeHandler:m}=P6c();function g(N,L){return typeof N=="string"?N=R(N,L):typeof N=="object"&&(N=w(_(N,L),L)),N}a(g,"cr");function A(N,L,B){let q=B?Object.assign({scheme:"null"},B):{scheme:"null"},M=y(w(N,q),w(L,q),q,!0);return q.skipEscape=!0,_(M,q)}a(A,"pr");function y(N,L,B,q){let M={};return q||(N=w(_(N,B),B),L=w(_(L,B),B)),B=B||{},!B.tolerant&&L.scheme?(M.scheme=L.scheme,M.userinfo=L.userinfo,M.host=L.host,M.port=L.port,M.path=n(L.path||""),M.query=L.query):(L.userinfo!==void 0||L.host!==void 0||L.port!==void 0?(M.userinfo=L.userinfo,M.host=L.host,M.port=L.port,M.path=n(L.path||""),M.query=L.query):(L.path?(L.path[0]==="/"?M.path=n(L.path):((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path?M.path="/"+L.path:N.path?M.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+L.path:M.path=L.path,M.path=n(M.path)),M.query=L.query):(M.path=N.path,L.query!==void 0?M.query=L.query:M.query=N.query),M.userinfo=N.userinfo,M.host=N.host,M.port=N.port),M.scheme=N.scheme),M.fragment=L.fragment,M}a(y,"MI");function E(N,L,B){let q=P(N,B),M=P(L,B);return q!==void 0&&M!==void 0&&q.toLowerCase()===M.toLowerCase()}a(E,"dr");function _(N,L){let B={host:N.host,scheme:N.scheme,userinfo:N.userinfo,port:N.port,path:N.path,query:N.query,nid:N.nid,nss:N.nss,uuid:N.uuid,fragment:N.fragment,reference:N.reference,resourceName:N.resourceName,secure:N.secure,error:""},q=Object.assign({},L),M=[],O=m(q.scheme||B.scheme);O&&O.serialize&&O.serialize(B,q),B.path!==void 0&&(q.skipEscape?B.path=s(B.path):(B.path=l(B.path),B.scheme!==void 0&&(B.path=B.path.split("%3A").join(":")))),q.reference!=="suffix"&&B.scheme&&M.push(B.scheme,":");let j=o(B);if(j!==void 0&&(q.reference!=="suffix"&&M.push("//"),M.push(j),B.path&&B.path[0]!=="/"&&M.push("/")),B.path!==void 0){let Q=B.path;!q.absolutePath&&(!O||!O.absolutePath)&&(Q=n(Q)),j===void 0&&Q[0]==="/"&&Q[1]==="/"&&(Q="/%2F"+Q.slice(2)),M.push(Q)}return B.query!==void 0&&M.push("?",B.query),B.fragment!==void 0&&M.push("#",B.fragment),M.join("")}a(_,"y0");var v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(N,L){if(L[2]!==void 0&&N.path&&N.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof N.port=="number"&&(N.port<0||N.port>65535))return"URI port is malformed."}a(b,"nr");function T(N,L){let B=Object.assign({},L),q={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},M=!1,O=!1;B.reference==="suffix"&&(B.scheme?N=B.scheme+":"+N:N="//"+N);let j=N.match(v);if(j){q.scheme=j[1],q.userinfo=j[3],q.host=j[4],q.port=parseInt(j[5],10),q.path=j[6]||"",q.query=j[7],q.fragment=j[8],isNaN(q.port)&&(q.port=j[5]);let Q=b(q,j);if(Q!==void 0&&(q.error=q.error||Q,M=!0),q.host)if(d(q.host)===!1){let Y=r(q.host);q.host=Y.host.toLowerCase(),O=Y.isIPV6}else O=!0;q.scheme===void 0&&q.userinfo===void 0&&q.host===void 0&&q.port===void 0&&q.query===void 0&&!q.path?q.reference="same-document":q.scheme===void 0?q.reference="relative":q.fragment===void 0?q.reference="absolute":q.reference="uri",B.reference&&B.reference!=="suffix"&&B.reference!==q.reference&&(q.error=q.error||"URI is not a "+B.reference+" reference.");let U=m(B.scheme||q.scheme);if(!B.unicodeSupport&&(!U||!U.unicodeSupport)&&q.host&&(B.domainHost||U&&U.domainHost)&&O===!1&&f(q.host))try{q.host=URL.domainToASCII(q.host.toLowerCase())}catch(Y){q.error=q.error||"Host's domain name can not be converted to ASCII: "+Y}if((!U||U&&!U.skipNormalize)&&(N.indexOf("%")!==-1&&(q.scheme!==void 0&&(q.scheme=unescape(q.scheme)),q.host!==void 0&&(q.host=u(unescape(q.host),O))),q.path&&(q.path=c(q.path)),q.fragment))try{q.fragment=encodeURI(decodeURIComponent(q.fragment))}catch{q.error=q.error||"URI malformed"}U&&U.parse&&U.parse(q,B)}else q.error=q.error||"URI can not be parsed.";return{parsed:q,malformedAuthorityOrPort:M}}a(T,"LI");function w(N,L){return T(N,L).parsed}a(w,"w9");function R(N,L){return x(N,L).normalized}a(R,"rr");function x(N,L){let{parsed:B,malformedAuthorityOrPort:q}=T(N,L);return{normalized:q?N:_(B,L),malformedAuthorityOrPort:q}}a(x,"jI");function P(N,L){if(typeof N=="string"){let{normalized:B,malformedAuthorityOrPort:q}=x(N,L);return q?void 0:B}if(typeof N=="object")return _(N,L)}a(P,"FI");var D={SCHEMES:h,normalize:g,resolve:A,resolveComponent:y,equal:E,serialize:_,parse:w};e.exports=D,e.exports.default=D,e.exports.fastUri=D}),N6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=D6c();e.code='require("ajv/dist/runtime/uri").default',t.default=e}),M6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=hwt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return e.KeywordCxt},"get")});var r=Ns();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return r._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return r.str},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return r.stringify},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return r.nil},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return r.Name},"get")}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:a(function(){return r.CodeGen},"get")});var n=C6r(),o=mwt(),s=KJi(),c=b6r(),l=Ns(),u=pwt(),d=$It(),f=mc(),h=k6c(),m=N6c(),g=a((W,V)=>new RegExp(W,V),"vI");g.code="new RegExp";var A=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),E={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function b(W){var V,z,ie,H,re,le,Le,ge,Ue,ke,X,ee,K,he,Z,ue,qe,ne,ce,Ne,we,Be,rt,st,_t;let Dt=W.strict,$t=(V=W.code)===null||V===void 0?void 0:V.optimize,Gt=$t===!0||$t===void 0?1:$t||0,Ie=(ie=(z=W.code)===null||z===void 0?void 0:z.regExp)!==null&&ie!==void 0?ie:g,F=(H=W.uriResolver)!==null&&H!==void 0?H:m.default;return{strictSchema:(le=(re=W.strictSchema)!==null&&re!==void 0?re:Dt)!==null&&le!==void 0?le:!0,strictNumbers:(ge=(Le=W.strictNumbers)!==null&&Le!==void 0?Le:Dt)!==null&&ge!==void 0?ge:!0,strictTypes:(ke=(Ue=W.strictTypes)!==null&&Ue!==void 0?Ue:Dt)!==null&&ke!==void 0?ke:"log",strictTuples:(ee=(X=W.strictTuples)!==null&&X!==void 0?X:Dt)!==null&&ee!==void 0?ee:"log",strictRequired:(he=(K=W.strictRequired)!==null&&K!==void 0?K:Dt)!==null&&he!==void 0?he:!1,code:W.code?{...W.code,optimize:Gt,regExp:Ie}:{optimize:Gt,regExp:Ie},loopRequired:(Z=W.loopRequired)!==null&&Z!==void 0?Z:v,loopEnum:(ue=W.loopEnum)!==null&&ue!==void 0?ue:v,meta:(qe=W.meta)!==null&&qe!==void 0?qe:!0,messages:(ne=W.messages)!==null&&ne!==void 0?ne:!0,inlineRefs:(ce=W.inlineRefs)!==null&&ce!==void 0?ce:!0,schemaId:(Ne=W.schemaId)!==null&&Ne!==void 0?Ne:"$id",addUsedSchema:(we=W.addUsedSchema)!==null&&we!==void 0?we:!0,validateSchema:(Be=W.validateSchema)!==null&&Be!==void 0?Be:!0,validateFormats:(rt=W.validateFormats)!==null&&rt!==void 0?rt:!0,unicodeRegExp:(st=W.unicodeRegExp)!==null&&st!==void 0?st:!0,int32range:(_t=W.int32range)!==null&&_t!==void 0?_t:!0,uriResolver:F}}a(b,"Wo");class T{static{a(this,"CW")}constructor(V={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,V=this.opts={...V,...b(V)};let{es5:z,lines:ie}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:z,lines:ie}),this.logger=B(V.logger);let H=V.validateFormats;V.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,E,V,"NOT SUPPORTED"),w.call(this,_,V,"DEPRECATED","warn"),this._metaOpts=N.call(this),V.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),V.keywords&&D.call(this,V.keywords),typeof V.meta=="object"&&this.addMetaSchema(V.meta),x.call(this),V.validateFormats=H}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:V,meta:z,schemaId:ie}=this.opts,H=h;ie==="id"&&(H={...h},H.id=H.$id,delete H.$id),z&&V&&this.addMetaSchema(H,H[ie],!1)}defaultMeta(){let{meta:V,schemaId:z}=this.opts;return this.opts.defaultMeta=typeof V=="object"?V[z]||V:void 0}validate(V,z){let ie;if(typeof V=="string"){if(ie=this.getSchema(V),!ie)throw Error(`no schema with key or ref "${V}"`)}else ie=this.compile(V);let H=ie(z);return"$async"in ie||(this.errors=ie.errors),H}compile(V,z){let ie=this._addSchema(V,z);return ie.validate||this._compileSchemaEnv(ie)}compileAsync(V,z){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:ie}=this.opts;return H.call(this,V,z);async function H(ke,X){await re.call(this,ke.$schema);let ee=this._addSchema(ke,X);return ee.validate||le.call(this,ee)}async function re(ke){ke&&!this.getSchema(ke)&&await H.call(this,{$ref:ke},!0)}async function le(ke){try{return this._compileSchemaEnv(ke)}catch(X){if(!(X instanceof o.default))throw X;return Le.call(this,X),await ge.call(this,X.missingSchema),le.call(this,ke)}}function Le({missingSchema:ke,missingRef:X}){if(this.refs[ke])throw Error(`AnySchema ${ke} is loaded but ${X} cannot be resolved`)}async function ge(ke){let X=await Ue.call(this,ke);this.refs[ke]||await re.call(this,X.$schema),this.refs[ke]||this.addSchema(X,ke,z)}async function Ue(ke){let X=this._loading[ke];if(X)return X;try{return await(this._loading[ke]=ie(ke))}finally{delete this._loading[ke]}}}addSchema(V,z,ie,H=this.opts.validateSchema){if(Array.isArray(V)){for(let le of V)this.addSchema(le,void 0,ie,H);return this}let re;if(typeof V=="object"){let{schemaId:le}=this.opts;if(re=V[le],re!==void 0&&typeof re!="string")throw Error(`schema ${le} must be string`)}return z=(0,u.normalizeId)(z||re),this._checkUnique(z),this.schemas[z]=this._addSchema(V,ie,z,H,!0),this}addMetaSchema(V,z,ie=this.opts.validateSchema){return this.addSchema(V,z,!0,ie),this}validateSchema(V,z){if(typeof V=="boolean")return!0;let ie;if(ie=V.$schema,ie!==void 0&&typeof ie!="string")throw Error("$schema must be a string");if(ie=ie||this.opts.defaultMeta||this.defaultMeta(),!ie)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let H=this.validate(ie,V);if(!H&&z){let re="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(re);else throw Error(re)}return H}getSchema(V){let z;for(;typeof(z=R.call(this,V))=="string";)V=z;if(z===void 0){let{schemaId:ie}=this.opts,H=new c.SchemaEnv({schema:{},schemaId:ie});if(z=c.resolveSchema.call(this,H,V),!z)return;this.refs[V]=z}return z.validate||this._compileSchemaEnv(z)}removeSchema(V){if(V instanceof RegExp)return this._removeAllSchemas(this.schemas,V),this._removeAllSchemas(this.refs,V),this;switch(typeof V){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let z=R.call(this,V);return typeof z=="object"&&this._cache.delete(z.schema),delete this.schemas[V],delete this.refs[V],this}case"object":{let z=V;this._cache.delete(z);let ie=V[this.opts.schemaId];return ie&&(ie=(0,u.normalizeId)(ie),delete this.schemas[ie],delete this.refs[ie]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(V){for(let z of V)this.addKeyword(z);return this}addKeyword(V,z){let ie;if(typeof V=="string")ie=V,typeof z=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),z.keyword=ie);else if(typeof V=="object"&&z===void 0){if(z=V,ie=z.keyword,Array.isArray(ie)&&!ie.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(M.call(this,ie,z),!z)return(0,f.eachItem)(ie,re=>O.call(this,re)),this;Q.call(this,z);let H={...z,type:(0,d.getJSONTypes)(z.type),schemaType:(0,d.getJSONTypes)(z.schemaType)};return(0,f.eachItem)(ie,H.type.length===0?re=>O.call(this,re,H):re=>H.type.forEach(le=>O.call(this,re,H,le))),this}getKeyword(V){let z=this.RULES.all[V];return typeof z=="object"?z.definition:!!z}removeKeyword(V){let{RULES:z}=this;delete z.keywords[V],delete z.all[V];for(let ie of z.rules){let H=ie.rules.findIndex(re=>re.keyword===V);H>=0&&ie.rules.splice(H,1)}return this}addFormat(V,z){return typeof z=="string"&&(z=new RegExp(z)),this.formats[V]=z,this}errorsText(V=this.errors,{separator:z=", ",dataVar:ie="data"}={}){return!V||V.length===0?"No errors":V.map(H=>`${ie}${H.instancePath} ${H.message}`).reduce((H,re)=>H+z+re)}$dataMetaSchema(V,z){let ie=this.RULES.all;V=JSON.parse(JSON.stringify(V));for(let H of z){let re=H.split("/").slice(1),le=V;for(let Le of re)le=le[Le];for(let Le in ie){let ge=ie[Le];if(typeof ge!="object")continue;let{$data:Ue}=ge.definition,ke=le[Le];Ue&&ke&&(le[Le]=Y(ke))}}return V}_removeAllSchemas(V,z){for(let ie in V){let H=V[ie];(!z||z.test(ie))&&(typeof H=="string"?delete V[ie]:H&&!H.meta&&(this._cache.delete(H.schema),delete V[ie]))}}_addSchema(V,z,ie,H=this.opts.validateSchema,re=this.opts.addUsedSchema){let le,{schemaId:Le}=this.opts;if(typeof V=="object")le=V[Le];else{if(this.opts.jtd)throw Error("schema must be object");if(typeof V!="boolean")throw Error("schema must be object or boolean")}let ge=this._cache.get(V);if(ge!==void 0)return ge;ie=(0,u.normalizeId)(le||ie);let Ue=u.getSchemaRefs.call(this,V,ie);return ge=new c.SchemaEnv({schema:V,schemaId:Le,meta:z,baseId:ie,localRefs:Ue}),this._cache.set(ge.schema,ge),re&&!ie.startsWith("#")&&(ie&&this._checkUnique(ie),this.refs[ie]=ge),H&&this.validateSchema(V,!0),ge}_checkUnique(V){if(this.schemas[V]||this.refs[V])throw Error(`schema with key or id "${V}" already exists`)}_compileSchemaEnv(V){if(V.meta?this._compileMetaSchema(V):c.compileSchema.call(this,V),!V.validate)throw Error("ajv implementation error");return V.validate}_compileMetaSchema(V){let z=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,V)}finally{this.opts=z}}}T.ValidationError=n.default,T.MissingRefError=o.default,t.default=T;function w(W,V,z,ie="error"){for(let H in W){let re=H;re in V&&this.logger[ie](`${z}: option ${H}. ${W[re]}`)}}a(w,"_I");function R(W){return W=(0,u.normalizeId)(W),this.schemas[W]||this.refs[W]}a(R,"kI");function x(){let W=this.opts.schemas;if(W)if(Array.isArray(W))this.addSchema(W);else for(let V in W)this.addSchema(W[V],V)}a(x,"Go");function P(){for(let W in this.opts.formats){let V=this.opts.formats[W];V&&this.addFormat(W,V)}}a(P,"Uo");function D(W){if(Array.isArray(W)){this.addVocabulary(W);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let V in W){let z=W[V];z.keyword||(z.keyword=V),this.addKeyword(z)}}a(D,"Ho");function N(){let W={...this.opts};for(let V of A)delete W[V];return W}a(N,"Ko");var L={log(){},warn(){},error(){}};function B(W){if(W===!1)return L;if(W===void 0)return console;if(W.log&&W.warn&&W.error)return W;throw Error("logger must implement log, warn and error methods")}a(B,"Vo");var q=/^[a-z_$][a-z0-9_$:-]*$/i;function M(W,V){let{RULES:z}=this;if((0,f.eachItem)(W,ie=>{if(z.keywords[ie])throw Error(`Keyword ${ie} is already defined`);if(!q.test(ie))throw Error(`Keyword ${ie} has invalid name`)}),!!V&&V.$data&&!("code"in V||"validate"in V))throw Error('$data keyword must have "code" or "validate" function')}a(M,"zo");function O(W,V,z){var ie;let H=V?.post;if(z&&H)throw Error('keyword with "post" flag cannot have "type"');let{RULES:re}=this,le=H?re.post:re.rules.find(({type:ge})=>ge===z);if(le||(le={type:z,rules:[]},re.rules.push(le)),re.keywords[W]=!0,!V)return;let Le={keyword:W,definition:{...V,type:(0,d.getJSONTypes)(V.type),schemaType:(0,d.getJSONTypes)(V.schemaType)}};V.before?j.call(this,le,Le,V.before):le.rules.push(Le),re.all[W]=Le,(ie=V.implements)===null||ie===void 0||ie.forEach(ge=>this.addKeyword(ge))}a(O,"lB");function j(W,V,z){let ie=W.rules.findIndex(H=>H.keyword===z);ie>=0?W.rules.splice(ie,0,V):(W.rules.push(V),this.logger.warn(`rule ${z} is not defined`))}a(j,"No");function Q(W){let{metaSchema:V}=W;V!==void 0&&(W.$data&&this.opts.$data&&(V=Y(V)),W.validateSchema=this.compile(V,!0))}a(Q,"wo");var U={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Y(W){return{anyOf:[W,U]}}a(Y,"CI")}),O6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=e}),L6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;var e=mwt(),r=HN(),n=Ns(),o=pW(),s=b6r(),c=mc(),l={keyword:"$ref",schemaType:"string",code(f){let{gen:h,schema:m,it:g}=f,{baseId:A,schemaEnv:y,validateName:E,opts:_,self:v}=g,{root:b}=y;if((m==="#"||m==="#/")&&A===b.baseId)return w();let T=s.resolveRef.call(v,b,A,m);if(T===void 0)throw new e.default(g.opts.uriResolver,A,m);if(T instanceof s.SchemaEnv)return R(T);return x(T);function w(){if(y===b)return d(f,E,y,y.$async);let P=h.scopeValue("root",{ref:b});return d(f,n._`${P}.validate`,b,b.$async)}function R(P){let D=u(f,P);d(f,D,P,P.$async)}function x(P){let D=h.scopeValue("schema",_.code.source===!0?{ref:P,code:(0,n.stringify)(P)}:{ref:P}),N=h.name("valid"),L=f.subschema({schema:P,dataTypes:[],schemaPath:n.nil,topSchemaRef:D,errSchemaPath:m},N);f.mergeEvaluated(L),f.ok(N)}}};function u(f,h){let{gen:m}=f;return h.validate?m.scopeValue("validate",{ref:h.validate}):n._`${m.scopeValue("wrapper",{ref:h})}.validate`}a(u,"hI"),t.getValidate=u;function d(f,h,m,g){let{gen:A,it:y}=f,{allErrors:E,schemaEnv:_,opts:v}=y,b=v.passContext?o.default.this:n.nil;g?T():w();function T(){if(!_.$async)throw Error("async schema referenced by sync schema");let P=A.let("valid");A.try(()=>{A.code(n._`await ${(0,r.callValidateCode)(f,h,b)}`),x(h),!E&&A.assign(P,!0)},D=>{A.if(n._`!(${D} instanceof ${y.ValidationError})`,()=>A.throw(D)),R(D),!E&&A.assign(P,!1)}),f.ok(P)}a(T,"V");function w(){f.result((0,r.callValidateCode)(f,h,b),()=>x(h),()=>R(h))}a(w,"B");function R(P){let D=n._`${P}.errors`;A.assign(o.default.vErrors,n._`${o.default.vErrors} === null ? ${D} : ${o.default.vErrors}.concat(${D})`),A.assign(o.default.errors,n._`${o.default.vErrors}.length`)}a(R,"z");function x(P){var D;if(!y.opts.unevaluated)return;let N=(D=m?.validate)===null||D===void 0?void 0:D.evaluated;if(y.props!==!0)if(N&&!N.dynamicProps)N.props!==void 0&&(y.props=c.mergeEvaluated.props(A,N.props,y.props));else{let L=A.var("props",n._`${P}.evaluated.props`);y.props=c.mergeEvaluated.props(A,L,y.props,n.Name)}if(y.items!==!0)if(N&&!N.dynamicItems)N.items!==void 0&&(y.items=c.mergeEvaluated.items(A,N.items,y.items));else{let L=A.var("items",n._`${P}.evaluated.items`);y.items=c.mergeEvaluated.items(A,L,y.items,n.Name)}}a(x,"N")}a(d,"xW"),t.callRef=d,t.default=l}),B6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=O6c(),r=L6c(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,r.default];t.default=n}),F6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=e.operators,n={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},o={message:a(({keyword:c,schemaCode:l})=>e.str`must be ${n[c].okStr} ${l}`,"message"),params:a(({keyword:c,schemaCode:l})=>e._`{comparison: ${n[c].okStr}, limit: ${l}}`,"params")},s={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:o,code(c){let{keyword:l,data:u,schemaCode:d}=c;c.fail$data(e._`${u} ${n[l].fail} ${d} || isNaN(${u})`)}};t.default=s}),U6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r={message:a(({schemaCode:o})=>e.str`must be multiple of ${o}`,"message"),params:a(({schemaCode:o})=>e._`{multipleOf: ${o}}`,"params")},n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:r,code(o){let{gen:s,data:c,schemaCode:l,it:u}=o,d=u.opts.multipleOfPrecision,f=s.let("res"),h=d?e._`Math.abs(Math.round(${f}) - ${f}) > 1e-${d}`:e._`${f} !== parseInt(${f})`;o.fail$data(e._`(${l} === 0 || (${f} = ${c}/${l}, ${h}))`)}};t.default=n}),Q6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});function e(r){let n=r.length,o=0,s=0,c;for(;s=55296&&c<=56319&&s{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n=Q6c(),o={message({keyword:c,schemaCode:l}){let u=c==="maxLength"?"more":"fewer";return e.str`must NOT have ${u} than ${l} characters`},params:a(({schemaCode:c})=>e._`{limit: ${c}}`,"params")},s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:o,code(c){let{keyword:l,data:u,schemaCode:d,it:f}=c,h=l==="maxLength"?e.operators.GT:e.operators.LT,m=f.opts.unicode===!1?e._`${u}.length`:e._`${(0,r.useFunc)(c.gen,n.default)}(${u})`;c.fail$data(e._`${m} ${h} ${d}`)}};t.default=s}),j6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=HN(),r=mc(),n=Ns(),o={message:a(({schemaCode:c})=>n.str`must match pattern "${c}"`,"message"),params:a(({schemaCode:c})=>n._`{pattern: ${c}}`,"params")},s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schema:f,schemaCode:h,it:m}=c,g=m.opts.unicodeRegExp?"u":"";if(d){let{regExp:A}=m.opts.code,y=A.code==="new RegExp"?n._`new RegExp`:(0,r.useFunc)(l,A),E=l.let("valid");l.try(()=>l.assign(E,n._`${y}(${h}, ${g}).test(${u})`),()=>l.assign(E,!1)),c.fail$data(n._`!${E}`)}else{let A=(0,e.usePattern)(c,f);c.fail$data(n._`!${A}.test(${u})`)}}};t.default=s}),H6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r={message({keyword:o,schemaCode:s}){let c=o==="maxProperties"?"more":"fewer";return e.str`must NOT have ${c} than ${s} properties`},params:a(({schemaCode:o})=>e._`{limit: ${o}}`,"params")},n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:r,code(o){let{keyword:s,data:c,schemaCode:l}=o,u=s==="maxProperties"?e.operators.GT:e.operators.LT;o.fail$data(e._`Object.keys(${c}).length ${u} ${l}`)}};t.default=n}),G6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=HN(),r=Ns(),n=mc(),o={message:a(({params:{missingProperty:c}})=>r.str`must have required property '${c}'`,"message"),params:a(({params:{missingProperty:c}})=>r._`{missingProperty: ${c}}`,"params")},s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:o,code(c){let{gen:l,schema:u,schemaCode:d,data:f,$data:h,it:m}=c,{opts:g}=m;if(!h&&u.length===0)return;let A=u.length>=g.loopRequired;if(m.allErrors?y():E(),g.strictRequired){let b=c.parentSchema.properties,{definedProperties:T}=c.it;for(let w of u)if(b?.[w]===void 0&&!T.has(w)){let R=m.schemaEnv.baseId+m.errSchemaPath,x=`required property "${w}" is not defined at "${R}" (strictRequired)`;(0,n.checkStrictMode)(m,x,m.opts.strictRequired)}}function y(){if(A||h)c.block$data(r.nil,_);else for(let b of u)(0,e.checkReportMissingProp)(c,b)}a(y,"q");function E(){let b=l.let("missing");if(A||h){let T=l.let("valid",!0);c.block$data(T,()=>v(b,T)),c.ok(T)}else l.if((0,e.checkMissingProp)(c,u,b)),(0,e.reportMissingProp)(c,b),l.else()}a(E,"V");function _(){l.forOf("prop",d,b=>{c.setParams({missingProperty:b}),l.if((0,e.noPropertyInData)(l,f,b,g.ownProperties),()=>c.error())})}a(_,"B");function v(b,T){c.setParams({missingProperty:b}),l.forOf(b,d,()=>{l.assign(T,(0,e.propertyInData)(l,f,b,g.ownProperties)),l.if((0,r.not)(T),()=>{c.error(),l.break()})},r.nil)}a(v,"z")}};t.default=s}),$6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r={message({keyword:o,schemaCode:s}){let c=o==="maxItems"?"more":"fewer";return e.str`must NOT have ${c} than ${s} items`},params:a(({schemaCode:o})=>e._`{limit: ${o}}`,"params")},n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:r,code(o){let{keyword:s,data:c,schemaCode:l}=o,u=s==="maxItems"?e.operators.GT:e.operators.LT;o.fail$data(e._`${c}.length ${u} ${l}`)}};t.default=n}),S6r=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=ZJi();e.code='require("ajv/dist/runtime/equal").default',t.default=e}),V6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=$It(),r=Ns(),n=mc(),o=S6r(),s={message:a(({params:{i:l,j:u}})=>r.str`must NOT have duplicate items (items ## ${u} and ${l} are identical)`,"message"),params:a(({params:{i:l,j:u}})=>r._`{i: ${l}, j: ${u}}`,"params")},c={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:s,code(l){let{gen:u,data:d,$data:f,schema:h,parentSchema:m,schemaCode:g,it:A}=l;if(!f&&!h)return;let y=u.let("valid"),E=m.items?(0,e.getSchemaTypes)(m.items):[];l.block$data(y,_,r._`${g} === false`),l.ok(y);function _(){let w=u.let("i",r._`${d}.length`),R=u.let("j");l.setParams({i:w,j:R}),u.assign(y,!0),u.if(r._`${w} > 1`,()=>(v()?b:T)(w,R))}a(_,"V");function v(){return E.length>0&&!E.some(w=>w==="object"||w==="array")}a(v,"B");function b(w,R){let x=u.name("item"),P=(0,e.checkDataTypes)(E,x,A.opts.strictNumbers,e.DataType.Wrong),D=u.const("indices",r._`{}`);u.for(r._`;${w}--;`,()=>{u.let(x,r._`${d}[${w}]`),u.if(P,r._`continue`),E.length>1&&u.if(r._`typeof ${x} == "string"`,r._`${x} += "_"`),u.if(r._`typeof ${D}[${x}] == "number"`,()=>{u.assign(R,r._`${D}[${x}]`),l.error(),u.assign(y,!1).break()}).code(r._`${D}[${x}] = ${w}`)})}a(b,"z");function T(w,R){let x=(0,n.useFunc)(u,o.default),P=u.name("outer");u.label(P).for(r._`;${w}--;`,()=>u.for(r._`${R} = ${w}; ${R}--;`,()=>u.if(r._`${x}(${d}[${w}], ${d}[${R}])`,()=>{l.error(),u.assign(y,!1).break(P)})))}a(T,"N")}};t.default=c}),W6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n=S6r(),o={message:"must be equal to constant",params:a(({schemaCode:c})=>e._`{allowedValue: ${c}}`,"params")},s={keyword:"const",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schemaCode:f,schema:h}=c;d||h&&typeof h=="object"?c.fail$data(e._`!${(0,r.useFunc)(l,n.default)}(${u}, ${f})`):c.fail(e._`${h} !== ${u}`)}};t.default=s}),z6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n=S6r(),o={message:"must be equal to one of the allowed values",params:a(({schemaCode:c})=>e._`{allowedValues: ${c}}`,"params")},s={keyword:"enum",schemaType:"array",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schema:f,schemaCode:h,it:m}=c;if(!d&&f.length===0)throw Error("enum must have non-empty array");let g=f.length>=m.opts.loopEnum,A,y=a(()=>A??(A=(0,r.useFunc)(l,n.default)),"q"),E;if(g||d)E=l.let("valid"),c.block$data(E,_);else{if(!Array.isArray(f))throw Error("ajv implementation error");let b=l.const("vSchema",h);E=(0,e.or)(...f.map((T,w)=>v(b,w)))}c.pass(E);function _(){l.assign(E,!1),l.forOf("v",h,b=>l.if(e._`${y()}(${u}, ${b})`,()=>l.assign(E,!0).break()))}a(_,"B");function v(b,T){let w=f[T];return typeof w=="object"&&w!==null?e._`${y()}(${u}, ${b}[${T}])`:e._`${u} === ${w}`}a(v,"z")}};t.default=s}),Y6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=F6c(),r=U6c(),n=q6c(),o=j6c(),s=H6c(),c=G6c(),l=$6c(),u=V6c(),d=W6c(),f=z6c(),h=[e.default,r.default,n.default,o.default,s.default,c.default,l.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,f.default];t.default=h}),eZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;var e=Ns(),r=mc(),n={message:a(({params:{len:c}})=>e.str`must NOT have more than ${c} items`,"message"),params:a(({params:{len:c}})=>e._`{limit: ${c}}`,"params")},o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:n,code(c){let{parentSchema:l,it:u}=c,{items:d}=l;if(!Array.isArray(d)){(0,r.checkStrictMode)(u,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(c,d)}};function s(c,l){let{gen:u,schema:d,data:f,keyword:h,it:m}=c;m.items=!0;let g=u.const("len",e._`${f}.length`);if(d===!1)c.setParams({len:l.length}),c.pass(e._`${g} <= ${l.length}`);else if(typeof d=="object"&&!(0,r.alwaysValidSchema)(m,d)){let y=u.var("valid",e._`${g} <= ${l.length}`);u.if((0,e.not)(y),()=>A(y)),c.ok(y)}function A(y){u.forRange("i",l.length,g,E=>{c.subschema({keyword:h,dataProp:E,dataPropType:r.Type.Num},y),!m.allErrors&&u.if((0,e.not)(y),()=>u.break())})}a(A,"H")}a(s,"FR"),t.validateAdditionalItems=s,t.default=o}),tZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;var e=Ns(),r=mc(),n=HN(),o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(c){let{schema:l,it:u}=c;if(Array.isArray(l))return s(c,"additionalItems",l);u.items=!0,!(0,r.alwaysValidSchema)(u,l)&&c.ok((0,n.validateArray)(c))}};function s(c,l,u=c.schema){let{gen:d,parentSchema:f,data:h,keyword:m,it:g}=c;E(f),g.opts.unevaluated&&u.length&&g.items!==!0&&(g.items=r.mergeEvaluated.items(d,u.length,g.items));let A=d.name("valid"),y=d.const("len",e._`${h}.length`);u.forEach((_,v)=>{(0,r.alwaysValidSchema)(g,_)||(d.if(e._`${y} > ${v}`,()=>c.subschema({keyword:m,schemaProp:v,dataProp:v},A)),c.ok(A))});function E(_){let{opts:v,errSchemaPath:b}=g,T=u.length,w=T===_.minItems&&(T===_.maxItems||_[l]===!1);if(v.strictTuples&&!w){let R=`"${m}" is ${T}-tuple, but minItems or maxItems/${l} are not specified or different at path "${b}"`;(0,r.checkStrictMode)(g,R,v.strictTuples)}}a(E,"V")}a(s,"jR"),t.validateTuple=s,t.default=o}),K6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=tZi(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(n=>(0,e.validateTuple)(n,"items"),"code")};t.default=r}),J6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n=HN(),o=eZi(),s={message:a(({params:{len:l}})=>e.str`must NOT have more than ${l} items`,"message"),params:a(({params:{len:l}})=>e._`{limit: ${l}}`,"params")},c={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:s,code(l){let{schema:u,parentSchema:d,it:f}=l,{prefixItems:h}=d;f.items=!0,!(0,r.alwaysValidSchema)(f,u)&&(h?(0,o.validateAdditionalItems)(l,h):l.ok((0,n.validateArray)(l)))}};t.default=c}),Z6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n={message:a(({params:{min:s,max:c}})=>c===void 0?e.str`must contain at least ${s} valid item(s)`:e.str`must contain at least ${s} and no more than ${c} valid item(s)`,"message"),params:a(({params:{min:s,max:c}})=>c===void 0?e._`{minContains: ${s}}`:e._`{minContains: ${s}, maxContains: ${c}}`,"params")},o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:n,code(s){let{gen:c,schema:l,parentSchema:u,data:d,it:f}=s,h,m,{minContains:g,maxContains:A}=u;f.opts.next?(h=g===void 0?1:g,m=A):h=1;let y=c.const("len",e._`${d}.length`);if(s.setParams({min:h,max:m}),m===void 0&&h===0){(0,r.checkStrictMode)(f,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(m!==void 0&&h>m){(0,r.checkStrictMode)(f,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,r.alwaysValidSchema)(f,l)){let T=e._`${y} >= ${h}`;m!==void 0&&(T=e._`${T} && ${y} <= ${m}`),s.pass(T);return}f.items=!0;let E=c.name("valid");m===void 0&&h===1?v(E,()=>c.if(E,()=>c.break())):h===0?(c.let(E,!0),m!==void 0&&c.if(e._`${d}.length > 0`,_)):(c.let(E,!1),_()),s.result(E,()=>s.reset());function _(){let T=c.name("_valid"),w=c.let("count",0);v(T,()=>c.if(T,()=>b(w)))}a(_,"z");function v(T,w){c.forRange("i",0,y,R=>{s.subschema({keyword:"contains",dataProp:R,dataPropType:r.Type.Num,compositeRule:!0},T),w()})}a(v,"N");function b(T){c.code(e._`${T}++`),m===void 0?c.if(e._`${T} >= ${h}`,()=>c.assign(E,!0).break()):(c.if(e._`${T} > ${m}`,()=>c.assign(E,!1).break()),h===1?c.assign(E,!0):c.if(e._`${T} >= ${h}`,()=>c.assign(E,!0)))}a(b,"w")}};t.default=o}),X6c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;var e=Ns(),r=mc(),n=HN();t.error={message:a(({params:{property:u,depsCount:d,deps:f}})=>{let h=d===1?"property":"properties";return e.str`must have ${h} ${f} when property ${u} is present`},"message"),params:a(({params:{property:u,depsCount:d,deps:f,missingProperty:h}})=>e._`{property: ${u}, + || ${D} === "boolean" || ${x} === null`).assign(N,o._`[${x}]`)}}a(L,"H")}a(m,"Ui");function g({gen:b,parentData:T,parentDataProperty:w},R){b.if(o._`${T} !== undefined`,()=>b.assign(o._`${T}[${w}]`,R))}a(g,"Hi");function A(b,T,w,R=c.Correct){let x=R===c.Correct?o.operators.EQ:o.operators.NEQ,P;switch(b){case"null":return o._`${T} ${x} null`;case"array":P=o._`Array.isArray(${T})`;break;case"object":P=o._`${T} && typeof ${T} == "object" && !Array.isArray(${T})`;break;case"integer":P=D(o._`!(${T} % 1) && !isNaN(${T})`);break;case"number":P=D();break;default:return o._`typeof ${T} ${x} ${b}`}return R===c.Correct?P:(0,o.not)(P);function D(N=o.nil){return(0,o.and)(o._`typeof ${T} == "number"`,N,w?o._`isFinite(${T})`:o.nil)}}a(A,"LB"),t.checkDataType=A;function y(b,T,w,R){if(b.length===1)return A(b[0],T,w,R);let x,P=(0,s.toHash)(b);if(P.array&&P.object){let D=o._`typeof ${T} != "object"`;x=P.null?D:o._`!${T} || ${D}`,delete P.null,delete P.array,delete P.object}else x=o.nil;P.number&&delete P.integer;for(let D in P)x=(0,o.and)(x,A(D,T,w,R));return x}a(y,"jB"),t.checkDataTypes=y;var E={message:a(({schema:b})=>`must be ${b}`,"message"),params:a(({schema:b,schemaValue:T})=>typeof b=="string"?o._`{type: ${b}}`:o._`{type: ${T}}`,"params")};function _(b){let T=v(b);(0,n.reportError)(T,E)}a(_,"AB"),t.reportTypeError=_;function v(b){let{gen:T,data:w,schema:R}=b,x=(0,s.schemaRefOrVal)(b,R,"type");return{gen:T,keyword:"type",data:w,schema:R.type,schemaCode:x,schemaValue:x,parentSchema:R,params:{},it:b}}a(v,"qi")}),A7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;var e=Ns(),r=gc();function n(s,c){let{properties:l,items:u}=s.schema;if(c==="object"&&l)for(let d in l)o(s,d,l[d].default);else c==="array"&&Array.isArray(u)&&u.forEach((d,f)=>o(s,f,d.default))}a(n,"Fi"),t.assignDefaults=n;function o(s,c,l){let{gen:u,compositeRule:d,data:f,opts:h}=s;if(l===void 0)return;let m=e._`${f}${(0,e.getProperty)(c)}`;if(d){(0,r.checkStrictMode)(s,`default is ignored for: ${m}`);return}let g=e._`${m} === undefined`;h.useDefaults==="empty"&&(g=e._`${g} || ${m} === null || ${m} === ""`),u.if(g,e._`${m} = ${(0,e.stringify)(l)}`)}a(o,"VA")}),JN=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;var e=Ns(),r=gc(),n=TW(),o=gc();function s(b,T){let{gen:w,data:R,it:x}=b;w.if(h(w,R,T,x.opts.ownProperties),()=>{b.setParams({missingProperty:e._`${T}`},!0),b.error()})}a(s,"Mi"),t.checkReportMissingProp=s;function c({gen:b,data:T,it:{opts:w}},R,x){return(0,e.or)(...R.map(P=>(0,e.and)(h(b,T,P,w.ownProperties),e._`${x} = ${P}`)))}a(c,"Li"),t.checkMissingProp=c;function l(b,T){b.setParams({missingProperty:T},!0),b.error()}a(l,"ji"),t.reportMissingProp=l;function u(b){return b.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:e._`Object.prototype.hasOwnProperty`})}a(u,"wA"),t.hasPropFunc=u;function d(b,T,w){return e._`${u(b)}.call(${T}, ${w})`}a(d,"RB"),t.isOwnProperty=d;function f(b,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} !== undefined`;return R?e._`${x} && ${d(b,T,w)}`:x}a(f,"Ai"),t.propertyInData=f;function h(b,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} === undefined`;return R?(0,e.or)(x,(0,e.not)(d(b,T,w))):x}a(h,"PB"),t.noPropertyInData=h;function m(b){return b?Object.keys(b).filter(T=>T!=="__proto__"):[]}a(m,"OA"),t.allSchemaProperties=m;function g(b,T){return m(T).filter(w=>!(0,r.alwaysValidSchema)(b,T[w]))}a(g,"Ii"),t.schemaProperties=g;function A({schemaCode:b,data:T,it:{gen:w,topSchemaRef:R,schemaPath:x,errorPath:P},it:D},N,L,B){let j=B?e._`${b}, ${T}, ${R}${x}`:T,M=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,P)],[n.default.parentData,D.parentData],[n.default.parentDataProperty,D.parentDataProperty],[n.default.rootData,n.default.rootData]];D.opts.dynamicRef&&M.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);let O=e._`${j}, ${w.object(...M)}`;return L!==e.nil?e._`${N}.call(${L}, ${O})`:e._`${N}(${O})`}a(A,"Ri"),t.callValidateCode=A;var y=e._`new RegExp`;function E({gen:b,it:{opts:T}},w){let R=T.unicodeRegExp?"u":"",{regExp:x}=T.code,P=x(w,R);return b.scopeValue("pattern",{key:P.toString(),ref:P,code:e._`${x.code==="new RegExp"?y:(0,o.useFunc)(b,x)}(${w}, ${R})`})}a(E,"Ei"),t.usePattern=E;function _(b){let{gen:T,data:w,keyword:R,it:x}=b,P=T.name("valid");if(x.allErrors){let N=T.let("valid",!0);return D(()=>T.assign(N,!1)),N}return T.var(P,!0),D(()=>T.break()),P;function D(N){let L=T.const("len",e._`${w}.length`);T.forRange("i",0,L,B=>{b.subschema({keyword:R,dataProp:B,dataPropType:r.Type.Num},P),T.if((0,e.not)(P),N)})}}a(_,"bi"),t.validateArray=_;function v(b){let{gen:T,schema:w,keyword:R,it:x}=b;if(!Array.isArray(w))throw Error("ajv implementation error");if(w.some(N=>(0,r.alwaysValidSchema)(x,N))&&!x.opts.unevaluated)return;let P=T.let("valid",!1),D=T.name("_valid");T.block(()=>w.forEach((N,L)=>{let B=b.subschema({keyword:R,schemaProp:L,compositeRule:!0},D);T.assign(P,e._`${P} || ${D}`),!b.mergeValidEvaluated(B,D)&&T.if((0,e.not)(P))})),b.result(P,()=>b.reset(),()=>b.error(!0))}a(v,"_i"),t.validateUnion=v}),y7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;var e=Ns(),r=TW(),n=JN(),o=Lwt();function s(g,A){let{gen:y,keyword:E,schema:_,parentSchema:v,it:b}=g,T=A.macro.call(b.self,_,v,b),w=f(y,E,T);b.opts.validateSchema!==!1&&b.self.validateSchema(T,!0);let R=y.name("valid");g.subschema({schema:T,schemaPath:e.nil,errSchemaPath:`${b.errSchemaPath}/${E}`,topSchemaRef:w,compositeRule:!0},R),g.pass(R,()=>g.error(!0))}a(s,"pi"),t.macroKeywordCode=s;function c(g,A){var y;let{gen:E,keyword:_,schema:v,parentSchema:b,$data:T,it:w}=g;d(w,A);let R=!T&&A.compile?A.compile.call(w.self,v,b,w):A.validate,x=f(E,_,R),P=E.let("valid");g.block$data(P,D),g.ok((y=A.valid)!==null&&y!==void 0?y:P);function D(){if(A.errors===!1)B(),A.modifying&&l(g),j(()=>g.error());else{let M=A.async?N():L();A.modifying&&l(g),j(()=>u(g,M))}}a(D,"z");function N(){let M=E.let("ruleErrs",null);return E.try(()=>B(e._`await `),O=>E.assign(P,!1).if(e._`${O} instanceof ${w.ValidationError}`,()=>E.assign(M,e._`${O}.errors`),()=>E.throw(O))),M}a(N,"N");function L(){let M=e._`${x}.errors`;return E.assign(M,null),B(e.nil),M}a(L,"w");function B(M=A.async?e._`await `:e.nil){let O=w.opts.passContext?r.default.this:r.default.self,U=!("compile"in A&&!T||A.schema===!1);E.assign(P,e._`${M}${(0,n.callValidateCode)(g,x,O,U)}`,A.modifying)}a(B,"O");function j(M){var O;E.if((0,e.not)((O=A.valid)!==null&&O!==void 0?O:P),M)}a(j,"D")}a(c,"di"),t.funcKeywordCode=c;function l(g){let{gen:A,data:y,it:E}=g;A.if(E.parentData,()=>A.assign(y,e._`${E.parentData}[${E.parentDataProperty}]`))}a(l,"ZA");function u(g,A){let{gen:y}=g;y.if(e._`Array.isArray(${A})`,()=>{y.assign(r.default.vErrors,e._`${r.default.vErrors} === null ? ${A} : ${r.default.vErrors}.concat(${A})`).assign(r.default.errors,e._`${r.default.vErrors}.length`),(0,o.extendErrors)(g)},()=>g.error())}a(u,"ii");function d({schemaEnv:g},A){if(A.async&&!g.$async)throw Error("async keyword in sync schema")}a(d,"ni");function f(g,A,y){if(y===void 0)throw Error(`keyword "${A}" failed to compile`);return g.scopeValue("keyword",typeof y=="function"?{ref:y}:{ref:y,code:(0,e.stringify)(y)})}a(f,"MA");function h(g,A,y=!1){return!A.length||A.some(E=>E==="array"?Array.isArray(g):E==="object"?g&&typeof g=="object"&&!Array.isArray(g):typeof g==E||y&&typeof g>"u")}a(h,"ri"),t.validSchemaType=h;function m({schema:g,opts:A,self:y,errSchemaPath:E},_,v){if(Array.isArray(_.keyword)?!_.keyword.includes(v):_.keyword!==v)throw Error("ajv implementation error");let b=_.dependencies;if(b?.some(T=>!Object.prototype.hasOwnProperty.call(g,T)))throw Error(`parent schema must have dependencies of ${v}: ${b.join(",")}`);if(_.validateSchema&&!_.validateSchema(g[v])){let T=`keyword "${v}" value is invalid at path "${E}": `+y.errorsText(_.validateSchema.errors);if(A.validateSchema==="log")y.logger.error(T);else throw Error(T)}}a(m,"oi"),t.validateKeywordUsage=m}),E7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;var e=Ns(),r=gc();function n(c,{keyword:l,schemaProp:u,schema:d,schemaPath:f,errSchemaPath:h,topSchemaRef:m}){if(l!==void 0&&d!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(l!==void 0){let g=c.schema[l];return u===void 0?{schema:g,schemaPath:e._`${c.schemaPath}${(0,e.getProperty)(l)}`,errSchemaPath:`${c.errSchemaPath}/${l}`}:{schema:g[u],schemaPath:e._`${c.schemaPath}${(0,e.getProperty)(l)}${(0,e.getProperty)(u)}`,errSchemaPath:`${c.errSchemaPath}/${l}/${(0,r.escapeFragment)(u)}`}}if(d!==void 0){if(f===void 0||h===void 0||m===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:d,schemaPath:f,topSchemaRef:m,errSchemaPath:h}}throw Error('either "keyword" or "schema" must be passed')}a(n,"ei"),t.getSubschema=n;function o(c,l,{dataProp:u,dataPropType:d,data:f,dataTypes:h,propertyName:m}){if(f!==void 0&&u!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:g}=l;if(u!==void 0){let{errorPath:y,dataPathArr:E,opts:_}=l,v=g.let("data",e._`${l.data}${(0,e.getProperty)(u)}`,!0);A(v),c.errorPath=e.str`${y}${(0,r.getErrorPath)(u,d,_.jsPropertySyntax)}`,c.parentDataProperty=e._`${u}`,c.dataPathArr=[...E,c.parentDataProperty]}if(f!==void 0){let y=f instanceof e.Name?f:g.let("data",f,!0);A(y),m!==void 0&&(c.propertyName=m)}h&&(c.dataTypes=h);function A(y){c.data=y,c.dataLevel=l.dataLevel+1,c.dataTypes=[],l.definedProperties=new Set,c.parentData=l.data,c.dataNames=[...l.dataNames,y]}a(A,"H")}a(o,"$n"),t.extendSubschemaData=o;function s(c,{jtdDiscriminator:l,jtdMetadata:u,compositeRule:d,createErrors:f,allErrors:h}){d!==void 0&&(c.compositeRule=d),f!==void 0&&(c.createErrors=f),h!==void 0&&(c.allErrors=h),c.jtdDiscriminator=l,c.jtdMetadata=u}a(s,"Qn"),t.extendSubschemaMode=s}),JXi=jt((t,e)=>{e.exports=a(function r(n,o){if(n===o)return!0;if(n&&o&&typeof n=="object"&&typeof o=="object"){if(n.constructor!==o.constructor)return!1;var s,c,l;if(Array.isArray(n)){if(s=n.length,s!=o.length)return!1;for(c=s;c--!==0;)if(!r(n[c],o[c]))return!1;return!0}if(n.constructor===RegExp)return n.source===o.source&&n.flags===o.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===o.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===o.toString();if(l=Object.keys(n),s=l.length,s!==Object.keys(o).length)return!1;for(c=s;c--!==0;)if(!Object.prototype.hasOwnProperty.call(o,l[c]))return!1;for(c=s;c--!==0;){var u=l[c];if(!r(n[u],o[u]))return!1}return!0}return n!==n&&o!==o},"$")}),_7c=jt((t,e)=>{var r=e.exports=function(s,c,l){typeof c=="function"&&(l=c,c={}),l=c.cb||l;var u=typeof l=="function"?l:l.pre||function(){},d=l.post||function(){};n(c,u,d,s,"",s)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function n(s,c,l,u,d,f,h,m,g,A){if(u&&typeof u=="object"&&!Array.isArray(u)){c(u,d,f,h,m,g,A);for(var y in u){var E=u[y];if(Array.isArray(E)){if(y in r.arrayKeywords)for(var _=0;_{Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;var e=gc(),r=JXi(),n=_7c(),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(E,_=!0){return typeof E=="boolean"?!0:_===!0?!l(E):_?u(E)<=_:!1}a(s,"Kn"),t.inlineRef=s;var c=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(E){for(let _ in E){if(c.has(_))return!0;let v=E[_];if(Array.isArray(v)&&v.some(l)||typeof v=="object"&&l(v))return!0}return!1}a(l,"bB");function u(E){let _=0;for(let v in E){if(v==="$ref")return 1/0;if(_++,!o.has(v)&&(typeof E[v]=="object"&&(0,e.eachItem)(E[v],b=>_+=u(b)),_===1/0))return 1/0}return _}a(u,"SA");function d(E,_="",v){v!==!1&&(_=m(_));let b=E.parse(_);return f(E,b)}a(d,"vA"),t.getFullPath=d;function f(E,_){return E.serialize(_).split("#")[0]+"#"}a(f,"CA"),t._getFullPath=f;var h=/#\/?$/;function m(E){return E?E.replace(h,""):""}a(m,"N9"),t.normalizeId=m;function g(E,_,v){return v=m(v),E.resolve(_,v)}a(g,"Bn"),t.resolveUrl=g;var A=/^[a-z_][-a-z0-9._]*$/i;function y(E,_){if(typeof E=="boolean")return{};let{schemaId:v,uriResolver:b}=this.opts,T=m(E[v]||_),w={"":T},R=d(b,T,!1),x={},P=new Set;return n(E,{allKeys:!0},(L,B,j,M)=>{if(M===void 0)return;let O=R+B,U=w[M];typeof L[v]=="string"&&(U=q.call(this,L[v])),Q.call(this,L.$anchor),Q.call(this,L.$dynamicAnchor),w[B]=U;function q(Y){let W=this.opts.uriResolver.resolve;if(Y=m(U?W(U,Y):Y),P.has(Y))throw N(Y);P.add(Y);let V=this.refs[Y];return typeof V=="string"&&(V=this.refs[V]),typeof V=="object"?D(L,V.schema,Y):Y!==m(O)&&(Y[0]==="#"?(D(L,x[Y],Y),x[Y]=L):this.refs[Y]=O),Y}a(q,"M");function Q(Y){if(typeof Y=="string"){if(!A.test(Y))throw Error(`invalid anchor "${Y}"`);q.call(this,`#${Y}`)}}a(Q,"j")}),x;function D(L,B,j){if(B!==void 0&&!r(L,B))throw N(j)}function N(L){return Error(`reference "${L}" resolves to more than one schema`)}}a(y,"Nn"),t.getSchemaRefs=y}),Fwt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;var e=g7c(),r=mxt(),n=KXi(),o=mxt(),s=A7c(),c=y7c(),l=E7c(),u=Ns(),d=TW(),f=Bwt(),h=gc(),m=Lwt();function g(ee){if(R(ee)&&(P(ee),w(ee))){_(ee);return}A(ee,()=>(0,e.topBoolOrEmptySchema)(ee))}a(g,"jn"),t.validateFunctionCode=g;function A({gen:ee,validateName:K,schema:he,schemaEnv:X,opts:de},qe){de.code.es5?ee.func(K,u._`${d.default.data}, ${d.default.valCxt}`,X.$async,()=>{ee.code(u._`"use strict"; ${b(he,de)}`),E(ee,de),ee.code(qe)}):ee.func(K,u._`${d.default.data}, ${y(de)}`,X.$async,()=>ee.code(b(he,de)).code(qe))}a(A,"mA");function y(ee){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${ee.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}a(y,"An");function E(ee,K){ee.if(d.default.valCxt,()=>{ee.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),ee.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),ee.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),ee.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),K.dynamicRef&&ee.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{ee.var(d.default.instancePath,u._`""`),ee.var(d.default.parentData,u._`undefined`),ee.var(d.default.parentDataProperty,u._`undefined`),ee.var(d.default.rootData,d.default.data),K.dynamicRef&&ee.var(d.default.dynamicAnchors,u._`{}`)})}a(E,"In");function _(ee){let{schema:K,opts:he,gen:X}=ee;A(ee,()=>{he.$comment&&K.$comment&&M(ee),L(ee),X.let(d.default.vErrors,null),X.let(d.default.errors,0),he.unevaluated&&v(ee),D(ee),O(ee)})}a(_,"Rn");function v(ee){let{gen:K,validateName:he}=ee;ee.evaluated=K.const("evaluated",u._`${he}.evaluated`),K.if(u._`${ee.evaluated}.dynamicProps`,()=>K.assign(u._`${ee.evaluated}.props`,u._`undefined`)),K.if(u._`${ee.evaluated}.dynamicItems`,()=>K.assign(u._`${ee.evaluated}.items`,u._`undefined`))}a(v,"Pn");function b(ee,K){let he=typeof ee=="object"&&ee[K.schemaId];return he&&(K.code.source||K.code.process)?u._`/*# sourceURL=${he} */`:u.nil}a(b,"fA");function T(ee,K){if(R(ee)&&(P(ee),w(ee))){x(ee,K);return}(0,e.boolOrEmptySchema)(ee,K)}a(T,"En");function w({schema:ee,self:K}){if(typeof ee=="boolean")return!ee;for(let he in ee)if(K.RULES.all[he])return!0;return!1}a(w,"lA");function R(ee){return typeof ee.schema!="boolean"}a(R,"cA");function x(ee,K){let{schema:he,gen:X,opts:de}=ee;de.$comment&&he.$comment&&M(ee),B(ee),j(ee);let qe=X.const("_errs",d.default.errors);D(ee,qe),X.var(K,u._`${qe} === ${d.default.errors}`)}a(x,"bn");function P(ee){(0,h.checkUnknownRules)(ee),N(ee)}a(P,"pA");function D(ee,K){if(ee.opts.jtd)return q(ee,[],!1,K);let he=(0,r.getSchemaTypes)(ee.schema),X=(0,r.coerceAndCheckDataType)(ee,he);q(ee,he,!X,K)}a(D,"dA");function N(ee){let{schema:K,errSchemaPath:he,opts:X,self:de}=ee;K.$ref&&X.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(K,de.RULES)&&de.logger.warn(`$ref: keywords ignored in schema at path "${he}"`)}a(N,"_n");function L(ee){let{schema:K,opts:he}=ee;K.default!==void 0&&he.useDefaults&&he.strictSchema&&(0,h.checkStrictMode)(ee,"default is ignored in the schema root")}a(L,"kn");function B(ee){let K=ee.schema[ee.opts.schemaId];K&&(ee.baseId=(0,f.resolveUrl)(ee.opts.uriResolver,ee.baseId,K))}a(B,"Sn");function j(ee){if(ee.schema.$async&&!ee.schemaEnv.$async)throw Error("async schema in sync schema")}a(j,"vn");function M({gen:ee,schemaEnv:K,schema:he,errSchemaPath:X,opts:de}){let qe=he.$comment;if(de.$comment===!0)ee.code(u._`${d.default.self}.logger.log(${qe})`);else if(typeof de.$comment=="function"){let ne=u.str`${X}/$comment`,ue=ee.scopeValue("root",{ref:K.root});ee.code(u._`${d.default.self}.opts.$comment(${qe}, ${ne}, ${ue}.schema)`)}}a(M,"iA");function O(ee){let{gen:K,schemaEnv:he,validateName:X,ValidationError:de,opts:qe}=ee;he.$async?K.if(u._`${d.default.errors} === 0`,()=>K.return(d.default.data),()=>K.throw(u._`new ${de}(${d.default.vErrors})`)):(K.assign(u._`${X}.errors`,d.default.vErrors),qe.unevaluated&&U(ee),K.return(u._`${d.default.errors} === 0`))}a(O,"Cn");function U({gen:ee,evaluated:K,props:he,items:X}){he instanceof u.Name&&ee.assign(u._`${K}.props`,he),X instanceof u.Name&&ee.assign(u._`${K}.items`,X)}a(U,"Tn");function q(ee,K,he,X){let{gen:de,schema:qe,data:ne,allErrors:ue,opts:Ne,self:Ie}=ee,{RULES:Be}=Ie;if(qe.$ref&&(Ne.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(qe,Be))){de.block(()=>ge(ee,"$ref",Be.all.$ref.definition));return}Ne.jtd||Y(ee,K),de.block(()=>{for(let st of Be.rules)tt(st);tt(Be.post)});function tt(st){(0,n.shouldUseGroup)(qe,st)&&(st.type?(de.if((0,o.checkDataType)(st.type,ne,Ne.strictNumbers)),Q(ee,st),K.length===1&&K[0]===st.type&&he&&(de.else(),(0,o.reportTypeError)(ee)),de.endIf()):Q(ee,st),ue||de.if(u._`${d.default.errors} === ${X||0}`))}a(tt,"B")}a(q,"gA");function Q(ee,K){let{gen:he,schema:X,opts:{useDefaults:de}}=ee;de&&(0,s.assignDefaults)(ee,K.type),he.block(()=>{for(let qe of K.rules)(0,n.shouldUseRule)(X,qe)&&ge(ee,qe.keyword,qe.definition,K.type)})}a(Q,"hA");function Y(ee,K){ee.schemaEnv.meta||!ee.opts.strictTypes||(W(ee,K),!ee.opts.allowUnionTypes&&V(ee,K),z(ee,ee.dataTypes))}a(Y,"xn");function W(ee,K){if(K.length){if(!ee.dataTypes.length){ee.dataTypes=K;return}K.forEach(he=>{H(ee.dataTypes,he)||le(ee,`type "${he}" not allowed by context "${ee.dataTypes.join(",")}"`)}),te(ee,K)}}a(W,"yn");function V(ee,K){K.length>1&&!(K.length===2&&K.includes("null"))&&le(ee,"use allowUnionTypes to allow union type keyword")}a(V,"fn");function z(ee,K){let he=ee.self.RULES.all;for(let X in he){let de=he[X];if(typeof de=="object"&&(0,n.shouldUseRule)(ee.schema,de)){let{type:qe}=de.definition;qe.length&&!qe.some(ne=>ie(K,ne))&&le(ee,`missing type "${qe.join(",")}" for keyword "${X}"`)}}}a(z,"gn");function ie(ee,K){return ee.includes(K)||K==="number"&&ee.includes("integer")}a(ie,"hn");function H(ee,K){return ee.includes(K)||K==="integer"&&ee.includes("number")}a(H,"nA");function te(ee,K){let he=[];for(let X of ee.dataTypes)H(K,X)?he.push(X):K.includes("integer")&&X==="number"&&he.push("integer");ee.dataTypes=he}a(te,"un");function le(ee,K){let he=ee.schemaEnv.baseId+ee.errSchemaPath;K+=` at "${he}" (strictTypes)`,(0,h.checkStrictMode)(ee,K,ee.opts.strictTypes)}a(le,"SB");class Le{static{a(this,"vB")}constructor(K,he,X){if((0,c.validateKeywordUsage)(K,he,X),this.gen=K.gen,this.allErrors=K.allErrors,this.keyword=X,this.data=K.data,this.schema=K.schema[X],this.$data=he.$data&&K.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(K,this.schema,X,this.$data),this.schemaType=he.schemaType,this.parentSchema=K.schema,this.params={},this.it=K,this.def=he,this.$data)this.schemaCode=K.gen.const("vSchema",re(this.$data,K));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,he.schemaType,he.allowUndefined))throw Error(`${X} value must be ${JSON.stringify(he.schemaType)}`);("code"in he?he.trackErrors:he.errors!==!1)&&(this.errsCount=K.gen.const("_errs",d.default.errors))}result(K,he,X){this.failResult((0,u.not)(K),he,X)}failResult(K,he,X){this.gen.if(K),X?X():this.error(),he?(this.gen.else(),he(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(K,he){this.failResult((0,u.not)(K),void 0,he)}fail(K){if(K===void 0){this.error(),!this.allErrors&&this.gen.if(!1);return}this.gen.if(K),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(K){if(!this.$data)return this.fail(K);let{schemaCode:he}=this;this.fail(u._`${he} !== undefined && (${(0,u.or)(this.invalid$data(),K)})`)}error(K,he,X){if(he){this.setParams(he),this._error(K,X),this.setParams({});return}this._error(K,X)}_error(K,he){(K?m.reportExtraError:m.reportError)(this,this.def.error,he)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(K){this.allErrors||this.gen.if(K)}setParams(K,he){he?Object.assign(this.params,K):this.params=K}block$data(K,he,X=u.nil){this.gen.block(()=>{this.check$data(K,X),he()})}check$data(K=u.nil,he=u.nil){if(!this.$data)return;let{gen:X,schemaCode:de,schemaType:qe,def:ne}=this;X.if((0,u.or)(u._`${de} === undefined`,he)),K!==u.nil&&X.assign(K,!0),(qe.length||ne.validateSchema)&&(X.elseIf(this.invalid$data()),this.$dataError(),K!==u.nil&&X.assign(K,!1)),X.else()}invalid$data(){let{gen:K,schemaCode:he,schemaType:X,def:de,it:qe}=this;return(0,u.or)(ne(),ue());function ne(){if(X.length){if(!(he instanceof u.Name))throw Error("ajv implementation error");let Ne=Array.isArray(X)?X:[X];return u._`${(0,o.checkDataTypes)(Ne,he,qe.opts.strictNumbers,o.DataType.Wrong)}`}return u.nil}function ue(){if(de.validateSchema){let Ne=K.scopeValue("validate$data",{ref:de.validateSchema});return u._`!${Ne}(${he})`}return u.nil}}subschema(K,he){let X=(0,l.getSubschema)(this.it,K);(0,l.extendSubschemaData)(X,this.it,K),(0,l.extendSubschemaMode)(X,K);let de={...this.it,...X,items:void 0,props:void 0};return T(de,he),de}mergeEvaluated(K,he){let{it:X,gen:de}=this;X.opts.unevaluated&&(X.props!==!0&&K.props!==void 0&&(X.props=h.mergeEvaluated.props(de,K.props,X.props,he)),X.items!==!0&&K.items!==void 0&&(X.items=h.mergeEvaluated.items(de,K.items,X.items,he)))}mergeValidEvaluated(K,he){let{it:X,gen:de}=this;if(X.opts.unevaluated&&(X.props!==!0||X.items!==!0))return de.if(he,()=>this.mergeEvaluated(K,u.Name)),!0}}t.KeywordCxt=Le;function ge(ee,K,he,X){let de=new Le(ee,he,K);"code"in he?he.code(de,X):de.$data&&he.validate?(0,c.funcKeywordCode)(de,he):"macro"in he?(0,c.macroKeywordCode)(de,he):(he.compile||he.validate)&&(0,c.funcKeywordCode)(de,he)}a(ge,"rA");var Oe=/^\/(?:[^~]|~0|~1)*$/,we=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function re(ee,{dataLevel:K,dataNames:he,dataPathArr:X}){let de,qe;if(ee==="")return d.default.rootData;if(ee[0]==="/"){if(!Oe.test(ee))throw Error(`Invalid JSON-pointer: ${ee}`);de=ee,qe=d.default.rootData}else{let Ie=we.exec(ee);if(!Ie)throw Error(`Invalid JSON-pointer: ${ee}`);let Be=+Ie[1];if(de=Ie[2],de==="#"){if(Be>=K)throw Error(Ne("property/index",Be));return X[K-Be]}if(Be>K)throw Error(Ne("data",Be));if(qe=he[K-Be],!de)return qe}let ne=qe,ue=de.split("/");for(let Ie of ue)Ie&&(qe=u._`${qe}${(0,u.getProperty)((0,h.unescapeJsonPointer)(Ie))}`,ne=u._`${ne} && ${qe}`);return ne;function Ne(Ie,Be){return`Cannot access ${Ie} ${Be} levels up, current level is ${K}`}}a(re,"oA"),t.getData=re}),x9r=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});class e extends Error{static{a(this,"sA")}constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}t.default=e}),Uwt=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Bwt();class r extends Error{static{a(this,"$I")}constructor(o,s,c,l){super(l||`can't resolve reference ${c} from id ${s}`),this.missingRef=(0,e.resolveUrl)(o,s,c),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(o,this.missingRef))}}t.default=r}),w9r=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;var e=Ns(),r=x9r(),n=TW(),o=Bwt(),s=gc(),c=Fwt();class l{static{a(this,"CJ")}constructor(v){var b;this.refs={},this.dynamicAnchors={};let T;typeof v.schema=="object"&&(T=v.schema),this.schema=v.schema,this.schemaId=v.schemaId,this.root=v.root||this,this.baseId=(b=v.baseId)!==null&&b!==void 0?b:(0,o.normalizeId)(T?.[v.schemaId||"$id"]),this.schemaPath=v.schemaPath,this.localRefs=v.localRefs,this.meta=v.meta,this.$async=T?.$async,this.refs={}}}t.SchemaEnv=l;function u(_){let v=h.call(this,_);if(v)return v;let b=(0,o.getFullPath)(this.opts.uriResolver,_.root.baseId),{es5:T,lines:w}=this.opts.code,{ownProperties:R}=this.opts,x=new e.CodeGen(this.scope,{es5:T,lines:w,ownProperties:R}),P;_.$async&&(P=x.scopeValue("Error",{ref:r.default,code:e._`require("ajv/dist/runtime/validation_error").default`}));let D=x.scopeName("validate");_.validateName=D;let N={gen:x,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:x.scopeValue("schema",this.opts.code.source===!0?{ref:_.schema,code:(0,e.stringify)(_.schema)}:{ref:_.schema}),validateName:D,ValidationError:P,schema:_.schema,schemaEnv:_,rootId:b,baseId:_.baseId||b,schemaPath:e.nil,errSchemaPath:_.schemaPath||(this.opts.jtd?"":"#"),errorPath:e._`""`,opts:this.opts,self:this},L;try{this._compilations.add(_),(0,c.validateFunctionCode)(N),x.optimize(this.opts.code.optimize);let B=x.toString();L=`${x.scopeRefs(n.default.scope)}return ${B}`,this.opts.code.process&&(L=this.opts.code.process(L,_));let j=Function(`${n.default.self}`,`${n.default.scope}`,L)(this,this.scope.get());if(this.scope.value(D,{ref:j}),j.errors=null,j.schema=_.schema,j.schemaEnv=_,_.$async&&(j.$async=!0),this.opts.code.source===!0&&(j.source={validateName:D,validateCode:B,scopeValues:x._values}),this.opts.unevaluated){let{props:M,items:O}=N;j.evaluated={props:M instanceof e.Name?void 0:M,items:O instanceof e.Name?void 0:O,dynamicProps:M instanceof e.Name,dynamicItems:O instanceof e.Name},j.source&&(j.source.evaluated=(0,e.stringify)(j.evaluated))}return _.validate=j,_}catch(B){throw delete _.validate,delete _.validateName,L&&this.logger.error("Error compiling schema, function code:",L),B}finally{this._compilations.delete(_)}}a(u,"xB"),t.compileSchema=u;function d(_,v,b){var T;b=(0,o.resolveUrl)(this.opts.uriResolver,v,b);let w=_.refs[b];if(w)return w;let R=g.call(this,_,b);if(R===void 0){let x=(T=_.localRefs)===null||T===void 0?void 0:T[b],{schemaId:P}=this.opts;x&&(R=new l({schema:x,schemaId:P,root:_,baseId:v}))}if(R!==void 0)return _.refs[b]=f.call(this,R)}a(d,"tn"),t.resolveRef=d;function f(_){return(0,o.inlineRef)(_.schema,this.opts.inlineRefs)?_.schema:_.validate?_:u.call(this,_)}a(f,"an");function h(_){for(let v of this._compilations)if(m(v,_))return v}a(h,"XI"),t.getCompilingSchema=h;function m(_,v){return _.schema===v.schema&&_.root===v.root&&_.baseId===v.baseId}a(m,"sn");function g(_,v){let b;for(;typeof(b=this.refs[v])=="string";)v=b;return b||this.schemas[v]||A.call(this,_,v)}a(g,"en");function A(_,v){let b=this.opts.uriResolver.parse(v),T=(0,o._getFullPath)(this.opts.uriResolver,b),w=(0,o.getFullPath)(this.opts.uriResolver,_.baseId,void 0);if(Object.keys(_.schema).length>0&&T===w)return E.call(this,b,_);let R=(0,o.normalizeId)(T),x=this.refs[R]||this.schemas[R];if(typeof x=="string"){let P=A.call(this,_,x);return typeof P?.schema!="object"?void 0:E.call(this,b,P)}if(typeof x?.schema=="object"){if(x.validate||u.call(this,x),R===(0,o.normalizeId)(v)){let{schema:P}=x,{schemaId:D}=this.opts,N=P[D];return N&&(w=(0,o.resolveUrl)(this.opts.uriResolver,w,N)),new l({schema:P,schemaId:D,root:_,baseId:w})}return E.call(this,b,x)}}a(A,"EW"),t.resolveSchema=A;var y=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function E(_,{baseId:v,schema:b,root:T}){var w;if(((w=_.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(let P of _.fragment.slice(1).split("/")){if(typeof b=="boolean")return;let D=b[(0,s.unescapeFragment)(P)];if(D===void 0)return;b=D;let N=typeof b=="object"&&b[this.opts.schemaId];!y.has(P)&&N&&(v=(0,o.resolveUrl)(this.opts.uriResolver,v,N))}let R;if(typeof b!="boolean"&&b.$ref&&!(0,s.schemaHasRulesButRef)(b,this.RULES)){let P=(0,o.resolveUrl)(this.opts.uriResolver,v,b.$ref);R=A.call(this,T,P)}let{schemaId:x}=this.opts;if(R=R||new l({schema:b,schemaId:x,root:T,baseId:v}),R.schema!==R.root.schema)return R}a(E,"TB")}),v7c=jt((t,e)=>{e.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),ZXi=jt((t,e)=>{var r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),n=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),o=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),s=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),c=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function l(x){let P="",D=0,N=0;for(N=0;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";P+=x[N];break}for(N+=1;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";P+=x[N]}return P}a(l,"fB");var u=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function d(x){return x.length=0,!0}a(d,"UI");function f(x,P,D){if(x.length){let N=l(x);if(N!=="")P.push(N);else return D.error=!0,!1;x.length=0}return!0}a(f,"Kr");function h(x){let P=0,D={error:!1,address:"",zone:""},N=[],L=[],B=!1,j=!1,M=f;for(let O=0;O7){D.error=!0;break}O>0&&x[O-1]===":"&&(B=!0),N.push(":");continue}else if(U==="%"){if(!M(L,N,D))break;M=d}else{L.push(U);continue}}return L.length&&(M===d?D.zone=L.join(""):j?N.push(L.join("")):N.push(l(L))),D.address=N.join(""),D}a(h,"qr");function m(x){if(g(x,":")<2)return{host:x,isIPV6:!1};let P=h(x);if(P.error)return{host:x,isIPV6:!1};{let{address:D,address:N}=P;return P.zone&&(D+="%"+P.zone,N+="%25"+P.zone),{host:D,isIPV6:!0,escapedHost:N}}}a(m,"qI");function g(x,P){let D=0;for(let N=0;Ny[N])}a(v,"VI");function b(x,P=!1){if(x.indexOf("%")===-1)return x;let D="";for(let N=0;N{var{isUUID:r}=ZXi(),n=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,o=["http","https","ws","wss","urn","urn:uuid"];function s(x){return o.indexOf(x)!==-1}a(s,"Ar");function c(x){return x.secure===!0?!0:x.secure===!1?!1:x.scheme?x.scheme.length===3&&(x.scheme[0]==="w"||x.scheme[0]==="W")&&(x.scheme[1]==="s"||x.scheme[1]==="S")&&(x.scheme[2]==="s"||x.scheme[2]==="S"):!1}a(c,"hB");function l(x){return x.host||(x.error=x.error||"HTTP URIs must have a host."),x}a(l,"zI");function u(x){let P=String(x.scheme).toLowerCase()==="https";return(x.port===(P?443:80)||x.port==="")&&(x.port=void 0),x.path||(x.path="/"),x}a(u,"NI");function d(x){return x.secure=c(x),x.resourceName=(x.path||"/")+(x.query?"?"+x.query:""),x.path=void 0,x.query=void 0,x}a(d,"Ir");function f(x){if((x.port===(c(x)?443:80)||x.port==="")&&(x.port=void 0),typeof x.secure=="boolean"&&(x.scheme=x.secure?"wss":"ws",x.secure=void 0),x.resourceName){let[P,D]=x.resourceName.split("?");x.path=P&&P!=="/"?P:void 0,x.query=D,x.resourceName=void 0}return x.fragment=void 0,x}a(f,"Rr");function h(x,P){if(!x.path)return x.error="URN can not be parsed",x;let D=x.path.match(n);if(D){let N=P.scheme||x.scheme||"urn";x.nid=D[1].toLowerCase(),x.nss=D[2];let L=`${N}:${P.nid||x.nid}`,B=R(L);x.path=void 0,B&&(x=B.parse(x,P))}else x.error=x.error||"URN can not be parsed.";return x}a(h,"Pr");function m(x,P){if(x.nid===void 0)throw Error("URN without nid cannot be serialized");let D=P.scheme||x.scheme||"urn",N=x.nid.toLowerCase(),L=`${D}:${P.nid||N}`,B=R(L);B&&(x=B.serialize(x,P));let j=x,M=x.nss;return j.path=`${N||P.nid}:${M}`,P.skipEscape=!0,j}a(m,"Er");function g(x,P){let D=x;return D.uuid=D.nss,D.nss=void 0,!P.tolerant&&(!D.uuid||!r(D.uuid))&&(D.error=D.error||"UUID is not valid."),D}a(g,"br");function A(x){let P=x;return P.nss=(x.uuid||"").toLowerCase(),P}a(A,"_r");var y={scheme:"http",domainHost:!0,parse:l,serialize:u},E={scheme:"https",domainHost:y.domainHost,parse:l,serialize:u},_={scheme:"ws",domainHost:!0,parse:d,serialize:f},v={scheme:"wss",domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},b={scheme:"urn",parse:h,serialize:m,skipNormalize:!0},T={scheme:"urn:uuid",parse:g,serialize:A,skipNormalize:!0},w={http:y,https:E,ws:_,wss:v,urn:b,"urn:uuid":T};Object.setPrototypeOf(w,null);function R(x){return x&&(w[x]||w[x.toLowerCase()])||void 0}a(R,"uB"),e.exports={wsIsSecure:c,SCHEMES:w,isValidSchemeName:s,getSchemeHandler:R}}),b7c=jt((t,e)=>{var{normalizeIPv6:r,removeDotSegments:n,recomposeAuthority:o,normalizePercentEncoding:s,normalizePathEncoding:c,escapePreservingEscapes:l,reescapeHostDelimiters:u,isIPv4:d,nonSimpleDomain:f}=ZXi(),{SCHEMES:h,getSchemeHandler:m}=C7c();function g(N,L){return typeof N=="string"?N=R(N,L):typeof N=="object"&&(N=w(_(N,L),L)),N}a(g,"cr");function A(N,L,B){let j=B?Object.assign({scheme:"null"},B):{scheme:"null"},M=y(w(N,j),w(L,j),j,!0);return j.skipEscape=!0,_(M,j)}a(A,"pr");function y(N,L,B,j){let M={};return j||(N=w(_(N,B),B),L=w(_(L,B),B)),B=B||{},!B.tolerant&&L.scheme?(M.scheme=L.scheme,M.userinfo=L.userinfo,M.host=L.host,M.port=L.port,M.path=n(L.path||""),M.query=L.query):(L.userinfo!==void 0||L.host!==void 0||L.port!==void 0?(M.userinfo=L.userinfo,M.host=L.host,M.port=L.port,M.path=n(L.path||""),M.query=L.query):(L.path?(L.path[0]==="/"?M.path=n(L.path):((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path?M.path="/"+L.path:N.path?M.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+L.path:M.path=L.path,M.path=n(M.path)),M.query=L.query):(M.path=N.path,L.query!==void 0?M.query=L.query:M.query=N.query),M.userinfo=N.userinfo,M.host=N.host,M.port=N.port),M.scheme=N.scheme),M.fragment=L.fragment,M}a(y,"MI");function E(N,L,B){let j=P(N,B),M=P(L,B);return j!==void 0&&M!==void 0&&j.toLowerCase()===M.toLowerCase()}a(E,"dr");function _(N,L){let B={host:N.host,scheme:N.scheme,userinfo:N.userinfo,port:N.port,path:N.path,query:N.query,nid:N.nid,nss:N.nss,uuid:N.uuid,fragment:N.fragment,reference:N.reference,resourceName:N.resourceName,secure:N.secure,error:""},j=Object.assign({},L),M=[],O=m(j.scheme||B.scheme);O&&O.serialize&&O.serialize(B,j),B.path!==void 0&&(j.skipEscape?B.path=s(B.path):(B.path=l(B.path),B.scheme!==void 0&&(B.path=B.path.split("%3A").join(":")))),j.reference!=="suffix"&&B.scheme&&M.push(B.scheme,":");let U=o(B);if(U!==void 0&&(j.reference!=="suffix"&&M.push("//"),M.push(U),B.path&&B.path[0]!=="/"&&M.push("/")),B.path!==void 0){let q=B.path;!j.absolutePath&&(!O||!O.absolutePath)&&(q=n(q)),U===void 0&&q[0]==="/"&&q[1]==="/"&&(q="/%2F"+q.slice(2)),M.push(q)}return B.query!==void 0&&M.push("?",B.query),B.fragment!==void 0&&M.push("#",B.fragment),M.join("")}a(_,"y0");var v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(N,L){if(L[2]!==void 0&&N.path&&N.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof N.port=="number"&&(N.port<0||N.port>65535))return"URI port is malformed."}a(b,"nr");function T(N,L){let B=Object.assign({},L),j={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},M=!1,O=!1;B.reference==="suffix"&&(B.scheme?N=B.scheme+":"+N:N="//"+N);let U=N.match(v);if(U){j.scheme=U[1],j.userinfo=U[3],j.host=U[4],j.port=parseInt(U[5],10),j.path=U[6]||"",j.query=U[7],j.fragment=U[8],isNaN(j.port)&&(j.port=U[5]);let q=b(j,U);if(q!==void 0&&(j.error=j.error||q,M=!0),j.host)if(d(j.host)===!1){let Y=r(j.host);j.host=Y.host.toLowerCase(),O=Y.isIPV6}else O=!0;j.scheme===void 0&&j.userinfo===void 0&&j.host===void 0&&j.port===void 0&&j.query===void 0&&!j.path?j.reference="same-document":j.scheme===void 0?j.reference="relative":j.fragment===void 0?j.reference="absolute":j.reference="uri",B.reference&&B.reference!=="suffix"&&B.reference!==j.reference&&(j.error=j.error||"URI is not a "+B.reference+" reference.");let Q=m(B.scheme||j.scheme);if(!B.unicodeSupport&&(!Q||!Q.unicodeSupport)&&j.host&&(B.domainHost||Q&&Q.domainHost)&&O===!1&&f(j.host))try{j.host=URL.domainToASCII(j.host.toLowerCase())}catch(Y){j.error=j.error||"Host's domain name can not be converted to ASCII: "+Y}if((!Q||Q&&!Q.skipNormalize)&&(N.indexOf("%")!==-1&&(j.scheme!==void 0&&(j.scheme=unescape(j.scheme)),j.host!==void 0&&(j.host=u(unescape(j.host),O))),j.path&&(j.path=c(j.path)),j.fragment))try{j.fragment=encodeURI(decodeURIComponent(j.fragment))}catch{j.error=j.error||"URI malformed"}Q&&Q.parse&&Q.parse(j,B)}else j.error=j.error||"URI can not be parsed.";return{parsed:j,malformedAuthorityOrPort:M}}a(T,"LI");function w(N,L){return T(N,L).parsed}a(w,"w9");function R(N,L){return x(N,L).normalized}a(R,"rr");function x(N,L){let{parsed:B,malformedAuthorityOrPort:j}=T(N,L);return{normalized:j?N:_(B,L),malformedAuthorityOrPort:j}}a(x,"jI");function P(N,L){if(typeof N=="string"){let{normalized:B,malformedAuthorityOrPort:j}=x(N,L);return j?void 0:B}if(typeof N=="object")return _(N,L)}a(P,"FI");var D={SCHEMES:h,normalize:g,resolve:A,resolveComponent:y,equal:E,serialize:_,parse:w};e.exports=D,e.exports.default=D,e.exports.fastUri=D}),S7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=b7c();e.code='require("ajv/dist/runtime/uri").default',t.default=e}),T7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=Fwt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return e.KeywordCxt},"get")});var r=Ns();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return r._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return r.str},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return r.stringify},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return r.nil},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return r.Name},"get")}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:a(function(){return r.CodeGen},"get")});var n=x9r(),o=Uwt(),s=YXi(),c=w9r(),l=Ns(),u=Bwt(),d=mxt(),f=gc(),h=v7c(),m=S7c(),g=a((W,V)=>new RegExp(W,V),"vI");g.code="new RegExp";var A=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),E={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function b(W){var V,z,ie,H,te,le,Le,ge,Oe,we,re,ee,K,he,X,de,qe,ne,ue,Ne,Ie,Be,tt,st,_t;let kt=W.strict,Ht=(V=W.code)===null||V===void 0?void 0:V.optimize,F=Ht===!0||Ht===void 0?1:Ht||0,se=(ie=(z=W.code)===null||z===void 0?void 0:z.regExp)!==null&&ie!==void 0?ie:g,be=(H=W.uriResolver)!==null&&H!==void 0?H:m.default;return{strictSchema:(le=(te=W.strictSchema)!==null&&te!==void 0?te:kt)!==null&&le!==void 0?le:!0,strictNumbers:(ge=(Le=W.strictNumbers)!==null&&Le!==void 0?Le:kt)!==null&&ge!==void 0?ge:!0,strictTypes:(we=(Oe=W.strictTypes)!==null&&Oe!==void 0?Oe:kt)!==null&&we!==void 0?we:"log",strictTuples:(ee=(re=W.strictTuples)!==null&&re!==void 0?re:kt)!==null&&ee!==void 0?ee:"log",strictRequired:(he=(K=W.strictRequired)!==null&&K!==void 0?K:kt)!==null&&he!==void 0?he:!1,code:W.code?{...W.code,optimize:F,regExp:se}:{optimize:F,regExp:se},loopRequired:(X=W.loopRequired)!==null&&X!==void 0?X:v,loopEnum:(de=W.loopEnum)!==null&&de!==void 0?de:v,meta:(qe=W.meta)!==null&&qe!==void 0?qe:!0,messages:(ne=W.messages)!==null&&ne!==void 0?ne:!0,inlineRefs:(ue=W.inlineRefs)!==null&&ue!==void 0?ue:!0,schemaId:(Ne=W.schemaId)!==null&&Ne!==void 0?Ne:"$id",addUsedSchema:(Ie=W.addUsedSchema)!==null&&Ie!==void 0?Ie:!0,validateSchema:(Be=W.validateSchema)!==null&&Be!==void 0?Be:!0,validateFormats:(tt=W.validateFormats)!==null&&tt!==void 0?tt:!0,unicodeRegExp:(st=W.unicodeRegExp)!==null&&st!==void 0?st:!0,int32range:(_t=W.int32range)!==null&&_t!==void 0?_t:!0,uriResolver:be}}a(b,"Wo");class T{static{a(this,"CW")}constructor(V={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,V=this.opts={...V,...b(V)};let{es5:z,lines:ie}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:z,lines:ie}),this.logger=B(V.logger);let H=V.validateFormats;V.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,E,V,"NOT SUPPORTED"),w.call(this,_,V,"DEPRECATED","warn"),this._metaOpts=N.call(this),V.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),V.keywords&&D.call(this,V.keywords),typeof V.meta=="object"&&this.addMetaSchema(V.meta),x.call(this),V.validateFormats=H}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:V,meta:z,schemaId:ie}=this.opts,H=h;ie==="id"&&(H={...h},H.id=H.$id,delete H.$id),z&&V&&this.addMetaSchema(H,H[ie],!1)}defaultMeta(){let{meta:V,schemaId:z}=this.opts;return this.opts.defaultMeta=typeof V=="object"?V[z]||V:void 0}validate(V,z){let ie;if(typeof V=="string"){if(ie=this.getSchema(V),!ie)throw Error(`no schema with key or ref "${V}"`)}else ie=this.compile(V);let H=ie(z);return"$async"in ie||(this.errors=ie.errors),H}compile(V,z){let ie=this._addSchema(V,z);return ie.validate||this._compileSchemaEnv(ie)}compileAsync(V,z){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:ie}=this.opts;return H.call(this,V,z);async function H(we,re){await te.call(this,we.$schema);let ee=this._addSchema(we,re);return ee.validate||le.call(this,ee)}async function te(we){we&&!this.getSchema(we)&&await H.call(this,{$ref:we},!0)}async function le(we){try{return this._compileSchemaEnv(we)}catch(re){if(!(re instanceof o.default))throw re;return Le.call(this,re),await ge.call(this,re.missingSchema),le.call(this,we)}}function Le({missingSchema:we,missingRef:re}){if(this.refs[we])throw Error(`AnySchema ${we} is loaded but ${re} cannot be resolved`)}async function ge(we){let re=await Oe.call(this,we);this.refs[we]||await te.call(this,re.$schema),this.refs[we]||this.addSchema(re,we,z)}async function Oe(we){let re=this._loading[we];if(re)return re;try{return await(this._loading[we]=ie(we))}finally{delete this._loading[we]}}}addSchema(V,z,ie,H=this.opts.validateSchema){if(Array.isArray(V)){for(let le of V)this.addSchema(le,void 0,ie,H);return this}let te;if(typeof V=="object"){let{schemaId:le}=this.opts;if(te=V[le],te!==void 0&&typeof te!="string")throw Error(`schema ${le} must be string`)}return z=(0,u.normalizeId)(z||te),this._checkUnique(z),this.schemas[z]=this._addSchema(V,ie,z,H,!0),this}addMetaSchema(V,z,ie=this.opts.validateSchema){return this.addSchema(V,z,!0,ie),this}validateSchema(V,z){if(typeof V=="boolean")return!0;let ie;if(ie=V.$schema,ie!==void 0&&typeof ie!="string")throw Error("$schema must be a string");if(ie=ie||this.opts.defaultMeta||this.defaultMeta(),!ie)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let H=this.validate(ie,V);if(!H&&z){let te="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(te);else throw Error(te)}return H}getSchema(V){let z;for(;typeof(z=R.call(this,V))=="string";)V=z;if(z===void 0){let{schemaId:ie}=this.opts,H=new c.SchemaEnv({schema:{},schemaId:ie});if(z=c.resolveSchema.call(this,H,V),!z)return;this.refs[V]=z}return z.validate||this._compileSchemaEnv(z)}removeSchema(V){if(V instanceof RegExp)return this._removeAllSchemas(this.schemas,V),this._removeAllSchemas(this.refs,V),this;switch(typeof V){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let z=R.call(this,V);return typeof z=="object"&&this._cache.delete(z.schema),delete this.schemas[V],delete this.refs[V],this}case"object":{let z=V;this._cache.delete(z);let ie=V[this.opts.schemaId];return ie&&(ie=(0,u.normalizeId)(ie),delete this.schemas[ie],delete this.refs[ie]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(V){for(let z of V)this.addKeyword(z);return this}addKeyword(V,z){let ie;if(typeof V=="string")ie=V,typeof z=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),z.keyword=ie);else if(typeof V=="object"&&z===void 0){if(z=V,ie=z.keyword,Array.isArray(ie)&&!ie.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(M.call(this,ie,z),!z)return(0,f.eachItem)(ie,te=>O.call(this,te)),this;q.call(this,z);let H={...z,type:(0,d.getJSONTypes)(z.type),schemaType:(0,d.getJSONTypes)(z.schemaType)};return(0,f.eachItem)(ie,H.type.length===0?te=>O.call(this,te,H):te=>H.type.forEach(le=>O.call(this,te,H,le))),this}getKeyword(V){let z=this.RULES.all[V];return typeof z=="object"?z.definition:!!z}removeKeyword(V){let{RULES:z}=this;delete z.keywords[V],delete z.all[V];for(let ie of z.rules){let H=ie.rules.findIndex(te=>te.keyword===V);H>=0&&ie.rules.splice(H,1)}return this}addFormat(V,z){return typeof z=="string"&&(z=new RegExp(z)),this.formats[V]=z,this}errorsText(V=this.errors,{separator:z=", ",dataVar:ie="data"}={}){return!V||V.length===0?"No errors":V.map(H=>`${ie}${H.instancePath} ${H.message}`).reduce((H,te)=>H+z+te)}$dataMetaSchema(V,z){let ie=this.RULES.all;V=JSON.parse(JSON.stringify(V));for(let H of z){let te=H.split("/").slice(1),le=V;for(let Le of te)le=le[Le];for(let Le in ie){let ge=ie[Le];if(typeof ge!="object")continue;let{$data:Oe}=ge.definition,we=le[Le];Oe&&we&&(le[Le]=Y(we))}}return V}_removeAllSchemas(V,z){for(let ie in V){let H=V[ie];(!z||z.test(ie))&&(typeof H=="string"?delete V[ie]:H&&!H.meta&&(this._cache.delete(H.schema),delete V[ie]))}}_addSchema(V,z,ie,H=this.opts.validateSchema,te=this.opts.addUsedSchema){let le,{schemaId:Le}=this.opts;if(typeof V=="object")le=V[Le];else{if(this.opts.jtd)throw Error("schema must be object");if(typeof V!="boolean")throw Error("schema must be object or boolean")}let ge=this._cache.get(V);if(ge!==void 0)return ge;ie=(0,u.normalizeId)(le||ie);let Oe=u.getSchemaRefs.call(this,V,ie);return ge=new c.SchemaEnv({schema:V,schemaId:Le,meta:z,baseId:ie,localRefs:Oe}),this._cache.set(ge.schema,ge),te&&!ie.startsWith("#")&&(ie&&this._checkUnique(ie),this.refs[ie]=ge),H&&this.validateSchema(V,!0),ge}_checkUnique(V){if(this.schemas[V]||this.refs[V])throw Error(`schema with key or id "${V}" already exists`)}_compileSchemaEnv(V){if(V.meta?this._compileMetaSchema(V):c.compileSchema.call(this,V),!V.validate)throw Error("ajv implementation error");return V.validate}_compileMetaSchema(V){let z=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,V)}finally{this.opts=z}}}T.ValidationError=n.default,T.MissingRefError=o.default,t.default=T;function w(W,V,z,ie="error"){for(let H in W){let te=H;te in V&&this.logger[ie](`${z}: option ${H}. ${W[te]}`)}}a(w,"_I");function R(W){return W=(0,u.normalizeId)(W),this.schemas[W]||this.refs[W]}a(R,"kI");function x(){let W=this.opts.schemas;if(W)if(Array.isArray(W))this.addSchema(W);else for(let V in W)this.addSchema(W[V],V)}a(x,"Go");function P(){for(let W in this.opts.formats){let V=this.opts.formats[W];V&&this.addFormat(W,V)}}a(P,"Uo");function D(W){if(Array.isArray(W)){this.addVocabulary(W);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let V in W){let z=W[V];z.keyword||(z.keyword=V),this.addKeyword(z)}}a(D,"Ho");function N(){let W={...this.opts};for(let V of A)delete W[V];return W}a(N,"Ko");var L={log(){},warn(){},error(){}};function B(W){if(W===!1)return L;if(W===void 0)return console;if(W.log&&W.warn&&W.error)return W;throw Error("logger must implement log, warn and error methods")}a(B,"Vo");var j=/^[a-z_$][a-z0-9_$:-]*$/i;function M(W,V){let{RULES:z}=this;if((0,f.eachItem)(W,ie=>{if(z.keywords[ie])throw Error(`Keyword ${ie} is already defined`);if(!j.test(ie))throw Error(`Keyword ${ie} has invalid name`)}),!!V&&V.$data&&!("code"in V||"validate"in V))throw Error('$data keyword must have "code" or "validate" function')}a(M,"zo");function O(W,V,z){var ie;let H=V?.post;if(z&&H)throw Error('keyword with "post" flag cannot have "type"');let{RULES:te}=this,le=H?te.post:te.rules.find(({type:ge})=>ge===z);if(le||(le={type:z,rules:[]},te.rules.push(le)),te.keywords[W]=!0,!V)return;let Le={keyword:W,definition:{...V,type:(0,d.getJSONTypes)(V.type),schemaType:(0,d.getJSONTypes)(V.schemaType)}};V.before?U.call(this,le,Le,V.before):le.rules.push(Le),te.all[W]=Le,(ie=V.implements)===null||ie===void 0||ie.forEach(ge=>this.addKeyword(ge))}a(O,"lB");function U(W,V,z){let ie=W.rules.findIndex(H=>H.keyword===z);ie>=0?W.rules.splice(ie,0,V):(W.rules.push(V),this.logger.warn(`rule ${z} is not defined`))}a(U,"No");function q(W){let{metaSchema:V}=W;V!==void 0&&(W.$data&&this.opts.$data&&(V=Y(V)),W.validateSchema=this.compile(V,!0))}a(q,"wo");var Q={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Y(W){return{anyOf:[W,Q]}}a(Y,"CI")}),I7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=e}),x7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;var e=Uwt(),r=JN(),n=Ns(),o=TW(),s=w9r(),c=gc(),l={keyword:"$ref",schemaType:"string",code(f){let{gen:h,schema:m,it:g}=f,{baseId:A,schemaEnv:y,validateName:E,opts:_,self:v}=g,{root:b}=y;if((m==="#"||m==="#/")&&A===b.baseId)return w();let T=s.resolveRef.call(v,b,A,m);if(T===void 0)throw new e.default(g.opts.uriResolver,A,m);if(T instanceof s.SchemaEnv)return R(T);return x(T);function w(){if(y===b)return d(f,E,y,y.$async);let P=h.scopeValue("root",{ref:b});return d(f,n._`${P}.validate`,b,b.$async)}function R(P){let D=u(f,P);d(f,D,P,P.$async)}function x(P){let D=h.scopeValue("schema",_.code.source===!0?{ref:P,code:(0,n.stringify)(P)}:{ref:P}),N=h.name("valid"),L=f.subschema({schema:P,dataTypes:[],schemaPath:n.nil,topSchemaRef:D,errSchemaPath:m},N);f.mergeEvaluated(L),f.ok(N)}}};function u(f,h){let{gen:m}=f;return h.validate?m.scopeValue("validate",{ref:h.validate}):n._`${m.scopeValue("wrapper",{ref:h})}.validate`}a(u,"hI"),t.getValidate=u;function d(f,h,m,g){let{gen:A,it:y}=f,{allErrors:E,schemaEnv:_,opts:v}=y,b=v.passContext?o.default.this:n.nil;g?T():w();function T(){if(!_.$async)throw Error("async schema referenced by sync schema");let P=A.let("valid");A.try(()=>{A.code(n._`await ${(0,r.callValidateCode)(f,h,b)}`),x(h),!E&&A.assign(P,!0)},D=>{A.if(n._`!(${D} instanceof ${y.ValidationError})`,()=>A.throw(D)),R(D),!E&&A.assign(P,!1)}),f.ok(P)}a(T,"V");function w(){f.result((0,r.callValidateCode)(f,h,b),()=>x(h),()=>R(h))}a(w,"B");function R(P){let D=n._`${P}.errors`;A.assign(o.default.vErrors,n._`${o.default.vErrors} === null ? ${D} : ${o.default.vErrors}.concat(${D})`),A.assign(o.default.errors,n._`${o.default.vErrors}.length`)}a(R,"z");function x(P){var D;if(!y.opts.unevaluated)return;let N=(D=m?.validate)===null||D===void 0?void 0:D.evaluated;if(y.props!==!0)if(N&&!N.dynamicProps)N.props!==void 0&&(y.props=c.mergeEvaluated.props(A,N.props,y.props));else{let L=A.var("props",n._`${P}.evaluated.props`);y.props=c.mergeEvaluated.props(A,L,y.props,n.Name)}if(y.items!==!0)if(N&&!N.dynamicItems)N.items!==void 0&&(y.items=c.mergeEvaluated.items(A,N.items,y.items));else{let L=A.var("items",n._`${P}.evaluated.items`);y.items=c.mergeEvaluated.items(A,L,y.items,n.Name)}}a(x,"N")}a(d,"xW"),t.callRef=d,t.default=l}),w7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=I7c(),r=x7c(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,r.default];t.default=n}),R7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=e.operators,n={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},o={message:a(({keyword:c,schemaCode:l})=>e.str`must be ${n[c].okStr} ${l}`,"message"),params:a(({keyword:c,schemaCode:l})=>e._`{comparison: ${n[c].okStr}, limit: ${l}}`,"params")},s={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:o,code(c){let{keyword:l,data:u,schemaCode:d}=c;c.fail$data(e._`${u} ${n[l].fail} ${d} || isNaN(${u})`)}};t.default=s}),k7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r={message:a(({schemaCode:o})=>e.str`must be multiple of ${o}`,"message"),params:a(({schemaCode:o})=>e._`{multipleOf: ${o}}`,"params")},n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:r,code(o){let{gen:s,data:c,schemaCode:l,it:u}=o,d=u.opts.multipleOfPrecision,f=s.let("res"),h=d?e._`Math.abs(Math.round(${f}) - ${f}) > 1e-${d}`:e._`${f} !== parseInt(${f})`;o.fail$data(e._`(${l} === 0 || (${f} = ${c}/${l}, ${h}))`)}};t.default=n}),P7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});function e(r){let n=r.length,o=0,s=0,c;for(;s=55296&&c<=56319&&s{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=gc(),n=P7c(),o={message({keyword:c,schemaCode:l}){let u=c==="maxLength"?"more":"fewer";return e.str`must NOT have ${u} than ${l} characters`},params:a(({schemaCode:c})=>e._`{limit: ${c}}`,"params")},s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:o,code(c){let{keyword:l,data:u,schemaCode:d,it:f}=c,h=l==="maxLength"?e.operators.GT:e.operators.LT,m=f.opts.unicode===!1?e._`${u}.length`:e._`${(0,r.useFunc)(c.gen,n.default)}(${u})`;c.fail$data(e._`${m} ${h} ${d}`)}};t.default=s}),N7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=JN(),r=gc(),n=Ns(),o={message:a(({schemaCode:c})=>n.str`must match pattern "${c}"`,"message"),params:a(({schemaCode:c})=>n._`{pattern: ${c}}`,"params")},s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schema:f,schemaCode:h,it:m}=c,g=m.opts.unicodeRegExp?"u":"";if(d){let{regExp:A}=m.opts.code,y=A.code==="new RegExp"?n._`new RegExp`:(0,r.useFunc)(l,A),E=l.let("valid");l.try(()=>l.assign(E,n._`${y}(${h}, ${g}).test(${u})`),()=>l.assign(E,!1)),c.fail$data(n._`!${E}`)}else{let A=(0,e.usePattern)(c,f);c.fail$data(n._`!${A}.test(${u})`)}}};t.default=s}),M7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r={message({keyword:o,schemaCode:s}){let c=o==="maxProperties"?"more":"fewer";return e.str`must NOT have ${c} than ${s} properties`},params:a(({schemaCode:o})=>e._`{limit: ${o}}`,"params")},n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:r,code(o){let{keyword:s,data:c,schemaCode:l}=o,u=s==="maxProperties"?e.operators.GT:e.operators.LT;o.fail$data(e._`Object.keys(${c}).length ${u} ${l}`)}};t.default=n}),O7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=JN(),r=Ns(),n=gc(),o={message:a(({params:{missingProperty:c}})=>r.str`must have required property '${c}'`,"message"),params:a(({params:{missingProperty:c}})=>r._`{missingProperty: ${c}}`,"params")},s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:o,code(c){let{gen:l,schema:u,schemaCode:d,data:f,$data:h,it:m}=c,{opts:g}=m;if(!h&&u.length===0)return;let A=u.length>=g.loopRequired;if(m.allErrors?y():E(),g.strictRequired){let b=c.parentSchema.properties,{definedProperties:T}=c.it;for(let w of u)if(b?.[w]===void 0&&!T.has(w)){let R=m.schemaEnv.baseId+m.errSchemaPath,x=`required property "${w}" is not defined at "${R}" (strictRequired)`;(0,n.checkStrictMode)(m,x,m.opts.strictRequired)}}function y(){if(A||h)c.block$data(r.nil,_);else for(let b of u)(0,e.checkReportMissingProp)(c,b)}a(y,"q");function E(){let b=l.let("missing");if(A||h){let T=l.let("valid",!0);c.block$data(T,()=>v(b,T)),c.ok(T)}else l.if((0,e.checkMissingProp)(c,u,b)),(0,e.reportMissingProp)(c,b),l.else()}a(E,"V");function _(){l.forOf("prop",d,b=>{c.setParams({missingProperty:b}),l.if((0,e.noPropertyInData)(l,f,b,g.ownProperties),()=>c.error())})}a(_,"B");function v(b,T){c.setParams({missingProperty:b}),l.forOf(b,d,()=>{l.assign(T,(0,e.propertyInData)(l,f,b,g.ownProperties)),l.if((0,r.not)(T),()=>{c.error(),l.break()})},r.nil)}a(v,"z")}};t.default=s}),L7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r={message({keyword:o,schemaCode:s}){let c=o==="maxItems"?"more":"fewer";return e.str`must NOT have ${c} than ${s} items`},params:a(({schemaCode:o})=>e._`{limit: ${o}}`,"params")},n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:r,code(o){let{keyword:s,data:c,schemaCode:l}=o,u=s==="maxItems"?e.operators.GT:e.operators.LT;o.fail$data(e._`${c}.length ${u} ${l}`)}};t.default=n}),R9r=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=JXi();e.code='require("ajv/dist/runtime/equal").default',t.default=e}),B7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mxt(),r=Ns(),n=gc(),o=R9r(),s={message:a(({params:{i:l,j:u}})=>r.str`must NOT have duplicate items (items ## ${u} and ${l} are identical)`,"message"),params:a(({params:{i:l,j:u}})=>r._`{i: ${l}, j: ${u}}`,"params")},c={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:s,code(l){let{gen:u,data:d,$data:f,schema:h,parentSchema:m,schemaCode:g,it:A}=l;if(!f&&!h)return;let y=u.let("valid"),E=m.items?(0,e.getSchemaTypes)(m.items):[];l.block$data(y,_,r._`${g} === false`),l.ok(y);function _(){let w=u.let("i",r._`${d}.length`),R=u.let("j");l.setParams({i:w,j:R}),u.assign(y,!0),u.if(r._`${w} > 1`,()=>(v()?b:T)(w,R))}a(_,"V");function v(){return E.length>0&&!E.some(w=>w==="object"||w==="array")}a(v,"B");function b(w,R){let x=u.name("item"),P=(0,e.checkDataTypes)(E,x,A.opts.strictNumbers,e.DataType.Wrong),D=u.const("indices",r._`{}`);u.for(r._`;${w}--;`,()=>{u.let(x,r._`${d}[${w}]`),u.if(P,r._`continue`),E.length>1&&u.if(r._`typeof ${x} == "string"`,r._`${x} += "_"`),u.if(r._`typeof ${D}[${x}] == "number"`,()=>{u.assign(R,r._`${D}[${x}]`),l.error(),u.assign(y,!1).break()}).code(r._`${D}[${x}] = ${w}`)})}a(b,"z");function T(w,R){let x=(0,n.useFunc)(u,o.default),P=u.name("outer");u.label(P).for(r._`;${w}--;`,()=>u.for(r._`${R} = ${w}; ${R}--;`,()=>u.if(r._`${x}(${d}[${w}], ${d}[${R}])`,()=>{l.error(),u.assign(y,!1).break(P)})))}a(T,"N")}};t.default=c}),F7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=gc(),n=R9r(),o={message:"must be equal to constant",params:a(({schemaCode:c})=>e._`{allowedValue: ${c}}`,"params")},s={keyword:"const",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schemaCode:f,schema:h}=c;d||h&&typeof h=="object"?c.fail$data(e._`!${(0,r.useFunc)(l,n.default)}(${u}, ${f})`):c.fail(e._`${h} !== ${u}`)}};t.default=s}),U7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=gc(),n=R9r(),o={message:"must be equal to one of the allowed values",params:a(({schemaCode:c})=>e._`{allowedValues: ${c}}`,"params")},s={keyword:"enum",schemaType:"array",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schema:f,schemaCode:h,it:m}=c;if(!d&&f.length===0)throw Error("enum must have non-empty array");let g=f.length>=m.opts.loopEnum,A,y=a(()=>A??(A=(0,r.useFunc)(l,n.default)),"q"),E;if(g||d)E=l.let("valid"),c.block$data(E,_);else{if(!Array.isArray(f))throw Error("ajv implementation error");let b=l.const("vSchema",h);E=(0,e.or)(...f.map((T,w)=>v(b,w)))}c.pass(E);function _(){l.assign(E,!1),l.forOf("v",h,b=>l.if(e._`${y()}(${u}, ${b})`,()=>l.assign(E,!0).break()))}a(_,"B");function v(b,T){let w=f[T];return typeof w=="object"&&w!==null?e._`${y()}(${u}, ${b}[${T}])`:e._`${u} === ${w}`}a(v,"z")}};t.default=s}),Q7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=R7c(),r=k7c(),n=D7c(),o=N7c(),s=M7c(),c=O7c(),l=L7c(),u=B7c(),d=F7c(),f=U7c(),h=[e.default,r.default,n.default,o.default,s.default,c.default,l.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,f.default];t.default=h}),XXi=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;var e=Ns(),r=gc(),n={message:a(({params:{len:c}})=>e.str`must NOT have more than ${c} items`,"message"),params:a(({params:{len:c}})=>e._`{limit: ${c}}`,"params")},o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:n,code(c){let{parentSchema:l,it:u}=c,{items:d}=l;if(!Array.isArray(d)){(0,r.checkStrictMode)(u,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(c,d)}};function s(c,l){let{gen:u,schema:d,data:f,keyword:h,it:m}=c;m.items=!0;let g=u.const("len",e._`${f}.length`);if(d===!1)c.setParams({len:l.length}),c.pass(e._`${g} <= ${l.length}`);else if(typeof d=="object"&&!(0,r.alwaysValidSchema)(m,d)){let y=u.var("valid",e._`${g} <= ${l.length}`);u.if((0,e.not)(y),()=>A(y)),c.ok(y)}function A(y){u.forRange("i",l.length,g,E=>{c.subschema({keyword:h,dataProp:E,dataPropType:r.Type.Num},y),!m.allErrors&&u.if((0,e.not)(y),()=>u.break())})}a(A,"H")}a(s,"FR"),t.validateAdditionalItems=s,t.default=o}),eeo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;var e=Ns(),r=gc(),n=JN(),o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(c){let{schema:l,it:u}=c;if(Array.isArray(l))return s(c,"additionalItems",l);u.items=!0,!(0,r.alwaysValidSchema)(u,l)&&c.ok((0,n.validateArray)(c))}};function s(c,l,u=c.schema){let{gen:d,parentSchema:f,data:h,keyword:m,it:g}=c;E(f),g.opts.unevaluated&&u.length&&g.items!==!0&&(g.items=r.mergeEvaluated.items(d,u.length,g.items));let A=d.name("valid"),y=d.const("len",e._`${h}.length`);u.forEach((_,v)=>{(0,r.alwaysValidSchema)(g,_)||(d.if(e._`${y} > ${v}`,()=>c.subschema({keyword:m,schemaProp:v,dataProp:v},A)),c.ok(A))});function E(_){let{opts:v,errSchemaPath:b}=g,T=u.length,w=T===_.minItems&&(T===_.maxItems||_[l]===!1);if(v.strictTuples&&!w){let R=`"${m}" is ${T}-tuple, but minItems or maxItems/${l} are not specified or different at path "${b}"`;(0,r.checkStrictMode)(g,R,v.strictTuples)}}a(E,"V")}a(s,"jR"),t.validateTuple=s,t.default=o}),q7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=eeo(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(n=>(0,e.validateTuple)(n,"items"),"code")};t.default=r}),j7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=gc(),n=JN(),o=XXi(),s={message:a(({params:{len:l}})=>e.str`must NOT have more than ${l} items`,"message"),params:a(({params:{len:l}})=>e._`{limit: ${l}}`,"params")},c={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:s,code(l){let{schema:u,parentSchema:d,it:f}=l,{prefixItems:h}=d;f.items=!0,!(0,r.alwaysValidSchema)(f,u)&&(h?(0,o.validateAdditionalItems)(l,h):l.ok((0,n.validateArray)(l)))}};t.default=c}),H7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=gc(),n={message:a(({params:{min:s,max:c}})=>c===void 0?e.str`must contain at least ${s} valid item(s)`:e.str`must contain at least ${s} and no more than ${c} valid item(s)`,"message"),params:a(({params:{min:s,max:c}})=>c===void 0?e._`{minContains: ${s}}`:e._`{minContains: ${s}, maxContains: ${c}}`,"params")},o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:n,code(s){let{gen:c,schema:l,parentSchema:u,data:d,it:f}=s,h,m,{minContains:g,maxContains:A}=u;f.opts.next?(h=g===void 0?1:g,m=A):h=1;let y=c.const("len",e._`${d}.length`);if(s.setParams({min:h,max:m}),m===void 0&&h===0){(0,r.checkStrictMode)(f,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(m!==void 0&&h>m){(0,r.checkStrictMode)(f,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,r.alwaysValidSchema)(f,l)){let T=e._`${y} >= ${h}`;m!==void 0&&(T=e._`${T} && ${y} <= ${m}`),s.pass(T);return}f.items=!0;let E=c.name("valid");m===void 0&&h===1?v(E,()=>c.if(E,()=>c.break())):h===0?(c.let(E,!0),m!==void 0&&c.if(e._`${d}.length > 0`,_)):(c.let(E,!1),_()),s.result(E,()=>s.reset());function _(){let T=c.name("_valid"),w=c.let("count",0);v(T,()=>c.if(T,()=>b(w)))}a(_,"z");function v(T,w){c.forRange("i",0,y,R=>{s.subschema({keyword:"contains",dataProp:R,dataPropType:r.Type.Num,compositeRule:!0},T),w()})}a(v,"N");function b(T){c.code(e._`${T}++`),m===void 0?c.if(e._`${T} >= ${h}`,()=>c.assign(E,!0).break()):(c.if(e._`${T} > ${m}`,()=>c.assign(E,!1).break()),h===1?c.assign(E,!0):c.if(e._`${T} >= ${h}`,()=>c.assign(E,!0)))}a(b,"w")}};t.default=o}),G7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;var e=Ns(),r=gc(),n=JN();t.error={message:a(({params:{property:u,depsCount:d,deps:f}})=>{let h=d===1?"property":"properties";return e.str`must have ${h} ${f} when property ${u} is present`},"message"),params:a(({params:{property:u,depsCount:d,deps:f,missingProperty:h}})=>e._`{property: ${u}, missingProperty: ${h}, depsCount: ${d}, - deps: ${f}}`,"params")};var o={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(u){let[d,f]=s(u);c(u,d),l(u,f)}};function s({schema:u}){let d={},f={};for(let h in u){if(h==="__proto__")continue;let m=Array.isArray(u[h])?d:f;m[h]=u[h]}return[d,f]}a(s,"at");function c(u,d=u.schema){let{gen:f,data:h,it:m}=u;if(Object.keys(d).length===0)return;let g=f.let("missing");for(let A in d){let y=d[A];if(y.length===0)continue;let E=(0,n.propertyInData)(f,h,A,m.opts.ownProperties);u.setParams({property:A,depsCount:y.length,deps:y.join(", ")}),m.allErrors?f.if(E,()=>{for(let _ of y)(0,n.checkReportMissingProp)(u,_)}):(f.if(e._`${E} && (${(0,n.checkMissingProp)(u,y,g)})`),(0,n.reportMissingProp)(u,g),f.else())}}a(c,"vR"),t.validatePropertyDeps=c;function l(u,d=u.schema){let{gen:f,data:h,keyword:m,it:g}=u,A=f.name("valid");for(let y in d)(0,r.alwaysValidSchema)(g,d[y])||(f.if((0,n.propertyInData)(f,h,y,g.opts.ownProperties),()=>{let E=u.subschema({keyword:m,schemaProp:y},A);u.mergeValidEvaluated(E,A)},()=>f.var(A,!0)),u.ok(A))}a(l,"CR"),t.validateSchemaDeps=l,t.default=o}),e9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n={message:"property name must be valid",params:a(({params:s})=>e._`{propertyName: ${s.propertyName}}`,"params")},o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:n,code(s){let{gen:c,schema:l,data:u,it:d}=s;if((0,r.alwaysValidSchema)(d,l))return;let f=c.name("valid");c.forIn("key",u,h=>{s.setParams({propertyName:h}),s.subschema({keyword:"propertyNames",data:h,dataTypes:["string"],propertyName:h,compositeRule:!0},f),c.if((0,e.not)(f),()=>{s.error(!0),!d.allErrors&&c.break()})}),s.ok(f)}};t.default=o}),rZi=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=HN(),r=Ns(),n=pW(),o=mc(),s={message:"must NOT have additional properties",params:a(({params:l})=>r._`{additionalProperty: ${l.additionalProperty}}`,"params")},c={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:s,code(l){let{gen:u,schema:d,parentSchema:f,data:h,errsCount:m,it:g}=l;if(!m)throw Error("ajv implementation error");let{allErrors:A,opts:y}=g;if(g.props=!0,y.removeAdditional!=="all"&&(0,o.alwaysValidSchema)(g,d))return;let E=(0,e.allSchemaProperties)(f.properties),_=(0,e.allSchemaProperties)(f.patternProperties);v(),l.ok(r._`${m} === ${n.default.errors}`);function v(){u.forIn("key",h,x=>{!E.length&&!_.length?w(x):u.if(b(x),()=>w(x))})}a(v,"B");function b(x){let P;if(E.length>8){let D=(0,o.schemaRefOrVal)(g,f.properties,"properties");P=(0,e.isOwnProperty)(u,D,x)}else E.length?P=(0,r.or)(...E.map(D=>r._`${x} === ${D}`)):P=r.nil;return _.length&&(P=(0,r.or)(P,..._.map(D=>r._`${(0,e.usePattern)(l,D)}.test(${x})`))),(0,r.not)(P)}a(b,"z");function T(x){u.code(r._`delete ${h}[${x}]`)}a(T,"N");function w(x){if(y.removeAdditional==="all"||y.removeAdditional&&d===!1){T(x);return}if(d===!1){l.setParams({additionalProperty:x}),l.error(),!A&&u.break();return}if(typeof d=="object"&&!(0,o.alwaysValidSchema)(g,d)){let P=u.name("valid");y.removeAdditional==="failing"?(R(x,P,!1),u.if((0,r.not)(P),()=>{l.reset(),T(x)})):(R(x,P),!A&&u.if((0,r.not)(P),()=>u.break()))}}a(w,"w");function R(x,P,D){let N={keyword:"additionalProperties",dataProp:x,dataPropType:o.Type.Str};D===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(N,P)}a(R,"O")}};t.default=c}),t9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=hwt(),r=HN(),n=mc(),o=rZi(),s={keyword:"properties",type:"object",schemaType:"object",code(c){let{gen:l,schema:u,parentSchema:d,data:f,it:h}=c;h.opts.removeAdditional==="all"&&d.additionalProperties===void 0&&o.default.code(new e.KeywordCxt(h,o.default,"additionalProperties"));let m=(0,r.allSchemaProperties)(u);for(let _ of m)h.definedProperties.add(_);h.opts.unevaluated&&m.length&&h.props!==!0&&(h.props=n.mergeEvaluated.props(l,(0,n.toHash)(m),h.props));let g=m.filter(_=>!(0,n.alwaysValidSchema)(h,u[_]));if(g.length===0)return;let A=l.name("valid");for(let _ of g)y(_)?E(_):(l.if((0,r.propertyInData)(l,f,_,h.opts.ownProperties)),E(_),!h.allErrors&&l.else().var(A,!0),l.endIf()),c.it.definedProperties.add(_),c.ok(A);function y(_){return h.opts.useDefaults&&!h.compositeRule&&u[_].default!==void 0}a(y,"q");function E(_){c.subschema({keyword:"properties",schemaProp:_,dataProp:_},A)}a(E,"V")}};t.default=s}),r9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=HN(),r=Ns(),n=mc(),o=mc(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(c){let{gen:l,schema:u,data:d,parentSchema:f,it:h}=c,{opts:m}=h,g=(0,e.allSchemaProperties)(u),A=g.filter(w=>(0,n.alwaysValidSchema)(h,u[w]));if(g.length===0||A.length===g.length&&(!h.opts.unevaluated||h.props===!0))return;let y=m.strictSchema&&!m.allowMatchingProperties&&f.properties,E=l.name("valid");h.props!==!0&&!(h.props instanceof r.Name)&&(h.props=(0,o.evaluatedPropsToName)(l,h.props));let{props:_}=h;v();function v(){for(let w of g)y&&b(w),h.allErrors?T(w):(l.var(E,!0),T(w),l.if(E))}a(v,"z");function b(w){for(let R in y)new RegExp(w).test(R)&&(0,n.checkStrictMode)(h,`property ${R} matches pattern ${w} (use allowMatchingProperties)`)}a(b,"N");function T(w){l.forIn("key",d,R=>{l.if(r._`${(0,e.usePattern)(c,w)}.test(${R})`,()=>{let x=A.includes(w);x||c.subschema({keyword:"patternProperties",schemaProp:w,dataProp:R,dataPropType:o.Type.Str},E),h.opts.unevaluated&&_!==!0?l.assign(r._`${_}[${R}]`,!0):!x&&!h.allErrors&&l.if((0,r.not)(E),()=>l.break())})})}a(T,"w")}};t.default=s}),n9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mc(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){let{gen:o,schema:s,it:c}=n;if((0,e.alwaysValidSchema)(c,s)){n.fail();return}let l=o.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),n.failResult(l,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};t.default=r}),i9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=HN(),r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e.validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r}),o9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n={message:"must match exactly one schema in oneOf",params:a(({params:s})=>e._`{passingSchemas: ${s.passing}}`,"params")},o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:n,code(s){let{gen:c,schema:l,parentSchema:u,it:d}=s;if(!Array.isArray(l))throw Error("ajv implementation error");if(d.opts.discriminator&&u.discriminator)return;let f=l,h=c.let("valid",!1),m=c.let("passing",null),g=c.name("_valid");s.setParams({passing:m}),c.block(A),s.result(h,()=>s.reset(),()=>s.error(!0));function A(){f.forEach((y,E)=>{let _;(0,r.alwaysValidSchema)(d,y)?c.var(g,!0):_=s.subschema({keyword:"oneOf",schemaProp:E,compositeRule:!0},g),E>0&&c.if(e._`${g} && ${h}`).assign(h,!1).assign(m,e._`[${m}, ${E}]`).else(),c.if(g,()=>{c.assign(h,!0),c.assign(m,E),_&&s.mergeEvaluated(_,e.Name)})})}a(A,"q")}};t.default=o}),s9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mc(),r={keyword:"allOf",schemaType:"array",code(n){let{gen:o,schema:s,it:c}=n;if(!Array.isArray(s))throw Error("ajv implementation error");let l=o.name("valid");s.forEach((u,d)=>{if((0,e.alwaysValidSchema)(c,u))return;let f=n.subschema({keyword:"allOf",schemaProp:d},l);n.ok(l),n.mergeEvaluated(f)})}};t.default=r}),a9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=mc(),n={message:a(({params:c})=>e.str`must match "${c.ifClause}" schema`,"message"),params:a(({params:c})=>e._`{failingKeyword: ${c.ifClause}}`,"params")},o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:n,code(c){let{gen:l,parentSchema:u,it:d}=c;u.then===void 0&&u.else===void 0&&(0,r.checkStrictMode)(d,'"if" without "then" and "else" is ignored');let f=s(d,"then"),h=s(d,"else");if(!f&&!h)return;let m=l.let("valid",!0),g=l.name("_valid");if(A(),c.reset(),f&&h){let E=l.let("ifClause");c.setParams({ifClause:E}),l.if(g,y("then",E),y("else",E))}else f?l.if(g,y("then")):l.if((0,e.not)(g),y("else"));c.pass(m,()=>c.error(!0));function A(){let E=c.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);c.mergeEvaluated(E)}a(A,"H");function y(E,_){return()=>{let v=c.subschema({keyword:E},g);l.assign(m,g),c.mergeValidEvaluated(v,m),_?l.assign(_,e._`${E}`):c.setParams({ifClause:E})}}a(y,"q")}};function s(c,l){let u=c.schema[l];return u!==void 0&&!(0,r.alwaysValidSchema)(c,u)}a(s,"WP"),t.default=o}),c9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=mc(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:o,it:s}){o.if===void 0&&(0,e.checkStrictMode)(s,`"${n}" without "if" is ignored`)}};t.default=r}),l9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=eZi(),r=K6c(),n=tZi(),o=J6c(),s=Z6c(),c=X6c(),l=e9c(),u=rZi(),d=t9c(),f=r9c(),h=n9c(),m=i9c(),g=o9c(),A=s9c(),y=a9c(),E=c9c();function _(v=!1){let b=[h.default,m.default,g.default,A.default,y.default,E.default,l.default,u.default,c.default,d.default,f.default];return v?b.push(r.default,o.default):b.push(e.default,n.default),b.push(s.default),b}a(_,"ra"),t.default=_}),u9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r={message:a(({schemaCode:o})=>e.str`must match format "${o}"`,"message"),params:a(({schemaCode:o})=>e._`{format: ${o}}`,"params")},n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:r,code(o,s){let{gen:c,data:l,$data:u,schema:d,schemaCode:f,it:h}=o,{opts:m,errSchemaPath:g,schemaEnv:A,self:y}=h;if(!m.validateFormats)return;u?E():_();function E(){let v=c.scopeValue("formats",{ref:y.formats,code:m.code.formats}),b=c.const("fDef",e._`${v}[${f}]`),T=c.let("fType"),w=c.let("format");c.if(e._`typeof ${b} == "object" && !(${b} instanceof RegExp)`,()=>c.assign(T,e._`${b}.type || "string"`).assign(w,e._`${b}.validate`),()=>c.assign(T,e._`"string"`).assign(w,b)),o.fail$data((0,e.or)(R(),x()));function R(){return m.strictSchema===!1?e.nil:e._`${f} && !${w}`}a(R,"j");function x(){let P=A.$async?e._`(${b}.async ? await ${w}(${l}) : ${w}(${l}))`:e._`${w}(${l})`,D=e._`(typeof ${w} == "function" ? ${P} : ${w}.test(${l}))`;return e._`${w} && ${w} !== true && ${T} === ${s} && !${D}`}a(x,"A")}a(E,"z");function _(){let v=y.formats[d];if(!v){R();return}if(v===!0)return;let[b,T,w]=x(v);b===s&&o.pass(P());function R(){if(m.strictSchema===!1){y.logger.warn(D());return}throw Error(D());function D(){return`unknown format "${d}" ignored in schema at path "${g}"`}}a(R,"j");function x(D){let N=D instanceof RegExp?(0,e.regexpCode)(D):m.code.formats?e._`${m.code.formats}${(0,e.getProperty)(d)}`:void 0,L=c.scopeValue("formats",{key:d,ref:D,code:N});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,e._`${L}.validate`]:["string",D,L]}a(x,"A");function P(){if(typeof v=="object"&&!(v instanceof RegExp)&&v.async){if(!A.$async)throw Error("async format in sync schema");return e._`await ${w}(${l})`}return typeof T=="function"?e._`${w}(${l})`:e._`${w}.test(${l})`}a(P,"S")}a(_,"N")}};t.default=n}),d9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=u9c(),r=[e.default];t.default=r}),f9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),p9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=B6c(),r=Y6c(),n=l9c(),o=d9c(),s=f9c(),c=[e.default,r.default,(0,n.default)(),o.default,s.metadataVocabulary,s.contentVocabulary];t.default=c}),h9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0;var e;(function(r){r.Tag="tag",r.Mapping="mapping"})(e||(t.DiscrError=e={}))}),m9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=h9c(),n=b6r(),o=mwt(),s=mc(),c={message:a(({params:{discrError:u,tagName:d}})=>u===r.DiscrError.Tag?`tag "${d}" must be string`:`value of tag "${d}" must be in oneOf`,"message"),params:a(({params:{discrError:u,tag:d,tagName:f}})=>e._`{error: ${u}, tag: ${f}, tagValue: ${d}}`,"params")},l={keyword:"discriminator",type:"object",schemaType:"object",error:c,code(u){let{gen:d,data:f,schema:h,parentSchema:m,it:g}=u,{oneOf:A}=m;if(!g.opts.discriminator)throw Error("discriminator: requires discriminator option");let y=h.propertyName;if(typeof y!="string")throw Error("discriminator: requires propertyName");if(h.mapping)throw Error("discriminator: mapping is not supported");if(!A)throw Error("discriminator: requires oneOf keyword");let E=d.let("valid",!1),_=d.const("tag",e._`${f}${(0,e.getProperty)(y)}`);d.if(e._`typeof ${_} == "string"`,()=>v(),()=>u.error(!1,{discrError:r.DiscrError.Tag,tag:_,tagName:y})),u.ok(E);function v(){let w=T();d.if(!1);for(let R in w)d.elseIf(e._`${_} === ${R}`),d.assign(E,b(w[R]));d.else(),u.error(!1,{discrError:r.DiscrError.Mapping,tag:_,tagName:y}),d.endIf()}a(v,"V");function b(w){let R=d.name("valid"),x=u.subschema({keyword:"oneOf",schemaProp:w},R);return u.mergeEvaluated(x,e.Name),R}a(b,"B");function T(){var w;let R={},x=D(m),P=!0;for(let B=0;B{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),nZi=Ht((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;var r=M6c(),n=p9c(),o=m9c(),s=g9c(),c=["/properties"],l="http://json-schema.org/draft-07/schema";class u extends r.default{static{a(this,"pJ")}_addVocabularies(){super._addVocabularies(),n.default.forEach(A=>this.addVocabulary(A)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let A=this.opts.$data?this.$dataMetaSchema(s,c):s;this.addMetaSchema(A,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var d=hwt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return d.KeywordCxt},"get")});var f=Ns();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return f._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return f.str},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return f.stringify},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return f.nil},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return f.Name},"get")}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:a(function(){return f.CodeGen},"get")});var h=C6r();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:a(function(){return h.default},"get")});var m=mwt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:a(function(){return m.default},"get")})}),A9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(L,B){return{validate:L,compare:B}}a(e,"b4"),t.fullFormats={date:e(s,c),time:e(u(!0),d),"date-time":e(m(!0),g),"iso-time":e(u(),f),"iso-date-time":e(m(),A),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:N,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:b,int32:{type:"number",validate:R},int64:{type:"number",validate:x},float:{type:"number",validate:P},double:{type:"number",validate:P},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,c),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,d),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,g),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,f),"iso-date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,A),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function r(L){return L%4===0&&(L%100!==0||L%400===0)}a(r,"Is");var n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(L){let B=n.exec(L);if(!B)return!1;let q=+B[1],M=+B[2],O=+B[3];return M>=1&&M<=12&&O>=1&&O<=(M===2&&r(q)?29:o[M])}a(s,"xP");function c(L,B){if(L&&B)return L>B?1:L23||W>59||L&&!Q)return!1;if(M<=23&&O<=59&&j<60)return!0;let V=O-W*U,z=M-Y*U-(V<0?1:0);return(z===23||z===-1)&&(V===59||V===-1)&&j<61}}a(u,"Jz");function d(L,B){if(!(L&&B))return;let q=new Date("2020-01-01T"+L).valueOf(),M=new Date("2020-01-01T"+B).valueOf();if(q&&M)return q-M}a(d,"Wz");function f(L,B){if(!(L&&B))return;let q=l.exec(L),M=l.exec(B);if(q&&M)return L=q[1]+q[2]+q[3],B=M[1]+M[2]+M[3],L>B?1:L=T}a(R,"Cs");function x(L){return Number.isInteger(L)}a(x,"Ts");function P(){return!0}a(P,"TP");var D=/[^\\]\\Z/;function N(L){if(D.test(L))return!1;try{return new RegExp(L),!0}catch{return!1}}a(N,"ys")}),y9c=Ht(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;var e=nZi(),r=Ns(),n=r.operators,o={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},s={message:a(({keyword:l,schemaCode:u})=>r.str`should be ${o[l].okStr} ${u}`,"message"),params:a(({keyword:l,schemaCode:u})=>r._`{comparison: ${o[l].okStr}, limit: ${u}}`,"params")};t.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:s,code(l){let{gen:u,data:d,schemaCode:f,keyword:h,it:m}=l,{opts:g,self:A}=m;if(!g.validateFormats)return;let y=new e.KeywordCxt(m,A.RULES.all.format.definition,"format");y.$data?E():_();function E(){let b=u.scopeValue("formats",{ref:A.formats,code:g.code.formats}),T=u.const("fmt",r._`${b}[${y.schemaCode}]`);l.fail$data((0,r.or)(r._`typeof ${T} != "object"`,r._`${T} instanceof RegExp`,r._`typeof ${T}.compare != "function"`,v(T)))}a(E,"q");function _(){let b=y.schema,T=A.formats[b];if(!T||T===!0)return;if(typeof T!="object"||T instanceof RegExp||typeof T.compare!="function")throw Error(`"${h}": format "${b}" does not define "compare" function`);let w=u.scopeValue("formats",{key:b,ref:T,code:g.code.formats?r._`${g.code.formats}${(0,r.getProperty)(b)}`:void 0});l.fail$data(v(w))}a(_,"V");function v(b){return r._`${b}.compare(${d}, ${f}) ${o[h].fail} 0`}a(v,"B")},dependencies:["format"]};var c=a(l=>(l.addKeyword(t.formatLimitDefinition),l),"us");t.default=c}),E9c=Ht((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=A9c(),n=y9c(),o=Ns(),s=new o.Name("fullFormats"),c=new o.Name("fastFormats"),l=a((d,f={keywords:!0})=>{if(Array.isArray(f))return u(d,f,r.fullFormats,s),d;let[h,m]=f.mode==="fast"?[r.fastFormats,c]:[r.fullFormats,s],g=f.formats||r.formatNames;return u(d,g,h,m),f.keywords&&(0,n.default)(d),d},"Kz");l.get=(d,f="full")=>{let h=(f==="fast"?r.fastFormats:r.fullFormats)[d];if(!h)throw Error(`Unknown format "${d}"`);return h};function u(d,f,h,m){var g,A;(g=(A=d.opts.code).formats)!==null&&g!==void 0||(A.formats=o._`require("ajv-formats/dist/formats").${m}`);for(let y of f)d.addFormat(y,h[y])}a(u,"dP"),e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l}),_9c=50;a(t8r,"g9");a(lZi,"K5");a(v9c,"Uk");a(Vie,"v4");ywt=["PreToolUse","PostToolUse","PostToolUseFailure","PostToolBatch","Notification","UserPromptSubmit","UserPromptExpansion","SessionStart","SessionEnd","Stop","StopFailure","SubagentStart","SubagentStop","PreCompact","PostCompact","PermissionRequest","PermissionDenied","Setup","TeammateIdle","TaskCreated","TaskCompleted","Elicitation","ElicitationResult","ConfigChange","WorktreeCreate","WorktreeRemove","InstructionsLoaded","CwdChanged","FileChanged","MessageDisplay"],C9c=["clear","resume","logout","prompt_input_exit","other","bypass_permissions_disabled"],b9c="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__",S9c=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,T9c=/(.*?)<\/command-name>/;a(T6r,"h9");I9c={customTitle:"customTitle",aiTitle:"aiTitle",lastPrompt:"lastPrompt",summary:"summaryHint",gitBranch:"gitBranch"};a(pZi,"q5");a(x9c,"JN");a(YV,"G1");a(w9c,"zk");a(R9c,"Nk");a(k9c,"wk");r8r=class{static{a(this,"FG")}store=new Map;mtimes=new Map;summaries=new Map;lastMtime=0;keyToString(e){let r=[e.projectKey,e.sessionId];return e.subpath&&r.push(e.subpath),r.join("/")}async append(e,r){let n=this.keyToString(e),o=this.store.get(n)??[];o.push(...r),this.store.set(n,o);let s=Math.max(Date.now(),this.lastMtime+1);if(this.lastMtime=s,this.mtimes.set(n,s),e.subpath===void 0){let c=`${e.projectKey}/${e.sessionId}`,l=pZi(this.summaries.get(c),e,r,{mtime:s});this.summaries.set(c,l)}}async load(e){let r=this.keyToString(e);return this.store.get(r)??null}async listSessions(e){let r=[],n=e+"/";for(let[o]of this.store)if(o.startsWith(n)){let s=o.slice(n.length);s.includes("/")||r.push({sessionId:s,mtime:this.mtimes.get(o)??0})}return r}async listSessionSummaries(e){let r=[],n=e+"/";for(let[o,s]of this.summaries)o.startsWith(n)&&r.push(s);return r}async delete(e){let r=this.keyToString(e);if(this.store.delete(r),this.mtimes.delete(r),e.subpath===void 0){this.summaries.delete(`${e.projectKey}/${e.sessionId}`);let n=`${e.projectKey}/${e.sessionId}/`;for(let o of this.store.keys())o.startsWith(n)&&(this.store.delete(o),this.mtimes.delete(o))}}async listSubkeys(e){let r=`${e.projectKey}/${e.sessionId}/`,n=[];for(let o of this.store.keys())o.startsWith(r)&&n.push(o.slice(r.length));return n}getEntries(e){return this.store.get(this.keyToString(e))??[]}get size(){let e=0;for(let r of this.store.keys()){let n=r.indexOf("/");n!==-1&&!r.slice(n+1).includes("/")&&e++}return e}clear(){this.store.clear(),this.mtimes.clear(),this.summaries.clear()}},R1=class extends Error{static{a(this,"W6")}};a(hZi,"V5");a(s_,"R$");a(D8e,"U1");P9c=typeof global=="object"&&global&&global.Object===Object&&global,mZi=P9c,D9c=typeof self=="object"&&self&&self.Object===Object&&self,N9c=mZi||D9c||Function("return this")(),Mve=N9c,M9c=Mve.Symbol,cW=M9c,gZi=Object.prototype,O9c=gZi.hasOwnProperty,L9c=gZi.toString,bFe=cW?cW.toStringTag:void 0;a(B9c,"Ak");F9c=B9c,U9c=Object.prototype,Q9c=U9c.toString;a(q9c,"Pk");j9c=q9c,H9c="[object Null]",G9c="[object Undefined]",MYi=cW?cW.toStringTag:void 0;a($9c,"_k");N8e=$9c;a(V9c,"kk");z9=V9c,W9c="[object AsyncFunction]",z9c="[object Function]",Y9c="[object GeneratorFunction]",K9c="[object Proxy]";a(J9c,"xk");I6r=J9c,Z9c=Mve["__core-js_shared__"],CFr=Z9c,OYi=(function(){var t=/[^.]+$/.exec(CFr&&CFr.keys&&CFr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();a(X9c,"fk");eUc=X9c,tUc=Function.prototype,rUc=tUc.toString;a(nUc,"uk");iUc=nUc,oUc=/[\\^$.*+?()[\]{}|]/g,sUc=/^\[object .+?Constructor\]$/,aUc=Function.prototype,cUc=Object.prototype,lUc=aUc.toString,uUc=cUc.hasOwnProperty,dUc=RegExp("^"+lUc.call(uUc).replace(oUc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");a(fUc,"rk");pUc=fUc;a(hUc,"ok");mUc=hUc;a(gUc,"tk");x6r=gUc,AUc=x6r(Object,"create"),n8e=AUc;a(yUc,"sk");EUc=yUc;a(_Uc,"ek");vUc=_Uc,CUc="__lodash_hash_undefined__",bUc=Object.prototype,SUc=bUc.hasOwnProperty;a(TUc,"XS");IUc=TUc,xUc=Object.prototype,wUc=xUc.hasOwnProperty;a(RUc,"GS");kUc=RUc,PUc="__lodash_hash_undefined__";a(DUc,"HS");NUc=DUc;a(Ove,"a0");Ove.prototype.clear=EUc;Ove.prototype.delete=vUc;Ove.prototype.get=IUc;Ove.prototype.has=kUc;Ove.prototype.set=NUc;LYi=Ove;a(MUc,"KS");OUc=MUc;a(LUc,"qS");Ewt=LUc;a(BUc,"VS");_wt=BUc,FUc=Array.prototype,UUc=FUc.splice;a(QUc,"NS");qUc=QUc;a(jUc,"wS");HUc=jUc;a(GUc,"OS");$Uc=GUc;a(VUc,"DS");WUc=VUc;a(Lve,"s0");Lve.prototype.clear=OUc;Lve.prototype.delete=qUc;Lve.prototype.get=HUc;Lve.prototype.has=$Uc;Lve.prototype.set=WUc;vwt=Lve,zUc=x6r(Mve,"Map"),AZi=zUc;a(YUc,"ZS");KUc=YUc;a(JUc,"MS");ZUc=JUc;a(XUc,"LS");Cwt=XUc;a(e7c,"jS");t7c=e7c;a(r7c,"AS");n7c=r7c;a(i7c,"IS");o7c=i7c;a(s7c,"RS");a7c=s7c;a(Bve,"e0");Bve.prototype.clear=KUc;Bve.prototype.delete=t7c;Bve.prototype.get=n7c;Bve.prototype.has=o7c;Bve.prototype.set=a7c;w6r=Bve,c7c="Expected a function";a(R6r,"MG");R6r.Cache=w6r;Py=R6r,Fve=Py(()=>(process.env.CLAUDE_CONFIG_DIR??(0,EZi.join)((0,yZi.homedir)(),".claude")).normalize("NFC"),()=>process.env.CLAUDE_CONFIG_DIR),AKh=Py(()=>s_(process.env.CLAUDE_CODE_SUPERVISED));a(En,"y");a(gt,"Z");_Zi=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return _Zi=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))},"LG");a(i8e,"T4");n8r=a(t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return Error(JSON.stringify(t))}catch{}}return Error(t)},"l9"),Ri=class extends Error{static{a(this,"g")}},Jv=class t extends Ri{static{a(this,"n$")}constructor(e,r,n,o,s){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=o,this.requestID=o?.get("request-id"),this.error=r,this.type=s??null}static makeMessage(e,r,n){let o=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&o?`${e} ${o}`:e?`${e} status code (no body)`:o||"(no status code or body)"}static generate(e,r,n,o){if(!e||!o)return new dve({message:n,cause:n8r(r)});let s=r,c=s?.error?.type;return e===400?new WIt(e,s,n,o,c):e===401?new zIt(e,s,n,o,c):e===403?new YIt(e,s,n,o,c):e===404?new KIt(e,s,n,o,c):e===409?new JIt(e,s,n,o,c):e===422?new ZIt(e,s,n,o,c):e===429?new XIt(e,s,n,o,c):e>=500?new ext(e,s,n,o,c):new t(e,s,n,o,c)}},kI=class extends Jv{static{a(this,"Q6")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},dve=class extends Jv{static{a(this,"e1")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},VIt=class extends dve{static{a(this,"c9")}constructor({message:e}={}){super({message:e??"Request timed out."})}},WIt=class extends Jv{static{a(this,"p9")}},zIt=class extends Jv{static{a(this,"d9")}},YIt=class extends Jv{static{a(this,"i9")}},KIt=class extends Jv{static{a(this,"n9")}},JIt=class extends Jv{static{a(this,"r9")}},ZIt=class extends Jv{static{a(this,"o9")}},XIt=class extends Jv{static{a(this,"t9")}},ext=class extends Jv{static{a(this,"a9")}},l7c=/^[a-z][a-z0-9+.-]*:/i,u7c=a(t=>l7c.test(t),"bN"),i8r=a(t=>(i8r=Array.isArray,i8r(t)),"jG"),BYi=i8r;a(o8r,"w5");a(FYi,"IG");a(d7c,"_N");f7c=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new Ri(`${t} must be an integer`);if(e<0)throw new Ri(`${t} must be a positive integer`);return e},"kN"),vZi=a(t=>{try{return JSON.parse(t)}catch{return}},"O5"),p7c=a(t=>new Promise(e=>setTimeout(e,t)),"SN"),nW="0.94.0",h7c=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","xN");a(m7c,"SS");g7c=a(()=>{let t=m7c();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":nW,"X-Stainless-OS":QYi(Deno.build.os),"X-Stainless-Arch":UYi(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":nW,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":nW,"X-Stainless-OS":QYi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":UYi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=A7c();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":nW,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":nW,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"vS");a(A7c,"CS");UYi=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","vN"),QYi=a(t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),"CN"),k6r=a(()=>qYi??(qYi=g7c()),"s9");a(y7c,"yN");a(CZi,"RG");a(bZi,"D5");a(P6r,"e9");a(E7c,"fN");_7c=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"gN");a(v7c,"hN");C7c="urn:ietf:params:oauth:grant-type:jwt-bearer",b7c="refresh_token",SZi="/v1/oauth/token",txt="oauth-2025-04-20",S7c="oidc-federation-2026-04-01",T7c=120,D6r=30,I7c=5,jYi=1048576;a(TZi,"Z5");a(IZi,"M5");bFr=2e3,x7c=new Set(["error","error_description","error_uri"]);a(gk,"Z6");a(xZi,"L5");a(wZi,"j5");a(w7c,"fS");nu=class extends Ri{static{a(this,"O$")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}};a(Wie,"Y4");s8r=class{static{a(this,"EG")}constructor(e,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=r}async getToken(){let e=this.nextForce;this.nextForce=!1;let r=this.cached;if(e||r==null)return(await this.refresh(e)).token;if(r.expiresAt==null)return r.token;let n=r.expiresAt-Wie();return n>T7c?r.token:n>D6r?(this.backgroundRefresh(),r.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||Wie()-this.lastAdvisoryError{this.lastAdvisoryError=Wie(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(r=>(this.cached=r,this.pendingRefresh=null,r),r=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}},tu=a(t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0},"w$");a(R7c,"rN");a(N6r,"Q8");a($Yi,"bG");rxt={off:0,error:200,warn:300,info:400,debug:500},VYi=a((t,e,r)=>{if(t){if(d7c(rxt,t))return t;oA(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(rxt))}`)}},"_G");a(GFe,"$Q");a(_It,"A5");k7c={error:GFe,warn:GFe,info:GFe,debug:GFe},WYi=new WeakMap;a(oA,"m$");Gie=a(t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="x-api-key"||e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t),"x4"),RZi="1.0",P7c=/^[A-Za-z0-9_.-]+$/;a(kZi,"tN");D7c=a(async t=>{var e,r;let n=await M6r();if(n===null)return null;let o=t??await PZi();if(o===null)return null;kZi(o);let s=await import("node:fs"),c=(await import("node:path")).join(n,"configs",`${o}.json`),l;try{l=await s.promises.readFile(c,"utf-8")}catch(f){if(f?.code!=="ENOENT")throw Error(`failed to read config file ${c}: ${f}`);l=null}if(l===null){let f=tu("ANTHROPIC_ORGANIZATION_ID"),h=tu("ANTHROPIC_IDENTITY_TOKEN_FILE"),m=tu("ANTHROPIC_FEDERATION_RULE_ID");return m&&f?{fromFile:!1,config:{organization_id:f,workspace_id:tu("ANTHROPIC_WORKSPACE_ID"),base_url:tu("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:m,service_account_id:tu("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:h?{source:"file",path:h}:void 0,scope:tu("ANTHROPIC_SCOPE")}}}:null}let u;try{u=JSON.parse(l)}catch(f){throw Error(`failed to parse config file ${c}: ${f}`)}if(!u.authentication)throw Error(`config file ${c} is missing "authentication"`);let d=u.authentication.type;if(d!=="oidc_federation"&&d!=="user_oauth")throw Error(`authentication.type "${d}" is not a known authentication type`);if(u.organization_id??(u.organization_id=tu("ANTHROPIC_ORGANIZATION_ID")),u.workspace_id??(u.workspace_id=tu("ANTHROPIC_WORKSPACE_ID")),u.base_url??(u.base_url=tu("ANTHROPIC_BASE_URL")),(e=u.authentication).scope??(e.scope=tu("ANTHROPIC_SCOPE")),u.authentication.type==="oidc_federation"){if(!u.authentication.identity_token){let f=tu("ANTHROPIC_IDENTITY_TOKEN_FILE");f&&(u.authentication.identity_token={source:"file",path:f})}u.authentication.federation_rule_id||(u.authentication.federation_rule_id=tu("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=u.authentication).service_account_id??(r.service_account_id=tu("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:u,fromFile:!0}},"aN"),N7c=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await M6r();if(!r)return null;let n=e??await PZi();return n?(kZi(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"sN"),M6r=a(async()=>{if(!M7c())return null;let t=await import("node:path"),e=tu("ANTHROPIC_CONFIG_DIR");if(e)return e;if(k6r()["X-Stainless-OS"]==="Windows"){let o=tu("APPDATA");if(o)return t.join(o,"Anthropic");let s=tu("USERPROFILE");return s?t.join(s,"AppData","Roaming","Anthropic"):null}let r=tu("XDG_CONFIG_HOME");if(r)return t.join(r,"anthropic");let n=tu("HOME");return n?t.join(n,".config","anthropic"):null},"kG"),M7c=a(()=>{let t=k6r()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"uS"),PZi=a(async()=>{let t=await M6r();if(!t)return null;let e=tu("ANTHROPIC_PROFILE");if(e)return e;let r=await import("node:fs"),n=(await import("node:path")).join(t,"active_config");try{return(await r.promises.readFile(n,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw Error(`failed to read ${n}: ${o}`);return"default"}},"eN");a(zYi,"SG");a(O7c,"$w");a(L7c,"Qw");a(B7c,"Jw");a(DZi,"vG");a(F7c,"Xw");a(U7c,"mS");a(Q7c,"lS");a(q7c,"cS");Zie=class{static{a(this,"B1")}constructor(){xI.set(this,void 0),wI.set(this,void 0),En(this,xI,new Uint8Array,"f"),En(this,wI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?N6r(e):e;En(this,xI,R7c([gt(this,xI,"f"),r]),"f");let n=[],o;for(;(o=j7c(gt(this,xI,"f"),gt(this,wI,"f")))!=null;){if(o.carriage&>(this,wI,"f")==null){En(this,wI,o.index,"f");continue}if(gt(this,wI,"f")!=null&&(o.index!==gt(this,wI,"f")+1||o.carriage)){n.push($Yi(gt(this,xI,"f").subarray(0,gt(this,wI,"f")-1))),En(this,xI,gt(this,xI,"f").subarray(gt(this,wI,"f")),"f"),En(this,wI,null,"f");continue}let s=gt(this,wI,"f")!==null?o.preceding-1:o.preceding,c=$Yi(gt(this,xI,"f").subarray(0,s));n.push(c),En(this,xI,gt(this,xI,"f").subarray(o.index),"f"),En(this,wI,null,"f")}return n}flush(){return gt(this,xI,"f").length?this.decode(` -`):[]}};xI=new WeakMap,wI=new WeakMap;Zie.NEWLINE_CHARS=new Set([` -`,"\r"]);Zie.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(j7c,"pS");a(H7c,"Yw");Xie=class t{static{a(this,"x6")}constructor(e,r,n){this.iterator=e,SFe.set(this,void 0),this.controller=r,En(this,SFe,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?oA(n):console;async function*c(){if(o)throw new Ri("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of G7c(e,r)){if(u.event==="completion")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event==="message_start"||u.event==="message_delta"||u.event==="message_stop"||u.event==="content_block_start"||u.event==="content_block_delta"||u.event==="content_block_stop"||u.event==="message"||u.event==="user.message"||u.event==="user.interrupt"||u.event==="user.tool_confirmation"||u.event==="user.custom_tool_result"||u.event==="agent.message"||u.event==="agent.thinking"||u.event==="agent.tool_use"||u.event==="agent.tool_result"||u.event==="agent.mcp_tool_use"||u.event==="agent.mcp_tool_result"||u.event==="agent.custom_tool_use"||u.event==="agent.thread_context_compacted"||u.event==="session.status_running"||u.event==="session.status_idle"||u.event==="session.status_rescheduled"||u.event==="session.status_terminated"||u.event==="session.error"||u.event==="session.deleted"||u.event==="span.model_request_start"||u.event==="span.model_request_end")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event!=="ping"&&u.event==="error"){let d=vZi(u.data)??u.data,f=d?.error?.type;throw new Jv(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(i8e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}static fromReadableStream(e,r,n){let o=!1;async function*s(){let l=new Zie,u=P6r(e);for await(let d of u)for(let f of l.decode(d))yield f;for(let d of l.flush())yield d}a(s,"X");async function*c(){if(o)throw new Ri("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of s())l||u&&(yield JSON.parse(u));l=!0}catch(u){if(i8e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}[(SFe=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),o=a(s=>({next:a(()=>{if(s.length===0){let c=n.next();e.push(c),r.push(c)}return s.shift()},"next")}),"Y");return[new t(()=>o(e),this.controller,gt(this,SFe,"f")),new t(()=>o(r),this.controller,gt(this,SFe,"f"))]}toReadableStream(){let e=this,r;return CZi({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:o,done:s}=await r.next();if(s)return n.close();let c=N6r(JSON.stringify(o)+` -`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(G7c,"dS");a($7c,"iS");a8r=class{static{a(this,"Ww")}constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let s={event:this.event,data:this.data.join(` -`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[r,n,o]=V7c(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(V7c,"nS");a(NZi,"P5");a(MZi,"CG");nxt=class t extends Promise{static{a(this,"Q0")}constructor(e,r,n=NZi){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,$Fe.set(this,void 0),En(this,$Fe,e,"f")}_thenUnwrap(e){return new t(gt(this,$Fe,"f"),this.responsePromise,async(r,n)=>MZi(e(await this.parseResponse(r,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:r,request_id:r.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(gt(this,$Fe,"f"),e))),this.parsedPromise}then(e,r){return this.parse().then(e,r)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};$Fe=new WeakMap;ixt=class{static{a(this,"TG")}constructor(e,r,n,o){vIt.set(this,void 0),En(this,vIt,e,"f"),this.options=o,this.response=r,this.body=n}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new Ri("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await gt(this,vIt,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(vIt=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},c8r=class extends nxt{static{a(this,"b5")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await NZi(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},eoe=class extends ixt{static{a(this,"W4")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let r=this.first_id;return r?{...this.options,query:{...o8r(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...o8r(this.options.query),after_id:e}}:null}},c_=class extends ixt{static{a(this,"D$")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.next_page=n.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{...o8r(this.options.query),page:e}}:null}},OZi=a(()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},"yG");a(sve,"J0");a(QIt,"XQ");LZi=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","fG"),O6r=a(async(t,e,r=!0)=>({...t,body:await z7c(t.body,e,r)}),"J8"),YYi=new WeakMap;a(W7c,"oS");z7c=a(async(t,e,r=!0)=>{if(!await W7c(e))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(t||{}).map(([o,s])=>l8r(n,o,s,r))),n},"tS"),Y7c=a(t=>t instanceof Blob&&"name"in t,"aS"),l8r=a(async(t,e,r,n)=>{if(r!==void 0){if(r==null)throw TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")t.append(e,String(r));else if(r instanceof Response){let o={},s=r.headers.get("Content-Type");s&&(o={type:s}),t.append(e,sve([await r.blob()],QIt(r,n),o))}else if(LZi(r))t.append(e,sve([await new Response(bZi(r)).blob()],QIt(r,n)));else if(Y7c(r))t.append(e,sve([r],QIt(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>l8r(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>l8r(t,`${e}[${o}]`,s,n)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}},"xG"),BZi=a(t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function","Uw"),K7c=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&BZi(t),"sS"),J7c=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","eS");a(Z7c,"_5");a(u8r,"gG");a(X7c,"$v");Sd=class{static{a(this,"t")}constructor(e){this._client=e}},FZi=Symbol.for("brand.privateNullableHeaders");a(eQc,"Jv");mr=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of eQc(n)){let l=s.toLowerCase();o.has(l)||(e.delete(s),o.add(l)),c===null?(e.delete(s),r.add(l)):(e.append(s,c),r.delete(l))}}return{[FZi]:!0,values:e,nulls:r}},"R");a(UZi,"qw");KYi=Object.freeze(Object.create(null)),tQc=a((t=UZi)=>function(e,...r){if(e.length===1)return e[0];let n=!1,o=[],s=e.reduce((d,f,h)=>{/[?#]/.test(f)&&(n=!0);let m=r[h],g=(n?encodeURIComponent:t)(""+m);return h!==r.length&&(m==null||typeof m=="object"&&m.toString===Object.getPrototypeOf(Object.getPrototypeOf(m.hasOwnProperty??KYi)??KYi)?.toString)&&(g=m+"",o.push({start:d.length+f.length,length:g.length,error:`Value of type ${Object.prototype.toString.call(m).slice(8,-1)} is not a valid path parameter`})),d+f+(h===r.length?"":g)},""),c=s.split(/[?#]/,1)[0],l=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,u;for(;(u=l.exec(c))!==null;)o.push({start:u.index,length:u[0].length,error:`Value "${u[0]}" can't be safely passed as a path parameter`});if(o.sort((d,f)=>d.start-f.start),o.length>0){let d=0,f=o.reduce((h,m)=>{let g=" ".repeat(m.start-d),A="^".repeat(m.length);return d=m.start+m.length,h+g+A},"");throw new Ri(`Path parameters result in path with invalid segments: + deps: ${f}}`,"params")};var o={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(u){let[d,f]=s(u);c(u,d),l(u,f)}};function s({schema:u}){let d={},f={};for(let h in u){if(h==="__proto__")continue;let m=Array.isArray(u[h])?d:f;m[h]=u[h]}return[d,f]}a(s,"at");function c(u,d=u.schema){let{gen:f,data:h,it:m}=u;if(Object.keys(d).length===0)return;let g=f.let("missing");for(let A in d){let y=d[A];if(y.length===0)continue;let E=(0,n.propertyInData)(f,h,A,m.opts.ownProperties);u.setParams({property:A,depsCount:y.length,deps:y.join(", ")}),m.allErrors?f.if(E,()=>{for(let _ of y)(0,n.checkReportMissingProp)(u,_)}):(f.if(e._`${E} && (${(0,n.checkMissingProp)(u,y,g)})`),(0,n.reportMissingProp)(u,g),f.else())}}a(c,"vR"),t.validatePropertyDeps=c;function l(u,d=u.schema){let{gen:f,data:h,keyword:m,it:g}=u,A=f.name("valid");for(let y in d)(0,r.alwaysValidSchema)(g,d[y])||(f.if((0,n.propertyInData)(f,h,y,g.opts.ownProperties),()=>{let E=u.subschema({keyword:m,schemaProp:y},A);u.mergeValidEvaluated(E,A)},()=>f.var(A,!0)),u.ok(A))}a(l,"CR"),t.validateSchemaDeps=l,t.default=o}),$7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=gc(),n={message:"property name must be valid",params:a(({params:s})=>e._`{propertyName: ${s.propertyName}}`,"params")},o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:n,code(s){let{gen:c,schema:l,data:u,it:d}=s;if((0,r.alwaysValidSchema)(d,l))return;let f=c.name("valid");c.forIn("key",u,h=>{s.setParams({propertyName:h}),s.subschema({keyword:"propertyNames",data:h,dataTypes:["string"],propertyName:h,compositeRule:!0},f),c.if((0,e.not)(f),()=>{s.error(!0),!d.allErrors&&c.break()})}),s.ok(f)}};t.default=o}),teo=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=JN(),r=Ns(),n=TW(),o=gc(),s={message:"must NOT have additional properties",params:a(({params:l})=>r._`{additionalProperty: ${l.additionalProperty}}`,"params")},c={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:s,code(l){let{gen:u,schema:d,parentSchema:f,data:h,errsCount:m,it:g}=l;if(!m)throw Error("ajv implementation error");let{allErrors:A,opts:y}=g;if(g.props=!0,y.removeAdditional!=="all"&&(0,o.alwaysValidSchema)(g,d))return;let E=(0,e.allSchemaProperties)(f.properties),_=(0,e.allSchemaProperties)(f.patternProperties);v(),l.ok(r._`${m} === ${n.default.errors}`);function v(){u.forIn("key",h,x=>{!E.length&&!_.length?w(x):u.if(b(x),()=>w(x))})}a(v,"B");function b(x){let P;if(E.length>8){let D=(0,o.schemaRefOrVal)(g,f.properties,"properties");P=(0,e.isOwnProperty)(u,D,x)}else E.length?P=(0,r.or)(...E.map(D=>r._`${x} === ${D}`)):P=r.nil;return _.length&&(P=(0,r.or)(P,..._.map(D=>r._`${(0,e.usePattern)(l,D)}.test(${x})`))),(0,r.not)(P)}a(b,"z");function T(x){u.code(r._`delete ${h}[${x}]`)}a(T,"N");function w(x){if(y.removeAdditional==="all"||y.removeAdditional&&d===!1){T(x);return}if(d===!1){l.setParams({additionalProperty:x}),l.error(),!A&&u.break();return}if(typeof d=="object"&&!(0,o.alwaysValidSchema)(g,d)){let P=u.name("valid");y.removeAdditional==="failing"?(R(x,P,!1),u.if((0,r.not)(P),()=>{l.reset(),T(x)})):(R(x,P),!A&&u.if((0,r.not)(P),()=>u.break()))}}a(w,"w");function R(x,P,D){let N={keyword:"additionalProperties",dataProp:x,dataPropType:o.Type.Str};D===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(N,P)}a(R,"O")}};t.default=c}),V7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Fwt(),r=JN(),n=gc(),o=teo(),s={keyword:"properties",type:"object",schemaType:"object",code(c){let{gen:l,schema:u,parentSchema:d,data:f,it:h}=c;h.opts.removeAdditional==="all"&&d.additionalProperties===void 0&&o.default.code(new e.KeywordCxt(h,o.default,"additionalProperties"));let m=(0,r.allSchemaProperties)(u);for(let _ of m)h.definedProperties.add(_);h.opts.unevaluated&&m.length&&h.props!==!0&&(h.props=n.mergeEvaluated.props(l,(0,n.toHash)(m),h.props));let g=m.filter(_=>!(0,n.alwaysValidSchema)(h,u[_]));if(g.length===0)return;let A=l.name("valid");for(let _ of g)y(_)?E(_):(l.if((0,r.propertyInData)(l,f,_,h.opts.ownProperties)),E(_),!h.allErrors&&l.else().var(A,!0),l.endIf()),c.it.definedProperties.add(_),c.ok(A);function y(_){return h.opts.useDefaults&&!h.compositeRule&&u[_].default!==void 0}a(y,"q");function E(_){c.subschema({keyword:"properties",schemaProp:_,dataProp:_},A)}a(E,"V")}};t.default=s}),W7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=JN(),r=Ns(),n=gc(),o=gc(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(c){let{gen:l,schema:u,data:d,parentSchema:f,it:h}=c,{opts:m}=h,g=(0,e.allSchemaProperties)(u),A=g.filter(w=>(0,n.alwaysValidSchema)(h,u[w]));if(g.length===0||A.length===g.length&&(!h.opts.unevaluated||h.props===!0))return;let y=m.strictSchema&&!m.allowMatchingProperties&&f.properties,E=l.name("valid");h.props!==!0&&!(h.props instanceof r.Name)&&(h.props=(0,o.evaluatedPropsToName)(l,h.props));let{props:_}=h;v();function v(){for(let w of g)y&&b(w),h.allErrors?T(w):(l.var(E,!0),T(w),l.if(E))}a(v,"z");function b(w){for(let R in y)new RegExp(w).test(R)&&(0,n.checkStrictMode)(h,`property ${R} matches pattern ${w} (use allowMatchingProperties)`)}a(b,"N");function T(w){l.forIn("key",d,R=>{l.if(r._`${(0,e.usePattern)(c,w)}.test(${R})`,()=>{let x=A.includes(w);x||c.subschema({keyword:"patternProperties",schemaProp:w,dataProp:R,dataPropType:o.Type.Str},E),h.opts.unevaluated&&_!==!0?l.assign(r._`${_}[${R}]`,!0):!x&&!h.allErrors&&l.if((0,r.not)(E),()=>l.break())})})}a(T,"w")}};t.default=s}),z7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=gc(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){let{gen:o,schema:s,it:c}=n;if((0,e.alwaysValidSchema)(c,s)){n.fail();return}let l=o.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),n.failResult(l,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};t.default=r}),Y7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=JN(),r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e.validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r}),K7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=gc(),n={message:"must match exactly one schema in oneOf",params:a(({params:s})=>e._`{passingSchemas: ${s.passing}}`,"params")},o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:n,code(s){let{gen:c,schema:l,parentSchema:u,it:d}=s;if(!Array.isArray(l))throw Error("ajv implementation error");if(d.opts.discriminator&&u.discriminator)return;let f=l,h=c.let("valid",!1),m=c.let("passing",null),g=c.name("_valid");s.setParams({passing:m}),c.block(A),s.result(h,()=>s.reset(),()=>s.error(!0));function A(){f.forEach((y,E)=>{let _;(0,r.alwaysValidSchema)(d,y)?c.var(g,!0):_=s.subschema({keyword:"oneOf",schemaProp:E,compositeRule:!0},g),E>0&&c.if(e._`${g} && ${h}`).assign(h,!1).assign(m,e._`[${m}, ${E}]`).else(),c.if(g,()=>{c.assign(h,!0),c.assign(m,E),_&&s.mergeEvaluated(_,e.Name)})})}a(A,"q")}};t.default=o}),J7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=gc(),r={keyword:"allOf",schemaType:"array",code(n){let{gen:o,schema:s,it:c}=n;if(!Array.isArray(s))throw Error("ajv implementation error");let l=o.name("valid");s.forEach((u,d)=>{if((0,e.alwaysValidSchema)(c,u))return;let f=n.subschema({keyword:"allOf",schemaProp:d},l);n.ok(l),n.mergeEvaluated(f)})}};t.default=r}),Z7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=gc(),n={message:a(({params:c})=>e.str`must match "${c.ifClause}" schema`,"message"),params:a(({params:c})=>e._`{failingKeyword: ${c.ifClause}}`,"params")},o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:n,code(c){let{gen:l,parentSchema:u,it:d}=c;u.then===void 0&&u.else===void 0&&(0,r.checkStrictMode)(d,'"if" without "then" and "else" is ignored');let f=s(d,"then"),h=s(d,"else");if(!f&&!h)return;let m=l.let("valid",!0),g=l.name("_valid");if(A(),c.reset(),f&&h){let E=l.let("ifClause");c.setParams({ifClause:E}),l.if(g,y("then",E),y("else",E))}else f?l.if(g,y("then")):l.if((0,e.not)(g),y("else"));c.pass(m,()=>c.error(!0));function A(){let E=c.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);c.mergeEvaluated(E)}a(A,"H");function y(E,_){return()=>{let v=c.subschema({keyword:E},g);l.assign(m,g),c.mergeValidEvaluated(v,m),_?l.assign(_,e._`${E}`):c.setParams({ifClause:E})}}a(y,"q")}};function s(c,l){let u=c.schema[l];return u!==void 0&&!(0,r.alwaysValidSchema)(c,u)}a(s,"WP"),t.default=o}),X7c=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=gc(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:o,it:s}){o.if===void 0&&(0,e.checkStrictMode)(s,`"${n}" without "if" is ignored`)}};t.default=r}),eQc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=XXi(),r=q7c(),n=eeo(),o=j7c(),s=H7c(),c=G7c(),l=$7c(),u=teo(),d=V7c(),f=W7c(),h=z7c(),m=Y7c(),g=K7c(),A=J7c(),y=Z7c(),E=X7c();function _(v=!1){let b=[h.default,m.default,g.default,A.default,y.default,E.default,l.default,u.default,c.default,d.default,f.default];return v?b.push(r.default,o.default):b.push(e.default,n.default),b.push(s.default),b}a(_,"ra"),t.default=_}),tQc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r={message:a(({schemaCode:o})=>e.str`must match format "${o}"`,"message"),params:a(({schemaCode:o})=>e._`{format: ${o}}`,"params")},n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:r,code(o,s){let{gen:c,data:l,$data:u,schema:d,schemaCode:f,it:h}=o,{opts:m,errSchemaPath:g,schemaEnv:A,self:y}=h;if(!m.validateFormats)return;u?E():_();function E(){let v=c.scopeValue("formats",{ref:y.formats,code:m.code.formats}),b=c.const("fDef",e._`${v}[${f}]`),T=c.let("fType"),w=c.let("format");c.if(e._`typeof ${b} == "object" && !(${b} instanceof RegExp)`,()=>c.assign(T,e._`${b}.type || "string"`).assign(w,e._`${b}.validate`),()=>c.assign(T,e._`"string"`).assign(w,b)),o.fail$data((0,e.or)(R(),x()));function R(){return m.strictSchema===!1?e.nil:e._`${f} && !${w}`}a(R,"j");function x(){let P=A.$async?e._`(${b}.async ? await ${w}(${l}) : ${w}(${l}))`:e._`${w}(${l})`,D=e._`(typeof ${w} == "function" ? ${P} : ${w}.test(${l}))`;return e._`${w} && ${w} !== true && ${T} === ${s} && !${D}`}a(x,"A")}a(E,"z");function _(){let v=y.formats[d];if(!v){R();return}if(v===!0)return;let[b,T,w]=x(v);b===s&&o.pass(P());function R(){if(m.strictSchema===!1){y.logger.warn(D());return}throw Error(D());function D(){return`unknown format "${d}" ignored in schema at path "${g}"`}}a(R,"j");function x(D){let N=D instanceof RegExp?(0,e.regexpCode)(D):m.code.formats?e._`${m.code.formats}${(0,e.getProperty)(d)}`:void 0,L=c.scopeValue("formats",{key:d,ref:D,code:N});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,e._`${L}.validate`]:["string",D,L]}a(x,"A");function P(){if(typeof v=="object"&&!(v instanceof RegExp)&&v.async){if(!A.$async)throw Error("async format in sync schema");return e._`await ${w}(${l})`}return typeof T=="function"?e._`${w}(${l})`:e._`${w}.test(${l})`}a(P,"S")}a(_,"N")}};t.default=n}),rQc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=tQc(),r=[e.default];t.default=r}),nQc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),iQc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=w7c(),r=Q7c(),n=eQc(),o=rQc(),s=nQc(),c=[e.default,r.default,(0,n.default)(),o.default,s.metadataVocabulary,s.contentVocabulary];t.default=c}),oQc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0;var e;(function(r){r.Tag="tag",r.Mapping="mapping"})(e||(t.DiscrError=e={}))}),sQc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Ns(),r=oQc(),n=w9r(),o=Uwt(),s=gc(),c={message:a(({params:{discrError:u,tagName:d}})=>u===r.DiscrError.Tag?`tag "${d}" must be string`:`value of tag "${d}" must be in oneOf`,"message"),params:a(({params:{discrError:u,tag:d,tagName:f}})=>e._`{error: ${u}, tag: ${f}, tagValue: ${d}}`,"params")},l={keyword:"discriminator",type:"object",schemaType:"object",error:c,code(u){let{gen:d,data:f,schema:h,parentSchema:m,it:g}=u,{oneOf:A}=m;if(!g.opts.discriminator)throw Error("discriminator: requires discriminator option");let y=h.propertyName;if(typeof y!="string")throw Error("discriminator: requires propertyName");if(h.mapping)throw Error("discriminator: mapping is not supported");if(!A)throw Error("discriminator: requires oneOf keyword");let E=d.let("valid",!1),_=d.const("tag",e._`${f}${(0,e.getProperty)(y)}`);d.if(e._`typeof ${_} == "string"`,()=>v(),()=>u.error(!1,{discrError:r.DiscrError.Tag,tag:_,tagName:y})),u.ok(E);function v(){let w=T();d.if(!1);for(let R in w)d.elseIf(e._`${_} === ${R}`),d.assign(E,b(w[R]));d.else(),u.error(!1,{discrError:r.DiscrError.Mapping,tag:_,tagName:y}),d.endIf()}a(v,"V");function b(w){let R=d.name("valid"),x=u.subschema({keyword:"oneOf",schemaProp:w},R);return u.mergeEvaluated(x,e.Name),R}a(b,"B");function T(){var w;let R={},x=D(m),P=!0;for(let B=0;B{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),reo=jt((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;var r=T7c(),n=iQc(),o=sQc(),s=aQc(),c=["/properties"],l="http://json-schema.org/draft-07/schema";class u extends r.default{static{a(this,"pJ")}_addVocabularies(){super._addVocabularies(),n.default.forEach(A=>this.addVocabulary(A)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let A=this.opts.$data?this.$dataMetaSchema(s,c):s;this.addMetaSchema(A,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var d=Fwt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return d.KeywordCxt},"get")});var f=Ns();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return f._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return f.str},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return f.stringify},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return f.nil},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return f.Name},"get")}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:a(function(){return f.CodeGen},"get")});var h=x9r();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:a(function(){return h.default},"get")});var m=Uwt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:a(function(){return m.default},"get")})}),cQc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(L,B){return{validate:L,compare:B}}a(e,"b4"),t.fullFormats={date:e(s,c),time:e(u(!0),d),"date-time":e(m(!0),g),"iso-time":e(u(),f),"iso-date-time":e(m(),A),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:N,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:b,int32:{type:"number",validate:R},int64:{type:"number",validate:x},float:{type:"number",validate:P},double:{type:"number",validate:P},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,c),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,d),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,g),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,f),"iso-date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,A),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function r(L){return L%4===0&&(L%100!==0||L%400===0)}a(r,"Is");var n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(L){let B=n.exec(L);if(!B)return!1;let j=+B[1],M=+B[2],O=+B[3];return M>=1&&M<=12&&O>=1&&O<=(M===2&&r(j)?29:o[M])}a(s,"xP");function c(L,B){if(L&&B)return L>B?1:L23||W>59||L&&!q)return!1;if(M<=23&&O<=59&&U<60)return!0;let V=O-W*Q,z=M-Y*Q-(V<0?1:0);return(z===23||z===-1)&&(V===59||V===-1)&&U<61}}a(u,"Jz");function d(L,B){if(!(L&&B))return;let j=new Date("2020-01-01T"+L).valueOf(),M=new Date("2020-01-01T"+B).valueOf();if(j&&M)return j-M}a(d,"Wz");function f(L,B){if(!(L&&B))return;let j=l.exec(L),M=l.exec(B);if(j&&M)return L=j[1]+j[2]+j[3],B=M[1]+M[2]+M[3],L>B?1:L=T}a(R,"Cs");function x(L){return Number.isInteger(L)}a(x,"Ts");function P(){return!0}a(P,"TP");var D=/[^\\]\\Z/;function N(L){if(D.test(L))return!1;try{return new RegExp(L),!0}catch{return!1}}a(N,"ys")}),lQc=jt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;var e=reo(),r=Ns(),n=r.operators,o={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},s={message:a(({keyword:l,schemaCode:u})=>r.str`should be ${o[l].okStr} ${u}`,"message"),params:a(({keyword:l,schemaCode:u})=>r._`{comparison: ${o[l].okStr}, limit: ${u}}`,"params")};t.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:s,code(l){let{gen:u,data:d,schemaCode:f,keyword:h,it:m}=l,{opts:g,self:A}=m;if(!g.validateFormats)return;let y=new e.KeywordCxt(m,A.RULES.all.format.definition,"format");y.$data?E():_();function E(){let b=u.scopeValue("formats",{ref:A.formats,code:g.code.formats}),T=u.const("fmt",r._`${b}[${y.schemaCode}]`);l.fail$data((0,r.or)(r._`typeof ${T} != "object"`,r._`${T} instanceof RegExp`,r._`typeof ${T}.compare != "function"`,v(T)))}a(E,"q");function _(){let b=y.schema,T=A.formats[b];if(!T||T===!0)return;if(typeof T!="object"||T instanceof RegExp||typeof T.compare!="function")throw Error(`"${h}": format "${b}" does not define "compare" function`);let w=u.scopeValue("formats",{key:b,ref:T,code:g.code.formats?r._`${g.code.formats}${(0,r.getProperty)(b)}`:void 0});l.fail$data(v(w))}a(_,"V");function v(b){return r._`${b}.compare(${d}, ${f}) ${o[h].fail} 0`}a(v,"B")},dependencies:["format"]};var c=a(l=>(l.addKeyword(t.formatLimitDefinition),l),"us");t.default=c}),uQc=jt((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=cQc(),n=lQc(),o=Ns(),s=new o.Name("fullFormats"),c=new o.Name("fastFormats"),l=a((d,f={keywords:!0})=>{if(Array.isArray(f))return u(d,f,r.fullFormats,s),d;let[h,m]=f.mode==="fast"?[r.fastFormats,c]:[r.fullFormats,s],g=f.formats||r.formatNames;return u(d,g,h,m),f.keywords&&(0,n.default)(d),d},"Kz");l.get=(d,f="full")=>{let h=(f==="fast"?r.fastFormats:r.fullFormats)[d];if(!h)throw Error(`Unknown format "${d}"`);return h};function u(d,f,h,m){var g,A;(g=(A=d.opts.code).formats)!==null&&g!==void 0||(A.formats=o._`require("ajv-formats/dist/formats").${m}`);for(let y of f)d.addFormat(y,h[y])}a(u,"dP"),e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l}),dQc=50;a(s6r,"g9");a(ceo,"K5");a(fQc,"Uk");a(roe,"v4");jwt=["PreToolUse","PostToolUse","PostToolUseFailure","PostToolBatch","Notification","UserPromptSubmit","UserPromptExpansion","SessionStart","SessionEnd","Stop","StopFailure","SubagentStart","SubagentStop","PreCompact","PostCompact","PermissionRequest","PermissionDenied","Setup","TeammateIdle","TaskCreated","TaskCompleted","Elicitation","ElicitationResult","ConfigChange","WorktreeCreate","WorktreeRemove","InstructionsLoaded","CwdChanged","FileChanged","MessageDisplay"],pQc=["clear","resume","logout","prompt_input_exit","other","bypass_permissions_disabled"],hQc="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__",mQc=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,gQc=/(.*?)<\/command-name>/;a(k9r,"h9");AQc={customTitle:"customTitle",aiTitle:"aiTitle",lastPrompt:"lastPrompt",summary:"summaryHint",gitBranch:"gitBranch"};a(feo,"q5");a(yQc,"JN");a(aW,"G1");a(EQc,"zk");a(_Qc,"Nk");a(vQc,"wk");a6r=class{static{a(this,"FG")}store=new Map;mtimes=new Map;summaries=new Map;lastMtime=0;keyToString(e){let r=[e.projectKey,e.sessionId];return e.subpath&&r.push(e.subpath),r.join("/")}async append(e,r){let n=this.keyToString(e),o=this.store.get(n)??[];o.push(...r),this.store.set(n,o);let s=Math.max(Date.now(),this.lastMtime+1);if(this.lastMtime=s,this.mtimes.set(n,s),e.subpath===void 0){let c=`${e.projectKey}/${e.sessionId}`,l=feo(this.summaries.get(c),e,r,{mtime:s});this.summaries.set(c,l)}}async load(e){let r=this.keyToString(e);return this.store.get(r)??null}async listSessions(e){let r=[],n=e+"/";for(let[o]of this.store)if(o.startsWith(n)){let s=o.slice(n.length);s.includes("/")||r.push({sessionId:s,mtime:this.mtimes.get(o)??0})}return r}async listSessionSummaries(e){let r=[],n=e+"/";for(let[o,s]of this.summaries)o.startsWith(n)&&r.push(s);return r}async delete(e){let r=this.keyToString(e);if(this.store.delete(r),this.mtimes.delete(r),e.subpath===void 0){this.summaries.delete(`${e.projectKey}/${e.sessionId}`);let n=`${e.projectKey}/${e.sessionId}/`;for(let o of this.store.keys())o.startsWith(n)&&(this.store.delete(o),this.mtimes.delete(o))}}async listSubkeys(e){let r=`${e.projectKey}/${e.sessionId}/`,n=[];for(let o of this.store.keys())o.startsWith(r)&&n.push(o.slice(r.length));return n}getEntries(e){return this.store.get(this.keyToString(e))??[]}get size(){let e=0;for(let r of this.store.keys()){let n=r.indexOf("/");n!==-1&&!r.slice(n+1).includes("/")&&e++}return e}clear(){this.store.clear(),this.mtimes.clear(),this.summaries.clear()}},M1=class extends Error{static{a(this,"W6")}};a(peo,"V5");a(d_,"R$");a(n6e,"U1");CQc=typeof global=="object"&&global&&global.Object===Object&&global,heo=CQc,bQc=typeof self=="object"&&self&&self.Object===Object&&self,SQc=heo||bQc||Function("return this")(),eCe=SQc,TQc=eCe.Symbol,_W=TQc,meo=Object.prototype,IQc=meo.hasOwnProperty,xQc=meo.toString,zFe=_W?_W.toStringTag:void 0;a(wQc,"Ak");RQc=wQc,kQc=Object.prototype,PQc=kQc.toString;a(DQc,"Pk");NQc=DQc,MQc="[object Null]",OQc="[object Undefined]",NJi=_W?_W.toStringTag:void 0;a(LQc,"_k");i6e=LQc;a(BQc,"kk");sU=BQc,FQc="[object AsyncFunction]",UQc="[object Function]",QQc="[object GeneratorFunction]",qQc="[object Proxy]";a(jQc,"xk");P9r=jQc,HQc=eCe["__core-js_shared__"],x8r=HQc,MJi=(function(){var t=/[^.]+$/.exec(x8r&&x8r.keys&&x8r.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();a(GQc,"fk");$Qc=GQc,VQc=Function.prototype,WQc=VQc.toString;a(zQc,"uk");YQc=zQc,KQc=/[\\^$.*+?()[\]{}|]/g,JQc=/^\[object .+?Constructor\]$/,ZQc=Function.prototype,XQc=Object.prototype,eqc=ZQc.toString,tqc=XQc.hasOwnProperty,rqc=RegExp("^"+eqc.call(tqc).replace(KQc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");a(nqc,"rk");iqc=nqc;a(oqc,"ok");sqc=oqc;a(aqc,"tk");D9r=aqc,cqc=D9r(Object,"create"),w8e=cqc;a(lqc,"sk");uqc=lqc;a(dqc,"ek");fqc=dqc,pqc="__lodash_hash_undefined__",hqc=Object.prototype,mqc=hqc.hasOwnProperty;a(gqc,"XS");Aqc=gqc,yqc=Object.prototype,Eqc=yqc.hasOwnProperty;a(_qc,"GS");vqc=_qc,Cqc="__lodash_hash_undefined__";a(bqc,"HS");Sqc=bqc;a(tCe,"a0");tCe.prototype.clear=uqc;tCe.prototype.delete=fqc;tCe.prototype.get=Aqc;tCe.prototype.has=vqc;tCe.prototype.set=Sqc;OJi=tCe;a(Tqc,"KS");Iqc=Tqc;a(xqc,"qS");Hwt=xqc;a(wqc,"VS");Gwt=wqc,Rqc=Array.prototype,kqc=Rqc.splice;a(Pqc,"NS");Dqc=Pqc;a(Nqc,"wS");Mqc=Nqc;a(Oqc,"OS");Lqc=Oqc;a(Bqc,"DS");Fqc=Bqc;a(rCe,"s0");rCe.prototype.clear=Iqc;rCe.prototype.delete=Dqc;rCe.prototype.get=Mqc;rCe.prototype.has=Lqc;rCe.prototype.set=Fqc;$wt=rCe,Uqc=D9r(eCe,"Map"),geo=Uqc;a(Qqc,"ZS");qqc=Qqc;a(jqc,"MS");Hqc=jqc;a(Gqc,"LS");Vwt=Gqc;a($qc,"jS");Vqc=$qc;a(Wqc,"AS");zqc=Wqc;a(Yqc,"IS");Kqc=Yqc;a(Jqc,"RS");Zqc=Jqc;a(nCe,"e0");nCe.prototype.clear=qqc;nCe.prototype.delete=Vqc;nCe.prototype.get=zqc;nCe.prototype.has=Kqc;nCe.prototype.set=Zqc;N9r=nCe,Xqc="Expected a function";a(M9r,"MG");M9r.Cache=N9r;Oy=M9r,iCe=Oy(()=>(process.env.CLAUDE_CONFIG_DIR??(0,yeo.join)((0,Aeo.homedir)(),".claude")).normalize("NFC"),()=>process.env.CLAUDE_CONFIG_DIR),Stm=Oy(()=>d_(process.env.CLAUDE_CODE_SUPERVISED));a(En,"y");a(gt,"Z");Eeo=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return Eeo=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))},"LG");a(R8e,"T4");c6r=a(t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return Error(JSON.stringify(t))}catch{}}return Error(t)},"l9"),wi=class extends Error{static{a(this,"g")}},eC=class t extends wi{static{a(this,"n$")}constructor(e,r,n,o,s){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=o,this.requestID=o?.get("request-id"),this.error=r,this.type=s??null}static makeMessage(e,r,n){let o=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&o?`${e} ${o}`:e?`${e} status code (no body)`:o||"(no status code or body)"}static generate(e,r,n,o){if(!e||!o)return new Pve({message:n,cause:c6r(r)});let s=r,c=s?.error?.type;return e===400?new Axt(e,s,n,o,c):e===401?new yxt(e,s,n,o,c):e===403?new Ext(e,s,n,o,c):e===404?new _xt(e,s,n,o,c):e===409?new vxt(e,s,n,o,c):e===422?new Cxt(e,s,n,o,c):e===429?new bxt(e,s,n,o,c):e>=500?new Sxt(e,s,n,o,c):new t(e,s,n,o,c)}},LI=class extends eC{static{a(this,"Q6")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},Pve=class extends eC{static{a(this,"e1")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},gxt=class extends Pve{static{a(this,"c9")}constructor({message:e}={}){super({message:e??"Request timed out."})}},Axt=class extends eC{static{a(this,"p9")}},yxt=class extends eC{static{a(this,"d9")}},Ext=class extends eC{static{a(this,"i9")}},_xt=class extends eC{static{a(this,"n9")}},vxt=class extends eC{static{a(this,"r9")}},Cxt=class extends eC{static{a(this,"o9")}},bxt=class extends eC{static{a(this,"t9")}},Sxt=class extends eC{static{a(this,"a9")}},ejc=/^[a-z][a-z0-9+.-]*:/i,tjc=a(t=>ejc.test(t),"bN"),l6r=a(t=>(l6r=Array.isArray,l6r(t)),"jG"),LJi=l6r;a(u6r,"w5");a(BJi,"IG");a(rjc,"_N");njc=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new wi(`${t} must be an integer`);if(e<0)throw new wi(`${t} must be a positive integer`);return e},"kN"),_eo=a(t=>{try{return JSON.parse(t)}catch{return}},"O5"),ijc=a(t=>new Promise(e=>setTimeout(e,t)),"SN"),mW="0.94.0",ojc=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","xN");a(sjc,"SS");ajc=a(()=>{let t=sjc();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":mW,"X-Stainless-OS":UJi(Deno.build.os),"X-Stainless-Arch":FJi(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":mW,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":mW,"X-Stainless-OS":UJi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":FJi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=cjc();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":mW,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":mW,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"vS");a(cjc,"CS");FJi=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","vN"),UJi=a(t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),"CN"),O9r=a(()=>QJi??(QJi=ajc()),"s9");a(ljc,"yN");a(veo,"RG");a(Ceo,"D5");a(L9r,"e9");a(ujc,"fN");djc=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"gN");a(fjc,"hN");pjc="urn:ietf:params:oauth:grant-type:jwt-bearer",hjc="refresh_token",beo="/v1/oauth/token",Txt="oauth-2025-04-20",mjc="oidc-federation-2026-04-01",gjc=120,B9r=30,Ajc=5,qJi=1048576;a(Seo,"Z5");a(Teo,"M5");w8r=2e3,yjc=new Set(["error","error_description","error_uri"]);a(Tk,"Z6");a(Ieo,"L5");a(xeo,"j5");a(Ejc,"fS");iu=class extends wi{static{a(this,"O$")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}};a(noe,"Y4");d6r=class{static{a(this,"EG")}constructor(e,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=r}async getToken(){let e=this.nextForce;this.nextForce=!1;let r=this.cached;if(e||r==null)return(await this.refresh(e)).token;if(r.expiresAt==null)return r.token;let n=r.expiresAt-noe();return n>gjc?r.token:n>B9r?(this.backgroundRefresh(),r.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||noe()-this.lastAdvisoryError{this.lastAdvisoryError=noe(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(r=>(this.cached=r,this.pendingRefresh=null,r),r=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}},ru=a(t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0},"w$");a(_jc,"rN");a(F9r,"Q8");a(GJi,"bG");Ixt={off:0,error:200,warn:300,info:400,debug:500},$Ji=a((t,e,r)=>{if(t){if(rjc(Ixt,t))return t;cA(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(Ixt))}`)}},"_G");a(m8e,"$Q");a(GIt,"A5");vjc={error:m8e,warn:m8e,info:m8e,debug:m8e},VJi=new WeakMap;a(cA,"m$");eoe=a(t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="x-api-key"||e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t),"x4"),weo="1.0",Cjc=/^[A-Za-z0-9_.-]+$/;a(Reo,"tN");bjc=a(async t=>{var e,r;let n=await U9r();if(n===null)return null;let o=t??await keo();if(o===null)return null;Reo(o);let s=await import("node:fs"),c=(await import("node:path")).join(n,"configs",`${o}.json`),l;try{l=await s.promises.readFile(c,"utf-8")}catch(f){if(f?.code!=="ENOENT")throw Error(`failed to read config file ${c}: ${f}`);l=null}if(l===null){let f=ru("ANTHROPIC_ORGANIZATION_ID"),h=ru("ANTHROPIC_IDENTITY_TOKEN_FILE"),m=ru("ANTHROPIC_FEDERATION_RULE_ID");return m&&f?{fromFile:!1,config:{organization_id:f,workspace_id:ru("ANTHROPIC_WORKSPACE_ID"),base_url:ru("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:m,service_account_id:ru("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:h?{source:"file",path:h}:void 0,scope:ru("ANTHROPIC_SCOPE")}}}:null}let u;try{u=JSON.parse(l)}catch(f){throw Error(`failed to parse config file ${c}: ${f}`)}if(!u.authentication)throw Error(`config file ${c} is missing "authentication"`);let d=u.authentication.type;if(d!=="oidc_federation"&&d!=="user_oauth")throw Error(`authentication.type "${d}" is not a known authentication type`);if(u.organization_id??(u.organization_id=ru("ANTHROPIC_ORGANIZATION_ID")),u.workspace_id??(u.workspace_id=ru("ANTHROPIC_WORKSPACE_ID")),u.base_url??(u.base_url=ru("ANTHROPIC_BASE_URL")),(e=u.authentication).scope??(e.scope=ru("ANTHROPIC_SCOPE")),u.authentication.type==="oidc_federation"){if(!u.authentication.identity_token){let f=ru("ANTHROPIC_IDENTITY_TOKEN_FILE");f&&(u.authentication.identity_token={source:"file",path:f})}u.authentication.federation_rule_id||(u.authentication.federation_rule_id=ru("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=u.authentication).service_account_id??(r.service_account_id=ru("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:u,fromFile:!0}},"aN"),Sjc=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await U9r();if(!r)return null;let n=e??await keo();return n?(Reo(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"sN"),U9r=a(async()=>{if(!Tjc())return null;let t=await import("node:path"),e=ru("ANTHROPIC_CONFIG_DIR");if(e)return e;if(O9r()["X-Stainless-OS"]==="Windows"){let o=ru("APPDATA");if(o)return t.join(o,"Anthropic");let s=ru("USERPROFILE");return s?t.join(s,"AppData","Roaming","Anthropic"):null}let r=ru("XDG_CONFIG_HOME");if(r)return t.join(r,"anthropic");let n=ru("HOME");return n?t.join(n,".config","anthropic"):null},"kG"),Tjc=a(()=>{let t=O9r()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"uS"),keo=a(async()=>{let t=await U9r();if(!t)return null;let e=ru("ANTHROPIC_PROFILE");if(e)return e;let r=await import("node:fs"),n=(await import("node:path")).join(t,"active_config");try{return(await r.promises.readFile(n,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw Error(`failed to read ${n}: ${o}`);return"default"}},"eN");a(WJi,"SG");a(Ijc,"$w");a(xjc,"Qw");a(wjc,"Jw");a(Peo,"vG");a(Rjc,"Xw");a(kjc,"mS");a(Pjc,"lS");a(Djc,"cS");coe=class{static{a(this,"B1")}constructor(){NI.set(this,void 0),MI.set(this,void 0),En(this,NI,new Uint8Array,"f"),En(this,MI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?F9r(e):e;En(this,NI,_jc([gt(this,NI,"f"),r]),"f");let n=[],o;for(;(o=Njc(gt(this,NI,"f"),gt(this,MI,"f")))!=null;){if(o.carriage&>(this,MI,"f")==null){En(this,MI,o.index,"f");continue}if(gt(this,MI,"f")!=null&&(o.index!==gt(this,MI,"f")+1||o.carriage)){n.push(GJi(gt(this,NI,"f").subarray(0,gt(this,MI,"f")-1))),En(this,NI,gt(this,NI,"f").subarray(gt(this,MI,"f")),"f"),En(this,MI,null,"f");continue}let s=gt(this,MI,"f")!==null?o.preceding-1:o.preceding,c=GJi(gt(this,NI,"f").subarray(0,s));n.push(c),En(this,NI,gt(this,NI,"f").subarray(o.index),"f"),En(this,MI,null,"f")}return n}flush(){return gt(this,NI,"f").length?this.decode(` +`):[]}};NI=new WeakMap,MI=new WeakMap;coe.NEWLINE_CHARS=new Set([` +`,"\r"]);coe.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(Njc,"pS");a(Mjc,"Yw");loe=class t{static{a(this,"x6")}constructor(e,r,n){this.iterator=e,YFe.set(this,void 0),this.controller=r,En(this,YFe,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?cA(n):console;async function*c(){if(o)throw new wi("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of Ojc(e,r)){if(u.event==="completion")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event==="message_start"||u.event==="message_delta"||u.event==="message_stop"||u.event==="content_block_start"||u.event==="content_block_delta"||u.event==="content_block_stop"||u.event==="message"||u.event==="user.message"||u.event==="user.interrupt"||u.event==="user.tool_confirmation"||u.event==="user.custom_tool_result"||u.event==="agent.message"||u.event==="agent.thinking"||u.event==="agent.tool_use"||u.event==="agent.tool_result"||u.event==="agent.mcp_tool_use"||u.event==="agent.mcp_tool_result"||u.event==="agent.custom_tool_use"||u.event==="agent.thread_context_compacted"||u.event==="session.status_running"||u.event==="session.status_idle"||u.event==="session.status_rescheduled"||u.event==="session.status_terminated"||u.event==="session.error"||u.event==="session.deleted"||u.event==="span.model_request_start"||u.event==="span.model_request_end")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event!=="ping"&&u.event==="error"){let d=_eo(u.data)??u.data,f=d?.error?.type;throw new eC(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(R8e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}static fromReadableStream(e,r,n){let o=!1;async function*s(){let l=new coe,u=L9r(e);for await(let d of u)for(let f of l.decode(d))yield f;for(let d of l.flush())yield d}a(s,"X");async function*c(){if(o)throw new wi("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of s())l||u&&(yield JSON.parse(u));l=!0}catch(u){if(R8e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}[(YFe=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),o=a(s=>({next:a(()=>{if(s.length===0){let c=n.next();e.push(c),r.push(c)}return s.shift()},"next")}),"Y");return[new t(()=>o(e),this.controller,gt(this,YFe,"f")),new t(()=>o(r),this.controller,gt(this,YFe,"f"))]}toReadableStream(){let e=this,r;return veo({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:o,done:s}=await r.next();if(s)return n.close();let c=F9r(JSON.stringify(o)+` +`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(Ojc,"dS");a(Ljc,"iS");f6r=class{static{a(this,"Ww")}constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let s={event:this.event,data:this.data.join(` +`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[r,n,o]=Bjc(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(Bjc,"nS");a(Deo,"P5");a(Neo,"CG");xxt=class t extends Promise{static{a(this,"Q0")}constructor(e,r,n=Deo){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,g8e.set(this,void 0),En(this,g8e,e,"f")}_thenUnwrap(e){return new t(gt(this,g8e,"f"),this.responsePromise,async(r,n)=>Neo(e(await this.parseResponse(r,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:r,request_id:r.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(gt(this,g8e,"f"),e))),this.parsedPromise}then(e,r){return this.parse().then(e,r)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};g8e=new WeakMap;wxt=class{static{a(this,"TG")}constructor(e,r,n,o){$It.set(this,void 0),En(this,$It,e,"f"),this.options=o,this.response=r,this.body=n}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new wi("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await gt(this,$It,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[($It=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},p6r=class extends xxt{static{a(this,"b5")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await Deo(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},uoe=class extends wxt{static{a(this,"W4")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let r=this.first_id;return r?{...this.options,query:{...u6r(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...u6r(this.options.query),after_id:e}}:null}},p_=class extends wxt{static{a(this,"D$")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.next_page=n.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{...u6r(this.options.query),page:e}}:null}},Meo=a(()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},"yG");a(Ive,"J0");a(uxt,"XQ");Oeo=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","fG"),Q9r=a(async(t,e,r=!0)=>({...t,body:await Ujc(t.body,e,r)}),"J8"),zJi=new WeakMap;a(Fjc,"oS");Ujc=a(async(t,e,r=!0)=>{if(!await Fjc(e))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(t||{}).map(([o,s])=>h6r(n,o,s,r))),n},"tS"),Qjc=a(t=>t instanceof Blob&&"name"in t,"aS"),h6r=a(async(t,e,r,n)=>{if(r!==void 0){if(r==null)throw TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")t.append(e,String(r));else if(r instanceof Response){let o={},s=r.headers.get("Content-Type");s&&(o={type:s}),t.append(e,Ive([await r.blob()],uxt(r,n),o))}else if(Oeo(r))t.append(e,Ive([await new Response(Ceo(r)).blob()],uxt(r,n)));else if(Qjc(r))t.append(e,Ive([r],uxt(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>h6r(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>h6r(t,`${e}[${o}]`,s,n)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}},"xG"),Leo=a(t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function","Uw"),qjc=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&Leo(t),"sS"),jjc=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","eS");a(Hjc,"_5");a(m6r,"gG");a(Gjc,"$v");Rd=class{static{a(this,"t")}constructor(e){this._client=e}},Beo=Symbol.for("brand.privateNullableHeaders");a($jc,"Jv");mr=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of $jc(n)){let l=s.toLowerCase();o.has(l)||(e.delete(s),o.add(l)),c===null?(e.delete(s),r.add(l)):(e.append(s,c),r.delete(l))}}return{[Beo]:!0,values:e,nulls:r}},"R");a(Feo,"qw");YJi=Object.freeze(Object.create(null)),Vjc=a((t=Feo)=>function(e,...r){if(e.length===1)return e[0];let n=!1,o=[],s=e.reduce((d,f,h)=>{/[?#]/.test(f)&&(n=!0);let m=r[h],g=(n?encodeURIComponent:t)(""+m);return h!==r.length&&(m==null||typeof m=="object"&&m.toString===Object.getPrototypeOf(Object.getPrototypeOf(m.hasOwnProperty??YJi)??YJi)?.toString)&&(g=m+"",o.push({start:d.length+f.length,length:g.length,error:`Value of type ${Object.prototype.toString.call(m).slice(8,-1)} is not a valid path parameter`})),d+f+(h===r.length?"":g)},""),c=s.split(/[?#]/,1)[0],l=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,u;for(;(u=l.exec(c))!==null;)o.push({start:u.index,length:u[0].length,error:`Value "${u[0]}" can't be safely passed as a path parameter`});if(o.sort((d,f)=>d.start-f.start),o.length>0){let d=0,f=o.reduce((h,m)=>{let g=" ".repeat(m.start-d),A="^".repeat(m.length);return d=m.start+m.length,h+g+A},"");throw new wi(`Path parameters result in path with invalid segments: ${o.map(h=>h.error).join(` `)} ${s} -${f}`)}return s},"Xv"),$n=tQc(UZi),oxt=class extends Sd{static{a(this,"YQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/environments/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/environments/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/environments?beta=true",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/environments/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/environments/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},XFe=Symbol("anthropic.sdk.stainlessHelper");a(qIt,"k5");a(QZi,"hG");a(qZi,"S5");a(rQc,"Vw");sxt=class extends Sd{static{a(this,"GQ")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",eoe,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/files/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/files/${e}/content?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/files/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,r){let{betas:n,...o}=e;return this._client.post("/v1/files?beta=true",O6r({body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},rQc(o.file),r?.headers])},this._client))}},axt=class extends Sd{static{a(this,"UQ")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/models/${e}?beta=true`,{...n,headers:mr([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models?beta=true",eoe,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},cxt=class extends Sd{static{a(this,"HQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/user_profiles?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/user_profiles/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}},lxt=class extends Sd{static{a(this,"KQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/agents/${e}/versions?beta=true`,c_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},o8e=class extends Sd{static{a(this,"X8")}constructor(){super(...arguments),this.versions=new lxt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get($n`/v1/agents/${e}?beta=true`,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/agents/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/agents?beta=true",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/agents/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};o8e.Versions=lxt;uxt=class extends Sd{static{a(this,"qQ")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post($n`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get($n`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{memory_store_id:o,view:s,betas:c,...l}=r;return this._client.post($n`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:mr([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/memory_stores/${e}/memories?beta=true`,c_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{memory_store_id:o,expected_content_sha256:s,betas:c}=r;return this._client.delete($n`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:mr([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},dxt=class extends Sd{static{a(this,"VQ")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get($n`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/memory_stores/${e}/memory_versions?beta=true`,c_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}redact(e,r,n){let{memory_store_id:o,betas:s}=r;return this._client.post($n`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},fve=class extends Sd{static{a(this,"X0")}constructor(){super(...arguments),this.memories=new uxt(this._client),this.memoryVersions=new dxt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/memory_stores/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/memory_stores/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};fve.Memories=uxt;fve.MemoryVersions=dxt;fxt=class t{static{a(this,"Y8")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new Zie;for await(let r of this.iterator)for(let n of e.decode(r))yield JSON.parse(n);for(let r of e.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,r){if(!e.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Ri("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Ri("Attempted to iterate over a response with no body");return new t(P6r(e.body),r)}},pxt=class extends Sd{static{a(this,"BQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/messages/batches?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/messages/batches/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",eoe,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/messages/batches/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,r={},n){let o=await this.retrieve(e);if(!o.results_url)throw new Ri(`No batch \`results_url\`; Has it finished processing? ${o.processing_status} - ${o.id}`);let{betas:s}=r??{};return this._client.get(o.results_url,{...n,headers:mr([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>fxt.fromResponse(l.response,l.controller))}},jZi={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};a(HZi,"Bw");a(JYi,"uG");a(GZi,"mG");a(nQc,"Nv");iQc=a(t=>{let e=0,r=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),eve(t);case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),eve(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),eve(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),eve(t);break;case"delimiter":return t=t.slice(0,t.length-1),eve(t)}return t},"W8"),oQc=a(t=>{let e=[];return t.map(r=>{r.type==="brace"&&(r.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(r=>{r==="}"?t.push({type:"brace",value:"}"}):r==="]"&&t.push({type:"paren",value:"]"})}),t},"Ov"),sQc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"Dv"),$Zi=a(t=>JSON.parse(sQc(oQc(eve(iQc(t))))),"C5"),eKi="__json_buf";a(tKi,"Ow");d8r=class t{static{a(this,"ZQ")}constructor(e,r){dk.add(this),this.messages=[],this.receivedMessages=[],KV.set(this,void 0),W_e.set(this,null),this.controller=new AbortController,TFe.set(this,void 0),CIt.set(this,()=>{}),IFe.set(this,()=>{}),xFe.set(this,void 0),bIt.set(this,()=>{}),wFe.set(this,()=>{}),U9.set(this,{}),RFe.set(this,!1),SIt.set(this,!1),TIt.set(this,!1),Qie.set(this,!1),IIt.set(this,void 0),xIt.set(this,void 0),kFe.set(this,void 0),wIt.set(this,n=>{if(En(this,SIt,!0,"f"),i8e(n)&&(n=new kI),n instanceof kI)return En(this,TIt,!0,"f"),this._emit("abort",n);if(n instanceof Ri)return this._emit("error",n);if(n instanceof Error){let o=new Ri(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ri(String(n)))}),En(this,TFe,new Promise((n,o)=>{En(this,CIt,n,"f"),En(this,IFe,o,"f")}),"f"),En(this,xFe,new Promise((n,o)=>{En(this,bIt,n,"f"),En(this,wFe,o,"f")}),"f"),gt(this,TFe,"f").catch(()=>{}),gt(this,xFe,"f").catch(()=>{}),En(this,W_e,e,"f"),En(this,kFe,r?.logger??console,"f")}get response(){return gt(this,IIt,"f")}get request_id(){return gt(this,xIt,"f")}async withResponse(){En(this,Qie,!0,"f");let e=await gt(this,TFe,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return En(s,W_e,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},gt(this,wIt,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{gt(this,dk,"m",TFr).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)gt(this,dk,"m",IFr).call(this,u);if(l.controller.signal?.aborted)throw new kI;gt(this,dk,"m",xFr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(En(this,IIt,e,"f"),En(this,xIt,e?.headers.get("request-id"),"f"),gt(this,CIt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,RFe,"f")}get errored(){return gt(this,SIt,"f")}get aborted(){return gt(this,TIt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,U9,"f")[e]||(gt(this,U9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,U9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(gt(this,U9,"f")[e]||(gt(this,U9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{En(this,Qie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){En(this,Qie,!0,"f"),await gt(this,xFe,"f")}get currentMessage(){return gt(this,KV,"f")}async finalMessage(){return await this.done(),gt(this,dk,"m",SFr).call(this)}async finalText(){return await this.done(),gt(this,dk,"m",ZYi).call(this)}_emit(e,...r){if(gt(this,RFe,"f"))return;e==="end"&&(En(this,RFe,!0,"f"),gt(this,bIt,"f").call(this));let n=gt(this,U9,"f")[e];if(n&&(gt(this,U9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,Qie,"f")&&!n?.length&&Promise.reject(o),gt(this,IFe,"f").call(this,o),gt(this,wFe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,Qie,"f")&&!n?.length&&Promise.reject(o),gt(this,IFe,"f").call(this,o),gt(this,wFe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,dk,"m",SFr).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{gt(this,dk,"m",TFr).call(this),this._connected(null);let s=Xie.fromReadableStream(e,this.controller);for await(let c of s)gt(this,dk,"m",IFr).call(this,c);if(s.controller.signal?.aborted)throw new kI;gt(this,dk,"m",xFr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(KV=new WeakMap,W_e=new WeakMap,TFe=new WeakMap,CIt=new WeakMap,IFe=new WeakMap,xFe=new WeakMap,bIt=new WeakMap,wFe=new WeakMap,U9=new WeakMap,RFe=new WeakMap,SIt=new WeakMap,TIt=new WeakMap,Qie=new WeakMap,IIt=new WeakMap,xIt=new WeakMap,kFe=new WeakMap,wIt=new WeakMap,dk=new WeakSet,SFr=a(function(){if(this.receivedMessages.length===0)throw new Ri("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"lG"),ZYi=a(function(){if(this.receivedMessages.length===0)throw new Ri("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(e.length===0)throw new Ri("stream ended without producing a content block with type=text");return e.join(" ")},"zw"),TFr=a(function(){this.ended||En(this,KV,void 0,"f")},"cG"),IFr=a(function(e){if(this.ended)return;let r=gt(this,dk,"m",XYi).call(this,e);switch(this._emit("streamEvent",e,r),e.type){case"content_block_delta":{let n=r.content.at(-1);switch(e.delta.type){case"text_delta":{n.type==="text"&&this._emit("text",e.delta.text,n.text||"");break}case"citations_delta":{n.type==="text"&&this._emit("citation",e.delta.citation,n.citations??[]);break}case"input_json_delta":{tKi(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break}case"thinking_delta":{n.type==="thinking"&&this._emit("thinking",e.delta.thinking,n.thinking);break}case"signature_delta":{n.type==="thinking"&&this._emit("signature",n.signature);break}case"compaction_delta":{n.type==="compaction"&&n.content&&this._emit("compaction",n.content);break}default:e.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(JYi(r,gt(this,W_e,"f"),{logger:gt(this,kFe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{En(this,KV,r,"f");break}case"content_block_start":case"message_delta":break}},"pG"),xFr=a(function(){if(this.ended)throw new Ri("stream has ended, this shouldn't happen");let e=gt(this,KV,"f");if(!e)throw new Ri("request ended without sending any chunks");return En(this,KV,void 0,"f"),JYi(e,gt(this,W_e,"f"),{logger:gt(this,kFe,"f")})},"dG"),XYi=a(function(e){let r=gt(this,KV,"f");if(e.type==="message_start"){if(r)throw new Ri(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ri(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":return r;case"message_delta":return r.container=e.delta.container,r.stop_reason=e.delta.stop_reason,r.stop_sequence=e.delta.stop_sequence,r.usage.output_tokens=e.usage.output_tokens,r.context_management=e.context_management,e.usage.input_tokens!=null&&(r.usage.input_tokens=e.usage.input_tokens),e.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),e.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),e.usage.server_tool_use!=null&&(r.usage.server_tool_use=e.usage.server_tool_use),e.usage.iterations!=null&&(r.usage.iterations=e.usage.iterations),r;case"content_block_start":return r.content.push(e.content_block),r;case"content_block_delta":{let n=r.content.at(e.index);switch(e.delta.type){case"text_delta":{n?.type==="text"&&(r.content[e.index]={...n,text:(n.text||"")+e.delta.text});break}case"citations_delta":{n?.type==="text"&&(r.content[e.index]={...n,citations:[...n.citations??[],e.delta.citation]});break}case"input_json_delta":{if(n&&tKi(n)){let o=n[eKi]||"";o+=e.delta.partial_json;let s={...n};if(Object.defineProperty(s,eKi,{value:o,enumerable:!1,writable:!0}),o)try{s.input=$Zi(o)}catch(c){let l=new Ri(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${c}. JSON: ${o}`);gt(this,wIt,"f").call(this,l)}r.content[e.index]=s}break}case"thinking_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,thinking:n.thinking+e.delta.thinking});break}case"signature_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,signature:e.delta.signature});break}case"compaction_delta":{n?.type==="compaction"&&(r.content[e.index]={...n,content:(n.content||"")+e.delta.content});break}default:e.delta}return r}case"content_block_stop":return r}},"Nw"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((o,s)=>r.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new Xie(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},hxt=class extends Error{static{a(this,"U8")}constructor(e){let r=typeof e=="string"?e:e.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=e}},aQc=1e5,cQc=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: +${f}`)}return s},"Xv"),$n=Vjc(Feo),Rxt=class extends Rd{static{a(this,"YQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/environments/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/environments/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/environments?beta=true",p_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/environments/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/environments/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},S8e=Symbol("anthropic.sdk.stainlessHelper");a(dxt,"k5");a(Ueo,"hG");a(Qeo,"S5");a(Wjc,"Vw");kxt=class extends Rd{static{a(this,"GQ")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",uoe,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/files/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/files/${e}/content?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/files/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,r){let{betas:n,...o}=e;return this._client.post("/v1/files?beta=true",Q9r({body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},Wjc(o.file),r?.headers])},this._client))}},Pxt=class extends Rd{static{a(this,"UQ")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/models/${e}?beta=true`,{...n,headers:mr([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models?beta=true",uoe,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},Dxt=class extends Rd{static{a(this,"HQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/user_profiles?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/user_profiles/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",p_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}},Nxt=class extends Rd{static{a(this,"KQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/agents/${e}/versions?beta=true`,p_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},k8e=class extends Rd{static{a(this,"X8")}constructor(){super(...arguments),this.versions=new Nxt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get($n`/v1/agents/${e}?beta=true`,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/agents/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/agents?beta=true",p_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/agents/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};k8e.Versions=Nxt;Mxt=class extends Rd{static{a(this,"qQ")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post($n`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get($n`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{memory_store_id:o,view:s,betas:c,...l}=r;return this._client.post($n`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:mr([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/memory_stores/${e}/memories?beta=true`,p_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{memory_store_id:o,expected_content_sha256:s,betas:c}=r;return this._client.delete($n`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:mr([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},Oxt=class extends Rd{static{a(this,"VQ")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get($n`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/memory_stores/${e}/memory_versions?beta=true`,p_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}redact(e,r,n){let{memory_store_id:o,betas:s}=r;return this._client.post($n`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},Dve=class extends Rd{static{a(this,"X0")}constructor(){super(...arguments),this.memories=new Mxt(this._client),this.memoryVersions=new Oxt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/memory_stores/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",p_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/memory_stores/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Dve.Memories=Mxt;Dve.MemoryVersions=Oxt;Lxt=class t{static{a(this,"Y8")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new coe;for await(let r of this.iterator)for(let n of e.decode(r))yield JSON.parse(n);for(let r of e.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,r){if(!e.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new wi("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new wi("Attempted to iterate over a response with no body");return new t(L9r(e.body),r)}},Bxt=class extends Rd{static{a(this,"BQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/messages/batches?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/messages/batches/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",uoe,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/messages/batches/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,r={},n){let o=await this.retrieve(e);if(!o.results_url)throw new wi(`No batch \`results_url\`; Has it finished processing? ${o.processing_status} - ${o.id}`);let{betas:s}=r??{};return this._client.get(o.results_url,{...n,headers:mr([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>Lxt.fromResponse(l.response,l.controller))}},qeo={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};a(jeo,"Bw");a(KJi,"uG");a(Heo,"mG");a(zjc,"Nv");Yjc=a(t=>{let e=0,r=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),_ve(t);case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),_ve(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),_ve(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),_ve(t);break;case"delimiter":return t=t.slice(0,t.length-1),_ve(t)}return t},"W8"),Kjc=a(t=>{let e=[];return t.map(r=>{r.type==="brace"&&(r.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(r=>{r==="}"?t.push({type:"brace",value:"}"}):r==="]"&&t.push({type:"paren",value:"]"})}),t},"Ov"),Jjc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"Dv"),Geo=a(t=>JSON.parse(Jjc(Kjc(_ve(Yjc(t))))),"C5"),XJi="__json_buf";a(eZi,"Ow");g6r=class t{static{a(this,"ZQ")}constructor(e,r){_k.add(this),this.messages=[],this.receivedMessages=[],cW.set(this,void 0),pve.set(this,null),this.controller=new AbortController,KFe.set(this,void 0),VIt.set(this,()=>{}),JFe.set(this,()=>{}),ZFe.set(this,void 0),WIt.set(this,()=>{}),XFe.set(this,()=>{}),J9.set(this,{}),e8e.set(this,!1),zIt.set(this,!1),YIt.set(this,!1),Kie.set(this,!1),KIt.set(this,void 0),JIt.set(this,void 0),t8e.set(this,void 0),ZIt.set(this,n=>{if(En(this,zIt,!0,"f"),R8e(n)&&(n=new LI),n instanceof LI)return En(this,YIt,!0,"f"),this._emit("abort",n);if(n instanceof wi)return this._emit("error",n);if(n instanceof Error){let o=new wi(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new wi(String(n)))}),En(this,KFe,new Promise((n,o)=>{En(this,VIt,n,"f"),En(this,JFe,o,"f")}),"f"),En(this,ZFe,new Promise((n,o)=>{En(this,WIt,n,"f"),En(this,XFe,o,"f")}),"f"),gt(this,KFe,"f").catch(()=>{}),gt(this,ZFe,"f").catch(()=>{}),En(this,pve,e,"f"),En(this,t8e,r?.logger??console,"f")}get response(){return gt(this,KIt,"f")}get request_id(){return gt(this,JIt,"f")}async withResponse(){En(this,Kie,!0,"f");let e=await gt(this,KFe,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return En(s,pve,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},gt(this,ZIt,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{gt(this,_k,"m",k8r).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)gt(this,_k,"m",P8r).call(this,u);if(l.controller.signal?.aborted)throw new LI;gt(this,_k,"m",D8r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(En(this,KIt,e,"f"),En(this,JIt,e?.headers.get("request-id"),"f"),gt(this,VIt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,e8e,"f")}get errored(){return gt(this,zIt,"f")}get aborted(){return gt(this,YIt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,J9,"f")[e]||(gt(this,J9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,J9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(gt(this,J9,"f")[e]||(gt(this,J9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{En(this,Kie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){En(this,Kie,!0,"f"),await gt(this,ZFe,"f")}get currentMessage(){return gt(this,cW,"f")}async finalMessage(){return await this.done(),gt(this,_k,"m",R8r).call(this)}async finalText(){return await this.done(),gt(this,_k,"m",JJi).call(this)}_emit(e,...r){if(gt(this,e8e,"f"))return;e==="end"&&(En(this,e8e,!0,"f"),gt(this,WIt,"f").call(this));let n=gt(this,J9,"f")[e];if(n&&(gt(this,J9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,Kie,"f")&&!n?.length&&Promise.reject(o),gt(this,JFe,"f").call(this,o),gt(this,XFe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,Kie,"f")&&!n?.length&&Promise.reject(o),gt(this,JFe,"f").call(this,o),gt(this,XFe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,_k,"m",R8r).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{gt(this,_k,"m",k8r).call(this),this._connected(null);let s=loe.fromReadableStream(e,this.controller);for await(let c of s)gt(this,_k,"m",P8r).call(this,c);if(s.controller.signal?.aborted)throw new LI;gt(this,_k,"m",D8r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(cW=new WeakMap,pve=new WeakMap,KFe=new WeakMap,VIt=new WeakMap,JFe=new WeakMap,ZFe=new WeakMap,WIt=new WeakMap,XFe=new WeakMap,J9=new WeakMap,e8e=new WeakMap,zIt=new WeakMap,YIt=new WeakMap,Kie=new WeakMap,KIt=new WeakMap,JIt=new WeakMap,t8e=new WeakMap,ZIt=new WeakMap,_k=new WeakSet,R8r=a(function(){if(this.receivedMessages.length===0)throw new wi("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"lG"),JJi=a(function(){if(this.receivedMessages.length===0)throw new wi("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(e.length===0)throw new wi("stream ended without producing a content block with type=text");return e.join(" ")},"zw"),k8r=a(function(){this.ended||En(this,cW,void 0,"f")},"cG"),P8r=a(function(e){if(this.ended)return;let r=gt(this,_k,"m",ZJi).call(this,e);switch(this._emit("streamEvent",e,r),e.type){case"content_block_delta":{let n=r.content.at(-1);switch(e.delta.type){case"text_delta":{n.type==="text"&&this._emit("text",e.delta.text,n.text||"");break}case"citations_delta":{n.type==="text"&&this._emit("citation",e.delta.citation,n.citations??[]);break}case"input_json_delta":{eZi(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break}case"thinking_delta":{n.type==="thinking"&&this._emit("thinking",e.delta.thinking,n.thinking);break}case"signature_delta":{n.type==="thinking"&&this._emit("signature",n.signature);break}case"compaction_delta":{n.type==="compaction"&&n.content&&this._emit("compaction",n.content);break}default:e.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(KJi(r,gt(this,pve,"f"),{logger:gt(this,t8e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{En(this,cW,r,"f");break}case"content_block_start":case"message_delta":break}},"pG"),D8r=a(function(){if(this.ended)throw new wi("stream has ended, this shouldn't happen");let e=gt(this,cW,"f");if(!e)throw new wi("request ended without sending any chunks");return En(this,cW,void 0,"f"),KJi(e,gt(this,pve,"f"),{logger:gt(this,t8e,"f")})},"dG"),ZJi=a(function(e){let r=gt(this,cW,"f");if(e.type==="message_start"){if(r)throw new wi(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new wi(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":return r;case"message_delta":return r.container=e.delta.container,r.stop_reason=e.delta.stop_reason,r.stop_sequence=e.delta.stop_sequence,r.usage.output_tokens=e.usage.output_tokens,r.context_management=e.context_management,e.usage.input_tokens!=null&&(r.usage.input_tokens=e.usage.input_tokens),e.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),e.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),e.usage.server_tool_use!=null&&(r.usage.server_tool_use=e.usage.server_tool_use),e.usage.iterations!=null&&(r.usage.iterations=e.usage.iterations),r;case"content_block_start":return r.content.push(e.content_block),r;case"content_block_delta":{let n=r.content.at(e.index);switch(e.delta.type){case"text_delta":{n?.type==="text"&&(r.content[e.index]={...n,text:(n.text||"")+e.delta.text});break}case"citations_delta":{n?.type==="text"&&(r.content[e.index]={...n,citations:[...n.citations??[],e.delta.citation]});break}case"input_json_delta":{if(n&&eZi(n)){let o=n[XJi]||"";o+=e.delta.partial_json;let s={...n};if(Object.defineProperty(s,XJi,{value:o,enumerable:!1,writable:!0}),o)try{s.input=Geo(o)}catch(c){let l=new wi(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${c}. JSON: ${o}`);gt(this,ZIt,"f").call(this,l)}r.content[e.index]=s}break}case"thinking_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,thinking:n.thinking+e.delta.thinking});break}case"signature_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,signature:e.delta.signature});break}case"compaction_delta":{n?.type==="compaction"&&(r.content[e.index]={...n,content:(n.content||"")+e.delta.content});break}default:e.delta}return r}case"content_block_stop":return r}},"Nw"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((o,s)=>r.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new loe(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},Fxt=class extends Error{static{a(this,"U8")}constructor(e){let r=typeof e=="string"?e:e.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=e}},Zjc=1e5,Xjc=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: 1. Task Overview The user's core request and success criteria Any clarifications or constraints they specified @@ -1571,24 +1571,24 @@ User preferences or style requirements Domain-specific details that aren't obvious Any promises made to the user Be concise but complete\u2014err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task. -Wrap your summary in tags.`;a(nKi,"Lw");mxt=class{static{a(this,"jQ")}constructor(e,r,n){PFe.add(this),this.client=e,z_e.set(this,!1),qie.set(this,!1),Q0.set(this,void 0),w1.set(this,void 0),II.set(this,void 0),G9.set(this,void 0),JV.set(this,void 0),DFe.set(this,0),En(this,Q0,{params:{...r,messages:structuredClone(r.messages)}},"f");let o=["BetaToolRunner",...QZi(r.tools,r.messages)].join(", ");En(this,w1,{...n,headers:mr([{"x-stainless-helper":o},n?.headers])},"f"),En(this,JV,nKi(),"f"),r.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(z_e=new WeakMap,qie=new WeakMap,Q0=new WeakMap,w1=new WeakMap,II=new WeakMap,G9=new WeakMap,JV=new WeakMap,DFe=new WeakMap,PFe=new WeakSet,rKi=a(async function(){let e=gt(this,Q0,"f").params.compactionControl;if(!e||!e.enabled)return!1;let r=0;if(gt(this,II,"f")!==void 0)try{let u=await gt(this,II,"f");r=u.usage.input_tokens+(u.usage.cache_creation_input_tokens??0)+(u.usage.cache_read_input_tokens??0)+u.usage.output_tokens}catch{return!1}let n=e.contextTokenThreshold??aQc;if(rf.type!=="tool_use");d.length===0?c.pop():u.content=d}}let l=await this.client.beta.messages.create({model:o,messages:[...c,{role:"user",content:[{type:"text",text:s}]}],max_tokens:gt(this,Q0,"f").params.max_tokens},{signal:gt(this,w1,"f").signal,headers:mr([gt(this,w1,"f").headers,{"x-stainless-helper":"compaction"}])});if(l.content[0]?.type!=="text")throw new Ri("Expected text response for compaction");return gt(this,Q0,"f").params.messages=[{role:"user",content:l.content}],!0},"Mw"),Symbol.asyncIterator)](){var e;if(gt(this,z_e,"f"))throw new Ri("Cannot iterate over a consumed stream");En(this,z_e,!0,"f"),En(this,qie,!0,"f"),En(this,G9,void 0,"f");try{for(;;){let r;try{if(gt(this,Q0,"f").params.max_iterations&>(this,DFe,"f")>=gt(this,Q0,"f").params.max_iterations)break;En(this,qie,!1,"f"),En(this,G9,void 0,"f"),En(this,DFe,(e=gt(this,DFe,"f"),e++,e),"f"),En(this,II,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=gt(this,Q0,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},gt(this,w1,"f")),En(this,II,r.finalMessage(),"f"),gt(this,II,"f").catch(()=>{}),yield r):(En(this,II,this.client.beta.messages.create({...s,stream:!1},gt(this,w1,"f")),"f"),yield gt(this,II,"f")),!await gt(this,PFe,"m",rKi).call(this)){if(!gt(this,qie,"f")){let{role:l,content:u}=await gt(this,II,"f");gt(this,Q0,"f").params.messages.push({role:l,content:u})}let c=await gt(this,PFe,"m",f8r).call(this,gt(this,Q0,"f").params.messages.at(-1));if(c)gt(this,Q0,"f").params.messages.push(c);else if(!gt(this,qie,"f"))break}}finally{r&&r.abort()}}if(!gt(this,II,"f"))throw new Ri("ToolRunner concluded without a message from the server");gt(this,JV,"f").resolve(await gt(this,II,"f"))}catch(r){throw En(this,z_e,!1,"f"),gt(this,JV,"f").promise.catch(()=>{}),gt(this,JV,"f").reject(r),En(this,JV,nKi(),"f"),r}}setMessagesParams(e){typeof e=="function"?gt(this,Q0,"f").params=e(gt(this,Q0,"f").params):gt(this,Q0,"f").params=e,En(this,qie,!0,"f"),En(this,G9,void 0,"f")}setRequestOptions(e){typeof e=="function"?En(this,w1,e(gt(this,w1,"f")),"f"):En(this,w1,{...gt(this,w1,"f"),...e},"f")}async generateToolResponse(e=gt(this,w1,"f").signal){let r=await gt(this,II,"f")??this.params.messages.at(-1);return r?gt(this,PFe,"m",f8r).call(this,r,e):null}done(){return gt(this,JV,"f").promise}async runUntilDone(){if(!gt(this,z_e,"f"))for await(let e of this);return this.done()}get params(){return gt(this,Q0,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};f8r=a(async function(t,e=gt(this,w1,"f").signal){return gt(this,G9,"f")!==void 0?gt(this,G9,"f"):(En(this,G9,lQc(gt(this,Q0,"f").params,t,{...gt(this,w1,"f"),signal:e}),"f"),gt(this,G9,"f"))},"iG");a(lQc,"Fv");iKi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},uQc=["claude-mythos-preview","claude-opus-4-6"],toe=class extends Sd{static{a(this,"w1")}constructor(){super(...arguments),this.batches=new pxt(this._client)}create(e,r){let n=oKi(e),{betas:o,...s}=n;s.model in iKi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${iKi[s.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),uQc.includes(s.model)&&s.thinking&&s.thinking.type==="enabled"&&console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let c=this._client._options.timeout;if(!s.stream&&c==null){let u=jZi[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=qZi(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:mr([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:mr([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>GZi(n,e,{logger:this._client.logger??console}))}stream(e,r){return d8r.createMessage(this,e,r)}countTokens(e,r){let n=oKi(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:mr([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new mxt(this._client,e,r)}};a(oKi,"Aw");toe.Batches=pxt;toe.BetaToolRunner=mxt;toe.ToolError=hxt;gxt=class extends Sd{static{a(this,"AQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/sessions/${e}/events?beta=true`,c_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}},Axt=class extends Sd{static{a(this,"IQ")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get($n`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.post($n`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/sessions/${e}/resources?beta=true`,c_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{session_id:o,betas:s}=r;return this._client.delete($n`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},pve=class extends Sd{static{a(this,"G0")}constructor(){super(...arguments),this.events=new gxt(this._client),this.resources=new Axt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/sessions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/sessions?beta=true",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/sessions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/sessions/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};pve.Events=gxt;pve.Resources=Axt;yxt=class extends Sd{static{a(this,"RQ")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post($n`/v1/skills/${e}/versions?beta=true`,O6r({body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])},this._client))}retrieve(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get($n`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/skills/${e}/versions?beta=true`,c_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}delete(e,r,n){let{skill_id:o,betas:s}=r;return this._client.delete($n`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}},s8e=class extends Sd{static{a(this,"K8")}constructor(){super(...arguments),this.versions=new yxt(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",O6r({body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])},this._client,!1))}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/skills/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/skills?beta=true",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/skills/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};s8e.Versions=yxt;Ext=class extends Sd{static{a(this,"PQ")}create(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{vault_id:o,betas:s}=r;return this._client.get($n`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{vault_id:o,betas:s,...c}=r;return this._client.post($n`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/vaults/${e}/credentials?beta=true`,c_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{vault_id:o,betas:s}=r;return this._client.delete($n`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post($n`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},a8e=class extends Sd{static{a(this,"q8")}constructor(){super(...arguments),this.credentials=new Ext(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/vaults/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/vaults?beta=true",c_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/vaults/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/vaults/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};a8e.Credentials=Ext;k1=class extends Sd{static{a(this,"G6")}constructor(){super(...arguments),this.models=new axt(this._client),this.messages=new toe(this._client),this.agents=new o8e(this._client),this.environments=new oxt(this._client),this.sessions=new pve(this._client),this.vaults=new a8e(this._client),this.memoryStores=new fve(this._client),this.files=new sxt(this._client),this.skills=new s8e(this._client),this.userProfiles=new cxt(this._client)}};k1.Models=axt;k1.Messages=toe;k1.Agents=o8e;k1.Environments=oxt;k1.Sessions=pve;k1.Vaults=a8e;k1.MemoryStores=fve;k1.Files=sxt;k1.Skills=s8e;k1.UserProfiles=cxt;_xt=class extends Sd{static{a(this,"V8")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}};a(VZi,"Iw");a(sKi,"nG");a(WZi,"rG");a(dQc,"bv");lKi="__json_buf";a(uKi,"bw");p8r=class t{static{a(this,"CQ")}constructor(e,r){fk.add(this),this.messages=[],this.receivedMessages=[],ZV.set(this,void 0),Y_e.set(this,null),this.controller=new AbortController,NFe.set(this,void 0),RIt.set(this,()=>{}),MFe.set(this,()=>{}),OFe.set(this,void 0),kIt.set(this,()=>{}),LFe.set(this,()=>{}),Q9.set(this,{}),BFe.set(this,!1),PIt.set(this,!1),DIt.set(this,!1),jie.set(this,!1),NIt.set(this,void 0),MIt.set(this,void 0),FFe.set(this,void 0),RFr.set(this,n=>{if(En(this,PIt,!0,"f"),i8e(n)&&(n=new kI),n instanceof kI)return En(this,DIt,!0,"f"),this._emit("abort",n);if(n instanceof Ri)return this._emit("error",n);if(n instanceof Error){let o=new Ri(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ri(String(n)))}),En(this,NFe,new Promise((n,o)=>{En(this,RIt,n,"f"),En(this,MFe,o,"f")}),"f"),En(this,OFe,new Promise((n,o)=>{En(this,kIt,n,"f"),En(this,LFe,o,"f")}),"f"),gt(this,NFe,"f").catch(()=>{}),gt(this,OFe,"f").catch(()=>{}),En(this,Y_e,e,"f"),En(this,FFe,r?.logger??console,"f")}get response(){return gt(this,NIt,"f")}get request_id(){return gt(this,MIt,"f")}async withResponse(){En(this,jie,!0,"f");let e=await gt(this,NFe,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return En(s,Y_e,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},gt(this,RFr,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{gt(this,fk,"m",kFr).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)gt(this,fk,"m",PFr).call(this,u);if(l.controller.signal?.aborted)throw new kI;gt(this,fk,"m",DFr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(En(this,NIt,e,"f"),En(this,MIt,e?.headers.get("request-id"),"f"),gt(this,RIt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,BFe,"f")}get errored(){return gt(this,PIt,"f")}get aborted(){return gt(this,DIt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,Q9,"f")[e]||(gt(this,Q9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,Q9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(gt(this,Q9,"f")[e]||(gt(this,Q9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{En(this,jie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){En(this,jie,!0,"f"),await gt(this,OFe,"f")}get currentMessage(){return gt(this,ZV,"f")}async finalMessage(){return await this.done(),gt(this,fk,"m",wFr).call(this)}async finalText(){return await this.done(),gt(this,fk,"m",aKi).call(this)}_emit(e,...r){if(gt(this,BFe,"f"))return;e==="end"&&(En(this,BFe,!0,"f"),gt(this,kIt,"f").call(this));let n=gt(this,Q9,"f")[e];if(n&&(gt(this,Q9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,jie,"f")&&!n?.length&&Promise.reject(o),gt(this,MFe,"f").call(this,o),gt(this,LFe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,jie,"f")&&!n?.length&&Promise.reject(o),gt(this,MFe,"f").call(this,o),gt(this,LFe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,fk,"m",wFr).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{gt(this,fk,"m",kFr).call(this),this._connected(null);let s=Xie.fromReadableStream(e,this.controller);for await(let c of s)gt(this,fk,"m",PFr).call(this,c);if(s.controller.signal?.aborted)throw new kI;gt(this,fk,"m",DFr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(ZV=new WeakMap,Y_e=new WeakMap,NFe=new WeakMap,RIt=new WeakMap,MFe=new WeakMap,OFe=new WeakMap,kIt=new WeakMap,LFe=new WeakMap,Q9=new WeakMap,BFe=new WeakMap,PIt=new WeakMap,DIt=new WeakMap,jie=new WeakMap,NIt=new WeakMap,MIt=new WeakMap,FFe=new WeakMap,RFr=new WeakMap,fk=new WeakSet,wFr=a(function(){if(this.receivedMessages.length===0)throw new Ri("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"oG"),aKi=a(function(){if(this.receivedMessages.length===0)throw new Ri("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(e.length===0)throw new Ri("stream ended without producing a content block with type=text");return e.join(" ")},"Rw"),kFr=a(function(){this.ended||En(this,ZV,void 0,"f")},"aG"),PFr=a(function(e){if(this.ended)return;let r=gt(this,fk,"m",cKi).call(this,e);switch(this._emit("streamEvent",e,r),e.type){case"content_block_delta":{let n=r.content.at(-1);switch(e.delta.type){case"text_delta":{n.type==="text"&&this._emit("text",e.delta.text,n.text||"");break}case"citations_delta":{n.type==="text"&&this._emit("citation",e.delta.citation,n.citations??[]);break}case"input_json_delta":{uKi(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break}case"thinking_delta":{n.type==="thinking"&&this._emit("thinking",e.delta.thinking,n.thinking);break}case"signature_delta":{n.type==="thinking"&&this._emit("signature",n.signature);break}default:e.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(sKi(r,gt(this,Y_e,"f"),{logger:gt(this,FFe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{En(this,ZV,r,"f");break}case"content_block_start":case"message_delta":break}},"sG"),DFr=a(function(){if(this.ended)throw new Ri("stream has ended, this shouldn't happen");let e=gt(this,ZV,"f");if(!e)throw new Ri("request ended without sending any chunks");return En(this,ZV,void 0,"f"),sKi(e,gt(this,Y_e,"f"),{logger:gt(this,FFe,"f")})},"eG"),cKi=a(function(e){let r=gt(this,ZV,"f");if(e.type==="message_start"){if(r)throw new Ri(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ri(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":return r;case"message_delta":return r.stop_reason=e.delta.stop_reason,r.stop_sequence=e.delta.stop_sequence,r.usage.output_tokens=e.usage.output_tokens,e.usage.input_tokens!=null&&(r.usage.input_tokens=e.usage.input_tokens),e.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),e.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),e.usage.server_tool_use!=null&&(r.usage.server_tool_use=e.usage.server_tool_use),r;case"content_block_start":return r.content.push({...e.content_block}),r;case"content_block_delta":{let n=r.content.at(e.index);switch(e.delta.type){case"text_delta":{n?.type==="text"&&(r.content[e.index]={...n,text:(n.text||"")+e.delta.text});break}case"citations_delta":{n?.type==="text"&&(r.content[e.index]={...n,citations:[...n.citations??[],e.delta.citation]});break}case"input_json_delta":{if(n&&uKi(n)){let o=n[lKi]||"";o+=e.delta.partial_json;let s={...n};Object.defineProperty(s,lKi,{value:o,enumerable:!1,writable:!0}),o&&(s.input=$Zi(o)),r.content[e.index]=s}break}case"thinking_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,thinking:n.thinking+e.delta.thinking});break}case"signature_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,signature:e.delta.signature});break}default:e.delta}return r}case"content_block_stop":return r}},"Pw"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((o,s)=>r.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new Xie(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},vxt=class extends Sd{static{a(this,"TQ")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get($n`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",eoe,{query:e,...r})}delete(e,r){return this._client.delete($n`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post($n`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new Ri(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:mr([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>fxt.fromResponse(s.response,s.controller))}},c8e=class extends Sd{static{a(this,"H0")}constructor(){super(...arguments),this.batches=new vxt(this._client)}create(e,r){e.model in dKi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${dKi[e.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),fQc.includes(e.model)&&e.thinking&&e.thinking.type==="enabled"&&console.warn(`Using Claude with ${e.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let n=this._client._options.timeout;if(!e.stream&&n==null){let s=jZi[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=qZi(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:mr([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>WZi(n,e,{logger:this._client.logger??console}))}stream(e,r){return p8r.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},dKi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026"},fQc=["claude-mythos-preview","claude-opus-4-6"];c8e.Batches=vxt;Cxt=class extends Sd{static{a(this,"z8")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/models/${e}`,{...n,headers:mr([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models",eoe,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},pQc="\\n\\nHuman:",hQc="\\n\\nAssistant:",Mp=class{static{a(this,"f$")}get credentials(){return this._authState.provider}constructor({baseURL:e=tu("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,...o}={}){if(h8r.add(this),this._requestAuthFlags=new WeakMap,jIt.set(this,void 0),r===void 0&&(r=o.profile!=null?null:tu("ANTHROPIC_API_KEY")??null),n===void 0&&(n=o.profile!=null?null:tu("ANTHROPIC_AUTH_TOKEN")??null),o.profile!=null&&(o.credentials!=null||o.config!=null))throw TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let s={apiKey:r,authToken:n,...o,baseURL:e||"https://api.anthropic.com"};if(!s.dangerouslyAllowBrowser&&h7c())throw new Ri(`It looks like you're running in a browser-like environment. +Wrap your summary in tags.`;a(rZi,"Lw");Uxt=class{static{a(this,"jQ")}constructor(e,r,n){r8e.add(this),this.client=e,hve.set(this,!1),Jie.set(this,!1),j0.set(this,void 0),N1.set(this,void 0),DI.set(this,void 0),rU.set(this,void 0),lW.set(this,void 0),n8e.set(this,0),En(this,j0,{params:{...r,messages:structuredClone(r.messages)}},"f");let o=["BetaToolRunner",...Ueo(r.tools,r.messages)].join(", ");En(this,N1,{...n,headers:mr([{"x-stainless-helper":o},n?.headers])},"f"),En(this,lW,rZi(),"f"),r.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(hve=new WeakMap,Jie=new WeakMap,j0=new WeakMap,N1=new WeakMap,DI=new WeakMap,rU=new WeakMap,lW=new WeakMap,n8e=new WeakMap,r8e=new WeakSet,tZi=a(async function(){let e=gt(this,j0,"f").params.compactionControl;if(!e||!e.enabled)return!1;let r=0;if(gt(this,DI,"f")!==void 0)try{let u=await gt(this,DI,"f");r=u.usage.input_tokens+(u.usage.cache_creation_input_tokens??0)+(u.usage.cache_read_input_tokens??0)+u.usage.output_tokens}catch{return!1}let n=e.contextTokenThreshold??Zjc;if(rf.type!=="tool_use");d.length===0?c.pop():u.content=d}}let l=await this.client.beta.messages.create({model:o,messages:[...c,{role:"user",content:[{type:"text",text:s}]}],max_tokens:gt(this,j0,"f").params.max_tokens},{signal:gt(this,N1,"f").signal,headers:mr([gt(this,N1,"f").headers,{"x-stainless-helper":"compaction"}])});if(l.content[0]?.type!=="text")throw new wi("Expected text response for compaction");return gt(this,j0,"f").params.messages=[{role:"user",content:l.content}],!0},"Mw"),Symbol.asyncIterator)](){var e;if(gt(this,hve,"f"))throw new wi("Cannot iterate over a consumed stream");En(this,hve,!0,"f"),En(this,Jie,!0,"f"),En(this,rU,void 0,"f");try{for(;;){let r;try{if(gt(this,j0,"f").params.max_iterations&>(this,n8e,"f")>=gt(this,j0,"f").params.max_iterations)break;En(this,Jie,!1,"f"),En(this,rU,void 0,"f"),En(this,n8e,(e=gt(this,n8e,"f"),e++,e),"f"),En(this,DI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=gt(this,j0,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},gt(this,N1,"f")),En(this,DI,r.finalMessage(),"f"),gt(this,DI,"f").catch(()=>{}),yield r):(En(this,DI,this.client.beta.messages.create({...s,stream:!1},gt(this,N1,"f")),"f"),yield gt(this,DI,"f")),!await gt(this,r8e,"m",tZi).call(this)){if(!gt(this,Jie,"f")){let{role:l,content:u}=await gt(this,DI,"f");gt(this,j0,"f").params.messages.push({role:l,content:u})}let c=await gt(this,r8e,"m",A6r).call(this,gt(this,j0,"f").params.messages.at(-1));if(c)gt(this,j0,"f").params.messages.push(c);else if(!gt(this,Jie,"f"))break}}finally{r&&r.abort()}}if(!gt(this,DI,"f"))throw new wi("ToolRunner concluded without a message from the server");gt(this,lW,"f").resolve(await gt(this,DI,"f"))}catch(r){throw En(this,hve,!1,"f"),gt(this,lW,"f").promise.catch(()=>{}),gt(this,lW,"f").reject(r),En(this,lW,rZi(),"f"),r}}setMessagesParams(e){typeof e=="function"?gt(this,j0,"f").params=e(gt(this,j0,"f").params):gt(this,j0,"f").params=e,En(this,Jie,!0,"f"),En(this,rU,void 0,"f")}setRequestOptions(e){typeof e=="function"?En(this,N1,e(gt(this,N1,"f")),"f"):En(this,N1,{...gt(this,N1,"f"),...e},"f")}async generateToolResponse(e=gt(this,N1,"f").signal){let r=await gt(this,DI,"f")??this.params.messages.at(-1);return r?gt(this,r8e,"m",A6r).call(this,r,e):null}done(){return gt(this,lW,"f").promise}async runUntilDone(){if(!gt(this,hve,"f"))for await(let e of this);return this.done()}get params(){return gt(this,j0,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};A6r=a(async function(t,e=gt(this,N1,"f").signal){return gt(this,rU,"f")!==void 0?gt(this,rU,"f"):(En(this,rU,eHc(gt(this,j0,"f").params,t,{...gt(this,N1,"f"),signal:e}),"f"),gt(this,rU,"f"))},"iG");a(eHc,"Fv");nZi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},tHc=["claude-mythos-preview","claude-opus-4-6"],doe=class extends Rd{static{a(this,"w1")}constructor(){super(...arguments),this.batches=new Bxt(this._client)}create(e,r){let n=iZi(e),{betas:o,...s}=n;s.model in nZi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${nZi[s.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),tHc.includes(s.model)&&s.thinking&&s.thinking.type==="enabled"&&console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let c=this._client._options.timeout;if(!s.stream&&c==null){let u=qeo[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=Qeo(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:mr([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:mr([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>Heo(n,e,{logger:this._client.logger??console}))}stream(e,r){return g6r.createMessage(this,e,r)}countTokens(e,r){let n=iZi(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:mr([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new Uxt(this._client,e,r)}};a(iZi,"Aw");doe.Batches=Bxt;doe.BetaToolRunner=Uxt;doe.ToolError=Fxt;Qxt=class extends Rd{static{a(this,"AQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/sessions/${e}/events?beta=true`,p_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}},qxt=class extends Rd{static{a(this,"IQ")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get($n`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.post($n`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/sessions/${e}/resources?beta=true`,p_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{session_id:o,betas:s}=r;return this._client.delete($n`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},Nve=class extends Rd{static{a(this,"G0")}constructor(){super(...arguments),this.events=new Qxt(this._client),this.resources=new qxt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/sessions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/sessions?beta=true",p_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/sessions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/sessions/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Nve.Events=Qxt;Nve.Resources=qxt;jxt=class extends Rd{static{a(this,"RQ")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post($n`/v1/skills/${e}/versions?beta=true`,Q9r({body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])},this._client))}retrieve(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get($n`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/skills/${e}/versions?beta=true`,p_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}delete(e,r,n){let{skill_id:o,betas:s}=r;return this._client.delete($n`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}},P8e=class extends Rd{static{a(this,"K8")}constructor(){super(...arguments),this.versions=new jxt(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",Q9r({body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])},this._client,!1))}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/skills/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/skills?beta=true",p_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/skills/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};P8e.Versions=jxt;Hxt=class extends Rd{static{a(this,"PQ")}create(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{vault_id:o,betas:s}=r;return this._client.get($n`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{vault_id:o,betas:s,...c}=r;return this._client.post($n`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/vaults/${e}/credentials?beta=true`,p_,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{vault_id:o,betas:s}=r;return this._client.delete($n`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post($n`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},D8e=class extends Rd{static{a(this,"q8")}constructor(){super(...arguments),this.credentials=new Hxt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/vaults/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/vaults?beta=true",p_,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/vaults/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/vaults/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};D8e.Credentials=Hxt;O1=class extends Rd{static{a(this,"G6")}constructor(){super(...arguments),this.models=new Pxt(this._client),this.messages=new doe(this._client),this.agents=new k8e(this._client),this.environments=new Rxt(this._client),this.sessions=new Nve(this._client),this.vaults=new D8e(this._client),this.memoryStores=new Dve(this._client),this.files=new kxt(this._client),this.skills=new P8e(this._client),this.userProfiles=new Dxt(this._client)}};O1.Models=Pxt;O1.Messages=doe;O1.Agents=k8e;O1.Environments=Rxt;O1.Sessions=Nve;O1.Vaults=D8e;O1.MemoryStores=Dve;O1.Files=kxt;O1.Skills=P8e;O1.UserProfiles=Dxt;Gxt=class extends Rd{static{a(this,"V8")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}};a($eo,"Iw");a(oZi,"nG");a(Veo,"rG");a(rHc,"bv");cZi="__json_buf";a(lZi,"bw");y6r=class t{static{a(this,"CQ")}constructor(e,r){vk.add(this),this.messages=[],this.receivedMessages=[],uW.set(this,void 0),mve.set(this,null),this.controller=new AbortController,i8e.set(this,void 0),XIt.set(this,()=>{}),o8e.set(this,()=>{}),s8e.set(this,void 0),ext.set(this,()=>{}),a8e.set(this,()=>{}),Z9.set(this,{}),c8e.set(this,!1),txt.set(this,!1),rxt.set(this,!1),Zie.set(this,!1),nxt.set(this,void 0),ixt.set(this,void 0),l8e.set(this,void 0),M8r.set(this,n=>{if(En(this,txt,!0,"f"),R8e(n)&&(n=new LI),n instanceof LI)return En(this,rxt,!0,"f"),this._emit("abort",n);if(n instanceof wi)return this._emit("error",n);if(n instanceof Error){let o=new wi(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new wi(String(n)))}),En(this,i8e,new Promise((n,o)=>{En(this,XIt,n,"f"),En(this,o8e,o,"f")}),"f"),En(this,s8e,new Promise((n,o)=>{En(this,ext,n,"f"),En(this,a8e,o,"f")}),"f"),gt(this,i8e,"f").catch(()=>{}),gt(this,s8e,"f").catch(()=>{}),En(this,mve,e,"f"),En(this,l8e,r?.logger??console,"f")}get response(){return gt(this,nxt,"f")}get request_id(){return gt(this,ixt,"f")}async withResponse(){En(this,Zie,!0,"f");let e=await gt(this,i8e,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return En(s,mve,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},gt(this,M8r,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{gt(this,vk,"m",O8r).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)gt(this,vk,"m",L8r).call(this,u);if(l.controller.signal?.aborted)throw new LI;gt(this,vk,"m",B8r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(En(this,nxt,e,"f"),En(this,ixt,e?.headers.get("request-id"),"f"),gt(this,XIt,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,c8e,"f")}get errored(){return gt(this,txt,"f")}get aborted(){return gt(this,rxt,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,Z9,"f")[e]||(gt(this,Z9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,Z9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(gt(this,Z9,"f")[e]||(gt(this,Z9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{En(this,Zie,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){En(this,Zie,!0,"f"),await gt(this,s8e,"f")}get currentMessage(){return gt(this,uW,"f")}async finalMessage(){return await this.done(),gt(this,vk,"m",N8r).call(this)}async finalText(){return await this.done(),gt(this,vk,"m",sZi).call(this)}_emit(e,...r){if(gt(this,c8e,"f"))return;e==="end"&&(En(this,c8e,!0,"f"),gt(this,ext,"f").call(this));let n=gt(this,Z9,"f")[e];if(n&&(gt(this,Z9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,Zie,"f")&&!n?.length&&Promise.reject(o),gt(this,o8e,"f").call(this,o),gt(this,a8e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,Zie,"f")&&!n?.length&&Promise.reject(o),gt(this,o8e,"f").call(this,o),gt(this,a8e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,vk,"m",N8r).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{gt(this,vk,"m",O8r).call(this),this._connected(null);let s=loe.fromReadableStream(e,this.controller);for await(let c of s)gt(this,vk,"m",L8r).call(this,c);if(s.controller.signal?.aborted)throw new LI;gt(this,vk,"m",B8r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(uW=new WeakMap,mve=new WeakMap,i8e=new WeakMap,XIt=new WeakMap,o8e=new WeakMap,s8e=new WeakMap,ext=new WeakMap,a8e=new WeakMap,Z9=new WeakMap,c8e=new WeakMap,txt=new WeakMap,rxt=new WeakMap,Zie=new WeakMap,nxt=new WeakMap,ixt=new WeakMap,l8e=new WeakMap,M8r=new WeakMap,vk=new WeakSet,N8r=a(function(){if(this.receivedMessages.length===0)throw new wi("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"oG"),sZi=a(function(){if(this.receivedMessages.length===0)throw new wi("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(e.length===0)throw new wi("stream ended without producing a content block with type=text");return e.join(" ")},"Rw"),O8r=a(function(){this.ended||En(this,uW,void 0,"f")},"aG"),L8r=a(function(e){if(this.ended)return;let r=gt(this,vk,"m",aZi).call(this,e);switch(this._emit("streamEvent",e,r),e.type){case"content_block_delta":{let n=r.content.at(-1);switch(e.delta.type){case"text_delta":{n.type==="text"&&this._emit("text",e.delta.text,n.text||"");break}case"citations_delta":{n.type==="text"&&this._emit("citation",e.delta.citation,n.citations??[]);break}case"input_json_delta":{lZi(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break}case"thinking_delta":{n.type==="thinking"&&this._emit("thinking",e.delta.thinking,n.thinking);break}case"signature_delta":{n.type==="thinking"&&this._emit("signature",n.signature);break}default:e.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(oZi(r,gt(this,mve,"f"),{logger:gt(this,l8e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{En(this,uW,r,"f");break}case"content_block_start":case"message_delta":break}},"sG"),B8r=a(function(){if(this.ended)throw new wi("stream has ended, this shouldn't happen");let e=gt(this,uW,"f");if(!e)throw new wi("request ended without sending any chunks");return En(this,uW,void 0,"f"),oZi(e,gt(this,mve,"f"),{logger:gt(this,l8e,"f")})},"eG"),aZi=a(function(e){let r=gt(this,uW,"f");if(e.type==="message_start"){if(r)throw new wi(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new wi(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":return r;case"message_delta":return r.stop_reason=e.delta.stop_reason,r.stop_sequence=e.delta.stop_sequence,r.usage.output_tokens=e.usage.output_tokens,e.usage.input_tokens!=null&&(r.usage.input_tokens=e.usage.input_tokens),e.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),e.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),e.usage.server_tool_use!=null&&(r.usage.server_tool_use=e.usage.server_tool_use),r;case"content_block_start":return r.content.push({...e.content_block}),r;case"content_block_delta":{let n=r.content.at(e.index);switch(e.delta.type){case"text_delta":{n?.type==="text"&&(r.content[e.index]={...n,text:(n.text||"")+e.delta.text});break}case"citations_delta":{n?.type==="text"&&(r.content[e.index]={...n,citations:[...n.citations??[],e.delta.citation]});break}case"input_json_delta":{if(n&&lZi(n)){let o=n[cZi]||"";o+=e.delta.partial_json;let s={...n};Object.defineProperty(s,cZi,{value:o,enumerable:!1,writable:!0}),o&&(s.input=Geo(o)),r.content[e.index]=s}break}case"thinking_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,thinking:n.thinking+e.delta.thinking});break}case"signature_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,signature:e.delta.signature});break}default:e.delta}return r}case"content_block_stop":return r}},"Pw"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((o,s)=>r.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new loe(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},$xt=class extends Rd{static{a(this,"TQ")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get($n`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",uoe,{query:e,...r})}delete(e,r){return this._client.delete($n`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post($n`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new wi(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:mr([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>Lxt.fromResponse(s.response,s.controller))}},N8e=class extends Rd{static{a(this,"H0")}constructor(){super(...arguments),this.batches=new $xt(this._client)}create(e,r){e.model in uZi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${uZi[e.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),nHc.includes(e.model)&&e.thinking&&e.thinking.type==="enabled"&&console.warn(`Using Claude with ${e.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let n=this._client._options.timeout;if(!e.stream&&n==null){let s=qeo[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=Qeo(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:mr([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>Veo(n,e,{logger:this._client.logger??console}))}stream(e,r){return y6r.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},uZi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026"},nHc=["claude-mythos-preview","claude-opus-4-6"];N8e.Batches=$xt;Vxt=class extends Rd{static{a(this,"z8")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/models/${e}`,{...n,headers:mr([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models",uoe,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},iHc="\\n\\nHuman:",oHc="\\n\\nAssistant:",Bp=class{static{a(this,"f$")}get credentials(){return this._authState.provider}constructor({baseURL:e=ru("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,...o}={}){if(E6r.add(this),this._requestAuthFlags=new WeakMap,fxt.set(this,void 0),r===void 0&&(r=o.profile!=null?null:ru("ANTHROPIC_API_KEY")??null),n===void 0&&(n=o.profile!=null?null:ru("ANTHROPIC_AUTH_TOKEN")??null),o.profile!=null&&(o.credentials!=null||o.config!=null))throw TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let s={apiKey:r,authToken:n,...o,baseURL:e||"https://api.anthropic.com"};if(!s.dangerouslyAllowBrowser&&ojc())throw new wi(`It looks like you're running in a browser-like environment. This is disabled by default, as it risks exposing your secret API credentials to attackers. If you understand the risks and have appropriate mitigations in place, you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g., new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); -`);this.baseURL=s.baseURL,this._baseURLIsExplicit=o.__baseURLIsExplicit??!!e,this.timeout=s.timeout??L6r.DEFAULT_TIMEOUT,this.logger=s.logger??console;let c="warn";this.logLevel=c,this.logLevel=VYi(s.logLevel,"ClientOptions.logLevel",this)??VYi(tu("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??c,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??y7c(),En(this,jIt,_7c,"f");let l=tu("ANTHROPIC_CUSTOM_HEADERS");if(l){let d={};for(let f of l.split(` -`)){let h=f.indexOf(":");h>=0&&(d[f.substring(0,h).trim()]=f.substring(h+1).trim())}s.defaultHeaders={...d,...s.defaultHeaders}}let u=o.__auth;if(delete s.__auth,delete s.__baseURLIsExplicit,this._options=s,this.apiKey=typeof r=="string"?r:null,this.authToken=n,u)this._authState=u,!this._baseURLIsExplicit&&u.baseURL&&(this.baseURL=u.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let d=s.credentials??null;if(d)this._authState.provider=d,this._authState.tokenCache=this._makeTokenCache(d);else if(s.config!=null){let f=DZi(s.config,this._credentialResolverOptions());this._authState.provider=f.provider,this._authState.tokenCache=this._makeTokenCache(f.provider),this._authState.extraHeaders=f.extraHeaders,this._applyCredentialBaseURL(f.baseURL)}else s.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(s.profile):this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let r=e.replace(/\/+$/,"");this._authState.baseURL=r,!this._baseURLIsExplicit&&(this.baseURL=r)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this.fetch,userAgent:this.getUserAgent(),onCacheWriteError:a(e=>{oA(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{oA(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new s8r(e,r=>{oA(this).debug("advisory token refresh failed; serving cached token",r)})}withOptions(e){let r="credentials"in e||"config"in e||"profile"in e,n="apiKey"in e||"authToken"in e||r,o={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,credentials:this.credentials,...r?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:n?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(o)}async _resolveDefaultCredentials(e){try{let r=await F7c(this._credentialResolverOptions(),e);if(r)this._authState.provider=r.provider,this._authState.tokenCache=this._makeTokenCache(r.provider),this._authState.extraHeaders=r.extraHeaders,this._applyCredentialBaseURL(r.baseURL);else if(e!=null)throw new Ri(`Profile "${e}" could not be resolved (no /configs/${e}.json found).`)}catch(r){this._authState.error=r}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:r}){if(!(e.get("x-api-key")||e.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&e.get("x-api-key"))&&!r.has("x-api-key")&&!(this.authToken&&e.get("authorization"))&&!r.has("authorization"))throw Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(e){let r=this._requestAuthFlags.get(e);return r||(r={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,r)),r}async authHeaders(e){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let r=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,mr([{Authorization:`Bearer ${r}`}])}return mr([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return mr([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return mr([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return v7c(e)}getUserAgent(){return`${this.constructor.name}/JS ${nW}`}defaultIdempotencyKey(){return`stainless-node-retry-${_Zi()}`}makeStatusError(e,r,n,o){return Jv.generate(e,r,n,o)}buildURL(e,r,n){let o=!gt(this,h8r,"m",zZi).call(this)&&n||this.baseURL,s=u7c(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!FYi(c)||!FYi(l))&&(r={...l,...c,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(s.search=this.stringifyQuery(r)),s.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new Ri("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 6e5}async prepareOptions(e){}async prepareRequest(e,{url:r,options:n}){if(this._authState.tokenCache&&this.apiKey==null){let o=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[s,c]of Object.entries(this._authState.extraHeaders))o.has(s)||o.set(s,c);o.get("anthropic-beta")?.split(",").map(s=>s.trim())?.includes(txt)||o.append("anthropic-beta",txt),e.headers=o}}get(e,r){return this.methodRequest("get",e,r)}post(e,r){return this.methodRequest("post",e,r)}patch(e,r){return this.methodRequest("patch",e,r)}put(e,r){return this.methodRequest("put",e,r)}delete(e,r){return this.methodRequest("delete",e,r)}methodRequest(e,r,n){return this.request(Promise.resolve(n).then(o=>({method:e,path:r,...o})))}request(e,r=null){return new nxt(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){let o=await e,s=o.maxRetries??this.maxRetries;r==null&&(r=s,this._requestAuthFlags.delete(o)),await this.prepareOptions(o);let{req:c,url:l,timeout:u}=await this.buildRequest(o,{retryCount:s-r});await this.prepareRequest(c,{url:l,options:o});let d="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),f=n===void 0?"":`, retryOf: ${n}`,h=Date.now();if(oA(this).debug(`[${d}] sending request`,Gie({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new kI;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(n8r),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new kI;let v=i8e(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return oA(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),oA(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,Gie({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw oA(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),oA(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,Gie({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new VIt:new dve({cause:g})}let y=[...g.headers.entries()].filter(([_])=>_==="request-id").map(([_,v])=>", "+_+": "+JSON.stringify(v)).join(""),E=`[${d}${f}${y}] ${c.method} ${l} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${A-h}ms`;if(!g.ok){let _=await this.shouldRetry(g,o);if(r&&_){let R=`retrying, ${r} attempts remaining`;return await E7c(g.body),oA(this).info(`${E} - ${R}`),oA(this).debug(`[${d}] response error (${R})`,Gie({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),this.retryRequest(o,r,n??d,g.headers)}let v=_?"error; no more retries left":"error; not retryable";oA(this).info(`${E} - ${v}`);let b=await g.text().catch(R=>n8r(R).message),T=vZi(b),w=T?void 0:b;throw oA(this).debug(`[${d}] response error (${v})`,Gie({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,message:w,durationMs:Date.now()-h})),this.makeStatusError(g.status,T,w,g.headers)}return oA(this).info(E),oA(this).debug(`[${d}] response start`,Gie({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),{response:g,options:o,controller:m,requestLogID:d,retryOfRequestLogID:n,startTime:h}}getAPIList(e,r,n){return this.requestAPIList(r,n&&"then"in n?n.then(o=>({method:"get",path:e,...o})):{method:"get",path:e,...n})}requestAPIList(e,r){let n=this.makeRequest(r,null,void 0);return new c8r(this,n,e)}async fetchWithTimeout(e,r,n,o){let{signal:s,method:c,...l}=r||{},u=this._makeAbort(o);s&&s.addEventListener("abort",u,{once:!0});let d=setTimeout(u,n),f=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,h={signal:o.signal,...f?{duplex:"half"}:{},method:"GET",...l};c&&(h.method=c.toUpperCase());try{return await this.fetch.call(void 0,e,h)}finally{clearTimeout(d)}}async shouldRetry(e,r){let n=this._authFlags(r);if(e.status===401&&this._authState.tokenCache&&n.usedTokenCache&&!n.didRefreshFor401)return n.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let o=e.headers.get("x-should-retry");return o==="true"?!0:o==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,r,n,o){let s,c=o?.get("retry-after-ms");if(c){let u=parseFloat(c);Number.isNaN(u)||(s=u)}let l=o?.get("retry-after");if(l&&!s){let u=parseFloat(l);Number.isNaN(u)?s=Date.parse(l)-Date.now():s=u*1e3}if(s===void 0){let u=e.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(r,u)}return await p7c(s),this.makeRequest(e,r-1,n)}calculateDefaultRetryTimeoutMillis(e,r){let n=r-e,o=Math.min(.5*Math.pow(2,n),8),s=1-Math.random()*.25;return o*s*1e3}calculateNonstreamingTimeout(e,r){if(36e5*e/128e3>6e5||r!=null&&e>r)throw new Ri("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(e,{retryCount:r=0}={}){let n={...e},{method:o,path:s,query:c,defaultBaseURL:l}=n;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let u=this.buildURL(s,c,l);"timeout"in n&&f7c("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:d,body:f}=this.buildBody({options:n}),h=await this.buildHeaders({options:e,method:o,bodyHeaders:d,retryCount:r});return{req:{method:o,headers:h,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&f instanceof globalThis.ReadableStream&&{duplex:"half"},...f&&{body:f},...this.fetchOptions??{},...n.fetchOptions??{}},url:u,timeout:n.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:n,retryCount:o}){let s={};this.idempotencyHeader&&r!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);let c=mr([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...k6r(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(c),c.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:r}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=mr([r]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:bZi(e)}:typeof e=="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:gt(this,jIt,"f").call(this,{body:e,headers:n})}};L6r=Mp,jIt=new WeakMap,h8r=new WeakSet,zZi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"Sw");Mp.Anthropic=L6r;Mp.HUMAN_PROMPT=pQc;Mp.AI_PROMPT=hQc;Mp.DEFAULT_TIMEOUT=6e5;Mp.AnthropicError=Ri;Mp.APIError=Jv;Mp.APIConnectionError=dve;Mp.APIConnectionTimeoutError=VIt;Mp.APIUserAbortError=kI;Mp.NotFoundError=KIt;Mp.ConflictError=JIt;Mp.RateLimitError=XIt;Mp.BadRequestError=WIt;Mp.AuthenticationError=zIt;Mp.InternalServerError=ext;Mp.PermissionDeniedError=YIt;Mp.UnprocessableEntityError=ZIt;Mp.toFile=Z7c;hve=class extends Mp{static{a(this,"K0")}constructor(){super(...arguments),this.completions=new _xt(this),this.messages=new c8e(this),this.models=new Cxt(this),this.beta=new k1(this)}};hve.Completions=_xt;hve.Messages=c8e;hve.Models=Cxt;hve.Beta=k1;a(M8e,"j4");a(HIt,"N8");a(PI,"o$");a(O8e,"D1");a(YZi,"JU");a(mQc,"Tw");gQc=new Set(["EXDEV","EPERM","EEXIST","EBUSY"]),AQc=new Set(["ENOSPC","EIO","EDQUOT","EFBIG"]);a(yQc,"xw");g8r=class{static{a(this,"gw")}read(e){return(0,sA.readFile)(e,"utf8")}readBytes(e){return(0,sA.readFile)(e)}write(e,r,n){return(0,sA.writeFile)(e,r,{encoding:"utf8",mode:n})}async mkdir(e){try{await(0,sA.mkdir)(e,{recursive:!0})}catch(r){if(PI(r)!=="EEXIST")throw r}}atomicWrite(e,r,n){return yQc(e,r,n)}delete(e){return(0,sA.unlink)(e)}list(e){return(0,sA.readdir)(e)}append(e,r,n){return(0,sA.appendFile)(e,r,{encoding:"utf8",mode:n})}writeExclusive(e,r){return(0,sA.writeFile)(e,r,{encoding:"utf8",flag:"wx"})}writeBytes(e,r){return(0,sA.writeFile)(e,r)}async stat(e){return{mtimeMs:(await(0,sA.stat)(e)).mtimeMs}}async listEntries(e){return(await(0,sA.readdir)(e,{withFileTypes:!0})).map(r=>({name:r.name,isDirectory:r.isDirectory(),isFile:r.isFile()}))}},EQc=new JZi.AsyncLocalStorage;a(bxt,"w8");K_e=null;a(XZi,"uw");a(_Qc,"mw");a(pk,"L6");a(vQc,"dv");CQc=vQc;a(bQc,"iv");SQc=bQc;a(TQc,"nv");IQc=TQc;a(xQc,"rv");wQc=xQc,RQc=200;a(kQc,"tv");PQc=kQc;a(Uve,"D8");Uve.prototype.clear=CQc;Uve.prototype.delete=SQc;Uve.prototype.get=IQc;Uve.prototype.has=wQc;Uve.prototype.set=PQc;DQc=Uve,NQc=(function(){try{var t=x6r(Object,"defineProperty");return t({},"",{}),t}catch{}})(),Sxt=NQc;a(MQc,"sv");B6r=MQc,OQc=Object.prototype,LQc=OQc.hasOwnProperty;a(BQc,"QC");eXi=BQc;a(FQc,"JC");UQc=FQc;a(QQc,"XC");qQc=QQc;a(jQc,"YC");Qve=jQc,HQc="[object Arguments]";a(GQc,"GC");fKi=GQc,tXi=Object.prototype,$Qc=tXi.hasOwnProperty,VQc=tXi.propertyIsEnumerable,WQc=fKi((function(){return arguments})())?fKi:function(t){return Qve(t)&&$Qc.call(t,"callee")&&!VQc.call(t,"callee")},l8e=WQc,zQc=Array.isArray,lW=zQc,VFe={};WL(VFe,{default:a(()=>F6r,"default")});a(YQc,"VC");KQc=YQc,rXi=typeof VFe=="object"&&VFe&&!VFe.nodeType&&VFe,pKi=rXi&&typeof o5=="object"&&o5&&!o5.nodeType&&o5,JQc=pKi&&pKi.exports===rXi,hKi=JQc?Mve.Buffer:void 0,ZQc=hKi?hKi.isBuffer:void 0,XQc=ZQc||KQc,F6r=XQc,eqc=9007199254740991,tqc=/^(?:0|[1-9]\d*)$/;a(rqc,"DC");bwt=rqc,nqc=9007199254740991;a(iqc,"ZC");U6r=iqc,oqc="[object Arguments]",sqc="[object Array]",aqc="[object Boolean]",cqc="[object Date]",lqc="[object Error]",uqc="[object Function]",dqc="[object Map]",fqc="[object Number]",pqc="[object Object]",hqc="[object RegExp]",mqc="[object Set]",gqc="[object String]",Aqc="[object WeakMap]",yqc="[object ArrayBuffer]",Eqc="[object DataView]",_qc="[object Float32Array]",vqc="[object Float64Array]",Cqc="[object Int8Array]",bqc="[object Int16Array]",Sqc="[object Int32Array]",Tqc="[object Uint8Array]",Iqc="[object Uint8ClampedArray]",xqc="[object Uint16Array]",wqc="[object Uint32Array]",Cd={};Cd[_qc]=Cd[vqc]=Cd[Cqc]=Cd[bqc]=Cd[Sqc]=Cd[Tqc]=Cd[Iqc]=Cd[xqc]=Cd[wqc]=!0;Cd[oqc]=Cd[sqc]=Cd[yqc]=Cd[aqc]=Cd[Eqc]=Cd[cqc]=Cd[lqc]=Cd[uqc]=Cd[dqc]=Cd[fqc]=Cd[pqc]=Cd[hqc]=Cd[mqc]=Cd[gqc]=Cd[Aqc]=!1;a(Rqc,"pC");kqc=Rqc;a(Pqc,"dC");Dqc=Pqc,WFe={};WL(WFe,{default:a(()=>A8r,"default")});nXi=typeof WFe=="object"&&WFe&&!WFe.nodeType&&WFe,e8e=nXi&&typeof a5=="object"&&a5&&!a5.nodeType&&a5,Nqc=e8e&&e8e.exports===nXi,NFr=Nqc&&mZi.process,Mqc=(function(){try{var t=e8e&&e8e.require&&e8e.require("util").types;return t||NFr&&NFr.binding&&NFr.binding("util")}catch{}})(),A8r=Mqc,mKi=A8r&&A8r.isTypedArray,Oqc=mKi?Dqc(mKi):kqc,iXi=Oqc,Lqc=Object.prototype,Bqc=Lqc.hasOwnProperty;a(Fqc,"aC");Uqc=Fqc,Qqc=Object.prototype;a(qqc,"eC");oXi=qqc;a(jqc,"$T");Hqc=jqc;a(Gqc,"QT");Q6r=Gqc;a($qc,"JT");Vqc=$qc,Wqc=Object.prototype,zqc=Wqc.hasOwnProperty;a(Yqc,"WT");Kqc=Yqc;a(Jqc,"GT");sXi=Jqc,zFe={};WL(zFe,{default:a(()=>cXi,"default")});aXi=typeof zFe=="object"&&zFe&&!zFe.nodeType&&zFe,gKi=aXi&&typeof XX=="object"&&XX&&!XX.nodeType&&XX,Zqc=gKi&&gKi.exports===aXi,AKi=Zqc?Mve.Buffer:void 0,yKi=AKi?AKi.allocUnsafe:void 0;a(Xqc,"HT");cXi=Xqc;a(ejc,"KT");tjc=ejc;a(rjc,"qT");njc=rjc,ijc=Hqc(Object.getPrototypeOf,Object),lXi=ijc,ojc=Mve.Uint8Array,EKi=ojc;a(sjc,"zT");ajc=sjc;a(cjc,"NT");ljc=cjc,_Ki=Object.create,ujc=(function(){function t(){}return a(t,"$"),function(e){if(!z9(e))return{};if(_Ki)return _Ki(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),djc=ujc;a(fjc,"OT");pjc=fjc,hjc="[object Symbol]";a(mjc,"FT");q6r=mjc,gjc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ajc=/^\w*$/;a(yjc,"LT");Ejc=yjc,_jc=500;a(vjc,"AT");Cjc=vjc,bjc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sjc=/\\(\\)?/g,Tjc=Cjc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(bjc,function(r,n,o,s){e.push(o?s.replace(Sjc,"$1"):n||r)}),e}),Ijc=Tjc;a(xjc,"ET");wjc=xjc,Rjc=1/0,vKi=cW?cW.prototype:void 0,CKi=vKi?vKi.toString:void 0;a(uXi,"PO");kjc=uXi;a(Pjc,"_T");Djc=Pjc;a(Njc,"kT");Swt=Njc,Mjc=1/0;a(Ojc,"vT");j6r=Ojc;a(Ljc,"CT");Bjc=Ljc;a(Fjc,"TT");Ujc=Fjc;a(Qjc,"xT");qjc=Qjc;a(jjc,"yT");Hjc=jjc;a(Gjc,"fT");dXi=Gjc,H6r=null;a($jc,"CO");a(Vjc,"TO");Ixt=new Map;a(Wjc,"xO");a(zjc,"yO");G6r=new Map;a(Kjc,"fO");a(Jjc,"gO");a($6r,"V0");a(Xjc,"hO");a(eHc,"uO");tHc={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};a(rHc,"lT");nHc=rHc(),iHc=a(()=>{},"pT");a(pXi,"VU");oHc=D8e(),yKh=oHc.subscribe,sHc=D8e(),EKh=sHc.subscribe,aHc=D8e(),_Kh=aHc.subscribe,cHc=D8e(),vKh=cHc.subscribe,lHc=D8e(),CKh=lHc.subscribe;a(uHc,"lO");a(dHc,"tT");E8r=class{static{a(this,"cO")}#e=new Set;register(e){let r=dHc(e);this.#e.add(r);let n=a(()=>{this.#e.delete(r)},"J");return Object.assign(n,{[Symbol.dispose]:n})}async drain(){let e=Array.from(this.#e);this.#e.clear(),await Promise.all(e.map(async r=>r()))}async[Symbol.asyncDispose](){await this.drain()}get sizeForTesting(){return this.#e.size}},fHc=new E8r;a(pHc,"pO");hHc=Py(t=>{if(!t||t.trim()==="")return null;let e=t.split(",").map(s=>s.trim()).filter(Boolean);if(e.length===0)return null;let r=e.some(s=>s.startsWith("!")),n=e.some(s=>!s.startsWith("!"));if(r&&n)return null;let o=e.map(s=>s.replace(/^!/,"").toLowerCase());return{include:r?[]:o,exclude:r?o:[],isExclusive:r}});a(mHc,"sT");a(gHc,"eT");a(AHc,"iO");a(yHc,"tO");a(EHc,"Qx");a(bKi,"oO");a(_Hc,"aO");a(mXi,"HX");vHc={cwd(){return process.cwd()},existsSync(t){let e=[];try{let o=ef(e,rf`fs.existsSync(${t})`,0);return vo.existsSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},async stat(t){return(0,G0.stat)(t)},async readdir(t){return(0,G0.readdir)(t,{withFileTypes:!0})},async unlink(t){return(0,G0.unlink)(t)},async rmdir(t){return(0,G0.rmdir)(t)},async rm(t,e){return(0,G0.rm)(t,e)},async mkdir(t,e){try{await(0,G0.mkdir)(t,{recursive:!0,...e})}catch(r){if(PI(r)!=="EEXIST")throw r}},async readFile(t,e){return(0,G0.readFile)(t,{encoding:e.encoding})},async rename(t,e){return(0,G0.rename)(t,e)},statSync(t){let e=[];try{let o=ef(e,rf`fs.statSync(${t})`,0);return vo.statSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},lstatSync(t){let e=[];try{let o=ef(e,rf`fs.lstatSync(${t})`,0);return vo.lstatSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},readFileSync(t,e){let r=[];try{let s=ef(r,rf`fs.readFileSync(${t})`,0);return vo.readFileSync(t,{encoding:e.encoding})}catch(s){var n=s,o=1}finally{tf(r,n,o)}},readFileBytesSync(t){let e=[];try{let o=ef(e,rf`fs.readFileBytesSync(${t})`,0);return vo.readFileSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},readSync(t,e){let r=[];try{let s=ef(r,rf`fs.readSync(${t}, ${e.length} bytes)`,0),c;try{c=vo.openSync(t,"r");let l=Buffer.alloc(e.length),u=vo.readSync(c,l,0,e.length,0);return{buffer:l,bytesRead:u}}finally{c&&vo.closeSync(c)}}catch(s){var n=s,o=1}finally{tf(r,n,o)}},appendFileSync(t,e,r){let n=[];try{let c=ef(n,rf`fs.appendFileSync(${t}, ${e.length} chars)`,0);if(r?.mode!==void 0)try{let l=vo.openSync(t,"ax",r.mode);try{vo.appendFileSync(l,e)}finally{vo.closeSync(l)}return}catch(l){if(PI(l)!=="EEXIST")throw l}vo.appendFileSync(t,e)}catch(c){var o=c,s=1}finally{tf(n,o,s)}},copyFileSync(t,e){let r=[];try{let s=ef(r,rf`fs.copyFileSync(${t} → ${e})`,0);vo.copyFileSync(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},unlinkSync(t){let e=[];try{let o=ef(e,rf`fs.unlinkSync(${t})`,0);vo.unlinkSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},renameSync(t,e){let r=[];try{let s=ef(r,rf`fs.renameSync(${t} → ${e})`,0);vo.renameSync(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},linkSync(t,e){let r=[];try{let s=ef(r,rf`fs.linkSync(${t} → ${e})`,0);vo.linkSync(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},symlinkSync(t,e,r){let n=[];try{let c=ef(n,rf`fs.symlinkSync(${t} → ${e})`,0);vo.symlinkSync(t,e,r)}catch(c){var o=c,s=1}finally{tf(n,o,s)}},readlinkSync(t){let e=[];try{let o=ef(e,rf`fs.readlinkSync(${t})`,0);return vo.readlinkSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},realpathSync(t){let e=[];try{let o=ef(e,rf`fs.realpathSync(${t})`,0);return vo.realpathSync(t).normalize("NFC")}catch(o){var r=o,n=1}finally{tf(e,r,n)}},mkdirSync(t,e){let r=[];try{let s=ef(r,rf`fs.mkdirSync(${t})`,0),c={recursive:!0};e?.mode!==void 0&&(c.mode=e.mode);try{vo.mkdirSync(t,c)}catch(l){if(PI(l)!=="EEXIST")throw l}}catch(s){var n=s,o=1}finally{tf(r,n,o)}},readdirSync(t){let e=[];try{let o=ef(e,rf`fs.readdirSync(${t})`,0);return vo.readdirSync(t,{withFileTypes:!0})}catch(o){var r=o,n=1}finally{tf(e,r,n)}},readdirStringSync(t){let e=[];try{let o=ef(e,rf`fs.readdirStringSync(${t})`,0);return vo.readdirSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},isDirEmptySync(t){let e=[];try{let o=ef(e,rf`fs.isDirEmptySync(${t})`,0);return this.readdirSync(t).length===0}catch(o){var r=o,n=1}finally{tf(e,r,n)}},rmdirSync(t){let e=[];try{let o=ef(e,rf`fs.rmdirSync(${t})`,0);vo.rmdirSync(t)}catch(o){var r=o,n=1}finally{tf(e,r,n)}},rmSync(t,e){let r=[];try{let s=ef(r,rf`fs.rmSync(${t})`,0);vo.rmSync(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},createWriteStream(t){return vo.createWriteStream(t)},async readFileBytes(t,e){if(e===void 0)return(0,G0.readFile)(t);let r=await(0,G0.open)(t,"r");try{let{size:n}=await r.stat(),o=Math.min(n,e),s=Buffer.allocUnsafe(o),c=0;for(;c=:(,)])([a-zA-Z0-9_~.]{3}\\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'"\\x60\\s<),])`,confidence:"high"},{id:"digitalocean-pat",source:`\\b(dop_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"digitalocean-access-token",source:`\\b(doo_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-api-key",source:`\\b(${RHc}03-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-admin-api-key",source:`\\b(sk-ant-admin01-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"openai-api-key",source:`\\b(sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})\\b|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"huggingface-access-token",source:`\\b(hf_[a-zA-Z]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"github-pat",source:"ghp_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-fine-grained-pat",source:"github_pat_\\w{82}",confidence:"high"},{id:"github-app-token",source:"(?:ghu|ghs)_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-oauth",source:"gho_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-refresh-token",source:"ghr_[0-9a-zA-Z]{36}",confidence:"high"},{id:"gitlab-pat",source:"glpat-[\\w-]{20}",confidence:"high"},{id:"gitlab-deploy-token",source:"gldt-[0-9a-zA-Z_\\-]{20}",confidence:"high"},{id:"slack-bot-token",source:"xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*",confidence:"high"},{id:"slack-user-token",source:"xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}",confidence:"high"},{id:"slack-app-token",source:"xapp-\\d-[A-Z0-9]+-\\d+-[a-z0-9]+",flags:"i",confidence:"high"},{id:"twilio-api-key",source:"SK[0-9a-fA-F]{32}",confidence:"high"},{id:"sendgrid-api-token",source:`\\b(SG\\.[a-zA-Z0-9=_\\-.]{66})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"npm-access-token",source:`\\b(npm_[a-zA-Z0-9]{36})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"pypi-upload-token",source:"pypi-AgEIcHlwaS5vcmc[\\w-]{50,1000}",confidence:"high"},{id:"databricks-api-token",source:`\\b(dapi[a-f0-9]{32}(?:-\\d)?)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"hashicorp-tf-api-token",source:"[a-zA-Z0-9]{14}\\.atlasv1\\.[a-zA-Z0-9\\-_=]{60,70}",confidence:"high"},{id:"pulumi-api-token",source:`\\b(pul-[a-f0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"postman-api-token",source:`\\b(PMAK-[a-fA-F0-9]{24}-[a-fA-F0-9]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-api-key",source:`\\b(eyJrIjoi[A-Za-z0-9+/]{70,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-cloud-api-token",source:`\\b(glc_[A-Za-z0-9+/]{32,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-service-account-token",source:`\\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-user-token",source:`\\b(sntryu_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-org-token",source:"\\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}",confidence:"high"},{id:"stripe-access-token",source:`\\b((?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"shopify-access-token",source:"shpat_[a-fA-F0-9]{32}",confidence:"high"},{id:"shopify-shared-secret",source:"shpss_[a-fA-F0-9]{32}",confidence:"high"},{id:"private-key",source:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\\s\\S-]{64,}?-----END[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----",flags:"i",confidence:"high"}],IKi=null;a(PHc,"Ox");a(DHc,"W2");_8r={verbose:0,debug:1,info:2,warn:3,error:4},NHc=Py(()=>{let t=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return t&&Object.hasOwn(_8r,t)?t:"debug"}),MHc=!1;a(Twt,"qX");v8r=Py(()=>{let t=Twt();return MHc||s_(process.env.DEBUG)||s_(process.env.DEBUG_SDK)||t.includes("--debug")||t.includes("-d")||gXi()||t.some(e=>e.startsWith("--debug="))||AXi()!==null}),OHc=Py(()=>{let t=Twt().find(r=>r.startsWith("--debug="));if(!t)return null;let e=t.substring(8);return hHc(e)}),gXi=Py(()=>{let t=Twt();return t.includes("--debug-to-stderr")||t.includes("-d2e")}),AXi=Py(()=>{let t=Twt();for(let e=0;e{try{let t=_Xi(),e=(0,soe.dirname)(t),r=(0,soe.join)(e,"latest");await(0,l_.unlink)(r).catch(()=>{}),await(0,l_.symlink)(t,r)}catch{}}),TKh=(()=>{let t=process.env.CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS;if(t!==void 0){let e=Number(t);if(!Number.isNaN(e)&&e>=0)return e}return 1/0})(),qHc={[Symbol.dispose](){}};a(jHc,"_x");rf=jHc;a(Qm,"B$");GN=a((t,e)=>{let r=[];try{let s=ef(r,rf`JSON.parse(${t})`,0);return typeof e>"u"?JSON.parse(t):JSON.parse(t,e)}catch(s){var n=s,o=1}finally{tf(r,n,o)}},"d$");a(HHc,"w2");a(uW,"A4");a(GHc,"kx");a($Hc,"O2");VHc=2e3,xxt=new Set,xKi=!1;a(WHc,"xx");a(zHc,"yx");S8r=class{static{a(this,"jU")}options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];abortHandler;forwardedAbort=t8r();pendingWrites=[];pendingEndInput=!1;spawnResolve;spawnReject;spawnPromise;constructor(e){this.options=e,this.abortController=e.abortController||t8r(),e.deferSpawn?(this.spawnPromise=new Promise((r,n)=>{this.spawnResolve=r,this.spawnReject=n}),this.spawnPromise.catch(()=>{})):this.initialize()}spawn(){try{this.initialize()}catch(r){throw this.spawnAbort(M8e(r)),r}let e=this.pendingWrites;this.pendingWrites=[],this.spawnResolve&&(this.spawnResolve(),this.spawnResolve=void 0,this.spawnReject=void 0);for(let r of e)this.write(r);this.pendingEndInput&&(this.pendingEndInput=!1,this.processStdin?.end())}spawnAbort(e){this.spawnReject&&(this.spawnReject(e),this.spawnReject=void 0,this.spawnResolve=void 0,this.pendingWrites=[])}updateEnv(e){this.options.env?Object.assign(this.options.env,e):this.options.env={...e}}updateResume(e){this.options.resume=e}getDefaultExecutable(){return hZi()?"bun":"node"}spawnLocalProcess(e){let{command:r,args:n,cwd:o,env:s,signal:c}=e,l=s_(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr?"pipe":"ignore",u=(0,uZi.spawn)(r,n,{cwd:o,stdio:["pipe","pipe",l],signal:c,env:s,windowsHide:!0});return(s_(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr)&&u.stderr.on("data",d=>{let f=d.toString();pk(f),this.options.stderr&&this.options.stderr(f)}),{stdin:u.stdin,stdout:u.stdout,get killed(){return u.killed},get exitCode(){return u.exitCode},kill:u.kill.bind(u),on:u.on.bind(u),once:u.once.bind(u),off:u.off.bind(u)}}initialize(){try{let{additionalDirectories:e=[],agent:r,betas:n,cwd:o,executable:s=this.getDefaultExecutable(),executableArgs:c=[],extraArgs:l={},pathToClaudeCodeExecutable:u,env:d={...process.env},thinkingConfig:f,maxTurns:h,maxBudgetUsd:m,taskBudget:g,model:A,fallbackModel:y,jsonSchema:E,permissionMode:_,allowDangerouslySkipPermissions:v,permissionPromptToolName:b,continueConversation:T,resume:w,settingSources:R,skills:x,disallowedTools:P=[],tools:D,mcpServers:N,strictMcpConfig:L,canUseTool:B,includePartialMessages:q,plugins:M,sandbox:O}=this.options,{allowedTools:j=[]}=this.options;if(x!==void 0){let H=x==="all"?["Skill"]:x.map(le=>`Skill(${le})`),re=new Set(j);j=[...j,...H.filter(le=>!re.has(le))]}let Q=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(f){switch(f.type){case"enabled":f.budgetTokens===void 0?Q.push("--thinking","adaptive"):Q.push("--max-thinking-tokens",f.budgetTokens.toString());break;case"disabled":Q.push("--thinking","disabled");break;case"adaptive":Q.push("--thinking","adaptive");break}f.type!=="disabled"&&f.display&&Q.push("--thinking-display",f.display)}if(this.options.effort&&Q.push("--effort",this.options.effort),h&&Q.push("--max-turns",h.toString()),m!==void 0&&Q.push("--max-budget-usd",m.toString()),g&&Q.push("--task-budget",g.total.toString()),A&&Q.push("--model",A),r&&Q.push("--agent",r),n&&n.length>0&&Q.push("--betas",n.join(",")),E&&Q.push("--json-schema",Qm(E)),this.options.debugFile?Q.push("--debug-file",this.options.debugFile):this.options.debug&&Q.push("--debug"),!this.options.debugFile&&!this.options.spawnClaudeCodeProcess){let H=_Qc();H&&Q.push("--debug-file",H)}if(B){if(b)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");Q.push("--permission-prompt-tool","stdio")}else b&&Q.push("--permission-prompt-tool",b);if(T&&Q.push("--continue"),w&&Q.push("--resume",w),this.options.assistant&&Q.push("--assistant"),this.options.channels&&this.options.channels.length>0&&Q.push("--channels",...this.options.channels),j.length>0&&Q.push("--allowedTools",j.join(",")),P.length>0&&Q.push("--disallowedTools",P.join(",")),D!==void 0&&(Array.isArray(D)?D.length===0?Q.push("--tools",""):Q.push("--tools",D.join(",")):Q.push("--tools","default")),N&&Object.keys(N).length>0&&Q.push("--mcp-config",Qm({mcpServers:N})),R!==void 0&&Q.push(`--setting-sources=${R.join(",")}`),L&&Q.push("--strict-mcp-config"),_&&Q.push("--permission-mode",_),v&&Q.push("--allow-dangerously-skip-permissions"),y){if(A&&y===A)throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");Q.push("--fallback-model",y)}this.options.includeHookEvents&&Q.push("--include-hook-events"),q&&Q.push("--include-partial-messages"),this.options.sessionMirror&&Q.push("--session-mirror");for(let H of e)Q.push("--add-dir",H);if(M&&M.length>0)for(let H of M)if(H.type==="local")Q.push("--plugin-dir",H.path);else throw Error(`Unsupported plugin type: ${H.type}`);this.options.forkSession&&Q.push("--fork-session"),this.options.resumeSessionAt&&Q.push("--resume-session-at",this.options.resumeSessionAt),this.options.sessionId&&Q.push("--session-id",this.options.sessionId),this.options.persistSession===!1&&Q.push("--no-session-persistence"),this.options.managedSettings&&Q.push("--managed-settings",this.options.managedSettings);let U={...l??{}};this.options.settings&&(U.settings=this.options.settings);let Y=$Hc(U,O);for(let[H,re]of Object.entries(Y))re===null?Q.push(`--${H}`):Q.push(`--${H}`,re);d.CLAUDE_CODE_ENTRYPOINT||(d.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),delete d.NODE_OPTIONS,s_(d.DEBUG_CLAUDE_AGENT_SDK)?d.DEBUG="1":delete d.DEBUG;let W=YHc(u),V=W?u:s,z=W?[...c,...Q]:[...c,u,...Q],ie={command:V,args:z,cwd:o,env:d,signal:this.forwardedAbort.signal};this.options.spawnClaudeCodeProcess?(pk(`Spawning Claude Code (custom): ${V} ${z.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(ie)):(pk(`Spawning Claude Code: ${V} ${z.join(" ")}`),this.process=this.spawnLocalProcess(ie)),this.processStdin=this.process.stdin,this.processStdout=this.process.stdout,zHc(this.process),this.abortHandler=()=>this.close(),this.abortController.signal.addEventListener("abort",this.abortHandler),this.abortController.signal.aborted&&this.close(),this.process.on("error",H=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new R1("Claude Code process aborted by user");else if(mQc(H)){let re=KHc(u,W);this.exitError=ReferenceError(re),pk(this.exitError.message)}else this.exitError=Error(`Failed to spawn Claude Code process: ${H.message}`),pk(this.exitError.message)}),this.process.on("exit",(H,re)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new R1("Claude Code process aborted by user");else{let le=this.getProcessExitError(H,re);le&&(this.exitError=le,pk(le.message))}}),this.ready=!this.abortController.signal.aborted}catch(e){throw this.ready=!1,e}}getProcessExitError(e,r){if(e!==0&&e!==null)return Error(`Claude Code process exited with code ${e}`);if(r)return Error(`Claude Code process terminated by signal ${r}`)}write(e){if(this.abortController.signal.aborted)throw new R1("Operation aborted");if(this.spawnResolve){this.pendingWrites.push(e);return}if(!this.ready||!this.processStdin)throw Error("ProcessTransport is not ready for writing");if(this.processStdin.writableEnded){pk("[ProcessTransport] Dropping write to ended stdin stream");return}if(this.process?.killed||this.process?.exitCode!==null)throw Error("Cannot write to terminated process");if(this.exitError)throw Error(`Cannot write to process that exited with error: ${this.exitError.message}`);pk(`[ProcessTransport] Writing to stdin: ${e.substring(0,100)}`);try{this.processStdin.write(e)||pk("[ProcessTransport] Write buffer full, data queued")}catch(r){throw this.ready=!1,Error(`Failed to write to process stdin: ${HIt(r)}`)}}[Symbol.dispose](){this.close()}close(){this.spawnAbort(this.abortController.signal.aborted?new R1("Claude Code process aborted by user"):Error("Query closed before spawn")),this.processStdin&&(this.processStdin.end(),this.processStdin=void 0),this.abortHandler&&(this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0);for(let{handler:n}of this.exitListeners)this.process?.off("exit",n);this.exitListeners=[];let e=a(()=>{this.abortController.signal.aborted&&this.forwardedAbort.abort(this.abortController.signal.reason)},"$"),r=this.process;r&&!r.killed&&r.exitCode===null?(setTimeout((n,o)=>{if(n.exitCode!==null){o();return}if(process.platform==="win32"){setTimeout((s,c)=>{s.exitCode===null&&s.kill("SIGKILL"),c()},5e3,n,o).unref();return}n.kill("SIGTERM"),setTimeout(s=>{s.exitCode===null&&s.kill("SIGKILL")},5e3,n).unref(),o()},VHc,r,e).unref(),r.once("exit",()=>xxt.delete(r))):r&&(xxt.delete(r),e()),this.ready=!1}isReady(){return this.ready}async*readMessages(){if(this.spawnPromise&&(await this.spawnPromise,this.spawnPromise=void 0),!this.processStdout)throw Error("ProcessTransport output stream not available");if(this.exitError)throw this.exitError;let e=(0,fZi.createInterface)({input:this.processStdout}),r=this.process?(()=>{let n=this.process,o=a(()=>e.close(),"Y");return n.on("error",o),()=>n.off("error",o)})():void 0;this.exitError&&e.close();try{for await(let n of e)if(n.trim()){let o;try{o=GN(n)}catch{pk(`Non-JSON stdout: ${n}`);continue}yield o}if(this.exitError)throw this.exitError;await this.waitForExit()}catch(n){throw n}finally{r?.(),e.close()}}endInput(){if(this.spawnResolve){this.pendingEndInput=!0;return}this.processStdin&&this.processStdin.end()}getInputStream(){return this.processStdin}onExit(e){if(!this.process)return()=>{};let r=a((n,o)=>{let s=this.getProcessExitError(n,o);e(s)},"Q");return this.process.on("exit",r),this.exitListeners.push({callback:e,handler:r}),()=>{this.process&&this.process.off("exit",r);let n=this.exitListeners.findIndex(o=>o.handler===r);n!==-1&&this.exitListeners.splice(n,1)}}async waitForExit(){if(!this.process){if(this.exitError)throw this.exitError;return}if(this.process.exitCode!==null||this.process.killed||this.exitError){if(this.exitError)throw this.exitError;return}return new Promise((e,r)=>{let n=a((s,c)=>{if(this.abortController.signal.aborted){r(new R1("Operation aborted"));return}let l=this.getProcessExitError(s,c);l?r(l):e()},"J");this.process.once("exit",n);let o=a(s=>{this.process.off("exit",n),r(s)},"Y");this.process.once("error",o),this.process.once("exit",()=>{this.process.off("error",o)})})}};a(YHc,"fx");a(KHc,"gx");J_e="@anthropic-ai/claude-agent-sdk";a(JHc,"ux");a(ZHc,"F2");wxt=class{static{a(this,"hQ")}returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(e){this.returned=e}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){return this.queue.length>0?Promise.resolve({done:!1,value:this.queue.shift()}):this.isDone?Promise.resolve({done:!0,value:void 0}):this.hasError?Promise.reject(this.hasError):new Promise((e,r)=>{this.readResolve=e,this.readReject=r})}enqueue(e){if(this.readResolve){let r=this.readResolve;this.readResolve=void 0,this.readReject=void 0,r({done:!1,value:e})}else this.queue.push(e)}done(){if(this.isDone=!0,this.readResolve){let e=this.readResolve;this.readResolve=void 0,this.readReject=void 0,e({done:!0,value:void 0})}}error(e){if(this.hasError=e,this.readReject){let r=this.readReject;this.readResolve=void 0,this.readReject=void 0,r(e)}}return(){return this.isDone=!0,this.returned&&this.returned(),Promise.resolve({done:!0,value:void 0})}};a(XHc,"mx");eGc=XHc();a(V6r,"BX");a(bXi,"AU");a(SXi,"IU");a(tGc,"Z2");a(q9,"I4");T8r=class{static{a(this,"RU")}sendMcpMessage;isClosed=!1;constructor(e){this.sendMcpMessage=e}onclose;onerror;onmessage;async start(){}async send(e){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(e)}async close(){this.isClosed||(this.isClosed=!0,this.onclose?.())}},I8r=class{static{a(this,"PU")}transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new wxt;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;sdkMcpServerInstances=new Map;pendingMcpResponses=new Map;firstResultReceivedResolve;firstResultReceived=!1;lastErrorResultText;transcriptMirrorBatcher;cleanupCallbacks=[];cleanupPromise;setIsSingleUserTurn(e){this.isSingleUserTurn=e}setTranscriptMirrorBatcher(e){this.transcriptMirrorBatcher=e}reportMirrorError(e,r){let n={type:"system",subtype:"mirror_error",error:r,key:e,uuid:(0,Txt.randomUUID)(),session_id:e.sessionId};this.inputStream.enqueue(n)}addCleanupCallback(e){this.cleanupPerformed?e():this.cleanupCallbacks.push(e)}isClosed(){return this.cleanupPerformed}hasBidirectionalNeeds(){return this.sdkMcpTransports.size>0||this.hooks!==void 0&&Object.keys(this.hooks).length>0||this.canUseTool!==void 0||this.onElicitation!==void 0||this.getOAuthToken!==void 0||this.getHostAuthToken!==void 0}constructor(e,r,n,o,s,c=new Map,l,u,d,f,h){this.transport=e,this.isSingleUserTurn=r,this.canUseTool=n,this.hooks=o,this.abortController=s,this.jsonSchema=l,this.initConfig=u,this.onElicitation=d,this.getOAuthToken=f,this.getHostAuthToken=h;for(let[m,g]of c)this.connectSdkMcpServer(m,g);this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(e){this.inputStream.error(e)}async stopTask(e){await this.request({subtype:"stop_task",task_id:e})}async backgroundTasks(e){return(await this.request({subtype:"background_tasks",tool_use_id:e})).response.backgrounded??!0}close(){this.cleanup()}cleanup(e){return this.cleanupPromise?this.cleanupPromise:(this.cleanupPerformed=!0,this.cleanupPromise=this.performCleanup(e),this.cleanupPromise)}async performCleanup(e){for(let r of this.cleanupCallbacks)try{r()}catch{}if(this.cleanupCallbacks=[],this.transcriptMirrorBatcher)try{await this.transcriptMirrorBatcher.flush()}catch{}try{for(let n of this.cancelControllers.values())n.abort();this.cancelControllers.clear(),this.transport.close();let r=e??Error("Query closed before response received");for(let{reject:n}of this.pendingControlResponses.values())n(r);this.pendingControlResponses.clear();for(let{reject:n}of this.pendingMcpResponses.values())n(r);this.pendingMcpResponses.clear(),this.hookCallbacks.clear();for(let n of this.sdkMcpTransports.values())n.close().catch(()=>{});this.sdkMcpTransports.clear(),e?this.inputStream.error(e):this.inputStream.done()}catch{}}next(...[e]){return this.sdkMessages.next(e)}async return(e){return await this.cleanup(),this.sdkMessages.return(e)}async throw(e){return await this.cleanup(),this.sdkMessages.throw(e)}[Symbol.asyncIterator](){return this.sdkMessages}async[Symbol.asyncDispose](){await this.cleanup()}async readMessages(){try{for await(let e of this.transport.readMessages()){if(e.type==="control_response"){let r=this.pendingControlResponses.get(e.response.request_id);r&&r.handler(e.response);continue}else if(e.type==="control_request"){this.handleControlRequest(e);continue}else if(e.type==="control_cancel_request"){this.handleControlCancelRequest(e);continue}else{if(e.type==="keep_alive")continue;if(e.type==="transcript_mirror"){this.transcriptMirrorBatcher?.enqueue(e.filePath,e.entries);continue}}if(e.type==="system"&&(e.subtype==="post_turn_summary"||e.subtype==="task_summary")){this.inputStream.enqueue(e);continue}e.type==="result"?(this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.lastErrorResultText=e.is_error?e.subtype==="success"?e.result:e.errors.join("; "):void 0,this.firstResultReceived=!0,this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.isSingleUserTurn&&(ru("[Query.readMessages] First result received for single-turn query, closing stdin"),this.transport.endInput())):e.type==="system"&&e.subtype==="session_state_changed"||(this.lastErrorResultText=void 0),this.inputStream.enqueue(e)}this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.inputStream.done(),this.cleanup()}catch(e){if(this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.lastErrorResultText!==void 0&&!(e instanceof R1)){let r=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);ru(`[Query.readMessages] Replacing exit error with result text. Original: ${HIt(e)}`),this.inputStream.error(r),this.cleanup(r);return}this.inputStream.error(e),this.cleanup(e)}}async handleControlRequest(e){let r=new AbortController;this.cancelControllers.set(e.request_id,r);try{let n=await this.processControlRequest(e,r.signal);if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"success",request_id:e.request_id,response:n}};await Promise.resolve(this.transport.write(Qm(o)+` -`))}catch(n){if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:HIt(n)}};try{await Promise.resolve(this.transport.write(Qm(o)+` -`))}catch(s){ru(`[Query.handleControlRequest] Error-response write failed: ${HIt(s)}`,{level:"error"})}}finally{this.cancelControllers.delete(e.request_id)}}handleControlCancelRequest(e){let r=this.cancelControllers.get(e.request_id);r&&(r.abort(),this.cancelControllers.delete(e.request_id))}async processControlRequest(e,r){if(e.request.subtype==="can_use_tool"){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");return{...await this.canUseTool(e.request.tool_name,e.request.input,{signal:r,suggestions:e.request.permission_suggestions,blockedPath:e.request.blocked_path,decisionReason:e.request.decision_reason,title:e.request.title,displayName:e.request.display_name,description:e.request.description,toolUseID:e.request.tool_use_id,agentID:e.request.agent_id}),toolUseID:e.request.tool_use_id}}else{if(e.request.subtype==="hook_callback")return await this.handleHookCallbacks(e.request.callback_id,e.request.input,e.request.tool_use_id,r);if(e.request.subtype==="mcp_message"){let n=e.request,o=this.sdkMcpTransports.get(n.server_name);if(!o)throw Error(`SDK MCP server not found: ${n.server_name}`);return"method"in n.message&&"id"in n.message&&n.message.id!==null?{mcp_response:await this.handleMcpControlRequest(n.server_name,n,o)}:(o.onmessage&&o.onmessage(n.message),{mcp_response:{jsonrpc:"2.0",result:{},id:0}})}else if(e.request.subtype==="elicitation"){let n=e.request;return this.onElicitation?await this.onElicitation({serverName:n.mcp_server_name,message:n.message,mode:n.mode,url:n.url,elicitationId:n.elicitation_id,requestedSchema:n.requested_schema,title:n.title,displayName:n.display_name,description:n.description},{signal:r}):{action:"decline"}}else if(e.request.subtype==="oauth_token_refresh"){if(!this.getOAuthToken)throw Error("getOAuthToken callback is not provided.");return{accessToken:await this.getOAuthToken({signal:r})??null}}else if(e.request.subtype==="host_auth_token_refresh"){if(!this.getHostAuthToken)throw Error("getHostAuthToken callback is not provided.");return{authToken:await this.getHostAuthToken({signal:r})??null}}}throw Error("Unsupported control request subtype: "+e.request.subtype)}async*readSdkMessages(){try{for await(let e of this.inputStream)yield e}finally{await this.cleanup()}}async initialize(){let e;if(this.hooks){e={};for(let[o,s]of Object.entries(this.hooks))s.length>0&&(e[o]=s.map(c=>{let l=[];for(let u of c.hooks){let d=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(d,u),l.push(d)}return{matcher:c.matcher,hookCallbackIds:l,timeout:c.timeout}}))}let r=this.sdkMcpTransports.size>0?Array.from(this.sdkMcpTransports.keys()):void 0,n={subtype:"initialize",hooks:e,sdkMcpServers:r,jsonSchema:this.jsonSchema,systemPrompt:typeof this.initConfig?.systemPrompt=="string"?[this.initConfig.systemPrompt]:this.initConfig?.systemPrompt,appendSystemPrompt:this.initConfig?.appendSystemPrompt,planModeInstructions:this.initConfig?.planModeInstructions,appendSubagentSystemPrompt:this.initConfig?.appendSubagentSystemPrompt,toolAliases:this.initConfig?.toolAliases,excludeDynamicSections:this.initConfig?.excludeDynamicSections,agents:this.initConfig?.agents,title:this.initConfig?.title,skills:Array.isArray(this.initConfig?.skills)?this.initConfig.skills:void 0,webSearchIsolationExemptMcpServers:this.initConfig?.webSearchIsolationExemptMcpServers,promptSuggestions:this.initConfig?.promptSuggestions,agentProgressSummaries:this.initConfig?.agentProgressSummaries,forwardSubagentText:this.initConfig?.forwardSubagentText};return(await this.request(n)).response}async interrupt(){return q9("sdk_interrupt",async()=>{await this.request({subtype:"interrupt"})})}async setPermissionMode(e){await this.request({subtype:"set_permission_mode",mode:e})}async setModel(e){await this.request({subtype:"set_model",model:e})}async setMaxThinkingTokens(e){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:e})}async applyFlagSettings(e){return q9("sdk_apply_flag_settings",async()=>{await this.request({subtype:"apply_flag_settings",settings:e})})}async getSettings(){return(await this.request({subtype:"get_settings"})).response}async rewindFiles(e,r){return q9("sdk_rewind_files",async()=>(await this.request({subtype:"rewind_files",user_message_id:e,dry_run:r?.dryRun})).response)}async cancelAsyncMessage(e){return(await this.request({subtype:"cancel_async_message",message_uuid:e})).response.cancelled}async seedReadState(e,r){await this.request({subtype:"seed_read_state",path:e,mtime:r})}async enableRemoteControl(e,r){return(await this.request({subtype:"remote_control",enabled:e,...r!==void 0&&{name:r}})).response}async submitFeedback(e,r){return(await this.request({subtype:"submit_feedback",description:e,surface:r?.surface})).response}async generateSessionTitle(e,r){return q9("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:e,persist:r?.persist})).response.title)}async askSideQuestion(e){return q9("sdk_side_question",async()=>{let r=(await this.request({subtype:"side_question",question:e})).response;return r.response===null?null:{response:r.response,synthetic:r.synthetic??!1}})}async launchUltrareview(e,r){return(await this.request({subtype:"ultrareview_launch",args:e,confirm:r?.confirm??!1})).response}async messageRated(e){await this.request({subtype:"message_rated",messageUuid:e.messageUuid,sentiment:e.sentiment,surface:e.surface,cleared:e.cleared??!1})}processPendingPermissionRequests(e){for(let r of e)r.request.subtype==="can_use_tool"&&this.handleControlRequest(r).catch(()=>{})}request(e){let r=Math.random().toString(36).substring(2,15),n={request_id:r,type:"control_request",request:e};return new Promise((o,s)=>{this.pendingControlResponses.set(r,{handler:a(c=>{this.pendingControlResponses.delete(r),c.subtype==="success"?o(c):(s(Error(c.error)),c.pending_permission_requests&&this.processPendingPermissionRequests(c.pending_permission_requests))},"handler"),reject:s}),Promise.resolve(this.transport.write(Qm(n)+` -`)).catch(c=>{this.pendingControlResponses.delete(r),s(c)})})}initializationResult(){return this.initialization}async supportedCommands(){return(await this.initialization).commands}async supportedModels(){return(await this.initialization).models}async supportedAgents(){return(await this.initialization).agents}async reconnectMcpServer(e){await this.request({subtype:"mcp_reconnect",serverName:e})}async toggleMcpServer(e,r){return q9("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:e,enabled:r})})}async enableChannel(e){return q9("sdk_mcp_enable_channel",async()=>{await this.request({subtype:"channel_enable",serverName:e})})}async mcpAuthenticate(e,r){return(await this.request({subtype:"mcp_authenticate",serverName:e,redirectUri:r})).response}async mcpClearAuth(e){return(await this.request({subtype:"mcp_clear_auth",serverName:e})).response}async mcpSubmitOAuthCallbackUrl(e,r){return(await this.request({subtype:"mcp_oauth_callback_url",serverName:e,callbackUrl:r})).response}async claudeAuthenticate(e){return(await this.request({subtype:"claude_authenticate",loginWithClaudeAi:e})).response}async claudeOAuthCallback(e,r){return(await this.request({subtype:"claude_oauth_callback",authorizationCode:e,state:r})).response}async claudeOAuthWaitForCompletion(){return(await this.request({subtype:"claude_oauth_wait_for_completion"})).response}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async getContextUsage(){return(await this.request({subtype:"get_context_usage"})).response}async readFile(e,r){try{return(await this.request({subtype:"read_file",path:e,max_bytes:r?.maxBytes,encoding:r?.encoding})).response}catch{return null}}async reloadPlugins(){return q9("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins"})).response)}async setMcpServers(e){return q9("sdk_mcp_set_servers",async()=>{let r={},n={};for(let[l,u]of Object.entries(e))u.type==="sdk"&&"instance"in u?r[l]=u.instance:n[l]=u;let o=new Set(this.sdkMcpServerInstances.keys()),s=new Set(Object.keys(r));for(let l of o)s.has(l)||await this.disconnectSdkMcpServer(l);for(let[l,u]of Object.entries(r))o.has(l)||this.connectSdkMcpServer(l,u);let c={};for(let l of Object.keys(r))c[l]={type:"sdk",name:l};return(await this.request({subtype:"mcp_set_servers",servers:{...n,...c}})).response})}async accountInfo(){return(await this.initialization).account}async streamInput(e){ru("[Query.streamInput] Starting to process input stream");try{let r=0;for await(let n of e){if(r++,ru(`[Query.streamInput] Processing message ${r}: ${n.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(Qm(n)+` -`))}ru(`[Query.streamInput] Finished processing ${r} messages from input stream`),r>0&&this.hasBidirectionalNeeds()&&(ru("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult()),ru("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(r){if(!(r instanceof R1))throw r}}waitForFirstResult(){return this.firstResultReceived?(ru("[Query.waitForFirstResult] Result already received, returning immediately"),Promise.resolve()):new Promise(e=>{if(this.abortController?.signal.aborted){e();return}this.abortController?.signal.addEventListener("abort",()=>e(),{once:!0}),this.firstResultReceivedResolve=e})}handleHookCallbacks(e,r,n,o){let s=this.hookCallbacks.get(e);if(!s)throw Error(`No hook callback found for ID: ${e}`);return s(r,n,{signal:o})}connectSdkMcpServer(e,r){let n=new T8r(o=>this.sendMcpServerMessageToCli(e,o));this.sdkMcpTransports.set(e,n),this.sdkMcpServerInstances.set(e,r),r.connect(n).catch(o=>{this.sdkMcpTransports.get(e)===n&&this.sdkMcpTransports.delete(e),this.sdkMcpServerInstances.get(e)===r&&this.sdkMcpServerInstances.delete(e),ru(`[Query.connectSdkMcpServer] Failed to connect MCP server '${e}': ${o}`,{level:"error"})})}async disconnectSdkMcpServer(e){let r=this.sdkMcpTransports.get(e);r&&(await r.close(),this.sdkMcpTransports.delete(e)),this.sdkMcpServerInstances.delete(e)}sendMcpServerMessageToCli(e,r){if("id"in r&&r.id!==null&&r.id!==void 0){let o=`${e}:${r.id}`,s=this.pendingMcpResponses.get(o);if(s){s.resolve(r),this.pendingMcpResponses.delete(o);return}}let n={type:"control_request",request_id:(0,Txt.randomUUID)(),request:{subtype:"mcp_message",server_name:e,message:r}};Promise.resolve(this.transport.write(Qm(n)+` -`)).catch(o=>{ru(`[Query.sendMcpServerMessageToCli] Transport write failed: ${o}`,{level:"error"})})}handleMcpControlRequest(e,r,n){let o="id"in r.message?r.message.id:null,s=`${e}:${o}`;return new Promise((c,l)=>{let u=a(()=>{this.pendingMcpResponses.delete(s)},"U"),d=a(h=>{u(),c(h)},"H"),f=a(h=>{u(),l(h)},"q");if(this.pendingMcpResponses.set(s,{resolve:d,reject:f}),n.onmessage)n.onmessage(r.message);else{u(),l(Error("No message handler registered"));return}})}},W6r=500,z6r=1048576,rGc=[200,800],x8r=class{static{a(this,"EU")}send;sendTimeoutMs;onError;maxPendingEntries;maxPendingBytes;backoffMs;pending=[];pendingEntries=0;pendingBytes=0;flushPromise=null;constructor(e,r=6e4,n,o=W6r,s=z6r,c=rGc){this.send=e,this.sendTimeoutMs=r,this.onError=n,this.maxPendingEntries=o,this.maxPendingBytes=s,this.backoffMs=c}enqueue(e,r){let n=Qm(r).length;this.pending.push({filePath:e,entries:r,bytes:n}),this.pendingEntries+=r.length,this.pendingBytes+=n,(this.pendingEntries>this.maxPendingEntries||this.pendingBytes>this.maxPendingBytes)&&(this.flushPromise=this.drain(),this.flushPromise.catch(()=>{}))}async flush(){let e=this.drain();this.flushPromise=e,await e,this.flushPromise===e&&(this.flushPromise=null)}async drain(){let e=this.flushPromise,r=this.pending.splice(0);this.pendingEntries=0,this.pendingBytes=0,e&&await e,r.length!==0&&await this.doFlush(r)}async doFlush(e){let r=new Map;for(let o of e){let s=r.get(o.filePath);s?s.push(...o.entries):r.set(o.filePath,o.entries.slice())}let n=this.backoffMs.length+1;for(let[o,s]of r){let c=`SessionStore.append() timed out after ${this.sendTimeoutMs}ms for ${o}`,l,u=1;for(;u<=n;u++)try{await Vie(this.send(o,s),this.sendTimeoutMs,c),l=void 0;break}catch(d){if(l=M8e(d),l.message===c)break;let f=this.backoffMs[u-1];if(f===void 0)break;await lZi(f)}if(l){ru(`[TranscriptMirrorBatcher] flush failed for ${o} after ${u} attempt(s): ${l}`,{level:"error"});try{this.onError?.(o,l)}catch(d){ru(`[TranscriptMirrorBatcher] onError callback threw: ${d}`,{level:"error"})}}}}},wKi=A6r(S6c(),1);a(nGc,"Ug");a(t8e,"O0");a(iGc,"qg");LFr=new Map,oGc=5e3;a(sGc,"Bg");a(aGc,"zg");a(cGc,"OZ");lGc=(0,wXi.promisify)(xXi.execFile);a(L8e,"m4");a(uGc,"jH");$9=65536,dGc=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;a(bh,"L$");a(PXi,"ZZ");a(BFr,"IX");a(hk,"A6");a(R8r,"rQ");a(DXi,"RX");a(fGc,"MZ");a(NXi,"PX");u8e=200;a(pGc,"Lg");a(B8e,"F0");a(hW,"U4");a(hGc,"jg");a(F8e,"M1");a(BN,"j6");a(Iwt,"L1");mGc=1048576,gGc=5242880;a(yGc,"Rg");a(MXi,"jZ");a(Yie,"D0");a(Rxt,"jX");kxt=Buffer.from('{"type":"attribution-snapshot"'),EGc=Buffer.from('{"type":"system"'),d8e=10,_Gc=Buffer.from([d8e]),vGc=256;a(CGc,"_g");a(bGc,"kg");a(SGc,"Sg");a(TGc,"vg");a(IGc,"Cg");a(xGc,"AZ");a(wGc,"xg");a(RGc,"yg");a(kGc,"fg");a(FFr,"IH");a(PGc,"gg");a(DGc,"hg");a(NGc,"ug");a(OXi,"RH");a(LXi,"PH");a(MGc,"IZ");a(BXi,"RZ");a(OGc,"PZ");a(xwt,"k8");a(YFe,"oQ");a(FXi,"EZ");LGc=32;a(BGc,"pg");a(FGc,"dg");a(UGc,"ig");a(QGc,"ng");a(qGc,"rg");a(jGc,"bZ");a(HGc,"_Z");a(GGc,"CZ");a($Gc,"TZ");a(VGc,"xZ");a(WGc,"ag");a(UXi,"yZ");a(UFr,"_H");a(zGc,"sg");YGc=new Set(["user","assistant","attachment","system","progress"]);a(KGc,"$h");a(JGc,"Qh");a(QXi,"fZ");a(ZGc,"gZ");a(XGc,"Jh");a(e$c,"hZ");a(t$c,"Xh");a(qXi,"uZ");a(jXi,"lZ");a(HXi,"cZ");a(r$c,"Wh");a(n$c,"Gh");a(i$c,"pZ");a(o$c,"dZ");a(GXi,"vH");a(WXi,"CH");a(zXi,"bX");a(s$c,"Uh");a$c="user:inference",YXi="user:profile",c$c="org:create_api_key",l$c=[c$c,YXi],u$c=[YXi,a$c,"user:sessions:claude_code","user:mcp_servers","user:file_upload"],xKh=zXi([...l$c,...u$c]),RKi={BASE_API_URL:"https://api.anthropic.com",CONSOLE_AUTHORIZE_URL:"https://platform.claude.com/oauth/authorize",CLAUDE_AI_AUTHORIZE_URL:"https://claude.com/cai/oauth/authorize",CLAUDE_AI_ORIGIN:"https://claude.ai",TOKEN_URL:"https://platform.claude.com/v1/oauth/token",API_KEY_URL:"https://api.anthropic.com/api/oauth/claude_cli/create_api_key",ROLES_URL:"https://api.anthropic.com/api/oauth/claude_cli/roles",CONSOLE_SUCCESS_URL:"https://platform.claude.com/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",CLAUDEAI_SUCCESS_URL:"https://platform.claude.com/oauth/code/success?app=claude-code",MANUAL_REDIRECT_URL:"https://platform.claude.com/oauth/code/callback",CLIENT_ID:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",OAUTH_FILE_SUFFIX:"",MCP_PROXY_URL:"https://mcp-proxy.anthropic.com",MCP_PROXY_PATH:"/v1/mcp/{server_id}"},d$c=void 0;a(f$c,"zh");p$c=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"];a(h$c,"rZ");m$c="-credentials";a(g$c,"tZ");A$c=/^[a-zA-Z0-9._-]+$/;a(y$c,"aZ");(function(t){t.assertEqual=o=>{};function e(o){}a(e,"Q"),t.assertIs=e;function r(o){throw Error()}a(r,"J"),t.assertNever=r,t.arrayToEnum=o=>{let s={};for(let c of o)s[c]=c;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(l=>typeof o[o[l]]!="number"),c={};for(let l of s)c[l]=o[l];return t.objectValues(c)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let c in o)Object.prototype.hasOwnProperty.call(o,c)&&s.push(c);return s},t.find=(o,s)=>{for(let c of o)if(s(c))return c},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}a(n,"Y"),t.joinValues=n,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(hc||(hc={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(kKi||(kKi={}));kn=hc.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tW=a(t=>{switch(typeof t){case"undefined":return kn.undefined;case"string":return kn.string;case"number":return Number.isNaN(t)?kn.nan:kn.number;case"boolean":return kn.boolean;case"function":return kn.function;case"bigint":return kn.bigint;case"symbol":return kn.symbol;case"object":return Array.isArray(t)?kn.array:t===null?kn.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?kn.promise:typeof Map<"u"&&t instanceof Map?kn.map:typeof Set<"u"&&t instanceof Set?kn.set:typeof Date<"u"&&t instanceof Date?kn.date:kn.object;default:return kn.unknown}},"l4"),hr=hc.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),yk=class t extends Error{static{a(this,"f6")}get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let c of s.issues)if(c.code==="invalid_union")c.unionErrors.map(o);else if(c.code==="invalid_return_type")o(c.returnTypeError);else if(c.code==="invalid_arguments")o(c.argumentsError);else if(c.path.length===0)n._errors.push(r(c));else{let l=n,u=0;for(;ur.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];r[s]=r[s]||[],r[s].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};yk.create=t=>new yk(t);E$c=a((t,e)=>{let r;switch(t.code){case hr.invalid_type:t.received===kn.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case hr.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,hc.jsonStringifyReplacer)}`;break;case hr.unrecognized_keys:r=`Unrecognized key(s) in object: ${hc.joinValues(t.keys,", ")}`;break;case hr.invalid_union:r="Invalid input";break;case hr.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${hc.joinValues(t.options)}`;break;case hr.invalid_enum_value:r=`Invalid enum value. Expected ${hc.joinValues(t.options)}, received '${t.received}'`;break;case hr.invalid_arguments:r="Invalid function arguments";break;case hr.invalid_return_type:r="Invalid function return type";break;case hr.invalid_date:r="Invalid date";break;case hr.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:hc.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case hr.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case hr.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case hr.custom:r="Invalid input";break;case hr.invalid_intersection_types:r="Intersection results could not be merged";break;case hr.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case hr.not_finite:r="Number must be finite";break;default:r=e.defaultError,hc.assertNever(t)}return{message:r}},"Fh"),p8e=E$c,_$c=p8e;a(P8r,"tQ");D8r=a(t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,s=[...r,...o.path||[]],c={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let l="",u=n.filter(d=>!!d).slice().reverse();for(let d of u)l=d(c,{data:e,defaultError:l}).message;return{...o,path:s,message:l}},"_X");a(ln,"f");Zv=class t{static{a(this,"U6")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return eo;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r){let s=await o.key,c=await o.value;n.push({key:s,value:c})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:s,value:c}=o;if(s.status==="aborted"||c.status==="aborted")return eo;s.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(n[s.value]=c.value)}return{status:e.value,value:n}}},eo=Object.freeze({status:"aborted"}),JFe=a(t=>({status:"dirty",value:t}),"v8"),P1=a(t=>({status:"valid",value:t}),"z6"),PKi=a(t=>t.status==="aborted","TH"),DKi=a(t=>t.status==="dirty","xH"),gve=a(t=>t.status==="valid","Z0"),Nxt=a(t=>typeof Promise<"u"&&t instanceof Promise,"aQ");(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Zn||(Zn={}));_k=class{static{a(this,"H4")}constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},NKi=a((t,e)=>{if(gve(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new yk(t.common.issues);return this._error=r,this._error}}},"eZ");a(Zo,"e");Ms=class{static{a(this,"Y$")}get description(){return this._def.description}_getType(e){return tW(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:tW(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Zv,ctx:{common:e.parent.common,data:e.data,parsedType:tW(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Nxt(r))throw Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tW(e)},o=this._parseSync({data:e,path:n.path,parent:n});return NKi(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tW(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return gve(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>gve(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tW(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(Nxt(o)?o:Promise.resolve(o));return NKi(n,s)}refine(e,r){let n=a(o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r,"J");return this._refinement((o,s)=>{let c=e(o),l=a(()=>s.addIssue({code:hr.custom,...n(o)}),"G");return typeof Promise<"u"&&c instanceof Promise?c.then(u=>u?!0:(l(),!1)):c?!0:(l(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new QN({schema:this,typeName:Cr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a(r=>this["~validate"](r),"validate")}}optional(){return Ek.create(this,this._def)}nullable(){return K9.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return dW.create(this)}promise(){return roe.create(this,this._def)}or(e){return _ve.create([this,e],this._def)}and(e){return vve.create(this,e,this._def)}transform(e){return new QN({...Zo(this._def),schema:this,typeName:Cr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ive({...Zo(this._def),innerType:this,defaultValue:r,typeName:Cr.ZodDefault})}brand(){return new Mxt({typeName:Cr.ZodBranded,type:this,...Zo(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new xve({...Zo(this._def),innerType:this,catchValue:r,typeName:Cr.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Oxt.create(this,e)}readonly(){return wve.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},v$c=/^c[^\s-]{8,}$/i,C$c=/^[0-9a-z]+$/,b$c=/^[0-9A-HJKMNP-TV-Z]{26}$/i,S$c=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,T$c=/^[a-z0-9_-]{21}$/i,I$c=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,x$c=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,w$c=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,R$c="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",k$c=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,P$c=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,D$c=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,N$c=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,M$c=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,O$c=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,KXi="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",L$c=new RegExp(`^${KXi}$`);a(JXi,"QM");a(B$c,"yh");a(F$c,"fh");a(U$c,"gh");a(Q$c,"hh");a(q$c,"uh");Ave=class t extends Ms{static{a(this,"p4")}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==kn.string){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_type,expected:kn.string,received:o.parsedType}),eo}let r=new Zv,n;for(let o of this._def.checks)if(o.kind==="min")e.data.lengtho.value&&(n=this._getOrReturnCtx(e,n),ln(n,{code:hr.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,c=e.data.lengthe.test(o),{validation:r,code:hr.invalid_string,...Zn.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Zn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Zn.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Zn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Zn.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Zn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Zn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Zn.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Zn.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Zn.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Zn.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Zn.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Zn.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Zn.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Zn.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Zn.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Zn.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Zn.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Zn.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Zn.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Zn.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Zn.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Zn.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Zn.errToObj(r)})}nonempty(e){return this.min(1,Zn.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew Ave({checks:[],typeName:Cr.ZodString,coerce:t?.coerce??!1,...Zo(t)});a(j$c,"mh");h8e=class t extends Ms{static{a(this,"T8")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==kn.number){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_type,expected:kn.number,received:o.parsedType}),eo}let r,n=new Zv;for(let o of this._def.checks)o.kind==="int"?hc.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ln(r,{code:hr.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),ln(r,{code:hr.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?j$c(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),ln(r,{code:hr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ln(r,{code:hr.not_finite,message:o.message}),n.dirty()):hc.assertNever(o);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Zn.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Zn.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Zn.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Zn.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Zn.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Zn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Zn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Zn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Zn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Zn.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Zn.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Zn.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Zn.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Zn.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuee.kind==="int"||e.kind==="multipleOf"&&hc.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.valuenew h8e({checks:[],typeName:Cr.ZodNumber,coerce:t?.coerce||!1,...Zo(t)});m8e=class t extends Ms{static{a(this,"x8")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==kn.bigint)return this._getInvalidInput(e);let r,n=new Zv;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),ln(r,{code:hr.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ln(r,{code:hr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):hc.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.bigint,received:r.parsedType}),eo}gte(e,r){return this.setLimit("min",e,!0,Zn.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Zn.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Zn.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Zn.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Zn.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Zn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Zn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Zn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Zn.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Zn.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew m8e({checks:[],typeName:Cr.ZodBigInt,coerce:t?.coerce??!1,...Zo(t)});g8e=class extends Ms{static{a(this,"kX")}_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==kn.boolean){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.boolean,received:r.parsedType}),eo}return P1(e.data)}};g8e.create=t=>new g8e({typeName:Cr.ZodBoolean,coerce:t?.coerce||!1,...Zo(t)});A8e=class t extends Ms{static{a(this,"eQ")}_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==kn.date){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_type,expected:kn.date,received:o.parsedType}),eo}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return ln(o,{code:hr.invalid_date}),eo}let r=new Zv,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()o.value&&(n=this._getOrReturnCtx(e,n),ln(n,{code:hr.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):hc.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Zn.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Zn.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew A8e({checks:[],coerce:t?.coerce||!1,typeName:Cr.ZodDate,...Zo(t)});y8e=class extends Ms{static{a(this,"SX")}_parse(e){if(this._getType(e)!==kn.symbol){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.symbol,received:r.parsedType}),eo}return P1(e.data)}};y8e.create=t=>new y8e({typeName:Cr.ZodSymbol,...Zo(t)});yve=class extends Ms{static{a(this,"$7")}_parse(e){if(this._getType(e)!==kn.undefined){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.undefined,received:r.parsedType}),eo}return P1(e.data)}};yve.create=t=>new yve({typeName:Cr.ZodUndefined,...Zo(t)});Eve=class extends Ms{static{a(this,"Q7")}_parse(e){if(this._getType(e)!==kn.null){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.null,received:r.parsedType}),eo}return P1(e.data)}};Eve.create=t=>new Eve({typeName:Cr.ZodNull,...Zo(t)});E8e=class extends Ms{static{a(this,"vX")}constructor(){super(...arguments),this._any=!0}_parse(e){return P1(e.data)}};E8e.create=t=>new E8e({typeName:Cr.ZodAny,...Zo(t)});aW=class extends Ms{static{a(this,"M0")}constructor(){super(...arguments),this._unknown=!0}_parse(e){return P1(e.data)}};aW.create=t=>new aW({typeName:Cr.ZodUnknown,...Zo(t)});$L=class extends Ms{static{a(this,"d4")}_parse(e){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.never,received:r.parsedType}),eo}};$L.create=t=>new $L({typeName:Cr.ZodNever,...Zo(t)});_8e=class extends Ms{static{a(this,"CX")}_parse(e){if(this._getType(e)!==kn.undefined){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.void,received:r.parsedType}),eo}return P1(e.data)}};_8e.create=t=>new _8e({typeName:Cr.ZodVoid,...Zo(t)});dW=class t extends Ms{static{a(this,"R4")}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==kn.array)return ln(r,{code:hr.invalid_type,expected:kn.array,received:r.parsedType}),eo;if(o.exactLength!==null){let c=r.data.length>o.exactLength.value,l=r.data.lengtho.maxLength.value&&(ln(r,{code:hr.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((c,l)=>o.type._parseAsync(new _k(r,c,r.path,l)))).then(c=>Zv.mergeArray(n,c));let s=[...r.data].map((c,l)=>o.type._parseSync(new _k(r,c,r.path,l)));return Zv.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Zn.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Zn.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Zn.toString(r)}})}nonempty(e){return this.min(1,e)}};dW.create=(t,e)=>new dW({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Cr.ZodArray,...Zo(e)});a(tve,"C8");NI=class t extends Ms{static{a(this,"g$")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=hc.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==kn.object){let u=this._getOrReturnCtx(e);return ln(u,{code:hr.invalid_type,expected:kn.object,received:u.parsedType}),eo}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof $L&&this._def.unknownKeys==="strip"))for(let u in n.data)s.includes(u)||c.push(u);let l=[];for(let u of s){let d=o[u],f=n.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new _k(n,f,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof $L){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of c)l.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(u==="strict")c.length>0&&(ln(n,{code:hr.unrecognized_keys,keys:c}),r.dirty());else if(u!=="strip")throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of c){let f=n.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new _k(n,f,n.path,d)),alwaysSet:d in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of l){let f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>Zv.mergeObjectSync(r,u)):Zv.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Zn.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:a((r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:Zn.errToObj(e).message??o}:{message:o}},"errorMap")}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:a(()=>({...this._def.shape(),...e}),"shape")})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:a(()=>({...this._def.shape(),...e._def.shape()}),"shape"),typeName:Cr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of hc.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}omit(e){let r={};for(let n of hc.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}deepPartial(){return tve(this)}partial(e){let r={};for(let n of hc.objectKeys(this.shape)){let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}return new t({...this._def,shape:a(()=>r,"shape")})}required(e){let r={};for(let n of hc.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Ek;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:a(()=>r,"shape")})}keyof(){return ZXi(hc.objectKeys(this.shape))}};NI.create=(t,e)=>new NI({shape:a(()=>t,"shape"),unknownKeys:"strip",catchall:$L.create(),typeName:Cr.ZodObject,...Zo(e)});NI.strictCreate=(t,e)=>new NI({shape:a(()=>t,"shape"),unknownKeys:"strict",catchall:$L.create(),typeName:Cr.ZodObject,...Zo(e)});NI.lazycreate=(t,e)=>new NI({shape:t,unknownKeys:"strip",catchall:$L.create(),typeName:Cr.ZodObject,...Zo(e)});_ve=class extends Ms{static{a(this,"J7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(s){for(let l of s)if(l.result.status==="valid")return l.result;for(let l of s)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let c=s.map(l=>new yk(l.ctx.common.issues));return ln(r,{code:hr.invalid_union,unionErrors:c}),eo}if(a(o,"Y"),r.common.async)return Promise.all(n.map(async s=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(o);{let s,c=[];for(let u of n){let d={...r,common:{...r.common,issues:[]},parent:null},f=u._parseSync({data:r.data,path:r.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:d}),d.common.issues.length&&c.push(d.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let l=c.map(u=>new yk(u));return ln(r,{code:hr.invalid_union,unionErrors:l}),eo}}get options(){return this._def.options}};_ve.create=(t,e)=>new _ve({options:t,typeName:Cr.ZodUnion,...Zo(e)});j9=a(t=>t instanceof Cve?j9(t.schema):t instanceof QN?j9(t.innerType()):t instanceof bve?[t.value]:t instanceof Sve?t.options:t instanceof Tve?hc.objectValues(t.enum):t instanceof Ive?j9(t._def.innerType):t instanceof yve?[void 0]:t instanceof Eve?[null]:t instanceof Ek?[void 0,...j9(t.unwrap())]:t instanceof K9?[null,...j9(t.unwrap())]:t instanceof Mxt||t instanceof wve?j9(t.unwrap()):t instanceof xve?j9(t._def.innerType):[],"c4"),N8r=class t extends Ms{static{a(this,"gH")}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==kn.object)return ln(r,{code:hr.invalid_type,expected:kn.object,received:r.parsedType}),eo;let n=this.discriminator,o=r.data[n],s=this.optionsMap.get(o);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(ln(r,{code:hr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),eo)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let s of r){let c=j9(s.shape[e]);if(!c.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let l of c){if(o.has(l))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);o.set(l,s)}}return new t({typeName:Cr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...Zo(n)})}};a(M8r,"fH");vve=class extends Ms{static{a(this,"X7")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=a((s,c)=>{if(PKi(s)||PKi(c))return eo;let l=M8r(s.value,c.value);return l.valid?((DKi(s)||DKi(c))&&r.dirty(),{status:r.value,value:l.data}):(ln(n,{code:hr.invalid_intersection_types}),eo)},"Y");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,c])=>o(s,c)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};vve.create=(t,e,r)=>new vve({left:t,right:e,typeName:Cr.ZodIntersection,...Zo(r)});Y9=class t extends Ms{static{a(this,"i4")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==kn.array)return ln(n,{code:hr.invalid_type,expected:kn.array,received:n.parsedType}),eo;if(n.data.lengththis._def.items.length&&(ln(n,{code:hr.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,c)=>{let l=this._def.items[c]||this._def.rest;return l?l._parse(new _k(n,s,n.path,c)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>Zv.mergeArray(r,s)):Zv.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Y9.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Y9({items:t,typeName:Cr.ZodTuple,rest:null,...Zo(e)})};O8r=class t extends Ms{static{a(this,"TX")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==kn.object)return ln(n,{code:hr.invalid_type,expected:kn.object,received:n.parsedType}),eo;let o=[],s=this._def.keyType,c=this._def.valueType;for(let l in n.data)o.push({key:s._parse(new _k(n,l,n.path,l)),value:c._parse(new _k(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?Zv.mergeObjectAsync(r,o):Zv.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Ms?new t({keyType:e,valueType:r,typeName:Cr.ZodRecord,...Zo(n)}):new t({keyType:Ave.create(),valueType:e,typeName:Cr.ZodRecord,...Zo(r)})}},v8e=class extends Ms{static{a(this,"xX")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==kn.map)return ln(n,{code:hr.invalid_type,expected:kn.map,received:n.parsedType}),eo;let o=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([l,u],d)=>({key:o._parse(new _k(n,l,n.path,[d,"key"])),value:s._parse(new _k(n,u,n.path,[d,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let u of c){let d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return eo;(d.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(d.value,f.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let u of c){let{key:d,value:f}=u;if(d.status==="aborted"||f.status==="aborted")return eo;(d.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(d.value,f.value)}return{status:r.value,value:l}}}};v8e.create=(t,e,r)=>new v8e({valueType:e,keyType:t,typeName:Cr.ZodMap,...Zo(r)});C8e=class t extends Ms{static{a(this,"y8")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==kn.set)return ln(n,{code:hr.invalid_type,expected:kn.set,received:n.parsedType}),eo;let o=this._def;o.minSize!==null&&n.data.sizeo.maxSize.value&&(ln(n,{code:hr.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let s=this._def.valueType;function c(u){let d=new Set;for(let f of u){if(f.status==="aborted")return eo;f.status==="dirty"&&r.dirty(),d.add(f.value)}return{status:r.value,value:d}}a(c,"W");let l=[...n.data.values()].map((u,d)=>s._parse(new _k(n,u,n.path,d)));return n.common.async?Promise.all(l).then(u=>c(u)):c(l)}min(e,r){return new t({...this._def,minSize:{value:e,message:Zn.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Zn.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};C8e.create=(t,e)=>new C8e({valueType:t,minSize:null,maxSize:null,typeName:Cr.ZodSet,...Zo(e)});L8r=class t extends Ms{static{a(this,"sQ")}constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==kn.function)return ln(r,{code:hr.invalid_type,expected:kn.function,received:r.parsedType}),eo;function n(l,u){return D8r({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,P8r(),p8e].filter(d=>!!d),issueData:{code:hr.invalid_arguments,argumentsError:u}})}a(n,"J");function o(l,u){return D8r({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,P8r(),p8e].filter(d=>!!d),issueData:{code:hr.invalid_return_type,returnTypeError:u}})}a(o,"Y");let s={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof roe){let l=this;return P1(async function(...u){let d=new yk([]),f=await l._def.args.parseAsync(u,s).catch(m=>{throw d.addIssue(n(u,m)),d}),h=await Reflect.apply(c,this,f);return await l._def.returns._def.type.parseAsync(h,s).catch(m=>{throw d.addIssue(o(h,m)),d})})}else{let l=this;return P1(function(...u){let d=l._def.args.safeParse(u,s);if(!d.success)throw new yk([n(u,d.error)]);let f=Reflect.apply(c,this,d.data),h=l._def.returns.safeParse(f,s);if(!h.success)throw new yk([o(f,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Y9.create(e).rest(aW.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||Y9.create([]).rest(aW.create()),returns:r||aW.create(),typeName:Cr.ZodFunction,...Zo(n)})}},Cve=class extends Ms{static{a(this,"Y7")}get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Cve.create=(t,e)=>new Cve({getter:t,typeName:Cr.ZodLazy,...Zo(e)});bve=class extends Ms{static{a(this,"W7")}_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ln(r,{received:r.data,code:hr.invalid_literal,expected:this._def.value}),eo}return{status:"valid",value:e.data}}get value(){return this._def.value}};bve.create=(t,e)=>new bve({value:t,typeName:Cr.ZodLiteral,...Zo(e)});a(ZXi,"JM");Sve=class t extends Ms{static{a(this,"L0")}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return ln(r,{expected:hc.joinValues(n),received:r.parsedType,code:hr.invalid_type}),eo}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return ln(r,{received:r.data,code:hr.invalid_enum_value,options:n}),eo}return P1(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};Sve.create=ZXi;Tve=class extends Ms{static{a(this,"G7")}_parse(e){let r=hc.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==kn.string&&n.parsedType!==kn.number){let o=hc.objectValues(r);return ln(n,{expected:hc.joinValues(o),received:n.parsedType,code:hr.invalid_type}),eo}if(this._cache||(this._cache=new Set(hc.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=hc.objectValues(r);return ln(n,{received:n.data,code:hr.invalid_enum_value,options:o}),eo}return P1(e.data)}get enum(){return this._def.values}};Tve.create=(t,e)=>new Tve({values:t,typeName:Cr.ZodNativeEnum,...Zo(e)});roe=class extends Ms{static{a(this,"f8")}unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==kn.promise&&r.common.async===!1)return ln(r,{code:hr.invalid_type,expected:kn.promise,received:r.parsedType}),eo;let n=r.parsedType===kn.promise?r.data:Promise.resolve(r.data);return P1(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};roe.create=(t,e)=>new roe({type:t,typeName:Cr.ZodPromise,...Zo(e)});QN=class extends Ms{static{a(this,"P4")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Cr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:a(c=>{ln(n,c),c.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let c=o.transform(n.data,s);if(n.common.async)return Promise.resolve(c).then(async l=>{if(r.value==="aborted")return eo;let u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?eo:u.status==="dirty"||r.value==="dirty"?JFe(u.value):u});{if(r.value==="aborted")return eo;let l=this._def.schema._parseSync({data:c,path:n.path,parent:n});return l.status==="aborted"?eo:l.status==="dirty"||r.value==="dirty"?JFe(l.value):l}}if(o.type==="refinement"){let c=a(l=>{let u=o.refinement(l,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"W");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?eo:(l.status==="dirty"&&r.dirty(),c(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?eo:(l.status==="dirty"&&r.dirty(),c(l.value).then(()=>({status:r.value,value:l.value}))))}if(o.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!gve(c))return eo;let l=o.transform(c.value,s);if(l instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>gve(c)?Promise.resolve(o.transform(c.value,s)).then(l=>({status:r.value,value:l})):eo);hc.assertNever(o)}};QN.create=(t,e,r)=>new QN({schema:t,typeName:Cr.ZodEffects,effect:e,...Zo(r)});QN.createWithPreprocess=(t,e,r)=>new QN({schema:e,effect:{type:"preprocess",transform:t},typeName:Cr.ZodEffects,...Zo(r)});Ek=class extends Ms{static{a(this,"o6")}_parse(e){return this._getType(e)===kn.undefined?P1(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ek.create=(t,e)=>new Ek({innerType:t,typeName:Cr.ZodOptional,...Zo(e)});K9=class extends Ms{static{a(this,"A1")}_parse(e){return this._getType(e)===kn.null?P1(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};K9.create=(t,e)=>new K9({innerType:t,typeName:Cr.ZodNullable,...Zo(e)});Ive=class extends Ms{static{a(this,"U7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===kn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ive.create=(t,e)=>new Ive({innerType:t,typeName:Cr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Zo(e)});xve=class extends Ms{static{a(this,"H7")}_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Nxt(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new yk(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new yk(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};xve.create=(t,e)=>new xve({innerType:t,typeName:Cr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Zo(e)});b8e=class extends Ms{static{a(this,"yX")}_parse(e){if(this._getType(e)!==kn.nan){let r=this._getOrReturnCtx(e);return ln(r,{code:hr.invalid_type,expected:kn.nan,received:r.parsedType}),eo}return{status:"valid",value:e.data}}};b8e.create=t=>new b8e({typeName:Cr.ZodNaN,...Zo(t)});Mxt=class extends Ms{static{a(this,"hH")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Oxt=class t extends Ms{static{a(this,"fX")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?eo:o.status==="dirty"?(r.dirty(),JFe(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?eo:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:Cr.ZodPipeline})}},wve=class extends Ms{static{a(this,"K7")}_parse(e){let r=this._def.innerType._parse(e),n=a(o=>(gve(o)&&(o.value=Object.freeze(o.value)),o),"J");return Nxt(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};wve.create=(t,e)=>new wve({innerType:t,typeName:Cr.ZodReadonly,...Zo(e)});wKh={object:NI.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Cr||(Cr={}));RKh=Ave.create,kKh=h8e.create,PKh=b8e.create,DKh=m8e.create,NKh=g8e.create,MKh=A8e.create,OKh=y8e.create,LKh=yve.create,BKh=Eve.create,FKh=E8e.create,UKh=aW.create,QKh=$L.create,qKh=_8e.create,jKh=dW.create,H$c=NI.create,HKh=NI.strictCreate,GKh=_ve.create,$Kh=N8r.create,VKh=vve.create,WKh=Y9.create,zKh=O8r.create,YKh=v8e.create,KKh=C8e.create,JKh=L8r.create,ZKh=Cve.create,XKh=bve.create,eJh=Sve.create,tJh=Tve.create,rJh=roe.create,nJh=QN.create,iJh=Ek.create,oJh=K9.create,sJh=QN.createWithPreprocess,aJh=Oxt.create,XXi={};WL(XXi,{version:a(()=>uto,"version"),util:a(()=>Ws,"util"),treeifyError:a(()=>deo,"treeifyError"),toJSONSchema:a(()=>eUr,"toJSONSchema"),toDotPath:a(()=>feo,"toDotPath"),safeParseAsync:a(()=>Nwt,"safeParseAsync"),safeParse:a(()=>Dwt,"safeParse"),registry:a(()=>E9r,"registry"),regexes:a(()=>o9r,"regexes"),prettifyError:a(()=>peo,"prettifyError"),parseAsync:a(()=>Uxt,"parseAsync"),parse:a(()=>Fxt,"parse"),locales:a(()=>y9r,"locales"),isValidJWT:a(()=>Mto,"isValidJWT"),isValidBase64URL:a(()=>Pto,"isValidBase64URL"),isValidBase64:a(()=>l9r,"isValidBase64"),globalRegistry:a(()=>V9,"globalRegistry"),globalConfig:a(()=>Lxt,"globalConfig"),function:a(()=>rno,"function"),formatError:a(()=>e9r,"formatError"),flattenError:a(()=>X6r,"flattenError"),config:a(()=>Xv,"config"),clone:a(()=>$N,"clone"),_xid:a(()=>P9r,"_xid"),_void:a(()=>qro,"_void"),_uuidv7:a(()=>S9r,"_uuidv7"),_uuidv6:a(()=>b9r,"_uuidv6"),_uuidv4:a(()=>C9r,"_uuidv4"),_uuid:a(()=>v9r,"_uuid"),_url:a(()=>T9r,"_url"),_uppercase:a(()=>G9r,"_uppercase"),_unknown:a(()=>Hxt,"_unknown"),_union:a(()=>GWc,"_union"),_undefined:a(()=>Bro,"_undefined"),_ulid:a(()=>k9r,"_ulid"),_uint64:a(()=>Oro,"_uint64"),_uint32:a(()=>Rro,"_uint32"),_tuple:a(()=>Kro,"_tuple"),_trim:a(()=>K9r,"_trim"),_transform:a(()=>XWc,"_transform"),_toUpperCase:a(()=>Z9r,"_toUpperCase"),_toLowerCase:a(()=>J9r,"_toLowerCase"),_templateLiteral:a(()=>czc,"_templateLiteral"),_symbol:a(()=>Lro,"_symbol"),_success:a(()=>izc,"_success"),_stringbool:a(()=>eno,"_stringbool"),_stringFormat:a(()=>tno,"_stringFormat"),_string:a(()=>gro,"_string"),_startsWith:a(()=>V9r,"_startsWith"),_size:a(()=>q9r,"_size"),_set:a(()=>YWc,"_set"),_safeParseAsync:a(()=>i9r,"_safeParseAsync"),_safeParse:a(()=>n9r,"_safeParse"),_regex:a(()=>j9r,"_regex"),_refine:a(()=>Xro,"_refine"),_record:a(()=>WWc,"_record"),_readonly:a(()=>azc,"_readonly"),_property:a(()=>Yro,"_property"),_promise:a(()=>uzc,"_promise"),_positive:a(()=>$ro,"_positive"),_pipe:a(()=>szc,"_pipe"),_parseAsync:a(()=>r9r,"_parseAsync"),_parse:a(()=>t9r,"_parse"),_overwrite:a(()=>loe,"_overwrite"),_optional:a(()=>ezc,"_optional"),_number:a(()=>bro,"_number"),_nullable:a(()=>tzc,"_nullable"),_null:a(()=>Fro,"_null"),_normalize:a(()=>Y9r,"_normalize"),_nonpositive:a(()=>Wro,"_nonpositive"),_nonoptional:a(()=>nzc,"_nonoptional"),_nonnegative:a(()=>zro,"_nonnegative"),_never:a(()=>Qro,"_never"),_negative:a(()=>Vro,"_negative"),_nativeEnum:a(()=>JWc,"_nativeEnum"),_nanoid:a(()=>x9r,"_nanoid"),_nan:a(()=>Gro,"_nan"),_multipleOf:a(()=>x8e,"_multipleOf"),_minSize:a(()=>w8e,"_minSize"),_minLength:a(()=>kve,"_minLength"),_min:a(()=>RI,"_min"),_mime:a(()=>z9r,"_mime"),_maxSize:a(()=>Owt,"_maxSize"),_maxLength:a(()=>Lwt,"_maxLength"),_max:a(()=>FN,"_max"),_map:a(()=>zWc,"_map"),_lte:a(()=>FN,"_lte"),_lt:a(()=>noe,"_lt"),_lowercase:a(()=>H9r,"_lowercase"),_literal:a(()=>ZWc,"_literal"),_length:a(()=>Bwt,"_length"),_lazy:a(()=>lzc,"_lazy"),_ksuid:a(()=>D9r,"_ksuid"),_jwt:a(()=>Q9r,"_jwt"),_isoTime:a(()=>vro,"_isoTime"),_isoDuration:a(()=>Cro,"_isoDuration"),_isoDateTime:a(()=>Ero,"_isoDateTime"),_isoDate:a(()=>_ro,"_isoDate"),_ipv6:a(()=>M9r,"_ipv6"),_ipv4:a(()=>N9r,"_ipv4"),_intersection:a(()=>VWc,"_intersection"),_int64:a(()=>Mro,"_int64"),_int32:a(()=>wro,"_int32"),_int:a(()=>Tro,"_int"),_includes:a(()=>$9r,"_includes"),_guid:a(()=>jxt,"_guid"),_gte:a(()=>RI,"_gte"),_gt:a(()=>ioe,"_gt"),_float64:a(()=>xro,"_float64"),_float32:a(()=>Iro,"_float32"),_file:a(()=>Jro,"_file"),_enum:a(()=>KWc,"_enum"),_endsWith:a(()=>W9r,"_endsWith"),_emoji:a(()=>I9r,"_emoji"),_email:a(()=>_9r,"_email"),_e164:a(()=>U9r,"_e164"),_discriminatedUnion:a(()=>$Wc,"_discriminatedUnion"),_default:a(()=>rzc,"_default"),_date:a(()=>jro,"_date"),_custom:a(()=>Zro,"_custom"),_cuid2:a(()=>R9r,"_cuid2"),_cuid:a(()=>w9r,"_cuid"),_coercedString:a(()=>Aro,"_coercedString"),_coercedNumber:a(()=>Sro,"_coercedNumber"),_coercedDate:a(()=>Hro,"_coercedDate"),_coercedBoolean:a(()=>Pro,"_coercedBoolean"),_coercedBigint:a(()=>Nro,"_coercedBigint"),_cidrv6:a(()=>L9r,"_cidrv6"),_cidrv4:a(()=>O9r,"_cidrv4"),_catch:a(()=>ozc,"_catch"),_boolean:a(()=>kro,"_boolean"),_bigint:a(()=>Dro,"_bigint"),_base64url:a(()=>F9r,"_base64url"),_base64:a(()=>B9r,"_base64"),_array:a(()=>X9r,"_array"),_any:a(()=>Uro,"_any"),TimePrecision:a(()=>yro,"TimePrecision"),NEVER:a(()=>eeo,"NEVER"),JSONSchemaGenerator:a(()=>R8e,"JSONSchemaGenerator"),JSONSchema:a(()=>dzc,"JSONSchema"),Doc:a(()=>Qxt,"Doc"),$output:a(()=>hro,"$output"),$input:a(()=>mro,"$input"),$constructor:a(()=>ft,"$constructor"),$brand:a(()=>teo,"$brand"),$ZodXID:a(()=>_to,"$ZodXID"),$ZodVoid:a(()=>Gto,"$ZodVoid"),$ZodUnknown:a(()=>qxt,"$ZodUnknown"),$ZodUnion:a(()=>m9r,"$ZodUnion"),$ZodUndefined:a(()=>Qto,"$ZodUndefined"),$ZodUUID:a(()=>fto,"$ZodUUID"),$ZodURL:a(()=>hto,"$ZodURL"),$ZodULID:a(()=>Eto,"$ZodULID"),$ZodType:a(()=>Co,"$ZodType"),$ZodTuple:a(()=>Mwt,"$ZodTuple"),$ZodTransform:a(()=>g9r,"$ZodTransform"),$ZodTemplateLiteral:a(()=>lro,"$ZodTemplateLiteral"),$ZodSymbol:a(()=>Uto,"$ZodSymbol"),$ZodSuccess:a(()=>oro,"$ZodSuccess"),$ZodStringFormat:a(()=>Lu,"$ZodStringFormat"),$ZodString:a(()=>q8e,"$ZodString"),$ZodSet:a(()=>Kto,"$ZodSet"),$ZodRegistry:a(()=>I8e,"$ZodRegistry"),$ZodRecord:a(()=>zto,"$ZodRecord"),$ZodRealError:a(()=>U8e,"$ZodRealError"),$ZodReadonly:a(()=>cro,"$ZodReadonly"),$ZodPromise:a(()=>uro,"$ZodPromise"),$ZodPrefault:a(()=>nro,"$ZodPrefault"),$ZodPipe:a(()=>A9r,"$ZodPipe"),$ZodOptional:a(()=>ero,"$ZodOptional"),$ZodObject:a(()=>h9r,"$ZodObject"),$ZodNumberFormat:a(()=>Bto,"$ZodNumberFormat"),$ZodNumber:a(()=>u9r,"$ZodNumber"),$ZodNullable:a(()=>tro,"$ZodNullable"),$ZodNull:a(()=>qto,"$ZodNull"),$ZodNonOptional:a(()=>iro,"$ZodNonOptional"),$ZodNever:a(()=>Hto,"$ZodNever"),$ZodNanoID:a(()=>gto,"$ZodNanoID"),$ZodNaN:a(()=>aro,"$ZodNaN"),$ZodMap:a(()=>Yto,"$ZodMap"),$ZodLiteral:a(()=>Zto,"$ZodLiteral"),$ZodLazy:a(()=>dro,"$ZodLazy"),$ZodKSUID:a(()=>vto,"$ZodKSUID"),$ZodJWT:a(()=>Oto,"$ZodJWT"),$ZodIntersection:a(()=>Wto,"$ZodIntersection"),$ZodISOTime:a(()=>Sto,"$ZodISOTime"),$ZodISODuration:a(()=>Tto,"$ZodISODuration"),$ZodISODateTime:a(()=>Cto,"$ZodISODateTime"),$ZodISODate:a(()=>bto,"$ZodISODate"),$ZodIPv6:a(()=>xto,"$ZodIPv6"),$ZodIPv4:a(()=>Ito,"$ZodIPv4"),$ZodGUID:a(()=>dto,"$ZodGUID"),$ZodFunction:a(()=>Gxt,"$ZodFunction"),$ZodFile:a(()=>Xto,"$ZodFile"),$ZodError:a(()=>Z6r,"$ZodError"),$ZodEnum:a(()=>Jto,"$ZodEnum"),$ZodEmoji:a(()=>mto,"$ZodEmoji"),$ZodEmail:a(()=>pto,"$ZodEmail"),$ZodE164:a(()=>Nto,"$ZodE164"),$ZodDiscriminatedUnion:a(()=>Vto,"$ZodDiscriminatedUnion"),$ZodDefault:a(()=>rro,"$ZodDefault"),$ZodDate:a(()=>$to,"$ZodDate"),$ZodCustomStringFormat:a(()=>Lto,"$ZodCustomStringFormat"),$ZodCustom:a(()=>fro,"$ZodCustom"),$ZodCheckUpperCase:a(()=>nto,"$ZodCheckUpperCase"),$ZodCheckStringFormat:a(()=>Q8e,"$ZodCheckStringFormat"),$ZodCheckStartsWith:a(()=>oto,"$ZodCheckStartsWith"),$ZodCheckSizeEquals:a(()=>Jeo,"$ZodCheckSizeEquals"),$ZodCheckRegex:a(()=>tto,"$ZodCheckRegex"),$ZodCheckProperty:a(()=>ato,"$ZodCheckProperty"),$ZodCheckOverwrite:a(()=>lto,"$ZodCheckOverwrite"),$ZodCheckNumberFormat:a(()=>Weo,"$ZodCheckNumberFormat"),$ZodCheckMultipleOf:a(()=>Veo,"$ZodCheckMultipleOf"),$ZodCheckMinSize:a(()=>Keo,"$ZodCheckMinSize"),$ZodCheckMinLength:a(()=>Xeo,"$ZodCheckMinLength"),$ZodCheckMimeType:a(()=>cto,"$ZodCheckMimeType"),$ZodCheckMaxSize:a(()=>Yeo,"$ZodCheckMaxSize"),$ZodCheckMaxLength:a(()=>Zeo,"$ZodCheckMaxLength"),$ZodCheckLowerCase:a(()=>rto,"$ZodCheckLowerCase"),$ZodCheckLessThan:a(()=>a9r,"$ZodCheckLessThan"),$ZodCheckLengthEquals:a(()=>eto,"$ZodCheckLengthEquals"),$ZodCheckIncludes:a(()=>ito,"$ZodCheckIncludes"),$ZodCheckGreaterThan:a(()=>c9r,"$ZodCheckGreaterThan"),$ZodCheckEndsWith:a(()=>sto,"$ZodCheckEndsWith"),$ZodCheckBigIntFormat:a(()=>zeo,"$ZodCheckBigIntFormat"),$ZodCheck:a(()=>Sh,"$ZodCheck"),$ZodCatch:a(()=>sro,"$ZodCatch"),$ZodCUID2:a(()=>yto,"$ZodCUID2"),$ZodCUID:a(()=>Ato,"$ZodCUID"),$ZodCIDRv6:a(()=>Rto,"$ZodCIDRv6"),$ZodCIDRv4:a(()=>wto,"$ZodCIDRv4"),$ZodBoolean:a(()=>d9r,"$ZodBoolean"),$ZodBigIntFormat:a(()=>Fto,"$ZodBigIntFormat"),$ZodBigInt:a(()=>f9r,"$ZodBigInt"),$ZodBase64URL:a(()=>Dto,"$ZodBase64URL"),$ZodBase64:a(()=>kto,"$ZodBase64"),$ZodAsyncError:a(()=>fW,"$ZodAsyncError"),$ZodArray:a(()=>p9r,"$ZodArray"),$ZodAny:a(()=>jto,"$ZodAny")});eeo=Object.freeze({status:"aborted"});a(ft,"F");teo=Symbol("zod_brand"),fW=class extends Error{static{a(this,"n4")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Lxt={};a(Xv,"c$");Ws={};WL(Ws,{unwrapMessage:a(()=>ZFe,"unwrapMessage"),stringifyPrimitive:a(()=>us,"stringifyPrimitive"),required:a(()=>sVc,"required"),randomString:a(()=>J$c,"randomString"),propertyKeyTypes:a(()=>Bxt,"propertyKeyTypes"),promiseAllObject:a(()=>K$c,"promiseAllObject"),primitiveTypes:a(()=>oeo,"primitiveTypes"),prefixIssues:a(()=>Ak,"prefixIssues"),pick:a(()=>tVc,"pick"),partial:a(()=>oVc,"partial"),optionalKeys:a(()=>seo,"optionalKeys"),omit:a(()=>rVc,"omit"),numKeys:a(()=>Z$c,"numKeys"),nullish:a(()=>aoe,"nullish"),normalizeParams:a(()=>xr,"normalizeParams"),merge:a(()=>iVc,"merge"),jsonStringifyReplacer:a(()=>reo,"jsonStringifyReplacer"),joinValues:a(()=>Vr,"joinValues"),issue:a(()=>leo,"issue"),isPlainObject:a(()=>T8e,"isPlainObject"),isObject:a(()=>S8e,"isObject"),getSizableOrigin:a(()=>kwt,"getSizableOrigin"),getParsedType:a(()=>X$c,"getParsedType"),getLengthableOrigin:a(()=>Pwt,"getLengthableOrigin"),getEnumValues:a(()=>Y6r,"getEnumValues"),getElementAtPath:a(()=>Y$c,"getElementAtPath"),floatSafeRemainder:a(()=>neo,"floatSafeRemainder"),finalizeIssue:a(()=>qN,"finalizeIssue"),extend:a(()=>nVc,"extend"),escapeRegex:a(()=>coe,"escapeRegex"),esc:a(()=>rve,"esc"),defineLazy:a(()=>zc,"defineLazy"),createTransparentProxy:a(()=>eVc,"createTransparentProxy"),clone:a(()=>$N,"clone"),cleanRegex:a(()=>Rwt,"cleanRegex"),cleanEnum:a(()=>aVc,"cleanEnum"),captureStackTrace:a(()=>J6r,"captureStackTrace"),cached:a(()=>wwt,"cached"),assignProp:a(()=>K6r,"assignProp"),assertNotEqual:a(()=>$$c,"assertNotEqual"),assertNever:a(()=>W$c,"assertNever"),assertIs:a(()=>V$c,"assertIs"),assertEqual:a(()=>G$c,"assertEqual"),assert:a(()=>z$c,"assert"),allowsEval:a(()=>ieo,"allowsEval"),aborted:a(()=>ave,"aborted"),NUMBER_FORMAT_RANGES:a(()=>aeo,"NUMBER_FORMAT_RANGES"),Class:a(()=>B8r,"Class"),BIGINT_FORMAT_RANGES:a(()=>ceo,"BIGINT_FORMAT_RANGES")});a(G$c,"lh");a($$c,"ch");a(V$c,"ph");a(W$c,"dh");a(z$c,"ih");a(Y6r,"B7");a(Vr,"P");a(reo,"mH");a(wwt,"z7");a(aoe,"I1");a(Rwt,"N7");a(neo,"lH");a(zc,"N$");a(K6r,"cH");a(Y$c,"nh");a(K$c,"rh");a(J$c,"oh");a(rve,"j0");J6r=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};a(S8e,"g8");ieo=wwt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});a(T8e,"h8");a(Z$c,"th");X$c=a(t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw Error(`Unknown data type: ${e}`)}},"ah"),Bxt=new Set(["string","number","symbol"]),oeo=new Set(["string","number","bigint","boolean","symbol","undefined"]);a(coe,"r4");a($N,"H6");a(xr,"k");a(eVc,"sh");a(us,"x");a(seo,"iH");aeo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ceo={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};a(tVc,"eh");a(rVc,"$u");a(nVc,"Qu");a(iVc,"Ju");a(oVc,"Xu");a(sVc,"Yu");a(ave,"A0");a(Ak,"I6");a(ZFe,"V7");a(qN,"g6");a(kwt,"O7");a(Pwt,"D7");a(leo,"oH");a(aVc,"Wu");B8r=class{static{a(this,"YM")}constructor(...e){}},ueo=a((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,reo,2)},enumerable:!0})},"WM"),Z6r=ft("$ZodError",ueo),U8e=ft("$ZodError",ueo,{Parent:Error});a(X6r,"m8");a(e9r,"l8");a(deo,"mX");a(feo,"GM");a(peo,"lX");t9r=a(t=>(e,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new fW;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>qN(u,s,Xv())));throw J6r(l,o?.callee),l}return c.value},"cX"),Fxt=t9r(U8e),r9r=a(t=>async(e,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>qN(u,s,Xv())));throw J6r(l,o?.callee),l}return c.value},"pX"),Uxt=r9r(U8e),n9r=a(t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new fW;return s.issues.length?{success:!1,error:new(t??Z6r)(s.issues.map(c=>qN(c,o,Xv())))}:{success:!0,data:s.value}},"dX"),Dwt=n9r(U8e),i9r=a(t=>async(e,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>qN(c,o,Xv())))}:{success:!0,data:s.value}},"iX"),Nwt=i9r(U8e),o9r={};WL(o9r,{xid:a(()=>Aeo,"xid"),uuid7:a(()=>dVc,"uuid7"),uuid6:a(()=>uVc,"uuid6"),uuid4:a(()=>lVc,"uuid4"),uuid:a(()=>Rve,"uuid"),uppercase:a(()=>Geo,"uppercase"),unicodeEmail:a(()=>hVc,"unicodeEmail"),undefined:a(()=>jeo,"undefined"),ulid:a(()=>geo,"ulid"),time:a(()=>Meo,"time"),string:a(()=>Leo,"string"),rfc5322Email:a(()=>pVc,"rfc5322Email"),number:a(()=>Ueo,"number"),null:a(()=>qeo,"null"),nanoid:a(()=>Eeo,"nanoid"),lowercase:a(()=>Heo,"lowercase"),ksuid:a(()=>yeo,"ksuid"),ipv6:a(()=>Teo,"ipv6"),ipv4:a(()=>Seo,"ipv4"),integer:a(()=>Feo,"integer"),html5Email:a(()=>fVc,"html5Email"),hostname:a(()=>Reo,"hostname"),guid:a(()=>veo,"guid"),extendedDuration:a(()=>cVc,"extendedDuration"),emoji:a(()=>beo,"emoji"),email:a(()=>Ceo,"email"),e164:a(()=>keo,"e164"),duration:a(()=>_eo,"duration"),domain:a(()=>AVc,"domain"),datetime:a(()=>Oeo,"datetime"),date:a(()=>Deo,"date"),cuid2:a(()=>meo,"cuid2"),cuid:a(()=>heo,"cuid"),cidrv6:a(()=>xeo,"cidrv6"),cidrv4:a(()=>Ieo,"cidrv4"),browserEmail:a(()=>mVc,"browserEmail"),boolean:a(()=>Qeo,"boolean"),bigint:a(()=>Beo,"bigint"),base64url:a(()=>s9r,"base64url"),base64:a(()=>weo,"base64"),_emoji:a(()=>gVc,"_emoji")});heo=/^[cC][^\s-]{8,}$/,meo=/^[0-9a-z]+$/,geo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Aeo=/^[0-9a-vA-V]{20}$/,yeo=/^[A-Za-z0-9]{27}$/,Eeo=/^[a-zA-Z0-9_-]{21}$/,_eo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,cVc=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,veo=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Rve=a(t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,"P0"),lVc=Rve(4),uVc=Rve(6),dVc=Rve(7),Ceo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,fVc=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,pVc=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,hVc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,mVc=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,gVc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";a(beo,"WK");Seo=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Teo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Ieo=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,xeo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,weo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,s9r=/^[A-Za-z0-9_-]*$/,Reo=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,AVc=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,keo=/^\+(?:[0-9]){6,14}[0-9]$/,Peo="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Deo=new RegExp(`^${Peo}$`);a(Neo,"HM");a(Meo,"NK");a(Oeo,"wK");Leo=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"OK"),Beo=/^\d+n?$/,Feo=/^\d+$/,Ueo=/^-?\d+(?:\.\d+)?/i,Qeo=/true|false/i,qeo=/null/i,jeo=/undefined/i,Heo=/^[^A-Z]*$/,Geo=/^[^a-z]*$/,Sh=ft("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),$eo={number:"number",bigint:"bigint",object:"date"},a9r=ft("$ZodCheckLessThan",(t,e)=>{Sh.init(t,e);let r=$eo[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?n.value<=e.value:n.value{Sh.init(t,e);let r=$eo[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Veo=ft("$ZodCheckMultipleOf",(t,e)=>{Sh.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):neo(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),Weo=ft("$ZodCheckNumberFormat",(t,e)=>{Sh.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=aeo[e.format];t._zod.onattach.push(c=>{let l=c._zod.bag;l.format=e.format,l.minimum=o,l.maximum=s,r&&(l.pattern=Feo)}),t._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:e.format,code:"invalid_type",input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort});return}}ls&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inst:t})}}),zeo=ft("$ZodCheckBigIntFormat",(t,e)=>{Sh.init(t,e);let[r,n]=ceo[e.format];t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,s.minimum=r,s.maximum=n}),t._zod.check=o=>{let s=o.value;sn&&o.issues.push({origin:"bigint",input:s,code:"too_big",maximum:n,inst:t})}}),Yeo=ft("$ZodCheckMaxSize",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let n=r.value;n.size<=e.maximum||r.issues.push({origin:kwt(n),code:"too_big",maximum:e.maximum,input:n,inst:t,continue:!e.abort})}}),Keo=ft("$ZodCheckMinSize",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let n=r.value;n.size>=e.minimum||r.issues.push({origin:kwt(n),code:"too_small",minimum:e.minimum,input:n,inst:t,continue:!e.abort})}}),Jeo=ft("$ZodCheckSizeEquals",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),t._zod.check=r=>{let n=r.value,o=n.size;if(o===e.size)return;let s=o>e.size;r.issues.push({origin:kwt(n),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),Zeo=ft("$ZodCheckMaxLength",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let n=r.value;if(n.length<=e.maximum)return;let o=Pwt(n);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Xeo=ft("$ZodCheckMinLength",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let n=r.value;if(n.length>=e.minimum)return;let o=Pwt(n);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),eto=ft("$ZodCheckLengthEquals",(t,e)=>{Sh.init(t,e),t._zod.when=r=>{let n=r.value;return!aoe(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),t._zod.check=r=>{let n=r.value,o=n.length;if(o===e.length)return;let s=Pwt(n),c=o>e.length;r.issues.push({origin:s,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),Q8e=ft("$ZodCheckStringFormat",(t,e)=>{var r,n;Sh.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),tto=ft("$ZodCheckRegex",(t,e)=>{Q8e.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),rto=ft("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Heo),Q8e.init(t,e)}),nto=ft("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Geo),Q8e.init(t,e)}),ito=ft("$ZodCheckIncludes",(t,e)=>{Sh.init(t,e);let r=coe(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),oto=ft("$ZodCheckStartsWith",(t,e)=>{Sh.init(t,e);let r=new RegExp(`^${coe(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),sto=ft("$ZodCheckEndsWith",(t,e)=>{Sh.init(t,e);let r=new RegExp(`.*${coe(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});a(MKi,"KM");ato=ft("$ZodCheckProperty",(t,e)=>{Sh.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>MKi(o,r,e.property));MKi(n,r,e.property)}}),cto=ft("$ZodCheckMimeType",(t,e)=>{Sh.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t})}}),lto=ft("$ZodCheckOverwrite",(t,e)=>{Sh.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}}),Qxt=class{static{a(this,"tX")}constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(` +`);this.baseURL=s.baseURL,this._baseURLIsExplicit=o.__baseURLIsExplicit??!!e,this.timeout=s.timeout??q9r.DEFAULT_TIMEOUT,this.logger=s.logger??console;let c="warn";this.logLevel=c,this.logLevel=$Ji(s.logLevel,"ClientOptions.logLevel",this)??$Ji(ru("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??c,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??ljc(),En(this,fxt,djc,"f");let l=ru("ANTHROPIC_CUSTOM_HEADERS");if(l){let d={};for(let f of l.split(` +`)){let h=f.indexOf(":");h>=0&&(d[f.substring(0,h).trim()]=f.substring(h+1).trim())}s.defaultHeaders={...d,...s.defaultHeaders}}let u=o.__auth;if(delete s.__auth,delete s.__baseURLIsExplicit,this._options=s,this.apiKey=typeof r=="string"?r:null,this.authToken=n,u)this._authState=u,!this._baseURLIsExplicit&&u.baseURL&&(this.baseURL=u.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let d=s.credentials??null;if(d)this._authState.provider=d,this._authState.tokenCache=this._makeTokenCache(d);else if(s.config!=null){let f=Peo(s.config,this._credentialResolverOptions());this._authState.provider=f.provider,this._authState.tokenCache=this._makeTokenCache(f.provider),this._authState.extraHeaders=f.extraHeaders,this._applyCredentialBaseURL(f.baseURL)}else s.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(s.profile):this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let r=e.replace(/\/+$/,"");this._authState.baseURL=r,!this._baseURLIsExplicit&&(this.baseURL=r)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this.fetch,userAgent:this.getUserAgent(),onCacheWriteError:a(e=>{cA(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{cA(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new d6r(e,r=>{cA(this).debug("advisory token refresh failed; serving cached token",r)})}withOptions(e){let r="credentials"in e||"config"in e||"profile"in e,n="apiKey"in e||"authToken"in e||r,o={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,credentials:this.credentials,...r?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:n?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(o)}async _resolveDefaultCredentials(e){try{let r=await Rjc(this._credentialResolverOptions(),e);if(r)this._authState.provider=r.provider,this._authState.tokenCache=this._makeTokenCache(r.provider),this._authState.extraHeaders=r.extraHeaders,this._applyCredentialBaseURL(r.baseURL);else if(e!=null)throw new wi(`Profile "${e}" could not be resolved (no /configs/${e}.json found).`)}catch(r){this._authState.error=r}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:r}){if(!(e.get("x-api-key")||e.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&e.get("x-api-key"))&&!r.has("x-api-key")&&!(this.authToken&&e.get("authorization"))&&!r.has("authorization"))throw Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(e){let r=this._requestAuthFlags.get(e);return r||(r={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,r)),r}async authHeaders(e){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let r=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,mr([{Authorization:`Bearer ${r}`}])}return mr([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return mr([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return mr([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return fjc(e)}getUserAgent(){return`${this.constructor.name}/JS ${mW}`}defaultIdempotencyKey(){return`stainless-node-retry-${Eeo()}`}makeStatusError(e,r,n,o){return eC.generate(e,r,n,o)}buildURL(e,r,n){let o=!gt(this,E6r,"m",Weo).call(this)&&n||this.baseURL,s=tjc(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!BJi(c)||!BJi(l))&&(r={...l,...c,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(s.search=this.stringifyQuery(r)),s.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new wi("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 6e5}async prepareOptions(e){}async prepareRequest(e,{url:r,options:n}){if(this._authState.tokenCache&&this.apiKey==null){let o=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[s,c]of Object.entries(this._authState.extraHeaders))o.has(s)||o.set(s,c);o.get("anthropic-beta")?.split(",").map(s=>s.trim())?.includes(Txt)||o.append("anthropic-beta",Txt),e.headers=o}}get(e,r){return this.methodRequest("get",e,r)}post(e,r){return this.methodRequest("post",e,r)}patch(e,r){return this.methodRequest("patch",e,r)}put(e,r){return this.methodRequest("put",e,r)}delete(e,r){return this.methodRequest("delete",e,r)}methodRequest(e,r,n){return this.request(Promise.resolve(n).then(o=>({method:e,path:r,...o})))}request(e,r=null){return new xxt(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){let o=await e,s=o.maxRetries??this.maxRetries;r==null&&(r=s,this._requestAuthFlags.delete(o)),await this.prepareOptions(o);let{req:c,url:l,timeout:u}=await this.buildRequest(o,{retryCount:s-r});await this.prepareRequest(c,{url:l,options:o});let d="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),f=n===void 0?"":`, retryOf: ${n}`,h=Date.now();if(cA(this).debug(`[${d}] sending request`,eoe({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new LI;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(c6r),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new LI;let v=R8e(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return cA(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),cA(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,eoe({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw cA(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),cA(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,eoe({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new gxt:new Pve({cause:g})}let y=[...g.headers.entries()].filter(([_])=>_==="request-id").map(([_,v])=>", "+_+": "+JSON.stringify(v)).join(""),E=`[${d}${f}${y}] ${c.method} ${l} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${A-h}ms`;if(!g.ok){let _=await this.shouldRetry(g,o);if(r&&_){let R=`retrying, ${r} attempts remaining`;return await ujc(g.body),cA(this).info(`${E} - ${R}`),cA(this).debug(`[${d}] response error (${R})`,eoe({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),this.retryRequest(o,r,n??d,g.headers)}let v=_?"error; no more retries left":"error; not retryable";cA(this).info(`${E} - ${v}`);let b=await g.text().catch(R=>c6r(R).message),T=_eo(b),w=T?void 0:b;throw cA(this).debug(`[${d}] response error (${v})`,eoe({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,message:w,durationMs:Date.now()-h})),this.makeStatusError(g.status,T,w,g.headers)}return cA(this).info(E),cA(this).debug(`[${d}] response start`,eoe({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),{response:g,options:o,controller:m,requestLogID:d,retryOfRequestLogID:n,startTime:h}}getAPIList(e,r,n){return this.requestAPIList(r,n&&"then"in n?n.then(o=>({method:"get",path:e,...o})):{method:"get",path:e,...n})}requestAPIList(e,r){let n=this.makeRequest(r,null,void 0);return new p6r(this,n,e)}async fetchWithTimeout(e,r,n,o){let{signal:s,method:c,...l}=r||{},u=this._makeAbort(o);s&&s.addEventListener("abort",u,{once:!0});let d=setTimeout(u,n),f=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,h={signal:o.signal,...f?{duplex:"half"}:{},method:"GET",...l};c&&(h.method=c.toUpperCase());try{return await this.fetch.call(void 0,e,h)}finally{clearTimeout(d)}}async shouldRetry(e,r){let n=this._authFlags(r);if(e.status===401&&this._authState.tokenCache&&n.usedTokenCache&&!n.didRefreshFor401)return n.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let o=e.headers.get("x-should-retry");return o==="true"?!0:o==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,r,n,o){let s,c=o?.get("retry-after-ms");if(c){let u=parseFloat(c);Number.isNaN(u)||(s=u)}let l=o?.get("retry-after");if(l&&!s){let u=parseFloat(l);Number.isNaN(u)?s=Date.parse(l)-Date.now():s=u*1e3}if(s===void 0){let u=e.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(r,u)}return await ijc(s),this.makeRequest(e,r-1,n)}calculateDefaultRetryTimeoutMillis(e,r){let n=r-e,o=Math.min(.5*Math.pow(2,n),8),s=1-Math.random()*.25;return o*s*1e3}calculateNonstreamingTimeout(e,r){if(36e5*e/128e3>6e5||r!=null&&e>r)throw new wi("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(e,{retryCount:r=0}={}){let n={...e},{method:o,path:s,query:c,defaultBaseURL:l}=n;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let u=this.buildURL(s,c,l);"timeout"in n&&njc("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:d,body:f}=this.buildBody({options:n}),h=await this.buildHeaders({options:e,method:o,bodyHeaders:d,retryCount:r});return{req:{method:o,headers:h,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&f instanceof globalThis.ReadableStream&&{duplex:"half"},...f&&{body:f},...this.fetchOptions??{},...n.fetchOptions??{}},url:u,timeout:n.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:n,retryCount:o}){let s={};this.idempotencyHeader&&r!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);let c=mr([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...O9r(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(c),c.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:r}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=mr([r]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:Ceo(e)}:typeof e=="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:gt(this,fxt,"f").call(this,{body:e,headers:n})}};q9r=Bp,fxt=new WeakMap,E6r=new WeakSet,Weo=a(function(){return this.baseURL!=="https://api.anthropic.com"},"Sw");Bp.Anthropic=q9r;Bp.HUMAN_PROMPT=iHc;Bp.AI_PROMPT=oHc;Bp.DEFAULT_TIMEOUT=6e5;Bp.AnthropicError=wi;Bp.APIError=eC;Bp.APIConnectionError=Pve;Bp.APIConnectionTimeoutError=gxt;Bp.APIUserAbortError=LI;Bp.NotFoundError=_xt;Bp.ConflictError=vxt;Bp.RateLimitError=bxt;Bp.BadRequestError=Axt;Bp.AuthenticationError=yxt;Bp.InternalServerError=Sxt;Bp.PermissionDeniedError=Ext;Bp.UnprocessableEntityError=Cxt;Bp.toFile=Hjc;Mve=class extends Bp{static{a(this,"K0")}constructor(){super(...arguments),this.completions=new Gxt(this),this.messages=new N8e(this),this.models=new Vxt(this),this.beta=new O1(this)}};Mve.Completions=Gxt;Mve.Messages=N8e;Mve.Models=Vxt;Mve.Beta=O1;a(o6e,"j4");a(pxt,"N8");a(BI,"o$");a(s6e,"D1");a(zeo,"JU");a(sHc,"Tw");aHc=new Set(["EXDEV","EPERM","EEXIST","EBUSY"]),cHc=new Set(["ENOSPC","EIO","EDQUOT","EFBIG"]);a(lHc,"xw");v6r=class{static{a(this,"gw")}read(e){return(0,lA.readFile)(e,"utf8")}readBytes(e){return(0,lA.readFile)(e)}write(e,r,n){return(0,lA.writeFile)(e,r,{encoding:"utf8",mode:n})}async mkdir(e){try{await(0,lA.mkdir)(e,{recursive:!0})}catch(r){if(BI(r)!=="EEXIST")throw r}}atomicWrite(e,r,n){return lHc(e,r,n)}delete(e){return(0,lA.unlink)(e)}list(e){return(0,lA.readdir)(e)}append(e,r,n){return(0,lA.appendFile)(e,r,{encoding:"utf8",mode:n})}writeExclusive(e,r){return(0,lA.writeFile)(e,r,{encoding:"utf8",flag:"wx"})}writeBytes(e,r){return(0,lA.writeFile)(e,r)}async stat(e){return{mtimeMs:(await(0,lA.stat)(e)).mtimeMs}}async listEntries(e){return(await(0,lA.readdir)(e,{withFileTypes:!0})).map(r=>({name:r.name,isDirectory:r.isDirectory(),isFile:r.isFile()}))}},uHc=new Keo.AsyncLocalStorage;a(Wxt,"w8");gve=null;a(Zeo,"uw");a(dHc,"mw");a(Ck,"L6");a(fHc,"dv");pHc=fHc;a(hHc,"iv");mHc=hHc;a(gHc,"nv");AHc=gHc;a(yHc,"rv");EHc=yHc,_Hc=200;a(vHc,"tv");CHc=vHc;a(oCe,"D8");oCe.prototype.clear=pHc;oCe.prototype.delete=mHc;oCe.prototype.get=AHc;oCe.prototype.has=EHc;oCe.prototype.set=CHc;bHc=oCe,SHc=(function(){try{var t=D9r(Object,"defineProperty");return t({},"",{}),t}catch{}})(),zxt=SHc;a(THc,"sv");j9r=THc,IHc=Object.prototype,xHc=IHc.hasOwnProperty;a(wHc,"QC");Xeo=wHc;a(RHc,"JC");kHc=RHc;a(PHc,"XC");DHc=PHc;a(NHc,"YC");sCe=NHc,MHc="[object Arguments]";a(OHc,"GC");dZi=OHc,eto=Object.prototype,LHc=eto.hasOwnProperty,BHc=eto.propertyIsEnumerable,FHc=dZi((function(){return arguments})())?dZi:function(t){return sCe(t)&&LHc.call(t,"callee")&&!BHc.call(t,"callee")},M8e=FHc,UHc=Array.isArray,vW=UHc,A8e={};ZL(A8e,{default:a(()=>H9r,"default")});a(QHc,"VC");qHc=QHc,tto=typeof A8e=="object"&&A8e&&!A8e.nodeType&&A8e,fZi=tto&&typeof o5=="object"&&o5&&!o5.nodeType&&o5,jHc=fZi&&fZi.exports===tto,pZi=jHc?eCe.Buffer:void 0,HHc=pZi?pZi.isBuffer:void 0,GHc=HHc||qHc,H9r=GHc,$Hc=9007199254740991,VHc=/^(?:0|[1-9]\d*)$/;a(WHc,"DC");Wwt=WHc,zHc=9007199254740991;a(YHc,"ZC");G9r=YHc,KHc="[object Arguments]",JHc="[object Array]",ZHc="[object Boolean]",XHc="[object Date]",eGc="[object Error]",tGc="[object Function]",rGc="[object Map]",nGc="[object Number]",iGc="[object Object]",oGc="[object RegExp]",sGc="[object Set]",aGc="[object String]",cGc="[object WeakMap]",lGc="[object ArrayBuffer]",uGc="[object DataView]",dGc="[object Float32Array]",fGc="[object Float64Array]",pGc="[object Int8Array]",hGc="[object Int16Array]",mGc="[object Int32Array]",gGc="[object Uint8Array]",AGc="[object Uint8ClampedArray]",yGc="[object Uint16Array]",EGc="[object Uint32Array]",xd={};xd[dGc]=xd[fGc]=xd[pGc]=xd[hGc]=xd[mGc]=xd[gGc]=xd[AGc]=xd[yGc]=xd[EGc]=!0;xd[KHc]=xd[JHc]=xd[lGc]=xd[ZHc]=xd[uGc]=xd[XHc]=xd[eGc]=xd[tGc]=xd[rGc]=xd[nGc]=xd[iGc]=xd[oGc]=xd[sGc]=xd[aGc]=xd[cGc]=!1;a(_Gc,"pC");vGc=_Gc;a(CGc,"dC");bGc=CGc,y8e={};ZL(y8e,{default:a(()=>C6r,"default")});rto=typeof y8e=="object"&&y8e&&!y8e.nodeType&&y8e,T8e=rto&&typeof a5=="object"&&a5&&!a5.nodeType&&a5,SGc=T8e&&T8e.exports===rto,F8r=SGc&&heo.process,TGc=(function(){try{var t=T8e&&T8e.require&&T8e.require("util").types;return t||F8r&&F8r.binding&&F8r.binding("util")}catch{}})(),C6r=TGc,hZi=C6r&&C6r.isTypedArray,IGc=hZi?bGc(hZi):vGc,nto=IGc,xGc=Object.prototype,wGc=xGc.hasOwnProperty;a(RGc,"aC");kGc=RGc,PGc=Object.prototype;a(DGc,"eC");ito=DGc;a(NGc,"$T");MGc=NGc;a(OGc,"QT");$9r=OGc;a(LGc,"JT");BGc=LGc,FGc=Object.prototype,UGc=FGc.hasOwnProperty;a(QGc,"WT");qGc=QGc;a(jGc,"GT");oto=jGc,E8e={};ZL(E8e,{default:a(()=>ato,"default")});sto=typeof E8e=="object"&&E8e&&!E8e.nodeType&&E8e,mZi=sto&&typeof XX=="object"&&XX&&!XX.nodeType&&XX,HGc=mZi&&mZi.exports===sto,gZi=HGc?eCe.Buffer:void 0,AZi=gZi?gZi.allocUnsafe:void 0;a(GGc,"HT");ato=GGc;a($Gc,"KT");VGc=$Gc;a(WGc,"qT");zGc=WGc,YGc=MGc(Object.getPrototypeOf,Object),cto=YGc,KGc=eCe.Uint8Array,yZi=KGc;a(JGc,"zT");ZGc=JGc;a(XGc,"NT");e$c=XGc,EZi=Object.create,t$c=(function(){function t(){}return a(t,"$"),function(e){if(!sU(e))return{};if(EZi)return EZi(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),r$c=t$c;a(n$c,"OT");i$c=n$c,o$c="[object Symbol]";a(s$c,"FT");V9r=s$c,a$c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c$c=/^\w*$/;a(l$c,"LT");u$c=l$c,d$c=500;a(f$c,"AT");p$c=f$c,h$c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,m$c=/\\(\\)?/g,g$c=p$c(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(h$c,function(r,n,o,s){e.push(o?s.replace(m$c,"$1"):n||r)}),e}),A$c=g$c;a(y$c,"ET");E$c=y$c,_$c=1/0,_Zi=_W?_W.prototype:void 0,vZi=_Zi?_Zi.toString:void 0;a(lto,"PO");v$c=lto;a(C$c,"_T");b$c=C$c;a(S$c,"kT");zwt=S$c,T$c=1/0;a(I$c,"vT");W9r=I$c;a(x$c,"CT");w$c=x$c;a(R$c,"TT");k$c=R$c;a(P$c,"xT");D$c=P$c;a(N$c,"yT");M$c=N$c;a(O$c,"fT");uto=O$c,z9r=null;a(L$c,"CO");a(B$c,"TO");Kxt=new Map;a(F$c,"xO");a(U$c,"yO");Y9r=new Map;a(q$c,"fO");a(j$c,"gO");a(K9r,"V0");a(G$c,"hO");a($$c,"uO");V$c={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};a(W$c,"lT");z$c=W$c(),Y$c=a(()=>{},"pT");a(fto,"VU");K$c=n6e(),Ttm=K$c.subscribe,J$c=n6e(),Itm=J$c.subscribe,Z$c=n6e(),xtm=Z$c.subscribe,X$c=n6e(),wtm=X$c.subscribe,eVc=n6e(),Rtm=eVc.subscribe;a(tVc,"lO");a(rVc,"tT");S6r=class{static{a(this,"cO")}#e=new Set;register(e){let r=rVc(e);this.#e.add(r);let n=a(()=>{this.#e.delete(r)},"J");return Object.assign(n,{[Symbol.dispose]:n})}async drain(){let e=Array.from(this.#e);this.#e.clear(),await Promise.all(e.map(async r=>r()))}async[Symbol.asyncDispose](){await this.drain()}get sizeForTesting(){return this.#e.size}},nVc=new S6r;a(iVc,"pO");oVc=Oy(t=>{if(!t||t.trim()==="")return null;let e=t.split(",").map(s=>s.trim()).filter(Boolean);if(e.length===0)return null;let r=e.some(s=>s.startsWith("!")),n=e.some(s=>!s.startsWith("!"));if(r&&n)return null;let o=e.map(s=>s.replace(/^!/,"").toLowerCase());return{include:r?[]:o,exclude:r?o:[],isExclusive:r}});a(sVc,"sT");a(aVc,"eT");a(cVc,"iO");a(lVc,"tO");a(uVc,"Qx");a(CZi,"oO");a(dVc,"aO");a(hto,"HX");fVc={cwd(){return process.cwd()},existsSync(t){let e=[];try{let o=sf(e,cf`fs.existsSync(${t})`,0);return vo.existsSync(t)}catch(o){var r=o,n=1}finally{af(e,r,n)}},async stat(t){return(0,V0.stat)(t)},async readdir(t){return(0,V0.readdir)(t,{withFileTypes:!0})},async unlink(t){return(0,V0.unlink)(t)},async rmdir(t){return(0,V0.rmdir)(t)},async rm(t,e){return(0,V0.rm)(t,e)},async mkdir(t,e){try{await(0,V0.mkdir)(t,{recursive:!0,...e})}catch(r){if(BI(r)!=="EEXIST")throw r}},async readFile(t,e){return(0,V0.readFile)(t,{encoding:e.encoding})},async rename(t,e){return(0,V0.rename)(t,e)},statSync(t){let e=[];try{let o=sf(e,cf`fs.statSync(${t})`,0);return vo.statSync(t)}catch(o){var r=o,n=1}finally{af(e,r,n)}},lstatSync(t){let e=[];try{let o=sf(e,cf`fs.lstatSync(${t})`,0);return vo.lstatSync(t)}catch(o){var r=o,n=1}finally{af(e,r,n)}},readFileSync(t,e){let r=[];try{let s=sf(r,cf`fs.readFileSync(${t})`,0);return vo.readFileSync(t,{encoding:e.encoding})}catch(s){var n=s,o=1}finally{af(r,n,o)}},readFileBytesSync(t){let e=[];try{let o=sf(e,cf`fs.readFileBytesSync(${t})`,0);return vo.readFileSync(t)}catch(o){var r=o,n=1}finally{af(e,r,n)}},readSync(t,e){let r=[];try{let s=sf(r,cf`fs.readSync(${t}, ${e.length} bytes)`,0),c;try{c=vo.openSync(t,"r");let l=Buffer.alloc(e.length),u=vo.readSync(c,l,0,e.length,0);return{buffer:l,bytesRead:u}}finally{c&&vo.closeSync(c)}}catch(s){var n=s,o=1}finally{af(r,n,o)}},appendFileSync(t,e,r){let n=[];try{let c=sf(n,cf`fs.appendFileSync(${t}, ${e.length} chars)`,0);if(r?.mode!==void 0)try{let l=vo.openSync(t,"ax",r.mode);try{vo.appendFileSync(l,e)}finally{vo.closeSync(l)}return}catch(l){if(BI(l)!=="EEXIST")throw l}vo.appendFileSync(t,e)}catch(c){var o=c,s=1}finally{af(n,o,s)}},copyFileSync(t,e){let r=[];try{let s=sf(r,cf`fs.copyFileSync(${t} → ${e})`,0);vo.copyFileSync(t,e)}catch(s){var n=s,o=1}finally{af(r,n,o)}},unlinkSync(t){let e=[];try{let o=sf(e,cf`fs.unlinkSync(${t})`,0);vo.unlinkSync(t)}catch(o){var r=o,n=1}finally{af(e,r,n)}},renameSync(t,e){let r=[];try{let s=sf(r,cf`fs.renameSync(${t} → ${e})`,0);vo.renameSync(t,e)}catch(s){var n=s,o=1}finally{af(r,n,o)}},linkSync(t,e){let r=[];try{let s=sf(r,cf`fs.linkSync(${t} → ${e})`,0);vo.linkSync(t,e)}catch(s){var n=s,o=1}finally{af(r,n,o)}},symlinkSync(t,e,r){let n=[];try{let c=sf(n,cf`fs.symlinkSync(${t} → ${e})`,0);vo.symlinkSync(t,e,r)}catch(c){var o=c,s=1}finally{af(n,o,s)}},readlinkSync(t){let e=[];try{let o=sf(e,cf`fs.readlinkSync(${t})`,0);return vo.readlinkSync(t)}catch(o){var r=o,n=1}finally{af(e,r,n)}},realpathSync(t){let e=[];try{let o=sf(e,cf`fs.realpathSync(${t})`,0);return vo.realpathSync(t).normalize("NFC")}catch(o){var r=o,n=1}finally{af(e,r,n)}},mkdirSync(t,e){let r=[];try{let s=sf(r,cf`fs.mkdirSync(${t})`,0),c={recursive:!0};e?.mode!==void 0&&(c.mode=e.mode);try{vo.mkdirSync(t,c)}catch(l){if(BI(l)!=="EEXIST")throw l}}catch(s){var n=s,o=1}finally{af(r,n,o)}},readdirSync(t){let e=[];try{let o=sf(e,cf`fs.readdirSync(${t})`,0);return vo.readdirSync(t,{withFileTypes:!0})}catch(o){var r=o,n=1}finally{af(e,r,n)}},readdirStringSync(t){let e=[];try{let o=sf(e,cf`fs.readdirStringSync(${t})`,0);return vo.readdirSync(t)}catch(o){var r=o,n=1}finally{af(e,r,n)}},isDirEmptySync(t){let e=[];try{let o=sf(e,cf`fs.isDirEmptySync(${t})`,0);return this.readdirSync(t).length===0}catch(o){var r=o,n=1}finally{af(e,r,n)}},rmdirSync(t){let e=[];try{let o=sf(e,cf`fs.rmdirSync(${t})`,0);vo.rmdirSync(t)}catch(o){var r=o,n=1}finally{af(e,r,n)}},rmSync(t,e){let r=[];try{let s=sf(r,cf`fs.rmSync(${t})`,0);vo.rmSync(t,e)}catch(s){var n=s,o=1}finally{af(r,n,o)}},createWriteStream(t){return vo.createWriteStream(t)},async readFileBytes(t,e){if(e===void 0)return(0,V0.readFile)(t);let r=await(0,V0.open)(t,"r");try{let{size:n}=await r.stat(),o=Math.min(n,e),s=Buffer.allocUnsafe(o),c=0;for(;c=:(,)])([a-zA-Z0-9_~.]{3}\\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'"\\x60\\s<),])`,confidence:"high"},{id:"digitalocean-pat",source:`\\b(dop_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"digitalocean-access-token",source:`\\b(doo_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-api-key",source:`\\b(${_Vc}03-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-admin-api-key",source:`\\b(sk-ant-admin01-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"openai-api-key",source:`\\b(sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})\\b|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"huggingface-access-token",source:`\\b(hf_[a-zA-Z]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"github-pat",source:"ghp_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-fine-grained-pat",source:"github_pat_\\w{82}",confidence:"high"},{id:"github-app-token",source:"(?:ghu|ghs)_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-oauth",source:"gho_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-refresh-token",source:"ghr_[0-9a-zA-Z]{36}",confidence:"high"},{id:"gitlab-pat",source:"glpat-[\\w-]{20}",confidence:"high"},{id:"gitlab-deploy-token",source:"gldt-[0-9a-zA-Z_\\-]{20}",confidence:"high"},{id:"slack-bot-token",source:"xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*",confidence:"high"},{id:"slack-user-token",source:"xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}",confidence:"high"},{id:"slack-app-token",source:"xapp-\\d-[A-Z0-9]+-\\d+-[a-z0-9]+",flags:"i",confidence:"high"},{id:"twilio-api-key",source:"SK[0-9a-fA-F]{32}",confidence:"high"},{id:"sendgrid-api-token",source:`\\b(SG\\.[a-zA-Z0-9=_\\-.]{66})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"npm-access-token",source:`\\b(npm_[a-zA-Z0-9]{36})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"pypi-upload-token",source:"pypi-AgEIcHlwaS5vcmc[\\w-]{50,1000}",confidence:"high"},{id:"databricks-api-token",source:`\\b(dapi[a-f0-9]{32}(?:-\\d)?)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"hashicorp-tf-api-token",source:"[a-zA-Z0-9]{14}\\.atlasv1\\.[a-zA-Z0-9\\-_=]{60,70}",confidence:"high"},{id:"pulumi-api-token",source:`\\b(pul-[a-f0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"postman-api-token",source:`\\b(PMAK-[a-fA-F0-9]{24}-[a-fA-F0-9]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-api-key",source:`\\b(eyJrIjoi[A-Za-z0-9+/]{70,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-cloud-api-token",source:`\\b(glc_[A-Za-z0-9+/]{32,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-service-account-token",source:`\\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-user-token",source:`\\b(sntryu_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-org-token",source:"\\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}",confidence:"high"},{id:"stripe-access-token",source:`\\b((?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"shopify-access-token",source:"shpat_[a-fA-F0-9]{32}",confidence:"high"},{id:"shopify-shared-secret",source:"shpss_[a-fA-F0-9]{32}",confidence:"high"},{id:"private-key",source:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\\s\\S-]{64,}?-----END[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----",flags:"i",confidence:"high"}],TZi=null;a(CVc,"Ox");a(bVc,"W2");T6r={verbose:0,debug:1,info:2,warn:3,error:4},SVc=Oy(()=>{let t=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return t&&Object.hasOwn(T6r,t)?t:"debug"}),TVc=!1;a(Ywt,"qX");I6r=Oy(()=>{let t=Ywt();return TVc||d_(process.env.DEBUG)||d_(process.env.DEBUG_SDK)||t.includes("--debug")||t.includes("-d")||mto()||t.some(e=>e.startsWith("--debug="))||gto()!==null}),IVc=Oy(()=>{let t=Ywt().find(r=>r.startsWith("--debug="));if(!t)return null;let e=t.substring(8);return oVc(e)}),mto=Oy(()=>{let t=Ywt();return t.includes("--debug-to-stderr")||t.includes("-d2e")}),gto=Oy(()=>{let t=Ywt();for(let e=0;e{try{let t=Eto(),e=(0,goe.dirname)(t),r=(0,goe.join)(e,"latest");await(0,h_.unlink)(r).catch(()=>{}),await(0,h_.symlink)(t,r)}catch{}}),Dtm=(()=>{let t=process.env.CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS;if(t!==void 0){let e=Number(t);if(!Number.isNaN(e)&&e>=0)return e}return 1/0})(),DVc={[Symbol.dispose](){}};a(NVc,"_x");cf=NVc;a($m,"B$");ZN=a((t,e)=>{let r=[];try{let s=sf(r,cf`JSON.parse(${t})`,0);return typeof e>"u"?JSON.parse(t):JSON.parse(t,e)}catch(s){var n=s,o=1}finally{af(r,n,o)}},"d$");a(MVc,"w2");a(CW,"A4");a(OVc,"kx");a(LVc,"O2");BVc=2e3,Jxt=new Set,IZi=!1;a(FVc,"xx");a(UVc,"yx");R6r=class{static{a(this,"jU")}options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];abortHandler;forwardedAbort=s6r();pendingWrites=[];pendingEndInput=!1;spawnResolve;spawnReject;spawnPromise;constructor(e){this.options=e,this.abortController=e.abortController||s6r(),e.deferSpawn?(this.spawnPromise=new Promise((r,n)=>{this.spawnResolve=r,this.spawnReject=n}),this.spawnPromise.catch(()=>{})):this.initialize()}spawn(){try{this.initialize()}catch(r){throw this.spawnAbort(o6e(r)),r}let e=this.pendingWrites;this.pendingWrites=[],this.spawnResolve&&(this.spawnResolve(),this.spawnResolve=void 0,this.spawnReject=void 0);for(let r of e)this.write(r);this.pendingEndInput&&(this.pendingEndInput=!1,this.processStdin?.end())}spawnAbort(e){this.spawnReject&&(this.spawnReject(e),this.spawnReject=void 0,this.spawnResolve=void 0,this.pendingWrites=[])}updateEnv(e){this.options.env?Object.assign(this.options.env,e):this.options.env={...e}}updateResume(e){this.options.resume=e}getDefaultExecutable(){return peo()?"bun":"node"}spawnLocalProcess(e){let{command:r,args:n,cwd:o,env:s,signal:c}=e,l=d_(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr?"pipe":"ignore",u=(0,leo.spawn)(r,n,{cwd:o,stdio:["pipe","pipe",l],signal:c,env:s,windowsHide:!0});return(d_(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr)&&u.stderr.on("data",d=>{let f=d.toString();Ck(f),this.options.stderr&&this.options.stderr(f)}),{stdin:u.stdin,stdout:u.stdout,get killed(){return u.killed},get exitCode(){return u.exitCode},kill:u.kill.bind(u),on:u.on.bind(u),once:u.once.bind(u),off:u.off.bind(u)}}initialize(){try{let{additionalDirectories:e=[],agent:r,betas:n,cwd:o,executable:s=this.getDefaultExecutable(),executableArgs:c=[],extraArgs:l={},pathToClaudeCodeExecutable:u,env:d={...process.env},thinkingConfig:f,maxTurns:h,maxBudgetUsd:m,taskBudget:g,model:A,fallbackModel:y,jsonSchema:E,permissionMode:_,allowDangerouslySkipPermissions:v,permissionPromptToolName:b,continueConversation:T,resume:w,settingSources:R,skills:x,disallowedTools:P=[],tools:D,mcpServers:N,strictMcpConfig:L,canUseTool:B,includePartialMessages:j,plugins:M,sandbox:O}=this.options,{allowedTools:U=[]}=this.options;if(x!==void 0){let H=x==="all"?["Skill"]:x.map(le=>`Skill(${le})`),te=new Set(U);U=[...U,...H.filter(le=>!te.has(le))]}let q=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(f){switch(f.type){case"enabled":f.budgetTokens===void 0?q.push("--thinking","adaptive"):q.push("--max-thinking-tokens",f.budgetTokens.toString());break;case"disabled":q.push("--thinking","disabled");break;case"adaptive":q.push("--thinking","adaptive");break}f.type!=="disabled"&&f.display&&q.push("--thinking-display",f.display)}if(this.options.effort&&q.push("--effort",this.options.effort),h&&q.push("--max-turns",h.toString()),m!==void 0&&q.push("--max-budget-usd",m.toString()),g&&q.push("--task-budget",g.total.toString()),A&&q.push("--model",A),r&&q.push("--agent",r),n&&n.length>0&&q.push("--betas",n.join(",")),E&&q.push("--json-schema",$m(E)),this.options.debugFile?q.push("--debug-file",this.options.debugFile):this.options.debug&&q.push("--debug"),!this.options.debugFile&&!this.options.spawnClaudeCodeProcess){let H=dHc();H&&q.push("--debug-file",H)}if(B){if(b)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");q.push("--permission-prompt-tool","stdio")}else b&&q.push("--permission-prompt-tool",b);if(T&&q.push("--continue"),w&&q.push("--resume",w),this.options.assistant&&q.push("--assistant"),this.options.channels&&this.options.channels.length>0&&q.push("--channels",...this.options.channels),U.length>0&&q.push("--allowedTools",U.join(",")),P.length>0&&q.push("--disallowedTools",P.join(",")),D!==void 0&&(Array.isArray(D)?D.length===0?q.push("--tools",""):q.push("--tools",D.join(",")):q.push("--tools","default")),N&&Object.keys(N).length>0&&q.push("--mcp-config",$m({mcpServers:N})),R!==void 0&&q.push(`--setting-sources=${R.join(",")}`),L&&q.push("--strict-mcp-config"),_&&q.push("--permission-mode",_),v&&q.push("--allow-dangerously-skip-permissions"),y){if(A&&y===A)throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");q.push("--fallback-model",y)}this.options.includeHookEvents&&q.push("--include-hook-events"),j&&q.push("--include-partial-messages"),this.options.sessionMirror&&q.push("--session-mirror");for(let H of e)q.push("--add-dir",H);if(M&&M.length>0)for(let H of M)if(H.type==="local")q.push("--plugin-dir",H.path);else throw Error(`Unsupported plugin type: ${H.type}`);this.options.forkSession&&q.push("--fork-session"),this.options.resumeSessionAt&&q.push("--resume-session-at",this.options.resumeSessionAt),this.options.sessionId&&q.push("--session-id",this.options.sessionId),this.options.persistSession===!1&&q.push("--no-session-persistence"),this.options.managedSettings&&q.push("--managed-settings",this.options.managedSettings);let Q={...l??{}};this.options.settings&&(Q.settings=this.options.settings);let Y=LVc(Q,O);for(let[H,te]of Object.entries(Y))te===null?q.push(`--${H}`):q.push(`--${H}`,te);d.CLAUDE_CODE_ENTRYPOINT||(d.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),delete d.NODE_OPTIONS,d_(d.DEBUG_CLAUDE_AGENT_SDK)?d.DEBUG="1":delete d.DEBUG;let W=QVc(u),V=W?u:s,z=W?[...c,...q]:[...c,u,...q],ie={command:V,args:z,cwd:o,env:d,signal:this.forwardedAbort.signal};this.options.spawnClaudeCodeProcess?(Ck(`Spawning Claude Code (custom): ${V} ${z.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(ie)):(Ck(`Spawning Claude Code: ${V} ${z.join(" ")}`),this.process=this.spawnLocalProcess(ie)),this.processStdin=this.process.stdin,this.processStdout=this.process.stdout,UVc(this.process),this.abortHandler=()=>this.close(),this.abortController.signal.addEventListener("abort",this.abortHandler),this.abortController.signal.aborted&&this.close(),this.process.on("error",H=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new M1("Claude Code process aborted by user");else if(sHc(H)){let te=qVc(u,W);this.exitError=ReferenceError(te),Ck(this.exitError.message)}else this.exitError=Error(`Failed to spawn Claude Code process: ${H.message}`),Ck(this.exitError.message)}),this.process.on("exit",(H,te)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new M1("Claude Code process aborted by user");else{let le=this.getProcessExitError(H,te);le&&(this.exitError=le,Ck(le.message))}}),this.ready=!this.abortController.signal.aborted}catch(e){throw this.ready=!1,e}}getProcessExitError(e,r){if(e!==0&&e!==null)return Error(`Claude Code process exited with code ${e}`);if(r)return Error(`Claude Code process terminated by signal ${r}`)}write(e){if(this.abortController.signal.aborted)throw new M1("Operation aborted");if(this.spawnResolve){this.pendingWrites.push(e);return}if(!this.ready||!this.processStdin)throw Error("ProcessTransport is not ready for writing");if(this.processStdin.writableEnded){Ck("[ProcessTransport] Dropping write to ended stdin stream");return}if(this.process?.killed||this.process?.exitCode!==null)throw Error("Cannot write to terminated process");if(this.exitError)throw Error(`Cannot write to process that exited with error: ${this.exitError.message}`);Ck(`[ProcessTransport] Writing to stdin: ${e.substring(0,100)}`);try{this.processStdin.write(e)||Ck("[ProcessTransport] Write buffer full, data queued")}catch(r){throw this.ready=!1,Error(`Failed to write to process stdin: ${pxt(r)}`)}}[Symbol.dispose](){this.close()}close(){this.spawnAbort(this.abortController.signal.aborted?new M1("Claude Code process aborted by user"):Error("Query closed before spawn")),this.processStdin&&(this.processStdin.end(),this.processStdin=void 0),this.abortHandler&&(this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0);for(let{handler:n}of this.exitListeners)this.process?.off("exit",n);this.exitListeners=[];let e=a(()=>{this.abortController.signal.aborted&&this.forwardedAbort.abort(this.abortController.signal.reason)},"$"),r=this.process;r&&!r.killed&&r.exitCode===null?(setTimeout((n,o)=>{if(n.exitCode!==null){o();return}if(process.platform==="win32"){setTimeout((s,c)=>{s.exitCode===null&&s.kill("SIGKILL"),c()},5e3,n,o).unref();return}n.kill("SIGTERM"),setTimeout(s=>{s.exitCode===null&&s.kill("SIGKILL")},5e3,n).unref(),o()},BVc,r,e).unref(),r.once("exit",()=>Jxt.delete(r))):r&&(Jxt.delete(r),e()),this.ready=!1}isReady(){return this.ready}async*readMessages(){if(this.spawnPromise&&(await this.spawnPromise,this.spawnPromise=void 0),!this.processStdout)throw Error("ProcessTransport output stream not available");if(this.exitError)throw this.exitError;let e=(0,deo.createInterface)({input:this.processStdout}),r=this.process?(()=>{let n=this.process,o=a(()=>e.close(),"Y");return n.on("error",o),()=>n.off("error",o)})():void 0;this.exitError&&e.close();try{for await(let n of e)if(n.trim()){let o;try{o=ZN(n)}catch{Ck(`Non-JSON stdout: ${n}`);continue}yield o}if(this.exitError)throw this.exitError;await this.waitForExit()}catch(n){throw n}finally{r?.(),e.close()}}endInput(){if(this.spawnResolve){this.pendingEndInput=!0;return}this.processStdin&&this.processStdin.end()}getInputStream(){return this.processStdin}onExit(e){if(!this.process)return()=>{};let r=a((n,o)=>{let s=this.getProcessExitError(n,o);e(s)},"Q");return this.process.on("exit",r),this.exitListeners.push({callback:e,handler:r}),()=>{this.process&&this.process.off("exit",r);let n=this.exitListeners.findIndex(o=>o.handler===r);n!==-1&&this.exitListeners.splice(n,1)}}async waitForExit(){if(!this.process){if(this.exitError)throw this.exitError;return}if(this.process.exitCode!==null||this.process.killed||this.exitError){if(this.exitError)throw this.exitError;return}return new Promise((e,r)=>{let n=a((s,c)=>{if(this.abortController.signal.aborted){r(new M1("Operation aborted"));return}let l=this.getProcessExitError(s,c);l?r(l):e()},"J");this.process.once("exit",n);let o=a(s=>{this.process.off("exit",n),r(s)},"Y");this.process.once("error",o),this.process.once("exit",()=>{this.process.off("error",o)})})}};a(QVc,"fx");a(qVc,"gx");Ave="@anthropic-ai/claude-agent-sdk";a(jVc,"ux");a(HVc,"F2");Zxt=class{static{a(this,"hQ")}returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(e){this.returned=e}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){return this.queue.length>0?Promise.resolve({done:!1,value:this.queue.shift()}):this.isDone?Promise.resolve({done:!0,value:void 0}):this.hasError?Promise.reject(this.hasError):new Promise((e,r)=>{this.readResolve=e,this.readReject=r})}enqueue(e){if(this.readResolve){let r=this.readResolve;this.readResolve=void 0,this.readReject=void 0,r({done:!1,value:e})}else this.queue.push(e)}done(){if(this.isDone=!0,this.readResolve){let e=this.readResolve;this.readResolve=void 0,this.readReject=void 0,e({done:!0,value:void 0})}}error(e){if(this.hasError=e,this.readReject){let r=this.readReject;this.readResolve=void 0,this.readReject=void 0,r(e)}}return(){return this.isDone=!0,this.returned&&this.returned(),Promise.resolve({done:!0,value:void 0})}};a(GVc,"mx");$Vc=GVc();a(J9r,"BX");a(Cto,"AU");a(bto,"IU");a(VVc,"Z2");a(X9,"I4");k6r=class{static{a(this,"RU")}sendMcpMessage;isClosed=!1;constructor(e){this.sendMcpMessage=e}onclose;onerror;onmessage;async start(){}async send(e){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(e)}async close(){this.isClosed||(this.isClosed=!0,this.onclose?.())}},P6r=class{static{a(this,"PU")}transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new Zxt;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;sdkMcpServerInstances=new Map;pendingMcpResponses=new Map;firstResultReceivedResolve;firstResultReceived=!1;lastErrorResultText;transcriptMirrorBatcher;cleanupCallbacks=[];cleanupPromise;setIsSingleUserTurn(e){this.isSingleUserTurn=e}setTranscriptMirrorBatcher(e){this.transcriptMirrorBatcher=e}reportMirrorError(e,r){let n={type:"system",subtype:"mirror_error",error:r,key:e,uuid:(0,Yxt.randomUUID)(),session_id:e.sessionId};this.inputStream.enqueue(n)}addCleanupCallback(e){this.cleanupPerformed?e():this.cleanupCallbacks.push(e)}isClosed(){return this.cleanupPerformed}hasBidirectionalNeeds(){return this.sdkMcpTransports.size>0||this.hooks!==void 0&&Object.keys(this.hooks).length>0||this.canUseTool!==void 0||this.onElicitation!==void 0||this.getOAuthToken!==void 0||this.getHostAuthToken!==void 0}constructor(e,r,n,o,s,c=new Map,l,u,d,f,h){this.transport=e,this.isSingleUserTurn=r,this.canUseTool=n,this.hooks=o,this.abortController=s,this.jsonSchema=l,this.initConfig=u,this.onElicitation=d,this.getOAuthToken=f,this.getHostAuthToken=h;for(let[m,g]of c)this.connectSdkMcpServer(m,g);this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(e){this.inputStream.error(e)}async stopTask(e){await this.request({subtype:"stop_task",task_id:e})}async backgroundTasks(e){return(await this.request({subtype:"background_tasks",tool_use_id:e})).response.backgrounded??!0}close(){this.cleanup()}cleanup(e){return this.cleanupPromise?this.cleanupPromise:(this.cleanupPerformed=!0,this.cleanupPromise=this.performCleanup(e),this.cleanupPromise)}async performCleanup(e){for(let r of this.cleanupCallbacks)try{r()}catch{}if(this.cleanupCallbacks=[],this.transcriptMirrorBatcher)try{await this.transcriptMirrorBatcher.flush()}catch{}try{for(let n of this.cancelControllers.values())n.abort();this.cancelControllers.clear(),this.transport.close();let r=e??Error("Query closed before response received");for(let{reject:n}of this.pendingControlResponses.values())n(r);this.pendingControlResponses.clear();for(let{reject:n}of this.pendingMcpResponses.values())n(r);this.pendingMcpResponses.clear(),this.hookCallbacks.clear();for(let n of this.sdkMcpTransports.values())n.close().catch(()=>{});this.sdkMcpTransports.clear(),e?this.inputStream.error(e):this.inputStream.done()}catch{}}next(...[e]){return this.sdkMessages.next(e)}async return(e){return await this.cleanup(),this.sdkMessages.return(e)}async throw(e){return await this.cleanup(),this.sdkMessages.throw(e)}[Symbol.asyncIterator](){return this.sdkMessages}async[Symbol.asyncDispose](){await this.cleanup()}async readMessages(){try{for await(let e of this.transport.readMessages()){if(e.type==="control_response"){let r=this.pendingControlResponses.get(e.response.request_id);r&&r.handler(e.response);continue}else if(e.type==="control_request"){this.handleControlRequest(e);continue}else if(e.type==="control_cancel_request"){this.handleControlCancelRequest(e);continue}else{if(e.type==="keep_alive")continue;if(e.type==="transcript_mirror"){this.transcriptMirrorBatcher?.enqueue(e.filePath,e.entries);continue}}if(e.type==="system"&&(e.subtype==="post_turn_summary"||e.subtype==="task_summary")){this.inputStream.enqueue(e);continue}e.type==="result"?(this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.lastErrorResultText=e.is_error?e.subtype==="success"?e.result:e.errors.join("; "):void 0,this.firstResultReceived=!0,this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.isSingleUserTurn&&(nu("[Query.readMessages] First result received for single-turn query, closing stdin"),this.transport.endInput())):e.type==="system"&&e.subtype==="session_state_changed"||(this.lastErrorResultText=void 0),this.inputStream.enqueue(e)}this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.inputStream.done(),this.cleanup()}catch(e){if(this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.lastErrorResultText!==void 0&&!(e instanceof M1)){let r=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);nu(`[Query.readMessages] Replacing exit error with result text. Original: ${pxt(e)}`),this.inputStream.error(r),this.cleanup(r);return}this.inputStream.error(e),this.cleanup(e)}}async handleControlRequest(e){let r=new AbortController;this.cancelControllers.set(e.request_id,r);try{let n=await this.processControlRequest(e,r.signal);if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"success",request_id:e.request_id,response:n}};await Promise.resolve(this.transport.write($m(o)+` +`))}catch(n){if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:pxt(n)}};try{await Promise.resolve(this.transport.write($m(o)+` +`))}catch(s){nu(`[Query.handleControlRequest] Error-response write failed: ${pxt(s)}`,{level:"error"})}}finally{this.cancelControllers.delete(e.request_id)}}handleControlCancelRequest(e){let r=this.cancelControllers.get(e.request_id);r&&(r.abort(),this.cancelControllers.delete(e.request_id))}async processControlRequest(e,r){if(e.request.subtype==="can_use_tool"){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");return{...await this.canUseTool(e.request.tool_name,e.request.input,{signal:r,suggestions:e.request.permission_suggestions,blockedPath:e.request.blocked_path,decisionReason:e.request.decision_reason,title:e.request.title,displayName:e.request.display_name,description:e.request.description,toolUseID:e.request.tool_use_id,agentID:e.request.agent_id}),toolUseID:e.request.tool_use_id}}else{if(e.request.subtype==="hook_callback")return await this.handleHookCallbacks(e.request.callback_id,e.request.input,e.request.tool_use_id,r);if(e.request.subtype==="mcp_message"){let n=e.request,o=this.sdkMcpTransports.get(n.server_name);if(!o)throw Error(`SDK MCP server not found: ${n.server_name}`);return"method"in n.message&&"id"in n.message&&n.message.id!==null?{mcp_response:await this.handleMcpControlRequest(n.server_name,n,o)}:(o.onmessage&&o.onmessage(n.message),{mcp_response:{jsonrpc:"2.0",result:{},id:0}})}else if(e.request.subtype==="elicitation"){let n=e.request;return this.onElicitation?await this.onElicitation({serverName:n.mcp_server_name,message:n.message,mode:n.mode,url:n.url,elicitationId:n.elicitation_id,requestedSchema:n.requested_schema,title:n.title,displayName:n.display_name,description:n.description},{signal:r}):{action:"decline"}}else if(e.request.subtype==="oauth_token_refresh"){if(!this.getOAuthToken)throw Error("getOAuthToken callback is not provided.");return{accessToken:await this.getOAuthToken({signal:r})??null}}else if(e.request.subtype==="host_auth_token_refresh"){if(!this.getHostAuthToken)throw Error("getHostAuthToken callback is not provided.");return{authToken:await this.getHostAuthToken({signal:r})??null}}}throw Error("Unsupported control request subtype: "+e.request.subtype)}async*readSdkMessages(){try{for await(let e of this.inputStream)yield e}finally{await this.cleanup()}}async initialize(){let e;if(this.hooks){e={};for(let[o,s]of Object.entries(this.hooks))s.length>0&&(e[o]=s.map(c=>{let l=[];for(let u of c.hooks){let d=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(d,u),l.push(d)}return{matcher:c.matcher,hookCallbackIds:l,timeout:c.timeout}}))}let r=this.sdkMcpTransports.size>0?Array.from(this.sdkMcpTransports.keys()):void 0,n={subtype:"initialize",hooks:e,sdkMcpServers:r,jsonSchema:this.jsonSchema,systemPrompt:typeof this.initConfig?.systemPrompt=="string"?[this.initConfig.systemPrompt]:this.initConfig?.systemPrompt,appendSystemPrompt:this.initConfig?.appendSystemPrompt,planModeInstructions:this.initConfig?.planModeInstructions,appendSubagentSystemPrompt:this.initConfig?.appendSubagentSystemPrompt,toolAliases:this.initConfig?.toolAliases,excludeDynamicSections:this.initConfig?.excludeDynamicSections,agents:this.initConfig?.agents,title:this.initConfig?.title,skills:Array.isArray(this.initConfig?.skills)?this.initConfig.skills:void 0,webSearchIsolationExemptMcpServers:this.initConfig?.webSearchIsolationExemptMcpServers,promptSuggestions:this.initConfig?.promptSuggestions,agentProgressSummaries:this.initConfig?.agentProgressSummaries,forwardSubagentText:this.initConfig?.forwardSubagentText};return(await this.request(n)).response}async interrupt(){return X9("sdk_interrupt",async()=>{await this.request({subtype:"interrupt"})})}async setPermissionMode(e){await this.request({subtype:"set_permission_mode",mode:e})}async setModel(e){await this.request({subtype:"set_model",model:e})}async setMaxThinkingTokens(e){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:e})}async applyFlagSettings(e){return X9("sdk_apply_flag_settings",async()=>{await this.request({subtype:"apply_flag_settings",settings:e})})}async getSettings(){return(await this.request({subtype:"get_settings"})).response}async rewindFiles(e,r){return X9("sdk_rewind_files",async()=>(await this.request({subtype:"rewind_files",user_message_id:e,dry_run:r?.dryRun})).response)}async cancelAsyncMessage(e){return(await this.request({subtype:"cancel_async_message",message_uuid:e})).response.cancelled}async seedReadState(e,r){await this.request({subtype:"seed_read_state",path:e,mtime:r})}async enableRemoteControl(e,r){return(await this.request({subtype:"remote_control",enabled:e,...r!==void 0&&{name:r}})).response}async submitFeedback(e,r){return(await this.request({subtype:"submit_feedback",description:e,surface:r?.surface})).response}async generateSessionTitle(e,r){return X9("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:e,persist:r?.persist})).response.title)}async askSideQuestion(e){return X9("sdk_side_question",async()=>{let r=(await this.request({subtype:"side_question",question:e})).response;return r.response===null?null:{response:r.response,synthetic:r.synthetic??!1}})}async launchUltrareview(e,r){return(await this.request({subtype:"ultrareview_launch",args:e,confirm:r?.confirm??!1})).response}async messageRated(e){await this.request({subtype:"message_rated",messageUuid:e.messageUuid,sentiment:e.sentiment,surface:e.surface,cleared:e.cleared??!1})}processPendingPermissionRequests(e){for(let r of e)r.request.subtype==="can_use_tool"&&this.handleControlRequest(r).catch(()=>{})}request(e){let r=Math.random().toString(36).substring(2,15),n={request_id:r,type:"control_request",request:e};return new Promise((o,s)=>{this.pendingControlResponses.set(r,{handler:a(c=>{this.pendingControlResponses.delete(r),c.subtype==="success"?o(c):(s(Error(c.error)),c.pending_permission_requests&&this.processPendingPermissionRequests(c.pending_permission_requests))},"handler"),reject:s}),Promise.resolve(this.transport.write($m(n)+` +`)).catch(c=>{this.pendingControlResponses.delete(r),s(c)})})}initializationResult(){return this.initialization}async supportedCommands(){return(await this.initialization).commands}async supportedModels(){return(await this.initialization).models}async supportedAgents(){return(await this.initialization).agents}async reconnectMcpServer(e){await this.request({subtype:"mcp_reconnect",serverName:e})}async toggleMcpServer(e,r){return X9("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:e,enabled:r})})}async enableChannel(e){return X9("sdk_mcp_enable_channel",async()=>{await this.request({subtype:"channel_enable",serverName:e})})}async mcpAuthenticate(e,r){return(await this.request({subtype:"mcp_authenticate",serverName:e,redirectUri:r})).response}async mcpClearAuth(e){return(await this.request({subtype:"mcp_clear_auth",serverName:e})).response}async mcpSubmitOAuthCallbackUrl(e,r){return(await this.request({subtype:"mcp_oauth_callback_url",serverName:e,callbackUrl:r})).response}async claudeAuthenticate(e){return(await this.request({subtype:"claude_authenticate",loginWithClaudeAi:e})).response}async claudeOAuthCallback(e,r){return(await this.request({subtype:"claude_oauth_callback",authorizationCode:e,state:r})).response}async claudeOAuthWaitForCompletion(){return(await this.request({subtype:"claude_oauth_wait_for_completion"})).response}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async getContextUsage(){return(await this.request({subtype:"get_context_usage"})).response}async readFile(e,r){try{return(await this.request({subtype:"read_file",path:e,max_bytes:r?.maxBytes,encoding:r?.encoding})).response}catch{return null}}async reloadPlugins(){return X9("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins"})).response)}async setMcpServers(e){return X9("sdk_mcp_set_servers",async()=>{let r={},n={};for(let[l,u]of Object.entries(e))u.type==="sdk"&&"instance"in u?r[l]=u.instance:n[l]=u;let o=new Set(this.sdkMcpServerInstances.keys()),s=new Set(Object.keys(r));for(let l of o)s.has(l)||await this.disconnectSdkMcpServer(l);for(let[l,u]of Object.entries(r))o.has(l)||this.connectSdkMcpServer(l,u);let c={};for(let l of Object.keys(r))c[l]={type:"sdk",name:l};return(await this.request({subtype:"mcp_set_servers",servers:{...n,...c}})).response})}async accountInfo(){return(await this.initialization).account}async streamInput(e){nu("[Query.streamInput] Starting to process input stream");try{let r=0;for await(let n of e){if(r++,nu(`[Query.streamInput] Processing message ${r}: ${n.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write($m(n)+` +`))}nu(`[Query.streamInput] Finished processing ${r} messages from input stream`),r>0&&this.hasBidirectionalNeeds()&&(nu("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult()),nu("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(r){if(!(r instanceof M1))throw r}}waitForFirstResult(){return this.firstResultReceived?(nu("[Query.waitForFirstResult] Result already received, returning immediately"),Promise.resolve()):new Promise(e=>{if(this.abortController?.signal.aborted){e();return}this.abortController?.signal.addEventListener("abort",()=>e(),{once:!0}),this.firstResultReceivedResolve=e})}handleHookCallbacks(e,r,n,o){let s=this.hookCallbacks.get(e);if(!s)throw Error(`No hook callback found for ID: ${e}`);return s(r,n,{signal:o})}connectSdkMcpServer(e,r){let n=new k6r(o=>this.sendMcpServerMessageToCli(e,o));this.sdkMcpTransports.set(e,n),this.sdkMcpServerInstances.set(e,r),r.connect(n).catch(o=>{this.sdkMcpTransports.get(e)===n&&this.sdkMcpTransports.delete(e),this.sdkMcpServerInstances.get(e)===r&&this.sdkMcpServerInstances.delete(e),nu(`[Query.connectSdkMcpServer] Failed to connect MCP server '${e}': ${o}`,{level:"error"})})}async disconnectSdkMcpServer(e){let r=this.sdkMcpTransports.get(e);r&&(await r.close(),this.sdkMcpTransports.delete(e)),this.sdkMcpServerInstances.delete(e)}sendMcpServerMessageToCli(e,r){if("id"in r&&r.id!==null&&r.id!==void 0){let o=`${e}:${r.id}`,s=this.pendingMcpResponses.get(o);if(s){s.resolve(r),this.pendingMcpResponses.delete(o);return}}let n={type:"control_request",request_id:(0,Yxt.randomUUID)(),request:{subtype:"mcp_message",server_name:e,message:r}};Promise.resolve(this.transport.write($m(n)+` +`)).catch(o=>{nu(`[Query.sendMcpServerMessageToCli] Transport write failed: ${o}`,{level:"error"})})}handleMcpControlRequest(e,r,n){let o="id"in r.message?r.message.id:null,s=`${e}:${o}`;return new Promise((c,l)=>{let u=a(()=>{this.pendingMcpResponses.delete(s)},"U"),d=a(h=>{u(),c(h)},"H"),f=a(h=>{u(),l(h)},"q");if(this.pendingMcpResponses.set(s,{resolve:d,reject:f}),n.onmessage)n.onmessage(r.message);else{u(),l(Error("No message handler registered"));return}})}},Z9r=500,X9r=1048576,WVc=[200,800],D6r=class{static{a(this,"EU")}send;sendTimeoutMs;onError;maxPendingEntries;maxPendingBytes;backoffMs;pending=[];pendingEntries=0;pendingBytes=0;flushPromise=null;constructor(e,r=6e4,n,o=Z9r,s=X9r,c=WVc){this.send=e,this.sendTimeoutMs=r,this.onError=n,this.maxPendingEntries=o,this.maxPendingBytes=s,this.backoffMs=c}enqueue(e,r){let n=$m(r).length;this.pending.push({filePath:e,entries:r,bytes:n}),this.pendingEntries+=r.length,this.pendingBytes+=n,(this.pendingEntries>this.maxPendingEntries||this.pendingBytes>this.maxPendingBytes)&&(this.flushPromise=this.drain(),this.flushPromise.catch(()=>{}))}async flush(){let e=this.drain();this.flushPromise=e,await e,this.flushPromise===e&&(this.flushPromise=null)}async drain(){let e=this.flushPromise,r=this.pending.splice(0);this.pendingEntries=0,this.pendingBytes=0,e&&await e,r.length!==0&&await this.doFlush(r)}async doFlush(e){let r=new Map;for(let o of e){let s=r.get(o.filePath);s?s.push(...o.entries):r.set(o.filePath,o.entries.slice())}let n=this.backoffMs.length+1;for(let[o,s]of r){let c=`SessionStore.append() timed out after ${this.sendTimeoutMs}ms for ${o}`,l,u=1;for(;u<=n;u++)try{await roe(this.send(o,s),this.sendTimeoutMs,c),l=void 0;break}catch(d){if(l=o6e(d),l.message===c)break;let f=this.backoffMs[u-1];if(f===void 0)break;await ceo(f)}if(l){nu(`[TranscriptMirrorBatcher] flush failed for ${o} after ${u} attempt(s): ${l}`,{level:"error"});try{this.onError?.(o,l)}catch(d){nu(`[TranscriptMirrorBatcher] onError callback threw: ${d}`,{level:"error"})}}}}},xZi=C9r(m7c(),1);a(zVc,"Ug");a(I8e,"O0");a(YVc,"qg");q8r=new Map,KVc=5e3;a(JVc,"Bg");a(ZVc,"zg");a(XVc,"OZ");eWc=(0,xto.promisify)(Ito.execFile);a(a6e,"m4");a(tWc,"jH");nU=65536,rWc=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;a(Ih,"L$");a(kto,"ZZ");a(j8r,"IX");a(bk,"A6");a(M6r,"rQ");a(Pto,"RX");a(nWc,"MZ");a(Dto,"PX");O8e=200;a(iWc,"Lg");a(c6e,"F0");a(IW,"U4");a(oWc,"jg");a(l6e,"M1");a($N,"j6");a(Kwt,"L1");sWc=1048576,aWc=5242880;a(lWc,"Rg");a(Nto,"jZ");a(ooe,"D0");a(Xxt,"jX");ewt=Buffer.from('{"type":"attribution-snapshot"'),uWc=Buffer.from('{"type":"system"'),L8e=10,dWc=Buffer.from([L8e]),fWc=256;a(pWc,"_g");a(hWc,"kg");a(mWc,"Sg");a(gWc,"vg");a(AWc,"Cg");a(yWc,"AZ");a(EWc,"xg");a(_Wc,"yg");a(vWc,"fg");a(H8r,"IH");a(CWc,"gg");a(bWc,"hg");a(SWc,"ug");a(Mto,"RH");a(Oto,"PH");a(TWc,"IZ");a(Lto,"RZ");a(IWc,"PZ");a(Jwt,"k8");a(_8e,"oQ");a(Bto,"EZ");xWc=32;a(wWc,"pg");a(RWc,"dg");a(kWc,"ig");a(PWc,"ng");a(DWc,"rg");a(NWc,"bZ");a(MWc,"_Z");a(OWc,"CZ");a(LWc,"TZ");a(BWc,"xZ");a(FWc,"ag");a(Fto,"yZ");a(G8r,"_H");a(UWc,"sg");QWc=new Set(["user","assistant","attachment","system","progress"]);a(qWc,"$h");a(jWc,"Qh");a(Uto,"fZ");a(HWc,"gZ");a(GWc,"Jh");a($Wc,"hZ");a(VWc,"Xh");a(Qto,"uZ");a(qto,"lZ");a(jto,"cZ");a(WWc,"Wh");a(zWc,"Gh");a(YWc,"pZ");a(KWc,"dZ");a(Hto,"vH");a(Vto,"CH");a(Wto,"bX");a(JWc,"Uh");ZWc="user:inference",zto="user:profile",XWc="org:create_api_key",ezc=[XWc,zto],tzc=[zto,ZWc,"user:sessions:claude_code","user:mcp_servers","user:file_upload"],Mtm=Wto([...ezc,...tzc]),wZi={BASE_API_URL:"https://api.anthropic.com",CONSOLE_AUTHORIZE_URL:"https://platform.claude.com/oauth/authorize",CLAUDE_AI_AUTHORIZE_URL:"https://claude.com/cai/oauth/authorize",CLAUDE_AI_ORIGIN:"https://claude.ai",TOKEN_URL:"https://platform.claude.com/v1/oauth/token",API_KEY_URL:"https://api.anthropic.com/api/oauth/claude_cli/create_api_key",ROLES_URL:"https://api.anthropic.com/api/oauth/claude_cli/roles",CONSOLE_SUCCESS_URL:"https://platform.claude.com/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",CLAUDEAI_SUCCESS_URL:"https://platform.claude.com/oauth/code/success?app=claude-code",MANUAL_REDIRECT_URL:"https://platform.claude.com/oauth/code/callback",CLIENT_ID:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",OAUTH_FILE_SUFFIX:"",MCP_PROXY_URL:"https://mcp-proxy.anthropic.com",MCP_PROXY_PATH:"/v1/mcp/{server_id}"},rzc=void 0;a(nzc,"zh");izc=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"];a(ozc,"rZ");szc="-credentials";a(azc,"tZ");czc=/^[a-zA-Z0-9._-]+$/;a(lzc,"aZ");(function(t){t.assertEqual=o=>{};function e(o){}a(e,"Q"),t.assertIs=e;function r(o){throw Error()}a(r,"J"),t.assertNever=r,t.arrayToEnum=o=>{let s={};for(let c of o)s[c]=c;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(l=>typeof o[o[l]]!="number"),c={};for(let l of s)c[l]=o[l];return t.objectValues(c)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let c in o)Object.prototype.hasOwnProperty.call(o,c)&&s.push(c);return s},t.find=(o,s)=>{for(let c of o)if(s(c))return c},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}a(n,"Y"),t.joinValues=n,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(mc||(mc={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(RZi||(RZi={}));Rn=mc.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pW=a(t=>{switch(typeof t){case"undefined":return Rn.undefined;case"string":return Rn.string;case"number":return Number.isNaN(t)?Rn.nan:Rn.number;case"boolean":return Rn.boolean;case"function":return Rn.function;case"bigint":return Rn.bigint;case"symbol":return Rn.symbol;case"object":return Array.isArray(t)?Rn.array:t===null?Rn.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Rn.promise:typeof Map<"u"&&t instanceof Map?Rn.map:typeof Set<"u"&&t instanceof Set?Rn.set:typeof Date<"u"&&t instanceof Date?Rn.date:Rn.object;default:return Rn.unknown}},"l4"),hr=mc.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),xk=class t extends Error{static{a(this,"f6")}get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let c of s.issues)if(c.code==="invalid_union")c.unionErrors.map(o);else if(c.code==="invalid_return_type")o(c.returnTypeError);else if(c.code==="invalid_arguments")o(c.argumentsError);else if(c.path.length===0)n._errors.push(r(c));else{let l=n,u=0;for(;ur.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];r[s]=r[s]||[],r[s].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};xk.create=t=>new xk(t);uzc=a((t,e)=>{let r;switch(t.code){case hr.invalid_type:t.received===Rn.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case hr.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,mc.jsonStringifyReplacer)}`;break;case hr.unrecognized_keys:r=`Unrecognized key(s) in object: ${mc.joinValues(t.keys,", ")}`;break;case hr.invalid_union:r="Invalid input";break;case hr.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${mc.joinValues(t.options)}`;break;case hr.invalid_enum_value:r=`Invalid enum value. Expected ${mc.joinValues(t.options)}, received '${t.received}'`;break;case hr.invalid_arguments:r="Invalid function arguments";break;case hr.invalid_return_type:r="Invalid function return type";break;case hr.invalid_date:r="Invalid date";break;case hr.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:mc.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case hr.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case hr.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case hr.custom:r="Invalid input";break;case hr.invalid_intersection_types:r="Intersection results could not be merged";break;case hr.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case hr.not_finite:r="Number must be finite";break;default:r=e.defaultError,mc.assertNever(t)}return{message:r}},"Fh"),F8e=uzc,dzc=F8e;a(L6r,"tQ");B6r=a(t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,s=[...r,...o.path||[]],c={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let l="",u=n.filter(d=>!!d).slice().reverse();for(let d of u)l=d(c,{data:e,defaultError:l}).message;return{...o,path:s,message:l}},"_X");a(un,"f");tC=class t{static{a(this,"U6")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return Xi;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r){let s=await o.key,c=await o.value;n.push({key:s,value:c})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:s,value:c}=o;if(s.status==="aborted"||c.status==="aborted")return Xi;s.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(n[s.value]=c.value)}return{status:e.value,value:n}}},Xi=Object.freeze({status:"aborted"}),C8e=a(t=>({status:"dirty",value:t}),"v8"),L1=a(t=>({status:"valid",value:t}),"z6"),kZi=a(t=>t.status==="aborted","TH"),PZi=a(t=>t.status==="dirty","xH"),Lve=a(t=>t.status==="valid","Z0"),nwt=a(t=>typeof Promise<"u"&&t instanceof Promise,"aQ");(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Kn||(Kn={}));Rk=class{static{a(this,"H4")}constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},DZi=a((t,e)=>{if(Lve(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new xk(t.common.issues);return this._error=r,this._error}}},"eZ");a(Jo,"e");Ms=class{static{a(this,"Y$")}get description(){return this._def.description}_getType(e){return pW(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:pW(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new tC,ctx:{common:e.parent.common,data:e.data,parsedType:pW(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(nwt(r))throw Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pW(e)},o=this._parseSync({data:e,path:n.path,parent:n});return DZi(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pW(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return Lve(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>Lve(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pW(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(nwt(o)?o:Promise.resolve(o));return DZi(n,s)}refine(e,r){let n=a(o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r,"J");return this._refinement((o,s)=>{let c=e(o),l=a(()=>s.addIssue({code:hr.custom,...n(o)}),"G");return typeof Promise<"u"&&c instanceof Promise?c.then(u=>u?!0:(l(),!1)):c?!0:(l(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new zN({schema:this,typeName:Cr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a(r=>this["~validate"](r),"validate")}}optional(){return wk.create(this,this._def)}nullable(){return cU.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return bW.create(this)}promise(){return foe.create(this,this._def)}or(e){return Qve.create([this,e],this._def)}and(e){return qve.create(this,e,this._def)}transform(e){return new zN({...Jo(this._def),schema:this,typeName:Cr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Vve({...Jo(this._def),innerType:this,defaultValue:r,typeName:Cr.ZodDefault})}brand(){return new iwt({typeName:Cr.ZodBranded,type:this,...Jo(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Wve({...Jo(this._def),innerType:this,catchValue:r,typeName:Cr.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return owt.create(this,e)}readonly(){return zve.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},fzc=/^c[^\s-]{8,}$/i,pzc=/^[0-9a-z]+$/,hzc=/^[0-9A-HJKMNP-TV-Z]{26}$/i,mzc=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,gzc=/^[a-z0-9_-]{21}$/i,Azc=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,yzc=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ezc=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_zc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",vzc=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Czc=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,bzc=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Szc=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Tzc=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Izc=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Yto="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",xzc=new RegExp(`^${Yto}$`);a(Kto,"QM");a(wzc,"yh");a(Rzc,"fh");a(kzc,"gh");a(Pzc,"hh");a(Dzc,"uh");Bve=class t extends Ms{static{a(this,"p4")}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Rn.string){let o=this._getOrReturnCtx(e);return un(o,{code:hr.invalid_type,expected:Rn.string,received:o.parsedType}),Xi}let r=new tC,n;for(let o of this._def.checks)if(o.kind==="min")e.data.lengtho.value&&(n=this._getOrReturnCtx(e,n),un(n,{code:hr.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,c=e.data.lengthe.test(o),{validation:r,code:hr.invalid_string,...Kn.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Kn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Kn.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Kn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Kn.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Kn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Kn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Kn.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Kn.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Kn.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Kn.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Kn.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Kn.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Kn.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Kn.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Kn.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Kn.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Kn.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Kn.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Kn.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Kn.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Kn.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Kn.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Kn.errToObj(r)})}nonempty(e){return this.min(1,Kn.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew Bve({checks:[],typeName:Cr.ZodString,coerce:t?.coerce??!1,...Jo(t)});a(Nzc,"mh");U8e=class t extends Ms{static{a(this,"T8")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Rn.number){let o=this._getOrReturnCtx(e);return un(o,{code:hr.invalid_type,expected:Rn.number,received:o.parsedType}),Xi}let r,n=new tC;for(let o of this._def.checks)o.kind==="int"?mc.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),un(r,{code:hr.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),un(r,{code:hr.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?Nzc(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),un(r,{code:hr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),un(r,{code:hr.not_finite,message:o.message}),n.dirty()):mc.assertNever(o);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Kn.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Kn.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Kn.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Kn.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Kn.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Kn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Kn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Kn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Kn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Kn.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Kn.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Kn.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Kn.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Kn.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuee.kind==="int"||e.kind==="multipleOf"&&mc.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.valuenew U8e({checks:[],typeName:Cr.ZodNumber,coerce:t?.coerce||!1,...Jo(t)});Q8e=class t extends Ms{static{a(this,"x8")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Rn.bigint)return this._getInvalidInput(e);let r,n=new tC;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),un(r,{code:hr.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),un(r,{code:hr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):mc.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return un(r,{code:hr.invalid_type,expected:Rn.bigint,received:r.parsedType}),Xi}gte(e,r){return this.setLimit("min",e,!0,Kn.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Kn.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Kn.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Kn.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Kn.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Kn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Kn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Kn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Kn.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Kn.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew Q8e({checks:[],typeName:Cr.ZodBigInt,coerce:t?.coerce??!1,...Jo(t)});q8e=class extends Ms{static{a(this,"kX")}_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Rn.boolean){let r=this._getOrReturnCtx(e);return un(r,{code:hr.invalid_type,expected:Rn.boolean,received:r.parsedType}),Xi}return L1(e.data)}};q8e.create=t=>new q8e({typeName:Cr.ZodBoolean,coerce:t?.coerce||!1,...Jo(t)});j8e=class t extends Ms{static{a(this,"eQ")}_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Rn.date){let o=this._getOrReturnCtx(e);return un(o,{code:hr.invalid_type,expected:Rn.date,received:o.parsedType}),Xi}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return un(o,{code:hr.invalid_date}),Xi}let r=new tC,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()o.value&&(n=this._getOrReturnCtx(e,n),un(n,{code:hr.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):mc.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Kn.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Kn.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew j8e({checks:[],coerce:t?.coerce||!1,typeName:Cr.ZodDate,...Jo(t)});H8e=class extends Ms{static{a(this,"SX")}_parse(e){if(this._getType(e)!==Rn.symbol){let r=this._getOrReturnCtx(e);return un(r,{code:hr.invalid_type,expected:Rn.symbol,received:r.parsedType}),Xi}return L1(e.data)}};H8e.create=t=>new H8e({typeName:Cr.ZodSymbol,...Jo(t)});Fve=class extends Ms{static{a(this,"$7")}_parse(e){if(this._getType(e)!==Rn.undefined){let r=this._getOrReturnCtx(e);return un(r,{code:hr.invalid_type,expected:Rn.undefined,received:r.parsedType}),Xi}return L1(e.data)}};Fve.create=t=>new Fve({typeName:Cr.ZodUndefined,...Jo(t)});Uve=class extends Ms{static{a(this,"Q7")}_parse(e){if(this._getType(e)!==Rn.null){let r=this._getOrReturnCtx(e);return un(r,{code:hr.invalid_type,expected:Rn.null,received:r.parsedType}),Xi}return L1(e.data)}};Uve.create=t=>new Uve({typeName:Cr.ZodNull,...Jo(t)});G8e=class extends Ms{static{a(this,"vX")}constructor(){super(...arguments),this._any=!0}_parse(e){return L1(e.data)}};G8e.create=t=>new G8e({typeName:Cr.ZodAny,...Jo(t)});EW=class extends Ms{static{a(this,"M0")}constructor(){super(...arguments),this._unknown=!0}_parse(e){return L1(e.data)}};EW.create=t=>new EW({typeName:Cr.ZodUnknown,...Jo(t)});KL=class extends Ms{static{a(this,"d4")}_parse(e){let r=this._getOrReturnCtx(e);return un(r,{code:hr.invalid_type,expected:Rn.never,received:r.parsedType}),Xi}};KL.create=t=>new KL({typeName:Cr.ZodNever,...Jo(t)});$8e=class extends Ms{static{a(this,"CX")}_parse(e){if(this._getType(e)!==Rn.undefined){let r=this._getOrReturnCtx(e);return un(r,{code:hr.invalid_type,expected:Rn.void,received:r.parsedType}),Xi}return L1(e.data)}};$8e.create=t=>new $8e({typeName:Cr.ZodVoid,...Jo(t)});bW=class t extends Ms{static{a(this,"R4")}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==Rn.array)return un(r,{code:hr.invalid_type,expected:Rn.array,received:r.parsedType}),Xi;if(o.exactLength!==null){let c=r.data.length>o.exactLength.value,l=r.data.lengtho.maxLength.value&&(un(r,{code:hr.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((c,l)=>o.type._parseAsync(new Rk(r,c,r.path,l)))).then(c=>tC.mergeArray(n,c));let s=[...r.data].map((c,l)=>o.type._parseSync(new Rk(r,c,r.path,l)));return tC.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Kn.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Kn.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Kn.toString(r)}})}nonempty(e){return this.min(1,e)}};bW.create=(t,e)=>new bW({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Cr.ZodArray,...Jo(e)});a(vve,"C8");UI=class t extends Ms{static{a(this,"g$")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=mc.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==Rn.object){let u=this._getOrReturnCtx(e);return un(u,{code:hr.invalid_type,expected:Rn.object,received:u.parsedType}),Xi}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof KL&&this._def.unknownKeys==="strip"))for(let u in n.data)s.includes(u)||c.push(u);let l=[];for(let u of s){let d=o[u],f=n.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new Rk(n,f,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof KL){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of c)l.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(u==="strict")c.length>0&&(un(n,{code:hr.unrecognized_keys,keys:c}),r.dirty());else if(u!=="strip")throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of c){let f=n.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new Rk(n,f,n.path,d)),alwaysSet:d in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of l){let f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>tC.mergeObjectSync(r,u)):tC.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Kn.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:a((r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:Kn.errToObj(e).message??o}:{message:o}},"errorMap")}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:a(()=>({...this._def.shape(),...e}),"shape")})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:a(()=>({...this._def.shape(),...e._def.shape()}),"shape"),typeName:Cr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of mc.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}omit(e){let r={};for(let n of mc.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}deepPartial(){return vve(this)}partial(e){let r={};for(let n of mc.objectKeys(this.shape)){let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}return new t({...this._def,shape:a(()=>r,"shape")})}required(e){let r={};for(let n of mc.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof wk;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:a(()=>r,"shape")})}keyof(){return Jto(mc.objectKeys(this.shape))}};UI.create=(t,e)=>new UI({shape:a(()=>t,"shape"),unknownKeys:"strip",catchall:KL.create(),typeName:Cr.ZodObject,...Jo(e)});UI.strictCreate=(t,e)=>new UI({shape:a(()=>t,"shape"),unknownKeys:"strict",catchall:KL.create(),typeName:Cr.ZodObject,...Jo(e)});UI.lazycreate=(t,e)=>new UI({shape:t,unknownKeys:"strip",catchall:KL.create(),typeName:Cr.ZodObject,...Jo(e)});Qve=class extends Ms{static{a(this,"J7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(s){for(let l of s)if(l.result.status==="valid")return l.result;for(let l of s)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let c=s.map(l=>new xk(l.ctx.common.issues));return un(r,{code:hr.invalid_union,unionErrors:c}),Xi}if(a(o,"Y"),r.common.async)return Promise.all(n.map(async s=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(o);{let s,c=[];for(let u of n){let d={...r,common:{...r.common,issues:[]},parent:null},f=u._parseSync({data:r.data,path:r.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:d}),d.common.issues.length&&c.push(d.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let l=c.map(u=>new xk(u));return un(r,{code:hr.invalid_union,unionErrors:l}),Xi}}get options(){return this._def.options}};Qve.create=(t,e)=>new Qve({options:t,typeName:Cr.ZodUnion,...Jo(e)});eU=a(t=>t instanceof jve?eU(t.schema):t instanceof zN?eU(t.innerType()):t instanceof Hve?[t.value]:t instanceof Gve?t.options:t instanceof $ve?mc.objectValues(t.enum):t instanceof Vve?eU(t._def.innerType):t instanceof Fve?[void 0]:t instanceof Uve?[null]:t instanceof wk?[void 0,...eU(t.unwrap())]:t instanceof cU?[null,...eU(t.unwrap())]:t instanceof iwt||t instanceof zve?eU(t.unwrap()):t instanceof Wve?eU(t._def.innerType):[],"c4"),F6r=class t extends Ms{static{a(this,"gH")}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Rn.object)return un(r,{code:hr.invalid_type,expected:Rn.object,received:r.parsedType}),Xi;let n=this.discriminator,o=r.data[n],s=this.optionsMap.get(o);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(un(r,{code:hr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Xi)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let s of r){let c=eU(s.shape[e]);if(!c.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let l of c){if(o.has(l))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);o.set(l,s)}}return new t({typeName:Cr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...Jo(n)})}};a(U6r,"fH");qve=class extends Ms{static{a(this,"X7")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=a((s,c)=>{if(kZi(s)||kZi(c))return Xi;let l=U6r(s.value,c.value);return l.valid?((PZi(s)||PZi(c))&&r.dirty(),{status:r.value,value:l.data}):(un(n,{code:hr.invalid_intersection_types}),Xi)},"Y");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,c])=>o(s,c)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};qve.create=(t,e,r)=>new qve({left:t,right:e,typeName:Cr.ZodIntersection,...Jo(r)});aU=class t extends Ms{static{a(this,"i4")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rn.array)return un(n,{code:hr.invalid_type,expected:Rn.array,received:n.parsedType}),Xi;if(n.data.lengththis._def.items.length&&(un(n,{code:hr.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,c)=>{let l=this._def.items[c]||this._def.rest;return l?l._parse(new Rk(n,s,n.path,c)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>tC.mergeArray(r,s)):tC.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};aU.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new aU({items:t,typeName:Cr.ZodTuple,rest:null,...Jo(e)})};Q6r=class t extends Ms{static{a(this,"TX")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rn.object)return un(n,{code:hr.invalid_type,expected:Rn.object,received:n.parsedType}),Xi;let o=[],s=this._def.keyType,c=this._def.valueType;for(let l in n.data)o.push({key:s._parse(new Rk(n,l,n.path,l)),value:c._parse(new Rk(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?tC.mergeObjectAsync(r,o):tC.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Ms?new t({keyType:e,valueType:r,typeName:Cr.ZodRecord,...Jo(n)}):new t({keyType:Bve.create(),valueType:e,typeName:Cr.ZodRecord,...Jo(r)})}},V8e=class extends Ms{static{a(this,"xX")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rn.map)return un(n,{code:hr.invalid_type,expected:Rn.map,received:n.parsedType}),Xi;let o=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([l,u],d)=>({key:o._parse(new Rk(n,l,n.path,[d,"key"])),value:s._parse(new Rk(n,u,n.path,[d,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let u of c){let d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return Xi;(d.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(d.value,f.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let u of c){let{key:d,value:f}=u;if(d.status==="aborted"||f.status==="aborted")return Xi;(d.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(d.value,f.value)}return{status:r.value,value:l}}}};V8e.create=(t,e,r)=>new V8e({valueType:e,keyType:t,typeName:Cr.ZodMap,...Jo(r)});W8e=class t extends Ms{static{a(this,"y8")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rn.set)return un(n,{code:hr.invalid_type,expected:Rn.set,received:n.parsedType}),Xi;let o=this._def;o.minSize!==null&&n.data.sizeo.maxSize.value&&(un(n,{code:hr.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let s=this._def.valueType;function c(u){let d=new Set;for(let f of u){if(f.status==="aborted")return Xi;f.status==="dirty"&&r.dirty(),d.add(f.value)}return{status:r.value,value:d}}a(c,"W");let l=[...n.data.values()].map((u,d)=>s._parse(new Rk(n,u,n.path,d)));return n.common.async?Promise.all(l).then(u=>c(u)):c(l)}min(e,r){return new t({...this._def,minSize:{value:e,message:Kn.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Kn.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};W8e.create=(t,e)=>new W8e({valueType:t,minSize:null,maxSize:null,typeName:Cr.ZodSet,...Jo(e)});q6r=class t extends Ms{static{a(this,"sQ")}constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Rn.function)return un(r,{code:hr.invalid_type,expected:Rn.function,received:r.parsedType}),Xi;function n(l,u){return B6r({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,L6r(),F8e].filter(d=>!!d),issueData:{code:hr.invalid_arguments,argumentsError:u}})}a(n,"J");function o(l,u){return B6r({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,L6r(),F8e].filter(d=>!!d),issueData:{code:hr.invalid_return_type,returnTypeError:u}})}a(o,"Y");let s={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof foe){let l=this;return L1(async function(...u){let d=new xk([]),f=await l._def.args.parseAsync(u,s).catch(m=>{throw d.addIssue(n(u,m)),d}),h=await Reflect.apply(c,this,f);return await l._def.returns._def.type.parseAsync(h,s).catch(m=>{throw d.addIssue(o(h,m)),d})})}else{let l=this;return L1(function(...u){let d=l._def.args.safeParse(u,s);if(!d.success)throw new xk([n(u,d.error)]);let f=Reflect.apply(c,this,d.data),h=l._def.returns.safeParse(f,s);if(!h.success)throw new xk([o(f,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:aU.create(e).rest(EW.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||aU.create([]).rest(EW.create()),returns:r||EW.create(),typeName:Cr.ZodFunction,...Jo(n)})}},jve=class extends Ms{static{a(this,"Y7")}get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};jve.create=(t,e)=>new jve({getter:t,typeName:Cr.ZodLazy,...Jo(e)});Hve=class extends Ms{static{a(this,"W7")}_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return un(r,{received:r.data,code:hr.invalid_literal,expected:this._def.value}),Xi}return{status:"valid",value:e.data}}get value(){return this._def.value}};Hve.create=(t,e)=>new Hve({value:t,typeName:Cr.ZodLiteral,...Jo(e)});a(Jto,"JM");Gve=class t extends Ms{static{a(this,"L0")}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return un(r,{expected:mc.joinValues(n),received:r.parsedType,code:hr.invalid_type}),Xi}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return un(r,{received:r.data,code:hr.invalid_enum_value,options:n}),Xi}return L1(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};Gve.create=Jto;$ve=class extends Ms{static{a(this,"G7")}_parse(e){let r=mc.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Rn.string&&n.parsedType!==Rn.number){let o=mc.objectValues(r);return un(n,{expected:mc.joinValues(o),received:n.parsedType,code:hr.invalid_type}),Xi}if(this._cache||(this._cache=new Set(mc.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=mc.objectValues(r);return un(n,{received:n.data,code:hr.invalid_enum_value,options:o}),Xi}return L1(e.data)}get enum(){return this._def.values}};$ve.create=(t,e)=>new $ve({values:t,typeName:Cr.ZodNativeEnum,...Jo(e)});foe=class extends Ms{static{a(this,"f8")}unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Rn.promise&&r.common.async===!1)return un(r,{code:hr.invalid_type,expected:Rn.promise,received:r.parsedType}),Xi;let n=r.parsedType===Rn.promise?r.data:Promise.resolve(r.data);return L1(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};foe.create=(t,e)=>new foe({type:t,typeName:Cr.ZodPromise,...Jo(e)});zN=class extends Ms{static{a(this,"P4")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Cr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:a(c=>{un(n,c),c.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let c=o.transform(n.data,s);if(n.common.async)return Promise.resolve(c).then(async l=>{if(r.value==="aborted")return Xi;let u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?Xi:u.status==="dirty"||r.value==="dirty"?C8e(u.value):u});{if(r.value==="aborted")return Xi;let l=this._def.schema._parseSync({data:c,path:n.path,parent:n});return l.status==="aborted"?Xi:l.status==="dirty"||r.value==="dirty"?C8e(l.value):l}}if(o.type==="refinement"){let c=a(l=>{let u=o.refinement(l,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"W");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?Xi:(l.status==="dirty"&&r.dirty(),c(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?Xi:(l.status==="dirty"&&r.dirty(),c(l.value).then(()=>({status:r.value,value:l.value}))))}if(o.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Lve(c))return Xi;let l=o.transform(c.value,s);if(l instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>Lve(c)?Promise.resolve(o.transform(c.value,s)).then(l=>({status:r.value,value:l})):Xi);mc.assertNever(o)}};zN.create=(t,e,r)=>new zN({schema:t,typeName:Cr.ZodEffects,effect:e,...Jo(r)});zN.createWithPreprocess=(t,e,r)=>new zN({schema:e,effect:{type:"preprocess",transform:t},typeName:Cr.ZodEffects,...Jo(r)});wk=class extends Ms{static{a(this,"o6")}_parse(e){return this._getType(e)===Rn.undefined?L1(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};wk.create=(t,e)=>new wk({innerType:t,typeName:Cr.ZodOptional,...Jo(e)});cU=class extends Ms{static{a(this,"A1")}_parse(e){return this._getType(e)===Rn.null?L1(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};cU.create=(t,e)=>new cU({innerType:t,typeName:Cr.ZodNullable,...Jo(e)});Vve=class extends Ms{static{a(this,"U7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===Rn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Vve.create=(t,e)=>new Vve({innerType:t,typeName:Cr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Jo(e)});Wve=class extends Ms{static{a(this,"H7")}_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return nwt(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new xk(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new xk(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Wve.create=(t,e)=>new Wve({innerType:t,typeName:Cr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Jo(e)});z8e=class extends Ms{static{a(this,"yX")}_parse(e){if(this._getType(e)!==Rn.nan){let r=this._getOrReturnCtx(e);return un(r,{code:hr.invalid_type,expected:Rn.nan,received:r.parsedType}),Xi}return{status:"valid",value:e.data}}};z8e.create=t=>new z8e({typeName:Cr.ZodNaN,...Jo(t)});iwt=class extends Ms{static{a(this,"hH")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},owt=class t extends Ms{static{a(this,"fX")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Xi:o.status==="dirty"?(r.dirty(),C8e(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Xi:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:Cr.ZodPipeline})}},zve=class extends Ms{static{a(this,"K7")}_parse(e){let r=this._def.innerType._parse(e),n=a(o=>(Lve(o)&&(o.value=Object.freeze(o.value)),o),"J");return nwt(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};zve.create=(t,e)=>new zve({innerType:t,typeName:Cr.ZodReadonly,...Jo(e)});Otm={object:UI.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Cr||(Cr={}));Ltm=Bve.create,Btm=U8e.create,Ftm=z8e.create,Utm=Q8e.create,Qtm=q8e.create,qtm=j8e.create,jtm=H8e.create,Htm=Fve.create,Gtm=Uve.create,$tm=G8e.create,Vtm=EW.create,Wtm=KL.create,ztm=$8e.create,Ytm=bW.create,Mzc=UI.create,Ktm=UI.strictCreate,Jtm=Qve.create,Ztm=F6r.create,Xtm=qve.create,erm=aU.create,trm=Q6r.create,rrm=V8e.create,nrm=W8e.create,irm=q6r.create,orm=jve.create,srm=Hve.create,arm=Gve.create,crm=$ve.create,lrm=foe.create,urm=zN.create,drm=wk.create,frm=cU.create,prm=zN.createWithPreprocess,hrm=owt.create,Zto={};ZL(Zto,{version:a(()=>lno,"version"),util:a(()=>zs,"util"),treeifyError:a(()=>uro,"treeifyError"),toJSONSchema:a(()=>o7r,"toJSONSchema"),toDotPath:a(()=>dro,"toDotPath"),safeParseAsync:a(()=>nRt,"safeParseAsync"),safeParse:a(()=>rRt,"safeParse"),registry:a(()=>SUr,"registry"),regexes:a(()=>uUr,"regexes"),prettifyError:a(()=>fro,"prettifyError"),parseAsync:a(()=>lwt,"parseAsync"),parse:a(()=>cwt,"parse"),locales:a(()=>bUr,"locales"),isValidJWT:a(()=>Nno,"isValidJWT"),isValidBase64URL:a(()=>kno,"isValidBase64URL"),isValidBase64:a(()=>hUr,"isValidBase64"),globalRegistry:a(()=>iU,"globalRegistry"),globalConfig:a(()=>swt,"globalConfig"),function:a(()=>too,"function"),formatError:a(()=>oUr,"formatError"),flattenError:a(()=>iUr,"flattenError"),config:a(()=>rC,"config"),clone:a(()=>XN,"clone"),_xid:a(()=>LUr,"_xid"),_void:a(()=>Qio,"_void"),_uuidv7:a(()=>RUr,"_uuidv7"),_uuidv6:a(()=>wUr,"_uuidv6"),_uuidv4:a(()=>xUr,"_uuidv4"),_uuid:a(()=>IUr,"_uuid"),_url:a(()=>kUr,"_url"),_uppercase:a(()=>YUr,"_uppercase"),_unknown:a(()=>pwt,"_unknown"),_union:a(()=>OKc,"_union"),_undefined:a(()=>Lio,"_undefined"),_ulid:a(()=>OUr,"_ulid"),_uint64:a(()=>Mio,"_uint64"),_uint32:a(()=>wio,"_uint32"),_tuple:a(()=>Yio,"_tuple"),_trim:a(()=>t7r,"_trim"),_transform:a(()=>GKc,"_transform"),_toUpperCase:a(()=>n7r,"_toUpperCase"),_toLowerCase:a(()=>r7r,"_toLowerCase"),_templateLiteral:a(()=>XKc,"_templateLiteral"),_symbol:a(()=>Oio,"_symbol"),_success:a(()=>YKc,"_success"),_stringbool:a(()=>Xio,"_stringbool"),_stringFormat:a(()=>eoo,"_stringFormat"),_string:a(()=>mio,"_string"),_startsWith:a(()=>JUr,"_startsWith"),_size:a(()=>VUr,"_size"),_set:a(()=>QKc,"_set"),_safeParseAsync:a(()=>lUr,"_safeParseAsync"),_safeParse:a(()=>cUr,"_safeParse"),_regex:a(()=>WUr,"_regex"),_refine:a(()=>Zio,"_refine"),_record:a(()=>FKc,"_record"),_readonly:a(()=>ZKc,"_readonly"),_property:a(()=>zio,"_property"),_promise:a(()=>tJc,"_promise"),_positive:a(()=>Gio,"_positive"),_pipe:a(()=>JKc,"_pipe"),_parseAsync:a(()=>aUr,"_parseAsync"),_parse:a(()=>sUr,"_parse"),_overwrite:a(()=>Eoe,"_overwrite"),_optional:a(()=>$Kc,"_optional"),_number:a(()=>Cio,"_number"),_nullable:a(()=>VKc,"_nullable"),_null:a(()=>Bio,"_null"),_normalize:a(()=>e7r,"_normalize"),_nonpositive:a(()=>Vio,"_nonpositive"),_nonoptional:a(()=>zKc,"_nonoptional"),_nonnegative:a(()=>Wio,"_nonnegative"),_never:a(()=>Uio,"_never"),_negative:a(()=>$io,"_negative"),_nativeEnum:a(()=>jKc,"_nativeEnum"),_nanoid:a(()=>DUr,"_nanoid"),_nan:a(()=>Hio,"_nan"),_multipleOf:a(()=>Z8e,"_multipleOf"),_minSize:a(()=>X8e,"_minSize"),_minLength:a(()=>Kve,"_minLength"),_min:a(()=>OI,"_min"),_mime:a(()=>XUr,"_mime"),_maxSize:a(()=>oRt,"_maxSize"),_maxLength:a(()=>sRt,"_maxLength"),_max:a(()=>VN,"_max"),_map:a(()=>UKc,"_map"),_lte:a(()=>VN,"_lte"),_lt:a(()=>poe,"_lt"),_lowercase:a(()=>zUr,"_lowercase"),_literal:a(()=>HKc,"_literal"),_length:a(()=>aRt,"_length"),_lazy:a(()=>eJc,"_lazy"),_ksuid:a(()=>BUr,"_ksuid"),_jwt:a(()=>$Ur,"_jwt"),_isoTime:a(()=>_io,"_isoTime"),_isoDuration:a(()=>vio,"_isoDuration"),_isoDateTime:a(()=>yio,"_isoDateTime"),_isoDate:a(()=>Eio,"_isoDate"),_ipv6:a(()=>UUr,"_ipv6"),_ipv4:a(()=>FUr,"_ipv4"),_intersection:a(()=>BKc,"_intersection"),_int64:a(()=>Nio,"_int64"),_int32:a(()=>xio,"_int32"),_int:a(()=>Sio,"_int"),_includes:a(()=>KUr,"_includes"),_guid:a(()=>fwt,"_guid"),_gte:a(()=>OI,"_gte"),_gt:a(()=>hoe,"_gt"),_float64:a(()=>Iio,"_float64"),_float32:a(()=>Tio,"_float32"),_file:a(()=>Kio,"_file"),_enum:a(()=>qKc,"_enum"),_endsWith:a(()=>ZUr,"_endsWith"),_emoji:a(()=>PUr,"_emoji"),_email:a(()=>TUr,"_email"),_e164:a(()=>GUr,"_e164"),_discriminatedUnion:a(()=>LKc,"_discriminatedUnion"),_default:a(()=>WKc,"_default"),_date:a(()=>qio,"_date"),_custom:a(()=>Jio,"_custom"),_cuid2:a(()=>MUr,"_cuid2"),_cuid:a(()=>NUr,"_cuid"),_coercedString:a(()=>gio,"_coercedString"),_coercedNumber:a(()=>bio,"_coercedNumber"),_coercedDate:a(()=>jio,"_coercedDate"),_coercedBoolean:a(()=>kio,"_coercedBoolean"),_coercedBigint:a(()=>Dio,"_coercedBigint"),_cidrv6:a(()=>qUr,"_cidrv6"),_cidrv4:a(()=>QUr,"_cidrv4"),_catch:a(()=>KKc,"_catch"),_boolean:a(()=>Rio,"_boolean"),_bigint:a(()=>Pio,"_bigint"),_base64url:a(()=>HUr,"_base64url"),_base64:a(()=>jUr,"_base64"),_array:a(()=>i7r,"_array"),_any:a(()=>Fio,"_any"),TimePrecision:a(()=>Aio,"TimePrecision"),NEVER:a(()=>Xto,"NEVER"),JSONSchemaGenerator:a(()=>e6e,"JSONSchemaGenerator"),JSONSchema:a(()=>rJc,"JSONSchema"),Doc:a(()=>uwt,"Doc"),$output:a(()=>pio,"$output"),$input:a(()=>hio,"$input"),$constructor:a(()=>pt,"$constructor"),$brand:a(()=>ero,"$brand"),$ZodXID:a(()=>Eno,"$ZodXID"),$ZodVoid:a(()=>Hno,"$ZodVoid"),$ZodUnknown:a(()=>dwt,"$ZodUnknown"),$ZodUnion:a(()=>_Ur,"$ZodUnion"),$ZodUndefined:a(()=>Uno,"$ZodUndefined"),$ZodUUID:a(()=>dno,"$ZodUUID"),$ZodURL:a(()=>pno,"$ZodURL"),$ZodULID:a(()=>yno,"$ZodULID"),$ZodType:a(()=>Co,"$ZodType"),$ZodTuple:a(()=>iRt,"$ZodTuple"),$ZodTransform:a(()=>vUr,"$ZodTransform"),$ZodTemplateLiteral:a(()=>cio,"$ZodTemplateLiteral"),$ZodSymbol:a(()=>Fno,"$ZodSymbol"),$ZodSuccess:a(()=>iio,"$ZodSuccess"),$ZodStringFormat:a(()=>Qu,"$ZodStringFormat"),$ZodString:a(()=>f6e,"$ZodString"),$ZodSet:a(()=>Yno,"$ZodSet"),$ZodRegistry:a(()=>J8e,"$ZodRegistry"),$ZodRecord:a(()=>Wno,"$ZodRecord"),$ZodRealError:a(()=>u6e,"$ZodRealError"),$ZodReadonly:a(()=>aio,"$ZodReadonly"),$ZodPromise:a(()=>lio,"$ZodPromise"),$ZodPrefault:a(()=>rio,"$ZodPrefault"),$ZodPipe:a(()=>CUr,"$ZodPipe"),$ZodOptional:a(()=>Xno,"$ZodOptional"),$ZodObject:a(()=>EUr,"$ZodObject"),$ZodNumberFormat:a(()=>Lno,"$ZodNumberFormat"),$ZodNumber:a(()=>mUr,"$ZodNumber"),$ZodNullable:a(()=>eio,"$ZodNullable"),$ZodNull:a(()=>Qno,"$ZodNull"),$ZodNonOptional:a(()=>nio,"$ZodNonOptional"),$ZodNever:a(()=>jno,"$ZodNever"),$ZodNanoID:a(()=>mno,"$ZodNanoID"),$ZodNaN:a(()=>sio,"$ZodNaN"),$ZodMap:a(()=>zno,"$ZodMap"),$ZodLiteral:a(()=>Jno,"$ZodLiteral"),$ZodLazy:a(()=>uio,"$ZodLazy"),$ZodKSUID:a(()=>_no,"$ZodKSUID"),$ZodJWT:a(()=>Mno,"$ZodJWT"),$ZodIntersection:a(()=>Vno,"$ZodIntersection"),$ZodISOTime:a(()=>bno,"$ZodISOTime"),$ZodISODuration:a(()=>Sno,"$ZodISODuration"),$ZodISODateTime:a(()=>vno,"$ZodISODateTime"),$ZodISODate:a(()=>Cno,"$ZodISODate"),$ZodIPv6:a(()=>Ino,"$ZodIPv6"),$ZodIPv4:a(()=>Tno,"$ZodIPv4"),$ZodGUID:a(()=>uno,"$ZodGUID"),$ZodFunction:a(()=>hwt,"$ZodFunction"),$ZodFile:a(()=>Zno,"$ZodFile"),$ZodError:a(()=>nUr,"$ZodError"),$ZodEnum:a(()=>Kno,"$ZodEnum"),$ZodEmoji:a(()=>hno,"$ZodEmoji"),$ZodEmail:a(()=>fno,"$ZodEmail"),$ZodE164:a(()=>Dno,"$ZodE164"),$ZodDiscriminatedUnion:a(()=>$no,"$ZodDiscriminatedUnion"),$ZodDefault:a(()=>tio,"$ZodDefault"),$ZodDate:a(()=>Gno,"$ZodDate"),$ZodCustomStringFormat:a(()=>Ono,"$ZodCustomStringFormat"),$ZodCustom:a(()=>dio,"$ZodCustom"),$ZodCheckUpperCase:a(()=>rno,"$ZodCheckUpperCase"),$ZodCheckStringFormat:a(()=>d6e,"$ZodCheckStringFormat"),$ZodCheckStartsWith:a(()=>ino,"$ZodCheckStartsWith"),$ZodCheckSizeEquals:a(()=>Kro,"$ZodCheckSizeEquals"),$ZodCheckRegex:a(()=>eno,"$ZodCheckRegex"),$ZodCheckProperty:a(()=>sno,"$ZodCheckProperty"),$ZodCheckOverwrite:a(()=>cno,"$ZodCheckOverwrite"),$ZodCheckNumberFormat:a(()=>Vro,"$ZodCheckNumberFormat"),$ZodCheckMultipleOf:a(()=>$ro,"$ZodCheckMultipleOf"),$ZodCheckMinSize:a(()=>Yro,"$ZodCheckMinSize"),$ZodCheckMinLength:a(()=>Zro,"$ZodCheckMinLength"),$ZodCheckMimeType:a(()=>ano,"$ZodCheckMimeType"),$ZodCheckMaxSize:a(()=>zro,"$ZodCheckMaxSize"),$ZodCheckMaxLength:a(()=>Jro,"$ZodCheckMaxLength"),$ZodCheckLowerCase:a(()=>tno,"$ZodCheckLowerCase"),$ZodCheckLessThan:a(()=>fUr,"$ZodCheckLessThan"),$ZodCheckLengthEquals:a(()=>Xro,"$ZodCheckLengthEquals"),$ZodCheckIncludes:a(()=>nno,"$ZodCheckIncludes"),$ZodCheckGreaterThan:a(()=>pUr,"$ZodCheckGreaterThan"),$ZodCheckEndsWith:a(()=>ono,"$ZodCheckEndsWith"),$ZodCheckBigIntFormat:a(()=>Wro,"$ZodCheckBigIntFormat"),$ZodCheck:a(()=>xh,"$ZodCheck"),$ZodCatch:a(()=>oio,"$ZodCatch"),$ZodCUID2:a(()=>Ano,"$ZodCUID2"),$ZodCUID:a(()=>gno,"$ZodCUID"),$ZodCIDRv6:a(()=>wno,"$ZodCIDRv6"),$ZodCIDRv4:a(()=>xno,"$ZodCIDRv4"),$ZodBoolean:a(()=>gUr,"$ZodBoolean"),$ZodBigIntFormat:a(()=>Bno,"$ZodBigIntFormat"),$ZodBigInt:a(()=>AUr,"$ZodBigInt"),$ZodBase64URL:a(()=>Pno,"$ZodBase64URL"),$ZodBase64:a(()=>Rno,"$ZodBase64"),$ZodAsyncError:a(()=>SW,"$ZodAsyncError"),$ZodArray:a(()=>yUr,"$ZodArray"),$ZodAny:a(()=>qno,"$ZodAny")});Xto=Object.freeze({status:"aborted"});a(pt,"F");ero=Symbol("zod_brand"),SW=class extends Error{static{a(this,"n4")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},swt={};a(rC,"c$");zs={};ZL(zs,{unwrapMessage:a(()=>b8e,"unwrapMessage"),stringifyPrimitive:a(()=>ls,"stringifyPrimitive"),required:a(()=>Jzc,"required"),randomString:a(()=>jzc,"randomString"),propertyKeyTypes:a(()=>awt,"propertyKeyTypes"),promiseAllObject:a(()=>qzc,"promiseAllObject"),primitiveTypes:a(()=>iro,"primitiveTypes"),prefixIssues:a(()=>Ik,"prefixIssues"),pick:a(()=>Vzc,"pick"),partial:a(()=>Kzc,"partial"),optionalKeys:a(()=>oro,"optionalKeys"),omit:a(()=>Wzc,"omit"),numKeys:a(()=>Hzc,"numKeys"),nullish:a(()=>Aoe,"nullish"),normalizeParams:a(()=>xr,"normalizeParams"),merge:a(()=>Yzc,"merge"),jsonStringifyReplacer:a(()=>tro,"jsonStringifyReplacer"),joinValues:a(()=>Vr,"joinValues"),issue:a(()=>cro,"issue"),isPlainObject:a(()=>K8e,"isPlainObject"),isObject:a(()=>Y8e,"isObject"),getSizableOrigin:a(()=>eRt,"getSizableOrigin"),getParsedType:a(()=>Gzc,"getParsedType"),getLengthableOrigin:a(()=>tRt,"getLengthableOrigin"),getEnumValues:a(()=>eUr,"getEnumValues"),getElementAtPath:a(()=>Qzc,"getElementAtPath"),floatSafeRemainder:a(()=>rro,"floatSafeRemainder"),finalizeIssue:a(()=>YN,"finalizeIssue"),extend:a(()=>zzc,"extend"),escapeRegex:a(()=>yoe,"escapeRegex"),esc:a(()=>Cve,"esc"),defineLazy:a(()=>Kc,"defineLazy"),createTransparentProxy:a(()=>$zc,"createTransparentProxy"),clone:a(()=>XN,"clone"),cleanRegex:a(()=>Xwt,"cleanRegex"),cleanEnum:a(()=>Zzc,"cleanEnum"),captureStackTrace:a(()=>rUr,"captureStackTrace"),cached:a(()=>Zwt,"cached"),assignProp:a(()=>tUr,"assignProp"),assertNotEqual:a(()=>Lzc,"assertNotEqual"),assertNever:a(()=>Fzc,"assertNever"),assertIs:a(()=>Bzc,"assertIs"),assertEqual:a(()=>Ozc,"assertEqual"),assert:a(()=>Uzc,"assert"),allowsEval:a(()=>nro,"allowsEval"),aborted:a(()=>xve,"aborted"),NUMBER_FORMAT_RANGES:a(()=>sro,"NUMBER_FORMAT_RANGES"),Class:a(()=>j6r,"Class"),BIGINT_FORMAT_RANGES:a(()=>aro,"BIGINT_FORMAT_RANGES")});a(Ozc,"lh");a(Lzc,"ch");a(Bzc,"ph");a(Fzc,"dh");a(Uzc,"ih");a(eUr,"B7");a(Vr,"P");a(tro,"mH");a(Zwt,"z7");a(Aoe,"I1");a(Xwt,"N7");a(rro,"lH");a(Kc,"N$");a(tUr,"cH");a(Qzc,"nh");a(qzc,"rh");a(jzc,"oh");a(Cve,"j0");rUr=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};a(Y8e,"g8");nro=Zwt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});a(K8e,"h8");a(Hzc,"th");Gzc=a(t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw Error(`Unknown data type: ${e}`)}},"ah"),awt=new Set(["string","number","symbol"]),iro=new Set(["string","number","bigint","boolean","symbol","undefined"]);a(yoe,"r4");a(XN,"H6");a(xr,"k");a($zc,"sh");a(ls,"x");a(oro,"iH");sro={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},aro={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};a(Vzc,"eh");a(Wzc,"$u");a(zzc,"Qu");a(Yzc,"Ju");a(Kzc,"Xu");a(Jzc,"Yu");a(xve,"A0");a(Ik,"I6");a(b8e,"V7");a(YN,"g6");a(eRt,"O7");a(tRt,"D7");a(cro,"oH");a(Zzc,"Wu");j6r=class{static{a(this,"YM")}constructor(...e){}},lro=a((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,tro,2)},enumerable:!0})},"WM"),nUr=pt("$ZodError",lro),u6e=pt("$ZodError",lro,{Parent:Error});a(iUr,"m8");a(oUr,"l8");a(uro,"mX");a(dro,"GM");a(fro,"lX");sUr=a(t=>(e,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new SW;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>YN(u,s,rC())));throw rUr(l,o?.callee),l}return c.value},"cX"),cwt=sUr(u6e),aUr=a(t=>async(e,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>YN(u,s,rC())));throw rUr(l,o?.callee),l}return c.value},"pX"),lwt=aUr(u6e),cUr=a(t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new SW;return s.issues.length?{success:!1,error:new(t??nUr)(s.issues.map(c=>YN(c,o,rC())))}:{success:!0,data:s.value}},"dX"),rRt=cUr(u6e),lUr=a(t=>async(e,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>YN(c,o,rC())))}:{success:!0,data:s.value}},"iX"),nRt=lUr(u6e),uUr={};ZL(uUr,{xid:a(()=>gro,"xid"),uuid7:a(()=>rYc,"uuid7"),uuid6:a(()=>tYc,"uuid6"),uuid4:a(()=>eYc,"uuid4"),uuid:a(()=>Yve,"uuid"),uppercase:a(()=>Hro,"uppercase"),unicodeEmail:a(()=>oYc,"unicodeEmail"),undefined:a(()=>qro,"undefined"),ulid:a(()=>mro,"ulid"),time:a(()=>Nro,"time"),string:a(()=>Oro,"string"),rfc5322Email:a(()=>iYc,"rfc5322Email"),number:a(()=>Fro,"number"),null:a(()=>Qro,"null"),nanoid:a(()=>yro,"nanoid"),lowercase:a(()=>jro,"lowercase"),ksuid:a(()=>Aro,"ksuid"),ipv6:a(()=>Sro,"ipv6"),ipv4:a(()=>bro,"ipv4"),integer:a(()=>Bro,"integer"),html5Email:a(()=>nYc,"html5Email"),hostname:a(()=>wro,"hostname"),guid:a(()=>_ro,"guid"),extendedDuration:a(()=>Xzc,"extendedDuration"),emoji:a(()=>Cro,"emoji"),email:a(()=>vro,"email"),e164:a(()=>Rro,"e164"),duration:a(()=>Ero,"duration"),domain:a(()=>cYc,"domain"),datetime:a(()=>Mro,"datetime"),date:a(()=>Pro,"date"),cuid2:a(()=>hro,"cuid2"),cuid:a(()=>pro,"cuid"),cidrv6:a(()=>Iro,"cidrv6"),cidrv4:a(()=>Tro,"cidrv4"),browserEmail:a(()=>sYc,"browserEmail"),boolean:a(()=>Uro,"boolean"),bigint:a(()=>Lro,"bigint"),base64url:a(()=>dUr,"base64url"),base64:a(()=>xro,"base64"),_emoji:a(()=>aYc,"_emoji")});pro=/^[cC][^\s-]{8,}$/,hro=/^[0-9a-z]+$/,mro=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,gro=/^[0-9a-vA-V]{20}$/,Aro=/^[A-Za-z0-9]{27}$/,yro=/^[a-zA-Z0-9_-]{21}$/,Ero=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Xzc=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_ro=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Yve=a(t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,"P0"),eYc=Yve(4),tYc=Yve(6),rYc=Yve(7),vro=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,nYc=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,iYc=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,oYc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,sYc=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,aYc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";a(Cro,"WK");bro=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Sro=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Tro=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Iro=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,xro=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dUr=/^[A-Za-z0-9_-]*$/,wro=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,cYc=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Rro=/^\+(?:[0-9]){6,14}[0-9]$/,kro="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Pro=new RegExp(`^${kro}$`);a(Dro,"HM");a(Nro,"NK");a(Mro,"wK");Oro=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"OK"),Lro=/^\d+n?$/,Bro=/^\d+$/,Fro=/^-?\d+(?:\.\d+)?/i,Uro=/true|false/i,Qro=/null/i,qro=/undefined/i,jro=/^[^A-Z]*$/,Hro=/^[^a-z]*$/,xh=pt("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Gro={number:"number",bigint:"bigint",object:"date"},fUr=pt("$ZodCheckLessThan",(t,e)=>{xh.init(t,e);let r=Gro[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?n.value<=e.value:n.value{xh.init(t,e);let r=Gro[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),$ro=pt("$ZodCheckMultipleOf",(t,e)=>{xh.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):rro(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),Vro=pt("$ZodCheckNumberFormat",(t,e)=>{xh.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=sro[e.format];t._zod.onattach.push(c=>{let l=c._zod.bag;l.format=e.format,l.minimum=o,l.maximum=s,r&&(l.pattern=Bro)}),t._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:e.format,code:"invalid_type",input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort});return}}ls&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inst:t})}}),Wro=pt("$ZodCheckBigIntFormat",(t,e)=>{xh.init(t,e);let[r,n]=aro[e.format];t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,s.minimum=r,s.maximum=n}),t._zod.check=o=>{let s=o.value;sn&&o.issues.push({origin:"bigint",input:s,code:"too_big",maximum:n,inst:t})}}),zro=pt("$ZodCheckMaxSize",(t,e)=>{xh.init(t,e),t._zod.when=r=>{let n=r.value;return!Aoe(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let n=r.value;n.size<=e.maximum||r.issues.push({origin:eRt(n),code:"too_big",maximum:e.maximum,input:n,inst:t,continue:!e.abort})}}),Yro=pt("$ZodCheckMinSize",(t,e)=>{xh.init(t,e),t._zod.when=r=>{let n=r.value;return!Aoe(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let n=r.value;n.size>=e.minimum||r.issues.push({origin:eRt(n),code:"too_small",minimum:e.minimum,input:n,inst:t,continue:!e.abort})}}),Kro=pt("$ZodCheckSizeEquals",(t,e)=>{xh.init(t,e),t._zod.when=r=>{let n=r.value;return!Aoe(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),t._zod.check=r=>{let n=r.value,o=n.size;if(o===e.size)return;let s=o>e.size;r.issues.push({origin:eRt(n),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),Jro=pt("$ZodCheckMaxLength",(t,e)=>{xh.init(t,e),t._zod.when=r=>{let n=r.value;return!Aoe(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let n=r.value;if(n.length<=e.maximum)return;let o=tRt(n);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Zro=pt("$ZodCheckMinLength",(t,e)=>{xh.init(t,e),t._zod.when=r=>{let n=r.value;return!Aoe(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let n=r.value;if(n.length>=e.minimum)return;let o=tRt(n);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Xro=pt("$ZodCheckLengthEquals",(t,e)=>{xh.init(t,e),t._zod.when=r=>{let n=r.value;return!Aoe(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),t._zod.check=r=>{let n=r.value,o=n.length;if(o===e.length)return;let s=tRt(n),c=o>e.length;r.issues.push({origin:s,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),d6e=pt("$ZodCheckStringFormat",(t,e)=>{var r,n;xh.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),eno=pt("$ZodCheckRegex",(t,e)=>{d6e.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),tno=pt("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=jro),d6e.init(t,e)}),rno=pt("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Hro),d6e.init(t,e)}),nno=pt("$ZodCheckIncludes",(t,e)=>{xh.init(t,e);let r=yoe(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),ino=pt("$ZodCheckStartsWith",(t,e)=>{xh.init(t,e);let r=new RegExp(`^${yoe(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),ono=pt("$ZodCheckEndsWith",(t,e)=>{xh.init(t,e);let r=new RegExp(`.*${yoe(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});a(NZi,"KM");sno=pt("$ZodCheckProperty",(t,e)=>{xh.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>NZi(o,r,e.property));NZi(n,r,e.property)}}),ano=pt("$ZodCheckMimeType",(t,e)=>{xh.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t})}}),cno=pt("$ZodCheckOverwrite",(t,e)=>{xh.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}}),uwt=class{static{a(this,"tX")}constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(` `).filter(s=>s),n=Math.min(...r.map(s=>s.length-s.trimStart().length)),o=r.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,r=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...r,n.join(` -`))}},uto={major:4,minor:0,patch:0},Co=ft("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=uto;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=a((s,c,l)=>{let u=ave(s),d;for(let f of c){if(f._zod.when){if(!f._zod.when(s))continue}else if(u)continue;let h=s.issues.length,m=f._zod.check(s);if(m instanceof Promise&&l?.async===!1)throw new fW;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=ave(s,h)))});else{if(s.issues.length===h)continue;u||(u=ave(s,h))}}return d?d.then(()=>s):s},"X");t._zod.run=(s,c)=>{let l=t._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new fW;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=Dwt(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Nwt(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),q8e=ft("$ZodString",(t,e)=>{Co.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Leo(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),Lu=ft("$ZodStringFormat",(t,e)=>{Q8e.init(t,e),q8e.init(t,e)}),dto=ft("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=veo),Lu.init(t,e)}),fto=ft("$ZodUUID",(t,e)=>{if(e.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Rve(r))}else e.pattern??(e.pattern=Rve());Lu.init(t,e)}),pto=ft("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Ceo),Lu.init(t,e)}),hto=ft("$ZodURL",(t,e)=>{Lu.init(t,e),t._zod.check=r=>{try{let n=r.value,o=new URL(n),s=o.href;e.hostname&&(e.hostname.lastIndex=0,!e.hostname.test(o.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Reo.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,!e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),!n.endsWith("/")&&s.endsWith("/")?r.value=s.slice(0,-1):r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),mto=ft("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=beo()),Lu.init(t,e)}),gto=ft("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Eeo),Lu.init(t,e)}),Ato=ft("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=heo),Lu.init(t,e)}),yto=ft("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=meo),Lu.init(t,e)}),Eto=ft("$ZodULID",(t,e)=>{e.pattern??(e.pattern=geo),Lu.init(t,e)}),_to=ft("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Aeo),Lu.init(t,e)}),vto=ft("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=yeo),Lu.init(t,e)}),Cto=ft("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Oeo(e)),Lu.init(t,e)}),bto=ft("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Deo),Lu.init(t,e)}),Sto=ft("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Meo(e)),Lu.init(t,e)}),Tto=ft("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=_eo),Lu.init(t,e)}),Ito=ft("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Seo),Lu.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),xto=ft("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Teo),Lu.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),wto=ft("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Ieo),Lu.init(t,e)}),Rto=ft("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=xeo),Lu.init(t,e),t._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw Error();let s=Number(o);if(`${s}`!==o||s<0||s>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});a(l9r,"oK");kto=ft("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=weo),Lu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{l9r(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});a(Pto,"AM");Dto=ft("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=s9r),Lu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{Pto(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Nto=ft("$ZodE164",(t,e)=>{e.pattern??(e.pattern=keo),Lu.init(t,e)});a(Mto,"IM");Oto=ft("$ZodJWT",(t,e)=>{Lu.init(t,e),t._zod.check=r=>{Mto(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Lto=ft("$ZodCustomStringFormat",(t,e)=>{Lu.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),u9r=ft("$ZodNumber",(t,e)=>{Co.init(t,e),t._zod.pattern=t._zod.bag.pattern??Ueo,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),Bto=ft("$ZodNumber",(t,e)=>{Weo.init(t,e),u9r.init(t,e)}),d9r=ft("$ZodBoolean",(t,e)=>{Co.init(t,e),t._zod.pattern=Qeo,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}}),f9r=ft("$ZodBigInt",(t,e)=>{Co.init(t,e),t._zod.pattern=Beo,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),Fto=ft("$ZodBigInt",(t,e)=>{zeo.init(t,e),f9r.init(t,e)}),Uto=ft("$ZodSymbol",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:t}),r}}),Qto=ft("$ZodUndefined",(t,e)=>{Co.init(t,e),t._zod.pattern=jeo,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:t}),r}}),qto=ft("$ZodNull",(t,e)=>{Co.init(t,e),t._zod.pattern=qeo,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}}),jto=ft("$ZodAny",(t,e)=>{Co.init(t,e),t._zod.parse=r=>r}),qxt=ft("$ZodUnknown",(t,e)=>{Co.init(t,e),t._zod.parse=r=>r}),Hto=ft("$ZodNever",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),Gto=ft("$ZodVoid",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:t}),r}}),$to=ft("$ZodDate",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:t}),r}});a(OKi,"BM");p9r=ft("$ZodArray",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let c=0;cOKi(d,r,c))):OKi(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});a(LIt,"aX");a(LKi,"zM");h9r=ft("$ZodObject",(t,e)=>{Co.init(t,e);let r=wwt(()=>{let f=Object.keys(e.shape);for(let m of f)if(!(e.shape[m]instanceof Co))throw Error(`Invalid element at key "${m}": expected a Zod schema`);let h=seo(e.shape);return{shape:e.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(h)}});zc(t._zod,"propValues",()=>{let f=e.shape,h={};for(let m in f){let g=f[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(let A of g.values)h[m].add(A)}}return h});let n=a(f=>{let h=new Qxt(["shape","payload","ctx"]),m=r.value,g=a(_=>{let v=rve(_);return`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`},"w");h.write("const input = payload.value;");let A=Object.create(null),y=0;for(let _ of m.keys)A[_]=`key_${y++}`;h.write("const newResult = {}");for(let _ of m.keys)if(m.optionalKeys.has(_)){let v=A[_];h.write(`const ${v} = ${g(_)};`);let b=rve(_);h.write(` +`))}},lno={major:4,minor:0,patch:0},Co=pt("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=lno;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=a((s,c,l)=>{let u=xve(s),d;for(let f of c){if(f._zod.when){if(!f._zod.when(s))continue}else if(u)continue;let h=s.issues.length,m=f._zod.check(s);if(m instanceof Promise&&l?.async===!1)throw new SW;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=xve(s,h)))});else{if(s.issues.length===h)continue;u||(u=xve(s,h))}}return d?d.then(()=>s):s},"X");t._zod.run=(s,c)=>{let l=t._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new SW;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=rRt(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return nRt(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),f6e=pt("$ZodString",(t,e)=>{Co.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Oro(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),Qu=pt("$ZodStringFormat",(t,e)=>{d6e.init(t,e),f6e.init(t,e)}),uno=pt("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=_ro),Qu.init(t,e)}),dno=pt("$ZodUUID",(t,e)=>{if(e.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Yve(r))}else e.pattern??(e.pattern=Yve());Qu.init(t,e)}),fno=pt("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=vro),Qu.init(t,e)}),pno=pt("$ZodURL",(t,e)=>{Qu.init(t,e),t._zod.check=r=>{try{let n=r.value,o=new URL(n),s=o.href;e.hostname&&(e.hostname.lastIndex=0,!e.hostname.test(o.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:wro.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,!e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),!n.endsWith("/")&&s.endsWith("/")?r.value=s.slice(0,-1):r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),hno=pt("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Cro()),Qu.init(t,e)}),mno=pt("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=yro),Qu.init(t,e)}),gno=pt("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=pro),Qu.init(t,e)}),Ano=pt("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=hro),Qu.init(t,e)}),yno=pt("$ZodULID",(t,e)=>{e.pattern??(e.pattern=mro),Qu.init(t,e)}),Eno=pt("$ZodXID",(t,e)=>{e.pattern??(e.pattern=gro),Qu.init(t,e)}),_no=pt("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Aro),Qu.init(t,e)}),vno=pt("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Mro(e)),Qu.init(t,e)}),Cno=pt("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Pro),Qu.init(t,e)}),bno=pt("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Nro(e)),Qu.init(t,e)}),Sno=pt("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Ero),Qu.init(t,e)}),Tno=pt("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=bro),Qu.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Ino=pt("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Sro),Qu.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),xno=pt("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Tro),Qu.init(t,e)}),wno=pt("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Iro),Qu.init(t,e),t._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw Error();let s=Number(o);if(`${s}`!==o||s<0||s>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});a(hUr,"oK");Rno=pt("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=xro),Qu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{hUr(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});a(kno,"AM");Pno=pt("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=dUr),Qu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{kno(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Dno=pt("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Rro),Qu.init(t,e)});a(Nno,"IM");Mno=pt("$ZodJWT",(t,e)=>{Qu.init(t,e),t._zod.check=r=>{Nno(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Ono=pt("$ZodCustomStringFormat",(t,e)=>{Qu.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),mUr=pt("$ZodNumber",(t,e)=>{Co.init(t,e),t._zod.pattern=t._zod.bag.pattern??Fro,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),Lno=pt("$ZodNumber",(t,e)=>{Vro.init(t,e),mUr.init(t,e)}),gUr=pt("$ZodBoolean",(t,e)=>{Co.init(t,e),t._zod.pattern=Uro,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}}),AUr=pt("$ZodBigInt",(t,e)=>{Co.init(t,e),t._zod.pattern=Lro,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),Bno=pt("$ZodBigInt",(t,e)=>{Wro.init(t,e),AUr.init(t,e)}),Fno=pt("$ZodSymbol",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:t}),r}}),Uno=pt("$ZodUndefined",(t,e)=>{Co.init(t,e),t._zod.pattern=qro,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:t}),r}}),Qno=pt("$ZodNull",(t,e)=>{Co.init(t,e),t._zod.pattern=Qro,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}}),qno=pt("$ZodAny",(t,e)=>{Co.init(t,e),t._zod.parse=r=>r}),dwt=pt("$ZodUnknown",(t,e)=>{Co.init(t,e),t._zod.parse=r=>r}),jno=pt("$ZodNever",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),Hno=pt("$ZodVoid",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:t}),r}}),Gno=pt("$ZodDate",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:t}),r}});a(MZi,"BM");yUr=pt("$ZodArray",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let c=0;cMZi(d,r,c))):MZi(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});a(sxt,"aX");a(OZi,"zM");EUr=pt("$ZodObject",(t,e)=>{Co.init(t,e);let r=Zwt(()=>{let f=Object.keys(e.shape);for(let m of f)if(!(e.shape[m]instanceof Co))throw Error(`Invalid element at key "${m}": expected a Zod schema`);let h=oro(e.shape);return{shape:e.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(h)}});Kc(t._zod,"propValues",()=>{let f=e.shape,h={};for(let m in f){let g=f[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(let A of g.values)h[m].add(A)}}return h});let n=a(f=>{let h=new uwt(["shape","payload","ctx"]),m=r.value,g=a(_=>{let v=Cve(_);return`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`},"w");h.write("const input = payload.value;");let A=Object.create(null),y=0;for(let _ of m.keys)A[_]=`key_${y++}`;h.write("const newResult = {}");for(let _ of m.keys)if(m.optionalKeys.has(_)){let v=A[_];h.write(`const ${v} = ${g(_)};`);let b=Cve(_);h.write(` if (${v}.issues.length) { if (input[${b}] === undefined) { if (${b} in input) { @@ -1610,20 +1610,20 @@ new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); `)}else{let v=A[_];h.write(`const ${v} = ${g(_)};`),h.write(` if (${v}.issues.length) payload.issues = payload.issues.concat(${v}.issues.map(iss => ({ ...iss, - path: iss.path ? [${rve(_)}, ...iss.path] : [${rve(_)}] - })));`),h.write(`newResult[${rve(_)}] = ${v}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let E=h.compile();return(_,v)=>E(f,_,v)},"Y"),o,s=S8e,c=!Lxt.jitless,l=c&&ieo.value,u=e.catchall,d;t._zod.parse=(f,h)=>{d??(d=r.value);let m=f.value;if(!s(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),f;let g=[];if(c&&l&&h?.async===!1&&h.jitless!==!0)o||(o=n(e.shape)),f=o(f,h);else{f.value={};let v=d.shape;for(let b of d.keys){let T=v[b],w=T._zod.run({value:m[b],issues:[]},h),R=T._zod.optin==="optional"&&T._zod.optout==="optional";w instanceof Promise?g.push(w.then(x=>R?LKi(x,f,b,m):LIt(x,f,b))):R?LKi(w,f,b,m):LIt(w,f,b)}}if(!u)return g.length?Promise.all(g).then(()=>f):f;let A=[],y=d.keySet,E=u._zod,_=E.def.type;for(let v of Object.keys(m)){if(y.has(v))continue;if(_==="never"){A.push(v);continue}let b=E.run({value:m[v],issues:[]},h);b instanceof Promise?g.push(b.then(T=>LIt(T,f,v))):LIt(b,f,v)}return A.length&&f.issues.push({code:"unrecognized_keys",keys:A,input:m,inst:t}),g.length?Promise.all(g).then(()=>f):f}});a(BKi,"NM");m9r=ft("$ZodUnion",(t,e)=>{Co.init(t,e),zc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),zc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),zc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),zc(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){let r=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>Rwt(n.source)).join("|")})$`)}}),t._zod.parse=(r,n)=>{let o=!1,s=[];for(let c of e.options){let l=c._zod.run({value:r.value,issues:[]},n);if(l instanceof Promise)s.push(l),o=!0;else{if(l.issues.length===0)return l;s.push(l)}}return o?Promise.all(s).then(c=>BKi(c,r,t,n)):BKi(s,r,t,n)}}),Vto=ft("$ZodDiscriminatedUnion",(t,e)=>{m9r.init(t,e);let r=t._zod.parse;zc(t._zod,"propValues",()=>{let o={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[l,u]of Object.entries(c)){o[l]||(o[l]=new Set);for(let d of u)o[l].add(d)}}return o});let n=wwt(()=>{let o=e.options,s=new Map;for(let c of o){let l=c._zod.propValues[e.discriminator];if(!l||l.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let u of l){if(s.has(u))throw Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,c)}}return s});t._zod.parse=(o,s)=>{let c=o.value;if(!S8e(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),o;let l=n.value.get(c?.[e.discriminator]);return l?l._zod.run(o,s):e.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:c,path:[e.discriminator],inst:t}),o)}}),Wto=ft("$ZodIntersection",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),c=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||c instanceof Promise?Promise.all([s,c]).then(([l,u])=>FKi(r,l,u)):FKi(r,s,c)}});a(F8r,"pK");a(FKi,"wM");Mwt=ft("$ZodTuple",(t,e)=>{Co.init(t,e);let r=e.items,n=r.length-[...r].reverse().findIndex(o=>o._zod.optin!=="optional");t._zod.parse=(o,s)=>{let c=o.value;if(!Array.isArray(c))return o.issues.push({input:c,inst:t,expected:"tuple",code:"invalid_type"}),o;o.value=[];let l=[];if(!e.rest){let d=c.length>r.length,f=c.length=c.length&&u>=n)continue;let f=d._zod.run({value:c[u],issues:[]},s);f instanceof Promise?l.push(f.then(h=>BIt(h,o,u))):BIt(f,o,u)}if(e.rest){let d=c.slice(r.length);for(let f of d){u++;let h=e.rest._zod.run({value:f,issues:[]},s);h instanceof Promise?l.push(h.then(m=>BIt(m,o,u))):BIt(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});a(BIt,"sX");zto=ft("$ZodRecord",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!T8e(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[];if(e.keyType._zod.values){let c=e.keyType._zod.values;r.value={};for(let u of c)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let d=e.valueType._zod.run({value:o[u],issues:[]},n);d instanceof Promise?s.push(d.then(f=>{f.issues.length&&r.issues.push(...Ak(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...Ak(u,d.issues)),r.value[u]=d.value)}let l;for(let u in o)c.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:l})}else{r.value={};for(let c of Reflect.ownKeys(o)){if(c==="__proto__")continue;let l=e.keyType._zod.run({value:c,issues:[]},n);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:l.issues.map(d=>qN(d,n,Xv())),input:c,path:[c],inst:t}),r.value[l.value]=l.value;continue}let u=e.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?s.push(u.then(d=>{d.issues.length&&r.issues.push(...Ak(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...Ak(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),Yto=ft("$ZodMap",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:t}),r;let s=[];r.value=new Map;for(let[c,l]of o){let u=e.keyType._zod.run({value:c,issues:[]},n),d=e.valueType._zod.run({value:l,issues:[]},n);u instanceof Promise||d instanceof Promise?s.push(Promise.all([u,d]).then(([f,h])=>{UKi(f,h,r,c,o,t,n)})):UKi(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});a(UKi,"OM");Kto=ft("$ZodSet",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:t,expected:"set",code:"invalid_type"}),r;let s=[];r.value=new Set;for(let c of o){let l=e.valueType._zod.run({value:c,issues:[]},n);l instanceof Promise?s.push(l.then(u=>QKi(u,r))):QKi(l,r)}return s.length?Promise.all(s).then(()=>r):r}});a(QKi,"DM");Jto=ft("$ZodEnum",(t,e)=>{Co.init(t,e);let r=Y6r(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>Bxt.has(typeof n)).map(n=>typeof n=="string"?coe(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return t._zod.values.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),Zto=ft("$ZodLiteral",(t,e)=>{Co.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?coe(r):r?r.toString():String(r)).join("|")})$`),t._zod.parse=(r,n)=>{let o=r.value;return t._zod.values.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),r}}),Xto=ft("$ZodFile",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:t}),r}}),g9r=ft("$ZodTransform",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new fW;return r.value=o,r}}),ero=ft("$ZodOptional",(t,e)=>{Co.init(t,e),t._zod.optin="optional",t._zod.optout="optional",zc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),zc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Rwt(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(r,n):r.value===void 0?r:e.innerType._zod.run(r,n)}),tro=ft("$ZodNullable",(t,e)=>{Co.init(t,e),zc(t._zod,"optin",()=>e.innerType._zod.optin),zc(t._zod,"optout",()=>e.innerType._zod.optout),zc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Rwt(r.source)}|null)$`):void 0}),zc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),rro=ft("$ZodDefault",(t,e)=>{Co.init(t,e),t._zod.optin="optional",zc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>qKi(s,e)):qKi(o,e)}});a(qKi,"FM");nro=ft("$ZodPrefault",(t,e)=>{Co.init(t,e),t._zod.optin="optional",zc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),iro=ft("$ZodNonOptional",(t,e)=>{Co.init(t,e),zc(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>jKi(s,t)):jKi(o,t)}});a(jKi,"ZM");oro=ft("$ZodSuccess",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.issues.length===0,r)):(r.value=o.issues.length===0,r)}}),sro=ft("$ZodCatch",(t,e)=>{Co.init(t,e),t._zod.optin="optional",zc(t._zod,"optout",()=>e.innerType._zod.optout),zc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(c=>qN(c,n,Xv()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>qN(s,n,Xv()))},input:r.value}),r.issues=[]),r)}}),aro=ft("$ZodNaN",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),A9r=ft("$ZodPipe",(t,e)=>{Co.init(t,e),zc(t._zod,"values",()=>e.in._zod.values),zc(t._zod,"optin",()=>e.in._zod.optin),zc(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(r,n)=>{let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>HKi(s,e,n)):HKi(o,e,n)}});a(HKi,"MM");cro=ft("$ZodReadonly",(t,e)=>{Co.init(t,e),zc(t._zod,"propValues",()=>e.innerType._zod.propValues),zc(t._zod,"values",()=>e.innerType._zod.values),zc(t._zod,"optin",()=>e.innerType._zod.optin),zc(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(GKi):GKi(o)}});a(GKi,"LM");lro=ft("$ZodTemplateLiteral",(t,e)=>{Co.init(t,e);let r=[];for(let n of e.parts)if(n instanceof Co){if(!n._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let o=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!o)throw Error(`Invalid template literal part: ${n._zod.traits}`);let s=o.startsWith("^")?1:0,c=o.endsWith("$")?o.length-1:o.length;r.push(o.slice(s,c))}else if(n===null||oeo.has(typeof n))r.push(coe(`${n}`));else throw Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"template_literal",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:"template_literal",pattern:t._zod.pattern.source}),n)}),uro=ft("$ZodPromise",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),dro=ft("$ZodLazy",(t,e)=>{Co.init(t,e),zc(t._zod,"innerType",()=>e.getter()),zc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),zc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),zc(t._zod,"optin",()=>t._zod.innerType._zod.optin),zc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),fro=ft("$ZodCustom",(t,e)=>{Sh.init(t,e),Co.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>$Ki(s,r,n,t));$Ki(o,r,n,t)}});a($Ki,"jM");y9r={};WL(y9r,{zhTW:a(()=>HWc,"zhTW"),zhCN:a(()=>qWc,"zhCN"),vi:a(()=>UWc,"vi"),ur:a(()=>BWc,"ur"),ua:a(()=>OWc,"ua"),tr:a(()=>NWc,"tr"),th:a(()=>kWc,"th"),ta:a(()=>wWc,"ta"),sv:a(()=>IWc,"sv"),sl:a(()=>SWc,"sl"),ru:a(()=>CWc,"ru"),pt:a(()=>_Wc,"pt"),ps:a(()=>gWc,"ps"),pl:a(()=>yWc,"pl"),ota:a(()=>hWc,"ota"),no:a(()=>fWc,"no"),nl:a(()=>uWc,"nl"),ms:a(()=>cWc,"ms"),mk:a(()=>sWc,"mk"),ko:a(()=>iWc,"ko"),kh:a(()=>rWc,"kh"),ja:a(()=>eWc,"ja"),it:a(()=>ZVc,"it"),id:a(()=>KVc,"id"),hu:a(()=>zVc,"hu"),he:a(()=>VVc,"he"),frCA:a(()=>GVc,"frCA"),fr:a(()=>jVc,"fr"),fi:a(()=>QVc,"fi"),fa:a(()=>FVc,"fa"),es:a(()=>LVc,"es"),eo:a(()=>MVc,"eo"),en:a(()=>pro,"en"),de:a(()=>RVc,"de"),cs:a(()=>xVc,"cs"),ca:a(()=>TVc,"ca"),be:a(()=>bVc,"be"),az:a(()=>vVc,"az"),ar:a(()=>EVc,"ar")});yVc=a(()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return o=>{switch(o.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${us(o.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()} ${c.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${o.prefix}"`:s.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${s.suffix}"`:s.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${s.includes}"`:s.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${s.pattern}`:`${n[s.format]??o.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${o.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${o.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${o.keys.length>1?"\u0629":""}: ${Vr(o.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"Du");a(EVc,"tK");_Vc=a(()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o.expected}, daxil olan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${us(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()} ${c.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${s.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:s.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${s.suffix}" il\u0259 bitm\u0259lidir`:s.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${s.includes}" daxil olmal\u0131d\u0131r`:s.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${s.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[s.format]??o.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${o.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${o.keys.length>1?"lar":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`${o.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${o.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"Fu");a(vVc,"aK");a(VKi,"PM");CVc=a(()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0456\u045E";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${us(o.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=VKi(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=VKi(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${o.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${o.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"Zu");a(bVc,"sK");SVc=a(()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${o.expected}, s'ha rebut ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Valor inv\xE0lid: s'esperava ${us(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${Vr(o.values," o ")}`;case"too_big":{let s=o.inclusive?"com a m\xE0xim":"menys de",c=e(o.origin);return c?`Massa gran: s'esperava que ${o.origin??"el valor"} contingu\xE9s ${s} ${o.maximum.toString()} ${c.unit??"elements"}`:`Massa gran: s'esperava que ${o.origin??"el valor"} fos ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"com a m\xEDnim":"m\xE9s de",c=e(o.origin);return c?`Massa petit: s'esperava que ${o.origin} contingu\xE9s ${s} ${o.minimum.toString()} ${c.unit}`:`Massa petit: s'esperava que ${o.origin} fos ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${s.prefix}"`:s.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format inv\xE0lid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${s.pattern}`:`Format inv\xE0lid per a ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${o.divisor}`;case"unrecognized_keys":return`Clau${o.keys.length>1?"s":""} no reconeguda${o.keys.length>1?"s":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${o.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${o.origin}`;default:return"Entrada inv\xE0lida"}}},"Mu");a(TVc,"eK");IVc=a(()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(o))return"pole";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return o=>{switch(o.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o.expected}, obdr\u017Eeno ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${us(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.maximum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.minimum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${s.prefix}"`:s.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${s.suffix}"`:s.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${s.includes}"`:s.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${s.pattern}`:`Neplatn\xFD form\xE1t ${n[s.format]??o.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${o.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${Vr(o.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${o.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${o.origin}`;default:return"Neplatn\xFD vstup"}}},"Lu");a(xVc,"$q");wVc=a(()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"Zahl";case"object":{if(Array.isArray(o))return"Array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return o=>{switch(o.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${o.expected}, erhalten ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ung\xFCltige Eingabe: erwartet ${us(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ${c.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ist`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ${c.unit} hat`:`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ist`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ung\xFCltiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ung\xFCltiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ung\xFCltiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${s.pattern} entsprechen`:`Ung\xFCltig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${o.divisor} sein`;case"unrecognized_keys":return`${o.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${o.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${o.origin}`;default:return"Ung\xFCltige Eingabe"}}},"ju");a(RVc,"Qq");kVc=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"Au"),PVc=a(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${kVc(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${us(n.values[0])}`:`Invalid option: expected one of ${Vr(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Vr(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}},"Iu");a(pro,"A7");DVc=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"nombro";case"object":{if(Array.isArray(t))return"tabelo";if(t===null)return"senvalora";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"Ru"),NVc=a(()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return n=>{switch(n.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${n.expected}, ricevi\u011Dis ${DVc(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${us(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${Vr(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${Vr(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}},"Pu");a(MVc,"Jq");OVc=a(()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"arreglo";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype)return o.constructor.name}}return s},"J"),n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${o.expected}, recibido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: se esperaba ${us(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Demasiado grande: se esperaba que ${o.origin??"valor"} tuviera ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: se esperaba que ${o.origin??"valor"} fuera ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Demasiado peque\xF1o: se esperaba que ${o.origin} tuviera ${s}${o.minimum.toString()} ${c.unit}`:`Demasiado peque\xF1o: se esperaba que ${o.origin} fuera ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Llave${o.keys.length>1?"s":""} desconocida${o.keys.length>1?"s":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o.origin}`;default:return"Entrada inv\xE1lida"}}},"Eu");a(LVc,"Xq");BVc=a(()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0622\u0631\u0627\u06CC\u0647";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return o=>{switch(o.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${r(o.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return o.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${us(o.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${Vr(o.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:s.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:s.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${s.includes}" \u0628\u0627\u0634\u062F`:s.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${s.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[s.format]??o.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${o.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${o.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${Vr(o.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${o.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${o.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"bu");a(FVc,"Yq");UVc=a(()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return o=>{switch(o.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${o.expected}, oli ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${us(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Liian suuri: ${c.subject} t\xE4ytyy olla ${s}${o.maximum.toString()} ${c.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Liian pieni: ${c.subject} t\xE4ytyy olla ${s}${o.minimum.toString()} ${c.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${s.includes}"`:s.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${s.pattern}`:`Virheellinen ${n[s.format]??o.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${o.divisor} monikerta`;case"unrecognized_keys":return`${o.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${Vr(o.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"_u");a(QVc,"Wq");qVc=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombre";case"object":{if(Array.isArray(o))return"tableau";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : ${o.expected} attendu, ${r(o.input)} re\xE7u`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : ${us(o.values[0])} attendu`:`Option invalide : une valeur parmi ${Vr(o.values,"|")} attendue`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Trop grand : ${o.origin??"valeur"} doit ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o.origin??"valeur"} doit \xEAtre ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Trop petit : ${o.origin} doit ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : ${o.origin} doit \xEAtre ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${Vr(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"ku");a(jVc,"Gq");HVc=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${o.expected}, re\xE7u ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : attendu ${us(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u2264":"<",c=e(o.origin);return c?`Trop grand : attendu que ${o.origin??"la valeur"} ait ${s}${o.maximum.toString()} ${c.unit}`:`Trop grand : attendu que ${o.origin??"la valeur"} soit ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u2265":">",c=e(o.origin);return c?`Trop petit : attendu que ${o.origin} ait ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : attendu que ${o.origin} soit ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${Vr(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"Su");a(GVc,"Uq");$Vc=a(()=>{let t={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return o=>{switch(o.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${o.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${us(o.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()} ${c.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()} ${c.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${s.prefix}"`:s.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${s.suffix}"`:s.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${s.includes}"`:s.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${s.pattern}`:`${n[s.format]??o.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${o.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${o.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${o.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"vu");a(VVc,"Hq");WVc=a(()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(o))return"t\xF6mb";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return o=>{switch(o.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o.expected}, a kapott \xE9rt\xE9k ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${us(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`T\xFAl nagy: ${o.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${s}${o.maximum.toString()} ${c.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${o.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} m\xE9rete t\xFAl kicsi ${s}${o.minimum.toString()} ${c.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} t\xFAl kicsi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\xC9rv\xE9nytelen string: "${s.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:s.format==="ends_with"?`\xC9rv\xE9nytelen string: "${s.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:s.format==="includes"?`\xC9rv\xE9nytelen string: "${s.includes}" \xE9rt\xE9ket kell tartalmaznia`:s.format==="regex"?`\xC9rv\xE9nytelen string: ${s.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[s.format]??o.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${o.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${o.keys.length>1?"s":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${o.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${o.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"Cu");a(zVc,"Kq");YVc=a(()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak valid: diharapkan ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak valid: diharapkan ${us(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: diharapkan ${o.origin??"value"} memiliki ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: diharapkan ${o.origin??"value"} menjadi ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: diharapkan ${o.origin} memiliki ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: diharapkan ${o.origin} menjadi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${n[s.format]??o.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${o.keys.length>1?"s":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${o.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${o.origin}`;default:return"Input tidak valid"}}},"Tu");a(KVc,"qq");JVc=a(()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numero";case"object":{if(Array.isArray(o))return"vettore";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input non valido: atteso ${o.expected}, ricevuto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input non valido: atteso ${us(o.values[0])}`:`Opzione non valida: atteso uno tra ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Troppo grande: ${o.origin??"valore"} deve avere ${s}${o.maximum.toString()} ${c.unit??"elementi"}`:`Troppo grande: ${o.origin??"valore"} deve essere ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Troppo piccolo: ${o.origin} deve avere ${s}${o.minimum.toString()} ${c.unit}`:`Troppo piccolo: ${o.origin} deve essere ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${o.divisor}`;case"unrecognized_keys":return`Chiav${o.keys.length>1?"i":"e"} non riconosciut${o.keys.length>1?"e":"a"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${o.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${o.origin}`;default:return"Input non valido"}}},"xu");a(ZVc,"Vq");XVc=a(()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(o))return"\u914D\u5217";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${o.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${r(o.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return o.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${us(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${Vr(o.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let s=o.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",c=e(o.origin);return c?`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${c.unit??"\u8981\u7D20"}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let s=o.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",c=e(o.origin);return c?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${c.unit}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${s.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${o.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${o.keys.length>1?"\u7FA4":""}: ${Vr(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"yu");a(eWc,"Bq");tWc=a(()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(o))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(o===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return o=>{switch(o.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${us(o.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()} ${c.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()} ${c.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${s.prefix}"`:s.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${s.suffix}"`:s.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${s.includes}"`:s.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${s.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${o.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${Vr(o.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"fu");a(rWc,"zq");nWc=a(()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return o=>{switch(o.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${r(o.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return o.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${us(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${Vr(o.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let s=o.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",c=s==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()} ${s}${c}`}case"too_small":{let s=o.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",c=s==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()} ${s}${c}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:s.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${s.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[s.format]??o.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${o.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${Vr(o.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${o.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${o.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"gu");a(iWc,"Nq");oWc=a(()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(o))return"\u043D\u0438\u0437\u0430";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return o=>{switch(o.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${us(o.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.minimum.toString()} ${c.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${o.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${o.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"hu");a(sWc,"wq");aWc=a(()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombor";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak sah: dijangka ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak sah: dijangka ${us(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: dijangka ${o.origin??"nilai"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: dijangka ${o.origin??"nilai"} adalah ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: dijangka ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: dijangka ${o.origin} adalah ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${n[s.format]??o.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${Vr(o.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${o.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${o.origin}`;default:return"Input tidak sah"}}},"uu");a(cWc,"Oq");lWc=a(()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"getal";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return o=>{switch(o.code){case"invalid_type":return`Ongeldige invoer: verwacht ${o.expected}, ontving ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ongeldige invoer: verwacht ${us(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} ${c.unit??"elementen"} bevat`:`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} is`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} ${c.unit} bevat`:`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} is`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${o.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${o.keys.length>1?"s":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${o.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${o.origin}`;default:return"Ongeldige invoer"}}},"mu");a(uWc,"Dq");dWc=a(()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"tall";case"object":{if(Array.isArray(o))return"liste";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Ugyldig input: forventet ${o.expected}, fikk ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ugyldig verdi: forventet ${us(o.values[0])}`:`Ugyldig valg: forventet en av ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()} ${c.unit??"elementer"}`:`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()} ${c.unit}`:`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${n[s.format]??o.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${o.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${o.origin}`;default:return"Ugyldig input"}}},"lu");a(fWc,"Fq");pWc=a(()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numara";case"object":{if(Array.isArray(o))return"saf";if(o===null)return"gayb";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return o=>{switch(o.code){case"invalid_type":return`F\xE2sit giren: umulan ${o.expected}, al\u0131nan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`F\xE2sit giren: umulan ${us(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} ${c.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} ${c.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let s=o;return s.format==="starts_with"?`F\xE2sit metin: "${s.prefix}" ile ba\u015Flamal\u0131.`:s.format==="ends_with"?`F\xE2sit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`F\xE2sit metin: "${s.includes}" ihtiv\xE2 etmeli.`:s.format==="regex"?`F\xE2sit metin: ${s.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[s.format]??o.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${o.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${o.keys.length>1?"s":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${o.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"cu");a(hWc,"Zq");mWc=a(()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0627\u0631\u06D0";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return o=>{switch(o.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${r(o.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return o.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${us(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${Vr(o.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0648\u064A`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0648\u064A`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:s.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:s.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${s.includes}" \u0648\u0644\u0631\u064A`:s.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${s.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[s.format]??o.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${o.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${o.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${o.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${o.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"pu");a(gWc,"Mq");AWc=a(()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"liczba";case"object":{if(Array.isArray(o))return"tablica";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return o=>{switch(o.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o.expected}, otrzymano ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${us(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.maximum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.minimum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${s.prefix}"`:s.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${s.suffix}"`:s.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${s.includes}"`:s.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${s.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[s.format]??o.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${o.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${o.keys.length>1?"s":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${o.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${o.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"du");a(yWc,"Lq");EWc=a(()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"array";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${o.expected}, recebido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: esperado ${us(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Muito grande: esperado que ${o.origin??"valor"} tivesse ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Muito grande: esperado que ${o.origin??"valor"} fosse ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Muito pequeno: esperado que ${o.origin} tivesse ${s}${o.minimum.toString()} ${c.unit}`:`Muito pequeno: esperado que ${o.origin} fosse ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`${n[s.format]??o.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Chave${o.keys.length>1?"s":""} desconhecida${o.keys.length>1?"s":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${o.origin}`;default:return"Campo inv\xE1lido"}}},"iu");a(_Wc,"jq");a(WKi,"EM");vWc=a(()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${us(o.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=WKi(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=WKi(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${o.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0438":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${o.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"nu");a(CWc,"Aq");bWc=a(()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(o))return"tabela";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return o=>{switch(o.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${o.expected}, prejeto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${us(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} imelo ${s}${o.maximum.toString()} ${c.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Premajhno: pri\u010Dakovano, da bo ${o.origin} imelo ${s}${o.minimum.toString()} ${c.unit}`:`Premajhno: pri\u010Dakovano, da bo ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${n[s.format]??o.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${o.divisor}`;case"unrecognized_keys":return`Neprepoznan${o.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${o.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${o.origin}`;default:return"Neveljaven vnos"}}},"ru");a(SWc,"Iq");TWc=a(()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"antal";case"object":{if(Array.isArray(o))return"lista";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return o=>{switch(o.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${o.expected}, fick ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${us(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`F\xF6r stor(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()} ${c.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()} ${c.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${s.includes}"`:s.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${s.pattern}"`:`Ogiltig(t) ${n[s.format]??o.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${o.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${o.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"ou");a(IWc,"Rq");xWc=a(()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(o))return"\u0B85\u0BA3\u0BBF";if(o===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${us(o.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Vr(o.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} ${c.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} ${c.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${s.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${o.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${o.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"tu");a(wWc,"Pq");RWc=a(()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(o))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(o===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return o=>{switch(o.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${us(o.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()} ${c.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()} ${c.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${s.prefix}"`:s.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${s.suffix}"`:s.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${s.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:s.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${s.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${o.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${Vr(o.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"au");a(kWc,"Eq");PWc=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"su"),DWc=a(()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return n=>{switch(n.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${n.expected}, al\u0131nan ${PWc(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${us(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${Vr(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${Vr(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"eu");a(NWc,"bq");MWc=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${us(o.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} \u0431\u0443\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0456":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${o.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"$m");a(OWc,"_q");LWc=a(()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(o))return"\u0622\u0631\u06D2";if(o===null)return"\u0646\u0644";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return o=>{switch(o.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${r(o.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return o.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${us(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${Vr(o.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${s}${o.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u06D2 ${s}${o.minimum.toString()} ${c.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u0627 ${s}${o.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${s.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${o.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${o.keys.length>1?"\u0632":""}: ${Vr(o.keys,"\u060C ")}`;case"invalid_key":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"Qm");a(BWc,"kq");FWc=a(()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(o))return"m\u1EA3ng";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return o=>{switch(o.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${us(o.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${s.prefix}"`:s.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${s.suffix}"`:s.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${s.includes}"`:s.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${s.pattern}`:`${n[s.format]??o.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${o.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${Vr(o.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"Jm");a(UWc,"Sq");QWc=a(()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(o))return"\u6570\u7EC4";if(o===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${us(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()} ${c.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.prefix}" \u5F00\u5934`:s.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.suffix}" \u7ED3\u5C3E`:s.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${s.pattern}`:`\u65E0\u6548${n[s.format]??o.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${o.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${Vr(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${o.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"Xm");a(qWc,"vq");jWc=a(()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o.expected}\uFF0C\u4F46\u6536\u5230 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${us(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()} ${c.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()} ${c.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.prefix}" \u958B\u982D`:s.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.suffix}" \u7D50\u5C3E`:s.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${s.pattern}`:`\u7121\u6548\u7684 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${o.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${o.keys.length>1?"\u5011":""}\uFF1A${Vr(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"Ym");a(HWc,"Cq");hro=Symbol("ZodOutput"),mro=Symbol("ZodInput"),I8e=class{static{a(this,"I7")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];if(this._map.set(e,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};a(E9r,"R7");V9=E9r();a(gro,"aY");a(Aro,"Tq");a(_9r,"P7");a(jxt,"o8");a(v9r,"E7");a(C9r,"b7");a(b9r,"_7");a(S9r,"k7");a(T9r,"S7");a(I9r,"v7");a(x9r,"C7");a(w9r,"T7");a(R9r,"x7");a(k9r,"y7");a(P9r,"f7");a(D9r,"g7");a(N9r,"h7");a(M9r,"u7");a(O9r,"m7");a(L9r,"l7");a(B9r,"c7");a(F9r,"p7");a(U9r,"d7");a(Q9r,"i7");yro={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};a(Ero,"xq");a(_ro,"yq");a(vro,"fq");a(Cro,"gq");a(bro,"eY");a(Sro,"hq");a(Tro,"$3");a(Iro,"Q3");a(xro,"J3");a(wro,"X3");a(Rro,"Y3");a(kro,"W3");a(Pro,"uq");a(Dro,"G3");a(Nro,"mq");a(Mro,"U3");a(Oro,"H3");a(Lro,"K3");a(Bro,"q3");a(Fro,"V3");a(Uro,"B3");a(Hxt,"b0");a(Qro,"z3");a(qro,"N3");a(jro,"w3");a(Hro,"lq");a(Gro,"O3");a(noe,"o4");a(FN,"t6");a(ioe,"t4");a(RI,"P6");a($ro,"cq");a(Vro,"pq");a(Wro,"dq");a(zro,"iq");a(x8e,"_0");a(Owt,"t8");a(w8e,"k0");a(q9r,"n7");a(Lwt,"a8");a(kve,"k1");a(Bwt,"s8");a(j9r,"r7");a(H9r,"o7");a(G9r,"t7");a($9r,"a7");a(V9r,"s7");a(W9r,"e7");a(Yro,"nq");a(z9r,"$J");a(loe,"a4");a(Y9r,"QJ");a(K9r,"JJ");a(J9r,"XJ");a(Z9r,"YJ");a(X9r,"WJ");a(GWc,"Wm");a($Wc,"Gm");a(VWc,"Um");a(Kro,"rq");a(WWc,"Hm");a(zWc,"Km");a(YWc,"qm");a(KWc,"Vm");a(JWc,"Bm");a(ZWc,"zm");a(Jro,"D3");a(XWc,"Nm");a(ezc,"wm");a(tzc,"Om");a(rzc,"Dm");a(nzc,"Fm");a(izc,"Zm");a(ozc,"Mm");a(szc,"Lm");a(azc,"jm");a(czc,"Am");a(lzc,"Im");a(uzc,"Rm");a(Zro,"F3");a(Xro,"Z3");a(eno,"M3");a(tno,"L3");Gxt=class{static{a(this,"oq")}constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!="function")throw Error("implement() must be called with a function");let r=a((...n)=>{let o=this._def.input?Fxt(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw Error("Invalid arguments schema: not an array or tuple schema.");let s=e(...o);return this._def.output?Fxt(this._def.output,s,void 0,{callee:r}):s},"Q");return r}implementAsync(e){if(typeof e!="function")throw Error("implement() must be called with a function");let r=a(async(...n)=>{let o=this._def.input?await Uxt(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw Error("Invalid arguments schema: not an array or tuple schema.");let s=await e(...o);return this._def.output?Uxt(this._def.output,s,void 0,{callee:r}):s},"Q");return r}input(...e){let r=this.constructor;return Array.isArray(e[0])?new r({type:"function",input:new Mwt({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output}):new r({type:"function",input:e[0],output:this._def.output})}output(e){return new this.constructor({type:"function",input:this._def.input,output:e})}};a(rno,"j3");R8e=class{static{a(this,"A3")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??V9,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,s={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},c=this.seen.get(e);if(c)return c.count++,r.schemaPath.includes(e)&&(c.cycle=r.path),c.schema;let l={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(e,l);let u=e._zod.toJSONSchema?.();if(u)l.schema=u;else{let f={...r,schemaPath:[...r.schemaPath,e],path:r.path},h=e._zod.parent;if(h)l.ref=h,this.process(h,f),this.seen.get(h).isParent=!0;else{let m=l.schema;switch(o.type){case"string":{let g=m;g.type="string";let{minimum:A,maximum:y,format:E,patterns:_,contentEncoding:v}=e._zod.bag;if(typeof A=="number"&&(g.minLength=A),typeof y=="number"&&(g.maxLength=y),E&&(g.format=s[E]??E,g.format===""&&delete g.format),v&&(g.contentEncoding=v),_&&_.size>0){let b=[..._];b.length===1?g.pattern=b[0].source:b.length>1&&(l.schema.allOf=[...b.map(T=>({...this.target==="draft-7"?{type:"string"}:{},pattern:T.source}))])}break}case"number":{let g=m,{minimum:A,maximum:y,format:E,multipleOf:_,exclusiveMaximum:v,exclusiveMinimum:b}=e._zod.bag;typeof E=="string"&&E.includes("int")?g.type="integer":g.type="number",typeof b=="number"&&(g.exclusiveMinimum=b),typeof A=="number"&&(g.minimum=A,typeof b=="number"&&(b>=A?delete g.minimum:delete g.exclusiveMinimum)),typeof v=="number"&&(g.exclusiveMaximum=v),typeof y=="number"&&(g.maximum=y,typeof v=="number"&&(v<=y?delete g.maximum:delete g.exclusiveMaximum)),typeof _=="number"&&(g.multipleOf=_);break}case"boolean":{let g=m;g.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{m.type="null";break}case"any":break;case"unknown":break;case"undefined":case"never":{m.not={};break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let g=m,{minimum:A,maximum:y}=e._zod.bag;typeof A=="number"&&(g.minItems=A),typeof y=="number"&&(g.maxItems=y),g.type="array",g.items=this.process(o.element,{...f,path:[...f.path,"items"]});break}case"object":{let g=m;g.type="object",g.properties={};let A=o.shape;for(let _ in A)g.properties[_]=this.process(A[_],{...f,path:[...f.path,"properties",_]});let y=new Set(Object.keys(A)),E=new Set([...y].filter(_=>{let v=o.shape[_]._zod;return this.io==="input"?v.optin===void 0:v.optout===void 0}));E.size>0&&(g.required=Array.from(E)),o.catchall?._zod.def.type==="never"?g.additionalProperties=!1:o.catchall?o.catchall&&(g.additionalProperties=this.process(o.catchall,{...f,path:[...f.path,"additionalProperties"]})):this.io==="output"&&(g.additionalProperties=!1);break}case"union":{let g=m;g.anyOf=o.options.map((A,y)=>this.process(A,{...f,path:[...f.path,"anyOf",y]}));break}case"intersection":{let g=m,A=this.process(o.left,{...f,path:[...f.path,"allOf",0]}),y=this.process(o.right,{...f,path:[...f.path,"allOf",1]}),E=a(v=>"allOf"in v&&Object.keys(v).length===1,"D"),_=[...E(A)?A.allOf:[A],...E(y)?y.allOf:[y]];g.allOf=_;break}case"tuple":{let g=m;g.type="array";let A=o.items.map((_,v)=>this.process(_,{...f,path:[...f.path,"prefixItems",v]}));if(this.target==="draft-2020-12"?g.prefixItems=A:g.items=A,o.rest){let _=this.process(o.rest,{...f,path:[...f.path,"items"]});this.target==="draft-2020-12"?g.items=_:g.additionalItems=_}o.rest&&(g.items=this.process(o.rest,{...f,path:[...f.path,"items"]}));let{minimum:y,maximum:E}=e._zod.bag;typeof y=="number"&&(g.minItems=y),typeof E=="number"&&(g.maxItems=E);break}case"record":{let g=m;g.type="object",g.propertyNames=this.process(o.keyType,{...f,path:[...f.path,"propertyNames"]}),g.additionalProperties=this.process(o.valueType,{...f,path:[...f.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let g=m,A=Y6r(o.entries);A.every(y=>typeof y=="number")&&(g.type="number"),A.every(y=>typeof y=="string")&&(g.type="string"),g.enum=A;break}case"literal":{let g=m,A=[];for(let y of o.values)if(y===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof y=="bigint"){if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");A.push(Number(y))}else A.push(y);if(A.length!==0)if(A.length===1){let y=A[0];g.type=y===null?"null":typeof y,g.const=y}else A.every(y=>typeof y=="number")&&(g.type="number"),A.every(y=>typeof y=="string")&&(g.type="string"),A.every(y=>typeof y=="boolean")&&(g.type="string"),A.every(y=>y===null)&&(g.type="null"),g.enum=A;break}case"file":{let g=m,A={type:"string",format:"binary",contentEncoding:"binary"},{minimum:y,maximum:E,mime:_}=e._zod.bag;y!==void 0&&(A.minLength=y),E!==void 0&&(A.maxLength=E),_?_.length===1?(A.contentMediaType=_[0],Object.assign(g,A)):g.anyOf=_.map(v=>({...A,contentMediaType:v})):Object.assign(g,A);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let g=this.process(o.innerType,f);m.anyOf=[g,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,f),l.ref=o.innerType;break}case"success":{let g=m;g.type="boolean";break}case"default":{this.process(o.innerType,f),l.ref=o.innerType,m.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,f),l.ref=o.innerType,this.io==="input"&&(m._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,f),l.ref=o.innerType;let g;try{g=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}m.default=g;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let g=m,A=e._zod.pattern;if(!A)throw Error("Pattern not found in template literal");g.type="string",g.pattern=A.source;break}case"pipe":{let g=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(g,f),l.ref=g;break}case"readonly":{this.process(o.innerType,f),l.ref=o.innerType,m.readOnly=!0;break}case"promise":{this.process(o.innerType,f),l.ref=o.innerType;break}case"optional":{this.process(o.innerType,f),l.ref=o.innerType;break}case"lazy":{let g=e._zod.innerType;this.process(g,f),l.ref=g;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let d=this.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),this.io==="input"&&q0(e)&&(delete l.schema.examples,delete l.schema.default),this.io==="input"&&l.schema._prefault&&((n=l.schema).default??(n.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(e).schema}emit(e,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(e);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");let s=a(f=>{let h=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let A=n.external.registry.get(f[0])?.id;if(A)return{ref:n.external.uri(A)};let y=f[1].defId??f[1].schema.id??`schema${this.counter++}`;return f[1].defId=y,{defId:y,ref:`${n.external.uri("__shared")}#/${h}/${y}`}}if(f[1]===o)return{ref:"#"};let m=`#/${h}/`,g=f[1].schema.id??`__schema${this.counter++}`;return{defId:g,ref:m+g}},"X"),c=a(f=>{if(f[1].schema.$ref)return;let h=f[1],{ref:m,defId:g}=s(f);h.def={...h.schema},g&&(h.defId=g);let A=h.schema;for(let y in A)delete A[y];A.$ref=m},"W");for(let f of this.seen.entries()){let h=f[1];if(e===f[0]){c(f);continue}if(n.external){let m=n.external.registry.get(f[0])?.id;if(e!==f[0]&&m){c(f);continue}}if(this.metadataRegistry.get(f[0])?.id){c(f);continue}if(h.cycle){if(n.cycles==="throw")throw Error(`Cycle detected: #/${h.cycle?.join("/")}/ + path: iss.path ? [${Cve(_)}, ...iss.path] : [${Cve(_)}] + })));`),h.write(`newResult[${Cve(_)}] = ${v}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let E=h.compile();return(_,v)=>E(f,_,v)},"Y"),o,s=Y8e,c=!swt.jitless,l=c&&nro.value,u=e.catchall,d;t._zod.parse=(f,h)=>{d??(d=r.value);let m=f.value;if(!s(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),f;let g=[];if(c&&l&&h?.async===!1&&h.jitless!==!0)o||(o=n(e.shape)),f=o(f,h);else{f.value={};let v=d.shape;for(let b of d.keys){let T=v[b],w=T._zod.run({value:m[b],issues:[]},h),R=T._zod.optin==="optional"&&T._zod.optout==="optional";w instanceof Promise?g.push(w.then(x=>R?OZi(x,f,b,m):sxt(x,f,b))):R?OZi(w,f,b,m):sxt(w,f,b)}}if(!u)return g.length?Promise.all(g).then(()=>f):f;let A=[],y=d.keySet,E=u._zod,_=E.def.type;for(let v of Object.keys(m)){if(y.has(v))continue;if(_==="never"){A.push(v);continue}let b=E.run({value:m[v],issues:[]},h);b instanceof Promise?g.push(b.then(T=>sxt(T,f,v))):sxt(b,f,v)}return A.length&&f.issues.push({code:"unrecognized_keys",keys:A,input:m,inst:t}),g.length?Promise.all(g).then(()=>f):f}});a(LZi,"NM");_Ur=pt("$ZodUnion",(t,e)=>{Co.init(t,e),Kc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Kc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Kc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),Kc(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){let r=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>Xwt(n.source)).join("|")})$`)}}),t._zod.parse=(r,n)=>{let o=!1,s=[];for(let c of e.options){let l=c._zod.run({value:r.value,issues:[]},n);if(l instanceof Promise)s.push(l),o=!0;else{if(l.issues.length===0)return l;s.push(l)}}return o?Promise.all(s).then(c=>LZi(c,r,t,n)):LZi(s,r,t,n)}}),$no=pt("$ZodDiscriminatedUnion",(t,e)=>{_Ur.init(t,e);let r=t._zod.parse;Kc(t._zod,"propValues",()=>{let o={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[l,u]of Object.entries(c)){o[l]||(o[l]=new Set);for(let d of u)o[l].add(d)}}return o});let n=Zwt(()=>{let o=e.options,s=new Map;for(let c of o){let l=c._zod.propValues[e.discriminator];if(!l||l.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let u of l){if(s.has(u))throw Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,c)}}return s});t._zod.parse=(o,s)=>{let c=o.value;if(!Y8e(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),o;let l=n.value.get(c?.[e.discriminator]);return l?l._zod.run(o,s):e.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:c,path:[e.discriminator],inst:t}),o)}}),Vno=pt("$ZodIntersection",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),c=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||c instanceof Promise?Promise.all([s,c]).then(([l,u])=>BZi(r,l,u)):BZi(r,s,c)}});a(H6r,"pK");a(BZi,"wM");iRt=pt("$ZodTuple",(t,e)=>{Co.init(t,e);let r=e.items,n=r.length-[...r].reverse().findIndex(o=>o._zod.optin!=="optional");t._zod.parse=(o,s)=>{let c=o.value;if(!Array.isArray(c))return o.issues.push({input:c,inst:t,expected:"tuple",code:"invalid_type"}),o;o.value=[];let l=[];if(!e.rest){let d=c.length>r.length,f=c.length=c.length&&u>=n)continue;let f=d._zod.run({value:c[u],issues:[]},s);f instanceof Promise?l.push(f.then(h=>axt(h,o,u))):axt(f,o,u)}if(e.rest){let d=c.slice(r.length);for(let f of d){u++;let h=e.rest._zod.run({value:f,issues:[]},s);h instanceof Promise?l.push(h.then(m=>axt(m,o,u))):axt(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});a(axt,"sX");Wno=pt("$ZodRecord",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!K8e(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[];if(e.keyType._zod.values){let c=e.keyType._zod.values;r.value={};for(let u of c)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let d=e.valueType._zod.run({value:o[u],issues:[]},n);d instanceof Promise?s.push(d.then(f=>{f.issues.length&&r.issues.push(...Ik(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...Ik(u,d.issues)),r.value[u]=d.value)}let l;for(let u in o)c.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:l})}else{r.value={};for(let c of Reflect.ownKeys(o)){if(c==="__proto__")continue;let l=e.keyType._zod.run({value:c,issues:[]},n);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:l.issues.map(d=>YN(d,n,rC())),input:c,path:[c],inst:t}),r.value[l.value]=l.value;continue}let u=e.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?s.push(u.then(d=>{d.issues.length&&r.issues.push(...Ik(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...Ik(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),zno=pt("$ZodMap",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:t}),r;let s=[];r.value=new Map;for(let[c,l]of o){let u=e.keyType._zod.run({value:c,issues:[]},n),d=e.valueType._zod.run({value:l,issues:[]},n);u instanceof Promise||d instanceof Promise?s.push(Promise.all([u,d]).then(([f,h])=>{FZi(f,h,r,c,o,t,n)})):FZi(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});a(FZi,"OM");Yno=pt("$ZodSet",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:t,expected:"set",code:"invalid_type"}),r;let s=[];r.value=new Set;for(let c of o){let l=e.valueType._zod.run({value:c,issues:[]},n);l instanceof Promise?s.push(l.then(u=>UZi(u,r))):UZi(l,r)}return s.length?Promise.all(s).then(()=>r):r}});a(UZi,"DM");Kno=pt("$ZodEnum",(t,e)=>{Co.init(t,e);let r=eUr(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>awt.has(typeof n)).map(n=>typeof n=="string"?yoe(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return t._zod.values.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),Jno=pt("$ZodLiteral",(t,e)=>{Co.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?yoe(r):r?r.toString():String(r)).join("|")})$`),t._zod.parse=(r,n)=>{let o=r.value;return t._zod.values.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),r}}),Zno=pt("$ZodFile",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:t}),r}}),vUr=pt("$ZodTransform",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new SW;return r.value=o,r}}),Xno=pt("$ZodOptional",(t,e)=>{Co.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Kc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Kc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Xwt(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(r,n):r.value===void 0?r:e.innerType._zod.run(r,n)}),eio=pt("$ZodNullable",(t,e)=>{Co.init(t,e),Kc(t._zod,"optin",()=>e.innerType._zod.optin),Kc(t._zod,"optout",()=>e.innerType._zod.optout),Kc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Xwt(r.source)}|null)$`):void 0}),Kc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),tio=pt("$ZodDefault",(t,e)=>{Co.init(t,e),t._zod.optin="optional",Kc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>QZi(s,e)):QZi(o,e)}});a(QZi,"FM");rio=pt("$ZodPrefault",(t,e)=>{Co.init(t,e),t._zod.optin="optional",Kc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),nio=pt("$ZodNonOptional",(t,e)=>{Co.init(t,e),Kc(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>qZi(s,t)):qZi(o,t)}});a(qZi,"ZM");iio=pt("$ZodSuccess",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.issues.length===0,r)):(r.value=o.issues.length===0,r)}}),oio=pt("$ZodCatch",(t,e)=>{Co.init(t,e),t._zod.optin="optional",Kc(t._zod,"optout",()=>e.innerType._zod.optout),Kc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(c=>YN(c,n,rC()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>YN(s,n,rC()))},input:r.value}),r.issues=[]),r)}}),sio=pt("$ZodNaN",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),CUr=pt("$ZodPipe",(t,e)=>{Co.init(t,e),Kc(t._zod,"values",()=>e.in._zod.values),Kc(t._zod,"optin",()=>e.in._zod.optin),Kc(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(r,n)=>{let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>jZi(s,e,n)):jZi(o,e,n)}});a(jZi,"MM");aio=pt("$ZodReadonly",(t,e)=>{Co.init(t,e),Kc(t._zod,"propValues",()=>e.innerType._zod.propValues),Kc(t._zod,"values",()=>e.innerType._zod.values),Kc(t._zod,"optin",()=>e.innerType._zod.optin),Kc(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(HZi):HZi(o)}});a(HZi,"LM");cio=pt("$ZodTemplateLiteral",(t,e)=>{Co.init(t,e);let r=[];for(let n of e.parts)if(n instanceof Co){if(!n._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let o=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!o)throw Error(`Invalid template literal part: ${n._zod.traits}`);let s=o.startsWith("^")?1:0,c=o.endsWith("$")?o.length-1:o.length;r.push(o.slice(s,c))}else if(n===null||iro.has(typeof n))r.push(yoe(`${n}`));else throw Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"template_literal",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:"template_literal",pattern:t._zod.pattern.source}),n)}),lio=pt("$ZodPromise",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),uio=pt("$ZodLazy",(t,e)=>{Co.init(t,e),Kc(t._zod,"innerType",()=>e.getter()),Kc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),Kc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),Kc(t._zod,"optin",()=>t._zod.innerType._zod.optin),Kc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),dio=pt("$ZodCustom",(t,e)=>{xh.init(t,e),Co.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>GZi(s,r,n,t));GZi(o,r,n,t)}});a(GZi,"jM");bUr={};ZL(bUr,{zhTW:a(()=>MKc,"zhTW"),zhCN:a(()=>DKc,"zhCN"),vi:a(()=>kKc,"vi"),ur:a(()=>wKc,"ur"),ua:a(()=>IKc,"ua"),tr:a(()=>SKc,"tr"),th:a(()=>vKc,"th"),ta:a(()=>EKc,"ta"),sv:a(()=>AKc,"sv"),sl:a(()=>mKc,"sl"),ru:a(()=>pKc,"ru"),pt:a(()=>dKc,"pt"),ps:a(()=>aKc,"ps"),pl:a(()=>lKc,"pl"),ota:a(()=>oKc,"ota"),no:a(()=>nKc,"no"),nl:a(()=>tKc,"nl"),ms:a(()=>XYc,"ms"),mk:a(()=>JYc,"mk"),ko:a(()=>YYc,"ko"),kh:a(()=>WYc,"kh"),ja:a(()=>$Yc,"ja"),it:a(()=>HYc,"it"),id:a(()=>qYc,"id"),hu:a(()=>UYc,"hu"),he:a(()=>BYc,"he"),frCA:a(()=>OYc,"frCA"),fr:a(()=>NYc,"fr"),fi:a(()=>PYc,"fi"),fa:a(()=>RYc,"fa"),es:a(()=>xYc,"es"),eo:a(()=>TYc,"eo"),en:a(()=>fio,"en"),de:a(()=>_Yc,"de"),cs:a(()=>yYc,"cs"),ca:a(()=>gYc,"ca"),be:a(()=>hYc,"be"),az:a(()=>fYc,"az"),ar:a(()=>uYc,"ar")});lYc=a(()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return o=>{switch(o.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${ls(o.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()} ${c.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${o.prefix}"`:s.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${s.suffix}"`:s.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${s.includes}"`:s.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${s.pattern}`:`${n[s.format]??o.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${o.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${o.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${o.keys.length>1?"\u0629":""}: ${Vr(o.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"Du");a(uYc,"tK");dYc=a(()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o.expected}, daxil olan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${ls(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()} ${c.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${s.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:s.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${s.suffix}" il\u0259 bitm\u0259lidir`:s.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${s.includes}" daxil olmal\u0131d\u0131r`:s.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${s.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[s.format]??o.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${o.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${o.keys.length>1?"lar":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`${o.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${o.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"Fu");a(fYc,"aK");a($Zi,"PM");pYc=a(()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0456\u045E";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${ls(o.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=$Zi(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=$Zi(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${o.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${o.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"Zu");a(hYc,"sK");mYc=a(()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${o.expected}, s'ha rebut ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Valor inv\xE0lid: s'esperava ${ls(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${Vr(o.values," o ")}`;case"too_big":{let s=o.inclusive?"com a m\xE0xim":"menys de",c=e(o.origin);return c?`Massa gran: s'esperava que ${o.origin??"el valor"} contingu\xE9s ${s} ${o.maximum.toString()} ${c.unit??"elements"}`:`Massa gran: s'esperava que ${o.origin??"el valor"} fos ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"com a m\xEDnim":"m\xE9s de",c=e(o.origin);return c?`Massa petit: s'esperava que ${o.origin} contingu\xE9s ${s} ${o.minimum.toString()} ${c.unit}`:`Massa petit: s'esperava que ${o.origin} fos ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${s.prefix}"`:s.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format inv\xE0lid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${s.pattern}`:`Format inv\xE0lid per a ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${o.divisor}`;case"unrecognized_keys":return`Clau${o.keys.length>1?"s":""} no reconeguda${o.keys.length>1?"s":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${o.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${o.origin}`;default:return"Entrada inv\xE0lida"}}},"Mu");a(gYc,"eK");AYc=a(()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(o))return"pole";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return o=>{switch(o.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o.expected}, obdr\u017Eeno ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${ls(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.maximum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.minimum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${s.prefix}"`:s.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${s.suffix}"`:s.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${s.includes}"`:s.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${s.pattern}`:`Neplatn\xFD form\xE1t ${n[s.format]??o.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${o.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${Vr(o.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${o.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${o.origin}`;default:return"Neplatn\xFD vstup"}}},"Lu");a(yYc,"$q");EYc=a(()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"Zahl";case"object":{if(Array.isArray(o))return"Array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return o=>{switch(o.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${o.expected}, erhalten ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ung\xFCltige Eingabe: erwartet ${ls(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ${c.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ist`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ${c.unit} hat`:`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ist`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ung\xFCltiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ung\xFCltiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ung\xFCltiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${s.pattern} entsprechen`:`Ung\xFCltig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${o.divisor} sein`;case"unrecognized_keys":return`${o.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${o.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${o.origin}`;default:return"Ung\xFCltige Eingabe"}}},"ju");a(_Yc,"Qq");vYc=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"Au"),CYc=a(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${vYc(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${ls(n.values[0])}`:`Invalid option: expected one of ${Vr(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Vr(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}},"Iu");a(fio,"A7");bYc=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"nombro";case"object":{if(Array.isArray(t))return"tabelo";if(t===null)return"senvalora";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"Ru"),SYc=a(()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return n=>{switch(n.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${n.expected}, ricevi\u011Dis ${bYc(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${ls(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${Vr(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${Vr(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}},"Pu");a(TYc,"Jq");IYc=a(()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"arreglo";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype)return o.constructor.name}}return s},"J"),n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${o.expected}, recibido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: se esperaba ${ls(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Demasiado grande: se esperaba que ${o.origin??"valor"} tuviera ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: se esperaba que ${o.origin??"valor"} fuera ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Demasiado peque\xF1o: se esperaba que ${o.origin} tuviera ${s}${o.minimum.toString()} ${c.unit}`:`Demasiado peque\xF1o: se esperaba que ${o.origin} fuera ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Llave${o.keys.length>1?"s":""} desconocida${o.keys.length>1?"s":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o.origin}`;default:return"Entrada inv\xE1lida"}}},"Eu");a(xYc,"Xq");wYc=a(()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0622\u0631\u0627\u06CC\u0647";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return o=>{switch(o.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${r(o.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return o.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${ls(o.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${Vr(o.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:s.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:s.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${s.includes}" \u0628\u0627\u0634\u062F`:s.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${s.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[s.format]??o.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${o.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${o.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${Vr(o.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${o.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${o.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"bu");a(RYc,"Yq");kYc=a(()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return o=>{switch(o.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${o.expected}, oli ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${ls(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Liian suuri: ${c.subject} t\xE4ytyy olla ${s}${o.maximum.toString()} ${c.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Liian pieni: ${c.subject} t\xE4ytyy olla ${s}${o.minimum.toString()} ${c.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${s.includes}"`:s.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${s.pattern}`:`Virheellinen ${n[s.format]??o.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${o.divisor} monikerta`;case"unrecognized_keys":return`${o.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${Vr(o.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"_u");a(PYc,"Wq");DYc=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombre";case"object":{if(Array.isArray(o))return"tableau";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : ${o.expected} attendu, ${r(o.input)} re\xE7u`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : ${ls(o.values[0])} attendu`:`Option invalide : une valeur parmi ${Vr(o.values,"|")} attendue`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Trop grand : ${o.origin??"valeur"} doit ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o.origin??"valeur"} doit \xEAtre ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Trop petit : ${o.origin} doit ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : ${o.origin} doit \xEAtre ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${Vr(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"ku");a(NYc,"Gq");MYc=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${o.expected}, re\xE7u ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : attendu ${ls(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u2264":"<",c=e(o.origin);return c?`Trop grand : attendu que ${o.origin??"la valeur"} ait ${s}${o.maximum.toString()} ${c.unit}`:`Trop grand : attendu que ${o.origin??"la valeur"} soit ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u2265":">",c=e(o.origin);return c?`Trop petit : attendu que ${o.origin} ait ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : attendu que ${o.origin} soit ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${Vr(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"Su");a(OYc,"Uq");LYc=a(()=>{let t={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return o=>{switch(o.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${o.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${ls(o.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()} ${c.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()} ${c.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${s.prefix}"`:s.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${s.suffix}"`:s.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${s.includes}"`:s.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${s.pattern}`:`${n[s.format]??o.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${o.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${o.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${o.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"vu");a(BYc,"Hq");FYc=a(()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(o))return"t\xF6mb";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return o=>{switch(o.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o.expected}, a kapott \xE9rt\xE9k ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${ls(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`T\xFAl nagy: ${o.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${s}${o.maximum.toString()} ${c.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${o.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} m\xE9rete t\xFAl kicsi ${s}${o.minimum.toString()} ${c.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} t\xFAl kicsi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\xC9rv\xE9nytelen string: "${s.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:s.format==="ends_with"?`\xC9rv\xE9nytelen string: "${s.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:s.format==="includes"?`\xC9rv\xE9nytelen string: "${s.includes}" \xE9rt\xE9ket kell tartalmaznia`:s.format==="regex"?`\xC9rv\xE9nytelen string: ${s.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[s.format]??o.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${o.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${o.keys.length>1?"s":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${o.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${o.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"Cu");a(UYc,"Kq");QYc=a(()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak valid: diharapkan ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak valid: diharapkan ${ls(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: diharapkan ${o.origin??"value"} memiliki ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: diharapkan ${o.origin??"value"} menjadi ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: diharapkan ${o.origin} memiliki ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: diharapkan ${o.origin} menjadi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${n[s.format]??o.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${o.keys.length>1?"s":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${o.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${o.origin}`;default:return"Input tidak valid"}}},"Tu");a(qYc,"qq");jYc=a(()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numero";case"object":{if(Array.isArray(o))return"vettore";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input non valido: atteso ${o.expected}, ricevuto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input non valido: atteso ${ls(o.values[0])}`:`Opzione non valida: atteso uno tra ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Troppo grande: ${o.origin??"valore"} deve avere ${s}${o.maximum.toString()} ${c.unit??"elementi"}`:`Troppo grande: ${o.origin??"valore"} deve essere ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Troppo piccolo: ${o.origin} deve avere ${s}${o.minimum.toString()} ${c.unit}`:`Troppo piccolo: ${o.origin} deve essere ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${o.divisor}`;case"unrecognized_keys":return`Chiav${o.keys.length>1?"i":"e"} non riconosciut${o.keys.length>1?"e":"a"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${o.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${o.origin}`;default:return"Input non valido"}}},"xu");a(HYc,"Vq");GYc=a(()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(o))return"\u914D\u5217";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${o.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${r(o.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return o.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${ls(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${Vr(o.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let s=o.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",c=e(o.origin);return c?`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${c.unit??"\u8981\u7D20"}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let s=o.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",c=e(o.origin);return c?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${c.unit}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${s.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${o.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${o.keys.length>1?"\u7FA4":""}: ${Vr(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"yu");a($Yc,"Bq");VYc=a(()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(o))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(o===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return o=>{switch(o.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${ls(o.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()} ${c.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()} ${c.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${s.prefix}"`:s.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${s.suffix}"`:s.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${s.includes}"`:s.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${s.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${o.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${Vr(o.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"fu");a(WYc,"zq");zYc=a(()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return o=>{switch(o.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${r(o.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return o.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${ls(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${Vr(o.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let s=o.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",c=s==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()} ${s}${c}`}case"too_small":{let s=o.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",c=s==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()} ${s}${c}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:s.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${s.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[s.format]??o.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${o.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${Vr(o.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${o.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${o.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"gu");a(YYc,"Nq");KYc=a(()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(o))return"\u043D\u0438\u0437\u0430";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return o=>{switch(o.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${ls(o.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.minimum.toString()} ${c.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${o.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${o.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"hu");a(JYc,"wq");ZYc=a(()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombor";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak sah: dijangka ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak sah: dijangka ${ls(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: dijangka ${o.origin??"nilai"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: dijangka ${o.origin??"nilai"} adalah ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: dijangka ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: dijangka ${o.origin} adalah ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${n[s.format]??o.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${Vr(o.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${o.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${o.origin}`;default:return"Input tidak sah"}}},"uu");a(XYc,"Oq");eKc=a(()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"getal";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return o=>{switch(o.code){case"invalid_type":return`Ongeldige invoer: verwacht ${o.expected}, ontving ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ongeldige invoer: verwacht ${ls(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} ${c.unit??"elementen"} bevat`:`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} is`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} ${c.unit} bevat`:`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} is`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${o.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${o.keys.length>1?"s":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${o.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${o.origin}`;default:return"Ongeldige invoer"}}},"mu");a(tKc,"Dq");rKc=a(()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"tall";case"object":{if(Array.isArray(o))return"liste";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Ugyldig input: forventet ${o.expected}, fikk ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ugyldig verdi: forventet ${ls(o.values[0])}`:`Ugyldig valg: forventet en av ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()} ${c.unit??"elementer"}`:`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()} ${c.unit}`:`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${n[s.format]??o.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${o.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${o.origin}`;default:return"Ugyldig input"}}},"lu");a(nKc,"Fq");iKc=a(()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numara";case"object":{if(Array.isArray(o))return"saf";if(o===null)return"gayb";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return o=>{switch(o.code){case"invalid_type":return`F\xE2sit giren: umulan ${o.expected}, al\u0131nan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`F\xE2sit giren: umulan ${ls(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} ${c.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} ${c.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let s=o;return s.format==="starts_with"?`F\xE2sit metin: "${s.prefix}" ile ba\u015Flamal\u0131.`:s.format==="ends_with"?`F\xE2sit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`F\xE2sit metin: "${s.includes}" ihtiv\xE2 etmeli.`:s.format==="regex"?`F\xE2sit metin: ${s.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[s.format]??o.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${o.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${o.keys.length>1?"s":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${o.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"cu");a(oKc,"Zq");sKc=a(()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0627\u0631\u06D0";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return o=>{switch(o.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${r(o.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return o.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${ls(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${Vr(o.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0648\u064A`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0648\u064A`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:s.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:s.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${s.includes}" \u0648\u0644\u0631\u064A`:s.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${s.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[s.format]??o.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${o.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${o.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${o.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${o.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"pu");a(aKc,"Mq");cKc=a(()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"liczba";case"object":{if(Array.isArray(o))return"tablica";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return o=>{switch(o.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o.expected}, otrzymano ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${ls(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.maximum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.minimum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${s.prefix}"`:s.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${s.suffix}"`:s.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${s.includes}"`:s.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${s.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[s.format]??o.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${o.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${o.keys.length>1?"s":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${o.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${o.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"du");a(lKc,"Lq");uKc=a(()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"array";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${o.expected}, recebido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: esperado ${ls(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Muito grande: esperado que ${o.origin??"valor"} tivesse ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Muito grande: esperado que ${o.origin??"valor"} fosse ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Muito pequeno: esperado que ${o.origin} tivesse ${s}${o.minimum.toString()} ${c.unit}`:`Muito pequeno: esperado que ${o.origin} fosse ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`${n[s.format]??o.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Chave${o.keys.length>1?"s":""} desconhecida${o.keys.length>1?"s":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${o.origin}`;default:return"Campo inv\xE1lido"}}},"iu");a(dKc,"jq");a(VZi,"EM");fKc=a(()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${ls(o.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=VZi(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=VZi(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${o.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0438":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${o.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"nu");a(pKc,"Aq");hKc=a(()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(o))return"tabela";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return o=>{switch(o.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${o.expected}, prejeto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${ls(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} imelo ${s}${o.maximum.toString()} ${c.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Premajhno: pri\u010Dakovano, da bo ${o.origin} imelo ${s}${o.minimum.toString()} ${c.unit}`:`Premajhno: pri\u010Dakovano, da bo ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${n[s.format]??o.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${o.divisor}`;case"unrecognized_keys":return`Neprepoznan${o.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${o.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${o.origin}`;default:return"Neveljaven vnos"}}},"ru");a(mKc,"Iq");gKc=a(()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"antal";case"object":{if(Array.isArray(o))return"lista";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return o=>{switch(o.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${o.expected}, fick ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${ls(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`F\xF6r stor(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()} ${c.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()} ${c.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${s.includes}"`:s.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${s.pattern}"`:`Ogiltig(t) ${n[s.format]??o.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${Vr(o.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${o.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${o.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"ou");a(AKc,"Rq");yKc=a(()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(o))return"\u0B85\u0BA3\u0BBF";if(o===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${ls(o.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Vr(o.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} ${c.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} ${c.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${s.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${o.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${o.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"tu");a(EKc,"Pq");_Kc=a(()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(o))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(o===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return o=>{switch(o.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${ls(o.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()} ${c.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()} ${c.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${s.prefix}"`:s.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${s.suffix}"`:s.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${s.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:s.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${s.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${o.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${Vr(o.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"au");a(vKc,"Eq");CKc=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"su"),bKc=a(()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return n=>{switch(n.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${n.expected}, al\u0131nan ${CKc(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${ls(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${Vr(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${Vr(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"eu");a(SKc,"bq");TKc=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${ls(o.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} \u0431\u0443\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0456":""}: ${Vr(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${o.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"$m");a(IKc,"_q");xKc=a(()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(o))return"\u0622\u0631\u06D2";if(o===null)return"\u0646\u0644";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return o=>{switch(o.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${r(o.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return o.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${ls(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${Vr(o.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${s}${o.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u06D2 ${s}${o.minimum.toString()} ${c.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u0627 ${s}${o.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${s.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${o.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${o.keys.length>1?"\u0632":""}: ${Vr(o.keys,"\u060C ")}`;case"invalid_key":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"Qm");a(wKc,"kq");RKc=a(()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(o))return"m\u1EA3ng";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return o=>{switch(o.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${ls(o.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${s.prefix}"`:s.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${s.suffix}"`:s.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${s.includes}"`:s.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${s.pattern}`:`${n[s.format]??o.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${o.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${Vr(o.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"Jm");a(kKc,"Sq");PKc=a(()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(o))return"\u6570\u7EC4";if(o===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${ls(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()} ${c.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.prefix}" \u5F00\u5934`:s.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.suffix}" \u7ED3\u5C3E`:s.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${s.pattern}`:`\u65E0\u6548${n[s.format]??o.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${o.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${Vr(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${o.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"Xm");a(DKc,"vq");NKc=a(()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o.expected}\uFF0C\u4F46\u6536\u5230 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${ls(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${Vr(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()} ${c.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()} ${c.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.prefix}" \u958B\u982D`:s.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.suffix}" \u7D50\u5C3E`:s.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${s.pattern}`:`\u7121\u6548\u7684 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${o.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${o.keys.length>1?"\u5011":""}\uFF1A${Vr(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"Ym");a(MKc,"Cq");pio=Symbol("ZodOutput"),hio=Symbol("ZodInput"),J8e=class{static{a(this,"I7")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];if(this._map.set(e,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};a(SUr,"R7");iU=SUr();a(mio,"aY");a(gio,"Tq");a(TUr,"P7");a(fwt,"o8");a(IUr,"E7");a(xUr,"b7");a(wUr,"_7");a(RUr,"k7");a(kUr,"S7");a(PUr,"v7");a(DUr,"C7");a(NUr,"T7");a(MUr,"x7");a(OUr,"y7");a(LUr,"f7");a(BUr,"g7");a(FUr,"h7");a(UUr,"u7");a(QUr,"m7");a(qUr,"l7");a(jUr,"c7");a(HUr,"p7");a(GUr,"d7");a($Ur,"i7");Aio={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};a(yio,"xq");a(Eio,"yq");a(_io,"fq");a(vio,"gq");a(Cio,"eY");a(bio,"hq");a(Sio,"$3");a(Tio,"Q3");a(Iio,"J3");a(xio,"X3");a(wio,"Y3");a(Rio,"W3");a(kio,"uq");a(Pio,"G3");a(Dio,"mq");a(Nio,"U3");a(Mio,"H3");a(Oio,"K3");a(Lio,"q3");a(Bio,"V3");a(Fio,"B3");a(pwt,"b0");a(Uio,"z3");a(Qio,"N3");a(qio,"w3");a(jio,"lq");a(Hio,"O3");a(poe,"o4");a(VN,"t6");a(hoe,"t4");a(OI,"P6");a(Gio,"cq");a($io,"pq");a(Vio,"dq");a(Wio,"iq");a(Z8e,"_0");a(oRt,"t8");a(X8e,"k0");a(VUr,"n7");a(sRt,"a8");a(Kve,"k1");a(aRt,"s8");a(WUr,"r7");a(zUr,"o7");a(YUr,"t7");a(KUr,"a7");a(JUr,"s7");a(ZUr,"e7");a(zio,"nq");a(XUr,"$J");a(Eoe,"a4");a(e7r,"QJ");a(t7r,"JJ");a(r7r,"XJ");a(n7r,"YJ");a(i7r,"WJ");a(OKc,"Wm");a(LKc,"Gm");a(BKc,"Um");a(Yio,"rq");a(FKc,"Hm");a(UKc,"Km");a(QKc,"qm");a(qKc,"Vm");a(jKc,"Bm");a(HKc,"zm");a(Kio,"D3");a(GKc,"Nm");a($Kc,"wm");a(VKc,"Om");a(WKc,"Dm");a(zKc,"Fm");a(YKc,"Zm");a(KKc,"Mm");a(JKc,"Lm");a(ZKc,"jm");a(XKc,"Am");a(eJc,"Im");a(tJc,"Rm");a(Jio,"F3");a(Zio,"Z3");a(Xio,"M3");a(eoo,"L3");hwt=class{static{a(this,"oq")}constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!="function")throw Error("implement() must be called with a function");let r=a((...n)=>{let o=this._def.input?cwt(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw Error("Invalid arguments schema: not an array or tuple schema.");let s=e(...o);return this._def.output?cwt(this._def.output,s,void 0,{callee:r}):s},"Q");return r}implementAsync(e){if(typeof e!="function")throw Error("implement() must be called with a function");let r=a(async(...n)=>{let o=this._def.input?await lwt(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw Error("Invalid arguments schema: not an array or tuple schema.");let s=await e(...o);return this._def.output?lwt(this._def.output,s,void 0,{callee:r}):s},"Q");return r}input(...e){let r=this.constructor;return Array.isArray(e[0])?new r({type:"function",input:new iRt({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output}):new r({type:"function",input:e[0],output:this._def.output})}output(e){return new this.constructor({type:"function",input:this._def.input,output:e})}};a(too,"j3");e6e=class{static{a(this,"A3")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??iU,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,s={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},c=this.seen.get(e);if(c)return c.count++,r.schemaPath.includes(e)&&(c.cycle=r.path),c.schema;let l={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(e,l);let u=e._zod.toJSONSchema?.();if(u)l.schema=u;else{let f={...r,schemaPath:[...r.schemaPath,e],path:r.path},h=e._zod.parent;if(h)l.ref=h,this.process(h,f),this.seen.get(h).isParent=!0;else{let m=l.schema;switch(o.type){case"string":{let g=m;g.type="string";let{minimum:A,maximum:y,format:E,patterns:_,contentEncoding:v}=e._zod.bag;if(typeof A=="number"&&(g.minLength=A),typeof y=="number"&&(g.maxLength=y),E&&(g.format=s[E]??E,g.format===""&&delete g.format),v&&(g.contentEncoding=v),_&&_.size>0){let b=[..._];b.length===1?g.pattern=b[0].source:b.length>1&&(l.schema.allOf=[...b.map(T=>({...this.target==="draft-7"?{type:"string"}:{},pattern:T.source}))])}break}case"number":{let g=m,{minimum:A,maximum:y,format:E,multipleOf:_,exclusiveMaximum:v,exclusiveMinimum:b}=e._zod.bag;typeof E=="string"&&E.includes("int")?g.type="integer":g.type="number",typeof b=="number"&&(g.exclusiveMinimum=b),typeof A=="number"&&(g.minimum=A,typeof b=="number"&&(b>=A?delete g.minimum:delete g.exclusiveMinimum)),typeof v=="number"&&(g.exclusiveMaximum=v),typeof y=="number"&&(g.maximum=y,typeof v=="number"&&(v<=y?delete g.maximum:delete g.exclusiveMaximum)),typeof _=="number"&&(g.multipleOf=_);break}case"boolean":{let g=m;g.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{m.type="null";break}case"any":break;case"unknown":break;case"undefined":case"never":{m.not={};break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let g=m,{minimum:A,maximum:y}=e._zod.bag;typeof A=="number"&&(g.minItems=A),typeof y=="number"&&(g.maxItems=y),g.type="array",g.items=this.process(o.element,{...f,path:[...f.path,"items"]});break}case"object":{let g=m;g.type="object",g.properties={};let A=o.shape;for(let _ in A)g.properties[_]=this.process(A[_],{...f,path:[...f.path,"properties",_]});let y=new Set(Object.keys(A)),E=new Set([...y].filter(_=>{let v=o.shape[_]._zod;return this.io==="input"?v.optin===void 0:v.optout===void 0}));E.size>0&&(g.required=Array.from(E)),o.catchall?._zod.def.type==="never"?g.additionalProperties=!1:o.catchall?o.catchall&&(g.additionalProperties=this.process(o.catchall,{...f,path:[...f.path,"additionalProperties"]})):this.io==="output"&&(g.additionalProperties=!1);break}case"union":{let g=m;g.anyOf=o.options.map((A,y)=>this.process(A,{...f,path:[...f.path,"anyOf",y]}));break}case"intersection":{let g=m,A=this.process(o.left,{...f,path:[...f.path,"allOf",0]}),y=this.process(o.right,{...f,path:[...f.path,"allOf",1]}),E=a(v=>"allOf"in v&&Object.keys(v).length===1,"D"),_=[...E(A)?A.allOf:[A],...E(y)?y.allOf:[y]];g.allOf=_;break}case"tuple":{let g=m;g.type="array";let A=o.items.map((_,v)=>this.process(_,{...f,path:[...f.path,"prefixItems",v]}));if(this.target==="draft-2020-12"?g.prefixItems=A:g.items=A,o.rest){let _=this.process(o.rest,{...f,path:[...f.path,"items"]});this.target==="draft-2020-12"?g.items=_:g.additionalItems=_}o.rest&&(g.items=this.process(o.rest,{...f,path:[...f.path,"items"]}));let{minimum:y,maximum:E}=e._zod.bag;typeof y=="number"&&(g.minItems=y),typeof E=="number"&&(g.maxItems=E);break}case"record":{let g=m;g.type="object",g.propertyNames=this.process(o.keyType,{...f,path:[...f.path,"propertyNames"]}),g.additionalProperties=this.process(o.valueType,{...f,path:[...f.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let g=m,A=eUr(o.entries);A.every(y=>typeof y=="number")&&(g.type="number"),A.every(y=>typeof y=="string")&&(g.type="string"),g.enum=A;break}case"literal":{let g=m,A=[];for(let y of o.values)if(y===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof y=="bigint"){if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");A.push(Number(y))}else A.push(y);if(A.length!==0)if(A.length===1){let y=A[0];g.type=y===null?"null":typeof y,g.const=y}else A.every(y=>typeof y=="number")&&(g.type="number"),A.every(y=>typeof y=="string")&&(g.type="string"),A.every(y=>typeof y=="boolean")&&(g.type="string"),A.every(y=>y===null)&&(g.type="null"),g.enum=A;break}case"file":{let g=m,A={type:"string",format:"binary",contentEncoding:"binary"},{minimum:y,maximum:E,mime:_}=e._zod.bag;y!==void 0&&(A.minLength=y),E!==void 0&&(A.maxLength=E),_?_.length===1?(A.contentMediaType=_[0],Object.assign(g,A)):g.anyOf=_.map(v=>({...A,contentMediaType:v})):Object.assign(g,A);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let g=this.process(o.innerType,f);m.anyOf=[g,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,f),l.ref=o.innerType;break}case"success":{let g=m;g.type="boolean";break}case"default":{this.process(o.innerType,f),l.ref=o.innerType,m.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,f),l.ref=o.innerType,this.io==="input"&&(m._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,f),l.ref=o.innerType;let g;try{g=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}m.default=g;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let g=m,A=e._zod.pattern;if(!A)throw Error("Pattern not found in template literal");g.type="string",g.pattern=A.source;break}case"pipe":{let g=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(g,f),l.ref=g;break}case"readonly":{this.process(o.innerType,f),l.ref=o.innerType,m.readOnly=!0;break}case"promise":{this.process(o.innerType,f),l.ref=o.innerType;break}case"optional":{this.process(o.innerType,f),l.ref=o.innerType;break}case"lazy":{let g=e._zod.innerType;this.process(g,f),l.ref=g;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let d=this.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),this.io==="input"&&H0(e)&&(delete l.schema.examples,delete l.schema.default),this.io==="input"&&l.schema._prefault&&((n=l.schema).default??(n.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(e).schema}emit(e,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(e);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");let s=a(f=>{let h=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let A=n.external.registry.get(f[0])?.id;if(A)return{ref:n.external.uri(A)};let y=f[1].defId??f[1].schema.id??`schema${this.counter++}`;return f[1].defId=y,{defId:y,ref:`${n.external.uri("__shared")}#/${h}/${y}`}}if(f[1]===o)return{ref:"#"};let m=`#/${h}/`,g=f[1].schema.id??`__schema${this.counter++}`;return{defId:g,ref:m+g}},"X"),c=a(f=>{if(f[1].schema.$ref)return;let h=f[1],{ref:m,defId:g}=s(f);h.def={...h.schema},g&&(h.defId=g);let A=h.schema;for(let y in A)delete A[y];A.$ref=m},"W");for(let f of this.seen.entries()){let h=f[1];if(e===f[0]){c(f);continue}if(n.external){let m=n.external.registry.get(f[0])?.id;if(e!==f[0]&&m){c(f);continue}}if(this.metadataRegistry.get(f[0])?.id){c(f);continue}if(h.cycle){if(n.cycles==="throw")throw Error(`Cycle detected: #/${h.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);n.cycles==="ref"&&c(f);continue}if(h.count>1&&n.reused==="ref"){c(f);continue}}let l=a((f,h)=>{let m=this.seen.get(f),g=m.def??m.schema,A={...g};if(m.ref===null)return;let y=m.ref;if(m.ref=null,y){l(y,h);let E=this.seen.get(y).schema;E.$ref&&h.target==="draft-7"?(g.allOf=g.allOf??[],g.allOf.push(E)):(Object.assign(g,E),Object.assign(g,A))}m.isParent||this.override({zodSchema:f,jsonSchema:g,path:m.path??[]})},"G");for(let f of[...this.seen.entries()].reverse())l(f[0],{target:this.target});let u={};this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),Object.assign(u,o.def);let d=n.external?.defs??{};for(let f of this.seen.entries()){let h=f[1];h.def&&h.defId&&(d[h.defId]=h.def)}!n.external&&Object.keys(d).length>0&&(this.target==="draft-2020-12"?u.$defs=d:u.definitions=d);try{return JSON.parse(JSON.stringify(u))}catch{throw Error("Error converting schema to JSON.")}}};a(eUr,"e8");a(q0,"t$");dzc={},fzc=ft("ZodMiniType",(t,e)=>{if(!t._zod)throw Error("Uninitialized schema in ZodMiniType.");Co.init(t,e),t.def=e,t.parse=(r,n)=>Fxt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Dwt(t,r,n),t.parseAsync=async(r,n)=>Uxt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Nwt(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>$N(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t)}),pzc=ft("ZodMiniObject",(t,e)=>{h9r.init(t,e),fzc.init(t,e),Ws.defineLazy(t,"shape",()=>e.shape)});a(zKi,"tq");a(VL,"a6");a(nve,"S0");a(r8e,"S1");a(qFr,"I3");a(j8e,"v1");a(QFe,"$9");a(jFr,"R3");a(hzc,"_M");a(mzc,"kM");a(nno,"P3");G={};WL(G,{xid:a(()=>Rzc,"xid"),void:a(()=>Kzc,"void"),uuidv7:a(()=>Czc,"uuidv7"),uuidv6:a(()=>vzc,"uuidv6"),uuidv4:a(()=>_zc,"uuidv4"),uuid:a(()=>Ezc,"uuid"),url:a(()=>bzc,"url"),uppercase:a(()=>G9r,"uppercase"),unknown:a(()=>of,"unknown"),union:a(()=>ou,"union"),undefined:a(()=>zzc,"undefined"),ulid:a(()=>wzc,"ulid"),uint64:a(()=>Vzc,"uint64"),uint32:a(()=>Hzc,"uint32"),tuple:a(()=>eYc,"tuple"),trim:a(()=>K9r,"trim"),treeifyError:a(()=>deo,"treeifyError"),transform:a(()=>PUr,"transform"),toUpperCase:a(()=>Z9r,"toUpperCase"),toLowerCase:a(()=>J9r,"toLowerCase"),toJSONSchema:a(()=>eUr,"toJSONSchema"),templateLiteral:a(()=>lYc,"templateLiteral"),symbol:a(()=>Wzc,"symbol"),superRefine:a(()=>zno,"superRefine"),success:a(()=>aYc,"success"),stringbool:a(()=>fYc,"stringbool"),stringFormat:a(()=>Uzc,"stringFormat"),string:a(()=>It,"string"),strictObject:a(()=>Xzc,"strictObject"),startsWith:a(()=>V9r,"startsWith"),size:a(()=>q9r,"size"),setErrorMap:a(()=>mYc,"setErrorMap"),set:a(()=>nYc,"set"),safeParseAsync:a(()=>fno,"safeParseAsync"),safeParse:a(()=>dno,"safeParse"),registry:a(()=>E9r,"registry"),regexes:a(()=>o9r,"regexes"),regex:a(()=>j9r,"regex"),refine:a(()=>Wno,"refine"),record:a(()=>iu,"record"),readonly:a(()=>Qno,"readonly"),property:a(()=>Yro,"property"),promise:a(()=>uYc,"promise"),prettifyError:a(()=>peo,"prettifyError"),preprocess:a(()=>OUr,"preprocess"),prefault:a(()=>Nno,"prefault"),positive:a(()=>$ro,"positive"),pipe:a(()=>Wxt,"pipe"),partialRecord:a(()=>tYc,"partialRecord"),parseAsync:a(()=>uno,"parseAsync"),parse:a(()=>lno,"parse"),overwrite:a(()=>loe,"overwrite"),optional:a(()=>bd,"optional"),object:a(()=>Tn,"object"),number:a(()=>Nc,"number"),nullish:a(()=>sYc,"nullish"),nullable:a(()=>Vxt,"nullable"),null:a(()=>TUr,"null"),normalize:a(()=>Y9r,"normalize"),nonpositive:a(()=>Wro,"nonpositive"),nonoptional:a(()=>Mno,"nonoptional"),nonnegative:a(()=>zro,"nonnegative"),never:a(()=>jwt,"never"),negative:a(()=>Vro,"negative"),nativeEnum:a(()=>iYc,"nativeEnum"),nanoid:a(()=>Tzc,"nanoid"),nan:a(()=>cYc,"nan"),multipleOf:a(()=>x8e,"multipleOf"),minSize:a(()=>w8e,"minSize"),minLength:a(()=>kve,"minLength"),mime:a(()=>z9r,"mime"),maxSize:a(()=>Owt,"maxSize"),maxLength:a(()=>Lwt,"maxLength"),map:a(()=>rYc,"map"),lte:a(()=>FN,"lte"),lt:a(()=>noe,"lt"),lowercase:a(()=>H9r,"lowercase"),looseObject:a(()=>Kv,"looseObject"),locales:a(()=>y9r,"locales"),literal:a(()=>ti,"literal"),length:a(()=>Bwt,"length"),lazy:a(()=>Hno,"lazy"),ksuid:a(()=>kzc,"ksuid"),keyof:a(()=>Zzc,"keyof"),jwt:a(()=>Fzc,"jwt"),json:a(()=>pYc,"json"),iso:a(()=>tUr,"iso"),ipv6:a(()=>Dzc,"ipv6"),ipv4:a(()=>Pzc,"ipv4"),intersection:a(()=>Gwt,"intersection"),int64:a(()=>$zc,"int64"),int32:a(()=>jzc,"int32"),int:a(()=>U8r,"int"),instanceof:a(()=>dYc,"instanceof"),includes:a(()=>$9r,"includes"),guid:a(()=>yzc,"guid"),gte:a(()=>RI,"gte"),gt:a(()=>ioe,"gt"),globalRegistry:a(()=>V9,"globalRegistry"),getErrorMap:a(()=>gYc,"getErrorMap"),function:a(()=>rno,"function"),formatError:a(()=>e9r,"formatError"),float64:a(()=>qzc,"float64"),float32:a(()=>Qzc,"float32"),flattenError:a(()=>X6r,"flattenError"),file:a(()=>oYc,"file"),enum:a(()=>N1,"enum"),endsWith:a(()=>W9r,"endsWith"),emoji:a(()=>Szc,"emoji"),email:a(()=>Azc,"email"),e164:a(()=>Bzc,"e164"),discriminatedUnion:a(()=>wUr,"discriminatedUnion"),date:a(()=>Jzc,"date"),custom:a(()=>Vno,"custom"),cuid2:a(()=>xzc,"cuid2"),cuid:a(()=>Izc,"cuid"),core:a(()=>XXi,"core"),config:a(()=>Xv,"config"),coerce:a(()=>Yno,"coerce"),clone:a(()=>$N,"clone"),cidrv6:a(()=>Mzc,"cidrv6"),cidrv4:a(()=>Nzc,"cidrv4"),check:a(()=>$no,"check"),catch:a(()=>Bno,"catch"),boolean:a(()=>j0,"boolean"),bigint:a(()=>Gzc,"bigint"),base64url:a(()=>Lzc,"base64url"),base64:a(()=>Ozc,"base64"),array:a(()=>Ca,"array"),any:a(()=>Yzc,"any"),_default:a(()=>Pno,"_default"),_ZodString:a(()=>sUr,"_ZodString"),ZodXID:a(()=>hUr,"ZodXID"),ZodVoid:a(()=>_no,"ZodVoid"),ZodUnknown:a(()=>yno,"ZodUnknown"),ZodUnion:a(()=>xUr,"ZodUnion"),ZodUndefined:a(()=>mno,"ZodUndefined"),ZodUUID:a(()=>W9,"ZodUUID"),ZodURL:a(()=>cUr,"ZodURL"),ZodULID:a(()=>pUr,"ZodULID"),ZodType:a(()=>Os,"ZodType"),ZodTuple:a(()=>Sno,"ZodTuple"),ZodTransform:a(()=>kUr,"ZodTransform"),ZodTemplateLiteral:a(()=>qno,"ZodTemplateLiteral"),ZodSymbol:a(()=>hno,"ZodSymbol"),ZodSuccess:a(()=>Ono,"ZodSuccess"),ZodStringFormat:a(()=>Td,"ZodStringFormat"),ZodString:a(()=>Fwt,"ZodString"),ZodSet:a(()=>Ino,"ZodSet"),ZodRecord:a(()=>RUr,"ZodRecord"),ZodRealError:a(()=>H8e,"ZodRealError"),ZodReadonly:a(()=>Uno,"ZodReadonly"),ZodPromise:a(()=>Gno,"ZodPromise"),ZodPrefault:a(()=>Dno,"ZodPrefault"),ZodPipe:a(()=>MUr,"ZodPipe"),ZodOptional:a(()=>DUr,"ZodOptional"),ZodObject:a(()=>Hwt,"ZodObject"),ZodNumberFormat:a(()=>Hve,"ZodNumberFormat"),ZodNumber:a(()=>Uwt,"ZodNumber"),ZodNullable:a(()=>Rno,"ZodNullable"),ZodNull:a(()=>gno,"ZodNull"),ZodNonOptional:a(()=>NUr,"ZodNonOptional"),ZodNever:a(()=>Eno,"ZodNever"),ZodNanoID:a(()=>uUr,"ZodNanoID"),ZodNaN:a(()=>Fno,"ZodNaN"),ZodMap:a(()=>Tno,"ZodMap"),ZodLiteral:a(()=>xno,"ZodLiteral"),ZodLazy:a(()=>jno,"ZodLazy"),ZodKSUID:a(()=>mUr,"ZodKSUID"),ZodJWT:a(()=>bUr,"ZodJWT"),ZodIssueCode:a(()=>hYc,"ZodIssueCode"),ZodIntersection:a(()=>bno,"ZodIntersection"),ZodISOTime:a(()=>iUr,"ZodISOTime"),ZodISODuration:a(()=>oUr,"ZodISODuration"),ZodISODateTime:a(()=>rUr,"ZodISODateTime"),ZodISODate:a(()=>nUr,"ZodISODate"),ZodIPv6:a(()=>AUr,"ZodIPv6"),ZodIPv4:a(()=>gUr,"ZodIPv4"),ZodGUID:a(()=>$xt,"ZodGUID"),ZodFile:a(()=>wno,"ZodFile"),ZodError:a(()=>gzc,"ZodError"),ZodEnum:a(()=>k8e,"ZodEnum"),ZodEmoji:a(()=>lUr,"ZodEmoji"),ZodEmail:a(()=>aUr,"ZodEmail"),ZodE164:a(()=>CUr,"ZodE164"),ZodDiscriminatedUnion:a(()=>Cno,"ZodDiscriminatedUnion"),ZodDefault:a(()=>kno,"ZodDefault"),ZodDate:a(()=>IUr,"ZodDate"),ZodCustomStringFormat:a(()=>pno,"ZodCustomStringFormat"),ZodCustom:a(()=>$wt,"ZodCustom"),ZodCatch:a(()=>Lno,"ZodCatch"),ZodCUID2:a(()=>fUr,"ZodCUID2"),ZodCUID:a(()=>dUr,"ZodCUID"),ZodCIDRv6:a(()=>EUr,"ZodCIDRv6"),ZodCIDRv4:a(()=>yUr,"ZodCIDRv4"),ZodBoolean:a(()=>Qwt,"ZodBoolean"),ZodBigIntFormat:a(()=>SUr,"ZodBigIntFormat"),ZodBigInt:a(()=>qwt,"ZodBigInt"),ZodBase64URL:a(()=>vUr,"ZodBase64URL"),ZodBase64:a(()=>_Ur,"ZodBase64"),ZodArray:a(()=>vno,"ZodArray"),ZodAny:a(()=>Ano,"ZodAny"),TimePrecision:a(()=>yro,"TimePrecision"),NEVER:a(()=>eeo,"NEVER"),$output:a(()=>hro,"$output"),$input:a(()=>mro,"$input"),$brand:a(()=>teo,"$brand")});tUr={};WL(tUr,{time:a(()=>sno,"time"),duration:a(()=>ano,"duration"),datetime:a(()=>ino,"datetime"),date:a(()=>ono,"date"),ZodISOTime:a(()=>iUr,"ZodISOTime"),ZodISODuration:a(()=>oUr,"ZodISODuration"),ZodISODateTime:a(()=>rUr,"ZodISODateTime"),ZodISODate:a(()=>nUr,"ZodISODate")});rUr=ft("ZodISODateTime",(t,e)=>{Cto.init(t,e),Td.init(t,e)});a(ino,"aq");nUr=ft("ZodISODate",(t,e)=>{bto.init(t,e),Td.init(t,e)});a(ono,"sq");iUr=ft("ZodISOTime",(t,e)=>{Sto.init(t,e),Td.init(t,e)});a(sno,"eq");oUr=ft("ZodISODuration",(t,e)=>{Tto.init(t,e),Td.init(t,e)});a(ano,"$V");cno=a((t,e)=>{Z6r.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>e9r(t,r),"value")},flatten:{value:a(r=>X6r(t,r),"value")},addIssue:{value:a(r=>t.issues.push(r),"value")},addIssues:{value:a(r=>t.issues.push(...r),"value")},isEmpty:{get(){return t.issues.length===0}}})},"vM"),gzc=ft("ZodError",cno),H8e=ft("ZodError",cno,{Parent:Error}),lno=t9r(H8e),uno=r9r(H8e),dno=n9r(H8e),fno=i9r(H8e),Os=ft("ZodType",(t,e)=>(Co.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>$N(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>lno(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>dno(t,r,n),t.parseAsync=async(r,n)=>uno(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>fno(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(Wno(r,n)),t.superRefine=r=>t.check(zno(r)),t.overwrite=r=>t.check(loe(r)),t.optional=()=>bd(t),t.nullable=()=>Vxt(t),t.nullish=()=>bd(Vxt(t)),t.nonoptional=r=>Mno(t,r),t.array=()=>Ca(t),t.or=r=>ou([t,r]),t.and=r=>Gwt(t,r),t.transform=r=>Wxt(t,PUr(r)),t.default=r=>Pno(t,r),t.prefault=r=>Nno(t,r),t.catch=r=>Bno(t,r),t.pipe=r=>Wxt(t,r),t.readonly=()=>Qno(t),t.describe=r=>{let n=t.clone();return V9.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return V9.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return V9.get(t);let n=t.clone();return V9.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),sUr=ft("_ZodString",(t,e)=>{q8e.init(t,e),Os.init(t,e);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check(j9r(...n)),t.includes=(...n)=>t.check($9r(...n)),t.startsWith=(...n)=>t.check(V9r(...n)),t.endsWith=(...n)=>t.check(W9r(...n)),t.min=(...n)=>t.check(kve(...n)),t.max=(...n)=>t.check(Lwt(...n)),t.length=(...n)=>t.check(Bwt(...n)),t.nonempty=(...n)=>t.check(kve(1,...n)),t.lowercase=n=>t.check(H9r(n)),t.uppercase=n=>t.check(G9r(n)),t.trim=()=>t.check(K9r()),t.normalize=(...n)=>t.check(Y9r(...n)),t.toLowerCase=()=>t.check(J9r()),t.toUpperCase=()=>t.check(Z9r())}),Fwt=ft("ZodString",(t,e)=>{q8e.init(t,e),sUr.init(t,e),t.email=r=>t.check(_9r(aUr,r)),t.url=r=>t.check(T9r(cUr,r)),t.jwt=r=>t.check(Q9r(bUr,r)),t.emoji=r=>t.check(I9r(lUr,r)),t.guid=r=>t.check(jxt($xt,r)),t.uuid=r=>t.check(v9r(W9,r)),t.uuidv4=r=>t.check(C9r(W9,r)),t.uuidv6=r=>t.check(b9r(W9,r)),t.uuidv7=r=>t.check(S9r(W9,r)),t.nanoid=r=>t.check(x9r(uUr,r)),t.guid=r=>t.check(jxt($xt,r)),t.cuid=r=>t.check(w9r(dUr,r)),t.cuid2=r=>t.check(R9r(fUr,r)),t.ulid=r=>t.check(k9r(pUr,r)),t.base64=r=>t.check(B9r(_Ur,r)),t.base64url=r=>t.check(F9r(vUr,r)),t.xid=r=>t.check(P9r(hUr,r)),t.ksuid=r=>t.check(D9r(mUr,r)),t.ipv4=r=>t.check(N9r(gUr,r)),t.ipv6=r=>t.check(M9r(AUr,r)),t.cidrv4=r=>t.check(O9r(yUr,r)),t.cidrv6=r=>t.check(L9r(EUr,r)),t.e164=r=>t.check(U9r(CUr,r)),t.datetime=r=>t.check(ino(r)),t.date=r=>t.check(ono(r)),t.time=r=>t.check(sno(r)),t.duration=r=>t.check(ano(r))});a(It,"L");Td=ft("ZodStringFormat",(t,e)=>{Lu.init(t,e),sUr.init(t,e)}),aUr=ft("ZodEmail",(t,e)=>{pto.init(t,e),Td.init(t,e)});a(Azc,"Cm");$xt=ft("ZodGUID",(t,e)=>{dto.init(t,e),Td.init(t,e)});a(yzc,"Tm");W9=ft("ZodUUID",(t,e)=>{fto.init(t,e),Td.init(t,e)});a(Ezc,"xm");a(_zc,"ym");a(vzc,"fm");a(Czc,"gm");cUr=ft("ZodURL",(t,e)=>{hto.init(t,e),Td.init(t,e)});a(bzc,"hm");lUr=ft("ZodEmoji",(t,e)=>{mto.init(t,e),Td.init(t,e)});a(Szc,"um");uUr=ft("ZodNanoID",(t,e)=>{gto.init(t,e),Td.init(t,e)});a(Tzc,"mm");dUr=ft("ZodCUID",(t,e)=>{Ato.init(t,e),Td.init(t,e)});a(Izc,"lm");fUr=ft("ZodCUID2",(t,e)=>{yto.init(t,e),Td.init(t,e)});a(xzc,"cm");pUr=ft("ZodULID",(t,e)=>{Eto.init(t,e),Td.init(t,e)});a(wzc,"pm");hUr=ft("ZodXID",(t,e)=>{_to.init(t,e),Td.init(t,e)});a(Rzc,"dm");mUr=ft("ZodKSUID",(t,e)=>{vto.init(t,e),Td.init(t,e)});a(kzc,"im");gUr=ft("ZodIPv4",(t,e)=>{Ito.init(t,e),Td.init(t,e)});a(Pzc,"nm");AUr=ft("ZodIPv6",(t,e)=>{xto.init(t,e),Td.init(t,e)});a(Dzc,"rm");yUr=ft("ZodCIDRv4",(t,e)=>{wto.init(t,e),Td.init(t,e)});a(Nzc,"om");EUr=ft("ZodCIDRv6",(t,e)=>{Rto.init(t,e),Td.init(t,e)});a(Mzc,"tm");_Ur=ft("ZodBase64",(t,e)=>{kto.init(t,e),Td.init(t,e)});a(Ozc,"am");vUr=ft("ZodBase64URL",(t,e)=>{Dto.init(t,e),Td.init(t,e)});a(Lzc,"sm");CUr=ft("ZodE164",(t,e)=>{Nto.init(t,e),Td.init(t,e)});a(Bzc,"em");bUr=ft("ZodJWT",(t,e)=>{Oto.init(t,e),Td.init(t,e)});a(Fzc,"$l");pno=ft("ZodCustomStringFormat",(t,e)=>{Lto.init(t,e),Td.init(t,e)});a(Uzc,"Ql");Uwt=ft("ZodNumber",(t,e)=>{u9r.init(t,e),Os.init(t,e),t.gt=(n,o)=>t.check(ioe(n,o)),t.gte=(n,o)=>t.check(RI(n,o)),t.min=(n,o)=>t.check(RI(n,o)),t.lt=(n,o)=>t.check(noe(n,o)),t.lte=(n,o)=>t.check(FN(n,o)),t.max=(n,o)=>t.check(FN(n,o)),t.int=n=>t.check(U8r(n)),t.safe=n=>t.check(U8r(n)),t.positive=n=>t.check(ioe(0,n)),t.nonnegative=n=>t.check(RI(0,n)),t.negative=n=>t.check(noe(0,n)),t.nonpositive=n=>t.check(FN(0,n)),t.multipleOf=(n,o)=>t.check(x8e(n,o)),t.step=(n,o)=>t.check(x8e(n,o)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});a(Nc,"z$");Hve=ft("ZodNumberFormat",(t,e)=>{Bto.init(t,e),Uwt.init(t,e)});a(U8r,"WV");a(Qzc,"Jl");a(qzc,"Xl");a(jzc,"Yl");a(Hzc,"Wl");Qwt=ft("ZodBoolean",(t,e)=>{d9r.init(t,e),Os.init(t,e)});a(j0,"i$");qwt=ft("ZodBigInt",(t,e)=>{f9r.init(t,e),Os.init(t,e),t.gte=(n,o)=>t.check(RI(n,o)),t.min=(n,o)=>t.check(RI(n,o)),t.gt=(n,o)=>t.check(ioe(n,o)),t.gte=(n,o)=>t.check(RI(n,o)),t.min=(n,o)=>t.check(RI(n,o)),t.lt=(n,o)=>t.check(noe(n,o)),t.lte=(n,o)=>t.check(FN(n,o)),t.max=(n,o)=>t.check(FN(n,o)),t.positive=n=>t.check(ioe(BigInt(0),n)),t.negative=n=>t.check(noe(BigInt(0),n)),t.nonpositive=n=>t.check(FN(BigInt(0),n)),t.nonnegative=n=>t.check(RI(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(x8e(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});a(Gzc,"Gl");SUr=ft("ZodBigIntFormat",(t,e)=>{Fto.init(t,e),qwt.init(t,e)});a($zc,"Ul");a(Vzc,"Hl");hno=ft("ZodSymbol",(t,e)=>{Uto.init(t,e),Os.init(t,e)});a(Wzc,"Kl");mno=ft("ZodUndefined",(t,e)=>{Qto.init(t,e),Os.init(t,e)});a(zzc,"ql");gno=ft("ZodNull",(t,e)=>{qto.init(t,e),Os.init(t,e)});a(TUr,"T3");Ano=ft("ZodAny",(t,e)=>{jto.init(t,e),Os.init(t,e)});a(Yzc,"Vl");yno=ft("ZodUnknown",(t,e)=>{qxt.init(t,e),Os.init(t,e)});a(of,"S$");Eno=ft("ZodNever",(t,e)=>{Hto.init(t,e),Os.init(t,e)});a(jwt,"x3");_no=ft("ZodVoid",(t,e)=>{Gto.init(t,e),Os.init(t,e)});a(Kzc,"Bl");IUr=ft("ZodDate",(t,e)=>{$to.init(t,e),Os.init(t,e),t.min=(n,o)=>t.check(RI(n,o)),t.max=(n,o)=>t.check(FN(n,o));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});a(Jzc,"zl");vno=ft("ZodArray",(t,e)=>{p9r.init(t,e),Os.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(kve(r,n)),t.nonempty=r=>t.check(kve(1,r)),t.max=(r,n)=>t.check(Lwt(r,n)),t.length=(r,n)=>t.check(Bwt(r,n)),t.unwrap=()=>t.element});a(Ca,"W$");a(Zzc,"Nl");Hwt=ft("ZodObject",(t,e)=>{h9r.init(t,e),Os.init(t,e),Ws.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>N1(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:of()}),t.loose=()=>t.clone({...t._zod.def,catchall:of()}),t.strict=()=>t.clone({...t._zod.def,catchall:jwt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>Ws.extend(t,r),t.merge=r=>Ws.merge(t,r),t.pick=r=>Ws.pick(t,r),t.omit=r=>Ws.omit(t,r),t.partial=(...r)=>Ws.partial(DUr,t,r[0]),t.required=(...r)=>Ws.required(NUr,t,r[0])});a(Tn,"h");a(Xzc,"wl");a(Kv,"K6");xUr=ft("ZodUnion",(t,e)=>{m9r.init(t,e),Os.init(t,e),t.options=e.options});a(ou,"A$");Cno=ft("ZodDiscriminatedUnion",(t,e)=>{xUr.init(t,e),Vto.init(t,e)});a(wUr,"g3");bno=ft("ZodIntersection",(t,e)=>{Wto.init(t,e),Os.init(t,e)});a(Gwt,"VJ");Sno=ft("ZodTuple",(t,e)=>{Mwt.init(t,e),Os.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});a(eYc,"Ol");RUr=ft("ZodRecord",(t,e)=>{zto.init(t,e),Os.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(iu,"I$");a(tYc,"Dl");Tno=ft("ZodMap",(t,e)=>{Yto.init(t,e),Os.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(rYc,"Fl");Ino=ft("ZodSet",(t,e)=>{Kto.init(t,e),Os.init(t,e),t.min=(...r)=>t.check(w8e(...r)),t.nonempty=r=>t.check(w8e(1,r)),t.max=(...r)=>t.check(Owt(...r)),t.size=(...r)=>t.check(q9r(...r))});a(nYc,"Zl");k8e=ft("ZodEnum",(t,e)=>{Jto.init(t,e),Os.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let c of n)if(r.has(c))s[c]=e.entries[c];else throw Error(`Key ${c} not found in enum`);return new k8e({...e,checks:[],...Ws.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let c of n)if(r.has(c))delete s[c];else throw Error(`Key ${c} not found in enum`);return new k8e({...e,checks:[],...Ws.normalizeParams(o),entries:s})}});a(N1,"N6");a(iYc,"Ml");xno=ft("ZodLiteral",(t,e)=>{Zto.init(t,e),Os.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});a(ti,"l");wno=ft("ZodFile",(t,e)=>{Xto.init(t,e),Os.init(t,e),t.min=(r,n)=>t.check(w8e(r,n)),t.max=(r,n)=>t.check(Owt(r,n)),t.mime=(r,n)=>t.check(z9r(Array.isArray(r)?r:[r],n))});a(oYc,"Ll");kUr=ft("ZodTransform",(t,e)=>{g9r.init(t,e),Os.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(Ws.issue(s,r.value,e));else{let c=s;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=r.value),c.inst??(c.inst=t),c.continue??(c.continue=!0),r.issues.push(Ws.issue(c))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});a(PUr,"bV");DUr=ft("ZodOptional",(t,e)=>{ero.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(bd,"_$");Rno=ft("ZodNullable",(t,e)=>{tro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Vxt,"v3");a(sYc,"jl");kno=ft("ZodDefault",(t,e)=>{rro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});a(Pno,"aM");Dno=ft("ZodPrefault",(t,e)=>{nro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Nno,"eM");NUr=ft("ZodNonOptional",(t,e)=>{iro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Mno,"$L");Ono=ft("ZodSuccess",(t,e)=>{oro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(aYc,"Al");Lno=ft("ZodCatch",(t,e)=>{sro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});a(Bno,"XL");Fno=ft("ZodNaN",(t,e)=>{aro.init(t,e),Os.init(t,e)});a(cYc,"Il");MUr=ft("ZodPipe",(t,e)=>{A9r.init(t,e),Os.init(t,e),t.in=e.in,t.out=e.out});a(Wxt,"C3");Uno=ft("ZodReadonly",(t,e)=>{cro.init(t,e),Os.init(t,e)});a(Qno,"GL");qno=ft("ZodTemplateLiteral",(t,e)=>{lro.init(t,e),Os.init(t,e)});a(lYc,"Rl");jno=ft("ZodLazy",(t,e)=>{dro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.getter()});a(Hno,"KL");Gno=ft("ZodPromise",(t,e)=>{uro.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(uYc,"Pl");$wt=ft("ZodCustom",(t,e)=>{fro.init(t,e),Os.init(t,e)});a($no,"VL");a(Vno,"vV");a(Wno,"BL");a(zno,"zL");a(dYc,"El");fYc=a((...t)=>eno({Pipe:MUr,Boolean:Qwt,String:Fwt,Transform:kUr},...t),"bl");a(pYc,"_l");a(OUr,"u3");hYc={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};a(mYc,"Sl");a(gYc,"vl");Yno={};WL(Yno,{string:a(()=>AYc,"string"),number:a(()=>yYc,"number"),date:a(()=>vYc,"date"),boolean:a(()=>EYc,"boolean"),bigint:a(()=>_Yc,"bigint")});a(AYc,"Cl");a(yYc,"Tl");a(EYc,"xl");a(_Yc,"yl");a(vYc,"fl");Xv(pro());CYc=G,Kno=CYc,Jno="2025-11-25",bYc=[Jno,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],$ie="io.modelcontextprotocol/related-task",Vwt="2.0",H0=Vno(t=>t!==null&&(typeof t=="object"||typeof t=="function")),Zno=ou([It(),Nc().int()]),Xno=It(),cJh=Kv({ttl:Nc().optional(),pollInterval:Nc().optional()}),SYc=Tn({ttl:Nc().optional()}),TYc=Tn({taskId:It()}),LUr=Kv({progressToken:Zno.optional(),[$ie]:TYc.optional()}),MI=Tn({_meta:LUr.optional()}),G8e=MI.extend({task:SYc.optional()}),IYc=a(t=>G8e.safeParse(t).success,"FL"),Dy=Tn({method:It(),params:MI.loose().optional()}),vk=Tn({_meta:LUr.optional()}),Ck=Tn({method:It(),params:vk.loose().optional()}),Ny=Kv({_meta:LUr.optional()}),Wwt=ou([It(),Nc().int()]),eio=Tn({jsonrpc:ti(Vwt),id:Wwt,...Dy.shape}).strict(),YKi=a(t=>eio.safeParse(t).success,"fV"),tio=Tn({jsonrpc:ti(Vwt),...Ck.shape}).strict(),xYc=a(t=>tio.safeParse(t).success,"LL"),BUr=Tn({jsonrpc:ti(Vwt),id:Wwt,result:Ny}).strict(),FIt=a(t=>BUr.safeParse(t).success,"zJ");(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Bi||(Bi={}));FUr=Tn({jsonrpc:ti(Vwt),id:Wwt.optional(),error:Tn({code:Nc().int(),message:It(),data:of().optional()})}).strict(),wYc=a(t=>FUr.safeParse(t).success,"jL"),lJh=ou([eio,tio,BUr,FUr]),uJh=ou([BUr,FUr]),UUr=Ny.strict(),RYc=vk.extend({requestId:Wwt.optional(),reason:It().optional()}),QUr=Ck.extend({method:ti("notifications/cancelled"),params:RYc}),kYc=Tn({src:It(),mimeType:It().optional(),sizes:Ca(It()).optional(),theme:N1(["light","dark"]).optional()}),$8e=Tn({icons:Ca(kYc).optional()}),Pve=Tn({name:It(),title:It().optional()}),rio=Pve.extend({...Pve.shape,...$8e.shape,version:It(),websiteUrl:It().optional(),description:It().optional()}),PYc=Gwt(Tn({applyDefaults:j0().optional()}),iu(It(),of())),DYc=OUr(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Gwt(Tn({form:PYc.optional(),url:H0.optional()}),iu(It(),of()).optional())),NYc=Kv({list:H0.optional(),cancel:H0.optional(),requests:Kv({sampling:Kv({createMessage:H0.optional()}).optional(),elicitation:Kv({create:H0.optional()}).optional()}).optional()}),MYc=Kv({list:H0.optional(),cancel:H0.optional(),requests:Kv({tools:Kv({call:H0.optional()}).optional()}).optional()}),OYc=Tn({experimental:iu(It(),H0).optional(),sampling:Tn({context:H0.optional(),tools:H0.optional()}).optional(),elicitation:DYc.optional(),roots:Tn({listChanged:j0().optional()}).optional(),tasks:NYc.optional(),extensions:iu(It(),H0).optional()}),LYc=MI.extend({protocolVersion:It(),capabilities:OYc,clientInfo:rio}),nio=Dy.extend({method:ti("initialize"),params:LYc}),BYc=Tn({experimental:iu(It(),H0).optional(),logging:H0.optional(),completions:H0.optional(),prompts:Tn({listChanged:j0().optional()}).optional(),resources:Tn({subscribe:j0().optional(),listChanged:j0().optional()}).optional(),tools:Tn({listChanged:j0().optional()}).optional(),tasks:MYc.optional(),extensions:iu(It(),H0).optional()}),FYc=Ny.extend({protocolVersion:It(),capabilities:BYc,serverInfo:rio,instructions:It().optional()}),iio=Ck.extend({method:ti("notifications/initialized"),params:vk.optional()}),qUr=Dy.extend({method:ti("ping"),params:MI.optional()}),UYc=Tn({progress:Nc(),total:bd(Nc()),message:bd(It())}),QYc=Tn({...vk.shape,...UYc.shape,progressToken:Zno}),jUr=Ck.extend({method:ti("notifications/progress"),params:QYc}),qYc=MI.extend({cursor:Xno.optional()}),V8e=Dy.extend({params:qYc.optional()}),W8e=Ny.extend({nextCursor:Xno.optional()}),jYc=N1(["working","input_required","completed","failed","cancelled"]),z8e=Tn({taskId:It(),status:jYc,ttl:ou([Nc(),TUr()]),createdAt:It(),lastUpdatedAt:It(),pollInterval:bd(Nc()),statusMessage:bd(It())}),zwt=Ny.extend({task:z8e}),HYc=vk.merge(z8e),zxt=Ck.extend({method:ti("notifications/tasks/status"),params:HYc}),HUr=Dy.extend({method:ti("tasks/get"),params:MI.extend({taskId:It()})}),GUr=Ny.merge(z8e),$Ur=Dy.extend({method:ti("tasks/result"),params:MI.extend({taskId:It()})}),dJh=Ny.loose(),VUr=V8e.extend({method:ti("tasks/list")}),WUr=W8e.extend({tasks:Ca(z8e)}),zUr=Dy.extend({method:ti("tasks/cancel"),params:MI.extend({taskId:It()})}),GYc=Ny.merge(z8e),oio=Tn({uri:It(),mimeType:bd(It()),_meta:iu(It(),of()).optional()}),sio=oio.extend({text:It()}),YUr=It().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),aio=oio.extend({blob:YUr}),Y8e=N1(["user","assistant"]),Gve=Tn({audience:Ca(Y8e).optional(),priority:Nc().min(0).max(1).optional(),lastModified:tUr.datetime({offset:!0}).optional()}),cio=Tn({...Pve.shape,...$8e.shape,uri:It(),description:bd(It()),mimeType:bd(It()),size:bd(Nc()),annotations:Gve.optional(),_meta:bd(Kv({}))}),$Yc=Tn({...Pve.shape,...$8e.shape,uriTemplate:It(),description:bd(It()),mimeType:bd(It()),annotations:Gve.optional(),_meta:bd(Kv({}))}),Q8r=V8e.extend({method:ti("resources/list")}),VYc=W8e.extend({resources:Ca(cio)}),q8r=V8e.extend({method:ti("resources/templates/list")}),WYc=W8e.extend({resourceTemplates:Ca($Yc)}),KUr=MI.extend({uri:It()}),zYc=KUr,j8r=Dy.extend({method:ti("resources/read"),params:zYc}),YYc=Ny.extend({contents:Ca(ou([sio,aio]))}),KYc=Ck.extend({method:ti("notifications/resources/list_changed"),params:vk.optional()}),JYc=KUr,ZYc=Dy.extend({method:ti("resources/subscribe"),params:JYc}),XYc=KUr,eKc=Dy.extend({method:ti("resources/unsubscribe"),params:XYc}),tKc=vk.extend({uri:It()}),rKc=Ck.extend({method:ti("notifications/resources/updated"),params:tKc}),nKc=Tn({name:It(),description:bd(It()),required:bd(j0())}),iKc=Tn({...Pve.shape,...$8e.shape,description:bd(It()),arguments:bd(Ca(nKc)),_meta:bd(Kv({}))}),H8r=V8e.extend({method:ti("prompts/list")}),oKc=W8e.extend({prompts:Ca(iKc)}),sKc=MI.extend({name:It(),arguments:iu(It(),It()).optional()}),G8r=Dy.extend({method:ti("prompts/get"),params:sKc}),JUr=Tn({type:ti("text"),text:It(),annotations:Gve.optional(),_meta:iu(It(),of()).optional()}),ZUr=Tn({type:ti("image"),data:YUr,mimeType:It(),annotations:Gve.optional(),_meta:iu(It(),of()).optional()}),XUr=Tn({type:ti("audio"),data:YUr,mimeType:It(),annotations:Gve.optional(),_meta:iu(It(),of()).optional()}),aKc=Tn({type:ti("tool_use"),name:It(),id:It(),input:iu(It(),of()),_meta:iu(It(),of()).optional()}),cKc=Tn({type:ti("resource"),resource:ou([sio,aio]),annotations:Gve.optional(),_meta:iu(It(),of()).optional()}),lKc=cio.extend({type:ti("resource_link")}),e7r=ou([JUr,ZUr,XUr,lKc,cKc]),uKc=Tn({role:Y8e,content:e7r}),dKc=Ny.extend({description:It().optional(),messages:Ca(uKc)}),fKc=Ck.extend({method:ti("notifications/prompts/list_changed"),params:vk.optional()}),pKc=Tn({title:It().optional(),readOnlyHint:j0().optional(),destructiveHint:j0().optional(),idempotentHint:j0().optional(),openWorldHint:j0().optional()}),hKc=Tn({taskSupport:N1(["required","optional","forbidden"]).optional()}),lio=Tn({...Pve.shape,...$8e.shape,description:It().optional(),inputSchema:Tn({type:ti("object"),properties:iu(It(),H0).optional(),required:Ca(It()).optional()}).catchall(of()),outputSchema:Tn({type:ti("object"),properties:iu(It(),H0).optional(),required:Ca(It()).optional()}).catchall(of()).optional(),annotations:pKc.optional(),execution:hKc.optional(),_meta:iu(It(),of()).optional()}),$8r=V8e.extend({method:ti("tools/list")}),mKc=W8e.extend({tools:Ca(lio)}),t7r=Ny.extend({content:Ca(e7r).default([]),structuredContent:iu(It(),of()).optional(),isError:j0().optional()}),fJh=t7r.or(Ny.extend({toolResult:of()})),gKc=G8e.extend({name:It(),arguments:iu(It(),of()).optional()}),Yxt=Dy.extend({method:ti("tools/call"),params:gKc}),AKc=Ck.extend({method:ti("notifications/tools/list_changed"),params:vk.optional()}),pJh=Tn({autoRefresh:j0().default(!0),debounceMs:Nc().int().nonnegative().default(300)}),Kxt=N1(["debug","info","notice","warning","error","critical","alert","emergency"]),yKc=MI.extend({level:Kxt}),uio=Dy.extend({method:ti("logging/setLevel"),params:yKc}),EKc=vk.extend({level:Kxt,logger:It().optional(),data:of()}),_Kc=Ck.extend({method:ti("notifications/message"),params:EKc}),vKc=Tn({name:It().optional()}),CKc=Tn({hints:Ca(vKc).optional(),costPriority:Nc().min(0).max(1).optional(),speedPriority:Nc().min(0).max(1).optional(),intelligencePriority:Nc().min(0).max(1).optional()}),bKc=Tn({mode:N1(["auto","required","none"]).optional()}),SKc=Tn({type:ti("tool_result"),toolUseId:It().describe("The unique identifier for the corresponding tool call."),content:Ca(e7r).default([]),structuredContent:Tn({}).loose().optional(),isError:j0().optional(),_meta:iu(It(),of()).optional()}),TKc=wUr("type",[JUr,ZUr,XUr]),Jxt=wUr("type",[JUr,ZUr,XUr,aKc,SKc]),IKc=Tn({role:Y8e,content:ou([Jxt,Ca(Jxt)]),_meta:iu(It(),of()).optional()}),xKc=G8e.extend({messages:Ca(IKc),modelPreferences:CKc.optional(),systemPrompt:It().optional(),includeContext:N1(["none","thisServer","allServers"]).optional(),temperature:Nc().optional(),maxTokens:Nc().int(),stopSequences:Ca(It()).optional(),metadata:H0.optional(),tools:Ca(lio).optional(),toolChoice:bKc.optional()}),wKc=Dy.extend({method:ti("sampling/createMessage"),params:xKc}),r7r=Ny.extend({model:It(),stopReason:bd(N1(["endTurn","stopSequence","maxTokens"]).or(It())),role:Y8e,content:TKc}),dio=Ny.extend({model:It(),stopReason:bd(N1(["endTurn","stopSequence","maxTokens","toolUse"]).or(It())),role:Y8e,content:ou([Jxt,Ca(Jxt)])}),RKc=Tn({type:ti("boolean"),title:It().optional(),description:It().optional(),default:j0().optional()}),kKc=Tn({type:ti("string"),title:It().optional(),description:It().optional(),minLength:Nc().optional(),maxLength:Nc().optional(),format:N1(["email","uri","date","date-time"]).optional(),default:It().optional()}),PKc=Tn({type:N1(["number","integer"]),title:It().optional(),description:It().optional(),minimum:Nc().optional(),maximum:Nc().optional(),default:Nc().optional()}),DKc=Tn({type:ti("string"),title:It().optional(),description:It().optional(),enum:Ca(It()),default:It().optional()}),NKc=Tn({type:ti("string"),title:It().optional(),description:It().optional(),oneOf:Ca(Tn({const:It(),title:It()})),default:It().optional()}),MKc=Tn({type:ti("string"),title:It().optional(),description:It().optional(),enum:Ca(It()),enumNames:Ca(It()).optional(),default:It().optional()}),OKc=ou([DKc,NKc]),LKc=Tn({type:ti("array"),title:It().optional(),description:It().optional(),minItems:Nc().optional(),maxItems:Nc().optional(),items:Tn({type:ti("string"),enum:Ca(It())}),default:Ca(It()).optional()}),BKc=Tn({type:ti("array"),title:It().optional(),description:It().optional(),minItems:Nc().optional(),maxItems:Nc().optional(),items:Tn({anyOf:Ca(Tn({const:It(),title:It()}))}),default:Ca(It()).optional()}),FKc=ou([LKc,BKc]),UKc=ou([MKc,OKc,FKc]),QKc=ou([UKc,RKc,kKc,PKc]),qKc=G8e.extend({mode:ti("form").optional(),message:It(),requestedSchema:Tn({type:ti("object"),properties:iu(It(),QKc),required:Ca(It()).optional()})}),jKc=G8e.extend({mode:ti("url"),message:It(),elicitationId:It(),url:It().url()}),HKc=ou([qKc,jKc]),GKc=Dy.extend({method:ti("elicitation/create"),params:HKc}),$Kc=vk.extend({elicitationId:It()}),VKc=Ck.extend({method:ti("notifications/elicitation/complete"),params:$Kc}),Zxt=Ny.extend({action:N1(["accept","decline","cancel"]),content:OUr(t=>t===null?void 0:t,iu(It(),ou([It(),Nc(),j0(),Ca(It())])).optional())}),WKc=Tn({type:ti("ref/resource"),uri:It()}),zKc=Tn({type:ti("ref/prompt"),name:It()}),YKc=MI.extend({ref:ou([zKc,WKc]),argument:Tn({name:It(),value:It()}),context:Tn({arguments:iu(It(),It()).optional()}).optional()}),V8r=Dy.extend({method:ti("completion/complete"),params:YKc});a(KKc,"kL");a(JKc,"SL");ZKc=Ny.extend({completion:Kv({values:Ca(It()).max(100),total:bd(Nc().int()),hasMore:bd(j0())})}),XKc=Tn({uri:It().startsWith("file://"),name:It().optional(),_meta:iu(It(),of()).optional()}),eJc=Dy.extend({method:ti("roots/list"),params:MI.optional()}),fio=Ny.extend({roots:Ca(XKc)}),tJc=Ck.extend({method:ti("notifications/roots/list_changed"),params:vk.optional()}),hJh=ou([qUr,nio,V8r,uio,G8r,H8r,Q8r,q8r,j8r,ZYc,eKc,Yxt,$8r,HUr,$Ur,VUr,zUr]),mJh=ou([QUr,jUr,iio,tJc,zxt]),gJh=ou([UUr,r7r,dio,Zxt,fio,GUr,WUr,zwt]),AJh=ou([qUr,wKc,GKc,eJc,HUr,$Ur,VUr,zUr]),yJh=ou([QUr,jUr,_Kc,rKc,KYc,AKc,fKc,zxt,VKc]),EJh=ou([UUr,FYc,ZKc,dKc,oKc,VYc,WYc,YYc,t7r,mKc,GUr,WUr,zwt]),fi=class t extends Error{static{a(this,"c")}constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===Bi.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new W8r(o.elicitations,r)}return new t(e,r,n)}},W8r=class extends fi{static{a(this,"vL")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Bi.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};a(Hie,"T1");rJc=Symbol("Let zodToJsonSchema decide on which parser to use"),KKi={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},nJc=a(t=>typeof t=="string"?{...KKi,name:t}:{...KKi,...t},"xL"),iJc=a(t=>{let e=nJc(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,o])=>[o._def,{def:o._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}},"yL");a(pio,"aV");a(Al,"H$");hio=a((t,e)=>{let r=0;for(;rDc(t.innerType._def,e),"uL");a(gio,"sV");lJc=a((t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let n of t.checks)switch(n.kind){case"min":Al(r,"minimum",n.value,n.message,e);break;case"max":Al(r,"maximum",n.value,n.message,e);break}return r},"Vp");a(uJc,"mL");a(dJc,"lL");a(fJc,"cL");pJc=a(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"Bp");a(hJc,"pL");a(mJc,"dL");HFr=void 0,ON={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:a(()=>(HFr===void 0&&(HFr=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),HFr),"emoji"),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};a(Aio,"qW");a(GFr,"$B");gJc=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");a(AJc,"Np");a(LN,"V4");a(Yv,"w6");a(JKi,"iL");a(yio,"VW");a(yJc,"nL");a(EJc,"rL");a(_Jc,"oL");a(vJc,"tL");Xxt={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};a(CJc,"sL");ZKi=a((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,o)=>Dc(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0},"aL");a(bJc,"eL");a(SJc,"$j");a(TJc,"Qj");a(IJc,"wp");a(xJc,"Op");wJc=a((t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return Dc(t.innerType._def,e);let r=Dc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:D1(e)},r]}:D1(e)},"Jj"),RJc=a((t,e)=>{if(e.pipeStrategy==="input")return Dc(t.in._def,e);if(e.pipeStrategy==="output")return Dc(t.out._def,e);let r=Dc(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=Dc(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}},"Xj");a(kJc,"Yj");a(PJc,"Wj");a(DJc,"Gj");a(NJc,"Uj");a(MJc,"Hj");OJc=a((t,e)=>Dc(t.innerType._def,e),"Kj"),LJc=a((t,e,r)=>{switch(e){case Cr.ZodString:return Aio(t,r);case Cr.ZodNumber:return SJc(t,r);case Cr.ZodObject:return TJc(t,r);case Cr.ZodBigInt:return sJc(t,r);case Cr.ZodBoolean:return aJc();case Cr.ZodDate:return gio(t,r);case Cr.ZodUndefined:return NJc(r);case Cr.ZodNull:return vJc(r);case Cr.ZodArray:return oJc(t,r);case Cr.ZodUnion:case Cr.ZodDiscriminatedUnion:return CJc(t,r);case Cr.ZodIntersection:return hJc(t,r);case Cr.ZodTuple:return DJc(t,r);case Cr.ZodRecord:return yio(t,r);case Cr.ZodLiteral:return mJc(t,r);case Cr.ZodEnum:return fJc(t);case Cr.ZodNativeEnum:return EJc(t);case Cr.ZodNullable:return bJc(t,r);case Cr.ZodOptional:return wJc(t,r);case Cr.ZodMap:return yJc(t,r);case Cr.ZodSet:return PJc(t,r);case Cr.ZodLazy:return()=>t.getter()._def;case Cr.ZodPromise:return kJc(t,r);case Cr.ZodNaN:case Cr.ZodNever:return _Jc(r);case Cr.ZodEffects:return dJc(t,r);case Cr.ZodAny:return D1(r);case Cr.ZodUnknown:return MJc(r);case Cr.ZodDefault:return uJc(t,r);case Cr.ZodBranded:return mio(t,r);case Cr.ZodReadonly:return OJc(t,r);case Cr.ZodCatch:return cJc(t,r);case Cr.ZodPipeline:return RJc(t,r);case Cr.ZodFunction:case Cr.ZodVoid:case Cr.ZodSymbol:return;default:return(n=>{})(e)}},"qj");a(Dc,"r");BJc=a((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:hio(e.currentPath,t.path)};case"none":case"seen":return t.path.lengthe.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),D1(e)):e.$refStrategy==="seen"?D1(e):void 0}},"Dp"),FJc=a((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r),"Fp"),UJc=a((t,e)=>{let r=iJc(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[d,f])=>({...u,[d]:Dc(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0)??D1(r)}),{}):void 0,o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=Dc(t._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??D1(r),c=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;c!==void 0&&(s.title=c),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let l=o===void 0?n?{...s,[r.definitionPath]:n}:s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...n,[o]:s}};return r.target==="jsonSchema7"?l.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(l.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in l||"oneOf"in l||"allOf"in l||"type"in l&&Array.isArray(l.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),l},"QB");a(QJc,"Zp");a(XKi,"JB");a(eJi,"XB");a(tJi,"YB");qJc=6e4,z8r=class{static{a(this,"WB")}constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(QUr,r=>{this._oncancel(r)}),this.setNotificationHandler(jUr,r=>{this._onprogress(r)}),this.setRequestHandler(qUr,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(HUr,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new fi(Bi.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler($Ur,async(r,n)=>{let o=a(async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let l;for(;l=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(l.type==="response"||l.type==="error"){let u=l.message,d=u.id,f=this._requestResolvers.get(d);if(f)if(this._requestResolvers.delete(d),l.type==="response")f(u);else{let h=u,m=new fi(h.error.code,h.error.message,h.error.data);f(m)}else{let h=l.type==="response"?"Response":"Error";this._onerror(Error(`${h} handler missing for request ${d}`))}continue}await this._transport?.send(l.message,{relatedRequestId:n.requestId})}}let c=await this._taskStore.getTask(s,n.sessionId);if(!c)throw new fi(Bi.InvalidParams,`Task not found: ${s}`);if(!Hie(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(Hie(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[$ie]:{taskId:s}}}}return await o()},"Y");return await o()}),this.setRequestHandler(VUr,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new fi(Bi.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(zUr,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new fi(Bi.InvalidParams,`Task not found: ${r.params.taskId}`);if(Hie(o.status))throw new fi(Bi.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new fi(Bi.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof fi?o:new fi(Bi.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),fi.fromError(Bi.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,c)=>{o?.(s,c),FIt(s)||wYc(s)?this._onresponse(s):YKi(s)?this._onrequest(s,c):xYc(s)?this._onnotification(s):this._onerror(Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=fi.fromError(Bi.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[$ie]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:Bi.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:f,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(Error(`Failed to enqueue error response: ${h}`))):o?.send(f).catch(h=>this._onerror(Error(`Failed to send an error response: ${h}`)));return}let c=new AbortController;this._requestHandlerAbortControllers.set(e.id,c);let l=IYc(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,d={signal:c.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:a(async f=>{if(c.signal.aborted)return;let h={relatedRequestId:e.id};s&&(h.relatedTask={taskId:s}),await this.notification(f,h)},"sendNotification"),sendRequest:a(async(f,h,m)=>{if(c.signal.aborted)throw new fi(Bi.ConnectionClosed,"Request was cancelled");let g={...m,relatedRequestId:e.id};s&&!g.relatedTask&&(g.relatedTask={taskId:s});let A=g.relatedTask?.taskId??s;return A&&u&&await u.updateTaskStatus(A,"input_required"),await this.request(f,h,g)},"sendRequest"),authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:u,taskRequestedTtl:l?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{l&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,d)).then(async f=>{if(c.signal.aborted)return;let h={result:f,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async f=>{if(c.signal.aborted)return;let h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:Bi.InternalError,message:f.message??"Internal error",...f.data!==void 0&&{data:f.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(f=>this._onerror(Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===c&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let c=this._responseHandlers.get(o),l=this._timeoutInfo.get(o);if(l&&c&&l.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(u){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),c(u);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),FIt(e))n(e);else{let c=new fi(e.error.code,e.error.message,e.error.data);n(c)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(FIt(e)&&e.result&&typeof e.result=="object"){let c=e.result;if(c.task&&typeof c.task=="object"){let l=c.task;typeof l.taskId=="string"&&(s=!0,this._taskProgressTokens.set(l.taskId,r))}}if(s||this._progressHandlers.delete(r),FIt(e))o(e);else{let c=fi.fromError(e.error.code,e.error.message,e.error.data);o(c)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(c){yield{type:"error",error:c instanceof fi?c:new fi(Bi.InternalError,String(c))}}return}let s;try{let c=await this.request(e,zwt,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new fi(Bi.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},Hie(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new fi(Bi.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new fi(Bi.InternalError,`Task ${s} was cancelled`)});return}if(l.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let u=l.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(d=>setTimeout(d,u)),n?.signal?.throwIfAborted()}}catch(c){yield{type:"error",error:c instanceof fi?c:new fi(Bi.InternalError,String(c))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c,task:l,relatedTask:u}=n??{};return new Promise((d,f)=>{let h=a(v=>{f(v)},"V");if(!this._transport){h(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),l&&this.assertTaskCapability(e.method)}catch(v){h(v);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),l&&(g.params={...g.params,task:l}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[$ie]:u}});let A=a(v=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(v)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(T=>this._onerror(Error(`Failed to send cancellation: ${T}`)));let b=v instanceof fi?v:new fi(Bi.RequestTimeout,String(v));f(b)},"N");this._responseHandlers.set(m,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return f(v);try{let b=r8e(r,v.result);b.success?d(b.data):f(b.error)}catch(b){f(b)}}}),n?.signal?.addEventListener("abort",()=>{A(n?.signal?.reason)});let y=n?.timeout??qJc,E=a(()=>A(fi.fromError(Bi.RequestTimeout,"Request timed out",{timeout:y})),"O");this._setupTimeout(m,y,n?.maxTotalTimeout,E,n?.resetTimeoutOnProgress??!1);let _=u?.taskId;if(_){let v=a(b=>{let T=this._responseHandlers.get(m);T?T(b):this._onerror(Error(`Response handler missing for side-channeled request ${m}`))},"M");this._requestResolvers.set(m,v),this._enqueueTaskMessage(_,{type:"request",message:g,timestamp:Date.now()}).catch(b=>{this._cleanupTimeout(m),f(b)})}else this._transport.send(g,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(v=>{this._cleanupTimeout(m),f(v)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},GUr,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},WUr,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},GYc,r)}async notification(e,r){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let s={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[$ie]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[$ie]:r.relatedTask}}}),this._transport?.send(s,r).catch(c=>this._onerror(c))});return}let o={...e,jsonrpc:"2.0"};r?.relatedTask&&(o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[$ie]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=eJi(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=tJi(e,o);return Promise.resolve(r(c,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=eJi(e);this._notificationHandlers.set(n,o=>{let s=tJi(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&YKi(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new fi(Bi.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new fi(Bi.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new fi(Bi.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw Error("No task store configured");return{createTask:a(async o=>{if(!e)throw Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},"createTask"),getTask:a(async o=>{let s=await n.getTask(o,r);if(!s)throw new fi(Bi.InvalidParams,"Failed to retrieve task: Task not found");return s},"getTask"),storeTaskResult:a(async(o,s,c)=>{await n.storeTaskResult(o,s,c,r);let l=await n.getTask(o,r);if(l){let u=zxt.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Hie(l.status)&&this._cleanupTaskProgressHandler(o)}},"storeTaskResult"),getTaskResult:a(o=>n.getTaskResult(o,r),"getTaskResult"),updateTaskStatus:a(async(o,s,c)=>{let l=await n.getTask(o,r);if(!l)throw new fi(Bi.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Hie(l.status))throw new fi(Bi.InvalidParams,`Cannot update task "${o}" from terminal status "${l.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,c,r);let u=await n.getTask(o,r);if(u){let d=zxt.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Hie(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};a(rJi,"Vj");a(jJc,"Bj");HJc=A6r(nZi(),1),GJc=A6r(E9c(),1);a($Jc,"ps");Y8r=class{static{a(this,"qz")}constructor(e){this._ajv=e??$Jc()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}},K8r=class{static{a(this,"Vz")}constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}createMessageStream(e,r){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let o=e.messages[e.messages.length-1],s=Array.isArray(o.content)?o.content:[o.content],c=s.some(f=>f.type==="tool_result"),l=e.messages.length>1?e.messages[e.messages.length-2]:void 0,u=l?Array.isArray(l.content)?l.content:[l.content]:[],d=u.some(f=>f.type==="tool_use");if(c){if(s.some(f=>f.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!d)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(d){let f=new Set(u.filter(m=>m.type==="tool_use").map(m=>m.id)),h=new Set(s.filter(m=>m.type==="tool_result").map(m=>m.toolUseId));if(f.size!==h.size||![...f].every(m=>h.has(m)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},r7r,r)}elicitInputStream(e,r){let n=this._server.getClientCapabilities(),o=e.mode??"form";switch(o){case"url":{if(!n?.elicitation?.url)throw Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw Error("Client does not support form elicitation.");break}}let s=o==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:s},Zxt,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};a(VJc,"tP");a(WJc,"aP");J8r=class extends z8r{static{a(this,"Bz")}constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Kxt.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let s=this._loggingLevels.get(o);return s?this.LOG_LEVEL_SEVERITY.get(n)this._oninitialize(n)),this.setNotificationHandler(iio,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(uio,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:c}=n.params,l=Kxt.safeParse(c);return l.success&&this._loggingLevels.set(s,l.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new K8r(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=jJc(this._capabilities,e)}setRequestHandler(e,r){let n=j8e(e)?.method;if(!n)throw Error("Schema is missing a method literal");let o;if(VL(n)){let s=n;o=s._zod?.def?.value??s.value}else{let s=n;o=s._def?.value??s.value}if(typeof o!="string")throw Error("Schema method literal must be a string");if(o==="tools/call"){let s=a(async(c,l)=>{let u=r8e(Yxt,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new fi(Bi.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,f=await Promise.resolve(r(c,l));if(d.task){let m=r8e(zwt,f);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new fi(Bi.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=r8e(t7r,f);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new fi(Bi.InvalidParams,`Invalid tools/call result: ${m}`)}return h.data},"G");return super.setRequestHandler(e,s)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){WJc(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&VJc(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:bYc.includes(r)?r:Jno,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},UUr)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],s=o.some(d=>d.type==="tool_result"),c=e.messages.length>1?e.messages[e.messages.length-2]:void 0,l=c?Array.isArray(c.content)?c.content:[c.content]:[],u=l.some(d=>d.type==="tool_use");if(s){if(o.some(d=>d.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!u)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let d=new Set(l.filter(h=>h.type==="tool_use").map(h=>h.id)),f=new Set(o.filter(h=>h.type==="tool_result").map(h=>h.toolUseId));if(d.size!==f.size||![...d].every(h=>f.has(h)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},dio,r):this.request({method:"sampling/createMessage",params:e},r7r,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support url elicitation.");let n=e;return this.request({method:"elicitation/create",params:n},Zxt,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw Error("Client does not support form elicitation.");let n=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:n},Zxt,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!s.valid)throw new fi(Bi.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(s){throw s instanceof fi?s:new fi(Bi.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},fio,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}},Eio=Symbol.for("mcp.completable");a(nJi,"zz");a(zJc,"$E");(function(t){t.Completable="McpCompletable"})(iJi||(iJi={}));YJc=/^[A-Za-z0-9._-]{1,128}$/;a(KJc,"is");a(JJc,"ns");a(oJi,"Nz");Z8r=class{static{a(this,"wz")}constructor(e){this._mcpServer=e}registerToolTask(e,r,n){let o={taskSupport:"required",...r.execution};if(o.taskSupport==="forbidden")throw Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,o,r._meta,n)}},X8r=class{static{a(this,"Dz")}constructor(e,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new J8r(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new Z8r(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(XV($8r)),this.server.assertCanSetRequestHandler(XV(Yxt)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler($8r,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,r])=>{let n={name:e,title:r.title,description:r.description,inputSchema:(()=>{let o=QFe(r.inputSchema);return o?XKi(o,{strictUnions:!0,pipeStrategy:"input"}):ZJc})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=QFe(r.outputSchema);o&&(n.outputSchema=XKi(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(Yxt,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new fi(Bi.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new fi(Bi.InvalidParams,`Tool ${e.params.name} disabled`);let o=!!e.params.task,s=n.execution?.taskSupport,c="createTask"in n.handler;if((s==="required"||s==="optional")&&!c)throw new fi(Bi.InternalError,`Tool ${e.params.name} has taskSupport '${s}' but was not registered with registerToolTask`);if(s==="required"&&!o)throw new fi(Bi.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(s==="optional"&&!o&&c)return await this.handleAutomaticTaskPolling(n,e,r);let l=await this.validateToolInput(n,e.params.arguments,e.params.name),u=await this.executeToolHandler(n,l,r);return o||await this.validateToolOutput(n,u,e.params.name),u}catch(n){if(n instanceof fi&&n.code===Bi.UrlElicitationRequired)throw n;return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,r,n){if(!e.inputSchema)return;let o=QFe(e.inputSchema)??e.inputSchema,s=await qFr(o,r);if(!s.success){let c="error"in s?s.error:"Unknown error",l=jFr(c);throw new fi(Bi.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${l}`)}return s.data}async validateToolOutput(e,r,n){if(!e.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new fi(Bi.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=QFe(e.outputSchema),s=await qFr(o,r.structuredContent);if(!s.success){let c="error"in s?s.error:"Unknown error",l=jFr(c);throw new fi(Bi.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${l}`)}}async executeToolHandler(e,r,n){let o=e.handler;if("createTask"in o){if(!n.taskStore)throw Error("No task store provided.");let s={...n,taskStore:n.taskStore};return e.inputSchema?await Promise.resolve(o.createTask(r,s)):await Promise.resolve(o.createTask(s))}return e.inputSchema?await Promise.resolve(o(r,n)):await Promise.resolve(o(n))}async handleAutomaticTaskPolling(e,r,n){if(!n.taskStore)throw Error("No task store provided for task-capable tool.");let o=await this.validateToolInput(e,r.params.arguments,r.params.name),s=e.handler,c={...n,taskStore:n.taskStore},l=o?await Promise.resolve(s.createTask(o,c)):await Promise.resolve(s.createTask(c)),u=l.task.taskId,d=l.task,f=d.pollInterval??5e3;for(;d.status!=="completed"&&d.status!=="failed"&&d.status!=="cancelled";){await new Promise(m=>setTimeout(m,f));let h=await n.taskStore.getTask(u);if(!h)throw new fi(Bi.InternalError,`Task ${u} not found during polling`);d=h}return await n.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(XV(V8r)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(V8r,async e=>{switch(e.params.ref.type){case"ref/prompt":return KKc(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return JKc(e),this.handleResourceCompletion(e,e.params.ref);default:throw new fi(Bi.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let n=this._registeredPrompts[r.name];if(!n)throw new fi(Bi.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new fi(Bi.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return qFe;let o=j8e(n.argsSchema)?.[e.params.argument.name];if(!nJi(o))return qFe;let s=zJc(o);if(!s)return qFe;let c=await s(e.params.argument.value,e.params.context);return aJi(c)}async handleResourceCompletion(e,r){let n=Object.values(this._registeredResourceTemplates).find(c=>c.resourceTemplate.uriTemplate.toString()===r.uri);if(!n){if(this._registeredResources[r.uri])return qFe;throw new fi(Bi.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return qFe;let s=await o(e.params.argument.value,e.params.context);return aJi(s)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(XV(Q8r)),this.server.assertCanSetRequestHandler(XV(q8r)),this.server.assertCanSetRequestHandler(XV(j8r)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Q8r,async(e,r)=>{let n=Object.entries(this._registeredResources).filter(([s,c])=>c.enabled).map(([s,c])=>({uri:s,name:c.name,...c.metadata})),o=[];for(let s of Object.values(this._registeredResourceTemplates)){if(!s.resourceTemplate.listCallback)continue;let c=await s.resourceTemplate.listCallback(r);for(let l of c.resources)o.push({...s.metadata,...l})}return{resources:[...n,...o]}}),this.server.setRequestHandler(q8r,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,r])=>({name:e,uriTemplate:r.resourceTemplate.uriTemplate.toString(),...r.metadata}))})),this.server.setRequestHandler(j8r,async(e,r)=>{let n=new URL(e.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new fi(Bi.InvalidParams,`Resource ${n} disabled`);return o.readCallback(n,r)}for(let s of Object.values(this._registeredResourceTemplates)){let c=s.resourceTemplate.uriTemplate.match(n.toString());if(c)return s.readCallback(n,c,r)}throw new fi(Bi.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(XV(H8r)),this.server.assertCanSetRequestHandler(XV(G8r)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(H8r,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?XJc(r.argsSchema):void 0}))})),this.server.setRequestHandler(G8r,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new fi(Bi.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new fi(Bi.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let o=QFe(n.argsSchema),s=await qFr(o,e.params.arguments);if(!s.success){let u="error"in s?s.error:"Unknown error",d=jFr(u);throw new fi(Bi.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${d}`)}let c=s.data,l=n.callback;return await Promise.resolve(l(c,r))}else{let o=n.callback;return await Promise.resolve(o(r))}}),this._promptHandlersInitialized=!0)}resource(e,r,...n){let o;typeof n[0]=="object"&&(o=n.shift());let s=n[0];if(typeof r=="string"){if(this._registeredResources[r])throw Error(`Resource ${r} is already registered`);let c=this._createRegisteredResource(e,void 0,r,o,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let c=this._createRegisteredResourceTemplate(e,void 0,r,o,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}}registerResource(e,r,n,o){if(typeof r=="string"){if(this._registeredResources[r])throw Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(e,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}_createRegisteredResource(e,r,n,o,s){let c={name:e,title:r,metadata:o,readCallback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({uri:null}),"remove"),update:a(l=>{typeof l.uri<"u"&&l.uri!==n&&(delete this._registeredResources[n],l.uri&&(this._registeredResources[l.uri]=c)),typeof l.name<"u"&&(c.name=l.name),typeof l.title<"u"&&(c.title=l.title),typeof l.metadata<"u"&&(c.metadata=l.metadata),typeof l.callback<"u"&&(c.readCallback=l.callback),typeof l.enabled<"u"&&(c.enabled=l.enabled),this.sendResourceListChanged()},"update")};return this._registeredResources[n]=c,c}_createRegisteredResourceTemplate(e,r,n,o,s){let c={resourceTemplate:n,title:r,metadata:o,readCallback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({name:null}),"remove"),update:a(u=>{typeof u.name<"u"&&u.name!==e&&(delete this._registeredResourceTemplates[e],u.name&&(this._registeredResourceTemplates[u.name]=c)),typeof u.title<"u"&&(c.title=u.title),typeof u.template<"u"&&(c.resourceTemplate=u.template),typeof u.metadata<"u"&&(c.metadata=u.metadata),typeof u.callback<"u"&&(c.readCallback=u.callback),typeof u.enabled<"u"&&(c.enabled=u.enabled),this.sendResourceListChanged()},"update")};this._registeredResourceTemplates[e]=c;let l=n.uriTemplate.variableNames;return Array.isArray(l)&&l.some(u=>!!n.completeCallback(u))&&this.setCompletionRequestHandler(),c}_createRegisteredPrompt(e,r,n,o,s){let c={title:r,description:n,argsSchema:o===void 0?void 0:nve(o),callback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({name:null}),"remove"),update:a(l=>{typeof l.name<"u"&&l.name!==e&&(delete this._registeredPrompts[e],l.name&&(this._registeredPrompts[l.name]=c)),typeof l.title<"u"&&(c.title=l.title),typeof l.description<"u"&&(c.description=l.description),typeof l.argsSchema<"u"&&(c.argsSchema=nve(l.argsSchema)),typeof l.callback<"u"&&(c.callback=l.callback),typeof l.enabled<"u"&&(c.enabled=l.enabled),this.sendPromptListChanged()},"update")};return this._registeredPrompts[e]=c,o&&Object.values(o).some(l=>{let u=l instanceof Ek?l._def?.innerType:l;return nJi(u)})&&this.setCompletionRequestHandler(),c}_createRegisteredTool(e,r,n,o,s,c,l,u,d){oJi(e);let f={title:r,description:n,inputSchema:sJi(o),outputSchema:sJi(s),annotations:c,execution:l,_meta:u,handler:d,enabled:!0,disable:a(()=>f.update({enabled:!1}),"disable"),enable:a(()=>f.update({enabled:!0}),"enable"),remove:a(()=>f.update({name:null}),"remove"),update:a(h=>{typeof h.name<"u"&&h.name!==e&&(typeof h.name=="string"&&oJi(h.name),delete this._registeredTools[e],h.name&&(this._registeredTools[h.name]=f)),typeof h.title<"u"&&(f.title=h.title),typeof h.description<"u"&&(f.description=h.description),typeof h.paramsSchema<"u"&&(f.inputSchema=nve(h.paramsSchema)),typeof h.outputSchema<"u"&&(f.outputSchema=nve(h.outputSchema)),typeof h.callback<"u"&&(f.handler=h.callback),typeof h.annotations<"u"&&(f.annotations=h.annotations),typeof h._meta<"u"&&(f._meta=h._meta),typeof h.enabled<"u"&&(f.enabled=h.enabled),this.sendToolListChanged()},"update")};return this._registeredTools[e]=f,this.setToolRequestHandlers(),this.sendToolListChanged(),f}tool(e,...r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let n,o,s,c;if(typeof r[0]=="string"&&(n=r.shift()),r.length>1){let u=r[0];if(e6r(u))o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!e6r(r[0])&&(c=r.shift());else if(typeof u=="object"&&u!==null){if(Object.values(u).some(d=>typeof d=="object"&&d!==null))throw Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);c=r.shift()}}let l=r[0];return this._createRegisteredTool(e,void 0,n,o,s,c,{taskSupport:"forbidden"},void 0,l)}registerTool(e,r,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:o,description:s,inputSchema:c,outputSchema:l,annotations:u,_meta:d}=r;return this._createRegisteredTool(e,o,s,c,l,u,{taskSupport:"forbidden"},d,n)}prompt(e,...r){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let n;typeof r[0]=="string"&&(n=r.shift());let o;r.length>1&&(o=r.shift());let s=r[0],c=this._createRegisteredPrompt(e,void 0,n,o,s);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}registerPrompt(e,r,n){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:o,description:s,argsSchema:c}=r,l=this._createRegisteredPrompt(e,o,s,c,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),l}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,r){return this.server.sendLoggingMessage(e,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}},ZJc={type:"object",properties:{}};a(_io,"XE");a(vio,"YE");a(e6r,"Oz");a(sJi,"QE");a(XJc,"os");a(XV,"l1");a(aJi,"JE");qFe={completion:{values:[],hasMore:!1}};a(eZc,"ts");a(tZc,"as");a(rZc,"ss");a(wr,"b");cJi=15e3,nZc=wr(()=>G.object({session_id:G.string(),ws_url:G.string(),work_dir:G.string().optional(),session_key:G.string().optional()})),mk=class extends Error{static{a(this,"F4")}code;constructor(e,r){super(e),this.name="DirectConnectError",this.code=r}},t6r=class{static{a(this,"UE")}options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new wxt;readyPromise;readyResolve;readyReject;abortHandler;partialChunks=[];telemetryEmitted=!1;constructor(e){this.options=e,this.abortController=e.abortController??new AbortController,this.readyPromise=new Promise((r,n)=>{this.readyResolve=r,this.readyReject=n}),this.readyPromise.catch(()=>{}),this.initialize()}get ready(){return this.readyPromise}getSessionId(){return this.sessionId}getWorkDir(){return this.workDir}async initialize(){if(this.abortController.signal.aborted){this.failInit(new R1("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new R1("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let e;try{let s=await oZc(this.options);this.sessionId=s.sessionId,this.workDir=s.workDir,e=s.wsUrl}catch(s){let c=M8e(s);if(!(c instanceof R1)){let l=c instanceof mk&&c.code?c.code:"session_create_failed";this.emitTelemetry("bad",l)}this.failInit(c);return}if(this.closed){this.options.deleteSessionOnClose&&this.sessionId&&lJi(this.options.serverUrl,this.sessionId,this.options.authToken);return}let r={};this.options.authToken&&(r.authorization=`Bearer ${this.options.authToken}`);let n=new WebSocket(e,{headers:r});this.ws=n;let o=setTimeout((s,c)=>{if(!s.readyState){c.close();let l=new mk(`WebSocket connection timeout after ${cJi}ms`);s.exitError=l,s.readyReject?.(l),s.emitTelemetry("bad","connect_timeout")}},cJi,this,n);n.addEventListener("open",()=>{clearTimeout(o),this.readyState=!0,pk(`[DirectConnectTransport] Connected to ${this.options.serverUrl}, session=${this.sessionId}`),this.readyResolve?.(),this.emitTelemetry("ok")}),n.addEventListener("message",s=>{let c=typeof s.data=="string"?s.data:"";if(c.indexOf(` +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);n.cycles==="ref"&&c(f);continue}if(h.count>1&&n.reused==="ref"){c(f);continue}}let l=a((f,h)=>{let m=this.seen.get(f),g=m.def??m.schema,A={...g};if(m.ref===null)return;let y=m.ref;if(m.ref=null,y){l(y,h);let E=this.seen.get(y).schema;E.$ref&&h.target==="draft-7"?(g.allOf=g.allOf??[],g.allOf.push(E)):(Object.assign(g,E),Object.assign(g,A))}m.isParent||this.override({zodSchema:f,jsonSchema:g,path:m.path??[]})},"G");for(let f of[...this.seen.entries()].reverse())l(f[0],{target:this.target});let u={};this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),Object.assign(u,o.def);let d=n.external?.defs??{};for(let f of this.seen.entries()){let h=f[1];h.def&&h.defId&&(d[h.defId]=h.def)}!n.external&&Object.keys(d).length>0&&(this.target==="draft-2020-12"?u.$defs=d:u.definitions=d);try{return JSON.parse(JSON.stringify(u))}catch{throw Error("Error converting schema to JSON.")}}};a(o7r,"e8");a(H0,"t$");rJc={},nJc=pt("ZodMiniType",(t,e)=>{if(!t._zod)throw Error("Uninitialized schema in ZodMiniType.");Co.init(t,e),t.def=e,t.parse=(r,n)=>cwt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>rRt(t,r,n),t.parseAsync=async(r,n)=>lwt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>nRt(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>XN(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t)}),iJc=pt("ZodMiniObject",(t,e)=>{EUr.init(t,e),nJc.init(t,e),zs.defineLazy(t,"shape",()=>e.shape)});a(WZi,"tq");a(JL,"a6");a(bve,"S0");a(x8e,"S1");a(V8r,"I3");a(p6e,"v1");a(d8e,"$9");a(W8r,"R3");a(oJc,"_M");a(sJc,"kM");a(roo,"P3");G={};ZL(G,{xid:a(()=>_Jc,"xid"),void:a(()=>qJc,"void"),uuidv7:a(()=>pJc,"uuidv7"),uuidv6:a(()=>fJc,"uuidv6"),uuidv4:a(()=>dJc,"uuidv4"),uuid:a(()=>uJc,"uuid"),url:a(()=>hJc,"url"),uppercase:a(()=>YUr,"uppercase"),unknown:a(()=>uf,"unknown"),union:a(()=>su,"union"),undefined:a(()=>UJc,"undefined"),ulid:a(()=>EJc,"ulid"),uint64:a(()=>BJc,"uint64"),uint32:a(()=>MJc,"uint32"),tuple:a(()=>$Jc,"tuple"),trim:a(()=>t7r,"trim"),treeifyError:a(()=>uro,"treeifyError"),transform:a(()=>L7r,"transform"),toUpperCase:a(()=>n7r,"toUpperCase"),toLowerCase:a(()=>r7r,"toLowerCase"),toJSONSchema:a(()=>o7r,"toJSONSchema"),templateLiteral:a(()=>eZc,"templateLiteral"),symbol:a(()=>FJc,"symbol"),superRefine:a(()=>Woo,"superRefine"),success:a(()=>ZJc,"success"),stringbool:a(()=>nZc,"stringbool"),stringFormat:a(()=>kJc,"stringFormat"),string:a(()=>Tt,"string"),strictObject:a(()=>GJc,"strictObject"),startsWith:a(()=>JUr,"startsWith"),size:a(()=>VUr,"size"),setErrorMap:a(()=>sZc,"setErrorMap"),set:a(()=>zJc,"set"),safeParseAsync:a(()=>doo,"safeParseAsync"),safeParse:a(()=>uoo,"safeParse"),registry:a(()=>SUr,"registry"),regexes:a(()=>uUr,"regexes"),regex:a(()=>WUr,"regex"),refine:a(()=>Voo,"refine"),record:a(()=>ou,"record"),readonly:a(()=>Uoo,"readonly"),property:a(()=>zio,"property"),promise:a(()=>tZc,"promise"),prettifyError:a(()=>fro,"prettifyError"),preprocess:a(()=>Q7r,"preprocess"),prefault:a(()=>Doo,"prefault"),positive:a(()=>Gio,"positive"),pipe:a(()=>Awt,"pipe"),partialRecord:a(()=>VJc,"partialRecord"),parseAsync:a(()=>loo,"parseAsync"),parse:a(()=>coo,"parse"),overwrite:a(()=>Eoe,"overwrite"),optional:a(()=>wd,"optional"),object:a(()=>Sn,"object"),number:a(()=>Lc,"number"),nullish:a(()=>JJc,"nullish"),nullable:a(()=>gwt,"nullable"),null:a(()=>k7r,"null"),normalize:a(()=>e7r,"normalize"),nonpositive:a(()=>Vio,"nonpositive"),nonoptional:a(()=>Noo,"nonoptional"),nonnegative:a(()=>Wio,"nonnegative"),never:a(()=>fRt,"never"),negative:a(()=>$io,"negative"),nativeEnum:a(()=>YJc,"nativeEnum"),nanoid:a(()=>gJc,"nanoid"),nan:a(()=>XJc,"nan"),multipleOf:a(()=>Z8e,"multipleOf"),minSize:a(()=>X8e,"minSize"),minLength:a(()=>Kve,"minLength"),mime:a(()=>XUr,"mime"),maxSize:a(()=>oRt,"maxSize"),maxLength:a(()=>sRt,"maxLength"),map:a(()=>WJc,"map"),lte:a(()=>VN,"lte"),lt:a(()=>poe,"lt"),lowercase:a(()=>zUr,"lowercase"),looseObject:a(()=>Xv,"looseObject"),locales:a(()=>bUr,"locales"),literal:a(()=>Xn,"literal"),length:a(()=>aRt,"length"),lazy:a(()=>joo,"lazy"),ksuid:a(()=>vJc,"ksuid"),keyof:a(()=>HJc,"keyof"),jwt:a(()=>RJc,"jwt"),json:a(()=>iZc,"json"),iso:a(()=>s7r,"iso"),ipv6:a(()=>bJc,"ipv6"),ipv4:a(()=>CJc,"ipv4"),intersection:a(()=>hRt,"intersection"),int64:a(()=>LJc,"int64"),int32:a(()=>NJc,"int32"),int:a(()=>G6r,"int"),instanceof:a(()=>rZc,"instanceof"),includes:a(()=>KUr,"includes"),guid:a(()=>lJc,"guid"),gte:a(()=>OI,"gte"),gt:a(()=>hoe,"gt"),globalRegistry:a(()=>iU,"globalRegistry"),getErrorMap:a(()=>aZc,"getErrorMap"),function:a(()=>too,"function"),formatError:a(()=>oUr,"formatError"),float64:a(()=>DJc,"float64"),float32:a(()=>PJc,"float32"),flattenError:a(()=>iUr,"flattenError"),file:a(()=>KJc,"file"),enum:a(()=>F1,"enum"),endsWith:a(()=>ZUr,"endsWith"),emoji:a(()=>mJc,"emoji"),email:a(()=>cJc,"email"),e164:a(()=>wJc,"e164"),discriminatedUnion:a(()=>N7r,"discriminatedUnion"),date:a(()=>jJc,"date"),custom:a(()=>$oo,"custom"),cuid2:a(()=>yJc,"cuid2"),cuid:a(()=>AJc,"cuid"),core:a(()=>Zto,"core"),config:a(()=>rC,"config"),coerce:a(()=>zoo,"coerce"),clone:a(()=>XN,"clone"),cidrv6:a(()=>TJc,"cidrv6"),cidrv4:a(()=>SJc,"cidrv4"),check:a(()=>Goo,"check"),catch:a(()=>Loo,"catch"),boolean:a(()=>G0,"boolean"),bigint:a(()=>OJc,"bigint"),base64url:a(()=>xJc,"base64url"),base64:a(()=>IJc,"base64"),array:a(()=>Ca,"array"),any:a(()=>QJc,"any"),_default:a(()=>koo,"_default"),_ZodString:a(()=>d7r,"_ZodString"),ZodXID:a(()=>E7r,"ZodXID"),ZodVoid:a(()=>Eoo,"ZodVoid"),ZodUnknown:a(()=>Aoo,"ZodUnknown"),ZodUnion:a(()=>D7r,"ZodUnion"),ZodUndefined:a(()=>hoo,"ZodUndefined"),ZodUUID:a(()=>oU,"ZodUUID"),ZodURL:a(()=>p7r,"ZodURL"),ZodULID:a(()=>y7r,"ZodULID"),ZodType:a(()=>Os,"ZodType"),ZodTuple:a(()=>boo,"ZodTuple"),ZodTransform:a(()=>O7r,"ZodTransform"),ZodTemplateLiteral:a(()=>Qoo,"ZodTemplateLiteral"),ZodSymbol:a(()=>poo,"ZodSymbol"),ZodSuccess:a(()=>Moo,"ZodSuccess"),ZodStringFormat:a(()=>kd,"ZodStringFormat"),ZodString:a(()=>cRt,"ZodString"),ZodSet:a(()=>Too,"ZodSet"),ZodRecord:a(()=>M7r,"ZodRecord"),ZodRealError:a(()=>h6e,"ZodRealError"),ZodReadonly:a(()=>Foo,"ZodReadonly"),ZodPromise:a(()=>Hoo,"ZodPromise"),ZodPrefault:a(()=>Poo,"ZodPrefault"),ZodPipe:a(()=>U7r,"ZodPipe"),ZodOptional:a(()=>B7r,"ZodOptional"),ZodObject:a(()=>pRt,"ZodObject"),ZodNumberFormat:a(()=>lCe,"ZodNumberFormat"),ZodNumber:a(()=>lRt,"ZodNumber"),ZodNullable:a(()=>woo,"ZodNullable"),ZodNull:a(()=>moo,"ZodNull"),ZodNonOptional:a(()=>F7r,"ZodNonOptional"),ZodNever:a(()=>yoo,"ZodNever"),ZodNanoID:a(()=>m7r,"ZodNanoID"),ZodNaN:a(()=>Boo,"ZodNaN"),ZodMap:a(()=>Soo,"ZodMap"),ZodLiteral:a(()=>Ioo,"ZodLiteral"),ZodLazy:a(()=>qoo,"ZodLazy"),ZodKSUID:a(()=>_7r,"ZodKSUID"),ZodJWT:a(()=>w7r,"ZodJWT"),ZodIssueCode:a(()=>oZc,"ZodIssueCode"),ZodIntersection:a(()=>Coo,"ZodIntersection"),ZodISOTime:a(()=>l7r,"ZodISOTime"),ZodISODuration:a(()=>u7r,"ZodISODuration"),ZodISODateTime:a(()=>a7r,"ZodISODateTime"),ZodISODate:a(()=>c7r,"ZodISODate"),ZodIPv6:a(()=>C7r,"ZodIPv6"),ZodIPv4:a(()=>v7r,"ZodIPv4"),ZodGUID:a(()=>mwt,"ZodGUID"),ZodFile:a(()=>xoo,"ZodFile"),ZodError:a(()=>aJc,"ZodError"),ZodEnum:a(()=>t6e,"ZodEnum"),ZodEmoji:a(()=>h7r,"ZodEmoji"),ZodEmail:a(()=>f7r,"ZodEmail"),ZodE164:a(()=>x7r,"ZodE164"),ZodDiscriminatedUnion:a(()=>voo,"ZodDiscriminatedUnion"),ZodDefault:a(()=>Roo,"ZodDefault"),ZodDate:a(()=>P7r,"ZodDate"),ZodCustomStringFormat:a(()=>foo,"ZodCustomStringFormat"),ZodCustom:a(()=>mRt,"ZodCustom"),ZodCatch:a(()=>Ooo,"ZodCatch"),ZodCUID2:a(()=>A7r,"ZodCUID2"),ZodCUID:a(()=>g7r,"ZodCUID"),ZodCIDRv6:a(()=>S7r,"ZodCIDRv6"),ZodCIDRv4:a(()=>b7r,"ZodCIDRv4"),ZodBoolean:a(()=>uRt,"ZodBoolean"),ZodBigIntFormat:a(()=>R7r,"ZodBigIntFormat"),ZodBigInt:a(()=>dRt,"ZodBigInt"),ZodBase64URL:a(()=>I7r,"ZodBase64URL"),ZodBase64:a(()=>T7r,"ZodBase64"),ZodArray:a(()=>_oo,"ZodArray"),ZodAny:a(()=>goo,"ZodAny"),TimePrecision:a(()=>Aio,"TimePrecision"),NEVER:a(()=>Xto,"NEVER"),$output:a(()=>pio,"$output"),$input:a(()=>hio,"$input"),$brand:a(()=>ero,"$brand")});s7r={};ZL(s7r,{time:a(()=>ooo,"time"),duration:a(()=>soo,"duration"),datetime:a(()=>noo,"datetime"),date:a(()=>ioo,"date"),ZodISOTime:a(()=>l7r,"ZodISOTime"),ZodISODuration:a(()=>u7r,"ZodISODuration"),ZodISODateTime:a(()=>a7r,"ZodISODateTime"),ZodISODate:a(()=>c7r,"ZodISODate")});a7r=pt("ZodISODateTime",(t,e)=>{vno.init(t,e),kd.init(t,e)});a(noo,"aq");c7r=pt("ZodISODate",(t,e)=>{Cno.init(t,e),kd.init(t,e)});a(ioo,"sq");l7r=pt("ZodISOTime",(t,e)=>{bno.init(t,e),kd.init(t,e)});a(ooo,"eq");u7r=pt("ZodISODuration",(t,e)=>{Sno.init(t,e),kd.init(t,e)});a(soo,"$V");aoo=a((t,e)=>{nUr.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>oUr(t,r),"value")},flatten:{value:a(r=>iUr(t,r),"value")},addIssue:{value:a(r=>t.issues.push(r),"value")},addIssues:{value:a(r=>t.issues.push(...r),"value")},isEmpty:{get(){return t.issues.length===0}}})},"vM"),aJc=pt("ZodError",aoo),h6e=pt("ZodError",aoo,{Parent:Error}),coo=sUr(h6e),loo=aUr(h6e),uoo=cUr(h6e),doo=lUr(h6e),Os=pt("ZodType",(t,e)=>(Co.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>XN(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>coo(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>uoo(t,r,n),t.parseAsync=async(r,n)=>loo(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>doo(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(Voo(r,n)),t.superRefine=r=>t.check(Woo(r)),t.overwrite=r=>t.check(Eoe(r)),t.optional=()=>wd(t),t.nullable=()=>gwt(t),t.nullish=()=>wd(gwt(t)),t.nonoptional=r=>Noo(t,r),t.array=()=>Ca(t),t.or=r=>su([t,r]),t.and=r=>hRt(t,r),t.transform=r=>Awt(t,L7r(r)),t.default=r=>koo(t,r),t.prefault=r=>Doo(t,r),t.catch=r=>Loo(t,r),t.pipe=r=>Awt(t,r),t.readonly=()=>Uoo(t),t.describe=r=>{let n=t.clone();return iU.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return iU.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return iU.get(t);let n=t.clone();return iU.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),d7r=pt("_ZodString",(t,e)=>{f6e.init(t,e),Os.init(t,e);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check(WUr(...n)),t.includes=(...n)=>t.check(KUr(...n)),t.startsWith=(...n)=>t.check(JUr(...n)),t.endsWith=(...n)=>t.check(ZUr(...n)),t.min=(...n)=>t.check(Kve(...n)),t.max=(...n)=>t.check(sRt(...n)),t.length=(...n)=>t.check(aRt(...n)),t.nonempty=(...n)=>t.check(Kve(1,...n)),t.lowercase=n=>t.check(zUr(n)),t.uppercase=n=>t.check(YUr(n)),t.trim=()=>t.check(t7r()),t.normalize=(...n)=>t.check(e7r(...n)),t.toLowerCase=()=>t.check(r7r()),t.toUpperCase=()=>t.check(n7r())}),cRt=pt("ZodString",(t,e)=>{f6e.init(t,e),d7r.init(t,e),t.email=r=>t.check(TUr(f7r,r)),t.url=r=>t.check(kUr(p7r,r)),t.jwt=r=>t.check($Ur(w7r,r)),t.emoji=r=>t.check(PUr(h7r,r)),t.guid=r=>t.check(fwt(mwt,r)),t.uuid=r=>t.check(IUr(oU,r)),t.uuidv4=r=>t.check(xUr(oU,r)),t.uuidv6=r=>t.check(wUr(oU,r)),t.uuidv7=r=>t.check(RUr(oU,r)),t.nanoid=r=>t.check(DUr(m7r,r)),t.guid=r=>t.check(fwt(mwt,r)),t.cuid=r=>t.check(NUr(g7r,r)),t.cuid2=r=>t.check(MUr(A7r,r)),t.ulid=r=>t.check(OUr(y7r,r)),t.base64=r=>t.check(jUr(T7r,r)),t.base64url=r=>t.check(HUr(I7r,r)),t.xid=r=>t.check(LUr(E7r,r)),t.ksuid=r=>t.check(BUr(_7r,r)),t.ipv4=r=>t.check(FUr(v7r,r)),t.ipv6=r=>t.check(UUr(C7r,r)),t.cidrv4=r=>t.check(QUr(b7r,r)),t.cidrv6=r=>t.check(qUr(S7r,r)),t.e164=r=>t.check(GUr(x7r,r)),t.datetime=r=>t.check(noo(r)),t.date=r=>t.check(ioo(r)),t.time=r=>t.check(ooo(r)),t.duration=r=>t.check(soo(r))});a(Tt,"L");kd=pt("ZodStringFormat",(t,e)=>{Qu.init(t,e),d7r.init(t,e)}),f7r=pt("ZodEmail",(t,e)=>{fno.init(t,e),kd.init(t,e)});a(cJc,"Cm");mwt=pt("ZodGUID",(t,e)=>{uno.init(t,e),kd.init(t,e)});a(lJc,"Tm");oU=pt("ZodUUID",(t,e)=>{dno.init(t,e),kd.init(t,e)});a(uJc,"xm");a(dJc,"ym");a(fJc,"fm");a(pJc,"gm");p7r=pt("ZodURL",(t,e)=>{pno.init(t,e),kd.init(t,e)});a(hJc,"hm");h7r=pt("ZodEmoji",(t,e)=>{hno.init(t,e),kd.init(t,e)});a(mJc,"um");m7r=pt("ZodNanoID",(t,e)=>{mno.init(t,e),kd.init(t,e)});a(gJc,"mm");g7r=pt("ZodCUID",(t,e)=>{gno.init(t,e),kd.init(t,e)});a(AJc,"lm");A7r=pt("ZodCUID2",(t,e)=>{Ano.init(t,e),kd.init(t,e)});a(yJc,"cm");y7r=pt("ZodULID",(t,e)=>{yno.init(t,e),kd.init(t,e)});a(EJc,"pm");E7r=pt("ZodXID",(t,e)=>{Eno.init(t,e),kd.init(t,e)});a(_Jc,"dm");_7r=pt("ZodKSUID",(t,e)=>{_no.init(t,e),kd.init(t,e)});a(vJc,"im");v7r=pt("ZodIPv4",(t,e)=>{Tno.init(t,e),kd.init(t,e)});a(CJc,"nm");C7r=pt("ZodIPv6",(t,e)=>{Ino.init(t,e),kd.init(t,e)});a(bJc,"rm");b7r=pt("ZodCIDRv4",(t,e)=>{xno.init(t,e),kd.init(t,e)});a(SJc,"om");S7r=pt("ZodCIDRv6",(t,e)=>{wno.init(t,e),kd.init(t,e)});a(TJc,"tm");T7r=pt("ZodBase64",(t,e)=>{Rno.init(t,e),kd.init(t,e)});a(IJc,"am");I7r=pt("ZodBase64URL",(t,e)=>{Pno.init(t,e),kd.init(t,e)});a(xJc,"sm");x7r=pt("ZodE164",(t,e)=>{Dno.init(t,e),kd.init(t,e)});a(wJc,"em");w7r=pt("ZodJWT",(t,e)=>{Mno.init(t,e),kd.init(t,e)});a(RJc,"$l");foo=pt("ZodCustomStringFormat",(t,e)=>{Ono.init(t,e),kd.init(t,e)});a(kJc,"Ql");lRt=pt("ZodNumber",(t,e)=>{mUr.init(t,e),Os.init(t,e),t.gt=(n,o)=>t.check(hoe(n,o)),t.gte=(n,o)=>t.check(OI(n,o)),t.min=(n,o)=>t.check(OI(n,o)),t.lt=(n,o)=>t.check(poe(n,o)),t.lte=(n,o)=>t.check(VN(n,o)),t.max=(n,o)=>t.check(VN(n,o)),t.int=n=>t.check(G6r(n)),t.safe=n=>t.check(G6r(n)),t.positive=n=>t.check(hoe(0,n)),t.nonnegative=n=>t.check(OI(0,n)),t.negative=n=>t.check(poe(0,n)),t.nonpositive=n=>t.check(VN(0,n)),t.multipleOf=(n,o)=>t.check(Z8e(n,o)),t.step=(n,o)=>t.check(Z8e(n,o)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});a(Lc,"z$");lCe=pt("ZodNumberFormat",(t,e)=>{Lno.init(t,e),lRt.init(t,e)});a(G6r,"WV");a(PJc,"Jl");a(DJc,"Xl");a(NJc,"Yl");a(MJc,"Wl");uRt=pt("ZodBoolean",(t,e)=>{gUr.init(t,e),Os.init(t,e)});a(G0,"i$");dRt=pt("ZodBigInt",(t,e)=>{AUr.init(t,e),Os.init(t,e),t.gte=(n,o)=>t.check(OI(n,o)),t.min=(n,o)=>t.check(OI(n,o)),t.gt=(n,o)=>t.check(hoe(n,o)),t.gte=(n,o)=>t.check(OI(n,o)),t.min=(n,o)=>t.check(OI(n,o)),t.lt=(n,o)=>t.check(poe(n,o)),t.lte=(n,o)=>t.check(VN(n,o)),t.max=(n,o)=>t.check(VN(n,o)),t.positive=n=>t.check(hoe(BigInt(0),n)),t.negative=n=>t.check(poe(BigInt(0),n)),t.nonpositive=n=>t.check(VN(BigInt(0),n)),t.nonnegative=n=>t.check(OI(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(Z8e(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});a(OJc,"Gl");R7r=pt("ZodBigIntFormat",(t,e)=>{Bno.init(t,e),dRt.init(t,e)});a(LJc,"Ul");a(BJc,"Hl");poo=pt("ZodSymbol",(t,e)=>{Fno.init(t,e),Os.init(t,e)});a(FJc,"Kl");hoo=pt("ZodUndefined",(t,e)=>{Uno.init(t,e),Os.init(t,e)});a(UJc,"ql");moo=pt("ZodNull",(t,e)=>{Qno.init(t,e),Os.init(t,e)});a(k7r,"T3");goo=pt("ZodAny",(t,e)=>{qno.init(t,e),Os.init(t,e)});a(QJc,"Vl");Aoo=pt("ZodUnknown",(t,e)=>{dwt.init(t,e),Os.init(t,e)});a(uf,"S$");yoo=pt("ZodNever",(t,e)=>{jno.init(t,e),Os.init(t,e)});a(fRt,"x3");Eoo=pt("ZodVoid",(t,e)=>{Hno.init(t,e),Os.init(t,e)});a(qJc,"Bl");P7r=pt("ZodDate",(t,e)=>{Gno.init(t,e),Os.init(t,e),t.min=(n,o)=>t.check(OI(n,o)),t.max=(n,o)=>t.check(VN(n,o));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});a(jJc,"zl");_oo=pt("ZodArray",(t,e)=>{yUr.init(t,e),Os.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(Kve(r,n)),t.nonempty=r=>t.check(Kve(1,r)),t.max=(r,n)=>t.check(sRt(r,n)),t.length=(r,n)=>t.check(aRt(r,n)),t.unwrap=()=>t.element});a(Ca,"W$");a(HJc,"Nl");pRt=pt("ZodObject",(t,e)=>{EUr.init(t,e),Os.init(t,e),zs.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>F1(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:uf()}),t.loose=()=>t.clone({...t._zod.def,catchall:uf()}),t.strict=()=>t.clone({...t._zod.def,catchall:fRt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>zs.extend(t,r),t.merge=r=>zs.merge(t,r),t.pick=r=>zs.pick(t,r),t.omit=r=>zs.omit(t,r),t.partial=(...r)=>zs.partial(B7r,t,r[0]),t.required=(...r)=>zs.required(F7r,t,r[0])});a(Sn,"h");a(GJc,"wl");a(Xv,"K6");D7r=pt("ZodUnion",(t,e)=>{_Ur.init(t,e),Os.init(t,e),t.options=e.options});a(su,"A$");voo=pt("ZodDiscriminatedUnion",(t,e)=>{D7r.init(t,e),$no.init(t,e)});a(N7r,"g3");Coo=pt("ZodIntersection",(t,e)=>{Vno.init(t,e),Os.init(t,e)});a(hRt,"VJ");boo=pt("ZodTuple",(t,e)=>{iRt.init(t,e),Os.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});a($Jc,"Ol");M7r=pt("ZodRecord",(t,e)=>{Wno.init(t,e),Os.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(ou,"I$");a(VJc,"Dl");Soo=pt("ZodMap",(t,e)=>{zno.init(t,e),Os.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(WJc,"Fl");Too=pt("ZodSet",(t,e)=>{Yno.init(t,e),Os.init(t,e),t.min=(...r)=>t.check(X8e(...r)),t.nonempty=r=>t.check(X8e(1,r)),t.max=(...r)=>t.check(oRt(...r)),t.size=(...r)=>t.check(VUr(...r))});a(zJc,"Zl");t6e=pt("ZodEnum",(t,e)=>{Kno.init(t,e),Os.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let c of n)if(r.has(c))s[c]=e.entries[c];else throw Error(`Key ${c} not found in enum`);return new t6e({...e,checks:[],...zs.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let c of n)if(r.has(c))delete s[c];else throw Error(`Key ${c} not found in enum`);return new t6e({...e,checks:[],...zs.normalizeParams(o),entries:s})}});a(F1,"N6");a(YJc,"Ml");Ioo=pt("ZodLiteral",(t,e)=>{Jno.init(t,e),Os.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});a(Xn,"l");xoo=pt("ZodFile",(t,e)=>{Zno.init(t,e),Os.init(t,e),t.min=(r,n)=>t.check(X8e(r,n)),t.max=(r,n)=>t.check(oRt(r,n)),t.mime=(r,n)=>t.check(XUr(Array.isArray(r)?r:[r],n))});a(KJc,"Ll");O7r=pt("ZodTransform",(t,e)=>{vUr.init(t,e),Os.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(zs.issue(s,r.value,e));else{let c=s;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=r.value),c.inst??(c.inst=t),c.continue??(c.continue=!0),r.issues.push(zs.issue(c))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});a(L7r,"bV");B7r=pt("ZodOptional",(t,e)=>{Xno.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(wd,"_$");woo=pt("ZodNullable",(t,e)=>{eio.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(gwt,"v3");a(JJc,"jl");Roo=pt("ZodDefault",(t,e)=>{tio.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});a(koo,"aM");Poo=pt("ZodPrefault",(t,e)=>{rio.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Doo,"eM");F7r=pt("ZodNonOptional",(t,e)=>{nio.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Noo,"$L");Moo=pt("ZodSuccess",(t,e)=>{iio.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(ZJc,"Al");Ooo=pt("ZodCatch",(t,e)=>{oio.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});a(Loo,"XL");Boo=pt("ZodNaN",(t,e)=>{sio.init(t,e),Os.init(t,e)});a(XJc,"Il");U7r=pt("ZodPipe",(t,e)=>{CUr.init(t,e),Os.init(t,e),t.in=e.in,t.out=e.out});a(Awt,"C3");Foo=pt("ZodReadonly",(t,e)=>{aio.init(t,e),Os.init(t,e)});a(Uoo,"GL");Qoo=pt("ZodTemplateLiteral",(t,e)=>{cio.init(t,e),Os.init(t,e)});a(eZc,"Rl");qoo=pt("ZodLazy",(t,e)=>{uio.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.getter()});a(joo,"KL");Hoo=pt("ZodPromise",(t,e)=>{lio.init(t,e),Os.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(tZc,"Pl");mRt=pt("ZodCustom",(t,e)=>{dio.init(t,e),Os.init(t,e)});a(Goo,"VL");a($oo,"vV");a(Voo,"BL");a(Woo,"zL");a(rZc,"El");nZc=a((...t)=>Xio({Pipe:U7r,Boolean:uRt,String:cRt,Transform:O7r},...t),"bl");a(iZc,"_l");a(Q7r,"u3");oZc={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};a(sZc,"Sl");a(aZc,"vl");zoo={};ZL(zoo,{string:a(()=>cZc,"string"),number:a(()=>lZc,"number"),date:a(()=>fZc,"date"),boolean:a(()=>uZc,"boolean"),bigint:a(()=>dZc,"bigint")});a(cZc,"Cl");a(lZc,"Tl");a(uZc,"xl");a(dZc,"yl");a(fZc,"fl");rC(fio());pZc=G,Yoo=pZc,Koo="2025-11-25",hZc=[Koo,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],toe="io.modelcontextprotocol/related-task",gRt="2.0",$0=$oo(t=>t!==null&&(typeof t=="object"||typeof t=="function")),Joo=su([Tt(),Lc().int()]),Zoo=Tt(),mrm=Xv({ttl:Lc().optional(),pollInterval:Lc().optional()}),mZc=Sn({ttl:Lc().optional()}),gZc=Sn({taskId:Tt()}),q7r=Xv({progressToken:Joo.optional(),[toe]:gZc.optional()}),QI=Sn({_meta:q7r.optional()}),m6e=QI.extend({task:mZc.optional()}),AZc=a(t=>m6e.safeParse(t).success,"FL"),Ly=Sn({method:Tt(),params:QI.loose().optional()}),kk=Sn({_meta:q7r.optional()}),Pk=Sn({method:Tt(),params:kk.loose().optional()}),By=Xv({_meta:q7r.optional()}),ARt=su([Tt(),Lc().int()]),Xoo=Sn({jsonrpc:Xn(gRt),id:ARt,...Ly.shape}).strict(),zZi=a(t=>Xoo.safeParse(t).success,"fV"),eso=Sn({jsonrpc:Xn(gRt),...Pk.shape}).strict(),yZc=a(t=>eso.safeParse(t).success,"LL"),j7r=Sn({jsonrpc:Xn(gRt),id:ARt,result:By}).strict(),cxt=a(t=>j7r.safeParse(t).success,"zJ");(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Li||(Li={}));H7r=Sn({jsonrpc:Xn(gRt),id:ARt.optional(),error:Sn({code:Lc().int(),message:Tt(),data:uf().optional()})}).strict(),EZc=a(t=>H7r.safeParse(t).success,"jL"),grm=su([Xoo,eso,j7r,H7r]),Arm=su([j7r,H7r]),G7r=By.strict(),_Zc=kk.extend({requestId:ARt.optional(),reason:Tt().optional()}),$7r=Pk.extend({method:Xn("notifications/cancelled"),params:_Zc}),vZc=Sn({src:Tt(),mimeType:Tt().optional(),sizes:Ca(Tt()).optional(),theme:F1(["light","dark"]).optional()}),g6e=Sn({icons:Ca(vZc).optional()}),Jve=Sn({name:Tt(),title:Tt().optional()}),tso=Jve.extend({...Jve.shape,...g6e.shape,version:Tt(),websiteUrl:Tt().optional(),description:Tt().optional()}),CZc=hRt(Sn({applyDefaults:G0().optional()}),ou(Tt(),uf())),bZc=Q7r(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,hRt(Sn({form:CZc.optional(),url:$0.optional()}),ou(Tt(),uf()).optional())),SZc=Xv({list:$0.optional(),cancel:$0.optional(),requests:Xv({sampling:Xv({createMessage:$0.optional()}).optional(),elicitation:Xv({create:$0.optional()}).optional()}).optional()}),TZc=Xv({list:$0.optional(),cancel:$0.optional(),requests:Xv({tools:Xv({call:$0.optional()}).optional()}).optional()}),IZc=Sn({experimental:ou(Tt(),$0).optional(),sampling:Sn({context:$0.optional(),tools:$0.optional()}).optional(),elicitation:bZc.optional(),roots:Sn({listChanged:G0().optional()}).optional(),tasks:SZc.optional(),extensions:ou(Tt(),$0).optional()}),xZc=QI.extend({protocolVersion:Tt(),capabilities:IZc,clientInfo:tso}),rso=Ly.extend({method:Xn("initialize"),params:xZc}),wZc=Sn({experimental:ou(Tt(),$0).optional(),logging:$0.optional(),completions:$0.optional(),prompts:Sn({listChanged:G0().optional()}).optional(),resources:Sn({subscribe:G0().optional(),listChanged:G0().optional()}).optional(),tools:Sn({listChanged:G0().optional()}).optional(),tasks:TZc.optional(),extensions:ou(Tt(),$0).optional()}),RZc=By.extend({protocolVersion:Tt(),capabilities:wZc,serverInfo:tso,instructions:Tt().optional()}),nso=Pk.extend({method:Xn("notifications/initialized"),params:kk.optional()}),V7r=Ly.extend({method:Xn("ping"),params:QI.optional()}),kZc=Sn({progress:Lc(),total:wd(Lc()),message:wd(Tt())}),PZc=Sn({...kk.shape,...kZc.shape,progressToken:Joo}),W7r=Pk.extend({method:Xn("notifications/progress"),params:PZc}),DZc=QI.extend({cursor:Zoo.optional()}),A6e=Ly.extend({params:DZc.optional()}),y6e=By.extend({nextCursor:Zoo.optional()}),NZc=F1(["working","input_required","completed","failed","cancelled"]),E6e=Sn({taskId:Tt(),status:NZc,ttl:su([Lc(),k7r()]),createdAt:Tt(),lastUpdatedAt:Tt(),pollInterval:wd(Lc()),statusMessage:wd(Tt())}),yRt=By.extend({task:E6e}),MZc=kk.merge(E6e),ywt=Pk.extend({method:Xn("notifications/tasks/status"),params:MZc}),z7r=Ly.extend({method:Xn("tasks/get"),params:QI.extend({taskId:Tt()})}),Y7r=By.merge(E6e),K7r=Ly.extend({method:Xn("tasks/result"),params:QI.extend({taskId:Tt()})}),yrm=By.loose(),J7r=A6e.extend({method:Xn("tasks/list")}),Z7r=y6e.extend({tasks:Ca(E6e)}),X7r=Ly.extend({method:Xn("tasks/cancel"),params:QI.extend({taskId:Tt()})}),OZc=By.merge(E6e),iso=Sn({uri:Tt(),mimeType:wd(Tt()),_meta:ou(Tt(),uf()).optional()}),oso=iso.extend({text:Tt()}),eQr=Tt().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),sso=iso.extend({blob:eQr}),_6e=F1(["user","assistant"]),uCe=Sn({audience:Ca(_6e).optional(),priority:Lc().min(0).max(1).optional(),lastModified:s7r.datetime({offset:!0}).optional()}),aso=Sn({...Jve.shape,...g6e.shape,uri:Tt(),description:wd(Tt()),mimeType:wd(Tt()),size:wd(Lc()),annotations:uCe.optional(),_meta:wd(Xv({}))}),LZc=Sn({...Jve.shape,...g6e.shape,uriTemplate:Tt(),description:wd(Tt()),mimeType:wd(Tt()),annotations:uCe.optional(),_meta:wd(Xv({}))}),$6r=A6e.extend({method:Xn("resources/list")}),BZc=y6e.extend({resources:Ca(aso)}),V6r=A6e.extend({method:Xn("resources/templates/list")}),FZc=y6e.extend({resourceTemplates:Ca(LZc)}),tQr=QI.extend({uri:Tt()}),UZc=tQr,W6r=Ly.extend({method:Xn("resources/read"),params:UZc}),QZc=By.extend({contents:Ca(su([oso,sso]))}),qZc=Pk.extend({method:Xn("notifications/resources/list_changed"),params:kk.optional()}),jZc=tQr,HZc=Ly.extend({method:Xn("resources/subscribe"),params:jZc}),GZc=tQr,$Zc=Ly.extend({method:Xn("resources/unsubscribe"),params:GZc}),VZc=kk.extend({uri:Tt()}),WZc=Pk.extend({method:Xn("notifications/resources/updated"),params:VZc}),zZc=Sn({name:Tt(),description:wd(Tt()),required:wd(G0())}),YZc=Sn({...Jve.shape,...g6e.shape,description:wd(Tt()),arguments:wd(Ca(zZc)),_meta:wd(Xv({}))}),z6r=A6e.extend({method:Xn("prompts/list")}),KZc=y6e.extend({prompts:Ca(YZc)}),JZc=QI.extend({name:Tt(),arguments:ou(Tt(),Tt()).optional()}),Y6r=Ly.extend({method:Xn("prompts/get"),params:JZc}),rQr=Sn({type:Xn("text"),text:Tt(),annotations:uCe.optional(),_meta:ou(Tt(),uf()).optional()}),nQr=Sn({type:Xn("image"),data:eQr,mimeType:Tt(),annotations:uCe.optional(),_meta:ou(Tt(),uf()).optional()}),iQr=Sn({type:Xn("audio"),data:eQr,mimeType:Tt(),annotations:uCe.optional(),_meta:ou(Tt(),uf()).optional()}),ZZc=Sn({type:Xn("tool_use"),name:Tt(),id:Tt(),input:ou(Tt(),uf()),_meta:ou(Tt(),uf()).optional()}),XZc=Sn({type:Xn("resource"),resource:su([oso,sso]),annotations:uCe.optional(),_meta:ou(Tt(),uf()).optional()}),eXc=aso.extend({type:Xn("resource_link")}),oQr=su([rQr,nQr,iQr,eXc,XZc]),tXc=Sn({role:_6e,content:oQr}),rXc=By.extend({description:Tt().optional(),messages:Ca(tXc)}),nXc=Pk.extend({method:Xn("notifications/prompts/list_changed"),params:kk.optional()}),iXc=Sn({title:Tt().optional(),readOnlyHint:G0().optional(),destructiveHint:G0().optional(),idempotentHint:G0().optional(),openWorldHint:G0().optional()}),oXc=Sn({taskSupport:F1(["required","optional","forbidden"]).optional()}),cso=Sn({...Jve.shape,...g6e.shape,description:Tt().optional(),inputSchema:Sn({type:Xn("object"),properties:ou(Tt(),$0).optional(),required:Ca(Tt()).optional()}).catchall(uf()),outputSchema:Sn({type:Xn("object"),properties:ou(Tt(),$0).optional(),required:Ca(Tt()).optional()}).catchall(uf()).optional(),annotations:iXc.optional(),execution:oXc.optional(),_meta:ou(Tt(),uf()).optional()}),K6r=A6e.extend({method:Xn("tools/list")}),sXc=y6e.extend({tools:Ca(cso)}),sQr=By.extend({content:Ca(oQr).default([]),structuredContent:ou(Tt(),uf()).optional(),isError:G0().optional()}),Erm=sQr.or(By.extend({toolResult:uf()})),aXc=m6e.extend({name:Tt(),arguments:ou(Tt(),uf()).optional()}),Ewt=Ly.extend({method:Xn("tools/call"),params:aXc}),cXc=Pk.extend({method:Xn("notifications/tools/list_changed"),params:kk.optional()}),_rm=Sn({autoRefresh:G0().default(!0),debounceMs:Lc().int().nonnegative().default(300)}),_wt=F1(["debug","info","notice","warning","error","critical","alert","emergency"]),lXc=QI.extend({level:_wt}),lso=Ly.extend({method:Xn("logging/setLevel"),params:lXc}),uXc=kk.extend({level:_wt,logger:Tt().optional(),data:uf()}),dXc=Pk.extend({method:Xn("notifications/message"),params:uXc}),fXc=Sn({name:Tt().optional()}),pXc=Sn({hints:Ca(fXc).optional(),costPriority:Lc().min(0).max(1).optional(),speedPriority:Lc().min(0).max(1).optional(),intelligencePriority:Lc().min(0).max(1).optional()}),hXc=Sn({mode:F1(["auto","required","none"]).optional()}),mXc=Sn({type:Xn("tool_result"),toolUseId:Tt().describe("The unique identifier for the corresponding tool call."),content:Ca(oQr).default([]),structuredContent:Sn({}).loose().optional(),isError:G0().optional(),_meta:ou(Tt(),uf()).optional()}),gXc=N7r("type",[rQr,nQr,iQr]),vwt=N7r("type",[rQr,nQr,iQr,ZZc,mXc]),AXc=Sn({role:_6e,content:su([vwt,Ca(vwt)]),_meta:ou(Tt(),uf()).optional()}),yXc=m6e.extend({messages:Ca(AXc),modelPreferences:pXc.optional(),systemPrompt:Tt().optional(),includeContext:F1(["none","thisServer","allServers"]).optional(),temperature:Lc().optional(),maxTokens:Lc().int(),stopSequences:Ca(Tt()).optional(),metadata:$0.optional(),tools:Ca(cso).optional(),toolChoice:hXc.optional()}),EXc=Ly.extend({method:Xn("sampling/createMessage"),params:yXc}),aQr=By.extend({model:Tt(),stopReason:wd(F1(["endTurn","stopSequence","maxTokens"]).or(Tt())),role:_6e,content:gXc}),uso=By.extend({model:Tt(),stopReason:wd(F1(["endTurn","stopSequence","maxTokens","toolUse"]).or(Tt())),role:_6e,content:su([vwt,Ca(vwt)])}),_Xc=Sn({type:Xn("boolean"),title:Tt().optional(),description:Tt().optional(),default:G0().optional()}),vXc=Sn({type:Xn("string"),title:Tt().optional(),description:Tt().optional(),minLength:Lc().optional(),maxLength:Lc().optional(),format:F1(["email","uri","date","date-time"]).optional(),default:Tt().optional()}),CXc=Sn({type:F1(["number","integer"]),title:Tt().optional(),description:Tt().optional(),minimum:Lc().optional(),maximum:Lc().optional(),default:Lc().optional()}),bXc=Sn({type:Xn("string"),title:Tt().optional(),description:Tt().optional(),enum:Ca(Tt()),default:Tt().optional()}),SXc=Sn({type:Xn("string"),title:Tt().optional(),description:Tt().optional(),oneOf:Ca(Sn({const:Tt(),title:Tt()})),default:Tt().optional()}),TXc=Sn({type:Xn("string"),title:Tt().optional(),description:Tt().optional(),enum:Ca(Tt()),enumNames:Ca(Tt()).optional(),default:Tt().optional()}),IXc=su([bXc,SXc]),xXc=Sn({type:Xn("array"),title:Tt().optional(),description:Tt().optional(),minItems:Lc().optional(),maxItems:Lc().optional(),items:Sn({type:Xn("string"),enum:Ca(Tt())}),default:Ca(Tt()).optional()}),wXc=Sn({type:Xn("array"),title:Tt().optional(),description:Tt().optional(),minItems:Lc().optional(),maxItems:Lc().optional(),items:Sn({anyOf:Ca(Sn({const:Tt(),title:Tt()}))}),default:Ca(Tt()).optional()}),RXc=su([xXc,wXc]),kXc=su([TXc,IXc,RXc]),PXc=su([kXc,_Xc,vXc,CXc]),DXc=m6e.extend({mode:Xn("form").optional(),message:Tt(),requestedSchema:Sn({type:Xn("object"),properties:ou(Tt(),PXc),required:Ca(Tt()).optional()})}),NXc=m6e.extend({mode:Xn("url"),message:Tt(),elicitationId:Tt(),url:Tt().url()}),MXc=su([DXc,NXc]),OXc=Ly.extend({method:Xn("elicitation/create"),params:MXc}),LXc=kk.extend({elicitationId:Tt()}),BXc=Pk.extend({method:Xn("notifications/elicitation/complete"),params:LXc}),Cwt=By.extend({action:F1(["accept","decline","cancel"]),content:Q7r(t=>t===null?void 0:t,ou(Tt(),su([Tt(),Lc(),G0(),Ca(Tt())])).optional())}),FXc=Sn({type:Xn("ref/resource"),uri:Tt()}),UXc=Sn({type:Xn("ref/prompt"),name:Tt()}),QXc=QI.extend({ref:su([UXc,FXc]),argument:Sn({name:Tt(),value:Tt()}),context:Sn({arguments:ou(Tt(),Tt()).optional()}).optional()}),J6r=Ly.extend({method:Xn("completion/complete"),params:QXc});a(qXc,"kL");a(jXc,"SL");HXc=By.extend({completion:Xv({values:Ca(Tt()).max(100),total:wd(Lc().int()),hasMore:wd(G0())})}),GXc=Sn({uri:Tt().startsWith("file://"),name:Tt().optional(),_meta:ou(Tt(),uf()).optional()}),$Xc=Ly.extend({method:Xn("roots/list"),params:QI.optional()}),dso=By.extend({roots:Ca(GXc)}),VXc=Pk.extend({method:Xn("notifications/roots/list_changed"),params:kk.optional()}),vrm=su([V7r,rso,J6r,lso,Y6r,z6r,$6r,V6r,W6r,HZc,$Zc,Ewt,K6r,z7r,K7r,J7r,X7r]),Crm=su([$7r,W7r,nso,VXc,ywt]),brm=su([G7r,aQr,uso,Cwt,dso,Y7r,Z7r,yRt]),Srm=su([V7r,EXc,OXc,$Xc,z7r,K7r,J7r,X7r]),Trm=su([$7r,W7r,dXc,WZc,qZc,cXc,nXc,ywt,BXc]),Irm=su([G7r,RZc,HXc,rXc,KZc,BZc,FZc,QZc,sQr,sXc,Y7r,Z7r,yRt]),fi=class t extends Error{static{a(this,"c")}constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===Li.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Z6r(o.elicitations,r)}return new t(e,r,n)}},Z6r=class extends fi{static{a(this,"vL")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Li.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};a(Xie,"T1");WXc=Symbol("Let zodToJsonSchema decide on which parser to use"),YZi={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},zXc=a(t=>typeof t=="string"?{...YZi,name:t}:{...YZi,...t},"xL"),YXc=a(t=>{let e=zXc(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,o])=>[o._def,{def:o._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}},"yL");a(fso,"aV");a(yl,"H$");pso=a((t,e)=>{let r=0;for(;rOc(t.innerType._def,e),"uL");a(mso,"sV");eel=a((t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let n of t.checks)switch(n.kind){case"min":yl(r,"minimum",n.value,n.message,e);break;case"max":yl(r,"maximum",n.value,n.message,e);break}return r},"Vp");a(tel,"mL");a(rel,"lL");a(nel,"cL");iel=a(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"Bp");a(oel,"pL");a(sel,"dL");z8r=void 0,HN={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:a(()=>(z8r===void 0&&(z8r=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),z8r),"emoji"),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};a(gso,"qW");a(Y8r,"$B");ael=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");a(cel,"Np");a(GN,"V4");a(Zv,"w6");a(KZi,"iL");a(Aso,"VW");a(lel,"nL");a(uel,"rL");a(del,"oL");a(fel,"tL");bwt={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};a(pel,"sL");JZi=a((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,o)=>Oc(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0},"aL");a(hel,"eL");a(mel,"$j");a(gel,"Qj");a(Ael,"wp");a(yel,"Op");Eel=a((t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return Oc(t.innerType._def,e);let r=Oc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:B1(e)},r]}:B1(e)},"Jj"),_el=a((t,e)=>{if(e.pipeStrategy==="input")return Oc(t.in._def,e);if(e.pipeStrategy==="output")return Oc(t.out._def,e);let r=Oc(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=Oc(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}},"Xj");a(vel,"Yj");a(Cel,"Wj");a(bel,"Gj");a(Sel,"Uj");a(Tel,"Hj");Iel=a((t,e)=>Oc(t.innerType._def,e),"Kj"),xel=a((t,e,r)=>{switch(e){case Cr.ZodString:return gso(t,r);case Cr.ZodNumber:return mel(t,r);case Cr.ZodObject:return gel(t,r);case Cr.ZodBigInt:return JXc(t,r);case Cr.ZodBoolean:return ZXc();case Cr.ZodDate:return mso(t,r);case Cr.ZodUndefined:return Sel(r);case Cr.ZodNull:return fel(r);case Cr.ZodArray:return KXc(t,r);case Cr.ZodUnion:case Cr.ZodDiscriminatedUnion:return pel(t,r);case Cr.ZodIntersection:return oel(t,r);case Cr.ZodTuple:return bel(t,r);case Cr.ZodRecord:return Aso(t,r);case Cr.ZodLiteral:return sel(t,r);case Cr.ZodEnum:return nel(t);case Cr.ZodNativeEnum:return uel(t);case Cr.ZodNullable:return hel(t,r);case Cr.ZodOptional:return Eel(t,r);case Cr.ZodMap:return lel(t,r);case Cr.ZodSet:return Cel(t,r);case Cr.ZodLazy:return()=>t.getter()._def;case Cr.ZodPromise:return vel(t,r);case Cr.ZodNaN:case Cr.ZodNever:return del(r);case Cr.ZodEffects:return rel(t,r);case Cr.ZodAny:return B1(r);case Cr.ZodUnknown:return Tel(r);case Cr.ZodDefault:return tel(t,r);case Cr.ZodBranded:return hso(t,r);case Cr.ZodReadonly:return Iel(t,r);case Cr.ZodCatch:return XXc(t,r);case Cr.ZodPipeline:return _el(t,r);case Cr.ZodFunction:case Cr.ZodVoid:case Cr.ZodSymbol:return;default:return(n=>{})(e)}},"qj");a(Oc,"r");wel=a((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:pso(e.currentPath,t.path)};case"none":case"seen":return t.path.lengthe.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),B1(e)):e.$refStrategy==="seen"?B1(e):void 0}},"Dp"),Rel=a((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r),"Fp"),kel=a((t,e)=>{let r=YXc(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[d,f])=>({...u,[d]:Oc(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0)??B1(r)}),{}):void 0,o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=Oc(t._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??B1(r),c=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;c!==void 0&&(s.title=c),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let l=o===void 0?n?{...s,[r.definitionPath]:n}:s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...n,[o]:s}};return r.target==="jsonSchema7"?l.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(l.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in l||"oneOf"in l||"allOf"in l||"type"in l&&Array.isArray(l.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),l},"QB");a(Pel,"Zp");a(ZZi,"JB");a(XZi,"XB");a(eXi,"YB");Del=6e4,X6r=class{static{a(this,"WB")}constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler($7r,r=>{this._oncancel(r)}),this.setNotificationHandler(W7r,r=>{this._onprogress(r)}),this.setRequestHandler(V7r,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(z7r,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new fi(Li.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(K7r,async(r,n)=>{let o=a(async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let l;for(;l=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(l.type==="response"||l.type==="error"){let u=l.message,d=u.id,f=this._requestResolvers.get(d);if(f)if(this._requestResolvers.delete(d),l.type==="response")f(u);else{let h=u,m=new fi(h.error.code,h.error.message,h.error.data);f(m)}else{let h=l.type==="response"?"Response":"Error";this._onerror(Error(`${h} handler missing for request ${d}`))}continue}await this._transport?.send(l.message,{relatedRequestId:n.requestId})}}let c=await this._taskStore.getTask(s,n.sessionId);if(!c)throw new fi(Li.InvalidParams,`Task not found: ${s}`);if(!Xie(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(Xie(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[toe]:{taskId:s}}}}return await o()},"Y");return await o()}),this.setRequestHandler(J7r,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new fi(Li.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(X7r,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new fi(Li.InvalidParams,`Task not found: ${r.params.taskId}`);if(Xie(o.status))throw new fi(Li.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new fi(Li.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof fi?o:new fi(Li.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),fi.fromError(Li.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,c)=>{o?.(s,c),cxt(s)||EZc(s)?this._onresponse(s):zZi(s)?this._onrequest(s,c):yZc(s)?this._onnotification(s):this._onerror(Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=fi.fromError(Li.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[toe]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:Li.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:f,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(Error(`Failed to enqueue error response: ${h}`))):o?.send(f).catch(h=>this._onerror(Error(`Failed to send an error response: ${h}`)));return}let c=new AbortController;this._requestHandlerAbortControllers.set(e.id,c);let l=AZc(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,d={signal:c.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:a(async f=>{if(c.signal.aborted)return;let h={relatedRequestId:e.id};s&&(h.relatedTask={taskId:s}),await this.notification(f,h)},"sendNotification"),sendRequest:a(async(f,h,m)=>{if(c.signal.aborted)throw new fi(Li.ConnectionClosed,"Request was cancelled");let g={...m,relatedRequestId:e.id};s&&!g.relatedTask&&(g.relatedTask={taskId:s});let A=g.relatedTask?.taskId??s;return A&&u&&await u.updateTaskStatus(A,"input_required"),await this.request(f,h,g)},"sendRequest"),authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:u,taskRequestedTtl:l?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{l&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,d)).then(async f=>{if(c.signal.aborted)return;let h={result:f,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async f=>{if(c.signal.aborted)return;let h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:Li.InternalError,message:f.message??"Internal error",...f.data!==void 0&&{data:f.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(f=>this._onerror(Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===c&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let c=this._responseHandlers.get(o),l=this._timeoutInfo.get(o);if(l&&c&&l.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(u){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),c(u);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),cxt(e))n(e);else{let c=new fi(e.error.code,e.error.message,e.error.data);n(c)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(cxt(e)&&e.result&&typeof e.result=="object"){let c=e.result;if(c.task&&typeof c.task=="object"){let l=c.task;typeof l.taskId=="string"&&(s=!0,this._taskProgressTokens.set(l.taskId,r))}}if(s||this._progressHandlers.delete(r),cxt(e))o(e);else{let c=fi.fromError(e.error.code,e.error.message,e.error.data);o(c)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(c){yield{type:"error",error:c instanceof fi?c:new fi(Li.InternalError,String(c))}}return}let s;try{let c=await this.request(e,yRt,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new fi(Li.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},Xie(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new fi(Li.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new fi(Li.InternalError,`Task ${s} was cancelled`)});return}if(l.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let u=l.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(d=>setTimeout(d,u)),n?.signal?.throwIfAborted()}}catch(c){yield{type:"error",error:c instanceof fi?c:new fi(Li.InternalError,String(c))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c,task:l,relatedTask:u}=n??{};return new Promise((d,f)=>{let h=a(v=>{f(v)},"V");if(!this._transport){h(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),l&&this.assertTaskCapability(e.method)}catch(v){h(v);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),l&&(g.params={...g.params,task:l}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[toe]:u}});let A=a(v=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(v)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(T=>this._onerror(Error(`Failed to send cancellation: ${T}`)));let b=v instanceof fi?v:new fi(Li.RequestTimeout,String(v));f(b)},"N");this._responseHandlers.set(m,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return f(v);try{let b=x8e(r,v.result);b.success?d(b.data):f(b.error)}catch(b){f(b)}}}),n?.signal?.addEventListener("abort",()=>{A(n?.signal?.reason)});let y=n?.timeout??Del,E=a(()=>A(fi.fromError(Li.RequestTimeout,"Request timed out",{timeout:y})),"O");this._setupTimeout(m,y,n?.maxTotalTimeout,E,n?.resetTimeoutOnProgress??!1);let _=u?.taskId;if(_){let v=a(b=>{let T=this._responseHandlers.get(m);T?T(b):this._onerror(Error(`Response handler missing for side-channeled request ${m}`))},"M");this._requestResolvers.set(m,v),this._enqueueTaskMessage(_,{type:"request",message:g,timestamp:Date.now()}).catch(b=>{this._cleanupTimeout(m),f(b)})}else this._transport.send(g,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(v=>{this._cleanupTimeout(m),f(v)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Y7r,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Z7r,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},OZc,r)}async notification(e,r){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let s={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[toe]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[toe]:r.relatedTask}}}),this._transport?.send(s,r).catch(c=>this._onerror(c))});return}let o={...e,jsonrpc:"2.0"};r?.relatedTask&&(o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[toe]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=XZi(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=eXi(e,o);return Promise.resolve(r(c,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=XZi(e);this._notificationHandlers.set(n,o=>{let s=eXi(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&zZi(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new fi(Li.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new fi(Li.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new fi(Li.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw Error("No task store configured");return{createTask:a(async o=>{if(!e)throw Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},"createTask"),getTask:a(async o=>{let s=await n.getTask(o,r);if(!s)throw new fi(Li.InvalidParams,"Failed to retrieve task: Task not found");return s},"getTask"),storeTaskResult:a(async(o,s,c)=>{await n.storeTaskResult(o,s,c,r);let l=await n.getTask(o,r);if(l){let u=ywt.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Xie(l.status)&&this._cleanupTaskProgressHandler(o)}},"storeTaskResult"),getTaskResult:a(o=>n.getTaskResult(o,r),"getTaskResult"),updateTaskStatus:a(async(o,s,c)=>{let l=await n.getTask(o,r);if(!l)throw new fi(Li.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Xie(l.status))throw new fi(Li.InvalidParams,`Cannot update task "${o}" from terminal status "${l.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,c,r);let u=await n.getTask(o,r);if(u){let d=ywt.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Xie(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};a(tXi,"Vj");a(Nel,"Bj");Mel=C9r(reo(),1),Oel=C9r(uQc(),1);a(Lel,"ps");e9r=class{static{a(this,"qz")}constructor(e){this._ajv=e??Lel()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}},t9r=class{static{a(this,"Vz")}constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}createMessageStream(e,r){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let o=e.messages[e.messages.length-1],s=Array.isArray(o.content)?o.content:[o.content],c=s.some(f=>f.type==="tool_result"),l=e.messages.length>1?e.messages[e.messages.length-2]:void 0,u=l?Array.isArray(l.content)?l.content:[l.content]:[],d=u.some(f=>f.type==="tool_use");if(c){if(s.some(f=>f.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!d)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(d){let f=new Set(u.filter(m=>m.type==="tool_use").map(m=>m.id)),h=new Set(s.filter(m=>m.type==="tool_result").map(m=>m.toolUseId));if(f.size!==h.size||![...f].every(m=>h.has(m)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},aQr,r)}elicitInputStream(e,r){let n=this._server.getClientCapabilities(),o=e.mode??"form";switch(o){case"url":{if(!n?.elicitation?.url)throw Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw Error("Client does not support form elicitation.");break}}let s=o==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:s},Cwt,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};a(Bel,"tP");a(Fel,"aP");r9r=class extends X6r{static{a(this,"Bz")}constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(_wt.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let s=this._loggingLevels.get(o);return s?this.LOG_LEVEL_SEVERITY.get(n)this._oninitialize(n)),this.setNotificationHandler(nso,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(lso,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:c}=n.params,l=_wt.safeParse(c);return l.success&&this._loggingLevels.set(s,l.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new t9r(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=Nel(this._capabilities,e)}setRequestHandler(e,r){let n=p6e(e)?.method;if(!n)throw Error("Schema is missing a method literal");let o;if(JL(n)){let s=n;o=s._zod?.def?.value??s.value}else{let s=n;o=s._def?.value??s.value}if(typeof o!="string")throw Error("Schema method literal must be a string");if(o==="tools/call"){let s=a(async(c,l)=>{let u=x8e(Ewt,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new fi(Li.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,f=await Promise.resolve(r(c,l));if(d.task){let m=x8e(yRt,f);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new fi(Li.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=x8e(sQr,f);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new fi(Li.InvalidParams,`Invalid tools/call result: ${m}`)}return h.data},"G");return super.setRequestHandler(e,s)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){Fel(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&Bel(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:hZc.includes(r)?r:Koo,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},G7r)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],s=o.some(d=>d.type==="tool_result"),c=e.messages.length>1?e.messages[e.messages.length-2]:void 0,l=c?Array.isArray(c.content)?c.content:[c.content]:[],u=l.some(d=>d.type==="tool_use");if(s){if(o.some(d=>d.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!u)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let d=new Set(l.filter(h=>h.type==="tool_use").map(h=>h.id)),f=new Set(o.filter(h=>h.type==="tool_result").map(h=>h.toolUseId));if(d.size!==f.size||![...d].every(h=>f.has(h)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},uso,r):this.request({method:"sampling/createMessage",params:e},aQr,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support url elicitation.");let n=e;return this.request({method:"elicitation/create",params:n},Cwt,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw Error("Client does not support form elicitation.");let n=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:n},Cwt,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!s.valid)throw new fi(Li.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(s){throw s instanceof fi?s:new fi(Li.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},dso,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}},yso=Symbol.for("mcp.completable");a(rXi,"zz");a(Uel,"$E");(function(t){t.Completable="McpCompletable"})(nXi||(nXi={}));Qel=/^[A-Za-z0-9._-]{1,128}$/;a(qel,"is");a(jel,"ns");a(iXi,"Nz");n9r=class{static{a(this,"wz")}constructor(e){this._mcpServer=e}registerToolTask(e,r,n){let o={taskSupport:"required",...r.execution};if(o.taskSupport==="forbidden")throw Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,o,r._meta,n)}},i9r=class{static{a(this,"Dz")}constructor(e,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new r9r(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new n9r(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(dW(K6r)),this.server.assertCanSetRequestHandler(dW(Ewt)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(K6r,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,r])=>{let n={name:e,title:r.title,description:r.description,inputSchema:(()=>{let o=d8e(r.inputSchema);return o?ZZi(o,{strictUnions:!0,pipeStrategy:"input"}):Hel})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=d8e(r.outputSchema);o&&(n.outputSchema=ZZi(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(Ewt,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new fi(Li.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new fi(Li.InvalidParams,`Tool ${e.params.name} disabled`);let o=!!e.params.task,s=n.execution?.taskSupport,c="createTask"in n.handler;if((s==="required"||s==="optional")&&!c)throw new fi(Li.InternalError,`Tool ${e.params.name} has taskSupport '${s}' but was not registered with registerToolTask`);if(s==="required"&&!o)throw new fi(Li.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(s==="optional"&&!o&&c)return await this.handleAutomaticTaskPolling(n,e,r);let l=await this.validateToolInput(n,e.params.arguments,e.params.name),u=await this.executeToolHandler(n,l,r);return o||await this.validateToolOutput(n,u,e.params.name),u}catch(n){if(n instanceof fi&&n.code===Li.UrlElicitationRequired)throw n;return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,r,n){if(!e.inputSchema)return;let o=d8e(e.inputSchema)??e.inputSchema,s=await V8r(o,r);if(!s.success){let c="error"in s?s.error:"Unknown error",l=W8r(c);throw new fi(Li.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${l}`)}return s.data}async validateToolOutput(e,r,n){if(!e.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new fi(Li.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=d8e(e.outputSchema),s=await V8r(o,r.structuredContent);if(!s.success){let c="error"in s?s.error:"Unknown error",l=W8r(c);throw new fi(Li.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${l}`)}}async executeToolHandler(e,r,n){let o=e.handler;if("createTask"in o){if(!n.taskStore)throw Error("No task store provided.");let s={...n,taskStore:n.taskStore};return e.inputSchema?await Promise.resolve(o.createTask(r,s)):await Promise.resolve(o.createTask(s))}return e.inputSchema?await Promise.resolve(o(r,n)):await Promise.resolve(o(n))}async handleAutomaticTaskPolling(e,r,n){if(!n.taskStore)throw Error("No task store provided for task-capable tool.");let o=await this.validateToolInput(e,r.params.arguments,r.params.name),s=e.handler,c={...n,taskStore:n.taskStore},l=o?await Promise.resolve(s.createTask(o,c)):await Promise.resolve(s.createTask(c)),u=l.task.taskId,d=l.task,f=d.pollInterval??5e3;for(;d.status!=="completed"&&d.status!=="failed"&&d.status!=="cancelled";){await new Promise(m=>setTimeout(m,f));let h=await n.taskStore.getTask(u);if(!h)throw new fi(Li.InternalError,`Task ${u} not found during polling`);d=h}return await n.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(dW(J6r)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(J6r,async e=>{switch(e.params.ref.type){case"ref/prompt":return qXc(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return jXc(e),this.handleResourceCompletion(e,e.params.ref);default:throw new fi(Li.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let n=this._registeredPrompts[r.name];if(!n)throw new fi(Li.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new fi(Li.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return f8e;let o=p6e(n.argsSchema)?.[e.params.argument.name];if(!rXi(o))return f8e;let s=Uel(o);if(!s)return f8e;let c=await s(e.params.argument.value,e.params.context);return sXi(c)}async handleResourceCompletion(e,r){let n=Object.values(this._registeredResourceTemplates).find(c=>c.resourceTemplate.uriTemplate.toString()===r.uri);if(!n){if(this._registeredResources[r.uri])return f8e;throw new fi(Li.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return f8e;let s=await o(e.params.argument.value,e.params.context);return sXi(s)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(dW($6r)),this.server.assertCanSetRequestHandler(dW(V6r)),this.server.assertCanSetRequestHandler(dW(W6r)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler($6r,async(e,r)=>{let n=Object.entries(this._registeredResources).filter(([s,c])=>c.enabled).map(([s,c])=>({uri:s,name:c.name,...c.metadata})),o=[];for(let s of Object.values(this._registeredResourceTemplates)){if(!s.resourceTemplate.listCallback)continue;let c=await s.resourceTemplate.listCallback(r);for(let l of c.resources)o.push({...s.metadata,...l})}return{resources:[...n,...o]}}),this.server.setRequestHandler(V6r,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,r])=>({name:e,uriTemplate:r.resourceTemplate.uriTemplate.toString(),...r.metadata}))})),this.server.setRequestHandler(W6r,async(e,r)=>{let n=new URL(e.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new fi(Li.InvalidParams,`Resource ${n} disabled`);return o.readCallback(n,r)}for(let s of Object.values(this._registeredResourceTemplates)){let c=s.resourceTemplate.uriTemplate.match(n.toString());if(c)return s.readCallback(n,c,r)}throw new fi(Li.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(dW(z6r)),this.server.assertCanSetRequestHandler(dW(Y6r)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(z6r,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?Gel(r.argsSchema):void 0}))})),this.server.setRequestHandler(Y6r,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new fi(Li.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new fi(Li.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let o=d8e(n.argsSchema),s=await V8r(o,e.params.arguments);if(!s.success){let u="error"in s?s.error:"Unknown error",d=W8r(u);throw new fi(Li.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${d}`)}let c=s.data,l=n.callback;return await Promise.resolve(l(c,r))}else{let o=n.callback;return await Promise.resolve(o(r))}}),this._promptHandlersInitialized=!0)}resource(e,r,...n){let o;typeof n[0]=="object"&&(o=n.shift());let s=n[0];if(typeof r=="string"){if(this._registeredResources[r])throw Error(`Resource ${r} is already registered`);let c=this._createRegisteredResource(e,void 0,r,o,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let c=this._createRegisteredResourceTemplate(e,void 0,r,o,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}}registerResource(e,r,n,o){if(typeof r=="string"){if(this._registeredResources[r])throw Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(e,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}_createRegisteredResource(e,r,n,o,s){let c={name:e,title:r,metadata:o,readCallback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({uri:null}),"remove"),update:a(l=>{typeof l.uri<"u"&&l.uri!==n&&(delete this._registeredResources[n],l.uri&&(this._registeredResources[l.uri]=c)),typeof l.name<"u"&&(c.name=l.name),typeof l.title<"u"&&(c.title=l.title),typeof l.metadata<"u"&&(c.metadata=l.metadata),typeof l.callback<"u"&&(c.readCallback=l.callback),typeof l.enabled<"u"&&(c.enabled=l.enabled),this.sendResourceListChanged()},"update")};return this._registeredResources[n]=c,c}_createRegisteredResourceTemplate(e,r,n,o,s){let c={resourceTemplate:n,title:r,metadata:o,readCallback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({name:null}),"remove"),update:a(u=>{typeof u.name<"u"&&u.name!==e&&(delete this._registeredResourceTemplates[e],u.name&&(this._registeredResourceTemplates[u.name]=c)),typeof u.title<"u"&&(c.title=u.title),typeof u.template<"u"&&(c.resourceTemplate=u.template),typeof u.metadata<"u"&&(c.metadata=u.metadata),typeof u.callback<"u"&&(c.readCallback=u.callback),typeof u.enabled<"u"&&(c.enabled=u.enabled),this.sendResourceListChanged()},"update")};this._registeredResourceTemplates[e]=c;let l=n.uriTemplate.variableNames;return Array.isArray(l)&&l.some(u=>!!n.completeCallback(u))&&this.setCompletionRequestHandler(),c}_createRegisteredPrompt(e,r,n,o,s){let c={title:r,description:n,argsSchema:o===void 0?void 0:bve(o),callback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({name:null}),"remove"),update:a(l=>{typeof l.name<"u"&&l.name!==e&&(delete this._registeredPrompts[e],l.name&&(this._registeredPrompts[l.name]=c)),typeof l.title<"u"&&(c.title=l.title),typeof l.description<"u"&&(c.description=l.description),typeof l.argsSchema<"u"&&(c.argsSchema=bve(l.argsSchema)),typeof l.callback<"u"&&(c.callback=l.callback),typeof l.enabled<"u"&&(c.enabled=l.enabled),this.sendPromptListChanged()},"update")};return this._registeredPrompts[e]=c,o&&Object.values(o).some(l=>{let u=l instanceof wk?l._def?.innerType:l;return rXi(u)})&&this.setCompletionRequestHandler(),c}_createRegisteredTool(e,r,n,o,s,c,l,u,d){iXi(e);let f={title:r,description:n,inputSchema:oXi(o),outputSchema:oXi(s),annotations:c,execution:l,_meta:u,handler:d,enabled:!0,disable:a(()=>f.update({enabled:!1}),"disable"),enable:a(()=>f.update({enabled:!0}),"enable"),remove:a(()=>f.update({name:null}),"remove"),update:a(h=>{typeof h.name<"u"&&h.name!==e&&(typeof h.name=="string"&&iXi(h.name),delete this._registeredTools[e],h.name&&(this._registeredTools[h.name]=f)),typeof h.title<"u"&&(f.title=h.title),typeof h.description<"u"&&(f.description=h.description),typeof h.paramsSchema<"u"&&(f.inputSchema=bve(h.paramsSchema)),typeof h.outputSchema<"u"&&(f.outputSchema=bve(h.outputSchema)),typeof h.callback<"u"&&(f.handler=h.callback),typeof h.annotations<"u"&&(f.annotations=h.annotations),typeof h._meta<"u"&&(f._meta=h._meta),typeof h.enabled<"u"&&(f.enabled=h.enabled),this.sendToolListChanged()},"update")};return this._registeredTools[e]=f,this.setToolRequestHandlers(),this.sendToolListChanged(),f}tool(e,...r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let n,o,s,c;if(typeof r[0]=="string"&&(n=r.shift()),r.length>1){let u=r[0];if(o9r(u))o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!o9r(r[0])&&(c=r.shift());else if(typeof u=="object"&&u!==null){if(Object.values(u).some(d=>typeof d=="object"&&d!==null))throw Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);c=r.shift()}}let l=r[0];return this._createRegisteredTool(e,void 0,n,o,s,c,{taskSupport:"forbidden"},void 0,l)}registerTool(e,r,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:o,description:s,inputSchema:c,outputSchema:l,annotations:u,_meta:d}=r;return this._createRegisteredTool(e,o,s,c,l,u,{taskSupport:"forbidden"},d,n)}prompt(e,...r){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let n;typeof r[0]=="string"&&(n=r.shift());let o;r.length>1&&(o=r.shift());let s=r[0],c=this._createRegisteredPrompt(e,void 0,n,o,s);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}registerPrompt(e,r,n){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:o,description:s,argsSchema:c}=r,l=this._createRegisteredPrompt(e,o,s,c,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),l}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,r){return this.server.sendLoggingMessage(e,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}},Hel={type:"object",properties:{}};a(Eso,"XE");a(_so,"YE");a(o9r,"Oz");a(oXi,"QE");a(Gel,"os");a(dW,"l1");a(sXi,"JE");f8e={completion:{values:[],hasMore:!1}};a($el,"ts");a(Vel,"as");a(Wel,"ss");a(wr,"b");aXi=15e3,zel=wr(()=>G.object({session_id:G.string(),ws_url:G.string(),work_dir:G.string().optional(),session_key:G.string().optional()})),Sk=class extends Error{static{a(this,"F4")}code;constructor(e,r){super(e),this.name="DirectConnectError",this.code=r}},s9r=class{static{a(this,"UE")}options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new Zxt;readyPromise;readyResolve;readyReject;abortHandler;partialChunks=[];telemetryEmitted=!1;constructor(e){this.options=e,this.abortController=e.abortController??new AbortController,this.readyPromise=new Promise((r,n)=>{this.readyResolve=r,this.readyReject=n}),this.readyPromise.catch(()=>{}),this.initialize()}get ready(){return this.readyPromise}getSessionId(){return this.sessionId}getWorkDir(){return this.workDir}async initialize(){if(this.abortController.signal.aborted){this.failInit(new M1("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new M1("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let e;try{let s=await Kel(this.options);this.sessionId=s.sessionId,this.workDir=s.workDir,e=s.wsUrl}catch(s){let c=o6e(s);if(!(c instanceof M1)){let l=c instanceof Sk&&c.code?c.code:"session_create_failed";this.emitTelemetry("bad",l)}this.failInit(c);return}if(this.closed){this.options.deleteSessionOnClose&&this.sessionId&&cXi(this.options.serverUrl,this.sessionId,this.options.authToken);return}let r={};this.options.authToken&&(r.authorization=`Bearer ${this.options.authToken}`);let n=new WebSocket(e,{headers:r});this.ws=n;let o=setTimeout((s,c)=>{if(!s.readyState){c.close();let l=new Sk(`WebSocket connection timeout after ${aXi}ms`);s.exitError=l,s.readyReject?.(l),s.emitTelemetry("bad","connect_timeout")}},aXi,this,n);n.addEventListener("open",()=>{clearTimeout(o),this.readyState=!0,Ck(`[DirectConnectTransport] Connected to ${this.options.serverUrl}, session=${this.sessionId}`),this.readyResolve?.(),this.emitTelemetry("ok")}),n.addEventListener("message",s=>{let c=typeof s.data=="string"?s.data:"";if(c.indexOf(` `)===-1){c&&this.partialChunks.push(c);return}let l=this.partialChunks.join("")+c;this.partialChunks.length=0;let u=l.split(` -`),d=u.pop()??"";d&&this.partialChunks.push(d);for(let f of u){if(!f)continue;let h;try{h=GN(f)}catch(m){pk(`DirectConnect: dropped malformed JSON line (${f.length} bytes): ${m}`);continue}this.messages.enqueue(h)}}),n.addEventListener("error",()=>{clearTimeout(o);let s=new mk("WebSocket connection error");this.exitError=s,this.readyReject?.(s),this.messages.done(),!this.readyState&&this.emitTelemetry("bad","ws_error")}),n.addEventListener("close",s=>{let c=this.readyState;this.readyState=!1,this.closed=!0;let l=s.code!==1e3&&s.code!==1001;l&&!this.exitError&&(this.exitError=new mk(`WebSocket closed abnormally: ${s.code} ${s.reason}`)),this.messages.done(),c&&l&&!this.abortController.signal.aborted&&this.emitTelemetry("sad","ws_closed_abnormally")})}emitTelemetry(e,r){this.telemetryEmitted||(this.telemetryEmitted=!0,e==="ok"?bXi("transport_direct_connect"):e==="bad"?SXi("transport_direct_connect",r??"unknown"):tGc("transport_direct_connect",r??"unknown"))}failInit(e){this.exitError=e,this.closed=!0,this.readyReject?.(e),this.messages.done()}async write(e){if(this.abortController.signal.aborted)throw new R1("Operation aborted");if(this.readyState||await this.readyPromise,!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new mk("Transport is not ready for writing");this.ws.send(e)}isReady(){return this.readyState&&this.ws?.readyState===WebSocket.OPEN}endInput(){}[Symbol.dispose](){this.close()}close(){this.closed||(this.closed=!0,this.readyState=!1,this.abortHandler&&(this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0),this.abortController.signal.aborted||this.abortController.abort(),this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.close(1e3,"Normal closure"),this.messages.done(),this.options.deleteSessionOnClose&&this.sessionId&&lJi(this.options.serverUrl,this.sessionId,this.options.authToken))}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}};a(iZc,"$e");a(oZc,"Qe");a(lJi,"GE");a(r6r,"nJ");a(sZc,"Xe");a(aZc,"Ye");a(cZc,"We");a(lZc,"Ge");a(Ywt,"h0");(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(uJi||(uJi={}));_Jh=Array(20).fill(0).map((t,e)=>" ".repeat(e)),vJh={" ":{"\n":Array(200).fill(0).map((t,e)=>` +`),d=u.pop()??"";d&&this.partialChunks.push(d);for(let f of u){if(!f)continue;let h;try{h=ZN(f)}catch(m){Ck(`DirectConnect: dropped malformed JSON line (${f.length} bytes): ${m}`);continue}this.messages.enqueue(h)}}),n.addEventListener("error",()=>{clearTimeout(o);let s=new Sk("WebSocket connection error");this.exitError=s,this.readyReject?.(s),this.messages.done(),!this.readyState&&this.emitTelemetry("bad","ws_error")}),n.addEventListener("close",s=>{let c=this.readyState;this.readyState=!1,this.closed=!0;let l=s.code!==1e3&&s.code!==1001;l&&!this.exitError&&(this.exitError=new Sk(`WebSocket closed abnormally: ${s.code} ${s.reason}`)),this.messages.done(),c&&l&&!this.abortController.signal.aborted&&this.emitTelemetry("sad","ws_closed_abnormally")})}emitTelemetry(e,r){this.telemetryEmitted||(this.telemetryEmitted=!0,e==="ok"?Cto("transport_direct_connect"):e==="bad"?bto("transport_direct_connect",r??"unknown"):VVc("transport_direct_connect",r??"unknown"))}failInit(e){this.exitError=e,this.closed=!0,this.readyReject?.(e),this.messages.done()}async write(e){if(this.abortController.signal.aborted)throw new M1("Operation aborted");if(this.readyState||await this.readyPromise,!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Sk("Transport is not ready for writing");this.ws.send(e)}isReady(){return this.readyState&&this.ws?.readyState===WebSocket.OPEN}endInput(){}[Symbol.dispose](){this.close()}close(){this.closed||(this.closed=!0,this.readyState=!1,this.abortHandler&&(this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0),this.abortController.signal.aborted||this.abortController.abort(),this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.close(1e3,"Normal closure"),this.messages.done(),this.options.deleteSessionOnClose&&this.sessionId&&cXi(this.options.serverUrl,this.sessionId,this.options.authToken))}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}};a(Yel,"$e");a(Kel,"Qe");a(cXi,"GE");a(a9r,"nJ");a(Jel,"Xe");a(Zel,"Ye");a(Xel,"We");a(etl,"Ge");a(ERt,"h0");(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(lXi||(lXi={}));xrm=Array(20).fill(0).map((t,e)=>" ".repeat(e)),wrm={" ":{"\n":Array(200).fill(0).map((t,e)=>` `+" ".repeat(e)),"\r":Array(200).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":Array(200).fill(0).map((t,e)=>`\r `+" ".repeat(e))}," ":{"\n":Array(200).fill(0).map((t,e)=>` `+" ".repeat(e)),"\r":Array(200).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":Array(200).fill(0).map((t,e)=>`\r -`+" ".repeat(e))}};(function(t){t.DEFAULT={allowTrailingComma:!1}})(dJi||(dJi={}));(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(fJi||(fJi={}));(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(pJi||(pJi={}));(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(hJi||(hJi={}));a(Sio,"rW");iW=n7r.default.homedir(),i7r=n7r.default.tmpdir(),{env:ive}=ewt.default,uZc=a(t=>{let e=nf.default.join(iW,"Library");return{data:nf.default.join(e,"Application Support",t),config:nf.default.join(e,"Preferences",t),cache:nf.default.join(e,"Caches",t),log:nf.default.join(e,"Logs",t),temp:nf.default.join(i7r,t)}},"Oe"),dZc=a(t=>{let e=ive.APPDATA||nf.default.join(iW,"AppData","Roaming"),r=ive.LOCALAPPDATA||nf.default.join(iW,"AppData","Local");return{data:nf.default.join(r,t,"Data"),config:nf.default.join(e,t,"Config"),cache:nf.default.join(r,t,"Cache"),log:nf.default.join(r,t,"Log"),temp:nf.default.join(i7r,t)}},"De"),fZc=a(t=>{let e=nf.default.basename(iW);return{data:nf.default.join(ive.XDG_DATA_HOME||nf.default.join(iW,".local","share"),t),config:nf.default.join(ive.XDG_CONFIG_HOME||nf.default.join(iW,".config"),t),cache:nf.default.join(ive.XDG_CACHE_HOME||nf.default.join(iW,".cache"),t),log:nf.default.join(ive.XDG_STATE_HOME||nf.default.join(iW,".local","state"),t),temp:nf.default.join(i7r,e,t)}},"Fe");a(pZc,"Mz");CJh=pZc("claude-cli");a(hZc,"Ze");a(mZc,"wE");gZc=100,$Fr=[];a(AZc,"Le");yZc=[],mJi=null,bJh=Py(()=>process.argv.includes("--hard-fail"));a(Tio,"oW");Z_e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Iio=new Set,n6r=typeof process=="object"&&process?process:{},xio=a((t,e,r,n)=>{typeof n6r.emitWarning=="function"?n6r.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"ZE"),twt=globalThis.AbortController,gJi=globalThis.AbortSignal;if(typeof twt>"u"){gJi=class{static{a(this,"DE")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,n){this._onabort.push(n)}},twt=class{static{a(this,"tW")}constructor(){e()}signal=new gJi;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let n of this.signal._onabort)n(r);this.signal.onabort?.(r)}}};let t=n6r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,xio("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"Q")}EZc=a(t=>!Iio.has(t),"Ae"),eW=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"p1"),wio=a(t=>eW(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?cve:null:null,"ME"),cve=class extends Array{static{a(this,"rJ")}constructor(e){super(e),this.fill(0)}},i6r=class t{static{a(this,"I9")}heap;length;static#e=!1;static create(e){let r=wio(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},o6r=class t{static{a(this,"aW")}#e;#t;#r;#n;#i;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#a;#c;#u;#l;#p;#g;#A;#h;#v;#m;#b;#T;#E;#C;#S;#y;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#E,sizes:e.#b,keyMap:e.#c,keyList:e.#u,valList:e.#l,next:e.#p,prev:e.#g,get head(){return e.#A},get tail(){return e.#h},free:e.#v,isBackgroundFetch:a(r=>e.#f(r),"isBackgroundFetch"),backgroundFetch:a((r,n,o,s)=>e.#U(r,n,o,s),"backgroundFetch"),moveToTail:a(r=>e.#O(r),"moveToTail"),indexes:a(r=>e.#I(r),"indexes"),rindexes:a(r=>e.#x(r),"rindexes"),isStale:a(r=>e.#_(r),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#a}get size(){return this.#s}get fetchMethod(){return this.#i}get memoMethod(){return this.#o}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(e){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,maxEntrySize:A=0,sizeCalculation:y,fetchMethod:E,memoMethod:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:R}=e;if(r!==0&&!eW(r))throw TypeError("max option must be a nonnegative integer");let x=r?wio(r):Array;if(!x)throw Error("invalid max value: "+r);if(this.#e=r,this.#t=g,this.maxEntrySize=A||this.#t,this.sizeCalculation=y,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw TypeError("sizeCalculation set to non-function")}if(_!==void 0&&typeof _!="function")throw TypeError("memoMethod must be a function if defined");if(this.#o=_,E!==void 0&&typeof E!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#i=E,this.#S=!!E,this.#c=new Map,this.#u=Array(r).fill(void 0),this.#l=Array(r).fill(void 0),this.#p=new x(r),this.#g=new x(r),this.#A=0,this.#h=0,this.#v=i6r.create(r),this.#s=0,this.#a=0,typeof d=="function"&&(this.#r=d),typeof f=="function"?(this.#n=f,this.#m=[]):(this.#n=void 0,this.#m=void 0),this.#C=!!this.#r,this.#y=!!this.#n,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!w,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!eW(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!eW(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=eW(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!eW(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError("At least one of max, maxSize, or ttl is required");!this.ttlAutopurge&&!this.#e&&!this.#t&&EZc("LRU_CACHE_UNBOUNDED")&&(Iio.add("LRU_CACHE_UNBOUNDED"),xio("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",t))}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#k(){let e=new cve(this.#e),r=new cve(this.#e);this.#E=e,this.#T=r,this.#L=(s,c,l=Z_e.now())=>{if(r[s]=c!==0?l:0,e[s]=c,c!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#_(s)&&this.#w(this.#u[s],"expire")},c+1);u.unref&&u.unref()}},this.#R=s=>{r[s]=e[s]!==0?Z_e.now():0},this.#d=(s,c)=>{if(e[c]){let l=e[c],u=r[c];if(!l||!u)return;s.ttl=l,s.start=u,s.now=n||o();let d=s.now-u;s.remainingTTL=l-d}};let n=0,o=a(()=>{let s=Z_e.now();if(this.ttlResolution>0){n=s;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref()}return s},"Y");this.getRemainingTTL=s=>{let c=this.#c.get(s);if(c===void 0)return 0;let l=e[c],u=r[c];if(!l||!u)return 1/0;let d=(n||o())-u;return l-d},this.#_=s=>{let c=r[s],l=e[s];return!!l&&!!c&&(n||o())-c>l}}#R=a(()=>{},"#E");#d=a(()=>{},"#R");#L=a(()=>{},"#y");#_=a(()=>!1,"#N");#D(){let e=new cve(this.#e);this.#a=0,this.#b=e,this.#P=r=>{this.#a-=e[r],e[r]=0},this.#B=(r,n,o,s)=>{if(this.#f(n))return 0;if(!eW(o))if(s){if(typeof s!="function")throw TypeError("sizeCalculation must be a function");if(o=s(n,r),!eW(o))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o},this.#N=(r,n,o)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#a>s;)this.#M(!0)}this.#a+=e[r],o&&(o.entrySize=n,o.totalCalculatedSize=this.#a)}}#P=a(e=>{},"#b");#N=a((e,r,n)=>{},"#v");#B=a((e,r,n,o)=>{if(n||o)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#f");*#I({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#h;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#A));)r=this.#g[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#A;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#h));)r=this.#p[r]}#F(e){return e!==void 0&&this.#c.get(this.#u[e])===e}*entries(){for(let e of this.#I())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*rentries(){for(let e of this.#x())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*keys(){for(let e of this.#I()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*values(){for(let e of this.#I())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}*rvalues(){for(let e of this.#x())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;if(s!==void 0&&e(s,this.#u[n],this))return this.get(this.#u[n],r)}}forEach(e,r=this){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}rforEach(e,r=this){for(let n of this.#x()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#_(r)&&(this.#w(this.#u[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let n=this.#l[r],o=this.#f(n)?n.__staleWhileFetching:n;if(o===void 0)return;let s={value:o};if(this.#E&&this.#T){let c=this.#E[r],l=this.#T[r];if(c&&l){let u=c-(Z_e.now()-l);s.ttl=u,s.start=Date.now()}}return this.#b&&(s.size=this.#b[r]),s}dump(){let e=[];for(let r of this.#I({allowStale:!0})){let n=this.#u[r],o=this.#l[r],s=this.#f(o)?o.__staleWhileFetching:o;if(s===void 0||n===void 0)continue;let c={value:s};if(this.#E&&this.#T){c.ttl=this.#E[r];let l=Z_e.now()-this.#T[r];c.start=Math.floor(Date.now()-l)}this.#b&&(c.size=this.#b[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=Z_e.now()-o}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:s,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,f=this.#B(e,r,n.size||0,l);if(this.maxEntrySize&&f>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#w(e,"set"),this;let h=this.#s===0?void 0:this.#c.get(e);if(h===void 0)h=this.#s===0?this.#h:this.#v.length!==0?this.#v.pop():this.#s===this.#e?this.#M(!1):this.#s,this.#u[h]=e,this.#l[h]=r,this.#c.set(e,h),this.#p[this.#h]=h,this.#g[h]=this.#h,this.#h=h,this.#s++,this.#N(h,f,u),u&&(u.set="add"),d=!1;else{this.#O(h);let m=this.#l[h];if(r!==m){if(this.#S&&this.#f(m)){m.__abortController.abort(Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!c&&(this.#C&&this.#r?.(g,e,"set"),this.#y&&this.#m?.push([g,e,"set"]))}else c||(this.#C&&this.#r?.(m,e,"set"),this.#y&&this.#m?.push([m,e,"set"]));if(this.#P(h),this.#N(h,f,u),this.#l[h]=r,u){u.set="replace";let g=m&&this.#f(m)?m.__staleWhileFetching:m;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(o!==0&&!this.#E&&this.#k(),this.#E&&(d||this.#L(h,o,s),u&&this.#d(u,h)),!c&&this.#y&&this.#m){let m=this.#m,g;for(;g=m?.shift();)this.#n?.(...g)}return this}pop(){try{for(;this.#s;){let e=this.#l[this.#A];if(this.#M(!0),this.#f(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#y&&this.#m){let e=this.#m,r;for(;r=e?.shift();)this.#n?.(...r)}}}#M(e){let r=this.#A,n=this.#u[r],o=this.#l[r];return this.#S&&this.#f(o)?o.__abortController.abort(Error("evicted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(o,n,"evict"),this.#y&&this.#m?.push([o,n,"evict"])),this.#P(r),e&&(this.#u[r]=void 0,this.#l[r]=void 0,this.#v.push(r)),this.#s===1?(this.#A=this.#h=0,this.#v.length=0):this.#A=this.#p[r],this.#c.delete(n),this.#s--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:o}=r,s=this.#c.get(e);if(s!==void 0){let c=this.#l[s];if(this.#f(c)&&c.__staleWhileFetching===void 0)return!1;if(this.#_(s))o&&(o.has="stale",this.#d(o,s));else return n&&this.#R(s),o&&(o.has="hit",this.#d(o,s)),!0}else o&&(o.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,o=this.#c.get(e);if(o===void 0||!n&&this.#_(o))return;let s=this.#l[o];return this.#f(s)?s.__staleWhileFetching:s}#U(e,r,n,o){let s=r===void 0?void 0:this.#l[r];if(this.#f(s))return s;let c=new twt,{signal:l}=n;l?.addEventListener("abort",()=>c.abort(l.reason),{signal:c.signal});let u={signal:c.signal,options:n,context:o},d=a((y,E=!1)=>{let{aborted:_}=c.signal,v=n.ignoreFetchAbort&&y!==void 0;if(n.status&&(_&&!E?(n.status.fetchAborted=!0,n.status.fetchError=c.signal.reason,v&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),_&&!v&&!E)return h(c.signal.reason);let b=g;return this.#l[r]===g&&(y===void 0?b.__staleWhileFetching?this.#l[r]=b.__staleWhileFetching:this.#w(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,y,u.options))),y},"H"),f=a(y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=y),h(y)),"q"),h=a(y=>{let{aborted:E}=c.signal,_=E&&n.allowStaleOnFetchAbort,v=_||n.allowStaleOnFetchRejection,b=v||n.noDeleteOnFetchRejection,T=g;if(this.#l[r]===g&&(!b||T.__staleWhileFetching===void 0?this.#w(e,"fetch"):_||(this.#l[r]=T.__staleWhileFetching)),v)return n.status&&T.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw y},"V"),m=a((y,E)=>{let _=this.#i?.(e,s,u);_&&_ instanceof Promise&&_.then(v=>y(v===void 0?void 0:v),E),c.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(y(void 0),n.allowStaleOnFetchAbort&&(y=a(v=>d(v,!0),"w")))})},"B");n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(d,f),A=Object.assign(g,{__abortController:c,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,A,{...u.options,status:void 0}),r=this.#c.get(e)):this.#l[r]=A,A}#f(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof twt}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:y,forceRefresh:E=!1,status:_,signal:v}=r;if(!this.#S)return _&&(_.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:_});let b={allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,ttl:c,noDisposeOnSet:l,size:u,sizeCalculation:d,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:g,status:_,signal:v},T=this.#c.get(e);if(T===void 0){_&&(_.fetch="miss");let w=this.#U(e,T,b,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let D=n&&w.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",D&&(_.returnedStale=!0)),D?w.__staleWhileFetching:w.__returned=w}let R=this.#_(T);if(!E&&!R)return _&&(_.fetch="hit"),this.#O(T),o&&this.#R(T),_&&this.#d(_,T),w;let x=this.#U(e,T,b,y),P=x.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=R?"stale":"refresh",P&&R&&(_.returnedStale=!0)),P?x.__staleWhileFetching:x.__returned=x}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#o;if(!n)throw Error("no memoMethod provided to constructor");let{context:o,forceRefresh:s,...c}=r,l=this.get(e,c);if(!s&&l!==void 0)return l;let u=n(e,l,{options:c,context:o});return this.set(e,u,c),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:c}=r,l=this.#c.get(e);if(l!==void 0){let u=this.#l[l],d=this.#f(u);return c&&this.#d(c,l),this.#_(l)?(c&&(c.get="stale"),d?(c&&n&&u.__staleWhileFetching!==void 0&&(c.returnedStale=!0),n?u.__staleWhileFetching:void 0):(s||this.#w(e,"expire"),c&&n&&(c.returnedStale=!0),n?u:void 0)):(c&&(c.get="hit"),d?u.__staleWhileFetching:(this.#O(l),o&&this.#R(l),u))}else c&&(c.get="miss")}#Q(e,r){this.#g[r]=e,this.#p[e]=r}#O(e){e!==this.#h&&(e===this.#A?this.#A=this.#p[e]:this.#Q(this.#g[e],this.#p[e]),this.#Q(this.#h,e),this.#h=e)}delete(e){return this.#w(e,"delete")}#w(e,r){let n=!1;if(this.#s!==0){let o=this.#c.get(e);if(o!==void 0)if(n=!0,this.#s===1)this.#q(r);else{this.#P(o);let s=this.#l[o];if(this.#f(s)?s.__abortController.abort(Error("deleted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(s,e,r),this.#y&&this.#m?.push([s,e,r])),this.#c.delete(e),this.#u[o]=void 0,this.#l[o]=void 0,o===this.#h)this.#h=this.#g[o];else if(o===this.#A)this.#A=this.#p[o];else{let c=this.#g[o];this.#p[c]=this.#p[o];let l=this.#p[o];this.#g[l]=this.#g[o]}this.#s--,this.#v.push(o)}}if(this.#y&&this.#m?.length){let o=this.#m,s;for(;s=o?.shift();)this.#n?.(...s)}return n}clear(){return this.#q("delete")}#q(e){for(let r of this.#x({allowStale:!0})){let n=this.#l[r];if(this.#f(n))n.__abortController.abort(Error("deleted"));else{let o=this.#u[r];this.#C&&this.#r?.(n,o,e),this.#y&&this.#m?.push([n,o,e])}}if(this.#c.clear(),this.#l.fill(void 0),this.#u.fill(void 0),this.#E&&this.#T&&(this.#E.fill(0),this.#T.fill(0)),this.#b&&this.#b.fill(0),this.#A=0,this.#h=0,this.#v.length=0,this.#a=0,this.#s=0,this.#y&&this.#m){let r=this.#m,n;for(;n=r?.shift();)this.#n?.(...n)}}};a(_Zc,"LE");vZc=8192;a(Rio,"AE");AJi=_Zc(Rio,t=>t,50),Kwt=Object.assign(function(t,e=!0){if(!t)return null;let r=t.length>vZc?Rio(t,e):AJi(t,e);return r.ok?r.value:null},{cache:AJi.cache}),Jwt=Py(()=>{try{if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";if(process.platform==="linux"){if(process.env.WSL_DISTRO_NAME||process.env.WSL_INTEROP)return"wsl";try{let t=DI().readFileSync("/proc/version",{encoding:"utf8"});if(t.toLowerCase().includes("microsoft")||t.toLowerCase().includes("wsl"))return"wsl"}catch(t){ru(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"})}return"linux"}return"unknown"}catch(t){return Tio(t),"unknown"}}),TJh=Py(()=>{if(process.platform==="linux")try{let t=DI().readFileSync("/proc/version",{encoding:"utf8"}),e=t.match(/WSL(\d+)/i);return e&&e[1]?e[1]:t.toLowerCase().includes("microsoft")?"1":void 0}catch(t){ru(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"});return}}),IJh=Py(async()=>{if(process.platform!=="linux")return;let t={linuxKernel:(0,o7r.release)()};try{let e=await(0,Pio.readFile)("/etc/os-release","utf8");for(let r of e.split(` -`)){let n=r.match(/^(ID|VERSION_ID)=(.*)$/);if(n&&n[1]&&n[2]){let o=n[2].replace(/^"|"$/g,"");n[1]==="ID"?t.linuxDistroId=o:t.linuxDistroVersion=o}}}catch{}return t}),xJh=Py(()=>{if(process.platform!=="darwin")return;let t=(0,o7r.release)().match(/^(\d+)\./);if(!(!t||!t[1]))return parseInt(t[1],10)-9}),P8e=Py(function(){switch(Jwt()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),wJh=Py(function(){return(0,kio.join)(P8e(),"managed-settings.d")}),CZc=wr(()=>G.object({allowedDomains:G.array(G.string()).optional(),deniedDomains:G.array(G.string()).optional().describe("Domains that are always blocked, even if matched by allowedDomains. Supports the same wildcard syntax as allowedDomains. Merged from all settings sources regardless of allowManagedDomainsOnly."),allowManagedDomainsOnly:G.boolean().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:G.array(G.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:G.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:G.boolean().optional(),allowMachLookup:G.array(G.string().refine(t=>!(t.endsWith("*")?t.slice(0,-1):t).includes("*"),{message:'Wildcards are only allowed as a single trailing "*" (e.g., "com.example.*" or "*" for all services).'})).optional().describe('macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., "com.apple.coresimulator.*"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright.'),httpProxyPort:G.number().optional(),socksProxyPort:G.number().optional(),tlsTerminate:G.object({caCertPath:G.string().min(1).optional(),caKeyPath:G.string().min(1).optional()}).optional().describe("[EXPERIMENTAL] Enable in-process TLS termination so the per-request filter can see HTTPS request bodies. Provide a CA cert+key, or omit both to have sandbox-runtime generate an ephemeral one for the session.")}).optional()),bZc=wr(()=>G.object({allowWrite:G.array(G.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:G.array(G.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:G.array(G.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:G.array(G.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:G.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used.")}).optional()),SZc=wr(()=>G.object({enabled:G.boolean().optional(),failIfUnavailable:G.boolean().optional().describe("Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies or unsupported platform). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate."),autoAllowBashIfSandboxed:G.boolean().optional(),allowUnsandboxedCommands:G.boolean().optional().describe("Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."),network:CZc(),filesystem:bZc(),ignoreViolations:G.record(G.string(),G.array(G.string())).optional(),enableWeakerNestedSandbox:G.boolean().optional(),enableWeakerNetworkIsolation:G.boolean().optional().describe("macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. **Reduces security** \u2014 opens a potential data exfiltration vector through the trustd service. Default: false"),excludedCommands:G.array(G.string()).optional(),ripgrep:G.object({command:G.string(),args:G.array(G.string()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support"),bwrapPath:G.preprocess(t=>typeof t=="string"&&(0,s6r.isAbsolute)(t)?t:void 0,G.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the bwrap (bubblewrap) binary. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings."),socatPath:G.preprocess(t=>typeof t=="string"&&(0,s6r.isAbsolute)(t)?t:void 0,G.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the socat binary used for the sandbox network proxy. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.")}).passthrough()),TZc=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","notifications_disabled"],IZc=["normal","vim"],xZc=["auto","tmux","in-process"],wZc=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],RZc=["auto",...wZc],RJh=Jwt()==="macos"?"\u23FA":"\u25CF",s7r=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],kZc=[...s7r,"bubble"],PZc=kZc,kJh=wr(()=>Kno.enum(PZc)),PJh=wr(()=>Kno.enum(s7r)),DZc=["bash","powershell"],jFe=wr(()=>G.string().optional().describe('Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.'));a(NZc,"Se");MZc=wr(()=>{let{BashCommandHookSchema:t,PromptHookSchema:e,AgentHookSchema:r,HttpHookSchema:n,McpToolHookSchema:o}=NZc();return G.discriminatedUnion("type",[t,e,r,n,o])}),OZc=wr(()=>G.object({matcher:G.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:G.array(MZc()).describe("List of hooks to execute when the matcher matches")})),rwt=wr(()=>G.partialRecord(G.enum(ywt),G.array(OZc()))),DJh=wr(()=>G.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),NJh=wr(()=>G.enum(["stdio","sse","sse-ide","http","ws","sdk"])),$ve=wr(()=>G.literal("comms").optional().catch(void 0)),mW=wr(()=>G.number().int().positive()),LZc=wr(()=>G.object({type:G.literal("stdio").optional(),command:G.string().min(1,"Command cannot be empty"),args:G.array(G.string()).default([]),env:G.record(G.string(),G.string()).optional(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),BZc=wr(()=>G.boolean()),Dio=wr(()=>G.object({clientId:G.string().optional(),callbackPort:G.number().int().positive().optional(),authServerMetadataUrl:G.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:G.string().min(1).optional(),xaa:BZc().optional()})),FZc=wr(()=>G.object({type:G.literal("sse"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:Dio().optional(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),UZc=wr(()=>G.object({type:G.literal("sse-ide"),url:G.string(),ideName:G.string(),ideRunningInWindows:G.boolean().optional(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),QZc=wr(()=>G.object({type:G.literal("ws-ide"),url:G.string(),ideName:G.string(),authToken:G.string().optional(),ideRunningInWindows:G.boolean().optional(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),qZc=wr(()=>G.object({type:G.enum(["http","streamable-http"]).transform(()=>"http"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:Dio().optional(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),jZc=wr(()=>G.object({type:G.literal("ws"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),role:$ve()})),HZc=wr(()=>G.object({type:G.literal("sdk"),name:G.string(),timeout:mW().optional(),alwaysLoad:G.boolean().optional()})),GZc=wr(()=>G.enum(["allow","ask","blocked"])),$Zc=wr(()=>G.object({type:G.literal("claudeai-proxy"),url:G.string(),id:G.string(),timeout:mW().optional(),alwaysLoad:G.boolean().optional(),toolPermissions:G.record(G.string(),GZc()).optional()})),a6r=wr(()=>G.union([LZc(),FZc(),UZc(),QZc(),qZc(),jZc(),HZc(),$Zc()])),MJh=wr(()=>G.object({mcpServers:G.record(G.string(),a6r())})),Nio=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","anthropic-agent-skills","life-sciences","knowledge-work-plugins","claude-for-legal","claude-for-financial-services","financial-services-plugins"]),VZc=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,WZc=/[^\u0020-\u007E]/;a(zZc,"pe");jN=wr(()=>G.string().startsWith("./")),ooe=wr(()=>jN().endsWith(".json")),yJi=wr(()=>G.union([jN().refine(t=>t.endsWith(".mcpb")||t.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),G.string().url().refine(t=>t.endsWith(".mcpb")||t.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),c6r=wr(()=>jN().endsWith(".md")),l6r=wr(()=>G.union([c6r(),jN()])),Mio=wr(()=>G.string().min(1,"Marketplace must have a name").refine(t=>!t.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine(t=>!t.includes("/")&&!t.includes("\\")&&!t.includes("..")&&t!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine(t=>!zZc(t),{message:"Marketplace name impersonates an official Anthropic/Claude marketplace"}).refine(t=>t.toLowerCase()!=="inline",{message:'Marketplace name "inline" is reserved for --plugin-dir session plugins'}).refine(t=>t.toLowerCase()!=="builtin",{message:'Marketplace name "builtin" is reserved for built-in plugins'}).refine(t=>t.toLowerCase()!=="skills-dir",{message:'Marketplace name "skills-dir" is reserved for plugins auto-loaded from .claude/skills/'})),a7r=wr(()=>G.object({name:G.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:G.string().optional().describe("Contact email for support or feedback"),url:G.string().optional().describe("Website, GitHub profile, or organization URL")})),YZc=wr(()=>G.object({$schema:G.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:G.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:G.string().optional().describe('Human-readable name shown in UI (e.g., "GitHub Utils"). Falls back to `name` when omitted. Unlike `name`, may contain spaces and any casing; not used for namespacing or lookup.'),version:G.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:G.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:a7r().optional().describe("Information about the plugin creator or maintainer"),homepage:G.string().url().optional().describe("Plugin homepage or documentation URL"),repository:G.string().optional().describe("Source code repository URL"),license:G.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:G.array(G.string()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:G.boolean().optional().describe("Whether the plugin starts enabled when the user has no explicit enabled/disabled setting for it (default: true). Explicit enabledPlugins values always win, and a plugin required by an enabled dependent is enabled regardless of this value."),dependencies:G.array(EXc()).optional().describe(`Plugins that must be enabled for this plugin to function. Bare names (no "@marketplace") are resolved against the declaring plugin's own marketplace.`)})),OJh=wr(()=>G.object({description:G.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:G.lazy(()=>rwt()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),KZc=wr(()=>G.object({hooks:G.union([ooe().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),G.lazy(()=>rwt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),G.array(G.union([ooe().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),G.lazy(()=>rwt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),JZc=wr(()=>G.object({source:l6r().optional().describe("Path to command markdown file, relative to plugin root"),content:G.string().optional().describe("Inline markdown content for the command"),description:G.string().optional().describe("Command description override"),argumentHint:G.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:G.string().optional().describe("Default model for this command"),allowedTools:G.array(G.string()).optional().describe("Tools allowed when command runs")}).refine(t=>t.source&&!t.content||!t.source&&t.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),ZZc=wr(()=>G.object({commands:G.union([l6r().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(l6r().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of command file or skill directory paths. When set, the commands/ directory is not auto-loaded."),G.record(G.string(),JZc()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" \u2192 "/plugin:about")')])})),XZc=wr(()=>G.object({agents:G.union([c6r().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(c6r().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of agent file paths. When set, the agents/ directory is not auto-loaded.")])})),eXc=wr(()=>G.object({skills:G.union([jN().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory."),G.array(jN().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory.")).describe("List of skill directory paths, loaded in addition to the skills/ directory.")])})),Oio=wr(()=>G.object({outputStyles:G.union([jN().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(jN().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of output-style directory or file paths. When set, the output-styles/ directory is not auto-loaded.")])})),Lio=wr(()=>G.object({themes:G.union([jN().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(jN().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of theme directory or file paths. When set, the themes/ directory is not auto-loaded.")])})),tXc=wr(()=>G.object({})),EJi=wr(()=>G.string().min(1)),rXc=wr(()=>G.string().min(2).refine(t=>t.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),nXc=wr(()=>G.object({mcpServers:G.union([ooe().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),yJi().describe("Path or URL to MCPB file containing MCP server configuration"),G.record(G.string(),a6r()).describe("MCP server configurations keyed by server name"),G.array(G.union([ooe().describe("Path to MCP servers configuration file"),yJi().describe("Path or URL to MCPB file"),G.record(G.string(),a6r()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),Bio=wr(()=>G.object({type:G.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:G.string().describe("Human-readable label shown in the config dialog"),description:G.string().describe("Help text shown beneath the field in the config dialog"),required:G.boolean().optional().describe("If true, validation fails when this field is empty"),default:G.union([G.string(),G.number(),G.boolean(),G.array(G.string())]).optional().describe("Default value used when the user provides nothing"),multiple:G.boolean().optional().describe("For string type: allow an array of strings"),sensitive:G.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:G.number().optional().describe("Minimum value (number type only)"),max:G.number().optional().describe("Maximum value (number type only)")}).strict()),iXc=wr(()=>G.object({userConfig:G.record(G.string().regex(/^[A-Za-z_]\w*$/,"Option keys must be valid identifiers (letters, digits, underscore; no leading digit) \u2014 they become CLAUDE_PLUGIN_OPTION_ env vars in hooks"),Bio()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage. Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. Keep sensitive value counts small.")})),oXc=wr(()=>G.object({channels:G.array(G.object({server:G.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:G.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:G.record(G.string(),Bio()).optional().describe("Fields to prompt the user for when enabling this plugin in assistant mode. Saved values are substituted into ${user_config.KEY} references in the mcpServers env.")}).strict()).describe("Channels this plugin provides. Each entry declares an MCP server as a message channel and optionally specifies user configuration to prompt for at enable time.")})),_Ji=wr(()=>G.strictObject({command:G.string().min(1).refine(t=>!(t.includes(" ")&&!t.startsWith("/")),{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:G.array(EJi()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:G.record(rXc(),EJi()).refine(t=>Object.keys(t).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:G.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:G.record(G.string(),G.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:G.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:G.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:G.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:G.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:G.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:G.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:G.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up")})),sXc=wr(()=>G.strictObject({name:G.string().min(1).describe("Identifier for this monitor, unique within the plugin. Used to dedupe so re-arming (plugin reload, repeat skill invoke) does not spawn duplicates."),command:G.string().min(1).describe('Shell command to run as a persistent background monitor. Each stdout line is delivered to the model as a event; the process runs for the session lifetime. ${CLAUDE_PLUGIN_ROOT}, ${CLAUDE_PLUGIN_DATA}, ${CLAUDE_PROJECT_DIR}, ${user_config.*}, and ${ENV_VAR} are substituted. Runs in the session cwd \u2014 prefix with `cd "${CLAUDE_PLUGIN_ROOT}" && ` if the script needs its own directory.'),description:G.string().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:G.union([G.literal("always"),G.string().startsWith("on-skill-invoke:").refine(t=>t.length>16,{message:"on-skill-invoke: must specify a skill name"})]).default("always").describe('Arm trigger. "always" arms at session start and on plugin reload. "on-skill-invoke:" arms the first time that skill is dispatched (via Skill tool or slash command).')})),aXc=wr(()=>G.array(sXc()).refine(t=>new Set(t.map(e=>e.name)).size===t.length,{message:"Monitor names must be unique within a plugin"})),Fio=wr(()=>G.object({monitors:G.union([ooe().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),aXc()]).describe("Background watch scripts the host arms as persistent Monitor tasks (unsandboxed, same trust tier as hooks) so plugins need not instruct the model to arm them. When omitted, monitors/monitors.json at the plugin root is loaded if present.")})),cXc=wr(()=>G.object({lspServers:G.union([ooe().describe("Path to .lsp.json configuration file relative to plugin root"),G.record(G.string(),_Ji()).describe("LSP server configurations keyed by server name"),G.array(G.union([ooe().describe("Path to LSP configuration file"),G.record(G.string(),_Ji()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),Uio=wr(()=>G.string().refine(t=>!t.includes("..")&&!t.includes("//"),"Package name cannot contain path traversal patterns").refine(t=>{let e=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,r=/^[a-z0-9][a-z0-9-._]*$/;return e.test(t)||r.test(t)},"Invalid npm package name format")),lXc=wr(()=>G.object({settings:G.record(G.string(),G.unknown()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),uXc=wr(()=>G.object({experimental:G.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,G.object({...Lio().partial().shape,...Fio().partial().shape,...Oio().partial().shape,evals:G.union([G.string(),G.array(G.string())]).optional().describe("Path(s) to evaluation query files for `claude plugin eval`. Defaults to `evals/`.")}).optional().describe("Components whose manifest shape may change without a deprecation cycle. Move a key out of here once it is promoted to stable."))})),dXc=wr(()=>G.object({...YZc().shape,...KZc().partial().shape,...ZZc().partial().shape,...XZc().partial().shape,...eXc().partial().shape,...Oio().partial().shape,...Lio().partial().shape,...tXc().shape,...oXc().partial().shape,...nXc().partial().shape,...cXc().partial().shape,...Fio().partial().shape,...lXc().partial().shape,...iXc().partial().shape,...uXc().partial().shape})),nwt=wr(()=>G.discriminatedUnion("source",[G.object({source:G.literal("url"),url:G.string().url().describe("Direct URL to marketplace.json file"),headers:G.record(G.string(),G.string()).optional().describe("Custom HTTP headers (e.g., for authentication)")}),G.object({source:G.literal("github"),repo:G.string().describe("GitHub repository in owner/repo format"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:G.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:G.array(G.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:G.boolean().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),G.object({source:G.literal("git"),url:G.string().describe("Full git repository URL"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:G.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:G.array(G.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:G.boolean().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),G.object({source:G.literal("npm"),package:Uio().describe("NPM package containing marketplace.json")}),G.object({source:G.literal("file"),path:G.string().describe("Local file path to marketplace.json")}),G.object({source:G.literal("directory"),path:G.string().describe("Local directory containing .claude-plugin/marketplace.json")}),G.object({source:G.literal("skills-dir")}).describe("Policy-list sentinel for the ~/.claude/skills/ auto-load (@skills-dir plugins). In strictKnownMarketplaces: opt the scan back IN (by default any allowlist blocks it). In blockedMarketplaces: turn the scan OFF without otherwise restricting marketplaces. Only meaningful in those two managed-settings lists (areLocalPluginDirsAllowedByPolicy); known_marketplaces.json / marketplace add etc. ignore it."),G.object({source:G.literal("hostPattern"),hostPattern:G.string().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against "github.com". For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')}),G.object({source:G.literal("pathPattern"),pathPattern:G.string().describe('Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.')}),G.object({source:G.literal("settings"),name:Mio().refine(t=>!Nio.has(t.toLowerCase()),{message:"Reserved official marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false."}).describe("Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation as PluginMarketplaceSchema plus reserved-name rejection \u2014 validateOfficialNameSource runs after the disk write, too late to clean up."),plugins:G.array(fXc()).describe("Plugin entries declared inline in settings.json"),owner:a7r().optional()}).describe("Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).")])),VFr=wr(()=>G.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),Qio=wr(()=>G.union([jN().describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),G.object({source:G.literal("npm"),package:Uio().or(G.string().refine(t=>/^(?:file|https?|git(?:\+https?|\+ssh)?|ssh|github|gitlab|bitbucket):/i.test(t)||!t.includes(".."),'Package reference cannot contain ".." path segments')).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:G.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:G.string().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),G.object({source:G.literal("url"),url:G.string().describe("Full git repository URL (https:// or git@)"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:VFr().optional().describe("Specific commit SHA to use")}),G.object({source:G.literal("github"),repo:G.string().describe("GitHub repository in owner/repo format"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:VFr().optional().describe("Specific commit SHA to use")}),G.object({source:G.literal("git-subdir"),url:G.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:G.string().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.'),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:VFr().optional().describe("Specific commit SHA to use")}).describe("Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded."),G.object({source:G.literal("unsupported")}).describe('Placeholder for source types this Claude Code version does not recognize. Never authored by hand \u2014 PluginMarketplaceSchema rewrites unparseable sources to this so the entry remains in marketplace.plugins (detectDelistedPlugins must not see it as removed). Install attempts fail at cachePlugin with a clear "update Claude Code" message.')])),fXc=wr(()=>G.object({name:G.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Plugin name as it appears in the target repository"),source:Qio().describe("Where to fetch the plugin from. Must be a remote source \u2014 relative paths have no marketplace repository to resolve against."),description:G.string().optional(),version:G.string().optional(),strict:G.boolean().optional()}).refine(t=>typeof t.source!="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}).refine(t=>typeof t.source=="string"||t.source.source!=="unsupported",{message:"source.source: 'unsupported' is a parse-time placeholder and cannot be authored. Use a remote source (github, git-subdir, npm, url)."})),pXc=wr(()=>G.object({cli:G.array(G.string().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) \u2014 exact match against commands run this session.'),hosts:G.array(G.string().max(128)).max(20).optional().describe('Hostnames (e.g. ["api.stripe.com"]) \u2014 exact, case-insensitive match against hostnames seen in https?:// URLs in bash commands run this session. Bare hostname only: lowercase, no scheme, no port, no path.'),filesRead:G.array(G.string().max(256)).max(10).optional().describe('Glob patterns (e.g. ["**/*.tf"]) \u2014 the plugin is relevant when a file Claude has read this session matches any pattern. Matched against read-file paths, forward-slash normalized, case-insensitive.'),manifestDeps:G.array(G.object({file:G.string().max(256),pattern:G.string().max(256)})).max(10).optional().describe("Dependency declared in a package manifest. Each {file, pattern} is a pair of RegExp sources: `file` matches the manifest filename (package.json, go.mod, requirements.txt, \u2026); `pattern` matches the dependency declaration inside that file. Evaluated against files read this session."),cwd:G.array(G.string().max(256)).max(10).optional().describe(`Glob patterns (e.g. ["Engine/Source/Runtime/Renderer/**"]) \u2014 the plugin is relevant when the session's working directory is at or under a directory matching the pattern. Matched against the cwd both relative to the enclosing git repo root and as an absolute path, forward-slash normalized, case-insensitive. A bare directory (no glob characters) means "cwd is at or under this directory". Known at session start, so this signal can surface a suggestion before the first turn.`)})),hXc=wr(()=>G.object({topic:G.string().max(64).optional().describe('What the user is working with when this plugin is relevant \u2014 fills "Working with {topic}?". Often the product name (e.g. "Stripe"); use a domain (e.g. "design") when the plugin name does not read naturally as a topic. Defaults to the plugin name with each hyphen-segment capitalized.'),signals:pXc().optional().describe("Matchers that determine when the plugin is relevant.")})),mXc=wr(()=>dXc().partial().extend({name:G.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier matching the plugin name"),source:Qio().describe("Where to fetch the plugin from"),category:G.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:G.array(G.string()).optional().describe("Tags for searchability and discovery"),strict:G.boolean().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest."),relevance:G.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,hXc().optional()).describe(`Declares when this plugin is relevant to the user's work. Consumed by the spinner tip ("Working with {topic}?"), session-start auto-suggest, and marketplace browse ranking.`)})),gXc=wr(()=>G.object({name:G.string().min(1).refine(t=>!t.includes(" "))}));a(AXc,"z$$");LJh=wr(()=>G.object({$schema:G.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:Mio(),version:G.string().optional().describe("Marketplace manifest version"),description:G.string().optional().describe("Human-readable description of this marketplace"),owner:a7r().describe("Marketplace maintainer or curator information"),plugins:G.array(G.unknown()).transform(AXc).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:G.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:G.object({pluginRoot:G.string().optional().describe("Base path for relative plugin sources"),version:G.string().optional().describe("Marketplace version"),description:G.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:G.array(G.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies \u2014 no transitive trust.")})),qio=wr(()=>G.string().regex(/^[A-Za-z0-9][-A-Za-z0-9._]*@[A-Za-z0-9][-A-Za-z0-9._]*$/,"Plugin ID must be in format: plugin@marketplace")),yXc=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,EXc=wr(()=>G.union([G.string().regex(yXc,"Dependency must be a plugin name, optionally qualified with @marketplace").transform(t=>t.replace(/@\^[^@]*$/,"")),G.object({name:G.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:G.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform(t=>t.marketplace?`${t.name}@${t.marketplace}`:t.name)])),_Xc=wr(()=>G.object({version:G.string().describe("Currently installed version"),installedAt:G.string().describe("ISO 8601 timestamp of installation"),lastUpdated:G.string().optional().describe("ISO 8601 timestamp of last update"),installPath:G.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:G.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:G.string().optional().describe("Tag-derived semver this install resolved to (when fetched via a version constraint). Used by verifyAndDemote in preference to manifest.version, since the upstream may have forgotten to bump plugin.json."),auto:G.boolean().optional().describe("True when this plugin was pulled in as a dependency rather than installed explicitly. Auto-installed plugins are eligible for removal by the orphan sweep when nothing depends on them. Absent = manual (preserves pre-flag installs).")})),vXc=wr(()=>G.object({version:G.literal(1).describe("Schema version 1"),plugins:G.record(qio(),_Xc()).describe("Map of plugin IDs to their installation metadata")})),CXc=wr(()=>G.enum(["managed","user","project","local"])),bXc=wr(()=>G.object({scope:CXc().describe("Installation scope"),projectPath:G.string().optional().describe("Project path (required for project/local scopes)"),installPath:G.string().describe("Absolute path to the versioned plugin directory"),version:G.string().optional().describe("Currently installed version"),installedAt:G.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:G.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:G.string().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:G.string().optional().describe("Tag-derived semver this install resolved to"),auto:G.boolean().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep.")})),SXc=wr(()=>G.object({version:G.literal(2).describe("Schema version 2"),plugins:G.record(qio(),G.array(bXc())).describe("Map of plugin IDs to arrays of installation entries")})),BJh=wr(()=>G.union([vXc(),SXc()])),TXc=wr(()=>G.object({source:nwt().describe("Where to fetch the marketplace from"),installLocation:G.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:G.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:G.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),FJh=wr(()=>G.record(G.string(),TXc())),IXc=["userSettings","projectSettings","localSettings","flagSettings","policySettings"],xXc="https://json.schemastore.org/claude-code-settings.json",wXc=["autoMode","deepLink","voice","assistant","briefView"],UIt={},Zwt={autoMode:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>UIt,"shape"),permissionsShape:a(()=>UIt,"permissionsShape"),permissionModes:a(()=>[],"permissionModes")},deepLink:{buildGate:a(()=>!0,"buildGate"),shape:a(()=>({disableDeepLinkRegistration:G.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")}),"shape")},voice:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>UIt,"shape")},assistant:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>UIt,"shape")},briefView:{buildGate:a(()=>!0,"buildGate"),shape:a(()=>({defaultView:G.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")}),"shape")}};a(jio,"Ez");a(RXc,"tE");a(kXc,"aE");a(PXc,"sE");a(DXc,"eE");vJi={Task:"Agent",KillShell:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage"};a(X_e,"E9");Hio="workspace",UJh=`mcp__${Hio}__bash`,QJh=`mcp__${Hio}__web_fetch`;a(NXc,"A$$");a(MXc,"Jb");a(OXc,"I$$");a(LXc,"R$$");iwt={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit"],bashPrefixTools:["Bash"],customValidation:{WebSearch:a(t=>t.includes("*")||t.includes("?")?{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]}:{valid:!0},"WebSearch"),WebFetch:a(t=>t.includes("://")||t.startsWith("http")?{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]}:t.startsWith("domain:")?{valid:!0}:{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]},"WebFetch")}};a(BXc,"Xb");a(FXc,"Yb");a(UXc,"Wb");a(Gio,"Gb");a(WFr,"bz");a(QXc,"P$$");a($io,"_z");zFr=wr(()=>G.string().superRefine((t,e)=>{let r=$io(t);if(!r.valid){let n=r.error;r.suggestion&&(n+=`. ${r.suggestion}`),r.examples&&r.examples.length>0&&(n+=`. Examples: ${r.examples.join(", ")}`),e.addIssue({code:G.ZodIssueCode.custom,message:n,params:{received:t}})}})),qXc=wr(()=>G.record(G.string(),G.coerce.string()));a(Vio,"Hb");qJh=wr(()=>Vio(jio())),jXc=wr(()=>G.object({source:nwt().describe("Where to fetch the marketplace from"),installLocation:G.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:G.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),Wio=wr(()=>G.object({serverName:G.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that users are allowed to configure"),serverCommand:G.array(G.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for allowed stdio servers"),serverUrl:G.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine(t=>WXi([t.serverName!==void 0,t.serverCommand!==void 0,t.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),zio=wr(()=>G.object({serverName:G.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:G.array(G.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for blocked stdio servers"),serverUrl:G.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine(t=>WXi([t.serverName!==void 0,t.serverCommand!==void 0,t.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),HXc=wr(()=>G.object({path:G.string().describe("Absolute path to the helper executable"),timeoutMs:G.number().int().min(1e3).optional(),refreshIntervalMs:G.union([G.literal(0),G.number().int().min(6e4)]).optional()})),CJi=["skills","agents","hooks","mcp"];a(GXc,"Kb");Vve=wr(()=>GXc(jio())),H9="https://code.claude.com/docs/en",$Xc=[{matches:a(t=>t.path==="permissions.defaultMode"&&t.code==="invalid_value","matches"),tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:`${H9}/iam#permission-modes`}},{matches:a(t=>t.path==="apiKeyHelper"&&t.code==="invalid_type","matches"),tip:{suggestion:'Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"'}},{matches:a(t=>t.path==="cleanupPeriodDays"&&t.code==="too_small","matches"),tip:{suggestion:'cleanupPeriodDays must be at least 1. To keep transcripts for a long time, set a large number (e.g. 3650 for ~10 years). To disable transcript writes entirely, remove this setting and use the --no-session-persistence CLI flag or the SDK persistSession:false option instead. (0 is rejected because it previously silently disabled all transcript writes, which users setting it to mean "never clean up" did not expect.)'}},{matches:a(t=>t.path.startsWith("env.")&&t.code==="invalid_type","matches"),tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:`${H9}/settings#environment-variables`}},{matches:a(t=>(t.path==="permissions.allow"||t.path==="permissions.deny")&&t.code==="invalid_type"&&t.expected==="array","matches"),tip:{suggestion:'Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.'}},{matches:a(t=>t.path.startsWith("hooks.")&&t.code==="invalid_key","matches"),tip:{suggestion:"Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",docLink:`${H9}/hooks`}},{matches:a(t=>/\.hooks\.\d+\.command$/.test(t.path)&&t.code==="invalid_type"&&t.received==="undefined","matches"),tip:{suggestion:'Command hooks require `command`. For exec form (no shell), set `command` to the executable and `args` to its arguments: {"type": "command", "command": "echo", "args": ["hi"]}. For shell form, set `command` to the full shell string: {"type": "command", "command": "echo hi"}.',docLink:`${H9}/hooks#exec-form-and-shell-form`}},{matches:a(t=>t.path.includes("hooks")&&t.code==="invalid_type","matches"),tip:{suggestion:'Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}'}},{matches:a(t=>t.code==="invalid_type"&&t.expected==="boolean","matches"),tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:a(t=>t.code==="unrecognized_keys","matches"),tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:`${H9}/settings`}},{matches:a(t=>t.code==="invalid_value"&&t.enumValues!==void 0,"matches"),tip:{suggestion:void 0}},{matches:a(t=>t.code==="invalid_type"&&t.expected==="object"&&t.received===null&&t.path==="","matches"),tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:a(t=>t.path==="permissions.additionalDirectories"&&t.code==="invalid_type","matches"),tip:{suggestion:'Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command',docLink:`${H9}/iam#working-directories`}}],VXc={permissions:`${H9}/iam#configuring-permissions`,env:`${H9}/settings#environment-variables`,hooks:`${H9}/hooks`};a(WXc,"qb");jJh=wr(()=>Vve().strict());a(bJi,"Vb");a(SJi,"Bb");a(zXc,"v$$");a(TJi,"zb");a(lve,"b9");a(IJi,"Nb");a(K8e,"d0");a(YXc,"C$$");KXc=new Set(ywt);a(JXc,"x$$");ZXc=[{key:"allowedMcpServers",schema:Wio},{key:"deniedMcpServers",schema:zio}];a(XXc,"f$$");a(Wve,"i1");xJi="com.anthropic.claudecode",u6r="HKLM\\SOFTWARE\\Policies\\ClaudeCode",d6r="HKCU\\SOFTWARE\\Policies\\ClaudeCode",ove="Settings",eel="/usr/bin/plutil",tel=["-convert","json","-o","-","--"],rel=5e3,wJi="/mnt/c/Windows/System32/reg.exe",owt="/mnt/c/Program Files/ClaudeCode";a(Kio,"XG");a(nel,"Zb");iel=null;a(HFe,"$5");a(oel,"Mb");a(sel,"Lb");rW=Object.freeze({settings:{},errors:[]}),Xio=null,eoo=null,too=!1,swt=null;a(ael,"l$$");a(cel,"bb");a(lel,"_b");a(uel,"kb");a(del,"Sb");a(YFr,"Cz");a(RJi,"jb");a(fel,"c$$");a(pel,"p$$");a(kJi,"Ab");a(hel,"d$$");a(PJi,"Ib");a(mel,"i$$");f6r=mel;a(gel,"n$$");Ael=gel,yel=Ael(),Eel=yel;a(_el,"o$$");vel=_el,Cel="[object Object]",bel=Function.prototype,Sel=Object.prototype,roo=bel.toString,Tel=Sel.hasOwnProperty,Iel=roo.call(Object);a(xel,"Q6$");wel=xel;a(Rel,"J6$");p6r=Rel;a(kel,"X6$");Pel=kel;a(Del,"Y6$");Nel=Del;a(noo,"hb");Mel=noo;a(Oel,"W6$");Lel=Oel,DJi=Math.max;a(Bel,"G6$");ioo=Bel;a(Fel,"U6$");Uel=Fel,Qel=Sxt?function(t,e){return Sxt(t,"toString",{configurable:!0,enumerable:!1,value:Uel(e),writable:!0})}:dXi,qel=Qel,jel=800,Hel=16,Gel=Date.now;a($el,"B6$");Vel=$el,Wel=Vel(qel),ooo=Wel;a(zel,"N6$");Yel=zel;a(Kel,"w6$");Jel=Kel;a(Zel,"O6$");Xel=Zel,etl=Xel(function(t,e,r,n){Mel(t,e,r,n)}),oW=etl;a(ttl,"F6$");rtl=ttl;a(ntl,"Z6$");itl=ntl;a(otl,"M6$");stl=otl,NJi=cW?cW.isConcatSpreadable:void 0;a(atl,"L6$");ctl=atl;a(soo,"$_");ltl=soo;a(utl,"j6$");dtl=utl;a(ftl,"A6$");ptl=ftl,htl=ptl(function(t,e){return t==null?{}:stl(t,e)}),KFr=htl,mtl="remote-settings.json",JFr=null;a(Atl,"b6$");a(ytl,"_6$");a(Etl,"W_");a(c7r,"fz");a(_tl,"S6$");a(coo,"U_");a(ZFr,"xz");a(vtl,"v6$");a(awt,"HG");a(loo,"H_");a(uoo,"K_");a(doo,"q_");a(foo,"V_");a(Ctl,"C6$");a(MJi,"G_");a(btl,"T6$");a(cwt,"Y5");a(Stl,"x6$");a(poo,"B_");a(Ttl,"y6$");a(Itl,"f6$");a(xtl,"z_");a(wtl,"g6$");a(hoo,"N_");a(Rtl,"h6$");a(ktl,"u6$");a(sW,"o1");XFr=!1;a(Ptl,"m6$");a(Dtl,"l6$");a(Ntl,"c6$");a(Mtl,"w_");a(Otl,"O_");Ltl={user:"userSettings",project:"projectSettings",local:"localSettings"},OJi={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},Btl=["user","project","local"],Ftl=new Set(["bypassPermissions","auto","acceptEdits"]),Utl=new Set(["project"]);a(Qtl,"o6$");a(qtl,"F_");process.env.NoDefaultCurrentDirectoryInExePath="1";a(jtl,"LA$");a(Htl,"G4$");a(Gtl,"U4$");a($tl,"H4$");a(moo,"b_");a(h6r,"uz");a(m6r,"mz");Vtl=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"]);a(lwt,"KG");a(Wtl,"q4$");a(ztl,"jA$");a(Ytl,"AA$");a(Ktl,"IA$");a(Jtl,"RA$");a(Ztl,"PA$");a(Xtl,"EA$");a(erl,"bA$");a(trl,"_A$");a(rrl,"kA$");a(nrl,"SA$");a(LJi,"M_");a(irl,"V4$");a(orl,"vA$");a(srl,"CA$");a(goo,"__");a(bk,"J4");a(Aoo,"k_");a(BJi,"L_");a(g6r,"lz");a(arl,"B4$");a(FJi,"j_");a(yoo,"S_");a(crl,"z4$");a(Eoo,"v_");a(lrl,"N4$");a(url,"w4$");a(drl,"O4$");a(frl,"D4$");a(prl,"F4$");a(hrl,"Z4$");a(mrl,"M4$");a(UJi,"A_")});var Lso=I((O7r,Oso)=>{p();O7r.createWatcher=W6e()("vscode-policy-watcher");if(require.main===Oso){let t=process.platform;O7r.createWatcher(t==="darwin"?"com.visualstudio.code.oss":"CodeOSS",{UpdateMode:{type:"string"},SCMInputFontSize:{type:"number"},DisableFeedback:{type:"boolean"}},e=>console.log(e))}});var yao=I(H7r=>{p();var Aao="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");H7r.encode=function(t){if(0<=t&&t{p();var Eao=yao(),G7r=5,_ao=1<>1;return e?-r:r}a(eil,"fromVLQSigned");$7r.encode=a(function(e){var r="",n,o=Xnl(e);do n=o&vao,o>>>=G7r,o>0&&(n|=Cao),r+=Eao.encode(n);while(o>0);return r},"base64VLQ_encode");$7r.decode=a(function(e,r,n){var o=e.length,s=0,c=0,l,u;do{if(r>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(u=Eao.decode(e.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));l=!!(u&Cao),u&=vao,s=s+(u<{p();function til(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}a(til,"getArg");p_.getArg=til;var bao=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,ril=/^data:.+\,.+$/;function I6e(t){var e=t.match(bao);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}a(I6e,"urlParse");p_.urlParse=I6e;function lCe(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}a(lCe,"urlGenerate");p_.urlGenerate=lCe;function W7r(t){var e=t,r=I6e(t);if(r){if(!r.path)return t;e=r.path}for(var n=p_.isAbsolute(e),o=e.split(/\/+/),s,c=0,l=o.length-1;l>=0;l--)s=o[l],s==="."?o.splice(l,1):s===".."?c++:c>0&&(s===""?(o.splice(l+1,c),c=0):(o.splice(l,2),c--));return e=o.join("/"),e===""&&(e=n?"/":"."),r?(r.path=e,lCe(r)):e}a(W7r,"normalize");p_.normalize=W7r;function Sao(t,e){t===""&&(t="."),e===""&&(e=".");var r=I6e(e),n=I6e(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),lCe(r);if(r||e.match(ril))return e;if(n&&!n.host&&!n.path)return n.host=e,lCe(n);var o=e.charAt(0)==="/"?e:W7r(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,lCe(n)):o}a(Sao,"join");p_.join=Sao;p_.isAbsolute=function(t){return t.charAt(0)==="/"||bao.test(t)};function nil(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}a(nil,"relative");p_.relative=nil;var Tao=(function(){var t=Object.create(null);return!("__proto__"in t)})();function Iao(t){return t}a(Iao,"identity");function iil(t){return xao(t)?"$"+t:t}a(iil,"toSetString");p_.toSetString=Tao?Iao:iil;function oil(t){return xao(t)?t.slice(1):t}a(oil,"fromSetString");p_.fromSetString=Tao?Iao:oil;function xao(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}a(xao,"isProtoString");function sil(t,e,r){var n=uCe(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:uCe(t.name,e.name)}a(sil,"compareByOriginalPositions");p_.compareByOriginalPositions=sil;function ail(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=uCe(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:uCe(t.name,e.name)}a(ail,"compareByGeneratedPositionsDeflated");p_.compareByGeneratedPositionsDeflated=ail;function uCe(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}a(uCe,"strcmp");function cil(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=uCe(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:uCe(t.name,e.name)}a(cil,"compareByGeneratedPositionsInflated");p_.compareByGeneratedPositionsInflated=cil;function lil(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}a(lil,"parseSourceMapInput");p_.parseSourceMapInput=lil;function uil(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=I6e(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}e=Sao(lCe(n),e)}return W7r(e)}a(uil,"computeSourceURL");p_.computeSourceURL=uil});var K7r=I(wao=>{p();var z7r=dCe(),Y7r=Object.prototype.hasOwnProperty,hoe=typeof Map<"u";function eU(){this._array=[],this._set=hoe?new Map:Object.create(null)}a(eU,"ArraySet");eU.fromArray=a(function(e,r){for(var n=new eU,o=0,s=e.length;o=0)return r}else{var n=z7r.toSetString(e);if(Y7r.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},"ArraySet_indexOf");eU.prototype.at=a(function(e){if(e>=0&&e{p();var Rao=dCe();function dil(t,e){var r=t.generatedLine,n=e.generatedLine,o=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=o||Rao.compareByGeneratedPositionsInflated(t,e)<=0}a(dil,"generatedPositionAfter");function bkt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}a(bkt,"MappingList");bkt.prototype.unsortedForEach=a(function(e,r){this._array.forEach(e,r)},"MappingList_forEach");bkt.prototype.add=a(function(e){dil(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},"MappingList_add");bkt.prototype.toArray=a(function(){return this._sorted||(this._array.sort(Rao.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},"MappingList_toArray");kao.MappingList=bkt});var J7r=I(Dao=>{p();var x6e=V7r(),qm=dCe(),Skt=K7r().ArraySet,fil=Pao().MappingList;function xk(t){t||(t={}),this._file=qm.getArg(t,"file",null),this._sourceRoot=qm.getArg(t,"sourceRoot",null),this._skipValidation=qm.getArg(t,"skipValidation",!1),this._sources=new Skt,this._names=new Skt,this._mappings=new fil,this._sourcesContents=null}a(xk,"SourceMapGenerator");xk.prototype._version=3;xk.fromSourceMap=a(function(e){var r=e.sourceRoot,n=new xk({file:e.file,sourceRoot:r});return e.eachMapping(function(o){var s={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(s.source=o.source,r!=null&&(s.source=qm.relative(r,s.source)),s.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(s.name=o.name)),n.addMapping(s)}),e.sources.forEach(function(o){var s=o;r!==null&&(s=qm.relative(r,o)),n._sources.has(s)||n._sources.add(s);var c=e.sourceContentFor(o);c!=null&&n.setSourceContent(o,c)}),n},"SourceMapGenerator_fromSourceMap");xk.prototype.addMapping=a(function(e){var r=qm.getArg(e,"generated"),n=qm.getArg(e,"original",null),o=qm.getArg(e,"source",null),s=qm.getArg(e,"name",null);this._skipValidation||this._validateMapping(r,n,o,s),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:s})},"SourceMapGenerator_addMapping");xk.prototype.setSourceContent=a(function(e,r){var n=e;this._sourceRoot!=null&&(n=qm.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[qm.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[qm.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},"SourceMapGenerator_setSourceContent");xk.prototype.applySourceMap=a(function(e,r,n){var o=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=e.file}var s=this._sourceRoot;s!=null&&(o=qm.relative(s,o));var c=new Skt,l=new Skt;this._mappings.unsortedForEach(function(u){if(u.source===o&&u.originalLine!=null){var d=e.originalPositionFor({line:u.originalLine,column:u.originalColumn});d.source!=null&&(u.source=d.source,n!=null&&(u.source=qm.join(n,u.source)),s!=null&&(u.source=qm.relative(s,u.source)),u.originalLine=d.line,u.originalColumn=d.column,d.name!=null&&(u.name=d.name))}var f=u.source;f!=null&&!c.has(f)&&c.add(f);var h=u.name;h!=null&&!l.has(h)&&l.add(h)},this),this._sources=c,this._names=l,e.sources.forEach(function(u){var d=e.sourceContentFor(u);d!=null&&(n!=null&&(u=qm.join(n,u)),s!=null&&(u=qm.relative(s,u)),this.setSourceContent(u,d))},this)},"SourceMapGenerator_applySourceMap");xk.prototype._validateMapping=a(function(e,r,n,o){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!o)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:o}))}},"SourceMapGenerator_validateMapping");xk.prototype._serializeMappings=a(function(){for(var e=0,r=1,n=0,o=0,s=0,c=0,l="",u,d,f,h,m=this._mappings.toArray(),g=0,A=m.length;g0){if(!qm.compareByGeneratedPositionsInflated(d,m[g-1]))continue;u+=","}u+=x6e.encode(d.generatedColumn-e),e=d.generatedColumn,d.source!=null&&(h=this._sources.indexOf(d.source),u+=x6e.encode(h-c),c=h,u+=x6e.encode(d.originalLine-1-o),o=d.originalLine-1,u+=x6e.encode(d.originalColumn-n),n=d.originalColumn,d.name!=null&&(f=this._names.indexOf(d.name),u+=x6e.encode(f-s),s=f)),l+=u}return l},"SourceMapGenerator_serializeMappings");xk.prototype._generateSourcesContent=a(function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=qm.relative(r,n));var o=qm.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)},"SourceMapGenerator_generateSourcesContent");xk.prototype.toJSON=a(function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},"SourceMapGenerator_toJSON");xk.prototype.toString=a(function(){return JSON.stringify(this.toJSON())},"SourceMapGenerator_toString");Dao.SourceMapGenerator=xk});var Nao=I(moe=>{p();moe.GREATEST_LOWER_BOUND=1;moe.LEAST_UPPER_BOUND=2;function Z7r(t,e,r,n,o,s){var c=Math.floor((e-t)/2)+t,l=o(r,n[c],!0);return l===0?c:l>0?e-c>1?Z7r(c,e,r,n,o,s):s==moe.LEAST_UPPER_BOUND?e1?Z7r(t,c,r,n,o,s):s==moe.LEAST_UPPER_BOUND?c:t<0?-1:t}a(Z7r,"recursiveSearch");moe.search=a(function(e,r,n,o){if(r.length===0)return-1;var s=Z7r(-1,r.length,e,r,n,o||moe.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&n(r[s],r[s-1],!0)===0;)--s;return s},"search")});var Oao=I(Mao=>{p();function X7r(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a(X7r,"swap");function pil(t,e){return Math.round(t+Math.random()*(e-t))}a(pil,"randomIntInRange");function eQr(t,e,r,n){if(r{p();var jn=dCe(),tQr=Nao(),fCe=K7r().ArraySet,hil=V7r(),w6e=Oao().quickSort;function Id(t,e){var r=t;return typeof t=="string"&&(r=jn.parseSourceMapInput(t)),r.sections!=null?new JN(r,e):new My(r,e)}a(Id,"SourceMapConsumer");Id.fromSourceMap=function(t,e){return My.fromSourceMap(t,e)};Id.prototype._version=3;Id.prototype.__generatedMappings=null;Object.defineProperty(Id.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings},"get")});Id.prototype.__originalMappings=null;Object.defineProperty(Id.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings},"get")});Id.prototype._charIsMappingSeparator=a(function(e,r){var n=e.charAt(r);return n===";"||n===","},"SourceMapConsumer_charIsMappingSeparator");Id.prototype._parseMappings=a(function(e,r){throw new Error("Subclasses must implement _parseMappings")},"SourceMapConsumer_parseMappings");Id.GENERATED_ORDER=1;Id.ORIGINAL_ORDER=2;Id.GREATEST_LOWER_BOUND=1;Id.LEAST_UPPER_BOUND=2;Id.prototype.eachMapping=a(function(e,r,n){var o=r||null,s=n||Id.GENERATED_ORDER,c;switch(s){case Id.GENERATED_ORDER:c=this._generatedMappings;break;case Id.ORIGINAL_ORDER:c=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var l=this.sourceRoot;c.map(function(u){var d=u.source===null?null:this._sources.at(u.source);return d=jn.computeSourceURL(l,d,this._sourceMapURL),{source:d,generatedLine:u.generatedLine,generatedColumn:u.generatedColumn,originalLine:u.originalLine,originalColumn:u.originalColumn,name:u.name===null?null:this._names.at(u.name)}},this).forEach(e,o)},"SourceMapConsumer_eachMapping");Id.prototype.allGeneratedPositionsFor=a(function(e){var r=jn.getArg(e,"line"),n={source:jn.getArg(e,"source"),originalLine:r,originalColumn:jn.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",jn.compareByOriginalPositions,tQr.LEAST_UPPER_BOUND);if(s>=0){var c=this._originalMappings[s];if(e.column===void 0)for(var l=c.originalLine;c&&c.originalLine===l;)o.push({line:jn.getArg(c,"generatedLine",null),column:jn.getArg(c,"generatedColumn",null),lastColumn:jn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s];else for(var u=c.originalColumn;c&&c.originalLine===r&&c.originalColumn==u;)o.push({line:jn.getArg(c,"generatedLine",null),column:jn.getArg(c,"generatedColumn",null),lastColumn:jn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s]}return o},"SourceMapConsumer_allGeneratedPositionsFor");Tkt.SourceMapConsumer=Id;function My(t,e){var r=t;typeof t=="string"&&(r=jn.parseSourceMapInput(t));var n=jn.getArg(r,"version"),o=jn.getArg(r,"sources"),s=jn.getArg(r,"names",[]),c=jn.getArg(r,"sourceRoot",null),l=jn.getArg(r,"sourcesContent",null),u=jn.getArg(r,"mappings"),d=jn.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);c&&(c=jn.normalize(c)),o=o.map(String).map(jn.normalize).map(function(f){return c&&jn.isAbsolute(c)&&jn.isAbsolute(f)?jn.relative(c,f):f}),this._names=fCe.fromArray(s.map(String),!0),this._sources=fCe.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(f){return jn.computeSourceURL(c,f,e)}),this.sourceRoot=c,this.sourcesContent=l,this._mappings=u,this._sourceMapURL=e,this.file=d}a(My,"BasicSourceMapConsumer");My.prototype=Object.create(Id.prototype);My.prototype.consumer=Id;My.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=jn.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r1&&(y.source=l+_[1],l+=_[1],y.originalLine=s+_[2],s=y.originalLine,y.originalLine+=1,y.originalColumn=c+_[3],c=y.originalColumn,_.length>4&&(y.name=u+_[4],u+=_[4])),A.push(y),typeof y.originalLine=="number"&&g.push(y)}w6e(A,jn.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,w6e(g,jn.compareByOriginalPositions),this.__originalMappings=g},"SourceMapConsumer_parseMappings");My.prototype._findMapping=a(function(e,r,n,o,s,c){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[o]);return tQr.search(e,r,s,c)},"SourceMapConsumer_findMapping");My.prototype.computeColumnSpans=a(function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var s=jn.getArg(o,"source",null);s!==null&&(s=this._sources.at(s),s=jn.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var c=jn.getArg(o,"name",null);return c!==null&&(c=this._names.at(c)),{source:s,line:jn.getArg(o,"originalLine",null),column:jn.getArg(o,"originalColumn",null),name:c}}}return{source:null,line:null,column:null,name:null}},"SourceMapConsumer_originalPositionFor");My.prototype.hasContentsOfAllSources=a(function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1},"BasicSourceMapConsumer_hasContentsOfAllSources");My.prototype.sourceContentFor=a(function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var o=e;this.sourceRoot!=null&&(o=jn.relative(this.sourceRoot,o));var s;if(this.sourceRoot!=null&&(s=jn.urlParse(this.sourceRoot))){var c=o.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(c))return this.sourcesContent[this._sources.indexOf(c)];if((!s.path||s.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(r)return null;throw new Error('"'+o+'" is not in the SourceMap.')},"SourceMapConsumer_sourceContentFor");My.prototype.generatedPositionFor=a(function(e){var r=jn.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:jn.getArg(e,"line"),originalColumn:jn.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",jn.compareByOriginalPositions,jn.getArg(e,"bias",Id.GREATEST_LOWER_BOUND));if(o>=0){var s=this._originalMappings[o];if(s.source===n.source)return{line:jn.getArg(s,"generatedLine",null),column:jn.getArg(s,"generatedColumn",null),lastColumn:jn.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},"SourceMapConsumer_generatedPositionFor");Tkt.BasicSourceMapConsumer=My;function JN(t,e){var r=t;typeof t=="string"&&(r=jn.parseSourceMapInput(t));var n=jn.getArg(r,"version"),o=jn.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new fCe,this._names=new fCe;var s={line:-1,column:0};this._sections=o.map(function(c){if(c.url)throw new Error("Support for url field in sections not implemented.");var l=jn.getArg(c,"offset"),u=jn.getArg(l,"line"),d=jn.getArg(l,"column");if(u{p();var mil=J7r().SourceMapGenerator,Ikt=dCe(),gil=/(\r?\n)/,Ail=10,pCe="$$$isSourceNode$$$";function BI(t,e,r,n,o){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=r??null,this.name=o??null,this[pCe]=!0,n!=null&&this.add(n)}a(BI,"SourceNode");BI.fromStringWithSourceMap=a(function(e,r,n){var o=new BI,s=e.split(gil),c=0,l=a(function(){var m=A(),g=A()||"";return m+g;function A(){return c=0;r--)this.prepend(e[r]);else if(e[pCe]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this},"SourceNode_prepend");BI.prototype.walk=a(function(e){for(var r,n=0,o=this.children.length;n0){for(r=[],n=0;n{p();xkt.SourceMapGenerator=J7r().SourceMapGenerator;xkt.SourceMapConsumer=Bao().SourceMapConsumer;xkt.SourceNode=Uao().SourceNode});var jao=I((Wmm,qao)=>{p();var yil=Object.prototype.toString,rQr=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function Eil(t){return yil.call(t).slice(8,-1)==="ArrayBuffer"}a(Eil,"isArrayBuffer");function _il(t,e,r){e>>>=0;var n=t.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(r===void 0)r=n;else if(r>>>=0,r>n)throw new RangeError("'length' is out of bounds");return rQr?Buffer.from(t.slice(e,e+r)):new Buffer(new Uint8Array(t.slice(e,e+r)))}a(_il,"fromArrayBuffer");function vil(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return rQr?Buffer.from(t,e):new Buffer(t,e)}a(vil,"fromString");function Cil(t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return Eil(t)?_il(t,e,r):typeof t=="string"?vil(t,e):rQr?Buffer.from(t):new Buffer(t)}a(Cil,"bufferFrom");qao.exports=Cil});var Kao=I((Aoe,sQr)=>{p();var bil=Qao().SourceMapConsumer,nQr=require("path"),JL;try{JL=require("fs"),(!JL.existsSync||!JL.readFileSync)&&(JL=null)}catch{}var Sil=jao();function Hao(t,e){return t.require(e)}a(Hao,"dynamicRequire");var Gao=!1,$ao=!1,iQr=!1,R6e="auto",goe={},k6e={},Til=/^data:application\/json[^,]+base64,/,CW=[],bW=[];function aQr(){return R6e==="browser"?!0:R6e==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}a(aQr,"isInBrowser");function Iil(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}a(Iil,"hasGlobalProcessEventEmitter");function xil(){return typeof process=="object"&&process!==null?process.version:""}a(xil,"globalProcessVersion");function wil(){if(typeof process=="object"&&process!==null)return process.stderr}a(wil,"globalProcessStderr");function Ril(t){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(t)}a(Ril,"globalProcessExit");function wkt(t){return function(e){for(var r=0;r";var r=this.getLineNumber();if(r!=null){e+=":"+r;var n=this.getColumnNumber();n&&(e+=":"+n)}}var o="",s=this.getFunctionName(),c=!0,l=this.isConstructor(),u=!(this.isToplevel()||l);if(u){var d=this.getTypeName();d==="[object Object]"&&(d="null");var f=this.getMethodName();s?(d&&s.indexOf(d)!=0&&(o+=d+"."),o+=s,f&&s.indexOf("."+f)!=s.length-f.length-1&&(o+=" [as "+f+"]")):o+=d+"."+(f||"")}else l?o+="new "+(s||""):s?o+=s:(o+=e,c=!1);return c&&(o+=" ("+e+")"),o}a(Pil,"CallSiteToString");function Vao(t){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(function(r){e[r]=/^(?:is|get)/.test(r)?function(){return t[r].call(t)}:t[r]}),e.toString=Pil,e}a(Vao,"cloneCallSite");function zao(t,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),t.isNative())return e.curPosition=null,t;var r=t.getFileName()||t.getScriptNameOrSourceURL();if(r){var n=t.getLineNumber(),o=t.getColumnNumber()-1,s=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,c=s.test(xil())?0:62;n===1&&o>c&&!aQr()&&!t.isEval()&&(o-=c);var l=uQr({source:r,line:n,column:o});e.curPosition=l,t=Vao(t);var u=t.getFunctionName;return t.getFunctionName=function(){return e.nextPosition==null?u():e.nextPosition.name||u()},t.getFileName=function(){return l.source},t.getLineNumber=function(){return l.line},t.getColumnNumber=function(){return l.column+1},t.getScriptNameOrSourceURL=function(){return l.source},t}var d=t.isEval()&&t.getEvalOrigin();return d&&(d=Wao(d),t=Vao(t),t.getEvalOrigin=function(){return d}),t}a(zao,"wrapCallSite");function Dil(t,e){iQr&&(goe={},k6e={});for(var r=t.name||"Error",n=t.message||"",o=r+": "+n,s={nextPosition:null,curPosition:null},c=[],l=e.length-1;l>=0;l--)c.push(` - at `+zao(e[l],s)),s.nextPosition=s.curPosition;return s.curPosition=s.nextPosition=null,o+c.reverse().join("")}a(Dil,"prepareStackTrace");function Yao(t){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(e){var r=e[1],n=+e[2],o=+e[3],s=goe[r];if(!s&&JL&&JL.existsSync(r))try{s=JL.readFileSync(r,"utf8")}catch{s=""}if(s){var c=s.split(/(?:\r\n|\r|\n)/)[n-1];if(c)return r+":"+n+` +`+" ".repeat(e))}};(function(t){t.DEFAULT={allowTrailingComma:!1}})(uXi||(uXi={}));(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(dXi||(dXi={}));(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(fXi||(fXi={}));(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(pXi||(pXi={}));a(bso,"rW");gW=cQr.default.homedir(),lQr=cQr.default.tmpdir(),{env:Sve}=Swt.default,ttl=a(t=>{let e=lf.default.join(gW,"Library");return{data:lf.default.join(e,"Application Support",t),config:lf.default.join(e,"Preferences",t),cache:lf.default.join(e,"Caches",t),log:lf.default.join(e,"Logs",t),temp:lf.default.join(lQr,t)}},"Oe"),rtl=a(t=>{let e=Sve.APPDATA||lf.default.join(gW,"AppData","Roaming"),r=Sve.LOCALAPPDATA||lf.default.join(gW,"AppData","Local");return{data:lf.default.join(r,t,"Data"),config:lf.default.join(e,t,"Config"),cache:lf.default.join(r,t,"Cache"),log:lf.default.join(r,t,"Log"),temp:lf.default.join(lQr,t)}},"De"),ntl=a(t=>{let e=lf.default.basename(gW);return{data:lf.default.join(Sve.XDG_DATA_HOME||lf.default.join(gW,".local","share"),t),config:lf.default.join(Sve.XDG_CONFIG_HOME||lf.default.join(gW,".config"),t),cache:lf.default.join(Sve.XDG_CACHE_HOME||lf.default.join(gW,".cache"),t),log:lf.default.join(Sve.XDG_STATE_HOME||lf.default.join(gW,".local","state"),t),temp:lf.default.join(lQr,e,t)}},"Fe");a(itl,"Mz");Rrm=itl("claude-cli");a(otl,"Ze");a(stl,"wE");atl=100,K8r=[];a(ctl,"Le");ltl=[],hXi=null,krm=Oy(()=>process.argv.includes("--hard-fail"));a(Sso,"oW");yve=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Tso=new Set,c9r=typeof process=="object"&&process?process:{},Iso=a((t,e,r,n)=>{typeof c9r.emitWarning=="function"?c9r.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"ZE"),Twt=globalThis.AbortController,mXi=globalThis.AbortSignal;if(typeof Twt>"u"){mXi=class{static{a(this,"DE")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,n){this._onabort.push(n)}},Twt=class{static{a(this,"tW")}constructor(){e()}signal=new mXi;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let n of this.signal._onabort)n(r);this.signal.onabort?.(r)}}};let t=c9r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,Iso("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"Q")}utl=a(t=>!Tso.has(t),"Ae"),fW=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"p1"),xso=a(t=>fW(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?wve:null:null,"ME"),wve=class extends Array{static{a(this,"rJ")}constructor(e){super(e),this.fill(0)}},l9r=class t{static{a(this,"I9")}heap;length;static#e=!1;static create(e){let r=xso(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},u9r=class t{static{a(this,"aW")}#e;#t;#r;#n;#i;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#a;#c;#u;#l;#p;#g;#A;#h;#v;#m;#b;#T;#E;#C;#S;#y;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#E,sizes:e.#b,keyMap:e.#c,keyList:e.#u,valList:e.#l,next:e.#p,prev:e.#g,get head(){return e.#A},get tail(){return e.#h},free:e.#v,isBackgroundFetch:a(r=>e.#f(r),"isBackgroundFetch"),backgroundFetch:a((r,n,o,s)=>e.#U(r,n,o,s),"backgroundFetch"),moveToTail:a(r=>e.#O(r),"moveToTail"),indexes:a(r=>e.#I(r),"indexes"),rindexes:a(r=>e.#x(r),"rindexes"),isStale:a(r=>e.#_(r),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#a}get size(){return this.#s}get fetchMethod(){return this.#i}get memoMethod(){return this.#o}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(e){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,maxEntrySize:A=0,sizeCalculation:y,fetchMethod:E,memoMethod:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:R}=e;if(r!==0&&!fW(r))throw TypeError("max option must be a nonnegative integer");let x=r?xso(r):Array;if(!x)throw Error("invalid max value: "+r);if(this.#e=r,this.#t=g,this.maxEntrySize=A||this.#t,this.sizeCalculation=y,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw TypeError("sizeCalculation set to non-function")}if(_!==void 0&&typeof _!="function")throw TypeError("memoMethod must be a function if defined");if(this.#o=_,E!==void 0&&typeof E!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#i=E,this.#S=!!E,this.#c=new Map,this.#u=Array(r).fill(void 0),this.#l=Array(r).fill(void 0),this.#p=new x(r),this.#g=new x(r),this.#A=0,this.#h=0,this.#v=l9r.create(r),this.#s=0,this.#a=0,typeof d=="function"&&(this.#r=d),typeof f=="function"?(this.#n=f,this.#m=[]):(this.#n=void 0,this.#m=void 0),this.#C=!!this.#r,this.#y=!!this.#n,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!w,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!fW(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!fW(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=fW(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!fW(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError("At least one of max, maxSize, or ttl is required");!this.ttlAutopurge&&!this.#e&&!this.#t&&utl("LRU_CACHE_UNBOUNDED")&&(Tso.add("LRU_CACHE_UNBOUNDED"),Iso("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",t))}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#k(){let e=new wve(this.#e),r=new wve(this.#e);this.#E=e,this.#T=r,this.#L=(s,c,l=yve.now())=>{if(r[s]=c!==0?l:0,e[s]=c,c!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#_(s)&&this.#w(this.#u[s],"expire")},c+1);u.unref&&u.unref()}},this.#R=s=>{r[s]=e[s]!==0?yve.now():0},this.#d=(s,c)=>{if(e[c]){let l=e[c],u=r[c];if(!l||!u)return;s.ttl=l,s.start=u,s.now=n||o();let d=s.now-u;s.remainingTTL=l-d}};let n=0,o=a(()=>{let s=yve.now();if(this.ttlResolution>0){n=s;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref()}return s},"Y");this.getRemainingTTL=s=>{let c=this.#c.get(s);if(c===void 0)return 0;let l=e[c],u=r[c];if(!l||!u)return 1/0;let d=(n||o())-u;return l-d},this.#_=s=>{let c=r[s],l=e[s];return!!l&&!!c&&(n||o())-c>l}}#R=a(()=>{},"#E");#d=a(()=>{},"#R");#L=a(()=>{},"#y");#_=a(()=>!1,"#N");#D(){let e=new wve(this.#e);this.#a=0,this.#b=e,this.#P=r=>{this.#a-=e[r],e[r]=0},this.#B=(r,n,o,s)=>{if(this.#f(n))return 0;if(!fW(o))if(s){if(typeof s!="function")throw TypeError("sizeCalculation must be a function");if(o=s(n,r),!fW(o))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o},this.#N=(r,n,o)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#a>s;)this.#M(!0)}this.#a+=e[r],o&&(o.entrySize=n,o.totalCalculatedSize=this.#a)}}#P=a(e=>{},"#b");#N=a((e,r,n)=>{},"#v");#B=a((e,r,n,o)=>{if(n||o)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#f");*#I({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#h;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#A));)r=this.#g[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#A;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#h));)r=this.#p[r]}#F(e){return e!==void 0&&this.#c.get(this.#u[e])===e}*entries(){for(let e of this.#I())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*rentries(){for(let e of this.#x())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*keys(){for(let e of this.#I()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*values(){for(let e of this.#I())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}*rvalues(){for(let e of this.#x())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;if(s!==void 0&&e(s,this.#u[n],this))return this.get(this.#u[n],r)}}forEach(e,r=this){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}rforEach(e,r=this){for(let n of this.#x()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#_(r)&&(this.#w(this.#u[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let n=this.#l[r],o=this.#f(n)?n.__staleWhileFetching:n;if(o===void 0)return;let s={value:o};if(this.#E&&this.#T){let c=this.#E[r],l=this.#T[r];if(c&&l){let u=c-(yve.now()-l);s.ttl=u,s.start=Date.now()}}return this.#b&&(s.size=this.#b[r]),s}dump(){let e=[];for(let r of this.#I({allowStale:!0})){let n=this.#u[r],o=this.#l[r],s=this.#f(o)?o.__staleWhileFetching:o;if(s===void 0||n===void 0)continue;let c={value:s};if(this.#E&&this.#T){c.ttl=this.#E[r];let l=yve.now()-this.#T[r];c.start=Math.floor(Date.now()-l)}this.#b&&(c.size=this.#b[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=yve.now()-o}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:s,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,f=this.#B(e,r,n.size||0,l);if(this.maxEntrySize&&f>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#w(e,"set"),this;let h=this.#s===0?void 0:this.#c.get(e);if(h===void 0)h=this.#s===0?this.#h:this.#v.length!==0?this.#v.pop():this.#s===this.#e?this.#M(!1):this.#s,this.#u[h]=e,this.#l[h]=r,this.#c.set(e,h),this.#p[this.#h]=h,this.#g[h]=this.#h,this.#h=h,this.#s++,this.#N(h,f,u),u&&(u.set="add"),d=!1;else{this.#O(h);let m=this.#l[h];if(r!==m){if(this.#S&&this.#f(m)){m.__abortController.abort(Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!c&&(this.#C&&this.#r?.(g,e,"set"),this.#y&&this.#m?.push([g,e,"set"]))}else c||(this.#C&&this.#r?.(m,e,"set"),this.#y&&this.#m?.push([m,e,"set"]));if(this.#P(h),this.#N(h,f,u),this.#l[h]=r,u){u.set="replace";let g=m&&this.#f(m)?m.__staleWhileFetching:m;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(o!==0&&!this.#E&&this.#k(),this.#E&&(d||this.#L(h,o,s),u&&this.#d(u,h)),!c&&this.#y&&this.#m){let m=this.#m,g;for(;g=m?.shift();)this.#n?.(...g)}return this}pop(){try{for(;this.#s;){let e=this.#l[this.#A];if(this.#M(!0),this.#f(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#y&&this.#m){let e=this.#m,r;for(;r=e?.shift();)this.#n?.(...r)}}}#M(e){let r=this.#A,n=this.#u[r],o=this.#l[r];return this.#S&&this.#f(o)?o.__abortController.abort(Error("evicted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(o,n,"evict"),this.#y&&this.#m?.push([o,n,"evict"])),this.#P(r),e&&(this.#u[r]=void 0,this.#l[r]=void 0,this.#v.push(r)),this.#s===1?(this.#A=this.#h=0,this.#v.length=0):this.#A=this.#p[r],this.#c.delete(n),this.#s--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:o}=r,s=this.#c.get(e);if(s!==void 0){let c=this.#l[s];if(this.#f(c)&&c.__staleWhileFetching===void 0)return!1;if(this.#_(s))o&&(o.has="stale",this.#d(o,s));else return n&&this.#R(s),o&&(o.has="hit",this.#d(o,s)),!0}else o&&(o.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,o=this.#c.get(e);if(o===void 0||!n&&this.#_(o))return;let s=this.#l[o];return this.#f(s)?s.__staleWhileFetching:s}#U(e,r,n,o){let s=r===void 0?void 0:this.#l[r];if(this.#f(s))return s;let c=new Twt,{signal:l}=n;l?.addEventListener("abort",()=>c.abort(l.reason),{signal:c.signal});let u={signal:c.signal,options:n,context:o},d=a((y,E=!1)=>{let{aborted:_}=c.signal,v=n.ignoreFetchAbort&&y!==void 0;if(n.status&&(_&&!E?(n.status.fetchAborted=!0,n.status.fetchError=c.signal.reason,v&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),_&&!v&&!E)return h(c.signal.reason);let b=g;return this.#l[r]===g&&(y===void 0?b.__staleWhileFetching?this.#l[r]=b.__staleWhileFetching:this.#w(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,y,u.options))),y},"H"),f=a(y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=y),h(y)),"q"),h=a(y=>{let{aborted:E}=c.signal,_=E&&n.allowStaleOnFetchAbort,v=_||n.allowStaleOnFetchRejection,b=v||n.noDeleteOnFetchRejection,T=g;if(this.#l[r]===g&&(!b||T.__staleWhileFetching===void 0?this.#w(e,"fetch"):_||(this.#l[r]=T.__staleWhileFetching)),v)return n.status&&T.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw y},"V"),m=a((y,E)=>{let _=this.#i?.(e,s,u);_&&_ instanceof Promise&&_.then(v=>y(v===void 0?void 0:v),E),c.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(y(void 0),n.allowStaleOnFetchAbort&&(y=a(v=>d(v,!0),"w")))})},"B");n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(d,f),A=Object.assign(g,{__abortController:c,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,A,{...u.options,status:void 0}),r=this.#c.get(e)):this.#l[r]=A,A}#f(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Twt}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:y,forceRefresh:E=!1,status:_,signal:v}=r;if(!this.#S)return _&&(_.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:_});let b={allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,ttl:c,noDisposeOnSet:l,size:u,sizeCalculation:d,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:g,status:_,signal:v},T=this.#c.get(e);if(T===void 0){_&&(_.fetch="miss");let w=this.#U(e,T,b,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let D=n&&w.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",D&&(_.returnedStale=!0)),D?w.__staleWhileFetching:w.__returned=w}let R=this.#_(T);if(!E&&!R)return _&&(_.fetch="hit"),this.#O(T),o&&this.#R(T),_&&this.#d(_,T),w;let x=this.#U(e,T,b,y),P=x.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=R?"stale":"refresh",P&&R&&(_.returnedStale=!0)),P?x.__staleWhileFetching:x.__returned=x}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#o;if(!n)throw Error("no memoMethod provided to constructor");let{context:o,forceRefresh:s,...c}=r,l=this.get(e,c);if(!s&&l!==void 0)return l;let u=n(e,l,{options:c,context:o});return this.set(e,u,c),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:c}=r,l=this.#c.get(e);if(l!==void 0){let u=this.#l[l],d=this.#f(u);return c&&this.#d(c,l),this.#_(l)?(c&&(c.get="stale"),d?(c&&n&&u.__staleWhileFetching!==void 0&&(c.returnedStale=!0),n?u.__staleWhileFetching:void 0):(s||this.#w(e,"expire"),c&&n&&(c.returnedStale=!0),n?u:void 0)):(c&&(c.get="hit"),d?u.__staleWhileFetching:(this.#O(l),o&&this.#R(l),u))}else c&&(c.get="miss")}#Q(e,r){this.#g[r]=e,this.#p[e]=r}#O(e){e!==this.#h&&(e===this.#A?this.#A=this.#p[e]:this.#Q(this.#g[e],this.#p[e]),this.#Q(this.#h,e),this.#h=e)}delete(e){return this.#w(e,"delete")}#w(e,r){let n=!1;if(this.#s!==0){let o=this.#c.get(e);if(o!==void 0)if(n=!0,this.#s===1)this.#q(r);else{this.#P(o);let s=this.#l[o];if(this.#f(s)?s.__abortController.abort(Error("deleted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(s,e,r),this.#y&&this.#m?.push([s,e,r])),this.#c.delete(e),this.#u[o]=void 0,this.#l[o]=void 0,o===this.#h)this.#h=this.#g[o];else if(o===this.#A)this.#A=this.#p[o];else{let c=this.#g[o];this.#p[c]=this.#p[o];let l=this.#p[o];this.#g[l]=this.#g[o]}this.#s--,this.#v.push(o)}}if(this.#y&&this.#m?.length){let o=this.#m,s;for(;s=o?.shift();)this.#n?.(...s)}return n}clear(){return this.#q("delete")}#q(e){for(let r of this.#x({allowStale:!0})){let n=this.#l[r];if(this.#f(n))n.__abortController.abort(Error("deleted"));else{let o=this.#u[r];this.#C&&this.#r?.(n,o,e),this.#y&&this.#m?.push([n,o,e])}}if(this.#c.clear(),this.#l.fill(void 0),this.#u.fill(void 0),this.#E&&this.#T&&(this.#E.fill(0),this.#T.fill(0)),this.#b&&this.#b.fill(0),this.#A=0,this.#h=0,this.#v.length=0,this.#a=0,this.#s=0,this.#y&&this.#m){let r=this.#m,n;for(;n=r?.shift();)this.#n?.(...n)}}};a(dtl,"LE");ftl=8192;a(wso,"AE");gXi=dtl(wso,t=>t,50),_Rt=Object.assign(function(t,e=!0){if(!t)return null;let r=t.length>ftl?wso(t,e):gXi(t,e);return r.ok?r.value:null},{cache:gXi.cache}),vRt=Oy(()=>{try{if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";if(process.platform==="linux"){if(process.env.WSL_DISTRO_NAME||process.env.WSL_INTEROP)return"wsl";try{let t=FI().readFileSync("/proc/version",{encoding:"utf8"});if(t.toLowerCase().includes("microsoft")||t.toLowerCase().includes("wsl"))return"wsl"}catch(t){nu(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"})}return"linux"}return"unknown"}catch(t){return Sso(t),"unknown"}}),Drm=Oy(()=>{if(process.platform==="linux")try{let t=FI().readFileSync("/proc/version",{encoding:"utf8"}),e=t.match(/WSL(\d+)/i);return e&&e[1]?e[1]:t.toLowerCase().includes("microsoft")?"1":void 0}catch(t){nu(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"});return}}),Nrm=Oy(async()=>{if(process.platform!=="linux")return;let t={linuxKernel:(0,uQr.release)()};try{let e=await(0,kso.readFile)("/etc/os-release","utf8");for(let r of e.split(` +`)){let n=r.match(/^(ID|VERSION_ID)=(.*)$/);if(n&&n[1]&&n[2]){let o=n[2].replace(/^"|"$/g,"");n[1]==="ID"?t.linuxDistroId=o:t.linuxDistroVersion=o}}}catch{}return t}),Mrm=Oy(()=>{if(process.platform!=="darwin")return;let t=(0,uQr.release)().match(/^(\d+)\./);if(!(!t||!t[1]))return parseInt(t[1],10)-9}),r6e=Oy(function(){switch(vRt()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),Orm=Oy(function(){return(0,Rso.join)(r6e(),"managed-settings.d")}),ptl=wr(()=>G.object({allowedDomains:G.array(G.string()).optional(),deniedDomains:G.array(G.string()).optional().describe("Domains that are always blocked, even if matched by allowedDomains. Supports the same wildcard syntax as allowedDomains. Merged from all settings sources regardless of allowManagedDomainsOnly."),allowManagedDomainsOnly:G.boolean().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:G.array(G.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:G.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:G.boolean().optional(),allowMachLookup:G.array(G.string().refine(t=>!(t.endsWith("*")?t.slice(0,-1):t).includes("*"),{message:'Wildcards are only allowed as a single trailing "*" (e.g., "com.example.*" or "*" for all services).'})).optional().describe('macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., "com.apple.coresimulator.*"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright.'),httpProxyPort:G.number().optional(),socksProxyPort:G.number().optional(),tlsTerminate:G.object({caCertPath:G.string().min(1).optional(),caKeyPath:G.string().min(1).optional()}).optional().describe("[EXPERIMENTAL] Enable in-process TLS termination so the per-request filter can see HTTPS request bodies. Provide a CA cert+key, or omit both to have sandbox-runtime generate an ephemeral one for the session.")}).optional()),htl=wr(()=>G.object({allowWrite:G.array(G.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:G.array(G.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:G.array(G.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:G.array(G.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:G.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used.")}).optional()),mtl=wr(()=>G.object({enabled:G.boolean().optional(),failIfUnavailable:G.boolean().optional().describe("Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies or unsupported platform). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate."),autoAllowBashIfSandboxed:G.boolean().optional(),allowUnsandboxedCommands:G.boolean().optional().describe("Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."),network:ptl(),filesystem:htl(),ignoreViolations:G.record(G.string(),G.array(G.string())).optional(),enableWeakerNestedSandbox:G.boolean().optional(),enableWeakerNetworkIsolation:G.boolean().optional().describe("macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. **Reduces security** \u2014 opens a potential data exfiltration vector through the trustd service. Default: false"),excludedCommands:G.array(G.string()).optional(),ripgrep:G.object({command:G.string(),args:G.array(G.string()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support"),bwrapPath:G.preprocess(t=>typeof t=="string"&&(0,d9r.isAbsolute)(t)?t:void 0,G.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the bwrap (bubblewrap) binary. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings."),socatPath:G.preprocess(t=>typeof t=="string"&&(0,d9r.isAbsolute)(t)?t:void 0,G.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the socat binary used for the sandbox network proxy. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.")}).passthrough()),gtl=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","notifications_disabled"],Atl=["normal","vim"],ytl=["auto","tmux","in-process"],Etl=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],_tl=["auto",...Etl],Lrm=vRt()==="macos"?"\u23FA":"\u25CF",dQr=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],vtl=[...dQr,"bubble"],Ctl=vtl,Brm=wr(()=>Yoo.enum(Ctl)),Frm=wr(()=>Yoo.enum(dQr)),btl=["bash","powershell"],p8e=wr(()=>G.string().optional().describe('Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.'));a(Stl,"Se");Ttl=wr(()=>{let{BashCommandHookSchema:t,PromptHookSchema:e,AgentHookSchema:r,HttpHookSchema:n,McpToolHookSchema:o}=Stl();return G.discriminatedUnion("type",[t,e,r,n,o])}),Itl=wr(()=>G.object({matcher:G.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:G.array(Ttl()).describe("List of hooks to execute when the matcher matches")})),Iwt=wr(()=>G.partialRecord(G.enum(jwt),G.array(Itl()))),Urm=wr(()=>G.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),Qrm=wr(()=>G.enum(["stdio","sse","sse-ide","http","ws","sdk"])),dCe=wr(()=>G.literal("comms").optional().catch(void 0)),xW=wr(()=>G.number().int().positive()),xtl=wr(()=>G.object({type:G.literal("stdio").optional(),command:G.string().min(1,"Command cannot be empty"),args:G.array(G.string()).default([]),env:G.record(G.string(),G.string()).optional(),timeout:xW().optional(),alwaysLoad:G.boolean().optional(),role:dCe()})),wtl=wr(()=>G.boolean()),Pso=wr(()=>G.object({clientId:G.string().optional(),callbackPort:G.number().int().positive().optional(),authServerMetadataUrl:G.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:G.string().min(1).optional(),xaa:wtl().optional()})),Rtl=wr(()=>G.object({type:G.literal("sse"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:Pso().optional(),timeout:xW().optional(),alwaysLoad:G.boolean().optional(),role:dCe()})),ktl=wr(()=>G.object({type:G.literal("sse-ide"),url:G.string(),ideName:G.string(),ideRunningInWindows:G.boolean().optional(),timeout:xW().optional(),alwaysLoad:G.boolean().optional(),role:dCe()})),Ptl=wr(()=>G.object({type:G.literal("ws-ide"),url:G.string(),ideName:G.string(),authToken:G.string().optional(),ideRunningInWindows:G.boolean().optional(),timeout:xW().optional(),alwaysLoad:G.boolean().optional(),role:dCe()})),Dtl=wr(()=>G.object({type:G.enum(["http","streamable-http"]).transform(()=>"http"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:Pso().optional(),timeout:xW().optional(),alwaysLoad:G.boolean().optional(),role:dCe()})),Ntl=wr(()=>G.object({type:G.literal("ws"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),timeout:xW().optional(),alwaysLoad:G.boolean().optional(),role:dCe()})),Mtl=wr(()=>G.object({type:G.literal("sdk"),name:G.string(),timeout:xW().optional(),alwaysLoad:G.boolean().optional()})),Otl=wr(()=>G.enum(["allow","ask","blocked"])),Ltl=wr(()=>G.object({type:G.literal("claudeai-proxy"),url:G.string(),id:G.string(),timeout:xW().optional(),alwaysLoad:G.boolean().optional(),toolPermissions:G.record(G.string(),Otl()).optional()})),f9r=wr(()=>G.union([xtl(),Rtl(),ktl(),Ptl(),Dtl(),Ntl(),Mtl(),Ltl()])),qrm=wr(()=>G.object({mcpServers:G.record(G.string(),f9r())})),Dso=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","anthropic-agent-skills","life-sciences","knowledge-work-plugins","claude-for-legal","claude-for-financial-services","financial-services-plugins"]),Btl=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,Ftl=/[^\u0020-\u007E]/;a(Utl,"pe");KN=wr(()=>G.string().startsWith("./")),moe=wr(()=>KN().endsWith(".json")),AXi=wr(()=>G.union([KN().refine(t=>t.endsWith(".mcpb")||t.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),G.string().url().refine(t=>t.endsWith(".mcpb")||t.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),p9r=wr(()=>KN().endsWith(".md")),h9r=wr(()=>G.union([p9r(),KN()])),Nso=wr(()=>G.string().min(1,"Marketplace must have a name").refine(t=>!t.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine(t=>!t.includes("/")&&!t.includes("\\")&&!t.includes("..")&&t!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine(t=>!Utl(t),{message:"Marketplace name impersonates an official Anthropic/Claude marketplace"}).refine(t=>t.toLowerCase()!=="inline",{message:'Marketplace name "inline" is reserved for --plugin-dir session plugins'}).refine(t=>t.toLowerCase()!=="builtin",{message:'Marketplace name "builtin" is reserved for built-in plugins'}).refine(t=>t.toLowerCase()!=="skills-dir",{message:'Marketplace name "skills-dir" is reserved for plugins auto-loaded from .claude/skills/'})),fQr=wr(()=>G.object({name:G.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:G.string().optional().describe("Contact email for support or feedback"),url:G.string().optional().describe("Website, GitHub profile, or organization URL")})),Qtl=wr(()=>G.object({$schema:G.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:G.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:G.string().optional().describe('Human-readable name shown in UI (e.g., "GitHub Utils"). Falls back to `name` when omitted. Unlike `name`, may contain spaces and any casing; not used for namespacing or lookup.'),version:G.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:G.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:fQr().optional().describe("Information about the plugin creator or maintainer"),homepage:G.string().url().optional().describe("Plugin homepage or documentation URL"),repository:G.string().optional().describe("Source code repository URL"),license:G.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:G.array(G.string()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:G.boolean().optional().describe("Whether the plugin starts enabled when the user has no explicit enabled/disabled setting for it (default: true). Explicit enabledPlugins values always win, and a plugin required by an enabled dependent is enabled regardless of this value."),dependencies:G.array(url()).optional().describe(`Plugins that must be enabled for this plugin to function. Bare names (no "@marketplace") are resolved against the declaring plugin's own marketplace.`)})),jrm=wr(()=>G.object({description:G.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:G.lazy(()=>Iwt()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),qtl=wr(()=>G.object({hooks:G.union([moe().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),G.lazy(()=>Iwt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),G.array(G.union([moe().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),G.lazy(()=>Iwt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),jtl=wr(()=>G.object({source:h9r().optional().describe("Path to command markdown file, relative to plugin root"),content:G.string().optional().describe("Inline markdown content for the command"),description:G.string().optional().describe("Command description override"),argumentHint:G.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:G.string().optional().describe("Default model for this command"),allowedTools:G.array(G.string()).optional().describe("Tools allowed when command runs")}).refine(t=>t.source&&!t.content||!t.source&&t.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),Htl=wr(()=>G.object({commands:G.union([h9r().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(h9r().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of command file or skill directory paths. When set, the commands/ directory is not auto-loaded."),G.record(G.string(),jtl()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" \u2192 "/plugin:about")')])})),Gtl=wr(()=>G.object({agents:G.union([p9r().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(p9r().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of agent file paths. When set, the agents/ directory is not auto-loaded.")])})),$tl=wr(()=>G.object({skills:G.union([KN().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory."),G.array(KN().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory.")).describe("List of skill directory paths, loaded in addition to the skills/ directory.")])})),Mso=wr(()=>G.object({outputStyles:G.union([KN().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(KN().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of output-style directory or file paths. When set, the output-styles/ directory is not auto-loaded.")])})),Oso=wr(()=>G.object({themes:G.union([KN().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(KN().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of theme directory or file paths. When set, the themes/ directory is not auto-loaded.")])})),Vtl=wr(()=>G.object({})),yXi=wr(()=>G.string().min(1)),Wtl=wr(()=>G.string().min(2).refine(t=>t.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),ztl=wr(()=>G.object({mcpServers:G.union([moe().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),AXi().describe("Path or URL to MCPB file containing MCP server configuration"),G.record(G.string(),f9r()).describe("MCP server configurations keyed by server name"),G.array(G.union([moe().describe("Path to MCP servers configuration file"),AXi().describe("Path or URL to MCPB file"),G.record(G.string(),f9r()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),Lso=wr(()=>G.object({type:G.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:G.string().describe("Human-readable label shown in the config dialog"),description:G.string().describe("Help text shown beneath the field in the config dialog"),required:G.boolean().optional().describe("If true, validation fails when this field is empty"),default:G.union([G.string(),G.number(),G.boolean(),G.array(G.string())]).optional().describe("Default value used when the user provides nothing"),multiple:G.boolean().optional().describe("For string type: allow an array of strings"),sensitive:G.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:G.number().optional().describe("Minimum value (number type only)"),max:G.number().optional().describe("Maximum value (number type only)")}).strict()),Ytl=wr(()=>G.object({userConfig:G.record(G.string().regex(/^[A-Za-z_]\w*$/,"Option keys must be valid identifiers (letters, digits, underscore; no leading digit) \u2014 they become CLAUDE_PLUGIN_OPTION_ env vars in hooks"),Lso()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage. Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. Keep sensitive value counts small.")})),Ktl=wr(()=>G.object({channels:G.array(G.object({server:G.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:G.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:G.record(G.string(),Lso()).optional().describe("Fields to prompt the user for when enabling this plugin in assistant mode. Saved values are substituted into ${user_config.KEY} references in the mcpServers env.")}).strict()).describe("Channels this plugin provides. Each entry declares an MCP server as a message channel and optionally specifies user configuration to prompt for at enable time.")})),EXi=wr(()=>G.strictObject({command:G.string().min(1).refine(t=>!(t.includes(" ")&&!t.startsWith("/")),{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:G.array(yXi()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:G.record(Wtl(),yXi()).refine(t=>Object.keys(t).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:G.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:G.record(G.string(),G.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:G.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:G.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:G.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:G.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:G.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:G.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:G.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up")})),Jtl=wr(()=>G.strictObject({name:G.string().min(1).describe("Identifier for this monitor, unique within the plugin. Used to dedupe so re-arming (plugin reload, repeat skill invoke) does not spawn duplicates."),command:G.string().min(1).describe('Shell command to run as a persistent background monitor. Each stdout line is delivered to the model as a event; the process runs for the session lifetime. ${CLAUDE_PLUGIN_ROOT}, ${CLAUDE_PLUGIN_DATA}, ${CLAUDE_PROJECT_DIR}, ${user_config.*}, and ${ENV_VAR} are substituted. Runs in the session cwd \u2014 prefix with `cd "${CLAUDE_PLUGIN_ROOT}" && ` if the script needs its own directory.'),description:G.string().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:G.union([G.literal("always"),G.string().startsWith("on-skill-invoke:").refine(t=>t.length>16,{message:"on-skill-invoke: must specify a skill name"})]).default("always").describe('Arm trigger. "always" arms at session start and on plugin reload. "on-skill-invoke:" arms the first time that skill is dispatched (via Skill tool or slash command).')})),Ztl=wr(()=>G.array(Jtl()).refine(t=>new Set(t.map(e=>e.name)).size===t.length,{message:"Monitor names must be unique within a plugin"})),Bso=wr(()=>G.object({monitors:G.union([moe().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),Ztl()]).describe("Background watch scripts the host arms as persistent Monitor tasks (unsandboxed, same trust tier as hooks) so plugins need not instruct the model to arm them. When omitted, monitors/monitors.json at the plugin root is loaded if present.")})),Xtl=wr(()=>G.object({lspServers:G.union([moe().describe("Path to .lsp.json configuration file relative to plugin root"),G.record(G.string(),EXi()).describe("LSP server configurations keyed by server name"),G.array(G.union([moe().describe("Path to LSP configuration file"),G.record(G.string(),EXi()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),Fso=wr(()=>G.string().refine(t=>!t.includes("..")&&!t.includes("//"),"Package name cannot contain path traversal patterns").refine(t=>{let e=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,r=/^[a-z0-9][a-z0-9-._]*$/;return e.test(t)||r.test(t)},"Invalid npm package name format")),erl=wr(()=>G.object({settings:G.record(G.string(),G.unknown()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),trl=wr(()=>G.object({experimental:G.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,G.object({...Oso().partial().shape,...Bso().partial().shape,...Mso().partial().shape,evals:G.union([G.string(),G.array(G.string())]).optional().describe("Path(s) to evaluation query files for `claude plugin eval`. Defaults to `evals/`.")}).optional().describe("Components whose manifest shape may change without a deprecation cycle. Move a key out of here once it is promoted to stable."))})),rrl=wr(()=>G.object({...Qtl().shape,...qtl().partial().shape,...Htl().partial().shape,...Gtl().partial().shape,...$tl().partial().shape,...Mso().partial().shape,...Oso().partial().shape,...Vtl().shape,...Ktl().partial().shape,...ztl().partial().shape,...Xtl().partial().shape,...Bso().partial().shape,...erl().partial().shape,...Ytl().partial().shape,...trl().partial().shape})),xwt=wr(()=>G.discriminatedUnion("source",[G.object({source:G.literal("url"),url:G.string().url().describe("Direct URL to marketplace.json file"),headers:G.record(G.string(),G.string()).optional().describe("Custom HTTP headers (e.g., for authentication)")}),G.object({source:G.literal("github"),repo:G.string().describe("GitHub repository in owner/repo format"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:G.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:G.array(G.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:G.boolean().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),G.object({source:G.literal("git"),url:G.string().describe("Full git repository URL"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:G.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:G.array(G.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:G.boolean().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),G.object({source:G.literal("npm"),package:Fso().describe("NPM package containing marketplace.json")}),G.object({source:G.literal("file"),path:G.string().describe("Local file path to marketplace.json")}),G.object({source:G.literal("directory"),path:G.string().describe("Local directory containing .claude-plugin/marketplace.json")}),G.object({source:G.literal("skills-dir")}).describe("Policy-list sentinel for the ~/.claude/skills/ auto-load (@skills-dir plugins). In strictKnownMarketplaces: opt the scan back IN (by default any allowlist blocks it). In blockedMarketplaces: turn the scan OFF without otherwise restricting marketplaces. Only meaningful in those two managed-settings lists (areLocalPluginDirsAllowedByPolicy); known_marketplaces.json / marketplace add etc. ignore it."),G.object({source:G.literal("hostPattern"),hostPattern:G.string().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against "github.com". For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')}),G.object({source:G.literal("pathPattern"),pathPattern:G.string().describe('Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.')}),G.object({source:G.literal("settings"),name:Nso().refine(t=>!Dso.has(t.toLowerCase()),{message:"Reserved official marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false."}).describe("Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation as PluginMarketplaceSchema plus reserved-name rejection \u2014 validateOfficialNameSource runs after the disk write, too late to clean up."),plugins:G.array(nrl()).describe("Plugin entries declared inline in settings.json"),owner:fQr().optional()}).describe("Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).")])),J8r=wr(()=>G.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),Uso=wr(()=>G.union([KN().describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),G.object({source:G.literal("npm"),package:Fso().or(G.string().refine(t=>/^(?:file|https?|git(?:\+https?|\+ssh)?|ssh|github|gitlab|bitbucket):/i.test(t)||!t.includes(".."),'Package reference cannot contain ".." path segments')).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:G.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:G.string().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),G.object({source:G.literal("url"),url:G.string().describe("Full git repository URL (https:// or git@)"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:J8r().optional().describe("Specific commit SHA to use")}),G.object({source:G.literal("github"),repo:G.string().describe("GitHub repository in owner/repo format"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:J8r().optional().describe("Specific commit SHA to use")}),G.object({source:G.literal("git-subdir"),url:G.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:G.string().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.'),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:J8r().optional().describe("Specific commit SHA to use")}).describe("Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded."),G.object({source:G.literal("unsupported")}).describe('Placeholder for source types this Claude Code version does not recognize. Never authored by hand \u2014 PluginMarketplaceSchema rewrites unparseable sources to this so the entry remains in marketplace.plugins (detectDelistedPlugins must not see it as removed). Install attempts fail at cachePlugin with a clear "update Claude Code" message.')])),nrl=wr(()=>G.object({name:G.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Plugin name as it appears in the target repository"),source:Uso().describe("Where to fetch the plugin from. Must be a remote source \u2014 relative paths have no marketplace repository to resolve against."),description:G.string().optional(),version:G.string().optional(),strict:G.boolean().optional()}).refine(t=>typeof t.source!="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}).refine(t=>typeof t.source=="string"||t.source.source!=="unsupported",{message:"source.source: 'unsupported' is a parse-time placeholder and cannot be authored. Use a remote source (github, git-subdir, npm, url)."})),irl=wr(()=>G.object({cli:G.array(G.string().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) \u2014 exact match against commands run this session.'),hosts:G.array(G.string().max(128)).max(20).optional().describe('Hostnames (e.g. ["api.stripe.com"]) \u2014 exact, case-insensitive match against hostnames seen in https?:// URLs in bash commands run this session. Bare hostname only: lowercase, no scheme, no port, no path.'),filesRead:G.array(G.string().max(256)).max(10).optional().describe('Glob patterns (e.g. ["**/*.tf"]) \u2014 the plugin is relevant when a file Claude has read this session matches any pattern. Matched against read-file paths, forward-slash normalized, case-insensitive.'),manifestDeps:G.array(G.object({file:G.string().max(256),pattern:G.string().max(256)})).max(10).optional().describe("Dependency declared in a package manifest. Each {file, pattern} is a pair of RegExp sources: `file` matches the manifest filename (package.json, go.mod, requirements.txt, \u2026); `pattern` matches the dependency declaration inside that file. Evaluated against files read this session."),cwd:G.array(G.string().max(256)).max(10).optional().describe(`Glob patterns (e.g. ["Engine/Source/Runtime/Renderer/**"]) \u2014 the plugin is relevant when the session's working directory is at or under a directory matching the pattern. Matched against the cwd both relative to the enclosing git repo root and as an absolute path, forward-slash normalized, case-insensitive. A bare directory (no glob characters) means "cwd is at or under this directory". Known at session start, so this signal can surface a suggestion before the first turn.`)})),orl=wr(()=>G.object({topic:G.string().max(64).optional().describe('What the user is working with when this plugin is relevant \u2014 fills "Working with {topic}?". Often the product name (e.g. "Stripe"); use a domain (e.g. "design") when the plugin name does not read naturally as a topic. Defaults to the plugin name with each hyphen-segment capitalized.'),signals:irl().optional().describe("Matchers that determine when the plugin is relevant.")})),srl=wr(()=>rrl().partial().extend({name:G.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier matching the plugin name"),source:Uso().describe("Where to fetch the plugin from"),category:G.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:G.array(G.string()).optional().describe("Tags for searchability and discovery"),strict:G.boolean().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest."),relevance:G.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,orl().optional()).describe(`Declares when this plugin is relevant to the user's work. Consumed by the spinner tip ("Working with {topic}?"), session-start auto-suggest, and marketplace browse ranking.`)})),arl=wr(()=>G.object({name:G.string().min(1).refine(t=>!t.includes(" "))}));a(crl,"z$$");Hrm=wr(()=>G.object({$schema:G.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:Nso(),version:G.string().optional().describe("Marketplace manifest version"),description:G.string().optional().describe("Human-readable description of this marketplace"),owner:fQr().describe("Marketplace maintainer or curator information"),plugins:G.array(G.unknown()).transform(crl).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:G.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:G.object({pluginRoot:G.string().optional().describe("Base path for relative plugin sources"),version:G.string().optional().describe("Marketplace version"),description:G.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:G.array(G.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies \u2014 no transitive trust.")})),Qso=wr(()=>G.string().regex(/^[A-Za-z0-9][-A-Za-z0-9._]*@[A-Za-z0-9][-A-Za-z0-9._]*$/,"Plugin ID must be in format: plugin@marketplace")),lrl=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,url=wr(()=>G.union([G.string().regex(lrl,"Dependency must be a plugin name, optionally qualified with @marketplace").transform(t=>t.replace(/@\^[^@]*$/,"")),G.object({name:G.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:G.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform(t=>t.marketplace?`${t.name}@${t.marketplace}`:t.name)])),drl=wr(()=>G.object({version:G.string().describe("Currently installed version"),installedAt:G.string().describe("ISO 8601 timestamp of installation"),lastUpdated:G.string().optional().describe("ISO 8601 timestamp of last update"),installPath:G.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:G.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:G.string().optional().describe("Tag-derived semver this install resolved to (when fetched via a version constraint). Used by verifyAndDemote in preference to manifest.version, since the upstream may have forgotten to bump plugin.json."),auto:G.boolean().optional().describe("True when this plugin was pulled in as a dependency rather than installed explicitly. Auto-installed plugins are eligible for removal by the orphan sweep when nothing depends on them. Absent = manual (preserves pre-flag installs).")})),frl=wr(()=>G.object({version:G.literal(1).describe("Schema version 1"),plugins:G.record(Qso(),drl()).describe("Map of plugin IDs to their installation metadata")})),prl=wr(()=>G.enum(["managed","user","project","local"])),hrl=wr(()=>G.object({scope:prl().describe("Installation scope"),projectPath:G.string().optional().describe("Project path (required for project/local scopes)"),installPath:G.string().describe("Absolute path to the versioned plugin directory"),version:G.string().optional().describe("Currently installed version"),installedAt:G.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:G.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:G.string().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:G.string().optional().describe("Tag-derived semver this install resolved to"),auto:G.boolean().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep.")})),mrl=wr(()=>G.object({version:G.literal(2).describe("Schema version 2"),plugins:G.record(Qso(),G.array(hrl())).describe("Map of plugin IDs to arrays of installation entries")})),Grm=wr(()=>G.union([frl(),mrl()])),grl=wr(()=>G.object({source:xwt().describe("Where to fetch the marketplace from"),installLocation:G.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:G.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:G.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),$rm=wr(()=>G.record(G.string(),grl())),Arl=["userSettings","projectSettings","localSettings","flagSettings","policySettings"],yrl="https://json.schemastore.org/claude-code-settings.json",Erl=["autoMode","deepLink","voice","assistant","briefView"],lxt={},CRt={autoMode:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>lxt,"shape"),permissionsShape:a(()=>lxt,"permissionsShape"),permissionModes:a(()=>[],"permissionModes")},deepLink:{buildGate:a(()=>!0,"buildGate"),shape:a(()=>({disableDeepLinkRegistration:G.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")}),"shape")},voice:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>lxt,"shape")},assistant:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>lxt,"shape")},briefView:{buildGate:a(()=>!0,"buildGate"),shape:a(()=>({defaultView:G.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")}),"shape")}};a(qso,"Ez");a(_rl,"tE");a(vrl,"aE");a(Crl,"sE");a(brl,"eE");_Xi={Task:"Agent",KillShell:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage"};a(Eve,"E9");jso="workspace",Vrm=`mcp__${jso}__bash`,Wrm=`mcp__${jso}__web_fetch`;a(Srl,"A$$");a(Trl,"Jb");a(Irl,"I$$");a(xrl,"R$$");wwt={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit"],bashPrefixTools:["Bash"],customValidation:{WebSearch:a(t=>t.includes("*")||t.includes("?")?{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]}:{valid:!0},"WebSearch"),WebFetch:a(t=>t.includes("://")||t.startsWith("http")?{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]}:t.startsWith("domain:")?{valid:!0}:{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]},"WebFetch")}};a(wrl,"Xb");a(Rrl,"Yb");a(krl,"Wb");a(Hso,"Gb");a(Z8r,"bz");a(Prl,"P$$");a(Gso,"_z");X8r=wr(()=>G.string().superRefine((t,e)=>{let r=Gso(t);if(!r.valid){let n=r.error;r.suggestion&&(n+=`. ${r.suggestion}`),r.examples&&r.examples.length>0&&(n+=`. Examples: ${r.examples.join(", ")}`),e.addIssue({code:G.ZodIssueCode.custom,message:n,params:{received:t}})}})),Drl=wr(()=>G.record(G.string(),G.coerce.string()));a($so,"Hb");zrm=wr(()=>$so(qso())),Nrl=wr(()=>G.object({source:xwt().describe("Where to fetch the marketplace from"),installLocation:G.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:G.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),Vso=wr(()=>G.object({serverName:G.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that users are allowed to configure"),serverCommand:G.array(G.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for allowed stdio servers"),serverUrl:G.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine(t=>Vto([t.serverName!==void 0,t.serverCommand!==void 0,t.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),Wso=wr(()=>G.object({serverName:G.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:G.array(G.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for blocked stdio servers"),serverUrl:G.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine(t=>Vto([t.serverName!==void 0,t.serverCommand!==void 0,t.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),Mrl=wr(()=>G.object({path:G.string().describe("Absolute path to the helper executable"),timeoutMs:G.number().int().min(1e3).optional(),refreshIntervalMs:G.union([G.literal(0),G.number().int().min(6e4)]).optional()})),vXi=["skills","agents","hooks","mcp"];a(Orl,"Kb");fCe=wr(()=>Orl(qso())),tU="https://code.claude.com/docs/en",Lrl=[{matches:a(t=>t.path==="permissions.defaultMode"&&t.code==="invalid_value","matches"),tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:`${tU}/iam#permission-modes`}},{matches:a(t=>t.path==="apiKeyHelper"&&t.code==="invalid_type","matches"),tip:{suggestion:'Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"'}},{matches:a(t=>t.path==="cleanupPeriodDays"&&t.code==="too_small","matches"),tip:{suggestion:'cleanupPeriodDays must be at least 1. To keep transcripts for a long time, set a large number (e.g. 3650 for ~10 years). To disable transcript writes entirely, remove this setting and use the --no-session-persistence CLI flag or the SDK persistSession:false option instead. (0 is rejected because it previously silently disabled all transcript writes, which users setting it to mean "never clean up" did not expect.)'}},{matches:a(t=>t.path.startsWith("env.")&&t.code==="invalid_type","matches"),tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:`${tU}/settings#environment-variables`}},{matches:a(t=>(t.path==="permissions.allow"||t.path==="permissions.deny")&&t.code==="invalid_type"&&t.expected==="array","matches"),tip:{suggestion:'Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.'}},{matches:a(t=>t.path.startsWith("hooks.")&&t.code==="invalid_key","matches"),tip:{suggestion:"Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",docLink:`${tU}/hooks`}},{matches:a(t=>/\.hooks\.\d+\.command$/.test(t.path)&&t.code==="invalid_type"&&t.received==="undefined","matches"),tip:{suggestion:'Command hooks require `command`. For exec form (no shell), set `command` to the executable and `args` to its arguments: {"type": "command", "command": "echo", "args": ["hi"]}. For shell form, set `command` to the full shell string: {"type": "command", "command": "echo hi"}.',docLink:`${tU}/hooks#exec-form-and-shell-form`}},{matches:a(t=>t.path.includes("hooks")&&t.code==="invalid_type","matches"),tip:{suggestion:'Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}'}},{matches:a(t=>t.code==="invalid_type"&&t.expected==="boolean","matches"),tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:a(t=>t.code==="unrecognized_keys","matches"),tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:`${tU}/settings`}},{matches:a(t=>t.code==="invalid_value"&&t.enumValues!==void 0,"matches"),tip:{suggestion:void 0}},{matches:a(t=>t.code==="invalid_type"&&t.expected==="object"&&t.received===null&&t.path==="","matches"),tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:a(t=>t.path==="permissions.additionalDirectories"&&t.code==="invalid_type","matches"),tip:{suggestion:'Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command',docLink:`${tU}/iam#working-directories`}}],Brl={permissions:`${tU}/iam#configuring-permissions`,env:`${tU}/settings#environment-variables`,hooks:`${tU}/hooks`};a(Frl,"qb");Yrm=wr(()=>fCe().strict());a(CXi,"Vb");a(bXi,"Bb");a(Url,"v$$");a(SXi,"zb");a(Rve,"b9");a(TXi,"Nb");a(v6e,"d0");a(Qrl,"C$$");qrl=new Set(jwt);a(jrl,"x$$");Hrl=[{key:"allowedMcpServers",schema:Vso},{key:"deniedMcpServers",schema:Wso}];a(Grl,"f$$");a(pCe,"i1");IXi="com.anthropic.claudecode",m9r="HKLM\\SOFTWARE\\Policies\\ClaudeCode",g9r="HKCU\\SOFTWARE\\Policies\\ClaudeCode",Tve="Settings",$rl="/usr/bin/plutil",Vrl=["-convert","json","-o","-","--"],Wrl=5e3,xXi="/mnt/c/Windows/System32/reg.exe",Rwt="/mnt/c/Program Files/ClaudeCode";a(Yso,"XG");a(zrl,"Zb");Yrl=null;a(h8e,"$5");a(Krl,"Mb");a(Jrl,"Lb");hW=Object.freeze({settings:{},errors:[]}),Zso=null,Xso=null,eao=!1,kwt=null;a(Zrl,"l$$");a(Xrl,"bb");a(enl,"_b");a(tnl,"kb");a(rnl,"Sb");a(e6r,"Cz");a(wXi,"jb");a(nnl,"c$$");a(inl,"p$$");a(RXi,"Ab");a(onl,"d$$");a(kXi,"Ib");a(snl,"i$$");A9r=snl;a(anl,"n$$");cnl=anl,lnl=cnl(),unl=lnl;a(dnl,"o$$");fnl=dnl,pnl="[object Object]",hnl=Function.prototype,mnl=Object.prototype,tao=hnl.toString,gnl=mnl.hasOwnProperty,Anl=tao.call(Object);a(ynl,"Q6$");Enl=ynl;a(_nl,"J6$");y9r=_nl;a(vnl,"X6$");Cnl=vnl;a(bnl,"Y6$");Snl=bnl;a(rao,"hb");Tnl=rao;a(Inl,"W6$");xnl=Inl,PXi=Math.max;a(wnl,"G6$");nao=wnl;a(Rnl,"U6$");knl=Rnl,Pnl=zxt?function(t,e){return zxt(t,"toString",{configurable:!0,enumerable:!1,value:knl(e),writable:!0})}:uto,Dnl=Pnl,Nnl=800,Mnl=16,Onl=Date.now;a(Lnl,"B6$");Bnl=Lnl,Fnl=Bnl(Dnl),iao=Fnl;a(Unl,"N6$");Qnl=Unl;a(qnl,"w6$");jnl=qnl;a(Hnl,"O6$");Gnl=Hnl,$nl=Gnl(function(t,e,r,n){Tnl(t,e,r,n)}),AW=$nl;a(Vnl,"F6$");Wnl=Vnl;a(znl,"Z6$");Ynl=znl;a(Knl,"M6$");Jnl=Knl,DXi=_W?_W.isConcatSpreadable:void 0;a(Znl,"L6$");Xnl=Znl;a(oao,"$_");eil=oao;a(til,"j6$");ril=til;a(nil,"A6$");iil=nil,oil=iil(function(t,e){return t==null?{}:Jnl(t,e)}),t6r=oil,sil="remote-settings.json",r6r=null;a(cil,"b6$");a(lil,"_6$");a(uil,"W_");a(pQr,"fz");a(dil,"S6$");a(aao,"U_");a(n6r,"xz");a(fil,"v6$");a(Pwt,"HG");a(cao,"H_");a(lao,"K_");a(uao,"q_");a(dao,"V_");a(pil,"C6$");a(NXi,"G_");a(hil,"T6$");a(Dwt,"Y5");a(mil,"x6$");a(fao,"B_");a(gil,"y6$");a(Ail,"f6$");a(yil,"z_");a(Eil,"g6$");a(pao,"N_");a(_il,"h6$");a(vil,"u6$");a(yW,"o1");i6r=!1;a(Cil,"m6$");a(bil,"l6$");a(Sil,"c6$");a(Til,"w_");a(Iil,"O_");xil={user:"userSettings",project:"projectSettings",local:"localSettings"},MXi={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},wil=["user","project","local"],Ril=new Set(["bypassPermissions","auto","acceptEdits"]),kil=new Set(["project"]);a(Pil,"o6$");a(Dil,"F_");process.env.NoDefaultCurrentDirectoryInExePath="1";a(Nil,"LA$");a(Mil,"G4$");a(Oil,"U4$");a(Lil,"H4$");a(hao,"b_");a(E9r,"uz");a(_9r,"mz");Bil=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"]);a(Nwt,"KG");a(Fil,"q4$");a(Uil,"jA$");a(Qil,"AA$");a(qil,"IA$");a(jil,"RA$");a(Hil,"PA$");a(Gil,"EA$");a($il,"bA$");a(Vil,"_A$");a(Wil,"kA$");a(zil,"SA$");a(OXi,"M_");a(Yil,"V4$");a(Kil,"vA$");a(Jil,"CA$");a(mao,"__");a(Dk,"J4");a(gao,"k_");a(LXi,"L_");a(v9r,"lz");a(Zil,"B4$");a(BXi,"j_");a(Aao,"S_");a(Xil,"z4$");a(yao,"v_");a(eol,"N4$");a(tol,"w4$");a(rol,"O4$");a(nol,"D4$");a(iol,"F4$");a(ool,"Z4$");a(sol,"M4$");a(FXi,"A_")});var qco=I((HQr,Qco)=>{p();HQr.createWatcher=E9e()("vscode-policy-watcher");if(require.main===Qco){let t=process.platform;HQr.createWatcher(t==="darwin"?"com.visualstudio.code.oss":"CodeOSS",{UpdateMode:{type:"string"},SCMInputFontSize:{type:"number"},DisableFeedback:{type:"boolean"}},e=>console.log(e))}});var Tlo=I(JQr=>{p();var Slo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");JQr.encode=function(t){if(0<=t&&t{p();var Ilo=Tlo(),ZQr=5,xlo=1<>1;return e?-r:r}a(aal,"fromVLQSigned");XQr.encode=a(function(e){var r="",n,o=sal(e);do n=o&wlo,o>>>=ZQr,o>0&&(n|=Rlo),r+=Ilo.encode(n);while(o>0);return r},"base64VLQ_encode");XQr.decode=a(function(e,r,n){var o=e.length,s=0,c=0,l,u;do{if(r>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(u=Ilo.decode(e.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));l=!!(u&Rlo),u&=wlo,s=s+(u<{p();function cal(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}a(cal,"getArg");y_.getArg=cal;var klo=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,lal=/^data:.+\,.+$/;function Z6e(t){var e=t.match(klo);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}a(Z6e,"urlParse");y_.urlParse=Z6e;function RCe(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}a(RCe,"urlGenerate");y_.urlGenerate=RCe;function tqr(t){var e=t,r=Z6e(t);if(r){if(!r.path)return t;e=r.path}for(var n=y_.isAbsolute(e),o=e.split(/\/+/),s,c=0,l=o.length-1;l>=0;l--)s=o[l],s==="."?o.splice(l,1):s===".."?c++:c>0&&(s===""?(o.splice(l+1,c),c=0):(o.splice(l,2),c--));return e=o.join("/"),e===""&&(e=n?"/":"."),r?(r.path=e,RCe(r)):e}a(tqr,"normalize");y_.normalize=tqr;function Plo(t,e){t===""&&(t="."),e===""&&(e=".");var r=Z6e(e),n=Z6e(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),RCe(r);if(r||e.match(lal))return e;if(n&&!n.host&&!n.path)return n.host=e,RCe(n);var o=e.charAt(0)==="/"?e:tqr(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,RCe(n)):o}a(Plo,"join");y_.join=Plo;y_.isAbsolute=function(t){return t.charAt(0)==="/"||klo.test(t)};function ual(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}a(ual,"relative");y_.relative=ual;var Dlo=(function(){var t=Object.create(null);return!("__proto__"in t)})();function Nlo(t){return t}a(Nlo,"identity");function dal(t){return Mlo(t)?"$"+t:t}a(dal,"toSetString");y_.toSetString=Dlo?Nlo:dal;function fal(t){return Mlo(t)?t.slice(1):t}a(fal,"fromSetString");y_.fromSetString=Dlo?Nlo:fal;function Mlo(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}a(Mlo,"isProtoString");function pal(t,e,r){var n=kCe(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:kCe(t.name,e.name)}a(pal,"compareByOriginalPositions");y_.compareByOriginalPositions=pal;function hal(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=kCe(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:kCe(t.name,e.name)}a(hal,"compareByGeneratedPositionsDeflated");y_.compareByGeneratedPositionsDeflated=hal;function kCe(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}a(kCe,"strcmp");function mal(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=kCe(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:kCe(t.name,e.name)}a(mal,"compareByGeneratedPositionsInflated");y_.compareByGeneratedPositionsInflated=mal;function gal(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}a(gal,"parseSourceMapInput");y_.parseSourceMapInput=gal;function Aal(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=Z6e(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}e=Plo(RCe(n),e)}return tqr(e)}a(Aal,"computeSourceURL");y_.computeSourceURL=Aal});var iqr=I(Olo=>{p();var rqr=PCe(),nqr=Object.prototype.hasOwnProperty,Soe=typeof Map<"u";function fU(){this._array=[],this._set=Soe?new Map:Object.create(null)}a(fU,"ArraySet");fU.fromArray=a(function(e,r){for(var n=new fU,o=0,s=e.length;o=0)return r}else{var n=rqr.toSetString(e);if(nqr.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},"ArraySet_indexOf");fU.prototype.at=a(function(e){if(e>=0&&e{p();var Llo=PCe();function yal(t,e){var r=t.generatedLine,n=e.generatedLine,o=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=o||Llo.compareByGeneratedPositionsInflated(t,e)<=0}a(yal,"generatedPositionAfter");function zkt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}a(zkt,"MappingList");zkt.prototype.unsortedForEach=a(function(e,r){this._array.forEach(e,r)},"MappingList_forEach");zkt.prototype.add=a(function(e){yal(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},"MappingList_add");zkt.prototype.toArray=a(function(){return this._sorted||(this._array.sort(Llo.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},"MappingList_toArray");Blo.MappingList=zkt});var oqr=I(Ulo=>{p();var X6e=eqr(),Vm=PCe(),Ykt=iqr().ArraySet,Eal=Flo().MappingList;function Lk(t){t||(t={}),this._file=Vm.getArg(t,"file",null),this._sourceRoot=Vm.getArg(t,"sourceRoot",null),this._skipValidation=Vm.getArg(t,"skipValidation",!1),this._sources=new Ykt,this._names=new Ykt,this._mappings=new Eal,this._sourcesContents=null}a(Lk,"SourceMapGenerator");Lk.prototype._version=3;Lk.fromSourceMap=a(function(e){var r=e.sourceRoot,n=new Lk({file:e.file,sourceRoot:r});return e.eachMapping(function(o){var s={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(s.source=o.source,r!=null&&(s.source=Vm.relative(r,s.source)),s.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(s.name=o.name)),n.addMapping(s)}),e.sources.forEach(function(o){var s=o;r!==null&&(s=Vm.relative(r,o)),n._sources.has(s)||n._sources.add(s);var c=e.sourceContentFor(o);c!=null&&n.setSourceContent(o,c)}),n},"SourceMapGenerator_fromSourceMap");Lk.prototype.addMapping=a(function(e){var r=Vm.getArg(e,"generated"),n=Vm.getArg(e,"original",null),o=Vm.getArg(e,"source",null),s=Vm.getArg(e,"name",null);this._skipValidation||this._validateMapping(r,n,o,s),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:s})},"SourceMapGenerator_addMapping");Lk.prototype.setSourceContent=a(function(e,r){var n=e;this._sourceRoot!=null&&(n=Vm.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Vm.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[Vm.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},"SourceMapGenerator_setSourceContent");Lk.prototype.applySourceMap=a(function(e,r,n){var o=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=e.file}var s=this._sourceRoot;s!=null&&(o=Vm.relative(s,o));var c=new Ykt,l=new Ykt;this._mappings.unsortedForEach(function(u){if(u.source===o&&u.originalLine!=null){var d=e.originalPositionFor({line:u.originalLine,column:u.originalColumn});d.source!=null&&(u.source=d.source,n!=null&&(u.source=Vm.join(n,u.source)),s!=null&&(u.source=Vm.relative(s,u.source)),u.originalLine=d.line,u.originalColumn=d.column,d.name!=null&&(u.name=d.name))}var f=u.source;f!=null&&!c.has(f)&&c.add(f);var h=u.name;h!=null&&!l.has(h)&&l.add(h)},this),this._sources=c,this._names=l,e.sources.forEach(function(u){var d=e.sourceContentFor(u);d!=null&&(n!=null&&(u=Vm.join(n,u)),s!=null&&(u=Vm.relative(s,u)),this.setSourceContent(u,d))},this)},"SourceMapGenerator_applySourceMap");Lk.prototype._validateMapping=a(function(e,r,n,o){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!o)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:o}))}},"SourceMapGenerator_validateMapping");Lk.prototype._serializeMappings=a(function(){for(var e=0,r=1,n=0,o=0,s=0,c=0,l="",u,d,f,h,m=this._mappings.toArray(),g=0,A=m.length;g0){if(!Vm.compareByGeneratedPositionsInflated(d,m[g-1]))continue;u+=","}u+=X6e.encode(d.generatedColumn-e),e=d.generatedColumn,d.source!=null&&(h=this._sources.indexOf(d.source),u+=X6e.encode(h-c),c=h,u+=X6e.encode(d.originalLine-1-o),o=d.originalLine-1,u+=X6e.encode(d.originalColumn-n),n=d.originalColumn,d.name!=null&&(f=this._names.indexOf(d.name),u+=X6e.encode(f-s),s=f)),l+=u}return l},"SourceMapGenerator_serializeMappings");Lk.prototype._generateSourcesContent=a(function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=Vm.relative(r,n));var o=Vm.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)},"SourceMapGenerator_generateSourcesContent");Lk.prototype.toJSON=a(function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},"SourceMapGenerator_toJSON");Lk.prototype.toString=a(function(){return JSON.stringify(this.toJSON())},"SourceMapGenerator_toString");Ulo.SourceMapGenerator=Lk});var Qlo=I(Toe=>{p();Toe.GREATEST_LOWER_BOUND=1;Toe.LEAST_UPPER_BOUND=2;function sqr(t,e,r,n,o,s){var c=Math.floor((e-t)/2)+t,l=o(r,n[c],!0);return l===0?c:l>0?e-c>1?sqr(c,e,r,n,o,s):s==Toe.LEAST_UPPER_BOUND?e1?sqr(t,c,r,n,o,s):s==Toe.LEAST_UPPER_BOUND?c:t<0?-1:t}a(sqr,"recursiveSearch");Toe.search=a(function(e,r,n,o){if(r.length===0)return-1;var s=sqr(-1,r.length,e,r,n,o||Toe.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&n(r[s],r[s-1],!0)===0;)--s;return s},"search")});var jlo=I(qlo=>{p();function aqr(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a(aqr,"swap");function _al(t,e){return Math.round(t+Math.random()*(e-t))}a(_al,"randomIntInRange");function cqr(t,e,r,n){if(r{p();var jn=PCe(),lqr=Qlo(),DCe=iqr().ArraySet,val=eqr(),e9e=jlo().quickSort;function Pd(t,e){var r=t;return typeof t=="string"&&(r=jn.parseSourceMapInput(t)),r.sections!=null?new oM(r,e):new Fy(r,e)}a(Pd,"SourceMapConsumer");Pd.fromSourceMap=function(t,e){return Fy.fromSourceMap(t,e)};Pd.prototype._version=3;Pd.prototype.__generatedMappings=null;Object.defineProperty(Pd.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings},"get")});Pd.prototype.__originalMappings=null;Object.defineProperty(Pd.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings},"get")});Pd.prototype._charIsMappingSeparator=a(function(e,r){var n=e.charAt(r);return n===";"||n===","},"SourceMapConsumer_charIsMappingSeparator");Pd.prototype._parseMappings=a(function(e,r){throw new Error("Subclasses must implement _parseMappings")},"SourceMapConsumer_parseMappings");Pd.GENERATED_ORDER=1;Pd.ORIGINAL_ORDER=2;Pd.GREATEST_LOWER_BOUND=1;Pd.LEAST_UPPER_BOUND=2;Pd.prototype.eachMapping=a(function(e,r,n){var o=r||null,s=n||Pd.GENERATED_ORDER,c;switch(s){case Pd.GENERATED_ORDER:c=this._generatedMappings;break;case Pd.ORIGINAL_ORDER:c=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var l=this.sourceRoot;c.map(function(u){var d=u.source===null?null:this._sources.at(u.source);return d=jn.computeSourceURL(l,d,this._sourceMapURL),{source:d,generatedLine:u.generatedLine,generatedColumn:u.generatedColumn,originalLine:u.originalLine,originalColumn:u.originalColumn,name:u.name===null?null:this._names.at(u.name)}},this).forEach(e,o)},"SourceMapConsumer_eachMapping");Pd.prototype.allGeneratedPositionsFor=a(function(e){var r=jn.getArg(e,"line"),n={source:jn.getArg(e,"source"),originalLine:r,originalColumn:jn.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",jn.compareByOriginalPositions,lqr.LEAST_UPPER_BOUND);if(s>=0){var c=this._originalMappings[s];if(e.column===void 0)for(var l=c.originalLine;c&&c.originalLine===l;)o.push({line:jn.getArg(c,"generatedLine",null),column:jn.getArg(c,"generatedColumn",null),lastColumn:jn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s];else for(var u=c.originalColumn;c&&c.originalLine===r&&c.originalColumn==u;)o.push({line:jn.getArg(c,"generatedLine",null),column:jn.getArg(c,"generatedColumn",null),lastColumn:jn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s]}return o},"SourceMapConsumer_allGeneratedPositionsFor");Kkt.SourceMapConsumer=Pd;function Fy(t,e){var r=t;typeof t=="string"&&(r=jn.parseSourceMapInput(t));var n=jn.getArg(r,"version"),o=jn.getArg(r,"sources"),s=jn.getArg(r,"names",[]),c=jn.getArg(r,"sourceRoot",null),l=jn.getArg(r,"sourcesContent",null),u=jn.getArg(r,"mappings"),d=jn.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);c&&(c=jn.normalize(c)),o=o.map(String).map(jn.normalize).map(function(f){return c&&jn.isAbsolute(c)&&jn.isAbsolute(f)?jn.relative(c,f):f}),this._names=DCe.fromArray(s.map(String),!0),this._sources=DCe.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(f){return jn.computeSourceURL(c,f,e)}),this.sourceRoot=c,this.sourcesContent=l,this._mappings=u,this._sourceMapURL=e,this.file=d}a(Fy,"BasicSourceMapConsumer");Fy.prototype=Object.create(Pd.prototype);Fy.prototype.consumer=Pd;Fy.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=jn.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r1&&(y.source=l+_[1],l+=_[1],y.originalLine=s+_[2],s=y.originalLine,y.originalLine+=1,y.originalColumn=c+_[3],c=y.originalColumn,_.length>4&&(y.name=u+_[4],u+=_[4])),A.push(y),typeof y.originalLine=="number"&&g.push(y)}e9e(A,jn.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,e9e(g,jn.compareByOriginalPositions),this.__originalMappings=g},"SourceMapConsumer_parseMappings");Fy.prototype._findMapping=a(function(e,r,n,o,s,c){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[o]);return lqr.search(e,r,s,c)},"SourceMapConsumer_findMapping");Fy.prototype.computeColumnSpans=a(function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var s=jn.getArg(o,"source",null);s!==null&&(s=this._sources.at(s),s=jn.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var c=jn.getArg(o,"name",null);return c!==null&&(c=this._names.at(c)),{source:s,line:jn.getArg(o,"originalLine",null),column:jn.getArg(o,"originalColumn",null),name:c}}}return{source:null,line:null,column:null,name:null}},"SourceMapConsumer_originalPositionFor");Fy.prototype.hasContentsOfAllSources=a(function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1},"BasicSourceMapConsumer_hasContentsOfAllSources");Fy.prototype.sourceContentFor=a(function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var o=e;this.sourceRoot!=null&&(o=jn.relative(this.sourceRoot,o));var s;if(this.sourceRoot!=null&&(s=jn.urlParse(this.sourceRoot))){var c=o.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(c))return this.sourcesContent[this._sources.indexOf(c)];if((!s.path||s.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(r)return null;throw new Error('"'+o+'" is not in the SourceMap.')},"SourceMapConsumer_sourceContentFor");Fy.prototype.generatedPositionFor=a(function(e){var r=jn.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:jn.getArg(e,"line"),originalColumn:jn.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",jn.compareByOriginalPositions,jn.getArg(e,"bias",Pd.GREATEST_LOWER_BOUND));if(o>=0){var s=this._originalMappings[o];if(s.source===n.source)return{line:jn.getArg(s,"generatedLine",null),column:jn.getArg(s,"generatedColumn",null),lastColumn:jn.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},"SourceMapConsumer_generatedPositionFor");Kkt.BasicSourceMapConsumer=Fy;function oM(t,e){var r=t;typeof t=="string"&&(r=jn.parseSourceMapInput(t));var n=jn.getArg(r,"version"),o=jn.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new DCe,this._names=new DCe;var s={line:-1,column:0};this._sections=o.map(function(c){if(c.url)throw new Error("Support for url field in sections not implemented.");var l=jn.getArg(c,"offset"),u=jn.getArg(l,"line"),d=jn.getArg(l,"column");if(u{p();var Cal=oqr().SourceMapGenerator,Jkt=PCe(),bal=/(\r?\n)/,Sal=10,NCe="$$$isSourceNode$$$";function HI(t,e,r,n,o){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=r??null,this.name=o??null,this[NCe]=!0,n!=null&&this.add(n)}a(HI,"SourceNode");HI.fromStringWithSourceMap=a(function(e,r,n){var o=new HI,s=e.split(bal),c=0,l=a(function(){var m=A(),g=A()||"";return m+g;function A(){return c=0;r--)this.prepend(e[r]);else if(e[NCe]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this},"SourceNode_prepend");HI.prototype.walk=a(function(e){for(var r,n=0,o=this.children.length;n0){for(r=[],n=0;n{p();Zkt.SourceMapGenerator=oqr().SourceMapGenerator;Zkt.SourceMapConsumer=Glo().SourceMapConsumer;Zkt.SourceNode=Vlo().SourceNode});var Ylo=I((k_m,zlo)=>{p();var Tal=Object.prototype.toString,uqr=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function Ial(t){return Tal.call(t).slice(8,-1)==="ArrayBuffer"}a(Ial,"isArrayBuffer");function xal(t,e,r){e>>>=0;var n=t.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(r===void 0)r=n;else if(r>>>=0,r>n)throw new RangeError("'length' is out of bounds");return uqr?Buffer.from(t.slice(e,e+r)):new Buffer(new Uint8Array(t.slice(e,e+r)))}a(xal,"fromArrayBuffer");function wal(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return uqr?Buffer.from(t,e):new Buffer(t,e)}a(wal,"fromString");function Ral(t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return Ial(t)?xal(t,e,r):typeof t=="string"?wal(t,e):uqr?Buffer.from(t):new Buffer(t)}a(Ral,"bufferFrom");zlo.exports=Ral});var nuo=I((xoe,hqr)=>{p();var kal=Wlo().SourceMapConsumer,dqr=require("path"),nB;try{nB=require("fs"),(!nB.existsSync||!nB.readFileSync)&&(nB=null)}catch{}var Pal=Ylo();function Klo(t,e){return t.require(e)}a(Klo,"dynamicRequire");var Jlo=!1,Zlo=!1,fqr=!1,t9e="auto",Ioe={},r9e={},Dal=/^data:application\/json[^,]+base64,/,MW=[],OW=[];function mqr(){return t9e==="browser"?!0:t9e==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}a(mqr,"isInBrowser");function Nal(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}a(Nal,"hasGlobalProcessEventEmitter");function Mal(){return typeof process=="object"&&process!==null?process.version:""}a(Mal,"globalProcessVersion");function Oal(){if(typeof process=="object"&&process!==null)return process.stderr}a(Oal,"globalProcessStderr");function Lal(t){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(t)}a(Lal,"globalProcessExit");function Xkt(t){return function(e){for(var r=0;r";var r=this.getLineNumber();if(r!=null){e+=":"+r;var n=this.getColumnNumber();n&&(e+=":"+n)}}var o="",s=this.getFunctionName(),c=!0,l=this.isConstructor(),u=!(this.isToplevel()||l);if(u){var d=this.getTypeName();d==="[object Object]"&&(d="null");var f=this.getMethodName();s?(d&&s.indexOf(d)!=0&&(o+=d+"."),o+=s,f&&s.indexOf("."+f)!=s.length-f.length-1&&(o+=" [as "+f+"]")):o+=d+"."+(f||"")}else l?o+="new "+(s||""):s?o+=s:(o+=e,c=!1);return c&&(o+=" ("+e+")"),o}a(Fal,"CallSiteToString");function Xlo(t){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(function(r){e[r]=/^(?:is|get)/.test(r)?function(){return t[r].call(t)}:t[r]}),e.toString=Fal,e}a(Xlo,"cloneCallSite");function tuo(t,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),t.isNative())return e.curPosition=null,t;var r=t.getFileName()||t.getScriptNameOrSourceURL();if(r){var n=t.getLineNumber(),o=t.getColumnNumber()-1,s=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,c=s.test(Mal())?0:62;n===1&&o>c&&!mqr()&&!t.isEval()&&(o-=c);var l=yqr({source:r,line:n,column:o});e.curPosition=l,t=Xlo(t);var u=t.getFunctionName;return t.getFunctionName=function(){return e.nextPosition==null?u():e.nextPosition.name||u()},t.getFileName=function(){return l.source},t.getLineNumber=function(){return l.line},t.getColumnNumber=function(){return l.column+1},t.getScriptNameOrSourceURL=function(){return l.source},t}var d=t.isEval()&&t.getEvalOrigin();return d&&(d=euo(d),t=Xlo(t),t.getEvalOrigin=function(){return d}),t}a(tuo,"wrapCallSite");function Ual(t,e){fqr&&(Ioe={},r9e={});for(var r=t.name||"Error",n=t.message||"",o=r+": "+n,s={nextPosition:null,curPosition:null},c=[],l=e.length-1;l>=0;l--)c.push(` + at `+tuo(e[l],s)),s.nextPosition=s.curPosition;return s.curPosition=s.nextPosition=null,o+c.reverse().join("")}a(Ual,"prepareStackTrace");function ruo(t){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(e){var r=e[1],n=+e[2],o=+e[3],s=Ioe[r];if(!s&&nB&&nB.existsSync(r))try{s=nB.readFileSync(r,"utf8")}catch{s=""}if(s){var c=s.split(/(?:\r\n|\r|\n)/)[n-1];if(c)return r+":"+n+` `+c+` -`+new Array(o).join(" ")+"^"}}return null}a(Yao,"getErrorSource");function Nil(t){var e=Yao(t),r=wil();r&&r._handle&&r._handle.setBlocking&&r._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(t.stack),Ril(1)}a(Nil,"printErrorAndExit");function Mil(){var t=process.emit;process.emit=function(e){if(e==="uncaughtException"){var r=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(r&&!n)return Nil(arguments[1])}return t.apply(this,arguments)}}a(Mil,"shimEmitUncaughtException");var Oil=CW.slice(0),Lil=bW.slice(0);Aoe.wrapCallSite=zao;Aoe.getErrorSource=Yao;Aoe.mapSourcePosition=uQr;Aoe.retrieveSourceMap=lQr;Aoe.install=function(t){if(t=t||{},t.environment&&(R6e=t.environment,["node","browser","auto"].indexOf(R6e)===-1))throw new Error("environment "+R6e+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(CW.length=0),CW.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(bW.length=0),bW.unshift(t.retrieveSourceMap)),t.hookRequire&&!aQr()){var e=Hao(sQr,"module"),r=e.prototype._compile;r.__sourceMapSupport||(e.prototype._compile=function(s,c){return goe[c]=s,k6e[c]=void 0,r.call(this,s,c)},e.prototype._compile.__sourceMapSupport=!0)}if(iQr||(iQr="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:!1),Gao||(Gao=!0,Error.prepareStackTrace=Dil),!$ao){var n="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:!0;try{var o=Hao(sQr,"worker_threads");o.isMainThread===!1&&(n=!1)}catch{}n&&Iil()&&($ao=!0,Mil())}};Aoe.resetRetrieveHandlers=function(){CW.length=0,bW.length=0,CW=Oil.slice(0),bW=Lil.slice(0),lQr=wkt(bW),cQr=wkt(CW)}});var Jao=I(()=>{p();Kao().install()});var Uil={};ki(Uil,{getTokenizer:()=>ws,getTokenizerAsync:()=>hQ,main:()=>Xao});module.exports=ba(Uil);p();p();p();var mQr="auth.db",oco=["PRAGMA busy_timeout = 5000","PRAGMA synchronous = normal","PRAGMA optimize = 0x10002","PRAGMA foreign_keys = ON"],sco=` +`+new Array(o).join(" ")+"^"}}return null}a(ruo,"getErrorSource");function Qal(t){var e=ruo(t),r=Oal();r&&r._handle&&r._handle.setBlocking&&r._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(t.stack),Lal(1)}a(Qal,"printErrorAndExit");function qal(){var t=process.emit;process.emit=function(e){if(e==="uncaughtException"){var r=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(r&&!n)return Qal(arguments[1])}return t.apply(this,arguments)}}a(qal,"shimEmitUncaughtException");var jal=MW.slice(0),Hal=OW.slice(0);xoe.wrapCallSite=tuo;xoe.getErrorSource=ruo;xoe.mapSourcePosition=yqr;xoe.retrieveSourceMap=Aqr;xoe.install=function(t){if(t=t||{},t.environment&&(t9e=t.environment,["node","browser","auto"].indexOf(t9e)===-1))throw new Error("environment "+t9e+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(MW.length=0),MW.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(OW.length=0),OW.unshift(t.retrieveSourceMap)),t.hookRequire&&!mqr()){var e=Klo(hqr,"module"),r=e.prototype._compile;r.__sourceMapSupport||(e.prototype._compile=function(s,c){return Ioe[c]=s,r9e[c]=void 0,r.call(this,s,c)},e.prototype._compile.__sourceMapSupport=!0)}if(fqr||(fqr="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:!1),Jlo||(Jlo=!0,Error.prepareStackTrace=Ual),!Zlo){var n="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:!0;try{var o=Klo(hqr,"worker_threads");o.isMainThread===!1&&(n=!1)}catch{}n&&Nal()&&(Zlo=!0,qal())}};xoe.resetRetrieveHandlers=function(){MW.length=0,OW.length=0,MW=jal.slice(0),OW=Hal.slice(0),Aqr=Xkt(OW),gqr=Xkt(MW)}});var iuo=I(()=>{p();nuo().install()});var Val={};Ri(Val,{getTokenizer:()=>ws,getTokenizerAsync:()=>SQ,main:()=>suo});module.exports=Qa(Val);p();p();p();var bqr="auth.db",fuo=["PRAGMA busy_timeout = 5000","PRAGMA synchronous = normal","PRAGMA optimize = 0x10002","PRAGMA foreign_keys = ON"],puo=` CREATE TABLE IF NOT EXISTS oauth_tokens ( token_id INTEGER PRIMARY KEY AUTOINCREMENT, auth_authority TEXT NOT NULL, @@ -1638,83 +1638,83 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. last_used_at INTEGER NOT NULL, UNIQUE(auth_authority, oauth_client_id, user_login) ) -`,aco=` +`,huo=` CREATE TABLE IF NOT EXISTS active_sessions ( editor_id TEXT PRIMARY KEY, token_id INTEGER NOT NULL REFERENCES oauth_tokens(token_id) ON DELETE CASCADE, activated_at INTEGER NOT NULL ) -`,cco=` +`,muo=` CREATE TABLE IF NOT EXISTS editor_signout ( editor_id TEXT PRIMARY KEY, signed_out_at INTEGER NOT NULL ) -`,lco=` +`,guo=` CREATE TABLE IF NOT EXISTS metadata ( key TEXT PRIMARY KEY, value TEXT NOT NULL ) -`,uco=[sco,aco,cco,lco];function Pkt(t){for(let e of oco)t.exec(e);return dco(t),t}a(Pkt,"applyPragmas");function dco(t){let r=t.prepare("PRAGMA journal_mode").get()?.journal_mode;(typeof r=="string"?r.toLowerCase():void 0)!=="wal"&&t.exec("PRAGMA journal_mode = WAL")}a(dco,"ensureWalMode");function Dkt(t){for(let e of uco)t.exec(e);return t}a(Dkt,"applySchema");function tU(t,e){t.exec("BEGIN IMMEDIATE");try{let r=e();return t.exec("COMMIT"),r}catch(r){try{t.exec("ROLLBACK")}catch{}throw r}}a(tU,"runInWriteTx");p();p();p();var Nkt="github.copilot",gQr="github-enterprise";p();var Ls=a((t,e)=>({editorId:t,displayName:e}),"id"),fco=Ls("unknown","Unknown"),AQr=Ls("eclipse","Eclipse"),yQr=Ls("xcode","Xcode"),rU=Ls("vim","Vim/Neovim"),EQr=Ls("helix","Helix"),pco={"copilot-eclipse":AQr,Copilot4Eclipse:AQr,"copilot-xcode":yQr,"Copilot for Xcode":yQr,"copilot-vs":Ls("visual-studio","Visual Studio"),"copilot.vim":rU,"copilot.lua":rU,"Github Copilot LSP for Neovim":rU,"coc-github-copilot":rU,"nvim-lspconfig":rU,"copilot-lsp-client-neovim":rU,"neovim-copilot-lsp":rU,"sidekick.nvim":rU,"helix-copilot":EQr,"copilot-helix":EQr,"copilot-sublime":Ls("sublime-text","Sublime Text"),"zed-copilot":Ls("zed","Zed"),RStudio:Ls("rstudio","RStudio"),"obsidian-copilot":Ls("obsidian","Obsidian"),marimo:Ls("marimo","marimo"),"Qt Creator Copilot plugin":Ls("qt-creator","Qt Creator"),"godot-copilot":Ls("godot","Godot"),"kakoune-lsp":Ls("kakoune","Kakoune"),"typora-copilot":Ls("typora","Typora"),"Copilot for Nova":Ls("nova","Nova")},hco={IU:Ls("intellij","IntelliJ IDEA"),IC:Ls("intellij","IntelliJ IDEA"),IE:Ls("intellij","IntelliJ IDEA"),PY:Ls("pycharm","PyCharm"),PC:Ls("pycharm","PyCharm"),PE:Ls("pycharm","PyCharm"),WS:Ls("webstorm","WebStorm"),PS:Ls("phpstorm","PhpStorm"),RD:Ls("rider","Rider"),RM:Ls("rubymine","RubyMine"),CL:Ls("clion","CLion"),GO:Ls("goland","GoLand"),RR:Ls("rustrover","RustRover"),DB:Ls("datagrip","DataGrip"),DS:Ls("dataspell","DataSpell"),AI:Ls("android-studio","Android Studio"),QA:Ls("aqua","Aqua"),MPS:Ls("mps","MPS"),JBC:Ls("jetbrains-client","JetBrains Client"),GW:Ls("jetbrains-gateway","JetBrains Gateway")},_Qr="JetBrains-",mco=Ls("jetbrains","JetBrains IDE");function vQr(t){let e=t.plugin.name?.trim();if(!e)return fco;if(e==="copilot-intellij"){let r=t.editor.name??"";if(r.startsWith(_Qr)){let n=hco[r.slice(_Qr.length)];if(n)return n}return mco}return pco[e]??Ls(e,e)}a(vQr,"resolveEditorIdentity");p();p();p();p();var P6e=class{constructor(e){this.userInfo=e}static{a(this,"CopilotUserInfoWrapper")}get sku(){return this.userInfo?.access_type_sku}get isFreeUser(){return this.sku==="free_limited_copilot"}get isIndividualUser(){return this.copilotPlan==="free"||this.copilotPlan==="individual"||this.copilotPlan==="individual_pro"||this.copilotPlan==="individual_max"}get isTBBEnabled(){return this.userInfo?.token_based_billing===!0}get copilotPlan(){if(this.isFreeUser)return"free";let e=this.userInfo?.copilot_plan;switch(e){case"individual":case"individual_pro":case"individual_max":case"business":case"enterprise":return e;default:return"individual"}}get canUpgradePlan(){return this.userInfo?.can_upgrade_plan===!0}get quotaInfo(){return{quota_snapshots:this.userInfo?.quota_snapshots,quota_reset_date:this.userInfo?.quota_reset_date}}get cliEnabled(){return this.userInfo?.cli_enabled}get raw(){return this.userInfo}};p();function Mkt(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(Mkt,"findKnownOrg");function CQr(t){let e=t.organization_list??[];return Mkt(e)??""}a(CQr,"getUserKind");p();var qf=class{static{a(this,"LogTarget")}},ZL=class{static{a(this,"TelemetryLogSender")}},fe=class{constructor(e){this.category=e}static{a(this,"Logger")}log(e,r,...n){e.get(qf).logIt(e,r,this.category,...n)}debug(e,...r){this.log(e,4,...r)}info(e,...r){this.log(e,3,...r)}warn(e,...r){this.log(e,2,...r)}error(e,...r){this.log(e,1,...r)}exception(e,r,n){if(r instanceof Error&&r.name==="Canceled"&&r.message==="Canceled")return;let o=n;n.startsWith(".")&&(o=n.substring(1),n=`${this.category}${n}`),e.get(ZL).sendException(e,r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e,1,`${o}:`,s)}},Nr=new fe("default");p();p();p();p();async function Juo(){let{getDeviceId:t}=await Promise.resolve().then(()=>de(eHr()));return t()}a(Juo,"loadDeviceId");var UI=class{constructor(e=Juo){this.resolvedId="";this.deviceIdPromise=(async()=>e())().catch(()=>"").then(r=>this.resolvedId=r)}static{a(this,"DevDeviceIdManager")}async getId(){return this.deviceIdPromise}getIdSync(){return this.resolvedId}};p();p();p();var kk=class{static{a(this,"InlineCompletionsUnification")}},Zuo={codeUnification:!1,modelUnification:!1,expAssignments:[]},boe=class extends kk{constructor(){super(...arguments);this.inlineCompletionsUnificationState=Zuo;this.onDidChangeState=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeState")}static{a(this,"NullInlineCompletionsUnification")}};var nC=class t{static{a(this,"ExpConfig")}constructor(e,r,n){this.variables=e,this.assignmentContext=r,this.features=n}static createFallbackConfig(e,r){return K6e(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"","")}addToTelemetry(e,r){let o=e.get(kk).inlineCompletionsUnificationState.expAssignments.filter(c=>!this.assignmentContext.includes(c)),s=[this.assignmentContext,...o].filter(Boolean).join(";");r.properties["VSCode.ABExp.Features"]=this.features,r.properties["abexp.assignmentcontext"]=s}};p();var E_="X-Copilot-RelatedPluginVersion-",Soe=(z=>(z.Market="X-MSEdge-Market",z.CorpNet="X-FD-Corpnet",z.Build="X-VSCode-Build",z.ApplicationVersion="X-VSCode-AppVersion",z.TargetPopulation="X-VSCode-TargetPopulation",z.ClientId="X-MSEdge-ClientId",z.DevDeviceId="X-VSCode-DevDeviceId",z.ExtensionName="X-VSCode-ExtensionName",z.ExtensionVersion="X-VSCode-ExtensionVersion",z.ExtensionRelease="X-VSCode-ExtensionRelease",z.CompletionsInChatExtensionVersion="X-VSCode-CompletionsInChatExtensionVersion",z.Language="X-VSCode-Language",z.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",z.CopilotEngine="X-Copilot-Engine",z.CopilotOverrideEngine="X-Copilot-OverrideEngine",z.CopilotRepository="X-Copilot-Repository",z.CopilotFileType="X-Copilot-FileType",z.CopilotUserKind="X-Copilot-UserKind",z.CopilotDogfood="X-Copilot-Dogfood",z.CopilotOrgs="X-Copilot-Orgs",z.CopilotTrackingId="X-Copilot-CopilotTrackingId",z.CopilotClientVersion="X-Copilot-ClientVersion",z.CopilotSku="X-GitHub-Copilot-SKU",z.CopilotIsFcv1="X-GitHub-Copilot-IsFcv1",z.CopilotIsSn="X-GitHub-Copilot-IsSn",z.CopilotRelatedPluginVersionCppTools=E_+"msvscodecpptools",z.CopilotRelatedPluginVersionCMakeTools=E_+"msvscodecmaketools",z.CopilotRelatedPluginVersionMakefileTools=E_+"msvscodemakefiletools",z.CopilotRelatedPluginVersionCSharpDevKit=E_+"msdotnettoolscsdevkit",z.CopilotRelatedPluginVersionPython=E_+"mspythonpython",z.CopilotRelatedPluginVersionPylance=E_+"mspythonvscodepylance",z.CopilotRelatedPluginVersionJavaPack=E_+"vscjavavscodejavapack",z.CopilotRelatedPluginVersionJavaManager=E_+"vscjavavscodejavadependency",z.CopilotRelatedPluginVersionTypescript=E_+"vscodetypescriptlanguagefeatures",z.CopilotRelatedPluginVersionTypescriptNext=E_+"msvscodevscodetypescriptnext",z.CopilotRelatedPluginVersionCSharp=E_+"msdotnettoolscsharp",z.CopilotRelatedPluginVersionGithubCopilotChat=E_+"githubcopilotchat",z.CopilotRelatedPluginVersionGithubCopilot=E_+"githubcopilot",z))(Soe||{});var Xuo={"X-Copilot-ClientTimeBucket":"timeBucket","X-Copilot-OverrideEngine":"engine","X-Copilot-Repository":"repo","X-Copilot-FileType":"fileType","X-Copilot-UserKind":"userKind"},iB=class t{constructor(e){this.filters=e;for(let[r,n]of Object.entries(this.filters))n===""&&delete this.filters[r]}static{a(this,"FilterSettings")}extends(e){for(let[r,n]of Object.entries(e.filters))if(this.filters[r]!==n)return!1;return!0}addToTelemetry(e){for(let[r,n]of Object.entries(this.filters)){let o=Xuo[r];o!==void 0&&(e.properties[o]=n)}}stringify(){let e=Object.keys(this.filters);return e.sort(),e.map(r=>`${r}:${this.filters[r]}`).join(";")}toHeaders(){return{...this.filters}}withChange(e,r){return new t({...this.filters,[e]:r})}};p();p();p();function bs(t,e){let r=z0(t,e,"event.CopilotToken");return t.get(Qt).onDidChangeTokenResult(n=>{n.copilotToken&&r(n.copilotToken)})}a(bs,"onCopilotToken");function oPt(t){let e=t.getTokenValue("tid"),r=t.organization_list,n=t.enterprise_list,o=t.getTokenValue("sku");if(!e)return;let s={copilot_trackingId:e};return r&&(s.organizations_list=r.toString()),n&&(s.enterprise_list=n.toString()),o&&(s.sku=o),s}a(oPt,"propertiesFromCopilotToken");var Op=class{constructor(e){this.#e={};this.optedIn=!1;bs(e,r=>this.updateFromToken(r))}static{a(this,"TelemetryUserConfig")}#e;getProperties(){return this.#e}get trackingId(){return this.#e.copilot_trackingId}updateFromToken(e){let r=oPt(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1")}};var O9e=de(dU()),L9e=de(require("os"));var edo=/^(\s+at)?(.*?)(@|\s\(|\s)([^(\n]+?)(:\d+)?(:\d+)?(\)?)$/;function tdo(t){let e={type:t.name,value:t.message},r=t.stack?.replace(/^.*?:\d+\n.*\n *\^?\n\n/,"");if(r?.startsWith(t.toString()+` -`)){e.stacktrace=[];for(let n of r.slice(t.toString().length+1).split(/\n/).reverse()){let o=n.match(edo),s={filename:"",function:""};o&&(s.function=o[2]?.trim()?.replace(/^[^.]{1,2}(\.|$)/,"_$1")??s.function,s.filename=(o[4]?.trim()??s.filename).replace(/^\.\/dist\//,"/github-copilot/dist/"),o[5]&&o[5]!==":0"&&(s.lineno=o[5].slice(1)),o[6]&&o[5]!==":0"&&(s.colno=o[6].slice(1)),s.in_app=!/[[<:]|(?:^|\/)node_modules\//.test(s.filename)),e.stacktrace.push(s)}}return e}a(tdo,"buildExceptionDetail");function cPt(t,e){let r=t.get(Ir),n=r.getEditorInfo(),o=t.get(Op),s={"#editor":n.devName??n.name,"#editor_version":M1({name:n.devName??n.name,version:n.version}),"#plugin":r.getEditorPluginInfo().name,"#plugin_version":M1(r.getEditorPluginInfo()),"#session_id":t.get(Ua).sessionId,"#machine_id":t.get(Ua).machineId,"#architecture":L9e.arch(),"#os_platform":L9e.platform(),...e};return o.trackingId&&(s.user=o.trackingId,s["#tracking_id"]=o.trackingId),s}a(cPt,"buildContext");function cGr(t,e,r){let n=t.get(ds),o=t.get(Ir).getEditorInfo(),s=typeof process<"u"?process.versions.node:"web",c={app:"copilot-client",rollup_id:"auto",platform:"node",release:n.getBuildType()!=="dev"?`copilot-client@${n.getVersion()}`:void 0,deployed_to:n.getBuildType(),catalog_service:o.name==="vscode"?"CopilotCompletionsVSCode":"CopilotLanguageServer",transaction:r,context:cPt(t,{"#node_version":s}),sensitive_context:{}},l=[];c.exception_detail=[];let u=0,d=e;for(;d instanceof Error&&u<10;){let h=tdo(d);c.exception_detail.unshift(h),l.unshift([d,h]),u+=1,d=d.cause}let f=[];for(let[h,m]of l)if(m.stacktrace&&m.stacktrace.length>0){f.push(`${m.type}: ${h.code??""}`);let g=[...m.stacktrace].reverse();for(let y of g)if(y.filename?.startsWith("/github-copilot/"))return c;let A=!1;for(let y of g)if(y.in_app){A=!0,f.push(`${y.filename?.replace(/^\.\//,"")}:${y.lineno}:${y.colno}`);break}A||f.push(r),f.push(`${g[0].filename?.replace(/^\.\//,"")}`)}else return c;return c.exception_detail.length>0&&(c.rollup_id=(0,O9e.SHA256)(O9e.enc.Utf16.parse(f.join(` -`))).toString()),c}a(cGr,"buildPayload");p();var B9e=class{static{a(this,"FailingTelemetryReporter")}sendTelemetryEvent(e,r,n){throw new Error("Telemetry disabled")}sendTelemetryErrorEvent(e,r,n,o){throw new Error("Telemetry disabled")}dispose(){return Promise.resolve()}hackOptOutListener(){}};p();p();var uGr=de(dU());var Cn=class{constructor(e=10){this.valueMap=new Map;if(e<1)throw new Error("Size limit must be at least 1");this.sizeLimit=e}static{a(this,"LRUCacheMap")}set(e,r){if(this.has(e))this.valueMap.delete(e);else if(this.valueMap.size>=this.sizeLimit){let n=this.valueMap.keys().next().value;this.delete(n)}return this.valueMap.set(e,r),this}get(e){if(this.valueMap.has(e)){let r=this.valueMap.get(e);return this.valueMap.delete(e),this.valueMap.set(e,r),r}}delete(e){return this.valueMap.delete(e)}clear(){this.valueMap.clear()}get size(){return this.valueMap.size}keys(){return new Map(this.valueMap).keys()}values(){return new Map(this.valueMap).values()}entries(){return new Map(this.valueMap).entries()}[Symbol.iterator](){return this.entries()}has(e){return this.valueMap.has(e)}forEach(e,r){new Map(this.valueMap).forEach(e,r)}get[Symbol.toStringTag](){return"LRUCacheMap"}peek(e){return this.valueMap.get(e)}},Pk=class extends Cn{constructor(r,n=120*1e3){super(r);this.defaultTtl=n;this.expiration=new Map}static{a(this,"LRUExpirationCacheMap")}has(r){let n=!1,o=this.expiration.get(r);return o!==void 0&&(o>performance.now()&&(n=super.has(r)),n||this.delete(r)),n}get(r){let n=this.expiration.get(r);if(n!==void 0){if(n>performance.now())return super.get(r);this.delete(r)}}peek(r){let n=this.expiration.get(r);if(n!==void 0){if(n>performance.now())return super.peek(r);this.delete(r)}}set(r,n,o=this.defaultTtl){if(o<=0)throw new Error("TTL must be greater than 0");let s=super.set(r,n);return this.expiration.set(r,performance.now()+o),s}clear(){super.clear(),this.expiration.clear()}delete(r){return this.expiration.delete(r),super.delete(r)}get[Symbol.toStringTag](){return"LRUExpirationCacheMap"}},F9e=class extends Cn{static{a(this,"LRUDisposableCacheMap")}delete(e){let r=this.peek(e);return r&&r.dispose(),super.delete(e)}clear(){for(let e of this.values())e.dispose();super.clear()}uncache(e){let r=this.peek(e);return super.delete(e),r}dispose(){this.clear()}};var dGr=7*86400*1e3,XN=class{constructor(e=5){this.perWeek=e;this.cache=new Cn(1e3)}static{a(this,"ExceptionRateLimiter")}isThrottled(e){let r=Date.now(),n=this.cache.get(e)||new Array(this.perWeek).fill(-dGr);return r-n[0]t?.length>0&&t!==".").map(t=>t.includes("\\")?new RegExp(fGr(t.replace(/\\/g,"/")),"gi"):new RegExp(fGr(t),"gi"));function ndo(t,e){if(!t||!t.includes("/")&&!t.includes("\\"))return t;let r=t,n=[];for(let l of e)for(;;){let u=l.exec(t);if(!u)break;n.push([u.index,l.lastIndex])}let o=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,s=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g,c=0;for(r="";;){let l=s.exec(t);if(!l)break;let u=n.some(([d,f])=>l.index",c=s.lastIndex)}return c`;return t}a(ido,"removePropertiesWithPossibleUserInfo");function odo(t){return t.replace(/([\s|(]|file:\/\/)(\/[^\s]+)/g,"$1[redacted]").replace(/([\s|(]|file:\/\/)([a-zA-Z]:[(\\|/){1,2}][^\s]+)/gi,"$1[redacted]").replace(/([\s|(]|file:\/\/)(\\[^\s]+)/gi,"$1[redacted]")}a(odo,"redactPaths");function hGr(t,e=rdo){let r={};for(let[n,o]of Object.entries(t))if(typeof o=="string"){let s=o.replaceAll("%20"," "),c=ido(s);if(c!==s){r[n]=c;continue}s=ndo(s,e);for(let l of e)s=s.replace(l,"");s=odo(s),r[n]=s}return r}a(hGr,"sanitizeTelemetryProperties");function fU(t,e=Object.keys(t)){let r={};for(let n of e)t[n]!==void 0&&(r[n]=t[n]);return r}a(fU,"filterTelemetryProperties");p();var QI=class t{constructor(e){this.flags=e}static{a(this,"RuntimeMode")}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:gGr(r,n),verboseLogging:ado(r,n),testMode:e,simulation:sdo(n)})}};function O1(t){return t.get(QI).flags.testMode}a(O1,"isRunningInTest");function RCe(t){return O1(t)}a(RCe,"shouldFailForDebugPurposes");function kCe(t){return t.get(QI).flags.debug}a(kCe,"isDebugEnabled");function mGr(t){return t.get(QI).flags.verboseLogging}a(mGr,"isVerboseLoggingEnabled");function gGr(t,e){return t.includes("--debug")||uPt(e,"DEBUG")}a(gGr,"determineDebugFlag");function sdo(t){return uPt(t,"SIMULATION")}a(sdo,"determineSimulationFlag");function Q9e(t){return t.get(QI).flags.simulation}a(Q9e,"isRunningInSimulation");function ado(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||uPt(e,"VERBOSE")||gGr(t,e)}a(ado,"determineVerboseLoggingEnabled");function uPt(t,e){for(let r of["GH_COPILOT_","GITHUB_COPILOT_"]){let n=t[`${r}${e}`];if(n)return n==="1"||n?.toLowerCase()==="true"}return!1}a(uPt,"determineEnvFlagEnabled");p();var xd=class{constructor(){this.promises=new Set}static{a(this,"PromiseQueue")}register(e){this.promises.add(e),e.finally(()=>this.promises.delete(e))}async flush(){await Promise.allSettled(this.promises)}};p();var EGr=require("os"),_Gr=de(require("path"));function PCe(t){return t.replace(/(file:\/\/)([^\s<>]+)/gi,"$1[redacted]").replace(/(^|[\s|:=(<'"`])((?:\/(?=[^/])|\\|[a-zA-Z]:[\\/])[^\s:)>'"`]+)/g,"$1[redacted]")}a(PCe,"redactPaths");var cdo=new Set(["Maximum call stack size exceeded","Set maximum size exceeded","Invalid arguments"]),ldo=[/^[\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}.]+ is not a function[ \w]*$/u,/^Cannot read properties of undefined \(reading '[\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}]+'\)$/u];function fPt(t){if(cdo.has(t))return t;for(let e of ldo)if(e.test(t))return t;return PCe(t).replace(/\bDNS:(?:\*\.)?[\w.-]+/gi,"DNS:[redacted]")}a(fPt,"redactMessage");function Toe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Toe,"escapeForRegExp");var udo=new RegExp("(?<=^|[\\s|(\"'`]|file://)"+Toe((0,EGr.homedir)())+"(?=$|[\\\\/:\"'`])","gi");function dPt(t){return t.replace(udo,"~")}a(dPt,"redactHomeDir");var vGr="[\\\\/]?([^:)]*)(?=:\\d)",AGr=new RegExp(Toe(_Gr.sep),"g"),yGr=new RegExp(Toe(__dirname.replace(/[\\/]lib[\\/]src[\\/]util$|[\\/]dist$/,""))+vGr,"gi");function pPt(t,e,r=!1,n=[]){let o=new Error(e(t));o.name=t.name,typeof t.syscall=="string"&&(o.syscall=t.syscall),typeof t.code=="string"&&(o.code=t.code),typeof t.errno=="number"&&(o.errno=t.errno),o.stack=void 0;let s=t.stack?.replace(/^.*?:\d+\n.*\n *\^?\n\n/,""),c;for(let l of[t.toString(),`${t.name}: ${t.message}`])if(s?.startsWith(l+` -`)){c=s.slice(l.length+1).split(/\n/);break}if(c){o.stack=o.toString();for(let l of c)if(yGr.test(l))o.stack+=` -${PCe(l.replace(yGr,(u,d)=>"./"+d.replace(AGr,"/")))}`;else if(/[ (]node:|[ (]wasm:\/\/wasm\/| \(\)$/.test(l))o.stack+=` -${PCe(l)}`;else{let u=!1;for(let{prefix:d,path:f}of n){let h=new RegExp(Toe(f.replace(/[\\/]$/,""))+vGr,"gi");if(h.test(l)){o.stack+=` -${PCe(l.replace(h,(m,g)=>d+g.replace(AGr,"/")))}`,u=!0;break}}if(u)continue;r?o.stack+=` -${dPt(l)}`:o.stack+=` - at [redacted]:0:0`}}else r&&s&&(o.stack=dPt(s));return t.cause instanceof Error&&(o.cause=pPt(t.cause,e,r,n)),o}a(pPt,"cloneError");function CGr(t){let e=t.message;return typeof t.path=="string"&&t.path.length>0&&(e=e.replaceAll(t.path,"")),e}a(CGr,"errorMessageWithoutPath");function bGr(t,e){return pPt(t,a(function(n){return dPt(CGr(n))},"prepareMessage"),!0,e)}a(bGr,"prepareErrorForRestrictedTelemetry");function SGr(t,e,r=!1){return pPt(t,a(function(o){if(r)return fPt(CGr(o));let s="[redacted]";return typeof o.code=="string"&&(s=o.code+" "+s),typeof o.syscall=="string"?s=PCe(o.syscall)+" "+s:"erroredSysCall"in o&&typeof o.erroredSysCall=="string"&&(s=o.erroredSysCall+" "+s),s},"prepareMessage"),!1,e)}a(SGr,"redactError");p();p();var Ly={};ki(Ly,{HasPropertyKey:()=>q9e,IsArray:()=>Lp,IsAsyncIterator:()=>hPt,IsBigInt:()=>DCe,IsBoolean:()=>sB,IsDate:()=>xW,IsFunction:()=>mPt,IsIterator:()=>gPt,IsNull:()=>APt,IsNumber:()=>L1,IsObject:()=>Yc,IsRegExp:()=>NCe,IsString:()=>Ql,IsSymbol:()=>yPt,IsUint8Array:()=>aB,IsUndefined:()=>Bp});p();function q9e(t,e){return e in t}a(q9e,"HasPropertyKey");function hPt(t){return Yc(t)&&!Lp(t)&&!aB(t)&&Symbol.asyncIterator in t}a(hPt,"IsAsyncIterator");function Lp(t){return Array.isArray(t)}a(Lp,"IsArray");function DCe(t){return typeof t=="bigint"}a(DCe,"IsBigInt");function sB(t){return typeof t=="boolean"}a(sB,"IsBoolean");function xW(t){return t instanceof globalThis.Date}a(xW,"IsDate");function mPt(t){return typeof t=="function"}a(mPt,"IsFunction");function gPt(t){return Yc(t)&&!Lp(t)&&!aB(t)&&Symbol.iterator in t}a(gPt,"IsIterator");function APt(t){return t===null}a(APt,"IsNull");function L1(t){return typeof t=="number"}a(L1,"IsNumber");function Yc(t){return typeof t=="object"&&t!==null}a(Yc,"IsObject");function NCe(t){return t instanceof globalThis.RegExp}a(NCe,"IsRegExp");function Ql(t){return typeof t=="string"}a(Ql,"IsString");function yPt(t){return typeof t=="symbol"}a(yPt,"IsSymbol");function aB(t){return t instanceof globalThis.Uint8Array}a(aB,"IsUint8Array");function Bp(t){return t===void 0}a(Bp,"IsUndefined");function ddo(t){return t.map(e=>j9e(e))}a(ddo,"ArrayType");function fdo(t){return new Date(t.getTime())}a(fdo,"DateType");function pdo(t){return new Uint8Array(t)}a(pdo,"Uint8ArrayType");function hdo(t){return new RegExp(t.source,t.flags)}a(hdo,"RegExpType");function mdo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=j9e(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=j9e(t[r]);return e}a(mdo,"ObjectType");function j9e(t){return Lp(t)?ddo(t):xW(t)?fdo(t):aB(t)?pdo(t):NCe(t)?hdo(t):Yc(t)?mdo(t):t}a(j9e,"Visit");function Bu(t){return j9e(t)}a(Bu,"Clone");function Ioe(t,e){return e===void 0?Bu(t):Bu({...e,...t})}a(Ioe,"CloneType");p();p();p();function H9e(t){return bo(t)&&globalThis.Symbol.asyncIterator in t}a(H9e,"IsAsyncIterator");function G9e(t){return bo(t)&&globalThis.Symbol.iterator in t}a(G9e,"IsIterator");function EPt(t){return bo(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(EPt,"IsStandardObject");function $9e(t){return t instanceof globalThis.Promise}a($9e,"IsPromise");function __(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(__,"IsDate");function TGr(t){return t instanceof globalThis.Map}a(TGr,"IsMap");function IGr(t){return t instanceof globalThis.Set}a(IGr,"IsSet");function qI(t){return globalThis.ArrayBuffer.isView(t)}a(qI,"IsTypedArray");function xoe(t){return t instanceof globalThis.Uint8Array}a(xoe,"IsUint8Array");function Qi(t,e){return e in t}a(Qi,"HasPropertyKey");function bo(t){return t!==null&&typeof t=="object"}a(bo,"IsObject");function Pi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(Pi,"IsArray");function Fu(t){return t===void 0}a(Fu,"IsUndefined");function cB(t){return t===null}a(cB,"IsNull");function eM(t){return typeof t=="boolean"}a(eM,"IsBoolean");function ai(t){return typeof t=="number"}a(ai,"IsNumber");function V9e(t){return globalThis.Number.isInteger(t)}a(V9e,"IsInteger");function pA(t){return typeof t=="bigint"}a(pA,"IsBigInt");function Sa(t){return typeof t=="string"}a(Sa,"IsString");function pU(t){return typeof t=="function"}a(pU,"IsFunction");function lB(t){return typeof t=="symbol"}a(lB,"IsSymbol");function B1(t){return pA(t)||eM(t)||cB(t)||ai(t)||Sa(t)||lB(t)||Fu(t)}a(B1,"IsValueType");var su;(function(t){t.InstanceMode="default",t.ExactOptionalPropertyTypes=!1,t.AllowArrayObject=!1,t.AllowNaN=!1,t.AllowNullVoid=!1;function e(c,l){return t.ExactOptionalPropertyTypes?l in c:c[l]!==void 0}a(e,"IsExactOptionalProperty"),t.IsExactOptionalProperty=e;function r(c){let l=bo(c);return t.AllowArrayObject?l:l&&!Pi(c)}a(r,"IsObjectLike"),t.IsObjectLike=r;function n(c){return r(c)&&!(c instanceof Date)&&!(c instanceof Uint8Array)}a(n,"IsRecordLike"),t.IsRecordLike=n;function o(c){return t.AllowNaN?ai(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=Fu(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(su||(su={}));p();function gdo(t){return globalThis.Object.freeze(t).map(e=>MCe(e))}a(gdo,"ImmutableArray");function Ado(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=MCe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=MCe(t[r]);return globalThis.Object.freeze(e)}a(Ado,"ImmutableObject");function MCe(t){return Lp(t)?gdo(t):xW(t)?t:aB(t)?t:NCe(t)?t:Yc(t)?Ado(t):t}a(MCe,"Immutable");function wt(t,e){let r=e!==void 0?{...e,...t}:t;switch(su.InstanceMode){case"freeze":return MCe(r);case"clone":return Bu(r);default:return r}}a(wt,"CreateType");p();var qi=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};p();p();p();var wd=Symbol.for("TypeBox.Transform"),Dk=Symbol.for("TypeBox.Readonly"),hA=Symbol.for("TypeBox.Optional"),jI=Symbol.for("TypeBox.Hint"),Tt=Symbol.for("TypeBox.Kind");function woe(t){return Yc(t)&&t[Dk]==="Readonly"}a(woe,"IsReadonly");function iC(t){return Yc(t)&&t[hA]==="Optional"}a(iC,"IsOptional");function _Pt(t){return aa(t,"Any")}a(_Pt,"IsAny");function vPt(t){return aa(t,"Argument")}a(vPt,"IsArgument");function Nk(t){return aa(t,"Array")}a(Nk,"IsArray");function wW(t){return aa(t,"AsyncIterator")}a(wW,"IsAsyncIterator");function RW(t){return aa(t,"BigInt")}a(RW,"IsBigInt");function uB(t){return aa(t,"Boolean")}a(uB,"IsBoolean");function Mk(t){return aa(t,"Computed")}a(Mk,"IsComputed");function Ok(t){return aa(t,"Constructor")}a(Ok,"IsConstructor");function ydo(t){return aa(t,"Date")}a(ydo,"IsDate");function Lk(t){return aa(t,"Function")}a(Lk,"IsFunction");function Bk(t){return aa(t,"Integer")}a(Bk,"IsInteger");function af(t){return aa(t,"Intersect")}a(af,"IsIntersect");function kW(t){return aa(t,"Iterator")}a(kW,"IsIterator");function aa(t,e){return Yc(t)&&Tt in t&&t[Tt]===e}a(aa,"IsKindOf");function W9e(t){return sB(t)||L1(t)||Ql(t)}a(W9e,"IsLiteralValue");function F1(t){return aa(t,"Literal")}a(F1,"IsLiteral");function U1(t){return aa(t,"MappedKey")}a(U1,"IsMappedKey");function Uu(t){return aa(t,"MappedResult")}a(Uu,"IsMappedResult");function hU(t){return aa(t,"Never")}a(hU,"IsNever");function Edo(t){return aa(t,"Not")}a(Edo,"IsNot");function OCe(t){return aa(t,"Null")}a(OCe,"IsNull");function Fk(t){return aa(t,"Number")}a(Fk,"IsNumber");function Fp(t){return aa(t,"Object")}a(Fp,"IsObject");function PW(t){return aa(t,"Promise")}a(PW,"IsPromise");function DW(t){return aa(t,"Record")}a(DW,"IsRecord");function jf(t){return aa(t,"Ref")}a(jf,"IsRef");function CPt(t){return aa(t,"RegExp")}a(CPt,"IsRegExp");function dB(t){return aa(t,"String")}a(dB,"IsString");function LCe(t){return aa(t,"Symbol")}a(LCe,"IsSymbol");function Q1(t){return aa(t,"TemplateLiteral")}a(Q1,"IsTemplateLiteral");function _do(t){return aa(t,"This")}a(_do,"IsThis");function ec(t){return Yc(t)&&wd in t}a(ec,"IsTransform");function q1(t){return aa(t,"Tuple")}a(q1,"IsTuple");function fB(t){return aa(t,"Undefined")}a(fB,"IsUndefined");function Ta(t){return aa(t,"Union")}a(Ta,"IsUnion");function vdo(t){return aa(t,"Uint8Array")}a(vdo,"IsUint8Array");function Cdo(t){return aa(t,"Unknown")}a(Cdo,"IsUnknown");function bdo(t){return aa(t,"Unsafe")}a(bdo,"IsUnsafe");function Sdo(t){return aa(t,"Void")}a(Sdo,"IsVoid");function mU(t){return Yc(t)&&Tt in t&&Ql(t[Tt])}a(mU,"IsKind");function Rd(t){return _Pt(t)||vPt(t)||Nk(t)||uB(t)||RW(t)||wW(t)||Mk(t)||Ok(t)||ydo(t)||Lk(t)||Bk(t)||af(t)||kW(t)||F1(t)||U1(t)||Uu(t)||hU(t)||Edo(t)||OCe(t)||Fk(t)||Fp(t)||PW(t)||DW(t)||jf(t)||CPt(t)||dB(t)||LCe(t)||Q1(t)||_do(t)||q1(t)||fB(t)||Ta(t)||vdo(t)||Cdo(t)||bdo(t)||Sdo(t)||mU(t)}a(Rd,"IsSchema");var it={};ki(it,{IsAny:()=>kGr,IsArgument:()=>PGr,IsArray:()=>DGr,IsAsyncIterator:()=>NGr,IsBigInt:()=>MGr,IsBoolean:()=>OGr,IsComputed:()=>LGr,IsConstructor:()=>BGr,IsDate:()=>FGr,IsFunction:()=>UGr,IsImport:()=>kdo,IsInteger:()=>QGr,IsIntersect:()=>qGr,IsIterator:()=>jGr,IsKind:()=>h$r,IsKindOf:()=>Bs,IsLiteral:()=>FCe,IsLiteralBoolean:()=>Pdo,IsLiteralNumber:()=>GGr,IsLiteralString:()=>HGr,IsLiteralValue:()=>$Gr,IsMappedKey:()=>VGr,IsMappedResult:()=>WGr,IsNever:()=>zGr,IsNot:()=>YGr,IsNull:()=>KGr,IsNumber:()=>JGr,IsObject:()=>ZGr,IsOptional:()=>Rdo,IsPromise:()=>XGr,IsProperties:()=>z9e,IsReadonly:()=>wdo,IsRecord:()=>e$r,IsRecursive:()=>Ddo,IsRef:()=>t$r,IsRegExp:()=>r$r,IsSchema:()=>Qu,IsString:()=>n$r,IsSymbol:()=>i$r,IsTemplateLiteral:()=>o$r,IsThis:()=>s$r,IsTransform:()=>a$r,IsTuple:()=>c$r,IsUint8Array:()=>u$r,IsUndefined:()=>l$r,IsUnion:()=>IPt,IsUnionLiteral:()=>Ndo,IsUnknown:()=>d$r,IsUnsafe:()=>f$r,IsVoid:()=>p$r,TypeGuardUnknownTypeError:()=>bPt});p();var bPt=class extends qi{static{a(this,"TypeGuardUnknownTypeError")}},Tdo=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function xGr(t){try{return new RegExp(t),!0}catch{return!1}}a(xGr,"IsPattern");function SPt(t){if(!Ql(t))return!1;for(let e=0;e=7&&r<=13||r===27||r===127)return!1}return!0}a(SPt,"IsControlCharacterFree");function wGr(t){return TPt(t)||Qu(t)}a(wGr,"IsAdditionalProperties");function BCe(t){return Bp(t)||DCe(t)}a(BCe,"IsOptionalBigInt");function ql(t){return Bp(t)||L1(t)}a(ql,"IsOptionalNumber");function TPt(t){return Bp(t)||sB(t)}a(TPt,"IsOptionalBoolean");function Kc(t){return Bp(t)||Ql(t)}a(Kc,"IsOptionalString");function Ido(t){return Bp(t)||Ql(t)&&SPt(t)&&xGr(t)}a(Ido,"IsOptionalPattern");function xdo(t){return Bp(t)||Ql(t)&&SPt(t)}a(xdo,"IsOptionalFormat");function RGr(t){return Bp(t)||Qu(t)}a(RGr,"IsOptionalSchema");function wdo(t){return Yc(t)&&t[Dk]==="Readonly"}a(wdo,"IsReadonly");function Rdo(t){return Yc(t)&&t[hA]==="Optional"}a(Rdo,"IsOptional");function kGr(t){return Bs(t,"Any")&&Kc(t.$id)}a(kGr,"IsAny");function PGr(t){return Bs(t,"Argument")&&L1(t.index)}a(PGr,"IsArgument");function DGr(t){return Bs(t,"Array")&&t.type==="array"&&Kc(t.$id)&&Qu(t.items)&&ql(t.minItems)&&ql(t.maxItems)&&TPt(t.uniqueItems)&&RGr(t.contains)&&ql(t.minContains)&&ql(t.maxContains)}a(DGr,"IsArray");function NGr(t){return Bs(t,"AsyncIterator")&&t.type==="AsyncIterator"&&Kc(t.$id)&&Qu(t.items)}a(NGr,"IsAsyncIterator");function MGr(t){return Bs(t,"BigInt")&&t.type==="bigint"&&Kc(t.$id)&&BCe(t.exclusiveMaximum)&&BCe(t.exclusiveMinimum)&&BCe(t.maximum)&&BCe(t.minimum)&&BCe(t.multipleOf)}a(MGr,"IsBigInt");function OGr(t){return Bs(t,"Boolean")&&t.type==="boolean"&&Kc(t.$id)}a(OGr,"IsBoolean");function LGr(t){return Bs(t,"Computed")&&Ql(t.target)&&Lp(t.parameters)&&t.parameters.every(e=>Qu(e))}a(LGr,"IsComputed");function BGr(t){return Bs(t,"Constructor")&&t.type==="Constructor"&&Kc(t.$id)&&Lp(t.parameters)&&t.parameters.every(e=>Qu(e))&&Qu(t.returns)}a(BGr,"IsConstructor");function FGr(t){return Bs(t,"Date")&&t.type==="Date"&&Kc(t.$id)&&ql(t.exclusiveMaximumTimestamp)&&ql(t.exclusiveMinimumTimestamp)&&ql(t.maximumTimestamp)&&ql(t.minimumTimestamp)&&ql(t.multipleOfTimestamp)}a(FGr,"IsDate");function UGr(t){return Bs(t,"Function")&&t.type==="Function"&&Kc(t.$id)&&Lp(t.parameters)&&t.parameters.every(e=>Qu(e))&&Qu(t.returns)}a(UGr,"IsFunction");function kdo(t){return Bs(t,"Import")&&q9e(t,"$defs")&&Yc(t.$defs)&&z9e(t.$defs)&&q9e(t,"$ref")&&Ql(t.$ref)&&t.$ref in t.$defs}a(kdo,"IsImport");function QGr(t){return Bs(t,"Integer")&&t.type==="integer"&&Kc(t.$id)&&ql(t.exclusiveMaximum)&&ql(t.exclusiveMinimum)&&ql(t.maximum)&&ql(t.minimum)&&ql(t.multipleOf)}a(QGr,"IsInteger");function z9e(t){return Yc(t)&&Object.entries(t).every(([e,r])=>SPt(e)&&Qu(r))}a(z9e,"IsProperties");function qGr(t){return Bs(t,"Intersect")&&!(Ql(t.type)&&t.type!=="object")&&Lp(t.allOf)&&t.allOf.every(e=>Qu(e)&&!a$r(e))&&Kc(t.type)&&(TPt(t.unevaluatedProperties)||RGr(t.unevaluatedProperties))&&Kc(t.$id)}a(qGr,"IsIntersect");function jGr(t){return Bs(t,"Iterator")&&t.type==="Iterator"&&Kc(t.$id)&&Qu(t.items)}a(jGr,"IsIterator");function Bs(t,e){return Yc(t)&&Tt in t&&t[Tt]===e}a(Bs,"IsKindOf");function HGr(t){return FCe(t)&&Ql(t.const)}a(HGr,"IsLiteralString");function GGr(t){return FCe(t)&&L1(t.const)}a(GGr,"IsLiteralNumber");function Pdo(t){return FCe(t)&&sB(t.const)}a(Pdo,"IsLiteralBoolean");function FCe(t){return Bs(t,"Literal")&&Kc(t.$id)&&$Gr(t.const)}a(FCe,"IsLiteral");function $Gr(t){return sB(t)||L1(t)||Ql(t)}a($Gr,"IsLiteralValue");function VGr(t){return Bs(t,"MappedKey")&&Lp(t.keys)&&t.keys.every(e=>L1(e)||Ql(e))}a(VGr,"IsMappedKey");function WGr(t){return Bs(t,"MappedResult")&&z9e(t.properties)}a(WGr,"IsMappedResult");function zGr(t){return Bs(t,"Never")&&Yc(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(zGr,"IsNever");function YGr(t){return Bs(t,"Not")&&Qu(t.not)}a(YGr,"IsNot");function KGr(t){return Bs(t,"Null")&&t.type==="null"&&Kc(t.$id)}a(KGr,"IsNull");function JGr(t){return Bs(t,"Number")&&t.type==="number"&&Kc(t.$id)&&ql(t.exclusiveMaximum)&&ql(t.exclusiveMinimum)&&ql(t.maximum)&&ql(t.minimum)&&ql(t.multipleOf)}a(JGr,"IsNumber");function ZGr(t){return Bs(t,"Object")&&t.type==="object"&&Kc(t.$id)&&z9e(t.properties)&&wGr(t.additionalProperties)&&ql(t.minProperties)&&ql(t.maxProperties)}a(ZGr,"IsObject");function XGr(t){return Bs(t,"Promise")&&t.type==="Promise"&&Kc(t.$id)&&Qu(t.item)}a(XGr,"IsPromise");function e$r(t){return Bs(t,"Record")&&t.type==="object"&&Kc(t.$id)&&wGr(t.additionalProperties)&&Yc(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&xGr(r[0])&&Yc(e.patternProperties)&&Qu(e.patternProperties[r[0]])})(t)}a(e$r,"IsRecord");function Ddo(t){return Yc(t)&&jI in t&&t[jI]==="Recursive"}a(Ddo,"IsRecursive");function t$r(t){return Bs(t,"Ref")&&Kc(t.$id)&&Ql(t.$ref)}a(t$r,"IsRef");function r$r(t){return Bs(t,"RegExp")&&Kc(t.$id)&&Ql(t.source)&&Ql(t.flags)&&ql(t.maxLength)&&ql(t.minLength)}a(r$r,"IsRegExp");function n$r(t){return Bs(t,"String")&&t.type==="string"&&Kc(t.$id)&&ql(t.minLength)&&ql(t.maxLength)&&Ido(t.pattern)&&xdo(t.format)}a(n$r,"IsString");function i$r(t){return Bs(t,"Symbol")&&t.type==="symbol"&&Kc(t.$id)}a(i$r,"IsSymbol");function o$r(t){return Bs(t,"TemplateLiteral")&&t.type==="string"&&Ql(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(o$r,"IsTemplateLiteral");function s$r(t){return Bs(t,"This")&&Kc(t.$id)&&Ql(t.$ref)}a(s$r,"IsThis");function a$r(t){return Yc(t)&&wd in t}a(a$r,"IsTransform");function c$r(t){return Bs(t,"Tuple")&&t.type==="array"&&Kc(t.$id)&&L1(t.minItems)&&L1(t.maxItems)&&t.minItems===t.maxItems&&(Bp(t.items)&&Bp(t.additionalItems)&&t.minItems===0||Lp(t.items)&&t.items.every(e=>Qu(e)))}a(c$r,"IsTuple");function l$r(t){return Bs(t,"Undefined")&&t.type==="undefined"&&Kc(t.$id)}a(l$r,"IsUndefined");function Ndo(t){return IPt(t)&&t.anyOf.every(e=>HGr(e)||GGr(e))}a(Ndo,"IsUnionLiteral");function IPt(t){return Bs(t,"Union")&&Kc(t.$id)&&Yc(t)&&Lp(t.anyOf)&&t.anyOf.every(e=>Qu(e))}a(IPt,"IsUnion");function u$r(t){return Bs(t,"Uint8Array")&&t.type==="Uint8Array"&&Kc(t.$id)&&ql(t.minByteLength)&&ql(t.maxByteLength)}a(u$r,"IsUint8Array");function d$r(t){return Bs(t,"Unknown")&&Kc(t.$id)}a(d$r,"IsUnknown");function f$r(t){return Bs(t,"Unsafe")}a(f$r,"IsUnsafe");function p$r(t){return Bs(t,"Void")&&t.type==="void"&&Kc(t.$id)}a(p$r,"IsVoid");function h$r(t){return Yc(t)&&Tt in t&&Ql(t[Tt])&&!Tdo.includes(t[Tt])}a(h$r,"IsKind");function Qu(t){return Yc(t)&&(kGr(t)||PGr(t)||DGr(t)||OGr(t)||MGr(t)||NGr(t)||LGr(t)||BGr(t)||FGr(t)||UGr(t)||QGr(t)||qGr(t)||jGr(t)||FCe(t)||VGr(t)||WGr(t)||zGr(t)||YGr(t)||KGr(t)||JGr(t)||ZGr(t)||XGr(t)||e$r(t)||t$r(t)||r$r(t)||n$r(t)||i$r(t)||o$r(t)||s$r(t)||c$r(t)||l$r(t)||IPt(t)||u$r(t)||d$r(t)||f$r(t)||p$r(t)||h$r(t))}a(Qu,"IsSchema");p();var xPt="(true|false)",UCe="(0|[1-9][0-9]*)",wPt="(.*)",Mdo="(?!.*)",Hdl=`^${xPt}$`,gU=`^${UCe}$`,AU=`^${wPt}$`,m$r=`^${Mdo}$`;p();var Uk={};ki(Uk,{Clear:()=>Ldo,Delete:()=>Bdo,Entries:()=>Odo,Get:()=>Qdo,Has:()=>Fdo,Set:()=>Udo});p();var Roe=new Map;function Odo(){return new Map(Roe)}a(Odo,"Entries");function Ldo(){return Roe.clear()}a(Ldo,"Clear");function Bdo(t){return Roe.delete(t)}a(Bdo,"Delete");function Fdo(t){return Roe.has(t)}a(Fdo,"Has");function Udo(t,e){Roe.set(t,e)}a(Udo,"Set");function Qdo(t){return Roe.get(t)}a(Qdo,"Get");var v_={};ki(v_,{Clear:()=>jdo,Delete:()=>Hdo,Entries:()=>qdo,Get:()=>Vdo,Has:()=>Gdo,Set:()=>$do});p();var koe=new Map;function qdo(){return new Map(koe)}a(qdo,"Entries");function jdo(){return koe.clear()}a(jdo,"Clear");function Hdo(t){return koe.delete(t)}a(Hdo,"Delete");function Gdo(t){return koe.has(t)}a(Gdo,"Has");function $do(t,e){koe.set(t,e)}a($do,"Set");function Vdo(t){return koe.get(t)}a(Vdo,"Get");p();function g$r(t,e){return t.includes(e)}a(g$r,"SetIncludes");function A$r(t){return[...new Set(t)]}a(A$r,"SetDistinct");function Wdo(t,e){return t.filter(r=>e.includes(r))}a(Wdo,"SetIntersect");function zdo(t,e){return t.reduce((r,n)=>Wdo(r,n),e)}a(zdo,"SetIntersectManyResolve");function y$r(t){return t.length===1?t[0]:t.length>1?zdo(t.slice(1),t[0]):[]}a(y$r,"SetIntersectMany");function E$r(t){let e=[];for(let r of t)e.push(...r);return e}a(E$r,"SetUnionMany");p();function yU(t){return wt({[Tt]:"Any"},t)}a(yU,"Any");p();function Poe(t,e){return wt({[Tt]:"Array",type:"array",items:t},e)}a(Poe,"Array");p();function _$r(t){return wt({[Tt]:"Argument",index:t})}a(_$r,"Argument");p();function Doe(t,e){return wt({[Tt]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(Doe,"AsyncIterator");p();p();function au(t,e,r){return wt({[Tt]:"Computed",target:t,parameters:e},r)}a(au,"Computed");p();p();function Ydo(t,e){let{[e]:r,...n}=t;return n}a(Ydo,"DiscardKey");function cf(t,e){return e.reduce((r,n)=>Ydo(r,n),t)}a(cf,"Discard");p();function Xo(t){return wt({[Tt]:"Never",not:{}},t)}a(Xo,"Never");p();p();function Qa(t){return wt({[Tt]:"MappedResult",properties:t})}a(Qa,"MappedResult");p();p();function Noe(t,e,r){return wt({[Tt]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(Noe,"Constructor");p();function tM(t,e,r){return wt({[Tt]:"Function",type:"Function",parameters:t,returns:e},r)}a(tM,"Function");p();p();p();p();function QCe(t,e){return wt({[Tt]:"Union",anyOf:t},e)}a(QCe,"UnionCreate");function Kdo(t){return t.some(e=>iC(e))}a(Kdo,"IsUnionOptional");function v$r(t){return t.map(e=>iC(e)?Jdo(e):e)}a(v$r,"RemoveOptionalFromRest");function Jdo(t){return cf(t,[hA])}a(Jdo,"RemoveOptionalFromType");function Zdo(t,e){return Kdo(t)?By(QCe(v$r(t),e)):QCe(v$r(t),e)}a(Zdo,"ResolveUnion");function rM(t,e){return t.length===1?wt(t[0],e):t.length===0?Xo(e):Zdo(t,e)}a(rM,"UnionEvaluated");p();function tc(t,e){return t.length===0?Xo(e):t.length===1?wt(t[0],e):QCe(t,e)}a(tc,"Union");p();p();p();var Y9e=class extends qi{static{a(this,"TemplateLiteralParserError")}};function Xdo(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(Xdo,"Unescape");function RPt(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(RPt,"IsNonEscaped");function hB(t,e){return RPt(t,e,"(")}a(hB,"IsOpenParen");function qCe(t,e){return RPt(t,e,")")}a(qCe,"IsCloseParen");function C$r(t,e){return RPt(t,e,"|")}a(C$r,"IsSeparator");function efo(t){if(!(hB(t,0)&&qCe(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(Moe(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(Moe(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(ifo,"Or");function ofo(t){function e(o,s){if(!hB(o,s))throw new Y9e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(Moe(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(ofo,"And");function Moe(t){return efo(t)?Moe(tfo(t)):rfo(t)?ifo(t):nfo(t)?ofo(t):{type:"const",const:Xdo(t)}}a(Moe,"TemplateLiteralParse");function Ooe(t){return Moe(t.slice(1,t.length-1))}a(Ooe,"TemplateLiteralParseExact");var kPt=class extends qi{static{a(this,"TemplateLiteralFiniteError")}};function sfo(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="0"&&t.expr[1].type==="const"&&t.expr[1].const==="[1-9][0-9]*"}a(sfo,"IsNumberExpression");function afo(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="true"&&t.expr[1].type==="const"&&t.expr[1].const==="false"}a(afo,"IsBooleanExpression");function cfo(t){return t.type==="const"&&t.const===".*"}a(cfo,"IsStringExpression");function NW(t){return sfo(t)||cfo(t)?!1:afo(t)?!0:t.type==="and"?t.expr.every(e=>NW(e)):t.type==="or"?t.expr.every(e=>NW(e)):t.type==="const"?!0:(()=>{throw new kPt("Unknown expression type")})()}a(NW,"IsTemplateLiteralExpressionFinite");function K9e(t){let e=Ooe(t.pattern);return NW(e)}a(K9e,"IsTemplateLiteralFinite");p();var PPt=class extends qi{static{a(this,"TemplateLiteralGenerateError")}};function*b$r(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of b$r(t.slice(1)))yield`${e}${r}`}a(b$r,"GenerateReduce");function*lfo(t){return yield*b$r(t.expr.map(e=>[...jCe(e)]))}a(lfo,"GenerateAnd");function*ufo(t){for(let e of t.expr)yield*jCe(e)}a(ufo,"GenerateOr");function*dfo(t){return yield t.const}a(dfo,"GenerateConst");function*jCe(t){return t.type==="and"?yield*lfo(t):t.type==="or"?yield*ufo(t):t.type==="const"?yield*dfo(t):(()=>{throw new PPt("Unknown expression")})()}a(jCe,"TemplateLiteralExpressionGenerate");function Loe(t){let e=Ooe(t.pattern);return NW(e)?[...jCe(e)]:[]}a(Loe,"TemplateLiteralGenerate");p();p();function ca(t,e){return wt({[Tt]:"Literal",const:t,type:typeof t},e)}a(ca,"Literal");p();function J9e(t){return wt({[Tt]:"Boolean",type:"boolean"},t)}a(J9e,"Boolean");p();function Boe(t){return wt({[Tt]:"BigInt",type:"bigint"},t)}a(Boe,"BigInt");p();function HI(t){return wt({[Tt]:"Number",type:"number"},t)}a(HI,"Number");p();function C_(t){return wt({[Tt]:"String",type:"string"},t)}a(C_,"String");function*ffo(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield J9e():e==="number"?yield HI():e==="bigint"?yield Boe():e==="string"?yield C_():yield(()=>{let r=e.split("|").map(n=>ca(n.trim()));return r.length===0?Xo():r.length===1?r[0]:rM(r)})()}a(ffo,"FromUnion");function*pfo(t){if(t[1]!=="{"){let e=ca("$"),r=DPt(t.slice(1));return yield*[e,...r]}for(let e=2;eT$r(r,e)).join("|")})`:Fk(t)?`${e}${UCe}`:Bk(t)?`${e}${UCe}`:RW(t)?`${e}${UCe}`:dB(t)?`${e}${wPt}`:F1(t)?`${e}${hfo(t.const.toString())}`:uB(t)?`${e}${xPt}`:(()=>{throw new NPt(`Unexpected Kind '${t[Tt]}'`)})()}a(T$r,"Visit");function MPt(t){return`^${t.map(e=>T$r(e,"")).join("")}$`}a(MPt,"TemplateLiteralPattern");p();function MW(t){let r=Loe(t).map(n=>ca(n));return rM(r)}a(MW,"TemplateLiteralToUnion");p();function Z9e(t,e){let r=Ql(t)?MPt(S$r(t)):MPt(t);return wt({[Tt]:"TemplateLiteral",type:"string",pattern:r},e)}a(Z9e,"TemplateLiteral");function mfo(t){return Loe(t).map(r=>r.toString())}a(mfo,"FromTemplateLiteral");function gfo(t){let e=[];for(let r of t)e.push(...oC(r));return e}a(gfo,"FromUnion");function Afo(t){return[t.toString()]}a(Afo,"FromLiteral");function oC(t){return[...new Set(Q1(t)?mfo(t):Ta(t)?gfo(t.anyOf):F1(t)?Afo(t.const):Fk(t)?["[number]"]:Bk(t)?["[number]"]:[])]}a(oC,"IndexPropertyKeys");p();function yfo(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=EU(t,oC(e[o]),r);return n}a(yfo,"FromProperties");function Efo(t,e,r){return yfo(t,e.properties,r)}a(Efo,"FromMappedResult");function I$r(t,e,r){let n=Efo(t,e,r);return Qa(n)}a(I$r,"IndexFromMappedResult");function w$r(t,e){return t.map(r=>R$r(r,e))}a(w$r,"FromRest");function _fo(t){return t.filter(e=>!hU(e))}a(_fo,"FromIntersectRest");function vfo(t,e){return X9e(_fo(w$r(t,e)))}a(vfo,"FromIntersect");function Cfo(t){return t.some(e=>hU(e))?[]:t}a(Cfo,"FromUnionRest");function bfo(t,e){return rM(Cfo(w$r(t,e)))}a(bfo,"FromUnion");function Sfo(t,e){return e in t?t[e]:e==="[number]"?rM(t):Xo()}a(Sfo,"FromTuple");function Tfo(t,e){return e==="[number]"?t:Xo()}a(Tfo,"FromArray");function Ifo(t,e){return e in t?t[e]:Xo()}a(Ifo,"FromProperty");function R$r(t,e){return af(t)?vfo(t.allOf,e):Ta(t)?bfo(t.anyOf,e):q1(t)?Sfo(t.items??[],e):Nk(t)?Tfo(t.items,e):Fp(t)?Ifo(t.properties,e):Xo()}a(R$r,"IndexFromPropertyKey");function HCe(t,e){return e.map(r=>R$r(t,r))}a(HCe,"IndexFromPropertyKeys");function x$r(t,e){return rM(HCe(t,e))}a(x$r,"FromSchema");function EU(t,e,r){if(jf(t)||jf(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!Rd(t)||!Rd(e))throw new qi(n);return au("Index",[t,e])}return Uu(e)?I$r(t,e,r):U1(e)?k$r(t,e,r):wt(Rd(e)?x$r(t,oC(e)):x$r(t,e),r)}a(EU,"Index");function xfo(t,e,r){return{[e]:EU(t,[e],Bu(r))}}a(xfo,"MappedIndexPropertyKey");function wfo(t,e,r){return e.reduce((n,o)=>({...n,...xfo(t,o,r)}),{})}a(wfo,"MappedIndexPropertyKeys");function Rfo(t,e,r){return wfo(t,e.keys,r)}a(Rfo,"MappedIndexProperties");function k$r(t,e,r){let n=Rfo(t,e,r);return Qa(n)}a(k$r,"IndexFromMappedKey");p();function Foe(t,e){return wt({[Tt]:"Iterator",type:"Iterator",items:t},e)}a(Foe,"Iterator");p();function kfo(t){return globalThis.Object.keys(t).filter(e=>!iC(t[e]))}a(kfo,"RequiredArray");function Pfo(t,e){let r=kfo(t),n=r.length>0?{[Tt]:"Object",type:"object",required:r,properties:t}:{[Tt]:"Object",type:"object",properties:t};return wt(n,e)}a(Pfo,"_Object");var rc=Pfo;p();function eUe(t,e){return wt({[Tt]:"Promise",type:"Promise",item:t},e)}a(eUe,"Promise");p();p();function Dfo(t){return wt(cf(t,[Dk]))}a(Dfo,"RemoveReadonly");function Nfo(t){return wt({...t,[Dk]:"Readonly"})}a(Nfo,"AddReadonly");function Mfo(t,e){return e===!1?Dfo(t):Nfo(t)}a(Mfo,"ReadonlyWithFlag");function sC(t,e){let r=e??!0;return Uu(t)?P$r(t,r):Mfo(t,r)}a(sC,"Readonly");function Ofo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=sC(t[n],e);return r}a(Ofo,"FromProperties");function Lfo(t,e){return Ofo(t.properties,e)}a(Lfo,"FromMappedResult");function P$r(t,e){let r=Lfo(t,e);return Qa(r)}a(P$r,"ReadonlyFromMappedResult");p();function GI(t,e){return wt(t.length>0?{[Tt]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[Tt]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(GI,"Tuple");function D$r(t,e){return t in e?$I(t,e[t]):Qa(e)}a(D$r,"FromMappedResult");function Bfo(t){return{[t]:ca(t)}}a(Bfo,"MappedKeyToKnownMappedResultProperties");function Ffo(t){let e={};for(let r of t)e[r]=ca(r);return e}a(Ffo,"MappedKeyToUnknownMappedResultProperties");function Ufo(t,e){return g$r(e,t)?Bfo(t):Ffo(e)}a(Ufo,"MappedKeyToMappedResultProperties");function Qfo(t,e){let r=Ufo(t,e);return D$r(t,r)}a(Qfo,"FromMappedKey");function GCe(t,e){return e.map(r=>$I(t,r))}a(GCe,"FromRest");function qfo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=$I(t,e[n]);return r}a(qfo,"FromProperties");function $I(t,e){let r={...e};return iC(e)?By($I(t,cf(e,[hA]))):woe(e)?sC($I(t,cf(e,[Dk]))):Uu(e)?D$r(t,e.properties):U1(e)?Qfo(t,e.keys):Ok(e)?Noe(GCe(t,e.parameters),$I(t,e.returns),r):Lk(e)?tM(GCe(t,e.parameters),$I(t,e.returns),r):wW(e)?Doe($I(t,e.items),r):kW(e)?Foe($I(t,e.items),r):af(e)?Fy(GCe(t,e.allOf),r):Ta(e)?tc(GCe(t,e.anyOf),r):q1(e)?GI(GCe(t,e.items??[]),r):Fp(e)?rc(qfo(t,e.properties),r):Nk(e)?Poe($I(t,e.items),r):PW(e)?eUe($I(t,e.item),r):e}a($I,"FromSchemaType");function jfo(t,e){let r={};for(let n of t)r[n]=$I(n,e);return r}a(jfo,"MappedFunctionReturnType");function N$r(t,e,r){let n=Rd(t)?oC(t):t,o=e({[Tt]:"MappedKey",keys:n}),s=jfo(n,o);return rc(s,r)}a(N$r,"Mapped");p();function Hfo(t){return wt(cf(t,[hA]))}a(Hfo,"RemoveOptional");function Gfo(t){return wt({...t,[hA]:"Optional"})}a(Gfo,"AddOptional");function $fo(t,e){return e===!1?Hfo(t):Gfo(t)}a($fo,"OptionalWithFlag");function By(t,e){let r=e??!0;return Uu(t)?M$r(t,r):$fo(t,r)}a(By,"Optional");function Vfo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=By(t[n],e);return r}a(Vfo,"FromProperties");function Wfo(t,e){return Vfo(t.properties,e)}a(Wfo,"FromMappedResult");function M$r(t,e){let r=Wfo(t,e);return Qa(r)}a(M$r,"OptionalFromMappedResult");p();function $Ce(t,e={}){let r=t.every(o=>Fp(o)),n=Rd(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return wt(e.unevaluatedProperties===!1||Rd(e.unevaluatedProperties)||r?{...n,[Tt]:"Intersect",type:"object",allOf:t}:{...n,[Tt]:"Intersect",allOf:t},e)}a($Ce,"IntersectCreate");function zfo(t){return t.every(e=>iC(e))}a(zfo,"IsIntersectOptional");function Yfo(t){return cf(t,[hA])}a(Yfo,"RemoveOptionalFromType");function O$r(t){return t.map(e=>iC(e)?Yfo(e):e)}a(O$r,"RemoveOptionalFromRest");function Kfo(t,e){return zfo(t)?By($Ce(O$r(t),e)):$Ce(O$r(t),e)}a(Kfo,"ResolveIntersect");function X9e(t,e={}){if(t.length===1)return wt(t[0],e);if(t.length===0)return Xo(e);if(t.some(r=>ec(r)))throw new Error("Cannot intersect transform types");return Kfo(t,e)}a(X9e,"IntersectEvaluated");p();function Fy(t,e){if(t.length===1)return wt(t[0],e);if(t.length===0)return Xo(e);if(t.some(r=>ec(r)))throw new Error("Cannot intersect transform types");return $Ce(t,e)}a(Fy,"Intersect");p();function VI(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new qi("Ref: $ref must be a string");return wt({[Tt]:"Ref",$ref:e},r)}a(VI,"Ref");function Jfo(t,e){return au("Awaited",[au(t,e)])}a(Jfo,"FromComputed");function Zfo(t){return au("Awaited",[VI(t)])}a(Zfo,"FromRef");function Xfo(t){return Fy(L$r(t))}a(Xfo,"FromIntersect");function epo(t){return tc(L$r(t))}a(epo,"FromUnion");function tpo(t){return Uoe(t)}a(tpo,"FromPromise");function L$r(t){return t.map(e=>Uoe(e))}a(L$r,"FromRest");function Uoe(t,e){return wt(Mk(t)?Jfo(t.target,t.parameters):af(t)?Xfo(t.allOf):Ta(t)?epo(t.anyOf):PW(t)?tpo(t.item):jf(t)?Zfo(t.$ref):t,e)}a(Uoe,"Awaited");p();p();p();p();function B$r(t){let e=[];for(let r of t)e.push(aC(r));return e}a(B$r,"FromRest");function rpo(t){let e=B$r(t);return E$r(e)}a(rpo,"FromIntersect");function npo(t){let e=B$r(t);return y$r(e)}a(npo,"FromUnion");function ipo(t){return t.map((e,r)=>r.toString())}a(ipo,"FromTuple");function opo(t){return["[number]"]}a(opo,"FromArray");function spo(t){return globalThis.Object.getOwnPropertyNames(t)}a(spo,"FromProperties");function apo(t){return OPt?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(apo,"FromPatternProperties");function aC(t){return af(t)?rpo(t.allOf):Ta(t)?npo(t.anyOf):q1(t)?ipo(t.items??[]):Nk(t)?opo(t.items):Fp(t)?spo(t.properties):DW(t)?apo(t.patternProperties):[]}a(aC,"KeyOfPropertyKeys");var OPt=!1;function mB(t){OPt=!0;let e=aC(t);return OPt=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(mB,"KeyOfPattern");function cpo(t,e){return au("KeyOf",[au(t,e)])}a(cpo,"FromComputed");function lpo(t){return au("KeyOf",[VI(t)])}a(lpo,"FromRef");function upo(t,e){let r=aC(t),n=dpo(r),o=rM(n);return wt(o,e)}a(upo,"KeyOfFromType");function dpo(t){return t.map(e=>e==="[number]"?HI():ca(e))}a(dpo,"KeyOfPropertyKeysToRest");function Qoe(t,e){return Mk(t)?cpo(t.target,t.parameters):jf(t)?lpo(t.$ref):Uu(t)?F$r(t,e):upo(t,e)}a(Qoe,"KeyOf");function fpo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Qoe(t[n],Bu(e));return r}a(fpo,"FromProperties");function ppo(t,e){return fpo(t.properties,e)}a(ppo,"FromMappedResult");function F$r(t,e){let r=ppo(t,e);return Qa(r)}a(F$r,"KeyOfFromMappedResult");p();function tUe(t){let e=aC(t),r=HCe(t,e);return e.map((n,o)=>[e[o],r[o]])}a(tUe,"KeyOfPropertyEntries");function hpo(t){let e=[];for(let r of t)e.push(...aC(r));return A$r(e)}a(hpo,"CompositeKeys");function mpo(t){return t.filter(e=>!hU(e))}a(mpo,"FilterNever");function gpo(t,e){let r=[];for(let n of t)r.push(...HCe(n,[e]));return mpo(r)}a(gpo,"CompositeProperty");function Apo(t,e){let r={};for(let n of e)r[n]=X9e(gpo(t,n));return r}a(Apo,"CompositeProperties");function U$r(t,e){let r=hpo(t),n=Apo(t,r);return rc(n,e)}a(U$r,"Composite");p();p();function rUe(t){return wt({[Tt]:"Date",type:"Date"},t)}a(rUe,"Date");p();function nUe(t){return wt({[Tt]:"Null",type:"null"},t)}a(nUe,"Null");p();function iUe(t){return wt({[Tt]:"Symbol",type:"symbol"},t)}a(iUe,"Symbol");p();function oUe(t){return wt({[Tt]:"Undefined",type:"undefined"},t)}a(oUe,"Undefined");p();function sUe(t){return wt({[Tt]:"Uint8Array",type:"Uint8Array"},t)}a(sUe,"Uint8Array");p();function Qk(t){return wt({[Tt]:"Unknown"},t)}a(Qk,"Unknown");function ypo(t){return t.map(e=>LPt(e,!1))}a(ypo,"FromArray");function Epo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=sC(LPt(t[r],!1));return e}a(Epo,"FromProperties");function aUe(t,e){return e===!0?t:sC(t)}a(aUe,"ConditionalReadonly");function LPt(t,e){return hPt(t)?aUe(yU(),e):gPt(t)?aUe(yU(),e):Lp(t)?sC(GI(ypo(t))):aB(t)?sUe():xW(t)?rUe():Yc(t)?aUe(rc(Epo(t)),e):mPt(t)?aUe(tM([],Qk()),e):Bp(t)?oUe():APt(t)?nUe():yPt(t)?iUe():DCe(t)?Boe():L1(t)?ca(t):sB(t)?ca(t):Ql(t)?ca(t):rc({})}a(LPt,"FromValue");function Q$r(t,e){return wt(LPt(t,!0),e)}a(Q$r,"Const");p();function q$r(t,e){return Ok(t)?GI(t.parameters,e):Xo(e)}a(q$r,"ConstructorParameters");p();function j$r(t,e){if(Bp(t))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(t).filter(s=>isNaN(s)).map(s=>t[s]),o=[...new Set(r)].map(s=>ca(s));return tc(o,{...e,[jI]:"Enum"})}a(j$r,"Enum");p();p();p();var FPt=class extends qi{static{a(this,"ExtendsResolverError")}},Rt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(Rt||(Rt={}));function WI(t){return t===Rt.False?t:Rt.True}a(WI,"IntoBooleanResult");function qoe(t){throw new FPt(t)}a(qoe,"Throw");function Ih(t){return it.IsNever(t)||it.IsIntersect(t)||it.IsUnion(t)||it.IsUnknown(t)||it.IsAny(t)}a(Ih,"IsStructuralRight");function xh(t,e){return it.IsNever(e)?Y$r(t,e):it.IsIntersect(e)?cUe(t,e):it.IsUnion(e)?jPt(t,e):it.IsUnknown(e)?X$r(t,e):it.IsAny(e)?qPt(t,e):qoe("StructuralRight")}a(xh,"StructuralRight");function qPt(t,e){return Rt.True}a(qPt,"FromAnyRight");function _po(t,e){return it.IsIntersect(e)?cUe(t,e):it.IsUnion(e)&&e.anyOf.some(r=>it.IsAny(r)||it.IsUnknown(r))?Rt.True:it.IsUnion(e)?Rt.Union:it.IsUnknown(e)||it.IsAny(e)?Rt.True:Rt.Union}a(_po,"FromAny");function vpo(t,e){return it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:it.IsNever(t)?Rt.True:Rt.False}a(vpo,"FromArrayRight");function Cpo(t,e){return it.IsObject(e)&&lUe(e)?Rt.True:Ih(e)?xh(t,e):it.IsArray(e)?WI(Jc(t.items,e.items)):Rt.False}a(Cpo,"FromArray");function bpo(t,e){return Ih(e)?xh(t,e):it.IsAsyncIterator(e)?WI(Jc(t.items,e.items)):Rt.False}a(bpo,"FromAsyncIterator");function Spo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsBigInt(e)?Rt.True:Rt.False}a(Spo,"FromBigInt");function W$r(t,e){return it.IsLiteralBoolean(t)||it.IsBoolean(t)?Rt.True:Rt.False}a(W$r,"FromBooleanRight");function Tpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsBoolean(e)?Rt.True:Rt.False}a(Tpo,"FromBoolean");function Ipo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsConstructor(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>WI(Jc(e.parameters[n],r))===Rt.True)?WI(Jc(t.returns,e.returns)):Rt.False:Rt.False}a(Ipo,"FromConstructor");function xpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsDate(e)?Rt.True:Rt.False}a(xpo,"FromDate");function wpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsFunction(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>WI(Jc(e.parameters[n],r))===Rt.True)?WI(Jc(t.returns,e.returns)):Rt.False:Rt.False}a(wpo,"FromFunction");function z$r(t,e){return it.IsLiteral(t)&&Ly.IsNumber(t.const)||it.IsNumber(t)||it.IsInteger(t)?Rt.True:Rt.False}a(z$r,"FromIntegerRight");function Rpo(t,e){return it.IsInteger(e)||it.IsNumber(e)?Rt.True:Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):Rt.False}a(Rpo,"FromInteger");function cUe(t,e){return e.allOf.every(r=>Jc(t,r)===Rt.True)?Rt.True:Rt.False}a(cUe,"FromIntersectRight");function kpo(t,e){return t.allOf.some(r=>Jc(r,e)===Rt.True)?Rt.True:Rt.False}a(kpo,"FromIntersect");function Ppo(t,e){return Ih(e)?xh(t,e):it.IsIterator(e)?WI(Jc(t.items,e.items)):Rt.False}a(Ppo,"FromIterator");function Dpo(t,e){return it.IsLiteral(e)&&e.const===t.const?Rt.True:Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsString(e)?Z$r(t,e):it.IsNumber(e)?K$r(t,e):it.IsInteger(e)?z$r(t,e):it.IsBoolean(e)?W$r(t,e):Rt.False}a(Dpo,"FromLiteral");function Y$r(t,e){return Rt.False}a(Y$r,"FromNeverRight");function Npo(t,e){return Rt.True}a(Npo,"FromNever");function H$r(t){let[e,r]=[t,0];for(;it.IsNot(e);)e=e.not,r+=1;return r%2===0?e:Qk()}a(H$r,"UnwrapTNot");function Mpo(t,e){return it.IsNot(t)?Jc(H$r(t),e):it.IsNot(e)?Jc(t,H$r(e)):qoe("Invalid fallthrough for Not")}a(Mpo,"FromNot");function Opo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsNull(e)?Rt.True:Rt.False}a(Opo,"FromNull");function K$r(t,e){return it.IsLiteralNumber(t)||it.IsNumber(t)||it.IsInteger(t)?Rt.True:Rt.False}a(K$r,"FromNumberRight");function Lpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsInteger(e)||it.IsNumber(e)?Rt.True:Rt.False}a(Lpo,"FromNumber");function cC(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(cC,"IsObjectPropertyCount");function G$r(t){return lUe(t)}a(G$r,"IsObjectStringLike");function $$r(t){return cC(t,0)||cC(t,1)&&"description"in t.properties&&it.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(it.IsString(t.properties.description.anyOf[0])&&it.IsUndefined(t.properties.description.anyOf[1])||it.IsString(t.properties.description.anyOf[1])&&it.IsUndefined(t.properties.description.anyOf[0]))}a($$r,"IsObjectSymbolLike");function BPt(t){return cC(t,0)}a(BPt,"IsObjectNumberLike");function V$r(t){return cC(t,0)}a(V$r,"IsObjectBooleanLike");function Bpo(t){return cC(t,0)}a(Bpo,"IsObjectBigIntLike");function Fpo(t){return cC(t,0)}a(Fpo,"IsObjectDateLike");function Upo(t){return lUe(t)}a(Upo,"IsObjectUint8ArrayLike");function Qpo(t){let e=HI();return cC(t,0)||cC(t,1)&&"length"in t.properties&&WI(Jc(t.properties.length,e))===Rt.True}a(Qpo,"IsObjectFunctionLike");function qpo(t){return cC(t,0)}a(qpo,"IsObjectConstructorLike");function lUe(t){let e=HI();return cC(t,0)||cC(t,1)&&"length"in t.properties&&WI(Jc(t.properties.length,e))===Rt.True}a(lUe,"IsObjectArrayLike");function jpo(t){let e=tM([yU()],yU());return cC(t,0)||cC(t,1)&&"then"in t.properties&&WI(Jc(t.properties.then,e))===Rt.True}a(jpo,"IsObjectPromiseLike");function J$r(t,e){return Jc(t,e)===Rt.False||it.IsOptional(t)&&!it.IsOptional(e)?Rt.False:Rt.True}a(J$r,"Property");function Uy(t,e){return it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:it.IsNever(t)||it.IsLiteralString(t)&&G$r(e)||it.IsLiteralNumber(t)&&BPt(e)||it.IsLiteralBoolean(t)&&V$r(e)||it.IsSymbol(t)&&$$r(e)||it.IsBigInt(t)&&Bpo(e)||it.IsString(t)&&G$r(e)||it.IsSymbol(t)&&$$r(e)||it.IsNumber(t)&&BPt(e)||it.IsInteger(t)&&BPt(e)||it.IsBoolean(t)&&V$r(e)||it.IsUint8Array(t)&&Upo(e)||it.IsDate(t)&&Fpo(e)||it.IsConstructor(t)&&qpo(e)||it.IsFunction(t)&&Qpo(e)?Rt.True:it.IsRecord(t)&&it.IsString(UPt(t))?e[jI]==="Record"?Rt.True:Rt.False:it.IsRecord(t)&&it.IsNumber(UPt(t))&&cC(e,0)?Rt.True:Rt.False}a(Uy,"FromObjectRight");function Hpo(t,e){return Ih(e)?xh(t,e):it.IsRecord(e)?zI(t,e):it.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!it.IsOptional(e.properties[r]))return Rt.False;if(it.IsOptional(e.properties[r]))return Rt.True;if(J$r(t.properties[r],e.properties[r])===Rt.False)return Rt.False}return Rt.True})():Rt.False}a(Hpo,"FromObject");function Gpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)&&jpo(e)?Rt.True:it.IsPromise(e)?WI(Jc(t.item,e.item)):Rt.False}a(Gpo,"FromPromise");function UPt(t){return gU in t.patternProperties?HI():AU in t.patternProperties?C_():qoe("Unknown record key pattern")}a(UPt,"RecordKey");function QPt(t){return gU in t.patternProperties?t.patternProperties[gU]:AU in t.patternProperties?t.patternProperties[AU]:qoe("Unable to get record value schema")}a(QPt,"RecordValue");function zI(t,e){let[r,n]=[UPt(e),QPt(e)];return it.IsLiteralString(t)&&it.IsNumber(r)&&WI(Jc(t,n))===Rt.True?Rt.True:it.IsUint8Array(t)&&it.IsNumber(r)||it.IsString(t)&&it.IsNumber(r)||it.IsArray(t)&&it.IsNumber(r)?Jc(t,n):it.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(J$r(n,t.properties[o])===Rt.False)return Rt.False;return Rt.True})():Rt.False}a(zI,"FromRecordRight");function $po(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?Jc(QPt(t),QPt(e)):Rt.False}a($po,"FromRecord");function Vpo(t,e){let r=it.IsRegExp(t)?C_():t,n=it.IsRegExp(e)?C_():e;return Jc(r,n)}a(Vpo,"FromRegExp");function Z$r(t,e){return it.IsLiteral(t)&&Ly.IsString(t.const)||it.IsString(t)?Rt.True:Rt.False}a(Z$r,"FromStringRight");function Wpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsString(e)?Rt.True:Rt.False}a(Wpo,"FromString");function zpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsSymbol(e)?Rt.True:Rt.False}a(zpo,"FromSymbol");function Ypo(t,e){return it.IsTemplateLiteral(t)?Jc(MW(t),e):it.IsTemplateLiteral(e)?Jc(t,MW(e)):qoe("Invalid fallthrough for TemplateLiteral")}a(Ypo,"FromTemplateLiteral");function Kpo(t,e){return it.IsArray(e)&&t.items!==void 0&&t.items.every(r=>Jc(r,e.items)===Rt.True)}a(Kpo,"IsArrayOfTuple");function Jpo(t,e){return it.IsNever(t)?Rt.True:it.IsUnknown(t)?Rt.False:it.IsAny(t)?Rt.Union:Rt.False}a(Jpo,"FromTupleRight");function Zpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)&&lUe(e)||it.IsArray(e)&&Kpo(t,e)?Rt.True:it.IsTuple(e)?Ly.IsUndefined(t.items)&&!Ly.IsUndefined(e.items)||!Ly.IsUndefined(t.items)&&Ly.IsUndefined(e.items)?Rt.False:Ly.IsUndefined(t.items)&&!Ly.IsUndefined(e.items)||t.items.every((r,n)=>Jc(r,e.items[n])===Rt.True)?Rt.True:Rt.False:Rt.False}a(Zpo,"FromTuple");function Xpo(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsUint8Array(e)?Rt.True:Rt.False}a(Xpo,"FromUint8Array");function eho(t,e){return Ih(e)?xh(t,e):it.IsObject(e)?Uy(t,e):it.IsRecord(e)?zI(t,e):it.IsVoid(e)?nho(t,e):it.IsUndefined(e)?Rt.True:Rt.False}a(eho,"FromUndefined");function jPt(t,e){return e.anyOf.some(r=>Jc(t,r)===Rt.True)?Rt.True:Rt.False}a(jPt,"FromUnionRight");function tho(t,e){return t.anyOf.every(r=>Jc(r,e)===Rt.True)?Rt.True:Rt.False}a(tho,"FromUnion");function X$r(t,e){return Rt.True}a(X$r,"FromUnknownRight");function rho(t,e){return it.IsNever(e)?Y$r(t,e):it.IsIntersect(e)?cUe(t,e):it.IsUnion(e)?jPt(t,e):it.IsAny(e)?qPt(t,e):it.IsString(e)?Z$r(t,e):it.IsNumber(e)?K$r(t,e):it.IsInteger(e)?z$r(t,e):it.IsBoolean(e)?W$r(t,e):it.IsArray(e)?vpo(t,e):it.IsTuple(e)?Jpo(t,e):it.IsObject(e)?Uy(t,e):it.IsUnknown(e)?Rt.True:Rt.False}a(rho,"FromUnknown");function nho(t,e){return it.IsUndefined(t)||it.IsUndefined(t)?Rt.True:Rt.False}a(nho,"FromVoidRight");function iho(t,e){return it.IsIntersect(e)?cUe(t,e):it.IsUnion(e)?jPt(t,e):it.IsUnknown(e)?X$r(t,e):it.IsAny(e)?qPt(t,e):it.IsObject(e)?Uy(t,e):it.IsVoid(e)?Rt.True:Rt.False}a(iho,"FromVoid");function Jc(t,e){return it.IsTemplateLiteral(t)||it.IsTemplateLiteral(e)?Ypo(t,e):it.IsRegExp(t)||it.IsRegExp(e)?Vpo(t,e):it.IsNot(t)||it.IsNot(e)?Mpo(t,e):it.IsAny(t)?_po(t,e):it.IsArray(t)?Cpo(t,e):it.IsBigInt(t)?Spo(t,e):it.IsBoolean(t)?Tpo(t,e):it.IsAsyncIterator(t)?bpo(t,e):it.IsConstructor(t)?Ipo(t,e):it.IsDate(t)?xpo(t,e):it.IsFunction(t)?wpo(t,e):it.IsInteger(t)?Rpo(t,e):it.IsIntersect(t)?kpo(t,e):it.IsIterator(t)?Ppo(t,e):it.IsLiteral(t)?Dpo(t,e):it.IsNever(t)?Npo(t,e):it.IsNull(t)?Opo(t,e):it.IsNumber(t)?Lpo(t,e):it.IsObject(t)?Hpo(t,e):it.IsRecord(t)?$po(t,e):it.IsString(t)?Wpo(t,e):it.IsSymbol(t)?zpo(t,e):it.IsTuple(t)?Zpo(t,e):it.IsPromise(t)?Gpo(t,e):it.IsUint8Array(t)?Xpo(t,e):it.IsUndefined(t)?eho(t,e):it.IsUnion(t)?tho(t,e):it.IsUnknown(t)?rho(t,e):it.IsVoid(t)?iho(t,e):qoe(`Unknown left type operand '${t[Tt]}'`)}a(Jc,"Visit");function _U(t,e){return Jc(t,e)}a(_U,"ExtendsCheck");p();p();p();function oho(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=joe(t[c],e,r,n,Bu(o));return s}a(oho,"FromProperties");function sho(t,e,r,n,o){return oho(t.properties,e,r,n,o)}a(sho,"FromMappedResult");function eVr(t,e,r,n,o){let s=sho(t,e,r,n,o);return Qa(s)}a(eVr,"ExtendsFromMappedResult");function aho(t,e,r,n){let o=_U(t,e);return o===Rt.Union?tc([r,n]):o===Rt.True?r:n}a(aho,"ExtendsResolve");function joe(t,e,r,n,o){return Uu(t)?eVr(t,e,r,n,o):U1(t)?wt(tVr(t,e,r,n,o)):wt(aho(t,e,r,n),o)}a(joe,"Extends");function cho(t,e,r,n,o){return{[t]:joe(ca(t),e,r,n,Bu(o))}}a(cho,"FromPropertyKey");function lho(t,e,r,n,o){return t.reduce((s,c)=>({...s,...cho(c,e,r,n,o)}),{})}a(lho,"FromPropertyKeys");function uho(t,e,r,n,o){return lho(t.keys,e,r,n,o)}a(uho,"FromMappedKey");function tVr(t,e,r,n,o){let s=uho(t,e,r,n,o);return Qa(s)}a(tVr,"ExtendsFromMappedKey");p();function dho(t){return t.allOf.every(e=>gB(e))}a(dho,"Intersect");function fho(t){return t.anyOf.some(e=>gB(e))}a(fho,"Union");function pho(t){return!gB(t.not)}a(pho,"Not");function gB(t){return t[Tt]==="Intersect"?dho(t):t[Tt]==="Union"?fho(t):t[Tt]==="Not"?pho(t):t[Tt]==="Undefined"}a(gB,"ExtendsUndefinedCheck");p();function rVr(t,e){return Hoe(MW(t),e)}a(rVr,"ExcludeFromTemplateLiteral");function hho(t,e){let r=t.filter(n=>_U(n,e)===Rt.False);return r.length===1?r[0]:tc(r)}a(hho,"ExcludeRest");function Hoe(t,e,r={}){return Q1(t)?wt(rVr(t,e),r):Uu(t)?wt(nVr(t,e),r):wt(Ta(t)?hho(t.anyOf,e):_U(t,e)!==Rt.False?Xo():t,r)}a(Hoe,"Exclude");function mho(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Hoe(t[n],e);return r}a(mho,"FromProperties");function gho(t,e){return mho(t.properties,e)}a(gho,"FromMappedResult");function nVr(t,e){let r=gho(t,e);return Qa(r)}a(nVr,"ExcludeFromMappedResult");p();p();p();function iVr(t,e){return Goe(MW(t),e)}a(iVr,"ExtractFromTemplateLiteral");function Aho(t,e){let r=t.filter(n=>_U(n,e)!==Rt.False);return r.length===1?r[0]:tc(r)}a(Aho,"ExtractRest");function Goe(t,e,r){return Q1(t)?wt(iVr(t,e),r):Uu(t)?wt(oVr(t,e),r):wt(Ta(t)?Aho(t.anyOf,e):_U(t,e)!==Rt.False?t:Xo(),r)}a(Goe,"Extract");function yho(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Goe(t[n],e);return r}a(yho,"FromProperties");function Eho(t,e){return yho(t.properties,e)}a(Eho,"FromMappedResult");function oVr(t,e){let r=Eho(t,e);return Qa(r)}a(oVr,"ExtractFromMappedResult");p();function sVr(t,e){return Ok(t)?wt(t.returns,e):Xo(e)}a(sVr,"InstanceType");p();p();function uUe(t){return sC(By(t))}a(uUe,"ReadonlyOptional");p();function OW(t,e,r){return wt({[Tt]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(OW,"RecordCreateFromPattern");function HPt(t,e,r){let n={};for(let o of t)n[o]=e;return rc(n,{...r,[jI]:"Record"})}a(HPt,"RecordCreateFromKeys");function _ho(t,e,r){return K9e(t)?HPt(oC(t),e,r):OW(t.pattern,e,r)}a(_ho,"FromTemplateLiteralKey");function vho(t,e,r){return HPt(oC(tc(t)),e,r)}a(vho,"FromUnionKey");function Cho(t,e,r){return HPt([t.toString()],e,r)}a(Cho,"FromLiteralKey");function bho(t,e,r){return OW(t.source,e,r)}a(bho,"FromRegExpKey");function Sho(t,e,r){let n=Bp(t.pattern)?AU:t.pattern;return OW(n,e,r)}a(Sho,"FromStringKey");function Tho(t,e,r){return OW(AU,e,r)}a(Tho,"FromAnyKey");function Iho(t,e,r){return OW(m$r,e,r)}a(Iho,"FromNeverKey");function xho(t,e,r){return rc({true:e,false:e},r)}a(xho,"FromBooleanKey");function who(t,e,r){return OW(gU,e,r)}a(who,"FromIntegerKey");function Rho(t,e,r){return OW(gU,e,r)}a(Rho,"FromNumberKey");function dUe(t,e,r={}){return Ta(t)?vho(t.anyOf,e,r):Q1(t)?_ho(t,e,r):F1(t)?Cho(t.const,e,r):uB(t)?xho(t,e,r):Bk(t)?who(t,e,r):Fk(t)?Rho(t,e,r):CPt(t)?bho(t,e,r):dB(t)?Sho(t,e,r):_Pt(t)?Tho(t,e,r):hU(t)?Iho(t,e,r):Xo(r)}a(dUe,"Record");function fUe(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(fUe,"RecordPattern");function aVr(t){let e=fUe(t);return e===AU?C_():e===gU?HI():C_({pattern:e})}a(aVr,"RecordKey");function pUe(t){return t.patternProperties[fUe(t)]}a(pUe,"RecordValue");function kho(t,e){return e.parameters=VCe(t,e.parameters),e.returns=qk(t,e.returns),e}a(kho,"FromConstructor");function Pho(t,e){return e.parameters=VCe(t,e.parameters),e.returns=qk(t,e.returns),e}a(Pho,"FromFunction");function Dho(t,e){return e.allOf=VCe(t,e.allOf),e}a(Dho,"FromIntersect");function Nho(t,e){return e.anyOf=VCe(t,e.anyOf),e}a(Nho,"FromUnion");function Mho(t,e){return Bp(e.items)||(e.items=VCe(t,e.items)),e}a(Mho,"FromTuple");function Oho(t,e){return e.items=qk(t,e.items),e}a(Oho,"FromArray");function Lho(t,e){return e.items=qk(t,e.items),e}a(Lho,"FromAsyncIterator");function Bho(t,e){return e.items=qk(t,e.items),e}a(Bho,"FromIterator");function Fho(t,e){return e.item=qk(t,e.item),e}a(Fho,"FromPromise");function Uho(t,e){let r=Hho(t,e.properties);return{...e,...rc(r)}}a(Uho,"FromObject");function Qho(t,e){let r=qk(t,aVr(e)),n=qk(t,pUe(e)),o=dUe(r,n);return{...e,...o}}a(Qho,"FromRecord");function qho(t,e){return e.index in t?t[e.index]:Qk()}a(qho,"FromArgument");function jho(t,e){let r=woe(e),n=iC(e),o=qk(t,e);return r&&n?uUe(o):r&&!n?sC(o):!r&&n?By(o):o}a(jho,"FromProperty");function Hho(t,e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:jho(t,e[n])}),{})}a(Hho,"FromProperties");function VCe(t,e){return e.map(r=>qk(t,r))}a(VCe,"FromTypes");function qk(t,e){return Ok(e)?kho(t,e):Lk(e)?Pho(t,e):af(e)?Dho(t,e):Ta(e)?Nho(t,e):q1(e)?Mho(t,e):Nk(e)?Oho(t,e):wW(e)?Lho(t,e):kW(e)?Bho(t,e):PW(e)?Fho(t,e):Fp(e)?Uho(t,e):DW(e)?Qho(t,e):vPt(e)?qho(t,e):e}a(qk,"FromType");function cVr(t,e){return qk(e,Ioe(t))}a(cVr,"Instantiate");p();function lVr(t){return wt({[Tt]:"Integer",type:"integer"},t)}a(lVr,"Integer");p();p();p();function Gho(t,e,r){return{[t]:jk(ca(t),e,Bu(r))}}a(Gho,"MappedIntrinsicPropertyKey");function $ho(t,e,r){return t.reduce((o,s)=>({...o,...Gho(s,e,r)}),{})}a($ho,"MappedIntrinsicPropertyKeys");function Vho(t,e,r){return $ho(t.keys,e,r)}a(Vho,"MappedIntrinsicProperties");function uVr(t,e,r){let n=Vho(t,e,r);return Qa(n)}a(uVr,"IntrinsicFromMappedKey");function Who(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(Who,"ApplyUncapitalize");function zho(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(zho,"ApplyCapitalize");function Yho(t){return t.toUpperCase()}a(Yho,"ApplyUppercase");function Kho(t){return t.toLowerCase()}a(Kho,"ApplyLowercase");function Jho(t,e,r){let n=Ooe(t.pattern);if(!NW(n))return{...t,pattern:dVr(t.pattern,e)};let c=[...jCe(n)].map(d=>ca(d)),l=fVr(c,e),u=tc(l);return Z9e([u],r)}a(Jho,"FromTemplateLiteral");function dVr(t,e){return typeof t=="string"?e==="Uncapitalize"?Who(t):e==="Capitalize"?zho(t):e==="Uppercase"?Yho(t):e==="Lowercase"?Kho(t):t:t.toString()}a(dVr,"FromLiteralValue");function fVr(t,e){return t.map(r=>jk(r,e))}a(fVr,"FromRest");function jk(t,e,r={}){return U1(t)?uVr(t,e,r):Q1(t)?Jho(t,e,r):Ta(t)?tc(fVr(t.anyOf,e),r):F1(t)?ca(dVr(t.const,e),r):wt(t,r)}a(jk,"Intrinsic");function pVr(t,e={}){return jk(t,"Capitalize",e)}a(pVr,"Capitalize");p();function hVr(t,e={}){return jk(t,"Lowercase",e)}a(hVr,"Lowercase");p();function mVr(t,e={}){return jk(t,"Uncapitalize",e)}a(mVr,"Uncapitalize");p();function gVr(t,e={}){return jk(t,"Uppercase",e)}a(gVr,"Uppercase");p();p();p();p();p();function Zho(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=vU(t[o],e,Bu(r));return n}a(Zho,"FromProperties");function Xho(t,e,r){return Zho(t.properties,e,r)}a(Xho,"FromMappedResult");function AVr(t,e,r){let n=Xho(t,e,r);return Qa(n)}a(AVr,"OmitFromMappedResult");function emo(t,e){return t.map(r=>GPt(r,e))}a(emo,"FromIntersect");function tmo(t,e){return t.map(r=>GPt(r,e))}a(tmo,"FromUnion");function rmo(t,e){let{[e]:r,...n}=t;return n}a(rmo,"FromProperty");function nmo(t,e){return e.reduce((r,n)=>rmo(r,n),t)}a(nmo,"FromProperties");function imo(t,e,r){let n=cf(t,[wd,"$id","required","properties"]),o=nmo(r,e);return rc(o,n)}a(imo,"FromObject");function omo(t){let e=t.reduce((r,n)=>W9e(n)?[...r,ca(n)]:r,[]);return tc(e)}a(omo,"UnionFromPropertyKeys");function GPt(t,e){return af(t)?Fy(emo(t.allOf,e)):Ta(t)?tc(tmo(t.anyOf,e)):Fp(t)?imo(t,e,t.properties):rc({})}a(GPt,"OmitResolve");function vU(t,e,r){let n=Lp(e)?omo(e):e,o=Rd(e)?oC(e):e,s=jf(t),c=jf(e);return Uu(t)?AVr(t,o,r):U1(e)?yVr(t,e,r):s&&c?au("Omit",[t,n],r):!s&&c?au("Omit",[t,n],r):s&&!c?au("Omit",[t,n],r):wt({...GPt(t,o),...r})}a(vU,"Omit");function smo(t,e,r){return{[e]:vU(t,[e],Bu(r))}}a(smo,"FromPropertyKey");function amo(t,e,r){return e.reduce((n,o)=>({...n,...smo(t,o,r)}),{})}a(amo,"FromPropertyKeys");function cmo(t,e,r){return amo(t,e.keys,r)}a(cmo,"FromMappedKey");function yVr(t,e,r){let n=cmo(t,e,r);return Qa(n)}a(yVr,"OmitFromMappedKey");p();p();p();function lmo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=CU(t[o],e,Bu(r));return n}a(lmo,"FromProperties");function umo(t,e,r){return lmo(t.properties,e,r)}a(umo,"FromMappedResult");function EVr(t,e,r){let n=umo(t,e,r);return Qa(n)}a(EVr,"PickFromMappedResult");function dmo(t,e){return t.map(r=>$Pt(r,e))}a(dmo,"FromIntersect");function fmo(t,e){return t.map(r=>$Pt(r,e))}a(fmo,"FromUnion");function pmo(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(pmo,"FromProperties");function hmo(t,e,r){let n=cf(t,[wd,"$id","required","properties"]),o=pmo(r,e);return rc(o,n)}a(hmo,"FromObject");function mmo(t){let e=t.reduce((r,n)=>W9e(n)?[...r,ca(n)]:r,[]);return tc(e)}a(mmo,"UnionFromPropertyKeys");function $Pt(t,e){return af(t)?Fy(dmo(t.allOf,e)):Ta(t)?tc(fmo(t.anyOf,e)):Fp(t)?hmo(t,e,t.properties):rc({})}a($Pt,"PickResolve");function CU(t,e,r){let n=Lp(e)?mmo(e):e,o=Rd(e)?oC(e):e,s=jf(t),c=jf(e);return Uu(t)?EVr(t,o,r):U1(e)?_Vr(t,e,r):s&&c?au("Pick",[t,n],r):!s&&c?au("Pick",[t,n],r):s&&!c?au("Pick",[t,n],r):wt({...$Pt(t,o),...r})}a(CU,"Pick");function gmo(t,e,r){return{[e]:CU(t,[e],Bu(r))}}a(gmo,"FromPropertyKey");function Amo(t,e,r){return e.reduce((n,o)=>({...n,...gmo(t,o,r)}),{})}a(Amo,"FromPropertyKeys");function ymo(t,e,r){return Amo(t,e.keys,r)}a(ymo,"FromMappedKey");function _Vr(t,e,r){let n=ymo(t,e,r);return Qa(n)}a(_Vr,"PickFromMappedKey");p();p();function Emo(t,e){return au("Partial",[au(t,e)])}a(Emo,"FromComputed");function _mo(t){return au("Partial",[VI(t)])}a(_mo,"FromRef");function vmo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=By(t[r]);return e}a(vmo,"FromProperties");function Cmo(t,e){let r=cf(t,[wd,"$id","required","properties"]),n=vmo(e);return rc(n,r)}a(Cmo,"FromObject");function vVr(t){return t.map(e=>CVr(e))}a(vVr,"FromRest");function CVr(t){return Mk(t)?Emo(t.target,t.parameters):jf(t)?_mo(t.$ref):af(t)?Fy(vVr(t.allOf)):Ta(t)?tc(vVr(t.anyOf)):Fp(t)?Cmo(t,t.properties):RW(t)||uB(t)||Bk(t)||F1(t)||OCe(t)||Fk(t)||dB(t)||LCe(t)||fB(t)?t:rc({})}a(CVr,"PartialResolve");function $oe(t,e){return Uu(t)?bVr(t,e):wt({...CVr(t),...e})}a($oe,"Partial");function bmo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=$oe(t[n],Bu(e));return r}a(bmo,"FromProperties");function Smo(t,e){return bmo(t.properties,e)}a(Smo,"FromMappedResult");function bVr(t,e){let r=Smo(t,e);return Qa(r)}a(bVr,"PartialFromMappedResult");p();p();function Tmo(t,e){return au("Required",[au(t,e)])}a(Tmo,"FromComputed");function Imo(t){return au("Required",[VI(t)])}a(Imo,"FromRef");function xmo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=cf(t[r],[hA]);return e}a(xmo,"FromProperties");function wmo(t,e){let r=cf(t,[wd,"$id","required","properties"]),n=xmo(e);return rc(n,r)}a(wmo,"FromObject");function SVr(t){return t.map(e=>TVr(e))}a(SVr,"FromRest");function TVr(t){return Mk(t)?Tmo(t.target,t.parameters):jf(t)?Imo(t.$ref):af(t)?Fy(SVr(t.allOf)):Ta(t)?tc(SVr(t.anyOf)):Fp(t)?wmo(t,t.properties):RW(t)||uB(t)||Bk(t)||F1(t)||OCe(t)||Fk(t)||dB(t)||LCe(t)||fB(t)?t:rc({})}a(TVr,"RequiredResolve");function Voe(t,e){return Uu(t)?IVr(t,e):wt({...TVr(t),...e})}a(Voe,"Required");function Rmo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Voe(t[n],e);return r}a(Rmo,"FromProperties");function kmo(t,e){return Rmo(t.properties,e)}a(kmo,"FromMappedResult");function IVr(t,e){let r=kmo(t,e);return Qa(r)}a(IVr,"RequiredFromMappedResult");function Pmo(t,e){return e.map(r=>jf(r)?VPt(t,r.$ref):j1(t,r))}a(Pmo,"DereferenceParameters");function VPt(t,e){return e in t?jf(t[e])?VPt(t,t[e].$ref):j1(t,t[e]):Xo()}a(VPt,"Dereference");function Dmo(t){return Uoe(t[0])}a(Dmo,"FromAwaited");function Nmo(t){return EU(t[0],t[1])}a(Nmo,"FromIndex");function Mmo(t){return Qoe(t[0])}a(Mmo,"FromKeyOf");function Omo(t){return $oe(t[0])}a(Omo,"FromPartial");function Lmo(t){return vU(t[0],t[1])}a(Lmo,"FromOmit");function Bmo(t){return CU(t[0],t[1])}a(Bmo,"FromPick");function Fmo(t){return Voe(t[0])}a(Fmo,"FromRequired");function Umo(t,e,r){let n=Pmo(t,r);return e==="Awaited"?Dmo(n):e==="Index"?Nmo(n):e==="KeyOf"?Mmo(n):e==="Partial"?Omo(n):e==="Omit"?Lmo(n):e==="Pick"?Bmo(n):e==="Required"?Fmo(n):Xo()}a(Umo,"FromComputed");function Qmo(t,e){return Poe(j1(t,e))}a(Qmo,"FromArray");function qmo(t,e){return Doe(j1(t,e))}a(qmo,"FromAsyncIterator");function jmo(t,e,r){return Noe(WCe(t,e),j1(t,r))}a(jmo,"FromConstructor");function Hmo(t,e,r){return tM(WCe(t,e),j1(t,r))}a(Hmo,"FromFunction");function Gmo(t,e){return Fy(WCe(t,e))}a(Gmo,"FromIntersect");function $mo(t,e){return Foe(j1(t,e))}a($mo,"FromIterator");function Vmo(t,e){return rc(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:j1(t,e[n])}),{}))}a(Vmo,"FromObject");function Wmo(t,e){let[r,n]=[j1(t,pUe(e)),fUe(e)],o=Ioe(e);return o.patternProperties[n]=r,o}a(Wmo,"FromRecord");function zmo(t,e){return jf(e)?{...VPt(t,e.$ref),[wd]:e[wd]}:e}a(zmo,"FromTransform");function Ymo(t,e){return GI(WCe(t,e))}a(Ymo,"FromTuple");function Kmo(t,e){return tc(WCe(t,e))}a(Kmo,"FromUnion");function WCe(t,e){return e.map(r=>j1(t,r))}a(WCe,"FromTypes");function j1(t,e){return iC(e)?wt(j1(t,cf(e,[hA])),e):woe(e)?wt(j1(t,cf(e,[Dk])),e):ec(e)?wt(zmo(t,e),e):Nk(e)?wt(Qmo(t,e.items),e):wW(e)?wt(qmo(t,e.items),e):Mk(e)?wt(Umo(t,e.target,e.parameters)):Ok(e)?wt(jmo(t,e.parameters,e.returns),e):Lk(e)?wt(Hmo(t,e.parameters,e.returns),e):af(e)?wt(Gmo(t,e.allOf),e):kW(e)?wt($mo(t,e.items),e):Fp(e)?wt(Vmo(t,e.properties),e):DW(e)?wt(Wmo(t,e)):q1(e)?wt(Ymo(t,e.items||[]),e):Ta(e)?wt(Kmo(t,e.anyOf),e):e}a(j1,"FromType");function Jmo(t,e){return e in t?j1(t,t[e]):Xo()}a(Jmo,"ComputeType");function xVr(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:Jmo(t,r)}),{})}a(xVr,"ComputeModuleProperties");var WPt=class{static{a(this,"TModule")}constructor(e){let r=xVr(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:wt(this.$defs[e],r)};return wt({[Tt]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};function wVr(t){return new WPt(t)}a(wVr,"Module");p();function RVr(t,e){return wt({[Tt]:"Not",not:t},e)}a(RVr,"Not");p();function kVr(t,e){return Lk(t)?GI(t.parameters,e):Xo()}a(kVr,"Parameters");p();var Zmo=0;function PVr(t,e={}){Bp(e.$id)&&(e.$id=`T${Zmo++}`);let r=Ioe(t({[Tt]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,wt({[jI]:"Recursive",...r},e)}a(PVr,"Recursive");p();function DVr(t,e){let r=Ql(t)?new globalThis.RegExp(t):t;return wt({[Tt]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(DVr,"RegExp");p();function Xmo(t){return af(t)?t.allOf:Ta(t)?t.anyOf:q1(t)?t.items??[]:[]}a(Xmo,"RestResolve");function NVr(t){return Xmo(t)}a(NVr,"Rest");p();function MVr(t,e){return Lk(t)?wt(t.returns,e):Xo(e)}a(MVr,"ReturnType");p();var zPt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new YPt(this.schema,e)}},YPt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[wd].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[wd].Decode(c)),"Decode")};return{...r,[wd]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[wd]:n}}Encode(e){return ec(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function OVr(t){return new zPt(t)}a(OVr,"Transform");p();function LVr(t={}){return wt({[Tt]:t[Tt]??"Unsafe"},t)}a(LVr,"Unsafe");p();function BVr(t){return wt({[Tt]:"Void",type:"void"},t)}a(BVr,"Void");p();var KPt={};ki(KPt,{Any:()=>yU,Argument:()=>_$r,Array:()=>Poe,AsyncIterator:()=>Doe,Awaited:()=>Uoe,BigInt:()=>Boe,Boolean:()=>J9e,Capitalize:()=>pVr,Composite:()=>U$r,Const:()=>Q$r,Constructor:()=>Noe,ConstructorParameters:()=>q$r,Date:()=>rUe,Enum:()=>j$r,Exclude:()=>Hoe,Extends:()=>joe,Extract:()=>Goe,Function:()=>tM,Index:()=>EU,InstanceType:()=>sVr,Instantiate:()=>cVr,Integer:()=>lVr,Intersect:()=>Fy,Iterator:()=>Foe,KeyOf:()=>Qoe,Literal:()=>ca,Lowercase:()=>hVr,Mapped:()=>N$r,Module:()=>wVr,Never:()=>Xo,Not:()=>RVr,Null:()=>nUe,Number:()=>HI,Object:()=>rc,Omit:()=>vU,Optional:()=>By,Parameters:()=>kVr,Partial:()=>$oe,Pick:()=>CU,Promise:()=>eUe,Readonly:()=>sC,ReadonlyOptional:()=>uUe,Record:()=>dUe,Recursive:()=>PVr,Ref:()=>VI,RegExp:()=>DVr,Required:()=>Voe,Rest:()=>NVr,ReturnType:()=>MVr,String:()=>C_,Symbol:()=>iUe,TemplateLiteral:()=>Z9e,Transform:()=>OVr,Tuple:()=>GI,Uint8Array:()=>sUe,Uncapitalize:()=>mVr,Undefined:()=>oUe,Union:()=>tc,Unknown:()=>Qk,Unsafe:()=>LVr,Uppercase:()=>gVr,Void:()=>BVr});p();var S=KPt;p();p();function e0o(t){switch(t.errorType){case St.ArrayContains:return"Expected array to contain at least one matching value";case St.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case St.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case St.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case St.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case St.ArrayUniqueItems:return"Expected array elements to be unique";case St.Array:return"Expected array";case St.AsyncIterator:return"Expected AsyncIterator";case St.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case St.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case St.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case St.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case St.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case St.BigInt:return"Expected bigint";case St.Boolean:return"Expected boolean";case St.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case St.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case St.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case St.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case St.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case St.Date:return"Expected Date";case St.Function:return"Expected function";case St.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case St.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case St.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case St.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case St.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case St.Integer:return"Expected integer";case St.IntersectUnevaluatedProperties:return"Unexpected property";case St.Intersect:return"Expected all values to match";case St.Iterator:return"Expected Iterator";case St.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case St.Never:return"Never";case St.Not:return"Value should not match";case St.Null:return"Expected null";case St.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case St.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case St.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case St.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case St.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case St.Number:return"Expected number";case St.Object:return"Expected object";case St.ObjectAdditionalProperties:return"Unexpected property";case St.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case St.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case St.ObjectRequiredProperty:return"Expected required property";case St.Promise:return"Expected Promise";case St.RegExp:return"Expected string to match regular expression";case St.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case St.StringFormat:return`Expected string to match '${t.schema.format}' format`;case St.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case St.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case St.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case St.String:return"Expected string";case St.Symbol:return"Expected symbol";case St.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case St.Tuple:return"Expected tuple";case St.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case St.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case St.Uint8Array:return"Expected Uint8Array";case St.Undefined:return"Expected undefined";case St.Union:return"Expected union value";case St.Void:return"Expected void";case St.Kind:return`Expected kind '${t.schema[Tt]}'`;default:return"Unknown error type"}}a(e0o,"DefaultErrorFunction");var t0o=e0o;function FVr(){return t0o}a(FVr,"GetErrorFunction");p();var JPt=class extends qi{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};function r0o(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new JPt(t);return Ia(r,e)}a(r0o,"Resolve");function Y0(t,e){return!Sa(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(Y0,"Pushref");function Ia(t,e){return t[Tt]==="This"||t[Tt]==="Ref"?r0o(t,e):t}a(Ia,"Deref");p();var ZPt=class extends qi{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}},H1;(function(t){t[t.Undefined=0]="Undefined",t[t.Null=1]="Null",t[t.Boolean=2]="Boolean",t[t.Number=3]="Number",t[t.String=4]="String",t[t.Object=5]="Object",t[t.Array=6]="Array",t[t.Date=7]="Date",t[t.Uint8Array=8]="Uint8Array",t[t.Symbol=9]="Symbol",t[t.BigInt=10]="BigInt"})(H1||(H1={}));var Woe=BigInt("14695981039346656037"),[n0o,i0o]=[BigInt("1099511628211"),BigInt("18446744073709551616")],o0o=Array.from({length:256}).map((t,e)=>BigInt(e)),UVr=new Float64Array(1),QVr=new DataView(UVr.buffer),qVr=new Uint8Array(UVr.buffer);function*s0o(t){let e=t===0?1:Math.ceil(Math.floor(Math.log2(t)+1)/8);for(let r=0;r>8*(e-1-r)&255}a(s0o,"NumberToBytes");function a0o(t){Qy(H1.Array);for(let e of t)zoe(e)}a(a0o,"ArrayType");function c0o(t){Qy(H1.Boolean),Qy(t?1:0)}a(c0o,"BooleanType");function l0o(t){Qy(H1.BigInt),QVr.setBigInt64(0,t);for(let e of qVr)Qy(e)}a(l0o,"BigIntType");function u0o(t){Qy(H1.Date),zoe(t.getTime())}a(u0o,"DateType");function d0o(t){Qy(H1.Null)}a(d0o,"NullType");function f0o(t){Qy(H1.Number),QVr.setFloat64(0,t);for(let e of qVr)Qy(e)}a(f0o,"NumberType");function p0o(t){Qy(H1.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())zoe(e),zoe(t[e])}a(p0o,"ObjectType");function h0o(t){Qy(H1.String);for(let e=0;e=t.minItems)||zs(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!K0(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=bU(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(zs(t.contains)||ai(t.minContains)||ai(t.maxContains)))return!0;let n=zs(t.contains)?t.contains:Xo(),o=r.reduce((s,c)=>K0(n,e,c)?s+1:s,0);return!(o===0||ai(t.minContains)&&ot.maxContains)}a(v0o,"FromArray");function C0o(t,e,r){return H9e(r)}a(C0o,"FromAsyncIterator");function b0o(t,e,r){return!(!pA(r)||zs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||zs(t.maximum)&&!(r<=t.maximum)||zs(t.minimum)&&!(r>=t.minimum)||zs(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(b0o,"FromBigInt");function S0o(t,e,r){return eM(r)}a(S0o,"FromBoolean");function T0o(t,e,r){return K0(t.returns,e,r.prototype)}a(T0o,"FromConstructor");function I0o(t,e,r){return!(!__(r)||zs(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||zs(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||zs(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||zs(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(I0o,"FromDate");function x0o(t,e,r){return pU(r)}a(x0o,"FromFunction");function w0o(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return K0(o,[...e,...n],r)}a(w0o,"FromImport");function R0o(t,e,r){return!(!V9e(r)||zs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||zs(t.maximum)&&!(r<=t.maximum)||zs(t.minimum)&&!(r>=t.minimum)||zs(t.multipleOf)&&r%t.multipleOf!==0)}a(R0o,"FromInteger");function k0o(t,e,r){let n=t.allOf.every(o=>K0(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp(mB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if(Rd(t.unevaluatedProperties)){let o=new RegExp(mB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||K0(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(k0o,"FromIntersect");function P0o(t,e,r){return G9e(r)}a(P0o,"FromIterator");function D0o(t,e,r){return r===t.const}a(D0o,"FromLiteral");function N0o(t,e,r){return!1}a(N0o,"FromNever");function M0o(t,e,r){return!K0(t.not,e,r)}a(M0o,"FromNot");function O0o(t,e,r){return cB(r)}a(O0o,"FromNull");function L0o(t,e,r){return!(!su.IsNumberLike(r)||zs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||zs(t.minimum)&&!(r>=t.minimum)||zs(t.maximum)&&!(r<=t.maximum)||zs(t.multipleOf)&&r%t.multipleOf!==0)}a(L0o,"FromNumber");function B0o(t,e,r){if(!su.IsObjectLike(r)||zs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||zs(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let n=Object.getOwnPropertyNames(t.properties);for(let o of n){let s=t.properties[o];if(t.required&&t.required.includes(o)){if(!K0(s,e,r[o])||(gB(s)||y0o(s))&&!(o in r))return!1}else if(su.IsExactOptionalProperty(r,o)&&!K0(s,e,r[o]))return!1}if(t.additionalProperties===!1){let o=Object.getOwnPropertyNames(r);return t.required&&t.required.length===n.length&&o.length===n.length?!0:o.every(s=>n.includes(s))}else return typeof t.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(s=>n.includes(s)||K0(t.additionalProperties,e,r[s])):!0}a(B0o,"FromObject");function F0o(t,e,r){return $9e(r)}a(F0o,"FromPromise");function U0o(t,e,r){if(!su.IsRecordLike(r)||zs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||zs(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let[n,o]=Object.entries(t.patternProperties)[0],s=new RegExp(n),c=Object.entries(r).every(([d,f])=>s.test(d)?K0(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:K0(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(U0o,"FromRecord");function Q0o(t,e,r){return K0(Ia(t,e),e,r)}a(Q0o,"FromRef");function q0o(t,e,r){let n=new RegExp(t.source,t.flags);return zs(t.minLength)&&!(r.length>=t.minLength)||zs(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(q0o,"FromRegExp");function j0o(t,e,r){return!Sa(r)||zs(t.minLength)&&!(r.length>=t.minLength)||zs(t.maxLength)&&!(r.length<=t.maxLength)||zs(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:zs(t.format)?Uk.Has(t.format)?Uk.Get(t.format)(r):!1:!0}a(j0o,"FromString");function H0o(t,e,r){return lB(r)}a(H0o,"FromSymbol");function G0o(t,e,r){return Sa(r)&&new RegExp(t.pattern).test(r)}a(G0o,"FromTemplateLiteral");function $0o(t,e,r){return K0(Ia(t,e),e,r)}a($0o,"FromThis");function V0o(t,e,r){if(!Pi(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nK0(n,e,r))}a(z0o,"FromUnion");function Y0o(t,e,r){return!(!xoe(r)||zs(t.maxByteLength)&&!(r.length<=t.maxByteLength)||zs(t.minByteLength)&&!(r.length>=t.minByteLength))}a(Y0o,"FromUint8Array");function K0o(t,e,r){return!0}a(K0o,"FromUnknown");function J0o(t,e,r){return su.IsVoidLike(r)}a(J0o,"FromVoid");function Z0o(t,e,r){return v_.Has(t[Tt])?v_.Get(t[Tt])(t,r):!1}a(Z0o,"FromKind");function K0(t,e,r){let n=zs(t.$id)?Y0(t,e):e,o=t;switch(o[Tt]){case"Any":return E0o(o,n,r);case"Argument":return _0o(o,n,r);case"Array":return v0o(o,n,r);case"AsyncIterator":return C0o(o,n,r);case"BigInt":return b0o(o,n,r);case"Boolean":return S0o(o,n,r);case"Constructor":return T0o(o,n,r);case"Date":return I0o(o,n,r);case"Function":return x0o(o,n,r);case"Import":return w0o(o,n,r);case"Integer":return R0o(o,n,r);case"Intersect":return k0o(o,n,r);case"Iterator":return P0o(o,n,r);case"Literal":return D0o(o,n,r);case"Never":return N0o(o,n,r);case"Not":return M0o(o,n,r);case"Null":return O0o(o,n,r);case"Number":return L0o(o,n,r);case"Object":return B0o(o,n,r);case"Promise":return F0o(o,n,r);case"Record":return U0o(o,n,r);case"Ref":return Q0o(o,n,r);case"RegExp":return q0o(o,n,r);case"String":return j0o(o,n,r);case"Symbol":return H0o(o,n,r);case"TemplateLiteral":return G0o(o,n,r);case"This":return $0o(o,n,r);case"Tuple":return V0o(o,n,r);case"Undefined":return W0o(o,n,r);case"Union":return z0o(o,n,r);case"Uint8Array":return Y0o(o,n,r);case"Unknown":return K0o(o,n,r);case"Void":return J0o(o,n,r);default:if(!v_.Has(o[Tt]))throw new XPt(o);return Z0o(o,n,r)}}a(K0,"Visit");function es(...t){return t.length===3?K0(t[0],t[1],t[2]):K0(t[0],[],t[1])}a(es,"Check");var St;(function(t){t[t.ArrayContains=0]="ArrayContains",t[t.ArrayMaxContains=1]="ArrayMaxContains",t[t.ArrayMaxItems=2]="ArrayMaxItems",t[t.ArrayMinContains=3]="ArrayMinContains",t[t.ArrayMinItems=4]="ArrayMinItems",t[t.ArrayUniqueItems=5]="ArrayUniqueItems",t[t.Array=6]="Array",t[t.AsyncIterator=7]="AsyncIterator",t[t.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",t[t.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",t[t.BigIntMaximum=10]="BigIntMaximum",t[t.BigIntMinimum=11]="BigIntMinimum",t[t.BigIntMultipleOf=12]="BigIntMultipleOf",t[t.BigInt=13]="BigInt",t[t.Boolean=14]="Boolean",t[t.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",t[t.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",t[t.DateMaximumTimestamp=17]="DateMaximumTimestamp",t[t.DateMinimumTimestamp=18]="DateMinimumTimestamp",t[t.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",t[t.Date=20]="Date",t[t.Function=21]="Function",t[t.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",t[t.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",t[t.IntegerMaximum=24]="IntegerMaximum",t[t.IntegerMinimum=25]="IntegerMinimum",t[t.IntegerMultipleOf=26]="IntegerMultipleOf",t[t.Integer=27]="Integer",t[t.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",t[t.Intersect=29]="Intersect",t[t.Iterator=30]="Iterator",t[t.Kind=31]="Kind",t[t.Literal=32]="Literal",t[t.Never=33]="Never",t[t.Not=34]="Not",t[t.Null=35]="Null",t[t.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",t[t.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",t[t.NumberMaximum=38]="NumberMaximum",t[t.NumberMinimum=39]="NumberMinimum",t[t.NumberMultipleOf=40]="NumberMultipleOf",t[t.Number=41]="Number",t[t.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",t[t.ObjectMaxProperties=43]="ObjectMaxProperties",t[t.ObjectMinProperties=44]="ObjectMinProperties",t[t.ObjectRequiredProperty=45]="ObjectRequiredProperty",t[t.Object=46]="Object",t[t.Promise=47]="Promise",t[t.RegExp=48]="RegExp",t[t.StringFormatUnknown=49]="StringFormatUnknown",t[t.StringFormat=50]="StringFormat",t[t.StringMaxLength=51]="StringMaxLength",t[t.StringMinLength=52]="StringMinLength",t[t.StringPattern=53]="StringPattern",t[t.String=54]="String",t[t.Symbol=55]="Symbol",t[t.TupleLength=56]="TupleLength",t[t.Tuple=57]="Tuple",t[t.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",t[t.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",t[t.Uint8Array=60]="Uint8Array",t[t.Undefined=61]="Undefined",t[t.Union=62]="Union",t[t.Void=63]="Void"})(St||(St={}));var e2t=class extends qi{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};function AB(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(AB,"EscapeKey");function Ys(t){return t!==void 0}a(Ys,"IsDefined");var SU=class{static{a(this,"ValueErrorIterator")}constructor(e){this.iterator=e}[Symbol.iterator](){return this.iterator}First(){let e=this.iterator.next();return e.done?void 0:e.value}};function sn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:FVr()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(sn,"Create");function*X0o(t,e,r,n){}a(X0o,"FromAny");function*ego(t,e,r,n){}a(ego,"FromArgument");function*tgo(t,e,r,n){if(!Pi(n))return yield sn(St.Array,t,r,n);Ys(t.minItems)&&!(n.length>=t.minItems)&&(yield sn(St.ArrayMinItems,t,r,n)),Ys(t.maxItems)&&!(n.length<=t.maxItems)&&(yield sn(St.ArrayMaxItems,t,r,n));for(let c=0;cJ0(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield sn(St.ArrayContains,t,r,n)),ai(t.minContains)&&st.maxContains&&(yield sn(St.ArrayMaxContains,t,r,n))}a(tgo,"FromArray");function*rgo(t,e,r,n){H9e(n)||(yield sn(St.AsyncIterator,t,r,n))}a(rgo,"FromAsyncIterator");function*ngo(t,e,r,n){if(!pA(n))return yield sn(St.BigInt,t,r,n);Ys(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(St.BigIntExclusiveMinimum,t,r,n)),Ys(t.maximum)&&!(n<=t.maximum)&&(yield sn(St.BigIntMaximum,t,r,n)),Ys(t.minimum)&&!(n>=t.minimum)&&(yield sn(St.BigIntMinimum,t,r,n)),Ys(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield sn(St.BigIntMultipleOf,t,r,n))}a(ngo,"FromBigInt");function*igo(t,e,r,n){eM(n)||(yield sn(St.Boolean,t,r,n))}a(igo,"FromBoolean");function*ogo(t,e,r,n){yield*J0(t.returns,e,r,n.prototype)}a(ogo,"FromConstructor");function*sgo(t,e,r,n){if(!__(n))return yield sn(St.Date,t,r,n);Ys(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield sn(St.DateExclusiveMinimumTimestamp,t,r,n)),Ys(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield sn(St.DateMaximumTimestamp,t,r,n)),Ys(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield sn(St.DateMinimumTimestamp,t,r,n)),Ys(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield sn(St.DateMultipleOfTimestamp,t,r,n))}a(sgo,"FromDate");function*ago(t,e,r,n){pU(n)||(yield sn(St.Function,t,r,n))}a(ago,"FromFunction");function*cgo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*J0(s,[...e,...o],r,n)}a(cgo,"FromImport");function*lgo(t,e,r,n){if(!V9e(n))return yield sn(St.Integer,t,r,n);Ys(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(St.IntegerExclusiveMinimum,t,r,n)),Ys(t.maximum)&&!(n<=t.maximum)&&(yield sn(St.IntegerMaximum,t,r,n)),Ys(t.minimum)&&!(n>=t.minimum)&&(yield sn(St.IntegerMinimum,t,r,n)),Ys(t.multipleOf)&&n%t.multipleOf!==0&&(yield sn(St.IntegerMultipleOf,t,r,n))}a(lgo,"FromInteger");function*ugo(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of J0(s,e,r,n))o=!0,yield c;if(o)return yield sn(St.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp(mB(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield sn(St.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp(mB(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=J0(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(ugo,"FromIntersect");function*dgo(t,e,r,n){G9e(n)||(yield sn(St.Iterator,t,r,n))}a(dgo,"FromIterator");function*fgo(t,e,r,n){n!==t.const&&(yield sn(St.Literal,t,r,n))}a(fgo,"FromLiteral");function*pgo(t,e,r,n){yield sn(St.Never,t,r,n)}a(pgo,"FromNever");function*hgo(t,e,r,n){J0(t.not,e,r,n).next().done===!0&&(yield sn(St.Not,t,r,n))}a(hgo,"FromNot");function*mgo(t,e,r,n){cB(n)||(yield sn(St.Null,t,r,n))}a(mgo,"FromNull");function*ggo(t,e,r,n){if(!su.IsNumberLike(n))return yield sn(St.Number,t,r,n);Ys(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(St.NumberExclusiveMinimum,t,r,n)),Ys(t.maximum)&&!(n<=t.maximum)&&(yield sn(St.NumberMaximum,t,r,n)),Ys(t.minimum)&&!(n>=t.minimum)&&(yield sn(St.NumberMinimum,t,r,n)),Ys(t.multipleOf)&&n%t.multipleOf!==0&&(yield sn(St.NumberMultipleOf,t,r,n))}a(ggo,"FromNumber");function*Ago(t,e,r,n){if(!su.IsObjectLike(n))return yield sn(St.Object,t,r,n);Ys(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield sn(St.ObjectMinProperties,t,r,n)),Ys(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield sn(St.ObjectMaxProperties,t,r,n));let o=Array.isArray(t.required)?t.required:[],s=Object.getOwnPropertyNames(t.properties),c=Object.getOwnPropertyNames(n);for(let l of o)c.includes(l)||(yield sn(St.ObjectRequiredProperty,t.properties[l],`${r}/${AB(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield sn(St.ObjectAdditionalProperties,t,`${r}/${AB(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*J0(t.additionalProperties,e,`${r}/${AB(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*J0(u,e,`${r}/${AB(l)}`,n[l]),gB(t)&&!(l in n)&&(yield sn(St.ObjectRequiredProperty,u,`${r}/${AB(l)}`,void 0))):su.IsExactOptionalProperty(n,l)&&(yield*J0(u,e,`${r}/${AB(l)}`,n[l]))}}a(Ago,"FromObject");function*ygo(t,e,r,n){$9e(n)||(yield sn(St.Promise,t,r,n))}a(ygo,"FromPromise");function*Ego(t,e,r,n){if(!su.IsRecordLike(n))return yield sn(St.Object,t,r,n);Ys(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield sn(St.ObjectMinProperties,t,r,n)),Ys(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield sn(St.ObjectMaxProperties,t,r,n));let[o,s]=Object.entries(t.patternProperties)[0],c=new RegExp(o);for(let[l,u]of Object.entries(n))c.test(l)&&(yield*J0(s,e,`${r}/${AB(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*J0(t.additionalProperties,e,`${r}/${AB(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield sn(St.ObjectAdditionalProperties,t,`${r}/${AB(l)}`,u)}}a(Ego,"FromRecord");function*_go(t,e,r,n){yield*J0(Ia(t,e),e,r,n)}a(_go,"FromRef");function*vgo(t,e,r,n){if(!Sa(n))return yield sn(St.String,t,r,n);if(Ys(t.minLength)&&!(n.length>=t.minLength)&&(yield sn(St.StringMinLength,t,r,n)),Ys(t.maxLength)&&!(n.length<=t.maxLength)&&(yield sn(St.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield sn(St.RegExp,t,r,n)}a(vgo,"FromRegExp");function*Cgo(t,e,r,n){if(!Sa(n))return yield sn(St.String,t,r,n);Ys(t.minLength)&&!(n.length>=t.minLength)&&(yield sn(St.StringMinLength,t,r,n)),Ys(t.maxLength)&&!(n.length<=t.maxLength)&&(yield sn(St.StringMaxLength,t,r,n)),Sa(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield sn(St.StringPattern,t,r,n))),Sa(t.format)&&(Uk.Has(t.format)?Uk.Get(t.format)(n)||(yield sn(St.StringFormat,t,r,n)):yield sn(St.StringFormatUnknown,t,r,n))}a(Cgo,"FromString");function*bgo(t,e,r,n){lB(n)||(yield sn(St.Symbol,t,r,n))}a(bgo,"FromSymbol");function*Sgo(t,e,r,n){if(!Sa(n))return yield sn(St.String,t,r,n);new RegExp(t.pattern).test(n)||(yield sn(St.StringPattern,t,r,n))}a(Sgo,"FromTemplateLiteral");function*Tgo(t,e,r,n){yield*J0(Ia(t,e),e,r,n)}a(Tgo,"FromThis");function*Igo(t,e,r,n){if(!Pi(n))return yield sn(St.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield sn(St.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield sn(St.TupleLength,t,r,n);if(t.items)for(let o=0;onew SU(J0(s,e,r,n)));yield sn(St.Union,t,r,n,o)}a(wgo,"FromUnion");function*Rgo(t,e,r,n){if(!xoe(n))return yield sn(St.Uint8Array,t,r,n);Ys(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield sn(St.Uint8ArrayMaxByteLength,t,r,n)),Ys(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield sn(St.Uint8ArrayMinByteLength,t,r,n))}a(Rgo,"FromUint8Array");function*kgo(t,e,r,n){}a(kgo,"FromUnknown");function*Pgo(t,e,r,n){su.IsVoidLike(n)||(yield sn(St.Void,t,r,n))}a(Pgo,"FromVoid");function*Dgo(t,e,r,n){v_.Get(t[Tt])(t,n)||(yield sn(St.Kind,t,r,n))}a(Dgo,"FromKind");function*J0(t,e,r,n){let o=Ys(t.$id)?[...e,t]:e,s=t;switch(s[Tt]){case"Any":return yield*X0o(s,o,r,n);case"Argument":return yield*ego(s,o,r,n);case"Array":return yield*tgo(s,o,r,n);case"AsyncIterator":return yield*rgo(s,o,r,n);case"BigInt":return yield*ngo(s,o,r,n);case"Boolean":return yield*igo(s,o,r,n);case"Constructor":return yield*ogo(s,o,r,n);case"Date":return yield*sgo(s,o,r,n);case"Function":return yield*ago(s,o,r,n);case"Import":return yield*cgo(s,o,r,n);case"Integer":return yield*lgo(s,o,r,n);case"Intersect":return yield*ugo(s,o,r,n);case"Iterator":return yield*dgo(s,o,r,n);case"Literal":return yield*fgo(s,o,r,n);case"Never":return yield*pgo(s,o,r,n);case"Not":return yield*hgo(s,o,r,n);case"Null":return yield*mgo(s,o,r,n);case"Number":return yield*ggo(s,o,r,n);case"Object":return yield*Ago(s,o,r,n);case"Promise":return yield*ygo(s,o,r,n);case"Record":return yield*Ego(s,o,r,n);case"Ref":return yield*_go(s,o,r,n);case"RegExp":return yield*vgo(s,o,r,n);case"String":return yield*Cgo(s,o,r,n);case"Symbol":return yield*bgo(s,o,r,n);case"TemplateLiteral":return yield*Sgo(s,o,r,n);case"This":return yield*Tgo(s,o,r,n);case"Tuple":return yield*Igo(s,o,r,n);case"Undefined":return yield*xgo(s,o,r,n);case"Union":return yield*wgo(s,o,r,n);case"Uint8Array":return yield*Rgo(s,o,r,n);case"Unknown":return yield*kgo(s,o,r,n);case"Void":return yield*Pgo(s,o,r,n);default:if(!v_.Has(s[Tt]))throw new e2t(t);return yield*Dgo(s,o,r,n)}}a(J0,"Visit");function nM(...t){let e=t.length===3?J0(t[0],t[1],"",t[2]):J0(t[0],[],"",t[1]);return new SU(e)}a(nM,"Errors");p();p();var Yoe=class extends qi{static{a(this,"TransformDecodeCheckError")}constructor(e,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=e,this.value=r,this.error=n}},t2t=class extends qi{static{a(this,"TransformDecodeError")}constructor(e,r,n,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=e,this.path=r,this.value=n,this.error=o}};function kd(t,e,r){try{return ec(t)?t[wd].Decode(r):r}catch(n){throw new t2t(t,e,r,n)}}a(kd,"Default");function Ngo(t,e,r,n){return Pi(n)?kd(t,r,n.map((o,s)=>Hk(t.items,e,`${r}/${s}`,o))):kd(t,r,n)}a(Ngo,"FromArray");function Mgo(t,e,r,n){if(!bo(n)||B1(n))return kd(t,r,n);let o=tUe(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=Hk(h,e,`${r}/${f}`,c[f]));if(!ec(t.unevaluatedProperties))return kd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=kd(u,`${r}/${f}`,d[f]));return kd(t,r,d)}a(Mgo,"FromIntersect");function Ogo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=Hk(s,[...e,...o],r,n);return kd(t,r,c)}a(Ogo,"FromImport");function Lgo(t,e,r,n){return kd(t,r,Hk(t.not,e,r,n))}a(Lgo,"FromNot");function Bgo(t,e,r,n){if(!bo(n))return kd(t,r,n);let o=aC(t),s={...n};for(let d of o)Qi(s,d)&&(Fu(s[d])&&(!fB(t.properties[d])||su.IsExactOptionalProperty(s,d))||(s[d]=Hk(t.properties[d],e,`${r}/${d}`,s[d])));if(!Rd(t.additionalProperties))return kd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=kd(l,`${r}/${d}`,u[d]));return kd(t,r,u)}a(Bgo,"FromObject");function Fgo(t,e,r,n){if(!bo(n))return kd(t,r,n);let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=new RegExp(o),c={...n};for(let f of Object.getOwnPropertyNames(n))s.test(f)&&(c[f]=Hk(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!Rd(t.additionalProperties))return kd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=kd(u,`${r}/${f}`,d[f]));return kd(t,r,d)}a(Fgo,"FromRecord");function Ugo(t,e,r,n){let o=Ia(t,e);return kd(t,r,Hk(o,e,r,n))}a(Ugo,"FromRef");function Qgo(t,e,r,n){let o=Ia(t,e);return kd(t,r,Hk(o,e,r,n))}a(Qgo,"FromThis");function qgo(t,e,r,n){return Pi(n)&&Pi(t.items)?kd(t,r,t.items.map((o,s)=>Hk(o,e,`${r}/${s}`,n[s]))):kd(t,r,n)}a(qgo,"FromTuple");function jgo(t,e,r,n){for(let o of t.anyOf){if(!es(o,e,n))continue;let s=Hk(o,e,r,n);return kd(t,r,s)}return kd(t,r,n)}a(jgo,"FromUnion");function Hk(t,e,r,n){let o=Y0(t,e),s=t;switch(t[Tt]){case"Array":return Ngo(s,o,r,n);case"Import":return Ogo(s,o,r,n);case"Intersect":return Mgo(s,o,r,n);case"Not":return Lgo(s,o,r,n);case"Object":return Bgo(s,o,r,n);case"Record":return Fgo(s,o,r,n);case"Ref":return Ugo(s,o,r,n);case"Symbol":return kd(s,r,n);case"This":return Qgo(s,o,r,n);case"Tuple":return qgo(s,o,r,n);case"Union":return jgo(s,o,r,n);default:return kd(s,r,n)}}a(Hk,"Visit");function Koe(t,e,r){return Hk(t,e,"",r)}a(Koe,"TransformDecode");p();var Joe=class extends qi{static{a(this,"TransformEncodeCheckError")}constructor(e,r,n){super("The encoded value does not match the expected schema"),this.schema=e,this.value=r,this.error=n}},r2t=class extends qi{static{a(this,"TransformEncodeError")}constructor(e,r,n,o){super(`${o instanceof Error?o.message:"Unknown error"}`),this.schema=e,this.path=r,this.value=n,this.error=o}};function mA(t,e,r){try{return ec(t)?t[wd].Encode(r):r}catch(n){throw new r2t(t,e,r,n)}}a(mA,"Default");function Hgo(t,e,r,n){let o=mA(t,r,n);return Pi(o)?o.map((s,c)=>Gk(t.items,e,`${r}/${c}`,s)):o}a(Hgo,"FromArray");function Ggo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=mA(t,r,n);return Gk(s,[...e,...o],r,c)}a(Ggo,"FromImport");function $go(t,e,r,n){let o=mA(t,r,n);if(!bo(n)||B1(n))return o;let s=tUe(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=Gk(m,e,`${r}/${h}`,l[h]));if(!ec(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=mA(d,`${r}/${h}`,f[h]));return f}a($go,"FromIntersect");function Vgo(t,e,r,n){return mA(t.not,r,mA(t,r,n))}a(Vgo,"FromNot");function Wgo(t,e,r,n){let o=mA(t,r,n);if(!bo(o))return o;let s=aC(t),c={...o};for(let f of s)Qi(c,f)&&(Fu(c[f])&&(!fB(t.properties[f])||su.IsExactOptionalProperty(c,f))||(c[f]=Gk(t.properties[f],e,`${r}/${f}`,c[f])));if(!Rd(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=mA(u,`${r}/${f}`,d[f]));return d}a(Wgo,"FromObject");function zgo(t,e,r,n){let o=mA(t,r,n);if(!bo(n))return o;let s=Object.getOwnPropertyNames(t.patternProperties)[0],c=new RegExp(s),l={...o};for(let h of Object.getOwnPropertyNames(n))c.test(h)&&(l[h]=Gk(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!Rd(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=mA(d,`${r}/${h}`,f[h]));return f}a(zgo,"FromRecord");function Ygo(t,e,r,n){let o=Ia(t,e),s=Gk(o,e,r,n);return mA(t,r,s)}a(Ygo,"FromRef");function Kgo(t,e,r,n){let o=Ia(t,e),s=Gk(o,e,r,n);return mA(t,r,s)}a(Kgo,"FromThis");function Jgo(t,e,r,n){let o=mA(t,r,n);return Pi(t.items)?t.items.map((s,c)=>Gk(s,e,`${r}/${c}`,o[c])):[]}a(Jgo,"FromTuple");function Zgo(t,e,r,n){for(let o of t.anyOf){if(!es(o,e,n))continue;let s=Gk(o,e,r,n);return mA(t,r,s)}for(let o of t.anyOf){let s=Gk(o,e,r,n);if(es(t,e,s))return mA(t,r,s)}return mA(t,r,n)}a(Zgo,"FromUnion");function Gk(t,e,r,n){let o=Y0(t,e),s=t;switch(t[Tt]){case"Array":return Hgo(s,o,r,n);case"Import":return Ggo(s,o,r,n);case"Intersect":return $go(s,o,r,n);case"Not":return Vgo(s,o,r,n);case"Object":return Wgo(s,o,r,n);case"Record":return zgo(s,o,r,n);case"Ref":return Ygo(s,o,r,n);case"This":return Kgo(s,o,r,n);case"Tuple":return Jgo(s,o,r,n);case"Union":return Zgo(s,o,r,n);default:return mA(s,r,n)}}a(Gk,"Visit");function Zoe(t,e,r){return Gk(t,e,"",r)}a(Zoe,"TransformEncode");p();function Xgo(t,e){return ec(t)||Hm(t.items,e)}a(Xgo,"FromArray");function eAo(t,e){return ec(t)||Hm(t.items,e)}a(eAo,"FromAsyncIterator");function tAo(t,e){return ec(t)||Hm(t.returns,e)||t.parameters.some(r=>Hm(r,e))}a(tAo,"FromConstructor");function rAo(t,e){return ec(t)||Hm(t.returns,e)||t.parameters.some(r=>Hm(r,e))}a(rAo,"FromFunction");function nAo(t,e){return ec(t)||ec(t.unevaluatedProperties)||t.allOf.some(r=>Hm(r,e))}a(nAo,"FromIntersect");function iAo(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return ec(t)||Hm(n,[...r,...e])}a(iAo,"FromImport");function oAo(t,e){return ec(t)||Hm(t.items,e)}a(oAo,"FromIterator");function sAo(t,e){return ec(t)||Hm(t.not,e)}a(sAo,"FromNot");function aAo(t,e){return ec(t)||Object.values(t.properties).some(r=>Hm(r,e))||Rd(t.additionalProperties)&&Hm(t.additionalProperties,e)}a(aAo,"FromObject");function cAo(t,e){return ec(t)||Hm(t.item,e)}a(cAo,"FromPromise");function lAo(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return ec(t)||Hm(n,e)||Rd(t.additionalProperties)&&ec(t.additionalProperties)}a(lAo,"FromRecord");function uAo(t,e){return ec(t)?!0:Hm(Ia(t,e),e)}a(uAo,"FromRef");function dAo(t,e){return ec(t)?!0:Hm(Ia(t,e),e)}a(dAo,"FromThis");function fAo(t,e){return ec(t)||!Fu(t.items)&&t.items.some(r=>Hm(r,e))}a(fAo,"FromTuple");function pAo(t,e){return ec(t)||t.anyOf.some(r=>Hm(r,e))}a(pAo,"FromUnion");function Hm(t,e){let r=Y0(t,e),n=t;if(t.$id&&n2t.has(t.$id))return!1;switch(t.$id&&n2t.add(t.$id),t[Tt]){case"Array":return Xgo(n,r);case"AsyncIterator":return eAo(n,r);case"Constructor":return tAo(n,r);case"Function":return rAo(n,r);case"Import":return iAo(n,r);case"Intersect":return nAo(n,r);case"Iterator":return oAo(n,r);case"Not":return sAo(n,r);case"Object":return aAo(n,r);case"Promise":return cAo(n,r);case"Record":return lAo(n,r);case"Ref":return uAo(n,r);case"This":return dAo(n,r);case"Tuple":return fAo(n,r);case"Union":return pAo(n,r);default:return ec(t)}}a(Hm,"Visit");var n2t=new Set;function yB(t,e){return n2t.clear(),Hm(t,e)}a(yB,"HasTransform");var i2t=class{static{a(this,"TypeCheck")}constructor(e,r,n,o){this.schema=e,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=yB(e,r)}Code(){return this.code}Schema(){return this.schema}References(){return this.references}Errors(e){return nM(this.schema,this.references,e)}Check(e){return this.checkFunc(e)}Decode(e){if(!this.checkFunc(e))throw new Yoe(this.schema,e,this.Errors(e).First());return this.hasTransform?Koe(this.schema,this.references,e):e}Encode(e){let r=this.hasTransform?Zoe(this.schema,this.references,e):e;if(!this.checkFunc(r))throw new Joe(this.schema,e,this.Errors(e).First());return r}},EB;(function(t){function e(s){return s===36}a(e,"DollarSign"),t.DollarSign=e;function r(s){return s===95}a(r,"IsUnderscore"),t.IsUnderscore=r;function n(s){return s>=65&&s<=90||s>=97&&s<=122}a(n,"IsAlpha"),t.IsAlpha=n;function o(s){return s>=48&&s<=57}a(o,"IsNumeric"),t.IsNumeric=o})(EB||(EB={}));var hUe;(function(t){function e(s){return s.length===0?!1:EB.IsNumeric(s.charCodeAt(0))}a(e,"IsFirstCharacterNumeric");function r(s){if(e(s))return!1;for(let c=0;c= ${X.minItems}`);let ue=z(X.items,ee,"value");if(yield`((array) => { for(const ${he} of array) if(!(${ue})) { return false }; return true; })(${K})`,Qu(X.contains)||ai(X.minContains)||ai(X.maxContains)){let qe=Qu(X.contains)?X.contains:Xo(),ne=z(qe,ee,"value"),ce=ai(X.minContains)?[`(count >= ${X.minContains})`]:[],Ne=ai(X.maxContains)?[`(count <= ${X.maxContains})`]:[],we=`const count = value.reduce((${Z}, ${he}) => ${ne} ? acc + 1 : acc, 0)`,Be=["(count > 0)",...ce,...Ne].join(" && ");yield`((${he}) => { ${we}; return ${Be}})(${K})`}X.uniqueItems===!0&&(yield`((${he}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${K})`)}a(o,"FromArray");function*s(X,ee,K){yield`(typeof value === 'object' && Symbol.asyncIterator in ${K})`}a(s,"FromAsyncIterator");function*c(X,ee,K){yield`(typeof ${K} === 'bigint')`,pA(X.exclusiveMaximum)&&(yield`${K} < BigInt(${X.exclusiveMaximum})`),pA(X.exclusiveMinimum)&&(yield`${K} > BigInt(${X.exclusiveMinimum})`),pA(X.maximum)&&(yield`${K} <= BigInt(${X.maximum})`),pA(X.minimum)&&(yield`${K} >= BigInt(${X.minimum})`),pA(X.multipleOf)&&(yield`(${K} % BigInt(${X.multipleOf})) === 0`)}a(c,"FromBigInt");function*l(X,ee,K){yield`(typeof ${K} === 'boolean')`}a(l,"FromBoolean");function*u(X,ee,K){yield*W(X.returns,ee,`${K}.prototype`)}a(u,"FromConstructor");function*d(X,ee,K){yield`(${K} instanceof Date) && Number.isFinite(${K}.getTime())`,ai(X.exclusiveMaximumTimestamp)&&(yield`${K}.getTime() < ${X.exclusiveMaximumTimestamp}`),ai(X.exclusiveMinimumTimestamp)&&(yield`${K}.getTime() > ${X.exclusiveMinimumTimestamp}`),ai(X.maximumTimestamp)&&(yield`${K}.getTime() <= ${X.maximumTimestamp}`),ai(X.minimumTimestamp)&&(yield`${K}.getTime() >= ${X.minimumTimestamp}`),ai(X.multipleOfTimestamp)&&(yield`(${K}.getTime() % ${X.multipleOfTimestamp}) === 0`)}a(d,"FromDate");function*f(X,ee,K){yield`(typeof ${K} === 'function')`}a(f,"FromFunction");function*h(X,ee,K){let he=globalThis.Object.getOwnPropertyNames(X.$defs).reduce((Z,ue)=>[...Z,X.$defs[ue]],[]);yield*W(VI(X.$ref),[...ee,...he],K)}a(h,"FromImport");function*m(X,ee,K){yield`Number.isInteger(${K})`,ai(X.exclusiveMaximum)&&(yield`${K} < ${X.exclusiveMaximum}`),ai(X.exclusiveMinimum)&&(yield`${K} > ${X.exclusiveMinimum}`),ai(X.maximum)&&(yield`${K} <= ${X.maximum}`),ai(X.minimum)&&(yield`${K} >= ${X.minimum}`),ai(X.multipleOf)&&(yield`(${K} % ${X.multipleOf}) === 0`)}a(m,"FromInteger");function*g(X,ee,K){let he=X.allOf.map(Z=>z(Z,ee,K)).join(" && ");if(X.unevaluatedProperties===!1){let Z=H(`${new RegExp(mB(X))};`),ue=`Object.getOwnPropertyNames(${K}).every(key => ${Z}.test(key))`;yield`(${he} && ${ue})`}else if(Qu(X.unevaluatedProperties)){let Z=H(`${new RegExp(mB(X))};`),ue=`Object.getOwnPropertyNames(${K}).every(key => ${Z}.test(key) || ${z(X.unevaluatedProperties,ee,`${K}[key]`)})`;yield`(${he} && ${ue})`}else yield`(${he})`}a(g,"FromIntersect");function*A(X,ee,K){yield`(typeof value === 'object' && Symbol.iterator in ${K})`}a(A,"FromIterator");function*y(X,ee,K){typeof X.const=="number"||typeof X.const=="boolean"?yield`(${K} === ${X.const})`:yield`(${K} === '${s2t.Escape(X.const)}')`}a(y,"FromLiteral");function*E(X,ee,K){yield"false"}a(E,"FromNever");function*_(X,ee,K){yield`(!${z(X.not,ee,K)})`}a(_,"FromNot");function*v(X,ee,K){yield`(${K} === null)`}a(v,"FromNull");function*b(X,ee,K){yield LW.IsNumberLike(K),ai(X.exclusiveMaximum)&&(yield`${K} < ${X.exclusiveMaximum}`),ai(X.exclusiveMinimum)&&(yield`${K} > ${X.exclusiveMinimum}`),ai(X.maximum)&&(yield`${K} <= ${X.maximum}`),ai(X.minimum)&&(yield`${K} >= ${X.minimum}`),ai(X.multipleOf)&&(yield`(${K} % ${X.multipleOf}) === 0`)}a(b,"FromNumber");function*T(X,ee,K){yield LW.IsObjectLike(K),ai(X.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${X.minProperties}`),ai(X.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${X.maxProperties}`);let he=Object.getOwnPropertyNames(X.properties);for(let Z of he){let ue=hUe.Encode(K,Z),qe=X.properties[Z];if(X.required&&X.required.includes(Z))yield*W(qe,ee,ue),(gB(qe)||e(qe))&&(yield`('${Z}' in ${K})`);else{let ne=z(qe,ee,ue);yield LW.IsExactOptionalProperty(K,Z,ne)}}if(X.additionalProperties===!1)if(X.required&&X.required.length===he.length)yield`Object.getOwnPropertyNames(${K}).length === ${he.length}`;else{let Z=`[${he.map(ue=>`'${ue}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${K}).every(key => ${Z}.includes(key))`}if(typeof X.additionalProperties=="object"){let Z=z(X.additionalProperties,ee,`${K}[key]`),ue=`[${he.map(qe=>`'${qe}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${K}).every(key => ${ue}.includes(key) || ${Z}))`}}a(T,"FromObject");function*w(X,ee,K){yield`${K} instanceof Promise`}a(w,"FromPromise");function*R(X,ee,K){yield LW.IsRecordLike(K),ai(X.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${X.minProperties}`),ai(X.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${X.maxProperties}`);let[he,Z]=Object.entries(X.patternProperties)[0],ue=H(`${new RegExp(he)}`),qe=z(Z,ee,"value"),ne=Qu(X.additionalProperties)?z(X.additionalProperties,ee,K):X.additionalProperties===!1?"false":"true",ce=`(${ue}.test(key) ? ${qe} : ${ne})`;yield`(Object.entries(${K}).every(([key, value]) => ${ce}))`}a(R,"FromRecord");function*x(X,ee,K){let he=Ia(X,ee);if(V.functions.has(X.$ref))return yield`${ie(X.$ref)}(${K})`;yield*W(he,ee,K)}a(x,"FromRef");function*P(X,ee,K){let he=H(`${new RegExp(X.source,X.flags)};`);yield`(typeof ${K} === 'string')`,ai(X.maxLength)&&(yield`${K}.length <= ${X.maxLength}`),ai(X.minLength)&&(yield`${K}.length >= ${X.minLength}`),yield`${he}.test(${K})`}a(P,"FromRegExp");function*D(X,ee,K){yield`(typeof ${K} === 'string')`,ai(X.maxLength)&&(yield`${K}.length <= ${X.maxLength}`),ai(X.minLength)&&(yield`${K}.length >= ${X.minLength}`),X.pattern!==void 0&&(yield`${H(`${new RegExp(X.pattern)};`)}.test(${K})`),X.format!==void 0&&(yield`format('${X.format}', ${K})`)}a(D,"FromString");function*N(X,ee,K){yield`(typeof ${K} === 'symbol')`}a(N,"FromSymbol");function*L(X,ee,K){yield`(typeof ${K} === 'string')`,yield`${H(`${new RegExp(X.pattern)};`)}.test(${K})`}a(L,"FromTemplateLiteral");function*B(X,ee,K){yield`${ie(X.$ref)}(${K})`}a(B,"FromThis");function*q(X,ee,K){if(yield`Array.isArray(${K})`,X.items===void 0)return yield`${K}.length === 0`;yield`(${K}.length === ${X.maxItems})`;for(let he=0;hez(Z,ee,K)).join(" || ")})`}a(O,"FromUnion");function*j(X,ee,K){yield`${K} instanceof Uint8Array`,ai(X.maxByteLength)&&(yield`(${K}.length <= ${X.maxByteLength})`),ai(X.minByteLength)&&(yield`(${K}.length >= ${X.minByteLength})`)}a(j,"FromUint8Array");function*Q(X,ee,K){yield"true"}a(Q,"FromUnknown");function*U(X,ee,K){yield LW.IsVoidLike(K)}a(U,"FromVoid");function*Y(X,ee,K){let he=V.instances.size;V.instances.set(he,X),yield`kind('${X[Tt]}', ${he}, ${K})`}a(Y,"FromKind");function*W(X,ee,K,he=!0){let Z=Sa(X.$id)?[...ee,X]:ee,ue=X;if(he&&Sa(X.$id)){let qe=ie(X.$id);if(V.functions.has(qe))return yield`${qe}(${K})`;{V.functions.set(qe,"");let ne=re(qe,X,ee,"value",!1);return V.functions.set(qe,ne),yield`${qe}(${K})`}}switch(ue[Tt]){case"Any":return yield*r(ue,Z,K);case"Argument":return yield*n(ue,Z,K);case"Array":return yield*o(ue,Z,K);case"AsyncIterator":return yield*s(ue,Z,K);case"BigInt":return yield*c(ue,Z,K);case"Boolean":return yield*l(ue,Z,K);case"Constructor":return yield*u(ue,Z,K);case"Date":return yield*d(ue,Z,K);case"Function":return yield*f(ue,Z,K);case"Import":return yield*h(ue,Z,K);case"Integer":return yield*m(ue,Z,K);case"Intersect":return yield*g(ue,Z,K);case"Iterator":return yield*A(ue,Z,K);case"Literal":return yield*y(ue,Z,K);case"Never":return yield*E(ue,Z,K);case"Not":return yield*_(ue,Z,K);case"Null":return yield*v(ue,Z,K);case"Number":return yield*b(ue,Z,K);case"Object":return yield*T(ue,Z,K);case"Promise":return yield*w(ue,Z,K);case"Record":return yield*R(ue,Z,K);case"Ref":return yield*x(ue,Z,K);case"RegExp":return yield*P(ue,Z,K);case"String":return yield*D(ue,Z,K);case"Symbol":return yield*N(ue,Z,K);case"TemplateLiteral":return yield*L(ue,Z,K);case"This":return yield*B(ue,Z,K);case"Tuple":return yield*q(ue,Z,K);case"Undefined":return yield*M(ue,Z,K);case"Union":return yield*O(ue,Z,K);case"Uint8Array":return yield*j(ue,Z,K);case"Unknown":return yield*Q(ue,Z,K);case"Void":return yield*U(ue,Z,K);default:if(!v_.Has(ue[Tt]))throw new a2t(X);return yield*Y(ue,Z,K)}}a(W,"Visit");let V={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function z(X,ee,K,he=!0){return`(${[...W(X,ee,K,he)].join(" && ")})`}a(z,"CreateExpression");function ie(X){return`check_${o2t.Encode(X)}`}a(ie,"CreateFunctionName");function H(X){let ee=`local_${V.variables.size}`;return V.variables.set(ee,`const ${ee} = ${X}`),ee}a(H,"CreateVariable");function re(X,ee,K,he,Z=!0){let[ue,qe]=[` -`,we=>"".padStart(we," ")],ne=le("value","any"),ce=Le("boolean"),Ne=[...W(ee,K,he,Z)].map(we=>`${qe(4)}${we}`).join(` &&${ue}`);return`function ${X}(${ne})${ce} {${ue}${qe(2)}return (${ue}${Ne}${ue}${qe(2)}) -}`}a(re,"CreateFunction");function le(X,ee){let K=V.language==="typescript"?`: ${ee}`:"";return`${X}${K}`}a(le,"CreateParameter");function Le(X){return V.language==="typescript"?`: ${X}`:""}a(Le,"CreateReturns");function ge(X,ee,K){let he=re("check",X,ee,"value"),Z=le("value","any"),ue=Le("boolean"),qe=[...V.functions.values()],ne=[...V.variables.values()],ce=Sa(X.$id)?`return function check(${Z})${ue} { - return ${ie(X.$id)}(value) -}`:`return ${he}`;return[...ne,...qe,ce].join(` -`)}a(ge,"Build");function Ue(...X){let ee={language:"javascript"},[K,he,Z]=X.length===2&&Pi(X[1])?[X[0],X[1],ee]:X.length===2&&!Pi(X[1])?[X[0],[],X[1]]:X.length===3?[X[0],X[1],X[2]]:X.length===1?[X[0],[],ee]:[null,[],ee];if(V.language=Z.language,V.variables.clear(),V.functions.clear(),V.instances.clear(),!Qu(K))throw new mUe(K);for(let ue of he)if(!Qu(ue))throw new mUe(ue);return ge(K,he,Z)}a(Ue,"Code"),t.Code=Ue;function ke(X,ee=[]){let K=Ue(X,ee,{language:"javascript"}),he=globalThis.Function("kind","format","hash",K),Z=new Map(V.instances);function ue(Ne,we,Be){if(!v_.Has(Ne)||!Z.has(we))return!1;let rt=v_.Get(Ne),st=Z.get(we);return rt(st,Be)}a(ue,"typeRegistryFunction");function qe(Ne,we){return Uk.Has(Ne)?Uk.Get(Ne)(we):!1}a(qe,"formatRegistryFunction");function ne(Ne){return bU(Ne)}a(ne,"hashFunction");let ce=he(ue,qe,ne);return new i2t(X,ee,ce,K)}a(ke,"Compile"),t.Compile=ke})(qu||(qu={}));var t7e=de(dU()),yse=de(require("os"));Mo();var r7e=de(ri());function obe(t){return t===1}a(obe,"isRestricted");var ibe=8192,Ayo=21;var X0=class{static{a(this,"TelemetryReporters")}getReporter(e,r=0){return obe(r)?this.getRestrictedReporter(e):this.reporter}getRestrictedReporter(e){if(_se(e))return this.reporterRestricted;if(RCe(e))return new B9e}getMsft1pReporter(){return this.reporterMsft1p}getMsftReporter(){return this.reporterMsft}setReporter(e){this.reporter=e}setRestrictedReporter(e){this.reporterRestricted=e}setMsft1pReporter(e){this.reporterMsft1p=e}setMsftReporter(e){this.reporterMsft=e}async deactivate(){let e=[this.reporter,this.reporterRestricted,this.reporterMsft1p,this.reporterMsft];this.reporter=this.reporterRestricted=this.reporterMsft1p=this.reporterMsft=void 0,await Promise.all(e.map(r=>r?.dispose()))}},yyo=S.Object({},{additionalProperties:S.String()}),Eyo=S.Object({meanLogProb:S.Optional(S.Number()),meanAlternativeLogProb:S.Optional(S.Number())},{additionalProperties:S.Number()}),_yo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function vyo(t){return _yo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(vyo,"isOomError");function Cyo(t){return XI(t)?"network":vyo(t)||t.code==="EMFILE"||t.code==="ENFILE"||t.syscall==="uv_cwd"&&(t.code==="ENOENT"||t.code=="EIO")||t.code==="CopilotPromptLoadFailure"||`${t.code}`.startsWith("CopilotPromptWorkerExit")?"local":"exception"}a(Cyo,"getErrorType");var Wt=class t{static{a(this,"TelemetryData")}static{this.validateTelemetryProperties=qu.Compile(yyo)}static{this.validateTelemetryMeasurements=qu.Compile(Eyo)}static{this.keysExemptedFromSanitization=["abexp.assignmentcontext","VSCode.ABExp.Features"]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},yl())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=yl())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(Zt).getFallbackExpAndFilters();n.addToTelemetry(e,this),r.addToTelemetry(this)}extendWithCoreEditorAgnosticFields(e){this.properties.editor_version=M1(e.get(Ir).getEditorInfo()),this.properties.editor_plugin_version=M1(e.get(Ir).getEditorPluginInfo());let r=e.get(Ua);this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${V1(e)}`,typeof process<"u"&&(this.properties.runtime_version=`node/${process.versions.node}`)}extendWithEditorAgnosticFields(e){this.extendWithCoreEditorAgnosticFields(e);let r=e.get(Ir);this.properties.common_extname=r.getEditorPluginInfo().name,this.properties.common_extversion=r.getEditorPluginInfo().version,this.properties.common_vscodeversion=M1(r.getEditorInfo());let n=e.get(tr);this.properties.fetcher=n.name;let o=e.get(Lo).getHttpSettings();this.properties.proxy_enabled=o.proxy?"true":"false",this.properties.proxy_auth=o.proxyAuthorization?"true":"false",this.properties.proxy_kerberos_spn=o.proxyKerberosServicePrincipal?"true":"false",this.properties.reject_unauthorized=o.proxyStrictSSL!==!1?"true":"false"}extendWithConfigProperties(e){let r=CKr(e);r["copilot.build"]=bKr(e),r["copilot.buildType"]=MU(e),this.properties={...this.properties,...r}}extendWithRequestId(e){let r={headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetryHack=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromPropertiesHack(e,r){if(obe(e))return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetryHack.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements);for(let e in this.measurements)isNaN(this.measurements[e])&&delete this.measurements[e]}multiplexProperties(){this.properties=t.multiplexProperties(this.properties)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}static multiplexProperties(e){let r={...e};for(let n in e){let o=e[n],s=o?.length??0;if(s>ibe){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+ibe;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(Ese,"telemetrizePromptLength");function yl(){return performance.now()}a(yl,"now");function Iyo(t){return Math.floor(t/1e3)}a(Iyo,"nowSeconds");function _se(t){return t.get(Op).optedIn}a(_se,"shouldSendRestricted");function Et(t,e,r,n){return t.get(xd).register(xyo(t,e,yl(),r?.extendedBy(),n))}a(Et,"telemetry");function ZI(t,e,r){return t.get(xd).register(i7e(t,e,r?.extendedBy()))}a(ZI,"telemetryMsft");function At(t,e,r,n){let o=Wt.createAndMarkAsIssued(r,n);return t.get(xd).register(i7e(t,e,o))}a(At,"telemetryMs");function n7e(t,e,r,n){let o=(n||Wt.createAndMarkAsIssued()).extendedBy(AKr(r));return t.get(xd).register(i7e(t,e,o))}a(n7e,"telemetryMsftWithError");function Vn(t,e,r,n,o){let s=Wt.createAndMarkAsIssued({...n,...AKr(r)},o);return t.get(xd).register(i7e(t,e,s))}a(Vn,"telemetryMsWithError");function AKr(t){let e={};if(t){let r=kyo(t);e.errorName=r.name,e.errorMessage=r.message,e.errorStack=r.stack??""}return e}a(AKr,"buildErrorProperties");async function xyo(t,e,r,n,o=0){let s=n||Wt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o??!1,"IncludeExp",r),(!obe(o)||_se(t))&&sbe(t,o,e,s),byo(t,e,s)}a(xyo,"_telemetry");async function i7e(t,e,r){let n=r||Wt.createAndMarkAsIssued({},{});await n.prepareForSendingToMsft(t),Tyo(t,e,n)}a(i7e,"_telemetryMsft");function K6e(t,e){return t.get(xd).register(wyo(t,e,yl()))}a(K6e,"telemetryExpProblem");async function wyo(t,e,r){let n="expProblem",o=Wt.createAndMarkAsIssued(e,{});await o.makeReadyForSending(t,0,"SkipExp",r),sbe(t,0,n,o)}a(wyo,"_telemetryExpProblem");function vse(t,e,r,n,o=0){let s={...r,...yKr(t)};sbe(t,o,e,{properties:s,measurements:n})}a(vse,"telemetryRaw");function yKr(t){let e=t.get(Ir),r={unique_id:Mt(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:M1(e.getEditorInfo())};return{...t.get(Op).getProperties(),...r}}a(yKr,"createRequiredProperties");var ODt=class extends Error{static{a(this,"CopilotNonError")}constructor(e){let r;try{r=JSON.stringify(e)}catch{r=String(e)}super(r),this.name="CopilotNonError",this.code=(0,t7e.SHA256)(t7e.enc.Utf16.parse(this.message)).toString().slice(0,16)}};function qa(t,e,r,n,o){return t.get(xd).register(EKr(t,e,yl(),r,{...n},o))}a(qa,"telemetryException");async function EKr(t,e,r,n,o,s){let c;if(e instanceof Error){if(c=e,c.name==="Canceled"&&c.message==="Canceled"||c.name==="CodeExpectedError"||Gm(c)||c instanceof r7e.ConnectionError||c instanceof r7e.ResponseError||c.name==="CopilotAuthError"||c.name==="DeviceFlowError")return}else{if(c=new ODt(e),e&&typeof e=="object"&&e.name==="ExitStatus")return;if(c.stack?.startsWith(`${c} +`,Auo=[puo,huo,muo,guo];function rPt(t){for(let e of fuo)t.exec(e);return yuo(t),t}a(rPt,"applyPragmas");function yuo(t){let r=t.prepare("PRAGMA journal_mode").get()?.journal_mode;(typeof r=="string"?r.toLowerCase():void 0)!=="wal"&&t.exec("PRAGMA journal_mode = WAL")}a(yuo,"ensureWalMode");function nPt(t){for(let e of Auo)t.exec(e);return t}a(nPt,"applySchema");function pU(t,e){t.exec("BEGIN IMMEDIATE");try{let r=e();return t.exec("COMMIT"),r}catch(r){try{t.exec("ROLLBACK")}catch{}throw r}}a(pU,"runInWriteTx");p();p();p();var iPt="github.copilot",Sqr="github-enterprise";p();var Ls=a((t,e)=>({editorId:t,displayName:e}),"id"),Euo=Ls("unknown","Unknown"),Tqr=Ls("eclipse","Eclipse"),Iqr=Ls("xcode","Xcode"),hU=Ls("vim","Vim/Neovim"),xqr=Ls("helix","Helix"),_uo={"copilot-eclipse":Tqr,Copilot4Eclipse:Tqr,"copilot-xcode":Iqr,"Copilot for Xcode":Iqr,"copilot-vs":Ls("visual-studio","Visual Studio"),"copilot.vim":hU,"copilot.lua":hU,"Github Copilot LSP for Neovim":hU,"coc-github-copilot":hU,"nvim-lspconfig":hU,"copilot-lsp-client-neovim":hU,"neovim-copilot-lsp":hU,"sidekick.nvim":hU,"helix-copilot":xqr,"copilot-helix":xqr,"copilot-sublime":Ls("sublime-text","Sublime Text"),"zed-copilot":Ls("zed","Zed"),RStudio:Ls("rstudio","RStudio"),"obsidian-copilot":Ls("obsidian","Obsidian"),marimo:Ls("marimo","marimo"),"Qt Creator Copilot plugin":Ls("qt-creator","Qt Creator"),"godot-copilot":Ls("godot","Godot"),"kakoune-lsp":Ls("kakoune","Kakoune"),"typora-copilot":Ls("typora","Typora"),"Copilot for Nova":Ls("nova","Nova")},vuo={IU:Ls("intellij","IntelliJ IDEA"),IC:Ls("intellij","IntelliJ IDEA"),IE:Ls("intellij","IntelliJ IDEA"),PY:Ls("pycharm","PyCharm"),PC:Ls("pycharm","PyCharm"),PE:Ls("pycharm","PyCharm"),WS:Ls("webstorm","WebStorm"),PS:Ls("phpstorm","PhpStorm"),RD:Ls("rider","Rider"),RM:Ls("rubymine","RubyMine"),CL:Ls("clion","CLion"),GO:Ls("goland","GoLand"),RR:Ls("rustrover","RustRover"),DB:Ls("datagrip","DataGrip"),DS:Ls("dataspell","DataSpell"),AI:Ls("android-studio","Android Studio"),QA:Ls("aqua","Aqua"),MPS:Ls("mps","MPS"),JBC:Ls("jetbrains-client","JetBrains Client"),GW:Ls("jetbrains-gateway","JetBrains Gateway")},wqr="JetBrains-",Cuo=Ls("jetbrains","JetBrains IDE");function Rqr(t){let e=t.plugin.name?.trim();if(!e)return Euo;if(e==="copilot-intellij"){let r=t.editor.name??"";if(r.startsWith(wqr)){let n=vuo[r.slice(wqr.length)];if(n)return n}return Cuo}return _uo[e]??Ls(e,e)}a(Rqr,"resolveEditorIdentity");p();p();p();p();var n9e=class{constructor(e){this.userInfo=e}static{a(this,"CopilotUserInfoWrapper")}get sku(){return this.userInfo?.access_type_sku}get isFreeUser(){return this.sku==="free_limited_copilot"}get isIndividualUser(){return this.copilotPlan==="free"||this.copilotPlan==="individual"||this.copilotPlan==="individual_pro"||this.copilotPlan==="individual_max"}get isTBBEnabled(){return this.userInfo?.token_based_billing===!0}get copilotPlan(){if(this.isFreeUser)return"free";let e=this.userInfo?.copilot_plan;switch(e){case"individual":case"individual_pro":case"individual_max":case"business":case"enterprise":return e;default:return"individual"}}get canUpgradePlan(){return this.userInfo?.can_upgrade_plan===!0}get quotaInfo(){return{quota_snapshots:this.userInfo?.quota_snapshots,quota_reset_date:this.userInfo?.quota_reset_date}}get cliEnabled(){return this.userInfo?.cli_enabled}get raw(){return this.userInfo}};p();function oPt(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(oPt,"findKnownOrg");function kqr(t){let e=t.organization_list??[];return oPt(e)??""}a(kqr,"getUserKind");p();var Vf=class{static{a(this,"LogTarget")}},iB=class{static{a(this,"TelemetryLogSender")}},pe=class{constructor(e){this.category=e}static{a(this,"Logger")}log(e,r,...n){e.get(Vf).logIt(e,r,this.category,...n)}debug(e,...r){this.log(e,4,...r)}info(e,...r){this.log(e,3,...r)}warn(e,...r){this.log(e,2,...r)}error(e,...r){this.log(e,1,...r)}exception(e,r,n){if(r instanceof Error&&r.name==="Canceled"&&r.message==="Canceled")return;let o=n;n.startsWith(".")&&(o=n.substring(1),n=`${this.category}${n}`),e.get(iB).sendException(e,r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e,1,`${o}:`,s)}},Nr=new pe("default");p();p();p();p();async function ipo(){let{getDeviceId:t}=await Promise.resolve().then(()=>fe(cGr()));return t()}a(ipo,"loadDeviceId");var $I=class{constructor(e=ipo){this.resolvedId="";this.deviceIdPromise=(async()=>e())().catch(()=>"").then(r=>this.resolvedId=r)}static{a(this,"DevDeviceIdManager")}async getId(){return this.deviceIdPromise}getIdSync(){return this.resolvedId}};p();p();p();var Uk=class{static{a(this,"InlineCompletionsUnification")}},opo={codeUnification:!1,modelUnification:!1,expAssignments:[]},Noe=class extends Uk{constructor(){super(...arguments);this.inlineCompletionsUnificationState=opo;this.onDidChangeState=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeState")}static{a(this,"NullInlineCompletionsUnification")}};var VI=class t{static{a(this,"ExpConfig")}constructor(e,r,n){this.variables=e,this.assignmentContext=r,this.features=n}static createFallbackConfig(e,r){return C9e(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"","")}addToTelemetry(e,r){let o=e.get(Uk).inlineCompletionsUnificationState.expAssignments.filter(c=>!this.assignmentContext.includes(c)),s=[this.assignmentContext,...o].filter(Boolean).join(";");r.properties["VSCode.ABExp.Features"]=this.features,r.properties["abexp.assignmentcontext"]=s}};p();var S_="X-Copilot-RelatedPluginVersion-",Moe=(z=>(z.Market="X-MSEdge-Market",z.CorpNet="X-FD-Corpnet",z.Build="X-VSCode-Build",z.ApplicationVersion="X-VSCode-AppVersion",z.TargetPopulation="X-VSCode-TargetPopulation",z.ClientId="X-MSEdge-ClientId",z.DevDeviceId="X-VSCode-DevDeviceId",z.ExtensionName="X-VSCode-ExtensionName",z.ExtensionVersion="X-VSCode-ExtensionVersion",z.ExtensionRelease="X-VSCode-ExtensionRelease",z.CompletionsInChatExtensionVersion="X-VSCode-CompletionsInChatExtensionVersion",z.Language="X-VSCode-Language",z.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",z.CopilotEngine="X-Copilot-Engine",z.CopilotOverrideEngine="X-Copilot-OverrideEngine",z.CopilotRepository="X-Copilot-Repository",z.CopilotFileType="X-Copilot-FileType",z.CopilotUserKind="X-Copilot-UserKind",z.CopilotDogfood="X-Copilot-Dogfood",z.CopilotOrgs="X-Copilot-Orgs",z.CopilotTrackingId="X-Copilot-CopilotTrackingId",z.CopilotClientVersion="X-Copilot-ClientVersion",z.CopilotSku="X-GitHub-Copilot-SKU",z.CopilotIsFcv1="X-GitHub-Copilot-IsFcv1",z.CopilotIsSn="X-GitHub-Copilot-IsSn",z.CopilotRelatedPluginVersionCppTools=S_+"msvscodecpptools",z.CopilotRelatedPluginVersionCMakeTools=S_+"msvscodecmaketools",z.CopilotRelatedPluginVersionMakefileTools=S_+"msvscodemakefiletools",z.CopilotRelatedPluginVersionCSharpDevKit=S_+"msdotnettoolscsdevkit",z.CopilotRelatedPluginVersionPython=S_+"mspythonpython",z.CopilotRelatedPluginVersionPylance=S_+"mspythonvscodepylance",z.CopilotRelatedPluginVersionJavaPack=S_+"vscjavavscodejavapack",z.CopilotRelatedPluginVersionJavaManager=S_+"vscjavavscodejavadependency",z.CopilotRelatedPluginVersionTypescript=S_+"vscodetypescriptlanguagefeatures",z.CopilotRelatedPluginVersionTypescriptNext=S_+"msvscodevscodetypescriptnext",z.CopilotRelatedPluginVersionCSharp=S_+"msdotnettoolscsharp",z.CopilotRelatedPluginVersionGithubCopilotChat=S_+"githubcopilotchat",z.CopilotRelatedPluginVersionGithubCopilot=S_+"githubcopilot",z))(Moe||{});var spo={"X-Copilot-ClientTimeBucket":"timeBucket","X-Copilot-OverrideEngine":"engine","X-Copilot-Repository":"repo","X-Copilot-FileType":"fileType","X-Copilot-UserKind":"userKind"},uB=class t{constructor(e){this.filters=e;for(let[r,n]of Object.entries(this.filters))n===""&&delete this.filters[r]}static{a(this,"FilterSettings")}extends(e){for(let[r,n]of Object.entries(e.filters))if(this.filters[r]!==n)return!1;return!0}addToTelemetry(e){for(let[r,n]of Object.entries(this.filters)){let o=spo[r];o!==void 0&&(e.properties[o]=n)}}stringify(){let e=Object.keys(this.filters);return e.sort(),e.map(r=>`${r}:${this.filters[r]}`).join(";")}toHeaders(){return{...this.filters}}withChange(e,r){return new t({...this.filters,[e]:r})}};p();p();p();function vs(t,e){let r=K0(t,e,"event.CopilotToken");return t.get(Ft).onDidChangeTokenResult(n=>{n.copilotToken&&r(n.copilotToken)})}a(vs,"onCopilotToken");function kPt(t){let e=t.getTokenValue("tid"),r=t.organization_list,n=t.enterprise_list,o=t.getTokenValue("sku");if(!e)return;let s={copilot_trackingId:e};return r&&(s.organizations_list=r.toString()),n&&(s.enterprise_list=n.toString()),o&&(s.sku=o),s}a(kPt,"propertiesFromCopilotToken");var Fp=class{constructor(e){this.#e={};this.optedIn=!1;vs(e,r=>this.updateFromToken(r))}static{a(this,"TelemetryUserConfig")}#e;getProperties(){return this.#e}get trackingId(){return this.#e.copilot_trackingId}updateFromToken(e){let r=kPt(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1")}};var aUe=fe(bU()),cUe=fe(require("os"));var apo=/^(\s+at)?(.*?)(@|\s\(|\s)([^(\n]+?)(:\d+)?(:\d+)?(\)?)$/;function cpo(t){let e={type:t.name,value:t.message},r=t.stack?.replace(/^.*?:\d+\n.*\n *\^?\n\n/,"");if(r?.startsWith(t.toString()+` +`)){e.stacktrace=[];for(let n of r.slice(t.toString().length+1).split(/\n/).reverse()){let o=n.match(apo),s={filename:"",function:""};o&&(s.function=o[2]?.trim()?.replace(/^[^.]{1,2}(\.|$)/,"_$1")??s.function,s.filename=(o[4]?.trim()??s.filename).replace(/^\.\/dist\//,"/github-copilot/dist/"),o[5]&&o[5]!==":0"&&(s.lineno=o[5].slice(1)),o[6]&&o[5]!==":0"&&(s.colno=o[6].slice(1)),s.in_app=!/[[<:]|(?:^|\/)node_modules\//.test(s.filename)),e.stacktrace.push(s)}}return e}a(cpo,"buildExceptionDetail");function NPt(t,e){let r=t.get(Ir),n=r.getEditorInfo(),o=t.get(Fp),s={"#editor":n.devName??n.name,"#editor_version":U1({name:n.devName??n.name,version:n.version}),"#plugin":r.getEditorPluginInfo().name,"#plugin_version":U1(r.getEditorPluginInfo()),"#session_id":t.get(qa).sessionId,"#machine_id":t.get(qa).machineId,"#architecture":cUe.arch(),"#os_platform":cUe.platform(),...e};return o.trackingId&&(s.user=o.trackingId,s["#tracking_id"]=o.trackingId),s}a(NPt,"buildContext");function g$r(t,e,r){let n=t.get(us),o=t.get(Ir).getEditorInfo(),s=typeof process<"u"?process.versions.node:"web",c={app:"copilot-client",rollup_id:"auto",platform:"node",release:n.getBuildType()!=="dev"?`copilot-client@${n.getVersion()}`:void 0,deployed_to:n.getBuildType(),catalog_service:o.name==="vscode"?"CopilotCompletionsVSCode":"CopilotLanguageServer",transaction:r,context:NPt(t,{"#node_version":s}),sensitive_context:{}},l=[];c.exception_detail=[];let u=0,d=e;for(;d instanceof Error&&u<10;){let h=cpo(d);c.exception_detail.unshift(h),l.unshift([d,h]),u+=1,d=d.cause}let f=[];for(let[h,m]of l)if(m.stacktrace&&m.stacktrace.length>0){f.push(`${m.type}: ${h.code??""}`);let g=[...m.stacktrace].reverse();for(let y of g)if(y.filename?.startsWith("/github-copilot/"))return c;let A=!1;for(let y of g)if(y.in_app){A=!0,f.push(`${y.filename?.replace(/^\.\//,"")}:${y.lineno}:${y.colno}`);break}A||f.push(r),f.push(`${g[0].filename?.replace(/^\.\//,"")}`)}else return c;return c.exception_detail.length>0&&(c.rollup_id=(0,aUe.SHA256)(aUe.enc.Utf16.parse(f.join(` +`))).toString()),c}a(g$r,"buildPayload");p();var lUe=class{static{a(this,"FailingTelemetryReporter")}sendTelemetryEvent(e,r,n){throw new Error("Telemetry disabled")}sendTelemetryErrorEvent(e,r,n,o){throw new Error("Telemetry disabled")}dispose(){return Promise.resolve()}hackOptOutListener(){}};p();p();var y$r=fe(bU());var Cn=class{constructor(e=10){this.valueMap=new Map;if(e<1)throw new Error("Size limit must be at least 1");this.sizeLimit=e}static{a(this,"LRUCacheMap")}set(e,r){if(this.has(e))this.valueMap.delete(e);else if(this.valueMap.size>=this.sizeLimit){let n=this.valueMap.keys().next().value;this.delete(n)}return this.valueMap.set(e,r),this}get(e){if(this.valueMap.has(e)){let r=this.valueMap.get(e);return this.valueMap.delete(e),this.valueMap.set(e,r),r}}delete(e){return this.valueMap.delete(e)}clear(){this.valueMap.clear()}get size(){return this.valueMap.size}keys(){return new Map(this.valueMap).keys()}values(){return new Map(this.valueMap).values()}entries(){return new Map(this.valueMap).entries()}[Symbol.iterator](){return this.entries()}has(e){return this.valueMap.has(e)}forEach(e,r){new Map(this.valueMap).forEach(e,r)}get[Symbol.toStringTag](){return"LRUCacheMap"}peek(e){return this.valueMap.get(e)}},Qk=class extends Cn{constructor(r,n=120*1e3){super(r);this.defaultTtl=n;this.expiration=new Map}static{a(this,"LRUExpirationCacheMap")}has(r){let n=!1,o=this.expiration.get(r);return o!==void 0&&(o>performance.now()&&(n=super.has(r)),n||this.delete(r)),n}get(r){let n=this.expiration.get(r);if(n!==void 0){if(n>performance.now())return super.get(r);this.delete(r)}}peek(r){let n=this.expiration.get(r);if(n!==void 0){if(n>performance.now())return super.peek(r);this.delete(r)}}set(r,n,o=this.defaultTtl){if(o<=0)throw new Error("TTL must be greater than 0");let s=super.set(r,n);return this.expiration.set(r,performance.now()+o),s}clear(){super.clear(),this.expiration.clear()}delete(r){return this.expiration.delete(r),super.delete(r)}get[Symbol.toStringTag](){return"LRUExpirationCacheMap"}},uUe=class extends Cn{static{a(this,"LRUDisposableCacheMap")}delete(e){let r=this.peek(e);return r&&r.dispose(),super.delete(e)}clear(){for(let e of this.values())e.dispose();super.clear()}uncache(e){let r=this.peek(e);return super.delete(e),r}dispose(){this.clear()}};var E$r=7*86400*1e3,aM=class{constructor(e=5){this.perWeek=e;this.cache=new Cn(1e3)}static{a(this,"ExceptionRateLimiter")}isThrottled(e){let r=Date.now(),n=this.cache.get(e)||new Array(this.perWeek).fill(-E$r);return r-n[0]t?.length>0&&t!==".").map(t=>t.includes("\\")?new RegExp(_$r(t.replace(/\\/g,"/")),"gi"):new RegExp(_$r(t),"gi"));function upo(t,e){if(!t||!t.includes("/")&&!t.includes("\\"))return t;let r=t,n=[];for(let l of e)for(;;){let u=l.exec(t);if(!u)break;n.push([u.index,l.lastIndex])}let o=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,s=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g,c=0;for(r="";;){let l=s.exec(t);if(!l)break;let u=n.some(([d,f])=>l.index",c=s.lastIndex)}return c`;return t}a(dpo,"removePropertiesWithPossibleUserInfo");function fpo(t){return t.replace(/([\s|(]|file:\/\/)(\/[^\s]+)/g,"$1[redacted]").replace(/([\s|(]|file:\/\/)([a-zA-Z]:[(\\|/){1,2}][^\s]+)/gi,"$1[redacted]").replace(/([\s|(]|file:\/\/)(\\[^\s]+)/gi,"$1[redacted]")}a(fpo,"redactPaths");function C$r(t,e=lpo){let r={};for(let[n,o]of Object.entries(t))if(typeof o=="string"){let s=o.replaceAll("%20"," "),c=dpo(s);if(c!==s){r[n]=c;continue}s=upo(s,e);for(let l of e)s=s.replace(l,"");s=fpo(s),r[n]=s}return r}a(C$r,"sanitizeTelemetryProperties");function SU(t,e=Object.keys(t)){let r={};for(let n of e)t[n]!==void 0&&(r[n]=t[n]);return r}a(SU,"filterTelemetryProperties");p();var WI=class t{constructor(e){this.flags=e}static{a(this,"RuntimeMode")}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:S$r(r,n),verboseLogging:hpo(r,n),testMode:e,simulation:ppo(n)})}};function Q1(t){return t.get(WI).flags.testMode}a(Q1,"isRunningInTest");function YCe(t){return Q1(t)}a(YCe,"shouldFailForDebugPurposes");function KCe(t){return t.get(WI).flags.debug}a(KCe,"isDebugEnabled");function b$r(t){return t.get(WI).flags.verboseLogging}a(b$r,"isVerboseLoggingEnabled");function S$r(t,e){return t.includes("--debug")||OPt(e,"DEBUG")}a(S$r,"determineDebugFlag");function ppo(t){return OPt(t,"SIMULATION")}a(ppo,"determineSimulationFlag");function fUe(t){return t.get(WI).flags.simulation}a(fUe,"isRunningInSimulation");function hpo(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||OPt(e,"VERBOSE")||S$r(t,e)}a(hpo,"determineVerboseLoggingEnabled");function OPt(t,e){for(let r of["GH_COPILOT_","GITHUB_COPILOT_"]){let n=t[`${r}${e}`];if(n)return n==="1"||n?.toLowerCase()==="true"}return!1}a(OPt,"determineEnvFlagEnabled");p();var Dd=class{constructor(){this.promises=new Set}static{a(this,"PromiseQueue")}register(e){this.promises.add(e),e.finally(()=>this.promises.delete(e))}async flush(){await Promise.allSettled(this.promises)}};p();var x$r=require("os"),w$r=fe(require("path"));function JCe(t){return t.replace(/(file:\/\/)([^\s<>]+)/gi,"$1[redacted]").replace(/(^|[\s|:=(<'"`])((?:\/(?=[^/])|\\|[a-zA-Z]:[\\/])[^\s:)>'"`]+)/g,"$1[redacted]")}a(JCe,"redactPaths");var mpo=new Set(["Maximum call stack size exceeded","Set maximum size exceeded","Invalid arguments"]),gpo=[/^[\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}.]+ is not a function[ \w]*$/u,/^Cannot read properties of undefined \(reading '[\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}]+'\)$/u];function BPt(t){if(mpo.has(t))return t;for(let e of gpo)if(e.test(t))return t;return JCe(t).replace(/\bDNS:(?:\*\.)?[\w.-]+/gi,"DNS:[redacted]")}a(BPt,"redactMessage");function Ooe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Ooe,"escapeForRegExp");var Apo=new RegExp("(?<=^|[\\s|(\"'`]|file://)"+Ooe((0,x$r.homedir)())+"(?=$|[\\\\/:\"'`])","gi");function LPt(t){return t.replace(Apo,"~")}a(LPt,"redactHomeDir");var R$r="[\\\\/]?([^:)]*)(?=:\\d)",T$r=new RegExp(Ooe(w$r.sep),"g"),I$r=new RegExp(Ooe(__dirname.replace(/[\\/]lib[\\/]src[\\/]util$|[\\/]dist$/,""))+R$r,"gi");function FPt(t,e,r=!1,n=[]){let o=new Error(e(t));o.name=t.name,typeof t.syscall=="string"&&(o.syscall=t.syscall),typeof t.code=="string"&&(o.code=t.code),typeof t.errno=="number"&&(o.errno=t.errno),o.stack=void 0;let s=t.stack?.replace(/^.*?:\d+\n.*\n *\^?\n\n/,""),c;for(let l of[t.toString(),`${t.name}: ${t.message}`])if(s?.startsWith(l+` +`)){c=s.slice(l.length+1).split(/\n/);break}if(c){o.stack=o.toString();for(let l of c)if(I$r.test(l))o.stack+=` +${JCe(l.replace(I$r,(u,d)=>"./"+d.replace(T$r,"/")))}`;else if(/[ (]node:|[ (]wasm:\/\/wasm\/| \(\)$/.test(l))o.stack+=` +${JCe(l)}`;else{let u=!1;for(let{prefix:d,path:f}of n){let h=new RegExp(Ooe(f.replace(/[\\/]$/,""))+R$r,"gi");if(h.test(l)){o.stack+=` +${JCe(l.replace(h,(m,g)=>d+g.replace(T$r,"/")))}`,u=!0;break}}if(u)continue;r?o.stack+=` +${LPt(l)}`:o.stack+=` + at [redacted]:0:0`}}else r&&s&&(o.stack=LPt(s));return t.cause instanceof Error&&(o.cause=FPt(t.cause,e,r,n)),o}a(FPt,"cloneError");function k$r(t){let e=t.message;return typeof t.path=="string"&&t.path.length>0&&(e=e.replaceAll(t.path,"")),e}a(k$r,"errorMessageWithoutPath");function P$r(t,e){return FPt(t,a(function(n){return LPt(k$r(n))},"prepareMessage"),!0,e)}a(P$r,"prepareErrorForRestrictedTelemetry");function D$r(t,e,r=!1){return FPt(t,a(function(o){if(r)return BPt(k$r(o));let s="[redacted]";return typeof o.code=="string"&&(s=o.code+" "+s),typeof o.syscall=="string"?s=JCe(o.syscall)+" "+s:"erroredSysCall"in o&&typeof o.erroredSysCall=="string"&&(s=o.erroredSysCall+" "+s),s},"prepareMessage"),!1,e)}a(D$r,"redactError");p();p();var Qy={};Ri(Qy,{HasPropertyKey:()=>pUe,IsArray:()=>Up,IsAsyncIterator:()=>UPt,IsBigInt:()=>ZCe,IsBoolean:()=>fB,IsDate:()=>UW,IsFunction:()=>QPt,IsIterator:()=>qPt,IsNull:()=>jPt,IsNumber:()=>q1,IsObject:()=>Jc,IsRegExp:()=>XCe,IsString:()=>Ql,IsSymbol:()=>HPt,IsUint8Array:()=>pB,IsUndefined:()=>Qp});p();function pUe(t,e){return e in t}a(pUe,"HasPropertyKey");function UPt(t){return Jc(t)&&!Up(t)&&!pB(t)&&Symbol.asyncIterator in t}a(UPt,"IsAsyncIterator");function Up(t){return Array.isArray(t)}a(Up,"IsArray");function ZCe(t){return typeof t=="bigint"}a(ZCe,"IsBigInt");function fB(t){return typeof t=="boolean"}a(fB,"IsBoolean");function UW(t){return t instanceof globalThis.Date}a(UW,"IsDate");function QPt(t){return typeof t=="function"}a(QPt,"IsFunction");function qPt(t){return Jc(t)&&!Up(t)&&!pB(t)&&Symbol.iterator in t}a(qPt,"IsIterator");function jPt(t){return t===null}a(jPt,"IsNull");function q1(t){return typeof t=="number"}a(q1,"IsNumber");function Jc(t){return typeof t=="object"&&t!==null}a(Jc,"IsObject");function XCe(t){return t instanceof globalThis.RegExp}a(XCe,"IsRegExp");function Ql(t){return typeof t=="string"}a(Ql,"IsString");function HPt(t){return typeof t=="symbol"}a(HPt,"IsSymbol");function pB(t){return t instanceof globalThis.Uint8Array}a(pB,"IsUint8Array");function Qp(t){return t===void 0}a(Qp,"IsUndefined");function ypo(t){return t.map(e=>hUe(e))}a(ypo,"ArrayType");function Epo(t){return new Date(t.getTime())}a(Epo,"DateType");function _po(t){return new Uint8Array(t)}a(_po,"Uint8ArrayType");function vpo(t){return new RegExp(t.source,t.flags)}a(vpo,"RegExpType");function Cpo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=hUe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=hUe(t[r]);return e}a(Cpo,"ObjectType");function hUe(t){return Up(t)?ypo(t):UW(t)?Epo(t):pB(t)?_po(t):XCe(t)?vpo(t):Jc(t)?Cpo(t):t}a(hUe,"Visit");function qu(t){return hUe(t)}a(qu,"Clone");function Loe(t,e){return e===void 0?qu(t):qu({...e,...t})}a(Loe,"CloneType");p();p();p();function mUe(t){return bo(t)&&globalThis.Symbol.asyncIterator in t}a(mUe,"IsAsyncIterator");function gUe(t){return bo(t)&&globalThis.Symbol.iterator in t}a(gUe,"IsIterator");function GPt(t){return bo(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(GPt,"IsStandardObject");function AUe(t){return t instanceof globalThis.Promise}a(AUe,"IsPromise");function T_(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(T_,"IsDate");function N$r(t){return t instanceof globalThis.Map}a(N$r,"IsMap");function M$r(t){return t instanceof globalThis.Set}a(M$r,"IsSet");function zI(t){return globalThis.ArrayBuffer.isView(t)}a(zI,"IsTypedArray");function Boe(t){return t instanceof globalThis.Uint8Array}a(Boe,"IsUint8Array");function Ui(t,e){return e in t}a(Ui,"HasPropertyKey");function bo(t){return t!==null&&typeof t=="object"}a(bo,"IsObject");function ki(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(ki,"IsArray");function ju(t){return t===void 0}a(ju,"IsUndefined");function hB(t){return t===null}a(hB,"IsNull");function cM(t){return typeof t=="boolean"}a(cM,"IsBoolean");function si(t){return typeof t=="number"}a(si,"IsNumber");function yUe(t){return globalThis.Number.isInteger(t)}a(yUe,"IsInteger");function gA(t){return typeof t=="bigint"}a(gA,"IsBigInt");function ba(t){return typeof t=="string"}a(ba,"IsString");function TU(t){return typeof t=="function"}a(TU,"IsFunction");function mB(t){return typeof t=="symbol"}a(mB,"IsSymbol");function j1(t){return gA(t)||cM(t)||hB(t)||si(t)||ba(t)||mB(t)||ju(t)}a(j1,"IsValueType");var au;(function(t){t.InstanceMode="default",t.ExactOptionalPropertyTypes=!1,t.AllowArrayObject=!1,t.AllowNaN=!1,t.AllowNullVoid=!1;function e(c,l){return t.ExactOptionalPropertyTypes?l in c:c[l]!==void 0}a(e,"IsExactOptionalProperty"),t.IsExactOptionalProperty=e;function r(c){let l=bo(c);return t.AllowArrayObject?l:l&&!ki(c)}a(r,"IsObjectLike"),t.IsObjectLike=r;function n(c){return r(c)&&!(c instanceof Date)&&!(c instanceof Uint8Array)}a(n,"IsRecordLike"),t.IsRecordLike=n;function o(c){return t.AllowNaN?si(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=ju(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(au||(au={}));p();function bpo(t){return globalThis.Object.freeze(t).map(e=>ebe(e))}a(bpo,"ImmutableArray");function Spo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=ebe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=ebe(t[r]);return globalThis.Object.freeze(e)}a(Spo,"ImmutableObject");function ebe(t){return Up(t)?bpo(t):UW(t)?t:pB(t)?t:XCe(t)?t:Jc(t)?Spo(t):t}a(ebe,"Immutable");function xt(t,e){let r=e!==void 0?{...e,...t}:t;switch(au.InstanceMode){case"freeze":return ebe(r);case"clone":return qu(r);default:return r}}a(xt,"CreateType");p();var Qi=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};p();p();p();var Nd=Symbol.for("TypeBox.Transform"),qk=Symbol.for("TypeBox.Readonly"),AA=Symbol.for("TypeBox.Optional"),YI=Symbol.for("TypeBox.Hint"),bt=Symbol.for("TypeBox.Kind");function Foe(t){return Jc(t)&&t[qk]==="Readonly"}a(Foe,"IsReadonly");function sC(t){return Jc(t)&&t[AA]==="Optional"}a(sC,"IsOptional");function $Pt(t){return ca(t,"Any")}a($Pt,"IsAny");function VPt(t){return ca(t,"Argument")}a(VPt,"IsArgument");function jk(t){return ca(t,"Array")}a(jk,"IsArray");function QW(t){return ca(t,"AsyncIterator")}a(QW,"IsAsyncIterator");function qW(t){return ca(t,"BigInt")}a(qW,"IsBigInt");function gB(t){return ca(t,"Boolean")}a(gB,"IsBoolean");function Hk(t){return ca(t,"Computed")}a(Hk,"IsComputed");function Gk(t){return ca(t,"Constructor")}a(Gk,"IsConstructor");function Tpo(t){return ca(t,"Date")}a(Tpo,"IsDate");function $k(t){return ca(t,"Function")}a($k,"IsFunction");function Vk(t){return ca(t,"Integer")}a(Vk,"IsInteger");function ff(t){return ca(t,"Intersect")}a(ff,"IsIntersect");function jW(t){return ca(t,"Iterator")}a(jW,"IsIterator");function ca(t,e){return Jc(t)&&bt in t&&t[bt]===e}a(ca,"IsKindOf");function EUe(t){return fB(t)||q1(t)||Ql(t)}a(EUe,"IsLiteralValue");function H1(t){return ca(t,"Literal")}a(H1,"IsLiteral");function G1(t){return ca(t,"MappedKey")}a(G1,"IsMappedKey");function Hu(t){return ca(t,"MappedResult")}a(Hu,"IsMappedResult");function IU(t){return ca(t,"Never")}a(IU,"IsNever");function Ipo(t){return ca(t,"Not")}a(Ipo,"IsNot");function tbe(t){return ca(t,"Null")}a(tbe,"IsNull");function Wk(t){return ca(t,"Number")}a(Wk,"IsNumber");function qp(t){return ca(t,"Object")}a(qp,"IsObject");function HW(t){return ca(t,"Promise")}a(HW,"IsPromise");function GW(t){return ca(t,"Record")}a(GW,"IsRecord");function Wf(t){return ca(t,"Ref")}a(Wf,"IsRef");function WPt(t){return ca(t,"RegExp")}a(WPt,"IsRegExp");function AB(t){return ca(t,"String")}a(AB,"IsString");function rbe(t){return ca(t,"Symbol")}a(rbe,"IsSymbol");function $1(t){return ca(t,"TemplateLiteral")}a($1,"IsTemplateLiteral");function xpo(t){return ca(t,"This")}a(xpo,"IsThis");function nc(t){return Jc(t)&&Nd in t}a(nc,"IsTransform");function V1(t){return ca(t,"Tuple")}a(V1,"IsTuple");function yB(t){return ca(t,"Undefined")}a(yB,"IsUndefined");function Sa(t){return ca(t,"Union")}a(Sa,"IsUnion");function wpo(t){return ca(t,"Uint8Array")}a(wpo,"IsUint8Array");function Rpo(t){return ca(t,"Unknown")}a(Rpo,"IsUnknown");function kpo(t){return ca(t,"Unsafe")}a(kpo,"IsUnsafe");function Ppo(t){return ca(t,"Void")}a(Ppo,"IsVoid");function xU(t){return Jc(t)&&bt in t&&Ql(t[bt])}a(xU,"IsKind");function Md(t){return $Pt(t)||VPt(t)||jk(t)||gB(t)||qW(t)||QW(t)||Hk(t)||Gk(t)||Tpo(t)||$k(t)||Vk(t)||ff(t)||jW(t)||H1(t)||G1(t)||Hu(t)||IU(t)||Ipo(t)||tbe(t)||Wk(t)||qp(t)||HW(t)||GW(t)||Wf(t)||WPt(t)||AB(t)||rbe(t)||$1(t)||xpo(t)||V1(t)||yB(t)||Sa(t)||wpo(t)||Rpo(t)||kpo(t)||Ppo(t)||xU(t)}a(Md,"IsSchema");var it={};Ri(it,{IsAny:()=>F$r,IsArgument:()=>U$r,IsArray:()=>Q$r,IsAsyncIterator:()=>q$r,IsBigInt:()=>j$r,IsBoolean:()=>H$r,IsComputed:()=>G$r,IsConstructor:()=>$$r,IsDate:()=>V$r,IsFunction:()=>W$r,IsImport:()=>Bpo,IsInteger:()=>z$r,IsIntersect:()=>Y$r,IsIterator:()=>K$r,IsKind:()=>CVr,IsKindOf:()=>Bs,IsLiteral:()=>ibe,IsLiteralBoolean:()=>Fpo,IsLiteralNumber:()=>Z$r,IsLiteralString:()=>J$r,IsLiteralValue:()=>X$r,IsMappedKey:()=>eVr,IsMappedResult:()=>tVr,IsNever:()=>rVr,IsNot:()=>nVr,IsNull:()=>iVr,IsNumber:()=>oVr,IsObject:()=>sVr,IsOptional:()=>Lpo,IsPromise:()=>aVr,IsProperties:()=>_Ue,IsReadonly:()=>Opo,IsRecord:()=>cVr,IsRecursive:()=>Upo,IsRef:()=>lVr,IsRegExp:()=>uVr,IsSchema:()=>Gu,IsString:()=>dVr,IsSymbol:()=>fVr,IsTemplateLiteral:()=>pVr,IsThis:()=>hVr,IsTransform:()=>mVr,IsTuple:()=>gVr,IsUint8Array:()=>yVr,IsUndefined:()=>AVr,IsUnion:()=>JPt,IsUnionLiteral:()=>Qpo,IsUnknown:()=>EVr,IsUnsafe:()=>_Vr,IsVoid:()=>vVr,TypeGuardUnknownTypeError:()=>zPt});p();var zPt=class extends Qi{static{a(this,"TypeGuardUnknownTypeError")}},Dpo=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function O$r(t){try{return new RegExp(t),!0}catch{return!1}}a(O$r,"IsPattern");function YPt(t){if(!Ql(t))return!1;for(let e=0;e=7&&r<=13||r===27||r===127)return!1}return!0}a(YPt,"IsControlCharacterFree");function L$r(t){return KPt(t)||Gu(t)}a(L$r,"IsAdditionalProperties");function nbe(t){return Qp(t)||ZCe(t)}a(nbe,"IsOptionalBigInt");function ql(t){return Qp(t)||q1(t)}a(ql,"IsOptionalNumber");function KPt(t){return Qp(t)||fB(t)}a(KPt,"IsOptionalBoolean");function Zc(t){return Qp(t)||Ql(t)}a(Zc,"IsOptionalString");function Npo(t){return Qp(t)||Ql(t)&&YPt(t)&&O$r(t)}a(Npo,"IsOptionalPattern");function Mpo(t){return Qp(t)||Ql(t)&&YPt(t)}a(Mpo,"IsOptionalFormat");function B$r(t){return Qp(t)||Gu(t)}a(B$r,"IsOptionalSchema");function Opo(t){return Jc(t)&&t[qk]==="Readonly"}a(Opo,"IsReadonly");function Lpo(t){return Jc(t)&&t[AA]==="Optional"}a(Lpo,"IsOptional");function F$r(t){return Bs(t,"Any")&&Zc(t.$id)}a(F$r,"IsAny");function U$r(t){return Bs(t,"Argument")&&q1(t.index)}a(U$r,"IsArgument");function Q$r(t){return Bs(t,"Array")&&t.type==="array"&&Zc(t.$id)&&Gu(t.items)&&ql(t.minItems)&&ql(t.maxItems)&&KPt(t.uniqueItems)&&B$r(t.contains)&&ql(t.minContains)&&ql(t.maxContains)}a(Q$r,"IsArray");function q$r(t){return Bs(t,"AsyncIterator")&&t.type==="AsyncIterator"&&Zc(t.$id)&&Gu(t.items)}a(q$r,"IsAsyncIterator");function j$r(t){return Bs(t,"BigInt")&&t.type==="bigint"&&Zc(t.$id)&&nbe(t.exclusiveMaximum)&&nbe(t.exclusiveMinimum)&&nbe(t.maximum)&&nbe(t.minimum)&&nbe(t.multipleOf)}a(j$r,"IsBigInt");function H$r(t){return Bs(t,"Boolean")&&t.type==="boolean"&&Zc(t.$id)}a(H$r,"IsBoolean");function G$r(t){return Bs(t,"Computed")&&Ql(t.target)&&Up(t.parameters)&&t.parameters.every(e=>Gu(e))}a(G$r,"IsComputed");function $$r(t){return Bs(t,"Constructor")&&t.type==="Constructor"&&Zc(t.$id)&&Up(t.parameters)&&t.parameters.every(e=>Gu(e))&&Gu(t.returns)}a($$r,"IsConstructor");function V$r(t){return Bs(t,"Date")&&t.type==="Date"&&Zc(t.$id)&&ql(t.exclusiveMaximumTimestamp)&&ql(t.exclusiveMinimumTimestamp)&&ql(t.maximumTimestamp)&&ql(t.minimumTimestamp)&&ql(t.multipleOfTimestamp)}a(V$r,"IsDate");function W$r(t){return Bs(t,"Function")&&t.type==="Function"&&Zc(t.$id)&&Up(t.parameters)&&t.parameters.every(e=>Gu(e))&&Gu(t.returns)}a(W$r,"IsFunction");function Bpo(t){return Bs(t,"Import")&&pUe(t,"$defs")&&Jc(t.$defs)&&_Ue(t.$defs)&&pUe(t,"$ref")&&Ql(t.$ref)&&t.$ref in t.$defs}a(Bpo,"IsImport");function z$r(t){return Bs(t,"Integer")&&t.type==="integer"&&Zc(t.$id)&&ql(t.exclusiveMaximum)&&ql(t.exclusiveMinimum)&&ql(t.maximum)&&ql(t.minimum)&&ql(t.multipleOf)}a(z$r,"IsInteger");function _Ue(t){return Jc(t)&&Object.entries(t).every(([e,r])=>YPt(e)&&Gu(r))}a(_Ue,"IsProperties");function Y$r(t){return Bs(t,"Intersect")&&!(Ql(t.type)&&t.type!=="object")&&Up(t.allOf)&&t.allOf.every(e=>Gu(e)&&!mVr(e))&&Zc(t.type)&&(KPt(t.unevaluatedProperties)||B$r(t.unevaluatedProperties))&&Zc(t.$id)}a(Y$r,"IsIntersect");function K$r(t){return Bs(t,"Iterator")&&t.type==="Iterator"&&Zc(t.$id)&&Gu(t.items)}a(K$r,"IsIterator");function Bs(t,e){return Jc(t)&&bt in t&&t[bt]===e}a(Bs,"IsKindOf");function J$r(t){return ibe(t)&&Ql(t.const)}a(J$r,"IsLiteralString");function Z$r(t){return ibe(t)&&q1(t.const)}a(Z$r,"IsLiteralNumber");function Fpo(t){return ibe(t)&&fB(t.const)}a(Fpo,"IsLiteralBoolean");function ibe(t){return Bs(t,"Literal")&&Zc(t.$id)&&X$r(t.const)}a(ibe,"IsLiteral");function X$r(t){return fB(t)||q1(t)||Ql(t)}a(X$r,"IsLiteralValue");function eVr(t){return Bs(t,"MappedKey")&&Up(t.keys)&&t.keys.every(e=>q1(e)||Ql(e))}a(eVr,"IsMappedKey");function tVr(t){return Bs(t,"MappedResult")&&_Ue(t.properties)}a(tVr,"IsMappedResult");function rVr(t){return Bs(t,"Never")&&Jc(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(rVr,"IsNever");function nVr(t){return Bs(t,"Not")&&Gu(t.not)}a(nVr,"IsNot");function iVr(t){return Bs(t,"Null")&&t.type==="null"&&Zc(t.$id)}a(iVr,"IsNull");function oVr(t){return Bs(t,"Number")&&t.type==="number"&&Zc(t.$id)&&ql(t.exclusiveMaximum)&&ql(t.exclusiveMinimum)&&ql(t.maximum)&&ql(t.minimum)&&ql(t.multipleOf)}a(oVr,"IsNumber");function sVr(t){return Bs(t,"Object")&&t.type==="object"&&Zc(t.$id)&&_Ue(t.properties)&&L$r(t.additionalProperties)&&ql(t.minProperties)&&ql(t.maxProperties)}a(sVr,"IsObject");function aVr(t){return Bs(t,"Promise")&&t.type==="Promise"&&Zc(t.$id)&&Gu(t.item)}a(aVr,"IsPromise");function cVr(t){return Bs(t,"Record")&&t.type==="object"&&Zc(t.$id)&&L$r(t.additionalProperties)&&Jc(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&O$r(r[0])&&Jc(e.patternProperties)&&Gu(e.patternProperties[r[0]])})(t)}a(cVr,"IsRecord");function Upo(t){return Jc(t)&&YI in t&&t[YI]==="Recursive"}a(Upo,"IsRecursive");function lVr(t){return Bs(t,"Ref")&&Zc(t.$id)&&Ql(t.$ref)}a(lVr,"IsRef");function uVr(t){return Bs(t,"RegExp")&&Zc(t.$id)&&Ql(t.source)&&Ql(t.flags)&&ql(t.maxLength)&&ql(t.minLength)}a(uVr,"IsRegExp");function dVr(t){return Bs(t,"String")&&t.type==="string"&&Zc(t.$id)&&ql(t.minLength)&&ql(t.maxLength)&&Npo(t.pattern)&&Mpo(t.format)}a(dVr,"IsString");function fVr(t){return Bs(t,"Symbol")&&t.type==="symbol"&&Zc(t.$id)}a(fVr,"IsSymbol");function pVr(t){return Bs(t,"TemplateLiteral")&&t.type==="string"&&Ql(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(pVr,"IsTemplateLiteral");function hVr(t){return Bs(t,"This")&&Zc(t.$id)&&Ql(t.$ref)}a(hVr,"IsThis");function mVr(t){return Jc(t)&&Nd in t}a(mVr,"IsTransform");function gVr(t){return Bs(t,"Tuple")&&t.type==="array"&&Zc(t.$id)&&q1(t.minItems)&&q1(t.maxItems)&&t.minItems===t.maxItems&&(Qp(t.items)&&Qp(t.additionalItems)&&t.minItems===0||Up(t.items)&&t.items.every(e=>Gu(e)))}a(gVr,"IsTuple");function AVr(t){return Bs(t,"Undefined")&&t.type==="undefined"&&Zc(t.$id)}a(AVr,"IsUndefined");function Qpo(t){return JPt(t)&&t.anyOf.every(e=>J$r(e)||Z$r(e))}a(Qpo,"IsUnionLiteral");function JPt(t){return Bs(t,"Union")&&Zc(t.$id)&&Jc(t)&&Up(t.anyOf)&&t.anyOf.every(e=>Gu(e))}a(JPt,"IsUnion");function yVr(t){return Bs(t,"Uint8Array")&&t.type==="Uint8Array"&&Zc(t.$id)&&ql(t.minByteLength)&&ql(t.maxByteLength)}a(yVr,"IsUint8Array");function EVr(t){return Bs(t,"Unknown")&&Zc(t.$id)}a(EVr,"IsUnknown");function _Vr(t){return Bs(t,"Unsafe")}a(_Vr,"IsUnsafe");function vVr(t){return Bs(t,"Void")&&t.type==="void"&&Zc(t.$id)}a(vVr,"IsVoid");function CVr(t){return Jc(t)&&bt in t&&Ql(t[bt])&&!Dpo.includes(t[bt])}a(CVr,"IsKind");function Gu(t){return Jc(t)&&(F$r(t)||U$r(t)||Q$r(t)||H$r(t)||j$r(t)||q$r(t)||G$r(t)||$$r(t)||V$r(t)||W$r(t)||z$r(t)||Y$r(t)||K$r(t)||ibe(t)||eVr(t)||tVr(t)||rVr(t)||nVr(t)||iVr(t)||oVr(t)||sVr(t)||aVr(t)||cVr(t)||lVr(t)||uVr(t)||dVr(t)||fVr(t)||pVr(t)||hVr(t)||gVr(t)||AVr(t)||JPt(t)||yVr(t)||EVr(t)||_Vr(t)||vVr(t)||CVr(t))}a(Gu,"IsSchema");p();var ZPt="(true|false)",obe="(0|[1-9][0-9]*)",XPt="(.*)",qpo="(?!.*)",Khl=`^${ZPt}$`,wU=`^${obe}$`,RU=`^${XPt}$`,bVr=`^${qpo}$`;p();var zk={};Ri(zk,{Clear:()=>Hpo,Delete:()=>Gpo,Entries:()=>jpo,Get:()=>Wpo,Has:()=>$po,Set:()=>Vpo});p();var Uoe=new Map;function jpo(){return new Map(Uoe)}a(jpo,"Entries");function Hpo(){return Uoe.clear()}a(Hpo,"Clear");function Gpo(t){return Uoe.delete(t)}a(Gpo,"Delete");function $po(t){return Uoe.has(t)}a($po,"Has");function Vpo(t,e){Uoe.set(t,e)}a(Vpo,"Set");function Wpo(t){return Uoe.get(t)}a(Wpo,"Get");var I_={};Ri(I_,{Clear:()=>Ypo,Delete:()=>Kpo,Entries:()=>zpo,Get:()=>Xpo,Has:()=>Jpo,Set:()=>Zpo});p();var Qoe=new Map;function zpo(){return new Map(Qoe)}a(zpo,"Entries");function Ypo(){return Qoe.clear()}a(Ypo,"Clear");function Kpo(t){return Qoe.delete(t)}a(Kpo,"Delete");function Jpo(t){return Qoe.has(t)}a(Jpo,"Has");function Zpo(t,e){Qoe.set(t,e)}a(Zpo,"Set");function Xpo(t){return Qoe.get(t)}a(Xpo,"Get");p();function SVr(t,e){return t.includes(e)}a(SVr,"SetIncludes");function TVr(t){return[...new Set(t)]}a(TVr,"SetDistinct");function eho(t,e){return t.filter(r=>e.includes(r))}a(eho,"SetIntersect");function tho(t,e){return t.reduce((r,n)=>eho(r,n),e)}a(tho,"SetIntersectManyResolve");function IVr(t){return t.length===1?t[0]:t.length>1?tho(t.slice(1),t[0]):[]}a(IVr,"SetIntersectMany");function xVr(t){let e=[];for(let r of t)e.push(...r);return e}a(xVr,"SetUnionMany");p();function kU(t){return xt({[bt]:"Any"},t)}a(kU,"Any");p();function qoe(t,e){return xt({[bt]:"Array",type:"array",items:t},e)}a(qoe,"Array");p();function wVr(t){return xt({[bt]:"Argument",index:t})}a(wVr,"Argument");p();function joe(t,e){return xt({[bt]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(joe,"AsyncIterator");p();p();function cu(t,e,r){return xt({[bt]:"Computed",target:t,parameters:e},r)}a(cu,"Computed");p();p();function rho(t,e){let{[e]:r,...n}=t;return n}a(rho,"DiscardKey");function pf(t,e){return e.reduce((r,n)=>rho(r,n),t)}a(pf,"Discard");p();function Zo(t){return xt({[bt]:"Never",not:{}},t)}a(Zo,"Never");p();p();function ja(t){return xt({[bt]:"MappedResult",properties:t})}a(ja,"MappedResult");p();p();function Hoe(t,e,r){return xt({[bt]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(Hoe,"Constructor");p();function lM(t,e,r){return xt({[bt]:"Function",type:"Function",parameters:t,returns:e},r)}a(lM,"Function");p();p();p();p();function sbe(t,e){return xt({[bt]:"Union",anyOf:t},e)}a(sbe,"UnionCreate");function nho(t){return t.some(e=>sC(e))}a(nho,"IsUnionOptional");function RVr(t){return t.map(e=>sC(e)?iho(e):e)}a(RVr,"RemoveOptionalFromRest");function iho(t){return pf(t,[AA])}a(iho,"RemoveOptionalFromType");function oho(t,e){return nho(t)?qy(sbe(RVr(t),e)):sbe(RVr(t),e)}a(oho,"ResolveUnion");function uM(t,e){return t.length===1?xt(t[0],e):t.length===0?Zo(e):oho(t,e)}a(uM,"UnionEvaluated");p();function ic(t,e){return t.length===0?Zo(e):t.length===1?xt(t[0],e):sbe(t,e)}a(ic,"Union");p();p();p();var vUe=class extends Qi{static{a(this,"TemplateLiteralParserError")}};function sho(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(sho,"Unescape");function e2t(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(e2t,"IsNonEscaped");function _B(t,e){return e2t(t,e,"(")}a(_B,"IsOpenParen");function abe(t,e){return e2t(t,e,")")}a(abe,"IsCloseParen");function kVr(t,e){return e2t(t,e,"|")}a(kVr,"IsSeparator");function aho(t){if(!(_B(t,0)&&abe(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(Goe(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(Goe(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(dho,"Or");function fho(t){function e(o,s){if(!_B(o,s))throw new vUe("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(Goe(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(fho,"And");function Goe(t){return aho(t)?Goe(cho(t)):lho(t)?dho(t):uho(t)?fho(t):{type:"const",const:sho(t)}}a(Goe,"TemplateLiteralParse");function $oe(t){return Goe(t.slice(1,t.length-1))}a($oe,"TemplateLiteralParseExact");var t2t=class extends Qi{static{a(this,"TemplateLiteralFiniteError")}};function pho(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="0"&&t.expr[1].type==="const"&&t.expr[1].const==="[1-9][0-9]*"}a(pho,"IsNumberExpression");function hho(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="true"&&t.expr[1].type==="const"&&t.expr[1].const==="false"}a(hho,"IsBooleanExpression");function mho(t){return t.type==="const"&&t.const===".*"}a(mho,"IsStringExpression");function $W(t){return pho(t)||mho(t)?!1:hho(t)?!0:t.type==="and"?t.expr.every(e=>$W(e)):t.type==="or"?t.expr.every(e=>$W(e)):t.type==="const"?!0:(()=>{throw new t2t("Unknown expression type")})()}a($W,"IsTemplateLiteralExpressionFinite");function CUe(t){let e=$oe(t.pattern);return $W(e)}a(CUe,"IsTemplateLiteralFinite");p();var r2t=class extends Qi{static{a(this,"TemplateLiteralGenerateError")}};function*PVr(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of PVr(t.slice(1)))yield`${e}${r}`}a(PVr,"GenerateReduce");function*gho(t){return yield*PVr(t.expr.map(e=>[...cbe(e)]))}a(gho,"GenerateAnd");function*Aho(t){for(let e of t.expr)yield*cbe(e)}a(Aho,"GenerateOr");function*yho(t){return yield t.const}a(yho,"GenerateConst");function*cbe(t){return t.type==="and"?yield*gho(t):t.type==="or"?yield*Aho(t):t.type==="const"?yield*yho(t):(()=>{throw new r2t("Unknown expression")})()}a(cbe,"TemplateLiteralExpressionGenerate");function Voe(t){let e=$oe(t.pattern);return $W(e)?[...cbe(e)]:[]}a(Voe,"TemplateLiteralGenerate");p();p();function la(t,e){return xt({[bt]:"Literal",const:t,type:typeof t},e)}a(la,"Literal");p();function bUe(t){return xt({[bt]:"Boolean",type:"boolean"},t)}a(bUe,"Boolean");p();function Woe(t){return xt({[bt]:"BigInt",type:"bigint"},t)}a(Woe,"BigInt");p();function KI(t){return xt({[bt]:"Number",type:"number"},t)}a(KI,"Number");p();function x_(t){return xt({[bt]:"String",type:"string"},t)}a(x_,"String");function*Eho(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield bUe():e==="number"?yield KI():e==="bigint"?yield Woe():e==="string"?yield x_():yield(()=>{let r=e.split("|").map(n=>la(n.trim()));return r.length===0?Zo():r.length===1?r[0]:uM(r)})()}a(Eho,"FromUnion");function*_ho(t){if(t[1]!=="{"){let e=la("$"),r=n2t(t.slice(1));return yield*[e,...r]}for(let e=2;eNVr(r,e)).join("|")})`:Wk(t)?`${e}${obe}`:Vk(t)?`${e}${obe}`:qW(t)?`${e}${obe}`:AB(t)?`${e}${XPt}`:H1(t)?`${e}${vho(t.const.toString())}`:gB(t)?`${e}${ZPt}`:(()=>{throw new i2t(`Unexpected Kind '${t[bt]}'`)})()}a(NVr,"Visit");function o2t(t){return`^${t.map(e=>NVr(e,"")).join("")}$`}a(o2t,"TemplateLiteralPattern");p();function VW(t){let r=Voe(t).map(n=>la(n));return uM(r)}a(VW,"TemplateLiteralToUnion");p();function SUe(t,e){let r=Ql(t)?o2t(DVr(t)):o2t(t);return xt({[bt]:"TemplateLiteral",type:"string",pattern:r},e)}a(SUe,"TemplateLiteral");function Cho(t){return Voe(t).map(r=>r.toString())}a(Cho,"FromTemplateLiteral");function bho(t){let e=[];for(let r of t)e.push(...aC(r));return e}a(bho,"FromUnion");function Sho(t){return[t.toString()]}a(Sho,"FromLiteral");function aC(t){return[...new Set($1(t)?Cho(t):Sa(t)?bho(t.anyOf):H1(t)?Sho(t.const):Wk(t)?["[number]"]:Vk(t)?["[number]"]:[])]}a(aC,"IndexPropertyKeys");p();function Tho(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=PU(t,aC(e[o]),r);return n}a(Tho,"FromProperties");function Iho(t,e,r){return Tho(t,e.properties,r)}a(Iho,"FromMappedResult");function MVr(t,e,r){let n=Iho(t,e,r);return ja(n)}a(MVr,"IndexFromMappedResult");function LVr(t,e){return t.map(r=>BVr(r,e))}a(LVr,"FromRest");function xho(t){return t.filter(e=>!IU(e))}a(xho,"FromIntersectRest");function who(t,e){return TUe(xho(LVr(t,e)))}a(who,"FromIntersect");function Rho(t){return t.some(e=>IU(e))?[]:t}a(Rho,"FromUnionRest");function kho(t,e){return uM(Rho(LVr(t,e)))}a(kho,"FromUnion");function Pho(t,e){return e in t?t[e]:e==="[number]"?uM(t):Zo()}a(Pho,"FromTuple");function Dho(t,e){return e==="[number]"?t:Zo()}a(Dho,"FromArray");function Nho(t,e){return e in t?t[e]:Zo()}a(Nho,"FromProperty");function BVr(t,e){return ff(t)?who(t.allOf,e):Sa(t)?kho(t.anyOf,e):V1(t)?Pho(t.items??[],e):jk(t)?Dho(t.items,e):qp(t)?Nho(t.properties,e):Zo()}a(BVr,"IndexFromPropertyKey");function lbe(t,e){return e.map(r=>BVr(t,r))}a(lbe,"IndexFromPropertyKeys");function OVr(t,e){return uM(lbe(t,e))}a(OVr,"FromSchema");function PU(t,e,r){if(Wf(t)||Wf(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!Md(t)||!Md(e))throw new Qi(n);return cu("Index",[t,e])}return Hu(e)?MVr(t,e,r):G1(e)?FVr(t,e,r):xt(Md(e)?OVr(t,aC(e)):OVr(t,e),r)}a(PU,"Index");function Mho(t,e,r){return{[e]:PU(t,[e],qu(r))}}a(Mho,"MappedIndexPropertyKey");function Oho(t,e,r){return e.reduce((n,o)=>({...n,...Mho(t,o,r)}),{})}a(Oho,"MappedIndexPropertyKeys");function Lho(t,e,r){return Oho(t,e.keys,r)}a(Lho,"MappedIndexProperties");function FVr(t,e,r){let n=Lho(t,e,r);return ja(n)}a(FVr,"IndexFromMappedKey");p();function zoe(t,e){return xt({[bt]:"Iterator",type:"Iterator",items:t},e)}a(zoe,"Iterator");p();function Bho(t){return globalThis.Object.keys(t).filter(e=>!sC(t[e]))}a(Bho,"RequiredArray");function Fho(t,e){let r=Bho(t),n=r.length>0?{[bt]:"Object",type:"object",required:r,properties:t}:{[bt]:"Object",type:"object",properties:t};return xt(n,e)}a(Fho,"_Object_");var oc=Fho;p();function IUe(t,e){return xt({[bt]:"Promise",type:"Promise",item:t},e)}a(IUe,"Promise");p();p();function Uho(t){return xt(pf(t,[qk]))}a(Uho,"RemoveReadonly");function Qho(t){return xt({...t,[qk]:"Readonly"})}a(Qho,"AddReadonly");function qho(t,e){return e===!1?Uho(t):Qho(t)}a(qho,"ReadonlyWithFlag");function cC(t,e){let r=e??!0;return Hu(t)?UVr(t,r):qho(t,r)}a(cC,"Readonly");function jho(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=cC(t[n],e);return r}a(jho,"FromProperties");function Hho(t,e){return jho(t.properties,e)}a(Hho,"FromMappedResult");function UVr(t,e){let r=Hho(t,e);return ja(r)}a(UVr,"ReadonlyFromMappedResult");p();function JI(t,e){return xt(t.length>0?{[bt]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[bt]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(JI,"Tuple");function QVr(t,e){return t in e?ZI(t,e[t]):ja(e)}a(QVr,"FromMappedResult");function Gho(t){return{[t]:la(t)}}a(Gho,"MappedKeyToKnownMappedResultProperties");function $ho(t){let e={};for(let r of t)e[r]=la(r);return e}a($ho,"MappedKeyToUnknownMappedResultProperties");function Vho(t,e){return SVr(e,t)?Gho(t):$ho(e)}a(Vho,"MappedKeyToMappedResultProperties");function Who(t,e){let r=Vho(t,e);return QVr(t,r)}a(Who,"FromMappedKey");function ube(t,e){return e.map(r=>ZI(t,r))}a(ube,"FromRest");function zho(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=ZI(t,e[n]);return r}a(zho,"FromProperties");function ZI(t,e){let r={...e};return sC(e)?qy(ZI(t,pf(e,[AA]))):Foe(e)?cC(ZI(t,pf(e,[qk]))):Hu(e)?QVr(t,e.properties):G1(e)?Who(t,e.keys):Gk(e)?Hoe(ube(t,e.parameters),ZI(t,e.returns),r):$k(e)?lM(ube(t,e.parameters),ZI(t,e.returns),r):QW(e)?joe(ZI(t,e.items),r):jW(e)?zoe(ZI(t,e.items),r):ff(e)?jy(ube(t,e.allOf),r):Sa(e)?ic(ube(t,e.anyOf),r):V1(e)?JI(ube(t,e.items??[]),r):qp(e)?oc(zho(t,e.properties),r):jk(e)?qoe(ZI(t,e.items),r):HW(e)?IUe(ZI(t,e.item),r):e}a(ZI,"FromSchemaType");function Yho(t,e){let r={};for(let n of t)r[n]=ZI(n,e);return r}a(Yho,"MappedFunctionReturnType");function qVr(t,e,r){let n=Md(t)?aC(t):t,o=e({[bt]:"MappedKey",keys:n}),s=Yho(n,o);return oc(s,r)}a(qVr,"Mapped");p();function Kho(t){return xt(pf(t,[AA]))}a(Kho,"RemoveOptional");function Jho(t){return xt({...t,[AA]:"Optional"})}a(Jho,"AddOptional");function Zho(t,e){return e===!1?Kho(t):Jho(t)}a(Zho,"OptionalWithFlag");function qy(t,e){let r=e??!0;return Hu(t)?jVr(t,r):Zho(t,r)}a(qy,"Optional");function Xho(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=qy(t[n],e);return r}a(Xho,"FromProperties");function emo(t,e){return Xho(t.properties,e)}a(emo,"FromMappedResult");function jVr(t,e){let r=emo(t,e);return ja(r)}a(jVr,"OptionalFromMappedResult");p();function dbe(t,e={}){let r=t.every(o=>qp(o)),n=Md(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return xt(e.unevaluatedProperties===!1||Md(e.unevaluatedProperties)||r?{...n,[bt]:"Intersect",type:"object",allOf:t}:{...n,[bt]:"Intersect",allOf:t},e)}a(dbe,"IntersectCreate");function tmo(t){return t.every(e=>sC(e))}a(tmo,"IsIntersectOptional");function rmo(t){return pf(t,[AA])}a(rmo,"RemoveOptionalFromType");function HVr(t){return t.map(e=>sC(e)?rmo(e):e)}a(HVr,"RemoveOptionalFromRest");function nmo(t,e){return tmo(t)?qy(dbe(HVr(t),e)):dbe(HVr(t),e)}a(nmo,"ResolveIntersect");function TUe(t,e={}){if(t.length===1)return xt(t[0],e);if(t.length===0)return Zo(e);if(t.some(r=>nc(r)))throw new Error("Cannot intersect transform types");return nmo(t,e)}a(TUe,"IntersectEvaluated");p();function jy(t,e){if(t.length===1)return xt(t[0],e);if(t.length===0)return Zo(e);if(t.some(r=>nc(r)))throw new Error("Cannot intersect transform types");return dbe(t,e)}a(jy,"Intersect");p();function XI(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new Qi("Ref: $ref must be a string");return xt({[bt]:"Ref",$ref:e},r)}a(XI,"Ref");function imo(t,e){return cu("Awaited",[cu(t,e)])}a(imo,"FromComputed");function omo(t){return cu("Awaited",[XI(t)])}a(omo,"FromRef");function smo(t){return jy(GVr(t))}a(smo,"FromIntersect");function amo(t){return ic(GVr(t))}a(amo,"FromUnion");function cmo(t){return Yoe(t)}a(cmo,"FromPromise");function GVr(t){return t.map(e=>Yoe(e))}a(GVr,"FromRest");function Yoe(t,e){return xt(Hk(t)?imo(t.target,t.parameters):ff(t)?smo(t.allOf):Sa(t)?amo(t.anyOf):HW(t)?cmo(t.item):Wf(t)?omo(t.$ref):t,e)}a(Yoe,"Awaited");p();p();p();p();function $Vr(t){let e=[];for(let r of t)e.push(lC(r));return e}a($Vr,"FromRest");function lmo(t){let e=$Vr(t);return xVr(e)}a(lmo,"FromIntersect");function umo(t){let e=$Vr(t);return IVr(e)}a(umo,"FromUnion");function dmo(t){return t.map((e,r)=>r.toString())}a(dmo,"FromTuple");function fmo(t){return["[number]"]}a(fmo,"FromArray");function pmo(t){return globalThis.Object.getOwnPropertyNames(t)}a(pmo,"FromProperties");function hmo(t){return s2t?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(hmo,"FromPatternProperties");function lC(t){return ff(t)?lmo(t.allOf):Sa(t)?umo(t.anyOf):V1(t)?dmo(t.items??[]):jk(t)?fmo(t.items):qp(t)?pmo(t.properties):GW(t)?hmo(t.patternProperties):[]}a(lC,"KeyOfPropertyKeys");var s2t=!1;function vB(t){s2t=!0;let e=lC(t);return s2t=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(vB,"KeyOfPattern");function mmo(t,e){return cu("KeyOf",[cu(t,e)])}a(mmo,"FromComputed");function gmo(t){return cu("KeyOf",[XI(t)])}a(gmo,"FromRef");function Amo(t,e){let r=lC(t),n=ymo(r),o=uM(n);return xt(o,e)}a(Amo,"KeyOfFromType");function ymo(t){return t.map(e=>e==="[number]"?KI():la(e))}a(ymo,"KeyOfPropertyKeysToRest");function Koe(t,e){return Hk(t)?mmo(t.target,t.parameters):Wf(t)?gmo(t.$ref):Hu(t)?VVr(t,e):Amo(t,e)}a(Koe,"KeyOf");function Emo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Koe(t[n],qu(e));return r}a(Emo,"FromProperties");function _mo(t,e){return Emo(t.properties,e)}a(_mo,"FromMappedResult");function VVr(t,e){let r=_mo(t,e);return ja(r)}a(VVr,"KeyOfFromMappedResult");p();function xUe(t){let e=lC(t),r=lbe(t,e);return e.map((n,o)=>[e[o],r[o]])}a(xUe,"KeyOfPropertyEntries");function vmo(t){let e=[];for(let r of t)e.push(...lC(r));return TVr(e)}a(vmo,"CompositeKeys");function Cmo(t){return t.filter(e=>!IU(e))}a(Cmo,"FilterNever");function bmo(t,e){let r=[];for(let n of t)r.push(...lbe(n,[e]));return Cmo(r)}a(bmo,"CompositeProperty");function Smo(t,e){let r={};for(let n of e)r[n]=TUe(bmo(t,n));return r}a(Smo,"CompositeProperties");function WVr(t,e){let r=vmo(t),n=Smo(t,r);return oc(n,e)}a(WVr,"Composite");p();p();function wUe(t){return xt({[bt]:"Date",type:"Date"},t)}a(wUe,"Date");p();function RUe(t){return xt({[bt]:"Null",type:"null"},t)}a(RUe,"Null");p();function kUe(t){return xt({[bt]:"Symbol",type:"symbol"},t)}a(kUe,"Symbol");p();function PUe(t){return xt({[bt]:"Undefined",type:"undefined"},t)}a(PUe,"Undefined");p();function DUe(t){return xt({[bt]:"Uint8Array",type:"Uint8Array"},t)}a(DUe,"Uint8Array");p();function Yk(t){return xt({[bt]:"Unknown"},t)}a(Yk,"Unknown");function Tmo(t){return t.map(e=>a2t(e,!1))}a(Tmo,"FromArray");function Imo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=cC(a2t(t[r],!1));return e}a(Imo,"FromProperties");function NUe(t,e){return e===!0?t:cC(t)}a(NUe,"ConditionalReadonly");function a2t(t,e){return UPt(t)?NUe(kU(),e):qPt(t)?NUe(kU(),e):Up(t)?cC(JI(Tmo(t))):pB(t)?DUe():UW(t)?wUe():Jc(t)?NUe(oc(Imo(t)),e):QPt(t)?NUe(lM([],Yk()),e):Qp(t)?PUe():jPt(t)?RUe():HPt(t)?kUe():ZCe(t)?Woe():q1(t)?la(t):fB(t)?la(t):Ql(t)?la(t):oc({})}a(a2t,"FromValue");function zVr(t,e){return xt(a2t(t,!0),e)}a(zVr,"Const");p();function YVr(t,e){return Gk(t)?JI(t.parameters,e):Zo(e)}a(YVr,"ConstructorParameters");p();function KVr(t,e){if(Qp(t))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(t).filter(s=>isNaN(s)).map(s=>t[s]),o=[...new Set(r)].map(s=>la(s));return ic(o,{...e,[YI]:"Enum"})}a(KVr,"Enum");p();p();p();var l2t=class extends Qi{static{a(this,"ExtendsResolverError")}},wt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(wt||(wt={}));function ex(t){return t===wt.False?t:wt.True}a(ex,"IntoBooleanResult");function Joe(t){throw new l2t(t)}a(Joe,"Throw");function Rh(t){return it.IsNever(t)||it.IsIntersect(t)||it.IsUnion(t)||it.IsUnknown(t)||it.IsAny(t)}a(Rh,"IsStructuralRight");function kh(t,e){return it.IsNever(e)?nWr(t,e):it.IsIntersect(e)?MUe(t,e):it.IsUnion(e)?p2t(t,e):it.IsUnknown(e)?aWr(t,e):it.IsAny(e)?f2t(t,e):Joe("StructuralRight")}a(kh,"StructuralRight");function f2t(t,e){return wt.True}a(f2t,"FromAnyRight");function xmo(t,e){return it.IsIntersect(e)?MUe(t,e):it.IsUnion(e)&&e.anyOf.some(r=>it.IsAny(r)||it.IsUnknown(r))?wt.True:it.IsUnion(e)?wt.Union:it.IsUnknown(e)||it.IsAny(e)?wt.True:wt.Union}a(xmo,"FromAny");function wmo(t,e){return it.IsUnknown(t)?wt.False:it.IsAny(t)?wt.Union:it.IsNever(t)?wt.True:wt.False}a(wmo,"FromArrayRight");function Rmo(t,e){return it.IsObject(e)&&OUe(e)?wt.True:Rh(e)?kh(t,e):it.IsArray(e)?ex(Xc(t.items,e.items)):wt.False}a(Rmo,"FromArray");function kmo(t,e){return Rh(e)?kh(t,e):it.IsAsyncIterator(e)?ex(Xc(t.items,e.items)):wt.False}a(kmo,"FromAsyncIterator");function Pmo(t,e){return Rh(e)?kh(t,e):it.IsObject(e)?Hy(t,e):it.IsRecord(e)?tx(t,e):it.IsBigInt(e)?wt.True:wt.False}a(Pmo,"FromBigInt");function tWr(t,e){return it.IsLiteralBoolean(t)||it.IsBoolean(t)?wt.True:wt.False}a(tWr,"FromBooleanRight");function Dmo(t,e){return Rh(e)?kh(t,e):it.IsObject(e)?Hy(t,e):it.IsRecord(e)?tx(t,e):it.IsBoolean(e)?wt.True:wt.False}a(Dmo,"FromBoolean");function Nmo(t,e){return Rh(e)?kh(t,e):it.IsObject(e)?Hy(t,e):it.IsConstructor(e)?t.parameters.length>e.parameters.length?wt.False:t.parameters.every((r,n)=>ex(Xc(e.parameters[n],r))===wt.True)?ex(Xc(t.returns,e.returns)):wt.False:wt.False}a(Nmo,"FromConstructor");function Mmo(t,e){return Rh(e)?kh(t,e):it.IsObject(e)?Hy(t,e):it.IsRecord(e)?tx(t,e):it.IsDate(e)?wt.True:wt.False}a(Mmo,"FromDate");function Omo(t,e){return Rh(e)?kh(t,e):it.IsObject(e)?Hy(t,e):it.IsFunction(e)?t.parameters.length>e.parameters.length?wt.False:t.parameters.every((r,n)=>ex(Xc(e.parameters[n],r))===wt.True)?ex(Xc(t.returns,e.returns)):wt.False:wt.False}a(Omo,"FromFunction");function rWr(t,e){return it.IsLiteral(t)&&Qy.IsNumber(t.const)||it.IsNumber(t)||it.IsInteger(t)?wt.True:wt.False}a(rWr,"FromIntegerRight");function Lmo(t,e){return it.IsInteger(e)||it.IsNumber(e)?wt.True:Rh(e)?kh(t,e):it.IsObject(e)?Hy(t,e):it.IsRecord(e)?tx(t,e):wt.False}a(Lmo,"FromInteger");function MUe(t,e){return e.allOf.every(r=>Xc(t,r)===wt.True)?wt.True:wt.False}a(MUe,"FromIntersectRight");function Bmo(t,e){return t.allOf.some(r=>Xc(r,e)===wt.True)?wt.True:wt.False}a(Bmo,"FromIntersect");function Fmo(t,e){return Rh(e)?kh(t,e):it.IsIterator(e)?ex(Xc(t.items,e.items)):wt.False}a(Fmo,"FromIterator");function Umo(t,e){return it.IsLiteral(e)&&e.const===t.const?wt.True:Rh(e)?kh(t,e):it.IsObject(e)?Hy(t,e):it.IsRecord(e)?tx(t,e):it.IsString(e)?sWr(t,e):it.IsNumber(e)?iWr(t,e):it.IsInteger(e)?rWr(t,e):it.IsBoolean(e)?tWr(t,e):wt.False}a(Umo,"FromLiteral");function nWr(t,e){return wt.False}a(nWr,"FromNeverRight");function Qmo(t,e){return wt.True}a(Qmo,"FromNever");function JVr(t){let[e,r]=[t,0];for(;it.IsNot(e);)e=e.not,r+=1;return r%2===0?e:Yk()}a(JVr,"UnwrapTNot");function qmo(t,e){return it.IsNot(t)?Xc(JVr(t),e):it.IsNot(e)?Xc(t,JVr(e)):Joe("Invalid fallthrough for Not")}a(qmo,"FromNot");function jmo(t,e){return Rh(e)?kh(t,e):it.IsObject(e)?Hy(t,e):it.IsRecord(e)?tx(t,e):it.IsNull(e)?wt.True:wt.False}a(jmo,"FromNull");function iWr(t,e){return it.IsLiteralNumber(t)||it.IsNumber(t)||it.IsInteger(t)?wt.True:wt.False}a(iWr,"FromNumberRight");function Hmo(t,e){return Rh(e)?kh(t,e):it.IsObject(e)?Hy(t,e):it.IsRecord(e)?tx(t,e):it.IsInteger(e)||it.IsNumber(e)?wt.True:wt.False}a(Hmo,"FromNumber");function uC(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(uC,"IsObjectPropertyCount");function ZVr(t){return OUe(t)}a(ZVr,"IsObjectStringLike");function XVr(t){return uC(t,0)||uC(t,1)&&"description"in t.properties&&it.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(it.IsString(t.properties.description.anyOf[0])&&it.IsUndefined(t.properties.description.anyOf[1])||it.IsString(t.properties.description.anyOf[1])&&it.IsUndefined(t.properties.description.anyOf[0]))}a(XVr,"IsObjectSymbolLike");function c2t(t){return uC(t,0)}a(c2t,"IsObjectNumberLike");function eWr(t){return uC(t,0)}a(eWr,"IsObjectBooleanLike");function Gmo(t){return uC(t,0)}a(Gmo,"IsObjectBigIntLike");function $mo(t){return uC(t,0)}a($mo,"IsObjectDateLike");function Vmo(t){return OUe(t)}a(Vmo,"IsObjectUint8ArrayLike");function Wmo(t){let e=KI();return uC(t,0)||uC(t,1)&&"length"in t.properties&&ex(Xc(t.properties.length,e))===wt.True}a(Wmo,"IsObjectFunctionLike");function zmo(t){return uC(t,0)}a(zmo,"IsObjectConstructorLike");function OUe(t){let e=KI();return uC(t,0)||uC(t,1)&&"length"in t.properties&&ex(Xc(t.properties.length,e))===wt.True}a(OUe,"IsObjectArrayLike");function Ymo(t){let e=lM([kU()],kU());return uC(t,0)||uC(t,1)&&"then"in t.properties&&ex(Xc(t.properties.then,e))===wt.True}a(Ymo,"IsObjectPromiseLike");function oWr(t,e){return Xc(t,e)===wt.False||it.IsOptional(t)&&!it.IsOptional(e)?wt.False:wt.True}a(oWr,"Property");function Hy(t,e){return it.IsUnknown(t)?wt.False:it.IsAny(t)?wt.Union:it.IsNever(t)||it.IsLiteralString(t)&&ZVr(e)||it.IsLiteralNumber(t)&&c2t(e)||it.IsLiteralBoolean(t)&&eWr(e)||it.IsSymbol(t)&&XVr(e)||it.IsBigInt(t)&&Gmo(e)||it.IsString(t)&&ZVr(e)||it.IsSymbol(t)&&XVr(e)||it.IsNumber(t)&&c2t(e)||it.IsInteger(t)&&c2t(e)||it.IsBoolean(t)&&eWr(e)||it.IsUint8Array(t)&&Vmo(e)||it.IsDate(t)&&$mo(e)||it.IsConstructor(t)&&zmo(e)||it.IsFunction(t)&&Wmo(e)?wt.True:it.IsRecord(t)&&it.IsString(u2t(t))?e[YI]==="Record"?wt.True:wt.False:it.IsRecord(t)&&it.IsNumber(u2t(t))&&uC(e,0)?wt.True:wt.False}a(Hy,"FromObjectRight");function Kmo(t,e){return Rh(e)?kh(t,e):it.IsRecord(e)?tx(t,e):it.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!it.IsOptional(e.properties[r]))return wt.False;if(it.IsOptional(e.properties[r]))return wt.True;if(oWr(t.properties[r],e.properties[r])===wt.False)return wt.False}return wt.True})():wt.False}a(Kmo,"FromObject");function Jmo(t,e){return Rh(e)?kh(t,e):it.IsObject(e)&&Ymo(e)?wt.True:it.IsPromise(e)?ex(Xc(t.item,e.item)):wt.False}a(Jmo,"FromPromise");function u2t(t){return wU in t.patternProperties?KI():RU in t.patternProperties?x_():Joe("Unknown record key pattern")}a(u2t,"RecordKey");function d2t(t){return wU in t.patternProperties?t.patternProperties[wU]:RU in t.patternProperties?t.patternProperties[RU]:Joe("Unable to get record value schema")}a(d2t,"RecordValue");function tx(t,e){let[r,n]=[u2t(e),d2t(e)];return it.IsLiteralString(t)&&it.IsNumber(r)&&ex(Xc(t,n))===wt.True?wt.True:it.IsUint8Array(t)&&it.IsNumber(r)||it.IsString(t)&&it.IsNumber(r)||it.IsArray(t)&&it.IsNumber(r)?Xc(t,n):it.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(oWr(n,t.properties[o])===wt.False)return wt.False;return wt.True})():wt.False}a(tx,"FromRecordRight");function Zmo(t,e){return Rh(e)?kh(t,e):it.IsObject(e)?Hy(t,e):it.IsRecord(e)?Xc(d2t(t),d2t(e)):wt.False}a(Zmo,"FromRecord");function Xmo(t,e){let r=it.IsRegExp(t)?x_():t,n=it.IsRegExp(e)?x_():e;return Xc(r,n)}a(Xmo,"FromRegExp");function sWr(t,e){return it.IsLiteral(t)&&Qy.IsString(t.const)||it.IsString(t)?wt.True:wt.False}a(sWr,"FromStringRight");function e0o(t,e){return Rh(e)?kh(t,e):it.IsObject(e)?Hy(t,e):it.IsRecord(e)?tx(t,e):it.IsString(e)?wt.True:wt.False}a(e0o,"FromString");function t0o(t,e){return Rh(e)?kh(t,e):it.IsObject(e)?Hy(t,e):it.IsRecord(e)?tx(t,e):it.IsSymbol(e)?wt.True:wt.False}a(t0o,"FromSymbol");function r0o(t,e){return it.IsTemplateLiteral(t)?Xc(VW(t),e):it.IsTemplateLiteral(e)?Xc(t,VW(e)):Joe("Invalid fallthrough for TemplateLiteral")}a(r0o,"FromTemplateLiteral");function n0o(t,e){return it.IsArray(e)&&t.items!==void 0&&t.items.every(r=>Xc(r,e.items)===wt.True)}a(n0o,"IsArrayOfTuple");function i0o(t,e){return it.IsNever(t)?wt.True:it.IsUnknown(t)?wt.False:it.IsAny(t)?wt.Union:wt.False}a(i0o,"FromTupleRight");function o0o(t,e){return Rh(e)?kh(t,e):it.IsObject(e)&&OUe(e)||it.IsArray(e)&&n0o(t,e)?wt.True:it.IsTuple(e)?Qy.IsUndefined(t.items)&&!Qy.IsUndefined(e.items)||!Qy.IsUndefined(t.items)&&Qy.IsUndefined(e.items)?wt.False:Qy.IsUndefined(t.items)&&!Qy.IsUndefined(e.items)||t.items.every((r,n)=>Xc(r,e.items[n])===wt.True)?wt.True:wt.False:wt.False}a(o0o,"FromTuple");function s0o(t,e){return Rh(e)?kh(t,e):it.IsObject(e)?Hy(t,e):it.IsRecord(e)?tx(t,e):it.IsUint8Array(e)?wt.True:wt.False}a(s0o,"FromUint8Array");function a0o(t,e){return Rh(e)?kh(t,e):it.IsObject(e)?Hy(t,e):it.IsRecord(e)?tx(t,e):it.IsVoid(e)?u0o(t,e):it.IsUndefined(e)?wt.True:wt.False}a(a0o,"FromUndefined");function p2t(t,e){return e.anyOf.some(r=>Xc(t,r)===wt.True)?wt.True:wt.False}a(p2t,"FromUnionRight");function c0o(t,e){return t.anyOf.every(r=>Xc(r,e)===wt.True)?wt.True:wt.False}a(c0o,"FromUnion");function aWr(t,e){return wt.True}a(aWr,"FromUnknownRight");function l0o(t,e){return it.IsNever(e)?nWr(t,e):it.IsIntersect(e)?MUe(t,e):it.IsUnion(e)?p2t(t,e):it.IsAny(e)?f2t(t,e):it.IsString(e)?sWr(t,e):it.IsNumber(e)?iWr(t,e):it.IsInteger(e)?rWr(t,e):it.IsBoolean(e)?tWr(t,e):it.IsArray(e)?wmo(t,e):it.IsTuple(e)?i0o(t,e):it.IsObject(e)?Hy(t,e):it.IsUnknown(e)?wt.True:wt.False}a(l0o,"FromUnknown");function u0o(t,e){return it.IsUndefined(t)||it.IsUndefined(t)?wt.True:wt.False}a(u0o,"FromVoidRight");function d0o(t,e){return it.IsIntersect(e)?MUe(t,e):it.IsUnion(e)?p2t(t,e):it.IsUnknown(e)?aWr(t,e):it.IsAny(e)?f2t(t,e):it.IsObject(e)?Hy(t,e):it.IsVoid(e)?wt.True:wt.False}a(d0o,"FromVoid");function Xc(t,e){return it.IsTemplateLiteral(t)||it.IsTemplateLiteral(e)?r0o(t,e):it.IsRegExp(t)||it.IsRegExp(e)?Xmo(t,e):it.IsNot(t)||it.IsNot(e)?qmo(t,e):it.IsAny(t)?xmo(t,e):it.IsArray(t)?Rmo(t,e):it.IsBigInt(t)?Pmo(t,e):it.IsBoolean(t)?Dmo(t,e):it.IsAsyncIterator(t)?kmo(t,e):it.IsConstructor(t)?Nmo(t,e):it.IsDate(t)?Mmo(t,e):it.IsFunction(t)?Omo(t,e):it.IsInteger(t)?Lmo(t,e):it.IsIntersect(t)?Bmo(t,e):it.IsIterator(t)?Fmo(t,e):it.IsLiteral(t)?Umo(t,e):it.IsNever(t)?Qmo(t,e):it.IsNull(t)?jmo(t,e):it.IsNumber(t)?Hmo(t,e):it.IsObject(t)?Kmo(t,e):it.IsRecord(t)?Zmo(t,e):it.IsString(t)?e0o(t,e):it.IsSymbol(t)?t0o(t,e):it.IsTuple(t)?o0o(t,e):it.IsPromise(t)?Jmo(t,e):it.IsUint8Array(t)?s0o(t,e):it.IsUndefined(t)?a0o(t,e):it.IsUnion(t)?c0o(t,e):it.IsUnknown(t)?l0o(t,e):it.IsVoid(t)?d0o(t,e):Joe(`Unknown left type operand '${t[bt]}'`)}a(Xc,"Visit");function DU(t,e){return Xc(t,e)}a(DU,"ExtendsCheck");p();p();p();function f0o(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=Zoe(t[c],e,r,n,qu(o));return s}a(f0o,"FromProperties");function p0o(t,e,r,n,o){return f0o(t.properties,e,r,n,o)}a(p0o,"FromMappedResult");function cWr(t,e,r,n,o){let s=p0o(t,e,r,n,o);return ja(s)}a(cWr,"ExtendsFromMappedResult");function h0o(t,e,r,n){let o=DU(t,e);return o===wt.Union?ic([r,n]):o===wt.True?r:n}a(h0o,"ExtendsResolve");function Zoe(t,e,r,n,o){return Hu(t)?cWr(t,e,r,n,o):G1(t)?xt(lWr(t,e,r,n,o)):xt(h0o(t,e,r,n),o)}a(Zoe,"Extends");function m0o(t,e,r,n,o){return{[t]:Zoe(la(t),e,r,n,qu(o))}}a(m0o,"FromPropertyKey");function g0o(t,e,r,n,o){return t.reduce((s,c)=>({...s,...m0o(c,e,r,n,o)}),{})}a(g0o,"FromPropertyKeys");function A0o(t,e,r,n,o){return g0o(t.keys,e,r,n,o)}a(A0o,"FromMappedKey");function lWr(t,e,r,n,o){let s=A0o(t,e,r,n,o);return ja(s)}a(lWr,"ExtendsFromMappedKey");p();function y0o(t){return t.allOf.every(e=>CB(e))}a(y0o,"Intersect");function E0o(t){return t.anyOf.some(e=>CB(e))}a(E0o,"Union");function _0o(t){return!CB(t.not)}a(_0o,"Not");function CB(t){return t[bt]==="Intersect"?y0o(t):t[bt]==="Union"?E0o(t):t[bt]==="Not"?_0o(t):t[bt]==="Undefined"}a(CB,"ExtendsUndefinedCheck");p();function uWr(t,e){return Xoe(VW(t),e)}a(uWr,"ExcludeFromTemplateLiteral");function v0o(t,e){let r=t.filter(n=>DU(n,e)===wt.False);return r.length===1?r[0]:ic(r)}a(v0o,"ExcludeRest");function Xoe(t,e,r={}){return $1(t)?xt(uWr(t,e),r):Hu(t)?xt(dWr(t,e),r):xt(Sa(t)?v0o(t.anyOf,e):DU(t,e)!==wt.False?Zo():t,r)}a(Xoe,"Exclude");function C0o(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Xoe(t[n],e);return r}a(C0o,"FromProperties");function b0o(t,e){return C0o(t.properties,e)}a(b0o,"FromMappedResult");function dWr(t,e){let r=b0o(t,e);return ja(r)}a(dWr,"ExcludeFromMappedResult");p();p();p();function fWr(t,e){return ese(VW(t),e)}a(fWr,"ExtractFromTemplateLiteral");function S0o(t,e){let r=t.filter(n=>DU(n,e)!==wt.False);return r.length===1?r[0]:ic(r)}a(S0o,"ExtractRest");function ese(t,e,r){return $1(t)?xt(fWr(t,e),r):Hu(t)?xt(pWr(t,e),r):xt(Sa(t)?S0o(t.anyOf,e):DU(t,e)!==wt.False?t:Zo(),r)}a(ese,"Extract");function T0o(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=ese(t[n],e);return r}a(T0o,"FromProperties");function I0o(t,e){return T0o(t.properties,e)}a(I0o,"FromMappedResult");function pWr(t,e){let r=I0o(t,e);return ja(r)}a(pWr,"ExtractFromMappedResult");p();function hWr(t,e){return Gk(t)?xt(t.returns,e):Zo(e)}a(hWr,"InstanceType");p();p();function LUe(t){return cC(qy(t))}a(LUe,"ReadonlyOptional");p();function WW(t,e,r){return xt({[bt]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(WW,"RecordCreateFromPattern");function h2t(t,e,r){let n={};for(let o of t)n[o]=e;return oc(n,{...r,[YI]:"Record"})}a(h2t,"RecordCreateFromKeys");function x0o(t,e,r){return CUe(t)?h2t(aC(t),e,r):WW(t.pattern,e,r)}a(x0o,"FromTemplateLiteralKey");function w0o(t,e,r){return h2t(aC(ic(t)),e,r)}a(w0o,"FromUnionKey");function R0o(t,e,r){return h2t([t.toString()],e,r)}a(R0o,"FromLiteralKey");function k0o(t,e,r){return WW(t.source,e,r)}a(k0o,"FromRegExpKey");function P0o(t,e,r){let n=Qp(t.pattern)?RU:t.pattern;return WW(n,e,r)}a(P0o,"FromStringKey");function D0o(t,e,r){return WW(RU,e,r)}a(D0o,"FromAnyKey");function N0o(t,e,r){return WW(bVr,e,r)}a(N0o,"FromNeverKey");function M0o(t,e,r){return oc({true:e,false:e},r)}a(M0o,"FromBooleanKey");function O0o(t,e,r){return WW(wU,e,r)}a(O0o,"FromIntegerKey");function L0o(t,e,r){return WW(wU,e,r)}a(L0o,"FromNumberKey");function BUe(t,e,r={}){return Sa(t)?w0o(t.anyOf,e,r):$1(t)?x0o(t,e,r):H1(t)?R0o(t.const,e,r):gB(t)?M0o(t,e,r):Vk(t)?O0o(t,e,r):Wk(t)?L0o(t,e,r):WPt(t)?k0o(t,e,r):AB(t)?P0o(t,e,r):$Pt(t)?D0o(t,e,r):IU(t)?N0o(t,e,r):Zo(r)}a(BUe,"Record");function FUe(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(FUe,"RecordPattern");function mWr(t){let e=FUe(t);return e===RU?x_():e===wU?KI():x_({pattern:e})}a(mWr,"RecordKey");function UUe(t){return t.patternProperties[FUe(t)]}a(UUe,"RecordValue");function B0o(t,e){return e.parameters=fbe(t,e.parameters),e.returns=Kk(t,e.returns),e}a(B0o,"FromConstructor");function F0o(t,e){return e.parameters=fbe(t,e.parameters),e.returns=Kk(t,e.returns),e}a(F0o,"FromFunction");function U0o(t,e){return e.allOf=fbe(t,e.allOf),e}a(U0o,"FromIntersect");function Q0o(t,e){return e.anyOf=fbe(t,e.anyOf),e}a(Q0o,"FromUnion");function q0o(t,e){return Qp(e.items)||(e.items=fbe(t,e.items)),e}a(q0o,"FromTuple");function j0o(t,e){return e.items=Kk(t,e.items),e}a(j0o,"FromArray");function H0o(t,e){return e.items=Kk(t,e.items),e}a(H0o,"FromAsyncIterator");function G0o(t,e){return e.items=Kk(t,e.items),e}a(G0o,"FromIterator");function $0o(t,e){return e.item=Kk(t,e.item),e}a($0o,"FromPromise");function V0o(t,e){let r=K0o(t,e.properties);return{...e,...oc(r)}}a(V0o,"FromObject");function W0o(t,e){let r=Kk(t,mWr(e)),n=Kk(t,UUe(e)),o=BUe(r,n);return{...e,...o}}a(W0o,"FromRecord");function z0o(t,e){return e.index in t?t[e.index]:Yk()}a(z0o,"FromArgument");function Y0o(t,e){let r=Foe(e),n=sC(e),o=Kk(t,e);return r&&n?LUe(o):r&&!n?cC(o):!r&&n?qy(o):o}a(Y0o,"FromProperty");function K0o(t,e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:Y0o(t,e[n])}),{})}a(K0o,"FromProperties");function fbe(t,e){return e.map(r=>Kk(t,r))}a(fbe,"FromTypes");function Kk(t,e){return Gk(e)?B0o(t,e):$k(e)?F0o(t,e):ff(e)?U0o(t,e):Sa(e)?Q0o(t,e):V1(e)?q0o(t,e):jk(e)?j0o(t,e):QW(e)?H0o(t,e):jW(e)?G0o(t,e):HW(e)?$0o(t,e):qp(e)?V0o(t,e):GW(e)?W0o(t,e):VPt(e)?z0o(t,e):e}a(Kk,"FromType");function gWr(t,e){return Kk(e,Loe(t))}a(gWr,"Instantiate");p();function AWr(t){return xt({[bt]:"Integer",type:"integer"},t)}a(AWr,"Integer");p();p();p();function J0o(t,e,r){return{[t]:Jk(la(t),e,qu(r))}}a(J0o,"MappedIntrinsicPropertyKey");function Z0o(t,e,r){return t.reduce((o,s)=>({...o,...J0o(s,e,r)}),{})}a(Z0o,"MappedIntrinsicPropertyKeys");function X0o(t,e,r){return Z0o(t.keys,e,r)}a(X0o,"MappedIntrinsicProperties");function yWr(t,e,r){let n=X0o(t,e,r);return ja(n)}a(yWr,"IntrinsicFromMappedKey");function ego(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(ego,"ApplyUncapitalize");function tgo(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(tgo,"ApplyCapitalize");function rgo(t){return t.toUpperCase()}a(rgo,"ApplyUppercase");function ngo(t){return t.toLowerCase()}a(ngo,"ApplyLowercase");function igo(t,e,r){let n=$oe(t.pattern);if(!$W(n))return{...t,pattern:EWr(t.pattern,e)};let c=[...cbe(n)].map(d=>la(d)),l=_Wr(c,e),u=ic(l);return SUe([u],r)}a(igo,"FromTemplateLiteral");function EWr(t,e){return typeof t=="string"?e==="Uncapitalize"?ego(t):e==="Capitalize"?tgo(t):e==="Uppercase"?rgo(t):e==="Lowercase"?ngo(t):t:t.toString()}a(EWr,"FromLiteralValue");function _Wr(t,e){return t.map(r=>Jk(r,e))}a(_Wr,"FromRest");function Jk(t,e,r={}){return G1(t)?yWr(t,e,r):$1(t)?igo(t,e,r):Sa(t)?ic(_Wr(t.anyOf,e),r):H1(t)?la(EWr(t.const,e),r):xt(t,r)}a(Jk,"Intrinsic");function vWr(t,e={}){return Jk(t,"Capitalize",e)}a(vWr,"Capitalize");p();function CWr(t,e={}){return Jk(t,"Lowercase",e)}a(CWr,"Lowercase");p();function bWr(t,e={}){return Jk(t,"Uncapitalize",e)}a(bWr,"Uncapitalize");p();function SWr(t,e={}){return Jk(t,"Uppercase",e)}a(SWr,"Uppercase");p();p();p();p();p();function ogo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=NU(t[o],e,qu(r));return n}a(ogo,"FromProperties");function sgo(t,e,r){return ogo(t.properties,e,r)}a(sgo,"FromMappedResult");function TWr(t,e,r){let n=sgo(t,e,r);return ja(n)}a(TWr,"OmitFromMappedResult");function ago(t,e){return t.map(r=>m2t(r,e))}a(ago,"FromIntersect");function cgo(t,e){return t.map(r=>m2t(r,e))}a(cgo,"FromUnion");function lgo(t,e){let{[e]:r,...n}=t;return n}a(lgo,"FromProperty");function ugo(t,e){return e.reduce((r,n)=>lgo(r,n),t)}a(ugo,"FromProperties");function dgo(t,e,r){let n=pf(t,[Nd,"$id","required","properties"]),o=ugo(r,e);return oc(o,n)}a(dgo,"FromObject");function fgo(t){let e=t.reduce((r,n)=>EUe(n)?[...r,la(n)]:r,[]);return ic(e)}a(fgo,"UnionFromPropertyKeys");function m2t(t,e){return ff(t)?jy(ago(t.allOf,e)):Sa(t)?ic(cgo(t.anyOf,e)):qp(t)?dgo(t,e,t.properties):oc({})}a(m2t,"OmitResolve");function NU(t,e,r){let n=Up(e)?fgo(e):e,o=Md(e)?aC(e):e,s=Wf(t),c=Wf(e);return Hu(t)?TWr(t,o,r):G1(e)?IWr(t,e,r):s&&c?cu("Omit",[t,n],r):!s&&c?cu("Omit",[t,n],r):s&&!c?cu("Omit",[t,n],r):xt({...m2t(t,o),...r})}a(NU,"Omit");function pgo(t,e,r){return{[e]:NU(t,[e],qu(r))}}a(pgo,"FromPropertyKey");function hgo(t,e,r){return e.reduce((n,o)=>({...n,...pgo(t,o,r)}),{})}a(hgo,"FromPropertyKeys");function mgo(t,e,r){return hgo(t,e.keys,r)}a(mgo,"FromMappedKey");function IWr(t,e,r){let n=mgo(t,e,r);return ja(n)}a(IWr,"OmitFromMappedKey");p();p();p();function ggo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=MU(t[o],e,qu(r));return n}a(ggo,"FromProperties");function Ago(t,e,r){return ggo(t.properties,e,r)}a(Ago,"FromMappedResult");function xWr(t,e,r){let n=Ago(t,e,r);return ja(n)}a(xWr,"PickFromMappedResult");function ygo(t,e){return t.map(r=>g2t(r,e))}a(ygo,"FromIntersect");function Ego(t,e){return t.map(r=>g2t(r,e))}a(Ego,"FromUnion");function _go(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(_go,"FromProperties");function vgo(t,e,r){let n=pf(t,[Nd,"$id","required","properties"]),o=_go(r,e);return oc(o,n)}a(vgo,"FromObject");function Cgo(t){let e=t.reduce((r,n)=>EUe(n)?[...r,la(n)]:r,[]);return ic(e)}a(Cgo,"UnionFromPropertyKeys");function g2t(t,e){return ff(t)?jy(ygo(t.allOf,e)):Sa(t)?ic(Ego(t.anyOf,e)):qp(t)?vgo(t,e,t.properties):oc({})}a(g2t,"PickResolve");function MU(t,e,r){let n=Up(e)?Cgo(e):e,o=Md(e)?aC(e):e,s=Wf(t),c=Wf(e);return Hu(t)?xWr(t,o,r):G1(e)?wWr(t,e,r):s&&c?cu("Pick",[t,n],r):!s&&c?cu("Pick",[t,n],r):s&&!c?cu("Pick",[t,n],r):xt({...g2t(t,o),...r})}a(MU,"Pick");function bgo(t,e,r){return{[e]:MU(t,[e],qu(r))}}a(bgo,"FromPropertyKey");function Sgo(t,e,r){return e.reduce((n,o)=>({...n,...bgo(t,o,r)}),{})}a(Sgo,"FromPropertyKeys");function Tgo(t,e,r){return Sgo(t,e.keys,r)}a(Tgo,"FromMappedKey");function wWr(t,e,r){let n=Tgo(t,e,r);return ja(n)}a(wWr,"PickFromMappedKey");p();p();function Igo(t,e){return cu("Partial",[cu(t,e)])}a(Igo,"FromComputed");function xgo(t){return cu("Partial",[XI(t)])}a(xgo,"FromRef");function wgo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=qy(t[r]);return e}a(wgo,"FromProperties");function Rgo(t,e){let r=pf(t,[Nd,"$id","required","properties"]),n=wgo(e);return oc(n,r)}a(Rgo,"FromObject");function RWr(t){return t.map(e=>kWr(e))}a(RWr,"FromRest");function kWr(t){return Hk(t)?Igo(t.target,t.parameters):Wf(t)?xgo(t.$ref):ff(t)?jy(RWr(t.allOf)):Sa(t)?ic(RWr(t.anyOf)):qp(t)?Rgo(t,t.properties):qW(t)||gB(t)||Vk(t)||H1(t)||tbe(t)||Wk(t)||AB(t)||rbe(t)||yB(t)?t:oc({})}a(kWr,"PartialResolve");function tse(t,e){return Hu(t)?PWr(t,e):xt({...kWr(t),...e})}a(tse,"Partial");function kgo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=tse(t[n],qu(e));return r}a(kgo,"FromProperties");function Pgo(t,e){return kgo(t.properties,e)}a(Pgo,"FromMappedResult");function PWr(t,e){let r=Pgo(t,e);return ja(r)}a(PWr,"PartialFromMappedResult");p();p();function Dgo(t,e){return cu("Required",[cu(t,e)])}a(Dgo,"FromComputed");function Ngo(t){return cu("Required",[XI(t)])}a(Ngo,"FromRef");function Mgo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=pf(t[r],[AA]);return e}a(Mgo,"FromProperties");function Ogo(t,e){let r=pf(t,[Nd,"$id","required","properties"]),n=Mgo(e);return oc(n,r)}a(Ogo,"FromObject");function DWr(t){return t.map(e=>NWr(e))}a(DWr,"FromRest");function NWr(t){return Hk(t)?Dgo(t.target,t.parameters):Wf(t)?Ngo(t.$ref):ff(t)?jy(DWr(t.allOf)):Sa(t)?ic(DWr(t.anyOf)):qp(t)?Ogo(t,t.properties):qW(t)||gB(t)||Vk(t)||H1(t)||tbe(t)||Wk(t)||AB(t)||rbe(t)||yB(t)?t:oc({})}a(NWr,"RequiredResolve");function rse(t,e){return Hu(t)?MWr(t,e):xt({...NWr(t),...e})}a(rse,"Required");function Lgo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=rse(t[n],e);return r}a(Lgo,"FromProperties");function Bgo(t,e){return Lgo(t.properties,e)}a(Bgo,"FromMappedResult");function MWr(t,e){let r=Bgo(t,e);return ja(r)}a(MWr,"RequiredFromMappedResult");function Fgo(t,e){return e.map(r=>Wf(r)?A2t(t,r.$ref):W1(t,r))}a(Fgo,"DereferenceParameters");function A2t(t,e){return e in t?Wf(t[e])?A2t(t,t[e].$ref):W1(t,t[e]):Zo()}a(A2t,"Dereference");function Ugo(t){return Yoe(t[0])}a(Ugo,"FromAwaited");function Qgo(t){return PU(t[0],t[1])}a(Qgo,"FromIndex");function qgo(t){return Koe(t[0])}a(qgo,"FromKeyOf");function jgo(t){return tse(t[0])}a(jgo,"FromPartial");function Hgo(t){return NU(t[0],t[1])}a(Hgo,"FromOmit");function Ggo(t){return MU(t[0],t[1])}a(Ggo,"FromPick");function $go(t){return rse(t[0])}a($go,"FromRequired");function Vgo(t,e,r){let n=Fgo(t,r);return e==="Awaited"?Ugo(n):e==="Index"?Qgo(n):e==="KeyOf"?qgo(n):e==="Partial"?jgo(n):e==="Omit"?Hgo(n):e==="Pick"?Ggo(n):e==="Required"?$go(n):Zo()}a(Vgo,"FromComputed");function Wgo(t,e){return qoe(W1(t,e))}a(Wgo,"FromArray");function zgo(t,e){return joe(W1(t,e))}a(zgo,"FromAsyncIterator");function Ygo(t,e,r){return Hoe(pbe(t,e),W1(t,r))}a(Ygo,"FromConstructor");function Kgo(t,e,r){return lM(pbe(t,e),W1(t,r))}a(Kgo,"FromFunction");function Jgo(t,e){return jy(pbe(t,e))}a(Jgo,"FromIntersect");function Zgo(t,e){return zoe(W1(t,e))}a(Zgo,"FromIterator");function Xgo(t,e){return oc(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:W1(t,e[n])}),{}))}a(Xgo,"FromObject");function eAo(t,e){let[r,n]=[W1(t,UUe(e)),FUe(e)],o=Loe(e);return o.patternProperties[n]=r,o}a(eAo,"FromRecord");function tAo(t,e){return Wf(e)?{...A2t(t,e.$ref),[Nd]:e[Nd]}:e}a(tAo,"FromTransform");function rAo(t,e){return JI(pbe(t,e))}a(rAo,"FromTuple");function nAo(t,e){return ic(pbe(t,e))}a(nAo,"FromUnion");function pbe(t,e){return e.map(r=>W1(t,r))}a(pbe,"FromTypes");function W1(t,e){return sC(e)?xt(W1(t,pf(e,[AA])),e):Foe(e)?xt(W1(t,pf(e,[qk])),e):nc(e)?xt(tAo(t,e),e):jk(e)?xt(Wgo(t,e.items),e):QW(e)?xt(zgo(t,e.items),e):Hk(e)?xt(Vgo(t,e.target,e.parameters)):Gk(e)?xt(Ygo(t,e.parameters,e.returns),e):$k(e)?xt(Kgo(t,e.parameters,e.returns),e):ff(e)?xt(Jgo(t,e.allOf),e):jW(e)?xt(Zgo(t,e.items),e):qp(e)?xt(Xgo(t,e.properties),e):GW(e)?xt(eAo(t,e)):V1(e)?xt(rAo(t,e.items||[]),e):Sa(e)?xt(nAo(t,e.anyOf),e):e}a(W1,"FromType");function iAo(t,e){return e in t?W1(t,t[e]):Zo()}a(iAo,"ComputeType");function OWr(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:iAo(t,r)}),{})}a(OWr,"ComputeModuleProperties");var y2t=class{static{a(this,"TModule")}constructor(e){let r=OWr(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:xt(this.$defs[e],r)};return xt({[bt]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};function LWr(t){return new y2t(t)}a(LWr,"Module");p();function BWr(t,e){return xt({[bt]:"Not",not:t},e)}a(BWr,"Not");p();function FWr(t,e){return $k(t)?JI(t.parameters,e):Zo()}a(FWr,"Parameters");p();var oAo=0;function UWr(t,e={}){Qp(e.$id)&&(e.$id=`T${oAo++}`);let r=Loe(t({[bt]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,xt({[YI]:"Recursive",...r},e)}a(UWr,"Recursive");p();function QWr(t,e){let r=Ql(t)?new globalThis.RegExp(t):t;return xt({[bt]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(QWr,"RegExp");p();function sAo(t){return ff(t)?t.allOf:Sa(t)?t.anyOf:V1(t)?t.items??[]:[]}a(sAo,"RestResolve");function qWr(t){return sAo(t)}a(qWr,"Rest");p();function jWr(t,e){return $k(t)?xt(t.returns,e):Zo(e)}a(jWr,"ReturnType");p();var E2t=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new _2t(this.schema,e)}},_2t=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[Nd].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[Nd].Decode(c)),"Decode")};return{...r,[Nd]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[Nd]:n}}Encode(e){return nc(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function HWr(t){return new E2t(t)}a(HWr,"Transform");p();function GWr(t={}){return xt({[bt]:t[bt]??"Unsafe"},t)}a(GWr,"Unsafe");p();function $Wr(t){return xt({[bt]:"Void",type:"void"},t)}a($Wr,"Void");p();var v2t={};Ri(v2t,{Any:()=>kU,Argument:()=>wVr,Array:()=>qoe,AsyncIterator:()=>joe,Awaited:()=>Yoe,BigInt:()=>Woe,Boolean:()=>bUe,Capitalize:()=>vWr,Composite:()=>WVr,Const:()=>zVr,Constructor:()=>Hoe,ConstructorParameters:()=>YVr,Date:()=>wUe,Enum:()=>KVr,Exclude:()=>Xoe,Extends:()=>Zoe,Extract:()=>ese,Function:()=>lM,Index:()=>PU,InstanceType:()=>hWr,Instantiate:()=>gWr,Integer:()=>AWr,Intersect:()=>jy,Iterator:()=>zoe,KeyOf:()=>Koe,Literal:()=>la,Lowercase:()=>CWr,Mapped:()=>qVr,Module:()=>LWr,Never:()=>Zo,Not:()=>BWr,Null:()=>RUe,Number:()=>KI,Object:()=>oc,Omit:()=>NU,Optional:()=>qy,Parameters:()=>FWr,Partial:()=>tse,Pick:()=>MU,Promise:()=>IUe,Readonly:()=>cC,ReadonlyOptional:()=>LUe,Record:()=>BUe,Recursive:()=>UWr,Ref:()=>XI,RegExp:()=>QWr,Required:()=>rse,Rest:()=>qWr,ReturnType:()=>jWr,String:()=>x_,Symbol:()=>kUe,TemplateLiteral:()=>SUe,Transform:()=>HWr,Tuple:()=>JI,Uint8Array:()=>DUe,Uncapitalize:()=>bWr,Undefined:()=>PUe,Union:()=>ic,Unknown:()=>Yk,Unsafe:()=>GWr,Uppercase:()=>SWr,Void:()=>$Wr});p();var S=v2t;p();p();function VWr(...t){return new globalThis.Function(...t)}a(VWr,"Evaluate");p();function aAo(t){switch(t.errorType){case Ct.ArrayContains:return"Expected array to contain at least one matching value";case Ct.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case Ct.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case Ct.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case Ct.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case Ct.ArrayUniqueItems:return"Expected array elements to be unique";case Ct.Array:return"Expected array";case Ct.AsyncIterator:return"Expected AsyncIterator";case Ct.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case Ct.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case Ct.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case Ct.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case Ct.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case Ct.BigInt:return"Expected bigint";case Ct.Boolean:return"Expected boolean";case Ct.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case Ct.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case Ct.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case Ct.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case Ct.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case Ct.Date:return"Expected Date";case Ct.Function:return"Expected function";case Ct.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case Ct.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case Ct.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case Ct.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case Ct.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case Ct.Integer:return"Expected integer";case Ct.IntersectUnevaluatedProperties:return"Unexpected property";case Ct.Intersect:return"Expected all values to match";case Ct.Iterator:return"Expected Iterator";case Ct.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case Ct.Never:return"Never";case Ct.Not:return"Value should not match";case Ct.Null:return"Expected null";case Ct.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case Ct.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case Ct.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case Ct.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case Ct.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case Ct.Number:return"Expected number";case Ct.Object:return"Expected object";case Ct.ObjectAdditionalProperties:return"Unexpected property";case Ct.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case Ct.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case Ct.ObjectRequiredProperty:return"Expected required property";case Ct.Promise:return"Expected Promise";case Ct.RegExp:return"Expected string to match regular expression";case Ct.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case Ct.StringFormat:return`Expected string to match '${t.schema.format}' format`;case Ct.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case Ct.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case Ct.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case Ct.String:return"Expected string";case Ct.Symbol:return"Expected symbol";case Ct.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case Ct.Tuple:return"Expected tuple";case Ct.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case Ct.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case Ct.Uint8Array:return"Expected Uint8Array";case Ct.Undefined:return"Expected undefined";case Ct.Union:return"Expected union value";case Ct.Void:return"Expected void";case Ct.Kind:return`Expected kind '${t.schema[bt]}'`;default:return"Unknown error type"}}a(aAo,"DefaultErrorFunction");var cAo=aAo;function WWr(){return cAo}a(WWr,"GetErrorFunction");p();var C2t=class extends Qi{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};function lAo(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new C2t(t);return Ta(r,e)}a(lAo,"Resolve");function J0(t,e){return!ba(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(J0,"Pushref");function Ta(t,e){return t[bt]==="This"||t[bt]==="Ref"?lAo(t,e):t}a(Ta,"Deref");p();var b2t=class extends Qi{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}},z1;(function(t){t[t.Undefined=0]="Undefined",t[t.Null=1]="Null",t[t.Boolean=2]="Boolean",t[t.Number=3]="Number",t[t.String=4]="String",t[t.Object=5]="Object",t[t.Array=6]="Array",t[t.Date=7]="Date",t[t.Uint8Array=8]="Uint8Array",t[t.Symbol=9]="Symbol",t[t.BigInt=10]="BigInt"})(z1||(z1={}));var nse=BigInt("14695981039346656037"),[uAo,dAo]=[BigInt("1099511628211"),BigInt("18446744073709551616")],fAo=Array.from({length:256}).map((t,e)=>BigInt(e)),zWr=new Float64Array(1),YWr=new DataView(zWr.buffer),KWr=new Uint8Array(zWr.buffer);function*pAo(t){let e=t===0?1:Math.ceil(Math.floor(Math.log2(t)+1)/8);for(let r=0;r>8*(e-1-r)&255}a(pAo,"NumberToBytes");function hAo(t){Gy(z1.Array);for(let e of t)ise(e)}a(hAo,"ArrayType");function mAo(t){Gy(z1.Boolean),Gy(t?1:0)}a(mAo,"BooleanType");function gAo(t){Gy(z1.BigInt),YWr.setBigInt64(0,t);for(let e of KWr)Gy(e)}a(gAo,"BigIntType");function AAo(t){Gy(z1.Date),ise(t.getTime())}a(AAo,"DateType");function yAo(t){Gy(z1.Null)}a(yAo,"NullType");function EAo(t){Gy(z1.Number),YWr.setFloat64(0,t);for(let e of KWr)Gy(e)}a(EAo,"NumberType");function _Ao(t){Gy(z1.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())ise(e),ise(t[e])}a(_Ao,"ObjectType");function vAo(t){Gy(z1.String);for(let e=0;e=t.minItems)||Ys(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!Z0(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=OU(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(Ys(t.contains)||si(t.minContains)||si(t.maxContains)))return!0;let n=Ys(t.contains)?t.contains:Zo(),o=r.reduce((s,c)=>Z0(n,e,c)?s+1:s,0);return!(o===0||si(t.minContains)&&ot.maxContains)}a(wAo,"FromArray");function RAo(t,e,r){return mUe(r)}a(RAo,"FromAsyncIterator");function kAo(t,e,r){return!(!gA(r)||Ys(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||Ys(t.maximum)&&!(r<=t.maximum)||Ys(t.minimum)&&!(r>=t.minimum)||Ys(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(kAo,"FromBigInt");function PAo(t,e,r){return cM(r)}a(PAo,"FromBoolean");function DAo(t,e,r){return Z0(t.returns,e,r.prototype)}a(DAo,"FromConstructor");function NAo(t,e,r){return!(!T_(r)||Ys(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||Ys(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||Ys(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||Ys(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(NAo,"FromDate");function MAo(t,e,r){return TU(r)}a(MAo,"FromFunction");function OAo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Z0(o,[...e,...n],r)}a(OAo,"FromImport");function LAo(t,e,r){return!(!yUe(r)||Ys(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||Ys(t.maximum)&&!(r<=t.maximum)||Ys(t.minimum)&&!(r>=t.minimum)||Ys(t.multipleOf)&&r%t.multipleOf!==0)}a(LAo,"FromInteger");function BAo(t,e,r){let n=t.allOf.every(o=>Z0(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp(vB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if(Md(t.unevaluatedProperties)){let o=new RegExp(vB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||Z0(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(BAo,"FromIntersect");function FAo(t,e,r){return gUe(r)}a(FAo,"FromIterator");function UAo(t,e,r){return r===t.const}a(UAo,"FromLiteral");function QAo(t,e,r){return!1}a(QAo,"FromNever");function qAo(t,e,r){return!Z0(t.not,e,r)}a(qAo,"FromNot");function jAo(t,e,r){return hB(r)}a(jAo,"FromNull");function HAo(t,e,r){return!(!au.IsNumberLike(r)||Ys(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||Ys(t.minimum)&&!(r>=t.minimum)||Ys(t.maximum)&&!(r<=t.maximum)||Ys(t.multipleOf)&&r%t.multipleOf!==0)}a(HAo,"FromNumber");function GAo(t,e,r){if(!au.IsObjectLike(r)||Ys(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||Ys(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let n=Object.getOwnPropertyNames(t.properties);for(let o of n){let s=t.properties[o];if(t.required&&t.required.includes(o)){if(!Z0(s,e,r[o])||(CB(s)||TAo(s))&&!(o in r))return!1}else if(au.IsExactOptionalProperty(r,o)&&!Z0(s,e,r[o]))return!1}if(t.additionalProperties===!1){let o=Object.getOwnPropertyNames(r);return t.required&&t.required.length===n.length&&o.length===n.length?!0:o.every(s=>n.includes(s))}else return typeof t.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(s=>n.includes(s)||Z0(t.additionalProperties,e,r[s])):!0}a(GAo,"FromObject");function $Ao(t,e,r){return AUe(r)}a($Ao,"FromPromise");function VAo(t,e,r){if(!au.IsRecordLike(r)||Ys(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||Ys(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let[n,o]=Object.entries(t.patternProperties)[0],s=new RegExp(n),c=Object.entries(r).every(([d,f])=>s.test(d)?Z0(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:Z0(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(VAo,"FromRecord");function WAo(t,e,r){return Z0(Ta(t,e),e,r)}a(WAo,"FromRef");function zAo(t,e,r){let n=new RegExp(t.source,t.flags);return Ys(t.minLength)&&!(r.length>=t.minLength)||Ys(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(zAo,"FromRegExp");function YAo(t,e,r){return!ba(r)||Ys(t.minLength)&&!(r.length>=t.minLength)||Ys(t.maxLength)&&!(r.length<=t.maxLength)||Ys(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:Ys(t.format)?zk.Has(t.format)?zk.Get(t.format)(r):!1:!0}a(YAo,"FromString");function KAo(t,e,r){return mB(r)}a(KAo,"FromSymbol");function JAo(t,e,r){return ba(r)&&new RegExp(t.pattern).test(r)}a(JAo,"FromTemplateLiteral");function ZAo(t,e,r){return Z0(Ta(t,e),e,r)}a(ZAo,"FromThis");function XAo(t,e,r){if(!ki(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nZ0(n,e,r))}a(tyo,"FromUnion");function ryo(t,e,r){return!(!Boe(r)||Ys(t.maxByteLength)&&!(r.length<=t.maxByteLength)||Ys(t.minByteLength)&&!(r.length>=t.minByteLength))}a(ryo,"FromUint8Array");function nyo(t,e,r){return!0}a(nyo,"FromUnknown");function iyo(t,e,r){return au.IsVoidLike(r)}a(iyo,"FromVoid");function oyo(t,e,r){return I_.Has(t[bt])?I_.Get(t[bt])(t,r):!1}a(oyo,"FromKind");function Z0(t,e,r){let n=Ys(t.$id)?J0(t,e):e,o=t;switch(o[bt]){case"Any":return IAo(o,n,r);case"Argument":return xAo(o,n,r);case"Array":return wAo(o,n,r);case"AsyncIterator":return RAo(o,n,r);case"BigInt":return kAo(o,n,r);case"Boolean":return PAo(o,n,r);case"Constructor":return DAo(o,n,r);case"Date":return NAo(o,n,r);case"Function":return MAo(o,n,r);case"Import":return OAo(o,n,r);case"Integer":return LAo(o,n,r);case"Intersect":return BAo(o,n,r);case"Iterator":return FAo(o,n,r);case"Literal":return UAo(o,n,r);case"Never":return QAo(o,n,r);case"Not":return qAo(o,n,r);case"Null":return jAo(o,n,r);case"Number":return HAo(o,n,r);case"Object":return GAo(o,n,r);case"Promise":return $Ao(o,n,r);case"Record":return VAo(o,n,r);case"Ref":return WAo(o,n,r);case"RegExp":return zAo(o,n,r);case"String":return YAo(o,n,r);case"Symbol":return KAo(o,n,r);case"TemplateLiteral":return JAo(o,n,r);case"This":return ZAo(o,n,r);case"Tuple":return XAo(o,n,r);case"Undefined":return eyo(o,n,r);case"Union":return tyo(o,n,r);case"Uint8Array":return ryo(o,n,r);case"Unknown":return nyo(o,n,r);case"Void":return iyo(o,n,r);default:if(!I_.Has(o[bt]))throw new S2t(o);return oyo(o,n,r)}}a(Z0,"Visit");function Xo(...t){return t.length===3?Z0(t[0],t[1],t[2]):Z0(t[0],[],t[1])}a(Xo,"Check");var Ct;(function(t){t[t.ArrayContains=0]="ArrayContains",t[t.ArrayMaxContains=1]="ArrayMaxContains",t[t.ArrayMaxItems=2]="ArrayMaxItems",t[t.ArrayMinContains=3]="ArrayMinContains",t[t.ArrayMinItems=4]="ArrayMinItems",t[t.ArrayUniqueItems=5]="ArrayUniqueItems",t[t.Array=6]="Array",t[t.AsyncIterator=7]="AsyncIterator",t[t.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",t[t.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",t[t.BigIntMaximum=10]="BigIntMaximum",t[t.BigIntMinimum=11]="BigIntMinimum",t[t.BigIntMultipleOf=12]="BigIntMultipleOf",t[t.BigInt=13]="BigInt",t[t.Boolean=14]="Boolean",t[t.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",t[t.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",t[t.DateMaximumTimestamp=17]="DateMaximumTimestamp",t[t.DateMinimumTimestamp=18]="DateMinimumTimestamp",t[t.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",t[t.Date=20]="Date",t[t.Function=21]="Function",t[t.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",t[t.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",t[t.IntegerMaximum=24]="IntegerMaximum",t[t.IntegerMinimum=25]="IntegerMinimum",t[t.IntegerMultipleOf=26]="IntegerMultipleOf",t[t.Integer=27]="Integer",t[t.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",t[t.Intersect=29]="Intersect",t[t.Iterator=30]="Iterator",t[t.Kind=31]="Kind",t[t.Literal=32]="Literal",t[t.Never=33]="Never",t[t.Not=34]="Not",t[t.Null=35]="Null",t[t.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",t[t.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",t[t.NumberMaximum=38]="NumberMaximum",t[t.NumberMinimum=39]="NumberMinimum",t[t.NumberMultipleOf=40]="NumberMultipleOf",t[t.Number=41]="Number",t[t.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",t[t.ObjectMaxProperties=43]="ObjectMaxProperties",t[t.ObjectMinProperties=44]="ObjectMinProperties",t[t.ObjectRequiredProperty=45]="ObjectRequiredProperty",t[t.Object=46]="Object",t[t.Promise=47]="Promise",t[t.RegExp=48]="RegExp",t[t.StringFormatUnknown=49]="StringFormatUnknown",t[t.StringFormat=50]="StringFormat",t[t.StringMaxLength=51]="StringMaxLength",t[t.StringMinLength=52]="StringMinLength",t[t.StringPattern=53]="StringPattern",t[t.String=54]="String",t[t.Symbol=55]="Symbol",t[t.TupleLength=56]="TupleLength",t[t.Tuple=57]="Tuple",t[t.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",t[t.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",t[t.Uint8Array=60]="Uint8Array",t[t.Undefined=61]="Undefined",t[t.Union=62]="Union",t[t.Void=63]="Void"})(Ct||(Ct={}));var T2t=class extends Qi{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};function bB(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(bB,"EscapeKey");function Ks(t){return t!==void 0}a(Ks,"IsDefined");var LU=class{static{a(this,"ValueErrorIterator")}constructor(e){this.iterator=e}[Symbol.iterator](){return this.iterator}First(){let e=this.iterator.next();return e.done?void 0:e.value}};function sn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:WWr()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(sn,"Create");function*syo(t,e,r,n){}a(syo,"FromAny");function*ayo(t,e,r,n){}a(ayo,"FromArgument");function*cyo(t,e,r,n){if(!ki(n))return yield sn(Ct.Array,t,r,n);Ks(t.minItems)&&!(n.length>=t.minItems)&&(yield sn(Ct.ArrayMinItems,t,r,n)),Ks(t.maxItems)&&!(n.length<=t.maxItems)&&(yield sn(Ct.ArrayMaxItems,t,r,n));for(let c=0;cX0(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield sn(Ct.ArrayContains,t,r,n)),si(t.minContains)&&st.maxContains&&(yield sn(Ct.ArrayMaxContains,t,r,n))}a(cyo,"FromArray");function*lyo(t,e,r,n){mUe(n)||(yield sn(Ct.AsyncIterator,t,r,n))}a(lyo,"FromAsyncIterator");function*uyo(t,e,r,n){if(!gA(n))return yield sn(Ct.BigInt,t,r,n);Ks(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(Ct.BigIntExclusiveMinimum,t,r,n)),Ks(t.maximum)&&!(n<=t.maximum)&&(yield sn(Ct.BigIntMaximum,t,r,n)),Ks(t.minimum)&&!(n>=t.minimum)&&(yield sn(Ct.BigIntMinimum,t,r,n)),Ks(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield sn(Ct.BigIntMultipleOf,t,r,n))}a(uyo,"FromBigInt");function*dyo(t,e,r,n){cM(n)||(yield sn(Ct.Boolean,t,r,n))}a(dyo,"FromBoolean");function*fyo(t,e,r,n){yield*X0(t.returns,e,r,n.prototype)}a(fyo,"FromConstructor");function*pyo(t,e,r,n){if(!T_(n))return yield sn(Ct.Date,t,r,n);Ks(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield sn(Ct.DateExclusiveMinimumTimestamp,t,r,n)),Ks(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield sn(Ct.DateMaximumTimestamp,t,r,n)),Ks(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield sn(Ct.DateMinimumTimestamp,t,r,n)),Ks(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield sn(Ct.DateMultipleOfTimestamp,t,r,n))}a(pyo,"FromDate");function*hyo(t,e,r,n){TU(n)||(yield sn(Ct.Function,t,r,n))}a(hyo,"FromFunction");function*myo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*X0(s,[...e,...o],r,n)}a(myo,"FromImport");function*gyo(t,e,r,n){if(!yUe(n))return yield sn(Ct.Integer,t,r,n);Ks(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(Ct.IntegerExclusiveMinimum,t,r,n)),Ks(t.maximum)&&!(n<=t.maximum)&&(yield sn(Ct.IntegerMaximum,t,r,n)),Ks(t.minimum)&&!(n>=t.minimum)&&(yield sn(Ct.IntegerMinimum,t,r,n)),Ks(t.multipleOf)&&n%t.multipleOf!==0&&(yield sn(Ct.IntegerMultipleOf,t,r,n))}a(gyo,"FromInteger");function*Ayo(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of X0(s,e,r,n))o=!0,yield c;if(o)return yield sn(Ct.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp(vB(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield sn(Ct.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp(vB(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=X0(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(Ayo,"FromIntersect");function*yyo(t,e,r,n){gUe(n)||(yield sn(Ct.Iterator,t,r,n))}a(yyo,"FromIterator");function*Eyo(t,e,r,n){n!==t.const&&(yield sn(Ct.Literal,t,r,n))}a(Eyo,"FromLiteral");function*_yo(t,e,r,n){yield sn(Ct.Never,t,r,n)}a(_yo,"FromNever");function*vyo(t,e,r,n){X0(t.not,e,r,n).next().done===!0&&(yield sn(Ct.Not,t,r,n))}a(vyo,"FromNot");function*Cyo(t,e,r,n){hB(n)||(yield sn(Ct.Null,t,r,n))}a(Cyo,"FromNull");function*byo(t,e,r,n){if(!au.IsNumberLike(n))return yield sn(Ct.Number,t,r,n);Ks(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(Ct.NumberExclusiveMinimum,t,r,n)),Ks(t.maximum)&&!(n<=t.maximum)&&(yield sn(Ct.NumberMaximum,t,r,n)),Ks(t.minimum)&&!(n>=t.minimum)&&(yield sn(Ct.NumberMinimum,t,r,n)),Ks(t.multipleOf)&&n%t.multipleOf!==0&&(yield sn(Ct.NumberMultipleOf,t,r,n))}a(byo,"FromNumber");function*Syo(t,e,r,n){if(!au.IsObjectLike(n))return yield sn(Ct.Object,t,r,n);Ks(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield sn(Ct.ObjectMinProperties,t,r,n)),Ks(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield sn(Ct.ObjectMaxProperties,t,r,n));let o=Array.isArray(t.required)?t.required:[],s=Object.getOwnPropertyNames(t.properties),c=Object.getOwnPropertyNames(n);for(let l of o)c.includes(l)||(yield sn(Ct.ObjectRequiredProperty,t.properties[l],`${r}/${bB(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield sn(Ct.ObjectAdditionalProperties,t,`${r}/${bB(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*X0(t.additionalProperties,e,`${r}/${bB(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*X0(u,e,`${r}/${bB(l)}`,n[l]),CB(t)&&!(l in n)&&(yield sn(Ct.ObjectRequiredProperty,u,`${r}/${bB(l)}`,void 0))):au.IsExactOptionalProperty(n,l)&&(yield*X0(u,e,`${r}/${bB(l)}`,n[l]))}}a(Syo,"FromObject");function*Tyo(t,e,r,n){AUe(n)||(yield sn(Ct.Promise,t,r,n))}a(Tyo,"FromPromise");function*Iyo(t,e,r,n){if(!au.IsRecordLike(n))return yield sn(Ct.Object,t,r,n);Ks(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield sn(Ct.ObjectMinProperties,t,r,n)),Ks(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield sn(Ct.ObjectMaxProperties,t,r,n));let[o,s]=Object.entries(t.patternProperties)[0],c=new RegExp(o);for(let[l,u]of Object.entries(n))c.test(l)&&(yield*X0(s,e,`${r}/${bB(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*X0(t.additionalProperties,e,`${r}/${bB(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield sn(Ct.ObjectAdditionalProperties,t,`${r}/${bB(l)}`,u)}}a(Iyo,"FromRecord");function*xyo(t,e,r,n){yield*X0(Ta(t,e),e,r,n)}a(xyo,"FromRef");function*wyo(t,e,r,n){if(!ba(n))return yield sn(Ct.String,t,r,n);if(Ks(t.minLength)&&!(n.length>=t.minLength)&&(yield sn(Ct.StringMinLength,t,r,n)),Ks(t.maxLength)&&!(n.length<=t.maxLength)&&(yield sn(Ct.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield sn(Ct.RegExp,t,r,n)}a(wyo,"FromRegExp");function*Ryo(t,e,r,n){if(!ba(n))return yield sn(Ct.String,t,r,n);Ks(t.minLength)&&!(n.length>=t.minLength)&&(yield sn(Ct.StringMinLength,t,r,n)),Ks(t.maxLength)&&!(n.length<=t.maxLength)&&(yield sn(Ct.StringMaxLength,t,r,n)),ba(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield sn(Ct.StringPattern,t,r,n))),ba(t.format)&&(zk.Has(t.format)?zk.Get(t.format)(n)||(yield sn(Ct.StringFormat,t,r,n)):yield sn(Ct.StringFormatUnknown,t,r,n))}a(Ryo,"FromString");function*kyo(t,e,r,n){mB(n)||(yield sn(Ct.Symbol,t,r,n))}a(kyo,"FromSymbol");function*Pyo(t,e,r,n){if(!ba(n))return yield sn(Ct.String,t,r,n);new RegExp(t.pattern).test(n)||(yield sn(Ct.StringPattern,t,r,n))}a(Pyo,"FromTemplateLiteral");function*Dyo(t,e,r,n){yield*X0(Ta(t,e),e,r,n)}a(Dyo,"FromThis");function*Nyo(t,e,r,n){if(!ki(n))return yield sn(Ct.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield sn(Ct.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield sn(Ct.TupleLength,t,r,n);if(t.items)for(let o=0;onew LU(X0(s,e,r,n)));yield sn(Ct.Union,t,r,n,o)}a(Oyo,"FromUnion");function*Lyo(t,e,r,n){if(!Boe(n))return yield sn(Ct.Uint8Array,t,r,n);Ks(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield sn(Ct.Uint8ArrayMaxByteLength,t,r,n)),Ks(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield sn(Ct.Uint8ArrayMinByteLength,t,r,n))}a(Lyo,"FromUint8Array");function*Byo(t,e,r,n){}a(Byo,"FromUnknown");function*Fyo(t,e,r,n){au.IsVoidLike(n)||(yield sn(Ct.Void,t,r,n))}a(Fyo,"FromVoid");function*Uyo(t,e,r,n){I_.Get(t[bt])(t,n)||(yield sn(Ct.Kind,t,r,n))}a(Uyo,"FromKind");function*X0(t,e,r,n){let o=Ks(t.$id)?[...e,t]:e,s=t;switch(s[bt]){case"Any":return yield*syo(s,o,r,n);case"Argument":return yield*ayo(s,o,r,n);case"Array":return yield*cyo(s,o,r,n);case"AsyncIterator":return yield*lyo(s,o,r,n);case"BigInt":return yield*uyo(s,o,r,n);case"Boolean":return yield*dyo(s,o,r,n);case"Constructor":return yield*fyo(s,o,r,n);case"Date":return yield*pyo(s,o,r,n);case"Function":return yield*hyo(s,o,r,n);case"Import":return yield*myo(s,o,r,n);case"Integer":return yield*gyo(s,o,r,n);case"Intersect":return yield*Ayo(s,o,r,n);case"Iterator":return yield*yyo(s,o,r,n);case"Literal":return yield*Eyo(s,o,r,n);case"Never":return yield*_yo(s,o,r,n);case"Not":return yield*vyo(s,o,r,n);case"Null":return yield*Cyo(s,o,r,n);case"Number":return yield*byo(s,o,r,n);case"Object":return yield*Syo(s,o,r,n);case"Promise":return yield*Tyo(s,o,r,n);case"Record":return yield*Iyo(s,o,r,n);case"Ref":return yield*xyo(s,o,r,n);case"RegExp":return yield*wyo(s,o,r,n);case"String":return yield*Ryo(s,o,r,n);case"Symbol":return yield*kyo(s,o,r,n);case"TemplateLiteral":return yield*Pyo(s,o,r,n);case"This":return yield*Dyo(s,o,r,n);case"Tuple":return yield*Nyo(s,o,r,n);case"Undefined":return yield*Myo(s,o,r,n);case"Union":return yield*Oyo(s,o,r,n);case"Uint8Array":return yield*Lyo(s,o,r,n);case"Unknown":return yield*Byo(s,o,r,n);case"Void":return yield*Fyo(s,o,r,n);default:if(!I_.Has(s[bt]))throw new T2t(t);return yield*Uyo(s,o,r,n)}}a(X0,"Visit");function dM(...t){let e=t.length===3?X0(t[0],t[1],"",t[2]):X0(t[0],[],"",t[1]);return new LU(e)}a(dM,"Errors");p();p();var ose=class extends Qi{static{a(this,"TransformDecodeCheckError")}constructor(e,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=e,this.value=r,this.error=n}},I2t=class extends Qi{static{a(this,"TransformDecodeError")}constructor(e,r,n,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=e,this.path=r,this.value=n,this.error=o}};function Od(t,e,r){try{return nc(t)?t[Nd].Decode(r):r}catch(n){throw new I2t(t,e,r,n)}}a(Od,"Default");function Qyo(t,e,r,n){return ki(n)?Od(t,r,n.map((o,s)=>Zk(t.items,e,`${r}/${s}`,o))):Od(t,r,n)}a(Qyo,"FromArray");function qyo(t,e,r,n){if(!bo(n)||j1(n))return Od(t,r,n);let o=xUe(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=Zk(h,e,`${r}/${f}`,c[f]));if(!nc(t.unevaluatedProperties))return Od(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=Od(u,`${r}/${f}`,d[f]));return Od(t,r,d)}a(qyo,"FromIntersect");function jyo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=Zk(s,[...e,...o],r,n);return Od(t,r,c)}a(jyo,"FromImport");function Hyo(t,e,r,n){return Od(t,r,Zk(t.not,e,r,n))}a(Hyo,"FromNot");function Gyo(t,e,r,n){if(!bo(n))return Od(t,r,n);let o=lC(t),s={...n};for(let d of o)Ui(s,d)&&(ju(s[d])&&(!yB(t.properties[d])||au.IsExactOptionalProperty(s,d))||(s[d]=Zk(t.properties[d],e,`${r}/${d}`,s[d])));if(!Md(t.additionalProperties))return Od(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=Od(l,`${r}/${d}`,u[d]));return Od(t,r,u)}a(Gyo,"FromObject");function $yo(t,e,r,n){if(!bo(n))return Od(t,r,n);let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=new RegExp(o),c={...n};for(let f of Object.getOwnPropertyNames(n))s.test(f)&&(c[f]=Zk(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!Md(t.additionalProperties))return Od(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=Od(u,`${r}/${f}`,d[f]));return Od(t,r,d)}a($yo,"FromRecord");function Vyo(t,e,r,n){let o=Ta(t,e);return Od(t,r,Zk(o,e,r,n))}a(Vyo,"FromRef");function Wyo(t,e,r,n){let o=Ta(t,e);return Od(t,r,Zk(o,e,r,n))}a(Wyo,"FromThis");function zyo(t,e,r,n){return ki(n)&&ki(t.items)?Od(t,r,t.items.map((o,s)=>Zk(o,e,`${r}/${s}`,n[s]))):Od(t,r,n)}a(zyo,"FromTuple");function Yyo(t,e,r,n){for(let o of t.anyOf){if(!Xo(o,e,n))continue;let s=Zk(o,e,r,n);return Od(t,r,s)}return Od(t,r,n)}a(Yyo,"FromUnion");function Zk(t,e,r,n){let o=J0(t,e),s=t;switch(t[bt]){case"Array":return Qyo(s,o,r,n);case"Import":return jyo(s,o,r,n);case"Intersect":return qyo(s,o,r,n);case"Not":return Hyo(s,o,r,n);case"Object":return Gyo(s,o,r,n);case"Record":return $yo(s,o,r,n);case"Ref":return Vyo(s,o,r,n);case"Symbol":return Od(s,r,n);case"This":return Wyo(s,o,r,n);case"Tuple":return zyo(s,o,r,n);case"Union":return Yyo(s,o,r,n);default:return Od(s,r,n)}}a(Zk,"Visit");function sse(t,e,r){return Zk(t,e,"",r)}a(sse,"TransformDecode");p();var ase=class extends Qi{static{a(this,"TransformEncodeCheckError")}constructor(e,r,n){super("The encoded value does not match the expected schema"),this.schema=e,this.value=r,this.error=n}},x2t=class extends Qi{static{a(this,"TransformEncodeError")}constructor(e,r,n,o){super(`${o instanceof Error?o.message:"Unknown error"}`),this.schema=e,this.path=r,this.value=n,this.error=o}};function yA(t,e,r){try{return nc(t)?t[Nd].Encode(r):r}catch(n){throw new x2t(t,e,r,n)}}a(yA,"Default");function Kyo(t,e,r,n){let o=yA(t,r,n);return ki(o)?o.map((s,c)=>Xk(t.items,e,`${r}/${c}`,s)):o}a(Kyo,"FromArray");function Jyo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=yA(t,r,n);return Xk(s,[...e,...o],r,c)}a(Jyo,"FromImport");function Zyo(t,e,r,n){let o=yA(t,r,n);if(!bo(n)||j1(n))return o;let s=xUe(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=Xk(m,e,`${r}/${h}`,l[h]));if(!nc(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=yA(d,`${r}/${h}`,f[h]));return f}a(Zyo,"FromIntersect");function Xyo(t,e,r,n){return yA(t.not,r,yA(t,r,n))}a(Xyo,"FromNot");function eEo(t,e,r,n){let o=yA(t,r,n);if(!bo(o))return o;let s=lC(t),c={...o};for(let f of s)Ui(c,f)&&(ju(c[f])&&(!yB(t.properties[f])||au.IsExactOptionalProperty(c,f))||(c[f]=Xk(t.properties[f],e,`${r}/${f}`,c[f])));if(!Md(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=yA(u,`${r}/${f}`,d[f]));return d}a(eEo,"FromObject");function tEo(t,e,r,n){let o=yA(t,r,n);if(!bo(n))return o;let s=Object.getOwnPropertyNames(t.patternProperties)[0],c=new RegExp(s),l={...o};for(let h of Object.getOwnPropertyNames(n))c.test(h)&&(l[h]=Xk(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!Md(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=yA(d,`${r}/${h}`,f[h]));return f}a(tEo,"FromRecord");function rEo(t,e,r,n){let o=Ta(t,e),s=Xk(o,e,r,n);return yA(t,r,s)}a(rEo,"FromRef");function nEo(t,e,r,n){let o=Ta(t,e),s=Xk(o,e,r,n);return yA(t,r,s)}a(nEo,"FromThis");function iEo(t,e,r,n){let o=yA(t,r,n);return ki(t.items)?t.items.map((s,c)=>Xk(s,e,`${r}/${c}`,o[c])):[]}a(iEo,"FromTuple");function oEo(t,e,r,n){for(let o of t.anyOf){if(!Xo(o,e,n))continue;let s=Xk(o,e,r,n);return yA(t,r,s)}for(let o of t.anyOf){let s=Xk(o,e,r,n);if(Xo(t,e,s))return yA(t,r,s)}return yA(t,r,n)}a(oEo,"FromUnion");function Xk(t,e,r,n){let o=J0(t,e),s=t;switch(t[bt]){case"Array":return Kyo(s,o,r,n);case"Import":return Jyo(s,o,r,n);case"Intersect":return Zyo(s,o,r,n);case"Not":return Xyo(s,o,r,n);case"Object":return eEo(s,o,r,n);case"Record":return tEo(s,o,r,n);case"Ref":return rEo(s,o,r,n);case"This":return nEo(s,o,r,n);case"Tuple":return iEo(s,o,r,n);case"Union":return oEo(s,o,r,n);default:return yA(s,r,n)}}a(Xk,"Visit");function cse(t,e,r){return Xk(t,e,"",r)}a(cse,"TransformEncode");p();function sEo(t,e){return nc(t)||zm(t.items,e)}a(sEo,"FromArray");function aEo(t,e){return nc(t)||zm(t.items,e)}a(aEo,"FromAsyncIterator");function cEo(t,e){return nc(t)||zm(t.returns,e)||t.parameters.some(r=>zm(r,e))}a(cEo,"FromConstructor");function lEo(t,e){return nc(t)||zm(t.returns,e)||t.parameters.some(r=>zm(r,e))}a(lEo,"FromFunction");function uEo(t,e){return nc(t)||nc(t.unevaluatedProperties)||t.allOf.some(r=>zm(r,e))}a(uEo,"FromIntersect");function dEo(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return nc(t)||zm(n,[...r,...e])}a(dEo,"FromImport");function fEo(t,e){return nc(t)||zm(t.items,e)}a(fEo,"FromIterator");function pEo(t,e){return nc(t)||zm(t.not,e)}a(pEo,"FromNot");function hEo(t,e){return nc(t)||Object.values(t.properties).some(r=>zm(r,e))||Md(t.additionalProperties)&&zm(t.additionalProperties,e)}a(hEo,"FromObject");function mEo(t,e){return nc(t)||zm(t.item,e)}a(mEo,"FromPromise");function gEo(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return nc(t)||zm(n,e)||Md(t.additionalProperties)&&nc(t.additionalProperties)}a(gEo,"FromRecord");function AEo(t,e){return nc(t)?!0:zm(Ta(t,e),e)}a(AEo,"FromRef");function yEo(t,e){return nc(t)?!0:zm(Ta(t,e),e)}a(yEo,"FromThis");function EEo(t,e){return nc(t)||!ju(t.items)&&t.items.some(r=>zm(r,e))}a(EEo,"FromTuple");function _Eo(t,e){return nc(t)||t.anyOf.some(r=>zm(r,e))}a(_Eo,"FromUnion");function zm(t,e){let r=J0(t,e),n=t;if(t.$id&&w2t.has(t.$id))return!1;switch(t.$id&&w2t.add(t.$id),t[bt]){case"Array":return sEo(n,r);case"AsyncIterator":return aEo(n,r);case"Constructor":return cEo(n,r);case"Function":return lEo(n,r);case"Import":return dEo(n,r);case"Intersect":return uEo(n,r);case"Iterator":return fEo(n,r);case"Not":return pEo(n,r);case"Object":return hEo(n,r);case"Promise":return mEo(n,r);case"Record":return gEo(n,r);case"Ref":return AEo(n,r);case"This":return yEo(n,r);case"Tuple":return EEo(n,r);case"Union":return _Eo(n,r);default:return nc(t)}}a(zm,"Visit");var w2t=new Set;function SB(t,e){return w2t.clear(),zm(t,e)}a(SB,"HasTransform");var R2t=class{static{a(this,"TypeCheck")}constructor(e,r,n,o){this.schema=e,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=SB(e,r)}Code(){return this.code}Schema(){return this.schema}References(){return this.references}Errors(e){return dM(this.schema,this.references,e)}Check(e){return this.checkFunc(e)}Decode(e){if(!this.checkFunc(e))throw new ose(this.schema,e,this.Errors(e).First());return this.hasTransform?sse(this.schema,this.references,e):e}Encode(e){let r=this.hasTransform?cse(this.schema,this.references,e):e;if(!this.checkFunc(r))throw new ase(this.schema,e,this.Errors(e).First());return r}},TB;(function(t){function e(s){return s===36}a(e,"DollarSign"),t.DollarSign=e;function r(s){return s===95}a(r,"IsUnderscore"),t.IsUnderscore=r;function n(s){return s>=65&&s<=90||s>=97&&s<=122}a(n,"IsAlpha"),t.IsAlpha=n;function o(s){return s>=48&&s<=57}a(o,"IsNumeric"),t.IsNumeric=o})(TB||(TB={}));var QUe;(function(t){function e(s){return s.length===0?!1:TB.IsNumeric(s.charCodeAt(0))}a(e,"IsFirstCharacterNumeric");function r(s){if(e(s))return!1;for(let c=0;c= ${re.minItems}`);let de=z(re.items,ee,"value");if(yield`((array) => { for(const ${he} of array) if(!(${de})) { return false }; return true; })(${K})`,Gu(re.contains)||si(re.minContains)||si(re.maxContains)){let qe=Gu(re.contains)?re.contains:Zo(),ne=z(qe,ee,"value"),ue=si(re.minContains)?[`(count >= ${re.minContains})`]:[],Ne=si(re.maxContains)?[`(count <= ${re.maxContains})`]:[],Ie=`const count = value.reduce((${X}, ${he}) => ${ne} ? acc + 1 : acc, 0)`,Be=["(count > 0)",...ue,...Ne].join(" && ");yield`((${he}) => { ${Ie}; return ${Be}})(${K})`}re.uniqueItems===!0&&(yield`((${he}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${K})`)}a(o,"FromArray");function*s(re,ee,K){yield`(typeof value === 'object' && Symbol.asyncIterator in ${K})`}a(s,"FromAsyncIterator");function*c(re,ee,K){yield`(typeof ${K} === 'bigint')`,gA(re.exclusiveMaximum)&&(yield`${K} < BigInt(${re.exclusiveMaximum})`),gA(re.exclusiveMinimum)&&(yield`${K} > BigInt(${re.exclusiveMinimum})`),gA(re.maximum)&&(yield`${K} <= BigInt(${re.maximum})`),gA(re.minimum)&&(yield`${K} >= BigInt(${re.minimum})`),gA(re.multipleOf)&&(yield`(${K} % BigInt(${re.multipleOf})) === 0`)}a(c,"FromBigInt");function*l(re,ee,K){yield`(typeof ${K} === 'boolean')`}a(l,"FromBoolean");function*u(re,ee,K){yield*W(re.returns,ee,`${K}.prototype`)}a(u,"FromConstructor");function*d(re,ee,K){yield`(${K} instanceof Date) && Number.isFinite(${K}.getTime())`,si(re.exclusiveMaximumTimestamp)&&(yield`${K}.getTime() < ${re.exclusiveMaximumTimestamp}`),si(re.exclusiveMinimumTimestamp)&&(yield`${K}.getTime() > ${re.exclusiveMinimumTimestamp}`),si(re.maximumTimestamp)&&(yield`${K}.getTime() <= ${re.maximumTimestamp}`),si(re.minimumTimestamp)&&(yield`${K}.getTime() >= ${re.minimumTimestamp}`),si(re.multipleOfTimestamp)&&(yield`(${K}.getTime() % ${re.multipleOfTimestamp}) === 0`)}a(d,"FromDate");function*f(re,ee,K){yield`(typeof ${K} === 'function')`}a(f,"FromFunction");function*h(re,ee,K){let he=globalThis.Object.getOwnPropertyNames(re.$defs).reduce((X,de)=>[...X,re.$defs[de]],[]);yield*W(XI(re.$ref),[...ee,...he],K)}a(h,"FromImport");function*m(re,ee,K){yield`Number.isInteger(${K})`,si(re.exclusiveMaximum)&&(yield`${K} < ${re.exclusiveMaximum}`),si(re.exclusiveMinimum)&&(yield`${K} > ${re.exclusiveMinimum}`),si(re.maximum)&&(yield`${K} <= ${re.maximum}`),si(re.minimum)&&(yield`${K} >= ${re.minimum}`),si(re.multipleOf)&&(yield`(${K} % ${re.multipleOf}) === 0`)}a(m,"FromInteger");function*g(re,ee,K){let he=re.allOf.map(X=>z(X,ee,K)).join(" && ");if(re.unevaluatedProperties===!1){let X=H(`${new RegExp(vB(re))};`),de=`Object.getOwnPropertyNames(${K}).every(key => ${X}.test(key))`;yield`(${he} && ${de})`}else if(Gu(re.unevaluatedProperties)){let X=H(`${new RegExp(vB(re))};`),de=`Object.getOwnPropertyNames(${K}).every(key => ${X}.test(key) || ${z(re.unevaluatedProperties,ee,`${K}[key]`)})`;yield`(${he} && ${de})`}else yield`(${he})`}a(g,"FromIntersect");function*A(re,ee,K){yield`(typeof value === 'object' && Symbol.iterator in ${K})`}a(A,"FromIterator");function*y(re,ee,K){typeof re.const=="number"||typeof re.const=="boolean"?yield`(${K} === ${re.const})`:yield`(${K} === '${P2t.Escape(re.const)}')`}a(y,"FromLiteral");function*E(re,ee,K){yield"false"}a(E,"FromNever");function*_(re,ee,K){yield`(!${z(re.not,ee,K)})`}a(_,"FromNot");function*v(re,ee,K){yield`(${K} === null)`}a(v,"FromNull");function*b(re,ee,K){yield zW.IsNumberLike(K),si(re.exclusiveMaximum)&&(yield`${K} < ${re.exclusiveMaximum}`),si(re.exclusiveMinimum)&&(yield`${K} > ${re.exclusiveMinimum}`),si(re.maximum)&&(yield`${K} <= ${re.maximum}`),si(re.minimum)&&(yield`${K} >= ${re.minimum}`),si(re.multipleOf)&&(yield`(${K} % ${re.multipleOf}) === 0`)}a(b,"FromNumber");function*T(re,ee,K){yield zW.IsObjectLike(K),si(re.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${re.minProperties}`),si(re.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${re.maxProperties}`);let he=Object.getOwnPropertyNames(re.properties);for(let X of he){let de=QUe.Encode(K,X),qe=re.properties[X];if(re.required&&re.required.includes(X))yield*W(qe,ee,de),(CB(qe)||e(qe))&&(yield`('${X}' in ${K})`);else{let ne=z(qe,ee,de);yield zW.IsExactOptionalProperty(K,X,ne)}}if(re.additionalProperties===!1)if(re.required&&re.required.length===he.length)yield`Object.getOwnPropertyNames(${K}).length === ${he.length}`;else{let X=`[${he.map(de=>`'${de}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${K}).every(key => ${X}.includes(key))`}if(typeof re.additionalProperties=="object"){let X=z(re.additionalProperties,ee,`${K}[key]`),de=`[${he.map(qe=>`'${qe}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${K}).every(key => ${de}.includes(key) || ${X}))`}}a(T,"FromObject");function*w(re,ee,K){yield`${K} instanceof Promise`}a(w,"FromPromise");function*R(re,ee,K){yield zW.IsRecordLike(K),si(re.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${re.minProperties}`),si(re.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${re.maxProperties}`);let[he,X]=Object.entries(re.patternProperties)[0],de=H(`${new RegExp(he)}`),qe=z(X,ee,"value"),ne=Gu(re.additionalProperties)?z(re.additionalProperties,ee,K):re.additionalProperties===!1?"false":"true",ue=`(${de}.test(key) ? ${qe} : ${ne})`;yield`(Object.entries(${K}).every(([key, value]) => ${ue}))`}a(R,"FromRecord");function*x(re,ee,K){let he=Ta(re,ee);if(V.functions.has(re.$ref))return yield`${ie(re.$ref)}(${K})`;yield*W(he,ee,K)}a(x,"FromRef");function*P(re,ee,K){let he=H(`${new RegExp(re.source,re.flags)};`);yield`(typeof ${K} === 'string')`,si(re.maxLength)&&(yield`${K}.length <= ${re.maxLength}`),si(re.minLength)&&(yield`${K}.length >= ${re.minLength}`),yield`${he}.test(${K})`}a(P,"FromRegExp");function*D(re,ee,K){yield`(typeof ${K} === 'string')`,si(re.maxLength)&&(yield`${K}.length <= ${re.maxLength}`),si(re.minLength)&&(yield`${K}.length >= ${re.minLength}`),re.pattern!==void 0&&(yield`${H(`${new RegExp(re.pattern)};`)}.test(${K})`),re.format!==void 0&&(yield`format('${re.format}', ${K})`)}a(D,"FromString");function*N(re,ee,K){yield`(typeof ${K} === 'symbol')`}a(N,"FromSymbol");function*L(re,ee,K){yield`(typeof ${K} === 'string')`,yield`${H(`${new RegExp(re.pattern)};`)}.test(${K})`}a(L,"FromTemplateLiteral");function*B(re,ee,K){yield`${ie(re.$ref)}(${K})`}a(B,"FromThis");function*j(re,ee,K){if(yield`Array.isArray(${K})`,re.items===void 0)return yield`${K}.length === 0`;yield`(${K}.length === ${re.maxItems})`;for(let he=0;hez(X,ee,K)).join(" || ")})`}a(O,"FromUnion");function*U(re,ee,K){yield`${K} instanceof Uint8Array`,si(re.maxByteLength)&&(yield`(${K}.length <= ${re.maxByteLength})`),si(re.minByteLength)&&(yield`(${K}.length >= ${re.minByteLength})`)}a(U,"FromUint8Array");function*q(re,ee,K){yield"true"}a(q,"FromUnknown");function*Q(re,ee,K){yield zW.IsVoidLike(K)}a(Q,"FromVoid");function*Y(re,ee,K){let he=V.instances.size;V.instances.set(he,re),yield`kind('${re[bt]}', ${he}, ${K})`}a(Y,"FromKind");function*W(re,ee,K,he=!0){let X=ba(re.$id)?[...ee,re]:ee,de=re;if(he&&ba(re.$id)){let qe=ie(re.$id);if(V.functions.has(qe))return yield`${qe}(${K})`;{V.functions.set(qe,"");let ne=te(qe,re,ee,"value",!1);return V.functions.set(qe,ne),yield`${qe}(${K})`}}switch(de[bt]){case"Any":return yield*r(de,X,K);case"Argument":return yield*n(de,X,K);case"Array":return yield*o(de,X,K);case"AsyncIterator":return yield*s(de,X,K);case"BigInt":return yield*c(de,X,K);case"Boolean":return yield*l(de,X,K);case"Constructor":return yield*u(de,X,K);case"Date":return yield*d(de,X,K);case"Function":return yield*f(de,X,K);case"Import":return yield*h(de,X,K);case"Integer":return yield*m(de,X,K);case"Intersect":return yield*g(de,X,K);case"Iterator":return yield*A(de,X,K);case"Literal":return yield*y(de,X,K);case"Never":return yield*E(de,X,K);case"Not":return yield*_(de,X,K);case"Null":return yield*v(de,X,K);case"Number":return yield*b(de,X,K);case"Object":return yield*T(de,X,K);case"Promise":return yield*w(de,X,K);case"Record":return yield*R(de,X,K);case"Ref":return yield*x(de,X,K);case"RegExp":return yield*P(de,X,K);case"String":return yield*D(de,X,K);case"Symbol":return yield*N(de,X,K);case"TemplateLiteral":return yield*L(de,X,K);case"This":return yield*B(de,X,K);case"Tuple":return yield*j(de,X,K);case"Undefined":return yield*M(de,X,K);case"Union":return yield*O(de,X,K);case"Uint8Array":return yield*U(de,X,K);case"Unknown":return yield*q(de,X,K);case"Void":return yield*Q(de,X,K);default:if(!I_.Has(de[bt]))throw new D2t(re);return yield*Y(de,X,K)}}a(W,"Visit");let V={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function z(re,ee,K,he=!0){return`(${[...W(re,ee,K,he)].join(" && ")})`}a(z,"CreateExpression");function ie(re){return`check_${k2t.Encode(re)}`}a(ie,"CreateFunctionName");function H(re){let ee=`local_${V.variables.size}`;return V.variables.set(ee,`const ${ee} = ${re}`),ee}a(H,"CreateVariable");function te(re,ee,K,he,X=!0){let[de,qe]=[` +`,Ie=>"".padStart(Ie," ")],ne=le("value","any"),ue=Le("boolean"),Ne=[...W(ee,K,he,X)].map(Ie=>`${qe(4)}${Ie}`).join(` &&${de}`);return`function ${re}(${ne})${ue} {${de}${qe(2)}return (${de}${Ne}${de}${qe(2)}) +}`}a(te,"CreateFunction");function le(re,ee){let K=V.language==="typescript"?`: ${ee}`:"";return`${re}${K}`}a(le,"CreateParameter");function Le(re){return V.language==="typescript"?`: ${re}`:""}a(Le,"CreateReturns");function ge(re,ee,K){let he=te("check",re,ee,"value"),X=le("value","any"),de=Le("boolean"),qe=[...V.functions.values()],ne=[...V.variables.values()],ue=ba(re.$id)?`return function check(${X})${de} { + return ${ie(re.$id)}(value) +}`:`return ${he}`;return[...ne,...qe,ue].join(` +`)}a(ge,"Build");function Oe(...re){let ee={language:"javascript"},[K,he,X]=re.length===2&&ki(re[1])?[re[0],re[1],ee]:re.length===2&&!ki(re[1])?[re[0],[],re[1]]:re.length===3?[re[0],re[1],re[2]]:re.length===1?[re[0],[],ee]:[null,[],ee];if(V.language=X.language,V.variables.clear(),V.functions.clear(),V.instances.clear(),!Gu(K))throw new qUe(K);for(let de of he)if(!Gu(de))throw new qUe(de);return ge(K,he,X)}a(Oe,"Code"),t.Code=Oe;function we(re,ee=[]){let K=Oe(re,ee,{language:"javascript"}),he=VWr("kind","format","hash",K),X=new Map(V.instances);function de(Ne,Ie,Be){if(!I_.Has(Ne)||!X.has(Ie))return!1;let tt=I_.Get(Ne),st=X.get(Ie);return tt(st,Be)}a(de,"typeRegistryFunction");function qe(Ne,Ie){return zk.Has(Ne)?zk.Get(Ne)(Ie):!1}a(qe,"formatRegistryFunction");function ne(Ne){return OU(Ne)}a(ne,"hashFunction");let ue=he(de,qe,ne);return new R2t(re,ee,ue,K)}a(we,"Compile"),t.Compile=we})($u||($u={}));var x7e=fe(bU()),wse=fe(require("os"));Mo();var w7e=fe(ei());function Tbe(t){return t===1}a(Tbe,"isRestricted");var Sbe=8192,S_o=21;var tg=class{static{a(this,"TelemetryReporters")}getReporter(e,r=0){return Tbe(r)?this.getRestrictedReporter(e):this.reporter}getRestrictedReporter(e){if(kse(e))return this.reporterRestricted;if(YCe(e))return new lUe}getMsft1pReporter(){return this.reporterMsft1p}getMsftReporter(){return this.reporterMsft}setReporter(e){this.reporter=e}setRestrictedReporter(e){this.reporterRestricted=e}setMsft1pReporter(e){this.reporterMsft1p=e}setMsftReporter(e){this.reporterMsft=e}async deactivate(){let e=[this.reporter,this.reporterRestricted,this.reporterMsft1p,this.reporterMsft];this.reporter=this.reporterRestricted=this.reporterMsft1p=this.reporterMsft=void 0,await Promise.all(e.map(r=>r?.dispose()))}},T_o=S.Object({},{additionalProperties:S.String()}),I_o=S.Object({meanLogProb:S.Optional(S.Number()),meanAlternativeLogProb:S.Optional(S.Number())},{additionalProperties:S.Number()}),x_o=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function w_o(t){return x_o.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(w_o,"isOomError");function R_o(t){return ax(t)?"network":w_o(t)||t.code==="EMFILE"||t.code==="ENFILE"||t.syscall==="uv_cwd"&&(t.code==="ENOENT"||t.code=="EIO")||t.code==="CopilotPromptLoadFailure"||`${t.code}`.startsWith("CopilotPromptWorkerExit")?"local":"exception"}a(R_o,"getErrorType");var Vt=class t{static{a(this,"TelemetryData")}static{this.validateTelemetryProperties=$u.Compile(T_o)}static{this.validateTelemetryMeasurements=$u.Compile(I_o)}static{this.keysExemptedFromSanitization=["abexp.assignmentcontext","VSCode.ABExp.Features"]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},El())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=El())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(Jt).getFallbackExpAndFilters();n.addToTelemetry(e,this),r.addToTelemetry(this)}extendWithCoreEditorAgnosticFields(e){this.properties.editor_version=U1(e.get(Ir).getEditorInfo()),this.properties.editor_plugin_version=U1(e.get(Ir).getEditorPluginInfo());let r=e.get(qa);this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${J1(e)}`,typeof process<"u"&&(this.properties.runtime_version=`node/${process.versions.node}`)}extendWithEditorAgnosticFields(e){this.extendWithCoreEditorAgnosticFields(e);let r=e.get(Ir);this.properties.common_extname=r.getEditorPluginInfo().name,this.properties.common_extversion=r.getEditorPluginInfo().version,this.properties.common_vscodeversion=U1(r.getEditorInfo());let n=e.get(nr);this.properties.fetcher=n.name;let o=e.get(Lo).getHttpSettings();this.properties.proxy_enabled=o.proxy?"true":"false",this.properties.proxy_auth=o.proxyAuthorization?"true":"false",this.properties.proxy_kerberos_spn=o.proxyKerberosServicePrincipal?"true":"false",this.properties.reject_unauthorized=o.proxyStrictSSL!==!1?"true":"false"}extendWithConfigProperties(e){let r=PJr(e);r["copilot.build"]=DJr(e),r["copilot.buildType"]=VU(e),this.properties={...this.properties,...r}}extendWithRequestId(e){let r={headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetryHack=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromPropertiesHack(e,r){if(Tbe(e))return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetryHack.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements);for(let e in this.measurements)isNaN(this.measurements[e])&&delete this.measurements[e]}multiplexProperties(){this.properties=t.multiplexProperties(this.properties)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}static multiplexProperties(e){let r={...e};for(let n in e){let o=e[n],s=o?.length??0;if(s>Sbe){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+Sbe;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(Rse,"telemetrizePromptLength");function El(){return performance.now()}a(El,"now");function N_o(t){return Math.floor(t/1e3)}a(N_o,"nowSeconds");function kse(t){return t.get(Fp).optedIn}a(kse,"shouldSendRestricted");function ft(t,e,r,n){return t.get(Dd).register(M_o(t,e,El(),r?.extendedBy(),n))}a(ft,"telemetry");function ox(t,e,r){return t.get(Dd).register(k7e(t,e,r?.extendedBy()))}a(ox,"telemetryMsft");function cr(t,e,r,n){let o=Vt.createAndMarkAsIssued(r,n);return t.get(Dd).register(k7e(t,e,o))}a(cr,"telemetryMs");function jl(t,e,r,n){cr(t,e,r,n),ft(t,e)}a(jl,"telemetryMsAndGitHub");function sx(t,e,r,n){cr(t,e,r,n),ft(t,e,Vt.createAndMarkAsIssued(r))}a(sx,"telemetryMsAndGitHubWithProperties");function R7e(t,e,r,n){let o=(n||Vt.createAndMarkAsIssued()).extendedBy(IJr(r));return t.get(Dd).register(k7e(t,e,o))}a(R7e,"telemetryMsftWithError");function Cs(t,e,r,n,o){let s=Vt.createAndMarkAsIssued({...n,...IJr(r)},o);return t.get(Dd).register(k7e(t,e,s))}a(Cs,"telemetryMsWithError");function ng(t,e,r,n,o){Cs(t,e,r,n,o),xa(t,r,e)}a(ng,"telemetryMsAndGitHubWithError");function IJr(t){let e={};if(t){let r=B_o(t);e.errorName=r.name,e.errorMessage=r.message,e.errorStack=r.stack??""}return e}a(IJr,"buildErrorProperties");async function M_o(t,e,r,n,o=0){let s=n||Vt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o??!1,"IncludeExp",r),(!Tbe(o)||kse(t))&&Ibe(t,o,e,s),k_o(t,e,s)}a(M_o,"_telemetry");async function k7e(t,e,r){let n=r||Vt.createAndMarkAsIssued({},{});await n.prepareForSendingToMsft(t),D_o(t,e,n)}a(k7e,"_telemetryMsft");function C9e(t,e){return t.get(Dd).register(O_o(t,e,El()))}a(C9e,"telemetryExpProblem");async function O_o(t,e,r){let n="expProblem",o=Vt.createAndMarkAsIssued(e,{});await o.makeReadyForSending(t,0,"SkipExp",r),Ibe(t,0,n,o)}a(O_o,"_telemetryExpProblem");function Pse(t,e,r,n,o=0){let s={...r,...xJr(t)};Ibe(t,o,e,{properties:s,measurements:n})}a(Pse,"telemetryRaw");function xJr(t){let e=t.get(Ir),r={unique_id:Nt(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:U1(e.getEditorInfo())};return{...t.get(Fp).getProperties(),...r}}a(xJr,"createRequiredProperties");var sNt=class extends Error{static{a(this,"CopilotNonError")}constructor(e){let r;try{r=JSON.stringify(e)}catch{r=String(e)}super(r),this.name="CopilotNonError",this.code=(0,x7e.SHA256)(x7e.enc.Utf16.parse(this.message)).toString().slice(0,16)}};function xa(t,e,r,n,o){return t.get(Dd).register(wJr(t,e,El(),r,{...n},o))}a(xa,"telemetryException");async function wJr(t,e,r,n,o,s){let c;if(e instanceof Error){if(c=e,c.name==="Canceled"&&c.message==="Canceled"||c.name==="CodeExpectedError"||Ym(c)||c instanceof w7e.ConnectionError||c instanceof w7e.ResponseError||c.name==="CopilotAuthError"||c.name==="DeviceFlowError")return}else{if(c=new sNt(e),e&&typeof e=="object"&&e.name==="ExitStatus")return;if(c.stack?.startsWith(`${c} `)){let y=c.stack.slice(`${c} `.length).split(` `);/^\s*(?:at )?(?:\w+\.)*_telemetryException\b/.test(y[0]??"")&&y.shift(),/^\s*(?:at )?(?:\w+\.)*telemetryException\b/.test(y[0]??"")&&y.shift(),c.stack=`${c} ${y.join(` -`)}`}}let l=t.get(Ir).getEditorInfo(),u;l.root&&(u=[{prefix:`${l.name}:`,path:l.root}]);let d=_se(t),f=SGr(c,u,d),h=Cyo(c),m=h==="exception",g=Wt.createAndMarkAsIssued({origin:n??"",type:c.name,code:`${c.code??""}`,reason:f.stack||f.toString(),message:f.message,...o});if(await g.makeReadyForSending(t,0,"IncludeExp",r),s?.exception_detail)for(let y of s.exception_detail)y.value&&(d?y.value=fPt(y.value):y.value="[redacted]");s??=cGr(t,f,n),s.context={...s.context,"copilot_event.unique_id":g.properties.unique_id,"#restricted_telemetry":d?"true":"false"},s.rollup_id!=="auto"&&(g.properties.errno=s.rollup_id),s.created_at=new Date(g.issuedTime).toISOString();let A=s.rollup_id==="auto"?c.stack??"":s.rollup_id;if(!t.get(XN).isThrottled(A)){if(d){let y=bGr(c,u),E=Wt.createAndMarkAsIssued({origin:n??"",type:c.name,code:`${c.code??""}`,reason:y.stack||y.toString(),message:y.message,...o});s.rollup_id!=="auto"&&(E.properties.errno=s.rollup_id),await E.makeReadyForSending(t,1,"IncludeExp",r),E.properties.unique_id=g.properties.unique_id,g.properties.restricted_unique_id=E.properties.unique_id,sbe(t,1,`error.${h}`,E)}m&&(g.properties.failbot_payload=JSON.stringify(s)),sbe(t,0,`error.${h}`,g)}}a(EKr,"_telemetryException");function z0(t,e,r,n){let o=a(async(...s)=>{try{await e(...s)}catch(c){await EKr(t,c,yl(),r,n)}},"wrapped");return(...s)=>t.get(xd).register(o(...s))}a(z0,"telemetryCatch");function eg(t,e,r,n){return t.get(xd).register(Ryo(t,e,yl(),r?.extendedBy(),n))}a(eg,"telemetryError");async function Ryo(t,e,r,n,o=0){if(obe(o)&&!_se(t))return;let s=n||Wt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o,"IncludeExp",r),Syo(t,o,e,s)}a(Ryo,"_telemetryError");function _Kr(t,e,r,n,o,s){let c={completionTextJson:JSON.stringify(e),choiceIndex:o.toString()},l=s?.properties?.engineName;l&&(c.engineName=l,c.modelId=l);let u=Wt.createAndMarkAsIssued(c);if(r.logprobs)for(let[d,f]of Object.entries(r.logprobs))u.properties["logprobs_"+d]=JSON.stringify(f)??"unset";return u.extendWithRequestId(n),Et(t,"engine.completion",u,1)}a(_Kr,"logEngineCompletion");function vKr(t,e,r){let n={promptJson:JSON.stringify({prefix:e.prefix,context:e.context}),promptSuffixJson:JSON.stringify(e.suffix)};if(e.context){let s=r.properties["request.option.extra"]?JSON.parse(r.properties["request.option.extra"]):{};s.context=e.context,n["request.option.extra"]=JSON.stringify(s)}let o=r.extendedBy(n);return Et(t,"engine.prompt",o,1)}a(vKr,"logEnginePrompt");function kyo(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);if(t&&typeof t=="object"){let e=t,r;if(typeof e.message=="string")r=e.message;else try{r=JSON.stringify(e)}catch{r="Unknown error"}let n=new Error(r);return n.name=typeof e.name=="string"?e.name:typeof t,typeof e.stack=="string"&&(n.stack=e.stack),n}return new Error("Unknown error")}a(kyo,"buildErrorFromUnknown");p();var jW=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function Gm(t){return!t||typeof t!="object"?!1:t instanceof jW||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(Gm,"isAbortError");var Cse=class extends SyntaxError{constructor(r,n){super(r);this.code=n;this.name="JsonParseError"}static{a(this,"JsonParseError")}},aM=class extends Error{static{a(this,"FetchResponseError")}constructor(e,r=`HTTP ${e.status} ${e.statusText}`){super(r),this.name="FetchResponseError",this.code=`HTTP${e.status}`}},Pyo=new Set(["ECONNABORTED","ECONNRESET","EHOSTUNREACH","ENETUNREACH","ENOTCONN","ENOTFOUND","ETIMEDOUT","ERR_HTTP2_STREAM_ERROR","ERR_SSL_BAD_DECRYPT","ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC","ERR_SSL_INVALID_LIBRARY_(0)","ERR_SSL_SSLV3_ALERT_BAD_RECORD_MAC","ERR_SSL_WRONG_VERSION_NUMBER","ERR_STREAM_PREMATURE_CLOSE","ERR_TLS_CERT_ALTNAME_INVALID"]);function XI(t,e=!0){return t instanceof Error?e&&"cause"in t&&XI(t.cause,!1)?!0:t.name==="EditorFetcherError"||t.name==="FetchError"||t instanceof Cse||t instanceof aM||t?.message?.startsWith("net::")||Pyo.has(t.code??""):!1}a(XI,"isNetworkError");var ex=class{constructor(e,r,n,o,s){this.status=e;this.statusText=r;this.headers=n;this.getText=o;this.getBody=s;this.ok=this.status>=200&&this.status<300;this.clientError=this.status>=400&&this.status<500}static{a(this,"Response")}async text(){return this.getText()}async json(){let e=await this.text(),r=this.headers.get("content-type");if(!r||!r.includes("json"))throw new Cse(`Response content-type is ${r??"missing"} (status=${this.status})`,`ContentType=${r}`);try{return JSON.parse(e)}catch(n){if(n instanceof SyntaxError){let o=n.message.match(/^(.*?) in JSON at position (\d+)(?: \(line \d+ column \d+\))?$/);if(o&&parseInt(o[2],10)==e.length||n.message==="Unexpected end of JSON input"){let s=new TextEncoder().encode(e).length,c=this.headers.get("content-length");throw c===null?new Cse(`Response body truncated: actualLength=${s}`,"Truncated"):new Cse(`Response body truncated: actualLength=${s}, headerLength=${c}`,"Truncated")}}throw n}}body(){return this.getBody()}};function OU(t){let e=t.headers.get("retry-after");if(!e)return;let r=Number.parseFloat(e);if(Number.isFinite(r)&&r>=0)return r;let n=Date.parse(e);if(Number.isNaN(n))return;let o=n-Date.now();return o<=0?0:o/1e3}a(OU,"parseRetryAfterSeconds");var tr=class{static{a(this,"Fetcher")}getImplementation(){return this}};function HW(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={...l,...m?{}:{Authorization:`Bearer ${r}`},...Gy(t)};d===void 0&&(g["Openai-Organization"]="github-copilot",g["X-Request-Id"]=o,g["VScode-SessionId"]=t.get(Ua).sessionId,g["VScode-MachineId"]=t.get(Ua).machineId,g["X-GitHub-Api-Version"]="2026-01-09"),n&&(g["OpenAI-Intent"]=n);let A={method:"POST",headers:g,json:s,timeout:u};f&&h&&f.logRequest({timestamp:new Date().toISOString(),requestId:o,method:"POST",url:e,headers:g,messages:h,body:s});let y=t.get(tr);if(c){let _=new AbortController;c.onCancellationRequested(()=>{Et(t,"networking.cancelRequest",Wt.createAndMarkAsIssued({headerRequestId:o})),_.abort()}),A.signal=_.signal}return y.fetch(e,A).catch(_=>{if(Dyo(_))return Et(t,"networking.disconnectAll"),y.disconnectAll().then(()=>y.fetch(e,A));throw _})}a(HW,"postRequest");function Dyo(t){return t instanceof Error?t.message=="ERR_HTTP2_GOAWAY_SESSION"?!0:"code"in t?t.code=="ECONNRESET"||t.code=="ETIMEDOUT"||t.code=="ERR_HTTP2_INVALID_SESSION":!1:!1}a(Dyo,"isInterruptedNetworkError");p();function o7e(){return typeof process>"u"}a(o7e,"isWeb");function CB(){return typeof process<"u"&&process.env.MSBENCH_MODE==="true"}a(CB,"isMsBenchModeEnabled");var LDt=class extends aM{static{a(this,"ProxiedResponseError")}constructor(e){super(e,`HTTP ${e.status} response does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`)}};async function Gf(t,e,r,n={}){n={...n,headers:{Authorization:`Bearer ${e.accessToken}`,...o7e()?{}:Gy(t),...n.headers}};let o=await t.get(tr).fetch(new URL(r,e.apiUrl).href,n);if(o.status>=500)throw new aM(o);if(!o.headers.get("x-github-request-id"))throw new LDt(o);return o}a(Gf,"apiFetch");p();p();var ts=class{constructor(){this.recentNotifications=new Cn(100)}static{a(this,"NotificationSender")}async showWarningMessageOnlyOnce(e,r,...n){if(!this.recentNotifications.has(e??r))return this.recentNotifications.set(e??r,!0),this.showWarningMessage(r,...n)}async showInformationMessageOnlyOnce(e,r,...n){if(!this.recentNotifications.has(e??r))return this.recentNotifications.set(e??r,!0),this.showInformationMessage(r,...n)}};p();p();var la=class t{static{a(this,"ContentProvider")}static{this.registeredSchemes=new Set}static registerSchemes(e){for(let r of e)t.registeredSchemes.add(r)}static isRegisteredScheme(e){return t.registeredSchemes.has(e)}};var IKr=require("os"),s7e=require("path");p();var SKr;(()=>{"use strict";var t={975:L=>{function B(O){if(typeof O!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(O))}a(B,"e");function q(O,j){for(var Q,U="",Y=0,W=-1,V=0,z=0;z<=O.length;++z){if(z2){var ie=U.lastIndexOf("/");if(ie!==U.length-1){ie===-1?(U="",Y=0):Y=(U=U.slice(0,ie)).length-1-U.lastIndexOf("/"),W=z,V=0;continue}}else if(U.length===2||U.length===1){U="",Y=0,W=z,V=0;continue}}j&&(U.length>0?U+="/..":U="..",Y=2)}else U.length>0?U+="/"+O.slice(W+1,z):U=O.slice(W+1,z),Y=z-W-1;W=z,V=0}else Q===46&&V!==-1?++V:V=-1}return U}a(q,"r");var M={resolve:a(function(){for(var O,j="",Q=!1,U=arguments.length-1;U>=-1&&!Q;U--){var Y;U>=0?Y=arguments[U]:(O===void 0&&(O=process.cwd()),Y=O),B(Y),Y.length!==0&&(j=Y+"/"+j,Q=Y.charCodeAt(0)===47)}return j=q(j,!Q),Q?j.length>0?"/"+j:"/":j.length>0?j:"."},"resolve"),normalize:a(function(O){if(B(O),O.length===0)return".";var j=O.charCodeAt(0)===47,Q=O.charCodeAt(O.length-1)===47;return(O=q(O,!j)).length!==0||j||(O="."),O.length>0&&Q&&(O+="/"),j?"/"+O:O},"normalize"),isAbsolute:a(function(O){return B(O),O.length>0&&O.charCodeAt(0)===47},"isAbsolute"),join:a(function(){if(arguments.length===0)return".";for(var O,j=0;j0&&(O===void 0?O=Q:O+="/"+Q)}return O===void 0?".":M.normalize(O)},"join"),relative:a(function(O,j){if(B(O),B(j),O===j||(O=M.resolve(O))===(j=M.resolve(j)))return"";for(var Q=1;Qz){if(j.charCodeAt(W+H)===47)return j.slice(W+H+1);if(H===0)return j.slice(W+H)}else Y>z&&(O.charCodeAt(Q+H)===47?ie=H:H===0&&(ie=0));break}var re=O.charCodeAt(Q+H);if(re!==j.charCodeAt(W+H))break;re===47&&(ie=H)}var le="";for(H=Q+ie+1;H<=U;++H)H!==U&&O.charCodeAt(H)!==47||(le.length===0?le+="..":le+="/..");return le.length>0?le+j.slice(W+ie):(W+=ie,j.charCodeAt(W)===47&&++W,j.slice(W))},"relative"),_makeLong:a(function(O){return O},"_makeLong"),dirname:a(function(O){if(B(O),O.length===0)return".";for(var j=O.charCodeAt(0),Q=j===47,U=-1,Y=!0,W=O.length-1;W>=1;--W)if((j=O.charCodeAt(W))===47){if(!Y){U=W;break}}else Y=!1;return U===-1?Q?"/":".":Q&&U===1?"//":O.slice(0,U)},"dirname"),basename:a(function(O,j){if(j!==void 0&&typeof j!="string")throw new TypeError('"ext" argument must be a string');B(O);var Q,U=0,Y=-1,W=!0;if(j!==void 0&&j.length>0&&j.length<=O.length){if(j.length===O.length&&j===O)return"";var V=j.length-1,z=-1;for(Q=O.length-1;Q>=0;--Q){var ie=O.charCodeAt(Q);if(ie===47){if(!W){U=Q+1;break}}else z===-1&&(W=!1,z=Q+1),V>=0&&(ie===j.charCodeAt(V)?--V==-1&&(Y=Q):(V=-1,Y=z))}return U===Y?Y=z:Y===-1&&(Y=O.length),O.slice(U,Y)}for(Q=O.length-1;Q>=0;--Q)if(O.charCodeAt(Q)===47){if(!W){U=Q+1;break}}else Y===-1&&(W=!1,Y=Q+1);return Y===-1?"":O.slice(U,Y)},"basename"),extname:a(function(O){B(O);for(var j=-1,Q=0,U=-1,Y=!0,W=0,V=O.length-1;V>=0;--V){var z=O.charCodeAt(V);if(z!==47)U===-1&&(Y=!1,U=V+1),z===46?j===-1?j=V:W!==1&&(W=1):j!==-1&&(W=-1);else if(!Y){Q=V+1;break}}return j===-1||U===-1||W===0||W===1&&j===U-1&&j===Q+1?"":O.slice(j,U)},"extname"),format:a(function(O){if(O===null||typeof O!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof O);return(function(j,Q){var U=Q.dir||Q.root,Y=Q.base||(Q.name||"")+(Q.ext||"");return U?U===Q.root?U+Y:U+"/"+Y:Y})(0,O)},"format"),parse:a(function(O){B(O);var j={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return j;var Q,U=O.charCodeAt(0),Y=U===47;Y?(j.root="/",Q=1):Q=0;for(var W=-1,V=0,z=-1,ie=!0,H=O.length-1,re=0;H>=Q;--H)if((U=O.charCodeAt(H))!==47)z===-1&&(ie=!1,z=H+1),U===46?W===-1?W=H:re!==1&&(re=1):W!==-1&&(re=-1);else if(!ie){V=H+1;break}return W===-1||z===-1||re===0||re===1&&W===z-1&&W===V+1?z!==-1&&(j.base=j.name=V===0&&Y?O.slice(1,z):O.slice(V,z)):(V===0&&Y?(j.name=O.slice(1,W),j.base=O.slice(1,z)):(j.name=O.slice(V,W),j.base=O.slice(V,z)),j.ext=O.slice(W,z)),V>0?j.dir=O.slice(0,V-1):Y&&(j.dir="/"),j},"parse"),sep:"/",delimiter:":",win32:null,posix:null};M.posix=M,L.exports=M}},e={};function r(L){var B=e[L];if(B!==void 0)return B.exports;var q=e[L]={exports:{}};return t[L](q,q.exports,r),q.exports}a(r,"r"),r.d=(L,B)=>{for(var q in B)r.o(B,q)&&!r.o(L,q)&&Object.defineProperty(L,q,{enumerable:!0,get:B[q]})},r.o=(L,B)=>Object.prototype.hasOwnProperty.call(L,B),r.r=L=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})};var n={};let o;r.r(n),r.d(n,{URI:a(()=>m,"URI"),Utils:a(()=>N,"Utils")}),typeof process=="object"?o=process.platform==="win32":typeof navigator=="object"&&(o=navigator.userAgent.indexOf("Windows")>=0);let s=/^\w[\w\d+.-]*$/,c=/^\//,l=/^\/\//;function u(L,B){if(!L.scheme&&B)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${L.authority}", path: "${L.path}", query: "${L.query}", fragment: "${L.fragment}"}`);if(L.scheme&&!s.test(L.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(L.path){if(L.authority){if(!c.test(L.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(L.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(u,"a");let d="",f="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class m{static{a(this,"l")}static isUri(B){return B instanceof m||!!B&&typeof B.authority=="string"&&typeof B.fragment=="string"&&typeof B.path=="string"&&typeof B.query=="string"&&typeof B.scheme=="string"&&typeof B.fsPath=="string"&&typeof B.with=="function"&&typeof B.toString=="function"}scheme;authority;path;query;fragment;constructor(B,q,M,O,j,Q=!1){typeof B=="object"?(this.scheme=B.scheme||d,this.authority=B.authority||d,this.path=B.path||d,this.query=B.query||d,this.fragment=B.fragment||d):(this.scheme=(function(U,Y){return U||Y?U:"file"})(B,Q),this.authority=q||d,this.path=(function(U,Y){switch(U){case"https":case"http":case"file":Y?Y[0]!==f&&(Y=f+Y):Y=f}return Y})(this.scheme,M||d),this.query=O||d,this.fragment=j||d,u(this,Q))}get fsPath(){return v(this,!1)}with(B){if(!B)return this;let{scheme:q,authority:M,path:O,query:j,fragment:Q}=B;return q===void 0?q=this.scheme:q===null&&(q=d),M===void 0?M=this.authority:M===null&&(M=d),O===void 0?O=this.path:O===null&&(O=d),j===void 0?j=this.query:j===null&&(j=d),Q===void 0?Q=this.fragment:Q===null&&(Q=d),q===this.scheme&&M===this.authority&&O===this.path&&j===this.query&&Q===this.fragment?this:new A(q,M,O,j,Q)}static parse(B,q=!1){let M=h.exec(B);return M?new A(M[2]||d,R(M[4]||d),R(M[5]||d),R(M[7]||d),R(M[9]||d),q):new A(d,d,d,d,d)}static file(B){let q=d;if(o&&(B=B.replace(/\\/g,f)),B[0]===f&&B[1]===f){let M=B.indexOf(f,2);M===-1?(q=B.substring(2),B=f):(q=B.substring(2,M),B=B.substring(M)||f)}return new A("file",q,B,d,d)}static from(B){let q=new A(B.scheme,B.authority,B.path,B.query,B.fragment);return u(q,!0),q}toString(B=!1){return b(this,B)}toJSON(){return this}static revive(B){if(B){if(B instanceof m)return B;{let q=new A(B);return q._formatted=B.external,q._fsPath=B._sep===g?B.fsPath:null,q}}return B}}let g=o?1:void 0;class A extends m{static{a(this,"d")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=v(this,!1)),this._fsPath}toString(B=!1){return B?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){let B={$mid:1};return this._fsPath&&(B.fsPath=this._fsPath,B._sep=g),this._formatted&&(B.external=this._formatted),this.path&&(B.path=this.path),this.scheme&&(B.scheme=this.scheme),this.authority&&(B.authority=this.authority),this.query&&(B.query=this.query),this.fragment&&(B.fragment=this.fragment),B}}let y={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function E(L,B,q){let M,O=-1;for(let j=0;j=97&&Q<=122||Q>=65&&Q<=90||Q>=48&&Q<=57||Q===45||Q===46||Q===95||Q===126||B&&Q===47||q&&Q===91||q&&Q===93||q&&Q===58)O!==-1&&(M+=encodeURIComponent(L.substring(O,j)),O=-1),M!==void 0&&(M+=L.charAt(j));else{M===void 0&&(M=L.substr(0,j));let U=y[Q];U!==void 0?(O!==-1&&(M+=encodeURIComponent(L.substring(O,j)),O=-1),M+=U):O===-1&&(O=j)}}return O!==-1&&(M+=encodeURIComponent(L.substring(O))),M!==void 0?M:L}a(E,"m");function _(L){let B;for(let q=0;q1&&L.scheme==="file"?`//${L.authority}${L.path}`:L.path.charCodeAt(0)===47&&(L.path.charCodeAt(1)>=65&&L.path.charCodeAt(1)<=90||L.path.charCodeAt(1)>=97&&L.path.charCodeAt(1)<=122)&&L.path.charCodeAt(2)===58?B?L.path.substr(1):L.path[1].toLowerCase()+L.path.substr(2):L.path,o&&(q=q.replace(/\//g,"\\")),q}a(v,"v");function b(L,B){let q=B?_:E,M="",{scheme:O,authority:j,path:Q,query:U,fragment:Y}=L;if(O&&(M+=O,M+=":"),(j||O==="file")&&(M+=f,M+=f),j){let W=j.indexOf("@");if(W!==-1){let V=j.substr(0,W);j=j.substr(W+1),W=V.lastIndexOf(":"),W===-1?M+=q(V,!1,!1):(M+=q(V.substr(0,W),!1,!1),M+=":",M+=q(V.substr(W+1),!1,!0)),M+="@"}j=j.toLowerCase(),W=j.lastIndexOf(":"),W===-1?M+=q(j,!1,!0):(M+=q(j.substr(0,W),!1,!0),M+=j.substr(W))}if(Q){if(Q.length>=3&&Q.charCodeAt(0)===47&&Q.charCodeAt(2)===58){let W=Q.charCodeAt(1);W>=65&&W<=90&&(Q=`/${String.fromCharCode(W+32)}:${Q.substr(3)}`)}else if(Q.length>=2&&Q.charCodeAt(1)===58){let W=Q.charCodeAt(0);W>=65&&W<=90&&(Q=`${String.fromCharCode(W+32)}:${Q.substr(2)}`)}M+=q(Q,!0,!1)}return U&&(M+="?",M+=q(U,!1,!1)),Y&&(M+="#",M+=B?Y:E(Y,!1,!1)),M}a(b,"b");function T(L){try{return decodeURIComponent(L)}catch{return L.length>3?L.substr(0,3)+T(L.substr(3)):L}}a(T,"C");let w=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function R(L){return L.match(w)?L.replace(w,(B=>T(B))):L}a(R,"w");var x=r(975);let P=x.posix||x,D="/";var N;(function(L){L.joinPath=function(B,...q){return B.with({path:P.join(B.path,...q)})},L.resolvePath=function(B,...q){let M=B.path,O=!1;M[0]!==D&&(M=D+M,O=!0);let j=P.resolve(M,...q);return O&&j[0]===D&&!B.authority&&(j=j.substring(1)),B.with({path:j})},L.dirname=function(B){if(B.path.length===0||B.path===D)return B;let q=P.dirname(B.path);return q.length===1&&q.charCodeAt(0)===46&&(q=""),B.with({path:q})},L.basename=function(B){return P.basename(B.path)},L.extname=function(B){return P.extname(B.path)}})(N||(N={})),SKr=n})();var{URI:LU,Utils:abe}=SKr;function xKr(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+xKr(t.substring(3)):t}}a(xKr,"decodeURIComponentGraceful");var TKr=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function BDt(t){return t.match(TKr)?t.replace(TKr,e=>xKr(e)):t}a(BDt,"percentDecode");function Ks(t){if(/^[A-Za-z][A-Za-z0-9+.-]+:/.test(t))throw new Error("Path must not contain a scheme");if(!t)throw new Error("Path must not be empty");return LU.file(t).toString()}a(Ks,"makeFsUri");function to(t){if(typeof t!="string"&&(t=t.uri),/^[A-Za-z]:\\/.test(t))throw new Error(`Could not parse <${t}>: Windows-style path`);try{let e=t.match(/^(?:([^:/?#]+?:)?\/\/)(\/\/.*)$/);return e?LU.parse(e[1]+e[2],!0):LU.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(to,"parseUri");function a7e(t){return to(t),t}a(a7e,"validateUri");function Fs(t){try{return to(t).toString()}catch{return t}}a(Fs,"normalizeUri");function wKr(t){let e=Fs(t);return e.endsWith("/")?e.slice(0,-1):e}a(wKr,"normalizeUriNoTrailingSlash");var GW=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function un(t){let e=to(t);if(!GW.has(e.scheme)&&!la.isRegisteredScheme(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,IKr.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,s7e.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(un,"fsPath");function rs(t){try{return un(t)}catch{return}}a(rs,"getFsPath");function RKr(t){let e=rs(t);if(e)return LU.file(e).toString()}a(RKr,"getFsUri");function $W(t,...e){let r,n=rs(t);return n?r=Ks((0,s7e.resolve)(n,...e)):r=abe.resolvePath(to(t),...e.map(o=>kKr(o))).toString(),typeof t=="string"?r:{uri:r}}a($W,"resolveFilePath");function wa(t,...e){let r=abe.joinPath(to(t),...e.map(kKr)).toString();return typeof t=="string"?r:{uri:r}}a(wa,"joinPath");function kKr(t){return Nyo(t)?t.replaceAll("\\","/"):t}a(kKr,"pathToURIPath");function Nyo(t){return/^[^/\\]*\\/.test(t)}a(Nyo,"isWinPath");function Ji(t){return BDt((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(Ji,"basename");function uf(t){let e=abe.dirname(to(t)),r;return GW.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(uf,"dirname");function PKr(t){return abe.extname(to(t))}a(PKr,"extname");var $m=class{static{a(this,"NetworkConfiguration")}};function c7e(t,e){try{let r=new URL(e??"");if(r.protocol==="https:"||!UDt(t)&&r.protocol==="http:")return r.href}catch{}}a(c7e,"ensurePermittedUrl");var VW={api:"https://api.githubcopilot.com",proxy:"https://copilot-proxy.githubusercontent.com",telemetry:"https://copilot-telemetry.githubusercontent.com","origin-tracker":"https://origin-tracker.githubusercontent.com"};function FDt(t,e,r){if(r&&O1(t)){for(let n of r){let o=Ft(t,n);if(o)return o}return}for(let n of e){let o=Ft(t,n);if(o)return o}}a(FDt,"urlConfigOverride");function Myo(t,e){switch(e){case"api":return FDt(t,[Ye.DebugOverrideCapiUrl,Ye.DebugOverrideCapiUrlLegacy],[Ye.DebugTestOverrideCapiUrl,Ye.DebugTestOverrideCapiUrlLegacy]);case"proxy":return FDt(t,[Ye.DebugOverrideProxyUrl,Ye.DebugOverrideProxyUrlLegacy],[Ye.DebugTestOverrideProxyUrl,Ye.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!UDt(t))return FDt(t,[Ye.DebugSnippyOverrideUrl])}}a(Myo,"getEndpointOverrideUrl");function tx(t,e,r,...n){let o=Myo(t,r)??e.endpoints[r];return wa(o,...n)}a(tx,"getEndpointUrl");function bB(t){return rx(t)?.endpoints??VW}a(bB,"getLastKnownEndpoints");function l7e(t,e){if(e&&!c7e(t,e)){t.get(ts).showWarningMessage(`Ignoring invalid or unsupported authentication URL "${e}".`);return}t.get($m).setConfiguredUrls(t,{serverUrl:e})}a(l7e,"updateServerUrl");p();var Vm=class{static{a(this,"UrlOpener")}};var b_=new fe("auth"),QDt=60,Oyo=300;var Lyo=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"],Byo="4535c7beffc844b46bb1ed4aa04d759a";function $y(t){let e=t.serverUrl?.match(/^https?:\/\//)?t.serverUrl:"",r=t.apiUrl?.match(/^https?:\/\//)?t.apiUrl:"";return e?r||=e.replace("://","://api."):r?.includes("://api.")&&(e||=r.replace("://api.","://")),(!e||!r)&&(e="https://github.com/",r="https://api.github.com/"),{apiUrl:r,serverUrl:e}}a($y,"fillGitHubUrls");function BU(){return Math.floor(Date.now()/1e3)}a(BU,"nowSeconds");async function qDt(t,e,r){let n=Wt.createAndMarkAsIssued({},{});Et(t,"auth.new_login");let o={"X-GitHub-Api-Version":"2024-12-15"};r?.hasKnownOrg&&(o["X-GitHub-Staff-Request"]="1");let s=await Gf(t,e,"copilot_internal/v2/token",{timeout:12e4,headers:o}),c=await s.json();if(s.status===401){let h="Failed to get copilot token due to 401 status. Please sign out and try again.",m=s.headers.get("x-github-request-id")??"",g=c.error_details,A=[];m&&A.push(`request_id=${m}`),g?.url&&A.push(`url=${g.url}`),g?.notification_id&&A.push(`notification_id=${g.notification_id}`),g?.message&&A.push(`error=${g.message}`);let y=A.length>0?` (${A.join(", ")})`:"";return b_.info(t,`${h}${y}`),eg(t,"auth.unknown_401",n),{failureKind:"HTTP401",message:h}}if(!s.ok||!c.token){b_.info(t,`Invalid copilot token: missing token: ${s.status} ${s.statusText}`),eg(t,"auth.invalid_token",n.extendedBy({status:s.status.toString(),status_text:s.statusText}));let h=c.error_details;return h?.notification_id!=="not_signed_up"&&Fyo(t,h,e),{failureKind:"NotAuthorized",message:h?.message??"Could not retrieve token",canSignUpForLimited:c.can_signup_for_limited??!1}}let l=BU()+c.refresh_in+QDt,u=await cbe(t,e),d;u.ok&&(d=await u.json());let f=new WW(c,d,l);return Et(t,"auth.new_token",n.extendedBy({...oPt(f)},{adjusted_expires_at:f.expiresAt,expires_at:c.expires_at,current_time:BU()})),{copilotToken:f}}a(qDt,"authFromGitHubSession");var Rh=class{static{a(this,"CopilotTokenFetcher")}},u7e=class extends Rh{static{a(this,"NetworkCopilotTokenFetcher")}async fetchTokenResult(e,r,n){return await qDt(e,r,n)}};async function cbe(t,e){return await Gf(t,e,"copilot_internal/user",{timeout:12e4,headers:{"X-GitHub-Api-Version":"2025-05-01"}})}a(cbe,"fetchCopilotUserInfo");function Fyo(t,e,r){e&&t.get(ts).showWarningMessageOnlyOnce(e.notification_id,e.message,{title:e.title},{title:"Dismiss"}).then(async n=>{let o=n?.title===e.title,s=o||n?.title==="Dismiss";if(o){let c=t.get(Ir).getEditorPluginInfo(),l=e.url.replace("{EDITOR}",encodeURIComponent(c.name+"_"+c.version));await t.get(Vm).open(l)}e.notification_id&&s&&await Uyo(t,e.notification_id,r)}).catch(n=>{b_.exception(t,n,"copilotToken.notification")})}a(Fyo,"notifyUser");async function Uyo(t,e,r){let n=await Gf(t,r,"copilot_internal/notification",{method:"POST",body:JSON.stringify({notification_id:e})});(!n||!n.ok)&&b_.error(t,`Failed to send notification result to GitHub: ${n?.status} ${n?.statusText}`)}a(Uyo,"sendNotificationResultToGitHub");var WW=class{constructor(e,r,n){this.envelope=e;this.expiresAt=n;this.token=e.token,this.organization_list=e.organization_list,this.enterprise_list=e.enterprise_list,this.tokenMap=this.parseToken(this.token),this.userInfo=new P6e(r)}static{a(this,"CopilotToken")}get endpoints(){return{...VW,...this.envelope.endpoints??{}}}needsRefresh(){return this.expiresAt-Oyo(this.organization_list??[]).includes(e))}isGitHubUser(){return(this.organization_list??[]).includes(Byo)}isInternalUser(){return this.isMicrosoftUser()||this.isGitHubUser()}};p();var yi=class extends Error{static{a(this,"CopilotAuthError")}constructor(e,r){super(e,{cause:r}),this.name="CopilotAuthError"}};function d7e(t){return`Environment variable ${t} provides a token that is not valid for GitHub Copilot. Please unset it (or replace with a working token) and retry.`}a(d7e,"authEnvVarConflictMessage");var FU=class extends yi{static{a(this,"NoBrowserAvailableError")}constructor(e="Browser not available for OAuth code flow"){super(e),this.name="NoBrowserAvailableError"}};function DKr(t){let e=t.trim();if(!e)throw new yi("Invalid GitHub server URL: value is empty or whitespace.");let r;try{r=new URL(e)}catch{throw new yi("Invalid GitHub server URL: value is not a valid absolute URL.")}if(r.protocol!=="https:")throw new yi("Invalid GitHub server URL: only HTTPS URLs are supported.");if(r.port!=="")throw new yi("Invalid GitHub server URL: port numbers are not supported.");return r.toString()}a(DKr,"validateGitHubServerUrl");p();p();var nx=class{static{a(this,"AuthRepository")}};p();function NKr(t){let e=t.trim();if(!e)throw new yi("Invalid GitHub server URL: value is empty or whitespace.");let r=/^https?:\/\//i.test(e)?e:`https://${e}`,n=DKr(r),{apiUrl:o}=$y({serverUrl:n}),s=new URL(n).hostname;return{serverUrl:n,apiUrl:o,authAuthority:s}}a(NKr,"buildAuthServerEndpoint");function UU(t,e){if(e!==void 0)return NKr(e);{let r=t.get($m),{serverUrl:n,apiUrl:o}=r.getConfiguredUrls(),s=r.getAuthAuthority();return{serverUrl:n,apiUrl:o,authAuthority:s}}}a(UU,"resolveAuthServerEndpoint");function jDt(t){if(!t)return!1;try{return NKr(t),!0}catch{return!1}}a(jDt,"isValidAuthServer");p();p();p();p();p();p();p();p();function IB(t,e){return t||e}a(IB,"_pureAssign");function Wm(t,e){return t[e]}a(Wm,"_pureRef");var pC=void 0,kh=null,nNt="",E7e="function",ube="object",SB="prototype",tNt="__proto__",zW="undefined",m7e="constructor",iNt="Symbol",Qyo="_polyfill",YW="length",g7e="name",AA="call",_7e="toString",ix=IB(Object),oNt=Wm(ix,SB),UKr=IB(String),KW=Wm(UKr,SB),dbe=IB(Math),QKr=IB(Array),v7e=Wm(QKr,SB),TB=Wm(v7e,"slice");function $f(t,e){try{return{v:t.apply(this,e)}}catch(r){return{e:r}}}a($f,"safe");function qyo(t,e){var r=$f(t);return r.e?e:r.v}a(qyo,"safeGet");var HDt;function C7e(t){return function(e){return typeof e===t}}a(C7e,"_createIs");function qKr(t){var e="[object "+t+"]";return function(r){return!!(r&&fbe(r)===e)}}a(qKr,"_createObjIs");function fbe(t){return oNt[_7e].call(t)}a(fbe,"objToString");function Nn(t){return typeof t===zW||t===zW}a(Nn,"isUndefined");function jyo(t){return!Tse(t)}a(jyo,"isStrictUndefined");function Xt(t){return t===kh||Nn(t)}a(Xt,"isNullOrUndefined");function Hyo(t){return t===kh||!Tse(t)}a(Hyo,"isStrictNullOrUndefined");function Tse(t){return!!t||t!==pC}a(Tse,"isDefined");function Gyo(t){return!HDt&&(HDt=["string","number","boolean",zW,"symbol","bigint"]),t!==ube&&HDt.indexOf(t)!==-1}a(Gyo,"isPrimitiveType");var Ei=C7e("string"),Or=C7e(E7e);function Gu(t){return!t&&Xt(t)?!1:!!t&&typeof t===ube}a(Gu,"isObject");var ur=Wm(QKr,"isArray"),b7e=qKr("Date"),Dh=C7e("number"),Wk=C7e("boolean");var xB=qKr("Error");function tg(t){return!!(t&&t.then&&Or(t.then))}a(tg,"isPromiseLike");function W1(t){return!(!t||qyo(function(){return!(t&&0+t)},!t))}a(W1,"isTruthy");var Ise=Wm(ix,"getOwnPropertyDescriptor");function rg(t,e){return!!t&&oNt.hasOwnProperty[AA](t,e)}a(rg,"objHasOwnProperty");var yA=IB(Wm(ix,"hasOwn"),$yo);function $yo(t,e){return rg(t,e)||!!Ise(t,e)}a($yo,"polyObjHasOwn");function Yr(t,e,r){if(t&&Gu(t)){for(var n in t)if(yA(t,n)&&e[AA](r||t,n,t[n])===-1)break}}a(Yr,"objForEachKey");var f7e={e:"enumerable",c:"configurable",v:"value",w:"writable",g:"get",s:"set"};function Vyo(t){var e={};if(e[f7e.c]=!0,e[f7e.e]=!0,t.l){e.get=function(){return t.l.v};var r=Ise(t.l,"v");r&&r.set&&(e.set=function(n){t.l.v=n})}return Yr(t,function(n,o){e[f7e[n]]=jyo(o)?e[f7e[n]]:o}),e}a(Vyo,"_createProp");var S_=Wm(ix,"defineProperty"),jKr=Wm(ix,"defineProperties");function ji(t,e,r){return S_(t,e,Vyo(r))}a(ji,"objDefine");function HKr(t,e,r,n,o){var s={};return Yr(t,function(c,l){A7e(s,c,e?l:c),A7e(s,l,r?l:c)}),n?n(s):s}a(HKr,"_createKeyValueMap");function A7e(t,e,r,n){S_(t,e,{value:r,enumerable:!0,writable:!1})}a(A7e,"_assignMapValue");var Hu=IB(UKr),Wyo="[object Error]";function dr(t,e){var r=nNt,n=oNt[_7e][AA](t);n===Wyo&&(t={stack:Hu(t.stack),message:Hu(t.message),name:Hu(t.name)});try{r=JSON.stringify(t,kh,e?typeof e=="number"?e:4:pC),r=(r?r.replace(/"(\w+)"\s*:\s{0,1}/g,"$1: "):kh)||Hu(t)}catch(o){r=" - "+dr(o,e)}return n+": "+r}a(dr,"dumpObj");function Zc(t){throw new Error(t)}a(Zc,"throwError");function zm(t){throw new TypeError(t)}a(zm,"throwTypeError");var GKr=Wm(ix,"freeze");function zyo(t){return t}a(zyo,"_doNothing");function Yyo(t){return t[tNt]||kh}a(Yyo,"_getProto");var wB=Wm(ix,"assign"),$u=Wm(ix,"keys");function T_(t){return GKr&&Yr(t,function(e,r){(ur(r)||Gu(r))&&T_(r)}),Nh(t)}a(T_,"objDeepFreeze");var Nh=IB(GKr,zyo);var rNt=IB(Wm(ix,"getPrototypeOf"),Yyo);function S7e(t){return HKr(t,1,0,Nh)}a(S7e,"createEnum");function Kyo(t){return HKr(t,0,0,Nh)}a(Kyo,"createEnumKeyMap");function Jyo(t){var e={};return Yr(t,function(r,n){A7e(e,r,n[1]),A7e(e,n[0],n[1])}),Nh(e)}a(Jyo,"createSimpleMap");function sNt(t){return Jyo(t)}a(sNt,"createTypeMap");var $Kr=Kyo({asyncIterator:0,hasInstance:1,isConcatSpreadable:2,iterator:3,match:4,matchAll:5,replace:6,search:7,species:8,split:9,toPrimitive:10,toStringTag:11,unscopables:12}),MKr="__tsUtils$gblCfg",GDt;function VKr(){var t;return typeof globalThis!==zW&&(t=globalThis),!t&&typeof self!==zW&&(t=self),!t&&typeof window!==zW&&(t=window),!t&&typeof global!==zW&&(t=global),t}a(VKr,"_getGlobalValue");function WKr(){if(!GDt){var t=$f(VKr).v||{};GDt=t[MKr]=t[MKr]||{}}return GDt}a(WKr,"_getGlobalConfig");var xse=pbe;function pbe(t,e,r){var n=e?e[t]:kh;return function(o){var s=(o?o[t]:kh)||n;if(s||r){var c=arguments;return(s||r).apply(o,s?TB[AA](c,1):c)}zm('"'+Hu(t)+'" not defined for '+dr(o))}}a(pbe,"_unwrapFunctionWithPoly");function Zyo(t){return function(e){return e[t]}}a(Zyo,"_unwrapProp");var QU=Wm(dbe,"min"),zk=Wm(dbe,"max"),OKr=xse("slice",KW),Vf=xse("substring",KW),T7e=pbe("substr",KW,Xyo);function Xyo(t,e,r){return Xt(t)&&zm("Invalid "+dr(t)),r<0?nNt:(e=e||0,e<0&&(e=zk(e+t[YW],0)),Nn(r)?OKr(t,e):OKr(t,e,e+r))}a(Xyo,"polyStrSubstr");function cM(t,e){return Vf(t,0,e)}a(cM,"strLeft");var LKr="_urid",$Dt;function eEo(){if(!$Dt){var t=WKr();$Dt=t.gblSym=t.gblSym||{k:{},s:{}}}return $Dt}a(eEo,"_globalSymbolRegistry");var p7e;function aNt(t){var e={description:Hu(t),toString:a(function(){return iNt+"("+t+")"},"toString")};return e[Qyo]=!0,e}a(aNt,"polyNewSymbol");function tEo(t){var e=eEo();if(!yA(e.k,t)){var r=aNt(t),n=$u(e.s).length;r[LKr]=function(){return n+"_"+r[_7e]()},e.k[t]=r,e.s[r[LKr]()]=Hu(t)}return e.k[t]}a(tEo,"polySymbolFor");function rEo(t){!p7e&&(p7e={});var e,r=$Kr[t];return r&&(e=p7e[r]=p7e[r]||aNt(iNt+"."+r)),e}a(rEo,"polyGetKnownSymbol");var Ph;function qU(){Ph=WKr()}a(qU,"_initTestHooks");function I7e(t){var e={};return!Ph&&qU(),e.b=Ph.lzy,S_(e,"v",{configurable:!0,get:a(function(){var r=t();return Ph.lzy||S_(e,"v",{value:r}),e.b=Ph.lzy,r},"get")}),e}a(I7e,"getLazy");function z1(t){return S_({toJSON:a(function(){return t},"toJSON")},"v",{value:t})}a(z1,"createCachedValue");var zKr="window",lbe;function x7e(t,e){var r;return function(){return!Ph&&qU(),(!r||Ph.lzy)&&(r=z1($f(t,e).v)),r.v}}a(x7e,"_getGlobalInstFn");function Vy(t){return!Ph&&qU(),(!lbe||t===!1||Ph.lzy)&&(lbe=z1($f(VKr).v||kh)),lbe.v}a(Vy,"getGlobal");function Di(t,e){var r;if(!lbe||e===!1?r=Vy(e):r=lbe.v,r&&r[t])return r[t];if(t===zKr)try{return window}catch{}return kh}a(Di,"getInst");function RB(){return!!df()}a(RB,"hasDocument");var df=x7e(Di,["document"]);function wse(){return!!ff()}a(wse,"hasWindow");var ff=x7e(Di,[zKr]);function JW(){return!!Vu()}a(JW,"hasNavigator");var Vu=x7e(Di,["navigator"]);var YKr=x7e(function(){return!!$f(function(){return process&&(process.versions||{}).node}).v});var Sse,VDt;function w7e(){return Sse=z1($f(Di,[iNt]).v),Sse}a(w7e,"_initSymbol");function nEo(t){var e=(Ph.lzy?0:Sse)||w7e();return e.v?e.v[t]:pC}a(nEo,"_getSymbolKey");function KKr(){return!!iEo()}a(KKr,"hasSymbol");function iEo(){return!Ph&&qU(),((Ph.lzy?0:Sse)||w7e()).v}a(iEo,"getSymbol");function hbe(t,e){var r=$Kr[t];!Ph&&qU();var n=(Ph.lzy?0:Sse)||w7e();return n.v?n.v[r||t]:e?pC:rEo(t)}a(hbe,"getKnownSymbol");function ox(t,e){!Ph&&qU();var r=(Ph.lzy?0:Sse)||w7e();return r.v?r.v(t):e?kh:aNt(t)}a(ox,"newSymbol");function jU(t){return!Ph&&qU(),VDt=(Ph.lzy?0:VDt)||z1($f(nEo,["for"]).v),(VDt.v||tEo)(t)}a(jU,"symbolFor");function y7e(t){return!!t&&Or(t.next)}a(y7e,"isIterator");function cNt(t){return!Hyo(t)&&Or(t[hbe(3)])}a(cNt,"isIterable");var h7e;function R7e(t,e,r){if(t&&(y7e(t)||(!h7e&&(h7e=z1(hbe(3))),t=t[h7e.v]?t[h7e.v]():kh),y7e(t))){var n=pC,o=pC;try{for(var s=0;!(o=t.next()).done&&e[AA](r||t,o.value,s,t)!==-1;)s++}catch(c){n={e:c},t.throw&&(o=kh,t.throw(n))}finally{try{o&&!o.done&&t.return&&t.return(o)}finally{if(n)throw n.e}}}}a(R7e,"iterForOf");function bse(t,e,r){return t.apply(e,r)}a(bse,"fnApply");function Mh(t,e){return!Nn(e)&&t&&(ur(e)?bse(t.push,t,e):y7e(e)||cNt(e)?R7e(e,function(r){t.push(r)}):t.push(e)),t}a(Mh,"arrAppend");function Ct(t,e,r){if(t)for(var n=t[YW]>>>0,o=0;o0?r:0;return Vf(t,o,o+n[YW])===n}a(EEo,"polyStrStartsWith");var ZDt="ref",XDt="unref",eNt="hasRef",_Eo="enabled";function vEo(t,e,r){var n=!0,o=t?e(kh):kh,s;function c(){return n=!1,o&&o[XDt]&&o[XDt](),s}a(c,"_unref");function l(){o&&r(o),o=kh}a(l,"_cancel");function u(){return o=e(o),n||c(),s}a(u,"_refresh");function d(f){!f&&o&&l(),f&&!o&&u()}return a(d,"_setEnabled"),s={cancel:l,refresh:u},s[eNt]=function(){return o&&o[eNt]?o[eNt]():n},s[ZDt]=function(){return n=!0,o&&o[ZDt]&&o[ZDt](),s},s[XDt]=c,s=S_(s,_Eo,{get:a(function(){return!!o},"get"),set:d}),{h:s,dn:a(function(){o=kh},"dn")}}a(vEo,"_createTimerHandler");function uNt(t,e,r){var n=ur(e),o=n?e.length:0,s=(o>0?e[0]:n?pC:e)||setTimeout,c=(o>1?e[1]:pC)||clearTimeout,l=r[0];r[0]=function(){u.dn(),bse(l,pC,TB[AA](arguments))};var u=vEo(t,function(d){if(d){if(d.refresh)return d.refresh(),d;bse(c,pC,[d])}return bse(s,pC,r)},function(d){bse(c,pC,[d])});return u.h}a(uNt,"_createTimeoutWith");function Up(t,e){return uNt(!0,pC,TB[AA](arguments))}a(Up,"scheduleTimeout");function rJr(t,e,r){return uNt(!0,t,TB[AA](arguments,1))}a(rJr,"scheduleTimeoutWith");function k7e(t,e){return uNt(!1,pC,TB[AA](arguments))}a(k7e,"createTimeout");var Ebe=S7e,dNt=sNt;p();var Yk=Ebe({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var Kk="toLowerCase",dn="length",Pse="warnToConsole",DB="throwInternal",uM="watch",GU="apply",Fi="push",sx="splice",Wu="logger",dM="cancel",NB="initialize",fM="identifier",Dse="removeNotificationListener",Nse="addNotificationListener",hC="isInitialized",_be="getNotifyMgr",$U="getPlugin",K1="name",Ym="processNext",P7e="getProcessTelContext",MB="value",VU="enabled",fNt="stopPollingInternalLogs",ax="unload",vbe="onComplete",D7e="version",N7e="loggingLevelConsole",pM="createNew",J1="teardown",Mse="messageId",hM="message",mC="diagLog",WU="_doTeardown",XW="update",Z1="getNext",zU="setNextPlugin",Cbe="userAgent",cx="split",Jk="replace",bbe="substring",Sbe="indexOf",OB="type",pNt="evtName",Zk="status",hNt="getAllResponseHeaders",Tbe="isChildEvt",X1="data",ez="getCtx",Xk="setCtx",mNt="itemsReceived",Ibe="headers",Ose="urlString",tz="timeout";var M7e="traceFlags";var gNt;function nJr(t,e){gNt||(gNt=gbe("AggregationError",function(n,o){o[dn]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw Ct(e,function(n,o){r+=` -`.concat(o," > ").concat(dr(n))}),new gNt(r,e||[])}a(nJr,"throwAggregationError");p();p();p();var Lse="function",lx="object",eS="undefined",tS="prototype";var YU=Object,xbe=YU[tS];p();var XRl=(Vy()||{}).Symbol,ekl=(Vy()||{}).Reflect;var iJr="hasOwnProperty",bEo=a(function(t){for(var e,r=1,n=arguments.length;r0)for(var o=0;o=0;r--)if(t[r]===e)return!0;return!1}a(wNt,"_hasVisited");function IEo(t,e,r,n){function o(u,d,f){var h=d[f];if(h[_Nt]&&n){var m=u[q7e]||{};m[wbe]!==!1&&(h=(m[d[Bse]]||{})[f]||h)}return function(){return h.apply(u,arguments)}}a(o,"_instFuncProxy");var s=lM(null);j7e(r,function(u){s[u]=o(e,r,u)});for(var c=nz(t),l=[];c&&!INt(c)&&!wNt(l,c);)j7e(c,function(u){!s[u]&&xNt(c,u,!Rbe)&&(s[u]=o(e,c,u))}),l.push(c),c=nz(c);return s}a(IEo,"_getBaseFuncs");function xEo(t,e,r,n){var o=null;if(t&&rg(r,Bse)){var s=t[q7e]||lM(null);if(o=(s[r[Bse]]||lM(null))[e],o||H7e("Missing ["+e+"] "+Q7e),!o[vNt]&&s[wbe]!==!1){for(var c=!rg(t,e),l=nz(t),u=[];c&&l&&!INt(l)&&!wNt(u,l);){var d=l[e];if(d){c=d===n;break}u.push(l),l=nz(l)}try{c&&(t[e]=o),o[vNt]=1}catch{s[wbe]=!1}}}return o}a(xEo,"_getInstFunc");function wEo(t,e,r){var n=e[t];return n===r&&(n=nz(e)[t]),typeof n!==Q7e&&H7e("["+t+"] is not a "+Q7e),n}a(wEo,"_getProtoFunc");function REo(t,e,r,n,o){function s(u,d){var f=a(function(){var h=xEo(this,d,u,f)||wEo(d,u,f);return h.apply(this,arguments)},"dynProtoProxy");return f[_Nt]=1,f}if(a(s,"_createDynamicPrototype"),!F7e(t)){var c=r[q7e]=r[q7e]||lM(null);if(!F7e(c)){var l=c[e]=c[e]||lM(null);c[wbe]!==!1&&(c[wbe]=!!o),F7e(l)||j7e(r,function(u){xNt(r,u,!1)&&r[u]!==n[u]&&(l[u]=r[u],delete r[u],(!rg(t,u)||t[u]&&!t[u][_Nt])&&(t[u]=s(t,u)))})}}}a(REo,"_populatePrototype");function kEo(t,e){if(Rbe){for(var r=[],n=nz(e);n&&!INt(n)&&!wNt(r,n);){if(n===t)return!0;r.push(n),n=nz(n)}return!1}return!0}a(kEo,"_checkPrototype");function ENt(t,e){return rg(t,LB)?t.name||e||oJr:((t||{})[U7e]||{}).name||e||oJr}a(ENt,"_getObjName");function Si(t,e,r,n){rg(t,LB)||H7e("theClass is an invalid class definition.");var o=t[LB];kEo(o,e)||H7e("["+ENt(t)+"] not in hierarchy of ["+ENt(e)+"]");var s=null;rg(o,Bse)?s=o[Bse]:(s=SEo+ENt(t,"_")+"$"+bNt.n,bNt.n++,o[Bse]=s);var c=Si[lJr],l=!!c[B7e];l&&n&&n[B7e]!==void 0&&(l=!!n[B7e]);var u=TEo(e),d=IEo(o,e,u,l);r(e,d);var f=!!Rbe&&!!c[CNt];f&&n&&(f=!!n[CNt]),REo(o,s,e,u,f!==!1)}a(Si,"dynamicProto");Si[lJr]=bNt.o;p();var $7e="Promise";var LNt="rejected";function _l(t,e){return V7e(t,function(r){return e?e({status:"fulfilled",rejected:!1,value:r}):r},function(r){return e?e({status:LNt,rejected:!0,reason:r}):r})}a(_l,"doAwaitResponse");function V7e(t,e,r,n){var o=t;try{if(tg(t))(e||r)&&(o=t.then(e,r));else try{e&&(o=e(t))}catch(s){if(r)o=r(s);else throw s}}finally{n&&PEo(o,n)}return o}a(V7e,"doAwait");function PEo(t,e){var r=t;return e&&(tg(t)?t.finally?r=t.finally(e):r=t.then(function(n){return e(),n},function(n){throw e(),n}):e()),r}a(PEo,"doFinally");var RNt,kNt,PNt,uJr=!1;function DEo(t,e,r,n){RNt=RNt||{toString:a(function(){return"[[PromiseState]]"},"toString")},kNt=kNt||{toString:a(function(){return"[[PromiseResult]]"},"toString")},PNt=PNt||{toString:a(function(){return"[[PromiseIsHandled]]"},"toString")};var o={};o[RNt]={get:e},o[kNt]={get:r},o[PNt]={get:n},jKr(t,o)}a(DEo,"_addDebugState$1");var pJr=["pending","resolving","resolved",LNt],dJr="dispatchEvent",G7e;function NEo(t){var e;return t&&t.createEvent&&(e=t.createEvent("Event")),!!e&&e.initEvent}a(NEo,"_hasInitEventFn");function MEo(t,e,r,n){var o=df();!G7e&&(G7e=z1(!!$f(NEo,[o]).v));var s=G7e.v?o.createEvent("Event"):n?new Event(e):{};if(r&&r(s),G7e.v&&s.initEvent(e,!1,!0),s&&t[dJr])t[dJr](s);else{var c=t["on"+e];if(c)c(s);else{var l=Di("console");l&&(l.error||l.log)(e,dr(s))}}}a(MEo,"emitEvent");var hJr="unhandledRejection",OEo=hJr.toLowerCase(),kbe=[],LEo=0,BEo=10;var DNt;function fJr(t){return Or(t)?t.toString():dr(t)}a(fJr,"dumpFnObj");function mJr(t,e,r){var n=HU(arguments,3),o=0,s=!1,c,l=[],u=LEo++,d=kbe.length>0?kbe[kbe.length-1]:void 0,f=!1,h=null,m;function g(w,R){try{kbe.push(u),f=!0,h&&h.cancel(),h=null;var x=t(function(P,D){l.push(function(){try{var N=o===2?w:R,L=Nn(N)?c:Or(N)?N(c):N;tg(L)?L.then(P,D):N?P(L):o===3?D(L):P(L)}catch(B){D(B)}}),s&&_()},n);return x}finally{kbe.pop()}}a(g,"_then");function A(w){return g(void 0,w)}a(A,"_catch");function y(w){var R=w,x=w;return Or(w)&&(R=a(function(P){return w&&w(),P},"thenFinally"),x=a(function(P){throw w&&w(),P},"catchFinally")),g(R,x)}a(y,"_finally");function E(){return pJr[o]}a(E,"_strState");function _(){if(l.length>0){var w=l.slice();l=[],f=!0,h&&h.cancel(),h=null,e(w)}}a(_,"_processQueue");function v(w,R){return function(x){if(o===R){if(w===2&&tg(x)){o=1,x.then(v(2,1),v(3,1));return}o=w,s=!0,c=x,_(),!f&&w===3&&!h&&(h=Up(b,BEo))}}}a(v,"_createSettleIfFn");function b(){if(!f)if(f=!0,YKr())process.emit(hJr,c,m);else{var w=ff()||Vy();!DNt&&(DNt=z1($f(Di,[$7e+"RejectionEvent"]).v)),MEo(w,OEo,function(R){return ji(R,"promise",{g:a(function(){return m},"g")}),R.reason=c,R},!!DNt.v)}}a(b,"_notifyUnhandledRejection"),m={then:g,catch:A,finally:y},S_(m,"state",{get:E}),uJr&&DEo(m,E,function(){return fbe(c)},function(){return f}),KKr()&&(m[hbe(11)]="IPromise");function T(){return"IPromise"+(uJr?"["+u+(Nn(d)?"":":"+d)+"]":"")+" "+E()+(s?" - "+fJr(c):"")}return a(T,"_toString"),m.toString=T,a((function(){Or(r)||zm($7e+": executor is not a function - "+fJr(r));var R=v(3,0);try{r.call(m,v(2,0),R)}catch(x){R(x)}}),"_initialize")(),m}a(mJr,"_createPromise");function FEo(t){return function(e){var r=HU(arguments,1);return t(function(n,o){try{var s=[],c=1;R7e(e,function(l,u){l&&(c++,V7e(l,function(d){s[u]=d,--c===0&&n(s)},o))}),c--,c===0&&n(s)}catch(l){o(l)}},r)}}a(FEo,"_createAllPromise");function UEo(t){return z1(function(e){var r=HU(arguments,1);return t(function(n,o){var s=[],c=1;function l(u,d){c++,_l(u,function(f){f.rejected?s[d]={status:LNt,reason:f.reason}:s[d]={status:"fulfilled",value:f.value},--c===0&&n(s)})}a(l,"processItem");try{ur(e)?Ct(e,l):cNt(e)?R7e(e,l):zm("Input is not an iterable"),c--,c===0&&n(s)}catch(u){o(u)}},r)})}a(UEo,"_createAllSettledPromise");function gJr(t){Ct(t,function(e){try{e()}catch{}})}a(gJr,"syncItemProcessor");function QEo(t){var e=Dh(t)?t:0;return function(r){Up(function(){gJr(r)},e)}}a(QEo,"timeoutItemProcessor");function AJr(t,e){return mJr(AJr,QEo(e),t,e)}a(AJr,"createAsyncPromise");var NNt;function qEo(t,e){!NNt&&(NNt=z1($f(Di,[$7e]).v||null));var r=NNt.v;if(!r)return AJr(t);Or(t)||zm($7e+": executor is not a function - "+dr(t));var n=0;function o(){return pJr[n]}a(o,"_strState");var s=new r(function(c,l){function u(f){n=2,c(f)}a(u,"_resolve");function d(f){n=3,l(f)}a(d,"_reject"),t(u,d)});return S_(s,"state",{get:o}),s}a(qEo,"createNativePromise");var MNt;function Pbe(t){return mJr(Pbe,gJr,t)}a(Pbe,"createSyncPromise");function W7e(t,e){return!MNt&&(MNt=UEo(Pbe)),MNt.v(t,e)}a(W7e,"createSyncAllSettledPromise");var ONt;function Dd(t,e){return!ONt&&(ONt=z1(qEo)),ONt.v.call(this,t,e)}a(Dd,"createPromise");var z7e=FEo(Dd);var Nkl=hbe(11);p();p();p();p();var rS=void 0,So="",iz="channels",Wf="core",Y7e="createPerfMgr",Dbe="disabled",BB="extensionConfig",oz="extensions",gC="processTelemetry",sz="priority",Fse="eventsSent",KU="eventsDiscarded",Use="eventsSendRequest",mM="perfEvent",K7e="offlineEventsStored",J7e="offlineBatchSent",Z7e="offlineBatchDrop",Qse="getPerfMgr",X7e="domain",eQe="path",yJr="Not dynamic - ",EJr="REDACTED",BNt=["sig","Signature","AWSAccessKeyId","X-Goog-Signature"];var jEo="getPrototypeOf",HEo=/-([a-z])/g,GEo=/([^\w\d_$])/g,$Eo=/^(\d+[\w\d_$])/,Hkl=Object[jEo];function JU(t){return!Xt(t)}a(JU,"isNotNullOrUndefined");function Nbe(t){var e=t;return e&&Ei(e)&&(e=e[Jk](HEo,function(r,n){return n.toUpperCase()}),e=e[Jk](GEo,"_"),e=e[Jk]($Eo,function(r,n){return"_"+n})),e}a(Nbe,"normalizeJsName");function Km(t,e){return t&&e?lu(t,e)!==-1:!1}a(Km,"strContains");function ZU(t){return t&&t.toISOString()||""}a(ZU,"toISOString");function Qp(t){return xB(t)?t[K1]:So}a(Qp,"getExceptionName");function gM(t,e,r,n,o){var s=r;return t&&(s=t[e],s!==r&&(!o||o(s))&&(!n||n(r))&&(s=r,t[e]=s)),s}a(gM,"setValue");function FNt(t,e,r){var n;return t?(n=t[e],!n&&Xt(n)&&(n=Nn(r)?{}:r,t[e]=n)):n=Nn(r)?{}:r,n}a(FNt,"getSetValue");function VEo(t,e){var r=null,n=null;return Or(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][GU](n,o)}}a(VEo,"_createProxyFunction");function az(t,e,r,n,o){t&&e&&r&&(o!==!1||Nn(t[e]))&&(t[e]=VEo(r,n))}a(az,"proxyFunctionAs");function cz(t,e,r,n){return t&&e&&Gu(t)&&ur(r)&&Ct(r,function(o){Ei(o)&&az(t,o,e,o,n)}),t}a(cz,"proxyFunctions");function UNt(t){return(function(){function e(){var r=this;t&&Yr(t,function(n,o){r[n]=o})}return a(e,"class_1"),e})()}a(UNt,"createClassFromInterface");function rQe(t){return t&&wB&&(t=YU(wB({},t))),t}a(rQe,"optimizeObject");function nQe(t,e,r,n,o,s){var c=arguments,l=c[0]||{},u=c[dn],d=!1,f=1;for(u>0&&Wk(l)&&(d=l,l=c[f]||{},f++),Gu(l)||(l={});f>>=0),Fbe=xJr+t&uz,Ube=wJr-t&uz,RJr=!0}a(s_o,"_mwcSeed");function a_o(){try{var t=El()&2147483647;s_o((Math.random()*IJr^t)+t)}catch{}}a(a_o,"_autoSeedMwc");function TJr(t){var e=0,r=zNt()||YNt();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&uz),e===0&&Hse()&&(RJr||a_o(),e=c_o()&uz),e===0&&(e=Y1(IJr*Math.random()|0)),t||(e>>>=0),e}a(TJr,"random32");function c_o(t){Ube=36969*(Ube&65535)+(Ube>>16)&uz,Fbe=18e3*(Fbe&65535)+(Fbe>>16)&uz;var e=(Ube<<16)+(Fbe&65535)>>>0&uz|0;return t||(e>>>=0),e}a(c_o,"mwcRandom32");function kJr(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=TJr()>>>0,n=0,o=So;o[dn]>>=6,n===5&&(r=(TJr()<<2&4294967295|r&3)>>>0,n=0);return o}a(kJr,"newId");var PJr="3.3.11",l_o="."+kJr(6),u_o=0;function DJr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(DJr,"_canAcceptData");function d_o(t,e){var r=e[t.id];if(!r){r={};try{DJr(e)&&ji(e,t.id,{e:!1,v:r})}catch{}}return r}a(d_o,"_getCache");function nS(t,e){return e===void 0&&(e=!1),Nbe(t+u_o+++(e?"."+PJr:So)+l_o)}a(nS,"createUniqueNamespace");function sQe(t){var e={id:nS("_aiData-"+(t||So)+"."+PJr),accept:a(function(r){return DJr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[Nbe(n)]:(s&&(c=d_o(e,r),c[Nbe(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(sQe,"createElmNodeData");p();function aQe(t){return t&&Gu(t)&&!ur(t)&&(t.isVal||t.fb||yA(t,"v")||yA(t,"mrg")||yA(t,"ref")||t.set)}a(aQe,"_isConfigDefaults");function NJr(t,e,r){var n,o=r.dfVal||Tse;if(e&&r.fb){var s=r.fb;ur(s)||(s=[s]);for(var c=0;c0&&nJr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[dn]>0){c||(c=[]),l||(l=Up(function(){l=null,f()},0));for(var A=0;A0?_l(FB(t[0],e),function(){fQe(HU(t,1),e,r)}):r(),n}a(fQe,"doUnloadAll");p();var FJr=500,tMt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function E_o(t,e,r){return!t&&Xt(t)?e:Wk(t)?t:Hu(t)[Kk]()==="true"}a(E_o,"_stringToBoolOrDefault");function rMt(t){return{mrg:!0,v:t}}a(rMt,"cfgDfMerge");function $se(t,e,r){return{fb:r,isVal:t,v:e}}a($se,"cfgDfValidate");function fx(t,e){return{fb:e,set:E_o,v:!!t}}a(fx,"cfgDfBoolean");p();p();var nMt=[Fse,KU,Use,mM],hQe=null,pQe;function __o(t,e){return function(){var r=arguments,n=iMt(e);if(n){var o=n.listener;o&&o[t]&&o[t][GU](o,r)}}}a(__o,"_listenerProxyFunc");function v_o(){var t=Di("Microsoft");return t&&(hQe=t.ApplicationInsights),hQe}a(v_o,"_getExtensionNamespace");function iMt(t){var e=hQe;return!e&&t.disableDbgExt!==!0&&(e=hQe||v_o()),e?e.ChromeDbgExt:null}a(iMt,"getDebugExt");function UJr(t){if(!pQe){pQe={};for(var e=0;e=A&&(d[T](b[hM]),n[w]=!0)}else o>=A&&d[T](b[hM]);f(A,b)}},d.debugToConsole=function(A){oMt("debug",A),g("warning",A)},d[Pse]=function(A){oMt("warn",A),g("warning",A)},d.errorToConsole=function(A){oMt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[ax]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=S_o+y[Mse];if(n[_]?E=!1:n[_]=!0,E&&(A<=s&&(d.queue[Fi](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",b=new $be(23,v,!1);d.queue[Fi](b),A===1?d.errorToConsole(v):d[Pse](v)}}}a(f,"_logInternalMessage");function h(A){return dx(Oh(A,T_o,d).cfg,function(y){var E=y.cfg;o=E[N7e],s=E.loggingLevelTelemetry,c=E.maxMessageLimit,l=E.enableDebug})}a(h,"_setDefaultsFromConfig");function m(){return r>=c}a(m,"_areInternalMessagesThrottled");function g(A,y){var E=iMt(e||{});E&&E[mC]&&E[mC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function jJr(t){return t||new Wse}a(jJr,"_getLogger");function Wr(t,e,r,n,o,s){s===void 0&&(s=!1),jJr(t)[DB](e,r,n,o,s)}a(Wr,"_throwInternal");function UB(t,e){jJr(t)[Pse](e)}a(UB,"_warnToConsole");var sMt,t7,HJr="toGMTString",GJr="toUTCString",uMt="cookie",aMt="expires",$Jr="isCookieUseDisabled",Vbe="disableCookiesUsage",VJr="_ckMgr",mQe=null,cMt=null,WJr=null,yM,zJr={},YJr={},x_o=(sMt={cookieCfg:rMt((t7={},t7[X7e]={fb:"cookieDomain",dfVal:JU},t7.path={fb:"cookiePath",dfVal:JU},t7.enabled=rS,t7.ignoreCookies=rS,t7.blockedCookies=rS,t7.disableCookieDefer=!1,t7)),cookieDomain:rS,cookiePath:rS},sMt[Vbe]=rS,sMt);function dMt(){!yM&&(yM=I7e(function(){return df()}))}a(dMt,"_getDoc");function gQe(t){return t?t.isEnabled():!0}a(gQe,"_isMgrEnabled");function tZr(t,e){return e&&t&&ur(t.ignoreCookies)?Vo(t.ignoreCookies,e)!==-1:!1}a(tZr,"_isIgnoredCookie");function KJr(t,e){return e&&t&&ur(t.blockedCookies)&&Vo(t.blockedCookies,e)!==-1?!0:tZr(t,e)}a(KJr,"_isBlockedCookie");function JJr(t,e){var r=e[VU];if(Xt(r)){var n=void 0;Nn(t[$Jr])||(n=!t[$Jr]),Nn(t[Vbe])||(n=!t[Vbe]),r=n}return r}a(JJr,"_isCfgEnabled");function rZr(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[eQe]=E||"/",_[aMt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return Hse()||(v["max-age"]="0"),XJr(So,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Ni(E||So),R=lu(w,";");if(R!==-1&&(w=Ni(cM(E,R)),T=nZr(Vf(E,R+1))),gM(T,X7e,v||o,W1,Nn),!Xt(_)){var x=Hse();if(Nn(T[aMt])){var P=El(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),gM(T,aMt,ZJr(N,x?HJr:GJr)||ZJr(N,x?HJr:GJr)||So,W1)}}x||gM(T,"max-age",So+_,null,Nn)}var L=Lbe();return L&&L.protocol==="https:"&&(gM(T,"secure",null,null,Nn),cMt===null&&(cMt=!R_o((Vu()||{})[Cbe])),cMt&&gM(T,"SameSite","None",null,Nn)),gM(T,eQe,b||n,null,Nn),XJr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[dn]-1;_>=0;_--)f[_].n===E&&f[sx](_,1)}a(g,"_removePendingCookie");function A(){lMt(e)&&f&&(Ct(f,function(E){KJr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=Oh(t||YJr,null,e).cfg,s=dx(t,function(E){E.setDf(E.cfg,x_o),r=E.ref(E.cfg,"cookieCfg"),n=r[eQe]||"/",o=r[X7e],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=JJr(t,r)!==!1,l=r.getCookie||w_o,u=r.setCookie||eZr,d=r.delCookie||eZr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=JJr(t,r)!==!1&&c&&lMt(e),_=YJr[VJr];return E&&_&&y!==_&&(E=gQe(_)),E},"isEnabled"),setEnabled:a(function(E){r[VU]=E,Nn(t[Vbe])||(t[Vbe]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=KJr(r,E);if(!R){var x=m(_,v,b,T);gQe(y)?(u(E,x),w=!0):f&&(g(E),f[Fi]({n:E,o:0,v:x}),w=!0)}return w},"set"),get:a(function(E){var _=So,v=tZr(r,E);if(!v){if(gQe(y))_=l(E);else if(f)for(var b=f[dn]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=lu(w,";");_=R!==-1?Ni(cM(w,R)):Ni(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return gQe(y)?v=y.purge(E,_):f&&(g(E),f[Fi]({n:E,o:1,v:h(_)}),v=!0),v},"del"),purge:a(function(E,_){var v=!1;return lMt(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[VJr]=y,y}a(rZr,"createCookieMgr");function lMt(t){if(mQe===null){mQe=!1,!yM&&dMt();try{var e=yM.v||{};mQe=e[uMt]!==void 0}catch(r){Wr(t,2,68,"Cannot access document.cookie - "+Qp(r),{exception:dr(r)})}}return mQe}a(lMt,"areCookiesSupported");function nZr(t){var e={};if(t&&t[dn]){var r=Ni(t)[cx](";");Ct(r,function(n){if(n=Ni(n||So),n){var o=lu(n,"=");o===-1?e[n]=null:e[Ni(cM(n,o))]=Ni(Vf(n,o+1))}})}return e}a(nZr,"_extractParts");function ZJr(t,e){return Or(t[e])?t[e]():null}a(ZJr,"_formatDate");function XJr(t,e){var r=t||So;return Yr(e,function(n,o){r+="; "+n+(Xt(o)?So:"="+o)}),r}a(XJr,"_formatCookieValue");function w_o(t){var e=So;if(!yM&&dMt(),yM.v){var r=yM.v[uMt]||So;WJr!==r&&(zJr=nZr(r),WJr=r),e=Ni(zJr[t]||So)}return e}a(w_o,"_getCookieValue");function eZr(t,e){!yM&&dMt(),yM.v&&(yM.v[uMt]=t+"="+e)}a(eZr,"_setCookieValue");function R_o(t){return Ei(t)?!!(Km(t,"CPU iPhone OS 12")||Km(t,"iPad; CPU OS 12")||Km(t,"Macintosh; Intel Mac OS X 10_14")&&Km(t,"Version/")&&Km(t,"Safari")||Km(t,"Macintosh; Intel Mac OS X 10_14")&&PB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||Km(t,"Chrome/5")||Km(t,"Chrome/6")||Km(t,"UnrealEngine")&&!Km(t,"Chrome")||Km(t,"UCBrowser/12")||Km(t,"UCBrowser/11")):!1}a(R_o,"uaDisallowsSameSiteNone");p();var k_o={perfEvtsSendAll:!1};function P_o(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){$f(r.fn,[r.arg])})}a(P_o,"_runScheduledListeners");function r7(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[Fi]({fn:n,arg:o}),r.h=r.h||Up(P_o,0,r)):$f(n,[o]))})}a(r7,"_runListeners");var iZr=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=Oh(e,k_o);n=c[uM](function(l){r=!!l.cfg.perfEvtsSendAll}),Si(t,this,function(l){ji(l,"listeners",{g:a(function(){return o},"g")}),l[Nse]=function(u){o[Fi](u)},l[Dse]=function(u){for(var d=Vo(o,u);d>-1;)o[sx](d,1),d=Vo(o,u)},l[Fse]=function(u){r7(o,Fse,s,function(d){d[Fse](u)})},l[KU]=function(u,d,f){r7(o,KU,s,function(h){h[KU](u,d,f)})},l[Use]=function(u,d){r7(o,Use,d?s:null,function(f){f[Use](u,d)})},l[mM]=function(u){u&&(r||!u[Tbe]())&&r7(o,mM,null,function(d){u.isAsync?Up(function(){return d[mM](u)},0):d[mM](u)})},l[K7e]=function(u){u&&u[dn]&&r7(o,K7e,s,function(d){d[K7e](u)})},l[J7e]=function(u){u&&u[X1]&&r7(o,J7e,s,function(d){d[J7e](u)})},l[Z7e]=function(u,d){if(u>0){var f=d||0;r7(o,Z7e,s,function(h){h[Z7e](u,f)})}},l[ax]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[dM](),s.h=null,s.cb=[]},"_finishUnload"),f;if(r7(o,"unload",null,function(h){var m=h[ax](u);m&&(f||(f=[]),f[Fi](m))}),f)return Dd(function(h){return _l(z7e(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var zse="ctx",pMt="ParentContextKey",Wbe="ChildrenContextKey",D_o=null,AQe=(function(){function t(e,r,n){var o=this;if(o.start=El(),o[K1]=e,o.isAsync=n,o[Tbe]=function(){return!1},Or(r)){var s;ji(o,"payload",{g:a(function(){return!s&&Or(r)&&(s=r(),r=null),s},"g")})}o[ez]=function(c){return c?c===t[pMt]||c===t[Wbe]?o[c]:(o[zse]||{})[c]:null},o[Xk]=function(c,l){if(c)if(c===t[pMt])o[c]||(o[Tbe]=function(){return!0}),o[c]=l;else if(c===t[Wbe])o[c]=l;else{var u=o[zse]=o[zse]||{};u[c]=l}},o.complete=function(){var c=0,l=o[ez](t[Wbe]);if(ur(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(E){Wr(r[Wu],2,73,"Unexpected Exception during onComplete - "+dr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[BB];!_&&A&&(_={}),E[BB]=_,_=e.ref(E,BB),_&&(y=_[g],!y&&A&&(y={}),_[g]=y,y=e.ref(_,g))}return y}a(d,"_getExtCfg");function f(g,A){var y=d(g,!0);return A&&Yr(A,function(E,_){if(Xt(y[E])){var v=e.cfg[E];(v||!Xt(v))&&(y[E]=v)}Qbe(e,y,E,_)}),e.setDf(y,A)}a(f,"_resolveExtCfg");function h(g,A,y){y===void 0&&(y=!1);var E,_=d(g,!1),v=e.cfg;return _&&(_[A]||!Xt(_[A]))?E=_[A]:(v[A]||!Xt(v[A]))&&(E=v[A]),E||!Xt(E)?E:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[$U]();y&&g(y)}}return a(m,"_iterateChain"),c}a(AMt,"_createInternalContext");function eP(t,e,r,n){var o=Oh(e),s=AMt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[gC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),ur(d)&&(d=n7(d,o.cfg,r,f)),eP(d||c[Z1](),o.cfg,r,f)}return a(u,"_createNew"),c[Ym]=l,c[pM]=u,c}a(eP,"createProcessTelemetryContext");function Yse(t,e,r){var n=Oh(e.config),o=AMt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[ax](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=n7(u,n.cfg,e,d)),Yse(u||s[Z1](),e,d)}return a(l,"_createNew"),s[Ym]=c,s[pM]=l,s}a(Yse,"createProcessTelemetryUnloadContext");function zbe(t,e,r){var n=Oh(e.config),o=AMt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Or(d[XW])&&d[XW](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=n7(u,n.cfg,e,d)),zbe(u||s[Z1](),e,d)}return a(l,"_createNew"),s[Ym]=c,s[pM]=l,s}a(zbe,"createProcessTelemetryUpdateContext");function n7(t,e,r,n){var o=null,s=!n;if(ur(t)&&t[dn]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Or(l[gC])){var u=F_o(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?n7([n],e,r):o}a(n7,"createTelemetryProxyChain");function F_o(t,e,r){var n=null,o=Or(t[gC]),s=Or(t[zU]),c;t?c=t[fM]+"-"+t[sz]+"-"+dZr++:c="Unknown-0-"+dZr++;var l={getPlugin:a(function(){return t},"getPlugin"),getNext:a(function(){return n},"getNext"),processTelemetry:f,unload:h,update:m,_id:c,_setNext:a(function(g){n=g},"_setNext")};function u(){var g;return t&&Or(t[uZr])&&(g=t[uZr]()),g||(g=eP(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[fM]:L_o,T=g[lZr];return T||(T=g[lZr]={}),g.setNext(n),t&&yQe(g[Wf](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:So;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&Wr(g[mC](),1,73,"Plugin ["+b+"] failed during "+y+" - "+dr(x)+", run flags: "+dr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=QB(t);return _[J1]||_[Dbe]?!1:(s&&t[zU](n),t[gC](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[Ym](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=QB(t),v=t[Wf]||_[Wf];t&&(!v||v===g.core())&&!_[J1]&&(_[Wf]=null,_[J1]=!0,_[hC]=!1,t[J1]&&t[J1](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[Ym](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=QB(t),v=t[Wf]||_[Wf];t&&(!v||v===g.core())&&!_[J1]&&t[XW]&&t[XW](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[Ym](A)}return a(m,"_updatePlugin"),Nh(l)}a(F_o,"createTelemetryPluginProxy");var U_o=(function(){function t(e,r,n,o){var s=this,c=eP(e,r,n,o);cz(s,c,$u(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function _Qe(){var t=[];function e(n){n&&t[Fi](n)}a(e,"_addHandler");function r(n,o){Ct(t,function(s){try{s(n,o)}catch(c){Wr(n[mC](),2,73,"Unexpected error calling unload handler - "+dr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(_Qe,"createUnloadHandlerContainer");p();var vQe,CQe;function bQe(){var t=[];function e(n){var o=t;t=[],Ct(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Wr(n,2,73,"Unloading:"+dr(c))}}),vQe&&o[dn]>vQe&&(CQe?CQe("doUnload",o):Wr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Mh(t,n),vQe&&t[dn]>vQe&&(CQe?CQe("Add",t):Wr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected.")))}return a(r,"_addHook"),{run:e,add:r}}a(bQe,"createUnloadHookContainer");var yMt,i7="getPlugin",Q_o=(yMt={},yMt[BB]={isVal:JU,v:{}},yMt),Ybe=(function(){function t(){var e=this,r,n,o,s,c;d(),Si(t,e,function(f){f[NB]=function(h,m,g,A){u(h,m,A),r=!0},f[J1]=function(h,m){var g=f[Wf];if(!g||h&&g!==h[Wf]())return;var A,y=!1,E=h||Yse(null,g,o&&o[i7]?o[i7]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[mC]()),A===!0&&E[Ym](_),d())}return a(v,"_unloadCallback"),!f[WU]||f[WU](E,_,v)!==!0?v():A=!0,A},f[XW]=function(h,m){var g=f[Wf];if(!g||h&&g!==h[Wf]())return;var A,y=!1,E=h||zbe(null,g,o&&o[i7]?o[i7]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[Z1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},az(f,"_addUnloadCb",function(){return s},"add"),az(f,"_addHook",function(){return c},"add"),ji(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[mC]=function(f){return l(f)[mC]()},e[hC]=function(){return r},e.setInitialized=function(f){r=f},e[zU]=function(f){o=f},e[Ym]=function(f,h){h?h[Ym](f):o&&Or(o[gC])&&o[gC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||eP(null,{},e[Wf]);o&&o[i7]?h=m[pM](null,o[i7]):h=m[pM](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){Oh(f,Q_o,dz(h)),!m&&h&&(m=h[P7e]()[Z1]());var g=o;o&&o[i7]&&(g=o[i7]()),e[Wf]=h,n=eP(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[Wf]=null,n=null,o=null,c=bQe(),s=_Qe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function q_o(t,e,r){var n={id:e,fn:r};Mh(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[sx](c,1),-1})},"remove")};return o}a(q_o,"_addInitializer");function j_o(t,e,r){for(var n=!1,o=t[dn],s=0;s"},"v")})}a(Z_o,"_createUnloadHook");var vMt=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,q,M,O,j,Q;Si(t,this,function(U){re(),U._getDbgPlgTargets=function(){return[x,o]},U[hC]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[NB]=function(ne,ce,Ne,we){g&&Zc(pZr),U[hC]()&&Zc("Core cannot be initialized more than once"),e=Oh(ne,EMt,Ne||U[Wu],!1),ne=e.cfg,qe(e[uM](function(st){var _t=st.cfg;B=_t.initInMemoMaxSize||$_o,Y(_t);var Dt=st.ref(st.cfg,BB);Yr(Dt,function($t){st.ref(Dt,$t)})})),s=we,b=J_o(e,v,s&&U[_be](),b),K(),U[Wu]=Ne;var Be=ne[oz];if(f=[],f[Fi].apply(f,rz(rz([],ce,!1),Be,!1)),h=ne[iz],Le(null),(!m||m[dn]===0)&&Zc("No "+iz+" available"),h&&h[dn]>1){var rt=U[$U]("TeeChannelController");(!rt||!rt.plugin)&&Wr(n,1,28,"TeeChannel required")}K_o(ne,R,n),R=null,r=!0,N===Yk.ACTIVE&&z()},U.getChannels=function(){var ne=[];return m&&Ct(m,function(ce){ne[Fi](ce)}),Nh(ne)},U.track=function(ne){yQe(U[Qse](),function(){return"AppInsightsCore:track"},function(){ne===null&&(ue(ne),Zc("Invalid telemetry item")),!ne[K1]&&Xt(ne[K1])&&(ue(ne),Zc("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||ZU(new Date),ne.ver=ne.ver||"4.0",!g&&U[hC]()&&N===Yk.ACTIVE?le()[Ym](ne):N!==Yk.INACTIVE&&o[dn]<=B&&o[Fi](ne)},function(){return{item:ne}},!ne.sync)},U[P7e]=le,U[_be]=function(){return s||(s=new iZr(e.cfg),U[H_o]=s),s},U[Nse]=function(ne){U.getNotifyMgr()[Nse](ne)},U[Dse]=function(ne){s&&s[Dse](ne)},U.getCookieMgr=function(){return u||(u=rZr(e.cfg,U[Wu])),u},U.setCookieMgr=function(ne){u!==ne&&(FB(u,!1),u=ne)},U[Qse]=function(){return c||l||sZr()},U.setPerfMgr=function(ne){c=ne},U.eventCnt=function(){return o[dn]},U.releaseQueue=function(){if(r&&o[dn]>0){var ne=o;o=[],N===2?Ct(ne,function(ce){ce.iKey=ce.iKey||w,le()[Ym](ce)}):Wr(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ne){return y=ne||null,Q=!1,O&&O[dM](),ie(!0)};function Y(ne){var ce=ne.instrumentationKey,Ne=ne.endpointUrl;if(N!==3){if(Xt(ce)){w=null,N=Yk.INACTIVE;var we="Please provide instrumentation key";r?(Wr(n,1,100,we),z()):Zc(we);return}var Be=[];tg(ce)?(Be[Fi](ce),w=null):w=ce,tg(Ne)?(Be[Fi](Ne),L=null):L=Ne,Be[dn]?W(ne,Be):V()}}a(Y,"_handleIKeyEndpointPromises");function W(ne,ce){q=!1,N=3;var Ne=JU(ne.initTimeOut)?ne.initTimeOut:V_o,we=W7e(ce);M&&M[dM](),M=Up(function(){M=null,q||V()},Ne),_l(we,function(Be){try{if(q)return;if(!Be.rejected){var rt=Be[MB];if(rt&&rt[dn]){var st=rt[0];if(w=st&&st[MB],rt[dn]>1){var _t=rt[1];L=_t&&_t[MB]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=L)}V()}catch{q||V()}})}a(W,"_waitForInitPromises");function V(){q=!0,Xt(w)?(N=Yk.INACTIVE,Wr(n,1,112,"ikey can't be resolved from promises")):N=Yk.ACTIVE,z()}a(V,"_setStatus");function z(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(z,"_releaseQueues");function ie(ne){if((!O||!O[VU])&&!Q){var ce=ne||n&&n.queue[dn]>0;ce&&(j||(j=!0,qe(e[uM](function(Ne){var we=Ne.cfg.diagnosticLogInterval;(!we||!(we>0))&&(we=1e4);var Be=!1;O&&(Be=O[VU],O[dM]()),O=k7e(X,we),O.unref(),O[VU]=Be}))),O[VU]=!0)}return O}a(ie,"_startLogPoller"),U[fNt]=function(){Q=!0,O&&O[dM](),X()},cz(U,function(){return A},["addTelemetryInitializer"]),U[ax]=function(ne,ce,Ne){ne===void 0&&(ne=!0),r||Zc(G_o),g&&Zc(pZr);var we={reason:50,isAsync:ne,flushComplete:!1},Be;ne&&!ce&&(Be=Dd(function(_t){ce=_t}));var rt=Yse(Ue(),U);rt[vbe](function(){v.run(U[Wu]),fQe([u,s,n],ne,function(){re(),ce&&ce(we)})},U);function st(_t){we.flushComplete=_t,g=!0,_.run(rt,we),U[fNt](),rt[Ym](we)}return a(st,"_doUnload"),X(),ee(ne,st,6,Ne)||st(!1),Be},U[$U]=ge,U.addPlugin=function(ne,ce,Ne,we){if(!ne){we&&we(!1),Z(gZr);return}var Be=ge(ne[fM]);if(Be&&!ce){we&&we(!1),Z("Plugin ["+ne[fM]+"] is already loaded!");return}var rt={reason:16};function st($t){f[Fi](ne),rt.added=[ne],Le(rt),we&&we(!0)}if(a(st,"_addPlugin"),Be){var _t=[Be.plugin],Dt={reason:2,isAsync:!!Ne};ke(_t,Dt,function($t){$t?(rt.removed=_t,rt.reason|=32,st(!0)):we&&we(!1)})}else st(!1)},U.updateCfg=function(ne,ce){ce===void 0&&(ce=!0);var Ne;if(U[hC]()){Ne={reason:1,cfg:e.cfg,oldCfg:Rse({},e.cfg),newConfig:Rse({},ne),merge:ce},ne=Ne.newConfig;var we=e.cfg;ne[oz]=we[oz],ne[iz]=we[iz]}e._block(function(Be){var rt=Be.cfg;_Mt(Be,rt,ne,ce),ce||Yr(rt,function(st){yA(ne,st)||Be.set(rt,st,rS)}),Be.setDf(rt,EMt)},!0),e.notify(),Ne&&he(Ne)},U.evtNamespace=function(){return E},U.flush=ee,U.getTraceCtx=function(ne){return T||(T=cZr()),T},U.setTraceCtx=function(ne){T=ne||null},U.addUnloadHook=qe,az(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ne){var ce;return r?ce=dx(e.cfg,ne,U[Wu]):ce=Y_o(R,ne),Z_o(ce)},U.getWParam=function(){return RB()||e.cfg.enableWParam?0:-1};function H(){var ne={};P=[];var ce=a(function(Ne){Ne&&Ct(Ne,function(we){if(we[fM]&&we[D7e]&&!ne[we.identifier]){var Be=we[fM]+"="+we[D7e];P[Fi](Be),ne[we.identifier]=we}})},"_addPluginVersions");ce(m),h&&Ct(h,function(Ne){ce(Ne)}),ce(f)}a(H,"_setPluginVersions");function re(){r=!1,e=Oh({},EMt,U[Wu]),e.cfg[N7e]=1,ji(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(ce){U.updateCfg(ce,!1)},"s")}),ji(U,"pluginVersionStringArr",{g:a(function(){return P||H(),P},"g")}),ji(U,"pluginVersionString",{g:a(function(){return D||(P||H(),D=P.join(";")),D||So},"g")}),ji(U,"logger",{g:a(function(){return n||(n=new Wse(e.cfg),e[Wu]=n),n},"g"),s:a(function(ce){e[Wu]=ce,n!==ce&&(FB(n,!1),n=ce)},"s")}),U[Wu]=new Wse(e.cfg),x=[];var ne=U.config[oz]||[];ne.splice(0,ne[dn]),Mh(ne,x),A=new fZr,o=[],FB(s,!1),s=null,c=null,l=null,FB(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=nS("AIBaseCore",!0),_=_Qe(),T=null,w=null,v=bQe(),R=[],D=null,P=null,Q=!1,O=null,j=!1,N=0,L=null,B=null,q=!1,M=null}a(re,"_initDefaults");function le(){var ne=eP(Ue(),e.cfg,U);return ne[vbe](ie),ne}a(le,"_createTelCtx");function Le(ne){var ce=z_o(U[Wu],FJr,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=EQe(Mh(m,ce[iz]));var Ne=Mh(EQe(ce[Wf]),m);x=Nh(Ne);var we=U.config[oz]||[];we.splice(0,we[dn]),Mh(we,x);var Be=le();m&&m[dn]>0&&gMt(Be[pM](m),Ne),gMt(Be,Ne),ne&&he(ne)}a(Le,"_initPluginChain");function ge(ne){var ce=null,Ne=null,we=[];return Ct(x,function(Be){if(Be[fM]===ne&&Be!==A)return Ne=Be,-1;Be.getChannel&&we[Fi](Be)}),!Ne&&we[dn]>0&&Ct(we,function(Be){if(Ne=Be.getChannel(ne),!Ne)return-1}),Ne&&(ce={plugin:Ne,setEnabled:a(function(Be){QB(Ne)[Dbe]=!Be},"setEnabled"),isEnabled:a(function(){var Be=QB(Ne);return!Be[J1]&&!Be[Dbe]},"isEnabled"),remove:a(function(Be,rt){Be===void 0&&(Be=!0);var st=[Ne],_t={reason:1,isAsync:Be};ke(st,_t,function(Dt){Dt&&Le({reason:32,removed:st}),rt&&rt(Dt)})},"remove")}),ce}a(ge,"_getPlugin");function Ue(){if(!d){var ne=(x||[]).slice();Vo(ne,A)===-1&&ne[Fi](A),d=n7(EQe(ne),e.cfg,U)}return d}a(Ue,"_getPluginChain");function ke(ne,ce,Ne){if(ne&&ne[dn]>0){var we=n7(ne,e.cfg,U),Be=Yse(we,U);Be[vbe](function(){var rt=!1,st=[];Ct(f,function(Dt,$t){hZr(Dt,ne)?rt=!0:st[Fi](Dt)}),f=st,D=null,P=null;var _t=[];h&&(Ct(h,function(Dt,$t){var Gt=[];Ct(Dt,function(Ie){hZr(Ie,ne)?rt=!0:Gt[Fi](Ie)}),_t[Fi](Gt)}),h=_t),Ne&&Ne(rt),ie()}),Be[Ym](ce)}else Ne(!1)}a(ke,"_removePlugins");function X(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[dn]=0,Ct(ne,function(ce){var Ne={name:y||"InternalMessageId: "+ce[Mse],iKey:w,time:ZU(new Date),baseType:$be.dataType,baseData:{message:ce[hM]}};U.track(Ne)})}}a(X,"_flushInternalLogs");function ee(ne,ce,Ne,we){var Be=1,rt=!1,st=null;we=we||5e3;function _t(){Be--,rt&&Be===0&&(st&&st[dM](),st=null,ce&&ce(rt),ce=null)}if(a(_t,"doCallback"),m&&m[dn]>0){var Dt=le()[pM](m);Dt.iterate(function($t){if($t.flush){Be++;var Gt=!1;$t.flush(ne,function(){Gt=!0,_t()},Ne)||Gt||(ne&&st==null?st=Up(function(){st=null,_t()},we):_t())}})}return rt=!0,_t(),!0}a(ee,"_flushChannels");function K(){var ne;qe(e[uM](function(ce){var Ne=ce.cfg.enablePerfMgr;if(Ne){var we=ce.cfg[Y7e];(ne!==we||!ne)&&(we||(we=W_o),FNt(ce.cfg,Y7e,we),ne=we,l=null),!c&&!l&&Or(we)&&(l=we(U,U[_be]()))}else l=null,ne=null}))}a(K,"_initPerfManager");function he(ne){var ce=zbe(Ue(),U);ce[vbe](ie),(!U._updateHook||U._updateHook(ce,ne)!==!0)&&ce[Ym](ne)}a(he,"_doUpdate");function Z(ne){var ce=U[Wu];ce?(Wr(ce,2,73,ne),ie()):Zc(ne)}a(Z,"_logOrThrowError");function ue(ne){var ce=U[_be]();ce&&ce[KU]([ne],2)}a(ue,"_notifyInvalidEvent");function qe(ne){v.add(ne)}a(qe,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();function Kbe(t,e){try{if(t&&t!==""){var r=I_().parse(t);if(r&&r[mNt]&&r[mNt]>=r.itemsAccepted&&r.itemsReceived-r.itemsAccepted===r.errors[dn])return r}}catch(n){Wr(e,1,43,"Cannot parse the response. "+(n[K1]||dr(n)),{response:t})}return null}a(Kbe,"parseResponse");p();var tP="",X_o="NoResponseBody",AZr="&"+X_o+"=true",CMt="POST",bMt=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;Si(t,this,function(E,_){var v=!0;q(),E[NB]=function(M,O){o=O,n&&Wr(o,1,28,"Sender is already initialized"),E.SetConfig(M),n=!0},E._getDbgPlgTargets=function(){return[n,s,l,r]},E.SetConfig=function(M){try{if(c=M.senderOnCompleteCallBack||{},l=!!M.disableCredentials,u=M.fetchCredentials,s=!!M.isOneDs,r=!!M.enableSendPromise,f=!!M.disableXhr,h=!!M.disableBeacon,m=!!M.disableBeaconSync,y=M.timeWrapper,A=!!M.addNoResponse,g=!!M.disableFetchKeepAlive,d={sendPOST:N},s||(v=!1),l){var O=Lbe();O&&O.protocol&&O.protocol[Kk]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[dn]?R(M,O):null},E.getFallbackInst=function(){return d},E[WU]=function(M,O){q()},E.preparePayload=function(M,O,j,Q){if(!O||Q||!j[X1]){M(j);return}try{var U=Di("CompressionStream");if(!Or(U)){M(j);return}var Y=new ReadableStream({start:a(function(re){re.enqueue(Ei(j[X1])?new TextEncoder().encode(j[X1]):j[X1]),re.close()},"start")}),W=Y.pipeThrough(new U("gzip")),V=W.getReader(),z=[],ie=0,H=!1;return _l(V.read(),a(function re(le){if(!H&&!le.rejected){var Le=le[MB];if(!Le.done)return z[Fi](Le[MB]),ie+=Le.value[dn],_l(V.read(),re);for(var ge=new Uint8Array(ie),Ue=0,ke=0,X=z;ke0&&(Ct($u(ge),function(K){H.append(K,ge[K])}),Ue[Ibe]=H),u?Ue.credentials=u:v&&s&&(Ue.credentials="include"),j&&(Ue.keepalive=!0,e+=re,s?M._sendReason===2&&(le=!0,A&&(U+=AZr)):le=!0);var ke=new Request(U,Ue);try{ke[tMt]=!0}catch{}if(!j&&r&&(V=Dd(function(K,he){z=K,ie=he})),!U){w(O),z&&z(!1);return}function X(K,he){he?x(O,s?0:he,{},s?tP:K):x(O,s?0:400,{},s?tP:K)}a(X,"_handleError");function ee(K,he,Z){var ue=K[Zk],qe=c.fetchOnComplete;qe&&Or(qe)?qe(K,O,Z||tP,he):x(O,ue,{},Z||tP)}a(ee,"_onFetchComplete");try{_l(fetch(s?U:ke,s?Ue:null),function(K){if(j&&(e-=re,re=0),!Le)if(Le=!0,K.rejected)X(K.reason&&K.reason[hM],499),ie&&ie(K.reason);else{var he=K[MB];try{!s&&!he.ok?(he[Zk]?X(he.statusText,he[Zk]):X(he.statusText,499),z&&z(!1)):s&&!he.body?(ee(he,null,tP),z&&z(!0)):_l(he.text(),function(Z){ee(he,M,Z[MB]),z&&z(!0)})}catch(Z){he&&he[Zk]?X(dr(Z),he[Zk]):X(dr(Z),499),ie&&ie(Z)}}})}catch(K){Le||(X(dr(K),499),ie&&ie(K))}return le&&!Le&&(Le=!0,x(O,200,{}),z&&z(!0)),s&&!Le&&M[tz]>0&&y&&y.set(function(){Le||(Le=!0,x(O,500,{}),z&&z(!0))},M[tz]),V}a(L,"_doFetchSender");function B(M,O,j){var Q=ff(),U=new XDomainRequest,Y=M[X1];U.onload=function(){var H=qse(U),re=c&&c.xdrOnComplete;re&&Or(re)?re(U,O,M):x(O,200,{},H)},U.onerror=function(){x(O,400,{},s?tP:Mbe(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var W=Q&&Q.location&&Q.location.protocol||"",V=M[Ose];if(!V){w(O);return}if(!s&&V.lastIndexOf(W,0)!==0){var z="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";Wr(o,2,40,". "+z),T(z,O);return}var ie=s?V:V[Jk](/^(https?:)/,"");U.open(CMt,ie),M[tz]&&(U[tz]=M[tz]),U.send(Y),s&&j?y&&y.set(function(){U.send(Y)},0):U.send(Y)}a(B,"_xdrSender");function q(){e=0,n=!1,r=!1,o=null,s=null,c=null,l=null,u=null,d=null,f=!1,h=!1,m=!1,g=!1,A=!1,y=null}a(q,"_initDefaults")})}return a(t,"SenderPostManager"),t.__ieDyn=1,t})();p();var SZr="on",yZr="attachEvent",EZr="addEventListener",_Zr="detachEvent",vZr="removeEventListener",SMt="events";var JNl=nS("aiEvtPageHide"),ZNl=nS("aiEvtPageShow"),evo=/\.[\.]+/g,tvo=/[\.]+$/,rvo=1,SQe=sQe("events"),nvo=/^([^.]*)(?:\.(.+)|)/;function CZr(t){return t&&t[Jk]?t[Jk](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,So):t}a(CZr,"_normalizeNamespace");function TMt(t,e){if(e){var r=So;ur(e)?(r=So,Ct(e,function(o){o=CZr(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=CZr(e),r&&(r[0]!=="."&&(r="."+r),t=(t||So)+r)}var n=nvo.exec(t||So)||[];return{type:n[1],ns:(n[2]||So).replace(evo,".").replace(tvo,So)[cx](".").sort().join(".")}}a(TMt,"_getEvtNamespace");function TZr(t,e,r){r===void 0&&(r=!0);var n=SQe.get(t,SMt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(TZr,"_getRegisteredEvents");function IZr(t,e,r,n){t&&e&&e[OB]&&(t[vZr]?t[vZr](e[OB],r,n):t[_Zr]&&t[_Zr](SZr+e[OB],r))}a(IZr,"_doDetach");function ivo(t,e,r,n){var o=!1;return t&&e&&e[OB]&&r&&(t[EZr]?(t[EZr](e[OB],r,n),o=!0):t[yZr]&&(t[yZr](SZr+e[OB],r),o=!0)),o}a(ivo,"_doAttach");function bZr(t,e,r,n){for(var o=e[dn];o--;){var s=e[o];s&&(!r.ns||r.ns===s[pNt].ns)&&(!n||n(s))&&(IZr(t,s[pNt],s.handler,s.capture),e[sx](o,1))}}a(bZr,"_doUnregister");function ovo(t,e,r){if(e[OB])bZr(t,TZr(t,e[OB]),e,r);else{var n=SQe.get(t,SMt,{});Yr(n,function(o,s){bZr(t,s,e,r)}),$u(n)[dn]===0&&SQe.kill(t,SMt)}}a(ovo,"_unregisterEvents");function Jbe(t,e){var r;return e?(ur(e)?r=[t].concat(e):r=[t,e],r=TMt("xx",r).ns[cx](".")):r=t,r}a(Jbe,"mergeEvtNamespace");function TQe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=TMt(e,n);if(s=ivo(t,c,r,o),s&&SQe.accept(t)){var l={guid:rvo++,evtName:c,handler:r,capture:o};TZr(t,c.type)[Fi](l)}}catch{}return s}a(TQe,"eventOn");function IMt(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=TMt(e,n),c=!1;ovo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||IZr(t,s,r,o)}catch{}}a(IMt,"eventOff");p();var Zbe="sampleRate",Xbe="ProcessLegacy",IQe="http.method",fz="https://dc.services.visualstudio.com",EM="/v2/track",zy="not_specified";p();var xQe=dNt({requestContextHeader:[0,"Request-Context"],requestContextTargetKey:[1,"appId"],requestContextAppIdFormat:[2,"appId=cid-v1:"],requestIdHeader:[3,"Request-Id"],traceParentHeader:[4,"traceparent"],traceStateHeader:[5,"tracestate"],sdkContextHeader:[6,"Sdk-Context"],sdkContextHeaderAppIdRequest:[7,"appId"],requestContextHeaderLowerCase:[8,"request-context"]});p();p();var pz="split",mo="length",hz="toLowerCase",s7="ingestionendpoint",a7="toString",xMt="removeItem",Kse="message",NZr="count";var e1e="stringify",t1e="pathname",mz="match";var Yy="name";var EA="properties",Ky="measurements",r1e="sizeInBytes",n1e="typeName",Jse="exceptions",gz="severityLevel",wQe="problemGroup",Az="parsedStack",i1e="hasFullStack",o1e="assembly",_M="fileName",yz="line",Zse="aiDataContract",Ez="duration";function wMt(t,e,r){var n=e[mo],o=MZr(t,e);if(o[mo]!==n){for(var s=0,c=o;r[c]!==void 0;)s++,c=Vf(o,0,147)+OZr(s);o=c}return o}a(wMt,"dataSanitizeKeyAndAddUniqueness");function MZr(t,e){var r;return e&&(e=Ni(Hu(e)),e[mo]>150&&(r=Vf(e,0,150),Wr(t,2,57,"name is too long. It has been truncated to 150 characters.",{name:e},!0))),r||e}a(MZr,"dataSanitizeKey");function uu(t,e,r){r===void 0&&(r=1024);var n;return e&&(r=r||1024,e=Ni(Hu(e)),e[mo]>r&&(n=Vf(e,0,r),Wr(t,2,61,"string value is too long. It has been truncated to "+r+" characters.",{value:e},!0))),n||e}a(uu,"dataSanitizeString");function _z(t,e,r){return Ei(e)&&(e=ZNt(e,r)),PMt(t,e,2048,66)}a(_z,"dataSanitizeUrl");function s1e(t,e){var r;return e&&e[mo]>32768&&(r=Vf(e,0,32768),Wr(t,2,56,"message is too long, it has been truncated to 32768 characters.",{message:e},!0)),r||e}a(s1e,"dataSanitizeMessage");function RMt(t,e){var r;if(e){var n=""+e;n[mo]>32768&&(r=Vf(n,0,32768),Wr(t,2,52,"exception is too long, it has been truncated to 32768 characters.",{exception:e},!0))}return r||e}a(RMt,"dataSanitizeException");function x_(t,e){if(e){var r={};Yr(e,function(n,o){if(Gu(o)&&XU())try{o=I_()[e1e](o)}catch(s){Wr(t,2,49,"custom property is not valid",{exception:s},!0)}o=uu(t,o,8192),n=wMt(t,n,r),r[n]=o}),e=r}return e}a(x_,"dataSanitizeProperties");function w_(t,e){if(e){var r={};Yr(e,function(n,o){n=wMt(t,n,r),r[n]=o}),e=r}return e}a(w_,"dataSanitizeMeasurements");function kMt(t,e){return e&&PMt(t,e,128,69)[a7]()}a(kMt,"dataSanitizeId");function PMt(t,e,r,n){var o;return e&&(e=Ni(Hu(e)),e[mo]>r&&(o=Vf(e,0,r),Wr(t,2,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),o||e}a(PMt,"dataSanitizeInput");function OZr(t){var e="00"+t;return T7e(e,e[mo]-3)}a(OZr,"dsPadNumber");p();var LZr=df()||{},BZr=0,avo=[null,null,null,null,null];function FZr(t){var e=BZr,r=avo,n=r[e];return LZr.createElement?r[e]||(n=r[e]=LZr.createElement("a")):n={host:cvo(t,!0)},n.href=t,e++,e>=r[mo]&&(e=0),BZr=e,n}a(FZr,"urlParseUrl");function cvo(t,e){var r=UZr(t,e)||"";if(r){var n=r[mz](/(www\d{0,5}\.)?([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[mo]>3&&Ei(n[2])&&n[2][mo]>0)return n[2]+(n[3]||"")}return r}a(cvo,"urlParseHost");function UZr(t,e){var r=null;if(t){var n=t[mz](/(\w{1,150}):\/\/([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[mo]>2&&Ei(n[2])&&n[2][mo]>0&&(r=n[2]||"",e&&n[mo]>2)){var o=(n[1]||"")[hz](),s=n[3]||"";(o==="http"&&s===":80"||o==="https"&&s===":443")&&(s=""),r+=s}}return r}a(UZr,"urlParseFullHost");var lvo=[fz+EM,"https://breeze.aimon.applicationinsights.io"+EM,"https://dc-int.services.visualstudio.com"+EM];function RQe(t){return Vo(lvo,t[hz]())!==-1}a(RQe,"isInternalApplicationInsightsEndpoint");function QZr(t,e,r,n){var o,s=n,c=n;if(e&&e[mo]>0){var l=FZr(e);if(o=l.host,!s)if(l[t1e]!=null){var u=l.pathname[mo]===0?"/":l[t1e];u.charAt(0)!=="/"&&(u="/"+u),c=l[t1e],s=uu(t,r?r+" "+u:u)}else s=uu(t,e)}else o=n,s=n;return{target:o,name:s,data:c}}a(QZr,"AjaxHelperParseDependencyPath");p();p();var kQe=Ebe({LocalStorage:0,SessionStorage:1});var Xse=void 0,qZr="";function jZr(t){try{if(Xt(Vy()))return null;var e=new Date()[a7](),r=Di(t===kQe.LocalStorage?"localStorage":"sessionStorage"),n=qZr+e;r.setItem(n,e);var o=r.getItem(n)!==e;if(r[xMt](n),!o)return r}catch{}return null}a(jZr,"_getVerifiedStorageObject");function DMt(){return PQe()?jZr(kQe.SessionStorage):null}a(DMt,"_getSessionStorageObject");function NMt(t){qZr=t||""}a(NMt,"utlSetStoragePrefix");function PQe(t){return(t||Xse===void 0)&&(Xse=!!jZr(kQe.SessionStorage)),Xse}a(PQe,"utlCanUseSessionStorage");function MMt(t,e){var r=DMt();if(r!==null)try{return r.getItem(e)}catch(n){Xse=!1,Wr(t,2,2,"Browser failed read of session storage. "+Qp(n),{exception:dr(n)})}return null}a(MMt,"utlGetSessionStorage");function OMt(t,e,r){var n=DMt();if(n!==null)try{return n.setItem(e,r),!0}catch(o){Xse=!1,Wr(t,2,4,"Browser failed write to session storage. "+Qp(o),{exception:dr(o)})}return!1}a(OMt,"utlSetSessionStorage");function LMt(t,e){var r=DMt();if(r!==null)try{return r[xMt](e),!0}catch(n){Xse=!1,Wr(t,2,6,"Browser failed removal of session storage item. "+Qp(n),{exception:dr(n)})}return!1}a(LMt,"utlRemoveSessionStorage");p();var uvo=";",dvo="=";function a1e(t){if(!t)return{};var e=t[pz](uvo),r=mbe(e,function(o,s){var c=s[pz](dvo);if(c[mo]===2){var l=c[0][hz](),u=c[1];o[l]=u}return o},{});if($u(r)[mo]>0){if(r.endpointsuffix){var n=r.location?r.location+".":"";r[s7]=r[s7]||"https://"+n+"dc."+r.endpointsuffix}r[s7]=r[s7]||fz,PB(r[s7],"/")&&(r[s7]=r[s7].slice(0,-1))}return r}a(a1e,"parseConnectionString");p();var BMt=(function(){function t(e,r,n){var o=this,s=this;s.ver=1,s.sampleRate=100,s.tags={},s[Yy]=uu(e,n)||zy,s.data=r,s.time=ZU(new Date),s[Zse]={time:1,iKey:1,name:1,sampleRate:a(function(){return o.sampleRate===100?4:1},"sampleRate"),tags:1,data:1}}return a(t,"Envelope"),t})();p();var qB=(function(){function t(e,r,n,o){this.aiDataContract={ver:1,name:1,properties:0,measurements:0};var s=this;s.ver=2,s[Yy]=uu(e,r)||zy,s[EA]=x_(e,n),s[Ky]=w_(e,o)}return a(t,"Event"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Event",t.dataType="EventData",t})();p();var fvo=58,pvo=/^\s{0,50}(from\s|at\s|Line\s{1,5}\d{1,10}\s{1,5}of|\w{1,50}@\w{1,80}|[^\(\s\n]+:[0-9\?]+(?::[0-9\?]+)?)/,hvo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+):([0-9\?]+)\)?$/,mvo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+)\)?$/,gvo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\)\]]+)\)?$/,Avo=/(?:^|\(|\s{0,10}[\w\)]+\@)?([^\(\n\s\]\)]+)(?:\:([0-9]+)(?:\:([0-9]+))?)?\)?(?:,|$)/,yvo=/([^\(\s\n]+):([0-9]+):([0-9]+)$/,Evo=/([^\(\s\n]+):([0-9]+)$/,HZr="",eae="error",px="stack",UMt="stackDetails",GZr="errorSrc",QMt="message",zZr="description",$Zr=[{re:hvo,len:5,m:1,fn:2,ln:3,col:4},{chk:vvo,pre:_vo,re:mvo,len:4,m:1,fn:2,ln:3},{re:gvo,len:3,m:1,fn:2,hdl:WZr},{re:Avo,len:2,fn:1,hdl:WZr}];function _vo(t){return t.replace(/(\(anonymous\))/,"")}a(_vo,"_scrubAnonymous");function vvo(t){return lu(t,"[native")<0}a(vvo,"_ignoreNative");function qMt(t,e){var r=t;return r&&!Ei(r)&&(JSON&&JSON[e1e]?(r=JSON[e1e](t),e&&(!r||r==="{}")&&(Or(t[a7])?r=t[a7]():r=""+t)):r=""+t+" - (Missing JSON.stringify)"),r||""}a(qMt,"_stringify");function YZr(t,e){var r=t;return t&&(r&&!Ei(r)&&(r=t[QMt]||t[zZr]||r),r&&!Ei(r)&&(r=qMt(r,!0)),t.filename&&(r=r+" @"+(t.filename||"")+":"+(t.lineno||"?")+":"+(t.colno||"?"))),e&&e!=="String"&&e!=="Object"&&e!=="Error"&&lu(r||"",e)===-1&&(r=e+": "+r),r||""}a(YZr,"_formatMessage");function Cvo(t){try{if(Gu(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}a(Cvo,"_isExceptionDetailsInternal");function bvo(t){try{if(Gu(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}a(bvo,"_isExceptionInternal");function VZr(t){return t&&t.src&&Ei(t.src)&&t.obj&&ur(t.obj)}a(VZr,"_isStackDetails");function vz(t){var e=t||"";Ei(e)||(Ei(e[px])?e=e[px]:e=""+e);var r=e[pz](` -`);return{src:e,obj:r}}a(vz,"_convertStackObj");function Svo(t){for(var e=[],r=t[pz](` -`),n=0;n0){e=[];var n=0,o=!1,s=0;Ct(r,function(y){if(o||kvo(y)){var E=Hu(y);o=!0;var _=Pvo(E,n);_&&(s+=_[r1e],e.push(_),n++)}});var c=32*1024;if(s>c)for(var l=0,u=e[mo]-1,d=0,f=l,h=u;lc){var A=h-f+1;e.splice(f,A);break}f=l,h=u,l++,u--}}return e}a(Ivo,"_parseStack");function DQe(t){var e="";if(t&&(e=t.typeName||t[Yy]||"",!e))try{var r=/function (.{1,200})\(/,n=r.exec(t.constructor[a7]());e=n&&n[mo]>1?n[1]:""}catch{}return e}a(DQe,"_getErrorType");function FMt(t){if(t)try{if(!Ei(t)){var e=DQe(t),r=qMt(t,!1);return(!r||r==="{}")&&(t[eae]&&(t=t[eae],e=DQe(t)),r=qMt(t,!0)),lu(r,e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}a(FMt,"_formatErrorCode");var Cz=(function(){function t(e,r,n,o,s,c){this.aiDataContract={ver:1,exceptions:1,severityLevel:0,properties:0,measurements:0};var l=this;l.ver=2,bvo(r)?(l[Jse]=r[Jse]||[],l[EA]=r[EA],l[Ky]=r[Ky],r[gz]&&(l[gz]=r[gz]),r.id&&(l.id=r.id,r[EA].id=r.id),r[wQe]&&(l[wQe]=r[wQe]),Xt(r.isManual)||(l.isManual=r.isManual)):(n||(n={}),c&&(n.id=c),l[Jse]=[JZr(e,r,n)],l[EA]=x_(e,n),l[Ky]=w_(e,o),s&&(l[gz]=s),c&&(l.id=c))}return a(t,"Exception"),t.CreateAutoException=function(e,r,n,o,s,c,l,u){var d=DQe(s||c||e);return{message:YZr(e,d),url:r,lineNumber:n,columnNumber:o,error:FMt(s||c||e),evt:FMt(c||e),typeName:d,stackDetails:KZr(l||s||c),errorSrc:u}},t.CreateFromInterface=function(e,r,n,o){var s=r[Jse]&&kB(r[Jse],function(l){return Rvo(e,l)}),c=new t(e,ux(ux({},r),{exceptions:s}),n,o);return c},t.prototype.toInterface=function(){var e=this,r=e.exceptions,n=e.properties,o=e.measurements,s=e.severityLevel,c=e.problemGroup,l=e.id,u=e.isManual,d=r instanceof Array&&kB(r,function(f){return f.toInterface()})||void 0;return{ver:"4.0",exceptions:d,severityLevel:s,properties:n,measurements:o,problemGroup:c,id:l,isManual:u}},t.CreateSimpleException=function(e,r,n,o,s,c){var l;return{exceptions:[(l={},l[i1e]=!0,l.message=e,l.stack=s,l.typeName=r,l)]}},t.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",t.dataType="ExceptionData",t.formatError=FMt,t})();var xvo=Nh({id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2});function wvo(){var t=this,e=ur(t[Az])&&kB(t[Az],function(n){return Nvo(n)}),r={id:t.id,outerId:t.outerId,typeName:t[n1e],message:t[Kse],hasFullStack:t[i1e],stack:t[px],parsedStack:e||void 0};return r}a(wvo,"_toInterface");function JZr(t,e,r){var n,o,s,c,l,u,d,f;if(Cvo(e))c=e[n1e],l=e[Kse],d=e[px],f=e[Az]||[],u=e[i1e];else{var h=e,m=h&&h.evt;xB(h)||(h=h[eae]||m||h),c=uu(t,DQe(h))||zy,l=s1e(t,YZr(e||h,c))||zy;var g=e[UMt]||KZr(e);f=Ivo(g),ur(f)&&kB(f,function(A){A[o1e]=uu(t,A[o1e]),A[_M]=uu(t,A[_M])}),d=RMt(t,Tvo(g)),u=ur(f)&&f[mo]>0,r&&(r[n1e]=r[n1e]||c)}return n={},n[Zse]=xvo,n.id=o,n.outerId=s,n.typeName=c,n.message=l,n[i1e]=u,n.stack=d,n.parsedStack=f,n.toInterface=wvo,n}a(JZr,"_createExceptionDetails");function Rvo(t,e){var r=ur(e[Az])&&kB(e[Az],function(o){return Dvo(o)})||e[Az],n=JZr(t,ux(ux({},e),{parsedStack:r}));return n}a(Rvo,"_createExDetailsFromInterface");function ZZr(t,e){var r=e[mz](yvo);if(r&&r[mo]>=4)t[_M]=r[1],t[yz]=parseInt(r[2]);else{var n=e[mz](Evo);n&&n[mo]>=3?(t[_M]=n[1],t[yz]=parseInt(n[2])):t[_M]=e}}a(ZZr,"_parseFilename");function WZr(t,e,r){var n=t[_M];e.fn&&r&&r[mo]>e.fn&&(e.ln&&r[mo]>e.ln?(n=Ni(r[e.fn]||""),t[yz]=parseInt(Ni(r[e.ln]||""))||0):n=Ni(r[e.fn]||"")),n&&ZZr(t,n)}a(WZr,"_handleFilename");function kvo(t){var e=!1;if(t&&Ei(t)){var r=Ni(t);r&&(e=pvo.test(r))}return e}a(kvo,"_isStackFrame");var XZr=Nh({level:1,method:1,assembly:0,fileName:0,line:0});function Pvo(t,e){var r,n;if(t&&Ei(t)&&Ni(t)){n=(r={},r[Zse]=XZr,r.level=e,r.assembly=Ni(t),r.method=HZr,r.fileName="",r.line=0,r.sizeInBytes=0,r);for(var o=0;o<$Zr[mo];){var s=$Zr[o];if(s.chk&&!s.chk(t))break;s.pre&&(t=s.pre(t));var c=t[mz](s.re);if(c&&c[mo]>=s.len){s.m&&(n.method=Ni(c[s.m]||HZr)),s.hdl?s.hdl(n,s,c):s.fn&&(s.ln?(n[_M]=Ni(c[s.fn]||""),n[yz]=parseInt(Ni(c[s.ln]||""))||0):ZZr(n,c[s.fn]||""));break}o++}}return eXr(n)}a(Pvo,"_extractStackFrame");function Dvo(t){var e,r=(e={},e[Zse]=XZr,e.level=t.level,e.method=t.method,e.assembly=t[o1e],e.fileName=t[_M],e.line=t[yz],e.sizeInBytes=0,e);return eXr(r)}a(Dvo,"_stackFrameFromInterface");function eXr(t){var e=fvo;return t&&(e+=t.method[mo],e+=t.assembly[mo],e+=t.fileName[mo],e+=t.level.toString()[mo],e+=t.line.toString()[mo],t[r1e]=e),t}a(eXr,"_populateFrameSizeInBytes");function Nvo(t){return{level:t.level,method:t.method,assembly:t[o1e],fileName:t[_M],line:t[yz]}}a(Nvo,"_parsedFrameToInterface");p();p();var tXr=(function(){function t(){this.aiDataContract={name:1,kind:0,value:1,count:0,min:0,max:0,stdDev:0},this.kind=0}return a(t,"DataPoint"),t})();var jB=(function(){function t(e,r,n,o,s,c,l,u,d){this.aiDataContract={ver:1,metrics:1,properties:0};var f=this;f.ver=2;var h=new tXr;h[NZr]=o>0?o:void 0,h.max=isNaN(c)||c===null?void 0:c,h.min=isNaN(s)||s===null?void 0:s,h[Yy]=uu(e,r)||zy,h.value=n,h.stdDev=isNaN(l)||l===null?void 0:l,f.metrics=[h],f[EA]=x_(e,u),f[Ky]=w_(e,d)}return a(t,"Metric"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",t.dataType="MetricData",t})();p();p();var c1e="";function NQe(t){(isNaN(t)||t<0)&&(t=0),t=tJr(t);var e=c1e+t%1e3,r=c1e+Y1(t/1e3)%60,n=c1e+Y1(t/(1e3*60))%60,o=c1e+Y1(t/(1e3*60*60))%24,s=Y1(t/(1e3*60*60*24));return e=e[mo]===1?"00"+e:e[mo]===2?"0"+e:e,r=r[mo]<2?"0"+r:r,n=n[mo]<2?"0"+n:n,o=o[mo]<2?"0"+o:o,(s>0?s+".":c1e)+o+":"+n+":"+r+"."+e}a(NQe,"msToTimeSpan");var bz=(function(){function t(e,r,n,o,s,c,l){this.aiDataContract={ver:1,name:0,url:0,duration:0,properties:0,measurements:0,id:0};var u=this;u.ver=2,u.id=kMt(e,l),u.url=_z(e,n),u[Yy]=uu(e,r)||zy,isNaN(o)||(u[Ez]=NQe(o)),u[EA]=x_(e,s),u[Ky]=w_(e,c)}return a(t,"PageView"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",t.dataType="PageviewData",t})();p();var Sz=(function(){function t(e,r,n,o,s,c,l,u,d,f,h,m){d===void 0&&(d="Ajax"),this.aiDataContract={id:1,ver:1,name:0,resultCode:0,duration:0,success:0,data:0,target:0,type:0,properties:0,measurements:0,kind:0,value:0,count:0,min:0,max:0,stdDev:0,dependencyKind:0,dependencySource:0,commandName:0,dependencyTypeName:0};var g=this;g.ver=2,g.id=r,g[Ez]=NQe(s),g.success=c,g.resultCode=l+"",g.type=uu(e,d);var A=QZr(e,n,u,o);g.data=_z(e,o)||A.data,g.target=uu(e,A.target),f&&(g.target="".concat(g.target," | ").concat(f)),g[Yy]=uu(e,A[Yy]),g[EA]=x_(e,h),g[Ky]=w_(e,m)}return a(t,"RemoteDependencyData"),t.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",t.dataType="RemoteDependencyData",t})();p();var Tz=(function(){function t(e,r,n,o,s){this.aiDataContract={ver:1,message:1,severityLevel:0,properties:0};var c=this;c.ver=2,r=r||zy,c[Kse]=s1e(e,r),c[EA]=x_(e,o),c[Ky]=w_(e,s),n&&(c[gz]=n)}return a(t,"Trace"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Message",t.dataType="MessageData",t})();p();var Iz=(function(){function t(e,r,n,o,s,c,l){this.aiDataContract={ver:1,name:0,url:0,duration:0,perfTotal:0,networkConnect:0,sentRequest:0,receivedResponse:0,domProcessing:0,properties:0,measurements:0};var u=this;u.ver=2,u.url=_z(e,n),u[Yy]=uu(e,r)||zy,u[EA]=x_(e,s),u[Ky]=w_(e,c),l&&(u.domProcessing=l.domProcessing,u[Ez]=l[Ez],u.networkConnect=l.networkConnect,u.perfTotal=l.perfTotal,u.receivedResponse=l.receivedResponse,u.sentRequest=l.sentRequest)}return a(t,"PageViewPerformance"),t.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",t.dataType="PageviewPerformanceData",t})();p();var HB=(function(){function t(e,r){this.aiDataContract={baseType:1,baseData:1},this.baseType=e,this.baseData=r}return a(t,"Data"),t})();p();function l7(t){var e="ai."+t+".";return function(r){return e+r}}a(l7,"_aiNameFunc");var l1e=l7("application"),Jm=l7("device"),MQe=l7("location"),tae=l7("operation"),jMt=l7("session"),c7=l7("user"),xz=l7("cloud"),u1e=l7("internal"),d1e=(function(t){Wy(e,t);function e(){return t.call(this)||this}return a(e,"ContextTagKeys"),e})(UNt({applicationVersion:l1e("ver"),applicationBuild:l1e("build"),applicationTypeId:l1e("typeId"),applicationId:l1e("applicationId"),applicationLayer:l1e("layer"),deviceId:Jm("id"),deviceIp:Jm("ip"),deviceLanguage:Jm("language"),deviceLocale:Jm("locale"),deviceModel:Jm("model"),deviceFriendlyName:Jm("friendlyName"),deviceNetwork:Jm("network"),deviceNetworkName:Jm("networkName"),deviceOEMName:Jm("oemName"),deviceOS:Jm("os"),deviceOSVersion:Jm("osVersion"),deviceRoleInstance:Jm("roleInstance"),deviceRoleName:Jm("roleName"),deviceScreenResolution:Jm("screenResolution"),deviceType:Jm("type"),deviceMachineName:Jm("machineName"),deviceVMName:Jm("vmName"),deviceBrowser:Jm("browser"),deviceBrowserVersion:Jm("browserVersion"),locationIp:MQe("ip"),locationCountry:MQe("country"),locationProvince:MQe("province"),locationCity:MQe("city"),operationId:tae("id"),operationName:tae("name"),operationParentId:tae("parentId"),operationRootId:tae("rootId"),operationSyntheticSource:tae("syntheticSource"),operationCorrelationVector:tae("correlationVector"),sessionId:jMt("id"),sessionIsFirst:jMt("isFirst"),sessionIsNew:jMt("isNew"),userAccountAcquisitionDate:c7("accountAcquisitionDate"),userAccountId:c7("accountId"),userAgent:c7("userAgent"),userId:c7("id"),userStoreRegion:c7("storeRegion"),userAuthUserId:c7("authUserId"),userAnonymousUserAcquisitionDate:c7("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:c7("authUserAcquisitionDate"),cloudName:xz("name"),cloudRole:xz("role"),cloudRoleVer:xz("roleVer"),cloudRoleInstance:xz("roleInstance"),cloudEnvironment:xz("environment"),cloudLocation:xz("location"),cloudDeploymentUnit:xz("deploymentUnit"),internalNodeName:u1e("nodeName"),internalSdkVersion:u1e("sdkVersion"),internalAgentVersion:u1e("agentVersion"),internalSnippet:u1e("snippet"),internalSdkSrc:u1e("sdkSrc")}));p();var Lh=new d1e;p();function rXr(t,e){IMt(t,null,null,e)}a(rXr,"_disableEvents");function HMt(t){var e=df(),r=Vu(),n=!1,o=[],s=1;r&&!Xt(r.onLine)&&!r.onLine&&(s=2);var c=0,l=m(),u=Jbe(nS("OfflineListener"),t);try{if(f(ff())&&(n=!0),e){var d=e.body||e;d.ononline&&f(d)&&(n=!0)}}catch{n=!1}function f(b){var T=!1;return b&&(T=TQe(b,"online",y,u),T&&TQe(b,"offline",E,u)),T}a(f,"_enableEvents");function h(){return l}a(h,"_isOnline");function m(){return!(c===2||s===2)}a(m,"calCurrentState");function g(){var b=m();l!==b&&(l=b,Ct(o,function(T){var w={isOnline:l,rState:s,uState:c};try{T(w)}catch{}}))}a(g,"listnerNoticeCheck");function A(b){c=b,g()}a(A,"setOnlineState");function y(){s=1,g()}a(y,"_setOnline");function E(){s=2,g()}a(E,"_setOffline");function _(){var b=ff();if(b&&n){if(rXr(b,u),e){var T=e.body||e;Nn(T.ononline)||rXr(T,u)}n=!1}}a(_,"_unload");function v(b){return o.push(b),{rm:a(function(){var T=o.indexOf(b);if(T>-1)return o.splice(T,1)},"rm")}}return a(v,"addListener"),{isOnline:h,isListening:a(function(){return n},"isListening"),unload:_,addListener:v,setOnlineState:A}}a(HMt,"createOfflineListener");var OQe="AppInsightsChannelPlugin";p();p();p();p();p();var u7="duration";p();var Bh="tags",LQe="deviceType",AC="data",vM="name",wz="traceID",Bo="length",d7="stringify",f7="measurements",hx="dataType",p7="envelopeType",GB="toString",$B="enqueue",VB="count",mx="push",f1e="emitLineDelimitedJson",h7="clear",rae="markAsSent",Rz="clearSent",p1e="bufferOverride",nae="BUFFER_KEY",WB="SENT_BUFFER_KEY",m7="concat",iae="MAX_BUFFER_SIZE",oae="triggerSend",_A="diagLog",BQe="initialize",sae="_sender",aae="endpointUrl",cae="instrumentationKey",FQe="customHeaders",GMt="maxBatchSizeInBytes",UQe="onunloadDisableBeacon",QQe="isBeaconApiDisabled",$Mt="alwaysUseXhrOverride",VMt="enableSessionStorageBuffer",rP="_buffer",WMt="onunloadDisableFetch",zMt="disableSendBeaconSplit",h1e="getSenderInst",g7="_onError",qQe="_onPartialSuccess",m1e="_onSuccess",jQe="itemsReceived",HQe="itemsAccepted",GQe="baseType",lae="sampleRate",nXr="getHashCodeScore";var YMt="baseType",Nd="baseData",ng="properties",iXr="true";function qp(t,e,r){return gM(t,e,r,W1)}a(qp,"_setValueIf");function Mvo(t,e,r){var n=r[Bh]=r[Bh]||{},o=e.ext=e.ext||{},s=e[Bh]=e[Bh]||[],c=o.user;c&&(qp(n,Lh.userAuthUserId,c.authId),qp(n,Lh.userId,c.id||c.localId));var l=o.app;l&&qp(n,Lh.sessionId,l.sesId);var u=o.device;u&&(qp(n,Lh.deviceId,u.id||u.localId),qp(n,Lh[LQe],u.deviceClass),qp(n,Lh.deviceIp,u.ip),qp(n,Lh.deviceModel,u.model),qp(n,Lh[LQe],u[LQe]));var d=e.ext.web;if(d){qp(n,Lh.deviceLanguage,d.browserLang),qp(n,Lh.deviceBrowserVersion,d.browserVer),qp(n,Lh.deviceBrowser,d.browser);var f=r[AC]=r[AC]||{},h=f[Nd]=f[Nd]||{},m=h[ng]=h[ng]||{};qp(m,"domain",d.domain),qp(m,"isManual",d.isManual?iXr:null),qp(m,"screenRes",d.screenRes),qp(m,"userConsent",d.userConsent?iXr:null)}var g=o.os;g&&(qp(n,Lh.deviceOS,g[vM]),qp(n,Lh.deviceOSVersion,g.osVer));var A=o.trace;A&&(qp(n,Lh.operationParentId,A.parentID),qp(n,Lh.operationName,uu(t,A[vM])),qp(n,Lh.operationId,A[wz]));for(var y={},E=s[Bo]-1;E>=0;E--){var _=s[E];Yr(_,function(b,T){y[b]=T}),s.splice(E,1)}Yr(s,function(b,T){y[b]=T});var v=ux(ux({},n),y);v[Lh.internalSdkVersion]||(v[Lh.internalSdkVersion]=uu(t,"javascript:".concat(Ovo.Version),64)),r[Bh]=rQe(v)}a(Mvo,"_extractPartAExtensions");function A7(t,e,r){Xt(t)||Yr(t,function(n,o){Dh(o)?r[n]=o:Ei(o)?e[n]=o:XU()&&(e[n]=I_()[d7](o))})}a(A7,"_extractPropsAndMeasurements");function kz(t,e){Xt(t)||Yr(t,function(r,n){t[r]=n||e})}a(kz,"_convertPropsUndefinedToCustomDefinedValue");function Pz(t,e,r,n){var o=new BMt(t,n,e);qp(o,"sampleRate",r[Zbe]),(r[Nd]||{}).startTime&&(o.time=ZU(r[Nd].startTime)),o.iKey=r.iKey;var s=r.iKey.replace(/-/g,"");return o[vM]=o[vM].replace("{0}",s),Mvo(t,r,o),r[Bh]=r[Bh]||[],rQe(o)}a(Pz,"_createEnvelope");function Dz(t,e){Xt(e[Nd])&&Wr(t,1,46,"telemetryItem.baseData cannot be null.")}a(Dz,"EnvelopeCreatorInit");var Ovo={Version:"3.3.11"};function oXr(t,e,r){Dz(t,e);var n=e[Nd][f7]||{},o=e[Nd][ng]||{};A7(e[AC],o,n),Xt(r)||kz(o,r);var s=e[Nd];if(Xt(s))return UB(t,"Invalid input for dependency data"),null;var c=s[ng]&&s[ng][IQe]?s[ng][IQe]:"GET",l=new Sz(t,s.id,s.target,s[vM],s[u7],s.success,s.responseCode,c,s.type,s.correlationContext,o,n),u=new HB(Sz[hx],l);return Pz(t,Sz[p7],e,u)}a(oXr,"DependencyEnvelopeCreator");function KMt(t,e,r){Dz(t,e);var n={},o={};e[YMt]!==qB[hx]&&(n.baseTypeSource=e[YMt]),e[YMt]===qB[hx]?(n=e[Nd][ng]||{},o=e[Nd][f7]||{}):e[Nd]&&A7(e[Nd],n,o),A7(e[AC],n,o),Xt(r)||kz(n,r);var s=e[Nd][vM],c=new qB(t,s,n,o),l=new HB(qB[hx],c);return Pz(t,qB[p7],e,l)}a(KMt,"EventEnvelopeCreator");function sXr(t,e,r){Dz(t,e);var n=e[Nd][f7]||{},o=e[Nd][ng]||{};A7(e[AC],o,n),Xt(r)||kz(o,r);var s=e[Nd],c=Cz.CreateFromInterface(t,s,o,n),l=new HB(Cz[hx],c);return Pz(t,Cz[p7],e,l)}a(sXr,"ExceptionEnvelopeCreator");function aXr(t,e,r){Dz(t,e);var n=e[Nd],o=n[ng]||{},s=n[f7]||{};A7(e[AC],o,s),Xt(r)||kz(o,r);var c=new jB(t,n[vM],n.average,n.sampleCount,n.min,n.max,n.stdDev,o,s),l=new HB(jB[hx],c);return Pz(t,jB[p7],e,l)}a(aXr,"MetricEnvelopeCreator");function cXr(t,e,r){Dz(t,e);var n,o=e[Nd];!Xt(o)&&!Xt(o[ng])&&!Xt(o[ng][u7])?(n=o[ng][u7],delete o[ng][u7]):!Xt(e[AC])&&!Xt(e[AC][u7])&&(n=e[AC][u7],delete e[AC][u7]);var s=e[Nd],c;((e.ext||{}).trace||{})[wz]&&(c=e.ext.trace[wz]);var l=s.id||c,u=s[vM],d=s.uri,f=s[ng]||{},h=s[f7]||{};if(Xt(s.refUri)||(f.refUri=s.refUri),Xt(s.pageType)||(f.pageType=s.pageType),Xt(s.isLoggedIn)||(f.isLoggedIn=s.isLoggedIn[GB]()),!Xt(s[ng])){var m=s[ng];Yr(m,function(y,E){f[y]=E})}A7(e[AC],f,h),Xt(r)||kz(f,r);var g=new bz(t,u,d,n,f,h,l),A=new HB(bz[hx],g);return Pz(t,bz[p7],e,A)}a(cXr,"PageViewEnvelopeCreator");function lXr(t,e,r){Dz(t,e);var n=e[Nd],o=n[vM],s=n.uri||n.url,c=n[ng]||{},l=n[f7]||{};A7(e[AC],c,l),Xt(r)||kz(c,r);var u=new Iz(t,o,s,void 0,c,l,n),d=new HB(Iz[hx],u);return Pz(t,Iz[p7],e,d)}a(lXr,"PageViewPerformanceEnvelopeCreator");function uXr(t,e,r){Dz(t,e);var n=e[Nd].message,o=e[Nd].severityLevel,s=e[Nd][ng]||{},c=e[Nd][f7]||{};A7(e[AC],s,c),Xt(r)||kz(s,r);var l=new Tz(t,n,o,s,c),u=new HB(Tz[hx],l);return Pz(t,Tz[p7],e,u)}a(uXr,"TraceEnvelopeCreator");p();var dXr=(function(){function t(e,r){var n=[],o=!1,s=r.maxRetryCnt;this._get=function(){return n},this._set=function(c){return n=c,n},Si(t,this,function(c){c[$B]=function(l){if(c[VB]()>=r.eventsLimitInMem){o||(Wr(e,2,105,"Maximum in-memory buffer size reached: "+c[VB](),!0),o=!0);return}l.cnt=l.cnt||0,!(!Xt(s)&&l.cnt>s)&&n[mx](l)},c[VB]=function(){return n[Bo]},c.size=function(){for(var l=n[Bo],u=0;u0){var u=[];Ct(l,function(f){u[mx](f.item)});var d=r[f1e]?u.join(` -`):"["+u.join(",")+"]";return d}return null},c.createNew=function(l,u,d){var f=n.slice(0);l=l||e,u=u||{};var h=d?new JMt(l,u):new $Qe(l,u);return Ct(f,function(m){h[$B](m)}),h}})}return a(t,"BaseSendBuffer"),t.__ieDyn=1,t})(),$Qe=(function(t){Wy(e,t);function e(r,n){var o=t.call(this,r,n)||this;return Si(e,o,function(s,c){s[rae]=function(l){c[h7]()},s[Rz]=function(l){}}),o}return a(e,"ArraySendBuffer"),e.__ieDyn=1,e})(dXr);var Lvo=["AI_buffer","AI_sentBuffer"],JMt=(function(t){Wy(e,t);function e(n,o){var s=t.call(this,n,o)||this,c=!1,l=o?.namePrefix,u=o[p1e]||{getItem:MMt,setItem:OMt},d=u.getItem,f=u.setItem,h=o.maxRetryCnt;return Si(e,s,function(m,g){var A=T(e[nae]),y=T(e[WB]),E=x(),_=y[m7](E),v=m._set(A[m7](_));v[Bo]>e[iae]&&(v[Bo]=e[iae]),R(e[WB],[]),R(e[nae],v),m[$B]=function(D){if(m[VB]()>=e[iae]){c||(Wr(n,2,67,"Maximum buffer size reached: "+m[VB](),!0),c=!0);return}D.cnt=D.cnt||0,!(!Xt(h)&&D.cnt>h)&&(g[$B](D),R(e[nae],m._get()))},m[h7]=function(){g[h7](),R(e[nae],m._get()),R(e[WB],[]),c=!1},m[rae]=function(D){R(e[nae],m._set(b(D,m._get())));var N=T(e[WB]);N instanceof Array&&D instanceof Array&&(N=N[m7](D),N[Bo]>e[iae]&&(Wr(n,1,67,"Sent buffer reached its maximum size: "+N[Bo],!0),N[Bo]=e[iae]),R(e[WB],N))},m[Rz]=function(D){var N=T(e[WB]);N=b(D,N),R(e[WB],N)},m.createNew=function(D,N,L){L=!!L;var B=m._get().slice(0),q=T(e[WB]).slice(0);D=D||n,N=N||{},m[h7]();var M=L?new e(D,N):new $Qe(D,N);return Ct(B,function(O){M[$B](O)}),L&&M[rae](q),M};function b(D,N){var L=[],B=[];return Ct(D,function(q){B[mx](q.item)}),Ct(N,function(q){!Or(q)&&Vo(B,q.item)===-1&&L[mx](q)}),L}a(b,"_removePayloadsFromBuffer");function T(D){var N=D;return N=l?l+"_"+N:N,w(N)}a(T,"_getBuffer");function w(D){try{var N=d(n,D);if(N){var L=I_().parse(N);if(Ei(L)&&(L=I_().parse(L)),L&&ur(L))return L}}catch(B){Wr(n,1,42," storage key: "+D+", "+Qp(B),{exception:dr(B)})}return[]}a(w,"_getBufferBase");function R(D,N){var L=D;try{L=l?l+"_"+L:L;var B=JSON[d7](N);f(n,L,B)}catch(q){f(n,L,JSON[d7]([])),Wr(n,2,41," storage key: "+L+", "+Qp(q)+". Buffer cleared",{exception:dr(q)})}}a(R,"_setBuffer");function x(){var D=[];try{return Ct(Lvo,function(N){var L=P(N);if(D=D[m7](L),l){var B=l+"_"+N,q=P(B);D=D[m7](q)}}),D}catch(N){Wr(n,2,41,"Transfer events from previous buffers: "+Qp(N)+". previous Buffer items can not be removed",{exception:dr(N)})}return[]}a(x,"_getPreviousEvents");function P(D){try{var N=w(D),L=[];return Ct(N,function(B){var q={item:B,cnt:0};L[mx](q)}),LMt(n,D),L}catch{}return[]}a(P,"_getItemsFromPreviousKey")}),s}a(e,"SessionStorageSendBuffer");var r;return r=e,e.VERSION="_1",e.BUFFER_KEY="AI_buffer"+r.VERSION,e.SENT_BUFFER_KEY="AI_sentBuffer"+r.VERSION,e.MAX_BUFFER_SIZE=2e3,e})(dXr);p();var fXr=(function(){function t(e){Si(t,this,function(r){r.serialize=function(c){var l=n(c,"root");try{return I_()[d7](l)}catch(u){Wr(e,1,48,u&&Or(u[GB])?u[GB]():"Error serializing object",null,!0)}};function n(c,l){var u="__aiCircularRefCheck",d={};if(!c)return Wr(e,1,48,"cannot serialize object because it is null or undefined",{name:l},!0),d;if(c[u])return Wr(e,2,50,"Circular reference detected while serializing object",{name:l},!0),d;if(!c.aiDataContract){if(l==="measurements")d=s(c,"number",l);else if(l==="properties")d=s(c,"string",l);else if(l==="tags")d=s(c,"string",l);else if(ur(c))d=o(c,l);else{Wr(e,2,49,"Attempting to serialize an object which does not implement ISerializable",{name:l},!0);try{I_()[d7](c),d=c}catch(f){Wr(e,1,48,f&&Or(f[GB])?f[GB]():"Error serializing object",null,!0)}}return d}return c[u]=!0,Yr(c.aiDataContract,function(f,h){var m=Or(h)?h()&1:h&1,g=Or(h)?h()&4:h&4,A=h&2,y=c[f]!==void 0,E=Gu(c[f])&&c[f]!==null;if(m&&!y&&!A)Wr(e,1,24,"Missing required field specification. The field is required but not present on source",{field:f,name:l});else if(!g){var _=void 0;E?A?_=o(c[f],f):_=n(c[f],f):_=c[f],_!==void 0&&(d[f]=_)}}),delete c[u],d}a(n,"_serializeObject");function o(c,l){var u;if(c)if(!ur(c))Wr(e,1,54,`This field was specified as an array in the contract but the item is not an array.\r -`,{name:l},!0);else{u=[];for(var d=0;d100||e<0)&&(n.throwInternal(2,58,"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.",{samplingRate:e},!0),e=100),this[lae]=e,this.samplingScoreGenerator=new hXr}return a(t,"Sample"),t.prototype.isSampledIn=function(e){var r=this[lae],n=!1;return r==null||r>=100||e.baseType===jB[hx]?!0:(n=this.samplingScoreGenerator.getSamplingScore(e)0&&t<=100}a(Qvo,"_chkSampling");var qvo=(zB={},zB[qB.dataType]=KMt,zB[Tz.dataType]=uXr,zB[bz.dataType]=cXr,zB[Iz.dataType]=lXr,zB[Cz.dataType]=sXr,zB[jB.dataType]=aXr,zB[Sz.dataType]=oXr,zB),ZMt=(function(t){Wy(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=OQe;var n,o,s,c,l,u,d,f,h=0,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,q,M,O,j,Q,U,Y,W,V,z,ie;return Si(e,r,function(H,re){Ge(),H.pause=function(){pe(),c=!0},H.resume=function(){c&&(c=!1,o=null,rt(),Qe())},H.flush=function(J,se,me){if(J===void 0&&(J=!0),!c){pe();try{var Ce=H[oae](J,null,me||1);return _l(Ce,function(He){return se?(se(!He.rejected),!0):J?Dd(function($e){$e(!He.rejected)}):Ce})}catch(He){Wr(H[_A](),1,22,"flush failed, telemetry will not be collected: "+Qp(He),{exception:dr(He)})}}},H.onunloadFlush=function(){if(!c)if(v||O)try{return H[oae](!0,Dt,2)}catch(J){Wr(H[_A](),1,20,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+Qp(J),{exception:dr(J)})}else H.flush(!1)},H.addHeader=function(J,se){f[J]=se},H[BQe]=function(J,se,me,Ce){H.isInitialized()&&Wr(H[_A](),1,28,"Sender is already initialized"),re[BQe](J,se,me,Ce);var He=H.identifier;u=new fXr(se.logger),n=0,o=null,s=0,H[sae]=null,d=0;var $e=H[_A]();A=Jbe(nS("Sender"),se.evtNamespace&&se.evtNamespace()),g=HMt(A),H._addHook(dx(J,function(et){var ct=et.cfg;ct.storagePrefix&&NMt(ct.storagePrefix);var bt=eP(null,ct,se),ht=bt.getExtCfg(He,yXr),We=ht[aae];if(y&&We===y){var ae=ct[aae];ae&&ae!==We&&(ht[aae]=ae)}var Re=Di("CompressionStream");ie=QNt("zipPayload",ct,!1),Or(Re)||(ie=!1);var Me=ht.corsPolicy;Me?(Me==="same-origin"||Me==="same-site"||Me==="cross-origin")&&r.addHeader(EXr,Me):delete f[EXr],tg(ht[cae])&&(ht[cae]=ct[cae]),ji(H,"_senderConfig",{g:a(function(){return ht},"g")}),E!==ht[aae]&&(y=E=ht[aae]),se.activeStatus()===Yk.PENDING?H.pause():se.activeStatus()===Yk.ACTIVE&&H.resume(),w&&w!==ht[FQe]&&Ct(w,function(_r){delete f[_r.header]}),_=ht[GMt],v=(ht[UQe]===!1||ht[QQe]===!1)&&e7(),b=ht[UQe]===!1&&e7(),T=ht[QQe]===!1&&e7(),O=ht[$Mt],j=!!ht.disableXhr,z=ht.retryCodes;var ye=ht[p1e],oe=!!ht[VMt]&&(!!ye||PQe()),ze=ht.namePrefix,at=oe!==L||oe&&q!==ze||oe&&B!==ye;if(H[rP]){if(at)try{H[rP]=H[rP].createNew($e,ht,oe)}catch(_r){Wr(H[_A](),1,12,"failed to transfer telemetry to different buffer storage, telemetry will be lost: "+Qp(_r),{exception:dr(_r)})}rt()}else H[rP]=oe?new JMt($e,ht):new $Qe($e,ht);q=ze,L=oe,B=ye,Q=!ht[WMt]&&Bbe(!0),W=!!ht[zMt],H._sample=new mXr(ht.samplingPercentage,$e),x=ht[cae],!tg(x)&&!Te(x,ct)&&Wr($e,1,100,"Invalid Instrumentation key "+x),w=ht[FQe],Ei(y)&&!RQe(y)&&w&&w[Bo]>0?Ct(w,function(_r){r.addHeader(_r.header,_r.value)}):w=null,M=ht.enableSendPromise;var Vt=Le();V?V.SetConfig(Vt):(V=new bMt,V[BQe](Vt,$e));var gr=ht.httpXHROverride,cr=null,Mr=null,Hr=iQe([3,1,2],ht.transports);cr=V&&V[h1e](Hr,!1);var Gr=V&&V.getFallbackInst();U=a(function(_r,$0){return Ne(Gr,_r,$0)},"_xhrSend"),Y=a(function(_r,$0){return Ne(Gr,_r,$0,!1)},"_fallbackSend"),cr=O?gr:cr||gr||Gr,H[sae]=function(_r,$0){return Ne(cr,_r,$0)},Q&&(m=Ie);var Yt=iQe([3,1],ht.unloadTransports);Q||(Yt=Yt.filter(function(_r){return _r!==2})),Mr=V&&V[h1e](Yt,!0),Mr=O?gr:Mr||gr,(O||ht.unloadTransports||!m)&&Mr&&(m=a(function(_r,$0){return Ne(Mr,_r,$0)},"_syncUnloadSender")),m||(m=U),R=ht.disableTelemetry,P=ht.convertUndefined||nP,D=ht.isRetryDisabled,N=ht.maxBatchInterval}))},H.processTelemetry=function(J,se){se=H._getTelCtx(se);var me=se[_A]();try{var Ce=K(J,me);if(!Ce)return;var He=he(J,me);if(!He)return;var $e=u.serialize(He),et=H[rP];rt($e);var ct={item:$e,cnt:0};et[$B](ct),Qe()}catch(bt){Wr(me,2,12,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+Qp(bt),{exception:dr(bt)})}H.processNext(J,se)},H.isCompletelyIdle=function(){return!c&&h===0&&H._buffer[VB]()===0},H.getOfflineListener=function(){return g},H._xhrReadyStateChange=function(J,se,me){if(!Gt(se))return ge(J,se,me)},H[oae]=function(J,se,me){J===void 0&&(J=!0);var Ce;if(!c)try{var He=H[rP];if(R)He[h7]();else{if(He[VB]()>0){var $e=He.getItems();te(me||0,J),se?Ce=se.call(H,$e,J):Ce=H[sae]($e,J)}s=+new Date}pe()}catch(ct){var et=KNt();(!et||et>9)&&Wr(H[_A](),1,40,"Telemetry transmission failed, some telemetry will be lost: "+Qp(ct),{exception:dr(ct)})}return Ce},H.getOfflineSupport=function(){return{getUrl:a(function(){return y},"getUrl"),createPayload:qe,serialize:Z,batch:ue,shouldProcess:a(function(J){return!!K(J)},"shouldProcess")}},H._doTeardown=function(J,se){H.onunloadFlush(),FB(g,!1),Ge()},H[g7]=function(J,se,me){if(!Gt(J))return Ue(J,se,me)},H[qQe]=function(J,se){if(!Gt(J))return ke(J,se)},H[m1e]=function(J,se){if(!Gt(J))return X(J,se)},H._xdrOnLoad=function(J,se){if(!Gt(se))return le(J,se)};function le(J,se){var me=AXr(J);if(J&&(me+""=="200"||me===""))n=0,H[m1e](se,0);else{var Ce=Kbe(me);Ce&&Ce[jQe]&&Ce[jQe]>Ce[HQe]&&!D?H[qQe](se,Ce):H[g7](se,Mbe(J))}}a(le,"_xdrOnLoad");function Le(){try{var J={xdrOnComplete:a(function(me,Ce,He){var $e=ee(He);if($e)return le(me,$e)},"xdrOnComplete"),fetchOnComplete:a(function(me,Ce,He,$e){var et=ee($e);if(et)return st(me.status,et,me.url,et[Bo],me.statusText,He||"")},"fetchOnComplete"),xhrOnComplete:a(function(me,Ce,He){var $e=ee(He);if($e)return ge(me,$e,$e[Bo])},"xhrOnComplete"),beaconOnRetry:a(function(me,Ce,He){return $t(me,Ce,He)},"beaconOnRetry")},se={enableSendPromise:M,isOneDs:!1,disableCredentials:!1,disableXhr:j,disableBeacon:!T,disableBeaconSync:!b,senderOnCompleteCallBack:J};return se}catch{}return null}a(Le,"_getSendPostMgrConfig");function ge(J,se,me){J.readyState===4&&st(J.status,se,J.responseURL,me,lz(J),AXr(J)||J.response)}a(ge,"_xhrReadyStateChange");function Ue(J,se,me){Wr(H[_A](),2,26,"Failed to send telemetry.",{message:se}),H._buffer&&H._buffer[Rz](J)}a(Ue,"_onError");function ke(J,se){for(var me=[],Ce=[],He=se.errors.reverse(),$e=0,et=He;$e0&&H[m1e](J,se[HQe]),me[Bo]>0&&H[g7](me,lz(null,["partial success",se[HQe],"of",se.itemsReceived].join(" "))),Ce[Bo]>0&&(F(Ce),Wr(H[_A](),2,40,"Partial success. Delivered: "+J[Bo]+", Failed: "+me[Bo]+". Will retry to send "+Ce[Bo]+" our of "+se[jQe]+" items"))}a(ke,"_onPartialSuccess");function X(J,se){H._buffer&&H._buffer[Rz](J)}a(X,"_onSuccess");function ee(J){try{if(J){var se=J,me=se.oriPayload;return me&&me[Bo]?me:null}}catch{}return null}a(ee,"_getPayloadArr");function K(J,se){if(R)return!1;if(!J)return se&&Wr(se,1,7,"Cannot send empty telemetry"),!1;if(J.baseData&&!J[GQe])return se&&Wr(se,1,70,"Cannot send telemetry without baseData and baseType"),!1;if(J[GQe]||(J[GQe]="EventData"),!H[sae])return se&&Wr(se,1,28,"Sender was not initialized"),!1;if(ne(J))J[Zbe]=H._sample[lae];else return se&&Wr(se,2,33,"Telemetry item was sampled out and not sent",{SampleRate:H._sample[lae]}),!1;return!0}a(K,"_validate");function he(J,se){var me=J.iKey||x,Ce=e.constructEnvelope(J,me,se,P);if(!Ce){Wr(se,1,47,"Unable to create an AppInsights envelope");return}var He=!1;if(J[Bh]&&J[Bh][Xbe]&&(Ct(J[Bh][Xbe],function($e){try{$e&&$e(Ce)===!1&&(He=!0,UB(se,"Telemetry processor check returns false"))}catch(et){Wr(se,1,64,"One of telemetry initializers failed, telemetry item will not be sent: "+Qp(et),{exception:dr(et)},!0)}}),delete J[Bh][Xbe]),!He)return Ce}a(he,"_getEnvelope");function Z(J){var se=gXr,me=H[_A]();try{var Ce=K(J,me),He=null;Ce&&(He=he(J,me)),He&&(se=u.serialize(He))}catch{}return se}a(Z,"_serialize");function ue(J){var se=gXr;return J&&J[Bo]&&(se="["+J.join(",")+"]"),se}a(ue,"_batch");function qe(J){var se=Be();return{urlString:y,data:J,headers:se}}a(qe,"_createPayload");function ne(J){return H._sample.isSampledIn(J)}a(ne,"_isSampledIn");function ce(J,se,me,Ce){se===200&&J?H._onSuccess(J,J[Bo]):Ce&&H[g7](J,Ce)}a(ce,"_getOnComplete");function Ne(J,se,me,Ce){Ce===void 0&&(Ce=!0);var He=a(function(ae,Re,Me){return ce(se,ae,Re,Me)},"onComplete"),$e=we(se),et=J&&J.sendPOST;if(et&&$e){Ce&&H._buffer[rae](se);var ct,bt=!1,ht,We;return V.preparePayload(function(ae){ct=et(ae,He,!me),bt=!0,ht&&V7e(ct,ht,We)},ie,$e,!me),bt?ct:Dd(function(ae,Re){ht=ae,We=Re})}return null}a(Ne,"_doSend");function we(J){if(ur(J)&&J[Bo]>0){var se=H[rP].batchPayloads(J),me=Be(),Ce={data:se,urlString:y,headers:me,disableXhrSync:j,disableFetchKeepAlive:!Q,oriPayload:J};return Ce}return null}a(we,"_getPayload");function Be(){try{var J=f||{};return RQe(y)&&(J[xQe[6]]=xQe[7]),J}catch{}return null}a(Be,"_getHeaders");function rt(J){var se=J?J[Bo]:0;return H[rP].size()+se>_?((!g||g.isOnline())&&H[oae](!0,null,10),!0):!1}a(rt,"_checkMaxSize");function st(J,se,me,Ce,He,$e){var et=null;if(H._appId||(et=Kbe($e),et&&et.appId&&(H._appId=et.appId)),(J<200||J>=300)&&J!==0){if((J===301||J===307||J===308)&&!_t(me)){H[g7](se,He);return}if(g&&!g.isOnline()){if(!D){var ct=10;F(se,ct),Wr(H[_A](),2,40,". Offline - Response Code: ".concat(J,". Offline status: ").concat(!g.isOnline(),". Will retry to send ").concat(se.length," items."))}return}!D&&Se(J)?(F(se),Wr(H[_A](),2,40,". Response code "+J+". Will retry to send "+se[Bo]+" items.")):H[g7](se,He)}else _t(me),J===206?(et||(et=Kbe($e)),et&&!D?H[qQe](se,et):H[g7](se,He)):(n=0,H[m1e](se,Ce))}a(st,"_checkResponsStatus");function _t(J){return d>=10?!1:!Xt(J)&&J!==""&&J!==y?(y=J,++d,!0):!1}a(_t,"_checkAndUpdateEndPointUrl");function Dt(J,se){if(m)m(J,!1);else{var me=V&&V[h1e]([3],!0);return Ne(me,J,se)}}a(Dt,"_doUnloadSend");function $t(J,se,me){var Ce=J,He=Ce&&Ce.oriPayload;if(W)Y&&Y(He,!0),Wr(H[_A](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender.");else{for(var $e=[],et=0;et0&&(Y&&Y($e,!0),Wr(H[_A](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender."))}}a($t,"_onBeaconRetry");function Gt(J){try{if(J&&J[Bo])return Ei(J[0])}catch{}return null}a(Gt,"_isStringArr");function Ie(J,se){var me=null;if(ur(J)){for(var Ce=J[Bo],He=0;He-1}a(Se,"_isRetriable");function Fe(){var J="getNotifyMgr",se,me=H.core;return me&&(me[J]?se=me[J]():se=me._notificationManager),se}a(Fe,"_getNotifyMgr");function te(J,se){var me=Fe();if(me&&me.eventsSendRequest)try{me.eventsSendRequest(J,se)}catch(Ce){Wr(H[_A](),1,74,"send request notification failed: "+Qp(Ce),{exception:dr(Ce)})}}a(te,"_notifySendRequest");function Te(J,se){var me=se.disableInstrumentationKeyValidation,Ce=Xt(me)?!1:me;if(Ce)return!0;var He="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",$e=new RegExp(He);return $e.test(J)}a(Te,"_validateInstrumentationKey");function Ge(){H[sae]=null,H[rP]=null,H._appId=null,H._sample=null,f={},g=null,n=0,o=null,s=null,c=!1,l=null,u=null,d=0,h=0,m=null,A=null,y=null,E=null,_=0,v=!1,w=null,R=!1,x=null,P=nP,D=!1,L=null,q=nP,j=!1,Q=!1,W=!1,U=null,Y=null,V=null,ji(H,"_senderConfig",{g:a(function(){return nQe({},yXr)},"g")})}a(Ge,"_initDefaults")}),r}return a(e,"Sender"),e.constructEnvelope=function(r,n,o,s){var c;n!==r.iKey&&!Xt(n)?c=ux(ux({},r),{iKey:n}):c=r;var l=qvo[c.baseType]||KMt;return l(o,c,s)},e})(Ybe);p();var Nz="instrumentationKey",g1e="connectionString",uae="endpointUrl",dae="userOverrideEndpointUrl";var Mz,XMt,eOt=void 0,jvo=(Mz={diagnosticLogInterval:$se(Hvo,1e4)},Mz[g1e]=eOt,Mz.endpointUrl=eOt,Mz[Nz]=eOt,Mz.featureOptIn=(XMt={},XMt.zipPayload={mode:1},XMt),Mz.extensionConfig={},Mz);function Hvo(t){return t&&t>0}a(Hvo,"_chkDiagLevel");var _Xr=(function(){function t(e){var r=new vMt,n;(Xt(e)||Xt(e[Nz])&&Xt(e[g1e]))&&Zc("Invalid input configuration"),Si(t,this,function(s){ji(s,"config",{g:a(function(){return n},"g")}),c(),s.initialize=c,s.track=o,cz(s,r,["flush","pollInternalLogs","stopPollingInternalLogs","unload","getPlugin","addPlugin","evtNamespace","addUnloadCb","onCfgChange","getTraceCtx","updateCfg","addTelemetryInitializer"]);function c(){var l=Oh(e||{},jvo);n=l.cfg,r.addUnloadHook(dx(l,function(){var u=n[g1e];if(tg(u)){var d=Pbe(function(g,A){_l(u,function(y){var E=y.value,_=n[Nz];if(!y.rejected&&E){n[g1e]=E;var v=a1e(E);_=v.instrumentationkey||_}g(_)})}),f=Pbe(function(g,A){_l(u,function(y){var E=y.value,_=n[uae];if(!y.rejected&&E){var v=a1e(E),b=v.ingestionendpoint;_=b?b+EM:_}g(_)})});n[Nz]=d,n[uae]=n[dae]||f}if(Ei(u)){var h=a1e(u),m=h.ingestionendpoint;n[uae]=n[dae]?n[dae]:m+EM,n[Nz]=h.instrumentationkey||n[Nz]}n[uae]=n[dae]?n[dae]:n[uae]})),r.initialize(n,[new ZMt])}a(c,"_initialize")});function o(s){s&&(s.baseData=s.baseData||{},s.baseType=s.baseType||"EventData"),r.track(s)}a(o,"_track")}return a(t,"ApplicationInsights"),t.__ieDyn=1,t})();var iS=de(require("os"));var fae=class{constructor(e,r,n,o){this.ctx=e;this.namespace=r;this.onCopilotToken=a(e=>{this.commonProperties["common.isinternal"]=e?.isInternalUser()?"true":"false";let r=e.getTokenValue("tid");r!==void 0&&(this.tags["ai.user.id"]=r)},"onCopilotToken");this.xhrOverride={sendPOST:a((e,r)=>{if(typeof e.data!="string")throw new Error(`AppInsightsReporter only supports string payloads, received ${typeof e.data}`);let n=e.headers??{};n["Content-Type"]="application/json";let o={method:"POST",headers:n,body:e.data};this.ctx.get(tr).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Nr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")};this.client=new _Xr({instrumentationKey:n.instrumentationKey,disableAjaxTracking:!0,disableExceptionTracking:!0,disableFetchTracking:!0,disableCorrelationHeaders:!0,disableCookiesUsage:!0,autoTrackPageVisitTime:!1,emitLineDelimitedJson:!1,disableInstrumentationKeyValidation:!0,endpointUrl:n.endpointUrl,extensionConfig:{[OQe]:{alwaysUseXhrOverride:!0,httpXHROverride:this.xhrOverride}}}),this.tags=n?.excludeCommonTags?{}:Gvo(e),this.commonProperties=n?.excludeCommonProperties?{}:$vo(e),this.#e=bs(e,this.onCopilotToken),o&&this.onCopilotToken(o)}static{a(this,"AppInsightsReporter")}#e;sendTelemetryEvent(e,r,n){r={...r,...this.commonProperties};let o=this.qualifyEventName(e);this.client.track({name:o,tags:this.tags,data:{...r,...n},baseType:"EventData",baseData:{name:o,properties:r,measurements:n}})}sendTelemetryErrorEvent(e,r,n){this.sendTelemetryEvent(this.qualifyEventName(e),r,n)}async dispose(){this.#e.dispose(),await this.client.unload(!0,void 0,200)}qualifyEventName(e){return e.startsWith(this.namespace)?e:`${this.namespace}/${e}`}};function Gvo(t){let e={},r=t.get(Ua);e["ai.session.id"]=r.sessionId;let n=t.get(Op);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${iS.type()} ${iS.release()}`,e["ai.device.osArchitecture"]=iS.arch(),e["ai.device.osPlatform"]=iS.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(ds).getVersion(),e}a(Gvo,"getTags");function $vo(t){let e={};e.common_os=iS.platform(),e.common_platformversion=iS.release(),e.common_arch=iS.arch(),e.common_cpu=Array.from(new Set(iS.cpus().map(n=>n.model))).join();let r=t.get(Ua);return e.common_vscodemachineid=r.machineId,e.common_vscodesessionid=r.sessionId,e.client_deviceid=r.devDeviceId,e.common_uikind=r.uiKind,e.common_remotename=r.remoteName,e.common_isnewappinstall="",e}a($vo,"getCommonProperties");p();p();p();p();p();p();var A1e=S7e;var CM=A1e({Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5});p();var y7=A1e({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var Oz="toLowerCase",In="length",pae="warnToConsole",YB="throwInternal",bM="watch",E7="apply",ro="push",gx="splice",zu="logger",SM="cancel",KB="initialize",TM="identifier",hae="removeNotificationListener",mae="addNotificationListener",yC="isInitialized",y1e="getNotifyMgr",_7="getPlugin",iP="name",Zm="processNext",VQe="getProcessTelContext",JB="value",v7="enabled",tOt="stopPollingInternalLogs",Ax="unload",E1e="onComplete",WQe="version",zQe="loggingLevelConsole",IM="createNew",oS="teardown",gae="messageId",xM="message",EC="diagLog",C7="_doTeardown",Lz="update",sS="getNext",b7="setNextPlugin",_1e="userAgent",ZB="split",oP="replace",rOt="substring",YQe="indexOf",XB="type",nOt="evtName",sP="status",iOt="getAllResponseHeaders",v1e="isChildEvt",aS="data",Bz="getCtx",aP="setCtx";var C1e="headers",Aae="urlString",Fz="timeout";var KQe="traceFlags";var oOt;function vXr(t,e){oOt||(oOt=gbe("AggregationError",function(n,o){o[In]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw Ct(e,function(n,o){r+=` -`.concat(o," > ").concat(dr(n))}),new oOt(r,e||[])}a(vXr,"throwAggregationError");p();p();p();p();p();var cS=void 0,Ss="",Uz="channels",zf="core",JQe="createPerfMgr",b1e="disabled",e3="extensionConfig",Qz="extensions",_C="processTelemetry",qz="priority",yae="eventsSent",S7="eventsDiscarded",Eae="eventsSendRequest",wM="perfEvent",ZQe="offlineEventsStored",XQe="offlineBatchSent",eqe="offlineBatchDrop",_ae="getPerfMgr",tqe="domain",rqe="path",CXr="Not dynamic - ";var Vvo="getPrototypeOf",Wvo=/-([a-z])/g,zvo=/([^\w\d_$])/g,Yvo=/^(\d+[\w\d_$])/,GBl=Object[Vvo];function T7(t){return!Xt(t)}a(T7,"isNotNullOrUndefined");function vae(t){var e=t;return e&&Ei(e)&&(e=e[oP](Wvo,function(r,n){return n.toUpperCase()}),e=e[oP](zvo,"_"),e=e[oP](Yvo,function(r,n){return"_"+n})),e}a(vae,"normalizeJsName");function ig(t,e){return t&&e?lu(t,e)!==-1:!1}a(ig,"strContains");function Cae(t){return t&&t.toISOString()||""}a(Cae,"toISOString");function bae(t){return xB(t)?t[iP]:Ss}a(bae,"getExceptionName");function t3(t,e,r,n,o){var s=r;return t&&(s=t[e],s!==r&&(!o||o(s))&&(!n||n(r))&&(s=r,t[e]=s)),s}a(t3,"setValue");function nqe(t,e,r){var n;return t?(n=t[e],!n&&Xt(n)&&(n=Nn(r)?{}:r,t[e]=n)):n=Nn(r)?{}:r,n}a(nqe,"getSetValue");function Kvo(t,e){var r=null,n=null;return Or(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][E7](n,o)}}a(Kvo,"_createProxyFunction");function I7(t,e,r,n,o){t&&e&&r&&(o!==!1||Nn(t[e]))&&(t[e]=Kvo(r,n))}a(I7,"proxyFunctionAs");function x7(t,e,r,n){return t&&e&&Gu(t)&&ur(r)&&Ct(r,function(o){Ei(o)&&I7(t,o,e,o,n)}),t}a(x7,"proxyFunctions");function RM(t){return t&&wB&&(t=YU(wB({},t))),t}a(RM,"optimizeObject");function iqe(t,e,r){var n=e&&e.featureOptIn&&e.featureOptIn[t];if(t&&n){var o=n.mode;if(o===3)return!0;if(o===2)return!1}return r}a(iqe,"isFeatureEnabled");function kM(t){try{return t.responseText}catch{}return null}a(kM,"getResponseText");function oqe(t,e){return t?"XDomainRequest,Response:"+kM(t)||"":e}a(oqe,"formatErrorMessageXdr");function T1e(t,e){return t?"XMLHttpRequest,Status:"+t[sP]+",Response:"+kM(t)||t.response||"":e}a(T1e,"formatErrorMessageXhr");function I1e(t,e){return e&&(Dh(e)?t=[e].concat(t):ur(e)&&(t=e.concat(t))),t}a(I1e,"prependTransports");var Jvo="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",bXr="withCredentials",Zvo="timeout";function sOt(t,e,r,n,o,s){n===void 0&&(n=!1),o===void 0&&(o=!1);function c(u,d,f){try{u[d]=f}catch{}}a(c,"_wrapSetXhrProp");var l=new XMLHttpRequest;return n&&c(l,Jvo,n),r&&c(l,bXr,r),l.open(t,e,!o),r&&c(l,bXr,r),!o&&s&&c(l,Zvo,s),l}a(sOt,"openXhr");function aOt(t){var e={};if(Ei(t)){var r=Ni(t)[ZB](/[\r\n]+/);Ct(r,function(n){if(n){var o=n[YQe](": ");if(o!==-1){var s=Ni(n.substring(0,o))[Oz](),c=Ni(n[rOt](o+1));e[s]=c}else e[Ni(n)]=1}})}return e}a(aOt,"convertAllHeadersToMap");function S1e(t,e,r){if(!t[r]&&e&&e.getResponseHeader){var n=e.getResponseHeader(r);n&&(t[r]=Ni(n))}return t}a(S1e,"_appendHeader");var Xvo="kill-duration",eCo="kill-duration-seconds",tCo="time-delta-millis";function w7(t,e){var r={};return t[iOt]?r=aOt(t[iOt]()):e&&(r=S1e(r,t,tCo),r=S1e(r,t,Xvo),r=S1e(r,t,eCo)),r}a(w7,"_getAllResponseHeaders");p();p();var rCo="location",nCo="console",SXr="JSON",iCo="crypto",oCo="msCrypto",sCo="ReactNative",aCo="msie",cCo="trident/",TXr="XMLHttpRequest",cOt=null,lOt=null,lCo=!1,Sae=null,uOt=null;function IXr(t,e){var r=!1;if(t){try{if(r=e in t,!r){var n=t[tS];n&&(r=e in n)}}catch{}if(!r)try{var o=new t;r=!Nn(o[e])}catch{}}return r}a(IXr,"_hasProperty");function Tae(t){if(t&&lCo){var e=Di("__mockLocation");if(e)return e}return typeof location===lx&&location?location:Di(rCo)}a(Tae,"getLocation");function sqe(){return typeof console!==eS?console:Di(nCo)}a(sqe,"getConsole");function x1e(){return!!(typeof JSON===lx&&JSON||Di(SXr)!==null)}a(x1e,"hasJSON");function aqe(){return x1e()?JSON||Di(SXr):null}a(aqe,"getJSON");function cqe(){return Di(iCo)}a(cqe,"getCrypto");function lqe(){return Di(oCo)}a(lqe,"getMsCrypto");function Iae(){var t=Vu();return t&&t.product?t.product===sCo:!1}a(Iae,"isReactNative");function jz(){var t=Vu();if(t&&(t[_1e]!==lOt||cOt===null)){lOt=t[_1e];var e=(lOt||Ss)[Oz]();cOt=ig(e,aCo)||ig(e,cCo)}return cOt}a(jz,"isIE");function xae(t){return(uOt===null||t===!1)&&(uOt=JW()&&!!Vu().sendBeacon),uOt}a(xae,"isBeaconsSupported");function wae(t){var e=!1;try{e=!!Di("fetch");var r=Di("Request");e&&t&&r&&(e=IXr(r,"keepalive"))}catch{}return e}a(wae,"isFetchSupported");function uqe(){return Sae===null&&(Sae=typeof XDomainRequest!==eS,Sae&&w1e()&&(Sae=Sae&&!IXr(Di(TXr),"withCredentials"))),Sae}a(uqe,"useXDomainRequest");function w1e(){var t=!1;try{var e=Di(TXr);t=!!e}catch{}return t}a(w1e,"isXhrSupported");var xXr=4294967296,Hz=4294967295,wXr=123456789,RXr=987654321,kXr=!1,R1e=wXr,k1e=RXr;function uCo(t){t<0&&(t>>>=0),R1e=wXr+t&Hz,k1e=RXr-t&Hz,kXr=!0}a(uCo,"_mwcSeed");function dCo(){try{var t=El()&2147483647;uCo((Math.random()*xXr^t)+t)}catch{}}a(dCo,"_autoSeedMwc");function dOt(t){var e=0,r=cqe()||lqe();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&Hz),e===0&&jz()&&(kXr||dCo(),e=fCo()&Hz),e===0&&(e=Y1(xXr*Math.random()|0)),t||(e>>>=0),e}a(dOt,"random32");function fCo(t){k1e=36969*(k1e&65535)+(k1e>>16)&Hz,R1e=18e3*(R1e&65535)+(R1e>>16)&Hz;var e=(k1e<<16)+(R1e&65535)>>>0&Hz|0;return t||(e>>>=0),e}a(fCo,"mwcRandom32");function fOt(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=dOt()>>>0,n=0,o=Ss;o[In]>>=6,n===5&&(r=(dOt()<<2&4294967295|r&3)>>>0,n=0);return o}a(fOt,"newId");var PXr="3.3.10",pCo="."+fOt(6),hCo=0;function DXr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(DXr,"_canAcceptData");function mCo(t,e){var r=e[t.id];if(!r){r={};try{DXr(e)&&ji(e,t.id,{e:!1,v:r})}catch{}}return r}a(mCo,"_getCache");function yx(t,e){return e===void 0&&(e=!1),vae(t+hCo+++(e?"."+PXr:Ss)+pCo)}a(yx,"createUniqueNamespace");function dqe(t){var e={id:yx("_aiData-"+(t||Ss)+"."+PXr),accept:a(function(r){return DXr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[vae(n)]:(s&&(c=mCo(e,r),c[vae(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(dqe,"createElmNodeData");p();function fqe(t){return t&&Gu(t)&&!ur(t)&&(t.isVal||t.fb||yA(t,"v")||yA(t,"mrg")||yA(t,"ref")||t.set)}a(fqe,"_isConfigDefaults");function NXr(t,e,r){var n,o=r.dfVal||Tse;if(e&&r.fb){var s=r.fb;ur(s)||(s=[s]);for(var c=0;c0&&vXr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[In]>0){c||(c=[]),l||(l=Up(function(){l=null,f()},0));for(var A=0;A0?_l(kae(t[0],e),function(){AOt(HU(t,1),e,r)}):r(),n}a(AOt,"doUnloadAll");p();var LXr=500,yOt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function BXr(t){return{mrg:!0,v:t}}a(BXr,"cfgDfMerge");p();p();var EOt=[yae,S7,Eae,wM],yqe=null,Aqe;function bCo(t,e){return function(){var r=arguments,n=_Ot(e);if(n){var o=n.listener;o&&o[t]&&o[t][E7](o,r)}}}a(bCo,"_listenerProxyFunc");function SCo(){var t=Di("Microsoft");return t&&(yqe=t.ApplicationInsights),yqe}a(SCo,"_getExtensionNamespace");function _Ot(t){var e=yqe;return!e&&t.disableDbgExt!==!0&&(e=yqe||SCo()),e?e.ChromeDbgExt:null}a(_Ot,"getDebugExt");function FXr(t){if(!Aqe){Aqe={};for(var e=0;e=A&&(d[T](b[xM]),n[w]=!0)}else o>=A&&d[T](b[xM]);f(A,b)}},d.debugToConsole=function(A){vOt("debug",A),g("warning",A)},d[pae]=function(A){vOt("warn",A),g("warning",A)},d.errorToConsole=function(A){vOt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[Ax]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=xCo+y[gae];if(n[_]?E=!1:n[_]=!0,E&&(A<=s&&(d.queue[ro](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",b=new Dae(23,v,!1);d.queue[ro](b),A===1?d.errorToConsole(v):d[pae](v)}}}a(f,"_logInternalMessage");function h(A){return lS(jp(A,wCo,d).cfg,function(y){var E=y.cfg;o=E[zQe],s=E.loggingLevelTelemetry,c=E.maxMessageLimit,l=E.enableDebug})}a(h,"_setDefaultsFromConfig");function m(){return r>=c}a(m,"_areInternalMessagesThrottled");function g(A,y){var E=_Ot(e||{});E&&E[EC]&&E[EC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function qXr(t){return t||new Gz}a(qXr,"_getLogger");function Ra(t,e,r,n,o,s){s===void 0&&(s=!1),qXr(t)[YB](e,r,n,o,s)}a(Ra,"_throwInternal");function DM(t,e){qXr(t)[pae](e)}a(DM,"_warnToConsole");var COt,R7,jXr="toGMTString",HXr="toUTCString",TOt="cookie",bOt="expires",GXr="isCookieUseDisabled",B1e="disableCookiesUsage",$Xr="_ckMgr",Eqe=null,SOt=null,VXr=null,NM,WXr={},zXr={},kCo=(COt={cookieCfg:BXr((R7={},R7[tqe]={fb:"cookieDomain",dfVal:T7},R7.path={fb:"cookiePath",dfVal:T7},R7.enabled=cS,R7.ignoreCookies=cS,R7.blockedCookies=cS,R7.disableCookieDefer=!1,R7)),cookieDomain:cS,cookiePath:cS},COt[B1e]=cS,COt);function IOt(){!NM&&(NM=I7e(function(){return df()}))}a(IOt,"_getDoc");function _qe(t){return t?t.isEnabled():!0}a(_qe,"_isMgrEnabled");function een(t,e){return e&&t&&ur(t.ignoreCookies)?Vo(t.ignoreCookies,e)!==-1:!1}a(een,"_isIgnoredCookie");function YXr(t,e){return e&&t&&ur(t.blockedCookies)&&Vo(t.blockedCookies,e)!==-1?!0:een(t,e)}a(YXr,"_isBlockedCookie");function KXr(t,e){var r=e[v7];if(Xt(r)){var n=void 0;Nn(t[GXr])||(n=!t[GXr]),Nn(t[B1e])||(n=!t[B1e]),r=n}return r}a(KXr,"_isCfgEnabled");function xOt(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[rqe]=E||"/",_[bOt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return jz()||(v["max-age"]="0"),ZXr(Ss,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Ni(E||Ss),R=lu(w,";");if(R!==-1&&(w=Ni(cM(E,R)),T=ten(Vf(E,R+1))),t3(T,tqe,v||o,W1,Nn),!Xt(_)){var x=jz();if(Nn(T[bOt])){var P=El(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),t3(T,bOt,JXr(N,x?jXr:HXr)||JXr(N,x?jXr:HXr)||Ss,W1)}}x||t3(T,"max-age",Ss+_,null,Nn)}var L=Tae();return L&&L.protocol==="https:"&&(t3(T,"secure",null,null,Nn),SOt===null&&(SOt=!ren((Vu()||{})[_1e])),SOt&&t3(T,"SameSite","None",null,Nn)),t3(T,rqe,b||n,null,Nn),ZXr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[In]-1;_>=0;_--)f[_].n===E&&f[gx](_,1)}a(g,"_removePendingCookie");function A(){L1e(e)&&f&&(Ct(f,function(E){YXr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=jp(t||zXr,null,e).cfg,s=lS(t,function(E){E.setDf(E.cfg,kCo),r=E.ref(E.cfg,"cookieCfg"),n=r[rqe]||"/",o=r[tqe],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=KXr(t,r)!==!1,l=r.getCookie||PCo,u=r.setCookie||XXr,d=r.delCookie||XXr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=KXr(t,r)!==!1&&c&&L1e(e),_=zXr[$Xr];return E&&_&&y!==_&&(E=_qe(_)),E},"isEnabled"),setEnabled:a(function(E){r[v7]=E,Nn(t[B1e])||(t[B1e]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=YXr(r,E);if(!R){var x=m(_,v,b,T);_qe(y)?(u(E,x),w=!0):f&&(g(E),f[ro]({n:E,o:0,v:x}),w=!0)}return w},"set"),get:a(function(E){var _=Ss,v=een(r,E);if(!v){if(_qe(y))_=l(E);else if(f)for(var b=f[In]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=lu(w,";");_=R!==-1?Ni(cM(w,R)):Ni(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return _qe(y)?v=y.purge(E,_):f&&(g(E),f[ro]({n:E,o:1,v:h(_)}),v=!0),v},"del"),purge:a(function(E,_){var v=!1;return L1e(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[$Xr]=y,y}a(xOt,"createCookieMgr");function L1e(t){if(Eqe===null){Eqe=!1,!NM&&IOt();try{var e=NM.v||{};Eqe=e[TOt]!==void 0}catch(r){Ra(t,2,68,"Cannot access document.cookie - "+bae(r),{exception:dr(r)})}}return Eqe}a(L1e,"areCookiesSupported");function ten(t){var e={};if(t&&t[In]){var r=Ni(t)[ZB](";");Ct(r,function(n){if(n=Ni(n||Ss),n){var o=lu(n,"=");o===-1?e[n]=null:e[Ni(cM(n,o))]=Ni(Vf(n,o+1))}})}return e}a(ten,"_extractParts");function JXr(t,e){return Or(t[e])?t[e]():null}a(JXr,"_formatDate");function ZXr(t,e){var r=t||Ss;return Yr(e,function(n,o){r+="; "+n+(Xt(o)?Ss:"="+o)}),r}a(ZXr,"_formatCookieValue");function PCo(t){var e=Ss;if(!NM&&IOt(),NM.v){var r=NM.v[TOt]||Ss;VXr!==r&&(WXr=ten(r),VXr=r),e=Ni(WXr[t]||Ss)}return e}a(PCo,"_getCookieValue");function XXr(t,e){!NM&&IOt(),NM.v&&(NM.v[TOt]=t+"="+e)}a(XXr,"_setCookieValue");function ren(t){return Ei(t)?!!(ig(t,"CPU iPhone OS 12")||ig(t,"iPad; CPU OS 12")||ig(t,"Macintosh; Intel Mac OS X 10_14")&&ig(t,"Version/")&&ig(t,"Safari")||ig(t,"Macintosh; Intel Mac OS X 10_14")&&PB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||ig(t,"Chrome/5")||ig(t,"Chrome/6")||ig(t,"UnrealEngine")&&!ig(t,"Chrome")||ig(t,"UCBrowser/12")||ig(t,"UCBrowser/11")):!1}a(ren,"uaDisallowsSameSiteNone");p();var DCo={perfEvtsSendAll:!1};function NCo(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){$f(r.fn,[r.arg])})}a(NCo,"_runScheduledListeners");function k7(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[ro]({fn:n,arg:o}),r.h=r.h||Up(NCo,0,r)):$f(n,[o]))})}a(k7,"_runListeners");var wOt=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=jp(e,DCo);n=c[bM](function(l){r=!!l.cfg.perfEvtsSendAll}),Si(t,this,function(l){ji(l,"listeners",{g:a(function(){return o},"g")}),l[mae]=function(u){o[ro](u)},l[hae]=function(u){for(var d=Vo(o,u);d>-1;)o[gx](d,1),d=Vo(o,u)},l[yae]=function(u){k7(o,yae,s,function(d){d[yae](u)})},l[S7]=function(u,d){k7(o,S7,s,function(f){f[S7](u,d)})},l[Eae]=function(u,d){k7(o,Eae,d?s:null,function(f){f[Eae](u,d)})},l[wM]=function(u){u&&(r||!u[v1e]())&&k7(o,wM,null,function(d){u.isAsync?Up(function(){return d[wM](u)},0):d[wM](u)})},l[ZQe]=function(u){u&&u[In]&&k7(o,ZQe,s,function(d){d[ZQe](u)})},l[XQe]=function(u){u&&u[aS]&&k7(o,XQe,s,function(d){d[XQe](u)})},l[eqe]=function(u,d){if(u>0){var f=d||0;k7(o,eqe,s,function(h){h[eqe](u,f)})}},l[Ax]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[SM](),s.h=null,s.cb=[]},"_finishUnload"),f;if(k7(o,"unload",null,function(h){var m=h[Ax](u);m&&(f||(f=[]),f[ro](m))}),f)return Dd(function(h){return _l(z7e(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var Mae="ctx",kOt="ParentContextKey",F1e="ChildrenContextKey",MCo=null,Oae=(function(){function t(e,r,n){var o=this;if(o.start=El(),o[iP]=e,o.isAsync=n,o[v1e]=function(){return!1},Or(r)){var s;ji(o,"payload",{g:a(function(){return!s&&Or(r)&&(s=r(),r=null),s},"g")})}o[Bz]=function(c){return c?c===t[kOt]||c===t[F1e]?o[c]:(o[Mae]||{})[c]:null},o[aP]=function(c,l){if(c)if(c===t[kOt])o[c]||(o[v1e]=function(){return!0}),o[c]=l;else if(c===t[F1e])o[c]=l;else{var u=o[Mae]=o[Mae]||{};u[c]=l}},o.complete=function(){var c=0,l=o[Bz](t[F1e]);if(ur(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(E){Ra(r[zu],2,73,"Unexpected Exception during onComplete - "+dr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[e3];!_&&A&&(_={}),E[e3]=_,_=e.ref(E,e3),_&&(y=_[g],!y&&A&&(y={}),_[g]=y,y=e.ref(_,g))}return y}a(d,"_getExtCfg");function f(g,A){var y=d(g,!0);return A&&Yr(A,function(E,_){if(Xt(y[E])){var v=e.cfg[E];(v||!Xt(v))&&(y[E]=v)}P1e(e,y,E,_)}),e.setDf(y,A)}a(f,"_resolveExtCfg");function h(g,A,y){y===void 0&&(y=!1);var E,_=d(g,!1),v=e.cfg;return _&&(_[A]||!Xt(_[A]))?E=_[A]:(v[A]||!Xt(v[A]))&&(E=v[A]),E||!Xt(E)?E:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[_7]();y&&g(y)}}return a(m,"_iterateChain"),c}a(OOt,"_createInternalContext");function Ex(t,e,r,n){var o=jp(e),s=OOt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[_C](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),ur(d)&&(d=P7(d,o.cfg,r,f)),Ex(d||c[sS](),o.cfg,r,f)}return a(u,"_createNew"),c[Zm]=l,c[IM]=u,c}a(Ex,"createProcessTelemetryContext");function Lae(t,e,r){var n=jp(e.config),o=OOt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[Ax](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=P7(u,n.cfg,e,d)),Lae(u||s[sS](),e,d)}return a(l,"_createNew"),s[Zm]=c,s[IM]=l,s}a(Lae,"createProcessTelemetryUnloadContext");function U1e(t,e,r){var n=jp(e.config),o=OOt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Or(d[Lz])&&d[Lz](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=P7(u,n.cfg,e,d)),U1e(u||s[sS](),e,d)}return a(l,"_createNew"),s[Zm]=c,s[IM]=l,s}a(U1e,"createProcessTelemetryUpdateContext");function P7(t,e,r,n){var o=null,s=!n;if(ur(t)&&t[In]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Or(l[_C])){var u=QCo(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?P7([n],e,r):o}a(P7,"createTelemetryProxyChain");function QCo(t,e,r){var n=null,o=Or(t[_C]),s=Or(t[b7]),c;t?c=t[TM]+"-"+t[qz]+"-"+aen++:c="Unknown-0-"+aen++;var l={getPlugin:a(function(){return t},"getPlugin"),getNext:a(function(){return n},"getNext"),processTelemetry:f,unload:h,update:m,_id:c,_setNext:a(function(g){n=g},"_setNext")};function u(){var g;return t&&Or(t[sen])&&(g=t[sen]()),g||(g=Ex(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[TM]:FCo,T=g[oen];return T||(T=g[oen]={}),g.setNext(n),t&&Hp(g[zf](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:Ss;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&Ra(g[EC](),1,73,"Plugin ["+b+"] failed during "+y+" - "+dr(x)+", run flags: "+dr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=r3(t);return _[oS]||_[b1e]?!1:(s&&t[b7](n),t[_C](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[Zm](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=r3(t),v=t[zf]||_[zf];t&&(!v||v===g.core())&&!_[oS]&&(_[zf]=null,_[oS]=!0,_[yC]=!1,t[oS]&&t[oS](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[Zm](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=r3(t),v=t[zf]||_[zf];t&&(!v||v===g.core())&&!_[oS]&&t[Lz]&&t[Lz](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[Zm](A)}return a(m,"_updatePlugin"),Nh(l)}a(QCo,"createTelemetryPluginProxy");var cen=(function(){function t(e,r,n,o){var s=this,c=Ex(e,r,n,o);x7(s,c,$u(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function Q1e(){var t=[];function e(n){n&&t[ro](n)}a(e,"_addHandler");function r(n,o){Ct(t,function(s){try{s(n,o)}catch(c){Ra(n[EC](),2,73,"Unexpected error calling unload handler - "+dr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(Q1e,"createUnloadHandlerContainer");p();var bqe,Sqe;function Tqe(){var t=[];function e(n){var o=t;t=[],Ct(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Ra(n,2,73,"Unloading:"+dr(c))}}),bqe&&o[In]>bqe&&(Sqe?Sqe("doUnload",o):Ra(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Mh(t,n),bqe&&t[In]>bqe&&(Sqe?Sqe("Add",t):Ra(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected.")))}return a(r,"_addHook"),{run:e,add:r}}a(Tqe,"createUnloadHookContainer");var LOt,D7="getPlugin",qCo=(LOt={},LOt[e3]={isVal:T7,v:{}},LOt),Bae=(function(){function t(){var e=this,r,n,o,s,c;d(),Si(t,e,function(f){f[KB]=function(h,m,g,A){u(h,m,A),r=!0},f[oS]=function(h,m){var g=f[zf];if(!g||h&&g!==h[zf]())return;var A,y=!1,E=h||Lae(null,g,o&&o[D7]?o[D7]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[EC]()),A===!0&&E[Zm](_),d())}return a(v,"_unloadCallback"),!f[C7]||f[C7](E,_,v)!==!0?v():A=!0,A},f[Lz]=function(h,m){var g=f[zf];if(!g||h&&g!==h[zf]())return;var A,y=!1,E=h||U1e(null,g,o&&o[D7]?o[D7]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[sS]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},I7(f,"_addUnloadCb",function(){return s},"add"),I7(f,"_addHook",function(){return c},"add"),ji(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[EC]=function(f){return l(f)[EC]()},e[yC]=function(){return r},e.setInitialized=function(f){r=f},e[b7]=function(f){o=f},e[Zm]=function(f,h){h?h[Zm](f):o&&Or(o[_C])&&o[_C](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||Ex(null,{},e[zf]);o&&o[D7]?h=m[IM](null,o[D7]):h=m[IM](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){jp(f,qCo,Nae(h)),!m&&h&&(m=h[VQe]()[sS]());var g=o;o&&o[D7]&&(g=o[D7]()),e[zf]=h,n=Ex(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[zf]=null,n=null,o=null,c=Tqe(),s=Q1e()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function jCo(t,e,r){var n={id:e,fn:r};Mh(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[gx](c,1),-1})},"remove")};return o}a(jCo,"_addInitializer");function HCo(t,e,r){for(var n=!1,o=t[In],s=0;s"},"v")})}a(XCo,"_createUnloadHook");var Iqe=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,q,M,O,j,Q;Si(t,this,function(U){re(),U._getDbgPlgTargets=function(){return[x,o]},U[yC]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[KB]=function(ne,ce,Ne,we){g&&Zc(uen),U[yC]()&&Zc("Core cannot be initialized more than once"),e=jp(ne,BOt,Ne||U[zu],!1),ne=e.cfg,qe(e[bM](function(st){var _t=st.cfg;B=_t.initInMemoMaxSize||VCo,Y(_t);var Dt=st.ref(st.cfg,e3);Yr(Dt,function($t){st.ref(Dt,$t)})})),s=we,b=ZCo(e,v,s&&U[y1e](),b),K(),U[zu]=Ne;var Be=ne[Qz];if(f=[],f[ro].apply(f,rz(rz([],ce,!1),Be,!1)),h=ne[Uz],Le(null),(!m||m[In]===0)&&Zc("No "+Uz+" available"),h&&h[In]>1){var rt=U[_7]("TeeChannelController");(!rt||!rt.plugin)&&Ra(n,1,28,"TeeChannel required")}JCo(ne,R,n),R=null,r=!0,N===y7.ACTIVE&&z()},U.getChannels=function(){var ne=[];return m&&Ct(m,function(ce){ne[ro](ce)}),Nh(ne)},U.track=function(ne){Hp(U[_ae](),function(){return"AppInsightsCore:track"},function(){ne===null&&(ue(ne),Zc("Invalid telemetry item")),!ne[iP]&&Xt(ne[iP])&&(ue(ne),Zc("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||Cae(new Date),ne.ver=ne.ver||"4.0",!g&&U[yC]()&&N===y7.ACTIVE?le()[Zm](ne):N!==y7.INACTIVE&&o[In]<=B&&o[ro](ne)},function(){return{item:ne}},!ne.sync)},U[VQe]=le,U[y1e]=function(){return s||(s=new wOt(e.cfg),U[GCo]=s),s},U[mae]=function(ne){U.getNotifyMgr()[mae](ne)},U[hae]=function(ne){s&&s[hae](ne)},U.getCookieMgr=function(){return u||(u=xOt(e.cfg,U[zu])),u},U.setCookieMgr=function(ne){u!==ne&&(kae(u,!1),u=ne)},U[_ae]=function(){return c||l||POt()},U.setPerfMgr=function(ne){c=ne},U.eventCnt=function(){return o[In]},U.releaseQueue=function(){if(r&&o[In]>0){var ne=o;o=[],N===2?Ct(ne,function(ce){ce.iKey=ce.iKey||w,le()[Zm](ce)}):Ra(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ne){return y=ne||null,Q=!1,O&&O[SM](),ie(!0)};function Y(ne){var ce=ne.instrumentationKey,Ne=ne.endpointUrl;if(N!==3){if(Xt(ce)){w=null,N=y7.INACTIVE;var we="Please provide instrumentation key";r?(Ra(n,1,100,we),z()):Zc(we);return}var Be=[];tg(ce)?(Be[ro](ce),w=null):w=ce,tg(Ne)?(Be[ro](Ne),L=null):L=Ne,Be[In]?W(ne,Be):V()}}a(Y,"_handleIKeyEndpointPromises");function W(ne,ce){q=!1,N=3;var Ne=T7(ne.initTimeOut)?ne.initTimeOut:WCo,we=W7e(ce);M&&M[SM](),M=Up(function(){M=null,q||V()},Ne),_l(we,function(Be){try{if(q)return;if(!Be.rejected){var rt=Be[JB];if(rt&&rt[In]){var st=rt[0];if(w=st&&st[JB],rt[In]>1){var _t=rt[1];L=_t&&_t[JB]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=L)}V()}catch{q||V()}})}a(W,"_waitForInitPromises");function V(){q=!0,Xt(w)?(N=y7.INACTIVE,Ra(n,1,112,"ikey can't be resolved from promises")):N=y7.ACTIVE,z()}a(V,"_setStatus");function z(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(z,"_releaseQueues");function ie(ne){if((!O||!O[v7])&&!Q){var ce=ne||n&&n.queue[In]>0;ce&&(j||(j=!0,qe(e[bM](function(Ne){var we=Ne.cfg.diagnosticLogInterval;(!we||!(we>0))&&(we=1e4);var Be=!1;O&&(Be=O[v7],O[SM]()),O=k7e(X,we),O.unref(),O[v7]=Be}))),O[v7]=!0)}return O}a(ie,"_startLogPoller"),U[tOt]=function(){Q=!0,O&&O[SM](),X()},x7(U,function(){return A},["addTelemetryInitializer"]),U[Ax]=function(ne,ce,Ne){ne===void 0&&(ne=!0),r||Zc($Co),g&&Zc(uen);var we={reason:50,isAsync:ne,flushComplete:!1},Be;ne&&!ce&&(Be=Dd(function(_t){ce=_t}));var rt=Lae(Ue(),U);rt[E1e](function(){v.run(U[zu]),AOt([u,s,n],ne,function(){re(),ce&&ce(we)})},U);function st(_t){we.flushComplete=_t,g=!0,_.run(rt,we),U[tOt](),rt[Zm](we)}return a(st,"_doUnload"),X(),ee(ne,st,6,Ne)||st(!1),Be},U[_7]=ge,U.addPlugin=function(ne,ce,Ne,we){if(!ne){we&&we(!1),Z(pen);return}var Be=ge(ne[TM]);if(Be&&!ce){we&&we(!1),Z("Plugin ["+ne[TM]+"] is already loaded!");return}var rt={reason:16};function st($t){f[ro](ne),rt.added=[ne],Le(rt),we&&we(!0)}if(a(st,"_addPlugin"),Be){var _t=[Be.plugin],Dt={reason:2,isAsync:!!Ne};ke(_t,Dt,function($t){$t?(rt.removed=_t,rt.reason|=32,st(!0)):we&&we(!1)})}else st(!1)},U.updateCfg=function(ne,ce){ce===void 0&&(ce=!0);var Ne;if(U[yC]()){Ne={reason:1,cfg:e.cfg,oldCfg:Rse({},e.cfg),newConfig:Rse({},ne),merge:ce},ne=Ne.newConfig;var we=e.cfg;ne[Qz]=we[Qz],ne[Uz]=we[Uz]}e._block(function(Be){var rt=Be.cfg;FOt(Be,rt,ne,ce),ce||Yr(rt,function(st){yA(ne,st)||Be.set(rt,st,cS)}),Be.setDf(rt,BOt)},!0),e.notify(),Ne&&he(Ne)},U.evtNamespace=function(){return E},U.flush=ee,U.getTraceCtx=function(ne){return T||(T=ien()),T},U.setTraceCtx=function(ne){T=ne||null},U.addUnloadHook=qe,I7(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ne){var ce;return r?ce=lS(e.cfg,ne,U[zu]):ce=KCo(R,ne),XCo(ce)},U.getWParam=function(){return RB()||e.cfg.enableWParam?0:-1};function H(){var ne={};P=[];var ce=a(function(Ne){Ne&&Ct(Ne,function(we){if(we[TM]&&we[WQe]&&!ne[we.identifier]){var Be=we[TM]+"="+we[WQe];P[ro](Be),ne[we.identifier]=we}})},"_addPluginVersions");ce(m),h&&Ct(h,function(Ne){ce(Ne)}),ce(f)}a(H,"_setPluginVersions");function re(){r=!1,e=jp({},BOt,U[zu]),e.cfg[zQe]=1,ji(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(ce){U.updateCfg(ce,!1)},"s")}),ji(U,"pluginVersionStringArr",{g:a(function(){return P||H(),P},"g")}),ji(U,"pluginVersionString",{g:a(function(){return D||(P||H(),D=P.join(";")),D||Ss},"g")}),ji(U,"logger",{g:a(function(){return n||(n=new Gz(e.cfg),e[zu]=n),n},"g"),s:a(function(ce){e[zu]=ce,n!==ce&&(kae(n,!1),n=ce)},"s")}),U[zu]=new Gz(e.cfg),x=[];var ne=U.config[Qz]||[];ne.splice(0,ne[In]),Mh(ne,x),A=new len,o=[],kae(s,!1),s=null,c=null,l=null,kae(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=yx("AIBaseCore",!0),_=Q1e(),T=null,w=null,v=Tqe(),R=[],D=null,P=null,Q=!1,O=null,j=!1,N=0,L=null,B=null,q=!1,M=null}a(re,"_initDefaults");function le(){var ne=Ex(Ue(),e.cfg,U);return ne[E1e](ie),ne}a(le,"_createTelCtx");function Le(ne){var ce=YCo(U[zu],LXr,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=Cqe(Mh(m,ce[Uz]));var Ne=Mh(Cqe(ce[zf]),m);x=Nh(Ne);var we=U.config[Qz]||[];we.splice(0,we[In]),Mh(we,x);var Be=le();m&&m[In]>0&&MOt(Be[IM](m),Ne),MOt(Be,Ne),ne&&he(ne)}a(Le,"_initPluginChain");function ge(ne){var ce=null,Ne=null,we=[];return Ct(x,function(Be){if(Be[TM]===ne&&Be!==A)return Ne=Be,-1;Be.getChannel&&we[ro](Be)}),!Ne&&we[In]>0&&Ct(we,function(Be){if(Ne=Be.getChannel(ne),!Ne)return-1}),Ne&&(ce={plugin:Ne,setEnabled:a(function(Be){r3(Ne)[b1e]=!Be},"setEnabled"),isEnabled:a(function(){var Be=r3(Ne);return!Be[oS]&&!Be[b1e]},"isEnabled"),remove:a(function(Be,rt){Be===void 0&&(Be=!0);var st=[Ne],_t={reason:1,isAsync:Be};ke(st,_t,function(Dt){Dt&&Le({reason:32,removed:st}),rt&&rt(Dt)})},"remove")}),ce}a(ge,"_getPlugin");function Ue(){if(!d){var ne=(x||[]).slice();Vo(ne,A)===-1&&ne[ro](A),d=P7(Cqe(ne),e.cfg,U)}return d}a(Ue,"_getPluginChain");function ke(ne,ce,Ne){if(ne&&ne[In]>0){var we=P7(ne,e.cfg,U),Be=Lae(we,U);Be[E1e](function(){var rt=!1,st=[];Ct(f,function(Dt,$t){den(Dt,ne)?rt=!0:st[ro](Dt)}),f=st,D=null,P=null;var _t=[];h&&(Ct(h,function(Dt,$t){var Gt=[];Ct(Dt,function(Ie){den(Ie,ne)?rt=!0:Gt[ro](Ie)}),_t[ro](Gt)}),h=_t),Ne&&Ne(rt),ie()}),Be[Zm](ce)}else Ne(!1)}a(ke,"_removePlugins");function X(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[In]=0,Ct(ne,function(ce){var Ne={name:y||"InternalMessageId: "+ce[gae],iKey:w,time:Cae(new Date),baseType:Dae.dataType,baseData:{message:ce[xM]}};U.track(Ne)})}}a(X,"_flushInternalLogs");function ee(ne,ce,Ne,we){var Be=1,rt=!1,st=null;we=we||5e3;function _t(){Be--,rt&&Be===0&&(st&&st[SM](),st=null,ce&&ce(rt),ce=null)}if(a(_t,"doCallback"),m&&m[In]>0){var Dt=le()[IM](m);Dt.iterate(function($t){if($t.flush){Be++;var Gt=!1;$t.flush(ne,function(){Gt=!0,_t()},Ne)||Gt||(ne&&st==null?st=Up(function(){st=null,_t()},we):_t())}})}return rt=!0,_t(),!0}a(ee,"_flushChannels");function K(){var ne;qe(e[bM](function(ce){var Ne=ce.cfg.enablePerfMgr;if(Ne){var we=ce.cfg[JQe];(ne!==we||!ne)&&(we||(we=zCo),nqe(ce.cfg,JQe,we),ne=we,l=null),!c&&!l&&Or(we)&&(l=we(U,U[y1e]()))}else l=null,ne=null}))}a(K,"_initPerfManager");function he(ne){var ce=U1e(Ue(),U);ce[E1e](ie),(!U._updateHook||U._updateHook(ce,ne)!==!0)&&ce[Zm](ne)}a(he,"_doUpdate");function Z(ne){var ce=U[zu];ce?(Ra(ce,2,73,ne),ie()):Zc(ne)}a(Z,"_logOrThrowError");function ue(ne){var ce=U[y1e]();ce&&ce[S7]([ne],2)}a(ue,"_notifyInvalidEvent");function qe(ne){v.add(ne)}a(qe,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();var cP="",ebo="NoResponseBody",hen="&"+ebo+"=true",UOt="POST",xqe=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;Si(t,this,function(E,_){var v=!0;q(),E[KB]=function(M,O){o=O,n&&Ra(o,1,28,"Sender is already initialized"),E.SetConfig(M),n=!0},E._getDbgPlgTargets=function(){return[n,s,l,r]},E.SetConfig=function(M){try{if(c=M.senderOnCompleteCallBack||{},l=!!M.disableCredentials,u=M.fetchCredentials,s=!!M.isOneDs,r=!!M.enableSendPromise,f=!!M.disableXhr,h=!!M.disableBeacon,m=!!M.disableBeaconSync,y=M.timeWrapper,A=!!M.addNoResponse,g=!!M.disableFetchKeepAlive,d={sendPOST:N},s||(v=!1),l){var O=Tae();O&&O.protocol&&O.protocol[Oz]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[In]?R(M,O):null},E.getFallbackInst=function(){return d},E[C7]=function(M,O){q()},E.preparePayload=function(M,O,j,Q){if(!O||Q||!j[aS]){M(j);return}try{var U=Di("CompressionStream");if(!Or(U)){M(j);return}var Y=new ReadableStream({start:a(function(re){re.enqueue(Ei(j[aS])?new TextEncoder().encode(j[aS]):j[aS]),re.close()},"start")}),W=Y.pipeThrough(new U("gzip")),V=W.getReader(),z=[],ie=0,H=!1;return _l(V.read(),a(function re(le){if(!H&&!le.rejected){var Le=le[JB];if(!Le.done)return z[ro](Le[JB]),ie+=Le.value[In],_l(V.read(),re);for(var ge=new Uint8Array(ie),Ue=0,ke=0,X=z;ke0&&(Ct($u(ge),function(K){H.append(K,ge[K])}),Ue[C1e]=H),u?Ue.credentials=u:v&&s&&(Ue.credentials="include"),j&&(Ue.keepalive=!0,e+=re,s?M._sendReason===2&&(le=!0,A&&(U+=hen)):le=!0);var ke=new Request(U,Ue);try{ke[yOt]=!0}catch{}if(!j&&r&&(V=Dd(function(K,he){z=K,ie=he})),!U){w(O),z&&z(!1);return}function X(K,he){he?x(O,s?0:he,{},s?cP:K):x(O,s?0:400,{},s?cP:K)}a(X,"_handleError");function ee(K,he,Z){var ue=K[sP],qe=c.fetchOnComplete;qe&&Or(qe)?qe(K,O,Z||cP,he):x(O,ue,{},Z||cP)}a(ee,"_onFetchComplete");try{_l(fetch(s?U:ke,s?Ue:null),function(K){if(j&&(e-=re,re=0),!Le)if(Le=!0,K.rejected)X(K.reason&&K.reason[xM],499),ie&&ie(K.reason);else{var he=K[JB];try{!s&&!he.ok?(he[sP]?X(he.statusText,he[sP]):X(he.statusText,499),z&&z(!1)):s&&!he.body?(ee(he,null,cP),z&&z(!0)):_l(he.text(),function(Z){ee(he,M,Z[JB]),z&&z(!0)})}catch(Z){he&&he[sP]?X(dr(Z),he[sP]):X(dr(Z),499),ie&&ie(Z)}}})}catch(K){Le||(X(dr(K),499),ie&&ie(K))}return le&&!Le&&(Le=!0,x(O,200,{}),z&&z(!0)),s&&!Le&&M[Fz]>0&&y&&y.set(function(){Le||(Le=!0,x(O,500,{}),z&&z(!0))},M[Fz]),V}a(L,"_doFetchSender");function B(M,O,j){var Q=ff(),U=new XDomainRequest,Y=M[aS];U.onload=function(){var H=kM(U),re=c&&c.xdrOnComplete;re&&Or(re)?re(U,O,M):x(O,200,{},H)},U.onerror=function(){x(O,400,{},s?cP:oqe(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var W=Q&&Q.location&&Q.location.protocol||"",V=M[Aae];if(!V){w(O);return}if(!s&&V.lastIndexOf(W,0)!==0){var z="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";Ra(o,2,40,". "+z),T(z,O);return}var ie=s?V:V[oP](/^(https?:)/,"");U.open(UOt,ie),M[Fz]&&(U[Fz]=M[Fz]),U.send(Y),s&&j?y&&y.set(function(){U.send(Y)},0):U.send(Y)}a(B,"_xdrSender");function q(){e=0,n=!1,r=!1,o=null,s=null,c=null,l=null,u=null,d=null,f=!1,h=!1,m=!1,g=!1,A=!1,y=null}a(q,"_initDefaults")})}return a(t,"SenderPostManager"),t.__ieDyn=1,t})();p();var ven="on",men="attachEvent",gen="addEventListener",Aen="detachEvent",yen="removeEventListener",QOt="events",H1e="visibilitychange",Rqe="pagehide",Cen="pageshow",ben="unload",Sen="beforeunload",Ten=yx("aiEvtPageHide"),Ien=yx("aiEvtPageShow"),tbo=/\.[\.]+/g,rbo=/[\.]+$/,nbo=1,wqe=dqe("events"),ibo=/^([^.]*)(?:\.(.+)|)/;function Een(t){return t&&t[oP]?t[oP](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,Ss):t}a(Een,"_normalizeNamespace");function qOt(t,e){if(e){var r=Ss;ur(e)?(r=Ss,Ct(e,function(o){o=Een(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=Een(e),r&&(r[0]!=="."&&(r="."+r),t=(t||Ss)+r)}var n=ibo.exec(t||Ss)||[];return{type:n[1],ns:(n[2]||Ss).replace(tbo,".").replace(rbo,Ss)[ZB](".").sort().join(".")}}a(qOt,"_getEvtNamespace");function xen(t,e,r){r===void 0&&(r=!0);var n=wqe.get(t,QOt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(xen,"_getRegisteredEvents");function wen(t,e,r,n){t&&e&&e[XB]&&(t[yen]?t[yen](e[XB],r,n):t[Aen]&&t[Aen](ven+e[XB],r))}a(wen,"_doDetach");function obo(t,e,r,n){var o=!1;return t&&e&&e[XB]&&r&&(t[gen]?(t[gen](e[XB],r,n),o=!0):t[men]&&(t[men](ven+e[XB],r),o=!0)),o}a(obo,"_doAttach");function _en(t,e,r,n){for(var o=e[In];o--;){var s=e[o];s&&(!r.ns||r.ns===s[nOt].ns)&&(!n||n(s))&&(wen(t,s[nOt],s.handler,s.capture),e[gx](o,1))}}a(_en,"_doUnregister");function sbo(t,e,r){if(e[XB])_en(t,xen(t,e[XB]),e,r);else{var n=wqe.get(t,QOt,{});Yr(n,function(o,s){_en(t,s,e,r)}),$u(n)[In]===0&&wqe.kill(t,QOt)}}a(sbo,"_unregisterEvents");function M7(t,e){var r;return e?(ur(e)?r=[t].concat(e):r=[t,e],r=qOt("xx",r).ns[ZB](".")):r=t,r}a(M7,"mergeEvtNamespace");function q1e(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=qOt(e,n);if(s=obo(t,c,r,o),s&&wqe.accept(t)){var l={guid:nbo++,evtName:c,handler:r,capture:o};xen(t,c.type)[ro](l)}}catch{}return s}a(q1e,"eventOn");function j1e(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=qOt(e,n),c=!1;sbo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||wen(t,s,r,o)}catch{}}a(j1e,"eventOff");function jOt(t,e,r){var n=!1,o=ff();o&&(n=q1e(o,t,e,r),n=q1e(o.body,t,e,r)||n);var s=df();return s&&(n=q1e(s,t,e,r)||n),n}a(jOt,"addEventHandler");function HOt(t,e,r){var n=ff();n&&(j1e(n,t,e,r),j1e(n.body,t,e,r));var o=df();o&&j1e(o,t,e,r)}a(HOt,"removeEventHandler");function Fae(t,e,r,n){var o=!1;return e&&t&&t[In]>0&&Ct(t,function(s){s&&(!r||Vo(r,s)===-1)&&(o=jOt(s,e,n)||o)}),o}a(Fae,"_addEventListeners");function GOt(t,e,r,n){var o=!1;return e&&t&&ur(t)&&(o=Fae(t,e,r,n),!o&&r&&r[In]>0&&(o=Fae(t,e,null,n))),o}a(GOt,"addEventListeners");function $z(t,e,r){t&&ur(t)&&Ct(t,function(n){n&&HOt(n,e,r)})}a($z,"removeEventListeners");function kqe(t,e,r){return GOt([Sen,ben,Rqe],t,e,r)}a(kqe,"addPageUnloadEventListener");function Pqe(t,e){$z([Sen,ben,Rqe],t,e)}a(Pqe,"removePageUnloadEventListener");function G1e(t,e,r){function n(c){var l=df();t&&l&&l.visibilityState==="hidden"&&t(c)}a(n,"_handlePageVisibility");var o=M7(Ten,r),s=Fae([Rqe],t,e,o);return(!e||Vo(e,H1e)===-1)&&(s=Fae([H1e],n,e,o)||s),!s&&e&&(s=G1e(t,null,r)),s}a(G1e,"addPageHideEventListener");function Dqe(t,e){var r=M7(Ten,e);$z([Rqe],t,r),$z([H1e],null,r)}a(Dqe,"removePageHideEventListener");function $1e(t,e,r){function n(c){var l=df();t&&l&&l.visibilityState==="visible"&&t(c)}a(n,"_handlePageVisibility");var o=M7(Ien,r),s=Fae([Cen],t,e,o);return s=Fae([H1e],n,e,o)||s,!s&&e&&(s=$1e(t,null,r)),s}a($1e,"addPageShowEventListener");function Nqe(t,e){var r=M7(Ien,e);$z([Cen],t,r),$z([H1e],null,r)}a(Nqe,"removePageShowEventListener");p();var Uae="",Ren="https://browser.events.data.microsoft.com/OneCollector/1.0/",$Ot="version",Mqe="properties";p();p();var VOt="initialize",WOt="indexOf",MM="timings",zOt="pollInternalLogs",uS="value",Oqe="length",Lqe="processTelemetryStart";var n3,ken="4.3.10",V1e="1DS-Web-JS-"+ken,Pen=xbe.hasOwnProperty;var gbo=(n3={},n3[0]=0,n3[2]=6,n3[1]=1,n3[3]=7,n3[4098]=6,n3[4097]=1,n3[4099]=7,n3);var Abo=RB(),ybo=wse();function _x(t){return!(t===Uae||Xt(t))}a(_x,"isValueAssigned");function YOt(t){if(t){var e=lu(t,"-");if(e>-1)return cM(t,e)}return Uae}a(YOt,"getTenantId");function KOt(t){return!!(t&&Dh(t)&&t>=1&&t<=4)}a(KOt,"isLatency");function JOt(t,e,r){if(!e&&!_x(e)||typeof t!="string")return null;var n=typeof e;if(n==="string"||n==="number"||n==="boolean"||ur(e))e={value:e};else if(n==="object"&&!Pen.call(e,"value"))e={value:r?JSON.stringify(e):e};else if(Xt(e[uS])||e[uS]===Uae||!Ei(e[uS])&&!Dh(e[uS])&&!Wk(e[uS])&&!ur(e[uS]))return null;if(ur(e[uS])&&!Nen(e[uS]))return null;if(!Xt(e.kind)){if(ur(e[uS])||!Den(e.kind))return null;e[uS]=e[uS].toString()}return e}a(JOt,"sanitizeProperty");function W1e(t,e,r){var n=-1;if(!Nn(t))if(e>0&&(e===32?n=8192:e<=13&&(n=e<<5)),Ebo(r))n===-1&&(n=0),n|=r;else{var o=gbo[Bqe(t)]||-1;n!==-1&&o!==-1?n|=o:o===6&&(n=o)}return n}a(W1e,"getCommonSchemaMetaData");function Qae(t,e,r,n,o){var s={},c=!1,l=0,u=arguments[Oqe],d=arguments;for(Wk(d[0])&&(c=d[0],l++);l0&&t<=13||t===32}a(Den,"isValueKind");function Ebo(t){return t>=0&&t<=9}a(Ebo,"isDataType");function Nen(t){return t[Oqe]>0}a(Nen,"isArrayValid");function Fqe(t,e){var r=t;r[MM]=r[MM]||{},r[MM][Lqe]=r[MM][Lqe]||{},r[MM][Lqe][e]=dS()}a(Fqe,"setProcessTelemetryTimings");function Bqe(t){var e=0;if(t!=null){var r=typeof t;r==="string"?e=1:r==="number"?e=2:r==="boolean"?e=3:r===lx&&(e=4,ur(t)?(e=4096,t[Oqe]>0&&(e|=Bqe(t[0]))):Pen.call(t,"value")&&(e=8192|Bqe(t[uS])))}return e}a(Bqe,"getFieldValueType");function ZOt(){return!!Di("chrome")}a(ZOt,"isChromium");function Vz(t){return t>0}a(Vz,"isGreaterThanZero");var _bo=T_({endpointUrl:Ren,propertyStorageOverride:{isVal:vbo}});function vbo(t){return t&&(!t.getProperty||!t.setProperty)&&Zc("Invalid property storage override passed."),!0}a(vbo,"_chkPropOverride");var XOt=(function(t){Wy(e,t);function e(){var r=t.call(this)||this;return Si(e,r,function(n,o){n[VOt]=function(s,c,l,u){Hp(n,function(){return"AppInsightsCore.initialize"},function(){try{o[VOt](jp(s,_bo,l||n.logger,!1).cfg,c,l,u)}catch(h){var d=n.logger,f=dr(h);f[WOt]("channels")!==-1&&(f+=` - - Channels must be provided through config.channels only!`),Ra(d,1,514,"SDK Initialization Failed - no telemetry will be sent: "+f)}},function(){return{config:s,extensions:c,logger:l,notificationManager:u}})},n.track=function(s){Hp(n,function(){return"AppInsightsCore.track"},function(){var c=s;if(c){c[MM]=c[MM]||{},c[MM].trackStart=dS(),KOt(c.latency)||(c.latency=1);var l=c.ext=c.ext||{};l.sdk=l.sdk||{},l.sdk.ver=V1e;var u=c.baseData=c.baseData||{};u[Mqe]=u[Mqe]||{};var d=u[Mqe];d[$Ot]=d[$Ot]||n.pluginVersionString||Uae}o.track(c)},function(){return{item:s}},!s.sync)},n[zOt]=function(s){return o[zOt](s||"InternalLog")}}),r}return a(e,"AppInsightsCore"),e.__ieDyn=1,e})(Iqe);p();p();var z1e="REAL_TIME",Men="NEAR_REAL_TIME",Oen="BEST_EFFORT";p();p();p();var lP="";var Uqe="drop",Len="send",e5t="requeue",Ben="rspFail",Fen="oth",t5t="no-cache, no-store",Qqe="application/x-json-stream",Y1e="cache-control",qae="content-type",Uen="kill-tokens",Qen="kill-duration";var qen="time-delta-millis",qqe="client-version",r5t="client-id",jqe="time-delta-to-apply-millis",Hqe="upload-time",Gqe="apikey",K1e="AuthMsaDeviceTicket",n5t="WebAuthToken",i5t="AuthXToken";var jen="NoResponseBody",jae="msfpc",o5t="trace",$qe="user";p();var J1e="allowRequestSending",Vqe="shouldAddClockSkewHeaders",Wqe="getClockSkewHeaderValue",Z1e="setClockSkew",Wo="length",OM="concat",fS="iKey",Yf="count",LM="events",Xm="push",BM="split",zqe="toLowerCase",Wz="hdrs",Yqe="useHdrs",zz="initialize",Kqe="setTimeoutOverride",Jqe="clearTimeoutOverride",Hen="payloadPreprocessor",s5t="overrideEndpointUrl",a5t="avoidOptions",Gen="disableEventTimings",Zqe="enableCompoundKey",c5t="disableXhrSync",l5t="disableFetchKeepAlive",$en="addNoResponse",u5t="useSendBeacon",d5t="fetchCredentials",f5t="alwaysUseXhrOverride",Xqe="serializeOfflineEvt",eje="getOfflineRequestDetails",tje="createPayload",X1e="createOneDSPayload",p5t="payloadBlob",uP="headers",Hae="_thePayload",Jy="batches",vC="sendType",eSe="canSendRequest",Gae="sendQueuedRequests",tSe="setUnloading",Ven="isTenantKilled",rje="sendSynchronousBatch",nje="_transport",$ae="getWParam",h5t="isBeacon",rSe="timings",ije="isTeardown",oje="_sendReason",sje="setKillSwitchTenants",aje="_backOffTransmission",nSe="identifier",Wen="ignoreMc1Ms0CookieProcessing",m5t="autoFlushEventsLimit",zen="disableAutoBatchFlushLimit",Yen="overrideInstrumentationKey",iSe="sendAttempt",O7="latency",Yz="sync";function Jen(t){var e=(t.ext||{}).intweb;return e&&_x(e[jae])?e[jae]:null}a(Jen,"_getEventMsfpc");function Ken(t){for(var e=null,r=0;e===null&&rEl()?!0:(delete s[c],!1)}})}return a(t,"KillSwitch"),t.__ieDyn=1,t})();p();var bbo=.8,Sbo=1.2,etn=3e3,Tbo=6e5;function ttn(t){return!(t>=300&&t<500&&t!=429||t==501||t==505)}a(ttn,"retryPolicyShouldRetryForStatus");function cje(t){var e=0,r=etn*bbo,n=etn*Sbo,o=Y1(Math.random()*(n-r))+r;return e=Math.pow(2,t)*o,QU(e,Tbo)}a(cje,"retryPolicyGetMillisToBackoffForRetry");p();var Ibo=20,xbo=3145728,ntn=65e3,itn=2e6,wbo=QU(itn,ntn),rtn="metadata",lje="f",Rbo=/\./,otn=(function(){function t(e,r,n,o,s,c,l){var u="data",d="baseData",f="ext",h=!!o,m=!0,g=r,A={},y=!!c,E=s||W1e,_=kbo(l),v=uje(_.requestLimit,xbo,0),b=uje(_.requestLimit,ntn,1),T=uje(_.recordLimit,itn,0),w=Math.min(uje(_.recordLimit,wbo,1),b);Si(t,this,function(R){R.createPayload=function(D,N,L,B,q,M){return{apiKeys:[],payloadBlob:lP,overflow:null,sizeExceed:[],failedEvts:[],batches:[],numEvents:0,retryCnt:D,isTeardown:N,isSync:L,isBeacon:B,sendType:M,sendReason:q}},R.appendPayload=function(D,N,L){var B=D&&N&&!D.overflow;return B&&Hp(e,function(){return"Serializer:appendPayload"},function(){for(var q=N.events(),M=D.payloadBlob,O=D.numEvents,j=!1,Q=[],U=[],Y=D.isBeacon,W=Y?b:v,V=Y?w:T,z=0,ie=0;z=L){D.overflow=N.split(z);break}var re=R.getEventBlob(H);if(re&&re.length<=V){var le=re.length,Le=M.length;if(Le+le>W){D.overflow=N.split(z);break}M&&(M+=` -`),M+=re,ie++,ie>Ibo&&(T7e(M,0,1),ie=0),j=!0,O++}else re?Q.push(H):U.push(H),q.splice(z,1),z--}z++}if(Q.length>0&&D.sizeExceed.push(L7.create(N.iKey(),Q)),U.length>0&&D.failedEvts.push(L7.create(N.iKey(),U)),j){D.batches.push(N),D.payloadBlob=M,D.numEvents=O;var ge=N.iKey();Vo(D.apiKeys,ge)===-1&&D.apiKeys.push(ge)}},function(){return{payload:D,theBatch:{iKey:N.iKey(),evts:N.events()},max:L}}),B},R.getEventBlob=function(D){try{return Hp(e,function(){return"Serializer.getEventBlob"},function(){var N={};N.name=D.name,N.time=D.time,N.ver=D.ver,N.iKey="o:"+YOt(D.iKey);var L={},B;y||(B=a(function(j,Q,U){Pbo(E,L,j,Q,U)},"_addMetadataCallback"));var q=D[f];q&&(N[f]=L,Yr(q,function(j,Q){var U=L[j]={};P(Q,U,"ext."+j,!0,null,null,!0)}));var M=N[u]={};M.baseType=D.baseType;var O=M[d]={};return P(D.baseData,O,d,!1,[d],B,m),P(D.data,M,u,!1,[],B,m),JSON.stringify(N)},function(){return{item:D}})}catch{return null}};function x(D,N){var L=A[D];return L===void 0&&(D.length>=7&&(L=kse(D,"ext.metadata")||kse(D,"ext.web")),A[D]=L),L}a(x,"_isReservedField");function P(D,N,L,B,q,M,O){Yr(D,function(j,Q){var U=null;if(Q||_x(Q)){var Y=L,W=j,V=q,z=N;if(h&&!B&&Rbo.test(j)){var ie=j.split("."),H=ie.length;if(H>1){V&&(V=V.slice());for(var re=0;re0&&n<=e)return n}return e}a(uje,"_validateSizeLimit");function kbo(t){var e={};return t&&t.requestLimit?t.requestLimit:e}a(kbo,"_getSizeLimtCfg");function Pbo(t,e,r,n,o){if(o&&e){var s=t(o.value,o.kind,o.propertyType);if(s>-1){var c=e[rtn];c||(c=e[rtn]={f:{}});var l=c[lje];if(l||(l=c[lje]={}),r)for(var u=0;u0)for(var o=e[zqe](),s=0;s0&&(n&&A5t[e]?(t[Wz][A5t[e]]=r,t[Yqe]=!0):t.url+="&"+e+"="+r)}a(Wae,"_addRequestDetails");function Obo(t,e,r){for(var n=0;n=0&&Q.splice(Se,1)},"rm")}},H[Xqe]=function(pe){try{if(b)return b.getEventBlob(pe)}catch{}return lP},H[eje]=function(){try{var pe=b&&b[tje](0,!1,!1,!1,1,0);return we(pe,x)}catch{}return null},H[X1e]=function(pe,Se){try{var Fe=[];Ct(pe,function(se){Se&&(se=RM(se));var me=L7.create(se[fS],[se]);Fe[Xm](me)});for(var te=null;Fe[Wo]>0&&b;){var Te=Fe.shift();Te&&Te[Yf]()>0&&(te=te||b[tje](0,!1,!1,!1,1,0),b.appendPayload(te,Te,ie))}var Ge=we(te,x),J={data:te[p5t],urlString:Ge.url,headers:Ge[Wz],timeout:P,disableXhrSync:N,disableFetchKeepAlive:L};return x&&(dje(J[uP],Y1e)||(J[uP][Y1e]=t5t),dje(J[uP],qae)||(J[uP][qae]=Qqe)),J}catch{}return null};function le(pe,Se){try{return V&&V.getSenderInst(pe,Se)}catch{}return null}a(le,"_getSenderInterface"),H._getDbgPlgTargets=function(){return[g[0],c,b,g,Le(),s,ie]};function Le(){try{var pe={xdrOnComplete:ge,fetchOnComplete:ke,xhrOnComplete:X,beaconOnRetry:K},Se={enableSendPromise:!1,isOneDs:!0,disableCredentials:!re,fetchCredentials:z,disableXhr:!1,disableBeacon:!d,disableBeaconSync:!d,disableFetchKeepAlive:L,timeWrapper:Y,addNoResponse:q,senderOnCompleteCallBack:pe};return Se}catch{}return null}a(Le,"_getSendPostMgrConfig");function ge(pe,Se,Fe){var te=kM(pe);ee(Se,200,{},te),F(te)}a(ge,"_xdrOncomplete");function Ue(){var pe;s=null,c=new Xen,l=!1,u=new Zen,d=!1,f=0,h=null,m=null,g=null,A=null,y=!0,E=[],_={},v=[],b=null,T=!1,w=null,R=!1,x=!1,P=pe,N=pe,L=pe,B=pe,q=pe,M=[],O=pe,j=pe,Q=[],U=!1,Y=Vae(),W=!1,V=null,ie=null}a(Ue,"_initDefaults");function ke(pe,Se,Fe,te){var Te=a(function(se,me,Ce){ee(Se,se,me,Ce),F(Ce)},"handleResponse"),Ge={},J=pe[uP];J&&J.forEach(function(se,me){Ge[me]=se}),Te(pe.status,Ge,Fe||lP)}a(ke,"_fetchOnComplete");function X(pe,Se,Fe){var te=kM(pe);ee(Se,pe.status,w7(pe,!0),te),F(te)}a(X,"_xhrOnComplete");function ee(pe,Se,Fe,te){try{pe(Se,Fe,te)}catch(Te){Ra(m,2,518,dr(Te))}}a(ee,"_doOnComplete");function K(pe,Se,Fe){var te=pe,Te=200,Ge=te[Hae],J=pe.urlString+(q?Dbo:lP);try{var se=Vu();if(Ge){var me=!!A.getPlugin("LocalStorage"),Ce=[],He=[];Ct(Ge[Jy],function($e){if(Ce&&$e&&$e[Yf]()>0)for(var et=$e[LM](),ct=0;ct0&&(Ge.sentEvts=He),me||be(Ce,8003,Ge[vC],!0)}else Te=0}catch($e){DM(m,"Failed to send telemetry using sendBeacon API. Ex:"+dr($e)),Te=0}finally{ee(Se,Te,{},lP)}}a(K,"_onBeaconRetry");function he(pe){return pe===2||pe===3}a(he,"_isBeaconPayload");function Z(pe){return R&&he(pe)&&(pe=2),pe}a(Z,"_adjustSendType"),H.addHeader=function(pe,Se){_[pe]=Se},H.removeHeader=function(pe){delete _[pe]},H[eSe]=function(){return ue()&&u[J1e]()},H[Gae]=function(pe,Se){Nn(pe)&&(pe=0),R&&(pe=Z(pe),Se=2),ne(v,pe,0)&&Ne(qe(),0,!1,pe,Se||0)},H.isCompletelyIdle=function(){return!l&&f===0&&v[Wo]===0},H[tSe]=function(pe){R=pe},H.addBatch=function(pe){if(pe&&pe[Yf]()>0){if(c.isTenantKilled(pe[fS]()))return!1;v[Xm](pe)}return!0},H.teardown=function(){v[Wo]>0&&Ne(qe(),0,!0,2,2),Ct(M,function(pe){pe&&pe.rm&&pe.rm()}),M=[]},H.pause=function(){l=!0},H.resume=function(){l=!1,H[Gae](0,4)},H[rje]=function(pe,Se,Fe){pe&&pe[Yf]()>0&&(Xt(Se)&&(Se=1),R&&(Se=Z(Se),Fe=2),Ne([pe],0,!1,Se,Fe||0))};function ue(){return!l&&f0&&!l&&g[Se]&&b&&(te=Se!==0||ue()&&(Fe>0||u[J1e]())),te}a(ne,"_canSendPayload");function ce(pe){var Se={};return pe&&Ct(pe,function(Fe,te){Se[te]={iKey:Fe[fS](),evts:Fe[LM]()}}),Se}a(ce,"_createDebugBatches");function Ne(pe,Se,Fe,te,Te){if(!(!pe||pe[Wo]===0)){if(l){be(pe,1,te);return}te=Z(te);try{var Ge=pe,J=te!==0;Hp(A,function(){return"HttpManager:_sendBatches"},function(se){se&&(pe=pe.slice(0));for(var me=[],Ce=null,He=dS(),$e=g[te]||(J?g[1]:g[0]),et=$e&&$e[nje],ct=B&&(R||he(te)||et===3||$e._isSync&&et===2);ne(pe,te,Se);){var bt=pe.shift();bt&&bt[Yf]()>0&&(c.isTenantKilled(bt[fS]())?me[Xm](bt):(Ce=Ce||b[tje](Se,Fe,J,ct,Te,te),b.appendPayload(Ce,bt,ie)?Ce.overflow!==null&&(pe=[Ce.overflow][OM](pe),Ce.overflow=null,rt(Ce,He,dS(),Te),He=dS(),Ce=null):(rt(Ce,He,dS(),Te),He=dS(),pe=[bt][OM](pe),Ce=null)))}Ce&&rt(Ce,He,dS(),Te),pe[Wo]>0&&(v=pe[OM](v)),be(me,8004,te)},function(){return{batches:ce(Ge),retryCount:Se,isTeardown:Fe,isSynchronous:J,sendReason:Te,useSendBeacon:he(te),sendType:te}},!J)}catch(se){Ra(m,2,48,"Unexpected Exception sending batch: "+dr(se))}}}a(Ne,"_sendBatches");function we(pe,Se){var Fe={url:s,hdrs:{},useHdrs:!1};Se?(Fe[Wz]=Qae(Fe[Wz],_),Fe.useHdrs=$u(Fe.hdrs)[Wo]>0):Yr(_,function(se,me){y5t[se]?Wae(Fe,y5t[se],me,!1):(Fe[Wz][se]=me,Fe[Yqe]=!0)}),Wae(Fe,r5t,"NO_AUTH",Se),Wae(Fe,qqe,V1e,Se);var te=lP;Ct(pe.apiKeys,function(se){te[Wo]>0&&(te+=","),te+=se}),Wae(Fe,Gqe,te,Se),Wae(Fe,Hqe,El().toString(),Se);var Te=Ie(pe);if(_x(Te)&&(Fe.url+="&ext.intweb.msfpc="+Te),u[Vqe]()&&Wae(Fe,jqe,u[Wqe](),Se),A[$ae]){var Ge=A[$ae]();Ge>=0&&(Fe.url+="&w="+Ge)}for(var J=0;J0){var Te=!!O,Ge=g[pe.sendType];!he(pe[vC])&&pe[h5t]&&pe.sendReason===2&&(Ge=g[2]||g[3]||Ge);var J=x;(pe.isBeacon||Ge[nje]===3)&&(J=!1);var se=we(pe,J);J=J||se[Yqe];var me=dS();Hp(A,function(){return"HttpManager:_doPayloadSend"},function(){for(var Ce=0;Ce0?ct[g5t]++:ct[g5t]=1}be(pe[Jy],1e3+(te||0),pe[vC],!0);var ht={data:pe[p5t],urlString:se.url,headers:se[Wz],_thePayload:pe,_sendReason:te,timeout:P,disableXhrSync:N,disableFetchKeepAlive:L};J&&(dje(ht[uP],Y1e)||(ht[uP][Y1e]=t5t),dje(ht[uP],qae)||(ht[uP][qae]=Qqe));var We=null;Ge&&(We=a(function(ae){u.firstRequestSent();var Re=a(function(ye,oe){_t(ye,oe,pe,te)},"onComplete"),Me=pe[ije]||pe.isSync;V.preparePayload(function(ye){try{Ge.sendPOST(ye,Re,Me),j&&j(ht,ye,Me,pe[h5t])}catch(oe){ee(Re,0,{}),DM(m,"Unexpected exception sending payload. Ex:"+dr(oe))}},D,ae,Me)},"sender")),Hp(A,function(){return"HttpManager:_doPayloadSend.sender"},function(){if(We)if(pe[vC]===0&&f++,Te&&!pe.isBeacon&&Ge[nje]!==3){var ae={data:ht.data,urlString:ht.urlString,headers:Qae({},ht[uP]),timeout:ht.timeout,disableXhrSync:ht[c5t],disableFetchKeepAlive:ht[l5t]},Re=!1;Hp(A,function(){return"HttpManager:_doPayloadSend.sendHook"},function(){try{O(ae,function(Me){Re=!0,!y&&!Me[Hae]&&(Me[Hae]=Me[Hae]||ht[Hae],Me[oje]=Me[oje]||ht[oje]),We(Me)},pe.isSync||pe[ije])}catch{Re||We(ht)}})}else We(ht)})},function(){return{thePayload:pe,serializationStart:Se,serializationCompleted:Fe,sendReason:te}},pe.isSync)}pe.sizeExceed&&pe.sizeExceed[Wo]>0&&be(pe.sizeExceed,8003,pe[vC]),pe.failedEvts&&pe.failedEvts[Wo]>0&&be(pe.failedEvts,8002,pe[vC])}a(rt,"_doPayloadSend");function st(pe,Se){T&&Ct(pe,function(Fe){var te=Fe[rSe]=Fe[rSe]||{};Be(te,"sendEventCompleted",Se)})}a(st,"_addEventCompletedTimings");function _t(pe,Se,Fe,te){var Te=9e3,Ge=null,J=!1,se=!1;try{var me=!0;if(typeof pe!==eS){if(Se){u[Z1e](Se[qen]);var Ce=Se[Qen]||Se["kill-duration-seconds"];Ct(c[sje](Se[Uen],Ce),function($e){Ct(Fe[Jy],function(et){if(et[fS]()===$e){Ge=Ge||[];var ct=et[BM](0);Fe.numEvents-=ct[Yf](),Ge[Xm](ct)}})})}if(pe==200||pe==204){Te=200;return}(!ttn(pe)||Fe.numEvents<=0)&&(me=!1),Te=9e3+pe%1e3}if(me){Te=100;var He=Fe.retryCnt;Fe[vC]===0&&(He0&&st(Fe[LM](),Se)})}}a($t,"_addCompleteTimings");function Gt(pe,Se,Fe){Se?pe():Y.set(pe,Fe)}a(Gt,"_doAction");function Ie(pe){for(var Se=0;Se0&&o){var Te=o[Qe(Se)];if(Te){var Ge=Fe!==0;Hp(A,function(){return"HttpManager:_sendBatchesNotification"},function(){Gt(function(){try{Te.call(o,pe,Se,Ge,Fe)}catch(J){Ra(m,1,74,"send request notification failed: "+J)}},te||Ge,0)},function(){return{batches:ce(pe),reason:Se,isSync:Ge,sendSync:te,sendType:Fe}},!Ge)}}}a(be,"_sendBatchesNotification");function Qe(pe){var Se=Mbo[pe];return _x(Se)||(Se=Fen,pe>=9e3&&pe<=9999?Se=Ben:pe>=8e3&&pe<=8999?Se=Uqe:pe>=1e3&&pe<=1999&&(Se=Len)),Se}a(Qe,"_getNotificationAction")})}return a(t,"HttpManager"),t.__ieDyn=1,t})();var Bbo=.25,ltn=500,Fbo=20,utn=6,dtn=2,Ubo=4,atn=2,Qbo=1,E5t=1e4,Zz="eventsDiscarded",ctn="",Fh=void 0,qbo=T_({eventsLimitInMem:{isVal:Vz,v:E5t},immediateEventLimit:{isVal:Vz,v:500},autoFlushEventsLimit:{isVal:Vz,v:0},disableAutoBatchFlushLimit:!1,httpXHROverride:{isVal:jbo,v:Fh},overrideInstrumentationKey:Fh,overrideEndpointUrl:Fh,disableTelemetry:!1,ignoreMc1Ms0CookieProcessing:!1,setTimeoutOverride:Fh,clearTimeoutOverride:Fh,payloadPreprocessor:Fh,payloadListener:Fh,disableEventTimings:Fh,valueSanitizer:Fh,stringifyObjects:Fh,enableCompoundKey:Fh,disableOptimizeObj:!1,fetchCredentials:Fh,transports:Fh,unloadTransports:Fh,useSendBeacon:Fh,disableFetchKeepAlive:Fh,avoidOptions:!1,xhrTimeout:Fh,disableXhrSync:Fh,alwaysUseXhrOverride:!1,maxEventRetryAttempts:{isVal:Dh,v:utn},maxUnloadEventRetryAttempts:{isVal:Dh,v:dtn},addNoResponse:Fh,maxEvtPerBatch:{isVal:Dh,v:ltn},excludeCsMetaData:Fh,requestLimit:{}});function jbo(t){return t&&t.sendPOST}a(jbo,"isOverrideFn");var _5t=(function(t){Wy(e,t);function e(){var r=t.call(this)||this;r.identifier="PostChannel",r.priority=1011,r.version="4.3.10";var n,o=!1,s=[],c,l=!1,u=0,d,f=0,h,m={},g=z1e,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,q,M,O,j,Q,U,Y,W;return Si(e,r,function(V,z){he(),V._getDbgPlgTargets=function(){return[v,n]},V[zz]=function(J,se,me){Hp(se,function(){return"PostChannel:initialize"},function(){z[zz](J,se,me),j=se.getNotifyMgr();try{B=M7(yx(V[nSe]),se.evtNamespace&&se.evtNamespace()),V._addHook(lS(J,function(Ce){var He=Ce.cfg,$e=Ex(null,He,se);n=$e.getExtCfg(V[nSe],qbo),q=Vae(n[Kqe],n[Jqe]),P=!n.disableOptimizeObj&&ZOt(),M=n[Wen],H(se),h=n.eventsLimitInMem,d=n.immediateEventLimit,T=n[m5t],N=n.maxEventRetryAttempts,L=n.maxUnloadEventRetryAttempts,O=n[zen],W=n.maxEvtPerBatch,tg(He.endpointUrl)?V.pause():l&&V.resume(),Ge(),U=n[Yen],Y=!!n.disableTelemetry,Q&&ie();var et=He.disablePageUnloadEvents||[];Q=kqe(Le,et,B),Q=G1e(Le,et,B)||Q,Q=$1e(ge,He.disablePageShowEvents,B)||Q})),v[zz](J,V.core,V)}catch(Ce){throw V.setInitialized(!1),Ce}},function(){return{theConfig:J,core:se,extensions:me}})},V.processTelemetry=function(J,se){Fqe(J,V[nSe]),se=se||V._getTelCtx(se);var me=J;!Y&&!o&&(U&&(me[fS]=U),ke(me,!0),D?qe(2,2):K()),V.processNext(me,se)},V.getOfflineSupport=function(){try{var J=v&&v[eje]();if(v)return{getUrl:a(function(){return J?J.url:null},"getUrl"),serialize:le,batch:re,shouldProcess:a(function(se){return!Y},"shouldProcess"),createPayload:a(function(se){return null},"createPayload"),createOneDSPayload:a(function(se){if(v[X1e])return v[X1e](se,P)},"createOneDSPayload")}}catch{}return null},V._doTeardown=function(J,se){qe(2,2),o=!0,v.teardown(),ie(),he()};function ie(){Pqe(null,B),Dqe(null,B),Nqe(null,B)}a(ie,"_removeUnloadHandlers");function H(J){var se=J[$ae];J[$ae]=function(){var me=0;return M&&(me=me|2),me|se.call(J)}}a(H,"_hookWParam");function re(J){var se=ctn;return J&&J[Wo]&&Ct(J,function(me){se&&(se+=` -`),se+=me}),se}a(re,"_batch");function le(J){var se=ctn;try{Ue(J),se=v[Xqe](J)}catch{}return se}a(le,"_serialize");function Le(J){var se=J||ff().event;se.type!=="beforeunload"&&(D=!0,v[tSe](D)),qe(2,2)}a(Le,"_handleUnloadEvents");function ge(J){D=!1,v[tSe](D)}a(ge,"_handleShowEvents");function Ue(J){J.ext&&J.ext[o5t]&&delete J.ext[o5t],J.ext&&J.ext[$qe]&&J.ext[$qe].id&&delete J.ext[$qe].id,P&&(J.ext=RM(J.ext),J.baseData&&(J.baseData=RM(J.baseData)),J.data&&(J.data=RM(J.data)))}a(Ue,"_cleanEvent");function ke(J,se){if(J[iSe]||(J[iSe]=0),J[O7]||(J[O7]=1),Ue(J),J[Yz]){if(E||l)J[O7]=3,J[Yz]=!1;else if(v){P&&(J=RM(J)),v[rje](L7.create(J[fS],[J]),J[Yz]===!0?1:J[Yz],3);return}}var me=J[O7],Ce=f,He=h;me===4&&(Ce=u,He=d);var $e=!1;if(CeJ;if(!me&&w>0)for(var Ce=1;!me&&Ce<=3;Ce++){var He=b[Ce];He&&He[Jy]&&Ct(He[Jy],function($e){$e&&$e[Yf]()>=w&&(me=!0)})}Ne(!0,me)},V.pause=function(){ue(),l=!0,v&&v.pause()},V.resume=function(){l=!1,v&&v.resume(),K()},V._loadTransmitProfiles=function(J){$t(),Yr(J,function(se,me){var Ce=me[Wo];if(Ce>=2){var He=Ce>2?me[2]:0;if(me.splice(0,Ce-2),me[1]<0&&(me[0]=-1),me[1]>0&&me[0]>0){var $e=me[0]/me[1];me[0]=ZKr($e)*me[1]}He>=0&&me[1]>=0&&He>me[1]&&(He=me[1]),me[Xm](He),m[se]=me}})},V.flush=function(J,se,me){J===void 0&&(J=!0);var Ce;if(!l)if(me=me||1,J)se||(Ce=Dd(function($e){se=$e})),c==null?(ue(),st(1,0,me),c=Z(function(){c=null,_t(se,me)},0)):s[Xm](se);else{var He=ue();X(1,1,me),se&&se(),He&&K()}return Ce},V.setMsaAuthTicket=function(J){v.addHeader(K1e,J)},V.setAuthPluginHeader=function(J){v.addHeader(n5t,J)},V.removeAuthPluginHeader=function(){v.removeHeader(n5t)},V.hasEvents=ee,V._setTransmitProfile=function(J){g!==J&&m[J]!==void 0&&(ue(),g=J,K())},x7(V,function(){return v},["addResponseHandler"]);function X(J,se,me){var Ce=st(J,se,me);return v[Gae](se,me),Ce}a(X,"_sendEventsForLatencyAndAbove");function ee(){return f>0}a(ee,"_hasEvents");function K(){if(R>=0&&st(R,0,x)&&v[Gae](0,x),u>0&&!y&&!l){var J=m[g][2];J>=0&&(y=Z(function(){y=null,X(4,0,1),K()},J))}var se=m[g][1];!A&&!c&&se>=0&&!l&&(ee()?A=Z(function(){A=null,X(_===0?3:1,0,1),_++,_%=2,K()},se):_=0)}a(K,"_scheduleTimer"),V[aje]=function(){E0&&f>T&&(se=!0),se&&c==null&&V.flush(J,function(){},20))}a(Ne,"_performAutoFlush");function we(J,se){P&&(J=RM(J));var me=J[O7],Ce=ce(J[fS],me,!0);return Ce.addEvent(J)?(me!==4?(f++,se&&J[iSe]===0&&Ne(!J.sync,w>0&&Ce[Yf]()>=w)):u++,!0):!1}a(we,"_addEventToProperQueue");function Be(J,se,me,Ce){for(;me<=se;){var He=ce(J,se,!0);if(He&&He[Yf]()>0){var $e=He[BM](0,Ce),et=$e[Yf]();if(et>0)return me===4?u-=et:f-=et,Qe(Zz,[$e],CM.QueueFull),!0}me++}return rt(),!1}a(Be,"_dropEventWithLatencyOrLess");function rt(){for(var J=0,se=0,me=a(function(He){var $e=b[He];$e&&$e[Jy]&&Ct($e[Jy],function(et){He===4?J+=et[Yf]():se+=et[Yf]()})},"_loop_1"),Ce=1;Ce<=4;Ce++)me(Ce);f=se,u=J}a(rt,"_resetQueueCounts");function st(J,se,me){var Ce=!1,He=se===0;return!He||v[eSe]()?Hp(V.core,function(){return"PostChannel._queueBatches"},function(){for(var $e=[],et=4;et>=J;){var ct=b[et];ct&&ct.batches&&ct.batches[Wo]>0&&(Ct(ct[Jy],function(bt){v.addBatch(bt)?Ce=Ce||bt&&bt[Yf]()>0:$e=$e[OM](bt[LM]()),et===4?u-=bt[Yf]():f-=bt[Yf]()}),ct[Jy]=[],ct.iKeyMap={}),et--}$e[Wo]>0&&be(Zz,$e,CM.KillSwitch),Ce&&R>=J&&(R=-1,x=0)},function(){return{latency:J,sendType:se,sendReason:me}},!He):(R=R>=0?QU(R,J):J,x=zk(x,me)),Ce}a(st,"_queueBatches");function _t(J,se){X(1,0,se),rt(),Dt(function(){J&&J(),s[Wo]>0?c=Z(function(){c=null,_t(s.shift(),se)},0):(c=null,K())})}a(_t,"_flushImpl");function Dt(J){v.isCompletelyIdle()?J():c=Z(function(){c=null,Dt(J)},Bbo)}a(Dt,"_waitForIdleManager");function $t(){ue(),Gt(),g=z1e,K()}a($t,"_resetTransmitProfiles");function Gt(){m={},m[z1e]=[2,1,0],m[Men]=[6,3,0],m[Oen]=[18,9,0]}a(Gt,"_initializeProfiles");function Ie(J,se){var me=[],Ce=N;D&&(Ce=L),Ct(J,function(He){He&&He[Yf]()>0&&Ct(He[LM](),function($e){$e&&($e[Yz]&&($e[O7]=4,$e[Yz]=!1),$e[iSe]0&&be(Zz,me,CM.NonRetryableStatus),D&&qe(2,2)}a(Ie,"_requeueEvents");function F(J,se){var me=j||{},Ce=me[J];if(Ce)try{Ce.apply(me,se)}catch(He){Ra(V.diagLog(),1,74,J+" notification failed: "+He)}}a(F,"_callNotification");function be(J,se){for(var me=[],Ce=2;Ce0&&F(J,[se][OM](me))}a(be,"_notifyEvents");function Qe(J,se){for(var me=[],Ce=2;Ce0&&Ct(se,function(He){He&&He[Yf]()>0&&F(J,[He.events()][OM](me))})}a(Qe,"_notifyBatchEvents");function pe(J,se,me){J&&J[Wo]>0&&F("eventsSendRequest",[se>=1e3&&se<=1999?se-1e3:0,me!==!0])}a(pe,"_sendingEvent");function Se(J,se){Qe("eventsSent",J,se),K()}a(Se,"_eventsSentEvent");function Fe(J,se){Qe(Zz,J,se>=8e3&&se<=8999?se-8e3:CM.Unknown)}a(Fe,"_eventsDropped");function te(J){Qe(Zz,J,CM.NonRetryableStatus),K()}a(te,"_eventsResponseFail");function Te(J,se){Qe(Zz,J,CM.Unknown),K()}a(Te,"_otherEvent");function Ge(){O?w=0:w=zk(W*(atn+1),h/6)}a(Ge,"_setAutoLimits")}),r}return a(e,"PostChannel"),e.__ieDyn=1,e})(Bae);var pS=de(require("os"));var fje=class{constructor(e,r,n,o=!0,s){this.ctx=e;this.namespace=r;this.internalOnly=o;this.onCopilotToken=a(async e=>{this.token=e,this.commonProperties["common.isinternal"]=e?.isInternalUser()?"true":"false",await this.refreshGitHubHandleInCommonProperties();let r=e.getTokenValue("tid");r!==void 0&&(this.tags["ai.user.id"]=r)},"onCopilotToken");this.client=this.initializeClient(n),this.tags=Hbo(e),this.commonProperties=Gbo(e),this.#e=bs(e,this.onCopilotToken),s&&this.onCopilotToken(s)}static{a(this,"Msft1dsReporter")}#e;initializeClient(e){try{let r=new XOt,n=new _5t,o={instrumentationKey:e,loggingLevelTelemetry:0,loggingLevelConsole:0,disableCookiesUsage:!0,disableDbgExt:!0,disableInstrumentationKeyValidation:!0,channels:[[n]]},s={alwaysUseXhrOverride:!0,httpXHROverride:this.createXhrOverride()};return o.extensionConfig={},o.extensionConfig[n.identifier]=s,r.initialize(o,[]),r.addTelemetryInitializer(c=>{let l=c.ext??{},u=l.web??{};u.consentDetails='{"GPC_DataSharingOptIn":false}',l.web=u,c.ext=l,c.tags={...c.tags??{},...this.tags}}),r}catch(r){Nr.error(this.ctx,"Failed to initialize MSFT 1DS reporter",r)}}sendTelemetryEvent(e,r,n){if(!this.client||this.internalOnly&&!this.token?.isInternalUser())return;r={...r,...this.commonProperties};let o=this.qualifyEventName(e);try{this.client.track({name:o,baseData:{name:o,properties:r,measurements:n}})}catch(s){Nr.debug(this.ctx,"Error tracking telemetry event",s)}}sendTelemetryErrorEvent(e,r,n){this.sendTelemetryEvent(this.qualifyEventName(e),r,n)}async dispose(){this.#e.dispose(),await this.client?.unload(!0,void 0,200)}qualifyEventName(e){return e.startsWith(this.namespace)?e:`${this.namespace}/${e}`}async refreshGitHubHandleInCommonProperties(){try{let e=await this.ctx.get(Ur).resolveSession();e?.login?this.commonProperties["common.github_handle"]=e.login:delete this.commonProperties["common.github_handle"]}catch(e){Nr.debug(this.ctx,"Error resolving GitHub handle for telemetry",e)}}createXhrOverride(){return{sendPOST:a((e,r)=>{if(typeof e.data!="string")throw new Error(`Telemetry reporter only supports string payloads, received ${typeof e.data}`);let n=e.headers??{};n["Content-Type"]="application/json";let o={method:"POST",headers:n,body:e.data};this.ctx.get(tr).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Nr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")}}};function Hbo(t){let e={},r=t.get(Ua);e["ai.session.id"]=r.sessionId;let n=t.get(Op);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${pS.type()} ${pS.release()}`,e["ai.device.osArchitecture"]=pS.arch(),e["ai.device.osPlatform"]=pS.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(ds).getVersion(),e}a(Hbo,"getTags");function Gbo(t){let e={};e.common_os=pS.platform(),e.common_platformversion=pS.release(),e.common_arch=pS.arch(),e.common_cpu=Array.from(new Set(pS.cpus().map(n=>n.model))).join();let r=t.get(Ua);return e.common_vscodemachineid=r.machineId,e.common_vscodesessionid=r.sessionId,e.client_deviceid=r.devDeviceId,e.common_uikind=r.uiKind,e.common_remotename=r.remoteName,e.common_isnewappinstall="",e}a(Gbo,"getCommonProperties");var $bo="7d7048df-6dd0-4048-bb23-b716c1461f8f",Vbo="3fdd7f28-937a-48c8-9a21-ba337db23bd1",Wbo="b73649cf-ca8f-4768-9e0e-b789d8529db5",zbo="5fb6107a-6a29-423f-a824-22e3724fa2a6",Ybo="ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917";function Kbo(t){return MU(t)==="prod"?Wbo:zbo}a(Kbo,"getMsftInstrumentationKey");function ftn(t){return new URL(t).hostname==="github.com"?VW.telemetry:t.replace("://","://copilot-telemetry-service.")}a(ftn,"getEndpointForServerUrl");var pf=class{constructor(e,r){this.ctx=e;this.namespace=r;this.serverUrl="https://github.com/";this.rootUrl=ftn(this.serverUrl);this.shuttingDown=new Set;this.initListeners=[];bs(e,n=>{this.cachedToken=n,this.updateServiceEndpoints(n.endpoints)})}static{a(this,"TelemetryInitialization")}get endpointUrl(){return this.overrideEndpointUrlForTesting||new URL("telemetry",this.rootUrl).href}get isInitialized(){return this.initializedWith!==void 0}get isEnabled(){return this._enabled??!1}initialize(e){let r=this.ctx;this._enabled=e;let n=this.endpointUrl;if(!(this.initializedWith?.enabled===this._enabled&&this.initializedWith?.endpointUrl===this.endpointUrl)&&(this.shutdownWithoutWaiting(),this.initializedWith={endpointUrl:n,enabled:this._enabled},e)){let o=r.get(X0);if(o.setReporter(new fae(r,this.namespace,{instrumentationKey:$bo,endpointUrl:n})),o.setRestrictedReporter(new fae(r,this.namespace,{instrumentationKey:Vbo,endpointUrl:n})),o.setMsftReporter(new fae(r,`copilot/${this.namespace}`,{instrumentationKey:Kbo(r),excludeCommonTags:!0,excludeCommonProperties:!0})),o.setMsft1pReporter(new fje(r,"ThirdParty.copilot-chat",Ybo,!0,this.cachedToken)),this.initListeners){let s=this.initListeners;this.initListeners=void 0;for(let c of s)try{c()}catch{}}}}onInitialized(e){if(this.initListeners)this.initListeners.push(e);else try{e()}catch{}}setCustomReporters(e,r){this.shutdownWithoutWaiting();let n=this.ctx.get(X0);n.setReporter(e),n.setRestrictedReporter(r)}async shutdown(){this.shutdownWithoutWaiting(),await Promise.all(this.shuttingDown)}shutdownWithoutWaiting(){this.initializedWith=void 0;let e=this.ctx.get(X0).deactivate().finally(()=>{this.shuttingDown.delete(e)});this.shuttingDown.add(e)}updateSessionConfig(e){e?.serverUrl&&e.serverUrl!==this.serverUrl&&(this.serverUrl=e.serverUrl,this.rootUrl=ftn(e.serverUrl)),this.isInitialized&&this.initialize(this._enabled)}updateServiceEndpoints(e){this.rootUrl=e.telemetry,this.isInitialized&&this.initialize(this._enabled)}};async function Jbo(t,e){let r="copilot_internal/subscribe_limited_user";try{return(await(await Gf(t,e,r,{method:"POST",headers:{"X-GitHub-Api-Version":"2025-05-01"},body:JSON.stringify({restricted_telemetry:t.get(pf).isEnabled?"enabled":"disabled",public_code_suggestions:"enabled"})})).json()).subscribed}catch(n){return b_.exception(t,n,"signUpLimited failed"),!1}}a(Jbo,"apiFetchSignUpLimited");async function C5t(t,e,r){let n=await t.get(Qt).getTokenResult();switch(n.failureKind){case void 0:return"OK";case"HTTP401":case"NotSignedIn":return"NotSignedIn";case"NotAuthorized":return r&&n.canSignUpForLimited&&await Jbo(t,e)?C5t(t,e,!1):"NotAuthorized";case"Exception":throw n.exception}}a(C5t,"getTokenWithSignUpLimited");p();p();var ptn=de(ri());var Wi=class extends ptn.Emitter{static{a(this,"Emitter")}get event(){return super.event}};var Zbo={didChangeFeatureFlags:!1,fetch:!1,ipCodeCitation:!1,redirectedTelemetry:!1,related:!1,token:!1,watchedFiles:!1,showPanelMessage:!1,mcpElicitation:!1,mcpSampling:!1,mcpAllowlist:!1,stateDatabase:!1,subAgent:!1,mcpServerManagement:!1,cveRemediatorAgent:!1,debuggerAgent:!1,contentProvider:[],manageTodoListTool:!1,agentDebugLog:!1,accountPickerEnabled:!1},bn=class{constructor(){this.capabilities={...Zbo};this.emitter=new Wi;this.onDidSetCapabilities=this.emitter.event}static{a(this,"CopilotCapabilitiesProvider")}setCapabilities(e){let r;for(r in e){let n=e[r];n!==void 0&&(this.capabilities[r]=n)}this.emitter.fire(this.capabilities)}getCapabilities(){return this.capabilities}};p();var i3=require("fs"),zae=require("os"),Yae=de(require("path")),B7=require("process");var Yn=class{static{a(this,"PersistenceManager")}},b5t=class extends Yn{constructor(r){super();this.directory=r}static{a(this,"FilePersistenceManager")}async read(r,n){try{return(await this.readJsonObject(r))[n]}catch{return}}async update(r,n,o){await i3.promises.mkdir(this.directory,{recursive:!0,mode:448});let s=`${this.directory}/${r}.json`,c=Yae.dirname(s);c!==this.directory&&await i3.promises.mkdir(c,{recursive:!0,mode:448});let l;try{l=await oSe.acquire(s);let u=await this.readJsonObject(r);u[n]=o,await i3.promises.writeFile(s,JSON.stringify(u)+` -`,{encoding:"utf8",mode:384})}finally{l&&await l()}}async delete(r,n){let o=`${this.directory}/${r}.json`,s;try{s=await oSe.acquire(o);let c=await this.readJsonObject(r);delete c[n];let l=JSON.stringify(c)+` +`)}`}}let l=t.get(Ir).getEditorInfo(),u;l.root&&(u=[{prefix:`${l.name}:`,path:l.root}]);let d=kse(t),f=D$r(c,u,d),h=R_o(c),m=h==="exception",g=Vt.createAndMarkAsIssued({origin:n??"",type:c.name,code:`${c.code??""}`,reason:f.stack||f.toString(),message:f.message,...o});if(await g.makeReadyForSending(t,0,"IncludeExp",r),s?.exception_detail)for(let y of s.exception_detail)y.value&&(d?y.value=BPt(y.value):y.value="[redacted]");s??=g$r(t,f,n),s.context={...s.context,"copilot_event.unique_id":g.properties.unique_id,"#restricted_telemetry":d?"true":"false"},s.rollup_id!=="auto"&&(g.properties.errno=s.rollup_id),s.created_at=new Date(g.issuedTime).toISOString();let A=s.rollup_id==="auto"?c.stack??"":s.rollup_id;if(!t.get(aM).isThrottled(A)){if(d){let y=P$r(c,u),E=Vt.createAndMarkAsIssued({origin:n??"",type:c.name,code:`${c.code??""}`,reason:y.stack||y.toString(),message:y.message,...o});s.rollup_id!=="auto"&&(E.properties.errno=s.rollup_id),await E.makeReadyForSending(t,1,"IncludeExp",r),E.properties.unique_id=g.properties.unique_id,g.properties.restricted_unique_id=E.properties.unique_id,Ibe(t,1,`error.${h}`,E)}m&&(g.properties.failbot_payload=JSON.stringify(s)),Ibe(t,0,`error.${h}`,g)}}a(wJr,"_telemetryException");function K0(t,e,r,n){let o=a(async(...s)=>{try{await e(...s)}catch(c){await wJr(t,c,El(),r,n)}},"wrapped");return(...s)=>t.get(Dd).register(o(...s))}a(K0,"telemetryCatch");function rg(t,e,r,n){return t.get(Dd).register(L_o(t,e,El(),r?.extendedBy(),n))}a(rg,"telemetryError");async function L_o(t,e,r,n,o=0){if(Tbe(o)&&!kse(t))return;let s=n||Vt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o,"IncludeExp",r),P_o(t,o,e,s)}a(L_o,"_telemetryError");function RJr(t,e,r,n,o,s){let c={completionTextJson:JSON.stringify(e),choiceIndex:o.toString()},l=s?.properties?.engineName;l&&(c.engineName=l,c.modelId=l);let u=Vt.createAndMarkAsIssued(c);if(r.logprobs)for(let[d,f]of Object.entries(r.logprobs))u.properties["logprobs_"+d]=JSON.stringify(f)??"unset";return u.extendWithRequestId(n),ft(t,"engine.completion",u,1)}a(RJr,"logEngineCompletion");function kJr(t,e,r){let n={promptJson:JSON.stringify({prefix:e.prefix,context:e.context}),promptSuffixJson:JSON.stringify(e.suffix)};if(e.context){let s=r.properties["request.option.extra"]?JSON.parse(r.properties["request.option.extra"]):{};s.context=e.context,n["request.option.extra"]=JSON.stringify(s)}let o=r.extendedBy(n);return ft(t,"engine.prompt",o,1)}a(kJr,"logEnginePrompt");function B_o(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);if(t&&typeof t=="object"){let e=t,r;if(typeof e.message=="string")r=e.message;else try{r=JSON.stringify(e)}catch{r="Unknown error"}let n=new Error(r);return n.name=typeof e.name=="string"?e.name:typeof t,typeof e.stack=="string"&&(n.stack=e.stack),n}return new Error("Unknown error")}a(B_o,"buildErrorFromUnknown");p();var ez=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function Ym(t){return!t||typeof t!="object"?!1:t instanceof ez||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(Ym,"isAbortError");var Dse=class extends SyntaxError{constructor(r,n){super(r);this.code=n;this.name="JsonParseError"}static{a(this,"JsonParseError")}},cx=class extends Error{static{a(this,"FetchResponseError")}constructor(e,r=`HTTP ${e.status} ${e.statusText}`){super(r),this.name="FetchResponseError",this.code=`HTTP${e.status}`}},F_o=new Set(["ECONNABORTED","ECONNRESET","EHOSTUNREACH","ENETUNREACH","ENOTCONN","ENOTFOUND","ETIMEDOUT","ERR_HTTP2_STREAM_ERROR","ERR_SSL_BAD_DECRYPT","ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC","ERR_SSL_INVALID_LIBRARY_(0)","ERR_SSL_SSLV3_ALERT_BAD_RECORD_MAC","ERR_SSL_WRONG_VERSION_NUMBER","ERR_STREAM_PREMATURE_CLOSE","ERR_TLS_CERT_ALTNAME_INVALID"]);function ax(t,e=!0){return t instanceof Error?e&&"cause"in t&&ax(t.cause,!1)?!0:t.name==="EditorFetcherError"||t.name==="FetchError"||t instanceof Dse||t instanceof cx||t?.message?.startsWith("net::")||F_o.has(t.code??""):!1}a(ax,"isNetworkError");var lx=class{constructor(e,r,n,o,s){this.status=e;this.statusText=r;this.headers=n;this.getText=o;this.getBody=s;this.ok=this.status>=200&&this.status<300;this.clientError=this.status>=400&&this.status<500}static{a(this,"Response")}async text(){return this.getText()}async json(){let e=await this.text(),r=this.headers.get("content-type");if(!r||!r.includes("json"))throw new Dse(`Response content-type is ${r??"missing"} (status=${this.status})`,`ContentType=${r}`);try{return JSON.parse(e)}catch(n){if(n instanceof SyntaxError){let o=n.message.match(/^(.*?) in JSON at position (\d+)(?: \(line \d+ column \d+\))?$/);if(o&&parseInt(o[2],10)==e.length||n.message==="Unexpected end of JSON input"){let s=new TextEncoder().encode(e).length,c=this.headers.get("content-length");throw c===null?new Dse(`Response body truncated: actualLength=${s}`,"Truncated"):new Dse(`Response body truncated: actualLength=${s}, headerLength=${c}`,"Truncated")}}throw n}}body(){return this.getBody()}};function mM(t){let e=t.headers.get("retry-after");if(!e)return;let r=Number.parseFloat(e);if(Number.isFinite(r)&&r>=0)return r;let n=Date.parse(e);if(Number.isNaN(n))return;let o=n-Date.now();return o<=0?0:o/1e3}a(mM,"parseRetryAfterSeconds");var nr=class{static{a(this,"Fetcher")}getImplementation(){return this}};function tz(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={...l,...m?{}:{Authorization:`Bearer ${r}`},...zy(t)};d===void 0&&(g["Openai-Organization"]="github-copilot",g["X-Request-Id"]=o,g["VScode-SessionId"]=t.get(qa).sessionId,g["VScode-MachineId"]=t.get(qa).machineId,g["X-GitHub-Api-Version"]="2026-01-09"),n&&(g["OpenAI-Intent"]=n);let A={method:"POST",headers:g,json:s,timeout:u};f&&h&&f.logRequest({timestamp:new Date().toISOString(),requestId:o,method:"POST",url:e,headers:g,messages:h,body:s});let y=t.get(nr);if(c){let _=new AbortController;c.onCancellationRequested(()=>{ft(t,"networking.cancelRequest",Vt.createAndMarkAsIssued({headerRequestId:o})),_.abort()}),A.signal=_.signal}return y.fetch(e,A).catch(_=>{if(U_o(_))return ft(t,"networking.disconnectAll"),y.disconnectAll().then(()=>y.fetch(e,A));throw _})}a(tz,"postRequest");function U_o(t){return t instanceof Error?t.message=="ERR_HTTP2_GOAWAY_SESSION"?!0:"code"in t?t.code=="ECONNRESET"||t.code=="ETIMEDOUT"||t.code=="ERR_HTTP2_INVALID_SESSION":!1:!1}a(U_o,"isInterruptedNetworkError");p();function P7e(){return typeof process>"u"}a(P7e,"isWeb");function wB(){return typeof process<"u"&&process.env.MSBENCH_MODE==="true"}a(wB,"isMsBenchModeEnabled");var aNt=class extends cx{static{a(this,"ProxiedResponseError")}constructor(e){super(e,`HTTP ${e.status} response does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`)}};async function Bd(t,e,r,n={}){n={...n,headers:{Authorization:`Bearer ${e.accessToken}`,...P7e()?{}:zy(t),...n.headers}};let o=await t.get(nr).fetch(new URL(r,e.apiUrl).href,n);if(o.status>=500)throw new cx(o);if(!o.headers.get("x-github-request-id"))throw new aNt(o);return o}a(Bd,"apiFetch");p();p();var es=class{constructor(){this.recentNotifications=new Cn(100)}static{a(this,"NotificationSender")}async showWarningMessageOnlyOnce(e,r,...n){if(!this.recentNotifications.has(e??r))return this.recentNotifications.set(e??r,!0),this.showWarningMessage(r,...n)}async showInformationMessageOnlyOnce(e,r,...n){if(!this.recentNotifications.has(e??r))return this.recentNotifications.set(e??r,!0),this.showInformationMessage(r,...n)}};p();p();var ua=class t{static{a(this,"ContentProvider")}static{this.registeredSchemes=new Set}static registerSchemes(e){for(let r of e)t.registeredSchemes.add(r)}static isRegisteredScheme(e){return t.registeredSchemes.has(e)}};var OJr=require("os"),D7e=require("path");p();var NJr;(()=>{"use strict";var t={975:L=>{function B(O){if(typeof O!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(O))}a(B,"e");function j(O,U){for(var q,Q="",Y=0,W=-1,V=0,z=0;z<=O.length;++z){if(z2){var ie=Q.lastIndexOf("/");if(ie!==Q.length-1){ie===-1?(Q="",Y=0):Y=(Q=Q.slice(0,ie)).length-1-Q.lastIndexOf("/"),W=z,V=0;continue}}else if(Q.length===2||Q.length===1){Q="",Y=0,W=z,V=0;continue}}U&&(Q.length>0?Q+="/..":Q="..",Y=2)}else Q.length>0?Q+="/"+O.slice(W+1,z):Q=O.slice(W+1,z),Y=z-W-1;W=z,V=0}else q===46&&V!==-1?++V:V=-1}return Q}a(j,"r");var M={resolve:a(function(){for(var O,U="",q=!1,Q=arguments.length-1;Q>=-1&&!q;Q--){var Y;Q>=0?Y=arguments[Q]:(O===void 0&&(O=process.cwd()),Y=O),B(Y),Y.length!==0&&(U=Y+"/"+U,q=Y.charCodeAt(0)===47)}return U=j(U,!q),q?U.length>0?"/"+U:"/":U.length>0?U:"."},"resolve"),normalize:a(function(O){if(B(O),O.length===0)return".";var U=O.charCodeAt(0)===47,q=O.charCodeAt(O.length-1)===47;return(O=j(O,!U)).length!==0||U||(O="."),O.length>0&&q&&(O+="/"),U?"/"+O:O},"normalize"),isAbsolute:a(function(O){return B(O),O.length>0&&O.charCodeAt(0)===47},"isAbsolute"),join:a(function(){if(arguments.length===0)return".";for(var O,U=0;U0&&(O===void 0?O=q:O+="/"+q)}return O===void 0?".":M.normalize(O)},"join"),relative:a(function(O,U){if(B(O),B(U),O===U||(O=M.resolve(O))===(U=M.resolve(U)))return"";for(var q=1;qz){if(U.charCodeAt(W+H)===47)return U.slice(W+H+1);if(H===0)return U.slice(W+H)}else Y>z&&(O.charCodeAt(q+H)===47?ie=H:H===0&&(ie=0));break}var te=O.charCodeAt(q+H);if(te!==U.charCodeAt(W+H))break;te===47&&(ie=H)}var le="";for(H=q+ie+1;H<=Q;++H)H!==Q&&O.charCodeAt(H)!==47||(le.length===0?le+="..":le+="/..");return le.length>0?le+U.slice(W+ie):(W+=ie,U.charCodeAt(W)===47&&++W,U.slice(W))},"relative"),_makeLong:a(function(O){return O},"_makeLong"),dirname:a(function(O){if(B(O),O.length===0)return".";for(var U=O.charCodeAt(0),q=U===47,Q=-1,Y=!0,W=O.length-1;W>=1;--W)if((U=O.charCodeAt(W))===47){if(!Y){Q=W;break}}else Y=!1;return Q===-1?q?"/":".":q&&Q===1?"//":O.slice(0,Q)},"dirname"),basename:a(function(O,U){if(U!==void 0&&typeof U!="string")throw new TypeError('"ext" argument must be a string');B(O);var q,Q=0,Y=-1,W=!0;if(U!==void 0&&U.length>0&&U.length<=O.length){if(U.length===O.length&&U===O)return"";var V=U.length-1,z=-1;for(q=O.length-1;q>=0;--q){var ie=O.charCodeAt(q);if(ie===47){if(!W){Q=q+1;break}}else z===-1&&(W=!1,z=q+1),V>=0&&(ie===U.charCodeAt(V)?--V==-1&&(Y=q):(V=-1,Y=z))}return Q===Y?Y=z:Y===-1&&(Y=O.length),O.slice(Q,Y)}for(q=O.length-1;q>=0;--q)if(O.charCodeAt(q)===47){if(!W){Q=q+1;break}}else Y===-1&&(W=!1,Y=q+1);return Y===-1?"":O.slice(Q,Y)},"basename"),extname:a(function(O){B(O);for(var U=-1,q=0,Q=-1,Y=!0,W=0,V=O.length-1;V>=0;--V){var z=O.charCodeAt(V);if(z!==47)Q===-1&&(Y=!1,Q=V+1),z===46?U===-1?U=V:W!==1&&(W=1):U!==-1&&(W=-1);else if(!Y){q=V+1;break}}return U===-1||Q===-1||W===0||W===1&&U===Q-1&&U===q+1?"":O.slice(U,Q)},"extname"),format:a(function(O){if(O===null||typeof O!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof O);return(function(U,q){var Q=q.dir||q.root,Y=q.base||(q.name||"")+(q.ext||"");return Q?Q===q.root?Q+Y:Q+"/"+Y:Y})(0,O)},"format"),parse:a(function(O){B(O);var U={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return U;var q,Q=O.charCodeAt(0),Y=Q===47;Y?(U.root="/",q=1):q=0;for(var W=-1,V=0,z=-1,ie=!0,H=O.length-1,te=0;H>=q;--H)if((Q=O.charCodeAt(H))!==47)z===-1&&(ie=!1,z=H+1),Q===46?W===-1?W=H:te!==1&&(te=1):W!==-1&&(te=-1);else if(!ie){V=H+1;break}return W===-1||z===-1||te===0||te===1&&W===z-1&&W===V+1?z!==-1&&(U.base=U.name=V===0&&Y?O.slice(1,z):O.slice(V,z)):(V===0&&Y?(U.name=O.slice(1,W),U.base=O.slice(1,z)):(U.name=O.slice(V,W),U.base=O.slice(V,z)),U.ext=O.slice(W,z)),V>0?U.dir=O.slice(0,V-1):Y&&(U.dir="/"),U},"parse"),sep:"/",delimiter:":",win32:null,posix:null};M.posix=M,L.exports=M}},e={};function r(L){var B=e[L];if(B!==void 0)return B.exports;var j=e[L]={exports:{}};return t[L](j,j.exports,r),j.exports}a(r,"r"),r.d=(L,B)=>{for(var j in B)r.o(B,j)&&!r.o(L,j)&&Object.defineProperty(L,j,{enumerable:!0,get:B[j]})},r.o=(L,B)=>Object.prototype.hasOwnProperty.call(L,B),r.r=L=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})};var n={};let o;r.r(n),r.d(n,{URI:a(()=>m,"URI"),Utils:a(()=>N,"Utils")}),typeof process=="object"?o=process.platform==="win32":typeof navigator=="object"&&(o=navigator.userAgent.indexOf("Windows")>=0);let s=/^\w[\w\d+.-]*$/,c=/^\//,l=/^\/\//;function u(L,B){if(!L.scheme&&B)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${L.authority}", path: "${L.path}", query: "${L.query}", fragment: "${L.fragment}"}`);if(L.scheme&&!s.test(L.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(L.path){if(L.authority){if(!c.test(L.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(L.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(u,"a");let d="",f="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class m{static{a(this,"l")}static isUri(B){return B instanceof m||!!B&&typeof B.authority=="string"&&typeof B.fragment=="string"&&typeof B.path=="string"&&typeof B.query=="string"&&typeof B.scheme=="string"&&typeof B.fsPath=="string"&&typeof B.with=="function"&&typeof B.toString=="function"}scheme;authority;path;query;fragment;constructor(B,j,M,O,U,q=!1){typeof B=="object"?(this.scheme=B.scheme||d,this.authority=B.authority||d,this.path=B.path||d,this.query=B.query||d,this.fragment=B.fragment||d):(this.scheme=(function(Q,Y){return Q||Y?Q:"file"})(B,q),this.authority=j||d,this.path=(function(Q,Y){switch(Q){case"https":case"http":case"file":Y?Y[0]!==f&&(Y=f+Y):Y=f}return Y})(this.scheme,M||d),this.query=O||d,this.fragment=U||d,u(this,q))}get fsPath(){return v(this,!1)}with(B){if(!B)return this;let{scheme:j,authority:M,path:O,query:U,fragment:q}=B;return j===void 0?j=this.scheme:j===null&&(j=d),M===void 0?M=this.authority:M===null&&(M=d),O===void 0?O=this.path:O===null&&(O=d),U===void 0?U=this.query:U===null&&(U=d),q===void 0?q=this.fragment:q===null&&(q=d),j===this.scheme&&M===this.authority&&O===this.path&&U===this.query&&q===this.fragment?this:new A(j,M,O,U,q)}static parse(B,j=!1){let M=h.exec(B);return M?new A(M[2]||d,R(M[4]||d),R(M[5]||d),R(M[7]||d),R(M[9]||d),j):new A(d,d,d,d,d)}static file(B){let j=d;if(o&&(B=B.replace(/\\/g,f)),B[0]===f&&B[1]===f){let M=B.indexOf(f,2);M===-1?(j=B.substring(2),B=f):(j=B.substring(2,M),B=B.substring(M)||f)}return new A("file",j,B,d,d)}static from(B){let j=new A(B.scheme,B.authority,B.path,B.query,B.fragment);return u(j,!0),j}toString(B=!1){return b(this,B)}toJSON(){return this}static revive(B){if(B){if(B instanceof m)return B;{let j=new A(B);return j._formatted=B.external,j._fsPath=B._sep===g?B.fsPath:null,j}}return B}}let g=o?1:void 0;class A extends m{static{a(this,"d")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=v(this,!1)),this._fsPath}toString(B=!1){return B?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){let B={$mid:1};return this._fsPath&&(B.fsPath=this._fsPath,B._sep=g),this._formatted&&(B.external=this._formatted),this.path&&(B.path=this.path),this.scheme&&(B.scheme=this.scheme),this.authority&&(B.authority=this.authority),this.query&&(B.query=this.query),this.fragment&&(B.fragment=this.fragment),B}}let y={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function E(L,B,j){let M,O=-1;for(let U=0;U=97&&q<=122||q>=65&&q<=90||q>=48&&q<=57||q===45||q===46||q===95||q===126||B&&q===47||j&&q===91||j&&q===93||j&&q===58)O!==-1&&(M+=encodeURIComponent(L.substring(O,U)),O=-1),M!==void 0&&(M+=L.charAt(U));else{M===void 0&&(M=L.substr(0,U));let Q=y[q];Q!==void 0?(O!==-1&&(M+=encodeURIComponent(L.substring(O,U)),O=-1),M+=Q):O===-1&&(O=U)}}return O!==-1&&(M+=encodeURIComponent(L.substring(O))),M!==void 0?M:L}a(E,"m");function _(L){let B;for(let j=0;j1&&L.scheme==="file"?`//${L.authority}${L.path}`:L.path.charCodeAt(0)===47&&(L.path.charCodeAt(1)>=65&&L.path.charCodeAt(1)<=90||L.path.charCodeAt(1)>=97&&L.path.charCodeAt(1)<=122)&&L.path.charCodeAt(2)===58?B?L.path.substr(1):L.path[1].toLowerCase()+L.path.substr(2):L.path,o&&(j=j.replace(/\//g,"\\")),j}a(v,"v");function b(L,B){let j=B?_:E,M="",{scheme:O,authority:U,path:q,query:Q,fragment:Y}=L;if(O&&(M+=O,M+=":"),(U||O==="file")&&(M+=f,M+=f),U){let W=U.indexOf("@");if(W!==-1){let V=U.substr(0,W);U=U.substr(W+1),W=V.lastIndexOf(":"),W===-1?M+=j(V,!1,!1):(M+=j(V.substr(0,W),!1,!1),M+=":",M+=j(V.substr(W+1),!1,!0)),M+="@"}U=U.toLowerCase(),W=U.lastIndexOf(":"),W===-1?M+=j(U,!1,!0):(M+=j(U.substr(0,W),!1,!0),M+=U.substr(W))}if(q){if(q.length>=3&&q.charCodeAt(0)===47&&q.charCodeAt(2)===58){let W=q.charCodeAt(1);W>=65&&W<=90&&(q=`/${String.fromCharCode(W+32)}:${q.substr(3)}`)}else if(q.length>=2&&q.charCodeAt(1)===58){let W=q.charCodeAt(0);W>=65&&W<=90&&(q=`${String.fromCharCode(W+32)}:${q.substr(2)}`)}M+=j(q,!0,!1)}return Q&&(M+="?",M+=j(Q,!1,!1)),Y&&(M+="#",M+=B?Y:E(Y,!1,!1)),M}a(b,"b");function T(L){try{return decodeURIComponent(L)}catch{return L.length>3?L.substr(0,3)+T(L.substr(3)):L}}a(T,"C");let w=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function R(L){return L.match(w)?L.replace(w,(B=>T(B))):L}a(R,"w");var x=r(975);let P=x.posix||x,D="/";var N;(function(L){L.joinPath=function(B,...j){return B.with({path:P.join(B.path,...j)})},L.resolvePath=function(B,...j){let M=B.path,O=!1;M[0]!==D&&(M=D+M,O=!0);let U=P.resolve(M,...j);return O&&U[0]===D&&!B.authority&&(U=U.substring(1)),B.with({path:U})},L.dirname=function(B){if(B.path.length===0||B.path===D)return B;let j=P.dirname(B.path);return j.length===1&&j.charCodeAt(0)===46&&(j=""),B.with({path:j})},L.basename=function(B){return P.basename(B.path)},L.extname=function(B){return P.extname(B.path)}})(N||(N={})),NJr=n})();var{URI:WU,Utils:xbe}=NJr;function LJr(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+LJr(t.substring(3)):t}}a(LJr,"decodeURIComponentGraceful");var MJr=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function cNt(t){return t.match(MJr)?t.replace(MJr,e=>LJr(e)):t}a(cNt,"percentDecode");function ts(t){if(/^[A-Za-z][A-Za-z0-9+.-]+:/.test(t))throw new Error("Path must not contain a scheme");if(!t)throw new Error("Path must not be empty");return WU.file(t).toString()}a(ts,"makeFsUri");function eo(t){if(typeof t!="string"&&(t=t.uri),/^[A-Za-z]:\\/.test(t))throw new Error(`Could not parse <${t}>: Windows-style path`);try{let e=t.match(/^(?:([^:/?#]+?:)?\/\/)(\/\/.*)$/);return e?WU.parse(e[1]+e[2],!0):WU.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(eo,"parseUri");function N7e(t){return eo(t),t}a(N7e,"validateUri");function Fs(t){try{return eo(t).toString()}catch{return t}}a(Fs,"normalizeUri");function BJr(t){let e=Fs(t);return e.endsWith("/")?e.slice(0,-1):e}a(BJr,"normalizeUriNoTrailingSlash");var rz=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function ln(t){let e=eo(t);if(!rz.has(e.scheme)&&!ua.isRegisteredScheme(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,OJr.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,D7e.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(ln,"fsPath");function Us(t){try{return ln(t)}catch{return}}a(Us,"getFsPath");function FJr(t){let e=Us(t);if(e)return WU.file(e).toString()}a(FJr,"getFsUri");function nz(t,...e){let r,n=Us(t);return n?r=ts((0,D7e.resolve)(n,...e)):r=xbe.resolvePath(eo(t),...e.map(o=>UJr(o))).toString(),typeof t=="string"?r:{uri:r}}a(nz,"resolveFilePath");function wa(t,...e){let r=xbe.joinPath(eo(t),...e.map(UJr)).toString();return typeof t=="string"?r:{uri:r}}a(wa,"joinPath");function UJr(t){return Q_o(t)?t.replaceAll("\\","/"):t}a(UJr,"pathToURIPath");function Q_o(t){return/^[^/\\]*\\/.test(t)}a(Q_o,"isWinPath");function Ki(t){return cNt((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(Ki,"basename");function mf(t){let e=xbe.dirname(eo(t)),r;return rz.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(mf,"dirname");function QJr(t){return xbe.extname(eo(t))}a(QJr,"extname");var Km=class{static{a(this,"NetworkConfiguration")}};function M7e(t,e){try{let r=new URL(e??"");if(r.protocol==="https:"||!uNt(t)&&r.protocol==="http:")return r.href}catch{}}a(M7e,"ensurePermittedUrl");var iz={api:"https://api.githubcopilot.com",proxy:"https://copilot-proxy.githubusercontent.com",telemetry:"https://copilot-telemetry.githubusercontent.com","origin-tracker":"https://origin-tracker.githubusercontent.com"};function lNt(t,e,r){if(r&&Q1(t)){for(let n of r){let o=Rt(t,n);if(o)return o}return}for(let n of e){let o=Rt(t,n);if(o)return o}}a(lNt,"urlConfigOverride");function q_o(t,e){switch(e){case"api":return lNt(t,[ze.DebugOverrideCapiUrl,ze.DebugOverrideCapiUrlLegacy],[ze.DebugTestOverrideCapiUrl,ze.DebugTestOverrideCapiUrlLegacy]);case"proxy":return lNt(t,[ze.DebugOverrideProxyUrl,ze.DebugOverrideProxyUrlLegacy],[ze.DebugTestOverrideProxyUrl,ze.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!uNt(t))return lNt(t,[ze.DebugSnippyOverrideUrl])}}a(q_o,"getEndpointOverrideUrl");function ux(t,e,r,...n){let o=q_o(t,r)??e.endpoints[r];return wa(o,...n)}a(ux,"getEndpointUrl");function RB(t){return dx(t)?.endpoints??iz}a(RB,"getLastKnownEndpoints");function O7e(t,e){if(e&&!M7e(t,e)){t.get(es).showWarningMessage(`Ignoring invalid or unsupported authentication URL "${e}".`);return}t.get(Km).setConfiguredUrls(t,{serverUrl:e})}a(O7e,"updateServerUrl");p();var Jm=class{static{a(this,"UrlOpener")}};var mC=new pe("auth"),dNt=60,j_o=300;var H_o=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"],G_o="4535c7beffc844b46bb1ed4aa04d759a";function Yy(t){let e=t.serverUrl?.match(/^https?:\/\//)?t.serverUrl:"",r=t.apiUrl?.match(/^https?:\/\//)?t.apiUrl:"";return e?r||=e.replace("://","://api."):r?.includes("://api.")&&(e||=r.replace("://api.","://")),(!e||!r)&&(e="https://github.com/",r="https://api.github.com/"),{apiUrl:r,serverUrl:e}}a(Yy,"fillGitHubUrls");function zU(){return Math.floor(Date.now()/1e3)}a(zU,"nowSeconds");async function fNt(t,e,r){let n=Vt.createAndMarkAsIssued({},{});ft(t,"auth.new_login");let o={"X-GitHub-Api-Version":"2024-12-15"};r?.hasKnownOrg&&(o["X-GitHub-Staff-Request"]="1");let s=await Bd(t,e,"copilot_internal/v2/token",{timeout:12e4,headers:o}),c=await s.json();if(s.status===401){let h="Failed to get copilot token due to 401 status. Please sign out and try again.",m=s.headers.get("x-github-request-id")??"",g=c.error_details,A=[];m&&A.push(`request_id=${m}`),g?.url&&A.push(`url=${g.url}`),g?.notification_id&&A.push(`notification_id=${g.notification_id}`),g?.message&&A.push(`error=${g.message}`);let y=A.length>0?` (${A.join(", ")})`:"";return mC.info(t,`${h}${y}`),rg(t,"auth.unknown_401",n),{failureKind:"HTTP401",message:h}}if(!s.ok||!c.token){mC.info(t,`Invalid copilot token: missing token: ${s.status} ${s.statusText}`),rg(t,"auth.invalid_token",n.extendedBy({status:s.status.toString(),status_text:s.statusText}));let h=c.error_details;return h?.notification_id!=="not_signed_up"&&$_o(t,h,e),{failureKind:"NotAuthorized",message:h?.message??"Could not retrieve token",canSignUpForLimited:c.can_signup_for_limited??!1}}let l=zU()+c.refresh_in+dNt,u=await wbe(t,e),d;u.ok&&(d=await u.json());let f=new oz(c,d,l);return ft(t,"auth.new_token",n.extendedBy({...kPt(f)},{adjusted_expires_at:f.expiresAt,expires_at:c.expires_at,current_time:zU()})),{copilotToken:f}}a(fNt,"authFromGitHubSession");var Dh=class{static{a(this,"CopilotTokenFetcher")}},L7e=class extends Dh{static{a(this,"NetworkCopilotTokenFetcher")}async fetchTokenResult(e,r,n){return await fNt(e,r,n)}};async function wbe(t,e){return await Bd(t,e,"copilot_internal/user",{timeout:12e4,headers:{"X-GitHub-Api-Version":"2025-05-01"}})}a(wbe,"fetchCopilotUserInfo");function $_o(t,e,r){e&&t.get(es).showWarningMessageOnlyOnce(e.notification_id,e.message,{title:e.title},{title:"Dismiss"}).then(async n=>{let o=n?.title===e.title,s=o||n?.title==="Dismiss";if(o){let c=t.get(Ir).getEditorPluginInfo(),l=e.url.replace("{EDITOR}",encodeURIComponent(c.name+"_"+c.version));await t.get(Jm).open(l)}e.notification_id&&s&&await V_o(t,e.notification_id,r)}).catch(n=>{mC.exception(t,n,"copilotToken.notification")})}a($_o,"notifyUser");async function V_o(t,e,r){let n=await Bd(t,r,"copilot_internal/notification",{method:"POST",body:JSON.stringify({notification_id:e})});(!n||!n.ok)&&mC.error(t,`Failed to send notification result to GitHub: ${n?.status} ${n?.statusText}`)}a(V_o,"sendNotificationResultToGitHub");var oz=class{constructor(e,r,n){this.envelope=e;this.expiresAt=n;this.token=e.token,this.organization_list=e.organization_list,this.enterprise_list=e.enterprise_list,this.tokenMap=this.parseToken(this.token),this.userInfo=new n9e(r)}static{a(this,"CopilotToken")}get endpoints(){return{...iz,...this.envelope.endpoints??{}}}needsRefresh(){return this.expiresAt-j_o(this.organization_list??[]).includes(e))}isGitHubUser(){return(this.organization_list??[]).includes(G_o)}isInternalUser(){return this.isMicrosoftUser()||this.isGitHubUser()}};p();var yi=class extends Error{static{a(this,"CopilotAuthError")}constructor(e,r){super(e,{cause:r}),this.name="CopilotAuthError"}};function B7e(t){return`Environment variable ${t} provides a token that is not valid for GitHub Copilot. Please unset it (or replace with a working token) and retry.`}a(B7e,"authEnvVarConflictMessage");var YU=class extends yi{static{a(this,"NoBrowserAvailableError")}constructor(e="Browser not available for OAuth code flow"){super(e),this.name="NoBrowserAvailableError"}};function qJr(t){let e=t.trim();if(!e)throw new yi("Invalid GitHub server URL: value is empty or whitespace.");let r;try{r=new URL(e)}catch{throw new yi("Invalid GitHub server URL: value is not a valid absolute URL.")}if(r.protocol!=="https:")throw new yi("Invalid GitHub server URL: only HTTPS URLs are supported.");if(r.port!=="")throw new yi("Invalid GitHub server URL: port numbers are not supported.");return r.toString()}a(qJr,"validateGitHubServerUrl");p();p();var fx=class{static{a(this,"AuthRepository")}};p();function jJr(t){let e=t.trim();if(!e)throw new yi("Invalid GitHub server URL: value is empty or whitespace.");let r=/^https?:\/\//i.test(e)?e:`https://${e}`,n=qJr(r),{apiUrl:o}=Yy({serverUrl:n}),s=new URL(n).hostname;return{serverUrl:n,apiUrl:o,authAuthority:s}}a(jJr,"buildAuthServerEndpoint");function KU(t,e){if(e!==void 0)return jJr(e);{let r=t.get(Km),{serverUrl:n,apiUrl:o}=r.getConfiguredUrls(),s=r.getAuthAuthority();return{serverUrl:n,apiUrl:o,authAuthority:s}}}a(KU,"resolveAuthServerEndpoint");function pNt(t){if(!t)return!1;try{return jJr(t),!0}catch{return!1}}a(pNt,"isValidAuthServer");p();p();p();p();p();p();p();p();function DB(t,e){return t||e}a(DB,"_pureAssign");function Zm(t,e){return t[e]}a(Zm,"_pureRef");var gC=void 0,Nh=null,wNt="",$7e="function",kbe="object",kB="prototype",INt="__proto__",sz="undefined",q7e="constructor",RNt="Symbol",W_o="_polyfill",az="length",j7e="name",_A="call",V7e="toString",px=DB(Object),kNt=Zm(px,kB),zJr=DB(String),cz=Zm(zJr,kB),Pbe=DB(Math),YJr=DB(Array),W7e=Zm(YJr,kB),PB=Zm(W7e,"slice");function Yf(t,e){try{return{v:t.apply(this,e)}}catch(r){return{e:r}}}a(Yf,"safe");function z_o(t,e){var r=Yf(t);return r.e?e:r.v}a(z_o,"safeGet");var hNt;function z7e(t){return function(e){return typeof e===t}}a(z7e,"_createIs");function KJr(t){var e="[object "+t+"]";return function(r){return!!(r&&Dbe(r)===e)}}a(KJr,"_createObjIs");function Dbe(t){return kNt[V7e].call(t)}a(Dbe,"objToString");function Nn(t){return typeof t===sz||t===sz}a(Nn,"isUndefined");function Y_o(t){return!Ose(t)}a(Y_o,"isStrictUndefined");function Zt(t){return t===Nh||Nn(t)}a(Zt,"isNullOrUndefined");function K_o(t){return t===Nh||!Ose(t)}a(K_o,"isStrictNullOrUndefined");function Ose(t){return!!t||t!==gC}a(Ose,"isDefined");function J_o(t){return!hNt&&(hNt=["string","number","boolean",sz,"symbol","bigint"]),t!==kbe&&hNt.indexOf(t)!==-1}a(J_o,"isPrimitiveType");var Ei=z7e("string"),Lr=z7e($7e);function zu(t){return!t&&Zt(t)?!1:!!t&&typeof t===kbe}a(zu,"isObject");var ur=Zm(YJr,"isArray"),Y7e=KJr("Date"),Oh=z7e("number"),rP=z7e("boolean");var NB=KJr("Error");function ig(t){return!!(t&&t.then&&Lr(t.then))}a(ig,"isPromiseLike");function Z1(t){return!(!t||z_o(function(){return!(t&&0+t)},!t))}a(Z1,"isTruthy");var Lse=Zm(px,"getOwnPropertyDescriptor");function og(t,e){return!!t&&kNt.hasOwnProperty[_A](t,e)}a(og,"objHasOwnProperty");var vA=DB(Zm(px,"hasOwn"),Z_o);function Z_o(t,e){return og(t,e)||!!Lse(t,e)}a(Z_o,"polyObjHasOwn");function Yr(t,e,r){if(t&&zu(t)){for(var n in t)if(vA(t,n)&&e[_A](r||t,n,t[n])===-1)break}}a(Yr,"objForEachKey");var F7e={e:"enumerable",c:"configurable",v:"value",w:"writable",g:"get",s:"set"};function X_o(t){var e={};if(e[F7e.c]=!0,e[F7e.e]=!0,t.l){e.get=function(){return t.l.v};var r=Lse(t.l,"v");r&&r.set&&(e.set=function(n){t.l.v=n})}return Yr(t,function(n,o){e[F7e[n]]=Y_o(o)?e[F7e[n]]:o}),e}a(X_o,"_createProp");var w_=Zm(px,"defineProperty"),JJr=Zm(px,"defineProperties");function qi(t,e,r){return w_(t,e,X_o(r))}a(qi,"objDefine");function ZJr(t,e,r,n,o){var s={};return Yr(t,function(c,l){H7e(s,c,e?l:c),H7e(s,l,r?l:c)}),n?n(s):s}a(ZJr,"_createKeyValueMap");function H7e(t,e,r,n){w_(t,e,{value:r,enumerable:!0,writable:!1})}a(H7e,"_assignMapValue");var Wu=DB(zJr),evo="[object Error]";function dr(t,e){var r=wNt,n=kNt[V7e][_A](t);n===evo&&(t={stack:Wu(t.stack),message:Wu(t.message),name:Wu(t.name)});try{r=JSON.stringify(t,Nh,e?typeof e=="number"?e:4:gC),r=(r?r.replace(/"(\w+)"\s*:\s{0,1}/g,"$1: "):Nh)||Wu(t)}catch(o){r=" - "+dr(o,e)}return n+": "+r}a(dr,"dumpObj");function el(t){throw new Error(t)}a(el,"throwError");function Xm(t){throw new TypeError(t)}a(Xm,"throwTypeError");var XJr=Zm(px,"freeze");function tvo(t){return t}a(tvo,"_doNothing");function rvo(t){return t[INt]||Nh}a(rvo,"_getProto");var MB=Zm(px,"assign"),Yu=Zm(px,"keys");function R_(t){return XJr&&Yr(t,function(e,r){(ur(r)||zu(r))&&R_(r)}),Lh(t)}a(R_,"objDeepFreeze");var Lh=DB(XJr,tvo);var xNt=DB(Zm(px,"getPrototypeOf"),rvo);function K7e(t){return ZJr(t,1,0,Lh)}a(K7e,"createEnum");function nvo(t){return ZJr(t,0,0,Lh)}a(nvo,"createEnumKeyMap");function ivo(t){var e={};return Yr(t,function(r,n){H7e(e,r,n[1]),H7e(e,n[0],n[1])}),Lh(e)}a(ivo,"createSimpleMap");function PNt(t){return ivo(t)}a(PNt,"createTypeMap");var eZr=nvo({asyncIterator:0,hasInstance:1,isConcatSpreadable:2,iterator:3,match:4,matchAll:5,replace:6,search:7,species:8,split:9,toPrimitive:10,toStringTag:11,unscopables:12}),HJr="__tsUtils$gblCfg",mNt;function tZr(){var t;return typeof globalThis!==sz&&(t=globalThis),!t&&typeof self!==sz&&(t=self),!t&&typeof window!==sz&&(t=window),!t&&typeof global!==sz&&(t=global),t}a(tZr,"_getGlobalValue");function rZr(){if(!mNt){var t=Yf(tZr).v||{};mNt=t[HJr]=t[HJr]||{}}return mNt}a(rZr,"_getGlobalConfig");var Bse=Nbe;function Nbe(t,e,r){var n=e?e[t]:Nh;return function(o){var s=(o?o[t]:Nh)||n;if(s||r){var c=arguments;return(s||r).apply(o,s?PB[_A](c,1):c)}Xm('"'+Wu(t)+'" not defined for '+dr(o))}}a(Nbe,"_unwrapFunctionWithPoly");function ovo(t){return function(e){return e[t]}}a(ovo,"_unwrapProp");var JU=Zm(Pbe,"min"),nP=Zm(Pbe,"max"),GJr=Bse("slice",cz),Kf=Bse("substring",cz),J7e=Nbe("substr",cz,svo);function svo(t,e,r){return Zt(t)&&Xm("Invalid "+dr(t)),r<0?wNt:(e=e||0,e<0&&(e=nP(e+t[az],0)),Nn(r)?GJr(t,e):GJr(t,e,e+r))}a(svo,"polyStrSubstr");function gM(t,e){return Kf(t,0,e)}a(gM,"strLeft");var $Jr="_urid",gNt;function avo(){if(!gNt){var t=rZr();gNt=t.gblSym=t.gblSym||{k:{},s:{}}}return gNt}a(avo,"_globalSymbolRegistry");var U7e;function DNt(t){var e={description:Wu(t),toString:a(function(){return RNt+"("+t+")"},"toString")};return e[W_o]=!0,e}a(DNt,"polyNewSymbol");function cvo(t){var e=avo();if(!vA(e.k,t)){var r=DNt(t),n=Yu(e.s).length;r[$Jr]=function(){return n+"_"+r[V7e]()},e.k[t]=r,e.s[r[$Jr]()]=Wu(t)}return e.k[t]}a(cvo,"polySymbolFor");function lvo(t){!U7e&&(U7e={});var e,r=eZr[t];return r&&(e=U7e[r]=U7e[r]||DNt(RNt+"."+r)),e}a(lvo,"polyGetKnownSymbol");var Mh;function ZU(){Mh=rZr()}a(ZU,"_initTestHooks");function Z7e(t){var e={};return!Mh&&ZU(),e.b=Mh.lzy,w_(e,"v",{configurable:!0,get:a(function(){var r=t();return Mh.lzy||w_(e,"v",{value:r}),e.b=Mh.lzy,r},"get")}),e}a(Z7e,"getLazy");function X1(t){return w_({toJSON:a(function(){return t},"toJSON")},"v",{value:t})}a(X1,"createCachedValue");var nZr="window",Rbe;function X7e(t,e){var r;return function(){return!Mh&&ZU(),(!r||Mh.lzy)&&(r=X1(Yf(t,e).v)),r.v}}a(X7e,"_getGlobalInstFn");function Ky(t){return!Mh&&ZU(),(!Rbe||t===!1||Mh.lzy)&&(Rbe=X1(Yf(tZr).v||Nh)),Rbe.v}a(Ky,"getGlobal");function Pi(t,e){var r;if(!Rbe||e===!1?r=Ky(e):r=Rbe.v,r&&r[t])return r[t];if(t===nZr)try{return window}catch{}return Nh}a(Pi,"getInst");function OB(){return!!gf()}a(OB,"hasDocument");var gf=X7e(Pi,["document"]);function Fse(){return!!Af()}a(Fse,"hasWindow");var Af=X7e(Pi,[nZr]);function lz(){return!!Ku()}a(lz,"hasNavigator");var Ku=X7e(Pi,["navigator"]);var iZr=X7e(function(){return!!Yf(function(){return process&&(process.versions||{}).node}).v});var Mse,ANt;function eQe(){return Mse=X1(Yf(Pi,[RNt]).v),Mse}a(eQe,"_initSymbol");function uvo(t){var e=(Mh.lzy?0:Mse)||eQe();return e.v?e.v[t]:gC}a(uvo,"_getSymbolKey");function oZr(){return!!dvo()}a(oZr,"hasSymbol");function dvo(){return!Mh&&ZU(),((Mh.lzy?0:Mse)||eQe()).v}a(dvo,"getSymbol");function Mbe(t,e){var r=eZr[t];!Mh&&ZU();var n=(Mh.lzy?0:Mse)||eQe();return n.v?n.v[r||t]:e?gC:lvo(t)}a(Mbe,"getKnownSymbol");function hx(t,e){!Mh&&ZU();var r=(Mh.lzy?0:Mse)||eQe();return r.v?r.v(t):e?Nh:DNt(t)}a(hx,"newSymbol");function XU(t){return!Mh&&ZU(),ANt=(Mh.lzy?0:ANt)||X1(Yf(uvo,["for"]).v),(ANt.v||cvo)(t)}a(XU,"symbolFor");function G7e(t){return!!t&&Lr(t.next)}a(G7e,"isIterator");function NNt(t){return!K_o(t)&&Lr(t[Mbe(3)])}a(NNt,"isIterable");var Q7e;function tQe(t,e,r){if(t&&(G7e(t)||(!Q7e&&(Q7e=X1(Mbe(3))),t=t[Q7e.v]?t[Q7e.v]():Nh),G7e(t))){var n=gC,o=gC;try{for(var s=0;!(o=t.next()).done&&e[_A](r||t,o.value,s,t)!==-1;)s++}catch(c){n={e:c},t.throw&&(o=Nh,t.throw(n))}finally{try{o&&!o.done&&t.return&&t.return(o)}finally{if(n)throw n.e}}}}a(tQe,"iterForOf");function Nse(t,e,r){return t.apply(e,r)}a(Nse,"fnApply");function Bh(t,e){return!Nn(e)&&t&&(ur(e)?Nse(t.push,t,e):G7e(e)||NNt(e)?tQe(e,function(r){t.push(r)}):t.push(e)),t}a(Bh,"arrAppend");function vt(t,e,r){if(t)for(var n=t[az]>>>0,o=0;o0?r:0;return Kf(t,o,o+n[az])===n}a(Ivo,"polyStrStartsWith");var bNt="ref",SNt="unref",TNt="hasRef",xvo="enabled";function wvo(t,e,r){var n=!0,o=t?e(Nh):Nh,s;function c(){return n=!1,o&&o[SNt]&&o[SNt](),s}a(c,"_unref");function l(){o&&r(o),o=Nh}a(l,"_cancel");function u(){return o=e(o),n||c(),s}a(u,"_refresh");function d(f){!f&&o&&l(),f&&!o&&u()}return a(d,"_setEnabled"),s={cancel:l,refresh:u},s[TNt]=function(){return o&&o[TNt]?o[TNt]():n},s[bNt]=function(){return n=!0,o&&o[bNt]&&o[bNt](),s},s[SNt]=c,s=w_(s,xvo,{get:a(function(){return!!o},"get"),set:d}),{h:s,dn:a(function(){o=Nh},"dn")}}a(wvo,"_createTimerHandler");function ONt(t,e,r){var n=ur(e),o=n?e.length:0,s=(o>0?e[0]:n?gC:e)||setTimeout,c=(o>1?e[1]:gC)||clearTimeout,l=r[0];r[0]=function(){u.dn(),Nse(l,gC,PB[_A](arguments))};var u=wvo(t,function(d){if(d){if(d.refresh)return d.refresh(),d;Nse(c,gC,[d])}return Nse(s,gC,r)},function(d){Nse(c,gC,[d])});return u.h}a(ONt,"_createTimeoutWith");function jp(t,e){return ONt(!0,gC,PB[_A](arguments))}a(jp,"scheduleTimeout");function dZr(t,e,r){return ONt(!0,t,PB[_A](arguments,1))}a(dZr,"scheduleTimeoutWith");function rQe(t,e){return ONt(!1,gC,PB[_A](arguments))}a(rQe,"createTimeout");var Ube=K7e,LNt=PNt;p();var iP=Ube({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var oP="toLowerCase",dn="length",qse="warnToConsole",FB="throwInternal",yM="watch",t7="apply",Bi="push",mx="splice",Ju="logger",EM="cancel",UB="initialize",_M="identifier",jse="removeNotificationListener",Hse="addNotificationListener",AC="isInitialized",Qbe="getNotifyMgr",r7="getPlugin",tS="name",e0="processNext",nQe="getProcessTelContext",QB="value",n7="enabled",BNt="stopPollingInternalLogs",gx="unload",qbe="onComplete",iQe="version",oQe="loggingLevelConsole",vM="createNew",rS="teardown",Gse="messageId",CM="message",yC="diagLog",i7="_doTeardown",dz="update",nS="getNext",o7="setNextPlugin",jbe="userAgent",Ax="split",sP="replace",Hbe="substring",Gbe="indexOf",qB="type",FNt="evtName",aP="status",UNt="getAllResponseHeaders",$be="isChildEvt",iS="data",fz="getCtx",cP="setCtx",QNt="itemsReceived",Vbe="headers",$se="urlString",pz="timeout";var sQe="traceFlags";var qNt;function fZr(t,e){qNt||(qNt=Lbe("AggregationError",function(n,o){o[dn]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw vt(e,function(n,o){r+=` +`.concat(o," > ").concat(dr(n))}),new qNt(r,e||[])}a(fZr,"throwAggregationError");p();p();p();var Vse="function",yx="object",oS="undefined",sS="prototype";var s7=Object,Wbe=s7[sS];p();var lDl=(Ky()||{}).Symbol,uDl=(Ky()||{}).Reflect;var pZr="hasOwnProperty",kvo=a(function(t){for(var e,r=1,n=arguments.length;r0)for(var o=0;o=0;r--)if(t[r]===e)return!0;return!1}a(XNt,"_hasVisited");function Nvo(t,e,r,n){function o(u,d,f){var h=d[f];if(h[$Nt]&&n){var m=u[pQe]||{};m[zbe]!==!1&&(h=(m[d[Wse]]||{})[f]||h)}return function(){return h.apply(u,arguments)}}a(o,"_instFuncProxy");var s=AM(null);hQe(r,function(u){s[u]=o(e,r,u)});for(var c=mz(t),l=[];c&&!JNt(c)&&!XNt(l,c);)hQe(c,function(u){!s[u]&&ZNt(c,u,!Ybe)&&(s[u]=o(e,c,u))}),l.push(c),c=mz(c);return s}a(Nvo,"_getBaseFuncs");function Mvo(t,e,r,n){var o=null;if(t&&og(r,Wse)){var s=t[pQe]||AM(null);if(o=(s[r[Wse]]||AM(null))[e],o||mQe("Missing ["+e+"] "+fQe),!o[VNt]&&s[zbe]!==!1){for(var c=!og(t,e),l=mz(t),u=[];c&&l&&!JNt(l)&&!XNt(u,l);){var d=l[e];if(d){c=d===n;break}u.push(l),l=mz(l)}try{c&&(t[e]=o),o[VNt]=1}catch{s[zbe]=!1}}}return o}a(Mvo,"_getInstFunc");function Ovo(t,e,r){var n=e[t];return n===r&&(n=mz(e)[t]),typeof n!==fQe&&mQe("["+t+"] is not a "+fQe),n}a(Ovo,"_getProtoFunc");function Lvo(t,e,r,n,o){function s(u,d){var f=a(function(){var h=Mvo(this,d,u,f)||Ovo(d,u,f);return h.apply(this,arguments)},"dynProtoProxy");return f[$Nt]=1,f}if(a(s,"_createDynamicPrototype"),!uQe(t)){var c=r[pQe]=r[pQe]||AM(null);if(!uQe(c)){var l=c[e]=c[e]||AM(null);c[zbe]!==!1&&(c[zbe]=!!o),uQe(l)||hQe(r,function(u){ZNt(r,u,!1)&&r[u]!==n[u]&&(l[u]=r[u],delete r[u],(!og(t,u)||t[u]&&!t[u][$Nt])&&(t[u]=s(t,u)))})}}}a(Lvo,"_populatePrototype");function Bvo(t,e){if(Ybe){for(var r=[],n=mz(e);n&&!JNt(n)&&!XNt(r,n);){if(n===t)return!0;r.push(n),n=mz(n)}return!1}return!0}a(Bvo,"_checkPrototype");function GNt(t,e){return og(t,jB)?t.name||e||hZr:((t||{})[dQe]||{}).name||e||hZr}a(GNt,"_getObjName");function Si(t,e,r,n){og(t,jB)||mQe("theClass is an invalid class definition.");var o=t[jB];Bvo(o,e)||mQe("["+GNt(t)+"] not in hierarchy of ["+GNt(e)+"]");var s=null;og(o,Wse)?s=o[Wse]:(s=Pvo+GNt(t,"_")+"$"+zNt.n,zNt.n++,o[Wse]=s);var c=Si[yZr],l=!!c[lQe];l&&n&&n[lQe]!==void 0&&(l=!!n[lQe]);var u=Dvo(e),d=Nvo(o,e,u,l);r(e,d);var f=!!Ybe&&!!c[WNt];f&&n&&(f=!!n[WNt]),Lvo(o,s,e,u,f!==!1)}a(Si,"dynamicProto");Si[yZr]=zNt.o;p();var AQe="Promise";var aMt="rejected";function vl(t,e){return yQe(t,function(r){return e?e({status:"fulfilled",rejected:!1,value:r}):r},function(r){return e?e({status:aMt,rejected:!0,reason:r}):r})}a(vl,"doAwaitResponse");function yQe(t,e,r,n){var o=t;try{if(ig(t))(e||r)&&(o=t.then(e,r));else try{e&&(o=e(t))}catch(s){if(r)o=r(s);else throw s}}finally{n&&Fvo(o,n)}return o}a(yQe,"doAwait");function Fvo(t,e){var r=t;return e&&(ig(t)?t.finally?r=t.finally(e):r=t.then(function(n){return e(),n},function(n){throw e(),n}):e()),r}a(Fvo,"doFinally");var eMt,tMt,rMt,EZr=!1;function Uvo(t,e,r,n){eMt=eMt||{toString:a(function(){return"[[PromiseState]]"},"toString")},tMt=tMt||{toString:a(function(){return"[[PromiseResult]]"},"toString")},rMt=rMt||{toString:a(function(){return"[[PromiseIsHandled]]"},"toString")};var o={};o[eMt]={get:e},o[tMt]={get:r},o[rMt]={get:n},JJr(t,o)}a(Uvo,"_addDebugState$1");var CZr=["pending","resolving","resolved",aMt],_Zr="dispatchEvent",gQe;function Qvo(t){var e;return t&&t.createEvent&&(e=t.createEvent("Event")),!!e&&e.initEvent}a(Qvo,"_hasInitEventFn");function qvo(t,e,r,n){var o=gf();!gQe&&(gQe=X1(!!Yf(Qvo,[o]).v));var s=gQe.v?o.createEvent("Event"):n?new Event(e):{};if(r&&r(s),gQe.v&&s.initEvent(e,!1,!0),s&&t[_Zr])t[_Zr](s);else{var c=t["on"+e];if(c)c(s);else{var l=Pi("console");l&&(l.error||l.log)(e,dr(s))}}}a(qvo,"emitEvent");var bZr="unhandledRejection",jvo=bZr.toLowerCase(),Kbe=[],Hvo=0,Gvo=10;var nMt;function vZr(t){return Lr(t)?t.toString():dr(t)}a(vZr,"dumpFnObj");function SZr(t,e,r){var n=e7(arguments,3),o=0,s=!1,c,l=[],u=Hvo++,d=Kbe.length>0?Kbe[Kbe.length-1]:void 0,f=!1,h=null,m;function g(w,R){try{Kbe.push(u),f=!0,h&&h.cancel(),h=null;var x=t(function(P,D){l.push(function(){try{var N=o===2?w:R,L=Nn(N)?c:Lr(N)?N(c):N;ig(L)?L.then(P,D):N?P(L):o===3?D(L):P(L)}catch(B){D(B)}}),s&&_()},n);return x}finally{Kbe.pop()}}a(g,"_then");function A(w){return g(void 0,w)}a(A,"_catch");function y(w){var R=w,x=w;return Lr(w)&&(R=a(function(P){return w&&w(),P},"thenFinally"),x=a(function(P){throw w&&w(),P},"catchFinally")),g(R,x)}a(y,"_finally");function E(){return CZr[o]}a(E,"_strState");function _(){if(l.length>0){var w=l.slice();l=[],f=!0,h&&h.cancel(),h=null,e(w)}}a(_,"_processQueue");function v(w,R){return function(x){if(o===R){if(w===2&&ig(x)){o=1,x.then(v(2,1),v(3,1));return}o=w,s=!0,c=x,_(),!f&&w===3&&!h&&(h=jp(b,Gvo))}}}a(v,"_createSettleIfFn");function b(){if(!f)if(f=!0,iZr())process.emit(bZr,c,m);else{var w=Af()||Ky();!nMt&&(nMt=X1(Yf(Pi,[AQe+"RejectionEvent"]).v)),qvo(w,jvo,function(R){return qi(R,"promise",{g:a(function(){return m},"g")}),R.reason=c,R},!!nMt.v)}}a(b,"_notifyUnhandledRejection"),m={then:g,catch:A,finally:y},w_(m,"state",{get:E}),EZr&&Uvo(m,E,function(){return Dbe(c)},function(){return f}),oZr()&&(m[Mbe(11)]="IPromise");function T(){return"IPromise"+(EZr?"["+u+(Nn(d)?"":":"+d)+"]":"")+" "+E()+(s?" - "+vZr(c):"")}return a(T,"_toString"),m.toString=T,a((function(){Lr(r)||Xm(AQe+": executor is not a function - "+vZr(r));var R=v(3,0);try{r.call(m,v(2,0),R)}catch(x){R(x)}}),"_initialize")(),m}a(SZr,"_createPromise");function $vo(t){return function(e){var r=e7(arguments,1);return t(function(n,o){try{var s=[],c=1;tQe(e,function(l,u){l&&(c++,yQe(l,function(d){s[u]=d,--c===0&&n(s)},o))}),c--,c===0&&n(s)}catch(l){o(l)}},r)}}a($vo,"_createAllPromise");function Vvo(t){return X1(function(e){var r=e7(arguments,1);return t(function(n,o){var s=[],c=1;function l(u,d){c++,vl(u,function(f){f.rejected?s[d]={status:aMt,reason:f.reason}:s[d]={status:"fulfilled",value:f.value},--c===0&&n(s)})}a(l,"processItem");try{ur(e)?vt(e,l):NNt(e)?tQe(e,l):Xm("Input is not an iterable"),c--,c===0&&n(s)}catch(u){o(u)}},r)})}a(Vvo,"_createAllSettledPromise");function TZr(t){vt(t,function(e){try{e()}catch{}})}a(TZr,"syncItemProcessor");function Wvo(t){var e=Oh(t)?t:0;return function(r){jp(function(){TZr(r)},e)}}a(Wvo,"timeoutItemProcessor");function IZr(t,e){return SZr(IZr,Wvo(e),t,e)}a(IZr,"createAsyncPromise");var iMt;function zvo(t,e){!iMt&&(iMt=X1(Yf(Pi,[AQe]).v||null));var r=iMt.v;if(!r)return IZr(t);Lr(t)||Xm(AQe+": executor is not a function - "+dr(t));var n=0;function o(){return CZr[n]}a(o,"_strState");var s=new r(function(c,l){function u(f){n=2,c(f)}a(u,"_resolve");function d(f){n=3,l(f)}a(d,"_reject"),t(u,d)});return w_(s,"state",{get:o}),s}a(zvo,"createNativePromise");var oMt;function Jbe(t){return SZr(Jbe,TZr,t)}a(Jbe,"createSyncPromise");function EQe(t,e){return!oMt&&(oMt=Vvo(Jbe)),oMt.v(t,e)}a(EQe,"createSyncAllSettledPromise");var sMt;function Fd(t,e){return!sMt&&(sMt=X1(zvo)),sMt.v.call(this,t,e)}a(Fd,"createPromise");var _Qe=$vo(Fd);var HDl=Mbe(11);p();p();p();p();var aS=void 0,So="",gz="channels",Jf="core",vQe="createPerfMgr",Zbe="disabled",HB="extensionConfig",Az="extensions",EC="processTelemetry",yz="priority",zse="eventsSent",a7="eventsDiscarded",Yse="eventsSendRequest",bM="perfEvent",CQe="offlineEventsStored",bQe="offlineBatchSent",SQe="offlineBatchDrop",Kse="getPerfMgr",TQe="domain",IQe="path",xZr="Not dynamic - ",wZr="REDACTED",cMt=["sig","Signature","AWSAccessKeyId","X-Goog-Signature"];var Yvo="getPrototypeOf",Kvo=/-([a-z])/g,Jvo=/([^\w\d_$])/g,Zvo=/^(\d+[\w\d_$])/,XDl=Object[Yvo];function c7(t){return!Zt(t)}a(c7,"isNotNullOrUndefined");function Xbe(t){var e=t;return e&&Ei(e)&&(e=e[sP](Kvo,function(r,n){return n.toUpperCase()}),e=e[sP](Jvo,"_"),e=e[sP](Zvo,function(r,n){return"_"+n})),e}a(Xbe,"normalizeJsName");function t0(t,e){return t&&e?uu(t,e)!==-1:!1}a(t0,"strContains");function l7(t){return t&&t.toISOString()||""}a(l7,"toISOString");function Hp(t){return NB(t)?t[tS]:So}a(Hp,"getExceptionName");function SM(t,e,r,n,o){var s=r;return t&&(s=t[e],s!==r&&(!o||o(s))&&(!n||n(r))&&(s=r,t[e]=s)),s}a(SM,"setValue");function lMt(t,e,r){var n;return t?(n=t[e],!n&&Zt(n)&&(n=Nn(r)?{}:r,t[e]=n)):n=Nn(r)?{}:r,n}a(lMt,"getSetValue");function Xvo(t,e){var r=null,n=null;return Lr(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][t7](n,o)}}a(Xvo,"_createProxyFunction");function Ez(t,e,r,n,o){t&&e&&r&&(o!==!1||Nn(t[e]))&&(t[e]=Xvo(r,n))}a(Ez,"proxyFunctionAs");function _z(t,e,r,n){return t&&e&&zu(t)&&ur(r)&&vt(r,function(o){Ei(o)&&Ez(t,o,e,o,n)}),t}a(_z,"proxyFunctions");function uMt(t){return(function(){function e(){var r=this;t&&Yr(t,function(n,o){r[n]=o})}return a(e,"class_1"),e})()}a(uMt,"createClassFromInterface");function wQe(t){return t&&MB&&(t=s7(MB({},t))),t}a(wQe,"optimizeObject");function RQe(t,e,r,n,o,s){var c=arguments,l=c[0]||{},u=c[dn],d=!1,f=1;for(u>0&&rP(l)&&(d=l,l=c[f]||{},f++),zu(l)||(l={});f>>=0),i1e=LZr+t&Cz,o1e=BZr-t&Cz,FZr=!0}a(pCo,"_mwcSeed");function hCo(){try{var t=_l()&2147483647;pCo((Math.random()*OZr^t)+t)}catch{}}a(hCo,"_autoSeedMwc");function MZr(t){var e=0,r=EMt()||_Mt();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&Cz),e===0&&Xse()&&(FZr||hCo(),e=mCo()&Cz),e===0&&(e=eS(OZr*Math.random()|0)),t||(e>>>=0),e}a(MZr,"random32");function mCo(t){o1e=36969*(o1e&65535)+(o1e>>16)&Cz,i1e=18e3*(i1e&65535)+(i1e>>16)&Cz;var e=(o1e<<16)+(i1e&65535)>>>0&Cz|0;return t||(e>>>=0),e}a(mCo,"mwcRandom32");function UZr(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=MZr()>>>0,n=0,o=So;o[dn]>>=6,n===5&&(r=(MZr()<<2&4294967295|r&3)>>>0,n=0);return o}a(UZr,"newId");var QZr="3.3.11",gCo="."+UZr(6),ACo=0;function qZr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(qZr,"_canAcceptData");function yCo(t,e){var r=e[t.id];if(!r){r={};try{qZr(e)&&qi(e,t.id,{e:!1,v:r})}catch{}}return r}a(yCo,"_getCache");function cS(t,e){return e===void 0&&(e=!1),Xbe(t+ACo+++(e?"."+QZr:So)+gCo)}a(cS,"createUniqueNamespace");function DQe(t){var e={id:cS("_aiData-"+(t||So)+"."+QZr),accept:a(function(r){return qZr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[Xbe(n)]:(s&&(c=yCo(e,r),c[Xbe(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(DQe,"createElmNodeData");p();function NQe(t){return t&&zu(t)&&!ur(t)&&(t.isVal||t.fb||vA(t,"v")||vA(t,"mrg")||vA(t,"ref")||t.set)}a(NQe,"_isConfigDefaults");function jZr(t,e,r){var n,o=r.dfVal||Ose;if(e&&r.fb){var s=r.fb;ur(s)||(s=[s]);for(var c=0;c0&&fZr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[dn]>0){c||(c=[]),l||(l=jp(function(){l=null,f()},0));for(var A=0;A0?vl(GB(t[0],e),function(){FQe(e7(t,1),e,r)}):r(),n}a(FQe,"doUnloadAll");p();var WZr=500,IMt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function ICo(t,e,r){return!t&&Zt(t)?e:rP(t)?t:Wu(t)[oP]()==="true"}a(ICo,"_stringToBoolOrDefault");function xMt(t){return{mrg:!0,v:t}}a(xMt,"cfgDfMerge");function tae(t,e,r){return{fb:r,isVal:t,v:e}}a(tae,"cfgDfValidate");function vx(t,e){return{fb:e,set:ICo,v:!!t}}a(vx,"cfgDfBoolean");p();p();var wMt=[zse,a7,Yse,bM],QQe=null,UQe;function xCo(t,e){return function(){var r=arguments,n=RMt(e);if(n){var o=n.listener;o&&o[t]&&o[t][t7](o,r)}}}a(xCo,"_listenerProxyFunc");function wCo(){var t=Pi("Microsoft");return t&&(QQe=t.ApplicationInsights),QQe}a(wCo,"_getExtensionNamespace");function RMt(t){var e=QQe;return!e&&t.disableDbgExt!==!0&&(e=QQe||wCo()),e?e.ChromeDbgExt:null}a(RMt,"getDebugExt");function zZr(t){if(!UQe){UQe={};for(var e=0;e=A&&(d[T](b[CM]),n[w]=!0)}else o>=A&&d[T](b[CM]);f(A,b)}},d.debugToConsole=function(A){kMt("debug",A),g("warning",A)},d[qse]=function(A){kMt("warn",A),g("warning",A)},d.errorToConsole=function(A){kMt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[gx]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=PCo+y[Gse];if(n[_]?E=!1:n[_]=!0,E&&(A<=s&&(d.queue[Bi](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",b=new d1e(23,v,!1);d.queue[Bi](b),A===1?d.errorToConsole(v):d[qse](v)}}}a(f,"_logInternalMessage");function h(A){return _x(Fh(A,DCo,d).cfg,function(y){var E=y.cfg;o=E[oQe],s=E.loggingLevelTelemetry,c=E.maxMessageLimit,l=E.enableDebug})}a(h,"_setDefaultsFromConfig");function m(){return r>=c}a(m,"_areInternalMessagesThrottled");function g(A,y){var E=RMt(e||{});E&&E[yC]&&E[yC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function JZr(t){return t||new nae}a(JZr,"_getLogger");function Wr(t,e,r,n,o,s){s===void 0&&(s=!1),JZr(t)[FB](e,r,n,o,s)}a(Wr,"_throwInternal");function $B(t,e){JZr(t)[qse](e)}a($B,"_warnToConsole");var PMt,f7,ZZr="toGMTString",XZr="toUTCString",OMt="cookie",DMt="expires",eXr="isCookieUseDisabled",f1e="disableCookiesUsage",tXr="_ckMgr",qQe=null,NMt=null,rXr=null,IM,nXr={},iXr={},MCo=(PMt={cookieCfg:xMt((f7={},f7[TQe]={fb:"cookieDomain",dfVal:c7},f7.path={fb:"cookiePath",dfVal:c7},f7.enabled=aS,f7.ignoreCookies=aS,f7.blockedCookies=aS,f7.disableCookieDefer=!1,f7)),cookieDomain:aS,cookiePath:aS},PMt[f1e]=aS,PMt);function LMt(){!IM&&(IM=Z7e(function(){return gf()}))}a(LMt,"_getDoc");function jQe(t){return t?t.isEnabled():!0}a(jQe,"_isMgrEnabled");function uXr(t,e){return e&&t&&ur(t.ignoreCookies)?Vo(t.ignoreCookies,e)!==-1:!1}a(uXr,"_isIgnoredCookie");function oXr(t,e){return e&&t&&ur(t.blockedCookies)&&Vo(t.blockedCookies,e)!==-1?!0:uXr(t,e)}a(oXr,"_isBlockedCookie");function sXr(t,e){var r=e[n7];if(Zt(r)){var n=void 0;Nn(t[eXr])||(n=!t[eXr]),Nn(t[f1e])||(n=!t[f1e]),r=n}return r}a(sXr,"_isCfgEnabled");function dXr(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[IQe]=E||"/",_[DMt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return Xse()||(v["max-age"]="0"),cXr(So,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Di(E||So),R=uu(w,";");if(R!==-1&&(w=Di(gM(E,R)),T=fXr(Kf(E,R+1))),SM(T,TQe,v||o,Z1,Nn),!Zt(_)){var x=Xse();if(Nn(T[DMt])){var P=_l(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),SM(T,DMt,aXr(N,x?ZZr:XZr)||aXr(N,x?ZZr:XZr)||So,Z1)}}x||SM(T,"max-age",So+_,null,Nn)}var L=r1e();return L&&L.protocol==="https:"&&(SM(T,"secure",null,null,Nn),NMt===null&&(NMt=!LCo((Ku()||{})[jbe])),NMt&&SM(T,"SameSite","None",null,Nn)),SM(T,IQe,b||n,null,Nn),cXr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[dn]-1;_>=0;_--)f[_].n===E&&f[mx](_,1)}a(g,"_removePendingCookie");function A(){MMt(e)&&f&&(vt(f,function(E){oXr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=Fh(t||iXr,null,e).cfg,s=_x(t,function(E){E.setDf(E.cfg,MCo),r=E.ref(E.cfg,"cookieCfg"),n=r[IQe]||"/",o=r[TQe],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=sXr(t,r)!==!1,l=r.getCookie||OCo,u=r.setCookie||lXr,d=r.delCookie||lXr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=sXr(t,r)!==!1&&c&&MMt(e),_=iXr[tXr];return E&&_&&y!==_&&(E=jQe(_)),E},"isEnabled"),setEnabled:a(function(E){r[n7]=E,Nn(t[f1e])||(t[f1e]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=oXr(r,E);if(!R){var x=m(_,v,b,T);jQe(y)?(u(E,x),w=!0):f&&(g(E),f[Bi]({n:E,o:0,v:x}),w=!0)}return w},"set"),get:a(function(E){var _=So,v=uXr(r,E);if(!v){if(jQe(y))_=l(E);else if(f)for(var b=f[dn]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=uu(w,";");_=R!==-1?Di(gM(w,R)):Di(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return jQe(y)?v=y.purge(E,_):f&&(g(E),f[Bi]({n:E,o:1,v:h(_)}),v=!0),v},"del"),purge:a(function(E,_){var v=!1;return MMt(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[tXr]=y,y}a(dXr,"createCookieMgr");function MMt(t){if(qQe===null){qQe=!1,!IM&&LMt();try{var e=IM.v||{};qQe=e[OMt]!==void 0}catch(r){Wr(t,2,68,"Cannot access document.cookie - "+Hp(r),{exception:dr(r)})}}return qQe}a(MMt,"areCookiesSupported");function fXr(t){var e={};if(t&&t[dn]){var r=Di(t)[Ax](";");vt(r,function(n){if(n=Di(n||So),n){var o=uu(n,"=");o===-1?e[n]=null:e[Di(gM(n,o))]=Di(Kf(n,o+1))}})}return e}a(fXr,"_extractParts");function aXr(t,e){return Lr(t[e])?t[e]():null}a(aXr,"_formatDate");function cXr(t,e){var r=t||So;return Yr(e,function(n,o){r+="; "+n+(Zt(o)?So:"="+o)}),r}a(cXr,"_formatCookieValue");function OCo(t){var e=So;if(!IM&&LMt(),IM.v){var r=IM.v[OMt]||So;rXr!==r&&(nXr=fXr(r),rXr=r),e=Di(nXr[t]||So)}return e}a(OCo,"_getCookieValue");function lXr(t,e){!IM&&LMt(),IM.v&&(IM.v[OMt]=t+"="+e)}a(lXr,"_setCookieValue");function LCo(t){return Ei(t)?!!(t0(t,"CPU iPhone OS 12")||t0(t,"iPad; CPU OS 12")||t0(t,"Macintosh; Intel Mac OS X 10_14")&&t0(t,"Version/")&&t0(t,"Safari")||t0(t,"Macintosh; Intel Mac OS X 10_14")&&BB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||t0(t,"Chrome/5")||t0(t,"Chrome/6")||t0(t,"UnrealEngine")&&!t0(t,"Chrome")||t0(t,"UCBrowser/12")||t0(t,"UCBrowser/11")):!1}a(LCo,"uaDisallowsSameSiteNone");p();var BCo={perfEvtsSendAll:!1};function FCo(t){t.h=null;var e=t.cb;t.cb=[],vt(e,function(r){Yf(r.fn,[r.arg])})}a(FCo,"_runScheduledListeners");function p7(t,e,r,n){vt(t,function(o){o&&o[e]&&(r?(r.cb[Bi]({fn:n,arg:o}),r.h=r.h||jp(FCo,0,r)):Yf(n,[o]))})}a(p7,"_runListeners");var pXr=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=Fh(e,BCo);n=c[yM](function(l){r=!!l.cfg.perfEvtsSendAll}),Si(t,this,function(l){qi(l,"listeners",{g:a(function(){return o},"g")}),l[Hse]=function(u){o[Bi](u)},l[jse]=function(u){for(var d=Vo(o,u);d>-1;)o[mx](d,1),d=Vo(o,u)},l[zse]=function(u){p7(o,zse,s,function(d){d[zse](u)})},l[a7]=function(u,d,f){p7(o,a7,s,function(h){h[a7](u,d,f)})},l[Yse]=function(u,d){p7(o,Yse,d?s:null,function(f){f[Yse](u,d)})},l[bM]=function(u){u&&(r||!u[$be]())&&p7(o,bM,null,function(d){u.isAsync?jp(function(){return d[bM](u)},0):d[bM](u)})},l[CQe]=function(u){u&&u[dn]&&p7(o,CQe,s,function(d){d[CQe](u)})},l[bQe]=function(u){u&&u[iS]&&p7(o,bQe,s,function(d){d[bQe](u)})},l[SQe]=function(u,d){if(u>0){var f=d||0;p7(o,SQe,s,function(h){h[SQe](u,f)})}},l[gx]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[EM](),s.h=null,s.cb=[]},"_finishUnload"),f;if(p7(o,"unload",null,function(h){var m=h[gx](u);m&&(f||(f=[]),f[Bi](m))}),f)return Fd(function(h){return vl(_Qe(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var iae="ctx",FMt="ParentContextKey",p1e="ChildrenContextKey",UCo=null,HQe=(function(){function t(e,r,n){var o=this;if(o.start=_l(),o[tS]=e,o.isAsync=n,o[$be]=function(){return!1},Lr(r)){var s;qi(o,"payload",{g:a(function(){return!s&&Lr(r)&&(s=r(),r=null),s},"g")})}o[fz]=function(c){return c?c===t[FMt]||c===t[p1e]?o[c]:(o[iae]||{})[c]:null},o[cP]=function(c,l){if(c)if(c===t[FMt])o[c]||(o[$be]=function(){return!0}),o[c]=l;else if(c===t[p1e])o[c]=l;else{var u=o[iae]=o[iae]||{};u[c]=l}},o.complete=function(){var c=0,l=o[fz](t[p1e]);if(ur(l))for(var u=0;u0&&(vt(A,function(y){try{y.func.call(y.self,y.args)}catch(E){Wr(r[Ju],2,73,"Unexpected Exception during onComplete - "+dr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[HB];!_&&A&&(_={}),E[HB]=_,_=e.ref(E,HB),_&&(y=_[g],!y&&A&&(y={}),_[g]=y,y=e.ref(_,g))}return y}a(d,"_getExtCfg");function f(g,A){var y=d(g,!0);return A&&Yr(A,function(E,_){if(Zt(y[E])){var v=e.cfg[E];(v||!Zt(v))&&(y[E]=v)}s1e(e,y,E,_)}),e.setDf(y,A)}a(f,"_resolveExtCfg");function h(g,A,y){y===void 0&&(y=!1);var E,_=d(g,!1),v=e.cfg;return _&&(_[A]||!Zt(_[A]))?E=_[A]:(v[A]||!Zt(v[A]))&&(E=v[A]),E||!Zt(E)?E:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[r7]();y&&g(y)}}return a(m,"_iterateChain"),c}a(jMt,"_createInternalContext");function lP(t,e,r,n){var o=Fh(e),s=jMt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[EC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),ur(d)&&(d=h7(d,o.cfg,r,f)),lP(d||c[nS](),o.cfg,r,f)}return a(u,"_createNew"),c[e0]=l,c[vM]=u,c}a(lP,"createProcessTelemetryContext");function oae(t,e,r){var n=Fh(e.config),o=jMt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[gx](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=h7(u,n.cfg,e,d)),oae(u||s[nS](),e,d)}return a(l,"_createNew"),s[e0]=c,s[vM]=l,s}a(oae,"createProcessTelemetryUnloadContext");function h1e(t,e,r){var n=Fh(e.config),o=jMt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Lr(d[dz])&&d[dz](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=h7(u,n.cfg,e,d)),h1e(u||s[nS](),e,d)}return a(l,"_createNew"),s[e0]=c,s[vM]=l,s}a(h1e,"createProcessTelemetryUpdateContext");function h7(t,e,r,n){var o=null,s=!n;if(ur(t)&&t[dn]>0){var c=null;vt(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Lr(l[EC])){var u=$Co(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?h7([n],e,r):o}a(h7,"createTelemetryProxyChain");function $Co(t,e,r){var n=null,o=Lr(t[EC]),s=Lr(t[o7]),c;t?c=t[_M]+"-"+t[yz]+"-"+_Xr++:c="Unknown-0-"+_Xr++;var l={getPlugin:a(function(){return t},"getPlugin"),getNext:a(function(){return n},"getNext"),processTelemetry:f,unload:h,update:m,_id:c,_setNext:a(function(g){n=g},"_setNext")};function u(){var g;return t&&Lr(t[EXr])&&(g=t[EXr]()),g||(g=lP(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[_M]:HCo,T=g[yXr];return T||(T=g[yXr]={}),g.setNext(n),t&&GQe(g[Jf](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:So;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&Wr(g[yC](),1,73,"Plugin ["+b+"] failed during "+y+" - "+dr(x)+", run flags: "+dr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=VB(t);return _[rS]||_[Zbe]?!1:(s&&t[o7](n),t[EC](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[e0](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=VB(t),v=t[Jf]||_[Jf];t&&(!v||v===g.core())&&!_[rS]&&(_[Jf]=null,_[rS]=!0,_[AC]=!1,t[rS]&&t[rS](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[e0](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=VB(t),v=t[Jf]||_[Jf];t&&(!v||v===g.core())&&!_[rS]&&t[dz]&&t[dz](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[e0](A)}return a(m,"_updatePlugin"),Lh(l)}a($Co,"createTelemetryPluginProxy");var VCo=(function(){function t(e,r,n,o){var s=this,c=lP(e,r,n,o);_z(s,c,Yu(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function VQe(){var t=[];function e(n){n&&t[Bi](n)}a(e,"_addHandler");function r(n,o){vt(t,function(s){try{s(n,o)}catch(c){Wr(n[yC](),2,73,"Unexpected error calling unload handler - "+dr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(VQe,"createUnloadHandlerContainer");p();var WQe,zQe;function YQe(){var t=[];function e(n){var o=t;t=[],vt(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Wr(n,2,73,"Unloading:"+dr(c))}}),WQe&&o[dn]>WQe&&(zQe?zQe("doUnload",o):Wr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Bh(t,n),WQe&&t[dn]>WQe&&(zQe?zQe("Add",t):Wr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected.")))}return a(r,"_addHook"),{run:e,add:r}}a(YQe,"createUnloadHookContainer");var HMt,m7="getPlugin",WCo=(HMt={},HMt[HB]={isVal:c7,v:{}},HMt),m1e=(function(){function t(){var e=this,r,n,o,s,c;d(),Si(t,e,function(f){f[UB]=function(h,m,g,A){u(h,m,A),r=!0},f[rS]=function(h,m){var g=f[Jf];if(!g||h&&g!==h[Jf]())return;var A,y=!1,E=h||oae(null,g,o&&o[m7]?o[m7]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[yC]()),A===!0&&E[e0](_),d())}return a(v,"_unloadCallback"),!f[i7]||f[i7](E,_,v)!==!0?v():A=!0,A},f[dz]=function(h,m){var g=f[Jf];if(!g||h&&g!==h[Jf]())return;var A,y=!1,E=h||h1e(null,g,o&&o[m7]?o[m7]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[nS]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},Ez(f,"_addUnloadCb",function(){return s},"add"),Ez(f,"_addHook",function(){return c},"add"),qi(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[yC]=function(f){return l(f)[yC]()},e[AC]=function(){return r},e.setInitialized=function(f){r=f},e[o7]=function(f){o=f},e[e0]=function(f,h){h?h[e0](f):o&&Lr(o[EC])&&o[EC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||lP(null,{},e[Jf]);o&&o[m7]?h=m[vM](null,o[m7]):h=m[vM](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){Fh(f,WCo,bz(h)),!m&&h&&(m=h[nQe]()[nS]());var g=o;o&&o[m7]&&(g=o[m7]()),e[Jf]=h,n=lP(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[Jf]=null,n=null,o=null,c=YQe(),s=VQe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function zCo(t,e,r){var n={id:e,fn:r};Bh(t,n);var o={remove:a(function(){vt(t,function(s,c){if(s.id===n.id)return t[mx](c,1),-1})},"remove")};return o}a(zCo,"_addInitializer");function YCo(t,e,r){for(var n=!1,o=t[dn],s=0;s"},"v")})}a(obo,"_createUnloadHook");var VMt=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,j,M,O,U,q;Si(t,this,function(Q){te(),Q._getDbgPlgTargets=function(){return[x,o]},Q[AC]=function(){return r},Q.activeStatus=function(){return N},Q._setPendingStatus=function(){N=3},Q[UB]=function(ne,ue,Ne,Ie){g&&el(CXr),Q[AC]()&&el("Core cannot be initialized more than once"),e=Fh(ne,GMt,Ne||Q[Ju],!1),ne=e.cfg,qe(e[yM](function(st){var _t=st.cfg;B=_t.initInMemoMaxSize||ZCo,Y(_t);var kt=st.ref(st.cfg,HB);Yr(kt,function(Ht){st.ref(kt,Ht)})})),s=Ie,b=ibo(e,v,s&&Q[Qbe](),b),K(),Q[Ju]=Ne;var Be=ne[Az];if(f=[],f[Bi].apply(f,hz(hz([],ue,!1),Be,!1)),h=ne[gz],Le(null),(!m||m[dn]===0)&&el("No "+gz+" available"),h&&h[dn]>1){var tt=Q[r7]("TeeChannelController");(!tt||!tt.plugin)&&Wr(n,1,28,"TeeChannel required")}nbo(ne,R,n),R=null,r=!0,N===iP.ACTIVE&&z()},Q.getChannels=function(){var ne=[];return m&&vt(m,function(ue){ne[Bi](ue)}),Lh(ne)},Q.track=function(ne){GQe(Q[Kse](),function(){return"AppInsightsCore:track"},function(){ne===null&&(de(ne),el("Invalid telemetry item")),!ne[tS]&&Zt(ne[tS])&&(de(ne),el("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||l7(new Date),ne.ver=ne.ver||"4.0",!g&&Q[AC]()&&N===iP.ACTIVE?le()[e0](ne):N!==iP.INACTIVE&&o[dn]<=B&&o[Bi](ne)},function(){return{item:ne}},!ne.sync)},Q[nQe]=le,Q[Qbe]=function(){return s||(s=new pXr(e.cfg),Q[KCo]=s),s},Q[Hse]=function(ne){Q.getNotifyMgr()[Hse](ne)},Q[jse]=function(ne){s&&s[jse](ne)},Q.getCookieMgr=function(){return u||(u=dXr(e.cfg,Q[Ju])),u},Q.setCookieMgr=function(ne){u!==ne&&(GB(u,!1),u=ne)},Q[Kse]=function(){return c||l||mXr()},Q.setPerfMgr=function(ne){c=ne},Q.eventCnt=function(){return o[dn]},Q.releaseQueue=function(){if(r&&o[dn]>0){var ne=o;o=[],N===2?vt(ne,function(ue){ue.iKey=ue.iKey||w,le()[e0](ue)}):Wr(n,2,20,"core init status is not active")}},Q.pollInternalLogs=function(ne){return y=ne||null,q=!1,O&&O[EM](),ie(!0)};function Y(ne){var ue=ne.instrumentationKey,Ne=ne.endpointUrl;if(N!==3){if(Zt(ue)){w=null,N=iP.INACTIVE;var Ie="Please provide instrumentation key";r?(Wr(n,1,100,Ie),z()):el(Ie);return}var Be=[];ig(ue)?(Be[Bi](ue),w=null):w=ue,ig(Ne)?(Be[Bi](Ne),L=null):L=Ne,Be[dn]?W(ne,Be):V()}}a(Y,"_handleIKeyEndpointPromises");function W(ne,ue){j=!1,N=3;var Ne=c7(ne.initTimeOut)?ne.initTimeOut:XCo,Ie=EQe(ue);M&&M[EM](),M=jp(function(){M=null,j||V()},Ne),vl(Ie,function(Be){try{if(j)return;if(!Be.rejected){var tt=Be[QB];if(tt&&tt[dn]){var st=tt[0];if(w=st&&st[QB],tt[dn]>1){var _t=tt[1];L=_t&&_t[QB]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=L)}V()}catch{j||V()}})}a(W,"_waitForInitPromises");function V(){j=!0,Zt(w)?(N=iP.INACTIVE,Wr(n,1,112,"ikey can't be resolved from promises")):N=iP.ACTIVE,z()}a(V,"_setStatus");function z(){r&&(Q.releaseQueue(),Q.pollInternalLogs())}a(z,"_releaseQueues");function ie(ne){if((!O||!O[n7])&&!q){var ue=ne||n&&n.queue[dn]>0;ue&&(U||(U=!0,qe(e[yM](function(Ne){var Ie=Ne.cfg.diagnosticLogInterval;(!Ie||!(Ie>0))&&(Ie=1e4);var Be=!1;O&&(Be=O[n7],O[EM]()),O=rQe(re,Ie),O.unref(),O[n7]=Be}))),O[n7]=!0)}return O}a(ie,"_startLogPoller"),Q[BNt]=function(){q=!0,O&&O[EM](),re()},_z(Q,function(){return A},["addTelemetryInitializer"]),Q[gx]=function(ne,ue,Ne){ne===void 0&&(ne=!0),r||el(JCo),g&&el(CXr);var Ie={reason:50,isAsync:ne,flushComplete:!1},Be;ne&&!ue&&(Be=Fd(function(_t){ue=_t}));var tt=oae(Oe(),Q);tt[qbe](function(){v.run(Q[Ju]),FQe([u,s,n],ne,function(){te(),ue&&ue(Ie)})},Q);function st(_t){Ie.flushComplete=_t,g=!0,_.run(tt,Ie),Q[BNt](),tt[e0](Ie)}return a(st,"_doUnload"),re(),ee(ne,st,6,Ne)||st(!1),Be},Q[r7]=ge,Q.addPlugin=function(ne,ue,Ne,Ie){if(!ne){Ie&&Ie(!1),X(TXr);return}var Be=ge(ne[_M]);if(Be&&!ue){Ie&&Ie(!1),X("Plugin ["+ne[_M]+"] is already loaded!");return}var tt={reason:16};function st(Ht){f[Bi](ne),tt.added=[ne],Le(tt),Ie&&Ie(!0)}if(a(st,"_addPlugin"),Be){var _t=[Be.plugin],kt={reason:2,isAsync:!!Ne};we(_t,kt,function(Ht){Ht?(tt.removed=_t,tt.reason|=32,st(!0)):Ie&&Ie(!1)})}else st(!1)},Q.updateCfg=function(ne,ue){ue===void 0&&(ue=!0);var Ne;if(Q[AC]()){Ne={reason:1,cfg:e.cfg,oldCfg:Use({},e.cfg),newConfig:Use({},ne),merge:ue},ne=Ne.newConfig;var Ie=e.cfg;ne[Az]=Ie[Az],ne[gz]=Ie[gz]}e._block(function(Be){var tt=Be.cfg;$Mt(Be,tt,ne,ue),ue||Yr(tt,function(st){vA(ne,st)||Be.set(tt,st,aS)}),Be.setDf(tt,GMt)},!0),e.notify(),Ne&&he(Ne)},Q.evtNamespace=function(){return E},Q.flush=ee,Q.getTraceCtx=function(ne){return T||(T=AXr()),T},Q.setTraceCtx=function(ne){T=ne||null},Q.addUnloadHook=qe,Ez(Q,"addUnloadCb",function(){return _},"add"),Q.onCfgChange=function(ne){var ue;return r?ue=_x(e.cfg,ne,Q[Ju]):ue=rbo(R,ne),obo(ue)},Q.getWParam=function(){return OB()||e.cfg.enableWParam?0:-1};function H(){var ne={};P=[];var ue=a(function(Ne){Ne&&vt(Ne,function(Ie){if(Ie[_M]&&Ie[iQe]&&!ne[Ie.identifier]){var Be=Ie[_M]+"="+Ie[iQe];P[Bi](Be),ne[Ie.identifier]=Ie}})},"_addPluginVersions");ue(m),h&&vt(h,function(Ne){ue(Ne)}),ue(f)}a(H,"_setPluginVersions");function te(){r=!1,e=Fh({},GMt,Q[Ju]),e.cfg[oQe]=1,qi(Q,"config",{g:a(function(){return e.cfg},"g"),s:a(function(ue){Q.updateCfg(ue,!1)},"s")}),qi(Q,"pluginVersionStringArr",{g:a(function(){return P||H(),P},"g")}),qi(Q,"pluginVersionString",{g:a(function(){return D||(P||H(),D=P.join(";")),D||So},"g")}),qi(Q,"logger",{g:a(function(){return n||(n=new nae(e.cfg),e[Ju]=n),n},"g"),s:a(function(ue){e[Ju]=ue,n!==ue&&(GB(n,!1),n=ue)},"s")}),Q[Ju]=new nae(e.cfg),x=[];var ne=Q.config[Az]||[];ne.splice(0,ne[dn]),Bh(ne,x),A=new vXr,o=[],GB(s,!1),s=null,c=null,l=null,GB(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=cS("AIBaseCore",!0),_=VQe(),T=null,w=null,v=YQe(),R=[],D=null,P=null,q=!1,O=null,U=!1,N=0,L=null,B=null,j=!1,M=null}a(te,"_initDefaults");function le(){var ne=lP(Oe(),e.cfg,Q);return ne[qbe](ie),ne}a(le,"_createTelCtx");function Le(ne){var ue=tbo(Q[Ju],WZr,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=$Qe(Bh(m,ue[gz]));var Ne=Bh($Qe(ue[Jf]),m);x=Lh(Ne);var Ie=Q.config[Az]||[];Ie.splice(0,Ie[dn]),Bh(Ie,x);var Be=le();m&&m[dn]>0&&qMt(Be[vM](m),Ne),qMt(Be,Ne),ne&&he(ne)}a(Le,"_initPluginChain");function ge(ne){var ue=null,Ne=null,Ie=[];return vt(x,function(Be){if(Be[_M]===ne&&Be!==A)return Ne=Be,-1;Be.getChannel&&Ie[Bi](Be)}),!Ne&&Ie[dn]>0&&vt(Ie,function(Be){if(Ne=Be.getChannel(ne),!Ne)return-1}),Ne&&(ue={plugin:Ne,setEnabled:a(function(Be){VB(Ne)[Zbe]=!Be},"setEnabled"),isEnabled:a(function(){var Be=VB(Ne);return!Be[rS]&&!Be[Zbe]},"isEnabled"),remove:a(function(Be,tt){Be===void 0&&(Be=!0);var st=[Ne],_t={reason:1,isAsync:Be};we(st,_t,function(kt){kt&&Le({reason:32,removed:st}),tt&&tt(kt)})},"remove")}),ue}a(ge,"_getPlugin");function Oe(){if(!d){var ne=(x||[]).slice();Vo(ne,A)===-1&&ne[Bi](A),d=h7($Qe(ne),e.cfg,Q)}return d}a(Oe,"_getPluginChain");function we(ne,ue,Ne){if(ne&&ne[dn]>0){var Ie=h7(ne,e.cfg,Q),Be=oae(Ie,Q);Be[qbe](function(){var tt=!1,st=[];vt(f,function(kt,Ht){bXr(kt,ne)?tt=!0:st[Bi](kt)}),f=st,D=null,P=null;var _t=[];h&&(vt(h,function(kt,Ht){var F=[];vt(kt,function(se){bXr(se,ne)?tt=!0:F[Bi](se)}),_t[Bi](F)}),h=_t),Ne&&Ne(tt),ie()}),Be[e0](ue)}else Ne(!1)}a(we,"_removePlugins");function re(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[dn]=0,vt(ne,function(ue){var Ne={name:y||"InternalMessageId: "+ue[Gse],iKey:w,time:l7(new Date),baseType:d1e.dataType,baseData:{message:ue[CM]}};Q.track(Ne)})}}a(re,"_flushInternalLogs");function ee(ne,ue,Ne,Ie){var Be=1,tt=!1,st=null;Ie=Ie||5e3;function _t(){Be--,tt&&Be===0&&(st&&st[EM](),st=null,ue&&ue(tt),ue=null)}if(a(_t,"doCallback"),m&&m[dn]>0){var kt=le()[vM](m);kt.iterate(function(Ht){if(Ht.flush){Be++;var F=!1;Ht.flush(ne,function(){F=!0,_t()},Ne)||F||(ne&&st==null?st=jp(function(){st=null,_t()},Ie):_t())}})}return tt=!0,_t(),!0}a(ee,"_flushChannels");function K(){var ne;qe(e[yM](function(ue){var Ne=ue.cfg.enablePerfMgr;if(Ne){var Ie=ue.cfg[vQe];(ne!==Ie||!ne)&&(Ie||(Ie=ebo),lMt(ue.cfg,vQe,Ie),ne=Ie,l=null),!c&&!l&&Lr(Ie)&&(l=Ie(Q,Q[Qbe]()))}else l=null,ne=null}))}a(K,"_initPerfManager");function he(ne){var ue=h1e(Oe(),Q);ue[qbe](ie),(!Q._updateHook||Q._updateHook(ue,ne)!==!0)&&ue[e0](ne)}a(he,"_doUpdate");function X(ne){var ue=Q[Ju];ue?(Wr(ue,2,73,ne),ie()):el(ne)}a(X,"_logOrThrowError");function de(ne){var ue=Q[Qbe]();ue&&ue[a7]([ne],2)}a(de,"_notifyInvalidEvent");function qe(ne){v.add(ne)}a(qe,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();function g1e(t,e){try{if(t&&t!==""){var r=k_().parse(t);if(r&&r[QNt]&&r[QNt]>=r.itemsAccepted&&r.itemsReceived-r.itemsAccepted===r.errors[dn])return r}}catch(n){Wr(e,1,43,"Cannot parse the response. "+(n[tS]||dr(n)),{response:t})}return null}a(g1e,"parseResponse");p();var uP="",sbo="NoResponseBody",IXr="&"+sbo+"=true",WMt="POST",zMt=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;Si(t,this,function(E,_){var v=!0;j(),E[UB]=function(M,O){o=O,n&&Wr(o,1,28,"Sender is already initialized"),E.SetConfig(M),n=!0},E._getDbgPlgTargets=function(){return[n,s,l,r]},E.SetConfig=function(M){try{if(c=M.senderOnCompleteCallBack||{},l=!!M.disableCredentials,u=M.fetchCredentials,s=!!M.isOneDs,r=!!M.enableSendPromise,f=!!M.disableXhr,h=!!M.disableBeacon,m=!!M.disableBeaconSync,y=M.timeWrapper,A=!!M.addNoResponse,g=!!M.disableFetchKeepAlive,d={sendPOST:N},s||(v=!1),l){var O=r1e();O&&O.protocol&&O.protocol[oP]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[dn]?R(M,O):null},E.getFallbackInst=function(){return d},E[i7]=function(M,O){j()},E.preparePayload=function(M,O,U,q){if(!O||q||!U[iS]){M(U);return}try{var Q=Pi("CompressionStream");if(!Lr(Q)){M(U);return}var Y=new ReadableStream({start:a(function(te){te.enqueue(Ei(U[iS])?new TextEncoder().encode(U[iS]):U[iS]),te.close()},"start")}),W=Y.pipeThrough(new Q("gzip")),V=W.getReader(),z=[],ie=0,H=!1;return vl(V.read(),a(function te(le){if(!H&&!le.rejected){var Le=le[QB];if(!Le.done)return z[Bi](Le[QB]),ie+=Le.value[dn],vl(V.read(),te);for(var ge=new Uint8Array(ie),Oe=0,we=0,re=z;we0&&(vt(Yu(ge),function(K){H.append(K,ge[K])}),Oe[Vbe]=H),u?Oe.credentials=u:v&&s&&(Oe.credentials="include"),U&&(Oe.keepalive=!0,e+=te,s?M._sendReason===2&&(le=!0,A&&(Q+=IXr)):le=!0);var we=new Request(Q,Oe);try{we[IMt]=!0}catch{}if(!U&&r&&(V=Fd(function(K,he){z=K,ie=he})),!Q){w(O),z&&z(!1);return}function re(K,he){he?x(O,s?0:he,{},s?uP:K):x(O,s?0:400,{},s?uP:K)}a(re,"_handleError");function ee(K,he,X){var de=K[aP],qe=c.fetchOnComplete;qe&&Lr(qe)?qe(K,O,X||uP,he):x(O,de,{},X||uP)}a(ee,"_onFetchComplete");try{vl(fetch(s?Q:we,s?Oe:null),function(K){if(U&&(e-=te,te=0),!Le)if(Le=!0,K.rejected)re(K.reason&&K.reason[CM],499),ie&&ie(K.reason);else{var he=K[QB];try{!s&&!he.ok?(he[aP]?re(he.statusText,he[aP]):re(he.statusText,499),z&&z(!1)):s&&!he.body?(ee(he,null,uP),z&&z(!0)):vl(he.text(),function(X){ee(he,M,X[QB]),z&&z(!0)})}catch(X){he&&he[aP]?re(dr(X),he[aP]):re(dr(X),499),ie&&ie(X)}}})}catch(K){Le||(re(dr(K),499),ie&&ie(K))}return le&&!Le&&(Le=!0,x(O,200,{}),z&&z(!0)),s&&!Le&&M[pz]>0&&y&&y.set(function(){Le||(Le=!0,x(O,500,{}),z&&z(!0))},M[pz]),V}a(L,"_doFetchSender");function B(M,O,U){var q=Af(),Q=new XDomainRequest,Y=M[iS];Q.onload=function(){var H=Jse(Q),te=c&&c.xdrOnComplete;te&&Lr(te)?te(Q,O,M):x(O,200,{},H)},Q.onerror=function(){x(O,400,{},s?uP:e1e(Q))},Q.ontimeout=function(){x(O,500,{})},Q.onprogress=function(){};var W=q&&q.location&&q.location.protocol||"",V=M[$se];if(!V){w(O);return}if(!s&&V.lastIndexOf(W,0)!==0){var z="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";Wr(o,2,40,". "+z),T(z,O);return}var ie=s?V:V[sP](/^(https?:)/,"");Q.open(WMt,ie),M[pz]&&(Q[pz]=M[pz]),Q.send(Y),s&&U?y&&y.set(function(){Q.send(Y)},0):Q.send(Y)}a(B,"_xdrSender");function j(){e=0,n=!1,r=!1,o=null,s=null,c=null,l=null,u=null,d=null,f=!1,h=!1,m=!1,g=!1,A=!1,y=null}a(j,"_initDefaults")})}return a(t,"SenderPostManager"),t.__ieDyn=1,t})();p();var NXr="on",xXr="attachEvent",wXr="addEventListener",RXr="detachEvent",kXr="removeEventListener",YMt="events";var a4l=cS("aiEvtPageHide"),c4l=cS("aiEvtPageShow"),abo=/\.[\.]+/g,cbo=/[\.]+$/,lbo=1,KQe=DQe("events"),ubo=/^([^.]*)(?:\.(.+)|)/;function PXr(t){return t&&t[sP]?t[sP](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,So):t}a(PXr,"_normalizeNamespace");function KMt(t,e){if(e){var r=So;ur(e)?(r=So,vt(e,function(o){o=PXr(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=PXr(e),r&&(r[0]!=="."&&(r="."+r),t=(t||So)+r)}var n=ubo.exec(t||So)||[];return{type:n[1],ns:(n[2]||So).replace(abo,".").replace(cbo,So)[Ax](".").sort().join(".")}}a(KMt,"_getEvtNamespace");function MXr(t,e,r){r===void 0&&(r=!0);var n=KQe.get(t,YMt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(MXr,"_getRegisteredEvents");function OXr(t,e,r,n){t&&e&&e[qB]&&(t[kXr]?t[kXr](e[qB],r,n):t[RXr]&&t[RXr](NXr+e[qB],r))}a(OXr,"_doDetach");function dbo(t,e,r,n){var o=!1;return t&&e&&e[qB]&&r&&(t[wXr]?(t[wXr](e[qB],r,n),o=!0):t[xXr]&&(t[xXr](NXr+e[qB],r),o=!0)),o}a(dbo,"_doAttach");function DXr(t,e,r,n){for(var o=e[dn];o--;){var s=e[o];s&&(!r.ns||r.ns===s[FNt].ns)&&(!n||n(s))&&(OXr(t,s[FNt],s.handler,s.capture),e[mx](o,1))}}a(DXr,"_doUnregister");function fbo(t,e,r){if(e[qB])DXr(t,MXr(t,e[qB]),e,r);else{var n=KQe.get(t,YMt,{});Yr(n,function(o,s){DXr(t,s,e,r)}),Yu(n)[dn]===0&&KQe.kill(t,YMt)}}a(fbo,"_unregisterEvents");function A1e(t,e){var r;return e?(ur(e)?r=[t].concat(e):r=[t,e],r=KMt("xx",r).ns[Ax](".")):r=t,r}a(A1e,"mergeEvtNamespace");function JQe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=KMt(e,n);if(s=dbo(t,c,r,o),s&&KQe.accept(t)){var l={guid:lbo++,evtName:c,handler:r,capture:o};MXr(t,c.type)[Bi](l)}}catch{}return s}a(JQe,"eventOn");function JMt(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=KMt(e,n),c=!1;fbo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||OXr(t,s,r,o)}catch{}}a(JMt,"eventOff");p();var y1e="sampleRate",E1e="ProcessLegacy",ZQe="http.method",Sz="https://dc.services.visualstudio.com",xM="/v2/track",Zy="not_specified";p();var XQe=LNt({requestContextHeader:[0,"Request-Context"],requestContextTargetKey:[1,"appId"],requestContextAppIdFormat:[2,"appId=cid-v1:"],requestIdHeader:[3,"Request-Id"],traceParentHeader:[4,"traceparent"],traceStateHeader:[5,"tracestate"],sdkContextHeader:[6,"Sdk-Context"],sdkContextHeaderAppIdRequest:[7,"appId"],requestContextHeaderLowerCase:[8,"request-context"]});p();p();var Tz="split",mo="length",Iz="toLowerCase",A7="ingestionendpoint",y7="toString",ZMt="removeItem",sae="message",jXr="count";var _1e="stringify",v1e="pathname",xz="match";var Xy="name";var CA="properties",eE="measurements",C1e="sizeInBytes",b1e="typeName",aae="exceptions",wz="severityLevel",eqe="problemGroup",Rz="parsedStack",S1e="hasFullStack",T1e="assembly",wM="fileName",kz="line",cae="aiDataContract",Pz="duration";function XMt(t,e,r){var n=e[mo],o=HXr(t,e);if(o[mo]!==n){for(var s=0,c=o;r[c]!==void 0;)s++,c=Kf(o,0,147)+GXr(s);o=c}return o}a(XMt,"dataSanitizeKeyAndAddUniqueness");function HXr(t,e){var r;return e&&(e=Di(Wu(e)),e[mo]>150&&(r=Kf(e,0,150),Wr(t,2,57,"name is too long. It has been truncated to 150 characters.",{name:e},!0))),r||e}a(HXr,"dataSanitizeKey");function du(t,e,r){r===void 0&&(r=1024);var n;return e&&(r=r||1024,e=Di(Wu(e)),e[mo]>r&&(n=Kf(e,0,r),Wr(t,2,61,"string value is too long. It has been truncated to "+r+" characters.",{value:e},!0))),n||e}a(du,"dataSanitizeString");function Dz(t,e,r){return Ei(e)&&(e=bMt(e,r)),rOt(t,e,2048,66)}a(Dz,"dataSanitizeUrl");function I1e(t,e){var r;return e&&e[mo]>32768&&(r=Kf(e,0,32768),Wr(t,2,56,"message is too long, it has been truncated to 32768 characters.",{message:e},!0)),r||e}a(I1e,"dataSanitizeMessage");function eOt(t,e){var r;if(e){var n=""+e;n[mo]>32768&&(r=Kf(n,0,32768),Wr(t,2,52,"exception is too long, it has been truncated to 32768 characters.",{exception:e},!0))}return r||e}a(eOt,"dataSanitizeException");function P_(t,e){if(e){var r={};Yr(e,function(n,o){if(zu(o)&&u7())try{o=k_()[_1e](o)}catch(s){Wr(t,2,49,"custom property is not valid",{exception:s},!0)}o=du(t,o,8192),n=XMt(t,n,r),r[n]=o}),e=r}return e}a(P_,"dataSanitizeProperties");function D_(t,e){if(e){var r={};Yr(e,function(n,o){n=XMt(t,n,r),r[n]=o}),e=r}return e}a(D_,"dataSanitizeMeasurements");function tOt(t,e){return e&&rOt(t,e,128,69)[y7]()}a(tOt,"dataSanitizeId");function rOt(t,e,r,n){var o;return e&&(e=Di(Wu(e)),e[mo]>r&&(o=Kf(e,0,r),Wr(t,2,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),o||e}a(rOt,"dataSanitizeInput");function GXr(t){var e="00"+t;return J7e(e,e[mo]-3)}a(GXr,"dsPadNumber");p();var $Xr=gf()||{},VXr=0,hbo=[null,null,null,null,null];function WXr(t){var e=VXr,r=hbo,n=r[e];return $Xr.createElement?r[e]||(n=r[e]=$Xr.createElement("a")):n={host:mbo(t,!0)},n.href=t,e++,e>=r[mo]&&(e=0),VXr=e,n}a(WXr,"urlParseUrl");function mbo(t,e){var r=zXr(t,e)||"";if(r){var n=r[xz](/(www\d{0,5}\.)?([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[mo]>3&&Ei(n[2])&&n[2][mo]>0)return n[2]+(n[3]||"")}return r}a(mbo,"urlParseHost");function zXr(t,e){var r=null;if(t){var n=t[xz](/(\w{1,150}):\/\/([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[mo]>2&&Ei(n[2])&&n[2][mo]>0&&(r=n[2]||"",e&&n[mo]>2)){var o=(n[1]||"")[Iz](),s=n[3]||"";(o==="http"&&s===":80"||o==="https"&&s===":443")&&(s=""),r+=s}}return r}a(zXr,"urlParseFullHost");var gbo=[Sz+xM,"https://breeze.aimon.applicationinsights.io"+xM,"https://dc-int.services.visualstudio.com"+xM];function tqe(t){return Vo(gbo,t[Iz]())!==-1}a(tqe,"isInternalApplicationInsightsEndpoint");function YXr(t,e,r,n){var o,s=n,c=n;if(e&&e[mo]>0){var l=WXr(e);if(o=l.host,!s)if(l[v1e]!=null){var u=l.pathname[mo]===0?"/":l[v1e];u.charAt(0)!=="/"&&(u="/"+u),c=l[v1e],s=du(t,r?r+" "+u:u)}else s=du(t,e)}else o=n,s=n;return{target:o,name:s,data:c}}a(YXr,"AjaxHelperParseDependencyPath");p();p();var rqe=Ube({LocalStorage:0,SessionStorage:1});var lae=void 0,KXr="";function JXr(t){try{if(Zt(Ky()))return null;var e=new Date()[y7](),r=Pi(t===rqe.LocalStorage?"localStorage":"sessionStorage"),n=KXr+e;r.setItem(n,e);var o=r.getItem(n)!==e;if(r[ZMt](n),!o)return r}catch{}return null}a(JXr,"_getVerifiedStorageObject");function nOt(){return nqe()?JXr(rqe.SessionStorage):null}a(nOt,"_getSessionStorageObject");function iOt(t){KXr=t||""}a(iOt,"utlSetStoragePrefix");function nqe(t){return(t||lae===void 0)&&(lae=!!JXr(rqe.SessionStorage)),lae}a(nqe,"utlCanUseSessionStorage");function oOt(t,e){var r=nOt();if(r!==null)try{return r.getItem(e)}catch(n){lae=!1,Wr(t,2,2,"Browser failed read of session storage. "+Hp(n),{exception:dr(n)})}return null}a(oOt,"utlGetSessionStorage");function sOt(t,e,r){var n=nOt();if(n!==null)try{return n.setItem(e,r),!0}catch(o){lae=!1,Wr(t,2,4,"Browser failed write to session storage. "+Hp(o),{exception:dr(o)})}return!1}a(sOt,"utlSetSessionStorage");function aOt(t,e){var r=nOt();if(r!==null)try{return r[ZMt](e),!0}catch(n){lae=!1,Wr(t,2,6,"Browser failed removal of session storage item. "+Hp(n),{exception:dr(n)})}return!1}a(aOt,"utlRemoveSessionStorage");p();var Abo=";",ybo="=";function x1e(t){if(!t)return{};var e=t[Tz](Abo),r=Obe(e,function(o,s){var c=s[Tz](ybo);if(c[mo]===2){var l=c[0][Iz](),u=c[1];o[l]=u}return o},{});if(Yu(r)[mo]>0){if(r.endpointsuffix){var n=r.location?r.location+".":"";r[A7]=r[A7]||"https://"+n+"dc."+r.endpointsuffix}r[A7]=r[A7]||Sz,BB(r[A7],"/")&&(r[A7]=r[A7].slice(0,-1))}return r}a(x1e,"parseConnectionString");p();var cOt=(function(){function t(e,r,n){var o=this,s=this;s.ver=1,s.sampleRate=100,s.tags={},s[Xy]=du(e,n)||Zy,s.data=r,s.time=l7(new Date),s[cae]={time:1,iKey:1,name:1,sampleRate:a(function(){return o.sampleRate===100?4:1},"sampleRate"),tags:1,data:1}}return a(t,"Envelope"),t})();p();var WB=(function(){function t(e,r,n,o){this.aiDataContract={ver:1,name:1,properties:0,measurements:0};var s=this;s.ver=2,s[Xy]=du(e,r)||Zy,s[CA]=P_(e,n),s[eE]=D_(e,o)}return a(t,"Event"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Event",t.dataType="EventData",t})();p();var Ebo=58,_bo=/^\s{0,50}(from\s|at\s|Line\s{1,5}\d{1,10}\s{1,5}of|\w{1,50}@\w{1,80}|[^\(\s\n]+:[0-9\?]+(?::[0-9\?]+)?)/,vbo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+):([0-9\?]+)\)?$/,Cbo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+)\)?$/,bbo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\)\]]+)\)?$/,Sbo=/(?:^|\(|\s{0,10}[\w\)]+\@)?([^\(\n\s\]\)]+)(?:\:([0-9]+)(?:\:([0-9]+))?)?\)?(?:,|$)/,Tbo=/([^\(\s\n]+):([0-9]+):([0-9]+)$/,Ibo=/([^\(\s\n]+):([0-9]+)$/,ZXr="",uae="error",Cx="stack",uOt="stackDetails",XXr="errorSrc",dOt="message",nen="description",een=[{re:vbo,len:5,m:1,fn:2,ln:3,col:4},{chk:wbo,pre:xbo,re:Cbo,len:4,m:1,fn:2,ln:3},{re:bbo,len:3,m:1,fn:2,hdl:ren},{re:Sbo,len:2,fn:1,hdl:ren}];function xbo(t){return t.replace(/(\(anonymous\))/,"")}a(xbo,"_scrubAnonymous");function wbo(t){return uu(t,"[native")<0}a(wbo,"_ignoreNative");function fOt(t,e){var r=t;return r&&!Ei(r)&&(JSON&&JSON[_1e]?(r=JSON[_1e](t),e&&(!r||r==="{}")&&(Lr(t[y7])?r=t[y7]():r=""+t)):r=""+t+" - (Missing JSON.stringify)"),r||""}a(fOt,"_stringify");function ien(t,e){var r=t;return t&&(r&&!Ei(r)&&(r=t[dOt]||t[nen]||r),r&&!Ei(r)&&(r=fOt(r,!0)),t.filename&&(r=r+" @"+(t.filename||"")+":"+(t.lineno||"?")+":"+(t.colno||"?"))),e&&e!=="String"&&e!=="Object"&&e!=="Error"&&uu(r||"",e)===-1&&(r=e+": "+r),r||""}a(ien,"_formatMessage");function Rbo(t){try{if(zu(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}a(Rbo,"_isExceptionDetailsInternal");function kbo(t){try{if(zu(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}a(kbo,"_isExceptionInternal");function ten(t){return t&&t.src&&Ei(t.src)&&t.obj&&ur(t.obj)}a(ten,"_isStackDetails");function Nz(t){var e=t||"";Ei(e)||(Ei(e[Cx])?e=e[Cx]:e=""+e);var r=e[Tz](` +`);return{src:e,obj:r}}a(Nz,"_convertStackObj");function Pbo(t){for(var e=[],r=t[Tz](` +`),n=0;n0){e=[];var n=0,o=!1,s=0;vt(r,function(y){if(o||Bbo(y)){var E=Wu(y);o=!0;var _=Fbo(E,n);_&&(s+=_[C1e],e.push(_),n++)}});var c=32*1024;if(s>c)for(var l=0,u=e[mo]-1,d=0,f=l,h=u;lc){var A=h-f+1;e.splice(f,A);break}f=l,h=u,l++,u--}}return e}a(Nbo,"_parseStack");function iqe(t){var e="";if(t&&(e=t.typeName||t[Xy]||"",!e))try{var r=/function (.{1,200})\(/,n=r.exec(t.constructor[y7]());e=n&&n[mo]>1?n[1]:""}catch{}return e}a(iqe,"_getErrorType");function lOt(t){if(t)try{if(!Ei(t)){var e=iqe(t),r=fOt(t,!1);return(!r||r==="{}")&&(t[uae]&&(t=t[uae],e=iqe(t)),r=fOt(t,!0)),uu(r,e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}a(lOt,"_formatErrorCode");var Mz=(function(){function t(e,r,n,o,s,c){this.aiDataContract={ver:1,exceptions:1,severityLevel:0,properties:0,measurements:0};var l=this;l.ver=2,kbo(r)?(l[aae]=r[aae]||[],l[CA]=r[CA],l[eE]=r[eE],r[wz]&&(l[wz]=r[wz]),r.id&&(l.id=r.id,r[CA].id=r.id),r[eqe]&&(l[eqe]=r[eqe]),Zt(r.isManual)||(l.isManual=r.isManual)):(n||(n={}),c&&(n.id=c),l[aae]=[sen(e,r,n)],l[CA]=P_(e,n),l[eE]=D_(e,o),s&&(l[wz]=s),c&&(l.id=c))}return a(t,"Exception"),t.CreateAutoException=function(e,r,n,o,s,c,l,u){var d=iqe(s||c||e);return{message:ien(e,d),url:r,lineNumber:n,columnNumber:o,error:lOt(s||c||e),evt:lOt(c||e),typeName:d,stackDetails:oen(l||s||c),errorSrc:u}},t.CreateFromInterface=function(e,r,n,o){var s=r[aae]&&LB(r[aae],function(l){return Lbo(e,l)}),c=new t(e,Ex(Ex({},r),{exceptions:s}),n,o);return c},t.prototype.toInterface=function(){var e=this,r=e.exceptions,n=e.properties,o=e.measurements,s=e.severityLevel,c=e.problemGroup,l=e.id,u=e.isManual,d=r instanceof Array&&LB(r,function(f){return f.toInterface()})||void 0;return{ver:"4.0",exceptions:d,severityLevel:s,properties:n,measurements:o,problemGroup:c,id:l,isManual:u}},t.CreateSimpleException=function(e,r,n,o,s,c){var l;return{exceptions:[(l={},l[S1e]=!0,l.message=e,l.stack=s,l.typeName=r,l)]}},t.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",t.dataType="ExceptionData",t.formatError=lOt,t})();var Mbo=Lh({id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2});function Obo(){var t=this,e=ur(t[Rz])&&LB(t[Rz],function(n){return Qbo(n)}),r={id:t.id,outerId:t.outerId,typeName:t[b1e],message:t[sae],hasFullStack:t[S1e],stack:t[Cx],parsedStack:e||void 0};return r}a(Obo,"_toInterface");function sen(t,e,r){var n,o,s,c,l,u,d,f;if(Rbo(e))c=e[b1e],l=e[sae],d=e[Cx],f=e[Rz]||[],u=e[S1e];else{var h=e,m=h&&h.evt;NB(h)||(h=h[uae]||m||h),c=du(t,iqe(h))||Zy,l=I1e(t,ien(e||h,c))||Zy;var g=e[uOt]||oen(e);f=Nbo(g),ur(f)&&LB(f,function(A){A[T1e]=du(t,A[T1e]),A[wM]=du(t,A[wM])}),d=eOt(t,Dbo(g)),u=ur(f)&&f[mo]>0,r&&(r[b1e]=r[b1e]||c)}return n={},n[cae]=Mbo,n.id=o,n.outerId=s,n.typeName=c,n.message=l,n[S1e]=u,n.stack=d,n.parsedStack=f,n.toInterface=Obo,n}a(sen,"_createExceptionDetails");function Lbo(t,e){var r=ur(e[Rz])&&LB(e[Rz],function(o){return Ubo(o)})||e[Rz],n=sen(t,Ex(Ex({},e),{parsedStack:r}));return n}a(Lbo,"_createExDetailsFromInterface");function aen(t,e){var r=e[xz](Tbo);if(r&&r[mo]>=4)t[wM]=r[1],t[kz]=parseInt(r[2]);else{var n=e[xz](Ibo);n&&n[mo]>=3?(t[wM]=n[1],t[kz]=parseInt(n[2])):t[wM]=e}}a(aen,"_parseFilename");function ren(t,e,r){var n=t[wM];e.fn&&r&&r[mo]>e.fn&&(e.ln&&r[mo]>e.ln?(n=Di(r[e.fn]||""),t[kz]=parseInt(Di(r[e.ln]||""))||0):n=Di(r[e.fn]||"")),n&&aen(t,n)}a(ren,"_handleFilename");function Bbo(t){var e=!1;if(t&&Ei(t)){var r=Di(t);r&&(e=_bo.test(r))}return e}a(Bbo,"_isStackFrame");var cen=Lh({level:1,method:1,assembly:0,fileName:0,line:0});function Fbo(t,e){var r,n;if(t&&Ei(t)&&Di(t)){n=(r={},r[cae]=cen,r.level=e,r.assembly=Di(t),r.method=ZXr,r.fileName="",r.line=0,r.sizeInBytes=0,r);for(var o=0;o=s.len){s.m&&(n.method=Di(c[s.m]||ZXr)),s.hdl?s.hdl(n,s,c):s.fn&&(s.ln?(n[wM]=Di(c[s.fn]||""),n[kz]=parseInt(Di(c[s.ln]||""))||0):aen(n,c[s.fn]||""));break}o++}}return len(n)}a(Fbo,"_extractStackFrame");function Ubo(t){var e,r=(e={},e[cae]=cen,e.level=t.level,e.method=t.method,e.assembly=t[T1e],e.fileName=t[wM],e.line=t[kz],e.sizeInBytes=0,e);return len(r)}a(Ubo,"_stackFrameFromInterface");function len(t){var e=Ebo;return t&&(e+=t.method[mo],e+=t.assembly[mo],e+=t.fileName[mo],e+=t.level.toString()[mo],e+=t.line.toString()[mo],t[C1e]=e),t}a(len,"_populateFrameSizeInBytes");function Qbo(t){return{level:t.level,method:t.method,assembly:t[T1e],fileName:t[wM],line:t[kz]}}a(Qbo,"_parsedFrameToInterface");p();p();var uen=(function(){function t(){this.aiDataContract={name:1,kind:0,value:1,count:0,min:0,max:0,stdDev:0},this.kind=0}return a(t,"DataPoint"),t})();var zB=(function(){function t(e,r,n,o,s,c,l,u,d){this.aiDataContract={ver:1,metrics:1,properties:0};var f=this;f.ver=2;var h=new uen;h[jXr]=o>0?o:void 0,h.max=isNaN(c)||c===null?void 0:c,h.min=isNaN(s)||s===null?void 0:s,h[Xy]=du(e,r)||Zy,h.value=n,h.stdDev=isNaN(l)||l===null?void 0:l,f.metrics=[h],f[CA]=P_(e,u),f[eE]=D_(e,d)}return a(t,"Metric"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",t.dataType="MetricData",t})();p();p();var w1e="";function oqe(t){(isNaN(t)||t<0)&&(t=0),t=uZr(t);var e=w1e+t%1e3,r=w1e+eS(t/1e3)%60,n=w1e+eS(t/(1e3*60))%60,o=w1e+eS(t/(1e3*60*60))%24,s=eS(t/(1e3*60*60*24));return e=e[mo]===1?"00"+e:e[mo]===2?"0"+e:e,r=r[mo]<2?"0"+r:r,n=n[mo]<2?"0"+n:n,o=o[mo]<2?"0"+o:o,(s>0?s+".":w1e)+o+":"+n+":"+r+"."+e}a(oqe,"msToTimeSpan");var Oz=(function(){function t(e,r,n,o,s,c,l){this.aiDataContract={ver:1,name:0,url:0,duration:0,properties:0,measurements:0,id:0};var u=this;u.ver=2,u.id=tOt(e,l),u.url=Dz(e,n),u[Xy]=du(e,r)||Zy,isNaN(o)||(u[Pz]=oqe(o)),u[CA]=P_(e,s),u[eE]=D_(e,c)}return a(t,"PageView"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",t.dataType="PageviewData",t})();p();var Lz=(function(){function t(e,r,n,o,s,c,l,u,d,f,h,m){d===void 0&&(d="Ajax"),this.aiDataContract={id:1,ver:1,name:0,resultCode:0,duration:0,success:0,data:0,target:0,type:0,properties:0,measurements:0,kind:0,value:0,count:0,min:0,max:0,stdDev:0,dependencyKind:0,dependencySource:0,commandName:0,dependencyTypeName:0};var g=this;g.ver=2,g.id=r,g[Pz]=oqe(s),g.success=c,g.resultCode=l+"",g.type=du(e,d);var A=YXr(e,n,u,o);g.data=Dz(e,o)||A.data,g.target=du(e,A.target),f&&(g.target="".concat(g.target," | ").concat(f)),g[Xy]=du(e,A[Xy]),g[CA]=P_(e,h),g[eE]=D_(e,m)}return a(t,"RemoteDependencyData"),t.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",t.dataType="RemoteDependencyData",t})();p();var Bz=(function(){function t(e,r,n,o,s){this.aiDataContract={ver:1,message:1,severityLevel:0,properties:0};var c=this;c.ver=2,r=r||Zy,c[sae]=I1e(e,r),c[CA]=P_(e,o),c[eE]=D_(e,s),n&&(c[wz]=n)}return a(t,"Trace"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Message",t.dataType="MessageData",t})();p();var Fz=(function(){function t(e,r,n,o,s,c,l){this.aiDataContract={ver:1,name:0,url:0,duration:0,perfTotal:0,networkConnect:0,sentRequest:0,receivedResponse:0,domProcessing:0,properties:0,measurements:0};var u=this;u.ver=2,u.url=Dz(e,n),u[Xy]=du(e,r)||Zy,u[CA]=P_(e,s),u[eE]=D_(e,c),l&&(u.domProcessing=l.domProcessing,u[Pz]=l[Pz],u.networkConnect=l.networkConnect,u.perfTotal=l.perfTotal,u.receivedResponse=l.receivedResponse,u.sentRequest=l.sentRequest)}return a(t,"PageViewPerformance"),t.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",t.dataType="PageviewPerformanceData",t})();p();var YB=(function(){function t(e,r){this.aiDataContract={baseType:1,baseData:1},this.baseType=e,this.baseData=r}return a(t,"Data"),t})();p();function _7(t){var e="ai."+t+".";return function(r){return e+r}}a(_7,"_aiNameFunc");var R1e=_7("application"),r0=_7("device"),sqe=_7("location"),dae=_7("operation"),pOt=_7("session"),E7=_7("user"),Uz=_7("cloud"),k1e=_7("internal"),P1e=(function(t){Jy(e,t);function e(){return t.call(this)||this}return a(e,"ContextTagKeys"),e})(uMt({applicationVersion:R1e("ver"),applicationBuild:R1e("build"),applicationTypeId:R1e("typeId"),applicationId:R1e("applicationId"),applicationLayer:R1e("layer"),deviceId:r0("id"),deviceIp:r0("ip"),deviceLanguage:r0("language"),deviceLocale:r0("locale"),deviceModel:r0("model"),deviceFriendlyName:r0("friendlyName"),deviceNetwork:r0("network"),deviceNetworkName:r0("networkName"),deviceOEMName:r0("oemName"),deviceOS:r0("os"),deviceOSVersion:r0("osVersion"),deviceRoleInstance:r0("roleInstance"),deviceRoleName:r0("roleName"),deviceScreenResolution:r0("screenResolution"),deviceType:r0("type"),deviceMachineName:r0("machineName"),deviceVMName:r0("vmName"),deviceBrowser:r0("browser"),deviceBrowserVersion:r0("browserVersion"),locationIp:sqe("ip"),locationCountry:sqe("country"),locationProvince:sqe("province"),locationCity:sqe("city"),operationId:dae("id"),operationName:dae("name"),operationParentId:dae("parentId"),operationRootId:dae("rootId"),operationSyntheticSource:dae("syntheticSource"),operationCorrelationVector:dae("correlationVector"),sessionId:pOt("id"),sessionIsFirst:pOt("isFirst"),sessionIsNew:pOt("isNew"),userAccountAcquisitionDate:E7("accountAcquisitionDate"),userAccountId:E7("accountId"),userAgent:E7("userAgent"),userId:E7("id"),userStoreRegion:E7("storeRegion"),userAuthUserId:E7("authUserId"),userAnonymousUserAcquisitionDate:E7("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:E7("authUserAcquisitionDate"),cloudName:Uz("name"),cloudRole:Uz("role"),cloudRoleVer:Uz("roleVer"),cloudRoleInstance:Uz("roleInstance"),cloudEnvironment:Uz("environment"),cloudLocation:Uz("location"),cloudDeploymentUnit:Uz("deploymentUnit"),internalNodeName:k1e("nodeName"),internalSdkVersion:k1e("sdkVersion"),internalAgentVersion:k1e("agentVersion"),internalSnippet:k1e("snippet"),internalSdkSrc:k1e("sdkSrc")}));p();var Uh=new P1e;p();function den(t,e){JMt(t,null,null,e)}a(den,"_disableEvents");function hOt(t){var e=gf(),r=Ku(),n=!1,o=[],s=1;r&&!Zt(r.onLine)&&!r.onLine&&(s=2);var c=0,l=m(),u=A1e(cS("OfflineListener"),t);try{if(f(Af())&&(n=!0),e){var d=e.body||e;d.ononline&&f(d)&&(n=!0)}}catch{n=!1}function f(b){var T=!1;return b&&(T=JQe(b,"online",y,u),T&&JQe(b,"offline",E,u)),T}a(f,"_enableEvents");function h(){return l}a(h,"_isOnline");function m(){return!(c===2||s===2)}a(m,"calCurrentState");function g(){var b=m();l!==b&&(l=b,vt(o,function(T){var w={isOnline:l,rState:s,uState:c};try{T(w)}catch{}}))}a(g,"listnerNoticeCheck");function A(b){c=b,g()}a(A,"setOnlineState");function y(){s=1,g()}a(y,"_setOnline");function E(){s=2,g()}a(E,"_setOffline");function _(){var b=Af();if(b&&n){if(den(b,u),e){var T=e.body||e;Nn(T.ononline)||den(T,u)}n=!1}}a(_,"_unload");function v(b){return o.push(b),{rm:a(function(){var T=o.indexOf(b);if(T>-1)return o.splice(T,1)},"rm")}}return a(v,"addListener"),{isOnline:h,isListening:a(function(){return n},"isListening"),unload:_,addListener:v,setOnlineState:A}}a(hOt,"createOfflineListener");var aqe="AppInsightsChannelPlugin";p();p();p();p();p();var v7="duration";p();var Qh="tags",cqe="deviceType",_C="data",RM="name",Qz="traceID",Bo="length",C7="stringify",b7="measurements",bx="dataType",S7="envelopeType",KB="toString",JB="enqueue",ZB="count",Sx="push",D1e="emitLineDelimitedJson",T7="clear",fae="markAsSent",qz="clearSent",N1e="bufferOverride",pae="BUFFER_KEY",XB="SENT_BUFFER_KEY",I7="concat",hae="MAX_BUFFER_SIZE",mae="triggerSend",bA="diagLog",lqe="initialize",gae="_sender",Aae="endpointUrl",yae="instrumentationKey",uqe="customHeaders",mOt="maxBatchSizeInBytes",dqe="onunloadDisableBeacon",fqe="isBeaconApiDisabled",gOt="alwaysUseXhrOverride",AOt="enableSessionStorageBuffer",dP="_buffer",yOt="onunloadDisableFetch",EOt="disableSendBeaconSplit",M1e="getSenderInst",x7="_onError",pqe="_onPartialSuccess",O1e="_onSuccess",hqe="itemsReceived",mqe="itemsAccepted",gqe="baseType",Eae="sampleRate",fen="getHashCodeScore";var _Ot="baseType",Ud="baseData",sg="properties",pen="true";function Gp(t,e,r){return SM(t,e,r,Z1)}a(Gp,"_setValueIf");function qbo(t,e,r){var n=r[Qh]=r[Qh]||{},o=e.ext=e.ext||{},s=e[Qh]=e[Qh]||[],c=o.user;c&&(Gp(n,Uh.userAuthUserId,c.authId),Gp(n,Uh.userId,c.id||c.localId));var l=o.app;l&&Gp(n,Uh.sessionId,l.sesId);var u=o.device;u&&(Gp(n,Uh.deviceId,u.id||u.localId),Gp(n,Uh[cqe],u.deviceClass),Gp(n,Uh.deviceIp,u.ip),Gp(n,Uh.deviceModel,u.model),Gp(n,Uh[cqe],u[cqe]));var d=e.ext.web;if(d){Gp(n,Uh.deviceLanguage,d.browserLang),Gp(n,Uh.deviceBrowserVersion,d.browserVer),Gp(n,Uh.deviceBrowser,d.browser);var f=r[_C]=r[_C]||{},h=f[Ud]=f[Ud]||{},m=h[sg]=h[sg]||{};Gp(m,"domain",d.domain),Gp(m,"isManual",d.isManual?pen:null),Gp(m,"screenRes",d.screenRes),Gp(m,"userConsent",d.userConsent?pen:null)}var g=o.os;g&&(Gp(n,Uh.deviceOS,g[RM]),Gp(n,Uh.deviceOSVersion,g.osVer));var A=o.trace;A&&(Gp(n,Uh.operationParentId,A.parentID),Gp(n,Uh.operationName,du(t,A[RM])),Gp(n,Uh.operationId,A[Qz]));for(var y={},E=s[Bo]-1;E>=0;E--){var _=s[E];Yr(_,function(b,T){y[b]=T}),s.splice(E,1)}Yr(s,function(b,T){y[b]=T});var v=Ex(Ex({},n),y);v[Uh.internalSdkVersion]||(v[Uh.internalSdkVersion]=du(t,"javascript:".concat(jbo.Version),64)),r[Qh]=wQe(v)}a(qbo,"_extractPartAExtensions");function w7(t,e,r){Zt(t)||Yr(t,function(n,o){Oh(o)?r[n]=o:Ei(o)?e[n]=o:u7()&&(e[n]=k_()[C7](o))})}a(w7,"_extractPropsAndMeasurements");function jz(t,e){Zt(t)||Yr(t,function(r,n){t[r]=n||e})}a(jz,"_convertPropsUndefinedToCustomDefinedValue");function Hz(t,e,r,n){var o=new cOt(t,n,e);Gp(o,"sampleRate",r[y1e]),(r[Ud]||{}).startTime&&(o.time=l7(r[Ud].startTime)),o.iKey=r.iKey;var s=r.iKey.replace(/-/g,"");return o[RM]=o[RM].replace("{0}",s),qbo(t,r,o),r[Qh]=r[Qh]||[],wQe(o)}a(Hz,"_createEnvelope");function Gz(t,e){Zt(e[Ud])&&Wr(t,1,46,"telemetryItem.baseData cannot be null.")}a(Gz,"EnvelopeCreatorInit");var jbo={Version:"3.3.11"};function hen(t,e,r){Gz(t,e);var n=e[Ud][b7]||{},o=e[Ud][sg]||{};w7(e[_C],o,n),Zt(r)||jz(o,r);var s=e[Ud];if(Zt(s))return $B(t,"Invalid input for dependency data"),null;var c=s[sg]&&s[sg][ZQe]?s[sg][ZQe]:"GET",l=new Lz(t,s.id,s.target,s[RM],s[v7],s.success,s.responseCode,c,s.type,s.correlationContext,o,n),u=new YB(Lz[bx],l);return Hz(t,Lz[S7],e,u)}a(hen,"DependencyEnvelopeCreator");function vOt(t,e,r){Gz(t,e);var n={},o={};e[_Ot]!==WB[bx]&&(n.baseTypeSource=e[_Ot]),e[_Ot]===WB[bx]?(n=e[Ud][sg]||{},o=e[Ud][b7]||{}):e[Ud]&&w7(e[Ud],n,o),w7(e[_C],n,o),Zt(r)||jz(n,r);var s=e[Ud][RM],c=new WB(t,s,n,o),l=new YB(WB[bx],c);return Hz(t,WB[S7],e,l)}a(vOt,"EventEnvelopeCreator");function men(t,e,r){Gz(t,e);var n=e[Ud][b7]||{},o=e[Ud][sg]||{};w7(e[_C],o,n),Zt(r)||jz(o,r);var s=e[Ud],c=Mz.CreateFromInterface(t,s,o,n),l=new YB(Mz[bx],c);return Hz(t,Mz[S7],e,l)}a(men,"ExceptionEnvelopeCreator");function gen(t,e,r){Gz(t,e);var n=e[Ud],o=n[sg]||{},s=n[b7]||{};w7(e[_C],o,s),Zt(r)||jz(o,r);var c=new zB(t,n[RM],n.average,n.sampleCount,n.min,n.max,n.stdDev,o,s),l=new YB(zB[bx],c);return Hz(t,zB[S7],e,l)}a(gen,"MetricEnvelopeCreator");function Aen(t,e,r){Gz(t,e);var n,o=e[Ud];!Zt(o)&&!Zt(o[sg])&&!Zt(o[sg][v7])?(n=o[sg][v7],delete o[sg][v7]):!Zt(e[_C])&&!Zt(e[_C][v7])&&(n=e[_C][v7],delete e[_C][v7]);var s=e[Ud],c;((e.ext||{}).trace||{})[Qz]&&(c=e.ext.trace[Qz]);var l=s.id||c,u=s[RM],d=s.uri,f=s[sg]||{},h=s[b7]||{};if(Zt(s.refUri)||(f.refUri=s.refUri),Zt(s.pageType)||(f.pageType=s.pageType),Zt(s.isLoggedIn)||(f.isLoggedIn=s.isLoggedIn[KB]()),!Zt(s[sg])){var m=s[sg];Yr(m,function(y,E){f[y]=E})}w7(e[_C],f,h),Zt(r)||jz(f,r);var g=new Oz(t,u,d,n,f,h,l),A=new YB(Oz[bx],g);return Hz(t,Oz[S7],e,A)}a(Aen,"PageViewEnvelopeCreator");function yen(t,e,r){Gz(t,e);var n=e[Ud],o=n[RM],s=n.uri||n.url,c=n[sg]||{},l=n[b7]||{};w7(e[_C],c,l),Zt(r)||jz(c,r);var u=new Fz(t,o,s,void 0,c,l,n),d=new YB(Fz[bx],u);return Hz(t,Fz[S7],e,d)}a(yen,"PageViewPerformanceEnvelopeCreator");function Een(t,e,r){Gz(t,e);var n=e[Ud].message,o=e[Ud].severityLevel,s=e[Ud][sg]||{},c=e[Ud][b7]||{};w7(e[_C],s,c),Zt(r)||jz(s,r);var l=new Bz(t,n,o,s,c),u=new YB(Bz[bx],l);return Hz(t,Bz[S7],e,u)}a(Een,"TraceEnvelopeCreator");p();var _en=(function(){function t(e,r){var n=[],o=!1,s=r.maxRetryCnt;this._get=function(){return n},this._set=function(c){return n=c,n},Si(t,this,function(c){c[JB]=function(l){if(c[ZB]()>=r.eventsLimitInMem){o||(Wr(e,2,105,"Maximum in-memory buffer size reached: "+c[ZB](),!0),o=!0);return}l.cnt=l.cnt||0,!(!Zt(s)&&l.cnt>s)&&n[Sx](l)},c[ZB]=function(){return n[Bo]},c.size=function(){for(var l=n[Bo],u=0;u0){var u=[];vt(l,function(f){u[Sx](f.item)});var d=r[D1e]?u.join(` +`):"["+u.join(",")+"]";return d}return null},c.createNew=function(l,u,d){var f=n.slice(0);l=l||e,u=u||{};var h=d?new COt(l,u):new Aqe(l,u);return vt(f,function(m){h[JB](m)}),h}})}return a(t,"BaseSendBuffer"),t.__ieDyn=1,t})(),Aqe=(function(t){Jy(e,t);function e(r,n){var o=t.call(this,r,n)||this;return Si(e,o,function(s,c){s[fae]=function(l){c[T7]()},s[qz]=function(l){}}),o}return a(e,"ArraySendBuffer"),e.__ieDyn=1,e})(_en);var Hbo=["AI_buffer","AI_sentBuffer"],COt=(function(t){Jy(e,t);function e(n,o){var s=t.call(this,n,o)||this,c=!1,l=o?.namePrefix,u=o[N1e]||{getItem:oOt,setItem:sOt},d=u.getItem,f=u.setItem,h=o.maxRetryCnt;return Si(e,s,function(m,g){var A=T(e[pae]),y=T(e[XB]),E=x(),_=y[I7](E),v=m._set(A[I7](_));v[Bo]>e[hae]&&(v[Bo]=e[hae]),R(e[XB],[]),R(e[pae],v),m[JB]=function(D){if(m[ZB]()>=e[hae]){c||(Wr(n,2,67,"Maximum buffer size reached: "+m[ZB](),!0),c=!0);return}D.cnt=D.cnt||0,!(!Zt(h)&&D.cnt>h)&&(g[JB](D),R(e[pae],m._get()))},m[T7]=function(){g[T7](),R(e[pae],m._get()),R(e[XB],[]),c=!1},m[fae]=function(D){R(e[pae],m._set(b(D,m._get())));var N=T(e[XB]);N instanceof Array&&D instanceof Array&&(N=N[I7](D),N[Bo]>e[hae]&&(Wr(n,1,67,"Sent buffer reached its maximum size: "+N[Bo],!0),N[Bo]=e[hae]),R(e[XB],N))},m[qz]=function(D){var N=T(e[XB]);N=b(D,N),R(e[XB],N)},m.createNew=function(D,N,L){L=!!L;var B=m._get().slice(0),j=T(e[XB]).slice(0);D=D||n,N=N||{},m[T7]();var M=L?new e(D,N):new Aqe(D,N);return vt(B,function(O){M[JB](O)}),L&&M[fae](j),M};function b(D,N){var L=[],B=[];return vt(D,function(j){B[Sx](j.item)}),vt(N,function(j){!Lr(j)&&Vo(B,j.item)===-1&&L[Sx](j)}),L}a(b,"_removePayloadsFromBuffer");function T(D){var N=D;return N=l?l+"_"+N:N,w(N)}a(T,"_getBuffer");function w(D){try{var N=d(n,D);if(N){var L=k_().parse(N);if(Ei(L)&&(L=k_().parse(L)),L&&ur(L))return L}}catch(B){Wr(n,1,42," storage key: "+D+", "+Hp(B),{exception:dr(B)})}return[]}a(w,"_getBufferBase");function R(D,N){var L=D;try{L=l?l+"_"+L:L;var B=JSON[C7](N);f(n,L,B)}catch(j){f(n,L,JSON[C7]([])),Wr(n,2,41," storage key: "+L+", "+Hp(j)+". Buffer cleared",{exception:dr(j)})}}a(R,"_setBuffer");function x(){var D=[];try{return vt(Hbo,function(N){var L=P(N);if(D=D[I7](L),l){var B=l+"_"+N,j=P(B);D=D[I7](j)}}),D}catch(N){Wr(n,2,41,"Transfer events from previous buffers: "+Hp(N)+". previous Buffer items can not be removed",{exception:dr(N)})}return[]}a(x,"_getPreviousEvents");function P(D){try{var N=w(D),L=[];return vt(N,function(B){var j={item:B,cnt:0};L[Sx](j)}),aOt(n,D),L}catch{}return[]}a(P,"_getItemsFromPreviousKey")}),s}a(e,"SessionStorageSendBuffer");var r;return r=e,e.VERSION="_1",e.BUFFER_KEY="AI_buffer"+r.VERSION,e.SENT_BUFFER_KEY="AI_sentBuffer"+r.VERSION,e.MAX_BUFFER_SIZE=2e3,e})(_en);p();var ven=(function(){function t(e){Si(t,this,function(r){r.serialize=function(c){var l=n(c,"root");try{return k_()[C7](l)}catch(u){Wr(e,1,48,u&&Lr(u[KB])?u[KB]():"Error serializing object",null,!0)}};function n(c,l){var u="__aiCircularRefCheck",d={};if(!c)return Wr(e,1,48,"cannot serialize object because it is null or undefined",{name:l},!0),d;if(c[u])return Wr(e,2,50,"Circular reference detected while serializing object",{name:l},!0),d;if(!c.aiDataContract){if(l==="measurements")d=s(c,"number",l);else if(l==="properties")d=s(c,"string",l);else if(l==="tags")d=s(c,"string",l);else if(ur(c))d=o(c,l);else{Wr(e,2,49,"Attempting to serialize an object which does not implement ISerializable",{name:l},!0);try{k_()[C7](c),d=c}catch(f){Wr(e,1,48,f&&Lr(f[KB])?f[KB]():"Error serializing object",null,!0)}}return d}return c[u]=!0,Yr(c.aiDataContract,function(f,h){var m=Lr(h)?h()&1:h&1,g=Lr(h)?h()&4:h&4,A=h&2,y=c[f]!==void 0,E=zu(c[f])&&c[f]!==null;if(m&&!y&&!A)Wr(e,1,24,"Missing required field specification. The field is required but not present on source",{field:f,name:l});else if(!g){var _=void 0;E?A?_=o(c[f],f):_=n(c[f],f):_=c[f],_!==void 0&&(d[f]=_)}}),delete c[u],d}a(n,"_serializeObject");function o(c,l){var u;if(c)if(!ur(c))Wr(e,1,54,`This field was specified as an array in the contract but the item is not an array.\r +`,{name:l},!0);else{u=[];for(var d=0;d100||e<0)&&(n.throwInternal(2,58,"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.",{samplingRate:e},!0),e=100),this[Eae]=e,this.samplingScoreGenerator=new ben}return a(t,"Sample"),t.prototype.isSampledIn=function(e){var r=this[Eae],n=!1;return r==null||r>=100||e.baseType===zB[bx]?!0:(n=this.samplingScoreGenerator.getSamplingScore(e)0&&t<=100}a(Wbo,"_chkSampling");var zbo=(e3={},e3[WB.dataType]=vOt,e3[Bz.dataType]=Een,e3[Oz.dataType]=Aen,e3[Fz.dataType]=yen,e3[Mz.dataType]=men,e3[zB.dataType]=gen,e3[Lz.dataType]=hen,e3),bOt=(function(t){Jy(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=aqe;var n,o,s,c,l,u,d,f,h=0,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,j,M,O,U,q,Q,Y,W,V,z,ie;return Si(e,r,function(H,te){je(),H.pause=function(){me(),c=!0},H.resume=function(){c&&(c=!1,o=null,tt(),Ue())},H.flush=function(J,ae,Ce){if(J===void 0&&(J=!0),!c){me();try{var Re=H[mae](J,null,Ce||1);return vl(Re,function($e){return ae?(ae(!$e.rejected),!0):J?Fd(function(Ye){Ye(!$e.rejected)}):Re})}catch($e){Wr(H[bA](),1,22,"flush failed, telemetry will not be collected: "+Hp($e),{exception:dr($e)})}}},H.onunloadFlush=function(){if(!c)if(v||O)try{return H[mae](!0,kt,2)}catch(J){Wr(H[bA](),1,20,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+Hp(J),{exception:dr(J)})}else H.flush(!1)},H.addHeader=function(J,ae){f[J]=ae},H[lqe]=function(J,ae,Ce,Re){H.isInitialized()&&Wr(H[bA](),1,28,"Sender is already initialized"),te[lqe](J,ae,Ce,Re);var $e=H.identifier;u=new ven(ae.logger),n=0,o=null,s=0,H[gae]=null,d=0;var Ye=H[bA]();A=A1e(cS("Sender"),ae.evtNamespace&&ae.evtNamespace()),g=hOt(A),H._addHook(_x(J,function(lt){var yt=lt.cfg;yt.storagePrefix&&iOt(yt.storagePrefix);var $t=lP(null,yt,ae),St=$t.getExtCfg($e,xen),We=St[Aae];if(y&&We===y){var ce=yt[Aae];ce&&ce!==We&&(St[Aae]=ce)}var Pe=Pi("CompressionStream");ie=dMt("zipPayload",yt,!1),Lr(Pe)||(ie=!1);var Me=St.corsPolicy;Me?(Me==="same-origin"||Me==="same-site"||Me==="cross-origin")&&r.addHeader(wen,Me):delete f[wen],ig(St[yae])&&(St[yae]=yt[yae]),qi(H,"_senderConfig",{g:a(function(){return St},"g")}),E!==St[Aae]&&(y=E=St[Aae]),ae.activeStatus()===iP.PENDING?H.pause():ae.activeStatus()===iP.ACTIVE&&H.resume(),w&&w!==St[uqe]&&vt(w,function(_r){delete f[_r.header]}),_=St[mOt],v=(St[dqe]===!1||St[fqe]===!1)&&d7(),b=St[dqe]===!1&&d7(),T=St[fqe]===!1&&d7(),O=St[gOt],U=!!St.disableXhr,z=St.retryCodes;var ye=St[N1e],oe=!!St[AOt]&&(!!ye||nqe()),Ke=St.namePrefix,at=oe!==L||oe&&j!==Ke||oe&&B!==ye;if(H[dP]){if(at)try{H[dP]=H[dP].createNew(Ye,St,oe)}catch(_r){Wr(H[bA](),1,12,"failed to transfer telemetry to different buffer storage, telemetry will be lost: "+Hp(_r),{exception:dr(_r)})}tt()}else H[dP]=oe?new COt(Ye,St):new Aqe(Ye,St);j=Ke,L=oe,B=ye,q=!St[yOt]&&n1e(!0),W=!!St[EOt],H._sample=new Sen(St.samplingPercentage,Ye),x=St[yae],!ig(x)&&!Qe(x,yt)&&Wr(Ye,1,100,"Invalid Instrumentation key "+x),w=St[uqe],Ei(y)&&!tqe(y)&&w&&w[Bo]>0?vt(w,function(_r){r.addHeader(_r.header,_r.value)}):w=null,M=St.enableSendPromise;var Gt=Le();V?V.SetConfig(Gt):(V=new zMt,V[lqe](Gt,Ye));var gr=St.httpXHROverride,ar=null,Or=null,Hr=kQe([3,1,2],St.transports);ar=V&&V[M1e](Hr,!1);var Gr=V&&V.getFallbackInst();Q=a(function(_r,W0){return Ne(Gr,_r,W0)},"_xhrSend"),Y=a(function(_r,W0){return Ne(Gr,_r,W0,!1)},"_fallbackSend"),ar=O?gr:ar||gr||Gr,H[gae]=function(_r,W0){return Ne(ar,_r,W0)},q&&(m=se);var zt=kQe([3,1],St.unloadTransports);q||(zt=zt.filter(function(_r){return _r!==2})),Or=V&&V[M1e](zt,!0),Or=O?gr:Or||gr,(O||St.unloadTransports||!m)&&Or&&(m=a(function(_r,W0){return Ne(Or,_r,W0)},"_syncUnloadSender")),m||(m=Q),R=St.disableTelemetry,P=St.convertUndefined||fP,D=St.isRetryDisabled,N=St.maxBatchInterval}))},H.processTelemetry=function(J,ae){ae=H._getTelCtx(ae);var Ce=ae[bA]();try{var Re=K(J,Ce);if(!Re)return;var $e=he(J,Ce);if(!$e)return;var Ye=u.serialize($e),lt=H[dP];tt(Ye);var yt={item:Ye,cnt:0};lt[JB](yt),Ue()}catch($t){Wr(Ce,2,12,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+Hp($t),{exception:dr($t)})}H.processNext(J,ae)},H.isCompletelyIdle=function(){return!c&&h===0&&H._buffer[ZB]()===0},H.getOfflineListener=function(){return g},H._xhrReadyStateChange=function(J,ae,Ce){if(!F(ae))return ge(J,ae,Ce)},H[mae]=function(J,ae,Ce){J===void 0&&(J=!0);var Re;if(!c)try{var $e=H[dP];if(R)$e[T7]();else{if($e[ZB]()>0){var Ye=$e.getItems();Ge(Ce||0,J),ae?Re=ae.call(H,Ye,J):Re=H[gae](Ye,J)}s=+new Date}me()}catch(yt){var lt=vMt();(!lt||lt>9)&&Wr(H[bA](),1,40,"Telemetry transmission failed, some telemetry will be lost: "+Hp(yt),{exception:dr(yt)})}return Re},H.getOfflineSupport=function(){return{getUrl:a(function(){return y},"getUrl"),createPayload:qe,serialize:X,batch:de,shouldProcess:a(function(J){return!!K(J)},"shouldProcess")}},H._doTeardown=function(J,ae){H.onunloadFlush(),GB(g,!1),je()},H[x7]=function(J,ae,Ce){if(!F(J))return Oe(J,ae,Ce)},H[pqe]=function(J,ae){if(!F(J))return we(J,ae)},H[O1e]=function(J,ae){if(!F(J))return re(J,ae)},H._xdrOnLoad=function(J,ae){if(!F(ae))return le(J,ae)};function le(J,ae){var Ce=Ien(J);if(J&&(Ce+""=="200"||Ce===""))n=0,H[O1e](ae,0);else{var Re=g1e(Ce);Re&&Re[hqe]&&Re[hqe]>Re[mqe]&&!D?H[pqe](ae,Re):H[x7](ae,e1e(J))}}a(le,"_xdrOnLoad");function Le(){try{var J={xdrOnComplete:a(function(Ce,Re,$e){var Ye=ee($e);if(Ye)return le(Ce,Ye)},"xdrOnComplete"),fetchOnComplete:a(function(Ce,Re,$e,Ye){var lt=ee(Ye);if(lt)return st(Ce.status,lt,Ce.url,lt[Bo],Ce.statusText,$e||"")},"fetchOnComplete"),xhrOnComplete:a(function(Ce,Re,$e){var Ye=ee($e);if(Ye)return ge(Ce,Ye,Ye[Bo])},"xhrOnComplete"),beaconOnRetry:a(function(Ce,Re,$e){return Ht(Ce,Re,$e)},"beaconOnRetry")},ae={enableSendPromise:M,isOneDs:!1,disableCredentials:!1,disableXhr:U,disableBeacon:!T,disableBeaconSync:!b,senderOnCompleteCallBack:J};return ae}catch{}return null}a(Le,"_getSendPostMgrConfig");function ge(J,ae,Ce){J.readyState===4&&st(J.status,ae,J.responseURL,Ce,vz(J),Ien(J)||J.response)}a(ge,"_xhrReadyStateChange");function Oe(J,ae,Ce){Wr(H[bA](),2,26,"Failed to send telemetry.",{message:ae}),H._buffer&&H._buffer[qz](J)}a(Oe,"_onError");function we(J,ae){for(var Ce=[],Re=[],$e=ae.errors.reverse(),Ye=0,lt=$e;Ye0&&H[O1e](J,ae[mqe]),Ce[Bo]>0&&H[x7](Ce,vz(null,["partial success",ae[mqe],"of",ae.itemsReceived].join(" "))),Re[Bo]>0&&(be(Re),Wr(H[bA](),2,40,"Partial success. Delivered: "+J[Bo]+", Failed: "+Ce[Bo]+". Will retry to send "+Re[Bo]+" our of "+ae[hqe]+" items"))}a(we,"_onPartialSuccess");function re(J,ae){H._buffer&&H._buffer[qz](J)}a(re,"_onSuccess");function ee(J){try{if(J){var ae=J,Ce=ae.oriPayload;return Ce&&Ce[Bo]?Ce:null}}catch{}return null}a(ee,"_getPayloadArr");function K(J,ae){if(R)return!1;if(!J)return ae&&Wr(ae,1,7,"Cannot send empty telemetry"),!1;if(J.baseData&&!J[gqe])return ae&&Wr(ae,1,70,"Cannot send telemetry without baseData and baseType"),!1;if(J[gqe]||(J[gqe]="EventData"),!H[gae])return ae&&Wr(ae,1,28,"Sender was not initialized"),!1;if(ne(J))J[y1e]=H._sample[Eae];else return ae&&Wr(ae,2,33,"Telemetry item was sampled out and not sent",{SampleRate:H._sample[Eae]}),!1;return!0}a(K,"_validate");function he(J,ae){var Ce=J.iKey||x,Re=e.constructEnvelope(J,Ce,ae,P);if(!Re){Wr(ae,1,47,"Unable to create an AppInsights envelope");return}var $e=!1;if(J[Qh]&&J[Qh][E1e]&&(vt(J[Qh][E1e],function(Ye){try{Ye&&Ye(Re)===!1&&($e=!0,$B(ae,"Telemetry processor check returns false"))}catch(lt){Wr(ae,1,64,"One of telemetry initializers failed, telemetry item will not be sent: "+Hp(lt),{exception:dr(lt)},!0)}}),delete J[Qh][E1e]),!$e)return Re}a(he,"_getEnvelope");function X(J){var ae=Ten,Ce=H[bA]();try{var Re=K(J,Ce),$e=null;Re&&($e=he(J,Ce)),$e&&(ae=u.serialize($e))}catch{}return ae}a(X,"_serialize");function de(J){var ae=Ten;return J&&J[Bo]&&(ae="["+J.join(",")+"]"),ae}a(de,"_batch");function qe(J){var ae=Be();return{urlString:y,data:J,headers:ae}}a(qe,"_createPayload");function ne(J){return H._sample.isSampledIn(J)}a(ne,"_isSampledIn");function ue(J,ae,Ce,Re){ae===200&&J?H._onSuccess(J,J[Bo]):Re&&H[x7](J,Re)}a(ue,"_getOnComplete");function Ne(J,ae,Ce,Re){Re===void 0&&(Re=!0);var $e=a(function(ce,Pe,Me){return ue(ae,ce,Pe,Me)},"onComplete"),Ye=Ie(ae),lt=J&&J.sendPOST;if(lt&&Ye){Re&&H._buffer[fae](ae);var yt,$t=!1,St,We;return V.preparePayload(function(ce){yt=lt(ce,$e,!Ce),$t=!0,St&&yQe(yt,St,We)},ie,Ye,!Ce),$t?yt:Fd(function(ce,Pe){St=ce,We=Pe})}return null}a(Ne,"_doSend");function Ie(J){if(ur(J)&&J[Bo]>0){var ae=H[dP].batchPayloads(J),Ce=Be(),Re={data:ae,urlString:y,headers:Ce,disableXhrSync:U,disableFetchKeepAlive:!q,oriPayload:J};return Re}return null}a(Ie,"_getPayload");function Be(){try{var J=f||{};return tqe(y)&&(J[XQe[6]]=XQe[7]),J}catch{}return null}a(Be,"_getHeaders");function tt(J){var ae=J?J[Bo]:0;return H[dP].size()+ae>_?((!g||g.isOnline())&&H[mae](!0,null,10),!0):!1}a(tt,"_checkMaxSize");function st(J,ae,Ce,Re,$e,Ye){var lt=null;if(H._appId||(lt=g1e(Ye),lt&<.appId&&(H._appId=lt.appId)),(J<200||J>=300)&&J!==0){if((J===301||J===307||J===308)&&!_t(Ce)){H[x7](ae,$e);return}if(g&&!g.isOnline()){if(!D){var yt=10;be(ae,yt),Wr(H[bA](),2,40,". Offline - Response Code: ".concat(J,". Offline status: ").concat(!g.isOnline(),". Will retry to send ").concat(ae.length," items."))}return}!D&&Z(J)?(be(ae),Wr(H[bA](),2,40,". Response code "+J+". Will retry to send "+ae[Bo]+" items.")):H[x7](ae,$e)}else _t(Ce),J===206?(lt||(lt=g1e(Ye)),lt&&!D?H[pqe](ae,lt):H[x7](ae,$e)):(n=0,H[O1e](ae,Re))}a(st,"_checkResponsStatus");function _t(J){return d>=10?!1:!Zt(J)&&J!==""&&J!==y?(y=J,++d,!0):!1}a(_t,"_checkAndUpdateEndPointUrl");function kt(J,ae){if(m)m(J,!1);else{var Ce=V&&V[M1e]([3],!0);return Ne(Ce,J,ae)}}a(kt,"_doUnloadSend");function Ht(J,ae,Ce){var Re=J,$e=Re&&Re.oriPayload;if(W)Y&&Y($e,!0),Wr(H[bA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender.");else{for(var Ye=[],lt=0;lt<$e[Bo];lt++){var yt=$e[lt],$t=[yt],St=Ie($t);Ce(St,ae)?H._onSuccess($t,$t[Bo]):Ye[Sx](yt)}Ye[Bo]>0&&(Y&&Y(Ye,!0),Wr(H[bA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender."))}}a(Ht,"_onBeaconRetry");function F(J){try{if(J&&J[Bo])return Ei(J[0])}catch{}return null}a(F,"_isStringArr");function se(J,ae){var Ce=null;if(ur(J)){for(var Re=J[Bo],$e=0;$e-1}a(Z,"_isRetriable");function ve(){var J="getNotifyMgr",ae,Ce=H.core;return Ce&&(Ce[J]?ae=Ce[J]():ae=Ce._notificationManager),ae}a(ve,"_getNotifyMgr");function Ge(J,ae){var Ce=ve();if(Ce&&Ce.eventsSendRequest)try{Ce.eventsSendRequest(J,ae)}catch(Re){Wr(H[bA](),1,74,"send request notification failed: "+Hp(Re),{exception:dr(Re)})}}a(Ge,"_notifySendRequest");function Qe(J,ae){var Ce=ae.disableInstrumentationKeyValidation,Re=Zt(Ce)?!1:Ce;if(Re)return!0;var $e="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",Ye=new RegExp($e);return Ye.test(J)}a(Qe,"_validateInstrumentationKey");function je(){H[gae]=null,H[dP]=null,H._appId=null,H._sample=null,f={},g=null,n=0,o=null,s=null,c=!1,l=null,u=null,d=0,h=0,m=null,A=null,y=null,E=null,_=0,v=!1,w=null,R=!1,x=null,P=fP,D=!1,L=null,j=fP,U=!1,q=!1,W=!1,Q=null,Y=null,V=null,qi(H,"_senderConfig",{g:a(function(){return RQe({},xen)},"g")})}a(je,"_initDefaults")}),r}return a(e,"Sender"),e.constructEnvelope=function(r,n,o,s){var c;n!==r.iKey&&!Zt(n)?c=Ex(Ex({},r),{iKey:n}):c=r;var l=zbo[c.baseType]||vOt;return l(o,c,s)},e})(m1e);p();var $z="instrumentationKey",L1e="connectionString",_ae="endpointUrl",vae="userOverrideEndpointUrl";var Vz,SOt,TOt=void 0,Ybo=(Vz={diagnosticLogInterval:tae(Kbo,1e4)},Vz[L1e]=TOt,Vz.endpointUrl=TOt,Vz[$z]=TOt,Vz.featureOptIn=(SOt={},SOt.zipPayload={mode:1},SOt),Vz.extensionConfig={},Vz);function Kbo(t){return t&&t>0}a(Kbo,"_chkDiagLevel");var Ren=(function(){function t(e){var r=new VMt,n;(Zt(e)||Zt(e[$z])&&Zt(e[L1e]))&&el("Invalid input configuration"),Si(t,this,function(s){qi(s,"config",{g:a(function(){return n},"g")}),c(),s.initialize=c,s.track=o,_z(s,r,["flush","pollInternalLogs","stopPollingInternalLogs","unload","getPlugin","addPlugin","evtNamespace","addUnloadCb","onCfgChange","getTraceCtx","updateCfg","addTelemetryInitializer"]);function c(){var l=Fh(e||{},Ybo);n=l.cfg,r.addUnloadHook(_x(l,function(){var u=n[L1e];if(ig(u)){var d=Jbe(function(g,A){vl(u,function(y){var E=y.value,_=n[$z];if(!y.rejected&&E){n[L1e]=E;var v=x1e(E);_=v.instrumentationkey||_}g(_)})}),f=Jbe(function(g,A){vl(u,function(y){var E=y.value,_=n[_ae];if(!y.rejected&&E){var v=x1e(E),b=v.ingestionendpoint;_=b?b+xM:_}g(_)})});n[$z]=d,n[_ae]=n[vae]||f}if(Ei(u)){var h=x1e(u),m=h.ingestionendpoint;n[_ae]=n[vae]?n[vae]:m+xM,n[$z]=h.instrumentationkey||n[$z]}n[_ae]=n[vae]?n[vae]:n[_ae]})),r.initialize(n,[new bOt])}a(c,"_initialize")});function o(s){s&&(s.baseData=s.baseData||{},s.baseType=s.baseType||"EventData"),r.track(s)}a(o,"_track")}return a(t,"ApplicationInsights"),t.__ieDyn=1,t})();var lS=fe(require("os"));var Cae=class{constructor(e,r,n,o){this.ctx=e;this.namespace=r;this.onCopilotToken=a(e=>{this.commonProperties["common.isinternal"]=e?.isInternalUser()?"true":"false";let r=e.getTokenValue("tid");r!==void 0&&(this.tags["ai.user.id"]=r)},"onCopilotToken");this.xhrOverride={sendPOST:a((e,r)=>{if(typeof e.data!="string")throw new Error(`AppInsightsReporter only supports string payloads, received ${typeof e.data}`);let n=e.headers??{};n["Content-Type"]="application/json";let o={method:"POST",headers:n,body:e.data};this.ctx.get(nr).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Nr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")};this.client=new Ren({instrumentationKey:n.instrumentationKey,disableAjaxTracking:!0,disableExceptionTracking:!0,disableFetchTracking:!0,disableCorrelationHeaders:!0,disableCookiesUsage:!0,autoTrackPageVisitTime:!1,emitLineDelimitedJson:!1,disableInstrumentationKeyValidation:!0,endpointUrl:n.endpointUrl,extensionConfig:{[aqe]:{alwaysUseXhrOverride:!0,httpXHROverride:this.xhrOverride}}}),this.tags=n?.excludeCommonTags?{}:Jbo(e),this.commonProperties=n?.excludeCommonProperties?{}:Zbo(e),this.#e=vs(e,this.onCopilotToken),o&&this.onCopilotToken(o)}static{a(this,"AppInsightsReporter")}#e;sendTelemetryEvent(e,r,n){r={...r,...this.commonProperties};let o=this.qualifyEventName(e);this.client.track({name:o,tags:this.tags,data:{...r,...n},baseType:"EventData",baseData:{name:o,properties:r,measurements:n}})}sendTelemetryErrorEvent(e,r,n){this.sendTelemetryEvent(this.qualifyEventName(e),r,n)}async dispose(){this.#e.dispose(),await this.client.unload(!0,void 0,200)}qualifyEventName(e){return e.startsWith(this.namespace)?e:`${this.namespace}/${e}`}};function Jbo(t){let e={},r=t.get(qa);e["ai.session.id"]=r.sessionId;let n=t.get(Fp);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${lS.type()} ${lS.release()}`,e["ai.device.osArchitecture"]=lS.arch(),e["ai.device.osPlatform"]=lS.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(us).getVersion(),e}a(Jbo,"getTags");function Zbo(t){let e={};e.common_os=lS.platform(),e.common_platformversion=lS.release(),e.common_arch=lS.arch(),e.common_cpu=Array.from(new Set(lS.cpus().map(n=>n.model))).join();let r=t.get(qa);return e.common_vscodemachineid=r.machineId,e.common_vscodesessionid=r.sessionId,e.client_deviceid=r.devDeviceId,e.common_uikind=r.uiKind,e.common_remotename=r.remoteName,e.common_isnewappinstall="",e}a(Zbo,"getCommonProperties");p();p();p();p();p();p();var B1e=K7e;var kM=B1e({Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5});p();var R7=B1e({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var Wz="toLowerCase",Tn="length",bae="warnToConsole",t3="throwInternal",PM="watch",k7="apply",to="push",Tx="splice",Zu="logger",DM="cancel",r3="initialize",NM="identifier",Sae="removeNotificationListener",Tae="addNotificationListener",vC="isInitialized",F1e="getNotifyMgr",P7="getPlugin",pP="name",n0="processNext",yqe="getProcessTelContext",n3="value",D7="enabled",IOt="stopPollingInternalLogs",Ix="unload",U1e="onComplete",Eqe="version",_qe="loggingLevelConsole",MM="createNew",uS="teardown",Iae="messageId",OM="message",CC="diagLog",N7="_doTeardown",zz="update",dS="getNext",M7="setNextPlugin",Q1e="userAgent",i3="split",hP="replace",xOt="substring",vqe="indexOf",o3="type",wOt="evtName",mP="status",ROt="getAllResponseHeaders",q1e="isChildEvt",fS="data",Yz="getCtx",gP="setCtx";var j1e="headers",xae="urlString",Kz="timeout";var Cqe="traceFlags";var kOt;function ken(t,e){kOt||(kOt=Lbe("AggregationError",function(n,o){o[Tn]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw vt(e,function(n,o){r+=` +`.concat(o," > ").concat(dr(n))}),new kOt(r,e||[])}a(ken,"throwAggregationError");p();p();p();p();p();var pS=void 0,bs="",Jz="channels",Zf="core",bqe="createPerfMgr",H1e="disabled",s3="extensionConfig",Zz="extensions",bC="processTelemetry",Xz="priority",wae="eventsSent",O7="eventsDiscarded",Rae="eventsSendRequest",LM="perfEvent",Sqe="offlineEventsStored",Tqe="offlineBatchSent",Iqe="offlineBatchDrop",kae="getPerfMgr",xqe="domain",wqe="path",Pen="Not dynamic - ";var Xbo="getPrototypeOf",e1o=/-([a-z])/g,t1o=/([^\w\d_$])/g,r1o=/^(\d+[\w\d_$])/,e6l=Object[Xbo];function L7(t){return!Zt(t)}a(L7,"isNotNullOrUndefined");function Pae(t){var e=t;return e&&Ei(e)&&(e=e[hP](e1o,function(r,n){return n.toUpperCase()}),e=e[hP](t1o,"_"),e=e[hP](r1o,function(r,n){return"_"+n})),e}a(Pae,"normalizeJsName");function ag(t,e){return t&&e?uu(t,e)!==-1:!1}a(ag,"strContains");function Dae(t){return t&&t.toISOString()||""}a(Dae,"toISOString");function Nae(t){return NB(t)?t[pP]:bs}a(Nae,"getExceptionName");function a3(t,e,r,n,o){var s=r;return t&&(s=t[e],s!==r&&(!o||o(s))&&(!n||n(r))&&(s=r,t[e]=s)),s}a(a3,"setValue");function Rqe(t,e,r){var n;return t?(n=t[e],!n&&Zt(n)&&(n=Nn(r)?{}:r,t[e]=n)):n=Nn(r)?{}:r,n}a(Rqe,"getSetValue");function n1o(t,e){var r=null,n=null;return Lr(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][k7](n,o)}}a(n1o,"_createProxyFunction");function B7(t,e,r,n,o){t&&e&&r&&(o!==!1||Nn(t[e]))&&(t[e]=n1o(r,n))}a(B7,"proxyFunctionAs");function F7(t,e,r,n){return t&&e&&zu(t)&&ur(r)&&vt(r,function(o){Ei(o)&&B7(t,o,e,o,n)}),t}a(F7,"proxyFunctions");function BM(t){return t&&MB&&(t=s7(MB({},t))),t}a(BM,"optimizeObject");function kqe(t,e,r){var n=e&&e.featureOptIn&&e.featureOptIn[t];if(t&&n){var o=n.mode;if(o===3)return!0;if(o===2)return!1}return r}a(kqe,"isFeatureEnabled");function FM(t){try{return t.responseText}catch{}return null}a(FM,"getResponseText");function Pqe(t,e){return t?"XDomainRequest,Response:"+FM(t)||"":e}a(Pqe,"formatErrorMessageXdr");function $1e(t,e){return t?"XMLHttpRequest,Status:"+t[mP]+",Response:"+FM(t)||t.response||"":e}a($1e,"formatErrorMessageXhr");function V1e(t,e){return e&&(Oh(e)?t=[e].concat(t):ur(e)&&(t=e.concat(t))),t}a(V1e,"prependTransports");var i1o="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",Den="withCredentials",o1o="timeout";function POt(t,e,r,n,o,s){n===void 0&&(n=!1),o===void 0&&(o=!1);function c(u,d,f){try{u[d]=f}catch{}}a(c,"_wrapSetXhrProp");var l=new XMLHttpRequest;return n&&c(l,i1o,n),r&&c(l,Den,r),l.open(t,e,!o),r&&c(l,Den,r),!o&&s&&c(l,o1o,s),l}a(POt,"openXhr");function DOt(t){var e={};if(Ei(t)){var r=Di(t)[i3](/[\r\n]+/);vt(r,function(n){if(n){var o=n[vqe](": ");if(o!==-1){var s=Di(n.substring(0,o))[Wz](),c=Di(n[xOt](o+1));e[s]=c}else e[Di(n)]=1}})}return e}a(DOt,"convertAllHeadersToMap");function G1e(t,e,r){if(!t[r]&&e&&e.getResponseHeader){var n=e.getResponseHeader(r);n&&(t[r]=Di(n))}return t}a(G1e,"_appendHeader");var s1o="kill-duration",a1o="kill-duration-seconds",c1o="time-delta-millis";function U7(t,e){var r={};return t[ROt]?r=DOt(t[ROt]()):e&&(r=G1e(r,t,c1o),r=G1e(r,t,s1o),r=G1e(r,t,a1o)),r}a(U7,"_getAllResponseHeaders");p();p();var l1o="location",u1o="console",Nen="JSON",d1o="crypto",f1o="msCrypto",p1o="ReactNative",h1o="msie",m1o="trident/",Men="XMLHttpRequest",NOt=null,MOt=null,g1o=!1,Mae=null,OOt=null;function Oen(t,e){var r=!1;if(t){try{if(r=e in t,!r){var n=t[sS];n&&(r=e in n)}}catch{}if(!r)try{var o=new t;r=!Nn(o[e])}catch{}}return r}a(Oen,"_hasProperty");function Oae(t){if(t&&g1o){var e=Pi("__mockLocation");if(e)return e}return typeof location===yx&&location?location:Pi(l1o)}a(Oae,"getLocation");function Dqe(){return typeof console!==oS?console:Pi(u1o)}a(Dqe,"getConsole");function W1e(){return!!(typeof JSON===yx&&JSON||Pi(Nen)!==null)}a(W1e,"hasJSON");function Nqe(){return W1e()?JSON||Pi(Nen):null}a(Nqe,"getJSON");function Mqe(){return Pi(d1o)}a(Mqe,"getCrypto");function Oqe(){return Pi(f1o)}a(Oqe,"getMsCrypto");function Lae(){var t=Ku();return t&&t.product?t.product===p1o:!1}a(Lae,"isReactNative");function eY(){var t=Ku();if(t&&(t[Q1e]!==MOt||NOt===null)){MOt=t[Q1e];var e=(MOt||bs)[Wz]();NOt=ag(e,h1o)||ag(e,m1o)}return NOt}a(eY,"isIE");function Bae(t){return(OOt===null||t===!1)&&(OOt=lz()&&!!Ku().sendBeacon),OOt}a(Bae,"isBeaconsSupported");function Fae(t){var e=!1;try{e=!!Pi("fetch");var r=Pi("Request");e&&t&&r&&(e=Oen(r,"keepalive"))}catch{}return e}a(Fae,"isFetchSupported");function Lqe(){return Mae===null&&(Mae=typeof XDomainRequest!==oS,Mae&&z1e()&&(Mae=Mae&&!Oen(Pi(Men),"withCredentials"))),Mae}a(Lqe,"useXDomainRequest");function z1e(){var t=!1;try{var e=Pi(Men);t=!!e}catch{}return t}a(z1e,"isXhrSupported");var Len=4294967296,tY=4294967295,Ben=123456789,Fen=987654321,Uen=!1,Y1e=Ben,K1e=Fen;function A1o(t){t<0&&(t>>>=0),Y1e=Ben+t&tY,K1e=Fen-t&tY,Uen=!0}a(A1o,"_mwcSeed");function y1o(){try{var t=_l()&2147483647;A1o((Math.random()*Len^t)+t)}catch{}}a(y1o,"_autoSeedMwc");function LOt(t){var e=0,r=Mqe()||Oqe();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&tY),e===0&&eY()&&(Uen||y1o(),e=E1o()&tY),e===0&&(e=eS(Len*Math.random()|0)),t||(e>>>=0),e}a(LOt,"random32");function E1o(t){K1e=36969*(K1e&65535)+(K1e>>16)&tY,Y1e=18e3*(Y1e&65535)+(Y1e>>16)&tY;var e=(K1e<<16)+(Y1e&65535)>>>0&tY|0;return t||(e>>>=0),e}a(E1o,"mwcRandom32");function BOt(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=LOt()>>>0,n=0,o=bs;o[Tn]>>=6,n===5&&(r=(LOt()<<2&4294967295|r&3)>>>0,n=0);return o}a(BOt,"newId");var Qen="3.3.10",_1o="."+BOt(6),v1o=0;function qen(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(qen,"_canAcceptData");function C1o(t,e){var r=e[t.id];if(!r){r={};try{qen(e)&&qi(e,t.id,{e:!1,v:r})}catch{}}return r}a(C1o,"_getCache");function xx(t,e){return e===void 0&&(e=!1),Pae(t+v1o+++(e?"."+Qen:bs)+_1o)}a(xx,"createUniqueNamespace");function Bqe(t){var e={id:xx("_aiData-"+(t||bs)+"."+Qen),accept:a(function(r){return qen(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[Pae(n)]:(s&&(c=C1o(e,r),c[Pae(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(Bqe,"createElmNodeData");p();function Fqe(t){return t&&zu(t)&&!ur(t)&&(t.isVal||t.fb||vA(t,"v")||vA(t,"mrg")||vA(t,"ref")||t.set)}a(Fqe,"_isConfigDefaults");function jen(t,e,r){var n,o=r.dfVal||Ose;if(e&&r.fb){var s=r.fb;ur(s)||(s=[s]);for(var c=0;c0&&ken("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[Tn]>0){c||(c=[]),l||(l=jp(function(){l=null,f()},0));for(var A=0;A0?vl(Qae(t[0],e),function(){jOt(e7(t,1),e,r)}):r(),n}a(jOt,"doUnloadAll");p();var $en=500,HOt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function Ven(t){return{mrg:!0,v:t}}a(Ven,"cfgDfMerge");p();p();var GOt=[wae,O7,Rae,LM],Gqe=null,Hqe;function k1o(t,e){return function(){var r=arguments,n=$Ot(e);if(n){var o=n.listener;o&&o[t]&&o[t][k7](o,r)}}}a(k1o,"_listenerProxyFunc");function P1o(){var t=Pi("Microsoft");return t&&(Gqe=t.ApplicationInsights),Gqe}a(P1o,"_getExtensionNamespace");function $Ot(t){var e=Gqe;return!e&&t.disableDbgExt!==!0&&(e=Gqe||P1o()),e?e.ChromeDbgExt:null}a($Ot,"getDebugExt");function Wen(t){if(!Hqe){Hqe={};for(var e=0;e=A&&(d[T](b[OM]),n[w]=!0)}else o>=A&&d[T](b[OM]);f(A,b)}},d.debugToConsole=function(A){VOt("debug",A),g("warning",A)},d[bae]=function(A){VOt("warn",A),g("warning",A)},d.errorToConsole=function(A){VOt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[Ix]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=M1o+y[Iae];if(n[_]?E=!1:n[_]=!0,E&&(A<=s&&(d.queue[to](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",b=new jae(23,v,!1);d.queue[to](b),A===1?d.errorToConsole(v):d[bae](v)}}}a(f,"_logInternalMessage");function h(A){return hS($p(A,O1o,d).cfg,function(y){var E=y.cfg;o=E[_qe],s=E.loggingLevelTelemetry,c=E.maxMessageLimit,l=E.enableDebug})}a(h,"_setDefaultsFromConfig");function m(){return r>=c}a(m,"_areInternalMessagesThrottled");function g(A,y){var E=$Ot(e||{});E&&E[CC]&&E[CC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function Ken(t){return t||new rY}a(Ken,"_getLogger");function Ra(t,e,r,n,o,s){s===void 0&&(s=!1),Ken(t)[t3](e,r,n,o,s)}a(Ra,"_throwInternal");function QM(t,e){Ken(t)[bae](e)}a(QM,"_warnToConsole");var WOt,Q7,Jen="toGMTString",Zen="toUTCString",KOt="cookie",zOt="expires",Xen="isCookieUseDisabled",nSe="disableCookiesUsage",etn="_ckMgr",$qe=null,YOt=null,ttn=null,qM,rtn={},ntn={},B1o=(WOt={cookieCfg:Ven((Q7={},Q7[xqe]={fb:"cookieDomain",dfVal:L7},Q7.path={fb:"cookiePath",dfVal:L7},Q7.enabled=pS,Q7.ignoreCookies=pS,Q7.blockedCookies=pS,Q7.disableCookieDefer=!1,Q7)),cookieDomain:pS,cookiePath:pS},WOt[nSe]=pS,WOt);function JOt(){!qM&&(qM=Z7e(function(){return gf()}))}a(JOt,"_getDoc");function Vqe(t){return t?t.isEnabled():!0}a(Vqe,"_isMgrEnabled");function ltn(t,e){return e&&t&&ur(t.ignoreCookies)?Vo(t.ignoreCookies,e)!==-1:!1}a(ltn,"_isIgnoredCookie");function itn(t,e){return e&&t&&ur(t.blockedCookies)&&Vo(t.blockedCookies,e)!==-1?!0:ltn(t,e)}a(itn,"_isBlockedCookie");function otn(t,e){var r=e[D7];if(Zt(r)){var n=void 0;Nn(t[Xen])||(n=!t[Xen]),Nn(t[nSe])||(n=!t[nSe]),r=n}return r}a(otn,"_isCfgEnabled");function ZOt(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[wqe]=E||"/",_[zOt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return eY()||(v["max-age"]="0"),atn(bs,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Di(E||bs),R=uu(w,";");if(R!==-1&&(w=Di(gM(E,R)),T=utn(Kf(E,R+1))),a3(T,xqe,v||o,Z1,Nn),!Zt(_)){var x=eY();if(Nn(T[zOt])){var P=_l(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),a3(T,zOt,stn(N,x?Jen:Zen)||stn(N,x?Jen:Zen)||bs,Z1)}}x||a3(T,"max-age",bs+_,null,Nn)}var L=Oae();return L&&L.protocol==="https:"&&(a3(T,"secure",null,null,Nn),YOt===null&&(YOt=!dtn((Ku()||{})[Q1e])),YOt&&a3(T,"SameSite","None",null,Nn)),a3(T,wqe,b||n,null,Nn),atn(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[Tn]-1;_>=0;_--)f[_].n===E&&f[Tx](_,1)}a(g,"_removePendingCookie");function A(){rSe(e)&&f&&(vt(f,function(E){itn(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=$p(t||ntn,null,e).cfg,s=hS(t,function(E){E.setDf(E.cfg,B1o),r=E.ref(E.cfg,"cookieCfg"),n=r[wqe]||"/",o=r[xqe],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=otn(t,r)!==!1,l=r.getCookie||F1o,u=r.setCookie||ctn,d=r.delCookie||ctn,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=otn(t,r)!==!1&&c&&rSe(e),_=ntn[etn];return E&&_&&y!==_&&(E=Vqe(_)),E},"isEnabled"),setEnabled:a(function(E){r[D7]=E,Nn(t[nSe])||(t[nSe]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=itn(r,E);if(!R){var x=m(_,v,b,T);Vqe(y)?(u(E,x),w=!0):f&&(g(E),f[to]({n:E,o:0,v:x}),w=!0)}return w},"set"),get:a(function(E){var _=bs,v=ltn(r,E);if(!v){if(Vqe(y))_=l(E);else if(f)for(var b=f[Tn]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=uu(w,";");_=R!==-1?Di(gM(w,R)):Di(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return Vqe(y)?v=y.purge(E,_):f&&(g(E),f[to]({n:E,o:1,v:h(_)}),v=!0),v},"del"),purge:a(function(E,_){var v=!1;return rSe(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[etn]=y,y}a(ZOt,"createCookieMgr");function rSe(t){if($qe===null){$qe=!1,!qM&&JOt();try{var e=qM.v||{};$qe=e[KOt]!==void 0}catch(r){Ra(t,2,68,"Cannot access document.cookie - "+Nae(r),{exception:dr(r)})}}return $qe}a(rSe,"areCookiesSupported");function utn(t){var e={};if(t&&t[Tn]){var r=Di(t)[i3](";");vt(r,function(n){if(n=Di(n||bs),n){var o=uu(n,"=");o===-1?e[n]=null:e[Di(gM(n,o))]=Di(Kf(n,o+1))}})}return e}a(utn,"_extractParts");function stn(t,e){return Lr(t[e])?t[e]():null}a(stn,"_formatDate");function atn(t,e){var r=t||bs;return Yr(e,function(n,o){r+="; "+n+(Zt(o)?bs:"="+o)}),r}a(atn,"_formatCookieValue");function F1o(t){var e=bs;if(!qM&&JOt(),qM.v){var r=qM.v[KOt]||bs;ttn!==r&&(rtn=utn(r),ttn=r),e=Di(rtn[t]||bs)}return e}a(F1o,"_getCookieValue");function ctn(t,e){!qM&&JOt(),qM.v&&(qM.v[KOt]=t+"="+e)}a(ctn,"_setCookieValue");function dtn(t){return Ei(t)?!!(ag(t,"CPU iPhone OS 12")||ag(t,"iPad; CPU OS 12")||ag(t,"Macintosh; Intel Mac OS X 10_14")&&ag(t,"Version/")&&ag(t,"Safari")||ag(t,"Macintosh; Intel Mac OS X 10_14")&&BB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||ag(t,"Chrome/5")||ag(t,"Chrome/6")||ag(t,"UnrealEngine")&&!ag(t,"Chrome")||ag(t,"UCBrowser/12")||ag(t,"UCBrowser/11")):!1}a(dtn,"uaDisallowsSameSiteNone");p();var U1o={perfEvtsSendAll:!1};function Q1o(t){t.h=null;var e=t.cb;t.cb=[],vt(e,function(r){Yf(r.fn,[r.arg])})}a(Q1o,"_runScheduledListeners");function q7(t,e,r,n){vt(t,function(o){o&&o[e]&&(r?(r.cb[to]({fn:n,arg:o}),r.h=r.h||jp(Q1o,0,r)):Yf(n,[o]))})}a(q7,"_runListeners");var XOt=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=$p(e,U1o);n=c[PM](function(l){r=!!l.cfg.perfEvtsSendAll}),Si(t,this,function(l){qi(l,"listeners",{g:a(function(){return o},"g")}),l[Tae]=function(u){o[to](u)},l[Sae]=function(u){for(var d=Vo(o,u);d>-1;)o[Tx](d,1),d=Vo(o,u)},l[wae]=function(u){q7(o,wae,s,function(d){d[wae](u)})},l[O7]=function(u,d){q7(o,O7,s,function(f){f[O7](u,d)})},l[Rae]=function(u,d){q7(o,Rae,d?s:null,function(f){f[Rae](u,d)})},l[LM]=function(u){u&&(r||!u[q1e]())&&q7(o,LM,null,function(d){u.isAsync?jp(function(){return d[LM](u)},0):d[LM](u)})},l[Sqe]=function(u){u&&u[Tn]&&q7(o,Sqe,s,function(d){d[Sqe](u)})},l[Tqe]=function(u){u&&u[fS]&&q7(o,Tqe,s,function(d){d[Tqe](u)})},l[Iqe]=function(u,d){if(u>0){var f=d||0;q7(o,Iqe,s,function(h){h[Iqe](u,f)})}},l[Ix]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[DM](),s.h=null,s.cb=[]},"_finishUnload"),f;if(q7(o,"unload",null,function(h){var m=h[Ix](u);m&&(f||(f=[]),f[to](m))}),f)return Fd(function(h){return vl(_Qe(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var Gae="ctx",t5t="ParentContextKey",iSe="ChildrenContextKey",q1o=null,$ae=(function(){function t(e,r,n){var o=this;if(o.start=_l(),o[pP]=e,o.isAsync=n,o[q1e]=function(){return!1},Lr(r)){var s;qi(o,"payload",{g:a(function(){return!s&&Lr(r)&&(s=r(),r=null),s},"g")})}o[Yz]=function(c){return c?c===t[t5t]||c===t[iSe]?o[c]:(o[Gae]||{})[c]:null},o[gP]=function(c,l){if(c)if(c===t[t5t])o[c]||(o[q1e]=function(){return!0}),o[c]=l;else if(c===t[iSe])o[c]=l;else{var u=o[Gae]=o[Gae]||{};u[c]=l}},o.complete=function(){var c=0,l=o[Yz](t[iSe]);if(ur(l))for(var u=0;u0&&(vt(A,function(y){try{y.func.call(y.self,y.args)}catch(E){Ra(r[Zu],2,73,"Unexpected Exception during onComplete - "+dr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[s3];!_&&A&&(_={}),E[s3]=_,_=e.ref(E,s3),_&&(y=_[g],!y&&A&&(y={}),_[g]=y,y=e.ref(_,g))}return y}a(d,"_getExtCfg");function f(g,A){var y=d(g,!0);return A&&Yr(A,function(E,_){if(Zt(y[E])){var v=e.cfg[E];(v||!Zt(v))&&(y[E]=v)}J1e(e,y,E,_)}),e.setDf(y,A)}a(f,"_resolveExtCfg");function h(g,A,y){y===void 0&&(y=!1);var E,_=d(g,!1),v=e.cfg;return _&&(_[A]||!Zt(_[A]))?E=_[A]:(v[A]||!Zt(v[A]))&&(E=v[A]),E||!Zt(E)?E:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[P7]();y&&g(y)}}return a(m,"_iterateChain"),c}a(s5t,"_createInternalContext");function wx(t,e,r,n){var o=$p(e),s=s5t(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[bC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),ur(d)&&(d=j7(d,o.cfg,r,f)),wx(d||c[dS](),o.cfg,r,f)}return a(u,"_createNew"),c[n0]=l,c[MM]=u,c}a(wx,"createProcessTelemetryContext");function Vae(t,e,r){var n=$p(e.config),o=s5t(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[Ix](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=j7(u,n.cfg,e,d)),Vae(u||s[dS](),e,d)}return a(l,"_createNew"),s[n0]=c,s[MM]=l,s}a(Vae,"createProcessTelemetryUnloadContext");function oSe(t,e,r){var n=$p(e.config),o=s5t(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Lr(d[zz])&&d[zz](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),ur(u)&&(u=j7(u,n.cfg,e,d)),oSe(u||s[dS](),e,d)}return a(l,"_createNew"),s[n0]=c,s[MM]=l,s}a(oSe,"createProcessTelemetryUpdateContext");function j7(t,e,r,n){var o=null,s=!n;if(ur(t)&&t[Tn]>0){var c=null;vt(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Lr(l[bC])){var u=W1o(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?j7([n],e,r):o}a(j7,"createTelemetryProxyChain");function W1o(t,e,r){var n=null,o=Lr(t[bC]),s=Lr(t[M7]),c;t?c=t[NM]+"-"+t[Xz]+"-"+gtn++:c="Unknown-0-"+gtn++;var l={getPlugin:a(function(){return t},"getPlugin"),getNext:a(function(){return n},"getNext"),processTelemetry:f,unload:h,update:m,_id:c,_setNext:a(function(g){n=g},"_setNext")};function u(){var g;return t&&Lr(t[mtn])&&(g=t[mtn]()),g||(g=wx(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[NM]:$1o,T=g[htn];return T||(T=g[htn]={}),g.setNext(n),t&&Vp(g[Zf](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:bs;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&Ra(g[CC](),1,73,"Plugin ["+b+"] failed during "+y+" - "+dr(x)+", run flags: "+dr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=c3(t);return _[uS]||_[H1e]?!1:(s&&t[M7](n),t[bC](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[n0](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=c3(t),v=t[Zf]||_[Zf];t&&(!v||v===g.core())&&!_[uS]&&(_[Zf]=null,_[uS]=!0,_[vC]=!1,t[uS]&&t[uS](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[n0](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=c3(t),v=t[Zf]||_[Zf];t&&(!v||v===g.core())&&!_[uS]&&t[zz]&&t[zz](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[n0](A)}return a(m,"_updatePlugin"),Lh(l)}a(W1o,"createTelemetryPluginProxy");var Atn=(function(){function t(e,r,n,o){var s=this,c=wx(e,r,n,o);F7(s,c,Yu(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function sSe(){var t=[];function e(n){n&&t[to](n)}a(e,"_addHandler");function r(n,o){vt(t,function(s){try{s(n,o)}catch(c){Ra(n[CC](),2,73,"Unexpected error calling unload handler - "+dr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(sSe,"createUnloadHandlerContainer");p();var Yqe,Kqe;function Jqe(){var t=[];function e(n){var o=t;t=[],vt(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Ra(n,2,73,"Unloading:"+dr(c))}}),Yqe&&o[Tn]>Yqe&&(Kqe?Kqe("doUnload",o):Ra(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Bh(t,n),Yqe&&t[Tn]>Yqe&&(Kqe?Kqe("Add",t):Ra(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected.")))}return a(r,"_addHook"),{run:e,add:r}}a(Jqe,"createUnloadHookContainer");var a5t,H7="getPlugin",z1o=(a5t={},a5t[s3]={isVal:L7,v:{}},a5t),Wae=(function(){function t(){var e=this,r,n,o,s,c;d(),Si(t,e,function(f){f[r3]=function(h,m,g,A){u(h,m,A),r=!0},f[uS]=function(h,m){var g=f[Zf];if(!g||h&&g!==h[Zf]())return;var A,y=!1,E=h||Vae(null,g,o&&o[H7]?o[H7]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[CC]()),A===!0&&E[n0](_),d())}return a(v,"_unloadCallback"),!f[N7]||f[N7](E,_,v)!==!0?v():A=!0,A},f[zz]=function(h,m){var g=f[Zf];if(!g||h&&g!==h[Zf]())return;var A,y=!1,E=h||oSe(null,g,o&&o[H7]?o[H7]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[dS]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},B7(f,"_addUnloadCb",function(){return s},"add"),B7(f,"_addHook",function(){return c},"add"),qi(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[CC]=function(f){return l(f)[CC]()},e[vC]=function(){return r},e.setInitialized=function(f){r=f},e[M7]=function(f){o=f},e[n0]=function(f,h){h?h[n0](f):o&&Lr(o[bC])&&o[bC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||wx(null,{},e[Zf]);o&&o[H7]?h=m[MM](null,o[H7]):h=m[MM](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){$p(f,z1o,Hae(h)),!m&&h&&(m=h[yqe]()[dS]());var g=o;o&&o[H7]&&(g=o[H7]()),e[Zf]=h,n=wx(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[Zf]=null,n=null,o=null,c=Jqe(),s=sSe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function Y1o(t,e,r){var n={id:e,fn:r};Bh(t,n);var o={remove:a(function(){vt(t,function(s,c){if(s.id===n.id)return t[Tx](c,1),-1})},"remove")};return o}a(Y1o,"_addInitializer");function K1o(t,e,r){for(var n=!1,o=t[Tn],s=0;s"},"v")})}a(sSo,"_createUnloadHook");var Zqe=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,j,M,O,U,q;Si(t,this,function(Q){te(),Q._getDbgPlgTargets=function(){return[x,o]},Q[vC]=function(){return r},Q.activeStatus=function(){return N},Q._setPendingStatus=function(){N=3},Q[r3]=function(ne,ue,Ne,Ie){g&&el(Etn),Q[vC]()&&el("Core cannot be initialized more than once"),e=$p(ne,c5t,Ne||Q[Zu],!1),ne=e.cfg,qe(e[PM](function(st){var _t=st.cfg;B=_t.initInMemoMaxSize||X1o,Y(_t);var kt=st.ref(st.cfg,s3);Yr(kt,function(Ht){st.ref(kt,Ht)})})),s=Ie,b=oSo(e,v,s&&Q[F1e](),b),K(),Q[Zu]=Ne;var Be=ne[Zz];if(f=[],f[to].apply(f,hz(hz([],ue,!1),Be,!1)),h=ne[Jz],Le(null),(!m||m[Tn]===0)&&el("No "+Jz+" available"),h&&h[Tn]>1){var tt=Q[P7]("TeeChannelController");(!tt||!tt.plugin)&&Ra(n,1,28,"TeeChannel required")}iSo(ne,R,n),R=null,r=!0,N===R7.ACTIVE&&z()},Q.getChannels=function(){var ne=[];return m&&vt(m,function(ue){ne[to](ue)}),Lh(ne)},Q.track=function(ne){Vp(Q[kae](),function(){return"AppInsightsCore:track"},function(){ne===null&&(de(ne),el("Invalid telemetry item")),!ne[pP]&&Zt(ne[pP])&&(de(ne),el("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||Dae(new Date),ne.ver=ne.ver||"4.0",!g&&Q[vC]()&&N===R7.ACTIVE?le()[n0](ne):N!==R7.INACTIVE&&o[Tn]<=B&&o[to](ne)},function(){return{item:ne}},!ne.sync)},Q[yqe]=le,Q[F1e]=function(){return s||(s=new XOt(e.cfg),Q[J1o]=s),s},Q[Tae]=function(ne){Q.getNotifyMgr()[Tae](ne)},Q[Sae]=function(ne){s&&s[Sae](ne)},Q.getCookieMgr=function(){return u||(u=ZOt(e.cfg,Q[Zu])),u},Q.setCookieMgr=function(ne){u!==ne&&(Qae(u,!1),u=ne)},Q[kae]=function(){return c||l||r5t()},Q.setPerfMgr=function(ne){c=ne},Q.eventCnt=function(){return o[Tn]},Q.releaseQueue=function(){if(r&&o[Tn]>0){var ne=o;o=[],N===2?vt(ne,function(ue){ue.iKey=ue.iKey||w,le()[n0](ue)}):Ra(n,2,20,"core init status is not active")}},Q.pollInternalLogs=function(ne){return y=ne||null,q=!1,O&&O[DM](),ie(!0)};function Y(ne){var ue=ne.instrumentationKey,Ne=ne.endpointUrl;if(N!==3){if(Zt(ue)){w=null,N=R7.INACTIVE;var Ie="Please provide instrumentation key";r?(Ra(n,1,100,Ie),z()):el(Ie);return}var Be=[];ig(ue)?(Be[to](ue),w=null):w=ue,ig(Ne)?(Be[to](Ne),L=null):L=Ne,Be[Tn]?W(ne,Be):V()}}a(Y,"_handleIKeyEndpointPromises");function W(ne,ue){j=!1,N=3;var Ne=L7(ne.initTimeOut)?ne.initTimeOut:eSo,Ie=EQe(ue);M&&M[DM](),M=jp(function(){M=null,j||V()},Ne),vl(Ie,function(Be){try{if(j)return;if(!Be.rejected){var tt=Be[n3];if(tt&&tt[Tn]){var st=tt[0];if(w=st&&st[n3],tt[Tn]>1){var _t=tt[1];L=_t&&_t[n3]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=L)}V()}catch{j||V()}})}a(W,"_waitForInitPromises");function V(){j=!0,Zt(w)?(N=R7.INACTIVE,Ra(n,1,112,"ikey can't be resolved from promises")):N=R7.ACTIVE,z()}a(V,"_setStatus");function z(){r&&(Q.releaseQueue(),Q.pollInternalLogs())}a(z,"_releaseQueues");function ie(ne){if((!O||!O[D7])&&!q){var ue=ne||n&&n.queue[Tn]>0;ue&&(U||(U=!0,qe(e[PM](function(Ne){var Ie=Ne.cfg.diagnosticLogInterval;(!Ie||!(Ie>0))&&(Ie=1e4);var Be=!1;O&&(Be=O[D7],O[DM]()),O=rQe(re,Ie),O.unref(),O[D7]=Be}))),O[D7]=!0)}return O}a(ie,"_startLogPoller"),Q[IOt]=function(){q=!0,O&&O[DM](),re()},F7(Q,function(){return A},["addTelemetryInitializer"]),Q[Ix]=function(ne,ue,Ne){ne===void 0&&(ne=!0),r||el(Z1o),g&&el(Etn);var Ie={reason:50,isAsync:ne,flushComplete:!1},Be;ne&&!ue&&(Be=Fd(function(_t){ue=_t}));var tt=Vae(Oe(),Q);tt[U1e](function(){v.run(Q[Zu]),jOt([u,s,n],ne,function(){te(),ue&&ue(Ie)})},Q);function st(_t){Ie.flushComplete=_t,g=!0,_.run(tt,Ie),Q[IOt](),tt[n0](Ie)}return a(st,"_doUnload"),re(),ee(ne,st,6,Ne)||st(!1),Be},Q[P7]=ge,Q.addPlugin=function(ne,ue,Ne,Ie){if(!ne){Ie&&Ie(!1),X(Ctn);return}var Be=ge(ne[NM]);if(Be&&!ue){Ie&&Ie(!1),X("Plugin ["+ne[NM]+"] is already loaded!");return}var tt={reason:16};function st(Ht){f[to](ne),tt.added=[ne],Le(tt),Ie&&Ie(!0)}if(a(st,"_addPlugin"),Be){var _t=[Be.plugin],kt={reason:2,isAsync:!!Ne};we(_t,kt,function(Ht){Ht?(tt.removed=_t,tt.reason|=32,st(!0)):Ie&&Ie(!1)})}else st(!1)},Q.updateCfg=function(ne,ue){ue===void 0&&(ue=!0);var Ne;if(Q[vC]()){Ne={reason:1,cfg:e.cfg,oldCfg:Use({},e.cfg),newConfig:Use({},ne),merge:ue},ne=Ne.newConfig;var Ie=e.cfg;ne[Zz]=Ie[Zz],ne[Jz]=Ie[Jz]}e._block(function(Be){var tt=Be.cfg;l5t(Be,tt,ne,ue),ue||Yr(tt,function(st){vA(ne,st)||Be.set(tt,st,pS)}),Be.setDf(tt,c5t)},!0),e.notify(),Ne&&he(Ne)},Q.evtNamespace=function(){return E},Q.flush=ee,Q.getTraceCtx=function(ne){return T||(T=ptn()),T},Q.setTraceCtx=function(ne){T=ne||null},Q.addUnloadHook=qe,B7(Q,"addUnloadCb",function(){return _},"add"),Q.onCfgChange=function(ne){var ue;return r?ue=hS(e.cfg,ne,Q[Zu]):ue=nSo(R,ne),sSo(ue)},Q.getWParam=function(){return OB()||e.cfg.enableWParam?0:-1};function H(){var ne={};P=[];var ue=a(function(Ne){Ne&&vt(Ne,function(Ie){if(Ie[NM]&&Ie[Eqe]&&!ne[Ie.identifier]){var Be=Ie[NM]+"="+Ie[Eqe];P[to](Be),ne[Ie.identifier]=Ie}})},"_addPluginVersions");ue(m),h&&vt(h,function(Ne){ue(Ne)}),ue(f)}a(H,"_setPluginVersions");function te(){r=!1,e=$p({},c5t,Q[Zu]),e.cfg[_qe]=1,qi(Q,"config",{g:a(function(){return e.cfg},"g"),s:a(function(ue){Q.updateCfg(ue,!1)},"s")}),qi(Q,"pluginVersionStringArr",{g:a(function(){return P||H(),P},"g")}),qi(Q,"pluginVersionString",{g:a(function(){return D||(P||H(),D=P.join(";")),D||bs},"g")}),qi(Q,"logger",{g:a(function(){return n||(n=new rY(e.cfg),e[Zu]=n),n},"g"),s:a(function(ue){e[Zu]=ue,n!==ue&&(Qae(n,!1),n=ue)},"s")}),Q[Zu]=new rY(e.cfg),x=[];var ne=Q.config[Zz]||[];ne.splice(0,ne[Tn]),Bh(ne,x),A=new ytn,o=[],Qae(s,!1),s=null,c=null,l=null,Qae(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=xx("AIBaseCore",!0),_=sSe(),T=null,w=null,v=Jqe(),R=[],D=null,P=null,q=!1,O=null,U=!1,N=0,L=null,B=null,j=!1,M=null}a(te,"_initDefaults");function le(){var ne=wx(Oe(),e.cfg,Q);return ne[U1e](ie),ne}a(le,"_createTelCtx");function Le(ne){var ue=rSo(Q[Zu],$en,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=zqe(Bh(m,ue[Jz]));var Ne=Bh(zqe(ue[Zf]),m);x=Lh(Ne);var Ie=Q.config[Zz]||[];Ie.splice(0,Ie[Tn]),Bh(Ie,x);var Be=le();m&&m[Tn]>0&&o5t(Be[MM](m),Ne),o5t(Be,Ne),ne&&he(ne)}a(Le,"_initPluginChain");function ge(ne){var ue=null,Ne=null,Ie=[];return vt(x,function(Be){if(Be[NM]===ne&&Be!==A)return Ne=Be,-1;Be.getChannel&&Ie[to](Be)}),!Ne&&Ie[Tn]>0&&vt(Ie,function(Be){if(Ne=Be.getChannel(ne),!Ne)return-1}),Ne&&(ue={plugin:Ne,setEnabled:a(function(Be){c3(Ne)[H1e]=!Be},"setEnabled"),isEnabled:a(function(){var Be=c3(Ne);return!Be[uS]&&!Be[H1e]},"isEnabled"),remove:a(function(Be,tt){Be===void 0&&(Be=!0);var st=[Ne],_t={reason:1,isAsync:Be};we(st,_t,function(kt){kt&&Le({reason:32,removed:st}),tt&&tt(kt)})},"remove")}),ue}a(ge,"_getPlugin");function Oe(){if(!d){var ne=(x||[]).slice();Vo(ne,A)===-1&&ne[to](A),d=j7(zqe(ne),e.cfg,Q)}return d}a(Oe,"_getPluginChain");function we(ne,ue,Ne){if(ne&&ne[Tn]>0){var Ie=j7(ne,e.cfg,Q),Be=Vae(Ie,Q);Be[U1e](function(){var tt=!1,st=[];vt(f,function(kt,Ht){_tn(kt,ne)?tt=!0:st[to](kt)}),f=st,D=null,P=null;var _t=[];h&&(vt(h,function(kt,Ht){var F=[];vt(kt,function(se){_tn(se,ne)?tt=!0:F[to](se)}),_t[to](F)}),h=_t),Ne&&Ne(tt),ie()}),Be[n0](ue)}else Ne(!1)}a(we,"_removePlugins");function re(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[Tn]=0,vt(ne,function(ue){var Ne={name:y||"InternalMessageId: "+ue[Iae],iKey:w,time:Dae(new Date),baseType:jae.dataType,baseData:{message:ue[OM]}};Q.track(Ne)})}}a(re,"_flushInternalLogs");function ee(ne,ue,Ne,Ie){var Be=1,tt=!1,st=null;Ie=Ie||5e3;function _t(){Be--,tt&&Be===0&&(st&&st[DM](),st=null,ue&&ue(tt),ue=null)}if(a(_t,"doCallback"),m&&m[Tn]>0){var kt=le()[MM](m);kt.iterate(function(Ht){if(Ht.flush){Be++;var F=!1;Ht.flush(ne,function(){F=!0,_t()},Ne)||F||(ne&&st==null?st=jp(function(){st=null,_t()},Ie):_t())}})}return tt=!0,_t(),!0}a(ee,"_flushChannels");function K(){var ne;qe(e[PM](function(ue){var Ne=ue.cfg.enablePerfMgr;if(Ne){var Ie=ue.cfg[bqe];(ne!==Ie||!ne)&&(Ie||(Ie=tSo),Rqe(ue.cfg,bqe,Ie),ne=Ie,l=null),!c&&!l&&Lr(Ie)&&(l=Ie(Q,Q[F1e]()))}else l=null,ne=null}))}a(K,"_initPerfManager");function he(ne){var ue=oSe(Oe(),Q);ue[U1e](ie),(!Q._updateHook||Q._updateHook(ue,ne)!==!0)&&ue[n0](ne)}a(he,"_doUpdate");function X(ne){var ue=Q[Zu];ue?(Ra(ue,2,73,ne),ie()):el(ne)}a(X,"_logOrThrowError");function de(ne){var ue=Q[F1e]();ue&&ue[O7]([ne],2)}a(de,"_notifyInvalidEvent");function qe(ne){v.add(ne)}a(qe,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();var AP="",aSo="NoResponseBody",btn="&"+aSo+"=true",u5t="POST",Xqe=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;Si(t,this,function(E,_){var v=!0;j(),E[r3]=function(M,O){o=O,n&&Ra(o,1,28,"Sender is already initialized"),E.SetConfig(M),n=!0},E._getDbgPlgTargets=function(){return[n,s,l,r]},E.SetConfig=function(M){try{if(c=M.senderOnCompleteCallBack||{},l=!!M.disableCredentials,u=M.fetchCredentials,s=!!M.isOneDs,r=!!M.enableSendPromise,f=!!M.disableXhr,h=!!M.disableBeacon,m=!!M.disableBeaconSync,y=M.timeWrapper,A=!!M.addNoResponse,g=!!M.disableFetchKeepAlive,d={sendPOST:N},s||(v=!1),l){var O=Oae();O&&O.protocol&&O.protocol[Wz]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[Tn]?R(M,O):null},E.getFallbackInst=function(){return d},E[N7]=function(M,O){j()},E.preparePayload=function(M,O,U,q){if(!O||q||!U[fS]){M(U);return}try{var Q=Pi("CompressionStream");if(!Lr(Q)){M(U);return}var Y=new ReadableStream({start:a(function(te){te.enqueue(Ei(U[fS])?new TextEncoder().encode(U[fS]):U[fS]),te.close()},"start")}),W=Y.pipeThrough(new Q("gzip")),V=W.getReader(),z=[],ie=0,H=!1;return vl(V.read(),a(function te(le){if(!H&&!le.rejected){var Le=le[n3];if(!Le.done)return z[to](Le[n3]),ie+=Le.value[Tn],vl(V.read(),te);for(var ge=new Uint8Array(ie),Oe=0,we=0,re=z;we0&&(vt(Yu(ge),function(K){H.append(K,ge[K])}),Oe[j1e]=H),u?Oe.credentials=u:v&&s&&(Oe.credentials="include"),U&&(Oe.keepalive=!0,e+=te,s?M._sendReason===2&&(le=!0,A&&(Q+=btn)):le=!0);var we=new Request(Q,Oe);try{we[HOt]=!0}catch{}if(!U&&r&&(V=Fd(function(K,he){z=K,ie=he})),!Q){w(O),z&&z(!1);return}function re(K,he){he?x(O,s?0:he,{},s?AP:K):x(O,s?0:400,{},s?AP:K)}a(re,"_handleError");function ee(K,he,X){var de=K[mP],qe=c.fetchOnComplete;qe&&Lr(qe)?qe(K,O,X||AP,he):x(O,de,{},X||AP)}a(ee,"_onFetchComplete");try{vl(fetch(s?Q:we,s?Oe:null),function(K){if(U&&(e-=te,te=0),!Le)if(Le=!0,K.rejected)re(K.reason&&K.reason[OM],499),ie&&ie(K.reason);else{var he=K[n3];try{!s&&!he.ok?(he[mP]?re(he.statusText,he[mP]):re(he.statusText,499),z&&z(!1)):s&&!he.body?(ee(he,null,AP),z&&z(!0)):vl(he.text(),function(X){ee(he,M,X[n3]),z&&z(!0)})}catch(X){he&&he[mP]?re(dr(X),he[mP]):re(dr(X),499),ie&&ie(X)}}})}catch(K){Le||(re(dr(K),499),ie&&ie(K))}return le&&!Le&&(Le=!0,x(O,200,{}),z&&z(!0)),s&&!Le&&M[Kz]>0&&y&&y.set(function(){Le||(Le=!0,x(O,500,{}),z&&z(!0))},M[Kz]),V}a(L,"_doFetchSender");function B(M,O,U){var q=Af(),Q=new XDomainRequest,Y=M[fS];Q.onload=function(){var H=FM(Q),te=c&&c.xdrOnComplete;te&&Lr(te)?te(Q,O,M):x(O,200,{},H)},Q.onerror=function(){x(O,400,{},s?AP:Pqe(Q))},Q.ontimeout=function(){x(O,500,{})},Q.onprogress=function(){};var W=q&&q.location&&q.location.protocol||"",V=M[xae];if(!V){w(O);return}if(!s&&V.lastIndexOf(W,0)!==0){var z="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";Ra(o,2,40,". "+z),T(z,O);return}var ie=s?V:V[hP](/^(https?:)/,"");Q.open(u5t,ie),M[Kz]&&(Q[Kz]=M[Kz]),Q.send(Y),s&&U?y&&y.set(function(){Q.send(Y)},0):Q.send(Y)}a(B,"_xdrSender");function j(){e=0,n=!1,r=!1,o=null,s=null,c=null,l=null,u=null,d=null,f=!1,h=!1,m=!1,g=!1,A=!1,y=null}a(j,"_initDefaults")})}return a(t,"SenderPostManager"),t.__ieDyn=1,t})();p();var ktn="on",Stn="attachEvent",Ttn="addEventListener",Itn="detachEvent",xtn="removeEventListener",d5t="events",lSe="visibilitychange",tje="pagehide",Ptn="pageshow",Dtn="unload",Ntn="beforeunload",Mtn=xx("aiEvtPageHide"),Otn=xx("aiEvtPageShow"),cSo=/\.[\.]+/g,lSo=/[\.]+$/,uSo=1,eje=Bqe("events"),dSo=/^([^.]*)(?:\.(.+)|)/;function wtn(t){return t&&t[hP]?t[hP](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,bs):t}a(wtn,"_normalizeNamespace");function f5t(t,e){if(e){var r=bs;ur(e)?(r=bs,vt(e,function(o){o=wtn(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=wtn(e),r&&(r[0]!=="."&&(r="."+r),t=(t||bs)+r)}var n=dSo.exec(t||bs)||[];return{type:n[1],ns:(n[2]||bs).replace(cSo,".").replace(lSo,bs)[i3](".").sort().join(".")}}a(f5t,"_getEvtNamespace");function Ltn(t,e,r){r===void 0&&(r=!0);var n=eje.get(t,d5t,{},r),o=n[e];return o||(o=n[e]=[]),o}a(Ltn,"_getRegisteredEvents");function Btn(t,e,r,n){t&&e&&e[o3]&&(t[xtn]?t[xtn](e[o3],r,n):t[Itn]&&t[Itn](ktn+e[o3],r))}a(Btn,"_doDetach");function fSo(t,e,r,n){var o=!1;return t&&e&&e[o3]&&r&&(t[Ttn]?(t[Ttn](e[o3],r,n),o=!0):t[Stn]&&(t[Stn](ktn+e[o3],r),o=!0)),o}a(fSo,"_doAttach");function Rtn(t,e,r,n){for(var o=e[Tn];o--;){var s=e[o];s&&(!r.ns||r.ns===s[wOt].ns)&&(!n||n(s))&&(Btn(t,s[wOt],s.handler,s.capture),e[Tx](o,1))}}a(Rtn,"_doUnregister");function pSo(t,e,r){if(e[o3])Rtn(t,Ltn(t,e[o3]),e,r);else{var n=eje.get(t,d5t,{});Yr(n,function(o,s){Rtn(t,s,e,r)}),Yu(n)[Tn]===0&&eje.kill(t,d5t)}}a(pSo,"_unregisterEvents");function $7(t,e){var r;return e?(ur(e)?r=[t].concat(e):r=[t,e],r=f5t("xx",r).ns[i3](".")):r=t,r}a($7,"mergeEvtNamespace");function aSe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=f5t(e,n);if(s=fSo(t,c,r,o),s&&eje.accept(t)){var l={guid:uSo++,evtName:c,handler:r,capture:o};Ltn(t,c.type)[to](l)}}catch{}return s}a(aSe,"eventOn");function cSe(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=f5t(e,n),c=!1;pSo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||Btn(t,s,r,o)}catch{}}a(cSe,"eventOff");function p5t(t,e,r){var n=!1,o=Af();o&&(n=aSe(o,t,e,r),n=aSe(o.body,t,e,r)||n);var s=gf();return s&&(n=aSe(s,t,e,r)||n),n}a(p5t,"addEventHandler");function h5t(t,e,r){var n=Af();n&&(cSe(n,t,e,r),cSe(n.body,t,e,r));var o=gf();o&&cSe(o,t,e,r)}a(h5t,"removeEventHandler");function zae(t,e,r,n){var o=!1;return e&&t&&t[Tn]>0&&vt(t,function(s){s&&(!r||Vo(r,s)===-1)&&(o=p5t(s,e,n)||o)}),o}a(zae,"_addEventListeners");function m5t(t,e,r,n){var o=!1;return e&&t&&ur(t)&&(o=zae(t,e,r,n),!o&&r&&r[Tn]>0&&(o=zae(t,e,null,n))),o}a(m5t,"addEventListeners");function nY(t,e,r){t&&ur(t)&&vt(t,function(n){n&&h5t(n,e,r)})}a(nY,"removeEventListeners");function rje(t,e,r){return m5t([Ntn,Dtn,tje],t,e,r)}a(rje,"addPageUnloadEventListener");function nje(t,e){nY([Ntn,Dtn,tje],t,e)}a(nje,"removePageUnloadEventListener");function uSe(t,e,r){function n(c){var l=gf();t&&l&&l.visibilityState==="hidden"&&t(c)}a(n,"_handlePageVisibility");var o=$7(Mtn,r),s=zae([tje],t,e,o);return(!e||Vo(e,lSe)===-1)&&(s=zae([lSe],n,e,o)||s),!s&&e&&(s=uSe(t,null,r)),s}a(uSe,"addPageHideEventListener");function ije(t,e){var r=$7(Mtn,e);nY([tje],t,r),nY([lSe],null,r)}a(ije,"removePageHideEventListener");function dSe(t,e,r){function n(c){var l=gf();t&&l&&l.visibilityState==="visible"&&t(c)}a(n,"_handlePageVisibility");var o=$7(Otn,r),s=zae([Ptn],t,e,o);return s=zae([lSe],n,e,o)||s,!s&&e&&(s=dSe(t,null,r)),s}a(dSe,"addPageShowEventListener");function oje(t,e){var r=$7(Otn,e);nY([Ptn],t,r),nY([lSe],null,r)}a(oje,"removePageShowEventListener");p();var Yae="",Ftn="https://browser.events.data.microsoft.com/OneCollector/1.0/",g5t="version",sje="properties";p();p();var A5t="initialize",y5t="indexOf",jM="timings",E5t="pollInternalLogs",mS="value",aje="length",cje="processTelemetryStart";var l3,Utn="4.3.10",fSe="1DS-Web-JS-"+Utn,Qtn=Wbe.hasOwnProperty;var bSo=(l3={},l3[0]=0,l3[2]=6,l3[1]=1,l3[3]=7,l3[4098]=6,l3[4097]=1,l3[4099]=7,l3);var SSo=OB(),TSo=Fse();function Rx(t){return!(t===Yae||Zt(t))}a(Rx,"isValueAssigned");function _5t(t){if(t){var e=uu(t,"-");if(e>-1)return gM(t,e)}return Yae}a(_5t,"getTenantId");function v5t(t){return!!(t&&Oh(t)&&t>=1&&t<=4)}a(v5t,"isLatency");function C5t(t,e,r){if(!e&&!Rx(e)||typeof t!="string")return null;var n=typeof e;if(n==="string"||n==="number"||n==="boolean"||ur(e))e={value:e};else if(n==="object"&&!Qtn.call(e,"value"))e={value:r?JSON.stringify(e):e};else if(Zt(e[mS])||e[mS]===Yae||!Ei(e[mS])&&!Oh(e[mS])&&!rP(e[mS])&&!ur(e[mS]))return null;if(ur(e[mS])&&!jtn(e[mS]))return null;if(!Zt(e.kind)){if(ur(e[mS])||!qtn(e.kind))return null;e[mS]=e[mS].toString()}return e}a(C5t,"sanitizeProperty");function pSe(t,e,r){var n=-1;if(!Nn(t))if(e>0&&(e===32?n=8192:e<=13&&(n=e<<5)),ISo(r))n===-1&&(n=0),n|=r;else{var o=bSo[lje(t)]||-1;n!==-1&&o!==-1?n|=o:o===6&&(n=o)}return n}a(pSe,"getCommonSchemaMetaData");function Kae(t,e,r,n,o){var s={},c=!1,l=0,u=arguments[aje],d=arguments;for(rP(d[0])&&(c=d[0],l++);l0&&t<=13||t===32}a(qtn,"isValueKind");function ISo(t){return t>=0&&t<=9}a(ISo,"isDataType");function jtn(t){return t[aje]>0}a(jtn,"isArrayValid");function uje(t,e){var r=t;r[jM]=r[jM]||{},r[jM][cje]=r[jM][cje]||{},r[jM][cje][e]=gS()}a(uje,"setProcessTelemetryTimings");function lje(t){var e=0;if(t!=null){var r=typeof t;r==="string"?e=1:r==="number"?e=2:r==="boolean"?e=3:r===yx&&(e=4,ur(t)?(e=4096,t[aje]>0&&(e|=lje(t[0]))):Qtn.call(t,"value")&&(e=8192|lje(t[mS])))}return e}a(lje,"getFieldValueType");function b5t(){return!!Pi("chrome")}a(b5t,"isChromium");function iY(t){return t>0}a(iY,"isGreaterThanZero");var xSo=R_({endpointUrl:Ftn,propertyStorageOverride:{isVal:wSo}});function wSo(t){return t&&(!t.getProperty||!t.setProperty)&&el("Invalid property storage override passed."),!0}a(wSo,"_chkPropOverride");var S5t=(function(t){Jy(e,t);function e(){var r=t.call(this)||this;return Si(e,r,function(n,o){n[A5t]=function(s,c,l,u){Vp(n,function(){return"AppInsightsCore.initialize"},function(){try{o[A5t]($p(s,xSo,l||n.logger,!1).cfg,c,l,u)}catch(h){var d=n.logger,f=dr(h);f[y5t]("channels")!==-1&&(f+=` + - Channels must be provided through config.channels only!`),Ra(d,1,514,"SDK Initialization Failed - no telemetry will be sent: "+f)}},function(){return{config:s,extensions:c,logger:l,notificationManager:u}})},n.track=function(s){Vp(n,function(){return"AppInsightsCore.track"},function(){var c=s;if(c){c[jM]=c[jM]||{},c[jM].trackStart=gS(),v5t(c.latency)||(c.latency=1);var l=c.ext=c.ext||{};l.sdk=l.sdk||{},l.sdk.ver=fSe;var u=c.baseData=c.baseData||{};u[sje]=u[sje]||{};var d=u[sje];d[g5t]=d[g5t]||n.pluginVersionString||Yae}o.track(c)},function(){return{item:s}},!s.sync)},n[E5t]=function(s){return o[E5t](s||"InternalLog")}}),r}return a(e,"AppInsightsCore"),e.__ieDyn=1,e})(Zqe);p();p();var hSe="REAL_TIME",Htn="NEAR_REAL_TIME",Gtn="BEST_EFFORT";p();p();p();var yP="";var dje="drop",$tn="send",T5t="requeue",Vtn="rspFail",Wtn="oth",I5t="no-cache, no-store",fje="application/x-json-stream",mSe="cache-control",Jae="content-type",ztn="kill-tokens",Ytn="kill-duration";var Ktn="time-delta-millis",pje="client-version",x5t="client-id",hje="time-delta-to-apply-millis",mje="upload-time",gje="apikey",gSe="AuthMsaDeviceTicket",w5t="WebAuthToken",R5t="AuthXToken";var Jtn="NoResponseBody",Zae="msfpc",k5t="trace",Aje="user";p();var ASe="allowRequestSending",yje="shouldAddClockSkewHeaders",Eje="getClockSkewHeaderValue",ySe="setClockSkew",Wo="length",HM="concat",AS="iKey",Xf="count",GM="events",i0="push",$M="split",_je="toLowerCase",oY="hdrs",vje="useHdrs",sY="initialize",Cje="setTimeoutOverride",bje="clearTimeoutOverride",Ztn="payloadPreprocessor",P5t="overrideEndpointUrl",D5t="avoidOptions",Xtn="disableEventTimings",Sje="enableCompoundKey",N5t="disableXhrSync",M5t="disableFetchKeepAlive",ern="addNoResponse",O5t="useSendBeacon",L5t="fetchCredentials",B5t="alwaysUseXhrOverride",Tje="serializeOfflineEvt",Ije="getOfflineRequestDetails",xje="createPayload",ESe="createOneDSPayload",F5t="payloadBlob",EP="headers",Xae="_thePayload",tE="batches",SC="sendType",_Se="canSendRequest",ece="sendQueuedRequests",vSe="setUnloading",trn="isTenantKilled",wje="sendSynchronousBatch",Rje="_transport",tce="getWParam",U5t="isBeacon",CSe="timings",kje="isTeardown",Pje="_sendReason",Dje="setKillSwitchTenants",Nje="_backOffTransmission",bSe="identifier",rrn="ignoreMc1Ms0CookieProcessing",Q5t="autoFlushEventsLimit",nrn="disableAutoBatchFlushLimit",irn="overrideInstrumentationKey",SSe="sendAttempt",V7="latency",aY="sync";function srn(t){var e=(t.ext||{}).intweb;return e&&Rx(e[Zae])?e[Zae]:null}a(srn,"_getEventMsfpc");function orn(t){for(var e=null,r=0;e===null&&r_l()?!0:(delete s[c],!1)}})}return a(t,"KillSwitch"),t.__ieDyn=1,t})();p();var kSo=.8,PSo=1.2,lrn=3e3,DSo=6e5;function urn(t){return!(t>=300&&t<500&&t!=429||t==501||t==505)}a(urn,"retryPolicyShouldRetryForStatus");function Mje(t){var e=0,r=lrn*kSo,n=lrn*PSo,o=eS(Math.random()*(n-r))+r;return e=Math.pow(2,t)*o,JU(e,DSo)}a(Mje,"retryPolicyGetMillisToBackoffForRetry");p();var NSo=20,MSo=3145728,frn=65e3,prn=2e6,OSo=JU(prn,frn),drn="metadata",Oje="f",LSo=/\./,hrn=(function(){function t(e,r,n,o,s,c,l){var u="data",d="baseData",f="ext",h=!!o,m=!0,g=r,A={},y=!!c,E=s||pSe,_=BSo(l),v=Lje(_.requestLimit,MSo,0),b=Lje(_.requestLimit,frn,1),T=Lje(_.recordLimit,prn,0),w=Math.min(Lje(_.recordLimit,OSo,1),b);Si(t,this,function(R){R.createPayload=function(D,N,L,B,j,M){return{apiKeys:[],payloadBlob:yP,overflow:null,sizeExceed:[],failedEvts:[],batches:[],numEvents:0,retryCnt:D,isTeardown:N,isSync:L,isBeacon:B,sendType:M,sendReason:j}},R.appendPayload=function(D,N,L){var B=D&&N&&!D.overflow;return B&&Vp(e,function(){return"Serializer:appendPayload"},function(){for(var j=N.events(),M=D.payloadBlob,O=D.numEvents,U=!1,q=[],Q=[],Y=D.isBeacon,W=Y?b:v,V=Y?w:T,z=0,ie=0;z=L){D.overflow=N.split(z);break}var te=R.getEventBlob(H);if(te&&te.length<=V){var le=te.length,Le=M.length;if(Le+le>W){D.overflow=N.split(z);break}M&&(M+=` +`),M+=te,ie++,ie>NSo&&(J7e(M,0,1),ie=0),U=!0,O++}else te?q.push(H):Q.push(H),j.splice(z,1),z--}z++}if(q.length>0&&D.sizeExceed.push(W7.create(N.iKey(),q)),Q.length>0&&D.failedEvts.push(W7.create(N.iKey(),Q)),U){D.batches.push(N),D.payloadBlob=M,D.numEvents=O;var ge=N.iKey();Vo(D.apiKeys,ge)===-1&&D.apiKeys.push(ge)}},function(){return{payload:D,theBatch:{iKey:N.iKey(),evts:N.events()},max:L}}),B},R.getEventBlob=function(D){try{return Vp(e,function(){return"Serializer.getEventBlob"},function(){var N={};N.name=D.name,N.time=D.time,N.ver=D.ver,N.iKey="o:"+_5t(D.iKey);var L={},B;y||(B=a(function(U,q,Q){FSo(E,L,U,q,Q)},"_addMetadataCallback"));var j=D[f];j&&(N[f]=L,Yr(j,function(U,q){var Q=L[U]={};P(q,Q,"ext."+U,!0,null,null,!0)}));var M=N[u]={};M.baseType=D.baseType;var O=M[d]={};return P(D.baseData,O,d,!1,[d],B,m),P(D.data,M,u,!1,[],B,m),JSON.stringify(N)},function(){return{item:D}})}catch{return null}};function x(D,N){var L=A[D];return L===void 0&&(D.length>=7&&(L=Qse(D,"ext.metadata")||Qse(D,"ext.web")),A[D]=L),L}a(x,"_isReservedField");function P(D,N,L,B,j,M,O){Yr(D,function(U,q){var Q=null;if(q||Rx(q)){var Y=L,W=U,V=j,z=N;if(h&&!B&&LSo.test(U)){var ie=U.split("."),H=ie.length;if(H>1){V&&(V=V.slice());for(var te=0;te0&&n<=e)return n}return e}a(Lje,"_validateSizeLimit");function BSo(t){var e={};return t&&t.requestLimit?t.requestLimit:e}a(BSo,"_getSizeLimtCfg");function FSo(t,e,r,n,o){if(o&&e){var s=t(o.value,o.kind,o.propertyType);if(s>-1){var c=e[drn];c||(c=e[drn]={f:{}});var l=c[Oje];if(l||(l=c[Oje]={}),r)for(var u=0;u0)for(var o=e[_je](),s=0;s0&&(n&&j5t[e]?(t[oY][j5t[e]]=r,t[vje]=!0):t.url+="&"+e+"="+r)}a(nce,"_addRequestDetails");function jSo(t,e,r){for(var n=0;n=0&&q.splice(Z,1)},"rm")}},H[Tje]=function(me){try{if(b)return b.getEventBlob(me)}catch{}return yP},H[Ije]=function(){try{var me=b&&b[xje](0,!1,!1,!1,1,0);return Ie(me,x)}catch{}return null},H[ESe]=function(me,Z){try{var ve=[];vt(me,function(ae){Z&&(ae=BM(ae));var Ce=W7.create(ae[AS],[ae]);ve[i0](Ce)});for(var Ge=null;ve[Wo]>0&&b;){var Qe=ve.shift();Qe&&Qe[Xf]()>0&&(Ge=Ge||b[xje](0,!1,!1,!1,1,0),b.appendPayload(Ge,Qe,ie))}var je=Ie(Ge,x),J={data:Ge[F5t],urlString:je.url,headers:je[oY],timeout:P,disableXhrSync:N,disableFetchKeepAlive:L};return x&&(Bje(J[EP],mSe)||(J[EP][mSe]=I5t),Bje(J[EP],Jae)||(J[EP][Jae]=fje)),J}catch{}return null};function le(me,Z){try{return V&&V.getSenderInst(me,Z)}catch{}return null}a(le,"_getSenderInterface"),H._getDbgPlgTargets=function(){return[g[0],c,b,g,Le(),s,ie]};function Le(){try{var me={xdrOnComplete:ge,fetchOnComplete:we,xhrOnComplete:re,beaconOnRetry:K},Z={enableSendPromise:!1,isOneDs:!0,disableCredentials:!te,fetchCredentials:z,disableXhr:!1,disableBeacon:!d,disableBeaconSync:!d,disableFetchKeepAlive:L,timeWrapper:Y,addNoResponse:j,senderOnCompleteCallBack:me};return Z}catch{}return null}a(Le,"_getSendPostMgrConfig");function ge(me,Z,ve){var Ge=FM(me);ee(Z,200,{},Ge),be(Ge)}a(ge,"_xdrOncomplete");function Oe(){var me;s=null,c=new crn,l=!1,u=new arn,d=!1,f=0,h=null,m=null,g=null,A=null,y=!0,E=[],_={},v=[],b=null,T=!1,w=null,R=!1,x=!1,P=me,N=me,L=me,B=me,j=me,M=[],O=me,U=me,q=[],Q=!1,Y=rce(),W=!1,V=null,ie=null}a(Oe,"_initDefaults");function we(me,Z,ve,Ge){var Qe=a(function(ae,Ce,Re){ee(Z,ae,Ce,Re),be(Re)},"handleResponse"),je={},J=me[EP];J&&J.forEach(function(ae,Ce){je[Ce]=ae}),Qe(me.status,je,ve||yP)}a(we,"_fetchOnComplete");function re(me,Z,ve){var Ge=FM(me);ee(Z,me.status,U7(me,!0),Ge),be(Ge)}a(re,"_xhrOnComplete");function ee(me,Z,ve,Ge){try{me(Z,ve,Ge)}catch(Qe){Ra(m,2,518,dr(Qe))}}a(ee,"_doOnComplete");function K(me,Z,ve){var Ge=me,Qe=200,je=Ge[Xae],J=me.urlString+(j?USo:yP);try{var ae=Ku();if(je){var Ce=!!A.getPlugin("LocalStorage"),Re=[],$e=[];vt(je[tE],function(Ye){if(Re&&Ye&&Ye[Xf]()>0)for(var lt=Ye[GM](),yt=0;yt0&&(je.sentEvts=$e),Ce||Fe(Re,8003,je[SC],!0)}else Qe=0}catch(Ye){QM(m,"Failed to send telemetry using sendBeacon API. Ex:"+dr(Ye)),Qe=0}finally{ee(Z,Qe,{},yP)}}a(K,"_onBeaconRetry");function he(me){return me===2||me===3}a(he,"_isBeaconPayload");function X(me){return R&&he(me)&&(me=2),me}a(X,"_adjustSendType"),H.addHeader=function(me,Z){_[me]=Z},H.removeHeader=function(me){delete _[me]},H[_Se]=function(){return de()&&u[ASe]()},H[ece]=function(me,Z){Nn(me)&&(me=0),R&&(me=X(me),Z=2),ne(v,me,0)&&Ne(qe(),0,!1,me,Z||0)},H.isCompletelyIdle=function(){return!l&&f===0&&v[Wo]===0},H[vSe]=function(me){R=me},H.addBatch=function(me){if(me&&me[Xf]()>0){if(c.isTenantKilled(me[AS]()))return!1;v[i0](me)}return!0},H.teardown=function(){v[Wo]>0&&Ne(qe(),0,!0,2,2),vt(M,function(me){me&&me.rm&&me.rm()}),M=[]},H.pause=function(){l=!0},H.resume=function(){l=!1,H[ece](0,4)},H[wje]=function(me,Z,ve){me&&me[Xf]()>0&&(Zt(Z)&&(Z=1),R&&(Z=X(Z),ve=2),Ne([me],0,!1,Z,ve||0))};function de(){return!l&&f0&&!l&&g[Z]&&b&&(Ge=Z!==0||de()&&(ve>0||u[ASe]())),Ge}a(ne,"_canSendPayload");function ue(me){var Z={};return me&&vt(me,function(ve,Ge){Z[Ge]={iKey:ve[AS](),evts:ve[GM]()}}),Z}a(ue,"_createDebugBatches");function Ne(me,Z,ve,Ge,Qe){if(!(!me||me[Wo]===0)){if(l){Fe(me,1,Ge);return}Ge=X(Ge);try{var je=me,J=Ge!==0;Vp(A,function(){return"HttpManager:_sendBatches"},function(ae){ae&&(me=me.slice(0));for(var Ce=[],Re=null,$e=gS(),Ye=g[Ge]||(J?g[1]:g[0]),lt=Ye&&Ye[Rje],yt=B&&(R||he(Ge)||lt===3||Ye._isSync&<===2);ne(me,Ge,Z);){var $t=me.shift();$t&&$t[Xf]()>0&&(c.isTenantKilled($t[AS]())?Ce[i0]($t):(Re=Re||b[xje](Z,ve,J,yt,Qe,Ge),b.appendPayload(Re,$t,ie)?Re.overflow!==null&&(me=[Re.overflow][HM](me),Re.overflow=null,tt(Re,$e,gS(),Qe),$e=gS(),Re=null):(tt(Re,$e,gS(),Qe),$e=gS(),me=[$t][HM](me),Re=null)))}Re&&tt(Re,$e,gS(),Qe),me[Wo]>0&&(v=me[HM](v)),Fe(Ce,8004,Ge)},function(){return{batches:ue(je),retryCount:Z,isTeardown:ve,isSynchronous:J,sendReason:Qe,useSendBeacon:he(Ge),sendType:Ge}},!J)}catch(ae){Ra(m,2,48,"Unexpected Exception sending batch: "+dr(ae))}}}a(Ne,"_sendBatches");function Ie(me,Z){var ve={url:s,hdrs:{},useHdrs:!1};Z?(ve[oY]=Kae(ve[oY],_),ve.useHdrs=Yu(ve.hdrs)[Wo]>0):Yr(_,function(ae,Ce){H5t[ae]?nce(ve,H5t[ae],Ce,!1):(ve[oY][ae]=Ce,ve[vje]=!0)}),nce(ve,x5t,"NO_AUTH",Z),nce(ve,pje,fSe,Z);var Ge=yP;vt(me.apiKeys,function(ae){Ge[Wo]>0&&(Ge+=","),Ge+=ae}),nce(ve,gje,Ge,Z),nce(ve,mje,_l().toString(),Z);var Qe=se(me);if(Rx(Qe)&&(ve.url+="&ext.intweb.msfpc="+Qe),u[yje]()&&nce(ve,hje,u[Eje](),Z),A[tce]){var je=A[tce]();je>=0&&(ve.url+="&w="+je)}for(var J=0;J0){var Qe=!!O,je=g[me.sendType];!he(me[SC])&&me[U5t]&&me.sendReason===2&&(je=g[2]||g[3]||je);var J=x;(me.isBeacon||je[Rje]===3)&&(J=!1);var ae=Ie(me,J);J=J||ae[vje];var Ce=gS();Vp(A,function(){return"HttpManager:_doPayloadSend"},function(){for(var Re=0;Re0?yt[q5t]++:yt[q5t]=1}Fe(me[tE],1e3+(Ge||0),me[SC],!0);var St={data:me[F5t],urlString:ae.url,headers:ae[oY],_thePayload:me,_sendReason:Ge,timeout:P,disableXhrSync:N,disableFetchKeepAlive:L};J&&(Bje(St[EP],mSe)||(St[EP][mSe]=I5t),Bje(St[EP],Jae)||(St[EP][Jae]=fje));var We=null;je&&(We=a(function(ce){u.firstRequestSent();var Pe=a(function(ye,oe){_t(ye,oe,me,Ge)},"onComplete"),Me=me[kje]||me.isSync;V.preparePayload(function(ye){try{je.sendPOST(ye,Pe,Me),U&&U(St,ye,Me,me[U5t])}catch(oe){ee(Pe,0,{}),QM(m,"Unexpected exception sending payload. Ex:"+dr(oe))}},D,ce,Me)},"sender")),Vp(A,function(){return"HttpManager:_doPayloadSend.sender"},function(){if(We)if(me[SC]===0&&f++,Qe&&!me.isBeacon&&je[Rje]!==3){var ce={data:St.data,urlString:St.urlString,headers:Kae({},St[EP]),timeout:St.timeout,disableXhrSync:St[N5t],disableFetchKeepAlive:St[M5t]},Pe=!1;Vp(A,function(){return"HttpManager:_doPayloadSend.sendHook"},function(){try{O(ce,function(Me){Pe=!0,!y&&!Me[Xae]&&(Me[Xae]=Me[Xae]||St[Xae],Me[Pje]=Me[Pje]||St[Pje]),We(Me)},me.isSync||me[kje])}catch{Pe||We(St)}})}else We(St)})},function(){return{thePayload:me,serializationStart:Z,serializationCompleted:ve,sendReason:Ge}},me.isSync)}me.sizeExceed&&me.sizeExceed[Wo]>0&&Fe(me.sizeExceed,8003,me[SC]),me.failedEvts&&me.failedEvts[Wo]>0&&Fe(me.failedEvts,8002,me[SC])}a(tt,"_doPayloadSend");function st(me,Z){T&&vt(me,function(ve){var Ge=ve[CSe]=ve[CSe]||{};Be(Ge,"sendEventCompleted",Z)})}a(st,"_addEventCompletedTimings");function _t(me,Z,ve,Ge){var Qe=9e3,je=null,J=!1,ae=!1;try{var Ce=!0;if(typeof me!==oS){if(Z){u[ySe](Z[Ktn]);var Re=Z[Ytn]||Z["kill-duration-seconds"];vt(c[Dje](Z[ztn],Re),function(Ye){vt(ve[tE],function(lt){if(lt[AS]()===Ye){je=je||[];var yt=lt[$M](0);ve.numEvents-=yt[Xf](),je[i0](yt)}})})}if(me==200||me==204){Qe=200;return}(!urn(me)||ve.numEvents<=0)&&(Ce=!1),Qe=9e3+me%1e3}if(Ce){Qe=100;var $e=ve.retryCnt;ve[SC]===0&&($e0&&st(ve[GM](),Z)})}}a(Ht,"_addCompleteTimings");function F(me,Z,ve){Z?me():Y.set(me,ve)}a(F,"_doAction");function se(me){for(var Z=0;Z0&&o){var Qe=o[Ue(Z)];if(Qe){var je=ve!==0;Vp(A,function(){return"HttpManager:_sendBatchesNotification"},function(){F(function(){try{Qe.call(o,me,Z,je,ve)}catch(J){Ra(m,1,74,"send request notification failed: "+J)}},Ge||je,0)},function(){return{batches:ue(me),reason:Z,isSync:je,sendSync:Ge,sendType:ve}},!je)}}}a(Fe,"_sendBatchesNotification");function Ue(me){var Z=qSo[me];return Rx(Z)||(Z=Wtn,me>=9e3&&me<=9999?Z=Vtn:me>=8e3&&me<=8999?Z=dje:me>=1e3&&me<=1999&&(Z=$tn)),Z}a(Ue,"_getNotificationAction")})}return a(t,"HttpManager"),t.__ieDyn=1,t})();var GSo=.25,yrn=500,$So=20,Ern=6,_rn=2,VSo=4,grn=2,WSo=1,G5t=1e4,uY="eventsDiscarded",Arn="",qh=void 0,zSo=R_({eventsLimitInMem:{isVal:iY,v:G5t},immediateEventLimit:{isVal:iY,v:500},autoFlushEventsLimit:{isVal:iY,v:0},disableAutoBatchFlushLimit:!1,httpXHROverride:{isVal:YSo,v:qh},overrideInstrumentationKey:qh,overrideEndpointUrl:qh,disableTelemetry:!1,ignoreMc1Ms0CookieProcessing:!1,setTimeoutOverride:qh,clearTimeoutOverride:qh,payloadPreprocessor:qh,payloadListener:qh,disableEventTimings:qh,valueSanitizer:qh,stringifyObjects:qh,enableCompoundKey:qh,disableOptimizeObj:!1,fetchCredentials:qh,transports:qh,unloadTransports:qh,useSendBeacon:qh,disableFetchKeepAlive:qh,avoidOptions:!1,xhrTimeout:qh,disableXhrSync:qh,alwaysUseXhrOverride:!1,maxEventRetryAttempts:{isVal:Oh,v:Ern},maxUnloadEventRetryAttempts:{isVal:Oh,v:_rn},addNoResponse:qh,maxEvtPerBatch:{isVal:Oh,v:yrn},excludeCsMetaData:qh,requestLimit:{}});function YSo(t){return t&&t.sendPOST}a(YSo,"isOverrideFn");var $5t=(function(t){Jy(e,t);function e(){var r=t.call(this)||this;r.identifier="PostChannel",r.priority=1011,r.version="4.3.10";var n,o=!1,s=[],c,l=!1,u=0,d,f=0,h,m={},g=hSe,A,y,E,_,v,b,T,w,R,x,P,D,N,L,B,j,M,O,U,q,Q,Y,W;return Si(e,r,function(V,z){he(),V._getDbgPlgTargets=function(){return[v,n]},V[sY]=function(J,ae,Ce){Vp(ae,function(){return"PostChannel:initialize"},function(){z[sY](J,ae,Ce),U=ae.getNotifyMgr();try{B=$7(xx(V[bSe]),ae.evtNamespace&&ae.evtNamespace()),V._addHook(hS(J,function(Re){var $e=Re.cfg,Ye=wx(null,$e,ae);n=Ye.getExtCfg(V[bSe],zSo),j=rce(n[Cje],n[bje]),P=!n.disableOptimizeObj&&b5t(),M=n[rrn],H(ae),h=n.eventsLimitInMem,d=n.immediateEventLimit,T=n[Q5t],N=n.maxEventRetryAttempts,L=n.maxUnloadEventRetryAttempts,O=n[nrn],W=n.maxEvtPerBatch,ig($e.endpointUrl)?V.pause():l&&V.resume(),je(),Q=n[irn],Y=!!n.disableTelemetry,q&&ie();var lt=$e.disablePageUnloadEvents||[];q=rje(Le,lt,B),q=uSe(Le,lt,B)||q,q=dSe(ge,$e.disablePageShowEvents,B)||q})),v[sY](J,V.core,V)}catch(Re){throw V.setInitialized(!1),Re}},function(){return{theConfig:J,core:ae,extensions:Ce}})},V.processTelemetry=function(J,ae){uje(J,V[bSe]),ae=ae||V._getTelCtx(ae);var Ce=J;!Y&&!o&&(Q&&(Ce[AS]=Q),we(Ce,!0),D?qe(2,2):K()),V.processNext(Ce,ae)},V.getOfflineSupport=function(){try{var J=v&&v[Ije]();if(v)return{getUrl:a(function(){return J?J.url:null},"getUrl"),serialize:le,batch:te,shouldProcess:a(function(ae){return!Y},"shouldProcess"),createPayload:a(function(ae){return null},"createPayload"),createOneDSPayload:a(function(ae){if(v[ESe])return v[ESe](ae,P)},"createOneDSPayload")}}catch{}return null},V._doTeardown=function(J,ae){qe(2,2),o=!0,v.teardown(),ie(),he()};function ie(){nje(null,B),ije(null,B),oje(null,B)}a(ie,"_removeUnloadHandlers");function H(J){var ae=J[tce];J[tce]=function(){var Ce=0;return M&&(Ce=Ce|2),Ce|ae.call(J)}}a(H,"_hookWParam");function te(J){var ae=Arn;return J&&J[Wo]&&vt(J,function(Ce){ae&&(ae+=` +`),ae+=Ce}),ae}a(te,"_batch");function le(J){var ae=Arn;try{Oe(J),ae=v[Tje](J)}catch{}return ae}a(le,"_serialize");function Le(J){var ae=J||Af().event;ae.type!=="beforeunload"&&(D=!0,v[vSe](D)),qe(2,2)}a(Le,"_handleUnloadEvents");function ge(J){D=!1,v[vSe](D)}a(ge,"_handleShowEvents");function Oe(J){J.ext&&J.ext[k5t]&&delete J.ext[k5t],J.ext&&J.ext[Aje]&&J.ext[Aje].id&&delete J.ext[Aje].id,P&&(J.ext=BM(J.ext),J.baseData&&(J.baseData=BM(J.baseData)),J.data&&(J.data=BM(J.data)))}a(Oe,"_cleanEvent");function we(J,ae){if(J[SSe]||(J[SSe]=0),J[V7]||(J[V7]=1),Oe(J),J[aY]){if(E||l)J[V7]=3,J[aY]=!1;else if(v){P&&(J=BM(J)),v[wje](W7.create(J[AS],[J]),J[aY]===!0?1:J[aY],3);return}}var Ce=J[V7],Re=f,$e=h;Ce===4&&(Re=u,$e=d);var Ye=!1;if(Re<$e)Ye=!Ie(J,ae);else{var lt=1,yt=$So;Ce===4&&(lt=4,yt=1),Ye=!0,Be(J[AS],J[V7],lt,yt)&&(Ye=!Ie(J,ae))}Ye&&Fe(uY,[J],kM.QueueFull)}a(we,"_addEventToQueues"),V.setEventQueueLimits=function(J,ae){n.eventsLimitInMem=h=iY(J)?J:G5t,n[Q5t]=T=iY(ae)?ae:0,je();var Ce=f>J;if(!Ce&&w>0)for(var Re=1;!Ce&&Re<=3;Re++){var $e=b[Re];$e&&$e[tE]&&vt($e[tE],function(Ye){Ye&&Ye[Xf]()>=w&&(Ce=!0)})}Ne(!0,Ce)},V.pause=function(){de(),l=!0,v&&v.pause()},V.resume=function(){l=!1,v&&v.resume(),K()},V._loadTransmitProfiles=function(J){Ht(),Yr(J,function(ae,Ce){var Re=Ce[Wo];if(Re>=2){var $e=Re>2?Ce[2]:0;if(Ce.splice(0,Re-2),Ce[1]<0&&(Ce[0]=-1),Ce[1]>0&&Ce[0]>0){var Ye=Ce[0]/Ce[1];Ce[0]=aZr(Ye)*Ce[1]}$e>=0&&Ce[1]>=0&&$e>Ce[1]&&($e=Ce[1]),Ce[i0]($e),m[ae]=Ce}})},V.flush=function(J,ae,Ce){J===void 0&&(J=!0);var Re;if(!l)if(Ce=Ce||1,J)ae||(Re=Fd(function(Ye){ae=Ye})),c==null?(de(),st(1,0,Ce),c=X(function(){c=null,_t(ae,Ce)},0)):s[i0](ae);else{var $e=de();re(1,1,Ce),ae&&ae(),$e&&K()}return Re},V.setMsaAuthTicket=function(J){v.addHeader(gSe,J)},V.setAuthPluginHeader=function(J){v.addHeader(w5t,J)},V.removeAuthPluginHeader=function(){v.removeHeader(w5t)},V.hasEvents=ee,V._setTransmitProfile=function(J){g!==J&&m[J]!==void 0&&(de(),g=J,K())},F7(V,function(){return v},["addResponseHandler"]);function re(J,ae,Ce){var Re=st(J,ae,Ce);return v[ece](ae,Ce),Re}a(re,"_sendEventsForLatencyAndAbove");function ee(){return f>0}a(ee,"_hasEvents");function K(){if(R>=0&&st(R,0,x)&&v[ece](0,x),u>0&&!y&&!l){var J=m[g][2];J>=0&&(y=X(function(){y=null,re(4,0,1),K()},J))}var ae=m[g][1];!A&&!c&&ae>=0&&!l&&(ee()?A=X(function(){A=null,re(_===0?3:1,0,1),_++,_%=2,K()},ae):_=0)}a(K,"_scheduleTimer"),V[Nje]=function(){E0&&f>T&&(ae=!0),ae&&c==null&&V.flush(J,function(){},20))}a(Ne,"_performAutoFlush");function Ie(J,ae){P&&(J=BM(J));var Ce=J[V7],Re=ue(J[AS],Ce,!0);return Re.addEvent(J)?(Ce!==4?(f++,ae&&J[SSe]===0&&Ne(!J.sync,w>0&&Re[Xf]()>=w)):u++,!0):!1}a(Ie,"_addEventToProperQueue");function Be(J,ae,Ce,Re){for(;Ce<=ae;){var $e=ue(J,ae,!0);if($e&&$e[Xf]()>0){var Ye=$e[$M](0,Re),lt=Ye[Xf]();if(lt>0)return Ce===4?u-=lt:f-=lt,Ue(uY,[Ye],kM.QueueFull),!0}Ce++}return tt(),!1}a(Be,"_dropEventWithLatencyOrLess");function tt(){for(var J=0,ae=0,Ce=a(function($e){var Ye=b[$e];Ye&&Ye[tE]&&vt(Ye[tE],function(lt){$e===4?J+=lt[Xf]():ae+=lt[Xf]()})},"_loop_1"),Re=1;Re<=4;Re++)Ce(Re);f=ae,u=J}a(tt,"_resetQueueCounts");function st(J,ae,Ce){var Re=!1,$e=ae===0;return!$e||v[_Se]()?Vp(V.core,function(){return"PostChannel._queueBatches"},function(){for(var Ye=[],lt=4;lt>=J;){var yt=b[lt];yt&&yt.batches&&yt.batches[Wo]>0&&(vt(yt[tE],function($t){v.addBatch($t)?Re=Re||$t&&$t[Xf]()>0:Ye=Ye[HM]($t[GM]()),lt===4?u-=$t[Xf]():f-=$t[Xf]()}),yt[tE]=[],yt.iKeyMap={}),lt--}Ye[Wo]>0&&Fe(uY,Ye,kM.KillSwitch),Re&&R>=J&&(R=-1,x=0)},function(){return{latency:J,sendType:ae,sendReason:Ce}},!$e):(R=R>=0?JU(R,J):J,x=nP(x,Ce)),Re}a(st,"_queueBatches");function _t(J,ae){re(1,0,ae),tt(),kt(function(){J&&J(),s[Wo]>0?c=X(function(){c=null,_t(s.shift(),ae)},0):(c=null,K())})}a(_t,"_flushImpl");function kt(J){v.isCompletelyIdle()?J():c=X(function(){c=null,kt(J)},GSo)}a(kt,"_waitForIdleManager");function Ht(){de(),F(),g=hSe,K()}a(Ht,"_resetTransmitProfiles");function F(){m={},m[hSe]=[2,1,0],m[Htn]=[6,3,0],m[Gtn]=[18,9,0]}a(F,"_initializeProfiles");function se(J,ae){var Ce=[],Re=N;D&&(Re=L),vt(J,function($e){$e&&$e[Xf]()>0&&vt($e[GM](),function(Ye){Ye&&(Ye[aY]&&(Ye[V7]=4,Ye[aY]=!1),Ye[SSe]0&&Fe(uY,Ce,kM.NonRetryableStatus),D&&qe(2,2)}a(se,"_requeueEvents");function be(J,ae){var Ce=U||{},Re=Ce[J];if(Re)try{Re.apply(Ce,ae)}catch($e){Ra(V.diagLog(),1,74,J+" notification failed: "+$e)}}a(be,"_callNotification");function Fe(J,ae){for(var Ce=[],Re=2;Re0&&be(J,[ae][HM](Ce))}a(Fe,"_notifyEvents");function Ue(J,ae){for(var Ce=[],Re=2;Re0&&vt(ae,function($e){$e&&$e[Xf]()>0&&be(J,[$e.events()][HM](Ce))})}a(Ue,"_notifyBatchEvents");function me(J,ae,Ce){J&&J[Wo]>0&&be("eventsSendRequest",[ae>=1e3&&ae<=1999?ae-1e3:0,Ce!==!0])}a(me,"_sendingEvent");function Z(J,ae){Ue("eventsSent",J,ae),K()}a(Z,"_eventsSentEvent");function ve(J,ae){Ue(uY,J,ae>=8e3&&ae<=8999?ae-8e3:kM.Unknown)}a(ve,"_eventsDropped");function Ge(J){Ue(uY,J,kM.NonRetryableStatus),K()}a(Ge,"_eventsResponseFail");function Qe(J,ae){Ue(uY,J,kM.Unknown),K()}a(Qe,"_otherEvent");function je(){O?w=0:w=nP(W*(grn+1),h/6)}a(je,"_setAutoLimits")}),r}return a(e,"PostChannel"),e.__ieDyn=1,e})(Wae);var yS=fe(require("os"));var Fje=class{constructor(e,r,n,o=!0,s){this.ctx=e;this.namespace=r;this.internalOnly=o;this.onCopilotToken=a(async e=>{this.token=e,this.commonProperties["common.isinternal"]=e?.isInternalUser()?"true":"false",await this.refreshGitHubHandleInCommonProperties();let r=e.getTokenValue("tid");r!==void 0&&(this.tags["ai.user.id"]=r)},"onCopilotToken");this.client=this.initializeClient(n),this.tags=KSo(e),this.commonProperties=JSo(e),this.#e=vs(e,this.onCopilotToken),s&&this.onCopilotToken(s)}static{a(this,"Msft1dsReporter")}#e;initializeClient(e){try{let r=new S5t,n=new $5t,o={instrumentationKey:e,loggingLevelTelemetry:0,loggingLevelConsole:0,disableCookiesUsage:!0,disableDbgExt:!0,disableInstrumentationKeyValidation:!0,channels:[[n]]},s={alwaysUseXhrOverride:!0,httpXHROverride:this.createXhrOverride()};return o.extensionConfig={},o.extensionConfig[n.identifier]=s,r.initialize(o,[]),r.addTelemetryInitializer(c=>{let l=c.ext??{},u=l.web??{};u.consentDetails='{"GPC_DataSharingOptIn":false}',l.web=u,c.ext=l,c.tags={...c.tags??{},...this.tags}}),r}catch(r){Nr.error(this.ctx,"Failed to initialize MSFT 1DS reporter",r)}}sendTelemetryEvent(e,r,n){if(!this.client||this.internalOnly&&!this.token?.isInternalUser())return;r={...r,...this.commonProperties};let o=this.qualifyEventName(e);try{this.client.track({name:o,baseData:{name:o,properties:r,measurements:n}})}catch(s){Nr.debug(this.ctx,"Error tracking telemetry event",s)}}sendTelemetryErrorEvent(e,r,n){this.sendTelemetryEvent(this.qualifyEventName(e),r,n)}async dispose(){this.#e.dispose(),await this.client?.unload(!0,void 0,200)}qualifyEventName(e){return e.startsWith(this.namespace)?e:`${this.namespace}/${e}`}async refreshGitHubHandleInCommonProperties(){try{let e=await this.ctx.get(Mr).resolveSession();e?.login?this.commonProperties["common.github_handle"]=e.login:delete this.commonProperties["common.github_handle"]}catch(e){Nr.debug(this.ctx,"Error resolving GitHub handle for telemetry",e)}}createXhrOverride(){return{sendPOST:a((e,r)=>{if(typeof e.data!="string")throw new Error(`Telemetry reporter only supports string payloads, received ${typeof e.data}`);let n=e.headers??{};n["Content-Type"]="application/json";let o={method:"POST",headers:n,body:e.data};this.ctx.get(nr).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Nr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")}}};function KSo(t){let e={},r=t.get(qa);e["ai.session.id"]=r.sessionId;let n=t.get(Fp);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${yS.type()} ${yS.release()}`,e["ai.device.osArchitecture"]=yS.arch(),e["ai.device.osPlatform"]=yS.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(us).getVersion(),e}a(KSo,"getTags");function JSo(t){let e={};e.common_os=yS.platform(),e.common_platformversion=yS.release(),e.common_arch=yS.arch(),e.common_cpu=Array.from(new Set(yS.cpus().map(n=>n.model))).join();let r=t.get(qa);return e.common_vscodemachineid=r.machineId,e.common_vscodesessionid=r.sessionId,e.client_deviceid=r.devDeviceId,e.common_uikind=r.uiKind,e.common_remotename=r.remoteName,e.common_isnewappinstall="",e}a(JSo,"getCommonProperties");var ZSo="7d7048df-6dd0-4048-bb23-b716c1461f8f",XSo="3fdd7f28-937a-48c8-9a21-ba337db23bd1",eTo="b73649cf-ca8f-4768-9e0e-b789d8529db5",tTo="5fb6107a-6a29-423f-a824-22e3724fa2a6",rTo="ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917";function nTo(t){return VU(t)==="prod"?eTo:tTo}a(nTo,"getMsftInstrumentationKey");function vrn(t){return new URL(t).hostname==="github.com"?iz.telemetry:t.replace("://","://copilot-telemetry-service.")}a(vrn,"getEndpointForServerUrl");var yf=class{constructor(e,r){this.ctx=e;this.namespace=r;this.serverUrl="https://github.com/";this.rootUrl=vrn(this.serverUrl);this.shuttingDown=new Set;this.initListeners=[];vs(e,n=>{this.cachedToken=n,this.updateServiceEndpoints(n.endpoints)})}static{a(this,"TelemetryInitialization")}get endpointUrl(){return this.overrideEndpointUrlForTesting||new URL("telemetry",this.rootUrl).href}get isInitialized(){return this.initializedWith!==void 0}get isEnabled(){return this._enabled??!1}initialize(e){let r=this.ctx;this._enabled=e;let n=this.endpointUrl;if(!(this.initializedWith?.enabled===this._enabled&&this.initializedWith?.endpointUrl===this.endpointUrl)&&(this.shutdownWithoutWaiting(),this.initializedWith={endpointUrl:n,enabled:this._enabled},e)){let o=r.get(tg);if(o.setReporter(new Cae(r,this.namespace,{instrumentationKey:ZSo,endpointUrl:n})),o.setRestrictedReporter(new Cae(r,this.namespace,{instrumentationKey:XSo,endpointUrl:n})),o.setMsftReporter(new Cae(r,`copilot/${this.namespace}`,{instrumentationKey:nTo(r),excludeCommonTags:!0,excludeCommonProperties:!0})),o.setMsft1pReporter(new Fje(r,"ThirdParty.copilot-chat",rTo,!0,this.cachedToken)),this.initListeners){let s=this.initListeners;this.initListeners=void 0;for(let c of s)try{c()}catch{}}}}onInitialized(e){if(this.initListeners)this.initListeners.push(e);else try{e()}catch{}}setCustomReporters(e,r){this.shutdownWithoutWaiting();let n=this.ctx.get(tg);n.setReporter(e),n.setRestrictedReporter(r)}async shutdown(){this.shutdownWithoutWaiting(),await Promise.all(this.shuttingDown)}shutdownWithoutWaiting(){this.initializedWith=void 0;let e=this.ctx.get(tg).deactivate().finally(()=>{this.shuttingDown.delete(e)});this.shuttingDown.add(e)}updateSessionConfig(e){e?.serverUrl&&e.serverUrl!==this.serverUrl&&(this.serverUrl=e.serverUrl,this.rootUrl=vrn(e.serverUrl)),this.isInitialized&&this.initialize(this._enabled)}updateServiceEndpoints(e){this.rootUrl=e.telemetry,this.isInitialized&&this.initialize(this._enabled)}};async function iTo(t,e){let r="copilot_internal/subscribe_limited_user";try{return(await(await Bd(t,e,r,{method:"POST",headers:{"X-GitHub-Api-Version":"2025-05-01"},body:JSON.stringify({restricted_telemetry:t.get(yf).isEnabled?"enabled":"disabled",public_code_suggestions:"enabled"})})).json()).subscribed}catch(n){return mC.exception(t,n,"signUpLimited failed"),!1}}a(iTo,"apiFetchSignUpLimited");async function W5t(t,e,r){let n=await t.get(Ft).getTokenResult();switch(n.failureKind){case void 0:return"OK";case"HTTP401":case"NotSignedIn":return"NotSignedIn";case"NotAuthorized":return r&&n.canSignUpForLimited&&await iTo(t,e)?W5t(t,e,!1):"NotAuthorized";case"Exception":throw n.exception}}a(W5t,"getTokenWithSignUpLimited");p();p();var Crn=fe(ei());var Vi=class extends Crn.Emitter{static{a(this,"Emitter")}get event(){return super.event}};var oTo={didChangeFeatureFlags:!1,didChangeManagedSettings:!1,fetch:!1,ipCodeCitation:!1,redirectedTelemetry:!1,related:!1,token:!1,watchedFiles:!1,showPanelMessage:!1,mcpElicitation:!1,mcpSampling:!1,mcpAllowlist:!1,stateDatabase:!1,subAgent:!1,mcpServerManagement:!1,cveRemediatorAgent:!1,debuggerAgent:!1,contentProvider:[],manageTodoListTool:!1,agentDebugLog:!1,accountPickerEnabled:!1},kn=class{constructor(){this.capabilities={...oTo};this.emitter=new Vi;this.onDidSetCapabilities=this.emitter.event}static{a(this,"CopilotCapabilitiesProvider")}setCapabilities(e){let r;for(r in e){let n=e[r];n!==void 0&&(this.capabilities[r]=n)}this.emitter.fire(this.capabilities)}getCapabilities(){return this.capabilities}};p();var u3=require("fs"),ice=require("os"),oce=fe(require("path")),z7=require("process");var ti=class{static{a(this,"PersistenceManager")}},z5t=class extends ti{constructor(r){super();this.directory=r}static{a(this,"FilePersistenceManager")}async read(r,n){try{return(await this.readJsonObject(r))[n]}catch{return}}async update(r,n,o){await u3.promises.mkdir(this.directory,{recursive:!0,mode:448});let s=`${this.directory}/${r}.json`,c=oce.dirname(s);c!==this.directory&&await u3.promises.mkdir(c,{recursive:!0,mode:448});let l;try{l=await TSe.acquire(s);let u=await this.readJsonObject(r);u[n]=o,await u3.promises.writeFile(s,JSON.stringify(u)+` +`,{encoding:"utf8",mode:384})}finally{l&&await l()}}async delete(r,n){let o=`${this.directory}/${r}.json`,s;try{s=await TSe.acquire(o);let c=await this.readJsonObject(r);delete c[n];let l=JSON.stringify(c)+` `;l===`{} -`?await i3.promises.rm(o):await i3.promises.writeFile(o,l,{encoding:"utf8",mode:384})}catch{}finally{s&&await s()}}async deleteSetting(r){let n=`${this.directory}/${r}.json`,o;try{o=await oSe.acquire(n),await i3.promises.rm(n)}catch{}finally{o&&await o()}}async listSettings(){try{return(await i3.promises.readdir(this.directory)).filter(n=>n.endsWith(".json")).map(n=>n.slice(0,-5))}catch{return[]}}async listKeys(r){return Object.keys(await this.readJsonObject(r))}async readAll(r){return await this.readJsonObject(r)}async readJsonObject(r){let n=`${this.directory}/${r}.json`;try{let o=await i3.promises.readFile(n,{encoding:"utf8"});return JSON.parse(o)}catch{return{}}}},oSe=class{static{a(this,"LockManager")}static{this.locks=new Map}static{this.DEFAULT_TIMEOUT_MS=1e4}static async acquire(e){await this.getLock(e);let r,n=new Promise(o=>{r=o});return this.locks.set(e,n),()=>Promise.resolve().then(()=>{r&&(r(),r=void 0,this.locks.get(e)===n&&this.locks.delete(e))})}static async getLock(e){let r=Date.now();for(;Date.now()-r{setTimeout(()=>{l(new Error("timeout"))},o)});try{await Promise.race([n,s])}catch{return}}}};function Xbo(){if(B7.env.XDG_CONFIG_HOME&&Yae.isAbsolute(B7.env.XDG_CONFIG_HOME))return B7.env.XDG_CONFIG_HOME+"/github-copilot";if((0,zae.platform)()==="win32"){let e=B7.env.USERPROFILE||S5t.homedir();return e?e+"\\AppData\\Local\\github-copilot":htn()}let t=B7.env.HOME&&B7.env.HOME.length>0?B7.env.HOME:S5t.homedir();return t?t+"/.config/github-copilot":htn()}a(Xbo,"getXdgConfigPath");var S5t={homedir:zae.homedir,tmpdir:zae.tmpdir};function htn(){return Yae.join(S5t.tmpdir(),"github-copilot")}a(htn,"tmpdirConfigPath");function mtn(){return new b5t(Xbo())}a(mtn,"makeXdgPersistenceManager");p();var ps=class{static{a(this,"StatusReporter")}#e=0;#t="Normal";#r;#n;#i=!0;#o={category:"auth",kind:"Warning",message:"Not initialized",askToReSignin:!1,result:{status:"NotSignedIn"}};#s={category:"cls",kind:"Normal",inactive:!1};get busy(){return this.#e>0}trackCompletionJob(e){return this.#t==="Warning"&&this.forceNormalV1(),this.#s.kind==="Warning"&&this.forceNormalV2("cls",{inactive:!1}),this.#e++===0&&(this.#a(),this.#c("completion")),e().finally(()=>{--this.#e===0&&(this.#a(),this.#c("completion"))})}forceStatusV1(e,r,n){this.#t===e&&this.#r===r&&!n&&!this.#n&&!this.#i||(this.#t=e,this.#r=r,this.#n=n,this.#i=!1,this.#a())}forceStatusV2(e,r){e==="auth"?this.#o=r:this.#s=r,this.#c(e)}forceStatus(e,r,n){this.forceStatusV1(r.kind,r.message,n),this.forceStatusV2(e,r)}forceNormalV1(){this.#t!=="Inactive"&&this.forceStatusV1("Normal")}forceNormalV2(e,r){this.forceStatusV2(e,{...r,kind:"Normal",category:e})}forceNormal(e,r){this.forceNormalV1(),this.forceNormalV2(e,r)}setErrorV1(e,r){this.forceStatusV1("Error",e,r)}setErrorV2(e,r){let n=e==="auth"?this.#o:this.#s;this.forceStatusV2(e,{...n,...r,kind:"Error",category:e})}setError(e,r,n){this.setErrorV1(r.message,n),this.setErrorV2(e,r)}setWarningV1(e){this.#t!=="Error"&&this.forceStatusV1("Warning",e)}setWarningV2(e,r){let n=e==="auth"?this.#o:this.#s;n.kind!=="Error"&&this.forceStatusV2(e,{...n,...r,kind:"Warning",category:e})}setWarning(e,r){this.setWarningV1(r.message),this.setWarningV2(e,r)}setInactiveV1(e){this.#t==="Error"||this.#t==="Warning"||this.forceStatusV1("Inactive",e)}setClsInactiveV2(e){this.setInactiveV1(e),!(this.#s.kind==="Error"||this.#s.kind==="Warning")&&(this.#s.inactive&&this.#s.message===e||(this.#s={category:"cls",kind:"Normal",inactive:!0,message:e},this.#c("cls")))}setClsInactive(e){this.setInactiveV1(e),this.setClsInactiveV2(e)}clearInactiveV1(){this.#t==="Inactive"&&this.forceStatusV1("Normal")}clearClsInactiveV2(){this.#s.inactive&&(this.#s={category:"cls",kind:"Normal",inactive:!1},this.#c("cls"))}clearClsInactive(){this.clearInactiveV1(),this.clearClsInactiveV2()}sendInitNonAuthStatus(){this.didChangeV2({statuses:[this.#s,{category:"completion",busy:this.busy}]})}#a(){let e={kind:this.#t,message:this.#r,busy:this.busy,command:this.#n};this.didChangeV1(e)}#c(e){let r=this.#u(e);this.didChangeV2({statuses:[r]})}#u(e){switch(e){case"completion":return{category:"completion",busy:this.#e>0};case"auth":return this.#o;case"cls":return this.#s}}},pje=class extends ps{static{a(this,"NoOpStatusReporter")}didChangeV1(){}didChangeV2(){}};p();var gtn={PickerListed:"auth.account_picker.listed",PickerUsed:"auth.account_picker.used"};function Atn(t,e){At(t,gtn.PickerListed,{editorId:e.editorId,hasCurrentSession:String(e.hasCurrentSession),hasOptOutTombstone:String(e.hasOptOutTombstone)},{candidateCount:e.candidateCount})}a(Atn,"telemetryAuthPickerListed");function T5t(t,e){At(t,gtn.PickerUsed,{editorId:e.editorId,status:e.status,clearedTombstone:String(e.clearedTombstone),crossEditorReuse:String(e.crossEditorReuse)},{validationMs:e.validationMs})}a(T5t,"telemetryAuthPickerUsed");p();var F7={StoreInitialize:"auth.store.initialize",StoreError:"auth.store.error",StoreMigration:"auth.store.migration",SessionActivated:"auth.session.activated",SessionDeactivated:"auth.session.deactivated",TokenRevoked:"auth.token.revoked",EncryptionInitialize:"auth.encryption.initialize",EncryptionUpgrade:"auth.encryption.upgrade",EncryptionDecryptV1ToV0:"auth.encryption.decryptV1ToV0"};function ytn(t,e){Vn(t,F7.StoreInitialize,e.error,{repoKind:e.repoKind,errorPhase:e.errorPhase||""},{durationMs:e.durationMs})}a(ytn,"telemetryAuthStoreInitialize");function Etn(t,e){Vn(t,F7.StoreError,e.error,{editorId:e.editorId,op:e.op})}a(Etn,"telemetryAuthStoreError");function _tn(t,e){Vn(t,F7.StoreMigration,e.error,{editorId:e.editorId,outcome:e.outcome},{appsRecords:e.appsRecords,hostsRecords:e.hostsRecords,skippedRecords:e.skippedRecords,durationMs:e.durationMs})}a(_tn,"telemetryAuthStoreMigration");function I5t(t,e){let r={editorId:e.editorId,trigger:e.trigger};e.crossEditorReuse!==void 0&&(r.crossEditorReuse=String(e.crossEditorReuse)),e.tokenRewrite!==void 0&&(r.tokenRewrite=String(e.tokenRewrite)),At(t,F7.SessionActivated,r,{durationMs:e.durationMs})}a(I5t,"telemetryAuthSessionActivated");function vtn(t,e){At(t,F7.SessionDeactivated,{editorId:e.editorId})}a(vtn,"telemetryAuthSessionDeactivated");function sSe(t,e){At(t,F7.TokenRevoked,{editorId:e.editorId,trigger:e.trigger},{affectedEditors:e.affectedEditors})}a(sSe,"telemetryAuthTokenRevoked");function hje(t,e){Vn(t,F7.EncryptionInitialize,e.diagnostics.error,{writerKind:e.writerKind,available:String(e.diagnostics.available),errorPhase:e.diagnostics.errorPhase??"",masterKeySource:e.diagnostics.masterKeySource??""})}a(hje,"telemetryAuthEncryptionInitialize");function x5t(t,e){Vn(t,F7.EncryptionDecryptV1ToV0,e.error,{},e.result?{attempted:e.result.attempted,decrypted:e.result.decrypted,purged:e.result.purged,skipped:e.result.skipped}:void 0)}a(x5t,"telemetryAuthEncryptionDecryptV1ToV0");var e1o="apps",Ctn="hosts",Md=new fe("AuthManager"),btn="legacy_files_migration_done",t1o=5,r1o=6e4,Ur=class{constructor(e,r){this.ctx=e;this.env=r}static{a(this,"AuthManager")}hasTransientSession(){return this.transientSession!==void 0}get _copilotTokenManager(){return this.ctx.get(Qt)}getConfiguredUrls(){return this.ctx.get($m).getConfiguredUrls()}async checkAndUpdateStatus(e){let r=e?.localChecksOnly??!1,n,o;if(e?.githubAppId!==void 0)n=await this.resolvePersistedSession(e);else{let c=await this.resolveSessionWithSource(e?.authAuthority);n=c.session,o=c.sourceEnvVar}if(n===void 0)return this._copilotTokenManager.resetToken("session_not_found"),Md.info(this.ctx,"checkAndUpdateStatus: no session found, priming token"),await this._copilotTokenManager.primeToken(),o?{status:"NotSignedIn",sourceEnvVar:o}:{status:"NotSignedIn"};if(r)return this.ctx.get(ps).forceNormalV2("auth",{result:{status:"MaybeOK",user:n.login}}),o?{status:"MaybeOK",user:n.login,sourceEnvVar:o}:{status:"MaybeOK",user:n.login};e?.forceRefresh&&this._copilotTokenManager.resetToken("force_refresh");let s=await C5t(this.ctx,n,e?.freshSignIn??!1);return o?{status:s,user:n.login,sourceEnvVar:o}:{status:s,user:n.login}}async resolveSession(e){return(await this.resolveSessionWithSource(e)).session}async resolveSessionWithSource(e){await this.ctx.get(Lo).requireReady();let{session:r,sourceEnvVar:n}=R5t(this.env);if(r)return this._copilotTokenManager.setActiveTokenId(void 0),Md.info(this.ctx,`resolveSessionWithSource: resolved from env var ${n}`),{session:{...r,...$y(r)},sourceEnvVar:n};let o=await this.transientSession;if(o)return o.accessToken===void 0?(Md.info(this.ctx,"resolveSessionWithSource: transient session is a shadow, no session"),{session:void 0}):(Md.info(this.ctx,"resolveSessionWithSource: resolved from transient session"),{session:{...o,...$y(o)}});let s=await this.resolvePersistedSession({authAuthority:e});return Md.info(this.ctx,`resolveSessionWithSource: persisted store ${s?"resolved a session":"returned no session"}`),{session:s}}setTransientSession(e){this.transientSession=e&&Promise.resolve(e),this._copilotTokenManager.setActiveTokenId(void 0),this._copilotTokenManager.resetToken("set_transient_session")}},mje=class extends Ur{constructor(){super(...arguments);this.lastTouchAt=0}static{a(this,"PersistentAuthManager")}get authRepository(){return this.ctx.get(nx)}async tracked(r,n){try{return await n()}catch(o){throw Md.exception(this.ctx,o,`authStore.${r}`),Etn(this.ctx,{editorId:this.editorId(),op:r,error:o}),o}}editorId(){return this.cachedEditorId===void 0&&(this.cachedEditorId=this.ctx.get(Ir).getEditorIdentity().editorId),this.cachedEditorId}tokenRecordToSession(r){let n;try{n=UU(this.ctx,r.authAuthority)}catch(o){Md.warn(this.ctx,"tokenRecordToSession: dropping record with unparseable authAuthority",o);return}return{serverUrl:n.serverUrl,apiUrl:n.apiUrl,accessToken:r.accessToken,login:r.user,githubAppId:r.oauthClientId||void 0,scopes:i1o(r.scopes)}}async ensureSqliteMigration(){return this.sqliteMigrationPromise||(this.sqliteMigrationPromise=this.runSqliteMigration()),this.sqliteMigrationPromise}async runSqliteMigration(){let r=this.authRepository;try{if(await r.getMetadata(btn))return}catch{}let n=Date.now(),o=0,s=0,c=0,l="ok",u,d=!1;try{let f=this.ctx.get(Yn),h=this.editorId(),[m,g]=await Promise.all([f.readAll(e1o).catch(()=>({})),f.readAll(Ctn).catch(()=>({}))]);d=Object.keys(m).length>0||Object.keys(g).length>0;for(let[A,y]of Object.entries(m)){let E=Stn(y);if(!E){c++;continue}let[_,v]=n1o(A)??["github.com",Kae],b=E.oauth_token||E.access_token,T=E.user||E.login;if(!b||!T){c++;continue}let w=E.authAuthority||_;if(!jDt(w)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:T,accessToken:b,authAuthority:w,oauthClientId:E.githubAppId??v,scopes:w5t(E.scopes)}),o++}catch{c++}}for(let[A,y]of Object.entries(g)){let E=Stn(y);if(!E){c++;continue}let _=E.oauth_token||E.access_token,v=E.user||E.login;if(!_||!v){c++;continue}let b=E.authAuthority||A;if(!jDt(b)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:v,accessToken:_,authAuthority:b,oauthClientId:E.githubAppId??Kae,scopes:w5t(E.scopes)}),s++}catch{c++}}}catch(f){l="failed",u=f}finally{l==="ok"&&!d&&(l="noop");try{await this.tracked("metadata",()=>r.setMetadata(btn,String(Date.now())))}catch{}this.ctx.get(Yn).deleteSetting(Ctn).catch(()=>{}),_tn(this.ctx,{editorId:this.editorId(),outcome:l,error:u,appsRecords:o,hostsRecords:s,skippedRecords:c,durationMs:Date.now()-n}),Md.info(this.ctx,`runSqliteMigration: outcome=${l} apps=${o} hosts=${s} skipped=${c}`)}}tryAutoAdoptCoalesced(){return this.autoAdoptPromise||(this.autoAdoptPromise=this.tryAutoAdopt().finally(()=>{this.autoAdoptPromise=void 0})),this.autoAdoptPromise}async tryAutoAdopt(){let r=this.authRepository,n=this.editorId(),o=Date.now(),s=await r.listTokensByRecency(t1o);if(Md.debug(this.ctx,`tryAutoAdopt: editorId=${n} candidates=${s.length}`),s.length===0)return;let c=this.ctx.get(Rh);for(let l of s){let u=this.tokenRecordToSession(l.record);if(!u){Md.info(this.ctx,`tryAutoAdopt: dropping corrupt-authority tokenId=${l.tokenId}; continuing walk`),await this.revokeTokenById(l.tokenId,"corrupt_authority");continue}let d;try{d=await c.fetchTokenResult(this.ctx,u)}catch{Md.debug(this.ctx,`tryAutoAdopt: transient fetch error tokenId=${l.tokenId}; aborting walk`);return}if(d.copilotToken||d.failureKind==="NotAuthorized"){Md.info(this.ctx,`tryAutoAdopt: adopting tokenId=${l.tokenId} crossEditor=${l.sourceEditorId!==n} noCopilotAccess=${d.failureKind==="NotAuthorized"}`);try{await this.tracked("assign",()=>r.assignActiveSession(n,l.tokenId))}catch(f){Md.info(this.ctx,`tryAutoAdopt: assign failed for tokenId=${l.tokenId} (${f?.message??f}); continuing walk`);continue}return this._copilotTokenManager.setActiveTokenId(l.tokenId),I5t(this.ctx,{editorId:n,trigger:"auto_adopt",crossEditorReuse:l.sourceEditorId!==n,durationMs:Date.now()-o}),u}if(d.failureKind==="HTTP401"){Md.info(this.ctx,`tryAutoAdopt: skipping invalid tokenId=${l.tokenId} (not revoking); continuing walk`);continue}Md.debug(this.ctx,`tryAutoAdopt: transient failure tokenId=${l.tokenId} kind=${d.failureKind}; aborting walk`);return}Md.debug(this.ctx,`tryAutoAdopt: exhausted candidates editorId=${n}`)}async signInEditor(r){if(!r.user)throw new yi("Cannot sign in: missing GitHub username.");if(!r.accessToken)throw new yi("Cannot sign in: missing GitHub access token.");await this.ensureSqliteMigration();let n=this.editorId(),o=Date.now();Md.debug(this.ctx,`signInEditor: editorId=${n} authority=${r.authAuthority} appId=${r.githubAppId??""}`);let s=await this.tracked("upsert",()=>this.authRepository.upsertTokenAndAssign(n,{user:r.user,accessToken:r.accessToken,authAuthority:r.authAuthority,oauthClientId:r.githubAppId??"",scopes:w5t(r.scopes)}));Md.info(this.ctx,`signInEditor: persisted editorId=${n} tokenId=${s.tokenId} rewrite=${s.tokenRewrite}`),I5t(this.ctx,{editorId:n,trigger:"sign_in",tokenRewrite:s.tokenRewrite,durationMs:Date.now()-o});let c=UU(this.ctx,r.authAuthority);return this.setTransientSession({login:r.user,accessToken:r.accessToken,githubAppId:r.githubAppId,serverUrl:c.serverUrl,apiUrl:c.apiUrl}),this._copilotTokenManager.setActiveTokenId(s.tokenId),await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:r.authAuthority})}async signOutEditor(){let r=this.editorId();return Md.info(this.ctx,`signOutEditor: editorId=${r}`),await this.tracked("opt_out",()=>this.authRepository.markEditorOptedOut(r)),vtn(this.ctx,{editorId:r}),this._copilotTokenManager.setActiveTokenId(void 0),this.setTransientSession(void 0),await this.checkAndUpdateStatus({forceRefresh:!0})}async revokeTokenById(r,n){Md.info(this.ctx,`revokeTokenById: tokenId=${r} trigger=${n??"unknown"}`);let o=await this.tracked("revoke",()=>this.authRepository.deleteTokenCascade(r));return Md.info(this.ctx,`revokeTokenById: cascade complete tokenId=${r} affectedEditors=${o.affectedEditors}`),sSe(this.ctx,{editorId:this.editorId(),trigger:n??"unknown",affectedEditors:o.affectedEditors}),this._copilotTokenManager.resetToken("token_revoked",void 0,r),this._copilotTokenManager.getActiveTokenId()===r&&this._copilotTokenManager.setActiveTokenId(void 0),o}async useExistingToken(r){let n=this.authRepository,o=this.editorId(),s=await n.getTokenById(r);if(!s)return T5t(this.ctx,{editorId:o,status:"revoked",clearedTombstone:!1,crossEditorReuse:!1,validationMs:0}),{status:"revoked"};let c=s.sourceEditorId!==o,l=await n.hasOptOutTombstone(o);this.setTransientSession(void 0),await n.assignActiveSession(o,r),this._copilotTokenManager.setActiveTokenId(r);let u=performance.now(),d,f=!1;try{d=(await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:s.record.authAuthority})).status}catch{f=!0,d="NotSignedIn"}let h;switch(d){case"OK":h="ok";break;case"NotAuthorized":h="not_entitled";break;default:h=f?"transient":"revoked";break}return T5t(this.ctx,{editorId:o,status:h,clearedTombstone:l,crossEditorReuse:c,validationMs:performance.now()-u}),{status:h}}async listAvailableTokens(){await this.ensureSqliteMigration();let r=this.authRepository,n=this.editorId(),o=await r.listAvailableTokens(),s=await r.getActiveSession(n),c=o.map(d=>({tokenId:d.tokenId,authAuthority:d.authAuthority,userLogin:d.userLogin,isCurrent:s?.tokenId===d.tokenId,lastUsedAt:d.lastUsedAt})),l=c.some(d=>d.isCurrent),u=await r.hasOptOutTombstone(n);return Atn(this.ctx,{editorId:n,candidateCount:c.length,hasCurrentSession:l,hasOptOutTombstone:u}),c}async resolvePersistedSession(r){await this.ensureSqliteMigration();let n=this.authRepository,o=this.editorId(),s=this.ctx.get(bn).getCapabilities().accountPickerEnabled,c=await n.hasOptOutTombstone(o),l=await n.getActiveSession(o),u=!l&&!s&&!c;if(u&&(await this.tryAutoAdoptCoalesced(),l=await n.getActiveSession(o)),!l){Md.info(this.ctx,`resolvePersistedSession: no active session editorId=${o} pickerEnabled=${s} optedOut=${c} autoAdoptAttempted=${u}`);return}let d=UU(this.ctx,r?.authAuthority);if(r?.authAuthority!==void 0&&l.record.authAuthority!==d.authAuthority){Md.info(this.ctx,`resolvePersistedSession: active session authority mismatch editorId=${o}`);return}if(r?.githubAppId!==void 0&&l.record.oauthClientId!==r.githubAppId){Md.info(this.ctx,`resolvePersistedSession: active session appId mismatch editorId=${o}`);return}let f=this.tokenRecordToSession(l.record);if(!f){await this.revokeTokenById(l.tokenId,"corrupt_authority");return}this._copilotTokenManager.setActiveTokenId(l.tokenId);let h=Date.now();return h-this.lastTouchAt>=r1o&&(this.lastTouchAt=h,n.touchActiveSession(o).catch(()=>{})),f}};function n1o(t){let e=t.lastIndexOf(":");if(e<0)return;let r=t.slice(e+1);if(r)return[t.slice(0,e),r]}a(n1o,"splitAppsKey");function i1o(t){if(t)return typeof t=="string"?t.split(" ").filter(e=>e.length>0):t}a(i1o,"normalizeScopes");function w5t(t){return t?typeof t=="string"?t:t.join(" "):""}a(w5t,"scopesToString");function Stn(t){if(!(!t||typeof t!="object"||Array.isArray(t)))return t}a(Stn,"asLegacyAuthRecord");function R5t(t){return t.GH_COPILOT_TOKEN&&!/=/.test(t.GH_COPILOT_TOKEN)?{session:{...$y({apiUrl:t.GH_COPILOT_API_URL,serverUrl:t.GH_COPILOT_SERVER_URL}),login:t.GH_COPILOT_USER||"",accessToken:t.GH_COPILOT_TOKEN},sourceEnvVar:"GH_COPILOT_TOKEN"}:t.GITHUB_COPILOT_TOKEN?{session:{...$y({apiUrl:t.GITHUB_COPILOT_API_URL,serverUrl:t.GITHUB_COPILOT_SERVER_URL}),login:t.GITHUB_COPILOT_USER||"",accessToken:t.GITHUB_COPILOT_TOKEN},sourceEnvVar:"GITHUB_COPILOT_TOKEN"}:t.CODESPACES==="true"&&t.GITHUB_TOKEN?{session:{...$y({apiUrl:t.GITHUB_API_URL,serverUrl:t.GITHUB_SERVER_URL}),login:t.GITHUB_USER||"",accessToken:t.GITHUB_TOKEN},sourceEnvVar:"GITHUB_TOKEN"}:{}}a(R5t,"getSessionFromEnv");p();var o1o=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],Ttn="Your proxy connection requires a trusted certificate. Please make sure the proxy certificate and any issuers are configured correctly and trusted by your operating system.",Itn="https://gh.io/copilot-network-errors",CC=class{constructor(){this.notifiedErrorCodes=[]}static{a(this,"UserErrorNotifier")}notifyUser(e,r){if(!(r instanceof Error))return;let n=r;n.code&&o1o.includes(n.code)&&!this.didNotifyBefore(n.code)&&(this.notifiedErrorCodes.push(n.code),this.displayCertificateErrorNotification(e,n))}async displayCertificateErrorNotification(e,r){new fe("certificates").error(e,`${Ttn} Please visit ${Itn} to learn more. Original cause:`,r);let n={title:"Learn more"};return e.get(ts).showWarningMessage(Ttn,n).then(o=>{if(o?.title===n.title)return e.get(Vm).open(Itn)})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};p();var vA=class{constructor(){this.resolve=a(()=>{},"resolve");this.reject=a(()=>{},"reject");this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}static{a(this,"Deferred")}};function bC(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(bC,"delay");async function vx(t,e,r){let n=new Array(t.length),o=Math.floor(e)>0?Math.floor(e):1,s=Math.max(1,Math.min(o,t.length)),c=0,l=a(async()=>{for(let u=c++;ul())),n}a(vx,"mapWithConcurrency");function Jae(t,e){try{t()?.catch(r=>{try{e?.(r)}catch{}})}catch(r){try{e?.(r)}catch{}}}a(Jae,"fireAndForget");function xtn(t){let e=Math.floor(t)>0?Math.floor(t):1,r=0,n=[],o=a(()=>rn.push(()=>{r++,c()})),"acquire"),s=a(()=>{r--,n.shift()?.()},"release");return{async run(c){await o();try{return await c()}finally{s()}}}}a(xtn,"createLimiter");function o3(t,e,r){return new Promise(n=>{let o=!1,s=setTimeout(()=>{o||(o=!0,n(r))},e),c=a(l=>{o||(o=!0,clearTimeout(s),n(l))},"finish");t.then(c,()=>c(r))})}a(o3,"withTimeout");function Zae(t,e,r){try{return t()}catch(n){try{r?.(n)}catch{}return e}}a(Zae,"safeInit");var k5t=class extends yi{constructor(r){super("message"in r?r.message:`${r.failureKind}`);this.result=r}static{a(this,"TokenResultError")}},Qt=class{constructor(e,r=!1){this.ctx=e;this.primed=r;this.lastToken=void 0;this.activeToken=void 0;this.activeTokenId=void 0;this.tokenPromise=void 0;this.tokenPrimingError=void 0;this.refreshTimer=void 0;this.didChangeTokenResult=new Wi;this.onDidChangeTokenResult=this.didChangeTokenResult.event;this.didResetToken=new Wi;this.onDidResetToken=this.didResetToken.event}static{a(this,"CopilotTokenManager")}async getGitHubSession(){return await this.ctx.get(Ur).resolveSession()}primeToken(){if(this.tokenPrimingError)return Promise.reject(this.tokenPrimingError);this.primed=!0;try{return this.getToken().then(()=>!0,()=>!1)}catch{return Promise.resolve(!1)}}async fetchTokenResult(e){return await this.ctx.get(Rh).fetchTokenResult(this.ctx,e,this.lastToken)}setToken(e){this.activeToken=this.lastToken=e,this.scheduleProactiveRefresh(e)}scheduleProactiveRefresh(e){if(this.clearRefreshTimer(),ktn(this.ctx).value)return;let r=e.envelope.refresh_in*1e3;r>0&&r<=2147483647&&(this.refreshTimer=setTimeout(()=>{this.refreshTimer=void 0,!this.tokenPromise&&(wtn(this.ctx,"started",r),this.startTokenRefresh(n=>{wtn(this.ctx,n.copilotToken?"success":"failure",r,n.failureKind??"","exception"in n?n.exception:void 0)}))},r),typeof this.refreshTimer=="object"&&"unref"in this.refreshTimer&&this.refreshTimer.unref())}clearRefreshTimer(){this.refreshTimer!==void 0&&(clearTimeout(this.refreshTimer),this.refreshTimer=void 0)}startTokenRefresh(e){let r,n=this.getGitHubSession().then(async o=>o?(r=o.login,await this.fetchTokenResult(o)):{failureKind:"NotSignedIn"}).catch(o=>{let s=o instanceof Error?o:new Error(String(o));return b_.exception(this.ctx,s,"tokenRefresh"),{failureKind:"Exception",message:String(o),exception:s}}).then(o=>(this.tokenPromise!==n||(this.tokenPromise=void 0,o.copilotToken&&(this.ctx.get(ps).forceNormal("auth",{result:{status:"OK",user:r??""}}),this.setToken(o.copilotToken),this.didChangeTokenResult.fire(o)),e?.(o)),o));this.tokenPromise=n}async getTokenResult(){if(!this.primed){let r=new Error("Token requested before initialization");if(Rtn(this.ctx))throw this.tokenPrimingError=r,r;b_.exception(this.ctx,r,".getToken")}if(this.activeToken!==void 0&&!this.activeToken.needsRefresh())return{copilotToken:this.activeToken};if(!this.tokenPromise){let r,n=this.captureFetchContext(),o=this.getGitHubSession().then(async s=>s?(r=s.login,await this.fetchTokenResult(s)):{failureKind:"NotSignedIn"}).catch(s=>{if(!(s instanceof Error))throw s;return{failureKind:"Exception",message:String(s),exception:s}}).then(s=>(this.tokenPromise!==o||(this.tokenPromise=void 0,this.handleTokenResult(s,r,n)),s));this.tokenPromise=o}return await this.tokenPromise}handleTokenResult(e,r,n){let o=this.ctx.get(ps);switch(e.failureKind){case"NotSignedIn":o.setError("auth",{message:"You are not signed into GitHub.",askToReSignin:!1,result:{status:"NotSignedIn",user:r}});break;case"HTTP401":o.setError("auth",{message:"Your GitHub Copilot session has expired. You have been signed out. Please sign in again to continue using GitHub Copilot.",askToReSignin:!0,result:{status:"NotSignedIn",user:r}},{command:"github.copilot.signIn",title:"Sign In"});break;case"NotAuthorized":o.setError("auth",{message:e.message,askToReSignin:!1,result:{status:"NotAuthorized",user:r??""}});break;case"Exception":o.setWarning("auth",{message:e.message,askToReSignin:!1,result:{status:"NotSignedIn",user:r}}),this.ctx.get(CC).notifyUser(this.ctx,e.exception);break;case void 0:o.forceNormal("auth",{result:{status:"OK",user:r??""}}),this.setToken(e.copilotToken)}this.didChangeTokenResult.fire(e);let s={result:e.copilotToken?"success":"failure",errorCode:e.failureKind??"",trigger:n?.trigger??"unknown",editorPreviewEnabled:e.copilotToken?e.copilotToken.getTokenValue("editor_preview_features")==="0"?"false":"true":""},c=BU(),l={previousRemainingLifetime:n?.previousRemainingLifetime??-1,previousUnadjustedRemainingLifetime:n?.previousUnadjustedRemainingLifetime??-1,newRefreshIn:e.copilotToken?.envelope.refresh_in??-1,newRemainingLifetime:e.copilotToken?e.copilotToken.expiresAt-c:-1,newUnadjustedRemainingLifetime:e.copilotToken?e.copilotToken.envelope.expires_at-c:-1};"exception"in e&&e.exception?Vn(this.ctx,"auth.token_reset_complete",e.exception,s,l):At(this.ctx,"auth.token_reset_complete",s,l)}captureFetchContext(){let e=this.activeToken??this.lastToken,r=this.lastToken===void 0?"initial":this.activeToken===void 0?"after_reset":"expiry",n=BU(),o=e?e.expiresAt-n:-1,s=e?e.envelope.expires_at-n:-1;return{trigger:r,previousRemainingLifetime:o,previousUnadjustedRemainingLifetime:s}}async getToken(){let e=await this.getTokenResult();if(e.copilotToken)return e.copilotToken;throw e.exception?e.exception:new k5t(e)}setActiveTokenId(e){if(this.activeTokenId===e)return;let r=this.activeTokenId;this.activeTokenId=e,r!==void 0&&this.activeToken&&this.resetToken("active_token_id_changed")}getActiveTokenId(){return this.activeTokenId}resetToken(e,r,n){if(n!==void 0&&this.activeTokenId!==void 0&&n!==this.activeTokenId){b_.debug(this.ctx,`Skipping token reset from ${e} for tokenId ${n} because activeTokenId is ${this.activeTokenId}`);return}if(r!==void 0?(Et(this.ctx,"auth.reset_token_"+r),b_.debug(this.ctx,`Resetting copilot token on HTTP error ${r} (caller: ${e})`)):b_.debug(this.ctx,`Resetting copilot token (caller: ${e})`),!this.activeToken&&!this.tokenPromise)return;let o=BU(),s=this.activeToken?this.activeToken.expiresAt-o:-1,c=this.activeToken?this.activeToken.envelope.expires_at-o:-1;At(this.ctx,"auth.token_reset_trigger",{caller:e,httpStatus:r!==void 0?String(r):"",hadActiveToken:String(!!this.activeToken),hadPendingRefresh:String(!!this.tokenPromise)},{remainingLifetime:s,unadjustedRemainingLifetime:c}),this.clearRefreshTimer(),this.activeToken=void 0,this.tokenPromise=void 0,this.didResetToken.fire()}getLastToken(){return this.lastToken}};function rx(t){return t.get(Qt).getLastToken()}a(rx,"getLastCopilotToken");function wtn(t,e,r,n,o){let s={status:e,errorCode:n??""},c={delayMs:r};o?Vn(t,"auth.proactive_copilot_token_refresh",o,s,c):At(t,"auth.proactive_copilot_token_refresh",s,c)}a(wtn,"telemetryProactiveCopilotTokenRefresh");p();var Cx=class{static{a(this,"Clock")}now(){return new Date}};p();var dP=class{static{a(this,"ExpConfigMaker")}},aSe=class extends dP{constructor(r={}){super();this.defaultFilters=r}static{a(this,"ExpConfigFromTAS")}async fetchExperiments(r,n,o){let s=r.get(tr),c=Object.keys(o).length===0?this.defaultFilters:o,l=new URL("telemetry",n.telemetry).href,u;try{u=await s.fetch(l,{method:"GET",headers:c,timeout:5e3})}catch(m){return nC.createFallbackConfig(r,`Error fetching ExP config: ${String(m)}`)}if(!u.ok)return nC.createFallbackConfig(r,`ExP responded with ${u.status}`);let d;try{d=await u.json()}catch(m){if(m instanceof SyntaxError)return qa(r,m,"fetchExperiments"),nC.createFallbackConfig(r,"ExP responded with invalid JSON");throw m}let f=d.Configs.find(m=>m.Id==="vscode")??{Id:"vscode",Parameters:{}},h=Object.entries(f.Parameters).map(([m,g])=>m+(g?"":"cf"));return new nC(f.Parameters,d.AssignmentContext,h.join(";"))}},gje=class extends dP{static{a(this,"ExpConfigNone")}fetchExperiments(){return Promise.resolve(nC.createEmptyConfig())}};p();p();var Aje=class{constructor(e){this.prefix=e}static{a(this,"GranularityImplementation")}getCurrentAndUpComingValues(e){let r=this.getValue(e),n=this.getUpcomingValues(e);return[r,n]}},P5t=class extends Aje{static{a(this,"ConstantGranularity")}getValue(e){return this.prefix}getUpcomingValues(e){return[]}},Ptn=a(t=>new P5t(t),"DEFAULT_GRANULARITY"),yje=class extends Aje{constructor(r,n=.5,o=new Date().setUTCHours(0,0,0,0)){super(r);this.prefix=r;this.fetchBeforeFactor=n;this.anchor=o}static{a(this,"TimeBucketGranularity")}setTimePeriod(r){isNaN(r)?this.timePeriodLengthMs=void 0:this.timePeriodLengthMs=r}setByCallBuckets(r){isNaN(r)?this.numByCallBuckets=void 0:this.numByCallBuckets=r}getValue(r){return this.prefix+this.getTimePeriodBucketString(r)+(this.numByCallBuckets?this.timeHash(r):"")}getTimePeriodBucketString(r){return this.timePeriodLengthMs?this.dateToTimePartString(r):""}getUpcomingValues(r){let n=[],o=this.getUpcomingTimePeriodBucketStrings(r),s=this.getUpcomingByCallBucketStrings();for(let c of o)for(let l of s)n.push(this.prefix+c+l);return n}getUpcomingTimePeriodBucketStrings(r){if(this.timePeriodLengthMs===void 0)return[""];if((r.getTime()-this.anchor)%this.timePeriodLengthMsr.toString())}timeHash(r){return this.numByCallBuckets==null?0:7883*(r.getTime()%this.numByCallBuckets)%this.numByCallBuckets}dateToTimePartString(r){return this.timePeriodLengthMs==null?"":Math.floor((r.getTime()-this.anchor)/this.timePeriodLengthMs).toString()}};var Dtn="X-Copilot-ClientTimeBucket",Eje=class{constructor(e,r){this.specs=new Map;this.prefix=e,this.clock=r,this.defaultGranularity=Ptn(e)}static{a(this,"GranularityDirectory")}selectGranularity(e){for(let[r,n]of this.specs.entries())if(e.extends(r))return n;return this.defaultGranularity}update(e,r,n){if(r=r>1?r:NaN,n=n>0?n:NaN,isNaN(r)&&isNaN(n))this.specs.delete(e);else{let o=new yje(this.prefix);isNaN(r)||o.setByCallBuckets(r),isNaN(n)||o.setTimePeriod(n*3600*1e3),this.specs.set(e,o)}}extendFilters(e){let r=this.selectGranularity(e),[n,o]=r.getCurrentAndUpComingValues(this.clock.now());return{newFilterSettings:e.withChange(Dtn,n),otherFilterSettingsToPrefetch:o.map(s=>e.withChange(Dtn,s))}}};p();p();p();p();var D5t=new Map;async function a1o(t){if(D5t.has(t))return D5t.get(t);let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return D5t.set(t,e),e}a(a1o,"getCachedHmacKey");async function c1o(t){if(t)try{let e=await a1o(t),r=Math.floor(Date.now()/1e3).toString(),n=new TextEncoder().encode(r),o=await crypto.subtle.sign("HMAC",e,n),c=Array.from(new Uint8Array(o)).map(l=>l.toString(16).padStart(2,"0")).join("");return`${r}.${c}`}catch{return}}a(c1o,"createRequestHMAC");async function Ntn(t,e){let r=await c1o(t);return r?{"Request-Hmac":r,"Copilot-Integration-Id":e??"jetbrains-chat-dev"}:{}}a(Ntn,"createMsBenchHmacHeaders");p();p();p();p();var vje="4.13.1",Xz="04b07795-8ddb-461a-bbee-02f9e1bf7b46",Mtn="common",_je;(function(t){t.AzureChina="https://login.chinacloudapi.cn",t.AzureGermany="https://login.microsoftonline.de",t.AzureGovernment="https://login.microsoftonline.us",t.AzurePublicCloud="https://login.microsoftonline.com"})(_je||(_je={}));var cSe=_je.AzurePublicCloud,Otn="login.microsoftonline.com",Ltn=["*"],Btn="cae",Ftn="nocae",Utn="msal.cache";var N5t;var l1o,Cje,qtn;function jtn(){return Cje!==void 0&&qtn!==void 0}a(jtn,"hasVSCodePlugin");function u1o(t){let e={cache:{},broker:{...t.brokerOptions,isEnabled:t.brokerOptions?.enabled??!1,enableMsaPassthrough:t.brokerOptions?.legacyEnableMsaPassthrough??!1}};if(t.tokenCachePersistenceOptions?.enabled){if(N5t===void 0)throw new Error(["Persistent token caching was requested, but no persistence provider was configured.","You must install the identity-cache-persistence plugin package (`npm install --save @azure/identity-cache-persistence`)","and enable it by importing `useIdentityPlugin` from `@azure/identity` and calling","`useIdentityPlugin(cachePersistencePlugin)` before using `tokenCachePersistenceOptions`."].join(" "));let r=t.tokenCachePersistenceOptions.name||Utn;e.cache.cachePlugin=N5t({name:`${r}.${Ftn}`,...t.tokenCachePersistenceOptions}),e.cache.cachePluginCae=N5t({name:`${r}.${Btn}`,...t.tokenCachePersistenceOptions})}return t.brokerOptions?.enabled&&(e.broker.nativeBrokerPlugin=f1o(t.isVSCodeCredential||!1)),e}a(u1o,"generatePluginConfiguration");var Qtn={missing:a((t,e,r)=>[`${t} was requested, but no plugin was configured or no authentication record was found.`,`You must install the ${e} plugin package (npm install --save ${e})`,"and enable it by importing `useIdentityPlugin` from `@azure/identity` and calling",`useIdentityPlugin(${r}) before using enableBroker.`].join(" "),"missing"),unavailable:a((t,e)=>[`${t} was requested, and the plugin is configured, but the broker is unavailable.`,`Ensure the ${t} plugin is properly installed and configured.`,"Check for missing native dependencies and ensure the package is properly installed.",`See the README for prerequisites on installing and using ${e}.`].join(" "),"unavailable")},d1o={vsCode:{credentialName:"Visual Studio Code Credential",packageName:"@azure/identity-vscode",pluginVar:"vsCodePlugin",get brokerInfo(){return qtn}},native:{credentialName:"Broker for WAM",packageName:"@azure/identity-broker",pluginVar:"nativeBrokerPlugin",get brokerInfo(){return l1o}}};function f1o(t){let{credentialName:e,packageName:r,pluginVar:n,brokerInfo:o}=d1o[t?"vsCode":"native"];if(o===void 0)throw new Error(Qtn.missing(e,r,n));if(o.broker.isBrokerAvailable===!1)throw new Error(Qtn.unavailable(e,r));return o.broker}a(f1o,"getBrokerPlugin");var Htn={generatePluginConfiguration:u1o};p();p();p();function p1o(t){return t&&typeof t.error=="string"&&typeof t.error_description=="string"}a(p1o,"isErrorResponse");var $tn="CredentialUnavailableError",Mn=class extends Error{static{a(this,"CredentialUnavailableError")}constructor(e,r){super(e,r),this.name=$tn}},bje="AuthenticationError",U7=class extends Error{static{a(this,"AuthenticationError")}statusCode;errorResponse;constructor(e,r,n){let o={error:"unknown",errorDescription:"An unknown error occurred and no additional details are available."};if(p1o(r))o=Gtn(r);else if(typeof r=="string")try{let s=JSON.parse(r);o=Gtn(s)}catch{e===400?o={error:"invalid_request",errorDescription:`The service indicated that the request was invalid. +`?await u3.promises.rm(o):await u3.promises.writeFile(o,l,{encoding:"utf8",mode:384})}catch{}finally{s&&await s()}}async deleteSetting(r){let n=`${this.directory}/${r}.json`,o;try{o=await TSe.acquire(n),await u3.promises.rm(n)}catch{}finally{o&&await o()}}async listSettings(){try{return(await u3.promises.readdir(this.directory)).filter(n=>n.endsWith(".json")).map(n=>n.slice(0,-5))}catch{return[]}}async listKeys(r){return Object.keys(await this.readJsonObject(r))}async readAll(r){return await this.readJsonObject(r)}async readJsonObject(r){let n=`${this.directory}/${r}.json`;try{let o=await u3.promises.readFile(n,{encoding:"utf8"});return JSON.parse(o)}catch{return{}}}},TSe=class{static{a(this,"LockManager")}static{this.locks=new Map}static{this.DEFAULT_TIMEOUT_MS=1e4}static async acquire(e){await this.getLock(e);let r,n=new Promise(o=>{r=o});return this.locks.set(e,n),()=>Promise.resolve().then(()=>{r&&(r(),r=void 0,this.locks.get(e)===n&&this.locks.delete(e))})}static async getLock(e){let r=Date.now();for(;Date.now()-r{setTimeout(()=>{l(new Error("timeout"))},o)});try{await Promise.race([n,s])}catch{return}}}};function sTo(){if(z7.env.XDG_CONFIG_HOME&&oce.isAbsolute(z7.env.XDG_CONFIG_HOME))return z7.env.XDG_CONFIG_HOME+"/github-copilot";if((0,ice.platform)()==="win32"){let e=z7.env.USERPROFILE||Y5t.homedir();return e?e+"\\AppData\\Local\\github-copilot":brn()}let t=z7.env.HOME&&z7.env.HOME.length>0?z7.env.HOME:Y5t.homedir();return t?t+"/.config/github-copilot":brn()}a(sTo,"getXdgConfigPath");var Y5t={homedir:ice.homedir,tmpdir:ice.tmpdir};function brn(){return oce.join(Y5t.tmpdir(),"github-copilot")}a(brn,"tmpdirConfigPath");function Srn(){return new z5t(sTo())}a(Srn,"makeXdgPersistenceManager");p();var Ss=class{static{a(this,"StatusReporter")}#e=0;#t="Normal";#r;#n;#i=!0;#o={category:"auth",kind:"Warning",message:"Not initialized",askToReSignin:!1,result:{status:"NotSignedIn"}};#s={category:"cls",kind:"Normal",inactive:!1};get busy(){return this.#e>0}trackCompletionJob(e){return this.#t==="Warning"&&this.forceNormalV1(),this.#s.kind==="Warning"&&this.forceNormalV2("cls",{inactive:!1}),this.#e++===0&&(this.#a(),this.#c("completion")),e().finally(()=>{--this.#e===0&&(this.#a(),this.#c("completion"))})}forceStatusV1(e,r,n){this.#t===e&&this.#r===r&&!n&&!this.#n&&!this.#i||(this.#t=e,this.#r=r,this.#n=n,this.#i=!1,this.#a())}forceStatusV2(e,r){e==="auth"?this.#o=r:this.#s=r,this.#c(e)}forceStatus(e,r,n){this.forceStatusV1(r.kind,r.message,n),this.forceStatusV2(e,r)}forceNormalV1(){this.#t!=="Inactive"&&this.forceStatusV1("Normal")}forceNormalV2(e,r){this.forceStatusV2(e,{...r,kind:"Normal",category:e})}forceNormal(e,r){this.forceNormalV1(),this.forceNormalV2(e,r)}setErrorV1(e,r){this.forceStatusV1("Error",e,r)}setErrorV2(e,r){let n=e==="auth"?this.#o:this.#s;this.forceStatusV2(e,{...n,...r,kind:"Error",category:e})}setError(e,r,n){this.setErrorV1(r.message,n),this.setErrorV2(e,r)}setWarningV1(e){this.#t!=="Error"&&this.forceStatusV1("Warning",e)}setWarningV2(e,r){let n=e==="auth"?this.#o:this.#s;n.kind!=="Error"&&this.forceStatusV2(e,{...n,...r,kind:"Warning",category:e})}setWarning(e,r){this.setWarningV1(r.message),this.setWarningV2(e,r)}setInactiveV1(e){this.#t==="Error"||this.#t==="Warning"||this.forceStatusV1("Inactive",e)}setClsInactiveV2(e){this.setInactiveV1(e),!(this.#s.kind==="Error"||this.#s.kind==="Warning")&&(this.#s.inactive&&this.#s.message===e||(this.#s={category:"cls",kind:"Normal",inactive:!0,message:e},this.#c("cls")))}setClsInactive(e){this.setInactiveV1(e),this.setClsInactiveV2(e)}clearInactiveV1(){this.#t==="Inactive"&&this.forceStatusV1("Normal")}clearClsInactiveV2(){this.#s.inactive&&(this.#s={category:"cls",kind:"Normal",inactive:!1},this.#c("cls"))}clearClsInactive(){this.clearInactiveV1(),this.clearClsInactiveV2()}sendInitNonAuthStatus(){this.didChangeV2({statuses:[this.#s,{category:"completion",busy:this.busy}]})}#a(){let e={kind:this.#t,message:this.#r,busy:this.busy,command:this.#n};this.didChangeV1(e)}#c(e){let r=this.#u(e);this.didChangeV2({statuses:[r]})}#u(e){switch(e){case"completion":return{category:"completion",busy:this.#e>0};case"auth":return this.#o;case"cls":return this.#s}}},Uje=class extends Ss{static{a(this,"NoOpStatusReporter")}didChangeV1(){}didChangeV2(){}};p();var Trn={PickerListed:"auth.account_picker.listed",PickerUsed:"auth.account_picker.used"};function Irn(t,e){cr(t,Trn.PickerListed,{editorId:e.editorId,hasCurrentSession:String(e.hasCurrentSession),hasOptOutTombstone:String(e.hasOptOutTombstone)},{candidateCount:e.candidateCount})}a(Irn,"telemetryAuthPickerListed");function K5t(t,e){cr(t,Trn.PickerUsed,{editorId:e.editorId,status:e.status,clearedTombstone:String(e.clearedTombstone),crossEditorReuse:String(e.crossEditorReuse)},{validationMs:e.validationMs})}a(K5t,"telemetryAuthPickerUsed");p();var d3={StoreInitialize:"auth.store.initialize",StoreError:"auth.store.error",StoreMigration:"auth.store.migration",SessionActivated:"auth.session.activated",SessionDeactivated:"auth.session.deactivated",TokenRevoked:"auth.token.revoked",EncryptionInitialize:"auth.encryption.initialize",EncryptionUpgrade:"auth.encryption.upgrade",EncryptionDecryptV1ToV0:"auth.encryption.decryptV1ToV0"};function xrn(t,e){Cs(t,d3.StoreInitialize,e.error,{repoKind:e.repoKind,errorPhase:e.errorPhase||""},{durationMs:e.durationMs}),ft(t,d3.StoreInitialize)}a(xrn,"telemetryAuthStoreInitialize");function wrn(t,e){Cs(t,d3.StoreError,e.error,{editorId:e.editorId,op:e.op})}a(wrn,"telemetryAuthStoreError");function Rrn(t,e){Cs(t,d3.StoreMigration,e.error,{editorId:e.editorId,outcome:e.outcome},{appsRecords:e.appsRecords,hostsRecords:e.hostsRecords,skippedRecords:e.skippedRecords,durationMs:e.durationMs})}a(Rrn,"telemetryAuthStoreMigration");function J5t(t,e){let r={editorId:e.editorId,trigger:e.trigger};e.crossEditorReuse!==void 0&&(r.crossEditorReuse=String(e.crossEditorReuse)),e.tokenRewrite!==void 0&&(r.tokenRewrite=String(e.tokenRewrite)),cr(t,d3.SessionActivated,r,{durationMs:e.durationMs})}a(J5t,"telemetryAuthSessionActivated");function krn(t,e){cr(t,d3.SessionDeactivated,{editorId:e.editorId})}a(krn,"telemetryAuthSessionDeactivated");function ISe(t,e){cr(t,d3.TokenRevoked,{editorId:e.editorId,trigger:e.trigger},{affectedEditors:e.affectedEditors})}a(ISe,"telemetryAuthTokenRevoked");function Qje(t,e){Cs(t,d3.EncryptionInitialize,e.diagnostics.error,{writerKind:e.writerKind,available:String(e.diagnostics.available),errorPhase:e.diagnostics.errorPhase??"",masterKeySource:e.diagnostics.masterKeySource??""})}a(Qje,"telemetryAuthEncryptionInitialize");function Z5t(t,e){Cs(t,d3.EncryptionDecryptV1ToV0,e.error,{},e.result?{attempted:e.result.attempted,decrypted:e.result.decrypted,purged:e.result.purged,skipped:e.result.skipped}:void 0)}a(Z5t,"telemetryAuthEncryptionDecryptV1ToV0");var aTo="apps",Prn="hosts",Qd=new pe("AuthManager"),Drn="legacy_files_migration_done",cTo=5,lTo=6e4,Mr=class{constructor(e,r){this.ctx=e;this.env=r}static{a(this,"AuthManager")}hasTransientSession(){return this.transientSession!==void 0}get _copilotTokenManager(){return this.ctx.get(Ft)}getConfiguredUrls(){return this.ctx.get(Km).getConfiguredUrls()}async checkAndUpdateStatus(e){let r=e?.localChecksOnly??!1,n,o;if(e?.githubAppId!==void 0)n=await this.resolvePersistedSession(e);else{let c=await this.resolveSessionWithSource(e?.authAuthority);n=c.session,o=c.sourceEnvVar}if(n===void 0)return this._copilotTokenManager.resetToken("session_not_found"),Qd.info(this.ctx,"checkAndUpdateStatus: no session found, priming token"),await this._copilotTokenManager.primeToken(),o?{status:"NotSignedIn",sourceEnvVar:o}:{status:"NotSignedIn"};if(r)return this.ctx.get(Ss).forceNormalV2("auth",{result:{status:"MaybeOK",user:n.login}}),o?{status:"MaybeOK",user:n.login,sourceEnvVar:o}:{status:"MaybeOK",user:n.login};e?.forceRefresh&&this._copilotTokenManager.resetToken("force_refresh");let s=await W5t(this.ctx,n,e?.freshSignIn??!1);return o?{status:s,user:n.login,sourceEnvVar:o}:{status:s,user:n.login}}async resolveSession(e){return(await this.resolveSessionWithSource(e)).session}async resolveSessionWithSource(e){await this.ctx.get(Lo).requireReady();let{session:r,sourceEnvVar:n}=e4t(this.env);if(r)return this._copilotTokenManager.setActiveTokenId(void 0),Qd.info(this.ctx,`resolveSessionWithSource: resolved from env var ${n}`),{session:{...r,...Yy(r)},sourceEnvVar:n};let o=await this.transientSession;if(o)return o.accessToken===void 0?(Qd.info(this.ctx,"resolveSessionWithSource: transient session is a shadow, no session"),{session:void 0}):(Qd.info(this.ctx,"resolveSessionWithSource: resolved from transient session"),{session:{...o,...Yy(o)}});let s=await this.resolvePersistedSession({authAuthority:e});return Qd.info(this.ctx,`resolveSessionWithSource: persisted store ${s?"resolved a session":"returned no session"}`),{session:s}}setTransientSession(e){this.transientSession=e&&Promise.resolve(e),this._copilotTokenManager.setActiveTokenId(void 0),this._copilotTokenManager.resetToken("set_transient_session")}},qje=class extends Mr{constructor(){super(...arguments);this.lastTouchAt=0}static{a(this,"PersistentAuthManager")}get authRepository(){return this.ctx.get(fx)}async tracked(r,n){try{return await n()}catch(o){throw Qd.exception(this.ctx,o,`authStore.${r}`),wrn(this.ctx,{editorId:this.editorId(),op:r,error:o}),o}}editorId(){return this.cachedEditorId===void 0&&(this.cachedEditorId=this.ctx.get(Ir).getEditorIdentity().editorId),this.cachedEditorId}tokenRecordToSession(r){let n;try{n=KU(this.ctx,r.authAuthority)}catch(o){Qd.warn(this.ctx,"tokenRecordToSession: dropping record with unparseable authAuthority",o);return}return{serverUrl:n.serverUrl,apiUrl:n.apiUrl,accessToken:r.accessToken,login:r.user,githubAppId:r.oauthClientId||void 0,scopes:dTo(r.scopes)}}async ensureSqliteMigration(){return this.sqliteMigrationPromise||(this.sqliteMigrationPromise=this.runSqliteMigration()),this.sqliteMigrationPromise}async runSqliteMigration(){let r=this.authRepository;try{if(await r.getMetadata(Drn))return}catch{}let n=Date.now(),o=0,s=0,c=0,l="ok",u,d=!1;try{let f=this.ctx.get(ti),h=this.editorId(),[m,g]=await Promise.all([f.readAll(aTo).catch(()=>({})),f.readAll(Prn).catch(()=>({}))]);d=Object.keys(m).length>0||Object.keys(g).length>0;for(let[A,y]of Object.entries(m)){let E=Nrn(y);if(!E){c++;continue}let[_,v]=uTo(A)??["github.com",sce],b=E.oauth_token||E.access_token,T=E.user||E.login;if(!b||!T){c++;continue}let w=E.authAuthority||_;if(!pNt(w)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:T,accessToken:b,authAuthority:w,oauthClientId:E.githubAppId??v,scopes:X5t(E.scopes)}),o++}catch{c++}}for(let[A,y]of Object.entries(g)){let E=Nrn(y);if(!E){c++;continue}let _=E.oauth_token||E.access_token,v=E.user||E.login;if(!_||!v){c++;continue}let b=E.authAuthority||A;if(!pNt(b)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:v,accessToken:_,authAuthority:b,oauthClientId:E.githubAppId??sce,scopes:X5t(E.scopes)}),s++}catch{c++}}}catch(f){l="failed",u=f}finally{l==="ok"&&!d&&(l="noop");try{await this.tracked("metadata",()=>r.setMetadata(Drn,String(Date.now())))}catch{}this.ctx.get(ti).deleteSetting(Prn).catch(()=>{}),Rrn(this.ctx,{editorId:this.editorId(),outcome:l,error:u,appsRecords:o,hostsRecords:s,skippedRecords:c,durationMs:Date.now()-n}),Qd.info(this.ctx,`runSqliteMigration: outcome=${l} apps=${o} hosts=${s} skipped=${c}`)}}tryAutoAdoptCoalesced(){return this.autoAdoptPromise||(this.autoAdoptPromise=this.tryAutoAdopt().finally(()=>{this.autoAdoptPromise=void 0})),this.autoAdoptPromise}async tryAutoAdopt(){let r=this.authRepository,n=this.editorId(),o=Date.now(),s=await r.listTokensByRecency(cTo);if(Qd.debug(this.ctx,`tryAutoAdopt: editorId=${n} candidates=${s.length}`),s.length===0)return;let c=this.ctx.get(Dh);for(let l of s){let u=this.tokenRecordToSession(l.record);if(!u){Qd.info(this.ctx,`tryAutoAdopt: dropping corrupt-authority tokenId=${l.tokenId}; continuing walk`),await this.revokeTokenById(l.tokenId,"corrupt_authority");continue}let d;try{d=await c.fetchTokenResult(this.ctx,u)}catch{Qd.debug(this.ctx,`tryAutoAdopt: transient fetch error tokenId=${l.tokenId}; aborting walk`);return}if(d.copilotToken||d.failureKind==="NotAuthorized"){Qd.info(this.ctx,`tryAutoAdopt: adopting tokenId=${l.tokenId} crossEditor=${l.sourceEditorId!==n} noCopilotAccess=${d.failureKind==="NotAuthorized"}`);try{await this.tracked("assign",()=>r.assignActiveSession(n,l.tokenId))}catch(f){Qd.info(this.ctx,`tryAutoAdopt: assign failed for tokenId=${l.tokenId} (${f?.message??f}); continuing walk`);continue}return this._copilotTokenManager.setActiveTokenId(l.tokenId),J5t(this.ctx,{editorId:n,trigger:"auto_adopt",crossEditorReuse:l.sourceEditorId!==n,durationMs:Date.now()-o}),u}if(d.failureKind==="HTTP401"){Qd.info(this.ctx,`tryAutoAdopt: skipping invalid tokenId=${l.tokenId} (not revoking); continuing walk`);continue}Qd.debug(this.ctx,`tryAutoAdopt: transient failure tokenId=${l.tokenId} kind=${d.failureKind}; aborting walk`);return}Qd.debug(this.ctx,`tryAutoAdopt: exhausted candidates editorId=${n}`)}async signInEditor(r){if(!r.user)throw new yi("Cannot sign in: missing GitHub username.");if(!r.accessToken)throw new yi("Cannot sign in: missing GitHub access token.");await this.ensureSqliteMigration();let n=this.editorId(),o=Date.now();Qd.debug(this.ctx,`signInEditor: editorId=${n} authority=${r.authAuthority} appId=${r.githubAppId??""}`);let s=await this.tracked("upsert",()=>this.authRepository.upsertTokenAndAssign(n,{user:r.user,accessToken:r.accessToken,authAuthority:r.authAuthority,oauthClientId:r.githubAppId??"",scopes:X5t(r.scopes)}));Qd.info(this.ctx,`signInEditor: persisted editorId=${n} tokenId=${s.tokenId} rewrite=${s.tokenRewrite}`),J5t(this.ctx,{editorId:n,trigger:"sign_in",tokenRewrite:s.tokenRewrite,durationMs:Date.now()-o});let c=KU(this.ctx,r.authAuthority);return this.setTransientSession({login:r.user,accessToken:r.accessToken,githubAppId:r.githubAppId,serverUrl:c.serverUrl,apiUrl:c.apiUrl}),this._copilotTokenManager.setActiveTokenId(s.tokenId),await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:r.authAuthority})}async signOutEditor(){let r=this.editorId();return Qd.info(this.ctx,`signOutEditor: editorId=${r}`),await this.tracked("opt_out",()=>this.authRepository.markEditorOptedOut(r)),krn(this.ctx,{editorId:r}),this._copilotTokenManager.setActiveTokenId(void 0),this.setTransientSession(void 0),await this.checkAndUpdateStatus({forceRefresh:!0})}async revokeTokenById(r,n){Qd.info(this.ctx,`revokeTokenById: tokenId=${r} trigger=${n??"unknown"}`);let o=await this.tracked("revoke",()=>this.authRepository.deleteTokenCascade(r));return Qd.info(this.ctx,`revokeTokenById: cascade complete tokenId=${r} affectedEditors=${o.affectedEditors}`),ISe(this.ctx,{editorId:this.editorId(),trigger:n??"unknown",affectedEditors:o.affectedEditors}),this._copilotTokenManager.resetToken("token_revoked",void 0,r),this._copilotTokenManager.getActiveTokenId()===r&&(this._copilotTokenManager.setActiveTokenId(void 0),await this.checkAndUpdateStatus({forceRefresh:!0})),o}async useExistingToken(r){let n=this.authRepository,o=this.editorId(),s=await n.getTokenById(r);if(!s)return K5t(this.ctx,{editorId:o,status:"revoked",clearedTombstone:!1,crossEditorReuse:!1,validationMs:0}),{status:"revoked"};let c=s.sourceEditorId!==o,l=await n.hasOptOutTombstone(o);this.setTransientSession(void 0),await n.assignActiveSession(o,r),this._copilotTokenManager.setActiveTokenId(r);let u=performance.now(),d,f=!1;try{d=(await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:s.record.authAuthority})).status}catch{f=!0,d="NotSignedIn"}let h;switch(d){case"OK":h="ok";break;case"NotAuthorized":h="not_entitled";break;default:h=f?"transient":"revoked";break}return K5t(this.ctx,{editorId:o,status:h,clearedTombstone:l,crossEditorReuse:c,validationMs:performance.now()-u}),{status:h}}async listAvailableTokens(){await this.ensureSqliteMigration();let r=this.authRepository,n=this.editorId(),o=await r.listAvailableTokens(),s=await r.getActiveSession(n),c=o.map(d=>({tokenId:d.tokenId,authAuthority:d.authAuthority,userLogin:d.userLogin,isCurrent:s?.tokenId===d.tokenId,lastUsedAt:d.lastUsedAt})),l=c.some(d=>d.isCurrent),u=await r.hasOptOutTombstone(n);return Irn(this.ctx,{editorId:n,candidateCount:c.length,hasCurrentSession:l,hasOptOutTombstone:u}),c}async resolvePersistedSession(r){await this.ensureSqliteMigration();let n=this.authRepository,o=this.editorId(),s=this.ctx.get(kn).getCapabilities().accountPickerEnabled,c=await n.hasOptOutTombstone(o),l=await n.getActiveSession(o),u=!l&&!s&&!c;if(u&&(await this.tryAutoAdoptCoalesced(),l=await n.getActiveSession(o)),!l){Qd.info(this.ctx,`resolvePersistedSession: no active session editorId=${o} pickerEnabled=${s} optedOut=${c} autoAdoptAttempted=${u}`);return}let d=KU(this.ctx,r?.authAuthority);if(r?.authAuthority!==void 0&&l.record.authAuthority!==d.authAuthority){Qd.info(this.ctx,`resolvePersistedSession: active session authority mismatch editorId=${o}`);return}if(r?.githubAppId!==void 0&&l.record.oauthClientId!==r.githubAppId){Qd.info(this.ctx,`resolvePersistedSession: active session appId mismatch editorId=${o}`);return}let f=this.tokenRecordToSession(l.record);if(!f){await this.revokeTokenById(l.tokenId,"corrupt_authority");return}this._copilotTokenManager.setActiveTokenId(l.tokenId);let h=Date.now();return h-this.lastTouchAt>=lTo&&(this.lastTouchAt=h,n.touchActiveSession(o).catch(()=>{})),f}};function uTo(t){let e=t.lastIndexOf(":");if(e<0)return;let r=t.slice(e+1);if(r)return[t.slice(0,e),r]}a(uTo,"splitAppsKey");function dTo(t){if(t)return typeof t=="string"?t.split(" ").filter(e=>e.length>0):t}a(dTo,"normalizeScopes");function X5t(t){return t?typeof t=="string"?t:t.join(" "):""}a(X5t,"scopesToString");function Nrn(t){if(!(!t||typeof t!="object"||Array.isArray(t)))return t}a(Nrn,"asLegacyAuthRecord");function e4t(t){return t.GH_COPILOT_TOKEN&&!/=/.test(t.GH_COPILOT_TOKEN)?{session:{...Yy({apiUrl:t.GH_COPILOT_API_URL,serverUrl:t.GH_COPILOT_SERVER_URL}),login:t.GH_COPILOT_USER||"",accessToken:t.GH_COPILOT_TOKEN},sourceEnvVar:"GH_COPILOT_TOKEN"}:t.GITHUB_COPILOT_TOKEN?{session:{...Yy({apiUrl:t.GITHUB_COPILOT_API_URL,serverUrl:t.GITHUB_COPILOT_SERVER_URL}),login:t.GITHUB_COPILOT_USER||"",accessToken:t.GITHUB_COPILOT_TOKEN},sourceEnvVar:"GITHUB_COPILOT_TOKEN"}:t.CODESPACES==="true"&&t.GITHUB_TOKEN?{session:{...Yy({apiUrl:t.GITHUB_API_URL,serverUrl:t.GITHUB_SERVER_URL}),login:t.GITHUB_USER||"",accessToken:t.GITHUB_TOKEN},sourceEnvVar:"GITHUB_TOKEN"}:{}}a(e4t,"getSessionFromEnv");p();var fTo=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],Mrn="Your proxy connection requires a trusted certificate. Please make sure the proxy certificate and any issuers are configured correctly and trusted by your operating system.",Orn="https://gh.io/copilot-network-errors",TC=class{constructor(){this.notifiedErrorCodes=[]}static{a(this,"UserErrorNotifier")}notifyUser(e,r){if(!(r instanceof Error))return;let n=r;n.code&&fTo.includes(n.code)&&!this.didNotifyBefore(n.code)&&(this.notifiedErrorCodes.push(n.code),this.displayCertificateErrorNotification(e,n))}async displayCertificateErrorNotification(e,r){new pe("certificates").error(e,`${Mrn} Please visit ${Orn} to learn more. Original cause:`,r);let n={title:"Learn more"};return e.get(es).showWarningMessage(Mrn,n).then(o=>{if(o?.title===n.title)return e.get(Jm).open(Orn)})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};var t4t=class extends yi{constructor(r){super("message"in r?r.message:`${r.failureKind}`);this.result=r}static{a(this,"TokenResultError")}},Ft=class{constructor(e,r=!1){this.ctx=e;this.primed=r;this.lastToken=void 0;this.activeToken=void 0;this.activeTokenId=void 0;this.tokenPromise=void 0;this.tokenPrimingError=void 0;this.didChangeTokenResult=new Vi;this.onDidChangeTokenResult=this.didChangeTokenResult.event;this.didResetToken=new Vi;this.onDidResetToken=this.didResetToken.event}static{a(this,"CopilotTokenManager")}async getGitHubSession(){return await this.ctx.get(Mr).resolveSession()}primeToken(){if(this.tokenPrimingError)return Promise.reject(this.tokenPrimingError);this.primed=!0;try{return this.getToken().then(()=>!0,()=>!1)}catch{return Promise.resolve(!1)}}async fetchTokenResult(e){return await this.ctx.get(Dh).fetchTokenResult(this.ctx,e,this.lastToken)}setToken(e){this.activeToken=this.lastToken=e}async getTokenResult(){if(!this.primed){let r=new Error("Token requested before initialization");if(Lrn(this.ctx))throw this.tokenPrimingError=r,r;mC.exception(this.ctx,r,".getToken")}if(this.activeToken!==void 0&&!this.activeToken.needsRefresh())return{copilotToken:this.activeToken};if(!this.tokenPromise){let r,n=this.captureFetchContext(),o=this.getGitHubSession().then(async s=>s?(r=s.login,await this.fetchTokenResult(s)):{failureKind:"NotSignedIn"}).catch(s=>{if(!(s instanceof Error))throw s;return{failureKind:"Exception",message:String(s),exception:s}}).then(s=>(this.tokenPromise!==o||(this.tokenPromise=void 0,this.handleTokenResult(s,r,n)),s));this.tokenPromise=o}return await this.tokenPromise}handleTokenResult(e,r,n){let o=this.ctx.get(Ss);switch(e.failureKind){case"NotSignedIn":o.setError("auth",{message:"You are not signed into GitHub.",askToReSignin:!1,result:{status:"NotSignedIn",user:r}});break;case"HTTP401":o.setError("auth",{message:"Your GitHub Copilot session has expired. You have been signed out. Please sign in again to continue using GitHub Copilot.",askToReSignin:!0,result:{status:"NotSignedIn",user:r}},{command:"github.copilot.signIn",title:"Sign In"});break;case"NotAuthorized":o.setError("auth",{message:e.message,askToReSignin:!1,result:{status:"NotAuthorized",user:r??""}});break;case"Exception":o.setWarning("auth",{message:e.message,askToReSignin:!1,result:{status:"NotSignedIn",user:r}}),this.ctx.get(TC).notifyUser(this.ctx,e.exception);break;case void 0:o.forceNormal("auth",{result:{status:"OK",user:r??""}}),this.setToken(e.copilotToken)}this.didChangeTokenResult.fire(e);let s={result:e.copilotToken?"success":"failure",errorCode:e.failureKind??"",trigger:n?.trigger??"unknown",editorPreviewEnabled:e.copilotToken?e.copilotToken.getTokenValue("editor_preview_features")==="0"?"false":"true":""},c=zU(),l={previousRemainingLifetime:n?.previousRemainingLifetime??-1,previousUnadjustedRemainingLifetime:n?.previousUnadjustedRemainingLifetime??-1,newRefreshIn:e.copilotToken?.envelope.refresh_in??-1,newRemainingLifetime:e.copilotToken?e.copilotToken.expiresAt-c:-1,newUnadjustedRemainingLifetime:e.copilotToken?e.copilotToken.envelope.expires_at-c:-1};"exception"in e&&e.exception?Cs(this.ctx,"auth.token_reset_complete",e.exception,s,l):cr(this.ctx,"auth.token_reset_complete",s,l)}captureFetchContext(){let e=this.activeToken??this.lastToken,r=this.lastToken===void 0?"initial":this.activeToken===void 0?"after_reset":"expiry",n=zU(),o=e?e.expiresAt-n:-1,s=e?e.envelope.expires_at-n:-1;return{trigger:r,previousRemainingLifetime:o,previousUnadjustedRemainingLifetime:s}}async getToken(){let e=await this.getTokenResult();if(e.copilotToken)return e.copilotToken;throw e.exception?e.exception:new t4t(e)}setActiveTokenId(e){if(this.activeTokenId===e)return;let r=this.activeTokenId;this.activeTokenId=e,r!==void 0&&this.activeToken&&this.resetToken("active_token_id_changed")}getActiveTokenId(){return this.activeTokenId}resetToken(e,r,n){if(n!==void 0&&this.activeTokenId!==void 0&&n!==this.activeTokenId){mC.debug(this.ctx,`Skipping token reset from ${e} for tokenId ${n} because activeTokenId is ${this.activeTokenId}`);return}if(r!==void 0?(ft(this.ctx,"auth.reset_token_"+r),mC.debug(this.ctx,`Resetting copilot token on HTTP error ${r} (caller: ${e})`)):mC.debug(this.ctx,`Resetting copilot token (caller: ${e})`),!this.activeToken&&!this.tokenPromise)return;let o=zU(),s=this.activeToken?this.activeToken.expiresAt-o:-1,c=this.activeToken?this.activeToken.envelope.expires_at-o:-1;cr(this.ctx,"auth.token_reset_trigger",{caller:e,httpStatus:r!==void 0?String(r):"",hadActiveToken:String(!!this.activeToken),hadPendingRefresh:String(!!this.tokenPromise)},{remainingLifetime:s,unadjustedRemainingLifetime:c}),this.activeToken=void 0,this.tokenPromise=void 0,this.didResetToken.fire()}getLastToken(){return this.lastToken}};function dx(t){return t.get(Ft).getLastToken()}a(dx,"getLastCopilotToken");p();var IC=class{static{a(this,"Clock")}now(){return new Date}};p();var _P=class{static{a(this,"ExpConfigMaker")}},pTo=5e3,hTo=2e3,xSe=class extends _P{constructor(r={}){super();this.defaultFilters=r}static{a(this,"ExpConfigFromTAS")}async fetchExperiments(r,n,o){let s=Object.keys(o).length===0?this.defaultFilters:o,c=new URL("telemetry",n.telemetry).href,l=await this.fetchOnce(r,c,s,pTo);return l.kind==="failure"&&l.retryable&&(l=await this.fetchOnce(r,c,s,hTo)),l.kind==="failure"?VI.createFallbackConfig(r,l.reason):l.config}async fetchOnce(r,n,o,s){let c=r.get(nr),l;try{l=await c.fetch(n,{method:"GET",headers:o,timeout:s})}catch(h){return{kind:"failure",reason:`Error fetching ExP config: ${String(h)}`,retryable:!0}}if(!l.ok){let h=l.status>=500||l.status===429;return{kind:"failure",reason:`ExP responded with ${l.status}`,retryable:h}}let u;try{u=await l.json()}catch(h){if(h instanceof SyntaxError)return xa(r,h,"fetchExperiments"),{kind:"failure",reason:"ExP responded with invalid JSON",retryable:!1};throw h}let d=u.Configs.find(h=>h.Id==="vscode")??{Id:"vscode",Parameters:{}},f=Object.entries(d.Parameters).map(([h,m])=>h+(m?"":"cf"));return{kind:"success",config:new VI(d.Parameters,u.AssignmentContext,f.join(";"))}}},jje=class extends _P{static{a(this,"ExpConfigNone")}fetchExperiments(){return Promise.resolve(VI.createEmptyConfig())}};p();p();var Hje=class{constructor(e){this.prefix=e}static{a(this,"GranularityImplementation")}getCurrentAndUpComingValues(e){let r=this.getValue(e),n=this.getUpcomingValues(e);return[r,n]}},r4t=class extends Hje{static{a(this,"ConstantGranularity")}getValue(e){return this.prefix}getUpcomingValues(e){return[]}},Brn=a(t=>new r4t(t),"DEFAULT_GRANULARITY"),Gje=class extends Hje{constructor(r,n=.5,o=new Date().setUTCHours(0,0,0,0)){super(r);this.prefix=r;this.fetchBeforeFactor=n;this.anchor=o}static{a(this,"TimeBucketGranularity")}setTimePeriod(r){isNaN(r)?this.timePeriodLengthMs=void 0:this.timePeriodLengthMs=r}setByCallBuckets(r){isNaN(r)?this.numByCallBuckets=void 0:this.numByCallBuckets=r}getValue(r){return this.prefix+this.getTimePeriodBucketString(r)+(this.numByCallBuckets?this.timeHash(r):"")}getTimePeriodBucketString(r){return this.timePeriodLengthMs?this.dateToTimePartString(r):""}getUpcomingValues(r){let n=[],o=this.getUpcomingTimePeriodBucketStrings(r),s=this.getUpcomingByCallBucketStrings();for(let c of o)for(let l of s)n.push(this.prefix+c+l);return n}getUpcomingTimePeriodBucketStrings(r){if(this.timePeriodLengthMs===void 0)return[""];if((r.getTime()-this.anchor)%this.timePeriodLengthMsr.toString())}timeHash(r){return this.numByCallBuckets==null?0:7883*(r.getTime()%this.numByCallBuckets)%this.numByCallBuckets}dateToTimePartString(r){return this.timePeriodLengthMs==null?"":Math.floor((r.getTime()-this.anchor)/this.timePeriodLengthMs).toString()}};var Frn="X-Copilot-ClientTimeBucket",$je=class{constructor(e,r){this.specs=new Map;this.prefix=e,this.clock=r,this.defaultGranularity=Brn(e)}static{a(this,"GranularityDirectory")}selectGranularity(e){for(let[r,n]of this.specs.entries())if(e.extends(r))return n;return this.defaultGranularity}update(e,r,n){if(r=r>1?r:NaN,n=n>0?n:NaN,isNaN(r)&&isNaN(n))this.specs.delete(e);else{let o=new Gje(this.prefix);isNaN(r)||o.setByCallBuckets(r),isNaN(n)||o.setTimePeriod(n*3600*1e3),this.specs.set(e,o)}}extendFilters(e){let r=this.selectGranularity(e),[n,o]=r.getCurrentAndUpComingValues(this.clock.now());return{newFilterSettings:e.withChange(Frn,n),otherFilterSettingsToPrefetch:o.map(s=>e.withChange(Frn,s))}}};p();p();p();p();var n4t=new Map;async function mTo(t){if(n4t.has(t))return n4t.get(t);let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return n4t.set(t,e),e}a(mTo,"getCachedHmacKey");async function gTo(t){if(t)try{let e=await mTo(t),r=Math.floor(Date.now()/1e3).toString(),n=new TextEncoder().encode(r),o=await crypto.subtle.sign("HMAC",e,n),c=Array.from(new Uint8Array(o)).map(l=>l.toString(16).padStart(2,"0")).join("");return`${r}.${c}`}catch{return}}a(gTo,"createRequestHMAC");async function Urn(t,e){let r=await gTo(t);return r?{"Request-Hmac":r,"Copilot-Integration-Id":e??"jetbrains-chat-dev"}:{}}a(Urn,"createMsBenchHmacHeaders");p();p();p();p();var Wje="4.13.1",dY="04b07795-8ddb-461a-bbee-02f9e1bf7b46",Qrn="common",Vje;(function(t){t.AzureChina="https://login.chinacloudapi.cn",t.AzureGermany="https://login.microsoftonline.de",t.AzureGovernment="https://login.microsoftonline.us",t.AzurePublicCloud="https://login.microsoftonline.com"})(Vje||(Vje={}));var wSe=Vje.AzurePublicCloud,qrn="login.microsoftonline.com",jrn=["*"],Hrn="cae",Grn="nocae",$rn="msal.cache";var i4t;var ATo,zje,Wrn;function zrn(){return zje!==void 0&&Wrn!==void 0}a(zrn,"hasVSCodePlugin");function yTo(t){let e={cache:{},broker:{...t.brokerOptions,isEnabled:t.brokerOptions?.enabled??!1,enableMsaPassthrough:t.brokerOptions?.legacyEnableMsaPassthrough??!1}};if(t.tokenCachePersistenceOptions?.enabled){if(i4t===void 0)throw new Error(["Persistent token caching was requested, but no persistence provider was configured.","You must install the identity-cache-persistence plugin package (`npm install --save @azure/identity-cache-persistence`)","and enable it by importing `useIdentityPlugin` from `@azure/identity` and calling","`useIdentityPlugin(cachePersistencePlugin)` before using `tokenCachePersistenceOptions`."].join(" "));let r=t.tokenCachePersistenceOptions.name||$rn;e.cache.cachePlugin=i4t({name:`${r}.${Grn}`,...t.tokenCachePersistenceOptions}),e.cache.cachePluginCae=i4t({name:`${r}.${Hrn}`,...t.tokenCachePersistenceOptions})}return t.brokerOptions?.enabled&&(e.broker.nativeBrokerPlugin=_To(t.isVSCodeCredential||!1)),e}a(yTo,"generatePluginConfiguration");var Vrn={missing:a((t,e,r)=>[`${t} was requested, but no plugin was configured or no authentication record was found.`,`You must install the ${e} plugin package (npm install --save ${e})`,"and enable it by importing `useIdentityPlugin` from `@azure/identity` and calling",`useIdentityPlugin(${r}) before using enableBroker.`].join(" "),"missing"),unavailable:a((t,e)=>[`${t} was requested, and the plugin is configured, but the broker is unavailable.`,`Ensure the ${t} plugin is properly installed and configured.`,"Check for missing native dependencies and ensure the package is properly installed.",`See the README for prerequisites on installing and using ${e}.`].join(" "),"unavailable")},ETo={vsCode:{credentialName:"Visual Studio Code Credential",packageName:"@azure/identity-vscode",pluginVar:"vsCodePlugin",get brokerInfo(){return Wrn}},native:{credentialName:"Broker for WAM",packageName:"@azure/identity-broker",pluginVar:"nativeBrokerPlugin",get brokerInfo(){return ATo}}};function _To(t){let{credentialName:e,packageName:r,pluginVar:n,brokerInfo:o}=ETo[t?"vsCode":"native"];if(o===void 0)throw new Error(Vrn.missing(e,r,n));if(o.broker.isBrokerAvailable===!1)throw new Error(Vrn.unavailable(e,r));return o.broker}a(_To,"getBrokerPlugin");var Yrn={generatePluginConfiguration:yTo};p();p();p();function vTo(t){return t&&typeof t.error=="string"&&typeof t.error_description=="string"}a(vTo,"isErrorResponse");var Jrn="CredentialUnavailableError",Mn=class extends Error{static{a(this,"CredentialUnavailableError")}constructor(e,r){super(e,r),this.name=Jrn}},Yje="AuthenticationError",Y7=class extends Error{static{a(this,"AuthenticationError")}statusCode;errorResponse;constructor(e,r,n){let o={error:"unknown",errorDescription:"An unknown error occurred and no additional details are available."};if(vTo(r))o=Krn(r);else if(typeof r=="string")try{let s=JSON.parse(r);o=Krn(s)}catch{e===400?o={error:"invalid_request",errorDescription:`The service indicated that the request was invalid. ${r}`}:o={error:"unknown_error",errorDescription:`An unknown error has occurred. Response body: ${r}`}}else o={error:"unknown_error",errorDescription:"An unknown error occurred and no additional details are available."};super(`${o.error} Status code: ${e} More details: -${o.errorDescription},`,n),this.statusCode=e,this.errorResponse=o,this.name=bje}},Vtn="AggregateAuthenticationError",lSe=class extends Error{static{a(this,"AggregateAuthenticationError")}errors;constructor(e,r){let n=e.join(` +${o.errorDescription},`,n),this.statusCode=e,this.errorResponse=o,this.name=Yje}},Zrn="AggregateAuthenticationError",RSe=class extends Error{static{a(this,"AggregateAuthenticationError")}errors;constructor(e,r){let n=e.join(` `);super(`${r} -${n}`),this.errors=e,this.name=Vtn}};function Gtn(t){return{error:t.error,errorDescription:t.error_description,correlationId:t.correlation_id,errorCodes:t.error_codes,timestamp:t.timestamp,traceId:t.trace_id}}a(Gtn,"convertOAuthErrorResponseToErrorResponse");var bx=class extends Error{static{a(this,"AuthenticationRequiredError")}scopes;getTokenOptions;constructor(e){super(e.message,e.cause?{cause:e.cause}:void 0),this.scopes=e.scopes,this.getTokenOptions=e.getTokenOptions,this.name="AuthenticationRequiredError"}};p();p();p();p();var Wtn=require("node:os"),ztn=de(require("node:util"),1),Ytn=de(require("node:process"),1);function Ktn(t,...e){Ytn.stderr.write(`${ztn.default.format(t,...e)}${Wtn.EOL}`)}a(Ktn,"log");var Jtn=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,Ztn,M5t=[],O5t=[],Sje=[];Jtn&&L5t(Jtn);var Xtn=Object.assign(t=>ern(t),{enable:L5t,enabled:B5t,disable:h1o,log:Ktn});function L5t(t){Ztn=t,M5t=[],O5t=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?O5t.push(new RegExp(`^${n.substr(1)}$`)):M5t.push(new RegExp(`^${n}$`));for(let n of Sje)n.enabled=B5t(n.namespace)}a(L5t,"enable");function B5t(t){if(t.endsWith("*"))return!0;for(let e of O5t)if(e.test(t))return!1;for(let e of M5t)if(e.test(t))return!0;return!1}a(B5t,"enabled");function h1o(){let t=Ztn||"";return L5t(""),t}a(h1o,"disable");function ern(t){let e=Object.assign(r,{enabled:B5t(t),destroy:m1o,log:Xtn.log,namespace:t,extend:g1o});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),Sje.push(e),e}a(ern,"createDebugger");function m1o(){let t=Sje.indexOf(this);return t>=0?(Sje.splice(t,1),!0):!1}a(m1o,"destroy");function g1o(t){let e=ern(`${this.namespace}:${t}`);return e.log=this.log,e}a(g1o,"extend");var Xae=Xtn;var rrn=new Set,Tje=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,xje,F5t=Xae("azure");F5t.log=(...t)=>{Xae.log(...t)};var U5t=["verbose","info","warning","error"];Tje&&(orn(Tje)?A1o(Tje):console.error(`AZURE_LOG_LEVEL set to unknown log level '${Tje}'; logging is not enabled. Acceptable values: ${U5t.join(", ")}.`));function A1o(t){if(t&&!orn(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${U5t.join(",")}`);xje=t;let e=[];for(let r of rrn)irn(r)&&e.push(r.namespace);Xae.enable(e.join(","))}a(A1o,"setLogLevel");function wje(){return xje}a(wje,"getLogLevel");var trn={verbose:400,info:300,warning:200,error:100};function Q7(t){let e=F5t.extend(t);return nrn(F5t,e),{error:Ije(e,"error"),warning:Ije(e,"warning"),info:Ije(e,"info"),verbose:Ije(e,"verbose")}}a(Q7,"createClientLogger");function nrn(t,e){e.log=(...r)=>{t.log(...r)}}a(nrn,"patchLogMethod");function Ije(t,e){let r=Object.assign(t.extend(e),{level:e});if(nrn(t,r),irn(r)){let n=Xae.disable();Xae.enable(n+","+r.namespace)}return rrn.add(r),r}a(Ije,"createLogger");function irn(t){return!!(xje&&trn[t.level]<=trn[xje])}a(irn,"shouldEnable");function orn(t){return U5t.includes(t)}a(orn,"isAzureLogLevel");var hS=Q7("identity");function Rje(t){return t.reduce((e,r)=>(process.env[r]?e.assigned.push(r):e.missing.push(r),e),{missing:[],assigned:[]})}a(Rje,"processEnvVars");function e0(t){return`SUCCESS. Scopes: ${Array.isArray(t)?t.join(", "):t}.`}a(e0,"formatSuccess");function Us(t,e){let r="ERROR.";return t?.length&&(r+=` Scopes: ${Array.isArray(t)?t.join(", "):t}.`),`${r} Error message: ${typeof e=="string"?e:e.message}.`}a(Us,"formatError");function srn(t,e,r=hS){let n=e?`${e.fullTitle} ${t}`:t;function o(u){r.info(`${n} =>`,u)}a(o,"info");function s(u){r.warning(`${n} =>`,u)}a(s,"warning");function c(u){r.verbose(`${n} =>`,u)}a(c,"verbose");function l(u){r.error(`${n} =>`,u)}return a(l,"error"),{title:t,fullTitle:n,info:o,warning:s,verbose:c,error:l}}a(srn,"credentialLoggerInstance");function lo(t,e=hS){let r=srn(t,void 0,e);return{...r,parent:e,getToken:srn("=> getToken()",r,e)}}a(lo,"credentialLogger");p();p();p();p();var ece={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function arn(t={}){let e=new Q5t(t.parentContext);return t.span&&(e=e.setValue(ece.span,t.span)),t.namespace&&(e=e.setValue(ece.namespace,t.namespace)),e}a(arn,"createTracingContext");var Q5t=class t{static{a(this,"TracingContextImpl")}constructor(e){this._contextMap=e instanceof t?new Map(e._contextMap):new Map}setValue(e,r){let n=new t(this);return n._contextMap.set(e,r),n}getValue(e){return this._contextMap.get(e)}deleteValue(e){let r=new t(this);return r._contextMap.delete(e),r}};p();var crn=de(q5t(),1),Pje=crn.state;function y1o(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(y1o,"createDefaultTracingSpan");function E1o(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:y1o(),tracingContext:arn({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(E1o,"createDefaultInstrumenter");function uSe(){return Pje.instrumenterImplementation||(Pje.instrumenterImplementation=E1o()),Pje.instrumenterImplementation}a(uSe,"getInstrumenter");p();function dSe(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=uSe().startSpan(d,Object.assign(Object.assign({},h),{packageName:r,packageVersion:n,tracingContext:(m=f?.tracingOptions)===null||m===void 0?void 0:m.tracingContext})),A=g.tracingContext,y=g.span;A.getValue(ece.namespace)||(A=A.setValue(ece.namespace,e)),y.setAttribute("az.namespace",A.getValue(ece.namespace));let E=Object.assign({},f,{tracingOptions:Object.assign(Object.assign({},f?.tracingOptions),{tracingContext:A})});return{span:y,updatedOptions:E}}a(o,"startSpan");async function s(d,f,h,m){let{span:g,updatedOptions:A}=o(d,f,m);try{let y=await c(A.tracingOptions.tracingContext,()=>Promise.resolve(h(A,g)));return g.setStatus({status:"success"}),y}catch(y){throw g.setStatus({status:"error",error:y}),y}finally{g.end()}}a(s,"withSpan");function c(d,f,...h){return uSe().withContext(d,f,...h)}a(c,"withContext");function l(d){return uSe().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return uSe().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(dSe,"createTracingClient");var Mc=dSe({namespace:"Microsoft.AAD",packageName:"@azure/identity",packageVersion:vje});var j5t=lo("ChainedTokenCredential"),fSe=class{static{a(this,"ChainedTokenCredential")}_sources=[];constructor(...e){this._sources=e}async getToken(e,r={}){let{token:n}=await this.getTokenInternal(e,r);return n}async getTokenInternal(e,r={}){let n=null,o,s=[];return Mc.withSpan("ChainedTokenCredential.getToken",r,async c=>{for(let l=0;l0){let l=new lSe(s,"ChainedTokenCredential authentication failed.");throw j5t.getToken.info(Us(e,l)),l}if(j5t.getToken.info(`Result for ${o.constructor.name}: ${e0(e)}`),n===null)throw new Mn("Failed to retrieve a valid token");return{token:n,successfulCredential:o}})}};p();p();p();p();var _S={};ki(_S,{AuthError:()=>Fo,AuthErrorCodes:()=>vce,AzureCloudInstance:()=>l3,ClientAssertion:()=>p3,ClientAuthError:()=>G7,ClientAuthErrorCodes:()=>$p,ClientConfigurationError:()=>cce,ClientConfigurationErrorCodes:()=>uce,ConfidentialClientApplication:()=>Fce,CryptoProvider:()=>jM,DistributedCachePlugin:()=>mGe,InteractionRequiredAuthError:()=>AS,InteractionRequiredAuthErrorCodes:()=>fHe,LogLevel:()=>mf,Logger:()=>r0,ManagedIdentityApplication:()=>Uce,ManagedIdentitySourceNames:()=>no,PromptValue:()=>f2o,ProtocolMode:()=>Xy,PublicClientApplication:()=>Lce,ResponseMode:()=>p2o,ServerError:()=>k_,TokenCache:()=>Sce,TokenCacheContext:()=>mS,internals:()=>mBt,version:()=>ES});p();var mBt={};ki(mBt,{Deserializer:()=>f3,Serializer:()=>q7});p();p();var q7=class{static{a(this,"Serializer")}static serializeJSONBlob(e){return JSON.stringify(e)}static serializeAccounts(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,realm:o.realm,local_account_id:o.localAccountId,username:o.username,authority_type:o.authorityType,name:o.name,client_info:o.clientInfo,last_modification_time:o.lastModificationTime,last_modification_app:o.lastModificationApp,tenantProfiles:o.tenantProfiles?.map(s=>JSON.stringify(s))}}),r}static serializeIdTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,realm:o.realm}}),r}static serializeAccessTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,realm:o.realm,target:o.target,cached_at:o.cachedAt,expires_on:o.expiresOn,extended_expires_on:o.extendedExpiresOn,refresh_on:o.refreshOn,key_id:o.keyId,token_type:o.tokenType,userAssertionHash:o.userAssertionHash,resource:o.resource}}),r}static serializeRefreshTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,family_id:o.familyId,target:o.target,realm:o.realm}}),r}static serializeAppMetadata(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={client_id:o.clientId,environment:o.environment,family_id:o.familyId}}),r}static serializeAllCache(e){return{Account:this.serializeAccounts(e.accounts),IdToken:this.serializeIdTokens(e.idTokens),AccessToken:this.serializeAccessTokens(e.accessTokens),RefreshToken:this.serializeRefreshTokens(e.refreshTokens),AppMetadata:this.serializeAppMetadata(e.appMetadata)}}};p();p();p();var an={};ki(an,{addApplicationTelemetry:()=>ISe,addAuthorizationCode:()=>HLt,addBrokerParameters:()=>c3,addCcsOid:()=>s3,addCcsUpn:()=>$7,addClaims:()=>uY,addCliData:()=>VLt,addClientAssertion:()=>RSe,addClientAssertionType:()=>kSe,addClientCapabilitiesToClaims:()=>prn,addClientId:()=>cY,addClientInfo:()=>fY,addClientSecret:()=>wSe,addCodeChallengeParams:()=>TSo,addCodeVerifier:()=>$Lt,addCorrelationId:()=>dY,addDeviceCode:()=>ISo,addDomainHint:()=>QLt,addEARParameters:()=>PSo,addExtraParameters:()=>a3,addGrantType:()=>PSe,addIdTokenHint:()=>ULt,addInstanceAware:()=>DSe,addLibraryInfo:()=>TSe,addLoginHint:()=>fce,addLogoutHint:()=>WLt,addNativeBroker:()=>SSo,addNonce:()=>jLt,addOboAssertion:()=>xSo,addPassword:()=>kSo,addPopToken:()=>NSe,addPostLogoutRedirectUri:()=>FLt,addPrompt:()=>qLt,addRedirectUri:()=>lY,addRefreshToken:()=>GLt,addRequestTokenUse:()=>wSo,addResource:()=>BSe,addResponseMode:()=>BLt,addResponseType:()=>bSo,addScopes:()=>aY,addServerTelemetry:()=>OSe,addSid:()=>tHe,addSshJwk:()=>MSe,addState:()=>xSe,addThrottling:()=>LSe,addUsername:()=>RSo,instrumentBrokerParams:()=>sY});p();var er={};ki(er,{AADAuthority:()=>fP,AAD_INSTANCE_DISCOVERY_ENDPT:()=>W5t,AAD_TENANT_DOMAIN_SUFFIX:()=>z5t,ADFS:()=>$5t,APP_METADATA:()=>oce,AUTHORITY_METADATA_CACHE_KEY:()=>sce,AUTHORITY_METADATA_REFRESH_TIME_SECONDS:()=>u4t,AUTHORIZATION_PENDING:()=>b1o,AZURE_REGION_AUTO_DISCOVER_FLAG:()=>Z5t,AuthenticationScheme:()=>hf,AuthorityMetadataSource:()=>Zy,CACHE_ACCOUNT_TYPE_ADFS:()=>c4t,CACHE_ACCOUNT_TYPE_GENERIC:()=>Uje,CACHE_ACCOUNT_TYPE_MSAV1:()=>j1o,CACHE_ACCOUNT_TYPE_MSSTS:()=>a4t,CACHE_KEY_SEPARATOR:()=>tY,CIAM_AUTH_URL:()=>Dje,CLIENT_INFO:()=>l4t,CLIENT_INFO_SEPARATOR:()=>ice,CLIENT_MISMATCH_ERROR:()=>_4t,CODE_GRANT_TYPE:()=>v1o,CONSUMER_UTID:()=>_1o,CacheOutcome:()=>pP,CacheType:()=>H1o,ClaimsRequestKeys:()=>nce,CodeChallengeMethodValues:()=>Q1o,CredentialType:()=>t0,DEFAULT_AUTHORITY:()=>lrn,DEFAULT_AUTHORITY_HOST:()=>G5t,DEFAULT_COMMON_TENANT:()=>pSe,DEFAULT_MAX_THROTTLE_TIME_SECONDS:()=>A4t,DEFAULT_THROTTLE_TIME_SECONDS:()=>g4t,DEFAULT_TOKEN_RENEWAL_OFFSET_SEC:()=>v4t,DSTS:()=>V5t,EMAIL_SCOPE:()=>frn,EncodingTypes:()=>W1o,FORWARD_SLASH:()=>tce,GrantType:()=>gSe,HTTP_BAD_REQUEST:()=>Bje,HTTP_CLIENT_ERROR:()=>w1o,HTTP_CLIENT_ERROR_RANGE_END:()=>n4t,HTTP_CLIENT_ERROR_RANGE_START:()=>r4t,HTTP_GATEWAY_TIMEOUT:()=>L1o,HTTP_GONE:()=>D1o,HTTP_MULTI_SIDED_ERROR:()=>B1o,HTTP_NOT_FOUND:()=>k1o,HTTP_REDIRECT:()=>x1o,HTTP_REQUEST_TIMEOUT:()=>P1o,HTTP_SERVER_ERROR:()=>M1o,HTTP_SERVER_ERROR_RANGE_END:()=>o4t,HTTP_SERVER_ERROR_RANGE_START:()=>i4t,HTTP_SERVICE_UNAVAILABLE:()=>O1o,HTTP_SUCCESS:()=>Lje,HTTP_SUCCESS_RANGE_END:()=>I1o,HTTP_SUCCESS_RANGE_START:()=>T1o,HTTP_TOO_MANY_REQUESTS:()=>N1o,HTTP_UNAUTHORIZED:()=>R1o,HeaderNames:()=>Gp,HttpMethod:()=>F1o,IMDS_ENDPOINT:()=>Oje,IMDS_TIMEOUT:()=>J5t,IMDS_VERSION:()=>K5t,INVALID_GRANT_ERROR:()=>E4t,INVALID_INSTANCE:()=>t4t,JsonWebTokenTypes:()=>$1o,KNOWN_PUBLIC_CLOUDS:()=>e4t,NOT_APPLICABLE:()=>hSe,NOT_AVAILABLE:()=>eY,OAuthResponseType:()=>q1o,OFFLINE_ACCESS_SCOPE:()=>Mje,OIDC_DEFAULT_SCOPES:()=>rce,OIDC_SCOPES:()=>Fje,ONE_DAY_IN_MS:()=>V1o,OPENID_SCOPE:()=>urn,PROFILE_SCOPE:()=>drn,PasswordGrantConstants:()=>jje,PersistentCacheKeys:()=>U1o,PromptValue:()=>mSe,REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:()=>X5t,RESOURCE_DELIM:()=>Nje,RegionDiscoveryOutcomes:()=>ESe,RegionDiscoverySources:()=>H7,ResponseMode:()=>s4t,S256_CODE_CHALLENGE_METHOD:()=>C1o,SERVER_TELEM_CACHE_KEY:()=>ASe,SERVER_TELEM_CATEGORY_SEPARATOR:()=>qje,SERVER_TELEM_MAX_CACHED_ERRORS:()=>f4t,SERVER_TELEM_MAX_CUR_HEADER_BYTES:()=>G1o,SERVER_TELEM_MAX_LAST_HEADER_BYTES:()=>d4t,SERVER_TELEM_OVERFLOW_FALSE:()=>h4t,SERVER_TELEM_OVERFLOW_TRUE:()=>p4t,SERVER_TELEM_SCHEMA_VERSION:()=>Qje,SERVER_TELEM_UNKNOWN_ERROR:()=>m4t,SERVER_TELEM_VALUE_SEPARATOR:()=>j7,SHR_NONCE_VALIDITY:()=>S1o,SKU:()=>H5t,THE_FAMILY_ID:()=>rY,THROTTLING_PREFIX:()=>ySe,URL_FORM_CONTENT_TYPE:()=>Y5t,X_MS_LIB_CAPABILITY_VALUE:()=>y4t});p();var H5t="msal.js.common",lrn="https://login.microsoftonline.com/common/",G5t="login.microsoftonline.com",pSe="common",$5t="adfs",V5t="dstsv2",W5t=`${lrn}discovery/instance?api-version=1.1&authorization_endpoint=`,Dje=".ciamlogin.com",z5t=".onmicrosoft.com",Nje="|",_1o="9188040d-6c67-4c5b-b112-36a304b66dad",urn="openid",drn="profile",Mje="offline_access",frn="email",v1o="authorization_code",C1o="S256",Y5t="application/x-www-form-urlencoded;charset=utf-8",b1o="authorization_pending",hSe="N/A",eY="Not Available",tce="/",Oje="http://169.254.169.254/metadata/instance/compute/location",K5t="2020-06-01",J5t=2e3,Z5t="TryAutoDetect",X5t="login.microsoft.com",e4t=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],S1o=240,t4t="invalid_instance",Lje=200,T1o=200,I1o=299,x1o=302,w1o=400,r4t=400,Bje=400,R1o=401,k1o=404,P1o=408,D1o=410,N1o=429,n4t=499,M1o=500,i4t=500,O1o=503,L1o=504,o4t=599,B1o=600,F1o={GET:"GET",POST:"POST"},rce=[urn,drn,Mje],Fje=[...rce,frn],Gp={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},U1o={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},fP={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},nce={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},mSe={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},Q1o={PLAIN:"plain",S256:"S256"},q1o={CODE:"code",IDTOKEN_TOKEN:"id_token token",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},s4t={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},gSe={IMPLICIT_GRANT:"implicit",AUTHORIZATION_CODE_GRANT:"authorization_code",CLIENT_CREDENTIALS_GRANT:"client_credentials",RESOURCE_OWNER_PASSWORD_GRANT:"password",REFRESH_TOKEN_GRANT:"refresh_token",DEVICE_CODE_GRANT:"device_code",JWT_BEARER:"urn:ietf:params:oauth:grant-type:jwt-bearer"},a4t="MSSTS",c4t="ADFS",j1o="MSA",Uje="Generic",tY="-",ice=".",t0={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},H1o={ADFS:1001,MSA:1002,MSSTS:1003,GENERIC:1004,ACCESS_TOKEN:2001,REFRESH_TOKEN:2002,ID_TOKEN:2003,APP_METADATA:3001,UNDEFINED:9999},oce="appmetadata",l4t="client_info",rY="1",sce="authority-metadata",u4t=3600*24,Zy={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},Qje=5,G1o=80,d4t=330,f4t=50,ASe="server-telemetry",qje="|",j7=",",p4t="1",h4t="0",m4t="unknown_error",hf={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},g4t=60,A4t=3600,ySe="throttling",y4t="retry-after, h429",E4t="invalid_grant",_4t="client_mismatch",jje={username:"username",password:"password"},H7={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},ESe={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},pP={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},$1o={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},V1o=864e5,v4t=300,W1o={BASE64:"base64",HEX:"hex",UTF8:"utf-8"};var nY={};ki(nY,{ACCESS_TOKEN:()=>K1o,BROKER_CLIENT_ID:()=>_Se,BROKER_REDIRECT_URI:()=>Wje,CCS_HEADER:()=>iSo,CLAIMS:()=>T4t,CLIENT_ASSERTION:()=>Y4t,CLIENT_ASSERTION_TYPE:()=>K4t,CLIENT_ID:()=>FM,CLIENT_INFO:()=>tSo,CLIENT_REQUEST_ID:()=>O4t,CLIENT_SECRET:()=>z4t,CLI_DATA:()=>aLt,CODE:()=>P4t,CODE_CHALLENGE:()=>D4t,CODE_CHALLENGE_METHOD:()=>N4t,CODE_VERIFIER:()=>M4t,DEVICE_CODE:()=>W4t,DOMAIN_HINT:()=>nLt,EAR_JWE_CRYPTO:()=>oLt,EAR_JWK:()=>iLt,ERROR:()=>z1o,ERROR_DESCRIPTION:()=>Y1o,EXPIRES_IN:()=>Z1o,FOCI:()=>nSo,GRANT_TYPE:()=>S4t,ID_TOKEN:()=>J1o,ID_TOKEN_HINT:()=>V4t,INSTANCE_AWARE:()=>ace,LOGIN_HINT:()=>rLt,LOGOUT_HINT:()=>eLt,NATIVE_BROKER:()=>X4t,NONCE:()=>R4t,OBO_ASSERTION:()=>J4t,ON_BEHALF_OF:()=>rSo,POST_LOGOUT_URI:()=>$4t,PROMPT:()=>k4t,REDIRECT_URI:()=>Hje,REFRESH_TOKEN:()=>x4t,REFRESH_TOKEN_EXPIRES_IN:()=>X1o,REQUESTED_TOKEN_USE:()=>Z4t,REQ_CNF:()=>$je,RESOURCE:()=>sLt,RESPONSE_MODE:()=>b4t,RESPONSE_TYPE:()=>C4t,RETURN_SPA_CODE:()=>Vje,SCOPE:()=>I4t,SESSION_STATE:()=>eSo,SID:()=>tLt,STATE:()=>w4t,TOKEN_TYPE:()=>Gje,X_APP_NAME:()=>H4t,X_APP_VER:()=>G4t,X_CLIENT_CPU:()=>U4t,X_CLIENT_CURR_TELEM:()=>Q4t,X_CLIENT_EXTRA_SKU:()=>oSo,X_CLIENT_LAST_TELEM:()=>q4t,X_CLIENT_OS:()=>F4t,X_CLIENT_SKU:()=>L4t,X_CLIENT_VER:()=>B4t,X_MS_LIB_CAPABILITY:()=>j4t});p();var FM="client_id",Hje="redirect_uri",C4t="response_type",b4t="response_mode",S4t="grant_type",T4t="claims",I4t="scope",z1o="error",Y1o="error_description",K1o="access_token",J1o="id_token",x4t="refresh_token",Z1o="expires_in",X1o="refresh_token_expires_in",w4t="state",R4t="nonce",k4t="prompt",eSo="session_state",tSo="client_info",P4t="code",D4t="code_challenge",N4t="code_challenge_method",M4t="code_verifier",O4t="client-request-id",L4t="x-client-SKU",B4t="x-client-VER",F4t="x-client-OS",U4t="x-client-CPU",Q4t="x-client-current-telemetry",q4t="x-client-last-telemetry",j4t="x-ms-lib-capability",H4t="x-app-name",G4t="x-app-ver",$4t="post_logout_redirect_uri",V4t="id_token_hint",W4t="device_code",z4t="client_secret",Y4t="client_assertion",K4t="client_assertion_type",Gje="token_type",$je="req_cnf",J4t="assertion",Z4t="requested_token_use",rSo="on_behalf_of",nSo="foci",iSo="X-AnchorMailbox",Vje="return_spa_code",X4t="nativebroker",eLt="logout_hint",tLt="sid",rLt="login_hint",nLt="domain_hint",oSo="x-client-xtra-sku",_Se="brk_client_id",Wje="brk_redirect_uri",ace="instance_aware",iLt="ear_jwk",oLt="ear_jwe_crypto",sLt="resource",aLt="clidata";p();p();p();function zje(t){return`See https://aka.ms/msal.js.errors#${t} for details`}a(zje,"getDefaultErrorMessage");var Fo=class t extends Error{static{a(this,"AuthError")}constructor(e,r,n){let o=r||(e?zje(e):""),s=o?`${e}: ${o}`:e;super(s),Object.setPrototypeOf(this,t.prototype),this.errorCode=e||"",this.errorMessage=o||"",this.subError=n||"",this.name="AuthError"}setCorrelationId(e){this.correlationId=e}};function iY(t,e){return new Fo(t,e||zje(t))}a(iY,"createAuthError");var cce=class t extends Fo{static{a(this,"ClientConfigurationError")}constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,t.prototype)}};function vl(t){return new cce(t)}a(vl,"createClientConfigurationError");p();var fu=class{static{a(this,"StringUtils")}static isEmptyObj(e){if(e)try{let r=JSON.parse(e);return Object.keys(r).length===0}catch{}return!0}static startsWith(e,r){return e.indexOf(r)===0}static endsWith(e,r){return e.length>=r.length&&e.lastIndexOf(r)===e.length-r.length}static queryStringToObject(e){let r={},n=e.split("&"),o=a(s=>decodeURIComponent(s.replace(/\+/g," ")),"decode");return n.forEach(s=>{if(s.trim()){let[c,l]=s.split(/=(.+)/g,2);c&&l&&(r[o(c)]=o(l))}}),r}static trimArrayEntries(e){return e.map(r=>r.trim())}static removeEmptyStringsFromArray(e){return e.filter(r=>!!r)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}};p();var G7=class t extends Fo{static{a(this,"ClientAuthError")}constructor(e,r){super(e,r),this.name="ClientAuthError",Object.setPrototypeOf(this,t.prototype)}};function kt(t,e){return new G7(t,e)}a(kt,"createClientAuthError");var uce={};ki(uce,{authorityMismatch:()=>pSo,authorityUriInsecure:()=>lLt,cannotAllowPlatformBroker:()=>fSo,cannotSetOIDCOptions:()=>dSo,claimsRequestParsingError:()=>sSo,emptyInputScopesError:()=>dLt,invalidAuthenticationHeader:()=>uSo,invalidAuthorityMetadata:()=>mLt,invalidClaims:()=>Yje,invalidCloudDiscoveryMetadata:()=>Kje,invalidCodeChallengeMethod:()=>aSo,invalidRequestMethodForEAR:()=>hSo,logoutRequestEmpty:()=>pLt,missingNonceAuthenticationHeader:()=>lSo,missingSshJwk:()=>vSe,missingSshKid:()=>cSo,pkceParamsMissing:()=>hLt,redirectUriEmpty:()=>cLt,tokenRequestEmpty:()=>fLt,untrustedAuthority:()=>gLt,urlEmptyError:()=>uLt,urlParseError:()=>lce});p();var cLt="redirect_uri_empty",sSo="claims_request_parsing_error",lLt="authority_uri_insecure",lce="url_parse_error",uLt="empty_url_error",dLt="empty_input_scopes_error",Yje="invalid_claims",fLt="token_request_empty",pLt="logout_request_empty",aSo="invalid_code_challenge_method",hLt="pkce_params_missing",Kje="invalid_cloud_discovery_metadata",mLt="invalid_authority_metadata",gLt="untrusted_authority",vSe="missing_ssh_jwk",cSo="missing_ssh_kid",lSo="missing_nonce_authentication_header",uSo="invalid_authentication_header",dSo="cannot_set_OIDCOptions",fSo="cannot_allow_platform_broker",pSo="authority_mismatch",hSo="invalid_request_method_for_EAR";var $p={};ki($p,{authTimeNotFound:()=>CSe,authorizationCodeMissingFromServerResponse:()=>DLt,bindingKeyNotRemoved:()=>ySo,cannotAppendScopeSet:()=>wLt,cannotRemoveEmptyScope:()=>xLt,clientInfoDecodingError:()=>Jje,clientInfoEmptyError:()=>ALt,emptyInputScopeSet:()=>eHe,endSessionEndpointNotSupported:()=>NLt,endpointResolutionError:()=>hP,hashNotDeserialized:()=>vLt,invalidCacheEnvironment:()=>SSe,invalidCacheRecord:()=>RLt,invalidState:()=>oY,keyIdMissing:()=>MLt,maxAgeTranspired:()=>SLt,methodNotImplemented:()=>Ts,misplacedResourceParam:()=>LLt,multipleMatchingAppMetadata:()=>TLt,multipleMatchingTokens:()=>mSo,nestedAppAuthBridgeDisabled:()=>vSo,networkError:()=>ELt,noAccountFound:()=>gSo,noAccountInSilentRequest:()=>bSe,noCryptoObject:()=>kLt,noNetworkConnectivity:()=>ESo,nonceMismatch:()=>bLt,nullOrEmptyToken:()=>yLt,openIdConfigError:()=>_Lt,platformBrokerError:()=>CSo,requestCannotBeMade:()=>ILt,resourceParameterRequired:()=>OLt,stateMismatch:()=>CLt,stateNotFound:()=>Xje,tokenClaimsCnfRequiredForSignedJwt:()=>PLt,tokenParsingError:()=>Zje,tokenRefreshRequired:()=>dce,unexpectedCredentialType:()=>ASo,userCanceled:()=>_So});p();var Jje="client_info_decoding_error",ALt="client_info_empty_error",Zje="token_parsing_error",yLt="null_or_empty_token",hP="endpoints_resolution_error",ELt="network_error",_Lt="openid_config_error",vLt="hash_not_deserialized",oY="invalid_state",CLt="state_mismatch",Xje="state_not_found",bLt="nonce_mismatch",CSe="auth_time_not_found",SLt="max_age_transpired",mSo="multiple_matching_tokens",TLt="multiple_matching_appMetadata",ILt="request_cannot_be_made",xLt="cannot_remove_empty_scope",wLt="cannot_append_scopeset",eHe="empty_input_scopeset",bSe="no_account_in_silent_request",RLt="invalid_cache_record",SSe="invalid_cache_environment",gSo="no_account_found",kLt="no_crypto_object",ASo="unexpected_credential_type",dce="token_refresh_required",PLt="token_claims_cnf_required_for_signedjwt",DLt="authorization_code_missing_from_server_response",ySo="binding_key_not_removed",NLt="end_session_endpoint_not_supported",MLt="key_id_missing",ESo="no_network_connectivity",_So="user_canceled",Ts="method_not_implemented",vSo="nested_app_auth_bridge_disabled",CSo="platform_broker_error",OLt="resource_parameter_required",LLt="misplaced_resource_parameter";var Uh=class t{static{a(this,"ScopeSet")}constructor(e){let r=e?fu.trimArrayEntries([...e]):[],n=r?fu.removeEmptyStringsFromArray(r):[];if(!n||!n.length)throw vl(dLt);this.scopes=new Set,n.forEach(o=>this.scopes.add(o))}static fromString(e){let n=(e||"").split(" ");return new t(n)}static createSearchScopes(e){let r=e&&e.length>0?e:[...rce],n=new t(r);return n.containsOnlyOIDCScopes()?n.removeScope(Mje):n.removeOIDCScopes(),n}containsScope(e){let r=this.printScopesLowerCase().split(" "),n=new t(r);return e?n.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(r=>this.containsScope(r))}containsOnlyOIDCScopes(){let e=0;return Fje.forEach(r=>{this.containsScope(r)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(r=>this.appendScope(r))}catch{throw kt(wLt)}}removeScope(e){if(!e)throw kt(xLt);this.scopes.delete(e.trim())}removeOIDCScopes(){Fje.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw kt(eHe);let r=new Set;return e.scopes.forEach(n=>r.add(n.toLowerCase())),this.scopes.forEach(n=>r.add(n.toLowerCase())),r}intersectingScopeSets(e){if(!e)throw kt(eHe);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();let r=this.unionScopeSets(e),n=e.getScopeCount(),o=this.getScopeCount();return r.sizee.push(r)),e}printScopes(){return this.scopes?this.asArray().join(" "):""}printScopesLowerCase(){return this.printScopes().toLowerCase()}};function sY(t,e,r){if(!e)return;let n=t.get(FM);n&&t.has(_Se)&&r?.addFields({embeddedClientId:n,embeddedRedirectUri:t.get(Hje)},e)}a(sY,"instrumentBrokerParams");function bSo(t,e){t.set(C4t,e)}a(bSo,"addResponseType");function BLt(t,e){t.set(b4t,e||s4t.QUERY)}a(BLt,"addResponseMode");function SSo(t){t.set(X4t,"1")}a(SSo,"addNativeBroker");function aY(t,e,r=!0,n=rce){r&&!n.includes("openid")&&!e.includes("openid")&&n.push("openid");let o=r?[...e||[],...n]:e||[],s=new Uh(o);t.set(I4t,s.printScopes())}a(aY,"addScopes");function cY(t,e){t.set(FM,e)}a(cY,"addClientId");function lY(t,e){t.set(Hje,e)}a(lY,"addRedirectUri");function FLt(t,e){t.set($4t,e)}a(FLt,"addPostLogoutRedirectUri");function ULt(t,e){t.set(V4t,e)}a(ULt,"addIdTokenHint");function QLt(t,e){t.set(nLt,e)}a(QLt,"addDomainHint");function fce(t,e){t.set(rLt,e)}a(fce,"addLoginHint");function $7(t,e){t.set(Gp.CCS_HEADER,`UPN:${e}`)}a($7,"addCcsUpn");function s3(t,e){t.set(Gp.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}a(s3,"addCcsOid");function tHe(t,e){t.set("sid",e)}a(tHe,"addSid");function uY(t,e,r){let n=prn(e,r);try{JSON.parse(n)}catch{throw vl(Yje)}t.set(T4t,n)}a(uY,"addClaims");function dY(t,e){t.set(O4t,e)}a(dY,"addCorrelationId");function TSe(t,e){t.set(L4t,e.sku),t.set(B4t,e.version),e.os&&t.set(F4t,e.os),e.cpu&&t.set(U4t,e.cpu)}a(TSe,"addLibraryInfo");function ISe(t,e){e?.appName&&t.set(H4t,e.appName),e?.appVersion&&t.set(G4t,e.appVersion)}a(ISe,"addApplicationTelemetry");function qLt(t,e){t.set(k4t,e)}a(qLt,"addPrompt");function xSe(t,e){e&&t.set(w4t,e)}a(xSe,"addState");function jLt(t,e){t.set(R4t,e)}a(jLt,"addNonce");function TSo(t,e,r){if(e&&r)t.set(D4t,e),t.set(N4t,r);else throw vl(hLt)}a(TSo,"addCodeChallengeParams");function HLt(t,e){t.set(P4t,e)}a(HLt,"addAuthorizationCode");function ISo(t,e){t.set(W4t,e)}a(ISo,"addDeviceCode");function GLt(t,e){t.set(x4t,e)}a(GLt,"addRefreshToken");function $Lt(t,e){t.set(M4t,e)}a($Lt,"addCodeVerifier");function wSe(t,e){t.set(z4t,e)}a(wSe,"addClientSecret");function RSe(t,e){e&&t.set(Y4t,e)}a(RSe,"addClientAssertion");function kSe(t,e){e&&t.set(K4t,e)}a(kSe,"addClientAssertionType");function xSo(t,e){t.set(J4t,e)}a(xSo,"addOboAssertion");function wSo(t,e){t.set(Z4t,e)}a(wSo,"addRequestTokenUse");function PSe(t,e){t.set(S4t,e)}a(PSe,"addGrantType");function fY(t){t.set(l4t,"1")}a(fY,"addClientInfo");function VLt(t){t.set(aLt,"1")}a(VLt,"addCliData");function DSe(t){t.has(ace)||t.set(ace,"true")}a(DSe,"addInstanceAware");function a3(t,e){Object.entries(e).forEach(([r,n])=>{!t.has(r)&&n&&t.set(r,n)})}a(a3,"addExtraParameters");function prn(t,e){let r;if(!t)r={};else try{r=JSON.parse(t)}catch{throw vl(Yje)}return e&&e.length>0&&(r.hasOwnProperty(nce.ACCESS_TOKEN)||(r[nce.ACCESS_TOKEN]={}),r[nce.ACCESS_TOKEN][nce.XMS_CC]={values:e}),JSON.stringify(r)}a(prn,"addClientCapabilitiesToClaims");function RSo(t,e){t.set(jje.username,e)}a(RSo,"addUsername");function kSo(t,e){t.set(jje.password,e)}a(kSo,"addPassword");function NSe(t,e){e&&(t.set(Gje,hf.POP),t.set($je,e))}a(NSe,"addPopToken");function MSe(t,e){e&&(t.set(Gje,hf.SSH),t.set($je,e))}a(MSe,"addSshJwk");function OSe(t,e){t.set(Q4t,e.generateCurrentRequestHeaderValue()),t.set(q4t,e.generateLastRequestHeaderValue())}a(OSe,"addServerTelemetry");function LSe(t){t.set(j4t,y4t)}a(LSe,"addThrottling");function WLt(t,e){t.set(eLt,e)}a(WLt,"addLogoutHint");function c3(t,e,r){t.has(_Se)||t.set(_Se,e),t.has(Wje)||t.set(Wje,r)}a(c3,"addBrokerParameters");function PSo(t,e){t.set(iLt,encodeURIComponent(e)),t.set(oLt,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}a(PSo,"addEARParameters");function BSe(t,e){e&&t.set(sLt,e)}a(BSe,"addResource");var CA={};ki(CA,{getDeserializedResponse:()=>DSo,mapToQueryString:()=>UM,normalizeUrlForComparison:()=>NSo,stripLeadingHashOrQuery:()=>mrn});p();function hrn(t){if(!t)return t;let e=t.toLowerCase();return fu.endsWith(e,"?")?e=e.slice(0,-1):fu.endsWith(e,"?/")&&(e=e.slice(0,-2)),fu.endsWith(e,"/")||(e+="/"),e}a(hrn,"canonicalizeUrl");function mrn(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}a(mrn,"stripLeadingHashOrQuery");function DSo(t){if(!t||t.indexOf("=")<0)return null;try{let e=mrn(t),r=Object.fromEntries(new URLSearchParams(e));if(r.code||r.ear_jwe||r.error||r.error_description||r.state)return r}catch{throw kt(vLt)}return null}a(DSo,"getDeserializedResponse");function UM(t){let e=new Array;return t.forEach((r,n)=>{e.push(`${n}=${encodeURIComponent(r)}`)}),e.join("&")}a(UM,"mapToQueryString");function NSo(t){if(!t)return t;let e=t.split("#")[0];try{let r=new URL(e),n=r.origin+r.pathname+r.search;return hrn(n)}catch{return hrn(e)}}a(NSo,"normalizeUrlForComparison");p();p();var pce={createNewGuid:a(()=>{throw kt(Ts)},"createNewGuid"),base64Decode:a(()=>{throw kt(Ts)},"base64Decode"),base64Encode:a(()=>{throw kt(Ts)},"base64Encode"),base64UrlEncode:a(()=>{throw kt(Ts)},"base64UrlEncode"),encodeKid:a(()=>{throw kt(Ts)},"encodeKid"),async getPublicKeyThumbprint(){throw kt(Ts)},async removeTokenBindingKey(){throw kt(Ts)},async clearKeystore(){throw kt(Ts)},async signJwt(){throw kt(Ts)},async hashString(){throw kt(Ts)}};p();var mf;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(mf||(mf={}));var MSo=50,OSo=500,pY=new Map;function LSo(t,e){pY.delete(t),pY.set(t,e)}a(LSo,"markAsRecentlyUsed");function BSo(t,e){let r=Date.now(),n=pY.get(t);if(n)LSo(t,n);else if(n={logs:[],firstEventTime:r},pY.set(t,n),pY.size>MSo){let o=pY.keys().next().value;o&&pY.delete(o)}n.logs.push({...e,milliseconds:r-n.firstEventTime}),n.logs.length>OSo&&n.logs.shift()}a(BSo,"addLogToCache");function FSo(t){if(t.length!==6)return!1;for(let e=0;e="a"&&r<="z"||r>="A"&&r<="Z"||r>="0"&&r<="9"))return!1}return!0}a(FSo,"isHashedString");var r0=class t{static{a(this,"Logger")}constructor(e,r,n){this.level=mf.Info;let o=a(()=>{},"defaultLoggerCallback"),s=e||t.createDefaultLoggerOptions();this.localCallback=s.loggerCallback||o,this.piiLoggingEnabled=s.piiLoggingEnabled||!1,this.level=typeof s.logLevel=="number"?s.logLevel:mf.Info,this.packageName=r||"",this.packageVersion=n||""}static createDefaultLoggerOptions(){return{loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:mf.Info}}clone(e,r){return new t({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level},e,r)}logMessage(e,r){let n=r.correlationId;if(FSo(e)){let u={hash:e,level:r.logLevel,containsPii:r.containsPii||!1,milliseconds:0};BSo(n,u)}if(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)return;let l=`${`[${new Date().toUTCString()}] : [${n}]`} : ${this.packageName}@${this.packageVersion} : ${mf[r.logLevel]} - ${e}`;this.executeCallback(r.logLevel,l,r.containsPii||!1)}executeCallback(e,r,n){this.localCallback&&this.localCallback(e,r,n)}error(e,r){this.logMessage(e,{logLevel:mf.Error,containsPii:!1,correlationId:r})}errorPii(e,r){this.logMessage(e,{logLevel:mf.Error,containsPii:!0,correlationId:r})}warning(e,r){this.logMessage(e,{logLevel:mf.Warning,containsPii:!1,correlationId:r})}warningPii(e,r){this.logMessage(e,{logLevel:mf.Warning,containsPii:!0,correlationId:r})}info(e,r){this.logMessage(e,{logLevel:mf.Info,containsPii:!1,correlationId:r})}infoPii(e,r){this.logMessage(e,{logLevel:mf.Info,containsPii:!0,correlationId:r})}verbose(e,r){this.logMessage(e,{logLevel:mf.Verbose,containsPii:!1,correlationId:r})}verbosePii(e,r){this.logMessage(e,{logLevel:mf.Verbose,containsPii:!0,correlationId:r})}trace(e,r){this.logMessage(e,{logLevel:mf.Trace,containsPii:!1,correlationId:r})}tracePii(e,r){this.logMessage(e,{logLevel:mf.Trace,containsPii:!0,correlationId:r})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}};p();var V7="@azure/msal-common",QM="16.4.1";p();var l3={None:"none",AzurePublic:"https://login.microsoftonline.com",AzurePpe:"https://login.windows-ppe.net",AzureChina:"https://login.chinacloudapi.cn",AzureGermany:"https://login.microsoftonline.de",AzureUsGovernment:"https://login.microsoftonline.us"};p();p();function grn(t,e){return!!t&&!!e&&t===e.split(".")[1]}a(grn,"tenantIdMatchesHomeTenant");function hY(t,e,r,n){if(n){let{oid:o,sub:s,tid:c,name:l,tfp:u,acr:d,preferred_username:f,upn:h,login_hint:m}=n,g=c||u||d||"";return{tenantId:g,localAccountId:o||s||"",name:l,username:f||h||"",loginHint:m,isHomeTenant:grn(g,t)}}else return{tenantId:r,localAccountId:e,username:"",isHomeTenant:grn(r,t)}}a(hY,"buildTenantProfile");function rHe(t,e,r,n){let o=t;if(e){let{isHomeTenant:s,...c}=e;o={...t,...c}}if(r){let{isHomeTenant:s,...c}=hY(t.homeAccountId,t.localAccountId,t.tenantId,r);return o={...o,...c,idTokenClaims:r,idToken:n},o}return o}a(rHe,"updateAccountTenantProfileData");var nHe={};ki(nHe,{checkMaxAge:()=>FSe,extractTokenClaims:()=>u3,getJWSPayload:()=>Arn,isKmsi:()=>zLt});p();function u3(t,e){let r=Arn(t);try{let n=e(r);return JSON.parse(n)}catch{throw kt(Zje)}}a(u3,"extractTokenClaims");function zLt(t){if(!t.signin_state)return!1;let e=["kmsi","dvc_dmjd"];return t.signin_state.some(r=>e.includes(r.trim().toLowerCase()))}a(zLt,"isKmsi");function Arn(t){if(!t)throw kt(yLt);let r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw kt(Zje);return r[2]}a(Arn,"getJWSPayload");function FSe(t,e){if(e===0||Date.now()-3e5>t+e)throw kt(SLt)}a(FSe,"checkMaxAge");p();p();var Is=class t{static{a(this,"UrlString")}get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw vl(uLt);e.includes("#")||(this._urlString=t.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let r=e.toLowerCase();return fu.endsWith(r,"?")?r=r.slice(0,-1):fu.endsWith(r,"?/")&&(r=r.slice(0,-2)),fu.endsWith(r,"/")||(r+="/"),r}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw vl(lce)}if(!e.HostNameAndPort||!e.PathSegments)throw vl(lce);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw vl(lLt)}static appendQueryString(e,r){return r?e.indexOf("?")<0?`${e}?${r}`:`${e}&${r}`:e}static removeHashFromUrl(e){return t.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){let r=this.getUrlComponents(),n=r.PathSegments;return e&&n.length!==0&&(n[0]===fP.COMMON||n[0]===fP.ORGANIZATIONS)&&(n[0]=e),t.constructAuthorityUriFromObject(r)}getUrlComponents(){let e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=this.urlString.match(e);if(!r)throw vl(lce);let n={Protocol:r[1],HostNameAndPort:r[4],AbsolutePath:r[5],QueryString:r[7]},o=n.AbsolutePath.split("/");return o=o.filter(s=>s&&s.length>0),n.PathSegments=o,n.QueryString&&n.QueryString.endsWith("/")&&(n.QueryString=n.QueryString.substring(0,n.QueryString.length-1)),n}static getDomainFromUrl(e){let r=RegExp("^([^:/?#]+://)?([^/?#]*)"),n=e.match(r);if(!n)throw vl(lce);return n[2]}static getAbsoluteUrl(e,r){if(e[0]===tce){let o=new t(r).getUrlComponents();return o.Protocol+"//"+o.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new t(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}};var USo=[{host:"login.microsoftonline.com"},{host:"login.chinacloudapi.cn",issuerHost:"login.partner.microsoftonline.cn"},{host:"login.microsoftonline.us"},{host:"login.sovcloud-identity.fr"},{host:"login.sovcloud-identity.de"},{host:"login.sovcloud-identity.sg"}];function QSo(t,e){return{token_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/token`,jwks_uri:`https://${t}/{tenantid}/discovery/v2.0/keys`,issuer:`https://${e}/{tenantid}/v2.0`,authorization_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/authorize`,end_session_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/logout`}}a(QSo,"buildOpenIdConfig");var qSo=USo.reduce((t,{host:e,issuerHost:r})=>(t[e]=QSo(e,r||e),t),{}),Ern={endpointMetadata:qSo,instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]},{preferred_network:"login.sovcloud-identity.fr",preferred_cache:"login.sovcloud-identity.fr",aliases:["login.sovcloud-identity.fr"]},{preferred_network:"login.sovcloud-identity.de",preferred_cache:"login.sovcloud-identity.de",aliases:["login.sovcloud-identity.de"]},{preferred_network:"login.sovcloud-identity.sg",preferred_cache:"login.sovcloud-identity.sg",aliases:["login.sovcloud-identity.sg"]}]}},YLt=Ern.endpointMetadata,KLt=Ern.instanceDiscoveryMetadata,JLt=new Set;KLt.metadata.forEach(t=>{t.aliases.forEach(e=>{JLt.add(e)})});function _rn(t,e,r){let n,o=t.canonicalAuthority;if(o){let s=new Is(o).getUrlComponents().HostNameAndPort;n=yrn(e,r,s,t.cloudDiscoveryMetadata?.metadata,Zy.CONFIG)||yrn(e,r,s,KLt.metadata,Zy.HARDCODED_VALUES)||t.knownAuthorities}return n||[]}a(_rn,"getAliasesFromStaticSources");function yrn(t,e,r,n,o){if(t.trace(`getAliasesFromMetadata called with source: '${o}'`,e),r&&n){let s=USe(n,r);if(s)return t.trace(`getAliasesFromMetadata: found cloud discovery metadata in '${o}', returning aliases`,e),s.aliases;t.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in '${o}'`,e)}return null}a(yrn,"getAliasesFromMetadata");function vrn(t){return USe(KLt.metadata,t)}a(vrn,"getCloudDiscoveryMetadataFromHardcodedValues");function USe(t,e){for(let r=0;rZLt,createAccountEntityFromAccountInfo:()=>GSo,generateAccountId:()=>jSo,generateHomeAccountId:()=>XLt,getAccountInfo:()=>mce,isAccountEntity:()=>$So,isSingleTenant:()=>HSo});p();p();function hce(t,e){if(!t)throw kt(ALt);try{let r=e(t);return JSON.parse(r)}catch{throw kt(Jje)}}a(hce,"buildClientInfo");function qM(t){if(!t)throw kt(Jje);let e=t.split(ice,2);return{uid:e[0],utid:e.length<2?"":e[1]}}a(qM,"buildClientInfoFromHomeAccountId");p();var Sx={Default:0,Adfs:1,Dsts:2,Ciam:3};p();function iHe(t){return t&&(t.tid||t.tfp||t.acr)||null}a(iHe,"getTenantIdFromIdTokenClaims");p();var Xy={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};function jSo(t){return[t.homeAccountId,t.environment].join(tY).toLowerCase()}a(jSo,"generateAccountId");function mce(t){let e=t.tenantProfiles||[];return e.length===0&&t.realm&&t.localAccountId&&e.push(hY(t.homeAccountId,t.localAccountId,t.realm)),{homeAccountId:t.homeAccountId,environment:t.environment,tenantId:t.realm,username:t.username,localAccountId:t.localAccountId,loginHint:t.loginHint,name:t.name,nativeAccountId:t.nativeAccountId,authorityType:t.authorityType,tenantProfiles:new Map(e.map(r=>[r.tenantId,r])),dataBoundary:t.dataBoundary}}a(mce,"getAccountInfo");function HSo(t){return!t.tenantProfiles}a(HSo,"isSingleTenant");function ZLt(t,e,r){let n;e.authorityType===Sx.Adfs?n=c4t:e.protocolMode===Xy.OIDC?n=Uje:n=a4t;let o,s;t.clientInfo&&r&&(o=hce(t.clientInfo,r),o.xms_tdbr&&(s=o.xms_tdbr==="EU"?"EU":"None"));let c=t.environment||e&&e.getPreferredCache();if(!c)throw kt(SSe);let l=t.idTokenClaims?.preferred_username||t.idTokenClaims?.upn,u=t.idTokenClaims?.emails?t.idTokenClaims.emails[0]:null,d=l||u||"",f=t.idTokenClaims?.login_hint,h=o?.utid||iHe(t.idTokenClaims)||"",m=o?.uid||t.idTokenClaims?.oid||t.idTokenClaims?.sub||"",g;return t.tenantProfiles?g=t.tenantProfiles:g=[hY(t.homeAccountId,m,h,t.idTokenClaims)],{homeAccountId:t.homeAccountId,environment:c,realm:h,localAccountId:m,username:d,authorityType:n,loginHint:f,clientInfo:t.clientInfo,name:t.idTokenClaims?.name||"",lastModificationTime:void 0,lastModificationApp:void 0,cloudGraphHostName:t.cloudGraphHostName,msGraphHost:t.msGraphHost,nativeAccountId:t.nativeAccountId,tenantProfiles:g,dataBoundary:s}}a(ZLt,"createAccountEntity");function GSo(t,e,r){let n=Array.from(t.tenantProfiles?.values()||[]);return n.length===0&&t.tenantId&&t.localAccountId&&n.push(hY(t.homeAccountId,t.localAccountId,t.tenantId,t.idTokenClaims)),{authorityType:t.authorityType||Uje,homeAccountId:t.homeAccountId,localAccountId:t.localAccountId,nativeAccountId:t.nativeAccountId,realm:t.tenantId,environment:t.environment,username:t.username,loginHint:t.loginHint,name:t.name,cloudGraphHostName:e,msGraphHost:r,tenantProfiles:n,dataBoundary:t.dataBoundary}}a(GSo,"createAccountEntityFromAccountInfo");function XLt(t,e,r,n,o,s){if(!(e===Sx.Adfs||e===Sx.Dsts)){if(t)try{let c=hce(t,n.base64Decode);if(c.uid&&c.utid)return`${c.uid}.${c.utid}`}catch{}r.warning("No client info in response",o)}return s?.sub||""}a(XLt,"generateHomeAccountId");function $So(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("localAccountId")&&t.hasOwnProperty("username")&&t.hasOwnProperty("authorityType"):!1}a($So,"isAccountEntity");var W7=class{static{a(this,"CacheManager")}constructor(e,r,n,o,s){this.clientId=e,this.cryptoImpl=r,this.commonLogger=n.clone(V7,QM),this.staticAuthorityOptions=s,this.performanceClient=o}getAllAccounts(e={},r){return this.buildTenantProfiles(this.getAccountsFilteredBy(e,r),r,e)}getAccountInfoFilteredBy(e,r){if(Object.keys(e).length===0||Object.values(e).every(o=>o==null||o===""))return this.commonLogger.warning("getAccountInfoFilteredBy: Account filter is empty or invalid, returning null",r),null;let n=this.getAllAccounts(e,r);return n.length>1?n.sort(s=>s.idTokenClaims?-1:1)[0]:n.length===1?n[0]:null}getBaseAccountInfo(e,r){let n=this.getAccountsFilteredBy(e,r);return n.length>0?mce(n[0]):null}buildTenantProfiles(e,r,n){return e.flatMap(o=>this.getTenantProfilesFromAccountEntity(o,r,n?.tenantId,n))}getTenantedAccountInfoByFilter(e,r,n,o,s){let c=null,l;if(s&&!this.tenantProfileMatchesFilter(n,s))return null;let u=this.getIdToken(e,o,r,n.tenantId);return u&&(l=u3(u.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(l,s))?null:(c=rHe(e,n,l,u?.secret),c)}getTenantProfilesFromAccountEntity(e,r,n,o){let s=mce(e),c=s.tenantProfiles||new Map,l=this.getTokenKeys();if(n){let d=c.get(n);if(d)c=new Map([[n,d]]);else return[]}let u=[];return c.forEach(d=>{let f=this.getTenantedAccountInfoByFilter(s,l,d,r,o);f&&u.push(f)}),u}tenantProfileMatchesFilter(e,r){return!(r.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,r.localAccountId)||r.name&&e.name!==r.name||r.isHomeTenant!==void 0&&e.isHomeTenant!==r.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,r){return!(r&&(r.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,r.localAccountId)||r.loginHint&&!this.matchLoginHintFromTokenClaims(e,r.loginHint)||r.username&&!this.matchUsername(e.preferred_username,r.username)||r.name&&!this.matchName(e,r.name)||r.sid&&!this.matchSid(e,r.sid)))}async saveCacheRecord(e,r,n,o,s){if(!e)throw kt(RLt);try{e.account&&await this.setAccount(e.account,r,n,o),e.idToken&&s?.idToken!==!1&&await this.setIdTokenCredential(e.idToken,r,n),e.accessToken&&s?.accessToken!==!1&&await this.saveAccessToken(e.accessToken,r,n),e.refreshToken&&s?.refreshToken!==!1&&await this.setRefreshTokenCredential(e.refreshToken,r,n),e.appMetadata&&this.setAppMetadata(e.appMetadata,r)}catch(c){throw this.commonLogger?.error("CacheManager.saveCacheRecord: failed",r),c instanceof Fo?c:Srn(c)}}async saveAccessToken(e,r,n){let o={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType},s=this.getTokenKeys(),c=Uh.fromString(e.target);s.accessToken.forEach(l=>{if(!this.accessTokenKeyMatchesFilter(l,o,!1))return;let u=this.getAccessTokenCredential(l,r);u&&this.credentialMatchesFilter(u,o,r)&&Uh.fromString(u.target).intersectingScopeSets(c)&&this.removeAccessToken(l,r)}),await this.setAccessTokenCredential(e,r,n)}getAccountsFilteredBy(e,r){let n=this.getAccountKeys(),o=[];return n.forEach(s=>{let c=this.getAccount(s,r);if(!c||e.homeAccountId&&!this.matchHomeAccountId(c,e.homeAccountId)||e.username&&!this.matchUsername(c.username,e.username)||e.environment&&!this.matchEnvironment(c,e.environment,r)||e.realm&&!this.matchRealm(c,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(c,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(c,e.authorityType))return;let l={localAccountId:e?.localAccountId,name:e?.name},u=c.tenantProfiles?.filter(d=>this.tenantProfileMatchesFilter(d,l));u&&u.length===0||o.push(c)}),o}credentialMatchesFilter(e,r,n){return!(r.clientId&&!this.matchClientId(e,r.clientId)||r.userAssertionHash&&!this.matchUserAssertionHash(e,r.userAssertionHash)||typeof r.homeAccountId=="string"&&!this.matchHomeAccountId(e,r.homeAccountId)||r.environment&&!this.matchEnvironment(e,r.environment,n)||r.realm&&!this.matchRealm(e,r.realm)||r.credentialType&&!this.matchCredentialType(e,r.credentialType)||r.familyId&&!this.matchFamilyId(e,r.familyId)||r.target&&!this.matchTarget(e,r.target)||e.credentialType===t0.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(r.tokenType&&!this.matchTokenType(e,r.tokenType)||r.tokenType===hf.SSH&&r.keyId&&!this.matchKeyId(e,r.keyId)))}getAppMetadataFilteredBy(e,r){let n=this.getKeys(),o={};return n.forEach(s=>{if(!this.isAppMetadata(s))return;let c=this.getAppMetadata(s,r);c&&(e.environment&&!this.matchEnvironment(c,e.environment,r)||e.clientId&&!this.matchClientId(c,e.clientId)||(o[s]=c))}),o}getAuthorityMetadataByAlias(e,r){let n=this.getAuthorityMetadataKeys(),o=null;return n.forEach(s=>{if(!this.isAuthorityMetadata(s)||s.indexOf(this.clientId)===-1)return;let c=this.getAuthorityMetadata(s,r);c&&c.aliases.indexOf(e)!==-1&&(o=c)}),o}removeAllAccounts(e){this.getAllAccounts({},e).forEach(n=>{this.removeAccount(n,e)})}removeAccount(e,r){this.removeAccountContext(e,r);let n=this.getAccountKeys(),o=a(s=>s.includes(e.homeAccountId)&&s.includes(e.environment),"keyFilter");n.filter(o).forEach(s=>{this.removeItem(s,r),this.performanceClient.incrementFields({accountsRemoved:1},r)})}removeAccountContext(e,r){let n=this.getTokenKeys(),o=a(s=>s.includes(e.homeAccountId)&&s.includes(e.environment),"keyFilter");n.idToken.filter(o).forEach(s=>{this.removeIdToken(s,r)}),n.accessToken.filter(o).forEach(s=>{this.removeAccessToken(s,r)}),n.refreshToken.filter(o).forEach(s=>{this.removeRefreshToken(s,r)})}removeAccessToken(e,r){let n=this.getAccessTokenCredential(e,r);if(n&&(this.removeItem(e,r),this.performanceClient.incrementFields({accessTokensRemoved:1},r),n.credentialType.toLowerCase()===t0.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&n.tokenType===hf.POP)){let s=n.keyId;s&&this.cryptoImpl.removeTokenBindingKey(s,r).catch(()=>{this.commonLogger.error(`Failed to remove token binding key '${s}'`,r),this.performanceClient?.incrementFields({removeTokenBindingKeyFailure:1},r)})}}removeAppMetadata(e){return this.getKeys().forEach(n=>{this.isAppMetadata(n)&&this.removeItem(n,e)}),!0}getIdToken(e,r,n,o){this.commonLogger.trace("CacheManager - getIdToken called",r);let s={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:t0.ID_TOKEN,clientId:this.clientId,realm:o},c=this.getIdTokensByFilter(s,r,n),l=c.size;if(l<1)return this.commonLogger.info("CacheManager:getIdToken - No token found",r),null;if(l>1){let u=c;if(!o){let d=new Map;c.forEach((h,m)=>{h.realm===e.tenantId&&d.set(m,h)});let f=d.size;if(f<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result",r),c.values().next().value;if(f===1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile",r),d.values().next().value;u=d}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them",r),u.forEach((d,f)=>{this.removeIdToken(f,r)}),this.performanceClient.addFields({multiMatchedID:c.size},r),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token",r),c.values().next().value}getIdTokensByFilter(e,r,n){let o=n&&n.idToken||this.getTokenKeys().idToken,s=new Map;return o.forEach(c=>{if(!this.idTokenKeyMatchesFilter(c,{clientId:this.clientId,...e}))return;let l=this.getIdTokenCredential(c,r);l&&this.credentialMatchesFilter(l,e,r)&&s.set(c,l)}),s}idTokenKeyMatchesFilter(e,r){let n=e.toLowerCase();return!(r.clientId&&n.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&n.indexOf(r.homeAccountId.toLowerCase())===-1)}removeIdToken(e,r){this.removeItem(e,r)}removeRefreshToken(e,r){this.removeItem(e,r)}getAccessToken(e,r,n,o){let s=r.correlationId;this.commonLogger.trace("CacheManager - getAccessToken called",s);let c=Uh.createSearchScopes(r.scopes),l=r.authenticationScheme||hf.BEARER,u=l&&l.toLowerCase()!==hf.BEARER.toLowerCase()?t0.ACCESS_TOKEN_WITH_AUTH_SCHEME:t0.ACCESS_TOKEN,d={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:u,clientId:this.clientId,realm:o||e.tenantId,target:c,tokenType:l,keyId:r.sshKid},f=n&&n.accessToken||this.getTokenKeys().accessToken,h=[];f.forEach(g=>{if(this.accessTokenKeyMatchesFilter(g,d,!0)){let A=this.getAccessTokenCredential(g,s);A&&this.credentialMatchesFilter(A,d,s)&&h.push(A)}});let m=h.length;return m<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found",s),null):m>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them",s),h.forEach(g=>{this.removeAccessToken(this.generateCredentialKey(g),s)}),this.performanceClient.addFields({multiMatchedAT:h.length},s),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token",s),h[0])}accessTokenKeyMatchesFilter(e,r,n){let o=e.toLowerCase();if(r.clientId&&o.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&o.indexOf(r.homeAccountId.toLowerCase())===-1||r.realm&&o.indexOf(r.realm.toLowerCase())===-1)return!1;if(r.target){let s=r.target.asArray();for(let c=0;c{if(!this.accessTokenKeyMatchesFilter(s,e,!0))return;let c=this.getAccessTokenCredential(s,r);c&&this.credentialMatchesFilter(c,e,r)&&o.push(c)}),o}getRefreshToken(e,r,n,o){this.commonLogger.trace("CacheManager - getRefreshToken called",n);let s=r?rY:void 0,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:t0.REFRESH_TOKEN,clientId:this.clientId,familyId:s},l=o&&o.refreshToken||this.getTokenKeys().refreshToken,u=[];l.forEach(f=>{if(this.refreshTokenKeyMatchesFilter(f,c)){let h=this.getRefreshTokenCredential(f,n);h&&this.credentialMatchesFilter(h,c,n)&&u.push(h)}});let d=u.length;return d<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found.",n),null):(d>1&&this.performanceClient.addFields({multiMatchedRT:d},n),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token",n),u[0])}refreshTokenKeyMatchesFilter(e,r){let n=e.toLowerCase();return!(r.familyId&&n.indexOf(r.familyId.toLowerCase())===-1||!r.familyId&&r.clientId&&n.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&n.indexOf(r.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e,r){let n={environment:e,clientId:this.clientId},o=this.getAppMetadataFilteredBy(n,r),s=Object.keys(o).map(l=>o[l]),c=s.length;if(c<1)return null;if(c>1)throw kt(TLt);return s[0]}isAppMetadataFOCI(e,r){let n=this.readAppMetadataFromCache(e,r);return!!(n&&n.familyId===rY)}matchHomeAccountId(e,r){return typeof e.homeAccountId=="string"&&r===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,r){let n=e.oid||e.sub;return r===n}matchLocalAccountIdFromTenantProfile(e,r){return e.localAccountId===r}matchName(e,r){return r.toLowerCase()===e.name?.toLowerCase()}matchUsername(e,r){return!!(e&&typeof e=="string"&&r?.toLowerCase()===e.toLowerCase())}matchUserAssertionHash(e,r){return!!(e.userAssertionHash&&r===e.userAssertionHash)}matchEnvironment(e,r,n){if(this.staticAuthorityOptions){let s=_rn(this.staticAuthorityOptions,this.commonLogger,n);if(s.includes(r)&&s.includes(e.environment))return!0}let o=this.getAuthorityMetadataByAlias(r,n);return!!(o&&o.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,r){return e.credentialType&&r.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,r){return!!(e.clientId&&r===e.clientId)}matchFamilyId(e,r){return!!(e.familyId&&r===e.familyId)}matchRealm(e,r){return e.realm?.toLowerCase()===r.toLowerCase()}matchNativeAccountId(e,r){return!!(e.nativeAccountId&&r===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,r){return e.login_hint===r||e.preferred_username===r||e.upn===r}matchSid(e,r){return e.sid===r}matchAuthorityType(e,r){return!!(e.authorityType&&r.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,r){return e.credentialType!==t0.ACCESS_TOKEN&&e.credentialType!==t0.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:Uh.fromString(e.target).containsScopeSet(r)}matchTokenType(e,r){return!!(e.tokenType&&e.tokenType===r)}matchKeyId(e,r){return!!(e.keyId&&e.keyId===r)}isAppMetadata(e){return e.indexOf(oce)!==-1}isAuthorityMetadata(e){return e.indexOf(sce)!==-1}generateAuthorityMetadataCacheKey(e){return`${sce}-${this.clientId}-${e}`}static toObject(e,r){for(let n in r)e[n]=r[n];return e}},qSe=class extends W7{static{a(this,"DefaultStorageClass")}async setAccount(){throw kt(Ts)}getAccount(){throw kt(Ts)}async setIdTokenCredential(){throw kt(Ts)}getIdTokenCredential(){throw kt(Ts)}async setAccessTokenCredential(){throw kt(Ts)}getAccessTokenCredential(){throw kt(Ts)}async setRefreshTokenCredential(){throw kt(Ts)}getRefreshTokenCredential(){throw kt(Ts)}setAppMetadata(){throw kt(Ts)}getAppMetadata(){throw kt(Ts)}setServerTelemetry(){throw kt(Ts)}getServerTelemetry(){throw kt(Ts)}setAuthorityMetadata(){throw kt(Ts)}getAuthorityMetadata(){throw kt(Ts)}getAuthorityMetadataKeys(){throw kt(Ts)}setThrottlingCache(){throw kt(Ts)}getThrottlingCache(){throw kt(Ts)}removeItem(){throw kt(Ts)}getKeys(){throw kt(Ts)}getAccountKeys(){throw kt(Ts)}getTokenKeys(){throw kt(Ts)}generateCredentialKey(){throw kt(Ts)}generateAccountKey(){throw kt(Ts)}};p();p();var Trn={NotStarted:0,InProgress:1,Completed:2};var Qh=class{static{a(this,"StubPerformanceClient")}generateId(){return"callback-id"}startMeasurement(e,r){return{end:a(()=>null,"end"),discard:a(()=>{},"discard"),add:a(()=>{},"add"),increment:a(()=>{},"increment"),event:{eventId:this.generateId(),status:Trn.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:r||""}}}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}};var Irn={tokenRenewalOffsetSeconds:v4t,preventCorsPreflight:!1},VSo={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:mf.Info,correlationId:""},WSo={async sendGetRequestAsync(){throw kt(Ts)},async sendPostRequestAsync(){throw kt(Ts)}},zSo={sku:H5t,version:QM,cpu:"",os:""},YSo={clientSecret:"",clientAssertion:void 0},KSo={azureCloudInstance:l3.None,tenant:`${pSe}`},JSo={application:{appName:"",appVersion:""}};function d3({authOptions:t,systemOptions:e,loggerOptions:r,storageInterface:n,networkInterface:o,cryptoInterface:s,clientCredentials:c,libraryInfo:l,telemetry:u,serverTelemetryManager:d,persistencePlugin:f,serializableCache:h}){let m={...VSo,...r};return{authOptions:ZSo(t),systemOptions:{...Irn,...e},loggerOptions:m,storageInterface:n||new qSe(t.clientId,pce,new r0(m),new Qh),networkInterface:o||WSo,cryptoInterface:s||pce,clientCredentials:c||YSo,libraryInfo:{...zSo,...l},telemetry:{...JSo,...u},serverTelemetryManager:d||null,persistencePlugin:f||null,serializableCache:h||null}}a(d3,"buildClientConfiguration");function ZSo(t){return{clientCapabilities:[],azureCloudOptions:KSo,instanceAware:!1,isMcp:!1,...t}}a(ZSo,"buildAuthOptions");function oHe(t){return t.authOptions.authority.options.protocolMode===Xy.OIDC}a(oHe,"isOidcProtocolMode");p();p();var mS=class{static{a(this,"TokenCacheContext")}constructor(e,r){this.cache=e,this.hasChanged=r}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}};var R_={};ki(R_,{createAccessTokenEntity:()=>rBt,createIdTokenEntity:()=>tBt,createRefreshTokenEntity:()=>nBt,generateAppMetadataKey:()=>aTo,generateAuthorityMetadataExpiresAt:()=>aHe,isAccessTokenEntity:()=>rTo,isAppMetadataEntity:()=>cTo,isAuthorityMetadataEntity:()=>lTo,isAuthorityMetadataExpired:()=>cHe,isCredentialEntity:()=>sHe,isIdTokenEntity:()=>nTo,isRefreshTokenEntity:()=>iTo,isServerTelemetryEntity:()=>oTo,isThrottlingEntity:()=>sTo,updateAuthorityEndpointMetadata:()=>Ace,updateCloudDiscoveryMetadata:()=>HSe});p();var Yu={};ki(Yu,{delay:()=>tTo,isCacheExpired:()=>eTo,isTokenExpired:()=>gce,nowSeconds:()=>gS,toDateFromSeconds:()=>jSe,toSecondsFromDate:()=>XSo,wasClockTurnedBack:()=>eBt});p();function gS(){return Math.round(new Date().getTime()/1e3)}a(gS,"nowSeconds");function XSo(t){return t.getTime()/1e3}a(XSo,"toSecondsFromDate");function jSe(t){return t?new Date(Number(t)*1e3):new Date}a(jSe,"toDateFromSeconds");function gce(t,e){let r=Number(t)||0;return gS()+e>r}a(gce,"isTokenExpired");function eTo(t,e){let r=Number(t)+e*24*60*60*1e3;return Date.now()>r}a(eTo,"isCacheExpired");function eBt(t){return Number(t)>gS()}a(eBt,"wasClockTurnedBack");function tTo(t,e){return new Promise(r=>setTimeout(()=>r(e),t))}a(tTo,"delay");function tBt(t,e,r,n,o){return{credentialType:t0.ID_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,realm:o,lastUpdatedAt:Date.now().toString()}}a(tBt,"createIdTokenEntity");function rBt(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={homeAccountId:t,credentialType:t0.ACCESS_TOKEN,secret:r,cachedAt:gS().toString(),expiresOn:c.toString(),extendedExpiresOn:l.toString(),environment:e,clientId:n,realm:o,target:s,tokenType:f||hf.BEARER,lastUpdatedAt:Date.now().toString()};if(h&&(g.userAssertionHash=h),d&&(g.refreshOn=d.toString()),g.tokenType?.toLowerCase()!==hf.BEARER.toLowerCase())switch(g.credentialType=t0.ACCESS_TOKEN_WITH_AUTH_SCHEME,g.tokenType){case hf.POP:let A=u3(r,u);if(!A?.cnf?.kid)throw kt(PLt);g.keyId=A.cnf.kid;break;case hf.SSH:g.keyId=m}return g}a(rBt,"createAccessTokenEntity");function nBt(t,e,r,n,o,s,c){let l={credentialType:t0.REFRESH_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,lastUpdatedAt:Date.now().toString()};return s&&(l.userAssertionHash=s),o&&(l.familyId=o),c&&(l.expiresOn=c.toString()),l}a(nBt,"createRefreshTokenEntity");function sHe(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}a(sHe,"isCredentialEntity");function rTo(t){return t?sHe(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===t0.ACCESS_TOKEN||t.credentialType===t0.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}a(rTo,"isAccessTokenEntity");function nTo(t){return t?sHe(t)&&t.hasOwnProperty("realm")&&t.credentialType===t0.ID_TOKEN:!1}a(nTo,"isIdTokenEntity");function iTo(t){return t?sHe(t)&&t.credentialType===t0.REFRESH_TOKEN:!1}a(iTo,"isRefreshTokenEntity");function oTo(t,e){let r=t.indexOf(ASe)===0,n=!0;return e&&(n=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),r&&n}a(oTo,"isServerTelemetryEntity");function sTo(t,e){let r=!1;t&&(r=t.indexOf(ySe)===0);let n=!0;return e&&(n=e.hasOwnProperty("throttleTime")),r&&n}a(sTo,"isThrottlingEntity");function aTo({environment:t,clientId:e}){return[oce,t,e].join(tY).toLowerCase()}a(aTo,"generateAppMetadataKey");function cTo(t,e){return e?t.indexOf(oce)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}a(cTo,"isAppMetadataEntity");function lTo(t,e){return e?t.indexOf(sce)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}a(lTo,"isAuthorityMetadataEntity");function aHe(){return gS()+u4t}a(aHe,"generateAuthorityMetadataExpiresAt");function Ace(t,e,r){t.authorization_endpoint=e.authorization_endpoint,t.token_endpoint=e.token_endpoint,t.end_session_endpoint=e.end_session_endpoint,t.issuer=e.issuer,t.endpointsFromNetwork=r,t.jwks_uri=e.jwks_uri}a(Ace,"updateAuthorityEndpointMetadata");function HSe(t,e,r){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=r}a(HSe,"updateCloudDiscoveryMetadata");function cHe(t){return t.expiresAt<=gS()}a(cHe,"isAuthorityMetadataExpired");p();p();var xrn="networkClientSendPostRequestAsync",wrn="refreshTokenClientExecutePostToTokenEndpoint",Rrn="authorizationCodeClientExecutePostToTokenEndpoint",krn="refreshTokenClientExecuteTokenRequest",Prn="refreshTokenClientAcquireToken",lHe="refreshTokenClientAcquireTokenWithCachedRefreshToken",Drn="refreshTokenClientCreateTokenRequestBody",Nrn="silentFlowClientGenerateResultFromCacheRecord";var Mrn="authClientExecuteTokenRequest",Orn="authClientCreateTokenRequestBody",Lrn="updateTokenEndpointAuthority",yce="popTokenGenerateCnf",uHe="handleServerTokenResponse",Brn="authorityResolveEndpointsAsync",Frn="authorityGetCloudDiscoveryMetadataFromNetwork",Urn="authorityUpdateCloudDiscoveryMetadata",Qrn="authorityGetEndpointMetadataFromNetwork",qrn="authorityUpdateEndpointMetadata",iBt="authorityUpdateMetadataWithRegionalInformation",jrn="regionDiscoveryDetectRegion",oBt="regionDiscoveryGetRegionFromIMDS",Hrn="regionDiscoveryGetCurrentVersion",Grn="cacheManagerGetRefreshToken";p();var $rn=a((t,e,r,n,o)=>(...s)=>{r.trace(`Executing function '${e}'`,o);let c=n.startMeasurement(e,o);o&&n.incrementFields({[`ext.${e}CallCount`]:1},o);try{let l=t(...s);return c.end({success:!0}),r.trace(`Returning result from '${e}'`,o),l}catch(l){r.trace(`Error occurred in '${e}'`,o);try{r.trace(JSON.stringify(l),o)}catch{r.trace("Unable to print error message.",o)}throw c.end({success:!1},l),l}},"invoke"),Js=a((t,e,r,n,o)=>(...s)=>{r.trace(`Executing function '${e}'`,o);let c=n.startMeasurement(e,o);return o&&n.incrementFields({[`ext.${e}CallCount`]:1},o),t(...s).then(l=>(r.trace(`Returning result from '${e}'`,o),c.end({success:!0}),l)).catch(l=>{r.trace(`Error occurred in '${e}'`,o);try{r.trace(JSON.stringify(l),o)}catch{r.trace("Unable to print error message.",o)}throw c.end({success:!1},l),l})},"invokeAsync");var uTo={SW:"sw"},z7=class{static{a(this,"PopTokenGenerator")}constructor(e,r){this.cryptoUtils=e,this.performanceClient=r}async generateCnf(e,r){let n=await Js(this.generateKid.bind(this),yce,r,this.performanceClient,e.correlationId)(e),o=this.cryptoUtils.base64UrlEncode(JSON.stringify(n));return{kid:n.kid,reqCnfString:o}}async generateKid(e){return{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:uTo.SW}}async signPopToken(e,r,n){return this.signPayload(e,r,n)}async signPayload(e,r,n,o){let{resourceRequestMethod:s,resourceRequestUri:c,shrClaims:l,shrNonce:u,shrOptions:d}=n,h=(c?new Is(c):void 0)?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:gS(),m:s?.toUpperCase(),u:h?.HostNameAndPort,nonce:u||this.cryptoUtils.createNewGuid(),p:h?.AbsolutePath,q:h?.QueryString?[[],h.QueryString]:void 0,client_claims:l||void 0,...o},r,d,n.correlationId)}};p();var fHe={};ki(fHe,{badToken:()=>GSe,consentRequired:()=>lBt,interactionRequired:()=>cBt,interruptedUser:()=>dBt,loginRequired:()=>uBt,nativeAccountUnavailable:()=>dTo,noTokensFound:()=>dHe,refreshTokenExpired:()=>sBt,uxNotAllowed:()=>aBt});p();var dHe="no_tokens_found",dTo="native_account_unavailable",sBt="refresh_token_expired",aBt="ux_not_allowed",cBt="interaction_required",lBt="consent_required",uBt="login_required",GSe="bad_token",dBt="interrupted_user";var Vrn=[cBt,lBt,uBt,GSe,aBt,dBt],fTo=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed","interrupted_user"],AS=class t extends Fo{static{a(this,"InteractionRequiredAuthError")}constructor(e,r,n,o,s,c,l,u){super(e,r,n),Object.setPrototypeOf(this,t.prototype),this.timestamp=o||"",this.traceId=s||"",this.correlationId=c||"",this.claims=l||"",this.name="InteractionRequiredAuthError",this.errorNo=u}};function pHe(t,e,r){let n=!!t&&Vrn.indexOf(t)>-1,o=!!r&&fTo.indexOf(r)>-1,s=!!e&&Vrn.some(c=>e.indexOf(c)>-1);return n||s||o}a(pHe,"isInteractionRequiredError");function hHe(t,e){return new AS(t,e)}a(hHe,"createInteractionRequiredAuthError");p();var k_=class t extends Fo{static{a(this,"ServerError")}constructor(e,r,n,o,s){super(e,r,n),this.name="ServerError",this.errorNo=o,this.status=s,Object.setPrototypeOf(this,t.prototype)}};p();function Wrn(t,e){if(!t)throw kt(kLt);if(!e)throw kt(oY);try{let r=e.split(Nje),n=r[0],o=r.length>1?r.slice(1).join(Nje):"",s=t(n),c=JSON.parse(s);return{userRequestState:o||"",libraryState:c}}catch{throw kt(oY)}}a(Wrn,"parseRequestState");var Vp=class t{static{a(this,"ResponseHandler")}constructor(e,r,n,o,s,c,l){this.clientId=e,this.cacheStorage=r,this.cryptoObj=n,this.logger=o,this.performanceClient=s,this.serializableCache=c,this.persistencePlugin=l}validateTokenResponse(e,r,n){if(e.error||e.error_description||e.suberror){let o=`Error(s): ${e.error_codes||eY} - Timestamp: ${e.timestamp||eY} - Description: ${e.error_description||eY} - Correlation ID: ${e.correlation_id||eY} - Trace ID: ${e.trace_id||eY}`,s=e.error_codes?.length?e.error_codes[0]:void 0,c=new k_(e.error,o,e.suberror,s,e.status);if(n&&e.status&&e.status>=i4t&&e.status<=o4t){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed. -${c}`,r);return}else if(n&&e.status&&e.status>=r4t&&e.status<=n4t){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. -${c}`,r);return}throw pHe(e.error,e.error_description,e.suberror)?new AS(e.error,e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",s):c}}async handleServerTokenResponse(e,r,n,o,s,c,l,u,d,f){let h;if(e.id_token){if(h=u3(e.id_token||"",this.cryptoObj.base64Decode),c&&c.nonce&&h.nonce!==c.nonce)throw kt(bLt);if(o.maxAge||o.maxAge===0){let y=h.auth_time;if(!y)throw kt(CSe);FSe(y,o.maxAge)}}this.homeAccountIdentifier=XLt(e.client_info||"",r.authorityType,this.logger,this.cryptoObj,o.correlationId,h);let m;c&&c.state&&(m=Wrn(this.cryptoObj.base64Decode,c.state)),e.key_id=e.key_id||o.sshKid||void 0;let g=this.generateCacheRecord(e,r,n,o,h,l,c),A;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess",o.correlationId),A=new mS(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(A)),u&&!d&&g.account&&this.cacheStorage.getAllAccounts({homeAccountId:g.account.homeAccountId,environment:g.account.environment},o.correlationId).length<1)return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache",o.correlationId),this.performanceClient?.addFields({acntLoggedOut:!0},o.correlationId),await t.generateAuthenticationResult(this.cryptoObj,r,g,!1,o,this.performanceClient,h,m,void 0,f);await this.cacheStorage.saveCacheRecord(g,o.correlationId,zLt(h||{}),s,o.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&A&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess",o.correlationId),await this.persistencePlugin.afterCacheAccess(A))}return t.generateAuthenticationResult(this.cryptoObj,r,g,!1,o,this.performanceClient,h,m,e,f)}generateCacheRecord(e,r,n,o,s,c,l){let u=r.getPreferredCache();if(!u)throw kt(SSe);let d=iHe(s),f,h;e.id_token&&s&&(f=tBt(this.homeAccountIdentifier,u,e.id_token,this.clientId,d||""),h=zrn(this.cacheStorage,r,this.homeAccountIdentifier,this.cryptoObj.base64Decode,o.correlationId,s,e.client_info,u,d,l,void 0,this.logger,this.performanceClient));let m=null;if(e.access_token){let y=e.scope?Uh.fromString(e.scope):new Uh(o.scopes||[]),E=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,_=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,v=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,b=n+E,T=b+_,w=v&&v>0?n+v:void 0;m=rBt(this.homeAccountIdentifier,u,e.access_token,this.clientId,d||r.tenant||"",y.printScopes(),b,T,this.cryptoObj.base64Decode,w,e.token_type,c,e.key_id);let R=o.resource||null;R&&(m.resource=R)}let g=null;if(e.refresh_token){let y;if(e.refresh_token_expires_in){let E=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;y=n+E,this.performanceClient?.addFields({ntwkRtExpiresOnSeconds:y},o.correlationId)}g=nBt(this.homeAccountIdentifier,u,e.refresh_token,this.clientId,e.foci,c,y)}let A=null;return e.foci&&(A={clientId:this.clientId,environment:u,familyId:e.foci}),{account:h,idToken:f,accessToken:m,refreshToken:g,appMetadata:A}}static async generateAuthenticationResult(e,r,n,o,s,c,l,u,d,f){let h="",m=[],g=null,A,y,E="";if(n.accessToken){if(n.accessToken.tokenType===hf.POP&&!s.popKid){let T=new z7(e,c),{secret:w,keyId:R}=n.accessToken;if(!R)throw kt(MLt);h=await T.signPopToken(w,R,s)}else h=n.accessToken.secret;m=Uh.fromString(n.accessToken.target).asArray(),g=jSe(n.accessToken.expiresOn),A=jSe(n.accessToken.extendedExpiresOn),n.accessToken.refreshOn&&(y=jSe(n.accessToken.refreshOn))}n.appMetadata&&(E=n.appMetadata.familyId===rY?rY:"");let _=l?.oid||l?.sub||"",v=l?.tid||"";d?.spa_accountid&&n.account&&(n.account.nativeAccountId=d?.spa_accountid);let b=n.account?rHe(mce(n.account),void 0,l,n.idToken?.secret):null;return{authority:r.canonicalAuthority,uniqueId:_,tenantId:v,scopes:m,account:b,idToken:n?.idToken?.secret||"",idTokenClaims:l||{},accessToken:h,fromCache:o,expiresOn:g,extExpiresOn:A,refreshOn:y,correlationId:s.correlationId,requestId:f||"",familyId:E,tokenType:n.accessToken?.tokenType||"",state:u?u.userRequestState:"",cloudGraphHostName:n.account?.cloudGraphHostName||"",msGraphHost:n.account?.msGraphHost||"",code:d?.spa_code,fromPlatformBroker:!1}}};function zrn(t,e,r,n,o,s,c,l,u,d,f,h,m){h?.verbose("setCachedAccount called",o);let g=l||e.getPreferredCache(),A=t.getAccountsFilteredBy({homeAccountId:r,environment:g},o);m?.addFields({cacheMatchedAccounts:A.length},o),A.length>1&&h?.warning("Multiple base accounts matched homeAccountId. Ignoring cached account and creating a new base account.",o);let E=(A.length===1?A[0]:null)||ZLt({homeAccountId:r,idTokenClaims:s,clientInfo:c,environment:l,cloudGraphHostName:d?.cloud_graph_host_name,msGraphHost:d?.msgraph_host,nativeAccountId:f},e,n),_=E.tenantProfiles||[],v=u||E.realm;if(v&&!_.find(b=>b.tenantId===v)){let b=hY(r,E.localAccountId,v,s);_.push(b)}return E.tenantProfiles=_,E}a(zrn,"buildAccountToCache");p();var P_={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};p();async function D_(t,e,r){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:r})}a(D_,"getClientAssertion");p();function Ece(t,e,r){return{clientId:t,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:r,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||e.extraParameters?.clientId}}a(Ece,"getRequestThumbprint");var gY={};ki(gY,{createTokenQueryParameters:()=>WSe,createTokenRequestHeaders:()=>VSe,executePostToTokenEndpoint:()=>zSe,sendPostRequest:()=>Yrn});p();p();var $Se=class t{static{a(this,"ThrottlingUtils")}static generateThrottlingStorageKey(e){return`${ySe}.${JSON.stringify(e)}`}static preProcess(e,r,n){let o=t.generateThrottlingStorageKey(r),s=e.getThrottlingCache(o,n);if(s){if(s.throttleTime=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(Gp.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){let r=e<=0?0:e,n=Date.now()/1e3;return Math.floor(Math.min(n+(r||g4t),n+A4t)*1e3)}static removeThrottle(e,r,n,o){let s=Ece(r,n,o),c=this.generateThrottlingStorageKey(s);e.removeItem(c,n.correlationId)}};p();var _ce=class t extends Fo{static{a(this,"NetworkError")}constructor(e,r,n){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,t.prototype),this.name="NetworkError",this.error=e,this.httpStatus=r,this.responseHeaders=n}};function fBt(t,e,r,n){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${n?.name}, error.message:${n?.message}`,new _ce(t,e,r)}a(fBt,"createNetworkError");function VSe(t,e,r){let n={};if(n[Gp.CONTENT_TYPE]=Y5t,!e&&r)switch(r.type){case P_.HOME_ACCOUNT_ID:try{let o=qM(r.credential);n[Gp.CCS_HEADER]=`Oid:${o.uid}@${o.utid}`}catch(o){t.verbose(`Could not parse home account ID for CCS Header: '${o}'`,"")}break;case P_.UPN:n[Gp.CCS_HEADER]=`UPN: ${r.credential}`;break}return n}a(VSe,"createTokenRequestHeaders");function WSe(t,e,r,n){let o=new Map;return t.embeddedClientId&&c3(o,e,r),t.extraQueryParameters&&a3(o,t.extraQueryParameters),dY(o,t.correlationId),sY(o,t.correlationId,n),UM(o)}a(WSe,"createTokenQueryParameters");async function zSe(t,e,r,n,o,s,c,l,u,d){let f=await Yrn(n,t,{body:e,headers:r},o,s,c,l,u);return d&&f.status<500&&f.status!==429&&d.clearTelemetryCache(),f}a(zSe,"executePostToTokenEndpoint");async function Yrn(t,e,r,n,o,s,c,l){$Se.preProcess(o,t,n);let u;try{u=await Js(s.sendPostRequestAsync.bind(s),xrn,c,l,n)(e,r);let d=u.headers||{};l?.addFields({refreshTokenSize:u.body.refresh_token?.length||0,httpVerToken:d[Gp.X_MS_HTTP_VERSION]||"",requestId:d[Gp.X_MS_REQUEST_ID]||""},n)}catch(d){if(d instanceof _ce){let f=d.responseHeaders;throw f&&l?.addFields({httpVerToken:f[Gp.X_MS_HTTP_VERSION]||"",requestId:f[Gp.X_MS_REQUEST_ID]||"",contentTypeHeader:f[Gp.CONTENT_TYPE]||void 0,contentLengthHeader:f[Gp.CONTENT_LENGTH]||void 0,httpStatus:d.httpStatus},n),d.error}throw d instanceof Fo?d:kt(ELt)}return $Se.postProcess(o,t,u,n),u}a(Yrn,"sendPostRequest");var gHe={};ki(gHe,{createDiscoveredInstance:()=>hBt});p();p();p();function Krn(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}a(Krn,"isOpenIdConfigResponse");p();function Jrn(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}a(Jrn,"isCloudInstanceDiscoveryResponse");p();function Zrn(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}a(Zrn,"isCloudInstanceDiscoveryErrorResponse");p();var YSe=class t{static{a(this,"RegionDiscovery")}constructor(e,r,n,o){this.networkInterface=e,this.logger=r,this.performanceClient=n,this.correlationId=o}async detectRegion(e,r){let n=e;if(n)r.region_source=H7.ENVIRONMENT_VARIABLE;else{let o=t.IMDS_OPTIONS;try{let s=await Js(this.getRegionFromIMDS.bind(this),oBt,this.logger,this.performanceClient,this.correlationId)(K5t,o);if(s.status===Lje&&(n=s.body,r.region_source=H7.IMDS),s.status===Bje){let c=await Js(this.getCurrentVersion.bind(this),Hrn,this.logger,this.performanceClient,this.correlationId)(o);if(!c)return r.region_source=H7.FAILED_AUTO_DETECTION,null;let l=await Js(this.getRegionFromIMDS.bind(this),oBt,this.logger,this.performanceClient,this.correlationId)(c,o);l.status===Lje&&(n=l.body,r.region_source=H7.IMDS)}}catch{return r.region_source=H7.FAILED_AUTO_DETECTION,null}}return n||(r.region_source=H7.FAILED_AUTO_DETECTION),n||null}async getRegionFromIMDS(e,r){return this.networkInterface.sendGetRequestAsync(`${Oje}?api-version=${e}&format=text`,r,J5t)}async getCurrentVersion(e){try{let r=await this.networkInterface.sendGetRequestAsync(`${Oje}?format=json`,e);return r.status===Bje&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}};YSe.IMDS_OPTIONS={headers:{Metadata:"true"}};var mP=class t{static{a(this,"Authority")}constructor(e,r,n,o,s,c,l,u){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=r,this.cacheManager=n,this.authorityOptions=o,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=s,this.performanceClient=l,this.correlationId=c,this.managedIdentity=u||!1,this.regionDiscovery=new YSe(r,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(Dje))return Sx.Ciam;let r=e.PathSegments;if(r.length)switch(r[0].toLowerCase()){case $5t:return Sx.Adfs;case V5t:return Sx.Dsts}return Sx.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new Is(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw kt(hP)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw kt(hP)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw kt(hP)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw kt(NLt);return this.replacePath(this.metadata.end_session_endpoint)}else throw kt(hP)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw kt(hP)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw kt(hP)}canReplaceTenant(e){return e.PathSegments.length===1&&!t.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===Sx.Default&&this.protocolMode!==Xy.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let r=e,o=new Is(this.metadata.canonical_authority).getUrlComponents(),s=o.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((l,u)=>{let d=s[u];if(u===0&&this.canReplaceTenant(o)){let f=new Is(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];d!==f&&(this.logger.verbose(`Replacing tenant domain name '${d}' with id '${f}'`,this.correlationId),d=f)}l!==d&&(r=r.replace(`/${d}/`,`/${l}/`))}),this.replaceTenant(r)}get defaultOpenIdConfigurationEndpoint(){let e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===Sx.Adfs||this.protocolMode===Xy.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){let e=this.getCurrentMetadataEntity(),r=await Js(this.updateCloudDiscoveryMetadata.bind(this),Urn,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);let n=await Js(this.updateEndpointMetadata.bind(this),qrn,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,r,{source:n}),this.performanceClient?.addFields({cloudDiscoverySource:r,authorityEndpointSource:n},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort,this.correlationId);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:aHe(),jwks_uri:""}),e}updateCachedMetadata(e,r,n){r!==Zy.CACHE&&n?.source!==Zy.CACHE&&(e.expiresAt=aHe(),e.canonical_authority=this.canonicalAuthority);let o=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache,this.correlationId);this.cacheManager.setAuthorityMetadata(o,e,this.correlationId),this.metadata=e}async updateEndpointMetadata(e){let r=this.updateEndpointMetadataFromLocalSources(e);if(r){if(r.source===Zy.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&r.metadata){let o=await Js(this.updateMetadataWithRegionalInformation.bind(this),iBt,this.logger,this.performanceClient,this.correlationId)(r.metadata);Ace(e,o,!1),e.canonical_authority=this.canonicalAuthority}return r.source}let n=await Js(this.getEndpointMetadataFromNetwork.bind(this),Qrn,this.logger,this.performanceClient,this.correlationId)();if(n)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(n=await Js(this.updateMetadataWithRegionalInformation.bind(this),iBt,this.logger,this.performanceClient,this.correlationId)(n)),Ace(e,n,!0),Zy.NETWORK;throw kt(_Lt,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration",this.correlationId);let r=this.getEndpointMetadataFromConfig();if(r)return this.logger.verbose("Found endpoint metadata in authority configuration",this.correlationId),Ace(e,r,!1),{source:Zy.CONFIG};this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values.",this.correlationId);let n=this.getEndpointMetadataFromHardcodedValues();if(n)return Ace(e,n,!1),{source:Zy.HARDCODED_VALUES,metadata:n};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.",this.correlationId);let o=cHe(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!o?(this.logger.verbose("Found endpoint metadata in the cache.",""),{source:Zy.CACHE}):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}isAuthoritySameType(e){return new Is(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw vl(mLt)}return null}async getEndpointMetadataFromNetwork(){let e={},r=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from '${r}'`,this.correlationId);try{let n=await this.networkInterface.sendGetRequestAsync(r,e);return Krn(n.body)?n.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration",this.correlationId),null)}catch(n){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: '${n}'`,this.correlationId),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in YLt?YLt[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){let r=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(r){if(r!==Z5t)return this.regionDiscoveryMetadata.region_outcome=ESe.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=r,t.replaceWithRegionalInformation(e,r);let n=await Js(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),jrn,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(n)return this.regionDiscoveryMetadata.region_outcome=ESe.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=n,t.replaceWithRegionalInformation(e,n);this.regionDiscoveryMetadata.region_outcome=ESe.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){let r=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(r)return r;let n=await Js(this.getCloudDiscoveryMetadataFromNetwork.bind(this),Frn,this.logger,this.performanceClient,this.correlationId)();if(n)return HSe(e,n,!0),Zy.NETWORK;throw vl(gLt)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration",this.correlationId),this.logger.verbosePii(`Known Authorities: '${this.authorityOptions.knownAuthorities||hSe}'`,this.correlationId),this.logger.verbosePii(`Authority Metadata: '${this.authorityOptions.authorityMetadata||hSe}'`,this.correlationId),this.logger.verbosePii(`Canonical Authority: '${e.canonical_authority||hSe}'`,this.correlationId);let r=this.getCloudDiscoveryMetadataFromConfig();if(r)return this.logger.verbose("Found cloud discovery metadata in authority configuration",this.correlationId),HSe(e,r,!1),Zy.CONFIG;this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values.",this.correlationId);let n=vrn(this.hostnameAndPort);if(n)return this.logger.verbose("Found cloud discovery metadata from hardcoded values.",this.correlationId),HSe(e,n,!1),Zy.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.",this.correlationId);let o=cHe(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!o?(this.logger.verbose("Found cloud discovery metadata in the cache.",""),Zy.CACHE):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===Sx.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host.",this.correlationId),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.",this.correlationId);try{this.logger.verbose("Attempting to parse the cloud discovery metadata.",this.correlationId);let e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),r=USe(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata.",""),r)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata.",this.correlationId),r;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.",this.correlationId)}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error.",this.correlationId),vl(Kje)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host.",this.correlationId),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){let e=`${W5t}${this.canonicalAuthority}oauth2/v2.0/authorize`,r={},n=null;try{let o=await this.networkInterface.sendGetRequestAsync(e,r),s,c;if(Jrn(o.body))s=o.body,c=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: '${s.tenant_discovery_endpoint}'`,this.correlationId);else if(Zrn(o.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: '${o.status}'`,this.correlationId),s=o.body,s.error===t4t)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance.",this.correlationId),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is '${s.error}'`,this.correlationId),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is '${s.error_description}'`,this.correlationId),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network, correlationId) to []",this.correlationId),c=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse",this.correlationId),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request.",this.correlationId),n=USe(c,this.hostnameAndPort)}catch(o){if(o instanceof Fo)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata. +${n}`),this.errors=e,this.name=Zrn}};function Krn(t){return{error:t.error,errorDescription:t.error_description,correlationId:t.correlation_id,errorCodes:t.error_codes,timestamp:t.timestamp,traceId:t.trace_id}}a(Krn,"convertOAuthErrorResponseToErrorResponse");var kx=class extends Error{static{a(this,"AuthenticationRequiredError")}scopes;getTokenOptions;constructor(e){super(e.message,e.cause?{cause:e.cause}:void 0),this.scopes=e.scopes,this.getTokenOptions=e.getTokenOptions,this.name="AuthenticationRequiredError"}};p();p();p();p();var Xrn=require("node:os"),enn=fe(require("node:util"),1),tnn=fe(require("node:process"),1);function rnn(t,...e){tnn.stderr.write(`${enn.default.format(t,...e)}${Xrn.EOL}`)}a(rnn,"log");var nnn=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,inn,o4t=[],s4t=[],Kje=[];nnn&&a4t(nnn);var onn=Object.assign(t=>snn(t),{enable:a4t,enabled:c4t,disable:CTo,log:rnn});function a4t(t){inn=t,o4t=[],s4t=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?s4t.push(new RegExp(`^${n.substr(1)}$`)):o4t.push(new RegExp(`^${n}$`));for(let n of Kje)n.enabled=c4t(n.namespace)}a(a4t,"enable");function c4t(t){if(t.endsWith("*"))return!0;for(let e of s4t)if(e.test(t))return!1;for(let e of o4t)if(e.test(t))return!0;return!1}a(c4t,"enabled");function CTo(){let t=inn||"";return a4t(""),t}a(CTo,"disable");function snn(t){let e=Object.assign(r,{enabled:c4t(t),destroy:bTo,log:onn.log,namespace:t,extend:STo});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),Kje.push(e),e}a(snn,"createDebugger");function bTo(){let t=Kje.indexOf(this);return t>=0?(Kje.splice(t,1),!0):!1}a(bTo,"destroy");function STo(t){let e=snn(`${this.namespace}:${t}`);return e.log=this.log,e}a(STo,"extend");var ace=onn;var cnn=new Set,Jje=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,Xje,l4t=ace("azure");l4t.log=(...t)=>{ace.log(...t)};var u4t=["verbose","info","warning","error"];Jje&&(dnn(Jje)?TTo(Jje):console.error(`AZURE_LOG_LEVEL set to unknown log level '${Jje}'; logging is not enabled. Acceptable values: ${u4t.join(", ")}.`));function TTo(t){if(t&&!dnn(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${u4t.join(",")}`);Xje=t;let e=[];for(let r of cnn)unn(r)&&e.push(r.namespace);ace.enable(e.join(","))}a(TTo,"setLogLevel");function eHe(){return Xje}a(eHe,"getLogLevel");var ann={verbose:400,info:300,warning:200,error:100};function K7(t){let e=l4t.extend(t);return lnn(l4t,e),{error:Zje(e,"error"),warning:Zje(e,"warning"),info:Zje(e,"info"),verbose:Zje(e,"verbose")}}a(K7,"createClientLogger");function lnn(t,e){e.log=(...r)=>{t.log(...r)}}a(lnn,"patchLogMethod");function Zje(t,e){let r=Object.assign(t.extend(e),{level:e});if(lnn(t,r),unn(r)){let n=ace.disable();ace.enable(n+","+r.namespace)}return cnn.add(r),r}a(Zje,"createLogger");function unn(t){return!!(Xje&&ann[t.level]<=ann[Xje])}a(unn,"shouldEnable");function dnn(t){return u4t.includes(t)}a(dnn,"isAzureLogLevel");var ES=K7("identity");function tHe(t){return t.reduce((e,r)=>(process.env[r]?e.assigned.push(r):e.missing.push(r),e),{missing:[],assigned:[]})}a(tHe,"processEnvVars");function o0(t){return`SUCCESS. Scopes: ${Array.isArray(t)?t.join(", "):t}.`}a(o0,"formatSuccess");function Qs(t,e){let r="ERROR.";return t?.length&&(r+=` Scopes: ${Array.isArray(t)?t.join(", "):t}.`),`${r} Error message: ${typeof e=="string"?e:e.message}.`}a(Qs,"formatError");function fnn(t,e,r=ES){let n=e?`${e.fullTitle} ${t}`:t;function o(u){r.info(`${n} =>`,u)}a(o,"info");function s(u){r.warning(`${n} =>`,u)}a(s,"warning");function c(u){r.verbose(`${n} =>`,u)}a(c,"verbose");function l(u){r.error(`${n} =>`,u)}return a(l,"error"),{title:t,fullTitle:n,info:o,warning:s,verbose:c,error:l}}a(fnn,"credentialLoggerInstance");function ao(t,e=ES){let r=fnn(t,void 0,e);return{...r,parent:e,getToken:fnn("=> getToken()",r,e)}}a(ao,"credentialLogger");p();p();p();p();var cce={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function pnn(t={}){let e=new d4t(t.parentContext);return t.span&&(e=e.setValue(cce.span,t.span)),t.namespace&&(e=e.setValue(cce.namespace,t.namespace)),e}a(pnn,"createTracingContext");var d4t=class t{static{a(this,"TracingContextImpl")}constructor(e){this._contextMap=e instanceof t?new Map(e._contextMap):new Map}setValue(e,r){let n=new t(this);return n._contextMap.set(e,r),n}getValue(e){return this._contextMap.get(e)}deleteValue(e){let r=new t(this);return r._contextMap.delete(e),r}};p();var hnn=fe(f4t(),1),nHe=hnn.state;function ITo(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(ITo,"createDefaultTracingSpan");function xTo(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:ITo(),tracingContext:pnn({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(xTo,"createDefaultInstrumenter");function kSe(){return nHe.instrumenterImplementation||(nHe.instrumenterImplementation=xTo()),nHe.instrumenterImplementation}a(kSe,"getInstrumenter");p();function PSe(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=kSe().startSpan(d,Object.assign(Object.assign({},h),{packageName:r,packageVersion:n,tracingContext:(m=f?.tracingOptions)===null||m===void 0?void 0:m.tracingContext})),A=g.tracingContext,y=g.span;A.getValue(cce.namespace)||(A=A.setValue(cce.namespace,e)),y.setAttribute("az.namespace",A.getValue(cce.namespace));let E=Object.assign({},f,{tracingOptions:Object.assign(Object.assign({},f?.tracingOptions),{tracingContext:A})});return{span:y,updatedOptions:E}}a(o,"startSpan");async function s(d,f,h,m){let{span:g,updatedOptions:A}=o(d,f,m);try{let y=await c(A.tracingOptions.tracingContext,()=>Promise.resolve(h(A,g)));return g.setStatus({status:"success"}),y}catch(y){throw g.setStatus({status:"error",error:y}),y}finally{g.end()}}a(s,"withSpan");function c(d,f,...h){return kSe().withContext(d,f,...h)}a(c,"withContext");function l(d){return kSe().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return kSe().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(PSe,"createTracingClient");var Bc=PSe({namespace:"Microsoft.AAD",packageName:"@azure/identity",packageVersion:Wje});var p4t=ao("ChainedTokenCredential"),DSe=class{static{a(this,"ChainedTokenCredential")}_sources=[];constructor(...e){this._sources=e}async getToken(e,r={}){let{token:n}=await this.getTokenInternal(e,r);return n}async getTokenInternal(e,r={}){let n=null,o,s=[];return Bc.withSpan("ChainedTokenCredential.getToken",r,async c=>{for(let l=0;l0){let l=new RSe(s,"ChainedTokenCredential authentication failed.");throw p4t.getToken.info(Qs(e,l)),l}if(p4t.getToken.info(`Result for ${o.constructor.name}: ${o0(e)}`),n===null)throw new Mn("Failed to retrieve a valid token");return{token:n,successfulCredential:o}})}};p();p();p();p();var TS={};Ri(TS,{AuthError:()=>Fo,AuthErrorCodes:()=>Rce,AzureCloudInstance:()=>m3,ClientAssertion:()=>E3,ClientAuthError:()=>eQ,ClientAuthErrorCodes:()=>zp,ClientConfigurationError:()=>gce,ClientConfigurationErrorCodes:()=>yce,ConfidentialClientApplication:()=>Vce,CryptoProvider:()=>KM,DistributedCachePlugin:()=>qGe,InteractionRequiredAuthError:()=>CS,InteractionRequiredAuthErrorCodes:()=>FHe,LogLevel:()=>_f,Logger:()=>a0,ManagedIdentityApplication:()=>Wce,ManagedIdentitySourceNames:()=>ro,PromptValue:()=>_No,ProtocolMode:()=>nE,PublicClientApplication:()=>Gce,ResponseMode:()=>vNo,ServerError:()=>M_,TokenCache:()=>Dce,TokenCacheContext:()=>_S,internals:()=>QBt,version:()=>SS});p();var QBt={};Ri(QBt,{Deserializer:()=>y3,Serializer:()=>J7});p();p();var J7=class{static{a(this,"Serializer")}static serializeJSONBlob(e){return JSON.stringify(e)}static serializeAccounts(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,realm:o.realm,local_account_id:o.localAccountId,username:o.username,authority_type:o.authorityType,name:o.name,client_info:o.clientInfo,last_modification_time:o.lastModificationTime,last_modification_app:o.lastModificationApp,tenantProfiles:o.tenantProfiles?.map(s=>JSON.stringify(s))}}),r}static serializeIdTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,realm:o.realm}}),r}static serializeAccessTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,realm:o.realm,target:o.target,cached_at:o.cachedAt,expires_on:o.expiresOn,extended_expires_on:o.extendedExpiresOn,refresh_on:o.refreshOn,key_id:o.keyId,token_type:o.tokenType,userAssertionHash:o.userAssertionHash,resource:o.resource}}),r}static serializeRefreshTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,family_id:o.familyId,target:o.target,realm:o.realm}}),r}static serializeAppMetadata(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={client_id:o.clientId,environment:o.environment,family_id:o.familyId}}),r}static serializeAllCache(e){return{Account:this.serializeAccounts(e.accounts),IdToken:this.serializeIdTokens(e.idTokens),AccessToken:this.serializeAccessTokens(e.accessTokens),RefreshToken:this.serializeRefreshTokens(e.refreshTokens),AppMetadata:this.serializeAppMetadata(e.appMetadata)}}};p();p();p();var an={};Ri(an,{addApplicationTelemetry:()=>VSe,addAuthorizationCode:()=>hBt,addBrokerParameters:()=>h3,addCcsOid:()=>f3,addCcsUpn:()=>tQ,addClaims:()=>CY,addCliData:()=>ABt,addClientAssertion:()=>YSe,addClientAssertionType:()=>KSe,addClientCapabilitiesToClaims:()=>Enn,addClientId:()=>_Y,addClientInfo:()=>SY,addClientSecret:()=>zSe,addCodeChallengeParams:()=>NIo,addCodeVerifier:()=>gBt,addCorrelationId:()=>bY,addDeviceCode:()=>MIo,addDomainHint:()=>dBt,addEARParameters:()=>UIo,addExtraParameters:()=>p3,addGrantType:()=>JSe,addIdTokenHint:()=>uBt,addInstanceAware:()=>ZSe,addLibraryInfo:()=>$Se,addLoginHint:()=>_ce,addLogoutHint:()=>yBt,addNativeBroker:()=>DIo,addNonce:()=>pBt,addOboAssertion:()=>OIo,addPassword:()=>FIo,addPopToken:()=>XSe,addPostLogoutRedirectUri:()=>lBt,addPrompt:()=>fBt,addRedirectUri:()=>vY,addRefreshToken:()=>mBt,addRequestTokenUse:()=>LIo,addResource:()=>nTe,addResponseMode:()=>cBt,addResponseType:()=>PIo,addScopes:()=>EY,addServerTelemetry:()=>tTe,addSid:()=>xHe,addSshJwk:()=>eTe,addState:()=>WSe,addThrottling:()=>rTe,addUsername:()=>BIo,instrumentBrokerParams:()=>yY});p();var er={};Ri(er,{AADAuthority:()=>vP,AAD_INSTANCE_DISCOVERY_ENDPT:()=>y4t,AAD_TENANT_DOMAIN_SUFFIX:()=>E4t,ADFS:()=>g4t,APP_METADATA:()=>pce,AUTHORITY_METADATA_CACHE_KEY:()=>hce,AUTHORITY_METADATA_REFRESH_TIME_SECONDS:()=>O4t,AUTHORIZATION_PENDING:()=>PTo,AZURE_REGION_AUTO_DISCOVER_FLAG:()=>b4t,AuthenticationScheme:()=>Ef,AuthorityMetadataSource:()=>rE,CACHE_ACCOUNT_TYPE_ADFS:()=>N4t,CACHE_ACCOUNT_TYPE_GENERIC:()=>dHe,CACHE_ACCOUNT_TYPE_MSAV1:()=>KTo,CACHE_ACCOUNT_TYPE_MSSTS:()=>D4t,CACHE_KEY_SEPARATOR:()=>pY,CIAM_AUTH_URL:()=>iHe,CLIENT_INFO:()=>M4t,CLIENT_INFO_SEPARATOR:()=>fce,CLIENT_MISMATCH_ERROR:()=>$4t,CODE_GRANT_TYPE:()=>RTo,CONSUMER_UTID:()=>wTo,CacheOutcome:()=>CP,CacheType:()=>JTo,ClaimsRequestKeys:()=>dce,CodeChallengeMethodValues:()=>zTo,CredentialType:()=>s0,DEFAULT_AUTHORITY:()=>mnn,DEFAULT_AUTHORITY_HOST:()=>m4t,DEFAULT_COMMON_TENANT:()=>NSe,DEFAULT_MAX_THROTTLE_TIME_SECONDS:()=>j4t,DEFAULT_THROTTLE_TIME_SECONDS:()=>q4t,DEFAULT_TOKEN_RENEWAL_OFFSET_SEC:()=>V4t,DSTS:()=>A4t,EMAIL_SCOPE:()=>ynn,EncodingTypes:()=>tIo,FORWARD_SLASH:()=>lce,GrantType:()=>LSe,HTTP_BAD_REQUEST:()=>lHe,HTTP_CLIENT_ERROR:()=>LTo,HTTP_CLIENT_ERROR_RANGE_END:()=>w4t,HTTP_CLIENT_ERROR_RANGE_START:()=>x4t,HTTP_GATEWAY_TIMEOUT:()=>GTo,HTTP_GONE:()=>QTo,HTTP_MULTI_SIDED_ERROR:()=>$To,HTTP_NOT_FOUND:()=>FTo,HTTP_REDIRECT:()=>OTo,HTTP_REQUEST_TIMEOUT:()=>UTo,HTTP_SERVER_ERROR:()=>jTo,HTTP_SERVER_ERROR_RANGE_END:()=>k4t,HTTP_SERVER_ERROR_RANGE_START:()=>R4t,HTTP_SERVICE_UNAVAILABLE:()=>HTo,HTTP_SUCCESS:()=>cHe,HTTP_SUCCESS_RANGE_END:()=>MTo,HTTP_SUCCESS_RANGE_START:()=>NTo,HTTP_TOO_MANY_REQUESTS:()=>qTo,HTTP_UNAUTHORIZED:()=>BTo,HeaderNames:()=>Wp,HttpMethod:()=>VTo,IMDS_ENDPOINT:()=>aHe,IMDS_TIMEOUT:()=>C4t,IMDS_VERSION:()=>v4t,INVALID_GRANT_ERROR:()=>G4t,INVALID_INSTANCE:()=>I4t,JsonWebTokenTypes:()=>XTo,KNOWN_PUBLIC_CLOUDS:()=>T4t,NOT_APPLICABLE:()=>MSe,NOT_AVAILABLE:()=>fY,OAuthResponseType:()=>YTo,OFFLINE_ACCESS_SCOPE:()=>sHe,OIDC_DEFAULT_SCOPES:()=>uce,OIDC_SCOPES:()=>uHe,ONE_DAY_IN_MS:()=>eIo,OPENID_SCOPE:()=>gnn,PROFILE_SCOPE:()=>Ann,PasswordGrantConstants:()=>hHe,PersistentCacheKeys:()=>WTo,PromptValue:()=>OSe,REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:()=>S4t,RESOURCE_DELIM:()=>oHe,RegionDiscoveryOutcomes:()=>USe,RegionDiscoverySources:()=>X7,ResponseMode:()=>P4t,S256_CODE_CHALLENGE_METHOD:()=>kTo,SERVER_TELEM_CACHE_KEY:()=>BSe,SERVER_TELEM_CATEGORY_SEPARATOR:()=>pHe,SERVER_TELEM_MAX_CACHED_ERRORS:()=>B4t,SERVER_TELEM_MAX_CUR_HEADER_BYTES:()=>ZTo,SERVER_TELEM_MAX_LAST_HEADER_BYTES:()=>L4t,SERVER_TELEM_OVERFLOW_FALSE:()=>U4t,SERVER_TELEM_OVERFLOW_TRUE:()=>F4t,SERVER_TELEM_SCHEMA_VERSION:()=>fHe,SERVER_TELEM_UNKNOWN_ERROR:()=>Q4t,SERVER_TELEM_VALUE_SEPARATOR:()=>Z7,SHR_NONCE_VALIDITY:()=>DTo,SKU:()=>h4t,THE_FAMILY_ID:()=>hY,THROTTLING_PREFIX:()=>FSe,URL_FORM_CONTENT_TYPE:()=>_4t,X_MS_LIB_CAPABILITY_VALUE:()=>H4t});p();var h4t="msal.js.common",mnn="https://login.microsoftonline.com/common/",m4t="login.microsoftonline.com",NSe="common",g4t="adfs",A4t="dstsv2",y4t=`${mnn}discovery/instance?api-version=1.1&authorization_endpoint=`,iHe=".ciamlogin.com",E4t=".onmicrosoft.com",oHe="|",wTo="9188040d-6c67-4c5b-b112-36a304b66dad",gnn="openid",Ann="profile",sHe="offline_access",ynn="email",RTo="authorization_code",kTo="S256",_4t="application/x-www-form-urlencoded;charset=utf-8",PTo="authorization_pending",MSe="N/A",fY="Not Available",lce="/",aHe="http://169.254.169.254/metadata/instance/compute/location",v4t="2020-06-01",C4t=2e3,b4t="TryAutoDetect",S4t="login.microsoft.com",T4t=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],DTo=240,I4t="invalid_instance",cHe=200,NTo=200,MTo=299,OTo=302,LTo=400,x4t=400,lHe=400,BTo=401,FTo=404,UTo=408,QTo=410,qTo=429,w4t=499,jTo=500,R4t=500,HTo=503,GTo=504,k4t=599,$To=600,VTo={GET:"GET",POST:"POST"},uce=[gnn,Ann,sHe],uHe=[...uce,ynn],Wp={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},WTo={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},vP={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},dce={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},OSe={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},zTo={PLAIN:"plain",S256:"S256"},YTo={CODE:"code",IDTOKEN_TOKEN:"id_token token",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},P4t={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},LSe={IMPLICIT_GRANT:"implicit",AUTHORIZATION_CODE_GRANT:"authorization_code",CLIENT_CREDENTIALS_GRANT:"client_credentials",RESOURCE_OWNER_PASSWORD_GRANT:"password",REFRESH_TOKEN_GRANT:"refresh_token",DEVICE_CODE_GRANT:"device_code",JWT_BEARER:"urn:ietf:params:oauth:grant-type:jwt-bearer"},D4t="MSSTS",N4t="ADFS",KTo="MSA",dHe="Generic",pY="-",fce=".",s0={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},JTo={ADFS:1001,MSA:1002,MSSTS:1003,GENERIC:1004,ACCESS_TOKEN:2001,REFRESH_TOKEN:2002,ID_TOKEN:2003,APP_METADATA:3001,UNDEFINED:9999},pce="appmetadata",M4t="client_info",hY="1",hce="authority-metadata",O4t=3600*24,rE={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},fHe=5,ZTo=80,L4t=330,B4t=50,BSe="server-telemetry",pHe="|",Z7=",",F4t="1",U4t="0",Q4t="unknown_error",Ef={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},q4t=60,j4t=3600,FSe="throttling",H4t="retry-after, h429",G4t="invalid_grant",$4t="client_mismatch",hHe={username:"username",password:"password"},X7={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},USe={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},CP={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},XTo={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},eIo=864e5,V4t=300,tIo={BASE64:"base64",HEX:"hex",UTF8:"utf-8"};var mY={};Ri(mY,{ACCESS_TOKEN:()=>iIo,BROKER_CLIENT_ID:()=>QSe,BROKER_REDIRECT_URI:()=>EHe,CCS_HEADER:()=>fIo,CLAIMS:()=>K4t,CLIENT_ASSERTION:()=>_Lt,CLIENT_ASSERTION_TYPE:()=>vLt,CLIENT_ID:()=>VM,CLIENT_INFO:()=>lIo,CLIENT_REQUEST_ID:()=>sLt,CLIENT_SECRET:()=>ELt,CLI_DATA:()=>DLt,CODE:()=>rLt,CODE_CHALLENGE:()=>nLt,CODE_CHALLENGE_METHOD:()=>iLt,CODE_VERIFIER:()=>oLt,DEVICE_CODE:()=>yLt,DOMAIN_HINT:()=>wLt,EAR_JWE_CRYPTO:()=>kLt,EAR_JWK:()=>RLt,ERROR:()=>rIo,ERROR_DESCRIPTION:()=>nIo,EXPIRES_IN:()=>sIo,FOCI:()=>dIo,GRANT_TYPE:()=>Y4t,ID_TOKEN:()=>oIo,ID_TOKEN_HINT:()=>ALt,INSTANCE_AWARE:()=>mce,LOGIN_HINT:()=>xLt,LOGOUT_HINT:()=>TLt,NATIVE_BROKER:()=>SLt,NONCE:()=>eLt,OBO_ASSERTION:()=>CLt,ON_BEHALF_OF:()=>uIo,POST_LOGOUT_URI:()=>gLt,PROMPT:()=>tLt,REDIRECT_URI:()=>mHe,REFRESH_TOKEN:()=>Z4t,REFRESH_TOKEN_EXPIRES_IN:()=>aIo,REQUESTED_TOKEN_USE:()=>bLt,REQ_CNF:()=>AHe,RESOURCE:()=>PLt,RESPONSE_MODE:()=>z4t,RESPONSE_TYPE:()=>W4t,RETURN_SPA_CODE:()=>yHe,SCOPE:()=>J4t,SESSION_STATE:()=>cIo,SID:()=>ILt,STATE:()=>X4t,TOKEN_TYPE:()=>gHe,X_APP_NAME:()=>hLt,X_APP_VER:()=>mLt,X_CLIENT_CPU:()=>uLt,X_CLIENT_CURR_TELEM:()=>dLt,X_CLIENT_EXTRA_SKU:()=>pIo,X_CLIENT_LAST_TELEM:()=>fLt,X_CLIENT_OS:()=>lLt,X_CLIENT_SKU:()=>aLt,X_CLIENT_VER:()=>cLt,X_MS_LIB_CAPABILITY:()=>pLt});p();var VM="client_id",mHe="redirect_uri",W4t="response_type",z4t="response_mode",Y4t="grant_type",K4t="claims",J4t="scope",rIo="error",nIo="error_description",iIo="access_token",oIo="id_token",Z4t="refresh_token",sIo="expires_in",aIo="refresh_token_expires_in",X4t="state",eLt="nonce",tLt="prompt",cIo="session_state",lIo="client_info",rLt="code",nLt="code_challenge",iLt="code_challenge_method",oLt="code_verifier",sLt="client-request-id",aLt="x-client-SKU",cLt="x-client-VER",lLt="x-client-OS",uLt="x-client-CPU",dLt="x-client-current-telemetry",fLt="x-client-last-telemetry",pLt="x-ms-lib-capability",hLt="x-app-name",mLt="x-app-ver",gLt="post_logout_redirect_uri",ALt="id_token_hint",yLt="device_code",ELt="client_secret",_Lt="client_assertion",vLt="client_assertion_type",gHe="token_type",AHe="req_cnf",CLt="assertion",bLt="requested_token_use",uIo="on_behalf_of",dIo="foci",fIo="X-AnchorMailbox",yHe="return_spa_code",SLt="nativebroker",TLt="logout_hint",ILt="sid",xLt="login_hint",wLt="domain_hint",pIo="x-client-xtra-sku",QSe="brk_client_id",EHe="brk_redirect_uri",mce="instance_aware",RLt="ear_jwk",kLt="ear_jwe_crypto",PLt="resource",DLt="clidata";p();p();p();function _He(t){return`See https://aka.ms/msal.js.errors#${t} for details`}a(_He,"getDefaultErrorMessage");var Fo=class t extends Error{static{a(this,"AuthError")}constructor(e,r,n){let o=r||(e?_He(e):""),s=o?`${e}: ${o}`:e;super(s),Object.setPrototypeOf(this,t.prototype),this.errorCode=e||"",this.errorMessage=o||"",this.subError=n||"",this.name="AuthError"}setCorrelationId(e){this.correlationId=e}};function gY(t,e){return new Fo(t,e||_He(t))}a(gY,"createAuthError");var gce=class t extends Fo{static{a(this,"ClientConfigurationError")}constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,t.prototype)}};function Cl(t){return new gce(t)}a(Cl,"createClientConfigurationError");p();var pu=class{static{a(this,"StringUtils")}static isEmptyObj(e){if(e)try{let r=JSON.parse(e);return Object.keys(r).length===0}catch{}return!0}static startsWith(e,r){return e.indexOf(r)===0}static endsWith(e,r){return e.length>=r.length&&e.lastIndexOf(r)===e.length-r.length}static queryStringToObject(e){let r={},n=e.split("&"),o=a(s=>decodeURIComponent(s.replace(/\+/g," ")),"decode");return n.forEach(s=>{if(s.trim()){let[c,l]=s.split(/=(.+)/g,2);c&&l&&(r[o(c)]=o(l))}}),r}static trimArrayEntries(e){return e.map(r=>r.trim())}static removeEmptyStringsFromArray(e){return e.filter(r=>!!r)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}};p();var eQ=class t extends Fo{static{a(this,"ClientAuthError")}constructor(e,r){super(e,r),this.name="ClientAuthError",Object.setPrototypeOf(this,t.prototype)}};function Pt(t,e){return new eQ(t,e)}a(Pt,"createClientAuthError");var yce={};Ri(yce,{authorityMismatch:()=>vIo,authorityUriInsecure:()=>MLt,cannotAllowPlatformBroker:()=>_Io,cannotSetOIDCOptions:()=>EIo,claimsRequestParsingError:()=>hIo,emptyInputScopesError:()=>LLt,invalidAuthenticationHeader:()=>yIo,invalidAuthorityMetadata:()=>QLt,invalidClaims:()=>vHe,invalidCloudDiscoveryMetadata:()=>CHe,invalidCodeChallengeMethod:()=>mIo,invalidRequestMethodForEAR:()=>CIo,logoutRequestEmpty:()=>FLt,missingNonceAuthenticationHeader:()=>AIo,missingSshJwk:()=>qSe,missingSshKid:()=>gIo,pkceParamsMissing:()=>ULt,redirectUriEmpty:()=>NLt,tokenRequestEmpty:()=>BLt,untrustedAuthority:()=>qLt,urlEmptyError:()=>OLt,urlParseError:()=>Ace});p();var NLt="redirect_uri_empty",hIo="claims_request_parsing_error",MLt="authority_uri_insecure",Ace="url_parse_error",OLt="empty_url_error",LLt="empty_input_scopes_error",vHe="invalid_claims",BLt="token_request_empty",FLt="logout_request_empty",mIo="invalid_code_challenge_method",ULt="pkce_params_missing",CHe="invalid_cloud_discovery_metadata",QLt="invalid_authority_metadata",qLt="untrusted_authority",qSe="missing_ssh_jwk",gIo="missing_ssh_kid",AIo="missing_nonce_authentication_header",yIo="invalid_authentication_header",EIo="cannot_set_OIDCOptions",_Io="cannot_allow_platform_broker",vIo="authority_mismatch",CIo="invalid_request_method_for_EAR";var zp={};Ri(zp,{authTimeNotFound:()=>jSe,authorizationCodeMissingFromServerResponse:()=>nBt,bindingKeyNotRemoved:()=>IIo,cannotAppendScopeSet:()=>XLt,cannotRemoveEmptyScope:()=>ZLt,clientInfoDecodingError:()=>bHe,clientInfoEmptyError:()=>jLt,emptyInputScopeSet:()=>IHe,endSessionEndpointNotSupported:()=>iBt,endpointResolutionError:()=>bP,hashNotDeserialized:()=>VLt,invalidCacheEnvironment:()=>GSe,invalidCacheRecord:()=>eBt,invalidState:()=>AY,keyIdMissing:()=>oBt,maxAgeTranspired:()=>YLt,methodNotImplemented:()=>Ts,misplacedResourceParam:()=>aBt,multipleMatchingAppMetadata:()=>KLt,multipleMatchingTokens:()=>bIo,nestedAppAuthBridgeDisabled:()=>RIo,networkError:()=>GLt,noAccountFound:()=>SIo,noAccountInSilentRequest:()=>HSe,noCryptoObject:()=>tBt,noNetworkConnectivity:()=>xIo,nonceMismatch:()=>zLt,nullOrEmptyToken:()=>HLt,openIdConfigError:()=>$Lt,platformBrokerError:()=>kIo,requestCannotBeMade:()=>JLt,resourceParameterRequired:()=>sBt,stateMismatch:()=>WLt,stateNotFound:()=>THe,tokenClaimsCnfRequiredForSignedJwt:()=>rBt,tokenParsingError:()=>SHe,tokenRefreshRequired:()=>Ece,unexpectedCredentialType:()=>TIo,userCanceled:()=>wIo});p();var bHe="client_info_decoding_error",jLt="client_info_empty_error",SHe="token_parsing_error",HLt="null_or_empty_token",bP="endpoints_resolution_error",GLt="network_error",$Lt="openid_config_error",VLt="hash_not_deserialized",AY="invalid_state",WLt="state_mismatch",THe="state_not_found",zLt="nonce_mismatch",jSe="auth_time_not_found",YLt="max_age_transpired",bIo="multiple_matching_tokens",KLt="multiple_matching_appMetadata",JLt="request_cannot_be_made",ZLt="cannot_remove_empty_scope",XLt="cannot_append_scopeset",IHe="empty_input_scopeset",HSe="no_account_in_silent_request",eBt="invalid_cache_record",GSe="invalid_cache_environment",SIo="no_account_found",tBt="no_crypto_object",TIo="unexpected_credential_type",Ece="token_refresh_required",rBt="token_claims_cnf_required_for_signedjwt",nBt="authorization_code_missing_from_server_response",IIo="binding_key_not_removed",iBt="end_session_endpoint_not_supported",oBt="key_id_missing",xIo="no_network_connectivity",wIo="user_canceled",Ts="method_not_implemented",RIo="nested_app_auth_bridge_disabled",kIo="platform_broker_error",sBt="resource_parameter_required",aBt="misplaced_resource_parameter";var jh=class t{static{a(this,"ScopeSet")}constructor(e){let r=e?pu.trimArrayEntries([...e]):[],n=r?pu.removeEmptyStringsFromArray(r):[];if(!n||!n.length)throw Cl(LLt);this.scopes=new Set,n.forEach(o=>this.scopes.add(o))}static fromString(e){let n=(e||"").split(" ");return new t(n)}static createSearchScopes(e){let r=e&&e.length>0?e:[...uce],n=new t(r);return n.containsOnlyOIDCScopes()?n.removeScope(sHe):n.removeOIDCScopes(),n}containsScope(e){let r=this.printScopesLowerCase().split(" "),n=new t(r);return e?n.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(r=>this.containsScope(r))}containsOnlyOIDCScopes(){let e=0;return uHe.forEach(r=>{this.containsScope(r)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(r=>this.appendScope(r))}catch{throw Pt(XLt)}}removeScope(e){if(!e)throw Pt(ZLt);this.scopes.delete(e.trim())}removeOIDCScopes(){uHe.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw Pt(IHe);let r=new Set;return e.scopes.forEach(n=>r.add(n.toLowerCase())),this.scopes.forEach(n=>r.add(n.toLowerCase())),r}intersectingScopeSets(e){if(!e)throw Pt(IHe);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();let r=this.unionScopeSets(e),n=e.getScopeCount(),o=this.getScopeCount();return r.sizee.push(r)),e}printScopes(){return this.scopes?this.asArray().join(" "):""}printScopesLowerCase(){return this.printScopes().toLowerCase()}};function yY(t,e,r){if(!e)return;let n=t.get(VM);n&&t.has(QSe)&&r?.addFields({embeddedClientId:n,embeddedRedirectUri:t.get(mHe)},e)}a(yY,"instrumentBrokerParams");function PIo(t,e){t.set(W4t,e)}a(PIo,"addResponseType");function cBt(t,e){t.set(z4t,e||P4t.QUERY)}a(cBt,"addResponseMode");function DIo(t){t.set(SLt,"1")}a(DIo,"addNativeBroker");function EY(t,e,r=!0,n=uce){r&&!n.includes("openid")&&!e.includes("openid")&&n.push("openid");let o=r?[...e||[],...n]:e||[],s=new jh(o);t.set(J4t,s.printScopes())}a(EY,"addScopes");function _Y(t,e){t.set(VM,e)}a(_Y,"addClientId");function vY(t,e){t.set(mHe,e)}a(vY,"addRedirectUri");function lBt(t,e){t.set(gLt,e)}a(lBt,"addPostLogoutRedirectUri");function uBt(t,e){t.set(ALt,e)}a(uBt,"addIdTokenHint");function dBt(t,e){t.set(wLt,e)}a(dBt,"addDomainHint");function _ce(t,e){t.set(xLt,e)}a(_ce,"addLoginHint");function tQ(t,e){t.set(Wp.CCS_HEADER,`UPN:${e}`)}a(tQ,"addCcsUpn");function f3(t,e){t.set(Wp.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}a(f3,"addCcsOid");function xHe(t,e){t.set("sid",e)}a(xHe,"addSid");function CY(t,e,r){let n=Enn(e,r);try{JSON.parse(n)}catch{throw Cl(vHe)}t.set(K4t,n)}a(CY,"addClaims");function bY(t,e){t.set(sLt,e)}a(bY,"addCorrelationId");function $Se(t,e){t.set(aLt,e.sku),t.set(cLt,e.version),e.os&&t.set(lLt,e.os),e.cpu&&t.set(uLt,e.cpu)}a($Se,"addLibraryInfo");function VSe(t,e){e?.appName&&t.set(hLt,e.appName),e?.appVersion&&t.set(mLt,e.appVersion)}a(VSe,"addApplicationTelemetry");function fBt(t,e){t.set(tLt,e)}a(fBt,"addPrompt");function WSe(t,e){e&&t.set(X4t,e)}a(WSe,"addState");function pBt(t,e){t.set(eLt,e)}a(pBt,"addNonce");function NIo(t,e,r){if(e&&r)t.set(nLt,e),t.set(iLt,r);else throw Cl(ULt)}a(NIo,"addCodeChallengeParams");function hBt(t,e){t.set(rLt,e)}a(hBt,"addAuthorizationCode");function MIo(t,e){t.set(yLt,e)}a(MIo,"addDeviceCode");function mBt(t,e){t.set(Z4t,e)}a(mBt,"addRefreshToken");function gBt(t,e){t.set(oLt,e)}a(gBt,"addCodeVerifier");function zSe(t,e){t.set(ELt,e)}a(zSe,"addClientSecret");function YSe(t,e){e&&t.set(_Lt,e)}a(YSe,"addClientAssertion");function KSe(t,e){e&&t.set(vLt,e)}a(KSe,"addClientAssertionType");function OIo(t,e){t.set(CLt,e)}a(OIo,"addOboAssertion");function LIo(t,e){t.set(bLt,e)}a(LIo,"addRequestTokenUse");function JSe(t,e){t.set(Y4t,e)}a(JSe,"addGrantType");function SY(t){t.set(M4t,"1")}a(SY,"addClientInfo");function ABt(t){t.set(DLt,"1")}a(ABt,"addCliData");function ZSe(t){t.has(mce)||t.set(mce,"true")}a(ZSe,"addInstanceAware");function p3(t,e){Object.entries(e).forEach(([r,n])=>{!t.has(r)&&n&&t.set(r,n)})}a(p3,"addExtraParameters");function Enn(t,e){let r;if(!t)r={};else try{r=JSON.parse(t)}catch{throw Cl(vHe)}return e&&e.length>0&&(r.hasOwnProperty(dce.ACCESS_TOKEN)||(r[dce.ACCESS_TOKEN]={}),r[dce.ACCESS_TOKEN][dce.XMS_CC]={values:e}),JSON.stringify(r)}a(Enn,"addClientCapabilitiesToClaims");function BIo(t,e){t.set(hHe.username,e)}a(BIo,"addUsername");function FIo(t,e){t.set(hHe.password,e)}a(FIo,"addPassword");function XSe(t,e){e&&(t.set(gHe,Ef.POP),t.set(AHe,e))}a(XSe,"addPopToken");function eTe(t,e){e&&(t.set(gHe,Ef.SSH),t.set(AHe,e))}a(eTe,"addSshJwk");function tTe(t,e){t.set(dLt,e.generateCurrentRequestHeaderValue()),t.set(fLt,e.generateLastRequestHeaderValue())}a(tTe,"addServerTelemetry");function rTe(t){t.set(pLt,H4t)}a(rTe,"addThrottling");function yBt(t,e){t.set(TLt,e)}a(yBt,"addLogoutHint");function h3(t,e,r){t.has(QSe)||t.set(QSe,e),t.has(EHe)||t.set(EHe,r)}a(h3,"addBrokerParameters");function UIo(t,e){t.set(RLt,encodeURIComponent(e)),t.set(kLt,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}a(UIo,"addEARParameters");function nTe(t,e){e&&t.set(PLt,e)}a(nTe,"addResource");var SA={};Ri(SA,{getDeserializedResponse:()=>QIo,mapToQueryString:()=>WM,normalizeUrlForComparison:()=>qIo,stripLeadingHashOrQuery:()=>vnn});p();function _nn(t){if(!t)return t;let e=t.toLowerCase();return pu.endsWith(e,"?")?e=e.slice(0,-1):pu.endsWith(e,"?/")&&(e=e.slice(0,-2)),pu.endsWith(e,"/")||(e+="/"),e}a(_nn,"canonicalizeUrl");function vnn(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}a(vnn,"stripLeadingHashOrQuery");function QIo(t){if(!t||t.indexOf("=")<0)return null;try{let e=vnn(t),r=Object.fromEntries(new URLSearchParams(e));if(r.code||r.ear_jwe||r.error||r.error_description||r.state)return r}catch{throw Pt(VLt)}return null}a(QIo,"getDeserializedResponse");function WM(t){let e=new Array;return t.forEach((r,n)=>{e.push(`${n}=${encodeURIComponent(r)}`)}),e.join("&")}a(WM,"mapToQueryString");function qIo(t){if(!t)return t;let e=t.split("#")[0];try{let r=new URL(e),n=r.origin+r.pathname+r.search;return _nn(n)}catch{return _nn(e)}}a(qIo,"normalizeUrlForComparison");p();p();var vce={createNewGuid:a(()=>{throw Pt(Ts)},"createNewGuid"),base64Decode:a(()=>{throw Pt(Ts)},"base64Decode"),base64Encode:a(()=>{throw Pt(Ts)},"base64Encode"),base64UrlEncode:a(()=>{throw Pt(Ts)},"base64UrlEncode"),encodeKid:a(()=>{throw Pt(Ts)},"encodeKid"),async getPublicKeyThumbprint(){throw Pt(Ts)},async removeTokenBindingKey(){throw Pt(Ts)},async clearKeystore(){throw Pt(Ts)},async signJwt(){throw Pt(Ts)},async hashString(){throw Pt(Ts)}};p();var _f;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(_f||(_f={}));var jIo=50,HIo=500,TY=new Map;function GIo(t,e){TY.delete(t),TY.set(t,e)}a(GIo,"markAsRecentlyUsed");function $Io(t,e){let r=Date.now(),n=TY.get(t);if(n)GIo(t,n);else if(n={logs:[],firstEventTime:r},TY.set(t,n),TY.size>jIo){let o=TY.keys().next().value;o&&TY.delete(o)}n.logs.push({...e,milliseconds:r-n.firstEventTime}),n.logs.length>HIo&&n.logs.shift()}a($Io,"addLogToCache");function VIo(t){if(t.length!==6)return!1;for(let e=0;e="a"&&r<="z"||r>="A"&&r<="Z"||r>="0"&&r<="9"))return!1}return!0}a(VIo,"isHashedString");var a0=class t{static{a(this,"Logger")}constructor(e,r,n){this.level=_f.Info;let o=a(()=>{},"defaultLoggerCallback"),s=e||t.createDefaultLoggerOptions();this.localCallback=s.loggerCallback||o,this.piiLoggingEnabled=s.piiLoggingEnabled||!1,this.level=typeof s.logLevel=="number"?s.logLevel:_f.Info,this.packageName=r||"",this.packageVersion=n||""}static createDefaultLoggerOptions(){return{loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:_f.Info}}clone(e,r){return new t({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level},e,r)}logMessage(e,r){let n=r.correlationId;if(VIo(e)){let u={hash:e,level:r.logLevel,containsPii:r.containsPii||!1,milliseconds:0};$Io(n,u)}if(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)return;let l=`${`[${new Date().toUTCString()}] : [${n}]`} : ${this.packageName}@${this.packageVersion} : ${_f[r.logLevel]} - ${e}`;this.executeCallback(r.logLevel,l,r.containsPii||!1)}executeCallback(e,r,n){this.localCallback&&this.localCallback(e,r,n)}error(e,r){this.logMessage(e,{logLevel:_f.Error,containsPii:!1,correlationId:r})}errorPii(e,r){this.logMessage(e,{logLevel:_f.Error,containsPii:!0,correlationId:r})}warning(e,r){this.logMessage(e,{logLevel:_f.Warning,containsPii:!1,correlationId:r})}warningPii(e,r){this.logMessage(e,{logLevel:_f.Warning,containsPii:!0,correlationId:r})}info(e,r){this.logMessage(e,{logLevel:_f.Info,containsPii:!1,correlationId:r})}infoPii(e,r){this.logMessage(e,{logLevel:_f.Info,containsPii:!0,correlationId:r})}verbose(e,r){this.logMessage(e,{logLevel:_f.Verbose,containsPii:!1,correlationId:r})}verbosePii(e,r){this.logMessage(e,{logLevel:_f.Verbose,containsPii:!0,correlationId:r})}trace(e,r){this.logMessage(e,{logLevel:_f.Trace,containsPii:!1,correlationId:r})}tracePii(e,r){this.logMessage(e,{logLevel:_f.Trace,containsPii:!0,correlationId:r})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}};p();var rQ="@azure/msal-common",zM="16.4.1";p();var m3={None:"none",AzurePublic:"https://login.microsoftonline.com",AzurePpe:"https://login.windows-ppe.net",AzureChina:"https://login.chinacloudapi.cn",AzureGermany:"https://login.microsoftonline.de",AzureUsGovernment:"https://login.microsoftonline.us"};p();p();function Cnn(t,e){return!!t&&!!e&&t===e.split(".")[1]}a(Cnn,"tenantIdMatchesHomeTenant");function IY(t,e,r,n){if(n){let{oid:o,sub:s,tid:c,name:l,tfp:u,acr:d,preferred_username:f,upn:h,login_hint:m}=n,g=c||u||d||"";return{tenantId:g,localAccountId:o||s||"",name:l,username:f||h||"",loginHint:m,isHomeTenant:Cnn(g,t)}}else return{tenantId:r,localAccountId:e,username:"",isHomeTenant:Cnn(r,t)}}a(IY,"buildTenantProfile");function wHe(t,e,r,n){let o=t;if(e){let{isHomeTenant:s,...c}=e;o={...t,...c}}if(r){let{isHomeTenant:s,...c}=IY(t.homeAccountId,t.localAccountId,t.tenantId,r);return o={...o,...c,idTokenClaims:r,idToken:n},o}return o}a(wHe,"updateAccountTenantProfileData");var RHe={};Ri(RHe,{checkMaxAge:()=>iTe,extractTokenClaims:()=>g3,getJWSPayload:()=>bnn,isKmsi:()=>EBt});p();function g3(t,e){let r=bnn(t);try{let n=e(r);return JSON.parse(n)}catch{throw Pt(SHe)}}a(g3,"extractTokenClaims");function EBt(t){if(!t.signin_state)return!1;let e=["kmsi","dvc_dmjd"];return t.signin_state.some(r=>e.includes(r.trim().toLowerCase()))}a(EBt,"isKmsi");function bnn(t){if(!t)throw Pt(HLt);let r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw Pt(SHe);return r[2]}a(bnn,"getJWSPayload");function iTe(t,e){if(e===0||Date.now()-3e5>t+e)throw Pt(YLt)}a(iTe,"checkMaxAge");p();p();var Is=class t{static{a(this,"UrlString")}get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw Cl(OLt);e.includes("#")||(this._urlString=t.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let r=e.toLowerCase();return pu.endsWith(r,"?")?r=r.slice(0,-1):pu.endsWith(r,"?/")&&(r=r.slice(0,-2)),pu.endsWith(r,"/")||(r+="/"),r}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw Cl(Ace)}if(!e.HostNameAndPort||!e.PathSegments)throw Cl(Ace);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw Cl(MLt)}static appendQueryString(e,r){return r?e.indexOf("?")<0?`${e}?${r}`:`${e}&${r}`:e}static removeHashFromUrl(e){return t.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){let r=this.getUrlComponents(),n=r.PathSegments;return e&&n.length!==0&&(n[0]===vP.COMMON||n[0]===vP.ORGANIZATIONS)&&(n[0]=e),t.constructAuthorityUriFromObject(r)}getUrlComponents(){let e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=this.urlString.match(e);if(!r)throw Cl(Ace);let n={Protocol:r[1],HostNameAndPort:r[4],AbsolutePath:r[5],QueryString:r[7]},o=n.AbsolutePath.split("/");return o=o.filter(s=>s&&s.length>0),n.PathSegments=o,n.QueryString&&n.QueryString.endsWith("/")&&(n.QueryString=n.QueryString.substring(0,n.QueryString.length-1)),n}static getDomainFromUrl(e){let r=RegExp("^([^:/?#]+://)?([^/?#]*)"),n=e.match(r);if(!n)throw Cl(Ace);return n[2]}static getAbsoluteUrl(e,r){if(e[0]===lce){let o=new t(r).getUrlComponents();return o.Protocol+"//"+o.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new t(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}};var WIo=[{host:"login.microsoftonline.com"},{host:"login.chinacloudapi.cn",issuerHost:"login.partner.microsoftonline.cn"},{host:"login.microsoftonline.us"},{host:"login.sovcloud-identity.fr"},{host:"login.sovcloud-identity.de"},{host:"login.sovcloud-identity.sg"}];function zIo(t,e){return{token_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/token`,jwks_uri:`https://${t}/{tenantid}/discovery/v2.0/keys`,issuer:`https://${e}/{tenantid}/v2.0`,authorization_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/authorize`,end_session_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/logout`}}a(zIo,"buildOpenIdConfig");var YIo=WIo.reduce((t,{host:e,issuerHost:r})=>(t[e]=zIo(e,r||e),t),{}),Tnn={endpointMetadata:YIo,instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]},{preferred_network:"login.sovcloud-identity.fr",preferred_cache:"login.sovcloud-identity.fr",aliases:["login.sovcloud-identity.fr"]},{preferred_network:"login.sovcloud-identity.de",preferred_cache:"login.sovcloud-identity.de",aliases:["login.sovcloud-identity.de"]},{preferred_network:"login.sovcloud-identity.sg",preferred_cache:"login.sovcloud-identity.sg",aliases:["login.sovcloud-identity.sg"]}]}},_Bt=Tnn.endpointMetadata,vBt=Tnn.instanceDiscoveryMetadata,CBt=new Set;vBt.metadata.forEach(t=>{t.aliases.forEach(e=>{CBt.add(e)})});function Inn(t,e,r){let n,o=t.canonicalAuthority;if(o){let s=new Is(o).getUrlComponents().HostNameAndPort;n=Snn(e,r,s,t.cloudDiscoveryMetadata?.metadata,rE.CONFIG)||Snn(e,r,s,vBt.metadata,rE.HARDCODED_VALUES)||t.knownAuthorities}return n||[]}a(Inn,"getAliasesFromStaticSources");function Snn(t,e,r,n,o){if(t.trace(`getAliasesFromMetadata called with source: '${o}'`,e),r&&n){let s=oTe(n,r);if(s)return t.trace(`getAliasesFromMetadata: found cloud discovery metadata in '${o}', returning aliases`,e),s.aliases;t.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in '${o}'`,e)}return null}a(Snn,"getAliasesFromMetadata");function xnn(t){return oTe(vBt.metadata,t)}a(xnn,"getCloudDiscoveryMetadataFromHardcodedValues");function oTe(t,e){for(let r=0;rbBt,createAccountEntityFromAccountInfo:()=>ZIo,generateAccountId:()=>KIo,generateHomeAccountId:()=>SBt,getAccountInfo:()=>bce,isAccountEntity:()=>XIo,isSingleTenant:()=>JIo});p();p();function Cce(t,e){if(!t)throw Pt(jLt);try{let r=e(t);return JSON.parse(r)}catch{throw Pt(bHe)}}a(Cce,"buildClientInfo");function YM(t){if(!t)throw Pt(bHe);let e=t.split(fce,2);return{uid:e[0],utid:e.length<2?"":e[1]}}a(YM,"buildClientInfoFromHomeAccountId");p();var Px={Default:0,Adfs:1,Dsts:2,Ciam:3};p();function kHe(t){return t&&(t.tid||t.tfp||t.acr)||null}a(kHe,"getTenantIdFromIdTokenClaims");p();var nE={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};function KIo(t){return[t.homeAccountId,t.environment].join(pY).toLowerCase()}a(KIo,"generateAccountId");function bce(t){let e=t.tenantProfiles||[];return e.length===0&&t.realm&&t.localAccountId&&e.push(IY(t.homeAccountId,t.localAccountId,t.realm)),{homeAccountId:t.homeAccountId,environment:t.environment,tenantId:t.realm,username:t.username,localAccountId:t.localAccountId,loginHint:t.loginHint,name:t.name,nativeAccountId:t.nativeAccountId,authorityType:t.authorityType,tenantProfiles:new Map(e.map(r=>[r.tenantId,r])),dataBoundary:t.dataBoundary}}a(bce,"getAccountInfo");function JIo(t){return!t.tenantProfiles}a(JIo,"isSingleTenant");function bBt(t,e,r){let n;e.authorityType===Px.Adfs?n=N4t:e.protocolMode===nE.OIDC?n=dHe:n=D4t;let o,s;t.clientInfo&&r&&(o=Cce(t.clientInfo,r),o.xms_tdbr&&(s=o.xms_tdbr==="EU"?"EU":"None"));let c=t.environment||e&&e.getPreferredCache();if(!c)throw Pt(GSe);let l=t.idTokenClaims?.preferred_username||t.idTokenClaims?.upn,u=t.idTokenClaims?.emails?t.idTokenClaims.emails[0]:null,d=l||u||"",f=t.idTokenClaims?.login_hint,h=o?.utid||kHe(t.idTokenClaims)||"",m=o?.uid||t.idTokenClaims?.oid||t.idTokenClaims?.sub||"",g;return t.tenantProfiles?g=t.tenantProfiles:g=[IY(t.homeAccountId,m,h,t.idTokenClaims)],{homeAccountId:t.homeAccountId,environment:c,realm:h,localAccountId:m,username:d,authorityType:n,loginHint:f,clientInfo:t.clientInfo,name:t.idTokenClaims?.name||"",lastModificationTime:void 0,lastModificationApp:void 0,cloudGraphHostName:t.cloudGraphHostName,msGraphHost:t.msGraphHost,nativeAccountId:t.nativeAccountId,tenantProfiles:g,dataBoundary:s}}a(bBt,"createAccountEntity");function ZIo(t,e,r){let n=Array.from(t.tenantProfiles?.values()||[]);return n.length===0&&t.tenantId&&t.localAccountId&&n.push(IY(t.homeAccountId,t.localAccountId,t.tenantId,t.idTokenClaims)),{authorityType:t.authorityType||dHe,homeAccountId:t.homeAccountId,localAccountId:t.localAccountId,nativeAccountId:t.nativeAccountId,realm:t.tenantId,environment:t.environment,username:t.username,loginHint:t.loginHint,name:t.name,cloudGraphHostName:e,msGraphHost:r,tenantProfiles:n,dataBoundary:t.dataBoundary}}a(ZIo,"createAccountEntityFromAccountInfo");function SBt(t,e,r,n,o,s){if(!(e===Px.Adfs||e===Px.Dsts)){if(t)try{let c=Cce(t,n.base64Decode);if(c.uid&&c.utid)return`${c.uid}.${c.utid}`}catch{}r.warning("No client info in response",o)}return s?.sub||""}a(SBt,"generateHomeAccountId");function XIo(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("localAccountId")&&t.hasOwnProperty("username")&&t.hasOwnProperty("authorityType"):!1}a(XIo,"isAccountEntity");var nQ=class{static{a(this,"CacheManager")}constructor(e,r,n,o,s){this.clientId=e,this.cryptoImpl=r,this.commonLogger=n.clone(rQ,zM),this.staticAuthorityOptions=s,this.performanceClient=o}getAllAccounts(e={},r){return this.buildTenantProfiles(this.getAccountsFilteredBy(e,r),r,e)}getAccountInfoFilteredBy(e,r){if(Object.keys(e).length===0||Object.values(e).every(o=>o==null||o===""))return this.commonLogger.warning("getAccountInfoFilteredBy: Account filter is empty or invalid, returning null",r),null;let n=this.getAllAccounts(e,r);return n.length>1?n.sort(s=>s.idTokenClaims?-1:1)[0]:n.length===1?n[0]:null}getBaseAccountInfo(e,r){let n=this.getAccountsFilteredBy(e,r);return n.length>0?bce(n[0]):null}buildTenantProfiles(e,r,n){return e.flatMap(o=>this.getTenantProfilesFromAccountEntity(o,r,n?.tenantId,n))}getTenantedAccountInfoByFilter(e,r,n,o,s){let c=null,l;if(s&&!this.tenantProfileMatchesFilter(n,s))return null;let u=this.getIdToken(e,o,r,n.tenantId);return u&&(l=g3(u.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(l,s))?null:(c=wHe(e,n,l,u?.secret),c)}getTenantProfilesFromAccountEntity(e,r,n,o){let s=bce(e),c=s.tenantProfiles||new Map,l=this.getTokenKeys();if(n){let d=c.get(n);if(d)c=new Map([[n,d]]);else return[]}let u=[];return c.forEach(d=>{let f=this.getTenantedAccountInfoByFilter(s,l,d,r,o);f&&u.push(f)}),u}tenantProfileMatchesFilter(e,r){return!(r.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,r.localAccountId)||r.name&&e.name!==r.name||r.isHomeTenant!==void 0&&e.isHomeTenant!==r.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,r){return!(r&&(r.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,r.localAccountId)||r.loginHint&&!this.matchLoginHintFromTokenClaims(e,r.loginHint)||r.username&&!this.matchUsername(e.preferred_username,r.username)||r.name&&!this.matchName(e,r.name)||r.sid&&!this.matchSid(e,r.sid)))}async saveCacheRecord(e,r,n,o,s){if(!e)throw Pt(eBt);try{e.account&&await this.setAccount(e.account,r,n,o),e.idToken&&s?.idToken!==!1&&await this.setIdTokenCredential(e.idToken,r,n),e.accessToken&&s?.accessToken!==!1&&await this.saveAccessToken(e.accessToken,r,n),e.refreshToken&&s?.refreshToken!==!1&&await this.setRefreshTokenCredential(e.refreshToken,r,n),e.appMetadata&&this.setAppMetadata(e.appMetadata,r)}catch(c){throw this.commonLogger?.error("CacheManager.saveCacheRecord: failed",r),c instanceof Fo?c:knn(c)}}async saveAccessToken(e,r,n){let o={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType},s=this.getTokenKeys(),c=jh.fromString(e.target);s.accessToken.forEach(l=>{if(!this.accessTokenKeyMatchesFilter(l,o,!1))return;let u=this.getAccessTokenCredential(l,r);u&&this.credentialMatchesFilter(u,o,r)&&jh.fromString(u.target).intersectingScopeSets(c)&&this.removeAccessToken(l,r)}),await this.setAccessTokenCredential(e,r,n)}getAccountsFilteredBy(e,r){let n=this.getAccountKeys(),o=[];return n.forEach(s=>{let c=this.getAccount(s,r);if(!c||e.homeAccountId&&!this.matchHomeAccountId(c,e.homeAccountId)||e.username&&!this.matchUsername(c.username,e.username)||e.environment&&!this.matchEnvironment(c,e.environment,r)||e.realm&&!this.matchRealm(c,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(c,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(c,e.authorityType))return;let l={localAccountId:e?.localAccountId,name:e?.name},u=c.tenantProfiles?.filter(d=>this.tenantProfileMatchesFilter(d,l));u&&u.length===0||o.push(c)}),o}credentialMatchesFilter(e,r,n){return!(r.clientId&&!this.matchClientId(e,r.clientId)||r.userAssertionHash&&!this.matchUserAssertionHash(e,r.userAssertionHash)||typeof r.homeAccountId=="string"&&!this.matchHomeAccountId(e,r.homeAccountId)||r.environment&&!this.matchEnvironment(e,r.environment,n)||r.realm&&!this.matchRealm(e,r.realm)||r.credentialType&&!this.matchCredentialType(e,r.credentialType)||r.familyId&&!this.matchFamilyId(e,r.familyId)||r.target&&!this.matchTarget(e,r.target)||e.credentialType===s0.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(r.tokenType&&!this.matchTokenType(e,r.tokenType)||r.tokenType===Ef.SSH&&r.keyId&&!this.matchKeyId(e,r.keyId)))}getAppMetadataFilteredBy(e,r){let n=this.getKeys(),o={};return n.forEach(s=>{if(!this.isAppMetadata(s))return;let c=this.getAppMetadata(s,r);c&&(e.environment&&!this.matchEnvironment(c,e.environment,r)||e.clientId&&!this.matchClientId(c,e.clientId)||(o[s]=c))}),o}getAuthorityMetadataByAlias(e,r){let n=this.getAuthorityMetadataKeys(),o=null;return n.forEach(s=>{if(!this.isAuthorityMetadata(s)||s.indexOf(this.clientId)===-1)return;let c=this.getAuthorityMetadata(s,r);c&&c.aliases.indexOf(e)!==-1&&(o=c)}),o}removeAllAccounts(e){this.getAllAccounts({},e).forEach(n=>{this.removeAccount(n,e)})}removeAccount(e,r){this.removeAccountContext(e,r);let n=this.getAccountKeys(),o=a(s=>s.includes(e.homeAccountId)&&s.includes(e.environment),"keyFilter");n.filter(o).forEach(s=>{this.removeItem(s,r),this.performanceClient.incrementFields({accountsRemoved:1},r)})}removeAccountContext(e,r){let n=this.getTokenKeys(),o=a(s=>s.includes(e.homeAccountId)&&s.includes(e.environment),"keyFilter");n.idToken.filter(o).forEach(s=>{this.removeIdToken(s,r)}),n.accessToken.filter(o).forEach(s=>{this.removeAccessToken(s,r)}),n.refreshToken.filter(o).forEach(s=>{this.removeRefreshToken(s,r)})}removeAccessToken(e,r){let n=this.getAccessTokenCredential(e,r);if(n&&(this.removeItem(e,r),this.performanceClient.incrementFields({accessTokensRemoved:1},r),n.credentialType.toLowerCase()===s0.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&n.tokenType===Ef.POP)){let s=n.keyId;s&&this.cryptoImpl.removeTokenBindingKey(s,r).catch(()=>{this.commonLogger.error(`Failed to remove token binding key '${s}'`,r),this.performanceClient?.incrementFields({removeTokenBindingKeyFailure:1},r)})}}removeAppMetadata(e){return this.getKeys().forEach(n=>{this.isAppMetadata(n)&&this.removeItem(n,e)}),!0}getIdToken(e,r,n,o){this.commonLogger.trace("CacheManager - getIdToken called",r);let s={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:s0.ID_TOKEN,clientId:this.clientId,realm:o},c=this.getIdTokensByFilter(s,r,n),l=c.size;if(l<1)return this.commonLogger.info("CacheManager:getIdToken - No token found",r),null;if(l>1){let u=c;if(!o){let d=new Map;c.forEach((h,m)=>{h.realm===e.tenantId&&d.set(m,h)});let f=d.size;if(f<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result",r),c.values().next().value;if(f===1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile",r),d.values().next().value;u=d}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them",r),u.forEach((d,f)=>{this.removeIdToken(f,r)}),this.performanceClient.addFields({multiMatchedID:c.size},r),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token",r),c.values().next().value}getIdTokensByFilter(e,r,n){let o=n&&n.idToken||this.getTokenKeys().idToken,s=new Map;return o.forEach(c=>{if(!this.idTokenKeyMatchesFilter(c,{clientId:this.clientId,...e}))return;let l=this.getIdTokenCredential(c,r);l&&this.credentialMatchesFilter(l,e,r)&&s.set(c,l)}),s}idTokenKeyMatchesFilter(e,r){let n=e.toLowerCase();return!(r.clientId&&n.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&n.indexOf(r.homeAccountId.toLowerCase())===-1)}removeIdToken(e,r){this.removeItem(e,r)}removeRefreshToken(e,r){this.removeItem(e,r)}getAccessToken(e,r,n,o){let s=r.correlationId;this.commonLogger.trace("CacheManager - getAccessToken called",s);let c=jh.createSearchScopes(r.scopes),l=r.authenticationScheme||Ef.BEARER,u=l&&l.toLowerCase()!==Ef.BEARER.toLowerCase()?s0.ACCESS_TOKEN_WITH_AUTH_SCHEME:s0.ACCESS_TOKEN,d={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:u,clientId:this.clientId,realm:o||e.tenantId,target:c,tokenType:l,keyId:r.sshKid},f=n&&n.accessToken||this.getTokenKeys().accessToken,h=[];f.forEach(g=>{if(this.accessTokenKeyMatchesFilter(g,d,!0)){let A=this.getAccessTokenCredential(g,s);A&&this.credentialMatchesFilter(A,d,s)&&h.push(A)}});let m=h.length;return m<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found",s),null):m>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them",s),h.forEach(g=>{this.removeAccessToken(this.generateCredentialKey(g),s)}),this.performanceClient.addFields({multiMatchedAT:h.length},s),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token",s),h[0])}accessTokenKeyMatchesFilter(e,r,n){let o=e.toLowerCase();if(r.clientId&&o.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&o.indexOf(r.homeAccountId.toLowerCase())===-1||r.realm&&o.indexOf(r.realm.toLowerCase())===-1)return!1;if(r.target){let s=r.target.asArray();for(let c=0;c{if(!this.accessTokenKeyMatchesFilter(s,e,!0))return;let c=this.getAccessTokenCredential(s,r);c&&this.credentialMatchesFilter(c,e,r)&&o.push(c)}),o}getRefreshToken(e,r,n,o){this.commonLogger.trace("CacheManager - getRefreshToken called",n);let s=r?hY:void 0,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:s0.REFRESH_TOKEN,clientId:this.clientId,familyId:s},l=o&&o.refreshToken||this.getTokenKeys().refreshToken,u=[];l.forEach(f=>{if(this.refreshTokenKeyMatchesFilter(f,c)){let h=this.getRefreshTokenCredential(f,n);h&&this.credentialMatchesFilter(h,c,n)&&u.push(h)}});let d=u.length;return d<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found.",n),null):(d>1&&this.performanceClient.addFields({multiMatchedRT:d},n),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token",n),u[0])}refreshTokenKeyMatchesFilter(e,r){let n=e.toLowerCase();return!(r.familyId&&n.indexOf(r.familyId.toLowerCase())===-1||!r.familyId&&r.clientId&&n.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&n.indexOf(r.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e,r){let n={environment:e,clientId:this.clientId},o=this.getAppMetadataFilteredBy(n,r),s=Object.keys(o).map(l=>o[l]),c=s.length;if(c<1)return null;if(c>1)throw Pt(KLt);return s[0]}isAppMetadataFOCI(e,r){let n=this.readAppMetadataFromCache(e,r);return!!(n&&n.familyId===hY)}matchHomeAccountId(e,r){return typeof e.homeAccountId=="string"&&r===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,r){let n=e.oid||e.sub;return r===n}matchLocalAccountIdFromTenantProfile(e,r){return e.localAccountId===r}matchName(e,r){return r.toLowerCase()===e.name?.toLowerCase()}matchUsername(e,r){return!!(e&&typeof e=="string"&&r?.toLowerCase()===e.toLowerCase())}matchUserAssertionHash(e,r){return!!(e.userAssertionHash&&r===e.userAssertionHash)}matchEnvironment(e,r,n){if(this.staticAuthorityOptions){let s=Inn(this.staticAuthorityOptions,this.commonLogger,n);if(s.includes(r)&&s.includes(e.environment))return!0}let o=this.getAuthorityMetadataByAlias(r,n);return!!(o&&o.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,r){return e.credentialType&&r.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,r){return!!(e.clientId&&r===e.clientId)}matchFamilyId(e,r){return!!(e.familyId&&r===e.familyId)}matchRealm(e,r){return e.realm?.toLowerCase()===r.toLowerCase()}matchNativeAccountId(e,r){return!!(e.nativeAccountId&&r===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,r){return e.login_hint===r||e.preferred_username===r||e.upn===r}matchSid(e,r){return e.sid===r}matchAuthorityType(e,r){return!!(e.authorityType&&r.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,r){return e.credentialType!==s0.ACCESS_TOKEN&&e.credentialType!==s0.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:jh.fromString(e.target).containsScopeSet(r)}matchTokenType(e,r){return!!(e.tokenType&&e.tokenType===r)}matchKeyId(e,r){return!!(e.keyId&&e.keyId===r)}isAppMetadata(e){return e.indexOf(pce)!==-1}isAuthorityMetadata(e){return e.indexOf(hce)!==-1}generateAuthorityMetadataCacheKey(e){return`${hce}-${this.clientId}-${e}`}static toObject(e,r){for(let n in r)e[n]=r[n];return e}},aTe=class extends nQ{static{a(this,"DefaultStorageClass")}async setAccount(){throw Pt(Ts)}getAccount(){throw Pt(Ts)}async setIdTokenCredential(){throw Pt(Ts)}getIdTokenCredential(){throw Pt(Ts)}async setAccessTokenCredential(){throw Pt(Ts)}getAccessTokenCredential(){throw Pt(Ts)}async setRefreshTokenCredential(){throw Pt(Ts)}getRefreshTokenCredential(){throw Pt(Ts)}setAppMetadata(){throw Pt(Ts)}getAppMetadata(){throw Pt(Ts)}setServerTelemetry(){throw Pt(Ts)}getServerTelemetry(){throw Pt(Ts)}setAuthorityMetadata(){throw Pt(Ts)}getAuthorityMetadata(){throw Pt(Ts)}getAuthorityMetadataKeys(){throw Pt(Ts)}setThrottlingCache(){throw Pt(Ts)}getThrottlingCache(){throw Pt(Ts)}removeItem(){throw Pt(Ts)}getKeys(){throw Pt(Ts)}getAccountKeys(){throw Pt(Ts)}getTokenKeys(){throw Pt(Ts)}generateCredentialKey(){throw Pt(Ts)}generateAccountKey(){throw Pt(Ts)}};p();p();var Pnn={NotStarted:0,InProgress:1,Completed:2};var Hh=class{static{a(this,"StubPerformanceClient")}generateId(){return"callback-id"}startMeasurement(e,r){return{end:a(()=>null,"end"),discard:a(()=>{},"discard"),add:a(()=>{},"add"),increment:a(()=>{},"increment"),event:{eventId:this.generateId(),status:Pnn.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:r||""}}}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}};var Dnn={tokenRenewalOffsetSeconds:V4t,preventCorsPreflight:!1},exo={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:_f.Info,correlationId:""},txo={async sendGetRequestAsync(){throw Pt(Ts)},async sendPostRequestAsync(){throw Pt(Ts)}},rxo={sku:h4t,version:zM,cpu:"",os:""},nxo={clientSecret:"",clientAssertion:void 0},ixo={azureCloudInstance:m3.None,tenant:`${NSe}`},oxo={application:{appName:"",appVersion:""}};function A3({authOptions:t,systemOptions:e,loggerOptions:r,storageInterface:n,networkInterface:o,cryptoInterface:s,clientCredentials:c,libraryInfo:l,telemetry:u,serverTelemetryManager:d,persistencePlugin:f,serializableCache:h}){let m={...exo,...r};return{authOptions:sxo(t),systemOptions:{...Dnn,...e},loggerOptions:m,storageInterface:n||new aTe(t.clientId,vce,new a0(m),new Hh),networkInterface:o||txo,cryptoInterface:s||vce,clientCredentials:c||nxo,libraryInfo:{...rxo,...l},telemetry:{...oxo,...u},serverTelemetryManager:d||null,persistencePlugin:f||null,serializableCache:h||null}}a(A3,"buildClientConfiguration");function sxo(t){return{clientCapabilities:[],azureCloudOptions:ixo,instanceAware:!1,isMcp:!1,...t}}a(sxo,"buildAuthOptions");function PHe(t){return t.authOptions.authority.options.protocolMode===nE.OIDC}a(PHe,"isOidcProtocolMode");p();p();var _S=class{static{a(this,"TokenCacheContext")}constructor(e,r){this.cache=e,this.hasChanged=r}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}};var N_={};Ri(N_,{createAccessTokenEntity:()=>xBt,createIdTokenEntity:()=>IBt,createRefreshTokenEntity:()=>wBt,generateAppMetadataKey:()=>mxo,generateAuthorityMetadataExpiresAt:()=>NHe,isAccessTokenEntity:()=>uxo,isAppMetadataEntity:()=>gxo,isAuthorityMetadataEntity:()=>Axo,isAuthorityMetadataExpired:()=>MHe,isCredentialEntity:()=>DHe,isIdTokenEntity:()=>dxo,isRefreshTokenEntity:()=>fxo,isServerTelemetryEntity:()=>pxo,isThrottlingEntity:()=>hxo,updateAuthorityEndpointMetadata:()=>Tce,updateCloudDiscoveryMetadata:()=>lTe});p();var Xu={};Ri(Xu,{delay:()=>lxo,isCacheExpired:()=>cxo,isTokenExpired:()=>Sce,nowSeconds:()=>vS,toDateFromSeconds:()=>cTe,toSecondsFromDate:()=>axo,wasClockTurnedBack:()=>TBt});p();function vS(){return Math.round(new Date().getTime()/1e3)}a(vS,"nowSeconds");function axo(t){return t.getTime()/1e3}a(axo,"toSecondsFromDate");function cTe(t){return t?new Date(Number(t)*1e3):new Date}a(cTe,"toDateFromSeconds");function Sce(t,e){let r=Number(t)||0;return vS()+e>r}a(Sce,"isTokenExpired");function cxo(t,e){let r=Number(t)+e*24*60*60*1e3;return Date.now()>r}a(cxo,"isCacheExpired");function TBt(t){return Number(t)>vS()}a(TBt,"wasClockTurnedBack");function lxo(t,e){return new Promise(r=>setTimeout(()=>r(e),t))}a(lxo,"delay");function IBt(t,e,r,n,o){return{credentialType:s0.ID_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,realm:o,lastUpdatedAt:Date.now().toString()}}a(IBt,"createIdTokenEntity");function xBt(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={homeAccountId:t,credentialType:s0.ACCESS_TOKEN,secret:r,cachedAt:vS().toString(),expiresOn:c.toString(),extendedExpiresOn:l.toString(),environment:e,clientId:n,realm:o,target:s,tokenType:f||Ef.BEARER,lastUpdatedAt:Date.now().toString()};if(h&&(g.userAssertionHash=h),d&&(g.refreshOn=d.toString()),g.tokenType?.toLowerCase()!==Ef.BEARER.toLowerCase())switch(g.credentialType=s0.ACCESS_TOKEN_WITH_AUTH_SCHEME,g.tokenType){case Ef.POP:let A=g3(r,u);if(!A?.cnf?.kid)throw Pt(rBt);g.keyId=A.cnf.kid;break;case Ef.SSH:g.keyId=m}return g}a(xBt,"createAccessTokenEntity");function wBt(t,e,r,n,o,s,c){let l={credentialType:s0.REFRESH_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,lastUpdatedAt:Date.now().toString()};return s&&(l.userAssertionHash=s),o&&(l.familyId=o),c&&(l.expiresOn=c.toString()),l}a(wBt,"createRefreshTokenEntity");function DHe(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}a(DHe,"isCredentialEntity");function uxo(t){return t?DHe(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===s0.ACCESS_TOKEN||t.credentialType===s0.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}a(uxo,"isAccessTokenEntity");function dxo(t){return t?DHe(t)&&t.hasOwnProperty("realm")&&t.credentialType===s0.ID_TOKEN:!1}a(dxo,"isIdTokenEntity");function fxo(t){return t?DHe(t)&&t.credentialType===s0.REFRESH_TOKEN:!1}a(fxo,"isRefreshTokenEntity");function pxo(t,e){let r=t.indexOf(BSe)===0,n=!0;return e&&(n=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),r&&n}a(pxo,"isServerTelemetryEntity");function hxo(t,e){let r=!1;t&&(r=t.indexOf(FSe)===0);let n=!0;return e&&(n=e.hasOwnProperty("throttleTime")),r&&n}a(hxo,"isThrottlingEntity");function mxo({environment:t,clientId:e}){return[pce,t,e].join(pY).toLowerCase()}a(mxo,"generateAppMetadataKey");function gxo(t,e){return e?t.indexOf(pce)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}a(gxo,"isAppMetadataEntity");function Axo(t,e){return e?t.indexOf(hce)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}a(Axo,"isAuthorityMetadataEntity");function NHe(){return vS()+O4t}a(NHe,"generateAuthorityMetadataExpiresAt");function Tce(t,e,r){t.authorization_endpoint=e.authorization_endpoint,t.token_endpoint=e.token_endpoint,t.end_session_endpoint=e.end_session_endpoint,t.issuer=e.issuer,t.endpointsFromNetwork=r,t.jwks_uri=e.jwks_uri}a(Tce,"updateAuthorityEndpointMetadata");function lTe(t,e,r){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=r}a(lTe,"updateCloudDiscoveryMetadata");function MHe(t){return t.expiresAt<=vS()}a(MHe,"isAuthorityMetadataExpired");p();p();var Nnn="networkClientSendPostRequestAsync",Mnn="refreshTokenClientExecutePostToTokenEndpoint",Onn="authorizationCodeClientExecutePostToTokenEndpoint",Lnn="refreshTokenClientExecuteTokenRequest",Bnn="refreshTokenClientAcquireToken",OHe="refreshTokenClientAcquireTokenWithCachedRefreshToken",Fnn="refreshTokenClientCreateTokenRequestBody",Unn="silentFlowClientGenerateResultFromCacheRecord";var Qnn="authClientExecuteTokenRequest",qnn="authClientCreateTokenRequestBody",jnn="updateTokenEndpointAuthority",Ice="popTokenGenerateCnf",LHe="handleServerTokenResponse",Hnn="authorityResolveEndpointsAsync",Gnn="authorityGetCloudDiscoveryMetadataFromNetwork",$nn="authorityUpdateCloudDiscoveryMetadata",Vnn="authorityGetEndpointMetadataFromNetwork",Wnn="authorityUpdateEndpointMetadata",RBt="authorityUpdateMetadataWithRegionalInformation",znn="regionDiscoveryDetectRegion",kBt="regionDiscoveryGetRegionFromIMDS",Ynn="regionDiscoveryGetCurrentVersion",Knn="cacheManagerGetRefreshToken";p();var Jnn=a((t,e,r,n,o)=>(...s)=>{r.trace(`Executing function '${e}'`,o);let c=n.startMeasurement(e,o);o&&n.incrementFields({[`ext.${e}CallCount`]:1},o);try{let l=t(...s);return c.end({success:!0}),r.trace(`Returning result from '${e}'`,o),l}catch(l){r.trace(`Error occurred in '${e}'`,o);try{r.trace(JSON.stringify(l),o)}catch{r.trace("Unable to print error message.",o)}throw c.end({success:!1},l),l}},"invoke"),Js=a((t,e,r,n,o)=>(...s)=>{r.trace(`Executing function '${e}'`,o);let c=n.startMeasurement(e,o);return o&&n.incrementFields({[`ext.${e}CallCount`]:1},o),t(...s).then(l=>(r.trace(`Returning result from '${e}'`,o),c.end({success:!0}),l)).catch(l=>{r.trace(`Error occurred in '${e}'`,o);try{r.trace(JSON.stringify(l),o)}catch{r.trace("Unable to print error message.",o)}throw c.end({success:!1},l),l})},"invokeAsync");var yxo={SW:"sw"},iQ=class{static{a(this,"PopTokenGenerator")}constructor(e,r){this.cryptoUtils=e,this.performanceClient=r}async generateCnf(e,r){let n=await Js(this.generateKid.bind(this),Ice,r,this.performanceClient,e.correlationId)(e),o=this.cryptoUtils.base64UrlEncode(JSON.stringify(n));return{kid:n.kid,reqCnfString:o}}async generateKid(e){return{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:yxo.SW}}async signPopToken(e,r,n){return this.signPayload(e,r,n)}async signPayload(e,r,n,o){let{resourceRequestMethod:s,resourceRequestUri:c,shrClaims:l,shrNonce:u,shrOptions:d}=n,h=(c?new Is(c):void 0)?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:vS(),m:s?.toUpperCase(),u:h?.HostNameAndPort,nonce:u||this.cryptoUtils.createNewGuid(),p:h?.AbsolutePath,q:h?.QueryString?[[],h.QueryString]:void 0,client_claims:l||void 0,...o},r,d,n.correlationId)}};p();var FHe={};Ri(FHe,{badToken:()=>uTe,consentRequired:()=>MBt,interactionRequired:()=>NBt,interruptedUser:()=>LBt,loginRequired:()=>OBt,nativeAccountUnavailable:()=>Exo,noTokensFound:()=>BHe,refreshTokenExpired:()=>PBt,uxNotAllowed:()=>DBt});p();var BHe="no_tokens_found",Exo="native_account_unavailable",PBt="refresh_token_expired",DBt="ux_not_allowed",NBt="interaction_required",MBt="consent_required",OBt="login_required",uTe="bad_token",LBt="interrupted_user";var Znn=[NBt,MBt,OBt,uTe,DBt,LBt],_xo=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed","interrupted_user"],CS=class t extends Fo{static{a(this,"InteractionRequiredAuthError")}constructor(e,r,n,o,s,c,l,u){super(e,r,n),Object.setPrototypeOf(this,t.prototype),this.timestamp=o||"",this.traceId=s||"",this.correlationId=c||"",this.claims=l||"",this.name="InteractionRequiredAuthError",this.errorNo=u}};function UHe(t,e,r){let n=!!t&&Znn.indexOf(t)>-1,o=!!r&&_xo.indexOf(r)>-1,s=!!e&&Znn.some(c=>e.indexOf(c)>-1);return n||s||o}a(UHe,"isInteractionRequiredError");function QHe(t,e){return new CS(t,e)}a(QHe,"createInteractionRequiredAuthError");p();var M_=class t extends Fo{static{a(this,"ServerError")}constructor(e,r,n,o,s){super(e,r,n),this.name="ServerError",this.errorNo=o,this.status=s,Object.setPrototypeOf(this,t.prototype)}};p();function Xnn(t,e){if(!t)throw Pt(tBt);if(!e)throw Pt(AY);try{let r=e.split(oHe),n=r[0],o=r.length>1?r.slice(1).join(oHe):"",s=t(n),c=JSON.parse(s);return{userRequestState:o||"",libraryState:c}}catch{throw Pt(AY)}}a(Xnn,"parseRequestState");var Yp=class t{static{a(this,"ResponseHandler")}constructor(e,r,n,o,s,c,l){this.clientId=e,this.cacheStorage=r,this.cryptoObj=n,this.logger=o,this.performanceClient=s,this.serializableCache=c,this.persistencePlugin=l}validateTokenResponse(e,r,n){if(e.error||e.error_description||e.suberror){let o=`Error(s): ${e.error_codes||fY} - Timestamp: ${e.timestamp||fY} - Description: ${e.error_description||fY} - Correlation ID: ${e.correlation_id||fY} - Trace ID: ${e.trace_id||fY}`,s=e.error_codes?.length?e.error_codes[0]:void 0,c=new M_(e.error,o,e.suberror,s,e.status);if(n&&e.status&&e.status>=R4t&&e.status<=k4t){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed. +${c}`,r);return}else if(n&&e.status&&e.status>=x4t&&e.status<=w4t){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. +${c}`,r);return}throw UHe(e.error,e.error_description,e.suberror)?new CS(e.error,e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",s):c}}async handleServerTokenResponse(e,r,n,o,s,c,l,u,d,f){let h;if(e.id_token){if(h=g3(e.id_token||"",this.cryptoObj.base64Decode),c&&c.nonce&&h.nonce!==c.nonce)throw Pt(zLt);if(o.maxAge||o.maxAge===0){let y=h.auth_time;if(!y)throw Pt(jSe);iTe(y,o.maxAge)}}this.homeAccountIdentifier=SBt(e.client_info||"",r.authorityType,this.logger,this.cryptoObj,o.correlationId,h);let m;c&&c.state&&(m=Xnn(this.cryptoObj.base64Decode,c.state)),e.key_id=e.key_id||o.sshKid||void 0;let g=this.generateCacheRecord(e,r,n,o,h,l,c),A;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess",o.correlationId),A=new _S(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(A)),u&&!d&&g.account&&this.cacheStorage.getAllAccounts({homeAccountId:g.account.homeAccountId,environment:g.account.environment},o.correlationId).length<1)return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache",o.correlationId),this.performanceClient?.addFields({acntLoggedOut:!0},o.correlationId),await t.generateAuthenticationResult(this.cryptoObj,r,g,!1,o,this.performanceClient,h,m,void 0,f);await this.cacheStorage.saveCacheRecord(g,o.correlationId,EBt(h||{}),s,o.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&A&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess",o.correlationId),await this.persistencePlugin.afterCacheAccess(A))}return t.generateAuthenticationResult(this.cryptoObj,r,g,!1,o,this.performanceClient,h,m,e,f)}generateCacheRecord(e,r,n,o,s,c,l){let u=r.getPreferredCache();if(!u)throw Pt(GSe);let d=kHe(s),f,h;e.id_token&&s&&(f=IBt(this.homeAccountIdentifier,u,e.id_token,this.clientId,d||""),h=ein(this.cacheStorage,r,this.homeAccountIdentifier,this.cryptoObj.base64Decode,o.correlationId,s,e.client_info,u,d,l,void 0,this.logger,this.performanceClient));let m=null;if(e.access_token){let y=e.scope?jh.fromString(e.scope):new jh(o.scopes||[]),E=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,_=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,v=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,b=n+E,T=b+_,w=v&&v>0?n+v:void 0;m=xBt(this.homeAccountIdentifier,u,e.access_token,this.clientId,d||r.tenant||"",y.printScopes(),b,T,this.cryptoObj.base64Decode,w,e.token_type,c,e.key_id);let R=o.resource||null;R&&(m.resource=R)}let g=null;if(e.refresh_token){let y;if(e.refresh_token_expires_in){let E=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;y=n+E,this.performanceClient?.addFields({ntwkRtExpiresOnSeconds:y},o.correlationId)}g=wBt(this.homeAccountIdentifier,u,e.refresh_token,this.clientId,e.foci,c,y)}let A=null;return e.foci&&(A={clientId:this.clientId,environment:u,familyId:e.foci}),{account:h,idToken:f,accessToken:m,refreshToken:g,appMetadata:A}}static async generateAuthenticationResult(e,r,n,o,s,c,l,u,d,f){let h="",m=[],g=null,A,y,E="";if(n.accessToken){if(n.accessToken.tokenType===Ef.POP&&!s.popKid){let T=new iQ(e,c),{secret:w,keyId:R}=n.accessToken;if(!R)throw Pt(oBt);h=await T.signPopToken(w,R,s)}else h=n.accessToken.secret;m=jh.fromString(n.accessToken.target).asArray(),g=cTe(n.accessToken.expiresOn),A=cTe(n.accessToken.extendedExpiresOn),n.accessToken.refreshOn&&(y=cTe(n.accessToken.refreshOn))}n.appMetadata&&(E=n.appMetadata.familyId===hY?hY:"");let _=l?.oid||l?.sub||"",v=l?.tid||"";d?.spa_accountid&&n.account&&(n.account.nativeAccountId=d?.spa_accountid);let b=n.account?wHe(bce(n.account),void 0,l,n.idToken?.secret):null;return{authority:r.canonicalAuthority,uniqueId:_,tenantId:v,scopes:m,account:b,idToken:n?.idToken?.secret||"",idTokenClaims:l||{},accessToken:h,fromCache:o,expiresOn:g,extExpiresOn:A,refreshOn:y,correlationId:s.correlationId,requestId:f||"",familyId:E,tokenType:n.accessToken?.tokenType||"",state:u?u.userRequestState:"",cloudGraphHostName:n.account?.cloudGraphHostName||"",msGraphHost:n.account?.msGraphHost||"",code:d?.spa_code,fromPlatformBroker:!1}}};function ein(t,e,r,n,o,s,c,l,u,d,f,h,m){h?.verbose("setCachedAccount called",o);let g=l||e.getPreferredCache(),A=t.getAccountsFilteredBy({homeAccountId:r,environment:g},o);m?.addFields({cacheMatchedAccounts:A.length},o),A.length>1&&h?.warning("Multiple base accounts matched homeAccountId. Ignoring cached account and creating a new base account.",o);let E=(A.length===1?A[0]:null)||bBt({homeAccountId:r,idTokenClaims:s,clientInfo:c,environment:l,cloudGraphHostName:d?.cloud_graph_host_name,msGraphHost:d?.msgraph_host,nativeAccountId:f},e,n),_=E.tenantProfiles||[],v=u||E.realm;if(v&&!_.find(b=>b.tenantId===v)){let b=IY(r,E.localAccountId,v,s);_.push(b)}return E.tenantProfiles=_,E}a(ein,"buildAccountToCache");p();var O_={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};p();async function L_(t,e,r){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:r})}a(L_,"getClientAssertion");p();function xce(t,e,r){return{clientId:t,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:r,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||e.extraParameters?.clientId}}a(xce,"getRequestThumbprint");var wY={};Ri(wY,{createTokenQueryParameters:()=>pTe,createTokenRequestHeaders:()=>fTe,executePostToTokenEndpoint:()=>hTe,sendPostRequest:()=>tin});p();p();var dTe=class t{static{a(this,"ThrottlingUtils")}static generateThrottlingStorageKey(e){return`${FSe}.${JSON.stringify(e)}`}static preProcess(e,r,n){let o=t.generateThrottlingStorageKey(r),s=e.getThrottlingCache(o,n);if(s){if(s.throttleTime=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(Wp.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){let r=e<=0?0:e,n=Date.now()/1e3;return Math.floor(Math.min(n+(r||q4t),n+j4t)*1e3)}static removeThrottle(e,r,n,o){let s=xce(r,n,o),c=this.generateThrottlingStorageKey(s);e.removeItem(c,n.correlationId)}};p();var wce=class t extends Fo{static{a(this,"NetworkError")}constructor(e,r,n){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,t.prototype),this.name="NetworkError",this.error=e,this.httpStatus=r,this.responseHeaders=n}};function BBt(t,e,r,n){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${n?.name}, error.message:${n?.message}`,new wce(t,e,r)}a(BBt,"createNetworkError");function fTe(t,e,r){let n={};if(n[Wp.CONTENT_TYPE]=_4t,!e&&r)switch(r.type){case O_.HOME_ACCOUNT_ID:try{let o=YM(r.credential);n[Wp.CCS_HEADER]=`Oid:${o.uid}@${o.utid}`}catch(o){t.verbose(`Could not parse home account ID for CCS Header: '${o}'`,"")}break;case O_.UPN:n[Wp.CCS_HEADER]=`UPN: ${r.credential}`;break}return n}a(fTe,"createTokenRequestHeaders");function pTe(t,e,r,n){let o=new Map;return t.embeddedClientId&&h3(o,e,r),t.extraQueryParameters&&p3(o,t.extraQueryParameters),bY(o,t.correlationId),yY(o,t.correlationId,n),WM(o)}a(pTe,"createTokenQueryParameters");async function hTe(t,e,r,n,o,s,c,l,u,d){let f=await tin(n,t,{body:e,headers:r},o,s,c,l,u);return d&&f.status<500&&f.status!==429&&d.clearTelemetryCache(),f}a(hTe,"executePostToTokenEndpoint");async function tin(t,e,r,n,o,s,c,l){dTe.preProcess(o,t,n);let u;try{u=await Js(s.sendPostRequestAsync.bind(s),Nnn,c,l,n)(e,r);let d=u.headers||{};l?.addFields({refreshTokenSize:u.body.refresh_token?.length||0,httpVerToken:d[Wp.X_MS_HTTP_VERSION]||"",requestId:d[Wp.X_MS_REQUEST_ID]||""},n)}catch(d){if(d instanceof wce){let f=d.responseHeaders;throw f&&l?.addFields({httpVerToken:f[Wp.X_MS_HTTP_VERSION]||"",requestId:f[Wp.X_MS_REQUEST_ID]||"",contentTypeHeader:f[Wp.CONTENT_TYPE]||void 0,contentLengthHeader:f[Wp.CONTENT_LENGTH]||void 0,httpStatus:d.httpStatus},n),d.error}throw d instanceof Fo?d:Pt(GLt)}return dTe.postProcess(o,t,u,n),u}a(tin,"sendPostRequest");var jHe={};Ri(jHe,{createDiscoveredInstance:()=>UBt});p();p();p();function rin(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}a(rin,"isOpenIdConfigResponse");p();function nin(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}a(nin,"isCloudInstanceDiscoveryResponse");p();function iin(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}a(iin,"isCloudInstanceDiscoveryErrorResponse");p();var mTe=class t{static{a(this,"RegionDiscovery")}constructor(e,r,n,o){this.networkInterface=e,this.logger=r,this.performanceClient=n,this.correlationId=o}async detectRegion(e,r){let n=e;if(n)r.region_source=X7.ENVIRONMENT_VARIABLE;else{let o=t.IMDS_OPTIONS;try{let s=await Js(this.getRegionFromIMDS.bind(this),kBt,this.logger,this.performanceClient,this.correlationId)(v4t,o);if(s.status===cHe&&(n=s.body,r.region_source=X7.IMDS),s.status===lHe){let c=await Js(this.getCurrentVersion.bind(this),Ynn,this.logger,this.performanceClient,this.correlationId)(o);if(!c)return r.region_source=X7.FAILED_AUTO_DETECTION,null;let l=await Js(this.getRegionFromIMDS.bind(this),kBt,this.logger,this.performanceClient,this.correlationId)(c,o);l.status===cHe&&(n=l.body,r.region_source=X7.IMDS)}}catch{return r.region_source=X7.FAILED_AUTO_DETECTION,null}}return n||(r.region_source=X7.FAILED_AUTO_DETECTION),n||null}async getRegionFromIMDS(e,r){return this.networkInterface.sendGetRequestAsync(`${aHe}?api-version=${e}&format=text`,r,C4t)}async getCurrentVersion(e){try{let r=await this.networkInterface.sendGetRequestAsync(`${aHe}?format=json`,e);return r.status===lHe&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}};mTe.IMDS_OPTIONS={headers:{Metadata:"true"}};var SP=class t{static{a(this,"Authority")}constructor(e,r,n,o,s,c,l,u){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=r,this.cacheManager=n,this.authorityOptions=o,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=s,this.performanceClient=l,this.correlationId=c,this.managedIdentity=u||!1,this.regionDiscovery=new mTe(r,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(iHe))return Px.Ciam;let r=e.PathSegments;if(r.length)switch(r[0].toLowerCase()){case g4t:return Px.Adfs;case A4t:return Px.Dsts}return Px.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new Is(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw Pt(bP)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw Pt(bP)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw Pt(bP)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw Pt(iBt);return this.replacePath(this.metadata.end_session_endpoint)}else throw Pt(bP)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw Pt(bP)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw Pt(bP)}canReplaceTenant(e){return e.PathSegments.length===1&&!t.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===Px.Default&&this.protocolMode!==nE.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let r=e,o=new Is(this.metadata.canonical_authority).getUrlComponents(),s=o.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((l,u)=>{let d=s[u];if(u===0&&this.canReplaceTenant(o)){let f=new Is(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];d!==f&&(this.logger.verbose(`Replacing tenant domain name '${d}' with id '${f}'`,this.correlationId),d=f)}l!==d&&(r=r.replace(`/${d}/`,`/${l}/`))}),this.replaceTenant(r)}get defaultOpenIdConfigurationEndpoint(){let e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===Px.Adfs||this.protocolMode===nE.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){let e=this.getCurrentMetadataEntity(),r=await Js(this.updateCloudDiscoveryMetadata.bind(this),$nn,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);let n=await Js(this.updateEndpointMetadata.bind(this),Wnn,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,r,{source:n}),this.performanceClient?.addFields({cloudDiscoverySource:r,authorityEndpointSource:n},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort,this.correlationId);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:NHe(),jwks_uri:""}),e}updateCachedMetadata(e,r,n){r!==rE.CACHE&&n?.source!==rE.CACHE&&(e.expiresAt=NHe(),e.canonical_authority=this.canonicalAuthority);let o=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache,this.correlationId);this.cacheManager.setAuthorityMetadata(o,e,this.correlationId),this.metadata=e}async updateEndpointMetadata(e){let r=this.updateEndpointMetadataFromLocalSources(e);if(r){if(r.source===rE.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&r.metadata){let o=await Js(this.updateMetadataWithRegionalInformation.bind(this),RBt,this.logger,this.performanceClient,this.correlationId)(r.metadata);Tce(e,o,!1),e.canonical_authority=this.canonicalAuthority}return r.source}let n=await Js(this.getEndpointMetadataFromNetwork.bind(this),Vnn,this.logger,this.performanceClient,this.correlationId)();if(n)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(n=await Js(this.updateMetadataWithRegionalInformation.bind(this),RBt,this.logger,this.performanceClient,this.correlationId)(n)),Tce(e,n,!0),rE.NETWORK;throw Pt($Lt,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration",this.correlationId);let r=this.getEndpointMetadataFromConfig();if(r)return this.logger.verbose("Found endpoint metadata in authority configuration",this.correlationId),Tce(e,r,!1),{source:rE.CONFIG};this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values.",this.correlationId);let n=this.getEndpointMetadataFromHardcodedValues();if(n)return Tce(e,n,!1),{source:rE.HARDCODED_VALUES,metadata:n};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.",this.correlationId);let o=MHe(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!o?(this.logger.verbose("Found endpoint metadata in the cache.",""),{source:rE.CACHE}):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}isAuthoritySameType(e){return new Is(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw Cl(QLt)}return null}async getEndpointMetadataFromNetwork(){let e={},r=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from '${r}'`,this.correlationId);try{let n=await this.networkInterface.sendGetRequestAsync(r,e);return rin(n.body)?n.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration",this.correlationId),null)}catch(n){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: '${n}'`,this.correlationId),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in _Bt?_Bt[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){let r=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(r){if(r!==b4t)return this.regionDiscoveryMetadata.region_outcome=USe.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=r,t.replaceWithRegionalInformation(e,r);let n=await Js(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),znn,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(n)return this.regionDiscoveryMetadata.region_outcome=USe.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=n,t.replaceWithRegionalInformation(e,n);this.regionDiscoveryMetadata.region_outcome=USe.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){let r=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(r)return r;let n=await Js(this.getCloudDiscoveryMetadataFromNetwork.bind(this),Gnn,this.logger,this.performanceClient,this.correlationId)();if(n)return lTe(e,n,!0),rE.NETWORK;throw Cl(qLt)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration",this.correlationId),this.logger.verbosePii(`Known Authorities: '${this.authorityOptions.knownAuthorities||MSe}'`,this.correlationId),this.logger.verbosePii(`Authority Metadata: '${this.authorityOptions.authorityMetadata||MSe}'`,this.correlationId),this.logger.verbosePii(`Canonical Authority: '${e.canonical_authority||MSe}'`,this.correlationId);let r=this.getCloudDiscoveryMetadataFromConfig();if(r)return this.logger.verbose("Found cloud discovery metadata in authority configuration",this.correlationId),lTe(e,r,!1),rE.CONFIG;this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values.",this.correlationId);let n=xnn(this.hostnameAndPort);if(n)return this.logger.verbose("Found cloud discovery metadata from hardcoded values.",this.correlationId),lTe(e,n,!1),rE.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.",this.correlationId);let o=MHe(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!o?(this.logger.verbose("Found cloud discovery metadata in the cache.",""),rE.CACHE):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===Px.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host.",this.correlationId),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.",this.correlationId);try{this.logger.verbose("Attempting to parse the cloud discovery metadata.",this.correlationId);let e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),r=oTe(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata.",""),r)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata.",this.correlationId),r;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.",this.correlationId)}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error.",this.correlationId),Cl(CHe)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host.",this.correlationId),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){let e=`${y4t}${this.canonicalAuthority}oauth2/v2.0/authorize`,r={},n=null;try{let o=await this.networkInterface.sendGetRequestAsync(e,r),s,c;if(nin(o.body))s=o.body,c=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: '${s.tenant_discovery_endpoint}'`,this.correlationId);else if(iin(o.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: '${o.status}'`,this.correlationId),s=o.body,s.error===I4t)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance.",this.correlationId),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is '${s.error}'`,this.correlationId),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is '${s.error_description}'`,this.correlationId),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network, correlationId) to []",this.correlationId),c=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse",this.correlationId),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request.",this.correlationId),n=oTe(c,this.hostnameAndPort)}catch(o){if(o instanceof Fo)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata. Error: '${o.errorCode}' Error Description: '${o.errorMessage}'`,this.correlationId);else{let s=o;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata. Error: '${s.name}' -Error Description: '${s.message}'`,this.correlationId)}return null}return n||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request.",this.correlationId),this.logger.verbose("Creating custom Authority for custom domain scenario.",this.correlationId),n=t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),n}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(r=>r&&Is.getDomainFromUrl(r).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,r){let n;if(r&&r.azureCloudInstance!==l3.None){let o=r.tenant?r.tenant:pSe;n=`${r.azureCloudInstance}/${o}/`}return n||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return G5t;if(this.discoveryComplete())return this.metadata.preferred_cache;throw kt(hP)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return JLt.has(e)}static isPublicCloudAuthority(e){return e4t.indexOf(e)>=0}static buildRegionalAuthorityString(e,r,n){let o=new Is(e);o.validateAsUri();let s=o.getUrlComponents(),c=`${r}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(c=`${r}.${X5t}`);let l=Is.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:c}).urlString;return n?`${l}?${n}`:l}static replaceWithRegionalInformation(e,r){let n={...e};return n.authorization_endpoint=t.buildRegionalAuthorityString(n.authorization_endpoint,r),n.token_endpoint=t.buildRegionalAuthorityString(n.token_endpoint,r),n.end_session_endpoint&&(n.end_session_endpoint=t.buildRegionalAuthorityString(n.end_session_endpoint,r)),n}static transformCIAMAuthority(e){let r=e,o=new Is(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(Dje)){let s=o.HostNameAndPort.split(".")[0];r=`${r}${s}${z5t}`}return r}};mP.reservedTenantDomains=new Set(["{tenant}","{tenantid}",fP.COMMON,fP.CONSUMERS,fP.ORGANIZATIONS]);function Xrn(t){let n=new Is(t).getUrlComponents().PathSegments.slice(-1)[0]?.toLowerCase();switch(n){case fP.COMMON:case fP.ORGANIZATIONS:case fP.CONSUMERS:return;default:return n}}a(Xrn,"getTenantFromAuthorityString");function mHe(t){return t.endsWith(tce)?t:`${t}${tce}`}a(mHe,"formatAuthorityUri");function pBt(t){let e=t.cloudDiscoveryMetadata,r;if(e)try{r=JSON.parse(e)}catch{throw vl(Kje)}return{canonicalAuthority:t.authority?mHe(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:r}}a(pBt,"buildStaticAuthorityOptions");async function hBt(t,e,r,n,o,s,c){let l=mP.transformCIAMAuthority(mHe(t)),u=new mP(l,e,r,n,o,s,c);try{return await Js(u.resolveEndpointsAsync.bind(u),Brn,o,c,s)(),u}catch{throw kt(hP)}}a(hBt,"createDiscoveredInstance");var KSe=class{static{a(this,"AuthorizationCodeClient")}constructor(e,r){this.includeRedirectUri=!0,this.config=d3(e),this.logger=new r0(this.config.loggerOptions,V7,QM),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async acquireToken(e,r,n){if(!e.code)throw kt(ILt);n&&n.cloud_instance_host_name&&await Js(this.updateTokenEndpointAuthority.bind(this),Lrn,this.logger,this.performanceClient,e.correlationId)(n.cloud_instance_host_name,e.correlationId);let o=gS(),s=await Js(this.executeTokenRequest.bind(this),Mrn,this.logger,this.performanceClient,e.correlationId)(this.authority,e,this.serverTelemetryManager),c=s.headers?.[Gp.X_MS_REQUEST_ID],l=new Vp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return l.validateTokenResponse(s.body,e.correlationId),Js(l.handleServerTokenResponse.bind(l),uHe,this.logger,this.performanceClient,e.correlationId)(s.body,this.authority,o,e,r,n,void 0,void 0,void 0,c)}getLogoutUri(e){if(!e)throw vl(pLt);let r=this.createLogoutUrlQueryString(e);return Is.appendQueryString(this.authority.endSessionEndpoint,r)}async executeTokenRequest(e,r,n){let o=WSe(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),s=Is.appendQueryString(e.tokenEndpoint,o),c=await Js(this.createTokenRequestBody.bind(this),Orn,this.logger,this.performanceClient,r.correlationId)(r),l;if(r.clientInfo)try{let f=hce(r.clientInfo,this.cryptoUtils.base64Decode);l={credential:`${f.uid}${ice}${f.utid}`,type:P_.HOME_ACCOUNT_ID}}catch(f){this.logger.verbose(`Could not parse client info for CCS Header: '${f}'`,r.correlationId)}let u=VSe(this.logger,this.config.systemOptions.preventCorsPreflight,l||r.ccsCredential),d=Ece(this.config.authOptions.clientId,r);return Js(zSe,Rrn,this.logger,this.performanceClient,r.correlationId)(s,c,u,d,r.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,n)}async createTokenRequestBody(e){let r=new Map;if(cY(r,e.embeddedClientId||e.extraParameters?.[FM]||this.config.authOptions.clientId),this.includeRedirectUri)lY(r,e.redirectUri);else if(!e.redirectUri)throw vl(cLt);if(aY(r,e.scopes,!0,this.oidcDefaultScopes),BSe(r,e.resource),HLt(r,e.code),TSe(r,this.config.libraryInfo),ISe(r,this.config.telemetry.application),LSe(r),this.serverTelemetryManager&&!oHe(this.config)&&OSe(r,this.serverTelemetryManager),e.codeVerifier&&$Lt(r,e.codeVerifier),this.config.clientCredentials.clientSecret&&wSe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let o=this.config.clientCredentials.clientAssertion;RSe(r,await D_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),kSe(r,o.assertionType)}if(PSe(r,gSe.AUTHORIZATION_CODE_GRANT),fY(r),e.authenticationScheme===hf.POP){let o=new z7(this.cryptoUtils,this.performanceClient),s;e.popKid?s=this.cryptoUtils.encodeKid(e.popKid):s=(await Js(o.generateCnf.bind(o),yce,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,NSe(r,s)}else if(e.authenticationScheme===hf.SSH)if(e.sshJwk)MSe(r,e.sshJwk);else throw vl(vSe);(!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&uY(r,e.claims,this.config.authOptions.clientCapabilities);let n;if(e.clientInfo)try{let o=hce(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${o.uid}${ice}${o.utid}`,type:P_.HOME_ACCOUNT_ID}}catch(o){this.logger.verbose(`Could not parse client info for CCS Header: '${o}'`,e.correlationId)}else n=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&n)switch(n.type){case P_.HOME_ACCOUNT_ID:try{let o=qM(n.credential);s3(r,o)}catch(o){this.logger.verbose(`Could not parse home account ID for CCS Header: '${o}'`,e.correlationId)}break;case P_.UPN:$7(r,n.credential);break}return e.embeddedClientId&&c3(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&a3(r,e.extraParameters),e.enableSpaAuthorizationCode&&(!e.extraParameters||!e.extraParameters[Vje])&&a3(r,{[Vje]:"1"}),sY(r,e.correlationId,this.performanceClient),UM(r)}createLogoutUrlQueryString(e){let r=new Map;return e.postLogoutRedirectUri&&FLt(r,e.postLogoutRedirectUri),e.correlationId&&dY(r,e.correlationId),e.idTokenHint&&ULt(r,e.idTokenHint),e.state&&xSe(r,e.state),e.logoutHint&&WLt(r,e.logoutHint),e.extraQueryParameters&&a3(r,e.extraQueryParameters),this.config.authOptions.instanceAware&&DSe(r),UM(r)}async updateTokenEndpointAuthority(e,r){let n=`https://${e}/${this.authority.tenant}/`,o=await hBt(n,this.networkClient,this.cacheManager,this.authority.options,this.logger,r,this.performanceClient);this.authority=o}};p();var pTo=300,AY=class{static{a(this,"RefreshTokenClient")}constructor(e,r){this.config=d3(e),this.logger=new r0(this.config.loggerOptions,V7,QM),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r}async acquireToken(e,r){let n=gS(),o=await Js(this.executeTokenRequest.bind(this),krn,this.logger,this.performanceClient,e.correlationId)(e,this.authority),s=o.headers?.[Gp.X_MS_REQUEST_ID],c=new Vp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return c.validateTokenResponse(o.body,e.correlationId),Js(c.handleServerTokenResponse.bind(c),uHe,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,n,e,r,void 0,void 0,!0,e.forceCache,s)}async acquireTokenByRefreshToken(e,r){if(!e)throw vl(fLt);if(!e.account)throw kt(bSe);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await Js(this.acquireTokenWithCachedRefreshToken.bind(this),lHe,this.logger,this.performanceClient,e.correlationId)(e,!0,r)}catch(o){let s=o instanceof AS&&o.errorCode===dHe,c=o instanceof k_&&o.errorCode===E4t&&o.subError===_4t;if(s||c)return Js(this.acquireTokenWithCachedRefreshToken.bind(this),lHe,this.logger,this.performanceClient,e.correlationId)(e,!1,r);throw o}return Js(this.acquireTokenWithCachedRefreshToken.bind(this),lHe,this.logger,this.performanceClient,e.correlationId)(e,!1,r)}async acquireTokenWithCachedRefreshToken(e,r,n){let o=$rn(this.cacheManager.getRefreshToken.bind(this.cacheManager),Grn,this.logger,this.performanceClient,e.correlationId)(e.account,r,e.correlationId,void 0);if(!o)throw hHe(dHe);if(o.expiresOn){let c=e.refreshTokenExpirationOffsetSeconds||pTo;if(this.performanceClient?.addFields({cacheRtExpiresOnSeconds:Number(o.expiresOn),rtOffsetSeconds:c},e.correlationId),gce(o.expiresOn,c))throw hHe(sBt)}let s={...e,refreshToken:o.secret,authenticationScheme:e.authenticationScheme||hf.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:P_.HOME_ACCOUNT_ID}};try{return await Js(this.acquireToken.bind(this),Prn,this.logger,this.performanceClient,e.correlationId)(s,n)}catch(c){if(c instanceof AS&&c.subError===GSe){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache",e.correlationId);let l=this.cacheManager.generateCredentialKey(o);this.cacheManager.removeRefreshToken(l,e.correlationId)}throw c}}async executeTokenRequest(e,r){let n=WSe(e,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),o=Is.appendQueryString(r.tokenEndpoint,n),s=await Js(this.createTokenRequestBody.bind(this),Drn,this.logger,this.performanceClient,e.correlationId)(e),c=VSe(this.logger,this.config.systemOptions.preventCorsPreflight,e.ccsCredential),l=Ece(this.config.authOptions.clientId,e);return Js(zSe,wrn,this.logger,this.performanceClient,e.correlationId)(o,s,c,l,e.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,this.serverTelemetryManager)}async createTokenRequestBody(e){let r=new Map;if(cY(r,e.embeddedClientId||e.extraParameters?.[FM]||this.config.authOptions.clientId),e.redirectUri&&lY(r,e.redirectUri),aY(r,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),PSe(r,gSe.REFRESH_TOKEN_GRANT),fY(r),TSe(r,this.config.libraryInfo),ISe(r,this.config.telemetry.application),LSe(r),this.serverTelemetryManager&&!oHe(this.config)&&OSe(r,this.serverTelemetryManager),GLt(r,e.refreshToken),this.config.clientCredentials.clientSecret&&wSe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let n=this.config.clientCredentials.clientAssertion;RSe(r,await D_(n.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),kSe(r,n.assertionType)}if(e.authenticationScheme===hf.POP){let n=new z7(this.cryptoUtils,this.performanceClient),o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await Js(n.generateCnf.bind(n),yce,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,NSe(r,o)}else if(e.authenticationScheme===hf.SSH)if(e.sshJwk)MSe(r,e.sshJwk);else throw vl(vSe);if((!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&uY(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case P_.HOME_ACCOUNT_ID:try{let n=qM(e.ccsCredential.credential);s3(r,n)}catch(n){this.logger.verbose(`Could not parse home account ID for CCS Header: '${n}'`,e.correlationId)}break;case P_.UPN:$7(r,e.ccsCredential.credential);break}return e.embeddedClientId&&c3(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&a3(r,{...e.extraParameters}),sY(r,e.correlationId,this.performanceClient),UM(r)}};p();var JSe=class{static{a(this,"SilentFlowClient")}constructor(e,r){this.config=d3(e),this.logger=new r0(this.config.loggerOptions,V7,QM),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r}async acquireCachedToken(e){let r=pP.NOT_APPLICABLE;if(e.forceRefresh||!fu.isEmptyObj(e.claims))throw this.setCacheOutcome(pP.FORCE_REFRESH_OR_CLAIMS,e.correlationId),kt(dce);if(!e.account)throw kt(bSe);let n=e.account.tenantId||Xrn(e.authority),o=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,o,n);if(s){if(eBt(s.cachedAt)||gce(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(pP.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),kt(dce);if(e.resource){if(s.resource!==e.resource)throw this.setCacheOutcome(pP.NO_CACHED_ACCESS_TOKEN,e.correlationId),kt(dce)}else s.refreshOn&&gce(s.refreshOn,0)&&(r=pP.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(pP.NO_CACHED_ACCESS_TOKEN,e.correlationId),kt(dce);let c=e.authority||this.authority.getPreferredCache(),l={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:s,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,o,n),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(c,e.correlationId)};return this.setCacheOutcome(r,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Js(this.generateResultFromCacheRecord.bind(this),Nrn,this.logger,this.performanceClient,e.correlationId)(l,e),r]}setCacheOutcome(e,r){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},r),e!==pP.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: '${e}'`,r)}async generateResultFromCacheRecord(e,r){let n;if(e.idToken&&(n=u3(e.idToken.secret,this.config.cryptoInterface.base64Decode)),r.maxAge||r.maxAge===0){let o=n?.auth_time;if(!o)throw kt(CSe);FSe(o,r.maxAge)}return Vp.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,r,this.performanceClient,n)}};var ZSe={};ki(ZSe,{getAuthorizationCodePayload:()=>gTo,getAuthorizeUrl:()=>mTo,getStandardAuthorizeRequestParameters:()=>hTo,validateAuthorizationResponse:()=>enn});p();function hTo(t,e,r,n){let o=e.correlationId,s=new Map;cY(s,e.embeddedClientId||e.extraQueryParameters?.[FM]||t.clientId);let c=[...e.scopes||[],...e.extraScopesToConsent||[]];if(aY(s,c,!0,t.authority.options.OIDCOptions?.defaultScopes),BSe(s,e.resource),lY(s,e.redirectUri),dY(s,o),BLt(s,e.responseMode),fY(s),VLt(s),e.prompt&&(qLt(s,e.prompt),n?.addFields({prompt:e.prompt},o)),e.domainHint&&(QLt(s,e.domainHint),n?.addFields({domainHintFromRequest:!0},o)),e.prompt!==mSe.SELECT_ACCOUNT)if(e.sid&&e.prompt===mSe.NONE)r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request",e.correlationId),tHe(s,e.sid),n?.addFields({sidFromRequest:!0},o);else if(e.account){let l=yTo(e.account),u=ETo(e.account);if(u&&e.domainHint&&(r.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint',e.correlationId),u=null),u){r.verbose("createAuthCodeUrlQueryString: login_hint claim present on account",e.correlationId),fce(s,u),n?.addFields({loginHintFromClaim:!0},o);try{let d=qM(e.account.homeAccountId);s3(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(l&&e.prompt===mSe.NONE){r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account",e.correlationId),tHe(s,l),n?.addFields({sidFromClaim:!0},o);try{let d=qM(e.account.homeAccountId);s3(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(e.loginHint)r.verbose("createAuthCodeUrlQueryString: Adding login_hint from request",e.correlationId),fce(s,e.loginHint),$7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o);else if(e.account.username){r.verbose("createAuthCodeUrlQueryString: Adding login_hint from account",e.correlationId),fce(s,e.account.username),n?.addFields({loginHintFromUpn:!0},o);try{let d=qM(e.account.homeAccountId);s3(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}}else e.loginHint&&(r.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request",e.correlationId),fce(s,e.loginHint),$7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o));else r.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints",e.correlationId);return e.nonce&&jLt(s,e.nonce),e.state&&xSe(s,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&uY(s,e.claims,t.clientCapabilities),e.embeddedClientId&&c3(s,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(ace))&&DSe(s),s}a(hTo,"getStandardAuthorizeRequestParameters");function mTo(t,e){let r=UM(e);return Is.appendQueryString(t.authorizationEndpoint,r)}a(mTo,"getAuthorizeUrl");function gTo(t,e){if(enn(t,e),!t.code)throw kt(DLt);return t}a(gTo,"getAuthorizationCodePayload");function enn(t,e){if(!t.state||!e)throw t.state?kt(Xje,"Cached State"):kt(Xje,"Server State");let r,n;try{r=decodeURIComponent(t.state)}catch{throw kt(oY,t.state)}try{n=decodeURIComponent(e)}catch{throw kt(oY,t.state)}if(r!==n)throw kt(CLt);if(t.error||t.error_description||t.suberror){let o=ATo(t);throw pHe(t.error,t.error_description,t.suberror)?new AS(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",o):new k_(t.error||"",t.error_description,t.suberror,o)}}a(enn,"validateAuthorizationResponse");function ATo(t){let e="code=",r=t.error_uri?.lastIndexOf(e);return r&&r>=0?t.error_uri?.substring(r+e.length):void 0}a(ATo,"parseServerErrorNo");function yTo(t){return t.idTokenClaims?.sid||null}a(yTo,"extractAccountSid");function ETo(t){return t.loginHint||t.idTokenClaims?.login_hint||null}a(ETo,"extractLoginHint");p();function yY(t,e){if(t){if(e.resource&&(tnn(e.extraParameters)||tnn(e.extraQueryParameters)))throw kt(LLt);if(!e.resource)throw kt(OLt)}}a(yY,"enforceResourceParameter");function tnn(t){return t?Object.prototype.hasOwnProperty.call(t,"resource"):!1}a(tnn,"containsResourceParam");var vce={};ki(vce,{postRequestFailed:()=>vTo,unexpectedError:()=>_To});p();var _To="unexpected_error",vTo="post_request_failed";p();var rnn=",",nnn="|";function CTo(t){let{skus:e,libraryName:r,libraryVersion:n,extensionName:o,extensionVersion:s}=t,c=new Map([[0,[r,n]],[2,[o,s]]]),l=[];if(e?.length){if(l=e.split(rnn),l.length<4)return e}else l=Array.from({length:4},()=>nnn);return c.forEach((u,d)=>{u.length===2&&u[0]?.length&&u[1]?.length&&bTo({skuArr:l,index:d,skuName:u[0],skuVersion:u[1]})}),l.join(rnn)}a(CTo,"makeExtraSkuString");function bTo(t){let{skuArr:e,index:r,skuName:n,skuVersion:o}=t;r>=e.length||(e[r]=[n,o].join(nnn))}a(bTo,"setSku");var EY=class t{static{a(this,"ServerTelemetryManager")}constructor(e,r){this.cacheOutcome=pP.NOT_APPLICABLE,this.cacheManager=r,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||"",this.wrapperVer=e.wrapperVer||"",this.telemetryCacheKey=ASe+tY+e.clientId}generateCurrentRequestHeaderValue(){let e=`${this.apiId}${j7}${this.cacheOutcome}`,r=[this.wrapperSKU,this.wrapperVer],n=this.getNativeBrokerErrorCode();n?.length&&r.push(`broker_error=${n}`);let o=r.join(j7),s=this.getRegionDiscoveryFields(),c=[e,s].join(j7);return[Qje,c,o].join(qje)}generateLastRequestHeaderValue(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.failedRequests.slice(0,2*r).join(j7),o=e.errors.slice(0,r).join(j7),s=e.errors.length,c=r=f4t&&(r.failedRequests.shift(),r.failedRequests.shift(),r.errors.shift()),r.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Fo?e.subError?r.errors.push(e.subError):e.errorCode?r.errors.push(e.errorCode):r.errors.push(e.toString()):r.errors.push(e.toString()):r.errors.push(m4t),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r,this.correlationId)}incrementCacheHits(){let e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){let e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey,this.correlationId)||e}clearTelemetryCache(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.errors.length;if(r===n)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{let o={failedRequests:e.failedRequests.slice(r*2),errors:e.errors.slice(r),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o,this.correlationId)}}static maxErrorsToSend(e){let r,n=0,o=0,s=e.errors.length;for(r=0;rJSON.parse(l)),lastUpdatedAt:Date.now().toString()},c={};W7.toObject(c,s),r[n]=c}),r}static deserializeIdTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,realm:o.realm,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeAccessTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,realm:o.realm,target:o.target,cachedAt:o.cached_at,expiresOn:o.expires_on,extendedExpiresOn:o.extended_expires_on,refreshOn:o.refresh_on,keyId:o.key_id,tokenType:o.token_type,userAssertionHash:o.userAssertionHash,resource:o.resource,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeRefreshTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,familyId:o.family_id,target:o.target,realm:o.realm,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeAppMetadata(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n];r[n]={clientId:o.client_id,environment:o.environment,familyId:o.family_id}}),r}static deserializeAllCache(e){return{accounts:e.Account?this.deserializeAccounts(e.Account):{},idTokens:e.IdToken?this.deserializeIdTokens(e.IdToken):{},accessTokens:e.AccessToken?this.deserializeAccessTokens(e.AccessToken):{},refreshTokens:e.RefreshToken?this.deserializeRefreshTokens(e.RefreshToken):{},appMetadata:e.AppMetadata?this.deserializeAppMetadata(e.AppMetadata):{}}}};p();p();var inn="system_assigned_managed_identity",STo="managed_identity",gBt=`https://login.microsoftonline.com/${STo}/`,SC={AUTHORIZATION_HEADER_NAME:"Authorization",METADATA_HEADER_NAME:"Metadata",APP_SERVICE_SECRET_HEADER_NAME:"X-IDENTITY-HEADER",ML_AND_SF_SECRET_HEADER_NAME:"secret"},qh={API_VERSION:"api-version",RESOURCE:"resource",SHA256_TOKEN_TO_REFRESH:"token_sha256_to_refresh",XMS_CC:"xms_cc"},zi={AZURE_POD_IDENTITY_AUTHORITY_HOST:"AZURE_POD_IDENTITY_AUTHORITY_HOST",DEFAULT_IDENTITY_CLIENT_ID:"DEFAULT_IDENTITY_CLIENT_ID",IDENTITY_ENDPOINT:"IDENTITY_ENDPOINT",IDENTITY_HEADER:"IDENTITY_HEADER",IDENTITY_SERVER_THUMBPRINT:"IDENTITY_SERVER_THUMBPRINT",IMDS_ENDPOINT:"IMDS_ENDPOINT",MSI_ENDPOINT:"MSI_ENDPOINT",MSI_SECRET:"MSI_SECRET"},no={APP_SERVICE:"AppService",AZURE_ARC:"AzureArc",CLOUD_SHELL:"CloudShell",DEFAULT_TO_IMDS:"DefaultToImds",IMDS:"Imds",MACHINE_LEARNING:"MachineLearning",SERVICE_FABRIC:"ServiceFabric"},gf={SYSTEM_ASSIGNED:"system-assigned",USER_ASSIGNED_CLIENT_ID:"user-assigned-client-id",USER_ASSIGNED_RESOURCE_ID:"user-assigned-resource-id",USER_ASSIGNED_OBJECT_ID:"user-assigned-object-id"},Kf={GET:"GET",POST:"POST"},onn="REGION_NAME",snn="MSAL_FORCE_REGION",ann=32,cnn={SHA256:"sha256"},AHe={CV_CHARSET:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"},ABt={KEY_SEPARATOR:"-"},Tx={MSAL_SKU:"msal.js.node",JWT_BEARER_ASSERTION_TYPE:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",HTTP_PROTOCOL:"http://",LOCALHOST:"localhost"},Af={acquireTokenSilent:62,acquireTokenByUsernamePassword:371,acquireTokenByDeviceCode:671,acquireTokenByClientCredential:771,acquireTokenByOBO:772,acquireTokenWithManagedIdentity:773,acquireTokenByCode:871,acquireTokenByRefreshToken:872},Ix={RSA_256:"RS256",PSS_256:"PS256",X5T_256:"x5t#S256",X5T:"x5t",X5C:"x5c",AUDIENCE:"aud",EXPIRATION_TIME:"exp",ISSUER:"iss",SUBJECT:"sub",NOT_BEFORE:"nbf",JWT_ID:"jti"},yHe={INTERVAL_MS:100,TIMEOUT_MS:5e3},lnn=4096;p();p();p();var Cce=class{static{a(this,"HttpClient")}async sendGetRequestAsync(e,r,n){return this.sendRequest(e,Kf.GET,r,n)}async sendPostRequestAsync(e,r){return this.sendRequest(e,Kf.POST,r)}async sendRequest(e,r,n,o){let s=new AbortController,c;o&&(c=setTimeout(()=>{s.abort()},o));let l={method:r,headers:ITo(n),signal:s.signal};r===Kf.POST&&(l.body=n?.body||"");let u;try{u=await fetch(e,l)}catch(d){if(c&&clearTimeout(c),d instanceof Error&&d.name==="AbortError")throw iY($p.networkError,"Request timeout");let f=iY($p.networkError,`Network request failed: ${d instanceof Error?d.message:"unknown"}`);throw fBt(f,void 0,void 0,d instanceof Error?d:void 0)}c&&clearTimeout(c);try{return{headers:TTo(u.headers),body:await u.json(),status:u.status}}catch(d){throw iY($p.tokenParsingError,`Failed to parse response: ${d instanceof Error?d.message:"unknown"}`)}}};function TTo(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}a(TTo,"getHeaderDict");function ITo(t){let e=new Headers;return t&&t.headers&&Object.entries(t.headers).forEach(([r,n])=>{e.append(r,n)}),e}a(ITo,"getFetchHeaders");p();p();p();var EHe="invalid_file_extension",_He="invalid_file_path",Y7="invalid_managed_identity_id_type",vHe="invalid_secret",unn="missing_client_id",dnn="network_unavailable",CHe="platform_not_supported",bHe="unable_to_create_azure_arc",SHe="unable_to_create_cloud_shell",THe="unable_to_create_source",XSe="unable_to_read_secret_file",fnn="user_assigned_not_available_at_runtime",IHe="www_authenticate_header_missing",xHe="www_authenticate_header_unsupported_format",_Y={[zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]:"azure_pod_identity_authority_host_url_malformed",[zi.IDENTITY_ENDPOINT]:"identity_endpoint_url_malformed",[zi.IMDS_ENDPOINT]:"imds_endpoint_url_malformed",[zi.MSI_ENDPOINT]:"msi_endpoint_url_malformed"};var xTo={[EHe]:"The file path in the WWW-Authenticate header does not contain a .key file.",[_He]:"The file path in the WWW-Authenticate header is not in a valid Windows or Linux Format.",[Y7]:"More than one ManagedIdentityIdType was provided.",[vHe]:"The secret in the file on the file path in the WWW-Authenticate header is greater than 4096 bytes.",[CHe]:"The platform is not supported by Azure Arc. Azure Arc only supports Windows and Linux.",[unn]:"A ManagedIdentityId id was not provided.",[_Y.AZURE_POD_IDENTITY_AUTHORITY_HOST]:`The Managed Identity's '${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST}' environment variable is malformed.`,[_Y.IDENTITY_ENDPOINT]:`The Managed Identity's '${zi.IDENTITY_ENDPOINT}' environment variable is malformed.`,[_Y.IMDS_ENDPOINT]:`The Managed Identity's '${zi.IMDS_ENDPOINT}' environment variable is malformed.`,[_Y.MSI_ENDPOINT]:`The Managed Identity's '${zi.MSI_ENDPOINT}' environment variable is malformed.`,[dnn]:"Authentication unavailable. The request to the managed identity endpoint timed out.",[bHe]:"Azure Arc Managed Identities can only be system assigned.",[SHe]:"Cloud Shell Managed Identities can only be system assigned.",[THe]:"Unable to create a Managed Identity source based on environment variables.",[XSe]:"Unable to read the secret file.",[fnn]:"Service Fabric user assigned managed identity ClientId or ResourceId is not configurable at runtime.",[IHe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is missing.",[xHe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is in an unsupported format."},yBt=class t extends Fo{static{a(this,"ManagedIdentityError")}constructor(e){super(e,xTo[e]),this.name="ManagedIdentityError",Object.setPrototypeOf(this,t.prototype)}};function Wp(t){return new yBt(t)}a(Wp,"createManagedIdentityError");var wHe=class{static{a(this,"ManagedIdentityId")}get id(){return this._id}set id(e){this._id=e}get idType(){return this._idType}set idType(e){this._idType=e}constructor(e){let r=e?.userAssignedClientId,n=e?.userAssignedResourceId,o=e?.userAssignedObjectId;if(r){if(n||o)throw Wp(Y7);this.id=r,this.idType=gf.USER_ASSIGNED_CLIENT_ID}else if(n){if(r||o)throw Wp(Y7);this.id=n,this.idType=gf.USER_ASSIGNED_RESOURCE_ID}else if(o){if(r||n)throw Wp(Y7);this.id=o,this.idType=gf.USER_ASSIGNED_OBJECT_ID}else this.id=inn,this.idType=gf.SYSTEM_ASSIGNED}};p();var jh={invalidLoopbackAddressType:{code:"invalid_loopback_server_address_type",desc:"Loopback server address is not type string. This is unexpected."},unableToLoadRedirectUri:{code:"unable_to_load_redirectUrl",desc:"Loopback server callback was invoked without a url. This is unexpected."},noAuthCodeInResponse:{code:"no_auth_code_in_response",desc:"No auth code found in the server response. Please check your network trace to determine what happened."},noLoopbackServerExists:{code:"no_loopback_server_exists",desc:"No loopback server exists yet."},loopbackServerAlreadyExists:{code:"loopback_server_already_exists",desc:"Loopback server already exists. Cannot create another."},loopbackServerTimeout:{code:"loopback_server_timeout",desc:"Timed out waiting for auth code listener to be registered."},stateNotFoundError:{code:"state_not_found",desc:"State not found. Please verify that the request originated from msal."},thumbprintMissing:{code:"thumbprint_missing_from_client_certificate",desc:"Client certificate does not contain a SHA-1 or SHA-256 thumbprint."},redirectUriNotSupported:{code:"redirect_uri_not_supported",desc:"RedirectUri is not supported in this scenario. Please remove redirectUri from the request."}},eE=class t extends Fo{static{a(this,"NodeAuthError")}constructor(e,r){super(e,r),this.name="NodeAuthError"}static createInvalidLoopbackAddressTypeError(){return new t(jh.invalidLoopbackAddressType.code,`${jh.invalidLoopbackAddressType.desc}`)}static createUnableToLoadRedirectUrlError(){return new t(jh.unableToLoadRedirectUri.code,`${jh.unableToLoadRedirectUri.desc}`)}static createNoAuthCodeInResponseError(){return new t(jh.noAuthCodeInResponse.code,`${jh.noAuthCodeInResponse.desc}`)}static createNoLoopbackServerExistsError(){return new t(jh.noLoopbackServerExists.code,`${jh.noLoopbackServerExists.desc}`)}static createLoopbackServerAlreadyExistsError(){return new t(jh.loopbackServerAlreadyExists.code,`${jh.loopbackServerAlreadyExists.desc}`)}static createLoopbackServerTimeoutError(){return new t(jh.loopbackServerTimeout.code,`${jh.loopbackServerTimeout.desc}`)}static createStateNotFoundError(){return new t(jh.stateNotFoundError.code,jh.stateNotFoundError.desc)}static createThumbprintMissingError(){return new t(jh.thumbprintMissing.code,jh.thumbprintMissing.desc)}static createRedirectUriNotSupportedError(){return new t(jh.redirectUriNotSupported.code,jh.redirectUriNotSupported.desc)}};var wTo={clientId:"",authority:er.DEFAULT_AUTHORITY,clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",thumbprintSha256:"",privateKey:"",x5c:""},knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",clientCapabilities:[],azureCloudOptions:{azureCloudInstance:l3.None,tenant:""},isMcp:!1},EBt={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:mf.Info},RTo={loggerOptions:EBt,networkClient:new Cce,disableInternalRetries:!1,protocolMode:Xy.AAD},kTo={application:{appName:"",appVersion:""}};function pnn({auth:t,broker:e,cache:r,system:n,telemetry:o}){let s={...RTo,networkClient:new Cce,loggerOptions:n?.loggerOptions||EBt,disableInternalRetries:n?.disableInternalRetries||!1};if(t.clientCertificate&&!t.clientCertificate.thumbprint&&!t.clientCertificate.thumbprintSha256)throw eE.createStateNotFoundError();return{auth:{...wTo,...t},broker:{...e},cache:{...r},system:{...s,...n},telemetry:{...kTo,...o}}}a(pnn,"buildAppConfiguration");function hnn({clientCapabilities:t,managedIdentityIdParams:e,system:r}){let n=new wHe(e),o=r?.loggerOptions||EBt,s;return r?.networkClient?s=r.networkClient:s=new Cce,{clientCapabilities:t||[],managedIdentityId:n,system:{loggerOptions:o,networkClient:s},disableInternalRetries:r?.disableInternalRetries||!1}}a(hnn,"buildManagedIdentityConfiguration");p();p();Mo();var bce=class{static{a(this,"GuidGenerator")}generateGuid(){return Mt()}isGuid(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}};p();var yS=class t{static{a(this,"EncodingUtils")}static base64Encode(e,r){return Buffer.from(e,r).toString(er.EncodingTypes.BASE64)}static base64EncodeUrl(e,r){return t.base64Encode(e,r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}static base64Decode(e){return Buffer.from(e,er.EncodingTypes.BASE64).toString("utf8")}static base64DecodeUrl(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");for(;r.length%4;)r+="=";return t.base64Decode(r)}};p();p();var mnn=de(require("crypto"),1);var K7=class{static{a(this,"HashUtils")}sha256(e){return mnn.default.createHash(cnn.SHA256).update(e).digest()}};var gnn=de(require("crypto"),1);var RHe=class{static{a(this,"PkceGenerator")}constructor(){this.hashUtils=new K7}async generatePkceCodes(){let e=this.generateCodeVerifier(),r=this.generateCodeChallengeFromVerifier(e);return{verifier:e,challenge:r}}generateCodeVerifier(){let e=[],r=256-256%AHe.CV_CHARSET.length;for(;e.length<=ann;){let o=gnn.default.randomBytes(1)[0];if(o>=r)continue;let s=o%AHe.CV_CHARSET.length;e.push(AHe.CV_CHARSET[s])}let n=e.join("");return yS.base64EncodeUrl(n)}generateCodeChallengeFromVerifier(e){return yS.base64EncodeUrl(this.hashUtils.sha256(e).toString(er.EncodingTypes.BASE64),er.EncodingTypes.BASE64)}};var jM=class{static{a(this,"CryptoProvider")}constructor(){this.pkceGenerator=new RHe,this.guidGenerator=new bce,this.hashUtils=new K7}base64UrlEncode(){throw new Error("Method not implemented.")}encodeKid(){throw new Error("Method not implemented.")}createNewGuid(){return this.guidGenerator.generateGuid()}base64Encode(e){return yS.base64Encode(e)}base64Decode(e){return yS.base64Decode(e)}generatePkceCodes(){return this.pkceGenerator.generatePkceCodes()}getPublicKeyThumbprint(){throw new Error("Method not implemented.")}removeTokenBindingKey(){throw new Error("Method not implemented.")}clearKeystore(){throw new Error("Method not implemented.")}signJwt(){throw new Error("Method not implemented.")}async hashString(e){return yS.base64EncodeUrl(this.hashUtils.sha256(e).toString(er.EncodingTypes.BASE64),er.EncodingTypes.BASE64)}};p();p();function Ann(t){let e=t.credentialType===er.CredentialType.REFRESH_TOKEN&&t.familyId||t.clientId,r=t.tokenType&&t.tokenType.toLowerCase()!==er.AuthenticationScheme.BEARER.toLowerCase()?t.tokenType.toLowerCase():"";return[t.homeAccountId,t.environment,t.credentialType,e,t.realm||"",t.target||"",r].join(ABt.KEY_SEPARATOR).toLowerCase()}a(Ann,"generateCredentialKey");function ynn(t){let e=t.homeAccountId.split(".")[1];return[t.homeAccountId,t.environment,e||t.tenantId||""].join(ABt.KEY_SEPARATOR).toLowerCase()}a(ynn,"generateAccountKey");var J7=class extends W7{static{a(this,"NodeStorage")}constructor(e,r,n,o){super(r,n,e,new Qh,o),this.cache={},this.changeEmitters=[],this.logger=e}registerChangeEmitter(e){this.changeEmitters.push(e)}emitChange(){this.changeEmitters.forEach(e=>e.call(null))}cacheToInMemoryCache(e){let r={accounts:{},idTokens:{},accessTokens:{},refreshTokens:{},appMetadata:{}};for(let n in e){let o=e[n];if(typeof o=="object")if(mY.isAccountEntity(o))r.accounts[n]=o;else if(R_.isIdTokenEntity(o))r.idTokens[n]=o;else if(R_.isAccessTokenEntity(o))r.accessTokens[n]=o;else if(R_.isRefreshTokenEntity(o))r.refreshTokens[n]=o;else if(R_.isAppMetadataEntity(n,o))r.appMetadata[n]=o;else continue}return r}inMemoryCacheToCache(e){let r=this.getCache();return r={...r,...e.accounts,...e.idTokens,...e.accessTokens,...e.refreshTokens,...e.appMetadata},r}getInMemoryCache(){return this.logger.trace("Getting in-memory cache",""),this.cacheToInMemoryCache(this.getCache())}setInMemoryCache(e){this.logger.trace("Setting in-memory cache","");let r=this.inMemoryCacheToCache(e);this.setCache(r),this.emitChange()}getCache(){return this.logger.trace("Getting cache key-value store",""),this.cache}setCache(e){this.logger.trace("Setting cache key value store",""),this.cache=e,this.emitChange()}getItem(e){return this.logger.tracePii(`Item key: ${e}`,""),this.getCache()[e]}setItem(e,r){this.logger.tracePii(`Item key: ${e}`,"");let n=this.getCache();n[e]=r,this.setCache(n)}generateCredentialKey(e){return Ann(e)}generateAccountKey(e){return ynn(e)}getAccountKeys(){let e=this.getInMemoryCache();return Object.keys(e.accounts)}getTokenKeys(){let e=this.getInMemoryCache();return{idToken:Object.keys(e.idTokens),accessToken:Object.keys(e.accessTokens),refreshToken:Object.keys(e.refreshTokens)}}getAccount(e){let r=this.getItem(e);return r&&typeof r=="object"?{...r}:null}async setAccount(e){let r=this.generateAccountKey(mY.getAccountInfo(e));this.setItem(r,e)}getIdTokenCredential(e){let r=this.getItem(e);return R_.isIdTokenEntity(r)?r:null}async setIdTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAccessTokenCredential(e){let r=this.getItem(e);return R_.isAccessTokenEntity(r)?r:null}async setAccessTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getRefreshTokenCredential(e){let r=this.getItem(e);return R_.isRefreshTokenEntity(r)?r:null}async setRefreshTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAppMetadata(e){let r=this.getItem(e);return R_.isAppMetadataEntity(e,r)?r:null}setAppMetadata(e){let r=R_.generateAppMetadataKey(e);this.setItem(r,e)}getServerTelemetry(e){let r=this.getItem(e);return r&&R_.isServerTelemetryEntity(e,r)?r:null}setServerTelemetry(e,r){this.setItem(e,r)}getAuthorityMetadata(e){let r=this.getItem(e);return r&&R_.isAuthorityMetadataEntity(e,r)?r:null}getAuthorityMetadataKeys(){return this.getKeys().filter(e=>this.isAuthorityMetadata(e))}setAuthorityMetadata(e,r){this.setItem(e,r)}getThrottlingCache(e){let r=this.getItem(e);return r&&R_.isThrottlingEntity(e,r)?r:null}setThrottlingCache(e,r){this.setItem(e,r)}removeItem(e){this.logger.tracePii(`Item key: ${e}`,"");let r=!1,n=this.getCache();return n[e]&&(delete n[e],r=!0),r&&(this.setCache(n),this.emitChange()),r}removeOutdatedAccount(e){this.removeItem(e)}containsKey(e){return this.getKeys().includes(e)}getKeys(){this.logger.trace("Retrieving all cache keys","");let e=this.getCache();return[...Object.keys(e)]}clear(){this.logger.trace("Clearing cache entries created by MSAL",""),this.getKeys().forEach(r=>{this.removeItem(r)}),this.emitChange()}static generateInMemoryCache(e){return f3.deserializeAllCache(f3.deserializeJSONBlob(e))}static generateJsonCache(e){return q7.serializeAllCache(e)}updateCredentialCacheKey(e,r){let n=this.generateCredentialKey(r);if(e!==n){let o=this.getItem(e);if(o)return this.removeItem(e),this.setItem(n,o),this.logger.verbose(`Updated an outdated ${r.credentialType} cache key`,""),n;this.logger.error(`Attempted to update an outdated ${r.credentialType} cache key but no item matching the outdated key was found in storage`,"")}return e}};p();var eTe={Account:{},IdToken:{},AccessToken:{},RefreshToken:{},AppMetadata:{}},Sce=class{static{a(this,"TokenCache")}constructor(e,r,n){this.cacheHasChanged=!1,this.storage=e,this.storage.registerChangeEmitter(this.handleChangeEvent.bind(this)),n&&(this.persistence=n),this.logger=r}hasChanged(){return this.cacheHasChanged}serialize(){this.logger.trace("Serializing in-memory cache","");let e=q7.serializeAllCache(this.storage.getInMemoryCache());return this.cacheSnapshot?(this.logger.trace("Reading cache snapshot from disk",""),e=this.mergeState(JSON.parse(this.cacheSnapshot),e)):this.logger.trace("No cache snapshot to merge",""),this.cacheHasChanged=!1,JSON.stringify(e)}deserialize(e){if(this.logger.trace("Deserializing JSON to in-memory cache",""),this.cacheSnapshot=e,this.cacheSnapshot){this.logger.trace("Reading cache snapshot from disk","");let r=f3.deserializeAllCache(this.overlayDefaults(JSON.parse(this.cacheSnapshot)));this.storage.setInMemoryCache(r)}else this.logger.trace("No cache snapshot to deserialize","")}getKVStore(){return this.storage.getCache()}getCacheSnapshot(){let e=J7.generateInMemoryCache(this.cacheSnapshot);return this.storage.inMemoryCacheToCache(e)}async getAllAccounts(e=new jM().createNewGuid()){this.logger.trace("getAllAccounts called",e);let r;try{return this.persistence&&(r=new mS(this,!1),await this.persistence.beforeCacheAccess(r)),this.storage.getAllAccounts({},e)}finally{this.persistence&&r&&await this.persistence.afterCacheAccess(r)}}async getAccountByHomeId(e){let r=await this.getAllAccounts();return e&&r&&r.length&&r.filter(n=>n.homeAccountId===e)[0]||null}async getAccountByLocalId(e){let r=await this.getAllAccounts();return e&&r&&r.length&&r.filter(n=>n.localAccountId===e)[0]||null}async removeAccount(e,r){this.logger.trace("removeAccount called",r||"");let n;try{this.persistence&&(n=new mS(this,!0),await this.persistence.beforeCacheAccess(n)),this.storage.removeAccount(e,r||new bce().generateGuid())}finally{this.persistence&&n&&await this.persistence.afterCacheAccess(n)}}async overwriteCache(){if(!this.persistence){this.logger.info("No persistence layer specified, cache cannot be overwritten","");return}this.logger.info("Overwriting in-memory cache with persistent cache",""),this.storage.clear();let e=new mS(this,!1);await this.persistence.beforeCacheAccess(e);let r=this.getCacheSnapshot();this.storage.setCache(r),await this.persistence.afterCacheAccess(e)}handleChangeEvent(){this.cacheHasChanged=!0}mergeState(e,r){this.logger.trace("Merging in-memory cache with cache snapshot","");let n=this.mergeRemovals(e,r);return this.mergeUpdates(n,r)}mergeUpdates(e,r){return Object.keys(r).forEach(n=>{let o=r[n];if(!e.hasOwnProperty(n))o!==null&&(e[n]=o);else{let s=o!==null,c=typeof o=="object",l=!Array.isArray(o),u=typeof e[n]<"u"&&e[n]!==null;s&&c&&l&&u?this.mergeUpdates(e[n],o):e[n]=o}}),e}mergeRemovals(e,r){this.logger.trace("Remove updated entries in cache","");let n=e.Account?this.mergeRemovalsDict(e.Account,r.Account):e.Account,o=e.AccessToken?this.mergeRemovalsDict(e.AccessToken,r.AccessToken):e.AccessToken,s=e.RefreshToken?this.mergeRemovalsDict(e.RefreshToken,r.RefreshToken):e.RefreshToken,c=e.IdToken?this.mergeRemovalsDict(e.IdToken,r.IdToken):e.IdToken,l=e.AppMetadata?this.mergeRemovalsDict(e.AppMetadata,r.AppMetadata):e.AppMetadata;return{...e,Account:n,AccessToken:o,RefreshToken:s,IdToken:c,AppMetadata:l}}mergeRemovalsDict(e,r){let n={...e};return Object.keys(e).forEach(o=>{(!r||!r.hasOwnProperty(o))&&delete n[o]}),n}overlayDefaults(e){return this.logger.trace("Overlaying input cache with the default cache",""),{Account:{...eTe.Account,...e.Account},IdToken:{...eTe.IdToken,...e.IdToken},AccessToken:{...eTe.AccessToken,...e.AccessToken},RefreshToken:{...eTe.RefreshToken,...e.RefreshToken},AppMetadata:{...eTe.AppMetadata,...e.AppMetadata}}}};p();var ran=de(Ysn(),1);p();var Ksn="missing_tenant_id_error",Jsn="user_timeout_reached",Zsn="invalid_assertion",u3t="invalid_client_credential",Xsn="device_code_polling_cancelled",ean="device_code_expired",tan="device_code_unknown_error";var p3=class t{static{a(this,"ClientAssertion")}static fromAssertion(e){let r=new t;return r.jwt=e,r}static fromCertificate(e,r,n){let o=new t;return o.privateKey=r,o.thumbprint=e,o.useSha256=!1,n&&(o.publicCertificate=this.parseCertificate(n)),o}static fromCertificateWithSha256Thumbprint(e,r,n){let o=new t;return o.privateKey=r,o.thumbprint=e,o.useSha256=!0,n&&(o.publicCertificate=this.parseCertificate(n)),o}getJwt(e,r,n){if(this.privateKey&&this.thumbprint)return this.jwt&&!this.isExpired()&&r===this.issuer&&n===this.jwtAudience?this.jwt:this.createJwt(e,r,n);if(this.jwt)return this.jwt;throw kt(Zsn)}createJwt(e,r,n){this.issuer=r,this.jwtAudience=n;let o=Yu.nowSeconds();this.expirationTime=o+600;let c={alg:this.useSha256?Ix.PSS_256:Ix.RSA_256},l=this.useSha256?Ix.X5T_256:Ix.X5T;Object.assign(c,{[l]:yS.base64EncodeUrl(this.thumbprint,er.EncodingTypes.HEX)}),this.publicCertificate&&Object.assign(c,{[Ix.X5C]:this.publicCertificate});let u={[Ix.AUDIENCE]:this.jwtAudience,[Ix.EXPIRATION_TIME]:this.expirationTime,[Ix.ISSUER]:this.issuer,[Ix.SUBJECT]:this.issuer,[Ix.NOT_BEFORE]:o,[Ix.JWT_ID]:e.createNewGuid()};return this.jwt=ran.default.sign(u,this.privateKey,{header:c}),this.jwt}isExpired(){return this.expirationTime0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.username&&an.addCcsUpn(r,e.username),CA.mapToQueryString(r)}};p();function nan(t,e,r,n){let o=ZSe.getStandardAuthorizeRequestParameters({...t.auth,authority:e,redirectUri:r.redirectUri||""},r,n);return an.addLibraryInfo(o,{sku:Tx.MSAL_SKU,version:ES,cpu:process.arch||"",os:process.platform||""}),t.system.protocolMode!==Xy.OIDC&&an.addApplicationTelemetry(o,t.telemetry.application),an.addResponseType(o,er.OAuthResponseType.CODE),r.codeChallenge&&r.codeChallengeMethod&&an.addCodeChallengeParams(o,r.codeChallenge,r.codeChallengeMethod),an.addExtraParameters(o,r.extraQueryParameters||{}),ZSe.getAuthorizeUrl(e,o)}a(nan,"getAuthCodeRequestUrl");var Oce=class{static{a(this,"ClientApplication")}constructor(e){this.config=pnn(e),this.cryptoProvider=new jM,this.logger=new r0(this.config.system.loggerOptions,Mce,ES),this.storage=new J7(this.logger,this.config.auth.clientId,this.cryptoProvider,pBt(this.config.auth)),this.tokenCache=new Sce(this.storage,this.logger,this.config.cache.cachePlugin)}async getAuthCodeUrl(e){this.logger.info("getAuthCodeUrl called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e),responseMode:e.responseMode||er.ResponseMode.QUERY,authenticationScheme:er.AuthenticationScheme.BEARER,state:e.state||"",nonce:e.nonce||""},n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions);return nan(this.config,n,r,this.logger)}async acquireTokenByCode(e,r){this.logger.info("acquireTokenByCode called",e.correlationId||""),e.state&&r&&(this.logger.info("acquireTokenByCode - validating state",e.correlationId||""),this.validateState(e.state,r.state||""),r={...r,state:""});let n={...e,...await this.initializeBaseRequest(e),authenticationScheme:er.AuthenticationScheme.BEARER},o=this.initializeServerTelemetryManager(Af.acquireTokenByCode,n.correlationId);try{let s=await this.createAuthority(n.authority,n.correlationId,void 0,e.azureCloudOptions),c=await this.buildOauthClientConfiguration(s,n.correlationId,n.redirectUri,o),l=new KSe(c,new Qh);return this.logger.verbose("Auth code client created",n.correlationId),await l.acquireToken(n,Af.acquireTokenByCode,r)}catch(s){throw s instanceof Fo&&s.setCorrelationId(n.correlationId),o.cacheFailedRequest(s),s}}async acquireTokenByRefreshToken(e){this.logger.info("acquireTokenByRefreshToken called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e),authenticationScheme:er.AuthenticationScheme.BEARER},n=this.initializeServerTelemetryManager(Af.acquireTokenByRefreshToken,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,r.redirectUri||"",n),c=new AY(s,new Qh);return this.logger.verbose("Refresh token client created",r.correlationId),await c.acquireToken(r,Af.acquireTokenByRefreshToken)}catch(o){throw o instanceof Fo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenSilent(e){let r={...e,...await this.initializeBaseRequest(e),forceRefresh:e.forceRefresh||!1},n=this.initializeServerTelemetryManager(Af.acquireTokenSilent,r.correlationId,r.forceRefresh);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,r.redirectUri||"",n),c=new JSe(s,new Qh);this.logger.verbose("Silent flow client created",r.correlationId);try{return await this.tokenCache.overwriteCache(),await this.acquireCachedTokenSilent(r,c,s)}catch(l){if(l instanceof G7&&l.errorCode===$p.tokenRefreshRequired)return new AY(s,new Qh).acquireTokenByRefreshToken(r,Af.acquireTokenSilent);throw l}}catch(o){throw o instanceof Fo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireCachedTokenSilent(e,r,n){let[o,s]=await r.acquireCachedToken({...e,scopes:e.scopes?.length?e.scopes:[...er.OIDC_DEFAULT_SCOPES]});if(s===er.CacheOutcome.PROACTIVELY_REFRESHED){this.logger.info("ClientApplication:acquireCachedTokenSilent - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.",e.correlationId);let c=new AY(n,new Qh);try{await c.acquireTokenByRefreshToken(e,Af.acquireTokenSilent)}catch{}}return o}async acquireTokenByUsernamePassword(e){this.logger.info("acquireTokenByUsernamePassword called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)},n=this.initializeServerTelemetryManager(Af.acquireTokenByUsernamePassword,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,"",n),c=new oGe(s);return this.logger.verbose("Username password client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Fo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}getTokenCache(){return this.logger.info("getTokenCache called",""),this.tokenCache}validateState(e,r){if(!e)throw eE.createStateNotFoundError();if(e!==r)throw kt($p.stateMismatch)}getLogger(){return this.logger}setLogger(e){this.logger=e}async buildOauthClientConfiguration(e,r,n,o){return this.logger.verbose("buildOauthClientConfiguration called",r),this.logger.info(`Building oauth client configuration with the following authority: ${e.tokenEndpoint}.`,r),o?.updateRegionDiscoveryMetadata(e.regionDiscoveryMetadata),{authOptions:{clientId:this.config.auth.clientId,authority:e,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:n,isMcp:this.config.auth.isMcp},loggerOptions:{logLevel:this.config.system.loggerOptions.logLevel,loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled,correlationId:r},cryptoInterface:this.cryptoProvider,networkInterface:this.config.system.networkClient,storageInterface:this.storage,serverTelemetryManager:o,clientCredentials:{clientSecret:this.clientSecret,clientAssertion:await this.getClientAssertion(e)},libraryInfo:{sku:Tx.MSAL_SKU,version:ES,cpu:process.arch||"",os:process.platform||""},telemetry:this.config.telemetry,persistencePlugin:this.config.cache.cachePlugin,serializableCache:this.tokenCache}}async getClientAssertion(e){return this.developerProvidedClientAssertion&&(this.clientAssertion=p3.fromAssertion(await D_(this.developerProvidedClientAssertion,this.config.auth.clientId,e.tokenEndpoint))),this.clientAssertion&&{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,e.tokenEndpoint),assertionType:Tx.JWT_BEARER_ASSERTION_TYPE}}async initializeBaseRequest(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();return this.logger.verbose("initializeRequestScopes called",r),e.authenticationScheme&&e.authenticationScheme===er.AuthenticationScheme.POP&&this.logger.verbose("Authentication Scheme 'pop' is not supported yet, setting Authentication Scheme to 'Bearer' for request",r),e.authenticationScheme=er.AuthenticationScheme.BEARER,{...e,scopes:[...e&&e.scopes||[],...er.OIDC_DEFAULT_SCOPES],correlationId:r,authority:e.authority||this.config.auth.authority}}initializeServerTelemetryManager(e,r,n){let o={clientId:this.config.auth.clientId,correlationId:r,apiId:e,forceRefresh:n||!1};return new EY(o,this.storage)}async createAuthority(e,r,n,o){this.logger.verbose("createAuthority called",r);let s=mP.generateAuthority(e,o||this.config.auth.azureCloudOptions),c={protocolMode:this.config.system.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,azureRegionConfiguration:n};return gHe.createDiscoveredInstance(s,this.config.system.networkClient,this.storage,c,this.logger,r,new Qh)}clearCache(){this.storage.clear()}};p();var ian=de(require("http"),1);var sGe=class{static{a(this,"LoopbackClient")}async listenForAuthCode(e,r){if(this.server)throw eE.createLoopbackServerAlreadyExistsError();return new Promise((n,o)=>{this.server=ian.default.createServer((s,c)=>{let l=s.url;if(l){if(l===er.FORWARD_SLASH){c.end(e||"Auth code was successfully acquired. You can close this window now.");return}}else{c.end(r||"Error occurred loading redirectUrl"),o(eE.createUnableToLoadRedirectUrlError());return}let u=this.getRedirectUri(),d=new URL(l,u),f=CA.getDeserializedResponse(d.search)||{};f.code&&(c.writeHead(er.HTTP_REDIRECT,{location:u}),c.end()),f.error&&c.end(r||`Error occurred: ${f.error}`),n(f)}),this.server.listen(0,"127.0.0.1")})}getRedirectUri(){if(!this.server||!this.server.listening)throw eE.createNoLoopbackServerExistsError();let e=this.server.address();if(!e||typeof e=="string"||!e.port)throw this.closeServer(),eE.createInvalidLoopbackAddressTypeError();let r=e&&e.port;return`${Tx.HTTP_PROTOCOL}${Tx.LOCALHOST}:${r}`}closeServer(){this.server&&(this.server.close(),typeof this.server.closeAllConnections=="function"&&this.server.closeAllConnections(),this.server.unref(),this.server=void 0)}};p();var aGe=class extends $M{static{a(this,"DeviceCodeClient")}constructor(e){super(e)}async acquireToken(e){let r=await this.getDeviceCode(e);e.deviceCodeCallback(r);let n=Yu.nowSeconds(),o=await this.acquireTokenWithDeviceCode(e,r),s=new Vp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return s.validateTokenResponse(o,e.correlationId),s.handleServerTokenResponse(o,this.authority,n,e,Af.acquireTokenByDeviceCode)}async getDeviceCode(e){let r=this.createExtraQueryParameters(e),n=Is.appendQueryString(this.authority.deviceCodeEndpoint,r),o=this.createQueryString(e),s=this.createTokenRequestHeaders(),c={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return this.executePostRequestToDeviceCodeEndpoint(n,o,s,c,e.correlationId)}createExtraQueryParameters(e){let r=new Map;return e.extraQueryParameters&&an.addExtraParameters(r,e.extraQueryParameters),CA.mapToQueryString(r)}async executePostRequestToDeviceCodeEndpoint(e,r,n,o,s){let{body:{user_code:c,device_code:l,verification_uri:u,expires_in:d,interval:f,message:h}}=await this.sendPostRequest(o,e,{body:r,headers:n},s);return{userCode:c,deviceCode:l,verificationUri:u,expiresIn:d,interval:f,message:h}}createQueryString(e){let r=new Map;return an.addScopes(r,e.scopes),an.addClientId(r,this.config.authOptions.clientId),e.extraQueryParameters&&an.addExtraParameters(r,e.extraQueryParameters),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),CA.mapToQueryString(r)}continuePolling(e,r,n){if(n)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true",""),kt(Xsn);if(r&&rr)throw this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${r}`,""),kt(Jsn);if(Yu.nowSeconds()>e)throw r&&this.logger.verbose(`User specified timeout ignored as the device code has expired before the timeout elapsed. The user specified timeout was set for ${r}`,""),this.logger.error(`Device code expired. Expiration time of device code was ${e}`,""),kt(ean);return!0}async acquireTokenWithDeviceCode(e,r){let n=this.createTokenQueryParameters(e),o=Is.appendQueryString(this.authority.tokenEndpoint,n),s=this.createTokenRequestBody(e,r),c=this.createTokenRequestHeaders(),l=e.timeout?Yu.nowSeconds()+e.timeout:void 0,u=Yu.nowSeconds()+r.expiresIn,d=r.interval*1e3;for(;this.continuePolling(u,l,e.cancel);){let f={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},h=await this.executePostToTokenEndpoint(o,s,c,f,e.correlationId);if(h.body&&h.body.error)if(h.body.error===er.AUTHORIZATION_PENDING)this.logger.info("Authorization pending. Continue polling.",e.correlationId),await Yu.delay(d);else throw this.logger.info("Unexpected error in polling from the server",e.correlationId),iY(vce.postRequestFailed,h.body.error);else return this.logger.verbose("Authorization completed successfully. Polling stopped.",e.correlationId),h.body}throw this.logger.error("Polling stopped for unknown reasons.",e.correlationId),kt(tan)}createTokenRequestBody(e,r){let n=new Map;an.addScopes(n,e.scopes),an.addClientId(n,this.config.authOptions.clientId),an.addGrantType(n,er.GrantType.DEVICE_CODE_GRANT),an.addDeviceCode(n,r.deviceCode);let o=e.correlationId||this.config.cryptoInterface.createNewGuid();return an.addCorrelationId(n,o),an.addClientInfo(n),an.addLibraryInfo(n,this.config.libraryInfo),an.addApplicationTelemetry(n,this.config.telemetry.application),an.addThrottling(n),this.serverTelemetryManager&&an.addServerTelemetry(n,this.serverTelemetryManager),(!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(n,e.claims,this.config.authOptions.clientCapabilities),CA.mapToQueryString(n)}};var Lce=class extends Oce{static{a(this,"PublicClientApplication")}constructor(e){super(e),this.config.broker.nativeBrokerPlugin&&(this.config.broker.nativeBrokerPlugin.isBrokerAvailable?(this.nativeBrokerPlugin=this.config.broker.nativeBrokerPlugin,this.nativeBrokerPlugin.setLogger(this.config.system.loggerOptions)):this.logger.warning("NativeBroker implementation was provided but the broker is unavailable.","")),this.skus=EY.makeExtraSkuString({libraryName:Tx.MSAL_SKU,libraryVersion:ES})}async acquireTokenByDeviceCode(e){this.logger.info("acquireTokenByDeviceCode called",e.correlationId||""),yY(this.config.auth.isMcp,e);let r=Object.assign(e,await this.initializeBaseRequest(e)),n=this.initializeServerTelemetryManager(Af.acquireTokenByDeviceCode,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,"",n),c=new aGe(s);return this.logger.verbose("Device code client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Fo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenInteractive(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();this.logger.trace("acquireTokenInteractive called",r),yY(this.config.auth.isMcp,e);let{openBrowser:n,successTemplate:o,errorTemplate:s,windowHandle:c,loopbackClient:l,...u}=e;if(this.nativeBrokerPlugin){let A={...u,clientId:this.config.auth.clientId,scopes:e.scopes||er.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...u.extraQueryParameters,...u.extraParameters,[nY.X_CLIENT_EXTRA_SKU]:this.skus},accountId:u.account?.nativeAccountId};return this.nativeBrokerPlugin.acquireTokenInteractive(A,c)}if(e.redirectUri){if(!this.config.broker.nativeBrokerPlugin)throw eE.createRedirectUriNotSupportedError();e.redirectUri=""}let{verifier:d,challenge:f}=await this.cryptoProvider.generatePkceCodes(),h=l||new sGe,m={},g=null;try{let A=h.listenForAuthCode(o,s).then(T=>{m=T}).catch(T=>{g=T}),y=await this.waitForRedirectUri(h),E={...u,correlationId:r,scopes:e.scopes||er.OIDC_DEFAULT_SCOPES,redirectUri:y,responseMode:er.ResponseMode.QUERY,codeChallenge:f,codeChallengeMethod:er.CodeChallengeMethodValues.S256},_=await this.getAuthCodeUrl(E);if(await n(_),await A,g)throw g;if(m.error)throw new k_(m.error,m.error_description,m.suberror);if(!m.code)throw eE.createNoAuthCodeInResponseError();let v=m.client_info,b={code:m.code,codeVerifier:d,clientInfo:v||"",...E};return await this.acquireTokenByCode(b)}finally{h.closeServer()}}async acquireTokenSilent(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();if(this.logger.trace("acquireTokenSilent called",r),yY(this.config.auth.isMcp,e),this.nativeBrokerPlugin){let n={...e,clientId:this.config.auth.clientId,scopes:e.scopes||er.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...e.extraQueryParameters,...e.extraParameters,[nY.X_CLIENT_EXTRA_SKU]:this.skus},accountId:e.account.nativeAccountId,forceRefresh:e.forceRefresh||!1};return this.nativeBrokerPlugin.acquireTokenSilent(n)}if(e.redirectUri){if(!this.config.broker.nativeBrokerPlugin)throw eE.createRedirectUriNotSupportedError();e.redirectUri=""}return super.acquireTokenSilent(e)}async acquireTokenByCode(e,r){return yY(this.config.auth.isMcp,e),super.acquireTokenByCode(e,r)}async acquireTokenByRefreshToken(e){return yY(this.config.auth.isMcp,e),super.acquireTokenByRefreshToken(e)}async signOut(e){if(this.nativeBrokerPlugin&&e.account.nativeAccountId){let r={clientId:this.config.auth.clientId,accountId:e.account.nativeAccountId,correlationId:e.correlationId||this.cryptoProvider.createNewGuid()};await this.nativeBrokerPlugin.signOut(r)}await this.getTokenCache().removeAccount(e.account,e.correlationId)}async getAllAccounts(){if(this.nativeBrokerPlugin){let e=this.cryptoProvider.createNewGuid();return this.nativeBrokerPlugin.getAllAccounts(this.config.auth.clientId,e)}return this.getTokenCache().getAllAccounts()}async waitForRedirectUri(e){return new Promise((r,n)=>{let o=0,s=setInterval(()=>{if(yHe.TIMEOUT_MS/yHe.INTERVAL_MS1)throw kt($p.multipleMatchingTokens);return l[0]}async executeTokenRequest(e,r,n){let o,s;if(this.appTokenProvider){this.logger.info("Using appTokenProvider extensibility.",e.correlationId);let u={correlationId:e.correlationId,tenantId:this.config.authOptions.authority.tenant,scopes:e.scopes,claims:e.claims};s=Yu.nowSeconds();let d=await this.appTokenProvider(u);o={access_token:d.accessToken,expires_in:d.expiresInSeconds,refresh_in:d.refreshInSeconds,token_type:er.AuthenticationScheme.BEARER}}else{let u=this.createTokenQueryParameters(e),d=Is.appendQueryString(r.tokenEndpoint,u),f=await this.createTokenRequestBody(e),h=this.createTokenRequestHeaders(),m={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};this.logger.info("Sending token request to endpoint: "+r.tokenEndpoint,e.correlationId),s=Yu.nowSeconds();let g=await this.executePostToTokenEndpoint(d,f,h,m,e.correlationId);o=g.body,o.status=g.status}let c=new Vp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return c.validateTokenResponse(o,e.correlationId,n),await c.handleServerTokenResponse(o,this.authority,s,e,Af.acquireTokenByClientCredential)}async createTokenRequestBody(e){let r=new Map;an.addClientId(r,this.config.authOptions.clientId),an.addScopes(r,e.scopes,!1),an.addGrantType(r,er.GrantType.CLIENT_CREDENTIALS_GRANT),an.addLibraryInfo(r,this.config.libraryInfo),an.addApplicationTelemetry(r,this.config.telemetry.application),an.addThrottling(r),this.serverTelemetryManager&&an.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();an.addCorrelationId(r,n),this.config.clientCredentials.clientSecret&&an.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=e.clientAssertion||this.config.clientCredentials.clientAssertion;return o&&(an.addClientAssertion(r,await D_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),an.addClientAssertionType(r,o.assertionType)),(!fu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),CA.mapToQueryString(r)}};p();var cGe=class extends $M{static{a(this,"OnBehalfOfClient")}constructor(e){super(e)}async acquireToken(e){if(this.scopeSet=new Uh(e.scopes||[]),this.userAssertionHash=await this.cryptoUtils.hashString(e.oboAssertion),e.skipCache||e.claims)return this.executeTokenRequest(e,this.authority,this.userAssertionHash);try{return await this.getCachedAuthenticationResult(e)}catch{return await this.executeTokenRequest(e,this.authority,this.userAssertionHash)}}async getCachedAuthenticationResult(e){let r=this.readAccessTokenFromCacheForOBO(this.config.authOptions.clientId,e);if(r){if(Yu.isTokenExpired(r.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.serverTelemetryManager?.setCacheOutcome(er.CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info(`OnbehalfofFlow:getCachedAuthenticationResult - Cached access token is expired or will expire within ${this.config.systemOptions.tokenRenewalOffsetSeconds} seconds.`,e.correlationId),kt($p.tokenRefreshRequired)}else throw this.serverTelemetryManager?.setCacheOutcome(er.CacheOutcome.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.",e.correlationId),kt($p.tokenRefreshRequired);let n=this.readIdTokenFromCacheForOBO(r.homeAccountId,e.correlationId),o,s=null;if(n){o=nHe.extractTokenClaims(n.secret,yS.base64Decode);let c=o.oid||o.sub,l={homeAccountId:n.homeAccountId,environment:n.environment,tenantId:n.realm,username:"",localAccountId:c||""};s=this.cacheManager.getAccount(this.cacheManager.generateAccountKey(l),e.correlationId)}return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),Vp.generateAuthenticationResult(this.cryptoUtils,this.authority,{account:s,accessToken:r,idToken:n,refreshToken:null,appMetadata:null},!0,e,this.performanceClient,o)}readIdTokenFromCacheForOBO(e,r){let n={homeAccountId:e,environment:this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,credentialType:er.CredentialType.ID_TOKEN,clientId:this.config.authOptions.clientId,realm:this.authority.tenant},o=this.cacheManager.getIdTokensByFilter(n,r);return Object.values(o).length<1?null:Object.values(o)[0]}readAccessTokenFromCacheForOBO(e,r){let n=r.authenticationScheme||er.AuthenticationScheme.BEARER,s={credentialType:n&&n.toLowerCase()!==er.AuthenticationScheme.BEARER.toLowerCase()?er.CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:er.CredentialType.ACCESS_TOKEN,clientId:e,target:Uh.createSearchScopes(this.scopeSet.asArray()),tokenType:n,keyId:r.sshKid,userAssertionHash:this.userAssertionHash},c=this.cacheManager.getAccessTokensByFilter(s,r.correlationId),l=c.length;if(l<1)return null;if(l>1)throw kt($p.multipleMatchingTokens);return c[0]}async executeTokenRequest(e,r,n){let o=this.createTokenQueryParameters(e),s=Is.appendQueryString(r.tokenEndpoint,o),c=await this.createTokenRequestBody(e),l=this.createTokenRequestHeaders(),u={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},d=Yu.nowSeconds(),f=await this.executePostToTokenEndpoint(s,c,l,u,e.correlationId),h=new Vp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return h.validateTokenResponse(f.body,e.correlationId),await h.handleServerTokenResponse(f.body,this.authority,d,e,Af.acquireTokenByOBO,void 0,n)}async createTokenRequestBody(e){let r=new Map;an.addClientId(r,this.config.authOptions.clientId),an.addScopes(r,e.scopes),an.addGrantType(r,er.GrantType.JWT_BEARER),an.addClientInfo(r),an.addLibraryInfo(r,this.config.libraryInfo),an.addApplicationTelemetry(r,this.config.telemetry.application),an.addThrottling(r),this.serverTelemetryManager&&an.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();an.addCorrelationId(r,n),an.addRequestTokenUse(r,nY.ON_BEHALF_OF),an.addOboAssertion(r,e.oboAssertion),this.config.clientCredentials.clientSecret&&an.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=this.config.clientCredentials.clientAssertion;return o&&(an.addClientAssertion(r,await D_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),an.addClientAssertionType(r,o.assertionType)),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),CA.mapToQueryString(r)}};var Fce=class extends Oce{static{a(this,"ConfidentialClientApplication")}constructor(e){super(e);let r=!!this.config.auth.clientSecret,n=!!this.config.auth.clientAssertion,o=(!!this.config.auth.clientCertificate?.thumbprint||!!this.config.auth.clientCertificate?.thumbprintSha256)&&!!this.config.auth.clientCertificate?.privateKey;if(!this.appTokenProvider){if(r&&n||n&&o||r&&o)throw kt(u3t);if(this.config.auth.clientSecret){this.clientSecret=this.config.auth.clientSecret;return}if(this.config.auth.clientAssertion){this.developerProvidedClientAssertion=this.config.auth.clientAssertion;return}if(o)this.clientAssertion=this.config.auth.clientCertificate.thumbprintSha256?p3.fromCertificateWithSha256Thumbprint(this.config.auth.clientCertificate.thumbprintSha256,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c):p3.fromCertificate(this.config.auth.clientCertificate.thumbprint,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c);else throw kt(u3t);this.appTokenProvider=void 0}}SetAppTokenProvider(e){this.appTokenProvider=e}async acquireTokenByClientCredential(e){this.logger.info("acquireTokenByClientCredential called",e.correlationId||"");let r;e.clientAssertion&&(r={assertion:await D_(e.clientAssertion,this.config.auth.clientId),assertionType:Tx.JWT_BEARER_ASSERTION_TYPE});let n=await this.initializeBaseRequest(e),o={...n,scopes:n.scopes.filter(m=>!er.OIDC_DEFAULT_SCOPES.includes(m))},s={...e,...o,clientAssertion:r},l=new Is(s.authority).getUrlComponents().PathSegments[0];if(Object.values(er.AADAuthority).includes(l))throw kt(Ksn);let u=process.env[snn],d;s.azureRegion!=="DisableMsalForceRegion"&&(!s.azureRegion&&u?d=u:d=s.azureRegion);let f={azureRegion:d,environmentRegion:process.env[onn]},h=this.initializeServerTelemetryManager(Af.acquireTokenByClientCredential,s.correlationId,s.skipCache);try{let m=await this.createAuthority(s.authority,s.correlationId,f,e.azureCloudOptions),g=await this.buildOauthClientConfiguration(m,s.correlationId,"",h),A=new Bce(g,this.appTokenProvider);return this.logger.verbose("Client credential client created",s.correlationId),await A.acquireToken(s)}catch(m){throw m instanceof Fo&&m.setCorrelationId(s.correlationId),h.cacheFailedRequest(m),m}}async acquireTokenOnBehalfOf(e){this.logger.info("acquireTokenOnBehalfOf called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)};try{let n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),o=await this.buildOauthClientConfiguration(n,r.correlationId,"",void 0),s=new cGe(o);return this.logger.verbose("On behalf of client created",r.correlationId),await s.acquireToken(r)}catch(n){throw n instanceof Fo&&n.setCorrelationId(r.correlationId),n}}};p();p();p();p();p();function oan(t){if(typeof t!="string")return!1;let e=new Date(t);return!isNaN(e.getTime())&&e.toISOString()===t}a(oan,"isIso8601");p();var lGe=class{static{a(this,"HttpClientWithRetries")}constructor(e,r,n){this.httpClientNoRetries=e,this.retryPolicy=r,this.logger=n}async sendNetworkRequestAsyncHelper(e,r,n){return e===Kf.GET?this.httpClientNoRetries.sendGetRequestAsync(r,n):this.httpClientNoRetries.sendPostRequestAsync(r,n)}async sendNetworkRequestAsync(e,r,n){let o=await this.sendNetworkRequestAsyncHelper(e,r,n);"isNewRequest"in this.retryPolicy&&(this.retryPolicy.isNewRequest=!0);let s=0;for(;await this.retryPolicy.pauseForRetry(o.status,s,this.logger,o.headers[er.HeaderNames.RETRY_AFTER]);)o=await this.sendNetworkRequestAsyncHelper(e,r,n),s++;return o}async sendGetRequestAsync(e,r){return this.sendNetworkRequestAsync(Kf.GET,e,r)}async sendPostRequestAsync(e,r){return this.sendNetworkRequestAsync(Kf.POST,e,r)}};var bY={MANAGED_IDENTITY_CLIENT_ID_2017:"clientid",MANAGED_IDENTITY_CLIENT_ID:"client_id",MANAGED_IDENTITY_OBJECT_ID:"object_id",MANAGED_IDENTITY_RESOURCE_ID_IMDS:"msi_res_id",MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS:"mi_res_id"},M_=class{static{a(this,"BaseManagedIdentitySource")}constructor(e,r,n,o,s){this.logger=e,this.nodeStorage=r,this.networkClient=n,this.cryptoProvider=o,this.disableInternalRetries=s}async getServerTokenResponseAsync(e,r,n,o){return this.getServerTokenResponse(e)}getServerTokenResponse(e){let r,n;return e.body.expires_on&&(oan(e.body.expires_on)&&(e.body.expires_on=new Date(e.body.expires_on).getTime()/1e3),n=e.body.expires_on-Yu.nowSeconds(),n>2*3600&&(r=n/2)),{status:e.status,access_token:e.body.access_token,expires_in:n,scope:e.body.resource,token_type:e.body.token_type,refresh_in:r,correlation_id:e.body.correlation_id||e.body.correlationId,error:typeof e.body.error=="string"?e.body.error:e.body.error?.code,error_description:e.body.message||(typeof e.body.error=="string"?e.body.error_description:e.body.error?.message),error_codes:e.body.error_codes,timestamp:e.body.timestamp,trace_id:e.body.trace_id}}async acquireTokenWithManagedIdentity(e,r,n,o){let s=this.createRequest(e.resource,r);if(e.revokedTokenSha256Hash&&(this.logger.info(`[Managed Identity] The following claims are present in the request: ${e.claims}`,""),s.queryParameters[qh.SHA256_TOKEN_TO_REFRESH]=e.revokedTokenSha256Hash),e.clientCapabilities?.length){let g=e.clientCapabilities.toString();this.logger.info(`[Managed Identity] The following client capabilities are present in the request: ${g}`,""),s.queryParameters[qh.XMS_CC]=g}let c=s.headers;c[er.HeaderNames.CONTENT_TYPE]=er.URL_FORM_CONTENT_TYPE;let l={headers:c};Object.keys(s.bodyParameters).length&&(l.body=s.computeParametersBodyString());let u=this.disableInternalRetries?this.networkClient:new lGe(this.networkClient,s.retryPolicy,this.logger),d=Yu.nowSeconds(),f;try{s.httpMethod===Kf.POST?f=await u.sendPostRequestAsync(s.computeUri(),l):f=await u.sendGetRequestAsync(s.computeUri(),l)}catch(g){throw g instanceof Fo?g:kt($p.networkError)}let h=new Vp(r.id,this.nodeStorage,this.cryptoProvider,this.logger,new Qh,null,null),m=await this.getServerTokenResponseAsync(f,u,s,l);return h.validateTokenResponse(m,m.correlation_id||"",o),h.handleServerTokenResponse(m,n,d,e,Af.acquireTokenWithManagedIdentity)}getManagedIdentityUserAssignedIdQueryParameterKey(e,r,n){switch(e){case gf.USER_ASSIGNED_CLIENT_ID:return this.logger.info(`[Managed Identity] [API version ${n?"2017+":"2019+"}] Adding user assigned client id to the request.`,""),n?bY.MANAGED_IDENTITY_CLIENT_ID_2017:bY.MANAGED_IDENTITY_CLIENT_ID;case gf.USER_ASSIGNED_RESOURCE_ID:return this.logger.info("[Managed Identity] Adding user assigned resource id to the request.",""),r?bY.MANAGED_IDENTITY_RESOURCE_ID_IMDS:bY.MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS;case gf.USER_ASSIGNED_OBJECT_ID:return this.logger.info("[Managed Identity] Adding user assigned object id to the request.",""),bY.MANAGED_IDENTITY_OBJECT_ID;default:throw Wp(Y7)}}};M_.getValidatedEnvVariableUrlString=(t,e,r,n)=>{try{return new Is(e).urlString}catch{throw n.info(`[Managed Identity] ${r} managed identity is unavailable because the '${t}' environment variable is malformed.`,""),Wp(_Y[t])}};p();p();p();var uGe=class{static{a(this,"LinearRetryStrategy")}calculateDelay(e,r){if(!e)return r;let n=Math.round(parseFloat(e)*1e3);return isNaN(n)&&(n=new Date(e).valueOf()-new Date().valueOf()),Math.max(r,n)}};var WPo=3,zPo=1e3,YPo=[er.HTTP_NOT_FOUND,er.HTTP_REQUEST_TIMEOUT,er.HTTP_TOO_MANY_REQUESTS,er.HTTP_SERVER_ERROR,er.HTTP_SERVICE_UNAVAILABLE,er.HTTP_GATEWAY_TIMEOUT],dGe=class t{static{a(this,"DefaultManagedIdentityRetryPolicy")}constructor(){this.linearRetryStrategy=new uGe}static get DEFAULT_MANAGED_IDENTITY_RETRY_DELAY_MS(){return zPo}async pauseForRetry(e,r,n,o){if(YPo.includes(e)&&rsetTimeout(c,s)),!0}return!1}};var TC=class{static{a(this,"ManagedIdentityRequestParameters")}constructor(e,r,n){this.httpMethod=e,this._baseEndpoint=r,this.headers={},this.bodyParameters={},this.queryParameters={},this.retryPolicy=n||new dGe}computeUri(){let e=new Map;this.queryParameters&&an.addExtraParameters(e,this.queryParameters);let r=CA.mapToQueryString(e);return Is.appendQueryString(this._baseEndpoint,r)}computeParametersBodyString(){let e=new Map;return this.bodyParameters&&an.addExtraParameters(e,this.bodyParameters),CA.mapToQueryString(e)}};var KPo="2019-08-01",uTe=class t extends M_{static{a(this,"AppService")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.identityEndpoint=c,this.identityHeader=l}static getEnvironmentVariables(){let e=process.env[zi.IDENTITY_ENDPOINT],r=process.env[zi.IDENTITY_HEADER];return[e,r]}static tryCreate(e,r,n,o,s){let[c,l]=t.getEnvironmentVariables();if(!c||!l)return e.info(`[Managed Identity] ${no.APP_SERVICE} managed identity is unavailable because one or both of the '${zi.IDENTITY_HEADER}' and '${zi.IDENTITY_ENDPOINT}' environment variables are not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(zi.IDENTITY_ENDPOINT,c,no.APP_SERVICE,e);return e.info(`[Managed Identity] Environment variables validation passed for ${no.APP_SERVICE} managed identity. Endpoint URI: ${u}. Creating ${no.APP_SERVICE} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new TC(Kf.GET,this.identityEndpoint);return n.headers[SC.APP_SERVICE_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[qh.API_VERSION]=KPo,n.queryParameters[qh.RESOURCE]=e,r.idType!==gf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var h3=require("fs"),lan=de(require("path"),1);var JPo="2019-11-01",san="http://127.0.0.1:40342/metadata/identity/oauth2/token",aan="N/A: himds executable exists",can={win32:`${process.env.ProgramData}\\AzureConnectedMachineAgent\\Tokens\\`,linux:"/var/opt/azcmagent/tokens/"},ZPo={win32:`${process.env.ProgramFiles}\\AzureConnectedMachineAgent\\himds.exe`,linux:"/opt/azcmagent/bin/himds"},dTe=class t extends M_{static{a(this,"AzureArc")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.identityEndpoint=c}static getEnvironmentVariables(){let e=process.env[zi.IDENTITY_ENDPOINT],r=process.env[zi.IMDS_ENDPOINT];if(!e||!r){let n=ZPo[process.platform];try{(0,h3.accessSync)(n,h3.constants.F_OK|h3.constants.R_OK),e=san,r=aan}catch{}}return[e,r]}static tryCreate(e,r,n,o,s,c){let[l,u]=t.getEnvironmentVariables();if(!l||!u)return e.info(`[Managed Identity] ${no.AZURE_ARC} managed identity is unavailable through environment variables because one or both of '${zi.IDENTITY_ENDPOINT}' and '${zi.IMDS_ENDPOINT}' are not defined. ${no.AZURE_ARC} managed identity is also unavailable through file detection.`,""),null;if(u===aan)e.info(`[Managed Identity] ${no.AZURE_ARC} managed identity is available through file detection. Defaulting to known ${no.AZURE_ARC} endpoint: ${san}. Creating ${no.AZURE_ARC} managed identity.`,"");else{let d=t.getValidatedEnvVariableUrlString(zi.IDENTITY_ENDPOINT,l,no.AZURE_ARC,e);d.endsWith("/")&&d.slice(0,-1),t.getValidatedEnvVariableUrlString(zi.IMDS_ENDPOINT,u,no.AZURE_ARC,e),e.info(`[Managed Identity] Environment variables validation passed for ${no.AZURE_ARC} managed identity. Endpoint URI: ${d}. Creating ${no.AZURE_ARC} managed identity.`,"")}if(c.idType!==gf.SYSTEM_ASSIGNED)throw Wp(bHe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new TC(Kf.GET,this.identityEndpoint.replace("localhost","127.0.0.1"));return r.headers[SC.METADATA_HEADER_NAME]="true",r.queryParameters[qh.API_VERSION]=JPo,r.queryParameters[qh.RESOURCE]=e,r}async getServerTokenResponseAsync(e,r,n,o){let s;if(e.status===er.HTTP_UNAUTHORIZED){let c=e.headers["www-authenticate"];if(!c)throw Wp(IHe);if(!c.includes("Basic realm="))throw Wp(xHe);let l=c.split("Basic realm=")[1];if(!can.hasOwnProperty(process.platform))throw Wp(CHe);let u=can[process.platform],d=lan.default.basename(l);if(!d.endsWith(".key"))throw Wp(EHe);if(u+d!==l)throw Wp(_He);let f;try{f=await(0,h3.statSync)(l).size}catch{throw Wp(XSe)}if(f>lnn)throw Wp(vHe);let h;try{h=(0,h3.readFileSync)(l,er.EncodingTypes.UTF8)}catch{throw Wp(XSe)}let m=`Basic ${h}`;this.logger.info("[Managed Identity] Adding authorization header to the request.",""),n.headers[SC.AUTHORIZATION_HEADER_NAME]=m;try{s=await r.sendGetRequestAsync(n.computeUri(),o)}catch(g){throw g instanceof Fo?g:kt($p.networkError)}}return this.getServerTokenResponse(s||e)}};p();var fTe=class t extends M_{static{a(this,"CloudShell")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.msiEndpoint=c}static getEnvironmentVariables(){return[process.env[zi.MSI_ENDPOINT]]}static tryCreate(e,r,n,o,s,c){let[l]=t.getEnvironmentVariables();if(!l)return e.info(`[Managed Identity] ${no.CLOUD_SHELL} managed identity is unavailable because the '${zi.MSI_ENDPOINT} environment variable is not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(zi.MSI_ENDPOINT,l,no.CLOUD_SHELL,e);if(e.info(`[Managed Identity] Environment variable validation passed for ${no.CLOUD_SHELL} managed identity. Endpoint URI: ${u}. Creating ${no.CLOUD_SHELL} managed identity.`,""),c.idType!==gf.SYSTEM_ASSIGNED)throw Wp(SHe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new TC(Kf.POST,this.msiEndpoint);return r.headers[SC.METADATA_HEADER_NAME]="true",r.bodyParameters[qh.RESOURCE]=e,r}};p();p();p();var fGe=class{static{a(this,"ExponentialRetryStrategy")}constructor(e,r,n){this.minExponentialBackoff=e,this.maxExponentialBackoff=r,this.exponentialDeltaBackoff=n}calculateDelay(e){return e===0?this.minExponentialBackoff:Math.min(Math.pow(2,e-1)*this.exponentialDeltaBackoff,this.maxExponentialBackoff)}};var XPo=[er.HTTP_NOT_FOUND,er.HTTP_REQUEST_TIMEOUT,er.HTTP_GONE,er.HTTP_TOO_MANY_REQUESTS],e2o=3,t2o=7,r2o=1e3,n2o=4e3,i2o=2e3,o2o=10*1e3,pGe=class t{static{a(this,"ImdsRetryPolicy")}constructor(){this.exponentialRetryStrategy=new fGe(t.MIN_EXPONENTIAL_BACKOFF_MS,t.MAX_EXPONENTIAL_BACKOFF_MS,t.EXPONENTIAL_DELTA_BACKOFF_MS)}static get MIN_EXPONENTIAL_BACKOFF_MS(){return r2o}static get MAX_EXPONENTIAL_BACKOFF_MS(){return n2o}static get EXPONENTIAL_DELTA_BACKOFF_MS(){return i2o}static get HTTP_STATUS_GONE_RETRY_AFTER_MS(){return o2o}set isNewRequest(e){this._isNewRequest=e}async pauseForRetry(e,r,n){if(this._isNewRequest&&(this._isNewRequest=!1,this.maxRetries=e===er.HTTP_GONE?t2o:e2o),(XPo.includes(e)||e>=er.HTTP_SERVER_ERROR_RANGE_START&&e<=er.HTTP_SERVER_ERROR_RANGE_END&&rsetTimeout(s,o)),!0}return!1}};var uan="/metadata/identity/oauth2/token",s2o=`http://169.254.169.254${uan}`,a2o="2018-02-01",hGe=class t extends M_{static{a(this,"Imds")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.identityEndpoint=c}static tryCreate(e,r,n,o,s){let c;return process.env[zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]?(e.info(`[Managed Identity] Environment variable ${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST} for ${no.IMDS} returned endpoint: ${process.env[zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]}`,""),c=t.getValidatedEnvVariableUrlString(zi.AZURE_POD_IDENTITY_AUTHORITY_HOST,`${process.env[zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]}${uan}`,no.IMDS,e)):(e.info(`[Managed Identity] Unable to find ${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST} environment variable for ${no.IMDS}, using the default endpoint.`,""),c=s2o),new t(e,r,n,o,s,c)}createRequest(e,r){let n=new TC(Kf.GET,this.identityEndpoint);return n.headers[SC.METADATA_HEADER_NAME]="true",n.queryParameters[qh.API_VERSION]=a2o,n.queryParameters[qh.RESOURCE]=e,r.idType!==gf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!0)]=r.id),n.retryPolicy=new pGe,n}};p();var c2o="2019-07-01-preview",pTe=class t extends M_{static{a(this,"ServiceFabric")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.identityEndpoint=c,this.identityHeader=l}static getEnvironmentVariables(){let e=process.env[zi.IDENTITY_ENDPOINT],r=process.env[zi.IDENTITY_HEADER],n=process.env[zi.IDENTITY_SERVER_THUMBPRINT];return[e,r,n]}static tryCreate(e,r,n,o,s,c){let[l,u,d]=t.getEnvironmentVariables();if(!l||!u||!d)return e.info(`[Managed Identity] ${no.SERVICE_FABRIC} managed identity is unavailable because one or all of the '${zi.IDENTITY_HEADER}', '${zi.IDENTITY_ENDPOINT}' or '${zi.IDENTITY_SERVER_THUMBPRINT}' environment variables are not defined.`,""),null;let f=t.getValidatedEnvVariableUrlString(zi.IDENTITY_ENDPOINT,l,no.SERVICE_FABRIC,e);return e.info(`[Managed Identity] Environment variables validation passed for ${no.SERVICE_FABRIC} managed identity. Endpoint URI: ${f}. Creating ${no.SERVICE_FABRIC} managed identity.`,""),c.idType!==gf.SYSTEM_ASSIGNED&&e.warning(`[Managed Identity] ${no.SERVICE_FABRIC} user assigned managed identity is configured in the cluster, not during runtime. See also: https://learn.microsoft.com/en-us/azure/service-fabric/configure-existing-cluster-enable-managed-identity-token-service.`,""),new t(e,r,n,o,s,l,u)}createRequest(e,r){let n=new TC(Kf.GET,this.identityEndpoint);return n.headers[SC.ML_AND_SF_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[qh.API_VERSION]=c2o,n.queryParameters[qh.RESOURCE]=e,r.idType!==gf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var l2o="2017-09-01",u2o=`Only client id is supported for user-assigned managed identity in ${no.MACHINE_LEARNING}.`,hTe=class t extends M_{static{a(this,"MachineLearning")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.msiEndpoint=c,this.secret=l}static getEnvironmentVariables(){let e=process.env[zi.MSI_ENDPOINT],r=process.env[zi.MSI_SECRET];return[e,r]}static tryCreate(e,r,n,o,s){let[c,l]=t.getEnvironmentVariables();if(!c||!l)return e.info(`[Managed Identity] ${no.MACHINE_LEARNING} managed identity is unavailable because one or both of the '${zi.MSI_ENDPOINT}' and '${zi.MSI_SECRET}' environment variables are not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(zi.MSI_ENDPOINT,c,no.MACHINE_LEARNING,e);return e.info(`[Managed Identity] Environment variables validation passed for ${no.MACHINE_LEARNING} managed identity. Endpoint URI: ${u}. Creating ${no.MACHINE_LEARNING} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new TC(Kf.GET,this.msiEndpoint);if(n.headers[SC.METADATA_HEADER_NAME]="true",n.headers[SC.ML_AND_SF_SECRET_HEADER_NAME]=this.secret,n.queryParameters[qh.API_VERSION]=l2o,n.queryParameters[qh.RESOURCE]=e,r.idType===gf.SYSTEM_ASSIGNED)n.queryParameters[bY.MANAGED_IDENTITY_CLIENT_ID_2017]=process.env[zi.DEFAULT_IDENTITY_CLIENT_ID];else if(r.idType===gf.USER_ASSIGNED_CLIENT_ID)n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!1,!0)]=r.id;else throw new Error(u2o);return n}};var mTe=class t{static{a(this,"ManagedIdentityClient")}constructor(e,r,n,o,s){this.logger=e,this.nodeStorage=r,this.networkClient=n,this.cryptoProvider=o,this.disableInternalRetries=s}async sendManagedIdentityTokenRequest(e,r,n,o){return t.identitySource||(t.identitySource=this.selectManagedIdentitySource(this.logger,this.nodeStorage,this.networkClient,this.cryptoProvider,this.disableInternalRetries,r)),t.identitySource.acquireTokenWithManagedIdentity(e,r,n,o)}allEnvironmentVariablesAreDefined(e){return Object.values(e).every(r=>r!==void 0)}getManagedIdentitySource(){return t.sourceName=this.allEnvironmentVariablesAreDefined(pTe.getEnvironmentVariables())?no.SERVICE_FABRIC:this.allEnvironmentVariablesAreDefined(uTe.getEnvironmentVariables())?no.APP_SERVICE:this.allEnvironmentVariablesAreDefined(hTe.getEnvironmentVariables())?no.MACHINE_LEARNING:this.allEnvironmentVariablesAreDefined(fTe.getEnvironmentVariables())?no.CLOUD_SHELL:this.allEnvironmentVariablesAreDefined(dTe.getEnvironmentVariables())?no.AZURE_ARC:no.DEFAULT_TO_IMDS,t.sourceName}selectManagedIdentitySource(e,r,n,o,s,c){let l=pTe.tryCreate(e,r,n,o,s,c)||uTe.tryCreate(e,r,n,o,s)||hTe.tryCreate(e,r,n,o,s)||fTe.tryCreate(e,r,n,o,s,c)||dTe.tryCreate(e,r,n,o,s,c)||hGe.tryCreate(e,r,n,o,s);if(!l)throw Wp(THe);return l}};var d2o=[no.SERVICE_FABRIC],Uce=class t{static{a(this,"ManagedIdentityApplication")}constructor(e){this.config=hnn(e||{}),this.logger=new r0(this.config.system.loggerOptions,Mce,ES);let r={canonicalAuthority:er.DEFAULT_AUTHORITY};t.nodeStorage||(t.nodeStorage=new J7(this.logger,this.config.managedIdentityId.id,pce,r)),this.networkClient=this.config.system.networkClient,this.cryptoProvider=new jM;let n={protocolMode:Xy.AAD,knownAuthorities:[gBt],cloudDiscoveryMetadata:"",authorityMetadata:""};this.fakeAuthority=new mP(gBt,this.networkClient,t.nodeStorage,n,this.logger,this.cryptoProvider.createNewGuid(),new Qh,!0),this.fakeClientCredentialClient=new Bce({authOptions:{clientId:this.config.managedIdentityId.id,authority:this.fakeAuthority}}),this.managedIdentityClient=new mTe(this.logger,t.nodeStorage,this.networkClient,this.cryptoProvider,this.config.disableInternalRetries),this.hashUtils=new K7}async acquireToken(e){if(!e.resource)throw vl(uce.urlEmptyError);let r={forceRefresh:e.forceRefresh,resource:e.resource.replace("/.default",""),scopes:[e.resource.replace("/.default","")],authority:this.fakeAuthority.canonicalAuthority,correlationId:this.cryptoProvider.createNewGuid(),claims:e.claims,clientCapabilities:this.config.clientCapabilities};if(r.forceRefresh)return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority);let[n,o]=await this.fakeClientCredentialClient.getCachedAuthenticationResult(r,this.config,this.cryptoProvider,this.fakeAuthority,t.nodeStorage);if(r.claims){let s=this.managedIdentityClient.getManagedIdentitySource();if(n&&d2o.includes(s)){let c=this.hashUtils.sha256(n.accessToken).toString(er.EncodingTypes.HEX);r.revokedTokenSha256Hash=c}return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}return n?(o===er.CacheOutcome.PROACTIVELY_REFRESHED&&(this.logger.info("ClientCredentialClient:getCachedAuthenticationResult - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.",r.correlationId),await this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority,!0)),n):this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}async acquireTokenFromManagedIdentity(e,r,n,o){return this.managedIdentityClient.sendManagedIdentityTokenRequest(e,r,n,o)}getManagedIdentitySource(){return mTe.sourceName||this.managedIdentityClient.getManagedIdentitySource()}};p();var mGe=class{static{a(this,"DistributedCachePlugin")}constructor(e,r){this.client=e,this.partitionManager=r}async beforeCacheAccess(e){let r=await this.partitionManager.getKey(),n=await this.client.get(r);e.tokenCache.deserialize(n)}async afterCacheAccess(e){if(e.cacheHasChanged){let r=e.tokenCache.getKVStore(),n=Object.values(r).filter(s=>mY.isAccountEntity(s)),o;if(n.length>0){let s=n[0];o=await this.partitionManager.extractKey(s)}else o=await this.partitionManager.getKey();await this.client.set(o,e.tokenCache.serialize())}}};var f2o=er.PromptValue,p2o=er.ResponseMode;p();p();p();p();p();function gTe(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(gTe,"getRandomIntegerInclusive");function ATe(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+gTe(0,n/2)}}a(ATe,"calculateRetryDelay");p();function Qce(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(Qce,"isObject");p();function SY(t){if(Qce(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(SY,"isError");p();p();var dan=require("node:crypto");var d3t,h2o=typeof((d3t=globalThis?.crypto)===null||d3t===void 0?void 0:d3t.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):dan.randomUUID;function qce(){return h2o()}a(qce,"randomUUID");p();var f3t,p3t,h3t,m3t,fan=typeof window<"u"&&typeof window.document<"u",pan=typeof self=="object"&&typeof self?.importScripts=="function"&&(((f3t=self.constructor)===null||f3t===void 0?void 0:f3t.name)==="DedicatedWorkerGlobalScope"||((p3t=self.constructor)===null||p3t===void 0?void 0:p3t.name)==="ServiceWorkerGlobalScope"||((h3t=self.constructor)===null||h3t===void 0?void 0:h3t.name)==="SharedWorkerGlobalScope"),han=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",man=typeof Bun<"u"&&typeof Bun.version<"u",tQ=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((m3t=globalThis.process.versions)===null||m3t===void 0)&&m3t.node);var gan=typeof navigator<"u"&&navigator?.product==="ReactNative";p();function IC(t,e){return Buffer.from(t,e)}a(IC,"stringToUint8Array");p();var g3t="REDACTED",m2o=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],g2o=["api-version"],yP=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=m2o.concat(e),r=g2o.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||Qce(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,g3t);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=g3t;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=g3t;return r}};p();p();p();p();var TY=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};function y3t(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new TY(o??"The operation was aborted."))}a(l,"rejectOnAbort");function u(){n?.removeEventListener("abort",d)}a(u,"removeListeners");function d(){r?.(),u(),l()}if(a(d,"onAbort"),n?.aborted)return l();try{t(f=>{u(),s(f)},f=>{u(),c(f)})}catch(f){c(f)}n?.addEventListener("abort",d)})}a(y3t,"createAbortablePromise");p();var v2o="The delay was aborted.";function E3t(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return y3t(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??v2o})}a(E3t,"delay");p();function jce(t){if(SY(t))return t.message;{let e;try{typeof t=="object"&&t?e=JSON.stringify(t):e=String(t)}catch{e="[unable to stringify input]"}return`Unknown error ${e}`}}a(jce,"getErrorMessage");p();function Aan(t,e){return ATe(t,e)}a(Aan,"calculateRetryDelay");function gGe(t){return SY(t)}a(gGe,"isError");var AGe=tQ,Hce=tQ;p();var yTe=lo("IdentityUtils"),yan="1.0";function IY(t,e,r){let n=a(o=>(yTe.getToken.info(o),new bx({scopes:Array.isArray(t)?t:[t],getTokenOptions:r,message:o})),"error");if(!e)throw n("No response");if(!e.expiresOn)throw n('Response had no "expiresOn" property.');if(!e.accessToken)throw n('Response had no "accessToken" property.')}a(IY,"ensureValidMsalToken");function _3t(t){let e=t?.authorityHost;return!e&&Hce&&(e=process.env.AZURE_AUTHORITY_HOST),e??cSe}a(_3t,"getAuthorityHost");function v3t(t,e){return e||(e=cSe),new RegExp(`${t}/?$`).test(e)?e:e.endsWith("/")?e+t:`${e}/${t}`}a(v3t,"getAuthority");function Ean(t,e,r){return t==="adfs"&&e||r?[e]:[]}a(Ean,"getKnownAuthorities");var yGe=a((t,e=AGe?"Node":"Browser")=>(r,n,o)=>{if(!o)switch(r){case _S.LogLevel.Error:t.info(`MSAL ${e} V2 error: ${n}`);return;case _S.LogLevel.Info:t.info(`MSAL ${e} V2 info message: ${n}`);return;case _S.LogLevel.Verbose:t.info(`MSAL ${e} V2 verbose message: ${n}`);return;case _S.LogLevel.Warning:t.info(`MSAL ${e} V2 warning: ${n}`);return}},"defaultLoggerCallback");function EGe(t){switch(t){case"error":return _S.LogLevel.Error;case"info":return _S.LogLevel.Info;case"verbose":return _S.LogLevel.Verbose;case"warning":return _S.LogLevel.Warning;default:return _S.LogLevel.Info}}a(EGe,"getMSALLogLevel");function xY(t,e,r){if(e.name==="AuthError"||e.name==="ClientAuthError"||e.name==="BrowserAuthError"){let n=e;switch(n.errorCode){case"endpoints_resolution_error":return yTe.info(Us(t,e.message)),new Mn(e.message);case"device_code_polling_cancelled":return new TY("The authentication has been aborted by the caller.");case"consent_required":case"interaction_required":case"login_required":yTe.info(Us(t,`Authentication returned errorCode ${n.errorCode}`));break;default:yTe.info(Us(t,`Failed to acquire token: ${e.message}`));break}}return e.name==="ClientConfigurationError"||e.name==="BrowserConfigurationAuthError"||e.name==="AbortError"||e.name==="AuthenticationError"?e:e.name==="NativeAuthError"?(yTe.info(Us(t,`Error from the native broker: ${e.message} with status code: ${e.statusCode}`)),e):new bx({scopes:t,getTokenOptions:r,message:e.message})}a(xY,"handleMsalError");function _an(t){return{localAccountId:t.homeAccountId,environment:t.authority,username:t.username,homeAccountId:t.homeAccountId,tenantId:t.tenantId}}a(_an,"publicToMsal");function van(t,e){return{authority:e.environment??Otn,homeAccountId:e.homeAccountId,tenantId:e.tenantId||Mtn,username:e.username,clientId:t,version:yan}}a(van,"msalToPublic");function C3t(t){let e=JSON.parse(t);if(e.version&&e.version!==yan)throw Error("Unsupported AuthenticationRecord version");return e}a(C3t,"deserializeAuthenticationRecord");p();p();p();p();p();p();function b2o(t,e){return e!=="Composite"&&e!=="Dictionary"&&(typeof t=="string"||typeof t=="number"||typeof t=="boolean"||e?.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)!==null||t===void 0||t===null)}a(b2o,"isPrimitiveBody");function S2o(t){let e=Object.assign(Object.assign({},t.headers),t.body);return t.hasNullableType&&Object.getOwnPropertyNames(e).length===0?t.shouldWrapBody?{body:null}:null:t.shouldWrapBody?Object.assign(Object.assign({},t.headers),{body:t.body}):e}a(S2o,"handleNullableResponseAndWrappableBody");function b3t(t,e){var r,n;let o=t.parsedHeaders;if(t.request.method==="HEAD")return Object.assign(Object.assign({},o),{body:t.parsedBody});let s=e&&e.bodyMapper,c=!!s?.nullable,l=s?.type.name;if(l==="Stream")return Object.assign(Object.assign({},o),{blobBody:t.blobBody,readableStreamBody:t.readableStreamBody});let u=l==="Composite"&&s.type.modelProperties||{},d=Object.keys(u).some(f=>u[f].serializedName==="");if(l==="Sequence"||d){let f=(r=t.parsedBody)!==null&&r!==void 0?r:[];for(let h of Object.keys(u))u[h].serializedName&&(f[h]=(n=t.parsedBody)===null||n===void 0?void 0:n[h]);if(o)for(let h of Object.keys(o))f[h]=o[h];return c&&!t.parsedBody&&!o&&Object.getOwnPropertyNames(u).length===0?null:f}return S2o({body:t.parsedBody,headers:o,hasNullableType:c,shouldWrapBody:b2o(t.parsedBody,l)})}a(b3t,"flattenResponse");var VM={Base64Url:"Base64Url",Boolean:"Boolean",ByteArray:"ByteArray",Composite:"Composite",Date:"Date",DateTime:"DateTime",DateTimeRfc1123:"DateTimeRfc1123",Dictionary:"Dictionary",Enum:"Enum",Number:"Number",Object:"Object",Sequence:"Sequence",String:"String",Stream:"Stream",TimeSpan:"TimeSpan",UnixTime:"UnixTime"};p();p();p();p();p();var WM=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};p();p();p();var Can=require("node:os"),ban=de(require("node:util"),1),San=de(require("node:process"),1);function Tan(t,...e){San.stderr.write(`${ban.default.format(t,...e)}${Can.EOL}`)}a(Tan,"log");var Ian=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,xan,S3t=[],T3t=[],vGe=[];Ian&&I3t(Ian);var wan=Object.assign(t=>Ran(t),{enable:I3t,enabled:x3t,disable:T2o,log:Tan});function I3t(t){xan=t,S3t=[],T3t=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?T3t.push(new RegExp(`^${n.substr(1)}$`)):S3t.push(new RegExp(`^${n}$`));for(let n of vGe)n.enabled=x3t(n.namespace)}a(I3t,"enable");function x3t(t){if(t.endsWith("*"))return!0;for(let e of T3t)if(e.test(t))return!1;for(let e of S3t)if(e.test(t))return!0;return!1}a(x3t,"enabled");function T2o(){let t=xan||"";return I3t(""),t}a(T2o,"disable");function Ran(t){let e=Object.assign(r,{enabled:x3t(t),destroy:I2o,log:wan.log,namespace:t,extend:x2o});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),vGe.push(e),e}a(Ran,"createDebugger");function I2o(){let t=vGe.indexOf(this);return t>=0?(vGe.splice(t,1),!0):!1}a(I2o,"destroy");function x2o(t){let e=Ran(`${this.namespace}:${t}`);return e.log=this.log,e}a(x2o,"extend");var Gce=wan;var w3t=["verbose","info","warning","error"],kan={verbose:400,info:300,warning:200,error:100};function Pan(t,e){e.log=(...r)=>{t.log(...r)}}a(Pan,"patchLogMethod");function Dan(t){return w3t.includes(t)}a(Dan,"isTypeSpecRuntimeLogLevel");function w2o(t){let e=new Set,r=typeof process<"u"&&process.env&&process.env[t.logLevelEnvVarName]||void 0,n,o=Gce(t.namespace);o.log=(...f)=>{Gce.log(...f)};function s(f){if(f&&!Dan(f))throw new Error(`Unknown log level '${f}'. Acceptable values: ${w3t.join(",")}`);n=f;let h=[];for(let m of e)c(m)&&h.push(m.namespace);Gce.enable(h.join(","))}a(s,"contextSetLogLevel"),r&&(Dan(r)?s(r):console.error(`${t.logLevelEnvVarName} set to unknown log level '${r}'; logging is not enabled. Acceptable values: ${w3t.join(", ")}.`));function c(f){return!!(n&&kan[f.level]<=kan[n])}a(c,"shouldEnable");function l(f,h){let m=Object.assign(f.extend(h),{level:h});if(Pan(f,m),c(m)){let g=Gce.disable();Gce.enable(g+","+m.namespace)}return e.add(m),m}a(l,"createLogger");function u(){return n}a(u,"contextGetLogLevel");function d(f){let h=o.extend(f);return Pan(o,h),{error:l(h,"error"),warning:l(h,"warning"),info:l(h,"info"),verbose:l(h,"verbose")}}return a(d,"contextCreateClientLogger"),{setLogLevel:s,getLogLevel:u,createClientLogger:d,logger:o}}a(w2o,"createLoggerContext");var Nan=w2o({logLevelEnvVarName:"TYPESPEC_RUNTIME_LOG_LEVEL",namespace:"typeSpecRuntime"}),R2o=Nan.logger;function _Te(t){return Nan.createClientLogger(t)}a(_Te,"createClientLogger");p();function CGe(t){return t.toLowerCase()}a(CGe,"normalizeName");function*k2o(t){for(let e of t.values())yield[e.name,e.value]}a(k2o,"headerIterator");var R3t=class{static{a(this,"HttpHeadersImpl")}constructor(e){if(this._headersMap=new Map,e)for(let r of Object.keys(e))this.set(r,e[r])}set(e,r){this._headersMap.set(CGe(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(CGe(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(CGe(e))}delete(e){this._headersMap.delete(CGe(e))}toJSON(e={}){let r={};if(e.preserveCase)for(let n of this._headersMap.values())r[n.name]=n.value;else for(let[n,o]of this._headersMap)r[n]=o.value;return r}toString(){return JSON.stringify(this.toJSON({preserveCase:!0}))}[Symbol.iterator](){return k2o(this._headersMap)}};function vS(t){return new R3t(t)}a(vS,"createHttpHeaders");p();p();p();var k3t=class{static{a(this,"PipelineRequestImpl")}constructor(e){var r,n,o,s,c,l,u;this.url=e.url,this.body=e.body,this.headers=(r=e.headers)!==null&&r!==void 0?r:vS(),this.method=(n=e.method)!==null&&n!==void 0?n:"GET",this.timeout=(o=e.timeout)!==null&&o!==void 0?o:0,this.multipartBody=e.multipartBody,this.formData=e.formData,this.disableKeepAlive=(s=e.disableKeepAlive)!==null&&s!==void 0?s:!1,this.proxySettings=e.proxySettings,this.streamResponseStatusCodes=e.streamResponseStatusCodes,this.withCredentials=(c=e.withCredentials)!==null&&c!==void 0?c:!1,this.abortSignal=e.abortSignal,this.onUploadProgress=e.onUploadProgress,this.onDownloadProgress=e.onDownloadProgress,this.requestId=e.requestId||qce(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1,this.requestOverrides=e.requestOverrides,this.authSchemes=e.authSchemes}};function bGe(t){return new k3t(t)}a(bGe,"createPipelineRequest");p();var Man=new Set(["Deserialize","Serialize","Retry","Sign"]),P3t=class t{static{a(this,"HttpPipeline")}constructor(e){var r;this._policies=[],this._policies=(r=e?.slice(0))!==null&&r!==void 0?r:[],this._orderedPolicies=void 0}addPolicy(e,r={}){if(r.phase&&r.afterPhase)throw new Error("Policies inside a phase cannot specify afterPhase.");if(r.phase&&!Man.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!Man.has(r.afterPhase))throw new Error(`Invalid afterPhase name: ${r.afterPhase}`);this._policies.push({policy:e,options:r}),this._orderedPolicies=void 0}removePolicy(e){let r=[];return this._policies=this._policies.filter(n=>e.name&&n.policy.name===e.name||e.phase&&n.options.phase===e.phase?(r.push(n.policy),!1):!0),this._orderedPolicies=void 0,r}sendRequest(e,r){return this.getOrderedPolicies().reduceRight((s,c)=>l=>c.sendRequest(l,s),s=>e.sendRequest(s))(r)}getOrderedPolicies(){return this._orderedPolicies||(this._orderedPolicies=this.orderPolicies()),this._orderedPolicies}clone(){return new t(this._policies)}static create(){return new t}orderPolicies(){let e=[],r=new Map;function n(A){return{name:A,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}a(n,"createPhase");let o=n("Serialize"),s=n("None"),c=n("Deserialize"),l=n("Retry"),u=n("Sign"),d=[o,s,c,l,u];function f(A){return A==="Retry"?l:A==="Serialize"?o:A==="Deserialize"?c:A==="Sign"?u:s}a(f,"getPhase");for(let A of this._policies){let y=A.policy,E=A.options,_=y.name;if(r.has(_))throw new Error("Duplicate policy names not allowed in pipeline");let v={policy:y,dependsOn:new Set,dependants:new Set};E.afterPhase&&(v.afterPhase=f(E.afterPhase),v.afterPhase.hasAfterPolicies=!0),r.set(_,v),f(E.phase).policies.add(v)}for(let A of this._policies){let{policy:y,options:E}=A,_=y.name,v=r.get(_);if(!v)throw new Error(`Missing node for policy ${_}`);if(E.afterPolicies)for(let b of E.afterPolicies){let T=r.get(b);T&&(v.dependsOn.add(T),T.dependants.add(v))}if(E.beforePolicies)for(let b of E.beforePolicies){let T=r.get(b);T&&(T.dependsOn.add(v),v.dependants.add(T))}}function h(A){A.hasRun=!0;for(let y of A.policies)if(!(y.afterPhase&&(!y.afterPhase.hasRun||y.afterPhase.policies.size))&&y.dependsOn.size===0){e.push(y.policy);for(let E of y.dependants)E.dependsOn.delete(y);r.delete(y.policy.name),A.policies.delete(y)}}a(h,"walkPhase");function m(){for(let A of d){if(h(A),A.policies.size>0&&A!==s){s.hasRun||h(s);return}A.hasAfterPolicies&&h(s)}}a(m,"walkPhases");let g=0;for(;r.size>0;){g++;let A=e.length;if(m(),e.length<=A&&g>1)throw new Error("Cannot satisfy policy dependencies due to requirements cycle.")}return e}};function SGe(){return P3t.create()}a(SGe,"createEmptyPipeline");p();p();var Oan=require("node:util"),Lan=Oan.inspect.custom;var P2o=new yP,TA=class t extends Error{static{a(this,"RestError")}constructor(e,r={}){super(e),this.name="RestError",this.code=r.code,this.statusCode=r.statusCode,Object.defineProperty(this,"request",{value:r.request,enumerable:!1}),Object.defineProperty(this,"response",{value:r.response,enumerable:!1}),Object.defineProperty(this,Lan,{value:a(()=>`RestError: ${this.message} - ${P2o.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`,"value"),enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}};TA.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";TA.PARSE_ERROR="PARSE_ERROR";function TGe(t){return t instanceof TA?!0:SY(t)&&t.name==="RestError"}a(TGe,"isRestError");p();p();var $ce=de(require("node:http"),1),Vce=de(require("node:https"),1),xGe=de(require("node:zlib"),1),Fan=require("node:stream");p();var kx=_Te("ts-http-runtime");var D2o={};function vTe(t){return t&&typeof t.pipe=="function"}a(vTe,"isReadableStream");function Ban(t){return t.readable===!1?Promise.resolve():new Promise(e=>{let r=a(()=>{e(),t.removeListener("close",r),t.removeListener("end",r),t.removeListener("error",r)},"handler");t.on("close",r),t.on("end",r),t.on("error",r)})}a(Ban,"isStreamComplete");function Uan(t){return t&&typeof t.byteLength=="number"}a(Uan,"isArrayBuffer");var IGe=class extends Fan.Transform{static{a(this,"ReportTransform")}_transform(e,r,n){this.push(e),this.loadedBytes+=e.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),n()}catch(o){n(o)}}constructor(e){super(),this.loadedBytes=0,this.progressCallback=e}},D3t=class{static{a(this,"NodeHttpClient")}constructor(){this.cachedHttpsAgents=new WeakMap}async sendRequest(e){var r,n,o;let s=new AbortController,c;if(e.abortSignal){if(e.abortSignal.aborted)throw new WM("The operation was aborted. Request has already been canceled.");c=a(m=>{m.type==="abort"&&s.abort()},"abortListener"),e.abortSignal.addEventListener("abort",c)}let l;e.timeout>0&&(l=setTimeout(()=>{let m=new yP;kx.info(`request to '${m.sanitizeUrl(e.url)}' timed out. canceling...`),s.abort()},e.timeout));let u=e.headers.get("Accept-Encoding"),d=u?.includes("gzip")||u?.includes("deflate"),f=typeof e.body=="function"?e.body():e.body;if(f&&!e.headers.has("Content-Length")){let m=L2o(f);m!==null&&e.headers.set("Content-Length",m)}let h;try{if(f&&e.onUploadProgress){let _=e.onUploadProgress,v=new IGe(_);v.on("error",b=>{kx.error("Error in upload progress",b)}),vTe(f)?f.pipe(v):v.end(f),f=v}let m=await this.makeRequest(e,s,f);l!==void 0&&clearTimeout(l);let g=N2o(m),y={status:(r=m.statusCode)!==null&&r!==void 0?r:0,headers:g,request:e};if(e.method==="HEAD")return m.resume(),y;h=d?M2o(m,g):m;let E=e.onDownloadProgress;if(E){let _=new IGe(E);_.on("error",v=>{kx.error("Error in download progress",v)}),h.pipe(_),h=_}return!((n=e.streamResponseStatusCodes)===null||n===void 0)&&n.has(Number.POSITIVE_INFINITY)||!((o=e.streamResponseStatusCodes)===null||o===void 0)&&o.has(y.status)?y.readableStreamBody=h:y.bodyAsText=await O2o(h),y}finally{if(e.abortSignal&&c){let m=Promise.resolve();vTe(f)&&(m=Ban(f));let g=Promise.resolve();vTe(h)&&(g=Ban(h)),Promise.all([m,g]).then(()=>{var A;c&&((A=e.abortSignal)===null||A===void 0||A.removeEventListener("abort",c))}).catch(A=>{kx.warning("Error when cleaning up abortListener on httpRequest",A)})}}}makeRequest(e,r,n){var o;let s=new URL(e.url),c=s.protocol!=="https:";if(c&&!e.allowInsecureConnection)throw new Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);let l=(o=e.agent)!==null&&o!==void 0?o:this.getOrCreateAgent(e,c),u=Object.assign({agent:l,hostname:s.hostname,path:`${s.pathname}${s.search}`,port:s.port,method:e.method,headers:e.headers.toJSON({preserveCase:!0})},e.requestOverrides);return new Promise((d,f)=>{let h=c?$ce.request(u,d):Vce.request(u,d);h.once("error",m=>{var g;f(new TA(m.message,{code:(g=m.code)!==null&&g!==void 0?g:TA.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new WM("The operation was aborted. Rejecting from abort signal callback while making request.");h.destroy(m),f(m)}),n&&vTe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):Uan(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(kx.error("Unrecognized body type",n),f(new TA("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?$ce.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new $ce.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return Vce.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:D2o,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(kx.info("No cached TLS Agent exist, creating a new Agent"),c=new Vce.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function N2o(t){let e=vS();for(let r of Object.keys(t.headers)){let n=t.headers[r];Array.isArray(n)?n.length>0&&e.set(r,n[0]):n&&e.set(r,n)}return e}a(N2o,"getResponseHeaders");function M2o(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=xGe.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=xGe.createInflate();return t.pipe(n),n}return t}a(M2o,"getDecodedResponseStream");function O2o(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{Buffer.isBuffer(o)?n.push(o):n.push(Buffer.from(o))}),t.on("end",()=>{e(Buffer.concat(n).toString("utf8"))}),t.on("error",o=>{o&&o?.name==="AbortError"?r(o):r(new TA(`Error reading response as text: ${o.message}`,{code:TA.PARSE_ERROR}))})})}a(O2o,"streamToText");function L2o(t){return t?Buffer.isBuffer(t)?t.length:vTe(t)?null:Uan(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(L2o,"getBodyLength");function Qan(){return new D3t}a(Qan,"createNodeHttpClient");function wGe(){return Qan()}a(wGe,"createDefaultHttpClient");p();p();p();p();var N3t="logPolicy";function RGe(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:kx.info,n=new yP({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:N3t,async sendRequest(o,s){if(!r.enabled)return s(o);r(`Request: ${n.sanitize(o)}`);let c=await s(o);return r(`Response status code: ${c.status}`),r(`Headers: ${n.sanitize(c.headers)}`),c}}}a(RGe,"logPolicy");p();var M3t="redirectPolicy",qan=["GET","HEAD"];function kGe(t={}){let{maxRetries:e=20}=t;return{name:M3t,async sendRequest(r,n){let o=await n(r);return jan(n,o,e)}}}a(kGe,"redirectPolicy");async function jan(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&qan.includes(o.method)||s===302&&qan.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{let s,c,l=a(()=>o(new WM(r?.abortErrorMsg?r?.abortErrorMsg:B2o)),"rejectOnAbort"),u=a(()=>{r?.abortSignal&&c&&r.abortSignal.removeEventListener("abort",c)},"removeListeners");if(c=a(()=>(s&&clearTimeout(s),u(),l()),"onAborted"),r?.abortSignal&&r.abortSignal.aborted)return l();s=setTimeout(()=>{u(),n(e)},t),r?.abortSignal&&r.abortSignal.addEventListener("abort",c)})}a($an,"delay");function Van(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(Van,"parseHeaderValueAsNumber");var L3t="Retry-After",F2o=["retry-after-ms","x-ms-retry-after-ms",L3t];function Wan(t){if(t&&[429,503].includes(t.status))try{for(let o of F2o){let s=Van(t,o);if(s===0||s)return s*(o===L3t?1e3:1)}let e=t.headers.get(L3t);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(Wan,"getRetryAfterInMs");function zan(t){return Number.isFinite(Wan(t))}a(zan,"isThrottlingRetryResponse");function B3t(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=Wan(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(B3t,"throttlingRetryStrategy");var U2o=1e3,Q2o=1e3*64;function DGe(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:U2o,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:Q2o;return{name:"exponentialRetryStrategy",retry({retryCount:s,response:c,responseError:l}){let u=j2o(l),d=u&&t.ignoreSystemErrors,f=q2o(c),h=f&&t.ignoreHttpStatusCodes;return c&&(zan(c)||!f)||h||d?{skipStrategy:!0}:l&&!u&&!f?{errorToThrow:l}:ATe(s,{retryDelayInMs:n,maxRetryDelayInMs:o})}}}a(DGe,"exponentialRetryStrategy");function q2o(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(q2o,"isExponentialRetryResponse");function j2o(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(j2o,"isSystemError");p();var H2o=_Te("ts-http-runtime retryPolicy"),G2o="retryPolicy";function rQ(t,e={maxRetries:3}){let r=e.logger||H2o;return{name:G2o,async sendRequest(n,o){var s,c;let l,u,d=-1;e:for(;;){d+=1,l=void 0,u=void 0;try{r.info(`Retry ${d}: Attempting to send request`,n.requestId),l=await o(n),r.info(`Retry ${d}: Received a response from request`,n.requestId)}catch(f){if(r.error(`Retry ${d}: Received an error from request`,n.requestId),u=f,!f||u.name!=="RestError")throw f;l=u.response}if(!((s=n.abortSignal)===null||s===void 0)&&s.aborted)throw r.error(`Retry ${d}: Request aborted.`),new WM;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:3)){if(r.info(`Retry ${d}: Maximum retries reached. Returning the last received response, or throwing the last received error.`),u)throw u;if(l)return l;throw new Error("Maximum retries reached with no response or error to throw")}r.info(`Retry ${d}: Processing ${t.length} retry strategies.`);t:for(let f of t){let h=f.logger||r;h.info(`Retry ${d}: Processing retry strategy ${f.name}.`);let m=f.retry({retryCount:d,response:l,responseError:u});if(m.skipStrategy){h.info(`Retry ${d}: Skipped.`);continue t}let{errorToThrow:g,retryAfterInMs:A,redirectTo:y}=m;if(g)throw h.error(`Retry ${d}: Retry strategy ${f.name} throws error:`,g),g;if(A||A===0){h.info(`Retry ${d}: Retry strategy ${f.name} retries after ${A}`),await $an(A,void 0,{abortSignal:n.abortSignal});continue e}if(y){h.info(`Retry ${d}: Retry strategy ${f.name} redirects to ${y}`),n.url=y;continue e}}if(u)throw r.info("None of the retry strategies could work with the received error. Throwing it."),u;if(l)return r.info("None of the retry strategies could work with the received response. Returning it."),l}}}}a(rQ,"retryPolicy");var F3t="defaultRetryPolicy";function NGe(t={}){var e;return{name:F3t,sendRequest:rQ([B3t(),DGe(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:3}).sendRequest}}a(NGe,"defaultRetryPolicy");p();var U3t="formDataPolicy";function $2o(t){var e;let r={};for(let[n,o]of t.entries())(e=r[n])!==null&&e!==void 0||(r[n]=[]),r[n].push(o);return r}a($2o,"formDataToFormDataMap");function MGe(){return{name:U3t,async sendRequest(t,e){if(tQ&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=$2o(t.body),t.body=void 0),t.formData){let r=t.headers.get("Content-Type");r&&r.indexOf("application/x-www-form-urlencoded")!==-1?t.body=V2o(t.formData):await W2o(t.formData,t),t.formData=void 0}return e(t)}}}a(MGe,"formDataPolicy");function V2o(t){let e=new URLSearchParams;for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.append(r,o.toString());else e.append(r,n.toString());return e.toString()}a(V2o,"wwwFormUrlEncode");async function W2o(t,e){let r=e.headers.get("Content-Type");if(r&&!r.startsWith("multipart/form-data"))return;e.headers.set("Content-Type",r??"multipart/form-data");let n=[];for(let[o,s]of Object.entries(t))for(let c of Array.isArray(s)?s:[s])if(typeof c=="string")n.push({headers:vS({"Content-Disposition":`form-data; name="${o}"`}),body:IC(c,"utf-8")});else{if(c==null||typeof c!="object")throw new Error(`Unexpected value for key ${o}: ${c}. Value should be serialized to string first.`);{let l=c.name||"blob",u=vS();u.set("Content-Disposition",`form-data; name="${o}"; filename="${l}"`),u.set("Content-Type",c.type||"application/octet-stream"),n.push({headers:u,body:c})}}e.multipartBody={parts:n}}a(W2o,"prepareFormData");p();var Ecn=de(W3t(),1),_cn=de(z3t(),1);var qDo="HTTPS_PROXY",jDo="HTTP_PROXY",HDo="ALL_PROXY",GDo="NO_PROXY",Y3t="proxyPolicy",gcn=[],vcn=!1,$Do=new Map;function jGe(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(jGe,"getEnvironmentValue");function VDo(){if(!process)return;let t=jGe(qDo),e=jGe(HDo),r=jGe(jDo);return t||e||r}a(VDo,"loadEnvironmentProxyValue");function WDo(t,e,r){if(e.length===0)return!1;let n=new URL(t).hostname;if(r?.has(n))return r.get(n);let o=!1;for(let s of e)s[0]==="."?(n.endsWith(s)||n.length===s.length-1&&n===s.slice(1))&&(o=!0):n===s&&(o=!0);return r?.set(n,o),o}a(WDo,"isBypassed");function zDo(){let t=jGe(GDo);return vcn=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(zDo,"loadNoProxy");function YDo(){let t=VDo();return t?new URL(t):void 0}a(YDo,"getDefaultProxySettingsInternal");function Acn(t){let e;try{e=new URL(t.host)}catch{throw new Error(`Expecting a valid host string in proxy settings, but found "${t.host}".`)}return e.port=String(t.port),t.username&&(e.username=t.username),t.password&&(e.password=t.password),e}a(Acn,"getUrlFromProxySettings");function ycn(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&kx.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");let s=t.headers.toJSON();o?(e.httpProxyAgent||(e.httpProxyAgent=new _cn.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new Ecn.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(ycn,"setProxyAgentOnRequest");function HGe(t,e){vcn||gcn.push(...zDo());let r=t?Acn(t):YDo(),n={};return{name:Y3t,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!WDo(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:gcn,e?.customNoProxyList?void 0:$Do)?ycn(o,n,r):o.proxySettings&&ycn(o,n,Acn(o.proxySettings)),s(o)}}}a(HGe,"proxyPolicy");p();var K3t="agentPolicy";function GGe(t){return{name:K3t,sendRequest:a(async(e,r)=>(e.agent||(e.agent=t),r(e)),"sendRequest")}}a(GGe,"agentPolicy");p();var J3t="tlsPolicy";function $Ge(t){return{name:J3t,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a($Ge,"tlsPolicy");p();p();function VGe(t){return typeof t.stream=="function"}a(VGe,"isBlob");p();m3();var JGe=require("stream");function Wcn(){return bTe(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield SS(e.read());if(r)return yield SS(void 0);yield yield SS(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(Wcn,"streamAsyncIterator");function XDo(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=Wcn.bind(t)),t.values||(t.values=Wcn.bind(t))}a(XDo,"makeAsyncIterable");function zcn(t){return t instanceof ReadableStream?(XDo(t),JGe.Readable.fromWeb(t)):t}a(zcn,"ensureNodeStream");function eNo(t){return t instanceof Uint8Array?JGe.Readable.from(Buffer.from(t)):VGe(t)?zcn(t.stream()):zcn(t)}a(eNo,"toStream");async function Ycn(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(eNo);return JGe.Readable.from((function(){return bTe(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,KGe(d)),u;u=yield SS(l.next()),r=u.done,!r;c=!0)s=u.value,c=!1,yield yield SS(s)}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield SS(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(Ycn,"concat");function tNo(){return`----AzSDKFormBoundary${qce()}`}a(tNo,"generateBoundary");function rNo(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r -`;return e}a(rNo,"encodeHeaders");function nNo(t){return t instanceof Uint8Array?t.byteLength:VGe(t)?t.size===-1?void 0:t.size:void 0}a(nNo,"getLength");function iNo(t){let e=0;for(let r of t){let n=nNo(r);if(n===void 0)return;e+=n}return e}a(iNo,"getTotalLength");async function oNo(t,e,r){let n=[IC(`--${r}`,"utf-8"),...e.flatMap(s=>[IC(`\r -`,"utf-8"),IC(rNo(s.headers),"utf-8"),IC(`\r -`,"utf-8"),s.body,IC(`\r ---${r}`,"utf-8")]),IC(`--\r +Error Description: '${s.message}'`,this.correlationId)}return null}return n||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request.",this.correlationId),this.logger.verbose("Creating custom Authority for custom domain scenario.",this.correlationId),n=t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),n}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(r=>r&&Is.getDomainFromUrl(r).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,r){let n;if(r&&r.azureCloudInstance!==m3.None){let o=r.tenant?r.tenant:NSe;n=`${r.azureCloudInstance}/${o}/`}return n||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return m4t;if(this.discoveryComplete())return this.metadata.preferred_cache;throw Pt(bP)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return CBt.has(e)}static isPublicCloudAuthority(e){return T4t.indexOf(e)>=0}static buildRegionalAuthorityString(e,r,n){let o=new Is(e);o.validateAsUri();let s=o.getUrlComponents(),c=`${r}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(c=`${r}.${S4t}`);let l=Is.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:c}).urlString;return n?`${l}?${n}`:l}static replaceWithRegionalInformation(e,r){let n={...e};return n.authorization_endpoint=t.buildRegionalAuthorityString(n.authorization_endpoint,r),n.token_endpoint=t.buildRegionalAuthorityString(n.token_endpoint,r),n.end_session_endpoint&&(n.end_session_endpoint=t.buildRegionalAuthorityString(n.end_session_endpoint,r)),n}static transformCIAMAuthority(e){let r=e,o=new Is(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(iHe)){let s=o.HostNameAndPort.split(".")[0];r=`${r}${s}${E4t}`}return r}};SP.reservedTenantDomains=new Set(["{tenant}","{tenantid}",vP.COMMON,vP.CONSUMERS,vP.ORGANIZATIONS]);function oin(t){let n=new Is(t).getUrlComponents().PathSegments.slice(-1)[0]?.toLowerCase();switch(n){case vP.COMMON:case vP.ORGANIZATIONS:case vP.CONSUMERS:return;default:return n}}a(oin,"getTenantFromAuthorityString");function qHe(t){return t.endsWith(lce)?t:`${t}${lce}`}a(qHe,"formatAuthorityUri");function FBt(t){let e=t.cloudDiscoveryMetadata,r;if(e)try{r=JSON.parse(e)}catch{throw Cl(CHe)}return{canonicalAuthority:t.authority?qHe(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:r}}a(FBt,"buildStaticAuthorityOptions");async function UBt(t,e,r,n,o,s,c){let l=SP.transformCIAMAuthority(qHe(t)),u=new SP(l,e,r,n,o,s,c);try{return await Js(u.resolveEndpointsAsync.bind(u),Hnn,o,c,s)(),u}catch{throw Pt(bP)}}a(UBt,"createDiscoveredInstance");var gTe=class{static{a(this,"AuthorizationCodeClient")}constructor(e,r){this.includeRedirectUri=!0,this.config=A3(e),this.logger=new a0(this.config.loggerOptions,rQ,zM),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async acquireToken(e,r,n){if(!e.code)throw Pt(JLt);n&&n.cloud_instance_host_name&&await Js(this.updateTokenEndpointAuthority.bind(this),jnn,this.logger,this.performanceClient,e.correlationId)(n.cloud_instance_host_name,e.correlationId);let o=vS(),s=await Js(this.executeTokenRequest.bind(this),Qnn,this.logger,this.performanceClient,e.correlationId)(this.authority,e,this.serverTelemetryManager),c=s.headers?.[Wp.X_MS_REQUEST_ID],l=new Yp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return l.validateTokenResponse(s.body,e.correlationId),Js(l.handleServerTokenResponse.bind(l),LHe,this.logger,this.performanceClient,e.correlationId)(s.body,this.authority,o,e,r,n,void 0,void 0,void 0,c)}getLogoutUri(e){if(!e)throw Cl(FLt);let r=this.createLogoutUrlQueryString(e);return Is.appendQueryString(this.authority.endSessionEndpoint,r)}async executeTokenRequest(e,r,n){let o=pTe(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),s=Is.appendQueryString(e.tokenEndpoint,o),c=await Js(this.createTokenRequestBody.bind(this),qnn,this.logger,this.performanceClient,r.correlationId)(r),l;if(r.clientInfo)try{let f=Cce(r.clientInfo,this.cryptoUtils.base64Decode);l={credential:`${f.uid}${fce}${f.utid}`,type:O_.HOME_ACCOUNT_ID}}catch(f){this.logger.verbose(`Could not parse client info for CCS Header: '${f}'`,r.correlationId)}let u=fTe(this.logger,this.config.systemOptions.preventCorsPreflight,l||r.ccsCredential),d=xce(this.config.authOptions.clientId,r);return Js(hTe,Onn,this.logger,this.performanceClient,r.correlationId)(s,c,u,d,r.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,n)}async createTokenRequestBody(e){let r=new Map;if(_Y(r,e.embeddedClientId||e.extraParameters?.[VM]||this.config.authOptions.clientId),this.includeRedirectUri)vY(r,e.redirectUri);else if(!e.redirectUri)throw Cl(NLt);if(EY(r,e.scopes,!0,this.oidcDefaultScopes),nTe(r,e.resource),hBt(r,e.code),$Se(r,this.config.libraryInfo),VSe(r,this.config.telemetry.application),rTe(r),this.serverTelemetryManager&&!PHe(this.config)&&tTe(r,this.serverTelemetryManager),e.codeVerifier&&gBt(r,e.codeVerifier),this.config.clientCredentials.clientSecret&&zSe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let o=this.config.clientCredentials.clientAssertion;YSe(r,await L_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),KSe(r,o.assertionType)}if(JSe(r,LSe.AUTHORIZATION_CODE_GRANT),SY(r),e.authenticationScheme===Ef.POP){let o=new iQ(this.cryptoUtils,this.performanceClient),s;e.popKid?s=this.cryptoUtils.encodeKid(e.popKid):s=(await Js(o.generateCnf.bind(o),Ice,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,XSe(r,s)}else if(e.authenticationScheme===Ef.SSH)if(e.sshJwk)eTe(r,e.sshJwk);else throw Cl(qSe);(!pu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&CY(r,e.claims,this.config.authOptions.clientCapabilities);let n;if(e.clientInfo)try{let o=Cce(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${o.uid}${fce}${o.utid}`,type:O_.HOME_ACCOUNT_ID}}catch(o){this.logger.verbose(`Could not parse client info for CCS Header: '${o}'`,e.correlationId)}else n=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&n)switch(n.type){case O_.HOME_ACCOUNT_ID:try{let o=YM(n.credential);f3(r,o)}catch(o){this.logger.verbose(`Could not parse home account ID for CCS Header: '${o}'`,e.correlationId)}break;case O_.UPN:tQ(r,n.credential);break}return e.embeddedClientId&&h3(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&p3(r,e.extraParameters),e.enableSpaAuthorizationCode&&(!e.extraParameters||!e.extraParameters[yHe])&&p3(r,{[yHe]:"1"}),yY(r,e.correlationId,this.performanceClient),WM(r)}createLogoutUrlQueryString(e){let r=new Map;return e.postLogoutRedirectUri&&lBt(r,e.postLogoutRedirectUri),e.correlationId&&bY(r,e.correlationId),e.idTokenHint&&uBt(r,e.idTokenHint),e.state&&WSe(r,e.state),e.logoutHint&&yBt(r,e.logoutHint),e.extraQueryParameters&&p3(r,e.extraQueryParameters),this.config.authOptions.instanceAware&&ZSe(r),WM(r)}async updateTokenEndpointAuthority(e,r){let n=`https://${e}/${this.authority.tenant}/`,o=await UBt(n,this.networkClient,this.cacheManager,this.authority.options,this.logger,r,this.performanceClient);this.authority=o}};p();var vxo=300,RY=class{static{a(this,"RefreshTokenClient")}constructor(e,r){this.config=A3(e),this.logger=new a0(this.config.loggerOptions,rQ,zM),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r}async acquireToken(e,r){let n=vS(),o=await Js(this.executeTokenRequest.bind(this),Lnn,this.logger,this.performanceClient,e.correlationId)(e,this.authority),s=o.headers?.[Wp.X_MS_REQUEST_ID],c=new Yp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return c.validateTokenResponse(o.body,e.correlationId),Js(c.handleServerTokenResponse.bind(c),LHe,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,n,e,r,void 0,void 0,!0,e.forceCache,s)}async acquireTokenByRefreshToken(e,r){if(!e)throw Cl(BLt);if(!e.account)throw Pt(HSe);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await Js(this.acquireTokenWithCachedRefreshToken.bind(this),OHe,this.logger,this.performanceClient,e.correlationId)(e,!0,r)}catch(o){let s=o instanceof CS&&o.errorCode===BHe,c=o instanceof M_&&o.errorCode===G4t&&o.subError===$4t;if(s||c)return Js(this.acquireTokenWithCachedRefreshToken.bind(this),OHe,this.logger,this.performanceClient,e.correlationId)(e,!1,r);throw o}return Js(this.acquireTokenWithCachedRefreshToken.bind(this),OHe,this.logger,this.performanceClient,e.correlationId)(e,!1,r)}async acquireTokenWithCachedRefreshToken(e,r,n){let o=Jnn(this.cacheManager.getRefreshToken.bind(this.cacheManager),Knn,this.logger,this.performanceClient,e.correlationId)(e.account,r,e.correlationId,void 0);if(!o)throw QHe(BHe);if(o.expiresOn){let c=e.refreshTokenExpirationOffsetSeconds||vxo;if(this.performanceClient?.addFields({cacheRtExpiresOnSeconds:Number(o.expiresOn),rtOffsetSeconds:c},e.correlationId),Sce(o.expiresOn,c))throw QHe(PBt)}let s={...e,refreshToken:o.secret,authenticationScheme:e.authenticationScheme||Ef.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:O_.HOME_ACCOUNT_ID}};try{return await Js(this.acquireToken.bind(this),Bnn,this.logger,this.performanceClient,e.correlationId)(s,n)}catch(c){if(c instanceof CS&&c.subError===uTe){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache",e.correlationId);let l=this.cacheManager.generateCredentialKey(o);this.cacheManager.removeRefreshToken(l,e.correlationId)}throw c}}async executeTokenRequest(e,r){let n=pTe(e,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),o=Is.appendQueryString(r.tokenEndpoint,n),s=await Js(this.createTokenRequestBody.bind(this),Fnn,this.logger,this.performanceClient,e.correlationId)(e),c=fTe(this.logger,this.config.systemOptions.preventCorsPreflight,e.ccsCredential),l=xce(this.config.authOptions.clientId,e);return Js(hTe,Mnn,this.logger,this.performanceClient,e.correlationId)(o,s,c,l,e.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,this.serverTelemetryManager)}async createTokenRequestBody(e){let r=new Map;if(_Y(r,e.embeddedClientId||e.extraParameters?.[VM]||this.config.authOptions.clientId),e.redirectUri&&vY(r,e.redirectUri),EY(r,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),JSe(r,LSe.REFRESH_TOKEN_GRANT),SY(r),$Se(r,this.config.libraryInfo),VSe(r,this.config.telemetry.application),rTe(r),this.serverTelemetryManager&&!PHe(this.config)&&tTe(r,this.serverTelemetryManager),mBt(r,e.refreshToken),this.config.clientCredentials.clientSecret&&zSe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let n=this.config.clientCredentials.clientAssertion;YSe(r,await L_(n.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),KSe(r,n.assertionType)}if(e.authenticationScheme===Ef.POP){let n=new iQ(this.cryptoUtils,this.performanceClient),o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await Js(n.generateCnf.bind(n),Ice,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,XSe(r,o)}else if(e.authenticationScheme===Ef.SSH)if(e.sshJwk)eTe(r,e.sshJwk);else throw Cl(qSe);if((!pu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&CY(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case O_.HOME_ACCOUNT_ID:try{let n=YM(e.ccsCredential.credential);f3(r,n)}catch(n){this.logger.verbose(`Could not parse home account ID for CCS Header: '${n}'`,e.correlationId)}break;case O_.UPN:tQ(r,e.ccsCredential.credential);break}return e.embeddedClientId&&h3(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&p3(r,{...e.extraParameters}),yY(r,e.correlationId,this.performanceClient),WM(r)}};p();var ATe=class{static{a(this,"SilentFlowClient")}constructor(e,r){this.config=A3(e),this.logger=new a0(this.config.loggerOptions,rQ,zM),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r}async acquireCachedToken(e){let r=CP.NOT_APPLICABLE;if(e.forceRefresh||!pu.isEmptyObj(e.claims))throw this.setCacheOutcome(CP.FORCE_REFRESH_OR_CLAIMS,e.correlationId),Pt(Ece);if(!e.account)throw Pt(HSe);let n=e.account.tenantId||oin(e.authority),o=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,o,n);if(s){if(TBt(s.cachedAt)||Sce(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(CP.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),Pt(Ece);if(e.resource){if(s.resource!==e.resource)throw this.setCacheOutcome(CP.NO_CACHED_ACCESS_TOKEN,e.correlationId),Pt(Ece)}else s.refreshOn&&Sce(s.refreshOn,0)&&(r=CP.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(CP.NO_CACHED_ACCESS_TOKEN,e.correlationId),Pt(Ece);let c=e.authority||this.authority.getPreferredCache(),l={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:s,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,o,n),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(c,e.correlationId)};return this.setCacheOutcome(r,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Js(this.generateResultFromCacheRecord.bind(this),Unn,this.logger,this.performanceClient,e.correlationId)(l,e),r]}setCacheOutcome(e,r){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},r),e!==CP.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: '${e}'`,r)}async generateResultFromCacheRecord(e,r){let n;if(e.idToken&&(n=g3(e.idToken.secret,this.config.cryptoInterface.base64Decode)),r.maxAge||r.maxAge===0){let o=n?.auth_time;if(!o)throw Pt(jSe);iTe(o,r.maxAge)}return Yp.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,r,this.performanceClient,n)}};var yTe={};Ri(yTe,{getAuthorizationCodePayload:()=>Sxo,getAuthorizeUrl:()=>bxo,getStandardAuthorizeRequestParameters:()=>Cxo,validateAuthorizationResponse:()=>sin});p();function Cxo(t,e,r,n){let o=e.correlationId,s=new Map;_Y(s,e.embeddedClientId||e.extraQueryParameters?.[VM]||t.clientId);let c=[...e.scopes||[],...e.extraScopesToConsent||[]];if(EY(s,c,!0,t.authority.options.OIDCOptions?.defaultScopes),nTe(s,e.resource),vY(s,e.redirectUri),bY(s,o),cBt(s,e.responseMode),SY(s),ABt(s),e.prompt&&(fBt(s,e.prompt),n?.addFields({prompt:e.prompt},o)),e.domainHint&&(dBt(s,e.domainHint),n?.addFields({domainHintFromRequest:!0},o)),e.prompt!==OSe.SELECT_ACCOUNT)if(e.sid&&e.prompt===OSe.NONE)r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request",e.correlationId),xHe(s,e.sid),n?.addFields({sidFromRequest:!0},o);else if(e.account){let l=Ixo(e.account),u=xxo(e.account);if(u&&e.domainHint&&(r.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint',e.correlationId),u=null),u){r.verbose("createAuthCodeUrlQueryString: login_hint claim present on account",e.correlationId),_ce(s,u),n?.addFields({loginHintFromClaim:!0},o);try{let d=YM(e.account.homeAccountId);f3(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(l&&e.prompt===OSe.NONE){r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account",e.correlationId),xHe(s,l),n?.addFields({sidFromClaim:!0},o);try{let d=YM(e.account.homeAccountId);f3(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(e.loginHint)r.verbose("createAuthCodeUrlQueryString: Adding login_hint from request",e.correlationId),_ce(s,e.loginHint),tQ(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o);else if(e.account.username){r.verbose("createAuthCodeUrlQueryString: Adding login_hint from account",e.correlationId),_ce(s,e.account.username),n?.addFields({loginHintFromUpn:!0},o);try{let d=YM(e.account.homeAccountId);f3(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}}else e.loginHint&&(r.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request",e.correlationId),_ce(s,e.loginHint),tQ(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o));else r.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints",e.correlationId);return e.nonce&&pBt(s,e.nonce),e.state&&WSe(s,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&CY(s,e.claims,t.clientCapabilities),e.embeddedClientId&&h3(s,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(mce))&&ZSe(s),s}a(Cxo,"getStandardAuthorizeRequestParameters");function bxo(t,e){let r=WM(e);return Is.appendQueryString(t.authorizationEndpoint,r)}a(bxo,"getAuthorizeUrl");function Sxo(t,e){if(sin(t,e),!t.code)throw Pt(nBt);return t}a(Sxo,"getAuthorizationCodePayload");function sin(t,e){if(!t.state||!e)throw t.state?Pt(THe,"Cached State"):Pt(THe,"Server State");let r,n;try{r=decodeURIComponent(t.state)}catch{throw Pt(AY,t.state)}try{n=decodeURIComponent(e)}catch{throw Pt(AY,t.state)}if(r!==n)throw Pt(WLt);if(t.error||t.error_description||t.suberror){let o=Txo(t);throw UHe(t.error,t.error_description,t.suberror)?new CS(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",o):new M_(t.error||"",t.error_description,t.suberror,o)}}a(sin,"validateAuthorizationResponse");function Txo(t){let e="code=",r=t.error_uri?.lastIndexOf(e);return r&&r>=0?t.error_uri?.substring(r+e.length):void 0}a(Txo,"parseServerErrorNo");function Ixo(t){return t.idTokenClaims?.sid||null}a(Ixo,"extractAccountSid");function xxo(t){return t.loginHint||t.idTokenClaims?.login_hint||null}a(xxo,"extractLoginHint");p();function kY(t,e){if(t){if(e.resource&&(ain(e.extraParameters)||ain(e.extraQueryParameters)))throw Pt(aBt);if(!e.resource)throw Pt(sBt)}}a(kY,"enforceResourceParameter");function ain(t){return t?Object.prototype.hasOwnProperty.call(t,"resource"):!1}a(ain,"containsResourceParam");var Rce={};Ri(Rce,{postRequestFailed:()=>Rxo,unexpectedError:()=>wxo});p();var wxo="unexpected_error",Rxo="post_request_failed";p();var cin=",",lin="|";function kxo(t){let{skus:e,libraryName:r,libraryVersion:n,extensionName:o,extensionVersion:s}=t,c=new Map([[0,[r,n]],[2,[o,s]]]),l=[];if(e?.length){if(l=e.split(cin),l.length<4)return e}else l=Array.from({length:4},()=>lin);return c.forEach((u,d)=>{u.length===2&&u[0]?.length&&u[1]?.length&&Pxo({skuArr:l,index:d,skuName:u[0],skuVersion:u[1]})}),l.join(cin)}a(kxo,"makeExtraSkuString");function Pxo(t){let{skuArr:e,index:r,skuName:n,skuVersion:o}=t;r>=e.length||(e[r]=[n,o].join(lin))}a(Pxo,"setSku");var PY=class t{static{a(this,"ServerTelemetryManager")}constructor(e,r){this.cacheOutcome=CP.NOT_APPLICABLE,this.cacheManager=r,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||"",this.wrapperVer=e.wrapperVer||"",this.telemetryCacheKey=BSe+pY+e.clientId}generateCurrentRequestHeaderValue(){let e=`${this.apiId}${Z7}${this.cacheOutcome}`,r=[this.wrapperSKU,this.wrapperVer],n=this.getNativeBrokerErrorCode();n?.length&&r.push(`broker_error=${n}`);let o=r.join(Z7),s=this.getRegionDiscoveryFields(),c=[e,s].join(Z7);return[fHe,c,o].join(pHe)}generateLastRequestHeaderValue(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.failedRequests.slice(0,2*r).join(Z7),o=e.errors.slice(0,r).join(Z7),s=e.errors.length,c=r=B4t&&(r.failedRequests.shift(),r.failedRequests.shift(),r.errors.shift()),r.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Fo?e.subError?r.errors.push(e.subError):e.errorCode?r.errors.push(e.errorCode):r.errors.push(e.toString()):r.errors.push(e.toString()):r.errors.push(Q4t),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r,this.correlationId)}incrementCacheHits(){let e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){let e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey,this.correlationId)||e}clearTelemetryCache(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.errors.length;if(r===n)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{let o={failedRequests:e.failedRequests.slice(r*2),errors:e.errors.slice(r),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o,this.correlationId)}}static maxErrorsToSend(e){let r,n=0,o=0,s=e.errors.length;for(r=0;rJSON.parse(l)),lastUpdatedAt:Date.now().toString()},c={};nQ.toObject(c,s),r[n]=c}),r}static deserializeIdTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,realm:o.realm,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeAccessTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,realm:o.realm,target:o.target,cachedAt:o.cached_at,expiresOn:o.expires_on,extendedExpiresOn:o.extended_expires_on,refreshOn:o.refresh_on,keyId:o.key_id,tokenType:o.token_type,userAssertionHash:o.userAssertionHash,resource:o.resource,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeRefreshTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,familyId:o.family_id,target:o.target,realm:o.realm,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeAppMetadata(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n];r[n]={clientId:o.client_id,environment:o.environment,familyId:o.family_id}}),r}static deserializeAllCache(e){return{accounts:e.Account?this.deserializeAccounts(e.Account):{},idTokens:e.IdToken?this.deserializeIdTokens(e.IdToken):{},accessTokens:e.AccessToken?this.deserializeAccessTokens(e.AccessToken):{},refreshTokens:e.RefreshToken?this.deserializeRefreshTokens(e.RefreshToken):{},appMetadata:e.AppMetadata?this.deserializeAppMetadata(e.AppMetadata):{}}}};p();p();var uin="system_assigned_managed_identity",Dxo="managed_identity",qBt=`https://login.microsoftonline.com/${Dxo}/`,xC={AUTHORIZATION_HEADER_NAME:"Authorization",METADATA_HEADER_NAME:"Metadata",APP_SERVICE_SECRET_HEADER_NAME:"X-IDENTITY-HEADER",ML_AND_SF_SECRET_HEADER_NAME:"secret"},Gh={API_VERSION:"api-version",RESOURCE:"resource",SHA256_TOKEN_TO_REFRESH:"token_sha256_to_refresh",XMS_CC:"xms_cc"},Wi={AZURE_POD_IDENTITY_AUTHORITY_HOST:"AZURE_POD_IDENTITY_AUTHORITY_HOST",DEFAULT_IDENTITY_CLIENT_ID:"DEFAULT_IDENTITY_CLIENT_ID",IDENTITY_ENDPOINT:"IDENTITY_ENDPOINT",IDENTITY_HEADER:"IDENTITY_HEADER",IDENTITY_SERVER_THUMBPRINT:"IDENTITY_SERVER_THUMBPRINT",IMDS_ENDPOINT:"IMDS_ENDPOINT",MSI_ENDPOINT:"MSI_ENDPOINT",MSI_SECRET:"MSI_SECRET"},ro={APP_SERVICE:"AppService",AZURE_ARC:"AzureArc",CLOUD_SHELL:"CloudShell",DEFAULT_TO_IMDS:"DefaultToImds",IMDS:"Imds",MACHINE_LEARNING:"MachineLearning",SERVICE_FABRIC:"ServiceFabric"},vf={SYSTEM_ASSIGNED:"system-assigned",USER_ASSIGNED_CLIENT_ID:"user-assigned-client-id",USER_ASSIGNED_RESOURCE_ID:"user-assigned-resource-id",USER_ASSIGNED_OBJECT_ID:"user-assigned-object-id"},ep={GET:"GET",POST:"POST"},din="REGION_NAME",fin="MSAL_FORCE_REGION",pin=32,hin={SHA256:"sha256"},HHe={CV_CHARSET:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"},jBt={KEY_SEPARATOR:"-"},Dx={MSAL_SKU:"msal.js.node",JWT_BEARER_ASSERTION_TYPE:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",HTTP_PROTOCOL:"http://",LOCALHOST:"localhost"},Cf={acquireTokenSilent:62,acquireTokenByUsernamePassword:371,acquireTokenByDeviceCode:671,acquireTokenByClientCredential:771,acquireTokenByOBO:772,acquireTokenWithManagedIdentity:773,acquireTokenByCode:871,acquireTokenByRefreshToken:872},Nx={RSA_256:"RS256",PSS_256:"PS256",X5T_256:"x5t#S256",X5T:"x5t",X5C:"x5c",AUDIENCE:"aud",EXPIRATION_TIME:"exp",ISSUER:"iss",SUBJECT:"sub",NOT_BEFORE:"nbf",JWT_ID:"jti"},GHe={INTERVAL_MS:100,TIMEOUT_MS:5e3},min=4096;p();p();p();var kce=class{static{a(this,"HttpClient")}async sendGetRequestAsync(e,r,n){return this.sendRequest(e,ep.GET,r,n)}async sendPostRequestAsync(e,r){return this.sendRequest(e,ep.POST,r)}async sendRequest(e,r,n,o){let s=new AbortController,c;o&&(c=setTimeout(()=>{s.abort()},o));let l={method:r,headers:Mxo(n),signal:s.signal};r===ep.POST&&(l.body=n?.body||"");let u;try{u=await fetch(e,l)}catch(d){if(c&&clearTimeout(c),d instanceof Error&&d.name==="AbortError")throw gY(zp.networkError,"Request timeout");let f=gY(zp.networkError,`Network request failed: ${d instanceof Error?d.message:"unknown"}`);throw BBt(f,void 0,void 0,d instanceof Error?d:void 0)}c&&clearTimeout(c);try{return{headers:Nxo(u.headers),body:await u.json(),status:u.status}}catch(d){throw gY(zp.tokenParsingError,`Failed to parse response: ${d instanceof Error?d.message:"unknown"}`)}}};function Nxo(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}a(Nxo,"getHeaderDict");function Mxo(t){let e=new Headers;return t&&t.headers&&Object.entries(t.headers).forEach(([r,n])=>{e.append(r,n)}),e}a(Mxo,"getFetchHeaders");p();p();p();var $He="invalid_file_extension",VHe="invalid_file_path",oQ="invalid_managed_identity_id_type",WHe="invalid_secret",gin="missing_client_id",Ain="network_unavailable",zHe="platform_not_supported",YHe="unable_to_create_azure_arc",KHe="unable_to_create_cloud_shell",JHe="unable_to_create_source",ETe="unable_to_read_secret_file",yin="user_assigned_not_available_at_runtime",ZHe="www_authenticate_header_missing",XHe="www_authenticate_header_unsupported_format",DY={[Wi.AZURE_POD_IDENTITY_AUTHORITY_HOST]:"azure_pod_identity_authority_host_url_malformed",[Wi.IDENTITY_ENDPOINT]:"identity_endpoint_url_malformed",[Wi.IMDS_ENDPOINT]:"imds_endpoint_url_malformed",[Wi.MSI_ENDPOINT]:"msi_endpoint_url_malformed"};var Oxo={[$He]:"The file path in the WWW-Authenticate header does not contain a .key file.",[VHe]:"The file path in the WWW-Authenticate header is not in a valid Windows or Linux Format.",[oQ]:"More than one ManagedIdentityIdType was provided.",[WHe]:"The secret in the file on the file path in the WWW-Authenticate header is greater than 4096 bytes.",[zHe]:"The platform is not supported by Azure Arc. Azure Arc only supports Windows and Linux.",[gin]:"A ManagedIdentityId id was not provided.",[DY.AZURE_POD_IDENTITY_AUTHORITY_HOST]:`The Managed Identity's '${Wi.AZURE_POD_IDENTITY_AUTHORITY_HOST}' environment variable is malformed.`,[DY.IDENTITY_ENDPOINT]:`The Managed Identity's '${Wi.IDENTITY_ENDPOINT}' environment variable is malformed.`,[DY.IMDS_ENDPOINT]:`The Managed Identity's '${Wi.IMDS_ENDPOINT}' environment variable is malformed.`,[DY.MSI_ENDPOINT]:`The Managed Identity's '${Wi.MSI_ENDPOINT}' environment variable is malformed.`,[Ain]:"Authentication unavailable. The request to the managed identity endpoint timed out.",[YHe]:"Azure Arc Managed Identities can only be system assigned.",[KHe]:"Cloud Shell Managed Identities can only be system assigned.",[JHe]:"Unable to create a Managed Identity source based on environment variables.",[ETe]:"Unable to read the secret file.",[yin]:"Service Fabric user assigned managed identity ClientId or ResourceId is not configurable at runtime.",[ZHe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is missing.",[XHe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is in an unsupported format."},HBt=class t extends Fo{static{a(this,"ManagedIdentityError")}constructor(e){super(e,Oxo[e]),this.name="ManagedIdentityError",Object.setPrototypeOf(this,t.prototype)}};function Kp(t){return new HBt(t)}a(Kp,"createManagedIdentityError");var eGe=class{static{a(this,"ManagedIdentityId")}get id(){return this._id}set id(e){this._id=e}get idType(){return this._idType}set idType(e){this._idType=e}constructor(e){let r=e?.userAssignedClientId,n=e?.userAssignedResourceId,o=e?.userAssignedObjectId;if(r){if(n||o)throw Kp(oQ);this.id=r,this.idType=vf.USER_ASSIGNED_CLIENT_ID}else if(n){if(r||o)throw Kp(oQ);this.id=n,this.idType=vf.USER_ASSIGNED_RESOURCE_ID}else if(o){if(r||n)throw Kp(oQ);this.id=o,this.idType=vf.USER_ASSIGNED_OBJECT_ID}else this.id=uin,this.idType=vf.SYSTEM_ASSIGNED}};p();var $h={invalidLoopbackAddressType:{code:"invalid_loopback_server_address_type",desc:"Loopback server address is not type string. This is unexpected."},unableToLoadRedirectUri:{code:"unable_to_load_redirectUrl",desc:"Loopback server callback was invoked without a url. This is unexpected."},noAuthCodeInResponse:{code:"no_auth_code_in_response",desc:"No auth code found in the server response. Please check your network trace to determine what happened."},noLoopbackServerExists:{code:"no_loopback_server_exists",desc:"No loopback server exists yet."},loopbackServerAlreadyExists:{code:"loopback_server_already_exists",desc:"Loopback server already exists. Cannot create another."},loopbackServerTimeout:{code:"loopback_server_timeout",desc:"Timed out waiting for auth code listener to be registered."},stateNotFoundError:{code:"state_not_found",desc:"State not found. Please verify that the request originated from msal."},thumbprintMissing:{code:"thumbprint_missing_from_client_certificate",desc:"Client certificate does not contain a SHA-1 or SHA-256 thumbprint."},redirectUriNotSupported:{code:"redirect_uri_not_supported",desc:"RedirectUri is not supported in this scenario. Please remove redirectUri from the request."}},iE=class t extends Fo{static{a(this,"NodeAuthError")}constructor(e,r){super(e,r),this.name="NodeAuthError"}static createInvalidLoopbackAddressTypeError(){return new t($h.invalidLoopbackAddressType.code,`${$h.invalidLoopbackAddressType.desc}`)}static createUnableToLoadRedirectUrlError(){return new t($h.unableToLoadRedirectUri.code,`${$h.unableToLoadRedirectUri.desc}`)}static createNoAuthCodeInResponseError(){return new t($h.noAuthCodeInResponse.code,`${$h.noAuthCodeInResponse.desc}`)}static createNoLoopbackServerExistsError(){return new t($h.noLoopbackServerExists.code,`${$h.noLoopbackServerExists.desc}`)}static createLoopbackServerAlreadyExistsError(){return new t($h.loopbackServerAlreadyExists.code,`${$h.loopbackServerAlreadyExists.desc}`)}static createLoopbackServerTimeoutError(){return new t($h.loopbackServerTimeout.code,`${$h.loopbackServerTimeout.desc}`)}static createStateNotFoundError(){return new t($h.stateNotFoundError.code,$h.stateNotFoundError.desc)}static createThumbprintMissingError(){return new t($h.thumbprintMissing.code,$h.thumbprintMissing.desc)}static createRedirectUriNotSupportedError(){return new t($h.redirectUriNotSupported.code,$h.redirectUriNotSupported.desc)}};var Lxo={clientId:"",authority:er.DEFAULT_AUTHORITY,clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",thumbprintSha256:"",privateKey:"",x5c:""},knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",clientCapabilities:[],azureCloudOptions:{azureCloudInstance:m3.None,tenant:""},isMcp:!1},GBt={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:_f.Info},Bxo={loggerOptions:GBt,networkClient:new kce,disableInternalRetries:!1,protocolMode:nE.AAD},Fxo={application:{appName:"",appVersion:""}};function Ein({auth:t,broker:e,cache:r,system:n,telemetry:o}){let s={...Bxo,networkClient:new kce,loggerOptions:n?.loggerOptions||GBt,disableInternalRetries:n?.disableInternalRetries||!1};if(t.clientCertificate&&!t.clientCertificate.thumbprint&&!t.clientCertificate.thumbprintSha256)throw iE.createStateNotFoundError();return{auth:{...Lxo,...t},broker:{...e},cache:{...r},system:{...s,...n},telemetry:{...Fxo,...o}}}a(Ein,"buildAppConfiguration");function _in({clientCapabilities:t,managedIdentityIdParams:e,system:r}){let n=new eGe(e),o=r?.loggerOptions||GBt,s;return r?.networkClient?s=r.networkClient:s=new kce,{clientCapabilities:t||[],managedIdentityId:n,system:{loggerOptions:o,networkClient:s},disableInternalRetries:r?.disableInternalRetries||!1}}a(_in,"buildManagedIdentityConfiguration");p();p();Mo();var Pce=class{static{a(this,"GuidGenerator")}generateGuid(){return Nt()}isGuid(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}};p();var bS=class t{static{a(this,"EncodingUtils")}static base64Encode(e,r){return Buffer.from(e,r).toString(er.EncodingTypes.BASE64)}static base64EncodeUrl(e,r){return t.base64Encode(e,r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}static base64Decode(e){return Buffer.from(e,er.EncodingTypes.BASE64).toString("utf8")}static base64DecodeUrl(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");for(;r.length%4;)r+="=";return t.base64Decode(r)}};p();p();var vin=fe(require("crypto"),1);var sQ=class{static{a(this,"HashUtils")}sha256(e){return vin.default.createHash(hin.SHA256).update(e).digest()}};var Cin=fe(require("crypto"),1);var tGe=class{static{a(this,"PkceGenerator")}constructor(){this.hashUtils=new sQ}async generatePkceCodes(){let e=this.generateCodeVerifier(),r=this.generateCodeChallengeFromVerifier(e);return{verifier:e,challenge:r}}generateCodeVerifier(){let e=[],r=256-256%HHe.CV_CHARSET.length;for(;e.length<=pin;){let o=Cin.default.randomBytes(1)[0];if(o>=r)continue;let s=o%HHe.CV_CHARSET.length;e.push(HHe.CV_CHARSET[s])}let n=e.join("");return bS.base64EncodeUrl(n)}generateCodeChallengeFromVerifier(e){return bS.base64EncodeUrl(this.hashUtils.sha256(e).toString(er.EncodingTypes.BASE64),er.EncodingTypes.BASE64)}};var KM=class{static{a(this,"CryptoProvider")}constructor(){this.pkceGenerator=new tGe,this.guidGenerator=new Pce,this.hashUtils=new sQ}base64UrlEncode(){throw new Error("Method not implemented.")}encodeKid(){throw new Error("Method not implemented.")}createNewGuid(){return this.guidGenerator.generateGuid()}base64Encode(e){return bS.base64Encode(e)}base64Decode(e){return bS.base64Decode(e)}generatePkceCodes(){return this.pkceGenerator.generatePkceCodes()}getPublicKeyThumbprint(){throw new Error("Method not implemented.")}removeTokenBindingKey(){throw new Error("Method not implemented.")}clearKeystore(){throw new Error("Method not implemented.")}signJwt(){throw new Error("Method not implemented.")}async hashString(e){return bS.base64EncodeUrl(this.hashUtils.sha256(e).toString(er.EncodingTypes.BASE64),er.EncodingTypes.BASE64)}};p();p();function bin(t){let e=t.credentialType===er.CredentialType.REFRESH_TOKEN&&t.familyId||t.clientId,r=t.tokenType&&t.tokenType.toLowerCase()!==er.AuthenticationScheme.BEARER.toLowerCase()?t.tokenType.toLowerCase():"";return[t.homeAccountId,t.environment,t.credentialType,e,t.realm||"",t.target||"",r].join(jBt.KEY_SEPARATOR).toLowerCase()}a(bin,"generateCredentialKey");function Sin(t){let e=t.homeAccountId.split(".")[1];return[t.homeAccountId,t.environment,e||t.tenantId||""].join(jBt.KEY_SEPARATOR).toLowerCase()}a(Sin,"generateAccountKey");var aQ=class extends nQ{static{a(this,"NodeStorage")}constructor(e,r,n,o){super(r,n,e,new Hh,o),this.cache={},this.changeEmitters=[],this.logger=e}registerChangeEmitter(e){this.changeEmitters.push(e)}emitChange(){this.changeEmitters.forEach(e=>e.call(null))}cacheToInMemoryCache(e){let r={accounts:{},idTokens:{},accessTokens:{},refreshTokens:{},appMetadata:{}};for(let n in e){let o=e[n];if(typeof o=="object")if(xY.isAccountEntity(o))r.accounts[n]=o;else if(N_.isIdTokenEntity(o))r.idTokens[n]=o;else if(N_.isAccessTokenEntity(o))r.accessTokens[n]=o;else if(N_.isRefreshTokenEntity(o))r.refreshTokens[n]=o;else if(N_.isAppMetadataEntity(n,o))r.appMetadata[n]=o;else continue}return r}inMemoryCacheToCache(e){let r=this.getCache();return r={...r,...e.accounts,...e.idTokens,...e.accessTokens,...e.refreshTokens,...e.appMetadata},r}getInMemoryCache(){return this.logger.trace("Getting in-memory cache",""),this.cacheToInMemoryCache(this.getCache())}setInMemoryCache(e){this.logger.trace("Setting in-memory cache","");let r=this.inMemoryCacheToCache(e);this.setCache(r),this.emitChange()}getCache(){return this.logger.trace("Getting cache key-value store",""),this.cache}setCache(e){this.logger.trace("Setting cache key value store",""),this.cache=e,this.emitChange()}getItem(e){return this.logger.tracePii(`Item key: ${e}`,""),this.getCache()[e]}setItem(e,r){this.logger.tracePii(`Item key: ${e}`,"");let n=this.getCache();n[e]=r,this.setCache(n)}generateCredentialKey(e){return bin(e)}generateAccountKey(e){return Sin(e)}getAccountKeys(){let e=this.getInMemoryCache();return Object.keys(e.accounts)}getTokenKeys(){let e=this.getInMemoryCache();return{idToken:Object.keys(e.idTokens),accessToken:Object.keys(e.accessTokens),refreshToken:Object.keys(e.refreshTokens)}}getAccount(e){let r=this.getItem(e);return r&&typeof r=="object"?{...r}:null}async setAccount(e){let r=this.generateAccountKey(xY.getAccountInfo(e));this.setItem(r,e)}getIdTokenCredential(e){let r=this.getItem(e);return N_.isIdTokenEntity(r)?r:null}async setIdTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAccessTokenCredential(e){let r=this.getItem(e);return N_.isAccessTokenEntity(r)?r:null}async setAccessTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getRefreshTokenCredential(e){let r=this.getItem(e);return N_.isRefreshTokenEntity(r)?r:null}async setRefreshTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAppMetadata(e){let r=this.getItem(e);return N_.isAppMetadataEntity(e,r)?r:null}setAppMetadata(e){let r=N_.generateAppMetadataKey(e);this.setItem(r,e)}getServerTelemetry(e){let r=this.getItem(e);return r&&N_.isServerTelemetryEntity(e,r)?r:null}setServerTelemetry(e,r){this.setItem(e,r)}getAuthorityMetadata(e){let r=this.getItem(e);return r&&N_.isAuthorityMetadataEntity(e,r)?r:null}getAuthorityMetadataKeys(){return this.getKeys().filter(e=>this.isAuthorityMetadata(e))}setAuthorityMetadata(e,r){this.setItem(e,r)}getThrottlingCache(e){let r=this.getItem(e);return r&&N_.isThrottlingEntity(e,r)?r:null}setThrottlingCache(e,r){this.setItem(e,r)}removeItem(e){this.logger.tracePii(`Item key: ${e}`,"");let r=!1,n=this.getCache();return n[e]&&(delete n[e],r=!0),r&&(this.setCache(n),this.emitChange()),r}removeOutdatedAccount(e){this.removeItem(e)}containsKey(e){return this.getKeys().includes(e)}getKeys(){this.logger.trace("Retrieving all cache keys","");let e=this.getCache();return[...Object.keys(e)]}clear(){this.logger.trace("Clearing cache entries created by MSAL",""),this.getKeys().forEach(r=>{this.removeItem(r)}),this.emitChange()}static generateInMemoryCache(e){return y3.deserializeAllCache(y3.deserializeJSONBlob(e))}static generateJsonCache(e){return J7.serializeAllCache(e)}updateCredentialCacheKey(e,r){let n=this.generateCredentialKey(r);if(e!==n){let o=this.getItem(e);if(o)return this.removeItem(e),this.setItem(n,o),this.logger.verbose(`Updated an outdated ${r.credentialType} cache key`,""),n;this.logger.error(`Attempted to update an outdated ${r.credentialType} cache key but no item matching the outdated key was found in storage`,"")}return e}};p();var _Te={Account:{},IdToken:{},AccessToken:{},RefreshToken:{},AppMetadata:{}},Dce=class{static{a(this,"TokenCache")}constructor(e,r,n){this.cacheHasChanged=!1,this.storage=e,this.storage.registerChangeEmitter(this.handleChangeEvent.bind(this)),n&&(this.persistence=n),this.logger=r}hasChanged(){return this.cacheHasChanged}serialize(){this.logger.trace("Serializing in-memory cache","");let e=J7.serializeAllCache(this.storage.getInMemoryCache());return this.cacheSnapshot?(this.logger.trace("Reading cache snapshot from disk",""),e=this.mergeState(JSON.parse(this.cacheSnapshot),e)):this.logger.trace("No cache snapshot to merge",""),this.cacheHasChanged=!1,JSON.stringify(e)}deserialize(e){if(this.logger.trace("Deserializing JSON to in-memory cache",""),this.cacheSnapshot=e,this.cacheSnapshot){this.logger.trace("Reading cache snapshot from disk","");let r=y3.deserializeAllCache(this.overlayDefaults(JSON.parse(this.cacheSnapshot)));this.storage.setInMemoryCache(r)}else this.logger.trace("No cache snapshot to deserialize","")}getKVStore(){return this.storage.getCache()}getCacheSnapshot(){let e=aQ.generateInMemoryCache(this.cacheSnapshot);return this.storage.inMemoryCacheToCache(e)}async getAllAccounts(e=new KM().createNewGuid()){this.logger.trace("getAllAccounts called",e);let r;try{return this.persistence&&(r=new _S(this,!1),await this.persistence.beforeCacheAccess(r)),this.storage.getAllAccounts({},e)}finally{this.persistence&&r&&await this.persistence.afterCacheAccess(r)}}async getAccountByHomeId(e){let r=await this.getAllAccounts();return e&&r&&r.length&&r.filter(n=>n.homeAccountId===e)[0]||null}async getAccountByLocalId(e){let r=await this.getAllAccounts();return e&&r&&r.length&&r.filter(n=>n.localAccountId===e)[0]||null}async removeAccount(e,r){this.logger.trace("removeAccount called",r||"");let n;try{this.persistence&&(n=new _S(this,!0),await this.persistence.beforeCacheAccess(n)),this.storage.removeAccount(e,r||new Pce().generateGuid())}finally{this.persistence&&n&&await this.persistence.afterCacheAccess(n)}}async overwriteCache(){if(!this.persistence){this.logger.info("No persistence layer specified, cache cannot be overwritten","");return}this.logger.info("Overwriting in-memory cache with persistent cache",""),this.storage.clear();let e=new _S(this,!1);await this.persistence.beforeCacheAccess(e);let r=this.getCacheSnapshot();this.storage.setCache(r),await this.persistence.afterCacheAccess(e)}handleChangeEvent(){this.cacheHasChanged=!0}mergeState(e,r){this.logger.trace("Merging in-memory cache with cache snapshot","");let n=this.mergeRemovals(e,r);return this.mergeUpdates(n,r)}mergeUpdates(e,r){return Object.keys(r).forEach(n=>{let o=r[n];if(!e.hasOwnProperty(n))o!==null&&(e[n]=o);else{let s=o!==null,c=typeof o=="object",l=!Array.isArray(o),u=typeof e[n]<"u"&&e[n]!==null;s&&c&&l&&u?this.mergeUpdates(e[n],o):e[n]=o}}),e}mergeRemovals(e,r){this.logger.trace("Remove updated entries in cache","");let n=e.Account?this.mergeRemovalsDict(e.Account,r.Account):e.Account,o=e.AccessToken?this.mergeRemovalsDict(e.AccessToken,r.AccessToken):e.AccessToken,s=e.RefreshToken?this.mergeRemovalsDict(e.RefreshToken,r.RefreshToken):e.RefreshToken,c=e.IdToken?this.mergeRemovalsDict(e.IdToken,r.IdToken):e.IdToken,l=e.AppMetadata?this.mergeRemovalsDict(e.AppMetadata,r.AppMetadata):e.AppMetadata;return{...e,Account:n,AccessToken:o,RefreshToken:s,IdToken:c,AppMetadata:l}}mergeRemovalsDict(e,r){let n={...e};return Object.keys(e).forEach(o=>{(!r||!r.hasOwnProperty(o))&&delete n[o]}),n}overlayDefaults(e){return this.logger.trace("Overlaying input cache with the default cache",""),{Account:{..._Te.Account,...e.Account},IdToken:{..._Te.IdToken,...e.IdToken},AccessToken:{..._Te.AccessToken,...e.AccessToken},RefreshToken:{..._Te.RefreshToken,...e.RefreshToken},AppMetadata:{..._Te.AppMetadata,...e.AppMetadata}}}};p();var ccn=fe(tcn(),1);p();var rcn="missing_tenant_id_error",ncn="user_timeout_reached",icn="invalid_assertion",O3t="invalid_client_credential",ocn="device_code_polling_cancelled",scn="device_code_expired",acn="device_code_unknown_error";var E3=class t{static{a(this,"ClientAssertion")}static fromAssertion(e){let r=new t;return r.jwt=e,r}static fromCertificate(e,r,n){let o=new t;return o.privateKey=r,o.thumbprint=e,o.useSha256=!1,n&&(o.publicCertificate=this.parseCertificate(n)),o}static fromCertificateWithSha256Thumbprint(e,r,n){let o=new t;return o.privateKey=r,o.thumbprint=e,o.useSha256=!0,n&&(o.publicCertificate=this.parseCertificate(n)),o}getJwt(e,r,n){if(this.privateKey&&this.thumbprint)return this.jwt&&!this.isExpired()&&r===this.issuer&&n===this.jwtAudience?this.jwt:this.createJwt(e,r,n);if(this.jwt)return this.jwt;throw Pt(icn)}createJwt(e,r,n){this.issuer=r,this.jwtAudience=n;let o=Xu.nowSeconds();this.expirationTime=o+600;let c={alg:this.useSha256?Nx.PSS_256:Nx.RSA_256},l=this.useSha256?Nx.X5T_256:Nx.X5T;Object.assign(c,{[l]:bS.base64EncodeUrl(this.thumbprint,er.EncodingTypes.HEX)}),this.publicCertificate&&Object.assign(c,{[Nx.X5C]:this.publicCertificate});let u={[Nx.AUDIENCE]:this.jwtAudience,[Nx.EXPIRATION_TIME]:this.expirationTime,[Nx.ISSUER]:this.issuer,[Nx.SUBJECT]:this.issuer,[Nx.NOT_BEFORE]:o,[Nx.JWT_ID]:e.createNewGuid()};return this.jwt=ccn.default.sign(u,this.privateKey,{header:c}),this.jwt}isExpired(){return this.expirationTime0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.username&&an.addCcsUpn(r,e.username),SA.mapToQueryString(r)}};p();function lcn(t,e,r,n){let o=yTe.getStandardAuthorizeRequestParameters({...t.auth,authority:e,redirectUri:r.redirectUri||""},r,n);return an.addLibraryInfo(o,{sku:Dx.MSAL_SKU,version:SS,cpu:process.arch||"",os:process.platform||""}),t.system.protocolMode!==nE.OIDC&&an.addApplicationTelemetry(o,t.telemetry.application),an.addResponseType(o,er.OAuthResponseType.CODE),r.codeChallenge&&r.codeChallengeMethod&&an.addCodeChallengeParams(o,r.codeChallenge,r.codeChallengeMethod),an.addExtraParameters(o,r.extraQueryParameters||{}),yTe.getAuthorizeUrl(e,o)}a(lcn,"getAuthCodeRequestUrl");var Hce=class{static{a(this,"ClientApplication")}constructor(e){this.config=Ein(e),this.cryptoProvider=new KM,this.logger=new a0(this.config.system.loggerOptions,jce,SS),this.storage=new aQ(this.logger,this.config.auth.clientId,this.cryptoProvider,FBt(this.config.auth)),this.tokenCache=new Dce(this.storage,this.logger,this.config.cache.cachePlugin)}async getAuthCodeUrl(e){this.logger.info("getAuthCodeUrl called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e),responseMode:e.responseMode||er.ResponseMode.QUERY,authenticationScheme:er.AuthenticationScheme.BEARER,state:e.state||"",nonce:e.nonce||""},n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions);return lcn(this.config,n,r,this.logger)}async acquireTokenByCode(e,r){this.logger.info("acquireTokenByCode called",e.correlationId||""),e.state&&r&&(this.logger.info("acquireTokenByCode - validating state",e.correlationId||""),this.validateState(e.state,r.state||""),r={...r,state:""});let n={...e,...await this.initializeBaseRequest(e),authenticationScheme:er.AuthenticationScheme.BEARER},o=this.initializeServerTelemetryManager(Cf.acquireTokenByCode,n.correlationId);try{let s=await this.createAuthority(n.authority,n.correlationId,void 0,e.azureCloudOptions),c=await this.buildOauthClientConfiguration(s,n.correlationId,n.redirectUri,o),l=new gTe(c,new Hh);return this.logger.verbose("Auth code client created",n.correlationId),await l.acquireToken(n,Cf.acquireTokenByCode,r)}catch(s){throw s instanceof Fo&&s.setCorrelationId(n.correlationId),o.cacheFailedRequest(s),s}}async acquireTokenByRefreshToken(e){this.logger.info("acquireTokenByRefreshToken called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e),authenticationScheme:er.AuthenticationScheme.BEARER},n=this.initializeServerTelemetryManager(Cf.acquireTokenByRefreshToken,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,r.redirectUri||"",n),c=new RY(s,new Hh);return this.logger.verbose("Refresh token client created",r.correlationId),await c.acquireToken(r,Cf.acquireTokenByRefreshToken)}catch(o){throw o instanceof Fo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenSilent(e){let r={...e,...await this.initializeBaseRequest(e),forceRefresh:e.forceRefresh||!1},n=this.initializeServerTelemetryManager(Cf.acquireTokenSilent,r.correlationId,r.forceRefresh);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,r.redirectUri||"",n),c=new ATe(s,new Hh);this.logger.verbose("Silent flow client created",r.correlationId);try{return await this.tokenCache.overwriteCache(),await this.acquireCachedTokenSilent(r,c,s)}catch(l){if(l instanceof eQ&&l.errorCode===zp.tokenRefreshRequired)return new RY(s,new Hh).acquireTokenByRefreshToken(r,Cf.acquireTokenSilent);throw l}}catch(o){throw o instanceof Fo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireCachedTokenSilent(e,r,n){let[o,s]=await r.acquireCachedToken({...e,scopes:e.scopes?.length?e.scopes:[...er.OIDC_DEFAULT_SCOPES]});if(s===er.CacheOutcome.PROACTIVELY_REFRESHED){this.logger.info("ClientApplication:acquireCachedTokenSilent - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.",e.correlationId);let c=new RY(n,new Hh);try{await c.acquireTokenByRefreshToken(e,Cf.acquireTokenSilent)}catch{}}return o}async acquireTokenByUsernamePassword(e){this.logger.info("acquireTokenByUsernamePassword called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)},n=this.initializeServerTelemetryManager(Cf.acquireTokenByUsernamePassword,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,"",n),c=new PGe(s);return this.logger.verbose("Username password client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Fo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}getTokenCache(){return this.logger.info("getTokenCache called",""),this.tokenCache}validateState(e,r){if(!e)throw iE.createStateNotFoundError();if(e!==r)throw Pt(zp.stateMismatch)}getLogger(){return this.logger}setLogger(e){this.logger=e}async buildOauthClientConfiguration(e,r,n,o){return this.logger.verbose("buildOauthClientConfiguration called",r),this.logger.info(`Building oauth client configuration with the following authority: ${e.tokenEndpoint}.`,r),o?.updateRegionDiscoveryMetadata(e.regionDiscoveryMetadata),{authOptions:{clientId:this.config.auth.clientId,authority:e,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:n,isMcp:this.config.auth.isMcp},loggerOptions:{logLevel:this.config.system.loggerOptions.logLevel,loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled,correlationId:r},cryptoInterface:this.cryptoProvider,networkInterface:this.config.system.networkClient,storageInterface:this.storage,serverTelemetryManager:o,clientCredentials:{clientSecret:this.clientSecret,clientAssertion:await this.getClientAssertion(e)},libraryInfo:{sku:Dx.MSAL_SKU,version:SS,cpu:process.arch||"",os:process.platform||""},telemetry:this.config.telemetry,persistencePlugin:this.config.cache.cachePlugin,serializableCache:this.tokenCache}}async getClientAssertion(e){return this.developerProvidedClientAssertion&&(this.clientAssertion=E3.fromAssertion(await L_(this.developerProvidedClientAssertion,this.config.auth.clientId,e.tokenEndpoint))),this.clientAssertion&&{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,e.tokenEndpoint),assertionType:Dx.JWT_BEARER_ASSERTION_TYPE}}async initializeBaseRequest(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();return this.logger.verbose("initializeRequestScopes called",r),e.authenticationScheme&&e.authenticationScheme===er.AuthenticationScheme.POP&&this.logger.verbose("Authentication Scheme 'pop' is not supported yet, setting Authentication Scheme to 'Bearer' for request",r),e.authenticationScheme=er.AuthenticationScheme.BEARER,{...e,scopes:[...e&&e.scopes||[],...er.OIDC_DEFAULT_SCOPES],correlationId:r,authority:e.authority||this.config.auth.authority}}initializeServerTelemetryManager(e,r,n){let o={clientId:this.config.auth.clientId,correlationId:r,apiId:e,forceRefresh:n||!1};return new PY(o,this.storage)}async createAuthority(e,r,n,o){this.logger.verbose("createAuthority called",r);let s=SP.generateAuthority(e,o||this.config.auth.azureCloudOptions),c={protocolMode:this.config.system.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,azureRegionConfiguration:n};return jHe.createDiscoveredInstance(s,this.config.system.networkClient,this.storage,c,this.logger,r,new Hh)}clearCache(){this.storage.clear()}};p();var ucn=fe(require("http"),1);var DGe=class{static{a(this,"LoopbackClient")}async listenForAuthCode(e,r){if(this.server)throw iE.createLoopbackServerAlreadyExistsError();return new Promise((n,o)=>{this.server=ucn.default.createServer((s,c)=>{let l=s.url;if(l){if(l===er.FORWARD_SLASH){c.end(e||"Auth code was successfully acquired. You can close this window now.");return}}else{c.end(r||"Error occurred loading redirectUrl"),o(iE.createUnableToLoadRedirectUrlError());return}let u=this.getRedirectUri(),d=new URL(l,u),f=SA.getDeserializedResponse(d.search)||{};f.code&&(c.writeHead(er.HTTP_REDIRECT,{location:u}),c.end()),f.error&&c.end(r||`Error occurred: ${f.error}`),n(f)}),this.server.listen(0,"127.0.0.1")})}getRedirectUri(){if(!this.server||!this.server.listening)throw iE.createNoLoopbackServerExistsError();let e=this.server.address();if(!e||typeof e=="string"||!e.port)throw this.closeServer(),iE.createInvalidLoopbackAddressTypeError();let r=e&&e.port;return`${Dx.HTTP_PROTOCOL}${Dx.LOCALHOST}:${r}`}closeServer(){this.server&&(this.server.close(),typeof this.server.closeAllConnections=="function"&&this.server.closeAllConnections(),this.server.unref(),this.server=void 0)}};p();var NGe=class extends XM{static{a(this,"DeviceCodeClient")}constructor(e){super(e)}async acquireToken(e){let r=await this.getDeviceCode(e);e.deviceCodeCallback(r);let n=Xu.nowSeconds(),o=await this.acquireTokenWithDeviceCode(e,r),s=new Yp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return s.validateTokenResponse(o,e.correlationId),s.handleServerTokenResponse(o,this.authority,n,e,Cf.acquireTokenByDeviceCode)}async getDeviceCode(e){let r=this.createExtraQueryParameters(e),n=Is.appendQueryString(this.authority.deviceCodeEndpoint,r),o=this.createQueryString(e),s=this.createTokenRequestHeaders(),c={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return this.executePostRequestToDeviceCodeEndpoint(n,o,s,c,e.correlationId)}createExtraQueryParameters(e){let r=new Map;return e.extraQueryParameters&&an.addExtraParameters(r,e.extraQueryParameters),SA.mapToQueryString(r)}async executePostRequestToDeviceCodeEndpoint(e,r,n,o,s){let{body:{user_code:c,device_code:l,verification_uri:u,expires_in:d,interval:f,message:h}}=await this.sendPostRequest(o,e,{body:r,headers:n},s);return{userCode:c,deviceCode:l,verificationUri:u,expiresIn:d,interval:f,message:h}}createQueryString(e){let r=new Map;return an.addScopes(r,e.scopes),an.addClientId(r,this.config.authOptions.clientId),e.extraQueryParameters&&an.addExtraParameters(r,e.extraQueryParameters),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),SA.mapToQueryString(r)}continuePolling(e,r,n){if(n)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true",""),Pt(ocn);if(r&&rr)throw this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${r}`,""),Pt(ncn);if(Xu.nowSeconds()>e)throw r&&this.logger.verbose(`User specified timeout ignored as the device code has expired before the timeout elapsed. The user specified timeout was set for ${r}`,""),this.logger.error(`Device code expired. Expiration time of device code was ${e}`,""),Pt(scn);return!0}async acquireTokenWithDeviceCode(e,r){let n=this.createTokenQueryParameters(e),o=Is.appendQueryString(this.authority.tokenEndpoint,n),s=this.createTokenRequestBody(e,r),c=this.createTokenRequestHeaders(),l=e.timeout?Xu.nowSeconds()+e.timeout:void 0,u=Xu.nowSeconds()+r.expiresIn,d=r.interval*1e3;for(;this.continuePolling(u,l,e.cancel);){let f={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},h=await this.executePostToTokenEndpoint(o,s,c,f,e.correlationId);if(h.body&&h.body.error)if(h.body.error===er.AUTHORIZATION_PENDING)this.logger.info("Authorization pending. Continue polling.",e.correlationId),await Xu.delay(d);else throw this.logger.info("Unexpected error in polling from the server",e.correlationId),gY(Rce.postRequestFailed,h.body.error);else return this.logger.verbose("Authorization completed successfully. Polling stopped.",e.correlationId),h.body}throw this.logger.error("Polling stopped for unknown reasons.",e.correlationId),Pt(acn)}createTokenRequestBody(e,r){let n=new Map;an.addScopes(n,e.scopes),an.addClientId(n,this.config.authOptions.clientId),an.addGrantType(n,er.GrantType.DEVICE_CODE_GRANT),an.addDeviceCode(n,r.deviceCode);let o=e.correlationId||this.config.cryptoInterface.createNewGuid();return an.addCorrelationId(n,o),an.addClientInfo(n),an.addLibraryInfo(n,this.config.libraryInfo),an.addApplicationTelemetry(n,this.config.telemetry.application),an.addThrottling(n),this.serverTelemetryManager&&an.addServerTelemetry(n,this.serverTelemetryManager),(!pu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(n,e.claims,this.config.authOptions.clientCapabilities),SA.mapToQueryString(n)}};var Gce=class extends Hce{static{a(this,"PublicClientApplication")}constructor(e){super(e),this.config.broker.nativeBrokerPlugin&&(this.config.broker.nativeBrokerPlugin.isBrokerAvailable?(this.nativeBrokerPlugin=this.config.broker.nativeBrokerPlugin,this.nativeBrokerPlugin.setLogger(this.config.system.loggerOptions)):this.logger.warning("NativeBroker implementation was provided but the broker is unavailable.","")),this.skus=PY.makeExtraSkuString({libraryName:Dx.MSAL_SKU,libraryVersion:SS})}async acquireTokenByDeviceCode(e){this.logger.info("acquireTokenByDeviceCode called",e.correlationId||""),kY(this.config.auth.isMcp,e);let r=Object.assign(e,await this.initializeBaseRequest(e)),n=this.initializeServerTelemetryManager(Cf.acquireTokenByDeviceCode,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,"",n),c=new NGe(s);return this.logger.verbose("Device code client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Fo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenInteractive(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();this.logger.trace("acquireTokenInteractive called",r),kY(this.config.auth.isMcp,e);let{openBrowser:n,successTemplate:o,errorTemplate:s,windowHandle:c,loopbackClient:l,...u}=e;if(this.nativeBrokerPlugin){let A={...u,clientId:this.config.auth.clientId,scopes:e.scopes||er.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...u.extraQueryParameters,...u.extraParameters,[mY.X_CLIENT_EXTRA_SKU]:this.skus},accountId:u.account?.nativeAccountId};return this.nativeBrokerPlugin.acquireTokenInteractive(A,c)}if(e.redirectUri){if(!this.config.broker.nativeBrokerPlugin)throw iE.createRedirectUriNotSupportedError();e.redirectUri=""}let{verifier:d,challenge:f}=await this.cryptoProvider.generatePkceCodes(),h=l||new DGe,m={},g=null;try{let A=h.listenForAuthCode(o,s).then(T=>{m=T}).catch(T=>{g=T}),y=await this.waitForRedirectUri(h),E={...u,correlationId:r,scopes:e.scopes||er.OIDC_DEFAULT_SCOPES,redirectUri:y,responseMode:er.ResponseMode.QUERY,codeChallenge:f,codeChallengeMethod:er.CodeChallengeMethodValues.S256},_=await this.getAuthCodeUrl(E);if(await n(_),await A,g)throw g;if(m.error)throw new M_(m.error,m.error_description,m.suberror);if(!m.code)throw iE.createNoAuthCodeInResponseError();let v=m.client_info,b={code:m.code,codeVerifier:d,clientInfo:v||"",...E};return await this.acquireTokenByCode(b)}finally{h.closeServer()}}async acquireTokenSilent(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();if(this.logger.trace("acquireTokenSilent called",r),kY(this.config.auth.isMcp,e),this.nativeBrokerPlugin){let n={...e,clientId:this.config.auth.clientId,scopes:e.scopes||er.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...e.extraQueryParameters,...e.extraParameters,[mY.X_CLIENT_EXTRA_SKU]:this.skus},accountId:e.account.nativeAccountId,forceRefresh:e.forceRefresh||!1};return this.nativeBrokerPlugin.acquireTokenSilent(n)}if(e.redirectUri){if(!this.config.broker.nativeBrokerPlugin)throw iE.createRedirectUriNotSupportedError();e.redirectUri=""}return super.acquireTokenSilent(e)}async acquireTokenByCode(e,r){return kY(this.config.auth.isMcp,e),super.acquireTokenByCode(e,r)}async acquireTokenByRefreshToken(e){return kY(this.config.auth.isMcp,e),super.acquireTokenByRefreshToken(e)}async signOut(e){if(this.nativeBrokerPlugin&&e.account.nativeAccountId){let r={clientId:this.config.auth.clientId,accountId:e.account.nativeAccountId,correlationId:e.correlationId||this.cryptoProvider.createNewGuid()};await this.nativeBrokerPlugin.signOut(r)}await this.getTokenCache().removeAccount(e.account,e.correlationId)}async getAllAccounts(){if(this.nativeBrokerPlugin){let e=this.cryptoProvider.createNewGuid();return this.nativeBrokerPlugin.getAllAccounts(this.config.auth.clientId,e)}return this.getTokenCache().getAllAccounts()}async waitForRedirectUri(e){return new Promise((r,n)=>{let o=0,s=setInterval(()=>{if(GHe.TIMEOUT_MS/GHe.INTERVAL_MS1)throw Pt(zp.multipleMatchingTokens);return l[0]}async executeTokenRequest(e,r,n){let o,s;if(this.appTokenProvider){this.logger.info("Using appTokenProvider extensibility.",e.correlationId);let u={correlationId:e.correlationId,tenantId:this.config.authOptions.authority.tenant,scopes:e.scopes,claims:e.claims};s=Xu.nowSeconds();let d=await this.appTokenProvider(u);o={access_token:d.accessToken,expires_in:d.expiresInSeconds,refresh_in:d.refreshInSeconds,token_type:er.AuthenticationScheme.BEARER}}else{let u=this.createTokenQueryParameters(e),d=Is.appendQueryString(r.tokenEndpoint,u),f=await this.createTokenRequestBody(e),h=this.createTokenRequestHeaders(),m={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};this.logger.info("Sending token request to endpoint: "+r.tokenEndpoint,e.correlationId),s=Xu.nowSeconds();let g=await this.executePostToTokenEndpoint(d,f,h,m,e.correlationId);o=g.body,o.status=g.status}let c=new Yp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return c.validateTokenResponse(o,e.correlationId,n),await c.handleServerTokenResponse(o,this.authority,s,e,Cf.acquireTokenByClientCredential)}async createTokenRequestBody(e){let r=new Map;an.addClientId(r,this.config.authOptions.clientId),an.addScopes(r,e.scopes,!1),an.addGrantType(r,er.GrantType.CLIENT_CREDENTIALS_GRANT),an.addLibraryInfo(r,this.config.libraryInfo),an.addApplicationTelemetry(r,this.config.telemetry.application),an.addThrottling(r),this.serverTelemetryManager&&an.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();an.addCorrelationId(r,n),this.config.clientCredentials.clientSecret&&an.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=e.clientAssertion||this.config.clientCredentials.clientAssertion;return o&&(an.addClientAssertion(r,await L_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),an.addClientAssertionType(r,o.assertionType)),(!pu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),SA.mapToQueryString(r)}};p();var MGe=class extends XM{static{a(this,"OnBehalfOfClient")}constructor(e){super(e)}async acquireToken(e){if(this.scopeSet=new jh(e.scopes||[]),this.userAssertionHash=await this.cryptoUtils.hashString(e.oboAssertion),e.skipCache||e.claims)return this.executeTokenRequest(e,this.authority,this.userAssertionHash);try{return await this.getCachedAuthenticationResult(e)}catch{return await this.executeTokenRequest(e,this.authority,this.userAssertionHash)}}async getCachedAuthenticationResult(e){let r=this.readAccessTokenFromCacheForOBO(this.config.authOptions.clientId,e);if(r){if(Xu.isTokenExpired(r.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.serverTelemetryManager?.setCacheOutcome(er.CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info(`OnbehalfofFlow:getCachedAuthenticationResult - Cached access token is expired or will expire within ${this.config.systemOptions.tokenRenewalOffsetSeconds} seconds.`,e.correlationId),Pt(zp.tokenRefreshRequired)}else throw this.serverTelemetryManager?.setCacheOutcome(er.CacheOutcome.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.",e.correlationId),Pt(zp.tokenRefreshRequired);let n=this.readIdTokenFromCacheForOBO(r.homeAccountId,e.correlationId),o,s=null;if(n){o=RHe.extractTokenClaims(n.secret,bS.base64Decode);let c=o.oid||o.sub,l={homeAccountId:n.homeAccountId,environment:n.environment,tenantId:n.realm,username:"",localAccountId:c||""};s=this.cacheManager.getAccount(this.cacheManager.generateAccountKey(l),e.correlationId)}return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),Yp.generateAuthenticationResult(this.cryptoUtils,this.authority,{account:s,accessToken:r,idToken:n,refreshToken:null,appMetadata:null},!0,e,this.performanceClient,o)}readIdTokenFromCacheForOBO(e,r){let n={homeAccountId:e,environment:this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,credentialType:er.CredentialType.ID_TOKEN,clientId:this.config.authOptions.clientId,realm:this.authority.tenant},o=this.cacheManager.getIdTokensByFilter(n,r);return Object.values(o).length<1?null:Object.values(o)[0]}readAccessTokenFromCacheForOBO(e,r){let n=r.authenticationScheme||er.AuthenticationScheme.BEARER,s={credentialType:n&&n.toLowerCase()!==er.AuthenticationScheme.BEARER.toLowerCase()?er.CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:er.CredentialType.ACCESS_TOKEN,clientId:e,target:jh.createSearchScopes(this.scopeSet.asArray()),tokenType:n,keyId:r.sshKid,userAssertionHash:this.userAssertionHash},c=this.cacheManager.getAccessTokensByFilter(s,r.correlationId),l=c.length;if(l<1)return null;if(l>1)throw Pt(zp.multipleMatchingTokens);return c[0]}async executeTokenRequest(e,r,n){let o=this.createTokenQueryParameters(e),s=Is.appendQueryString(r.tokenEndpoint,o),c=await this.createTokenRequestBody(e),l=this.createTokenRequestHeaders(),u={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},d=Xu.nowSeconds(),f=await this.executePostToTokenEndpoint(s,c,l,u,e.correlationId),h=new Yp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return h.validateTokenResponse(f.body,e.correlationId),await h.handleServerTokenResponse(f.body,this.authority,d,e,Cf.acquireTokenByOBO,void 0,n)}async createTokenRequestBody(e){let r=new Map;an.addClientId(r,this.config.authOptions.clientId),an.addScopes(r,e.scopes),an.addGrantType(r,er.GrantType.JWT_BEARER),an.addClientInfo(r),an.addLibraryInfo(r,this.config.libraryInfo),an.addApplicationTelemetry(r,this.config.telemetry.application),an.addThrottling(r),this.serverTelemetryManager&&an.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();an.addCorrelationId(r,n),an.addRequestTokenUse(r,mY.ON_BEHALF_OF),an.addOboAssertion(r,e.oboAssertion),this.config.clientCredentials.clientSecret&&an.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=this.config.clientCredentials.clientAssertion;return o&&(an.addClientAssertion(r,await L_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),an.addClientAssertionType(r,o.assertionType)),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&an.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),SA.mapToQueryString(r)}};var Vce=class extends Hce{static{a(this,"ConfidentialClientApplication")}constructor(e){super(e);let r=!!this.config.auth.clientSecret,n=!!this.config.auth.clientAssertion,o=(!!this.config.auth.clientCertificate?.thumbprint||!!this.config.auth.clientCertificate?.thumbprintSha256)&&!!this.config.auth.clientCertificate?.privateKey;if(!this.appTokenProvider){if(r&&n||n&&o||r&&o)throw Pt(O3t);if(this.config.auth.clientSecret){this.clientSecret=this.config.auth.clientSecret;return}if(this.config.auth.clientAssertion){this.developerProvidedClientAssertion=this.config.auth.clientAssertion;return}if(o)this.clientAssertion=this.config.auth.clientCertificate.thumbprintSha256?E3.fromCertificateWithSha256Thumbprint(this.config.auth.clientCertificate.thumbprintSha256,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c):E3.fromCertificate(this.config.auth.clientCertificate.thumbprint,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c);else throw Pt(O3t);this.appTokenProvider=void 0}}SetAppTokenProvider(e){this.appTokenProvider=e}async acquireTokenByClientCredential(e){this.logger.info("acquireTokenByClientCredential called",e.correlationId||"");let r;e.clientAssertion&&(r={assertion:await L_(e.clientAssertion,this.config.auth.clientId),assertionType:Dx.JWT_BEARER_ASSERTION_TYPE});let n=await this.initializeBaseRequest(e),o={...n,scopes:n.scopes.filter(m=>!er.OIDC_DEFAULT_SCOPES.includes(m))},s={...e,...o,clientAssertion:r},l=new Is(s.authority).getUrlComponents().PathSegments[0];if(Object.values(er.AADAuthority).includes(l))throw Pt(rcn);let u=process.env[fin],d;s.azureRegion!=="DisableMsalForceRegion"&&(!s.azureRegion&&u?d=u:d=s.azureRegion);let f={azureRegion:d,environmentRegion:process.env[din]},h=this.initializeServerTelemetryManager(Cf.acquireTokenByClientCredential,s.correlationId,s.skipCache);try{let m=await this.createAuthority(s.authority,s.correlationId,f,e.azureCloudOptions),g=await this.buildOauthClientConfiguration(m,s.correlationId,"",h),A=new $ce(g,this.appTokenProvider);return this.logger.verbose("Client credential client created",s.correlationId),await A.acquireToken(s)}catch(m){throw m instanceof Fo&&m.setCorrelationId(s.correlationId),h.cacheFailedRequest(m),m}}async acquireTokenOnBehalfOf(e){this.logger.info("acquireTokenOnBehalfOf called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)};try{let n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),o=await this.buildOauthClientConfiguration(n,r.correlationId,"",void 0),s=new MGe(o);return this.logger.verbose("On behalf of client created",r.correlationId),await s.acquireToken(r)}catch(n){throw n instanceof Fo&&n.setCorrelationId(r.correlationId),n}}};p();p();p();p();p();function dcn(t){if(typeof t!="string")return!1;let e=new Date(t);return!isNaN(e.getTime())&&e.toISOString()===t}a(dcn,"isIso8601");p();var OGe=class{static{a(this,"HttpClientWithRetries")}constructor(e,r,n){this.httpClientNoRetries=e,this.retryPolicy=r,this.logger=n}async sendNetworkRequestAsyncHelper(e,r,n){return e===ep.GET?this.httpClientNoRetries.sendGetRequestAsync(r,n):this.httpClientNoRetries.sendPostRequestAsync(r,n)}async sendNetworkRequestAsync(e,r,n){let o=await this.sendNetworkRequestAsyncHelper(e,r,n);"isNewRequest"in this.retryPolicy&&(this.retryPolicy.isNewRequest=!0);let s=0;for(;await this.retryPolicy.pauseForRetry(o.status,s,this.logger,o.headers[er.HeaderNames.RETRY_AFTER]);)o=await this.sendNetworkRequestAsyncHelper(e,r,n),s++;return o}async sendGetRequestAsync(e,r){return this.sendNetworkRequestAsync(ep.GET,e,r)}async sendPostRequestAsync(e,r){return this.sendNetworkRequestAsync(ep.POST,e,r)}};var OY={MANAGED_IDENTITY_CLIENT_ID_2017:"clientid",MANAGED_IDENTITY_CLIENT_ID:"client_id",MANAGED_IDENTITY_OBJECT_ID:"object_id",MANAGED_IDENTITY_RESOURCE_ID_IMDS:"msi_res_id",MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS:"mi_res_id"},F_=class{static{a(this,"BaseManagedIdentitySource")}constructor(e,r,n,o,s){this.logger=e,this.nodeStorage=r,this.networkClient=n,this.cryptoProvider=o,this.disableInternalRetries=s}async getServerTokenResponseAsync(e,r,n,o){return this.getServerTokenResponse(e)}getServerTokenResponse(e){let r,n;return e.body.expires_on&&(dcn(e.body.expires_on)&&(e.body.expires_on=new Date(e.body.expires_on).getTime()/1e3),n=e.body.expires_on-Xu.nowSeconds(),n>2*3600&&(r=n/2)),{status:e.status,access_token:e.body.access_token,expires_in:n,scope:e.body.resource,token_type:e.body.token_type,refresh_in:r,correlation_id:e.body.correlation_id||e.body.correlationId,error:typeof e.body.error=="string"?e.body.error:e.body.error?.code,error_description:e.body.message||(typeof e.body.error=="string"?e.body.error_description:e.body.error?.message),error_codes:e.body.error_codes,timestamp:e.body.timestamp,trace_id:e.body.trace_id}}async acquireTokenWithManagedIdentity(e,r,n,o){let s=this.createRequest(e.resource,r);if(e.revokedTokenSha256Hash&&(this.logger.info(`[Managed Identity] The following claims are present in the request: ${e.claims}`,""),s.queryParameters[Gh.SHA256_TOKEN_TO_REFRESH]=e.revokedTokenSha256Hash),e.clientCapabilities?.length){let g=e.clientCapabilities.toString();this.logger.info(`[Managed Identity] The following client capabilities are present in the request: ${g}`,""),s.queryParameters[Gh.XMS_CC]=g}let c=s.headers;c[er.HeaderNames.CONTENT_TYPE]=er.URL_FORM_CONTENT_TYPE;let l={headers:c};Object.keys(s.bodyParameters).length&&(l.body=s.computeParametersBodyString());let u=this.disableInternalRetries?this.networkClient:new OGe(this.networkClient,s.retryPolicy,this.logger),d=Xu.nowSeconds(),f;try{s.httpMethod===ep.POST?f=await u.sendPostRequestAsync(s.computeUri(),l):f=await u.sendGetRequestAsync(s.computeUri(),l)}catch(g){throw g instanceof Fo?g:Pt(zp.networkError)}let h=new Yp(r.id,this.nodeStorage,this.cryptoProvider,this.logger,new Hh,null,null),m=await this.getServerTokenResponseAsync(f,u,s,l);return h.validateTokenResponse(m,m.correlation_id||"",o),h.handleServerTokenResponse(m,n,d,e,Cf.acquireTokenWithManagedIdentity)}getManagedIdentityUserAssignedIdQueryParameterKey(e,r,n){switch(e){case vf.USER_ASSIGNED_CLIENT_ID:return this.logger.info(`[Managed Identity] [API version ${n?"2017+":"2019+"}] Adding user assigned client id to the request.`,""),n?OY.MANAGED_IDENTITY_CLIENT_ID_2017:OY.MANAGED_IDENTITY_CLIENT_ID;case vf.USER_ASSIGNED_RESOURCE_ID:return this.logger.info("[Managed Identity] Adding user assigned resource id to the request.",""),r?OY.MANAGED_IDENTITY_RESOURCE_ID_IMDS:OY.MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS;case vf.USER_ASSIGNED_OBJECT_ID:return this.logger.info("[Managed Identity] Adding user assigned object id to the request.",""),OY.MANAGED_IDENTITY_OBJECT_ID;default:throw Kp(oQ)}}};F_.getValidatedEnvVariableUrlString=(t,e,r,n)=>{try{return new Is(e).urlString}catch{throw n.info(`[Managed Identity] ${r} managed identity is unavailable because the '${t}' environment variable is malformed.`,""),Kp(DY[t])}};p();p();p();var LGe=class{static{a(this,"LinearRetryStrategy")}calculateDelay(e,r){if(!e)return r;let n=Math.round(parseFloat(e)*1e3);return isNaN(n)&&(n=new Date(e).valueOf()-new Date().valueOf()),Math.max(r,n)}};var tNo=3,rNo=1e3,nNo=[er.HTTP_NOT_FOUND,er.HTTP_REQUEST_TIMEOUT,er.HTTP_TOO_MANY_REQUESTS,er.HTTP_SERVER_ERROR,er.HTTP_SERVICE_UNAVAILABLE,er.HTTP_GATEWAY_TIMEOUT],BGe=class t{static{a(this,"DefaultManagedIdentityRetryPolicy")}constructor(){this.linearRetryStrategy=new LGe}static get DEFAULT_MANAGED_IDENTITY_RETRY_DELAY_MS(){return rNo}async pauseForRetry(e,r,n,o){if(nNo.includes(e)&&rsetTimeout(c,s)),!0}return!1}};var wC=class{static{a(this,"ManagedIdentityRequestParameters")}constructor(e,r,n){this.httpMethod=e,this._baseEndpoint=r,this.headers={},this.bodyParameters={},this.queryParameters={},this.retryPolicy=n||new BGe}computeUri(){let e=new Map;this.queryParameters&&an.addExtraParameters(e,this.queryParameters);let r=SA.mapToQueryString(e);return Is.appendQueryString(this._baseEndpoint,r)}computeParametersBodyString(){let e=new Map;return this.bodyParameters&&an.addExtraParameters(e,this.bodyParameters),SA.mapToQueryString(e)}};var iNo="2019-08-01",kTe=class t extends F_{static{a(this,"AppService")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.identityEndpoint=c,this.identityHeader=l}static getEnvironmentVariables(){let e=process.env[Wi.IDENTITY_ENDPOINT],r=process.env[Wi.IDENTITY_HEADER];return[e,r]}static tryCreate(e,r,n,o,s){let[c,l]=t.getEnvironmentVariables();if(!c||!l)return e.info(`[Managed Identity] ${ro.APP_SERVICE} managed identity is unavailable because one or both of the '${Wi.IDENTITY_HEADER}' and '${Wi.IDENTITY_ENDPOINT}' environment variables are not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(Wi.IDENTITY_ENDPOINT,c,ro.APP_SERVICE,e);return e.info(`[Managed Identity] Environment variables validation passed for ${ro.APP_SERVICE} managed identity. Endpoint URI: ${u}. Creating ${ro.APP_SERVICE} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new wC(ep.GET,this.identityEndpoint);return n.headers[xC.APP_SERVICE_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[Gh.API_VERSION]=iNo,n.queryParameters[Gh.RESOURCE]=e,r.idType!==vf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var _3=require("fs"),mcn=fe(require("path"),1);var oNo="2019-11-01",fcn="http://127.0.0.1:40342/metadata/identity/oauth2/token",pcn="N/A: himds executable exists",hcn={win32:`${process.env.ProgramData}\\AzureConnectedMachineAgent\\Tokens\\`,linux:"/var/opt/azcmagent/tokens/"},sNo={win32:`${process.env.ProgramFiles}\\AzureConnectedMachineAgent\\himds.exe`,linux:"/opt/azcmagent/bin/himds"},PTe=class t extends F_{static{a(this,"AzureArc")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.identityEndpoint=c}static getEnvironmentVariables(){let e=process.env[Wi.IDENTITY_ENDPOINT],r=process.env[Wi.IMDS_ENDPOINT];if(!e||!r){let n=sNo[process.platform];try{(0,_3.accessSync)(n,_3.constants.F_OK|_3.constants.R_OK),e=fcn,r=pcn}catch{}}return[e,r]}static tryCreate(e,r,n,o,s,c){let[l,u]=t.getEnvironmentVariables();if(!l||!u)return e.info(`[Managed Identity] ${ro.AZURE_ARC} managed identity is unavailable through environment variables because one or both of '${Wi.IDENTITY_ENDPOINT}' and '${Wi.IMDS_ENDPOINT}' are not defined. ${ro.AZURE_ARC} managed identity is also unavailable through file detection.`,""),null;if(u===pcn)e.info(`[Managed Identity] ${ro.AZURE_ARC} managed identity is available through file detection. Defaulting to known ${ro.AZURE_ARC} endpoint: ${fcn}. Creating ${ro.AZURE_ARC} managed identity.`,"");else{let d=t.getValidatedEnvVariableUrlString(Wi.IDENTITY_ENDPOINT,l,ro.AZURE_ARC,e);d.endsWith("/")&&d.slice(0,-1),t.getValidatedEnvVariableUrlString(Wi.IMDS_ENDPOINT,u,ro.AZURE_ARC,e),e.info(`[Managed Identity] Environment variables validation passed for ${ro.AZURE_ARC} managed identity. Endpoint URI: ${d}. Creating ${ro.AZURE_ARC} managed identity.`,"")}if(c.idType!==vf.SYSTEM_ASSIGNED)throw Kp(YHe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new wC(ep.GET,this.identityEndpoint.replace("localhost","127.0.0.1"));return r.headers[xC.METADATA_HEADER_NAME]="true",r.queryParameters[Gh.API_VERSION]=oNo,r.queryParameters[Gh.RESOURCE]=e,r}async getServerTokenResponseAsync(e,r,n,o){let s;if(e.status===er.HTTP_UNAUTHORIZED){let c=e.headers["www-authenticate"];if(!c)throw Kp(ZHe);if(!c.includes("Basic realm="))throw Kp(XHe);let l=c.split("Basic realm=")[1];if(!hcn.hasOwnProperty(process.platform))throw Kp(zHe);let u=hcn[process.platform],d=mcn.default.basename(l);if(!d.endsWith(".key"))throw Kp($He);if(u+d!==l)throw Kp(VHe);let f;try{f=await(0,_3.statSync)(l).size}catch{throw Kp(ETe)}if(f>min)throw Kp(WHe);let h;try{h=(0,_3.readFileSync)(l,er.EncodingTypes.UTF8)}catch{throw Kp(ETe)}let m=`Basic ${h}`;this.logger.info("[Managed Identity] Adding authorization header to the request.",""),n.headers[xC.AUTHORIZATION_HEADER_NAME]=m;try{s=await r.sendGetRequestAsync(n.computeUri(),o)}catch(g){throw g instanceof Fo?g:Pt(zp.networkError)}}return this.getServerTokenResponse(s||e)}};p();var DTe=class t extends F_{static{a(this,"CloudShell")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.msiEndpoint=c}static getEnvironmentVariables(){return[process.env[Wi.MSI_ENDPOINT]]}static tryCreate(e,r,n,o,s,c){let[l]=t.getEnvironmentVariables();if(!l)return e.info(`[Managed Identity] ${ro.CLOUD_SHELL} managed identity is unavailable because the '${Wi.MSI_ENDPOINT} environment variable is not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(Wi.MSI_ENDPOINT,l,ro.CLOUD_SHELL,e);if(e.info(`[Managed Identity] Environment variable validation passed for ${ro.CLOUD_SHELL} managed identity. Endpoint URI: ${u}. Creating ${ro.CLOUD_SHELL} managed identity.`,""),c.idType!==vf.SYSTEM_ASSIGNED)throw Kp(KHe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new wC(ep.POST,this.msiEndpoint);return r.headers[xC.METADATA_HEADER_NAME]="true",r.bodyParameters[Gh.RESOURCE]=e,r}};p();p();p();var FGe=class{static{a(this,"ExponentialRetryStrategy")}constructor(e,r,n){this.minExponentialBackoff=e,this.maxExponentialBackoff=r,this.exponentialDeltaBackoff=n}calculateDelay(e){return e===0?this.minExponentialBackoff:Math.min(Math.pow(2,e-1)*this.exponentialDeltaBackoff,this.maxExponentialBackoff)}};var aNo=[er.HTTP_NOT_FOUND,er.HTTP_REQUEST_TIMEOUT,er.HTTP_GONE,er.HTTP_TOO_MANY_REQUESTS],cNo=3,lNo=7,uNo=1e3,dNo=4e3,fNo=2e3,pNo=10*1e3,UGe=class t{static{a(this,"ImdsRetryPolicy")}constructor(){this.exponentialRetryStrategy=new FGe(t.MIN_EXPONENTIAL_BACKOFF_MS,t.MAX_EXPONENTIAL_BACKOFF_MS,t.EXPONENTIAL_DELTA_BACKOFF_MS)}static get MIN_EXPONENTIAL_BACKOFF_MS(){return uNo}static get MAX_EXPONENTIAL_BACKOFF_MS(){return dNo}static get EXPONENTIAL_DELTA_BACKOFF_MS(){return fNo}static get HTTP_STATUS_GONE_RETRY_AFTER_MS(){return pNo}set isNewRequest(e){this._isNewRequest=e}async pauseForRetry(e,r,n){if(this._isNewRequest&&(this._isNewRequest=!1,this.maxRetries=e===er.HTTP_GONE?lNo:cNo),(aNo.includes(e)||e>=er.HTTP_SERVER_ERROR_RANGE_START&&e<=er.HTTP_SERVER_ERROR_RANGE_END&&rsetTimeout(s,o)),!0}return!1}};var gcn="/metadata/identity/oauth2/token",hNo=`http://169.254.169.254${gcn}`,mNo="2018-02-01",QGe=class t extends F_{static{a(this,"Imds")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.identityEndpoint=c}static tryCreate(e,r,n,o,s){let c;return process.env[Wi.AZURE_POD_IDENTITY_AUTHORITY_HOST]?(e.info(`[Managed Identity] Environment variable ${Wi.AZURE_POD_IDENTITY_AUTHORITY_HOST} for ${ro.IMDS} returned endpoint: ${process.env[Wi.AZURE_POD_IDENTITY_AUTHORITY_HOST]}`,""),c=t.getValidatedEnvVariableUrlString(Wi.AZURE_POD_IDENTITY_AUTHORITY_HOST,`${process.env[Wi.AZURE_POD_IDENTITY_AUTHORITY_HOST]}${gcn}`,ro.IMDS,e)):(e.info(`[Managed Identity] Unable to find ${Wi.AZURE_POD_IDENTITY_AUTHORITY_HOST} environment variable for ${ro.IMDS}, using the default endpoint.`,""),c=hNo),new t(e,r,n,o,s,c)}createRequest(e,r){let n=new wC(ep.GET,this.identityEndpoint);return n.headers[xC.METADATA_HEADER_NAME]="true",n.queryParameters[Gh.API_VERSION]=mNo,n.queryParameters[Gh.RESOURCE]=e,r.idType!==vf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!0)]=r.id),n.retryPolicy=new UGe,n}};p();var gNo="2019-07-01-preview",NTe=class t extends F_{static{a(this,"ServiceFabric")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.identityEndpoint=c,this.identityHeader=l}static getEnvironmentVariables(){let e=process.env[Wi.IDENTITY_ENDPOINT],r=process.env[Wi.IDENTITY_HEADER],n=process.env[Wi.IDENTITY_SERVER_THUMBPRINT];return[e,r,n]}static tryCreate(e,r,n,o,s,c){let[l,u,d]=t.getEnvironmentVariables();if(!l||!u||!d)return e.info(`[Managed Identity] ${ro.SERVICE_FABRIC} managed identity is unavailable because one or all of the '${Wi.IDENTITY_HEADER}', '${Wi.IDENTITY_ENDPOINT}' or '${Wi.IDENTITY_SERVER_THUMBPRINT}' environment variables are not defined.`,""),null;let f=t.getValidatedEnvVariableUrlString(Wi.IDENTITY_ENDPOINT,l,ro.SERVICE_FABRIC,e);return e.info(`[Managed Identity] Environment variables validation passed for ${ro.SERVICE_FABRIC} managed identity. Endpoint URI: ${f}. Creating ${ro.SERVICE_FABRIC} managed identity.`,""),c.idType!==vf.SYSTEM_ASSIGNED&&e.warning(`[Managed Identity] ${ro.SERVICE_FABRIC} user assigned managed identity is configured in the cluster, not during runtime. See also: https://learn.microsoft.com/en-us/azure/service-fabric/configure-existing-cluster-enable-managed-identity-token-service.`,""),new t(e,r,n,o,s,l,u)}createRequest(e,r){let n=new wC(ep.GET,this.identityEndpoint);return n.headers[xC.ML_AND_SF_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[Gh.API_VERSION]=gNo,n.queryParameters[Gh.RESOURCE]=e,r.idType!==vf.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var ANo="2017-09-01",yNo=`Only client id is supported for user-assigned managed identity in ${ro.MACHINE_LEARNING}.`,MTe=class t extends F_{static{a(this,"MachineLearning")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.msiEndpoint=c,this.secret=l}static getEnvironmentVariables(){let e=process.env[Wi.MSI_ENDPOINT],r=process.env[Wi.MSI_SECRET];return[e,r]}static tryCreate(e,r,n,o,s){let[c,l]=t.getEnvironmentVariables();if(!c||!l)return e.info(`[Managed Identity] ${ro.MACHINE_LEARNING} managed identity is unavailable because one or both of the '${Wi.MSI_ENDPOINT}' and '${Wi.MSI_SECRET}' environment variables are not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(Wi.MSI_ENDPOINT,c,ro.MACHINE_LEARNING,e);return e.info(`[Managed Identity] Environment variables validation passed for ${ro.MACHINE_LEARNING} managed identity. Endpoint URI: ${u}. Creating ${ro.MACHINE_LEARNING} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new wC(ep.GET,this.msiEndpoint);if(n.headers[xC.METADATA_HEADER_NAME]="true",n.headers[xC.ML_AND_SF_SECRET_HEADER_NAME]=this.secret,n.queryParameters[Gh.API_VERSION]=ANo,n.queryParameters[Gh.RESOURCE]=e,r.idType===vf.SYSTEM_ASSIGNED)n.queryParameters[OY.MANAGED_IDENTITY_CLIENT_ID_2017]=process.env[Wi.DEFAULT_IDENTITY_CLIENT_ID];else if(r.idType===vf.USER_ASSIGNED_CLIENT_ID)n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!1,!0)]=r.id;else throw new Error(yNo);return n}};var OTe=class t{static{a(this,"ManagedIdentityClient")}constructor(e,r,n,o,s){this.logger=e,this.nodeStorage=r,this.networkClient=n,this.cryptoProvider=o,this.disableInternalRetries=s}async sendManagedIdentityTokenRequest(e,r,n,o){return t.identitySource||(t.identitySource=this.selectManagedIdentitySource(this.logger,this.nodeStorage,this.networkClient,this.cryptoProvider,this.disableInternalRetries,r)),t.identitySource.acquireTokenWithManagedIdentity(e,r,n,o)}allEnvironmentVariablesAreDefined(e){return Object.values(e).every(r=>r!==void 0)}getManagedIdentitySource(){return t.sourceName=this.allEnvironmentVariablesAreDefined(NTe.getEnvironmentVariables())?ro.SERVICE_FABRIC:this.allEnvironmentVariablesAreDefined(kTe.getEnvironmentVariables())?ro.APP_SERVICE:this.allEnvironmentVariablesAreDefined(MTe.getEnvironmentVariables())?ro.MACHINE_LEARNING:this.allEnvironmentVariablesAreDefined(DTe.getEnvironmentVariables())?ro.CLOUD_SHELL:this.allEnvironmentVariablesAreDefined(PTe.getEnvironmentVariables())?ro.AZURE_ARC:ro.DEFAULT_TO_IMDS,t.sourceName}selectManagedIdentitySource(e,r,n,o,s,c){let l=NTe.tryCreate(e,r,n,o,s,c)||kTe.tryCreate(e,r,n,o,s)||MTe.tryCreate(e,r,n,o,s)||DTe.tryCreate(e,r,n,o,s,c)||PTe.tryCreate(e,r,n,o,s,c)||QGe.tryCreate(e,r,n,o,s);if(!l)throw Kp(JHe);return l}};var ENo=[ro.SERVICE_FABRIC],Wce=class t{static{a(this,"ManagedIdentityApplication")}constructor(e){this.config=_in(e||{}),this.logger=new a0(this.config.system.loggerOptions,jce,SS);let r={canonicalAuthority:er.DEFAULT_AUTHORITY};t.nodeStorage||(t.nodeStorage=new aQ(this.logger,this.config.managedIdentityId.id,vce,r)),this.networkClient=this.config.system.networkClient,this.cryptoProvider=new KM;let n={protocolMode:nE.AAD,knownAuthorities:[qBt],cloudDiscoveryMetadata:"",authorityMetadata:""};this.fakeAuthority=new SP(qBt,this.networkClient,t.nodeStorage,n,this.logger,this.cryptoProvider.createNewGuid(),new Hh,!0),this.fakeClientCredentialClient=new $ce({authOptions:{clientId:this.config.managedIdentityId.id,authority:this.fakeAuthority}}),this.managedIdentityClient=new OTe(this.logger,t.nodeStorage,this.networkClient,this.cryptoProvider,this.config.disableInternalRetries),this.hashUtils=new sQ}async acquireToken(e){if(!e.resource)throw Cl(yce.urlEmptyError);let r={forceRefresh:e.forceRefresh,resource:e.resource.replace("/.default",""),scopes:[e.resource.replace("/.default","")],authority:this.fakeAuthority.canonicalAuthority,correlationId:this.cryptoProvider.createNewGuid(),claims:e.claims,clientCapabilities:this.config.clientCapabilities};if(r.forceRefresh)return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority);let[n,o]=await this.fakeClientCredentialClient.getCachedAuthenticationResult(r,this.config,this.cryptoProvider,this.fakeAuthority,t.nodeStorage);if(r.claims){let s=this.managedIdentityClient.getManagedIdentitySource();if(n&&ENo.includes(s)){let c=this.hashUtils.sha256(n.accessToken).toString(er.EncodingTypes.HEX);r.revokedTokenSha256Hash=c}return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}return n?(o===er.CacheOutcome.PROACTIVELY_REFRESHED&&(this.logger.info("ClientCredentialClient:getCachedAuthenticationResult - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.",r.correlationId),await this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority,!0)),n):this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}async acquireTokenFromManagedIdentity(e,r,n,o){return this.managedIdentityClient.sendManagedIdentityTokenRequest(e,r,n,o)}getManagedIdentitySource(){return OTe.sourceName||this.managedIdentityClient.getManagedIdentitySource()}};p();var qGe=class{static{a(this,"DistributedCachePlugin")}constructor(e,r){this.client=e,this.partitionManager=r}async beforeCacheAccess(e){let r=await this.partitionManager.getKey(),n=await this.client.get(r);e.tokenCache.deserialize(n)}async afterCacheAccess(e){if(e.cacheHasChanged){let r=e.tokenCache.getKVStore(),n=Object.values(r).filter(s=>xY.isAccountEntity(s)),o;if(n.length>0){let s=n[0];o=await this.partitionManager.extractKey(s)}else o=await this.partitionManager.getKey();await this.client.set(o,e.tokenCache.serialize())}}};var _No=er.PromptValue,vNo=er.ResponseMode;p();p();p();p();p();function LTe(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(LTe,"getRandomIntegerInclusive");function BTe(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+LTe(0,n/2)}}a(BTe,"calculateRetryDelay");p();function zce(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(zce,"isObject");p();function LY(t){if(zce(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(LY,"isError");p();p();var Acn=require("node:crypto");var L3t,CNo=typeof((L3t=globalThis?.crypto)===null||L3t===void 0?void 0:L3t.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):Acn.randomUUID;function Yce(){return CNo()}a(Yce,"randomUUID");p();var B3t,F3t,U3t,Q3t,ycn=typeof window<"u"&&typeof window.document<"u",Ecn=typeof self=="object"&&typeof self?.importScripts=="function"&&(((B3t=self.constructor)===null||B3t===void 0?void 0:B3t.name)==="DedicatedWorkerGlobalScope"||((F3t=self.constructor)===null||F3t===void 0?void 0:F3t.name)==="ServiceWorkerGlobalScope"||((U3t=self.constructor)===null||U3t===void 0?void 0:U3t.name)==="SharedWorkerGlobalScope"),_cn=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",vcn=typeof Bun<"u"&&typeof Bun.version<"u",dQ=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((Q3t=globalThis.process.versions)===null||Q3t===void 0)&&Q3t.node);var Ccn=typeof navigator<"u"&&navigator?.product==="ReactNative";p();function RC(t,e){return Buffer.from(t,e)}a(RC,"stringToUint8Array");p();var q3t="REDACTED",bNo=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],SNo=["api-version"],xP=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=bNo.concat(e),r=SNo.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||zce(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,q3t);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=q3t;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=q3t;return r}};p();p();p();p();var BY=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};function H3t(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new BY(o??"The operation was aborted."))}a(l,"rejectOnAbort");function u(){n?.removeEventListener("abort",d)}a(u,"removeListeners");function d(){r?.(),u(),l()}if(a(d,"onAbort"),n?.aborted)return l();try{t(f=>{u(),s(f)},f=>{u(),c(f)})}catch(f){c(f)}n?.addEventListener("abort",d)})}a(H3t,"createAbortablePromise");p();var RNo="The delay was aborted.";function G3t(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return H3t(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??RNo})}a(G3t,"delay");p();function Kce(t){if(LY(t))return t.message;{let e;try{typeof t=="object"&&t?e=JSON.stringify(t):e=String(t)}catch{e="[unable to stringify input]"}return`Unknown error ${e}`}}a(Kce,"getErrorMessage");p();function bcn(t,e){return BTe(t,e)}a(bcn,"calculateRetryDelay");function jGe(t){return LY(t)}a(jGe,"isError");var HGe=dQ,Jce=dQ;p();var FTe=ao("IdentityUtils"),Scn="1.0";function FY(t,e,r){let n=a(o=>(FTe.getToken.info(o),new kx({scopes:Array.isArray(t)?t:[t],getTokenOptions:r,message:o})),"error");if(!e)throw n("No response");if(!e.expiresOn)throw n('Response had no "expiresOn" property.');if(!e.accessToken)throw n('Response had no "accessToken" property.')}a(FY,"ensureValidMsalToken");function $3t(t){let e=t?.authorityHost;return!e&&Jce&&(e=process.env.AZURE_AUTHORITY_HOST),e??wSe}a($3t,"getAuthorityHost");function V3t(t,e){return e||(e=wSe),new RegExp(`${t}/?$`).test(e)?e:e.endsWith("/")?e+t:`${e}/${t}`}a(V3t,"getAuthority");function Tcn(t,e,r){return t==="adfs"&&e||r?[e]:[]}a(Tcn,"getKnownAuthorities");var GGe=a((t,e=HGe?"Node":"Browser")=>(r,n,o)=>{if(!o)switch(r){case TS.LogLevel.Error:t.info(`MSAL ${e} V2 error: ${n}`);return;case TS.LogLevel.Info:t.info(`MSAL ${e} V2 info message: ${n}`);return;case TS.LogLevel.Verbose:t.info(`MSAL ${e} V2 verbose message: ${n}`);return;case TS.LogLevel.Warning:t.info(`MSAL ${e} V2 warning: ${n}`);return}},"defaultLoggerCallback");function $Ge(t){switch(t){case"error":return TS.LogLevel.Error;case"info":return TS.LogLevel.Info;case"verbose":return TS.LogLevel.Verbose;case"warning":return TS.LogLevel.Warning;default:return TS.LogLevel.Info}}a($Ge,"getMSALLogLevel");function UY(t,e,r){if(e.name==="AuthError"||e.name==="ClientAuthError"||e.name==="BrowserAuthError"){let n=e;switch(n.errorCode){case"endpoints_resolution_error":return FTe.info(Qs(t,e.message)),new Mn(e.message);case"device_code_polling_cancelled":return new BY("The authentication has been aborted by the caller.");case"consent_required":case"interaction_required":case"login_required":FTe.info(Qs(t,`Authentication returned errorCode ${n.errorCode}`));break;default:FTe.info(Qs(t,`Failed to acquire token: ${e.message}`));break}}return e.name==="ClientConfigurationError"||e.name==="BrowserConfigurationAuthError"||e.name==="AbortError"||e.name==="AuthenticationError"?e:e.name==="NativeAuthError"?(FTe.info(Qs(t,`Error from the native broker: ${e.message} with status code: ${e.statusCode}`)),e):new kx({scopes:t,getTokenOptions:r,message:e.message})}a(UY,"handleMsalError");function Icn(t){return{localAccountId:t.homeAccountId,environment:t.authority,username:t.username,homeAccountId:t.homeAccountId,tenantId:t.tenantId}}a(Icn,"publicToMsal");function xcn(t,e){return{authority:e.environment??qrn,homeAccountId:e.homeAccountId,tenantId:e.tenantId||Qrn,username:e.username,clientId:t,version:Scn}}a(xcn,"msalToPublic");function W3t(t){let e=JSON.parse(t);if(e.version&&e.version!==Scn)throw Error("Unsupported AuthenticationRecord version");return e}a(W3t,"deserializeAuthenticationRecord");p();p();p();p();p();p();function PNo(t,e){return e!=="Composite"&&e!=="Dictionary"&&(typeof t=="string"||typeof t=="number"||typeof t=="boolean"||e?.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)!==null||t===void 0||t===null)}a(PNo,"isPrimitiveBody");function DNo(t){let e=Object.assign(Object.assign({},t.headers),t.body);return t.hasNullableType&&Object.getOwnPropertyNames(e).length===0?t.shouldWrapBody?{body:null}:null:t.shouldWrapBody?Object.assign(Object.assign({},t.headers),{body:t.body}):e}a(DNo,"handleNullableResponseAndWrappableBody");function z3t(t,e){var r,n;let o=t.parsedHeaders;if(t.request.method==="HEAD")return Object.assign(Object.assign({},o),{body:t.parsedBody});let s=e&&e.bodyMapper,c=!!s?.nullable,l=s?.type.name;if(l==="Stream")return Object.assign(Object.assign({},o),{blobBody:t.blobBody,readableStreamBody:t.readableStreamBody});let u=l==="Composite"&&s.type.modelProperties||{},d=Object.keys(u).some(f=>u[f].serializedName==="");if(l==="Sequence"||d){let f=(r=t.parsedBody)!==null&&r!==void 0?r:[];for(let h of Object.keys(u))u[h].serializedName&&(f[h]=(n=t.parsedBody)===null||n===void 0?void 0:n[h]);if(o)for(let h of Object.keys(o))f[h]=o[h];return c&&!t.parsedBody&&!o&&Object.getOwnPropertyNames(u).length===0?null:f}return DNo({body:t.parsedBody,headers:o,hasNullableType:c,shouldWrapBody:PNo(t.parsedBody,l)})}a(z3t,"flattenResponse");var eO={Base64Url:"Base64Url",Boolean:"Boolean",ByteArray:"ByteArray",Composite:"Composite",Date:"Date",DateTime:"DateTime",DateTimeRfc1123:"DateTimeRfc1123",Dictionary:"Dictionary",Enum:"Enum",Number:"Number",Object:"Object",Sequence:"Sequence",String:"String",Stream:"Stream",TimeSpan:"TimeSpan",UnixTime:"UnixTime"};p();p();p();p();p();var tO=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};p();p();p();var wcn=require("node:os"),Rcn=fe(require("node:util"),1),kcn=fe(require("node:process"),1);function Pcn(t,...e){kcn.stderr.write(`${Rcn.default.format(t,...e)}${wcn.EOL}`)}a(Pcn,"log");var Dcn=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,Ncn,Y3t=[],K3t=[],WGe=[];Dcn&&J3t(Dcn);var Mcn=Object.assign(t=>Ocn(t),{enable:J3t,enabled:Z3t,disable:NNo,log:Pcn});function J3t(t){Ncn=t,Y3t=[],K3t=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?K3t.push(new RegExp(`^${n.substr(1)}$`)):Y3t.push(new RegExp(`^${n}$`));for(let n of WGe)n.enabled=Z3t(n.namespace)}a(J3t,"enable");function Z3t(t){if(t.endsWith("*"))return!0;for(let e of K3t)if(e.test(t))return!1;for(let e of Y3t)if(e.test(t))return!0;return!1}a(Z3t,"enabled");function NNo(){let t=Ncn||"";return J3t(""),t}a(NNo,"disable");function Ocn(t){let e=Object.assign(r,{enabled:Z3t(t),destroy:MNo,log:Mcn.log,namespace:t,extend:ONo});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),WGe.push(e),e}a(Ocn,"createDebugger");function MNo(){let t=WGe.indexOf(this);return t>=0?(WGe.splice(t,1),!0):!1}a(MNo,"destroy");function ONo(t){let e=Ocn(`${this.namespace}:${t}`);return e.log=this.log,e}a(ONo,"extend");var Zce=Mcn;var X3t=["verbose","info","warning","error"],Lcn={verbose:400,info:300,warning:200,error:100};function Bcn(t,e){e.log=(...r)=>{t.log(...r)}}a(Bcn,"patchLogMethod");function Fcn(t){return X3t.includes(t)}a(Fcn,"isTypeSpecRuntimeLogLevel");function LNo(t){let e=new Set,r=typeof process<"u"&&process.env&&process.env[t.logLevelEnvVarName]||void 0,n,o=Zce(t.namespace);o.log=(...f)=>{Zce.log(...f)};function s(f){if(f&&!Fcn(f))throw new Error(`Unknown log level '${f}'. Acceptable values: ${X3t.join(",")}`);n=f;let h=[];for(let m of e)c(m)&&h.push(m.namespace);Zce.enable(h.join(","))}a(s,"contextSetLogLevel"),r&&(Fcn(r)?s(r):console.error(`${t.logLevelEnvVarName} set to unknown log level '${r}'; logging is not enabled. Acceptable values: ${X3t.join(", ")}.`));function c(f){return!!(n&&Lcn[f.level]<=Lcn[n])}a(c,"shouldEnable");function l(f,h){let m=Object.assign(f.extend(h),{level:h});if(Bcn(f,m),c(m)){let g=Zce.disable();Zce.enable(g+","+m.namespace)}return e.add(m),m}a(l,"createLogger");function u(){return n}a(u,"contextGetLogLevel");function d(f){let h=o.extend(f);return Bcn(o,h),{error:l(h,"error"),warning:l(h,"warning"),info:l(h,"info"),verbose:l(h,"verbose")}}return a(d,"contextCreateClientLogger"),{setLogLevel:s,getLogLevel:u,createClientLogger:d,logger:o}}a(LNo,"createLoggerContext");var Ucn=LNo({logLevelEnvVarName:"TYPESPEC_RUNTIME_LOG_LEVEL",namespace:"typeSpecRuntime"}),BNo=Ucn.logger;function QTe(t){return Ucn.createClientLogger(t)}a(QTe,"createClientLogger");p();function zGe(t){return t.toLowerCase()}a(zGe,"normalizeName");function*FNo(t){for(let e of t.values())yield[e.name,e.value]}a(FNo,"headerIterator");var eFt=class{static{a(this,"HttpHeadersImpl")}constructor(e){if(this._headersMap=new Map,e)for(let r of Object.keys(e))this.set(r,e[r])}set(e,r){this._headersMap.set(zGe(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(zGe(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(zGe(e))}delete(e){this._headersMap.delete(zGe(e))}toJSON(e={}){let r={};if(e.preserveCase)for(let n of this._headersMap.values())r[n.name]=n.value;else for(let[n,o]of this._headersMap)r[n]=o.value;return r}toString(){return JSON.stringify(this.toJSON({preserveCase:!0}))}[Symbol.iterator](){return FNo(this._headersMap)}};function IS(t){return new eFt(t)}a(IS,"createHttpHeaders");p();p();p();var tFt=class{static{a(this,"PipelineRequestImpl")}constructor(e){var r,n,o,s,c,l,u;this.url=e.url,this.body=e.body,this.headers=(r=e.headers)!==null&&r!==void 0?r:IS(),this.method=(n=e.method)!==null&&n!==void 0?n:"GET",this.timeout=(o=e.timeout)!==null&&o!==void 0?o:0,this.multipartBody=e.multipartBody,this.formData=e.formData,this.disableKeepAlive=(s=e.disableKeepAlive)!==null&&s!==void 0?s:!1,this.proxySettings=e.proxySettings,this.streamResponseStatusCodes=e.streamResponseStatusCodes,this.withCredentials=(c=e.withCredentials)!==null&&c!==void 0?c:!1,this.abortSignal=e.abortSignal,this.onUploadProgress=e.onUploadProgress,this.onDownloadProgress=e.onDownloadProgress,this.requestId=e.requestId||Yce(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1,this.requestOverrides=e.requestOverrides,this.authSchemes=e.authSchemes}};function YGe(t){return new tFt(t)}a(YGe,"createPipelineRequest");p();var Qcn=new Set(["Deserialize","Serialize","Retry","Sign"]),rFt=class t{static{a(this,"HttpPipeline")}constructor(e){var r;this._policies=[],this._policies=(r=e?.slice(0))!==null&&r!==void 0?r:[],this._orderedPolicies=void 0}addPolicy(e,r={}){if(r.phase&&r.afterPhase)throw new Error("Policies inside a phase cannot specify afterPhase.");if(r.phase&&!Qcn.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!Qcn.has(r.afterPhase))throw new Error(`Invalid afterPhase name: ${r.afterPhase}`);this._policies.push({policy:e,options:r}),this._orderedPolicies=void 0}removePolicy(e){let r=[];return this._policies=this._policies.filter(n=>e.name&&n.policy.name===e.name||e.phase&&n.options.phase===e.phase?(r.push(n.policy),!1):!0),this._orderedPolicies=void 0,r}sendRequest(e,r){return this.getOrderedPolicies().reduceRight((s,c)=>l=>c.sendRequest(l,s),s=>e.sendRequest(s))(r)}getOrderedPolicies(){return this._orderedPolicies||(this._orderedPolicies=this.orderPolicies()),this._orderedPolicies}clone(){return new t(this._policies)}static create(){return new t}orderPolicies(){let e=[],r=new Map;function n(A){return{name:A,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}a(n,"createPhase");let o=n("Serialize"),s=n("None"),c=n("Deserialize"),l=n("Retry"),u=n("Sign"),d=[o,s,c,l,u];function f(A){return A==="Retry"?l:A==="Serialize"?o:A==="Deserialize"?c:A==="Sign"?u:s}a(f,"getPhase");for(let A of this._policies){let y=A.policy,E=A.options,_=y.name;if(r.has(_))throw new Error("Duplicate policy names not allowed in pipeline");let v={policy:y,dependsOn:new Set,dependants:new Set};E.afterPhase&&(v.afterPhase=f(E.afterPhase),v.afterPhase.hasAfterPolicies=!0),r.set(_,v),f(E.phase).policies.add(v)}for(let A of this._policies){let{policy:y,options:E}=A,_=y.name,v=r.get(_);if(!v)throw new Error(`Missing node for policy ${_}`);if(E.afterPolicies)for(let b of E.afterPolicies){let T=r.get(b);T&&(v.dependsOn.add(T),T.dependants.add(v))}if(E.beforePolicies)for(let b of E.beforePolicies){let T=r.get(b);T&&(T.dependsOn.add(v),v.dependants.add(T))}}function h(A){A.hasRun=!0;for(let y of A.policies)if(!(y.afterPhase&&(!y.afterPhase.hasRun||y.afterPhase.policies.size))&&y.dependsOn.size===0){e.push(y.policy);for(let E of y.dependants)E.dependsOn.delete(y);r.delete(y.policy.name),A.policies.delete(y)}}a(h,"walkPhase");function m(){for(let A of d){if(h(A),A.policies.size>0&&A!==s){s.hasRun||h(s);return}A.hasAfterPolicies&&h(s)}}a(m,"walkPhases");let g=0;for(;r.size>0;){g++;let A=e.length;if(m(),e.length<=A&&g>1)throw new Error("Cannot satisfy policy dependencies due to requirements cycle.")}return e}};function KGe(){return rFt.create()}a(KGe,"createEmptyPipeline");p();p();var qcn=require("node:util"),jcn=qcn.inspect.custom;var UNo=new xP,xA=class t extends Error{static{a(this,"RestError")}constructor(e,r={}){super(e),this.name="RestError",this.code=r.code,this.statusCode=r.statusCode,Object.defineProperty(this,"request",{value:r.request,enumerable:!1}),Object.defineProperty(this,"response",{value:r.response,enumerable:!1}),Object.defineProperty(this,jcn,{value:a(()=>`RestError: ${this.message} + ${UNo.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`,"value"),enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}};xA.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";xA.PARSE_ERROR="PARSE_ERROR";function JGe(t){return t instanceof xA?!0:LY(t)&&t.name==="RestError"}a(JGe,"isRestError");p();p();var Xce=fe(require("node:http"),1),ele=fe(require("node:https"),1),XGe=fe(require("node:zlib"),1),Gcn=require("node:stream");p();var Bx=QTe("ts-http-runtime");var QNo={};function qTe(t){return t&&typeof t.pipe=="function"}a(qTe,"isReadableStream");function Hcn(t){return t.readable===!1?Promise.resolve():new Promise(e=>{let r=a(()=>{e(),t.removeListener("close",r),t.removeListener("end",r),t.removeListener("error",r)},"handler");t.on("close",r),t.on("end",r),t.on("error",r)})}a(Hcn,"isStreamComplete");function $cn(t){return t&&typeof t.byteLength=="number"}a($cn,"isArrayBuffer");var ZGe=class extends Gcn.Transform{static{a(this,"ReportTransform")}_transform(e,r,n){this.push(e),this.loadedBytes+=e.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),n()}catch(o){n(o)}}constructor(e){super(),this.loadedBytes=0,this.progressCallback=e}},nFt=class{static{a(this,"NodeHttpClient")}constructor(){this.cachedHttpsAgents=new WeakMap}async sendRequest(e){var r,n,o;let s=new AbortController,c;if(e.abortSignal){if(e.abortSignal.aborted)throw new tO("The operation was aborted. Request has already been canceled.");c=a(m=>{m.type==="abort"&&s.abort()},"abortListener"),e.abortSignal.addEventListener("abort",c)}let l;e.timeout>0&&(l=setTimeout(()=>{let m=new xP;Bx.info(`request to '${m.sanitizeUrl(e.url)}' timed out. canceling...`),s.abort()},e.timeout));let u=e.headers.get("Accept-Encoding"),d=u?.includes("gzip")||u?.includes("deflate"),f=typeof e.body=="function"?e.body():e.body;if(f&&!e.headers.has("Content-Length")){let m=GNo(f);m!==null&&e.headers.set("Content-Length",m)}let h;try{if(f&&e.onUploadProgress){let _=e.onUploadProgress,v=new ZGe(_);v.on("error",b=>{Bx.error("Error in upload progress",b)}),qTe(f)?f.pipe(v):v.end(f),f=v}let m=await this.makeRequest(e,s,f);l!==void 0&&clearTimeout(l);let g=qNo(m),y={status:(r=m.statusCode)!==null&&r!==void 0?r:0,headers:g,request:e};if(e.method==="HEAD")return m.resume(),y;h=d?jNo(m,g):m;let E=e.onDownloadProgress;if(E){let _=new ZGe(E);_.on("error",v=>{Bx.error("Error in download progress",v)}),h.pipe(_),h=_}return!((n=e.streamResponseStatusCodes)===null||n===void 0)&&n.has(Number.POSITIVE_INFINITY)||!((o=e.streamResponseStatusCodes)===null||o===void 0)&&o.has(y.status)?y.readableStreamBody=h:y.bodyAsText=await HNo(h),y}finally{if(e.abortSignal&&c){let m=Promise.resolve();qTe(f)&&(m=Hcn(f));let g=Promise.resolve();qTe(h)&&(g=Hcn(h)),Promise.all([m,g]).then(()=>{var A;c&&((A=e.abortSignal)===null||A===void 0||A.removeEventListener("abort",c))}).catch(A=>{Bx.warning("Error when cleaning up abortListener on httpRequest",A)})}}}makeRequest(e,r,n){var o;let s=new URL(e.url),c=s.protocol!=="https:";if(c&&!e.allowInsecureConnection)throw new Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);let l=(o=e.agent)!==null&&o!==void 0?o:this.getOrCreateAgent(e,c),u=Object.assign({agent:l,hostname:s.hostname,path:`${s.pathname}${s.search}`,port:s.port,method:e.method,headers:e.headers.toJSON({preserveCase:!0})},e.requestOverrides);return new Promise((d,f)=>{let h=c?Xce.request(u,d):ele.request(u,d);h.once("error",m=>{var g;f(new xA(m.message,{code:(g=m.code)!==null&&g!==void 0?g:xA.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new tO("The operation was aborted. Rejecting from abort signal callback while making request.");h.destroy(m),f(m)}),n&&qTe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):$cn(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(Bx.error("Unrecognized body type",n),f(new xA("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?Xce.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new Xce.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return ele.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:QNo,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(Bx.info("No cached TLS Agent exist, creating a new Agent"),c=new ele.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function qNo(t){let e=IS();for(let r of Object.keys(t.headers)){let n=t.headers[r];Array.isArray(n)?n.length>0&&e.set(r,n[0]):n&&e.set(r,n)}return e}a(qNo,"getResponseHeaders");function jNo(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=XGe.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=XGe.createInflate();return t.pipe(n),n}return t}a(jNo,"getDecodedResponseStream");function HNo(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{Buffer.isBuffer(o)?n.push(o):n.push(Buffer.from(o))}),t.on("end",()=>{e(Buffer.concat(n).toString("utf8"))}),t.on("error",o=>{o&&o?.name==="AbortError"?r(o):r(new xA(`Error reading response as text: ${o.message}`,{code:xA.PARSE_ERROR}))})})}a(HNo,"streamToText");function GNo(t){return t?Buffer.isBuffer(t)?t.length:qTe(t)?null:$cn(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(GNo,"getBodyLength");function Vcn(){return new nFt}a(Vcn,"createNodeHttpClient");function e$e(){return Vcn()}a(e$e,"createDefaultHttpClient");p();p();p();p();var iFt="logPolicy";function t$e(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:Bx.info,n=new xP({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:iFt,async sendRequest(o,s){if(!r.enabled)return s(o);r(`Request: ${n.sanitize(o)}`);let c=await s(o);return r(`Response status code: ${c.status}`),r(`Headers: ${n.sanitize(c.headers)}`),c}}}a(t$e,"logPolicy");p();var oFt="redirectPolicy",Wcn=["GET","HEAD"];function r$e(t={}){let{maxRetries:e=20}=t;return{name:oFt,async sendRequest(r,n){let o=await n(r);return zcn(n,o,e)}}}a(r$e,"redirectPolicy");async function zcn(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&Wcn.includes(o.method)||s===302&&Wcn.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{let s,c,l=a(()=>o(new tO(r?.abortErrorMsg?r?.abortErrorMsg:$No)),"rejectOnAbort"),u=a(()=>{r?.abortSignal&&c&&r.abortSignal.removeEventListener("abort",c)},"removeListeners");if(c=a(()=>(s&&clearTimeout(s),u(),l()),"onAborted"),r?.abortSignal&&r.abortSignal.aborted)return l();s=setTimeout(()=>{u(),n(e)},t),r?.abortSignal&&r.abortSignal.addEventListener("abort",c)})}a(Jcn,"delay");function Zcn(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(Zcn,"parseHeaderValueAsNumber");var aFt="Retry-After",VNo=["retry-after-ms","x-ms-retry-after-ms",aFt];function Xcn(t){if(t&&[429,503].includes(t.status))try{for(let o of VNo){let s=Zcn(t,o);if(s===0||s)return s*(o===aFt?1e3:1)}let e=t.headers.get(aFt);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(Xcn,"getRetryAfterInMs");function eln(t){return Number.isFinite(Xcn(t))}a(eln,"isThrottlingRetryResponse");function cFt(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=Xcn(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(cFt,"throttlingRetryStrategy");var WNo=1e3,zNo=1e3*64;function i$e(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:WNo,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:zNo;return{name:"exponentialRetryStrategy",retry({retryCount:s,response:c,responseError:l}){let u=KNo(l),d=u&&t.ignoreSystemErrors,f=YNo(c),h=f&&t.ignoreHttpStatusCodes;return c&&(eln(c)||!f)||h||d?{skipStrategy:!0}:l&&!u&&!f?{errorToThrow:l}:BTe(s,{retryDelayInMs:n,maxRetryDelayInMs:o})}}}a(i$e,"exponentialRetryStrategy");function YNo(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(YNo,"isExponentialRetryResponse");function KNo(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(KNo,"isSystemError");p();var JNo=QTe("ts-http-runtime retryPolicy"),ZNo="retryPolicy";function fQ(t,e={maxRetries:3}){let r=e.logger||JNo;return{name:ZNo,async sendRequest(n,o){var s,c;let l,u,d=-1;e:for(;;){d+=1,l=void 0,u=void 0;try{r.info(`Retry ${d}: Attempting to send request`,n.requestId),l=await o(n),r.info(`Retry ${d}: Received a response from request`,n.requestId)}catch(f){if(r.error(`Retry ${d}: Received an error from request`,n.requestId),u=f,!f||u.name!=="RestError")throw f;l=u.response}if(!((s=n.abortSignal)===null||s===void 0)&&s.aborted)throw r.error(`Retry ${d}: Request aborted.`),new tO;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:3)){if(r.info(`Retry ${d}: Maximum retries reached. Returning the last received response, or throwing the last received error.`),u)throw u;if(l)return l;throw new Error("Maximum retries reached with no response or error to throw")}r.info(`Retry ${d}: Processing ${t.length} retry strategies.`);t:for(let f of t){let h=f.logger||r;h.info(`Retry ${d}: Processing retry strategy ${f.name}.`);let m=f.retry({retryCount:d,response:l,responseError:u});if(m.skipStrategy){h.info(`Retry ${d}: Skipped.`);continue t}let{errorToThrow:g,retryAfterInMs:A,redirectTo:y}=m;if(g)throw h.error(`Retry ${d}: Retry strategy ${f.name} throws error:`,g),g;if(A||A===0){h.info(`Retry ${d}: Retry strategy ${f.name} retries after ${A}`),await Jcn(A,void 0,{abortSignal:n.abortSignal});continue e}if(y){h.info(`Retry ${d}: Retry strategy ${f.name} redirects to ${y}`),n.url=y;continue e}}if(u)throw r.info("None of the retry strategies could work with the received error. Throwing it."),u;if(l)return r.info("None of the retry strategies could work with the received response. Returning it."),l}}}}a(fQ,"retryPolicy");var lFt="defaultRetryPolicy";function o$e(t={}){var e;return{name:lFt,sendRequest:fQ([cFt(),i$e(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:3}).sendRequest}}a(o$e,"defaultRetryPolicy");p();var uFt="formDataPolicy";function XNo(t){var e;let r={};for(let[n,o]of t.entries())(e=r[n])!==null&&e!==void 0||(r[n]=[]),r[n].push(o);return r}a(XNo,"formDataToFormDataMap");function s$e(){return{name:uFt,async sendRequest(t,e){if(dQ&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=XNo(t.body),t.body=void 0),t.formData){let r=t.headers.get("Content-Type");r&&r.indexOf("application/x-www-form-urlencoded")!==-1?t.body=eMo(t.formData):await tMo(t.formData,t),t.formData=void 0}return e(t)}}}a(s$e,"formDataPolicy");function eMo(t){let e=new URLSearchParams;for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.append(r,o.toString());else e.append(r,n.toString());return e.toString()}a(eMo,"wwwFormUrlEncode");async function tMo(t,e){let r=e.headers.get("Content-Type");if(r&&!r.startsWith("multipart/form-data"))return;e.headers.set("Content-Type",r??"multipart/form-data");let n=[];for(let[o,s]of Object.entries(t))for(let c of Array.isArray(s)?s:[s])if(typeof c=="string")n.push({headers:IS({"Content-Disposition":`form-data; name="${o}"`}),body:RC(c,"utf-8")});else{if(c==null||typeof c!="object")throw new Error(`Unexpected value for key ${o}: ${c}. Value should be serialized to string first.`);{let l=c.name||"blob",u=IS();u.set("Content-Disposition",`form-data; name="${o}"; filename="${l}"`),u.set("Content-Type",c.type||"application/octet-stream"),n.push({headers:u,body:c})}}e.multipartBody={parts:n}}a(tMo,"prepareFormData");p();var Tln=fe(yFt(),1),Iln=fe(EFt(),1);var YMo="HTTPS_PROXY",KMo="HTTP_PROXY",JMo="ALL_PROXY",ZMo="NO_PROXY",_Ft="proxyPolicy",Cln=[],xln=!1,XMo=new Map;function h$e(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(h$e,"getEnvironmentValue");function eOo(){if(!process)return;let t=h$e(YMo),e=h$e(JMo),r=h$e(KMo);return t||e||r}a(eOo,"loadEnvironmentProxyValue");function tOo(t,e,r){if(e.length===0)return!1;let n=new URL(t).hostname;if(r?.has(n))return r.get(n);let o=!1;for(let s of e)s[0]==="."?(n.endsWith(s)||n.length===s.length-1&&n===s.slice(1))&&(o=!0):n===s&&(o=!0);return r?.set(n,o),o}a(tOo,"isBypassed");function rOo(){let t=h$e(ZMo);return xln=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(rOo,"loadNoProxy");function nOo(){let t=eOo();return t?new URL(t):void 0}a(nOo,"getDefaultProxySettingsInternal");function bln(t){let e;try{e=new URL(t.host)}catch{throw new Error(`Expecting a valid host string in proxy settings, but found "${t.host}".`)}return e.port=String(t.port),t.username&&(e.username=t.username),t.password&&(e.password=t.password),e}a(bln,"getUrlFromProxySettings");function Sln(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&Bx.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");let s=t.headers.toJSON();o?(e.httpProxyAgent||(e.httpProxyAgent=new Iln.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new Tln.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(Sln,"setProxyAgentOnRequest");function m$e(t,e){xln||Cln.push(...rOo());let r=t?bln(t):nOo(),n={};return{name:_Ft,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!tOo(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:Cln,e?.customNoProxyList?void 0:XMo)?Sln(o,n,r):o.proxySettings&&Sln(o,n,bln(o.proxySettings)),s(o)}}}a(m$e,"proxyPolicy");p();var vFt="agentPolicy";function g$e(t){return{name:vFt,sendRequest:a(async(e,r)=>(e.agent||(e.agent=t),r(e)),"sendRequest")}}a(g$e,"agentPolicy");p();var CFt="tlsPolicy";function A$e(t){return{name:CFt,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(A$e,"tlsPolicy");p();p();function y$e(t){return typeof t.stream=="function"}a(y$e,"isBlob");p();v3();var b$e=require("stream");function Xln(){return HTe(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield RS(e.read());if(r)return yield RS(void 0);yield yield RS(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(Xln,"streamAsyncIterator");function aOo(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=Xln.bind(t)),t.values||(t.values=Xln.bind(t))}a(aOo,"makeAsyncIterable");function eun(t){return t instanceof ReadableStream?(aOo(t),b$e.Readable.fromWeb(t)):t}a(eun,"ensureNodeStream");function cOo(t){return t instanceof Uint8Array?b$e.Readable.from(Buffer.from(t)):y$e(t)?eun(t.stream()):eun(t)}a(cOo,"toStream");async function tun(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(cOo);return b$e.Readable.from((function(){return HTe(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,C$e(d)),u;u=yield RS(l.next()),r=u.done,!r;c=!0)s=u.value,c=!1,yield yield RS(s)}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield RS(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(tun,"concat");function lOo(){return`----AzSDKFormBoundary${Yce()}`}a(lOo,"generateBoundary");function uOo(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r +`;return e}a(uOo,"encodeHeaders");function dOo(t){return t instanceof Uint8Array?t.byteLength:y$e(t)?t.size===-1?void 0:t.size:void 0}a(dOo,"getLength");function fOo(t){let e=0;for(let r of t){let n=dOo(r);if(n===void 0)return;e+=n}return e}a(fOo,"getTotalLength");async function pOo(t,e,r){let n=[RC(`--${r}`,"utf-8"),...e.flatMap(s=>[RC(`\r +`,"utf-8"),RC(uOo(s.headers),"utf-8"),RC(`\r +`,"utf-8"),s.body,RC(`\r +--${r}`,"utf-8")]),RC(`--\r \r -`,"utf-8")],o=iNo(n);o&&t.headers.set("Content-Length",o),t.body=await Ycn(n)}a(oNo,"buildRequestBody");var STe="multipartPolicy",sNo=70,aNo=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function cNo(t){if(t.length>sNo)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!aNo.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(cNo,"assertValidBoundary");function ZGe(){return{name:STe,async sendRequest(t,e){var r;if(!t.multipartBody)return e(t);if(t.body)throw new Error("multipartBody and regular body cannot be set at the same time");let n=t.multipartBody.boundary,o=(r=t.headers.get("Content-Type"))!==null&&r!==void 0?r:"multipart/mixed",s=o.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!s)throw new Error(`Got multipart request body, but content-type header was not multipart: ${o}`);let[,c,l]=s;if(l&&n&&l!==n)throw new Error(`Multipart boundary was specified as ${l} in the header, but got ${n} in the request body`);return n??(n=l),n?cNo(n):n=tNo(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await oNo(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(ZGe,"multipartPolicy");p();p();p();p();p();p();p();p();p();p();p();p();function XGe(){return SGe()}a(XGe,"createEmptyPipeline");p();p();p();var YM=Q7("core-rest-pipeline");p();p();p();p();function rFt(t={}){return RGe(Object.assign({logger:YM.info},t))}a(rFt,"logPolicy");p();function nFt(t={}){return kGe(t)}a(nFt,"redirectPolicy");p();p();p();var Yce=de(require("node:os"),1),e$e=de(require("node:process"),1);function Kcn(){return"User-Agent"}a(Kcn,"getHeaderName");async function Jcn(t){if(e$e&&e$e.versions){let e=e$e.versions;e.bun?t.set("Bun",e.bun):e.deno?t.set("Deno",e.deno):e.node&&t.set("Node",e.node)}t.set("OS",`(${Yce.arch()}-${Yce.type()}-${Yce.release()})`)}a(Jcn,"setPlatformSpecificData");p();var t$e="1.22.0";function ANo(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(ANo,"getUserAgentString");function Zcn(){return Kcn()}a(Zcn,"getUserAgentHeaderName");async function r$e(t){let e=new Map;e.set("core-rest-pipeline",t$e),await Jcn(e);let r=ANo(e);return t?`${t} ${r}`:r}a(r$e,"getUserAgentValue");var Xcn=Zcn(),eln="userAgentPolicy";function iFt(t={}){let e=r$e(t.userAgentPrefix);return{name:eln,async sendRequest(r,n){return r.headers.has(Xcn)||r.headers.set(Xcn,await e),n(r)}}}a(iFt,"userAgentPolicy");p();p();var tln=Symbol("rawContent");function oFt(t){return typeof t[tln]=="function"}a(oFt,"hasRawContent");function rln(t){return oFt(t)?t[tln]():t}a(rln,"getRawContent");var n$e=STe;function sFt(){let t=ZGe();return{name:n$e,sendRequest:a(async(e,r)=>{if(e.multipartBody)for(let n of e.multipartBody.parts)oFt(n.body)&&(n.body=rln(n.body));return t.sendRequest(e,r)},"sendRequest")}}a(sFt,"multipartPolicy");p();function aFt(){return PGe()}a(aFt,"decompressResponsePolicy");p();function cFt(t={}){return NGe(t)}a(cFt,"defaultRetryPolicy");p();function lFt(){return MGe()}a(lFt,"formDataPolicy");p();function uFt(t,e){return HGe(t,e)}a(uFt,"proxyPolicy");p();var nln="setClientRequestIdPolicy";function dFt(t="x-ms-client-request-id"){return{name:nln,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(dFt,"setClientRequestIdPolicy");p();function fFt(t){return GGe(t)}a(fFt,"agentPolicy");p();function pFt(t){return $Ge(t)}a(pFt,"tlsPolicy");p();p();var Kce=TA;function TTe(t){return TGe(t)}a(TTe,"isRestError");var iln="tracingPolicy";function hFt(t={}){let e=r$e(t.userAgentPrefix),r=new yP({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=yNo();return{name:iln,async sendRequest(o,s){var c;if(!n)return s(o);let l=await e,u={"http.url":r.sanitizeUrl(o.url),"http.method":o.method,"http.user_agent":l,requestId:o.requestId};l&&(u["http.user_agent"]=l);let{span:d,tracingContext:f}=(c=ENo(n,o,u))!==null&&c!==void 0?c:{};if(!d||!f)return s(o);try{let h=await n.withContext(f,s,o);return vNo(d,h),h}catch(h){throw _No(d,h),h}}}}a(hFt,"tracingPolicy");function yNo(){try{return dSe({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:t$e})}catch(t){YM.warning(`Error when creating the TracingClient: ${jce(t)}`);return}}a(yNo,"tryCreateTracingClient");function ENo(t,e,r){try{let{span:n,updatedOptions:o}=t.startSpan(`HTTP ${e.method}`,{tracingOptions:e.tracingOptions},{spanKind:"client",spanAttributes:r});if(!n.isRecording()){n.end();return}let s=t.createRequestHeaders(o.tracingOptions.tracingContext);for(let[c,l]of Object.entries(s))e.headers.set(c,l);return{span:n,tracingContext:o.tracingOptions.tracingContext}}catch(n){YM.warning(`Skipping creating a tracing span due to an error: ${jce(n)}`);return}}a(ENo,"tryCreateSpan");function _No(t,e){try{t.setStatus({status:"error",error:gGe(e)?e:void 0}),TTe(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){YM.warning(`Skipping tracing span processing due to an error: ${jce(r)}`)}}a(_No,"tryProcessError");function vNo(t,e){try{t.setAttribute("http.status_code",e.status);let r=e.headers.get("x-ms-request-id");r&&t.setAttribute("serviceRequestId",r),e.status>=400&&t.setStatus({status:"error"}),t.end()}catch(r){YM.warning(`Skipping tracing span processing due to an error: ${jce(r)}`)}}a(vNo,"tryProcessResponse");p();p();function i$e(t){if(t instanceof AbortSignal)return{abortSignal:t};if(t.aborted)return{abortSignal:AbortSignal.abort(t.reason)};let e=new AbortController,r=!0;function n(){r&&(t.removeEventListener("abort",o),r=!1)}a(n,"cleanup");function o(){e.abort(t.reason),n()}return a(o,"listener"),t.addEventListener("abort",o),{abortSignal:e.signal,cleanup:n}}a(i$e,"wrapAbortSignalLike");var CNo="wrapAbortSignalLikePolicy";function oln(){return{name:CNo,sendRequest:a(async(t,e)=>{if(!t.abortSignal)return e(t);let{abortSignal:r,cleanup:n}=i$e(t.abortSignal);t.abortSignal=r;try{return await e(t)}finally{n?.()}},"sendRequest")}}a(oln,"wrapAbortSignalLikePolicy");function mFt(t){var e;let r=XGe();return Hce&&(t.agent&&r.addPolicy(fFt(t.agent)),t.tlsOptions&&r.addPolicy(pFt(t.tlsOptions)),r.addPolicy(uFt(t.proxyOptions)),r.addPolicy(aFt())),r.addPolicy(oln()),r.addPolicy(lFt(),{beforePolicies:[n$e]}),r.addPolicy(iFt(t.userAgentOptions)),r.addPolicy(dFt((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy(sFt(),{afterPhase:"Deserialize"}),r.addPolicy(cFt(t.retryOptions),{phase:"Retry"}),r.addPolicy(hFt(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),Hce&&r.addPolicy(nFt(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy(rFt(t.loggingOptions),{afterPhase:"Sign"}),r}a(mFt,"createPipelineFromOptions");p();function gFt(){let t=wGe();return{async sendRequest(e){let{abortSignal:r,cleanup:n}=e.abortSignal?i$e(e.abortSignal):{};try{return e.abortSignal=r,await t.sendRequest(e)}finally{n?.()}}}}a(gFt,"createDefaultHttpClient");p();function oQ(t){return vS(t)}a(oQ,"createHttpHeaders");p();function _P(t){return bGe(t)}a(_P,"createPipelineRequest");p();p();p();p();var SNo=Q7("core-rest-pipeline retryPolicy");function AFt(t,e={maxRetries:3}){return rQ(t,Object.assign({logger:SNo},e))}a(AFt,"retryPolicy");p();p();var TNo={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function INo(t,e,r){async function n(){if(Date.now()t.getToken(u,d),"tryGetAccessToken"),s.retryIntervalInMs,(f=n?.expiresOnTimestamp)!==null&&f!==void 0?f:Date.now()).then(m=>(r=null,n=m,o=d.tenantId,n)).catch(m=>{throw r=null,n=null,o=void 0,m})),r}return a(l,"refresh"),async(u,d)=>{let f=!!d.claims,h=o!==d.tenantId;return f&&(n=null),h||f||c.mustRefresh?l(u,d):(c.shouldRefresh&&l(u,d),n)}}a(yFt,"createTokenCycler");var lln="bearerTokenAuthenticationPolicy";async function o$e(t,e){try{return[await e(t),void 0]}catch(r){if(TTe(r)&&r.response)return[r.response,r];throw r}}a(o$e,"trySendRequest");async function xNo(t){let{scopes:e,getAccessToken:r,request:n}=t,o={abortSignal:n.abortSignal,tracingOptions:n.tracingOptions,enableCae:!0},s=await r(e,o);s&&t.request.headers.set("Authorization",`Bearer ${s.token}`)}a(xNo,"defaultAuthorizeRequest");function sln(t){return t.status===401&&t.headers.has("WWW-Authenticate")}a(sln,"isChallengeResponse");async function aln(t,e){var r;let{scopes:n}=t,o=await t.getAccessToken(n,{enableCae:!0,claims:e});return o?(t.request.headers.set("Authorization",`${(r=o.tokenType)!==null&&r!==void 0?r:"Bearer"} ${o.token}`),!0):!1}a(aln,"authorizeRequestOnCaeChallenge");function s$e(t){var e,r,n;let{credential:o,scopes:s,challengeCallbacks:c}=t,l=t.logger||YM,u={authorizeRequest:(r=(e=c?.authorizeRequest)===null||e===void 0?void 0:e.bind(c))!==null&&r!==void 0?r:xNo,authorizeRequestOnChallenge:(n=c?.authorizeRequestOnChallenge)===null||n===void 0?void 0:n.bind(c)},d=o?yFt(o):()=>Promise.resolve(null);return{name:lln,async sendRequest(f,h){if(!f.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");await u.authorizeRequest({scopes:Array.isArray(s)?s:[s],request:f,getAccessToken:d,logger:l});let m,g,A;if([m,g]=await o$e(f,h),sln(m)){let y=cln(m.headers.get("WWW-Authenticate"));if(y){let E;try{E=atob(y)}catch{return l.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${y}`),m}A=await aln({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await o$e(f,h))}else if(u.authorizeRequestOnChallenge&&(A=await u.authorizeRequestOnChallenge({scopes:Array.isArray(s)?s:[s],request:f,response:m,getAccessToken:d,logger:l}),A&&([m,g]=await o$e(f,h)),sln(m)&&(y=cln(m.headers.get("WWW-Authenticate")),y))){let E;try{E=atob(y)}catch{return l.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${y}`),m}A=await aln({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await o$e(f,h))}}if(g)throw g;return m}}}a(s$e,"bearerTokenAuthenticationPolicy");function wNo(t){let e=/(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g,r=/(\w+)="([^"]*)"/g,n=[],o;for(;(o=e.exec(t))!==null;){let s=o[1],c=o[2],l={},u;for(;(u=r.exec(c))!==null;)l[u[1]]=u[2];n.push({scheme:s,params:l})}return n}a(wNo,"parseChallenges");function cln(t){var e;return t?(e=wNo(t).find(n=>n.scheme==="Bearer"&&n.params.claims&&n.params.error==="insufficient_claims"))===null||e===void 0?void 0:e.params.claims:void 0}a(cln,"getCaeChallengeClaims");p();p();p();p();p();p();var dln=de(uln(),1),EFt=dln.state;function sQ(t,e,r){let n=e.parameterPath,o=e.mapper,s;if(typeof n=="string"&&(n=[n]),Array.isArray(n)){if(n.length>0)if(o.isConstant)s=o.defaultValue;else{let c=fln(t,n);!c.propertyFound&&r&&(c=fln(r,n));let l=!1;c.propertyFound||(l=o.required||n[0]==="options"&&n.length===2),s=l?o.defaultValue:c.propertyValue}}else{o.required&&(s={});for(let c in n){let l=o.type.modelProperties[c],u=n[c],d=sQ(t,{parameterPath:u,mapper:l},r);d!==void 0&&(s||(s={}),s[c]=d)}}return s}a(sQ,"getOperationArgumentValueFromParameter");function fln(t,e){let r={propertyFound:!1},n=0;for(;n=200&&r.status<300);u.headersMapper&&(s.parsedHeaders=l.serializer.deserialize(u.headersMapper,s.headers.toJSON(),"operationRes.parsedHeaders",{xml:{},ignoreUnknownProperties:!0}))}return s}a(MNo,"deserializeResponseBody");function ONo(t){let e=Object.keys(t.responses);return e.length===0||e.length===1&&e[0]==="default"}a(ONo,"isOperationSpecEmpty");function LNo(t,e,r,n){var o;let s=200<=t.status&&t.status<300;if(ONo(e)?s:!!r)if(r){if(!r.isError)return{error:null,shouldReturnResponse:!1}}else return{error:null,shouldReturnResponse:!1};let l=r??e.responses.default,u=!((o=t.request.streamResponseStatusCodes)===null||o===void 0)&&o.has(t.status)?`Unexpected status code: ${t.status}`:t.bodyAsText,d=new Kce(u,{statusCode:t.status,request:t.request,response:t});if(!l)throw d;let f=l.bodyMapper,h=l.headersMapper;try{if(t.parsedBody){let m=t.parsedBody,g;if(f){let y=m;if(e.isXML&&f.type.name===VM.Sequence){y=[];let E=f.xmlElementName;typeof m=="object"&&E&&(y=m[E])}g=e.serializer.deserialize(f,y,"error.response.parsedBody",n)}let A=m.error||g||m;d.code=A.code,A.message&&(d.message=A.message),f&&(d.response.parsedBody=g)}t.headers&&h&&(d.response.parsedHeaders=e.serializer.deserialize(h,t.headers.toJSON(),"operationRes.parsedHeaders"))}catch(m){d.message=`Error "${m.message}" occurred in deserializing the responseBody - "${t.bodyAsText}" for the default response.`}return{error:d,shouldReturnResponse:!1}}a(LNo,"handleErrorResponse");async function BNo(t,e,r,n,o){var s;if(!(!((s=r.request.streamResponseStatusCodes)===null||s===void 0)&&s.has(r.status))&&r.bodyAsText){let c=r.bodyAsText,l=r.headers.get("Content-Type")||"",u=l?l.split(";").map(d=>d.toLowerCase()):[];try{if(u.length===0||u.some(d=>t.indexOf(d)!==-1))return r.parsedBody=JSON.parse(c),r;if(u.some(d=>e.indexOf(d)!==-1)){if(!o)throw new Error("Parsing XML not supported.");let d=await o(c,n.xml);return r.parsedBody=d,r}}catch(d){let f=`Error "${d}" occurred while parsing the response body - ${r.bodyAsText}.`,h=d.code||Kce.PARSE_ERROR;throw new Kce(f,{code:h,statusCode:r.status,request:r.request,response:r})}}return r}a(BNo,"parse");p();p();function mln(t){let e=new Set;for(let r in t.responses){let n=t.responses[r];n.bodyMapper&&n.bodyMapper.type.name===VM.Stream&&e.add(Number(r))}return e}a(mln,"getStreamingResponseStatusCodes");function KM(t){let{parameterPath:e,mapper:r}=t,n;return typeof e=="string"?n=e:Array.isArray(e)?n=e.join("."):n=r.serializedName,n}a(KM,"getPathStringFromParameter");var gln="serializationPolicy";function vFt(t={}){let e=t.stringifyXML;return{name:gln,async sendRequest(r,n){let o=g3(r),s=o?.operationSpec,c=o?.operationArguments;return s&&c&&(FNo(r,c,s),UNo(r,c,s,e)),n(r)}}}a(vFt,"serializationPolicy");function FNo(t,e,r){var n,o;if(r.headerParameters)for(let c of r.headerParameters){let l=sQ(e,c);if(l!=null||c.mapper.required){l=r.serializer.serialize(c.mapper,l,KM(c));let u=c.mapper.headerCollectionPrefix;if(u)for(let d of Object.keys(l))t.headers.set(u+d,l[d]);else t.headers.set(c.mapper.serializedName||KM(c),l)}}let s=(o=(n=e.options)===null||n===void 0?void 0:n.requestOptions)===null||o===void 0?void 0:o.customHeaders;if(s)for(let c of Object.keys(s))t.headers.set(c,s[c])}a(FNo,"serializeHeaders");function UNo(t,e,r,n=function(){throw new Error("XML serialization unsupported!")}){var o,s,c,l,u;let d=(o=e.options)===null||o===void 0?void 0:o.serializerOptions,f={xml:{rootName:(s=d?.xml.rootName)!==null&&s!==void 0?s:"",includeRoot:(c=d?.xml.includeRoot)!==null&&c!==void 0?c:!1,xmlCharKey:(l=d?.xml.xmlCharKey)!==null&&l!==void 0?l:"_"}},h=f.xml.xmlCharKey;if(r.requestBody&&r.requestBody.mapper){t.body=sQ(e,r.requestBody);let m=r.requestBody.mapper,{required:g,serializedName:A,xmlName:y,xmlElementName:E,xmlNamespace:_,xmlNamespacePrefix:v,nullable:b}=m,T=m.type.name;try{if(t.body!==void 0&&t.body!==null||b&&t.body===null||g){let w=KM(r.requestBody);t.body=r.serializer.serialize(m,t.body,w,f);let R=T===VM.Stream;if(r.isXML){let x=v?`xmlns:${v}`:"xmlns",P=QNo(_,x,T,t.body,f);T===VM.Sequence?t.body=n(qNo(P,E||y||A,x,_),{rootName:y||A,xmlCharKey:h}):R||(t.body=n(P,{rootName:y||A,xmlCharKey:h}))}else{if(T===VM.String&&(!((u=r.contentType)===null||u===void 0)&&u.match("text/plain")||r.mediaType==="text"))return;R||(t.body=JSON.stringify(t.body))}}}catch(w){throw new Error(`Error "${w.message}" occurred in serializing the payload - ${JSON.stringify(A,void 0," ")}.`)}}else if(r.formDataParameters&&r.formDataParameters.length>0){t.formData={};for(let m of r.formDataParameters){let g=sQ(e,m);if(g!=null){let A=m.mapper.serializedName||KM(m);t.formData[A]=r.serializer.serialize(m.mapper,g,KM(m),f)}}}}a(UNo,"serializeRequestBody");function QNo(t,e,r,n,o){if(t&&!["Composite","Sequence","Dictionary"].includes(r)){let s={};return s[o.xml.xmlCharKey]=n,s["$"]={[e]:t},s}return n}a(QNo,"getXmlValueWithNamespace");function qNo(t,e,r,n){if(Array.isArray(t)||(t=[t]),!r||!n)return{[e]:t};let o={[e]:t};return o["$"]={[r]:n},o}a(qNo,"prepareXMLRootList");function CFt(t={}){let e=mFt(t??{});return t.credentialOptions&&e.addPolicy(s$e({credential:t.credentialOptions.credential,scopes:t.credentialOptions.credentialScopes})),e.addPolicy(vFt(t.serializationOptions),{phase:"Serialize"}),e.addPolicy(_Ft(t.deserializationOptions),{phase:"Deserialize"}),e}a(CFt,"createClientPipeline");p();var bFt;function Aln(){return bFt||(bFt=gFt()),bFt}a(Aln,"getCachedDefaultHttpClient");p();var jNo={CSV:",",SSV:" ",Multi:"Multi",TSV:" ",Pipes:"|"};function Eln(t,e,r,n){let o=HNo(e,r,n),s=!1,c=yln(t,o);if(e.path){let d=yln(e.path,o);e.path==="/{nextLink}"&&d.startsWith("/")&&(d=d.substring(1)),GNo(d)?(c=d,s=!0):c=$No(c,d)}let{queryParams:l,sequenceParams:u}=VNo(e,r,n);return c=zNo(c,l,u,s),c}a(Eln,"getRequestUrl");function yln(t,e){let r=t;for(let[n,o]of e)r=r.split(n).join(o);return r}a(yln,"replaceAll");function HNo(t,e,r){var n;let o=new Map;if(!((n=t.urlParameters)===null||n===void 0)&&n.length)for(let s of t.urlParameters){let c=sQ(e,s,r),l=KM(s);c=t.serializer.serialize(s.mapper,c,l),s.skipEncoding||(c=encodeURIComponent(c)),o.set(`{${s.mapper.serializedName||l}}`,c)}return o}a(HNo,"calculateUrlReplacements");function GNo(t){return t.includes("://")}a(GNo,"isAbsoluteUrl");function $No(t,e){if(!e)return t;let r=new URL(t),n=r.pathname;n.endsWith("/")||(n=`${n}/`),e.startsWith("/")&&(e=e.substring(1));let o=e.indexOf("?");if(o!==-1){let s=e.substring(0,o),c=e.substring(o+1);n=n+s,c&&(r.search=r.search?`${r.search}&${c}`:c)}else n=n+e;return r.pathname=n,r.toString()}a($No,"appendPath");function VNo(t,e,r){var n;let o=new Map,s=new Set;if(!((n=t.queryParameters)===null||n===void 0)&&n.length)for(let c of t.queryParameters){c.mapper.type.name==="Sequence"&&c.mapper.serializedName&&s.add(c.mapper.serializedName);let l=sQ(e,c,r);if(l!=null||c.mapper.required){l=t.serializer.serialize(c.mapper,l,KM(c));let u=c.collectionFormat?jNo[c.collectionFormat]:"";if(Array.isArray(l)&&(l=l.map(d=>d??"")),c.collectionFormat==="Multi"&&l.length===0)continue;Array.isArray(l)&&(c.collectionFormat==="SSV"||c.collectionFormat==="TSV")&&(l=l.join(u)),c.skipEncoding||(Array.isArray(l)?l=l.map(d=>encodeURIComponent(d)):l=encodeURIComponent(l)),Array.isArray(l)&&(c.collectionFormat==="CSV"||c.collectionFormat==="Pipes")&&(l=l.join(u)),o.set(c.mapper.serializedName||KM(c),l)}}return{queryParams:o,sequenceParams:s}}a(VNo,"calculateQueryParameters");function WNo(t){let e=new Map;if(!t||t[0]!=="?")return e;t=t.slice(1);let r=t.split("&");for(let n of r){let[o,s]=n.split("=",2),c=e.get(o);c?Array.isArray(c)?c.push(s):e.set(o,[c,s]):e.set(o,s)}return e}a(WNo,"simpleParseQueryParams");function zNo(t,e,r,n=!1){if(e.size===0)return t;let o=new URL(t),s=WNo(o.search);for(let[l,u]of e){let d=s.get(l);if(Array.isArray(d))if(Array.isArray(u)){d.push(...u);let f=new Set(d);s.set(l,Array.from(f))}else d.push(u);else d?(Array.isArray(u)?u.unshift(d):r.has(l)&&s.set(l,[d,u]),n||s.set(l,u)):s.set(l,u)}let c=[];for(let[l,u]of s)if(typeof u=="string")c.push(`${l}=${u}`);else if(Array.isArray(u))for(let d of u)c.push(`${l}=${d}`);else c.push(`${l}=${u}`);return o.search=c.length?`?${c.join("&")}`:"",o.toString()}a(zNo,"appendQueryParams");p();var SFt=Q7("core-client");var ITe=class{static{a(this,"ServiceClient")}constructor(e={}){var r,n;if(this._requestContentType=e.requestContentType,this._endpoint=(r=e.endpoint)!==null&&r!==void 0?r:e.baseUri,e.baseUri&&SFt.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||Aln(),this.pipeline=e.pipeline||YNo(e),!((n=e.additionalPolicies)===null||n===void 0)&&n.length)for(let{policy:o,position:s}of e.additionalPolicies){let c=s==="perRetry"?"Sign":void 0;this.pipeline.addPolicy(o,{afterPhase:c})}}async sendRequest(e){return this.pipeline.sendRequest(this._httpClient,e)}async sendOperationRequest(e,r){let n=r.baseUrl||this._endpoint;if(!n)throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a endpoint string property that contains the base URL to use.");let o=Eln(n,r,e,this),s=_P({url:o});s.method=r.httpMethod;let c=g3(s);c.operationSpec=r,c.operationArguments=e;let l=r.contentType||this._requestContentType;l&&r.requestBody&&s.headers.set("Content-Type",l);let u=e.options;if(u){let d=u.requestOptions;d&&(d.timeout&&(s.timeout=d.timeout),d.onUploadProgress&&(s.onUploadProgress=d.onUploadProgress),d.onDownloadProgress&&(s.onDownloadProgress=d.onDownloadProgress),d.shouldDeserialize!==void 0&&(c.shouldDeserialize=d.shouldDeserialize),d.allowInsecureConnection&&(s.allowInsecureConnection=!0)),u.abortSignal&&(s.abortSignal=u.abortSignal),u.tracingOptions&&(s.tracingOptions=u.tracingOptions)}this._allowInsecureConnection&&(s.allowInsecureConnection=!0),s.streamResponseStatusCodes===void 0&&(s.streamResponseStatusCodes=mln(r));try{let d=await this.sendRequest(s),f=b3t(d,r.responses[d.status]);return u?.onResponse&&u.onResponse(d,f),f}catch(d){if(typeof d=="object"&&d?.response){let f=d.response,h=b3t(f,r.responses[d.statusCode]||r.responses.default);d.details=h,u?.onResponse&&u.onResponse(f,h,d)}throw d}}};function YNo(t){let e=KNo(t),r=t.credential&&e?{credentialScopes:e,credential:t.credential}:void 0;return CFt(Object.assign(Object.assign({},t),{credentialOptions:r}))}a(YNo,"createDefaultPipeline");function KNo(t){if(t.credentialScopes)return t.credentialScopes;if(t.endpoint)return`${t.endpoint}/.default`;if(t.baseUri)return`${t.baseUri}/.default`;if(t.credential&&!t.credentialScopes)throw new Error("When using credentials, the ServiceClientOptions must contain either a endpoint or a credentialScopes. Unable to create a bearerTokenAuthenticationPolicy")}a(KNo,"getCredentialScopes");p();p();p();function _ln(t){return t==="adfs"?"oauth2/token":"oauth2/v2.0/token"}a(_ln,"getIdentityTokenEndpointSuffix");p();var vln="/.default",Cln="Specifying a `clientId` or `resourceId` is not supported by the Service Fabric managed identity environment. The managed identity configuration is determined by the Service Fabric cluster resource configuration. See https://aka.ms/servicefabricmi for more information";function xTe(t){let e="";if(Array.isArray(t)){if(t.length!==1)return;e=t[0]}else typeof t=="string"&&(e=t);return e.endsWith(vln)?e.substr(0,e.lastIndexOf(vln)):e}a(xTe,"mapScopesToResource");function bln(t){if(typeof t.expires_on=="number")return t.expires_on*1e3;if(typeof t.expires_on=="string"){let e=+t.expires_on;if(!isNaN(e))return e*1e3;let r=Date.parse(t.expires_on);if(!isNaN(r))return r}if(typeof t.expires_in=="number")return Date.now()+t.expires_in*1e3;throw new Error(`Failed to parse token expiration from body. expires_in="${t.expires_in}", expires_on="${t.expires_on}"`)}a(bln,"parseExpirationTimestamp");function Sln(t){if(t.refresh_on){if(typeof t.refresh_on=="number")return t.refresh_on*1e3;if(typeof t.refresh_on=="string"){let e=+t.refresh_on;if(!isNaN(e))return e*1e3;let r=Date.parse(t.refresh_on);if(!isNaN(r))return r}throw new Error(`Failed to parse refresh_on from body. refresh_on="${t.refresh_on}"`)}else return}a(Sln,"parseRefreshTimestamp");var wTe="noCorrelationId";function JNo(t){let e=t?.authorityHost;return AGe&&(e=e??process.env.AZURE_AUTHORITY_HOST),e??cSe}a(JNo,"getIdentityClientAuthorityHost");var aQ=class extends ITe{static{a(this,"IdentityClient")}authorityHost;allowLoggingAccountIdentifiers;abortControllers;allowInsecureConnection=!1;tokenCredentialOptions;constructor(e){let r=`azsdk-js-identity/${vje}`,n=e?.userAgentOptions?.userAgentPrefix?`${e.userAgentOptions.userAgentPrefix} ${r}`:`${r}`,o=JNo(e);if(!o.startsWith("https:"))throw new Error("The authorityHost address must use the 'https' protocol.");super({requestContentType:"application/json; charset=utf-8",retryOptions:{maxRetries:3},...e,userAgentOptions:{userAgentPrefix:n},baseUri:o}),this.authorityHost=o,this.abortControllers=new Map,this.allowLoggingAccountIdentifiers=e?.loggingOptions?.allowLoggingAccountIdentifiers,this.tokenCredentialOptions={...e},e?.allowInsecureConnection&&(this.allowInsecureConnection=e.allowInsecureConnection)}async sendTokenRequest(e){hS.info(`IdentityClient: sending token request to [${e.url}]`);let r=await this.sendRequest(e);if(r.bodyAsText&&(r.status===200||r.status===201)){let n=JSON.parse(r.bodyAsText);if(!n.access_token)return null;this.logIdentifiers(r);let o={accessToken:{token:n.access_token,expiresOnTimestamp:bln(n),refreshAfterTimestamp:Sln(n),tokenType:"Bearer"},refreshToken:n.refresh_token};return hS.info(`IdentityClient: [${e.url}] token acquired, expires on ${o.accessToken.expiresOnTimestamp}`),o}else{let n=new U7(r.status,r.bodyAsText);throw hS.warning(`IdentityClient: authentication error. HTTP status: ${r.status}, ${n.errorResponse.errorDescription}`),n}}async refreshAccessToken(e,r,n,o,s,c={}){if(o===void 0)return null;hS.info(`IdentityClient: refreshing access token with client ID: ${r}, scopes: ${n} started`);let l={grant_type:"refresh_token",client_id:r,refresh_token:o,scope:n};s!==void 0&&(l.client_secret=s);let u=new URLSearchParams(l);return Mc.withSpan("IdentityClient.refreshAccessToken",c,async d=>{try{let f=_ln(e),h=_P({url:`${this.authorityHost}/${e}/${f}`,method:"POST",body:u.toString(),abortSignal:c.abortSignal,headers:oQ({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"}),tracingOptions:d.tracingOptions}),m=await this.sendTokenRequest(h);return hS.info(`IdentityClient: refreshed token for client ID: ${r}`),m}catch(f){if(f.name===bje&&f.errorResponse.error==="interaction_required")return hS.info(`IdentityClient: interaction required for client ID: ${r}`),null;throw hS.warning(`IdentityClient: failed refreshing token for client ID: ${r}: ${f}`),f}})}generateAbortSignal(e){let r=new AbortController,n=this.abortControllers.get(e)||[];n.push(r),this.abortControllers.set(e,n);let o=r.signal.onabort;return r.signal.onabort=(...s)=>{this.abortControllers.set(e,void 0),o&&o.apply(r.signal,s)},r.signal}abortRequests(e){let r=e||wTe,n=[...this.abortControllers.get(r)||[],...this.abortControllers.get(wTe)||[]];if(n.length){for(let o of n)o.abort();this.abortControllers.set(r,void 0)}}getCorrelationId(e){let r=e?.body?.split("&").map(n=>n.split("=")).find(([n])=>n==="client-request-id");return r&&r.length&&r[1]||wTe}async sendGetRequestAsync(e,r){let n=_P({url:e,method:"GET",body:r?.body,allowInsecureConnection:this.allowInsecureConnection,headers:oQ(r?.headers),abortSignal:this.generateAbortSignal(wTe)}),o=await this.sendRequest(n);return this.logIdentifiers(o),{body:o.bodyAsText?JSON.parse(o.bodyAsText):void 0,headers:o.headers.toJSON(),status:o.status}}async sendPostRequestAsync(e,r){let n=_P({url:e,method:"POST",body:r?.body,headers:oQ(r?.headers),allowInsecureConnection:this.allowInsecureConnection,abortSignal:this.generateAbortSignal(this.getCorrelationId(r))}),o=await this.sendRequest(n);return this.logIdentifiers(o),{body:o.bodyAsText?JSON.parse(o.bodyAsText):void 0,headers:o.headers.toJSON(),status:o.status}}getTokenCredentialOptions(){return this.tokenCredentialOptions}logIdentifiers(e){if(!this.allowLoggingAccountIdentifiers||!e.bodyAsText)return;let r="No User Principal Name available";try{let o=(e.parsedBody||JSON.parse(e.bodyAsText)).access_token;if(!o)return;let s=o.split(".")[1],{appid:c,upn:l,tid:u,oid:d}=JSON.parse(Buffer.from(s,"base64").toString("utf8"));hS.info(`[Authenticated account] Client ID: ${c}. Tenant ID: ${u}. User Principal Name: ${l||r}. Object ID (user): ${d}`)}catch(n){hS.warning("allowLoggingAccountIdentifiers was set, but we couldn't log the account information. Error:",n.message)}}};p();var TFt;(function(t){t.AutoDiscoverRegion="AutoDiscoverRegion",t.USWest="westus",t.USWest2="westus2",t.USCentral="centralus",t.USEast="eastus",t.USEast2="eastus2",t.USNorthCentral="northcentralus",t.USSouthCentral="southcentralus",t.USWestCentral="westcentralus",t.CanadaCentral="canadacentral",t.CanadaEast="canadaeast",t.BrazilSouth="brazilsouth",t.EuropeNorth="northeurope",t.EuropeWest="westeurope",t.UKSouth="uksouth",t.UKWest="ukwest",t.FranceCentral="francecentral",t.FranceSouth="francesouth",t.SwitzerlandNorth="switzerlandnorth",t.SwitzerlandWest="switzerlandwest",t.GermanyNorth="germanynorth",t.GermanyWestCentral="germanywestcentral",t.NorwayWest="norwaywest",t.NorwayEast="norwayeast",t.AsiaEast="eastasia",t.AsiaSouthEast="southeastasia",t.JapanEast="japaneast",t.JapanWest="japanwest",t.AustraliaEast="australiaeast",t.AustraliaSouthEast="australiasoutheast",t.AustraliaCentral="australiacentral",t.AustraliaCentral2="australiacentral2",t.IndiaCentral="centralindia",t.IndiaSouth="southindia",t.IndiaWest="westindia",t.KoreaSouth="koreasouth",t.KoreaCentral="koreacentral",t.UAECentral="uaecentral",t.UAENorth="uaenorth",t.SouthAfricaNorth="southafricanorth",t.SouthAfricaWest="southafricawest",t.ChinaNorth="chinanorth",t.ChinaEast="chinaeast",t.ChinaNorth2="chinanorth2",t.ChinaEast2="chinaeast2",t.GermanyCentral="germanycentral",t.GermanyNorthEast="germanynortheast",t.GovernmentUSVirginia="usgovvirginia",t.GovernmentUSIowa="usgoviowa",t.GovernmentUSArizona="usgovarizona",t.GovernmentUSTexas="usgovtexas",t.GovernmentUSDodEast="usdodeast",t.GovernmentUSDodCentral="usdodcentral"})(TFt||(TFt={}));function c$e(t){let e=t;return e===void 0&&globalThis.process?.env?.AZURE_REGIONAL_AUTHORITY_NAME!==void 0&&(e=process.env.AZURE_REGIONAL_AUTHORITY_NAME),e===TFt.AutoDiscoverRegion?"AUTO_DISCOVER":e}a(c$e,"calculateRegionalAuthority");p();p();function ZNo(t){return`The current credential is not configured to acquire tokens for tenant ${t}. To enable acquiring tokens for this tenant add it to the AdditionallyAllowedTenants on the credential options, or add "*" to AdditionallyAllowedTenants to allow acquiring tokens for any tenant.`}a(ZNo,"createConfigurationErrorMessage");function yf(t,e,r=[],n){let o;if(process.env.AZURE_IDENTITY_DISABLE_MULTITENANTAUTH||t==="adfs"?o=t:o=e?.tenantId??t,t&&o!==t&&!r.includes("*")&&!r.some(s=>s.localeCompare(o)===0)){let s=ZNo(o);throw n?.info(s),new Mn(s)}return o}a(yf,"processMultiTenantRequest");function sg(t,e){if(!e.match(/^[0-9a-zA-Z-.]+$/)){let r=new Error("Invalid tenant id provided. You can locate your tenant id by following the instructions listed here: https://learn.microsoft.com/partner-center/find-ids-and-domain-names.");throw t.info(Us("",r)),r}}a(sg,"checkTenantId");function Jce(t,e,r){return e?(sg(t,e),e):(r||(r=Xz),r!==Xz?"common":"organizations")}a(Jce,"resolveTenantId");function Jf(t){return!t||t.length===0?[]:t.includes("*")?Ltn:t}a(Jf,"resolveAdditionallyAllowedTenantIds");var O_=lo("MsalClient");function hMo(t,e,r={}){let n=Jce(r.logger??O_,e,t),o=v3t(n,_3t(r)),s=new aQ({...r.tokenCredentialOptions,authorityHost:o,loggingOptions:r.loggingOptions});return{auth:{clientId:t,authority:o,knownAuthorities:Ean(n,o,r.disableInstanceDiscovery)},system:{networkClient:s,loggerOptions:{loggerCallback:yGe(r.logger??O_),logLevel:EGe(wje()),piiLoggingEnabled:r.loggingOptions?.enableUnsafeSupportLogging}}}}a(hMo,"generateMsalConfiguration");function tE(t,e,r={}){let n={msalConfig:hMo(t,e,r),cachedAccount:r.authenticationRecord?_an(r.authenticationRecord):null,pluginConfiguration:Htn.generatePluginConfiguration(r),logger:r.logger??O_},o=new Map;async function s(x={}){let P=x.enableCae?"CAE":"default",D=o.get(P);if(D)return n.logger.getToken.info("Existing PublicClientApplication found in cache, returning it."),D;n.logger.getToken.info(`Creating new PublicClientApplication with CAE ${x.enableCae?"enabled":"disabled"}.`);let N=x.enableCae?n.pluginConfiguration.cache.cachePluginCae:n.pluginConfiguration.cache.cachePlugin;return n.msalConfig.auth.clientCapabilities=x.enableCae?["cp1"]:void 0,D=new Lce({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),o.set(P,D),D}a(s,"getPublicApp");let c=new Map;async function l(x={}){let P=x.enableCae?"CAE":"default",D=c.get(P);if(D)return n.logger.getToken.info("Existing ConfidentialClientApplication found in cache, returning it."),D;n.logger.getToken.info(`Creating new ConfidentialClientApplication with CAE ${x.enableCae?"enabled":"disabled"}.`);let N=x.enableCae?n.pluginConfiguration.cache.cachePluginCae:n.pluginConfiguration.cache.cachePlugin;return n.msalConfig.auth.clientCapabilities=x.enableCae?["cp1"]:void 0,D=new Fce({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),c.set(P,D),D}a(l,"getConfidentialApp");async function u(x,P,D={}){if(n.cachedAccount===null)throw n.logger.getToken.info("No cached account found in local state."),new bx({scopes:P});D.claims&&(n.cachedClaims=D.claims);let N={account:n.cachedAccount,scopes:P,claims:n.cachedClaims};n.pluginConfiguration.broker.isEnabled&&(N.extraQueryParameters||={},n.pluginConfiguration.broker.enableMsaPassthrough&&(N.extraQueryParameters.msal_request_type="consumer_passthrough")),D.proofOfPossessionOptions&&(N.shrNonce=D.proofOfPossessionOptions.nonce,N.authenticationScheme="pop",N.resourceRequestMethod=D.proofOfPossessionOptions.resourceRequestMethod,N.resourceRequestUri=D.proofOfPossessionOptions.resourceRequestUrl),n.logger.getToken.info("Attempting to acquire token silently");try{return await x.acquireTokenSilent(N)}catch(L){throw xY(P,L,D)}}a(u,"getTokenSilent");function d(x){return x?.tenantId?v3t(x.tenantId,_3t(r)):n.msalConfig.auth.authority}a(d,"calculateRequestAuthority");async function f(x,P,D,N){let L=null;try{L=await u(x,P,D)}catch(B){if(B.name!=="AuthenticationRequiredError")throw B;if(D.disableAutomaticAuthentication)throw new bx({scopes:P,getTokenOptions:D,message:"Automatic authentication has been disabled. You may call the authentication() method."})}if(L===null)try{L=await N()}catch(B){throw xY(P,B,D)}return IY(P,L,D),n.cachedAccount=L?.account??null,n.logger.getToken.info(e0(P)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}a(f,"withSilentAuthentication");async function h(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client secret"),n.msalConfig.auth.clientSecret=P;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:c$e(),claims:D?.claims});return IY(x,L,D),n.logger.getToken.info(e0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw xY(x,L,D)}}a(h,"getTokenByClientSecret");async function m(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client assertion"),n.msalConfig.auth.clientAssertion=P;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:c$e(),claims:D?.claims,clientAssertion:P});return IY(x,L,D),n.logger.getToken.info(e0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw xY(x,L,D)}}a(m,"getTokenByClientAssertion");async function g(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client certificate"),n.msalConfig.auth.clientCertificate=P;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:c$e(),claims:D?.claims});return IY(x,L,D),n.logger.getToken.info(e0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw xY(x,L,D)}}a(g,"getTokenByClientCertificate");async function A(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using device code");let N=await s(D);return f(N,x,D,()=>{let L={scopes:x,cancel:D?.abortSignal?.aborted??!1,deviceCodeCallback:P,authority:d(D),claims:D?.claims},B=N.acquireTokenByDeviceCode(L);return D.abortSignal&&D.abortSignal.addEventListener("abort",()=>{L.cancel=!0}),B})}a(A,"getTokenByDeviceCode");async function y(x,P,D,N={}){n.logger.getToken.info("Attempting to acquire token using username and password");let L=await s(N);return f(L,x,N,()=>{let B={scopes:x,username:P,password:D,authority:d(N),claims:N?.claims};return L.acquireTokenByUsernamePassword(B)})}a(y,"getTokenByUsernamePassword");function E(){if(n.cachedAccount)return van(t,n.cachedAccount)}a(E,"getActiveAccount");async function _(x,P,D,N,L={}){n.logger.getToken.info("Attempting to acquire token using authorization code");let B;return N?(n.msalConfig.auth.clientSecret=N,B=await l(L)):B=await s(L),f(B,x,L,()=>B.acquireTokenByCode({scopes:x,redirectUri:P,code:D,authority:d(L),claims:L?.claims}))}a(_,"getTokenByAuthorizationCode");async function v(x,P,D,N={}){O_.getToken.info("Attempting to acquire token on behalf of another user"),typeof D=="string"?(O_.getToken.info("Using client secret for on behalf of flow"),n.msalConfig.auth.clientSecret=D):typeof D=="function"?(O_.getToken.info("Using client assertion callback for on behalf of flow"),n.msalConfig.auth.clientAssertion=D):(O_.getToken.info("Using client certificate for on behalf of flow"),n.msalConfig.auth.clientCertificate=D);let L=await l(N);try{let B=await L.acquireTokenOnBehalfOf({scopes:x,authority:d(N),claims:N.claims,oboAssertion:P});return IY(x,B,N),O_.getToken.info(e0(x)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}catch(B){throw xY(x,B,N)}}a(v,"getTokenOnBehalfOf");function b(x,P){return{openBrowser:a(async D=>{await(await Promise.resolve().then(()=>(p$e(),Xln))).default(D,{newInstance:!0})},"openBrowser"),scopes:x,authority:d(P),claims:P?.claims,loginHint:P?.loginHint,errorTemplate:P?.browserCustomizationOptions?.errorMessage,successTemplate:P?.browserCustomizationOptions?.successMessage,prompt:P?.loginHint?"login":"select_account"}}a(b,"createBaseInteractiveRequest");async function T(x,P,D={}){O_.verbose("Authentication will resume through the broker");let N=await s(D),L=b(x,D);n.pluginConfiguration.broker.parentWindowHandle?L.windowHandle=Buffer.from(n.pluginConfiguration.broker.parentWindowHandle):O_.warning("Parent window handle is not specified for the broker. This may cause unexpected behavior. Please provide the parentWindowHandle."),n.pluginConfiguration.broker.enableMsaPassthrough&&((L.extraQueryParameters??={}).msal_request_type="consumer_passthrough"),P?(L.prompt="none",O_.verbose("Attempting broker authentication using the default broker account")):O_.verbose("Attempting broker authentication without the default broker account"),D.proofOfPossessionOptions&&(L.shrNonce=D.proofOfPossessionOptions.nonce,L.authenticationScheme="pop",L.resourceRequestMethod=D.proofOfPossessionOptions.resourceRequestMethod,L.resourceRequestUri=D.proofOfPossessionOptions.resourceRequestUrl);try{return await N.acquireTokenInteractive(L)}catch(B){if(O_.verbose(`Failed to authenticate through the broker: ${B.message}`),D.disableAutomaticAuthentication)throw new bx({scopes:x,getTokenOptions:D,message:"Cannot silently authenticate with default broker account."});if(P)return T(x,!1,D);throw B}}a(T,"getBrokeredTokenInternal");async function w(x,P,D={}){O_.getToken.info(`Attempting to acquire token using brokered authentication with useDefaultBrokerAccount: ${P}`);let N=await T(x,P,D);return IY(x,N,D),n.cachedAccount=N?.account??null,n.logger.getToken.info(e0(x)),{token:N.accessToken,expiresOnTimestamp:N.expiresOn.getTime(),refreshAfterTimestamp:N.refreshOn?.getTime(),tokenType:N.tokenType}}a(w,"getBrokeredToken");async function R(x,P={}){O_.getToken.info("Attempting to acquire token interactively");let D=await s(P);return f(D,x,P,async()=>{let N=b(x,P);return n.pluginConfiguration.broker.isEnabled?T(x,n.pluginConfiguration.broker.useDefaultBrokerAccount??!1,P):(P.proofOfPossessionOptions&&(N.shrNonce=P.proofOfPossessionOptions.nonce,N.authenticationScheme="pop",N.resourceRequestMethod=P.proofOfPossessionOptions.resourceRequestMethod,N.resourceRequestUri=P.proofOfPossessionOptions.resourceRequestUrl),D.acquireTokenInteractive(N))})}return a(R,"getTokenByInteractiveRequest"),{getActiveAccount:E,getBrokeredToken:w,getTokenByClientSecret:h,getTokenByClientAssertion:m,getTokenByClientCertificate:g,getTokenByDeviceCode:A,getTokenByUsernamePassword:y,getTokenByAuthorizationCode:_,getTokenOnBehalfOf:v,getTokenByInteractiveRequest:R}}a(tE,"createMsalClient");var NTe=require("node:crypto");var tun=require("node:fs/promises");var DTe="ClientCertificateCredential",eun=lo(DTe),MTe=class{static{a(this,"ClientCertificateCredential")}tenantId;additionallyAllowedTenantIds;certificateConfiguration;sendCertificateChain;msalClient;constructor(e,r,n,o={}){if(!e||!r)throw new Error(`${DTe}: tenantId and clientId are required parameters.`);this.tenantId=e,this.additionallyAllowedTenantIds=Jf(o?.additionallyAllowedTenants),this.sendCertificateChain=o.sendCertificateChain,this.certificateConfiguration={...typeof n=="string"?{certificatePath:n}:n};let s=this.certificateConfiguration.certificate,c=this.certificateConfiguration.certificatePath;if(!this.certificateConfiguration||!(s||c))throw new Error(`${DTe}: Provide either a PEM certificate in string form, or the path to that certificate in the filesystem. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);if(s&&c)throw new Error(`${DTe}: To avoid unexpected behaviors, providing both the contents of a PEM certificate and the path to a PEM certificate is forbidden. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);this.msalClient=tE(r,e,{...o,logger:eun,tokenCredentialOptions:o})}async getToken(e,r={}){return Mc.withSpan(`${DTe}.getToken`,r,async n=>{n.tenantId=yf(this.tenantId,n,this.additionallyAllowedTenantIds,eun);let o=Array.isArray(e)?e:[e],s=await this.buildClientCertificate();return this.msalClient.getTokenByClientCertificate(o,s,n)})}async buildClientCertificate(){let e=await mMo(this.certificateConfiguration,this.sendCertificateChain??!1),r;return this.certificateConfiguration.certificatePassword!==void 0?r=(0,NTe.createPrivateKey)({key:e.certificateContents,passphrase:this.certificateConfiguration.certificatePassword,format:"pem"}).export({format:"pem",type:"pkcs8"}).toString():r=e.certificateContents,{thumbprint:e.thumbprint,thumbprintSha256:e.thumbprintSha256,privateKey:r,x5c:e.x5c}}};async function mMo(t,e){let r=t.certificate,n=t.certificatePath,o=r||await(0,tun.readFile)(n,"utf8"),s=e?o:void 0,c=/(-+BEGIN CERTIFICATE-+)(\n\r?|\r\n?)([A-Za-z0-9+/\n\r]+=*)(\n\r?|\r\n?)(-+END CERTIFICATE-+)/g,l=[],u;do u=c.exec(o),u&&l.push(u[3]);while(u);if(l.length===0)throw new Error("The file at the specified path does not contain a PEM-encoded certificate.");let d=(0,NTe.createHash)("sha1").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase(),f=(0,NTe.createHash)("sha256").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase();return{certificateContents:o,thumbprintSha256:f,thumbprint:d,x5c:s}}a(mMo,"parseCertificate");p();p();function Mx(t){return Array.isArray(t)?t:[t]}a(Mx,"ensureScopes");function ele(t,e){if(!t.match(/^[0-9a-zA-Z-_.:/]+$/)){let r=new Error("Invalid scope was specified by the user or calling client");throw e.getToken.info(Us(t,r)),r}}a(ele,"ensureValidScopeForDevTimeCreds");function h$e(t){return t.replace(/\/.default$/,"")}a(h$e,"getScopeResource");var nun=lo("ClientSecretCredential"),OTe=class{static{a(this,"ClientSecretCredential")}tenantId;additionallyAllowedTenantIds;msalClient;clientSecret;constructor(e,r,n,o={}){if(!e)throw new Mn("ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!r)throw new Mn("ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!n)throw new Mn("ClientSecretCredential: clientSecret is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");this.clientSecret=n,this.tenantId=e,this.additionallyAllowedTenantIds=Jf(o?.additionallyAllowedTenants),this.msalClient=tE(r,e,{...o,logger:nun,tokenCredentialOptions:o})}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=yf(this.tenantId,n,this.additionallyAllowedTenantIds,nun);let o=Mx(e);return this.msalClient.getTokenByClientSecret(o,this.clientSecret,n)})}};p();var gMo=lo("UsernamePasswordCredential"),LTe=class{static{a(this,"UsernamePasswordCredential")}tenantId;additionallyAllowedTenantIds;msalClient;username;password;constructor(e,r,n,o,s={}){if(!e)throw new Mn("UsernamePasswordCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!r)throw new Mn("UsernamePasswordCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!n)throw new Mn("UsernamePasswordCredential: username is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!o)throw new Mn("UsernamePasswordCredential: password is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");this.tenantId=e,this.additionallyAllowedTenantIds=Jf(s?.additionallyAllowedTenants),this.username=n,this.password=o,this.msalClient=tE(r,this.tenantId,{...s,tokenCredentialOptions:s??{}})}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=yf(this.tenantId,n,this.additionallyAllowedTenantIds,gMo);let o=Mx(e);return this.msalClient.getTokenByUsernamePassword(o,this.username,this.password,n)})}};var AMo=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_CLIENT_SECRET","AZURE_CLIENT_CERTIFICATE_PATH","AZURE_CLIENT_CERTIFICATE_PASSWORD","AZURE_USERNAME","AZURE_PASSWORD","AZURE_ADDITIONALLY_ALLOWED_TENANTS","AZURE_CLIENT_SEND_CERTIFICATE_CHAIN"];function yMo(){return(process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS??"").split(";")}a(yMo,"getAdditionallyAllowedTenants");var m$e="EnvironmentCredential",A3=lo(m$e);function EMo(){let t=(process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN??"").toLowerCase(),e=t==="true"||t==="1";return A3.verbose(`AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: ${process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN}; sendCertificateChain: ${e}`),e}a(EMo,"getSendCertificateChain");var BTe=class{static{a(this,"EnvironmentCredential")}_credential=void 0;constructor(e){let r=Rje(AMo).assigned.join(", ");A3.info(`Found the following environment variables: ${r}`);let n=process.env.AZURE_TENANT_ID,o=process.env.AZURE_CLIENT_ID,s=process.env.AZURE_CLIENT_SECRET,c=yMo(),l=EMo(),u={...e,additionallyAllowedTenantIds:c,sendCertificateChain:l};if(n&&sg(A3,n),n&&o&&s){A3.info(`Invoking ClientSecretCredential with tenant ID: ${n}, clientId: ${o} and clientSecret: [REDACTED]`),this._credential=new OTe(n,o,s,u);return}let d=process.env.AZURE_CLIENT_CERTIFICATE_PATH,f=process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD;if(n&&o&&d){A3.info(`Invoking ClientCertificateCredential with tenant ID: ${n}, clientId: ${o} and certificatePath: ${d}`),this._credential=new MTe(n,o,{certificatePath:d,certificatePassword:f},u);return}let h=process.env.AZURE_USERNAME,m=process.env.AZURE_PASSWORD;n&&o&&h&&m&&(A3.info(`Invoking UsernamePasswordCredential with tenant ID: ${n}, clientId: ${o} and username: ${h}`),A3.warning("Environment is configured to use username and password authentication. This authentication method is deprecated, as it doesn't support multifactor authentication (MFA). Use a more secure credential. For more details, see https://aka.ms/azsdk/identity/mfa."),this._credential=new LTe(n,o,h,m,u))}async getToken(e,r={}){return Mc.withSpan(`${m$e}.getToken`,r,async n=>{if(this._credential)try{let o=await this._credential.getToken(e,n);return A3.getToken.info(e0(e)),o}catch(o){let s=new U7(400,{error:`${m$e} authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`,error_description:o.message.toString().split("More details:").join("")});throw A3.getToken.info(Us(e,s)),s}throw new Mn(`${m$e} is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`)})}};p();p();var _Mo=1e3*64,vMo=3e3;function iun(t){return AFt([{name:"imdsRetryPolicy",retry:a(({retryCount:e,response:r})=>{if(r?.status!==404&&r?.status!==410)return{skipStrategy:!0};let n=r?.status===410?Math.max(vMo,t.startDelayInMs):t.startDelayInMs;return Aan(e,{retryDelayInMs:n,maxRetryDelayInMs:_Mo})},"retry")}],{maxRetries:t.maxRetries})}a(iun,"imdsRetryPolicy");p();var y3="ManagedIdentityCredential - IMDS",RY=lo(y3),CMo="http://169.254.169.254",bMo="/metadata/identity/oauth2/token";function SMo(t){if(!xTe(t))throw new Error(`${y3}: Multiple scopes are not supported.`);let r=new URL(bMo,process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST??CMo),n={Accept:"application/json"};return{url:`${r}`,method:"GET",headers:oQ(n)}}a(SMo,"prepareInvalidRequestOptions");var oun={name:"imdsMsi",async isAvailable(t){let{scopes:e,identityClient:r,getTokenOptions:n}=t,o=xTe(e);if(!o)return RY.info(`${y3}: Unavailable. Multiple scopes are not supported.`),!1;if(process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST)return!0;if(!r)throw new Error("Missing IdentityClient");let s=SMo(o);return Mc.withSpan("ManagedIdentityCredential-pingImdsEndpoint",n??{},async c=>{s.tracingOptions=c.tracingOptions;let l=_P(s);l.timeout=c.requestOptions?.timeout||1e3,l.allowInsecureConnection=!0;let u;try{RY.info(`${y3}: Pinging the Azure IMDS endpoint`),u=await r.sendRequest(l)}catch(d){return gGe(d)&&RY.verbose(`${y3}: Caught error ${d.name}: ${d.message}`),RY.info(`${y3}: The Azure IMDS endpoint is unavailable`),!1}return u.status===403&&u.bodyAsText?.includes("unreachable")?(RY.info(`${y3}: The Azure IMDS endpoint is unavailable`),RY.info(`${y3}: ${u.bodyAsText}`),!1):(RY.info(`${y3}: The Azure IMDS endpoint is available`),!0)})}};p();p();p();var sun=lo("ClientAssertionCredential"),tle=class{static{a(this,"ClientAssertionCredential")}msalClient;tenantId;additionallyAllowedTenantIds;getAssertion;options;constructor(e,r,n,o={}){if(!e)throw new Mn("ClientAssertionCredential: tenantId is a required parameter.");if(!r)throw new Mn("ClientAssertionCredential: clientId is a required parameter.");if(!n)throw new Mn("ClientAssertionCredential: clientAssertion is a required parameter.");this.tenantId=e,this.additionallyAllowedTenantIds=Jf(o?.additionallyAllowedTenants),this.options=o,this.getAssertion=n,this.msalClient=tE(r,e,{...o,logger:sun,tokenCredentialOptions:this.options})}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=yf(this.tenantId,n,this.additionallyAllowedTenantIds,sun);let o=Array.isArray(e)?e:[e];return this.msalClient.getTokenByClientAssertion(o,this.getAssertion,n)})}};var aun=require("node:fs/promises");var kY="WorkloadIdentityCredential",TMo=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_FEDERATED_TOKEN_FILE"],FTe=lo(kY),E3=class{static{a(this,"WorkloadIdentityCredential")}client;azureFederatedTokenFileContent=void 0;cacheDate=void 0;federatedTokenFilePath;constructor(e){let r=Rje(TMo).assigned.join(", ");FTe.info(`Found the following environment variables: ${r}`);let n=e??{},o=n.tenantId||process.env.AZURE_TENANT_ID,s=n.clientId||process.env.AZURE_CLIENT_ID;if(this.federatedTokenFilePath=n.tokenFilePath||process.env.AZURE_FEDERATED_TOKEN_FILE,o&&sg(FTe,o),!s)throw new Mn(`${kY}: is unavailable. clientId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_CLIENT_ID". - See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);if(!o)throw new Mn(`${kY}: is unavailable. tenantId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_TENANT_ID". - See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);if(!this.federatedTokenFilePath)throw new Mn(`${kY}: is unavailable. federatedTokenFilePath is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_FEDERATED_TOKEN_FILE". - See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);FTe.info(`Invoking ClientAssertionCredential with tenant ID: ${o}, clientId: ${n.clientId} and federated token path: [REDACTED]`),this.client=new tle(o,s,this.readFileContents.bind(this),e)}async getToken(e,r){if(!this.client){let n=`${kY}: is unavailable. tenantId, clientId, and federatedTokenFilePath are required parameters. +`,"utf-8")],o=fOo(n);o&&t.headers.set("Content-Length",o),t.body=await tun(n)}a(pOo,"buildRequestBody");var GTe="multipartPolicy",hOo=70,mOo=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function gOo(t){if(t.length>hOo)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!mOo.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(gOo,"assertValidBoundary");function S$e(){return{name:GTe,async sendRequest(t,e){var r;if(!t.multipartBody)return e(t);if(t.body)throw new Error("multipartBody and regular body cannot be set at the same time");let n=t.multipartBody.boundary,o=(r=t.headers.get("Content-Type"))!==null&&r!==void 0?r:"multipart/mixed",s=o.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!s)throw new Error(`Got multipart request body, but content-type header was not multipart: ${o}`);let[,c,l]=s;if(l&&n&&l!==n)throw new Error(`Multipart boundary was specified as ${l} in the header, but got ${n} in the request body`);return n??(n=l),n?gOo(n):n=lOo(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await pOo(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(S$e,"multipartPolicy");p();p();p();p();p();p();p();p();p();p();p();p();function T$e(){return KGe()}a(T$e,"createEmptyPipeline");p();p();p();var nO=K7("core-rest-pipeline");p();p();p();p();function xFt(t={}){return t$e(Object.assign({logger:nO.info},t))}a(xFt,"logPolicy");p();function wFt(t={}){return r$e(t)}a(wFt,"redirectPolicy");p();p();p();var nle=fe(require("node:os"),1),I$e=fe(require("node:process"),1);function nun(){return"User-Agent"}a(nun,"getHeaderName");async function iun(t){if(I$e&&I$e.versions){let e=I$e.versions;e.bun?t.set("Bun",e.bun):e.deno?t.set("Deno",e.deno):e.node&&t.set("Node",e.node)}t.set("OS",`(${nle.arch()}-${nle.type()}-${nle.release()})`)}a(iun,"setPlatformSpecificData");p();var x$e="1.22.0";function TOo(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(TOo,"getUserAgentString");function oun(){return nun()}a(oun,"getUserAgentHeaderName");async function w$e(t){let e=new Map;e.set("core-rest-pipeline",x$e),await iun(e);let r=TOo(e);return t?`${t} ${r}`:r}a(w$e,"getUserAgentValue");var sun=oun(),aun="userAgentPolicy";function RFt(t={}){let e=w$e(t.userAgentPrefix);return{name:aun,async sendRequest(r,n){return r.headers.has(sun)||r.headers.set(sun,await e),n(r)}}}a(RFt,"userAgentPolicy");p();p();var cun=Symbol("rawContent");function kFt(t){return typeof t[cun]=="function"}a(kFt,"hasRawContent");function lun(t){return kFt(t)?t[cun]():t}a(lun,"getRawContent");var R$e=GTe;function PFt(){let t=S$e();return{name:R$e,sendRequest:a(async(e,r)=>{if(e.multipartBody)for(let n of e.multipartBody.parts)kFt(n.body)&&(n.body=lun(n.body));return t.sendRequest(e,r)},"sendRequest")}}a(PFt,"multipartPolicy");p();function DFt(){return n$e()}a(DFt,"decompressResponsePolicy");p();function NFt(t={}){return o$e(t)}a(NFt,"defaultRetryPolicy");p();function MFt(){return s$e()}a(MFt,"formDataPolicy");p();function OFt(t,e){return m$e(t,e)}a(OFt,"proxyPolicy");p();var uun="setClientRequestIdPolicy";function LFt(t="x-ms-client-request-id"){return{name:uun,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(LFt,"setClientRequestIdPolicy");p();function BFt(t){return g$e(t)}a(BFt,"agentPolicy");p();function FFt(t){return A$e(t)}a(FFt,"tlsPolicy");p();p();var ile=xA;function $Te(t){return JGe(t)}a($Te,"isRestError");var dun="tracingPolicy";function UFt(t={}){let e=w$e(t.userAgentPrefix),r=new xP({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=IOo();return{name:dun,async sendRequest(o,s){var c;if(!n)return s(o);let l=await e,u={"http.url":r.sanitizeUrl(o.url),"http.method":o.method,"http.user_agent":l,requestId:o.requestId};l&&(u["http.user_agent"]=l);let{span:d,tracingContext:f}=(c=xOo(n,o,u))!==null&&c!==void 0?c:{};if(!d||!f)return s(o);try{let h=await n.withContext(f,s,o);return ROo(d,h),h}catch(h){throw wOo(d,h),h}}}}a(UFt,"tracingPolicy");function IOo(){try{return PSe({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:x$e})}catch(t){nO.warning(`Error when creating the TracingClient: ${Kce(t)}`);return}}a(IOo,"tryCreateTracingClient");function xOo(t,e,r){try{let{span:n,updatedOptions:o}=t.startSpan(`HTTP ${e.method}`,{tracingOptions:e.tracingOptions},{spanKind:"client",spanAttributes:r});if(!n.isRecording()){n.end();return}let s=t.createRequestHeaders(o.tracingOptions.tracingContext);for(let[c,l]of Object.entries(s))e.headers.set(c,l);return{span:n,tracingContext:o.tracingOptions.tracingContext}}catch(n){nO.warning(`Skipping creating a tracing span due to an error: ${Kce(n)}`);return}}a(xOo,"tryCreateSpan");function wOo(t,e){try{t.setStatus({status:"error",error:jGe(e)?e:void 0}),$Te(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){nO.warning(`Skipping tracing span processing due to an error: ${Kce(r)}`)}}a(wOo,"tryProcessError");function ROo(t,e){try{t.setAttribute("http.status_code",e.status);let r=e.headers.get("x-ms-request-id");r&&t.setAttribute("serviceRequestId",r),e.status>=400&&t.setStatus({status:"error"}),t.end()}catch(r){nO.warning(`Skipping tracing span processing due to an error: ${Kce(r)}`)}}a(ROo,"tryProcessResponse");p();p();function k$e(t){if(t instanceof AbortSignal)return{abortSignal:t};if(t.aborted)return{abortSignal:AbortSignal.abort(t.reason)};let e=new AbortController,r=!0;function n(){r&&(t.removeEventListener("abort",o),r=!1)}a(n,"cleanup");function o(){e.abort(t.reason),n()}return a(o,"listener"),t.addEventListener("abort",o),{abortSignal:e.signal,cleanup:n}}a(k$e,"wrapAbortSignalLike");var kOo="wrapAbortSignalLikePolicy";function fun(){return{name:kOo,sendRequest:a(async(t,e)=>{if(!t.abortSignal)return e(t);let{abortSignal:r,cleanup:n}=k$e(t.abortSignal);t.abortSignal=r;try{return await e(t)}finally{n?.()}},"sendRequest")}}a(fun,"wrapAbortSignalLikePolicy");function QFt(t){var e;let r=T$e();return Jce&&(t.agent&&r.addPolicy(BFt(t.agent)),t.tlsOptions&&r.addPolicy(FFt(t.tlsOptions)),r.addPolicy(OFt(t.proxyOptions)),r.addPolicy(DFt())),r.addPolicy(fun()),r.addPolicy(MFt(),{beforePolicies:[R$e]}),r.addPolicy(RFt(t.userAgentOptions)),r.addPolicy(LFt((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy(PFt(),{afterPhase:"Deserialize"}),r.addPolicy(NFt(t.retryOptions),{phase:"Retry"}),r.addPolicy(UFt(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),Jce&&r.addPolicy(wFt(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy(xFt(t.loggingOptions),{afterPhase:"Sign"}),r}a(QFt,"createPipelineFromOptions");p();function qFt(){let t=e$e();return{async sendRequest(e){let{abortSignal:r,cleanup:n}=e.abortSignal?k$e(e.abortSignal):{};try{return e.abortSignal=r,await t.sendRequest(e)}finally{n?.()}}}}a(qFt,"createDefaultHttpClient");p();function mQ(t){return IS(t)}a(mQ,"createHttpHeaders");p();function RP(t){return YGe(t)}a(RP,"createPipelineRequest");p();p();p();p();var DOo=K7("core-rest-pipeline retryPolicy");function jFt(t,e={maxRetries:3}){return fQ(t,Object.assign({logger:DOo},e))}a(jFt,"retryPolicy");p();p();var NOo={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function MOo(t,e,r){async function n(){if(Date.now()t.getToken(u,d),"tryGetAccessToken"),s.retryIntervalInMs,(f=n?.expiresOnTimestamp)!==null&&f!==void 0?f:Date.now()).then(m=>(r=null,n=m,o=d.tenantId,n)).catch(m=>{throw r=null,n=null,o=void 0,m})),r}return a(l,"refresh"),async(u,d)=>{let f=!!d.claims,h=o!==d.tenantId;return f&&(n=null),h||f||c.mustRefresh?l(u,d):(c.shouldRefresh&&l(u,d),n)}}a(HFt,"createTokenCycler");var gun="bearerTokenAuthenticationPolicy";async function P$e(t,e){try{return[await e(t),void 0]}catch(r){if($Te(r)&&r.response)return[r.response,r];throw r}}a(P$e,"trySendRequest");async function OOo(t){let{scopes:e,getAccessToken:r,request:n}=t,o={abortSignal:n.abortSignal,tracingOptions:n.tracingOptions,enableCae:!0},s=await r(e,o);s&&t.request.headers.set("Authorization",`Bearer ${s.token}`)}a(OOo,"defaultAuthorizeRequest");function pun(t){return t.status===401&&t.headers.has("WWW-Authenticate")}a(pun,"isChallengeResponse");async function hun(t,e){var r;let{scopes:n}=t,o=await t.getAccessToken(n,{enableCae:!0,claims:e});return o?(t.request.headers.set("Authorization",`${(r=o.tokenType)!==null&&r!==void 0?r:"Bearer"} ${o.token}`),!0):!1}a(hun,"authorizeRequestOnCaeChallenge");function D$e(t){var e,r,n;let{credential:o,scopes:s,challengeCallbacks:c}=t,l=t.logger||nO,u={authorizeRequest:(r=(e=c?.authorizeRequest)===null||e===void 0?void 0:e.bind(c))!==null&&r!==void 0?r:OOo,authorizeRequestOnChallenge:(n=c?.authorizeRequestOnChallenge)===null||n===void 0?void 0:n.bind(c)},d=o?HFt(o):()=>Promise.resolve(null);return{name:gun,async sendRequest(f,h){if(!f.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");await u.authorizeRequest({scopes:Array.isArray(s)?s:[s],request:f,getAccessToken:d,logger:l});let m,g,A;if([m,g]=await P$e(f,h),pun(m)){let y=mun(m.headers.get("WWW-Authenticate"));if(y){let E;try{E=atob(y)}catch{return l.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${y}`),m}A=await hun({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await P$e(f,h))}else if(u.authorizeRequestOnChallenge&&(A=await u.authorizeRequestOnChallenge({scopes:Array.isArray(s)?s:[s],request:f,response:m,getAccessToken:d,logger:l}),A&&([m,g]=await P$e(f,h)),pun(m)&&(y=mun(m.headers.get("WWW-Authenticate")),y))){let E;try{E=atob(y)}catch{return l.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${y}`),m}A=await hun({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await P$e(f,h))}}if(g)throw g;return m}}}a(D$e,"bearerTokenAuthenticationPolicy");function LOo(t){let e=/(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g,r=/(\w+)="([^"]*)"/g,n=[],o;for(;(o=e.exec(t))!==null;){let s=o[1],c=o[2],l={},u;for(;(u=r.exec(c))!==null;)l[u[1]]=u[2];n.push({scheme:s,params:l})}return n}a(LOo,"parseChallenges");function mun(t){var e;return t?(e=LOo(t).find(n=>n.scheme==="Bearer"&&n.params.claims&&n.params.error==="insufficient_claims"))===null||e===void 0?void 0:e.params.claims:void 0}a(mun,"getCaeChallengeClaims");p();p();p();p();p();p();var yun=fe(Aun(),1),GFt=yun.state;function gQ(t,e,r){let n=e.parameterPath,o=e.mapper,s;if(typeof n=="string"&&(n=[n]),Array.isArray(n)){if(n.length>0)if(o.isConstant)s=o.defaultValue;else{let c=Eun(t,n);!c.propertyFound&&r&&(c=Eun(r,n));let l=!1;c.propertyFound||(l=o.required||n[0]==="options"&&n.length===2),s=l?o.defaultValue:c.propertyValue}}else{o.required&&(s={});for(let c in n){let l=o.type.modelProperties[c],u=n[c],d=gQ(t,{parameterPath:u,mapper:l},r);d!==void 0&&(s||(s={}),s[c]=d)}}return s}a(gQ,"getOperationArgumentValueFromParameter");function Eun(t,e){let r={propertyFound:!1},n=0;for(;n=200&&r.status<300);u.headersMapper&&(s.parsedHeaders=l.serializer.deserialize(u.headersMapper,s.headers.toJSON(),"operationRes.parsedHeaders",{xml:{},ignoreUnknownProperties:!0}))}return s}a(jOo,"deserializeResponseBody");function HOo(t){let e=Object.keys(t.responses);return e.length===0||e.length===1&&e[0]==="default"}a(HOo,"isOperationSpecEmpty");function GOo(t,e,r,n){var o;let s=200<=t.status&&t.status<300;if(HOo(e)?s:!!r)if(r){if(!r.isError)return{error:null,shouldReturnResponse:!1}}else return{error:null,shouldReturnResponse:!1};let l=r??e.responses.default,u=!((o=t.request.streamResponseStatusCodes)===null||o===void 0)&&o.has(t.status)?`Unexpected status code: ${t.status}`:t.bodyAsText,d=new ile(u,{statusCode:t.status,request:t.request,response:t});if(!l)throw d;let f=l.bodyMapper,h=l.headersMapper;try{if(t.parsedBody){let m=t.parsedBody,g;if(f){let y=m;if(e.isXML&&f.type.name===eO.Sequence){y=[];let E=f.xmlElementName;typeof m=="object"&&E&&(y=m[E])}g=e.serializer.deserialize(f,y,"error.response.parsedBody",n)}let A=m.error||g||m;d.code=A.code,A.message&&(d.message=A.message),f&&(d.response.parsedBody=g)}t.headers&&h&&(d.response.parsedHeaders=e.serializer.deserialize(h,t.headers.toJSON(),"operationRes.parsedHeaders"))}catch(m){d.message=`Error "${m.message}" occurred in deserializing the responseBody - "${t.bodyAsText}" for the default response.`}return{error:d,shouldReturnResponse:!1}}a(GOo,"handleErrorResponse");async function $Oo(t,e,r,n,o){var s;if(!(!((s=r.request.streamResponseStatusCodes)===null||s===void 0)&&s.has(r.status))&&r.bodyAsText){let c=r.bodyAsText,l=r.headers.get("Content-Type")||"",u=l?l.split(";").map(d=>d.toLowerCase()):[];try{if(u.length===0||u.some(d=>t.indexOf(d)!==-1))return r.parsedBody=JSON.parse(c),r;if(u.some(d=>e.indexOf(d)!==-1)){if(!o)throw new Error("Parsing XML not supported.");let d=await o(c,n.xml);return r.parsedBody=d,r}}catch(d){let f=`Error "${d}" occurred while parsing the response body - ${r.bodyAsText}.`,h=d.code||ile.PARSE_ERROR;throw new ile(f,{code:h,statusCode:r.status,request:r.request,response:r})}}return r}a($Oo,"parse");p();p();function Cun(t){let e=new Set;for(let r in t.responses){let n=t.responses[r];n.bodyMapper&&n.bodyMapper.type.name===eO.Stream&&e.add(Number(r))}return e}a(Cun,"getStreamingResponseStatusCodes");function iO(t){let{parameterPath:e,mapper:r}=t,n;return typeof e=="string"?n=e:Array.isArray(e)?n=e.join("."):n=r.serializedName,n}a(iO,"getPathStringFromParameter");var bun="serializationPolicy";function VFt(t={}){let e=t.stringifyXML;return{name:bun,async sendRequest(r,n){let o=C3(r),s=o?.operationSpec,c=o?.operationArguments;return s&&c&&(VOo(r,c,s),WOo(r,c,s,e)),n(r)}}}a(VFt,"serializationPolicy");function VOo(t,e,r){var n,o;if(r.headerParameters)for(let c of r.headerParameters){let l=gQ(e,c);if(l!=null||c.mapper.required){l=r.serializer.serialize(c.mapper,l,iO(c));let u=c.mapper.headerCollectionPrefix;if(u)for(let d of Object.keys(l))t.headers.set(u+d,l[d]);else t.headers.set(c.mapper.serializedName||iO(c),l)}}let s=(o=(n=e.options)===null||n===void 0?void 0:n.requestOptions)===null||o===void 0?void 0:o.customHeaders;if(s)for(let c of Object.keys(s))t.headers.set(c,s[c])}a(VOo,"serializeHeaders");function WOo(t,e,r,n=function(){throw new Error("XML serialization unsupported!")}){var o,s,c,l,u;let d=(o=e.options)===null||o===void 0?void 0:o.serializerOptions,f={xml:{rootName:(s=d?.xml.rootName)!==null&&s!==void 0?s:"",includeRoot:(c=d?.xml.includeRoot)!==null&&c!==void 0?c:!1,xmlCharKey:(l=d?.xml.xmlCharKey)!==null&&l!==void 0?l:"_"}},h=f.xml.xmlCharKey;if(r.requestBody&&r.requestBody.mapper){t.body=gQ(e,r.requestBody);let m=r.requestBody.mapper,{required:g,serializedName:A,xmlName:y,xmlElementName:E,xmlNamespace:_,xmlNamespacePrefix:v,nullable:b}=m,T=m.type.name;try{if(t.body!==void 0&&t.body!==null||b&&t.body===null||g){let w=iO(r.requestBody);t.body=r.serializer.serialize(m,t.body,w,f);let R=T===eO.Stream;if(r.isXML){let x=v?`xmlns:${v}`:"xmlns",P=zOo(_,x,T,t.body,f);T===eO.Sequence?t.body=n(YOo(P,E||y||A,x,_),{rootName:y||A,xmlCharKey:h}):R||(t.body=n(P,{rootName:y||A,xmlCharKey:h}))}else{if(T===eO.String&&(!((u=r.contentType)===null||u===void 0)&&u.match("text/plain")||r.mediaType==="text"))return;R||(t.body=JSON.stringify(t.body))}}}catch(w){throw new Error(`Error "${w.message}" occurred in serializing the payload - ${JSON.stringify(A,void 0," ")}.`)}}else if(r.formDataParameters&&r.formDataParameters.length>0){t.formData={};for(let m of r.formDataParameters){let g=gQ(e,m);if(g!=null){let A=m.mapper.serializedName||iO(m);t.formData[A]=r.serializer.serialize(m.mapper,g,iO(m),f)}}}}a(WOo,"serializeRequestBody");function zOo(t,e,r,n,o){if(t&&!["Composite","Sequence","Dictionary"].includes(r)){let s={};return s[o.xml.xmlCharKey]=n,s["$"]={[e]:t},s}return n}a(zOo,"getXmlValueWithNamespace");function YOo(t,e,r,n){if(Array.isArray(t)||(t=[t]),!r||!n)return{[e]:t};let o={[e]:t};return o["$"]={[r]:n},o}a(YOo,"prepareXMLRootList");function WFt(t={}){let e=QFt(t??{});return t.credentialOptions&&e.addPolicy(D$e({credential:t.credentialOptions.credential,scopes:t.credentialOptions.credentialScopes})),e.addPolicy(VFt(t.serializationOptions),{phase:"Serialize"}),e.addPolicy($Ft(t.deserializationOptions),{phase:"Deserialize"}),e}a(WFt,"createClientPipeline");p();var zFt;function Sun(){return zFt||(zFt=qFt()),zFt}a(Sun,"getCachedDefaultHttpClient");p();var KOo={CSV:",",SSV:" ",Multi:"Multi",TSV:" ",Pipes:"|"};function Iun(t,e,r,n){let o=JOo(e,r,n),s=!1,c=Tun(t,o);if(e.path){let d=Tun(e.path,o);e.path==="/{nextLink}"&&d.startsWith("/")&&(d=d.substring(1)),ZOo(d)?(c=d,s=!0):c=XOo(c,d)}let{queryParams:l,sequenceParams:u}=e5o(e,r,n);return c=r5o(c,l,u,s),c}a(Iun,"getRequestUrl");function Tun(t,e){let r=t;for(let[n,o]of e)r=r.split(n).join(o);return r}a(Tun,"replaceAll");function JOo(t,e,r){var n;let o=new Map;if(!((n=t.urlParameters)===null||n===void 0)&&n.length)for(let s of t.urlParameters){let c=gQ(e,s,r),l=iO(s);c=t.serializer.serialize(s.mapper,c,l),s.skipEncoding||(c=encodeURIComponent(c)),o.set(`{${s.mapper.serializedName||l}}`,c)}return o}a(JOo,"calculateUrlReplacements");function ZOo(t){return t.includes("://")}a(ZOo,"isAbsoluteUrl");function XOo(t,e){if(!e)return t;let r=new URL(t),n=r.pathname;n.endsWith("/")||(n=`${n}/`),e.startsWith("/")&&(e=e.substring(1));let o=e.indexOf("?");if(o!==-1){let s=e.substring(0,o),c=e.substring(o+1);n=n+s,c&&(r.search=r.search?`${r.search}&${c}`:c)}else n=n+e;return r.pathname=n,r.toString()}a(XOo,"appendPath");function e5o(t,e,r){var n;let o=new Map,s=new Set;if(!((n=t.queryParameters)===null||n===void 0)&&n.length)for(let c of t.queryParameters){c.mapper.type.name==="Sequence"&&c.mapper.serializedName&&s.add(c.mapper.serializedName);let l=gQ(e,c,r);if(l!=null||c.mapper.required){l=t.serializer.serialize(c.mapper,l,iO(c));let u=c.collectionFormat?KOo[c.collectionFormat]:"";if(Array.isArray(l)&&(l=l.map(d=>d??"")),c.collectionFormat==="Multi"&&l.length===0)continue;Array.isArray(l)&&(c.collectionFormat==="SSV"||c.collectionFormat==="TSV")&&(l=l.join(u)),c.skipEncoding||(Array.isArray(l)?l=l.map(d=>encodeURIComponent(d)):l=encodeURIComponent(l)),Array.isArray(l)&&(c.collectionFormat==="CSV"||c.collectionFormat==="Pipes")&&(l=l.join(u)),o.set(c.mapper.serializedName||iO(c),l)}}return{queryParams:o,sequenceParams:s}}a(e5o,"calculateQueryParameters");function t5o(t){let e=new Map;if(!t||t[0]!=="?")return e;t=t.slice(1);let r=t.split("&");for(let n of r){let[o,s]=n.split("=",2),c=e.get(o);c?Array.isArray(c)?c.push(s):e.set(o,[c,s]):e.set(o,s)}return e}a(t5o,"simpleParseQueryParams");function r5o(t,e,r,n=!1){if(e.size===0)return t;let o=new URL(t),s=t5o(o.search);for(let[l,u]of e){let d=s.get(l);if(Array.isArray(d))if(Array.isArray(u)){d.push(...u);let f=new Set(d);s.set(l,Array.from(f))}else d.push(u);else d?(Array.isArray(u)?u.unshift(d):r.has(l)&&s.set(l,[d,u]),n||s.set(l,u)):s.set(l,u)}let c=[];for(let[l,u]of s)if(typeof u=="string")c.push(`${l}=${u}`);else if(Array.isArray(u))for(let d of u)c.push(`${l}=${d}`);else c.push(`${l}=${u}`);return o.search=c.length?`?${c.join("&")}`:"",o.toString()}a(r5o,"appendQueryParams");p();var YFt=K7("core-client");var VTe=class{static{a(this,"ServiceClient")}constructor(e={}){var r,n;if(this._requestContentType=e.requestContentType,this._endpoint=(r=e.endpoint)!==null&&r!==void 0?r:e.baseUri,e.baseUri&&YFt.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||Sun(),this.pipeline=e.pipeline||n5o(e),!((n=e.additionalPolicies)===null||n===void 0)&&n.length)for(let{policy:o,position:s}of e.additionalPolicies){let c=s==="perRetry"?"Sign":void 0;this.pipeline.addPolicy(o,{afterPhase:c})}}async sendRequest(e){return this.pipeline.sendRequest(this._httpClient,e)}async sendOperationRequest(e,r){let n=r.baseUrl||this._endpoint;if(!n)throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a endpoint string property that contains the base URL to use.");let o=Iun(n,r,e,this),s=RP({url:o});s.method=r.httpMethod;let c=C3(s);c.operationSpec=r,c.operationArguments=e;let l=r.contentType||this._requestContentType;l&&r.requestBody&&s.headers.set("Content-Type",l);let u=e.options;if(u){let d=u.requestOptions;d&&(d.timeout&&(s.timeout=d.timeout),d.onUploadProgress&&(s.onUploadProgress=d.onUploadProgress),d.onDownloadProgress&&(s.onDownloadProgress=d.onDownloadProgress),d.shouldDeserialize!==void 0&&(c.shouldDeserialize=d.shouldDeserialize),d.allowInsecureConnection&&(s.allowInsecureConnection=!0)),u.abortSignal&&(s.abortSignal=u.abortSignal),u.tracingOptions&&(s.tracingOptions=u.tracingOptions)}this._allowInsecureConnection&&(s.allowInsecureConnection=!0),s.streamResponseStatusCodes===void 0&&(s.streamResponseStatusCodes=Cun(r));try{let d=await this.sendRequest(s),f=z3t(d,r.responses[d.status]);return u?.onResponse&&u.onResponse(d,f),f}catch(d){if(typeof d=="object"&&d?.response){let f=d.response,h=z3t(f,r.responses[d.statusCode]||r.responses.default);d.details=h,u?.onResponse&&u.onResponse(f,h,d)}throw d}}};function n5o(t){let e=i5o(t),r=t.credential&&e?{credentialScopes:e,credential:t.credential}:void 0;return WFt(Object.assign(Object.assign({},t),{credentialOptions:r}))}a(n5o,"createDefaultPipeline");function i5o(t){if(t.credentialScopes)return t.credentialScopes;if(t.endpoint)return`${t.endpoint}/.default`;if(t.baseUri)return`${t.baseUri}/.default`;if(t.credential&&!t.credentialScopes)throw new Error("When using credentials, the ServiceClientOptions must contain either a endpoint or a credentialScopes. Unable to create a bearerTokenAuthenticationPolicy")}a(i5o,"getCredentialScopes");p();p();p();function xun(t){return t==="adfs"?"oauth2/token":"oauth2/v2.0/token"}a(xun,"getIdentityTokenEndpointSuffix");p();var wun="/.default",Run="Specifying a `clientId` or `resourceId` is not supported by the Service Fabric managed identity environment. The managed identity configuration is determined by the Service Fabric cluster resource configuration. See https://aka.ms/servicefabricmi for more information";function WTe(t){let e="";if(Array.isArray(t)){if(t.length!==1)return;e=t[0]}else typeof t=="string"&&(e=t);return e.endsWith(wun)?e.substr(0,e.lastIndexOf(wun)):e}a(WTe,"mapScopesToResource");function kun(t){if(typeof t.expires_on=="number")return t.expires_on*1e3;if(typeof t.expires_on=="string"){let e=+t.expires_on;if(!isNaN(e))return e*1e3;let r=Date.parse(t.expires_on);if(!isNaN(r))return r}if(typeof t.expires_in=="number")return Date.now()+t.expires_in*1e3;throw new Error(`Failed to parse token expiration from body. expires_in="${t.expires_in}", expires_on="${t.expires_on}"`)}a(kun,"parseExpirationTimestamp");function Pun(t){if(t.refresh_on){if(typeof t.refresh_on=="number")return t.refresh_on*1e3;if(typeof t.refresh_on=="string"){let e=+t.refresh_on;if(!isNaN(e))return e*1e3;let r=Date.parse(t.refresh_on);if(!isNaN(r))return r}throw new Error(`Failed to parse refresh_on from body. refresh_on="${t.refresh_on}"`)}else return}a(Pun,"parseRefreshTimestamp");var zTe="noCorrelationId";function o5o(t){let e=t?.authorityHost;return HGe&&(e=e??process.env.AZURE_AUTHORITY_HOST),e??wSe}a(o5o,"getIdentityClientAuthorityHost");var AQ=class extends VTe{static{a(this,"IdentityClient")}authorityHost;allowLoggingAccountIdentifiers;abortControllers;allowInsecureConnection=!1;tokenCredentialOptions;constructor(e){let r=`azsdk-js-identity/${Wje}`,n=e?.userAgentOptions?.userAgentPrefix?`${e.userAgentOptions.userAgentPrefix} ${r}`:`${r}`,o=o5o(e);if(!o.startsWith("https:"))throw new Error("The authorityHost address must use the 'https' protocol.");super({requestContentType:"application/json; charset=utf-8",retryOptions:{maxRetries:3},...e,userAgentOptions:{userAgentPrefix:n},baseUri:o}),this.authorityHost=o,this.abortControllers=new Map,this.allowLoggingAccountIdentifiers=e?.loggingOptions?.allowLoggingAccountIdentifiers,this.tokenCredentialOptions={...e},e?.allowInsecureConnection&&(this.allowInsecureConnection=e.allowInsecureConnection)}async sendTokenRequest(e){ES.info(`IdentityClient: sending token request to [${e.url}]`);let r=await this.sendRequest(e);if(r.bodyAsText&&(r.status===200||r.status===201)){let n=JSON.parse(r.bodyAsText);if(!n.access_token)return null;this.logIdentifiers(r);let o={accessToken:{token:n.access_token,expiresOnTimestamp:kun(n),refreshAfterTimestamp:Pun(n),tokenType:"Bearer"},refreshToken:n.refresh_token};return ES.info(`IdentityClient: [${e.url}] token acquired, expires on ${o.accessToken.expiresOnTimestamp}`),o}else{let n=new Y7(r.status,r.bodyAsText);throw ES.warning(`IdentityClient: authentication error. HTTP status: ${r.status}, ${n.errorResponse.errorDescription}`),n}}async refreshAccessToken(e,r,n,o,s,c={}){if(o===void 0)return null;ES.info(`IdentityClient: refreshing access token with client ID: ${r}, scopes: ${n} started`);let l={grant_type:"refresh_token",client_id:r,refresh_token:o,scope:n};s!==void 0&&(l.client_secret=s);let u=new URLSearchParams(l);return Bc.withSpan("IdentityClient.refreshAccessToken",c,async d=>{try{let f=xun(e),h=RP({url:`${this.authorityHost}/${e}/${f}`,method:"POST",body:u.toString(),abortSignal:c.abortSignal,headers:mQ({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"}),tracingOptions:d.tracingOptions}),m=await this.sendTokenRequest(h);return ES.info(`IdentityClient: refreshed token for client ID: ${r}`),m}catch(f){if(f.name===Yje&&f.errorResponse.error==="interaction_required")return ES.info(`IdentityClient: interaction required for client ID: ${r}`),null;throw ES.warning(`IdentityClient: failed refreshing token for client ID: ${r}: ${f}`),f}})}generateAbortSignal(e){let r=new AbortController,n=this.abortControllers.get(e)||[];n.push(r),this.abortControllers.set(e,n);let o=r.signal.onabort;return r.signal.onabort=(...s)=>{this.abortControllers.set(e,void 0),o&&o.apply(r.signal,s)},r.signal}abortRequests(e){let r=e||zTe,n=[...this.abortControllers.get(r)||[],...this.abortControllers.get(zTe)||[]];if(n.length){for(let o of n)o.abort();this.abortControllers.set(r,void 0)}}getCorrelationId(e){let r=e?.body?.split("&").map(n=>n.split("=")).find(([n])=>n==="client-request-id");return r&&r.length&&r[1]||zTe}async sendGetRequestAsync(e,r){let n=RP({url:e,method:"GET",body:r?.body,allowInsecureConnection:this.allowInsecureConnection,headers:mQ(r?.headers),abortSignal:this.generateAbortSignal(zTe)}),o=await this.sendRequest(n);return this.logIdentifiers(o),{body:o.bodyAsText?JSON.parse(o.bodyAsText):void 0,headers:o.headers.toJSON(),status:o.status}}async sendPostRequestAsync(e,r){let n=RP({url:e,method:"POST",body:r?.body,headers:mQ(r?.headers),allowInsecureConnection:this.allowInsecureConnection,abortSignal:this.generateAbortSignal(this.getCorrelationId(r))}),o=await this.sendRequest(n);return this.logIdentifiers(o),{body:o.bodyAsText?JSON.parse(o.bodyAsText):void 0,headers:o.headers.toJSON(),status:o.status}}getTokenCredentialOptions(){return this.tokenCredentialOptions}logIdentifiers(e){if(!this.allowLoggingAccountIdentifiers||!e.bodyAsText)return;let r="No User Principal Name available";try{let o=(e.parsedBody||JSON.parse(e.bodyAsText)).access_token;if(!o)return;let s=o.split(".")[1],{appid:c,upn:l,tid:u,oid:d}=JSON.parse(Buffer.from(s,"base64").toString("utf8"));ES.info(`[Authenticated account] Client ID: ${c}. Tenant ID: ${u}. User Principal Name: ${l||r}. Object ID (user): ${d}`)}catch(n){ES.warning("allowLoggingAccountIdentifiers was set, but we couldn't log the account information. Error:",n.message)}}};p();var KFt;(function(t){t.AutoDiscoverRegion="AutoDiscoverRegion",t.USWest="westus",t.USWest2="westus2",t.USCentral="centralus",t.USEast="eastus",t.USEast2="eastus2",t.USNorthCentral="northcentralus",t.USSouthCentral="southcentralus",t.USWestCentral="westcentralus",t.CanadaCentral="canadacentral",t.CanadaEast="canadaeast",t.BrazilSouth="brazilsouth",t.EuropeNorth="northeurope",t.EuropeWest="westeurope",t.UKSouth="uksouth",t.UKWest="ukwest",t.FranceCentral="francecentral",t.FranceSouth="francesouth",t.SwitzerlandNorth="switzerlandnorth",t.SwitzerlandWest="switzerlandwest",t.GermanyNorth="germanynorth",t.GermanyWestCentral="germanywestcentral",t.NorwayWest="norwaywest",t.NorwayEast="norwayeast",t.AsiaEast="eastasia",t.AsiaSouthEast="southeastasia",t.JapanEast="japaneast",t.JapanWest="japanwest",t.AustraliaEast="australiaeast",t.AustraliaSouthEast="australiasoutheast",t.AustraliaCentral="australiacentral",t.AustraliaCentral2="australiacentral2",t.IndiaCentral="centralindia",t.IndiaSouth="southindia",t.IndiaWest="westindia",t.KoreaSouth="koreasouth",t.KoreaCentral="koreacentral",t.UAECentral="uaecentral",t.UAENorth="uaenorth",t.SouthAfricaNorth="southafricanorth",t.SouthAfricaWest="southafricawest",t.ChinaNorth="chinanorth",t.ChinaEast="chinaeast",t.ChinaNorth2="chinanorth2",t.ChinaEast2="chinaeast2",t.GermanyCentral="germanycentral",t.GermanyNorthEast="germanynortheast",t.GovernmentUSVirginia="usgovvirginia",t.GovernmentUSIowa="usgoviowa",t.GovernmentUSArizona="usgovarizona",t.GovernmentUSTexas="usgovtexas",t.GovernmentUSDodEast="usdodeast",t.GovernmentUSDodCentral="usdodcentral"})(KFt||(KFt={}));function M$e(t){let e=t;return e===void 0&&globalThis.process?.env?.AZURE_REGIONAL_AUTHORITY_NAME!==void 0&&(e=process.env.AZURE_REGIONAL_AUTHORITY_NAME),e===KFt.AutoDiscoverRegion?"AUTO_DISCOVER":e}a(M$e,"calculateRegionalAuthority");p();p();function s5o(t){return`The current credential is not configured to acquire tokens for tenant ${t}. To enable acquiring tokens for this tenant add it to the AdditionallyAllowedTenants on the credential options, or add "*" to AdditionallyAllowedTenants to allow acquiring tokens for any tenant.`}a(s5o,"createConfigurationErrorMessage");function bf(t,e,r=[],n){let o;if(process.env.AZURE_IDENTITY_DISABLE_MULTITENANTAUTH||t==="adfs"?o=t:o=e?.tenantId??t,t&&o!==t&&!r.includes("*")&&!r.some(s=>s.localeCompare(o)===0)){let s=s5o(o);throw n?.info(s),new Mn(s)}return o}a(bf,"processMultiTenantRequest");function lg(t,e){if(!e.match(/^[0-9a-zA-Z-.]+$/)){let r=new Error("Invalid tenant id provided. You can locate your tenant id by following the instructions listed here: https://learn.microsoft.com/partner-center/find-ids-and-domain-names.");throw t.info(Qs("",r)),r}}a(lg,"checkTenantId");function ole(t,e,r){return e?(lg(t,e),e):(r||(r=dY),r!==dY?"common":"organizations")}a(ole,"resolveTenantId");function tp(t){return!t||t.length===0?[]:t.includes("*")?jrn:t}a(tp,"resolveAdditionallyAllowedTenantIds");var U_=ao("MsalClient");function C5o(t,e,r={}){let n=ole(r.logger??U_,e,t),o=V3t(n,$3t(r)),s=new AQ({...r.tokenCredentialOptions,authorityHost:o,loggingOptions:r.loggingOptions});return{auth:{clientId:t,authority:o,knownAuthorities:Tcn(n,o,r.disableInstanceDiscovery)},system:{networkClient:s,loggerOptions:{loggerCallback:GGe(r.logger??U_),logLevel:$Ge(eHe()),piiLoggingEnabled:r.loggingOptions?.enableUnsafeSupportLogging}}}}a(C5o,"generateMsalConfiguration");function oE(t,e,r={}){let n={msalConfig:C5o(t,e,r),cachedAccount:r.authenticationRecord?Icn(r.authenticationRecord):null,pluginConfiguration:Yrn.generatePluginConfiguration(r),logger:r.logger??U_},o=new Map;async function s(x={}){let P=x.enableCae?"CAE":"default",D=o.get(P);if(D)return n.logger.getToken.info("Existing PublicClientApplication found in cache, returning it."),D;n.logger.getToken.info(`Creating new PublicClientApplication with CAE ${x.enableCae?"enabled":"disabled"}.`);let N=x.enableCae?n.pluginConfiguration.cache.cachePluginCae:n.pluginConfiguration.cache.cachePlugin;return n.msalConfig.auth.clientCapabilities=x.enableCae?["cp1"]:void 0,D=new Gce({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),o.set(P,D),D}a(s,"getPublicApp");let c=new Map;async function l(x={}){let P=x.enableCae?"CAE":"default",D=c.get(P);if(D)return n.logger.getToken.info("Existing ConfidentialClientApplication found in cache, returning it."),D;n.logger.getToken.info(`Creating new ConfidentialClientApplication with CAE ${x.enableCae?"enabled":"disabled"}.`);let N=x.enableCae?n.pluginConfiguration.cache.cachePluginCae:n.pluginConfiguration.cache.cachePlugin;return n.msalConfig.auth.clientCapabilities=x.enableCae?["cp1"]:void 0,D=new Vce({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),c.set(P,D),D}a(l,"getConfidentialApp");async function u(x,P,D={}){if(n.cachedAccount===null)throw n.logger.getToken.info("No cached account found in local state."),new kx({scopes:P});D.claims&&(n.cachedClaims=D.claims);let N={account:n.cachedAccount,scopes:P,claims:n.cachedClaims};n.pluginConfiguration.broker.isEnabled&&(N.extraQueryParameters||={},n.pluginConfiguration.broker.enableMsaPassthrough&&(N.extraQueryParameters.msal_request_type="consumer_passthrough")),D.proofOfPossessionOptions&&(N.shrNonce=D.proofOfPossessionOptions.nonce,N.authenticationScheme="pop",N.resourceRequestMethod=D.proofOfPossessionOptions.resourceRequestMethod,N.resourceRequestUri=D.proofOfPossessionOptions.resourceRequestUrl),n.logger.getToken.info("Attempting to acquire token silently");try{return await x.acquireTokenSilent(N)}catch(L){throw UY(P,L,D)}}a(u,"getTokenSilent");function d(x){return x?.tenantId?V3t(x.tenantId,$3t(r)):n.msalConfig.auth.authority}a(d,"calculateRequestAuthority");async function f(x,P,D,N){let L=null;try{L=await u(x,P,D)}catch(B){if(B.name!=="AuthenticationRequiredError")throw B;if(D.disableAutomaticAuthentication)throw new kx({scopes:P,getTokenOptions:D,message:"Automatic authentication has been disabled. You may call the authentication() method."})}if(L===null)try{L=await N()}catch(B){throw UY(P,B,D)}return FY(P,L,D),n.cachedAccount=L?.account??null,n.logger.getToken.info(o0(P)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}a(f,"withSilentAuthentication");async function h(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client secret"),n.msalConfig.auth.clientSecret=P;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:M$e(),claims:D?.claims});return FY(x,L,D),n.logger.getToken.info(o0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw UY(x,L,D)}}a(h,"getTokenByClientSecret");async function m(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client assertion"),n.msalConfig.auth.clientAssertion=P;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:M$e(),claims:D?.claims,clientAssertion:P});return FY(x,L,D),n.logger.getToken.info(o0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw UY(x,L,D)}}a(m,"getTokenByClientAssertion");async function g(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client certificate"),n.msalConfig.auth.clientCertificate=P;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:M$e(),claims:D?.claims});return FY(x,L,D),n.logger.getToken.info(o0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw UY(x,L,D)}}a(g,"getTokenByClientCertificate");async function A(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using device code");let N=await s(D);return f(N,x,D,()=>{let L={scopes:x,cancel:D?.abortSignal?.aborted??!1,deviceCodeCallback:P,authority:d(D),claims:D?.claims},B=N.acquireTokenByDeviceCode(L);return D.abortSignal&&D.abortSignal.addEventListener("abort",()=>{L.cancel=!0}),B})}a(A,"getTokenByDeviceCode");async function y(x,P,D,N={}){n.logger.getToken.info("Attempting to acquire token using username and password");let L=await s(N);return f(L,x,N,()=>{let B={scopes:x,username:P,password:D,authority:d(N),claims:N?.claims};return L.acquireTokenByUsernamePassword(B)})}a(y,"getTokenByUsernamePassword");function E(){if(n.cachedAccount)return xcn(t,n.cachedAccount)}a(E,"getActiveAccount");async function _(x,P,D,N,L={}){n.logger.getToken.info("Attempting to acquire token using authorization code");let B;return N?(n.msalConfig.auth.clientSecret=N,B=await l(L)):B=await s(L),f(B,x,L,()=>B.acquireTokenByCode({scopes:x,redirectUri:P,code:D,authority:d(L),claims:L?.claims}))}a(_,"getTokenByAuthorizationCode");async function v(x,P,D,N={}){U_.getToken.info("Attempting to acquire token on behalf of another user"),typeof D=="string"?(U_.getToken.info("Using client secret for on behalf of flow"),n.msalConfig.auth.clientSecret=D):typeof D=="function"?(U_.getToken.info("Using client assertion callback for on behalf of flow"),n.msalConfig.auth.clientAssertion=D):(U_.getToken.info("Using client certificate for on behalf of flow"),n.msalConfig.auth.clientCertificate=D);let L=await l(N);try{let B=await L.acquireTokenOnBehalfOf({scopes:x,authority:d(N),claims:N.claims,oboAssertion:P});return FY(x,B,N),U_.getToken.info(o0(x)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}catch(B){throw UY(x,B,N)}}a(v,"getTokenOnBehalfOf");function b(x,P){return{openBrowser:a(async D=>{await(await Promise.resolve().then(()=>(U$e(),adn))).default(D,{newInstance:!0})},"openBrowser"),scopes:x,authority:d(P),claims:P?.claims,loginHint:P?.loginHint,errorTemplate:P?.browserCustomizationOptions?.errorMessage,successTemplate:P?.browserCustomizationOptions?.successMessage,prompt:P?.loginHint?"login":"select_account"}}a(b,"createBaseInteractiveRequest");async function T(x,P,D={}){U_.verbose("Authentication will resume through the broker");let N=await s(D),L=b(x,D);n.pluginConfiguration.broker.parentWindowHandle?L.windowHandle=Buffer.from(n.pluginConfiguration.broker.parentWindowHandle):U_.warning("Parent window handle is not specified for the broker. This may cause unexpected behavior. Please provide the parentWindowHandle."),n.pluginConfiguration.broker.enableMsaPassthrough&&((L.extraQueryParameters??={}).msal_request_type="consumer_passthrough"),P?(L.prompt="none",U_.verbose("Attempting broker authentication using the default broker account")):U_.verbose("Attempting broker authentication without the default broker account"),D.proofOfPossessionOptions&&(L.shrNonce=D.proofOfPossessionOptions.nonce,L.authenticationScheme="pop",L.resourceRequestMethod=D.proofOfPossessionOptions.resourceRequestMethod,L.resourceRequestUri=D.proofOfPossessionOptions.resourceRequestUrl);try{return await N.acquireTokenInteractive(L)}catch(B){if(U_.verbose(`Failed to authenticate through the broker: ${B.message}`),D.disableAutomaticAuthentication)throw new kx({scopes:x,getTokenOptions:D,message:"Cannot silently authenticate with default broker account."});if(P)return T(x,!1,D);throw B}}a(T,"getBrokeredTokenInternal");async function w(x,P,D={}){U_.getToken.info(`Attempting to acquire token using brokered authentication with useDefaultBrokerAccount: ${P}`);let N=await T(x,P,D);return FY(x,N,D),n.cachedAccount=N?.account??null,n.logger.getToken.info(o0(x)),{token:N.accessToken,expiresOnTimestamp:N.expiresOn.getTime(),refreshAfterTimestamp:N.refreshOn?.getTime(),tokenType:N.tokenType}}a(w,"getBrokeredToken");async function R(x,P={}){U_.getToken.info("Attempting to acquire token interactively");let D=await s(P);return f(D,x,P,async()=>{let N=b(x,P);return n.pluginConfiguration.broker.isEnabled?T(x,n.pluginConfiguration.broker.useDefaultBrokerAccount??!1,P):(P.proofOfPossessionOptions&&(N.shrNonce=P.proofOfPossessionOptions.nonce,N.authenticationScheme="pop",N.resourceRequestMethod=P.proofOfPossessionOptions.resourceRequestMethod,N.resourceRequestUri=P.proofOfPossessionOptions.resourceRequestUrl),D.acquireTokenInteractive(N))})}return a(R,"getTokenByInteractiveRequest"),{getActiveAccount:E,getBrokeredToken:w,getTokenByClientSecret:h,getTokenByClientAssertion:m,getTokenByClientCertificate:g,getTokenByDeviceCode:A,getTokenByUsernamePassword:y,getTokenByAuthorizationCode:_,getTokenOnBehalfOf:v,getTokenByInteractiveRequest:R}}a(oE,"createMsalClient");var XTe=require("node:crypto");var ldn=require("node:fs/promises");var ZTe="ClientCertificateCredential",cdn=ao(ZTe),eIe=class{static{a(this,"ClientCertificateCredential")}tenantId;additionallyAllowedTenantIds;certificateConfiguration;sendCertificateChain;msalClient;constructor(e,r,n,o={}){if(!e||!r)throw new Error(`${ZTe}: tenantId and clientId are required parameters.`);this.tenantId=e,this.additionallyAllowedTenantIds=tp(o?.additionallyAllowedTenants),this.sendCertificateChain=o.sendCertificateChain,this.certificateConfiguration={...typeof n=="string"?{certificatePath:n}:n};let s=this.certificateConfiguration.certificate,c=this.certificateConfiguration.certificatePath;if(!this.certificateConfiguration||!(s||c))throw new Error(`${ZTe}: Provide either a PEM certificate in string form, or the path to that certificate in the filesystem. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);if(s&&c)throw new Error(`${ZTe}: To avoid unexpected behaviors, providing both the contents of a PEM certificate and the path to a PEM certificate is forbidden. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);this.msalClient=oE(r,e,{...o,logger:cdn,tokenCredentialOptions:o})}async getToken(e,r={}){return Bc.withSpan(`${ZTe}.getToken`,r,async n=>{n.tenantId=bf(this.tenantId,n,this.additionallyAllowedTenantIds,cdn);let o=Array.isArray(e)?e:[e],s=await this.buildClientCertificate();return this.msalClient.getTokenByClientCertificate(o,s,n)})}async buildClientCertificate(){let e=await b5o(this.certificateConfiguration,this.sendCertificateChain??!1),r;return this.certificateConfiguration.certificatePassword!==void 0?r=(0,XTe.createPrivateKey)({key:e.certificateContents,passphrase:this.certificateConfiguration.certificatePassword,format:"pem"}).export({format:"pem",type:"pkcs8"}).toString():r=e.certificateContents,{thumbprint:e.thumbprint,thumbprintSha256:e.thumbprintSha256,privateKey:r,x5c:e.x5c}}};async function b5o(t,e){let r=t.certificate,n=t.certificatePath,o=r||await(0,ldn.readFile)(n,"utf8"),s=e?o:void 0,c=/(-+BEGIN CERTIFICATE-+)(\n\r?|\r\n?)([A-Za-z0-9+/\n\r]+=*)(\n\r?|\r\n?)(-+END CERTIFICATE-+)/g,l=[],u;do u=c.exec(o),u&&l.push(u[3]);while(u);if(l.length===0)throw new Error("The file at the specified path does not contain a PEM-encoded certificate.");let d=(0,XTe.createHash)("sha1").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase(),f=(0,XTe.createHash)("sha256").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase();return{certificateContents:o,thumbprintSha256:f,thumbprint:d,x5c:s}}a(b5o,"parseCertificate");p();p();function qx(t){return Array.isArray(t)?t:[t]}a(qx,"ensureScopes");function cle(t,e){if(!t.match(/^[0-9a-zA-Z-_.:/]+$/)){let r=new Error("Invalid scope was specified by the user or calling client");throw e.getToken.info(Qs(t,r)),r}}a(cle,"ensureValidScopeForDevTimeCreds");function Q$e(t){return t.replace(/\/.default$/,"")}a(Q$e,"getScopeResource");var udn=ao("ClientSecretCredential"),tIe=class{static{a(this,"ClientSecretCredential")}tenantId;additionallyAllowedTenantIds;msalClient;clientSecret;constructor(e,r,n,o={}){if(!e)throw new Mn("ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!r)throw new Mn("ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!n)throw new Mn("ClientSecretCredential: clientSecret is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");this.clientSecret=n,this.tenantId=e,this.additionallyAllowedTenantIds=tp(o?.additionallyAllowedTenants),this.msalClient=oE(r,e,{...o,logger:udn,tokenCredentialOptions:o})}async getToken(e,r={}){return Bc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=bf(this.tenantId,n,this.additionallyAllowedTenantIds,udn);let o=qx(e);return this.msalClient.getTokenByClientSecret(o,this.clientSecret,n)})}};p();var S5o=ao("UsernamePasswordCredential"),rIe=class{static{a(this,"UsernamePasswordCredential")}tenantId;additionallyAllowedTenantIds;msalClient;username;password;constructor(e,r,n,o,s={}){if(!e)throw new Mn("UsernamePasswordCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!r)throw new Mn("UsernamePasswordCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!n)throw new Mn("UsernamePasswordCredential: username is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!o)throw new Mn("UsernamePasswordCredential: password is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");this.tenantId=e,this.additionallyAllowedTenantIds=tp(s?.additionallyAllowedTenants),this.username=n,this.password=o,this.msalClient=oE(r,this.tenantId,{...s,tokenCredentialOptions:s??{}})}async getToken(e,r={}){return Bc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=bf(this.tenantId,n,this.additionallyAllowedTenantIds,S5o);let o=qx(e);return this.msalClient.getTokenByUsernamePassword(o,this.username,this.password,n)})}};var T5o=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_CLIENT_SECRET","AZURE_CLIENT_CERTIFICATE_PATH","AZURE_CLIENT_CERTIFICATE_PASSWORD","AZURE_USERNAME","AZURE_PASSWORD","AZURE_ADDITIONALLY_ALLOWED_TENANTS","AZURE_CLIENT_SEND_CERTIFICATE_CHAIN"];function I5o(){return(process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS??"").split(";")}a(I5o,"getAdditionallyAllowedTenants");var q$e="EnvironmentCredential",b3=ao(q$e);function x5o(){let t=(process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN??"").toLowerCase(),e=t==="true"||t==="1";return b3.verbose(`AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: ${process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN}; sendCertificateChain: ${e}`),e}a(x5o,"getSendCertificateChain");var nIe=class{static{a(this,"EnvironmentCredential")}_credential=void 0;constructor(e){let r=tHe(T5o).assigned.join(", ");b3.info(`Found the following environment variables: ${r}`);let n=process.env.AZURE_TENANT_ID,o=process.env.AZURE_CLIENT_ID,s=process.env.AZURE_CLIENT_SECRET,c=I5o(),l=x5o(),u={...e,additionallyAllowedTenantIds:c,sendCertificateChain:l};if(n&&lg(b3,n),n&&o&&s){b3.info(`Invoking ClientSecretCredential with tenant ID: ${n}, clientId: ${o} and clientSecret: [REDACTED]`),this._credential=new tIe(n,o,s,u);return}let d=process.env.AZURE_CLIENT_CERTIFICATE_PATH,f=process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD;if(n&&o&&d){b3.info(`Invoking ClientCertificateCredential with tenant ID: ${n}, clientId: ${o} and certificatePath: ${d}`),this._credential=new eIe(n,o,{certificatePath:d,certificatePassword:f},u);return}let h=process.env.AZURE_USERNAME,m=process.env.AZURE_PASSWORD;n&&o&&h&&m&&(b3.info(`Invoking UsernamePasswordCredential with tenant ID: ${n}, clientId: ${o} and username: ${h}`),b3.warning("Environment is configured to use username and password authentication. This authentication method is deprecated, as it doesn't support multifactor authentication (MFA). Use a more secure credential. For more details, see https://aka.ms/azsdk/identity/mfa."),this._credential=new rIe(n,o,h,m,u))}async getToken(e,r={}){return Bc.withSpan(`${q$e}.getToken`,r,async n=>{if(this._credential)try{let o=await this._credential.getToken(e,n);return b3.getToken.info(o0(e)),o}catch(o){let s=new Y7(400,{error:`${q$e} authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`,error_description:o.message.toString().split("More details:").join("")});throw b3.getToken.info(Qs(e,s)),s}throw new Mn(`${q$e} is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`)})}};p();p();var w5o=1e3*64,R5o=3e3;function ddn(t){return jFt([{name:"imdsRetryPolicy",retry:a(({retryCount:e,response:r})=>{if(r?.status!==404&&r?.status!==410)return{skipStrategy:!0};let n=r?.status===410?Math.max(R5o,t.startDelayInMs):t.startDelayInMs;return bcn(e,{retryDelayInMs:n,maxRetryDelayInMs:w5o})},"retry")}],{maxRetries:t.maxRetries})}a(ddn,"imdsRetryPolicy");p();var S3="ManagedIdentityCredential - IMDS",qY=ao(S3),k5o="http://169.254.169.254",P5o="/metadata/identity/oauth2/token";function D5o(t){if(!WTe(t))throw new Error(`${S3}: Multiple scopes are not supported.`);let r=new URL(P5o,process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST??k5o),n={Accept:"application/json"};return{url:`${r}`,method:"GET",headers:mQ(n)}}a(D5o,"prepareInvalidRequestOptions");var fdn={name:"imdsMsi",async isAvailable(t){let{scopes:e,identityClient:r,getTokenOptions:n}=t,o=WTe(e);if(!o)return qY.info(`${S3}: Unavailable. Multiple scopes are not supported.`),!1;if(process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST)return!0;if(!r)throw new Error("Missing IdentityClient");let s=D5o(o);return Bc.withSpan("ManagedIdentityCredential-pingImdsEndpoint",n??{},async c=>{s.tracingOptions=c.tracingOptions;let l=RP(s);l.timeout=c.requestOptions?.timeout||1e3,l.allowInsecureConnection=!0;let u;try{qY.info(`${S3}: Pinging the Azure IMDS endpoint`),u=await r.sendRequest(l)}catch(d){return jGe(d)&&qY.verbose(`${S3}: Caught error ${d.name}: ${d.message}`),qY.info(`${S3}: The Azure IMDS endpoint is unavailable`),!1}return u.status===403&&u.bodyAsText?.includes("unreachable")?(qY.info(`${S3}: The Azure IMDS endpoint is unavailable`),qY.info(`${S3}: ${u.bodyAsText}`),!1):(qY.info(`${S3}: The Azure IMDS endpoint is available`),!0)})}};p();p();p();var pdn=ao("ClientAssertionCredential"),lle=class{static{a(this,"ClientAssertionCredential")}msalClient;tenantId;additionallyAllowedTenantIds;getAssertion;options;constructor(e,r,n,o={}){if(!e)throw new Mn("ClientAssertionCredential: tenantId is a required parameter.");if(!r)throw new Mn("ClientAssertionCredential: clientId is a required parameter.");if(!n)throw new Mn("ClientAssertionCredential: clientAssertion is a required parameter.");this.tenantId=e,this.additionallyAllowedTenantIds=tp(o?.additionallyAllowedTenants),this.options=o,this.getAssertion=n,this.msalClient=oE(r,e,{...o,logger:pdn,tokenCredentialOptions:this.options})}async getToken(e,r={}){return Bc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=bf(this.tenantId,n,this.additionallyAllowedTenantIds,pdn);let o=Array.isArray(e)?e:[e];return this.msalClient.getTokenByClientAssertion(o,this.getAssertion,n)})}};var hdn=require("node:fs/promises");var jY="WorkloadIdentityCredential",N5o=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_FEDERATED_TOKEN_FILE"],iIe=ao(jY),T3=class{static{a(this,"WorkloadIdentityCredential")}client;azureFederatedTokenFileContent=void 0;cacheDate=void 0;federatedTokenFilePath;constructor(e){let r=tHe(N5o).assigned.join(", ");iIe.info(`Found the following environment variables: ${r}`);let n=e??{},o=n.tenantId||process.env.AZURE_TENANT_ID,s=n.clientId||process.env.AZURE_CLIENT_ID;if(this.federatedTokenFilePath=n.tokenFilePath||process.env.AZURE_FEDERATED_TOKEN_FILE,o&&lg(iIe,o),!s)throw new Mn(`${jY}: is unavailable. clientId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_CLIENT_ID". + See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);if(!o)throw new Mn(`${jY}: is unavailable. tenantId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_TENANT_ID". + See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);if(!this.federatedTokenFilePath)throw new Mn(`${jY}: is unavailable. federatedTokenFilePath is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_FEDERATED_TOKEN_FILE". + See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);iIe.info(`Invoking ClientAssertionCredential with tenant ID: ${o}, clientId: ${n.clientId} and federated token path: [REDACTED]`),this.client=new lle(o,s,this.readFileContents.bind(this),e)}async getToken(e,r){if(!this.client){let n=`${jY}: is unavailable. tenantId, clientId, and federatedTokenFilePath are required parameters. In DefaultAzureCredential and ManagedIdentityCredential, these can be provided as environment variables - "AZURE_TENANT_ID", "AZURE_CLIENT_ID", - "AZURE_FEDERATED_TOKEN_FILE". See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`;throw FTe.info(n),new Mn(n)}return FTe.info("Invoking getToken() of Client Assertion Credential"),this.client.getToken(e,r)}async readFileContents(){if(this.cacheDate!==void 0&&Date.now()-this.cacheDate>=1e3*60*5&&(this.azureFederatedTokenFileContent=void 0),!this.federatedTokenFilePath)throw new Mn(`${kY}: is unavailable. Invalid file path provided ${this.federatedTokenFilePath}.`);if(!this.azureFederatedTokenFileContent){let r=(await(0,aun.readFile)(this.federatedTokenFilePath,"utf8")).trim();if(r)this.azureFederatedTokenFileContent=r,this.cacheDate=Date.now();else throw new Mn(`${kY}: is unavailable. No content on the file ${this.federatedTokenFilePath}.`)}return this.azureFederatedTokenFileContent}};var cun="ManagedIdentityCredential - Token Exchange",IMo=lo(cun),$Ft={name:"tokenExchangeMsi",async isAvailable(t){let e=process.env,r=!!((t||e.AZURE_CLIENT_ID)&&e.AZURE_TENANT_ID&&process.env.AZURE_FEDERATED_TOKEN_FILE);return r||IMo.info(`${cun}: Unavailable. The environment variables needed are: AZURE_CLIENT_ID (or the client ID sent through the parameters), AZURE_TENANT_ID and AZURE_FEDERATED_TOKEN_FILE`),r},async getToken(t,e={}){let{scopes:r,clientId:n}=t,o={};return new E3({clientId:n,tenantId:process.env.AZURE_TENANT_ID,tokenFilePath:process.env.AZURE_FEDERATED_TOKEN_FILE,...o,disableInstanceDiscovery:!0}).getToken(r,e)}};var TS=lo("ManagedIdentityCredential"),dQ=class{static{a(this,"ManagedIdentityCredential")}managedIdentityApp;identityClient;clientId;resourceId;objectId;msiRetryConfig={maxRetries:5,startDelayInMs:800,intervalIncrement:2};isAvailableIdentityClient;sendProbeRequest;constructor(e,r){let n;typeof e=="string"?(this.clientId=e,n=r??{}):(this.clientId=e?.clientId,n=e??{}),this.resourceId=n?.resourceId,this.objectId=n?.objectId,this.sendProbeRequest=n?.sendProbeRequest??!1;let o=[{key:"clientId",value:this.clientId},{key:"resourceId",value:this.resourceId},{key:"objectId",value:this.objectId}].filter(c=>c.value);if(o.length>1)throw new Error(`ManagedIdentityCredential: only one of 'clientId', 'resourceId', or 'objectId' can be provided. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}`);n.allowInsecureConnection=!0,n.retryOptions?.maxRetries!==void 0&&(this.msiRetryConfig.maxRetries=n.retryOptions.maxRetries),this.identityClient=new aQ({...n,additionalPolicies:[{policy:iun(this.msiRetryConfig),position:"perCall"}]}),this.managedIdentityApp=new Uce({managedIdentityIdParams:{userAssignedClientId:this.clientId,userAssignedResourceId:this.resourceId,userAssignedObjectId:this.objectId},system:{disableInternalRetries:!0,networkClient:this.identityClient,loggerOptions:{logLevel:EGe(wje()),piiLoggingEnabled:n.loggingOptions?.enableUnsafeSupportLogging,loggerCallback:yGe(TS)}}}),this.isAvailableIdentityClient=new aQ({...n,retryOptions:{maxRetries:0}});let s=this.managedIdentityApp.getManagedIdentitySource();if(s==="CloudShell"&&(this.clientId||this.resourceId||this.objectId))throw TS.warning(`CloudShell MSI detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Mn("ManagedIdentityCredential: Specifying a user-assigned managed identity is not supported for CloudShell at runtime. When using Managed Identity in CloudShell, omit the clientId, resourceId, and objectId parameters.");if(s==="ServiceFabric"&&(this.clientId||this.resourceId||this.objectId))throw TS.warning(`Service Fabric detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Mn(`ManagedIdentityCredential: ${Cln}`);if(TS.info(`Using ${s} managed identity.`),o.length===1){let{key:c,value:l}=o[0];TS.info(`${s} with ${c}: ${l}`)}}async getToken(e,r={}){TS.getToken.info("Using the MSAL provider for Managed Identity.");let n=xTe(e);if(!n)throw new Mn(`ManagedIdentityCredential: Multiple scopes are not supported. Scopes: ${JSON.stringify(e)}`);return Mc.withSpan("ManagedIdentityCredential.getToken",r,async()=>{try{let o=await $Ft.isAvailable(this.clientId),s=this.managedIdentityApp.getManagedIdentitySource(),c=s==="DefaultToImds"||s==="Imds";if(TS.getToken.info(`MSAL Identity source: ${s}`),o){TS.getToken.info("Using the token exchange managed identity.");let u=await $Ft.getToken({scopes:e,clientId:this.clientId,identityClient:this.identityClient,retryConfig:this.msiRetryConfig,resourceId:this.resourceId});if(u===null)throw new Mn("Attempted to use the token exchange managed identity, but received a null response.");return u}else if(c&&this.sendProbeRequest&&(TS.getToken.info("Using the IMDS endpoint to probe for availability."),!await oun.isAvailable({scopes:e,clientId:this.clientId,getTokenOptions:r,identityClient:this.isAvailableIdentityClient,resourceId:this.resourceId})))throw new Mn("Attempted to use the IMDS endpoint, but it is not available.");TS.getToken.info("Calling into MSAL for managed identity token.");let l=await this.managedIdentityApp.acquireToken({resource:n});return this.ensureValidMsalToken(e,l,r),TS.getToken.info(e0(e)),{expiresOnTimestamp:l.expiresOn.getTime(),token:l.accessToken,refreshAfterTimestamp:l.refreshOn?.getTime(),tokenType:"Bearer"}}catch(o){throw TS.getToken.error(Us(e,o)),o.name==="AuthenticationRequiredError"?o:xMo(o)?new Mn(`ManagedIdentityCredential: Network unreachable. Message: ${o.message}`,{cause:o}):new Mn(`ManagedIdentityCredential: Authentication failed. Message ${o.message}`,{cause:o})}})}ensureValidMsalToken(e,r,n){let o=a(s=>(TS.getToken.info(s),new bx({scopes:Array.isArray(e)?e:[e],getTokenOptions:n,message:s})),"createError");if(!r)throw o("No response.");if(!r.expiresOn)throw o('Response had no "expiresOn" property.');if(!r.accessToken)throw o('Response had no "accessToken" property.')}};function xMo(t){return!!(t.errorCode==="network_error"||t.code==="ENETUNREACH"||t.code==="EHOSTUNREACH"||(t.statusCode===403||t.code===403)&&t.message.includes("unreachable"))}a(xMo,"isNetworkError");p();var lun=de(require("child_process"),1);var JM=lo("AzureDeveloperCliCredential"),g$e={notInstalled:"Azure Developer CLI couldn't be found. To mitigate this issue, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.",login:"Please run 'azd auth login' from a command prompt to authenticate before using this credential. For more information, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.",unknown:"Unknown error while trying to retrieve the access token",claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:"},uun={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(JM.getToken.warning("The SystemRoot environment variable is not set. This may cause issues when using the Azure Developer CLI credential."),t="C:\\Windows"),t}else return"/bin"},async getAzdAccessToken(t,e,r,n){let o=[];e&&(o=["--tenant-id",e]);let s=[];return n&&(s=["--claims",btoa(n)]),new Promise((c,l)=>{try{let d=["azd",...["auth","token","--output","json","--no-prompt",...t.reduce((f,h)=>f.concat("--scope",h),[]),...o,...s]].join(" ");lun.default.exec(d,{cwd:uun.getSafeWorkingDir(),timeout:r},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},UTe=class{static{a(this,"AzureDeveloperCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(sg(JM,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=Jf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=yf(this.tenantId,r,this.additionallyAllowedTenantIds);n&&sg(JM,n);let o;return typeof e=="string"?o=[e]:o=e,JM.getToken.info(`Using the scopes ${e}`),Mc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{o.forEach(d=>{ele(d,JM)});let s=await uun.getAzdAccessToken(o,n,this.timeout,r.claims),c=s.stderr?.match("must use multi-factor authentication")||s.stderr?.match("reauthentication required"),l=s.stderr?.match("not logged in, run `azd login` to login")||s.stderr?.match("not logged in, run `azd auth login` to login");if(s.stderr?.match("azd:(.*)not found")||s.stderr?.startsWith("'azd' is not recognized")||s.error&&s.error.code==="ENOENT"){let d=new Mn(g$e.notInstalled);throw JM.getToken.info(Us(e,d)),d}if(l){let d=new Mn(g$e.login);throw JM.getToken.info(Us(e,d)),d}if(c){let f=`azd auth login ${o.reduce((m,g)=>m.concat("--scope",g),[]).join(" ")}`,h=new Mn(`${g$e.claim} ${f}`);throw JM.getToken.info(Us(e,h)),h}try{let d=JSON.parse(s.stdout);return JM.getToken.info(e0(e)),{token:d.token,expiresOnTimestamp:new Date(d.expiresOn).getTime(),tokenType:"Bearer"}}catch(d){throw s.stderr?new Mn(s.stderr):d}}catch(s){let c=s.name==="CredentialUnavailableError"?s:new Mn(s.message||g$e.unknown);throw JM.getToken.info(Us(e,c)),c}})}};p();var dun=de(require("child_process"),1);p();function VFt(t,e){if(!e.match(/^[0-9a-zA-Z-._ ]+$/)){let r=new Error(`Subscription '${e}' contains invalid characters. If this is the name of a subscription, use its ID instead. You can locate your subscription by following the instructions listed here: https://learn.microsoft.com/azure/azure-portal/get-subscription-tenant-id`);throw t.info(Us("",r)),r}}a(VFt,"checkSubscription");var IS=lo("AzureCliCredential"),QTe={claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:",notInstalled:"Azure CLI could not be found. Please visit https://aka.ms/azure-cli for installation instructions and then, once installed, authenticate to your Azure account using 'az login'.",login:"Please run 'az login' from a command prompt to authenticate before using this credential.",unknown:"Unknown error while trying to retrieve the access token",unexpectedResponse:'Unexpected response from Azure CLI when getting token. Expected "expiresOn" to be a RFC3339 date string. Got:'},fun={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(IS.getToken.warning("The SystemRoot environment variable is not set. This may cause issues when using the Azure CLI credential."),t="C:\\Windows"),t}else return"/bin"},async getAzureCliAccessToken(t,e,r,n){let o=[],s=[];return e&&(o=["--tenant",e]),r&&(s=["--subscription",`"${r}"`]),new Promise((c,l)=>{try{let d=["az",...["account","get-access-token","--output","json","--resource",t,...o,...s]].join(" ");dun.default.exec(d,{cwd:fun.getSafeWorkingDir(),timeout:n},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},qTe=class{static{a(this,"AzureCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;subscription;constructor(e){e?.tenantId&&(sg(IS,e?.tenantId),this.tenantId=e?.tenantId),e?.subscription&&(VFt(IS,e?.subscription),this.subscription=e?.subscription),this.additionallyAllowedTenantIds=Jf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=typeof e=="string"?e:e[0],o=r.claims;if(o&&o.trim()){let l=`az login --claims-challenge ${btoa(o)} --scope ${n}`,u=r.tenantId;u&&(l+=` --tenant ${u}`);let d=new Mn(`${QTe.claim} ${l}`);throw IS.getToken.info(Us(n,d)),d}let s=yf(this.tenantId,r,this.additionallyAllowedTenantIds);return s&&sg(IS,s),this.subscription&&VFt(IS,this.subscription),IS.getToken.info(`Using the scope ${n}`),Mc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{ele(n,IS);let c=h$e(n),l=await fun.getAzureCliAccessToken(c,s,this.subscription,this.timeout),u=l.stderr?.match("(.*)az login --scope(.*)"),d=l.stderr?.match("(.*)az login(.*)")&&!u;if(l.stderr?.match("az:(.*)not found")||l.stderr?.startsWith("'az' is not recognized")){let h=new Mn(QTe.notInstalled);throw IS.getToken.info(Us(e,h)),h}if(d){let h=new Mn(QTe.login);throw IS.getToken.info(Us(e,h)),h}try{let h=l.stdout,m=this.parseRawResponse(h);return IS.getToken.info(e0(e)),m}catch(h){throw l.stderr?new Mn(l.stderr):h}}catch(c){let l=c.name==="CredentialUnavailableError"?c:new Mn(c.message||QTe.unknown);throw IS.getToken.info(Us(e,l)),l}})}parseRawResponse(e){let r=JSON.parse(e),n=r.accessToken,o=Number.parseInt(r.expires_on,10)*1e3;if(!isNaN(o))return IS.getToken.info("expires_on is available and is valid, using it"),{token:n,expiresOnTimestamp:o,tokenType:"Bearer"};if(o=new Date(r.expiresOn).getTime(),isNaN(o))throw new Mn(`${QTe.unexpectedResponse} "${r.expiresOn}"`);return{token:n,expiresOnTimestamp:o,tokenType:"Bearer"}}};p();p();var pun=de(require("node:child_process"),1),hun={execFile(t,e,r){return new Promise((n,o)=>{pun.default.execFile(t,e,r,(s,c,l)=>{Buffer.isBuffer(c)&&(c=c.toString("utf8")),Buffer.isBuffer(l)&&(l=l.toString("utf8")),l||s?o(l?new Error(l):s):n(c)})})}};var ZM=lo("AzurePowerShellCredential"),gun=process.platform==="win32";function Aun(t){return gun?`${t}.exe`:t}a(Aun,"formatCommand");async function mun(t,e){let r=[];for(let n of t){let[o,...s]=n,c=await hun.execFile(o,s,{encoding:"utf8",timeout:e});r.push(c)}return r}a(mun,"runCommands");var yun={login:"Run Connect-AzAccount to login",installed:"The specified module 'Az.Accounts' with version '2.2.0' was not loaded because no valid module file was found in any module directory"},A$e={login:"Please run 'Connect-AzAccount' from PowerShell to authenticate before using this credential.",installed:`The 'Az.Account' module >= 2.2.0 is not installed. Install the Azure Az PowerShell module with: "Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force".`,claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:",troubleshoot:"To troubleshoot, visit https://aka.ms/azsdk/js/identity/powershellcredential/troubleshoot."},wMo=a(t=>t.message.match(`(.*)${yun.login}(.*)`),"isLoginError"),RMo=a(t=>t.message.match(yun.installed),"isNotInstalledError"),WFt=[Aun("pwsh")];gun&&WFt.push(Aun("powershell"));var jTe=class{static{a(this,"AzurePowerShellCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(sg(ZM,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=Jf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getAzurePowerShellAccessToken(e,r,n){for(let o of[...WFt]){try{await mun([[o,"/?"]],n)}catch{WFt.shift();continue}let c=(await mun([[o,"-NoProfile","-NonInteractive","-Command",` + "AZURE_FEDERATED_TOKEN_FILE". See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`;throw iIe.info(n),new Mn(n)}return iIe.info("Invoking getToken() of Client Assertion Credential"),this.client.getToken(e,r)}async readFileContents(){if(this.cacheDate!==void 0&&Date.now()-this.cacheDate>=1e3*60*5&&(this.azureFederatedTokenFileContent=void 0),!this.federatedTokenFilePath)throw new Mn(`${jY}: is unavailable. Invalid file path provided ${this.federatedTokenFilePath}.`);if(!this.azureFederatedTokenFileContent){let r=(await(0,hdn.readFile)(this.federatedTokenFilePath,"utf8")).trim();if(r)this.azureFederatedTokenFileContent=r,this.cacheDate=Date.now();else throw new Mn(`${jY}: is unavailable. No content on the file ${this.federatedTokenFilePath}.`)}return this.azureFederatedTokenFileContent}};var mdn="ManagedIdentityCredential - Token Exchange",M5o=ao(mdn),g8t={name:"tokenExchangeMsi",async isAvailable(t){let e=process.env,r=!!((t||e.AZURE_CLIENT_ID)&&e.AZURE_TENANT_ID&&process.env.AZURE_FEDERATED_TOKEN_FILE);return r||M5o.info(`${mdn}: Unavailable. The environment variables needed are: AZURE_CLIENT_ID (or the client ID sent through the parameters), AZURE_TENANT_ID and AZURE_FEDERATED_TOKEN_FILE`),r},async getToken(t,e={}){let{scopes:r,clientId:n}=t,o={};return new T3({clientId:n,tenantId:process.env.AZURE_TENANT_ID,tokenFilePath:process.env.AZURE_FEDERATED_TOKEN_FILE,...o,disableInstanceDiscovery:!0}).getToken(r,e)}};var kS=ao("ManagedIdentityCredential"),vQ=class{static{a(this,"ManagedIdentityCredential")}managedIdentityApp;identityClient;clientId;resourceId;objectId;msiRetryConfig={maxRetries:5,startDelayInMs:800,intervalIncrement:2};isAvailableIdentityClient;sendProbeRequest;constructor(e,r){let n;typeof e=="string"?(this.clientId=e,n=r??{}):(this.clientId=e?.clientId,n=e??{}),this.resourceId=n?.resourceId,this.objectId=n?.objectId,this.sendProbeRequest=n?.sendProbeRequest??!1;let o=[{key:"clientId",value:this.clientId},{key:"resourceId",value:this.resourceId},{key:"objectId",value:this.objectId}].filter(c=>c.value);if(o.length>1)throw new Error(`ManagedIdentityCredential: only one of 'clientId', 'resourceId', or 'objectId' can be provided. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}`);n.allowInsecureConnection=!0,n.retryOptions?.maxRetries!==void 0&&(this.msiRetryConfig.maxRetries=n.retryOptions.maxRetries),this.identityClient=new AQ({...n,additionalPolicies:[{policy:ddn(this.msiRetryConfig),position:"perCall"}]}),this.managedIdentityApp=new Wce({managedIdentityIdParams:{userAssignedClientId:this.clientId,userAssignedResourceId:this.resourceId,userAssignedObjectId:this.objectId},system:{disableInternalRetries:!0,networkClient:this.identityClient,loggerOptions:{logLevel:$Ge(eHe()),piiLoggingEnabled:n.loggingOptions?.enableUnsafeSupportLogging,loggerCallback:GGe(kS)}}}),this.isAvailableIdentityClient=new AQ({...n,retryOptions:{maxRetries:0}});let s=this.managedIdentityApp.getManagedIdentitySource();if(s==="CloudShell"&&(this.clientId||this.resourceId||this.objectId))throw kS.warning(`CloudShell MSI detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Mn("ManagedIdentityCredential: Specifying a user-assigned managed identity is not supported for CloudShell at runtime. When using Managed Identity in CloudShell, omit the clientId, resourceId, and objectId parameters.");if(s==="ServiceFabric"&&(this.clientId||this.resourceId||this.objectId))throw kS.warning(`Service Fabric detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Mn(`ManagedIdentityCredential: ${Run}`);if(kS.info(`Using ${s} managed identity.`),o.length===1){let{key:c,value:l}=o[0];kS.info(`${s} with ${c}: ${l}`)}}async getToken(e,r={}){kS.getToken.info("Using the MSAL provider for Managed Identity.");let n=WTe(e);if(!n)throw new Mn(`ManagedIdentityCredential: Multiple scopes are not supported. Scopes: ${JSON.stringify(e)}`);return Bc.withSpan("ManagedIdentityCredential.getToken",r,async()=>{try{let o=await g8t.isAvailable(this.clientId),s=this.managedIdentityApp.getManagedIdentitySource(),c=s==="DefaultToImds"||s==="Imds";if(kS.getToken.info(`MSAL Identity source: ${s}`),o){kS.getToken.info("Using the token exchange managed identity.");let u=await g8t.getToken({scopes:e,clientId:this.clientId,identityClient:this.identityClient,retryConfig:this.msiRetryConfig,resourceId:this.resourceId});if(u===null)throw new Mn("Attempted to use the token exchange managed identity, but received a null response.");return u}else if(c&&this.sendProbeRequest&&(kS.getToken.info("Using the IMDS endpoint to probe for availability."),!await fdn.isAvailable({scopes:e,clientId:this.clientId,getTokenOptions:r,identityClient:this.isAvailableIdentityClient,resourceId:this.resourceId})))throw new Mn("Attempted to use the IMDS endpoint, but it is not available.");kS.getToken.info("Calling into MSAL for managed identity token.");let l=await this.managedIdentityApp.acquireToken({resource:n});return this.ensureValidMsalToken(e,l,r),kS.getToken.info(o0(e)),{expiresOnTimestamp:l.expiresOn.getTime(),token:l.accessToken,refreshAfterTimestamp:l.refreshOn?.getTime(),tokenType:"Bearer"}}catch(o){throw kS.getToken.error(Qs(e,o)),o.name==="AuthenticationRequiredError"?o:O5o(o)?new Mn(`ManagedIdentityCredential: Network unreachable. Message: ${o.message}`,{cause:o}):new Mn(`ManagedIdentityCredential: Authentication failed. Message ${o.message}`,{cause:o})}})}ensureValidMsalToken(e,r,n){let o=a(s=>(kS.getToken.info(s),new kx({scopes:Array.isArray(e)?e:[e],getTokenOptions:n,message:s})),"createError");if(!r)throw o("No response.");if(!r.expiresOn)throw o('Response had no "expiresOn" property.');if(!r.accessToken)throw o('Response had no "accessToken" property.')}};function O5o(t){return!!(t.errorCode==="network_error"||t.code==="ENETUNREACH"||t.code==="EHOSTUNREACH"||(t.statusCode===403||t.code===403)&&t.message.includes("unreachable"))}a(O5o,"isNetworkError");p();var gdn=fe(require("child_process"),1);var oO=ao("AzureDeveloperCliCredential"),j$e={notInstalled:"Azure Developer CLI couldn't be found. To mitigate this issue, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.",login:"Please run 'azd auth login' from a command prompt to authenticate before using this credential. For more information, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.",unknown:"Unknown error while trying to retrieve the access token",claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:"},Adn={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(oO.getToken.warning("The SystemRoot environment variable is not set. This may cause issues when using the Azure Developer CLI credential."),t="C:\\Windows"),t}else return"/bin"},async getAzdAccessToken(t,e,r,n){let o=[];e&&(o=["--tenant-id",e]);let s=[];return n&&(s=["--claims",btoa(n)]),new Promise((c,l)=>{try{let d=["azd",...["auth","token","--output","json","--no-prompt",...t.reduce((f,h)=>f.concat("--scope",h),[]),...o,...s]].join(" ");gdn.default.exec(d,{cwd:Adn.getSafeWorkingDir(),timeout:r},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},oIe=class{static{a(this,"AzureDeveloperCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(lg(oO,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=tp(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=bf(this.tenantId,r,this.additionallyAllowedTenantIds);n&&lg(oO,n);let o;return typeof e=="string"?o=[e]:o=e,oO.getToken.info(`Using the scopes ${e}`),Bc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{o.forEach(d=>{cle(d,oO)});let s=await Adn.getAzdAccessToken(o,n,this.timeout,r.claims),c=s.stderr?.match("must use multi-factor authentication")||s.stderr?.match("reauthentication required"),l=s.stderr?.match("not logged in, run `azd login` to login")||s.stderr?.match("not logged in, run `azd auth login` to login");if(s.stderr?.match("azd:(.*)not found")||s.stderr?.startsWith("'azd' is not recognized")||s.error&&s.error.code==="ENOENT"){let d=new Mn(j$e.notInstalled);throw oO.getToken.info(Qs(e,d)),d}if(l){let d=new Mn(j$e.login);throw oO.getToken.info(Qs(e,d)),d}if(c){let f=`azd auth login ${o.reduce((m,g)=>m.concat("--scope",g),[]).join(" ")}`,h=new Mn(`${j$e.claim} ${f}`);throw oO.getToken.info(Qs(e,h)),h}try{let d=JSON.parse(s.stdout);return oO.getToken.info(o0(e)),{token:d.token,expiresOnTimestamp:new Date(d.expiresOn).getTime(),tokenType:"Bearer"}}catch(d){throw s.stderr?new Mn(s.stderr):d}}catch(s){let c=s.name==="CredentialUnavailableError"?s:new Mn(s.message||j$e.unknown);throw oO.getToken.info(Qs(e,c)),c}})}};p();var ydn=fe(require("child_process"),1);p();function A8t(t,e){if(!e.match(/^[0-9a-zA-Z-._ ]+$/)){let r=new Error(`Subscription '${e}' contains invalid characters. If this is the name of a subscription, use its ID instead. You can locate your subscription by following the instructions listed here: https://learn.microsoft.com/azure/azure-portal/get-subscription-tenant-id`);throw t.info(Qs("",r)),r}}a(A8t,"checkSubscription");var PS=ao("AzureCliCredential"),sIe={claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:",notInstalled:"Azure CLI could not be found. Please visit https://aka.ms/azure-cli for installation instructions and then, once installed, authenticate to your Azure account using 'az login'.",login:"Please run 'az login' from a command prompt to authenticate before using this credential.",unknown:"Unknown error while trying to retrieve the access token",unexpectedResponse:'Unexpected response from Azure CLI when getting token. Expected "expiresOn" to be a RFC3339 date string. Got:'},Edn={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(PS.getToken.warning("The SystemRoot environment variable is not set. This may cause issues when using the Azure CLI credential."),t="C:\\Windows"),t}else return"/bin"},async getAzureCliAccessToken(t,e,r,n){let o=[],s=[];return e&&(o=["--tenant",e]),r&&(s=["--subscription",`"${r}"`]),new Promise((c,l)=>{try{let d=["az",...["account","get-access-token","--output","json","--resource",t,...o,...s]].join(" ");ydn.default.exec(d,{cwd:Edn.getSafeWorkingDir(),timeout:n},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},aIe=class{static{a(this,"AzureCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;subscription;constructor(e){e?.tenantId&&(lg(PS,e?.tenantId),this.tenantId=e?.tenantId),e?.subscription&&(A8t(PS,e?.subscription),this.subscription=e?.subscription),this.additionallyAllowedTenantIds=tp(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=typeof e=="string"?e:e[0],o=r.claims;if(o&&o.trim()){let l=`az login --claims-challenge ${btoa(o)} --scope ${n}`,u=r.tenantId;u&&(l+=` --tenant ${u}`);let d=new Mn(`${sIe.claim} ${l}`);throw PS.getToken.info(Qs(n,d)),d}let s=bf(this.tenantId,r,this.additionallyAllowedTenantIds);return s&&lg(PS,s),this.subscription&&A8t(PS,this.subscription),PS.getToken.info(`Using the scope ${n}`),Bc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{cle(n,PS);let c=Q$e(n),l=await Edn.getAzureCliAccessToken(c,s,this.subscription,this.timeout),u=l.stderr?.match("(.*)az login --scope(.*)"),d=l.stderr?.match("(.*)az login(.*)")&&!u;if(l.stderr?.match("az:(.*)not found")||l.stderr?.startsWith("'az' is not recognized")){let h=new Mn(sIe.notInstalled);throw PS.getToken.info(Qs(e,h)),h}if(d){let h=new Mn(sIe.login);throw PS.getToken.info(Qs(e,h)),h}try{let h=l.stdout,m=this.parseRawResponse(h);return PS.getToken.info(o0(e)),m}catch(h){throw l.stderr?new Mn(l.stderr):h}}catch(c){let l=c.name==="CredentialUnavailableError"?c:new Mn(c.message||sIe.unknown);throw PS.getToken.info(Qs(e,l)),l}})}parseRawResponse(e){let r=JSON.parse(e),n=r.accessToken,o=Number.parseInt(r.expires_on,10)*1e3;if(!isNaN(o))return PS.getToken.info("expires_on is available and is valid, using it"),{token:n,expiresOnTimestamp:o,tokenType:"Bearer"};if(o=new Date(r.expiresOn).getTime(),isNaN(o))throw new Mn(`${sIe.unexpectedResponse} "${r.expiresOn}"`);return{token:n,expiresOnTimestamp:o,tokenType:"Bearer"}}};p();p();var _dn=fe(require("node:child_process"),1),vdn={execFile(t,e,r){return new Promise((n,o)=>{_dn.default.execFile(t,e,r,(s,c,l)=>{Buffer.isBuffer(c)&&(c=c.toString("utf8")),Buffer.isBuffer(l)&&(l=l.toString("utf8")),l||s?o(l?new Error(l):s):n(c)})})}};var sO=ao("AzurePowerShellCredential"),bdn=process.platform==="win32";function Sdn(t){return bdn?`${t}.exe`:t}a(Sdn,"formatCommand");async function Cdn(t,e){let r=[];for(let n of t){let[o,...s]=n,c=await vdn.execFile(o,s,{encoding:"utf8",timeout:e});r.push(c)}return r}a(Cdn,"runCommands");var Tdn={login:"Run Connect-AzAccount to login",installed:"The specified module 'Az.Accounts' with version '2.2.0' was not loaded because no valid module file was found in any module directory"},H$e={login:"Please run 'Connect-AzAccount' from PowerShell to authenticate before using this credential.",installed:`The 'Az.Account' module >= 2.2.0 is not installed. Install the Azure Az PowerShell module with: "Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force".`,claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:",troubleshoot:"To troubleshoot, visit https://aka.ms/azsdk/js/identity/powershellcredential/troubleshoot."},L5o=a(t=>t.message.match(`(.*)${Tdn.login}(.*)`),"isLoginError"),B5o=a(t=>t.message.match(Tdn.installed),"isNotInstalledError"),y8t=[Sdn("pwsh")];bdn&&y8t.push(Sdn("powershell"));var cIe=class{static{a(this,"AzurePowerShellCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(lg(sO,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=tp(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getAzurePowerShellAccessToken(e,r,n){for(let o of[...y8t]){try{await Cdn([[o,"/?"]],n)}catch{y8t.shift();continue}let c=(await Cdn([[o,"-NoProfile","-NonInteractive","-Command",` $tenantId = "${r??""}" $m = Import-Module Az.Accounts -MinimumVersion 2.2.0 -PassThru $useSecureString = $m.Version -ge [version]'2.17.0' -and $m.Version -lt [version]'5.0.0' @@ -1755,26 +1755,26 @@ Error Description: '${s.message}'`,this.correlationId)}return null}return n||(th } Write-Output (ConvertTo-Json $result) - `]]))[0];return kMo(c)}throw new Error("Unable to execute PowerShell. Ensure that it is installed in your system")}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{let n=typeof e=="string"?e:e[0],o=r.claims;if(o&&o.trim()){let l=`Connect-AzAccount -ClaimsChallenge ${btoa(o)}`,u=r.tenantId;u&&(l+=` -Tenant ${u}`);let d=new Mn(`${A$e.claim} ${l}`);throw ZM.getToken.info(Us(n,d)),d}let s=yf(this.tenantId,r,this.additionallyAllowedTenantIds);s&&sg(ZM,s);try{ele(n,ZM),ZM.getToken.info(`Using the scope ${n}`);let c=h$e(n),l=await this.getAzurePowerShellAccessToken(c,s,this.timeout);return ZM.getToken.info(e0(e)),{token:l.Token,expiresOnTimestamp:new Date(l.ExpiresOn).getTime(),tokenType:"Bearer"}}catch(c){if(RMo(c)){let u=new Mn(A$e.installed);throw ZM.getToken.info(Us(n,u)),u}else if(wMo(c)){let u=new Mn(A$e.login);throw ZM.getToken.info(Us(n,u)),u}let l=new Mn(`${c}. ${A$e.troubleshoot}`);throw ZM.getToken.info(Us(n,l)),l}})}};async function kMo(t){let e=/{[^{}]*}/g,r=t.match(e),n=t;if(r)try{for(let o of r)try{let s=JSON.parse(o);if(s?.Token)return n=n.replace(o,""),n&&ZM.getToken.warning(n),s}catch{continue}}catch{throw new Error(`Unable to parse the output of PowerShell. Received output: ${t}`)}throw new Error(`No access token found in the output. Received output: ${t}`)}a(kMo,"parseJsonToken");p();var Eun=require("node:fs/promises");var PMo="common",DMo="aebc6443-996d-45c2-90f0-388ff96faa56",zFt=lo("VisualStudioCodeCredential"),NMo={adfs:"The VisualStudioCodeCredential does not support authentication with ADFS tenants."};function MMo(t){let e=NMo[t];if(e)throw new Mn(e)}a(MMo,"checkUnsupportedTenant");var HTe=class{static{a(this,"VisualStudioCodeCredential")}tenantId;additionallyAllowedTenantIds;msalClient;options;constructor(e){this.options=e||{},e&&e.tenantId?(sg(zFt,e.tenantId),this.tenantId=e.tenantId):this.tenantId=PMo,this.additionallyAllowedTenantIds=Jf(e?.additionallyAllowedTenants),MMo(this.tenantId)}async prepare(e){let r=yf(this.tenantId,this.options,this.additionallyAllowedTenantIds,zFt)||this.tenantId;if(!jtn()||!Cje)throw new Mn("Visual Studio Code Authentication is not available. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.");let n=await this.loadAuthRecord(Cje,e);this.msalClient=tE(DMo,r,{...this.options,isVSCodeCredential:!0,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0},authenticationRecord:n})}preparePromise;prepareOnce(e){return this.preparePromise||(this.preparePromise=this.prepare(e)),this.preparePromise}async getToken(e,r){let n=Mx(e);if(await this.prepareOnce(n),!this.msalClient)throw new Mn("Visual Studio Code Authentication failed to initialize. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.");return this.msalClient.getTokenByInteractiveRequest(n,{...r,disableAutomaticAuthentication:!0})}async loadAuthRecord(e,r){try{let n=await(0,Eun.readFile)(e,{encoding:"utf8"});return C3t(n)}catch(n){throw zFt.getToken.info(Us(r,n)),new Mn("Cannot load authentication record in Visual Studio Code. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.")}}};p();var y$e=lo("BrokerCredential"),E$e=class{static{a(this,"BrokerCredential")}brokerMsalClient;brokerTenantId;brokerAdditionallyAllowedTenantIds;constructor(e){this.brokerTenantId=Jce(y$e,e.tenantId),this.brokerAdditionallyAllowedTenantIds=Jf(e?.additionallyAllowedTenants);let r={...e,tokenCredentialOptions:e,logger:y$e,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0}};this.brokerMsalClient=tE(Xz,this.brokerTenantId,r)}async getToken(e,r={}){return Mc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=yf(this.brokerTenantId,n,this.brokerAdditionallyAllowedTenantIds,y$e);let o=Mx(e);try{return this.brokerMsalClient.getBrokeredToken(o,!0,{...n,disableAutomaticAuthentication:!0})}catch(s){throw y$e.getToken.info(Us(o,s)),new Mn("Failed to acquire token using broker authentication",{cause:s})}})}};function _un(t={}){return new E$e(t)}a(_un,"createDefaultBrokerCredential");function YFt(t={}){return new HTe(t)}a(YFt,"createDefaultVisualStudioCodeCredential");function KFt(t={}){t.retryOptions??={maxRetries:5,retryDelayInMs:800},t.sendProbeRequest??=!0;let e=t?.managedIdentityClientId??process.env.AZURE_CLIENT_ID,r=t?.workloadIdentityClientId??e,n=t?.managedIdentityResourceId,o=process.env.AZURE_FEDERATED_TOKEN_FILE,s=t?.tenantId??process.env.AZURE_TENANT_ID;if(n){let c={...t,resourceId:n};return new dQ(c)}if(o&&r){let c={...t,tenantId:s};return new dQ(r,c)}if(e){let c={...t,clientId:e};return new dQ(c)}return new dQ(t)}a(KFt,"createDefaultManagedIdentityCredential");function JFt(t){let e=t?.managedIdentityClientId??process.env.AZURE_CLIENT_ID,r=t?.workloadIdentityClientId??e,n=process.env.AZURE_FEDERATED_TOKEN_FILE,o=t?.tenantId??process.env.AZURE_TENANT_ID;if(n&&r){let s={...t,tenantId:o,clientId:r,tokenFilePath:n};return new E3(s)}if(o){let s={...t,tenantId:o};return new E3(s)}return new E3(t)}a(JFt,"createDefaultWorkloadIdentityCredential");function ZFt(t={}){return new UTe(t)}a(ZFt,"createDefaultAzureDeveloperCliCredential");function XFt(t={}){return new qTe(t)}a(XFt,"createDefaultAzureCliCredential");function e8t(t={}){return new jTe(t)}a(e8t,"createDefaultAzurePowershellCredential");function t8t(t={}){return new BTe(t)}a(t8t,"createDefaultEnvironmentCredential");var _$e=lo("DefaultAzureCredential"),r8t=class{static{a(this,"UnavailableDefaultCredential")}credentialUnavailableErrorMessage;credentialName;constructor(e,r){this.credentialName=e,this.credentialUnavailableErrorMessage=r}getToken(){return _$e.getToken.info(`Skipping ${this.credentialName}, reason: ${this.credentialUnavailableErrorMessage}`),Promise.resolve(null)}},rle=class extends fSe{static{a(this,"DefaultAzureCredential")}constructor(e){OMo(e);let r=process.env.AZURE_TOKEN_CREDENTIALS?process.env.AZURE_TOKEN_CREDENTIALS.trim().toLowerCase():void 0,n=[YFt,XFt,e8t,ZFt,_un],o=[t8t,JFt,KFt],s=[],c="EnvironmentCredential, WorkloadIdentityCredential, ManagedIdentityCredential, VisualStudioCodeCredential, AzureCliCredential, AzurePowerShellCredential, AzureDeveloperCliCredential";if(r)switch(r){case"dev":s=n;break;case"prod":s=o;break;case"environmentcredential":s=[t8t];break;case"workloadidentitycredential":s=[JFt];break;case"managedidentitycredential":s=[()=>KFt({sendProbeRequest:!1})];break;case"visualstudiocodecredential":s=[YFt];break;case"azureclicredential":s=[XFt];break;case"azurepowershellcredential":s=[e8t];break;case"azuredeveloperclicredential":s=[ZFt];break;default:{let u=`Invalid value for AZURE_TOKEN_CREDENTIALS = ${process.env.AZURE_TOKEN_CREDENTIALS}. Valid values are 'prod' or 'dev' or any of these credentials - ${c}.`;throw _$e.warning(u),new Error(u)}}else s=[...o,...n];let l=s.map(u=>{try{return u(e??{})}catch(d){return _$e.warning(`Skipped ${u.name} because of an error creating the credential: ${d}`),new r8t(u.name,d.message)}});super(...l)}};function OMo(t){if(t?.requiredEnvVars){let r=(Array.isArray(t.requiredEnvVars)?t.requiredEnvVars:[t.requiredEnvVars]).filter(n=>!process.env[n]);if(r.length>0){let n=`Required environment ${r.length===1?"variable":"variables"} '${r.join(", ")}' for DefaultAzureCredential ${r.length===1?"is":"are"} not set or empty.`;throw _$e.warning(n),new Error(n)}}}a(OMo,"validateRequiredEnvVars");p();var ICu=lo("InteractiveBrowserCredential");p();var LCu=lo("DeviceCodeCredential");p();var LMo="AzurePipelinesCredential",VCu=lo(LMo);p();var rbu=lo("AuthorizationCodeCredential");p();var BMo="OnBehalfOfCredential",fbu=lo(BMo);p();var v$e=new fe("capiFetchUtilities");function i0(t){let e={...Gy(t),"X-GitHub-Api-Version":"2026-06-01"},r=S$e(t.get(Ir));return r&&(e["Copilot-Integration-Id"]=r),e}a(i0,"getCapiHeaders");function vun(t,e){return v$e.debug(t,"Using CES proxy mode for msbench"),{...e,"ces-proxy-target":VW.api,"Copilot-Integration-Id":"autodev-test"}}a(vun,"addMsBenchCesProxyHeaders");async function Cun(t,e){let r=process.env.INTEGRATION_ID_FOR_HMAC_SECRET;v$e.info(t,"Using HMAC authentication mode for msbench with integration id",r);let n=await Ntn(process.env.HMAC_SECRET,r);return{...e,...n}}a(Cun,"addMsBenchHmacHeaders");function FMo(){return CB()&&!!process.env.HMAC_SECRET}a(FMo,"isMsBenchHmacModeEnabled");function n8t(){return CB()&&!process.env.HMAC_SECRET}a(n8t,"isMsBenchCesProxyModeEnabled");async function C$e(t,e){return process.env.HMAC_SECRET?await Cun(t,e):vun(t,e)}a(C$e,"addMsBenchHeaders");async function nle(t,e,r){let n=r;n8t()&&(n=await UMo());let o={...e,Authorization:`Bearer ${n}`};return{headers:FMo()?await Cun(t,o):n8t()?vun(t,o):o,token:n}}a(nle,"applyMsBenchAuth");function ile(t,e,...r){if(n8t()){v$e.debug(t,"Using CES proxy endpoint for URL generation");let n=r.join("/");return n.startsWith("/")&&(n=n.slice(1)),`https://ces-dev1.azurewebsites.net/api/proxy/${n}`}return tx(t,e,"api",...r)}a(ile,"getCapiUrl");function ole(t,e,r){(e.status===401||e.status===403)&&(v$e.debug(t,"CAPI auth error encountered",{status:e.status,path:r}),t.get(Qt).resetToken("capi_fetch",e.status))}a(ole,"handleCapiAuthError");async function PY(t,e,r){r??=await t.get(Qt).getToken();let n=ile(t,r,e),{headers:o}=await nle(t,i0(t),r.token),s=await t.get(tr).fetch(new URL(n).href,{method:"GET",headers:o});return ole(t,s,e),s}a(PY,"fetchCapiUrl");async function b$e(t,e,r){let n=await t.get(Qt).getToken(),o=ile(t,n,e),{headers:s}=await nle(t,i0(t),n.token),c=await t.get(tr).fetch(new URL(o).href,{method:"POST",headers:s,body:r});return ole(t,c,e),c}a(b$e,"postCapiUrl");async function UMo(){let e=await new rle().getToken("api://17b0ad65-ed36-4194-bb27-059c567bc41f/.default");if(!e)throw new Error("Failed to retrieve access token");return e.token}a(UMo,"getMsBenchToken");p();var Sun=600*1e3,Rn={Gpt35turbo:"gpt-3.5-turbo",Gpt4:"gpt-4",Gpt4turbo:"gpt-4-turbo",Gpt4o:"gpt-4o",Gpt4oMini:"gpt-4o-mini",O1Mini:"o1-mini",O1Ga:"o1-ga",Claude35Sonnet:"claude-3.5-sonnet",O3Mini:"o3-mini",Gemini20Flash:"gemini-2.0-flash",Gemini20Pro:"gemini-2.0-pro",Claude37Sonnet:"claude-3.7-sonnet",Claude37SonnetThought:"claude-3.7-sonnet-thought",Gpt45:"gpt-4.5",Gpt41:"gpt-4.1",Gpt5:"gpt-5",Gpt5Mini:"gpt-5-mini",Gpt5CodeX:"gpt-5-codex",Gpt51:"gpt-5.1",Gpt51CodeX:"gpt-5.1-codex",Gpt51CodeXMini:"gpt-5.1-codex-mini",Gpt52:"gpt-5.2",Gpt54Mini:"gpt-5.4-mini",ClaudeHaiku45:"claude-haiku-4.5",Gemini3Flash:"gemini-3-flash",CopilotBase:"copilot-base",BYOK:"byok",Unknown:"unknown"},x$e={ChatCompletions:"/chat/completions",Responses:"/responses",Messages:"/v1/messages"},sle=new Set([Rn.O1Ga,Rn.O3Mini,Rn.O1Mini,Rn.Gemini20Pro,Rn.Gemini20Flash]);function w$e(t){return t.startsWith("claude")}a(w$e,"isClaudeFamily");function xS(t,e=!1){let r;switch(t){case"user":case"inline":e?r=[Rn.Gpt4o]:r=[Rn.Gpt4o,Rn.Gpt4turbo,Rn.Gpt4,Rn.O1Mini,Rn.O1Ga,Rn.Claude35Sonnet,Rn.O3Mini,Rn.Gemini20Flash,Rn.Claude37Sonnet,Rn.Claude37SonnetThought,Rn.Gpt45,Rn.Gpt41,Rn.CopilotBase];break;case"meta":case"suggestions":case"synonyms":e?r=[Rn.Gpt4oMini]:r=[Rn.Gpt4oMini,Rn.Gpt4o,Rn.Gpt35turbo,Rn.Gpt41,Rn.CopilotBase];break;case"gitCommit":e?r=[Rn.Gpt4oMini]:r=[Rn.Gpt4oMini,Rn.Gpt4o,Rn.Gpt4,Rn.Gpt41,Rn.CopilotBase];break;case"nesStubs":e?r=[Rn.Gpt4oMini]:r=[Rn.Gpt4oMini,Rn.Gpt4o,Rn.Gpt41,Rn.CopilotBase];break;case"codeMapper":r=[Rn.Gpt41]}return r}a(xS,"getSupportedModelFamiliesForPrompt");var Tun={textEmbedding3Small:"text-embedding-3-small"},QMo=S.Object({type:S.Union([S.Literal("chat"),S.Literal("embeddings"),S.Literal("completion")]),tokenizer:S.String(),family:S.String(),object:S.String(),supports:S.Optional(S.Object({tool_calls:S.Optional(S.Boolean()),parallel_tool_calls:S.Optional(S.Boolean()),streaming:S.Optional(S.Boolean()),vision:S.Optional(S.Boolean()),adaptive_thinking:S.Optional(S.Boolean()),reasoning_effort:S.Optional(S.Array(S.String()))})),limits:S.Optional(S.Object({max_inputs:S.Optional(S.Number()),max_prompt_tokens:S.Optional(S.Number()),max_output_tokens:S.Optional(S.Number()),max_non_streaming_output_tokens:S.Optional(S.Number()),max_context_window_tokens:S.Optional(S.Number())}))}),bun=S.Object({cache_price:S.Optional(S.Number()),input_price:S.Optional(S.Number()),output_price:S.Optional(S.Number()),context_max:S.Optional(S.Number())}),qMo=S.Object({id:S.String(),vendor:S.Optional(S.String()),name:S.String(),version:S.String(),model_picker_enabled:S.Boolean(),model_picker_category:S.Optional(S.String()),model_picker_price_category:S.Optional(S.String()),is_chat_default:S.Optional(S.Boolean()),is_chat_fallback:S.Optional(S.Boolean()),capabilities:QMo,billing:S.Optional(S.Object({is_premium:S.Optional(S.Boolean()),multiplier:S.Optional(S.Number()),token_prices:S.Optional(S.Object({batch_size:S.Optional(S.Number()),default:S.Optional(bun),long_context:S.Optional(bun)}))})),custom_model:S.Optional(S.Object({key_name:S.Optional(S.String()),owner_name:S.Optional(S.String()),owner_type:S.Optional(S.String()),provider:S.Optional(S.String())})),object:S.String(),preview:S.Optional(S.Boolean()),isExperimental:S.Optional(S.Boolean()),policy:S.Optional(S.Object({state:S.String(),terms:S.String()})),supported_endpoints:S.Optional(S.Array(S.String())),warning_messages:S.Optional(S.Array(S.Object({message:S.String()}))),info_messages:S.Optional(S.Array(S.Object({message:S.String()})))}),Iun=S.Object({data:S.Array(qMo)});function xun(t){return t.warning_messages?.at(0)?.message??t.info_messages?.at(0)?.message}a(xun,"getDegradationReason");var xs=class{static{a(this,"ModelMetadataProvider")}},T$e=class extends xs{constructor(r){super();this.ctx=r;this._metadata=[];this._lastFetchTime=0;this._xGithubRequestId=void 0;this.allowTokenRefresh=a(()=>{this._lastFetchTime=0},"allowTokenRefresh");r.get(Qt).onDidResetToken(this.allowTokenRefresh)}static{a(this,"CapiModelMetadataProvider")}async getMetadata(r){return(r||this.shouldRefreshModels())&&await this.fetchMetadata(),this._metadata.slice()}async getModelMetadataList(){return this.shouldRefreshModels()&&await this.fetchMetadata(),{models:this._metadata.slice(),xGithubRequestId:this._xGithubRequestId}}async getFallbackModel(){return(await this.getMetadata()).find(n=>n.is_chat_fallback)}async fetchMetadata(){let r=await PY(this.ctx,"/models");if(this._xGithubRequestId=r.headers.get("X-GitHub-Request-Id")??void 0,r.status<200||r.status>=300){if(r.status===429&&this._metadata.length>0){Nr.error(this.ctx,"Rate limited while fetching models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId});return}throw Nr.error(this.ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId}),new aM(r)}await this.processModels(r)}async fetchModel(r){let n=await PY(this.ctx,`/models/${r}`);if(!n.ok){Nr.error(this.ctx,`Failed to fetch model ${r} from CAPI`,{status:n.status,statusText:n.statusText,xGithubRequestId:this._xGithubRequestId});return}return await n.json()}async acceptModelPolicy(r){return(await b$e(this.ctx,`/models/${r}/policy`,JSON.stringify({status:"enabled"}))).ok?(await this.fetchMetadata(),!0):!1}async processModels(r){try{let n=await r.json();this._metadata=n.data,this._lastFetchTime=Date.now()}catch(n){Nr.error(this.ctx,"Failed to parse models from CAPI",{error:n})}}shouldRefreshModels(){return this._metadata.length===0||!this._lastFetchTime?!0:this.isLastFetchOlderTenMinutes()}isLastFetchOlderTenMinutes(){return Date.now()-this._lastFetchTime>Sun}},I$e=class extends xs{constructor(r,n){super();this.ctx=r;this.delegate=n;this._exp_models_cache=new Map}static{a(this,"ExpModelMetadataProvider")}async getMetadata(r){let n=this.ctx.get(Zt),o=await n.fetchTokenAndUpdateExPValuesAndAssignments(),s=n.ideChatExpModelIds(o),c=[];if(s){let l=s?.split(",");for(let u of l){let d=await this.fetchModel(u.trim());d!==void 0&&(d.isExperimental=!0,c.push(d))}}return c.concat(await this.delegate.getMetadata(r))}async getModelMetadataList(){return this.delegate.getModelMetadataList()}async fetchModel(r){let n=this._exp_models_cache.get(r);if(n){let[s,c]=n;if(Date.now()-c0?e:null}a(wun,"getUserSelectedModelConfiguration");p();p();p();var fQ=class extends Error{constructor(r,n){super(r,{cause:n});this.code="CopilotPromptLoadFailure"}static{a(this,"CopilotPromptLoadFailure")}};p();p();var Run=de(require("node:fs/promises")),R$e=de(require("node:path"));async function k$e(t){return await Run.readFile(GTe(t))}a(k$e,"readFile");function GTe(t){return R$e.default.resolve(R$e.default.extname(__filename)!==".ts"?__dirname:R$e.default.resolve(__dirname,"../../dist"),t)}a(GTe,"locateFile");var i8t=de(require("node:fs")),$Te=de(require("node:path"));function Pun(){let t=$Te.join("compiled",process.platform,process.arch,"copilot-tokenizer.node"),e=[$Te.join(__dirname,t),$Te.join(__dirname,"../../../packages/copilot-tokenizer",t)],r=[];for(let n of e)try{return{binding:require(n)}}catch(o){r.push(`${n}: ${o instanceof Error?o.message:String(o)}`)}return{error:new Error(`could not load copilot-tokenizer.node: + `]]))[0];return F5o(c)}throw new Error("Unable to execute PowerShell. Ensure that it is installed in your system")}async getToken(e,r={}){return Bc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{let n=typeof e=="string"?e:e[0],o=r.claims;if(o&&o.trim()){let l=`Connect-AzAccount -ClaimsChallenge ${btoa(o)}`,u=r.tenantId;u&&(l+=` -Tenant ${u}`);let d=new Mn(`${H$e.claim} ${l}`);throw sO.getToken.info(Qs(n,d)),d}let s=bf(this.tenantId,r,this.additionallyAllowedTenantIds);s&&lg(sO,s);try{cle(n,sO),sO.getToken.info(`Using the scope ${n}`);let c=Q$e(n),l=await this.getAzurePowerShellAccessToken(c,s,this.timeout);return sO.getToken.info(o0(e)),{token:l.Token,expiresOnTimestamp:new Date(l.ExpiresOn).getTime(),tokenType:"Bearer"}}catch(c){if(B5o(c)){let u=new Mn(H$e.installed);throw sO.getToken.info(Qs(n,u)),u}else if(L5o(c)){let u=new Mn(H$e.login);throw sO.getToken.info(Qs(n,u)),u}let l=new Mn(`${c}. ${H$e.troubleshoot}`);throw sO.getToken.info(Qs(n,l)),l}})}};async function F5o(t){let e=/{[^{}]*}/g,r=t.match(e),n=t;if(r)try{for(let o of r)try{let s=JSON.parse(o);if(s?.Token)return n=n.replace(o,""),n&&sO.getToken.warning(n),s}catch{continue}}catch{throw new Error(`Unable to parse the output of PowerShell. Received output: ${t}`)}throw new Error(`No access token found in the output. Received output: ${t}`)}a(F5o,"parseJsonToken");p();var Idn=require("node:fs/promises");var U5o="common",Q5o="aebc6443-996d-45c2-90f0-388ff96faa56",E8t=ao("VisualStudioCodeCredential"),q5o={adfs:"The VisualStudioCodeCredential does not support authentication with ADFS tenants."};function j5o(t){let e=q5o[t];if(e)throw new Mn(e)}a(j5o,"checkUnsupportedTenant");var lIe=class{static{a(this,"VisualStudioCodeCredential")}tenantId;additionallyAllowedTenantIds;msalClient;options;constructor(e){this.options=e||{},e&&e.tenantId?(lg(E8t,e.tenantId),this.tenantId=e.tenantId):this.tenantId=U5o,this.additionallyAllowedTenantIds=tp(e?.additionallyAllowedTenants),j5o(this.tenantId)}async prepare(e){let r=bf(this.tenantId,this.options,this.additionallyAllowedTenantIds,E8t)||this.tenantId;if(!zrn()||!zje)throw new Mn("Visual Studio Code Authentication is not available. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.");let n=await this.loadAuthRecord(zje,e);this.msalClient=oE(Q5o,r,{...this.options,isVSCodeCredential:!0,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0},authenticationRecord:n})}preparePromise;prepareOnce(e){return this.preparePromise||(this.preparePromise=this.prepare(e)),this.preparePromise}async getToken(e,r){let n=qx(e);if(await this.prepareOnce(n),!this.msalClient)throw new Mn("Visual Studio Code Authentication failed to initialize. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.");return this.msalClient.getTokenByInteractiveRequest(n,{...r,disableAutomaticAuthentication:!0})}async loadAuthRecord(e,r){try{let n=await(0,Idn.readFile)(e,{encoding:"utf8"});return W3t(n)}catch(n){throw E8t.getToken.info(Qs(r,n)),new Mn("Cannot load authentication record in Visual Studio Code. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.")}}};p();var G$e=ao("BrokerCredential"),$$e=class{static{a(this,"BrokerCredential")}brokerMsalClient;brokerTenantId;brokerAdditionallyAllowedTenantIds;constructor(e){this.brokerTenantId=ole(G$e,e.tenantId),this.brokerAdditionallyAllowedTenantIds=tp(e?.additionallyAllowedTenants);let r={...e,tokenCredentialOptions:e,logger:G$e,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0}};this.brokerMsalClient=oE(dY,this.brokerTenantId,r)}async getToken(e,r={}){return Bc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=bf(this.brokerTenantId,n,this.brokerAdditionallyAllowedTenantIds,G$e);let o=qx(e);try{return this.brokerMsalClient.getBrokeredToken(o,!0,{...n,disableAutomaticAuthentication:!0})}catch(s){throw G$e.getToken.info(Qs(o,s)),new Mn("Failed to acquire token using broker authentication",{cause:s})}})}};function xdn(t={}){return new $$e(t)}a(xdn,"createDefaultBrokerCredential");function _8t(t={}){return new lIe(t)}a(_8t,"createDefaultVisualStudioCodeCredential");function v8t(t={}){t.retryOptions??={maxRetries:5,retryDelayInMs:800},t.sendProbeRequest??=!0;let e=t?.managedIdentityClientId??process.env.AZURE_CLIENT_ID,r=t?.workloadIdentityClientId??e,n=t?.managedIdentityResourceId,o=process.env.AZURE_FEDERATED_TOKEN_FILE,s=t?.tenantId??process.env.AZURE_TENANT_ID;if(n){let c={...t,resourceId:n};return new vQ(c)}if(o&&r){let c={...t,tenantId:s};return new vQ(r,c)}if(e){let c={...t,clientId:e};return new vQ(c)}return new vQ(t)}a(v8t,"createDefaultManagedIdentityCredential");function C8t(t){let e=t?.managedIdentityClientId??process.env.AZURE_CLIENT_ID,r=t?.workloadIdentityClientId??e,n=process.env.AZURE_FEDERATED_TOKEN_FILE,o=t?.tenantId??process.env.AZURE_TENANT_ID;if(n&&r){let s={...t,tenantId:o,clientId:r,tokenFilePath:n};return new T3(s)}if(o){let s={...t,tenantId:o};return new T3(s)}return new T3(t)}a(C8t,"createDefaultWorkloadIdentityCredential");function b8t(t={}){return new oIe(t)}a(b8t,"createDefaultAzureDeveloperCliCredential");function S8t(t={}){return new aIe(t)}a(S8t,"createDefaultAzureCliCredential");function T8t(t={}){return new cIe(t)}a(T8t,"createDefaultAzurePowershellCredential");function I8t(t={}){return new nIe(t)}a(I8t,"createDefaultEnvironmentCredential");var V$e=ao("DefaultAzureCredential"),x8t=class{static{a(this,"UnavailableDefaultCredential")}credentialUnavailableErrorMessage;credentialName;constructor(e,r){this.credentialName=e,this.credentialUnavailableErrorMessage=r}getToken(){return V$e.getToken.info(`Skipping ${this.credentialName}, reason: ${this.credentialUnavailableErrorMessage}`),Promise.resolve(null)}},ule=class extends DSe{static{a(this,"DefaultAzureCredential")}constructor(e){H5o(e);let r=process.env.AZURE_TOKEN_CREDENTIALS?process.env.AZURE_TOKEN_CREDENTIALS.trim().toLowerCase():void 0,n=[_8t,S8t,T8t,b8t,xdn],o=[I8t,C8t,v8t],s=[],c="EnvironmentCredential, WorkloadIdentityCredential, ManagedIdentityCredential, VisualStudioCodeCredential, AzureCliCredential, AzurePowerShellCredential, AzureDeveloperCliCredential";if(r)switch(r){case"dev":s=n;break;case"prod":s=o;break;case"environmentcredential":s=[I8t];break;case"workloadidentitycredential":s=[C8t];break;case"managedidentitycredential":s=[()=>v8t({sendProbeRequest:!1})];break;case"visualstudiocodecredential":s=[_8t];break;case"azureclicredential":s=[S8t];break;case"azurepowershellcredential":s=[T8t];break;case"azuredeveloperclicredential":s=[b8t];break;default:{let u=`Invalid value for AZURE_TOKEN_CREDENTIALS = ${process.env.AZURE_TOKEN_CREDENTIALS}. Valid values are 'prod' or 'dev' or any of these credentials - ${c}.`;throw V$e.warning(u),new Error(u)}}else s=[...o,...n];let l=s.map(u=>{try{return u(e??{})}catch(d){return V$e.warning(`Skipped ${u.name} because of an error creating the credential: ${d}`),new x8t(u.name,d.message)}});super(...l)}};function H5o(t){if(t?.requiredEnvVars){let r=(Array.isArray(t.requiredEnvVars)?t.requiredEnvVars:[t.requiredEnvVars]).filter(n=>!process.env[n]);if(r.length>0){let n=`Required environment ${r.length===1?"variable":"variables"} '${r.join(", ")}' for DefaultAzureCredential ${r.length===1?"is":"are"} not set or empty.`;throw V$e.warning(n),new Error(n)}}}a(H5o,"validateRequiredEnvVars");p();var PSu=ao("InteractiveBrowserCredential");p();var qSu=ao("DeviceCodeCredential");p();var G5o="AzurePipelinesCredential",JSu=ao(G5o);p();var aTu=ao("AuthorizationCodeCredential");p();var $5o="OnBehalfOfCredential",ATu=ao($5o);p();var W$e=new pe("capiFetchUtilities");function Vh(t){let e={...zy(t),"X-GitHub-Api-Version":"2026-06-01"},r=K$e(t.get(Ir));return r&&(e["Copilot-Integration-Id"]=r),e}a(Vh,"getCapiHeaders");function wdn(t,e){return W$e.debug(t,"Using CES proxy mode for msbench"),{...e,"ces-proxy-target":iz.api,"Copilot-Integration-Id":"autodev-test"}}a(wdn,"addMsBenchCesProxyHeaders");async function Rdn(t,e){let r=process.env.INTEGRATION_ID_FOR_HMAC_SECRET;W$e.info(t,"Using HMAC authentication mode for msbench with integration id",r);let n=await Urn(process.env.HMAC_SECRET,r);return{...e,...n}}a(Rdn,"addMsBenchHmacHeaders");function V5o(){return wB()&&!!process.env.HMAC_SECRET}a(V5o,"isMsBenchHmacModeEnabled");function w8t(){return wB()&&!process.env.HMAC_SECRET}a(w8t,"isMsBenchCesProxyModeEnabled");async function z$e(t,e){return process.env.HMAC_SECRET?await Rdn(t,e):wdn(t,e)}a(z$e,"addMsBenchHeaders");async function dle(t,e,r){let n=r;w8t()&&(n=await W5o());let o={...e,Authorization:`Bearer ${n}`};return{headers:V5o()?await Rdn(t,o):w8t()?wdn(t,o):o,token:n}}a(dle,"applyMsBenchAuth");function fle(t,e,...r){if(w8t()){W$e.debug(t,"Using CES proxy endpoint for URL generation");let n=r.join("/");return n.startsWith("/")&&(n=n.slice(1)),`https://ces-dev1.azurewebsites.net/api/proxy/${n}`}return ux(t,e,"api",...r)}a(fle,"getCapiUrl");function ple(t,e,r){(e.status===401||e.status===403)&&(W$e.debug(t,"CAPI auth error encountered",{status:e.status,path:r}),t.get(Ft).resetToken("capi_fetch",e.status))}a(ple,"handleCapiAuthError");async function HY(t,e,r){r??=await t.get(Ft).getToken();let n=fle(t,r,e),{headers:o}=await dle(t,Vh(t),r.token),s=await t.get(nr).fetch(new URL(n).href,{method:"GET",headers:o});return ple(t,s,e),s}a(HY,"fetchCapiUrl");async function Y$e(t,e,r){let n=await t.get(Ft).getToken(),o=fle(t,n,e),{headers:s}=await dle(t,Vh(t),n.token),c=await t.get(nr).fetch(new URL(o).href,{method:"POST",headers:s,body:r});return ple(t,c,e),c}a(Y$e,"postCapiUrl");async function W5o(){let e=await new ule().getToken("api://17b0ad65-ed36-4194-bb27-059c567bc41f/.default");if(!e)throw new Error("Failed to retrieve access token");return e.token}a(W5o,"getMsBenchToken");p();var Pdn=600*1e3,wn={Gpt35turbo:"gpt-3.5-turbo",Gpt4:"gpt-4",Gpt4turbo:"gpt-4-turbo",Gpt4o:"gpt-4o",Gpt4oMini:"gpt-4o-mini",O1Mini:"o1-mini",O1Ga:"o1-ga",Claude35Sonnet:"claude-3.5-sonnet",O3Mini:"o3-mini",Gemini20Flash:"gemini-2.0-flash",Gemini20Pro:"gemini-2.0-pro",Claude37Sonnet:"claude-3.7-sonnet",Claude37SonnetThought:"claude-3.7-sonnet-thought",Gpt45:"gpt-4.5",Gpt41:"gpt-4.1",Gpt5:"gpt-5",Gpt5Mini:"gpt-5-mini",Gpt5CodeX:"gpt-5-codex",Gpt51:"gpt-5.1",Gpt51CodeX:"gpt-5.1-codex",Gpt51CodeXMini:"gpt-5.1-codex-mini",Gpt52:"gpt-5.2",Gpt54Mini:"gpt-5.4-mini",ClaudeHaiku45:"claude-haiku-4.5",Gemini3Flash:"gemini-3-flash",CopilotBase:"copilot-base",BYOK:"byok",Unknown:"unknown"},X$e={ChatCompletions:"/chat/completions",Responses:"/responses",Messages:"/v1/messages"},hle=new Set([wn.O1Ga,wn.O3Mini,wn.O1Mini,wn.Gemini20Pro,wn.Gemini20Flash]);function eVe(t){return t.startsWith("claude")}a(eVe,"isClaudeFamily");function DS(t,e=!1){let r;switch(t){case"user":case"inline":e?r=[wn.Gpt4o]:r=[wn.Gpt4o,wn.Gpt4turbo,wn.Gpt4,wn.O1Mini,wn.O1Ga,wn.Claude35Sonnet,wn.O3Mini,wn.Gemini20Flash,wn.Claude37Sonnet,wn.Claude37SonnetThought,wn.Gpt45,wn.Gpt41,wn.CopilotBase];break;case"meta":case"suggestions":case"synonyms":e?r=[wn.Gpt4oMini]:r=[wn.Gpt4oMini,wn.Gpt4o,wn.Gpt35turbo,wn.Gpt41,wn.CopilotBase];break;case"gitCommit":e?r=[wn.Gpt4oMini]:r=[wn.Gpt4oMini,wn.Gpt4o,wn.Gpt4,wn.Gpt41,wn.CopilotBase];break;case"nesStubs":e?r=[wn.Gpt4oMini]:r=[wn.Gpt4oMini,wn.Gpt4o,wn.Gpt41,wn.CopilotBase];break;case"codeMapper":r=[wn.Gpt41]}return r}a(DS,"getSupportedModelFamiliesForPrompt");var Ddn={textEmbedding3Small:"text-embedding-3-small"},z5o=S.Object({type:S.Union([S.Literal("chat"),S.Literal("embeddings"),S.Literal("completion")]),tokenizer:S.String(),family:S.String(),object:S.String(),supports:S.Optional(S.Object({tool_calls:S.Optional(S.Boolean()),parallel_tool_calls:S.Optional(S.Boolean()),streaming:S.Optional(S.Boolean()),vision:S.Optional(S.Boolean()),adaptive_thinking:S.Optional(S.Boolean()),reasoning_effort:S.Optional(S.Array(S.String()))})),limits:S.Optional(S.Object({max_inputs:S.Optional(S.Number()),max_prompt_tokens:S.Optional(S.Number()),max_output_tokens:S.Optional(S.Number()),max_non_streaming_output_tokens:S.Optional(S.Number()),max_context_window_tokens:S.Optional(S.Number())}))}),kdn=S.Object({cache_price:S.Optional(S.Number()),input_price:S.Optional(S.Number()),output_price:S.Optional(S.Number()),context_max:S.Optional(S.Number())}),Y5o=S.Object({id:S.String(),vendor:S.Optional(S.String()),name:S.String(),version:S.String(),model_picker_enabled:S.Boolean(),model_picker_category:S.Optional(S.String()),model_picker_price_category:S.Optional(S.String()),is_chat_default:S.Optional(S.Boolean()),is_chat_fallback:S.Optional(S.Boolean()),capabilities:z5o,billing:S.Optional(S.Object({is_premium:S.Optional(S.Boolean()),multiplier:S.Optional(S.Number()),token_prices:S.Optional(S.Object({batch_size:S.Optional(S.Number()),default:S.Optional(kdn),long_context:S.Optional(kdn)}))})),custom_model:S.Optional(S.Object({key_name:S.Optional(S.String()),owner_name:S.Optional(S.String()),owner_type:S.Optional(S.String()),provider:S.Optional(S.String())})),object:S.String(),preview:S.Optional(S.Boolean()),isExperimental:S.Optional(S.Boolean()),policy:S.Optional(S.Object({state:S.String(),terms:S.String()})),supported_endpoints:S.Optional(S.Array(S.String())),warning_messages:S.Optional(S.Array(S.Object({message:S.String()}))),info_messages:S.Optional(S.Array(S.Object({message:S.String()})))}),Ndn=S.Object({data:S.Array(Y5o)});function Mdn(t){return t.warning_messages?.at(0)?.message??t.info_messages?.at(0)?.message}a(Mdn,"getDegradationReason");var xs=class{static{a(this,"ModelMetadataProvider")}},J$e=class extends xs{constructor(r){super();this.ctx=r;this._metadata=[];this._lastFetchTime=0;this._xGithubRequestId=void 0;this.allowTokenRefresh=a(()=>{this._lastFetchTime=0},"allowTokenRefresh");r.get(Ft).onDidResetToken(this.allowTokenRefresh)}static{a(this,"CapiModelMetadataProvider")}async getMetadata(r){return(r||this.shouldRefreshModels())&&await this.fetchMetadata(),this._metadata.slice()}async getModelMetadataList(){return this.shouldRefreshModels()&&await this.fetchMetadata(),{models:this._metadata.slice(),xGithubRequestId:this._xGithubRequestId}}async getFallbackModel(){return(await this.getMetadata()).find(n=>n.is_chat_fallback)}async fetchMetadata(){let r=await HY(this.ctx,"/models");if(this._xGithubRequestId=r.headers.get("X-GitHub-Request-Id")??void 0,r.status<200||r.status>=300){if(r.status===429&&this._metadata.length>0){Nr.error(this.ctx,"Rate limited while fetching models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId});return}throw Nr.error(this.ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId}),new cx(r)}await this.processModels(r)}async fetchModel(r){let n=await HY(this.ctx,`/models/${r}`);if(!n.ok){Nr.error(this.ctx,`Failed to fetch model ${r} from CAPI`,{status:n.status,statusText:n.statusText,xGithubRequestId:this._xGithubRequestId});return}return await n.json()}async acceptModelPolicy(r){return(await Y$e(this.ctx,`/models/${r}/policy`,JSON.stringify({status:"enabled"}))).ok?(await this.fetchMetadata(),!0):!1}async processModels(r){try{let n=await r.json();this._metadata=n.data,this._lastFetchTime=Date.now()}catch(n){Nr.error(this.ctx,"Failed to parse models from CAPI",{error:n})}}shouldRefreshModels(){return this._metadata.length===0||!this._lastFetchTime?!0:this.isLastFetchOlderTenMinutes()}isLastFetchOlderTenMinutes(){return Date.now()-this._lastFetchTime>Pdn}},Z$e=class extends xs{constructor(r,n){super();this.ctx=r;this.delegate=n;this._exp_models_cache=new Map}static{a(this,"ExpModelMetadataProvider")}async getMetadata(r){let n=this.ctx.get(Jt),o=await n.fetchTokenAndUpdateExPValuesAndAssignments(),s=n.ideChatExpModelIds(o),c=[];if(s){let l=s?.split(",");for(let u of l){let d=await this.fetchModel(u.trim());d!==void 0&&(d.isExperimental=!0,c.push(d))}}return c.concat(await this.delegate.getMetadata(r))}async getModelMetadataList(){return this.delegate.getModelMetadataList()}async fetchModel(r){let n=this._exp_models_cache.get(r);if(n){let[s,c]=n;if(Date.now()-c0?e:null}a(Odn,"getUserSelectedModelConfiguration");p();p();p();var CQ=class extends Error{constructor(r,n){super(r,{cause:n});this.code="CopilotPromptLoadFailure"}static{a(this,"CopilotPromptLoadFailure")}};p();p();var Ldn=fe(require("node:fs/promises")),tVe=fe(require("node:path"));async function rVe(t){return await Ldn.readFile(uIe(t))}a(rVe,"readFile");function uIe(t){return tVe.default.resolve(tVe.default.extname(__filename)!==".ts"?__dirname:tVe.default.resolve(__dirname,"../../dist"),t)}a(uIe,"locateFile");var R8t=fe(require("node:fs")),dIe=fe(require("node:path"));function Fdn(){let t=dIe.join("compiled",process.platform,process.arch,"copilot-tokenizer.node"),e=[dIe.join(__dirname,t),dIe.join(__dirname,"../../../packages/copilot-tokenizer",t)],r=[];for(let n of e)try{return{binding:require(n)}}catch(o){r.push(`${n}: ${o instanceof Error?o.message:String(o)}`)}return{error:new Error(`could not load copilot-tokenizer.node: ${r.join(` -`)}`)}}a(Pun,"loadNativeTokenizer");var kun=new Set;function jMo(t){return[GTe(`resources/${t}.tiktoken.noindex`),$Te.join(__dirname,"resources",`${t}.tiktoken.noindex`)]}a(jMo,"vocabularyCandidates");async function Dun(t,e){if(!kun.has(e)){if(!t.tokenEncoderInitialized(e)){let r=await i8t.promises.readFile(await HMo(e));t.tokenInitEncoder(e,r)}kun.add(e)}}a(Dun,"initializeEncoderAsync");async function HMo(t){let e=jMo(t);for(let r of e)try{return await i8t.promises.access(r),r}catch{}throw new Error(`vocabulary for "${t}" not found at ${e.join(" or ")}`)}a(HMo,"firstExistingVocabulary");var D$e=new Map;function ws(t="o200k_base"){c8t(t);let e=D$e.get(t);return e!==void 0?e:GMo(t)}a(ws,"getTokenizer");var Nun=new Map;function GMo(t){let e=Nun.get(t);if(!e){let r=new pQ(t),n=a(()=>D$e.get(t)??r,"current");e={tokenLength:a(o=>n().tokenLength(o),"tokenLength"),tokenize:a(o=>n().tokenize(o),"tokenize"),detokenize:a(o=>n().detokenize(o),"detokenize"),tokenizeStrings:a(o=>n().tokenizeStrings(o),"tokenizeStrings"),takeLastTokens:a((o,s)=>n().takeLastTokens(o,s),"takeLastTokens"),takeFirstTokens:a((o,s)=>n().takeFirstTokens(o,s),"takeFirstTokens"),takeLastLinesTokens:a((o,s)=>n().takeLastLinesTokens(o,s),"takeLastLinesTokens")},Nun.set(t,e)}return e}a(GMo,"getUpgradingTokenizer");async function hQ(t="o200k_base"){return await c8t(t),ws(t)}a(hQ,"getTokenizerAsync");var P$e=Pun(),s8t=class t{constructor(e,r){this._binding=e;this._encoder=r}static{a(this,"TTokenizer")}static async create(e){if(e!=="cl100k_base"&&e!=="o200k_base")throw new fQ("Could not load tokenizer",new Error(`unsupported encoder ${e}`));if(P$e.error)throw new fQ("Could not load tokenizer",P$e.error);try{return await Dun(P$e.binding,e),new t(P$e.binding,e)}catch(r){throw r instanceof Error?new fQ("Could not load tokenizer",r):r}}tokenize(e){return this._binding.tokenEncode(e,this._encoder)}encode(e,r){return r!==void 0&&r.length>0?this._binding.tokenEncodeWithSpecial(e,this._encoder,[...r]):this._binding.tokenEncode(e,this._encoder)}detokenize(e){return this._binding.tokenDecode(e,this._encoder)}tokenLength(e){return this._binding.tokenCount(e,this._encoder)}tokenizeStrings(e){return this._binding.tokenEncodeStrings(e,this._encoder)}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=4,o=1,s=Math.min(e.length,r*n),c=e.slice(-s),l=this.tokenize(c);for(;l.lengthiVe.get(t)??r,"current");e={tokenLength:a(o=>n().tokenLength(o),"tokenLength"),tokenize:a(o=>n().tokenize(o),"tokenize"),detokenize:a(o=>n().detokenize(o),"detokenize"),tokenizeStrings:a(o=>n().tokenizeStrings(o),"tokenizeStrings"),takeLastTokens:a((o,s)=>n().takeLastTokens(o,s),"takeLastTokens"),takeFirstTokens:a((o,s)=>n().takeFirstTokens(o,s),"takeFirstTokens"),takeLastLinesTokens:a((o,s)=>n().takeLastLinesTokens(o,s),"takeLastLinesTokens")},Qdn.set(t,e)}return e}a(Z5o,"getUpgradingTokenizer");async function SQ(t="o200k_base"){return await N8t(t),ws(t)}a(SQ,"getTokenizerAsync");var nVe=Fdn(),P8t=class t{constructor(e,r){this._binding=e;this._encoder=r}static{a(this,"TTokenizer")}static async create(e){if(e!=="cl100k_base"&&e!=="o200k_base")throw new CQ("Could not load tokenizer",new Error(`unsupported encoder ${e}`));if(nVe.error)throw new CQ("Could not load tokenizer",nVe.error);try{return await Udn(nVe.binding,e),new t(nVe.binding,e)}catch(r){throw r instanceof Error?new CQ("Could not load tokenizer",r):r}}tokenize(e){return this._binding.tokenEncode(e,this._encoder)}encode(e,r){return r!==void 0&&r.length>0?this._binding.tokenEncodeWithSpecial(e,this._encoder,[...r]):this._binding.tokenEncode(e,this._encoder)}detokenize(e){return this._binding.tokenDecode(e,this._encoder)}tokenLength(e){return this._binding.tokenCount(e,this._encoder)}tokenizeStrings(e){return this._binding.tokenEncodeStrings(e,this._encoder)}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=4,o=1,s=Math.min(e.length,r*n),c=e.slice(-s),l=this.tokenize(c);for(;l.length{let r=0;for(let n=0;nr.toString()).join(" ")}tokenizeStrings(e){return e.split(/\b/)}tokenLength(e){return this.tokenizeStrings(e).length}takeLastTokens(e,r){let n=this.tokenizeStrings(e).slice(-r);return{text:n.join(""),tokens:n.map(this.hash)}}takeFirstTokens(e,r){let n=this.tokenizeStrings(e).slice(0,r);return{text:n.join(""),tokens:n.map(this.hash)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` +`);return n.substring(o+1)}},D8t=class{constructor(){this.hash=a(e=>{let r=0;for(let n=0;nr.toString()).join(" ")}tokenizeStrings(e){return e.split(/\b/)}tokenLength(e){return this.tokenizeStrings(e).length}takeLastTokens(e,r){let n=this.tokenizeStrings(e).slice(-r);return{text:n.join(""),tokens:n.map(this.hash)}}takeFirstTokens(e,r){let n=this.tokenizeStrings(e).slice(0,r);return{text:n.join(""),tokens:n.map(this.hash)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` `)return n;let o=n.indexOf(` -`);return n.substring(o+1)}},$Mo={cl100k_base:{python:3.99,typescript:4.54,typescriptreact:4.58,javascript:4.76,csharp:5.13,java:4.86,cpp:3.85,php:4.1,html:4.57,vue:4.22,go:3.93,dart:5.66,javascriptreact:4.81,css:3.37},o200k_base:{python:4.05,typescript:4.12,typescriptreact:5.01,javascript:4.47,csharp:5.47,java:4.86,cpp:3.8,php:4.35,html:4.86,vue:4.3,go:4.21,dart:5.7,javascriptreact:4.83,css:3.33}},o8t=4,pQ=class{constructor(e="o200k_base",r){this.languageId=r;this.tokenizerName=e}static{a(this,"ApproximateTokenizer")}tokenize(e){return this.tokenizeStrings(e).map(r=>{let n=0;for(let o=0;o{let n=[],o=r.toString();for(;o.length>0;){let s=o.slice(-o8t),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-o8t)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?$Mo[this.tokenizerName]?.[this.languageId]??4:4}tokenLength(e){return Math.ceil(e.length/this.getEffectiveTokenLength())}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(-Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeFirstTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(0,Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` +`);return n.substring(o+1)}},X5o={cl100k_base:{python:3.99,typescript:4.54,typescriptreact:4.58,javascript:4.76,csharp:5.13,java:4.86,cpp:3.85,php:4.1,html:4.57,vue:4.22,go:3.93,dart:5.66,javascriptreact:4.81,css:3.37},o200k_base:{python:4.05,typescript:4.12,typescriptreact:5.01,javascript:4.47,csharp:5.47,java:4.86,cpp:3.8,php:4.35,html:4.86,vue:4.3,go:4.21,dart:5.7,javascriptreact:4.83,css:3.33}},k8t=4,bQ=class{constructor(e="o200k_base",r){this.languageId=r;this.tokenizerName=e}static{a(this,"ApproximateTokenizer")}tokenize(e){return this.tokenizeStrings(e).map(r=>{let n=0;for(let o=0;o{let n=[],o=r.toString();for(;o.length>0;){let s=o.slice(-k8t),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-k8t)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?X5o[this.tokenizerName]?.[this.languageId]??4:4}tokenLength(e){return Math.ceil(e.length/this.getEffectiveTokenLength())}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(-Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeFirstTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(0,Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` `)return n;let o=n.indexOf(` -`);return n.substring(o+1)}};async function VMo(t){try{let e=await s8t.create(t);D$e.set(t,e)}catch(e){console.error(`[tokenizer] failed to load ${t}, using approximate token counts: ${String(e)}`)}}a(VMo,"setTokenizer");var Mun=new Map,Oun=!1;function c8t(t="o200k_base"){if(Oun||(Oun=!0,D$e.set("mock",new a8t)),t==="mock")return Promise.resolve();let e=Mun.get(t);return e||(e=VMo(t).catch(()=>{}),Mun.set(t,e)),e}a(c8t,"_ensureLoaded");async function Lun(t){let e=t==="cl100k_base"?"cl100k_base":t==="o200k_base"||t===void 0?"o200k_base":void 0;e&&await c8t(e)}a(Lun,"ensureNativeTokenizersLoaded");p();p();var WMo=function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},Uun=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},l8t,N$e,Qun,u8t=class extends qi{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),l8t.add(this),N$e.set(this,void 0),WMo(this,N$e,e,"f"),this.error=r}Errors(){return new SU(Uun(this,l8t,"m",Qun).call(this))}};N$e=new WeakMap,l8t=new WeakSet,Qun=a(function*(){this.error&&(yield this.error),yield*Uun(this,N$e,"f")},"_AssertError_Iterator");function Fun(t,e,r){if(!es(t,e,r))throw new u8t(nM(t,e,r))}a(Fun,"AssertValue");function M$e(...t){return t.length===3?Fun(t[0],t[1],t[2]):Fun(t[0],[],t[1])}a(M$e,"Assert");p();p();p();function zMo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=ja(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=ja(t[r]);return e}a(zMo,"FromObject");function YMo(t){return t.map(e=>ja(e))}a(YMo,"FromArray");function KMo(t){return t.slice()}a(KMo,"FromTypedArray");function JMo(t){return new Map(ja([...t.entries()]))}a(JMo,"FromMap");function ZMo(t){return new Set(ja([...t.entries()]))}a(ZMo,"FromSet");function XMo(t){return new Date(t.toISOString())}a(XMo,"FromDate");function ja(t){if(Pi(t))return YMo(t);if(__(t))return XMo(t);if(qI(t))return KMo(t);if(TGr(t))return JMo(t);if(IGr(t))return ZMo(t);if(bo(t))return zMo(t);if(B1(t))return t;throw new Error("ValueClone: Unable to clone value")}a(ja,"Clone");var wS=class extends qi{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};function Ha(t){return pU(t)?t():ja(t)}a(Ha,"FromDefault");function eOo(t,e){return Qi(t,"default")?Ha(t.default):{}}a(eOo,"FromAny");function tOo(t,e){return{}}a(tOo,"FromArgument");function rOo(t,e){if(t.uniqueItems===!0&&!Qi(t,"default"))throw new wS(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!Qi(t,"default"))throw new wS(t,"Array with the contains constraint requires a default value");return"default"in t?Ha(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>RS(t.items,e)):[]}a(rOo,"FromArray");function nOo(t,e){return Qi(t,"default")?Ha(t.default):(async function*(){})()}a(nOo,"FromAsyncIterator");function iOo(t,e){return Qi(t,"default")?Ha(t.default):BigInt(0)}a(iOo,"FromBigInt");function oOo(t,e){return Qi(t,"default")?Ha(t.default):!1}a(oOo,"FromBoolean");function sOo(t,e){if(Qi(t,"default"))return Ha(t.default);{let r=RS(t.returns,e);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,o]of Object.entries(r)){let s=this;s[n]=o}}}:class{}}}a(sOo,"FromConstructor");function aOo(t,e){return Qi(t,"default")?Ha(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(aOo,"FromDate");function cOo(t,e){return Qi(t,"default")?Ha(t.default):()=>RS(t.returns,e)}a(cOo,"FromFunction");function lOo(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return RS(n,[...e,...r])}a(lOo,"FromImport");function uOo(t,e){return Qi(t,"default")?Ha(t.default):t.minimum!==void 0?t.minimum:0}a(uOo,"FromInteger");function dOo(t,e){if(Qi(t,"default"))return Ha(t.default);{let r=t.allOf.reduce((n,o)=>{let s=RS(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!es(t,e,r))throw new wS(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(dOo,"FromIntersect");function fOo(t,e){return Qi(t,"default")?Ha(t.default):(function*(){})()}a(fOo,"FromIterator");function pOo(t,e){return Qi(t,"default")?Ha(t.default):t.const}a(pOo,"FromLiteral");function hOo(t,e){if(Qi(t,"default"))return Ha(t.default);throw new wS(t,"Never types cannot be created. Consider using a default value.")}a(hOo,"FromNever");function mOo(t,e){if(Qi(t,"default"))return Ha(t.default);throw new wS(t,"Not types must have a default value")}a(mOo,"FromNot");function gOo(t,e){return Qi(t,"default")?Ha(t.default):null}a(gOo,"FromNull");function AOo(t,e){return Qi(t,"default")?Ha(t.default):t.minimum!==void 0?t.minimum:0}a(AOo,"FromNumber");function yOo(t,e){if(Qi(t,"default"))return Ha(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=RS(s,e));return n}}a(yOo,"FromObject");function EOo(t,e){return Qi(t,"default")?Ha(t.default):Promise.resolve(RS(t.item,e))}a(EOo,"FromPromise");function _Oo(t,e){return Qi(t,"default")?Ha(t.default):{}}a(_Oo,"FromRecord");function vOo(t,e){return Qi(t,"default")?Ha(t.default):RS(Ia(t,e),e)}a(vOo,"FromRef");function COo(t,e){if(Qi(t,"default"))return Ha(t.default);throw new wS(t,"RegExp types cannot be created. Consider using a default value.")}a(COo,"FromRegExp");function bOo(t,e){if(t.pattern!==void 0){if(Qi(t,"default"))return Ha(t.default);throw new wS(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if(Qi(t,"default"))return Ha(t.default);throw new wS(t,"String types with formats must specify a default value")}else return Qi(t,"default")?Ha(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(bOo,"FromString");function SOo(t,e){return Qi(t,"default")?Ha(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(SOo,"FromSymbol");function TOo(t,e){if(Qi(t,"default"))return Ha(t.default);if(!K9e(t))throw new wS(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return Loe(t)[0]}a(TOo,"FromTemplateLiteral");function IOo(t,e){if(qun++>MOo)throw new wS(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Qi(t,"default")?Ha(t.default):RS(Ia(t,e),e)}a(IOo,"FromThis");function xOo(t,e){return Qi(t,"default")?Ha(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>RS(t.items[n],e))}a(xOo,"FromTuple");function wOo(t,e){if(Qi(t,"default"))return Ha(t.default)}a(wOo,"FromUndefined");function ROo(t,e){if(Qi(t,"default"))return Ha(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return RS(t.anyOf[0],e)}a(ROo,"FromUnion");function kOo(t,e){return Qi(t,"default")?Ha(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(kOo,"FromUint8Array");function POo(t,e){return Qi(t,"default")?Ha(t.default):{}}a(POo,"FromUnknown");function DOo(t,e){if(Qi(t,"default"))return Ha(t.default)}a(DOo,"FromVoid");function NOo(t,e){if(Qi(t,"default"))return Ha(t.default);throw new Error("User defined types must specify a default value")}a(NOo,"FromKind");function RS(t,e){let r=Y0(t,e),n=t;switch(n[Tt]){case"Any":return eOo(n,r);case"Argument":return tOo(n,r);case"Array":return rOo(n,r);case"AsyncIterator":return nOo(n,r);case"BigInt":return iOo(n,r);case"Boolean":return oOo(n,r);case"Constructor":return sOo(n,r);case"Date":return aOo(n,r);case"Function":return cOo(n,r);case"Import":return lOo(n,r);case"Integer":return uOo(n,r);case"Intersect":return dOo(n,r);case"Iterator":return fOo(n,r);case"Literal":return pOo(n,r);case"Never":return hOo(n,r);case"Not":return mOo(n,r);case"Null":return gOo(n,r);case"Number":return AOo(n,r);case"Object":return yOo(n,r);case"Promise":return EOo(n,r);case"Record":return _Oo(n,r);case"Ref":return vOo(n,r);case"RegExp":return COo(n,r);case"String":return bOo(n,r);case"Symbol":return SOo(n,r);case"TemplateLiteral":return TOo(n,r);case"This":return IOo(n,r);case"Tuple":return xOo(n,r);case"Undefined":return wOo(n,r);case"Union":return ROo(n,r);case"Uint8Array":return kOo(n,r);case"Unknown":return POo(n,r);case"Void":return DOo(n,r);default:if(!v_.Has(n[Tt]))throw new wS(n,"Unknown type");return NOo(n,r)}}a(RS,"Visit");var MOo=512,qun=0;function vP(...t){return qun=0,t.length===2?RS(t[0],t[1]):RS(t[0],[])}a(vP,"Create");var O$e=class extends qi{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};function jun(t,e,r){if(t[Tt]==="Object"&&typeof r=="object"&&!cB(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[Tt]==="Literal"&&u.const===r[l]?100:0,f=es(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[Tt]==="Union"){let o=t.anyOf.map(s=>Ia(s,e)).map(s=>jun(s,e,r));return Math.max(...o)}else return es(t,e,r)?1:0}a(jun,"ScoreUnion");function OOo(t,e,r){let n=t.anyOf.map(c=>Ia(c,e)),[o,s]=[n[0],0];for(let c of n){let l=jun(c,e,r);l>s&&(o=c,s=l)}return o}a(OOo,"SelectUnion");function LOo(t,e,r){if("default"in t)return typeof r=="function"?t.default:ja(t.default);{let n=OOo(t,e,r);return VTe(n,e,r)}}a(LOo,"CastUnion");function BOo(t,e,r){return es(t,e,r)?ja(r):vP(t,e)}a(BOo,"DefaultClone");function FOo(t,e,r){return es(t,e,r)?r:vP(t,e)}a(FOo,"Default");function UOo(t,e,r){if(es(t,e,r))return ja(r);let n=Pi(r)?ja(r):vP(t,e),o=ai(t.minItems)&&n.lengthnull)]:n,c=(ai(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>CP(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!es(t,e,l))throw new O$e(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(UOo,"FromArray");function QOo(t,e,r){if(es(t,e,r))return vP(t,e);let n=new Set(t.returns.required||[]),o=a(function(){},"result");for(let[s,c]of Object.entries(t.returns.properties))!n.has(s)&&r.prototype[s]===void 0||(o.prototype[s]=CP(c,e,r.prototype[s]));return o}a(QOo,"FromConstructor");function qOo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return CP(o,[...e,...n],r)}a(qOo,"FromImport");function Hun(t,e){return bo(t)&&!bo(e)||!bo(t)&&bo(e)?t:!bo(t)||!bo(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?Hun(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(Hun,"IntersectAssign");function jOo(t,e,r){if(es(t,e,r))return r;let n=vP(t,e),o=Hun(n,r);return es(t,e,o)?o:n}a(jOo,"FromIntersect");function HOo(t,e,r){throw new O$e(t,"Never types cannot be cast")}a(HOo,"FromNever");function GOo(t,e,r){if(es(t,e,r))return r;if(r===null||typeof r!="object")return vP(t,e);let n=new Set(t.required||[]),o={};for(let[s,c]of Object.entries(t.properties))!n.has(s)&&r[s]===void 0||(o[s]=CP(c,e,r[s]));if(typeof t.additionalProperties=="object"){let s=Object.getOwnPropertyNames(t.properties);for(let c of Object.getOwnPropertyNames(r))s.includes(c)||(o[c]=CP(t.additionalProperties,e,r[c]))}return o}a(GOo,"FromObject");function $Oo(t,e,r){if(es(t,e,r))return ja(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return vP(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=CP(o,e,l);return s}a($Oo,"FromRecord");function VOo(t,e,r){return CP(Ia(t,e),e,r)}a(VOo,"FromRef");function WOo(t,e,r){return CP(Ia(t,e),e,r)}a(WOo,"FromThis");function zOo(t,e,r){return es(t,e,r)?ja(r):Pi(r)?t.items===void 0?[]:t.items.map((n,o)=>CP(n,e,r[o])):vP(t,e)}a(zOo,"FromTuple");function YOo(t,e,r){return es(t,e,r)?ja(r):LOo(t,e,r)}a(YOo,"FromUnion");function CP(t,e,r){let n=Sa(t.$id)?Y0(t,e):e,o=t;switch(t[Tt]){case"Array":return UOo(o,n,r);case"Constructor":return QOo(o,n,r);case"Import":return qOo(o,n,r);case"Intersect":return jOo(o,n,r);case"Never":return HOo(o,n,r);case"Object":return GOo(o,n,r);case"Record":return $Oo(o,n,r);case"Ref":return VOo(o,n,r);case"This":return WOo(o,n,r);case"Tuple":return zOo(o,n,r);case"Union":return YOo(o,n,r);case"Date":case"Symbol":case"Uint8Array":return BOo(t,e,r);default:return FOo(o,n,r)}}a(CP,"Visit");function VTe(...t){return t.length===3?CP(t[0],t[1],t[2]):CP(t[0],[],t[1])}a(VTe,"Cast");p();function KOo(t){return mU(t)&&t[Tt]!=="Unsafe"}a(KOo,"IsCheckable");function JOo(t,e,r){return Pi(r)?r.map(n=>wC(t.items,e,n)):r}a(JOo,"FromArray");function ZOo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return wC(o,[...e,...n],r)}a(ZOo,"FromImport");function XOo(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>wC(l,e,ja(r))).reduce((l,u)=>bo(u)?{...l,...u}:u,{});if(!bo(r)||!bo(s)||!mU(n))return s;let c=aC(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||es(n,e,r[l])&&(s[l]=wC(n,e,r[l]));return s}a(XOo,"FromIntersect");function e5o(t,e,r){if(!bo(r)||Pi(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(Qi(t.properties,o)){r[o]=wC(t.properties[o],e,r[o]);continue}if(mU(n)&&es(n,e,r[o])){r[o]=wC(n,e,r[o]);continue}delete r[o]}return r}a(e5o,"FromObject");function t5o(t,e,r){if(!bo(r))return r;let n=t.additionalProperties,o=Object.getOwnPropertyNames(r),[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of o){if(l.test(u)){r[u]=wC(c,e,r[u]);continue}if(mU(n)&&es(n,e,r[u])){r[u]=wC(n,e,r[u]);continue}delete r[u]}return r}a(t5o,"FromRecord");function r5o(t,e,r){return wC(Ia(t,e),e,r)}a(r5o,"FromRef");function n5o(t,e,r){return wC(Ia(t,e),e,r)}a(n5o,"FromThis");function i5o(t,e,r){if(!Pi(r))return r;if(Fu(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(i5o,"FromTuple");function o5o(t,e,r){for(let n of t.anyOf)if(KOo(n)&&es(n,e,r))return wC(n,e,r);return r}a(o5o,"FromUnion");function wC(t,e,r){let n=Sa(t.$id)?Y0(t,e):e,o=t;switch(o[Tt]){case"Array":return JOo(o,n,r);case"Import":return ZOo(o,n,r);case"Intersect":return XOo(o,n,r);case"Object":return e5o(o,n,r);case"Record":return t5o(o,n,r);case"Ref":return r5o(o,n,r);case"This":return n5o(o,n,r);case"Tuple":return i5o(o,n,r);case"Union":return o5o(o,n,r);default:return r}}a(wC,"Visit");function L$e(...t){return t.length===3?wC(t[0],t[1],t[2]):wC(t[0],[],t[1])}a(L$e,"Clean");p();function B$e(t){return Sa(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(B$e,"IsStringNumeric");function s5o(t){return pA(t)||eM(t)||ai(t)}a(s5o,"IsValueToString");function WTe(t){return t===!0||ai(t)&&t===1||pA(t)&&t===BigInt("1")||Sa(t)&&(t.toLowerCase()==="true"||t==="1")}a(WTe,"IsValueTrue");function zTe(t){return t===!1||ai(t)&&(t===0||Object.is(t,-0))||pA(t)&&t===BigInt("0")||Sa(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(zTe,"IsValueFalse");function a5o(t){return Sa(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(a5o,"IsTimeStringWithTimeZone");function c5o(t){return Sa(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(c5o,"IsTimeStringWithoutTimeZone");function l5o(t){return Sa(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(l5o,"IsDateTimeStringWithTimeZone");function u5o(t){return Sa(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(u5o,"IsDateTimeStringWithoutTimeZone");function d5o(t){return Sa(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(d5o,"IsDateString");function f5o(t,e){let r=$un(t);return r===e?r:t}a(f5o,"TryConvertLiteralString");function p5o(t,e){let r=Vun(t);return r===e?r:t}a(p5o,"TryConvertLiteralNumber");function h5o(t,e){let r=Gun(t);return r===e?r:t}a(h5o,"TryConvertLiteralBoolean");function m5o(t,e){return Sa(t.const)?f5o(e,t.const):ai(t.const)?p5o(e,t.const):eM(t.const)?h5o(e,t.const):e}a(m5o,"TryConvertLiteral");function Gun(t){return WTe(t)?!0:zTe(t)?!1:t}a(Gun,"TryConvertBoolean");function g5o(t){let e=a(r=>r.split(".")[0],"truncateInteger");return B$e(t)?BigInt(e(t)):ai(t)?BigInt(Math.trunc(t)):zTe(t)?BigInt(0):WTe(t)?BigInt(1):t}a(g5o,"TryConvertBigInt");function $un(t){return lB(t)&&t.description!==void 0?t.description.toString():s5o(t)?t.toString():t}a($un,"TryConvertString");function Vun(t){return B$e(t)?parseFloat(t):WTe(t)?1:zTe(t)?0:t}a(Vun,"TryConvertNumber");function A5o(t){return B$e(t)?parseInt(t):ai(t)?Math.trunc(t):WTe(t)?1:zTe(t)?0:t}a(A5o,"TryConvertInteger");function y5o(t){return Sa(t)&&t.toLowerCase()==="null"?null:t}a(y5o,"TryConvertNull");function E5o(t){return Sa(t)&&t==="undefined"?void 0:t}a(E5o,"TryConvertUndefined");function _5o(t){return __(t)?t:ai(t)?new Date(t):WTe(t)?new Date(1):zTe(t)?new Date(0):B$e(t)?new Date(parseInt(t)):c5o(t)?new Date(`1970-01-01T${t}.000Z`):a5o(t)?new Date(`1970-01-01T${t}`):u5o(t)?new Date(`${t}.000Z`):l5o(t)?new Date(t):d5o(t)?new Date(`${t}T00:00:00.000Z`):t}a(_5o,"TryConvertDate");function v5o(t,e,r){return(Pi(r)?r:[r]).map(o=>bP(t.items,e,o))}a(v5o,"FromArray");function C5o(t,e,r){return g5o(r)}a(C5o,"FromBigInt");function b5o(t,e,r){return Gun(r)}a(b5o,"FromBoolean");function S5o(t,e,r){return _5o(r)}a(S5o,"FromDate");function T5o(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return bP(o,[...e,...n],r)}a(T5o,"FromImport");function I5o(t,e,r){return A5o(r)}a(I5o,"FromInteger");function x5o(t,e,r){return t.allOf.reduce((n,o)=>bP(o,e,n),r)}a(x5o,"FromIntersect");function w5o(t,e,r){return m5o(t,r)}a(w5o,"FromLiteral");function R5o(t,e,r){return y5o(r)}a(R5o,"FromNull");function k5o(t,e,r){return Vun(r)}a(k5o,"FromNumber");function P5o(t,e,r){if(!bo(r)||Pi(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))Qi(r,n)&&(r[n]=bP(t.properties[n],e,r[n]));return r}a(P5o,"FromObject");function D5o(t,e,r){if(!(bo(r)&&!Pi(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=bP(s,e,l);return r}a(D5o,"FromRecord");function N5o(t,e,r){return bP(Ia(t,e),e,r)}a(N5o,"FromRef");function M5o(t,e,r){return $un(r)}a(M5o,"FromString");function O5o(t,e,r){return Sa(r)||ai(r)?Symbol(r):r}a(O5o,"FromSymbol");function L5o(t,e,r){return bP(Ia(t,e),e,r)}a(L5o,"FromThis");function B5o(t,e,r){return Pi(r)&&!Fu(t.items)?r.map((o,s)=>s{let c=L_(s,e,n);return bo(c)?{...o,...c}:c},{})}a(H5o,"FromIntersect");function G5o(t,e,r){let n=_3(t,r);if(!bo(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=L_(t.properties[s],e,n[s]);Fu(c)||(n[s]=L_(t.properties[s],e,n[s]))}if(!d8t(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=L_(t.additionalProperties,e,n[s]));return n}a(G5o,"FromObject");function $5o(t,e,r){let n=_3(t,r);if(!bo(n))return n;let o=t.additionalProperties,[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of Object.getOwnPropertyNames(n))l.test(u)&&d8t(c)&&(n[u]=L_(c,e,n[u]));if(!d8t(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=L_(o,e,n[u]));return n}a($5o,"FromRecord");function V5o(t,e,r){return L_(Ia(t,e),e,_3(t,r))}a(V5o,"FromRef");function W5o(t,e,r){return L_(Ia(t,e),e,r)}a(W5o,"FromThis");function z5o(t,e,r){let n=_3(t,r);if(!Pi(n)||Fu(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;cJ5o,Format:()=>YTe,Get:()=>X5o,Has:()=>Z5o,Set:()=>K5o,ValuePointerRootDeleteError:()=>q$e,ValuePointerRootSetError:()=>Q$e});p();var Q$e=class extends qi{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}},q$e=class extends qi{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};function zun(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(zun,"Escape");function*YTe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;nDY(t[o],e[o]))}a(e4o,"ObjectType");function t4o(t,e){return __(e)&&t.getTime()===e.getTime()}a(t4o,"DateType");function r4o(t,e){return!Pi(e)||t.length!==e.length?!1:t.every((r,n)=>DY(r,e[n]))}a(r4o,"ArrayType");function n4o(t,e){return!qI(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>DY(r,e[n]))}a(n4o,"TypedArrayType");function i4o(t,e){return t===e}a(i4o,"ValueType");function DY(t,e){if(__(t))return t4o(t,e);if(qI(t))return n4o(t,e);if(Pi(t))return r4o(t,e);if(bo(t))return e4o(t,e);if(B1(t))return i4o(t,e);throw new Error("ValueEquals: Unable to compare value")}a(DY,"Equal");var o4o=rc({type:ca("insert"),path:C_(),value:Qk()}),s4o=rc({type:ca("update"),path:C_(),value:Qk()}),a4o=rc({type:ca("delete"),path:C_()}),Kun=tc([o4o,s4o,a4o]),j$e=class extends qi{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};function H$e(t,e){return{type:"update",path:t,value:e}}a(H$e,"CreateUpdate");function Jun(t,e){return{type:"insert",path:t,value:e}}a(Jun,"CreateInsert");function Zun(t){return{type:"delete",path:t}}a(Zun,"CreateDelete");function Yun(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new j$e(t,"Cannot diff objects with symbols")}a(Yun,"AssertDiffable");function*c4o(t,e,r){if(Yun(e),Yun(r),!EPt(r))return yield H$e(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)Qi(e,s)||(yield Jun(`${t}/${s}`,r[s]));for(let s of n)Qi(r,s)&&(DY(e,r)||(yield*G$e(`${t}/${s}`,e[s],r[s])));for(let s of n)Qi(r,s)||(yield Zun(`${t}/${s}`))}a(c4o,"ObjectType");function*l4o(t,e,r){if(!Pi(r))return yield H$e(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(f4o,"IsRootUpdate");function p4o(t){return t.length===0}a(p4o,"IsIdentity");function edn(t,e){if(f4o(e))return ja(e[0].value);if(p4o(e))return ja(t);let r=ja(t);for(let n of e)switch(n.type){case"insert":{SP.Set(r,n.path,n.value);break}case"update":{SP.Set(r,n.path,n.value);break}case"delete":{SP.Delete(r,n.path);break}}return r}a(edn,"Patch");p();function tdn(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=yB(e,r)?Zoe(e,r,n):n;if(!es(e,r,o))throw new Joe(e,o,nM(e,r,o).First());return o}a(tdn,"Encode");p();function $$e(t){return bo(t)&&!Pi(t)}a($$e,"IsStandardObject");var V$e=class extends qi{static{a(this,"ValueMutateError")}constructor(e){super(e)}};function h4o(t,e,r,n){if(!$$e(r))SP.Set(t,e,ja(n));else{let o=Object.getOwnPropertyNames(r),s=Object.getOwnPropertyNames(n);for(let c of o)s.includes(c)||delete r[c];for(let c of s)o.includes(c)||(r[c]=null);for(let c of s)f8t(t,`${e}/${c}`,r[c],n[c])}}a(h4o,"ObjectType");function m4o(t,e,r,n){if(!Pi(r))SP.Set(t,e,ja(n));else{for(let o=0;o(M$e(s,c,l),l)],["Cast",(s,c,l)=>VTe(s,c,l)],["Clean",(s,c,l)=>L$e(s,c,l)],["Clone",(s,c,l)=>ja(l)],["Convert",(s,c,l)=>F$e(s,c,l)],["Decode",(s,c,l)=>yB(s,c)?Koe(s,c,l):l],["Default",(s,c,l)=>U$e(s,c,l)],["Encode",(s,c,l)=>yB(s,c)?Zoe(s,c,l):l]]);function r(s){e.delete(s)}a(r,"Delete"),t.Delete=r;function n(s,c){e.set(s,c)}a(n,"Set"),t.Set=n;function o(s){return e.get(s)}a(o,"Get"),t.Get=o})(p8t||(p8t={}));var idn=["Clone","Clean","Default","Convert","Assert","Decode"];function E4o(t,e,r,n){return t.reduce((o,s)=>{let c=p8t.Get(s);if(Fu(c))throw new W$e(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(E4o,"ParseValue");function odn(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?Pi(t[0])?[t[0],t[1],[],t[2]]:[idn,t[0],t[1],t[2]]:t.length===2?[idn,t[0],[],t[1]]:(()=>{throw new W$e("Invalid Arguments")})();return E4o(e,r,n,o)}a(odn,"Parse");p();var XM={};ki(XM,{Assert:()=>M$e,Cast:()=>VTe,Check:()=>es,Clean:()=>L$e,Clone:()=>ja,Convert:()=>F$e,Create:()=>vP,Decode:()=>Wun,Default:()=>U$e,Diff:()=>Xun,Edit:()=>Kun,Encode:()=>tdn,Equal:()=>DY,Errors:()=>nM,Hash:()=>bU,Mutate:()=>ndn,Parse:()=>odn,Patch:()=>edn,ValueErrorIterator:()=>SU});p();var _4o="gpt-41-copilot",Ox=class t{constructor(e,r=!0){this._ctx=e;this.onModelsFetchedCallbacks=[];this.fetchedModelData=[];this.editorPreviewFeaturesDisabled=!1;r&&bs(this._ctx,n=>this.refreshAvailableModels(n))}static{a(this,"AvailableModelsManager")}async refreshAvailableModels(e){await this.refreshModels(e);for(let r of this.onModelsFetchedCallbacks)r()}addHandler(e){this.onModelsFetchedCallbacks.push(e)}getDefaultModelId(){if(this.fetchedModelData){let e=t.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return _4o}parseModelsResponse(e){try{return XM.Parse(Iun,e)}catch(r){Nr.exception(this._ctx,r,"Failed to parse /models response from CAPI");return}}async refreshModels(e){let r=await this.fetchModels(e);r&&(this.fetchedModelData=r)}async fetchModels(e){return this.editorPreviewFeaturesDisabled=e.getTokenValue("editor_preview_features")=="0",await this.fetch(e)}fetch(e){return(!this.fetchInProgress||this.fetchInProgress.withToken.token!==e.token)&&(this.fetchInProgress={withToken:e,response:this.fetchImpl(e).finally(()=>{this.fetchInProgress=void 0})}),this.fetchInProgress.response}async fetchImpl(e){let r=await PY(this._ctx,"/models",e);return r.ok?this.parseModelsResponse(await r.json())?.data??[]:(Nr.error(this._ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText}),null)}getGenericCompletionModels(){let e=t.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return t.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:"o200k_base"}static filterCompletionModels(e,r){return e.filter(n=>n.capabilities.type==="completion").filter(n=>!r||n.preview===!1||n.preview===void 0)}static filterModelsWithEditorPreviewFeatures(e,r){return e.filter(n=>!r||n.preview===!1||n.preview===void 0)}static mapCompletionModels(e){return e.map(r=>({modelId:r.id,label:r.name,preview:!!r.preview,tokenizer:r.capabilities.tokenizer}))}getCurrentModelRequestInfo(e=void 0){let r=this.getDefaultModelId(),n=wun(this._ctx);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&Nr.error(this._ctx,`User selected model ${n} is not in the list of generic models: ${l.join(", ")}, falling back to default model.`),n=null),r===n&&(n=null)}let o=Ft(this._ctx,Ye.DebugOverrideEngine)||Ft(this._ctx,Ye.DebugOverrideEngineLegacy);if(o)return new NY(o,"override");let s=e?this._ctx.get(Zt).customEngine(e):"",c=e?this._ctx.get(Zt).customEngineTargetEngine(e):void 0;return n?s&&c&&n===c?new NY(s,"exp"):new NY(n,"modelpicker"):s?new NY(s,"exp"):new NY(r,"default")}},NY=class{constructor(e,r){this.modelId=e;this.modelChoiceSource=r}static{a(this,"ModelRequestInfo")}get headers(){return{}}};function mQ(t,e=void 0){let r=t.get(Ox),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(mQ,"getEngineRequestInfo");p();p();var Qo=class{static{a(this,"FileSystem")}};var bdn=de(Cdn());function Sdn(t){return t!==void 0&&t!==0}a(Sdn,"isRepoInfo");function Tdn(t){if(t===void 0||t===0)return"";let e=MY(t);if(e==="github/github")return e;let r=V4o(t)?.toLowerCase();return r!==void 0?r:""}a(Tdn,"getDogFood");function MY(t){if(t!==void 0&&t!==0&&t.hostname==="github.com")return t.owner+"/"+t.repo}a(MY,"tryGetGitHubNWO");function V4o(t){if(t===void 0||t===0)return;let e=t.hostname.toLowerCase(),r=e==="azure.com"||e.endsWith(".azure.com"),n=e==="visualstudio.com"||e.endsWith(".visualstudio.com");if(r||n)return t.owner+"/"+t.repo}a(V4o,"tryGetADONWO");function gQ(t,e){let r=uf(e);return W4o(t,r)}a(gQ,"extractRepoInfoInBackground");var W4o=J4o(z4o,1e4);async function z4o(t,e){let r=RKr(e);if(!r)return;let n=await Y4o(t,r);if(!n)return;let o=t.get(Qo),s=wa(n,".git","config"),c;try{c=await o.readFileString(s)}catch{return}let l=K4o(c)??"",u=A8t(l),d={uri:n};return u===void 0?{baseFolder:d,url:l,hostname:"",owner:"",repo:"",pathname:""}:{baseFolder:d,url:l,...u}}a(z4o,"extractRepoInfo");function A8t(t){let e;try{if(e=(0,bdn.default)(t),e.resource==""||e.owner==""||e.name==""||e.pathname=="")return}catch{return}return{hostname:e.resource,owner:e.owner,repo:e.name,pathname:e.pathname}}a(A8t,"parseRepoUrl");async function Y4o(t,e){let r=e+"_add_to_make_longer",n=t.get(Qo);for(;e!=="file:///"&&e.length{let c=JSON.stringify(s),l=r.get(c);if(l)return l.result;if(n.has(c))return 0;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new g8t(d)),n.delete(c)}),0}}a(J4o,"computeInBackgroundAndMemoize");p();var KTe=500,Idn=8192-KTe,xdn=4,z$e=10,wdn=1e3*5,Y$e={prefix:35,suffix:15,stableContext:35,volatileContext:15},Z4o={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function JTe(t){return t=t.toLowerCase(),Z4o[t]??t}a(JTe,"normalizeLanguageId");var y8t=class{constructor(e){this.ctx=e;this.cache=new Cn(200)}static{a(this,"FilterSettingsToExpConfigs")}async fetchExpConfig(e,r){let n=e.stringify()+` -`+JSON.stringify(r),o=this.cache.get(n);return o||(o=new E8t(()=>this.ctx.get(dP).fetchExperiments(this.ctx,r,e.toHeaders()),1e3*60*60),this.cache.set(n,o)),o.run()}getCachedExpConfig(e){return this.cache.get(e.stringify())?.value()}},E8t=class{constructor(e,r=1/0){this.producer=e;this.expirationMs=r}static{a(this,"Task")}async run(){return this.promise===void 0&&(this.promise=this.producer(),this.storeResult(this.promise).then(()=>{this.expirationMs<1/0&&this.promise!==void 0&&setTimeout(()=>this.promise=void 0,this.expirationMs)})),this.promise}async storeResult(e){try{this.result=await e}finally{this.result===void 0&&(this.promise=void 0)}}value(){return this.result}};function X4o(t){return"uri"in t}a(X4o,"isCompletionsFiltersInfo");var Zt=class t{constructor(e){this.ctx=e;this.staticFilters={};this.dynamicFilters={};this.dynamicFilterGroups=[];this.upcomingDynamicFilters={};this.assignments=new y8t(this.ctx)}static{a(this,"Features")}static{this.upcomingDynamicFilterCheckDelayMs=20}static{this.upcomingTimeBucketMinutes=5+Math.floor(Math.random()*11)}registerStaticFilters(e){Object.assign(this.staticFilters,e)}registerDynamicFilter(e,r){this.dynamicFilters[e]=r}registerDynamicFilterGroup(e){this.dynamicFilterGroups.push(e)}getDynamicFilterValues(){let e={};for(let r of this.dynamicFilterGroups)Object.assign(e,r());for(let[r,n]of Object.entries(this.dynamicFilters))e[r]=n();return e}registerUpcomingDynamicFilter(e,r){this.upcomingDynamicFilters[e]=r}async updateExPValuesAndAssignments(e,r,n=Wt.createAndMarkAsIssued()){if(n instanceof JI)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let o=r&&X4o(r)?gQ(this.ctx,r.uri):void 0,s=MY(o)??"",c=Tdn(o)??"",l=r?.languageId??"",u=mQ(this.ctx).modelId,d=CQr(e),f=e.getTokenValue("ol")??"",h=e.getTokenValue("tid")??"",m=e.getTokenValue("fcv1")==="1",g=e.getTokenValue("sn")==="1",y=this.ctx.get(Op).getProperties(),E=e.endpoints,_={"X-Copilot-Repository":s,"X-Copilot-FileType":l,"X-Copilot-UserKind":d,"X-Copilot-Dogfood":c,"X-Copilot-Engine":u,"X-Copilot-Orgs":f,"X-Copilot-CopilotTrackingId":h,"X-GitHub-Copilot-SKU":y.sku||"","X-GitHub-Copilot-IsFcv1":m?"1":"0","X-GitHub-Copilot-IsSn":g?"1":"0"},v=this.getGranularityDirectory(),b=this.makeFilterSettings(_),T=v.extendFilters(b),w=await this.getExpConfig(T.newFilterSettings,E);v.update(b,+(w.variables.copilotbycallbuckets??NaN),+(w.variables.copilottimeperiodsizeinh??NaN));let R=v.extendFilters(b),x=R.newFilterSettings,P=await this.getExpConfig(x,E),D=new Promise(N=>setTimeout(N,t.upcomingDynamicFilterCheckDelayMs));for(let N of R.otherFilterSettingsToPrefetch)D=D.then(async()=>{await new Promise(L=>setTimeout(L,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(N,E)});return this.prepareForUpcomingFilters(x,E),new JI(n.properties,n.measurements,n.issuedTime,{filters:x,exp:P})}async fetchTokenAndUpdateExPValuesAndAssignments(e,r){let n=await this.ctx.get(Qt).getToken();return await this.updateExPValuesAndAssignments(n,e,r)}getGranularityDirectory(){if(!this.granularityDirectory){let e=this.ctx.get(Ua).machineId;this.granularityDirectory=new Eje(e,this.ctx.get(Cx))}return this.granularityDirectory}makeFilterSettings(e){return new iB({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e,r){try{return this.assignments.fetchExpConfig(e,r)}catch(n){return nC.createFallbackConfig(this.ctx,`Error fetching ExP config: ${String(n)}`)}}async prepareForUpcomingFilters(e,r){if(!(new Date().getMinutes()<60-t.upcomingTimeBucketMinutes))for(let[n,o]of Object.entries(this.upcomingDynamicFilters))await new Promise(s=>setTimeout(s,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(e.withChange(n,o()),r)}stringify(){let e=this.assignments.getCachedExpConfig(new iB({}));return JSON.stringify(e?.variables??{})}async getFallbackExpAndFilters(){let e=this.makeFilterSettings({}),r=bB(this.ctx),n=await this.getExpConfig(e,r);return{filters:e,exp:n}}disableLogProb(e){return e.filtersAndExp.exp.variables.copilotdisablelogprob??!0}overrideBlockMode(e){return e.filtersAndExp.exp.variables.copilotoverrideblockmode||void 0}customEngine(e){return e.filtersAndExp.exp.variables.copilotcustomengine??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables.copilotcustomenginetargetengine}suffixPercent(e){return e.filtersAndExp.exp.variables.CopilotSuffixPercent??Y$e.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables.copilotsuffixmatchthreshold??z$e}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables.copilotcppheadersenableswitch??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscodecsharp??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscodetypescript??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscode??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables.copilotcontextproviders??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e){return e.filtersAndExp.exp.variables.copilotcontextprovidertimebudget??150}includeNeighboringFiles(e){return e.filtersAndExp.exp.variables.copilotincludeneighboringfiles??!1}excludeRelatedFiles(e){return e.filtersAndExp.exp.variables.copilotexcluderelatedfiles??!1}maxPromptCompletionTokens(e){return e.filtersAndExp.exp.variables.maxpromptcompletionTokens??Idn+KTe}ideChatMaxRequestTokens(e){return e.filtersAndExp.exp.variables.idechatmaxrequesttokens??-1}ideChatExpModelIds(e){return e.filtersAndExp.exp.variables.idechatexpmodelids??""}ideChatEnableProjectMetadata(e){return e.filtersAndExp.exp.variables.idechatenableprojectmetadata??!1}ideDataMigrationCompleted(e){return e.filtersAndExp.exp.variables.idedatamigrationcompleted??!1}workspaceContextCoordinator(e){return e.filtersAndExp.exp.variables.copilotworkspacecontextcoordinator??!1}workspaceContextCacheTime(e){return e.filtersAndExp.exp.variables.copilotworkspacecontextcachetime??wdn}stableContextPercent(e){return e.filtersAndExp.exp.variables.copilotstablecontextpercent??Y$e.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables.copilotvolatilecontextpercent??Y$e.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotcppContextProviderParams}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotcsharpcontextproviderparams}javaContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotjavacontextproviderparams}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotmultilanguagecontextproviderparams}tsContextProviderParams(e){return e.filtersAndExp.exp.variables.copilottscontextproviderparams}completionsDebounce(e){return e.filtersAndExp.exp.variables.copilotcompletionsdebounce}enableElectronFetcher(e){return e.filtersAndExp.exp.variables.copilotelectronfetcher??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables.copilotfetchfetcher??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables.copilotasynccompletionstimeout??200}enablePromptContextProxyField(e){return e.filtersAndExp.exp.variables.copilotenablepromptcontextproxyfield??!1}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables.copilotprogressivereveal??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables.copilotmodelterminatesingleline??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables.copilotprogressivereveallonglookaheadsize??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables.copilotprogressiverevealshortlookaheadsize??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables.copilotmaxmultilinetokens??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables.copilotmultilineafteracceptlines??1}enableNESXTab(e){return e.filtersAndExp.exp.variables.copilotnesxtab??!1}getNESXTabModelID(e){return e.filtersAndExp.exp.variables.copilotnesxtabmodelid??"copilot-nes-xtab"}completionsDelay(e){return e.filtersAndExp.exp.variables.copilotcompletionsdelay??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables.copilotsinglelineunlessaccepted??!1}useCompletionsComparisonPanel(e){return e.filtersAndExp.exp.variables.copilotusecompletionscomparisonpanel??!1}comparisonPanelModelIds(e){return e.filtersAndExp.exp.variables.copilotcomparisonpanelmodelids??""}comparisonPanelRandomizedMode(e){return e.filtersAndExp.exp.variables.copilotcomparisonpanelrandomizedmode??!0}useChatLibCompletions(e){return e.filtersAndExp.exp.variables.copilotusechatlibcompletions??!1}cveRemediatorAgentEnabled(e){return e.filtersAndExp.exp.variables.cveremediatoragentenabled??!1}instantApplyModelMigration(e){return e.filtersAndExp.exp.variables.copilotinstantapplymodelmigration??!1}appmodContextMenuEnabled(e){return e.filtersAndExp.exp.variables.copilotappmodcontextmenuenabled??!1}appmodProblemsViewEnabled(e){return e.filtersAndExp.exp.variables.copilotappmodproblemsviewenabled??!1}searchAgentEnabled(e){return e.filtersAndExp.exp.variables.copilotsearchagentenabled??!1}cliAsDefaultAgentProviderEnabled(e){return e.filtersAndExp.exp.variables.copilotcliasdefaultagentprovider??!1}inlineChatUseCliEnabled(e){return e.filtersAndExp.exp.variables.inlinechatusecli??!1}ideEnableCopilotNesNonFreeEnabled(e){return e.filtersAndExp.exp.variables.ideenablecopilotnes??!1}};async function K$e(t){let e=Ft(t,Ye.SearchAgent);if(e==="true")return!0;if(e==="false")return!1;let r=t.get(Zt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments();return r.searchAgentEnabled(n)}a(K$e,"isSearchAgentEnabled");function kdn(t,e){let r=Ft(t,Ye.EnableCopilotNesNonFree);return r==="true"?!0:r==="false"?!1:t.get(Zt).ideEnableCopilotNesNonFreeEnabled(e)}a(kdn,"isIdeEnableCopilotNesNonFreeEnabled");p();p();p();var J$e=de(ale());var v8t={python:"python",javascript:"javascript",javascriptreact:"javascript",jsx:"javascript",typescript:"typescript",typescriptreact:"tsx",go:"go",ruby:"ruby",csharp:"c-sharp",java:"java",php:"php",c:"cpp",cpp:"cpp"};function kS(t){return t in v8t&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(kS,"isSupportedLanguageId");function Z$e(t){if(!(t in v8t))throw new Error(`Unrecognized language: ${t}`);return v8t[t]}a(Z$e,"languageIdToWasmLanguage");var _8t=new Map;async function eLo(t){let e;try{e=await k$e(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new fQ(`Could not load tree-sitter-${t}.wasm`,r):r}return J$e.default.Language.load(e)}a(eLo,"loadWasmLanguage");function b8t(t){let e=Z$e(t);if(!_8t.has(e)){let r=eLo(e);_8t.set(e,r)}return _8t.get(e)}a(b8t,"getLanguage");var C8t=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function AQ(t,e){return(await S8t(t,e))[0]}a(AQ,"parseTreeSitter");async function S8t(t,e){await J$e.default.init({locateFile:a(s=>GTe(s),"locateFile")});let r;try{r=new J$e.default}catch(s){throw s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&s.message.includes("table index is out of bounds")?new C8t(`Could not init Parse for language <${t}>`,s):s}let n=await b8t(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(S8t,"parseTreeSitterIncludingVersion");function Pdn(t){switch(Z$e(t)){case"python":return null;case"javascript":case"typescript":case"tsx":case"go":case"c-sharp":case"java":case"php":case"cpp":return"}";case"ruby":return"end"}}a(Pdn,"getBlockCloseToken");function tLo(t,e){let r=[];for(let n of t){if(!n[1]){let o=e.tree.getLanguage();n[1]=o.query(n[0])}r.push(...n[1].matches(e))}return r}a(tLo,"innerQuery");var rLo=[`[ +`);return n.substring(o+1)}};async function e4o(t){try{let e=await P8t.create(t);iVe.set(t,e)}catch(e){console.error(`[tokenizer] failed to load ${t}, using approximate token counts: ${String(e)}`)}}a(e4o,"setTokenizer");var qdn=new Map,jdn=!1;function N8t(t="o200k_base"){if(jdn||(jdn=!0,iVe.set("mock",new D8t)),t==="mock")return Promise.resolve();let e=qdn.get(t);return e||(e=e4o(t).catch(()=>{}),qdn.set(t,e)),e}a(N8t,"_ensureLoaded");async function Hdn(t){let e=t==="cl100k_base"?"cl100k_base":t==="o200k_base"||t===void 0?"o200k_base":void 0;e&&await N8t(e)}a(Hdn,"ensureNativeTokenizersLoaded");p();p();var t4o=function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},$dn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},M8t,oVe,Vdn,O8t=class extends Qi{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),M8t.add(this),oVe.set(this,void 0),t4o(this,oVe,e,"f"),this.error=r}Errors(){return new LU($dn(this,M8t,"m",Vdn).call(this))}};oVe=new WeakMap,M8t=new WeakSet,Vdn=a(function*(){this.error&&(yield this.error),yield*$dn(this,oVe,"f")},"_AssertError_Iterator");function Gdn(t,e,r){if(!Xo(t,e,r))throw new O8t(dM(t,e,r))}a(Gdn,"AssertValue");function sVe(...t){return t.length===3?Gdn(t[0],t[1],t[2]):Gdn(t[0],[],t[1])}a(sVe,"Assert");p();p();p();function r4o(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Ha(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Ha(t[r]);return e}a(r4o,"FromObject");function n4o(t){return t.map(e=>Ha(e))}a(n4o,"FromArray");function i4o(t){return t.slice()}a(i4o,"FromTypedArray");function o4o(t){return new Map(Ha([...t.entries()]))}a(o4o,"FromMap");function s4o(t){return new Set(Ha([...t.entries()]))}a(s4o,"FromSet");function a4o(t){return new Date(t.toISOString())}a(a4o,"FromDate");function Ha(t){if(ki(t))return n4o(t);if(T_(t))return a4o(t);if(zI(t))return i4o(t);if(N$r(t))return o4o(t);if(M$r(t))return s4o(t);if(bo(t))return r4o(t);if(j1(t))return t;throw new Error("ValueClone: Unable to clone value")}a(Ha,"Clone");var NS=class extends Qi{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};function Ga(t){return TU(t)?t():Ha(t)}a(Ga,"FromDefault");function c4o(t,e){return Ui(t,"default")?Ga(t.default):{}}a(c4o,"FromAny");function l4o(t,e){return{}}a(l4o,"FromArgument");function u4o(t,e){if(t.uniqueItems===!0&&!Ui(t,"default"))throw new NS(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!Ui(t,"default"))throw new NS(t,"Array with the contains constraint requires a default value");return"default"in t?Ga(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>MS(t.items,e)):[]}a(u4o,"FromArray");function d4o(t,e){return Ui(t,"default")?Ga(t.default):(async function*(){})()}a(d4o,"FromAsyncIterator");function f4o(t,e){return Ui(t,"default")?Ga(t.default):BigInt(0)}a(f4o,"FromBigInt");function p4o(t,e){return Ui(t,"default")?Ga(t.default):!1}a(p4o,"FromBoolean");function h4o(t,e){if(Ui(t,"default"))return Ga(t.default);{let r=MS(t.returns,e);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,o]of Object.entries(r)){let s=this;s[n]=o}}}:class{}}}a(h4o,"FromConstructor");function m4o(t,e){return Ui(t,"default")?Ga(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(m4o,"FromDate");function g4o(t,e){return Ui(t,"default")?Ga(t.default):()=>MS(t.returns,e)}a(g4o,"FromFunction");function A4o(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return MS(n,[...e,...r])}a(A4o,"FromImport");function y4o(t,e){return Ui(t,"default")?Ga(t.default):t.minimum!==void 0?t.minimum:0}a(y4o,"FromInteger");function E4o(t,e){if(Ui(t,"default"))return Ga(t.default);{let r=t.allOf.reduce((n,o)=>{let s=MS(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!Xo(t,e,r))throw new NS(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(E4o,"FromIntersect");function _4o(t,e){return Ui(t,"default")?Ga(t.default):(function*(){})()}a(_4o,"FromIterator");function v4o(t,e){return Ui(t,"default")?Ga(t.default):t.const}a(v4o,"FromLiteral");function C4o(t,e){if(Ui(t,"default"))return Ga(t.default);throw new NS(t,"Never types cannot be created. Consider using a default value.")}a(C4o,"FromNever");function b4o(t,e){if(Ui(t,"default"))return Ga(t.default);throw new NS(t,"Not types must have a default value")}a(b4o,"FromNot");function S4o(t,e){return Ui(t,"default")?Ga(t.default):null}a(S4o,"FromNull");function T4o(t,e){return Ui(t,"default")?Ga(t.default):t.minimum!==void 0?t.minimum:0}a(T4o,"FromNumber");function I4o(t,e){if(Ui(t,"default"))return Ga(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=MS(s,e));return n}}a(I4o,"FromObject");function x4o(t,e){return Ui(t,"default")?Ga(t.default):Promise.resolve(MS(t.item,e))}a(x4o,"FromPromise");function w4o(t,e){return Ui(t,"default")?Ga(t.default):{}}a(w4o,"FromRecord");function R4o(t,e){return Ui(t,"default")?Ga(t.default):MS(Ta(t,e),e)}a(R4o,"FromRef");function k4o(t,e){if(Ui(t,"default"))return Ga(t.default);throw new NS(t,"RegExp types cannot be created. Consider using a default value.")}a(k4o,"FromRegExp");function P4o(t,e){if(t.pattern!==void 0){if(Ui(t,"default"))return Ga(t.default);throw new NS(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if(Ui(t,"default"))return Ga(t.default);throw new NS(t,"String types with formats must specify a default value")}else return Ui(t,"default")?Ga(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(P4o,"FromString");function D4o(t,e){return Ui(t,"default")?Ga(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(D4o,"FromSymbol");function N4o(t,e){if(Ui(t,"default"))return Ga(t.default);if(!CUe(t))throw new NS(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return Voe(t)[0]}a(N4o,"FromTemplateLiteral");function M4o(t,e){if(Wdn++>j4o)throw new NS(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Ui(t,"default")?Ga(t.default):MS(Ta(t,e),e)}a(M4o,"FromThis");function O4o(t,e){return Ui(t,"default")?Ga(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>MS(t.items[n],e))}a(O4o,"FromTuple");function L4o(t,e){if(Ui(t,"default"))return Ga(t.default)}a(L4o,"FromUndefined");function B4o(t,e){if(Ui(t,"default"))return Ga(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return MS(t.anyOf[0],e)}a(B4o,"FromUnion");function F4o(t,e){return Ui(t,"default")?Ga(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(F4o,"FromUint8Array");function U4o(t,e){return Ui(t,"default")?Ga(t.default):{}}a(U4o,"FromUnknown");function Q4o(t,e){if(Ui(t,"default"))return Ga(t.default)}a(Q4o,"FromVoid");function q4o(t,e){if(Ui(t,"default"))return Ga(t.default);throw new Error("User defined types must specify a default value")}a(q4o,"FromKind");function MS(t,e){let r=J0(t,e),n=t;switch(n[bt]){case"Any":return c4o(n,r);case"Argument":return l4o(n,r);case"Array":return u4o(n,r);case"AsyncIterator":return d4o(n,r);case"BigInt":return f4o(n,r);case"Boolean":return p4o(n,r);case"Constructor":return h4o(n,r);case"Date":return m4o(n,r);case"Function":return g4o(n,r);case"Import":return A4o(n,r);case"Integer":return y4o(n,r);case"Intersect":return E4o(n,r);case"Iterator":return _4o(n,r);case"Literal":return v4o(n,r);case"Never":return C4o(n,r);case"Not":return b4o(n,r);case"Null":return S4o(n,r);case"Number":return T4o(n,r);case"Object":return I4o(n,r);case"Promise":return x4o(n,r);case"Record":return w4o(n,r);case"Ref":return R4o(n,r);case"RegExp":return k4o(n,r);case"String":return P4o(n,r);case"Symbol":return D4o(n,r);case"TemplateLiteral":return N4o(n,r);case"This":return M4o(n,r);case"Tuple":return O4o(n,r);case"Undefined":return L4o(n,r);case"Union":return B4o(n,r);case"Uint8Array":return F4o(n,r);case"Unknown":return U4o(n,r);case"Void":return Q4o(n,r);default:if(!I_.Has(n[bt]))throw new NS(n,"Unknown type");return q4o(n,r)}}a(MS,"Visit");var j4o=512,Wdn=0;function kP(...t){return Wdn=0,t.length===2?MS(t[0],t[1]):MS(t[0],[])}a(kP,"Create");var aVe=class extends Qi{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};function zdn(t,e,r){if(t[bt]==="Object"&&typeof r=="object"&&!hB(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[bt]==="Literal"&&u.const===r[l]?100:0,f=Xo(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[bt]==="Union"){let o=t.anyOf.map(s=>Ta(s,e)).map(s=>zdn(s,e,r));return Math.max(...o)}else return Xo(t,e,r)?1:0}a(zdn,"ScoreUnion");function H4o(t,e,r){let n=t.anyOf.map(c=>Ta(c,e)),[o,s]=[n[0],0];for(let c of n){let l=zdn(c,e,r);l>s&&(o=c,s=l)}return o}a(H4o,"SelectUnion");function G4o(t,e,r){if("default"in t)return typeof r=="function"?t.default:Ha(t.default);{let n=H4o(t,e,r);return fIe(n,e,r)}}a(G4o,"CastUnion");function $4o(t,e,r){return Xo(t,e,r)?Ha(r):kP(t,e)}a($4o,"DefaultClone");function V4o(t,e,r){return Xo(t,e,r)?r:kP(t,e)}a(V4o,"Default");function W4o(t,e,r){if(Xo(t,e,r))return Ha(r);let n=ki(r)?Ha(r):kP(t,e),o=si(t.minItems)&&n.lengthnull)]:n,c=(si(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>PP(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!Xo(t,e,l))throw new aVe(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(W4o,"FromArray");function z4o(t,e,r){if(Xo(t,e,r))return kP(t,e);let n=new Set(t.returns.required||[]),o=a(function(){},"result");for(let[s,c]of Object.entries(t.returns.properties))!n.has(s)&&r.prototype[s]===void 0||(o.prototype[s]=PP(c,e,r.prototype[s]));return o}a(z4o,"FromConstructor");function Y4o(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return PP(o,[...e,...n],r)}a(Y4o,"FromImport");function Ydn(t,e){return bo(t)&&!bo(e)||!bo(t)&&bo(e)?t:!bo(t)||!bo(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?Ydn(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(Ydn,"IntersectAssign");function K4o(t,e,r){if(Xo(t,e,r))return r;let n=kP(t,e),o=Ydn(n,r);return Xo(t,e,o)?o:n}a(K4o,"FromIntersect");function J4o(t,e,r){throw new aVe(t,"Never types cannot be cast")}a(J4o,"FromNever");function Z4o(t,e,r){if(Xo(t,e,r))return r;if(r===null||typeof r!="object")return kP(t,e);let n=new Set(t.required||[]),o={};for(let[s,c]of Object.entries(t.properties))!n.has(s)&&r[s]===void 0||(o[s]=PP(c,e,r[s]));if(typeof t.additionalProperties=="object"){let s=Object.getOwnPropertyNames(t.properties);for(let c of Object.getOwnPropertyNames(r))s.includes(c)||(o[c]=PP(t.additionalProperties,e,r[c]))}return o}a(Z4o,"FromObject");function X4o(t,e,r){if(Xo(t,e,r))return Ha(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return kP(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=PP(o,e,l);return s}a(X4o,"FromRecord");function eLo(t,e,r){return PP(Ta(t,e),e,r)}a(eLo,"FromRef");function tLo(t,e,r){return PP(Ta(t,e),e,r)}a(tLo,"FromThis");function rLo(t,e,r){return Xo(t,e,r)?Ha(r):ki(r)?t.items===void 0?[]:t.items.map((n,o)=>PP(n,e,r[o])):kP(t,e)}a(rLo,"FromTuple");function nLo(t,e,r){return Xo(t,e,r)?Ha(r):G4o(t,e,r)}a(nLo,"FromUnion");function PP(t,e,r){let n=ba(t.$id)?J0(t,e):e,o=t;switch(t[bt]){case"Array":return W4o(o,n,r);case"Constructor":return z4o(o,n,r);case"Import":return Y4o(o,n,r);case"Intersect":return K4o(o,n,r);case"Never":return J4o(o,n,r);case"Object":return Z4o(o,n,r);case"Record":return X4o(o,n,r);case"Ref":return eLo(o,n,r);case"This":return tLo(o,n,r);case"Tuple":return rLo(o,n,r);case"Union":return nLo(o,n,r);case"Date":case"Symbol":case"Uint8Array":return $4o(t,e,r);default:return V4o(o,n,r)}}a(PP,"Visit");function fIe(...t){return t.length===3?PP(t[0],t[1],t[2]):PP(t[0],[],t[1])}a(fIe,"Cast");p();function iLo(t){return xU(t)&&t[bt]!=="Unsafe"}a(iLo,"IsCheckable");function oLo(t,e,r){return ki(r)?r.map(n=>PC(t.items,e,n)):r}a(oLo,"FromArray");function sLo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return PC(o,[...e,...n],r)}a(sLo,"FromImport");function aLo(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>PC(l,e,Ha(r))).reduce((l,u)=>bo(u)?{...l,...u}:u,{});if(!bo(r)||!bo(s)||!xU(n))return s;let c=lC(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||Xo(n,e,r[l])&&(s[l]=PC(n,e,r[l]));return s}a(aLo,"FromIntersect");function cLo(t,e,r){if(!bo(r)||ki(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(Ui(t.properties,o)){r[o]=PC(t.properties[o],e,r[o]);continue}if(xU(n)&&Xo(n,e,r[o])){r[o]=PC(n,e,r[o]);continue}delete r[o]}return r}a(cLo,"FromObject");function lLo(t,e,r){if(!bo(r))return r;let n=t.additionalProperties,o=Object.getOwnPropertyNames(r),[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of o){if(l.test(u)){r[u]=PC(c,e,r[u]);continue}if(xU(n)&&Xo(n,e,r[u])){r[u]=PC(n,e,r[u]);continue}delete r[u]}return r}a(lLo,"FromRecord");function uLo(t,e,r){return PC(Ta(t,e),e,r)}a(uLo,"FromRef");function dLo(t,e,r){return PC(Ta(t,e),e,r)}a(dLo,"FromThis");function fLo(t,e,r){if(!ki(r))return r;if(ju(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(fLo,"FromTuple");function pLo(t,e,r){for(let n of t.anyOf)if(iLo(n)&&Xo(n,e,r))return PC(n,e,r);return r}a(pLo,"FromUnion");function PC(t,e,r){let n=ba(t.$id)?J0(t,e):e,o=t;switch(o[bt]){case"Array":return oLo(o,n,r);case"Import":return sLo(o,n,r);case"Intersect":return aLo(o,n,r);case"Object":return cLo(o,n,r);case"Record":return lLo(o,n,r);case"Ref":return uLo(o,n,r);case"This":return dLo(o,n,r);case"Tuple":return fLo(o,n,r);case"Union":return pLo(o,n,r);default:return r}}a(PC,"Visit");function cVe(...t){return t.length===3?PC(t[0],t[1],t[2]):PC(t[0],[],t[1])}a(cVe,"Clean");p();function lVe(t){return ba(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(lVe,"IsStringNumeric");function hLo(t){return gA(t)||cM(t)||si(t)}a(hLo,"IsValueToString");function pIe(t){return t===!0||si(t)&&t===1||gA(t)&&t===BigInt("1")||ba(t)&&(t.toLowerCase()==="true"||t==="1")}a(pIe,"IsValueTrue");function hIe(t){return t===!1||si(t)&&(t===0||Object.is(t,-0))||gA(t)&&t===BigInt("0")||ba(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(hIe,"IsValueFalse");function mLo(t){return ba(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(mLo,"IsTimeStringWithTimeZone");function gLo(t){return ba(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(gLo,"IsTimeStringWithoutTimeZone");function ALo(t){return ba(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(ALo,"IsDateTimeStringWithTimeZone");function yLo(t){return ba(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(yLo,"IsDateTimeStringWithoutTimeZone");function ELo(t){return ba(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(ELo,"IsDateString");function _Lo(t,e){let r=Jdn(t);return r===e?r:t}a(_Lo,"TryConvertLiteralString");function vLo(t,e){let r=Zdn(t);return r===e?r:t}a(vLo,"TryConvertLiteralNumber");function CLo(t,e){let r=Kdn(t);return r===e?r:t}a(CLo,"TryConvertLiteralBoolean");function bLo(t,e){return ba(t.const)?_Lo(e,t.const):si(t.const)?vLo(e,t.const):cM(t.const)?CLo(e,t.const):e}a(bLo,"TryConvertLiteral");function Kdn(t){return pIe(t)?!0:hIe(t)?!1:t}a(Kdn,"TryConvertBoolean");function SLo(t){let e=a(r=>r.split(".")[0],"truncateInteger");return lVe(t)?BigInt(e(t)):si(t)?BigInt(Math.trunc(t)):hIe(t)?BigInt(0):pIe(t)?BigInt(1):t}a(SLo,"TryConvertBigInt");function Jdn(t){return mB(t)&&t.description!==void 0?t.description.toString():hLo(t)?t.toString():t}a(Jdn,"TryConvertString");function Zdn(t){return lVe(t)?parseFloat(t):pIe(t)?1:hIe(t)?0:t}a(Zdn,"TryConvertNumber");function TLo(t){return lVe(t)?parseInt(t):si(t)?Math.trunc(t):pIe(t)?1:hIe(t)?0:t}a(TLo,"TryConvertInteger");function ILo(t){return ba(t)&&t.toLowerCase()==="null"?null:t}a(ILo,"TryConvertNull");function xLo(t){return ba(t)&&t==="undefined"?void 0:t}a(xLo,"TryConvertUndefined");function wLo(t){return T_(t)?t:si(t)?new Date(t):pIe(t)?new Date(1):hIe(t)?new Date(0):lVe(t)?new Date(parseInt(t)):gLo(t)?new Date(`1970-01-01T${t}.000Z`):mLo(t)?new Date(`1970-01-01T${t}`):yLo(t)?new Date(`${t}.000Z`):ALo(t)?new Date(t):ELo(t)?new Date(`${t}T00:00:00.000Z`):t}a(wLo,"TryConvertDate");function RLo(t,e,r){return(ki(r)?r:[r]).map(o=>DP(t.items,e,o))}a(RLo,"FromArray");function kLo(t,e,r){return SLo(r)}a(kLo,"FromBigInt");function PLo(t,e,r){return Kdn(r)}a(PLo,"FromBoolean");function DLo(t,e,r){return wLo(r)}a(DLo,"FromDate");function NLo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return DP(o,[...e,...n],r)}a(NLo,"FromImport");function MLo(t,e,r){return TLo(r)}a(MLo,"FromInteger");function OLo(t,e,r){return t.allOf.reduce((n,o)=>DP(o,e,n),r)}a(OLo,"FromIntersect");function LLo(t,e,r){return bLo(t,r)}a(LLo,"FromLiteral");function BLo(t,e,r){return ILo(r)}a(BLo,"FromNull");function FLo(t,e,r){return Zdn(r)}a(FLo,"FromNumber");function ULo(t,e,r){if(!bo(r)||ki(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))Ui(r,n)&&(r[n]=DP(t.properties[n],e,r[n]));return r}a(ULo,"FromObject");function QLo(t,e,r){if(!(bo(r)&&!ki(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=DP(s,e,l);return r}a(QLo,"FromRecord");function qLo(t,e,r){return DP(Ta(t,e),e,r)}a(qLo,"FromRef");function jLo(t,e,r){return Jdn(r)}a(jLo,"FromString");function HLo(t,e,r){return ba(r)||si(r)?Symbol(r):r}a(HLo,"FromSymbol");function GLo(t,e,r){return DP(Ta(t,e),e,r)}a(GLo,"FromThis");function $Lo(t,e,r){return ki(r)&&!ju(t.items)?r.map((o,s)=>s{let c=Q_(s,e,n);return bo(c)?{...o,...c}:c},{})}a(JLo,"FromIntersect");function ZLo(t,e,r){let n=I3(t,r);if(!bo(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=Q_(t.properties[s],e,n[s]);ju(c)||(n[s]=Q_(t.properties[s],e,n[s]))}if(!L8t(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=Q_(t.additionalProperties,e,n[s]));return n}a(ZLo,"FromObject");function XLo(t,e,r){let n=I3(t,r);if(!bo(n))return n;let o=t.additionalProperties,[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of Object.getOwnPropertyNames(n))l.test(u)&&L8t(c)&&(n[u]=Q_(c,e,n[u]));if(!L8t(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=Q_(o,e,n[u]));return n}a(XLo,"FromRecord");function eBo(t,e,r){return Q_(Ta(t,e),e,I3(t,r))}a(eBo,"FromRef");function tBo(t,e,r){return Q_(Ta(t,e),e,r)}a(tBo,"FromThis");function rBo(t,e,r){let n=I3(t,r);if(!ki(n)||ju(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;coBo,Format:()=>mIe,Get:()=>aBo,Has:()=>sBo,Set:()=>iBo,ValuePointerRootDeleteError:()=>pVe,ValuePointerRootSetError:()=>fVe});p();var fVe=class extends Qi{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}},pVe=class extends Qi{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};function efn(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(efn,"Escape");function*mIe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;nGY(t[o],e[o]))}a(cBo,"ObjectType");function lBo(t,e){return T_(e)&&t.getTime()===e.getTime()}a(lBo,"DateType");function uBo(t,e){return!ki(e)||t.length!==e.length?!1:t.every((r,n)=>GY(r,e[n]))}a(uBo,"ArrayType");function dBo(t,e){return!zI(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>GY(r,e[n]))}a(dBo,"TypedArrayType");function fBo(t,e){return t===e}a(fBo,"ValueType");function GY(t,e){if(T_(t))return lBo(t,e);if(zI(t))return dBo(t,e);if(ki(t))return uBo(t,e);if(bo(t))return cBo(t,e);if(j1(t))return fBo(t,e);throw new Error("ValueEquals: Unable to compare value")}a(GY,"Equal");var pBo=oc({type:la("insert"),path:x_(),value:Yk()}),hBo=oc({type:la("update"),path:x_(),value:Yk()}),mBo=oc({type:la("delete"),path:x_()}),rfn=ic([pBo,hBo,mBo]),hVe=class extends Qi{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};function mVe(t,e){return{type:"update",path:t,value:e}}a(mVe,"CreateUpdate");function nfn(t,e){return{type:"insert",path:t,value:e}}a(nfn,"CreateInsert");function ifn(t){return{type:"delete",path:t}}a(ifn,"CreateDelete");function tfn(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new hVe(t,"Cannot diff objects with symbols")}a(tfn,"AssertDiffable");function*gBo(t,e,r){if(tfn(e),tfn(r),!GPt(r))return yield mVe(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)Ui(e,s)||(yield nfn(`${t}/${s}`,r[s]));for(let s of n)Ui(r,s)&&(GY(e,r)||(yield*gVe(`${t}/${s}`,e[s],r[s])));for(let s of n)Ui(r,s)||(yield ifn(`${t}/${s}`))}a(gBo,"ObjectType");function*ABo(t,e,r){if(!ki(r))return yield mVe(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(_Bo,"IsRootUpdate");function vBo(t){return t.length===0}a(vBo,"IsIdentity");function sfn(t,e){if(_Bo(e))return Ha(e[0].value);if(vBo(e))return Ha(t);let r=Ha(t);for(let n of e)switch(n.type){case"insert":{NP.Set(r,n.path,n.value);break}case"update":{NP.Set(r,n.path,n.value);break}case"delete":{NP.Delete(r,n.path);break}}return r}a(sfn,"Patch");p();function afn(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=SB(e,r)?cse(e,r,n):n;if(!Xo(e,r,o))throw new ase(e,o,dM(e,r,o).First());return o}a(afn,"Encode");p();function AVe(t){return bo(t)&&!ki(t)}a(AVe,"IsStandardObject");var yVe=class extends Qi{static{a(this,"ValueMutateError")}constructor(e){super(e)}};function CBo(t,e,r,n){if(!AVe(r))NP.Set(t,e,Ha(n));else{let o=Object.getOwnPropertyNames(r),s=Object.getOwnPropertyNames(n);for(let c of o)s.includes(c)||delete r[c];for(let c of s)o.includes(c)||(r[c]=null);for(let c of s)B8t(t,`${e}/${c}`,r[c],n[c])}}a(CBo,"ObjectType");function bBo(t,e,r,n){if(!ki(r))NP.Set(t,e,Ha(n));else{for(let o=0;o(sVe(s,c,l),l)],["Cast",(s,c,l)=>fIe(s,c,l)],["Clean",(s,c,l)=>cVe(s,c,l)],["Clone",(s,c,l)=>Ha(l)],["Convert",(s,c,l)=>uVe(s,c,l)],["Decode",(s,c,l)=>SB(s,c)?sse(s,c,l):l],["Default",(s,c,l)=>dVe(s,c,l)],["Encode",(s,c,l)=>SB(s,c)?cse(s,c,l):l]]);function r(s){e.delete(s)}a(r,"Delete"),t.Delete=r;function n(s,c){e.set(s,c)}a(n,"Set"),t.Set=n;function o(s){return e.get(s)}a(o,"Get"),t.Get=o})(F8t||(F8t={}));var ufn=["Clone","Clean","Default","Convert","Assert","Decode"];function xBo(t,e,r,n){return t.reduce((o,s)=>{let c=F8t.Get(s);if(ju(c))throw new EVe(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(xBo,"ParseValue");function dfn(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?ki(t[0])?[t[0],t[1],[],t[2]]:[ufn,t[0],t[1],t[2]]:t.length===2?[ufn,t[0],[],t[1]]:(()=>{throw new EVe("Invalid Arguments")})();return xBo(e,r,n,o)}a(dfn,"Parse");p();var aO={};Ri(aO,{Assert:()=>sVe,Cast:()=>fIe,Check:()=>Xo,Clean:()=>cVe,Clone:()=>Ha,Convert:()=>uVe,Create:()=>kP,Decode:()=>Xdn,Default:()=>dVe,Diff:()=>ofn,Edit:()=>rfn,Encode:()=>afn,Equal:()=>GY,Errors:()=>dM,Hash:()=>OU,Mutate:()=>lfn,Parse:()=>dfn,Patch:()=>sfn,ValueErrorIterator:()=>LU});p();var wBo="gpt-41-copilot",jx=class t{constructor(e,r=!0){this._ctx=e;this.onModelsFetchedCallbacks=[];this.fetchedModelData=[];this.editorPreviewFeaturesDisabled=!1;r&&vs(this._ctx,n=>this.refreshAvailableModels(n))}static{a(this,"AvailableModelsManager")}async refreshAvailableModels(e){await this.refreshModels(e);for(let r of this.onModelsFetchedCallbacks)r()}addHandler(e){this.onModelsFetchedCallbacks.push(e)}getDefaultModelId(){if(this.fetchedModelData){let e=t.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return wBo}parseModelsResponse(e){try{return aO.Parse(Ndn,e)}catch(r){Nr.exception(this._ctx,r,"Failed to parse /models response from CAPI");return}}async refreshModels(e){let r=await this.fetchModels(e);r&&(this.fetchedModelData=r)}async fetchModels(e){return this.editorPreviewFeaturesDisabled=e.getTokenValue("editor_preview_features")=="0",await this.fetch(e)}fetch(e){return(!this.fetchInProgress||this.fetchInProgress.withToken.token!==e.token)&&(this.fetchInProgress={withToken:e,response:this.fetchImpl(e).finally(()=>{this.fetchInProgress=void 0})}),this.fetchInProgress.response}async fetchImpl(e){let r=await HY(this._ctx,"/models",e);return r.ok?this.parseModelsResponse(await r.json())?.data??[]:(Nr.error(this._ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText}),null)}getGenericCompletionModels(){let e=t.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return t.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:"o200k_base"}static filterCompletionModels(e,r){return e.filter(n=>n.capabilities.type==="completion").filter(n=>!r||n.preview===!1||n.preview===void 0)}static filterModelsWithEditorPreviewFeatures(e,r){return e.filter(n=>!r||n.preview===!1||n.preview===void 0)}static mapCompletionModels(e){return e.map(r=>({modelId:r.id,label:r.name,preview:!!r.preview,tokenizer:r.capabilities.tokenizer}))}getCurrentModelRequestInfo(e=void 0){let r=this.getDefaultModelId(),n=Odn(this._ctx);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&Nr.error(this._ctx,`User selected model ${n} is not in the list of generic models: ${l.join(", ")}, falling back to default model.`),n=null),r===n&&(n=null)}let o=Rt(this._ctx,ze.DebugOverrideEngine)||Rt(this._ctx,ze.DebugOverrideEngineLegacy);if(o)return new $Y(o,"override");let s=e?this._ctx.get(Jt).customEngine(e):"",c=e?this._ctx.get(Jt).customEngineTargetEngine(e):void 0;return n?s&&c&&n===c?new $Y(s,"exp"):new $Y(n,"modelpicker"):s?new $Y(s,"exp"):new $Y(r,"default")}},$Y=class{constructor(e,r){this.modelId=e;this.modelChoiceSource=r}static{a(this,"ModelRequestInfo")}get headers(){return{}}};function TQ(t,e=void 0){let r=t.get(jx),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(TQ,"getEngineRequestInfo");p();p();var Qo=class{static{a(this,"FileSystem")}};var Rfn=fe(wfn());function kfn(t){return t!==void 0&&t!==0}a(kfn,"isRepoInfo");function Pfn(t){if(t===void 0||t===0)return"";let e=VY(t);if(e==="github/github")return e;let r=e3o(t)?.toLowerCase();return r!==void 0?r:""}a(Pfn,"getDogFood");function VY(t){if(t!==void 0&&t!==0&&t.hostname==="github.com")return t.owner+"/"+t.repo}a(VY,"tryGetGitHubNWO");function e3o(t){if(t===void 0||t===0)return;let e=t.hostname.toLowerCase(),r=e==="azure.com"||e.endsWith(".azure.com"),n=e==="visualstudio.com"||e.endsWith(".visualstudio.com");if(r||n)return t.owner+"/"+t.repo}a(e3o,"tryGetADONWO");function IQ(t,e){let r=mf(e);return t3o(t,r)}a(IQ,"extractRepoInfoInBackground");var t3o=o3o(r3o,1e4);async function r3o(t,e){let r=FJr(e);if(!r)return;let n=await n3o(t,r);if(!n)return;let o=t.get(Qo),s=wa(n,".git","config"),c;try{c=await o.readFileString(s)}catch{return}let l=i3o(c)??"",u=j8t(l),d={uri:n};return u===void 0?{baseFolder:d,url:l,hostname:"",owner:"",repo:"",pathname:""}:{baseFolder:d,url:l,...u}}a(r3o,"extractRepoInfo");function j8t(t){let e;try{if(e=(0,Rfn.default)(t),e.resource==""||e.owner==""||e.name==""||e.pathname=="")return}catch{return}return{hostname:e.resource,owner:e.owner,repo:e.name,pathname:e.pathname}}a(j8t,"parseRepoUrl");async function n3o(t,e){let r=e+"_add_to_make_longer",n=t.get(Qo);for(;e!=="file:///"&&e.length{let c=JSON.stringify(s),l=r.get(c);if(l)return l.result;if(n.has(c))return 0;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new q8t(d)),n.delete(c)}),0}}a(o3o,"computeInBackgroundAndMemoize");p();var gIe=500,Dfn=8192-gIe,Nfn=4,_Ve=10,Mfn=1e3*5,vVe={prefix:35,suffix:15,stableContext:35,volatileContext:15},s3o={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function AIe(t){return t=t.toLowerCase(),s3o[t]??t}a(AIe,"normalizeLanguageId");var H8t=class{constructor(e){this.ctx=e;this.cache=new Cn(200)}static{a(this,"FilterSettingsToExpConfigs")}async fetchExpConfig(e,r){let n=e.stringify()+` +`+JSON.stringify(r),o=this.cache.get(n);return o||(o=new G8t(()=>this.ctx.get(_P).fetchExperiments(this.ctx,r,e.toHeaders()),1e3*60*60),this.cache.set(n,o)),o.run()}getCachedExpConfig(e){return this.cache.get(e.stringify())?.value()}},G8t=class{constructor(e,r=1/0){this.producer=e;this.expirationMs=r}static{a(this,"Task")}async run(){return this.promise===void 0&&(this.promise=this.producer(),this.storeResult(this.promise).then(()=>{this.expirationMs<1/0&&this.promise!==void 0&&setTimeout(()=>this.promise=void 0,this.expirationMs)})),this.promise}async storeResult(e){try{this.result=await e}finally{this.result===void 0&&(this.promise=void 0)}}value(){return this.result}};function c3o(t){return"uri"in t}a(c3o,"isCompletionsFiltersInfo");var Jt=class t{constructor(e){this.ctx=e;this.staticFilters={};this.dynamicFilters={};this.dynamicFilterGroups=[];this.upcomingDynamicFilters={};this.assignments=new H8t(this.ctx)}static{a(this,"Features")}static{this.upcomingDynamicFilterCheckDelayMs=20}static{this.upcomingTimeBucketMinutes=5+Math.floor(Math.random()*11)}registerStaticFilters(e){Object.assign(this.staticFilters,e)}registerDynamicFilter(e,r){this.dynamicFilters[e]=r}registerDynamicFilterGroup(e){this.dynamicFilterGroups.push(e)}getDynamicFilterValues(){let e={};for(let r of this.dynamicFilterGroups)Object.assign(e,r());for(let[r,n]of Object.entries(this.dynamicFilters))e[r]=n();return e}registerUpcomingDynamicFilter(e,r){this.upcomingDynamicFilters[e]=r}async updateExPValuesAndAssignments(e,r,n=Vt.createAndMarkAsIssued()){if(n instanceof ix)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let o=r&&c3o(r)?IQ(this.ctx,r.uri):void 0,s=VY(o)??"",c=Pfn(o)??"",l=r?.languageId??"",u=TQ(this.ctx).modelId,d=kqr(e),f=e.getTokenValue("ol")??"",h=e.getTokenValue("tid")??"",m=e.getTokenValue("fcv1")==="1",g=e.getTokenValue("sn")==="1",y=this.ctx.get(Fp).getProperties(),E=e.endpoints,_={"X-Copilot-Repository":s,"X-Copilot-FileType":l,"X-Copilot-UserKind":d,"X-Copilot-Dogfood":c,"X-Copilot-Engine":u,"X-Copilot-Orgs":f,"X-Copilot-CopilotTrackingId":h,"X-GitHub-Copilot-SKU":y.sku||"","X-GitHub-Copilot-IsFcv1":m?"1":"0","X-GitHub-Copilot-IsSn":g?"1":"0"},v=this.getGranularityDirectory(),b=this.makeFilterSettings(_),T=v.extendFilters(b),w=await this.getExpConfig(T.newFilterSettings,E);v.update(b,+(w.variables.copilotbycallbuckets??NaN),+(w.variables.copilottimeperiodsizeinh??NaN));let R=v.extendFilters(b),x=R.newFilterSettings,P=await this.getExpConfig(x,E),D=new Promise(N=>setTimeout(N,t.upcomingDynamicFilterCheckDelayMs));for(let N of R.otherFilterSettingsToPrefetch)D=D.then(async()=>{await new Promise(L=>setTimeout(L,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(N,E)});return this.prepareForUpcomingFilters(x,E),new ix(n.properties,n.measurements,n.issuedTime,{filters:x,exp:P})}async fetchTokenAndUpdateExPValuesAndAssignments(e,r){let n=await this.ctx.get(Ft).getToken();return await this.updateExPValuesAndAssignments(n,e,r)}getGranularityDirectory(){if(!this.granularityDirectory){let e=this.ctx.get(qa).machineId;this.granularityDirectory=new $je(e,this.ctx.get(IC))}return this.granularityDirectory}makeFilterSettings(e){return new uB({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e,r){try{return this.assignments.fetchExpConfig(e,r)}catch(n){return VI.createFallbackConfig(this.ctx,`Error fetching ExP config: ${String(n)}`)}}async prepareForUpcomingFilters(e,r){if(!(new Date().getMinutes()<60-t.upcomingTimeBucketMinutes))for(let[n,o]of Object.entries(this.upcomingDynamicFilters))await new Promise(s=>setTimeout(s,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(e.withChange(n,o()),r)}stringify(){let e=this.assignments.getCachedExpConfig(new uB({}));return JSON.stringify(e?.variables??{})}async getFallbackExpAndFilters(){let e=this.makeFilterSettings({}),r=RB(this.ctx),n=await this.getExpConfig(e,r);return{filters:e,exp:n}}disableLogProb(e){return e.filtersAndExp.exp.variables.copilotdisablelogprob??!0}overrideBlockMode(e){return e.filtersAndExp.exp.variables.copilotoverrideblockmode||void 0}customEngine(e){return e.filtersAndExp.exp.variables.copilotcustomengine??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables.copilotcustomenginetargetengine}suffixPercent(e){return e.filtersAndExp.exp.variables.CopilotSuffixPercent??vVe.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables.copilotsuffixmatchthreshold??_Ve}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables.copilotcppheadersenableswitch??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscodecsharp??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscodetypescript??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscode??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables.copilotcontextproviders??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e){return e.filtersAndExp.exp.variables.copilotcontextprovidertimebudget??150}includeNeighboringFiles(e){return e.filtersAndExp.exp.variables.copilotincludeneighboringfiles??!1}excludeRelatedFiles(e){return e.filtersAndExp.exp.variables.copilotexcluderelatedfiles??!1}maxPromptCompletionTokens(e){return e.filtersAndExp.exp.variables.maxpromptcompletionTokens??Dfn+gIe}ideChatMaxRequestTokens(e){return e.filtersAndExp.exp.variables.idechatmaxrequesttokens??-1}ideChatExpModelIds(e){return e.filtersAndExp.exp.variables.idechatexpmodelids??""}ideChatEnableProjectMetadata(e){return e.filtersAndExp.exp.variables.idechatenableprojectmetadata??!1}ideDataMigrationCompleted(e){return e.filtersAndExp.exp.variables.idedatamigrationcompleted??!1}workspaceContextCoordinator(e){return e.filtersAndExp.exp.variables.copilotworkspacecontextcoordinator??!1}workspaceContextCacheTime(e){return e.filtersAndExp.exp.variables.copilotworkspacecontextcachetime??Mfn}stableContextPercent(e){return e.filtersAndExp.exp.variables.copilotstablecontextpercent??vVe.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables.copilotvolatilecontextpercent??vVe.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotcppContextProviderParams}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotcsharpcontextproviderparams}javaContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotjavacontextproviderparams}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotmultilanguagecontextproviderparams}tsContextProviderParams(e){return e.filtersAndExp.exp.variables.copilottscontextproviderparams}completionsDebounce(e){return e.filtersAndExp.exp.variables.copilotcompletionsdebounce}enableElectronFetcher(e){return e.filtersAndExp.exp.variables.copilotelectronfetcher??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables.copilotfetchfetcher??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables.copilotasynccompletionstimeout??200}enablePromptContextProxyField(e){return e.filtersAndExp.exp.variables.copilotenablepromptcontextproxyfield??!1}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables.copilotprogressivereveal??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables.copilotmodelterminatesingleline??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables.copilotprogressivereveallonglookaheadsize??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables.copilotprogressiverevealshortlookaheadsize??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables.copilotmaxmultilinetokens??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables.copilotmultilineafteracceptlines??1}enableNESXTab(e){return e.filtersAndExp.exp.variables.copilotnesxtab??!1}getNESXTabModelID(e){return e.filtersAndExp.exp.variables.copilotnesxtabmodelid??"copilot-nes-xtab"}completionsDelay(e){return e.filtersAndExp.exp.variables.copilotcompletionsdelay??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables.copilotsinglelineunlessaccepted??!1}useCompletionsComparisonPanel(e){return e.filtersAndExp.exp.variables.copilotusecompletionscomparisonpanel??!1}comparisonPanelModelIds(e){return e.filtersAndExp.exp.variables.copilotcomparisonpanelmodelids??""}comparisonPanelRandomizedMode(e){return e.filtersAndExp.exp.variables.copilotcomparisonpanelrandomizedmode??!0}useChatLibCompletions(e){return e.filtersAndExp.exp.variables.copilotusechatlibcompletions??!1}cveRemediatorAgentEnabled(e){return e.filtersAndExp.exp.variables.cveremediatoragentenabled??!1}instantApplyModelMigration(e){return e.filtersAndExp.exp.variables.copilotinstantapplymodelmigration??!1}appmodContextMenuEnabled(e){return e.filtersAndExp.exp.variables.copilotappmodcontextmenuenabled??!1}appmodProblemsViewEnabled(e){return e.filtersAndExp.exp.variables.copilotappmodproblemsviewenabled??!1}searchAgentEnabled(e){return e.filtersAndExp.exp.variables.copilotsearchagentenabled??!1}cliAsDefaultAgentProviderEnabled(e){return e.filtersAndExp.exp.variables.copilotcliasdefaultagentprovider??!1}inlineChatUseCliEnabled(e){return e.filtersAndExp.exp.variables.inlinechatusecli??!1}ideEnableCopilotNesNonFreeEnabled(e){return e.filtersAndExp.exp.variables.ideenablecopilotnes??!1}};async function CVe(t){let e=Rt(t,ze.SearchAgent);if(e==="true")return!0;if(e==="false")return!1;let r=t.get(Jt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments();return r.searchAgentEnabled(n)}a(CVe,"isSearchAgentEnabled");function Ofn(t,e){let r=Rt(t,ze.EnableCopilotNesNonFree);return r==="true"?!0:r==="false"?!1:t.get(Jt).ideEnableCopilotNesNonFreeEnabled(e)}a(Ofn,"isIdeEnableCopilotNesNonFreeEnabled");p();p();p();var bVe=fe(mle());var V8t={python:"python",javascript:"javascript",javascriptreact:"javascript",jsx:"javascript",typescript:"typescript",typescriptreact:"tsx",go:"go",ruby:"ruby",csharp:"c-sharp",java:"java",php:"php",c:"cpp",cpp:"cpp"};function OS(t){return t in V8t&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(OS,"isSupportedLanguageId");function SVe(t){if(!(t in V8t))throw new Error(`Unrecognized language: ${t}`);return V8t[t]}a(SVe,"languageIdToWasmLanguage");var $8t=new Map;async function l3o(t){let e;try{e=await rVe(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new CQ(`Could not load tree-sitter-${t}.wasm`,r):r}return bVe.default.Language.load(e)}a(l3o,"loadWasmLanguage");function z8t(t){let e=SVe(t);if(!$8t.has(e)){let r=l3o(e);$8t.set(e,r)}return $8t.get(e)}a(z8t,"getLanguage");var W8t=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function xQ(t,e){return(await Y8t(t,e))[0]}a(xQ,"parseTreeSitter");async function Y8t(t,e){await bVe.default.init({locateFile:a(s=>uIe(s),"locateFile")});let r;try{r=new bVe.default}catch(s){throw s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&s.message.includes("table index is out of bounds")?new W8t(`Could not init Parse for language <${t}>`,s):s}let n=await z8t(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(Y8t,"parseTreeSitterIncludingVersion");function Lfn(t){switch(SVe(t)){case"python":return null;case"javascript":case"typescript":case"tsx":case"go":case"c-sharp":case"java":case"php":case"cpp":return"}";case"ruby":return"end"}}a(Lfn,"getBlockCloseToken");function u3o(t,e){let r=[];for(let n of t){if(!n[1]){let o=e.tree.getLanguage();n[1]=o.query(n[0])}r.push(...n[1].matches(e))}return r}a(u3o,"innerQuery");var d3o=[`[ (class_definition (block (expression_statement (string)))) (function_definition (block (expression_statement (string)))) -]`];function Ddn(t){return tLo([rLo],t).length==1}a(Ddn,"queryPythonIsDocstring");var eO=class{constructor(e){this.node=e;this.children=[];this.collapsed=!1}static{a(this,"StatementNode")}addChild(e){e.parent=this,e.nextSibling=void 0,this.children.length>0&&(this.children[this.children.length-1].nextSibling=e),this.children.push(e)}childrenFinished(){}containsStatement(e){return this.node.startIndex<=e.node.startIndex&&this.node.endIndex>=e.node.endIndex}statementAt(e){if(this.node.startIndex>e||this.node.endIndex(r=n.statementAt(e),r!==void 0)),r??this}collapse(){this.children.length=0,this.collapsed=!0}get description(){return`${this.node.type} ([${this.node.startPosition.row},${this.node.startPosition.column}]..[${this.node.endPosition.row},${this.node.endPosition.column}]): ${JSON.stringify(this.node.text.length>33?this.node.text.substring(0,15)+"..."+this.node.text.slice(-15):this.node.text)}`}dump(e="",r=""){let n=[`${e}${this.description}`];return this.children.forEach(o=>{n.push(o.dump(`${r}+- `,o.nextSibling===void 0?`${r} `:`${r}| `))}),n.join(` +]`];function Bfn(t){return u3o([d3o],t).length==1}a(Bfn,"queryPythonIsDocstring");var cO=class{constructor(e){this.node=e;this.children=[];this.collapsed=!1}static{a(this,"StatementNode")}addChild(e){e.parent=this,e.nextSibling=void 0,this.children.length>0&&(this.children[this.children.length-1].nextSibling=e),this.children.push(e)}childrenFinished(){}containsStatement(e){return this.node.startIndex<=e.node.startIndex&&this.node.endIndex>=e.node.endIndex}statementAt(e){if(this.node.startIndex>e||this.node.endIndex(r=n.statementAt(e),r!==void 0)),r??this}collapse(){this.children.length=0,this.collapsed=!0}get description(){return`${this.node.type} ([${this.node.startPosition.row},${this.node.startPosition.column}]..[${this.node.endPosition.row},${this.node.endPosition.column}]): ${JSON.stringify(this.node.text.length>33?this.node.text.substring(0,15)+"..."+this.node.text.slice(-15):this.node.text)}`}dump(e="",r=""){let n=[`${e}${this.description}`];return this.children.forEach(o=>{n.push(o.dump(`${r}+- `,o.nextSibling===void 0?`${r} `:`${r}| `))}),n.join(` `)}dumpPath(e="",r="",n=!1){if(this.parent){let o=this.parent.dumpPath(e,r,!0),s=o.length-o.lastIndexOf(` `)-1-r.length,c=" ".repeat(s),l=n?` ${r}${c}+- `:"";return o+this.description+l}else{let o=n?` -${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.languageId=e;this.text=r;this.startOffset=n;this.endOffset=o;this.statements=[]}static{a(this,"StatementTree")}static isSupported(e){return cle.languageIds.has(e)||lle.languageIds.has(e)||ZTe.languageIds.has(e)||ule.languageIds.has(e)||XTe.languageIds.has(e)||eIe.languageIds.has(e)||tIe.languageIds.has(e)||rIe.languageIds.has(e)||nIe.languageIds.has(e)}static isTrimmedByDefault(e){return cle.languageIds.has(e)||lle.languageIds.has(e)||ule.languageIds.has(e)}static create(e,r,n,o){if(cle.languageIds.has(e))return new cle(e,r,n,o);if(lle.languageIds.has(e))return new lle(e,r,n,o);if(ZTe.languageIds.has(e))return new ZTe(e,r,n,o);if(ule.languageIds.has(e))return new ule(e,r,n,o);if(tIe.languageIds.has(e))return new tIe(e,r,n,o);if(XTe.languageIds.has(e))return new XTe(e,r,n,o);if(eIe.languageIds.has(e))return new eIe(e,r,n,o);if(rIe.languageIds.has(e))return new rIe(e,r,n,o);if(nIe.languageIds.has(e))return new nIe(e,r,n,o);throw new Error(`Unsupported languageId: ${e}`)}[Symbol.dispose](){this.tree&&(this.tree.delete(),this.tree=void 0)}clear(){this.statements.length=0}statementAt(e){let r;return this.statements.find(n=>(r=n.statementAt(e),r!==void 0)),r}async build(){let e=[];this.clear();let r=await this.parse();this.getStatementQuery(r).captures(r.rootNode,{startPosition:this.offsetToPosition(this.startOffset),endPosition:this.offsetToPosition(this.endOffset)}).forEach(o=>{let s=this.createNode(o.node);for(;e.length>0&&!e[0].containsStatement(s);)e.shift()?.childrenFinished();e.length>0?e[0].addChild(s):this.addStatement(s),e.unshift(s)}),e.forEach(o=>o.childrenFinished())}addStatement(e){e.parent=void 0,e.nextSibling=void 0,this.statements.length>0&&(this.statements[this.statements.length-1].nextSibling=e),this.statements.push(e)}async parse(){return this.tree||(this.tree=await AQ(this.languageId,this.text)),this.tree}getStatementQuery(e){return this.getQuery(e.getLanguage(),this.getStatementQueryText())}getQuery(e,r){return e.query(r)}offsetToPosition(e){let r=this.text.slice(0,e).split(` +${r}+- `:"";return e+this.description+o}}},ug=class{constructor(e,r,n,o){this.languageId=e;this.text=r;this.startOffset=n;this.endOffset=o;this.statements=[]}static{a(this,"StatementTree")}static isSupported(e){return gle.languageIds.has(e)||Ale.languageIds.has(e)||yIe.languageIds.has(e)||yle.languageIds.has(e)||EIe.languageIds.has(e)||_Ie.languageIds.has(e)||vIe.languageIds.has(e)||CIe.languageIds.has(e)||bIe.languageIds.has(e)}static isTrimmedByDefault(e){return gle.languageIds.has(e)||Ale.languageIds.has(e)||yle.languageIds.has(e)}static create(e,r,n,o){if(gle.languageIds.has(e))return new gle(e,r,n,o);if(Ale.languageIds.has(e))return new Ale(e,r,n,o);if(yIe.languageIds.has(e))return new yIe(e,r,n,o);if(yle.languageIds.has(e))return new yle(e,r,n,o);if(vIe.languageIds.has(e))return new vIe(e,r,n,o);if(EIe.languageIds.has(e))return new EIe(e,r,n,o);if(_Ie.languageIds.has(e))return new _Ie(e,r,n,o);if(CIe.languageIds.has(e))return new CIe(e,r,n,o);if(bIe.languageIds.has(e))return new bIe(e,r,n,o);throw new Error(`Unsupported languageId: ${e}`)}[Symbol.dispose](){this.tree&&(this.tree.delete(),this.tree=void 0)}clear(){this.statements.length=0}statementAt(e){let r;return this.statements.find(n=>(r=n.statementAt(e),r!==void 0)),r}async build(){let e=[];this.clear();let r=await this.parse();this.getStatementQuery(r).captures(r.rootNode,{startPosition:this.offsetToPosition(this.startOffset),endPosition:this.offsetToPosition(this.endOffset)}).forEach(o=>{let s=this.createNode(o.node);for(;e.length>0&&!e[0].containsStatement(s);)e.shift()?.childrenFinished();e.length>0?e[0].addChild(s):this.addStatement(s),e.unshift(s)}),e.forEach(o=>o.childrenFinished())}addStatement(e){e.parent=void 0,e.nextSibling=void 0,this.statements.length>0&&(this.statements[this.statements.length-1].nextSibling=e),this.statements.push(e)}async parse(){return this.tree||(this.tree=await xQ(this.languageId,this.text)),this.tree}getStatementQuery(e){return this.getQuery(e.getLanguage(),this.getStatementQueryText())}getQuery(e,r){return e.query(r)}offsetToPosition(e){let r=this.text.slice(0,e).split(` `),n=r.length-1,o=r[r.length-1].length;return{row:n,column:o}}dump(e=""){let r=[];return this.statements.forEach((n,o)=>{let s=`[${o}]`,c=" ".repeat(s.length);r.push(n.dump(`${e} ${s} `,`${e} ${c} `))}),r.join(` -`)}},X$e=class t extends eO{static{a(this,"JSStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","generator_function_declaration","class_declaration","statement_block","if_statement","switch_statement","for_statement","for_in_statement","while_statement","do_statement","try_statement","with_statement","labeled_statement","method_definition","interface_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="statement_block"||this.children.length===2&&this.node.childForFieldName("alternative")!==null&&this.children[0].node.type!=="statement_block"&&this.children[1].node.type!=="statement_block"}},cle=class extends ag{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new X$e(e)}getStatementQueryText(){return`[ +`)}},TVe=class t extends cO{static{a(this,"JSStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","generator_function_declaration","class_declaration","statement_block","if_statement","switch_statement","for_statement","for_in_statement","while_statement","do_statement","try_statement","with_statement","labeled_statement","method_definition","interface_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="statement_block"||this.children.length===2&&this.node.childForFieldName("alternative")!==null&&this.children[0].node.type!=="statement_block"&&this.children[1].node.type!=="statement_block"}},gle=class extends ug{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new TVe(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -1797,7 +1797,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (labeled_statement) (method_definition) (field_definition) - ] @statement`}},lle=class extends ag{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new X$e(e)}getStatementQueryText(){return`[ + ] @statement`}},Ale=class extends ug{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new TVe(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -1820,7 +1820,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (labeled_statement) (method_definition) (public_field_definition) - ] @statement`}},T8t=class t extends eO{static{a(this,"PyStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","for_statement","while_statement","try_statement","with_statement","function_definition","class_definition","decorated_definition","match_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"?!1:this.node.startPosition.row===this.node.endPosition.row}},ZTe=class extends ag{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new T8t(e)}getStatementQueryText(){return`[ + ] @statement`}},K8t=class t extends cO{static{a(this,"PyStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","for_statement","while_statement","try_statement","with_statement","function_definition","class_definition","decorated_definition","match_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"?!1:this.node.startPosition.row===this.node.endPosition.row}},yIe=class extends ug{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new K8t(e)}getStatementQueryText(){return`[ (future_import_statement) (import_statement) (import_from_statement) @@ -1846,24 +1846,24 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (decorated_definition) (match_statement) (block) - ] @statement`}},I8t=class t extends eO{static{a(this,"GoStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","method_declaration","if_statement","for_statement","expression_switch_statement","type_switch_statement","select_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},ule=class extends ag{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new I8t(e)}getStatementQueryText(){return`[ + ] @statement`}},J8t=class t extends cO{static{a(this,"GoStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","method_declaration","if_statement","for_statement","expression_switch_statement","type_switch_statement","select_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},yle=class extends ug{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new J8t(e)}getStatementQueryText(){return`[ (package_clause) (function_declaration) (method_declaration) (import_declaration) (_statement) (block) - ] @statement`}},x8t=class t extends eO{static{a(this,"PhpStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","else_clause","else_if_clause","for_statement","foreach_statement","while_statement","do_statement","switch_statement","try_statement","catch_clause","finally_clause","anonymous_function","compound_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},XTe=class extends ag{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new x8t(e)}getStatementQueryText(){return`[ + ] @statement`}},Z8t=class t extends cO{static{a(this,"PhpStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","else_clause","else_if_clause","for_statement","foreach_statement","while_statement","do_statement","switch_statement","try_statement","catch_clause","finally_clause","anonymous_function","compound_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},EIe=class extends ug{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new Z8t(e)}getStatementQueryText(){return`[ (statement) (compound_statement) (method_declaration) (property_declaration) (const_declaration) (use_declaration) - ] @statement`}},w8t=class t extends eO{static{a(this,"RubyStatementNode")}static{this.compoundTypeNames=new Set(["if","case","while","until","for","begin","module","class","method"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},eIe=class extends ag{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new w8t(e)}getStatementQueryText(){return`[ + ] @statement`}},X8t=class t extends cO{static{a(this,"RubyStatementNode")}static{this.compoundTypeNames=new Set(["if","case","while","until","for","begin","module","class","method"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},_Ie=class extends ug{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new X8t(e)}getStatementQueryText(){return`[ (_statement) (when) - ] @statement`}},R8t=class t extends eO{static{a(this,"JavaStatementNode")}static{this.compoundTypeNames=new Set(["block","do_statement","enhanced_for_statement","for_statement","if_statement","labeled_statement","switch_expression","synchronized_statement","try_statement","try_with_resources_statement","while_statement","interface_declaration","method_declaration","constructor_declaration","compact_constructor_declaration","class_declaration","annotation_type_declaration","static_initializer"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},tIe=class extends ag{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new R8t(e)}getStatementQueryText(){return`[ + ] @statement`}},e6t=class t extends cO{static{a(this,"JavaStatementNode")}static{this.compoundTypeNames=new Set(["block","do_statement","enhanced_for_statement","for_statement","if_statement","labeled_statement","switch_expression","synchronized_statement","try_statement","try_with_resources_statement","while_statement","interface_declaration","method_declaration","constructor_declaration","compact_constructor_declaration","class_declaration","annotation_type_declaration","static_initializer"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},vIe=class extends ug{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new e6t(e)}getStatementQueryText(){return`[ (statement) (field_declaration) (record_declaration) @@ -1876,7 +1876,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (block) (static_initializer) (constructor_declaration) - ] @statement`}},k8t=class t extends eO{static{a(this,"CSharpStatementNode")}static{this.compoundTypeNames=new Set(["block","checked_statement","class_declaration","constructor_declaration","destructor_declaration","do_statement","fixed_statement","for_statement","foreach_statement","if_statement","interface_declaration","lock_statement","method_declaration","struct_declaration","switch_statement","try_statement","unsafe_statement","while_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},rIe=class extends ag{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new k8t(e)}getStatementQueryText(){return`[ + ] @statement`}},t6t=class t extends cO{static{a(this,"CSharpStatementNode")}static{this.compoundTypeNames=new Set(["block","checked_statement","class_declaration","constructor_declaration","destructor_declaration","do_statement","fixed_statement","for_statement","foreach_statement","if_statement","interface_declaration","lock_statement","method_declaration","struct_declaration","switch_statement","try_statement","unsafe_statement","while_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},CIe=class extends ug{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new t6t(e)}getStatementQueryText(){return`[ (extern_alias_directive) (using_directive) (global_attribute) @@ -1888,7 +1888,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (declaration) (accessor_declaration) (block) - ] @statement`}},P8t=class t extends eO{static{a(this,"CStatementNode")}static{this.compoundTypeNames=new Set(["declaration","function_definition","enum_specifier","field_declaration_list","type_definition","compound_statement","if_statement","switch_statement","while_statement","for_statement","do_statement","preproc_if","preproc_ifdef","namespace_definition","class_specifier","field_declaration_list","concept_definition","template_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){(this.isSingleLineDeclarationStatement()||this.isSingleLineConceptDefinition())&&this.collapse()}isSingleLineDeclarationStatement(){return!(this.node.type!=="declaration"||this.node.startPosition.row!==this.node.endPosition.row)}isSingleLineConceptDefinition(){return!(this.node.type!=="concept_definition"||this.node.startPosition.row!==this.node.endPosition.row)}},nIe=class extends ag{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new P8t(e)}getStatementQueryText(){return`[ + ] @statement`}},r6t=class t extends cO{static{a(this,"CStatementNode")}static{this.compoundTypeNames=new Set(["declaration","function_definition","enum_specifier","field_declaration_list","type_definition","compound_statement","if_statement","switch_statement","while_statement","for_statement","do_statement","preproc_if","preproc_ifdef","namespace_definition","class_specifier","field_declaration_list","concept_definition","template_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){(this.isSingleLineDeclarationStatement()||this.isSingleLineConceptDefinition())&&this.collapse()}isSingleLineDeclarationStatement(){return!(this.node.type!=="declaration"||this.node.startPosition.row!==this.node.endPosition.row)}isSingleLineConceptDefinition(){return!(this.node.type!=="concept_definition"||this.node.startPosition.row!==this.node.endPosition.row)}},bIe=class extends ug{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new r6t(e)}getStatementQueryText(){return`[ (declaration) (function_definition) (type_definition) @@ -1925,7 +1925,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (using_declaration) (alias_declaration) (static_assert_declaration) - ] @statement`}};var tO=class{constructor(e,r,n){this.languageId=e;this.prefix=r;this.completion=n}static{a(this,"BlockTrimmer")}static isSupported(e){return ag.isSupported(e)}static isTrimmedByDefault(e){return ag.isTrimmedByDefault(e)}async withParsedStatementTree(e){var n=[];try{let r=Rkt(n,ag.create(this.languageId,this.prefix+this.completion,this.prefix.length,this.prefix.length+this.completion.length));await r.build();return await e(r)}catch(o){var s=o,c=!0}finally{kkt(n,s,c)}}trimmedCompletion(e){return e===void 0?this.completion:this.completion.substring(0,e)}getStatementAtCursor(e){return e.statementAt(Math.max(this.prefix.length-1,0))??e.statements[0]}getContainingBlockOffset(e){let r;if(e&&this.isCompoundStatement(e))r=e;else if(e){let n=e.parent;for(;n&&!this.isCompoundStatement(n);)n=n.parent;r=n}if(r){let n=this.asCompletionOffset(r.node.endIndex);if(n&&this.completion.substring(n).trim()!=="")return n}}hasNonStatementContentAfter(e){if(!e||!e.nextSibling)return!1;let r=this.asCompletionOffset(e.node.endIndex),n=this.asCompletionOffset(e.nextSibling.node.startIndex);return this.completion.substring(Math.max(0,r??0),Math.max(0,n??0)).trim()!==""}asCompletionOffset(e){return e===void 0?void 0:e-this.prefix.length}isCompoundStatement(e){return e.isCompoundStatementType||e.children.length>0}};var eVe=class extends tO{constructor(r,n,o,s=3,c=7){super(r,n,o);this.lineLimit=s;this.lookAhead=c;let l=[...this.completion.matchAll(/\n/g)],u=this.lineLimit+this.lookAhead;l.length>=this.lineLimit&&this.lineLimit>0&&(this.limitOffset=l[this.lineLimit-1].index),l.length>=u&&u>0&&(this.lookAheadOffset=l[u-1].index)}static{a(this,"TerseBlockTrimmer")}async getCompletionTrimOffset(){return await this.withParsedStatementTree(r=>{let n=r.statementAt(this.stmtStartPos()),o=this.getContainingBlockOffset(n);return o=this.trimAtFirstBlankLine(o),n&&(o=this.trimAtStatementChange(n,o)),this.limitOffset&&this.lookAheadOffset&&(o===void 0||o>this.lookAheadOffset)?this.limitOffset:o})}stmtStartPos(){let r=this.completion.match(/\S/);return r&&r.index!==void 0?this.prefix.length+r.index:Math.max(this.prefix.length-1,0)}trimAtFirstBlankLine(r){let n=[...this.trimmedCompletion(r).matchAll(/\r?\n\s*\r?\n/g)];for(;n.length>0&&(r===void 0||r>n[0].index);){let o=n.shift();if(this.completion.substring(0,o.index).trim()!=="")return o.index}return r}trimAtStatementChange(r,n){let o=this.prefix.length,s=this.prefix.length+(n??this.completion.length);if(r.node.endIndex>o&&this.isCompoundStatement(r))return r.nextSibling&&r.node.endIndexo&&c.node.endIndexpLo,build:()=>uLo,buildType:()=>dLo,default:()=>ELo,dependencies:()=>gLo,description:()=>cLo,devDependencies:()=>mLo,displayName:()=>aLo,engines:()=>fLo,name:()=>sLo,overrides:()=>ALo,overridesComments:()=>yLo,scripts:()=>hLo,version:()=>lLo});var sLo="copilot",aLo="GitHub Copilot",cLo="Your AI pair programmer",lLo="1.517.0",uLo="64",dLo="prod",fLo={node:">=22.13.0",npm:">=11.6.0 <12.0.0"},pLo={cliPackageVersion:"2.1.159"},hLo={postinstall:"tsx script/copyCopilotSdkFiles.ts",build:"tsx esbuild.ts",clean:"./script/build/clean.sh",compress:"tsx ./script/compressTokenizer.ts",generate_languages:"tsx script/generateLanguages.ts && prettier --write lib/src/language/generatedLanguages.ts",get_token:"tsx script/deviceFlow.ts --save-as-test-token",lint:'run-p --aggregate-output "lint:*"',"lint:deps":"depcruise -c .dependency-cruiser.js .","lint:eslint":"eslint -f visualstudio --quiet --cache .","lint:overrides":"tsx script/checkOverridesDocumented.ts","lint:prettier":"prettier --check . 2>&1","lint:types":"tsc --noEmit",inspect_auth_db:"tsx script/inspectAuthDb.ts",prebuild:"npm install",pretest:"npm run build","pretest:headless":"npm run build","pretest:lsp-client":"npm run build","pretest:lib-e2e":"npm run build",prewatch:"npm run build","prewatch:esbuild":"npm run build",start:"npm run watch",test:'npm-run-all "test:headless --ignore-scripts" lint',"test:headless":'npm-run-all test:lib test:agent "test:lib-e2e --ignore-scripts" test:prompt "test:lsp-client --ignore-scripts" lint',"test:agent":'mocha "agent/src/**/*.test.{ts,tsx}"',"test:lib":'mocha "lib/src/**/*.test.{ts,tsx}" "script/**/*.test.{ts,tsx}" --exclude "lib/src/**/*.int.test.ts"',"test:lib-int":'mocha "lib/src/**/*.int.test.ts"',"test:lib-e2e":'mocha "lib/e2e/src/**/*.test.{ts,tsx}" --exclude "lib/e2e/src/prompt/**/*.test.ts"',"test:lib-e2e-no-ci":'mocha "lib/e2e/no-ci/**/*.test.{ts,tsx}"',"test:lib-prompt-e2e":'mocha "lib/e2e/src/prompt/prompt.test.ts"',"test:lib-prompt-e2e-perf":"INCLUDE_PERFORMANCE=true npm run test:lib-prompt-e2e","test:lsp-client":'mocha "lsp-client/test/*.test.{ts,tsx}"',"test:prompt":'mocha "prompt/test/**/*.test.{ts,tsx}"',"test:prepare-msbench":"tsx script/setupMsbench.ts","test:run-msbench":"tsx lsp-client/test/msbench/agent/index.ts",watch:'run-p "watch:esbuild --ignore-scripts" "watch:types -- --preserveWatchOutput"',"watch:esbuild":"tsx esbuild.ts --watch","watch:types":"tsc --noEmit --watch"},mLo={"@azure/identity":"^4.13.1","@azure/keyvault-secrets":"^4.11.2","@github/prettier-config":"0.0.6","@limegrass/eslint-plugin-import-alias":"^1.6.1","@types/crypto-js":"^4.2.2","@types/diff":"^8.0.0","@types/git-url-parse":"^16.0.2","@types/js-yaml":"^4.0.6","@types/kerberos":"^1.1.2","@types/markdown-it":"^14.1.2","@types/mocha":"^10.0.10","@types/node":"~22.13.0","@types/semver":"^7.7.1","@types/sinon":"^21.0.1","@types/vscode":"1.125.0","@types/which":"^3.0.0","@types/yargs":"^17.0.35","@vscode/tree-sitter-wasm":"0.0.5-php.2","@yao-pkg/pkg":"^6.20.0",boxen:"^8.0.1",chalk:"^5.6.2","dependency-cruiser":"^17.4.3",esbuild:"^0.28.1","esbuild-plugin-copy":"^2.1.1",eslint:"^9.39.4","eslint-formatter-visualstudio":"^9.0.1","eslint-plugin-mocha":"^10.5.0",globals:"^17.7.0","js-yaml":"^4.2.0",mocha:"^11.7.6","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","npm-run-all":"^4.1.5",openai:"^6.45.0",prettier:"^3.5.3","prettier-plugin-organize-imports":"^4.2.0","simple-git":"^3.36.0",sinon:"^22.0.0","tree-sitter-bash":"^0.23.0","tree-sitter-powershell":"0.25.9","ts-dedent":"^2.3.0",tsx:"^4.22.4",typescript:"^5.9.3","typescript-eslint":"^8.39.1","vscode-dts":"^0.3.3"},gLo={"@adobe/helix-fetch":"github:devm33/helix-fetch#2a08fa939591a0e14f34f611adcc3ed767579e9a","@agentclientprotocol/sdk":"^0.22.1","@anthropic-ai/claude-agent-sdk":"0.3.159","@anthropic-ai/sdk":"^0.98.0","@github/copilot":"1.0.63","@github/keytar":"7.10.6","@github/memoize":"1.1.5","@microsoft/1ds-core-js":"^4.3.10","@microsoft/1ds-post-js":"^4.3.10","@microsoft/applicationinsights-web-basic":"^3.3.11","@modelcontextprotocol/sdk":"^1.29.0","@octokit/graphql":"^9.0.3","@octokit/rest":"^22.0.1","@parcel/watcher":"^2.5.6","@sinclair/typebox":"^0.34.49","@vscode/chat-lib":"^0.54.0","@vscode/codicons":"^0.0.45","@vscode/deviceid":"github:ghc-jetbrains/vscode-deviceid#f0e5738cd362ef20a09aeb30c3a8be99a9a710f5","@vscode/policy-watcher":"^1.4.0","@vscode/prompt-tsx":"^0.4.0-alpha.9","@vscode/webview-ui-toolkit":"^1.3.1","crypto-js":"^4.2.0",diff:"^9.0.0",dldr:"^0.0.10",events:"^3.3.0","git-url-parse":"^16.1.0",glob:"^11.1.0","jsonc-parser":"^3.3.1",kerberos:"^2.2.0","mac-ca":"^3.1.3","markdown-it":"^14.2.0",minimatch:"^10.2.5",open:"^10.2.0",semver:"^7.8.5",shiki:"~1.15.0","source-map-support":"^0.5.21",undici:"^7.28.0",uuid:"^14.0.0","vscode-languageclient":"^9.0.0","vscode-languageserver":"^9.0.0","vscode-languageserver-protocol":"^3.17","vscode-languageserver-textdocument":"~1.0.11","vscode-uri":"^3.1.0","web-tree-sitter":"^0.23.0",which:"^7.0.0","windows-ca-certs":"^0.2.2",ws:"^8.21.0",yargs:"^18.0.0"},ALo={fsevents:"<0",bindings:"npm:bundled-bindings@^1.5.0",jws:"^3.2.3",tar:"7.5.11","serialize-javascript":"^7.0.5",uuid:"^14.0.0","ip-address":"^10.1.1","fast-uri":"^3.1.2",zod:"3.25.76"},yLo={"//":"Rationale for each entry in `overrides`. Required by `npm run lint:overrides` (script/checkOverridesDocumented.ts). Each value should cover: why (CVE/GHSA or build-hack reason), which direct dep pulls in the vulnerable transitive, and the remove-when condition.",fsevents:"Build hack: macOS-only optional native dep; '<0' is an impossible semver that force-skips install on Linux/Windows pkg builds. Permanent \u2014 keep until @yao-pkg/pkg handles macOS-only optionalDependencies natively. See commit d635096c.",bindings:"Build hack: alias to bundled-bindings fork that resolves .node native addon paths after pkg/esbuild bundling. Required by kerberos. Drop when upstream `bindings` adopts platform-specific path resolution. See commits c4461665 and b55ece83.",jws:"CVE GHSA-869p-cjfg-cm3x (Improperly Verifies HMAC Signature). Pulled in by jsonwebtoken-family deps. Drop when all transitive consumers pin jws >= 3.2.3. See commit 2b5dc766.",tar:"CVE GHSA-9ppj-qmqm-q256 + GHSA-qffp-2rhf-9h96 (Symlink/Hardlink Path Traversal via Drive-Relative Linkpath). Pulled in by node-gyp / native-build deps. Drop when transitive consumers bump tar >= 7.5.11. See commit e2dff0f3.","serialize-javascript":"CVE GHSA-5c6j-r48x-rmvq (RCE via RegExp.flags / Date.toISOString) + GHSA-qj8w-gfj5-8c6v (ReDoS). Pulled in by mocha 11.x (^6.0.2). Dev-only. Drop when mocha bumps to a release that carries serialize-javascript >= 7.0.3. See commit d49f75fd.",uuid:"CVE GHSA-w5hq-g745-h8pq (missing buffer bounds checks in v3/v5/v6). Pulled in by msal-node and @vscode/deviceid as uuid 8.x/9.x. Drop when both upgrade to uuid >= 14. Dependabot alert #128. See commit 6315f3f8.","ip-address":"CVE GHSA-v2v4-37r5-5v8g (XSS in Address6 HTML-emitting methods: group/link/spanAll and AddressError.parseMessage). Pulled in by @modelcontextprotocol/sdk -> express-rate-limit. Not exploitable here (we don't render HTML or call the affected methods), but the override clears the alert. Drop when express-rate-limit bumps to a release carrying ip-address >= 10.1.1. Dependabot alert #129. See PR #854.","fast-uri":"CVE-2026-6321 GHSA-q3j6-qgpj-74h6 (host confusion via percent-encoded authority delimiters) + CVE-2026-6322 GHSA-v39h-62p7-jpjc (path traversal via percent-encoded dot segments). Pulled in by @modelcontextprotocol/sdk -> ajv -> fast-uri. Drop when ajv bumps to a release carrying fast-uri >= 3.1.2. Dependabot alerts #132, #133.",zod:"Type-resolution hack: pin to 3.25.76 so the v3 API at root 'zod' (used by @github/copilot/sdk's zod-3-authored .d.ts via `import * as z from 'zod'`) and the v4 API at the 'zod/v4' subpath (used by @anthropic-ai/claude-agent-sdk via `import { z } from 'zod/v4'`) resolve from a single zod install. Without this, @anthropic-ai/claude-agent-sdk's strict `\"zod\": \"^4.0.0\"` requirement makes npm install zod 4.x, which causes z.infer in @github/copilot/sdk types to collapse to 'unknown' (TS18046 in lib/src/backgroundAgent/*). zod 3.25+ ships both APIs (root = v3, /v4 subpath = v4) so both consumers work from one install. Mirrors the same workaround used by vscode-copilot-chat. Drop when @github/copilot publishes zod-4-compatible types OR @anthropic-ai/claude-agent-sdk relaxes its zod requirement to '^3.25.0 || ^4.0.0'."},ELo={name:sLo,displayName:aLo,description:cLo,version:lLo,build:uLo,buildType:dLo,engines:fLo,anthropicClaude:pLo,scripts:hLo,devDependencies:mLo,dependencies:gLo,overrides:ALo,overridesComments:yLo};var Ye={Enable:"enable",UserSelectedCompletionModel:"selectedCompletionModel",ShowEditorCompletions:"editor.showEditorCompletions",EnableAutoCompletions:"editor.enableAutoCompletions",DelayCompletions:"editor.delayCompletions",FilterCompletions:"editor.filterCompletions",FetchStrategy:"fetchStrategy",ToolConfirmAutoApprove:"agent.toolConfirmAutoApprove",AutoApproveUnmatchedTerminal:"agent.autoApproveUnmatchedTerminal",AutoApproveUnmatchedFileOp:"agent.autoApproveUnmatchedFileOp",TrustToolAnnotations:"agent.trustToolAnnotations",AutoApproveYoloMode:"agent.autoApproveYoloMode",EditorHandlesAllConfirmation:"agent.editorHandlesAllConfirmation",MaxToolCallingLoop:"agent.maxToolCallingLoop",AutoCompress:"agent.autoCompress",AnthropicThinkingBudgetToken:"agent.anthropicThinkingBudgetToken",EnableSkills:"agent.enableSkills",EnableHooks:"agent.enableHooks",EnableSandbox:"agent.sandbox.enabled",SandboxAddCurrentWorkingDirectory:"agent.sandbox.addCurrentWorkingDirectory",SandboxUserPolicy:"agent.sandbox.userPolicy",EnablePlugins:"agent.enablePlugins",EnableCustomAgents:"agent.enableCustomAgents",EnableOrgCustomAgents:"agent.enableOrgCustomAgents",UseAgentsMd:"agent.useAgentsMdFile",UseNestedAgentsMd:"agent.useNestedAgentsMdFiles",UseClaudeMd:"agent.useClaudeMdFile",UseNestedClaudeMd:"agent.useNestedClaudeMdFiles",CompletionsDelay:"completionsDelay",CompletionsDebounce:"completionsDebounce",EnableThinking:"agent.enableThinking",TranscriptDirectory:"agent.transcriptDirectory",AgentDebugLogsDirectory:"agent.agentDebugLogsDirectory",ClaudeCliPath:"agent.claude.cliPath",CodexCliPath:"agent.codex.cliPath",NESExtendedRange:"nextEditSuggestions.extendedRange",RelatedFilesVSCodeCSharp:"advanced.relatedFilesVSCodeCSharp",RelatedFilesVSCodeTypeScript:"advanced.relatedFilesVSCodeTypeScript",RelatedFilesVSCode:"advanced.relatedFilesVSCode",ContextProviders:"advanced.contextProviders",DebugOverrideLogLevels:"advanced.debug.overrideLogLevels",DebugFilterLogCategories:"advanced.debug.filterLogCategories",DebugSnippyOverrideUrl:"advanced.debug.codeRefOverrideUrl",DebugUseElectronFetcher:"advanced.debug.useElectronFetcher",DebugUseEditorFetcher:"advanced.debug.useEditorFetcher",UseSubsetMatching:"advanced.useSubsetMatching",ContextProviderTimeBudget:"advanced.contextProviderTimeBudget",DebugOverrideCapiUrl:"internal.capiUrl",DebugOverrideCapiUrlLegacy:"advanced.debug.overrideCapiUrl",DebugTestOverrideCapiUrl:"internal.capiTestUrl",DebugTestOverrideCapiUrlLegacy:"advanced.debug.testOverrideCapiUrl",DebugOverrideProxyUrl:"internal.completionsUrl",DebugOverrideProxyUrlLegacy:"advanced.debug.overrideProxyUrl",DebugTestOverrideProxyUrl:"internal.completionsTestUrl",DebugTestOverrideProxyUrlLegacy:"advanced.debug.testOverrideProxyUrl",DebugOverrideEngine:"internal.completionModel",DebugOverrideEngineLegacy:"advanced.debug.overrideEngine",AlwaysRequestMultiline:"internal.alwaysRequestMultiline",ModelAlwaysTerminatesSingleline:"internal.modelAlwaysTerminatesSingleline",TrimCompletionsAggressively:"internal.trimCompletionsAggressively",UseWorkspaceContextCoordinator:"internal.useWorkspaceContextCoordinator",ShowWorkspaceContextDebugger:"internal.showWorkspaceContextDebugger",IncludeNeighboringFiles:"internal.includeNeighboringFiles",ExcludeRelatedFiles:"internal.excludeRelatedFiles",DebugOverrideCppHeadersEnableSwitch:"internal.cppHeadersEnableSwitch",NESXTab:"internal.useXTab",NESUseExplicitRejection:"internal.nesUseExplicitRejection",UseSplitContextPrompt:"internal.useSplitContextPrompt",UseCompletionsComparisonPanel:"internal.useCompletionsComparisonPanel",ComparisonPanelModelIds:"internal.comparisonPanelModelIds",ComparisonPanelRandomizedMode:"internal.comparisonPanelRandomizedMode",UseFetchFetcher:"internal.useFetchFetcher",UseChatLibCompletions:"internal.useChatLibCompletions",HookErrorOccurredStackTrace:"internal.hookErrorOccurredStackTrace",AppendPromptTokenCache:"internal.appendPromptTokenCache",PromptPersistBasePath:"internal.promptPersistBasePath",EnableCopilotNesNonFree:"internal.enableCopilotNesNonFree",AnthropicMessagesEndpoint:"internal.anthropic.messagesEndpoint",UseHelixFetcher:"internal.useHelixFetcher",EnableMapCodeFallback:"internal.enableMapCodeFallback",SearchAgent:"internal.searchAgent",PerfEnabled:"internal.perf.enabled",TransparentTokenRefresh:"internal.auth.transparentTokenRefresh",AuthTokenEncryption:"internal.auth.tokenEncryption",DisableWorkspaceIndex:"internal.disableWorkspaceIndex"};function Ldn(t){return["server","parsingandserver"].includes(t)}a(Ldn,"shouldDoServerTrimming");var TP=class{static{a(this,"BlockModeConfig")}},dle=class extends TP{static{a(this,"ConfigBlockModeConfig")}forLanguage(e,r,n){let o=e.get(Zt).overrideBlockMode(n);if(o)return D8t(o,r);let s=e.get(Zt).enableProgressiveReveal(n);return(Ft(e,Ye.AlwaysRequestMultiline)??s)||tO.isTrimmedByDefault(r)?D8t("moremultiline",r):r=="ruby"?"parsing":kS(r)?"parsingandserver":"server"}};function _Lo(t){return["parsing","parsingandserver","moremultiline"].includes(t)}a(_Lo,"blockModeRequiresTreeSitter");function D8t(t,e){return t==="moremultiline"&&ag.isSupported(e)?t:_Lo(t)&&!kS(e)?"server":t}a(D8t,"toApplicableBlockMode");var Lo=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}},fle=class extends Lo{constructor(){super(...arguments);this.onDidChangeCopilotSettings=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeCopilotSettings");this.onDidChangeHttpSettings=this.onDidChangeCopilotSettings}static{a(this,"DefaultsOnlyConfigProvider")}getConfig(r){return vLo(r)}getOptionalConfig(r){return CLo(r)}dumpForTelemetry(){return{}}getExplicitlySetConfigs(){return new Map}getHttpSettings(){return{proxy:""}}},OY=class extends Lo{constructor(r,n){super();this.baseConfigProvider=r;this.overrides=n;this.copilotEmitter=new Wi;this.onDidChangeCopilotSettings=this.copilotEmitter.event;this.didChangeHttpSettingsEmitter=new Wi;this.onDidChangeHttpSettings=this.didChangeHttpSettingsEmitter.event;this.httpSettings=this.baseConfigProvider.getHttpSettings()}static{a(this,"InMemoryConfigProvider")}getOptionalOverride(r){return this.overrides.get(r)}getConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getConfig(r)}getOptionalConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getOptionalConfig(r)}setConfig(r,n){this.setCopilotSettings({[r]:n})}setCopilotSettings(r){for(let[n,o]of Object.entries(r))o!==void 0?this.overrides.set(n,o):this.overrides.delete(n);this.copilotEmitter.fire(this)}getExplicitlySetConfigs(){let r=new Map(this.baseConfigProvider.getExplicitlySetConfigs());for(let[n,o]of this.overrides)r.set(n,o);return r}getHttpSettings(){return this.httpSettings}setHttpSettings(r){let n=iIe(r);this.httpSettings=n,this.didChangeHttpSettingsEmitter.fire(this.getHttpSettings())}dumpForTelemetry(){let r=this.baseConfigProvider.dumpForTelemetry();for(let n of[Ye.ShowEditorCompletions,Ye.EnableAutoCompletions,Ye.DelayCompletions,Ye.FilterCompletions]){let o=this.overrides.get(n);o!==void 0&&(r[n]=JSON.stringify(o))}return r}};function Bdn(t,e){let r=t,n=[];for(let o of e.split(".")){let s=[...n,o].join(".");r&&typeof r=="object"&&s in r?(r=r[s],n.length=0):n.push(o)}if(!(r===void 0||n.length>0))return r}a(Bdn,"getConfigKeyRecursively");function vLo(t){if(tVe.has(t))return tVe.get(t);throw new Error(`Missing config default value: ${Nkt}.${t}`)}a(vLo,"getConfigDefaultForKey");function CLo(t){return tVe.get(t)}a(CLo,"getOptionalConfigDefaultForKey");function ple(t){return t.get(Lo).getExplicitlySetConfigs()}a(ple,"getExplicitlySetConfigs");var bLo={[Ye.DebugOverrideCppHeadersEnableSwitch]:!1,[Ye.RelatedFilesVSCodeCSharp]:!1,[Ye.RelatedFilesVSCodeTypeScript]:!1,[Ye.RelatedFilesVSCode]:!1,[Ye.IncludeNeighboringFiles]:!1,[Ye.ExcludeRelatedFiles]:!1,[Ye.ContextProviders]:[],[Ye.DebugUseEditorFetcher]:null,[Ye.DebugUseElectronFetcher]:null,[Ye.DebugOverrideLogLevels]:{},[Ye.DebugSnippyOverrideUrl]:"",[Ye.AgentDebugLogsDirectory]:void 0,[Ye.ClaudeCliPath]:void 0,[Ye.CodexCliPath]:void 0,[Ye.FetchStrategy]:"auto",[Ye.ToolConfirmAutoApprove]:!1,[Ye.AutoApproveUnmatchedTerminal]:void 0,[Ye.AutoApproveUnmatchedFileOp]:void 0,[Ye.TrustToolAnnotations]:!1,[Ye.AutoApproveYoloMode]:!1,[Ye.EditorHandlesAllConfirmation]:!1,[Ye.MaxToolCallingLoop]:25,[Ye.AutoCompress]:!1,[Ye.AnthropicThinkingBudgetToken]:1024,[Ye.EnableSkills]:!1,[Ye.EnableHooks]:!1,[Ye.EnableSandbox]:!1,[Ye.SandboxAddCurrentWorkingDirectory]:void 0,[Ye.SandboxUserPolicy]:void 0,[Ye.EnablePlugins]:!1,[Ye.EnableCustomAgents]:!0,[Ye.EnableOrgCustomAgents]:!0,[Ye.UseAgentsMd]:!1,[Ye.UseNestedAgentsMd]:!1,[Ye.UseClaudeMd]:!1,[Ye.UseNestedClaudeMd]:!1,[Ye.UseSubsetMatching]:null,[Ye.ContextProviderTimeBudget]:void 0,[Ye.DebugOverrideCapiUrl]:"",[Ye.DebugTestOverrideCapiUrl]:"",[Ye.DebugOverrideProxyUrl]:"",[Ye.DebugTestOverrideProxyUrl]:"",[Ye.DebugOverrideEngine]:"",[Ye.AlwaysRequestMultiline]:void 0,[Ye.ModelAlwaysTerminatesSingleline]:void 0,[Ye.TrimCompletionsAggressively]:void 0,[Ye.CompletionsDebounce]:void 0,[Ye.NESXTab]:void 0,[Ye.UseWorkspaceContextCoordinator]:void 0,[Ye.ShowWorkspaceContextDebugger]:!1,[Ye.CompletionsDelay]:void 0,[Ye.UseSplitContextPrompt]:void 0,[Ye.UseCompletionsComparisonPanel]:void 0,[Ye.ComparisonPanelModelIds]:void 0,[Ye.ComparisonPanelRandomizedMode]:void 0,[Ye.UseFetchFetcher]:void 0,[Ye.UseChatLibCompletions]:void 0,[Ye.TranscriptDirectory]:void 0,[Ye.EnableThinking]:!0,[Ye.ShowEditorCompletions]:void 0,[Ye.EnableAutoCompletions]:void 0,[Ye.DelayCompletions]:void 0,[Ye.FilterCompletions]:void 0,[Ye.Enable]:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},[Ye.UserSelectedCompletionModel]:"",[Ye.DebugFilterLogCategories]:[],[Ye.DebugOverrideEngineLegacy]:"",[Ye.DebugTestOverrideProxyUrlLegacy]:"",[Ye.DebugOverrideProxyUrlLegacy]:"",[Ye.DebugTestOverrideCapiUrlLegacy]:"",[Ye.DebugOverrideCapiUrlLegacy]:"",[Ye.HookErrorOccurredStackTrace]:!1,[Ye.NESUseExplicitRejection]:!1,[Ye.AppendPromptTokenCache]:"",[Ye.PromptPersistBasePath]:void 0,[Ye.AnthropicMessagesEndpoint]:"",[Ye.EnableCopilotNesNonFree]:"",[Ye.UseHelixFetcher]:"",[Ye.EnableMapCodeFallback]:"enabled",[Ye.SearchAgent]:"",[Ye.PerfEnabled]:"",[Ye.NESExtendedRange]:!1,[Ye.TransparentTokenRefresh]:"",[Ye.AuthTokenEncryption]:"",[Ye.DisableWorkspaceIndex]:""},tVe=new Map(Object.entries(bLo));for(let t of Object.values(Ye))if(!tVe.has(t))throw new Error(`Missing config default value ${Nkt}.${t}`);function Ft(t,e){return t.get(Lo).getConfig(e)}a(Ft,"getConfig");function IP(t){return Ft(t,Ye.DisableWorkspaceIndex)==="true"}a(IP,"isWorkspaceIndexDisabled");function CKr(t){return t.get(Lo).dumpForTelemetry()}a(CKr,"dumpForTelemetry");var ds=class{constructor(){this.packageJson=oIe}static{a(this,"BuildInfo")}isProduction(){return this.getBuildType()!=="dev"}getBuildType(){return this.packageJson.buildType}getVersion(){return this.packageJson.version}getDisplayVersion(){return this.getBuildType()==="dev"?`${this.getVersion()}-dev`:this.getVersion()}getBuild(){return this.packageJson.build}getName(){return this.packageJson.name}};function UDt(t){return t.get(ds).isProduction()}a(UDt,"isProduction");function Rtn(t){return t.get(ds).getBuildType()==="dev"}a(Rtn,"isDevBuild");function MU(t){return t.get(ds).getBuildType()}a(MU,"getBuildType");function bKr(t){return t.get(ds).getBuild()}a(bKr,"getBuild");function V1(t){return t.get(ds).getVersion()}a(V1,"getVersion");var Ua=class{constructor(e,r,n,o="none",s="desktop"){this.sessionId=e;this.machineId=r;this.devDeviceId=n;this.remoteName=o;this.uiKind=s}static{a(this,"EditorSession")}};function M1({name:t,version:e}){return`${t}/${e}`}a(M1,"formatNameAndVersion");var Ir=class{static{a(this,"EditorAndPluginInfo")}getCopilotIntegrationId(){}getEditorPluginSpecificFilters(){return[]}getEditorIdentity(){return vQr({editor:this.getEditorInfo(),plugin:this.getEditorPluginInfo()})}isEditorPluginInfoKnown(){return!0}};function S$e(t){let e=t.getCopilotIntegrationId();if(e)return e;switch(t.getEditorPluginInfo().name){case"copilot-intellij":return"jetbrains-chat";case"copilot":case"copilot-vs":return;default:return"jetbrains-chat"}}a(S$e,"getIntegrationId");function Gy(t){let e=t.get(Ir);return{"Editor-Version":M1(e.getEditorInfo()),"Editor-Plugin-Version":M1(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":V1(t)}}a(Gy,"editorVersionHeaders");var Fdn="Iv1.b507a08c87ecfe98",SLo="350ee525b5da0e4a54c6e8e043edc1b99cc02f19",Kae="Ov23liV9UpD7Rnfnskm3",TLo="5509a52e4c525cd594a6fba9147ff6cc2388dd9f",ILo={[Fdn]:SLo,[Kae]:TLo},zp=class{static{a(this,"GitHubAppInfo")}findAppIdToAuthenticate(){return this.githubAppId??Fdn}findAppSecretToAuthenticate(){let e=this.findAppIdToAuthenticate(),r=ILo[e];if(!r)throw new Error(`GitHubAppInfo: No app secret found for app ID: ${e}`);return r}};p();var xLo=new fe("expConfigManager"),wLo=3600*1e3,rO=class{constructor(e,r){this.ctx=e;this.fetchedAt=0;r.onDidChangeTokenResult(n=>{n.copilotToken&&this.refresh({force:!0})})}static{a(this,"ExpConfigManager")}getBoolean(e){let r=this.cached?.variables[e];return typeof r=="boolean"?r:void 0}getNumber(e){let r=this.cached?.variables[e];return typeof r=="number"?r:void 0}getString(e){let r=this.cached?.variables[e];return typeof r=="string"?r:void 0}getRaw(e){return this.cached?.variables[e]}refresh({force:e=!1}={}){return this.inflight?this.inflight:!e&&this.cached!==void 0&&Date.now()-this.fetchedAt{try{let{exp:r}=await this.ctx.get(Zt).getFallbackExpAndFilters();this.cached=r,this.fetchedAt=Date.now()}catch(r){xLo.exception(this.ctx,r,".refresh")}finally{this.inflight=void 0}})(),this.inflight)}};function ktn(t){let e=Ft(t,Ye.TransparentTokenRefresh);if(e==="true")return{value:!0,source:"config"};if(e==="false")return{value:!1,source:"config"};let r=t.get(rO).getBoolean("copilottransparenttokenrefresh");return typeof r=="boolean"?{value:r,source:"exp"}:{value:!1,source:"default"}}a(ktn,"resolveTransparentTokenRefresh");function Udn(t){return Ft(t,Ye.AuthTokenEncryption)==="false"}a(Udn,"isAuthTokenEncryptionDisabled");p();var Vdn=de(require("node:crypto"));var N8t=new fe("KeytarMasterKey"),jdn="copilot-language-server",Hdn="oauth-token-key",Gdn=5e3,Wdn=32,M8t;function PLo(t){return M8t??=DLo(t).finally(()=>{M8t=void 0}),M8t}a(PLo,"resolveMasterKey");async function DLo(t){let e;try{e=await L8t.loadKeytar()}catch(n){return N8t.warn(t,"keytar-master-key: @github/keytar failed to load",n),{diagnostics:O8t("loadModule",n)}}let r;try{r=await MLo(e)}catch(n){return n instanceof rVe?(N8t.error(t,"keytar-master-key: existing entry is corrupt; refusing to overwrite",n),{diagnostics:O8t("corruptExistingEntry",n)}):(N8t.warn(t,"keytar-master-key: master-key resolution failed",n),{diagnostics:O8t("getOrCreateMasterKey",n)})}return{masterKey:r.key,diagnostics:{available:!0,masterKeySource:r.source}}}a(DLo,"doResolveMasterKey");function NLo(){return Promise.resolve().then(()=>de(qdn()))}a(NLo,"loadKeytar");var L8t={resolveMasterKey:PLo,loadKeytar:NLo};async function MLo(t){let e=await $dn(t.getPassword(jdn,Hdn),Gdn,"getMasterKey");if(e){let n=OLo(e);if(n)return{key:n,source:"useExisting"};throw new rVe}let r=Vdn.randomBytes(Wdn);return await $dn(t.setPassword(jdn,Hdn,r.toString("base64")),Gdn,"setMasterKey"),{key:r,source:"createNew"}}a(MLo,"getOrCreateMasterKey");function $dn(t,e,r){return new Promise((n,o)=>{let s=setTimeout(()=>o(new Error(`${r}: timeout after ${e}ms`)),e);s.unref?.(),t.then(c=>{clearTimeout(s),n(c)},c=>{clearTimeout(s),o(c instanceof Error?c:new Error(`${r}: ${String(c)}`))})})}a($dn,"withTimeout");var rVe=class extends Error{static{a(this,"CorruptMasterKeyError")}constructor(){super("keytar master-key entry present but undecodable"),this.name="CorruptMasterKeyError"}};function O8t(t,e){return{available:!1,errorPhase:t,error:e}}a(O8t,"unavailable");function OLo(t){let e=Buffer.from(t,"base64");return e.length===Wdn?e:void 0}a(OLo,"decodeMasterKey");p();var hle=de(require("node:crypto"));var U8t=0,sVe=1,yQ=class extends Error{constructor(r,n,o){super(r,o?.cause!==void 0?{cause:o.cause}:void 0);this.kind=n;this.name="SecretUnwrapError"}static{a(this,"SecretUnwrapError")}},iVe=class{static{a(this,"SecretCodec")}},F8t=class extends iVe{constructor(){super(...arguments);this.schemaVersion=U8t}static{a(this,"PlaintextCodec")}encode(r){return Buffer.from(r,"utf8")}decode(r){return Buffer.from(r).toString("utf8")}},nVe=12,B8t=16,zdn=32,oVe=class extends iVe{constructor(r){super();this.key=r;this.schemaVersion=sVe;if(r.length!==zdn)throw new Error(`AesGcmCodec requires a ${zdn}-byte key, got ${r.length}`)}static{a(this,"AesGcmCodec")}encode(r){let n=hle.randomBytes(nVe),o=hle.createCipheriv("aes-256-gcm",this.key,n),s=Buffer.concat([o.update(Buffer.from(r,"utf8")),o.final()]);return Buffer.concat([n,s,o.getAuthTag()])}decode(r){let n=Buffer.from(r);if(n.length0}};var IVe=class extends lO{constructor(r,n,o,s=3,c=7){super(r,n,o);this.lineLimit=s;this.lookAhead=c;let l=[...this.completion.matchAll(/\n/g)],u=this.lineLimit+this.lookAhead;l.length>=this.lineLimit&&this.lineLimit>0&&(this.limitOffset=l[this.lineLimit-1].index),l.length>=u&&u>0&&(this.lookAheadOffset=l[u-1].index)}static{a(this,"TerseBlockTrimmer")}async getCompletionTrimOffset(){return await this.withParsedStatementTree(r=>{let n=r.statementAt(this.stmtStartPos()),o=this.getContainingBlockOffset(n);return o=this.trimAtFirstBlankLine(o),n&&(o=this.trimAtStatementChange(n,o)),this.limitOffset&&this.lookAheadOffset&&(o===void 0||o>this.lookAheadOffset)?this.limitOffset:o})}stmtStartPos(){let r=this.completion.match(/\S/);return r&&r.index!==void 0?this.prefix.length+r.index:Math.max(this.prefix.length-1,0)}trimAtFirstBlankLine(r){let n=[...this.trimmedCompletion(r).matchAll(/\r?\n\s*\r?\n/g)];for(;n.length>0&&(r===void 0||r>n[0].index);){let o=n.shift();if(this.completion.substring(0,o.index).trim()!=="")return o.index}return r}trimAtStatementChange(r,n){let o=this.prefix.length,s=this.prefix.length+(n??this.completion.length);if(r.node.endIndex>o&&this.isCompoundStatement(r))return r.nextSibling&&r.node.endIndexo&&c.node.endIndexC3o,build:()=>E3o,buildType:()=>_3o,default:()=>w3o,dependencies:()=>T3o,description:()=>A3o,devDependencies:()=>S3o,displayName:()=>g3o,engines:()=>v3o,name:()=>m3o,overrides:()=>I3o,overridesComments:()=>x3o,scripts:()=>b3o,version:()=>y3o});var m3o="copilot",g3o="GitHub Copilot",A3o="Your AI pair programmer",y3o="1.522.0",E3o="74",_3o="prod",v3o={node:">=22.13.0",npm:">=11.6.0 <12.0.0"},C3o={cliPackageVersion:"2.1.159"},b3o={postinstall:"tsx script/copyCopilotSdkFiles.ts",build:"tsx esbuild.ts",clean:"./script/build/clean.sh",compress:"tsx ./script/compressTokenizer.ts",generate_languages:"tsx script/generateLanguages.ts && prettier --write lib/src/language/generatedLanguages.ts",get_token:"tsx script/deviceFlow.ts --save-as-test-token",lint:'run-p --aggregate-output "lint:*"',"lint:deps":"depcruise -c .dependency-cruiser.js .","lint:eslint":"eslint -f visualstudio --quiet --cache .","lint:overrides":"tsx script/checkOverridesDocumented.ts","lint:prettier":"prettier --check . 2>&1","lint:types":"tsc --noEmit",inspect_auth_db:"tsx script/inspectAuthDb.ts",prebuild:"npm install",pretest:"npm run build","pretest:headless":"npm run build","pretest:lsp-client":"npm run build","pretest:lib-e2e":"npm run build",prewatch:"npm run build","prewatch:esbuild":"npm run build",start:"npm run watch",test:'npm-run-all "test:headless --ignore-scripts" lint',"test:headless":'npm-run-all test:lib test:agent "test:lib-e2e --ignore-scripts" test:prompt "test:lsp-client --ignore-scripts" lint',"test:agent":'mocha "agent/src/**/*.test.{ts,tsx}"',"test:lib":'mocha "lib/src/**/*.test.{ts,tsx}" "script/**/*.test.{ts,tsx}" --exclude "lib/src/**/*.int.test.ts"',"test:lib-int":'mocha "lib/src/**/*.int.test.ts"',"test:lib-e2e":'mocha "lib/e2e/src/**/*.test.{ts,tsx}" --exclude "lib/e2e/src/prompt/**/*.test.ts"',"test:lib-e2e-no-ci":'mocha "lib/e2e/no-ci/**/*.test.{ts,tsx}"',"test:lib-prompt-e2e":'mocha "lib/e2e/src/prompt/prompt.test.ts"',"test:lib-prompt-e2e-perf":"INCLUDE_PERFORMANCE=true npm run test:lib-prompt-e2e","test:lsp-client":'mocha "lsp-client/test/*.test.{ts,tsx}"',"test:prompt":'mocha "prompt/test/**/*.test.{ts,tsx}"',"test:prepare-msbench":"tsx script/setupMsbench.ts","test:run-msbench":"tsx lsp-client/test/msbench/agent/index.ts",watch:'run-p "watch:esbuild --ignore-scripts" "watch:types -- --preserveWatchOutput"',"watch:esbuild":"tsx esbuild.ts --watch","watch:types":"tsc --noEmit --watch"},S3o={"@azure/identity":"^4.13.1","@azure/keyvault-secrets":"^4.11.2","@github/prettier-config":"0.0.6","@limegrass/eslint-plugin-import-alias":"^1.6.1","@types/crypto-js":"^4.2.2","@types/diff":"^8.0.0","@types/git-url-parse":"^16.0.2","@types/js-yaml":"^4.0.6","@types/kerberos":"^1.1.2","@types/markdown-it":"^14.1.2","@types/mocha":"^10.0.10","@types/node":"~22.13.0","@types/semver":"^7.7.1","@types/sinon":"^22.0.0","@types/toposort":"^2.0.7","@types/vscode":"1.125.0","@types/which":"^3.0.0","@types/yargs":"^17.0.35","@vscode/tree-sitter-wasm":"0.0.5-php.2","@yao-pkg/pkg":"^6.21.0",boxen:"^8.0.1",chalk:"^5.6.2","dependency-cruiser":"^18.1.0",esbuild:"^0.28.1","esbuild-plugin-copy":"^2.1.1",eslint:"^9.39.5","eslint-formatter-visualstudio":"^9.0.1","eslint-plugin-mocha":"^10.5.0",globals:"^17.7.0","js-yaml":"^4.2.0",mocha:"^11.7.6","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","npm-run-all":"^4.1.5",openai:"^6.47.0",prettier:"^3.5.3","prettier-plugin-organize-imports":"^4.2.0","simple-git":"^3.36.0",sinon:"^22.0.0","tree-sitter-bash":"^0.23.0","tree-sitter-powershell":"0.25.9","ts-dedent":"^2.3.0",tsx:"^4.23.1",typescript:"^5.9.3","typescript-eslint":"^8.39.1","vscode-dts":"^0.3.3"},T3o={"@adobe/helix-fetch":"github:devm33/helix-fetch#2a08fa939591a0e14f34f611adcc3ed767579e9a","@agentclientprotocol/sdk":"^0.22.1","@anthropic-ai/claude-agent-sdk":"0.3.159","@anthropic-ai/sdk":"^0.98.0","@github/copilot":"1.0.63","@github/keytar":"7.10.6","@github/memoize":"1.1.5","@microsoft/1ds-core-js":"^4.3.10","@microsoft/1ds-post-js":"^4.3.10","@microsoft/applicationinsights-web-basic":"^3.3.11","@modelcontextprotocol/sdk":"^1.29.0","@octokit/graphql":"^9.0.3","@octokit/rest":"^22.0.1","@parcel/watcher":"^2.5.6","@sinclair/typebox":"^0.34.50","@vscode/chat-lib":"^0.54.0","@vscode/codicons":"^0.0.45","@vscode/deviceid":"github:ghc-jetbrains/vscode-deviceid#f0e5738cd362ef20a09aeb30c3a8be99a9a710f5","@vscode/policy-watcher":"^1.4.0","@vscode/prompt-tsx":"^0.4.0-alpha.9","@vscode/webview-ui-toolkit":"^1.3.1","crypto-js":"^4.2.0",diff:"^9.0.0",dldr:"^0.0.10",events:"^3.3.0","git-url-parse":"^16.1.0",glob:"^11.1.0","jsonc-parser":"^3.3.1",kerberos:"^2.2.0","mac-ca":"^3.1.3","markdown-it":"^14.3.0",minimatch:"^10.2.5",open:"^10.2.0",semver:"^7.8.5",shiki:"~1.15.0","source-map-support":"^0.5.21",toposort:"^2.0.2",undici:"^7.28.0",uuid:"^14.0.0","vscode-languageclient":"^9.0.0","vscode-languageserver":"^9.0.0","vscode-languageserver-protocol":"^3.17","vscode-languageserver-textdocument":"~1.0.11","vscode-uri":"^3.1.0","web-tree-sitter":"^0.23.0",which:"^7.0.0","windows-ca-certs":"^0.2.2",ws:"^8.21.1",yargs:"^18.0.0"},I3o={fsevents:"<0",bindings:"npm:bundled-bindings@^1.5.0",jws:"^3.2.3",tar:"7.5.11","serialize-javascript":"^7.0.5",uuid:"^14.0.0","ip-address":"^10.1.1","fast-uri":"^3.1.2",zod:"3.25.76"},x3o={"//":"Rationale for each entry in `overrides`. Required by `npm run lint:overrides` (script/checkOverridesDocumented.ts). Each value should cover: why (CVE/GHSA or build-hack reason), which direct dep pulls in the vulnerable transitive, and the remove-when condition.",fsevents:"Build hack: macOS-only optional native dep; '<0' is an impossible semver that force-skips install on Linux/Windows pkg builds. Permanent \u2014 keep until @yao-pkg/pkg handles macOS-only optionalDependencies natively. See commit d635096c.",bindings:"Build hack: alias to bundled-bindings fork that resolves .node native addon paths after pkg/esbuild bundling. Required by kerberos. Drop when upstream `bindings` adopts platform-specific path resolution. See commits c4461665 and b55ece83.",jws:"CVE GHSA-869p-cjfg-cm3x (Improperly Verifies HMAC Signature). Pulled in by jsonwebtoken-family deps. Drop when all transitive consumers pin jws >= 3.2.3. See commit 2b5dc766.",tar:"CVE GHSA-9ppj-qmqm-q256 + GHSA-qffp-2rhf-9h96 (Symlink/Hardlink Path Traversal via Drive-Relative Linkpath). Pulled in by node-gyp / native-build deps. Drop when transitive consumers bump tar >= 7.5.11. See commit e2dff0f3.","serialize-javascript":"CVE GHSA-5c6j-r48x-rmvq (RCE via RegExp.flags / Date.toISOString) + GHSA-qj8w-gfj5-8c6v (ReDoS). Pulled in by mocha 11.x (^6.0.2). Dev-only. Drop when mocha bumps to a release that carries serialize-javascript >= 7.0.3. See commit d49f75fd.",uuid:"CVE GHSA-w5hq-g745-h8pq (missing buffer bounds checks in v3/v5/v6). Pulled in by msal-node and @vscode/deviceid as uuid 8.x/9.x. Drop when both upgrade to uuid >= 14. Dependabot alert #128. See commit 6315f3f8.","ip-address":"CVE GHSA-v2v4-37r5-5v8g (XSS in Address6 HTML-emitting methods: group/link/spanAll and AddressError.parseMessage). Pulled in by @modelcontextprotocol/sdk -> express-rate-limit. Not exploitable here (we don't render HTML or call the affected methods), but the override clears the alert. Drop when express-rate-limit bumps to a release carrying ip-address >= 10.1.1. Dependabot alert #129. See PR #854.","fast-uri":"CVE-2026-6321 GHSA-q3j6-qgpj-74h6 (host confusion via percent-encoded authority delimiters) + CVE-2026-6322 GHSA-v39h-62p7-jpjc (path traversal via percent-encoded dot segments). Pulled in by @modelcontextprotocol/sdk -> ajv -> fast-uri. Drop when ajv bumps to a release carrying fast-uri >= 3.1.2. Dependabot alerts #132, #133.",zod:"Type-resolution hack: pin to 3.25.76 so the v3 API at root 'zod' (used by @github/copilot/sdk's zod-3-authored .d.ts via `import * as z from 'zod'`) and the v4 API at the 'zod/v4' subpath (used by @anthropic-ai/claude-agent-sdk via `import { z } from 'zod/v4'`) resolve from a single zod install. Without this, @anthropic-ai/claude-agent-sdk's strict `\"zod\": \"^4.0.0\"` requirement makes npm install zod 4.x, which causes z.infer in @github/copilot/sdk types to collapse to 'unknown' (TS18046 in lib/src/backgroundAgent/*). zod 3.25+ ships both APIs (root = v3, /v4 subpath = v4) so both consumers work from one install. Mirrors the same workaround used by vscode-copilot-chat. Drop when @github/copilot publishes zod-4-compatible types OR @anthropic-ai/claude-agent-sdk relaxes its zod requirement to '^3.25.0 || ^4.0.0'."},w3o={name:m3o,displayName:g3o,description:A3o,version:y3o,build:E3o,buildType:_3o,engines:v3o,anthropicClaude:C3o,scripts:b3o,devDependencies:S3o,dependencies:T3o,overrides:I3o,overridesComments:x3o};var ze={Enable:"enable",UserSelectedCompletionModel:"selectedCompletionModel",ShowEditorCompletions:"editor.showEditorCompletions",EnableAutoCompletions:"editor.enableAutoCompletions",DelayCompletions:"editor.delayCompletions",FilterCompletions:"editor.filterCompletions",FetchStrategy:"fetchStrategy",ToolConfirmAutoApprove:"agent.toolConfirmAutoApprove",AutoApproveUnmatchedTerminal:"agent.autoApproveUnmatchedTerminal",AutoApproveUnmatchedFileOp:"agent.autoApproveUnmatchedFileOp",TrustToolAnnotations:"agent.trustToolAnnotations",AutoApproveYoloMode:"agent.autoApproveYoloMode",EditorHandlesAllConfirmation:"agent.editorHandlesAllConfirmation",MaxToolCallingLoop:"agent.maxToolCallingLoop",AutoCompress:"agent.autoCompress",AnthropicThinkingBudgetToken:"agent.anthropicThinkingBudgetToken",EnableSkills:"agent.enableSkills",EnableHooks:"agent.enableHooks",EnableSandbox:"agent.sandbox.enabled",SandboxAddCurrentWorkingDirectory:"agent.sandbox.addCurrentWorkingDirectory",SandboxUserPolicy:"agent.sandbox.userPolicy",EnablePlugins:"agent.enablePlugins",EnableCustomAgents:"agent.enableCustomAgents",EnableOrgCustomAgents:"agent.enableOrgCustomAgents",UseAgentsMd:"agent.useAgentsMdFile",UseNestedAgentsMd:"agent.useNestedAgentsMdFiles",UseClaudeMd:"agent.useClaudeMdFile",UseNestedClaudeMd:"agent.useNestedClaudeMdFiles",CompletionsDelay:"completionsDelay",CompletionsDebounce:"completionsDebounce",EnableThinking:"agent.enableThinking",TranscriptDirectory:"agent.transcriptDirectory",AgentDebugLogsDirectory:"agent.agentDebugLogsDirectory",ClaudeCliPath:"agent.claude.cliPath",CodexCliPath:"agent.codex.cliPath",OtelEnabled:"agent.otel.enabled",OtelEndpoint:"agent.otel.otlpEndpoint",OtelCaptureContent:"agent.otel.captureContent",OtelExporterType:"agent.otel.exporterType",OtelProtocol:"agent.otel.protocol",OtelOutfile:"agent.otel.outfile",NESExtendedRange:"nextEditSuggestions.extendedRange",RelatedFilesVSCodeCSharp:"advanced.relatedFilesVSCodeCSharp",RelatedFilesVSCodeTypeScript:"advanced.relatedFilesVSCodeTypeScript",RelatedFilesVSCode:"advanced.relatedFilesVSCode",ContextProviders:"advanced.contextProviders",DebugOverrideLogLevels:"advanced.debug.overrideLogLevels",DebugFilterLogCategories:"advanced.debug.filterLogCategories",DebugSnippyOverrideUrl:"advanced.debug.codeRefOverrideUrl",DebugUseElectronFetcher:"advanced.debug.useElectronFetcher",DebugUseEditorFetcher:"advanced.debug.useEditorFetcher",UseSubsetMatching:"advanced.useSubsetMatching",ContextProviderTimeBudget:"advanced.contextProviderTimeBudget",DebugOverrideCapiUrl:"internal.capiUrl",DebugOverrideCapiUrlLegacy:"advanced.debug.overrideCapiUrl",DebugTestOverrideCapiUrl:"internal.capiTestUrl",DebugTestOverrideCapiUrlLegacy:"advanced.debug.testOverrideCapiUrl",DebugOverrideProxyUrl:"internal.completionsUrl",DebugOverrideProxyUrlLegacy:"advanced.debug.overrideProxyUrl",DebugTestOverrideProxyUrl:"internal.completionsTestUrl",DebugTestOverrideProxyUrlLegacy:"advanced.debug.testOverrideProxyUrl",DebugOverrideEngine:"internal.completionModel",DebugOverrideEngineLegacy:"advanced.debug.overrideEngine",AlwaysRequestMultiline:"internal.alwaysRequestMultiline",ModelAlwaysTerminatesSingleline:"internal.modelAlwaysTerminatesSingleline",TrimCompletionsAggressively:"internal.trimCompletionsAggressively",UseWorkspaceContextCoordinator:"internal.useWorkspaceContextCoordinator",ShowWorkspaceContextDebugger:"internal.showWorkspaceContextDebugger",IncludeNeighboringFiles:"internal.includeNeighboringFiles",ExcludeRelatedFiles:"internal.excludeRelatedFiles",DebugOverrideCppHeadersEnableSwitch:"internal.cppHeadersEnableSwitch",NESXTab:"internal.useXTab",NESUseExplicitRejection:"internal.nesUseExplicitRejection",UseSplitContextPrompt:"internal.useSplitContextPrompt",UseCompletionsComparisonPanel:"internal.useCompletionsComparisonPanel",ComparisonPanelModelIds:"internal.comparisonPanelModelIds",ComparisonPanelRandomizedMode:"internal.comparisonPanelRandomizedMode",UseFetchFetcher:"internal.useFetchFetcher",UseChatLibCompletions:"internal.useChatLibCompletions",HookErrorOccurredStackTrace:"internal.hookErrorOccurredStackTrace",AppendPromptTokenCache:"internal.appendPromptTokenCache",PromptPersistBasePath:"internal.promptPersistBasePath",EnableCopilotNesNonFree:"internal.enableCopilotNesNonFree",AnthropicMessagesEndpoint:"internal.anthropic.messagesEndpoint",UseHelixFetcher:"internal.useHelixFetcher",EnableMapCodeFallback:"internal.enableMapCodeFallback",SearchAgent:"internal.searchAgent",PerfEnabled:"internal.perf.enabled",AuthTokenEncryption:"internal.auth.tokenEncryption",DisableWorkspaceIndex:"internal.disableWorkspaceIndex"};function qfn(t){return["server","parsingandserver"].includes(t)}a(qfn,"shouldDoServerTrimming");var MP=class{static{a(this,"BlockModeConfig")}},Ele=class extends MP{static{a(this,"ConfigBlockModeConfig")}forLanguage(e,r,n){let o=e.get(Jt).overrideBlockMode(n);if(o)return n6t(o,r);let s=e.get(Jt).enableProgressiveReveal(n);return(Rt(e,ze.AlwaysRequestMultiline)??s)||lO.isTrimmedByDefault(r)?n6t("moremultiline",r):r=="ruby"?"parsing":OS(r)?"parsingandserver":"server"}};function R3o(t){return["parsing","parsingandserver","moremultiline"].includes(t)}a(R3o,"blockModeRequiresTreeSitter");function n6t(t,e){return t==="moremultiline"&&ug.isSupported(e)?t:R3o(t)&&!OS(e)?"server":t}a(n6t,"toApplicableBlockMode");var Lo=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}},_le=class extends Lo{constructor(){super(...arguments);this.onDidChangeCopilotSettings=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeCopilotSettings");this.onDidChangeHttpSettings=this.onDidChangeCopilotSettings}static{a(this,"DefaultsOnlyConfigProvider")}getConfig(r){return k3o(r)}getOptionalConfig(r){return P3o(r)}dumpForTelemetry(){return{}}getExplicitlySetConfigs(){return new Map}getHttpSettings(){return{proxy:""}}},WY=class extends Lo{constructor(r,n){super();this.baseConfigProvider=r;this.overrides=n;this.copilotEmitter=new Vi;this.onDidChangeCopilotSettings=this.copilotEmitter.event;this.didChangeHttpSettingsEmitter=new Vi;this.onDidChangeHttpSettings=this.didChangeHttpSettingsEmitter.event;this.httpSettings=this.baseConfigProvider.getHttpSettings()}static{a(this,"InMemoryConfigProvider")}getOptionalOverride(r){return this.overrides.get(r)}getConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getConfig(r)}getOptionalConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getOptionalConfig(r)}setConfig(r,n){this.setCopilotSettings({[r]:n})}setCopilotSettings(r){for(let[n,o]of Object.entries(r))o!==void 0?this.overrides.set(n,o):this.overrides.delete(n);this.copilotEmitter.fire(this)}getExplicitlySetConfigs(){let r=new Map(this.baseConfigProvider.getExplicitlySetConfigs());for(let[n,o]of this.overrides)r.set(n,o);return r}getHttpSettings(){return this.httpSettings}setHttpSettings(r){let n=SIe(r);this.httpSettings=n,this.didChangeHttpSettingsEmitter.fire(this.getHttpSettings())}dumpForTelemetry(){let r=this.baseConfigProvider.dumpForTelemetry();for(let n of[ze.ShowEditorCompletions,ze.EnableAutoCompletions,ze.DelayCompletions,ze.FilterCompletions]){let o=this.overrides.get(n);o!==void 0&&(r[n]=JSON.stringify(o))}return r}};function jfn(t,e){let r=t,n=[];for(let o of e.split(".")){let s=[...n,o].join(".");r&&typeof r=="object"&&s in r?(r=r[s],n.length=0):n.push(o)}if(!(r===void 0||n.length>0))return r}a(jfn,"getConfigKeyRecursively");function k3o(t){if(xVe.has(t))return xVe.get(t);throw new Error(`Missing config default value: ${iPt}.${t}`)}a(k3o,"getConfigDefaultForKey");function P3o(t){return xVe.get(t)}a(P3o,"getOptionalConfigDefaultForKey");function vle(t){return t.get(Lo).getExplicitlySetConfigs()}a(vle,"getExplicitlySetConfigs");var D3o={[ze.DebugOverrideCppHeadersEnableSwitch]:!1,[ze.RelatedFilesVSCodeCSharp]:!1,[ze.RelatedFilesVSCodeTypeScript]:!1,[ze.RelatedFilesVSCode]:!1,[ze.IncludeNeighboringFiles]:!1,[ze.ExcludeRelatedFiles]:!1,[ze.ContextProviders]:[],[ze.DebugUseEditorFetcher]:null,[ze.DebugUseElectronFetcher]:null,[ze.DebugOverrideLogLevels]:{},[ze.DebugSnippyOverrideUrl]:"",[ze.AgentDebugLogsDirectory]:void 0,[ze.ClaudeCliPath]:void 0,[ze.CodexCliPath]:void 0,[ze.OtelEnabled]:!1,[ze.OtelEndpoint]:void 0,[ze.OtelCaptureContent]:!1,[ze.OtelExporterType]:"otlp-http",[ze.OtelProtocol]:"",[ze.OtelOutfile]:"",[ze.FetchStrategy]:"auto",[ze.ToolConfirmAutoApprove]:!1,[ze.AutoApproveUnmatchedTerminal]:void 0,[ze.AutoApproveUnmatchedFileOp]:void 0,[ze.TrustToolAnnotations]:!1,[ze.AutoApproveYoloMode]:!1,[ze.EditorHandlesAllConfirmation]:!1,[ze.MaxToolCallingLoop]:25,[ze.AutoCompress]:!1,[ze.AnthropicThinkingBudgetToken]:1024,[ze.EnableSkills]:!1,[ze.EnableHooks]:!1,[ze.EnableSandbox]:!1,[ze.SandboxAddCurrentWorkingDirectory]:void 0,[ze.SandboxUserPolicy]:void 0,[ze.EnablePlugins]:!1,[ze.EnableCustomAgents]:!0,[ze.EnableOrgCustomAgents]:!0,[ze.UseAgentsMd]:!1,[ze.UseNestedAgentsMd]:!1,[ze.UseClaudeMd]:!1,[ze.UseNestedClaudeMd]:!1,[ze.UseSubsetMatching]:null,[ze.ContextProviderTimeBudget]:void 0,[ze.DebugOverrideCapiUrl]:"",[ze.DebugTestOverrideCapiUrl]:"",[ze.DebugOverrideProxyUrl]:"",[ze.DebugTestOverrideProxyUrl]:"",[ze.DebugOverrideEngine]:"",[ze.AlwaysRequestMultiline]:void 0,[ze.ModelAlwaysTerminatesSingleline]:void 0,[ze.TrimCompletionsAggressively]:void 0,[ze.CompletionsDebounce]:void 0,[ze.NESXTab]:void 0,[ze.UseWorkspaceContextCoordinator]:void 0,[ze.ShowWorkspaceContextDebugger]:!1,[ze.CompletionsDelay]:void 0,[ze.UseSplitContextPrompt]:void 0,[ze.UseCompletionsComparisonPanel]:void 0,[ze.ComparisonPanelModelIds]:void 0,[ze.ComparisonPanelRandomizedMode]:void 0,[ze.UseFetchFetcher]:void 0,[ze.UseChatLibCompletions]:void 0,[ze.TranscriptDirectory]:void 0,[ze.EnableThinking]:!0,[ze.ShowEditorCompletions]:void 0,[ze.EnableAutoCompletions]:void 0,[ze.DelayCompletions]:void 0,[ze.FilterCompletions]:void 0,[ze.Enable]:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},[ze.UserSelectedCompletionModel]:"",[ze.DebugFilterLogCategories]:[],[ze.DebugOverrideEngineLegacy]:"",[ze.DebugTestOverrideProxyUrlLegacy]:"",[ze.DebugOverrideProxyUrlLegacy]:"",[ze.DebugTestOverrideCapiUrlLegacy]:"",[ze.DebugOverrideCapiUrlLegacy]:"",[ze.HookErrorOccurredStackTrace]:!1,[ze.NESUseExplicitRejection]:!1,[ze.AppendPromptTokenCache]:"",[ze.PromptPersistBasePath]:void 0,[ze.AnthropicMessagesEndpoint]:"",[ze.EnableCopilotNesNonFree]:"",[ze.UseHelixFetcher]:"",[ze.EnableMapCodeFallback]:"enabled",[ze.SearchAgent]:"",[ze.PerfEnabled]:"",[ze.NESExtendedRange]:!1,[ze.AuthTokenEncryption]:"",[ze.DisableWorkspaceIndex]:""},xVe=new Map(Object.entries(D3o));for(let t of Object.values(ze))if(!xVe.has(t))throw new Error(`Missing config default value ${iPt}.${t}`);function Rt(t,e){return t.get(Lo).getConfig(e)}a(Rt,"getConfig");function OP(t){return Rt(t,ze.DisableWorkspaceIndex)==="true"}a(OP,"isWorkspaceIndexDisabled");function PJr(t){return t.get(Lo).dumpForTelemetry()}a(PJr,"dumpForTelemetry");var us=class{constructor(){this.packageJson=TIe}static{a(this,"BuildInfo")}isProduction(){return this.getBuildType()!=="dev"}getBuildType(){return this.packageJson.buildType}getVersion(){return this.packageJson.version}getDisplayVersion(){return this.getBuildType()==="dev"?`${this.getVersion()}-dev`:this.getVersion()}getBuild(){return this.packageJson.build}getName(){return this.packageJson.name}};function uNt(t){return t.get(us).isProduction()}a(uNt,"isProduction");function Lrn(t){return t.get(us).getBuildType()==="dev"}a(Lrn,"isDevBuild");function VU(t){return t.get(us).getBuildType()}a(VU,"getBuildType");function DJr(t){return t.get(us).getBuild()}a(DJr,"getBuild");function J1(t){return t.get(us).getVersion()}a(J1,"getVersion");var qa=class{constructor(e,r,n,o="none",s="desktop"){this.sessionId=e;this.machineId=r;this.devDeviceId=n;this.remoteName=o;this.uiKind=s}static{a(this,"EditorSession")}};function U1({name:t,version:e}){return`${t}/${e}`}a(U1,"formatNameAndVersion");var Ir=class{static{a(this,"EditorAndPluginInfo")}getCopilotIntegrationId(){}getEditorPluginSpecificFilters(){return[]}getEditorIdentity(){return Rqr({editor:this.getEditorInfo(),plugin:this.getEditorPluginInfo()})}isEditorPluginInfoKnown(){return!0}};function K$e(t){let e=t.getCopilotIntegrationId();if(e)return e;switch(t.getEditorPluginInfo().name){case"copilot-intellij":return"jetbrains-chat";case"copilot":case"copilot-vs":return;default:return"jetbrains-chat"}}a(K$e,"getIntegrationId");function zy(t){let e=t.get(Ir);return{"Editor-Version":U1(e.getEditorInfo()),"Editor-Plugin-Version":U1(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":J1(t)}}a(zy,"editorVersionHeaders");var Hfn="Iv1.b507a08c87ecfe98",N3o="350ee525b5da0e4a54c6e8e043edc1b99cc02f19",sce="Ov23liV9UpD7Rnfnskm3",M3o="5509a52e4c525cd594a6fba9147ff6cc2388dd9f",O3o={[Hfn]:N3o,[sce]:M3o},Jp=class{static{a(this,"GitHubAppInfo")}findAppIdToAuthenticate(){return this.githubAppId??Hfn}findAppSecretToAuthenticate(){let e=this.findAppIdToAuthenticate(),r=O3o[e];if(!r)throw new Error(`GitHubAppInfo: No app secret found for app ID: ${e}`);return r}};function Gfn(t){return Rt(t,ze.AuthTokenEncryption)==="false"}a(Gfn,"isAuthTokenEncryptionDisabled");p();var Jfn=fe(require("node:crypto"));var wQ=new pe("KeytarMasterKey"),Wfn="copilot-language-server",zfn="oauth-token-key",Yfn=5e3,Zfn=32,i6t;function F3o(t){return i6t??=U3o(t).finally(()=>{i6t=void 0}),i6t}a(F3o,"resolveMasterKey");async function U3o(t){wQ.info(t,"keytar-master-key: resolving master key");let e;try{e=await s6t.loadKeytar(),wQ.info(t,"keytar-master-key: module loaded")}catch(n){return wQ.warn(t,"keytar-master-key: @github/keytar failed to load",n),{diagnostics:o6t("loadModule",n)}}let r;try{r=await q3o(t,e)}catch(n){return n instanceof wVe?(wQ.error(t,"keytar-master-key: existing entry is corrupt; refusing to overwrite",n),{diagnostics:o6t("corruptExistingEntry",n)}):(wQ.warn(t,"keytar-master-key: master-key resolution failed",n),{diagnostics:o6t("getOrCreateMasterKey",n)})}return wQ.info(t,`keytar-master-key: resolved (source=${r.source})`),{masterKey:r.key,diagnostics:{available:!0,masterKeySource:r.source}}}a(U3o,"doResolveMasterKey");function Q3o(){return Promise.resolve().then(()=>fe(Vfn()))}a(Q3o,"loadKeytar");var s6t={resolveMasterKey:F3o,loadKeytar:Q3o};async function q3o(t,e){let r=await Kfn(e.getPassword(Wfn,zfn),Yfn,"getMasterKey");if(wQ.info(t,`keytar-master-key: getPassword returned (found=${r!=null})`),r){let o=j3o(r);if(o)return{key:o,source:"useExisting"};throw new wVe}let n=Jfn.randomBytes(Zfn);return await Kfn(e.setPassword(Wfn,zfn,n.toString("base64")),Yfn,"setMasterKey"),wQ.info(t,"keytar-master-key: setPassword (new key) completed"),{key:n,source:"createNew"}}a(q3o,"getOrCreateMasterKey");function Kfn(t,e,r){return new Promise((n,o)=>{let s=setTimeout(()=>o(new Error(`${r}: timeout after ${e}ms`)),e);s.unref?.(),t.then(c=>{clearTimeout(s),n(c)},c=>{clearTimeout(s),o(c instanceof Error?c:new Error(`${r}: ${String(c)}`))})})}a(Kfn,"withTimeout");var wVe=class extends Error{static{a(this,"CorruptMasterKeyError")}constructor(){super("keytar master-key entry present but undecodable"),this.name="CorruptMasterKeyError"}};function o6t(t,e){return{available:!1,errorPhase:t,error:e}}a(o6t,"unavailable");function j3o(t){let e=Buffer.from(t,"base64");return e.length===Zfn?e:void 0}a(j3o,"decodeMasterKey");p();var Cle=fe(require("node:crypto"));var l6t=0,DVe=1,RQ=class extends Error{constructor(r,n,o){super(r,o?.cause!==void 0?{cause:o.cause}:void 0);this.kind=n;this.name="SecretUnwrapError"}static{a(this,"SecretUnwrapError")}},kVe=class{static{a(this,"SecretCodec")}},c6t=class extends kVe{constructor(){super(...arguments);this.schemaVersion=l6t}static{a(this,"PlaintextCodec")}encode(r){return Buffer.from(r,"utf8")}decode(r){return Buffer.from(r).toString("utf8")}},RVe=12,a6t=16,Xfn=32,PVe=class extends kVe{constructor(r){super();this.key=r;this.schemaVersion=DVe;if(r.length!==Xfn)throw new Error(`AesGcmCodec requires a ${Xfn}-byte key, got ${r.length}`)}static{a(this,"AesGcmCodec")}encode(r){let n=Cle.randomBytes(RVe),o=Cle.createCipheriv("aes-256-gcm",this.key,n),s=Buffer.concat([o.update(Buffer.from(r,"utf8")),o.final()]);return Buffer.concat([n,s,o.getAuthTag()])}decode(r){let n=Buffer.from(r);if(n.length{let c=this.stmts.upsertToken.get(n.authAuthority,n.oauthClientId,n.user,n.scopes,s.ciphertext,s.schemaVersion,r,o,o,o);return this.stmts.upsertActiveSession.run(r,c.token_id,o),this.stmts.deleteSignoutTombstone.run(r),{tokenId:c.token_id,tokenRewrite:c.token_rewrite===1}})}async assignActiveSession(r,n){let o=Date.now();tU(this.db,()=>{if(!this.stmts.selectTokenById.get(n))throw new Error(`assignActiveSession: tokenId ${n} not found`);this.stmts.upsertActiveSession.run(r,n,o),this.stmts.deleteSignoutTombstone.run(r),this.stmts.bumpLastUsed.run(o,n)})}async markEditorOptedOut(r){let n=Date.now();tU(this.db,()=>{this.stmts.deleteActiveSession.run(r),this.stmts.insertSignoutTombstone.run(r,n)})}async hasOptOutTombstone(r){return this.stmts.selectSignoutTombstone.get(r)!==void 0}async listTokensByRecency(r=-1){let n=this.stmts.selectAllTokensByRecency.all(r),o=[];for(let s of n){let c=await this.toStoredTokenRecordOrPurge(s);c&&o.push(c)}return o}async findTokenByAuthority(r){let n=this.stmts.selectTokenByAuthority.get(r);return n?await this.toStoredTokenRecordOrPurge(n):void 0}async listAvailableTokens(){return this.stmts.selectAllTokensByRecency.all(-1).map(n=>({tokenId:n.token_id,authAuthority:n.auth_authority,oauthClientId:n.oauth_client_id,userLogin:n.user_login,sourceEditorId:n.source_editor_id,lastUsedAt:n.last_used_at}))}async deleteTokenCascade(r){let n=Date.now();return tU(this.db,()=>{let o=this.stmts.deleteActiveSessionsForTokenReturning.all(r),s=this.stmts.deleteTokenById.run(r);for(let{editor_id:c}of o)this.stmts.insertSignoutTombstone.run(c,n);return{affectedEditors:o.length,tokenDeleted:Number(s.changes)===1}})}async touchActiveSession(r){let n=Date.now();tU(this.db,()=>{let o=this.stmts.selectActiveSessionByEditor.get(r);o&&this.stmts.bumpLastUsed.run(n,o.token_id)})}async getMetadata(r){return this.stmts.getMetadata.get(r)?.value}async setMetadata(r,n){this.stmts.setMetadata.run(r,n)}async upgradePlaintextRows(){let r=this.stmts.selectPlaintextTokenRows.all(),n=0,o=0,s=0;for(let c of r){let l;try{let d=this.secretStorage.unwrap({schemaVersion:U8t,ciphertext:c.token_ciphertext});l=this.secretStorage.wrap(d)}catch{o++;continue}let u=tU(this.db,()=>this.stmts.updateTokenCiphertext.run(l.ciphertext,l.schemaVersion,c.token_id));Number(u.changes)===1?n++:s++}return{attempted:r.length,upgraded:n,failed:o,skipped:s}}async decryptOauthTokensFromV1ToV0(){let r=this.stmts.selectEncryptedTokenRows.all(),n=0,o=0,s=0;for(let c of r){let l;try{l=this.secretStorage.unwrap({schemaVersion:sVe,ciphertext:c.token_ciphertext})}catch(d){if(d instanceof yQ){let{affectedEditors:f,tokenDeleted:h}=await this.deleteTokenCascade(c.token_id);h?(o++,sSe(this.ctx,{editorId:c.source_editor_id,trigger:"unwrap_failure",affectedEditors:f})):s++;continue}s++;continue}this.writePlaintextRow(c.token_id,l)===1?n++:s++}return{attempted:r.length,decrypted:n,purged:o,skipped:s}}writePlaintextRow(r,n){let o=tU(this.db,()=>this.stmts.updateTokenToPlaintext.run(Buffer.from(n,"utf8"),r));return Number(o.changes)}async toStoredTokenRecordOrPurge(r){try{let n=this.secretStorage.unwrap({schemaVersion:r.token_schema_version,ciphertext:r.token_ciphertext});if(r.token_schema_version===sVe){let o=r.token_id,s=n;setImmediate(()=>{try{this.writePlaintextRow(o,s)}catch(c){Q8t.info(this.ctx,`opportunistic v1->v0 heal failed tokenId=${o} (will retry on next read/boot)`,c)}})}return{tokenId:r.token_id,sourceEditorId:r.source_editor_id,record:{user:r.user_login,accessToken:n,authAuthority:r.auth_authority,oauthClientId:r.oauth_client_id,scopes:r.scopes}}}catch(n){n instanceof yQ&&n.kind==="tagMismatch"&&this.deleteTokenCascade(r.token_id).then(({affectedEditors:o,tokenDeleted:s})=>{s&&(Q8t.warn(this.ctx,`purged token after AES unwrap failure (tagMismatch) tokenId=${r.token_id} affectedEditors=${o}`),sSe(this.ctx,{editorId:r.source_editor_id,trigger:"unwrap_failure",affectedEditors:o}))}).catch(o=>Q8t.error(this.ctx,`cleanup after AES unwrap failure failed tokenId=${r.token_id} (row may be preserved, will retry on next read)`,o));return}}};var Jdn=de(require("fs")),q8t=de(require("node:sqlite")),Zdn=de(require("path"));var EQ=new fe("AuthRepoInit");function mle(){return typeof performance<"u"?performance.now():Date.now()}a(mle,"nowMs");function Kdn(t){try{t.close()}catch{}}a(Kdn,"safeClose");function LLo(t){let e=mle(),r={durationMs:0};try{Jdn.mkdirSync(Zdn.dirname(t),{recursive:!0,mode:448})}catch(o){return r.durationMs=mle()-e,r.errorPhase="ensureDir",r.error=o,{db:void 0,diagnostics:r}}let n;try{n=new q8t.default.DatabaseSync(t)}catch(o){return r.durationMs=mle()-e,r.errorPhase="connectDb",r.error=o,{db:void 0,diagnostics:r}}try{Pkt(n)}catch(o){return r.durationMs=mle()-e,r.errorPhase="applyPragmas",r.error=o,Kdn(n),{db:void 0,diagnostics:r}}try{Dkt(n)}catch(o){return r.durationMs=mle()-e,r.errorPhase="applySchema",r.error=o,Kdn(n),{db:void 0,diagnostics:r}}return r.durationMs=mle()-e,{db:n,diagnostics:r}}a(LLo,"tryOpenAuthDb");function BLo(t,e){let r=new q8t.default.DatabaseSync(":memory:");return Pkt(r),Dkt(r),new sIe(t,r,e)}a(BLo,"openInMemoryAuthRepo");function Xdn(t,e,r){let{db:n,diagnostics:o}=LLo(e);return n?{repo:new sIe(t,n,r),diagnostics:{...o,repoKind:"sqlite"}}:{repo:BLo(t,r),diagnostics:{...o,repoKind:"memory"}}}a(Xdn,"buildAuthRepository");function efn(t,e){if(e.repoKind==="memory"){EQ.error(t,`auth.db open failed (phase=${e.errorPhase}); using in-memory fallback. Tokens will not persist across restarts.`,e.error);try{t.get(ts).showWarningMessageOnlyOnce("auth.db.inMemoryFallback","GitHub Copilot could not open its credential store and is using an in-memory fallback. You will need to sign in again after restarting.").catch(r=>{EQ.info(t,"reportAuthRepoFallbackNotice: notification failed",r)})}catch(r){EQ.info(t,"reportAuthRepoFallbackNotice: notification skipped",r)}}}a(efn,"reportAuthRepoFallbackNotice");function tfn(t,e){ytn(t,e)}a(tfn,"reportAuthRepoTelemetry");async function j8t(t){let e=t.get(v3),r=t.get(pf);if(Udn(t)){EQ.info(t,"secret-store: encryption disabled by config; pinning writes to plaintext v0");let c={available:!1,errorPhase:"disabledByConfig"};return r.onInitialized(()=>hje(t,{writerKind:"plaintext",diagnostics:c})),{diagnostics:c}}let{masterKey:n,diagnostics:o}=await L8t.resolveMasterKey(t);if(!n)return ULo(t,o),r.onInitialized(()=>hje(t,{writerKind:"plaintext",diagnostics:o})),{diagnostics:o};let s=new oVe(n);return e.addReader(s),r.onInitialized(()=>hje(t,{writerKind:"plaintext",diagnostics:o})),FLo(t),{diagnostics:o}}a(j8t,"initializeSecretStorage");function FLo(t){let e=t.get(pf);setImmediate(()=>{t.get(nx).decryptOauthTokensFromV1ToV0().then(r=>{r.attempted!==0&&e.onInitialized(()=>x5t(t,{result:r}))}).catch(r=>{EQ.error(t,"secret-store: v1->v0 decrypt pass failed",r),e.onInitialized(()=>x5t(t,{error:r}))})})}a(FLo,"scheduleDecryptOauthTokensFromV1ToV0");function ULo(t,e){EQ.info(t,`secret-store fallback: tokens stored in plaintext on disk (no OS keychain available; phase=${e.errorPhase??"n/a"})`);try{t.get(ts).showWarningMessageOnlyOnce("auth.secretStorage.plaintextFallback","GitHub Copilot could not access the OS keychain. OAuth tokens are stored in plaintext on disk.").catch(r=>{EQ.info(t,"reportSecretStorageFallbackNotice: notification failed",r)})}catch(r){EQ.info(t,"reportSecretStorageFallbackNotice: notification skipped",r)}}a(ULo,"reportSecretStorageFallbackNotice");p();p();var QLo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function qLo(t){return QLo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(qLo,"isOomError");function LY(t,e,r,n=Nr){if(!Gm(e)){if(e instanceof Error){let o=e;qLo(o)?t.get(ps).setWarning("cls",{message:"Out of memory"}):o.code==="EMFILE"||o.code==="ENFILE"?t.get(ps).setWarning("cls",{message:"Too many open files"}):o.code==="CopilotPromptLoadFailure"?t.get(ps).setWarning("cls",{message:"Corrupted Copilot installation"}):`${o.code}`.startsWith("CopilotPromptWorkerExit")?t.get(ps).setWarning("cls",{message:"Worker unexpectedly exited"}):o.syscall==="uv_cwd"&&o.code==="ENOENT"&&t.get(ps).setWarning("cls",{message:"Current working directory does not exist"})}n.exception(t,e,r)}}a(LY,"handleException");function rfn(t){process.addListener("uncaughtException",r=>{LY(t,r,"uncaughtException")});let e=!1;process.addListener("unhandledRejection",r=>{if(!e)try{e=!0,LY(t,r,"unhandledRejection")}finally{e=!1}})}a(rfn,"registerDefaultHandlers");function nfn(){hQ("o200k_base").catch(()=>{})}a(nfn,"prewarmTokenizers");p();p();p();var C3={abap:{extensions:[".abap"]},aspdotnet:{extensions:[".asax",".ascx",".ashx",".asmx",".aspx",".axd"]},bat:{extensions:[".bat",".cmd"]},bibtex:{extensions:[".bib",".bibtex"]},blade:{extensions:[".blade",".blade.php"]},BluespecSystemVerilog:{extensions:[".bsv"]},c:{extensions:[".c",".cats",".h",".h.in",".idc"]},csharp:{extensions:[".cake",".cs",".cs.pp",".csx",".linq"]},cpp:{extensions:[".c++",".cc",".cp",".cpp",".cppm",".cxx",".h",".h++",".hh",".hpp",".hxx",".idl",".inc",".inl",".ino",".ipp",".ixx",".rc",".re",".tcc",".tpp",".txx",".i"]},cobol:{extensions:[".cbl",".ccp",".cob",".cobol",".cpy"]},css:{extensions:[".css",".wxss"]},clojure:{extensions:[".bb",".boot",".cl2",".clj",".cljc",".cljs",".cljs.hl",".cljscm",".cljx",".edn",".hic"],filenames:["riemann.config"]},ql:{extensions:[".ql",".qll"]},coffeescript:{extensions:["._coffee",".cake",".cjsx",".coffee",".iced"],filenames:["Cakefile"]},cuda:{extensions:[".cu",".cuh"]},dart:{extensions:[".dart"]},dockerfile:{extensions:[".containerfile",".dockerfile"],filenames:["Containerfile","Dockerfile"]},dotenv:{extensions:[".env"],filenames:[".env",".env.ci",".env.dev",".env.development",".env.development.local",".env.example",".env.local",".env.prod",".env.production",".env.sample",".env.staging",".env.test",".env.testing"]},html:{extensions:[".ect",".ejs",".ejs.t",".jst",".hta",".htm",".html",".html.hl",".html5",".inc",".jsp",".njk",".tpl",".twig",".wxml",".xht",".xhtml",".phtml",".liquid"]},elixir:{extensions:[".ex",".exs"],filenames:["mix.lock"]},erlang:{extensions:[".app",".app.src",".erl",".es",".escript",".hrl",".xrl",".yrl"],filenames:["Emakefile","rebar.config","rebar.config.lock","rebar.lock"]},fsharp:{extensions:[".fs",".fsi",".fsx"]},go:{extensions:[".go"]},groovy:{extensions:[".gradle",".groovy",".grt",".gtpl",".gvy",".jenkinsfile"],filenames:["Jenkinsfile","Jenkinsfile"]},graphql:{extensions:[".gql",".graphql",".graphqls"]},terraform:{extensions:[".hcl",".nomad",".tf",".tfvars",".workflow"]},hlsl:{extensions:[".cginc",".fx",".fxh",".hlsl",".hlsli"]},erb:{extensions:[".erb",".erb.deface",".rhtml"]},razor:{extensions:[".cshtml",".razor"]},haml:{extensions:[".haml",".haml.deface"]},handlebars:{extensions:[".handlebars",".hbs"]},haskell:{extensions:[".hs",".hs-boot",".hsc"]},ini:{extensions:[".cfg",".cnf",".dof",".ini",".lektorproject",".prefs",".pro",".properties",".url"],filenames:[".buckconfig",".coveragerc",".flake8",".pylintrc","HOSTS","buildozer.spec","hosts","pylintrc","vlcrc"]},json:{extensions:[".4DForm",".4DProject",".JSON-tmLanguage",".avsc",".geojson",".gltf",".har",".ice",".json",".json.example",".jsonl",".mcmeta",".sarif",".tact",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","MODULE.bazel.lock","Package.resolved","Pipfile.lock","bun.lock","composer.lock","deno.lock","flake.lock","mcmod.info"]},jsonc:{extensions:[".code-snippets",".code-workspace",".jsonc",".sublime-build",".sublime-color-scheme",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[".babelrc",".devcontainer.json",".eslintrc.json",".jscsrc",".jshintrc",".jslintrc",".swcrc","api-extractor.json","argv.json","devcontainer.json","extensions.json","jsconfig.json","keybindings.json","language-configuration.json","launch.json","profiles.json","settings.json","tasks.json","tsconfig.json","tslint.json"]},java:{extensions:[".jav",".java",".jsh"]},javascript:{extensions:["._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".js",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib"],filenames:["Jakefile"]},julia:{extensions:[".jl"]},kotlin:{extensions:[".kt",".ktm",".kts"]},less:{extensions:[".less"]},lua:{extensions:[".fcgi",".lua",".luau",".nse",".p8",".pd_lua",".rbxs",".rockspec",".wlua"],filenames:[".luacheckrc"]},makefile:{extensions:[".d",".mak",".make",".makefile",".mk",".mkfile"],filenames:["BSDmakefile","GNUmakefile","Kbuild","Makefile","Makefile.am","Makefile.boot","Makefile.frag","Makefile.in","Makefile.inc","Makefile.wat","makefile","makefile.sco","mkfile"]},markdown:{extensions:[".livemd",".markdown",".md",".mdown",".mdwn",".mdx",".mkd",".mkdn",".mkdown",".ronn",".scd",".workbook"],filenames:["contents.lr"]},"objective-c":{extensions:[".h",".m"]},"objective-cpp":{extensions:[".mm"]},php:{extensions:[".aw",".ctp",".fcgi",".inc",".install",".module",".php",".php3",".php4",".php5",".phps",".phpt",".theme"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"]},perl:{extensions:[".al",".cgi",".fcgi",".perl",".ph",".pl",".plx",".pm",".psgi",".t"],filenames:[".latexmkrc","Makefile.PL","Rexfile","ack","cpanfile","latexmkrc"]},powershell:{extensions:[".ps1",".psd1",".psm1"]},pug:{extensions:[".jade",".pug"]},python:{extensions:[".cgi",".codon",".fcgi",".gyp",".gypi",".lmi",".py",".py3",".pyde",".pyi",".pyp",".pyt",".pyw",".rpy",".sage",".spec",".tac",".wsgi",".xpy"],filenames:[".gclient","DEPS","SConscript","SConstruct","wscript"]},r:{extensions:[".r",".rd",".rsx"],filenames:[".Rprofile","expr-dist"]},ruby:{extensions:[".builder",".eye",".fcgi",".gemspec",".god",".jbuilder",".mspec",".pluginspec",".podspec",".prawn",".rabl",".rake",".rb",".rbi",".rbuild",".rbw",".rbx",".ru",".ruby",".spec",".thor",".watchr"],filenames:[".irbrc",".pryrc",".simplecov","Appraisals","Berksfile","Brewfile","Buildfile","Capfile","Dangerfile","Deliverfile","Fastfile","Gemfile","Guardfile","Jarfile","Mavenfile","Podfile","Puppetfile","Rakefile","Snapfile","Steepfile","Thorfile","Vagrantfile","buildfile"]},rust:{extensions:[".rs",".rs.in"]},scss:{extensions:[".scss"]},sql:{extensions:[".cql",".ddl",".inc",".mysql",".prc",".sql",".tab",".udf",".viw"]},sass:{extensions:[".sass"]},scala:{extensions:[".kojo",".sbt",".sc",".scala"]},shellscript:{extensions:[".bash",".bats",".cgi",".command",".fcgi",".fish",".ksh",".sh",".sh.in",".tmux",".tool",".trigger",".zsh",".zsh-theme"],filenames:[".bash_aliases",".bash_functions",".bash_history",".bash_logout",".bash_profile",".bashrc",".cshrc",".envrc",".flaskenv",".kshrc",".login",".profile",".tmux.conf",".zlogin",".zlogout",".zprofile",".zshenv",".zshrc","9fs","PKGBUILD","bash_aliases","bash_logout","bash_profile","bashrc","cshrc","gradlew","kshrc","login","man","profile","tmux.conf","zlogin","zlogout","zprofile","zshenv","zshrc"]},slang:{extensions:[".fxc",".hlsl",".s",".slang",".slangh",".usf",".ush",".vfx"]},slim:{extensions:[".slim"]},solidity:{extensions:[".sol"]},stylus:{extensions:[".styl"]},svelte:{extensions:[".svelte"]},swift:{extensions:[".swift"]},systemverilog:{extensions:[".sv",".svh",".vh"]},typescriptreact:{extensions:[".tsx"]},latex:{extensions:[".aux",".bbx",".cbx",".cls",".dtx",".ins",".lbx",".ltx",".mkii",".mkiv",".mkvi",".sty",".tex",".toc"]},typescript:{extensions:[".cts",".mts",".ts"]},verilog:{extensions:[".v",".veo"]},vim:{extensions:[".vba",".vim",".vimrc",".vmb"],filenames:[".exrc",".gvimrc",".nvimrc",".vimrc","_vimrc","gvimrc","nvimrc","vimrc"]},vb:{extensions:[".vb",".vbhtml",".Dsr",".bas",".cls",".ctl",".frm",".vbs"]},vue:{extensions:[".nvue",".vue"]},xml:{extensions:[".adml",".admx",".ant",".axaml",".axml",".builds",".ccproj",".ccxml",".clixml",".cproject",".cscfg",".csdef",".csl",".csproj",".ct",".depproj",".dita",".ditamap",".ditaval",".dll.config",".dotsettings",".filters",".fsproj",".fxml",".glade",".gml",".gmx",".gpx",".grxml",".gst",".hzp",".iml",".ivy",".jelly",".jsproj",".kml",".launch",".mdpolicy",".mjml",".mod",".mojo",".mxml",".natvis",".ncl",".ndproj",".nproj",".nuspec",".odd",".osm",".pkgproj",".plist",".pluginspec",".proj",".props",".ps1xml",".psc1",".pt",".pubxml",".qhelp",".rdf",".res",".resx",".rss",".sch",".scxml",".sfproj",".shproj",".srdf",".storyboard",".sublime-snippet",".svg",".sw",".targets",".tml",".typ",".ui",".urdf",".ux",".vbproj",".vcxproj",".vsixmanifest",".vssettings",".vstemplate",".vxml",".wixproj",".workflow",".wsdl",".wsf",".wxi",".wxl",".wxs",".x3d",".xacro",".xaml",".xib",".xlf",".xliff",".xmi",".xml",".xml.dist",".xmp",".xproj",".xsd",".xspec",".xul",".zcml"],filenames:[".classpath",".cproject",".project","App.config","NuGet.config","Settings.StyleCop","Web.Debug.config","Web.Release.config","Web.config","packages.config"]},xsl:{extensions:[".xsl",".xslt"]},yaml:{extensions:[".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".clangd",".gemrc","CITATION.cff","glide.lock","pixi.lock","yarn.lock"]},javascriptreact:{extensions:[".jsx"]},legend:{extensions:[".pure"]}};p();p();var ifn=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"],ofn={".php":[".blade"]},_Q=Object.keys(C3).flatMap(t=>C3[t].extensions);var H8t=de(require("node:path"));var Ale=class{constructor(e,r,n){this.languageId=e;this.isGuess=r;this.fileExtension=n}static{a(this,"Language")}},aIe=class{static{a(this,"LanguageDetection")}},G8t=new Map,gle=new Map;for(let[t,{extensions:e,filenames:r}]of Object.entries(C3)){for(let n of e)G8t.set(n,[...G8t.get(n)??[],t]);for(let n of r??[])gle.set(n,[...gle.get(n)??[],t])}var $8t=class extends aIe{static{a(this,"FilenameAndExensionLanguageDetection")}detectLanguage(e){let r=Ji(e.uri),n=H8t.extname(r).toLowerCase(),o=this.extensionWithoutTemplateLanguage(r,n),s=this.detectLanguageId(r,o),c=this.computeFullyQualifiedExtension(n,o);return s?new Ale(s.languageId,s.isGuess,c):new Ale(e.languageId,!0,c)}extensionWithoutTemplateLanguage(e,r){if(ifn.includes(r)){let n=e.substring(0,e.lastIndexOf(".")),o=H8t.extname(n).toLowerCase();if(o.length>0&&_Q.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=ofn[e];return!n||n.includes(r)}detectLanguageId(e,r){if(gle.has(e))return{languageId:gle.get(e)[0],isGuess:!1};let n=G8t.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),gle.has(e))return{languageId:gle.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},V8t=class extends aIe{constructor(r){super();this.delegate=r}static{a(this,"GroupingLanguageDetection")}detectLanguage(r){let n=this.delegate.detectLanguage(r),o=n.languageId;return o==="c"||o==="cpp"?new Ale("cpp",n.isGuess,n.fileExtension):n}},W8t=class extends aIe{constructor(r){super();this.delegate=r}static{a(this,"ClientProvidedLanguageDetection")}detectLanguage(r){return r.uri.startsWith("untitled:")||r.uri.startsWith("vscode-notebook-cell:")?new Ale(r.languageId,!0,""):this.delegate.detectLanguage(r)}},jLo=new V8t(new W8t(new $8t));function nO({uri:t,languageId:e}){let r=jLo.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(nO,"detectLanguage");p();p();p();p();function Hh(t){if(t.isCancellationRequested)throw new aVe}a(Hh,"throwIfCancellationRequested");function xP(t){return t instanceof aVe?!0:t instanceof Error&&t.name===z8t&&t.message===z8t}a(xP,"isCancellationError");var aVe=class extends Error{static{a(this,"CancellationError")}constructor(){super(z8t),this.name=this.message}},z8t="Canceled",cVe=class{constructor(){this.items=[]}static{a(this,"Stack")}push(e){this.items.push(e)}pop(){return this.items.pop()}peek(){return this.items[this.items.length-1]}tryPeek(){return this.items.length>0}toArray(){return this.items}};function BY(t){switch(t){case 0:case 2:case 7:case 8:case 11:case 12:case 13:case 14:return!0;default:return!1}}a(BY,"isTypeDefinition");var hu=class t{static{a(this,"TextRange")}static{this.empty=new t(0,0)}constructor(e,r){this.start=e,this.length=r}static fromBounds(e,r){return new t(e,r-e)}get end(){return this.start+this.length}contains(e){return this.start<=e&&this.end>=e}containsRange(e){return this.start<=e.start&&this.end>=e.end}equals(e){return this.start===e.start&&this.length===e.length}getText(e){return e.slice(this.start,this.end)}getTextWithIndentation(e,r){let n=[],o=this.start;for(o=afn(e,e.length,o),sfn(n,r);o{let c=this.stmts.upsertToken.get(n.authAuthority,n.oauthClientId,n.user,n.scopes,s.ciphertext,s.schemaVersion,r,o,o,o);return this.stmts.upsertActiveSession.run(r,c.token_id,o),this.stmts.deleteSignoutTombstone.run(r),{tokenId:c.token_id,tokenRewrite:c.token_rewrite===1}})}async assignActiveSession(r,n){let o=Date.now();pU(this.db,()=>{if(!this.stmts.selectTokenById.get(n))throw new Error(`assignActiveSession: tokenId ${n} not found`);this.stmts.upsertActiveSession.run(r,n,o),this.stmts.deleteSignoutTombstone.run(r),this.stmts.bumpLastUsed.run(o,n)})}async markEditorOptedOut(r){let n=Date.now();pU(this.db,()=>{this.stmts.deleteActiveSession.run(r),this.stmts.insertSignoutTombstone.run(r,n)})}async hasOptOutTombstone(r){return this.stmts.selectSignoutTombstone.get(r)!==void 0}async listTokensByRecency(r=-1){let n=this.stmts.selectAllTokensByRecency.all(r),o=[];for(let s of n){let c=await this.toStoredTokenRecordOrPurge(s);c&&o.push(c)}return o}async findTokenByAuthority(r){let n=this.stmts.selectTokenByAuthority.get(r);return n?await this.toStoredTokenRecordOrPurge(n):void 0}async listAvailableTokens(){return this.stmts.selectAllTokensByRecency.all(-1).map(n=>({tokenId:n.token_id,authAuthority:n.auth_authority,oauthClientId:n.oauth_client_id,userLogin:n.user_login,sourceEditorId:n.source_editor_id,lastUsedAt:n.last_used_at}))}async deleteTokenCascade(r){let n=Date.now();return pU(this.db,()=>{let o=this.stmts.deleteActiveSessionsForTokenReturning.all(r),s=this.stmts.deleteTokenById.run(r);for(let{editor_id:c}of o)this.stmts.insertSignoutTombstone.run(c,n);return{affectedEditors:o.length,tokenDeleted:Number(s.changes)===1}})}async touchActiveSession(r){let n=Date.now();pU(this.db,()=>{let o=this.stmts.selectActiveSessionByEditor.get(r);o&&this.stmts.bumpLastUsed.run(n,o.token_id)})}async getMetadata(r){return this.stmts.getMetadata.get(r)?.value}async setMetadata(r,n){this.stmts.setMetadata.run(r,n)}async upgradePlaintextRows(){let r=this.stmts.selectPlaintextTokenRows.all(),n=0,o=0,s=0;for(let c of r){let l;try{let d=this.secretStorage.unwrap({schemaVersion:l6t,ciphertext:c.token_ciphertext});l=this.secretStorage.wrap(d)}catch{o++;continue}let u=pU(this.db,()=>this.stmts.updateTokenCiphertext.run(l.ciphertext,l.schemaVersion,c.token_id));Number(u.changes)===1?n++:s++}return{attempted:r.length,upgraded:n,failed:o,skipped:s}}async decryptOauthTokensFromV1ToV0(){let r=this.stmts.selectEncryptedTokenRows.all(),n=0,o=0,s=0;for(let c of r){let l;try{l=this.secretStorage.unwrap({schemaVersion:DVe,ciphertext:c.token_ciphertext})}catch(d){if(d instanceof RQ){let{affectedEditors:f,tokenDeleted:h}=await this.deleteTokenCascade(c.token_id);h?(o++,ISe(this.ctx,{editorId:c.source_editor_id,trigger:"unwrap_failure",affectedEditors:f})):s++;continue}s++;continue}this.writePlaintextRow(c.token_id,l)===1?n++:s++}return{attempted:r.length,decrypted:n,purged:o,skipped:s}}writePlaintextRow(r,n){let o=pU(this.db,()=>this.stmts.updateTokenToPlaintext.run(Buffer.from(n,"utf8"),r));return Number(o.changes)}async toStoredTokenRecordOrPurge(r){try{let n=this.secretStorage.unwrap({schemaVersion:r.token_schema_version,ciphertext:r.token_ciphertext});if(r.token_schema_version===DVe){let o=r.token_id,s=n;setImmediate(()=>{try{this.writePlaintextRow(o,s)}catch(c){u6t.info(this.ctx,`opportunistic v1->v0 heal failed tokenId=${o} (will retry on next read/boot)`,c)}})}return{tokenId:r.token_id,sourceEditorId:r.source_editor_id,record:{user:r.user_login,accessToken:n,authAuthority:r.auth_authority,oauthClientId:r.oauth_client_id,scopes:r.scopes}}}catch(n){n instanceof RQ&&n.kind==="tagMismatch"&&this.deleteTokenCascade(r.token_id).then(({affectedEditors:o,tokenDeleted:s})=>{s&&(u6t.warn(this.ctx,`purged token after AES unwrap failure (tagMismatch) tokenId=${r.token_id} affectedEditors=${o}`),ISe(this.ctx,{editorId:r.source_editor_id,trigger:"unwrap_failure",affectedEditors:o}))}).catch(o=>u6t.error(this.ctx,`cleanup after AES unwrap failure failed tokenId=${r.token_id} (row may be preserved, will retry on next read)`,o));return}}};var rpn=fe(require("fs")),d6t=fe(require("node:sqlite")),npn=fe(require("path"));var kQ=new pe("AuthRepoInit");function ble(){return typeof performance<"u"?performance.now():Date.now()}a(ble,"nowMs");function tpn(t){try{t.close()}catch{}}a(tpn,"safeClose");function H3o(t){let e=ble(),r={durationMs:0};try{rpn.mkdirSync(npn.dirname(t),{recursive:!0,mode:448})}catch(o){return r.durationMs=ble()-e,r.errorPhase="ensureDir",r.error=o,{db:void 0,diagnostics:r}}let n;try{n=new d6t.default.DatabaseSync(t)}catch(o){return r.durationMs=ble()-e,r.errorPhase="connectDb",r.error=o,{db:void 0,diagnostics:r}}try{rPt(n)}catch(o){return r.durationMs=ble()-e,r.errorPhase="applyPragmas",r.error=o,tpn(n),{db:void 0,diagnostics:r}}try{nPt(n)}catch(o){return r.durationMs=ble()-e,r.errorPhase="applySchema",r.error=o,tpn(n),{db:void 0,diagnostics:r}}return r.durationMs=ble()-e,{db:n,diagnostics:r}}a(H3o,"tryOpenAuthDb");function G3o(t,e){let r=new d6t.default.DatabaseSync(":memory:");return rPt(r),nPt(r),new IIe(t,r,e)}a(G3o,"openInMemoryAuthRepo");function ipn(t,e,r){let{db:n,diagnostics:o}=H3o(e);return n?{repo:new IIe(t,n,r),diagnostics:{...o,repoKind:"sqlite"}}:{repo:G3o(t,r),diagnostics:{...o,repoKind:"memory"}}}a(ipn,"buildAuthRepository");function opn(t,e){if(e.repoKind==="memory"){kQ.error(t,`auth.db open failed (phase=${e.errorPhase}); using in-memory fallback. Tokens will not persist across restarts.`,e.error);try{t.get(es).showWarningMessageOnlyOnce("auth.db.inMemoryFallback","GitHub Copilot could not open its credential store and is using an in-memory fallback. You will need to sign in again after restarting.").catch(r=>{kQ.info(t,"reportAuthRepoFallbackNotice: notification failed",r)})}catch(r){kQ.info(t,"reportAuthRepoFallbackNotice: notification skipped",r)}}}a(opn,"reportAuthRepoFallbackNotice");function spn(t,e){xrn(t,e)}a(spn,"reportAuthRepoTelemetry");async function f6t(t){let e=t.get(x3),r=t.get(yf);if(Gfn(t)){kQ.info(t,"secret-store: encryption disabled by config; pinning writes to plaintext v0");let c={available:!1,errorPhase:"disabledByConfig"};return r.onInitialized(()=>Qje(t,{writerKind:"plaintext",diagnostics:c})),{diagnostics:c}}let{masterKey:n,diagnostics:o}=await s6t.resolveMasterKey(t);if(!n)return V3o(t,o),r.onInitialized(()=>Qje(t,{writerKind:"plaintext",diagnostics:o})),{diagnostics:o};let s=new PVe(n);return e.addReader(s),r.onInitialized(()=>Qje(t,{writerKind:"plaintext",diagnostics:o})),$3o(t),{diagnostics:o}}a(f6t,"initializeSecretStorage");function $3o(t){let e=t.get(yf);setImmediate(()=>{t.get(fx).decryptOauthTokensFromV1ToV0().then(r=>{r.attempted!==0&&e.onInitialized(()=>Z5t(t,{result:r}))}).catch(r=>{kQ.error(t,"secret-store: v1->v0 decrypt pass failed",r),e.onInitialized(()=>Z5t(t,{error:r}))})})}a($3o,"scheduleDecryptOauthTokensFromV1ToV0");function V3o(t,e){kQ.info(t,`secret-store fallback: tokens stored in plaintext on disk (no OS keychain available; phase=${e.errorPhase??"n/a"})`);try{t.get(es).showWarningMessageOnlyOnce("auth.secretStorage.plaintextFallback","GitHub Copilot could not access the OS keychain. OAuth tokens are stored in plaintext on disk.").catch(r=>{kQ.info(t,"reportSecretStorageFallbackNotice: notification failed",r)})}catch(r){kQ.info(t,"reportSecretStorageFallbackNotice: notification skipped",r)}}a(V3o,"reportSecretStorageFallbackNotice");p();p();var W3o=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function z3o(t){return W3o.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(z3o,"isOomError");function zY(t,e,r,n=Nr){if(!Ym(e)){if(e instanceof Error){let o=e;z3o(o)?t.get(Ss).setWarning("cls",{message:"Out of memory"}):o.code==="EMFILE"||o.code==="ENFILE"?t.get(Ss).setWarning("cls",{message:"Too many open files"}):o.code==="CopilotPromptLoadFailure"?t.get(Ss).setWarning("cls",{message:"Corrupted Copilot installation"}):`${o.code}`.startsWith("CopilotPromptWorkerExit")?t.get(Ss).setWarning("cls",{message:"Worker unexpectedly exited"}):o.syscall==="uv_cwd"&&o.code==="ENOENT"&&t.get(Ss).setWarning("cls",{message:"Current working directory does not exist"})}n.exception(t,e,r)}}a(zY,"handleException");function apn(t){process.addListener("uncaughtException",r=>{zY(t,r,"uncaughtException")});let e=!1;process.addListener("unhandledRejection",r=>{if(!e)try{e=!0,zY(t,r,"unhandledRejection")}finally{e=!1}})}a(apn,"registerDefaultHandlers");function cpn(){SQ("o200k_base").catch(()=>{})}a(cpn,"prewarmTokenizers");p();p();p();var w3={abap:{extensions:[".abap"]},aspdotnet:{extensions:[".asax",".ascx",".ashx",".asmx",".aspx",".axd"]},bat:{extensions:[".bat",".cmd"]},bibtex:{extensions:[".bib",".bibtex"]},blade:{extensions:[".blade",".blade.php"]},BluespecSystemVerilog:{extensions:[".bsv"]},c:{extensions:[".c",".cats",".h",".h.in",".idc"]},csharp:{extensions:[".cake",".cs",".cs.pp",".csx",".linq"]},cpp:{extensions:[".c++",".cc",".cp",".cpp",".cppm",".cxx",".h",".h++",".hh",".hpp",".hxx",".idl",".inc",".inl",".ino",".ipp",".ixx",".rc",".re",".tcc",".tpp",".txx",".i"]},cobol:{extensions:[".cbl",".ccp",".cob",".cobol",".cpy"]},css:{extensions:[".css",".wxss"]},clojure:{extensions:[".bb",".boot",".cl2",".clj",".cljc",".cljs",".cljs.hl",".cljscm",".cljx",".edn",".hic"],filenames:["riemann.config"]},ql:{extensions:[".ql",".qll"]},coffeescript:{extensions:["._coffee",".cake",".cjsx",".coffee",".iced"],filenames:["Cakefile"]},cuda:{extensions:[".cu",".cuh"]},dart:{extensions:[".dart"]},dockerfile:{extensions:[".containerfile",".dockerfile"],filenames:["Containerfile","Dockerfile"]},dotenv:{extensions:[".env"],filenames:[".env",".env.ci",".env.dev",".env.development",".env.development.local",".env.example",".env.local",".env.prod",".env.production",".env.sample",".env.staging",".env.test",".env.testing"]},html:{extensions:[".ect",".ejs",".ejs.t",".jst",".hta",".htm",".html",".html.hl",".html5",".inc",".jsp",".njk",".tpl",".twig",".wxml",".xht",".xhtml",".phtml",".liquid"]},elixir:{extensions:[".ex",".exs"],filenames:["mix.lock"]},erlang:{extensions:[".app",".app.src",".erl",".es",".escript",".hrl",".xrl",".yrl"],filenames:["Emakefile","rebar.config","rebar.config.lock","rebar.lock"]},fsharp:{extensions:[".fs",".fsi",".fsx"]},go:{extensions:[".go"]},groovy:{extensions:[".gradle",".groovy",".grt",".gtpl",".gvy",".jenkinsfile"],filenames:["Jenkinsfile","Jenkinsfile"]},graphql:{extensions:[".gql",".graphql",".graphqls"]},terraform:{extensions:[".hcl",".nomad",".tf",".tfvars",".workflow"]},hlsl:{extensions:[".cginc",".fx",".fxh",".hlsl",".hlsli"]},erb:{extensions:[".erb",".erb.deface",".rhtml"]},razor:{extensions:[".cshtml",".razor"]},haml:{extensions:[".haml",".haml.deface"]},handlebars:{extensions:[".handlebars",".hbs"]},haskell:{extensions:[".hs",".hs-boot",".hsc"]},ini:{extensions:[".cfg",".cnf",".dof",".ini",".lektorproject",".prefs",".pro",".properties",".url"],filenames:[".buckconfig",".coveragerc",".flake8",".pylintrc","HOSTS","buildozer.spec","hosts","pylintrc","vlcrc"]},json:{extensions:[".4DForm",".4DProject",".JSON-tmLanguage",".avsc",".geojson",".gltf",".har",".ice",".json",".json.example",".jsonl",".mcmeta",".sarif",".tact",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","MODULE.bazel.lock","Package.resolved","Pipfile.lock","bun.lock","composer.lock","deno.lock","flake.lock","mcmod.info"]},jsonc:{extensions:[".code-snippets",".code-workspace",".jsonc",".sublime-build",".sublime-color-scheme",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[".babelrc",".devcontainer.json",".eslintrc.json",".jscsrc",".jshintrc",".jslintrc",".swcrc","api-extractor.json","argv.json","devcontainer.json","extensions.json","jsconfig.json","keybindings.json","language-configuration.json","launch.json","profiles.json","settings.json","tasks.json","tsconfig.json","tslint.json"]},java:{extensions:[".jav",".java",".jsh"]},javascript:{extensions:["._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".js",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib"],filenames:["Jakefile"]},julia:{extensions:[".jl"]},kotlin:{extensions:[".kt",".ktm",".kts"]},less:{extensions:[".less"]},lua:{extensions:[".fcgi",".lua",".luau",".nse",".p8",".pd_lua",".rbxs",".rockspec",".wlua"],filenames:[".luacheckrc"]},makefile:{extensions:[".d",".mak",".make",".makefile",".mk",".mkfile"],filenames:["BSDmakefile","GNUmakefile","Kbuild","Makefile","Makefile.am","Makefile.boot","Makefile.frag","Makefile.in","Makefile.inc","Makefile.wat","makefile","makefile.sco","mkfile"]},markdown:{extensions:[".livemd",".markdown",".md",".mdown",".mdwn",".mdx",".mkd",".mkdn",".mkdown",".ronn",".scd",".workbook"],filenames:["contents.lr"]},"objective-c":{extensions:[".h",".m"]},"objective-cpp":{extensions:[".mm"]},php:{extensions:[".aw",".ctp",".fcgi",".inc",".install",".module",".php",".php3",".php4",".php5",".phps",".phpt",".theme"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"]},perl:{extensions:[".al",".cgi",".fcgi",".perl",".ph",".pl",".plx",".pm",".psgi",".t"],filenames:[".latexmkrc","Makefile.PL","Rexfile","ack","cpanfile","latexmkrc"]},powershell:{extensions:[".ps1",".psd1",".psm1"]},pug:{extensions:[".jade",".pug"]},python:{extensions:[".cgi",".codon",".fcgi",".gyp",".gypi",".lmi",".py",".py3",".pyde",".pyi",".pyp",".pyt",".pyw",".rpy",".sage",".spec",".tac",".wsgi",".xpy"],filenames:[".gclient","DEPS","SConscript","SConstruct","wscript"]},r:{extensions:[".r",".rd",".rsx"],filenames:[".Rprofile","expr-dist"]},ruby:{extensions:[".builder",".eye",".fcgi",".gemspec",".god",".jbuilder",".mspec",".pluginspec",".podspec",".prawn",".rabl",".rake",".rb",".rbi",".rbuild",".rbw",".rbx",".ru",".ruby",".spec",".thor",".watchr"],filenames:[".irbrc",".pryrc",".simplecov","Appraisals","Berksfile","Brewfile","Buildfile","Capfile","Dangerfile","Deliverfile","Fastfile","Gemfile","Guardfile","Jarfile","Mavenfile","Podfile","Puppetfile","Rakefile","Snapfile","Steepfile","Thorfile","Vagrantfile","buildfile"]},rust:{extensions:[".rs",".rs.in"]},scss:{extensions:[".scss"]},sql:{extensions:[".cql",".ddl",".inc",".mysql",".prc",".sql",".tab",".udf",".viw"]},sass:{extensions:[".sass"]},scala:{extensions:[".kojo",".sbt",".sc",".scala"]},shellscript:{extensions:[".bash",".bats",".cgi",".command",".fcgi",".fish",".ksh",".sh",".sh.in",".tmux",".tool",".trigger",".zsh",".zsh-theme"],filenames:[".bash_aliases",".bash_functions",".bash_history",".bash_logout",".bash_profile",".bashrc",".cshrc",".envrc",".flaskenv",".kshrc",".login",".profile",".tmux.conf",".zlogin",".zlogout",".zprofile",".zshenv",".zshrc","9fs","PKGBUILD","bash_aliases","bash_logout","bash_profile","bashrc","cshrc","gradlew","kshrc","login","man","profile","tmux.conf","zlogin","zlogout","zprofile","zshenv","zshrc"]},slang:{extensions:[".fxc",".hlsl",".s",".slang",".slangh",".usf",".ush",".vfx"]},slim:{extensions:[".slim"]},solidity:{extensions:[".sol"]},stylus:{extensions:[".styl"]},svelte:{extensions:[".svelte"]},swift:{extensions:[".swift"]},systemverilog:{extensions:[".sv",".svh",".vh"]},typescriptreact:{extensions:[".tsx"]},latex:{extensions:[".aux",".bbx",".cbx",".cls",".dtx",".ins",".lbx",".ltx",".mkii",".mkiv",".mkvi",".sty",".tex",".toc"]},typescript:{extensions:[".cts",".mts",".ts"]},verilog:{extensions:[".v",".veo"]},vim:{extensions:[".vba",".vim",".vimrc",".vmb"],filenames:[".exrc",".gvimrc",".nvimrc",".vimrc","_vimrc","gvimrc","nvimrc","vimrc"]},vb:{extensions:[".vb",".vbhtml",".Dsr",".bas",".cls",".ctl",".frm",".vbs"]},vue:{extensions:[".nvue",".vue"]},xml:{extensions:[".adml",".admx",".ant",".axaml",".axml",".builds",".ccproj",".ccxml",".clixml",".cproject",".cscfg",".csdef",".csl",".csproj",".ct",".depproj",".dita",".ditamap",".ditaval",".dll.config",".dotsettings",".filters",".fsproj",".fxml",".glade",".gml",".gmx",".gpx",".grxml",".gst",".hzp",".iml",".ivy",".jelly",".jsproj",".kml",".launch",".mdpolicy",".mjml",".mod",".mojo",".mxml",".natvis",".ncl",".ndproj",".nproj",".nuspec",".odd",".osm",".pkgproj",".plist",".pluginspec",".proj",".props",".ps1xml",".psc1",".pt",".pubxml",".qhelp",".rdf",".res",".resx",".rss",".sch",".scxml",".sfproj",".shproj",".srdf",".storyboard",".sublime-snippet",".svg",".sw",".targets",".tml",".typ",".ui",".urdf",".ux",".vbproj",".vcxproj",".vsixmanifest",".vssettings",".vstemplate",".vxml",".wixproj",".workflow",".wsdl",".wsf",".wxi",".wxl",".wxs",".x3d",".xacro",".xaml",".xib",".xlf",".xliff",".xmi",".xml",".xml.dist",".xmp",".xproj",".xsd",".xspec",".xul",".zcml"],filenames:[".classpath",".cproject",".project","App.config","NuGet.config","Settings.StyleCop","Web.Debug.config","Web.Release.config","Web.config","packages.config"]},xsl:{extensions:[".xsl",".xslt"]},yaml:{extensions:[".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".clangd",".gemrc","CITATION.cff","glide.lock","pixi.lock","yarn.lock"]},javascriptreact:{extensions:[".jsx"]},legend:{extensions:[".pure"]}};p();p();var lpn=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"],upn={".php":[".blade"]},PQ=Object.keys(w3).flatMap(t=>w3[t].extensions);var p6t=fe(require("node:path"));var Tle=class{constructor(e,r,n){this.languageId=e;this.isGuess=r;this.fileExtension=n}static{a(this,"Language")}},xIe=class{static{a(this,"LanguageDetection")}},h6t=new Map,Sle=new Map;for(let[t,{extensions:e,filenames:r}]of Object.entries(w3)){for(let n of e)h6t.set(n,[...h6t.get(n)??[],t]);for(let n of r??[])Sle.set(n,[...Sle.get(n)??[],t])}var m6t=class extends xIe{static{a(this,"FilenameAndExensionLanguageDetection")}detectLanguage(e){let r=Ki(e.uri),n=p6t.extname(r).toLowerCase(),o=this.extensionWithoutTemplateLanguage(r,n),s=this.detectLanguageId(r,o),c=this.computeFullyQualifiedExtension(n,o);return s?new Tle(s.languageId,s.isGuess,c):new Tle(e.languageId,!0,c)}extensionWithoutTemplateLanguage(e,r){if(lpn.includes(r)){let n=e.substring(0,e.lastIndexOf(".")),o=p6t.extname(n).toLowerCase();if(o.length>0&&PQ.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=upn[e];return!n||n.includes(r)}detectLanguageId(e,r){if(Sle.has(e))return{languageId:Sle.get(e)[0],isGuess:!1};let n=h6t.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),Sle.has(e))return{languageId:Sle.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},g6t=class extends xIe{constructor(r){super();this.delegate=r}static{a(this,"GroupingLanguageDetection")}detectLanguage(r){let n=this.delegate.detectLanguage(r),o=n.languageId;return o==="c"||o==="cpp"?new Tle("cpp",n.isGuess,n.fileExtension):n}},A6t=class extends xIe{constructor(r){super();this.delegate=r}static{a(this,"ClientProvidedLanguageDetection")}detectLanguage(r){return r.uri.startsWith("untitled:")||r.uri.startsWith("vscode-notebook-cell:")?new Tle(r.languageId,!0,""):this.delegate.detectLanguage(r)}},Y3o=new g6t(new A6t(new m6t));function uO({uri:t,languageId:e}){let r=Y3o.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(uO,"detectLanguage");p();p();p();p();function Wh(t){if(t.isCancellationRequested)throw new NVe}a(Wh,"throwIfCancellationRequested");function LP(t){return t instanceof NVe?!0:t instanceof Error&&t.name===y6t&&t.message===y6t}a(LP,"isCancellationError");var NVe=class extends Error{static{a(this,"CancellationError")}constructor(){super(y6t),this.name=this.message}},y6t="Canceled",MVe=class{constructor(){this.items=[]}static{a(this,"Stack")}push(e){this.items.push(e)}pop(){return this.items.pop()}peek(){return this.items[this.items.length-1]}tryPeek(){return this.items.length>0}toArray(){return this.items}};function YY(t){switch(t){case 0:case 2:case 7:case 8:case 11:case 12:case 13:case 14:return!0;default:return!1}}a(YY,"isTypeDefinition");var mu=class t{static{a(this,"TextRange")}static{this.empty=new t(0,0)}constructor(e,r){this.start=e,this.length=r}static fromBounds(e,r){return new t(e,r-e)}get end(){return this.start+this.length}contains(e){return this.start<=e&&this.end>=e}containsRange(e){return this.start<=e.start&&this.end>=e.end}equals(e){return this.start===e.start&&this.length===e.length}getText(e){return e.slice(this.start,this.end)}getTextWithIndentation(e,r){let n=[],o=this.start;for(o=fpn(e,e.length,o),dpn(n,r);o0||u>0||d>0||f>0?new Bx(r,"","",hu.fromBounds(s,c),hu.fromBounds(d,f),hu.fromBounds(h,m),y,t.kindFromString(g),0):null;if(E){t.updateScopesForSymbol(e,E);let _=E.nameRange.getText(n),v=this.createNameFromScopes(n,e.toArray());return v=A?`${A}.${v}`:v,new Bx(r,v,_.substring(_.lastIndexOf(".")+1),E.commentRange,E.nameRange,E.bodyRange,E.extentRange,E.kind,0)}return null}static updateScopesForSymbol(e,r){for(;e.tryPeek()&&!e.peek()?.extentRange.containsRange(r.extentRange);)e.pop();e.push(r)}static kindFromString(e){switch(e){case"definition.class":return 0;case"definition.constant":return 1;case"definition.enum_variant":return 3;case"definition.enum":return 2;case"definition.field":return 4;case"definition.function":return 5;case"definition.implementation":return 6;case"definition.interface":return 7;case"definition.macro":return 8;case"definition.method":return 9;case"import.module":case"definition.module":case"definition.module.filescoped":return 10;case"definition.struct":return 11;case"definition.trait":return 12;case"definition.type":return 13;case"definition.union":return 14;case"reference":return 16;case"wildcard":return 18;case"alias":return 19;case"import":return 17;default:throw new Error("NotSupportedException")}}cleanQuotedString(e){return e.replace(/^(['"])(.*)\1$/,"$2")}};var lVe=class extends Gh{static{a(this,"GoSymbolExtractor")}get languageId(){return"go"}extractSymbols(e,r){return this.executeQuery(e,r,HLo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},uVe=class extends Gh{static{a(this,"GoReferenceExtractor")}get languageId(){return"go"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}extractReferences(e,r){return this.executeQuery(e,r,$Lo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,VLo),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},dVe=class extends Gh{static{a(this,"GoImportExtractor")}get languageId(){return"go"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){let n=await this.findMatches(r,GLo),o=new Set;try{n.matches.forEach(s=>{let c,l,u;for(let d of s.captures)d.name==="import.name"?c=d:d.name==="alias"?l=d:d.name==="import"&&(u=d);if(c&&u){let d=this.cleanQuotedString(c.node.text),f=c.node.startIndex+1,h=c.node.endIndex-1,m=l?new hu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new hu(f,h-f),g=new hu(u.node.startIndex,u.node.endIndex-u.node.startIndex),A=hu.empty,y=hu.empty,E=d.substring(d.lastIndexOf("/")+1);o.add(new Bx(e,d,E,A,m,y,g,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},HLo=` +`),o=fpn(e,e.length,++o),dpn(n,r)):o++;return n.join("")}};function dpn(t,e){for(let r=0;r0||u>0||d>0||f>0?new Gx(r,"","",mu.fromBounds(s,c),mu.fromBounds(d,f),mu.fromBounds(h,m),y,t.kindFromString(g),0):null;if(E){t.updateScopesForSymbol(e,E);let _=E.nameRange.getText(n),v=this.createNameFromScopes(n,e.toArray());return v=A?`${A}.${v}`:v,new Gx(r,v,_.substring(_.lastIndexOf(".")+1),E.commentRange,E.nameRange,E.bodyRange,E.extentRange,E.kind,0)}return null}static updateScopesForSymbol(e,r){for(;e.tryPeek()&&!e.peek()?.extentRange.containsRange(r.extentRange);)e.pop();e.push(r)}static kindFromString(e){switch(e){case"definition.class":return 0;case"definition.constant":return 1;case"definition.enum_variant":return 3;case"definition.enum":return 2;case"definition.field":return 4;case"definition.function":return 5;case"definition.implementation":return 6;case"definition.interface":return 7;case"definition.macro":return 8;case"definition.method":return 9;case"import.module":case"definition.module":case"definition.module.filescoped":return 10;case"definition.struct":return 11;case"definition.trait":return 12;case"definition.type":return 13;case"definition.union":return 14;case"reference":return 16;case"wildcard":return 18;case"alias":return 19;case"import":return 17;default:throw new Error("NotSupportedException")}}cleanQuotedString(e){return e.replace(/^(['"])(.*)\1$/,"$2")}};var OVe=class extends zh{static{a(this,"GoSymbolExtractor")}get languageId(){return"go"}extractSymbols(e,r){return this.executeQuery(e,r,K3o)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},LVe=class extends zh{static{a(this,"GoReferenceExtractor")}get languageId(){return"go"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}extractReferences(e,r){return this.executeQuery(e,r,Z3o)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,X3o),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},BVe=class extends zh{static{a(this,"GoImportExtractor")}get languageId(){return"go"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){let n=await this.findMatches(r,J3o),o=new Set;try{n.matches.forEach(s=>{let c,l,u;for(let d of s.captures)d.name==="import.name"?c=d:d.name==="alias"?l=d:d.name==="import"&&(u=d);if(c&&u){let d=this.cleanQuotedString(c.node.text),f=c.node.startIndex+1,h=c.node.endIndex-1,m=l?new mu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new mu(f,h-f),g=new mu(u.node.startIndex,u.node.endIndex-u.node.startIndex),A=mu.empty,y=mu.empty,E=d.substring(d.lastIndexOf("/")+1);o.add(new Gx(e,d,E,A,m,y,g,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},K3o=` ( ((comment)* @comment) . @@ -2013,7 +2013,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la . (field_declaration name: (_) @name) @definition.field ) -`,GLo=` +`,J3o=` (import_declaration (import_spec name: (package_identifier)? @alias @@ -2024,15 +2024,15 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (import_spec name: (package_identifier)? @alias path: (interpreted_string_literal) @import.name))+) @import -`,$Lo=` +`,Z3o=` (call_expression function: (_) @name) @reference (type_identifier) @reference -`,VLo=` +`,X3o=` (call_expression function: (_) @name) @reference (type_identifier) @reference -`;p();var pVe=class extends Gh{static{a(this,"JavaSymbolExtractor")}get languageId(){return"java"}extractSymbols(e,r){return this.executeQuery(e,r,WLo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},hVe=class extends Gh{static{a(this,"JavaReferenceExtractor")}get languageId(){return"java"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}extractReferences(e,r){return this.executeQuery(e,r,YLo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,KLo),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},mVe=class extends Gh{static{a(this,"JavaImportExtractor")}get languageId(){return"java"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){return(await this.executeQuery(e,r,zLo)).filter(o=>o.kind===0)}},WLo=` +`;p();var UVe=class extends zh{static{a(this,"JavaSymbolExtractor")}get languageId(){return"java"}extractSymbols(e,r){return this.executeQuery(e,r,eFo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},QVe=class extends zh{static{a(this,"JavaReferenceExtractor")}get languageId(){return"java"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}extractReferences(e,r){return this.executeQuery(e,r,rFo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,nFo),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},qVe=class extends zh{static{a(this,"JavaImportExtractor")}get languageId(){return"java"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){return(await this.executeQuery(e,r,tFo)).filter(o=>o.kind===0)}},eFo=` ( [ (block_comment) @comment @@ -2095,7 +2095,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la . (enum_constant name: (identifier) @name) @definition.enum_variant ) -`,zLo=` +`,tFo=` ( [ ((line_comment)* @comment) @@ -2107,19 +2107,19 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (asterisk)? @wildcard ) @definition.class ) -`,YLo=` +`,rFo=` (method_invocation name: (identifier) @name ) @reference (type_identifier) @reference -`,KLo=` +`,nFo=` (method_invocation name: (identifier) @name ) @reference (type_identifier) @reference -`;p();var JLo=new Set(["null","undefined","void","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),gVe=class extends Gh{static{a(this,"JavaScriptSymbolExtractor")}get languageId(){return"javascript"}extractSymbols(e,r){return this.executeQuery(e,r,ZLo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},AVe=class extends Gh{static{a(this,"JavaScriptReferenceExtractor")}extractLocalReferences(e,r,n){throw new Error("Method not implemented.")}get languageId(){return"javascript"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,XLo)).filter(o=>!JLo.has(o.unqualifiedName))}};var ZLo=` +`;p();var iFo=new Set(["null","undefined","void","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),jVe=class extends zh{static{a(this,"JavaScriptSymbolExtractor")}get languageId(){return"javascript"}extractSymbols(e,r){return this.executeQuery(e,r,oFo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},HVe=class extends zh{static{a(this,"JavaScriptReferenceExtractor")}extractLocalReferences(e,r,n){throw new Error("Method not implemented.")}get languageId(){return"javascript"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,sFo)).filter(o=>!iFo.has(o.unqualifiedName))}};var oFo=` ( ((comment)* @comment) . @@ -2129,9 +2129,9 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (export_statement declaration: (lexical_declaration (variable_declarator name: (identifier) @name value: (_) @body))) @definition.function ] ) -`,XLo=` +`,sFo=` (call_expression function: (_) @name) @reference -`;p();var eBo=new Set(["int","str","float","bool","list","dict","tuple","set"]),yVe=class extends Gh{static{a(this,"PythonSymbolExtractor")}get languageId(){return"python"}extractSymbols(e,r){return this.executeQuery(e,r,tBo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},EVe=class extends Gh{static{a(this,"PythonReferenceExtractor")}get languageId(){return"python"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,rBo)).filter(o=>!eBo.has(o.unqualifiedName))}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,iBo),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},_Ve=class extends Gh{static{a(this,"PythonImportExtractor")}get languageId(){return"python"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){let n=await this.findMatches(r,nBo),o=new Set;try{n.matches.forEach(s=>{let c,l,u,d;for(let f of s.captures)f.name==="import.name"?c=f:f.name==="import.module"?u=f:f.name==="alias"?l=f:f.name==="import"&&(d=f);if(u&&d){let f=c||u,h=l?new hu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new hu(f.node.startIndex,d.node.endIndex-f.node.endIndex),m=new hu(d.node.startIndex,d.node.endIndex-d.node.startIndex),g=hu.empty,A=hu.empty,y=f.node.text,E=y.split(".").pop()||y,_;c?_=`${u.node.text}.${c.node.text}`:_=u.node.text,o.add(new Bx(e,_,E,g,h,A,m,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},tBo=` +`;p();var aFo=new Set(["int","str","float","bool","list","dict","tuple","set"]),GVe=class extends zh{static{a(this,"PythonSymbolExtractor")}get languageId(){return"python"}extractSymbols(e,r){return this.executeQuery(e,r,cFo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},$Ve=class extends zh{static{a(this,"PythonReferenceExtractor")}get languageId(){return"python"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,lFo)).filter(o=>!aFo.has(o.unqualifiedName))}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,dFo),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},VVe=class extends zh{static{a(this,"PythonImportExtractor")}get languageId(){return"python"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){let n=await this.findMatches(r,uFo),o=new Set;try{n.matches.forEach(s=>{let c,l,u,d;for(let f of s.captures)f.name==="import.name"?c=f:f.name==="import.module"?u=f:f.name==="alias"?l=f:f.name==="import"&&(d=f);if(u&&d){let f=c||u,h=l?new mu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new mu(f.node.startIndex,d.node.endIndex-f.node.endIndex),m=new mu(d.node.startIndex,d.node.endIndex-d.node.startIndex),g=mu.empty,A=mu.empty,y=f.node.text,E=y.split(".").pop()||y,_;c?_=`${u.node.text}.${c.node.text}`:_=u.node.text,o.add(new Gx(e,_,E,g,h,A,m,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},cFo=` ( ((comment)* @comment) . @@ -2143,7 +2143,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la . (function_definition name: (_) @name body: (_) @body) @definition.method ) -`,rBo=` +`,lFo=` (call function: (_) @name) @reference (type [ @@ -2152,7 +2152,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la ]) @reference (class_definition superclasses: (argument_list (identifier) @name)) @reference -`,nBo=` +`,uFo=` (import_statement name: (dotted_name) @import.module) @import (import_from_statement @@ -2167,7 +2167,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (aliased_import name: ((dotted_name) @import.name) alias: (identifier) @alias)) @import -`,iBo=` +`,dFo=` (call function: (_) @name) @reference (type [ @@ -2176,7 +2176,7 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la ]) @reference (class_definition superclasses: (argument_list (identifier) @name)) @reference -`;p();var oBo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),yle=class extends Gh{static{a(this,"TypeScriptSymbolExtractor")}get languageId(){return"typescript"}extractSymbols(e,r){return this.executeQuery(e,r,sBo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},Ele=class extends Gh{static{a(this,"TypeScriptReferenceExtractor")}get languageId(){return"typescript"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,aBo)).filter(o=>!oBo.has(o.unqualifiedName))}extractLocalReferences(){return Promise.reject(new Error("Method not implemented."))}};var sBo=` +`;p();var fFo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),Ile=class extends zh{static{a(this,"TypeScriptSymbolExtractor")}get languageId(){return"typescript"}extractSymbols(e,r){return this.executeQuery(e,r,pFo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},xle=class extends zh{static{a(this,"TypeScriptReferenceExtractor")}get languageId(){return"typescript"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,hFo)).filter(o=>!fFo.has(o.unqualifiedName))}extractLocalReferences(){return Promise.reject(new Error("Method not implemented."))}};var pFo=` ( ((comment)* @comment) . @@ -2201,13 +2201,13 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la (variable_declarator name: (identifier) @name type: (type_annotation (type_identifier))) ] ) -`,aBo=` +`,hFo=` (call_expression function: (_) @name) @reference (type_identifier) @name @reference (new_expression constructor: (identifier) @name) @reference -`;p();var cBo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),vVe=class extends yle{static{a(this,"TypeScriptReactSymbolExtractor")}get languageId(){return"typescriptreact"}extractSymbols(e,r){return Promise.all([this.executeQuery(e,r,lBo),super.extractSymbols(e,r)]).then(([n,o])=>[...n,...o])}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},CVe=class extends Ele{static{a(this,"TypeScriptReactReferenceExtractor")}get languageId(){return"typescriptreact"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){let[n,o]=await Promise.all([this.executeQuery(e,r,uBo),super.extractReferences(e,r)]);return[...n.filter(s=>!cBo.has(s.unqualifiedName)),...o]}},lBo=` +`;p();var mFo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),WVe=class extends Ile{static{a(this,"TypeScriptReactSymbolExtractor")}get languageId(){return"typescriptreact"}extractSymbols(e,r){return Promise.all([this.executeQuery(e,r,gFo),super.extractSymbols(e,r)]).then(([n,o])=>[...n,...o])}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},zVe=class extends xle{static{a(this,"TypeScriptReactReferenceExtractor")}get languageId(){return"typescriptreact"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){let[n,o]=await Promise.all([this.executeQuery(e,r,AFo),super.extractReferences(e,r)]);return[...n.filter(s=>!mFo.has(s.unqualifiedName)),...o]}},gFo=` ( ((comment)* @comment) . @@ -2220,58 +2220,58 @@ ${r}+- `:"";return e+this.description+o}}},ag=class{constructor(e,r,n,o){this.la body: (_) @body))) @definition.function ] ) -`,uBo=` +`,AFo=` (jsx_element open_tag: (jsx_opening_element name: (_) @name) close_tag: (jsx_closing_element) ) @reference (jsx_self_closing_element name: (_) @name) @reference (import_specifier name:(identifier) @name) @reference -`;var cIe=[{symbolExtractor:new pVe,referenceExtractor:new hVe,importExtractor:new mVe,languageId:"java"},{symbolExtractor:new lVe,referenceExtractor:new uVe,importExtractor:new dVe,languageId:"go"},{symbolExtractor:new yVe,referenceExtractor:new EVe,importExtractor:new _Ve,languageId:"python"},{symbolExtractor:new yle,referenceExtractor:new Ele,languageId:"typescript"},{symbolExtractor:new vVe,referenceExtractor:new CVe,languageId:"typescriptreact"},{symbolExtractor:new gVe,referenceExtractor:new AVe,languageId:"javascript"}];function cfn(t){let e=nO({uri:t});if(e&&cIe.some(r=>e===r.languageId))return e}a(cfn,"getSupportedLanguageIdForMultiLanguageProvider");var lfn=new Map(cIe.map(t=>[t.languageId,t.referenceExtractor])),ufn=new Map(cIe.map(t=>[t.languageId,t.symbolExtractor])),dfn=new Map(cIe.filter(t=>t.importExtractor!==void 0).map(t=>[t.languageId,t.importExtractor])),Y8t=cIe.map(t=>C3[t.languageId].extensions).flat();p();p();p();p();p();p();p();p();p();function K8t(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(K8t,"virtualNode");function ffn(t,e,r,n,o){if(r==="")throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:t,lineNumber:e,sourceLine:r,subs:n,label:o}}a(ffn,"lineNode");function J8t(t){return{type:"blank",lineNumber:t,subs:[]}}a(J8t,"blankNode");function bVe(t){return{type:"top",indentation:-1,subs:t??[]}}a(bVe,"topNode");function xA(t){return t.type==="blank"}a(xA,"isBlank");function FY(t){return t.type==="line"}a(FY,"isLine");function UY(t){return t.type==="virtual"}a(UY,"isVirtual");p();function pfn(t,e){return rE(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(pfn,"clearLabelsIf");function QY(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>QY(n,e));return{...t,subs:r,label:t.label?e(t.label):void 0}}case"blank":return{...t,label:t.label?e(t.label):void 0};case"top":return{...t,subs:t.subs.map(r=>QY(r,e)),label:t.label?e(t.label):void 0}}}a(QY,"mapLabels");function rE(t,e,r){function n(o){r==="topDown"&&e(o),o.subs.forEach(s=>{n(s)}),r==="bottomUp"&&e(o)}a(n,"_visit"),n(t)}a(rE,"visitTree");function Z8t(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),rE(t,s,n),o}a(Z8t,"foldTree");function SVe(t,e,r){let n=a(s=>{if(r!==void 0&&r(s))return s;{let c=s.subs.map(n).filter(l=>l!==void 0);return s.subs=c,e(s)}},"rebuild"),o=n(t);return o!==void 0?o:bVe()}a(SVe,"rebuildTree");p();function fBo(t){let e=t.split(` -`),r=e.map(d=>d.match(/^\s*/)[0].length),n=e.map(d=>d.trimLeft());function o(d){let[f,h]=s(d+1,r[d]);return[ffn(r[d],d,n[d],f),h]}a(o,"parseNode");function s(d,f){let h,m=[],g=d,A;for(;gf);)if(n[g]==="")A===void 0&&(A=g),g+=1;else{if(A!==void 0){for(let y=A;ys.matches(n.sourceLine));o&&(n.label=o.label)}}a(r,"visitor"),rE(t,r,"bottomUp")}a(lIe,"labelLines");function TVe(t){function e(r){if(UY(r)&&r.label===void 0){let n=r.subs.filter(o=>!xA(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),rE(t,e,"bottomUp")}a(TVe,"labelVirtualInherited");function uIe(t){return Object.keys(t).map(e=>{let r;return t[e].test?r=a(n=>t[e].test(n),"matches"):r=t[e],{matches:r,label:e}})}a(uIe,"buildLabelRules");function X8t(t){let r=SVe(t,a(function(n){if(n.subs.length===0||n.subs.findIndex(c=>c.label==="closer"||c.label==="opener")===-1)return n;let o=[],s;for(let c=0;cu.subs.push(d)),l.subs=[];else if(l.label==="closer"&&s!==void 0&&(FY(l)||UY(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&xA(o[d]);)d-=1;if(s.subs.push(...o.splice(d+1)),l.subs.length>0){let f=s.subs.findIndex(A=>A.label!=="newVirtual"),h=s.subs.slice(0,f),m=s.subs.slice(f),g=m.length>0?[K8t(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),xA(l)||(s=l)}return n.subs=o,n},"rebuilder"));return pfn(t,n=>n==="newVirtual"),r}a(X8t,"combineClosersAndOpeners");function hfn(t,e=xA,r){return SVe(t,a(function(o){if(o.subs.length<=1)return o;let s=[],c=[],l,u=!1;function d(f=!1){if(l!==void 0&&(s.length>0||!f)){let h=K8t(l,c,r);s.push(h)}else c.forEach(h=>s.push(h))}a(d,"flushBlockIntoNewSubs");for(let f=0;f{if(r.label==="class"||r.label==="interface")for(let n of r.subs)!xA(n)&&(n.label===void 0||n.label==="annotation")&&(n.label="member")},"bottomUp"),e}a(gfn,"processJava");p();var ABo={heading:/^# /,subheading:/^## /,subsubheading:/### /},yBo=uIe(ABo);function Afn(t){let e=t;if(lIe(e,yBo),xA(e))return e;function r(s){if(s.label==="heading")return 1;if(s.label==="subheading")return 2;if(s.label==="subsubheading")return 3}a(r,"headingLevel");let n=[e],o=[...e.subs];e.subs=[];for(let s of o){let c=r(s);if(c===void 0||xA(s))n[n.length-1].subs.push(s);else{for(;n.lengthc+1;)n.pop()}}return e=hfn(e),e=qY(e),TVe(e),e}a(Afn,"processMarkdown");p();function yfn(t){return" ".repeat(t.indentation)+t.sourceLine+` -`}a(yfn,"deparseLine");e6t("markdown",Afn);e6t("java",gfn);var EBo={worthUp:.9,worthSibling:.88,worthDown:.8};function t6t(t,e,r=ws(),n=EBo){let o=QY(t,s=>s?1:void 0);return rE(o,s=>{if(xA(s))return;let c=s.subs.reduce((l,u)=>Math.max(l,u.label??0),0);s.label=Math.max(s.label??0,c*n.worthUp)},"bottomUp"),rE(o,s=>{if(xA(s))return;let c=s.subs.map(d=>d.label??0),l=[...c];for(let d=0;dMath.max(f,Math.pow(n.worthSibling,Math.abs(d-h))*c[d])));let u=s.label;u!==void 0&&(l=l.map(d=>Math.max(d,n.worthDown*u))),s.subs.forEach((d,f)=>d.label=l[f])},"topDown"),_Bo(o,e,r)}a(t6t,"fromTreeWithFocussedLines");function _Bo(t,e,r=ws()){let n=Z8t(t,[],(o,s)=>((o.type==="line"||o.type==="blank")&&s.push(o.type==="line"?[yfn(o).trimEnd(),o.label??0]:["",o.label??0]),s),"topDown");return new Ar(n,e,r)}a(_Bo,"fromTreeWithValuedLines");function PS(t,e=!0,r=!0,n,o=ws()){let s=typeof t=="string"?jY(t):jY(t.source,t.languageId);qY(s);let c=QY(s,l=>e&&l!=="closer");return rE(c,l=>{l.label===void 0&&(l.label=e&&l.label!==!1)},"topDown"),e&&rE(c,l=>{if(l.label){let u=!1;for(let d of[...l.subs].reverse())d.label&&!u?u=!0:d.label=!1}else for(let u of l.subs)u.label=!1;l.subs.length>0&&(l.label=!1)},"topDown"),r&&rE(c,l=>{l.label||=(FY(l)||xA(l))&&l.lineNumber==0},"topDown"),t6t(c,n,o)}a(PS,"elidableTextForSourceCode");p();var dIe=class t{constructor(e,r,n,o="strict",s){this.text=e;this._value=r;this._cost=n;this.metadata=s;this.markedForRemoval=!1;if(e.includes(` +`;var wIe=[{symbolExtractor:new UVe,referenceExtractor:new QVe,importExtractor:new qVe,languageId:"java"},{symbolExtractor:new OVe,referenceExtractor:new LVe,importExtractor:new BVe,languageId:"go"},{symbolExtractor:new GVe,referenceExtractor:new $Ve,importExtractor:new VVe,languageId:"python"},{symbolExtractor:new Ile,referenceExtractor:new xle,languageId:"typescript"},{symbolExtractor:new WVe,referenceExtractor:new zVe,languageId:"typescriptreact"},{symbolExtractor:new jVe,referenceExtractor:new HVe,languageId:"javascript"}];function ppn(t){let e=uO({uri:t});if(e&&wIe.some(r=>e===r.languageId))return e}a(ppn,"getSupportedLanguageIdForMultiLanguageProvider");var hpn=new Map(wIe.map(t=>[t.languageId,t.referenceExtractor])),mpn=new Map(wIe.map(t=>[t.languageId,t.symbolExtractor])),gpn=new Map(wIe.filter(t=>t.importExtractor!==void 0).map(t=>[t.languageId,t.importExtractor])),E6t=wIe.map(t=>w3[t.languageId].extensions).flat();p();p();p();p();p();p();p();p();p();function _6t(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(_6t,"virtualNode");function Apn(t,e,r,n,o){if(r==="")throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:t,lineNumber:e,sourceLine:r,subs:n,label:o}}a(Apn,"lineNode");function v6t(t){return{type:"blank",lineNumber:t,subs:[]}}a(v6t,"blankNode");function YVe(t){return{type:"top",indentation:-1,subs:t??[]}}a(YVe,"topNode");function RA(t){return t.type==="blank"}a(RA,"isBlank");function KY(t){return t.type==="line"}a(KY,"isLine");function JY(t){return t.type==="virtual"}a(JY,"isVirtual");p();function ypn(t,e){return sE(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(ypn,"clearLabelsIf");function ZY(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>ZY(n,e));return{...t,subs:r,label:t.label?e(t.label):void 0}}case"blank":return{...t,label:t.label?e(t.label):void 0};case"top":return{...t,subs:t.subs.map(r=>ZY(r,e)),label:t.label?e(t.label):void 0}}}a(ZY,"mapLabels");function sE(t,e,r){function n(o){r==="topDown"&&e(o),o.subs.forEach(s=>{n(s)}),r==="bottomUp"&&e(o)}a(n,"_visit"),n(t)}a(sE,"visitTree");function C6t(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),sE(t,s,n),o}a(C6t,"foldTree");function KVe(t,e,r){let n=a(s=>{if(r!==void 0&&r(s))return s;{let c=s.subs.map(n).filter(l=>l!==void 0);return s.subs=c,e(s)}},"rebuild"),o=n(t);return o!==void 0?o:YVe()}a(KVe,"rebuildTree");p();function EFo(t){let e=t.split(` +`),r=e.map(d=>d.match(/^\s*/)[0].length),n=e.map(d=>d.trimLeft());function o(d){let[f,h]=s(d+1,r[d]);return[Apn(r[d],d,n[d],f),h]}a(o,"parseNode");function s(d,f){let h,m=[],g=d,A;for(;gf);)if(n[g]==="")A===void 0&&(A=g),g+=1;else{if(A!==void 0){for(let y=A;ys.matches(n.sourceLine));o&&(n.label=o.label)}}a(r,"visitor"),sE(t,r,"bottomUp")}a(RIe,"labelLines");function JVe(t){function e(r){if(JY(r)&&r.label===void 0){let n=r.subs.filter(o=>!RA(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),sE(t,e,"bottomUp")}a(JVe,"labelVirtualInherited");function kIe(t){return Object.keys(t).map(e=>{let r;return t[e].test?r=a(n=>t[e].test(n),"matches"):r=t[e],{matches:r,label:e}})}a(kIe,"buildLabelRules");function b6t(t){let r=KVe(t,a(function(n){if(n.subs.length===0||n.subs.findIndex(c=>c.label==="closer"||c.label==="opener")===-1)return n;let o=[],s;for(let c=0;cu.subs.push(d)),l.subs=[];else if(l.label==="closer"&&s!==void 0&&(KY(l)||JY(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&RA(o[d]);)d-=1;if(s.subs.push(...o.splice(d+1)),l.subs.length>0){let f=s.subs.findIndex(A=>A.label!=="newVirtual"),h=s.subs.slice(0,f),m=s.subs.slice(f),g=m.length>0?[_6t(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),RA(l)||(s=l)}return n.subs=o,n},"rebuilder"));return ypn(t,n=>n==="newVirtual"),r}a(b6t,"combineClosersAndOpeners");function Epn(t,e=RA,r){return KVe(t,a(function(o){if(o.subs.length<=1)return o;let s=[],c=[],l,u=!1;function d(f=!1){if(l!==void 0&&(s.length>0||!f)){let h=_6t(l,c,r);s.push(h)}else c.forEach(h=>s.push(h))}a(d,"flushBlockIntoNewSubs");for(let f=0;f{if(r.label==="class"||r.label==="interface")for(let n of r.subs)!RA(n)&&(n.label===void 0||n.label==="annotation")&&(n.label="member")},"bottomUp"),e}a(vpn,"processJava");p();var SFo={heading:/^# /,subheading:/^## /,subsubheading:/### /},TFo=kIe(SFo);function Cpn(t){let e=t;if(RIe(e,TFo),RA(e))return e;function r(s){if(s.label==="heading")return 1;if(s.label==="subheading")return 2;if(s.label==="subsubheading")return 3}a(r,"headingLevel");let n=[e],o=[...e.subs];e.subs=[];for(let s of o){let c=r(s);if(c===void 0||RA(s))n[n.length-1].subs.push(s);else{for(;n.lengthc+1;)n.pop()}}return e=Epn(e),e=XY(e),JVe(e),e}a(Cpn,"processMarkdown");p();function bpn(t){return" ".repeat(t.indentation)+t.sourceLine+` +`}a(bpn,"deparseLine");S6t("markdown",Cpn);S6t("java",vpn);var IFo={worthUp:.9,worthSibling:.88,worthDown:.8};function T6t(t,e,r=ws(),n=IFo){let o=ZY(t,s=>s?1:void 0);return sE(o,s=>{if(RA(s))return;let c=s.subs.reduce((l,u)=>Math.max(l,u.label??0),0);s.label=Math.max(s.label??0,c*n.worthUp)},"bottomUp"),sE(o,s=>{if(RA(s))return;let c=s.subs.map(d=>d.label??0),l=[...c];for(let d=0;dMath.max(f,Math.pow(n.worthSibling,Math.abs(d-h))*c[d])));let u=s.label;u!==void 0&&(l=l.map(d=>Math.max(d,n.worthDown*u))),s.subs.forEach((d,f)=>d.label=l[f])},"topDown"),xFo(o,e,r)}a(T6t,"fromTreeWithFocussedLines");function xFo(t,e,r=ws()){let n=C6t(t,[],(o,s)=>((o.type==="line"||o.type==="blank")&&s.push(o.type==="line"?[bpn(o).trimEnd(),o.label??0]:["",o.label??0]),s),"topDown");return new Ar(n,e,r)}a(xFo,"fromTreeWithValuedLines");function LS(t,e=!0,r=!0,n,o=ws()){let s=typeof t=="string"?eK(t):eK(t.source,t.languageId);XY(s);let c=ZY(s,l=>e&&l!=="closer");return sE(c,l=>{l.label===void 0&&(l.label=e&&l.label!==!1)},"topDown"),e&&sE(c,l=>{if(l.label){let u=!1;for(let d of[...l.subs].reverse())d.label&&!u?u=!0:d.label=!1}else for(let u of l.subs)u.label=!1;l.subs.length>0&&(l.label=!1)},"topDown"),r&&sE(c,l=>{l.label||=(KY(l)||RA(l))&&l.lineNumber==0},"topDown"),T6t(c,n,o)}a(LS,"elidableTextForSourceCode");p();var PIe=class t{constructor(e,r,n,o="strict",s){this.text=e;this._value=r;this._cost=n;this.metadata=s;this.markedForRemoval=!1;if(e.includes(` `)&&o!=="none")throw new Error("LineWithValueAndCost: text contains newline");if(r<0&&o!=="none")throw new Error("LineWithValueAndCost: value is negative");if(n<0&&o!=="none")throw new Error("LineWithValueAndCost: cost is negative");if(o=="strict"&&r>1)throw new Error("Value should normally be between 0 and 1 -- set validation to `loose` to ignore this error")}static{a(this,"LineWithValueAndCost")}get value(){return this._value}get cost(){return this._cost}adjustValue(e){return this._value*=e,this}setValue(e){return this._value=e,this}recost(e=r=>ws().tokenLength(r+` `)){return this._cost=e(this.text),this}copy(){let e=new t(this.text,this.value,this.cost,"none",this.metadata);return e.markedForRemoval=this.markedForRemoval,e}};var Ar=class t{constructor(e,r,n=ws()){this.metadata=r;this.tokenizer=n;this.lines=[];let o=[];for(let s of e){let c=Array.isArray(s)?s[1]:1,l=Array.isArray(s)?s[0]:s;typeof l=="string"?l.split(` -`).forEach(u=>o.push(new dIe(u,c,n.tokenLength(u+` -`),"strict",this.metadata))):l instanceof t?l.lines.forEach(u=>o.push(u.copy().adjustValue(c))):"source"in l&&"languageId"in l&&PS(l).lines.forEach(u=>o.push(u.copy().adjustValue(c)))}this.lines=o}static{a(this,"ElidableText")}adjust(e){this.lines.forEach(r=>r.adjustValue(e))}recost(e=r=>ws().tokenLength(r+` +`).forEach(u=>o.push(new PIe(u,c,n.tokenLength(u+` +`),"strict",this.metadata))):l instanceof t?l.lines.forEach(u=>o.push(u.copy().adjustValue(c))):"source"in l&&"languageId"in l&&LS(l).lines.forEach(u=>o.push(u.copy().adjustValue(c)))}this.lines=o}static{a(this,"ElidableText")}adjust(e){this.lines.forEach(r=>r.adjustValue(e))}recost(e=r=>ws().tokenLength(r+` `)){this.lines.forEach(r=>r.recost(e))}elide(e,r="[...]",n=!0,o="removeLeastDesirable",s=this.tokenizer,c="topToBottom"){if(s.tokenLength(r+` -`)>e)throw new Error("maxTokens must be larger than the ellipsis length");let{lines:l,totalCost:u,priorityQueue:d}=CBo(this.lines,o);if(u<=e)return r6t(l);bBo(d,c);let f=u;for(;f>e&&d.length>0;){let m=d.shift().originalIndex,g=l[m];if(g.markedForRemoval)continue;let A=n?SBo(l,m):"",y=Efn(A,r,s,g);l[m]=y,f-=g.cost,f+=y.cost;let E=m+1;if(E=0){let v=l[_];IVe(v,r)&&(f-=v.cost,v.markedForRemoval=!0)}}if(f>e)return r6t([Efn("",r,s)]);let h=l.filter(m=>!m.markedForRemoval);for(let m=h.length-1;m>0;m--)IVe(h[m],r)&&IVe(h[m-1],r)&&h.splice(m,1);return r6t(h)}};function vBo(t){return t?.text.match(/^\s*/)?.[0]??""}a(vBo,"getIndentation");function IVe(t,e){return t?.text.trim()===e.trim()}a(IVe,"isEllipsis");function r6t(t){return{getText:a(()=>t.map(e=>e.text).join(` -`),"getText"),getLines:a(()=>t,"getLines")}}a(r6t,"produceElidedText");function CBo(t,e){let r=0,n=[];return{lines:t.map((s,c)=>{let l=s.copy();return e==="removeLeastBangForBuck"&&l.adjustValue(1/l.cost),r+=l.cost,n.push({originalIndex:c,value:l.value}),l}),totalCost:r,priorityQueue:n}}a(CBo,"initializeElisionContext");function bBo(t,e){t.sort((r,n)=>r.value!==n.value?r.value-n.value:e==="bottomToTop"?n.originalIndex-r.originalIndex:r.originalIndex-n.originalIndex)}a(bBo,"sortPriorityQueue");function SBo(t,e){let r="";for(let n=e;n>=0;n--){let o=t[n];if(!o.markedForRemoval&&o.text.trim()!==""){r=vBo(o);break}}return r}a(SBo,"getClosestIndentation");function Efn(t,e,r,n){let o=t+e;return new dIe(o,1/0,r.tokenLength(o+` -`),"loose",n?.metadata)}a(Efn,"getNewEllipsis");p();var _fn=require("fs");async function vfn(t,e,r,n,o){let s=new Map,c=0;for(let h of t){let m=h.node.fileName.toLowerCase(),g=s.get(m);g?g.symbols.push(h):s.set(m,{symbols:[h],topRank:c}),c++}if(s.delete(r.toLowerCase()),s.size===0)return[];let l=e,u=e/Math.min(4,s.size),d=[],f=Array.from(s.keys());f.sort((h,m)=>{let g=s.get(h).topRank,A=s.get(m).topRank;return g-A});for(let h of f){let m=s.get(h).symbols;if(m.length===0)continue;let g=m[0].node.fileName,A=m.reduce((y,E)=>y+E.node.extentRange.length,0);for(let y of m){if(l<=5)return d;Hh(o);let E=y.node.extentRange.length/A,_=Math.min(l,E*u),v=(await TBo([y])).elide(_).getText();l-=n.tokenLength(v),d.push({uri:g,value:v})}}return d}a(vfn,"symbolRangesToCodeSnippets");async function TBo(t){if(t.length===0)return new Ar([]);let e=t[0].node.fileName,r=[],n="";try{let o=rs(e);o&&(n=(await _fn.promises.readFile(o)).toString())}catch{}for(let o of t)Cfn(o,n).forEach(s=>r.push(s));return new Ar(r)}a(TBo,"sameFileSymbolRangeToElidableText");function Cfn(t,e){let n=[],o=t.node,s=e.substring(n6t(e,o.commentRange.start),o.commentRange.end);n.push([i6t(s),1-3e-4]);let c=n6t(e,o.bodyRange.start),l=n6t(e,o.extentRange.start),u=o.bodyRange.length===0?e.substring(l,o.extentRange.end):e.substring(o.commentRange.length===0?l:o.commentRange.end,c);if(BY(o.kind)&&(u="BEGIN "+u.trimStart()),n.push([i6t(u),1-1e-4]),t.children.length>0)for(let d of t.children)n.push(...Cfn(d,e));else{let d=1-(BY(t.node.kind)?3e-4:4e-4),f=e.substring(c,o.bodyRange.end);n.push([i6t(f),d])}return BY(o.kind)&&n.push(["END "+u.substring(6),1-1e-4]),n.filter(d=>d[0].length>0)}a(Cfn,"prepareForElidableText");function n6t(t,e){for(;e-1>=0&&(t[e-1]===" "||t[e-1]===" ");)e--;return e}a(n6t,"shiftLeftToNearestLineEndingOrAlphanumeric");function i6t(t){let e=0;for(;ee)throw new Error("maxTokens must be larger than the ellipsis length");let{lines:l,totalCost:u,priorityQueue:d}=RFo(this.lines,o);if(u<=e)return I6t(l);kFo(d,c);let f=u;for(;f>e&&d.length>0;){let m=d.shift().originalIndex,g=l[m];if(g.markedForRemoval)continue;let A=n?PFo(l,m):"",y=Spn(A,r,s,g);l[m]=y,f-=g.cost,f+=y.cost;let E=m+1;if(E=0){let v=l[_];ZVe(v,r)&&(f-=v.cost,v.markedForRemoval=!0)}}if(f>e)return I6t([Spn("",r,s)]);let h=l.filter(m=>!m.markedForRemoval);for(let m=h.length-1;m>0;m--)ZVe(h[m],r)&&ZVe(h[m-1],r)&&h.splice(m,1);return I6t(h)}};function wFo(t){return t?.text.match(/^\s*/)?.[0]??""}a(wFo,"getIndentation");function ZVe(t,e){return t?.text.trim()===e.trim()}a(ZVe,"isEllipsis");function I6t(t){return{getText:a(()=>t.map(e=>e.text).join(` +`),"getText"),getLines:a(()=>t,"getLines")}}a(I6t,"produceElidedText");function RFo(t,e){let r=0,n=[];return{lines:t.map((s,c)=>{let l=s.copy();return e==="removeLeastBangForBuck"&&l.adjustValue(1/l.cost),r+=l.cost,n.push({originalIndex:c,value:l.value}),l}),totalCost:r,priorityQueue:n}}a(RFo,"initializeElisionContext");function kFo(t,e){t.sort((r,n)=>r.value!==n.value?r.value-n.value:e==="bottomToTop"?n.originalIndex-r.originalIndex:r.originalIndex-n.originalIndex)}a(kFo,"sortPriorityQueue");function PFo(t,e){let r="";for(let n=e;n>=0;n--){let o=t[n];if(!o.markedForRemoval&&o.text.trim()!==""){r=wFo(o);break}}return r}a(PFo,"getClosestIndentation");function Spn(t,e,r,n){let o=t+e;return new PIe(o,1/0,r.tokenLength(o+` +`),"loose",n?.metadata)}a(Spn,"getNewEllipsis");p();var Tpn=require("fs");async function Ipn(t,e,r,n,o){let s=new Map,c=0;for(let h of t){let m=h.node.fileName.toLowerCase(),g=s.get(m);g?g.symbols.push(h):s.set(m,{symbols:[h],topRank:c}),c++}if(s.delete(r.toLowerCase()),s.size===0)return[];let l=e,u=e/Math.min(4,s.size),d=[],f=Array.from(s.keys());f.sort((h,m)=>{let g=s.get(h).topRank,A=s.get(m).topRank;return g-A});for(let h of f){let m=s.get(h).symbols;if(m.length===0)continue;let g=m[0].node.fileName,A=m.reduce((y,E)=>y+E.node.extentRange.length,0);for(let y of m){if(l<=5)return d;Wh(o);let E=y.node.extentRange.length/A,_=Math.min(l,E*u),v=(await DFo([y])).elide(_).getText();l-=n.tokenLength(v),d.push({uri:g,value:v})}}return d}a(Ipn,"symbolRangesToCodeSnippets");async function DFo(t){if(t.length===0)return new Ar([]);let e=t[0].node.fileName,r=[],n="";try{let o=Us(e);o&&(n=(await Tpn.promises.readFile(o)).toString())}catch{}for(let o of t)xpn(o,n).forEach(s=>r.push(s));return new Ar(r)}a(DFo,"sameFileSymbolRangeToElidableText");function xpn(t,e){let n=[],o=t.node,s=e.substring(x6t(e,o.commentRange.start),o.commentRange.end);n.push([w6t(s),1-3e-4]);let c=x6t(e,o.bodyRange.start),l=x6t(e,o.extentRange.start),u=o.bodyRange.length===0?e.substring(l,o.extentRange.end):e.substring(o.commentRange.length===0?l:o.commentRange.end,c);if(YY(o.kind)&&(u="BEGIN "+u.trimStart()),n.push([w6t(u),1-1e-4]),t.children.length>0)for(let d of t.children)n.push(...xpn(d,e));else{let d=1-(YY(t.node.kind)?3e-4:4e-4),f=e.substring(c,o.bodyRange.end);n.push([w6t(f),d])}return YY(o.kind)&&n.push(["END "+u.substring(6),1-1e-4]),n.filter(d=>d[0].length>0)}a(xpn,"prepareForElidableText");function x6t(t,e){for(;e-1>=0&&(t[e-1]===" "||t[e-1]===" ");)e--;return e}a(x6t,"shiftLeftToNearestLineEndingOrAlphanumeric");function w6t(t){let e=0;for(;e=0&&(t[r]==="\r"||t[r]===` -`||t[r]===" "||t[r]===" ");)r--;return t.substring(e,r+1)}a(i6t,"trimLineEndingsAndTrailingWhitespace");var o6t=class{constructor(e,r){this.referenceExtractors=new Map;this.index=e,this.referenceExtractors=r}static{a(this,"ContextRetrievalStrategy")}},vQ=class extends o6t{static{a(this,"UnqualifiedNameRetrievalStrategy")}constructor(e,r,n,o){super(e,r),this.caseSensitive=n,this.typesOnly=o}async getContextAtPositionAsync(e,r,n,o,s,c){let l=this.referenceExtractors.get(o);if(!l)return[];Hh(c);let u=await l.extractReferences(e,r);Hh(c);let d=Array.from(u);d.sort((g,A)=>this.compareSymbolRangesByProximityToCaret(g,A,n));let f=[],h=new Set,m=await this.findDefinitionsViaUnqualifiedNames(d,s,c);this.typesOnly&&(m=m.filter(g=>BY(g.kind)));for(let g of m)h.has(JSON.stringify(g))||(h.add(JSON.stringify(g)),f.push(await this.makeSymbolRangeNodeFromDefinition(g,c)));return f}async findDefinitionsViaUnqualifiedNames(e,r,n){let o=Array.from(new Set(e.map(h=>h.unqualifiedName))),s=!this.caseSensitive,c=await this.index.findPotentialDefinitionsAsync(o,s,n),l=a(h=>s?h.toLowerCase():h,"lowercaseIfCaseInsensitive"),u=a(h=>l(h.unqualifiedName),"getSymbolKey"),d=new Map;for(let h of c){let m=u(h),g=d.get(m)??[];d.set(m,[...g,h])}let f=[];for(let h of o){let m=d.get(l(h));if(!(!m||m.length>r.mlcpMaxSymbolMatches)){if(f.length+m.length>r.mlcpMaxContextItems){f.push(...m.slice(0,r.mlcpMaxContextItems-f.length));break}f.push(...m)}}return f}async makeSymbolRangeNodeFromDefinition(e,r){if(Hh(r),BY(e.kind)){let n=await this.index.findSymbolsByFullyQualifiedNamePrefix(e.fileName,e.fullyQualifiedName+".",r),o=await Promise.all(n.map(s=>this.makeSymbolRangeNodeFromDefinition(s,r)));return{node:e,children:o}}else return{node:e,children:[]}}compareSymbolRangesByProximityToCaret(e,r,n){let o=e.extentRange.end<=n,s=r.extentRange.end<=n;if(o&&!s)return-1;if(!o&&s)return 1;let c=Math.abs(e.extentRange.start-n),l=Math.abs(r.extentRange.start-n);return c-l}},xVe=class{constructor(e,r){this.strategies=new Map;this.strategies.set("go",new vQ(e,r,!0,!0)),this.strategies.set("java",new vQ(e,r,!0,!0)),this.strategies.set("python",new vQ(e,r,!0,!1)),this.strategies.set("typescript",new vQ(e,r,!0,!0)),this.strategies.set("typescriptreact",new vQ(e,r,!0,!0)),this.strategies.set("javascript",new vQ(e,r,!0,!1))}static{a(this,"SyntaxAwareContextRetrieval")}async getStringifiedContextAtPositionAsync(e,r,n,o,s,c,l){let u=await this.getContextAtPositionAsync(e,r,n,o,s,l);Hh(l);let d=ws();return vfn(u,c,e,d,l)}async getContextAtPositionAsync(e,r,n,o,s,c){return this.strategies.has(o)?this.strategies.get(o).getContextAtPositionAsync(e,r,n,o,s,c):[]}};p();p();p();p();var HY={Id:"id"},DS={FilePath:"filePath",LastWriteTimeUtc:"lastWriteTimeUtc"},ua={DocumentId:"documentId",FullyQualifiedName:"fullyQualifiedName",UnqualifiedName:"unqualifiedName",CommentStart:"commentStart",CommentLength:"commentLength",NameStart:"nameStart",NameLength:"nameLength",BodyStart:"bodyStart",BodyLength:"bodyLength",ExtentStart:"extentStart",ExtentLength:"extentLength",SymbolKind:"symbolKind",RefKind:"refKind"};p();p();var wVe=class{constructor(e,r,n){this.tableName=e;this.createOptimizations=r;this.extraCreateDeclarations=n;this.primaryKey=new s6t(HY.Id)}static{a(this,"SQLTableQueryGenerator")}createTableQueries(){return this.createTableString??=this.generateCreateTableString(),[this.createTableString,...this.createOptimizations]}generateCreateTableString(){let e=this.fields.map(r=>r.initColumnString());return this.extraCreateDeclarations&&e.push(this.extraCreateDeclarations),e.push(),[`CREATE TABLE IF NOT EXISTS ${this.tableName} (`,` ${this.primaryKey.initColumnString()},`,` ${e.join(`, +`||t[r]===" "||t[r]===" ");)r--;return t.substring(e,r+1)}a(w6t,"trimLineEndingsAndTrailingWhitespace");var R6t=class{constructor(e,r){this.referenceExtractors=new Map;this.index=e,this.referenceExtractors=r}static{a(this,"ContextRetrievalStrategy")}},DQ=class extends R6t{static{a(this,"UnqualifiedNameRetrievalStrategy")}constructor(e,r,n,o){super(e,r),this.caseSensitive=n,this.typesOnly=o}async getContextAtPositionAsync(e,r,n,o,s,c){let l=this.referenceExtractors.get(o);if(!l)return[];Wh(c);let u=await l.extractReferences(e,r);Wh(c);let d=Array.from(u);d.sort((g,A)=>this.compareSymbolRangesByProximityToCaret(g,A,n));let f=[],h=new Set,m=await this.findDefinitionsViaUnqualifiedNames(d,s,c);this.typesOnly&&(m=m.filter(g=>YY(g.kind)));for(let g of m)h.has(JSON.stringify(g))||(h.add(JSON.stringify(g)),f.push(await this.makeSymbolRangeNodeFromDefinition(g,c)));return f}async findDefinitionsViaUnqualifiedNames(e,r,n){let o=Array.from(new Set(e.map(h=>h.unqualifiedName))),s=!this.caseSensitive,c=await this.index.findPotentialDefinitionsAsync(o,s,n),l=a(h=>s?h.toLowerCase():h,"lowercaseIfCaseInsensitive"),u=a(h=>l(h.unqualifiedName),"getSymbolKey"),d=new Map;for(let h of c){let m=u(h),g=d.get(m)??[];d.set(m,[...g,h])}let f=[];for(let h of o){let m=d.get(l(h));if(!(!m||m.length>r.mlcpMaxSymbolMatches)){if(f.length+m.length>r.mlcpMaxContextItems){f.push(...m.slice(0,r.mlcpMaxContextItems-f.length));break}f.push(...m)}}return f}async makeSymbolRangeNodeFromDefinition(e,r){if(Wh(r),YY(e.kind)){let n=await this.index.findSymbolsByFullyQualifiedNamePrefix(e.fileName,e.fullyQualifiedName+".",r),o=await Promise.all(n.map(s=>this.makeSymbolRangeNodeFromDefinition(s,r)));return{node:e,children:o}}else return{node:e,children:[]}}compareSymbolRangesByProximityToCaret(e,r,n){let o=e.extentRange.end<=n,s=r.extentRange.end<=n;if(o&&!s)return-1;if(!o&&s)return 1;let c=Math.abs(e.extentRange.start-n),l=Math.abs(r.extentRange.start-n);return c-l}},XVe=class{constructor(e,r){this.strategies=new Map;this.strategies.set("go",new DQ(e,r,!0,!0)),this.strategies.set("java",new DQ(e,r,!0,!0)),this.strategies.set("python",new DQ(e,r,!0,!1)),this.strategies.set("typescript",new DQ(e,r,!0,!0)),this.strategies.set("typescriptreact",new DQ(e,r,!0,!0)),this.strategies.set("javascript",new DQ(e,r,!0,!1))}static{a(this,"SyntaxAwareContextRetrieval")}async getStringifiedContextAtPositionAsync(e,r,n,o,s,c,l){let u=await this.getContextAtPositionAsync(e,r,n,o,s,l);Wh(l);let d=ws();return Ipn(u,c,e,d,l)}async getContextAtPositionAsync(e,r,n,o,s,c){return this.strategies.has(o)?this.strategies.get(o).getContextAtPositionAsync(e,r,n,o,s,c):[]}};p();p();p();p();var tK={Id:"id"},BS={FilePath:"filePath",LastWriteTimeUtc:"lastWriteTimeUtc"},da={DocumentId:"documentId",FullyQualifiedName:"fullyQualifiedName",UnqualifiedName:"unqualifiedName",CommentStart:"commentStart",CommentLength:"commentLength",NameStart:"nameStart",NameLength:"nameLength",BodyStart:"bodyStart",BodyLength:"bodyLength",ExtentStart:"extentStart",ExtentLength:"extentLength",SymbolKind:"symbolKind",RefKind:"refKind"};p();p();var eWe=class{constructor(e,r,n){this.tableName=e;this.createOptimizations=r;this.extraCreateDeclarations=n;this.primaryKey=new k6t(tK.Id)}static{a(this,"SQLTableQueryGenerator")}createTableQueries(){return this.createTableString??=this.generateCreateTableString(),[this.createTableString,...this.createOptimizations]}generateCreateTableString(){let e=this.fields.map(r=>r.initColumnString());return this.extraCreateDeclarations&&e.push(this.extraCreateDeclarations),e.push(),[`CREATE TABLE IF NOT EXISTS ${this.tableName} (`,` ${this.primaryKey.initColumnString()},`,` ${e.join(`, `)}`,")"].join(` `)}insertQuery(e,r){this.cachedInsertQueryStrings??=this.generateInsertQueryStrings();let n=[this.cachedInsertQueryStrings.prefix,Array(r).fill(this.cachedInsertQueryStrings.valuesTemplate).join(`, `)];return e&&n.push("ON CONFLICT DO NOTHING"),n.join(` `)}generateInsertQueryStrings(){return{prefix:`INSERT INTO ${this.tableName} (${this.fields.map(e=>e.name).join(", ")}) -VALUES`,valuesTemplate:`(${Array(this.fields.length).fill("?").join(", ")})`}}},fIe=class t extends wVe{constructor(){super(t.tableName,[`CREATE UNIQUE INDEX IF NOT EXISTS 'IX_Document_FilePath' ON '${t.tableName}' ('${DS.FilePath}');`]);this.fields=[new mIe(DS.FilePath,{notNull:!0,collate:!0,noCase:!0,unique:!0}),new kC(DS.LastWriteTimeUtc,{notNull:!0})]}static{a(this,"DocumentQueryGenerator")}static{this.tableName="Document"}},pIe=class t extends wVe{constructor(){super(t.tableName,[`CREATE INDEX IF NOT EXISTS 'IX_Symbol_DocumentId' ON '${t.tableName}' ('${ua.DocumentId}', '${ua.ExtentStart}', '${ua.ExtentLength}');`,`CREATE INDEX IF NOT EXISTS 'IX_Symbol_UnqualifiedName' ON '${t.tableName}' ('${ua.UnqualifiedName}');`],`FOREIGN KEY(${ua.DocumentId}) REFERENCES Document(${HY.Id}) ON DELETE CASCADE`);this.fields=[new kC(ua.DocumentId),new mIe(ua.FullyQualifiedName,{notNull:!0}),new mIe(ua.UnqualifiedName,{notNull:!0}),new kC(ua.CommentStart,{notNull:!0}),new kC(ua.CommentLength,{notNull:!0}),new kC(ua.NameStart,{notNull:!0}),new kC(ua.NameLength,{notNull:!0}),new kC(ua.BodyStart,{notNull:!0}),new kC(ua.BodyLength,{notNull:!0}),new kC(ua.ExtentStart,{notNull:!0}),new kC(ua.ExtentLength,{notNull:!0}),new kC(ua.SymbolKind,{notNull:!0}),new kC(ua.RefKind,{notNull:!0})]}static{a(this,"SymbolQueryGenerator")}static{this.tableName="Symbol"}},hIe=class{constructor(e,r){this.name=e;this.notNull=r?.notNull??!1}static{a(this,"SQLField")}},mIe=class extends hIe{static{a(this,"StringColumn")}constructor(e,r){super(e,{notNull:r?.notNull}),this.collate=r?.collate??!1,this.noCase=r?.noCase??!1,this.unique=r?.unique??!1}initColumnString(){let e=this.collate?"COLLATE":void 0,r=this.noCase?"NOCASE":void 0,n=this.notNull?"NOT NULL":void 0,o=this.unique?"UNIQUE":void 0,s=[e,r,n,o].filter(c=>c).join(" ");return`'${this.name}' VARCHAR(500) ${s}`}},kC=class extends hIe{static{a(this,"NumberColumn")}initColumnString(){return`'${this.name}' INTEGER${this.notNull?" NOT NULL":""}`}},s6t=class extends hIe{static{a(this,"NumberPrimaryKeyColumn")}initColumnString(){return`'${this.name}' INTEGER PRIMARY KEY AUTOINCREMENT${this.notNull?" NOT NULL":""}`}};var RVe=class{static{a(this,"SQLTable")}constructor(e){this.queryGenerator=this.createQueryGenerator(),this.init=this.doInit(e)}async doInit(e){let r=await e;if(r)return this.create(r),r}create(e){let r=this.queryGenerator.createTableQueries();for(let n of r)e.exec(n)}async insert(e,r){let n=await this.init;if(!n)return;let o=this.queryGenerator.insertQuery(r,e.length),c=e.map(l=>Object.values(l)).flat();n.prepare(o).run(...c)}async getAllRows(){let e=await this.init;return e?PVe(e,`SELECT * FROM ${this.queryGenerator.tableName}`,[]):[]}async deleteRow(e){let r=await this.init;r&&kVe(r,`DELETE FROM ${this.queryGenerator.tableName} WHERE ${HY.Id} = ?`,[e])}},b3=class t extends RVe{static{a(this,"DocumentTable")}static{this.tableName=fIe.tableName}createQueryGenerator(){return new fIe}async updateTimestamp(e,r){let n=await this.init;n&&kVe(n,`UPDATE ${t.tableName} SET ${DS.LastWriteTimeUtc} = ? WHERE ${DS.FilePath} = ?`,[r,e])}async deleteAllWithPath(e){let r=await this.init;r&&kVe(r,`DELETE FROM ${t.tableName} WHERE ${DS.FilePath} = ?`,[e])}async getDocumentByFilePath(e){let r=await this.init;return r?PVe(r,`SELECT * FROM ${this.queryGenerator.tableName} WHERE ${DS.FilePath} = ?`,[e]):[]}},$h=class t extends RVe{static{a(this,"SymbolTable")}static{this.tableName=pIe.tableName}createQueryGenerator(){return new pIe}async clearAllSymbolsFromDocument(e){let r=await this.init;r&&kVe(r,`DELETE FROM ${t.tableName} WHERE ${ua.DocumentId} = ?`,[e])}};function PVe(t,e,r){let o=Array.isArray(r)?r:[r];return o.length>0?t.prepare(e).all(...o):t.prepare(e).all()}a(PVe,"runDBQuery");function kVe(t,e,r){let o=Array.isArray(r)?r:[r];o.length>0?t.prepare(e).run(...o):t.prepare(e).run()}a(kVe,"runDBCommand");var bfn=de(require("node:sqlite"));var DVe=class{constructor(e){this.databaseFileName=e;this.innerJoinStatement=`INNER JOIN ${b3.tableName} ON ${$h.tableName}.${ua.DocumentId} = ${b3.tableName}.${HY.Id}`;this.db=this.initDb(e),this.documentTable=new b3(this.db),this.symbolTable=new $h(this.db)}static{a(this,"DocumentSymbolDatabase")}initDb(e){try{let r=new bfn.default.DatabaseSync(e,{open:!0});return r.exec(` +VALUES`,valuesTemplate:`(${Array(this.fields.length).fill("?").join(", ")})`}}},DIe=class t extends eWe{constructor(){super(t.tableName,[`CREATE UNIQUE INDEX IF NOT EXISTS 'IX_Document_FilePath' ON '${t.tableName}' ('${BS.FilePath}');`]);this.fields=[new OIe(BS.FilePath,{notNull:!0,collate:!0,noCase:!0,unique:!0}),new NC(BS.LastWriteTimeUtc,{notNull:!0})]}static{a(this,"DocumentQueryGenerator")}static{this.tableName="Document"}},NIe=class t extends eWe{constructor(){super(t.tableName,[`CREATE INDEX IF NOT EXISTS 'IX_Symbol_DocumentId' ON '${t.tableName}' ('${da.DocumentId}', '${da.ExtentStart}', '${da.ExtentLength}');`,`CREATE INDEX IF NOT EXISTS 'IX_Symbol_UnqualifiedName' ON '${t.tableName}' ('${da.UnqualifiedName}');`],`FOREIGN KEY(${da.DocumentId}) REFERENCES Document(${tK.Id}) ON DELETE CASCADE`);this.fields=[new NC(da.DocumentId),new OIe(da.FullyQualifiedName,{notNull:!0}),new OIe(da.UnqualifiedName,{notNull:!0}),new NC(da.CommentStart,{notNull:!0}),new NC(da.CommentLength,{notNull:!0}),new NC(da.NameStart,{notNull:!0}),new NC(da.NameLength,{notNull:!0}),new NC(da.BodyStart,{notNull:!0}),new NC(da.BodyLength,{notNull:!0}),new NC(da.ExtentStart,{notNull:!0}),new NC(da.ExtentLength,{notNull:!0}),new NC(da.SymbolKind,{notNull:!0}),new NC(da.RefKind,{notNull:!0})]}static{a(this,"SymbolQueryGenerator")}static{this.tableName="Symbol"}},MIe=class{constructor(e,r){this.name=e;this.notNull=r?.notNull??!1}static{a(this,"SQLField")}},OIe=class extends MIe{static{a(this,"StringColumn")}constructor(e,r){super(e,{notNull:r?.notNull}),this.collate=r?.collate??!1,this.noCase=r?.noCase??!1,this.unique=r?.unique??!1}initColumnString(){let e=this.collate?"COLLATE":void 0,r=this.noCase?"NOCASE":void 0,n=this.notNull?"NOT NULL":void 0,o=this.unique?"UNIQUE":void 0,s=[e,r,n,o].filter(c=>c).join(" ");return`'${this.name}' VARCHAR(500) ${s}`}},NC=class extends MIe{static{a(this,"NumberColumn")}initColumnString(){return`'${this.name}' INTEGER${this.notNull?" NOT NULL":""}`}},k6t=class extends MIe{static{a(this,"NumberPrimaryKeyColumn")}initColumnString(){return`'${this.name}' INTEGER PRIMARY KEY AUTOINCREMENT${this.notNull?" NOT NULL":""}`}};var tWe=class{static{a(this,"SQLTable")}constructor(e){this.queryGenerator=this.createQueryGenerator(),this.init=this.doInit(e)}async doInit(e){let r=await e;if(r)return this.create(r),r}create(e){let r=this.queryGenerator.createTableQueries();for(let n of r)e.exec(n)}async insert(e,r){let n=await this.init;if(!n)return;let o=this.queryGenerator.insertQuery(r,e.length),c=e.map(l=>Object.values(l)).flat();n.prepare(o).run(...c)}async getAllRows(){let e=await this.init;return e?nWe(e,`SELECT * FROM ${this.queryGenerator.tableName}`,[]):[]}async deleteRow(e){let r=await this.init;r&&rWe(r,`DELETE FROM ${this.queryGenerator.tableName} WHERE ${tK.Id} = ?`,[e])}},R3=class t extends tWe{static{a(this,"DocumentTable")}static{this.tableName=DIe.tableName}createQueryGenerator(){return new DIe}async updateTimestamp(e,r){let n=await this.init;n&&rWe(n,`UPDATE ${t.tableName} SET ${BS.LastWriteTimeUtc} = ? WHERE ${BS.FilePath} = ?`,[r,e])}async deleteAllWithPath(e){let r=await this.init;r&&rWe(r,`DELETE FROM ${t.tableName} WHERE ${BS.FilePath} = ?`,[e])}async getDocumentByFilePath(e){let r=await this.init;return r?nWe(r,`SELECT * FROM ${this.queryGenerator.tableName} WHERE ${BS.FilePath} = ?`,[e]):[]}},Yh=class t extends tWe{static{a(this,"SymbolTable")}static{this.tableName=NIe.tableName}createQueryGenerator(){return new NIe}async clearAllSymbolsFromDocument(e){let r=await this.init;r&&rWe(r,`DELETE FROM ${t.tableName} WHERE ${da.DocumentId} = ?`,[e])}};function nWe(t,e,r){let o=Array.isArray(r)?r:[r];return o.length>0?t.prepare(e).all(...o):t.prepare(e).all()}a(nWe,"runDBQuery");function rWe(t,e,r){let o=Array.isArray(r)?r:[r];o.length>0?t.prepare(e).run(...o):t.prepare(e).run()}a(rWe,"runDBCommand");var wpn=fe(require("node:sqlite"));var iWe=class{constructor(e){this.databaseFileName=e;this.innerJoinStatement=`INNER JOIN ${R3.tableName} ON ${Yh.tableName}.${da.DocumentId} = ${R3.tableName}.${tK.Id}`;this.db=this.initDb(e),this.documentTable=new R3(this.db),this.symbolTable=new Yh(this.db)}static{a(this,"DocumentSymbolDatabase")}initDb(e){try{let r=new wpn.default.DatabaseSync(e,{open:!0});return r.exec(` PRAGMA journal_mode = wal; PRAGMA synchronous = normal; PRAGMA optimize = 0x10002; PRAGMA foreign_keys = ON; - `),Promise.resolve(r)}catch(r){return console.error("Error initializing database:",r),Promise.resolve(void 0)}}async close(){let e=await this.db;e&&(await this.documentTable.init,await this.symbolTable.init,e.close())}async querySymbolsFuzzilyUsingUnqualifiedName(e,r){return await this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${ua.UnqualifiedName} BETWEEN ? AND (? || '~')`,`ORDER BY ${ua.UnqualifiedName}`,"LIMIT ?"].join(` -`),[e,e,r])}async querySymbolsUsingUnqualifiedNames(e,r){let n=e.map(()=>"?").join(", "),o=r?"COLLATE NOCASE ":"";return await this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${ua.UnqualifiedName} ${o}IN (${n})`].join(` -`),e)}async querySymbolsUsingFullyQualifiedName(e){return this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${ua.FullyQualifiedName} = ?`].join(` -`),[e])}async querySymbolsContainingPosition(e,r){return this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${b3.tableName}.${DS.FilePath} = ? AND ${$h.tableName}.${ua.ExtentStart} <= ? AND (${$h.tableName}.${ua.ExtentStart} + ${$h.tableName}.${ua.ExtentLength}) >= ?`].join(` -`),[e,r,r])}async querySymbolsContainedByRange(e,r,n){return this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${b3.tableName}.${DS.FilePath} = ? AND ${$h.tableName}.${ua.ExtentStart} >= ? AND (${$h.tableName}.${ua.ExtentStart} + ${$h.tableName}.${ua.ExtentLength}) <= ?`,`ORDER BY ${$h.tableName}.${ua.ExtentStart}`].join(` -`),[e,r,n])}async querySymbolsByQualifiedNamePrefix(e,r){return this.query([`SELECT * FROM ${$h.tableName}`,this.innerJoinStatement,`WHERE ${b3.tableName}.${DS.FilePath} = ? AND ${$h.tableName}.${ua.FullyQualifiedName} LIKE ?`,`ORDER BY ${$h.tableName}.${ua.ExtentStart}`].join(` -`),[e,`${r}%`])}async insertSymbols(e){return await this.symbolTable.insert(e,!1)}async insertDocument(e,r,n=!1){return await this.documentTable.insert([{filePath:e,lastWriteTimeUtc:r}],n)}async clearAllSymbolsFromDocument(e){return this.symbolTable.clearAllSymbolsFromDocument(e)}async updateDocumentTimestamp(e,r){return this.documentTable.updateTimestamp(e,r)}async deleteAllDocumentsWithPath(e){return this.documentTable.deleteAllWithPath(e)}async getAllDocuments(){return this.documentTable.getAllRows()}getDocument(e){return this.documentTable.getDocumentByFilePath(e)}async query(e,r){let n=await this.db;return n?(await this.documentTable.init,await this.symbolTable.init,PVe(n,e,r)):[]}};var NVe=class{static{a(this,"SQLStorageReaderWriter")}constructor(e){this.database=new DVe(e)}async close(){await this.database.close()}async insertOrReplaceDocumentSymbolsAsync(e,r,n){let o=await this.getOrCreateDocumentAsync(e,r);await this.database.clearAllSymbolsFromDocument(o.id),n.length>0&&await this.database.insertSymbols(n.map(s=>({documentId:o.id,fullyQualifiedName:s.fullyQualifiedName,unqualifiedName:s.unqualifiedName,commentStart:s.commentRange.start,commentLength:s.commentRange.length,nameStart:s.nameRange.start,nameLength:s.nameRange.length,bodyStart:s.bodyRange.start,bodyLength:s.bodyRange.length,extentStart:s.extentRange.start,extentLength:s.extentRange.length,symbolKind:s.kind,refKind:s.refKind}))),await this.database.updateDocumentTimestamp(e,r)}async addDocumentsAsync(e){for(let r of e)r=r.toLowerCase(),await this.database.insertDocument(r,Date.now(),!0)}async deleteDocumentAsync(e){return await this.database.deleteAllDocumentsWithPath(e.toLowerCase())}async updateDocumentTimestampAsync(e,r){return await this.database.updateDocumentTimestamp(e.toLowerCase(),r)}async fuzzyMatchSymbolsAsync(e,r){return _le(await this.database.querySymbolsFuzzilyUsingUnqualifiedName(e,r))}async findPotentialDefinitionsAsync(e,r,n){let o=[],c=0;for(;cnew Bx(e.filePath,e.fullyQualifiedName,e.unqualifiedName,new hu(e.commentStart,e.commentLength),new hu(e.nameStart,e.nameLength),new hu(e.bodyStart,e.bodyLength),new hu(e.extentStart,e.extentLength),e.symbolKind,e.refKind))}a(_le,"symbolsToSymbolRanges");var OVe=de(require("fs/promises"));var MVe=class{static{a(this,"Index")}constructor(e,r,n,o){this.storage=new NVe(e),this.symbolExtractors=r,this.importExtractors=n,this.params=o}dispose(){return this.storage.close()}get reader(){return this.storage}async indexFile(e,r){let n=rs(e);if(!n)throw Error(`Cannot resolve a readable file path from ${e}`);let o;try{o=await OVe.stat(n)}catch{await this.storage.deleteDocumentAsync(e);return}let s=o.mtimeMs,c=await this.storage.getDocumentAsync(e);if(c&&c.lastWriteTimeUtc>=s)return;let l=this.symbolExtractors.get(r);if(!l)return;let u=(await OVe.readFile(n)).toString(),d=await l.extractSymbols(e,u),f=d;if(this.params?.mlcpEnableImports){let h=this.importExtractors.get(r);if(h){let m=await h.extractSymbols(e,u);f=[...d,...m]}}await this.storage.insertOrReplaceDocumentSymbolsAsync(e,s,f)}async getDocumentFilePaths(){return(await this.storage.getDocumentsAsync()).map(r=>r.filePath)}};p();function a6t(t){let e=t;return typeof e?.cwd=="string"&&Array.isArray(e?.indexWorkspaceRoots)&&e.indexWorkspaceRoots.every(r=>IBo(r))}a(a6t,"isIndexWorkerData");var gIe=class{static{a(this,"IndexNotification")}constructor(e){this.operation=e}},CQ=class extends gIe{constructor(r,n){super(n);this.id=r;this.id=r}static{a(this,"IndexRequest")}},LVe=class extends gIe{constructor(r){super(nE.Cancel);this.messageIdToCancel=r}static{a(this,"CancellationNotification")}},nE={CreateIndex:"createIndex",AddOrInvalidated:"addOrInvalidated",GetContext:"getContext",Exit:"exit",Response:"response",RemoveIndex:"removeIndex",Cancel:"cancel",GetAllDocumentsInWorkspace:"getAllDocumentsInWorkspace"},BVe=class extends CQ{constructor(r,n,o){super(r,nE.CreateIndex);this.baseWorkspaceFolderUri=n;this.databaseFilePath=o}static{a(this,"CreateIndexRequest")}},FVe=class extends CQ{constructor(r,n){super(r,nE.RemoveIndex);this.baseWorkspaceFolderUri=n}static{a(this,"RemoveIndexRequest")}},UVe=class extends CQ{constructor(r,n,o){super(r,nE.AddOrInvalidated);this.fileUri=n;this.languageId=o}static{a(this,"AddOrInvalidatedRequest")}},QVe=class extends CQ{constructor(r,n){super(r,nE.GetAllDocumentsInWorkspace);this.baseWorkspaceFolderUri=n}static{a(this,"GetAllDocumentsRequest")}},qVe=class extends CQ{constructor(r,n,o,s,c,l){super(r,nE.GetContext);this.fileUri=n;this.code=o;this.offset=s;this.languageId=c;this.params=l}static{a(this,"GetContextRequest")}},jVe=class extends CQ{static{a(this,"ExitRequest")}constructor(e){super(e,nE.Exit)}},wP=class extends gIe{constructor(r,n,o){super(nE.Response);this.id=r;this.error=n;this.data=o;n&&"code"in n&&typeof n.code=="string"&&(this.code=n.code)}static{a(this,"ResponseMessage")}};function IBo(t){return"databaseFilePath"in t&&"rootPath"in t}a(IBo,"isIndexableWorkspaceFolder");var Sfn=de(ri()),bQ=require("worker_threads");var HVe=class{static{a(this,"IndexInfo")}constructor(e,r){this.index=new MVe(e,ufn,dfn,r),this.contextRetreival=new xVe(this.index.reader,lfn)}},c6t=class t{constructor(e,r,n){this.indices=new Map;this.cancellationTokens=new Map;this.params=n;for(let o of r){let s=un(o.rootPath);this.indices.set(s,new HVe(o.databaseFilePath,n))}this.port=e,this.port.on("message",o=>{o&&typeof o=="object"&&o.__perf__&&this.port?.postMessage({__perf__:!0,memoryUsage:process.memoryUsage()})}),this.port.on("message",o=>{this.dispatchMessage(o,this.indices,this.cancellationTokens)})}static{a(this,"IndexWorker")}async dispatchMessage(e,r,n){if(!e.__perf__)try{let o=new Sfn.CancellationTokenSource;n.set(e.id,o);let s;switch(e.operation){case nE.AddOrInvalidated:s=await t.dispatchAddOrInvalidate(e,r,o.token);break;case nE.GetContext:s=await t.dispatchGetContext(e,r,o.token);break;case nE.Cancel:n.get(e.id)?.cancel(),s=new wP(e.id,void 0,void 0);break;case nE.Exit:s=await this.dispatchExit(e,r,o.token);break;case nE.CreateIndex:s=t.dispatchCreateIndex(e,r,o.token);break;case nE.RemoveIndex:s=await t.dispatchRemoveIndex(e,r,o.token);break;case nE.GetAllDocumentsInWorkspace:s=await t.GetAllDocumentsInWorkspaceRequest(e,r,o.token);break;default:this.port?.postMessage(new Error(`Unknown operation: ${e.operation}`))}s&&this.port?.postMessage(s),n.get(e.id)?.dispose(),n.delete(e.id)}catch(o){if(!(o instanceof Error))throw o;this.port?.postMessage(new wP(e.id,o,void 0))}}static async GetAllDocumentsInWorkspaceRequest(e,r,n){let o=un(e.baseWorkspaceFolderUri),s,c;return r.has(o)?c=await r.get(o).index.getDocumentFilePaths():s=new Error(`Index not found for ${e.baseWorkspaceFolderUri}`),new wP(e.id,s,c)}static async dispatchAddOrInvalidate(e,r,n){let o=un(e.fileUri),s=t.getIndexInfo(o,r)?.index,c;return s?await s.indexFile(e.fileUri,e.languageId):c=new Error(`Index not found for ${e.fileUri}`),new wP(e.id,c,void 0)}static async dispatchGetContext(e,r,n){let o=un(e.fileUri),s=t.getIndexInfo(o,r)?.contextRetreival,c,l;return s?l=await s.getStringifiedContextAtPositionAsync(e.fileUri,e.code,e.offset,e.languageId,e.params,8e3,n):c=new Error(`ContextRetrieval not found for ${e.fileUri}`),new wP(e.id,c,l)}async dispatchExit(e,r,n){for(let o of r.values())await o.index.dispose();r.clear(),this.port?.postMessage(new wP(e.id,void 0,void 0)),this.port?.close()}static dispatchCreateIndex(e,r,n){let o=un(e.baseWorkspaceFolderUri);return r.has(o)||r.set(o,new HVe(e.databaseFilePath)),new wP(e.id,void 0,void 0)}static async dispatchRemoveIndex(e,r,n){let o=un(e.baseWorkspaceFolderUri);if(r.has(o)){let s=r.get(o);s&&await s.index.dispose(),r.delete(o)}return new wP(e.id,void 0,void 0)}static getIndexInfo(e,r){for(let[n,o]of r)if(e.startsWith(n))return o}};function Tfn(){return a6t(bQ.workerData)}a(Tfn,"isIndexWorker");function Ifn(){let t=bQ.parentPort;if(!t)throw new Error("This must be run a worker thread.");if(!a6t(bQ.workerData))throw new Error("Worker data must provide a valid database path.");let e=bQ.workerData.cwd;process.cwd=()=>e,new c6t(t,bQ.workerData.indexWorkspaceRoots,bQ.workerData.params)}a(Ifn,"runIndexWorker");p();p();var AIe=require("fs"),xfn=require("path");var SQ=class extends Qo{static{a(this,"LocalFileSystem")}async readFileString(e,r="utf8"){return await AIe.promises.readFile(un(e),r)}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink(un(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=un(e),n=await AIe.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,xfn.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await AIe.promises.lstat(e);if(r.isSymbolicLink())try{let n=await AIe.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=0;return e.isFile()&&(o=1),e.isDirectory()&&(o=2),r.isSymbolicLink()&&n&&(o|=64),o}};p();async function xBo(t){if(t.isCancellationRequested)return;let e=new vA,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(xBo,"cancellationTokenToPromise");async function wfn(t,e){if(e){let r=xBo(e);await Promise.race([t,r])}else await t}a(wfn,"raceCancellation");function l6t(t){return Array.isArray(t)}a(l6t,"isArrayOfT");async function Rfn(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await u6t(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(Rfn,"resolveAll");async function u6t(t,e){let r;return t instanceof Promise?r=await wBo(t,e):r=await RBo(t,e),r}a(u6t,"resolve");async function wBo(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{let s=await t;if(e?.isCancellationRequested)return;n={status:"full",resolutionTime:0,value:l6t(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await wfn(o,e),n.resolutionTime=performance.now()-r,n}a(wBo,"resolvePromise");async function RBo(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{for await(let s of t){if(e?.isCancellationRequested)return;n.status!="partial"&&(n={status:"partial",resolutionTime:0,value:[]}),n.value.push(s)}e?.isCancellationRequested||(n.status!=="partial"?n={status:"full",resolutionTime:0,value:[]}:n.status="full")}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await wfn(o,e),n.resolutionTime=performance.now()-r,n}a(RBo,"resolveIterable");p();p();var GVe="[...]",kBo=0,PC=-1;function Ef(){return kBo++}a(Ef,"getAvailableNodeId");function PBo(t,e){let r=t.children.map(n=>n.elisionMarker??e);return[...t.text.entries()].map(([n,o])=>n===0?o:r[n-1]+o).join("")}a(PBo,"elideChildren");function kfn(t,e=GVe){return r=>t.tokenLength(PBo(r,e))}a(kfn,"getTokenizerCostFunction");p();var IQ=class{static{a(this,"PriorityQueue")}constructor(e){if(this.heap=e?[...e]:[],this.heap.length>0)for(let r=Math.floor(this.heap.length/2)-1;r>=0;r--)this.siftDown(r)}get size(){return this.heap.length}insert(e,r){let n={item:e,priority:r};this.heap.push(n);let o=this.heap.length-1;this.siftUp(o)}peek(){return this.heap.length===0?null:this.heap[0]}pop(){if(this.heap.length===0)return null;let e=this.heap[0],r=this.heap.pop();return this.heap.length>0&&(this.heap[0]=r,this.siftDown(0)),e}clear(){let e=this.heap;return this.heap=[],e}siftUp(e){let r=this.heap[e];for(;e>0;){let n=Math.floor((e-1)/2);if(this.heap[n].priority>=r.priority)break;this.heap[e]=this.heap[n],e=n}this.heap[e]=r}siftDown(e){for(;ethis.heap[r].priority&&(r=n),othis.heap[r].priority&&(r=o),r===e)break;let s=this.heap[e];this.heap[e]=this.heap[r],this.heap[r]=s,e=r}}};function DBo(t){let e={id:t.id??Ef(),text:t.text??new Array((t.children?.length??0)+1).fill(""),children:t.children??[],cost:t.cost??1,weight:t.weight??0,rectifiedWeight:t.rectifiedWeight,canMerge:t.canMerge??!1,elisionMarker:t.elisionMarker??GVe,requireRenderedChild:t.requireRenderedChild??!1};if(e.text.length!==e.children.length+1)throw new Error(`RenderNode text length (${e.text.length}) must be children length + 1 (${e.children.length+1})`);return e}a(DBo,"createRenderNode");function NBo(t){return t.requireRenderedChild||(t.rectifiedWeight??t.weight)>t.weight}a(NBo,"isRenderedChildRequired");function Pfn(t){return(t.rectifiedWeight??t.weight)/Math.max(t.cost,1)}a(Pfn,"rectifiedValue");function yIe(t,e){let r=Dfn(t,e);for(let{item:n,priority:o}of r.clear())for(let s of n.nodes)s.rectifiedWeight=o*Math.max(s.cost,1)}a(yIe,"rectifyWeights");function Dfn(t,e){let r=t.children.map(s=>Dfn(s,e));if(t.weight=Math.max(0,e?e(t):t.weight),t.weight===0&&r.reduce((s,c)=>s+c.size,0)===0)return new IQ([]);let n=new IQ(r.flatMap(s=>s.clear())),o={nodes:[t],totalCost:t.cost,totalWeight:t.weight};for(;(n.peek()?.priority??0)>o.totalWeight/Math.max(o.totalCost,1);){let{item:s}=n.pop();o.nodes.push(...s.nodes),o.totalCost+=s.totalCost,o.totalWeight+=s.totalWeight}return n.insert(o,o.totalWeight/Math.max(o.totalCost,1)),n}a(Dfn,"recursivelyRectifyWeights");function Nfn(t,e={}){let{budget:r,mask:n,costFunction:o}=e,s=n??[],c=new Set(Array.isArray(s)?s:[s]);if((r??t.cost)c.has(E.id),"elider"),m=[],g=new Map;if(f6t(t,m,h,g),m.length===0)return d6t(t,o);let A=m.join(""),y=o?o(A):[...g.values()].reduce((E,_)=>E+_.cost,0);return{text:A,cost:y,renderedNodes:g}}let l=new Map,u=[],d=new IQ([{item:t,priority:Pfn(t)}]),f=r;for(;f>0&&d.size>0;){let{item:h}=d.pop();if(!c.has(h.id)&&h.cost<=f){f-=h.cost,l.set(h.id,h),u.push(h);for(let m of h.children)d.insert(m,Pfn(m))}}for(;l.size>0;){let h=[],m=a(E=>!l.has(E.id),"elider"),g=new Map;if(f6t(t,h,m,g),h.length===0)return d6t(t,o);let A=h.join("");if(o===void 0){let E=[...g.values()].reduce((_,v)=>_+v.cost,0);return{text:A,cost:E,renderedNodes:g}}let y=o(A);if(y<=r)return{text:A,cost:y,renderedNodes:g};for(l=g;u.length>0&&y>r;){let E=u.pop();l.has(E.id)&&(y-=E.cost,l.delete(E.id))}if(u.length===0)break}return d6t(t,o)}a(Nfn,"render");function d6t(t,e){return{text:t.elisionMarker,cost:e?e(t.elisionMarker):t.elisionMarker.length,renderedNodes:new Map}}a(d6t,"renderEmpty");function f6t(t,e,r,n,o=!1){let s=e.length;if(r(t))return s>=2&&(o||e[s-2]===t.elisionMarker&&e[s-1].trim().length===0)?(e.pop(),!1):(e.push(t.elisionMarker),!1);let c=NBo(t),l=!0;for(let[u,d]of t.children.entries())e.push(t.text[u]??""),l=f6t(d,e,r,n,d.canMerge&&!l),c&&=!l;if(c){for(;e.length>s;)e.pop();return!1}return e.push(t.text[t.text.length-1]??""),n.set(t.id,t),!0}a(f6t,"recursivelyRender");function EIe(t,e,r=GVe){let n=t.children.map(c=>EIe(c,e,r));r=t.elisionMarker??r;let o=e(t);return DBo({...t,children:n,cost:o,weight:0,elisionMarker:t.elisionMarker??r})}a(EIe,"snapshot");var xQ={id:Ef(),text:[""],children:[],cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};p();p();var RP=class{constructor(){this.disposables=[]}static{a(this,"WorkspaceContextProvider")}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};var VVe={MaxDirectorySize:200,MaxResults:100,Decay:.5,CacheSize:2e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:2*1024*1024};async function MBo(t,e,r=VVe,n){let o=n?.get(e);if(o!==void 0)return o;let s;try{s=await t.readDirectory(e)}catch{}if(s===void 0||r.MaxDirectorySize!==void 0&&s.length>r.MaxDirectorySize)return n?.set(e,"Invalid",r.InvalidCacheTime),"Invalid";let c={documents:[],directories:[]};for(let[l,u]of s){let d=wa(e,l);u&2?c.directories.push(d):c.documents.push(d)}return n?.set(e,c),c}a(MBo,"getDirectoryChildren");function OBo(t,e){let r=t.getWorkspaceFolder({uri:e});if(r===void 0)return[];let n=[],o=uf(e);for(;o.startsWith(r);){n.push(o);let s=uf(o);if(s.length>=o.length)break;o=s}return n}a(OBo,"getAncestors");function LBo(t,e,r=VVe.Decay){let n=new Map,o=new Map,s=new Map,c=new Map;for(let l of e){let u=OBo(t,l.uri);if(u.length===0){n.set(l.uri,new Set);continue}let d;for(let f of u){if(d!==void 0){let h=o.get(f)??new Set;h.add(d),o.set(f,h)}d=f}s.set(l.uri,d),n.set(l.uri,new Set(u))}for(let l of e){let u=[],d=n.get(l.uri);if(!(!d||d.size===0))for(u.push({uri:s.get(l.uri),weight:l.weight*Math.pow(r,d.size)});u.length>0;){let f=u.pop();c.set(f.uri,(c.get(f.uri)??0)+f.weight);let h=o.get(f.uri)??new Set;for(let m of h){let g=f.weight;d.has(m)?g/=r:g*=r,u.push({uri:m,weight:g})}}}return c}a(LBo,"getAncestorWeights");async function*p6t(t,e,r,n,o,s){let c={...VVe,...r},l=c.MaxResults,u=c.Decay,d=LBo(t,e,u),f=new IQ([...d.entries()].map(([m,g])=>({item:m,priority:g}))),h=0;for(;f.size>0;){let{item:m,priority:g}=f.pop(),A=await MBo(t,m,c,n);if(s?.isCancellationRequested)return;if(A!=="Invalid"){for(let y of A.documents)if(!o||o(y)){try{if((await t.stat(y)).size>c.MaxFileBytes)continue}catch{continue}if(yield{uri:y,weight:g},h++,h>=l)return}for(let y of A.directories)d.has(y)||(f.insert(y,g*u),d.set(y,g*u))}}}a(p6t,"getNearbyDocuments");var $Ve=class extends RP{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=VVe;this.cache=new Pk(this.config.CacheSize,this.config.CacheTime)}static{a(this,"FileDirectoryDocumentProvider")}async*getContext(r,n,o,s){for await(let c of p6t(this.fileSystem,n.documents,this.config,this.cache,l=>this.documentManager.normalizeUri(l)!==void 0,s))yield{...c,source:"FileDirectoryDocumentProvider"}}};p();p();p();function o0(t,e,r){let n=t.get(e);return n===void 0&&(n=r(e),t.set(e,n)),n}a(o0,"setDefault");var BBo={MaxActiveSymbols:500,SymbolCacheSize:1e6},WVe=class extends RP{constructor(){super(...arguments);this.config=BBo;this.nodeToSymbol=new Map;this.nodeValency=new Map;this.symbolToNode=new Map;this.symbolValency=new Map;this.identifierSymbols=new Set;this.identifiers=new Cn(this.config.SymbolCacheSize);this.textSymbols=new Cn(this.config.SymbolCacheSize);this.nextSymbolId=0}static{a(this,"SymbolContextProvider")}getContext(r,n,o,s){this.updateSymbolIndex(r,o);let c=this.getWeightedSymbols(n);return Promise.resolve(this.getWeightedNodes(c))}updateSymbolIndex(r,n){for(let{id:o}of r.getInvalidatedNodes()){let s=this.nodeToSymbol.get(o);if(this.nodeToSymbol.delete(o),this.nodeValency.delete(o),s)for(let[c,l]of s.entries()){let u=this.symbolToNode.get(c);u?.delete(o),u?.size===0?(this.symbolToNode.delete(c),this.symbolValency.delete(c),this.identifierSymbols.delete(c)):this.symbolValency.has(c)&&this.symbolValency.set(c,Math.max(1,(this.symbolValency.get(c)??0)-l))}}for(let{id:o}of r.getCreatedNodes()){let s=n.getNode(o);s!==void 0&&this.extractSymbols(s.document,s.node)}}getWeightedSymbols(r){let n=new Map;for(let{id:s,weight:c}of r.nodes){let l=this.nodeValency.get(s)??0,u=[],d=0;for(let[f,h]of this.nodeToSymbol.get(s)??[]){let m=this.symbolValency.get(f);if((m??0)<1)continue;let g=h/(Math.max(l,1)*Math.max(1,m));u.push({symbolId:f,nodeSymbolWeight:g}),d+=g}d=Math.max(d,1);for(let{symbolId:f,nodeSymbolWeight:h}of u)n.set(f,(n.get(f)??0)+c*h/d)}return[...n.entries()].map(([s,c])=>({symbolId:s,symbolWeight:c,symbolValency:this.symbolValency.get(s)})).filter(({symbolValency:s})=>(s??0)>0).sort((s,c)=>c.symbolWeight/c.symbolValency-s.symbolWeight/s.symbolValency).slice(0,this.config.MaxActiveSymbols)}getWeightedNodes(r){let n=[];for(let{symbolId:o,symbolWeight:s,symbolValency:c}of r){let l=this.identifierSymbols.has(o)?"SymbolContextProvider.Identifiers":"SymbolContextProvider.Text";for(let[u,d]of this.symbolToNode.get(o)??[]){let f=s*d/Math.max(c,this.nodeValency.get(u)??d);n.push({id:u,weight:f,source:l})}}return n}extractSymbols(r,n){if(this.nodeToSymbol.has(n.id))return;let o=new Map;this.nodeToSymbol.set(n.id,o);let s=0;for(let c of n.syntaxNodes()){let l=r.document.getText(c.range);if(this.isIdentifier(r,c,l)){let u=o0(this.identifiers,l,()=>this.createSymbol(!0));o.set(u,(o.get(u)??0)+1),s+=1}if(this.isText(r,c,l)||this.isIdentifier(r,c,l))for(let u of h6t(l)){let d=o0(this.textSymbols,u,()=>this.createSymbol());o.set(d,(o.get(d)??0)+1),s+=1}}this.nodeValency.set(n.id,s);for(let[c,l]of o.entries())o0(this.symbolToNode,c,()=>new Map).set(n.id,l),this.symbolValency.set(c,(this.symbolValency.get(c)??0)+l)}createSymbol(r=!1){let n=this.nextSymbolId++;return r&&this.identifierSymbols.add(n),n}isText(r,n,o){return r.parser.labeler.isText?.(n)??(n.children.length===0&&o.search(/\s/)>=0)}isIdentifier(r,n,o){return r.parser.labeler.isIdentifier?.(n)??(n.children.length===0&&Mfn(o))}},FBo=/^[a-zA-Z_]{2,}\w+$/;function Mfn(t){return FBo.test(t)}a(Mfn,"isSymbol");function UBo(t){return t.toLowerCase()}a(UBo,"normalizeWord");function*h6t(t){for(let e of t.split(/\W/))Mfn(e)&&(yield UBo(e))}a(h6t,"getTextSymbols");var QBo={MaxDirectorySize:50,MaxResults:50,Decay:.5,CacheSize:1e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:1*1024*1024,MaxActiveSymbols:500,DebouncedRemovalThreshold:3,UpdateDebounceTimeout:500,SymbolCacheSize:1e5},zVe=class extends WVe{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=QBo;this.symbolToDocuments=new Map;this.documentToSymbols=new Map;this.documentValency=new Map;this.cache=new Pk(this.config.CacheSize,this.config.CacheTime);this.debouncedExpirationCount=new Map;this.updateDebounce=new Map;this.currentlyUpdating=new Set;this.isUpdatingIndex=!1;this.fileSystem.onDidFileChange(o=>{let s=o.document.uri;this.documentToSymbols.has(s)&&this.debouncedReadOrUpdateDocument(s)})}static{a(this,"IndexingSymbolContextProvider")}async getContext(r,n,o,s){super.updateSymbolIndex(r,o),await this.updateDocumentIndex(n);let c=super.getWeightedSymbols(n),l=super.getWeightedNodes(c),u=this.getWeightedDocuments(c);return[...l,...u]}getWeightedDocuments(r){let n=[];for(let{symbolId:o,symbolWeight:s}of r)for(let[c,l]of this.symbolToDocuments.get(o)??[]){let u=l/Math.max(1,this.documentValency.get(c)??1),d=Math.log(Math.max(this.documentToSymbols.size,1)/Math.max(1,this.symbolToDocuments.get(o)?.size??1)),f=s*u*d;n.push({source:"IndexingSymbolContextProvider.Text",uri:c,weight:f})}return n}debouncedReadOrUpdateDocument(r){this.updateDebounce.has(r)&&clearTimeout(this.updateDebounce.get(r)),this.updateDebounce.set(r,setTimeout(()=>{this.updateDebounce.delete(r),this.readOrUpdateDocument(r)},this.config.UpdateDebounceTimeout))}async readOrUpdateDocument(r){try{if(this.currentlyUpdating.has(r))return;if(this.documentManager.normalizeUri(r)===void 0){this.removeFromIndex(r);return}this.currentlyUpdating.add(r);let n=await this.fileSystem.readFileString({uri:r}),o=new Map,s=0;for(let l of h6t(n))o.set(l,(o.get(l)??0)+1),s++;let c=[];for(let[l,u]of o.entries()){let d=o0(this.textSymbols,l,()=>this.createSymbol(!1));o0(this.symbolToDocuments,d,()=>new Map).set(r,u),c.push(d)}this.documentValency.set(r,s),this.documentToSymbols.set(r,c)}catch{this.removeFromIndex(r)}finally{this.currentlyUpdating.delete(r)}}async updateDocumentIndex(r){if(!this.isUpdatingIndex){this.isUpdatingIndex=!0;try{for(let s of this.documentToSymbols.keys())this.debouncedExpirationCount.set(s,(this.debouncedExpirationCount.get(s)??0)+1);let n=a(s=>this.documentManager.normalizeUri(s)!==void 0,"filter");for await(let{uri:s}of p6t(this.fileSystem,r.documents,this.config,this.cache,n))this.documentToSymbols.has(s)||await this.readOrUpdateDocument(s),this.debouncedExpirationCount.delete(s);let o=[...this.debouncedExpirationCount.entries()].filter(([s,c])=>c>=this.config.DebouncedRemovalThreshold&&!this.currentlyUpdating.has(s)&&!this.updateDebounce.has(s));for(let[s]of o)this.removeFromIndex(s),this.debouncedExpirationCount.delete(s)}finally{this.isUpdatingIndex=!1}}}removeFromIndex(r){this.documentValency.delete(r);for(let n of this.documentToSymbols.get(r)??[]){let o=this.symbolToDocuments.get(n);o?.delete(r),o?.size===0&&this.symbolToDocuments.delete(n)}this.documentToSymbols.delete(r)}};p();function Ofn(t){return t.nodeId!==void 0}a(Ofn,"isNodeLocation");var Lfn={"RecentDocumentProvider.RecentlyFocused":{maxEventCount:100,halflife:1e3*60*5,isImpulse:!1},"RecentDocumentProvider.RecentlyEdited":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!0},"RecentDocumentProvider.RecentlyOpen":{maxEventCount:100,halflife:1e3*60*5,isImpulse:!1},RecentCompletionsRequestProvider:{maxEventCount:100,halflife:1e3*60*5,isImpulse:!0},"ExtensionActivityProvider.CurrentSelection":{maxEventCount:1,halflife:1e5,isImpulse:!0},"ExtensionActivityProvider.PrimarySelection":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1},"ExtensionActivityProvider.Selection":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1},"ExtensionActivityProvider.VisibleRange":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1}},YVe=class extends RP{constructor(){super(...arguments);this.eventsByType=new Map;this.nextId=0}static{a(this,"RecentActivityProvider")}getContext(r,n,o,s){let c=performance.now(),l=[];for(let[u,d]of this.eventsByType.entries()){let f=Lfn[u],h=[...d.values()].sort((g,A)=>A.timestamp-g.timestamp),m=1;for(let g of h){this.resolveRanges(g,o);let A=.5**((c-g.timestamp)/f.halflife),y=f.isImpulse?A:m-A;m=A;for(let E of g.locations)Ofn(E)?l.push({weight:y,uri:E.uri,id:E.nodeId,source:u}):l.push({weight:y,uri:E.uri,source:u})}}return Promise.resolve(l)}resolveRanges(r,n){if(r.isFullyResolved)return;let o=!0,s=[];for(let c of r.locations)if(Ofn(c))s.push(c);else if(c.range&&c.range.start!==void 0&&c.range.end!==void 0){let l=n.getDocument(c.uri)?.document;if(l!==void 0){let u=l.findNode(l.document.offsetAt(c.range.start),l.document.offsetAt(c.range.end));s.push({uri:c.uri,nodeId:u.id})}else o=!1,s.push(c)}else s.push({uri:c.uri,nodeId:PC});r.locations=s,r.isFullyResolved=o}recordEvent(r,n,o){let s=Lfn[r];if(s===void 0)return;let c={timestamp:o,locations:n,isFullyResolved:!1};o0(this.eventsByType,r,()=>new Cn(s.maxEventCount)).set(++this.nextId,c)}};p();var KVe=class extends RP{constructor(){super(...arguments);this.nodeParent=new Map;this.nodeChildren=new Map}static{a(this,"TreeProximityProvider")}getContext(r,n,o,s){this.updateIndex(r,o,s);let c=new Map,l=new Map,u=new Map;for(let{id:f,weight:h}of n.nodes){let m=this.nodeParent.get(f)??PC,g=this.nodeChildren.get(m)?.size??0;g>0&&c.set(m,(c.get(m)??0)+h/g);let A=this.nodeChildren.get(f);if(A&&A.size>0)for(let E of A)l.set(E,(l.get(E)??0)+h/A.size);let y=this.nodeChildren.get(m);if(y&&y.size>1)for(let E of y)E!==f&&u.set(E,(u.get(E)??0)+h/y.size)}let d=[...[...c.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Parent"})),...[...l.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Children"})),...[...u.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Siblings"}))];return Promise.resolve(d)}updateIndex(r,n,o){for(let{id:s}of r.getInvalidatedNodes())this.nodeParent.delete(s),this.nodeChildren.delete(s);for(let{id:s}of r.getCreatedNodes()){let c=n.getNode(s),l=new Set;if(c!==void 0)for(let u of c.node.children)this.nodeParent.set(u.id,s),l.add(u.id);l.size>0&&this.nodeChildren.set(s,l)}}};p();function qBo(t){return t.id!==void 0}a(qBo,"isNodeItem");function jBo(t){return!("uri"in t)&&!("id"in t)}a(jBo,"isNullItem");var Bfn={"RecentDocumentProvider.RecentlyOpen":.1,"RecentDocumentProvider.RecentlyFocused":.1,"RecentDocumentProvider.RecentlyEdited":.1,RecentCompletionsRequestProvider:1,"ExtensionActivityProvider.CurrentSelection":5,"ExtensionActivityProvider.PrimarySelection":2,"ExtensionActivityProvider.Selection":.2,"ExtensionActivityProvider.VisibleRange":1,FileDirectoryDocumentProvider:.05,"SymbolContextProvider.Identifiers":.2,"SymbolContextProvider.Text":.2,"IndexingSymbolContextProvider.Text":1,"TreeProximityProvider.Parent":.3,"TreeProximityProvider.Children":.3,"TreeProximityProvider.Siblings":.3,"ExtensionReferenceProvider.References":.2,"ExtensionReferenceProvider.Definitions":1};function Ffn(t){return t in Bfn}a(Ffn,"isSourceId");var wQ="64f5ff7d-e507-4558-81cf-3bdacc3c5c00",vle=class{static{a(this,"WorkspaceContextWeights")}constructor(e){let r=new Map;for(let{uri:n,weight:o}of e)r.set(n,(r.get(n)??0)+o);this.documents=[...r.entries()].map(([n,o])=>({uri:n,weight:o})).sort((n,o)=>o.weight-n.weight),this.docWeights=r,this.nodes=e.filter(({id:n})=>n!==PC),this.nodeWeights=new Map(e.map(({id:n,weight:o})=>[n,o]))}getNodeWeight(e){return this.nodeWeights.get(e)??0}getDocumentWeight(e){return this.docWeights.get(e)??0}},JVe=class{constructor(e,r){this.activeContext=e;this.config=r;this.sourceWeights=Bfn;this.sourceContext=new Map;this.prevUpdateTime=void 0;this.prevItems=[];this.weights=new vle([])}static{a(this,"WorkspaceContextCoordinator")}getWeights(e){if(e){let r=this.sourceContext.get(e);return r?new vle(r.items):new vle([])}return this.weights}updateWeights(){let e=new Map,r=0,n=this.config.StaleWeightHalflife;for(let[o,{items:s,updateTime:c}]of this.sourceContext.entries()){let l=this.sourceWeights[o]??0;if(l<=0||s.length===0)continue;let u=.5**(-Math.max(0,(this.prevUpdateTime??c)-c)/n);l*=u,r+=l,this.aggregateWeights(s,e,l,!0)}if(r>0){if(this.weights.nodes.length>0){let o=r*this.config.Laziness,s=this.prevItems;this.aggregateWeights(s,e,o,!0)}for(let[o,s]of e.entries()){let c=this.activeContext.getDocument(o)?.document;if(c===void 0)continue;let l=s.get(PC);if(l!==void 0&&l>0){s.delete(PC);let u=0;for(let d of s.values())u+=d;if(u<=0){let d=c.getAllIds(),f=l/Math.max(d.length,1);for(let h of d)s.set(h,f)}else for(let[d,f]of[...s.entries()])s.set(d,f+l*(f/u))}}this.prevItems=this.truncateAndNormalize(e),this.weights=new vle(this.prevItems)}return this.prevUpdateTime=performance.now(),this.weights}pushWorkspaceContext(e,r){let n=performance.now(),o=this.addUriAndId(r),s=new Map;this.aggregateWeights(o,s);let c=this.truncateAndNormalize(s);this.sourceContext.set(e,{items:c,updateTime:n})}addUriAndId(e){return e.filter(r=>r.weight>0).map(r=>{if(jBo(r))return{weight:r.weight,uri:wQ,id:PC};let n=qBo(r)?r.id:PC,o=r.uri??this.activeContext.getUri(n)??wQ;return o===wQ&&(n=PC),{weight:r.weight,uri:o,id:n}})}aggregateWeights(e,r,n=1,o=!1){for(let{uri:s,id:c,weight:l}of e){if(l<=0||isNaN(l))continue;let u=o0(r,s,()=>new Map),d=PC;(!o||this.activeContext.getUri(c)!==void 0)&&(d=c),u.set(d,(u.get(d)??0)+l*n)}}truncateAndNormalize(e){let r=[],n=new Map,o=0;for(let[u,d]of e.entries()){let f=u!==wQ?this.activeContext.normalizeUri(u)??wQ:wQ;for(let[h,m]of d.entries())u===wQ||h===PC?n.set(f,(n.get(f)??0)+m):r.push({uri:f,id:h,weight:m}),o+=m}if(o<=0)return[];n.delete(wQ),r.sort((u,d)=>d.weight-u.weight);for(let{uri:u,weight:d}of r.slice(this.config.MaxActiveNodes,r.length))n.set(u,(n.get(u)??0)+d);let s=[...n.entries()].sort((u,d)=>d[1]-u[1]).slice(0,this.config.MaxActiveFiles).map(([u,d])=>({uri:u,id:PC,weight:d}));return r.slice(0,this.config.MaxActiveNodes).concat(s).sort((u,d)=>d.weight-u.weight).map(u=>({...u,weight:u.weight/o}))}};p();p();p();var m6t=class{constructor(e,r,n,o=!1){this.id=e;this.parts=r;this.text=n;this.canMerge=o}static{a(this,"ContextNode")}get startOffset(){return this.parts[0].root.startOffset}get endOffset(){return this.parts[this.parts.length-1].root.endOffset}get syntaxRoots(){return this.parts.map(e=>e.root)}get children(){return this.parts.flatMap(e=>e.children)}get syntaxLimits(){return this.children.flatMap(e=>e.syntaxRoots)}*syntaxNodes(){let e=new Set(this.syntaxLimits.map(r=>r.id));for(let r of this.syntaxRoots)yield*Ufn(r,e)}findChild(e,r){if(ethis.endOffset||r=r)break;s.root.endOffset=r)break;c.endOffsets.root.startOffset-c.root.startOffset);let n=GBo(e,this.document),o=new m6t(Ef(),e,n,r);return this.nodeById.set(o.id,o),o}buildTree(){let e=this.buildRecursively(this._syntaxRoot);return this.createNode([{root:this._syntaxRoot,children:e}])}buildRecursively(e){if(e.endOffset-e.startOffset({root:o,children:this.buildRecursively(o)}));if(this.canMergeChildren(e))return this.mergeChildren(r);let n=[];for(let{root:o,children:s}of r){if(this.canBeNode(o)&&o.endOffset-o.startOffset-s.reduce((l,u)=>l+(u.endOffset-u.startOffset),0)>=this.minSize){n.push(this.createNode([{root:o,children:s}]));continue}n.push(...s)}return n}mergeChildren(e){if(e.length===0)return[];e.sort((m,g)=>m.root.startOffset-g.root.startOffset);let r=e[e.length-1].root.endOffset-e[0].root.startOffset,n=[];for(let m of e){let g=m.root.endOffset-m.root.startOffset;for(let A of m.children){let y=A.endOffset-A.startOffset;g-=y,r-=y}n.push(g)}if(rm.children);let o=[0],s=0,c=null,l={line:-1,size:-1},u=e[0].root.startOffset,d=e[0].root.range.start.line;for(let m=0;mthis.minSize&&sl.line||A.line==l.line&&A.size>l.size)&&(l=A,c=m)}u=g.root.endOffset,d=g.root.range.end.line,s>=this.maxSize&&(c=c??m,o.push(c+1),m=c,s=0,c=null,l={line:-1,size:-1},u=e[m+1]?.root.startOffset,d=e[m+1]?.root.range.start.line)}o.length==1?o.push(e.length):o[o.length-1]!==e.length&&(o[o.length-1]=e.length);let f=[],h=!1;for(let m=0;mHBo}canBeNode(e){return this.parser.labeler.canBeNode?.(e)??!0}};function GBo(t,e){if(t.length===0)return[""];let r=[],n=e.positionAt(t[0].root.startOffset);for(let s of t.flatMap(c=>c.children).sort((c,l)=>c.startOffset-l.startOffset)){let c=e.positionAt(s.startOffset);r.push(e.getText({start:n,end:c})),n=e.positionAt(s.endOffset)}let o=e.positionAt(t[t.length-1].root.endOffset);return r.push(e.getText({start:n,end:o})),r}a(GBo,"buildText");function*Ufn(t,e){yield t;for(let r of t.children)e.has(r.id)||(yield*Ufn(r,e))}a(Ufn,"walk");p();p();p();var XVe=class{constructor(e,r,n,o,s,c){this.id=e;this.raw=r;this.children=n;this.source="indentation";this.parent=null;let l={start:{line:o,character:0},end:{line:s,character:c.lineAt(s).text.length}},u=c.getText(l),d=u.search(/\S/);if(d===-1){let m={line:s,character:0};this.startOffset=c.offsetAt(m),this.endOffset=this.startOffset,this.range={start:m,end:m};return}let f=u.search(/\S(?!.*\S)/s),h=c.offsetAt(l.start);this.startOffset=h+d,this.endOffset=h+f+1,this.range={start:c.positionAt(this.startOffset),end:c.positionAt(this.endOffset)}}static{a(this,"IndentationNode")}get type(){return this.raw.type}};function g6t(t,e,r){let n=t.subs.map(u=>({subtree:u,node:g6t(u,e,r)})).filter(u=>u.node!==null).sort((u,d)=>u.node.startOffset-d.node.startOffset),o=[],s=e;for(let u=n.length-1;u>=0;u--){let{subtree:d,node:f}=n[u];if(f.range.end.line>=s){let h=g6t(d,s,r);h!==null&&(o.push(h),s=Math.min(h.range.start.line,s))}else o.push(f),s=Math.min(f.range.start.line,s)}o.sort((u,d)=>u.startOffset-d.startOffset);let c=e,l=0;if(o.length>0&&(c=Math.min(c,o[0].range.start.line),l=Math.max(l,o[o.length-1].range.end.line)),(t.type==="blank"||t.type==="line")&&(c=Math.min(c,t.lineNumber),l=Math.max(l,t.lineNumber),t.type==="blank"&&c===l))return null;if(l=Math.min(l,e-1),c<=l){let u=new XVe(Ef(),t,o,c,l,r);for(let d of o)d.parent=u;return u}return null}a(g6t,"recursivelyBuildNode");function Qfn(t){let e=jY(t.getText(),t.detectedLanguageId);return g6t(e,t.lineCount,t)??new XVe(Ef(),e,[],0,t.lineCount-1,t)}a(Qfn,"parse");var eWe={source:"indentation",parse:Qfn,update(t,e){return{root:Qfn(e),remapper:a(()=>{},"remapper")}},dispose:a(()=>{},"dispose"),labeler:{isIdentifier:a(t=>!1,"isIdentifier"),isText:a(t=>!0,"isText")}};p();p();var jfn=de(ale());function qfn(t){return{line:t.row,character:t.column}}a(qfn,"asPosition");var iO=class{constructor(e,r,n,o){this.nodeList=e;this.mergeList=r;this.identifierList=n;this.textList=o}static{a(this,"BasicNodeLabeler")}canBeNode(e){return this.nodeList.has(e.type)}canMergeChildren(e){return this.mergeList.has(e.type)}isIdentifier(e){return this.identifierList.has(e.type)}isText(e){return this.textList.has(e.type)}},RQ=class{constructor(e,r,n={}){this.language=e;this.source=r;this.labeler=n}static{a(this,"TreeSitterParser")}dispose(){}parse(e){let r,n;try{return r=new jfn.default,r.setLanguage(this.language),n=r.parse(e.getText()),this.snapshot(n.rootNode,null)}catch{return eWe.parse(e)}finally{n?.delete(),r?.delete()}}update(e,r){return{root:this.parse(r),remapper:a(()=>{},"remapper")}}snapshot(e,r){let n={id:e.id,source:this.source,type:e.type,startOffset:e.startIndex,endOffset:e.endIndex,range:{start:qfn(e.startPosition),end:qfn(e.endPosition)},parent:r,children:[]};return n.children=e.namedChildren.map(o=>this.snapshot(o,n)),n}};var $Bo=new Set(["class_specifier","function_definition","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement","compound_statement"]),VBo=new Set(["translation_unit","compound_statement","parameter_list","argument_list"]),WBo=new Set(["identifier"]),zBo=new Set(["string","comment"]),Hfn=new iO($Bo,VBo,WBo,zBo);p();var YBo=new Set(["class_declaration","method_declaration","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement"]),KBo=new Set(["program","block","object_creation_expression","formal_parameters","argument_list","array_initializer"]),JBo=new Set(["identifier"]),ZBo=new Set(["string_literal","line_comment","block_comment"]),Gfn=new iO(YBo,KBo,JBo,ZBo);p();var XBo=new Set(["class_definition","function_definition","expression_statement","if_statement","for_statement","while_statement","with_statement","try_statement"]),e3o=new Set(["module","block","parameters","dictionary","list"]),t3o=new Set(["identifier"]),r3o=new Set(["string","comment"]),$fn=new iO(XBo,e3o,t3o,r3o);p();var n3o=new Set(["class_declaration","function_declaration","arrow_function","method_definition","expression_statement","if_statement","while_statement","try_statement","for_statement","switch_statement"]),i3o=new Set(["program","statement_block","formal_parameters","arguments","object","array"]),o3o=new Set(["identifier"]),s3o=new Set(["string","comment"]),Vfn=new iO(n3o,i3o,o3o,s3o);var Wfn=de(ale());async function zfn(t){await Wfn.default.init();try{let e=await b8t(t);switch(t){case"python":return new RQ(e,"tree-sitter-python",$fn);case"typescript":return new RQ(e,"tree-sitter-typescript",Vfn);case"java":return new RQ(e,"tree-sitter-java",Gfn);case"cpp":return new RQ(e,"tree-sitter-cpp",Hfn);default:return new RQ(e,"tree-sitter-generic")}}catch{return eWe}}a(zfn,"getParser");var A6t=class{constructor(e,r){this.created=e;this.invalidated=r;this.updatedDocuments=Array.from(new Set([...e.entries(),...r.entries()].filter(([n,o])=>o.size>0).map(([n,o])=>n)))}static{a(this,"WorkspaceContextChanges")}getInvalidatedNodes(e){return this.getNodes(this.invalidated,e)}getCreatedNodes(e){return this.getNodes(this.created,e)}getNodes(e,r){return r===void 0?Array.from(e.entries()).flatMap(([n,o])=>[...o].map(s=>({uri:n,id:s}))):Array.from(e.get(r)??[]).map(n=>({uri:r,id:n}))}},tWe=class{constructor(e,r){this.item=e;this.disposalCallback=r}static{a(this,"CachedItem")}dispose(){this.disposalCallback(this.item)}},Yfn=500,rWe=class{constructor(e,r){this.fileSystem=e;this.config=r;this.targetSet=new Set;this.activeDocuments=new Map;this.nodeToDoc=new Map;this.createdNodes=new Map;this.invalidatedNodes=new Map;this.parsers=new Map;this.staleDocuments=new Set;this.pendingUpdates=new Map;this.uriCache=new Cn(Yfn);this.allowedExtensions=new Set(_Q);this.invalidDocumentCache=new Pk(Yfn,this.config.InvalidCacheTime),this.cachedDocuments=new F9e(this.config.MaxActiveFiles),this.fileSystem.onDidFileChange(n=>this.handleFileChange(n.document.uri))}static{a(this,"WorkspaceContextDocumentManager")}setAllowedLanguages(e){this.allowedExtensions=new Set(e.flatMap(r=>C3[r]?.extensions??[]))}getActiveDocuments(){return Array.from(this.activeDocuments.values())}getNode(e){let r=this.nodeToDoc.get(e);if(r===void 0)return;let n=this.getDocument(r);if(n===void 0)return;let o=n.document.getNode(e);if(o!==void 0)return{...n,node:o}}getDocument(e){let r=this.activeDocuments.get(e);if(r!==void 0)return{document:r,isActive:!0};let n=this.cachedDocuments.get(e);if(n!==void 0)return{document:n.item,isActive:!1}}getUri(e){return this.nodeToDoc.get(e)}normalizeUri(e){let r,n=this.uriCache.get(e);if(n!==null){if(n!==void 0)r=n;else try{if(a7e(e),r=Fs(e),!(this.fileSystem.getWorkspaceFolder({uri:r})!==void 0)){this.uriCache.set(e,null);return}this.uriCache.set(e,r)}catch{this.uriCache.set(e,null);return}if(!(!this.allowedExtensions.has(PKr(r))||this.invalidDocumentCache.has(r)))return r}}dispose(){this.parsers.clear(),this.activeDocuments.clear(),this.cachedDocuments.clear()}updateDocuments(e){this.targetSet.clear();let r=[],n=e.documents.map(({uri:o})=>this.normalizeUri(o)).filter(o=>o!==void 0).slice(0,this.config.MaxActiveFiles);for(let o of n)this.targetSet.add(o),r.push(this.updateDocument(o));for(let o of[...this.activeDocuments.keys()])this.targetSet.has(o)||this.deactivateDocument(o);return Promise.all(r)}popChanges(){let e=new A6t(this.createdNodes,this.invalidatedNodes);return this.createdNodes=new Map,this.invalidatedNodes=new Map,e}isKnownDocument(e){return this.activeDocuments.has(e)||this.cachedDocuments.has(e)||this.pendingUpdates.has(e)}deactivateDocument(e){let r=this.activeDocuments.get(e);r!==void 0&&(this.activeDocuments.delete(e),this.pendingUpdates.has(e)||this.cachedDocuments.set(e,new tWe(r,n=>this.disposeDocument(n))))}async updateDocument(e){if(this.pendingUpdates.has(e))return;let r=new vA;this.pendingUpdates.set(e,r.promise);let n;this.activeDocuments.has(e)?n=this.activeDocuments.get(e):this.cachedDocuments.has(e)&&(n=this.cachedDocuments.get(e).item,this.cachedDocuments.uncache(e)),(n===void 0||this.staleDocuments.has(e))&&(this.staleDocuments.delete(e),n=await this.createUpdatedDocument(e,n)),n!==void 0&&(this.targetSet.has(e)?this.activeDocuments.set(e,n):(this.activeDocuments.delete(e),this.cachedDocuments.set(e,new tWe(n,o=>this.disposeDocument(o))))),this.pendingUpdates.delete(e),r.resolve()}async createUpdatedDocument(e,r){let n=await this.readTextDocument(e);if(n===void 0){r!==void 0&&this.disposeDocument(r);return}let o;try{o=await this.getParser(n.detectedLanguageId)}catch{this.invalidDocumentCache.set(e,!0),r!==void 0&&this.disposeDocument(r);return}if(r!==void 0)if(n.detectedLanguageId!==r.document.detectedLanguageId)this.disposeDocument(r);else{let c=new Set(r.getAllIds());r.update(n);let l=new Set(r.getAllIds()),u=[...l].filter(f=>!c.has(f)),d=[...c].filter(f=>!l.has(f));return this.recordDocumentChanges(e,{created:u,invalidated:d}),r}let s=new ZVe(n,o,this.config.MinNodeSize);return this.recordDocumentChanges(e,{created:s.getAllIds(),invalidated:[]}),s}disposeDocument(e){this.recordDocumentChanges(e.uri,{created:[],invalidated:e.getAllIds()})}recordDocumentChanges(e,r){let n=o0(this.createdNodes,e,()=>new Set),o=o0(this.invalidatedNodes,e,()=>new Set);for(let s of r.created)n.add(s),this.nodeToDoc.set(s,e);for(let s of r.invalidated)n.has(s)?n.delete(s):o.add(s),this.nodeToDoc.delete(s)}async getParser(e){let r=this.parsers.get(e);return r===void 0&&(r=await zfn(e),this.parsers.set(e,r)),r}async readTextDocument(e){if(this.invalidDocumentCache.has(e)||this.normalizeUri(e)===void 0)return;let r=await this.fileSystem.readValidFile({uri:e});if(r.status!=="valid"||r.document.uri!==e){this.invalidDocumentCache.set(e,!0);return}return r.document}handleFileChange(e){this.isKnownDocument(e)&&this.staleDocuments.add(e)}};p();var a3o="WorkspaceContextWorker";function y6t(t){let e=t;return e?.workerId===a3o&&typeof e?.cwd=="string"&&Array.isArray(e?.workspaceRoots)&&e.workspaceRoots.every(r=>typeof r=="string")}a(y6t,"isContextWorkerData");var c3o=["RequestUpdate","Exit","ReadAndValidateUri","Error","UpdateResponse","FlushUpdates","ReadAndValidateResponse"];function Kfn(t){if(typeof t!="object"||t===null)return;let e=t.messageType;return c3o.includes(e)?e:void 0}a(Kfn,"getContextMessageType");var kQ=class{constructor(e,r,n){this.id=e;this.messageType=r;this.data=n}static{a(this,"ContextMessage")}};p();_6t();p();var tpn;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(tpn||(tpn={}));var v6t;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(v6t||(v6t={}));var rpn;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}a(e,"is"),t.is=e})(rpn||(rpn={}));var iWe;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}a(e,"is"),t.is=e})(iWe||(iWe={}));var iE;(function(t){function e(n,o){return n===Number.MAX_VALUE&&(n=iWe.MAX_VALUE),o===Number.MAX_VALUE&&(o=iWe.MAX_VALUE),{line:n,character:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.uinteger(o.line)&&mt.uinteger(o.character)}a(r,"is"),t.is=r})(iE||(iE={}));var mu;(function(t){function e(n,o,s,c){if(mt.uinteger(n)&&mt.uinteger(o)&&mt.uinteger(s)&&mt.uinteger(c))return{start:iE.create(n,o),end:iE.create(s,c)};if(iE.is(n)&&iE.is(o))return{start:n,end:o};throw new Error(`Range#create called with invalid arguments[${n}, ${o}, ${s}, ${c}]`)}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&iE.is(o.start)&&iE.is(o.end)}a(r,"is"),t.is=r})(mu||(mu={}));var oWe;(function(t){function e(n,o){return{uri:n,range:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mu.is(o.range)&&(mt.string(o.uri)||mt.undefined(o.uri))}a(r,"is"),t.is=r})(oWe||(oWe={}));var npn;(function(t){function e(n,o,s,c){return{targetUri:n,targetRange:o,targetSelectionRange:s,originSelectionRange:c}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mu.is(o.targetRange)&&mt.string(o.targetUri)&&mu.is(o.targetSelectionRange)&&(mu.is(o.originSelectionRange)||mt.undefined(o.originSelectionRange))}a(r,"is"),t.is=r})(npn||(npn={}));var C6t;(function(t){function e(n,o,s,c){return{red:n,green:o,blue:s,alpha:c}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.numberRange(o.red,0,1)&&mt.numberRange(o.green,0,1)&&mt.numberRange(o.blue,0,1)&&mt.numberRange(o.alpha,0,1)}a(r,"is"),t.is=r})(C6t||(C6t={}));var ipn;(function(t){function e(n,o){return{range:n,color:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mu.is(o.range)&&C6t.is(o.color)}a(r,"is"),t.is=r})(ipn||(ipn={}));var opn;(function(t){function e(n,o,s){return{label:n,textEdit:o,additionalTextEdits:s}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.string(o.label)&&(mt.undefined(o.textEdit)||ble.is(o))&&(mt.undefined(o.additionalTextEdits)||mt.typedArray(o.additionalTextEdits,ble.is))}a(r,"is"),t.is=r})(opn||(opn={}));var spn;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(spn||(spn={}));var apn;(function(t){function e(n,o,s,c,l,u){let d={startLine:n,endLine:o};return mt.defined(s)&&(d.startCharacter=s),mt.defined(c)&&(d.endCharacter=c),mt.defined(l)&&(d.kind=l),mt.defined(u)&&(d.collapsedText=u),d}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.uinteger(o.startLine)&&mt.uinteger(o.startLine)&&(mt.undefined(o.startCharacter)||mt.uinteger(o.startCharacter))&&(mt.undefined(o.endCharacter)||mt.uinteger(o.endCharacter))&&(mt.undefined(o.kind)||mt.string(o.kind))}a(r,"is"),t.is=r})(apn||(apn={}));var b6t;(function(t){function e(n,o){return{location:n,message:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&oWe.is(o.location)&&mt.string(o.message)}a(r,"is"),t.is=r})(b6t||(b6t={}));var cpn;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(cpn||(cpn={}));var lpn;(function(t){t.Unnecessary=1,t.Deprecated=2})(lpn||(lpn={}));var upn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&mt.string(n.href)}a(e,"is"),t.is=e})(upn||(upn={}));var sWe;(function(t){function e(n,o,s,c,l,u){let d={range:n,message:o};return mt.defined(s)&&(d.severity=s),mt.defined(c)&&(d.code=c),mt.defined(l)&&(d.source=l),mt.defined(u)&&(d.relatedInformation=u),d}a(e,"create"),t.create=e;function r(n){var o;let s=n;return mt.defined(s)&&mu.is(s.range)&&mt.string(s.message)&&(mt.number(s.severity)||mt.undefined(s.severity))&&(mt.integer(s.code)||mt.string(s.code)||mt.undefined(s.code))&&(mt.undefined(s.codeDescription)||mt.string((o=s.codeDescription)===null||o===void 0?void 0:o.href))&&(mt.string(s.source)||mt.undefined(s.source))&&(mt.undefined(s.relatedInformation)||mt.typedArray(s.relatedInformation,b6t.is))}a(r,"is"),t.is=r})(sWe||(sWe={}));var Cle;(function(t){function e(n,o,...s){let c={title:n,command:o};return mt.defined(s)&&s.length>0&&(c.arguments=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.title)&&mt.string(o.command)}a(r,"is"),t.is=r})(Cle||(Cle={}));var ble;(function(t){function e(s,c){return{range:s,newText:c}}a(e,"replace"),t.replace=e;function r(s,c){return{range:{start:s,end:s},newText:c}}a(r,"insert"),t.insert=r;function n(s){return{range:s,newText:""}}a(n,"del"),t.del=n;function o(s){let c=s;return mt.objectLiteral(c)&&mt.string(c.newText)&&mu.is(c.range)}a(o,"is"),t.is=o})(ble||(ble={}));var S6t;(function(t){function e(n,o,s){let c={label:n};return o!==void 0&&(c.needsConfirmation=o),s!==void 0&&(c.description=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.string(o.label)&&(mt.boolean(o.needsConfirmation)||o.needsConfirmation===void 0)&&(mt.string(o.description)||o.description===void 0)}a(r,"is"),t.is=r})(S6t||(S6t={}));var Sle;(function(t){function e(r){let n=r;return mt.string(n)}a(e,"is"),t.is=e})(Sle||(Sle={}));var dpn;(function(t){function e(s,c,l){return{range:s,newText:c,annotationId:l}}a(e,"replace"),t.replace=e;function r(s,c,l){return{range:{start:s,end:s},newText:c,annotationId:l}}a(r,"insert"),t.insert=r;function n(s,c){return{range:s,newText:"",annotationId:c}}a(n,"del"),t.del=n;function o(s){let c=s;return ble.is(c)&&(S6t.is(c.annotationId)||Sle.is(c.annotationId))}a(o,"is"),t.is=o})(dpn||(dpn={}));var T6t;(function(t){function e(n,o){return{textDocument:n,edits:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&k6t.is(o.textDocument)&&Array.isArray(o.edits)}a(r,"is"),t.is=r})(T6t||(T6t={}));var I6t;(function(t){function e(n,o,s){let c={kind:"create",uri:n};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(c.options=o),s!==void 0&&(c.annotationId=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="create"&&mt.string(o.uri)&&(o.options===void 0||(o.options.overwrite===void 0||mt.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||mt.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||Sle.is(o.annotationId))}a(r,"is"),t.is=r})(I6t||(I6t={}));var x6t;(function(t){function e(n,o,s,c){let l={kind:"rename",oldUri:n,newUri:o};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),c!==void 0&&(l.annotationId=c),l}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="rename"&&mt.string(o.oldUri)&&mt.string(o.newUri)&&(o.options===void 0||(o.options.overwrite===void 0||mt.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||mt.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||Sle.is(o.annotationId))}a(r,"is"),t.is=r})(x6t||(x6t={}));var w6t;(function(t){function e(n,o,s){let c={kind:"delete",uri:n};return o!==void 0&&(o.recursive!==void 0||o.ignoreIfNotExists!==void 0)&&(c.options=o),s!==void 0&&(c.annotationId=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="delete"&&mt.string(o.uri)&&(o.options===void 0||(o.options.recursive===void 0||mt.boolean(o.options.recursive))&&(o.options.ignoreIfNotExists===void 0||mt.boolean(o.options.ignoreIfNotExists)))&&(o.annotationId===void 0||Sle.is(o.annotationId))}a(r,"is"),t.is=r})(w6t||(w6t={}));var R6t;(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(o=>mt.string(o.kind)?I6t.is(o)||x6t.is(o)||w6t.is(o):T6t.is(o)))}a(e,"is"),t.is=e})(R6t||(R6t={}));var fpn;(function(t){function e(n){return{uri:n}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)}a(r,"is"),t.is=r})(fpn||(fpn={}));var ppn;(function(t){function e(n,o){return{uri:n,version:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)&&mt.integer(o.version)}a(r,"is"),t.is=r})(ppn||(ppn={}));var k6t;(function(t){function e(n,o){return{uri:n,version:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)&&(o.version===null||mt.integer(o.version))}a(r,"is"),t.is=r})(k6t||(k6t={}));var hpn;(function(t){function e(n,o,s,c){return{uri:n,languageId:o,version:s,text:c}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)&&mt.string(o.languageId)&&mt.integer(o.version)&&mt.string(o.text)}a(r,"is"),t.is=r})(hpn||(hpn={}));var P6t;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}a(e,"is"),t.is=e})(P6t||(P6t={}));var _Ie;(function(t){function e(r){let n=r;return mt.objectLiteral(r)&&P6t.is(n.kind)&&mt.string(n.value)}a(e,"is"),t.is=e})(_Ie||(_Ie={}));var mpn;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(mpn||(mpn={}));var gpn;(function(t){t.PlainText=1,t.Snippet=2})(gpn||(gpn={}));var Apn;(function(t){t.Deprecated=1})(Apn||(Apn={}));var ypn;(function(t){function e(n,o,s){return{newText:n,insert:o,replace:s}}a(e,"create"),t.create=e;function r(n){let o=n;return o&&mt.string(o.newText)&&mu.is(o.insert)&&mu.is(o.replace)}a(r,"is"),t.is=r})(ypn||(ypn={}));var Epn;(function(t){t.asIs=1,t.adjustIndentation=2})(Epn||(Epn={}));var _pn;(function(t){function e(r){let n=r;return n&&(mt.string(n.detail)||n.detail===void 0)&&(mt.string(n.description)||n.description===void 0)}a(e,"is"),t.is=e})(_pn||(_pn={}));var vpn;(function(t){function e(r){return{label:r}}a(e,"create"),t.create=e})(vpn||(vpn={}));var Cpn;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}a(e,"create"),t.create=e})(Cpn||(Cpn={}));var aWe;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(e,"fromPlainText"),t.fromPlainText=e;function r(n){let o=n;return mt.string(o)||mt.objectLiteral(o)&&mt.string(o.language)&&mt.string(o.value)}a(r,"is"),t.is=r})(aWe||(aWe={}));var bpn;(function(t){function e(r){let n=r;return!!n&&mt.objectLiteral(n)&&(_Ie.is(n.contents)||aWe.is(n.contents)||mt.typedArray(n.contents,aWe.is))&&(r.range===void 0||mu.is(r.range))}a(e,"is"),t.is=e})(bpn||(bpn={}));var Spn;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}a(e,"create"),t.create=e})(Spn||(Spn={}));var Tpn;(function(t){function e(r,n,...o){let s={label:r};return mt.defined(n)&&(s.documentation=n),mt.defined(o)?s.parameters=o:s.parameters=[],s}a(e,"create"),t.create=e})(Tpn||(Tpn={}));var Ipn;(function(t){t.Text=1,t.Read=2,t.Write=3})(Ipn||(Ipn={}));var xpn;(function(t){function e(r,n){let o={range:r};return mt.number(n)&&(o.kind=n),o}a(e,"create"),t.create=e})(xpn||(xpn={}));var wpn;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(wpn||(wpn={}));var Rpn;(function(t){t.Deprecated=1})(Rpn||(Rpn={}));var kpn;(function(t){function e(r,n,o,s,c){let l={name:r,kind:n,location:{uri:s,range:o}};return c&&(l.containerName=c),l}a(e,"create"),t.create=e})(kpn||(kpn={}));var Ppn;(function(t){function e(r,n,o,s){return s!==void 0?{name:r,kind:n,location:{uri:o,range:s}}:{name:r,kind:n,location:{uri:o}}}a(e,"create"),t.create=e})(Ppn||(Ppn={}));var Dpn;(function(t){function e(n,o,s,c,l,u){let d={name:n,detail:o,kind:s,range:c,selectionRange:l};return u!==void 0&&(d.children=u),d}a(e,"create"),t.create=e;function r(n){let o=n;return o&&mt.string(o.name)&&mt.number(o.kind)&&mu.is(o.range)&&mu.is(o.selectionRange)&&(o.detail===void 0||mt.string(o.detail))&&(o.deprecated===void 0||mt.boolean(o.deprecated))&&(o.children===void 0||Array.isArray(o.children))&&(o.tags===void 0||Array.isArray(o.tags))}a(r,"is"),t.is=r})(Dpn||(Dpn={}));var Npn;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(Npn||(Npn={}));var cWe;(function(t){t.Invoked=1,t.Automatic=2})(cWe||(cWe={}));var Mpn;(function(t){function e(n,o,s){let c={diagnostics:n};return o!=null&&(c.only=o),s!=null&&(c.triggerKind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.typedArray(o.diagnostics,sWe.is)&&(o.only===void 0||mt.typedArray(o.only,mt.string))&&(o.triggerKind===void 0||o.triggerKind===cWe.Invoked||o.triggerKind===cWe.Automatic)}a(r,"is"),t.is=r})(Mpn||(Mpn={}));var Opn;(function(t){function e(n,o,s){let c={title:n},l=!0;return typeof o=="string"?(l=!1,c.kind=o):Cle.is(o)?c.command=o:c.edit=o,l&&s!==void 0&&(c.kind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&mt.string(o.title)&&(o.diagnostics===void 0||mt.typedArray(o.diagnostics,sWe.is))&&(o.kind===void 0||mt.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||Cle.is(o.command))&&(o.isPreferred===void 0||mt.boolean(o.isPreferred))&&(o.edit===void 0||R6t.is(o.edit))}a(r,"is"),t.is=r})(Opn||(Opn={}));var Lpn;(function(t){function e(n,o){let s={range:n};return mt.defined(o)&&(s.data=o),s}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mu.is(o.range)&&(mt.undefined(o.command)||Cle.is(o.command))}a(r,"is"),t.is=r})(Lpn||(Lpn={}));var Bpn;(function(t){function e(n,o){return{tabSize:n,insertSpaces:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.uinteger(o.tabSize)&&mt.boolean(o.insertSpaces)}a(r,"is"),t.is=r})(Bpn||(Bpn={}));var Fpn;(function(t){function e(n,o,s){return{range:n,target:o,data:s}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mu.is(o.range)&&(mt.undefined(o.target)||mt.string(o.target))}a(r,"is"),t.is=r})(Fpn||(Fpn={}));var Upn;(function(t){function e(n,o){return{range:n,parent:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mu.is(o.range)&&(o.parent===void 0||t.is(o.parent))}a(r,"is"),t.is=r})(Upn||(Upn={}));var Qpn;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Qpn||(Qpn={}));var qpn;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(qpn||(qpn={}));var jpn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}a(e,"is"),t.is=e})(jpn||(jpn={}));var Hpn;(function(t){function e(n,o){return{range:n,text:o}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&mu.is(o.range)&&mt.string(o.text)}a(r,"is"),t.is=r})(Hpn||(Hpn={}));var Gpn;(function(t){function e(n,o,s){return{range:n,variableName:o,caseSensitiveLookup:s}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&mu.is(o.range)&&mt.boolean(o.caseSensitiveLookup)&&(mt.string(o.variableName)||o.variableName===void 0)}a(r,"is"),t.is=r})(Gpn||(Gpn={}));var $pn;(function(t){function e(n,o){return{range:n,expression:o}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&mu.is(o.range)&&(mt.string(o.expression)||o.expression===void 0)}a(r,"is"),t.is=r})($pn||($pn={}));var Vpn;(function(t){function e(n,o){return{frameId:n,stoppedLocation:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mu.is(n.stoppedLocation)}a(r,"is"),t.is=r})(Vpn||(Vpn={}));var D6t;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(D6t||(D6t={}));var N6t;(function(t){function e(n){return{value:n}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&(o.tooltip===void 0||mt.string(o.tooltip)||_Ie.is(o.tooltip))&&(o.location===void 0||oWe.is(o.location))&&(o.command===void 0||Cle.is(o.command))}a(r,"is"),t.is=r})(N6t||(N6t={}));var Wpn;(function(t){function e(n,o,s){let c={position:n,label:o};return s!==void 0&&(c.kind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&iE.is(o.position)&&(mt.string(o.label)||mt.typedArray(o.label,N6t.is))&&(o.kind===void 0||D6t.is(o.kind))&&o.textEdits===void 0||mt.typedArray(o.textEdits,ble.is)&&(o.tooltip===void 0||mt.string(o.tooltip)||_Ie.is(o.tooltip))&&(o.paddingLeft===void 0||mt.boolean(o.paddingLeft))&&(o.paddingRight===void 0||mt.boolean(o.paddingRight))}a(r,"is"),t.is=r})(Wpn||(Wpn={}));var zpn;(function(t){function e(r){return{kind:"snippet",value:r}}a(e,"createSnippet"),t.createSnippet=e})(zpn||(zpn={}));var Ypn;(function(t){function e(r,n,o,s){return{insertText:r,filterText:n,range:o,command:s}}a(e,"create"),t.create=e})(Ypn||(Ypn={}));var Kpn;(function(t){function e(r){return{items:r}}a(e,"create"),t.create=e})(Kpn||(Kpn={}));var Jpn;(function(t){t.Invoked=0,t.Automatic=1})(Jpn||(Jpn={}));var Zpn;(function(t){function e(r,n){return{range:r,text:n}}a(e,"create"),t.create=e})(Zpn||(Zpn={}));var Xpn;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}a(e,"create"),t.create=e})(Xpn||(Xpn={}));var ehn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&v6t.is(n.uri)&&mt.string(n.name)}a(e,"is"),t.is=e})(ehn||(ehn={}));var thn;(function(t){function e(s,c,l,u){return new M6t(s,c,l,u)}a(e,"create"),t.create=e;function r(s){let c=s;return!!(mt.defined(c)&&mt.string(c.uri)&&(mt.undefined(c.languageId)||mt.string(c.languageId))&&mt.uinteger(c.lineCount)&&mt.func(c.getText)&&mt.func(c.positionAt)&&mt.func(c.offsetAt))}a(r,"is"),t.is=r;function n(s,c){let l=s.getText(),u=o(c,(f,h)=>{let m=f.range.start.line-h.range.start.line;return m===0?f.range.start.character-h.range.start.character:m}),d=l.length;for(let f=u.length-1;f>=0;f--){let h=u[f],m=s.offsetAt(h.range.start),g=s.offsetAt(h.range.end);if(g<=d)l=l.substring(0,m)+h.newText+l.substring(g,l.length);else throw new Error("Overlapping edit");d=m}return l}a(n,"applyEdits"),t.applyEdits=n;function o(s,c){if(s.length<=1)return s;let l=s.length/2|0,u=s.slice(0,l),d=s.slice(l);o(u,c),o(d,c);let f=0,h=0,m=0;for(;f"?").join(", "),o=r?"COLLATE NOCASE ":"";return await this.query([`SELECT * FROM ${Yh.tableName}`,this.innerJoinStatement,`WHERE ${da.UnqualifiedName} ${o}IN (${n})`].join(` +`),e)}async querySymbolsUsingFullyQualifiedName(e){return this.query([`SELECT * FROM ${Yh.tableName}`,this.innerJoinStatement,`WHERE ${da.FullyQualifiedName} = ?`].join(` +`),[e])}async querySymbolsContainingPosition(e,r){return this.query([`SELECT * FROM ${Yh.tableName}`,this.innerJoinStatement,`WHERE ${R3.tableName}.${BS.FilePath} = ? AND ${Yh.tableName}.${da.ExtentStart} <= ? AND (${Yh.tableName}.${da.ExtentStart} + ${Yh.tableName}.${da.ExtentLength}) >= ?`].join(` +`),[e,r,r])}async querySymbolsContainedByRange(e,r,n){return this.query([`SELECT * FROM ${Yh.tableName}`,this.innerJoinStatement,`WHERE ${R3.tableName}.${BS.FilePath} = ? AND ${Yh.tableName}.${da.ExtentStart} >= ? AND (${Yh.tableName}.${da.ExtentStart} + ${Yh.tableName}.${da.ExtentLength}) <= ?`,`ORDER BY ${Yh.tableName}.${da.ExtentStart}`].join(` +`),[e,r,n])}async querySymbolsByQualifiedNamePrefix(e,r){return this.query([`SELECT * FROM ${Yh.tableName}`,this.innerJoinStatement,`WHERE ${R3.tableName}.${BS.FilePath} = ? AND ${Yh.tableName}.${da.FullyQualifiedName} LIKE ?`,`ORDER BY ${Yh.tableName}.${da.ExtentStart}`].join(` +`),[e,`${r}%`])}async insertSymbols(e){return await this.symbolTable.insert(e,!1)}async insertDocument(e,r,n=!1){return await this.documentTable.insert([{filePath:e,lastWriteTimeUtc:r}],n)}async clearAllSymbolsFromDocument(e){return this.symbolTable.clearAllSymbolsFromDocument(e)}async updateDocumentTimestamp(e,r){return this.documentTable.updateTimestamp(e,r)}async deleteAllDocumentsWithPath(e){return this.documentTable.deleteAllWithPath(e)}async getAllDocuments(){return this.documentTable.getAllRows()}getDocument(e){return this.documentTable.getDocumentByFilePath(e)}async query(e,r){let n=await this.db;return n?(await this.documentTable.init,await this.symbolTable.init,nWe(n,e,r)):[]}};var oWe=class{static{a(this,"SQLStorageReaderWriter")}constructor(e){this.database=new iWe(e)}async close(){await this.database.close()}async insertOrReplaceDocumentSymbolsAsync(e,r,n){let o=await this.getOrCreateDocumentAsync(e,r);await this.database.clearAllSymbolsFromDocument(o.id),n.length>0&&await this.database.insertSymbols(n.map(s=>({documentId:o.id,fullyQualifiedName:s.fullyQualifiedName,unqualifiedName:s.unqualifiedName,commentStart:s.commentRange.start,commentLength:s.commentRange.length,nameStart:s.nameRange.start,nameLength:s.nameRange.length,bodyStart:s.bodyRange.start,bodyLength:s.bodyRange.length,extentStart:s.extentRange.start,extentLength:s.extentRange.length,symbolKind:s.kind,refKind:s.refKind}))),await this.database.updateDocumentTimestamp(e,r)}async addDocumentsAsync(e){for(let r of e)r=r.toLowerCase(),await this.database.insertDocument(r,Date.now(),!0)}async deleteDocumentAsync(e){return await this.database.deleteAllDocumentsWithPath(e.toLowerCase())}async updateDocumentTimestampAsync(e,r){return await this.database.updateDocumentTimestamp(e.toLowerCase(),r)}async fuzzyMatchSymbolsAsync(e,r){return wle(await this.database.querySymbolsFuzzilyUsingUnqualifiedName(e,r))}async findPotentialDefinitionsAsync(e,r,n){let o=[],c=0;for(;cnew Gx(e.filePath,e.fullyQualifiedName,e.unqualifiedName,new mu(e.commentStart,e.commentLength),new mu(e.nameStart,e.nameLength),new mu(e.bodyStart,e.bodyLength),new mu(e.extentStart,e.extentLength),e.symbolKind,e.refKind))}a(wle,"symbolsToSymbolRanges");var aWe=fe(require("fs/promises"));var sWe=class{static{a(this,"Index")}constructor(e,r,n,o){this.storage=new oWe(e),this.symbolExtractors=r,this.importExtractors=n,this.params=o}dispose(){return this.storage.close()}get reader(){return this.storage}async indexFile(e,r){let n=Us(e);if(!n)throw Error(`Cannot resolve a readable file path from ${e}`);let o;try{o=await aWe.stat(n)}catch{await this.storage.deleteDocumentAsync(e);return}let s=o.mtimeMs,c=await this.storage.getDocumentAsync(e);if(c&&c.lastWriteTimeUtc>=s)return;let l=this.symbolExtractors.get(r);if(!l)return;let u=(await aWe.readFile(n)).toString(),d=await l.extractSymbols(e,u),f=d;if(this.params?.mlcpEnableImports){let h=this.importExtractors.get(r);if(h){let m=await h.extractSymbols(e,u);f=[...d,...m]}}await this.storage.insertOrReplaceDocumentSymbolsAsync(e,s,f)}async getDocumentFilePaths(){return(await this.storage.getDocumentsAsync()).map(r=>r.filePath)}};p();function P6t(t){let e=t;return typeof e?.cwd=="string"&&Array.isArray(e?.indexWorkspaceRoots)&&e.indexWorkspaceRoots.every(r=>NFo(r))}a(P6t,"isIndexWorkerData");var LIe=class{static{a(this,"IndexNotification")}constructor(e){this.operation=e}},NQ=class extends LIe{constructor(r,n){super(n);this.id=r;this.id=r}static{a(this,"IndexRequest")}},cWe=class extends LIe{constructor(r){super(aE.Cancel);this.messageIdToCancel=r}static{a(this,"CancellationNotification")}},aE={CreateIndex:"createIndex",AddOrInvalidated:"addOrInvalidated",GetContext:"getContext",Exit:"exit",Response:"response",RemoveIndex:"removeIndex",Cancel:"cancel",GetAllDocumentsInWorkspace:"getAllDocumentsInWorkspace"},lWe=class extends NQ{constructor(r,n,o){super(r,aE.CreateIndex);this.baseWorkspaceFolderUri=n;this.databaseFilePath=o}static{a(this,"CreateIndexRequest")}},uWe=class extends NQ{constructor(r,n){super(r,aE.RemoveIndex);this.baseWorkspaceFolderUri=n}static{a(this,"RemoveIndexRequest")}},dWe=class extends NQ{constructor(r,n,o){super(r,aE.AddOrInvalidated);this.fileUri=n;this.languageId=o}static{a(this,"AddOrInvalidatedRequest")}},fWe=class extends NQ{constructor(r,n){super(r,aE.GetAllDocumentsInWorkspace);this.baseWorkspaceFolderUri=n}static{a(this,"GetAllDocumentsRequest")}},pWe=class extends NQ{constructor(r,n,o,s,c,l){super(r,aE.GetContext);this.fileUri=n;this.code=o;this.offset=s;this.languageId=c;this.params=l}static{a(this,"GetContextRequest")}},hWe=class extends NQ{static{a(this,"ExitRequest")}constructor(e){super(e,aE.Exit)}},BP=class extends LIe{constructor(r,n,o){super(aE.Response);this.id=r;this.error=n;this.data=o;n&&"code"in n&&typeof n.code=="string"&&(this.code=n.code)}static{a(this,"ResponseMessage")}};function NFo(t){return"databaseFilePath"in t&&"rootPath"in t}a(NFo,"isIndexableWorkspaceFolder");var Rpn=fe(ei()),MQ=require("worker_threads");var mWe=class{static{a(this,"IndexInfo")}constructor(e,r){this.index=new sWe(e,mpn,gpn,r),this.contextRetreival=new XVe(this.index.reader,hpn)}},D6t=class t{constructor(e,r,n){this.indices=new Map;this.cancellationTokens=new Map;this.params=n;for(let o of r){let s=ln(o.rootPath);this.indices.set(s,new mWe(o.databaseFilePath,n))}this.port=e,this.port.on("message",o=>{o&&typeof o=="object"&&o.__perf__&&this.port?.postMessage({__perf__:!0,memoryUsage:process.memoryUsage()})}),this.port.on("message",o=>{this.dispatchMessage(o,this.indices,this.cancellationTokens)})}static{a(this,"IndexWorker")}async dispatchMessage(e,r,n){if(!e.__perf__)try{let o=new Rpn.CancellationTokenSource;n.set(e.id,o);let s;switch(e.operation){case aE.AddOrInvalidated:s=await t.dispatchAddOrInvalidate(e,r,o.token);break;case aE.GetContext:s=await t.dispatchGetContext(e,r,o.token);break;case aE.Cancel:n.get(e.id)?.cancel(),s=new BP(e.id,void 0,void 0);break;case aE.Exit:s=await this.dispatchExit(e,r,o.token);break;case aE.CreateIndex:s=t.dispatchCreateIndex(e,r,o.token);break;case aE.RemoveIndex:s=await t.dispatchRemoveIndex(e,r,o.token);break;case aE.GetAllDocumentsInWorkspace:s=await t.GetAllDocumentsInWorkspaceRequest(e,r,o.token);break;default:this.port?.postMessage(new Error(`Unknown operation: ${e.operation}`))}s&&this.port?.postMessage(s),n.get(e.id)?.dispose(),n.delete(e.id)}catch(o){if(!(o instanceof Error))throw o;this.port?.postMessage(new BP(e.id,o,void 0))}}static async GetAllDocumentsInWorkspaceRequest(e,r,n){let o=ln(e.baseWorkspaceFolderUri),s,c;return r.has(o)?c=await r.get(o).index.getDocumentFilePaths():s=new Error(`Index not found for ${e.baseWorkspaceFolderUri}`),new BP(e.id,s,c)}static async dispatchAddOrInvalidate(e,r,n){let o=ln(e.fileUri),s=t.getIndexInfo(o,r)?.index,c;return s?await s.indexFile(e.fileUri,e.languageId):c=new Error(`Index not found for ${e.fileUri}`),new BP(e.id,c,void 0)}static async dispatchGetContext(e,r,n){let o=ln(e.fileUri),s=t.getIndexInfo(o,r)?.contextRetreival,c,l;return s?l=await s.getStringifiedContextAtPositionAsync(e.fileUri,e.code,e.offset,e.languageId,e.params,8e3,n):c=new Error(`ContextRetrieval not found for ${e.fileUri}`),new BP(e.id,c,l)}async dispatchExit(e,r,n){for(let o of r.values())await o.index.dispose();r.clear(),this.port?.postMessage(new BP(e.id,void 0,void 0)),this.port?.close()}static dispatchCreateIndex(e,r,n){let o=ln(e.baseWorkspaceFolderUri);return r.has(o)||r.set(o,new mWe(e.databaseFilePath)),new BP(e.id,void 0,void 0)}static async dispatchRemoveIndex(e,r,n){let o=ln(e.baseWorkspaceFolderUri);if(r.has(o)){let s=r.get(o);s&&await s.index.dispose(),r.delete(o)}return new BP(e.id,void 0,void 0)}static getIndexInfo(e,r){for(let[n,o]of r)if(e.startsWith(n))return o}};function kpn(){return P6t(MQ.workerData)}a(kpn,"isIndexWorker");function Ppn(){let t=MQ.parentPort;if(!t)throw new Error("This must be run a worker thread.");if(!P6t(MQ.workerData))throw new Error("Worker data must provide a valid database path.");let e=MQ.workerData.cwd;process.cwd=()=>e,new D6t(t,MQ.workerData.indexWorkspaceRoots,MQ.workerData.params)}a(Ppn,"runIndexWorker");p();p();var BIe=require("fs"),Dpn=require("path");var OQ=class extends Qo{static{a(this,"LocalFileSystem")}async readFileString(e,r="utf8"){return await BIe.promises.readFile(ln(e),r)}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink(ln(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=ln(e),n=await BIe.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,Dpn.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await BIe.promises.lstat(e);if(r.isSymbolicLink())try{let n=await BIe.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=0;return e.isFile()&&(o=1),e.isDirectory()&&(o=2),r.isSymbolicLink()&&n&&(o|=64),o}};p();p();var kA=class{constructor(){this.resolve=a(()=>{},"resolve");this.reject=a(()=>{},"reject");this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}static{a(this,"Deferred")}};function MC(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(MC,"delay");async function FS(t,e,r){let n=new Array(t.length),o=Math.floor(e)>0?Math.floor(e):1,s=Math.max(1,Math.min(o,t.length)),c=0,l=a(async()=>{for(let u=c++;ul())),n}a(FS,"mapWithConcurrency");function Rle(t,e){try{t()?.catch(r=>{try{e?.(r)}catch{}})}catch(r){try{e?.(r)}catch{}}}a(Rle,"fireAndForget");function Npn(t){let e=Math.floor(t)>0?Math.floor(t):1,r=0,n=[],o=a(()=>rn.push(()=>{r++,c()})),"acquire"),s=a(()=>{r--,n.shift()?.()},"release");return{async run(c){await o();try{return await c()}finally{s()}}}}a(Npn,"createLimiter");function k3(t,e,r){return new Promise(n=>{let o=!1,s=setTimeout(()=>{o||(o=!0,n(r))},e),c=a(l=>{o||(o=!0,clearTimeout(s),n(l))},"finish");t.then(c,()=>c(r))})}a(k3,"withTimeout");function kle(t,e,r){try{return t()}catch(n){try{r?.(n)}catch{}return e}}a(kle,"safeInit");async function MFo(t){if(t.isCancellationRequested)return;let e=new kA,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(MFo,"cancellationTokenToPromise");async function Mpn(t,e){if(e){let r=MFo(e);await Promise.race([t,r])}else await t}a(Mpn,"raceCancellation");function N6t(t){return Array.isArray(t)}a(N6t,"isArrayOfT");async function Opn(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await M6t(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(Opn,"resolveAll");async function M6t(t,e){let r;return t instanceof Promise?r=await OFo(t,e):r=await LFo(t,e),r}a(M6t,"resolve");async function OFo(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{let s=await t;if(e?.isCancellationRequested)return;n={status:"full",resolutionTime:0,value:N6t(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await Mpn(o,e),n.resolutionTime=performance.now()-r,n}a(OFo,"resolvePromise");async function LFo(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{for await(let s of t){if(e?.isCancellationRequested)return;n.status!="partial"&&(n={status:"partial",resolutionTime:0,value:[]}),n.value.push(s)}e?.isCancellationRequested||(n.status!=="partial"?n={status:"full",resolutionTime:0,value:[]}:n.status="full")}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await Mpn(o,e),n.resolutionTime=performance.now()-r,n}a(LFo,"resolveIterable");p();p();var gWe="[...]",BFo=0,OC=-1;function Sf(){return BFo++}a(Sf,"getAvailableNodeId");function FFo(t,e){let r=t.children.map(n=>n.elisionMarker??e);return[...t.text.entries()].map(([n,o])=>n===0?o:r[n-1]+o).join("")}a(FFo,"elideChildren");function Lpn(t,e=gWe){return r=>t.tokenLength(FFo(r,e))}a(Lpn,"getTokenizerCostFunction");p();var BQ=class{static{a(this,"PriorityQueue")}constructor(e){if(this.heap=e?[...e]:[],this.heap.length>0)for(let r=Math.floor(this.heap.length/2)-1;r>=0;r--)this.siftDown(r)}get size(){return this.heap.length}insert(e,r){let n={item:e,priority:r};this.heap.push(n);let o=this.heap.length-1;this.siftUp(o)}peek(){return this.heap.length===0?null:this.heap[0]}pop(){if(this.heap.length===0)return null;let e=this.heap[0],r=this.heap.pop();return this.heap.length>0&&(this.heap[0]=r,this.siftDown(0)),e}clear(){let e=this.heap;return this.heap=[],e}siftUp(e){let r=this.heap[e];for(;e>0;){let n=Math.floor((e-1)/2);if(this.heap[n].priority>=r.priority)break;this.heap[e]=this.heap[n],e=n}this.heap[e]=r}siftDown(e){for(;ethis.heap[r].priority&&(r=n),othis.heap[r].priority&&(r=o),r===e)break;let s=this.heap[e];this.heap[e]=this.heap[r],this.heap[r]=s,e=r}}};function UFo(t){let e={id:t.id??Sf(),text:t.text??new Array((t.children?.length??0)+1).fill(""),children:t.children??[],cost:t.cost??1,weight:t.weight??0,rectifiedWeight:t.rectifiedWeight,canMerge:t.canMerge??!1,elisionMarker:t.elisionMarker??gWe,requireRenderedChild:t.requireRenderedChild??!1};if(e.text.length!==e.children.length+1)throw new Error(`RenderNode text length (${e.text.length}) must be children length + 1 (${e.children.length+1})`);return e}a(UFo,"createRenderNode");function QFo(t){return t.requireRenderedChild||(t.rectifiedWeight??t.weight)>t.weight}a(QFo,"isRenderedChildRequired");function Bpn(t){return(t.rectifiedWeight??t.weight)/Math.max(t.cost,1)}a(Bpn,"rectifiedValue");function FIe(t,e){let r=Fpn(t,e);for(let{item:n,priority:o}of r.clear())for(let s of n.nodes)s.rectifiedWeight=o*Math.max(s.cost,1)}a(FIe,"rectifyWeights");function Fpn(t,e){let r=t.children.map(s=>Fpn(s,e));if(t.weight=Math.max(0,e?e(t):t.weight),t.weight===0&&r.reduce((s,c)=>s+c.size,0)===0)return new BQ([]);let n=new BQ(r.flatMap(s=>s.clear())),o={nodes:[t],totalCost:t.cost,totalWeight:t.weight};for(;(n.peek()?.priority??0)>o.totalWeight/Math.max(o.totalCost,1);){let{item:s}=n.pop();o.nodes.push(...s.nodes),o.totalCost+=s.totalCost,o.totalWeight+=s.totalWeight}return n.insert(o,o.totalWeight/Math.max(o.totalCost,1)),n}a(Fpn,"recursivelyRectifyWeights");function Upn(t,e={}){let{budget:r,mask:n,costFunction:o}=e,s=n??[],c=new Set(Array.isArray(s)?s:[s]);if((r??t.cost)c.has(E.id),"elider"),m=[],g=new Map;if(L6t(t,m,h,g),m.length===0)return O6t(t,o);let A=m.join(""),y=o?o(A):[...g.values()].reduce((E,_)=>E+_.cost,0);return{text:A,cost:y,renderedNodes:g}}let l=new Map,u=[],d=new BQ([{item:t,priority:Bpn(t)}]),f=r;for(;f>0&&d.size>0;){let{item:h}=d.pop();if(!c.has(h.id)&&h.cost<=f){f-=h.cost,l.set(h.id,h),u.push(h);for(let m of h.children)d.insert(m,Bpn(m))}}for(;l.size>0;){let h=[],m=a(E=>!l.has(E.id),"elider"),g=new Map;if(L6t(t,h,m,g),h.length===0)return O6t(t,o);let A=h.join("");if(o===void 0){let E=[...g.values()].reduce((_,v)=>_+v.cost,0);return{text:A,cost:E,renderedNodes:g}}let y=o(A);if(y<=r)return{text:A,cost:y,renderedNodes:g};for(l=g;u.length>0&&y>r;){let E=u.pop();l.has(E.id)&&(y-=E.cost,l.delete(E.id))}if(u.length===0)break}return O6t(t,o)}a(Upn,"render");function O6t(t,e){return{text:t.elisionMarker,cost:e?e(t.elisionMarker):t.elisionMarker.length,renderedNodes:new Map}}a(O6t,"renderEmpty");function L6t(t,e,r,n,o=!1){let s=e.length;if(r(t))return s>=2&&(o||e[s-2]===t.elisionMarker&&e[s-1].trim().length===0)?(e.pop(),!1):(e.push(t.elisionMarker),!1);let c=QFo(t),l=!0;for(let[u,d]of t.children.entries())e.push(t.text[u]??""),l=L6t(d,e,r,n,d.canMerge&&!l),c&&=!l;if(c){for(;e.length>s;)e.pop();return!1}return e.push(t.text[t.text.length-1]??""),n.set(t.id,t),!0}a(L6t,"recursivelyRender");function UIe(t,e,r=gWe){let n=t.children.map(c=>UIe(c,e,r));r=t.elisionMarker??r;let o=e(t);return UFo({...t,children:n,cost:o,weight:0,elisionMarker:t.elisionMarker??r})}a(UIe,"snapshot");var FQ={id:Sf(),text:[""],children:[],cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};p();p();var FP=class{constructor(){this.disposables=[]}static{a(this,"WorkspaceContextProvider")}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};var yWe={MaxDirectorySize:200,MaxResults:100,Decay:.5,CacheSize:2e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:2*1024*1024};async function qFo(t,e,r=yWe,n){let o=n?.get(e);if(o!==void 0)return o;let s;try{s=await t.readDirectory(e)}catch{}if(s===void 0||r.MaxDirectorySize!==void 0&&s.length>r.MaxDirectorySize)return n?.set(e,"Invalid",r.InvalidCacheTime),"Invalid";let c={documents:[],directories:[]};for(let[l,u]of s){let d=wa(e,l);u&2?c.directories.push(d):c.documents.push(d)}return n?.set(e,c),c}a(qFo,"getDirectoryChildren");function jFo(t,e){let r=t.getWorkspaceFolder({uri:e});if(r===void 0)return[];let n=[],o=mf(e);for(;o.startsWith(r);){n.push(o);let s=mf(o);if(s.length>=o.length)break;o=s}return n}a(jFo,"getAncestors");function HFo(t,e,r=yWe.Decay){let n=new Map,o=new Map,s=new Map,c=new Map;for(let l of e){let u=jFo(t,l.uri);if(u.length===0){n.set(l.uri,new Set);continue}let d;for(let f of u){if(d!==void 0){let h=o.get(f)??new Set;h.add(d),o.set(f,h)}d=f}s.set(l.uri,d),n.set(l.uri,new Set(u))}for(let l of e){let u=[],d=n.get(l.uri);if(!(!d||d.size===0))for(u.push({uri:s.get(l.uri),weight:l.weight*Math.pow(r,d.size)});u.length>0;){let f=u.pop();c.set(f.uri,(c.get(f.uri)??0)+f.weight);let h=o.get(f.uri)??new Set;for(let m of h){let g=f.weight;d.has(m)?g/=r:g*=r,u.push({uri:m,weight:g})}}}return c}a(HFo,"getAncestorWeights");async function*B6t(t,e,r,n,o,s){let c={...yWe,...r},l=c.MaxResults,u=c.Decay,d=HFo(t,e,u),f=new BQ([...d.entries()].map(([m,g])=>({item:m,priority:g}))),h=0;for(;f.size>0;){let{item:m,priority:g}=f.pop(),A=await qFo(t,m,c,n);if(s?.isCancellationRequested)return;if(A!=="Invalid"){for(let y of A.documents)if(!o||o(y)){try{if((await t.stat(y)).size>c.MaxFileBytes)continue}catch{continue}if(yield{uri:y,weight:g},h++,h>=l)return}for(let y of A.directories)d.has(y)||(f.insert(y,g*u),d.set(y,g*u))}}}a(B6t,"getNearbyDocuments");var AWe=class extends FP{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=yWe;this.cache=new Qk(this.config.CacheSize,this.config.CacheTime)}static{a(this,"FileDirectoryDocumentProvider")}async*getContext(r,n,o,s){for await(let c of B6t(this.fileSystem,n.documents,this.config,this.cache,l=>this.documentManager.normalizeUri(l)!==void 0,s))yield{...c,source:"FileDirectoryDocumentProvider"}}};p();p();p();function l0(t,e,r){let n=t.get(e);return n===void 0&&(n=r(e),t.set(e,n)),n}a(l0,"setDefault");var GFo={MaxActiveSymbols:500,SymbolCacheSize:1e6},EWe=class extends FP{constructor(){super(...arguments);this.config=GFo;this.nodeToSymbol=new Map;this.nodeValency=new Map;this.symbolToNode=new Map;this.symbolValency=new Map;this.identifierSymbols=new Set;this.identifiers=new Cn(this.config.SymbolCacheSize);this.textSymbols=new Cn(this.config.SymbolCacheSize);this.nextSymbolId=0}static{a(this,"SymbolContextProvider")}getContext(r,n,o,s){this.updateSymbolIndex(r,o);let c=this.getWeightedSymbols(n);return Promise.resolve(this.getWeightedNodes(c))}updateSymbolIndex(r,n){for(let{id:o}of r.getInvalidatedNodes()){let s=this.nodeToSymbol.get(o);if(this.nodeToSymbol.delete(o),this.nodeValency.delete(o),s)for(let[c,l]of s.entries()){let u=this.symbolToNode.get(c);u?.delete(o),u?.size===0?(this.symbolToNode.delete(c),this.symbolValency.delete(c),this.identifierSymbols.delete(c)):this.symbolValency.has(c)&&this.symbolValency.set(c,Math.max(1,(this.symbolValency.get(c)??0)-l))}}for(let{id:o}of r.getCreatedNodes()){let s=n.getNode(o);s!==void 0&&this.extractSymbols(s.document,s.node)}}getWeightedSymbols(r){let n=new Map;for(let{id:s,weight:c}of r.nodes){let l=this.nodeValency.get(s)??0,u=[],d=0;for(let[f,h]of this.nodeToSymbol.get(s)??[]){let m=this.symbolValency.get(f);if((m??0)<1)continue;let g=h/(Math.max(l,1)*Math.max(1,m));u.push({symbolId:f,nodeSymbolWeight:g}),d+=g}d=Math.max(d,1);for(let{symbolId:f,nodeSymbolWeight:h}of u)n.set(f,(n.get(f)??0)+c*h/d)}return[...n.entries()].map(([s,c])=>({symbolId:s,symbolWeight:c,symbolValency:this.symbolValency.get(s)})).filter(({symbolValency:s})=>(s??0)>0).sort((s,c)=>c.symbolWeight/c.symbolValency-s.symbolWeight/s.symbolValency).slice(0,this.config.MaxActiveSymbols)}getWeightedNodes(r){let n=[];for(let{symbolId:o,symbolWeight:s,symbolValency:c}of r){let l=this.identifierSymbols.has(o)?"SymbolContextProvider.Identifiers":"SymbolContextProvider.Text";for(let[u,d]of this.symbolToNode.get(o)??[]){let f=s*d/Math.max(c,this.nodeValency.get(u)??d);n.push({id:u,weight:f,source:l})}}return n}extractSymbols(r,n){if(this.nodeToSymbol.has(n.id))return;let o=new Map;this.nodeToSymbol.set(n.id,o);let s=0;for(let c of n.syntaxNodes()){let l=r.document.getText(c.range);if(this.isIdentifier(r,c,l)){let u=l0(this.identifiers,l,()=>this.createSymbol(!0));o.set(u,(o.get(u)??0)+1),s+=1}if(this.isText(r,c,l)||this.isIdentifier(r,c,l))for(let u of F6t(l)){let d=l0(this.textSymbols,u,()=>this.createSymbol());o.set(d,(o.get(d)??0)+1),s+=1}}this.nodeValency.set(n.id,s);for(let[c,l]of o.entries())l0(this.symbolToNode,c,()=>new Map).set(n.id,l),this.symbolValency.set(c,(this.symbolValency.get(c)??0)+l)}createSymbol(r=!1){let n=this.nextSymbolId++;return r&&this.identifierSymbols.add(n),n}isText(r,n,o){return r.parser.labeler.isText?.(n)??(n.children.length===0&&o.search(/\s/)>=0)}isIdentifier(r,n,o){return r.parser.labeler.isIdentifier?.(n)??(n.children.length===0&&Qpn(o))}},$Fo=/^[a-zA-Z_]{2,}\w+$/;function Qpn(t){return $Fo.test(t)}a(Qpn,"isSymbol");function VFo(t){return t.toLowerCase()}a(VFo,"normalizeWord");function*F6t(t){for(let e of t.split(/\W/))Qpn(e)&&(yield VFo(e))}a(F6t,"getTextSymbols");var WFo={MaxDirectorySize:50,MaxResults:50,Decay:.5,CacheSize:1e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:1*1024*1024,MaxActiveSymbols:500,DebouncedRemovalThreshold:3,UpdateDebounceTimeout:500,SymbolCacheSize:1e5},_We=class extends EWe{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=WFo;this.symbolToDocuments=new Map;this.documentToSymbols=new Map;this.documentValency=new Map;this.cache=new Qk(this.config.CacheSize,this.config.CacheTime);this.debouncedExpirationCount=new Map;this.updateDebounce=new Map;this.currentlyUpdating=new Set;this.isUpdatingIndex=!1;this.fileSystem.onDidFileChange(o=>{let s=o.document.uri;this.documentToSymbols.has(s)&&this.debouncedReadOrUpdateDocument(s)})}static{a(this,"IndexingSymbolContextProvider")}async getContext(r,n,o,s){super.updateSymbolIndex(r,o),await this.updateDocumentIndex(n);let c=super.getWeightedSymbols(n),l=super.getWeightedNodes(c),u=this.getWeightedDocuments(c);return[...l,...u]}getWeightedDocuments(r){let n=[];for(let{symbolId:o,symbolWeight:s}of r)for(let[c,l]of this.symbolToDocuments.get(o)??[]){let u=l/Math.max(1,this.documentValency.get(c)??1),d=Math.log(Math.max(this.documentToSymbols.size,1)/Math.max(1,this.symbolToDocuments.get(o)?.size??1)),f=s*u*d;n.push({source:"IndexingSymbolContextProvider.Text",uri:c,weight:f})}return n}debouncedReadOrUpdateDocument(r){this.updateDebounce.has(r)&&clearTimeout(this.updateDebounce.get(r)),this.updateDebounce.set(r,setTimeout(()=>{this.updateDebounce.delete(r),this.readOrUpdateDocument(r)},this.config.UpdateDebounceTimeout))}async readOrUpdateDocument(r){try{if(this.currentlyUpdating.has(r))return;if(this.documentManager.normalizeUri(r)===void 0){this.removeFromIndex(r);return}this.currentlyUpdating.add(r);let n=await this.fileSystem.readFileString({uri:r}),o=new Map,s=0;for(let l of F6t(n))o.set(l,(o.get(l)??0)+1),s++;let c=[];for(let[l,u]of o.entries()){let d=l0(this.textSymbols,l,()=>this.createSymbol(!1));l0(this.symbolToDocuments,d,()=>new Map).set(r,u),c.push(d)}this.documentValency.set(r,s),this.documentToSymbols.set(r,c)}catch{this.removeFromIndex(r)}finally{this.currentlyUpdating.delete(r)}}async updateDocumentIndex(r){if(!this.isUpdatingIndex){this.isUpdatingIndex=!0;try{for(let s of this.documentToSymbols.keys())this.debouncedExpirationCount.set(s,(this.debouncedExpirationCount.get(s)??0)+1);let n=a(s=>this.documentManager.normalizeUri(s)!==void 0,"filter");for await(let{uri:s}of B6t(this.fileSystem,r.documents,this.config,this.cache,n))this.documentToSymbols.has(s)||await this.readOrUpdateDocument(s),this.debouncedExpirationCount.delete(s);let o=[...this.debouncedExpirationCount.entries()].filter(([s,c])=>c>=this.config.DebouncedRemovalThreshold&&!this.currentlyUpdating.has(s)&&!this.updateDebounce.has(s));for(let[s]of o)this.removeFromIndex(s),this.debouncedExpirationCount.delete(s)}finally{this.isUpdatingIndex=!1}}}removeFromIndex(r){this.documentValency.delete(r);for(let n of this.documentToSymbols.get(r)??[]){let o=this.symbolToDocuments.get(n);o?.delete(r),o?.size===0&&this.symbolToDocuments.delete(n)}this.documentToSymbols.delete(r)}};p();function qpn(t){return t.nodeId!==void 0}a(qpn,"isNodeLocation");var jpn={"RecentDocumentProvider.RecentlyFocused":{maxEventCount:100,halflife:1e3*60*5,isImpulse:!1},"RecentDocumentProvider.RecentlyEdited":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!0},"RecentDocumentProvider.RecentlyOpen":{maxEventCount:100,halflife:1e3*60*5,isImpulse:!1},RecentCompletionsRequestProvider:{maxEventCount:100,halflife:1e3*60*5,isImpulse:!0},"ExtensionActivityProvider.CurrentSelection":{maxEventCount:1,halflife:1e5,isImpulse:!0},"ExtensionActivityProvider.PrimarySelection":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1},"ExtensionActivityProvider.Selection":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1},"ExtensionActivityProvider.VisibleRange":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1}},vWe=class extends FP{constructor(){super(...arguments);this.eventsByType=new Map;this.nextId=0}static{a(this,"RecentActivityProvider")}getContext(r,n,o,s){let c=performance.now(),l=[];for(let[u,d]of this.eventsByType.entries()){let f=jpn[u],h=[...d.values()].sort((g,A)=>A.timestamp-g.timestamp),m=1;for(let g of h){this.resolveRanges(g,o);let A=.5**((c-g.timestamp)/f.halflife),y=f.isImpulse?A:m-A;m=A;for(let E of g.locations)qpn(E)?l.push({weight:y,uri:E.uri,id:E.nodeId,source:u}):l.push({weight:y,uri:E.uri,source:u})}}return Promise.resolve(l)}resolveRanges(r,n){if(r.isFullyResolved)return;let o=!0,s=[];for(let c of r.locations)if(qpn(c))s.push(c);else if(c.range&&c.range.start!==void 0&&c.range.end!==void 0){let l=n.getDocument(c.uri)?.document;if(l!==void 0){let u=l.findNode(l.document.offsetAt(c.range.start),l.document.offsetAt(c.range.end));s.push({uri:c.uri,nodeId:u.id})}else o=!1,s.push(c)}else s.push({uri:c.uri,nodeId:OC});r.locations=s,r.isFullyResolved=o}recordEvent(r,n,o){let s=jpn[r];if(s===void 0)return;let c={timestamp:o,locations:n,isFullyResolved:!1};l0(this.eventsByType,r,()=>new Cn(s.maxEventCount)).set(++this.nextId,c)}};p();var CWe=class extends FP{constructor(){super(...arguments);this.nodeParent=new Map;this.nodeChildren=new Map}static{a(this,"TreeProximityProvider")}getContext(r,n,o,s){this.updateIndex(r,o,s);let c=new Map,l=new Map,u=new Map;for(let{id:f,weight:h}of n.nodes){let m=this.nodeParent.get(f)??OC,g=this.nodeChildren.get(m)?.size??0;g>0&&c.set(m,(c.get(m)??0)+h/g);let A=this.nodeChildren.get(f);if(A&&A.size>0)for(let E of A)l.set(E,(l.get(E)??0)+h/A.size);let y=this.nodeChildren.get(m);if(y&&y.size>1)for(let E of y)E!==f&&u.set(E,(u.get(E)??0)+h/y.size)}let d=[...[...c.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Parent"})),...[...l.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Children"})),...[...u.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Siblings"}))];return Promise.resolve(d)}updateIndex(r,n,o){for(let{id:s}of r.getInvalidatedNodes())this.nodeParent.delete(s),this.nodeChildren.delete(s);for(let{id:s}of r.getCreatedNodes()){let c=n.getNode(s),l=new Set;if(c!==void 0)for(let u of c.node.children)this.nodeParent.set(u.id,s),l.add(u.id);l.size>0&&this.nodeChildren.set(s,l)}}};p();function zFo(t){return t.id!==void 0}a(zFo,"isNodeItem");function YFo(t){return!("uri"in t)&&!("id"in t)}a(YFo,"isNullItem");var Hpn={"RecentDocumentProvider.RecentlyOpen":.1,"RecentDocumentProvider.RecentlyFocused":.1,"RecentDocumentProvider.RecentlyEdited":.1,RecentCompletionsRequestProvider:1,"ExtensionActivityProvider.CurrentSelection":5,"ExtensionActivityProvider.PrimarySelection":2,"ExtensionActivityProvider.Selection":.2,"ExtensionActivityProvider.VisibleRange":1,FileDirectoryDocumentProvider:.05,"SymbolContextProvider.Identifiers":.2,"SymbolContextProvider.Text":.2,"IndexingSymbolContextProvider.Text":1,"TreeProximityProvider.Parent":.3,"TreeProximityProvider.Children":.3,"TreeProximityProvider.Siblings":.3,"ExtensionReferenceProvider.References":.2,"ExtensionReferenceProvider.Definitions":1};function Gpn(t){return t in Hpn}a(Gpn,"isSourceId");var UQ="64f5ff7d-e507-4558-81cf-3bdacc3c5c00",Ple=class{static{a(this,"WorkspaceContextWeights")}constructor(e){let r=new Map;for(let{uri:n,weight:o}of e)r.set(n,(r.get(n)??0)+o);this.documents=[...r.entries()].map(([n,o])=>({uri:n,weight:o})).sort((n,o)=>o.weight-n.weight),this.docWeights=r,this.nodes=e.filter(({id:n})=>n!==OC),this.nodeWeights=new Map(e.map(({id:n,weight:o})=>[n,o]))}getNodeWeight(e){return this.nodeWeights.get(e)??0}getDocumentWeight(e){return this.docWeights.get(e)??0}},bWe=class{constructor(e,r){this.activeContext=e;this.config=r;this.sourceWeights=Hpn;this.sourceContext=new Map;this.prevUpdateTime=void 0;this.prevItems=[];this.weights=new Ple([])}static{a(this,"WorkspaceContextCoordinator")}getWeights(e){if(e){let r=this.sourceContext.get(e);return r?new Ple(r.items):new Ple([])}return this.weights}updateWeights(){let e=new Map,r=0,n=this.config.StaleWeightHalflife;for(let[o,{items:s,updateTime:c}]of this.sourceContext.entries()){let l=this.sourceWeights[o]??0;if(l<=0||s.length===0)continue;let u=.5**(-Math.max(0,(this.prevUpdateTime??c)-c)/n);l*=u,r+=l,this.aggregateWeights(s,e,l,!0)}if(r>0){if(this.weights.nodes.length>0){let o=r*this.config.Laziness,s=this.prevItems;this.aggregateWeights(s,e,o,!0)}for(let[o,s]of e.entries()){let c=this.activeContext.getDocument(o)?.document;if(c===void 0)continue;let l=s.get(OC);if(l!==void 0&&l>0){s.delete(OC);let u=0;for(let d of s.values())u+=d;if(u<=0){let d=c.getAllIds(),f=l/Math.max(d.length,1);for(let h of d)s.set(h,f)}else for(let[d,f]of[...s.entries()])s.set(d,f+l*(f/u))}}this.prevItems=this.truncateAndNormalize(e),this.weights=new Ple(this.prevItems)}return this.prevUpdateTime=performance.now(),this.weights}pushWorkspaceContext(e,r){let n=performance.now(),o=this.addUriAndId(r),s=new Map;this.aggregateWeights(o,s);let c=this.truncateAndNormalize(s);this.sourceContext.set(e,{items:c,updateTime:n})}addUriAndId(e){return e.filter(r=>r.weight>0).map(r=>{if(YFo(r))return{weight:r.weight,uri:UQ,id:OC};let n=zFo(r)?r.id:OC,o=r.uri??this.activeContext.getUri(n)??UQ;return o===UQ&&(n=OC),{weight:r.weight,uri:o,id:n}})}aggregateWeights(e,r,n=1,o=!1){for(let{uri:s,id:c,weight:l}of e){if(l<=0||isNaN(l))continue;let u=l0(r,s,()=>new Map),d=OC;(!o||this.activeContext.getUri(c)!==void 0)&&(d=c),u.set(d,(u.get(d)??0)+l*n)}}truncateAndNormalize(e){let r=[],n=new Map,o=0;for(let[u,d]of e.entries()){let f=u!==UQ?this.activeContext.normalizeUri(u)??UQ:UQ;for(let[h,m]of d.entries())u===UQ||h===OC?n.set(f,(n.get(f)??0)+m):r.push({uri:f,id:h,weight:m}),o+=m}if(o<=0)return[];n.delete(UQ),r.sort((u,d)=>d.weight-u.weight);for(let{uri:u,weight:d}of r.slice(this.config.MaxActiveNodes,r.length))n.set(u,(n.get(u)??0)+d);let s=[...n.entries()].sort((u,d)=>d[1]-u[1]).slice(0,this.config.MaxActiveFiles).map(([u,d])=>({uri:u,id:OC,weight:d}));return r.slice(0,this.config.MaxActiveNodes).concat(s).sort((u,d)=>d.weight-u.weight).map(u=>({...u,weight:u.weight/o}))}};p();p();p();var U6t=class{constructor(e,r,n,o=!1){this.id=e;this.parts=r;this.text=n;this.canMerge=o}static{a(this,"ContextNode")}get startOffset(){return this.parts[0].root.startOffset}get endOffset(){return this.parts[this.parts.length-1].root.endOffset}get syntaxRoots(){return this.parts.map(e=>e.root)}get children(){return this.parts.flatMap(e=>e.children)}get syntaxLimits(){return this.children.flatMap(e=>e.syntaxRoots)}*syntaxNodes(){let e=new Set(this.syntaxLimits.map(r=>r.id));for(let r of this.syntaxRoots)yield*$pn(r,e)}findChild(e,r){if(ethis.endOffset||r=r)break;s.root.endOffset=r)break;c.endOffsets.root.startOffset-c.root.startOffset);let n=JFo(e,this.document),o=new U6t(Sf(),e,n,r);return this.nodeById.set(o.id,o),o}buildTree(){let e=this.buildRecursively(this._syntaxRoot);return this.createNode([{root:this._syntaxRoot,children:e}])}buildRecursively(e){if(e.endOffset-e.startOffset({root:o,children:this.buildRecursively(o)}));if(this.canMergeChildren(e))return this.mergeChildren(r);let n=[];for(let{root:o,children:s}of r){if(this.canBeNode(o)&&o.endOffset-o.startOffset-s.reduce((l,u)=>l+(u.endOffset-u.startOffset),0)>=this.minSize){n.push(this.createNode([{root:o,children:s}]));continue}n.push(...s)}return n}mergeChildren(e){if(e.length===0)return[];e.sort((m,g)=>m.root.startOffset-g.root.startOffset);let r=e[e.length-1].root.endOffset-e[0].root.startOffset,n=[];for(let m of e){let g=m.root.endOffset-m.root.startOffset;for(let A of m.children){let y=A.endOffset-A.startOffset;g-=y,r-=y}n.push(g)}if(rm.children);let o=[0],s=0,c=null,l={line:-1,size:-1},u=e[0].root.startOffset,d=e[0].root.range.start.line;for(let m=0;mthis.minSize&&sl.line||A.line==l.line&&A.size>l.size)&&(l=A,c=m)}u=g.root.endOffset,d=g.root.range.end.line,s>=this.maxSize&&(c=c??m,o.push(c+1),m=c,s=0,c=null,l={line:-1,size:-1},u=e[m+1]?.root.startOffset,d=e[m+1]?.root.range.start.line)}o.length==1?o.push(e.length):o[o.length-1]!==e.length&&(o[o.length-1]=e.length);let f=[],h=!1;for(let m=0;mKFo}canBeNode(e){return this.parser.labeler.canBeNode?.(e)??!0}};function JFo(t,e){if(t.length===0)return[""];let r=[],n=e.positionAt(t[0].root.startOffset);for(let s of t.flatMap(c=>c.children).sort((c,l)=>c.startOffset-l.startOffset)){let c=e.positionAt(s.startOffset);r.push(e.getText({start:n,end:c})),n=e.positionAt(s.endOffset)}let o=e.positionAt(t[t.length-1].root.endOffset);return r.push(e.getText({start:n,end:o})),r}a(JFo,"buildText");function*$pn(t,e){yield t;for(let r of t.children)e.has(r.id)||(yield*$pn(r,e))}a($pn,"walk");p();p();p();var TWe=class{constructor(e,r,n,o,s,c){this.id=e;this.raw=r;this.children=n;this.source="indentation";this.parent=null;let l={start:{line:o,character:0},end:{line:s,character:c.lineAt(s).text.length}},u=c.getText(l),d=u.search(/\S/);if(d===-1){let m={line:s,character:0};this.startOffset=c.offsetAt(m),this.endOffset=this.startOffset,this.range={start:m,end:m};return}let f=u.search(/\S(?!.*\S)/s),h=c.offsetAt(l.start);this.startOffset=h+d,this.endOffset=h+f+1,this.range={start:c.positionAt(this.startOffset),end:c.positionAt(this.endOffset)}}static{a(this,"IndentationNode")}get type(){return this.raw.type}};function Q6t(t,e,r){let n=t.subs.map(u=>({subtree:u,node:Q6t(u,e,r)})).filter(u=>u.node!==null).sort((u,d)=>u.node.startOffset-d.node.startOffset),o=[],s=e;for(let u=n.length-1;u>=0;u--){let{subtree:d,node:f}=n[u];if(f.range.end.line>=s){let h=Q6t(d,s,r);h!==null&&(o.push(h),s=Math.min(h.range.start.line,s))}else o.push(f),s=Math.min(f.range.start.line,s)}o.sort((u,d)=>u.startOffset-d.startOffset);let c=e,l=0;if(o.length>0&&(c=Math.min(c,o[0].range.start.line),l=Math.max(l,o[o.length-1].range.end.line)),(t.type==="blank"||t.type==="line")&&(c=Math.min(c,t.lineNumber),l=Math.max(l,t.lineNumber),t.type==="blank"&&c===l))return null;if(l=Math.min(l,e-1),c<=l){let u=new TWe(Sf(),t,o,c,l,r);for(let d of o)d.parent=u;return u}return null}a(Q6t,"recursivelyBuildNode");function Vpn(t){let e=eK(t.getText(),t.detectedLanguageId);return Q6t(e,t.lineCount,t)??new TWe(Sf(),e,[],0,t.lineCount-1,t)}a(Vpn,"parse");var IWe={source:"indentation",parse:Vpn,update(t,e){return{root:Vpn(e),remapper:a(()=>{},"remapper")}},dispose:a(()=>{},"dispose"),labeler:{isIdentifier:a(t=>!1,"isIdentifier"),isText:a(t=>!0,"isText")}};p();p();var zpn=fe(mle());function Wpn(t){return{line:t.row,character:t.column}}a(Wpn,"asPosition");var dO=class{constructor(e,r,n,o){this.nodeList=e;this.mergeList=r;this.identifierList=n;this.textList=o}static{a(this,"BasicNodeLabeler")}canBeNode(e){return this.nodeList.has(e.type)}canMergeChildren(e){return this.mergeList.has(e.type)}isIdentifier(e){return this.identifierList.has(e.type)}isText(e){return this.textList.has(e.type)}},QQ=class{constructor(e,r,n={}){this.language=e;this.source=r;this.labeler=n}static{a(this,"TreeSitterParser")}dispose(){}parse(e){let r,n;try{return r=new zpn.default,r.setLanguage(this.language),n=r.parse(e.getText()),this.snapshot(n.rootNode,null)}catch{return IWe.parse(e)}finally{n?.delete(),r?.delete()}}update(e,r){return{root:this.parse(r),remapper:a(()=>{},"remapper")}}snapshot(e,r){let n={id:e.id,source:this.source,type:e.type,startOffset:e.startIndex,endOffset:e.endIndex,range:{start:Wpn(e.startPosition),end:Wpn(e.endPosition)},parent:r,children:[]};return n.children=e.namedChildren.map(o=>this.snapshot(o,n)),n}};var ZFo=new Set(["class_specifier","function_definition","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement","compound_statement"]),XFo=new Set(["translation_unit","compound_statement","parameter_list","argument_list"]),e8o=new Set(["identifier"]),t8o=new Set(["string","comment"]),Ypn=new dO(ZFo,XFo,e8o,t8o);p();var r8o=new Set(["class_declaration","method_declaration","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement"]),n8o=new Set(["program","block","object_creation_expression","formal_parameters","argument_list","array_initializer"]),i8o=new Set(["identifier"]),o8o=new Set(["string_literal","line_comment","block_comment"]),Kpn=new dO(r8o,n8o,i8o,o8o);p();var s8o=new Set(["class_definition","function_definition","expression_statement","if_statement","for_statement","while_statement","with_statement","try_statement"]),a8o=new Set(["module","block","parameters","dictionary","list"]),c8o=new Set(["identifier"]),l8o=new Set(["string","comment"]),Jpn=new dO(s8o,a8o,c8o,l8o);p();var u8o=new Set(["class_declaration","function_declaration","arrow_function","method_definition","expression_statement","if_statement","while_statement","try_statement","for_statement","switch_statement"]),d8o=new Set(["program","statement_block","formal_parameters","arguments","object","array"]),f8o=new Set(["identifier"]),p8o=new Set(["string","comment"]),Zpn=new dO(u8o,d8o,f8o,p8o);var Xpn=fe(mle());async function ehn(t){await Xpn.default.init();try{let e=await z8t(t);switch(t){case"python":return new QQ(e,"tree-sitter-python",Jpn);case"typescript":return new QQ(e,"tree-sitter-typescript",Zpn);case"java":return new QQ(e,"tree-sitter-java",Kpn);case"cpp":return new QQ(e,"tree-sitter-cpp",Ypn);default:return new QQ(e,"tree-sitter-generic")}}catch{return IWe}}a(ehn,"getParser");var q6t=class{constructor(e,r){this.created=e;this.invalidated=r;this.updatedDocuments=Array.from(new Set([...e.entries(),...r.entries()].filter(([n,o])=>o.size>0).map(([n,o])=>n)))}static{a(this,"WorkspaceContextChanges")}getInvalidatedNodes(e){return this.getNodes(this.invalidated,e)}getCreatedNodes(e){return this.getNodes(this.created,e)}getNodes(e,r){return r===void 0?Array.from(e.entries()).flatMap(([n,o])=>[...o].map(s=>({uri:n,id:s}))):Array.from(e.get(r)??[]).map(n=>({uri:r,id:n}))}},xWe=class{constructor(e,r){this.item=e;this.disposalCallback=r}static{a(this,"CachedItem")}dispose(){this.disposalCallback(this.item)}},thn=500,wWe=class{constructor(e,r){this.fileSystem=e;this.config=r;this.targetSet=new Set;this.activeDocuments=new Map;this.nodeToDoc=new Map;this.createdNodes=new Map;this.invalidatedNodes=new Map;this.parsers=new Map;this.staleDocuments=new Set;this.pendingUpdates=new Map;this.uriCache=new Cn(thn);this.allowedExtensions=new Set(PQ);this.invalidDocumentCache=new Qk(thn,this.config.InvalidCacheTime),this.cachedDocuments=new uUe(this.config.MaxActiveFiles),this.fileSystem.onDidFileChange(n=>this.handleFileChange(n.document.uri))}static{a(this,"WorkspaceContextDocumentManager")}setAllowedLanguages(e){this.allowedExtensions=new Set(e.flatMap(r=>w3[r]?.extensions??[]))}getActiveDocuments(){return Array.from(this.activeDocuments.values())}getNode(e){let r=this.nodeToDoc.get(e);if(r===void 0)return;let n=this.getDocument(r);if(n===void 0)return;let o=n.document.getNode(e);if(o!==void 0)return{...n,node:o}}getDocument(e){let r=this.activeDocuments.get(e);if(r!==void 0)return{document:r,isActive:!0};let n=this.cachedDocuments.get(e);if(n!==void 0)return{document:n.item,isActive:!1}}getUri(e){return this.nodeToDoc.get(e)}normalizeUri(e){let r,n=this.uriCache.get(e);if(n!==null){if(n!==void 0)r=n;else try{if(N7e(e),r=Fs(e),!(this.fileSystem.getWorkspaceFolder({uri:r})!==void 0)){this.uriCache.set(e,null);return}this.uriCache.set(e,r)}catch{this.uriCache.set(e,null);return}if(!(!this.allowedExtensions.has(QJr(r))||this.invalidDocumentCache.has(r)))return r}}dispose(){this.parsers.clear(),this.activeDocuments.clear(),this.cachedDocuments.clear()}updateDocuments(e){this.targetSet.clear();let r=[],n=e.documents.map(({uri:o})=>this.normalizeUri(o)).filter(o=>o!==void 0).slice(0,this.config.MaxActiveFiles);for(let o of n)this.targetSet.add(o),r.push(this.updateDocument(o));for(let o of[...this.activeDocuments.keys()])this.targetSet.has(o)||this.deactivateDocument(o);return Promise.all(r)}popChanges(){let e=new q6t(this.createdNodes,this.invalidatedNodes);return this.createdNodes=new Map,this.invalidatedNodes=new Map,e}isKnownDocument(e){return this.activeDocuments.has(e)||this.cachedDocuments.has(e)||this.pendingUpdates.has(e)}deactivateDocument(e){let r=this.activeDocuments.get(e);r!==void 0&&(this.activeDocuments.delete(e),this.pendingUpdates.has(e)||this.cachedDocuments.set(e,new xWe(r,n=>this.disposeDocument(n))))}async updateDocument(e){if(this.pendingUpdates.has(e))return;let r=new kA;this.pendingUpdates.set(e,r.promise);let n;this.activeDocuments.has(e)?n=this.activeDocuments.get(e):this.cachedDocuments.has(e)&&(n=this.cachedDocuments.get(e).item,this.cachedDocuments.uncache(e)),(n===void 0||this.staleDocuments.has(e))&&(this.staleDocuments.delete(e),n=await this.createUpdatedDocument(e,n)),n!==void 0&&(this.targetSet.has(e)?this.activeDocuments.set(e,n):(this.activeDocuments.delete(e),this.cachedDocuments.set(e,new xWe(n,o=>this.disposeDocument(o))))),this.pendingUpdates.delete(e),r.resolve()}async createUpdatedDocument(e,r){let n=await this.readTextDocument(e);if(n===void 0){r!==void 0&&this.disposeDocument(r);return}let o;try{o=await this.getParser(n.detectedLanguageId)}catch{this.invalidDocumentCache.set(e,!0),r!==void 0&&this.disposeDocument(r);return}if(r!==void 0)if(n.detectedLanguageId!==r.document.detectedLanguageId)this.disposeDocument(r);else{let c=new Set(r.getAllIds());r.update(n);let l=new Set(r.getAllIds()),u=[...l].filter(f=>!c.has(f)),d=[...c].filter(f=>!l.has(f));return this.recordDocumentChanges(e,{created:u,invalidated:d}),r}let s=new SWe(n,o,this.config.MinNodeSize);return this.recordDocumentChanges(e,{created:s.getAllIds(),invalidated:[]}),s}disposeDocument(e){this.recordDocumentChanges(e.uri,{created:[],invalidated:e.getAllIds()})}recordDocumentChanges(e,r){let n=l0(this.createdNodes,e,()=>new Set),o=l0(this.invalidatedNodes,e,()=>new Set);for(let s of r.created)n.add(s),this.nodeToDoc.set(s,e);for(let s of r.invalidated)n.has(s)?n.delete(s):o.add(s),this.nodeToDoc.delete(s)}async getParser(e){let r=this.parsers.get(e);return r===void 0&&(r=await ehn(e),this.parsers.set(e,r)),r}async readTextDocument(e){if(this.invalidDocumentCache.has(e)||this.normalizeUri(e)===void 0)return;let r=await this.fileSystem.readValidFile({uri:e});if(r.status!=="valid"||r.document.uri!==e){this.invalidDocumentCache.set(e,!0);return}return r.document}handleFileChange(e){this.isKnownDocument(e)&&this.staleDocuments.add(e)}};p();var h8o="WorkspaceContextWorker";function j6t(t){let e=t;return e?.workerId===h8o&&typeof e?.cwd=="string"&&Array.isArray(e?.workspaceRoots)&&e.workspaceRoots.every(r=>typeof r=="string")}a(j6t,"isContextWorkerData");var m8o=["RequestUpdate","Exit","ReadAndValidateUri","Error","UpdateResponse","FlushUpdates","ReadAndValidateResponse"];function rhn(t){if(typeof t!="object"||t===null)return;let e=t.messageType;return m8o.includes(e)?e:void 0}a(rhn,"getContextMessageType");var qQ=class{constructor(e,r,n){this.id=e;this.messageType=r;this.data=n}static{a(this,"ContextMessage")}};p();G6t();p();var ahn;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(ahn||(ahn={}));var $6t;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})($6t||($6t={}));var chn;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}a(e,"is"),t.is=e})(chn||(chn={}));var kWe;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}a(e,"is"),t.is=e})(kWe||(kWe={}));var cE;(function(t){function e(n,o){return n===Number.MAX_VALUE&&(n=kWe.MAX_VALUE),o===Number.MAX_VALUE&&(o=kWe.MAX_VALUE),{line:n,character:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.uinteger(o.line)&&mt.uinteger(o.character)}a(r,"is"),t.is=r})(cE||(cE={}));var gu;(function(t){function e(n,o,s,c){if(mt.uinteger(n)&&mt.uinteger(o)&&mt.uinteger(s)&&mt.uinteger(c))return{start:cE.create(n,o),end:cE.create(s,c)};if(cE.is(n)&&cE.is(o))return{start:n,end:o};throw new Error(`Range#create called with invalid arguments[${n}, ${o}, ${s}, ${c}]`)}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&cE.is(o.start)&&cE.is(o.end)}a(r,"is"),t.is=r})(gu||(gu={}));var PWe;(function(t){function e(n,o){return{uri:n,range:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&gu.is(o.range)&&(mt.string(o.uri)||mt.undefined(o.uri))}a(r,"is"),t.is=r})(PWe||(PWe={}));var lhn;(function(t){function e(n,o,s,c){return{targetUri:n,targetRange:o,targetSelectionRange:s,originSelectionRange:c}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&gu.is(o.targetRange)&&mt.string(o.targetUri)&&gu.is(o.targetSelectionRange)&&(gu.is(o.originSelectionRange)||mt.undefined(o.originSelectionRange))}a(r,"is"),t.is=r})(lhn||(lhn={}));var V6t;(function(t){function e(n,o,s,c){return{red:n,green:o,blue:s,alpha:c}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.numberRange(o.red,0,1)&&mt.numberRange(o.green,0,1)&&mt.numberRange(o.blue,0,1)&&mt.numberRange(o.alpha,0,1)}a(r,"is"),t.is=r})(V6t||(V6t={}));var uhn;(function(t){function e(n,o){return{range:n,color:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&gu.is(o.range)&&V6t.is(o.color)}a(r,"is"),t.is=r})(uhn||(uhn={}));var dhn;(function(t){function e(n,o,s){return{label:n,textEdit:o,additionalTextEdits:s}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.string(o.label)&&(mt.undefined(o.textEdit)||Nle.is(o))&&(mt.undefined(o.additionalTextEdits)||mt.typedArray(o.additionalTextEdits,Nle.is))}a(r,"is"),t.is=r})(dhn||(dhn={}));var fhn;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(fhn||(fhn={}));var phn;(function(t){function e(n,o,s,c,l,u){let d={startLine:n,endLine:o};return mt.defined(s)&&(d.startCharacter=s),mt.defined(c)&&(d.endCharacter=c),mt.defined(l)&&(d.kind=l),mt.defined(u)&&(d.collapsedText=u),d}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.uinteger(o.startLine)&&mt.uinteger(o.startLine)&&(mt.undefined(o.startCharacter)||mt.uinteger(o.startCharacter))&&(mt.undefined(o.endCharacter)||mt.uinteger(o.endCharacter))&&(mt.undefined(o.kind)||mt.string(o.kind))}a(r,"is"),t.is=r})(phn||(phn={}));var W6t;(function(t){function e(n,o){return{location:n,message:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&PWe.is(o.location)&&mt.string(o.message)}a(r,"is"),t.is=r})(W6t||(W6t={}));var hhn;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(hhn||(hhn={}));var mhn;(function(t){t.Unnecessary=1,t.Deprecated=2})(mhn||(mhn={}));var ghn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&mt.string(n.href)}a(e,"is"),t.is=e})(ghn||(ghn={}));var DWe;(function(t){function e(n,o,s,c,l,u){let d={range:n,message:o};return mt.defined(s)&&(d.severity=s),mt.defined(c)&&(d.code=c),mt.defined(l)&&(d.source=l),mt.defined(u)&&(d.relatedInformation=u),d}a(e,"create"),t.create=e;function r(n){var o;let s=n;return mt.defined(s)&&gu.is(s.range)&&mt.string(s.message)&&(mt.number(s.severity)||mt.undefined(s.severity))&&(mt.integer(s.code)||mt.string(s.code)||mt.undefined(s.code))&&(mt.undefined(s.codeDescription)||mt.string((o=s.codeDescription)===null||o===void 0?void 0:o.href))&&(mt.string(s.source)||mt.undefined(s.source))&&(mt.undefined(s.relatedInformation)||mt.typedArray(s.relatedInformation,W6t.is))}a(r,"is"),t.is=r})(DWe||(DWe={}));var Dle;(function(t){function e(n,o,...s){let c={title:n,command:o};return mt.defined(s)&&s.length>0&&(c.arguments=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.title)&&mt.string(o.command)}a(r,"is"),t.is=r})(Dle||(Dle={}));var Nle;(function(t){function e(s,c){return{range:s,newText:c}}a(e,"replace"),t.replace=e;function r(s,c){return{range:{start:s,end:s},newText:c}}a(r,"insert"),t.insert=r;function n(s){return{range:s,newText:""}}a(n,"del"),t.del=n;function o(s){let c=s;return mt.objectLiteral(c)&&mt.string(c.newText)&&gu.is(c.range)}a(o,"is"),t.is=o})(Nle||(Nle={}));var z6t;(function(t){function e(n,o,s){let c={label:n};return o!==void 0&&(c.needsConfirmation=o),s!==void 0&&(c.description=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.string(o.label)&&(mt.boolean(o.needsConfirmation)||o.needsConfirmation===void 0)&&(mt.string(o.description)||o.description===void 0)}a(r,"is"),t.is=r})(z6t||(z6t={}));var Mle;(function(t){function e(r){let n=r;return mt.string(n)}a(e,"is"),t.is=e})(Mle||(Mle={}));var Ahn;(function(t){function e(s,c,l){return{range:s,newText:c,annotationId:l}}a(e,"replace"),t.replace=e;function r(s,c,l){return{range:{start:s,end:s},newText:c,annotationId:l}}a(r,"insert"),t.insert=r;function n(s,c){return{range:s,newText:"",annotationId:c}}a(n,"del"),t.del=n;function o(s){let c=s;return Nle.is(c)&&(z6t.is(c.annotationId)||Mle.is(c.annotationId))}a(o,"is"),t.is=o})(Ahn||(Ahn={}));var Y6t;(function(t){function e(n,o){return{textDocument:n,edits:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&e9t.is(o.textDocument)&&Array.isArray(o.edits)}a(r,"is"),t.is=r})(Y6t||(Y6t={}));var K6t;(function(t){function e(n,o,s){let c={kind:"create",uri:n};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(c.options=o),s!==void 0&&(c.annotationId=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="create"&&mt.string(o.uri)&&(o.options===void 0||(o.options.overwrite===void 0||mt.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||mt.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||Mle.is(o.annotationId))}a(r,"is"),t.is=r})(K6t||(K6t={}));var J6t;(function(t){function e(n,o,s,c){let l={kind:"rename",oldUri:n,newUri:o};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),c!==void 0&&(l.annotationId=c),l}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="rename"&&mt.string(o.oldUri)&&mt.string(o.newUri)&&(o.options===void 0||(o.options.overwrite===void 0||mt.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||mt.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||Mle.is(o.annotationId))}a(r,"is"),t.is=r})(J6t||(J6t={}));var Z6t;(function(t){function e(n,o,s){let c={kind:"delete",uri:n};return o!==void 0&&(o.recursive!==void 0||o.ignoreIfNotExists!==void 0)&&(c.options=o),s!==void 0&&(c.annotationId=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="delete"&&mt.string(o.uri)&&(o.options===void 0||(o.options.recursive===void 0||mt.boolean(o.options.recursive))&&(o.options.ignoreIfNotExists===void 0||mt.boolean(o.options.ignoreIfNotExists)))&&(o.annotationId===void 0||Mle.is(o.annotationId))}a(r,"is"),t.is=r})(Z6t||(Z6t={}));var X6t;(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(o=>mt.string(o.kind)?K6t.is(o)||J6t.is(o)||Z6t.is(o):Y6t.is(o)))}a(e,"is"),t.is=e})(X6t||(X6t={}));var yhn;(function(t){function e(n){return{uri:n}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)}a(r,"is"),t.is=r})(yhn||(yhn={}));var Ehn;(function(t){function e(n,o){return{uri:n,version:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)&&mt.integer(o.version)}a(r,"is"),t.is=r})(Ehn||(Ehn={}));var e9t;(function(t){function e(n,o){return{uri:n,version:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)&&(o.version===null||mt.integer(o.version))}a(r,"is"),t.is=r})(e9t||(e9t={}));var _hn;(function(t){function e(n,o,s,c){return{uri:n,languageId:o,version:s,text:c}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)&&mt.string(o.languageId)&&mt.integer(o.version)&&mt.string(o.text)}a(r,"is"),t.is=r})(_hn||(_hn={}));var t9t;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}a(e,"is"),t.is=e})(t9t||(t9t={}));var QIe;(function(t){function e(r){let n=r;return mt.objectLiteral(r)&&t9t.is(n.kind)&&mt.string(n.value)}a(e,"is"),t.is=e})(QIe||(QIe={}));var vhn;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(vhn||(vhn={}));var Chn;(function(t){t.PlainText=1,t.Snippet=2})(Chn||(Chn={}));var bhn;(function(t){t.Deprecated=1})(bhn||(bhn={}));var Shn;(function(t){function e(n,o,s){return{newText:n,insert:o,replace:s}}a(e,"create"),t.create=e;function r(n){let o=n;return o&&mt.string(o.newText)&&gu.is(o.insert)&&gu.is(o.replace)}a(r,"is"),t.is=r})(Shn||(Shn={}));var Thn;(function(t){t.asIs=1,t.adjustIndentation=2})(Thn||(Thn={}));var Ihn;(function(t){function e(r){let n=r;return n&&(mt.string(n.detail)||n.detail===void 0)&&(mt.string(n.description)||n.description===void 0)}a(e,"is"),t.is=e})(Ihn||(Ihn={}));var xhn;(function(t){function e(r){return{label:r}}a(e,"create"),t.create=e})(xhn||(xhn={}));var whn;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}a(e,"create"),t.create=e})(whn||(whn={}));var NWe;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(e,"fromPlainText"),t.fromPlainText=e;function r(n){let o=n;return mt.string(o)||mt.objectLiteral(o)&&mt.string(o.language)&&mt.string(o.value)}a(r,"is"),t.is=r})(NWe||(NWe={}));var Rhn;(function(t){function e(r){let n=r;return!!n&&mt.objectLiteral(n)&&(QIe.is(n.contents)||NWe.is(n.contents)||mt.typedArray(n.contents,NWe.is))&&(r.range===void 0||gu.is(r.range))}a(e,"is"),t.is=e})(Rhn||(Rhn={}));var khn;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}a(e,"create"),t.create=e})(khn||(khn={}));var Phn;(function(t){function e(r,n,...o){let s={label:r};return mt.defined(n)&&(s.documentation=n),mt.defined(o)?s.parameters=o:s.parameters=[],s}a(e,"create"),t.create=e})(Phn||(Phn={}));var Dhn;(function(t){t.Text=1,t.Read=2,t.Write=3})(Dhn||(Dhn={}));var Nhn;(function(t){function e(r,n){let o={range:r};return mt.number(n)&&(o.kind=n),o}a(e,"create"),t.create=e})(Nhn||(Nhn={}));var Mhn;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(Mhn||(Mhn={}));var Ohn;(function(t){t.Deprecated=1})(Ohn||(Ohn={}));var Lhn;(function(t){function e(r,n,o,s,c){let l={name:r,kind:n,location:{uri:s,range:o}};return c&&(l.containerName=c),l}a(e,"create"),t.create=e})(Lhn||(Lhn={}));var Bhn;(function(t){function e(r,n,o,s){return s!==void 0?{name:r,kind:n,location:{uri:o,range:s}}:{name:r,kind:n,location:{uri:o}}}a(e,"create"),t.create=e})(Bhn||(Bhn={}));var Fhn;(function(t){function e(n,o,s,c,l,u){let d={name:n,detail:o,kind:s,range:c,selectionRange:l};return u!==void 0&&(d.children=u),d}a(e,"create"),t.create=e;function r(n){let o=n;return o&&mt.string(o.name)&&mt.number(o.kind)&&gu.is(o.range)&&gu.is(o.selectionRange)&&(o.detail===void 0||mt.string(o.detail))&&(o.deprecated===void 0||mt.boolean(o.deprecated))&&(o.children===void 0||Array.isArray(o.children))&&(o.tags===void 0||Array.isArray(o.tags))}a(r,"is"),t.is=r})(Fhn||(Fhn={}));var Uhn;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(Uhn||(Uhn={}));var MWe;(function(t){t.Invoked=1,t.Automatic=2})(MWe||(MWe={}));var Qhn;(function(t){function e(n,o,s){let c={diagnostics:n};return o!=null&&(c.only=o),s!=null&&(c.triggerKind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.typedArray(o.diagnostics,DWe.is)&&(o.only===void 0||mt.typedArray(o.only,mt.string))&&(o.triggerKind===void 0||o.triggerKind===MWe.Invoked||o.triggerKind===MWe.Automatic)}a(r,"is"),t.is=r})(Qhn||(Qhn={}));var qhn;(function(t){function e(n,o,s){let c={title:n},l=!0;return typeof o=="string"?(l=!1,c.kind=o):Dle.is(o)?c.command=o:c.edit=o,l&&s!==void 0&&(c.kind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&mt.string(o.title)&&(o.diagnostics===void 0||mt.typedArray(o.diagnostics,DWe.is))&&(o.kind===void 0||mt.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||Dle.is(o.command))&&(o.isPreferred===void 0||mt.boolean(o.isPreferred))&&(o.edit===void 0||X6t.is(o.edit))}a(r,"is"),t.is=r})(qhn||(qhn={}));var jhn;(function(t){function e(n,o){let s={range:n};return mt.defined(o)&&(s.data=o),s}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&gu.is(o.range)&&(mt.undefined(o.command)||Dle.is(o.command))}a(r,"is"),t.is=r})(jhn||(jhn={}));var Hhn;(function(t){function e(n,o){return{tabSize:n,insertSpaces:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.uinteger(o.tabSize)&&mt.boolean(o.insertSpaces)}a(r,"is"),t.is=r})(Hhn||(Hhn={}));var Ghn;(function(t){function e(n,o,s){return{range:n,target:o,data:s}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&gu.is(o.range)&&(mt.undefined(o.target)||mt.string(o.target))}a(r,"is"),t.is=r})(Ghn||(Ghn={}));var $hn;(function(t){function e(n,o){return{range:n,parent:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&gu.is(o.range)&&(o.parent===void 0||t.is(o.parent))}a(r,"is"),t.is=r})($hn||($hn={}));var Vhn;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Vhn||(Vhn={}));var Whn;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(Whn||(Whn={}));var zhn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}a(e,"is"),t.is=e})(zhn||(zhn={}));var Yhn;(function(t){function e(n,o){return{range:n,text:o}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&gu.is(o.range)&&mt.string(o.text)}a(r,"is"),t.is=r})(Yhn||(Yhn={}));var Khn;(function(t){function e(n,o,s){return{range:n,variableName:o,caseSensitiveLookup:s}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&gu.is(o.range)&&mt.boolean(o.caseSensitiveLookup)&&(mt.string(o.variableName)||o.variableName===void 0)}a(r,"is"),t.is=r})(Khn||(Khn={}));var Jhn;(function(t){function e(n,o){return{range:n,expression:o}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&gu.is(o.range)&&(mt.string(o.expression)||o.expression===void 0)}a(r,"is"),t.is=r})(Jhn||(Jhn={}));var Zhn;(function(t){function e(n,o){return{frameId:n,stoppedLocation:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&gu.is(n.stoppedLocation)}a(r,"is"),t.is=r})(Zhn||(Zhn={}));var r9t;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(r9t||(r9t={}));var n9t;(function(t){function e(n){return{value:n}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&(o.tooltip===void 0||mt.string(o.tooltip)||QIe.is(o.tooltip))&&(o.location===void 0||PWe.is(o.location))&&(o.command===void 0||Dle.is(o.command))}a(r,"is"),t.is=r})(n9t||(n9t={}));var Xhn;(function(t){function e(n,o,s){let c={position:n,label:o};return s!==void 0&&(c.kind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&cE.is(o.position)&&(mt.string(o.label)||mt.typedArray(o.label,n9t.is))&&(o.kind===void 0||r9t.is(o.kind))&&o.textEdits===void 0||mt.typedArray(o.textEdits,Nle.is)&&(o.tooltip===void 0||mt.string(o.tooltip)||QIe.is(o.tooltip))&&(o.paddingLeft===void 0||mt.boolean(o.paddingLeft))&&(o.paddingRight===void 0||mt.boolean(o.paddingRight))}a(r,"is"),t.is=r})(Xhn||(Xhn={}));var emn;(function(t){function e(r){return{kind:"snippet",value:r}}a(e,"createSnippet"),t.createSnippet=e})(emn||(emn={}));var tmn;(function(t){function e(r,n,o,s){return{insertText:r,filterText:n,range:o,command:s}}a(e,"create"),t.create=e})(tmn||(tmn={}));var rmn;(function(t){function e(r){return{items:r}}a(e,"create"),t.create=e})(rmn||(rmn={}));var nmn;(function(t){t.Invoked=0,t.Automatic=1})(nmn||(nmn={}));var imn;(function(t){function e(r,n){return{range:r,text:n}}a(e,"create"),t.create=e})(imn||(imn={}));var omn;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}a(e,"create"),t.create=e})(omn||(omn={}));var smn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&$6t.is(n.uri)&&mt.string(n.name)}a(e,"is"),t.is=e})(smn||(smn={}));var amn;(function(t){function e(s,c,l,u){return new i9t(s,c,l,u)}a(e,"create"),t.create=e;function r(s){let c=s;return!!(mt.defined(c)&&mt.string(c.uri)&&(mt.undefined(c.languageId)||mt.string(c.languageId))&&mt.uinteger(c.lineCount)&&mt.func(c.getText)&&mt.func(c.positionAt)&&mt.func(c.offsetAt))}a(r,"is"),t.is=r;function n(s,c){let l=s.getText(),u=o(c,(f,h)=>{let m=f.range.start.line-h.range.start.line;return m===0?f.range.start.character-h.range.start.character:m}),d=l.length;for(let f=u.length-1;f>=0;f--){let h=u[f],m=s.offsetAt(h.range.start),g=s.offsetAt(h.range.end);if(g<=d)l=l.substring(0,m)+h.newText+l.substring(g,l.length);else throw new Error("Overlapping edit");d=m}return l}a(n,"applyEdits"),t.applyEdits=n;function o(s,c){if(s.length<=1)return s;let l=s.length/2|0,u=s.slice(0,l),d=s.slice(l);o(u,c),o(d,c);let f=0,h=0,m=0;for(;f0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,o=r.length;if(o===0)return iE.create(0,e);for(;ne?o=c:n=c+1}let s=n-1;return iE.create(s,e-r[s])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],o=e.line+1"u"}a(n,"undefined"),t.undefined=n;function o(g){return g===!0||g===!1}a(o,"boolean"),t.boolean=o;function s(g){return e.call(g)==="[object String]"}a(s,"string"),t.string=s;function c(g){return e.call(g)==="[object Number]"}a(c,"number"),t.number=c;function l(g,A,y){return e.call(g)==="[object Number]"&&A<=g&&g<=y}a(l,"numberRange"),t.numberRange=l;function u(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}a(u,"integer"),t.integer=u;function d(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}a(d,"uinteger"),t.uinteger=d;function f(g){return e.call(g)==="[object Function]"}a(f,"func"),t.func=f;function h(g){return g!==null&&typeof g=="object"}a(h,"objectLiteral"),t.objectLiteral=h;function m(g,A){return Array.isArray(g)&&g.every(A)}a(m,"typedArray"),t.typedArray=m})(mt||(mt={}));var gu=class{static{a(this,"LocationFactory")}static{this.range=mu.create.bind(mu)}static{this.position=iE.create.bind(iE)}},NS=class t{constructor(e,r,n){this.uri=e;this._textDocument=r;this.detectedLanguageId=n}static{a(this,"CopilotTextDocument")}static withChanges(e,r,n){let o=S3.create(e.clientUri,e.clientLanguageId,n,e.getText());return S3.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=S3.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return S3.update(r,e.map(n=>({text:n.newText,range:n.range})),this.version),new t(this.uri,r,this.detectedLanguageId)}static create(e,r,n,o,s=nO({uri:e,languageId:r})){return new t(Fs(e),S3.create(e,r,n,o),s)}get clientUri(){return this._textDocument.uri}get clientLanguageId(){return this._textDocument.languageId}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){let r=typeof e=="number"?e:e.line;if(r<0||r>=this.lineCount)throw new RangeError("Illegal value for lineNumber");let n=mu.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=mu.create(iE.create(r,0),iE.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};var oO=require("worker_threads");var u3o=5,rhn=3e4,O6t=class extends SQ{constructor(r){super();this.worker=r;this.didChangeEmitter=new Wi;this.onDidFileChange=this.didChangeEmitter.event;this.workspaceFolders=[]}static{a(this,"ContextWorkerFileSystem")}setWorkspaceFolders(r){this.workspaceFolders=r.map(n=>Fs(n))}getWorkspaceFolder(r){let n=Fs(r.uri);for(let o of this.workspaceFolders)if(n.startsWith(o))return o}async readValidFile(r){try{let n=await this.worker.readAndValidateUri(r.uri);return n.valid?{status:"valid",document:NS.create(n.uri,"UNKNOWN",-1,n.text)}:{status:"invalid",reason:`Invalid file ${r.uri}`}}catch{return{status:"invalid",reason:`Invalid file ${r.uri}`}}}},L6t=class{constructor(e,r,n){this.nextId=-1;this.activeValidations=new Map;this.validationQueue=new Map;this.fileSystem=new O6t(this);this.providers=[];this.port=e,this.port.on("message",o=>{o&&typeof o=="object"&&o.__perf__&&this.port.postMessage({__perf__:!0,memoryUsage:process.memoryUsage()})}),this.port.on("message",o=>{this.handleMessage(o)}),this.fileSystem.setWorkspaceFolders(r),this.documentManager=new rWe(this.fileSystem,n),this.coordinator=new JVe(this.documentManager,n),this.recentActivityProvider=new YVe,this.providers.push(this.recentActivityProvider)}static{a(this,"ContextWorker")}addLocalProvider(e){this.providers.push(e)}async handleMessage(e){if(e&&typeof e=="object"&&e.__perf__)return;if(!Kfn(e)||typeof e.id!="number"){this.port.postMessage({error:new Error(`Received unrecognized context worker message: ${JSON.stringify(e)}`)});return}let n=e;try{await this.handleMessageUnsafe(n)}catch(o){this.port.postMessage(new kQ(n.id,"Error",o))}}async handleMessageUnsafe(e){switch(e.messageType){case"Exit":this.exit(),this.port.postMessage(new kQ(e.id,"Exit",void 0)),this.port?.close();break;case"RequestUpdate":await this.updateContext(e);break;case"ReadAndValidateResponse":this.settleValidation(e);break;default:throw new Error(`Received inappropriate context client message: ${JSON.stringify(e)}`)}}readAndValidateUri(e){let r=this.validationQueue.get(e)?.deferred;if(!r){let n=this.nextId--,o=setTimeout(()=>{let s=this.activeValidations.get(n)??this.validationQueue.get(e);s&&s.id===n&&(s.deferred.reject(new Error(`Validation timed out after ${rhn}ms`)),this.activeValidations.delete(n)||this.validationQueue.delete(e),this.advanceValidationQueue())},rhn);r=new vA,this.validationQueue.set(e,{id:n,uri:e,deferred:r,timeout:o}),this.advanceValidationQueue()}return r.promise}advanceValidationQueue(){for(;this.validationQueue.size>0&&this.activeValidations.sizer.getNodeWeight(h.id)??0),c[d.uri]=f}this.port.postMessage(new kQ(e.id,"UpdateResponse",{documents:c}));let l=[];for(let d of this.providers)l.push(u6t(d.getContext(n,r,this.documentManager)));let u=await Promise.all(l);for(let d of u)if(d.status==="error"){let f=d.reason instanceof Error?d.reason:new Error(String(d.reason));this.port.postMessage(new kQ(e.id,"Error",f))}else for(let f of d.value??[])this.coordinator.pushWorkspaceContext(f.source,[f])}exit(){for(let e of this.providers)e.dispose();this.providers=[],this.documentManager.dispose()}};function B6t(){return oO.parentPort!==null&&y6t(oO.workerData)}a(B6t,"isContextWorker");function nhn(){if(!B6t())throw new Error("This must be run in a worker thread.");if(!y6t(oO.workerData))throw new Error(`Invalid worker data for context worker: ${JSON.stringify(oO.workerData)}`);let t=oO.workerData.cwd;process.cwd=()=>t;let e=new L6t(oO.parentPort,oO.workerData.workspaceRoots,oO.workerData.config);e.addLocalProvider(new $Ve(e.fileSystem,e.documentManager)),e.addLocalProvider(new zVe(e.fileSystem,e.documentManager)),e.addLocalProvider(new KVe)}a(nhn,"runContextWorker");p();var vIe=de(require("util"));function ihn(t){let e=new console.Console(process.stderr,process.stderr);function r(n,...o){if(MU(t)==="dev")return t.get(qf).logIt(t,n,"console",...o)}return a(r,"logIt"),e.debug=(...n)=>r(4,...n),e.info=(...n)=>r(3,...n),e.warn=(...n)=>r(2,...n),e.error=(...n)=>r(1,...n),e.assert=(n,...o)=>{n||(o.length===0?r(2,"Assertion failed"):r(2,"Assertion failed:",vIe.format(...o)))},e.dir=(n,o)=>r(4,vIe.inspect(n,o)),e.log=e.debug.bind(e),e.trace=(...n)=>{let o=new Error(vIe.format(...n));o.name="Trace",e.log(o)},e}a(ihn,"createConsole");p();p();var uWe=de(require("path")),ohn=require("worker_threads");var dWe=new Map,d3o=0;function CIe(t,e){let r=d3o++;dWe.set(r,{worker:t,name:e});let n=t.removeAllListeners.bind(t),o=!1,s=a(()=>{o||(o=!0,dWe.delete(r),t.removeListener("exit",s),t.removeAllListeners===c&&(t.removeAllListeners=n))},"unregisterWorker"),c=a((l=>((l===void 0||l==="exit")&&s(),n(l))),"patchedRemoveAllListeners");return t.removeAllListeners=c,t.once("exit",s),s}a(CIe,"registerWorker");function shn(t,e){let r=new ohn.Worker(uWe.default.resolve(f3o(),t),{workerData:e});return CIe(r,t),r}a(shn,"createWorker");function f3o(){return uWe.default.extname(__filename)!==".ts"?__dirname:uWe.default.resolve(__dirname,"../../dist")}a(f3o,"workerBundleDir");function ahn(){return dWe.size}a(ahn,"getActiveWorkerCount");async function chn(){let t=[],e=[];for(let[r,{worker:n,name:o}]of dWe)e.push(new Promise(s=>{let c=setTimeout(()=>{n.removeListener("message",l),s()},1e3);c.unref();let l=a(u=>{if(u&&typeof u=="object"&&u.__perf__){clearTimeout(c),n.removeListener("message",l);let f=u.memoryUsage;t.push({id:r,name:o,heapUsedBytes:f?.heapUsed??0,heapTotalBytes:f?.heapTotal??0,externalBytes:f?.external??0,arrayBufferBytes:f?.arrayBuffers??0}),s()}},"handler");n.on("message",l);try{n.postMessage({__perf__:!0})}catch{clearTimeout(c),n.removeListener("message",l),s()}}));return await Promise.allSettled(e),t}a(chn,"collectWorkerPerfStats");var fWe=de(require("os")),lhn=de(require("v8"));function p3o(t){let e=Ft(t,Ye.PerfEnabled);return e==="false"||e===!1?{enabled:!1,shouldSample:!1}:e==="true"||e===!0?{enabled:!0,shouldSample:!0}:{enabled:!0,shouldSample:Math.random()<.01}}a(p3o,"getPerfState");var GY=class t{constructor(e){this.ctx=e;this.sampled=!1;this.pendingTimeouts=[];this.lastCpuUsage=process.cpuUsage();this.lastCpuTime=Date.now();this.lastHighRssTime=0}static{a(this,"PerfMonitor")}static{this.HIGH_RSS_BYTES=2*1024*1024*1024}start(){this.sampled=p3o(this.ctx).shouldSample,this.sampled&&(this.scheduleTimeout(()=>{this.emitSnapshot("startup_30s")},3e4),this.scheduleTimeout(()=>{this.emitSnapshot("startup_1min")},6e4),this.scheduleTimeout(()=>{this.emitSnapshot("startup_5min")},3e5),this.snapshotTimer=setInterval(()=>{this.emitSnapshot("periodic")},6e5),this.snapshotTimer.unref())}stop(){this.snapshotTimer&&(clearInterval(this.snapshotTimer),this.snapshotTimer=void 0);for(let e of this.pendingTimeouts)clearTimeout(e);this.pendingTimeouts.length=0}scheduleTimeout(e,r){let n=setTimeout(()=>{let o=this.pendingTimeouts.indexOf(n);o>=0&&this.pendingTimeouts.splice(o,1),e()},r);n.unref(),this.pendingTimeouts.push(n)}async emitSnapshot(e){try{let r=process.memoryUsage(),n=lhn.getHeapStatistics(),o=this.cpuDelta(),s=ahn(),c=0,l="";try{let u=await chn();s=u.length;for(let d of u)c+=d.heapUsedBytes;u.length>0&&(l=JSON.stringify(u.map(d=>({id:d.id,n:d.name,heap:d.heapUsedBytes,heapTotal:d.heapTotalBytes,ext:d.externalBytes,arrBuf:d.arrayBufferBytes}))))}catch{}if(At(this.ctx,"cls.perf.memory_snapshot",{platform:process.platform,trigger:e,workerDetails:l},{uptimeMs:Math.round(process.uptime()*1e3),rssBytes:r.rss,heapUsedBytes:r.heapUsed,heapTotalBytes:r.heapTotal,heapSizeLimitBytes:n.heap_size_limit,externalBytes:r.external,arrayBufferBytes:r.arrayBuffers,cpuPercent:o.total,cpuUserPercent:o.user,cpuSystemPercent:o.system,systemFreeMemBytes:fWe.freemem(),systemTotalMemBytes:fWe.totalmem(),workerCount:s,workerHeapUsedTotal:c,workspaceIndexDisabled:IP(this.ctx)?1:0}),e!=="high_rss_followup_30s"&&r.rss>t.HIGH_RSS_BYTES){let u=Date.now();u-this.lastHighRssTime>=6e5&&(this.lastHighRssTime=u,this.scheduleTimeout(()=>{this.emitSnapshot("high_rss_followup_30s")},3e4))}}catch{}}cpuDelta(){let e=Date.now(),r=e-this.lastCpuTime;if(r<=0)return{total:0,user:0,system:0};let n=process.cpuUsage(),o=(n.user-this.lastCpuUsage.user)/1e3/r*100,s=(n.system-this.lastCpuUsage.system)/1e3/r*100;return this.lastCpuUsage=n,this.lastCpuTime=e,{total:Math.round((o+s)*100)/100,user:Math.round(o*100)/100,system:Math.round(s*100)/100}}};var wk=de(PP()),Zao=require("worker_threads");p();p();var XWe=require("assert");p();p();var IFo={right:PFo,center:DFo},xFo=0,HWe=1,wFo=2,GWe=3,l9t=class{static{a(this,"UI")}constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){let r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let r=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let r=e.split(` -`).map(o=>o.split(" ")),n=0;return r.forEach(o=>{o.length>1&&MS.stringWidth(o[0])>n&&(n=Math.min(Math.floor(this.width*.5),MS.stringWidth(o[0])))}),r.forEach(o=>{this.div(...o.map((s,c)=>({text:s.trim(),padding:this.measurePadding(s),width:c===0&&o.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let r=MS.stripAnsi(e);return[0,r.match(/\s*$/)[0].length,0,r.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(r=>{this.rowToString(r,e)}),e.filter(r=>!r.hidden).map(r=>r.text).join(` -`)}rowToString(e,r){return this.rasterize(e).forEach((n,o)=>{let s="";n.forEach((c,l)=>{let{width:u}=e[l],d=this.negatePadding(e[l]),f=c;if(d>MS.stringWidth(c)&&(f+=" ".repeat(d-MS.stringWidth(c))),e[l].align&&e[l].align!=="left"&&this.wrap){let m=IFo[e[l].align];f=m(f,d),MS.stringWidth(f)0&&(s=this.renderInline(s,r[r.length-1]))}),r.push({text:s.replace(/ +$/,""),span:e.span})}),r}renderInline(e,r){let n=e.match(/^ */),o=n?n[0].length:0,s=r.text,c=MS.stringWidth(s.trimRight());return r.span?this.wrap?o{s.width=n[c],this.wrap?o=MS.wrap(s.text,this.negatePadding(s),{hard:!0}).split(` +`&&o++}n&&r.length>0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,o=r.length;if(o===0)return cE.create(0,e);for(;ne?o=c:n=c+1}let s=n-1;return cE.create(s,e-r[s])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],o=e.line+1"u"}a(n,"undefined"),t.undefined=n;function o(g){return g===!0||g===!1}a(o,"boolean"),t.boolean=o;function s(g){return e.call(g)==="[object String]"}a(s,"string"),t.string=s;function c(g){return e.call(g)==="[object Number]"}a(c,"number"),t.number=c;function l(g,A,y){return e.call(g)==="[object Number]"&&A<=g&&g<=y}a(l,"numberRange"),t.numberRange=l;function u(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}a(u,"integer"),t.integer=u;function d(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}a(d,"uinteger"),t.uinteger=d;function f(g){return e.call(g)==="[object Function]"}a(f,"func"),t.func=f;function h(g){return g!==null&&typeof g=="object"}a(h,"objectLiteral"),t.objectLiteral=h;function m(g,A){return Array.isArray(g)&&g.every(A)}a(m,"typedArray"),t.typedArray=m})(mt||(mt={}));var Au=class{static{a(this,"LocationFactory")}static{this.range=gu.create.bind(gu)}static{this.position=cE.create.bind(cE)}},US=class t{constructor(e,r,n){this.uri=e;this._textDocument=r;this.detectedLanguageId=n}static{a(this,"CopilotTextDocument")}static withChanges(e,r,n){let o=P3.create(e.clientUri,e.clientLanguageId,n,e.getText());return P3.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=P3.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return P3.update(r,e.map(n=>({text:n.newText,range:n.range})),this.version),new t(this.uri,r,this.detectedLanguageId)}static create(e,r,n,o,s=uO({uri:e,languageId:r})){return new t(Fs(e),P3.create(e,r,n,o),s)}get clientUri(){return this._textDocument.uri}get clientLanguageId(){return this._textDocument.languageId}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){let r=typeof e=="number"?e:e.line;if(r<0||r>=this.lineCount)throw new RangeError("Illegal value for lineNumber");let n=gu.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=gu.create(cE.create(r,0),cE.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};var fO=require("worker_threads");var A8o=5,cmn=3e4,o9t=class extends OQ{constructor(r){super();this.worker=r;this.didChangeEmitter=new Vi;this.onDidFileChange=this.didChangeEmitter.event;this.workspaceFolders=[]}static{a(this,"ContextWorkerFileSystem")}setWorkspaceFolders(r){this.workspaceFolders=r.map(n=>Fs(n))}getWorkspaceFolder(r){let n=Fs(r.uri);for(let o of this.workspaceFolders)if(n.startsWith(o))return o}async readValidFile(r){try{let n=await this.worker.readAndValidateUri(r.uri);return n.valid?{status:"valid",document:US.create(n.uri,"UNKNOWN",-1,n.text)}:{status:"invalid",reason:`Invalid file ${r.uri}`}}catch{return{status:"invalid",reason:`Invalid file ${r.uri}`}}}},s9t=class{constructor(e,r,n){this.nextId=-1;this.activeValidations=new Map;this.validationQueue=new Map;this.fileSystem=new o9t(this);this.providers=[];this.port=e,this.port.on("message",o=>{o&&typeof o=="object"&&o.__perf__&&this.port.postMessage({__perf__:!0,memoryUsage:process.memoryUsage()})}),this.port.on("message",o=>{this.handleMessage(o)}),this.fileSystem.setWorkspaceFolders(r),this.documentManager=new wWe(this.fileSystem,n),this.coordinator=new bWe(this.documentManager,n),this.recentActivityProvider=new vWe,this.providers.push(this.recentActivityProvider)}static{a(this,"ContextWorker")}addLocalProvider(e){this.providers.push(e)}async handleMessage(e){if(e&&typeof e=="object"&&e.__perf__)return;if(!rhn(e)||typeof e.id!="number"){this.port.postMessage({error:new Error(`Received unrecognized context worker message: ${JSON.stringify(e)}`)});return}let n=e;try{await this.handleMessageUnsafe(n)}catch(o){this.port.postMessage(new qQ(n.id,"Error",o))}}async handleMessageUnsafe(e){switch(e.messageType){case"Exit":this.exit(),this.port.postMessage(new qQ(e.id,"Exit",void 0)),this.port?.close();break;case"RequestUpdate":await this.updateContext(e);break;case"ReadAndValidateResponse":this.settleValidation(e);break;default:throw new Error(`Received inappropriate context client message: ${JSON.stringify(e)}`)}}readAndValidateUri(e){let r=this.validationQueue.get(e)?.deferred;if(!r){let n=this.nextId--,o=setTimeout(()=>{let s=this.activeValidations.get(n)??this.validationQueue.get(e);s&&s.id===n&&(s.deferred.reject(new Error(`Validation timed out after ${cmn}ms`)),this.activeValidations.delete(n)||this.validationQueue.delete(e),this.advanceValidationQueue())},cmn);r=new kA,this.validationQueue.set(e,{id:n,uri:e,deferred:r,timeout:o}),this.advanceValidationQueue()}return r.promise}advanceValidationQueue(){for(;this.validationQueue.size>0&&this.activeValidations.sizer.getNodeWeight(h.id)??0),c[d.uri]=f}this.port.postMessage(new qQ(e.id,"UpdateResponse",{documents:c}));let l=[];for(let d of this.providers)l.push(M6t(d.getContext(n,r,this.documentManager)));let u=await Promise.all(l);for(let d of u)if(d.status==="error"){let f=d.reason instanceof Error?d.reason:new Error(String(d.reason));this.port.postMessage(new qQ(e.id,"Error",f))}else for(let f of d.value??[])this.coordinator.pushWorkspaceContext(f.source,[f])}exit(){for(let e of this.providers)e.dispose();this.providers=[],this.documentManager.dispose()}};function a9t(){return fO.parentPort!==null&&j6t(fO.workerData)}a(a9t,"isContextWorker");function lmn(){if(!a9t())throw new Error("This must be run in a worker thread.");if(!j6t(fO.workerData))throw new Error(`Invalid worker data for context worker: ${JSON.stringify(fO.workerData)}`);let t=fO.workerData.cwd;process.cwd=()=>t;let e=new s9t(fO.parentPort,fO.workerData.workspaceRoots,fO.workerData.config);e.addLocalProvider(new AWe(e.fileSystem,e.documentManager)),e.addLocalProvider(new _We(e.fileSystem,e.documentManager)),e.addLocalProvider(new CWe)}a(lmn,"runContextWorker");p();var qIe=fe(require("util"));function umn(t){let e=new console.Console(process.stderr,process.stderr);function r(n,...o){if(VU(t)==="dev")return t.get(Vf).logIt(t,n,"console",...o)}return a(r,"logIt"),e.debug=(...n)=>r(4,...n),e.info=(...n)=>r(3,...n),e.warn=(...n)=>r(2,...n),e.error=(...n)=>r(1,...n),e.assert=(n,...o)=>{n||(o.length===0?r(2,"Assertion failed"):r(2,"Assertion failed:",qIe.format(...o)))},e.dir=(n,o)=>r(4,qIe.inspect(n,o)),e.log=e.debug.bind(e),e.trace=(...n)=>{let o=new Error(qIe.format(...n));o.name="Trace",e.log(o)},e}a(umn,"createConsole");p();p();var LWe=fe(require("path")),dmn=require("worker_threads");var BWe=new Map,y8o=0;function jIe(t,e){let r=y8o++;BWe.set(r,{worker:t,name:e});let n=t.removeAllListeners.bind(t),o=!1,s=a(()=>{o||(o=!0,BWe.delete(r),t.removeListener("exit",s),t.removeAllListeners===c&&(t.removeAllListeners=n))},"unregisterWorker"),c=a((l=>((l===void 0||l==="exit")&&s(),n(l))),"patchedRemoveAllListeners");return t.removeAllListeners=c,t.once("exit",s),s}a(jIe,"registerWorker");function fmn(t,e){let r=new dmn.Worker(LWe.default.resolve(E8o(),t),{workerData:e});return jIe(r,t),r}a(fmn,"createWorker");function E8o(){return LWe.default.extname(__filename)!==".ts"?__dirname:LWe.default.resolve(__dirname,"../../dist")}a(E8o,"workerBundleDir");function pmn(){return BWe.size}a(pmn,"getActiveWorkerCount");async function hmn(){let t=[],e=[];for(let[r,{worker:n,name:o}]of BWe)e.push(new Promise(s=>{let c=setTimeout(()=>{n.removeListener("message",l),s()},1e3);c.unref();let l=a(u=>{if(u&&typeof u=="object"&&u.__perf__){clearTimeout(c),n.removeListener("message",l);let f=u.memoryUsage;t.push({id:r,name:o,heapUsedBytes:f?.heapUsed??0,heapTotalBytes:f?.heapTotal??0,externalBytes:f?.external??0,arrayBufferBytes:f?.arrayBuffers??0}),s()}},"handler");n.on("message",l);try{n.postMessage({__perf__:!0})}catch{clearTimeout(c),n.removeListener("message",l),s()}}));return await Promise.allSettled(e),t}a(hmn,"collectWorkerPerfStats");var FWe=fe(require("os")),mmn=fe(require("v8"));function _8o(t){let e=Rt(t,ze.PerfEnabled);return e==="false"||e===!1?{enabled:!1,shouldSample:!1}:e==="true"||e===!0?{enabled:!0,shouldSample:!0}:{enabled:!0,shouldSample:Math.random()<.01}}a(_8o,"getPerfState");var rK=class t{constructor(e,r=hmn){this.ctx=e;this.collectWorkerStats=r;this.sampled=!1;this.pendingTimeouts=[];this.lastCpuUsage=process.cpuUsage();this.lastCpuTime=Date.now();this.lastHighRssTime=0}static{a(this,"PerfMonitor")}static{this.HIGH_RSS_BYTES=2*1024*1024*1024}start(){this.sampled=_8o(this.ctx).shouldSample,this.sampled&&(this.scheduleTimeout(()=>{this.emitSnapshot("startup_30s")},3e4),this.scheduleTimeout(()=>{this.emitSnapshot("startup_1min")},6e4),this.scheduleTimeout(()=>{this.emitSnapshot("startup_5min")},3e5),this.snapshotTimer=setInterval(()=>{this.emitSnapshot("periodic")},6e5),this.snapshotTimer.unref())}stop(){this.snapshotTimer&&(clearInterval(this.snapshotTimer),this.snapshotTimer=void 0);for(let e of this.pendingTimeouts)clearTimeout(e);this.pendingTimeouts.length=0}scheduleTimeout(e,r){let n=setTimeout(()=>{let o=this.pendingTimeouts.indexOf(n);o>=0&&this.pendingTimeouts.splice(o,1),e()},r);n.unref(),this.pendingTimeouts.push(n)}async emitSnapshot(e){try{let r=process.memoryUsage(),n=mmn.getHeapStatistics(),o=this.cpuDelta(),s=pmn(),c=0,l="";try{let u=await this.collectWorkerStats();s=u.length;for(let d of u)c+=d.heapUsedBytes;u.length>0&&(l=JSON.stringify(u.map(d=>({id:d.id,n:d.name,heap:d.heapUsedBytes,heapTotal:d.heapTotalBytes,ext:d.externalBytes,arrBuf:d.arrayBufferBytes}))))}catch{}if(cr(this.ctx,"cls.perf.memory_snapshot",{platform:process.platform,trigger:e,workerDetails:l},{uptimeMs:Math.round(process.uptime()*1e3),rssBytes:r.rss,heapUsedBytes:r.heapUsed,heapTotalBytes:r.heapTotal,heapSizeLimitBytes:n.heap_size_limit,externalBytes:r.external,arrayBufferBytes:r.arrayBuffers,cpuPercent:o.total,cpuUserPercent:o.user,cpuSystemPercent:o.system,systemFreeMemBytes:FWe.freemem(),systemTotalMemBytes:FWe.totalmem(),workerCount:s,workerHeapUsedTotal:c,workspaceIndexDisabled:OP(this.ctx)?1:0}),ft(this.ctx,"cls.perf.memory_snapshot"),e!=="high_rss_followup_30s"&&r.rss>t.HIGH_RSS_BYTES){let u=Date.now();u-this.lastHighRssTime>=6e5&&(this.lastHighRssTime=u,this.scheduleTimeout(()=>{this.emitSnapshot("high_rss_followup_30s")},3e4))}}catch{}}cpuDelta(){let e=Date.now(),r=e-this.lastCpuTime;if(r<=0)return{total:0,user:0,system:0};let n=process.cpuUsage(),o=(n.user-this.lastCpuUsage.user)/1e3/r*100,s=(n.system-this.lastCpuUsage.system)/1e3/r*100;return this.lastCpuUsage=n,this.lastCpuTime=e,{total:Math.round((o+s)*100)/100,user:Math.round(o*100)/100,system:Math.round(s*100)/100}}};var Bk=fe(QP()),ouo=require("worker_threads");p();p();var Tze=require("assert");p();p();var N6o={right:F6o,center:U6o},M6o=0,mze=1,O6o=2,gze=3,N9t=class{static{a(this,"UI")}constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){let r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let r=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let r=e.split(` +`).map(o=>o.split(" ")),n=0;return r.forEach(o=>{o.length>1&&QS.stringWidth(o[0])>n&&(n=Math.min(Math.floor(this.width*.5),QS.stringWidth(o[0])))}),r.forEach(o=>{this.div(...o.map((s,c)=>({text:s.trim(),padding:this.measurePadding(s),width:c===0&&o.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let r=QS.stripAnsi(e);return[0,r.match(/\s*$/)[0].length,0,r.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(r=>{this.rowToString(r,e)}),e.filter(r=>!r.hidden).map(r=>r.text).join(` +`)}rowToString(e,r){return this.rasterize(e).forEach((n,o)=>{let s="";n.forEach((c,l)=>{let{width:u}=e[l],d=this.negatePadding(e[l]),f=c;if(d>QS.stringWidth(c)&&(f+=" ".repeat(d-QS.stringWidth(c))),e[l].align&&e[l].align!=="left"&&this.wrap){let m=N6o[e[l].align];f=m(f,d),QS.stringWidth(f)0&&(s=this.renderInline(s,r[r.length-1]))}),r.push({text:s.replace(/ +$/,""),span:e.span})}),r}renderInline(e,r){let n=e.match(/^ */),o=n?n[0].length:0,s=r.text,c=QS.stringWidth(s.trimRight());return r.span?this.wrap?o{s.width=n[c],this.wrap?o=QS.wrap(s.text,this.negatePadding(s),{hard:!0}).split(` `):o=s.text.split(` -`),s.border&&(o.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),o.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(o.unshift(...new Array(s.padding[xFo]||0).fill("")),o.push(...new Array(s.padding[wFo]||0).fill(""))),o.forEach((l,u)=>{r[u]||r.push([]);let d=r[u];for(let f=0;fc.width||MS.stringWidth(c.text));let r=e.length,n=this.width,o=e.map(c=>{if(c.width)return r--,n-=c.width,c.width}),s=r?Math.floor(n/r):0;return o.map((c,l)=>c===void 0?Math.max(s,RFo(e[l])):c)}};function nmn(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}a(nmn,"addBorder");function RFo(t){let e=t.padding||[],r=1+(e[GWe]||0)+(e[HWe]||0);return t.border?r+4:r}a(RFo,"_minWidth");function kFo(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}a(kFo,"getWindowWidth");function PFo(t,e){t=t.trim();let r=MS.stringWidth(t);return r=e?t:" ".repeat(e-r>>1)+t}a(DFo,"alignCenter");var MS;function imn(t,e){return MS=e,new l9t({width:t?.width||kFo(),wrap:t?.wrap})}a(imn,"cliui");p();p();p();function u9t({onlyFirst:t=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,t?void 0:"g")}a(u9t,"ansiRegex");var NFo=u9t();function zY(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(NFo,"")}a(zY,"stripAnsi");p();p();function omn(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}a(omn,"isAmbiguous");function smn(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}a(smn,"isFullWidth");function amn(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9800&&t<=9811||t===9855||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12771||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=19903||t>=19968&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101632&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129672||t>=129680&&t<=129725||t>=129727&&t<=129733||t>=129742&&t<=129755||t>=129760&&t<=129768||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}a(amn,"isWide");function MFo(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}a(MFo,"validate");function $We(t,{ambiguousAsWide:e=!1}={}){return MFo(t),smn(t)||amn(t)||e&&omn(t)?2:1}a($We,"eastAsianWidth");p();var cmn=a(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,"default");var OFo=new Intl.Segmenter,LFo=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function T3(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=zY(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of OFo.segment(t)){let l=c.codePointAt(0);if(!(l<=31||l>=127&&l<=159)&&!(l>=8203&&l<=8207||l===65279)&&!(l>=768&&l<=879||l>=6832&&l<=6911||l>=7616&&l<=7679||l>=8400&&l<=8447||l>=65056&&l<=65071)&&!(l>=55296&&l<=57343)&&!(l>=65024&&l<=65039)&&!LFo.test(c)){if(cmn().test(c)){o+=2;continue}o+=$We(l,s)}}return o}a(T3,"stringWidth");p();p();var lmn=a((t=0)=>e=>`\x1B[${e+t}m`,"wrapAnsi16"),umn=a((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"wrapAnsi256"),dmn=a((t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,"wrapAnsi16m"),Od={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},qLu=Object.keys(Od.modifier),BFo=Object.keys(Od.color),FFo=Object.keys(Od.bgColor),jLu=[...BFo,...FFo];function UFo(){let t=new Map;for(let[e,r]of Object.entries(Od)){for(let[n,o]of Object.entries(r))Od[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Od[n],t.set(o[0],o[1]);Object.defineProperty(Od,e,{value:r,enumerable:!1})}return Object.defineProperty(Od,"codes",{value:t,enumerable:!1}),Od.color.close="\x1B[39m",Od.bgColor.close="\x1B[49m",Od.color.ansi=lmn(),Od.color.ansi256=umn(),Od.color.ansi16m=dmn(),Od.bgColor.ansi=lmn(10),Od.bgColor.ansi256=umn(10),Od.bgColor.ansi16m=dmn(10),Object.defineProperties(Od,{rgbToAnsi256:{value(e,r,n){return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:a(e=>Od.rgbToAnsi256(...Od.hexToRgb(e)),"value"),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,o;if(e>=232)r=((e-232)*10+8)/255,n=r,o=r;else{e-=16;let l=e%36;r=Math.floor(e/36)/5,n=Math.floor(l/6)/5,o=l%6/5}let s=Math.max(r,n,o)*2;if(s===0)return 30;let c=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(c+=60),c},enumerable:!1},rgbToAnsi:{value:a((e,r,n)=>Od.ansi256ToAnsi(Od.rgbToAnsi256(e,r,n)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>Od.ansi256ToAnsi(Od.hexToAnsi256(e)),"value"),enumerable:!1}}),Od}a(UFo,"assembleStyles");var QFo=UFo(),fmn=QFo;var WWe=new Set(["\x1B","\x9B"]),qFo=39,f9t="\x07",mmn="[",jFo="]",gmn="m",VWe=`${jFo}8;;`,pmn=a(t=>`${WWe.values().next().value}${mmn}${t}${gmn}`,"wrapAnsiCode"),hmn=a(t=>`${WWe.values().next().value}${VWe}${t}${f9t}`,"wrapAnsiHyperlink"),HFo=a(t=>t.split(" ").map(e=>T3(e)),"wordLengths"),d9t=a((t,e,r)=>{let n=[...e],o=!1,s=!1,c=T3(zY(t.at(-1)));for(let[l,u]of n.entries()){let d=T3(u);if(c+d<=r?t[t.length-1]+=u:(t.push(u),c=0),WWe.has(u)&&(o=!0,s=n.slice(l+1,l+1+VWe.length).join("")===VWe),o){s?u===f9t&&(o=!1,s=!1):u===gmn&&(o=!1);continue}c+=d,c===r&&l0&&t.length>1&&(t[t.length-2]+=t.pop())},"wrapWord"),GFo=a(t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(T3(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},"stringVisibleTrimSpacesRight"),$Fo=a((t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,c=HFo(t),l=[""];for(let[h,m]of t.split(" ").entries()){r.trim!==!1&&(l[l.length-1]=l.at(-1).trimStart());let g=T3(l.at(-1));if(h!==0&&(g>=e&&(r.wordWrap===!1||r.trim===!1)&&(l.push(""),g=0),(g>0||r.trim===!1)&&(l[l.length-1]+=" ",g++)),r.hard&&c[h]>e){let A=e-g,y=1+Math.floor((c[h]-A-1)/e);Math.floor((c[h]-1)/e)e&&g>0&&c[h]>0){if(r.wordWrap===!1&&ge&&r.wordWrap===!1){d9t(l,m,e);continue}l[l.length-1]+=m}r.trim!==!1&&(l=l.map(h=>GFo(h)));let u=l.join(` -`),d=[...u],f=0;for(let[h,m]of d.entries()){if(n+=m,WWe.has(m)){let{groups:A}=new RegExp(`(?:\\${mmn}(?\\d+)m|\\${VWe}(?.*)${f9t})`).exec(u.slice(f))||{groups:{}};if(A.code!==void 0){let y=Number.parseFloat(A.code);o=y===qFo?void 0:y}else A.uri!==void 0&&(s=A.uri.length===0?void 0:A.uri)}let g=fmn.codes.get(Number(o));d[h+1]===` -`?(s&&(n+=hmn("")),o&&g&&(n+=pmn(g))):m===` -`&&(o&&g&&(n+=pmn(o)),s&&(n+=hmn(s))),f+=m.length}return n},"exec");function p9t(t,e,r){return String(t).normalize().replaceAll(`\r +`),s.border&&(o.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),o.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(o.unshift(...new Array(s.padding[M6o]||0).fill("")),o.push(...new Array(s.padding[O6o]||0).fill(""))),o.forEach((l,u)=>{r[u]||r.push([]);let d=r[u];for(let f=0;fc.width||QS.stringWidth(c.text));let r=e.length,n=this.width,o=e.map(c=>{if(c.width)return r--,n-=c.width,c.width}),s=r?Math.floor(n/r):0;return o.map((c,l)=>c===void 0?Math.max(s,L6o(e[l])):c)}};function l0n(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}a(l0n,"addBorder");function L6o(t){let e=t.padding||[],r=1+(e[gze]||0)+(e[mze]||0);return t.border?r+4:r}a(L6o,"_minWidth");function B6o(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}a(B6o,"getWindowWidth");function F6o(t,e){t=t.trim();let r=QS.stringWidth(t);return r=e?t:" ".repeat(e-r>>1)+t}a(U6o,"alignCenter");var QS;function u0n(t,e){return QS=e,new N9t({width:t?.width||B6o(),wrap:t?.wrap})}a(u0n,"cliui");p();p();p();function M9t({onlyFirst:t=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,t?void 0:"g")}a(M9t,"ansiRegex");var Q6o=M9t();function sK(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(Q6o,"")}a(sK,"stripAnsi");p();p();function d0n(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}a(d0n,"isAmbiguous");function f0n(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}a(f0n,"isFullWidth");function p0n(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9800&&t<=9811||t===9855||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12771||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=19903||t>=19968&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101632&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129672||t>=129680&&t<=129725||t>=129727&&t<=129733||t>=129742&&t<=129755||t>=129760&&t<=129768||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}a(p0n,"isWide");function q6o(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}a(q6o,"validate");function Aze(t,{ambiguousAsWide:e=!1}={}){return q6o(t),f0n(t)||p0n(t)||e&&d0n(t)?2:1}a(Aze,"eastAsianWidth");p();var h0n=a(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,"default");var j6o=new Intl.Segmenter,H6o=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function D3(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=sK(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of j6o.segment(t)){let l=c.codePointAt(0);if(!(l<=31||l>=127&&l<=159)&&!(l>=8203&&l<=8207||l===65279)&&!(l>=768&&l<=879||l>=6832&&l<=6911||l>=7616&&l<=7679||l>=8400&&l<=8447||l>=65056&&l<=65071)&&!(l>=55296&&l<=57343)&&!(l>=65024&&l<=65039)&&!H6o.test(c)){if(h0n().test(c)){o+=2;continue}o+=Aze(l,s)}}return o}a(D3,"stringWidth");p();p();var m0n=a((t=0)=>e=>`\x1B[${e+t}m`,"wrapAnsi16"),g0n=a((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"wrapAnsi256"),A0n=a((t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,"wrapAnsi16m"),qd={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},jFu=Object.keys(qd.modifier),G6o=Object.keys(qd.color),$6o=Object.keys(qd.bgColor),HFu=[...G6o,...$6o];function V6o(){let t=new Map;for(let[e,r]of Object.entries(qd)){for(let[n,o]of Object.entries(r))qd[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=qd[n],t.set(o[0],o[1]);Object.defineProperty(qd,e,{value:r,enumerable:!1})}return Object.defineProperty(qd,"codes",{value:t,enumerable:!1}),qd.color.close="\x1B[39m",qd.bgColor.close="\x1B[49m",qd.color.ansi=m0n(),qd.color.ansi256=g0n(),qd.color.ansi16m=A0n(),qd.bgColor.ansi=m0n(10),qd.bgColor.ansi256=g0n(10),qd.bgColor.ansi16m=A0n(10),Object.defineProperties(qd,{rgbToAnsi256:{value(e,r,n){return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:a(e=>qd.rgbToAnsi256(...qd.hexToRgb(e)),"value"),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,o;if(e>=232)r=((e-232)*10+8)/255,n=r,o=r;else{e-=16;let l=e%36;r=Math.floor(e/36)/5,n=Math.floor(l/6)/5,o=l%6/5}let s=Math.max(r,n,o)*2;if(s===0)return 30;let c=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(c+=60),c},enumerable:!1},rgbToAnsi:{value:a((e,r,n)=>qd.ansi256ToAnsi(qd.rgbToAnsi256(e,r,n)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>qd.ansi256ToAnsi(qd.hexToAnsi256(e)),"value"),enumerable:!1}}),qd}a(V6o,"assembleStyles");var W6o=V6o(),y0n=W6o;var Eze=new Set(["\x1B","\x9B"]),z6o=39,L9t="\x07",v0n="[",Y6o="]",C0n="m",yze=`${Y6o}8;;`,E0n=a(t=>`${Eze.values().next().value}${v0n}${t}${C0n}`,"wrapAnsiCode"),_0n=a(t=>`${Eze.values().next().value}${yze}${t}${L9t}`,"wrapAnsiHyperlink"),K6o=a(t=>t.split(" ").map(e=>D3(e)),"wordLengths"),O9t=a((t,e,r)=>{let n=[...e],o=!1,s=!1,c=D3(sK(t.at(-1)));for(let[l,u]of n.entries()){let d=D3(u);if(c+d<=r?t[t.length-1]+=u:(t.push(u),c=0),Eze.has(u)&&(o=!0,s=n.slice(l+1,l+1+yze.length).join("")===yze),o){s?u===L9t&&(o=!1,s=!1):u===C0n&&(o=!1);continue}c+=d,c===r&&l0&&t.length>1&&(t[t.length-2]+=t.pop())},"wrapWord"),J6o=a(t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(D3(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},"stringVisibleTrimSpacesRight"),Z6o=a((t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,c=K6o(t),l=[""];for(let[h,m]of t.split(" ").entries()){r.trim!==!1&&(l[l.length-1]=l.at(-1).trimStart());let g=D3(l.at(-1));if(h!==0&&(g>=e&&(r.wordWrap===!1||r.trim===!1)&&(l.push(""),g=0),(g>0||r.trim===!1)&&(l[l.length-1]+=" ",g++)),r.hard&&c[h]>e){let A=e-g,y=1+Math.floor((c[h]-A-1)/e);Math.floor((c[h]-1)/e)e&&g>0&&c[h]>0){if(r.wordWrap===!1&&ge&&r.wordWrap===!1){O9t(l,m,e);continue}l[l.length-1]+=m}r.trim!==!1&&(l=l.map(h=>J6o(h)));let u=l.join(` +`),d=[...u],f=0;for(let[h,m]of d.entries()){if(n+=m,Eze.has(m)){let{groups:A}=new RegExp(`(?:\\${v0n}(?\\d+)m|\\${yze}(?.*)${L9t})`).exec(u.slice(f))||{groups:{}};if(A.code!==void 0){let y=Number.parseFloat(A.code);o=y===z6o?void 0:y}else A.uri!==void 0&&(s=A.uri.length===0?void 0:A.uri)}let g=y0n.codes.get(Number(o));d[h+1]===` +`?(s&&(n+=_0n("")),o&&g&&(n+=E0n(g))):m===` +`&&(o&&g&&(n+=E0n(o)),s&&(n+=_0n(s))),f+=m.length}return n},"exec");function B9t(t,e,r){return String(t).normalize().replaceAll(`\r `,` `).split(` -`).map(n=>$Fo(n,e,r)).join(` -`)}a(p9t,"wrapAnsi");function h9t(t){return imn(t,{stringWidth:T3,stripAnsi:zY,wrap:p9t})}a(h9t,"ui");p();var wle=require("path"),zWe=require("fs");function m9t(t,e){let r=(0,wle.resolve)(".",t),n;for((0,zWe.statSync)(r).isDirectory()||(r=(0,wle.dirname)(r));;){if(n=e(r,(0,zWe.readdirSync)(r)),n)return(0,wle.resolve)(r,n);if(r=(0,wle.dirname)(n=r),n===r)break}}a(m9t,"default");var Omn=require("util"),I9t=require("url");p();var Cmn=require("util"),ZWe=require("path");p();function YY(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",n=!1,o=t.match(/^-+/);for(let s=o?o[0].length:0;s0?n+=`${e}${r.charAt(o)}`:n+=c}return n}a(YWe,"decamelize");function KWe(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}a(KWe,"looksLikeNumber");p();p();function Amn(t){if(Array.isArray(t))return t.map(c=>typeof c!="string"?c+"":c);t=t.trim();let e=0,r=null,n=null,o=null,s=[];for(let c=0;c{typeof ue=="number"&&(E.nargs[Z]=ue,E.keys.push(Z))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([Z,ue])=>{typeof ue=="function"&&(E.coercions[Z]=ue,E.keys.push(Z))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(Z){E.configs[Z]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([Z,ue])=>{(typeof ue=="boolean"||typeof ue=="function")&&(E.configs[Z]=ue)})),ie(n.key,c,n.default,E.arrays),Object.keys(u).forEach(function(Z){(E.aliases[Z]||[]).forEach(function(ue){u[ue]=u[Z]})});let b=null;he();let T=[],w=Object.assign(Object.create(null),{_:[]}),R={};for(let Z=0;Z=3&&(H(we[1],E.arrays)?Z=D(Z,we[1],o,we[2]):H(we[1],E.nargs)!==!1?Z=P(Z,we[1],o,we[2]):N(we[1],we[2],!0));else if(ue.match(v)&&l["boolean-negation"])we=ue.match(v),we!==null&&Array.isArray(we)&&we.length>=2&&(ce=we[1],N(ce,H(ce,E.arrays)?[!1]:!1));else if(ue.match(/^--.+/)||!l["short-option-groups"]&&ue.match(/^-[^-]+/))we=ue.match(/^--?(.+)/),we!==null&&Array.isArray(we)&&we.length>=2&&(ce=we[1],H(ce,E.arrays)?Z=D(Z,ce,o):H(ce,E.nargs)!==!1?Z=P(Z,ce,o):(Be=o[Z+1],Be!==void 0&&(!Be.match(/^-/)||Be.match(_))&&!H(ce,E.bools)&&!H(ce,E.counts)||/^(true|false)$/.test(Be)?(N(ce,Be),Z++):N(ce,ke(ce))));else if(ue.match(/^-.\..+=/))we=ue.match(/^-([^=]+)=([\s\S]*)$/),we!==null&&Array.isArray(we)&&we.length>=3&&N(we[1],we[2]);else if(ue.match(/^-.\..+/)&&!ue.match(_))Be=o[Z+1],we=ue.match(/^-(.\..+)/),we!==null&&Array.isArray(we)&&we.length>=2&&(ce=we[1],Be!==void 0&&!Be.match(/^-/)&&!H(ce,E.bools)&&!H(ce,E.counts)?(N(ce,Be),Z++):N(ce,ke(ce)));else if(ue.match(/^-[^-]+/)&&!ue.match(_)){Ne=ue.slice(1,-1).split(""),ne=!1;for(let st=0;stZ!=="--"&&Z.includes("-")).forEach(Z=>{delete w[Z]}),l["strip-aliased"]&&[].concat(...Object.keys(c).map(Z=>c[Z])).forEach(Z=>{l["camel-case-expansion"]&&Z.includes("-")&&delete w[Z.split(".").map(ue=>YY(ue)).join(".")],delete w[Z]});function x(Z){let ue=q("_",Z);(typeof ue=="string"||typeof ue=="number")&&w._.push(ue)}a(x,"pushPositional");function P(Z,ue,qe,ne){let ce,Ne=H(ue,E.nargs);if(Ne=typeof Ne!="number"||isNaN(Ne)?1:Ne,Ne===0)return K(ne)||(b=Error(y("Argument unexpected for: %s",ue))),N(ue,ke(ue)),Z;let we=K(ne)?0:1;if(l["nargs-eats-options"])qe.length-(Z+1)+we0&&(N(ue,ne),Be--),ce=Z+1;ce0||we&&typeof we=="number"&&ce.length>=we||(Ne=qe[Be],/^-/.test(Ne)&&!_.test(Ne)&&!ge(Ne)));Be++)Z=Be,ce.push(B(ue,Ne,s))}return typeof we=="number"&&(we&&ce.length1&&l["dot-notation"]&&(E.aliases[ce[0]]||[]).forEach(function(Ne){let we=Ne.split("."),Be=[].concat(ce);Be.shift(),we=we.concat(Be),(E.aliases[Z]||[]).includes(we.join("."))||z(w,we,ne)}),H(Z,E.normalize)&&!H(Z,E.arrays)&&[Z].concat(E.aliases[Z]||[]).forEach(function(we){Object.defineProperty(R,we,{enumerable:!0,get(){return ue},set(Be){ue=typeof Be=="string"?I3.normalize(Be):Be}})})}a(N,"setArg");function L(Z,ue){E.aliases[Z]&&E.aliases[Z].length||(E.aliases[Z]=[ue],g[ue]=!0),E.aliases[ue]&&E.aliases[ue].length||L(ue,Z)}a(L,"addNewAlias");function B(Z,ue,qe){qe&&(ue=WFo(ue)),(H(Z,E.bools)||H(Z,E.counts))&&typeof ue=="string"&&(ue=ue==="true");let ne=Array.isArray(ue)?ue.map(function(ce){return q(Z,ce)}):q(Z,ue);return H(Z,E.counts)&&(K(ne)||typeof ne=="boolean")&&(ne=g9t()),H(Z,E.normalize)&&H(Z,E.arrays)&&(Array.isArray(ue)?ne=ue.map(ce=>I3.normalize(ce)):ne=I3.normalize(ue)),ne}a(B,"processValue");function q(Z,ue){return!l["parse-positional-numbers"]&&Z==="_"||!H(Z,E.strings)&&!H(Z,E.bools)&&!Array.isArray(ue)&&(KWe(ue)&&l["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${ue}`)))||!K(ue)&&H(Z,E.numbers))&&(ue=Number(ue)),ue}a(q,"maybeCoerceNumber");function M(Z){let ue=Object.create(null);W(ue,E.aliases,u),Object.keys(E.configs).forEach(function(qe){let ne=Z[qe]||ue[qe];if(ne)try{let ce=null,Ne=I3.resolve(I3.cwd(),ne),we=E.configs[qe];if(typeof we=="function"){try{ce=we(Ne)}catch(Be){ce=Be}if(ce instanceof Error){b=ce;return}}else ce=I3.require(Ne);O(ce)}catch(ce){ce.name==="PermissionDenied"?b=ce:Z[qe]&&(b=Error(y("Invalid JSON config file: %s",ne)))}})}a(M,"setConfig");function O(Z,ue){Object.keys(Z).forEach(function(qe){let ne=Z[qe],ce=ue?ue+"."+qe:qe;typeof ne=="object"&&ne!==null&&!Array.isArray(ne)&&l["dot-notation"]?O(ne,ce):(!V(w,ce.split("."))||H(ce,E.arrays)&&l["combine-arrays"])&&N(ce,ne)})}a(O,"setConfigObject");function j(){typeof d<"u"&&d.forEach(function(Z){O(Z)})}a(j,"setConfigObjects");function Q(Z,ue){if(typeof f>"u")return;let qe=typeof f=="string"?f:"",ne=I3.env();Object.keys(ne).forEach(function(ce){if(qe===""||ce.lastIndexOf(qe,0)===0){let Ne=ce.split("__").map(function(we,Be){return Be===0&&(we=we.substring(qe.length)),YY(we)});(ue&&E.configs[Ne.join(".")]||!ue)&&!V(Z,Ne)&&N(Ne.join("."),ne[ce])}})}a(Q,"applyEnvVars");function U(Z){let ue,qe=new Set;Object.keys(Z).forEach(function(ne){if(!qe.has(ne)&&(ue=H(ne,E.coercions),typeof ue=="function"))try{let ce=q(ne,ue(Z[ne]));[].concat(E.aliases[ne]||[],ne).forEach(Ne=>{qe.add(Ne),Z[Ne]=ce})}catch(ce){b=ce}})}a(U,"applyCoercions");function Y(Z){return E.keys.forEach(ue=>{~ue.indexOf(".")||typeof Z[ue]>"u"&&(Z[ue]=void 0)}),Z}a(Y,"setPlaceholderKeys");function W(Z,ue,qe,ne=!1){Object.keys(qe).forEach(function(ce){V(Z,ce.split("."))||(z(Z,ce.split("."),qe[ce]),ne&&(A[ce]=!0),(ue[ce]||[]).forEach(function(Ne){V(Z,Ne.split("."))||z(Z,Ne.split("."),qe[ce])}))})}a(W,"applyDefaultsAndAliases");function V(Z,ue){let qe=Z;l["dot-notation"]||(ue=[ue.join(".")]),ue.slice(0,-1).forEach(function(ce){qe=qe[ce]||{}});let ne=ue[ue.length-1];return typeof qe!="object"?!1:ne in qe}a(V,"hasKey");function z(Z,ue,qe){let ne=Z;l["dot-notation"]||(ue=[ue.join(".")]),ue.slice(0,-1).forEach(function(rt){rt=ymn(rt),typeof ne=="object"&&ne[rt]===void 0&&(ne[rt]={}),typeof ne[rt]!="object"||Array.isArray(ne[rt])?(Array.isArray(ne[rt])?ne[rt].push({}):ne[rt]=[ne[rt],{}],ne=ne[rt][ne[rt].length-1]):ne=ne[rt]});let ce=ymn(ue[ue.length-1]),Ne=H(ue.join("."),E.arrays),we=Array.isArray(qe),Be=l["duplicate-arguments-array"];!Be&&H(ce,E.nargs)&&(Be=!0,(!K(ne[ce])&&E.nargs[ce]===1||Array.isArray(ne[ce])&&ne[ce].length===E.nargs[ce])&&(ne[ce]=void 0)),qe===g9t()?ne[ce]=g9t(ne[ce]):Array.isArray(ne[ce])?Be&&Ne&&we?ne[ce]=l["flatten-duplicate-arrays"]?ne[ce].concat(qe):(Array.isArray(ne[ce][0])?ne[ce]:[ne[ce]]).concat([qe]):!Be&&!!Ne==!!we?ne[ce]=qe:ne[ce]=ne[ce].concat([qe]):ne[ce]===void 0&&Ne?ne[ce]=we?qe:[qe]:Be&&!(ne[ce]===void 0||H(ce,E.counts)||H(ce,E.bools))?ne[ce]=[ne[ce],qe]:ne[ce]=qe}a(z,"setKey");function ie(...Z){Z.forEach(function(ue){Object.keys(ue||{}).forEach(function(qe){E.aliases[qe]||(E.aliases[qe]=[].concat(c[qe]||[]),E.aliases[qe].concat(qe).forEach(function(ne){if(/-/.test(ne)&&l["camel-case-expansion"]){let ce=YY(ne);ce!==qe&&E.aliases[qe].indexOf(ce)===-1&&(E.aliases[qe].push(ce),g[ce]=!0)}}),E.aliases[qe].concat(qe).forEach(function(ne){if(ne.length>1&&/[A-Z]/.test(ne)&&l["camel-case-expansion"]){let ce=YWe(ne,"-");ce!==qe&&E.aliases[qe].indexOf(ce)===-1&&(E.aliases[qe].push(ce),g[ce]=!0)}}),E.aliases[qe].forEach(function(ne){E.aliases[ne]=[qe].concat(E.aliases[qe].filter(function(ce){return ne!==ce}))}))})})}a(ie,"extendAliases");function H(Z,ue){let qe=[].concat(E.aliases[Z]||[],Z),ne=Object.keys(ue),ce=qe.find(Ne=>ne.includes(Ne));return ce?ue[ce]:!1}a(H,"checkAllAliases");function re(Z){let ue=Object.keys(E);return[].concat(ue.map(ne=>E[ne])).some(function(ne){return Array.isArray(ne)?ne.includes(Z):ne[Z]})}a(re,"hasAnyFlag");function le(Z,...ue){return[].concat(...ue).some(function(ne){let ce=Z.match(ne);return ce&&re(ce[1])})}a(le,"hasFlagsMatching");function Le(Z){if(Z.match(_)||!Z.match(/^-[^-]+/))return!1;let ue=!0,qe,ne=Z.slice(1).split("");for(let ce=0;ceH(Z,E.arrays)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",Z)),!0):H(Z,E.nargs)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",Z)),!0):!1)}return a(he,"checkConfiguration"),{aliases:Object.assign({},E.aliases),argv:Object.assign(R,w),configuration:l,defaulted:Object.assign({},A),error:b,newAliases:Object.assign({},g)}}};function VFo(t){let e=[],r=Object.create(null),n=!0;for(Object.keys(t).forEach(function(o){e.push([].concat(t[o],o))});n;){n=!1;for(let o=0;ozFo,"env"),format:Cmn.format,normalize:ZWe.normalize,resolve:ZWe.resolve,require:a(t=>{if(typeof vmn<"u")return vmn(t);if(t.match(/\.json$/))return JSON.parse((0,bmn.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")},"require")}),RIe=a(function(e,r){return Smn.parse(e.slice(),r).argv},"Parser");RIe.detailed=function(t,e){return Smn.parse(t.slice(),e)};RIe.camelCase=YY;RIe.decamelize=YWe;RIe.looksLikeNumber=KWe;var Tmn=RIe;var OS=require("path");p();function YFo(){return KFo()?0:1}a(YFo,"getProcessArgvBinIndex");function KFo(){return JFo()&&!process.defaultApp}a(KFo,"isBundledElectronApp");function JFo(){return!!process.versions.electron}a(JFo,"isElectronApp");function Imn(){return process.argv[YFo()]}a(Imn,"getProcessArgvBin");p();p();p();function v9t({onlyFirst:t=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,t?void 0:"g")}a(v9t,"ansiRegex");var ZFo=v9t();function C9t(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(ZFo,"")}a(C9t,"stripAnsi");p();var xmn=a(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,"default");var XFo=new Intl.Segmenter,e8o=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function b9t(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=C9t(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of XFo.segment(t)){let l=c.codePointAt(0);if(!(l<=31||l>=127&&l<=159)&&!(l>=8203&&l<=8207||l===65279)&&!(l>=768&&l<=879||l>=6832&&l<=6911||l>=7616&&l<=7679||l>=8400&&l<=8447||l>=65056&&l<=65071)&&!(l>=55296&&l<=57343)&&!(l>=65024&&l<=65039)&&!e8o.test(c)){if(xmn().test(c)){o+=2;continue}o+=$We(l,s)}}return o}a(b9t,"stringWidth");p();p();var Rle=require("fs"),wmn=require("util"),Rmn=require("path");var kmn={fs:{readFileSync:Rle.readFileSync,writeFile:Rle.writeFile},format:wmn.format,resolve:Rmn.resolve,exists:a(t=>{try{return(0,Rle.statSync)(t).isFile()}catch{return!1}},"exists")};p();var DP,S9t=class{static{a(this,"Y18N")}constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let r=e.shift(),n=a(function(){},"cb");return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),DP.format.apply(DP.format,[this.cache[this.locale][r]||r].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),r=e.shift(),n=e.shift(),o=e.shift(),s=a(function(){},"cb");typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let c=o===1?r:n;this.cache[this.locale][r]&&(c=this.cache[this.locale][r][o===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let l=[c];return~c.indexOf("%d")&&l.push(o),DP.format.apply(DP.format,l.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this.cache[this.locale][r]=e[r])}_taggedLiteral(e,...r){let n="";return e.forEach(function(o,s){let c=r[s+1];n+=o,typeof c<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,r=this.writeQueue[0],n=r.directory,o=r.locale,s=r.cb,c=this._resolveLocaleFile(n,o),l=JSON.stringify(this.cache[o],null,2);DP.fs.writeFile(c,l,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(u)})}_readLocaleFile(){let e={},r=this._resolveLocaleFile(this.directory,this.locale);try{DP.fs.readFileSync&&(e=JSON.parse(DP.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,r){let n=DP.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let o=DP.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(o)&&(n=o)}return n}_fileExistsSync(e){return DP.exists(e)}};function Pmn(t,e){DP=e;let r=new S9t(t);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}a(Pmn,"y18n");var t8o=a(t=>Pmn(t,kmn),"y18n"),Dmn=t8o;var Lmn=require("node:module"),Bmn=de(Mmn(),1),eze=require("node:fs");var T9t=(0,I9t.fileURLToPath)(importMetaUrlShim),r8o=T9t.substring(0,T9t.lastIndexOf("node_modules")),n8o=(0,Lmn.createRequire)(importMetaUrlShim),Fmn={assert:{notStrictEqual:XWe.notStrictEqual,strictEqual:XWe.strictEqual},cliui:h9t,findUp:m9t,getEnv:a(t=>process.env[t],"getEnv"),inspect:Omn.inspect,getProcessArgvBin:Imn,mainFilename:r8o||process.cwd(),Parser:Tmn,path:{basename:OS.basename,dirname:OS.dirname,extname:OS.extname,relative:OS.relative,resolve:OS.resolve,join:OS.join},process:{argv:a(()=>process.argv,"argv"),cwd:process.cwd,emitWarning:a((t,e)=>process.emitWarning(t,e),"emitWarning"),execPath:a(()=>process.execPath,"execPath"),exit:a(t=>{process.exit(t)},"exit"),nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:eze.readFileSync,readdirSync:eze.readdirSync,require:n8o,getCallerFile:a(()=>{let t=(0,Bmn.default)(3);return t.match(/^file:\/\//)?(0,I9t.fileURLToPath)(t):t},"getCallerFile"),stringWidth:b9t,y18n:Dmn({directory:(0,OS.resolve)(T9t,"../../../locales"),updateFiles:!1})};p();p();p();function B_(t,e,r,n){r.assert.notStrictEqual(t,e,n)}a(B_,"assertNotStrictEqual");function x9t(t,e){e.assert.strictEqual(typeof t,"string")}a(x9t,"assertSingleKey");function kle(t){return Object.keys(t)}a(kle,"objectKeys");p();function Ju(t){return!!t&&!!t.then&&typeof t.then=="function"}a(Ju,"isPromise");p();p();p();var Yp=class t extends Error{static{a(this,"YError")}constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}};p();function MQ(t){let r=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,o=r.shift();if(!o)throw new Error(`No command found in: ${t}`);let s={cmd:o.replace(n,""),demanded:[],optional:[]};return r.forEach((c,l)=>{let u=!1;c=c.replace(/\s/g,""),/\.+[\]>]/.test(c)&&l===r.length-1&&(u=!0),/^\[/.test(c)?s.optional.push({cmd:c.replace(n,"").split("|"),variadic:u}):s.demanded.push({cmd:c.replace(n,"").split("|"),variadic:u})}),s}a(MQ,"parseCommand");var i8o=["first","second","third","fourth","fifth","sixth"];function Ln(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[MQ(`cmd ${t}`),e,r]}a(n,"parseArgs");try{let o=0,[s,c,l]=n(),u=[].slice.call(c);for(;u.length&&u[u.length-1]===void 0;)u.pop();let d=l||u.length;if(df)throw new Yp(`Too many arguments provided. Expected max ${f} but received ${d}.`);s.demanded.forEach(h=>{let m=u.shift(),g=Umn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&Qmn(g,h.cmd,o),o+=1}),s.optional.forEach(h=>{if(u.length===0)return;let m=u.shift(),g=Umn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&Qmn(g,h.cmd,o),o+=1})}catch(o){console.warn(o.stack)}}a(Ln,"argsert");function Umn(t){return Array.isArray(t)?"array":t===null?"null":typeof t}a(Umn,"guessType");function Qmn(t,e,r){throw new Yp(`Invalid ${i8o[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}a(Qmn,"argumentTypeError");var tze=class{static{a(this,"GlobalMiddleware")}constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,o=!1){if(Ln(" [boolean] [boolean] [boolean]",[e,r,n],arguments.length),Array.isArray(e)){for(let s=0;s{let s=[...n[r]||[],r];return o.option?!s.includes(o.option):!0}),e.option=r,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function qmn(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}a(qmn,"commandMiddlewareFactory");function KY(t,e,r,n){return r.reduce((o,s)=>{if(s.applyBeforeValidation!==n)return o;if(s.mutates){if(s.applied)return o;s.applied=!0}if(Ju(o))return o.then(c=>Promise.all([c,s(c,e)])).then(([c,l])=>Object.assign(c,l));{let c=s(o,e);return Ju(c)?c.then(l=>Object.assign(o,l)):Object.assign(o,c)}},t)}a(KY,"applyMiddleware");p();function JY(t,e,r=n=>{throw n}){try{let n=o8o(t)?t():t;return Ju(n)?n.then(o=>e(o)):e(n)}catch(n){return r(n)}}a(JY,"maybeAsyncResult");function o8o(t){return typeof t=="function"}a(o8o,"isFunction");var Ple=/(^\*)|(^\$0)/,w9t=class{static{a(this,"CommandInstance")}constructor(e,r,n,o){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=o,this.usage=e,this.globalMiddleware=n,this.validation=r}addDirectory(e,r,n,o){o=o||{},this.requireCache.add(n);let s=this.shim.path.resolve(this.shim.path.dirname(n),e),c=this.shim.readdirSync(s,{recursive:!!o.recurse});Array.isArray(o.extensions)||(o.extensions=["js"]);let l=typeof o.visit=="function"?o.visit:u=>u;for(let u of c){let d=u.toString();if(o.exclude){let h=!1;if(typeof o.exclude=="function"?h=o.exclude(d):h=o.exclude.test(d),h)continue}if(o.include){let h=!1;if(typeof o.include=="function"?h=o.include(d):h=o.include.test(d),!h)continue}let f=!1;for(let h of o.extensions)d.endsWith(h)&&(f=!0);if(f){let h=this.shim.path.join(s,d),m=r(h),g=Object.create(null,Object.getOwnPropertyDescriptors({...m}));if(l(g,h,d)){if(this.requireCache.has(h))continue;this.requireCache.add(h),g.command||(g.command=this.shim.path.basename(h,this.shim.path.extname(h))),this.addHandler(g)}}}}addHandler(e,r,n,o,s,c){let l=[],u=qmn(s);if(o=o||(()=>{}),Array.isArray(e))if(s8o(e))[e,...l]=e;else for(let d of e)this.addHandler(d);else if(c8o(e)){let d=Array.isArray(e.command)||typeof e.command=="string"?e.command:null;if(d===null)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);e.aliases&&(d=[].concat(d).concat(e.aliases)),this.addHandler(d,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(jmn(n)){this.addHandler([e].concat(l),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let d=MQ(e);l=l.map(m=>MQ(m).cmd);let f=!1,h=[d.cmd].concat(l).filter(m=>Ple.test(m)?(f=!0,!1):!0);h.length===0&&f&&h.push("$0"),f&&(d.cmd=h[0],l=h.slice(1),e=e.replace(Ple,d.cmd)),l.forEach(m=>{this.aliasMap[m]=d.cmd}),r!==!1&&this.usage.command(e,r,f,l,c),this.handlers[d.cmd]={original:e,description:r,handler:o,builder:n||{},middlewares:u,deprecated:c,demanded:d.demanded,optional:d.optional},f&&(this.defaultCommand=this.handlers[d.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,r,n,o,s,c){let l=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=r.getInternalMethods().getContext(),d=u.commands.slice(),f=!e;e&&(u.commands.push(e),u.fullCommands.push(l.original));let h=this.applyBuilderUpdateUsageAndParse(f,l,r,n.aliases,d,o,s,c);return Ju(h)?h.then(m=>this.applyMiddlewareAndGetResult(f,l,m.innerArgv,u,s,m.aliases,r)):this.applyMiddlewareAndGetResult(f,l,h.innerArgv,u,s,h.aliases,r)}applyBuilderUpdateUsageAndParse(e,r,n,o,s,c,l,u){let d=r.builder,f=n;if(rze(d)){n.getInternalMethods().getUsageInstance().freeze();let h=d(n.getInternalMethods().reset(o),u);if(Ju(h))return h.then(m=>(f=Gmn(m)?m:n,this.parseAndUpdateUsage(e,r,f,s,c,l)))}else a8o(d)&&(n.getInternalMethods().getUsageInstance().freeze(),f=n.getInternalMethods().reset(o),Object.keys(r.builder).forEach(h=>{f.option(h,d[h])}));return this.parseAndUpdateUsage(e,r,f,s,c,l)}parseAndUpdateUsage(e,r,n,o,s,c){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(o,r),r.description);let l=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,c);return Ju(l)?l.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:l}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,r){let n=Ple.test(r.original)?r.original.replace(Ple,"").trim():r.original,o=e.filter(s=>!Ple.test(s));return o.push(n),`$0 ${o.join(" ")}`}handleValidationAndGetResult(e,r,n,o,s,c,l,u){if(!c.getInternalMethods().getHasOutput()){let d=c.getInternalMethods().runValidation(s,u,c.parsed.error,e);n=JY(n,f=>(d(f),f))}if(r.handler&&!c.getInternalMethods().getHasOutput()){c.getInternalMethods().setHasOutput();let d=!!c.getOptions().configuration["populate--"];c.getInternalMethods().postProcess(n,d,!1,!1),n=KY(n,c,l,!1),n=JY(n,f=>{let h=r.handler(f);return Ju(h)?h.then(()=>f):f}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),Ju(n)&&!c.getInternalMethods().hasParseCallback()&&n.catch(f=>{try{c.getInternalMethods().getUsageInstance().fail(null,f)}catch{}})}return e||(o.commands.pop(),o.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,r,n,o,s,c,l){let u={};if(s)return n;l.getInternalMethods().getHasOutput()||(u=this.populatePositionals(r,n,o,l));let d=this.globalMiddleware.getMiddleware().slice(0).concat(r.middlewares),f=KY(n,l,d,!0);return Ju(f)?f.then(h=>this.handleValidationAndGetResult(e,r,h,o,c,l,d,u)):this.handleValidationAndGetResult(e,r,f,o,c,l,d,u)}populatePositionals(e,r,n,o){r._=r._.slice(n.commands.length);let s=e.demanded.slice(0),c=e.optional.slice(0),l={};for(this.validation.positionalCount(s.length,r._.length);s.length;){let u=s.shift();this.populatePositional(u,r,l)}for(;c.length;){let u=c.shift();this.populatePositional(u,r,l)}return r._=n.commands.concat(r._.map(u=>""+u)),this.postProcessPositionals(r,l,this.cmdToParseOptions(e.original),o),l}populatePositional(e,r,n){let o=e.cmd[0];e.variadic?n[o]=r._.splice(0).map(String):r._.length&&(n[o]=[String(r._.shift())])}cmdToParseOptions(e){let r={array:[],default:{},alias:{},demand:{}},n=MQ(e);return n.demanded.forEach(o=>{let[s,...c]=o.cmd;o.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=c,r.demand[s]=!0}),n.optional.forEach(o=>{let[s,...c]=o.cmd;o.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=c}),r}postProcessPositionals(e,r,n,o){let s=Object.assign({},o.getOptions());s.default=Object.assign(n.default,s.default);for(let d of Object.keys(n.alias))s.alias[d]=(s.alias[d]||[]).concat(n.alias[d]);s.array=s.array.concat(n.array),s.config={};let c=[];if(Object.keys(r).forEach(d=>{r[d].map(f=>{s.configuration["unknown-options-as-args"]&&(s.key[d]=!0),c.push(`--${d}`),c.push(f)})}),!c.length)return;let l=Object.assign({},s.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(c,Object.assign({},s,{configuration:l}));if(u.error)o.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let d=Object.keys(r);Object.keys(r).forEach(f=>{d.push(...u.aliases[f])}),Object.keys(u.argv).forEach(f=>{d.includes(f)&&(r[f]||(r[f]=u.argv[f]),!this.isInConfigs(o,f)&&!this.isDefaulted(o,f)&&Object.prototype.hasOwnProperty.call(e,f)&&Object.prototype.hasOwnProperty.call(u.argv,f)&&(Array.isArray(e[f])||Array.isArray(u.argv[f]))?e[f]=[].concat(e[f],u.argv[f]):e[f]=u.argv[f])})}}isDefaulted(e,r){let{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(e,r){let{configObjects:n}=e.getOptions();return n.some(o=>Object.prototype.hasOwnProperty.call(o,r))||n.some(o=>Object.prototype.hasOwnProperty.call(o,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=Ple.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let r=this.defaultCommand.builder;if(rze(r))return r(e,!0);jmn(r)||Object.keys(r).forEach(n=>{e.option(n,r[n])})}extractDesc({describe:e,description:r,desc:n}){for(let o of[e,r,n]){if(typeof o=="string"||o===!1)return o;B_(o,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();B_(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function Hmn(t,e,r,n){return new w9t(t,e,r,n)}a(Hmn,"command");function jmn(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}a(jmn,"isCommandBuilderDefinition");function s8o(t){return t.every(e=>typeof e=="string")}a(s8o,"isCommandAndAliases");function rze(t){return typeof t=="function"}a(rze,"isCommandBuilderCallback");function a8o(t){return typeof t=="object"}a(a8o,"isCommandBuilderOptionDefinitions");function c8o(t){return typeof t=="object"&&!Array.isArray(t)}a(c8o,"isCommandHandlerDefinition");p();p();function OQ(t={},e=()=>!0){let r={};return kle(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}a(OQ,"objFilter");p();function LQ(t){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let r=e;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(t)})}a(LQ,"setBlocking");function l8o(t){return typeof t=="boolean"}a(l8o,"isBoolean");function Vmn(t,e){let r=e.y18n.__,n={},o=[];n.failFn=a(function(B){o.push(B)},"failFn");let s=null,c=null,l=!0;n.showHelpOnFail=a(function(B=!0,q){let[M,O]=typeof B=="string"?[!0,B]:[B,q];return t.getInternalMethods().isGlobalContext()&&(c=O),s=O,l=M,n},"showHelpOnFailFn");let u=!1;n.fail=a(function(B,q){let M=t.getInternalMethods().getLoggerInstance();if(o.length)for(let O=o.length-1;O>=0;--O){let j=o[O];if(l8o(j)){if(q)throw q;if(B)throw Error(B)}else j(B,q,n)}else{if(t.getExitProcess()&&LQ(!0),!u){u=!0,l&&(t.showHelp("error"),M.error()),(B||q)&&M.error(B||q);let O=s||c;O&&((B||q)&&M.error(""),M.error(O))}if(q=q||new Yp(B),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,q);throw q}},"fail");let d=[],f=!1;n.usage=(L,B)=>L===null?(f=!0,d=[],n):(f=!1,d.push([L,B||""]),n),n.getUsage=()=>d,n.getUsageDisabled=()=>f,n.getPositionalGroupName=()=>r("Positionals:");let h=[];n.example=(L,B)=>{h.push([L,B||""])};let m=[];n.command=a(function(B,q,M,O,j=!1){M&&(m=m.map(Q=>(Q[2]=!1,Q))),m.push([B,q||"",M,O,j])},"command"),n.getCommands=()=>m;let g={};n.describe=a(function(B,q){Array.isArray(B)?B.forEach(M=>{n.describe(M,q)}):typeof B=="object"?Object.keys(B).forEach(M=>{n.describe(M,B[M])}):g[B]=q},"describe"),n.getDescriptions=()=>g;let A=[];n.epilog=L=>{A.push(L)};let y=!1,E;n.wrap=L=>{y=!0,E=L},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(E=P(),y=!0),E);let _="__yargsString__:";n.deferY18nLookup=L=>_+L,n.help=a(function(){if(T)return T;b();let B=t.customScriptName?t.$0:e.path.basename(t.$0),q=t.getDemandedOptions(),M=t.getDemandedCommands(),O=t.getDeprecatedOptions(),j=t.getGroups(),Q=t.getOptions(),U=[];U=U.concat(Object.keys(g)),U=U.concat(Object.keys(q)),U=U.concat(Object.keys(M)),U=U.concat(Object.keys(Q.default)),U=U.filter(R),U=Object.keys(U.reduce((le,Le)=>(Le!=="_"&&(le[Le]=!0),le),{}));let Y=n.getWrap(),W=e.cliui({width:Y,wrap:!!Y});if(!f){if(d.length)d.forEach(le=>{W.div({text:`${le[0].replace(/\$0/g,B)}`}),le[1]&&W.div({text:`${le[1]}`,padding:[1,0,0,0]})}),W.div();else if(m.length){let le=null;M._?le=`${B} <${r("command")}> +`).map(n=>Z6o(n,e,r)).join(` +`)}a(B9t,"wrapAnsi");function F9t(t){return u0n(t,{stringWidth:D3,stripAnsi:sK,wrap:B9t})}a(F9t,"ui");p();var Fle=require("path"),_ze=require("fs");function U9t(t,e){let r=(0,Fle.resolve)(".",t),n;for((0,_ze.statSync)(r).isDirectory()||(r=(0,Fle.dirname)(r));;){if(n=e(r,(0,_ze.readdirSync)(r)),n)return(0,Fle.resolve)(r,n);if(r=(0,Fle.dirname)(n=r),n===r)break}}a(U9t,"default");var q0n=require("util"),K9t=require("url");p();var w0n=require("util"),Sze=require("path");p();function aK(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",n=!1,o=t.match(/^-+/);for(let s=o?o[0].length:0;s0?n+=`${e}${r.charAt(o)}`:n+=c}return n}a(vze,"decamelize");function Cze(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}a(Cze,"looksLikeNumber");p();p();function b0n(t){if(Array.isArray(t))return t.map(c=>typeof c!="string"?c+"":c);t=t.trim();let e=0,r=null,n=null,o=null,s=[];for(let c=0;c{typeof de=="number"&&(E.nargs[X]=de,E.keys.push(X))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([X,de])=>{typeof de=="function"&&(E.coercions[X]=de,E.keys.push(X))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(X){E.configs[X]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([X,de])=>{(typeof de=="boolean"||typeof de=="function")&&(E.configs[X]=de)})),ie(n.key,c,n.default,E.arrays),Object.keys(u).forEach(function(X){(E.aliases[X]||[]).forEach(function(de){u[de]=u[X]})});let b=null;he();let T=[],w=Object.assign(Object.create(null),{_:[]}),R={};for(let X=0;X=3&&(H(Ie[1],E.arrays)?X=D(X,Ie[1],o,Ie[2]):H(Ie[1],E.nargs)!==!1?X=P(X,Ie[1],o,Ie[2]):N(Ie[1],Ie[2],!0));else if(de.match(v)&&l["boolean-negation"])Ie=de.match(v),Ie!==null&&Array.isArray(Ie)&&Ie.length>=2&&(ue=Ie[1],N(ue,H(ue,E.arrays)?[!1]:!1));else if(de.match(/^--.+/)||!l["short-option-groups"]&&de.match(/^-[^-]+/))Ie=de.match(/^--?(.+)/),Ie!==null&&Array.isArray(Ie)&&Ie.length>=2&&(ue=Ie[1],H(ue,E.arrays)?X=D(X,ue,o):H(ue,E.nargs)!==!1?X=P(X,ue,o):(Be=o[X+1],Be!==void 0&&(!Be.match(/^-/)||Be.match(_))&&!H(ue,E.bools)&&!H(ue,E.counts)||/^(true|false)$/.test(Be)?(N(ue,Be),X++):N(ue,we(ue))));else if(de.match(/^-.\..+=/))Ie=de.match(/^-([^=]+)=([\s\S]*)$/),Ie!==null&&Array.isArray(Ie)&&Ie.length>=3&&N(Ie[1],Ie[2]);else if(de.match(/^-.\..+/)&&!de.match(_))Be=o[X+1],Ie=de.match(/^-(.\..+)/),Ie!==null&&Array.isArray(Ie)&&Ie.length>=2&&(ue=Ie[1],Be!==void 0&&!Be.match(/^-/)&&!H(ue,E.bools)&&!H(ue,E.counts)?(N(ue,Be),X++):N(ue,we(ue)));else if(de.match(/^-[^-]+/)&&!de.match(_)){Ne=de.slice(1,-1).split(""),ne=!1;for(let st=0;stX!=="--"&&X.includes("-")).forEach(X=>{delete w[X]}),l["strip-aliased"]&&[].concat(...Object.keys(c).map(X=>c[X])).forEach(X=>{l["camel-case-expansion"]&&X.includes("-")&&delete w[X.split(".").map(de=>aK(de)).join(".")],delete w[X]});function x(X){let de=j("_",X);(typeof de=="string"||typeof de=="number")&&w._.push(de)}a(x,"pushPositional");function P(X,de,qe,ne){let ue,Ne=H(de,E.nargs);if(Ne=typeof Ne!="number"||isNaN(Ne)?1:Ne,Ne===0)return K(ne)||(b=Error(y("Argument unexpected for: %s",de))),N(de,we(de)),X;let Ie=K(ne)?0:1;if(l["nargs-eats-options"])qe.length-(X+1)+Ie0&&(N(de,ne),Be--),ue=X+1;ue0||Ie&&typeof Ie=="number"&&ue.length>=Ie||(Ne=qe[Be],/^-/.test(Ne)&&!_.test(Ne)&&!ge(Ne)));Be++)X=Be,ue.push(B(de,Ne,s))}return typeof Ie=="number"&&(Ie&&ue.length1&&l["dot-notation"]&&(E.aliases[ue[0]]||[]).forEach(function(Ne){let Ie=Ne.split("."),Be=[].concat(ue);Be.shift(),Ie=Ie.concat(Be),(E.aliases[X]||[]).includes(Ie.join("."))||z(w,Ie,ne)}),H(X,E.normalize)&&!H(X,E.arrays)&&[X].concat(E.aliases[X]||[]).forEach(function(Ie){Object.defineProperty(R,Ie,{enumerable:!0,get(){return de},set(Be){de=typeof Be=="string"?N3.normalize(Be):Be}})})}a(N,"setArg");function L(X,de){E.aliases[X]&&E.aliases[X].length||(E.aliases[X]=[de],g[de]=!0),E.aliases[de]&&E.aliases[de].length||L(de,X)}a(L,"addNewAlias");function B(X,de,qe){qe&&(de=e9o(de)),(H(X,E.bools)||H(X,E.counts))&&typeof de=="string"&&(de=de==="true");let ne=Array.isArray(de)?de.map(function(ue){return j(X,ue)}):j(X,de);return H(X,E.counts)&&(K(ne)||typeof ne=="boolean")&&(ne=Q9t()),H(X,E.normalize)&&H(X,E.arrays)&&(Array.isArray(de)?ne=de.map(ue=>N3.normalize(ue)):ne=N3.normalize(de)),ne}a(B,"processValue");function j(X,de){return!l["parse-positional-numbers"]&&X==="_"||!H(X,E.strings)&&!H(X,E.bools)&&!Array.isArray(de)&&(Cze(de)&&l["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${de}`)))||!K(de)&&H(X,E.numbers))&&(de=Number(de)),de}a(j,"maybeCoerceNumber");function M(X){let de=Object.create(null);W(de,E.aliases,u),Object.keys(E.configs).forEach(function(qe){let ne=X[qe]||de[qe];if(ne)try{let ue=null,Ne=N3.resolve(N3.cwd(),ne),Ie=E.configs[qe];if(typeof Ie=="function"){try{ue=Ie(Ne)}catch(Be){ue=Be}if(ue instanceof Error){b=ue;return}}else ue=N3.require(Ne);O(ue)}catch(ue){ue.name==="PermissionDenied"?b=ue:X[qe]&&(b=Error(y("Invalid JSON config file: %s",ne)))}})}a(M,"setConfig");function O(X,de){Object.keys(X).forEach(function(qe){let ne=X[qe],ue=de?de+"."+qe:qe;typeof ne=="object"&&ne!==null&&!Array.isArray(ne)&&l["dot-notation"]?O(ne,ue):(!V(w,ue.split("."))||H(ue,E.arrays)&&l["combine-arrays"])&&N(ue,ne)})}a(O,"setConfigObject");function U(){typeof d<"u"&&d.forEach(function(X){O(X)})}a(U,"setConfigObjects");function q(X,de){if(typeof f>"u")return;let qe=typeof f=="string"?f:"",ne=N3.env();Object.keys(ne).forEach(function(ue){if(qe===""||ue.lastIndexOf(qe,0)===0){let Ne=ue.split("__").map(function(Ie,Be){return Be===0&&(Ie=Ie.substring(qe.length)),aK(Ie)});(de&&E.configs[Ne.join(".")]||!de)&&!V(X,Ne)&&N(Ne.join("."),ne[ue])}})}a(q,"applyEnvVars");function Q(X){let de,qe=new Set;Object.keys(X).forEach(function(ne){if(!qe.has(ne)&&(de=H(ne,E.coercions),typeof de=="function"))try{let ue=j(ne,de(X[ne]));[].concat(E.aliases[ne]||[],ne).forEach(Ne=>{qe.add(Ne),X[Ne]=ue})}catch(ue){b=ue}})}a(Q,"applyCoercions");function Y(X){return E.keys.forEach(de=>{~de.indexOf(".")||typeof X[de]>"u"&&(X[de]=void 0)}),X}a(Y,"setPlaceholderKeys");function W(X,de,qe,ne=!1){Object.keys(qe).forEach(function(ue){V(X,ue.split("."))||(z(X,ue.split("."),qe[ue]),ne&&(A[ue]=!0),(de[ue]||[]).forEach(function(Ne){V(X,Ne.split("."))||z(X,Ne.split("."),qe[ue])}))})}a(W,"applyDefaultsAndAliases");function V(X,de){let qe=X;l["dot-notation"]||(de=[de.join(".")]),de.slice(0,-1).forEach(function(ue){qe=qe[ue]||{}});let ne=de[de.length-1];return typeof qe!="object"?!1:ne in qe}a(V,"hasKey");function z(X,de,qe){let ne=X;l["dot-notation"]||(de=[de.join(".")]),de.slice(0,-1).forEach(function(tt){tt=S0n(tt),typeof ne=="object"&&ne[tt]===void 0&&(ne[tt]={}),typeof ne[tt]!="object"||Array.isArray(ne[tt])?(Array.isArray(ne[tt])?ne[tt].push({}):ne[tt]=[ne[tt],{}],ne=ne[tt][ne[tt].length-1]):ne=ne[tt]});let ue=S0n(de[de.length-1]),Ne=H(de.join("."),E.arrays),Ie=Array.isArray(qe),Be=l["duplicate-arguments-array"];!Be&&H(ue,E.nargs)&&(Be=!0,(!K(ne[ue])&&E.nargs[ue]===1||Array.isArray(ne[ue])&&ne[ue].length===E.nargs[ue])&&(ne[ue]=void 0)),qe===Q9t()?ne[ue]=Q9t(ne[ue]):Array.isArray(ne[ue])?Be&&Ne&&Ie?ne[ue]=l["flatten-duplicate-arrays"]?ne[ue].concat(qe):(Array.isArray(ne[ue][0])?ne[ue]:[ne[ue]]).concat([qe]):!Be&&!!Ne==!!Ie?ne[ue]=qe:ne[ue]=ne[ue].concat([qe]):ne[ue]===void 0&&Ne?ne[ue]=Ie?qe:[qe]:Be&&!(ne[ue]===void 0||H(ue,E.counts)||H(ue,E.bools))?ne[ue]=[ne[ue],qe]:ne[ue]=qe}a(z,"setKey");function ie(...X){X.forEach(function(de){Object.keys(de||{}).forEach(function(qe){E.aliases[qe]||(E.aliases[qe]=[].concat(c[qe]||[]),E.aliases[qe].concat(qe).forEach(function(ne){if(/-/.test(ne)&&l["camel-case-expansion"]){let ue=aK(ne);ue!==qe&&E.aliases[qe].indexOf(ue)===-1&&(E.aliases[qe].push(ue),g[ue]=!0)}}),E.aliases[qe].concat(qe).forEach(function(ne){if(ne.length>1&&/[A-Z]/.test(ne)&&l["camel-case-expansion"]){let ue=vze(ne,"-");ue!==qe&&E.aliases[qe].indexOf(ue)===-1&&(E.aliases[qe].push(ue),g[ue]=!0)}}),E.aliases[qe].forEach(function(ne){E.aliases[ne]=[qe].concat(E.aliases[qe].filter(function(ue){return ne!==ue}))}))})})}a(ie,"extendAliases");function H(X,de){let qe=[].concat(E.aliases[X]||[],X),ne=Object.keys(de),ue=qe.find(Ne=>ne.includes(Ne));return ue?de[ue]:!1}a(H,"checkAllAliases");function te(X){let de=Object.keys(E);return[].concat(de.map(ne=>E[ne])).some(function(ne){return Array.isArray(ne)?ne.includes(X):ne[X]})}a(te,"hasAnyFlag");function le(X,...de){return[].concat(...de).some(function(ne){let ue=X.match(ne);return ue&&te(ue[1])})}a(le,"hasFlagsMatching");function Le(X){if(X.match(_)||!X.match(/^-[^-]+/))return!1;let de=!0,qe,ne=X.slice(1).split("");for(let ue=0;ueH(X,E.arrays)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",X)),!0):H(X,E.nargs)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",X)),!0):!1)}return a(he,"checkConfiguration"),{aliases:Object.assign({},E.aliases),argv:Object.assign(R,w),configuration:l,defaulted:Object.assign({},A),error:b,newAliases:Object.assign({},g)}}};function X6o(t){let e=[],r=Object.create(null),n=!0;for(Object.keys(t).forEach(function(o){e.push([].concat(t[o],o))});n;){n=!1;for(let o=0;ot9o,"env"),format:w0n.format,normalize:Sze.normalize,resolve:Sze.resolve,require:a(t=>{if(typeof x0n<"u")return x0n(t);if(t.match(/\.json$/))return JSON.parse((0,R0n.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")},"require")}),YIe=a(function(e,r){return k0n.parse(e.slice(),r).argv},"Parser");YIe.detailed=function(t,e){return k0n.parse(t.slice(),e)};YIe.camelCase=aK;YIe.decamelize=vze;YIe.looksLikeNumber=Cze;var P0n=YIe;var qS=require("path");p();function r9o(){return n9o()?0:1}a(r9o,"getProcessArgvBinIndex");function n9o(){return i9o()&&!process.defaultApp}a(n9o,"isBundledElectronApp");function i9o(){return!!process.versions.electron}a(i9o,"isElectronApp");function D0n(){return process.argv[r9o()]}a(D0n,"getProcessArgvBin");p();p();p();function $9t({onlyFirst:t=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,t?void 0:"g")}a($9t,"ansiRegex");var o9o=$9t();function V9t(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(o9o,"")}a(V9t,"stripAnsi");p();var N0n=a(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,"default");var s9o=new Intl.Segmenter,a9o=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function W9t(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=V9t(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of s9o.segment(t)){let l=c.codePointAt(0);if(!(l<=31||l>=127&&l<=159)&&!(l>=8203&&l<=8207||l===65279)&&!(l>=768&&l<=879||l>=6832&&l<=6911||l>=7616&&l<=7679||l>=8400&&l<=8447||l>=65056&&l<=65071)&&!(l>=55296&&l<=57343)&&!(l>=65024&&l<=65039)&&!a9o.test(c)){if(N0n().test(c)){o+=2;continue}o+=Aze(l,s)}}return o}a(W9t,"stringWidth");p();p();var Ule=require("fs"),M0n=require("util"),O0n=require("path");var L0n={fs:{readFileSync:Ule.readFileSync,writeFile:Ule.writeFile},format:M0n.format,resolve:O0n.resolve,exists:a(t=>{try{return(0,Ule.statSync)(t).isFile()}catch{return!1}},"exists")};p();var qP,z9t=class{static{a(this,"Y18N")}constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let r=e.shift(),n=a(function(){},"cb");return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),qP.format.apply(qP.format,[this.cache[this.locale][r]||r].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),r=e.shift(),n=e.shift(),o=e.shift(),s=a(function(){},"cb");typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let c=o===1?r:n;this.cache[this.locale][r]&&(c=this.cache[this.locale][r][o===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let l=[c];return~c.indexOf("%d")&&l.push(o),qP.format.apply(qP.format,l.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this.cache[this.locale][r]=e[r])}_taggedLiteral(e,...r){let n="";return e.forEach(function(o,s){let c=r[s+1];n+=o,typeof c<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,r=this.writeQueue[0],n=r.directory,o=r.locale,s=r.cb,c=this._resolveLocaleFile(n,o),l=JSON.stringify(this.cache[o],null,2);qP.fs.writeFile(c,l,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(u)})}_readLocaleFile(){let e={},r=this._resolveLocaleFile(this.directory,this.locale);try{qP.fs.readFileSync&&(e=JSON.parse(qP.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,r){let n=qP.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let o=qP.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(o)&&(n=o)}return n}_fileExistsSync(e){return qP.exists(e)}};function B0n(t,e){qP=e;let r=new z9t(t);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}a(B0n,"y18n");var c9o=a(t=>B0n(t,L0n),"y18n"),F0n=c9o;var j0n=require("node:module"),H0n=fe(Q0n(),1),Ize=require("node:fs");var Y9t=(0,K9t.fileURLToPath)(importMetaUrlShim),l9o=Y9t.substring(0,Y9t.lastIndexOf("node_modules")),u9o=(0,j0n.createRequire)(importMetaUrlShim),G0n={assert:{notStrictEqual:Tze.notStrictEqual,strictEqual:Tze.strictEqual},cliui:F9t,findUp:U9t,getEnv:a(t=>process.env[t],"getEnv"),inspect:q0n.inspect,getProcessArgvBin:D0n,mainFilename:l9o||process.cwd(),Parser:P0n,path:{basename:qS.basename,dirname:qS.dirname,extname:qS.extname,relative:qS.relative,resolve:qS.resolve,join:qS.join},process:{argv:a(()=>process.argv,"argv"),cwd:process.cwd,emitWarning:a((t,e)=>process.emitWarning(t,e),"emitWarning"),execPath:a(()=>process.execPath,"execPath"),exit:a(t=>{process.exit(t)},"exit"),nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:Ize.readFileSync,readdirSync:Ize.readdirSync,require:u9o,getCallerFile:a(()=>{let t=(0,H0n.default)(3);return t.match(/^file:\/\//)?(0,K9t.fileURLToPath)(t):t},"getCallerFile"),stringWidth:W9t,y18n:F0n({directory:(0,qS.resolve)(Y9t,"../../../locales"),updateFiles:!1})};p();p();p();function q_(t,e,r,n){r.assert.notStrictEqual(t,e,n)}a(q_,"assertNotStrictEqual");function J9t(t,e){e.assert.strictEqual(typeof t,"string")}a(J9t,"assertSingleKey");function Qle(t){return Object.keys(t)}a(Qle,"objectKeys");p();function td(t){return!!t&&!!t.then&&typeof t.then=="function"}a(td,"isPromise");p();p();p();var Zp=class t extends Error{static{a(this,"YError")}constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}};p();function $Q(t){let r=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,o=r.shift();if(!o)throw new Error(`No command found in: ${t}`);let s={cmd:o.replace(n,""),demanded:[],optional:[]};return r.forEach((c,l)=>{let u=!1;c=c.replace(/\s/g,""),/\.+[\]>]/.test(c)&&l===r.length-1&&(u=!0),/^\[/.test(c)?s.optional.push({cmd:c.replace(n,"").split("|"),variadic:u}):s.demanded.push({cmd:c.replace(n,"").split("|"),variadic:u})}),s}a($Q,"parseCommand");var d9o=["first","second","third","fourth","fifth","sixth"];function Ln(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[$Q(`cmd ${t}`),e,r]}a(n,"parseArgs");try{let o=0,[s,c,l]=n(),u=[].slice.call(c);for(;u.length&&u[u.length-1]===void 0;)u.pop();let d=l||u.length;if(df)throw new Zp(`Too many arguments provided. Expected max ${f} but received ${d}.`);s.demanded.forEach(h=>{let m=u.shift(),g=$0n(m);h.cmd.filter(y=>y===g||y==="*").length===0&&V0n(g,h.cmd,o),o+=1}),s.optional.forEach(h=>{if(u.length===0)return;let m=u.shift(),g=$0n(m);h.cmd.filter(y=>y===g||y==="*").length===0&&V0n(g,h.cmd,o),o+=1})}catch(o){console.warn(o.stack)}}a(Ln,"argsert");function $0n(t){return Array.isArray(t)?"array":t===null?"null":typeof t}a($0n,"guessType");function V0n(t,e,r){throw new Zp(`Invalid ${d9o[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}a(V0n,"argumentTypeError");var xze=class{static{a(this,"GlobalMiddleware")}constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,o=!1){if(Ln(" [boolean] [boolean] [boolean]",[e,r,n],arguments.length),Array.isArray(e)){for(let s=0;s{let s=[...n[r]||[],r];return o.option?!s.includes(o.option):!0}),e.option=r,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function W0n(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}a(W0n,"commandMiddlewareFactory");function cK(t,e,r,n){return r.reduce((o,s)=>{if(s.applyBeforeValidation!==n)return o;if(s.mutates){if(s.applied)return o;s.applied=!0}if(td(o))return o.then(c=>Promise.all([c,s(c,e)])).then(([c,l])=>Object.assign(c,l));{let c=s(o,e);return td(c)?c.then(l=>Object.assign(o,l)):Object.assign(o,c)}},t)}a(cK,"applyMiddleware");p();function lK(t,e,r=n=>{throw n}){try{let n=f9o(t)?t():t;return td(n)?n.then(o=>e(o)):e(n)}catch(n){return r(n)}}a(lK,"maybeAsyncResult");function f9o(t){return typeof t=="function"}a(f9o,"isFunction");var qle=/(^\*)|(^\$0)/,Z9t=class{static{a(this,"CommandInstance")}constructor(e,r,n,o){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=o,this.usage=e,this.globalMiddleware=n,this.validation=r}addDirectory(e,r,n,o){o=o||{},this.requireCache.add(n);let s=this.shim.path.resolve(this.shim.path.dirname(n),e),c=this.shim.readdirSync(s,{recursive:!!o.recurse});Array.isArray(o.extensions)||(o.extensions=["js"]);let l=typeof o.visit=="function"?o.visit:u=>u;for(let u of c){let d=u.toString();if(o.exclude){let h=!1;if(typeof o.exclude=="function"?h=o.exclude(d):h=o.exclude.test(d),h)continue}if(o.include){let h=!1;if(typeof o.include=="function"?h=o.include(d):h=o.include.test(d),!h)continue}let f=!1;for(let h of o.extensions)d.endsWith(h)&&(f=!0);if(f){let h=this.shim.path.join(s,d),m=r(h),g=Object.create(null,Object.getOwnPropertyDescriptors({...m}));if(l(g,h,d)){if(this.requireCache.has(h))continue;this.requireCache.add(h),g.command||(g.command=this.shim.path.basename(h,this.shim.path.extname(h))),this.addHandler(g)}}}}addHandler(e,r,n,o,s,c){let l=[],u=W0n(s);if(o=o||(()=>{}),Array.isArray(e))if(p9o(e))[e,...l]=e;else for(let d of e)this.addHandler(d);else if(m9o(e)){let d=Array.isArray(e.command)||typeof e.command=="string"?e.command:null;if(d===null)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);e.aliases&&(d=[].concat(d).concat(e.aliases)),this.addHandler(d,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(z0n(n)){this.addHandler([e].concat(l),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let d=$Q(e);l=l.map(m=>$Q(m).cmd);let f=!1,h=[d.cmd].concat(l).filter(m=>qle.test(m)?(f=!0,!1):!0);h.length===0&&f&&h.push("$0"),f&&(d.cmd=h[0],l=h.slice(1),e=e.replace(qle,d.cmd)),l.forEach(m=>{this.aliasMap[m]=d.cmd}),r!==!1&&this.usage.command(e,r,f,l,c),this.handlers[d.cmd]={original:e,description:r,handler:o,builder:n||{},middlewares:u,deprecated:c,demanded:d.demanded,optional:d.optional},f&&(this.defaultCommand=this.handlers[d.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,r,n,o,s,c){let l=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=r.getInternalMethods().getContext(),d=u.commands.slice(),f=!e;e&&(u.commands.push(e),u.fullCommands.push(l.original));let h=this.applyBuilderUpdateUsageAndParse(f,l,r,n.aliases,d,o,s,c);return td(h)?h.then(m=>this.applyMiddlewareAndGetResult(f,l,m.innerArgv,u,s,m.aliases,r)):this.applyMiddlewareAndGetResult(f,l,h.innerArgv,u,s,h.aliases,r)}applyBuilderUpdateUsageAndParse(e,r,n,o,s,c,l,u){let d=r.builder,f=n;if(wze(d)){n.getInternalMethods().getUsageInstance().freeze();let h=d(n.getInternalMethods().reset(o),u);if(td(h))return h.then(m=>(f=K0n(m)?m:n,this.parseAndUpdateUsage(e,r,f,s,c,l)))}else h9o(d)&&(n.getInternalMethods().getUsageInstance().freeze(),f=n.getInternalMethods().reset(o),Object.keys(r.builder).forEach(h=>{f.option(h,d[h])}));return this.parseAndUpdateUsage(e,r,f,s,c,l)}parseAndUpdateUsage(e,r,n,o,s,c){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(o,r),r.description);let l=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,c);return td(l)?l.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:l}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,r){let n=qle.test(r.original)?r.original.replace(qle,"").trim():r.original,o=e.filter(s=>!qle.test(s));return o.push(n),`$0 ${o.join(" ")}`}handleValidationAndGetResult(e,r,n,o,s,c,l,u){if(!c.getInternalMethods().getHasOutput()){let d=c.getInternalMethods().runValidation(s,u,c.parsed.error,e);n=lK(n,f=>(d(f),f))}if(r.handler&&!c.getInternalMethods().getHasOutput()){c.getInternalMethods().setHasOutput();let d=!!c.getOptions().configuration["populate--"];c.getInternalMethods().postProcess(n,d,!1,!1),n=cK(n,c,l,!1),n=lK(n,f=>{let h=r.handler(f);return td(h)?h.then(()=>f):f}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),td(n)&&!c.getInternalMethods().hasParseCallback()&&n.catch(f=>{try{c.getInternalMethods().getUsageInstance().fail(null,f)}catch{}})}return e||(o.commands.pop(),o.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,r,n,o,s,c,l){let u={};if(s)return n;l.getInternalMethods().getHasOutput()||(u=this.populatePositionals(r,n,o,l));let d=this.globalMiddleware.getMiddleware().slice(0).concat(r.middlewares),f=cK(n,l,d,!0);return td(f)?f.then(h=>this.handleValidationAndGetResult(e,r,h,o,c,l,d,u)):this.handleValidationAndGetResult(e,r,f,o,c,l,d,u)}populatePositionals(e,r,n,o){r._=r._.slice(n.commands.length);let s=e.demanded.slice(0),c=e.optional.slice(0),l={};for(this.validation.positionalCount(s.length,r._.length);s.length;){let u=s.shift();this.populatePositional(u,r,l)}for(;c.length;){let u=c.shift();this.populatePositional(u,r,l)}return r._=n.commands.concat(r._.map(u=>""+u)),this.postProcessPositionals(r,l,this.cmdToParseOptions(e.original),o),l}populatePositional(e,r,n){let o=e.cmd[0];e.variadic?n[o]=r._.splice(0).map(String):r._.length&&(n[o]=[String(r._.shift())])}cmdToParseOptions(e){let r={array:[],default:{},alias:{},demand:{}},n=$Q(e);return n.demanded.forEach(o=>{let[s,...c]=o.cmd;o.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=c,r.demand[s]=!0}),n.optional.forEach(o=>{let[s,...c]=o.cmd;o.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=c}),r}postProcessPositionals(e,r,n,o){let s=Object.assign({},o.getOptions());s.default=Object.assign(n.default,s.default);for(let d of Object.keys(n.alias))s.alias[d]=(s.alias[d]||[]).concat(n.alias[d]);s.array=s.array.concat(n.array),s.config={};let c=[];if(Object.keys(r).forEach(d=>{r[d].map(f=>{s.configuration["unknown-options-as-args"]&&(s.key[d]=!0),c.push(`--${d}`),c.push(f)})}),!c.length)return;let l=Object.assign({},s.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(c,Object.assign({},s,{configuration:l}));if(u.error)o.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let d=Object.keys(r);Object.keys(r).forEach(f=>{d.push(...u.aliases[f])}),Object.keys(u.argv).forEach(f=>{d.includes(f)&&(r[f]||(r[f]=u.argv[f]),!this.isInConfigs(o,f)&&!this.isDefaulted(o,f)&&Object.prototype.hasOwnProperty.call(e,f)&&Object.prototype.hasOwnProperty.call(u.argv,f)&&(Array.isArray(e[f])||Array.isArray(u.argv[f]))?e[f]=[].concat(e[f],u.argv[f]):e[f]=u.argv[f])})}}isDefaulted(e,r){let{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(e,r){let{configObjects:n}=e.getOptions();return n.some(o=>Object.prototype.hasOwnProperty.call(o,r))||n.some(o=>Object.prototype.hasOwnProperty.call(o,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=qle.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let r=this.defaultCommand.builder;if(wze(r))return r(e,!0);z0n(r)||Object.keys(r).forEach(n=>{e.option(n,r[n])})}extractDesc({describe:e,description:r,desc:n}){for(let o of[e,r,n]){if(typeof o=="string"||o===!1)return o;q_(o,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();q_(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function Y0n(t,e,r,n){return new Z9t(t,e,r,n)}a(Y0n,"command");function z0n(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}a(z0n,"isCommandBuilderDefinition");function p9o(t){return t.every(e=>typeof e=="string")}a(p9o,"isCommandAndAliases");function wze(t){return typeof t=="function"}a(wze,"isCommandBuilderCallback");function h9o(t){return typeof t=="object"}a(h9o,"isCommandBuilderOptionDefinitions");function m9o(t){return typeof t=="object"&&!Array.isArray(t)}a(m9o,"isCommandHandlerDefinition");p();p();function VQ(t={},e=()=>!0){let r={};return Qle(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}a(VQ,"objFilter");p();function WQ(t){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let r=e;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(t)})}a(WQ,"setBlocking");function g9o(t){return typeof t=="boolean"}a(g9o,"isBoolean");function Z0n(t,e){let r=e.y18n.__,n={},o=[];n.failFn=a(function(B){o.push(B)},"failFn");let s=null,c=null,l=!0;n.showHelpOnFail=a(function(B=!0,j){let[M,O]=typeof B=="string"?[!0,B]:[B,j];return t.getInternalMethods().isGlobalContext()&&(c=O),s=O,l=M,n},"showHelpOnFailFn");let u=!1;n.fail=a(function(B,j){let M=t.getInternalMethods().getLoggerInstance();if(o.length)for(let O=o.length-1;O>=0;--O){let U=o[O];if(g9o(U)){if(j)throw j;if(B)throw Error(B)}else U(B,j,n)}else{if(t.getExitProcess()&&WQ(!0),!u){u=!0,l&&(t.showHelp("error"),M.error()),(B||j)&&M.error(B||j);let O=s||c;O&&((B||j)&&M.error(""),M.error(O))}if(j=j||new Zp(B),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,j);throw j}},"fail");let d=[],f=!1;n.usage=(L,B)=>L===null?(f=!0,d=[],n):(f=!1,d.push([L,B||""]),n),n.getUsage=()=>d,n.getUsageDisabled=()=>f,n.getPositionalGroupName=()=>r("Positionals:");let h=[];n.example=(L,B)=>{h.push([L,B||""])};let m=[];n.command=a(function(B,j,M,O,U=!1){M&&(m=m.map(q=>(q[2]=!1,q))),m.push([B,j||"",M,O,U])},"command"),n.getCommands=()=>m;let g={};n.describe=a(function(B,j){Array.isArray(B)?B.forEach(M=>{n.describe(M,j)}):typeof B=="object"?Object.keys(B).forEach(M=>{n.describe(M,B[M])}):g[B]=j},"describe"),n.getDescriptions=()=>g;let A=[];n.epilog=L=>{A.push(L)};let y=!1,E;n.wrap=L=>{y=!0,E=L},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(E=P(),y=!0),E);let _="__yargsString__:";n.deferY18nLookup=L=>_+L,n.help=a(function(){if(T)return T;b();let B=t.customScriptName?t.$0:e.path.basename(t.$0),j=t.getDemandedOptions(),M=t.getDemandedCommands(),O=t.getDeprecatedOptions(),U=t.getGroups(),q=t.getOptions(),Q=[];Q=Q.concat(Object.keys(g)),Q=Q.concat(Object.keys(j)),Q=Q.concat(Object.keys(M)),Q=Q.concat(Object.keys(q.default)),Q=Q.filter(R),Q=Object.keys(Q.reduce((le,Le)=>(Le!=="_"&&(le[Le]=!0),le),{}));let Y=n.getWrap(),W=e.cliui({width:Y,wrap:!!Y});if(!f){if(d.length)d.forEach(le=>{W.div({text:`${le[0].replace(/\$0/g,B)}`}),le[1]&&W.div({text:`${le[1]}`,padding:[1,0,0,0]})}),W.div();else if(m.length){let le=null;M._?le=`${B} <${r("command")}> `:le=`${B} [${r("command")}] -`,W.div(`${le}`)}}if(m.length>1||m.length===1&&!m[0][2]){W.div(r("Commands:"));let le=t.getInternalMethods().getContext(),Le=le.commands.length?`${le.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(m=m.sort((Ue,ke)=>Ue[0].localeCompare(ke[0])));let ge=B?`${B} `:"";m.forEach(Ue=>{let ke=`${ge}${Le}${Ue[0].replace(/^\$0 ?/,"")}`;W.span({text:ke,padding:[0,2,0,2],width:v(m,Y,`${B}${Le}`)+4},{text:Ue[1]});let X=[];Ue[2]&&X.push(`[${r("default")}]`),Ue[3]&&Ue[3].length&&X.push(`[${r("aliases:")} ${Ue[3].join(", ")}]`),Ue[4]&&(typeof Ue[4]=="string"?X.push(`[${r("deprecated: %s",Ue[4])}]`):X.push(`[${r("deprecated")}]`)),X.length?W.div({text:X.join(" "),padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}let V=(Object.keys(Q.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);U=U.filter(le=>!t.parsed.newAliases[le]&&V.every(Le=>(Q.alias[Le]||[]).indexOf(le)===-1));let z=r("Options:");j[z]||(j[z]=[]),w(U,Q.alias,j,z);let ie=a(le=>/^--/.test(nze(le)),"isLongSwitch"),H=Object.keys(j).filter(le=>j[le].length>0).map(le=>{let Le=j[le].filter(R).map(ge=>{if(V.includes(ge))return ge;for(let Ue=0,ke;(ke=V[Ue])!==void 0;Ue++)if((Q.alias[ke]||[]).includes(ge))return ke;return ge});return{groupName:le,normalizedKeys:Le}}).filter(({normalizedKeys:le})=>le.length>0).map(({groupName:le,normalizedKeys:Le})=>{let ge=Le.reduce((Ue,ke)=>(Ue[ke]=[ke].concat(Q.alias[ke]||[]).map(X=>le===n.getPositionalGroupName()?X:(/^[0-9]$/.test(X)?Q.boolean.includes(ke)?"-":"--":X.length>1?"--":"-")+X).sort((X,ee)=>ie(X)===ie(ee)?0:ie(X)?1:-1).join(", "),Ue),{});return{groupName:le,normalizedKeys:Le,switches:ge}});if(H.filter(({groupName:le})=>le!==n.getPositionalGroupName()).some(({normalizedKeys:le,switches:Le})=>!le.every(ge=>ie(Le[ge])))&&H.filter(({groupName:le})=>le!==n.getPositionalGroupName()).forEach(({normalizedKeys:le,switches:Le})=>{le.forEach(ge=>{ie(Le[ge])&&(Le[ge]=u8o(Le[ge],4))})}),H.forEach(({groupName:le,normalizedKeys:Le,switches:ge})=>{W.div(le),Le.forEach(Ue=>{let ke=ge[Ue],X=g[Ue]||"",ee=null;X.includes(_)&&(X=r(X.substring(_.length))),Q.boolean.includes(Ue)&&(ee=`[${r("boolean")}]`),Q.count.includes(Ue)&&(ee=`[${r("count")}]`),Q.string.includes(Ue)&&(ee=`[${r("string")}]`),Q.normalize.includes(Ue)&&(ee=`[${r("string")}]`),Q.array.includes(Ue)&&(ee=`[${r("array")}]`),Q.number.includes(Ue)&&(ee=`[${r("number")}]`);let K=a(ue=>typeof ue=="string"?`[${r("deprecated: %s",ue)}]`:`[${r("deprecated")}]`,"deprecatedExtra"),he=[Ue in O?K(O[Ue]):null,ee,Ue in q?`[${r("required")}]`:null,Q.choices&&Q.choices[Ue]?`[${r("choices:")} ${n.stringifiedValues(Q.choices[Ue])}]`:null,x(Q.default[Ue],Q.defaultDescription[Ue])].filter(Boolean).join(" ");W.span({text:nze(ke),padding:[0,2,0,2+$mn(ke)],width:v(ge,Y)+4},X);let Z=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;he&&!Z?W.div({text:he,padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}),h.length&&(W.div(r("Examples:")),h.forEach(le=>{le[0]=le[0].replace(/\$0/g,B)}),h.forEach(le=>{le[1]===""?W.div({text:le[0],padding:[0,2,0,2]}):W.div({text:le[0],padding:[0,2,0,2],width:v(h,Y)+4},{text:le[1]})}),W.div()),A.length>0){let le=A.map(Le=>Le.replace(/\$0/g,B)).join(` +`,W.div(`${le}`)}}if(m.length>1||m.length===1&&!m[0][2]){W.div(r("Commands:"));let le=t.getInternalMethods().getContext(),Le=le.commands.length?`${le.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(m=m.sort((Oe,we)=>Oe[0].localeCompare(we[0])));let ge=B?`${B} `:"";m.forEach(Oe=>{let we=`${ge}${Le}${Oe[0].replace(/^\$0 ?/,"")}`;W.span({text:we,padding:[0,2,0,2],width:v(m,Y,`${B}${Le}`)+4},{text:Oe[1]});let re=[];Oe[2]&&re.push(`[${r("default")}]`),Oe[3]&&Oe[3].length&&re.push(`[${r("aliases:")} ${Oe[3].join(", ")}]`),Oe[4]&&(typeof Oe[4]=="string"?re.push(`[${r("deprecated: %s",Oe[4])}]`):re.push(`[${r("deprecated")}]`)),re.length?W.div({text:re.join(" "),padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}let V=(Object.keys(q.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);Q=Q.filter(le=>!t.parsed.newAliases[le]&&V.every(Le=>(q.alias[Le]||[]).indexOf(le)===-1));let z=r("Options:");U[z]||(U[z]=[]),w(Q,q.alias,U,z);let ie=a(le=>/^--/.test(Rze(le)),"isLongSwitch"),H=Object.keys(U).filter(le=>U[le].length>0).map(le=>{let Le=U[le].filter(R).map(ge=>{if(V.includes(ge))return ge;for(let Oe=0,we;(we=V[Oe])!==void 0;Oe++)if((q.alias[we]||[]).includes(ge))return we;return ge});return{groupName:le,normalizedKeys:Le}}).filter(({normalizedKeys:le})=>le.length>0).map(({groupName:le,normalizedKeys:Le})=>{let ge=Le.reduce((Oe,we)=>(Oe[we]=[we].concat(q.alias[we]||[]).map(re=>le===n.getPositionalGroupName()?re:(/^[0-9]$/.test(re)?q.boolean.includes(we)?"-":"--":re.length>1?"--":"-")+re).sort((re,ee)=>ie(re)===ie(ee)?0:ie(re)?1:-1).join(", "),Oe),{});return{groupName:le,normalizedKeys:Le,switches:ge}});if(H.filter(({groupName:le})=>le!==n.getPositionalGroupName()).some(({normalizedKeys:le,switches:Le})=>!le.every(ge=>ie(Le[ge])))&&H.filter(({groupName:le})=>le!==n.getPositionalGroupName()).forEach(({normalizedKeys:le,switches:Le})=>{le.forEach(ge=>{ie(Le[ge])&&(Le[ge]=A9o(Le[ge],4))})}),H.forEach(({groupName:le,normalizedKeys:Le,switches:ge})=>{W.div(le),Le.forEach(Oe=>{let we=ge[Oe],re=g[Oe]||"",ee=null;re.includes(_)&&(re=r(re.substring(_.length))),q.boolean.includes(Oe)&&(ee=`[${r("boolean")}]`),q.count.includes(Oe)&&(ee=`[${r("count")}]`),q.string.includes(Oe)&&(ee=`[${r("string")}]`),q.normalize.includes(Oe)&&(ee=`[${r("string")}]`),q.array.includes(Oe)&&(ee=`[${r("array")}]`),q.number.includes(Oe)&&(ee=`[${r("number")}]`);let K=a(de=>typeof de=="string"?`[${r("deprecated: %s",de)}]`:`[${r("deprecated")}]`,"deprecatedExtra"),he=[Oe in O?K(O[Oe]):null,ee,Oe in j?`[${r("required")}]`:null,q.choices&&q.choices[Oe]?`[${r("choices:")} ${n.stringifiedValues(q.choices[Oe])}]`:null,x(q.default[Oe],q.defaultDescription[Oe])].filter(Boolean).join(" ");W.span({text:Rze(we),padding:[0,2,0,2+J0n(we)],width:v(ge,Y)+4},re);let X=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;he&&!X?W.div({text:he,padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}),h.length&&(W.div(r("Examples:")),h.forEach(le=>{le[0]=le[0].replace(/\$0/g,B)}),h.forEach(le=>{le[1]===""?W.div({text:le[0],padding:[0,2,0,2]}):W.div({text:le[0],padding:[0,2,0,2],width:v(h,Y)+4},{text:le[1]})}),W.div()),A.length>0){let le=A.map(Le=>Le.replace(/\$0/g,B)).join(` `);W.div(`${le} -`)}return W.toString().replace(/\s*$/,"")},"help");function v(L,B,q){let M=0;return Array.isArray(L)||(L=Object.values(L).map(O=>[O])),L.forEach(O=>{M=Math.max(e.stringWidth(q?`${q} ${nze(O[0])}`:nze(O[0]))+$mn(O[0]),M)}),B&&(M=Math.min(M,parseInt((B*.5).toString(),10))),M}a(v,"maxWidth");function b(){let L=t.getDemandedOptions(),B=t.getOptions();(Object.keys(B.alias)||[]).forEach(q=>{B.alias[q].forEach(M=>{g[M]&&n.describe(q,g[M]),M in L&&t.demandOption(q,L[M]),B.boolean.includes(M)&&t.boolean(q),B.count.includes(M)&&t.count(q),B.string.includes(M)&&t.string(q),B.normalize.includes(M)&&t.normalize(q),B.array.includes(M)&&t.array(q),B.number.includes(M)&&t.number(q)})})}a(b,"normalizeAliases");let T;n.cacheHelpMessage=function(){T=this.help()},n.clearCachedHelpMessage=function(){T=void 0},n.hasCachedHelpMessage=function(){return!!T};function w(L,B,q,M){let O=[],j=null;return Object.keys(q).forEach(Q=>{O=O.concat(q[Q])}),L.forEach(Q=>{j=[Q].concat(B[Q]),j.some(U=>O.indexOf(U)!==-1)||q[M].push(Q)}),O}a(w,"addUngroupedKeys");function R(L){return t.getOptions().hiddenOptions.indexOf(L)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}a(R,"filterHiddenOptions"),n.showHelp=L=>{let B=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:B[L])(n.help())},n.functionDescription=L=>["(",L.name?e.Parser.decamelize(L.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=a(function(B,q){let M="",O=q||", ",j=[].concat(B);return!B||!j.length||j.forEach(Q=>{M.length&&(M+=O),M+=JSON.stringify(Q)}),M},"stringifiedValues");function x(L,B){let q=`[${r("default:")} `;if(L===void 0&&!B)return null;if(B)q+=B;else switch(typeof L){case"string":q+=`"${L}"`;break;case"object":q+=JSON.stringify(L);break;default:q+=L}return`${q}]`}a(x,"defaultString");function P(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}a(P,"windowWidth");let D=null;n.version=L=>{D=L},n.showVersion=L=>{let B=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:B[L])(D)},n.reset=a(function(B){return s=null,u=!1,d=[],f=!1,A=[],h=[],m=[],g=OQ(g,q=>!B[q]),n},"reset");let N=[];return n.freeze=a(function(){N.push({failMessage:s,failureOutput:u,usages:d,usageDisabled:f,epilogs:A,examples:h,commands:m,descriptions:g})},"freeze"),n.unfreeze=a(function(B=!1){let q=N.pop();q&&(B?(g={...q.descriptions,...g},m=[...q.commands,...m],d=[...q.usages,...d],h=[...q.examples,...h],A=[...q.epilogs,...A]):{failMessage:s,failureOutput:u,usages:d,usageDisabled:f,epilogs:A,examples:h,commands:m,descriptions:g}=q)},"unfreeze"),n}a(Vmn,"usage");function R9t(t){return typeof t=="object"}a(R9t,"isIndentedText");function u8o(t,e){return R9t(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}a(u8o,"addIndentation");function $mn(t){return R9t(t)?t.indentation:0}a($mn,"getIndentation");function nze(t){return R9t(t)?t.text:t}a(nze,"getText");p();p();var Wmn=`###-begin-{{app_name}}-completions-### +`)}return W.toString().replace(/\s*$/,"")},"help");function v(L,B,j){let M=0;return Array.isArray(L)||(L=Object.values(L).map(O=>[O])),L.forEach(O=>{M=Math.max(e.stringWidth(j?`${j} ${Rze(O[0])}`:Rze(O[0]))+J0n(O[0]),M)}),B&&(M=Math.min(M,parseInt((B*.5).toString(),10))),M}a(v,"maxWidth");function b(){let L=t.getDemandedOptions(),B=t.getOptions();(Object.keys(B.alias)||[]).forEach(j=>{B.alias[j].forEach(M=>{g[M]&&n.describe(j,g[M]),M in L&&t.demandOption(j,L[M]),B.boolean.includes(M)&&t.boolean(j),B.count.includes(M)&&t.count(j),B.string.includes(M)&&t.string(j),B.normalize.includes(M)&&t.normalize(j),B.array.includes(M)&&t.array(j),B.number.includes(M)&&t.number(j)})})}a(b,"normalizeAliases");let T;n.cacheHelpMessage=function(){T=this.help()},n.clearCachedHelpMessage=function(){T=void 0},n.hasCachedHelpMessage=function(){return!!T};function w(L,B,j,M){let O=[],U=null;return Object.keys(j).forEach(q=>{O=O.concat(j[q])}),L.forEach(q=>{U=[q].concat(B[q]),U.some(Q=>O.indexOf(Q)!==-1)||j[M].push(q)}),O}a(w,"addUngroupedKeys");function R(L){return t.getOptions().hiddenOptions.indexOf(L)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}a(R,"filterHiddenOptions"),n.showHelp=L=>{let B=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:B[L])(n.help())},n.functionDescription=L=>["(",L.name?e.Parser.decamelize(L.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=a(function(B,j){let M="",O=j||", ",U=[].concat(B);return!B||!U.length||U.forEach(q=>{M.length&&(M+=O),M+=JSON.stringify(q)}),M},"stringifiedValues");function x(L,B){let j=`[${r("default:")} `;if(L===void 0&&!B)return null;if(B)j+=B;else switch(typeof L){case"string":j+=`"${L}"`;break;case"object":j+=JSON.stringify(L);break;default:j+=L}return`${j}]`}a(x,"defaultString");function P(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}a(P,"windowWidth");let D=null;n.version=L=>{D=L},n.showVersion=L=>{let B=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:B[L])(D)},n.reset=a(function(B){return s=null,u=!1,d=[],f=!1,A=[],h=[],m=[],g=VQ(g,j=>!B[j]),n},"reset");let N=[];return n.freeze=a(function(){N.push({failMessage:s,failureOutput:u,usages:d,usageDisabled:f,epilogs:A,examples:h,commands:m,descriptions:g})},"freeze"),n.unfreeze=a(function(B=!1){let j=N.pop();j&&(B?(g={...j.descriptions,...g},m=[...j.commands,...m],d=[...j.usages,...d],h=[...j.examples,...h],A=[...j.epilogs,...A]):{failMessage:s,failureOutput:u,usages:d,usageDisabled:f,epilogs:A,examples:h,commands:m,descriptions:g}=j)},"unfreeze"),n}a(Z0n,"usage");function X9t(t){return typeof t=="object"}a(X9t,"isIndentedText");function A9o(t,e){return X9t(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}a(A9o,"addIndentation");function J0n(t){return X9t(t)?t.indentation:0}a(J0n,"getIndentation");function Rze(t){return X9t(t)?t.text:t}a(Rze,"getText");p();p();var X0n=`###-begin-{{app_name}}-completions-### # # yargs command completion script # @@ -2300,7 +2300,7 @@ _{{app_name}}_yargs_completions() } complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}} ###-end-{{app_name}}-completions-### -`,zmn=`#compdef {{app_name}} +`,egn=`#compdef {{app_name}} ###-begin-{{app_name}}-completions-### # # yargs command completion script @@ -2327,68 +2327,68 @@ else compdef _{{app_name}}_yargs_completions {{app_name}} fi ###-end-{{app_name}}-completions-### -`;var k9t=class{static{a(this,"Completion")}constructor(e,r,n,o){var s,c,l;this.yargs=e,this.usage=r,this.command=n,this.shim=o,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(l=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((c=this.shim.getEnv("ZSH_NAME"))===null||c===void 0?void 0:c.includes("zsh")))!==null&&l!==void 0?l:!1}defaultCompletion(e,r,n,o){let s=this.command.getCommandHandlers();for(let l=0,u=e.length;l{let c=MQ(s[0]).cmd;if(r.indexOf(c)===-1)if(!this.zshShell)e.push(c);else{let l=s[1]||"";e.push(c.replace(/:/g,"\\:")+":"+l)}})}optionCompletions(e,r,n,o){if((o.match(/^-/)||o===""&&e.length===0)&&!this.previousArgHasChoices(r)){let s=this.yargs.getOptions(),c=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(l=>{let u=!!s.configuration["boolean-negation"]&&s.boolean.includes(l);!c.includes(l)&&!s.hiddenOptions.includes(l)&&!this.argsContainKey(r,l,u)&&this.completeOptionKey(l,e,o,u&&!!s.default[l])})}}choicesFromOptionsCompletions(e,r,n,o){if(this.previousArgHasChoices(r)){let s=this.getPreviousArgChoices(r);s&&s.length>0&&e.push(...s.map(c=>c.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,r,n,o){if(o===""&&e.length>0&&this.previousArgHasChoices(r))return;let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],c=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),l=s[n._.length-c-1];if(!l)return;let u=this.yargs.getOptions().choices[l]||[];for(let d of u)d.startsWith(o)&&e.push(d.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let r=e[e.length-1],n="";if(!r.startsWith("-")&&e.length>1&&(n=r,r=e[e.length-2]),!r.startsWith("-"))return;let o=r.replace(/^-+/,""),s=this.yargs.getOptions(),c=[o,...this.yargs.getAliases()[o]||[]],l;for(let u of c)if(Object.prototype.hasOwnProperty.call(s.key,u)&&Array.isArray(s.choices[u])){l=s.choices[u];break}if(l)return l.filter(u=>!n||u.startsWith(n))}previousArgHasChoices(e){let r=this.getPreviousArgChoices(e);return r!==void 0&&r.length>0}argsContainKey(e,r,n){let o=a(s=>e.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1,"argsContains");if(o(r)||n&&o(`no-${r}`))return!0;if(this.aliases){for(let s of this.aliases[r])if(o(s))return!0}return!1}completeOptionKey(e,r,n,o){var s,c,l,u;let d=e;if(this.zshShell){let g=this.usage.getDescriptions(),A=(c=(s=this===null||this===void 0?void 0:this.aliases)===null||s===void 0?void 0:s[e])===null||c===void 0?void 0:c.find(_=>{let v=g[_];return typeof v=="string"&&v.length>0}),y=A?g[A]:void 0,E=(u=(l=g[e])!==null&&l!==void 0?l:y)!==null&&u!==void 0?u:"";d=`${e.replace(/:/g,"\\:")}:${E.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let f=a(g=>/^--/.test(g),"startsByTwoDashes"),h=a(g=>/^[^0-9]$/.test(g),"isShortOption"),m=!f(n)&&h(e)?"-":"--";r.push(m+d),o&&r.push(m+"no-"+d)}customCompletion(e,r,n,o){if(B_(this.customCompletionFunction,null,this.shim),f8o(this.customCompletionFunction)){let s=this.customCompletionFunction(n,r);return Ju(s)?s.then(c=>{this.shim.process.nextTick(()=>{o(null,c)})}).catch(c=>{this.shim.process.nextTick(()=>{o(c,void 0)})}):o(null,s)}else return p8o(this.customCompletionFunction)?this.customCompletionFunction(n,r,(s=o)=>this.defaultCompletion(e,r,n,s),s=>{o(null,s)}):this.customCompletionFunction(n,r,s=>{o(null,s)})}getCompletion(e,r){let n=e.length?e[e.length-1]:"",o=this.yargs.parse(e,!0),s=this.customCompletionFunction?c=>this.customCompletion(e,c,n,r):c=>this.defaultCompletion(e,c,n,r);return Ju(o)?o.then(s):s(o)}generateCompletionScript(e,r){let n=this.zshShell?zmn:Wmn,o=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,o),n=n.replace(/{{completion_command}}/g,r),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function Ymn(t,e,r,n){return new k9t(t,e,r,n)}a(Ymn,"completion");function f8o(t){return t.length<3}a(f8o,"isSyncCompletionFunction");function p8o(t){return t.length>3}a(p8o,"isFallbackCompletionFunction");p();p();function Kmn(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],n;for(n=0;n<=e.length;n++)r[n]=[n];let o;for(o=0;o<=t.length;o++)r[0][o]=o;for(n=1;n<=e.length;n++)for(o=1;o<=t.length;o++)e.charAt(n-1)===t.charAt(o-1)?r[n][o]=r[n-1][o-1]:n>1&&o>1&&e.charAt(n-2)===t.charAt(o-1)&&e.charAt(n-1)===t.charAt(o-2)?r[n][o]=r[n-2][o-2]+1:r[n][o]=Math.min(r[n-1][o-1]+1,Math.min(r[n][o-1]+1,r[n-1][o]+1));return r[e.length][t.length]}a(Kmn,"levenshtein");var Jmn=["$0","--","_"];function Zmn(t,e,r){let n=r.y18n.__,o=r.y18n.__n,s={};s.nonOptionCount=a(function(h){let m=t.getDemandedCommands(),A=h._.length+(h["--"]?h["--"].length:0)-t.getInternalMethods().getContext().commands.length;m._&&(Am._.max)&&(Am._.max&&(m._.maxMsg!==void 0?e.fail(m._.maxMsg?m._.maxMsg.replace(/\$0/g,A.toString()).replace(/\$1/,m._.max.toString()):null):e.fail(o("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",A,A.toString(),m._.max.toString()))))},"nonOptionCount"),s.positionalCount=a(function(h,m){m"u")&&(g=g||{},g[A]=m[A]);if(g){let A=[];for(let E of Object.keys(g)){let _=g[E];_&&A.indexOf(_)<0&&A.push(_)}let y=A.length?` +`;var eUt=class{static{a(this,"Completion")}constructor(e,r,n,o){var s,c,l;this.yargs=e,this.usage=r,this.command=n,this.shim=o,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(l=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((c=this.shim.getEnv("ZSH_NAME"))===null||c===void 0?void 0:c.includes("zsh")))!==null&&l!==void 0?l:!1}defaultCompletion(e,r,n,o){let s=this.command.getCommandHandlers();for(let l=0,u=e.length;l{let c=$Q(s[0]).cmd;if(r.indexOf(c)===-1)if(!this.zshShell)e.push(c);else{let l=s[1]||"";e.push(c.replace(/:/g,"\\:")+":"+l)}})}optionCompletions(e,r,n,o){if((o.match(/^-/)||o===""&&e.length===0)&&!this.previousArgHasChoices(r)){let s=this.yargs.getOptions(),c=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(l=>{let u=!!s.configuration["boolean-negation"]&&s.boolean.includes(l);!c.includes(l)&&!s.hiddenOptions.includes(l)&&!this.argsContainKey(r,l,u)&&this.completeOptionKey(l,e,o,u&&!!s.default[l])})}}choicesFromOptionsCompletions(e,r,n,o){if(this.previousArgHasChoices(r)){let s=this.getPreviousArgChoices(r);s&&s.length>0&&e.push(...s.map(c=>c.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,r,n,o){if(o===""&&e.length>0&&this.previousArgHasChoices(r))return;let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],c=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),l=s[n._.length-c-1];if(!l)return;let u=this.yargs.getOptions().choices[l]||[];for(let d of u)d.startsWith(o)&&e.push(d.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let r=e[e.length-1],n="";if(!r.startsWith("-")&&e.length>1&&(n=r,r=e[e.length-2]),!r.startsWith("-"))return;let o=r.replace(/^-+/,""),s=this.yargs.getOptions(),c=[o,...this.yargs.getAliases()[o]||[]],l;for(let u of c)if(Object.prototype.hasOwnProperty.call(s.key,u)&&Array.isArray(s.choices[u])){l=s.choices[u];break}if(l)return l.filter(u=>!n||u.startsWith(n))}previousArgHasChoices(e){let r=this.getPreviousArgChoices(e);return r!==void 0&&r.length>0}argsContainKey(e,r,n){let o=a(s=>e.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1,"argsContains");if(o(r)||n&&o(`no-${r}`))return!0;if(this.aliases){for(let s of this.aliases[r])if(o(s))return!0}return!1}completeOptionKey(e,r,n,o){var s,c,l,u;let d=e;if(this.zshShell){let g=this.usage.getDescriptions(),A=(c=(s=this===null||this===void 0?void 0:this.aliases)===null||s===void 0?void 0:s[e])===null||c===void 0?void 0:c.find(_=>{let v=g[_];return typeof v=="string"&&v.length>0}),y=A?g[A]:void 0,E=(u=(l=g[e])!==null&&l!==void 0?l:y)!==null&&u!==void 0?u:"";d=`${e.replace(/:/g,"\\:")}:${E.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let f=a(g=>/^--/.test(g),"startsByTwoDashes"),h=a(g=>/^[^0-9]$/.test(g),"isShortOption"),m=!f(n)&&h(e)?"-":"--";r.push(m+d),o&&r.push(m+"no-"+d)}customCompletion(e,r,n,o){if(q_(this.customCompletionFunction,null,this.shim),E9o(this.customCompletionFunction)){let s=this.customCompletionFunction(n,r);return td(s)?s.then(c=>{this.shim.process.nextTick(()=>{o(null,c)})}).catch(c=>{this.shim.process.nextTick(()=>{o(c,void 0)})}):o(null,s)}else return _9o(this.customCompletionFunction)?this.customCompletionFunction(n,r,(s=o)=>this.defaultCompletion(e,r,n,s),s=>{o(null,s)}):this.customCompletionFunction(n,r,s=>{o(null,s)})}getCompletion(e,r){let n=e.length?e[e.length-1]:"",o=this.yargs.parse(e,!0),s=this.customCompletionFunction?c=>this.customCompletion(e,c,n,r):c=>this.defaultCompletion(e,c,n,r);return td(o)?o.then(s):s(o)}generateCompletionScript(e,r){let n=this.zshShell?egn:X0n,o=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,o),n=n.replace(/{{completion_command}}/g,r),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function tgn(t,e,r,n){return new eUt(t,e,r,n)}a(tgn,"completion");function E9o(t){return t.length<3}a(E9o,"isSyncCompletionFunction");function _9o(t){return t.length>3}a(_9o,"isFallbackCompletionFunction");p();p();function rgn(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],n;for(n=0;n<=e.length;n++)r[n]=[n];let o;for(o=0;o<=t.length;o++)r[0][o]=o;for(n=1;n<=e.length;n++)for(o=1;o<=t.length;o++)e.charAt(n-1)===t.charAt(o-1)?r[n][o]=r[n-1][o-1]:n>1&&o>1&&e.charAt(n-2)===t.charAt(o-1)&&e.charAt(n-1)===t.charAt(o-2)?r[n][o]=r[n-2][o-2]+1:r[n][o]=Math.min(r[n-1][o-1]+1,Math.min(r[n][o-1]+1,r[n-1][o]+1));return r[e.length][t.length]}a(rgn,"levenshtein");var ngn=["$0","--","_"];function ign(t,e,r){let n=r.y18n.__,o=r.y18n.__n,s={};s.nonOptionCount=a(function(h){let m=t.getDemandedCommands(),A=h._.length+(h["--"]?h["--"].length:0)-t.getInternalMethods().getContext().commands.length;m._&&(Am._.max)&&(Am._.max&&(m._.maxMsg!==void 0?e.fail(m._.maxMsg?m._.maxMsg.replace(/\$0/g,A.toString()).replace(/\$1/,m._.max.toString()):null):e.fail(o("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",A,A.toString(),m._.max.toString()))))},"nonOptionCount"),s.positionalCount=a(function(h,m){m"u")&&(g=g||{},g[A]=m[A]);if(g){let A=[];for(let E of Object.keys(g)){let _=g[E];_&&A.indexOf(_)<0&&A.push(_)}let y=A.length?` ${A.join(` -`)}`:"";e.fail(o("Missing required argument: %s","Missing required arguments: %s",Object.keys(g).length,Object.keys(g).join(", ")+y))}},"requiredArguments"),s.unknownArguments=a(function(h,m,g,A,y=!0){var E;let _=t.getInternalMethods().getCommandInstance().getCommands(),v=[],b=t.getInternalMethods().getContext();if(Object.keys(h).forEach(T=>{!Jmn.includes(T)&&!Object.prototype.hasOwnProperty.call(g,T)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),T)&&!s.isValidAndSomeAliasIsNotNew(T,m)&&v.push(T)}),y&&(b.commands.length>0||_.length>0||A)&&h._.slice(b.commands.length).forEach(T=>{_.includes(""+T)||v.push(""+T)}),y){let w=((E=t.getDemandedCommands()._)===null||E===void 0?void 0:E.max)||0,R=b.commands.length+w;R{x=String(x),!b.commands.includes(x)&&!v.includes(x)&&v.push(x)})}v.length&&e.fail(o("Unknown argument: %s","Unknown arguments: %s",v.length,v.map(T=>T.trim()?T:`"${T}"`).join(", ")))},"unknownArguments"),s.unknownCommands=a(function(h){let m=t.getInternalMethods().getCommandInstance().getCommands(),g=[],A=t.getInternalMethods().getContext();return(A.commands.length>0||m.length>0)&&h._.slice(A.commands.length).forEach(y=>{m.includes(""+y)||g.push(""+y)}),g.length>0?(e.fail(o("Unknown command: %s","Unknown commands: %s",g.length,g.join(", "))),!0):!1},"unknownCommands"),s.isValidAndSomeAliasIsNotNew=a(function(h,m){if(!Object.prototype.hasOwnProperty.call(m,h))return!1;let g=t.parsed.newAliases;return[h,...m[h]].some(A=>!Object.prototype.hasOwnProperty.call(g,A)||!g[h])},"isValidAndSomeAliasIsNotNew"),s.limitedChoices=a(function(h){let m=t.getOptions(),g={};if(!Object.keys(m.choices).length)return;Object.keys(h).forEach(E=>{Jmn.indexOf(E)===-1&&Object.prototype.hasOwnProperty.call(m.choices,E)&&[].concat(h[E]).forEach(_=>{m.choices[E].indexOf(_)===-1&&_!==void 0&&(g[E]=(g[E]||[]).concat(_))})});let A=Object.keys(g);if(!A.length)return;let y=n("Invalid values:");A.forEach(E=>{y+=` - ${n("Argument: %s, Given: %s, Choices: %s",E,e.stringifiedValues(g[E]),e.stringifiedValues(m.choices[E]))}`}),e.fail(y)},"limitedChoices");let c={};s.implies=a(function(h,m){Ln(" [array|number|string]",[h,m],arguments.length),typeof h=="object"?Object.keys(h).forEach(g=>{s.implies(g,h[g])}):(t.global(h),c[h]||(c[h]=[]),Array.isArray(m)?m.forEach(g=>s.implies(h,g)):(B_(m,void 0,r),c[h].push(m)))},"implies"),s.getImplied=a(function(){return c},"getImplied");function l(f,h){let m=Number(h);return h=isNaN(m)?h:m,typeof h=="number"?h=f._.length>=h:h.match(/^--no-.+/)?(h=h.match(/^--no-(.+)/)[1],h=!Object.prototype.hasOwnProperty.call(f,h)):h=Object.prototype.hasOwnProperty.call(f,h),h}a(l,"keyExists"),s.implications=a(function(h){let m=[];if(Object.keys(c).forEach(g=>{let A=g;(c[g]||[]).forEach(y=>{let E=A,_=y;E=l(h,E),y=l(h,y),E&&!y&&m.push(` ${A} -> ${_}`)})}),m.length){let g=`${n("Implications failed:")} -`;m.forEach(A=>{g+=A}),e.fail(g)}},"implications");let u={};s.conflicts=a(function(h,m){Ln(" [array|string]",[h,m],arguments.length),typeof h=="object"?Object.keys(h).forEach(g=>{s.conflicts(g,h[g])}):(t.global(h),u[h]||(u[h]=[]),Array.isArray(m)?m.forEach(g=>s.conflicts(h,g)):u[h].push(m))},"conflicts"),s.getConflicting=()=>u,s.conflicting=a(function(h){Object.keys(h).forEach(m=>{u[m]&&u[m].forEach(g=>{g&&h[m]!==void 0&&h[g]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",m,g))})}),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(m=>{u[m].forEach(g=>{g&&h[r.Parser.camelCase(m)]!==void 0&&h[r.Parser.camelCase(g)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",m,g))})})},"conflictingFn"),s.recommendCommands=a(function(h,m){m=m.sort((E,_)=>_.length-E.length);let A=null,y=1/0;for(let E=0,_;(_=m[E])!==void 0;E++){let v=Kmn(h,_);v<=3&&v!h[m]),u=OQ(u,m=>!h[m]),s},"reset");let d=[];return s.freeze=a(function(){d.push({implied:c,conflicting:u})},"freeze"),s.unfreeze=a(function(){let h=d.pop();B_(h,void 0,r),{implied:c,conflicting:u}=h},"unfreeze"),s}a(Zmn,"validation");p();var g8o={};var P9t=[],kIe;function ize(t,e,r,n){kIe=n;let o={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return o;let s=/\.json|\..*rc$/.test(t.extends),c=null;if(s)c=m8o(e,t.extends);else try{c=g8o.resolve(t.extends)}catch{return t}h8o(c),P9t.push(c),o=s?JSON.parse(kIe.readFileSync(c,"utf8")):n.require(t.extends),delete t.extends,o=ize(o,kIe.path.dirname(c),r,kIe)}return P9t=[],r?Xmn(o,t):Object.assign({},o,t)}a(ize,"applyExtends");function h8o(t){if(P9t.indexOf(t)>-1)throw new Yp(`Circular extended configurations: '${t}'.`)}a(h8o,"checkForCircularExtends");function m8o(t,e){return kIe.path.resolve(t,e)}a(m8o,"getPathToDefaultConfig");function Xmn(t,e){let r={};function n(o){return o&&typeof o=="object"&&!Array.isArray(o)}a(n,"isObject"),Object.assign(r,t);for(let o of Object.keys(e))n(e[o])&&n(r[o])?r[o]=Xmn(t[o],e[o]):r[o]=e[o];return r}a(Xmn,"mergeDeep");var Bn=function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},Pe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Kp,ZY,PIe,NC,LS,oze,BQ,XY,sze,Hx,aze,Gx,sO,BS,$x,cze,eK,cg,ni,lze,uze,FS,tK,Dle,rK,FQ,dze,Yi,nK,iK,oK,go,fze,aO,Zf;function E0n(t){return(e=[],r=t.process.cwd(),n)=>{let o=new j9t(e,r,n,t);return Object.defineProperty(o,"argv",{get:a(()=>o.parse(),"get"),enumerable:!0}),o.help(),o.version(),o}}a(E0n,"YargsFactory");var e0n=Symbol("copyDoubleDash"),t0n=Symbol("copyDoubleDash"),D9t=Symbol("deleteFromParserHintObject"),r0n=Symbol("emitWarning"),n0n=Symbol("freeze"),i0n=Symbol("getDollarZero"),sK=Symbol("getParserConfiguration"),o0n=Symbol("getUsageConfiguration"),N9t=Symbol("guessLocale"),s0n=Symbol("guessVersion"),a0n=Symbol("parsePositionalNumbers"),M9t=Symbol("pkgUp"),UQ=Symbol("populateParserHintArray"),Nle=Symbol("populateParserHintSingleValueDictionary"),O9t=Symbol("populateParserHintArrayDictionary"),L9t=Symbol("populateParserHintDictionary"),B9t=Symbol("sanitizeKey"),F9t=Symbol("setKey"),U9t=Symbol("unfreeze"),c0n=Symbol("validateAsync"),l0n=Symbol("getCommandInstance"),u0n=Symbol("getContext"),d0n=Symbol("getHasOutput"),f0n=Symbol("getLoggerInstance"),p0n=Symbol("getParseContext"),h0n=Symbol("getUsageInstance"),m0n=Symbol("getValidationInstance"),pze=Symbol("hasParseCallback"),g0n=Symbol("isGlobalContext"),aK=Symbol("postProcess"),A0n=Symbol("rebase"),Q9t=Symbol("reset"),DIe=Symbol("runYargsParserAndExecuteCommands"),q9t=Symbol("runValidation"),y0n=Symbol("setHasOutput"),cK=Symbol("kTrackManuallySetKeys"),A8o="en_US",j9t=class{static{a(this,"YargsInstance")}constructor(e=[],r,n,o){this.customScriptName=!1,this.parsed=!1,Kp.set(this,void 0),ZY.set(this,void 0),PIe.set(this,{commands:[],fullCommands:[]}),NC.set(this,null),LS.set(this,null),oze.set(this,"show-hidden"),BQ.set(this,null),XY.set(this,!0),sze.set(this,{}),Hx.set(this,!0),aze.set(this,[]),Gx.set(this,void 0),sO.set(this,{}),BS.set(this,!1),$x.set(this,null),cze.set(this,!0),eK.set(this,void 0),cg.set(this,""),ni.set(this,void 0),lze.set(this,void 0),uze.set(this,{}),FS.set(this,null),tK.set(this,null),Dle.set(this,{}),rK.set(this,{}),FQ.set(this,void 0),dze.set(this,!1),Yi.set(this,void 0),nK.set(this,!1),iK.set(this,!1),oK.set(this,!1),go.set(this,void 0),fze.set(this,{}),aO.set(this,null),Zf.set(this,void 0),Bn(this,Yi,o,"f"),Bn(this,FQ,e,"f"),Bn(this,ZY,r,"f"),Bn(this,lze,n,"f"),Bn(this,Gx,new tze(this),"f"),this.$0=this[i0n](),this[Q9t](),Bn(this,Kp,Pe(this,Kp,"f"),"f"),Bn(this,go,Pe(this,go,"f"),"f"),Bn(this,Zf,Pe(this,Zf,"f"),"f"),Bn(this,ni,Pe(this,ni,"f"),"f"),Pe(this,ni,"f").showHiddenOpt=Pe(this,oze,"f"),Bn(this,eK,this[t0n](),"f"),Pe(this,Yi,"f").y18n.setLocale(A8o)}addHelpOpt(e,r){let n="help";return Ln("[string|boolean] [string]",[e,r],arguments.length),Pe(this,$x,"f")&&(this[D9t](Pe(this,$x,"f")),Bn(this,$x,null,"f")),e===!1&&r===void 0?this:(Bn(this,$x,typeof e=="string"?e:n,"f"),this.boolean(Pe(this,$x,"f")),this.describe(Pe(this,$x,"f"),r||Pe(this,go,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(Ln("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:Pe(this,oze,"f");return this.boolean(n),this.describe(n,r||Pe(this,go,"f").deferY18nLookup("Show hidden options")),Pe(this,ni,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return Ln(" [string|array]",[e,r],arguments.length),this[O9t](this.alias.bind(this),"alias",e,r),this}array(e){return Ln("",[e],arguments.length),this[UQ]("array",e),this[cK](e),this}boolean(e){return Ln("",[e],arguments.length),this[UQ]("boolean",e),this[cK](e),this}check(e,r){return Ln(" [boolean]",[e,r],arguments.length),this.middleware((n,o)=>JY(()=>e(n,o.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&Pe(this,go,"f").fail(s.toString(),s):Pe(this,go,"f").fail(Pe(this,Yi,"f").y18n.__("Argument check failed: %s",e.toString())),n),s=>(Pe(this,go,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(e,r){return Ln(" [string|array]",[e,r],arguments.length),this[O9t](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(Ln(" [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new Yp("coerce callback must be provided");for(let o of e)this.coerce(o,r);return this}else if(typeof e=="object"){for(let o of Object.keys(e))this.coerce(o,e[o]);return this}if(!r)throw new Yp("coerce callback must be provided");let n=e;return Pe(this,ni,"f").key[n]=!0,Pe(this,Gx,"f").addCoerceMiddleware((o,s)=>{var c;let l=(c=s.getAliases()[n])!==null&&c!==void 0?c:[],u=[n,...l].filter(d=>Object.prototype.hasOwnProperty.call(o,d));return u.length===0?o:JY(()=>r(o[u[0]]),d=>(u.forEach(f=>{o[f]=d}),o),d=>{throw new Yp(d.message)})},n),this}conflicts(e,r){return Ln(" [string|array]",[e,r],arguments.length),Pe(this,Zf,"f").conflicts(e,r),this}config(e="config",r,n){return Ln("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=ize(e,Pe(this,ZY,"f"),this[sK]()["deep-merge-config"]||!1,Pe(this,Yi,"f")),Pe(this,ni,"f").configObjects=(Pe(this,ni,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||Pe(this,go,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(o=>{Pe(this,ni,"f").config[o]=n||!0}),this)}completion(e,r,n){return Ln("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Bn(this,LS,e||Pe(this,LS,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(Pe(this,LS,"f"),r),n&&Pe(this,NC,"f").registerFunction(n),this}command(e,r,n,o,s,c){return Ln(" [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,o,s,c],arguments.length),Pe(this,Kp,"f").addHandler(e,r,n,o,s,c),this}commands(e,r,n,o,s,c){return this.command(e,r,n,o,s,c)}commandDir(e,r){Ln(" [object]",[e,r],arguments.length);let n=Pe(this,lze,"f")||Pe(this,Yi,"f").require;return Pe(this,Kp,"f").addDirectory(e,n,Pe(this,Yi,"f").getCallerFile(),r),this}count(e){return Ln("",[e],arguments.length),this[UQ]("count",e),this[cK](e),this}default(e,r,n){return Ln(" [*] [string]",[e,r,n],arguments.length),n&&(x9t(e,Pe(this,Yi,"f")),Pe(this,ni,"f").defaultDescription[e]=n),typeof r=="function"&&(x9t(e,Pe(this,Yi,"f")),Pe(this,ni,"f").defaultDescription[e]||(Pe(this,ni,"f").defaultDescription[e]=Pe(this,go,"f").functionDescription(r)),r=r.call()),this[Nle](this.default.bind(this),"default",e,r),this}defaults(e,r,n){return this.default(e,r,n)}demandCommand(e=1,r,n,o){return Ln("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,r,n,o],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),Pe(this,ni,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:o},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(o=>{B_(n,!0,Pe(this,Yi,"f")),this.demandOption(o,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(B_(n,!0,Pe(this,Yi,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(o=>{B_(n,!0,Pe(this,Yi,"f")),this.demandOption(o,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,r){return Ln(" [string]",[e,r],arguments.length),this[Nle](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return Ln(" [string|boolean]",[e,r],arguments.length),Pe(this,ni,"f").deprecatedOptions[e]=r,this}describe(e,r){return Ln(" [string]",[e,r],arguments.length),this[F9t](e,!0),Pe(this,go,"f").describe(e,r),this}detectLocale(e){return Ln("",[e],arguments.length),Bn(this,XY,e,"f"),this}env(e){return Ln("[string|boolean]",[e],arguments.length),e===!1?delete Pe(this,ni,"f").envPrefix:Pe(this,ni,"f").envPrefix=e||"",this}epilogue(e){return Ln("",[e],arguments.length),Pe(this,go,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return Ln(" [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):Pe(this,go,"f").example(e,r),this}exit(e,r){Bn(this,BS,!0,"f"),Bn(this,BQ,r,"f"),Pe(this,Hx,"f")&&Pe(this,Yi,"f").process.exit(e)}exitProcess(e=!0){return Ln("[boolean]",[e],arguments.length),Bn(this,Hx,e,"f"),this}fail(e){if(Ln("",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Yp("Invalid first argument. Expected function or boolean 'false'");return Pe(this,go,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return Ln(" [function]",[e,r],arguments.length),r?Pe(this,NC,"f").getCompletion(e,r):new Promise((n,o)=>{Pe(this,NC,"f").getCompletion(e,(s,c)=>{s?o(s):n(c)})})}getDemandedOptions(){return Ln([],0),Pe(this,ni,"f").demandedOptions}getDemandedCommands(){return Ln([],0),Pe(this,ni,"f").demandedCommands}getDeprecatedOptions(){return Ln([],0),Pe(this,ni,"f").deprecatedOptions}getDetectLocale(){return Pe(this,XY,"f")}getExitProcess(){return Pe(this,Hx,"f")}getGroups(){return Object.assign({},Pe(this,sO,"f"),Pe(this,rK,"f"))}getHelp(){if(Bn(this,BS,!0,"f"),!Pe(this,go,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[DIe](Pe(this,FQ,"f"),void 0,void 0,0,!0);if(Ju(r))return r.then(()=>Pe(this,go,"f").help())}let e=Pe(this,Kp,"f").runDefaultBuilderOn(this);if(Ju(e))return e.then(()=>Pe(this,go,"f").help())}return Promise.resolve(Pe(this,go,"f").help())}getOptions(){return Pe(this,ni,"f")}getStrict(){return Pe(this,nK,"f")}getStrictCommands(){return Pe(this,iK,"f")}getStrictOptions(){return Pe(this,oK,"f")}global(e,r){return Ln(" [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?Pe(this,ni,"f").local=Pe(this,ni,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{Pe(this,ni,"f").local.includes(n)||Pe(this,ni,"f").local.push(n)}),this}group(e,r){Ln(" ",[e,r],arguments.length);let n=Pe(this,rK,"f")[r]||Pe(this,sO,"f")[r];Pe(this,rK,"f")[r]&&delete Pe(this,rK,"f")[r];let o={};return Pe(this,sO,"f")[r]=(n||[]).concat(e).filter(s=>o[s]?!1:o[s]=!0),this}hide(e){return Ln("",[e],arguments.length),Pe(this,ni,"f").hiddenOptions.push(e),this}implies(e,r){return Ln(" [number|string|array]",[e,r],arguments.length),Pe(this,Zf,"f").implies(e,r),this}locale(e){return Ln("[string]",[e],arguments.length),e===void 0?(this[N9t](),Pe(this,Yi,"f").y18n.getLocale()):(Bn(this,XY,!1,"f"),Pe(this,Yi,"f").y18n.setLocale(e),this)}middleware(e,r,n){return Pe(this,Gx,"f").addMiddleware(e,!!r,n)}nargs(e,r){return Ln(" [number]",[e,r],arguments.length),this[Nle](this.nargs.bind(this),"narg",e,r),this}normalize(e){return Ln("",[e],arguments.length),this[UQ]("normalize",e),this}number(e){return Ln("",[e],arguments.length),this[UQ]("number",e),this[cK](e),this}option(e,r){if(Ln(" [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[cK](e),Pe(this,aO,"f")&&(e==="version"||r?.alias==="version")&&this[r0n](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(` -`),void 0,"versionWarning"),Pe(this,ni,"f").key[e]=!0,r.alias&&this.alias(e,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(e,n);let o=r.demand||r.required||r.require;o&&this.demand(e,o),r.demandOption&&this.demandOption(e,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(e,r.conflicts),"default"in r&&this.default(e,r.default),r.implies!==void 0&&this.implies(e,r.implies),r.nargs!==void 0&&this.nargs(e,r.nargs),r.config&&this.config(e,r.configParser),r.normalize&&this.normalize(e),r.choices&&this.choices(e,r.choices),r.coerce&&this.coerce(e,r.coerce),r.group&&this.group(e,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(e),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(e),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(e),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(e),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(e),typeof r.global=="boolean"&&this.global(e,r.global),r.defaultDescription&&(Pe(this,ni,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let s=r.describe||r.description||r.desc,c=Pe(this,go,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(c,e)||typeof s=="string")&&this.describe(e,s),r.hidden&&this.hide(e),r.requiresArg&&this.requiresArg(e)}return this}options(e,r){return this.option(e,r)}parse(e,r,n){Ln("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[n0n](),typeof e>"u"&&(e=Pe(this,FQ,"f")),typeof r=="object"&&(Bn(this,tK,r,"f"),r=n),typeof r=="function"&&(Bn(this,FS,r,"f"),r=!1),r||Bn(this,FQ,e,"f"),Pe(this,FS,"f")&&Bn(this,Hx,!1,"f");let o=this[DIe](e,!!r),s=this.parsed;return Pe(this,NC,"f").setParsed(this.parsed),Ju(o)?o.then(c=>(Pe(this,FS,"f")&&Pe(this,FS,"f").call(this,Pe(this,BQ,"f"),c,Pe(this,cg,"f")),c)).catch(c=>{throw Pe(this,FS,"f")&&Pe(this,FS,"f")(c,this.parsed.argv,Pe(this,cg,"f")),c}).finally(()=>{this[U9t](),this.parsed=s}):(Pe(this,FS,"f")&&Pe(this,FS,"f").call(this,Pe(this,BQ,"f"),o,Pe(this,cg,"f")),this[U9t](),this.parsed=s,o)}parseAsync(e,r,n){let o=this.parse(e,r,n);return Ju(o)?o:Promise.resolve(o)}parseSync(e,r,n){let o=this.parse(e,r,n);if(Ju(o))throw new Yp(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return o}parserConfiguration(e){return Ln("",[e],arguments.length),Bn(this,uze,e,"f"),this}pkgConf(e,r){Ln(" [string]",[e,r],arguments.length);let n=null,o=this[M9t](r||Pe(this,ZY,"f"));return o[e]&&typeof o[e]=="object"&&(n=ize(o[e],r||Pe(this,ZY,"f"),this[sK]()["deep-merge-config"]||!1,Pe(this,Yi,"f")),Pe(this,ni,"f").configObjects=(Pe(this,ni,"f").configObjects||[]).concat(n)),this}positional(e,r){Ln(" ",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=OQ(r,(c,l)=>c==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(c));let o=Pe(this,PIe,"f").fullCommands[Pe(this,PIe,"f").fullCommands.length-1],s=o?Pe(this,Kp,"f").cmdToParseOptions(o):{array:[],alias:{},default:{},demand:{}};return kle(s).forEach(c=>{let l=s[c];Array.isArray(l)?l.indexOf(e)!==-1&&(r[c]=!0):l[e]&&!(c in r)&&(r[c]=l[e])}),this.group(e,Pe(this,go,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return Ln("[boolean]",[e],arguments.length),Bn(this,dze,e,"f"),this}required(e,r,n){return this.demand(e,r,n)}require(e,r,n){return this.demand(e,r,n)}requiresArg(e){return Ln(" [number]",[e],arguments.length),typeof e=="string"&&Pe(this,ni,"f").narg[e]?this:(this[Nle](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return Ln("[string] [string]",[e,r],arguments.length),e=e||this.$0,Pe(this,eK,"f").log(Pe(this,NC,"f").generateCompletionScript(e,r||Pe(this,LS,"f")||"completion")),this}showHelp(e){if(Ln("[string|function]",[e],arguments.length),Bn(this,BS,!0,"f"),!Pe(this,go,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[DIe](Pe(this,FQ,"f"),void 0,void 0,0,!0);if(Ju(n))return n.then(()=>{Pe(this,go,"f").showHelp(e)}),this}let r=Pe(this,Kp,"f").runDefaultBuilderOn(this);if(Ju(r))return r.then(()=>{Pe(this,go,"f").showHelp(e)}),this}return Pe(this,go,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return Ln("[boolean|string] [string]",[e,r],arguments.length),Pe(this,go,"f").showHelpOnFail(e,r),this}showVersion(e){return Ln("[string|function]",[e],arguments.length),Pe(this,go,"f").showVersion(e),this}skipValidation(e){return Ln("",[e],arguments.length),this[UQ]("skipValidation",e),this}strict(e){return Ln("[boolean]",[e],arguments.length),Bn(this,nK,e!==!1,"f"),this}strictCommands(e){return Ln("[boolean]",[e],arguments.length),Bn(this,iK,e!==!1,"f"),this}strictOptions(e){return Ln("[boolean]",[e],arguments.length),Bn(this,oK,e!==!1,"f"),this}string(e){return Ln("",[e],arguments.length),this[UQ]("string",e),this[cK](e),this}terminalWidth(){return Ln([],0),Pe(this,Yi,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return Ln("",[e],arguments.length),Bn(this,XY,!1,"f"),Pe(this,Yi,"f").y18n.updateLocale(e),this}usage(e,r,n,o){if(Ln(" [string|boolean] [function|object] [function]",[e,r,n,o],arguments.length),r!==void 0){if(B_(e,null,Pe(this,Yi,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,o);throw new Yp(".usage() description must start with $0 if being used as alias for .command()")}else return Pe(this,go,"f").usage(e),this}usageConfiguration(e){return Ln("",[e],arguments.length),Bn(this,fze,e,"f"),this}version(e,r,n){let o="version";if(Ln("[boolean|string] [string] [string]",[e,r,n],arguments.length),Pe(this,aO,"f")&&(this[D9t](Pe(this,aO,"f")),Pe(this,go,"f").version(void 0),Bn(this,aO,null,"f")),arguments.length===0)n=this[s0n](),e=o;else if(arguments.length===1){if(e===!1)return this;n=e,e=o}else arguments.length===2&&(n=r,r=void 0);return Bn(this,aO,typeof e=="string"?e:o,"f"),r=r||Pe(this,go,"f").deferY18nLookup("Show version number"),Pe(this,go,"f").version(n||void 0),this.boolean(Pe(this,aO,"f")),this.describe(Pe(this,aO,"f"),r),this}wrap(e){return Ln("",[e],arguments.length),Pe(this,go,"f").wrap(e),this}[(Kp=new WeakMap,ZY=new WeakMap,PIe=new WeakMap,NC=new WeakMap,LS=new WeakMap,oze=new WeakMap,BQ=new WeakMap,XY=new WeakMap,sze=new WeakMap,Hx=new WeakMap,aze=new WeakMap,Gx=new WeakMap,sO=new WeakMap,BS=new WeakMap,$x=new WeakMap,cze=new WeakMap,eK=new WeakMap,cg=new WeakMap,ni=new WeakMap,lze=new WeakMap,uze=new WeakMap,FS=new WeakMap,tK=new WeakMap,Dle=new WeakMap,rK=new WeakMap,FQ=new WeakMap,dze=new WeakMap,Yi=new WeakMap,nK=new WeakMap,iK=new WeakMap,oK=new WeakMap,go=new WeakMap,fze=new WeakMap,aO=new WeakMap,Zf=new WeakMap,e0n)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[t0n](){return{log:a((...e)=>{this[pze]()||console.log(...e),Bn(this,BS,!0,"f"),Pe(this,cg,"f").length&&Bn(this,cg,Pe(this,cg,"f")+` -`,"f"),Bn(this,cg,Pe(this,cg,"f")+e.join(" "),"f")},"log"),error:a((...e)=>{this[pze]()||console.error(...e),Bn(this,BS,!0,"f"),Pe(this,cg,"f").length&&Bn(this,cg,Pe(this,cg,"f")+` -`,"f"),Bn(this,cg,Pe(this,cg,"f")+e.join(" "),"f")},"error")}}[D9t](e){kle(Pe(this,ni,"f")).forEach(r=>{if((o=>o==="configObjects")(r))return;let n=Pe(this,ni,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete Pe(this,go,"f").getDescriptions()[e]}[r0n](e,r,n){Pe(this,sze,"f")[n]||(Pe(this,Yi,"f").process.emitWarning(e,r),Pe(this,sze,"f")[n]=!0)}[n0n](){Pe(this,aze,"f").push({options:Pe(this,ni,"f"),configObjects:Pe(this,ni,"f").configObjects.slice(0),exitProcess:Pe(this,Hx,"f"),groups:Pe(this,sO,"f"),strict:Pe(this,nK,"f"),strictCommands:Pe(this,iK,"f"),strictOptions:Pe(this,oK,"f"),completionCommand:Pe(this,LS,"f"),output:Pe(this,cg,"f"),exitError:Pe(this,BQ,"f"),hasOutput:Pe(this,BS,"f"),parsed:this.parsed,parseFn:Pe(this,FS,"f"),parseContext:Pe(this,tK,"f")}),Pe(this,go,"f").freeze(),Pe(this,Zf,"f").freeze(),Pe(this,Kp,"f").freeze(),Pe(this,Gx,"f").freeze()}[i0n](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(Pe(this,Yi,"f").process.argv()[0])?r=Pe(this,Yi,"f").process.argv().slice(1,2):r=Pe(this,Yi,"f").process.argv().slice(0,1),e=r.map(n=>{let o=this[A0n](Pe(this,ZY,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&o.length{if(l.includes("package.json"))return"package.json"});B_(s,void 0,Pe(this,Yi,"f")),n=JSON.parse(Pe(this,Yi,"f").readFileSync(s,"utf8"))}catch{}return Pe(this,Dle,"f")[r]=n||{},Pe(this,Dle,"f")[r]}[UQ](e,r){r=[].concat(r),r.forEach(n=>{n=this[B9t](n),Pe(this,ni,"f")[e].push(n)})}[Nle](e,r,n,o){this[L9t](e,r,n,o,(s,c,l)=>{Pe(this,ni,"f")[s][c]=l})}[O9t](e,r,n,o){this[L9t](e,r,n,o,(s,c,l)=>{Pe(this,ni,"f")[s][c]=(Pe(this,ni,"f")[s][c]||[]).concat(l)})}[L9t](e,r,n,o,s){if(Array.isArray(n))n.forEach(c=>{e(c,o)});else if((c=>typeof c=="object")(n))for(let c of kle(n))e(c,n[c]);else s(r,this[B9t](n),o)}[B9t](e){return e==="__proto__"?"___proto___":e}[F9t](e,r){return this[Nle](this[F9t].bind(this),"key",e,r),this}[U9t](){var e,r,n,o,s,c,l,u,d,f,h,m;let g=Pe(this,aze,"f").pop();B_(g,void 0,Pe(this,Yi,"f"));let A;e=this,r=this,n=this,o=this,s=this,c=this,l=this,u=this,d=this,f=this,h=this,m=this,{options:{set value(y){Bn(e,ni,y,"f")}}.value,configObjects:A,exitProcess:{set value(y){Bn(r,Hx,y,"f")}}.value,groups:{set value(y){Bn(n,sO,y,"f")}}.value,output:{set value(y){Bn(o,cg,y,"f")}}.value,exitError:{set value(y){Bn(s,BQ,y,"f")}}.value,hasOutput:{set value(y){Bn(c,BS,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){Bn(l,nK,y,"f")}}.value,strictCommands:{set value(y){Bn(u,iK,y,"f")}}.value,strictOptions:{set value(y){Bn(d,oK,y,"f")}}.value,completionCommand:{set value(y){Bn(f,LS,y,"f")}}.value,parseFn:{set value(y){Bn(h,FS,y,"f")}}.value,parseContext:{set value(y){Bn(m,tK,y,"f")}}.value}=g,Pe(this,ni,"f").configObjects=A,Pe(this,go,"f").unfreeze(),Pe(this,Zf,"f").unfreeze(),Pe(this,Kp,"f").unfreeze(),Pe(this,Gx,"f").unfreeze()}[c0n](e,r){return JY(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[l0n].bind(this),getContext:this[u0n].bind(this),getHasOutput:this[d0n].bind(this),getLoggerInstance:this[f0n].bind(this),getParseContext:this[p0n].bind(this),getParserConfiguration:this[sK].bind(this),getUsageConfiguration:this[o0n].bind(this),getUsageInstance:this[h0n].bind(this),getValidationInstance:this[m0n].bind(this),hasParseCallback:this[pze].bind(this),isGlobalContext:this[g0n].bind(this),postProcess:this[aK].bind(this),reset:this[Q9t].bind(this),runValidation:this[q9t].bind(this),runYargsParserAndExecuteCommands:this[DIe].bind(this),setHasOutput:this[y0n].bind(this)}}[l0n](){return Pe(this,Kp,"f")}[u0n](){return Pe(this,PIe,"f")}[d0n](){return Pe(this,BS,"f")}[f0n](){return Pe(this,eK,"f")}[p0n](){return Pe(this,tK,"f")||{}}[h0n](){return Pe(this,go,"f")}[m0n](){return Pe(this,Zf,"f")}[pze](){return!!Pe(this,FS,"f")}[g0n](){return Pe(this,cze,"f")}[aK](e,r,n,o){return n||Ju(e)||(r||(e=this[e0n](e)),(this[sK]()["parse-positional-numbers"]||this[sK]()["parse-positional-numbers"]===void 0)&&(e=this[a0n](e)),o&&(e=KY(e,this,Pe(this,Gx,"f").getMiddleware(),!1))),e}[Q9t](e={}){Bn(this,ni,Pe(this,ni,"f")||{},"f");let r={};r.local=Pe(this,ni,"f").local||[],r.configObjects=Pe(this,ni,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(e[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(Pe(this,rK,"f"),Object.keys(Pe(this,sO,"f")).reduce((c,l)=>{let u=Pe(this,sO,"f")[l].filter(d=>!(d in n));return u.length>0&&(c[l]=u),c},{})),Bn(this,sO,{},"f");let o=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return o.forEach(c=>{r[c]=(Pe(this,ni,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=OQ(Pe(this,ni,"f")[c],l=>!n[l])}),r.envPrefix=Pe(this,ni,"f").envPrefix,Bn(this,ni,r,"f"),Bn(this,go,Pe(this,go,"f")?Pe(this,go,"f").reset(n):Vmn(this,Pe(this,Yi,"f")),"f"),Bn(this,Zf,Pe(this,Zf,"f")?Pe(this,Zf,"f").reset(n):Zmn(this,Pe(this,go,"f"),Pe(this,Yi,"f")),"f"),Bn(this,Kp,Pe(this,Kp,"f")?Pe(this,Kp,"f").reset():Hmn(Pe(this,go,"f"),Pe(this,Zf,"f"),Pe(this,Gx,"f"),Pe(this,Yi,"f")),"f"),Pe(this,NC,"f")||Bn(this,NC,Ymn(this,Pe(this,go,"f"),Pe(this,Kp,"f"),Pe(this,Yi,"f")),"f"),Pe(this,Gx,"f").reset(),Bn(this,LS,null,"f"),Bn(this,cg,"","f"),Bn(this,BQ,null,"f"),Bn(this,BS,!1,"f"),this.parsed=!1,this}[A0n](e,r){return Pe(this,Yi,"f").path.relative(e,r)}[DIe](e,r,n,o=0,s=!1){var c,l,u,d;let f=!!n||s;e=e||Pe(this,FQ,"f"),Pe(this,ni,"f").__=Pe(this,Yi,"f").y18n.__,Pe(this,ni,"f").configuration=this[sK]();let h=!!Pe(this,ni,"f").configuration["populate--"],m=Object.assign({},Pe(this,ni,"f").configuration,{"populate--":!0}),g=Pe(this,Yi,"f").Parser.detailed(e,Object.assign({},Pe(this,ni,"f"),{configuration:{"parse-positional-numbers":!1,...m}})),A=Object.assign(g.argv,Pe(this,tK,"f")),y,E=g.aliases,_=!1,v=!1;Object.keys(A).forEach(b=>{b===Pe(this,$x,"f")&&A[b]?_=!0:b===Pe(this,aO,"f")&&A[b]&&(v=!0)}),A.$0=this.$0,this.parsed=g,o===0&&Pe(this,go,"f").clearCachedHelpMessage();try{if(this[N9t](),r)return this[aK](A,h,!!n,!1);Pe(this,$x,"f")&&[Pe(this,$x,"f")].concat(E[Pe(this,$x,"f")]||[]).filter(x=>x.length>1).includes(""+A._[A._.length-1])&&(A._.pop(),_=!0),Bn(this,cze,!1,"f");let b=Pe(this,Kp,"f").getCommands(),T=!((c=Pe(this,NC,"f"))===null||c===void 0)&&c.completionKey?[(l=Pe(this,NC,"f"))===null||l===void 0?void 0:l.completionKey,...(d=this.getAliases()[(u=Pe(this,NC,"f"))===null||u===void 0?void 0:u.completionKey])!==null&&d!==void 0?d:[]].some(R=>Object.prototype.hasOwnProperty.call(A,R)):!1,w=_||T||s;if(A._.length){if(b.length){let R;for(let x=o||0,P;A._[x]!==void 0;x++)if(P=String(A._[x]),b.includes(P)&&P!==Pe(this,LS,"f")){let D=Pe(this,Kp,"f").runCommand(P,this,g,x+1,s,_||v||s);return this[aK](D,h,!!n,!1)}else if(!R&&P!==Pe(this,LS,"f")){R=P;break}!Pe(this,Kp,"f").hasDefaultCommand()&&Pe(this,dze,"f")&&R&&!w&&Pe(this,Zf,"f").recommendCommands(R,b)}Pe(this,LS,"f")&&A._.includes(Pe(this,LS,"f"))&&!T&&(Pe(this,Hx,"f")&&LQ(!0),this.showCompletionScript(),this.exit(0))}if(Pe(this,Kp,"f").hasDefaultCommand()&&!w){let R=Pe(this,Kp,"f").runCommand(null,this,g,0,s,_||v||s);return this[aK](R,h,!!n,!1)}if(T){Pe(this,Hx,"f")&&LQ(!0),e=[].concat(e);let R=e.slice(e.indexOf(`--${Pe(this,NC,"f").completionKey}`)+1);return Pe(this,NC,"f").getCompletion(R,(x,P)=>{if(x)throw new Yp(x.message);(P||[]).forEach(D=>{Pe(this,eK,"f").log(D)}),this.exit(0)}),this[aK](A,!h,!!n,!1)}if(Pe(this,BS,"f")||(_?(Pe(this,Hx,"f")&&LQ(!0),f=!0,this.showHelp(R=>{Pe(this,eK,"f").log(R),this.exit(0)})):v&&(Pe(this,Hx,"f")&&LQ(!0),f=!0,Pe(this,go,"f").showVersion("log"),this.exit(0))),!f&&Pe(this,ni,"f").skipValidation.length>0&&(f=Object.keys(A).some(R=>Pe(this,ni,"f").skipValidation.indexOf(R)>=0&&A[R]===!0)),!f){if(g.error)throw new Yp(g.error.message);if(!T){let R=this[q9t](E,{},g.error);n||(y=KY(A,this,Pe(this,Gx,"f").getMiddleware(),!0)),y=this[c0n](R,y??A),Ju(y)&&!n&&(y=y.then(()=>KY(A,this,Pe(this,Gx,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof Yp)Pe(this,go,"f").fail(b.message,b);else throw b}return this[aK](y??A,h,!!n,!0)}[q9t](e,r,n,o){let s={...this.getDemandedOptions()};return c=>{if(n)throw new Yp(n.message);Pe(this,Zf,"f").nonOptionCount(c),Pe(this,Zf,"f").requiredArguments(c,s);let l=!1;Pe(this,iK,"f")&&(l=Pe(this,Zf,"f").unknownCommands(c)),Pe(this,nK,"f")&&!l?Pe(this,Zf,"f").unknownArguments(c,e,r,!!o):Pe(this,oK,"f")&&Pe(this,Zf,"f").unknownArguments(c,e,{},!1,!1),Pe(this,Zf,"f").limitedChoices(c),Pe(this,Zf,"f").implications(c),Pe(this,Zf,"f").conflicting(c)}}[y0n](){Bn(this,BS,!0,"f")}[cK](e){if(typeof e=="string")Pe(this,ni,"f").key[e]=!0;else for(let r of e)Pe(this,ni,"f").key[r]=!0}};function Gmn(t){return!!t&&typeof t.getInternalMethods=="function"}a(Gmn,"isYargsInstance");var y8o=E0n(Fmn),_0n=y8o;p();p();var b0n=require("node:child_process"),S0n=require("node:util");var E8o=(0,S0n.promisify)(b0n.execFile),QQ="1.0.60",v0n="COPILOT_CLI_PATH",_8o="GITHUB_COPILOT_ACP_USE_CLI",Mle="@github/copilot",v8o=3e4,C8o=1e4,C0n=6e4,Ole=class extends Error{static{a(this,"CLIDiscoveryError")}constructor(e){super(e),this.name="CLIDiscoveryError"}};function T0n(){return process.env[_8o]!=="0"}a(T0n,"isCLIIntegrationEnabled");var H9t=process.platform==="win32";async function I0n(){if(process.env[v0n]){let l=process.env[v0n],u=await NIe(l,["--version"]);if(u)return S8o(u,"COPILOT_CLI_PATH"),{path:l,args:[],version:u,source:"env"};throw new Ole("Copilot CLI not found at COPILOT_CLI_PATH. Ensure the path is correct and the binary is executable.")}let t=await NIe("copilot",["--version"]);if(t&&MIe(t,QQ))return{path:"copilot",args:[],version:t,source:"path"};let e=process.platform==="win32"?"npx.cmd":"npx",r=await NIe(e,["--offline",Mle,"--version"],!1,C8o);if(r&&MIe(r,QQ))return{path:e,args:[Mle],version:r,source:"npx"};let n=`${Mle}@${QQ}`,o=await NIe(e,[n,"--version"],!1,C0n);if(o&&MIe(o,QQ))return{path:e,args:[n],version:o,source:"npx-pinned"};let s=`${Mle}@latest`,c=await NIe(e,[s,"--version"],!0,C0n);if(c){if(MIe(c,QQ))return{path:e,args:[s],version:c,source:"npx-latest"};throw new Ole(`Latest published Copilot CLI version ${c} is below the minimum required ${QQ}.`)}throw new Ole(`Copilot CLI version could not be determined. 'npx ${s} --version' ran successfully but its output contained no recognisable version. -Try running 'npx ${s} --version' manually to inspect the output, or install/update globally with: npm install -g ${Mle}`)}a(I0n,"discoverCLI");function b8o(t){let e=t.match(/(\d+\.\d+\.\d+)/);return e?e[1]:null}a(b8o,"parseVersion");async function NIe(t,e,r=!1,n=v8o){try{let{stdout:o}=await E8o(t,e,{timeout:n,shell:H9t});return b8o(o)}catch(o){if(r)throw o;return null}}a(NIe,"tryGetVersion");function S8o(t,e){if(!MIe(t,QQ))throw new Ole(`Copilot CLI version ${t} (from ${e}) is below the minimum required version ${QQ}. Update with: npm install -g ${Mle}@latest`)}a(S8o,"validateVersion");function MIe(t,e){let r=a(c=>c.replace(/^v/,"").split(".").map(l=>{let u=parseInt(l,10);return isNaN(u)?0:u}),"parse"),n=r(t),o=r(e),s=Math.max(n.length,o.length);for(let c=0;cu)return!0;if(lr.type==="file").map(r=>r.uri).filter(Boolean),...this.request.activeEditor?.uri?[this.request.activeEditor.uri]:[]];return Array.from(new Set(e))}getMetadata(e){return this._metadata.get(e)?.at(-1)}getAllMetadata(e){return this._metadata.get(e)}setMetadata(e){let r=e.constructor,n=this._metadata.get(r)??[];n.push(e),this._metadata.set(r,n)}hasMetadata(e){let r=this._metadata.get(e);return r!==void 0&&r.length>0}isSubagent(){return this.parentTurnId!==void 0&&this.parentTurnId!==""}},lK=class t{constructor(e=[],r="panel",n="en",o){this.turns=e;this.source=r;this.userLanguage=n;this._telemetryId=Mt();this._timestamp=Date.now();this.uriSchemeCache=new hze;this.currentPartitionId=1;this.id=o??this.telemetryId}static{a(this,"Conversation")}copy(){let e=JSON.parse(JSON.stringify(this.turns)),r=new t(e,this.source,this.userLanguage,this.id);return r._telemetryId=this.telemetryId,r._timestamp=this.timestamp,r.currentPartitionId=this.currentPartitionId,r}get telemetryId(){return this._telemetryId}get timestamp(){return this._timestamp}addTurn(e){this.turns.push(e)}deleteTurn(e){this.turns=this.turns.filter(r=>r.id!==e)}getLastTurn(){return this.turns[this.turns.length-1]}findTurn(e){return this.turns.find(r=>r.id===e)}};p();p();var Vx=class{constructor(){this.promiseMap=new Map}static{a(this,"SequencerByKey")}queue(e,r){let o=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(r).finally(()=>{this.promiseMap.get(e)===o&&this.promiseMap.delete(e)});return this.promiseMap.set(e,o),o}async drain(){let e=Array.from(this.promiseMap.values());await Promise.all(e.map(r=>r.catch(()=>{})))}};p();var uK=(n=>(n.Local="LOCAL",n.Background="BACKGROUND",n.Claude="CLAUDE",n))(uK||{}),T8o=Object.values(uK);function x3(t){let e=new Set;for(let r of t??[]){let n=r.providers;if(Array.isArray(n))for(let o of n)e.add(o)}return e.size===0?["LOCAL","BACKGROUND"]:T8o.filter(r=>e.has(r))}a(x3,"unionProviders");function cO(t,e){return t?["BACKGROUND"]:e?.length?[...e]:["LOCAL","BACKGROUND"]}a(cO,"providersForListRow");p();p();p();var dK=de(require("child_process")),$9t=de(require("path")),H0n=de(j0n());function G0n(t){return t.replace(/^git version /,"")}a(G0n,"parseVersion");function V9t(t){return new Promise((e,r)=>{let n=[],o=dK.spawn(t,["--version"]);o.stdout.on("data",s=>n.push(s)),o.on("error",r),o.on("close",s=>s?r(new Error(`Not found. Code: ${s}`)):e({path:t,version:G0n(Buffer.concat(n).toString("utf8").trim())}))})}a(V9t,"findSpecificGit");function F8o(){return new Promise((t,e)=>{dK.exec("which git",(r,n)=>{if(r)return e(new Error(`Executing "which git" failed: ${r.message}`));let o=n.toString().trim();function s(c){dK.execFile(c,["--version"],(l,u)=>l?e(new Error(`Executing "${c} --version" failed: ${l.message}`)):t({path:c,version:G0n(u.toString().trim())}))}if(a(s,"getVersion"),o!=="/usr/bin/git")return s(o);dK.exec("xcode-select -p",c=>{if(c&&c.code===2)return e(new Error('Executing "xcode-select -p" failed with error code 2.'));s(o)})})})}a(F8o,"findGitDarwin");function mze(t){return t?V9t($9t.join(t,"Git","cmd","git.exe")):Promise.reject(new Error("Not found"))}a(mze,"findSystemGitWin32");async function U8o(){let t=await(0,H0n.default)("git.exe");return V9t(t)}a(U8o,"findGitWin32InPath");function Q8o(){return mze(process.env.ProgramW6432).then(void 0,()=>mze(process.env["ProgramFiles(x86)"])).then(void 0,()=>mze(process.env.ProgramFiles)).then(void 0,()=>mze($9t.join(process.env.LocalAppData,"Programs"))).then(void 0,()=>U8o())}a(Q8o,"findGitWin32");async function lO(){try{switch(process.platform){case"darwin":return await F8o();case"win32":return await Q8o();default:return await V9t("git")}}catch(t){throw new Error(`Git installation not found in trusted locations: ${t.message}`)}}a(lO,"findGit");var $0n=require("node:child_process"),V0n=require("node:util");var q8o=(0,V0n.promisify)($0n.execFile);async function W0n(t){return W9t(t,["github.com"])}a(W0n,"resolveGitHubNwo");async function W9t(t,e){let r;try{r=(await lO()).path}catch{return}let n;try{n=(await q8o(r,["remote","get-url","origin"],{cwd:t,timeout:5e3,windowsHide:!0})).stdout}catch{return}return j8o(n,e)}a(W9t,"resolveGitHubNwoForHosts");function j8o(t,e){let r=new Set(["github.com",...e.map(h=>h.toLowerCase())]),n=t.trim().match(/^(?:(?:https?|ssh|git):\/\/(?:[^@]+@)?|git@)([^/:]+)(?::\d+)?[:/](.+?)(?:\.git)?$/);if(!n)return;let[,o,s]=n;if(!r.has(o.toLowerCase()))return;let c=s.indexOf("/");if(c<=0)return;let l=s.slice(0,c),u=s.slice(c+1),d=u.indexOf("/"),f=d>=0?u.slice(0,d):u;if(!(!l||!f))return{owner:l,repo:f}}a(j8o,"parseGitRemoteUrl");async function z0n(t,e,r=fetch){let n=`https://api.github.com/repos/${encodeURIComponent(t.owner)}/${encodeURIComponent(t.repo)}`,o;try{o=await r(n,{headers:{Authorization:`token ${e}`,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}})}catch{return}if(!o.ok)return;let s=await o.json();if(!(typeof s.id!="number"||typeof s.owner?.id!="number"))return{ownerId:s.owner.id,repoId:s.id}}a(z0n,"resolveRepoIds");p();var H8o=3e4,gze=class{constructor(e,r=H8o){this.ctx=e;this.timeoutMs=r;this.logger=new fe("OrgCustomAgentClient")}static{a(this,"OrgCustomAgentClient")}async listCustomAgents(e,r){let n=this.ctx,o=await this.tryGetAccessToken();if(!o)return;let s=bB(n).api,c=`${Y0n(s)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}?include_sources=org,enterprise`;try{let l=await n.get(tr).fetch(c,{method:"GET",headers:{Authorization:`Bearer ${o}`,Accept:"application/json",...i0(n)},timeout:this.timeoutMs});if(!l.ok){this.logger.warn(n,`[OrgCustomAgentClient] list ${e}/${r} -> ${l.status}`);return}let u=await l.json();return Array.isArray(u?.agents)?u.agents:[]}catch(l){this.logger.warn(n,`[OrgCustomAgentClient] list ${e}/${r} failed: ${String(l)}`);return}}async getCustomAgentDetails(e,r,n,o){let s=this.ctx,c=await this.tryGetAccessToken();if(!c)return;let l=bB(s).api,u=new URL(`${Y0n(l)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}/${encodeURIComponent(n)}`);u.searchParams.set("version",o);try{let d=await s.get(tr).fetch(u.toString(),{method:"GET",headers:{Authorization:`Bearer ${c}`,Accept:"application/json",...i0(s)},timeout:this.timeoutMs});if(!d.ok){this.logger.warn(s,`[OrgCustomAgentClient] detail ${e}/${r}/${n}?version=${o} -> ${d.status}`);return}return await d.json()}catch(d){this.logger.warn(s,`[OrgCustomAgentClient] detail ${e}/${r}/${n}?version=${o} failed: ${String(d)}`);return}}async tryGetAccessToken(){try{return(await this.ctx.get(Ur).resolveSession())?.accessToken}catch(e){this.logger.debug(this.ctx,`[OrgCustomAgentClient] no GitHub session: ${String(e)}`);return}}};function Y0n(t){return t.endsWith("/")?t.slice(0,-1):t}a(Y0n,"trimTrailingSlash");p();p();var G8o=Object.create,K0n=Object.defineProperty,$8o=Object.getOwnPropertyDescriptor,V8o=Object.getOwnPropertyNames,W8o=Object.getPrototypeOf,z8o=Object.prototype.hasOwnProperty,Zu=a((t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),"__commonJSMin"),Y8o=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(var o=V8o(e),s=0,c=o.length,l;se[u]).bind(null,l),enumerable:!(n=$8o(e,l))||n.enumerable});return t},"__copyProps"),K8o=a((t,e,r)=>(r=t!=null?G8o(W8o(t)):{},Y8o(e||!t||!t.__esModule?K0n(r,"default",{value:t,enumerable:!0}):r,t)),"__toESM"),OIe=Zu(((t,e)=>{function r(u){return typeof u>"u"||u===null}a(r,"isNothing");function n(u){return typeof u=="object"&&u!==null}a(n,"isObject");function o(u){return Array.isArray(u)?u:r(u)?[]:[u]}a(o,"toArray");function s(u,d){if(d){let f=Object.keys(d);for(let h=0,m=f.length;h{function r(o,s){let c="",l=o.reason||"(unknown reason)";return o.mark?(o.mark.name&&(c+='in "'+o.mark.name+'" '),c+="("+(o.mark.line+1)+":"+(o.mark.column+1)+")",!s&&o.mark.snippet&&(c+=` - -`+o.mark.snippet),l+" "+c):l}a(r,"formatError");function n(o,s){Error.call(this),this.name="YAMLException",this.reason=o,this.mark=s,this.message=r(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}a(n,"YAMLException"),n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.prototype.toString=a(function(s){return this.name+": "+r(this,s)},"toString"),e.exports=n})),J8o=Zu(((t,e)=>{var r=OIe();function n(c,l,u,d,f){let h="",m="",g=Math.floor(f/2)-1;return d-l>g&&(h=" ... ",l=d-g+h.length),u-d>g&&(m=" ...",u=d+g-m.length),{str:h+c.slice(l,u).replace(/\t/g,"\u2192")+m,pos:d-l+h.length}}a(n,"getLine");function o(c,l){return r.repeat(" ",l-c.length)+c}a(o,"padStart");function s(c,l){if(l=Object.create(l||null),!c.buffer)return null;l.maxLength||(l.maxLength=79),typeof l.indent!="number"&&(l.indent=1),typeof l.linesBefore!="number"&&(l.linesBefore=3),typeof l.linesAfter!="number"&&(l.linesAfter=2);let u=/\r?\n|\r|\0/g,d=[0],f=[],h,m=-1;for(;h=u.exec(c.buffer);)f.push(h.index),d.push(h.index+h[0].length),c.position<=h.index&&m<0&&(m=d.length-2);m<0&&(m=d.length-1);let g="",A=Math.min(c.line+l.linesAfter,f.length).toString().length,y=l.maxLength-(l.indent+A+3);for(let _=1;_<=l.linesBefore&&!(m-_<0);_++){let v=n(c.buffer,d[m-_],f[m-_],c.position-(d[m]-d[m-_]),y);g=r.repeat(" ",l.indent)+o((c.line-_+1).toString(),A)+" | "+v.str+` -`+g}let E=n(c.buffer,d[m],f[m],c.position,y);g+=r.repeat(" ",l.indent)+o((c.line+1).toString(),A)+" | "+E.str+` -`,g+=r.repeat("-",l.indent+A+3+E.pos)+`^ -`;for(let _=1;_<=l.linesAfter&&!(m+_>=f.length);_++){let v=n(c.buffer,d[m+_],f[m+_],c.position-(d[m]-d[m+_]),y);g+=r.repeat(" ",l.indent)+o((c.line+_+1).toString(),A)+" | "+v.str+` -`}return g.replace(/\n$/,"")}a(s,"makeSnippet"),e.exports=s})),U_=Zu(((t,e)=>{var r=LIe(),n=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];function s(l){let u={};return l!==null&&Object.keys(l).forEach(function(d){l[d].forEach(function(f){u[String(f)]=d})}),u}a(s,"compileStyleAliases");function c(l,u){if(u=u||{},Object.keys(u).forEach(function(d){if(n.indexOf(d)===-1)throw new r('Unknown option "'+d+'" is met in definition of "'+l+'" YAML type.')}),this.options=u,this.tag=l,this.kind=u.kind||null,this.resolve=u.resolve||function(){return!0},this.construct=u.construct||function(d){return d},this.instanceOf=u.instanceOf||null,this.predicate=u.predicate||null,this.represent=u.represent||null,this.representName=u.representName||null,this.defaultStyle=u.defaultStyle||null,this.multi=u.multi||!1,this.styleAliases=s(u.styleAliases||null),o.indexOf(this.kind)===-1)throw new r('Unknown kind "'+this.kind+'" is specified for "'+l+'" YAML type.')}a(c,"Type"),e.exports=c})),J0n=Zu(((t,e)=>{var r=LIe(),n=U_();function o(l,u){let d=[];return l[u].forEach(function(f){let h=d.length;d.forEach(function(m,g){m.tag===f.tag&&m.kind===f.kind&&m.multi===f.multi&&(h=g)}),d[h]=f}),d}a(o,"compileList");function s(){let l={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function u(d){d.multi?(l.multi[d.kind].push(d),l.multi.fallback.push(d)):l[d.kind][d.tag]=l.fallback[d.tag]=d}a(u,"collectType");for(let d=0,f=arguments.length;d{e.exports=new(U_())("tag:yaml.org,2002:str",{kind:"scalar",construct:a(function(r){return r!==null?r:""},"construct")})})),X0n=Zu(((t,e)=>{e.exports=new(U_())("tag:yaml.org,2002:seq",{kind:"sequence",construct:a(function(r){return r!==null?r:[]},"construct")})})),egn=Zu(((t,e)=>{e.exports=new(U_())("tag:yaml.org,2002:map",{kind:"mapping",construct:a(function(r){return r!==null?r:{}},"construct")})})),tgn=Zu(((t,e)=>{e.exports=new(J0n())({explicit:[Z0n(),X0n(),egn()]})})),rgn=Zu(((t,e)=>{var r=U_();function n(c){if(c===null)return!0;let l=c.length;return l===1&&c==="~"||l===4&&(c==="null"||c==="Null"||c==="NULL")}a(n,"resolveYamlNull");function o(){return null}a(o,"constructYamlNull");function s(c){return c===null}a(s,"isNull"),e.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:n,construct:o,predicate:s,represent:{canonical:a(function(){return"~"},"canonical"),lowercase:a(function(){return"null"},"lowercase"),uppercase:a(function(){return"NULL"},"uppercase"),camelcase:a(function(){return"Null"},"camelcase"),empty:a(function(){return""},"empty")},defaultStyle:"lowercase"})})),ngn=Zu(((t,e)=>{var r=U_();function n(c){if(c===null)return!1;let l=c.length;return l===4&&(c==="true"||c==="True"||c==="TRUE")||l===5&&(c==="false"||c==="False"||c==="FALSE")}a(n,"resolveYamlBoolean");function o(c){return c==="true"||c==="True"||c==="TRUE"}a(o,"constructYamlBoolean");function s(c){return Object.prototype.toString.call(c)==="[object Boolean]"}a(s,"isBoolean"),e.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:n,construct:o,predicate:s,represent:{lowercase:a(function(c){return c?"true":"false"},"lowercase"),uppercase:a(function(c){return c?"TRUE":"FALSE"},"uppercase"),camelcase:a(function(c){return c?"True":"False"},"camelcase")},defaultStyle:"lowercase"})})),ign=Zu(((t,e)=>{var r=OIe(),n=U_();function o(h){return h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102}a(o,"isHexCode");function s(h){return h>=48&&h<=55}a(s,"isOctCode");function c(h){return h>=48&&h<=57}a(c,"isDecCode");function l(h){if(h===null)return!1;let m=h.length,g=0,A=!1;if(!m)return!1;let y=h[g];if((y==="-"||y==="+")&&(y=h[++g]),y==="0"){if(g+1===m)return!0;if(y=h[++g],y==="b"){for(g++;g=0?"0b"+h.toString(2):"-0b"+h.toString(2).slice(1)},"binary"),octal:a(function(h){return h>=0?"0o"+h.toString(8):"-0o"+h.toString(8).slice(1)},"octal"),decimal:a(function(h){return h.toString(10)},"decimal"),hexadecimal:a(function(h){return h>=0?"0x"+h.toString(16).toUpperCase():"-0x"+h.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})})),ogn=Zu(((t,e)=>{var r=OIe(),n=U_(),o=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),s=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function c(h){return h===null||!o.test(h)?!1:Number.isFinite(parseFloat(h,10))?!0:s.test(h)}a(c,"resolveYamlFloat");function l(h){let m=h.toLowerCase(),g=m[0]==="-"?-1:1;return"+-".indexOf(m[0])>=0&&(m=m.slice(1)),m===".inf"?g===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:m===".nan"?NaN:g*parseFloat(m,10)}a(l,"constructYamlFloat");var u=/^[-+]?[0-9]+e/;function d(h,m){if(isNaN(h))switch(m){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===h)switch(m){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===h)switch(m){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(h))return"-0.0";let g=h.toString(10);return u.test(g)?g.replace("e",".e"):g}a(d,"representYamlFloat");function f(h){return Object.prototype.toString.call(h)==="[object Number]"&&(h%1!==0||r.isNegativeZero(h))}a(f,"isFloat"),e.exports=new n("tag:yaml.org,2002:float",{kind:"scalar",resolve:c,construct:l,predicate:f,represent:d,defaultStyle:"lowercase"})})),sgn=Zu(((t,e)=>{e.exports=tgn().extend({implicit:[rgn(),ngn(),ign(),ogn()]})})),agn=Zu(((t,e)=>{e.exports=sgn()})),cgn=Zu(((t,e)=>{var r=U_(),n=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function s(u){return u===null?!1:n.exec(u)!==null||o.exec(u)!==null}a(s,"resolveYamlTimestamp");function c(u){let d=0,f=null,h=n.exec(u);if(h===null&&(h=o.exec(u)),h===null)throw new Error("Date resolve error");let m=+h[1],g=+h[2]-1,A=+h[3];if(!h[4])return new Date(Date.UTC(m,g,A));let y=+h[4],E=+h[5],_=+h[6];if(h[7]){for(d=h[7].slice(0,3);d.length<3;)d+="0";d=+d}if(h[9]){let b=+h[10],T=+(h[11]||0);f=(b*60+T)*6e4,h[9]==="-"&&(f=-f)}let v=new Date(Date.UTC(m,g,A,y,E,_,d));return f&&v.setTime(v.getTime()-f),v}a(c,"constructYamlTimestamp");function l(u){return u.toISOString()}a(l,"representYamlTimestamp"),e.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:s,construct:c,instanceOf:Date,represent:l})})),lgn=Zu(((t,e)=>{var r=U_();function n(o){return o==="<<"||o===null}a(n,"resolveYamlMerge"),e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:n})})),ugn=Zu(((t,e)=>{var r=U_(),n=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function o(u){if(u===null)return!1;let d=0,f=u.length,h=n;for(let m=0;m64)){if(g<0)return!1;d+=6}}return d%8===0}a(o,"resolveYamlBinary");function s(u){let d=u.replace(/[\r\n=]/g,""),f=d.length,h=n,m=0,g=[];for(let y=0;y>16&255),g.push(m>>8&255),g.push(m&255)),m=m<<6|h.indexOf(d.charAt(y));let A=f%4*6;return A===0?(g.push(m>>16&255),g.push(m>>8&255),g.push(m&255)):A===18?(g.push(m>>10&255),g.push(m>>2&255)):A===12&&g.push(m>>4&255),new Uint8Array(g)}a(s,"constructYamlBinary");function c(u){let d="",f=0,h=u.length,m=n;for(let A=0;A>18&63],d+=m[f>>12&63],d+=m[f>>6&63],d+=m[f&63]),f=(f<<8)+u[A];let g=h%3;return g===0?(d+=m[f>>18&63],d+=m[f>>12&63],d+=m[f>>6&63],d+=m[f&63]):g===2?(d+=m[f>>10&63],d+=m[f>>4&63],d+=m[f<<2&63],d+=m[64]):g===1&&(d+=m[f>>2&63],d+=m[f<<4&63],d+=m[64],d+=m[64]),d}a(c,"representYamlBinary");function l(u){return Object.prototype.toString.call(u)==="[object Uint8Array]"}a(l,"isBinary"),e.exports=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:o,construct:s,predicate:l,represent:c})})),dgn=Zu(((t,e)=>{var r=U_(),n=Object.prototype.hasOwnProperty,o=Object.prototype.toString;function s(l){if(l===null)return!0;let u=[],d=l;for(let f=0,h=d.length;f{var r=U_(),n=Object.prototype.toString;function o(c){if(c===null)return!0;let l=c,u=new Array(l.length);for(let d=0,f=l.length;d{var r=U_(),n=Object.prototype.hasOwnProperty;function o(c){if(c===null)return!0;let l=c;for(let u in l)if(n.call(l,u)&&l[u]!==null)return!1;return!0}a(o,"resolveYamlSet");function s(c){return c!==null?c:{}}a(s,"constructYamlSet"),e.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:o,construct:s})})),z9t=Zu(((t,e)=>{e.exports=agn().extend({implicit:[cgn(),lgn()],explicit:[ugn(),dgn(),fgn(),pgn()]})})),Z8o=Zu(((t,e)=>{var r=OIe(),n=LIe(),o=J8o(),s=z9t(),c=Object.prototype.hasOwnProperty,l=1,u=2,d=3,f=4,h=1,m=2,g=3,A=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/[\x85\u2028\u2029]/,E=/[,\[\]{}]/,_=/^(?:!|!!|![0-9A-Za-z-]+!)$/,v=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function b(F){return Object.prototype.toString.call(F)}a(b,"_class");function T(F){return F===10||F===13}a(T,"isEol");function w(F){return F===9||F===32}a(w,"isWhiteSpace");function R(F){return F===9||F===32||F===10||F===13}a(R,"isWsOrEol");function x(F){return F===44||F===91||F===93||F===123||F===125}a(x,"isFlowIndicator");function P(F){if(F>=48&&F<=57)return F-48;let be=F|32;return be>=97&&be<=102?be-97+10:-1}a(P,"fromHexCode");function D(F){return F===120?2:F===117?4:F===85?8:0}a(D,"escapedHexLen");function N(F){return F>=48&&F<=57?F-48:-1}a(N,"fromDecimalCode");function L(F){switch(F){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return` -`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}a(L,"simpleEscapeSequence");function B(F){return F<=65535?String.fromCharCode(F):String.fromCharCode((F-65536>>10)+55296,(F-65536&1023)+56320)}a(B,"charFromCodepoint");function q(F,be,Qe){be==="__proto__"?Object.defineProperty(F,be,{configurable:!0,enumerable:!0,writable:!0,value:Qe}):F[be]=Qe}a(q,"setProperty");var M=new Array(256),O=new Array(256);for(let F=0;F<256;F++)M[F]=L(F)?1:0,O[F]=L(F);function j(F,be){this.input=F,this.filename=be.filename||null,this.schema=be.schema||s,this.onWarning=be.onWarning||null,this.legacy=be.legacy||!1,this.json=be.json||!1,this.listener=be.listener||null,this.maxDepth=typeof be.maxDepth=="number"?be.maxDepth:100,this.maxMergeSeqLength=typeof be.maxMergeSeqLength=="number"?be.maxMergeSeqLength:20,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=F.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}a(j,"State");function Q(F,be){let Qe={name:F.filename,buffer:F.input.slice(0,-1),position:F.position,line:F.line,column:F.position-F.lineStart};return Qe.snippet=o(Qe),new n(be,Qe)}a(Q,"generateError");function U(F,be){throw Q(F,be)}a(U,"throwError");function Y(F,be){F.onWarning&&F.onWarning.call(null,Q(F,be))}a(Y,"throwWarning");function W(F,be,Qe){let pe=F.anchorMapTransactions;if(pe.length!==0){let Se=pe[pe.length-1];c.call(Se,be)||(Se[be]={existed:c.call(F.anchorMap,be),value:F.anchorMap[be]})}F.anchorMap[be]=Qe}a(W,"storeAnchor");function V(F){F.anchorMapTransactions.push(Object.create(null))}a(V,"beginAnchorTransaction");function z(F){let be=F.anchorMapTransactions.pop(),Qe=F.anchorMapTransactions;if(Qe.length===0)return;let pe=Qe[Qe.length-1],Se=Object.keys(be);for(let Fe=0,te=Se.length;Fe=0;pe-=1){let Se=be[Qe[pe]];Se.existed?F.anchorMap[Qe[pe]]=Se.value:delete F.anchorMap[Qe[pe]]}}a(ie,"rollbackAnchorTransaction");function H(F){return{position:F.position,line:F.line,lineStart:F.lineStart,lineIndent:F.lineIndent,firstTabInLine:F.firstTabInLine,tag:F.tag,anchor:F.anchor,kind:F.kind,result:F.result}}a(H,"snapshotState");function re(F,be){F.position=be.position,F.line=be.line,F.lineStart=be.lineStart,F.lineIndent=be.lineIndent,F.firstTabInLine=be.firstTabInLine,F.tag=be.tag,F.anchor=be.anchor,F.kind=be.kind,F.result=be.result}a(re,"restoreState");var le={YAML:a(function(be,Qe,pe){be.version!==null&&U(be,"duplication of %YAML directive"),pe.length!==1&&U(be,"YAML directive accepts exactly one argument");let Se=/^([0-9]+)\.([0-9]+)$/.exec(pe[0]);Se===null&&U(be,"ill-formed argument of the YAML directive");let Fe=parseInt(Se[1],10),te=parseInt(Se[2],10);Fe!==1&&U(be,"unacceptable YAML version of the document"),be.version=pe[0],be.checkLineBreaks=te<2,te!==1&&te!==2&&Y(be,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(be,Qe,pe){let Se;pe.length!==2&&U(be,"TAG directive accepts exactly two arguments");let Fe=pe[0];Se=pe[1],_.test(Fe)||U(be,"ill-formed tag handle (first argument) of the TAG directive"),c.call(be.tagMap,Fe)&&U(be,'there is a previously declared suffix for "'+Fe+'" tag handle'),v.test(Se)||U(be,"ill-formed tag prefix (second argument) of the TAG directive");try{Se=decodeURIComponent(Se)}catch{U(be,"tag prefix is malformed: "+Se)}be.tagMap[Fe]=Se},"handleTagDirective")};function Le(F,be,Qe,pe){if(be=32&&Te<=1114111||U(F,"expected valid JSON character")}else A.test(Se)&&U(F,"the stream contains non-printable characters");F.result+=Se}}a(Le,"captureSegment");function ge(F,be,Qe,pe){r.isObject(Qe)||U(F,"cannot merge mappings; the provided source object is unacceptable");let Se=Object.keys(Qe);for(let Fe=0,te=Se.length;FeF.maxMergeSeqLength&&U(F,"merge sequence length exceeded maxMergeSeqLength ("+F.maxMergeSeqLength+")");let J=new Set;for(let se=0,me=Fe.length;se1&&(F.result+=r.repeat(` -`,be-1))}a(K,"writeFoldedLines");function he(F,be,Qe){let pe,Se,Fe,te,Te,Ge,J=F.kind,se=F.result,me=F.input.charCodeAt(F.position);if(R(me)||x(me)||me===35||me===38||me===42||me===33||me===124||me===62||me===39||me===34||me===37||me===64||me===96)return!1;if(me===63||me===45){let Ce=F.input.charCodeAt(F.position+1);if(R(Ce)||Qe&&x(Ce))return!1}for(F.kind="scalar",F.result="",pe=Se=F.position,Fe=!1;me!==0;){if(me===58){let Ce=F.input.charCodeAt(F.position+1);if(R(Ce)||Qe&&x(Ce))break}else if(me===35){if(R(F.input.charCodeAt(F.position-1)))break}else{if(F.position===F.lineStart&&ee(F)||Qe&&x(me))break;if(T(me))if(te=F.line,Te=F.lineStart,Ge=F.lineIndent,X(F,!1,-1),F.lineIndent>=be){Fe=!0,me=F.input.charCodeAt(F.position);continue}else{F.position=Se,F.line=te,F.lineStart=Te,F.lineIndent=Ge;break}}Fe&&(Le(F,pe,Se,!1),K(F,F.line-te),pe=Se=F.position,Fe=!1),w(me)||(Se=F.position+1),me=F.input.charCodeAt(++F.position)}return Le(F,pe,Se,!1),F.result?!0:(F.kind=J,F.result=se,!1)}a(he,"readPlainScalar");function Z(F,be){let Qe,pe,Se=F.input.charCodeAt(F.position);if(Se!==39)return!1;for(F.kind="scalar",F.result="",F.position++,Qe=pe=F.position;(Se=F.input.charCodeAt(F.position))!==0;)if(Se===39)if(Le(F,Qe,F.position,!0),Se=F.input.charCodeAt(++F.position),Se===39)Qe=F.position,F.position++,pe=F.position;else return!0;else T(Se)?(Le(F,Qe,pe,!0),K(F,X(F,!1,be)),Qe=pe=F.position):F.position===F.lineStart&&ee(F)?U(F,"unexpected end of the document within a single quoted scalar"):(F.position++,w(Se)||(pe=F.position));U(F,"unexpected end of the stream within a single quoted scalar")}a(Z,"readSingleQuotedScalar");function ue(F,be){let Qe,pe,Se,Fe=F.input.charCodeAt(F.position);if(Fe!==34)return!1;for(F.kind="scalar",F.result="",F.position++,Qe=pe=F.position;(Fe=F.input.charCodeAt(F.position))!==0;){if(Fe===34)return Le(F,Qe,F.position,!0),F.position++,!0;if(Fe===92){if(Le(F,Qe,F.position,!0),Fe=F.input.charCodeAt(++F.position),T(Fe))X(F,!1,be);else if(Fe<256&&M[Fe])F.result+=O[Fe],F.position++;else if((Se=D(Fe))>0){let te=Se,Te=0;for(;te>0;te--)Fe=F.input.charCodeAt(++F.position),(Se=P(Fe))>=0?Te=(Te<<4)+Se:U(F,"expected hexadecimal character");F.result+=B(Te),F.position++}else U(F,"unknown escape sequence");Qe=pe=F.position}else T(Fe)?(Le(F,Qe,pe,!0),K(F,X(F,!1,be)),Qe=pe=F.position):F.position===F.lineStart&&ee(F)?U(F,"unexpected end of the document within a double quoted scalar"):(F.position++,w(Fe)||(pe=F.position))}U(F,"unexpected end of the stream within a double quoted scalar")}a(ue,"readDoubleQuotedScalar");function qe(F,be){let Qe=!0,pe,Se,Fe,te=F.tag,Te,Ge=F.anchor,J,se,me,Ce,He=Object.create(null),$e,et,ct,bt=F.input.charCodeAt(F.position);if(bt===91)J=93,Ce=!1,Te=[];else if(bt===123)J=125,Ce=!0,Te={};else return!1;for(F.anchor!==null&&W(F,F.anchor,Te),bt=F.input.charCodeAt(++F.position);bt!==0;){if(X(F,!0,be),bt=F.input.charCodeAt(F.position),bt===J)return F.position++,F.tag=te,F.anchor=Ge,F.kind=Ce?"mapping":"sequence",F.result=Te,!0;Qe?bt===44&&U(F,"expected the node content, but found ','"):U(F,"missed comma between flow collection entries"),et=$e=ct=null,se=me=!1,bt===63&&R(F.input.charCodeAt(F.position+1))&&(se=me=!0,F.position++,X(F,!0,be)),pe=F.line,Se=F.lineStart,Fe=F.position,_t(F,be,l,!1,!0),et=F.tag,$e=F.result,X(F,!0,be),bt=F.input.charCodeAt(F.position),(me||F.line===pe)&&bt===58&&(se=!0,bt=F.input.charCodeAt(++F.position),X(F,!0,be),_t(F,be,l,!1,!0),ct=F.result),Ce?Ue(F,Te,He,et,$e,ct,pe,Se,Fe):se?Te.push(Ue(F,null,He,et,$e,ct,pe,Se,Fe)):Te.push($e),X(F,!0,be),bt=F.input.charCodeAt(F.position),bt===44?(Qe=!0,bt=F.input.charCodeAt(++F.position)):Qe=!1}U(F,"unexpected end of the stream within a flow collection")}a(qe,"readFlowCollection");function ne(F,be){let Qe,pe=h,Se=!1,Fe=!1,te=be,Te=0,Ge=!1,J,se=F.input.charCodeAt(F.position);if(se===124)Qe=!1;else if(se===62)Qe=!0;else return!1;for(F.kind="scalar",F.result="";se!==0;)if(se=F.input.charCodeAt(++F.position),se===43||se===45)h===pe?pe=se===43?g:m:U(F,"repeat of a chomping mode identifier");else if((J=N(se))>=0)J===0?U(F,"bad explicit indentation width of a block scalar; it cannot be less than one"):Fe?U(F,"repeat of an indentation width identifier"):(te=be+J-1,Fe=!0);else break;if(w(se)){do se=F.input.charCodeAt(++F.position);while(w(se));if(se===35)do se=F.input.charCodeAt(++F.position);while(!T(se)&&se!==0)}for(;se!==0;){for(ke(F),F.lineIndent=0,se=F.input.charCodeAt(F.position);(!Fe||F.lineIndentte&&(te=F.lineIndent),T(se)){Te++;continue}if(!Fe&&te===0&&U(F,"missing indentation for block scalar"),F.lineIndentbe)&&te!==0)U(F,"bad indentation of a sequence entry");else if(F.lineIndentbe)&&($e&&(Se=F.line,Fe=F.lineStart,te=F.position),_t(F,be,f,!0,pe)&&($e?Ce=F.result:He=F.result),$e||(Ue(F,J,se,me,Ce,He,Se,Fe,te),me=Ce=He=null),X(F,!0,-1),ct=F.input.charCodeAt(F.position)),(F.line===ht||F.lineIndent>be)&&ct!==0)U(F,"bad indentation of a mapping entry");else if(F.lineIndent=F.maxDepth&&U(F,"nesting exceeded maxDepth ("+F.maxDepth+")"),F.depth+=1,F.listener!==null&&F.listener("open",F),F.tag=null,F.anchor=null,F.kind=null,F.result=null;let $e=Fe=te=f===Qe||d===Qe;if(pe&&X(F,!0,-1)&&(Ge=!0,F.lineIndent>be?Te=1:F.lineIndent===be?Te=0:F.lineIndentbe?Te=1:F.lineIndent===be?Te=0:F.lineIndent tag; it should be "scalar", not "'+F.kind+'"');for(let et=0,ct=F.implicitTypes.length;et"),F.result!==null&&me.kind!==F.kind&&U(F,"unacceptable node kind for !<"+F.tag+'> tag; it should be "'+me.kind+'", not "'+F.kind+'"'),me.resolve(F.result,F.tag)?(F.result=me.construct(F.result,F.tag),F.anchor!==null&&W(F,F.anchor,F.result)):U(F,"cannot resolve a node with !<"+F.tag+"> explicit tag")}return F.listener!==null&&F.listener("close",F),F.depth-=1,F.tag!==null||F.anchor!==null||J}a(_t,"composeNode");function Dt(F){let be=F.position,Qe=!1,pe;for(F.version=null,F.checkLineBreaks=F.legacy,F.tagMap=Object.create(null),F.anchorMap=Object.create(null);(pe=F.input.charCodeAt(F.position))!==0&&(X(F,!0,-1),pe=F.input.charCodeAt(F.position),!(F.lineIndent>0||pe!==37));){Qe=!0,pe=F.input.charCodeAt(++F.position);let Se=F.position;for(;pe!==0&&!R(pe);)pe=F.input.charCodeAt(++F.position);let Fe=F.input.slice(Se,F.position),te=[];for(Fe.length<1&&U(F,"directive name must not be less than one character in length");pe!==0;){for(;w(pe);)pe=F.input.charCodeAt(++F.position);if(pe===35){do pe=F.input.charCodeAt(++F.position);while(pe!==0&&!T(pe));break}if(T(pe))break;for(Se=F.position;pe!==0&&!R(pe);)pe=F.input.charCodeAt(++F.position);te.push(F.input.slice(Se,F.position))}pe!==0&&ke(F),c.call(le,Fe)?le[Fe](F,Fe,te):Y(F,'unknown document directive "'+Fe+'"')}if(X(F,!0,-1),F.lineIndent===0&&F.input.charCodeAt(F.position)===45&&F.input.charCodeAt(F.position+1)===45&&F.input.charCodeAt(F.position+2)===45?(F.position+=3,X(F,!0,-1)):Qe&&U(F,"directives end mark is expected"),_t(F,F.lineIndent-1,f,!1,!0),X(F,!0,-1),F.checkLineBreaks&&y.test(F.input.slice(be,F.position))&&Y(F,"non-ASCII line breaks are interpreted as content"),F.documents.push(F.result),F.position===F.lineStart&&ee(F)){F.input.charCodeAt(F.position)===46&&(F.position+=3,X(F,!0,-1));return}F.position"u"&&(Qe=be,be=null);let pe=$t(F,Qe);if(typeof be!="function")return pe;for(let Se=0,Fe=pe.length;Se{var r=OIe(),n=LIe(),o=z9t(),s=Object.prototype.toString,c=Object.prototype.hasOwnProperty,l=65279,u=9,d=10,f=13,h=32,m=33,g=34,A=35,y=37,E=38,_=39,v=42,b=44,T=45,w=58,R=61,x=62,P=63,D=64,N=91,L=93,B=96,q=123,M=124,O=125,j={};j[0]="\\0",j[7]="\\a",j[8]="\\b",j[9]="\\t",j[10]="\\n",j[11]="\\v",j[12]="\\f",j[13]="\\r",j[27]="\\e",j[34]='\\"',j[92]="\\\\",j[133]="\\N",j[160]="\\_",j[8232]="\\L",j[8233]="\\P";var Q=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],U=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Y(te,Te){if(Te===null)return{};let Ge={},J=Object.keys(Te);for(let se=0,me=J.length;se=32&&te<=126||te>=161&&te<=55295&&te!==8232&&te!==8233||te>=57344&&te<=65533&&te!==l||te>=65536&&te<=1114111}a(ge,"isPrintable");function Ue(te){return ge(te)&&te!==l&&te!==f&&te!==d}a(Ue,"isNsCharOrWhitespace");function ke(te,Te,Ge){let J=Ue(te),se=J&&!Le(te);return(Ge?J:J&&te!==b&&te!==N&&te!==L&&te!==q&&te!==O)&&te!==A&&!(Te===w&&!se)||Ue(Te)&&!Le(Te)&&te===A||Te===w&&se}a(ke,"isPlainSafe");function X(te){return ge(te)&&te!==l&&!Le(te)&&te!==T&&te!==P&&te!==w&&te!==b&&te!==N&&te!==L&&te!==q&&te!==O&&te!==A&&te!==E&&te!==v&&te!==m&&te!==M&&te!==R&&te!==x&&te!==_&&te!==g&&te!==y&&te!==D&&te!==B}a(X,"isPlainSafeFirst");function ee(te){return!Le(te)&&te!==w}a(ee,"isPlainSafeLast");function K(te,Te){let Ge=te.charCodeAt(Te),J;return Ge>=55296&&Ge<=56319&&Te+1=56320&&J<=57343)?(Ge-55296)*1024+J-56320+65536:Ge}a(K,"codePointAt");function he(te){return/^\n* /.test(te)}a(he,"needIndentIndicator");var Z=1,ue=2,qe=3,ne=4,ce=5;function Ne(te,Te,Ge,J,se,me,Ce,He){let $e,et=0,ct=null,bt=!1,ht=!1,We=J!==-1,ae=-1,Re=X(K(te,0))&&ee(K(te,te.length-1));if(Te||Ce)for($e=0;$e=65536?$e+=2:$e++){if(et=K(te,$e),!ge(et))return ce;Re=Re&&ke(et,ct,He),ct=et}else{for($e=0;$e=65536?$e+=2:$e++){if(et=K(te,$e),et===d)bt=!0,We&&(ht=ht||$e-ae-1>J&&te[ae+1]!==" ",ae=$e);else if(!ge(et))return ce;Re=Re&&ke(et,ct,He),ct=et}ht=ht||We&&$e-ae-1>J&&te[ae+1]!==" "}return!bt&&!ht?Re&&!Ce&&!se(te)?Z:me===z?ce:ue:Ge>9&&he(te)?ce:Ce?me===z?ce:ue:ht?ne:qe}a(Ne,"chooseScalarStyle");function we(te,Te,Ge,J,se){te.dump=(function(){if(Te.length===0)return te.quotingType===z?'""':"''";if(!te.noCompatMode&&(Q.indexOf(Te)!==-1||U.test(Te)))return te.quotingType===z?'"'+Te+'"':"'"+Te+"'";let me=te.indent*Math.max(1,Ge),Ce=te.lineWidth===-1?-1:Math.max(Math.min(te.lineWidth,40),te.lineWidth-me),He=J||te.flowLevel>-1&&Ge>=te.flowLevel;function $e(et){return le(te,et)}switch(a($e,"testAmbiguity"),Ne(Te,He,te.indent,Ce,$e,te.quotingType,te.forceQuotes&&!J,se)){case Z:return Te;case ue:return"'"+Te.replace(/'/g,"''")+"'";case qe:return"|"+Be(Te,te.indent)+rt(H(Te,me));case ne:return">"+Be(Te,te.indent)+rt(H(st(Te,Ce),me));case ce:return'"'+Dt(Te,Ce)+'"';default:throw new n("impossible error: invalid scalar style")}})()}a(we,"writeScalar");function Be(te,Te){let Ge=he(te)?String(Te):"",J=te[te.length-1]===` -`;return Ge+(J&&(te[te.length-2]===` -`||te===` -`)?"+":J?"":"-")+` -`}a(Be,"blockHeader");function rt(te){return te[te.length-1]===` -`?te.slice(0,-1):te}a(rt,"dropEndingNewline");function st(te,Te){let Ge=/(\n+)([^\n]*)/g,J=(function(){let He=te.indexOf(` -`);return He=He!==-1?He:te.length,Ge.lastIndex=He,_t(te.slice(0,He),Te)})(),se=te[0]===` -`||te[0]===" ",me,Ce;for(;Ce=Ge.exec(te);){let He=Ce[1],$e=Ce[2];me=$e[0]===" ",J+=He+(!se&&!me&&$e!==""?` -`:"")+_t($e,Te),se=me}return J}a(st,"foldString");function _t(te,Te){if(te===""||te[0]===" ")return te;let Ge=/ [^ ]/g,J,se=0,me,Ce=0,He=0,$e="";for(;J=Ge.exec(te);)He=J.index,He-se>Te&&(me=Ce>se?Ce:He,$e+=` -`+te.slice(se,me),se=me+1),Ce=He;return $e+=` -`,te.length-se>Te&&Ce>se?$e+=te.slice(se,Ce)+` -`+te.slice(Ce+1):$e+=te.slice(se),$e.slice(1)}a(_t,"foldLine");function Dt(te){let Te="",Ge=0;for(let J=0;J=65536?J+=2:J++){Ge=K(te,J);let se=j[Ge];!se&&ge(Ge)?(Te+=te[J],Ge>=65536&&(Te+=te[J+1])):Te+=se||W(Ge)}return Te}a(Dt,"escapeString");function $t(te,Te,Ge){let J="",se=te.tag;for(let me=0,Ce=Ge.length;me"u"&&Qe(te,Te,null,!1,!1))&&(J!==""&&(J+=","+(te.condenseFlow?"":" ")),J+=te.dump)}te.tag=se,te.dump="["+J+"]"}a($t,"writeFlowSequence");function Gt(te,Te,Ge,J){let se="",me=te.tag;for(let Ce=0,He=Ge.length;Ce"u"&&Qe(te,Te+1,null,!0,!0,!1,!0))&&((!J||se!=="")&&(se+=re(te,Te)),te.dump&&d===te.dump.charCodeAt(0)?se+="-":se+="- ",se+=te.dump)}te.tag=me,te.dump=se||"[]"}a(Gt,"writeBlockSequence");function Ie(te,Te,Ge){let J="",se=te.tag,me=Object.keys(Ge);for(let Ce=0,He=me.length;Ce1024&&($e+="? "),$e+=te.dump+(te.condenseFlow?'"':"")+":"+(te.condenseFlow?"":" "),Qe(te,Te,ct,!1,!1)&&($e+=te.dump,J+=$e))}te.tag=se,te.dump="{"+J+"}"}a(Ie,"writeFlowMapping");function F(te,Te,Ge,J){let se="",me=te.tag,Ce=Object.keys(Ge);if(te.sortKeys===!0)Ce.sort();else if(typeof te.sortKeys=="function")Ce.sort(te.sortKeys);else if(te.sortKeys)throw new n("sortKeys must be a boolean or a function");for(let He=0,$e=Ce.length;He<$e;He+=1){let et="";(!J||se!=="")&&(et+=re(te,Te));let ct=Ce[He],bt=Ge[ct];if(te.replacer&&(bt=te.replacer.call(Ge,ct,bt)),!Qe(te,Te+1,ct,!0,!0,!0))continue;let ht=te.tag!==null&&te.tag!=="?"||te.dump&&te.dump.length>1024;ht&&(te.dump&&d===te.dump.charCodeAt(0)?et+="?":et+="? "),et+=te.dump,ht&&(et+=re(te,Te)),Qe(te,Te+1,bt,!0,ht)&&(te.dump&&d===te.dump.charCodeAt(0)?et+=":":et+=": ",et+=te.dump,se+=et)}te.tag=me,te.dump=se||"{}"}a(F,"writeBlockMapping");function be(te,Te,Ge){let J=Ge?te.explicitTypes:te.implicitTypes;for(let se=0,me=J.length;se tag resolver accepts not "'+He+'" style');te.dump=$e}return!0}}return!1}a(be,"detectType");function Qe(te,Te,Ge,J,se,me,Ce){te.tag=null,te.dump=Ge,be(te,Ge,!1)||be(te,Ge,!0);let He=s.call(te.dump),$e=J;J&&(J=te.flowLevel<0||te.flowLevel>Te);let et=He==="[object Object]"||He==="[object Array]",ct,bt;if(et&&(ct=te.duplicates.indexOf(Ge),bt=ct!==-1),(te.tag!==null&&te.tag!=="?"||bt||te.indent!==2&&Te>0)&&(se=!1),bt&&te.usedDuplicates[ct])te.dump="*ref_"+ct;else{if(et&&bt&&!te.usedDuplicates[ct]&&(te.usedDuplicates[ct]=!0),He==="[object Object]")J&&Object.keys(te.dump).length!==0?(F(te,Te,te.dump,se),bt&&(te.dump="&ref_"+ct+te.dump)):(Ie(te,Te,te.dump),bt&&(te.dump="&ref_"+ct+" "+te.dump));else if(He==="[object Array]")J&&te.dump.length!==0?(te.noArrayIndent&&!Ce&&Te>0?Gt(te,Te-1,te.dump,se):Gt(te,Te,te.dump,se),bt&&(te.dump="&ref_"+ct+te.dump)):($t(te,Te,te.dump),bt&&(te.dump="&ref_"+ct+" "+te.dump));else if(He==="[object String]")te.tag!=="?"&&we(te,te.dump,Te,me,$e);else{if(He==="[object Undefined]")return!1;if(te.skipInvalid)return!1;throw new n("unacceptable kind of an object to dump "+He)}if(te.tag!==null&&te.tag!=="?"){let ht=encodeURI(te.tag[0]==="!"?te.tag.slice(1):te.tag).replace(/!/g,"%21");te.tag[0]==="!"?ht="!"+ht:ht.slice(0,18)==="tag:yaml.org,2002:"?ht="!!"+ht.slice(18):ht="!<"+ht+">",te.dump=ht+" "+te.dump}}return!0}a(Qe,"writeNode");function pe(te,Te){let Ge=[],J=[];Se(te,Ge,J);let se=J.length;for(let me=0;me{var r=Z8o(),n=X8o();function o(s,c){return function(){throw new Error("Function yaml."+s+" is removed in js-yaml 4. Use yaml."+c+" instead, which is now safe by default.")}}a(o,"renamed"),e.exports.Type=U_(),e.exports.Schema=J0n(),e.exports.FAILSAFE_SCHEMA=tgn(),e.exports.JSON_SCHEMA=sgn(),e.exports.CORE_SCHEMA=agn(),e.exports.DEFAULT_SCHEMA=z9t(),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.dump=n.dump,e.exports.YAMLException=LIe(),e.exports.types={binary:ugn(),float:ogn(),map:egn(),null:rgn(),pairs:fgn(),set:pgn(),timestamp:cgn(),bool:ngn(),int:ign(),merge:lgn(),omap:dgn(),seq:X0n(),str:Z0n()},e.exports.safeLoad=o("safeLoad","load"),e.exports.safeLoadAll=o("safeLoadAll","loadAll"),e.exports.safeDump=o("safeDump","dump")}))(),1),{Type:U8u,Schema:Q8u,FAILSAFE_SCHEMA:q8u,JSON_SCHEMA:j8u,CORE_SCHEMA:H8u,DEFAULT_SCHEMA:G8u,load:$8u,loadAll:V8u,dump:fK,YAMLException:W8u,types:z8u,safeLoad:Y8u,safeLoadAll:K8u,safeDump:J8u}=hgn.default,Z8u=hgn.default;function ggn(t){let e={};t.display_name&&(e.name=t.display_name),t.description&&(e.description=t.description),t.tools&&t.tools.length>0&&!t.tools.includes("*")&&(e.tools=t.tools),t.argument_hint&&(e["argument-hint"]=t.argument_hint),t.target&&(e.target=t.target),t.model&&(e.model=t.model);let r=[];t.user_invocable!==!1&&r.push("user"),t.disable_model_invocation!==!0&&r.push("model"),r.length<2&&(e["x-github-copilot-invoke-policy"]=r);let n=fK(e,{sortKeys:!1,lineWidth:-1,noRefs:!0,noCompatMode:!0,quotingType:'"',forceQuotes:!1}).trim(),o=t.prompt??"";return`--- +`)}`:"";e.fail(o("Missing required argument: %s","Missing required arguments: %s",Object.keys(g).length,Object.keys(g).join(", ")+y))}},"requiredArguments"),s.unknownArguments=a(function(h,m,g,A,y=!0){var E;let _=t.getInternalMethods().getCommandInstance().getCommands(),v=[],b=t.getInternalMethods().getContext();if(Object.keys(h).forEach(T=>{!ngn.includes(T)&&!Object.prototype.hasOwnProperty.call(g,T)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),T)&&!s.isValidAndSomeAliasIsNotNew(T,m)&&v.push(T)}),y&&(b.commands.length>0||_.length>0||A)&&h._.slice(b.commands.length).forEach(T=>{_.includes(""+T)||v.push(""+T)}),y){let w=((E=t.getDemandedCommands()._)===null||E===void 0?void 0:E.max)||0,R=b.commands.length+w;R{x=String(x),!b.commands.includes(x)&&!v.includes(x)&&v.push(x)})}v.length&&e.fail(o("Unknown argument: %s","Unknown arguments: %s",v.length,v.map(T=>T.trim()?T:`"${T}"`).join(", ")))},"unknownArguments"),s.unknownCommands=a(function(h){let m=t.getInternalMethods().getCommandInstance().getCommands(),g=[],A=t.getInternalMethods().getContext();return(A.commands.length>0||m.length>0)&&h._.slice(A.commands.length).forEach(y=>{m.includes(""+y)||g.push(""+y)}),g.length>0?(e.fail(o("Unknown command: %s","Unknown commands: %s",g.length,g.join(", "))),!0):!1},"unknownCommands"),s.isValidAndSomeAliasIsNotNew=a(function(h,m){if(!Object.prototype.hasOwnProperty.call(m,h))return!1;let g=t.parsed.newAliases;return[h,...m[h]].some(A=>!Object.prototype.hasOwnProperty.call(g,A)||!g[h])},"isValidAndSomeAliasIsNotNew"),s.limitedChoices=a(function(h){let m=t.getOptions(),g={};if(!Object.keys(m.choices).length)return;Object.keys(h).forEach(E=>{ngn.indexOf(E)===-1&&Object.prototype.hasOwnProperty.call(m.choices,E)&&[].concat(h[E]).forEach(_=>{m.choices[E].indexOf(_)===-1&&_!==void 0&&(g[E]=(g[E]||[]).concat(_))})});let A=Object.keys(g);if(!A.length)return;let y=n("Invalid values:");A.forEach(E=>{y+=` + ${n("Argument: %s, Given: %s, Choices: %s",E,e.stringifiedValues(g[E]),e.stringifiedValues(m.choices[E]))}`}),e.fail(y)},"limitedChoices");let c={};s.implies=a(function(h,m){Ln(" [array|number|string]",[h,m],arguments.length),typeof h=="object"?Object.keys(h).forEach(g=>{s.implies(g,h[g])}):(t.global(h),c[h]||(c[h]=[]),Array.isArray(m)?m.forEach(g=>s.implies(h,g)):(q_(m,void 0,r),c[h].push(m)))},"implies"),s.getImplied=a(function(){return c},"getImplied");function l(f,h){let m=Number(h);return h=isNaN(m)?h:m,typeof h=="number"?h=f._.length>=h:h.match(/^--no-.+/)?(h=h.match(/^--no-(.+)/)[1],h=!Object.prototype.hasOwnProperty.call(f,h)):h=Object.prototype.hasOwnProperty.call(f,h),h}a(l,"keyExists"),s.implications=a(function(h){let m=[];if(Object.keys(c).forEach(g=>{let A=g;(c[g]||[]).forEach(y=>{let E=A,_=y;E=l(h,E),y=l(h,y),E&&!y&&m.push(` ${A} -> ${_}`)})}),m.length){let g=`${n("Implications failed:")} +`;m.forEach(A=>{g+=A}),e.fail(g)}},"implications");let u={};s.conflicts=a(function(h,m){Ln(" [array|string]",[h,m],arguments.length),typeof h=="object"?Object.keys(h).forEach(g=>{s.conflicts(g,h[g])}):(t.global(h),u[h]||(u[h]=[]),Array.isArray(m)?m.forEach(g=>s.conflicts(h,g)):u[h].push(m))},"conflicts"),s.getConflicting=()=>u,s.conflicting=a(function(h){Object.keys(h).forEach(m=>{u[m]&&u[m].forEach(g=>{g&&h[m]!==void 0&&h[g]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",m,g))})}),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(m=>{u[m].forEach(g=>{g&&h[r.Parser.camelCase(m)]!==void 0&&h[r.Parser.camelCase(g)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",m,g))})})},"conflictingFn"),s.recommendCommands=a(function(h,m){m=m.sort((E,_)=>_.length-E.length);let A=null,y=1/0;for(let E=0,_;(_=m[E])!==void 0;E++){let v=rgn(h,_);v<=3&&v!h[m]),u=VQ(u,m=>!h[m]),s},"reset");let d=[];return s.freeze=a(function(){d.push({implied:c,conflicting:u})},"freeze"),s.unfreeze=a(function(){let h=d.pop();q_(h,void 0,r),{implied:c,conflicting:u}=h},"unfreeze"),s}a(ign,"validation");p();var b9o={};var tUt=[],KIe;function kze(t,e,r,n){KIe=n;let o={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return o;let s=/\.json|\..*rc$/.test(t.extends),c=null;if(s)c=C9o(e,t.extends);else try{c=b9o.resolve(t.extends)}catch{return t}v9o(c),tUt.push(c),o=s?JSON.parse(KIe.readFileSync(c,"utf8")):n.require(t.extends),delete t.extends,o=kze(o,KIe.path.dirname(c),r,KIe)}return tUt=[],r?ogn(o,t):Object.assign({},o,t)}a(kze,"applyExtends");function v9o(t){if(tUt.indexOf(t)>-1)throw new Zp(`Circular extended configurations: '${t}'.`)}a(v9o,"checkForCircularExtends");function C9o(t,e){return KIe.path.resolve(t,e)}a(C9o,"getPathToDefaultConfig");function ogn(t,e){let r={};function n(o){return o&&typeof o=="object"&&!Array.isArray(o)}a(n,"isObject"),Object.assign(r,t);for(let o of Object.keys(e))n(e[o])&&n(r[o])?r[o]=ogn(t[o],e[o]):r[o]=e[o];return r}a(ogn,"mergeDeep");var Bn=function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},ke=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Xp,uK,JIe,BC,jS,Pze,zQ,dK,Dze,Kx,Nze,Jx,pO,HS,Zx,Mze,fK,dg,ri,Oze,Lze,GS,pK,jle,hK,YQ,Bze,zi,mK,gK,AK,go,Fze,hO,rp;function Tgn(t){return(e=[],r=t.process.cwd(),n)=>{let o=new fUt(e,r,n,t);return Object.defineProperty(o,"argv",{get:a(()=>o.parse(),"get"),enumerable:!0}),o.help(),o.version(),o}}a(Tgn,"YargsFactory");var sgn=Symbol("copyDoubleDash"),agn=Symbol("copyDoubleDash"),rUt=Symbol("deleteFromParserHintObject"),cgn=Symbol("emitWarning"),lgn=Symbol("freeze"),ugn=Symbol("getDollarZero"),yK=Symbol("getParserConfiguration"),dgn=Symbol("getUsageConfiguration"),nUt=Symbol("guessLocale"),fgn=Symbol("guessVersion"),pgn=Symbol("parsePositionalNumbers"),iUt=Symbol("pkgUp"),KQ=Symbol("populateParserHintArray"),Hle=Symbol("populateParserHintSingleValueDictionary"),oUt=Symbol("populateParserHintArrayDictionary"),sUt=Symbol("populateParserHintDictionary"),aUt=Symbol("sanitizeKey"),cUt=Symbol("setKey"),lUt=Symbol("unfreeze"),hgn=Symbol("validateAsync"),mgn=Symbol("getCommandInstance"),ggn=Symbol("getContext"),Agn=Symbol("getHasOutput"),ygn=Symbol("getLoggerInstance"),Egn=Symbol("getParseContext"),_gn=Symbol("getUsageInstance"),vgn=Symbol("getValidationInstance"),Uze=Symbol("hasParseCallback"),Cgn=Symbol("isGlobalContext"),EK=Symbol("postProcess"),bgn=Symbol("rebase"),uUt=Symbol("reset"),ZIe=Symbol("runYargsParserAndExecuteCommands"),dUt=Symbol("runValidation"),Sgn=Symbol("setHasOutput"),_K=Symbol("kTrackManuallySetKeys"),S9o="en_US",fUt=class{static{a(this,"YargsInstance")}constructor(e=[],r,n,o){this.customScriptName=!1,this.parsed=!1,Xp.set(this,void 0),uK.set(this,void 0),JIe.set(this,{commands:[],fullCommands:[]}),BC.set(this,null),jS.set(this,null),Pze.set(this,"show-hidden"),zQ.set(this,null),dK.set(this,!0),Dze.set(this,{}),Kx.set(this,!0),Nze.set(this,[]),Jx.set(this,void 0),pO.set(this,{}),HS.set(this,!1),Zx.set(this,null),Mze.set(this,!0),fK.set(this,void 0),dg.set(this,""),ri.set(this,void 0),Oze.set(this,void 0),Lze.set(this,{}),GS.set(this,null),pK.set(this,null),jle.set(this,{}),hK.set(this,{}),YQ.set(this,void 0),Bze.set(this,!1),zi.set(this,void 0),mK.set(this,!1),gK.set(this,!1),AK.set(this,!1),go.set(this,void 0),Fze.set(this,{}),hO.set(this,null),rp.set(this,void 0),Bn(this,zi,o,"f"),Bn(this,YQ,e,"f"),Bn(this,uK,r,"f"),Bn(this,Oze,n,"f"),Bn(this,Jx,new xze(this),"f"),this.$0=this[ugn](),this[uUt](),Bn(this,Xp,ke(this,Xp,"f"),"f"),Bn(this,go,ke(this,go,"f"),"f"),Bn(this,rp,ke(this,rp,"f"),"f"),Bn(this,ri,ke(this,ri,"f"),"f"),ke(this,ri,"f").showHiddenOpt=ke(this,Pze,"f"),Bn(this,fK,this[agn](),"f"),ke(this,zi,"f").y18n.setLocale(S9o)}addHelpOpt(e,r){let n="help";return Ln("[string|boolean] [string]",[e,r],arguments.length),ke(this,Zx,"f")&&(this[rUt](ke(this,Zx,"f")),Bn(this,Zx,null,"f")),e===!1&&r===void 0?this:(Bn(this,Zx,typeof e=="string"?e:n,"f"),this.boolean(ke(this,Zx,"f")),this.describe(ke(this,Zx,"f"),r||ke(this,go,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(Ln("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:ke(this,Pze,"f");return this.boolean(n),this.describe(n,r||ke(this,go,"f").deferY18nLookup("Show hidden options")),ke(this,ri,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return Ln(" [string|array]",[e,r],arguments.length),this[oUt](this.alias.bind(this),"alias",e,r),this}array(e){return Ln("",[e],arguments.length),this[KQ]("array",e),this[_K](e),this}boolean(e){return Ln("",[e],arguments.length),this[KQ]("boolean",e),this[_K](e),this}check(e,r){return Ln(" [boolean]",[e,r],arguments.length),this.middleware((n,o)=>lK(()=>e(n,o.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&ke(this,go,"f").fail(s.toString(),s):ke(this,go,"f").fail(ke(this,zi,"f").y18n.__("Argument check failed: %s",e.toString())),n),s=>(ke(this,go,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(e,r){return Ln(" [string|array]",[e,r],arguments.length),this[oUt](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(Ln(" [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new Zp("coerce callback must be provided");for(let o of e)this.coerce(o,r);return this}else if(typeof e=="object"){for(let o of Object.keys(e))this.coerce(o,e[o]);return this}if(!r)throw new Zp("coerce callback must be provided");let n=e;return ke(this,ri,"f").key[n]=!0,ke(this,Jx,"f").addCoerceMiddleware((o,s)=>{var c;let l=(c=s.getAliases()[n])!==null&&c!==void 0?c:[],u=[n,...l].filter(d=>Object.prototype.hasOwnProperty.call(o,d));return u.length===0?o:lK(()=>r(o[u[0]]),d=>(u.forEach(f=>{o[f]=d}),o),d=>{throw new Zp(d.message)})},n),this}conflicts(e,r){return Ln(" [string|array]",[e,r],arguments.length),ke(this,rp,"f").conflicts(e,r),this}config(e="config",r,n){return Ln("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=kze(e,ke(this,uK,"f"),this[yK]()["deep-merge-config"]||!1,ke(this,zi,"f")),ke(this,ri,"f").configObjects=(ke(this,ri,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||ke(this,go,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(o=>{ke(this,ri,"f").config[o]=n||!0}),this)}completion(e,r,n){return Ln("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Bn(this,jS,e||ke(this,jS,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(ke(this,jS,"f"),r),n&&ke(this,BC,"f").registerFunction(n),this}command(e,r,n,o,s,c){return Ln(" [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,o,s,c],arguments.length),ke(this,Xp,"f").addHandler(e,r,n,o,s,c),this}commands(e,r,n,o,s,c){return this.command(e,r,n,o,s,c)}commandDir(e,r){Ln(" [object]",[e,r],arguments.length);let n=ke(this,Oze,"f")||ke(this,zi,"f").require;return ke(this,Xp,"f").addDirectory(e,n,ke(this,zi,"f").getCallerFile(),r),this}count(e){return Ln("",[e],arguments.length),this[KQ]("count",e),this[_K](e),this}default(e,r,n){return Ln(" [*] [string]",[e,r,n],arguments.length),n&&(J9t(e,ke(this,zi,"f")),ke(this,ri,"f").defaultDescription[e]=n),typeof r=="function"&&(J9t(e,ke(this,zi,"f")),ke(this,ri,"f").defaultDescription[e]||(ke(this,ri,"f").defaultDescription[e]=ke(this,go,"f").functionDescription(r)),r=r.call()),this[Hle](this.default.bind(this),"default",e,r),this}defaults(e,r,n){return this.default(e,r,n)}demandCommand(e=1,r,n,o){return Ln("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,r,n,o],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),ke(this,ri,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:o},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(o=>{q_(n,!0,ke(this,zi,"f")),this.demandOption(o,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(q_(n,!0,ke(this,zi,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(o=>{q_(n,!0,ke(this,zi,"f")),this.demandOption(o,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,r){return Ln(" [string]",[e,r],arguments.length),this[Hle](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return Ln(" [string|boolean]",[e,r],arguments.length),ke(this,ri,"f").deprecatedOptions[e]=r,this}describe(e,r){return Ln(" [string]",[e,r],arguments.length),this[cUt](e,!0),ke(this,go,"f").describe(e,r),this}detectLocale(e){return Ln("",[e],arguments.length),Bn(this,dK,e,"f"),this}env(e){return Ln("[string|boolean]",[e],arguments.length),e===!1?delete ke(this,ri,"f").envPrefix:ke(this,ri,"f").envPrefix=e||"",this}epilogue(e){return Ln("",[e],arguments.length),ke(this,go,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return Ln(" [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):ke(this,go,"f").example(e,r),this}exit(e,r){Bn(this,HS,!0,"f"),Bn(this,zQ,r,"f"),ke(this,Kx,"f")&&ke(this,zi,"f").process.exit(e)}exitProcess(e=!0){return Ln("[boolean]",[e],arguments.length),Bn(this,Kx,e,"f"),this}fail(e){if(Ln("",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Zp("Invalid first argument. Expected function or boolean 'false'");return ke(this,go,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return Ln(" [function]",[e,r],arguments.length),r?ke(this,BC,"f").getCompletion(e,r):new Promise((n,o)=>{ke(this,BC,"f").getCompletion(e,(s,c)=>{s?o(s):n(c)})})}getDemandedOptions(){return Ln([],0),ke(this,ri,"f").demandedOptions}getDemandedCommands(){return Ln([],0),ke(this,ri,"f").demandedCommands}getDeprecatedOptions(){return Ln([],0),ke(this,ri,"f").deprecatedOptions}getDetectLocale(){return ke(this,dK,"f")}getExitProcess(){return ke(this,Kx,"f")}getGroups(){return Object.assign({},ke(this,pO,"f"),ke(this,hK,"f"))}getHelp(){if(Bn(this,HS,!0,"f"),!ke(this,go,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[ZIe](ke(this,YQ,"f"),void 0,void 0,0,!0);if(td(r))return r.then(()=>ke(this,go,"f").help())}let e=ke(this,Xp,"f").runDefaultBuilderOn(this);if(td(e))return e.then(()=>ke(this,go,"f").help())}return Promise.resolve(ke(this,go,"f").help())}getOptions(){return ke(this,ri,"f")}getStrict(){return ke(this,mK,"f")}getStrictCommands(){return ke(this,gK,"f")}getStrictOptions(){return ke(this,AK,"f")}global(e,r){return Ln(" [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?ke(this,ri,"f").local=ke(this,ri,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{ke(this,ri,"f").local.includes(n)||ke(this,ri,"f").local.push(n)}),this}group(e,r){Ln(" ",[e,r],arguments.length);let n=ke(this,hK,"f")[r]||ke(this,pO,"f")[r];ke(this,hK,"f")[r]&&delete ke(this,hK,"f")[r];let o={};return ke(this,pO,"f")[r]=(n||[]).concat(e).filter(s=>o[s]?!1:o[s]=!0),this}hide(e){return Ln("",[e],arguments.length),ke(this,ri,"f").hiddenOptions.push(e),this}implies(e,r){return Ln(" [number|string|array]",[e,r],arguments.length),ke(this,rp,"f").implies(e,r),this}locale(e){return Ln("[string]",[e],arguments.length),e===void 0?(this[nUt](),ke(this,zi,"f").y18n.getLocale()):(Bn(this,dK,!1,"f"),ke(this,zi,"f").y18n.setLocale(e),this)}middleware(e,r,n){return ke(this,Jx,"f").addMiddleware(e,!!r,n)}nargs(e,r){return Ln(" [number]",[e,r],arguments.length),this[Hle](this.nargs.bind(this),"narg",e,r),this}normalize(e){return Ln("",[e],arguments.length),this[KQ]("normalize",e),this}number(e){return Ln("",[e],arguments.length),this[KQ]("number",e),this[_K](e),this}option(e,r){if(Ln(" [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[_K](e),ke(this,hO,"f")&&(e==="version"||r?.alias==="version")&&this[cgn](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(` +`),void 0,"versionWarning"),ke(this,ri,"f").key[e]=!0,r.alias&&this.alias(e,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(e,n);let o=r.demand||r.required||r.require;o&&this.demand(e,o),r.demandOption&&this.demandOption(e,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(e,r.conflicts),"default"in r&&this.default(e,r.default),r.implies!==void 0&&this.implies(e,r.implies),r.nargs!==void 0&&this.nargs(e,r.nargs),r.config&&this.config(e,r.configParser),r.normalize&&this.normalize(e),r.choices&&this.choices(e,r.choices),r.coerce&&this.coerce(e,r.coerce),r.group&&this.group(e,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(e),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(e),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(e),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(e),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(e),typeof r.global=="boolean"&&this.global(e,r.global),r.defaultDescription&&(ke(this,ri,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let s=r.describe||r.description||r.desc,c=ke(this,go,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(c,e)||typeof s=="string")&&this.describe(e,s),r.hidden&&this.hide(e),r.requiresArg&&this.requiresArg(e)}return this}options(e,r){return this.option(e,r)}parse(e,r,n){Ln("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[lgn](),typeof e>"u"&&(e=ke(this,YQ,"f")),typeof r=="object"&&(Bn(this,pK,r,"f"),r=n),typeof r=="function"&&(Bn(this,GS,r,"f"),r=!1),r||Bn(this,YQ,e,"f"),ke(this,GS,"f")&&Bn(this,Kx,!1,"f");let o=this[ZIe](e,!!r),s=this.parsed;return ke(this,BC,"f").setParsed(this.parsed),td(o)?o.then(c=>(ke(this,GS,"f")&&ke(this,GS,"f").call(this,ke(this,zQ,"f"),c,ke(this,dg,"f")),c)).catch(c=>{throw ke(this,GS,"f")&&ke(this,GS,"f")(c,this.parsed.argv,ke(this,dg,"f")),c}).finally(()=>{this[lUt](),this.parsed=s}):(ke(this,GS,"f")&&ke(this,GS,"f").call(this,ke(this,zQ,"f"),o,ke(this,dg,"f")),this[lUt](),this.parsed=s,o)}parseAsync(e,r,n){let o=this.parse(e,r,n);return td(o)?o:Promise.resolve(o)}parseSync(e,r,n){let o=this.parse(e,r,n);if(td(o))throw new Zp(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return o}parserConfiguration(e){return Ln("",[e],arguments.length),Bn(this,Lze,e,"f"),this}pkgConf(e,r){Ln(" [string]",[e,r],arguments.length);let n=null,o=this[iUt](r||ke(this,uK,"f"));return o[e]&&typeof o[e]=="object"&&(n=kze(o[e],r||ke(this,uK,"f"),this[yK]()["deep-merge-config"]||!1,ke(this,zi,"f")),ke(this,ri,"f").configObjects=(ke(this,ri,"f").configObjects||[]).concat(n)),this}positional(e,r){Ln(" ",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=VQ(r,(c,l)=>c==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(c));let o=ke(this,JIe,"f").fullCommands[ke(this,JIe,"f").fullCommands.length-1],s=o?ke(this,Xp,"f").cmdToParseOptions(o):{array:[],alias:{},default:{},demand:{}};return Qle(s).forEach(c=>{let l=s[c];Array.isArray(l)?l.indexOf(e)!==-1&&(r[c]=!0):l[e]&&!(c in r)&&(r[c]=l[e])}),this.group(e,ke(this,go,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return Ln("[boolean]",[e],arguments.length),Bn(this,Bze,e,"f"),this}required(e,r,n){return this.demand(e,r,n)}require(e,r,n){return this.demand(e,r,n)}requiresArg(e){return Ln(" [number]",[e],arguments.length),typeof e=="string"&&ke(this,ri,"f").narg[e]?this:(this[Hle](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return Ln("[string] [string]",[e,r],arguments.length),e=e||this.$0,ke(this,fK,"f").log(ke(this,BC,"f").generateCompletionScript(e,r||ke(this,jS,"f")||"completion")),this}showHelp(e){if(Ln("[string|function]",[e],arguments.length),Bn(this,HS,!0,"f"),!ke(this,go,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[ZIe](ke(this,YQ,"f"),void 0,void 0,0,!0);if(td(n))return n.then(()=>{ke(this,go,"f").showHelp(e)}),this}let r=ke(this,Xp,"f").runDefaultBuilderOn(this);if(td(r))return r.then(()=>{ke(this,go,"f").showHelp(e)}),this}return ke(this,go,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return Ln("[boolean|string] [string]",[e,r],arguments.length),ke(this,go,"f").showHelpOnFail(e,r),this}showVersion(e){return Ln("[string|function]",[e],arguments.length),ke(this,go,"f").showVersion(e),this}skipValidation(e){return Ln("",[e],arguments.length),this[KQ]("skipValidation",e),this}strict(e){return Ln("[boolean]",[e],arguments.length),Bn(this,mK,e!==!1,"f"),this}strictCommands(e){return Ln("[boolean]",[e],arguments.length),Bn(this,gK,e!==!1,"f"),this}strictOptions(e){return Ln("[boolean]",[e],arguments.length),Bn(this,AK,e!==!1,"f"),this}string(e){return Ln("",[e],arguments.length),this[KQ]("string",e),this[_K](e),this}terminalWidth(){return Ln([],0),ke(this,zi,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return Ln("",[e],arguments.length),Bn(this,dK,!1,"f"),ke(this,zi,"f").y18n.updateLocale(e),this}usage(e,r,n,o){if(Ln(" [string|boolean] [function|object] [function]",[e,r,n,o],arguments.length),r!==void 0){if(q_(e,null,ke(this,zi,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,o);throw new Zp(".usage() description must start with $0 if being used as alias for .command()")}else return ke(this,go,"f").usage(e),this}usageConfiguration(e){return Ln("",[e],arguments.length),Bn(this,Fze,e,"f"),this}version(e,r,n){let o="version";if(Ln("[boolean|string] [string] [string]",[e,r,n],arguments.length),ke(this,hO,"f")&&(this[rUt](ke(this,hO,"f")),ke(this,go,"f").version(void 0),Bn(this,hO,null,"f")),arguments.length===0)n=this[fgn](),e=o;else if(arguments.length===1){if(e===!1)return this;n=e,e=o}else arguments.length===2&&(n=r,r=void 0);return Bn(this,hO,typeof e=="string"?e:o,"f"),r=r||ke(this,go,"f").deferY18nLookup("Show version number"),ke(this,go,"f").version(n||void 0),this.boolean(ke(this,hO,"f")),this.describe(ke(this,hO,"f"),r),this}wrap(e){return Ln("",[e],arguments.length),ke(this,go,"f").wrap(e),this}[(Xp=new WeakMap,uK=new WeakMap,JIe=new WeakMap,BC=new WeakMap,jS=new WeakMap,Pze=new WeakMap,zQ=new WeakMap,dK=new WeakMap,Dze=new WeakMap,Kx=new WeakMap,Nze=new WeakMap,Jx=new WeakMap,pO=new WeakMap,HS=new WeakMap,Zx=new WeakMap,Mze=new WeakMap,fK=new WeakMap,dg=new WeakMap,ri=new WeakMap,Oze=new WeakMap,Lze=new WeakMap,GS=new WeakMap,pK=new WeakMap,jle=new WeakMap,hK=new WeakMap,YQ=new WeakMap,Bze=new WeakMap,zi=new WeakMap,mK=new WeakMap,gK=new WeakMap,AK=new WeakMap,go=new WeakMap,Fze=new WeakMap,hO=new WeakMap,rp=new WeakMap,sgn)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[agn](){return{log:a((...e)=>{this[Uze]()||console.log(...e),Bn(this,HS,!0,"f"),ke(this,dg,"f").length&&Bn(this,dg,ke(this,dg,"f")+` +`,"f"),Bn(this,dg,ke(this,dg,"f")+e.join(" "),"f")},"log"),error:a((...e)=>{this[Uze]()||console.error(...e),Bn(this,HS,!0,"f"),ke(this,dg,"f").length&&Bn(this,dg,ke(this,dg,"f")+` +`,"f"),Bn(this,dg,ke(this,dg,"f")+e.join(" "),"f")},"error")}}[rUt](e){Qle(ke(this,ri,"f")).forEach(r=>{if((o=>o==="configObjects")(r))return;let n=ke(this,ri,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete ke(this,go,"f").getDescriptions()[e]}[cgn](e,r,n){ke(this,Dze,"f")[n]||(ke(this,zi,"f").process.emitWarning(e,r),ke(this,Dze,"f")[n]=!0)}[lgn](){ke(this,Nze,"f").push({options:ke(this,ri,"f"),configObjects:ke(this,ri,"f").configObjects.slice(0),exitProcess:ke(this,Kx,"f"),groups:ke(this,pO,"f"),strict:ke(this,mK,"f"),strictCommands:ke(this,gK,"f"),strictOptions:ke(this,AK,"f"),completionCommand:ke(this,jS,"f"),output:ke(this,dg,"f"),exitError:ke(this,zQ,"f"),hasOutput:ke(this,HS,"f"),parsed:this.parsed,parseFn:ke(this,GS,"f"),parseContext:ke(this,pK,"f")}),ke(this,go,"f").freeze(),ke(this,rp,"f").freeze(),ke(this,Xp,"f").freeze(),ke(this,Jx,"f").freeze()}[ugn](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(ke(this,zi,"f").process.argv()[0])?r=ke(this,zi,"f").process.argv().slice(1,2):r=ke(this,zi,"f").process.argv().slice(0,1),e=r.map(n=>{let o=this[bgn](ke(this,uK,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&o.length{if(l.includes("package.json"))return"package.json"});q_(s,void 0,ke(this,zi,"f")),n=JSON.parse(ke(this,zi,"f").readFileSync(s,"utf8"))}catch{}return ke(this,jle,"f")[r]=n||{},ke(this,jle,"f")[r]}[KQ](e,r){r=[].concat(r),r.forEach(n=>{n=this[aUt](n),ke(this,ri,"f")[e].push(n)})}[Hle](e,r,n,o){this[sUt](e,r,n,o,(s,c,l)=>{ke(this,ri,"f")[s][c]=l})}[oUt](e,r,n,o){this[sUt](e,r,n,o,(s,c,l)=>{ke(this,ri,"f")[s][c]=(ke(this,ri,"f")[s][c]||[]).concat(l)})}[sUt](e,r,n,o,s){if(Array.isArray(n))n.forEach(c=>{e(c,o)});else if((c=>typeof c=="object")(n))for(let c of Qle(n))e(c,n[c]);else s(r,this[aUt](n),o)}[aUt](e){return e==="__proto__"?"___proto___":e}[cUt](e,r){return this[Hle](this[cUt].bind(this),"key",e,r),this}[lUt](){var e,r,n,o,s,c,l,u,d,f,h,m;let g=ke(this,Nze,"f").pop();q_(g,void 0,ke(this,zi,"f"));let A;e=this,r=this,n=this,o=this,s=this,c=this,l=this,u=this,d=this,f=this,h=this,m=this,{options:{set value(y){Bn(e,ri,y,"f")}}.value,configObjects:A,exitProcess:{set value(y){Bn(r,Kx,y,"f")}}.value,groups:{set value(y){Bn(n,pO,y,"f")}}.value,output:{set value(y){Bn(o,dg,y,"f")}}.value,exitError:{set value(y){Bn(s,zQ,y,"f")}}.value,hasOutput:{set value(y){Bn(c,HS,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){Bn(l,mK,y,"f")}}.value,strictCommands:{set value(y){Bn(u,gK,y,"f")}}.value,strictOptions:{set value(y){Bn(d,AK,y,"f")}}.value,completionCommand:{set value(y){Bn(f,jS,y,"f")}}.value,parseFn:{set value(y){Bn(h,GS,y,"f")}}.value,parseContext:{set value(y){Bn(m,pK,y,"f")}}.value}=g,ke(this,ri,"f").configObjects=A,ke(this,go,"f").unfreeze(),ke(this,rp,"f").unfreeze(),ke(this,Xp,"f").unfreeze(),ke(this,Jx,"f").unfreeze()}[hgn](e,r){return lK(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[mgn].bind(this),getContext:this[ggn].bind(this),getHasOutput:this[Agn].bind(this),getLoggerInstance:this[ygn].bind(this),getParseContext:this[Egn].bind(this),getParserConfiguration:this[yK].bind(this),getUsageConfiguration:this[dgn].bind(this),getUsageInstance:this[_gn].bind(this),getValidationInstance:this[vgn].bind(this),hasParseCallback:this[Uze].bind(this),isGlobalContext:this[Cgn].bind(this),postProcess:this[EK].bind(this),reset:this[uUt].bind(this),runValidation:this[dUt].bind(this),runYargsParserAndExecuteCommands:this[ZIe].bind(this),setHasOutput:this[Sgn].bind(this)}}[mgn](){return ke(this,Xp,"f")}[ggn](){return ke(this,JIe,"f")}[Agn](){return ke(this,HS,"f")}[ygn](){return ke(this,fK,"f")}[Egn](){return ke(this,pK,"f")||{}}[_gn](){return ke(this,go,"f")}[vgn](){return ke(this,rp,"f")}[Uze](){return!!ke(this,GS,"f")}[Cgn](){return ke(this,Mze,"f")}[EK](e,r,n,o){return n||td(e)||(r||(e=this[sgn](e)),(this[yK]()["parse-positional-numbers"]||this[yK]()["parse-positional-numbers"]===void 0)&&(e=this[pgn](e)),o&&(e=cK(e,this,ke(this,Jx,"f").getMiddleware(),!1))),e}[uUt](e={}){Bn(this,ri,ke(this,ri,"f")||{},"f");let r={};r.local=ke(this,ri,"f").local||[],r.configObjects=ke(this,ri,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(e[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(ke(this,hK,"f"),Object.keys(ke(this,pO,"f")).reduce((c,l)=>{let u=ke(this,pO,"f")[l].filter(d=>!(d in n));return u.length>0&&(c[l]=u),c},{})),Bn(this,pO,{},"f");let o=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return o.forEach(c=>{r[c]=(ke(this,ri,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=VQ(ke(this,ri,"f")[c],l=>!n[l])}),r.envPrefix=ke(this,ri,"f").envPrefix,Bn(this,ri,r,"f"),Bn(this,go,ke(this,go,"f")?ke(this,go,"f").reset(n):Z0n(this,ke(this,zi,"f")),"f"),Bn(this,rp,ke(this,rp,"f")?ke(this,rp,"f").reset(n):ign(this,ke(this,go,"f"),ke(this,zi,"f")),"f"),Bn(this,Xp,ke(this,Xp,"f")?ke(this,Xp,"f").reset():Y0n(ke(this,go,"f"),ke(this,rp,"f"),ke(this,Jx,"f"),ke(this,zi,"f")),"f"),ke(this,BC,"f")||Bn(this,BC,tgn(this,ke(this,go,"f"),ke(this,Xp,"f"),ke(this,zi,"f")),"f"),ke(this,Jx,"f").reset(),Bn(this,jS,null,"f"),Bn(this,dg,"","f"),Bn(this,zQ,null,"f"),Bn(this,HS,!1,"f"),this.parsed=!1,this}[bgn](e,r){return ke(this,zi,"f").path.relative(e,r)}[ZIe](e,r,n,o=0,s=!1){var c,l,u,d;let f=!!n||s;e=e||ke(this,YQ,"f"),ke(this,ri,"f").__=ke(this,zi,"f").y18n.__,ke(this,ri,"f").configuration=this[yK]();let h=!!ke(this,ri,"f").configuration["populate--"],m=Object.assign({},ke(this,ri,"f").configuration,{"populate--":!0}),g=ke(this,zi,"f").Parser.detailed(e,Object.assign({},ke(this,ri,"f"),{configuration:{"parse-positional-numbers":!1,...m}})),A=Object.assign(g.argv,ke(this,pK,"f")),y,E=g.aliases,_=!1,v=!1;Object.keys(A).forEach(b=>{b===ke(this,Zx,"f")&&A[b]?_=!0:b===ke(this,hO,"f")&&A[b]&&(v=!0)}),A.$0=this.$0,this.parsed=g,o===0&&ke(this,go,"f").clearCachedHelpMessage();try{if(this[nUt](),r)return this[EK](A,h,!!n,!1);ke(this,Zx,"f")&&[ke(this,Zx,"f")].concat(E[ke(this,Zx,"f")]||[]).filter(x=>x.length>1).includes(""+A._[A._.length-1])&&(A._.pop(),_=!0),Bn(this,Mze,!1,"f");let b=ke(this,Xp,"f").getCommands(),T=!((c=ke(this,BC,"f"))===null||c===void 0)&&c.completionKey?[(l=ke(this,BC,"f"))===null||l===void 0?void 0:l.completionKey,...(d=this.getAliases()[(u=ke(this,BC,"f"))===null||u===void 0?void 0:u.completionKey])!==null&&d!==void 0?d:[]].some(R=>Object.prototype.hasOwnProperty.call(A,R)):!1,w=_||T||s;if(A._.length){if(b.length){let R;for(let x=o||0,P;A._[x]!==void 0;x++)if(P=String(A._[x]),b.includes(P)&&P!==ke(this,jS,"f")){let D=ke(this,Xp,"f").runCommand(P,this,g,x+1,s,_||v||s);return this[EK](D,h,!!n,!1)}else if(!R&&P!==ke(this,jS,"f")){R=P;break}!ke(this,Xp,"f").hasDefaultCommand()&&ke(this,Bze,"f")&&R&&!w&&ke(this,rp,"f").recommendCommands(R,b)}ke(this,jS,"f")&&A._.includes(ke(this,jS,"f"))&&!T&&(ke(this,Kx,"f")&&WQ(!0),this.showCompletionScript(),this.exit(0))}if(ke(this,Xp,"f").hasDefaultCommand()&&!w){let R=ke(this,Xp,"f").runCommand(null,this,g,0,s,_||v||s);return this[EK](R,h,!!n,!1)}if(T){ke(this,Kx,"f")&&WQ(!0),e=[].concat(e);let R=e.slice(e.indexOf(`--${ke(this,BC,"f").completionKey}`)+1);return ke(this,BC,"f").getCompletion(R,(x,P)=>{if(x)throw new Zp(x.message);(P||[]).forEach(D=>{ke(this,fK,"f").log(D)}),this.exit(0)}),this[EK](A,!h,!!n,!1)}if(ke(this,HS,"f")||(_?(ke(this,Kx,"f")&&WQ(!0),f=!0,this.showHelp(R=>{ke(this,fK,"f").log(R),this.exit(0)})):v&&(ke(this,Kx,"f")&&WQ(!0),f=!0,ke(this,go,"f").showVersion("log"),this.exit(0))),!f&&ke(this,ri,"f").skipValidation.length>0&&(f=Object.keys(A).some(R=>ke(this,ri,"f").skipValidation.indexOf(R)>=0&&A[R]===!0)),!f){if(g.error)throw new Zp(g.error.message);if(!T){let R=this[dUt](E,{},g.error);n||(y=cK(A,this,ke(this,Jx,"f").getMiddleware(),!0)),y=this[hgn](R,y??A),td(y)&&!n&&(y=y.then(()=>cK(A,this,ke(this,Jx,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof Zp)ke(this,go,"f").fail(b.message,b);else throw b}return this[EK](y??A,h,!!n,!0)}[dUt](e,r,n,o){let s={...this.getDemandedOptions()};return c=>{if(n)throw new Zp(n.message);ke(this,rp,"f").nonOptionCount(c),ke(this,rp,"f").requiredArguments(c,s);let l=!1;ke(this,gK,"f")&&(l=ke(this,rp,"f").unknownCommands(c)),ke(this,mK,"f")&&!l?ke(this,rp,"f").unknownArguments(c,e,r,!!o):ke(this,AK,"f")&&ke(this,rp,"f").unknownArguments(c,e,{},!1,!1),ke(this,rp,"f").limitedChoices(c),ke(this,rp,"f").implications(c),ke(this,rp,"f").conflicting(c)}}[Sgn](){Bn(this,HS,!0,"f")}[_K](e){if(typeof e=="string")ke(this,ri,"f").key[e]=!0;else for(let r of e)ke(this,ri,"f").key[r]=!0}};function K0n(t){return!!t&&typeof t.getInternalMethods=="function"}a(K0n,"isYargsInstance");var T9o=Tgn(G0n),Ign=T9o;p();p();var Rgn=require("node:child_process"),kgn=require("node:util");var I9o=(0,kgn.promisify)(Rgn.execFile),JQ="1.0.60",xgn="COPILOT_CLI_PATH",x9o="GITHUB_COPILOT_ACP_USE_CLI",Gle="@github/copilot",w9o=3e4,R9o=1e4,wgn=6e4,$le=class extends Error{static{a(this,"CLIDiscoveryError")}constructor(e){super(e),this.name="CLIDiscoveryError"}};function Pgn(){return process.env[x9o]!=="0"}a(Pgn,"isCLIIntegrationEnabled");var pUt=process.platform==="win32";async function Dgn(){if(process.env[xgn]){let l=process.env[xgn],u=await XIe(l,["--version"]);if(u)return P9o(u,"COPILOT_CLI_PATH"),{path:l,args:[],version:u,source:"env"};throw new $le("Copilot CLI not found at COPILOT_CLI_PATH. Ensure the path is correct and the binary is executable.")}let t=await XIe("copilot",["--version"]);if(t&&exe(t,JQ))return{path:"copilot",args:[],version:t,source:"path"};let e=process.platform==="win32"?"npx.cmd":"npx",r=await XIe(e,["--offline",Gle,"--version"],!1,R9o);if(r&&exe(r,JQ))return{path:e,args:[Gle],version:r,source:"npx"};let n=`${Gle}@${JQ}`,o=await XIe(e,[n,"--version"],!1,wgn);if(o&&exe(o,JQ))return{path:e,args:[n],version:o,source:"npx-pinned"};let s=`${Gle}@latest`,c=await XIe(e,[s,"--version"],!0,wgn);if(c){if(exe(c,JQ))return{path:e,args:[s],version:c,source:"npx-latest"};throw new $le(`Latest published Copilot CLI version ${c} is below the minimum required ${JQ}.`)}throw new $le(`Copilot CLI version could not be determined. 'npx ${s} --version' ran successfully but its output contained no recognisable version. +Try running 'npx ${s} --version' manually to inspect the output, or install/update globally with: npm install -g ${Gle}`)}a(Dgn,"discoverCLI");function k9o(t){let e=t.match(/(\d+\.\d+\.\d+)/);return e?e[1]:null}a(k9o,"parseVersion");async function XIe(t,e,r=!1,n=w9o){try{let{stdout:o}=await I9o(t,e,{timeout:n,shell:pUt});return k9o(o)}catch(o){if(r)throw o;return null}}a(XIe,"tryGetVersion");function P9o(t,e){if(!exe(t,JQ))throw new $le(`Copilot CLI version ${t} (from ${e}) is below the minimum required version ${JQ}. Update with: npm install -g ${Gle}@latest`)}a(P9o,"validateVersion");function exe(t,e){let r=a(c=>c.replace(/^v/,"").split(".").map(l=>{let u=parseInt(l,10);return isNaN(u)?0:u}),"parse"),n=r(t),o=r(e),s=Math.max(n.length,o.length);for(let c=0;cu)return!0;if(lr.type==="file").map(r=>r.uri).filter(Boolean),...this.request.activeEditor?.uri?[this.request.activeEditor.uri]:[]];return Array.from(new Set(e))}getMetadata(e){return this._metadata.get(e)?.at(-1)}getAllMetadata(e){return this._metadata.get(e)}setMetadata(e){let r=e.constructor,n=this._metadata.get(r)??[];n.push(e),this._metadata.set(r,n)}hasMetadata(e){let r=this._metadata.get(e);return r!==void 0&&r.length>0}isSubagent(){return this.parentTurnId!==void 0&&this.parentTurnId!==""}},vK=class t{constructor(e=[],r="panel",n="en",o){this.turns=e;this.source=r;this.userLanguage=n;this._telemetryId=Nt();this._timestamp=Date.now();this.uriSchemeCache=new Qze;this.currentPartitionId=1;this.id=o??this.telemetryId}static{a(this,"Conversation")}copy(){let e=JSON.parse(JSON.stringify(this.turns)),r=new t(e,this.source,this.userLanguage,this.id);return r._telemetryId=this.telemetryId,r._timestamp=this.timestamp,r.currentPartitionId=this.currentPartitionId,r}get telemetryId(){return this._telemetryId}get timestamp(){return this._timestamp}addTurn(e){this.turns.push(e)}deleteTurn(e){this.turns=this.turns.filter(r=>r.id!==e)}getLastTurn(){return this.turns[this.turns.length-1]}findTurn(e){return this.turns.find(r=>r.id===e)}};p();p();var Xx=class{constructor(){this.promiseMap=new Map}static{a(this,"SequencerByKey")}queue(e,r){let o=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(r).finally(()=>{this.promiseMap.get(e)===o&&this.promiseMap.delete(e)});return this.promiseMap.set(e,o),o}async drain(){let e=Array.from(this.promiseMap.values());await Promise.all(e.map(r=>r.catch(()=>{})))}};p();var M3=(n=>(n.Local="LOCAL",n.Background="BACKGROUND",n.Claude="CLAUDE",n))(M3||{}),D9o=Object.values(M3);function O3(t){let e=new Set;for(let r of t??[]){let n=r.providers;if(Array.isArray(n))for(let o of n)e.add(o)}return e.size===0?["LOCAL","BACKGROUND"]:D9o.filter(r=>e.has(r))}a(O3,"unionProviders");function $S(t,e){return t?["BACKGROUND"]:e?.length?[...e]:["LOCAL","BACKGROUND"]}a($S,"providersForListRow");p();p();p();var CK=fe(require("child_process")),mUt=fe(require("path")),Ygn=fe(zgn());function Kgn(t){return t.replace(/^git version /,"")}a(Kgn,"parseVersion");function gUt(t){return new Promise((e,r)=>{let n=[],o=CK.spawn(t,["--version"]);o.stdout.on("data",s=>n.push(s)),o.on("error",r),o.on("close",s=>s?r(new Error(`Not found. Code: ${s}`)):e({path:t,version:Kgn(Buffer.concat(n).toString("utf8").trim())}))})}a(gUt,"findSpecificGit");function $9o(){return new Promise((t,e)=>{CK.exec("which git",(r,n)=>{if(r)return e(new Error(`Executing "which git" failed: ${r.message}`));let o=n.toString().trim();function s(c){CK.execFile(c,["--version"],(l,u)=>l?e(new Error(`Executing "${c} --version" failed: ${l.message}`)):t({path:c,version:Kgn(u.toString().trim())}))}if(a(s,"getVersion"),o!=="/usr/bin/git")return s(o);CK.exec("xcode-select -p",c=>{if(c&&c.code===2)return e(new Error('Executing "xcode-select -p" failed with error code 2.'));s(o)})})})}a($9o,"findGitDarwin");function qze(t){return t?gUt(mUt.join(t,"Git","cmd","git.exe")):Promise.reject(new Error("Not found"))}a(qze,"findSystemGitWin32");async function V9o(){let t=await(0,Ygn.default)("git.exe");return gUt(t)}a(V9o,"findGitWin32InPath");function W9o(){return qze(process.env.ProgramW6432).then(void 0,()=>qze(process.env["ProgramFiles(x86)"])).then(void 0,()=>qze(process.env.ProgramFiles)).then(void 0,()=>qze(mUt.join(process.env.LocalAppData,"Programs"))).then(void 0,()=>V9o())}a(W9o,"findGitWin32");async function mO(){try{switch(process.platform){case"darwin":return await $9o();case"win32":return await W9o();default:return await gUt("git")}}catch(t){throw new Error(`Git installation not found in trusted locations: ${t.message}`)}}a(mO,"findGit");var Jgn=require("node:child_process"),Zgn=require("node:util");var z9o=(0,Zgn.promisify)(Jgn.execFile);async function Xgn(t){return AUt(t,["github.com"])}a(Xgn,"resolveGitHubNwo");async function AUt(t,e){let r;try{r=(await mO()).path}catch{return}let n;try{n=(await z9o(r,["remote","get-url","origin"],{cwd:t,timeout:5e3,windowsHide:!0})).stdout}catch{return}return Y9o(n,e)}a(AUt,"resolveGitHubNwoForHosts");function Y9o(t,e){let r=new Set(["github.com",...e.map(h=>h.toLowerCase())]),n=t.trim().match(/^(?:(?:https?|ssh|git):\/\/(?:[^@]+@)?|git@)([^/:]+)(?::\d+)?[:/](.+?)(?:\.git)?$/);if(!n)return;let[,o,s]=n;if(!r.has(o.toLowerCase()))return;let c=s.indexOf("/");if(c<=0)return;let l=s.slice(0,c),u=s.slice(c+1),d=u.indexOf("/"),f=d>=0?u.slice(0,d):u;if(!(!l||!f))return{owner:l,repo:f}}a(Y9o,"parseGitRemoteUrl");async function eAn(t,e,r=fetch){let n=`https://api.github.com/repos/${encodeURIComponent(t.owner)}/${encodeURIComponent(t.repo)}`,o;try{o=await r(n,{headers:{Authorization:`token ${e}`,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}})}catch{return}if(!o.ok)return;let s=await o.json();if(!(typeof s.id!="number"||typeof s.owner?.id!="number"))return{ownerId:s.owner.id,repoId:s.id}}a(eAn,"resolveRepoIds");p();var K9o=3e4,jze=class{constructor(e,r=K9o){this.ctx=e;this.timeoutMs=r;this.logger=new pe("OrgCustomAgentClient")}static{a(this,"OrgCustomAgentClient")}async listCustomAgents(e,r){let n=this.ctx,o=await this.tryGetAccessToken();if(!o)return;let s=RB(n).api,c=`${tAn(s)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}?include_sources=org,enterprise`;try{let l=await n.get(nr).fetch(c,{method:"GET",headers:{Authorization:`Bearer ${o}`,Accept:"application/json",...Vh(n)},timeout:this.timeoutMs});if(!l.ok){this.logger.warn(n,`[OrgCustomAgentClient] list ${e}/${r} -> ${l.status}`);return}let u=await l.json();return Array.isArray(u?.agents)?u.agents:[]}catch(l){this.logger.warn(n,`[OrgCustomAgentClient] list ${e}/${r} failed: ${String(l)}`);return}}async getCustomAgentDetails(e,r,n,o){let s=this.ctx,c=await this.tryGetAccessToken();if(!c)return;let l=RB(s).api,u=new URL(`${tAn(l)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}/${encodeURIComponent(n)}`);u.searchParams.set("version",o);try{let d=await s.get(nr).fetch(u.toString(),{method:"GET",headers:{Authorization:`Bearer ${c}`,Accept:"application/json",...Vh(s)},timeout:this.timeoutMs});if(!d.ok){this.logger.warn(s,`[OrgCustomAgentClient] detail ${e}/${r}/${n}?version=${o} -> ${d.status}`);return}return await d.json()}catch(d){this.logger.warn(s,`[OrgCustomAgentClient] detail ${e}/${r}/${n}?version=${o} failed: ${String(d)}`);return}}async tryGetAccessToken(){try{return(await this.ctx.get(Mr).resolveSession())?.accessToken}catch(e){this.logger.debug(this.ctx,`[OrgCustomAgentClient] no GitHub session: ${String(e)}`);return}}};function tAn(t){return t.endsWith("/")?t.slice(0,-1):t}a(tAn,"trimTrailingSlash");p();p();function J9o(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}a(J9o,"getDefaultExportFromCjs");var uE={},Hze={},XQ={},rAn;function txe(){if(rAn)return XQ;rAn=1;function t(c){return typeof c>"u"||c===null}a(t,"isNothing");function e(c){return typeof c=="object"&&c!==null}a(e,"isObject");function r(c){return Array.isArray(c)?c:t(c)?[]:[c]}a(r,"toArray");function n(c,l){if(l){let u=Object.keys(l);for(let d=0,f=u.length;dh&&(d=" ... ",s=l-h+d.length),c-l>h&&(f=" ...",c=l+h-f.length),{str:d+o.slice(s,c).replace(/\t/g,"\u2192")+f,pos:l-s+d.length}}a(e,"getLine");function r(o,s){return t.repeat(" ",s-o.length)+o}a(r,"padStart");function n(o,s){if(s=Object.create(s||null),!o.buffer)return null;s.maxLength||(s.maxLength=79),typeof s.indent!="number"&&(s.indent=1),typeof s.linesBefore!="number"&&(s.linesBefore=3),typeof s.linesAfter!="number"&&(s.linesAfter=2);let c=/\r?\n|\r|\0/g,l=[0],u=[],d,f=-1;for(;d=c.exec(o.buffer);)u.push(d.index),l.push(d.index+d[0].length),o.position<=d.index&&f<0&&(f=l.length-2);f<0&&(f=l.length-1);let h="",m=Math.min(o.line+s.linesAfter,u.length).toString().length,g=s.maxLength-(s.indent+m+3);for(let y=1;y<=s.linesBefore&&!(f-y<0);y++){let E=e(o.buffer,l[f-y],u[f-y],o.position-(l[f]-l[f-y]),g);h=t.repeat(" ",s.indent)+r((o.line-y+1).toString(),m)+" | "+E.str+` +`+h}let A=e(o.buffer,l[f],u[f],o.position,g);h+=t.repeat(" ",s.indent)+r((o.line+1).toString(),m)+" | "+A.str+` +`,h+=t.repeat("-",s.indent+m+3+A.pos)+`^ +`;for(let y=1;y<=s.linesAfter&&!(f+y>=u.length);y++){let E=e(o.buffer,l[f+y],u[f+y],o.position-(l[f]-l[f+y]),g);h+=t.repeat(" ",s.indent)+r((o.line+y+1).toString(),m)+" | "+E.str+` +`}return h.replace(/\n$/,"")}return a(n,"makeSnippet"),EUt=n,EUt}a(Z9o,"requireSnippet");var _Ut,oAn;function H_(){if(oAn)return _Ut;oAn=1;let t=rxe(),e=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function n(s){let c={};return s!==null&&Object.keys(s).forEach(function(l){s[l].forEach(function(u){c[String(u)]=l})}),c}a(n,"compileStyleAliases");function o(s,c){if(c=c||{},Object.keys(c).forEach(function(l){if(e.indexOf(l)===-1)throw new t('Unknown option "'+l+'" is met in definition of "'+s+'" YAML type.')}),this.options=c,this.tag=s,this.kind=c.kind||null,this.resolve=c.resolve||function(){return!0},this.construct=c.construct||function(l){return l},this.instanceOf=c.instanceOf||null,this.predicate=c.predicate||null,this.represent=c.represent||null,this.representName=c.representName||null,this.defaultStyle=c.defaultStyle||null,this.multi=c.multi||!1,this.styleAliases=n(c.styleAliases||null),r.indexOf(this.kind)===-1)throw new t('Unknown kind "'+this.kind+'" is specified for "'+s+'" YAML type.')}return a(o,"Type2"),_Ut=o,_Ut}a(H_,"requireType");var vUt,sAn;function xAn(){if(sAn)return vUt;sAn=1;let t=rxe(),e=H_();function r(s,c){let l=[];return s[c].forEach(function(u){let d=l.length;l.forEach(function(f,h){f.tag===u.tag&&f.kind===u.kind&&f.multi===u.multi&&(d=h)}),l[d]=u}),l}a(r,"compileList");function n(){let s={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function c(l){l.multi?(s.multi[l.kind].push(l),s.multi.fallback.push(l)):s[l.kind][l.tag]=s.fallback[l.tag]=l}a(c,"collectType");for(let l=0,u=arguments.length;l=48&&d<=57||d>=65&&d<=70||d>=97&&d<=102}a(r,"isHexCode");function n(d){return d>=48&&d<=55}a(n,"isOctCode");function o(d){return d>=48&&d<=57}a(o,"isDecCode");function s(d){if(d===null)return!1;let f=d.length,h=0,m=!1;if(!f)return!1;let g=d[h];if((g==="-"||g==="+")&&(g=d[++h]),g==="0"){if(h+1===f)return!0;if(g=d[++h],g==="b"){for(h++;h=0?"0b"+d.toString(2):"-0b"+d.toString(2).slice(1)},"binary"),octal:a(function(d){return d>=0?"0o"+d.toString(8):"-0o"+d.toString(8).slice(1)},"octal"),decimal:a(function(d){return d.toString(10)},"decimal"),hexadecimal:a(function(d){return d>=0?"0x"+d.toString(16).toUpperCase():"-0x"+d.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),wUt}a(MAn,"requireInt");var RUt,hAn;function OAn(){if(hAn)return RUt;hAn=1;let t=txe(),e=H_(),r=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),n=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function o(d){return d===null||!r.test(d)?!1:isFinite(parseFloat(d,10))?!0:n.test(d)}a(o,"resolveYamlFloat");function s(d){let f=d.toLowerCase(),h=f[0]==="-"?-1:1;return"+-".indexOf(f[0])>=0&&(f=f.slice(1)),f===".inf"?h===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:f===".nan"?NaN:h*parseFloat(f,10)}a(s,"constructYamlFloat");let c=/^[-+]?[0-9]+e/;function l(d,f){if(isNaN(d))switch(f){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===d)switch(f){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===d)switch(f){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(t.isNegativeZero(d))return"-0.0";let h=d.toString(10);return c.test(h)?h.replace("e",".e"):h}a(l,"representYamlFloat");function u(d){return Object.prototype.toString.call(d)==="[object Number]"&&(d%1!==0||t.isNegativeZero(d))}return a(u,"isFloat"),RUt=new e("tag:yaml.org,2002:float",{kind:"scalar",resolve:o,construct:s,predicate:u,represent:l,defaultStyle:"lowercase"}),RUt}a(OAn,"requireFloat");var kUt,mAn;function LAn(){return mAn||(mAn=1,kUt=PAn().extend({implicit:[DAn(),NAn(),MAn(),OAn()]})),kUt}a(LAn,"requireJson");var PUt,gAn;function BAn(){return gAn||(gAn=1,PUt=LAn()),PUt}a(BAn,"requireCore");var DUt,AAn;function FAn(){if(AAn)return DUt;AAn=1;let t=H_(),e=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function n(c){return c===null?!1:e.exec(c)!==null||r.exec(c)!==null}a(n,"resolveYamlTimestamp");function o(c){let l=0,u=null,d=e.exec(c);if(d===null&&(d=r.exec(c)),d===null)throw new Error("Date resolve error");let f=+d[1],h=+d[2]-1,m=+d[3];if(!d[4])return new Date(Date.UTC(f,h,m));let g=+d[4],A=+d[5],y=+d[6];if(d[7]){for(l=d[7].slice(0,3);l.length<3;)l+="0";l=+l}if(d[9]){let _=+d[10],v=+(d[11]||0);u=(_*60+v)*6e4,d[9]==="-"&&(u=-u)}let E=new Date(Date.UTC(f,h,m,g,A,y,l));return u&&E.setTime(E.getTime()-u),E}a(o,"constructYamlTimestamp");function s(c){return c.toISOString()}return a(s,"representYamlTimestamp"),DUt=new t("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:n,construct:o,instanceOf:Date,represent:s}),DUt}a(FAn,"requireTimestamp");var NUt,yAn;function UAn(){if(yAn)return NUt;yAn=1;let t=H_();function e(r){return r==="<<"||r===null}return a(e,"resolveYamlMerge"),NUt=new t("tag:yaml.org,2002:merge",{kind:"scalar",resolve:e}),NUt}a(UAn,"requireMerge");var MUt,EAn;function QAn(){if(EAn)return MUt;EAn=1;let t=H_(),e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function r(c){if(c===null)return!1;let l=0,u=c.length,d=e;for(let f=0;f64)){if(h<0)return!1;l+=6}}return l%8===0}a(r,"resolveYamlBinary");function n(c){let l=c.replace(/[\r\n=]/g,""),u=l.length,d=e,f=0,h=[];for(let g=0;g>16&255),h.push(f>>8&255),h.push(f&255)),f=f<<6|d.indexOf(l.charAt(g));let m=u%4*6;return m===0?(h.push(f>>16&255),h.push(f>>8&255),h.push(f&255)):m===18?(h.push(f>>10&255),h.push(f>>2&255)):m===12&&h.push(f>>4&255),new Uint8Array(h)}a(n,"constructYamlBinary");function o(c){let l="",u=0,d=c.length,f=e;for(let m=0;m>18&63],l+=f[u>>12&63],l+=f[u>>6&63],l+=f[u&63]),u=(u<<8)+c[m];let h=d%3;return h===0?(l+=f[u>>18&63],l+=f[u>>12&63],l+=f[u>>6&63],l+=f[u&63]):h===2?(l+=f[u>>10&63],l+=f[u>>4&63],l+=f[u<<2&63],l+=f[64]):h===1&&(l+=f[u>>2&63],l+=f[u<<4&63],l+=f[64],l+=f[64]),l}a(o,"representYamlBinary");function s(c){return Object.prototype.toString.call(c)==="[object Uint8Array]"}return a(s,"isBinary"),MUt=new t("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:n,predicate:s,represent:o}),MUt}a(QAn,"requireBinary");var OUt,_An;function qAn(){if(_An)return OUt;_An=1;let t=H_(),e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function n(s){if(s===null)return!0;let c=[],l=s;for(let u=0,d=l.length;u=48&&F<=57)return F-48;let se=F|32;return se>=97&&se<=102?se-97+10:-1}a(R,"fromHexCode");function x(F){return F===120?2:F===117?4:F===85?8:0}a(x,"escapedHexLen");function P(F){return F>=48&&F<=57?F-48:-1}a(P,"fromDecimalCode");function D(F){switch(F){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return` +`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}a(D,"simpleEscapeSequence");function N(F){return F<=65535?String.fromCharCode(F):String.fromCharCode((F-65536>>10)+55296,(F-65536&1023)+56320)}a(N,"charFromCodepoint");function L(F,se,be){se==="__proto__"?Object.defineProperty(F,se,{configurable:!0,enumerable:!0,writable:!0,value:be}):F[se]=be}a(L,"setProperty");let B=new Array(256),j=new Array(256);for(let F=0;F<256;F++)B[F]=D(F)?1:0,j[F]=D(F);function M(F,se){this.input=F,this.filename=se.filename||null,this.schema=se.schema||n,this.onWarning=se.onWarning||null,this.legacy=se.legacy||!1,this.json=se.json||!1,this.listener=se.listener||null,this.maxDepth=typeof se.maxDepth=="number"?se.maxDepth:100,this.maxTotalMergeKeys=typeof se.maxTotalMergeKeys=="number"?se.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=F.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}a(M,"State");function O(F,se){let be={name:F.filename,buffer:F.input.slice(0,-1),position:F.position,line:F.line,column:F.position-F.lineStart};return be.snippet=r(be),new e(se,be)}a(O,"generateError");function U(F,se){throw O(F,se)}a(U,"throwError");function q(F,se){F.onWarning&&F.onWarning.call(null,O(F,se))}a(q,"throwWarning");function Q(F,se,be){let Fe=F.anchorMapTransactions;if(Fe.length!==0){let Ue=Fe[Fe.length-1];o.call(Ue,se)||(Ue[se]={existed:o.call(F.anchorMap,se),value:F.anchorMap[se]})}F.anchorMap[se]=be}a(Q,"storeAnchor");function Y(F){F.anchorMapTransactions.push(Object.create(null))}a(Y,"beginAnchorTransaction");function W(F){let se=F.anchorMapTransactions.pop(),be=F.anchorMapTransactions;if(be.length===0)return;let Fe=be[be.length-1],Ue=Object.keys(se);for(let me=0,Z=Ue.length;me=0;Fe-=1){let Ue=se[be[Fe]];Ue.existed?F.anchorMap[be[Fe]]=Ue.value:delete F.anchorMap[be[Fe]]}}a(V,"rollbackAnchorTransaction");function z(F){return{position:F.position,line:F.line,lineStart:F.lineStart,lineIndent:F.lineIndent,firstTabInLine:F.firstTabInLine,tag:F.tag,anchor:F.anchor,kind:F.kind,result:F.result}}a(z,"snapshotState");function ie(F,se){F.position=se.position,F.line=se.line,F.lineStart=se.lineStart,F.lineIndent=se.lineIndent,F.firstTabInLine=se.firstTabInLine,F.tag=se.tag,F.anchor=se.anchor,F.kind=se.kind,F.result=se.result}a(ie,"restoreState");let H={YAML:a(function(se,be,Fe){se.version!==null&&U(se,"duplication of %YAML directive"),Fe.length!==1&&U(se,"YAML directive accepts exactly one argument");let Ue=/^([0-9]+)\.([0-9]+)$/.exec(Fe[0]);Ue===null&&U(se,"ill-formed argument of the YAML directive");let me=parseInt(Ue[1],10),Z=parseInt(Ue[2],10);me!==1&&U(se,"unacceptable YAML version of the document"),se.version=Fe[0],se.checkLineBreaks=Z<2,Z!==1&&Z!==2&&q(se,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(se,be,Fe){let Ue;Fe.length!==2&&U(se,"TAG directive accepts exactly two arguments");let me=Fe[0];Ue=Fe[1],y.test(me)||U(se,"ill-formed tag handle (first argument) of the TAG directive"),o.call(se.tagMap,me)&&U(se,'there is a previously declared suffix for "'+me+'" tag handle'),E.test(Ue)||U(se,"ill-formed tag prefix (second argument) of the TAG directive");try{Ue=decodeURIComponent(Ue)}catch{U(se,"tag prefix is malformed: "+Ue)}se.tagMap[me]=Ue},"handleTagDirective")};function te(F,se,be,Fe){if(se=32&&ve<=1114111||U(F,"expected valid JSON character")}else m.test(Ue)&&U(F,"the stream contains non-printable characters");F.result+=Ue}}a(te,"captureSegment");function le(F,se,be,Fe){t.isObject(be)||U(F,"cannot merge mappings; the provided source object is unacceptable");let Ue=Object.keys(be);for(let me=0,Z=Ue.length;meF.maxTotalMergeKeys&&U(F,"merge keys exceeded maxTotalMergeKeys ("+F.maxTotalMergeKeys+")"),o.call(se,ve)||(L(se,ve,be[ve]),Fe[ve]=!0)}}a(le,"mergeMappings");function Le(F,se,be,Fe,Ue,me,Z,ve,Ge){if(Array.isArray(Ue)){Ue=Array.prototype.slice.call(Ue);for(let Qe=0,je=Ue.length;Qe1&&(F.result+=t.repeat(` +`,se-1))}a(re,"writeFoldedLines");function ee(F,se,be){let Fe,Ue,me,Z,ve,Ge,Qe=F.kind,je=F.result,J=F.input.charCodeAt(F.position);if(T(J)||w(J)||J===35||J===38||J===42||J===33||J===124||J===62||J===39||J===34||J===37||J===64||J===96)return!1;if(J===63||J===45){let ae=F.input.charCodeAt(F.position+1);if(T(ae)||be&&w(ae))return!1}for(F.kind="scalar",F.result="",Fe=Ue=F.position,me=!1;J!==0;){if(J===58){let ae=F.input.charCodeAt(F.position+1);if(T(ae)||be&&w(ae))break}else if(J===35){let ae=F.input.charCodeAt(F.position-1);if(T(ae))break}else{if(F.position===F.lineStart&&we(F)||be&&w(J))break;if(v(J))if(Z=F.line,ve=F.lineStart,Ge=F.lineIndent,Oe(F,!1,-1),F.lineIndent>=se){me=!0,J=F.input.charCodeAt(F.position);continue}else{F.position=Ue,F.line=Z,F.lineStart=ve,F.lineIndent=Ge;break}}me&&(te(F,Fe,Ue,!1),re(F,F.line-Z),Fe=Ue=F.position,me=!1),b(J)||(Ue=F.position+1),J=F.input.charCodeAt(++F.position)}return te(F,Fe,Ue,!1),F.result?!0:(F.kind=Qe,F.result=je,!1)}a(ee,"readPlainScalar");function K(F,se){let be,Fe,Ue=F.input.charCodeAt(F.position);if(Ue!==39)return!1;for(F.kind="scalar",F.result="",F.position++,be=Fe=F.position;(Ue=F.input.charCodeAt(F.position))!==0;)if(Ue===39)if(te(F,be,F.position,!0),Ue=F.input.charCodeAt(++F.position),Ue===39)be=F.position,F.position++,Fe=F.position;else return!0;else v(Ue)?(te(F,be,Fe,!0),re(F,Oe(F,!1,se)),be=Fe=F.position):F.position===F.lineStart&&we(F)?U(F,"unexpected end of the document within a single quoted scalar"):(F.position++,b(Ue)||(Fe=F.position));U(F,"unexpected end of the stream within a single quoted scalar")}a(K,"readSingleQuotedScalar");function he(F,se){let be,Fe,Ue,me=F.input.charCodeAt(F.position);if(me!==34)return!1;for(F.kind="scalar",F.result="",F.position++,be=Fe=F.position;(me=F.input.charCodeAt(F.position))!==0;){if(me===34)return te(F,be,F.position,!0),F.position++,!0;if(me===92){if(te(F,be,F.position,!0),me=F.input.charCodeAt(++F.position),v(me))Oe(F,!1,se);else if(me<256&&B[me])F.result+=j[me],F.position++;else if((Ue=x(me))>0){let Z=Ue,ve=0;for(;Z>0;Z--)me=F.input.charCodeAt(++F.position),(Ue=R(me))>=0?ve=(ve<<4)+Ue:U(F,"expected hexadecimal character");F.result+=N(ve),F.position++}else U(F,"unknown escape sequence");be=Fe=F.position}else v(me)?(te(F,be,Fe,!0),re(F,Oe(F,!1,se)),be=Fe=F.position):F.position===F.lineStart&&we(F)?U(F,"unexpected end of the document within a double quoted scalar"):(F.position++,b(me)||(Fe=F.position))}U(F,"unexpected end of the stream within a double quoted scalar")}a(he,"readDoubleQuotedScalar");function X(F,se){let be=!0,Fe,Ue,me,Z=F.tag,ve,Ge=F.anchor,Qe,je,J,ae,Ce=Object.create(null),Re,$e,Ye,lt=F.input.charCodeAt(F.position);if(lt===91)Qe=93,ae=!1,ve=[];else if(lt===123)Qe=125,ae=!0,ve={};else return!1;for(F.anchor!==null&&Q(F,F.anchor,ve),lt=F.input.charCodeAt(++F.position);lt!==0;){if(Oe(F,!0,se),lt=F.input.charCodeAt(F.position),lt===Qe)return F.position++,F.tag=Z,F.anchor=Ge,F.kind=ae?"mapping":"sequence",F.result=ve,!0;if(be?lt===44&&U(F,"expected the node content, but found ','"):U(F,"missed comma between flow collection entries"),$e=Re=Ye=null,je=J=!1,lt===63){let yt=F.input.charCodeAt(F.position+1);T(yt)&&(je=J=!0,F.position++,Oe(F,!0,se))}Fe=F.line,Ue=F.lineStart,me=F.position,tt(F,se,s,!1,!0),$e=F.tag,Re=F.result,Oe(F,!0,se),lt=F.input.charCodeAt(F.position),(J||F.line===Fe)&<===58&&(je=!0,lt=F.input.charCodeAt(++F.position),Oe(F,!0,se),tt(F,se,s,!1,!0),Ye=F.result),ae?Le(F,ve,Ce,$e,Re,Ye,Fe,Ue,me):je?ve.push(Le(F,null,Ce,$e,Re,Ye,Fe,Ue,me)):ve.push(Re),Oe(F,!0,se),lt=F.input.charCodeAt(F.position),lt===44?(be=!0,lt=F.input.charCodeAt(++F.position)):be=!1}U(F,"unexpected end of the stream within a flow collection")}a(X,"readFlowCollection");function de(F,se){let be,Fe=d,Ue=!1,me=!1,Z=se,ve=0,Ge=!1,Qe,je=F.input.charCodeAt(F.position);if(je===124)be=!1;else if(je===62)be=!0;else return!1;for(F.kind="scalar",F.result="";je!==0;)if(je=F.input.charCodeAt(++F.position),je===43||je===45)d===Fe?Fe=je===43?h:f:U(F,"repeat of a chomping mode identifier");else if((Qe=P(je))>=0)Qe===0?U(F,"bad explicit indentation width of a block scalar; it cannot be less than one"):me?U(F,"repeat of an indentation width identifier"):(Z=se+Qe-1,me=!0);else break;if(b(je)){do je=F.input.charCodeAt(++F.position);while(b(je));if(je===35)do je=F.input.charCodeAt(++F.position);while(!v(je)&&je!==0)}for(;je!==0;){for(ge(F),F.lineIndent=0,je=F.input.charCodeAt(F.position);(!me||F.lineIndentZ&&(Z=F.lineIndent),v(je)){ve++;continue}if(!me&&Z===0&&U(F,"missing indentation for block scalar"),F.lineIndentse)&&Z!==0)U(F,"bad indentation of a sequence entry");else if(F.lineIndentse)&&(Re&&(Ue=F.line,me=F.lineStart,Z=F.position),tt(F,se,u,!0,Fe)&&(Re?ae=F.result:Ce=F.result),Re||(Le(F,Qe,je,J,ae,Ce,Ue,me,Z),J=ae=Ce=null),Oe(F,!0,-1),Ye=F.input.charCodeAt(F.position)),(F.line===yt||F.lineIndent>se)&&Ye!==0)U(F,"bad indentation of a mapping entry");else if(F.lineIndent=F.maxDepth&&U(F,"nesting exceeded maxDepth ("+F.maxDepth+")"),F.depth+=1,F.listener!==null&&F.listener("open",F),F.tag=null,F.anchor=null,F.kind=null,F.result=null;let Re=me=Z=u===be||l===be;if(Fe&&Oe(F,!0,-1)&&(Ge=!0,F.lineIndent>se?ve=1:F.lineIndent===se?ve=0:F.lineIndentse?ve=1:F.lineIndent===se?ve=0:F.lineIndent tag; it should be "scalar", not "'+F.kind+'"');for(let $e=0,Ye=F.implicitTypes.length;$e"),F.result!==null&&J.kind!==F.kind&&U(F,"unacceptable node kind for !<"+F.tag+'> tag; it should be "'+J.kind+'", not "'+F.kind+'"'),J.resolve(F.result,F.tag)?(F.result=J.construct(F.result,F.tag),F.anchor!==null&&Q(F,F.anchor,F.result)):U(F,"cannot resolve a node with !<"+F.tag+"> explicit tag")}return F.listener!==null&&F.listener("close",F),F.depth-=1,F.tag!==null||F.anchor!==null||Qe}a(tt,"composeNode");function st(F){let se=F.position,be=!1,Fe;for(F.version=null,F.checkLineBreaks=F.legacy,F.tagMap=Object.create(null),F.anchorMap=Object.create(null);(Fe=F.input.charCodeAt(F.position))!==0&&(Oe(F,!0,-1),Fe=F.input.charCodeAt(F.position),!(F.lineIndent>0||Fe!==37));){be=!0,Fe=F.input.charCodeAt(++F.position);let Ue=F.position;for(;Fe!==0&&!T(Fe);)Fe=F.input.charCodeAt(++F.position);let me=F.input.slice(Ue,F.position),Z=[];for(me.length<1&&U(F,"directive name must not be less than one character in length");Fe!==0;){for(;b(Fe);)Fe=F.input.charCodeAt(++F.position);if(Fe===35){do Fe=F.input.charCodeAt(++F.position);while(Fe!==0&&!v(Fe));break}if(v(Fe))break;for(Ue=F.position;Fe!==0&&!T(Fe);)Fe=F.input.charCodeAt(++F.position);Z.push(F.input.slice(Ue,F.position))}Fe!==0&&ge(F),o.call(H,me)?H[me](F,me,Z):q(F,'unknown document directive "'+me+'"')}if(Oe(F,!0,-1),F.lineIndent===0&&F.input.charCodeAt(F.position)===45&&F.input.charCodeAt(F.position+1)===45&&F.input.charCodeAt(F.position+2)===45?(F.position+=3,Oe(F,!0,-1)):be&&U(F,"directives end mark is expected"),tt(F,F.lineIndent-1,u,!1,!0),Oe(F,!0,-1),F.checkLineBreaks&&g.test(F.input.slice(se,F.position))&&q(F,"non-ASCII line breaks are interpreted as content"),F.documents.push(F.result),F.position===F.lineStart&&we(F)){F.input.charCodeAt(F.position)===46&&(F.position+=3,Oe(F,!0,-1));return}F.position"u"&&(be=se,se=null);let Fe=_t(F,be);if(typeof se!="function")return Fe;for(let Ue=0,me=Fe.length;Ue=32&&Z<=126||Z>=161&&Z<=55295&&Z!==8232&&Z!==8233||Z>=57344&&Z<=65533&&Z!==s||Z>=65536&&Z<=1114111}a(le,"isPrintable");function Le(Z){return le(Z)&&Z!==s&&Z!==u&&Z!==l}a(Le,"isNsCharOrWhitespace");function ge(Z,ve,Ge){let Qe=Le(Z),je=Qe&&!te(Z);return(Ge?Qe:Qe&&Z!==_&&Z!==P&&Z!==D&&Z!==L&&Z!==j)&&Z!==m&&!(ve===b&&!je)||Le(ve)&&!te(ve)&&Z===m||ve===b&&je}a(ge,"isPlainSafe");function Oe(Z){return le(Z)&&Z!==s&&!te(Z)&&Z!==v&&Z!==R&&Z!==b&&Z!==_&&Z!==P&&Z!==D&&Z!==L&&Z!==j&&Z!==m&&Z!==A&&Z!==E&&Z!==f&&Z!==B&&Z!==T&&Z!==w&&Z!==y&&Z!==h&&Z!==g&&Z!==x&&Z!==N}a(Oe,"isPlainSafeFirst");function we(Z){return!te(Z)&&Z!==b}a(we,"isPlainSafeLast");function re(Z,ve){let Ge=Z.charCodeAt(ve),Qe;return Ge>=55296&&Ge<=56319&&ve+1=56320&&Qe<=57343)?(Ge-55296)*1024+Qe-56320+65536:Ge}a(re,"codePointAt");function ee(Z){return/^\n* /.test(Z)}a(ee,"needIndentIndicator");let K=1,he=2,X=3,de=4,qe=5;function ne(Z,ve,Ge,Qe,je,J,ae,Ce){let Re,$e=0,Ye=null,lt=!1,yt=!1,$t=Qe!==-1,St=-1,We=Oe(re(Z,0))&&we(re(Z,Z.length-1));if(ve||ae)for(Re=0;Re=65536?Re+=2:Re++){if($e=re(Z,Re),!le($e))return qe;We=We&&ge($e,Ye,Ce),Ye=$e}else{for(Re=0;Re=65536?Re+=2:Re++){if($e=re(Z,Re),$e===l)lt=!0,$t&&(yt=yt||Re-St-1>Qe&&Z[St+1]!==" ",St=Re);else if(!le($e))return qe;We=We&&ge($e,Ye,Ce),Ye=$e}yt=yt||$t&&Re-St-1>Qe&&Z[St+1]!==" "}return!lt&&!yt?We&&!ae&&!je(Z)?K:J===W?qe:he:Ge>9&&ee(Z)?qe:ae?J===W?qe:he:yt?de:X}a(ne,"chooseScalarStyle");function ue(Z,ve,Ge,Qe,je){Z.dump=(function(){if(ve.length===0)return Z.quotingType===W?'""':"''";if(!Z.noCompatMode&&(O.indexOf(ve)!==-1||U.test(ve)))return Z.quotingType===W?'"'+ve+'"':"'"+ve+"'";let J=Z.indent*Math.max(1,Ge),ae=Z.lineWidth===-1?-1:Math.max(Math.min(Z.lineWidth,40),Z.lineWidth-J),Ce=Qe||Z.flowLevel>-1&&Ge>=Z.flowLevel;function Re($e){return H(Z,$e)}switch(a(Re,"testAmbiguity"),ne(ve,Ce,Z.indent,ae,Re,Z.quotingType,Z.forceQuotes&&!Qe,je)){case K:return ve;case he:return"'"+ve.replace(/'/g,"''")+"'";case X:return"|"+Ne(ve,Z.indent)+Ie(z(ve,J));case de:return">"+Ne(ve,Z.indent)+Ie(z(Be(ve,ae),J));case qe:return'"'+st(ve)+'"';default:throw new e("impossible error: invalid scalar style")}})()}a(ue,"writeScalar");function Ne(Z,ve){let Ge=ee(Z)?String(ve):"",Qe=Z[Z.length-1]===` +`,J=Qe&&(Z[Z.length-2]===` +`||Z===` +`)?"+":Qe?"":"-";return Ge+J+` +`}a(Ne,"blockHeader");function Ie(Z){return Z[Z.length-1]===` +`?Z.slice(0,-1):Z}a(Ie,"dropEndingNewline");function Be(Z,ve){let Ge=/(\n+)([^\n]*)/g,Qe=(function(){let Ce=Z.indexOf(` +`);return Ce=Ce!==-1?Ce:Z.length,Ge.lastIndex=Ce,tt(Z.slice(0,Ce),ve)})(),je=Z[0]===` +`||Z[0]===" ",J,ae;for(;ae=Ge.exec(Z);){let Ce=ae[1],Re=ae[2];J=Re[0]===" ",Qe+=Ce+(!je&&!J&&Re!==""?` +`:"")+tt(Re,ve),je=J}return Qe}a(Be,"foldString");function tt(Z,ve){if(Z===""||Z[0]===" ")return Z;let Ge=/ [^ ]/g,Qe,je=0,J,ae=0,Ce=0,Re="";for(;Qe=Ge.exec(Z);)Ce=Qe.index,Ce-je>ve&&(J=ae>je?ae:Ce,Re+=` +`+Z.slice(je,J),je=J+1),ae=Ce;return Re+=` +`,Z.length-je>ve&&ae>je?Re+=Z.slice(je,ae)+` +`+Z.slice(ae+1):Re+=Z.slice(je),Re.slice(1)}a(tt,"foldLine");function st(Z){let ve="",Ge=0;for(let Qe=0;Qe=65536?Qe+=2:Qe++){Ge=re(Z,Qe);let je=M[Ge];!je&&le(Ge)?(ve+=Z[Qe],Ge>=65536&&(ve+=Z[Qe+1])):ve+=je||Q(Ge)}return ve}a(st,"escapeString");function _t(Z,ve,Ge){let Qe="",je=Z.tag;for(let J=0,ae=Ge.length;J"u"&&be(Z,ve,null,!1,!1))&&(Qe!==""&&(Qe+=","+(Z.condenseFlow?"":" ")),Qe+=Z.dump)}Z.tag=je,Z.dump="["+Qe+"]"}a(_t,"writeFlowSequence");function kt(Z,ve,Ge,Qe){let je="",J=Z.tag;for(let ae=0,Ce=Ge.length;ae"u"&&be(Z,ve+1,null,!0,!0,!1,!0))&&((!Qe||je!=="")&&(je+=ie(Z,ve)),Z.dump&&l===Z.dump.charCodeAt(0)?je+="-":je+="- ",je+=Z.dump)}Z.tag=J,Z.dump=je||"[]"}a(kt,"writeBlockSequence");function Ht(Z,ve,Ge){let Qe="",je=Z.tag,J=Object.keys(Ge);for(let ae=0,Ce=J.length;ae1024&&(Re+="? "),Re+=Z.dump+(Z.condenseFlow?'"':"")+":"+(Z.condenseFlow?"":" "),be(Z,ve,Ye,!1,!1)&&(Re+=Z.dump,Qe+=Re))}Z.tag=je,Z.dump="{"+Qe+"}"}a(Ht,"writeFlowMapping");function F(Z,ve,Ge,Qe){let je="",J=Z.tag,ae=Object.keys(Ge);if(Z.sortKeys===!0)ae.sort();else if(typeof Z.sortKeys=="function")ae.sort(Z.sortKeys);else if(Z.sortKeys)throw new e("sortKeys must be a boolean or a function");for(let Ce=0,Re=ae.length;Ce1024;yt&&(Z.dump&&l===Z.dump.charCodeAt(0)?$e+="?":$e+="? "),$e+=Z.dump,yt&&($e+=ie(Z,ve)),be(Z,ve+1,lt,!0,yt)&&(Z.dump&&l===Z.dump.charCodeAt(0)?$e+=":":$e+=": ",$e+=Z.dump,je+=$e)}Z.tag=J,Z.dump=je||"{}"}a(F,"writeBlockMapping");function se(Z,ve,Ge){let Qe=Ge?Z.explicitTypes:Z.implicitTypes;for(let je=0,J=Qe.length;je tag resolver accepts not "'+Ce+'" style');Z.dump=Re}return!0}}return!1}a(se,"detectType");function be(Z,ve,Ge,Qe,je,J,ae){Z.tag=null,Z.dump=Ge,se(Z,Ge,!1)||se(Z,Ge,!0);let Ce=n.call(Z.dump),Re=Qe;Qe&&(Qe=Z.flowLevel<0||Z.flowLevel>ve);let $e=Ce==="[object Object]"||Ce==="[object Array]",Ye,lt;if($e&&(Ye=Z.duplicates.indexOf(Ge),lt=Ye!==-1),(Z.tag!==null&&Z.tag!=="?"||lt||Z.indent!==2&&ve>0)&&(je=!1),lt&&Z.usedDuplicates[Ye])Z.dump="*ref_"+Ye;else{if($e&<&&!Z.usedDuplicates[Ye]&&(Z.usedDuplicates[Ye]=!0),Ce==="[object Object]")Qe&&Object.keys(Z.dump).length!==0?(F(Z,ve,Z.dump,je),lt&&(Z.dump="&ref_"+Ye+Z.dump)):(Ht(Z,ve,Z.dump),lt&&(Z.dump="&ref_"+Ye+" "+Z.dump));else if(Ce==="[object Array]")Qe&&Z.dump.length!==0?(Z.noArrayIndent&&!ae&&ve>0?kt(Z,ve-1,Z.dump,je):kt(Z,ve,Z.dump,je),lt&&(Z.dump="&ref_"+Ye+Z.dump)):(_t(Z,ve,Z.dump),lt&&(Z.dump="&ref_"+Ye+" "+Z.dump));else if(Ce==="[object String]")Z.tag!=="?"&&ue(Z,Z.dump,ve,J,Re);else{if(Ce==="[object Undefined]")return!1;if(Z.skipInvalid)return!1;throw new e("unacceptable kind of an object to dump "+Ce)}if(Z.tag!==null&&Z.tag!=="?"){let yt=encodeURI(Z.tag[0]==="!"?Z.tag.slice(1):Z.tag).replace(/!/g,"%21");Z.tag[0]==="!"?yt="!"+yt:yt.slice(0,18)==="tag:yaml.org,2002:"?yt="!!"+yt.slice(18):yt="!<"+yt+">",Z.dump=yt+" "+Z.dump}}return!0}a(be,"writeNode");function Fe(Z,ve){let Ge=[],Qe=[];Ue(Z,Ge,Qe);let je=Qe.length;for(let J=0;J0&&!t.tools.includes("*")&&(e.tools=t.tools),t.argument_hint&&(e["argument-hint"]=t.argument_hint),t.target&&(e.target=t.target),t.model&&(e.model=t.model);let r=[];t.user_invocable!==!1&&r.push("user"),t.disable_model_invocation!==!0&&r.push("model"),r.length<2&&(e["x-github-copilot-invoke-policy"]=r);let n=bK(e,{sortKeys:!1,lineWidth:-1,noRefs:!0,noCompatMode:!0,quotingType:'"',forceQuotes:!1}).trim(),o=t.prompt??"";return`--- ${n} --- ${o} -`}a(ggn,"generateAgentMarkdown");p();p();p();p();p();p();var BIe={isBlocked:!1,reason:"VALID_FILE"},Aze={isBlocked:!1,reason:"NO_MATCHING_POLICY"},Agn={isBlocked:!0,reason:"POLICY_ERROR",message:"Copilot is disabled because we could not fetch the repository policy"},pK={all:"all",repo:"repo"},jQ=new fe("contentExclusion");p();p();var yze=class{static{a(this,"PolicyEvaluator")}};p();p();p();var Y9t=new fe("repository"),hK=class t{constructor(){this.data={}}static{a(this,"GitConfigData")}getKeys(){return Object.keys(this.data)}getEntries(){return Object.entries(this.data)}get(e){let r=this.getAll(e);return r?r[r.length-1]:void 0}getAll(e){return this.data[this.normalizeKey(e)]}add(e,r){e in this.data||(this.data[e]=[]),this.data[e].push(r)}getSectionValues(e,r){let n=`${e}.`.toLowerCase(),o=`.${r}`.toLowerCase();return Object.keys(this.data).filter(s=>s.startsWith(n)&&s.endsWith(o)).map(s=>s.slice(n.length,-o.length))}concat(e){return this.getEntries().concat(e.getEntries()).reduce((r,[n,o])=>(o.forEach(s=>r.add(n,s)),r),new t)}normalizeKey(e){let r=e.split(".");return r[0]=r[0].toLowerCase(),r[r.length-1]=r[r.length-1].toLowerCase(),r.join(".")}},NP=class{static{a(this,"GitConfigLoader")}},Eze=class extends NP{constructor(r){super();this.loaders=r}static{a(this,"GitFallbackConfigLoader")}async getConfig(r,n){for(let o of this.loaders){let s=await o.getConfig(r,n);if(s)return s}}};p();var ygn=require("os");var _ze=class{constructor(e){this.url=e;this.isUrl()?this.parseUrl():this.tryParseSSHString()||(this._scheme="file")}static{a(this,"GitRemoteUrl")}get scheme(){return this._scheme}get authority(){return this._authority}get hostname(){return this._hostname}get path(){return this._path}isInvalid(){return this._error!==void 0}isRemote(){return this.scheme!=="file"&&this.hostname!==void 0}isGitHub(){return this.isRemote()&&/(?:^|\.)(?:github\.com|ghe\.com)$/i.test(this.hostname??"")}isADO(){return this.isRemote()&&/(?:^|\.)(?:visualstudio\.com|azure\.com)$/i.test(this.hostname??"")}getUrlForApi(){if(!this.isRemote())return null;if(this.isUrl()&&!this.isInvalid())return LU.from({scheme:this.scheme,authority:this.authority.replace(/^[^@]+@/,""),path:this.path}).toString();if(this.scheme=="ssh"&&this.isADO()){let e=this.url.indexOf(":");return this.url.substring(0,e+1)+this.path}return this.url}isUrl(){return/[A-Za-z0-9][A-Za-z0-9]+:\/\//.test(this.url)}parseUrl(){let e;try{e=LU.parse(this.url)}catch(r){this._error=r;return}this._scheme=e.scheme,this.setAuthority(e.authority),this.setPath(e.path)}setAuthority(e){this._authority=e;let r=e.replace(/^[^@]+@/,"").replace(/:\d*$/,"");r&&(this._hostname=r)}tryParseSSHString(){let e=/^(?[^:/\\[]*(?:\[[^/\\\]]*\])?):/.exec(this.url);if(e&&((0,ygn.platform)()!=="win32"||(e.groups?.host?.length??0)>1)){let r=e.groups?.host??"";return this._scheme="ssh",this.setAuthority(r),this.setPath(this.url.substring(r.length+1)),!0}return!1}setPath(e){if(this.isADO())try{this._path=decodeURIComponent(e);return}catch{}this._path=e}};var vze=class{static{a(this,"GitRemoteResolver")}async resolveRemote(e,r){let n=await e.get(NP).getConfig(e,r);if(!n)return;let o=this.getRemotes(n),s=o.filter(c=>c.url.isGitHub());if(s.length)return s.find(c=>c.name==="origin")?.url??s[0].url;if(o.length)return o.find(c=>c.name==="origin")?.url??o[0].url}getRemotes(e){let r=this.getInsteadOfRules(e);return e.getSectionValues("remote","url").map(n=>({name:n,url:new _ze(this.applyInsteadOfRules(r,e.get(`remote.${n}.url`)??""))})).filter(n=>n.url.isRemote())}applyInsteadOfRules(e,r){for(let n of e)if(r.startsWith(n.insteadOf))return n.base+r.slice(n.insteadOf.length);return r}getInsteadOfRules(e){return e.getSectionValues("url","insteadof").map(r=>({base:r,insteadOf:e.get(`url.${r}.insteadof`)})).sort((r,n)=>n.base.length-r.base.length)}};var e6o=100,K9t=class{constructor(e,r){this.baseFolder=e;this.remote=r;this.setNWO()}static{a(this,"GitRepository")}get tenant(){return this._tenant}get owner(){return this._owner}get name(){return this._name}get adoOrganization(){return this._adoOrganization}isGitHub(){return this.remote?.isGitHub()??!1}isADO(){return this.remote?.isADO()??!1}setNWO(){let e=this.remote?.path?.replace(/^\//,"").split("/");if(this.isGitHub()){this._owner=e?.[0],this._name=e?.[1]?.replace(/\.git$/,"");let r=/^(?[^.]+)\.ghe\.com$/.exec(this.remote?.hostname??"");r&&(this._tenant=r.groups?.tenant)}else if(this.isADO()&&e?.length===4){if(this.remote?.scheme==="ssh"){this._adoOrganization=e?.[1],this._owner=e?.[2],this._name=e?.[3];return}let r=/(?:(?[^.]+)\.)?visualstudio\.com$/.exec(this.remote?.hostname??"");r?(this._adoOrganization=r.groups?.org,this._owner=e?.[1],this._name=e?.[3]):(this._adoOrganization=e?.[0],this._owner=e?.[1],this._name=e?.[3])}}},_f=class t{constructor(e){this.ctx=e;this.remoteResolver=new vze;this.cache=new Cn(e6o)}static{a(this,"RepositoryManager")}async getRepo({uri:e}){let r,n=[];do{if(this.cache.has(e.toString())){let s=this.cache.get(e);return this.updateCache(n,s),s}n.push(e.toString());let o=await this.tryGetRepoForFolder(e);if(o)return this.updateCache(n,o),o;r=e,e=uf(e)}while(e!==r);this.updateCache(n,void 0)}updateCache(e,r){e.forEach(n=>this.cache.set(n,r))}async tryGetRepoForFolder(e){return await this.isBaseRepoFolder(e)?new K9t(typeof e=="string"?{uri:e}:e,await this.repoUrl(e)):void 0}async isBaseRepoFolder(e){return await t.getRepoConfigLocation(this.ctx,e)!==void 0}async repoUrl(e){return await this.remoteResolver.resolveRemote(this.ctx,e)}static async getRepoConfigLocation(e,r){try{let n=e.get(Qo),o=wa(r,".git");if((await n.stat(o)).type&1)return await this.getConfigLocationForGitfile(n,r,o);let c=wa(o,"config");return await n.stat(c),c}catch{return}}static async getConfigLocationForGitfile(e,r,n){let s=(await e.readFileString(n)).match(/^gitdir:\s+(.+)$/m);if(!s)return;let c=$W(r,s[1]),l=wa(c,"config");if(await this.tryStat(e,l)!==void 0)return l;let u=wa(c,"config.worktree");if(await this.tryStat(e,u)!==void 0)return u;let d=wa(c,"commondir");c=$W(c,(await e.readFileString(d)).trimEnd());let f=wa(c,"config");return await e.stat(f),f}static async tryStat(e,r){try{return await e.stat(r)}catch{return}}};p();var mK=a((t,e)=>{if(XM.Check(t,e))return e;let r=`Typebox schema validation failed: -${[...XM.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` -`)}`;throw new Error(r)},"assertShape");p();p();p();var Cze=new WeakMap;function bze(t,e){if(t==null||typeof t!="object")return String(t);let r,n="",o=0,s=Object.prototype.toString.call(t);if(s!=="[object RegExp]"&&s!=="[object Date]"&&Cze.has(t))return Cze.get(t);switch(Cze.set(t,"~"+ ++e),s){case"[object Set]":r=Array.from(t);case"[object Array]":for(r||(r=t),n+="a";oe.delete(n))),o}a(t6o,"n");function vgn(t,e){return function(r,n){return t6o(t,e,r,n)}}a(vgn,"o");p();p();p();var Z9t=a((t,e,r)=>{let n=t instanceof RegExp?Cgn(t,r):t,o=e instanceof RegExp?Cgn(e,r):e,s=n!==null&&o!=null&&r6o(n,o,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+n.length,s[1]),post:r.slice(s[1]+o.length)}},"balanced"),Cgn=a((t,e)=>{let r=e.match(t);return r?r[0]:null},"maybeMatch"),r6o=a((t,e,r)=>{let n,o,s,c,l,u=r.indexOf(t),d=r.indexOf(e,u+1),f=u;if(u>=0&&d>0){if(t===e)return[u,d];for(n=[],s=r.length;f>=0&&!l;){if(f===u)n.push(f),u=r.indexOf(t,f+1);else if(n.length===1){let h=n.pop();h!==void 0&&(l=[h,d])}else o=n.pop(),o!==void 0&&o=0?u:d}n.length&&c!==void 0&&(l=[s,c])}return l},"range");var bgn="\0SLASH"+Math.random()+"\0",Sgn="\0OPEN"+Math.random()+"\0",eUt="\0CLOSE"+Math.random()+"\0",Tgn="\0COMMA"+Math.random()+"\0",Ign="\0PERIOD"+Math.random()+"\0",n6o=new RegExp(bgn,"g"),i6o=new RegExp(Sgn,"g"),o6o=new RegExp(eUt,"g"),s6o=new RegExp(Tgn,"g"),a6o=new RegExp(Ign,"g"),c6o=/\\\\/g,l6o=/\\{/g,u6o=/\\}/g,d6o=/\\,/g,f6o=/\\\./g,p6o=1e5;function X9t(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}a(X9t,"numeric");function h6o(t){return t.replace(c6o,bgn).replace(l6o,Sgn).replace(u6o,eUt).replace(d6o,Tgn).replace(f6o,Ign)}a(h6o,"escapeBraces");function m6o(t){return t.replace(n6o,"\\").replace(i6o,"{").replace(o6o,"}").replace(s6o,",").replace(a6o,".")}a(m6o,"unescapeBraces");function xgn(t){if(!t)return[""];let e=[],r=Z9t("{","}",t);if(!r)return t.split(",");let{pre:n,body:o,post:s}=r,c=n.split(",");c[c.length-1]+="{"+o+"}";let l=xgn(s);return s.length&&(c[c.length-1]+=l.shift(),c.push.apply(c,l)),e.push.apply(e,c),e}a(xgn,"parseCommaParts");function wgn(t,e={}){if(!t)return[];let{max:r=p6o}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),FIe(h6o(t),r,!0).map(m6o)}a(wgn,"expand");function g6o(t){return"{"+t+"}"}a(g6o,"embrace");function A6o(t){return/^-?0\d/.test(t)}a(A6o,"isPadded");function y6o(t,e){return t<=e}a(y6o,"lte");function E6o(t,e){return t>=e}a(E6o,"gte");function FIe(t,e,r){let n=[],o=Z9t("{","}",t);if(!o)return[t];let s=o.pre,c=o.post.length?FIe(o.post,e,!1):[""];if(/\$$/.test(o.pre))for(let l=0;l=0;if(!d&&!f)return o.post.match(/,(?!,).*\}/)?(t=o.pre+"{"+o.body+eUt+o.post,FIe(t,e,!0)):[t];let h;if(d)h=o.body.split(/\.\./);else if(h=xgn(o.body),h.length===1&&h[0]!==void 0&&(h=FIe(h[0],e,!1).map(g6o),h.length===1))return c.map(g=>o.pre+h[0]+g);let m;if(d&&h[0]!==void 0&&h[1]!==void 0){let g=X9t(h[0]),A=X9t(h[1]),y=Math.max(h[0].length,h[1].length),E=h.length===3&&h[2]!==void 0?Math.max(Math.abs(X9t(h[2])),1):1,_=y6o;A0){let x=new Array(R+1).join("0");T<0?w="-"+x+w.slice(1):w=x+w}}m.push(w)}}else{m=[];for(let g=0;g{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");p();p();var _6o={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},QIe=a(t=>t.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),v6o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),Rgn=a(t=>t.join(""),"rangesToString"),kgn=a((t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],o=[],s=r+1,c=!1,l=!1,u=!1,d=!1,f=r,h="";e:for(;sh?n.push(QIe(h)+"-"+QIe(y)):y===h&&n.push(QIe(y)),h="",s++;continue}if(t.startsWith("-]",s+1)){n.push(QIe(y+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=y,s+=2;continue}n.push(QIe(y)),s++}if(fr?e?t.replace(/\[([^/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?t.replace(/\[([^/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var MC,C6o=new Set(["!","?","+","*","@"]),tUt=a(t=>C6o.has(t),"isExtglobType"),Pgn=a(t=>tUt(t.type),"isExtglobAST"),b6o=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),S6o=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),T6o=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Dgn=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),I6o="(?!(?:^|/)\\.\\.?(?:$|/))",Tze="(?!\\.)",x6o=new Set(["[","."]),w6o=new Set(["..","."]),R6o=new Set("().*{}+?[]^$\\!"),k6o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),rUt="[^/]",Ngn=rUt+"*?",Mgn=rUt+"+?",P6o=0,gK=class{static{a(this,"AST")}type;#e;#t;#r=!1;#n=[];#i;#o;#s;#a=!1;#c;#u;#l=!1;id=++P6o;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#n.length,parts:this.#n}}constructor(e,r,n={}){this.type=e,e&&(this.#t=!0),this.#i=r,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#s=this.#e===this?[]:this.#e.#s,e==="!"&&!this.#e.#a&&this.#s.push(this),this.#o=this.#i?this.#i.#n.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#n)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#n.map(e=>String(e)).join("|")+")":this.#u=this.#n.map(e=>String(e)).join("")}#p(){if(this!==this.#e)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let e;for(;e=this.#s.pop();){if(e.type!=="!")continue;let r=e,n=r.#i;for(;n;){for(let o=r.#o+1;!n.type&&otypeof r=="string"?r:r.toJSON()):[this.type,...this.#n.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#a&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#o===0)return!0;let e=this.#i;for(let r=0;rtypeof g!="string"),d=this.#n.map(g=>{let[A,y,E,_]=typeof g=="string"?MC.#k(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||E,this.#r=this.#r||_,A}).join(""),f="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&w6o.has(this.#n[0]))){let A=x6o,y=r&&A.has(d.charAt(0))||d.startsWith("\\.")&&A.has(d.charAt(2))||d.startsWith("\\.\\.")&&A.has(d.charAt(4)),E=!r&&!e&&A.has(d.charAt(0));f=y?I6o:E?Tze:""}let h="";return this.isEnd()&&this.#e.#a&&this.#i?.type==="!"&&(h="(?:$|\\/)"),[f+d+h,MP(d),this.#t=!!this.#t,this.#r]}let n=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#y(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString(),d=this;return d.#n=[u],d.type=null,d.#t=void 0,[u,MP(this.toString()),!1,!1]}let c=!n||e||r||!Tze?"":this.#y(!0);c===s&&(c=""),c&&(s=`(?:${s})(?:${c})*?`);let l="";if(this.type==="!"&&this.#l)l=(this.isStart()&&!r?Tze:"")+Mgn;else{let u=this.type==="!"?"))"+(this.isStart()&&!r&&!e?Tze:"")+Ngn+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&c?")":this.type==="*"&&c?")?":`)${this.type}`;l=o+s+u}return[l,MP(s),this.#t=!!this.#t,this.#r]}#S(){if(Pgn(this)){let e=0,r=!1;do{r=!0;for(let n=0;n{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,o,s,c]=r.toRegExpSource(e);return this.#r=this.#r||c,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#k(e,r,n=!1){let o=!1,s="",c=!1,l=!1;for(let u=0;ur?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var vf=a((t,e,r={})=>(UIe(e),!r.nocomment&&e.charAt(0)==="#"?!1:new Q_(e,r).match(t)),"minimatch"),D6o=/^\*+([^+@!?*[(]*)$/,N6o=a(t=>e=>!e.startsWith(".")&&e.endsWith(t),"starDotExtTest"),M6o=a(t=>e=>e.endsWith(t),"starDotExtTestDot"),O6o=a(t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),"starDotExtTestNocase"),L6o=a(t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),"starDotExtTestNocaseDot"),B6o=/^\*+\.\*+$/,F6o=a(t=>!t.startsWith(".")&&t.includes("."),"starDotStarTest"),U6o=a(t=>t!=="."&&t!==".."&&t.includes("."),"starDotStarTestDot"),Q6o=/^\.\*+$/,q6o=a(t=>t!=="."&&t!==".."&&t.startsWith("."),"dotStarTest"),j6o=/^\*+$/,H6o=a(t=>t.length!==0&&!t.startsWith("."),"starTest"),G6o=a(t=>t.length!==0&&t!=="."&&t!=="..","starTestDot"),$6o=/^\?+([^+@!?*[(]*)?$/,V6o=a(([t,e=""])=>{let r=Bgn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocase"),W6o=a(([t,e=""])=>{let r=Fgn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocaseDot"),z6o=a(([t,e=""])=>{let r=Fgn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTestDot"),Y6o=a(([t,e=""])=>{let r=Bgn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTest"),Bgn=a(([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},"qmarksTestNoExt"),Fgn=a(([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),Ugn=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ogn={win32:{sep:"\\"},posix:{sep:"/"}},K6o=Ugn==="win32"?Ogn.win32.sep:Ogn.posix.sep;vf.sep=K6o;var Jp=Symbol("globstar **");vf.GLOBSTAR=Jp;var J6o="[^/]",Z6o=J6o+"*?",X6o="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",e9o="(?:(?!(?:\\/|^)\\.).)*?",t9o=a((t,e={})=>r=>vf(r,t,e),"filter");vf.filter=t9o;var Wx=a((t,e={})=>Object.assign({},t,e),"ext"),r9o=a(t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return vf;let e=vf;return Object.assign(a((n,o,s={})=>e(n,o,Wx(t,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(o,s={}){super(o,Wx(t,s))}static defaults(o){return e.defaults(Wx(t,o)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(o,s,c={}){super(o,s,Wx(t,c))}static fromGlob(o,s={}){return e.AST.fromGlob(o,Wx(t,s))}},unescape:a((n,o={})=>e.unescape(n,Wx(t,o)),"unescape"),escape:a((n,o={})=>e.escape(n,Wx(t,o)),"escape"),filter:a((n,o={})=>e.filter(n,Wx(t,o)),"filter"),defaults:a(n=>e.defaults(Wx(t,n)),"defaults"),makeRe:a((n,o={})=>e.makeRe(n,Wx(t,o)),"makeRe"),braceExpand:a((n,o={})=>e.braceExpand(n,Wx(t,o)),"braceExpand"),match:a((n,o,s={})=>e.match(n,o,Wx(t,s)),"match"),sep:e.sep,GLOBSTAR:Jp})},"defaults");vf.defaults=r9o;var Qgn=a((t,e={})=>(UIe(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:wgn(t,{max:e.braceExpandMax})),"braceExpand");vf.braceExpand=Qgn;var n9o=a((t,e={})=>new Q_(t,e).makeRe(),"makeRe");vf.makeRe=n9o;var i9o=a((t,e,r={})=>{let n=new Q_(e,r);return t=t.filter(o=>n.match(o)),n.options.nonull&&!t.length&&t.push(e),t},"match");vf.match=i9o;var Lgn=/[?*]|[+@!]\(.*?\)|\[|\]/,o9o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Q_=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,r={}){UIe(e),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=e,this.platform=r.platform||Ugn,this.isWindows=this.platform==="win32";let n="allowWindowsEscape";this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r[n]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let o=this.globParts.map((s,c,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=s[0]===""&&s[1]===""&&(s[2]==="?"||!Lgn.test(s[2]))&&!Lgn.test(s[3]),d=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(d)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,o),this.set=o.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let o=n;for(;r[o+1]==="**";)o++;o!==n&&r.splice(n,o-n)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((n,o)=>{let s=n[n.length-1];return o==="**"&&s==="**"?n:o===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(o),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let o=1;oo&&n.splice(o+1,c-o);let l=n[o+1],u=n[o+2],d=n[o+3];if(l!==".."||!u||u==="."||u===".."||!d||d==="."||d==="..")continue;r=!0,n.splice(o,1);let f=n.slice(0);f[o]="**",e.push(f),o--}if(!this.preserveMultipleSlashes){for(let c=1;cr.length)}partsMatch(e,r,n=!1){let o=0,s=0,c=[],l="";for(;o=2&&(e=this.levelTwoFileOptimize(e)),r.includes(Jp)?this.#e(e,r,n,o,s):this.#r(e,r,n,o,s)}#e(e,r,n,o,s){let c=r.indexOf(Jp,s),l=r.lastIndexOf(Jp),[u,d,f]=n?[r.slice(s,c),r.slice(c+1),[]]:[r.slice(s,c),r.slice(c+1,l),r.slice(l+1)];if(u.length){let v=e.slice(o,o+u.length);if(!this.#r(v,u,n,0,0))return!1;o+=u.length,s+=u.length}let h=0;if(f.length){if(f.length+o>e.length)return!1;let v=e.length-f.length;if(this.#r(e,f,n,v,0))h=f.length;else{if(e[e.length-1]!==""||o+f.length===e.length||(v--,!this.#r(e,f,n,v,0)))return!1;h=f.length+1}}if(!d.length){let v=!!h;for(let b=o;b{let d=u.map(h=>{if(h instanceof RegExp)for(let m of h.flags.split(""))o.add(m);return typeof h=="string"?o9o(h):h===Jp?Jp:h._src});d.forEach((h,m)=>{let g=d[m+1],A=d[m-1];h!==Jp||A===Jp||(A===void 0?g!==void 0&&g!==Jp?d[m+1]="(?:\\/|"+n+"\\/)?"+g:d[m]=n:g===void 0?d[m-1]=A+"(?:\\/|\\/"+n+")?":g!==Jp&&(d[m-1]=A+"(?:\\/|\\/"+n+"\\/)"+g,d[m+1]=Jp))});let f=d.filter(h=>h!==Jp);if(this.partial&&f.length>=1){let h=[];for(let m=1;m<=f.length;m++)h.push(f.slice(0,m).join("/"));return"(?:"+h.join("|")+")"}return f.join("/")}).join("|"),[c,l]=e.length>1?["(?:",")"]:["",""];s="^"+c+s+l+"$",this.partial&&(s="^(?:\\/|"+c+s.slice(1,-1)+l+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let o=this.slashSplit(e);this.debug(this.pattern,"split",o);let s=this.set;this.debug(this.pattern,"set",s);let c=o[o.length-1];if(!c)for(let l=o.length-2;!c&&l>=0;l--)c=o[l];for(let l of s){let u=o;if(n.matchBase&&l.length===1&&(u=[c]),this.matchOne(u,l,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return vf.defaults(e).Minimatch}};vf.AST=gK;vf.Minimatch=Q_;vf.escape=Lle;vf.unescape=MP;var nUt="contentExclusion",Ize=class extends yze{static{a(this,"CopilotContentExclusion")}#e;#t=new Cn(1e4);#r=new Cn(200);constructor(e){super(),this.#e=e}async evaluate(e,r){try{e=$W(e).toString();let n=await this.getGitRepo({uri:e}),o=await this.#n(n?.url??pK.all);if(!o)return Aze;let s=n?.baseFolder?.uri??"file://",c=this.evaluateFilePathRules(e,s,o);if(c.isBlocked)return c;let l=this.evaluateTextBasedRules(e,o,r);if(l.isBlocked)return l}catch(n){return jQ.exception(this.#e,n,`${nUt}.evaluate`),Agn}return BIe}evaluateFilePathRules(e,r,n){let o=e;if(this.#t.has(o))return this.#t.get(o);let s=BIe,c,l=BDt(e.replace(r,""));e:for(let u of n)for(let d of u.paths)if(vf(l,d,{nocase:!0,matchBase:!0,nonegate:!0,dot:!0})){s=iUt(u,"FILE_BLOCKED_PATH"),c=d;break e}return jQ.debug(this.#e,`Evaluated path-based exclusion rules for <${e}>`,{result:s,baseUri:r,fileName:l,matchingPattern:c}),this.#t.set(o,s),s}evaluateTextBasedRules(e,r,n){let o=r.filter(l=>l.ifAnyMatch),s=r.filter(l=>l.ifNoneMatch);if(!n||o.length===0&&s.length===0)return BIe;let c=this.evaluateFileContent(o,s,n);return jQ.debug(this.#e,`Evaluated text-based exclusion rules for <${e}>`,{result:c}),c}evaluateFileContent(e,r,n){for(let o of e)if(o.ifAnyMatch&&o.ifAnyMatch.length>0&&o.ifAnyMatch.map(c=>qgn(c)).some(c=>c.test(n)))return iUt(o,"FILE_BLOCKED_TEXT_BASED");for(let o of r)if(o.ifNoneMatch&&o.ifNoneMatch.length>0&&!o.ifNoneMatch.map(c=>qgn(c)).some(c=>c.test(n)))return iUt(o,"FILE_BLOCKED_TEXT_BASED");return BIe}async refresh(){try{let e=[...this.#r.keys()];this.reset(),await Promise.all(e.map(r=>this.#o(r)))}catch(e){qa(this.#e,e,`${nUt}.refresh`)}}reset(){this.#r.clear(),this.#t.clear()}async#n(e){if(this.#i?.length)return this.#i;let r=await this.#o(e.toLowerCase());if(r.length!==0)return r}#i;setTestingRules(e){this.#i=e}#o=vgn(async e=>{let r=await this.#e.get(Qt).getGitHubSession();if(!r)throw new yi("No token found");let n=new URL("copilot_internal/content_exclusion",r.apiUrl),o=e.includes(pK.all);e.filter(u=>u!==pK.all).length>0&&n.searchParams.set("repos",e.filter(u=>u!==pK.all).join(",")),n.searchParams.set("scope",o?pK.all:pK.repo);let c=await Gf(this.#e,r,n.href),l=await c.json();if(!c.ok){if(c.status===404)return Array.from(e,()=>[]);throw this.#s("fetch.error",{message:l.message}),new aM(c)}return this.#s("fetch.success"),mK(l9o,l).map(u=>u.rules)},this.#r);async getGitRepo(e){let n=await this.#e.get(_f).getRepo(uf(e));if(!n||!n?.remote)return;let o=n.remote.getUrlForApi();if(o)return{baseFolder:n.baseFolder,url:o}}#s(e,r,n){Et(this.#e,`${nUt}.${e}`,Wt.createAndMarkAsIssued(r,n))}};function qgn(t){if(!t.startsWith("/")&&!t.endsWith("/"))return new RegExp(t);let e=t.slice(1,t.lastIndexOf("/")),r=t.slice(t.lastIndexOf("/")+1);return new RegExp(e,r)}a(qgn,"stringToRegex");function iUt(t,e){return{isBlocked:!0,message:`Your ${t.source.type.toLowerCase()} '${t.source.name}' has disabled Copilot for this file`,reason:e}}a(iUt,"fileBlockedEvaluationResult");var s9o=S.Object({name:S.String(),type:S.String()}),a9o=S.Object({paths:S.Array(S.String()),ifNoneMatch:S.Optional(S.Array(S.String())),ifAnyMatch:S.Optional(S.Array(S.String())),source:s9o}),oUt=S.Array(a9o),c9o=S.Object({rules:oUt,last_updated_at:S.String(),scope:S.String()}),l9o=S.Array(c9o);var nc=class{constructor(e){this.ctx=e;this.#e=!1;this.#t=new Ize(this.ctx);this.evaluateResultCache=new Map;this.onDidChangeActiveTextEditor=a(async e=>{if(!this.#e)return;if(!e.document){this.updateStatusIcon(!1);return}let r=await this.ctx.get($r).getTextDocumentValidation(e.document),n=r.status==="invalid",o=r.status==="invalid"?r.reason:void 0;this.updateStatusIcon(n,o)},"onDidChangeActiveTextEditor");let r=z0(this.ctx,this.onDidChangeActiveTextEditor,"Content exclusions focus change");this.ctx.get($r).onDidFocusTextDocument(r),bs(this.ctx,n=>{this.#e=n.envelope.copilotignore_enabled??!1,this.evaluateResultCache.clear(),this.#t.refresh()})}static{a(this,"CopilotContentExclusionManager")}#e;#t;get enabled(){return this.#e}async evaluate(e,r,n){if(!this.#e)return{isBlocked:!1};let o=[],s=a(async(u,d)=>{let f=performance.now(),h=await d.evaluate(e,r),m=performance.now();return o.push({key:u,result:h,elapsedMs:Math.round(m-f)}),h},"track"),l=(await Promise.all([s("contentExclusion.evaluate",this.#t)])).find(u=>u?.isBlocked)??{isBlocked:!1};try{for(let u of o)this.#r(u.key,e,u.result,u.elapsedMs)}catch(u){jQ.error(this.ctx,"Error tracking telemetry",u)}return n==="UPDATE"&&this.updateStatusIcon(l.isBlocked,l.message),l}updateStatusIcon(e,r){this.#e&&(e?this.ctx.get(ps).setClsInactive(r??"Copilot is disabled"):this.ctx.get(ps).clearClsInactive())}#r(e,r,n,o){let s=r+e;if(this.evaluateResultCache.get(s)===n.reason)return!1;if(this.evaluateResultCache.set(s,n.reason??"UNKNOWN"),n.reason===Aze.reason)return jQ.debug(this.ctx,`[${e}] No matching policy for this repository. uri: ${r}`),!1;let l={isBlocked:n.isBlocked?"true":"false",reason:n.reason??"UNKNOWN"},u={contentExclusionEvalMs:o};return Et(this.ctx,e,Wt.createAndMarkAsIssued(l,u)),Et(this.ctx,e,Wt.createAndMarkAsIssued({...l,path:r},u),1),jQ.debug(this.ctx,`[${e}] ${r}`,n),!0}setTestingRules(e){this.#t.setTestingRules(e)}set __contentExclusions(e){this.#t=e}get __contentExclusions(){return this.#t}};async function Ble(t,e,r){let n=await t.get(nc).evaluate(e.uri,r);return n.isBlocked?{status:"invalid",reason:n.message??"Document is blocked by repository policy"}:{status:"valid"}}a(Ble,"isDocumentValid");var $r=class{constructor(e,r=Ble){this.ctx=e;this.validateTextDocument=r}static{a(this,"TextDocumentManager")}async textDocuments(){let e=this.getTextDocumentsUnsafe(),r=[];for(let n of e)(await this.validateTextDocument(this.ctx,n,n.getText())).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=Fs(e.uri);return this.getTextDocumentsUnsafe().find(n=>n.uri===r)}async getTextDocument(e){return this.getTextDocumentWithValidation(e).then(r=>{if(r.status==="valid")return r.document})}async getTextDocumentValidation(e){try{let r=this.getTextDocumentUnsafe(e)?.getText()??await this.readTextDocumentFromDisk(e.uri);return r===void 0?this.notFoundResult(e):this.validateTextDocument(this.ctx,e,r)}catch{return this.notFoundResult(e)}}async getTextDocumentWithValidation(e){let r=this.getTextDocumentUnsafe(e);if(!r)return this.notFoundResult(e);let n=await this.validateTextDocument(this.ctx,e,r.getText());return n.status==="valid"?{status:"valid",document:r}:n}notFoundResult({uri:e}){return{status:"notfound",message:`Document for URI could not be found: ${e}`}}async readTextDocumentFromDisk(e){try{if((await this.ctx.get(Qo).stat(e)).size>5*1024*1024)return}catch{return}return await this.ctx.get(Qo).readFileString(e)}getWorkspaceFolder(e){let r=Fs(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith(Fs(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=Fs(e.uri);for(let n of this.getWorkspaceFolders()){let o=Fs(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return Ji(r)}};p();p();var ot=new fe("chat");p();var xze=class{constructor(e,r){this.ctx=e;this.workspaceFolder=r;this.emitter=new Wi;this.onFileChange=this.emitter.event;this.status="created",this.startWatching()}static{a(this,"WorkspaceWatcher")}emitFilesCreated(e){this.emitter.fire({type:"create",documents:e,workspaceFolder:this.workspaceFolder})}emitFilesUpdated(e){this.emitter.fire({type:"update",documents:e,workspaceFolder:this.workspaceFolder})}emitFilesDeleted(e){this.emitter.fire({type:"delete",documents:e,workspaceFolder:this.workspaceFolder})}};var zx=class{constructor(e){this.ctx=e;this.watchers=new Cn(25)}static{a(this,"WorkspaceWatcherProvider")}getWatcher(e){let r=this.watchers.get(e.uri);if(r)return r;let n=this.getParentFolder(e.uri);return n?this.watchers.get(n):void 0}getParentFolder(e){return[...this.watchers.keys()].find(n=>{let o=n.replace(/[#?].*/,"").replace(/\/?$/,"/");return e!==n&&e.startsWith(o)})}hasWatcher(e){return this.getParentFolder(e.uri)||this.getWatcher(e)!==void 0}startWatching(e){if(ot.debug(this.ctx,`WorkspaceWatcherProvider - Start watching workspace ${e.uri}`),this.hasWatcher(e)){this.getWatcher(e)?.startWatching();return}let r=this.createWatcher(e);this.watchers.set(e.uri,r)}stopWatching(e){this.getWatcher(e)?.stopWatching()}terminateSubfolderWatchers(e){let r=[];for(let s of this.watchers.values())r.push(s.workspaceFolder);let n=e.uri.replace(/[#?].*/,"").replace(/\/?$/,"/"),o=r.filter(s=>s.uri!==e.uri&&s.uri.startsWith(n));for(let s of o)this.terminateWatching(s);return o}terminateWatching(e){if(this.getWatcher(e)?.status!=="stopped")return this.stopWatching(e),this.watchers.delete(e.uri);this.watchers.delete(e.uri)}onFileChange(e,r,n,o){return this.getWatcher(e)?.onFileChange(z0(this.ctx,r,"WorkspaceWatcherProvider.onFileChange"),n,o)}async getWatchedFiles(e){return await this.getWatcher(e)?.getWatchedFiles()??[]}async getWatchedFileUris(e){return await this.getWatcher(e)?.getWatchedFileUris()??[]}getStatus(e){return this.getWatcher(e)?.status}};var HQ=class{static{a(this,"WorkspaceLifecycleListener")}start(){}didAddWorkspace(e){}didRemoveWorkspace(e){}didTerminateWorkspaceSubfolders(e,r){}didChangeFiles(e){}},u9o="workspaceLifecycleManager",sE=new fe(u9o),US=class t{constructor(e){this.ctx=e;this.activeListeners=[];this.watchedWorkspaces=[];this.ctx=e;let r=bs(e,async()=>{r.dispose(),await this.start()})}static{a(this,"WorkspaceLifecycleManager")}async start(){for(let e of this.activeListeners)await e.isEnabled()?e.isStarted()?sE.debug(this.ctx,`listener ${e.constructor.name} is already started`):(sE.debug(this.ctx,`starting listener ${e.constructor.name}`),await e.start()):sE.debug(this.ctx,`listener ${e.constructor.name} is not enabled`);sE.debug(this.ctx,"WorkspaceLifecycleManager started"),this.ctx.get($r).onDidChangeWorkspaceFolders(e=>{this.onWorkspacesAdded(e.added,this.ctx),this.onWorkspacesRemoved(e.removed,this.ctx)}),await this.onWorkspacesAdded(this.ctx.get($r).getWorkspaceFolders(),this.ctx)}static isSubfolder(e,r){let n=e.uri,o=r.uri.replace(/[#?].*/,"").replace(/\/?$/,"/");return n!==o&&n.startsWith(o)}async onWorkspacesAdded(e,r){if(!e.length){sE.debug(r,"No workspaces to add.");return}sE.debug(r,`Adding workspaces: ${e.map(l=>l.uri).join(", ")}`);let n=[...this.watchedWorkspaces,...e];sE.debug(r,`Combined workspaces: ${n.map(l=>l.uri).join(", ")}`);let o=n.filter((l,u,d)=>d.findIndex(f=>f.uri===l.uri)===u&&!d.some(f=>t.isSubfolder(l,f)));sE.debug(r,`Filtered workspaces: ${o.map(l=>l.uri).join(", ")}`);let s=o.filter(l=>!this.watchedWorkspaces.some(u=>u.uri===l.uri));sE.debug(r,`New workspaces: ${s.map(l=>l.uri).join(", ")}`);let c=this.watchedWorkspaces.filter(l=>!o.some(u=>u.uri===l.uri));sE.debug(r,`Removed workspaces: ${c.map(l=>l.uri).join(", ")}`),this.watchedWorkspaces=o;for(let l of c){sE.debug(r,`Terminating watching for removed workspace: ${l.uri}`),r.get(zx).terminateWatching(l);for(let d of this.activeListeners)sE.debug(r,`Notifying listener of removed workspace: ${l.uri}`),await d.didRemoveWorkspace(l)}for(let l of s){if(!l.uri)continue;sE.debug(r,`Starting to watch new workspace: ${l.uri}`);let u=r.get(zx);if(u.shouldStartWatching(l)){u.startWatching(l);let d=u.terminateSubfolderWatchers(l);if(d.length){sE.debug(r,`Terminated subfolder watchers for workspace: ${l.uri}, Subfolders: ${d.map(f=>f.uri).join(", ")}`);for(let f of this.activeListeners)await f.didTerminateWorkspaceSubfolders(l,d)}for(let f of this.activeListeners)sE.debug(r,`Adding file change listener for workspace: ${l.uri}`),u.onFileChange(l,f.didChangeFiles.bind(f))}}for(let l of this.activeListeners)for(let u of s)sE.debug(r,`Notifying ${l.constructor.name} of added workspace: ${u.uri}`),await l.didAddWorkspace(u)}async onWorkspacesRemoved(e,r){if(e.length)for(let n of e){if(!n.uri)continue;r.get(zx).terminateWatching(n),this.watchedWorkspaces=this.watchedWorkspaces.filter(s=>s.uri!==n.uri);for(let s of this.activeListeners)await s.didRemoveWorkspace(n)}}addListener(e){this.activeListeners.push(e)}removeListener(e){this.activeListeners=this.activeListeners.filter(r=>r!==e)}removeAllListeners(){this.activeListeners=[]}};function wze(t){t.set(US,new US(t))}a(wze,"setupWorkspaceLifecycleListener");var GQ=de(require("fs")),Yx=de(require("path"));var sUt=".agent.md",d9o=300*1e3,f9o="github",Hgn="agents";function qIe(t){return t.replace(/[^a-z0-9_-]/gi,"_").toLowerCase()}a(qIe,"sanitizeSegment");function p9o(t){return t.replace(/\\/g,"/")}a(p9o,"toPosix");var w3=class{constructor(e,r,n,o={}){this.ctx=e;this.registry=r;this.persistenceManager=n;this.logger=new fe("OrgCustomAgentService");this.fetchSequencer=new Vx;this.activated=!1;this.orgs=new Map;this.client=o.client??new gze(e),this.resolveNwo=o.resolveNwo??(s=>W9t(s,[e.get($m).getAuthAuthority()])),this.refreshIntervalMs=o.refreshIntervalMs??d9o,this.cacheRoot=Yx.join(this.persistenceManager.directory,f9o),this.lifecycleListener=new aUt(this)}static{a(this,"OrgCustomAgentService")}activate(){if(this.activated)return;this.activated=!0;let e=p9o(this.cacheRoot),n=`${e.endsWith("/")?e.slice(0,-1):e}/*/*/${Hgn}/*${sUt}`;this.registration=this.registry.register("agent",[n],{watchable:!0,cacheable:!0,metadata:Ggn.githubOrg}),this.tokenSubscription=bs(this.ctx,()=>{this.refreshAll()}),this.refreshIntervalMs>0&&(this.refreshTimer=setInterval(()=>{this.refreshAll()},this.refreshIntervalMs),this.refreshTimer.unref?.())}async dispose(){this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=void 0),this.tokenSubscription?.dispose(),this.tokenSubscription=void 0,this.registration?.dispose(),this.registration=void 0,this.activated=!1,await this.fetchSequencer.drain()}async refreshAll(){let e=Array.from(this.orgs.entries()).map(([r,n])=>this.fetchSequencer.queue(r,()=>this.fetchAndCacheOrg(r,n.probeNwo)));await Promise.all(e)}visibleOwnersForWorkspaces(e){let r=new Set(e.map(o=>Fs(o.uri))),n=new Set;for(let o of this.orgs.values())for(let s of r)if(o.workspaces.has(s)){n.add(qIe(o.probeNwo.owner));break}return n}isCachedAgentVisibleFor(e,r){let n=this.extractOwnerFromPath(e);return n===void 0?!0:this.visibleOwnersForWorkspaces(r).has(n)}extractOwnerFromPath(e){let r=Yx.relative(this.cacheRoot,e);if(r.startsWith("..")||Yx.isAbsolute(r))return;let n=r.indexOf(Yx.sep);if(!(n<=0))return r.slice(0,n)}_isActivated(){return this.activated}async _handleWorkspaceAdded(e){await this.onWorkspaceAdded(e)}async _handleWorkspaceRemoved(e){await this.onWorkspaceRemoved(e)}async onWorkspaceAdded(e){if(!e?.uri)return;let r;try{r=un(e.uri)}catch{return}let n=await this.resolveNwo(r);if(!n)return;let o=Fs(e.uri),s=this.orgs.get(n.owner);if(s){s.workspaces.add(o);return}this.orgs.set(n.owner,{workspaces:new Set([o]),probeNwo:n}),await this.fetchSequencer.queue(n.owner,()=>this.fetchAndCacheOrg(n.owner,n))}async onWorkspaceRemoved(e){if(!e?.uri)return;let r=Fs(e.uri),n=[];for(let[o,s]of this.orgs)s.workspaces.delete(r)&&s.workspaces.size===0&&n.push({org:o,probe:s.probeNwo});for(let{org:o,probe:s}of n)this.orgs.delete(o),await this.fetchSequencer.queue(o,()=>this.removeOrgCache(s))}async fetchAndCacheOrg(e,r){if(Ft(this.ctx,Ye.EnableOrgCustomAgents)===!1)return;let n=await this.client.listCustomAgents(r.owner,r.repo);if(n===void 0)return;let o=this.agentsDirFor(r);await GQ.promises.mkdir(o,{recursive:!0});let s=new Set;for(let c of n){let l=`${c.name}${sUt}`;s.add(l);let u=await this.fetchDetails(c);u&&await this.writeIfChanged(Yx.join(o,l),ggn(u))}await this.clearOrphans(o,s)}agentsDirFor(e){return Yx.join(this.cacheRoot,qIe(e.owner),qIe(e.repo),Hgn)}async fetchDetails(e){return this.client.getCustomAgentDetails(e.repo_owner,e.repo_name,e.name,e.version)}async writeIfChanged(e,r){let n=Buffer.from(r,"utf8");try{if((await GQ.promises.stat(e)).size===n.length&&(await GQ.promises.readFile(e)).equals(n))return}catch{}await GQ.promises.writeFile(e,n),this.logger.debug(this.ctx,`[OrgCustomAgentService] wrote ${e}`)}async clearOrphans(e,r){let n;try{n=await GQ.promises.readdir(e,{withFileTypes:!0})}catch{return}for(let o of n)if(o.isFile()&&o.name.endsWith(sUt)&&!r.has(o.name))try{await GQ.promises.unlink(Yx.join(e,o.name)),this.logger.debug(this.ctx,`[OrgCustomAgentService] removed orphan ${o.name}`)}catch(s){this.logger.warn(this.ctx,`[OrgCustomAgentService] orphan unlink failed: ${String(s)}`)}}async removeOrgCache(e){let r=Yx.join(this.cacheRoot,qIe(e.owner),qIe(e.repo));try{await GQ.promises.rm(r,{recursive:!0,force:!0}),this.logger.debug(this.ctx,`[OrgCustomAgentService] removed cache for ${e.owner}/${e.repo}`)}catch(n){this.logger.warn(this.ctx,`[OrgCustomAgentService] failed to remove cache for ${e.owner}/${e.repo}: ${String(n)}`)}}},aUt=class extends HQ{constructor(r){super();this.service=r}static{a(this,"OrgCustomAgentLifecycleListener")}isEnabled(){return Promise.resolve(!0)}isStarted(){return this.service._isActivated()}start(){this.service.activate()}async didAddWorkspace(r){await this.service._handleWorkspaceAdded(r)}async didRemoveWorkspace(r){await this.service._handleWorkspaceRemoved(r)}};p();var a0=class{static{a(this,"PromptChangeNotifier")}},Rze=class extends a0{static{a(this,"NullPromptChangeNotifier")}async notify(e){}};p();p();p();function $gn(t,e,r,n){let o=Array.isArray(t)?t:[t];return{affectedTypes:new Set(o),changes:[{reason:e,path:r}],workspaceFolderUri:n}}a($gn,"createPromptFilesChangedEvent");function Vgn(t,e,r){return{affectedTypes:new Set(t),changes:e,workspaceFolderUri:r}}a(Vgn,"createBatchPromptFilesChangedEvent");p();var ep=class{constructor(){this._listeners=[];this._disposed=!1}static{a(this,"EventEmitter")}get event(){return(e,r,n)=>{if(this._disposed)throw new Error("EventEmitter is disposed");let o={listener:e,thisArgs:r};this._listeners.push(o);let s={dispose:a(()=>{let c=this._listeners.indexOf(o);c>=0&&this._listeners.splice(c,1)},"dispose")};return n&&n.push(s),s}}fire(e){if(this._disposed)return;let r=this._listeners.slice();for(let{listener:n,thisArgs:o}of r)try{n.call(o,e)}catch(s){console.error("Error in event listener:",s)}}dispose(){this._listeners.length=0,this._disposed=!0}};function Fle(...t){return(e,r,n)=>{let o=[];for(let c of t)o.push(c(e,r));let s={dispose:a(()=>{for(let c of o)c.dispose()},"dispose")};return n&&n.push(s),s}}a(Fle,"anyEvent");var Kgn=require("os"),jIe=de(require("path"));function Ule(t){return t.replace(/\\/g,"/")}a(Ule,"toForwardSlash");function Wgn(...t){return jIe.default.posix.join(...t.map(Ule))}a(Wgn,"globJoin");function m9o(t){let e=Ule(t);return(e.startsWith("~/")?e.slice(2):e).split("/").some(n=>n==="..")}a(m9o,"containsTraversal");function zgn(t,e){let r=Ule(jIe.default.posix.normalize(Ule(t))),n=Ule(jIe.default.posix.normalize(Ule(e)));if(n===r)return!0;let o=r.endsWith("/")?r:`${r}/`;return n.startsWith(o)}a(zgn,"isContained");var Ygn=["*","?","{","["],wA=class{constructor(e,r){this.ctx=e;this.logger=new fe("PromptFileLocationRegistry");this._onLocationsChanged=new ep;this.onLocationsChanged=this._onLocationsChanged.event;this.patterns=new Map;this.suppressEvents=0;this.getHomedir=r?.homedir??Kgn.homedir}static{a(this,"PromptFileLocationRegistry")}register(e,r,n={}){let o=n.watchable??!0,s=n.cacheable??!0,c=n.metadata,l=this.patterns.get(e);l||(l=[],this.patterns.set(e,l));let u=[];for(let d of r){if(m9o(d)){this.logger.warn(this.ctx,`Skipping pattern "${d}" because it contains a ".." segment; traversal is not allowed.`);continue}if(!l.some(f=>f.pattern===d)){let f=Ygn.some(m=>d.includes(m)),h=n.classification??{storage:this.derivePatternStorage(d)};l.push({pattern:d,isGlob:f,watchable:o,cacheable:s,metadata:c,classification:h}),u.push(d)}}return u.length>0&&this.fireLocationsChanged(e),{dispose:a(()=>this.unregister(e,u),"dispose")}}replace(e,r,n,o={}){let s=this.patterns.get(r)?.length??0;this.suppressEvents++;try{e?.dispose()}finally{this.suppressEvents--}return n.length>0?this.register(r,n,o):((this.patterns.get(r)?.length??0){},"dispose")})}unregister(e,r){let n=this.patterns.get(e);if(!n)return;let o=new Set(r),s=n.length,c=n.filter(l=>!o.has(l.pattern));c.lengtho.watchable).map(o=>o.pattern):n.map(o=>o.pattern):[]}resolvePatterns(e,r,n){let o=this.patterns.get(e);if(!o)return[];let s=new Set,c=[],l=a((d,f,h)=>{s.has(d)||(s.add(d),c.push({pattern:d,isGlob:f,watchable:h.watchable,cacheable:h.cacheable,metadata:h.metadata,classification:h.classification}))},"addIfNew"),u=n?o.filter(d=>d.watchable):o;for(let d of u)if(d.pattern.startsWith("~/")){let f=this.getHomedir(),h=Wgn(f,d.pattern.slice(2));if(!zgn(f,h))continue;l(h,d.isGlob,d)}else if(this.isAbsolutePattern(d.pattern))l(d.pattern,d.isGlob,d);else for(let f of r){let h=Wgn(f,d.pattern);zgn(f,h)&&l(h,d.isGlob,d)}return c}clear(e){let r=this.patterns.get(e);r&&r.length>0&&(this.patterns.set(e,[]),this.fireLocationsChanged(e))}derivePatternStorage(e){return e.startsWith("~/")||this.isAbsolutePattern(e)?"user":"local"}isAbsolutePattern(e){let r=e.length;for(let o of Ygn){let s=e.indexOf(o);s>=0&&s0||this._onLocationsChanged.fire($gn(e,"ConfigChanged"))}};p();p();p();p();var cUt=de(require("path"));function Kx(t,e,r){let n=r?t:t.toLowerCase(),o=r?e:e.toLowerCase();if(n===o)return!0;let s=cUt.posix.relative(n,o);return s!==""&&!s.startsWith("..")&&!cUt.posix.isAbsolute(s)}a(Kx,"isEqualOrParent");var OC=process.platform==="linux";function $Q(t){return t.replace(/\\/g,"/")}a($Q,"normalizeSlashes");function lg(t){let e=$Q(t);return OC?e:e.toLowerCase()}a(lg,"canonicalKey");function Jgn(t){if(t.length<=1)return t.slice();let e=new Map,r=a(u=>OC?u:u.toLowerCase(),"toKey");for(let u of t){let d=r(u.path),f=e.get(d);if(!f){e.set(d,{path:u.path,type:u.type});continue}let h=f.type,m=u.type;h==="create"&&m==="delete"?e.delete(d):h==="delete"&&m==="create"?e.set(d,{path:u.path,type:"update"}):h==="create"&&m==="update"||e.set(d,{path:u.path,type:m})}let n=[...e.values()],o=n.filter(u=>u.type==="delete").sort((u,d)=>u.path.length-d.path.length),s=[],c=[];for(let u of o){let d=r(u.path);c.some(h=>d!==h&&Kx(h,d,OC))||(s.push(u),c.push(d))}let l=n.filter(u=>u.type!=="delete");return[...s,...l]}a(Jgn,"coalesceEvents");var kze=class{constructor(e,r,n){this._parcel=r;this._nodejs=n;this._disposed=!1;this.onDidChange=Fle(this._parcel.onDidChange,this._nodejs.onDidChange),this.onDidError=Fle(this._parcel.onDidError,this._nodejs.onDidError)}static{a(this,"UniversalWatcher")}watch(e){if(this._disposed)throw new Error("UniversalWatcher: cannot watch after dispose");return e.recursive?this._parcel.watch(e):this._nodejs.watch(e)}async dispose(){this._disposed||(this._disposed=!0,await Promise.all([this._parcel.dispose(),this._nodejs.dispose()]))}};var k3=de(require("fs"));var AK=new fe("NodeJSWatcherService"),g9o=1e3,Pze=class{constructor(e,r,n,o){this.ctx=e;this.recursive=r;this._onDidChange=new ep;this.onDidChange=this._onDidChange.event;this._onDidError=new ep;this.onDidError=this._onDidError.event;this._entries=new Map;this._disposed=!1;this._fsWatch=n??k3.watch,this._fsWatchFile=o??{watchFile:k3.watchFile,unwatchFile:k3.unwatchFile}}static{a(this,"NodeJSWatcherService")}watch(e){if(this._disposed)throw new Error("NodeJSWatcherService: cannot watch after dispose");if(e.recursive)throw new Error("NodeJSWatcherService: only supports non-recursive watches");let r=$Q(e.path),n=lg(r),o=this._entries.get(n);if(o)return o.refCount++,this._entryDisposable(n);let s=this.recursive?.subscribeToPath(r,u=>{this._onDidChange.fire([u])});if(s)return this._entries.set(n,{path:r,refCount:1,disposable:s}),this._entryDisposable(n);let l=this._isRegularFile(r)?this._startWatchFile(r):this._startFsWatch(r);return this._entries.set(n,{path:r,refCount:1,disposable:l}),this._entryDisposable(n)}dispose(){if(this._disposed)return Promise.resolve();this._disposed=!0;let e=[...this._entries.values()];this._entries.clear();for(let r of e)try{r.disposable.dispose()}catch(n){AK.debug(this.ctx,"fs watcher dispose threw",r.path,n)}return this._onDidChange.dispose(),this._onDidError.dispose(),Promise.resolve()}_entryDisposable(e){let r=!1;return{dispose:a(()=>{if(r)return;r=!0;let n=this._entries.get(e);if(n&&(n.refCount--,n.refCount<=0)){this._entries.delete(e);try{n.disposable.dispose()}catch(o){AK.debug(this.ctx,"fs watcher dispose threw",n.path,o)}}},"dispose")}}_isRegularFile(e){try{return k3.statSync(e).isFile()}catch{return!1}}_startFsWatch(e){let r;try{r=this._fsWatch(e,{recursive:!1},(n,o)=>{if(this._disposed)return;let s=o?E9o(e,$Q(o)):e,c=A9o(n,s);this._onDidChange.fire([{path:s,type:c}])}),r.on("error",n=>{this._disposed||(this._onDidError.fire({path:e,error:n}),AK.debug(this.ctx,"fs.watch error for",e,n))})}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),AK.debug(this.ctx,"fs.watch threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{r?.close()}catch(n){AK.debug(this.ctx,"fs.watch close threw for",e,n)}},"dispose")}}_startWatchFile(e){let r=a((n,o)=>{if(this._disposed)return;let s=y9o(n,o);s&&this._onDidChange.fire([{path:e,type:s}])},"listener");try{this._fsWatchFile.watchFile(e,{interval:g9o},r)}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),AK.debug(this.ctx,"fs.watchFile threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{this._fsWatchFile.unwatchFile(e,r)}catch(n){AK.debug(this.ctx,"fs.unwatchFile threw for",e,n)}},"dispose")}}};function A9o(t,e){if(t==="change")return"update";try{return k3.statSync(e),"create"}catch{return"delete"}}a(A9o,"classify");function y9o(t,e){if(t.mtimeMs===0&&e.mtimeMs!==0)return"delete";if(t.mtimeMs!==0&&e.mtimeMs===0)return"create";if(t.mtimeMs!==e.mtimeMs)return"update"}a(y9o,"classifyStat");function E9o(t,e){return t.endsWith("/")?t+e:`${t}/${e}`}a(E9o,"joinPosix");p();var PAn=de(kAn()),DAn=require("os"),NAn=de(require("path"));var Oze=new fe("ParcelWatcherService"),lUo=process.platform==="win32"?"windows":process.platform==="linux"?"inotify":"fs-events",uUo=process.platform==="darwin"?[NAn.join((0,DAn.homedir)(),"Library","Containers")]:[],Lze=class{constructor(e,r){this.ctx=e;this._onDidChange=new ep;this.onDidChange=this._onDidChange.event;this._onDidError=new ep;this.onDidError=this._onDidError.event;this._roots=new Map;this._pendingShutdowns=new Set;this._disposed=!1;this._enospcNotified=!1;this._warnedPaths=new Set;this._subscribe=r??PAn.subscribe}static{a(this,"ParcelWatcherService")}watch(e){if(this._disposed)throw new Error("ParcelWatcherService: cannot watch after dispose");if(!e.recursive)throw new Error("ParcelWatcherService: only supports recursive watches");let r=$Q(e.path),n=lg(r),o=this._findCoveringRoot(r);if(o){let l={root:o};return o.handles.add(l),{dispose:a(()=>this._releaseHandle(l),"dispose")}}let s={path:r,handles:new Set,pathSubscribers:new Map};this._roots.set(n,s),this._startSubscription(s),this._foldChildrenIntoAfterSubscribed(s);let c={root:s};return s.handles.add(c),{dispose:a(()=>this._releaseHandle(c),"dispose")}}subscribeToPath(e,r){if(this._disposed)return;let n=$Q(e),o=this._findCoveringRoot(n);if(!o)return;let s=lg(n),c=o.pathSubscribers.get(s);return c||(c=new Set,o.pathSubscribers.set(s,c)),c.add(r),{dispose:a(()=>{let l=o.pathSubscribers.get(s);l&&(l.delete(r),l.size===0&&o.pathSubscribers.delete(s),this._maybeTearDown(o))},"dispose")}}async dispose(){if(this._disposed)return;this._disposed=!0;let e=[...this._roots.values()];for(this._roots.clear(),await Promise.all(e.map(async r=>{r.handles.clear(),r.pathSubscribers.clear(),await this._shutdownEntry(r)}));this._pendingShutdowns.size>0;){let r=[...this._pendingShutdowns];await Promise.allSettled(r)}this._onDidChange.dispose(),this._onDidError.dispose()}_findCoveringRoot(e){for(let r of this._roots.values())if(Kx(r.path,e,OC))return r}async _foldChildrenIntoAfterSubscribed(e){let r=[];for(let[n,o]of[...this._roots])if(o!==e&&Kx(e.path,o.path,OC)){for(let s of o.handles)s.root=e,e.handles.add(s);o.handles.clear();for(let[s,c]of o.pathSubscribers){let l=e.pathSubscribers.get(s);l||(l=new Set,e.pathSubscribers.set(s,l));for(let u of c)l.add(u)}o.pathSubscribers.clear(),this._roots.delete(n),r.push(o)}if(r.length!==0){try{await e.subscribing}catch{}for(let n of r)this._trackShutdown(n,"Shutdown of folded child failed for")}}_releaseHandle(e){let r=e.root;r.handles.delete(e),this._maybeTearDown(r)}_maybeTearDown(e){if(e.handles.size>0||e.pathSubscribers.size>0)return;let r=lg(e.path);this._roots.get(r)===e&&(this._roots.delete(r),this._trackShutdown(e,"Unsubscribe failed for"))}_trackShutdown(e,r){let n=this._shutdownEntry(e).catch(o=>{Oze.debug(this.ctx,r,e.path,o)});this._pendingShutdowns.add(n),n.finally(()=>this._pendingShutdowns.delete(n))}_startSubscription(e){let r=this._subscribe(e.path,(n,o)=>{if(!this._disposed){if(n){this._onWatchError(n,e.path);return}this._handleParcelEvents(e,o)}},{backend:lUo,ignore:uUo}).then(async n=>{if(e.subscribing=void 0,this._disposed||!this._rootStillActive(e)){await n.unsubscribe();return}return e.subscription=n,n}).catch(n=>{e.subscribing=void 0,this._onWatchError(n instanceof Error?n:new Error(String(n)),e.path)});e.subscribing=r}_rootStillActive(e){let r=lg(e.path);return this._roots.get(r)===e}async _shutdownEntry(e){let r=e.subscription;e.subscription=void 0;let n=e.subscribing;if(e.subscribing=void 0,r)await r.unsubscribe();else if(n){let o=await n;o&&await o.unsubscribe()}}_handleParcelEvents(e,r){if(r.length===0)return;let n=[];for(let s of r){let c=$Q(s.path);n.push({path:c,type:s.type})}let o=Jgn(n);if(o.length!==0&&(this._onDidChange.fire(o),e.pathSubscribers.size!==0))for(let s of o){let c=lg(s.path),l=e.pathSubscribers.get(c);if(l)for(let u of l)try{u(s)}catch(d){Oze.debug(this.ctx,"Path subscriber threw",s.path,d)}}}_onWatchError(e,r){if(this._disposed)return;let n=e.toString();if(Oze.debug(this.ctx,"Watcher error for",r,e),this._onDidError.fire({path:r,error:e}),n.includes("ENOSPC")&&!this._enospcNotified){this._enospcNotified=!0,this.ctx.get(ts).showWarningMessageOnlyOnce("parcelWatcher.enospc","Unable to watch for file changes in AI customization files. The inotify watch limit may have been reached. Please increase the limit by following the instructions at http://aka.ms/ghc-jetbrains-wiki/FAQ#resolving-the-enospc-file-watcher-error-on-linux");return}this._warnedPaths.has(r)||(this._warnedPaths.add(r),Oze.warn(this.ctx,"Failed to watch for file changes at",r,e))}};function Bze(t){let e=new Lze(t),r=new Pze(t,e);return new kze(t,e,r)}a(Bze,"createUniversalWatcher");var MAn=de(require("fs"));var VQ=de(require("path"));var dUo=100,Fze=/[*?{[]/,EUt=class{constructor(e,r,n,o,s){this.request=e;this.watcher=r;this.registerDeferred=n;this.unregisterDeferred=o;this.statSync=s;this._disposed=!1;this._innerSubs=[];this.registerDeferred(this),this._tryActivate()}static{a(this,"DeferredWatchSubscription")}isPending(){return!this._disposed&&this._ancestorPath!==void 0}targetPath(){return this.request.path}handleEvent(e){if(!this._disposed){if(this._ancestorPath!==void 0){if(e.type!=="create"||!Kx(e.path,this.request.path,OC)&&!Kx(this.request.path,e.path,OC))return;this._tryActivate();return}e.type==="delete"&&Kx(e.path,this.request.path,OC)&&this._tryActivate()}}dispose(){this._disposed||(this._disposed=!0,this.unregisterDeferred(this),this._ancestorPath=void 0,this._disposeInnerSubs())}_tryActivate(){if(this._disposed)return;let e=this._isDirectory(this.request.path);if(e||this._exists(this.request.path)){let c=[];if(c.push(this.watcher.watch(this.request)),e){let u=VQ.dirname(this.request.path);u!==this.request.path&&this._isDirectory(u)&&c.push(this.watcher.watch({path:u,recursive:!1}))}let l=this._innerSubs;this._innerSubs=c,this._ancestorPath=void 0;for(let u of l)u.dispose();return}let n=fUo(this.request.path,this.statSync);if(n===void 0||pUo(n,this.request.path)){this._ancestorPath="",this._disposeInnerSubs();return}if(this._ancestorPath===n&&this._innerSubs.length>0)return;let o=this.watcher.watch({path:n,recursive:!1}),s=this._innerSubs;this._innerSubs=[o],this._ancestorPath=n;for(let c of s)c.dispose()}_exists(e){try{return this.statSync(e),!0}catch{return!1}}_isDirectory(e){try{return this.statSync(e).isDirectory()}catch{return!1}}_disposeInnerSubs(){let e=this._innerSubs;this._innerSubs=[];for(let r of e)r.dispose()}};function fUo(t,e){let r=VQ.dirname(t),n;for(;r!==n;){try{if(e(r).isDirectory())return r}catch{}n=r,r=VQ.dirname(r)}}a(fUo,"findExistingAncestor");function pUo(t,e){return VQ.dirname(e)===t?!1:t===VQ.parse(t).root}a(pUo,"isAncestorTooBroad");var Uze=class{constructor(e,r,n=MAn.statSync){this._onPromptFileChanged=new ep;this.onPromptFileChanged=this._onPromptFileChanged.event;this._patterns=new Map;this._pendingChanges=[];this._pendingTypes=new Set;this._pendingKeys=new Set;this._disposed=!1;this._deferredSubs=new Set;this._watcher=r??Bze(e),this._ownsWatcher=r===void 0,this._statSync=n,this._subscriptionDisposable=this._watcher.onDidChange(o=>this._handleEvents(o))}static{a(this,"PromptFileWatcher")}watch(e,r,n){if(this._disposed)throw new Error("PromptFileWatcher: cannot watch after dispose");let o=Array.isArray(r)?r:[r],s=[],c=new Map,l=new Map;for(let d of o){let f=d.replace(/\\/g,"/");s.push(f),c.set(f,(c.get(f)??0)+1),!this._patterns.has(f)&&!l.has(f)&&l.set(f,this._toWatchRequest(f))}for(let[d,f]of c){let h=this._patterns.get(d);if(!h){let m=l.get(d),g=this._createDeferredSubscription(m),A=Fze.test(d)?m.path:void 0;h={refCountByType:new Map,matcher:new Q_(d,{dot:!0}),subscription:g,baseDir:A},this._patterns.set(d,h)}h.refCountByType.set(e,(h.refCountByType.get(e)??0)+f)}n&&n.dispose();let u=!1;return{dispose:a(()=>{if(!u){u=!0;for(let d of s)this._decrementRefCount(d,e)}},"dispose")}}flush(){if(this._disposed||(this._debounceTimer!==void 0&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0),this._pendingChanges.length===0))return;let e=Vgn([...this._pendingTypes],this._pendingChanges);this._pendingChanges=[],this._pendingTypes=new Set,this._pendingKeys=new Set,this._onPromptFileChanged.fire(e)}async dispose(){if(!this._disposed){this._disposed=!0,this._debounceTimer!==void 0&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0);for(let e of this._patterns.values())e.subscription.dispose();this._patterns.clear(),this._subscriptionDisposable.dispose(),this._ownsWatcher&&await this._watcher.dispose(),this._onPromptFileChanged.dispose()}}_createDeferredSubscription(e){return new EUt(e,this._watcher,r=>this._deferredSubs.add(r),r=>this._deferredSubs.delete(r),this._statSync)}_toWatchRequest(e){if(!Fze.test(e))return{path:e,recursive:!1,includes:[e]};let r=this._extractBaseDir(e),n=e.includes("**")||this._globSpansMultipleSegments(e);return{path:r,recursive:n,includes:[e]}}_globSpansMultipleSegments(e){let r=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));if(r<0)return!1;let n=e.slice(0,r);return Fze.test(n)}_extractBaseDir(e){let r=Fze.exec(e);if(!r)return VQ.dirname(e);let n=e.slice(0,r.index),o=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\"));if(o<0)throw new Error(`PromptFileWatcher: pattern "${e}" has no base directory; expected an absolute path.`);let s=o>0?n.slice(0,o):n;if(/^[A-Za-z]:$/.test(s)&&n.length>s.length){let c=n[s.length];if(c==="/"||c==="\\")return`${s}${c}`}return s}_handleEvents(e){if(!this._disposed){if(this._deferredSubs.size>0)for(let r of e)for(let n of[...this._deferredSubs])n.handleEvent(r);for(let r of e){let n=this._mapEventType(r.type),o=!1;for(let c of this._patterns.values()){if(c.matcher.match(r.path)){for(let f of c.refCountByType.keys())this._pendingTypes.add(f);o=!0;continue}if(r.type!=="delete"||c.baseDir===void 0)continue;let l=c.baseDir,u=Kx(r.path,l,OC),d=Kx(l,r.path,OC);if(!(!u&&!d)){for(let f of c.refCountByType.keys())this._pendingTypes.add(f);o=!0}}if(!o)continue;let s=`${n}\0${r.path}`;this._pendingKeys.has(s)||(this._pendingKeys.add(s),this._pendingChanges.push({reason:n,path:r.path}))}this._pendingChanges.length>0&&this._scheduleFlush()}}_mapEventType(e){switch(e){case"create":return"FileCreated";case"update":return"FileChanged";case"delete":return"FileDeleted"}}_scheduleFlush(){this._debounceTimer!==void 0&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this._debounceTimer=void 0,this.flush()},dUo)}_decrementRefCount(e,r){let n=this._patterns.get(e);if(!n)return;let o=n.refCountByType.get(r);o!==void 0&&(o<=1?n.refCountByType.delete(r):n.refCountByType.set(r,o-1),n.refCountByType.size===0&&(this._patterns.delete(e),n.subscription.dispose()))}};p();p();function Jx(t,e,...r){return e.replace(/\{(\d+)\}/g,(n,o)=>{let s=r[Number(o)];return s!==void 0?String(s):n})}a(Jx,"localize");function hUo(t,e=[],r={}){let o=new _Ut(t).scan();return new vUt(o,t,e,r).parse()}a(hUo,"parseRaw");function Xp(t,e,r,n){return{type:t,startOffset:e,endOffset:r,rawValue:n?.rawValue??"",value:n?.value??"",format:n?.format??"none",indent:n?.indent??0}}a(Xp,"makeToken");var _Ut=class{constructor(e){this.input=e;this.pos=0;this.tokens=[];this.flowDepth=0;this.seenBlockColon=!1;this.seenDocumentStart=0}static{a(this,"YamlScanner")}scan(e=1){for(;this.pose)););return this.tokens.push(Xp(13,this.pos,this.pos)),this.tokens}scanLine(){if(this.seenBlockColon=!1,this.peekChar()===` -`){this.tokens.push(Xp(8,this.pos,this.pos+1)),this.pos++;return}if(this.peekChar()==="\r"){let n=this.pos+(this.input[this.pos+1]===` -`?2:1);this.tokens.push(Xp(8,this.pos,n)),this.pos=n;return}let e=this.pos,r=0;for(;this.pos0&&this.tokens.push(Xp(9,e,this.pos,{indent:r})),this.pos>=this.input.length||this.peekChar()===` +`}a($An,"generateAgentMarkdown");p();p();p();p();p();p();var nxe={isBlocked:!1,reason:"VALID_FILE"},Gze={isBlocked:!1,reason:"NO_MATCHING_POLICY"},VAn={isBlocked:!0,reason:"POLICY_ERROR",message:"Copilot is disabled because we could not fetch the repository policy"},SK={all:"all",repo:"repo"},eq=new pe("contentExclusion");p();p();var $ze=class{static{a(this,"PolicyEvaluator")}};p();p();p();var qUt=new pe("repository"),TK=class t{constructor(){this.data={}}static{a(this,"GitConfigData")}getKeys(){return Object.keys(this.data)}getEntries(){return Object.entries(this.data)}get(e){let r=this.getAll(e);return r?r[r.length-1]:void 0}getAll(e){return this.data[this.normalizeKey(e)]}add(e,r){e in this.data||(this.data[e]=[]),this.data[e].push(r)}getSectionValues(e,r){let n=`${e}.`.toLowerCase(),o=`.${r}`.toLowerCase();return Object.keys(this.data).filter(s=>s.startsWith(n)&&s.endsWith(o)).map(s=>s.slice(n.length,-o.length))}concat(e){return this.getEntries().concat(e.getEntries()).reduce((r,[n,o])=>(o.forEach(s=>r.add(n,s)),r),new t)}normalizeKey(e){let r=e.split(".");return r[0]=r[0].toLowerCase(),r[r.length-1]=r[r.length-1].toLowerCase(),r.join(".")}},jP=class{static{a(this,"GitConfigLoader")}},Vze=class extends jP{constructor(r){super();this.loaders=r}static{a(this,"GitFallbackConfigLoader")}async getConfig(r,n){for(let o of this.loaders){let s=await o.getConfig(r,n);if(s)return s}}};p();var WAn=require("os");var Wze=class{constructor(e){this.url=e;this.isUrl()?this.parseUrl():this.tryParseSSHString()||(this._scheme="file")}static{a(this,"GitRemoteUrl")}get scheme(){return this._scheme}get authority(){return this._authority}get hostname(){return this._hostname}get path(){return this._path}isInvalid(){return this._error!==void 0}isRemote(){return this.scheme!=="file"&&this.hostname!==void 0}isGitHub(){return this.isRemote()&&/(?:^|\.)(?:github\.com|ghe\.com)$/i.test(this.hostname??"")}isADO(){return this.isRemote()&&/(?:^|\.)(?:visualstudio\.com|azure\.com)$/i.test(this.hostname??"")}getUrlForApi(){if(!this.isRemote())return null;if(this.isUrl()&&!this.isInvalid())return WU.from({scheme:this.scheme,authority:this.authority.replace(/^[^@]+@/,""),path:this.path}).toString();if(this.scheme=="ssh"&&this.isADO()){let e=this.url.indexOf(":");return this.url.substring(0,e+1)+this.path}return this.url}isUrl(){return/[A-Za-z0-9][A-Za-z0-9]+:\/\//.test(this.url)}parseUrl(){let e;try{e=WU.parse(this.url)}catch(r){this._error=r;return}this._scheme=e.scheme,this.setAuthority(e.authority),this.setPath(e.path)}setAuthority(e){this._authority=e;let r=e.replace(/^[^@]+@/,"").replace(/:\d*$/,"");r&&(this._hostname=r)}tryParseSSHString(){let e=/^(?[^:/\\[]*(?:\[[^/\\\]]*\])?):/.exec(this.url);if(e&&((0,WAn.platform)()!=="win32"||(e.groups?.host?.length??0)>1)){let r=e.groups?.host??"";return this._scheme="ssh",this.setAuthority(r),this.setPath(this.url.substring(r.length+1)),!0}return!1}setPath(e){if(this.isADO())try{this._path=decodeURIComponent(e);return}catch{}this._path=e}};var zze=class{static{a(this,"GitRemoteResolver")}async resolveRemote(e,r){let n=await e.get(jP).getConfig(e,r);if(!n)return;let o=this.getRemotes(n),s=o.filter(c=>c.url.isGitHub());if(s.length)return s.find(c=>c.name==="origin")?.url??s[0].url;if(o.length)return o.find(c=>c.name==="origin")?.url??o[0].url}getRemotes(e){let r=this.getInsteadOfRules(e);return e.getSectionValues("remote","url").map(n=>({name:n,url:new Wze(this.applyInsteadOfRules(r,e.get(`remote.${n}.url`)??""))})).filter(n=>n.url.isRemote())}applyInsteadOfRules(e,r){for(let n of e)if(r.startsWith(n.insteadOf))return n.base+r.slice(n.insteadOf.length);return r}getInsteadOfRules(e){return e.getSectionValues("url","insteadof").map(r=>({base:r,insteadOf:e.get(`url.${r}.insteadof`)})).sort((r,n)=>n.base.length-r.base.length)}};var iUo=100,jUt=class{constructor(e,r){this.baseFolder=e;this.remote=r;this.setNWO()}static{a(this,"GitRepository")}get tenant(){return this._tenant}get owner(){return this._owner}get name(){return this._name}get adoOrganization(){return this._adoOrganization}isGitHub(){return this.remote?.isGitHub()??!1}isADO(){return this.remote?.isADO()??!1}setNWO(){let e=this.remote?.path?.replace(/^\//,"").split("/");if(this.isGitHub()){this._owner=e?.[0],this._name=e?.[1]?.replace(/\.git$/,"");let r=/^(?[^.]+)\.ghe\.com$/.exec(this.remote?.hostname??"");r&&(this._tenant=r.groups?.tenant)}else if(this.isADO()&&e?.length===4){if(this.remote?.scheme==="ssh"){this._adoOrganization=e?.[1],this._owner=e?.[2],this._name=e?.[3];return}let r=/(?:(?[^.]+)\.)?visualstudio\.com$/.exec(this.remote?.hostname??"");r?(this._adoOrganization=r.groups?.org,this._owner=e?.[1],this._name=e?.[3]):(this._adoOrganization=e?.[0],this._owner=e?.[1],this._name=e?.[3])}}},Tf=class t{constructor(e){this.ctx=e;this.remoteResolver=new zze;this.cache=new Cn(iUo)}static{a(this,"RepositoryManager")}async getRepo({uri:e}){let r,n=[];do{if(this.cache.has(e.toString())){let s=this.cache.get(e);return this.updateCache(n,s),s}n.push(e.toString());let o=await this.tryGetRepoForFolder(e);if(o)return this.updateCache(n,o),o;r=e,e=mf(e)}while(e!==r);this.updateCache(n,void 0)}updateCache(e,r){e.forEach(n=>this.cache.set(n,r))}async tryGetRepoForFolder(e){return await this.isBaseRepoFolder(e)?new jUt(typeof e=="string"?{uri:e}:e,await this.repoUrl(e)):void 0}async isBaseRepoFolder(e){return await t.getRepoConfigLocation(this.ctx,e)!==void 0}async repoUrl(e){return await this.remoteResolver.resolveRemote(this.ctx,e)}static async getRepoConfigLocation(e,r){try{let n=e.get(Qo),o=wa(r,".git");if((await n.stat(o)).type&1)return await this.getConfigLocationForGitfile(n,r,o);let c=wa(o,"config");return await n.stat(c),c}catch{return}}static async getConfigLocationForGitfile(e,r,n){let s=(await e.readFileString(n)).match(/^gitdir:\s+(.+)$/m);if(!s)return;let c=nz(r,s[1]),l=wa(c,"config");if(await this.tryStat(e,l)!==void 0)return l;let u=wa(c,"config.worktree");if(await this.tryStat(e,u)!==void 0)return u;let d=wa(c,"commondir");c=nz(c,(await e.readFileString(d)).trimEnd());let f=wa(c,"config");return await e.stat(f),f}static async tryStat(e,r){try{return await e.stat(r)}catch{return}}};p();var IK=a((t,e)=>{if(aO.Check(t,e))return e;let r=`Typebox schema validation failed: +${[...aO.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` +`)}`;throw new Error(r)},"assertShape");p();p();p();var Yze=new WeakMap;function Kze(t,e){if(t==null||typeof t!="object")return String(t);let r,n="",o=0,s=Object.prototype.toString.call(t);if(s!=="[object RegExp]"&&s!=="[object Date]"&&Yze.has(t))return Yze.get(t);switch(Yze.set(t,"~"+ ++e),s){case"[object Set]":r=Array.from(t);case"[object Array]":for(r||(r=t),n+="a";oe.delete(n))),o}a(oUo,"n");function KAn(t,e){return function(r,n){return oUo(t,e,r,n)}}a(KAn,"o");p();p();p();var GUt=a((t,e,r)=>{let n=t instanceof RegExp?JAn(t,r):t,o=e instanceof RegExp?JAn(e,r):e,s=n!==null&&o!=null&&sUo(n,o,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+n.length,s[1]),post:r.slice(s[1]+o.length)}},"balanced"),JAn=a((t,e)=>{let r=e.match(t);return r?r[0]:null},"maybeMatch"),sUo=a((t,e,r)=>{let n,o,s,c,l,u=r.indexOf(t),d=r.indexOf(e,u+1),f=u;if(u>=0&&d>0){if(t===e)return[u,d];for(n=[],s=r.length;f>=0&&!l;){if(f===u)n.push(f),u=r.indexOf(t,f+1);else if(n.length===1){let h=n.pop();h!==void 0&&(l=[h,d])}else o=n.pop(),o!==void 0&&o=0?u:d}n.length&&c!==void 0&&(l=[s,c])}return l},"range");var ZAn="\0SLASH"+Math.random()+"\0",XAn="\0OPEN"+Math.random()+"\0",VUt="\0CLOSE"+Math.random()+"\0",eyn="\0COMMA"+Math.random()+"\0",tyn="\0PERIOD"+Math.random()+"\0",aUo=new RegExp(ZAn,"g"),cUo=new RegExp(XAn,"g"),lUo=new RegExp(VUt,"g"),uUo=new RegExp(eyn,"g"),dUo=new RegExp(tyn,"g"),fUo=/\\\\/g,pUo=/\\{/g,hUo=/\\}/g,mUo=/\\,/g,gUo=/\\\./g,AUo=1e5;function $Ut(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}a($Ut,"numeric");function yUo(t){return t.replace(fUo,ZAn).replace(pUo,XAn).replace(hUo,VUt).replace(mUo,eyn).replace(gUo,tyn)}a(yUo,"escapeBraces");function EUo(t){return t.replace(aUo,"\\").replace(cUo,"{").replace(lUo,"}").replace(uUo,",").replace(dUo,".")}a(EUo,"unescapeBraces");function ryn(t){if(!t)return[""];let e=[],r=GUt("{","}",t);if(!r)return t.split(",");let{pre:n,body:o,post:s}=r,c=n.split(",");c[c.length-1]+="{"+o+"}";let l=ryn(s);return s.length&&(c[c.length-1]+=l.shift(),c.push.apply(c,l)),e.push.apply(e,c),e}a(ryn,"parseCommaParts");function nyn(t,e={}){if(!t)return[];let{max:r=AUo}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),ixe(yUo(t),r,!0).map(EUo)}a(nyn,"expand");function _Uo(t){return"{"+t+"}"}a(_Uo,"embrace");function vUo(t){return/^-?0\d/.test(t)}a(vUo,"isPadded");function CUo(t,e){return t<=e}a(CUo,"lte");function bUo(t,e){return t>=e}a(bUo,"gte");function ixe(t,e,r){let n=[],o=GUt("{","}",t);if(!o)return[t];let s=o.pre,c=o.post.length?ixe(o.post,e,!1):[""];if(/\$$/.test(o.pre))for(let l=0;l=0;if(!d&&!f)return o.post.match(/,(?!,).*\}/)?(t=o.pre+"{"+o.body+VUt+o.post,ixe(t,e,!0)):[t];let h;if(d)h=o.body.split(/\.\./);else if(h=ryn(o.body),h.length===1&&h[0]!==void 0&&(h=ixe(h[0],e,!1).map(_Uo),h.length===1))return c.map(g=>o.pre+h[0]+g);let m;if(d&&h[0]!==void 0&&h[1]!==void 0){let g=$Ut(h[0]),A=$Ut(h[1]),y=Math.max(h[0].length,h[1].length),E=h.length===3&&h[2]!==void 0?Math.max(Math.abs($Ut(h[2])),1):1,_=CUo;A0){let x=new Array(R+1).join("0");T<0?w="-"+x+w.slice(1):w=x+w}}m.push(w)}}else{m=[];for(let g=0;g{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");p();p();var SUo={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},sxe=a(t=>t.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),TUo=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),iyn=a(t=>t.join(""),"rangesToString"),oyn=a((t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],o=[],s=r+1,c=!1,l=!1,u=!1,d=!1,f=r,h="";e:for(;sh?n.push(sxe(h)+"-"+sxe(y)):y===h&&n.push(sxe(y)),h="",s++;continue}if(t.startsWith("-]",s+1)){n.push(sxe(y+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=y,s+=2;continue}n.push(sxe(y)),s++}if(fr?e?t.replace(/\[([^/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?t.replace(/\[([^/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var FC,IUo=new Set(["!","?","+","*","@"]),WUt=a(t=>IUo.has(t),"isExtglobType"),syn=a(t=>WUt(t.type),"isExtglobAST"),xUo=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),wUo=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),RUo=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),ayn=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),kUo="(?!(?:^|/)\\.\\.?(?:$|/))",Zze="(?!\\.)",PUo=new Set(["[","."]),DUo=new Set(["..","."]),NUo=new Set("().*{}+?[]^$\\!"),MUo=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),zUt="[^/]",cyn=zUt+"*?",lyn=zUt+"+?",OUo=0,xK=class{static{a(this,"AST")}type;#e;#t;#r=!1;#n=[];#i;#o;#s;#a=!1;#c;#u;#l=!1;id=++OUo;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#n.length,parts:this.#n}}constructor(e,r,n={}){this.type=e,e&&(this.#t=!0),this.#i=r,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#s=this.#e===this?[]:this.#e.#s,e==="!"&&!this.#e.#a&&this.#s.push(this),this.#o=this.#i?this.#i.#n.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#n)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#n.map(e=>String(e)).join("|")+")":this.#u=this.#n.map(e=>String(e)).join("")}#p(){if(this!==this.#e)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let e;for(;e=this.#s.pop();){if(e.type!=="!")continue;let r=e,n=r.#i;for(;n;){for(let o=r.#o+1;!n.type&&otypeof r=="string"?r:r.toJSON()):[this.type,...this.#n.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#a&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#o===0)return!0;let e=this.#i;for(let r=0;rtypeof g!="string"),d=this.#n.map(g=>{let[A,y,E,_]=typeof g=="string"?FC.#k(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||E,this.#r=this.#r||_,A}).join(""),f="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&DUo.has(this.#n[0]))){let A=PUo,y=r&&A.has(d.charAt(0))||d.startsWith("\\.")&&A.has(d.charAt(2))||d.startsWith("\\.\\.")&&A.has(d.charAt(4)),E=!r&&!e&&A.has(d.charAt(0));f=y?kUo:E?Zze:""}let h="";return this.isEnd()&&this.#e.#a&&this.#i?.type==="!"&&(h="(?:$|\\/)"),[f+d+h,HP(d),this.#t=!!this.#t,this.#r]}let n=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#y(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString(),d=this;return d.#n=[u],d.type=null,d.#t=void 0,[u,HP(this.toString()),!1,!1]}let c=!n||e||r||!Zze?"":this.#y(!0);c===s&&(c=""),c&&(s=`(?:${s})(?:${c})*?`);let l="";if(this.type==="!"&&this.#l)l=(this.isStart()&&!r?Zze:"")+lyn;else{let u=this.type==="!"?"))"+(this.isStart()&&!r&&!e?Zze:"")+cyn+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&c?")":this.type==="*"&&c?")?":`)${this.type}`;l=o+s+u}return[l,HP(s),this.#t=!!this.#t,this.#r]}#S(){if(syn(this)){let e=0,r=!1;do{r=!0;for(let n=0;n{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,o,s,c]=r.toRegExpSource(e);return this.#r=this.#r||c,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#k(e,r,n=!1){let o=!1,s="",c=!1,l=!1;for(let u=0;ur?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var If=a((t,e,r={})=>(oxe(e),!r.nocomment&&e.charAt(0)==="#"?!1:new G_(e,r).match(t)),"minimatch"),LUo=/^\*+([^+@!?*[(]*)$/,BUo=a(t=>e=>!e.startsWith(".")&&e.endsWith(t),"starDotExtTest"),FUo=a(t=>e=>e.endsWith(t),"starDotExtTestDot"),UUo=a(t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),"starDotExtTestNocase"),QUo=a(t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),"starDotExtTestNocaseDot"),qUo=/^\*+\.\*+$/,jUo=a(t=>!t.startsWith(".")&&t.includes("."),"starDotStarTest"),HUo=a(t=>t!=="."&&t!==".."&&t.includes("."),"starDotStarTestDot"),GUo=/^\.\*+$/,$Uo=a(t=>t!=="."&&t!==".."&&t.startsWith("."),"dotStarTest"),VUo=/^\*+$/,WUo=a(t=>t.length!==0&&!t.startsWith("."),"starTest"),zUo=a(t=>t.length!==0&&t!=="."&&t!=="..","starTestDot"),YUo=/^\?+([^+@!?*[(]*)?$/,KUo=a(([t,e=""])=>{let r=fyn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocase"),JUo=a(([t,e=""])=>{let r=pyn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocaseDot"),ZUo=a(([t,e=""])=>{let r=pyn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTestDot"),XUo=a(([t,e=""])=>{let r=fyn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTest"),fyn=a(([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},"qmarksTestNoExt"),pyn=a(([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),hyn=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",uyn={win32:{sep:"\\"},posix:{sep:"/"}},e7o=hyn==="win32"?uyn.win32.sep:uyn.posix.sep;If.sep=e7o;var eh=Symbol("globstar **");If.GLOBSTAR=eh;var t7o="[^/]",r7o=t7o+"*?",n7o="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",i7o="(?:(?!(?:\\/|^)\\.).)*?",o7o=a((t,e={})=>r=>If(r,t,e),"filter");If.filter=o7o;var ew=a((t,e={})=>Object.assign({},t,e),"ext"),s7o=a(t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return If;let e=If;return Object.assign(a((n,o,s={})=>e(n,o,ew(t,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(o,s={}){super(o,ew(t,s))}static defaults(o){return e.defaults(ew(t,o)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(o,s,c={}){super(o,s,ew(t,c))}static fromGlob(o,s={}){return e.AST.fromGlob(o,ew(t,s))}},unescape:a((n,o={})=>e.unescape(n,ew(t,o)),"unescape"),escape:a((n,o={})=>e.escape(n,ew(t,o)),"escape"),filter:a((n,o={})=>e.filter(n,ew(t,o)),"filter"),defaults:a(n=>e.defaults(ew(t,n)),"defaults"),makeRe:a((n,o={})=>e.makeRe(n,ew(t,o)),"makeRe"),braceExpand:a((n,o={})=>e.braceExpand(n,ew(t,o)),"braceExpand"),match:a((n,o,s={})=>e.match(n,o,ew(t,s)),"match"),sep:e.sep,GLOBSTAR:eh})},"defaults");If.defaults=s7o;var myn=a((t,e={})=>(oxe(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:nyn(t,{max:e.braceExpandMax})),"braceExpand");If.braceExpand=myn;var a7o=a((t,e={})=>new G_(t,e).makeRe(),"makeRe");If.makeRe=a7o;var c7o=a((t,e,r={})=>{let n=new G_(e,r);return t=t.filter(o=>n.match(o)),n.options.nonull&&!t.length&&t.push(e),t},"match");If.match=c7o;var dyn=/[?*]|[+@!]\(.*?\)|\[|\]/,l7o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),G_=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,r={}){oxe(e),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=e,this.platform=r.platform||hyn,this.isWindows=this.platform==="win32";let n="allowWindowsEscape";this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r[n]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let o=this.globParts.map((s,c,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=s[0]===""&&s[1]===""&&(s[2]==="?"||!dyn.test(s[2]))&&!dyn.test(s[3]),d=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(d)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,o),this.set=o.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let o=n;for(;r[o+1]==="**";)o++;o!==n&&r.splice(n,o-n)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((n,o)=>{let s=n[n.length-1];return o==="**"&&s==="**"?n:o===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(o),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let o=1;oo&&n.splice(o+1,c-o);let l=n[o+1],u=n[o+2],d=n[o+3];if(l!==".."||!u||u==="."||u===".."||!d||d==="."||d==="..")continue;r=!0,n.splice(o,1);let f=n.slice(0);f[o]="**",e.push(f),o--}if(!this.preserveMultipleSlashes){for(let c=1;cr.length)}partsMatch(e,r,n=!1){let o=0,s=0,c=[],l="";for(;o=2&&(e=this.levelTwoFileOptimize(e)),r.includes(eh)?this.#e(e,r,n,o,s):this.#r(e,r,n,o,s)}#e(e,r,n,o,s){let c=r.indexOf(eh,s),l=r.lastIndexOf(eh),[u,d,f]=n?[r.slice(s,c),r.slice(c+1),[]]:[r.slice(s,c),r.slice(c+1,l),r.slice(l+1)];if(u.length){let v=e.slice(o,o+u.length);if(!this.#r(v,u,n,0,0))return!1;o+=u.length,s+=u.length}let h=0;if(f.length){if(f.length+o>e.length)return!1;let v=e.length-f.length;if(this.#r(e,f,n,v,0))h=f.length;else{if(e[e.length-1]!==""||o+f.length===e.length||(v--,!this.#r(e,f,n,v,0)))return!1;h=f.length+1}}if(!d.length){let v=!!h;for(let b=o;b{let d=u.map(h=>{if(h instanceof RegExp)for(let m of h.flags.split(""))o.add(m);return typeof h=="string"?l7o(h):h===eh?eh:h._src});d.forEach((h,m)=>{let g=d[m+1],A=d[m-1];h!==eh||A===eh||(A===void 0?g!==void 0&&g!==eh?d[m+1]="(?:\\/|"+n+"\\/)?"+g:d[m]=n:g===void 0?d[m-1]=A+"(?:\\/|\\/"+n+")?":g!==eh&&(d[m-1]=A+"(?:\\/|\\/"+n+"\\/)"+g,d[m+1]=eh))});let f=d.filter(h=>h!==eh);if(this.partial&&f.length>=1){let h=[];for(let m=1;m<=f.length;m++)h.push(f.slice(0,m).join("/"));return"(?:"+h.join("|")+")"}return f.join("/")}).join("|"),[c,l]=e.length>1?["(?:",")"]:["",""];s="^"+c+s+l+"$",this.partial&&(s="^(?:\\/|"+c+s.slice(1,-1)+l+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let o=this.slashSplit(e);this.debug(this.pattern,"split",o);let s=this.set;this.debug(this.pattern,"set",s);let c=o[o.length-1];if(!c)for(let l=o.length-2;!c&&l>=0;l--)c=o[l];for(let l of s){let u=o;if(n.matchBase&&l.length===1&&(u=[c]),this.matchOne(u,l,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return If.defaults(e).Minimatch}};If.AST=xK;If.Minimatch=G_;If.escape=Vle;If.unescape=HP;var YUt="contentExclusion",Xze=class extends $ze{static{a(this,"CopilotContentExclusion")}#e;#t=new Cn(1e4);#r=new Cn(200);constructor(e){super(),this.#e=e}async evaluate(e,r){try{e=nz(e).toString();let n=await this.getGitRepo({uri:e}),o=await this.#n(n?.url??SK.all);if(!o)return Gze;let s=n?.baseFolder?.uri??"file://",c=this.evaluateFilePathRules(e,s,o);if(c.isBlocked)return c;let l=this.evaluateTextBasedRules(e,o,r);if(l.isBlocked)return l}catch(n){return eq.exception(this.#e,n,`${YUt}.evaluate`),VAn}return nxe}evaluateFilePathRules(e,r,n){let o=e;if(this.#t.has(o))return this.#t.get(o);let s=nxe,c,l=cNt(e.replace(r,""));e:for(let u of n)for(let d of u.paths)if(If(l,d,{nocase:!0,matchBase:!0,nonegate:!0,dot:!0})){s=KUt(u,"FILE_BLOCKED_PATH"),c=d;break e}return eq.debug(this.#e,`Evaluated path-based exclusion rules for <${e}>`,{result:s,baseUri:r,fileName:l,matchingPattern:c}),this.#t.set(o,s),s}evaluateTextBasedRules(e,r,n){let o=r.filter(l=>l.ifAnyMatch),s=r.filter(l=>l.ifNoneMatch);if(!n||o.length===0&&s.length===0)return nxe;let c=this.evaluateFileContent(o,s,n);return eq.debug(this.#e,`Evaluated text-based exclusion rules for <${e}>`,{result:c}),c}evaluateFileContent(e,r,n){for(let o of e)if(o.ifAnyMatch&&o.ifAnyMatch.length>0&&o.ifAnyMatch.map(c=>gyn(c)).some(c=>c.test(n)))return KUt(o,"FILE_BLOCKED_TEXT_BASED");for(let o of r)if(o.ifNoneMatch&&o.ifNoneMatch.length>0&&!o.ifNoneMatch.map(c=>gyn(c)).some(c=>c.test(n)))return KUt(o,"FILE_BLOCKED_TEXT_BASED");return nxe}async refresh(){try{let e=[...this.#r.keys()];this.reset(),await Promise.all(e.map(r=>this.#o(r)))}catch(e){xa(this.#e,e,`${YUt}.refresh`)}}reset(){this.#r.clear(),this.#t.clear()}async#n(e){if(this.#i?.length)return this.#i;let r=await this.#o(e.toLowerCase());if(r.length!==0)return r}#i;setTestingRules(e){this.#i=e}#o=KAn(async e=>{let r=await this.#e.get(Ft).getGitHubSession();if(!r)throw new yi("No token found");let n=new URL("copilot_internal/content_exclusion",r.apiUrl),o=e.includes(SK.all);e.filter(u=>u!==SK.all).length>0&&n.searchParams.set("repos",e.filter(u=>u!==SK.all).join(",")),n.searchParams.set("scope",o?SK.all:SK.repo);let c=await Bd(this.#e,r,n.href),l=await c.json();if(!c.ok){if(c.status===404)return Array.from(e,()=>[]);throw this.#s("fetch.error",{message:l.message}),new cx(c)}return this.#s("fetch.success"),IK(p7o,l).map(u=>u.rules)},this.#r);async getGitRepo(e){let n=await this.#e.get(Tf).getRepo(mf(e));if(!n||!n?.remote)return;let o=n.remote.getUrlForApi();if(o)return{baseFolder:n.baseFolder,url:o}}#s(e,r,n){ft(this.#e,`${YUt}.${e}`,Vt.createAndMarkAsIssued(r,n))}};function gyn(t){if(!t.startsWith("/")&&!t.endsWith("/"))return new RegExp(t);let e=t.slice(1,t.lastIndexOf("/")),r=t.slice(t.lastIndexOf("/")+1);return new RegExp(e,r)}a(gyn,"stringToRegex");function KUt(t,e){return{isBlocked:!0,message:`Your ${t.source.type.toLowerCase()} '${t.source.name}' has disabled Copilot for this file`,reason:e}}a(KUt,"fileBlockedEvaluationResult");var u7o=S.Object({name:S.String(),type:S.String()}),d7o=S.Object({paths:S.Array(S.String()),ifNoneMatch:S.Optional(S.Array(S.String())),ifAnyMatch:S.Optional(S.Array(S.String())),source:u7o}),JUt=S.Array(d7o),f7o=S.Object({rules:JUt,last_updated_at:S.String(),scope:S.String()}),p7o=S.Array(f7o);var sc=class{constructor(e){this.ctx=e;this.#e=!1;this.#t=new Xze(this.ctx);this.evaluateResultCache=new Map;this.onDidChangeActiveTextEditor=a(async e=>{if(!this.#e)return;if(!e.document){this.updateStatusIcon(!1);return}let r=await this.ctx.get($r).getTextDocumentValidation(e.document),n=r.status==="invalid",o=r.status==="invalid"?r.reason:void 0;this.updateStatusIcon(n,o)},"onDidChangeActiveTextEditor");let r=K0(this.ctx,this.onDidChangeActiveTextEditor,"Content exclusions focus change");this.ctx.get($r).onDidFocusTextDocument(r),vs(this.ctx,n=>{this.#e=n.envelope.copilotignore_enabled??!1,this.evaluateResultCache.clear(),this.#t.refresh()})}static{a(this,"CopilotContentExclusionManager")}#e;#t;get enabled(){return this.#e}async evaluate(e,r,n){if(!this.#e)return{isBlocked:!1};let o=[],s=a(async(u,d)=>{let f=performance.now(),h=await d.evaluate(e,r),m=performance.now();return o.push({key:u,result:h,elapsedMs:Math.round(m-f)}),h},"track"),l=(await Promise.all([s("contentExclusion.evaluate",this.#t)])).find(u=>u?.isBlocked)??{isBlocked:!1};try{for(let u of o)this.#r(u.key,e,u.result,u.elapsedMs)}catch(u){eq.error(this.ctx,"Error tracking telemetry",u)}return n==="UPDATE"&&this.updateStatusIcon(l.isBlocked,l.message),l}updateStatusIcon(e,r){this.#e&&(e?this.ctx.get(Ss).setClsInactive(r??"Copilot is disabled"):this.ctx.get(Ss).clearClsInactive())}#r(e,r,n,o){let s=r+e;if(this.evaluateResultCache.get(s)===n.reason)return!1;if(this.evaluateResultCache.set(s,n.reason??"UNKNOWN"),n.reason===Gze.reason)return eq.debug(this.ctx,`[${e}] No matching policy for this repository. uri: ${r}`),!1;let l={isBlocked:n.isBlocked?"true":"false",reason:n.reason??"UNKNOWN"},u={contentExclusionEvalMs:o};return ft(this.ctx,e,Vt.createAndMarkAsIssued(l,u)),ft(this.ctx,e,Vt.createAndMarkAsIssued({...l,path:r},u),1),eq.debug(this.ctx,`[${e}] ${r}`,n),!0}setTestingRules(e){this.#t.setTestingRules(e)}set __contentExclusions(e){this.#t=e}get __contentExclusions(){return this.#t}};async function Wle(t,e,r){let n=await t.get(sc).evaluate(e.uri,r);return n.isBlocked?{status:"invalid",reason:n.message??"Document is blocked by repository policy"}:{status:"valid"}}a(Wle,"isDocumentValid");var $r=class{constructor(e,r=Wle){this.ctx=e;this.validateTextDocument=r}static{a(this,"TextDocumentManager")}async textDocuments(){let e=this.getTextDocumentsUnsafe(),r=[];for(let n of e)(await this.validateTextDocument(this.ctx,n,n.getText())).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=Fs(e.uri);return this.getTextDocumentsUnsafe().find(n=>n.uri===r)}async getTextDocument(e){return this.getTextDocumentWithValidation(e).then(r=>{if(r.status==="valid")return r.document})}async getTextDocumentValidation(e){try{let r=this.getTextDocumentUnsafe(e)?.getText()??await this.readTextDocumentFromDisk(e.uri);return r===void 0?this.notFoundResult(e):this.validateTextDocument(this.ctx,e,r)}catch{return this.notFoundResult(e)}}async getTextDocumentWithValidation(e){let r=this.getTextDocumentUnsafe(e);if(!r)return this.notFoundResult(e);let n=await this.validateTextDocument(this.ctx,e,r.getText());return n.status==="valid"?{status:"valid",document:r}:n}notFoundResult({uri:e}){return{status:"notfound",message:`Document for URI could not be found: ${e}`}}async readTextDocumentFromDisk(e){try{if((await this.ctx.get(Qo).stat(e)).size>5*1024*1024)return}catch{return}return await this.ctx.get(Qo).readFileString(e)}getWorkspaceFolder(e){let r=Fs(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith(Fs(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=Fs(e.uri);for(let n of this.getWorkspaceFolders()){let o=Fs(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return Ki(r)}};p();p();var ot=new pe("chat");p();var eYe=class{constructor(e,r){this.ctx=e;this.workspaceFolder=r;this.emitter=new Vi;this.onFileChange=this.emitter.event;this.status="created",this.startWatching()}static{a(this,"WorkspaceWatcher")}emitFilesCreated(e){this.emitter.fire({type:"create",documents:e,workspaceFolder:this.workspaceFolder})}emitFilesUpdated(e){this.emitter.fire({type:"update",documents:e,workspaceFolder:this.workspaceFolder})}emitFilesDeleted(e){this.emitter.fire({type:"delete",documents:e,workspaceFolder:this.workspaceFolder})}};var tw=class{constructor(e){this.ctx=e;this.watchers=new Cn(25)}static{a(this,"WorkspaceWatcherProvider")}getWatcher(e){let r=this.watchers.get(e.uri);if(r)return r;let n=this.getParentFolder(e.uri);return n?this.watchers.get(n):void 0}getParentFolder(e){return[...this.watchers.keys()].find(n=>{let o=n.replace(/[#?].*/,"").replace(/\/?$/,"/");return e!==n&&e.startsWith(o)})}hasWatcher(e){return this.getParentFolder(e.uri)||this.getWatcher(e)!==void 0}startWatching(e){if(ot.debug(this.ctx,`WorkspaceWatcherProvider - Start watching workspace ${e.uri}`),this.hasWatcher(e)){this.getWatcher(e)?.startWatching();return}let r=this.createWatcher(e);this.watchers.set(e.uri,r)}stopWatching(e){this.getWatcher(e)?.stopWatching()}terminateSubfolderWatchers(e){let r=[];for(let s of this.watchers.values())r.push(s.workspaceFolder);let n=e.uri.replace(/[#?].*/,"").replace(/\/?$/,"/"),o=r.filter(s=>s.uri!==e.uri&&s.uri.startsWith(n));for(let s of o)this.terminateWatching(s);return o}terminateWatching(e){if(this.getWatcher(e)?.status!=="stopped")return this.stopWatching(e),this.watchers.delete(e.uri);this.watchers.delete(e.uri)}onFileChange(e,r,n,o){return this.getWatcher(e)?.onFileChange(K0(this.ctx,r,"WorkspaceWatcherProvider.onFileChange"),n,o)}async getWatchedFiles(e){return await this.getWatcher(e)?.getWatchedFiles()??[]}async getWatchedFileUris(e){return await this.getWatcher(e)?.getWatchedFileUris()??[]}getStatus(e){return this.getWatcher(e)?.status}};var tq=class{static{a(this,"WorkspaceLifecycleListener")}start(){}didAddWorkspace(e){}didRemoveWorkspace(e){}didTerminateWorkspaceSubfolders(e,r){}didChangeFiles(e){}},h7o="workspaceLifecycleManager",dE=new pe(h7o),VS=class t{constructor(e){this.ctx=e;this.activeListeners=[];this.watchedWorkspaces=[];this.ctx=e;let r=vs(e,async()=>{r.dispose(),await this.start()})}static{a(this,"WorkspaceLifecycleManager")}async start(){for(let e of this.activeListeners)await e.isEnabled()?e.isStarted()?dE.debug(this.ctx,`listener ${e.constructor.name} is already started`):(dE.debug(this.ctx,`starting listener ${e.constructor.name}`),await e.start()):dE.debug(this.ctx,`listener ${e.constructor.name} is not enabled`);dE.debug(this.ctx,"WorkspaceLifecycleManager started"),this.ctx.get($r).onDidChangeWorkspaceFolders(e=>{this.onWorkspacesAdded(e.added,this.ctx),this.onWorkspacesRemoved(e.removed,this.ctx)}),await this.onWorkspacesAdded(this.ctx.get($r).getWorkspaceFolders(),this.ctx)}static isSubfolder(e,r){let n=e.uri,o=r.uri.replace(/[#?].*/,"").replace(/\/?$/,"/");return n!==o&&n.startsWith(o)}async onWorkspacesAdded(e,r){if(!e.length){dE.debug(r,"No workspaces to add.");return}dE.debug(r,`Adding workspaces: ${e.map(l=>l.uri).join(", ")}`);let n=[...this.watchedWorkspaces,...e];dE.debug(r,`Combined workspaces: ${n.map(l=>l.uri).join(", ")}`);let o=n.filter((l,u,d)=>d.findIndex(f=>f.uri===l.uri)===u&&!d.some(f=>t.isSubfolder(l,f)));dE.debug(r,`Filtered workspaces: ${o.map(l=>l.uri).join(", ")}`);let s=o.filter(l=>!this.watchedWorkspaces.some(u=>u.uri===l.uri));dE.debug(r,`New workspaces: ${s.map(l=>l.uri).join(", ")}`);let c=this.watchedWorkspaces.filter(l=>!o.some(u=>u.uri===l.uri));dE.debug(r,`Removed workspaces: ${c.map(l=>l.uri).join(", ")}`),this.watchedWorkspaces=o;for(let l of c){dE.debug(r,`Terminating watching for removed workspace: ${l.uri}`),r.get(tw).terminateWatching(l);for(let d of this.activeListeners)dE.debug(r,`Notifying listener of removed workspace: ${l.uri}`),await d.didRemoveWorkspace(l)}for(let l of s){if(!l.uri)continue;dE.debug(r,`Starting to watch new workspace: ${l.uri}`);let u=r.get(tw);if(u.shouldStartWatching(l)){u.startWatching(l);let d=u.terminateSubfolderWatchers(l);if(d.length){dE.debug(r,`Terminated subfolder watchers for workspace: ${l.uri}, Subfolders: ${d.map(f=>f.uri).join(", ")}`);for(let f of this.activeListeners)await f.didTerminateWorkspaceSubfolders(l,d)}for(let f of this.activeListeners)dE.debug(r,`Adding file change listener for workspace: ${l.uri}`),u.onFileChange(l,f.didChangeFiles.bind(f))}}for(let l of this.activeListeners)for(let u of s)dE.debug(r,`Notifying ${l.constructor.name} of added workspace: ${u.uri}`),await l.didAddWorkspace(u)}async onWorkspacesRemoved(e,r){if(e.length)for(let n of e){if(!n.uri)continue;r.get(tw).terminateWatching(n),this.watchedWorkspaces=this.watchedWorkspaces.filter(s=>s.uri!==n.uri);for(let s of this.activeListeners)await s.didRemoveWorkspace(n)}}addListener(e){this.activeListeners.push(e)}removeListener(e){this.activeListeners=this.activeListeners.filter(r=>r!==e)}removeAllListeners(){this.activeListeners=[]}};function tYe(t){t.set(VS,new VS(t))}a(tYe,"setupWorkspaceLifecycleListener");var rq=fe(require("fs")),rw=fe(require("path"));var ZUt=".agent.md",m7o=300*1e3,g7o="github",yyn="agents";function axe(t){return t.replace(/[^a-z0-9_-]/gi,"_").toLowerCase()}a(axe,"sanitizeSegment");function A7o(t){return t.replace(/\\/g,"/")}a(A7o,"toPosix");var L3=class{constructor(e,r,n,o={}){this.ctx=e;this.registry=r;this.persistenceManager=n;this.logger=new pe("OrgCustomAgentService");this.fetchSequencer=new Xx;this.activated=!1;this.orgs=new Map;this.client=o.client??new jze(e),this.resolveNwo=o.resolveNwo??(s=>AUt(s,[e.get(Km).getAuthAuthority()])),this.refreshIntervalMs=o.refreshIntervalMs??m7o,this.cacheRoot=rw.join(this.persistenceManager.directory,g7o),this.lifecycleListener=new XUt(this)}static{a(this,"OrgCustomAgentService")}activate(){if(this.activated)return;this.activated=!0;let e=A7o(this.cacheRoot),n=`${e.endsWith("/")?e.slice(0,-1):e}/*/*/${yyn}/*${ZUt}`;this.registration=this.registry.register("agent",[n],{watchable:!0,cacheable:!0,metadata:Eyn.githubOrg}),this.tokenSubscription=vs(this.ctx,()=>{this.refreshAll()}),this.refreshIntervalMs>0&&(this.refreshTimer=setInterval(()=>{this.refreshAll()},this.refreshIntervalMs),this.refreshTimer.unref?.())}async dispose(){this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=void 0),this.tokenSubscription?.dispose(),this.tokenSubscription=void 0,this.registration?.dispose(),this.registration=void 0,this.activated=!1,await this.fetchSequencer.drain()}async refreshAll(){let e=Array.from(this.orgs.entries()).map(([r,n])=>this.fetchSequencer.queue(r,()=>this.fetchAndCacheOrg(r,n.probeNwo)));await Promise.all(e)}visibleOwnersForWorkspaces(e){let r=new Set(e.map(o=>Fs(o.uri))),n=new Set;for(let o of this.orgs.values())for(let s of r)if(o.workspaces.has(s)){n.add(axe(o.probeNwo.owner));break}return n}isCachedAgentVisibleFor(e,r){let n=this.extractOwnerFromPath(e);return n===void 0?!0:this.visibleOwnersForWorkspaces(r).has(n)}extractOwnerFromPath(e){let r=rw.relative(this.cacheRoot,e);if(r.startsWith("..")||rw.isAbsolute(r))return;let n=r.indexOf(rw.sep);if(!(n<=0))return r.slice(0,n)}_isActivated(){return this.activated}async _handleWorkspaceAdded(e){await this.onWorkspaceAdded(e)}async _handleWorkspaceRemoved(e){await this.onWorkspaceRemoved(e)}async onWorkspaceAdded(e){if(!e?.uri)return;let r;try{r=ln(e.uri)}catch{return}let n=await this.resolveNwo(r);if(!n)return;let o=Fs(e.uri),s=this.orgs.get(n.owner);if(s){s.workspaces.add(o);return}this.orgs.set(n.owner,{workspaces:new Set([o]),probeNwo:n}),await this.fetchSequencer.queue(n.owner,()=>this.fetchAndCacheOrg(n.owner,n))}async onWorkspaceRemoved(e){if(!e?.uri)return;let r=Fs(e.uri),n=[];for(let[o,s]of this.orgs)s.workspaces.delete(r)&&s.workspaces.size===0&&n.push({org:o,probe:s.probeNwo});for(let{org:o,probe:s}of n)this.orgs.delete(o),await this.fetchSequencer.queue(o,()=>this.removeOrgCache(s))}async fetchAndCacheOrg(e,r){if(Rt(this.ctx,ze.EnableOrgCustomAgents)===!1)return;let n=await this.client.listCustomAgents(r.owner,r.repo);if(n===void 0)return;let o=this.agentsDirFor(r);await rq.promises.mkdir(o,{recursive:!0});let s=new Set;for(let c of n){let l=`${c.name}${ZUt}`;s.add(l);let u=await this.fetchDetails(c);u&&await this.writeIfChanged(rw.join(o,l),$An(u))}await this.clearOrphans(o,s)}agentsDirFor(e){return rw.join(this.cacheRoot,axe(e.owner),axe(e.repo),yyn)}async fetchDetails(e){return this.client.getCustomAgentDetails(e.repo_owner,e.repo_name,e.name,e.version)}async writeIfChanged(e,r){let n=Buffer.from(r,"utf8");try{if((await rq.promises.stat(e)).size===n.length&&(await rq.promises.readFile(e)).equals(n))return}catch{}await rq.promises.writeFile(e,n),this.logger.debug(this.ctx,`[OrgCustomAgentService] wrote ${e}`)}async clearOrphans(e,r){let n;try{n=await rq.promises.readdir(e,{withFileTypes:!0})}catch{return}for(let o of n)if(o.isFile()&&o.name.endsWith(ZUt)&&!r.has(o.name))try{await rq.promises.unlink(rw.join(e,o.name)),this.logger.debug(this.ctx,`[OrgCustomAgentService] removed orphan ${o.name}`)}catch(s){this.logger.warn(this.ctx,`[OrgCustomAgentService] orphan unlink failed: ${String(s)}`)}}async removeOrgCache(e){let r=rw.join(this.cacheRoot,axe(e.owner),axe(e.repo));try{await rq.promises.rm(r,{recursive:!0,force:!0}),this.logger.debug(this.ctx,`[OrgCustomAgentService] removed cache for ${e.owner}/${e.repo}`)}catch(n){this.logger.warn(this.ctx,`[OrgCustomAgentService] failed to remove cache for ${e.owner}/${e.repo}: ${String(n)}`)}}},XUt=class extends tq{constructor(r){super();this.service=r}static{a(this,"OrgCustomAgentLifecycleListener")}isEnabled(){return Promise.resolve(!0)}isStarted(){return this.service._isActivated()}start(){this.service.activate()}async didAddWorkspace(r){await this.service._handleWorkspaceAdded(r)}async didRemoveWorkspace(r){await this.service._handleWorkspaceRemoved(r)}};p();var d0=class{static{a(this,"PromptChangeNotifier")}},rYe=class extends d0{static{a(this,"NullPromptChangeNotifier")}async notify(e){}};p();p();p();function _yn(t,e,r,n){let o=Array.isArray(t)?t:[t];return{affectedTypes:new Set(o),changes:[{reason:e,path:r}],workspaceFolderUri:n}}a(_yn,"createPromptFilesChangedEvent");function vyn(t,e,r){return{affectedTypes:new Set(t),changes:e,workspaceFolderUri:r}}a(vyn,"createBatchPromptFilesChangedEvent");p();var yu=class{constructor(){this._listeners=[];this._disposed=!1}static{a(this,"EventEmitter")}get event(){return(e,r,n)=>{if(this._disposed)throw new Error("EventEmitter is disposed");let o={listener:e,thisArgs:r};this._listeners.push(o);let s={dispose:a(()=>{let c=this._listeners.indexOf(o);c>=0&&this._listeners.splice(c,1)},"dispose")};return n&&n.push(s),s}}fire(e){if(this._disposed)return;let r=this._listeners.slice();for(let{listener:n,thisArgs:o}of r)try{n.call(o,e)}catch(s){console.error("Error in event listener:",s)}}dispose(){this._listeners.length=0,this._disposed=!0}};function zle(...t){return(e,r,n)=>{let o=[];for(let c of t)o.push(c(e,r));let s={dispose:a(()=>{for(let c of o)c.dispose()},"dispose")};return n&&n.push(s),s}}a(zle,"anyEvent");var Tyn=require("os"),cxe=fe(require("path"));function Yle(t){return t.replace(/\\/g,"/")}a(Yle,"toForwardSlash");function Cyn(...t){return cxe.default.posix.join(...t.map(Yle))}a(Cyn,"globJoin");function E7o(t){let e=Yle(t);return(e.startsWith("~/")?e.slice(2):e).split("/").some(n=>n==="..")}a(E7o,"containsTraversal");function byn(t,e){let r=Yle(cxe.default.posix.normalize(Yle(t))),n=Yle(cxe.default.posix.normalize(Yle(e)));if(n===r)return!0;let o=r.endsWith("/")?r:`${r}/`;return n.startsWith(o)}a(byn,"isContained");var Syn=["*","?","{","["],PA=class{constructor(e,r){this.ctx=e;this.logger=new pe("PromptFileLocationRegistry");this._onLocationsChanged=new yu;this.onLocationsChanged=this._onLocationsChanged.event;this.patterns=new Map;this.suppressEvents=0;this.getHomedir=r?.homedir??Tyn.homedir}static{a(this,"PromptFileLocationRegistry")}register(e,r,n={}){let o=n.watchable??!0,s=n.cacheable??!0,c=n.metadata,l=this.patterns.get(e);l||(l=[],this.patterns.set(e,l));let u=[];for(let d of r){if(E7o(d)){this.logger.warn(this.ctx,`Skipping pattern "${d}" because it contains a ".." segment; traversal is not allowed.`);continue}if(!l.some(f=>f.pattern===d)){let f=Syn.some(m=>d.includes(m)),h=n.classification??{storage:this.derivePatternStorage(d)};l.push({pattern:d,isGlob:f,watchable:o,cacheable:s,metadata:c,classification:h}),u.push(d)}}return u.length>0&&this.fireLocationsChanged(e),{dispose:a(()=>this.unregister(e,u),"dispose")}}replace(e,r,n,o={}){let s=this.patterns.get(r)?.length??0;this.suppressEvents++;try{e?.dispose()}finally{this.suppressEvents--}return n.length>0?this.register(r,n,o):((this.patterns.get(r)?.length??0){},"dispose")})}unregister(e,r){let n=this.patterns.get(e);if(!n)return;let o=new Set(r),s=n.length,c=n.filter(l=>!o.has(l.pattern));c.lengtho.watchable).map(o=>o.pattern):n.map(o=>o.pattern):[]}resolvePatterns(e,r,n){let o=this.patterns.get(e);if(!o)return[];let s=new Set,c=[],l=a((d,f,h)=>{s.has(d)||(s.add(d),c.push({pattern:d,isGlob:f,watchable:h.watchable,cacheable:h.cacheable,metadata:h.metadata,classification:h.classification}))},"addIfNew"),u=n?o.filter(d=>d.watchable):o;for(let d of u)if(d.pattern.startsWith("~/")){let f=this.getHomedir(),h=Cyn(f,d.pattern.slice(2));if(!byn(f,h))continue;l(h,d.isGlob,d)}else if(this.isAbsolutePattern(d.pattern))l(d.pattern,d.isGlob,d);else for(let f of r){let h=Cyn(f,d.pattern);byn(f,h)&&l(h,d.isGlob,d)}return c}clear(e){let r=this.patterns.get(e);r&&r.length>0&&(this.patterns.set(e,[]),this.fireLocationsChanged(e))}derivePatternStorage(e){return e.startsWith("~/")||this.isAbsolutePattern(e)?"user":"local"}isAbsolutePattern(e){let r=e.length;for(let o of Syn){let s=e.indexOf(o);s>=0&&s0||this._onLocationsChanged.fire(_yn(e,"ConfigChanged"))}};p();p();p();p();var e7t=fe(require("path"));function nw(t,e,r){let n=r?t:t.toLowerCase(),o=r?e:e.toLowerCase();if(n===o)return!0;let s=e7t.posix.relative(n,o);return s!==""&&!s.startsWith("..")&&!e7t.posix.isAbsolute(s)}a(nw,"isEqualOrParent");var UC=process.platform==="linux";function nq(t){return t.replace(/\\/g,"/")}a(nq,"normalizeSlashes");function fg(t){let e=nq(t);return UC?e:e.toLowerCase()}a(fg,"canonicalKey");function Iyn(t){if(t.length<=1)return t.slice();let e=new Map,r=a(u=>UC?u:u.toLowerCase(),"toKey");for(let u of t){let d=r(u.path),f=e.get(d);if(!f){e.set(d,{path:u.path,type:u.type});continue}let h=f.type,m=u.type;h==="create"&&m==="delete"?e.delete(d):h==="delete"&&m==="create"?e.set(d,{path:u.path,type:"update"}):h==="create"&&m==="update"||e.set(d,{path:u.path,type:m})}let n=[...e.values()],o=n.filter(u=>u.type==="delete").sort((u,d)=>u.path.length-d.path.length),s=[],c=[];for(let u of o){let d=r(u.path);c.some(h=>d!==h&&nw(h,d,UC))||(s.push(u),c.push(d))}let l=n.filter(u=>u.type!=="delete");return[...s,...l]}a(Iyn,"coalesceEvents");var nYe=class{constructor(e,r,n){this._parcel=r;this._nodejs=n;this._disposed=!1;this.onDidChange=zle(this._parcel.onDidChange,this._nodejs.onDidChange),this.onDidError=zle(this._parcel.onDidError,this._nodejs.onDidError)}static{a(this,"UniversalWatcher")}watch(e){if(this._disposed)throw new Error("UniversalWatcher: cannot watch after dispose");return e.recursive?this._parcel.watch(e):this._nodejs.watch(e)}async dispose(){this._disposed||(this._disposed=!0,await Promise.all([this._parcel.dispose(),this._nodejs.dispose()]))}};var F3=fe(require("fs"));var wK=new pe("NodeJSWatcherService"),_7o=1e3,iYe=class{constructor(e,r,n,o){this.ctx=e;this.recursive=r;this._onDidChange=new yu;this.onDidChange=this._onDidChange.event;this._onDidError=new yu;this.onDidError=this._onDidError.event;this._entries=new Map;this._disposed=!1;this._fsWatch=n??F3.watch,this._fsWatchFile=o??{watchFile:F3.watchFile,unwatchFile:F3.unwatchFile}}static{a(this,"NodeJSWatcherService")}watch(e){if(this._disposed)throw new Error("NodeJSWatcherService: cannot watch after dispose");if(e.recursive)throw new Error("NodeJSWatcherService: only supports non-recursive watches");let r=nq(e.path),n=fg(r),o=this._entries.get(n);if(o)return o.refCount++,this._entryDisposable(n);let s=this.recursive?.subscribeToPath(r,u=>{this._onDidChange.fire([u])});if(s)return this._entries.set(n,{path:r,refCount:1,disposable:s}),this._entryDisposable(n);let l=this._isRegularFile(r)?this._startWatchFile(r):this._startFsWatch(r);return this._entries.set(n,{path:r,refCount:1,disposable:l}),this._entryDisposable(n)}dispose(){if(this._disposed)return Promise.resolve();this._disposed=!0;let e=[...this._entries.values()];this._entries.clear();for(let r of e)try{r.disposable.dispose()}catch(n){wK.debug(this.ctx,"fs watcher dispose threw",r.path,n)}return this._onDidChange.dispose(),this._onDidError.dispose(),Promise.resolve()}_entryDisposable(e){let r=!1;return{dispose:a(()=>{if(r)return;r=!0;let n=this._entries.get(e);if(n&&(n.refCount--,n.refCount<=0)){this._entries.delete(e);try{n.disposable.dispose()}catch(o){wK.debug(this.ctx,"fs watcher dispose threw",n.path,o)}}},"dispose")}}_isRegularFile(e){try{return F3.statSync(e).isFile()}catch{return!1}}_startFsWatch(e){let r;try{r=this._fsWatch(e,{recursive:!1},(n,o)=>{if(this._disposed)return;let s=o?b7o(e,nq(o)):e,c=v7o(n,s);this._onDidChange.fire([{path:s,type:c}])}),r.on("error",n=>{this._disposed||(this._onDidError.fire({path:e,error:n}),wK.debug(this.ctx,"fs.watch error for",e,n))})}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),wK.debug(this.ctx,"fs.watch threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{r?.close()}catch(n){wK.debug(this.ctx,"fs.watch close threw for",e,n)}},"dispose")}}_startWatchFile(e){let r=a((n,o)=>{if(this._disposed)return;let s=C7o(n,o);s&&this._onDidChange.fire([{path:e,type:s}])},"listener");try{this._fsWatchFile.watchFile(e,{interval:_7o},r)}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),wK.debug(this.ctx,"fs.watchFile threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{this._fsWatchFile.unwatchFile(e,r)}catch(n){wK.debug(this.ctx,"fs.unwatchFile threw for",e,n)}},"dispose")}}};function v7o(t,e){if(t==="change")return"update";try{return F3.statSync(e),"create"}catch{return"delete"}}a(v7o,"classify");function C7o(t,e){if(t.mtimeMs===0&&e.mtimeMs!==0)return"delete";if(t.mtimeMs!==0&&e.mtimeMs===0)return"create";if(t.mtimeMs!==e.mtimeMs)return"update"}a(C7o,"classifyStat");function b7o(t,e){return t.endsWith("/")?t+e:`${t}/${e}`}a(b7o,"joinPosix");p();var sEn=fe(oEn()),aEn=require("os"),cEn=fe(require("path"));var cYe=new pe("ParcelWatcherService"),pQo=process.platform==="win32"?"windows":process.platform==="linux"?"inotify":"fs-events",hQo=process.platform==="darwin"?[cEn.join((0,aEn.homedir)(),"Library","Containers")]:[],lYe=class{constructor(e,r){this.ctx=e;this._onDidChange=new yu;this.onDidChange=this._onDidChange.event;this._onDidError=new yu;this.onDidError=this._onDidError.event;this._roots=new Map;this._pendingShutdowns=new Set;this._disposed=!1;this._enospcNotified=!1;this._warnedPaths=new Set;this._subscribe=r??sEn.subscribe}static{a(this,"ParcelWatcherService")}watch(e){if(this._disposed)throw new Error("ParcelWatcherService: cannot watch after dispose");if(!e.recursive)throw new Error("ParcelWatcherService: only supports recursive watches");let r=nq(e.path),n=fg(r),o=this._findCoveringRoot(r);if(o){let l={root:o};return o.handles.add(l),{dispose:a(()=>this._releaseHandle(l),"dispose")}}let s={path:r,handles:new Set,pathSubscribers:new Map};this._roots.set(n,s),this._startSubscription(s),this._foldChildrenIntoAfterSubscribed(s);let c={root:s};return s.handles.add(c),{dispose:a(()=>this._releaseHandle(c),"dispose")}}subscribeToPath(e,r){if(this._disposed)return;let n=nq(e),o=this._findCoveringRoot(n);if(!o)return;let s=fg(n),c=o.pathSubscribers.get(s);return c||(c=new Set,o.pathSubscribers.set(s,c)),c.add(r),{dispose:a(()=>{let l=o.pathSubscribers.get(s);l&&(l.delete(r),l.size===0&&o.pathSubscribers.delete(s),this._maybeTearDown(o))},"dispose")}}async dispose(){if(this._disposed)return;this._disposed=!0;let e=[...this._roots.values()];for(this._roots.clear(),await Promise.all(e.map(async r=>{r.handles.clear(),r.pathSubscribers.clear(),await this._shutdownEntry(r)}));this._pendingShutdowns.size>0;){let r=[...this._pendingShutdowns];await Promise.allSettled(r)}this._onDidChange.dispose(),this._onDidError.dispose()}_findCoveringRoot(e){for(let r of this._roots.values())if(nw(r.path,e,UC))return r}async _foldChildrenIntoAfterSubscribed(e){let r=[];for(let[n,o]of[...this._roots])if(o!==e&&nw(e.path,o.path,UC)){for(let s of o.handles)s.root=e,e.handles.add(s);o.handles.clear();for(let[s,c]of o.pathSubscribers){let l=e.pathSubscribers.get(s);l||(l=new Set,e.pathSubscribers.set(s,l));for(let u of c)l.add(u)}o.pathSubscribers.clear(),this._roots.delete(n),r.push(o)}if(r.length!==0){try{await e.subscribing}catch{}for(let n of r)this._trackShutdown(n,"Shutdown of folded child failed for")}}_releaseHandle(e){let r=e.root;r.handles.delete(e),this._maybeTearDown(r)}_maybeTearDown(e){if(e.handles.size>0||e.pathSubscribers.size>0)return;let r=fg(e.path);this._roots.get(r)===e&&(this._roots.delete(r),this._trackShutdown(e,"Unsubscribe failed for"))}_trackShutdown(e,r){let n=this._shutdownEntry(e).catch(o=>{cYe.debug(this.ctx,r,e.path,o)});this._pendingShutdowns.add(n),n.finally(()=>this._pendingShutdowns.delete(n))}_startSubscription(e){let r=this._subscribe(e.path,(n,o)=>{if(!this._disposed){if(n){this._onWatchError(n,e.path);return}this._handleParcelEvents(e,o)}},{backend:pQo,ignore:hQo}).then(async n=>{if(e.subscribing=void 0,this._disposed||!this._rootStillActive(e)){await n.unsubscribe();return}return e.subscription=n,n}).catch(n=>{e.subscribing=void 0,this._onWatchError(n instanceof Error?n:new Error(String(n)),e.path)});e.subscribing=r}_rootStillActive(e){let r=fg(e.path);return this._roots.get(r)===e}async _shutdownEntry(e){let r=e.subscription;e.subscription=void 0;let n=e.subscribing;if(e.subscribing=void 0,r)await r.unsubscribe();else if(n){let o=await n;o&&await o.unsubscribe()}}_handleParcelEvents(e,r){if(r.length===0)return;let n=[];for(let s of r){let c=nq(s.path);n.push({path:c,type:s.type})}let o=Iyn(n);if(o.length!==0&&(this._onDidChange.fire(o),e.pathSubscribers.size!==0))for(let s of o){let c=fg(s.path),l=e.pathSubscribers.get(c);if(l)for(let u of l)try{u(s)}catch(d){cYe.debug(this.ctx,"Path subscriber threw",s.path,d)}}}_onWatchError(e,r){if(this._disposed)return;let n=e.toString();if(cYe.debug(this.ctx,"Watcher error for",r,e),this._onDidError.fire({path:r,error:e}),n.includes("ENOSPC")&&!this._enospcNotified){this._enospcNotified=!0,this.ctx.get(es).showWarningMessageOnlyOnce("parcelWatcher.enospc","Unable to watch for file changes in AI customization files. The inotify watch limit may have been reached. Please increase the limit by following the instructions at http://aka.ms/ghc-jetbrains-wiki/FAQ#resolving-the-enospc-file-watcher-error-on-linux");return}this._warnedPaths.has(r)||(this._warnedPaths.add(r),cYe.warn(this.ctx,"Failed to watch for file changes at",r,e))}};function uYe(t){let e=new lYe(t),r=new iYe(t,e);return new nYe(t,e,r)}a(uYe,"createUniversalWatcher");var lEn=fe(require("fs"));var iq=fe(require("path"));var mQo=100,dYe=/[*?{[]/,d7t=class{constructor(e,r,n,o,s){this.request=e;this.watcher=r;this.registerDeferred=n;this.unregisterDeferred=o;this.statSync=s;this._disposed=!1;this._innerSubs=[];this.registerDeferred(this),this._tryActivate()}static{a(this,"DeferredWatchSubscription")}isPending(){return!this._disposed&&this._ancestorPath!==void 0}targetPath(){return this.request.path}handleEvent(e){if(!this._disposed){if(this._ancestorPath!==void 0){if(e.type!=="create"||!nw(e.path,this.request.path,UC)&&!nw(this.request.path,e.path,UC))return;this._tryActivate();return}e.type==="delete"&&nw(e.path,this.request.path,UC)&&this._tryActivate()}}dispose(){this._disposed||(this._disposed=!0,this.unregisterDeferred(this),this._ancestorPath=void 0,this._disposeInnerSubs())}_tryActivate(){if(this._disposed)return;let e=this._isDirectory(this.request.path);if(e||this._exists(this.request.path)){let c=[];if(c.push(this.watcher.watch(this.request)),e){let u=iq.dirname(this.request.path);u!==this.request.path&&this._isDirectory(u)&&c.push(this.watcher.watch({path:u,recursive:!1}))}let l=this._innerSubs;this._innerSubs=c,this._ancestorPath=void 0;for(let u of l)u.dispose();return}let n=gQo(this.request.path,this.statSync);if(n===void 0||AQo(n,this.request.path)){this._ancestorPath="",this._disposeInnerSubs();return}if(this._ancestorPath===n&&this._innerSubs.length>0)return;let o=this.watcher.watch({path:n,recursive:!1}),s=this._innerSubs;this._innerSubs=[o],this._ancestorPath=n;for(let c of s)c.dispose()}_exists(e){try{return this.statSync(e),!0}catch{return!1}}_isDirectory(e){try{return this.statSync(e).isDirectory()}catch{return!1}}_disposeInnerSubs(){let e=this._innerSubs;this._innerSubs=[];for(let r of e)r.dispose()}};function gQo(t,e){let r=iq.dirname(t),n;for(;r!==n;){try{if(e(r).isDirectory())return r}catch{}n=r,r=iq.dirname(r)}}a(gQo,"findExistingAncestor");function AQo(t,e){return iq.dirname(e)===t?!1:t===iq.parse(t).root}a(AQo,"isAncestorTooBroad");var fYe=class{constructor(e,r,n=lEn.statSync){this._onPromptFileChanged=new yu;this.onPromptFileChanged=this._onPromptFileChanged.event;this._patterns=new Map;this._pendingChanges=[];this._pendingTypes=new Set;this._pendingKeys=new Set;this._disposed=!1;this._deferredSubs=new Set;this._watcher=r??uYe(e),this._ownsWatcher=r===void 0,this._statSync=n,this._subscriptionDisposable=this._watcher.onDidChange(o=>this._handleEvents(o))}static{a(this,"PromptFileWatcher")}watch(e,r,n){if(this._disposed)throw new Error("PromptFileWatcher: cannot watch after dispose");let o=Array.isArray(r)?r:[r],s=[],c=new Map,l=new Map;for(let d of o){let f=d.replace(/\\/g,"/");s.push(f),c.set(f,(c.get(f)??0)+1),!this._patterns.has(f)&&!l.has(f)&&l.set(f,this._toWatchRequest(f))}for(let[d,f]of c){let h=this._patterns.get(d);if(!h){let m=l.get(d),g=this._createDeferredSubscription(m),A=dYe.test(d)?m.path:void 0;h={refCountByType:new Map,matcher:new G_(d,{dot:!0}),subscription:g,baseDir:A},this._patterns.set(d,h)}h.refCountByType.set(e,(h.refCountByType.get(e)??0)+f)}n&&n.dispose();let u=!1;return{dispose:a(()=>{if(!u){u=!0;for(let d of s)this._decrementRefCount(d,e)}},"dispose")}}flush(){if(this._disposed||(this._debounceTimer!==void 0&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0),this._pendingChanges.length===0))return;let e=vyn([...this._pendingTypes],this._pendingChanges);this._pendingChanges=[],this._pendingTypes=new Set,this._pendingKeys=new Set,this._onPromptFileChanged.fire(e)}async dispose(){if(!this._disposed){this._disposed=!0,this._debounceTimer!==void 0&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0);for(let e of this._patterns.values())e.subscription.dispose();this._patterns.clear(),this._subscriptionDisposable.dispose(),this._ownsWatcher&&await this._watcher.dispose(),this._onPromptFileChanged.dispose()}}_createDeferredSubscription(e){return new d7t(e,this._watcher,r=>this._deferredSubs.add(r),r=>this._deferredSubs.delete(r),this._statSync)}_toWatchRequest(e){if(!dYe.test(e))return{path:e,recursive:!1,includes:[e]};let r=this._extractBaseDir(e),n=e.includes("**")||this._globSpansMultipleSegments(e);return{path:r,recursive:n,includes:[e]}}_globSpansMultipleSegments(e){let r=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));if(r<0)return!1;let n=e.slice(0,r);return dYe.test(n)}_extractBaseDir(e){let r=dYe.exec(e);if(!r)return iq.dirname(e);let n=e.slice(0,r.index),o=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\"));if(o<0)throw new Error(`PromptFileWatcher: pattern "${e}" has no base directory; expected an absolute path.`);let s=o>0?n.slice(0,o):n;if(/^[A-Za-z]:$/.test(s)&&n.length>s.length){let c=n[s.length];if(c==="/"||c==="\\")return`${s}${c}`}return s}_handleEvents(e){if(!this._disposed){if(this._deferredSubs.size>0)for(let r of e)for(let n of[...this._deferredSubs])n.handleEvent(r);for(let r of e){let n=this._mapEventType(r.type),o=!1;for(let c of this._patterns.values()){if(c.matcher.match(r.path)){for(let f of c.refCountByType.keys())this._pendingTypes.add(f);o=!0;continue}if(r.type!=="delete"||c.baseDir===void 0)continue;let l=c.baseDir,u=nw(r.path,l,UC),d=nw(l,r.path,UC);if(!(!u&&!d)){for(let f of c.refCountByType.keys())this._pendingTypes.add(f);o=!0}}if(!o)continue;let s=`${n}\0${r.path}`;this._pendingKeys.has(s)||(this._pendingKeys.add(s),this._pendingChanges.push({reason:n,path:r.path}))}this._pendingChanges.length>0&&this._scheduleFlush()}}_mapEventType(e){switch(e){case"create":return"FileCreated";case"update":return"FileChanged";case"delete":return"FileDeleted"}}_scheduleFlush(){this._debounceTimer!==void 0&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this._debounceTimer=void 0,this.flush()},mQo)}_decrementRefCount(e,r){let n=this._patterns.get(e);if(!n)return;let o=n.refCountByType.get(r);o!==void 0&&(o<=1?n.refCountByType.delete(r):n.refCountByType.set(r,o-1),n.refCountByType.size===0&&(this._patterns.delete(e),n.subscription.dispose()))}};p();p();function iw(t,e,...r){return e.replace(/\{(\d+)\}/g,(n,o)=>{let s=r[Number(o)];return s!==void 0?String(s):n})}a(iw,"localize");function yQo(t,e=[],r={}){let o=new f7t(t).scan();return new p7t(o,t,e,r).parse()}a(yQo,"parseRaw");function rh(t,e,r,n){return{type:t,startOffset:e,endOffset:r,rawValue:n?.rawValue??"",value:n?.value??"",format:n?.format??"none",indent:n?.indent??0}}a(rh,"makeToken");var f7t=class{constructor(e){this.input=e;this.pos=0;this.tokens=[];this.flowDepth=0;this.seenBlockColon=!1;this.seenDocumentStart=0}static{a(this,"YamlScanner")}scan(e=1){for(;this.pose)););return this.tokens.push(rh(13,this.pos,this.pos)),this.tokens}scanLine(){if(this.seenBlockColon=!1,this.peekChar()===` +`){this.tokens.push(rh(8,this.pos,this.pos+1)),this.pos++;return}if(this.peekChar()==="\r"){let n=this.pos+(this.input[this.pos+1]===` +`?2:1);this.tokens.push(rh(8,this.pos,n)),this.pos=n;return}let e=this.pos,r=0;for(;this.pos0&&this.tokens.push(rh(9,e,this.pos,{indent:r})),this.pos>=this.input.length||this.peekChar()===` `||this.peekChar()==="\r"){if(this.pos=3){let n=this.input[this.pos],o=this.input[this.pos+1],s=this.input[this.pos+2],c=this.input[this.pos+3],l=c===void 0||c===" "||c===" "||c===` -`||c==="\r";if(n==="-"&&o==="-"&&s==="-"&&l){this.tokens.push(Xp(11,this.pos,this.pos+3)),this.pos+=3,this.scanLineContent(),this.scanNewline(),this.seenDocumentStart++;return}if(n==="."&&o==="."&&s==="."&&l){this.tokens.push(Xp(12,this.pos,this.pos+3)),this.pos+=3,this.scanLineContent(),this.scanNewline();return}}if(this.peekChar()==="#"){this.scanComment(),this.scanNewline();return}if(this.peekChar()==="%"){for(;this.pos=3){let n=this.input[this.pos],o=this.input[this.pos+1],s=this.input[this.pos+2],c=this.input[this.pos+3],l=c===void 0||c===" "||c===" "||c===` +`||c==="\r";if(n==="-"&&o==="-"&&s==="-"&&l){this.tokens.push(rh(11,this.pos,this.pos+3)),this.pos+=3,this.scanLineContent(),this.scanNewline(),this.seenDocumentStart++;return}if(n==="."&&o==="."&&s==="."&&l){this.tokens.push(rh(12,this.pos,this.pos+3)),this.pos+=3,this.scanLineContent(),this.scanNewline();return}}if(this.peekChar()==="#"){this.scanComment(),this.scanNewline();return}if(this.peekChar()==="%"){for(;this.pos=this.input.length||this.peekChar()===` -`||this.peekChar()==="\r"));){let e=this.peekChar();if(e==="#"){this.scanComment();break}else if(e==="{")this.flowDepth++,this.tokens.push(Xp(4,this.pos,this.pos+1)),this.pos++;else if(e==="}"&&this.flowDepth>0)this.flowDepth--,this.tokens.push(Xp(5,this.pos,this.pos+1)),this.pos++;else if(e==="[")this.flowDepth++,this.tokens.push(Xp(6,this.pos,this.pos+1)),this.pos++;else if(e==="]"&&this.flowDepth>0)this.flowDepth--,this.tokens.push(Xp(7,this.pos,this.pos+1)),this.pos++;else if(e===","&&this.flowDepth>0)this.tokens.push(Xp(3,this.pos,this.pos+1)),this.pos++;else if(e==="-"&&this.isBlockDash())this.tokens.push(Xp(2,this.pos,this.pos+1)),this.pos++;else if(e===":"&&this.isBlockColon())this.tokens.push(Xp(1,this.pos,this.pos+1)),this.pos++,this.flowDepth===0&&(this.seenBlockColon=!0);else if(e===":"&&this.flowDepth>0&&this.lastTokenIsJsonLike())this.tokens.push(Xp(1,this.pos,this.pos+1)),this.pos++;else if(e==="'"||e==='"')this.scanQuotedScalar(e);else if((e==="|"||e===">")&&this.flowDepth===0&&this.isBlockScalarStart()){this.scanBlockScalar(e);break}else this.scanUnquotedScalar()}}isBlockDash(){let e=this.input[this.pos+1];return e===void 0||e===" "||e===" "||e===` +`||this.peekChar()==="\r"));){let e=this.peekChar();if(e==="#"){this.scanComment();break}else if(e==="{")this.flowDepth++,this.tokens.push(rh(4,this.pos,this.pos+1)),this.pos++;else if(e==="}"&&this.flowDepth>0)this.flowDepth--,this.tokens.push(rh(5,this.pos,this.pos+1)),this.pos++;else if(e==="[")this.flowDepth++,this.tokens.push(rh(6,this.pos,this.pos+1)),this.pos++;else if(e==="]"&&this.flowDepth>0)this.flowDepth--,this.tokens.push(rh(7,this.pos,this.pos+1)),this.pos++;else if(e===","&&this.flowDepth>0)this.tokens.push(rh(3,this.pos,this.pos+1)),this.pos++;else if(e==="-"&&this.isBlockDash())this.tokens.push(rh(2,this.pos,this.pos+1)),this.pos++;else if(e===":"&&this.isBlockColon())this.tokens.push(rh(1,this.pos,this.pos+1)),this.pos++,this.flowDepth===0&&(this.seenBlockColon=!0);else if(e===":"&&this.flowDepth>0&&this.lastTokenIsJsonLike())this.tokens.push(rh(1,this.pos,this.pos+1)),this.pos++;else if(e==="'"||e==='"')this.scanQuotedScalar(e);else if((e==="|"||e===">")&&this.flowDepth===0&&this.isBlockScalarStart()){this.scanBlockScalar(e);break}else this.scanUnquotedScalar()}}isBlockDash(){let e=this.input[this.pos+1];return e===void 0||e===" "||e===" "||e===` `||e==="\r"}isBlockColon(){if(this.seenBlockColon&&this.flowDepth===0)return!1;let e=this.input[this.pos+1];return e===void 0||e===" "||e===" "||e===` -`||e==="\r"||this.flowDepth>0&&(e===","||e==="}"||e==="]")}lastTokenIsJsonLike(){for(let e=this.tokens.length-1;e>=0;e--){let r=this.tokens[e];if(!(r.type===8||r.type===9||r.type===10))return r.type===0&&r.format!=="none"||r.type===5||r.type===7}return!1}scanQuotedScalar(e){let r=this.pos;this.pos++;let n="",o=0;for(;this.pos0&&(e===","||e==="}"||e==="]")}lastTokenIsJsonLike(){for(let e=this.tokens.length-1;e>=0;e--){let r=this.tokens[e];if(!(r.type===8||r.type===9||r.type===10))return r.type===0&&r.format!=="none"||r.type===5||r.type===7}return!1}scanQuotedScalar(e){let r=this.pos;this.pos++;let n="",o=0;for(;this.pos0&&(n=n.substring(0,n.length-o)),o=0,this.consumeNewline();let l=0;for(;this.pos0?n+=` -`.repeat(l):n+=" ";continue}c===" "||c===" "?o++:o=0,n+=c,this.pos++}let s=this.input.substring(r,this.pos);this.tokens.push(Xp(0,r,this.pos,{rawValue:s,value:n,format:e==="'"?"single":"double"}))}scanUnquotedScalar(){let e=this.pos,r=this.pos;for(;this.pos0&&(o===","||o==="}"||o==="]")||this.flowDepth>0&&(o==="{"||o==="[")||o===":"&&this.isBlockColon()||o==="#"&&this.pos>e&&(this.input[this.pos-1]===" "||this.input[this.pos-1]===" "))break;this.pos++,o!==" "&&o!==" "&&(r=this.pos)}let n=this.input.substring(e,r);this.tokens.push(Xp(0,e,r,{rawValue:n,value:n,format:"none"}))}isBlockScalarStart(){let e=this.pos+1;for(;e="1"&&n<="9"){e++;continue}if(n==="+"||n==="-"){e++;continue}break}for(;e=this.input.length)return!0;let r=this.input[e];return r===` +`.repeat(l):n+=" ";continue}c===" "||c===" "?o++:o=0,n+=c,this.pos++}let s=this.input.substring(r,this.pos);this.tokens.push(rh(0,r,this.pos,{rawValue:s,value:n,format:e==="'"?"single":"double"}))}scanUnquotedScalar(){let e=this.pos,r=this.pos;for(;this.pos0&&(o===","||o==="}"||o==="]")||this.flowDepth>0&&(o==="{"||o==="[")||o===":"&&this.isBlockColon()||o==="#"&&this.pos>e&&(this.input[this.pos-1]===" "||this.input[this.pos-1]===" "))break;this.pos++,o!==" "&&o!==" "&&(r=this.pos)}let n=this.input.substring(e,r);this.tokens.push(rh(0,e,r,{rawValue:n,value:n,format:"none"}))}isBlockScalarStart(){let e=this.pos+1;for(;e="1"&&n<="9"){e++;continue}if(n==="+"||n==="-"){e++;continue}break}for(;e=this.input.length)return!0;let r=this.input[e];return r===` `||r==="\r"||r==="#"}scanBlockScalar(e){let r=this.pos;this.pos++;let n=0,o="clip";for(let m=0;m<2;m++)if(this.pos="1"&&g<="9"&&n===0?(n=parseInt(g,10),this.pos++):g==="-"&&o==="clip"?(o="strip",this.pos++):g==="+"&&o==="clip"&&(o="keep",this.pos++)}for(;this.pos0?s+n:0,l=[],u=0;for(;this.pos=this.input.length||this.input[this.pos]===` `||this.input[this.pos]==="\r"){if(c>0&&g>=c){let E=this.input.substring(m+c,this.pos);l.push(E),E===""?u++:u=0}else l.push(""),u++;this.consumeNewline();continue}if(g===0&&this.input.length-this.pos>=3){let E=this.input[this.pos],_=this.input[this.pos+1],v=this.input[this.pos+2],b=this.input[this.pos+3],T=b===void 0||b===" "||b===" "||b===` @@ -2401,28 +2401,28 @@ ${[...XM.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` `;)m--;d=d.substring(0,m)}let f=l.some(m=>m!=="");switch(o){case"clip":f&&(d+=` `);break;case"keep":f?d+=` `.repeat(u+1):d=` -`.repeat(u);break;case"strip":break}let h=this.input.substring(r,this.pos);this.tokens.push(Xp(0,r,this.pos,{rawValue:h,value:d,format:e==="|"?"literal":"folded"}))}getParentBlockIndent(e){for(let r=this.tokens.length-1;r>=0;r--){let n=this.tokens[r];if(!(n.type===8||n.type===10||n.type===9)){if(n.type===1){for(let o=r-1;o>=0;o--){let s=this.tokens[o];if(!(s.type===8||s.type===10||s.type===9))return this.getColumnAt(s.startOffset)}return 0}if(n.type===2)return this.getColumnAt(n.startOffset);if(n.type===11)return-1;break}}return 0}getColumnAt(e){let r=0,n=e-1;for(;n>=0&&this.input[n]!==` +`.repeat(u);break;case"strip":break}let h=this.input.substring(r,this.pos);this.tokens.push(rh(0,r,this.pos,{rawValue:h,value:d,format:e==="|"?"literal":"folded"}))}getParentBlockIndent(e){for(let r=this.tokens.length-1;r>=0;r--){let n=this.tokens[r];if(!(n.type===8||n.type===10||n.type===9)){if(n.type===1){for(let o=r-1;o>=0;o--){let s=this.tokens[o];if(!(s.type===8||s.type===10||s.type===9))return this.getColumnAt(s.startOffset)}return 0}if(n.type===2)return this.getColumnAt(n.startOffset);if(n.type===11)return-1;break}}return 0}getColumnAt(e){let r=0,n=e-1;for(;n>=0&&this.input[n]!==` `&&this.input[n]!=="\r";)r++,n--;return r}scanComment(){let e=this.pos;for(;this.pos=this.input.length?!1:this.input[this.pos]==="\r"&&this.input[this.pos+1]===` +`&&this.input[this.pos]!=="\r";)this.pos++;this.tokens.push(rh(10,e,this.pos,{rawValue:this.input.substring(e,this.pos),value:this.input.substring(e,this.pos)}))}scanNewline(){let e=this.pos;this.consumeNewline()&&this.tokens.push(rh(8,e,this.pos))}skipInlineWhitespace(){for(;this.pos=this.input.length?!1:this.input[this.pos]==="\r"&&this.input[this.pos+1]===` `?(this.pos+=2,!0):this.input[this.pos]===` -`||this.input[this.pos]==="\r"?(this.pos++,!0):!1}peekChar(){return this.input[this.pos]}},vUt=class{constructor(e,r,n,o){this.tokens=e;this.input=r;this.errors=n;this.options=o;this.pos=0}static{a(this,"YamlParser")}parse(){return this.skipNewlinesAndComments(),this.currentToken().type===11&&(this.advance(),this.skipNewlinesAndComments()),this.currentToken().type===13||this.currentToken().type===12?void 0:this.parseValue(-1)}currentToken(){return this.tokens[this.pos]}peek(e=0){return this.tokens[Math.min(this.pos+e,this.tokens.length-1)]}advance(){let e=this.tokens[this.pos];return e.type!==13&&this.pos++,e}expect(e){let r=this.currentToken();return r.type===e?this.advance():r}emitError(e,r,n,o){this.errors.push({message:e,startOffset:r,endOffset:n,code:o})}skipNewlinesAndComments(){for(;this.currentToken().type===8||this.currentToken().type===10||this.currentToken().type===9&&this.isFollowedByNewlineOrComment();)this.advance()}isFollowedByNewlineOrComment(){let e=this.peek(1);return e.type===8||e.type===10||e.type===13}currentIndent(){return this.currentToken().type===9?this.currentToken().indent:0}parseValue(e){this.skipNewlinesAndComments();let r=this.currentToken(),n=r.type===9?this.peek(1):r;if(n.type===4||n.type===6)return r.type===9&&this.advance(),n.type===4?this.parseFlowMap():this.parseFlowSeq();let o=this.currentIndent();if(this.peekPastIndent().type===2)return this.parseBlockSequence(o);if(this.looksLikeMapping())return this.parseBlockMapping(o);if(r.type===0||r.type===9)return this.parseScalar(e)}peekPastIndent(){return this.currentToken().type===9?this.peek(1):this.currentToken()}looksLikeMapping(){let e=0;return this.peek(e).type===9&&e++,this.peek(e).type===0&&(e++,this.peek(e).type===1)}parseScalar(e=-1){this.currentToken().type===9&&this.advance();let r=this.expect(0);return r.format!=="none"?this.scalarFromToken(r):this.parsePlainMultiline(r,e)}parsePlainMultiline(e,r){let n=e.value,o=e.endOffset;for(;;){let s=this.pos,c=0,l=!1;for(;this.posr){l=!0;break}else break}if(f.type===13||f.type===11||f.type===12)break;if(r<0){l=!0;break}break}if(d.type===9)break;break}if(!l){this.pos=s;break}if(this.currentToken().type===9&&this.advance(),this.currentToken().type!==0){if(this.currentToken().type===2){let d=this.advance(),f="-";if(this.currentToken().type===0){let h=this.advance();f="- "+h.value,o=h.endOffset}else o=d.endOffset;c>0?n+=` +`||this.input[this.pos]==="\r"?(this.pos++,!0):!1}peekChar(){return this.input[this.pos]}},p7t=class{constructor(e,r,n,o){this.tokens=e;this.input=r;this.errors=n;this.options=o;this.pos=0}static{a(this,"YamlParser")}parse(){return this.skipNewlinesAndComments(),this.currentToken().type===11&&(this.advance(),this.skipNewlinesAndComments()),this.currentToken().type===13||this.currentToken().type===12?void 0:this.parseValue(-1)}currentToken(){return this.tokens[this.pos]}peek(e=0){return this.tokens[Math.min(this.pos+e,this.tokens.length-1)]}advance(){let e=this.tokens[this.pos];return e.type!==13&&this.pos++,e}expect(e){let r=this.currentToken();return r.type===e?this.advance():r}emitError(e,r,n,o){this.errors.push({message:e,startOffset:r,endOffset:n,code:o})}skipNewlinesAndComments(){for(;this.currentToken().type===8||this.currentToken().type===10||this.currentToken().type===9&&this.isFollowedByNewlineOrComment();)this.advance()}isFollowedByNewlineOrComment(){let e=this.peek(1);return e.type===8||e.type===10||e.type===13}currentIndent(){return this.currentToken().type===9?this.currentToken().indent:0}parseValue(e){this.skipNewlinesAndComments();let r=this.currentToken(),n=r.type===9?this.peek(1):r;if(n.type===4||n.type===6)return r.type===9&&this.advance(),n.type===4?this.parseFlowMap():this.parseFlowSeq();let o=this.currentIndent();if(this.peekPastIndent().type===2)return this.parseBlockSequence(o);if(this.looksLikeMapping())return this.parseBlockMapping(o);if(r.type===0||r.type===9)return this.parseScalar(e)}peekPastIndent(){return this.currentToken().type===9?this.peek(1):this.currentToken()}looksLikeMapping(){let e=0;return this.peek(e).type===9&&e++,this.peek(e).type===0&&(e++,this.peek(e).type===1)}parseScalar(e=-1){this.currentToken().type===9&&this.advance();let r=this.expect(0);return r.format!=="none"?this.scalarFromToken(r):this.parsePlainMultiline(r,e)}parsePlainMultiline(e,r){let n=e.value,o=e.endOffset;for(;;){let s=this.pos,c=0,l=!1;for(;this.posr){l=!0;break}else break}if(f.type===13||f.type===11||f.type===12)break;if(r<0){l=!0;break}break}if(d.type===9)break;break}if(!l){this.pos=s;break}if(this.currentToken().type===9&&this.advance(),this.currentToken().type!==0){if(this.currentToken().type===2){let d=this.advance(),f="-";if(this.currentToken().type===0){let h=this.advance();f="- "+h.value,o=h.endOffset}else o=d.endOffset;c>0?n+=` `.repeat(c):n+=" ",n+=f;continue}this.pos=s;break}if(this.peek(1).type===1){this.pos=s;break}let u=this.advance();c>0?n+=` -`.repeat(c):n+=" ",n+=u.value,o=u.endOffset}return{type:"scalar",value:n,rawValue:this.input.substring(e.startOffset,o),startOffset:e.startOffset,endOffset:o,format:"none"}}parseBlockMapping(e,r=!1){let n=this.currentToken().startOffset,o=[],s=new Set;if(r){let l=this.parseMappingEntry(e);l&&(s.add(l.key.value),o.push(l))}for(;this.currentToken().type!==13&&(this.skipNewlinesAndComments(),this.currentToken().type!==13);){let l=this.currentIndent();if(le)this.emitError(Jx("unexpectedIndentation","Unexpected indentation (expected {0}, got {1})",e,l),this.currentToken().startOffset,this.currentToken().endOffset,"unexpected-indentation");else break;if(!this.looksLikeMapping())break;let u=this.parseMappingEntry(e);if(!u)break;!this.options.allowDuplicateKeys&&s.has(u.key.value)&&this.emitError(Jx("duplicateKey",'Duplicate key: "{0}"',u.key.value),u.key.startOffset,u.key.endOffset,"duplicate-key"),s.add(u.key.value),o.push(u)}let c=o.length>0?o[o.length-1].value.endOffset:n;return{type:"map",properties:o,style:"block",startOffset:n,endOffset:c}}parseMappingEntry(e){this.currentToken().type===9&&this.advance();let r=this.expect(0),n=this.scalarFromToken(r),o=this.expect(1);if(o.type!==1){this.emitError(Jx("expectedColon",'Expected ":"'),o.startOffset,o.endOffset,"expected-colon");return}let s=this.parseMappingValue(e,o);return{key:n,value:s}}parseMappingValue(e,r){let n=this.currentToken();if(n.type===4)return this.parseFlowMap();if(n.type===6)return this.parseFlowSeq();if(n.type===0){this.currentToken().type===9&&this.advance();let c=this.advance();return c.format!=="none"?this.scalarFromToken(c):this.parsePlainMultiline(c,e)}if(this.skipNewlinesAndComments(),this.currentToken().type===13)return this.emitError(Jx("missingValue","Missing value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset);let s=this.currentIndent();return s===e&&this.peekPastIndent().type===2?this.parseValue(e)??this.makeEmptyScalar(r.endOffset):s<=e?(this.emitError(Jx("missingValue","Missing value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset)):this.parseValue(e)??this.makeEmptyScalar(r.endOffset)}parseBlockSequence(e){let r=[],n=this.currentToken().startOffset,o=n,s=!0;for(;this.currentToken().type!==13&&(this.skipNewlinesAndComments(),this.currentToken().type!==13);){let c;if(s&&this.currentToken().type===2?c=this.currentToken().startOffset-this.getLineStart(this.currentToken().startOffset):c=this.currentIndent(),s=!1,ce)this.emitError(Jx("unexpectedIndentation","Unexpected indentation (expected {0}, got {1})",e,c),this.currentToken().startOffset,this.currentToken().endOffset,"unexpected-indentation");else break;if(this.peekPastIndent().type!==2)break;this.currentToken().type===9&&this.advance();let u=this.advance(),d=this.parseSequenceItemValue(e,u);r.push(d),o=d.endOffset}return{type:"sequence",items:r,style:"block",startOffset:n,endOffset:o}}parseSequenceItemValue(e,r){let n=this.currentToken();if(n.type===10&&this.advance(),n.type===4)return this.parseFlowMap();if(n.type===6)return this.parseFlowSeq();if(n.type===2){let s=n.startOffset-this.getLineStart(n.startOffset);return this.parseBlockSequence(s)}if(n.type===0){if(this.peek(1).type===1){let s=n.startOffset-this.getLineStart(n.startOffset);return this.parseBlockMapping(s,!0)}return this.parseScalar(e)}return this.skipNewlinesAndComments(),this.currentToken().type===13?(this.emitError(Jx("missingSeqItemValue","Missing sequence item value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset)):this.currentIndent()<=e?(this.emitError(Jx("missingSeqItemValue","Missing sequence item value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset)):this.parseValue(e)??this.makeEmptyScalar(r.endOffset)}getLineStart(e){let r=e-1;for(;r>=0&&this.input[r]!==` -`&&this.input[r]!=="\r";)r--;return r+1}parseFlowMap(){let e=this.advance(),r=[];for(this.skipFlowWhitespace();this.currentToken().type!==5&&this.currentToken().type!==13;){let o;if(this.currentToken().type===0)o=this.parseFlowScalar();else{this.emitError(Jx("expectedMappingKey","Expected mapping key"),this.currentToken().startOffset,this.currentToken().endOffset,"expected-key");break}this.skipFlowWhitespace();let s;this.currentToken().type===1?(this.advance(),this.skipFlowWhitespace(),s=this.parseFlowValue()):s=this.makeEmptyScalar(o.endOffset),r.push({key:o,value:s}),this.skipFlowWhitespace(),this.currentToken().type===3&&(this.advance(),this.skipFlowWhitespace())}let n=this.currentToken();return n.type===5?this.advance():this.emitError(Jx("expectedFlowMapEnd",'Expected "}"'),n.startOffset,n.endOffset,"expected-flow-map-end"),{type:"map",properties:r,style:"flow",startOffset:e.startOffset,endOffset:n.type===5?n.endOffset:n.startOffset}}parseFlowSeq(){let e=this.advance(),r=[];for(this.skipFlowWhitespace();this.currentToken().type!==7&&this.currentToken().type!==13;){let o;if(this.currentToken().type===4)o=this.parseFlowMap();else if(this.currentToken().type===6)o=this.parseFlowSeq();else if(this.currentToken().type===0)o=this.parseFlowScalar();else{this.emitError(Jx("unexpectedTokenInFlowSeq","Unexpected token in flow sequence"),this.currentToken().startOffset,this.currentToken().endOffset,"unexpected-token"),this.advance();continue}r.push(o),this.skipFlowWhitespace(),this.currentToken().type===3&&(this.advance(),this.skipFlowWhitespace())}let n=this.currentToken();return n.type===7?this.advance():this.emitError(Jx("expectedFlowSeqEnd",'Expected "]"'),n.startOffset,n.endOffset,"expected-flow-seq-end"),{type:"sequence",items:r,style:"flow",startOffset:e.startOffset,endOffset:n.type===7?n.endOffset:n.startOffset}}parseFlowScalar(){let e=this.advance();if(e.format!=="none")return this.scalarFromToken(e);let r=e.value,n=e.endOffset;for(;;){let o=!1,s=this.pos;for(;s=this.tokens.length)break;let c=this.tokens[s];if(c.type===0&&c.format==="none")this.pos=s+1,r+=" "+c.value,n=c.endOffset;else break}return{type:"scalar",value:r,rawValue:this.input.substring(e.startOffset,n),startOffset:e.startOffset,endOffset:n,format:"none"}}parseFlowValue(){return this.currentToken().type===4?this.parseFlowMap():this.currentToken().type===6?this.parseFlowSeq():this.currentToken().type===0?this.parseFlowScalar():this.makeEmptyScalar(this.currentToken().startOffset)}skipFlowWhitespace(){for(;;){let e=this.currentToken().type;if(e===8||e===9||e===10)this.advance();else break}}scalarFromToken(e){return{type:"scalar",value:e.value,rawValue:e.rawValue,startOffset:e.startOffset,endOffset:e.endOffset,format:e.format}}makeEmptyScalar(e){return{type:"scalar",value:"",rawValue:"",startOffset:e,endOffset:e,format:"none"}}};function OAn(t,e=[],r={}){let n=[],o=hUo(t,n,r),s=mUo(t);for(let c of n)e.push({message:c.message,code:c.code,start:uO(s,c.startOffset),end:uO(s,c.endOffset)});return o===void 0?void 0:CUt(s,o)}a(OAn,"parse");function mUo(t){let e=[0];for(let r=0;re)this.emitError(iw("unexpectedIndentation","Unexpected indentation (expected {0}, got {1})",e,l),this.currentToken().startOffset,this.currentToken().endOffset,"unexpected-indentation");else break;if(!this.looksLikeMapping())break;let u=this.parseMappingEntry(e);if(!u)break;!this.options.allowDuplicateKeys&&s.has(u.key.value)&&this.emitError(iw("duplicateKey",'Duplicate key: "{0}"',u.key.value),u.key.startOffset,u.key.endOffset,"duplicate-key"),s.add(u.key.value),o.push(u)}let c=o.length>0?o[o.length-1].value.endOffset:n;return{type:"map",properties:o,style:"block",startOffset:n,endOffset:c}}parseMappingEntry(e){this.currentToken().type===9&&this.advance();let r=this.expect(0),n=this.scalarFromToken(r),o=this.expect(1);if(o.type!==1){this.emitError(iw("expectedColon",'Expected ":"'),o.startOffset,o.endOffset,"expected-colon");return}let s=this.parseMappingValue(e,o);return{key:n,value:s}}parseMappingValue(e,r){let n=this.currentToken();if(n.type===4)return this.parseFlowMap();if(n.type===6)return this.parseFlowSeq();if(n.type===0){this.currentToken().type===9&&this.advance();let c=this.advance();return c.format!=="none"?this.scalarFromToken(c):this.parsePlainMultiline(c,e)}if(this.skipNewlinesAndComments(),this.currentToken().type===13)return this.emitError(iw("missingValue","Missing value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset);let s=this.currentIndent();return s===e&&this.peekPastIndent().type===2?this.parseValue(e)??this.makeEmptyScalar(r.endOffset):s<=e?(this.emitError(iw("missingValue","Missing value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset)):this.parseValue(e)??this.makeEmptyScalar(r.endOffset)}parseBlockSequence(e){let r=[],n=this.currentToken().startOffset,o=n,s=!0;for(;this.currentToken().type!==13&&(this.skipNewlinesAndComments(),this.currentToken().type!==13);){let c;if(s&&this.currentToken().type===2?c=this.currentToken().startOffset-this.getLineStart(this.currentToken().startOffset):c=this.currentIndent(),s=!1,ce)this.emitError(iw("unexpectedIndentation","Unexpected indentation (expected {0}, got {1})",e,c),this.currentToken().startOffset,this.currentToken().endOffset,"unexpected-indentation");else break;if(this.peekPastIndent().type!==2)break;this.currentToken().type===9&&this.advance();let u=this.advance(),d=this.parseSequenceItemValue(e,u);r.push(d),o=d.endOffset}return{type:"sequence",items:r,style:"block",startOffset:n,endOffset:o}}parseSequenceItemValue(e,r){let n=this.currentToken();if(n.type===10&&this.advance(),n.type===4)return this.parseFlowMap();if(n.type===6)return this.parseFlowSeq();if(n.type===2){let s=n.startOffset-this.getLineStart(n.startOffset);return this.parseBlockSequence(s)}if(n.type===0){if(this.peek(1).type===1){let s=n.startOffset-this.getLineStart(n.startOffset);return this.parseBlockMapping(s,!0)}return this.parseScalar(e)}return this.skipNewlinesAndComments(),this.currentToken().type===13?(this.emitError(iw("missingSeqItemValue","Missing sequence item value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset)):this.currentIndent()<=e?(this.emitError(iw("missingSeqItemValue","Missing sequence item value"),r.startOffset,r.endOffset,"missing-value"),this.makeEmptyScalar(r.endOffset)):this.parseValue(e)??this.makeEmptyScalar(r.endOffset)}getLineStart(e){let r=e-1;for(;r>=0&&this.input[r]!==` +`&&this.input[r]!=="\r";)r--;return r+1}parseFlowMap(){let e=this.advance(),r=[];for(this.skipFlowWhitespace();this.currentToken().type!==5&&this.currentToken().type!==13;){let o;if(this.currentToken().type===0)o=this.parseFlowScalar();else{this.emitError(iw("expectedMappingKey","Expected mapping key"),this.currentToken().startOffset,this.currentToken().endOffset,"expected-key");break}this.skipFlowWhitespace();let s;this.currentToken().type===1?(this.advance(),this.skipFlowWhitespace(),s=this.parseFlowValue()):s=this.makeEmptyScalar(o.endOffset),r.push({key:o,value:s}),this.skipFlowWhitespace(),this.currentToken().type===3&&(this.advance(),this.skipFlowWhitespace())}let n=this.currentToken();return n.type===5?this.advance():this.emitError(iw("expectedFlowMapEnd",'Expected "}"'),n.startOffset,n.endOffset,"expected-flow-map-end"),{type:"map",properties:r,style:"flow",startOffset:e.startOffset,endOffset:n.type===5?n.endOffset:n.startOffset}}parseFlowSeq(){let e=this.advance(),r=[];for(this.skipFlowWhitespace();this.currentToken().type!==7&&this.currentToken().type!==13;){let o;if(this.currentToken().type===4)o=this.parseFlowMap();else if(this.currentToken().type===6)o=this.parseFlowSeq();else if(this.currentToken().type===0)o=this.parseFlowScalar();else{this.emitError(iw("unexpectedTokenInFlowSeq","Unexpected token in flow sequence"),this.currentToken().startOffset,this.currentToken().endOffset,"unexpected-token"),this.advance();continue}r.push(o),this.skipFlowWhitespace(),this.currentToken().type===3&&(this.advance(),this.skipFlowWhitespace())}let n=this.currentToken();return n.type===7?this.advance():this.emitError(iw("expectedFlowSeqEnd",'Expected "]"'),n.startOffset,n.endOffset,"expected-flow-seq-end"),{type:"sequence",items:r,style:"flow",startOffset:e.startOffset,endOffset:n.type===7?n.endOffset:n.startOffset}}parseFlowScalar(){let e=this.advance();if(e.format!=="none")return this.scalarFromToken(e);let r=e.value,n=e.endOffset;for(;;){let o=!1,s=this.pos;for(;s=this.tokens.length)break;let c=this.tokens[s];if(c.type===0&&c.format==="none")this.pos=s+1,r+=" "+c.value,n=c.endOffset;else break}return{type:"scalar",value:r,rawValue:this.input.substring(e.startOffset,n),startOffset:e.startOffset,endOffset:n,format:"none"}}parseFlowValue(){return this.currentToken().type===4?this.parseFlowMap():this.currentToken().type===6?this.parseFlowSeq():this.currentToken().type===0?this.parseFlowScalar():this.makeEmptyScalar(this.currentToken().startOffset)}skipFlowWhitespace(){for(;;){let e=this.currentToken().type;if(e===8||e===9||e===10)this.advance();else break}}scalarFromToken(e){return{type:"scalar",value:e.value,rawValue:e.rawValue,startOffset:e.startOffset,endOffset:e.endOffset,format:e.format}}makeEmptyScalar(e){return{type:"scalar",value:"",rawValue:"",startOffset:e,endOffset:e,format:"none"}}};function uEn(t,e=[],r={}){let n=[],o=yQo(t,n,r),s=EQo(t);for(let c of n)e.push({message:c.message,code:c.code,start:gO(s,c.startOffset),end:gO(s,c.endOffset)});return o===void 0?void 0:h7t(s,o)}a(uEn,"parse");function EQo(t){let e=[0];for(let r=0;r>1;t[s]<=e?(o=s,r=s+1):n=s-1}return{line:o,character:e-t[o]}}a(uO,"offsetToPosition");function CUt(t,e){switch(e.type){case"scalar":return gUo(t,e);case"sequence":return{type:"array",items:e.items.map(r=>CUt(t,r)),start:uO(t,e.startOffset),end:uO(t,e.endOffset)};case"map":return{type:"object",properties:e.properties.map(r=>({key:AUo(t,r.key),value:CUt(t,r.value)})),start:uO(t,e.startOffset),end:uO(t,e.endOffset)}}}a(CUt,"convertNode");function gUo(t,e){let r=uO(t,e.startOffset),n=uO(t,e.endOffset);if(e.format==="none"){let o=e.value;if(o==="true")return{type:"boolean",value:!0,start:r,end:n};if(o==="false")return{type:"boolean",value:!1,start:r,end:n};if(o==="null"||o==="~")return{type:"null",value:null,start:r,end:n};if(o!==""&&/^-?\d*\.?\d+$/.test(o)){let s=Number(o);if(!isNaN(s)&&isFinite(s))return{type:"number",value:s,start:r,end:n}}}return{type:"string",value:e.value,start:r,end:n}}a(gUo,"convertScalar");function AUo(t,e){return{type:"string",value:e.value,start:uO(t,e.startOffset),end:uO(t,e.endOffset)}}a(AUo,"convertScalarAsString");var LP=de(eh());var dO=class{static{a(this,"PromptsParser")}constructor(){}parse(e,r){let n=this.#t(r);if(n.length===0)return new jze(e,void 0,void 0);let o,s,c=0;if(n[0].match(/^---[\s\r\n]*$/)){let l=n.findIndex((d,f)=>f>0&&d.match(/^---[\s\r\n]*$/));l===-1?(l=n.length,c=n.length):c=l+1;let u=new LP.Range(2,1,l+1,1);o=new TUt(u,n),this.#e(o,n)}if(cs>0&&o.match(/^---[\s\r\n]*$/))||e.pushError({message:"Missing closing `---` delimiter for frontmatter",range:e.range,code:"MISSING_CLOSING_DELIMITER"})}#t(e){let r=[],n=e.split(/(\r\n|\r|\n)/);for(let o=0;o({message:c.message,range:this.asRange(c),code:c.code}));if(n)if(n.type!=="object")s.push({message:"Invalid header, expecting pairs",range:this.range,code:"INVALID_YAML"});else for(let c of n.properties)o.push({key:c.key.value,range:this.asRange({start:c.key.start,end:c.value.end}),value:this.asValue(c.value)});this._parsed={node:n,attributes:o,errors:s}}return this._parsed}asRange({start:e,end:r}){return new LP.Range(this.range.startLineNumber+e.line,e.character+1,this.range.startLineNumber+r.line,r.character+1)}asValue(e){switch(e.type){case"string":return{type:"string",value:e.value,range:this.asRange(e)};case"number":return{type:"number",value:e.value,range:this.asRange(e)};case"boolean":return{type:"boolean",value:e.value,range:this.asRange(e)};case"null":return{type:"null",value:e.value,range:this.asRange(e)};case"array":return{type:"array",items:e.items.map(r=>this.asValue(r)),range:this.asRange(e)};case"object":return{type:"object",properties:e.properties.map(n=>({key:this.asValue(n.key),value:this.asValue(n.value)})),range:this.asRange(e)}}}get attributes(){return this._parsedHeader.attributes}getAttribute(e){return this._parsedHeader.attributes.find(r=>r.key===e)}get errors(){return this._parsedHeader.errors}pushError(e){this._parsedHeader.errors.unshift(e)}getStringAttribute(e){let r=this._parsedHeader.attributes.find(n=>n.key===e);if(r?.value.type==="string")return r.value.value}get name(){return this.getStringAttribute("name")}get description(){return this.getStringAttribute("description")}get agent(){return this.getStringAttribute("agent")??this.getStringAttribute("mode")}get model(){return this.getStringAttribute("model")}get applyTo(){return this.getStringAttribute("applyTo")}get invokePolicy(){let e=this._parsedHeader.attributes.find(r=>r.key===EUo);if(e?.value.type==="array"){let r=[];for(let n of e.value.items)n.type==="string"&&n.value&&r.push(n.value);return r}}get tools(){let e=this._parsedHeader.attributes.find(r=>r.key==="tools");if(e){if(e.value.type==="array"){let r=[];for(let n of e.value.items)n.type==="string"&&n.value&&r.push(n.value);return r}else if(e.value.type==="object"){let r=[],n=a(({key:o,value:s})=>{s.type==="boolean"?r.push(o.value):s.type==="object"&&s.properties.forEach(n)},"collectLeafs");return e.value.properties.forEach(n),r}}}get handOffs(){let e=this._parsedHeader.attributes.find(r=>r.key==="handoffs");if(e&&e.value.type==="array"){let r=[];for(let n of e.value.items)if(n.type==="object"){let o,s,c,l;for(let u of n.properties)u.key.value==="agent"&&u.value.type==="string"?o=u.value.value:u.key.value==="label"&&u.value.type==="string"?s=u.value.value:u.key.value==="prompt"&&u.value.type==="string"?c=u.value.value:u.key.value==="send"&&u.value.type==="boolean"&&(l=u.value.value);o&&s&&c!==void 0&&r.push({agent:o,label:s,prompt:c,send:l})}return r}}},IUt=class{constructor(e,r,n){this.range=e;this.linesWithEOL=r;this.uri=n}static{a(this,"PromptBody")}get fileReferences(){return this.getParsedBody().fileReferences}get variableReferences(){return this.getParsedBody().variableReferences}get offset(){return this.getParsedBody().bodyOffset}getParsedBody(){if(this._parsed===void 0){let e=[],r=[],n=[],o=this.linesWithEOL.slice(0,this.range.startLineNumber-1).reduce((s,c)=>c.length+s,0);for(let s=this.range.startLineNumber-1,c=o;sLP.Range.areIntersectingOrTouching(A,m)))continue;let g=h[1];if(g){if(g==="file:"){let A=h.index+h[0].length-h[2].length,y=h.index+h[0].length,E=new LP.Range(s+1,A+1,s+1,y+1);r.push({content:h[2],range:E,isMarkdownLink:!1})}}else{let A=h.index+1,y=h.index+h[0].length,E=new LP.Range(s+1,A+1,s+1,y+1);n.push({name:h[2],range:E,offset:c+h.index})}}c+=l.length}this._parsed={fileReferences:r.sort((s,c)=>LP.Range.compareRangesUsingStarts(s.range,c.range)),variableReferences:n,bodyOffset:o}}return this._parsed}get content(){return this._content===void 0&&(this._content=this.linesWithEOL.slice(this.range.startLineNumber-1,this.range.endLineNumber-1).join("").trim()),this._content}};p();var _Uo=new Set(["sessionStart","sessionEnd","userPromptSubmitted","preToolUse","postToolUse","errorOccurred"]),vUo="agentHook.event.load",Hze=class{constructor(){this.logger=new fe("HookParser")}static{a(this,"HookParser")}parse(e,r,n){let o=JSON.parse(n);if(o.version!==1)throw new Error(`Unsupported hooks config version: ${String(o.version)}`);if(o.hooks===void 0||typeof o.hooks!="object"||o.hooks===null)throw new Error("Invalid or missing hooks section");let s=o,c={};for(let[l,u]of Object.entries(s.hooks)){if(!this.isValidEventType(l)){this.logger.warn(e,`Invalid event type: ${l} in ${r}`);continue}let d=Array.isArray(u)?u:[],f=[];for(let h of d)this.isValidHook(h)?f.push(h):this.logger.warn(e,`Invalid hook configuration in ${r}: ${JSON.stringify(h)}`);c[l]=f}return At(e,vUo,this.buildHookCountsByEventType(c)),{uri:r,version:1,hooks:c}}buildHookCountsByEventType(e){let r={};for(let[n,o]of Object.entries(e))o!==void 0&&(r[`${n}.hookCount`]=String(o.length));return r}isValidEventType(e){return _Uo.has(e)}isValidHook(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="command"&&("bash"in e&&typeof e.bash=="string"||"powershell"in e&&typeof e.powershell=="string")}};p();var BAn=require("os");var CUo=(0,BAn.platform)()==="win32",tp=class{constructor(){this.trustByUri=new Map;this.emitter=new Wi;this.onDidChangeTrust=this.emitter.event;this.capabilityEnabled=!1}static{a(this,"WorkspaceTrustService")}setCapabilityEnabled(e){this.capabilityEnabled=e}setTrust(e,r){let n=this.normalizeKey(e),o=this.trustByUri.get(n);if(this.trustByUri.set(n,r),o===r)return;let s=`${n}/`,c=[];for(let l of this.trustByUri.keys())l.startsWith(s)&&c.push(l);for(let l of c)this.trustByUri.delete(l);this.emitter.fire({folderUri:n,trusted:r});for(let l of c)this.emitter.fire({folderUri:l,trusted:this.isTrustedInternal(l)})}forget(e){let r=this.normalizeKey(e);this.trustByUri.delete(r)&&this.emitter.fire({folderUri:r,trusted:this.isTrustedInternal(r)})}isTrusted(e){return this.capabilityEnabled?this.isTrustedInternal(this.normalizeKey(e)):!0}isTrustedInternal(e){let r=e.indexOf("://"),n=r>=0?r+3:0,o=e;for(;o.length>n;){let s=this.trustByUri.get(o);if(s!==void 0)return s;let c=o.lastIndexOf("/");if(cthis.handleChange(f));for(let f of xUt)this.rewatch(f);this.registrySubscription=o.onLocationsChanged(f=>{for(let h of f.affectedTypes)this.rewatch(h)});let c=a(f=>{this.evictFolder(f),this.rewatchAll()},"onWorkspaceRemoved"),l=a(()=>{this.rewatchAll()},"onWorkspaceAdded");this.workspaceListener=new class extends HQ{isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}didAddWorkspace(){l()}didRemoveWorkspace(f){c(f)}},e.get(US).addListener(this.workspaceListener);let u,d=a(()=>{let f=u;if(u=void 0,!(!f||this.disposed)){for(let h of f)this.evictFolder({uri:h});this.rewatchAll();for(let h of xUt)this.notifyChange(h)}},"flushPending");this.trustSubscription=e.get(tp).onDidChangeTrust(f=>{u===void 0&&(u=new Set,queueMicrotask(d)),u.add(f.folderUri)})}static{a(this,"PromptService")}async collect(e,r,n,o){let s=e.get(tp),c=n.filter(h=>s.isTrusted(h.uri)),l=await this.fileLocator.listFiles(e,c,r),u=o?.includePlugins?l:l.filter(h=>h.classification.storage!=="plugin"),f=(await Promise.all(u.map(h=>this.resolveEntry(e,r,h)))).filter(h=>h!==void 0);return o?.includePlugins?f:f.filter(h=>h.promptPath.storage!=="plugin")}async resolveEntry(e,r,n){let o=FAn(r,n.uri);if(n.cacheable){let l=this.entryCache.get(o);if(l){let d=await this.fsMtime(e,n.uri);if(d!==void 0&&d===l.timestamp)return l.entry;this.invalidateKey(o)}let u=this.parseInflight.get(o);if(u)return u}let s=this.buildPromptPath(r,n),c=this.parseOne(e,s).then(l=>{if(l===void 0)return;let u={promptPath:s,parsedPromptFile:l};return n.cacheable&&!this.disposed&&this.parseInflight.get(o)===c&&this.entryCache.set(o,{entry:u,timestamp:n.timestamp}),u});return n.cacheable&&(this.parseInflight.set(o,c),c.finally(()=>{this.parseInflight.get(o)===c&&this.parseInflight.delete(o)})),c}async fsMtime(e,r){try{return(await e.get(Qo).stat(r)).mtime}catch{return}}buildPromptPath(e,r){let{classification:n}=r;return n.storage==="plugin"?{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata,name:n.pluginInfo.name,description:n.pluginInfo.description,pluginUri:n.pluginInfo.pluginUri}:n.storage==="extension"||n.storage==="clsAssets"?{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata,name:n.extensionInfo.name,description:n.extensionInfo.description,extensionId:n.extensionInfo.extensionId}:{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata}}async dispose(){if(!this.disposed){this.disposed=!0,this.registrySubscription.dispose(),this.mergedChangeSubscription.dispose(),this.trustSubscription.dispose();try{this.ctx.get(US).removeListener(this.workspaceListener)}catch{}for(let e of this.watchHandles.values())e.dispose();this.watchHandles.clear(),this.entryCache.clear(),this.parseInflight.clear(),this.ownsWatcher&&await this.watcher.dispose()}}async parseOne(e,r){let n=this.parsers.get(r.type);if(!n){this.logger.warn(e,`No parser registered for type ${r.type} (uri: ${r.uri})`);return}try{return await n.parse(e,r.uri,await e.get(Qo).readFileString(r.uri))}catch(o){this.logger.warn(e,`Failed to parse ${r.type} file ${r.uri}:`,o);return}}handleChange(e){let r=new Set,n=!1;for(let o of e.changes)o.path?r.add(o.path):n=!0;for(let o of e.affectedTypes){if(n)this.clearType(o);else for(let s of r)this.invalidateKey(FAn(o,Ks(s)));this.notifyChange(o)}}notifyChange(e){try{this.ctx.get(a0).notify(e).catch(r=>{this.logger.warn(this.ctx,`PromptChangeNotifier.notify(${e}) failed:`,r)})}catch(r){this.logger.warn(this.ctx,`PromptChangeNotifier.notify(${e}) failed:`,r)}}invalidateKey(e){this.entryCache.delete(e),this.parseInflight.delete(e)}clearType(e){let r=bUo(e),n=new Set;for(let o of this.entryCache.keys())o.startsWith(r)&&n.add(o);for(let o of this.parseInflight.keys())o.startsWith(r)&&n.add(o);for(let o of n)this.invalidateKey(o)}rewatch(e){if(this.disposed)return;let r=this.ctx.get(wA),n=this.currentWorkspacePaths(),o=r.resolvePatterns(e,n,!0).map(l=>l.pattern),s=this.watchHandles.get(e);if(o.length===0){s&&(s.dispose(),this.watchHandles.delete(e));return}let c=this.watcher.watch(e,o,s);this.watchHandles.set(e,c)}rewatchAll(){for(let e of xUt)this.rewatch(e)}evictFolder(e){let r=e.uri.endsWith("/")?e.uri:`${e.uri}/`;for(let[n,o]of this.entryCache){let s=o.entry.promptPath.uri;(s===e.uri||s.startsWith(r))&&this.invalidateKey(n)}}currentWorkspacePaths(){let e;try{let o=this.ctx.get(tp);e=this.ctx.get($r).getWorkspaceFolders().filter(s=>o.isTrusted(s.uri)).map(s=>un(s.uri))}catch{return[]}let r=e.map(o=>({raw:o,normalized:o.replace(/\\/g,"/")})).sort((o,s)=>o.normalized.length-s.normalized.length),n=[];for(let o of r)n.some(s=>Kx(s.normalized,o.normalized,OC))||n.push(o);return n.map(o=>o.raw)}};p();var jl=class{constructor(){this.policyChangeEmitter=new ep;this.onDidChangePolicy=this.policyChangeEmitter.event}static{a(this,"PolicyWatcher")}},Gze=class extends jl{static{a(this,"NoOpPolicyWatcher")}getPolicyValue(e){}};p();var wUt=64;var P3=(r=>(r.enabled="enabled",r.disabled="disabled",r))(P3||{}),dg={id:"copilot",displayName:"Copilot Language Server",description:"Copilot Language Server tool provider",isFirstPartyTool:!0},rp={id:"copilot-editor",displayName:"Editor",description:"Editor tool provider",isFirstPartyTool:!0},EK=class{static{a(this,"LanguageModelTool")}constructor(e){this.type=e.type,this.toolProvider=e.toolProvider,this.name=e.name,this.displayName=e.displayName??this.name,this.description=e.description,this.displayDescription=e.displayDescription??this.description,this.inputSchema=e.inputSchema,this.annotations=e.annotations,this.id=`${this.toolProvider.id}.${this.name}`,this.nameForModel=(this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.displayNamePrefix??this.toolProvider.id}_${this.name}`).replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,wUt),this.status=e.status??"enabled",this.configurationKey=this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.id}/${this.name}`}isEnabled(e){return Promise.resolve(!0)}},YQ=class extends EK{static{a(this,"BaseLanguageModelTool")}constructor(e){super(e)}},Rr=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}},KQ=class{static{a(this,"LanguageModelDataPart")}constructor(e){this.value=e}},_K=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};var Lr=class{static{a(this,"LanguageModelToolResult")}constructor(e,r){this.status=r,this.content=e}},JQ=class extends Lr{static{a(this,"ExtendedLanguageModelToolResult")}},UAn=S.Object({content:S.Array(S.Union([S.Object({value:S.String()}),S.Object({value:S.Unknown()})])),status:S.Optional(S.Union([S.Literal("success"),S.Literal("error"),S.Literal("cancelled")]))}),D3=(r=>(r.Accept="accept",r.Dismiss="dismiss",r))(D3||{}),QAn=S.Object({result:S.Enum(D3)});var RUt=de(require("fs"));var YIe=de(require("path"));var PUt=["user","model"],DUt="source",NUt={githubOrg:"github-org"},Ggn={githubOrg:{[DUt]:NUt.githubOrg}},kUt=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._id=n.uri;let o=n.header?.name?.trim()||void 0;this._name=r.name??o??Ji(n.uri).replace(/\.(agent\.)?md$/i,"")}static{a(this,"CustomAgent")}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get id(){return this._id}get name(){return this._name}get description(){return this.parsedPromptFile.header?.description}get tools(){return this.parsedPromptFile.header?.tools}get model(){return this.parsedPromptFile.header?.model}get handOffs(){return this.parsedPromptFile.header?.handOffs}get instruction(){return this.parsedPromptFile.body?.content}get isReadonly(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||qle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get invokePolicy(){return this.parsedPromptFile.header?.invokePolicy??PUt}get extensionId(){let e=this.promptFileEntry.promptPath;if(e.storage==="extension"||e.storage==="clsAssets")return e.extensionId}get pluginUri(){return zQ(this.promptFileEntry.promptPath)}get source(){let e=this.promptFileEntry.promptPath.metadata;if(!e)return;let r=new Set(Object.values(NUt));for(let n of e){let o=n[DUt];if(typeof o=="string"&&r.has(o))return o}}get providers(){return x3(this.promptFileEntry.promptPath.metadata)}},qAn="./assets/prompts.contributions.json",HAn="CVE Remediator",SUo="Debugger",jAn=new Map([[HAn,"cveRemediatorAgent"],[SUo,"debuggerAgent"]]),TUo=new Map([[HAn,["LOCAL"]]]),Ld=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.logger=new fe("CustomAgentService");this.agentUpdateSequencer=new Vx;this.extensionAgents=new Map;this.agentsByExtension=new Map;this.agentFileLocationsPatterns=[];this.runtimeSources=[];this.gateSubscriptions=[];this.lastGatedCapabilities={};this.syncRegistry(),this.registerClaudeAgentPatterns(),this.ready=this.loadAssetsContributions(e),this.subscribeToGateChanges()}static{a(this,"CustomAgentService")}static{this.DEFAULT_AGENT_REGISTRATIONS=[".github/agents/**/*.agent.md",".claude/agents/**/*.agent.md","~/.copilot/agents/**/*.agent.md"]}static{this.AGENT_GLOB_SUFFIX="**/*.agent.md"}static{this.CLAUDE_AGENT_PATTERNS=[".claude/agents/**/*.md","~/.claude/agents/**/*.md"]}registerClaudeAgentPatterns(){this.promptFileLocationRegistry.register("agent",[...t.CLAUDE_AGENT_PATTERNS],{metadata:{providers:["CLAUDE"]}})}registerRuntimeAgentSource(e){return this.runtimeSources.push(e),{dispose:a(()=>{let r=this.runtimeSources.indexOf(e);r>=0&&this.runtimeSources.splice(r,1)},"dispose")}}subscribeToGateChanges(){try{let e=this.ctx.get(Lo);this.lastEnableCustomAgents=Ft(this.ctx,Ye.EnableCustomAgents),this.lastEnableOrgCustomAgents=Ft(this.ctx,Ye.EnableOrgCustomAgents),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Ft(this.ctx,Ye.EnableCustomAgents),n=Ft(this.ctx,Ye.EnableOrgCustomAgents);r===this.lastEnableCustomAgents&&n===this.lastEnableOrgCustomAgents||(this.lastEnableCustomAgents=r,this.lastEnableOrgCustomAgents=n,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(jl);this.lastCustomAgentPolicyEnabled=e.getPolicyValue("customAgent.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customAgent.enabled");r!==this.lastCustomAgentPolicyEnabled&&(this.lastCustomAgentPolicyEnabled=r,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(bn),r=Array.from(new Set(jAn.values())),n=a(o=>{let s={};for(let c of r)s[c]=o[c];return s},"snapshotGated");this.lastGatedCapabilities=n(e.getCapabilities()),this.gateSubscriptions.push(e.onDidSetCapabilities(o=>{let s=n(o);r.every(c=>s[c]===this.lastGatedCapabilities[c])||(this.lastGatedCapabilities=s,this.notifyAgentListChanged())}))}catch{}}notifyAgentListChanged(){try{this.ctx.get(a0).notify("agent").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(agent) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(agent) failed:",e)}}dispose(){for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0}syncRegistry(){let e=new Set(t.DEFAULT_AGENT_REGISTRATIONS);for(let r of this.agentFileLocationsPatterns)e.add(r);this.registryAgentPatterns=this.promptFileLocationRegistry.replace(this.registryAgentPatterns,"agent",Array.from(e),{metadata:{providers:["LOCAL","BACKGROUND"]}})}setAgentFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(un(n.uri)):n.type==="location"&&r.add(YIe.default.posix.join(n.path,t.AGENT_GLOB_SUFFIX));this.agentFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listCustomAgents(e,r){if(this.ctx.get(jl).getPolicyValue("customAgent.enabled")===!1)return[];await this.ready;let s=(await this.ctx.get(ug).collect(this.ctx,"agent",e,{includePlugins:r?.includePlugins})).map(m=>new kUt(m)),c=this.ctx.get(w3),l=Ft(this.ctx,Ye.EnableOrgCustomAgents)!==!1,u=this.ctx.get(bn).getCapabilities(),d=s.filter(m=>{let g=m.promptFileEntry?.parsedPromptFile.header?.errors;if(g&&g.length>0){let E=g[0];return this.logger.warn(this.ctx,`Ignoring custom agent ${m.promptFileEntry?.promptPath.uri}: invalid frontmatter (${E.code}: ${E.message})`),!1}if(this.isOrgScopedAgent(m)){if(!l)return!1;let E=m.promptFileEntry?.parsedPromptFile.uri,_=E?rs(E):void 0;if(!_||!c.isCachedAgentVisibleFor(_,e))return!1}let A=jAn.get(m.name);if(A===void 0)return!0;let y=u[A]??!1;return y||this.logger.debug(this.ctx,`Filtering out agent '${m.name}' (capability '${A}' is disabled)`),y});if(!r?.includeRuntimeAgents||this.runtimeSources.length===0)return d;let f=new Set(d.map(m=>m.name.toLowerCase())),h=[];for(let m of this.runtimeSources){let g;try{g=await m.getAgents(e)}catch(A){this.logger.warn(this.ctx,"RuntimeAgentSource.getAgents failed:",A);continue}for(let A of g){let y=A.name.toLowerCase();f.has(y)||(f.add(y),h.push(A))}}return[...d,...h]}isOrgScopedAgent(e){let r=e.promptFileEntry?.promptPath.metadata;return r?r.some(n=>n[DUt]===NUt.githubOrg):!1}async getCustomAgentById(e,r){return(await this.listCustomAgents(e)).find(o=>o.id===r)}registerExtensionAgent(e,r){let n=[];for(let o of r){if(this.extensionAgents.has(o.uri))continue;let s=this.promptFileLocationRegistry.register("agent",[un(o.uri)],{watchable:!1,classification:{storage:"extension",extensionInfo:{name:o.name,description:o.description,extensionId:e}}}),c=o.uri,l={dispose:a(()=>{s.dispose(),this.extensionAgents.delete(c),this.agentsByExtension.get(e)?.delete(c),this.agentsByExtension.get(e)?.size===0&&this.agentsByExtension.delete(e)},"dispose")};this.extensionAgents.set(c,l);let u=this.agentsByExtension.get(e);u||(u=new Set,this.agentsByExtension.set(e,u)),u.add(c),n.push(c)}return{dispose:a(()=>{for(let o of n)this.extensionAgents.get(o)?.dispose()},"dispose")}}unregisterExtensionAgents(e){let r=this.agentsByExtension.get(e);if(r)for(let n of[...r])this.extensionAgents.get(n)?.dispose()}resolveAssetsPath(e){let r=YIe.default.extname(__filename)===".ts"?YIe.default.resolve(__dirname,"../../../..",e):YIe.default.resolve(__dirname,e);return this.logger.debug(this.ctx,`Resolved assets path: ${r}`),r}async loadAssetsContributions(e){try{let r=this.resolveAssetsPath(qAn),n=await RUt.promises.readFile(r,"utf8"),s=JSON.parse(n).chatAgents||[];for(let c of s)if(c.name&&c.description&&c.path){let l=this.resolveAssetsPath(c.path),u=TUo.get(c.name);this.promptFileLocationRegistry.register("agent",[l],{watchable:!1,classification:{storage:"clsAssets",extensionInfo:{name:c.name,description:c.description}},...u?{metadata:{providers:[...u]}}:{}})}}catch(r){this.logger.warn(e,`Failed to read assets contribution file ${qAn}:`,r)}}async updateCustomAgent(e,r){if(e.isReadonly)throw new Error(`Cannot update readonly agent: ${e.name}`);await this.agentUpdateSequencer.queue(e.id,async()=>{await this.performUpdateCustomAgent(e,r)})}async performUpdateCustomAgent(e,r){let n=[];a(l=>{l&&n.push(l)},"addIfNotUndefined")(this.updateCustomAgentTools(e,r.updateToolOptions));let s,c=e.promptFileEntry?.parsedPromptFile;if(!c)throw new Error("Cannot update agent: parsedPromptFile is undefined");if(n.forEach(l=>{let u=l(c);u!==void 0&&(s={...s||{},...u})}),s!==void 0){let l={...this.extractHeader(c.header),...s},u="";if(c.header){let m=[];for(let g of c.header.attributes){let A=g.key,y=l[A];if(y!==void 0)if(A==="tools"&&Array.isArray(y)){let E=y.map(_=>JSON.stringify(_).slice(1,-1)).map(_=>`'${_}'`).join(", ");m.push(`tools: [${E}]`)}else{let E=fK({[A]:y}).trim();m.push(E)}}u=m.join(` +`&&r++,e.push(r+1))}return e}a(EQo,"computeLineStartOffsets");function gO(t,e){let r=0,n=t.length-1,o=0;for(;r<=n;){let s=r+n>>1;t[s]<=e?(o=s,r=s+1):n=s-1}return{line:o,character:e-t[o]}}a(gO,"offsetToPosition");function h7t(t,e){switch(e.type){case"scalar":return _Qo(t,e);case"sequence":return{type:"array",items:e.items.map(r=>h7t(t,r)),start:gO(t,e.startOffset),end:gO(t,e.endOffset)};case"map":return{type:"object",properties:e.properties.map(r=>({key:vQo(t,r.key),value:h7t(t,r.value)})),start:gO(t,e.startOffset),end:gO(t,e.endOffset)}}}a(h7t,"convertNode");function _Qo(t,e){let r=gO(t,e.startOffset),n=gO(t,e.endOffset);if(e.format==="none"){let o=e.value;if(o==="true")return{type:"boolean",value:!0,start:r,end:n};if(o==="false")return{type:"boolean",value:!1,start:r,end:n};if(o==="null"||o==="~")return{type:"null",value:null,start:r,end:n};if(o!==""&&/^-?\d*\.?\d+$/.test(o)){let s=Number(o);if(!isNaN(s)&&isFinite(s))return{type:"number",value:s,start:r,end:n}}}return{type:"string",value:e.value,start:r,end:n}}a(_Qo,"convertScalar");function vQo(t,e){return{type:"string",value:e.value,start:gO(t,e.startOffset),end:gO(t,e.endOffset)}}a(vQo,"convertScalarAsString");var $P=fe(nh());var AO=class{static{a(this,"PromptsParser")}constructor(){}parse(e,r){let n=this.#t(r);if(n.length===0)return new mYe(e,void 0,void 0);let o,s,c=0;if(n[0].match(/^---[\s\r\n]*$/)){let l=n.findIndex((d,f)=>f>0&&d.match(/^---[\s\r\n]*$/));l===-1?(l=n.length,c=n.length):c=l+1;let u=new $P.Range(2,1,l+1,1);o=new A7t(u,n),this.#e(o,n)}if(cs>0&&o.match(/^---[\s\r\n]*$/))||e.pushError({message:"Missing closing `---` delimiter for frontmatter",range:e.range,code:"MISSING_CLOSING_DELIMITER"})}#t(e){let r=[],n=e.split(/(\r\n|\r|\n)/);for(let o=0;o({message:c.message,range:this.asRange(c),code:c.code}));if(n)if(n.type!=="object")s.push({message:"Invalid header, expecting pairs",range:this.range,code:"INVALID_YAML"});else for(let c of n.properties)o.push({key:c.key.value,range:this.asRange({start:c.key.start,end:c.value.end}),value:this.asValue(c.value)});this._parsed={node:n,attributes:o,errors:s}}return this._parsed}asRange({start:e,end:r}){return new $P.Range(this.range.startLineNumber+e.line,e.character+1,this.range.startLineNumber+r.line,r.character+1)}asValue(e){switch(e.type){case"string":return{type:"string",value:e.value,range:this.asRange(e)};case"number":return{type:"number",value:e.value,range:this.asRange(e)};case"boolean":return{type:"boolean",value:e.value,range:this.asRange(e)};case"null":return{type:"null",value:e.value,range:this.asRange(e)};case"array":return{type:"array",items:e.items.map(r=>this.asValue(r)),range:this.asRange(e)};case"object":return{type:"object",properties:e.properties.map(n=>({key:this.asValue(n.key),value:this.asValue(n.value)})),range:this.asRange(e)}}}get attributes(){return this._parsedHeader.attributes}getAttribute(e){return this._parsedHeader.attributes.find(r=>r.key===e)}get errors(){return this._parsedHeader.errors}pushError(e){this._parsedHeader.errors.unshift(e)}getStringAttribute(e){let r=this._parsedHeader.attributes.find(n=>n.key===e);if(r?.value.type==="string")return r.value.value}get name(){return this.getStringAttribute("name")}get description(){return this.getStringAttribute("description")}get agent(){return this.getStringAttribute("agent")??this.getStringAttribute("mode")}get model(){return this.getStringAttribute("model")}get applyTo(){return this.getStringAttribute("applyTo")}get invokePolicy(){let e=this._parsedHeader.attributes.find(r=>r.key===bQo);if(e?.value.type==="array"){let r=[];for(let n of e.value.items)n.type==="string"&&n.value&&r.push(n.value);return r}}get tools(){let e=this._parsedHeader.attributes.find(r=>r.key==="tools");if(e){if(e.value.type==="array"){let r=[];for(let n of e.value.items)n.type==="string"&&n.value&&r.push(n.value);return r}else if(e.value.type==="object"){let r=[],n=a(({key:o,value:s})=>{s.type==="boolean"?r.push(o.value):s.type==="object"&&s.properties.forEach(n)},"collectLeafs");return e.value.properties.forEach(n),r}}}get handOffs(){let e=this._parsedHeader.attributes.find(r=>r.key==="handoffs");if(e&&e.value.type==="array"){let r=[];for(let n of e.value.items)if(n.type==="object"){let o,s,c,l;for(let u of n.properties)u.key.value==="agent"&&u.value.type==="string"?o=u.value.value:u.key.value==="label"&&u.value.type==="string"?s=u.value.value:u.key.value==="prompt"&&u.value.type==="string"?c=u.value.value:u.key.value==="send"&&u.value.type==="boolean"&&(l=u.value.value);o&&s&&c!==void 0&&r.push({agent:o,label:s,prompt:c,send:l})}return r}}},y7t=class{constructor(e,r,n){this.range=e;this.linesWithEOL=r;this.uri=n}static{a(this,"PromptBody")}get fileReferences(){return this.getParsedBody().fileReferences}get variableReferences(){return this.getParsedBody().variableReferences}get offset(){return this.getParsedBody().bodyOffset}getParsedBody(){if(this._parsed===void 0){let e=[],r=[],n=[],o=this.linesWithEOL.slice(0,this.range.startLineNumber-1).reduce((s,c)=>c.length+s,0);for(let s=this.range.startLineNumber-1,c=o;s$P.Range.areIntersectingOrTouching(A,m)))continue;let g=h[1];if(g){if(g==="file:"){let A=h.index+h[0].length-h[2].length,y=h.index+h[0].length,E=new $P.Range(s+1,A+1,s+1,y+1);r.push({content:h[2],range:E,isMarkdownLink:!1})}}else{let A=h.index+1,y=h.index+h[0].length,E=new $P.Range(s+1,A+1,s+1,y+1);n.push({name:h[2],range:E,offset:c+h.index})}}c+=l.length}this._parsed={fileReferences:r.sort((s,c)=>$P.Range.compareRangesUsingStarts(s.range,c.range)),variableReferences:n,bodyOffset:o}}return this._parsed}get content(){return this._content===void 0&&(this._content=this.linesWithEOL.slice(this.range.startLineNumber-1,this.range.endLineNumber-1).join("").trim()),this._content}};p();var SQo=new Set(["sessionStart","sessionEnd","userPromptSubmitted","preToolUse","postToolUse","errorOccurred"]),fEn="agentHook.event.load",gYe=class{constructor(){this.logger=new pe("HookParser")}static{a(this,"HookParser")}parse(e,r,n){let o=JSON.parse(n);if(o.version!==1)throw new Error(`Unsupported hooks config version: ${String(o.version)}`);if(o.hooks===void 0||typeof o.hooks!="object"||o.hooks===null)throw new Error("Invalid or missing hooks section");let s=o,c={};for(let[l,u]of Object.entries(s.hooks)){if(!this.isValidEventType(l)){this.logger.warn(e,`Invalid event type: ${l} in ${r}`);continue}let d=Array.isArray(u)?u:[],f=[];for(let h of d)this.isValidHook(h)?f.push(h):this.logger.warn(e,`Invalid hook configuration in ${r}: ${JSON.stringify(h)}`);c[l]=f}return ft(e,fEn),cr(e,fEn,this.buildHookCountsByEventType(c)),{uri:r,version:1,hooks:c}}buildHookCountsByEventType(e){let r={};for(let[n,o]of Object.entries(e))o!==void 0&&(r[`${n}.hookCount`]=String(o.length));return r}isValidEventType(e){return SQo.has(e)}isValidHook(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="command"&&("bash"in e&&typeof e.bash=="string"||"powershell"in e&&typeof e.powershell=="string")}};p();var pEn=require("os");var TQo=(0,pEn.platform)()==="win32",ip=class{constructor(){this.trustByUri=new Map;this.emitter=new Vi;this.onDidChangeTrust=this.emitter.event;this.capabilityEnabled=!1}static{a(this,"WorkspaceTrustService")}setCapabilityEnabled(e){this.capabilityEnabled=e}setTrust(e,r){let n=this.normalizeKey(e),o=this.trustByUri.get(n);if(this.trustByUri.set(n,r),o===r)return;let s=`${n}/`,c=[];for(let l of this.trustByUri.keys())l.startsWith(s)&&c.push(l);for(let l of c)this.trustByUri.delete(l);this.emitter.fire({folderUri:n,trusted:r});for(let l of c)this.emitter.fire({folderUri:l,trusted:this.isTrustedInternal(l)})}forget(e){let r=this.normalizeKey(e);this.trustByUri.delete(r)&&this.emitter.fire({folderUri:r,trusted:this.isTrustedInternal(r)})}isTrusted(e){return this.capabilityEnabled?this.isTrustedInternal(this.normalizeKey(e)):!0}isTrustedInternal(e){let r=e.indexOf("://"),n=r>=0?r+3:0,o=e;for(;o.length>n;){let s=this.trustByUri.get(o);if(s!==void 0)return s;let c=o.lastIndexOf("/");if(cthis.handleChange(f));for(let f of E7t)this.rewatch(f);this.registrySubscription=o.onLocationsChanged(f=>{for(let h of f.affectedTypes)this.rewatch(h)});let c=a(f=>{this.evictFolder(f),this.rewatchAll()},"onWorkspaceRemoved"),l=a(()=>{this.rewatchAll()},"onWorkspaceAdded");this.workspaceListener=new class extends tq{isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}didAddWorkspace(){l()}didRemoveWorkspace(f){c(f)}},e.get(VS).addListener(this.workspaceListener);let u,d=a(()=>{let f=u;if(u=void 0,!(!f||this.disposed)){for(let h of f)this.evictFolder({uri:h});this.rewatchAll();for(let h of E7t)this.notifyChange(h)}},"flushPending");this.trustSubscription=e.get(ip).onDidChangeTrust(f=>{u===void 0&&(u=new Set,queueMicrotask(d)),u.add(f.folderUri)})}static{a(this,"PromptService")}async collect(e,r,n,o){let s=e.get(ip),c=n.filter(h=>s.isTrusted(h.uri)),l=await this.fileLocator.listFiles(e,c,r),u=o?.includePlugins?l:l.filter(h=>h.classification.storage!=="plugin"),f=(await Promise.all(u.map(h=>this.resolveEntry(e,r,h)))).filter(h=>h!==void 0);return o?.includePlugins?f:f.filter(h=>h.promptPath.storage!=="plugin")}async resolveEntry(e,r,n){let o=hEn(r,n.uri);if(n.cacheable){let l=this.entryCache.get(o);if(l){let d=await this.fsMtime(e,n.uri);if(d!==void 0&&d===l.timestamp)return l.entry;this.invalidateKey(o)}let u=this.parseInflight.get(o);if(u)return u}let s=this.buildPromptPath(r,n),c=this.parseOne(e,s).then(l=>{if(l===void 0)return;let u={promptPath:s,parsedPromptFile:l};return n.cacheable&&!this.disposed&&this.parseInflight.get(o)===c&&this.entryCache.set(o,{entry:u,timestamp:n.timestamp}),u});return n.cacheable&&(this.parseInflight.set(o,c),c.finally(()=>{this.parseInflight.get(o)===c&&this.parseInflight.delete(o)})),c}async fsMtime(e,r){try{return(await e.get(Qo).stat(r)).mtime}catch{return}}buildPromptPath(e,r){let{classification:n}=r;return n.storage==="plugin"?{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata,name:n.pluginInfo.name,description:n.pluginInfo.description,pluginUri:n.pluginInfo.pluginUri}:n.storage==="extension"||n.storage==="clsAssets"?{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata,name:n.extensionInfo.name,description:n.extensionInfo.description,extensionId:n.extensionInfo.extensionId}:{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata}}async dispose(){if(!this.disposed){this.disposed=!0,this.registrySubscription.dispose(),this.mergedChangeSubscription.dispose(),this.trustSubscription.dispose();try{this.ctx.get(VS).removeListener(this.workspaceListener)}catch{}for(let e of this.watchHandles.values())e.dispose();this.watchHandles.clear(),this.entryCache.clear(),this.parseInflight.clear(),this.ownsWatcher&&await this.watcher.dispose()}}async parseOne(e,r){let n=this.parsers.get(r.type);if(!n){this.logger.warn(e,`No parser registered for type ${r.type} (uri: ${r.uri})`);return}try{return await n.parse(e,r.uri,await e.get(Qo).readFileString(r.uri))}catch(o){this.logger.warn(e,`Failed to parse ${r.type} file ${r.uri}:`,o);return}}handleChange(e){let r=new Set,n=!1;for(let o of e.changes)o.path?r.add(o.path):n=!0;for(let o of e.affectedTypes){if(n)this.clearType(o);else for(let s of r)this.invalidateKey(hEn(o,ts(s)));this.notifyChange(o)}}notifyChange(e){try{this.ctx.get(d0).notify(e).catch(r=>{this.logger.warn(this.ctx,`PromptChangeNotifier.notify(${e}) failed:`,r)})}catch(r){this.logger.warn(this.ctx,`PromptChangeNotifier.notify(${e}) failed:`,r)}}invalidateKey(e){this.entryCache.delete(e),this.parseInflight.delete(e)}clearType(e){let r=IQo(e),n=new Set;for(let o of this.entryCache.keys())o.startsWith(r)&&n.add(o);for(let o of this.parseInflight.keys())o.startsWith(r)&&n.add(o);for(let o of n)this.invalidateKey(o)}rewatch(e){if(this.disposed)return;let r=this.ctx.get(PA),n=this.currentWorkspacePaths(),o=r.resolvePatterns(e,n,!0).map(l=>l.pattern),s=this.watchHandles.get(e);if(o.length===0){s&&(s.dispose(),this.watchHandles.delete(e));return}let c=this.watcher.watch(e,o,s);this.watchHandles.set(e,c)}rewatchAll(){for(let e of E7t)this.rewatch(e)}evictFolder(e){let r=e.uri.endsWith("/")?e.uri:`${e.uri}/`;for(let[n,o]of this.entryCache){let s=o.entry.promptPath.uri;(s===e.uri||s.startsWith(r))&&this.invalidateKey(n)}}currentWorkspacePaths(){let e;try{let o=this.ctx.get(ip);e=this.ctx.get($r).getWorkspaceFolders().filter(s=>o.isTrusted(s.uri)).map(s=>ln(s.uri))}catch{return[]}let r=e.map(o=>({raw:o,normalized:o.replace(/\\/g,"/")})).sort((o,s)=>o.normalized.length-s.normalized.length),n=[];for(let o of r)n.some(s=>nw(s.normalized,o.normalized,UC))||n.push(o);return n.map(o=>o.raw)}};p();var Hl=class{constructor(){this.policyChangeEmitter=new yu;this.onDidChangePolicy=this.policyChangeEmitter.event}static{a(this,"PolicyWatcher")}},AYe=class extends Hl{static{a(this,"NoOpPolicyWatcher")}getPolicyValue(e){}};p();var _7t=64;var U3=(r=>(r.enabled="enabled",r.disabled="disabled",r))(U3||{}),hg={id:"copilot",displayName:"Copilot Language Server",description:"Copilot Language Server tool provider",isFirstPartyTool:!0},op={id:"copilot-editor",displayName:"Editor",description:"Editor tool provider",isFirstPartyTool:!0},kK=class{static{a(this,"LanguageModelTool")}constructor(e){this.type=e.type,this.toolProvider=e.toolProvider,this.name=e.name,this.displayName=e.displayName??this.name,this.description=e.description,this.displayDescription=e.displayDescription??this.description,this.inputSchema=e.inputSchema,this.annotations=e.annotations,this.id=`${this.toolProvider.id}.${this.name}`,this.nameForModel=(this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.displayNamePrefix??this.toolProvider.id}_${this.name}`).replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,_7t),this.status=e.status??"enabled",this.configurationKey=this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.id}/${this.name}`}isEnabled(e){return Promise.resolve(!0)}},aq=class extends kK{static{a(this,"BaseLanguageModelTool")}constructor(e){super(e)}},Pr=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}},cq=class{static{a(this,"LanguageModelDataPart")}constructor(e){this.value=e}},PK=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};var Fr=class{static{a(this,"LanguageModelToolResult")}constructor(e,r){this.status=r,this.content=e}},lq=class extends Fr{static{a(this,"ExtendedLanguageModelToolResult")}},mEn=S.Object({content:S.Array(S.Union([S.Object({value:S.String()}),S.Object({value:S.Unknown()})])),status:S.Optional(S.Union([S.Literal("success"),S.Literal("error"),S.Literal("cancelled")]))}),Q3=(r=>(r.Accept="accept",r.Dismiss="dismiss",r))(Q3||{}),gEn=S.Object({result:S.Enum(Q3)});var v7t=fe(require("fs"));var mxe=fe(require("path"));var b7t=["user","model"],S7t="source",T7t={githubOrg:"github-org"},Eyn={githubOrg:{[S7t]:T7t.githubOrg}},C7t=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._id=n.uri;let o=n.header?.name?.trim()||void 0;this._name=r.name??o??Ki(n.uri).replace(/\.(agent\.)?md$/i,"")}static{a(this,"CustomAgent")}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get id(){return this._id}get name(){return this._name}get description(){return this.parsedPromptFile.header?.description}get tools(){return this.parsedPromptFile.header?.tools}get model(){return this.parsedPromptFile.header?.model}get handOffs(){return this.parsedPromptFile.header?.handOffs}get instruction(){return this.parsedPromptFile.body?.content}get isReadonly(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||Jle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get invokePolicy(){return this.parsedPromptFile.header?.invokePolicy??b7t}get extensionId(){let e=this.promptFileEntry.promptPath;if(e.storage==="extension"||e.storage==="clsAssets")return e.extensionId}get pluginUri(){return sq(this.promptFileEntry.promptPath)}get source(){let e=this.promptFileEntry.promptPath.metadata;if(!e)return;let r=new Set(Object.values(T7t));for(let n of e){let o=n[S7t];if(typeof o=="string"&&r.has(o))return o}}get providers(){return O3(this.promptFileEntry.promptPath.metadata)}},AEn="./assets/prompts.contributions.json",EEn="CVE Remediator",xQo="Debugger",yEn=new Map([[EEn,"cveRemediatorAgent"],[xQo,"debuggerAgent"]]),wQo=new Map([[EEn,["LOCAL"]]]),jd=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.logger=new pe("CustomAgentService");this.agentUpdateSequencer=new Xx;this.extensionAgents=new Map;this.agentsByExtension=new Map;this.agentFileLocationsPatterns=[];this.runtimeSources=[];this.gateSubscriptions=[];this.lastGatedCapabilities={};this.syncRegistry(),this.registerClaudeAgentPatterns(),this.ready=this.loadAssetsContributions(e),this.subscribeToGateChanges()}static{a(this,"CustomAgentService")}static{this.DEFAULT_AGENT_REGISTRATIONS=[".github/agents/**/*.agent.md",".claude/agents/**/*.agent.md","~/.copilot/agents/**/*.agent.md"]}static{this.AGENT_GLOB_SUFFIX="**/*.agent.md"}static{this.CLAUDE_AGENT_PATTERNS=[".claude/agents/**/*.md","~/.claude/agents/**/*.md"]}registerClaudeAgentPatterns(){this.promptFileLocationRegistry.register("agent",[...t.CLAUDE_AGENT_PATTERNS],{metadata:{providers:["CLAUDE"]}})}registerRuntimeAgentSource(e){return this.runtimeSources.push(e),{dispose:a(()=>{let r=this.runtimeSources.indexOf(e);r>=0&&this.runtimeSources.splice(r,1)},"dispose")}}subscribeToGateChanges(){try{let e=this.ctx.get(Lo);this.lastEnableCustomAgents=Rt(this.ctx,ze.EnableCustomAgents),this.lastEnableOrgCustomAgents=Rt(this.ctx,ze.EnableOrgCustomAgents),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Rt(this.ctx,ze.EnableCustomAgents),n=Rt(this.ctx,ze.EnableOrgCustomAgents);r===this.lastEnableCustomAgents&&n===this.lastEnableOrgCustomAgents||(this.lastEnableCustomAgents=r,this.lastEnableOrgCustomAgents=n,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(Hl);this.lastCustomAgentPolicyEnabled=e.getPolicyValue("customAgent.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customAgent.enabled");r!==this.lastCustomAgentPolicyEnabled&&(this.lastCustomAgentPolicyEnabled=r,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(kn),r=Array.from(new Set(yEn.values())),n=a(o=>{let s={};for(let c of r)s[c]=o[c];return s},"snapshotGated");this.lastGatedCapabilities=n(e.getCapabilities()),this.gateSubscriptions.push(e.onDidSetCapabilities(o=>{let s=n(o);r.every(c=>s[c]===this.lastGatedCapabilities[c])||(this.lastGatedCapabilities=s,this.notifyAgentListChanged())}))}catch{}}notifyAgentListChanged(){try{this.ctx.get(d0).notify("agent").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(agent) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(agent) failed:",e)}}dispose(){for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0}syncRegistry(){let e=new Set(t.DEFAULT_AGENT_REGISTRATIONS);for(let r of this.agentFileLocationsPatterns)e.add(r);this.registryAgentPatterns=this.promptFileLocationRegistry.replace(this.registryAgentPatterns,"agent",Array.from(e),{metadata:{providers:["LOCAL","BACKGROUND"]}})}setAgentFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(ln(n.uri)):n.type==="location"&&r.add(mxe.default.posix.join(n.path,t.AGENT_GLOB_SUFFIX));this.agentFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listCustomAgents(e,r){if(this.ctx.get(Hl).getPolicyValue("customAgent.enabled")===!1)return[];await this.ready;let s=(await this.ctx.get(pg).collect(this.ctx,"agent",e,{includePlugins:r?.includePlugins})).map(m=>new C7t(m)),c=this.ctx.get(L3),l=Rt(this.ctx,ze.EnableOrgCustomAgents)!==!1,u=this.ctx.get(kn).getCapabilities(),d=s.filter(m=>{let g=m.promptFileEntry?.parsedPromptFile.header?.errors;if(g&&g.length>0){let E=g[0];return this.logger.warn(this.ctx,`Ignoring custom agent ${m.promptFileEntry?.promptPath.uri}: invalid frontmatter (${E.code}: ${E.message})`),!1}if(this.isOrgScopedAgent(m)){if(!l)return!1;let E=m.promptFileEntry?.parsedPromptFile.uri,_=E?Us(E):void 0;if(!_||!c.isCachedAgentVisibleFor(_,e))return!1}let A=yEn.get(m.name);if(A===void 0)return!0;let y=u[A]??!1;return y||this.logger.debug(this.ctx,`Filtering out agent '${m.name}' (capability '${A}' is disabled)`),y});if(!r?.includeRuntimeAgents||this.runtimeSources.length===0)return d;let f=new Set(d.map(m=>m.name.toLowerCase())),h=[];for(let m of this.runtimeSources){let g;try{g=await m.getAgents(e)}catch(A){this.logger.warn(this.ctx,"RuntimeAgentSource.getAgents failed:",A);continue}for(let A of g){let y=A.name.toLowerCase();f.has(y)||(f.add(y),h.push(A))}}return[...d,...h]}isOrgScopedAgent(e){let r=e.promptFileEntry?.promptPath.metadata;return r?r.some(n=>n[S7t]===T7t.githubOrg):!1}async getCustomAgentById(e,r){return(await this.listCustomAgents(e)).find(o=>o.id===r)}registerExtensionAgent(e,r){let n=[];for(let o of r){if(this.extensionAgents.has(o.uri))continue;let s=this.promptFileLocationRegistry.register("agent",[ln(o.uri)],{watchable:!1,classification:{storage:"extension",extensionInfo:{name:o.name,description:o.description,extensionId:e}}}),c=o.uri,l={dispose:a(()=>{s.dispose(),this.extensionAgents.delete(c),this.agentsByExtension.get(e)?.delete(c),this.agentsByExtension.get(e)?.size===0&&this.agentsByExtension.delete(e)},"dispose")};this.extensionAgents.set(c,l);let u=this.agentsByExtension.get(e);u||(u=new Set,this.agentsByExtension.set(e,u)),u.add(c),n.push(c)}return{dispose:a(()=>{for(let o of n)this.extensionAgents.get(o)?.dispose()},"dispose")}}unregisterExtensionAgents(e){let r=this.agentsByExtension.get(e);if(r)for(let n of[...r])this.extensionAgents.get(n)?.dispose()}resolveAssetsPath(e){let r=mxe.default.extname(__filename)===".ts"?mxe.default.resolve(__dirname,"../../../..",e):mxe.default.resolve(__dirname,e);return this.logger.debug(this.ctx,`Resolved assets path: ${r}`),r}async loadAssetsContributions(e){try{let r=this.resolveAssetsPath(AEn),n=await v7t.promises.readFile(r,"utf8"),s=JSON.parse(n).chatAgents||[];for(let c of s)if(c.name&&c.description&&c.path){let l=this.resolveAssetsPath(c.path),u=wQo.get(c.name);this.promptFileLocationRegistry.register("agent",[l],{watchable:!1,classification:{storage:"clsAssets",extensionInfo:{name:c.name,description:c.description}},...u?{metadata:{providers:[...u]}}:{}})}}catch(r){this.logger.warn(e,`Failed to read assets contribution file ${AEn}:`,r)}}async updateCustomAgent(e,r){if(e.isReadonly)throw new Error(`Cannot update readonly agent: ${e.name}`);await this.agentUpdateSequencer.queue(e.id,async()=>{await this.performUpdateCustomAgent(e,r)})}async performUpdateCustomAgent(e,r){let n=[];a(l=>{l&&n.push(l)},"addIfNotUndefined")(this.updateCustomAgentTools(e,r.updateToolOptions));let s,c=e.promptFileEntry?.parsedPromptFile;if(!c)throw new Error("Cannot update agent: parsedPromptFile is undefined");if(n.forEach(l=>{let u=l(c);u!==void 0&&(s={...s||{},...u})}),s!==void 0){let l={...this.extractHeader(c.header),...s},u="";if(c.header){let m=[];for(let g of c.header.attributes){let A=g.key,y=l[A];if(y!==void 0)if(A==="tools"&&Array.isArray(y)){let E=y.map(_=>JSON.stringify(_).slice(1,-1)).map(_=>`'${_}'`).join(", ");m.push(`tools: [${E}]`)}else{let E=bK({[A]:y}).trim();m.push(E)}}u=m.join(` `)+` `}let d=c.body?.content,f=u?`--- ${u}--- -${d}`:d||"",h=rs(c.uri);if(!h)throw new Error(`Invalid file URI: ${c.uri}`);await RUt.promises.writeFile(h,f,{encoding:"utf8"})}}updateCustomAgentTools(e,r){if(r)return n=>{let o=n.header?.tools;if(o!==void 0)return r.forEach(s=>{let c=o.findIndex(l=>l===s.toolConfigurationKey);s.status==="enabled"?c===-1&&o.push(s.toolConfigurationKey):c!==-1&&o.splice(c,1)}),{tools:o}}}extractHeader(e){let r=a(o=>{if(o.type==="array")return[...o.items.map(s=>r(s))];if(o.type==="object"){let s={};return o.properties.forEach(c=>{s[c.key.value]=r(c.value)}),s}return o.value},"extractValue"),n={};return e?.attributes.forEach(o=>{let{key:s,value:c}=o;n[s]=r(c)}),n}};var JIe=class{constructor(e){this.customAgent=e;this._isBuiltIn=!1;this.kind="Agent";e.promptFileEntry?.promptPath?.storage==="clsAssets"&&(this._isBuiltIn=!0)}static{a(this,"CustomChatMode")}get isBuiltIn(){return this._isBuiltIn}get id(){return this.customAgent.id}get name(){return this.customAgent.name}get uri(){return this.customAgent?.promptFileEntry?.parsedPromptFile?.uri}get description(){return this.customAgent.description}get customTools(){return this.customAgent.tools}get model(){return this.customAgent.model}get handOffs(){return this.customAgent.handOffs}get instruction(){return this.customAgent.instruction}get source(){return this.customAgent}},KIe=class{constructor(e,r,n,o){this.id=e;this.name=r;this.kind=n;this.description=o;this.isBuiltIn=!0}static{a(this,"BuiltInChatMode")}},Cl={Ask:new KIe("Ask","Ask","Ask","General purpose chat mode for questions and assistance"),Agent:new KIe("Agent","Agent","Agent","Advanced agent mode with access to tools and capabilities"),InlineAgent:new KIe("InlineAgent","Agent","InlineAgent","Agent mode with a restricted tool set for inline editing")};function $An(t){return t===Cl.Agent||t.id===Cl.Agent.id}a($An,"isBuiltInAgentMode");function IUo(t){return t===Cl.InlineAgent||t.id===Cl.InlineAgent.id}a(IUo,"isBuiltInInlineAgentMode");function VAn(t){return t===Cl.Ask||t.id===Cl.Ask.id||$An(t)||IUo(t)}a(VAn,"isBuiltInChatMode");function ZIe(t){return $An(t)||!t.isBuiltIn&&t.customTools===void 0}a(ZIe,"shouldApplyGlobalToolsSetting");var j_=class{constructor(e){this.ctx=e}static{a(this,"ChatModeService")}async listChatModes(e){let r=[Cl.Ask,Cl.Agent,Cl.InlineAgent],o=await this.ctx.get(Ld).listCustomAgents(e||[],{includePlugins:!0});return r.push(...o.filter(s=>s.invokePolicy.includes("user")).map(s=>new JIe(s))),r}async getChatMode(e,r,n){switch(e){case"Ask":return Cl.Ask;case"Agent":return r?await this.getCustomChatModeById(r,n)??Cl.Agent:Cl.Agent;case"InlineAgent":return Cl.InlineAgent}}async getCustomChatModeById(e,r){return(await this.listChatModes(r)).find(o=>o.id===e)}};p();var Oc=class extends Error{static{a(this,"CanceledError")}constructor(){super("Canceled"),this.name="Canceled"}};p();var $ze=class{constructor(){this._tools=new Map}static{a(this,"ToolRegistry")}registerTool(e){this._tools.set(e.id,e)}unregisterTool(e){return this._tools.delete(e)}getTool(e){return this._tools.get(e)}listTools(){return Array.from(this._tools.values())}};p();p();p();var xUo=new fe("conversationProgress"),ZQ={Unknown:-1,Default:0,ToolRoundExceedError:1e4};var Tc=class{constructor(e){this.ctx=e;this.progressEntries=new Cn(250)}static{a(this,"ConversationProgress")}async begin(e,r,n){let o={status:"open",handler:n};this.progressEntries.set(e.id,o),await o.handler.begin(this.ctx,e,r)}async report(e,r,n){let o=this.getProgressEntry(e);if(o.status==="open")await o.handler.report(this.ctx,e,r,n);else{let s=Object.keys(n).filter(c=>n[c]!==void 0);xUo.debug(this.ctx,`conversationProgress.report(): dropped because status is '${o.status}' (not open) for conversation ${e.id}. Dropped payload fields: [${s.join(", ")}]. If tokenUsage is among dropped fields, this is a cause of token usage not reaching $progress.`)}}async end(e,r,n){let o=this.getProgressEntry(e);o.status==="open"&&(this.progressEntries.set(e.id,{...o,status:"done",updatedAt:Date.now()}),await o.handler.end(this.ctx,e,r,n))}async cancel(e,r,n){let o=this.getProgressEntry(e);o.status==="open"&&(this.progressEntries.set(e.id,{...o,status:"cancelled",updatedAt:Date.now()}),await o.handler.cancel(this.ctx,e,r,n))}getCurrentHandler(e){return this.progressEntries.get(e.id)?.handler}getProgressEntry(e){let r=this.progressEntries.get(e.id);if(r===void 0)throw new Error(`No work done token for conversation ${e.id}`);return r.status!=="open"&&ot.error(this.ctx,`Work done token for conversation ${e.id} is already ${r.status}, last updated at ${r.updatedAt}`),r}};p();p();p();var io={Azure:"Azure",OpenAI:"OpenAI",Gemini:"Gemini",Groq:"Groq",OpenRouter:"OpenRouter",Anthropic:"Anthropic"},wUo=new Set(Object.values(io));function vK(t){return!wUo.has(t)}a(vK,"isCustomEndpointProvider");var XIe="chatCompletions",RUo=128e3,kUo=16e3;function pO(t){return t===io.Azure?1:0}a(pO,"getAuthTypeForProvider");function WAn(t){switch(t){case"responses":return"responses";case"messages":return"v1/messages";default:return"completions"}}a(WAn,"customEndpointApiTypeToEndpoint");function Vze(t,e){let r=t.trim();r.endsWith("/")&&(r=r.slice(0,-1));let n=["/v1/messages","/chat/completions","/responses","/messages"];for(let s of n)if(r.endsWith(s)){r=r.slice(0,-s.length);break}let o=/\/v\d+$/;return e==="messages"?r.replace(o,""):o.test(r)?r:`${r}/v1`}a(Vze,"resolveCustomEndpointBaseUrl");function jle(t){return t===io.OpenAI||t===io.Gemini||t===io.Groq||t===io.OpenRouter||t===io.Anthropic}a(jle,"isOpenAICompatible");async function hO(t,e,r){let n=new da(t.get(Yn)),o=await n.getStoredModelConfigs(e),s=o&&o[r]&&o[r].isRegistered!==!1?o[r]:void 0,c=s?.modelCapabilities,l=c?.name||r,u=vK(e),d=u?RUo:1e5,f=u?kUo:8192,h=c?.maxInputTokens||d,m=c?.maxOutputTokens||f,g=s?.deploymentUrl,A;return u&&(A=(await n.getProviderConfig(e))?.apiType??XIe),{modelId:r,uiName:l,modelFamily:Rn.BYOK,providerName:e,deploymentUrl:g,apiType:A,maxRequestTokens:h,maxResponseTokens:m,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!!c?.toolCalling,supportsThinking:!!c?.thinking,originalBillingMultiplier:0}}a(hO,"resolveModelConfiguration");async function Wze(t,e,r){return await new da(t.get(Yn)).getAPIKey(e,r)}a(Wze,"resolveModelKey");function zAn(t,e){let{protocol:r,hostname:n,pathname:o}=new URL(e);if(o.endsWith("/chat/completions"))return e;if(n.endsWith(".models.ai.azure.com")||n.endsWith(".inference.ml.azure.com"))return`${r}//${n}/v1/chat/completions`;if(n.endsWith(".openai.azure.com"))return`${r}//${n}/openai/deployments/${t}/chat/completions?api-version=2025-01-01-preview`;throw new Error(`Unrecognized Azure deployment URL: ${e}`)}a(zAn,"resolveAzureUrl");function XQ(t){return t.userInfo.isIndividualUser||t.isClientBYOKEnabled}a(XQ,"isBYOKEnabled");var BC="byok",da=class{constructor(e){this.persistenceManager=e}static{a(this,"BYOKPersistence")}modelApiKeyKey(e,r){return`${e}-${r}-api-key`}providerApiKeyKey(e){return`${e}-api-key`}modelsConfigKey(e){return`${e}-models-config`}providerConfigKey(e){return`${e}-provider-config`}async getAPIKey(e,r){if(r){let o=await this.persistenceManager.read(BC,this.modelApiKeyKey(e,r));if(o)return o}return await this.persistenceManager.read(BC,this.providerApiKeyKey(e))}async storeAPIKey(e,r,n,o){n!==2&&(n===0?await this.persistenceManager.update(BC,this.providerApiKeyKey(e),r):n===1&&o&&await this.persistenceManager.update(BC,this.modelApiKeyKey(e,o),r))}async deleteAPIKey(e,r,n){r!==2&&(r===0?await this.persistenceManager.delete(BC,this.providerApiKeyKey(e)):r===1&&n&&await this.persistenceManager.delete(BC,this.modelApiKeyKey(e,n)))}async getStoredModelConfigs(e){return await this.persistenceManager.read(BC,this.modelsConfigKey(e))||{}}async getProviderConfig(e){return await this.persistenceManager.read(BC,this.providerConfigKey(e))}async saveProviderConfig(e,r){await this.persistenceManager.update(BC,this.providerConfigKey(e),r)}async deleteProviderConfig(e){await this.persistenceManager.delete(BC,this.providerConfigKey(e))}async listCustomProviderNames(){let e=await this.persistenceManager.listKeys(BC),r=this.providerConfigKey(""),n=new Set(Object.values(io));return e.filter(o=>o.endsWith(r)).map(o=>o.slice(0,-r.length)).filter(o=>!n.has(o))}async listAllProviderNames(){let e=await this.listCustomProviderNames();return Array.from(new Set([...Object.values(io),...e]))}async getAllModels(e){let r=[];if(!XQ(await e.get(Qt).getToken()))return r;for(let n of await this.listAllProviderNames()){let o=await this.getStoredModelConfigs(n);r.push(...Object.keys(o).map(s=>({name:s,provider:n,capabilities:o[s].modelCapabilities})))}return r}async saveModelConfig(e,r,n,o,s){let c=await this.getStoredModelConfigs(e);c[r]=n,await this.persistenceManager.update(BC,this.modelsConfigKey(e),c),o&&s&&await this.storeAPIKey(e,o,s,r)}async removeModelConfig(e,r){let n=await this.getStoredModelConfigs(e),o=n[r];o&&(delete n[r],await this.persistenceManager.update(BC,this.modelsConfigKey(e),n),o.deploymentUrl&&await this.deleteAPIKey(e,1,r))}async removeAllModelConfigs(e){await this.persistenceManager.delete(BC,this.modelsConfigKey(e))}};p();p();p();p();function MUt(t,e){let r=CK(t,e);return r===-1?void 0:t[r]}a(MUt,"findLastMonotonous");function CK(t,e,r=0,n=t.length){let o=r,s=n;for(;o{throw e.stack?Kze.isErrorNoTelemetry(e)?new Kze(e.message+` +${d}`:d||"",h=Us(c.uri);if(!h)throw new Error(`Invalid file URI: ${c.uri}`);await v7t.promises.writeFile(h,f,{encoding:"utf8"})}}updateCustomAgentTools(e,r){if(r)return n=>{let o=n.header?.tools;if(o!==void 0)return r.forEach(s=>{let c=o.findIndex(l=>l===s.toolConfigurationKey);s.status==="enabled"?c===-1&&o.push(s.toolConfigurationKey):c!==-1&&o.splice(c,1)}),{tools:o}}}extractHeader(e){let r=a(o=>{if(o.type==="array")return[...o.items.map(s=>r(s))];if(o.type==="object"){let s={};return o.properties.forEach(c=>{s[c.key.value]=r(c.value)}),s}return o.value},"extractValue"),n={};return e?.attributes.forEach(o=>{let{key:s,value:c}=o;n[s]=r(c)}),n}};var Axe=class{constructor(e){this.customAgent=e;this._isBuiltIn=!1;this.kind="Agent";e.promptFileEntry?.promptPath?.storage==="clsAssets"&&(this._isBuiltIn=!0)}static{a(this,"CustomChatMode")}get isBuiltIn(){return this._isBuiltIn}get id(){return this.customAgent.id}get name(){return this.customAgent.name}get uri(){return this.customAgent?.promptFileEntry?.parsedPromptFile?.uri}get description(){return this.customAgent.description}get customTools(){return this.customAgent.tools}get model(){return this.customAgent.model}get handOffs(){return this.customAgent.handOffs}get instruction(){return this.customAgent.instruction}get source(){return this.customAgent}},gxe=class{constructor(e,r,n,o){this.id=e;this.name=r;this.kind=n;this.description=o;this.isBuiltIn=!0}static{a(this,"BuiltInChatMode")}},bl={Ask:new gxe("Ask","Ask","Ask","General purpose chat mode for questions and assistance"),Agent:new gxe("Agent","Agent","Agent","Advanced agent mode with access to tools and capabilities"),InlineAgent:new gxe("InlineAgent","Agent","InlineAgent","Agent mode with a restricted tool set for inline editing")};function vEn(t){return t===bl.Agent||t.id===bl.Agent.id}a(vEn,"isBuiltInAgentMode");function RQo(t){return t===bl.InlineAgent||t.id===bl.InlineAgent.id}a(RQo,"isBuiltInInlineAgentMode");function CEn(t){return t===bl.Ask||t.id===bl.Ask.id||vEn(t)||RQo(t)}a(CEn,"isBuiltInChatMode");function yxe(t){return vEn(t)||!t.isBuiltIn&&t.customTools===void 0}a(yxe,"shouldApplyGlobalToolsSetting");var V_=class{constructor(e){this.ctx=e}static{a(this,"ChatModeService")}async listChatModes(e){let r=[bl.Ask,bl.Agent,bl.InlineAgent],o=await this.ctx.get(jd).listCustomAgents(e||[],{includePlugins:!0});return r.push(...o.filter(s=>s.invokePolicy.includes("user")).map(s=>new Axe(s))),r}async getChatMode(e,r,n){switch(e){case"Ask":return bl.Ask;case"Agent":return r?await this.getCustomChatModeById(r,n)??bl.Agent:bl.Agent;case"InlineAgent":return bl.InlineAgent}}async getCustomChatModeById(e,r){return(await this.listChatModes(r)).find(o=>o.id===e)}};p();var Uc=class extends Error{static{a(this,"CanceledError")}constructor(){super("Canceled"),this.name="Canceled"}};p();var yYe=class{constructor(){this._tools=new Map}static{a(this,"ToolRegistry")}registerTool(e){this._tools.set(e.id,e)}unregisterTool(e){return this._tools.delete(e)}getTool(e){return this._tools.get(e)}listTools(){return Array.from(this._tools.values())}};p();p();p();var kQo=new pe("conversationProgress"),uq={Unknown:-1,Default:0,ToolRoundExceedError:1e4};var wc=class{constructor(e){this.ctx=e;this.progressEntries=new Cn(250)}static{a(this,"ConversationProgress")}async begin(e,r,n){let o={status:"open",handler:n};this.progressEntries.set(e.id,o),await o.handler.begin(this.ctx,e,r)}async report(e,r,n){let o=this.getProgressEntry(e);if(o.status==="open")await o.handler.report(this.ctx,e,r,n);else{let s=Object.keys(n).filter(c=>n[c]!==void 0);kQo.debug(this.ctx,`conversationProgress.report(): dropped because status is '${o.status}' (not open) for conversation ${e.id}. Dropped payload fields: [${s.join(", ")}]. If tokenUsage is among dropped fields, this is a cause of token usage not reaching $progress.`)}}async end(e,r,n){let o=this.getProgressEntry(e);o.status==="open"&&(this.progressEntries.set(e.id,{...o,status:"done",updatedAt:Date.now()}),await o.handler.end(this.ctx,e,r,n))}async cancel(e,r,n){let o=this.getProgressEntry(e);o.status==="open"&&(this.progressEntries.set(e.id,{...o,status:"cancelled",updatedAt:Date.now()}),await o.handler.cancel(this.ctx,e,r,n))}getCurrentHandler(e){return this.progressEntries.get(e.id)?.handler}getProgressEntry(e){let r=this.progressEntries.get(e.id);if(r===void 0)throw new Error(`No work done token for conversation ${e.id}`);return r.status!=="open"&&ot.error(this.ctx,`Work done token for conversation ${e.id} is already ${r.status}, last updated at ${r.updatedAt}`),r}};p();p();p();var no={Azure:"Azure",OpenAI:"OpenAI",Gemini:"Gemini",Groq:"Groq",OpenRouter:"OpenRouter",Anthropic:"Anthropic"},PQo=new Set(Object.values(no));function dq(t){return!PQo.has(t)}a(dq,"isCustomEndpointProvider");var Exe="chatCompletions",DQo=128e3,NQo=16e3,MQo=1e5,OQo=8192;function _xe(t){return dq(t)?{maxInputTokens:DQo,maxOutputTokens:NQo}:{maxInputTokens:MQo,maxOutputTokens:OQo}}a(_xe,"getDefaultTokenLimits");function EO(t){return t===no.Azure?1:0}a(EO,"getAuthTypeForProvider");function bEn(t){switch(t){case"responses":return"responses";case"messages":return"v1/messages";default:return"completions"}}a(bEn,"customEndpointApiTypeToEndpoint");function EYe(t,e){let r=t.trim();r.endsWith("/")&&(r=r.slice(0,-1));let n=["/v1/messages","/chat/completions","/responses","/messages"];for(let s of n)if(r.endsWith(s)){r=r.slice(0,-s.length);break}let o=/\/v\d+$/;return e==="messages"?r.replace(o,""):o.test(r)?r:`${r}/v1`}a(EYe,"resolveCustomEndpointBaseUrl");function Zle(t){return t===no.OpenAI||t===no.Gemini||t===no.Groq||t===no.OpenRouter||t===no.Anthropic}a(Zle,"isOpenAICompatible");async function _O(t,e,r){let n=new $a(t.get(ti)),o=await n.getStoredModelConfigs(e),s=o&&o[r]&&o[r].isRegistered!==!1?o[r]:void 0,c=s?.modelCapabilities,l=c?.name||r,u=dq(e),d=_xe(e),f=c?.maxInputTokens??d.maxInputTokens,h=c?.maxOutputTokens??d.maxOutputTokens,m=s?.deploymentUrl,g;return u&&(g=(await n.getProviderConfig(e))?.apiType??Exe),{modelId:r,uiName:l,modelFamily:wn.BYOK,providerName:e,deploymentUrl:m,apiType:g,maxRequestTokens:f,maxResponseTokens:h,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!!c?.toolCalling,supportsThinking:!!c?.thinking,reasoningEfforts:c?.supportsReasoningEffort,originalBillingMultiplier:0}}a(_O,"resolveModelConfiguration");async function _Ye(t,e,r){return await new $a(t.get(ti)).getAPIKey(e,r)}a(_Ye,"resolveModelKey");function SEn(t,e){let{protocol:r,hostname:n,pathname:o}=new URL(e);if(o.endsWith("/chat/completions"))return e;if(n.endsWith(".models.ai.azure.com")||n.endsWith(".inference.ml.azure.com"))return`${r}//${n}/v1/chat/completions`;if(n.endsWith(".openai.azure.com"))return`${r}//${n}/openai/deployments/${t}/chat/completions?api-version=2025-01-01-preview`;throw new Error(`Unrecognized Azure deployment URL: ${e}`)}a(SEn,"resolveAzureUrl");function fq(t){return t.userInfo.isIndividualUser||t.isClientBYOKEnabled}a(fq,"isBYOKEnabled");var W_="byok",$a=class t{constructor(e){this.persistenceManager=e}static{a(this,"BYOKPersistence")}static{this._writeQueue=Promise.resolve()}static enqueue(e){let r=t._writeQueue.then(e,e);return t._writeQueue=r.then(()=>{},()=>{}),r}modelApiKeyKey(e,r){return`${e}-${r}-api-key`}providerApiKeyKey(e){return`${e}-api-key`}modelsConfigKey(e){return`${e}-models-config`}providerConfigKey(e){return`${e}-provider-config`}async getAPIKey(e,r){if(r){let o=await this.persistenceManager.read(W_,this.modelApiKeyKey(e,r));if(o)return o}return await this.persistenceManager.read(W_,this.providerApiKeyKey(e))}async storeAPIKey(e,r,n,o){return t.enqueue(()=>this.storeAPIKeyUnserialized(e,r,n,o))}async deleteAPIKey(e,r,n){return t.enqueue(async()=>{r!==2&&(r===0?await this.persistenceManager.delete(W_,this.providerApiKeyKey(e)):r===1&&n&&await this.persistenceManager.delete(W_,this.modelApiKeyKey(e,n)))})}async getStoredModelConfigs(e){return await this.persistenceManager.read(W_,this.modelsConfigKey(e))||{}}async getProviderConfig(e){return await this.persistenceManager.read(W_,this.providerConfigKey(e))}async saveProviderConfig(e,r){return t.enqueue(async()=>{await this.persistenceManager.update(W_,this.providerConfigKey(e),r)})}async deleteProviderConfig(e){return t.enqueue(async()=>{await this.persistenceManager.delete(W_,this.providerConfigKey(e))})}async listCustomProviderNames(){let e=await this.persistenceManager.listKeys(W_),r=this.providerConfigKey(""),n=new Set(Object.values(no));return e.filter(o=>o.endsWith(r)).map(o=>o.slice(0,-r.length)).filter(o=>!n.has(o))}async listAllProviderNames(){let e=await this.listCustomProviderNames();return Array.from(new Set([...Object.values(no),...e]))}async getAllModels(e){let r=[];if(!fq(await e.get(Ft).getToken()))return r;for(let n of await this.listAllProviderNames()){let o=await this.getStoredModelConfigs(n);r.push(...Object.keys(o).map(s=>({name:s,provider:n,capabilities:o[s].modelCapabilities})))}return r}async saveModelConfig(e,r,n,o,s){return t.enqueue(async()=>{let c=await this.getStoredModelConfigs(e);c[r]=n,await this.persistenceManager.update(W_,this.modelsConfigKey(e),c),o&&s&&await this.storeAPIKeyUnserialized(e,o,s,r)})}async storeAPIKeyUnserialized(e,r,n,o){n!==2&&(n===0?await this.persistenceManager.update(W_,this.providerApiKeyKey(e),r):n===1&&o&&await this.persistenceManager.update(W_,this.modelApiKeyKey(e,o),r))}async removeModelConfig(e,r){return t.enqueue(async()=>{let n=await this.getStoredModelConfigs(e),o=n[r];o&&(delete n[r],await this.persistenceManager.update(W_,this.modelsConfigKey(e),n),o.deploymentUrl&&await this.persistenceManager.delete(W_,this.modelApiKeyKey(e,r)))})}async removeAllModelConfigs(e){return t.enqueue(async()=>{await this.persistenceManager.delete(W_,this.modelsConfigKey(e))})}};p();p();p();p();function I7t(t,e){let r=DK(t,e);return r===-1?void 0:t[r]}a(I7t,"findLastMonotonous");function DK(t,e,r=0,n=t.length){let o=r,s=n;for(;o{throw e.stack?bYe.isErrorNoTelemetry(e)?new bYe(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(r=>{r(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},PUo=new OUt;function Hle(t){exe(t)||PUo.onUnexpectedError(t)}a(Hle,"onUnexpectedError");var LUt="Canceled";function exe(t){return t instanceof H_?!0:t instanceof Error&&t.name===LUt&&t.message===LUt}a(exe,"isCancellationError");var H_=class extends Error{static{a(this,"CancellationError")}constructor(){super(LUt),this.name=this.message}};var Kze=class t extends Error{static{a(this,"ErrorNoTelemetry")}constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof t)return e;let r=new t;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},Lc=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};function BUt(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n{let o=Math.sin(n++)*179426549;return o-Math.floor(o)},"rand")}else r=Math.random;for(let n=t.length-1;n>0;n-=1){let o=Math.floor(r()*(n+1)),s=t[n];t[n]=t[o],t[o]=s}}a(UUt,"shuffle");var JAn;(l=>{function t(u){return u<0}l.isLessThan=t,a(t,"isLessThan");function e(u){return u<=0}l.isLessThanOrEqual=e,a(e,"isLessThanOrEqual");function r(u){return u>0}l.isGreaterThan=r,a(r,"isGreaterThan");function n(u){return u===0}l.isNeitherLessOrGreaterThan=n,a(n,"isNeitherLessOrGreaterThan"),l.greaterThan=1,l.lessThan=-1,l.neitherLessOrGreaterThan=0})(JAn||={});function Gle(t,e){return(r,n)=>e(t(r),t(n))}a(Gle,"compareBy");var $le=a((t,e)=>t-e,"numberComparator");var KAn=class t{constructor(e){this.iterate=e}static{a(this,"CallbackIterable")}static{this.empty=new t(e=>{})}forEach(e){this.iterate(r=>(e(r),!0))}toArray(){let e=[];return this.iterate(r=>(e.push(r),!0)),e}filter(e){return new t(r=>this.iterate(n=>e(n)?r(n):!0))}map(e){return new t(r=>this.iterate(n=>r(e(n))))}some(e){let r=!1;return this.iterate(n=>(r=e(n),!r)),r}findFirst(e){let r;return this.iterate(n=>e(n)?(r=n,!1):!0),r}findLast(e){let r;return this.iterate(n=>(e(n)&&(r=n),!0)),r}findLastMaxBy(e){let r,n=!0;return this.iterate(o=>((n||JAn.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};function txe(t,e){return t.reduce((r,n)=>r+e(n),0)}a(txe,"sumBy");p();function tyn(t,e){let r=Object.create(null);for(let n of t){let o=e(n),s=r[o];s||(s=r[o]=[]),s.push(n)}return r}a(tyn,"groupBy");var XAn,eyn,ZAn=class{constructor(e,r){this.toKey=r;this._map=new Map;this[XAn]="SetWithKey";for(let n of e)this.add(n)}static{a(this,"SetWithKey")}get size(){return this._map.size}add(e){let r=this.toKey(e);return this._map.set(r,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,r){this._map.forEach(n=>e.call(r,n,n,this))}[(eyn=Symbol.iterator,XAn=Symbol.toStringTag,eyn)](){return this.values()}};p();function QUt(t,e){let r=this,n=!1,o;return function(){if(n)return o;if(n=!0,e)try{o=t.apply(r,arguments)}finally{e()}else o=t.apply(r,arguments);return o}}a(QUt,"createSingleCallFunction");p();var qUt;(b=>{function t(T){return T&&typeof T=="object"&&typeof T[Symbol.iterator]=="function"}b.is=t,a(t,"is");let e=Object.freeze([]);function r(){return e}b.empty=r,a(r,"empty");function*n(T){yield T}b.single=n,a(n,"single");function o(T){return t(T)?T:n(T)}b.wrap=o,a(o,"wrap");function s(T){return T||e}b.from=s,a(s,"from");function*c(T){for(let w=T.length-1;w>=0;w--)yield T[w]}b.reverse=c,a(c,"reverse");function l(T){return!T||T[Symbol.iterator]().next().done===!0}b.isEmpty=l,a(l,"isEmpty");function u(T){return T[Symbol.iterator]().next().value}b.first=u,a(u,"first");function d(T,w){let R=0;for(let x of T)if(w(x,R++))return!0;return!1}b.some=d,a(d,"some");function f(T,w){for(let R of T)if(w(R))return R}b.find=f,a(f,"find");function*h(T,w){for(let R of T)w(R)&&(yield R)}b.filter=h,a(h,"filter");function*m(T,w){let R=0;for(let x of T)yield w(x,R++)}b.map=m,a(m,"map");function*g(T,w){let R=0;for(let x of T)yield*w(x,R++)}b.flatMap=g,a(g,"flatMap");function*A(...T){for(let w of T)yield*w}b.concat=A,a(A,"concat");function y(T,w,R){let x=R;for(let P of T)x=w(x,P);return x}b.reduce=y,a(y,"reduce");function*E(T,w,R=T.length){for(w<-T.length&&(w=0),w<0&&(w+=T.length),R<0?R+=T.length:R>T.length&&(R=T.length);we.toString(),"defaultToKey")}set(e,r){return this.map.set(this.toKey(e),new jUt(e,r)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,r){typeof r<"u"&&(e=e.bind(r));for(let[n,o]of this.map)e(o.value,o.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(nyn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}},iyn,ryn=class{constructor(e,r){this[iyn]="ResourceSet";!e||typeof e=="function"?this._map=new Jze(e):(this._map=new Jze(r),e.forEach(this.add,this))}static{a(this,"ResourceSet")}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,r){this._map.forEach((n,o)=>e.call(r,o,o,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(iyn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};var oyn,HUt=class{constructor(){this[oyn]="LinkedMap";this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}static{a(this,"LinkedMap")}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=0){let n=this._map.get(e);if(n)return r!==0&&this.touch(n,r),n.value}set(e,r,n=0){let o=this._map.get(e);if(o)o.value=r,n!==0&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.key,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}values(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.value,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}entries(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:[n.key,n.value],done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}[(oyn=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._tail,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.previous,n--;this._tail=r,this._size=n,r&&(r.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==1&&r!==2)){if(r===1){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===2){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}},GUt=class extends HUt{static{a(this,"Cache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=2){return super.get(e,r)}peek(e){return super.get(e,0)}set(e,r){return super.set(e,r,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},Zze=class extends GUt{static{a(this,"LRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimOld(e)}set(e,r){return super.set(e,r),this.checkTrim(),this}};var Xze=class{constructor(){this.map=new Map}static{a(this,"SetMap")}add(e,r){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(r)}delete(e,r){let n=this.map.get(e);n&&(n.delete(r),n.size===0&&this.map.delete(e))}forEach(e,r){let n=this.map.get(e);n&&n.forEach(r)}get(e){let r=this.map.get(e);return r||new Set}};var NUo=!1,Vle=null;var syn=class t{constructor(){this.livingDisposables=new Map}static{a(this,"DisposableTracker")}static{this.idx=0}getDisposableData(e){let r=this.livingDisposables.get(e);return r||(r={parent:null,source:null,isSingleton:!1,value:e,idx:t.idx++},this.livingDisposables.set(e,r)),r}trackDisposable(e){let r=this.getDisposableData(e);r.source||(r.source=new Error().stack)}setParent(e,r){let n=this.getDisposableData(e);n.parent=r}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,r){let n=r.get(e);if(n)return n;let o=e.parent?this.getRootParent(this.getDisposableData(e.parent),r):e;return r.set(e,o),o}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,n])=>n.source!==null&&!this.getRootParent(n,e).isSingleton).flatMap(([n])=>n)}computeLeakingDisposables(e=10,r){let n;if(r)n=r;else{let u=new Map,d=[...this.livingDisposables.values()].filter(h=>h.source!==null&&!this.getRootParent(h,u).isSingleton);if(d.length===0)return;let f=new Set(d.map(h=>h.value));if(n=d.filter(h=>!(h.parent&&f.has(h.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function o(u){function d(h,m){for(;h.length>0&&m.some(g=>typeof g=="string"?g===h[0]:h[0].match(g));)h.shift()}a(d,"removePrefix");let f=u.source.split(` -`).map(h=>h.trim().replace("at ","")).filter(h=>h!=="");return d(f,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),f.reverse()}a(o,"getStackTracePath");let s=new Xze;for(let u of n){let d=o(u);for(let f=0;f<=d.length;f++)s.add(d.slice(0,f).join(` -`),u)}n.sort(Gle(u=>u.idx,$le));let c="",l=0;for(let u of n.slice(0,e)){l++;let d=o(u),f=[];for(let h=0;h{this._removeListener(e)}}emit(e){this.listeners.forEach(r=>{r(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},LQo=new x7t;function Xle(t){vxe(t)||LQo.onUnexpectedError(t)}a(Xle,"onUnexpectedError");var w7t="Canceled";function vxe(t){return t instanceof mg?!0:t instanceof Error&&t.name===w7t&&t.message===w7t}a(vxe,"isCancellationError");var mg=class extends Error{static{a(this,"CancellationError")}constructor(){super(w7t),this.name=this.message}};var bYe=class t extends Error{static{a(this,"ErrorNoTelemetry")}constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof t)return e;let r=new t;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},Qc=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};function R7t(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n{let o=Math.sin(n++)*179426549;return o-Math.floor(o)},"rand")}else r=Math.random;for(let n=t.length-1;n>0;n-=1){let o=Math.floor(r()*(n+1)),s=t[n];t[n]=t[o],t[o]=s}}a(P7t,"shuffle");var xEn;(l=>{function t(u){return u<0}l.isLessThan=t,a(t,"isLessThan");function e(u){return u<=0}l.isLessThanOrEqual=e,a(e,"isLessThanOrEqual");function r(u){return u>0}l.isGreaterThan=r,a(r,"isGreaterThan");function n(u){return u===0}l.isNeitherLessOrGreaterThan=n,a(n,"isNeitherLessOrGreaterThan"),l.greaterThan=1,l.lessThan=-1,l.neitherLessOrGreaterThan=0})(xEn||={});function eue(t,e){return(r,n)=>e(t(r),t(n))}a(eue,"compareBy");var tue=a((t,e)=>t-e,"numberComparator");var IEn=class t{constructor(e){this.iterate=e}static{a(this,"CallbackIterable")}static{this.empty=new t(e=>{})}forEach(e){this.iterate(r=>(e(r),!0))}toArray(){let e=[];return this.iterate(r=>(e.push(r),!0)),e}filter(e){return new t(r=>this.iterate(n=>e(n)?r(n):!0))}map(e){return new t(r=>this.iterate(n=>r(e(n))))}some(e){let r=!1;return this.iterate(n=>(r=e(n),!r)),r}findFirst(e){let r;return this.iterate(n=>e(n)?(r=n,!1):!0),r}findLast(e){let r;return this.iterate(n=>(e(n)&&(r=n),!0)),r}findLastMaxBy(e){let r,n=!0;return this.iterate(o=>((n||xEn.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};function Cxe(t,e){return t.reduce((r,n)=>r+e(n),0)}a(Cxe,"sumBy");p();function PEn(t,e){let r=Object.create(null);for(let n of t){let o=e(n),s=r[o];s||(s=r[o]=[]),s.push(n)}return r}a(PEn,"groupBy");var REn,kEn,wEn=class{constructor(e,r){this.toKey=r;this._map=new Map;this[REn]="SetWithKey";for(let n of e)this.add(n)}static{a(this,"SetWithKey")}get size(){return this._map.size}add(e){let r=this.toKey(e);return this._map.set(r,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,r){this._map.forEach(n=>e.call(r,n,n,this))}[(kEn=Symbol.iterator,REn=Symbol.toStringTag,kEn)](){return this.values()}};p();function D7t(t,e){let r=this,n=!1,o;return function(){if(n)return o;if(n=!0,e)try{o=t.apply(r,arguments)}finally{e()}else o=t.apply(r,arguments);return o}}a(D7t,"createSingleCallFunction");p();var N7t;(b=>{function t(T){return T&&typeof T=="object"&&typeof T[Symbol.iterator]=="function"}b.is=t,a(t,"is");let e=Object.freeze([]);function r(){return e}b.empty=r,a(r,"empty");function*n(T){yield T}b.single=n,a(n,"single");function o(T){return t(T)?T:n(T)}b.wrap=o,a(o,"wrap");function s(T){return T||e}b.from=s,a(s,"from");function*c(T){for(let w=T.length-1;w>=0;w--)yield T[w]}b.reverse=c,a(c,"reverse");function l(T){return!T||T[Symbol.iterator]().next().done===!0}b.isEmpty=l,a(l,"isEmpty");function u(T){return T[Symbol.iterator]().next().value}b.first=u,a(u,"first");function d(T,w){let R=0;for(let x of T)if(w(x,R++))return!0;return!1}b.some=d,a(d,"some");function f(T,w){for(let R of T)if(w(R))return R}b.find=f,a(f,"find");function*h(T,w){for(let R of T)w(R)&&(yield R)}b.filter=h,a(h,"filter");function*m(T,w){let R=0;for(let x of T)yield w(x,R++)}b.map=m,a(m,"map");function*g(T,w){let R=0;for(let x of T)yield*w(x,R++)}b.flatMap=g,a(g,"flatMap");function*A(...T){for(let w of T)yield*w}b.concat=A,a(A,"concat");function y(T,w,R){let x=R;for(let P of T)x=w(x,P);return x}b.reduce=y,a(y,"reduce");function*E(T,w,R=T.length){for(w<-T.length&&(w=0),w<0&&(w+=T.length),R<0?R+=T.length:R>T.length&&(R=T.length);we.toString(),"defaultToKey")}set(e,r){return this.map.set(this.toKey(e),new M7t(e,r)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,r){typeof r<"u"&&(e=e.bind(r));for(let[n,o]of this.map)e(o.value,o.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(NEn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}},MEn,DEn=class{constructor(e,r){this[MEn]="ResourceSet";!e||typeof e=="function"?this._map=new SYe(e):(this._map=new SYe(r),e.forEach(this.add,this))}static{a(this,"ResourceSet")}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,r){this._map.forEach((n,o)=>e.call(r,o,o,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(MEn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};var OEn,O7t=class{constructor(){this[OEn]="LinkedMap";this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}static{a(this,"LinkedMap")}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=0){let n=this._map.get(e);if(n)return r!==0&&this.touch(n,r),n.value}set(e,r,n=0){let o=this._map.get(e);if(o)o.value=r,n!==0&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.key,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}values(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.value,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}entries(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:[n.key,n.value],done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}[(OEn=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._tail,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.previous,n--;this._tail=r,this._size=n,r&&(r.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==1&&r!==2)){if(r===1){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===2){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}},L7t=class extends O7t{static{a(this,"Cache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=2){return super.get(e,r)}peek(e){return super.get(e,0)}set(e,r){return super.set(e,r,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},TYe=class extends L7t{static{a(this,"LRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimOld(e)}set(e,r){return super.set(e,r),this.checkTrim(),this}};var IYe=class{constructor(){this.map=new Map}static{a(this,"SetMap")}add(e,r){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(r)}delete(e,r){let n=this.map.get(e);n&&(n.delete(r),n.size===0&&this.map.delete(e))}forEach(e,r){let n=this.map.get(e);n&&n.forEach(r)}get(e){let r=this.map.get(e);return r||new Set}};var FQo=!1,rue=null;var LEn=class t{constructor(){this.livingDisposables=new Map}static{a(this,"DisposableTracker")}static{this.idx=0}getDisposableData(e){let r=this.livingDisposables.get(e);return r||(r={parent:null,source:null,isSingleton:!1,value:e,idx:t.idx++},this.livingDisposables.set(e,r)),r}trackDisposable(e){let r=this.getDisposableData(e);r.source||(r.source=new Error().stack)}setParent(e,r){let n=this.getDisposableData(e);n.parent=r}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,r){let n=r.get(e);if(n)return n;let o=e.parent?this.getRootParent(this.getDisposableData(e.parent),r):e;return r.set(e,o),o}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,n])=>n.source!==null&&!this.getRootParent(n,e).isSingleton).flatMap(([n])=>n)}computeLeakingDisposables(e=10,r){let n;if(r)n=r;else{let u=new Map,d=[...this.livingDisposables.values()].filter(h=>h.source!==null&&!this.getRootParent(h,u).isSingleton);if(d.length===0)return;let f=new Set(d.map(h=>h.value));if(n=d.filter(h=>!(h.parent&&f.has(h.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function o(u){function d(h,m){for(;h.length>0&&m.some(g=>typeof g=="string"?g===h[0]:h[0].match(g));)h.shift()}a(d,"removePrefix");let f=u.source.split(` +`).map(h=>h.trim().replace("at ","")).filter(h=>h!=="");return d(f,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),f.reverse()}a(o,"getStackTracePath");let s=new IYe;for(let u of n){let d=o(u);for(let f=0;f<=d.length;f++)s.add(d.slice(0,f).join(` +`),u)}n.sort(eue(u=>u.idx,tue));let c="",l=0;for(let u of n.slice(0,e)){l++;let d=o(u),f=[];for(let h=0;ho(E)[h]),E=>E);delete y[d[h]];for(let[E,_]of Object.entries(y))f.unshift(` - stacktraces of ${_.length} other leaks continue with ${E}`);f.unshift(m)}c+=` +`)),y=PEn([...A].map(E=>o(E)[h]),E=>E);delete y[d[h]];for(let[E,_]of Object.entries(y))f.unshift(` - stacktraces of ${_.length} other leaks continue with ${E}`);f.unshift(m)}c+=` ==================== Leaking disposable ${l}/${n.length}: ${u.value.constructor.name} ==================== @@ -2435,7 +2435,7 @@ ${f.join(` ... and ${n.length-e} more leaking disposables -`),{leaks:n,details:c}}};function MUo(t){Vle=t}a(MUo,"setDisposableTracker");if(NUo){let t="__is_disposable_tracked__";MUo(new class{trackDisposable(e){let r=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[t]||console.log(r)},3e3)}setParent(e,r){if(e&&e!==G_.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==G_.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function VUt(t){return Vle?.trackDisposable(t),t}a(VUt,"trackDisposable");function WUt(t){Vle?.markAsDisposed(t)}a(WUt,"markAsDisposed");function $Ut(t,e){Vle?.setParent(t,e)}a($Ut,"setParentOfDisposable");function OUo(t,e){if(Vle)for(let r of t)Vle.setParent(r,e)}a(OUo,"setParentOfDisposables");function ayn(t){if(qUt.is(t)){let e=[];for(let r of t)if(r)try{r.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}a(ayn,"dispose");function cyn(...t){let e=eYe(()=>ayn(t));return OUo(t,e),e}a(cyn,"combinedDisposable");function eYe(t){let e=VUt({dispose:QUt(()=>{WUt(e),t()})});return e}a(eYe,"toDisposable");var eq=class t{constructor(){this._toDispose=new Set;this._isDisposed=!1;VUt(this)}static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(WUt(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ayn(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return $Ut(e,this),this._isDisposed?t.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),$Ut(e,null))}},G_=class{constructor(){this._store=new eq;VUt(this),$Ut(this._store,this)}static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}dispose(){WUt(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};p();function Wle(t){let e=new Date(t);if(Number.isNaN(e.getTime()))return t;let r=new Date,n=e.getFullYear()!==r.getFullYear();return new Intl.DateTimeFormat("en-US",n?{month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}:{month:"long",day:"numeric",hour:"numeric",minute:"2-digit"}).format(e)}a(Wle,"formatResetDate");var tq=class{static{a(this,"QuotaWarningNotifier")}};var bK=class{static{a(this,"QuotaChangeNotifier")}};var zUt=[50,75,90,95],Au=class extends G_{constructor(r){super();this._shownThresholds={chat:new Set,completions:new Set,premium_interactions:new Set};this._hasNotifiedOverage={};this._isTBBEnabled=!1;this._canUpgradePlan=!1;this._turnCredits=new Map;this._ctx=r,this._register(bs(r,n=>{let o=n.userInfo?.raw?.analytics_tracking_id;if(o!==this._userId){for(let s of Object.values(this._shownThresholds))s.clear();this._hasNotifiedOverage={},this._turnCredits.clear(),this._userId=o}this._copilotPlan=n.userInfo.copilotPlan,this._isTBBEnabled=!!n.userInfo?.isTBBEnabled,this._canUpgradePlan=!!n.userInfo?.canUpgradePlan,this.processUserInfoQuotaSnapshot(n.userInfo?.raw)}))}static{a(this,"ChatQuotaService")}get overageEnabled(){return this._quotaInfo?.chat?.overageEnabled===!0||this._quotaInfo?.completions?.overageEnabled===!0||this._quotaInfo?.premium_interactions?.overageEnabled===!0}get quotaExhausted(){return this._quotaInfo?.premium_interactions?this._quotaInfo.premium_interactions.used>=this._quotaInfo.premium_interactions.quota&&!this._quotaInfo.premium_interactions.overageEnabled:!1}setLastCopilotUsage(r,n){let o=r/1e9;this.addAic(o,n)}addAic(r,n){r>0&&this._turnCredits.set(n,(this._turnCredits.get(n)??0)+r)}transferTurnCredits(r,n){if(r===n)return;let o=this._turnCredits.get(r);o!==void 0&&(this._turnCredits.delete(r),this.addAic(o,n))}resetTurnCredits(r){this._turnCredits.delete(r)}getCreditsForTurn(r){return this._turnCredits.get(r)}clearQuota(){this._quotaInfo=void 0}processQuotaHeaders(r){let n=r.get("x-quota-snapshot-premium_models")||r.get("x-quota-snapshot-premium_interactions"),o=r.get("x-quota-snapshot-chat"),s=r.get("x-quota-snapshot-completions");!n&&!o&&!s||(this._quotaInfo={chat:this._parseQuotaHeader(o),completions:this._parseQuotaHeader(s),premium_interactions:this._parseQuotaHeader(n)},this.sendQuotaChangeNotification(),this._isTBBEnabled&&(this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse()))}processUserInfoQuotaSnapshot(r){if(!r?.quota_snapshots)return;let{chat:n,completions:o,premium_interactions:s}=r.quota_snapshots;this._quotaInfo={chat:n?this._buildSnapshotFromRaw(n):void 0,completions:o?this._buildSnapshotFromRaw(o):void 0,premium_interactions:s?this._buildSnapshotFromRaw(s):void 0},this.sendQuotaChangeNotification(),this._isTBBEnabled&&(this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse())}_parseQuotaHeader(r){if(r)try{let n=new URLSearchParams(r),o=Number.parseInt(n.get("ent")||"0",10),s=Number.parseFloat(n.get("ov")||"0.0"),c=n.get("ovPerm")==="true",l=Number.parseFloat(n.get("rem")||"0.0"),u=n.get("rst")??"",d=Math.max(0,o*(1-l/100)),f=o<0;return{quota:o,used:d,percentRemaining:l,overageUsed:s,overageEnabled:c,resetDate:u,unlimited:f}}catch(n){console.error("Failed to parse quota header",n);return}}_buildSnapshotFromRaw(r){return{overageEnabled:r.overage_permitted,overageUsed:r.overage_count,quota:r.entitlement,percentRemaining:r.percent_remaining,resetDate:r.quota_reset_at!=null&&r.quota_reset_at!==0?new Date(r.quota_reset_at*1e3).toISOString():"",used:Math.max(0,r.entitlement*(1-r.percent_remaining/100)),unlimited:r.unlimited}}async sendQuotaChangeNotification(){if(!this._quotaInfo)return;let r={chat:this._quotaInfo.chat,completions:this._quotaInfo.completions,premium_interactions:this._quotaInfo.premium_interactions,copilotPlan:this._copilotPlan};if(this._hasQuotaChanged(r)){this._lastSentQuotaParams=r;try{await this._ctx.get(bK).notifyQuotaChange(r)}catch(n){console.warn("Failed to send quota change notification",n)}}}_hasQuotaChanged(r){let n=this._lastSentQuotaParams;return n?n.copilotPlan!==r.copilotPlan||this._hasSnapshotChanged(n.chat,r.chat)||this._hasSnapshotChanged(n.completions,r.completions)||this._hasSnapshotChanged(n.premium_interactions,r.premium_interactions):!0}_hasSnapshotChanged(r,n){return r===void 0&&n===void 0?!1:r===void 0||n===void 0?!0:r.overageUsed!==n.overageUsed||r.overageEnabled!==n.overageEnabled||r.percentRemaining!==n.percentRemaining||r.quota!==n.quota||r.used!==n.used||r.resetDate!==n.resetDate}_isSnapshotNotificationActive(r){return r?.notified?!r.resetDate||new Date=0;s--){let c=zUt[s];if(o>=c&&!n.has(c)){for(let l=0;l<=s;l++)n.add(zUt[l]);return c}}}async _checkAndNotifyOverageSnapshot(r,n,o){if(!(!r||r.quota<=0)&&r.percentRemaining===0&&r.overageEnabled&&!this._isSnapshotNotificationActive(this._hasNotifiedOverage[n])){this._hasNotifiedOverage={...this._hasNotifiedOverage,[n]:{notified:!0,resetDate:r.resetDate}};try{await this._ctx.get(tq).notifyQuotaWarning(this._buildWarningParams(o,"info"))}catch{}}}async checkAndNotifyOverageInUse(){this._quotaInfo&&(this._copilotPlan==="free"?(await this._checkAndNotifyOverageSnapshot(this._quotaInfo.chat,"chat","You are currently on overage spend until your chat limit resets."),await this._checkAndNotifyOverageSnapshot(this._quotaInfo.completions,"completions","You are currently on overage spend until your completions limit resets.")):await this._checkAndNotifyOverageSnapshot(this._quotaInfo.premium_interactions,"premium_interactions","You are currently on overage spend until your monthly limit resets."))}async checkAndNotifyQuotaThreshold(){if(!this._quotaInfo)return;let r=a(async(n,o)=>{let s=this._shownThresholds[o];if(this.clearStaleThresholds(n,s),this.checkThreshold(n,s)===void 0||!n)return;let l=n&&100-n.percentRemaining>=90?"warning":"info",u=100-n.percentRemaining,d=this.getQuotaThresholdMessage(o,u,n.resetDate);try{await this._ctx.get(tq).notifyQuotaWarning(this._buildWarningParams(d,l))}catch{}},"notifyForSnapshot");this._copilotPlan==="free"?(await r(this._quotaInfo.chat,"chat"),await r(this._quotaInfo.completions,"completions")):await r(this._quotaInfo.premium_interactions,"premium_interactions")}getQuotaThresholdMessage(r,n,o){return r==="chat"||r==="completions"?n>=95?`You're close to your ${r} limit. Upgrade your plan to continue uninterrupted.`:`You've used over ${n}% of your ${r} budget. Upgrade your plan to continue uninterrupted.`:o?`You've used over ${n}% of your included AI credits. Limits reset on ${Wle(o)}.`:`You've used over ${n}% of your included AI credits.`}};async function tYe(t){let e=await t.get(Ur).resolveSession();if(e){let r=await cbe(t,e);if(r.ok){let n=await r.json();t.get(Au).processUserInfoQuotaSnapshot(n)}}}a(tYe,"refreshUserQuota");p();p();var rxe=new fe("openAICompatibleLMProvider"),zle={[io.OpenAI]:"https://api.openai.com/v1",[io.Gemini]:"https://generativelanguage.googleapis.com/v1beta/openai",[io.Groq]:"https://api.groq.com/openai/v1",[io.OpenRouter]:"https://openrouter.ai/api/v1",[io.Anthropic]:"https://api.anthropic.com/v1"},Zx=class{constructor(e,r){this._lastFetchTime=0;this.providerName=e,this.ctx=r}static{a(this,"BaseOpenAICompatibleLMProvider")}async getAllModels(){await this.ensureKnownModelsCache();try{let e=this.getFetchModelUrl(),r={"Content-Type":"application/json"},n=await new da(this.ctx.get(Yn)).getAPIKey(this.providerName);n&&(r.Authorization=`Bearer ${n}`);let o=await fetch(e,{method:"GET",headers:r});if(!o.ok)throw new Error(`Failed to fetch models: ${o.status} ${o.statusText}`);let s=await o.json();if(s.error)throw new Error(`API Error: ${JSON.stringify(s.error)}`);let c=[];for(let l of s.data){let u=this._knownModels?.[l.id];u&&c.push({providerName:this.providerName,modelId:l.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:u})}return c}catch(e){throw rxe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}getBaseUrl(){let e=zle[this.providerName];if(!e)throw new Error(`Unsupported provider: ${this.providerName}`);return e}getFetchModelUrl(){return`${this.getBaseUrl()}/models`}async ensureKnownModelsCache(){let e=Date.now();!this._knownModels&&(this._knownModels=await this.fetchKnownModelList(),this._lastFetchTime=e)}async fetchKnownModelList(){let e=await(await this.ctx.get(tr).fetch("https://main.vscode-cdn.net/extensions/copilotChat.json",{method:"GET"})).json(),r;return e.version!==1?r={}:r=e.modelInfo[this.providerName]||{},r}};p();async function*nxe(t,e){for await(let r of t)yield e(r)}a(nxe,"asyncIterableMap");async function*lyn(t,e){for await(let r of t)await e(r)&&(yield r)}a(lyn,"asyncIterableFilter");async function*ixe(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(ixe,"asyncIterableMapFilter");p();var rYe="interleaved-thinking-2025-05-14",uyn="2023-06-01";p();var BP=class{static{a(this,"EndpointStrategyFactory")}static{this.strategies=new Map}static register(e){this.strategies.set(e.name,e)}static getStrategy(e){let r=this.strategies.get(e);if(!r){let n=this.strategies.get("completions");if(!n)throw new Error(`No strategy registered for endpoint '${e}' and no fallback strategy available. Available: ${Array.from(this.strategies.keys()).join(", ")}`);return n}return r}static hasStrategy(e){return this.strategies.has(e)}};p();var el=class{static{a(this,"ModelConfigurationProvider")}},nYe=class extends el{constructor(r){super();this.ctx=r}static{a(this,"DefaultModelConfigurationProvider")}async getBestChatModelConfig(r,n,o=!1){let s=[];for(let c of r){let l=await this.getFirstMatchingChatModelConfiguration(c,n,o);l&&s.push(l)}if(s.length>0){let c=s.find(l=>l.isExperimental);return c||s[0]}throw ot.error(this.ctx,`No model configuration found for families: ${r.join(", ")}. Available models: ${JSON.stringify(await this.ctx.get(xs).getMetadata())}`),new Error("No model configuration found")}async getFirstMatchingModelMetadata(r){let n=await this.ctx.get(xs).getMetadata(),o=BUo(n,r);if(o.length>0)return o[0]}async getFirstMatchingChatModelConfiguration(r,n,o){let s=await this.getFirstMatchingModelMetadata({family:r,type:"chat",supports:n,modelPickerEnabled:o});if(s===void 0)return;let c=s.supported_endpoints&&s.supported_endpoints.length>0?s.supported_endpoints:["/chat/completions"],l=s.capabilities.supports?.adaptive_thinking??!1,u=s.capabilities.supports?.reasoning_effort;return r===Rn.Gpt35turbo||r===Rn.Gpt4oMini?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:KUt(6144,s),maxLongContextTokens:void 0,maxResponseTokens:YUt(2048,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:r===Rn.Gpt4||r===Rn.Gpt4turbo?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:KUt(10240,s),maxLongContextTokens:void 0,maxResponseTokens:YUt(4096,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:r===Rn.Gpt4o?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:await LUo(this.ctx,s),maxLongContextTokens:void 0,maxResponseTokens:YUt(4096,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:dyn(s),maxLongContextTokens:fyn(s),maxResponseTokens:s.capabilities.limits?.max_output_tokens??4096,baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}}async getModelConfigurationById(r){let o=(await this.ctx.get(xs).getMetadata()).find(c=>c.id===r&&c.capabilities.type==="chat"&&c.model_picker_enabled===!0);if(!o)return;let s=o.supported_endpoints&&o.supported_endpoints.length>0?o.supported_endpoints:["/chat/completions"];return{modelId:o.id,uiName:o.name,modelFamily:o.capabilities.family,maxRequestTokens:dyn(o),maxLongContextTokens:fyn(o),maxResponseTokens:o.capabilities.limits?.max_output_tokens??4096,baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:o.capabilities.tokenizer,isExperimental:o.isExperimental??!1,stream:o.capabilities.supports?.streaming??!1,toolCalls:o.capabilities.supports?.tool_calls??!1,supportedEndpoints:s,supportsAdaptiveThinking:o.capabilities.supports?.adaptive_thinking??!1,reasoningEfforts:o.capabilities.supports?.reasoning_effort,originalBillingMultiplier:o.billing?.multiplier??0}}async getFirstMatchingEmbeddingModelConfiguration(r){let n=await this.getFirstMatchingModelMetadata({family:r,type:"embeddings"});if(n!==void 0&&r===Tun.textEmbedding3Small)return{modelId:n.id,modelFamily:r,maxBatchSize:n.capabilities.limits?.max_inputs??16,maxTokens:8191,tokenizer:"cl100k_base"}}};async function LUo(t,e){let r=t.get(Zt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments(),o=r.ideChatMaxRequestTokens(n);return o===-1&&(o=16384),KUt(o,e)}a(LUo,"getExpRequestTokens");function KUt(t,e){return e.capabilities.limits?.max_prompt_tokens?Math.min(t,e.capabilities.limits.max_prompt_tokens):t}a(KUt,"getRequestTokens");function dyn(t){return t.billing?.token_prices?.default?.context_max??t.capabilities.limits?.max_prompt_tokens??8192}a(dyn,"getMaxRequestTokens");function fyn(t){return t.billing?.token_prices?.long_context?.context_max}a(fyn,"getMaxLongContextTokens");function YUt(t,e){return e.capabilities.limits?.max_output_tokens?Math.min(t,e.capabilities.limits.max_output_tokens):t}a(YUt,"getResponseTokens");function BUo(t,e){return t.filter(r=>r.capabilities.type!==e.type||r.capabilities.family!==e.family&&!(r.is_chat_fallback===!0&&r.id===e.family)||r.capabilities.family===e.family&&r.id!==e.family&&r.is_chat_fallback===!0||e.modelPickerEnabled===!0&&!r.model_picker_enabled?!1:r.capabilities.supports===void 0||e.supports===void 0?!0:Object.keys(e.supports).every(n=>e.supports?.[n]===r.capabilities.supports?.[n]))}a(BUo,"filterModelsByCapabilities");function mO(t,e){if(e)return e;if(!(!t||t.length===0))return t.includes("medium")?"medium":t[0]}a(mO,"pickReasoningEffort");function FUo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/responses")}a(FUo,"shouldUseResponsesApi");function UUo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/v1/messages")&&!e.includes("/responses")}a(UUo,"shouldUseMessagesApi");var pyn=["completions","responses","v1/messages"];function iYe(t,e){return e?"v1/messages":t&&FUo(t)?"responses":"completions"}a(iYe,"resolveEndpointRoute");function oYe(t,e){if(!UUo(e))return!1;let r=Ft(t,Ye.AnthropicMessagesEndpoint);return r==="true"?!0:r!=="false"}a(oYe,"willUseMessagesEndpoint");p();function sYe(t){let e=t.toLowerCase();return e.startsWith("gpt")&&e.includes("-codex")}a(sYe,"isCodexStyleGptModel");function hyn(t){return t?t.toLowerCase().startsWith("gpt-5"):!1}a(hyn,"isGpt5PlusFamily");function myn(t){return t?t.toLowerCase().startsWith("claude"):!1}a(myn,"isAnthropicModel");p();p();function gyn(t,e){if(!e||!e.providerName)return;let r=e.apiType==="messages";e.providerName===io.Anthropic?(delete t.temperature,delete t.top_p):e.supportsThinking&&(delete t.temperature,!r&&"max_tokens"in t&&(t.max_completion_tokens=t.max_tokens,delete t.max_tokens)),e.providerName&&!r&&delete t.max_tokens}a(gyn,"adaptRequestForBYOKProvider");p();p();var qS=class{static{a(this,"RateLimitNotifier")}},aYe=class extends qS{static{a(this,"NullRateLimitNotifier")}async notifyRateLimitWarning(e){}};var JUt=[50,75,90,95],gO=class extends G_{constructor(r){super();this.ctx=r;this._shownSessionThresholds=new Set;this._shownWeeklyThresholds=new Set;this._register(bs(r,()=>{this._shownSessionThresholds.clear(),this._shownWeeklyThresholds.clear(),this.clearRateLimits()}))}static{a(this,"ChatUsageRateLimitService")}get weeklyRateLimit(){return this._weeklyRateLimit}get sessionRateLimit(){return this._sessionRateLimit}clearRateLimits(){this._weeklyRateLimit=void 0,this._sessionRateLimit=void 0}processRateLimitHeaders(r){let n=r.get("x-usage-ratelimit-weekly"),o=r.get("x-usage-ratelimit-session");if(!n&&!o)return;n&&(this._weeklyRateLimit=this.parseRateLimitHeader(n)),o&&(this._sessionRateLimit=this.parseRateLimitHeader(o)),this.clearStaleThresholds(this._sessionRateLimit,this._shownSessionThresholds),this.clearStaleThresholds(this._weeklyRateLimit,this._shownWeeklyThresholds);let s=this.checkThreshold(this._sessionRateLimit,this._shownSessionThresholds,"session")??this.checkThreshold(this._weeklyRateLimit,this._shownWeeklyThresholds,"weekly");s&&this.ctx.get(qS).notifyRateLimitWarning(s)}clearStaleThresholds(r,n){if(!r){n.clear();return}let o=100-r.percentRemaining;for(let s of n)o=0;c--){let l=JUt[c];if(s>=l&&!n.has(l)){for(let d=0;d<=c;d++)n.add(JUt[d]);let u=this.getRateLimitMessage(o,r);return{type:o,rateLimit:r,message:u}}}}getRateLimitMessage(r,n){let o=Math.round(100-n.percentRemaining),s=Wle(n.resetDate);return r==="session"?`You've used ${o}% of your session rate limit. Your session rate limit will reset on ${s}.`:`You've used ${o}% of your weekly rate limit. Your weekly rate limit will reset on ${s}.`}parseRateLimitHeader(r){try{let n=new URLSearchParams(r),o=Number.parseInt(n.get("ent")||"0",10),s=Number.parseFloat(n.get("rem")||"0.0"),c=n.get("rst")||"";return{entitlement:o,percentRemaining:s,resetDate:c}}catch(n){console.error("Failed to parse rate limit header",n);return}}};p();var fg="https://aka.ms/github-copilot-rate-limit-error";function QUo(t){if(t<90)return`${t} ${t===1?"second":"seconds"}`;let e=Math.floor(t/60);if(t<=5400)return`${e} ${e===1?"minute":"minutes"}`;let r=Math.floor(e/60),n=e%60,o=`${r} ${r===1?"hour":"hours"}`;return n>0&&(o+=` ${n} ${n===1?"minute":"minutes"}`),o}a(QUo,"secondsToHumanReadableTime");var $_=class t{static{a(this,"CapiErrorTranslator")}static formatRequestId(e,r){let n=[];return e&&n.push(`Request ID: ${e}`),r&&n.push(`GitHub Request ID: ${r}`),n.length>0?` ${n.join(" | ")}`:""}static appendRequestId(e,r,n){return`${e}${t.formatRequestId(r,n)}`}static translateErrorMessage(e,r,n,o,s,c){let l;switch(e){case 466:l="Oops, your plugin is out of date. Please update it.";break;case 401:l="Oops, you are not authorized. Please sign in. If you are using a custom model, please check if the API key is still valid.";break;case 402:l=r||"Oops, you need to upgrade your plan.";break;case 413:l="Oops, your request is too large. Please try again with a smaller input.";break;case 429:l=t.getRateLimitMessage(o,c);break;case 503:l=r||"Oops, the service is currently unavailable. Please try again later.";break;default:if(r&&r.trim().length>0){let u=360,d=t.formatRequestId(n,s),f="Sorry, an error occurred while generating a response. Details: ",h=u-f.length-d.length;if(r.length<=h)return`${f}${r}${d}`;{let m=r.substring(0,h);return`${f}${m}... Read more from logs.${d}`}}l="Sorry, an error occurred while generating a response.";break}return t.appendRequestId(l,n,s)}static getRateLimitMessage(e,r){let n=e===void 0?"a moment":QUo(e),o=r?.capiErrorCode,s=r?.suggestSwitchToAuto??!r?.isAuto;if(o?.startsWith("agent_mode_limit_exceeded"))return`Sorry, you have exceeded the agent mode rate limit. Please switch to ask mode and try again in ${n}. [Learn More](${fg})`;if(o?.startsWith("model_overloaded")||o?.startsWith("upstream_provider_rate_limit"))return s?`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n} or consider switching to Auto. [Learn More](${fg})`:`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n}. [Learn More](${fg})`;if(o?.startsWith("user_global_rate_limited"))return r?.copilotPlan==="free"||r?.copilotPlan==="individual"||r?.copilotPlan==="individual_pro"?`You've hit your session rate limit. Please upgrade your plan or wait ${n} for your limit to reset. [Learn More](${fg})`:`You've hit your session rate limit. Please wait ${n} for your limit to reset. [Learn More](${fg})`;if(o?.startsWith("user_weekly_rate_limited")){if(e!==void 0){let l=new Date(Date.now()+e*1e3).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"});return r?.copilotPlan==="free"||r?.copilotPlan==="individual"||r?.copilotPlan==="individual_pro"?s?`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${fg})`:`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l}. [Learn More](${fg})`:s?`You've reached your weekly rate limit. Please wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${fg})`:`You've reached your weekly rate limit. Please wait for your limit to reset on ${l}. [Learn More](${fg})`}return s?`You've reached your weekly rate limit. Please wait ${n} for your limit to reset or consider switching to Auto. [Learn More](${fg})`:`You've reached your weekly rate limit. Please wait ${n} for your limit to reset. [Learn More](${fg})`}return o?.startsWith("user_model_rate_limited")?s?`You've hit the rate limit for this model. Please try switching to Auto or try again in ${n}. [Learn More](${fg})`:`You've hit the rate limit for this model. Please try again in ${n}. [Learn More](${fg})`:o?.startsWith("integration_rate_limited")?`Sorry, GitHub Copilot Chat is currently experiencing high demand. Please try again in ${n}. [Learn More](${fg})`:o?s?`Sorry, you have been rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${fg})`:`Sorry, you have been rate-limited. Please wait ${n} before trying again. [Learn More](${fg})`:s?`Sorry, your request was rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${fg})`:`Sorry, your request was rate-limited. Please wait ${n} before trying again. [Learn More](${fg})`}static translate402Reason(e,r){let n=r.retryAfterHeader,o=r.retryAfterSeconds;if(e.includes("free_quota_exceeded"))return n?`You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait until ${new Date(n).toLocaleString()} for your limit to reset.`:"You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.";if(e.includes("additional_spend_limit_reached"))return"You've reached your additional usage limit for your plan. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.";if(e.includes("overage_limit_reached"))return r.isTBBEnabled?"You've reached your additional usage limit for your plan. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.":"You cannot accrue additional overages at this time. Please contact [GitHub Support](https://support.github.com/contact) to continue using Copilot.";if(e.includes("quota_exceeded")){if(r.isTBBEnabled){let s="";o!==void 0&&(s=` Quota resets on ${new Date(Date.now()+o*1e3).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}.`);let c=r.overageEnabled?"increase budget":"enable additional overages",l=r.canUpgradePlan?", upgrade your plan":"";switch(r.copilotPlan){case"free":return`You've used your monthly chat messages limit. Please upgrade your plan or wait for your allowance to renew.${s}`;case"individual":case"individual_pro":return`You've used your monthly AI Credits. Please ${c}${l} or wait for your allowance to renew.${s}`;case"individual_max":return`You've used your monthly AI Credits. Please ${c} or wait for your allowance to renew.${s}`;case"business":case"enterprise":return`You've used your monthly AI Credits. Please reach out to your organization's Copilot admin to ${c} or wait for your allowance to renew.${s}`;default:return`You've used your monthly AI Credits.${s}`}}switch(r.copilotPlan){case"free":return"You've reached your monthly chat messages quota. Upgrade to Copilot Pro (30-day free trial) or wait for your allowance to renew.";case"individual":return"You've reached your monthly chat messages quota. Please enable additional paid premium requests, upgrade to Copilot Pro+, or wait for your allowance to renew.";case"individual_pro":return"You've reached your monthly chat messages quota. Please enable additional paid premium requests or wait for your allowance to renew.";case"business":case"enterprise":return"You've reached your monthly chat messages quota. Please reach out to your organization's Copilot admin to enable additional paid premium requests or wait for your allowance to renew.";default:return"You've reached your monthly chat messages quota."}}return e.includes("session_quota_exceeded")?o!==void 0?`You've used your session quota. Wait until ${new Date(Date.now()+o*1e3).toLocaleString()} for your limit to reset.`:"You've used your session quota.":e.includes("billing_not_configured")?"You have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, you must select a billing entity via the GitHub site, under Settings > Copilot > Billing.":r.isTBBEnabled?"Usage limit exceeded. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.":"Quota Exceeded."}static translate400Reason(e,r){if(e.includes("off_topic"))return"filtered as off_topic by intent classifier: message was not programming related";if(e.includes("model_not_supported"))return r?`model is not supported: ${r}`:"model is not supported.";if(e.includes("model_max_prompt_tokens_exceeded"))return"model max prompt tokens exceeded."}};p();p();p();var rq="copilot-edits-session";p();p();p();p();Mo();function cYe(t,e,r,n,o,s,c){return _Kr(t,e,r,o,n,c),{completionText:e,meanLogProb:qUo(t,r),meanAlternativeLogProb:jUo(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:Mt(),finishReason:r.finish_reason}}a(cYe,"convertToAPIChoice");function qUo(t,e){if(e?.logprobs?.token_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--)r+=e.logprobs.token_logprobs[s],n+=1;return n>0?r/n:void 0}catch(r){Nr.exception(t,r,"Error calculating mean prob")}}a(qUo,"calculateMeanLogProb");function jUo(t,e){if(e?.logprobs?.top_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--){let c={...e.logprobs.top_logprobs[s]};delete c[e.logprobs.tokens[s]],r+=Math.max(...Object.values(c)),n+=1}return n>0?r/n:void 0}catch(r){Nr.exception(t,r,"Error calculating mean prob")}}a(jUo,"calculateMeanAlternativeLogProb");function Yle(t,e){return O1(t)||e<=1?0:e<10?.2:e<20?.4:.8}a(Yle,"getTemperatureForSamples");var HUo={markdown:[` +`),{leaks:n,details:c}}};function UQo(t){rue=t}a(UQo,"setDisposableTracker");if(FQo){let t="__is_disposable_tracked__";UQo(new class{trackDisposable(e){let r=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[t]||console.log(r)},3e3)}setParent(e,r){if(e&&e!==z_.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==z_.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function F7t(t){return rue?.trackDisposable(t),t}a(F7t,"trackDisposable");function U7t(t){rue?.markAsDisposed(t)}a(U7t,"markAsDisposed");function B7t(t,e){rue?.setParent(t,e)}a(B7t,"setParentOfDisposable");function QQo(t,e){if(rue)for(let r of t)rue.setParent(r,e)}a(QQo,"setParentOfDisposables");function BEn(t){if(N7t.is(t)){let e=[];for(let r of t)if(r)try{r.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}a(BEn,"dispose");function FEn(...t){let e=xYe(()=>BEn(t));return QQo(t,e),e}a(FEn,"combinedDisposable");function xYe(t){let e=F7t({dispose:D7t(()=>{U7t(e),t()})});return e}a(xYe,"toDisposable");var pq=class t{constructor(){this._toDispose=new Set;this._isDisposed=!1;F7t(this)}static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(U7t(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{BEn(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return B7t(e,this),this._isDisposed?t.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),B7t(e,null))}},z_=class{constructor(){this._store=new pq;F7t(this),B7t(this._store,this)}static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}dispose(){U7t(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};p();function nue(t){let e=new Date(t);if(Number.isNaN(e.getTime()))return t;let r=new Date,n=e.getFullYear()!==r.getFullYear();return new Intl.DateTimeFormat("en-US",n?{month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}:{month:"long",day:"numeric",hour:"numeric",minute:"2-digit"}).format(e)}a(nue,"formatResetDate");var hq=class{static{a(this,"QuotaWarningNotifier")}};var NK=class{static{a(this,"QuotaChangeNotifier")}};var Q7t=[50,75,90,95],Eu=class extends z_{constructor(r){super();this._shownThresholds={chat:new Set,completions:new Set,premium_interactions:new Set};this._hasNotifiedOverage={};this._isTBBEnabled=!1;this._canUpgradePlan=!1;this._turnCredits=new Map;this._ctx=r,this._register(vs(r,n=>{let o=n.userInfo?.raw?.analytics_tracking_id;if(o!==this._userId){for(let s of Object.values(this._shownThresholds))s.clear();this._hasNotifiedOverage={},this._turnCredits.clear(),this._userId=o}this._copilotPlan=n.userInfo.copilotPlan,this._isTBBEnabled=!!n.userInfo?.isTBBEnabled,this._canUpgradePlan=!!n.userInfo?.canUpgradePlan,this.processUserInfoQuotaSnapshot(n.userInfo?.raw)}))}static{a(this,"ChatQuotaService")}get overageEnabled(){return this._quotaInfo?.chat?.overageEnabled===!0||this._quotaInfo?.completions?.overageEnabled===!0||this._quotaInfo?.premium_interactions?.overageEnabled===!0}get quotaExhausted(){return this._quotaInfo?.premium_interactions?this._quotaInfo.premium_interactions.used>=this._quotaInfo.premium_interactions.quota&&!this._quotaInfo.premium_interactions.overageEnabled:!1}setLastCopilotUsage(r,n){let o=r/1e9;this.addAic(o,n)}addAic(r,n){r>0&&this._turnCredits.set(n,(this._turnCredits.get(n)??0)+r)}transferTurnCredits(r,n){if(r===n)return;let o=this._turnCredits.get(r);o!==void 0&&(this._turnCredits.delete(r),this.addAic(o,n))}resetTurnCredits(r){this._turnCredits.delete(r)}getCreditsForTurn(r){return this._turnCredits.get(r)}clearQuota(){this._quotaInfo=void 0}processQuotaHeaders(r){let n=r.get("x-quota-snapshot-premium_models")||r.get("x-quota-snapshot-premium_interactions"),o=r.get("x-quota-snapshot-chat"),s=r.get("x-quota-snapshot-completions");!n&&!o&&!s||(this._quotaInfo={chat:this._parseQuotaHeader(o),completions:this._parseQuotaHeader(s),premium_interactions:this._parseQuotaHeader(n)},this.sendQuotaChangeNotification(),this._isTBBEnabled&&(this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse()))}processUserInfoQuotaSnapshot(r){if(!r?.quota_snapshots)return;let{chat:n,completions:o,premium_interactions:s}=r.quota_snapshots;this._quotaInfo={chat:n?this._buildSnapshotFromRaw(n):void 0,completions:o?this._buildSnapshotFromRaw(o):void 0,premium_interactions:s?this._buildSnapshotFromRaw(s):void 0},this.sendQuotaChangeNotification(),this._isTBBEnabled&&(this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse())}_parseQuotaHeader(r){if(r)try{let n=new URLSearchParams(r),o=Number.parseInt(n.get("ent")||"0",10),s=Number.parseFloat(n.get("ov")||"0.0"),c=n.get("ovPerm")==="true",l=Number.parseFloat(n.get("rem")||"0.0"),u=n.get("rst")??"",d=Math.max(0,o*(1-l/100)),f=o<0;return{quota:o,used:d,percentRemaining:l,overageUsed:s,overageEnabled:c,resetDate:u,unlimited:f}}catch(n){console.error("Failed to parse quota header",n);return}}_buildSnapshotFromRaw(r){return{overageEnabled:r.overage_permitted,overageUsed:r.overage_count,overageEntitlement:r.overage_entitlement,creditsUsed:r.credits_used,quota:r.entitlement,percentRemaining:r.percent_remaining,resetDate:r.quota_reset_at!=null&&r.quota_reset_at!==0?new Date(r.quota_reset_at*1e3).toISOString():"",used:Math.max(0,r.entitlement*(1-r.percent_remaining/100)),unlimited:r.unlimited}}async sendQuotaChangeNotification(){if(!this._quotaInfo)return;let r={chat:this._quotaInfo.chat,completions:this._quotaInfo.completions,premium_interactions:this._quotaInfo.premium_interactions,copilotPlan:this._copilotPlan};if(this._hasQuotaChanged(r)){this._lastSentQuotaParams=r;try{await this._ctx.get(NK).notifyQuotaChange(r)}catch(n){console.warn("Failed to send quota change notification",n)}}}_hasQuotaChanged(r){let n=this._lastSentQuotaParams;return n?n.copilotPlan!==r.copilotPlan||this._hasSnapshotChanged(n.chat,r.chat)||this._hasSnapshotChanged(n.completions,r.completions)||this._hasSnapshotChanged(n.premium_interactions,r.premium_interactions):!0}_hasSnapshotChanged(r,n){return r===void 0&&n===void 0?!1:r===void 0||n===void 0?!0:r.overageUsed!==n.overageUsed||r.overageEnabled!==n.overageEnabled||r.percentRemaining!==n.percentRemaining||r.quota!==n.quota||r.used!==n.used||r.resetDate!==n.resetDate}_isSnapshotNotificationActive(r){return r?.notified?!r.resetDate||new Date=0;s--){let c=Q7t[s];if(o>=c&&!n.has(c)){for(let l=0;l<=s;l++)n.add(Q7t[l]);return c}}}async _checkAndNotifyOverageSnapshot(r,n,o){if(!(!r||r.quota<=0)&&r.percentRemaining===0&&r.overageEnabled&&!this._isSnapshotNotificationActive(this._hasNotifiedOverage[n])){this._hasNotifiedOverage={...this._hasNotifiedOverage,[n]:{notified:!0,resetDate:r.resetDate}};try{await this._ctx.get(hq).notifyQuotaWarning(this._buildWarningParams(o,"info"))}catch{}}}async checkAndNotifyOverageInUse(){this._quotaInfo&&(this._copilotPlan==="free"?(await this._checkAndNotifyOverageSnapshot(this._quotaInfo.chat,"chat","You are currently on overage spend until your chat limit resets."),await this._checkAndNotifyOverageSnapshot(this._quotaInfo.completions,"completions","You are currently on overage spend until your completions limit resets.")):await this._checkAndNotifyOverageSnapshot(this._quotaInfo.premium_interactions,"premium_interactions","You are currently on overage spend until your monthly limit resets."))}async checkAndNotifyQuotaThreshold(){if(!this._quotaInfo)return;let r=a(async(n,o)=>{let s=this._shownThresholds[o];if(this.clearStaleThresholds(n,s),this.checkThreshold(n,s)===void 0||!n)return;let l=n&&100-n.percentRemaining>=90?"warning":"info",u=100-n.percentRemaining,d=this.getQuotaThresholdMessage(o,u,n.resetDate);try{await this._ctx.get(hq).notifyQuotaWarning(this._buildWarningParams(d,l))}catch{}},"notifyForSnapshot");this._copilotPlan==="free"?(await r(this._quotaInfo.chat,"chat"),await r(this._quotaInfo.completions,"completions")):await r(this._quotaInfo.premium_interactions,"premium_interactions")}getQuotaThresholdMessage(r,n,o){return r==="chat"||r==="completions"?n>=95?`You're close to your ${r} limit. Upgrade your plan to continue uninterrupted.`:`You've used over ${n}% of your ${r} budget. Upgrade your plan to continue uninterrupted.`:o?`You've used over ${n}% of your included AI credits. Limits reset on ${nue(o)}.`:`You've used over ${n}% of your included AI credits.`}};async function wYe(t){let e=await t.get(Mr).resolveSession();if(e){let r=await wbe(t,e);if(r.ok){let n=await r.json();t.get(Eu).processUserInfoQuotaSnapshot(n)}}}a(wYe,"refreshUserQuota");p();p();var RYe=new pe("openAICompatibleLMProvider"),iue={[no.OpenAI]:"https://api.openai.com/v1",[no.Gemini]:"https://generativelanguage.googleapis.com/v1beta/openai",[no.Groq]:"https://api.groq.com/openai/v1",[no.OpenRouter]:"https://openrouter.ai/api/v1",[no.Anthropic]:"https://api.anthropic.com/v1"},ow=class{constructor(e,r){this._lastFetchTime=0;this.providerName=e,this.ctx=r}static{a(this,"BaseOpenAICompatibleLMProvider")}async getAllModels(){await this.ensureKnownModelsCache();try{let e=this.getFetchModelUrl(),r={"Content-Type":"application/json"},n=await new $a(this.ctx.get(ti)).getAPIKey(this.providerName);n&&(r.Authorization=`Bearer ${n}`);let o=await this.ctx.get(nr).fetch(e,{method:"GET",headers:r});if(!o.ok)throw new Error(`Failed to fetch models: ${o.status} ${o.statusText}`);let s=await o.json();if(s.error)throw new Error(`API Error: ${JSON.stringify(s.error)}`);let c=[];for(let l of s.data){let u=this._knownModels?.[l.id]??this.resolveModelCapabilities(l);u&&c.push({providerName:this.providerName,modelId:l.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:u})}return c}catch(e){throw RYe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}resolveModelCapabilities(e){}getBaseUrl(){let e=iue[this.providerName];if(!e)throw new Error(`Unsupported provider: ${this.providerName}`);return e}getFetchModelUrl(){return`${this.getBaseUrl()}/models`}async ensureKnownModelsCache(){let e=Date.now();if(!this._knownModels){try{this._knownModels=await this.fetchKnownModelList()}catch(n){RYe.error(this.ctx,`Failed to fetch known models list for ${this.providerName} provider:`,n),this._knownModels=void 0}this._lastFetchTime=e}}async fetchKnownModelList(){let e=await(await this.ctx.get(nr).fetch("https://main.vscode-cdn.net/extensions/copilotChat.json",{method:"GET"})).json(),r;return e.version!==1?r={}:r=e.modelInfo[this.providerName]||{},r}};p();async function*bxe(t,e){for await(let r of t)yield e(r)}a(bxe,"asyncIterableMap");async function*UEn(t,e){for await(let r of t)await e(r)&&(yield r)}a(UEn,"asyncIterableFilter");async function*Sxe(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(Sxe,"asyncIterableMapFilter");p();var kYe="interleaved-thinking-2025-05-14",QEn="2023-06-01";p();var VP=class{static{a(this,"EndpointStrategyFactory")}static{this.strategies=new Map}static register(e){this.strategies.set(e.name,e)}static getStrategy(e){let r=this.strategies.get(e);if(!r){let n=this.strategies.get("completions");if(!n)throw new Error(`No strategy registered for endpoint '${e}' and no fallback strategy available. Available: ${Array.from(this.strategies.keys()).join(", ")}`);return n}return r}static hasStrategy(e){return this.strategies.has(e)}};p();var tl=class{static{a(this,"ModelConfigurationProvider")}},PYe=class extends tl{constructor(r){super();this.ctx=r}static{a(this,"DefaultModelConfigurationProvider")}async getBestChatModelConfig(r,n,o=!1){let s=[];for(let c of r){let l=await this.getFirstMatchingChatModelConfiguration(c,n,o);l&&s.push(l)}if(s.length>0){let c=s.find(l=>l.isExperimental);return c||s[0]}throw ot.error(this.ctx,`No model configuration found for families: ${r.join(", ")}. Available models: ${JSON.stringify(await this.ctx.get(xs).getMetadata())}`),new Error("No model configuration found")}async getFirstMatchingModelMetadata(r){let n=await this.ctx.get(xs).getMetadata(),o=jQo(n,r);if(o.length>0)return o[0]}async getFirstMatchingChatModelConfiguration(r,n,o){let s=await this.getFirstMatchingModelMetadata({family:r,type:"chat",supports:n,modelPickerEnabled:o});if(s===void 0)return;let c=s.supported_endpoints&&s.supported_endpoints.length>0?s.supported_endpoints:["/chat/completions"],l=s.capabilities.supports?.adaptive_thinking??!1,u=s.capabilities.supports?.reasoning_effort;return r===wn.Gpt35turbo||r===wn.Gpt4oMini?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:j7t(6144,s),maxLongContextTokens:void 0,maxResponseTokens:q7t(2048,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:r===wn.Gpt4||r===wn.Gpt4turbo?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:j7t(10240,s),maxLongContextTokens:void 0,maxResponseTokens:q7t(4096,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:r===wn.Gpt4o?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:await qQo(this.ctx,s),maxLongContextTokens:void 0,maxResponseTokens:q7t(4096,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:qEn(s),maxLongContextTokens:jEn(s),maxResponseTokens:s.capabilities.limits?.max_output_tokens??4096,baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}}async getModelConfigurationById(r){let o=(await this.ctx.get(xs).getMetadata()).find(c=>c.id===r&&c.capabilities.type==="chat"&&c.model_picker_enabled===!0);if(!o)return;let s=o.supported_endpoints&&o.supported_endpoints.length>0?o.supported_endpoints:["/chat/completions"];return{modelId:o.id,uiName:o.name,modelFamily:o.capabilities.family,maxRequestTokens:qEn(o),maxLongContextTokens:jEn(o),maxResponseTokens:o.capabilities.limits?.max_output_tokens??4096,baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:o.capabilities.tokenizer,isExperimental:o.isExperimental??!1,stream:o.capabilities.supports?.streaming??!1,toolCalls:o.capabilities.supports?.tool_calls??!1,supportedEndpoints:s,supportsAdaptiveThinking:o.capabilities.supports?.adaptive_thinking??!1,reasoningEfforts:o.capabilities.supports?.reasoning_effort,originalBillingMultiplier:o.billing?.multiplier??0}}async getFirstMatchingEmbeddingModelConfiguration(r){let n=await this.getFirstMatchingModelMetadata({family:r,type:"embeddings"});if(n!==void 0&&r===Ddn.textEmbedding3Small)return{modelId:n.id,modelFamily:r,maxBatchSize:n.capabilities.limits?.max_inputs??16,maxTokens:8191,tokenizer:"cl100k_base"}}};async function qQo(t,e){let r=t.get(Jt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments(),o=r.ideChatMaxRequestTokens(n);return o===-1&&(o=16384),j7t(o,e)}a(qQo,"getExpRequestTokens");function j7t(t,e){return e.capabilities.limits?.max_prompt_tokens?Math.min(t,e.capabilities.limits.max_prompt_tokens):t}a(j7t,"getRequestTokens");function qEn(t){return t.billing?.token_prices?.default?.context_max??t.capabilities.limits?.max_prompt_tokens??8192}a(qEn,"getMaxRequestTokens");function jEn(t){return t.billing?.token_prices?.long_context?.context_max}a(jEn,"getMaxLongContextTokens");function q7t(t,e){return e.capabilities.limits?.max_output_tokens?Math.min(t,e.capabilities.limits.max_output_tokens):t}a(q7t,"getResponseTokens");function jQo(t,e){return t.filter(r=>r.capabilities.type!==e.type||r.capabilities.family!==e.family&&!(r.is_chat_fallback===!0&&r.id===e.family)||r.capabilities.family===e.family&&r.id!==e.family&&r.is_chat_fallback===!0||e.modelPickerEnabled===!0&&!r.model_picker_enabled?!1:r.capabilities.supports===void 0||e.supports===void 0?!0:Object.keys(e.supports).every(n=>e.supports?.[n]===r.capabilities.supports?.[n]))}a(jQo,"filterModelsByCapabilities");function vO(t,e){if(e)return e;if(!(!t||t.length===0))return t.includes("medium")?"medium":t[0]}a(vO,"pickReasoningEffort");function HQo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/responses")}a(HQo,"shouldUseResponsesApi");function GQo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/v1/messages")&&!e.includes("/responses")}a(GQo,"shouldUseMessagesApi");var HEn=["completions","responses","v1/messages"];function DYe(t,e){return e?"v1/messages":t&&HQo(t)?"responses":"completions"}a(DYe,"resolveEndpointRoute");function NYe(t,e){if(!GQo(e))return!1;let r=Rt(t,ze.AnthropicMessagesEndpoint);return r==="true"?!0:r!=="false"}a(NYe,"willUseMessagesEndpoint");p();function MYe(t){let e=t.toLowerCase();return e.startsWith("gpt")&&e.includes("-codex")}a(MYe,"isCodexStyleGptModel");function GEn(t){return t?t.toLowerCase().startsWith("gpt-5"):!1}a(GEn,"isGpt5PlusFamily");function $En(t){return t?t.toLowerCase().startsWith("claude"):!1}a($En,"isAnthropicModel");p();p();function VEn(t,e){if(!e||!e.providerName)return;let r=e.apiType==="messages";e.providerName===no.Anthropic?(delete t.temperature,delete t.top_p):e.supportsThinking&&(delete t.temperature,!r&&"max_tokens"in t&&(t.max_completion_tokens=t.max_tokens,delete t.max_tokens)),e.providerName&&!r&&delete t.max_tokens}a(VEn,"adaptRequestForBYOKProvider");p();p();var zS=class{static{a(this,"RateLimitNotifier")}},OYe=class extends zS{static{a(this,"NullRateLimitNotifier")}async notifyRateLimitWarning(e){}};var H7t=[50,75,90,95],CO=class extends z_{constructor(r){super();this.ctx=r;this._shownSessionThresholds=new Set;this._shownWeeklyThresholds=new Set;this._register(vs(r,()=>{this._shownSessionThresholds.clear(),this._shownWeeklyThresholds.clear(),this.clearRateLimits()}))}static{a(this,"ChatUsageRateLimitService")}get weeklyRateLimit(){return this._weeklyRateLimit}get sessionRateLimit(){return this._sessionRateLimit}clearRateLimits(){this._weeklyRateLimit=void 0,this._sessionRateLimit=void 0}processRateLimitHeaders(r){let n=r.get("x-usage-ratelimit-weekly"),o=r.get("x-usage-ratelimit-session");if(!n&&!o)return;n&&(this._weeklyRateLimit=this.parseRateLimitHeader(n)),o&&(this._sessionRateLimit=this.parseRateLimitHeader(o)),this.clearStaleThresholds(this._sessionRateLimit,this._shownSessionThresholds),this.clearStaleThresholds(this._weeklyRateLimit,this._shownWeeklyThresholds);let s=this.checkThreshold(this._sessionRateLimit,this._shownSessionThresholds,"session")??this.checkThreshold(this._weeklyRateLimit,this._shownWeeklyThresholds,"weekly");s&&this.ctx.get(zS).notifyRateLimitWarning(s)}clearStaleThresholds(r,n){if(!r){n.clear();return}let o=100-r.percentRemaining;for(let s of n)o=0;c--){let l=H7t[c];if(s>=l&&!n.has(l)){for(let d=0;d<=c;d++)n.add(H7t[d]);let u=this.getRateLimitMessage(o,r);return{type:o,rateLimit:r,message:u}}}}getRateLimitMessage(r,n){let o=Math.round(100-n.percentRemaining),s=nue(n.resetDate);return r==="session"?`You've used ${o}% of your session rate limit. Your session rate limit will reset on ${s}.`:`You've used ${o}% of your weekly rate limit. Your weekly rate limit will reset on ${s}.`}parseRateLimitHeader(r){try{let n=new URLSearchParams(r),o=Number.parseInt(n.get("ent")||"0",10),s=Number.parseFloat(n.get("rem")||"0.0"),c=n.get("rst")||"";return{entitlement:o,percentRemaining:s,resetDate:c}}catch(n){console.error("Failed to parse rate limit header",n);return}}};p();var gg="https://aka.ms/github-copilot-rate-limit-error";function $Qo(t){if(t<90)return`${t} ${t===1?"second":"seconds"}`;let e=Math.floor(t/60);if(t<=5400)return`${e} ${e===1?"minute":"minutes"}`;let r=Math.floor(e/60),n=e%60,o=`${r} ${r===1?"hour":"hours"}`;return n>0&&(o+=` ${n} ${n===1?"minute":"minutes"}`),o}a($Qo,"secondsToHumanReadableTime");var Y_=class t{static{a(this,"CapiErrorTranslator")}static formatRequestId(e,r){let n=[];return e&&n.push(`Request ID: ${e}`),r&&n.push(`GitHub Request ID: ${r}`),n.length>0?` ${n.join(" | ")}`:""}static appendRequestId(e,r,n){return`${e}${t.formatRequestId(r,n)}`}static translateErrorMessage(e,r,n,o,s,c){let l;switch(e){case 466:l="Oops, your plugin is out of date. Please update it.";break;case 401:l="Oops, you are not authorized. Please sign in. If you are using a custom model, please check if the API key is still valid.";break;case 402:l=r||"Oops, you need to upgrade your plan.";break;case 413:l="Oops, your request is too large. Please try again with a smaller input.";break;case 429:l=t.getRateLimitMessage(o,c);break;case 503:l=r||"Oops, the service is currently unavailable. Please try again later.";break;default:if(r&&r.trim().length>0){let u=360,d=t.formatRequestId(n,s),f="Sorry, an error occurred while generating a response. Details: ",h=u-f.length-d.length;if(r.length<=h)return`${f}${r}${d}`;{let m=r.substring(0,h);return`${f}${m}... Read more from logs.${d}`}}l="Sorry, an error occurred while generating a response.";break}return t.appendRequestId(l,n,s)}static getRateLimitMessage(e,r){let n=e===void 0?"a moment":$Qo(e),o=r?.capiErrorCode,s=r?.suggestSwitchToAuto??!r?.isAuto;if(o?.startsWith("agent_mode_limit_exceeded"))return`Sorry, you have exceeded the agent mode rate limit. Please switch to ask mode and try again in ${n}. [Learn More](${gg})`;if(o?.startsWith("model_overloaded")||o?.startsWith("upstream_provider_rate_limit"))return s?`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n} or consider switching to Auto. [Learn More](${gg})`:`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n}. [Learn More](${gg})`;if(o?.startsWith("user_global_rate_limited"))return r?.copilotPlan==="free"||r?.copilotPlan==="individual"||r?.copilotPlan==="individual_pro"?`You've hit your session rate limit. Please upgrade your plan or wait ${n} for your limit to reset. [Learn More](${gg})`:`You've hit your session rate limit. Please wait ${n} for your limit to reset. [Learn More](${gg})`;if(o?.startsWith("user_weekly_rate_limited")){if(e!==void 0){let l=new Date(Date.now()+e*1e3).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"});return r?.copilotPlan==="free"||r?.copilotPlan==="individual"||r?.copilotPlan==="individual_pro"?s?`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${gg})`:`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l}. [Learn More](${gg})`:s?`You've reached your weekly rate limit. Please wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${gg})`:`You've reached your weekly rate limit. Please wait for your limit to reset on ${l}. [Learn More](${gg})`}return s?`You've reached your weekly rate limit. Please wait ${n} for your limit to reset or consider switching to Auto. [Learn More](${gg})`:`You've reached your weekly rate limit. Please wait ${n} for your limit to reset. [Learn More](${gg})`}return o?.startsWith("user_model_rate_limited")?s?`You've hit the rate limit for this model. Please try switching to Auto or try again in ${n}. [Learn More](${gg})`:`You've hit the rate limit for this model. Please try again in ${n}. [Learn More](${gg})`:o?.startsWith("integration_rate_limited")?`Sorry, GitHub Copilot Chat is currently experiencing high demand. Please try again in ${n}. [Learn More](${gg})`:o?s?`Sorry, you have been rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${gg})`:`Sorry, you have been rate-limited. Please wait ${n} before trying again. [Learn More](${gg})`:s?`Sorry, your request was rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${gg})`:`Sorry, your request was rate-limited. Please wait ${n} before trying again. [Learn More](${gg})`}static translate402Reason(e,r){let n=r.retryAfterHeader,o=r.retryAfterSeconds;if(e.includes("free_quota_exceeded"))return n?`You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait until ${new Date(n).toLocaleString()} for your limit to reset.`:"You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.";if(e.includes("additional_spend_limit_reached"))return"You've reached your additional usage limit for your plan. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.";if(e.includes("overage_limit_reached"))return r.isTBBEnabled?"You've reached your additional usage limit for your plan. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.":"You cannot accrue additional overages at this time. Please contact [GitHub Support](https://support.github.com/contact) to continue using Copilot.";if(e.includes("quota_exceeded")){if(r.isTBBEnabled){let s="";o!==void 0&&(s=` Quota resets on ${new Date(Date.now()+o*1e3).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}.`);let c=r.overageEnabled?"increase budget":"enable additional overages",l=r.canUpgradePlan?", upgrade your plan":"";switch(r.copilotPlan){case"free":return`You've used your monthly chat messages limit. Please upgrade your plan or wait for your allowance to renew.${s}`;case"individual":case"individual_pro":return`You've used your monthly AI Credits. Please ${c}${l} or wait for your allowance to renew.${s}`;case"individual_max":return`You've used your monthly AI Credits. Please ${c} or wait for your allowance to renew.${s}`;case"business":case"enterprise":return`You've used your monthly AI Credits. Please reach out to your organization's Copilot admin to ${c} or wait for your allowance to renew.${s}`;default:return`You've used your monthly AI Credits.${s}`}}switch(r.copilotPlan){case"free":return"You've reached your monthly chat messages quota. Upgrade to Copilot Pro (30-day free trial) or wait for your allowance to renew.";case"individual":return"You've reached your monthly chat messages quota. Please enable additional paid premium requests, upgrade to Copilot Pro+, or wait for your allowance to renew.";case"individual_pro":return"You've reached your monthly chat messages quota. Please enable additional paid premium requests or wait for your allowance to renew.";case"business":case"enterprise":return"You've reached your monthly chat messages quota. Please reach out to your organization's Copilot admin to enable additional paid premium requests or wait for your allowance to renew.";default:return"You've reached your monthly chat messages quota."}}return e.includes("session_quota_exceeded")?o!==void 0?`You've used your session quota. Wait until ${new Date(Date.now()+o*1e3).toLocaleString()} for your limit to reset.`:"You've used your session quota.":e.includes("billing_not_configured")?"You have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, you must select a billing entity via the GitHub site, under Settings > Copilot > Billing.":r.isTBBEnabled?"Usage limit exceeded. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.":"Quota Exceeded."}static translate400Reason(e,r){if(e.includes("off_topic"))return"filtered as off_topic by intent classifier: message was not programming related";if(e.includes("model_not_supported"))return r?`model is not supported: ${r}`:"model is not supported.";if(e.includes("model_max_prompt_tokens_exceeded"))return"model max prompt tokens exceeded."}};p();p();p();var mq="copilot-edits-session";p();p();p();p();Mo();function LYe(t,e,r,n,o,s,c){return RJr(t,e,r,o,n,c),{completionText:e,meanLogProb:VQo(t,r),meanAlternativeLogProb:WQo(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:Nt(),finishReason:r.finish_reason}}a(LYe,"convertToAPIChoice");function VQo(t,e){if(e?.logprobs?.token_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--)r+=e.logprobs.token_logprobs[s],n+=1;return n>0?r/n:void 0}catch(r){Nr.exception(t,r,"Error calculating mean prob")}}a(VQo,"calculateMeanLogProb");function WQo(t,e){if(e?.logprobs?.top_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--){let c={...e.logprobs.top_logprobs[s]};delete c[e.logprobs.tokens[s]],r+=Math.max(...Object.values(c)),n+=1}return n>0?r/n:void 0}catch(r){Nr.exception(t,r,"Error calculating mean prob")}}a(WQo,"calculateMeanAlternativeLogProb");function oue(t,e){return Q1(t)||e<=1?0:e<10?.2:e<20?.4:.8}a(oue,"getTemperatureForSamples");var zQo={markdown:[` `],python:[` @@ -2443,23 +2443,23 @@ def `,` class `,` if `,` -#`]};function Ayn(t,e){return HUo[e??""]??[` +#`]};function WEn(t,e){return zQo[e??""]??[` -`,"\n```"]}a(Ayn,"getStops");function Kle(t){return 1}a(Kle,"getTopP");function lYe(t){return KTe}a(lYe,"getMaxSolutionTokens");p();p();var GUo=1.15,$Uo=1.17,VUo=2;function WUo(t){if(!t)return!1;let e=t.toLowerCase();return e.includes("opus")||e.includes("sonnet-4.6")}a(WUo,"isHighMultiplierModel");function zUo(t){return t.text?Array.isArray(t.text)?t.text.join(""):t.text:""}a(zUo,"getThinkingText");function Jle(t,e){let r=zUo(t);if(r.length>0){let n=ws(),o=WUo(e)?$Uo:GUo;return Math.ceil(n.tokenLength(r)*VUo*o)}return 0}a(Jle,"estimateThinkingTokens");function ZUt(t){let e=t.delta;if(!e)return;let r=KUo(e),n=YUo(e);if(r||n)return{id:r,text:n}}a(ZUt,"extractThinkingDeltaFromChoice");function YUo(t){if(t)return t.cot_summary??t.reasoning_text??t.thinking}a(YUo,"getThinkingDeltaText");function KUo(t){if(t)return t.cot_id??t.reasoning_opaque??t.signature}a(KUo,"getThinkingDeltaId");p();function Xu(t){if(t instanceof Error)return t.stack?t.stack:t.message;if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}a(Xu,"toString");var jS=new fe("streamChoices"),XUt=class{constructor(e){this.enableThinking=e;this.logprobs=[];this.top_logprobs=[];this.text=[];this.tokens=[];this.text_offset=[];this.copilot_annotations=new n7t;this.tool_calls=new t7t;this.function_call=new r7t;this.copilot_references=[];this.yielded=!1}static{a(this,"APIJsonDataStreaming")}append(e){if(e.text&&this.text.push(e.text),e.delta?.content&&e.delta.role!=="function"&&this.text.push(e.delta.content),e.logprobs&&(this.tokens.push(e.logprobs.tokens??[]),this.text_offset.push(e.logprobs.text_offset??[]),this.logprobs.push(e.logprobs.token_logprobs??[]),this.top_logprobs.push(e.logprobs.top_logprobs??[])),e.copilot_annotations&&this.copilot_annotations.update(e.copilot_annotations),e.delta?.copilot_annotations&&this.copilot_annotations.update(e.delta.copilot_annotations),e.delta?.tool_calls&&e.delta.tool_calls.length>0&&this.tool_calls.update(e.delta.tool_calls),e.delta?.function_call&&this.function_call.update(e.delta.function_call),e?.finish_reason&&(this.finish_reason=e.finish_reason),this.enableThinking){let r=ZUt(e);if((r?.id||r?.text)&&(this.thinking??={id:"",text:[]},r.id&&(this.thinking.id=r.id),r.text&&Array.isArray(this.thinking.text))){let n=Array.isArray(r.text)?r.text:[r.text];this.thinking.text.push(...n)}}}};function JUo(t){let e=t.split(` -`),r=e.pop();return[e.filter(n=>n!=""),r]}a(JUo,"splitChunk");var e7t=class{constructor(){this.arguments=[]}static{a(this,"StreamingToolCall")}update(e){e.id&&(this.id=e.id),e.function.name&&(this.name=e.function.name),this.arguments.push(e.function.arguments)}},t7t=class{constructor(){this.toolCalls=[]}static{a(this,"StreamingToolCalls")}update(e){e.forEach(r=>{let n;if(r.id&&(n=this.toolCalls.find(o=>o.id===r.id)),!n&&!r.id&&r.index!==void 0){for(let o=this.toolCalls.length-1;o>=0;o--)if(this.toolCalls[o].index===r.index){n=this.toolCalls[o];break}}n||(n=this.toolCalls.length>0?this.toolCalls[this.toolCalls.length-1]:void 0),(!n||r.id&&n.id!==r.id)&&(n=new e7t,this.toolCalls.push(n)),r.index!==void 0&&n.index===void 0&&(n.index=r.index),n.update(r)})}getToolCalls(){return this.toolCalls}},r7t=class{constructor(){this.arguments=[]}static{a(this,"StreamingFunctionCall")}update(e){e.name&&(this.name=e.name),this.arguments.push(e.arguments)}},n7t=class{constructor(){this.current={}}static{a(this,"StreamCopilotAnnotations")}update(e){Object.entries(e).forEach(([r,n])=>{n.forEach(o=>this.update_namespace(r,o))})}update_namespace(e,r){this.current[e]||(this.current[e]=[]);let n=this.current[e],o=n.findIndex(s=>s.id===r.id);o>=0?n[o]=r:n.push(r)}for(e){return this.current[e]??[]}},SK=class t{constructor(e,r,n,o,s,c,l){this.ctx=e;this.expectedNumChoices=r;this.response=n;this.body=o;this.telemetryData=s;this.dropCompletionReasons=c;this.cancellationToken=l;this.requestId=M3(this.response);this.stats=new i7t;this.solutions={}}static{a(this,"SSEProcessor")}static create(e,r,n,o,s,c){let l=n.body();if(l===null)throw new Error("No response body available");return typeof l.setEncoding=="function"?l.setEncoding("utf8"):l=l.pipeThrough(new TextDecoderStream),new t(e,r,n,l,o,s??[],c)}async*processSSE(e=()=>{}){try{yield*this.processSSEInner(e)}finally{this.cancel(),jS.debug(this.ctx,`request done: headerRequestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`),jS.debug(this.ctx,"request stats:",this.stats)}}async*processSSEInner(e){let r="",n=null,o,s,c;e:for await(let l of this.body){if(this.maybeCancel("after awaiting body chunk"))return;let u=l.toString();jS.debug(this.ctx,"chunk",u);let[d,f]=JUo(r+u);r=f;for(let h of d){if(h.startsWith(":"))continue;let m=h.slice(5).trim();if(m=="[DONE]"){yield*this.finishSolutions(n,o,s,c,e);return}n=null;let g;try{g=JSON.parse(m)}catch{jS.error(this.ctx,"Error parsing JSON stream data",h);continue}if(g.copilot_confirmation&&ZUo(g.copilot_confirmation)&&await e("",{text:"",requestId:this.requestId,copilotConfirmation:g.copilot_confirmation}),g.copilot_references&&await e("",{text:"",requestId:this.requestId,copilotReferences:g.copilot_references}),g.choices===void 0){!g.copilot_references&&!g.copilot_confirmation&&(g.error!==void 0?jS.error(this.ctx,"Error in response:",g.error.message):jS.error(this.ctx,"Unexpected response with no choices or error: "+m)),g.copilot_errors&&await e("",{text:"",requestId:this.requestId,copilotErrors:g.copilot_errors});continue}if(o===void 0&&g.model&&(o=g.model),g.usage&&(s=g.usage),g.copilot_usage&&(c=g.copilot_usage),this.allSolutionsDone()){r="";break e}for(let A=0;A0){let n=ws(),o=ZQo(e)?KQo:YQo;return Math.ceil(n.tokenLength(r)*JQo*o)}return 0}a(aue,"estimateThinkingTokens");function G7t(t){let e=t.delta;if(!e)return;let r=tqo(e),n=eqo(e);if(r||n)return{id:r,text:n}}a(G7t,"extractThinkingDeltaFromChoice");function eqo(t){if(t)return t.cot_summary??t.reasoning_text??t.thinking}a(eqo,"getThinkingDeltaText");function tqo(t){if(t)return t.cot_id??t.reasoning_opaque??t.signature}a(tqo,"getThinkingDeltaId");p();function rd(t){if(t instanceof Error)return t.stack?t.stack:t.message;if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}a(rd,"toString");var YS=new pe("streamChoices"),$7t=class{constructor(e){this.enableThinking=e;this.logprobs=[];this.top_logprobs=[];this.text=[];this.tokens=[];this.text_offset=[];this.copilot_annotations=new Y7t;this.tool_calls=new W7t;this.function_call=new z7t;this.copilot_references=[];this.yielded=!1}static{a(this,"APIJsonDataStreaming")}append(e){if(e.text&&this.text.push(e.text),e.delta?.content&&e.delta.role!=="function"&&this.text.push(e.delta.content),e.logprobs&&(this.tokens.push(e.logprobs.tokens??[]),this.text_offset.push(e.logprobs.text_offset??[]),this.logprobs.push(e.logprobs.token_logprobs??[]),this.top_logprobs.push(e.logprobs.top_logprobs??[])),e.copilot_annotations&&this.copilot_annotations.update(e.copilot_annotations),e.delta?.copilot_annotations&&this.copilot_annotations.update(e.delta.copilot_annotations),e.delta?.tool_calls&&e.delta.tool_calls.length>0&&this.tool_calls.update(e.delta.tool_calls),e.delta?.function_call&&this.function_call.update(e.delta.function_call),e?.finish_reason&&(this.finish_reason=e.finish_reason),this.enableThinking){let r=G7t(e);if((r?.id||r?.text)&&(this.thinking??={id:"",text:[]},r.id&&(this.thinking.id=r.id),r.text&&Array.isArray(this.thinking.text))){let n=Array.isArray(r.text)?r.text:[r.text];this.thinking.text.push(...n)}}}};function rqo(t){let e=t.split(` +`),r=e.pop();return[e.filter(n=>n!=""),r]}a(rqo,"splitChunk");var V7t=class{constructor(){this.arguments=[]}static{a(this,"StreamingToolCall")}update(e){e.id&&(this.id=e.id),e.function.name&&(this.name=e.function.name),this.arguments.push(e.function.arguments)}},W7t=class{constructor(){this.toolCalls=[]}static{a(this,"StreamingToolCalls")}update(e){e.forEach(r=>{let n;if(r.id&&(n=this.toolCalls.find(o=>o.id===r.id)),!n&&!r.id&&r.index!==void 0){for(let o=this.toolCalls.length-1;o>=0;o--)if(this.toolCalls[o].index===r.index){n=this.toolCalls[o];break}}n||(n=this.toolCalls.length>0?this.toolCalls[this.toolCalls.length-1]:void 0),(!n||r.id&&n.id!==r.id)&&(n=new V7t,this.toolCalls.push(n)),r.index!==void 0&&n.index===void 0&&(n.index=r.index),n.update(r)})}getToolCalls(){return this.toolCalls}},z7t=class{constructor(){this.arguments=[]}static{a(this,"StreamingFunctionCall")}update(e){e.name&&(this.name=e.name),this.arguments.push(e.arguments)}},Y7t=class{constructor(){this.current={}}static{a(this,"StreamCopilotAnnotations")}update(e){Object.entries(e).forEach(([r,n])=>{n.forEach(o=>this.update_namespace(r,o))})}update_namespace(e,r){this.current[e]||(this.current[e]=[]);let n=this.current[e],o=n.findIndex(s=>s.id===r.id);o>=0?n[o]=r:n.push(r)}for(e){return this.current[e]??[]}},MK=class t{constructor(e,r,n,o,s,c,l){this.ctx=e;this.expectedNumChoices=r;this.response=n;this.body=o;this.telemetryData=s;this.dropCompletionReasons=c;this.cancellationToken=l;this.requestId=j3(this.response);this.stats=new K7t;this.solutions={}}static{a(this,"SSEProcessor")}static create(e,r,n,o,s,c){let l=n.body();if(l===null)throw new Error("No response body available");return typeof l.setEncoding=="function"?l.setEncoding("utf8"):l=l.pipeThrough(new TextDecoderStream),new t(e,r,n,l,o,s??[],c)}async*processSSE(e=()=>{}){try{yield*this.processSSEInner(e)}finally{this.cancel(),YS.debug(this.ctx,`request done: headerRequestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`),YS.debug(this.ctx,"request stats:",this.stats)}}async*processSSEInner(e){let r="",n=null,o,s,c;e:for await(let l of this.body){if(this.maybeCancel("after awaiting body chunk"))return;let u=l.toString();YS.debug(this.ctx,"chunk",u);let[d,f]=rqo(r+u);r=f;for(let h of d){if(h.startsWith(":"))continue;let m=h.slice(5).trim();if(m=="[DONE]"){yield*this.finishSolutions(n,o,s,c,e);return}n=null;let g;try{g=JSON.parse(m)}catch{YS.error(this.ctx,"Error parsing JSON stream data",h);continue}if(g.copilot_confirmation&&nqo(g.copilot_confirmation)&&await e("",{text:"",requestId:this.requestId,copilotConfirmation:g.copilot_confirmation}),g.copilot_references&&await e("",{text:"",requestId:this.requestId,copilotReferences:g.copilot_references}),g.choices===void 0){!g.copilot_references&&!g.copilot_confirmation&&(g.error!==void 0?YS.error(this.ctx,"Error in response:",g.error.message):YS.error(this.ctx,"Unexpected response with no choices or error: "+m)),g.copilot_errors&&await e("",{text:"",requestId:this.requestId,copilotErrors:g.copilot_errors});continue}if(o===void 0&&g.model&&(o=g.model),g.usage&&(s=g.usage),g.copilot_usage&&(c=g.copilot_usage),this.allSolutionsDone()){r="";break e}for(let A=0;A-1||y.delta?.content?.indexOf(` -`)>-1,T=E?ZUt(y):void 0;if(y.finish_reason||b||T){let R=_.text.join("");if(v=this.asSolutionDecision(await e(R,{text:R,index:y.index,requestId:this.requestId,annotations:_.copilot_annotations,copilotReferences:_.copilot_references,getAPIJsonData:a(()=>sxe(_,this.ctx),"getAPIJsonData"),finished:!!y.finish_reason,telemetryData:this.telemetryData,thinking:T?{id:T.id??"",text:T.text}:void 0})),this.maybeCancel("after awaiting finishedCb"))return}if(y.finish_reason&&_.function_call.name!==void 0){n=y.finish_reason;continue}if(y.finish_reason&&(v.yieldSolution=!0,v.continueStreaming=!1),!v.yieldSolution)continue;let w=y.finish_reason??"client-trimmed";if(Et(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:w,engineName:o??"",engineChoiceSource:mQ(this.ctx,this.telemetryData).engineChoiceSource})),this.dropCompletionReasons.includes(y.finish_reason)?this.solutions[y.index]=null:_.yielded||(this.stats.markYielded(y.index),yield{solution:_,finishOffset:v.finishOffset,reason:y.finish_reason,requestId:this.requestId,index:y.index,model:o,usage:s,copilot_usage:c},_.yielded=!0),this.maybeCancel("after yielding finished choice"))return;v.continueStreaming||(this.solutions[y.index]=null)}}}for(let[l,u]of Object.entries(this.solutions)){let d=Number(l);if(u!=null&&(Et(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:"Iteration Done",engineName:o??""})),this.stats.markYielded(d),yield{solution:u,finishOffset:void 0,reason:"Iteration Done",requestId:this.requestId,index:d,model:o,usage:s,copilot_usage:c},this.maybeCancel("after yielding after iteration done")))return}if(r.length>0)try{let l=JSON.parse(r);l.error!==void 0&&jS.error(this.ctx,`Error in response: ${l.error.message}`,l.error)}catch{jS.error(this.ctx,`Error parsing extraData: ${r}`)}}asSolutionDecision(e){return e===void 0?{yieldSolution:!1,continueStreaming:!0}:typeof e=="number"?{yieldSolution:!0,continueStreaming:!1,finishOffset:e}:e}async*finishSolutions(e,r,n,o,s){for(let[c,l]of Object.entries(this.solutions)){let u=Number(c);if(l==null)continue;let d=l.text.join("");if(await s(d,{text:d,index:u,requestId:this.requestId,annotations:l.copilot_annotations,copilotReferences:l.copilot_references,getAPIJsonData:a(()=>sxe(l,this.ctx),"getAPIJsonData"),finished:!0,telemetryData:this.telemetryData}),!l.yielded&&(this.stats.markYielded(u),Et(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:e??"DONE",engineName:r??""})),yield{solution:l,finishOffset:void 0,reason:e??"DONE",requestId:this.requestId,index:u,model:r,usage:n,copilot_usage:o},this.maybeCancel("after yielding on DONE")))return}}maybeCancel(e){return this.cancellationToken?.isCancellationRequested?(jS.debug(this.ctx,"Cancelled: "+e),this.cancel(),!0):!1}cancel(){this.body&&"destroy"in this.body&&typeof this.body.destroy=="function"?this.body.destroy():this.body instanceof ReadableStream&&this.body.cancel()}allSolutionsDone(){let e=Object.values(this.solutions);return e.length==this.expectedNumChoices&&e.every(r=>r==null)}};function s7t(t,e,r){let n=e.solution.text.join(""),o=!1;e.finishOffset!==void 0&&(jS.debug(t,`solution ${e.index}: early finish at offset ${e.finishOffset}`),n=n.substring(0,e.finishOffset),o=!0),jS.info(t,`solution ${e.index} returned. finish reason: [${e.reason}]`),jS.debug(t,`solution ${e.index} details: finishOffset: [${e.finishOffset}]`);let s=sxe(e.solution,t);return cYe(t,n,s,e.index,e.requestId,o,r)}a(s7t,"prepareSolutionForReturn");function sxe(t,e){let r=t.text.join(""),n=XUo(t,e),o=e7o(t,e),s=t.copilot_annotations.current,c=t.thinking?.id?t.thinking:void 0,l={text:r,tokens:t.text,tool_calls:n,function_call:o,copilot_annotations:s,finish_reason:t.finish_reason??"stop",thinking:c};if(t.logprobs.length===0)return l;let u=t.logprobs.reduce((m,g)=>m.concat(g),[]),d=t.top_logprobs.reduce((m,g)=>m.concat(g),[]),f=t.text_offset.reduce((m,g)=>m.concat(g),[]),h=t.tokens.reduce((m,g)=>m.concat(g),[]);return{...l,logprobs:{token_logprobs:u,top_logprobs:d,text_offset:f,tokens:h}}}a(sxe,"convertToAPIJsonData");function ZUo(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(ZUo,"isCopilotConfirmation");function yyn(t,e,r,n,o){if(!t)return{};try{return JSON.parse(t)}catch(s){let c=n?` Chunks (${n.length}): ${JSON.stringify(n)}`:"",l=new Error(`Failed to parse JSON for ${e} '${r}': ${Xu(s)}. Input: '${t}'.${c}`);throw o&&At(o,"toolCall.argumentParseError",{callType:e,callName:r,error:l.message}),l}}a(yyn,"parseCallArguments");function XUo(t,e){let r=[],n=t.tool_calls.getToolCalls();for(let o of n)if(o.name){let s=o.arguments.join("").trim(),c=yyn(s,"tool call",o.name,o.arguments,e);r.push({type:"function",function:{name:o.name,arguments:c},approxNumTokens:o.arguments.length+1,id:o.id})}return r}a(XUo,"extractToolCalls");function e7o(t,e){if(t.function_call.name){let r=t.function_call.arguments.join("").trim(),n=yyn(r,"function call",t.function_call.name,t.function_call.arguments,e);return{name:t.function_call.name,arguments:n}}}a(e7o,"extractFunctionCall");var i7t=class{constructor(){this.choices=new Map}static{a(this,"ChunkStats")}getChoiceStats(e){let r=this.choices.get(e);return r||(r=new o7t,this.choices.set(e,r)),r}add(e){this.getChoiceStats(e).increment()}markYielded(e){this.getChoiceStats(e).markYielded()}toString(){return Array.from(this.choices.entries()).map(([e,r])=>`${e}: ${r.yieldedTokens} -> ${r.seenTokens}`).join(", ")}},o7t=class{constructor(){this.yieldedTokens=-1;this.seenTokens=0}static{a(this,"ChoiceStats")}increment(){this.seenTokens++}markYielded(){this.yieldedTokens=this.seenTokens}};p();function uYe(t,e){return t!==null&&typeof t=="object"&&e in t}a(uYe,"hasKey");function Wh(t,e){return uYe(t,e)?t[e]:void 0}a(Wh,"getKey");var _yn=de(ri());var np=new fe("fetchCompletions");function M3(t){return{headerRequestId:t.headers.get("x-request-id")||"",serverExperiments:t.headers.get("X-Copilot-Experiment")||"",deploymentId:t.headers.get("azureml-model-deployment")||""}}a(M3,"getRequestId");function O3(t){let e=t.headers.get("openai-processing-ms");return e?parseInt(e,10):0}a(O3,"getProcessingTime");function vyn(t){switch(t){case"ghostText":return"copilot-ghost";case"synthesize":return"copilot-panel"}}a(vyn,"uiKindToIntent");var AO=class{static{a(this,"OpenAIFetcher")}};function t7o(t,e,r,n){return tx(t,e,"proxy","v1/engines",r,n)}a(t7o,"getProxyEngineUrl");function dYe(t,e,r,n){for(let[o,s]of Object.entries(t)){if(r.includes(o))continue;let c=s;if(o==="extra"&&n){let l={...c};for(let u of n)delete l[u];c=l}e.properties[`request.option.${o}`]=JSON.stringify(c)??"undefined"}}a(dYe,"sanitizeRequestOptionTelemetry");async function r7o(t,e,r,n,o,s,c,l,u,d,f){let h=t.get(ps),m=t7o(t,c,r,n),g=u.extendedBy({endpoint:n,engineName:r,uiKind:l},Ese(e));dYe(s,g,["prompt","suffix"],["context"]),g.properties.headerRequestId=o,Et(t,"request.sent",g);let A=yl(),y=vyn(l);return HW(t,m,c.token,y,o,s,d,f).then(E=>{let _=M3(E);g.extendWithRequestId(_);let v=yl()-A;return g.measurements.totalTimeMs=v,np.info(t,`Request ${o} at <${m}> finished with ${E.status} status after ${v}ms`),g.properties.status=String(E.status),np.debug(t,"request.response properties",g.properties),np.debug(t,"request.response measurements",g.measurements),np.debug(t,"prompt:",e),Et(t,"request.response",g),E}).catch(E=>{if(Gm(E))throw Et(t,"request.cancel",g),E;h.setWarning("cls",{message:Wh(E,"message")??""});let _=g.extendedBy({error:"Network exception"});Et(t,"request.shownWarning",_),g.properties.message=String(Wh(E,"name")??""),g.properties.code=String(Wh(E,"code")??""),g.properties.errno=String(Wh(E,"errno")??""),g.properties.type=String(Wh(E,"type")??"");let v=yl()-A;throw g.measurements.totalTimeMs=v,np.info(t,`Request ${o} at <${m}> rejected with ${String(E)} after ${v}ms`),np.debug(t,"request.error properties",g.properties),np.debug(t,"request.error measurements",g.measurements),Et(t,"request.error",g),E}).finally(()=>{vKr(t,e,g)})}a(r7o,"fetchWithInstrumentation");async function n7o(t,e,r,n,o,s,c,l,u,d){let f=u.extendedBy({endpoint:"chat/completions",engineModelId:r,uiKind:l});dYe(s,f,["messages"]),f.properties.headerRequestId=o,Et(t,"request.sent",f);let h=yl(),m=vyn(l),g=i0(t);CB()&&(g=await C$e(t,g));try{let A=await HW(t,n,c.token,m,o,s,d,g),y=M3(A);f.extendWithRequestId(y);let E=yl()-h;return f.measurements.totalTimeMs=E,np.info(t,`Request ${o} at <${n}> finished with ${A.status} status after ${E}ms`),np.debug(t,"request.response properties",f.properties),np.debug(t,"request.response measurements",f.measurements),np.debug(t,"messages:",JSON.stringify(e)),Et(t,"request.response",f),A}catch(A){if(Gm(A))throw Et(t,"request.cancel",f),A;let y=f.extendedBy({error:"Network exception"});Et(t,"request.shownWarning",y),f.properties.message=String(Wh(A,"name")??""),f.properties.code=String(Wh(A,"code")??""),f.properties.errno=String(Wh(A,"errno")??""),f.properties.type=String(Wh(A,"type")??"");let E=yl()-h;throw f.measurements.totalTimeMs=E,np.info(t,`Request ${o} at <${n}> rejected with ${String(A)} after ${E}ms`),np.debug(t,"request.error properties",f.properties),np.debug(t,"request.error measurements",f.measurements),Et(t,"request.error",f),A}finally{Zle(t,e,f)}}a(n7o,"fetchChatWithInstrumentation");function Eyn(t){return lyn(t,e=>e.completionText.trim().length>0)}a(Eyn,"postProcessChoices");var i7o="github.copilot.completions.quotaExceeded",oxe=class extends AO{static{a(this,"LiveOpenAIFetcher")}#e;async fetchAndStreamCompletions(e,r,n,o,s){if(this.#e)return{type:"canceled",reason:this.#e};let c=e.get(ps),l="completions",u=await e.get(Qt).getToken(),d=await this.fetchWithParameters(e,l,r,u,n,s);if(d==="not-sent")return{type:"canceled",reason:"before fetch request"};if(s?.isCancellationRequested){let g=d.body();try{g&&"destroy"in g&&typeof g.destroy=="function"?g.destroy():g instanceof ReadableStream&&g.cancel()}catch(A){np.exception(e,A,"Error destroying stream")}return{type:"canceled",reason:"after fetch request"}}if(d.status!==200){let g=this.createTelemetryData(l,e,r);return this.handleError(e,c,g,d,r.uiKind)}let h=SK.create(e,r.count,d,n,[],s).processSSE(o),m=nxe(h,g=>s7t(e,g,n));return{type:"success",choices:Eyn(m),getProcessingTime:a(()=>O3(d),"getProcessingTime")}}async fetchAndStreamChat(e,r,n,o,s,c,l,u={},d){if(this.#e)return{type:"canceled",reason:this.#e};let f="https://copilot-proxy.githubusercontent.com/chat/completions",h={messages:r,model:l.id,stream:!0,...u},m=n.extendedBy({endpoint:f,model:l.name}),g=e.get(ps),A=await e.get(Qt).getToken(),y=await n7o(e,r,l.id,f,s,h,A,o,m,d);if(d?.isCancellationRequested){let b=y.body();try{b&&"destroy"in b&&typeof b.destroy=="function"?b.destroy():b instanceof ReadableStream&&b.cancel()}catch(T){np.exception(e,T,"Error destroying stream")}return{type:"canceled",reason:"after fetch request"}}if(y.status!==200){let b=Wt.createAndMarkAsIssued({endpoint:f,engineName:l.name,uiKind:o,headerRequestId:s});return this.handleError(e,g,b,y,o)}let _=SK.create(e,1,y,m,[],_yn.CancellationToken.None).processSSE(),v=nxe(_,b=>s7t(e,b,n));return{type:"success",choices:Eyn(v),getProcessingTime:a(()=>O3(y),"getProcessingTime")}}createTelemetryData(e,r,n){return Wt.createAndMarkAsIssued({endpoint:e,engineName:n.engineModelId,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s,c){let l=e.get(Zt).disableLogProb(s),u={prompt:n.prompt.prefix,suffix:n.prompt.suffix,max_tokens:lYe(e),temperature:Yle(e,n.count),top_p:Kle(e),n:n.count,stop:Ayn(e,n.languageId),stream:!0,extra:n.extra};(n.requestLogProbs||!l)&&(u.logprobs=2);let d=MY(n.repoInfo);return d!==void 0&&(u.nwo=d),n.postOptions&&Object.assign(u,n.postOptions),n.prompt.context&&n.prompt.context.length>0&&(u.extra.context=n.prompt.context),await bC(0),c?.isCancellationRequested?"not-sent":await r7o(e,n.prompt,n.engineModelId,r,n.ourRequestId,u,o,n.uiKind,s,c,n.headers)}async handleError(e,r,n,o,s){let c=await o.text();if(o.status===402){this.#e="monthly free code completions exhausted",r.setError("cls",{message:"Completions limit reached"},{command:i7o,title:"Learn More"});let l=bs(e,u=>{this.#e=void 0,(u.envelope.limited_user_quotas?.completions??1)>0&&(r.forceNormal("cls",{inactive:!1}),l.dispose())});return{type:"failed",reason:this.#e}}if(o.status===466)return r.setError("cls",{message:c}),np.info(e,c),{type:"failed",reason:`client not supported: ${c}`};if(o.clientError&&!o.headers.get("x-github-request-id")){let l=`Last response was a ${o.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;np.error(e,l),r.setWarning("cls",{message:l}),n.properties.error=`Response status was ${o.status} with no x-github-request-id header`}else o.clientError?(np.warn(e,`Response status was ${o.status}:`,c),r.setWarning("cls",{message:`Last response was a ${o.status} error: ${c}`}),n.properties.error=`Response status was ${o.status}: ${c}`):(r.setWarning("cls",{message:`Last response was a ${o.status} error`}),n.properties.error=`Response status was ${o.status}`);if(n.properties.status=String(o.status),Et(e,"request.shownWarning",n),o.status===401||o.status===403)return e.get(Qt).resetToken("code_completion",o.status),{type:"failed",reason:`token expired or invalid: ${o.status}`};if(o.status===429){let l=OU(o);At(e,"request.throttled",{requestSource:s??"unknown"},{retryAfter:l??-1});let u=l??10,d=Math.max(u,0)*1e3;return setTimeout(()=>{this.#e=void 0},d),this.#e=`Rate limited by server. Retry in ${u}s.`,np.warn(e,this.#e),{type:"failed",reason:this.#e}}return o.status===499?(np.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(np.error(e,"Unhandled status from server:",o.status,c),{type:"failed",reason:`unhandled status from server: ${o.status} ${c}`})}};Mo();async function axe(t,e,r,n){let o=Wt.createAndMarkAsIssued({messageId:e,conversationId:r});return await t.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments(n,o)}a(axe,"createTelemetryWithExpWithId");function tl(t,{turn:e,conversation:r}={},n){return axe(t,e?.telemetryId??"",r?.telemetryId??"",n)}a(tl,"createTelemetryWithExpWithTurn");function cxe(t,e,r,n,o,s,c,l){let u=t.turns[t.turns.length-1].skills.map(h=>h.skillId).sort(),d={source:"user",turnIndex:(t.turns.length-1).toString(),uiKind:e,skillIds:u.join(",")},f={promptTokenLen:n,messageCharLen:r};return o&&(d.suggestion=o),s&&(d.suggestionId=s),l.length>0&&(d.skillResolutionsJson=JSON.stringify(o7o(l))),c=c.extendedBy(d,f),c}a(cxe,"extendUserMessageTelemetryData");function o7o(t){return t.map(e=>({skillId:e.skillId,resolution:e.resolution,fileStatus:e.files?.map(r=>r.status),tokensPreEliding:e.tokensPreEliding??0,resolutionTimeMs:e.resolutionTimeMs??0,processingTimeMs:e.processingTimeMs??0}))}a(o7o,"mapSkillResolutionsForTelemetry");function Cyn(t,e,r,n,o,s,c){return n!=null&&(c=c.extendedBy({offTopic:n.toString()})),fYe(t,s,e,r,{uiKind:e,headerRequestId:o},{},c).properties.messageId}a(Cyn,"createUserMessageTelemetryData");function byn(t,e,r,n,o,s,c){let l=a7o(r);return fYe(t.ctx,s,e,r,{source:"model",turnIndex:(t.conversation.turns.length-1).toString(),headerRequestId:o,uiKind:e,codeBlockLanguages:JSON.stringify(l),mode:t.turn.getChatModeForTelemetry(),modelId:t.turn.getResolvedModelId()??"unknown"},{messageCharLen:r.length,numCodeBlocks:l.length,numTokens:n},c).properties.messageId}a(byn,"createModelMessageTelemetryData");function Syn(t,e,r,n,o,s,c){fYe(t,s,r,n,{source:"offTopic",turnIndex:e.turns.length.toString(),userMessageId:o,uiKind:r},{messageCharLen:n.length},c)}a(Syn,"createOffTopicMessageTelemetryData");function Tyn(t,e,r,n,o,s,c,l,u){let d=fYe(t,l,r,n,{source:"suggestion",suggestion:s,turnIndex:(e.turns.length-1).toString(),uiKind:r,suggestionId:c},{promptTokenLen:o,messageCharLen:n.length},u);return s7o(t,r,s,d.properties.messageId,d.properties.conversationId,c,u,l),d.properties.messageId}a(Tyn,"createSuggestionMessageTelemetryData");async function Iyn(t,e,r){let n=await tl(t.ctx,t),o=t.conversation.source==="inline"?"conversationInline":"conversationPanel";HS(t.ctx,void 0,{conversationId:t.conversation.telemetryId,turnIndex:(t.conversation.turns.length-1).toString(),userMessageId:t.turn.telemetryId,provider:e,uiKind:o},r,"index.codesearch",n)}a(Iyn,"telemetryIndexCodesearch");function fYe(t,e,r,n,o,s,c){let l=c??Wt.createAndMarkAsIssued();if(!("messageId"in o)&&!("messageId"in l.properties)){let m=Mt();o.messageId=m}e&&(o.languageId=e.detectedLanguageId,s.documentLength=e.getText().length,s.documentLineCount=e.lineCount);let u={messageText:n,...o},d=l.extendedBy(o,s),f=l.extendedBy(u),h=aE(r);return Et(t,`${h}.message`,d),Et(t,`${h}.messageText`,f,1),d}a(fYe,"telemetryMessage");function xyn(t,e,r,n){HS(t,n,{uiKind:e},{},"conversation.suggestionShown",r)}a(xyn,"createSuggestionShownTelemetryData");function s7o(t,e,r,n,o,s,c,l){HS(t,l,{suggestion:r,messageId:n,conversationId:o,suggestionId:s,uiKind:e},{},"conversation.suggestionSelected",c)}a(s7o,"createSuggestionSelectedTelemetryData");function HS(t,e,r,n,o,s){let c=s??Wt.createAndMarkAsIssued();e&&(r.languageId=e.detectedLanguageId,n.documentLength=e.getText().length,n.documentLineCount=e.lineCount);let l=c.extendedBy(r,n);return Et(t,o,l),l}a(HS,"telemetryUserAction");function Zle(t,e,r){let n=r.extendedBy({messagesJson:JSON.stringify(e)});return Et(t,"engine.messages",n,1)}a(Zle,"logEngineMessages");function aE(t){switch(t){case"conversationInline":return"inlineConversation";case"conversationPanel":case"agentPanel":default:return"conversation"}}a(aE,"telemetryPrefixForUiKind");function a7o(t){let e=t.split(` -`),r=[],n;for(let o=0;o-1,T=E?G7t(y):void 0;if(y.finish_reason||b||T){let R=_.text.join("");if(v=this.asSolutionDecision(await e(R,{text:R,index:y.index,requestId:this.requestId,annotations:_.copilot_annotations,copilotReferences:_.copilot_references,getAPIJsonData:a(()=>Ixe(_,this.ctx),"getAPIJsonData"),finished:!!y.finish_reason,telemetryData:this.telemetryData,thinking:T?{id:T.id??"",text:T.text}:void 0})),this.maybeCancel("after awaiting finishedCb"))return}if(y.finish_reason&&_.function_call.name!==void 0){n=y.finish_reason;continue}if(y.finish_reason&&(v.yieldSolution=!0,v.continueStreaming=!1),!v.yieldSolution)continue;let w=y.finish_reason??"client-trimmed";if(ft(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:w,engineName:o??"",engineChoiceSource:TQ(this.ctx,this.telemetryData).engineChoiceSource})),this.dropCompletionReasons.includes(y.finish_reason)?this.solutions[y.index]=null:_.yielded||(this.stats.markYielded(y.index),yield{solution:_,finishOffset:v.finishOffset,reason:y.finish_reason,requestId:this.requestId,index:y.index,model:o,usage:s,copilot_usage:c},_.yielded=!0),this.maybeCancel("after yielding finished choice"))return;v.continueStreaming||(this.solutions[y.index]=null)}}}for(let[l,u]of Object.entries(this.solutions)){let d=Number(l);if(u!=null&&(ft(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:"Iteration Done",engineName:o??""})),this.stats.markYielded(d),yield{solution:u,finishOffset:void 0,reason:"Iteration Done",requestId:this.requestId,index:d,model:o,usage:s,copilot_usage:c},this.maybeCancel("after yielding after iteration done")))return}if(r.length>0)try{let l=JSON.parse(r);l.error!==void 0&&YS.error(this.ctx,`Error in response: ${l.error.message}`,l.error)}catch{YS.error(this.ctx,`Error parsing extraData: ${r}`)}}asSolutionDecision(e){return e===void 0?{yieldSolution:!1,continueStreaming:!0}:typeof e=="number"?{yieldSolution:!0,continueStreaming:!1,finishOffset:e}:e}async*finishSolutions(e,r,n,o,s){for(let[c,l]of Object.entries(this.solutions)){let u=Number(c);if(l==null)continue;let d=l.text.join("");if(await s(d,{text:d,index:u,requestId:this.requestId,annotations:l.copilot_annotations,copilotReferences:l.copilot_references,getAPIJsonData:a(()=>Ixe(l,this.ctx),"getAPIJsonData"),finished:!0,telemetryData:this.telemetryData}),!l.yielded&&(this.stats.markYielded(u),ft(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:e??"DONE",engineName:r??""})),yield{solution:l,finishOffset:void 0,reason:e??"DONE",requestId:this.requestId,index:u,model:r,usage:n,copilot_usage:o},this.maybeCancel("after yielding on DONE")))return}}maybeCancel(e){return this.cancellationToken?.isCancellationRequested?(YS.debug(this.ctx,"Cancelled: "+e),this.cancel(),!0):!1}cancel(){this.body&&"destroy"in this.body&&typeof this.body.destroy=="function"?this.body.destroy():this.body instanceof ReadableStream&&this.body.cancel()}allSolutionsDone(){let e=Object.values(this.solutions);return e.length==this.expectedNumChoices&&e.every(r=>r==null)}};function Z7t(t,e,r){let n=e.solution.text.join(""),o=!1;e.finishOffset!==void 0&&(YS.debug(t,`solution ${e.index}: early finish at offset ${e.finishOffset}`),n=n.substring(0,e.finishOffset),o=!0),YS.info(t,`solution ${e.index} returned. finish reason: [${e.reason}]`),YS.debug(t,`solution ${e.index} details: finishOffset: [${e.finishOffset}]`);let s=Ixe(e.solution,t);return LYe(t,n,s,e.index,e.requestId,o,r)}a(Z7t,"prepareSolutionForReturn");function Ixe(t,e){let r=t.text.join(""),n=iqo(t,e),o=oqo(t,e),s=t.copilot_annotations.current,c=t.thinking?.id?t.thinking:void 0,l={text:r,tokens:t.text,tool_calls:n,function_call:o,copilot_annotations:s,finish_reason:t.finish_reason??"stop",thinking:c};if(t.logprobs.length===0)return l;let u=t.logprobs.reduce((m,g)=>m.concat(g),[]),d=t.top_logprobs.reduce((m,g)=>m.concat(g),[]),f=t.text_offset.reduce((m,g)=>m.concat(g),[]),h=t.tokens.reduce((m,g)=>m.concat(g),[]);return{...l,logprobs:{token_logprobs:u,top_logprobs:d,text_offset:f,tokens:h}}}a(Ixe,"convertToAPIJsonData");function nqo(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(nqo,"isCopilotConfirmation");function zEn(t,e,r,n,o){if(!t)return{};try{return JSON.parse(t)}catch(s){let c=n?` Chunks (${n.length}): ${JSON.stringify(n)}`:"",l=new Error(`Failed to parse JSON for ${e} '${r}': ${rd(s)}. Input: '${t}'.${c}`);throw o&&jl(o,"toolCall.argumentParseError",{callType:e,callName:r,error:l.message}),l}}a(zEn,"parseCallArguments");function iqo(t,e){let r=[],n=t.tool_calls.getToolCalls();for(let o of n)if(o.name){let s=o.arguments.join("").trim(),c=zEn(s,"tool call",o.name,o.arguments,e);r.push({type:"function",function:{name:o.name,arguments:c},approxNumTokens:o.arguments.length+1,id:o.id})}return r}a(iqo,"extractToolCalls");function oqo(t,e){if(t.function_call.name){let r=t.function_call.arguments.join("").trim(),n=zEn(r,"function call",t.function_call.name,t.function_call.arguments,e);return{name:t.function_call.name,arguments:n}}}a(oqo,"extractFunctionCall");var K7t=class{constructor(){this.choices=new Map}static{a(this,"ChunkStats")}getChoiceStats(e){let r=this.choices.get(e);return r||(r=new J7t,this.choices.set(e,r)),r}add(e){this.getChoiceStats(e).increment()}markYielded(e){this.getChoiceStats(e).markYielded()}toString(){return Array.from(this.choices.entries()).map(([e,r])=>`${e}: ${r.yieldedTokens} -> ${r.seenTokens}`).join(", ")}},J7t=class{constructor(){this.yieldedTokens=-1;this.seenTokens=0}static{a(this,"ChoiceStats")}increment(){this.seenTokens++}markYielded(){this.yieldedTokens=this.seenTokens}};p();function FYe(t,e){return t!==null&&typeof t=="object"&&e in t}a(FYe,"hasKey");function Jh(t,e){return FYe(t,e)?t[e]:void 0}a(Jh,"getKey");var KEn=fe(ei());var sp=new pe("fetchCompletions");function j3(t){return{headerRequestId:t.headers.get("x-request-id")||"",serverExperiments:t.headers.get("X-Copilot-Experiment")||"",deploymentId:t.headers.get("azureml-model-deployment")||""}}a(j3,"getRequestId");function H3(t){let e=t.headers.get("openai-processing-ms");return e?parseInt(e,10):0}a(H3,"getProcessingTime");function JEn(t){switch(t){case"ghostText":return"copilot-ghost";case"synthesize":return"copilot-panel"}}a(JEn,"uiKindToIntent");var bO=class{static{a(this,"OpenAIFetcher")}};function sqo(t,e,r,n){return ux(t,e,"proxy","v1/engines",r,n)}a(sqo,"getProxyEngineUrl");function UYe(t,e,r,n){for(let[o,s]of Object.entries(t)){if(r.includes(o))continue;let c=s;if(o==="extra"&&n){let l={...c};for(let u of n)delete l[u];c=l}e.properties[`request.option.${o}`]=JSON.stringify(c)??"undefined"}}a(UYe,"sanitizeRequestOptionTelemetry");async function aqo(t,e,r,n,o,s,c,l,u,d,f){let h=t.get(Ss),m=sqo(t,c,r,n),g=u.extendedBy({endpoint:n,engineName:r,uiKind:l},Rse(e));UYe(s,g,["prompt","suffix"],["context"]),g.properties.headerRequestId=o,ft(t,"request.sent",g);let A=El(),y=JEn(l);return tz(t,m,c.token,y,o,s,d,f).then(E=>{let _=j3(E);g.extendWithRequestId(_);let v=El()-A;return g.measurements.totalTimeMs=v,sp.info(t,`Request ${o} at <${m}> finished with ${E.status} status after ${v}ms`),g.properties.status=String(E.status),sp.debug(t,"request.response properties",g.properties),sp.debug(t,"request.response measurements",g.measurements),sp.debug(t,"prompt:",e),ft(t,"request.response",g),E}).catch(E=>{if(Ym(E))throw ft(t,"request.cancel",g),E;h.setWarning("cls",{message:Jh(E,"message")??""});let _=g.extendedBy({error:"Network exception"});ft(t,"request.shownWarning",_),g.properties.message=String(Jh(E,"name")??""),g.properties.code=String(Jh(E,"code")??""),g.properties.errno=String(Jh(E,"errno")??""),g.properties.type=String(Jh(E,"type")??"");let v=El()-A;throw g.measurements.totalTimeMs=v,sp.info(t,`Request ${o} at <${m}> rejected with ${String(E)} after ${v}ms`),sp.debug(t,"request.error properties",g.properties),sp.debug(t,"request.error measurements",g.measurements),ft(t,"request.error",g),E}).finally(()=>{kJr(t,e,g)})}a(aqo,"fetchWithInstrumentation");async function cqo(t,e,r,n,o,s,c,l,u,d){let f=u.extendedBy({endpoint:"chat/completions",engineModelId:r,uiKind:l});UYe(s,f,["messages"]),f.properties.headerRequestId=o,ft(t,"request.sent",f);let h=El(),m=JEn(l),g=Vh(t);wB()&&(g=await z$e(t,g));try{let A=await tz(t,n,c.token,m,o,s,d,g),y=j3(A);f.extendWithRequestId(y);let E=El()-h;return f.measurements.totalTimeMs=E,sp.info(t,`Request ${o} at <${n}> finished with ${A.status} status after ${E}ms`),sp.debug(t,"request.response properties",f.properties),sp.debug(t,"request.response measurements",f.measurements),sp.debug(t,"messages:",JSON.stringify(e)),ft(t,"request.response",f),A}catch(A){if(Ym(A))throw ft(t,"request.cancel",f),A;let y=f.extendedBy({error:"Network exception"});ft(t,"request.shownWarning",y),f.properties.message=String(Jh(A,"name")??""),f.properties.code=String(Jh(A,"code")??""),f.properties.errno=String(Jh(A,"errno")??""),f.properties.type=String(Jh(A,"type")??"");let E=El()-h;throw f.measurements.totalTimeMs=E,sp.info(t,`Request ${o} at <${n}> rejected with ${String(A)} after ${E}ms`),sp.debug(t,"request.error properties",f.properties),sp.debug(t,"request.error measurements",f.measurements),ft(t,"request.error",f),A}finally{cue(t,e,f)}}a(cqo,"fetchChatWithInstrumentation");function YEn(t){return UEn(t,e=>e.completionText.trim().length>0)}a(YEn,"postProcessChoices");var lqo="github.copilot.completions.quotaExceeded",Txe=class extends bO{static{a(this,"LiveOpenAIFetcher")}#e;async fetchAndStreamCompletions(e,r,n,o,s){if(this.#e)return{type:"canceled",reason:this.#e};let c=e.get(Ss),l="completions",u=await e.get(Ft).getToken(),d=await this.fetchWithParameters(e,l,r,u,n,s);if(d==="not-sent")return{type:"canceled",reason:"before fetch request"};if(s?.isCancellationRequested){let g=d.body();try{g&&"destroy"in g&&typeof g.destroy=="function"?g.destroy():g instanceof ReadableStream&&g.cancel()}catch(A){sp.exception(e,A,"Error destroying stream")}return{type:"canceled",reason:"after fetch request"}}if(d.status!==200){let g=this.createTelemetryData(l,e,r);return this.handleError(e,c,g,d,r.uiKind)}let h=MK.create(e,r.count,d,n,[],s).processSSE(o),m=bxe(h,g=>Z7t(e,g,n));return{type:"success",choices:YEn(m),getProcessingTime:a(()=>H3(d),"getProcessingTime")}}async fetchAndStreamChat(e,r,n,o,s,c,l,u={},d){if(this.#e)return{type:"canceled",reason:this.#e};let f="https://copilot-proxy.githubusercontent.com/chat/completions",h={messages:r,model:l.id,stream:!0,...u},m=n.extendedBy({endpoint:f,model:l.name}),g=e.get(Ss),A=await e.get(Ft).getToken(),y=await cqo(e,r,l.id,f,s,h,A,o,m,d);if(d?.isCancellationRequested){let b=y.body();try{b&&"destroy"in b&&typeof b.destroy=="function"?b.destroy():b instanceof ReadableStream&&b.cancel()}catch(T){sp.exception(e,T,"Error destroying stream")}return{type:"canceled",reason:"after fetch request"}}if(y.status!==200){let b=Vt.createAndMarkAsIssued({endpoint:f,engineName:l.name,uiKind:o,headerRequestId:s});return this.handleError(e,g,b,y,o)}let _=MK.create(e,1,y,m,[],KEn.CancellationToken.None).processSSE(),v=bxe(_,b=>Z7t(e,b,n));return{type:"success",choices:YEn(v),getProcessingTime:a(()=>H3(y),"getProcessingTime")}}createTelemetryData(e,r,n){return Vt.createAndMarkAsIssued({endpoint:e,engineName:n.engineModelId,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s,c){let l=e.get(Jt).disableLogProb(s),u={prompt:n.prompt.prefix,suffix:n.prompt.suffix,max_tokens:BYe(e),temperature:oue(e,n.count),top_p:sue(e),n:n.count,stop:WEn(e,n.languageId),stream:!0,extra:n.extra};(n.requestLogProbs||!l)&&(u.logprobs=2);let d=VY(n.repoInfo);return d!==void 0&&(u.nwo=d),n.postOptions&&Object.assign(u,n.postOptions),n.prompt.context&&n.prompt.context.length>0&&(u.extra.context=n.prompt.context),await MC(0),c?.isCancellationRequested?"not-sent":await aqo(e,n.prompt,n.engineModelId,r,n.ourRequestId,u,o,n.uiKind,s,c,n.headers)}async handleError(e,r,n,o,s){let c=await o.text();if(o.status===402){this.#e="monthly free code completions exhausted",r.setError("cls",{message:"Completions limit reached"},{command:lqo,title:"Learn More"});let l=vs(e,u=>{this.#e=void 0,(u.envelope.limited_user_quotas?.completions??1)>0&&(r.forceNormal("cls",{inactive:!1}),l.dispose())});return{type:"failed",reason:this.#e}}if(o.status===466)return r.setError("cls",{message:c}),sp.info(e,c),{type:"failed",reason:`client not supported: ${c}`};if(o.clientError&&!o.headers.get("x-github-request-id")){let l=`Last response was a ${o.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;sp.error(e,l),r.setWarning("cls",{message:l}),n.properties.error=`Response status was ${o.status} with no x-github-request-id header`}else o.clientError?(sp.warn(e,`Response status was ${o.status}:`,c),r.setWarning("cls",{message:`Last response was a ${o.status} error: ${c}`}),n.properties.error=`Response status was ${o.status}: ${c}`):(r.setWarning("cls",{message:`Last response was a ${o.status} error`}),n.properties.error=`Response status was ${o.status}`);if(n.properties.status=String(o.status),ft(e,"request.shownWarning",n),o.status===401||o.status===403)return e.get(Ft).resetToken("code_completion",o.status),{type:"failed",reason:`token expired or invalid: ${o.status}`};if(o.status===429){let l=mM(o);cr(e,"request.throttled",{requestSource:s??"unknown"},{retryAfter:l??-1});let u=l??10,d=Math.max(u,0)*1e3;return setTimeout(()=>{this.#e=void 0},d),this.#e=`Rate limited by server. Retry in ${u}s.`,sp.warn(e,this.#e),{type:"failed",reason:this.#e}}return o.status===499?(sp.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(sp.error(e,"Unhandled status from server:",o.status,c),{type:"failed",reason:`unhandled status from server: ${o.status} ${c}`})}};Mo();async function xxe(t,e,r,n){let o=Vt.createAndMarkAsIssued({messageId:e,conversationId:r});return await t.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments(n,o)}a(xxe,"createTelemetryWithExpWithId");function rl(t,{turn:e,conversation:r}={},n){return xxe(t,e?.telemetryId??"",r?.telemetryId??"",n)}a(rl,"createTelemetryWithExpWithTurn");function wxe(t,e,r,n,o,s,c,l){let u=t.turns[t.turns.length-1].skills.map(h=>h.skillId).sort(),d={source:"user",turnIndex:(t.turns.length-1).toString(),uiKind:e,skillIds:u.join(",")},f={promptTokenLen:n,messageCharLen:r};return o&&(d.suggestion=o),s&&(d.suggestionId=s),l.length>0&&(d.skillResolutionsJson=JSON.stringify(uqo(l))),c=c.extendedBy(d,f),c}a(wxe,"extendUserMessageTelemetryData");function uqo(t){return t.map(e=>({skillId:e.skillId,resolution:e.resolution,fileStatus:e.files?.map(r=>r.status),tokensPreEliding:e.tokensPreEliding??0,resolutionTimeMs:e.resolutionTimeMs??0,processingTimeMs:e.processingTimeMs??0}))}a(uqo,"mapSkillResolutionsForTelemetry");function ZEn(t,e,r,n,o,s,c){return n!=null&&(c=c.extendedBy({offTopic:n.toString()})),QYe(t,s,e,r,{uiKind:e,headerRequestId:o},{},c).properties.messageId}a(ZEn,"createUserMessageTelemetryData");function XEn(t,e,r,n,o,s,c){let l=fqo(r);return QYe(t.ctx,s,e,r,{source:"model",turnIndex:(t.conversation.turns.length-1).toString(),headerRequestId:o,uiKind:e,codeBlockLanguages:JSON.stringify(l),mode:t.turn.getChatModeForTelemetry(),modelId:t.turn.getResolvedModelId()??"unknown"},{messageCharLen:r.length,numCodeBlocks:l.length,numTokens:n},c).properties.messageId}a(XEn,"createModelMessageTelemetryData");function e_n(t,e,r,n,o,s,c){QYe(t,s,r,n,{source:"offTopic",turnIndex:e.turns.length.toString(),userMessageId:o,uiKind:r},{messageCharLen:n.length},c)}a(e_n,"createOffTopicMessageTelemetryData");function t_n(t,e,r,n,o,s,c,l,u){let d=QYe(t,l,r,n,{source:"suggestion",suggestion:s,turnIndex:(e.turns.length-1).toString(),uiKind:r,suggestionId:c},{promptTokenLen:o,messageCharLen:n.length},u);return dqo(t,r,s,d.properties.messageId,d.properties.conversationId,c,u,l),d.properties.messageId}a(t_n,"createSuggestionMessageTelemetryData");async function r_n(t,e,r){let n=await rl(t.ctx,t),o=t.conversation.source==="inline"?"conversationInline":"conversationPanel";KS(t.ctx,void 0,{conversationId:t.conversation.telemetryId,turnIndex:(t.conversation.turns.length-1).toString(),userMessageId:t.turn.telemetryId,provider:e,uiKind:o},r,"index.codesearch",n)}a(r_n,"telemetryIndexCodesearch");function QYe(t,e,r,n,o,s,c){let l=c??Vt.createAndMarkAsIssued();if(!("messageId"in o)&&!("messageId"in l.properties)){let m=Nt();o.messageId=m}e&&(o.languageId=e.detectedLanguageId,s.documentLength=e.getText().length,s.documentLineCount=e.lineCount);let u={messageText:n,...o},d=l.extendedBy(o,s),f=l.extendedBy(u),h=fE(r);return ft(t,`${h}.message`,d),ft(t,`${h}.messageText`,f,1),d}a(QYe,"telemetryMessage");function n_n(t,e,r,n){KS(t,n,{uiKind:e},{},"conversation.suggestionShown",r)}a(n_n,"createSuggestionShownTelemetryData");function dqo(t,e,r,n,o,s,c,l){KS(t,l,{suggestion:r,messageId:n,conversationId:o,suggestionId:s,uiKind:e},{},"conversation.suggestionSelected",c)}a(dqo,"createSuggestionSelectedTelemetryData");function KS(t,e,r,n,o,s){let c=s??Vt.createAndMarkAsIssued();e&&(r.languageId=e.detectedLanguageId,n.documentLength=e.getText().length,n.documentLineCount=e.lineCount);let l=c.extendedBy(r,n);return ft(t,o,l),l}a(KS,"telemetryUserAction");function cue(t,e,r){let n=r.extendedBy({messagesJson:JSON.stringify(e)});return ft(t,"engine.messages",n,1)}a(cue,"logEngineMessages");function fE(t){switch(t){case"conversationInline":return"inlineConversation";case"conversationPanel":case"agentPanel":default:return"conversation"}}a(fE,"telemetryPrefixForUiKind");function fqo(t){let e=t.split(` +`),r=[],n;for(let o=0;o(s.System="system",s.User="user",s.Assistant="assistant",s.Function="function",s.Tool="tool",s))(ic||{});function Pn(t){return t?(t=GS(t),typeof t=="string"?t:t.map(e=>"text"in e?e.text:"").join("")):""}a(Pn,"getTextPart");function Dyn(t){return t.some(e=>Array.isArray(e.content)?e.content.some(r=>r.type==="image_url"):!1)}a(Dyn,"hasImageContent");function iq(t){return t.some(e=>{let r=a(n=>{if(Array.isArray(n)){if(Xle(n))return n.some(o=>o.type==="image_url");if(TK(n))return n.some(o=>Array.isArray(o.content)?o.content.some(s=>s.type==="image_url"):!1)}return!1},"checkContent");return e.request?.message&&r(e.request.message)||e.response?.message&&r(e.response.message)})}a(iq,"hasImageContentInTurns");var Nyn=a((t,e)=>S.Unsafe({type:"string",enum:t,description:e?.description}),"StringEnum"),Myn=S.Optional(S.Object({agentSlug:S.String(),state:S.Union([S.Literal("accepted"),S.Literal("dismissed")]),confirmation:S.Any()}));function B3(t){if(typeof t.function.arguments=="string")try{return JSON.parse(t.function.arguments)}catch{return{}}return t.function.arguments}a(B3,"parseToolCallArguments");function Oyn(t){return typeof t.function.arguments=="object"&&(t.function.arguments=JSON.stringify(t.function.arguments)),t}a(Oyn,"toOpenAIToolCall");function Lyn(t,e,r,n,o,s,c,l,u,d,f,h){let m=JSON.parse(JSON.stringify(e));r.tool_calls&&(m.tool_calls=r.tool_calls),Zle(t,[m],l);let g=r.thinking;return g&&g.tokens===void 0&&(g.tokens=Jle(g,h)),{message:e,choiceIndex:n,requestId:o,blockFinished:s,finishReason:c,tokens:r.tokens,numTokens:r.tokens.length,tool_calls:r.tool_calls,function_call:r.function_call,telemetryData:l,copilotEditsSessionHeader:u,thinking:g,usage:d,copilot_usage:f}}a(Lyn,"convertToChatCompletion");function Xle(t){return Array.isArray(t)&&t.every(e=>"type"in e&&!("role"in e))}a(Xle,"isChatCompletionContentPartArray");function TK(t){return Array.isArray(t)&&t.every(e=>"role"in e)}a(TK,"isChatMessageArray");function GS(t){if(typeof t=="string")return t;if(Xle(t))return t;if(TK(t)){let e=t.filter(n=>n.role==="assistant"),r=[];for(let n of e)Array.isArray(n.content)?r.push(...n.content):r.push({type:"text",text:n.content});return r}return""}a(GS,"resolveAsChatMessageContent");function oq(t,e){return(typeof t=="string"||Xle(t))&&(t=[{role:"assistant",content:t}]),t.push(e),t}a(oq,"appendChatMessageContent");function yO(t,e){if(t){if(typeof t=="string"||Xle(t))return[{role:"assistant",content:t}];if(TK(t))return e?t:t.filter(r=>r.role!=="tool").map(r=>r.tool_calls?{...r,tool_calls:void 0,tool_call_id:void 0}:r)}else return[];return[]}a(yO,"resolveResponseAsChatMessages");p();var c7t=new fe("streamMessages");function Byn(t,e,r,n,o){let s=e.solution.text.join(""),c=!1;e.finishOffset!==void 0&&(c7t.debug(t,`message ${e.index}: early finish at offset ${e.finishOffset}`),s=s.substring(0,e.finishOffset),c=!0),c7t.info(t,`message ${e.index} returned. finish reason: [${e.reason}]`),c7t.debug(t,`message ${e.index} details: finishOffset: [${e.finishOffset}]`);let l=sxe(e.solution,t),u={role:"assistant",content:s};return Lyn(t,u,l,e.index,e.requestId,c,e.reason??"",r,n,e.usage,e.copilot_usage,o)}a(Byn,"prepareChatCompletionForReturn");Mo();var pYe=class{constructor(){this.name="completions";this.engineName="chat"}static{a(this,"ChatCompletionsEndpointStrategy")}buildRequestBody(e,r){let o={messages:r.messages.map(c=>{let l={...c};if(delete l.thinking,c.thinking&&c.thinking.id){l.reasoning_opaque=c.thinking.id;let u=Array.isArray(c.thinking.text)?c.thinking.text.join(""):c.thinking.text;u&&(l.reasoning_text=u)}return l}),tools:r.tools,tool_choice:r.tool_choice,model:r.modelConfiguration?.modelId,temperature:Yle(e,r.count),top_p:Kle(e),n:r.count,stop:[` +`);return r+n}a(mqo,"truncateContentIfNeeded");var gqo=["requestSource","chatRequestModel","mapper","headerRequestId","mode","modelId","languageId","messageId","conversationId","uiKind"];function a_n(t,e,r,n,o,s,c){let l=`${fE(e)}.${c}`,u=s.extendedBy(r,n);ft(t,l,u);let d={...r,uiKind:e||""};ft(t,c),cr(t,c,SU(d,gqo),n);let f={...r};o.currentFileContent!==void 0&&(f.completionTextJson=mqo(o.currentFileContent));let h=s.extendedBy(f,n);ft(t,`${l}.restricted`,h,1)}a(a_n,"telemetryEditSurvivalTracking");var ac=(s=>(s.System="system",s.User="user",s.Assistant="assistant",s.Function="function",s.Tool="tool",s))(ac||{});function Pn(t){return t?(t=JS(t),typeof t=="string"?t:t.map(e=>"text"in e?e.text:"").join("")):""}a(Pn,"getTextPart");function c_n(t){return t.some(e=>Array.isArray(e.content)?e.content.some(r=>r.type==="image_url"):!1)}a(c_n,"hasImageContent");function Aq(t){return t.some(e=>{let r=a(n=>{if(Array.isArray(n)){if(lue(n))return n.some(o=>o.type==="image_url");if(OK(n))return n.some(o=>Array.isArray(o.content)?o.content.some(s=>s.type==="image_url"):!1)}return!1},"checkContent");return e.request?.message&&r(e.request.message)||e.response?.message&&r(e.response.message)})}a(Aq,"hasImageContentInTurns");var l_n=a((t,e)=>S.Unsafe({type:"string",enum:t,description:e?.description}),"StringEnum"),u_n=S.Optional(S.Object({agentSlug:S.String(),state:S.Union([S.Literal("accepted"),S.Literal("dismissed")]),confirmation:S.Any()}));function $3(t){if(typeof t.function.arguments=="string")try{return JSON.parse(t.function.arguments)}catch{return{}}return t.function.arguments}a($3,"parseToolCallArguments");function d_n(t){return typeof t.function.arguments=="object"&&(t.function.arguments=JSON.stringify(t.function.arguments)),t}a(d_n,"toOpenAIToolCall");function f_n(t,e,r,n,o,s,c,l,u,d,f,h){let m=JSON.parse(JSON.stringify(e));r.tool_calls&&(m.tool_calls=r.tool_calls),cue(t,[m],l);let g=r.thinking;return g&&g.tokens===void 0&&(g.tokens=aue(g,h)),{message:e,choiceIndex:n,requestId:o,blockFinished:s,finishReason:c,tokens:r.tokens,numTokens:r.tokens.length,tool_calls:r.tool_calls,function_call:r.function_call,telemetryData:l,copilotEditsSessionHeader:u,thinking:g,usage:d,copilot_usage:f}}a(f_n,"convertToChatCompletion");function lue(t){return Array.isArray(t)&&t.every(e=>"type"in e&&!("role"in e))}a(lue,"isChatCompletionContentPartArray");function OK(t){return Array.isArray(t)&&t.every(e=>"role"in e)}a(OK,"isChatMessageArray");function JS(t){if(typeof t=="string")return t;if(lue(t))return t;if(OK(t)){let e=t.filter(n=>n.role==="assistant"),r=[];for(let n of e)Array.isArray(n.content)?r.push(...n.content):r.push({type:"text",text:n.content});return r}return""}a(JS,"resolveAsChatMessageContent");function yq(t,e){return(typeof t=="string"||lue(t))&&(t=[{role:"assistant",content:t}]),t.push(e),t}a(yq,"appendChatMessageContent");function SO(t,e){if(t){if(typeof t=="string"||lue(t))return[{role:"assistant",content:t}];if(OK(t))return e?t:t.filter(r=>r.role!=="tool").map(r=>r.tool_calls?{...r,tool_calls:void 0,tool_call_id:void 0}:r)}else return[];return[]}a(SO,"resolveResponseAsChatMessages");p();var eQt=new pe("streamMessages");function p_n(t,e,r,n,o){let s=e.solution.text.join(""),c=!1;e.finishOffset!==void 0&&(eQt.debug(t,`message ${e.index}: early finish at offset ${e.finishOffset}`),s=s.substring(0,e.finishOffset),c=!0),eQt.info(t,`message ${e.index} returned. finish reason: [${e.reason}]`),eQt.debug(t,`message ${e.index} details: finishOffset: [${e.finishOffset}]`);let l=Ixe(e.solution,t),u={role:"assistant",content:s};return f_n(t,u,l,e.index,e.requestId,c,e.reason??"",r,n,e.usage,e.copilot_usage,o)}a(p_n,"prepareChatCompletionForReturn");Mo();var qYe=class{constructor(){this.name="completions";this.engineName="chat"}static{a(this,"ChatCompletionsEndpointStrategy")}buildRequestBody(e,r){let o={messages:r.messages.map(c=>{let l={...c};if(delete l.thinking,c.thinking&&c.thinking.id){l.reasoning_opaque=c.thinking.id;let u=Array.isArray(c.thinking.text)?c.thinking.text.join(""):c.thinking.text;u&&(l.reasoning_text=u)}return l}),tools:r.tools,tool_choice:r.tool_choice,model:r.modelConfiguration?.modelId,temperature:oue(e,r.count),top_p:sue(e),n:r.count,stop:[` -`],copilot_thread_id:r.copilot_thread_id};r.modelConfiguration?.maxResponseTokens!==void 0&&(o.max_tokens=r.modelConfiguration.maxResponseTokens);let s=MY(r.repoInfo);if(s!==void 0&&(o.nwo=s),r.postOptions&&Object.assign(o,r.postOptions),r.enableThinking||r.modelConfiguration?.reasoningEfforts?.length){let c=mO(r.modelConfiguration?.reasoningEfforts,r.modelConfiguration?.userSelectedReasoningEffort);c&&(o.reasoning_effort=c)}return r.intentParams?.intent&&(o.intent=r.intentParams.intent,r.intentParams.intent_model&&(o.intent_model=r.intentParams.intent_model),r.intentParams.intent_tokenizer&&(o.intent_tokenizer=r.intentParams.intent_tokenizer),r.intentParams.intent_threshold&&(o.intent_threshold=r.intentParams.intent_threshold),r.intentParams.intent_content&&(o.intent_content=r.intentParams.intent_content)),o}processResponse(e,r,n,o,s){let c=r.headers.get(rq)||void 0;return s.postOptions?.stream===!1?{type:"success",chatCompletions:this.processNonStreamingResponse(r,n,o,c),getProcessingTime:a(()=>O3(r),"getProcessingTime")}:this.processStreamingResponse(e,r,n,o,c,s)}processNonStreamingResponse(e,r,n,o){return(async function*(){let s=await e.text(),c=JSON.parse(s),l=c.choices!=null?c.choices[0].message:{role:"assistant",content:""},u=e.headers.get("X-Request-ID")??Mt(),d={blockFinished:!1,choiceIndex:0,finishReason:"stop",message:l,tokens:Pn(l.content).split(" "),requestId:{headerRequestId:u,deploymentId:"",serverExperiments:""},telemetryData:n,numTokens:0,copilotEditsSessionHeader:o,usage:c.usage},f=Pn(l.content);await r(f,{text:f,copilotReferences:c.copilot_references}),yield Promise.resolve(d)})()}processStreamingResponse(e,r,n,o,s,c){let u=SK.create(e,c.count,r,o,[],c.cancel).processSSE(n);return{type:"success",chatCompletions:nxe(u,f=>Byn(e,f,o,s,c.modelConfiguration?.modelId)),getProcessingTime:a(()=>O3(r),"getProcessingTime")}}};p();p();p();var cE=de(Io());var e_n="ephemeral",eQt=4,pQo=2;function t_n(t){let e=eQt-pQo-hQo(t);if(e<=0)return;let r=!0,n=[...t].reverse();for(let[o,s]of n.entries()){let c=o>0?n[o-1]:void 0;if(s.content.some(f=>f.type===cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint))continue;let u=s.role===cE.Raw.ChatRole.Tool&&c?.role!==cE.Raw.ChatRole.Tool,d=s.role===cE.Raw.ChatRole.Assistant&&!s.toolCalls?.length;if((r&&(u||s.role===cE.Raw.ChatRole.User)||d)&&(s.content.push({type:cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e_n}),e--,e<=0))break;s.role===cE.Raw.ChatRole.User&&(r=!1)}for(let o of t){if(e<=0)break;let s=o.content.some(c=>c.type===cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint);if((o.role===cE.Raw.ChatRole.User||o.role===cE.Raw.ChatRole.System)&&!s&&(e--,o.content.push({type:cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e_n})),o.role!==cE.Raw.ChatRole.User&&o.role!==cE.Raw.ChatRole.System)break}}a(t_n,"addCacheBreakpoints");function hQo(t){let e=0;for(let r of t)e+=r.content.filter(n=>n.type===cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint).length;return e}a(hQo,"countCacheBreakpoints");function r_n(t){for(let e of t)e.content=e.content.filter(r=>r.type!==cE.Raw.ChatCompletionContentPartKind.CacheBreakpoint)}a(r_n,"removeCacheBreakpoints");var i_n=new fe("messagesApi"),mQo="Please continue.";function o_n(t){let e=yQo(t.tools),r=gQo(t.messages,t.ctx);EQo(e,r);let n=r.messages.at(-1);n&&n.role==="assistant"&&r.messages.push({role:"user",content:[{type:"text",text:mQo}]});let o={model:t.model,...r,max_tokens:t.maxTokens??4096,stream:t.stream??!0,...e.length>0?{tools:e}:{}};return t.adaptiveThinking?(o.thinking={type:"adaptive"},t.thinkingEffort&&(o.output_config={effort:t.thinkingEffort})):t.thinkingBudget&&t.thinkingBudget>0&&(o.thinking={type:"enabled",budget_tokens:t.thinkingBudget}),o}a(o_n,"buildMessagesApiRequest");function gQo(t,e){let r=[],n=[];for(let s of t)switch(s.role){case"system":{let c=GYe(s.content);for(let l of c)l.type==="text"&&n.push(l);break}case"user":{let c=GYe(s.content);s.copilot_cache_control&&n_n(c),c.length>0&&r.push({role:"user",content:c});break}case"assistant":{let c=GYe(s.content);if(s.thinking&&AQo(e,c,s.thinking),s.tool_calls)for(let l of s.tool_calls){if(!l.id)continue;let u={};try{u=typeof l.function.arguments=="string"?JSON.parse(l.function.arguments):l.function.arguments}catch{i_n.warn(e,`Failed to parse tool call arguments for ${l.function.name}, using empty object`)}c.push({type:"tool_use",id:l.id,name:l.function.name,input:u})}s.copilot_cache_control&&n_n(c),c.length>0&&r.push({role:"assistant",content:c});break}case"tool":{if(s.tool_call_id){let l=GYe(s.content).filter(d=>(d.type==="text"||d.type==="image")&&!(d.type==="text"&&d.text.trim()==="")),u={type:"tool_result",tool_use_id:s.tool_call_id,content:l.length>0?l:void 0};s.copilot_cache_control&&(u.cache_control={type:"ephemeral"}),r.push({role:"user",content:[u]})}break}}let o=[];for(let s of r){let c=o.at(-1);c&&c.role===s.role?c.content=[...c.content,...s.content]:o.push(s)}return{messages:o,...n.length>0?{system:n}:{}}}a(gQo,"convertToAnthropicMessages");function GYe(t){if(!t)return[];if(typeof t=="string")return t.trim()?[{type:"text",text:t}]:[];let e=[];for(let r of t)if(r.type==="text")r.text.trim()&&e.push({type:"text",text:r.text});else if(r.type==="image_url"){let n=r.image_url.url,o=n.match(/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/);o?e.push({type:"image",source:{type:"base64",media_type:o[1],data:o[2]}}):n.startsWith("https://")&&e.push({type:"image",source:{type:"url",url:n}})}return e}a(GYe,"convertContentToAnthropicBlocks");function AQo(t,e,r){let n=Array.isArray(r.text)?r.text.join(""):r.text;n&&r.encrypted?e.unshift({type:"thinking",thinking:n,signature:r.encrypted}):r.encrypted&&!n?e.unshift({type:"redacted_thinking",data:r.encrypted}):n&&!r.encrypted&&i_n.warn(t,"Dropping thinking block: has text but no signature (possible incomplete stream)")}a(AQo,"addThinkingBlocks");function n_n(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.type!=="thinking"&&r.type!=="redacted_thinking"){r.cache_control={type:"ephemeral"};return}}}a(n_n,"applyCacheControlToLastBlock");function yQo(t){return!t||t.length===0?[]:t.filter(e=>e.function.name&&e.function.name.length>0).map(e=>({name:e.function.name,description:e.function.description||"",input_schema:{type:"object",properties:e.function.parameters?.properties??{},required:e.function.parameters?.required}}))}a(yQo,"convertToAnthropicTools");function EQo(t,e){let r=0;if(e.system)for(let c of e.system)c.cache_control&&r++;for(let c of e.messages)for(let l of c.content)"cache_control"in l&&l.cache_control&&r++;let n=eQt-r;if(n<=0)return;let o=t.at(-1);o&&n>0&&(o.cache_control={type:"ephemeral"},n--);let s=e.system?.at(-1);s&&!s.cache_control&&n>0&&(s.cache_control={type:"ephemeral"})}a(EQo,"addToolsAndSystemCacheControl");p();p();var iue=class{constructor(e,r){this.dataBuffer="";this.eventTypeBuffer="";this.buffer=[];this.endedOnCR=!1;this.onEventHandler=e,this.onUnrecognizedFieldHandler=r,this.decoder=new TextDecoder("utf-8")}static{a(this,"SSEParser")}getLastEventId(){return this.lastEventIdBuffer}getReconnectionTime(){return this.reconnectionTime}feed(e){if(e.length===0)return;let r=0;for(this.endedOnCR&&e[0]===10&&r++,this.endedOnCR=!1;rH3(r),"getProcessingTime")}:this.processStreamingResponse(e,r,n,o,c,s)}processNonStreamingResponse(e,r,n,o){return(async function*(){let s=await e.text(),c=JSON.parse(s),l=c.choices!=null?c.choices[0].message:{role:"assistant",content:""},u=e.headers.get("X-Request-ID")??Nt(),d={blockFinished:!1,choiceIndex:0,finishReason:"stop",message:l,tokens:Pn(l.content).split(" "),requestId:{headerRequestId:u,deploymentId:"",serverExperiments:""},telemetryData:n,numTokens:0,copilotEditsSessionHeader:o,usage:c.usage},f=Pn(l.content);await r(f,{text:f,copilotReferences:c.copilot_references}),yield Promise.resolve(d)})()}processStreamingResponse(e,r,n,o,s,c){let u=MK.create(e,c.count,r,o,[],c.cancel).processSSE(n);return{type:"success",chatCompletions:bxe(u,f=>p_n(e,f,o,s,c.modelConfiguration?.modelId)),getProcessingTime:a(()=>H3(r),"getProcessingTime")}}};p();p();p();var pE=fe(Io());var kvn="ephemeral",VQt=4,yjo=2;function Pvn(t){let e=VQt-yjo-Ejo(t);if(e<=0)return;let r=!0,n=[...t].reverse();for(let[o,s]of n.entries()){let c=o>0?n[o-1]:void 0;if(s.content.some(f=>f.type===pE.Raw.ChatCompletionContentPartKind.CacheBreakpoint))continue;let u=s.role===pE.Raw.ChatRole.Tool&&c?.role!==pE.Raw.ChatRole.Tool,d=s.role===pE.Raw.ChatRole.Assistant&&!s.toolCalls?.length;if((r&&(u||s.role===pE.Raw.ChatRole.User)||d)&&(s.content.push({type:pE.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:kvn}),e--,e<=0))break;s.role===pE.Raw.ChatRole.User&&(r=!1)}for(let o of t){if(e<=0)break;let s=o.content.some(c=>c.type===pE.Raw.ChatCompletionContentPartKind.CacheBreakpoint);if((o.role===pE.Raw.ChatRole.User||o.role===pE.Raw.ChatRole.System)&&!s&&(e--,o.content.push({type:pE.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:kvn})),o.role!==pE.Raw.ChatRole.User&&o.role!==pE.Raw.ChatRole.System)break}}a(Pvn,"addCacheBreakpoints");function Ejo(t){let e=0;for(let r of t)e+=r.content.filter(n=>n.type===pE.Raw.ChatCompletionContentPartKind.CacheBreakpoint).length;return e}a(Ejo,"countCacheBreakpoints");function Dvn(t){for(let e of t)e.content=e.content.filter(r=>r.type!==pE.Raw.ChatCompletionContentPartKind.CacheBreakpoint)}a(Dvn,"removeCacheBreakpoints");var Mvn=new pe("messagesApi"),_jo="Please continue.";function Ovn(t){let e=bjo(t.tools),r=vjo(t.messages,t.ctx);Sjo(e,r);let n=r.messages.at(-1);n&&n.role==="assistant"&&r.messages.push({role:"user",content:[{type:"text",text:_jo}]});let o={model:t.model,...r,max_tokens:t.maxTokens??4096,stream:t.stream??!0,...e.length>0?{tools:e}:{}};return t.adaptiveThinking?(o.thinking={type:"adaptive"},t.thinkingEffort&&(o.output_config={effort:t.thinkingEffort})):t.thinkingBudget&&t.thinkingBudget>0&&(o.thinking={type:"enabled",budget_tokens:t.thinkingBudget}),o}a(Ovn,"buildMessagesApiRequest");function vjo(t,e){let r=[],n=[];for(let s of t)switch(s.role){case"system":{let c=yKe(s.content);for(let l of c)l.type==="text"&&n.push(l);break}case"user":{let c=yKe(s.content);s.copilot_cache_control&&Nvn(c),c.length>0&&r.push({role:"user",content:c});break}case"assistant":{let c=yKe(s.content);if(s.thinking&&Cjo(e,c,s.thinking),s.tool_calls)for(let l of s.tool_calls){if(!l.id)continue;let u={};try{u=typeof l.function.arguments=="string"?JSON.parse(l.function.arguments):l.function.arguments}catch{Mvn.warn(e,`Failed to parse tool call arguments for ${l.function.name}, using empty object`)}c.push({type:"tool_use",id:l.id,name:l.function.name,input:u})}s.copilot_cache_control&&Nvn(c),c.length>0&&r.push({role:"assistant",content:c});break}case"tool":{if(s.tool_call_id){let l=yKe(s.content).filter(d=>(d.type==="text"||d.type==="image")&&!(d.type==="text"&&d.text.trim()==="")),u={type:"tool_result",tool_use_id:s.tool_call_id,content:l.length>0?l:void 0};s.copilot_cache_control&&(u.cache_control={type:"ephemeral"}),r.push({role:"user",content:[u]})}break}}let o=[];for(let s of r){let c=o.at(-1);c&&c.role===s.role?c.content=[...c.content,...s.content]:o.push(s)}return{messages:o,...n.length>0?{system:n}:{}}}a(vjo,"convertToAnthropicMessages");function yKe(t){if(!t)return[];if(typeof t=="string")return t.trim()?[{type:"text",text:t}]:[];let e=[];for(let r of t)if(r.type==="text")r.text.trim()&&e.push({type:"text",text:r.text});else if(r.type==="image_url"){let n=r.image_url.url,o=n.match(/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/);o?e.push({type:"image",source:{type:"base64",media_type:o[1],data:o[2]}}):n.startsWith("https://")&&e.push({type:"image",source:{type:"url",url:n}})}return e}a(yKe,"convertContentToAnthropicBlocks");function Cjo(t,e,r){let n=Array.isArray(r.text)?r.text.join(""):r.text;n&&r.encrypted?e.unshift({type:"thinking",thinking:n,signature:r.encrypted}):r.encrypted&&!n?e.unshift({type:"redacted_thinking",data:r.encrypted}):n&&!r.encrypted&&Mvn.warn(t,"Dropping thinking block: has text but no signature (possible incomplete stream)")}a(Cjo,"addThinkingBlocks");function Nvn(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.type!=="thinking"&&r.type!=="redacted_thinking"){r.cache_control={type:"ephemeral"};return}}}a(Nvn,"applyCacheControlToLastBlock");function bjo(t){return!t||t.length===0?[]:t.filter(e=>e.function.name&&e.function.name.length>0).map(e=>({name:e.function.name,description:e.function.description||"",input_schema:{type:"object",properties:e.function.parameters?.properties??{},required:e.function.parameters?.required}}))}a(bjo,"convertToAnthropicTools");function Sjo(t,e){let r=0;if(e.system)for(let c of e.system)c.cache_control&&r++;for(let c of e.messages)for(let l of c.content)"cache_control"in l&&l.cache_control&&r++;let n=VQt-r;if(n<=0)return;let o=t.at(-1);o&&n>0&&(o.cache_control={type:"ephemeral"},n--);let s=e.system?.at(-1);s&&!s.cache_control&&n>0&&(s.cache_control={type:"ephemeral"})}a(Sjo,"addToolsAndSystemCacheControl");p();p();var hue=class{constructor(e,r){this.dataBuffer="";this.eventTypeBuffer="";this.buffer=[];this.endedOnCR=!1;this.onEventHandler=e,this.onUnrecognizedFieldHandler=r,this.decoder=new TextDecoder("utf-8")}static{a(this,"SSEParser")}getLastEventId(){return this.lastEventIdBuffer}getReconnectionTime(){return this.reconnectionTime}feed(e){if(e.length===0)return;let r=0;for(this.endedOnCR&&e[0]===10&&r++,this.endedOnCR=!1;r{try{if(A.data==="[DONE]")return;let y;try{y={type:A.type,...JSON.parse(A.data)}}catch(_){Cxe.warn(t,`Skipping malformed SSE event: ${String(_.message).substring(0,100)}`);return}let E=f.push(y,r);E&&h.push(E)}catch(y){m=y}});for await(let A of l){if(s?.isCancellationRequested)break;for(g.feed(new Uint8Array(A));h.length>0;)yield h.shift();if(m)throw m}for(;h.length>0;)yield h.shift()}finally{try{l.destroy()}catch(g){Cxe.exception(t,g,`Error destroying stream for Messages API request ${u}`)}}}a(s_n,"processMessagesApiStream");var tQt=class{constructor(e,r,n,o,s,c){this.ctx=e;this.telemetryData=r;this.requestId=n;this.ghRequestId=o;this.copilotEditsSessionHeader=s;this.modelId=c;this.textAccumulator="";this.toolCallAccumulator=new Map;this.thinkingAccumulator=new Map;this.completedToolCalls=[];this.completedThinking=[];this.inputTokens=0;this.outputTokens=0;this.cacheCreationTokens=0;this.cacheReadTokens=0;this.hasError=!1}static{a(this,"AnthropicMessagesProcessor")}push(e,r){if(this.hasError)return;let n=a((o,s)=>{this.textAccumulator+=o,r(this.textAccumulator,{text:this.textAccumulator,...s})},"onProgress");switch(e.type){case"message_start":e.message&&(this.inputTokens=e.message.usage.input_tokens??0,this.outputTokens=e.message.usage.output_tokens??0,this.cacheCreationTokens=e.message.usage.cache_creation_input_tokens??0,this.cacheReadTokens=e.message.usage.cache_read_input_tokens??0);return;case"content_block_start":e.content_block?.type==="tool_use"&&e.index!==void 0?this.toolCallAccumulator.set(e.index,{id:e.content_block.id||"",name:e.content_block.name||"",arguments:""}):e.content_block?.type==="thinking"&&e.index!==void 0?this.thinkingAccumulator.set(e.index,{thinking:"",signature:""}):e.content_block?.type==="redacted_thinking"&&e.index!==void 0&&e.content_block.data&&(n("",{thinking:{id:`redacted_thinking_${e.index}`,encrypted:e.content_block.data}}),this.completedThinking.push({index:e.index,thinking:"",signature:e.content_block.data}));return;case"content_block_delta":if(e.delta){if(e.delta.type==="text_delta"&&e.delta.text)n(e.delta.text,{});else if(e.delta.type==="thinking_delta"&&e.delta.thinking&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.thinking+=e.delta.thinking),n("",{thinking:{id:`thinking_${e.index}`,text:e.delta.thinking}})}else if(e.delta.type==="signature_delta"&&e.delta.signature&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.signature+=e.delta.signature)}else if(e.delta.type==="input_json_delta"&&e.delta.partial_json&&e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(o.arguments+=e.delta.partial_json)}}return;case"content_block_stop":if(e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(this.completedToolCalls.push(o),this.toolCallAccumulator.delete(e.index));let s=this.thinkingAccumulator.get(e.index);s&&(s.signature?n("",{thinking:{id:`thinking_${e.index}`,encrypted:s.signature}}):Cxe.warn(this.ctx,`Thinking block ${e.index} finalized without signature (incomplete stream?)`),this.completedThinking.push({index:e.index,...s}),this.thinkingAccumulator.delete(e.index))}return;case"message_delta":e.usage&&(this.outputTokens=e.usage.output_tokens,this.inputTokens=e.usage.input_tokens??this.inputTokens,this.cacheCreationTokens=e.usage.cache_creation_input_tokens??this.cacheCreationTokens,this.cacheReadTokens=e.usage.cache_read_input_tokens??this.cacheReadTokens),e.delta?.stop_reason&&(this.stopReason=e.delta.stop_reason),e.copilot_usage&&(this.copilotUsage=e.copilot_usage);return;case"message_stop":return this.buildFinalCompletion();case"error":{let o=e.error,s=o?.message||"Unknown error",c=o?.type||"unknown";return Cxe.warn(this.ctx,`Messages API error (${c}): ${s}`),n("",{copilotErrors:[{type:"error",code:c,message:s,identifier:""}]}),this.stopReason="error",this.hasError=!0,this.buildFinalCompletion()}}}buildFinalCompletion(){let e;switch(this.stopReason){case"max_tokens":case"model_context_window_exceeded":e="length";break;case"tool_use":e="tool_calls";break;case"refusal":e="content_filter";break;default:e="stop";break}let r=this.inputTokens+this.cacheCreationTokens+this.cacheReadTokens,n={prompt_tokens:r,completion_tokens:this.outputTokens,total_tokens:r+this.outputTokens,prompt_tokens_details:{cached_tokens:this.cacheReadTokens}},o=this.copilotUsage,s={role:"assistant",content:this.textAccumulator},c=[...this.completedThinking.map(d=>({index:d.index,thinking:d.thinking,signature:d.signature})),...[...this.thinkingAccumulator.entries()].map(([d,f])=>({index:d,...f}))],l;for(let d of c)if(d.thinking||d.signature)if(!l)l={id:`thinking_${d.index}`,text:d.thinking||void 0,encrypted:d.signature||void 0};else{if(d.thinking){let f=Array.isArray(l.text)?l.text.join(""):l.text??"";l.text=f+d.thinking}d.signature&&(l.encrypted&&Cxe.warn(this.ctx,"Multiple thinking blocks with signatures; keeping last"),l.id=`thinking_${d.index}`,l.encrypted=d.signature)}l&&l.tokens===void 0&&(l.tokens=Jle(l,this.modelId));let u={message:s,choiceIndex:0,requestId:{headerRequestId:this.requestId,deploymentId:"",serverExperiments:"",ghRequestId:this.ghRequestId},tokens:[],numTokens:0,blockFinished:!0,finishReason:e,telemetryData:this.telemetryData,usage:n,copilotEditsSessionHeader:this.copilotEditsSessionHeader,thinking:l,copilot_usage:o};return this.completedToolCalls.length>0&&(u.tool_calls=this.completedToolCalls.map(d=>({id:d.id,type:"function",function:{name:d.name,arguments:d.arguments},approxNumTokens:0}))),u}};var $Ye=class{constructor(){this.name="v1/messages";this.engineName=""}static{a(this,"MessagesEndpointStrategy")}buildRequestBody(e,r){let n=r.postOptions,o=n?.thinking_budget,s=n?.adaptive_thinking,c=n?.thinking_effort;return o_n({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,maxTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,thinkingBudget:o,adaptiveThinking:s,thinkingEffort:c,ctx:e})}processResponse(e,r,n,o,s){let c=r.headers.get(rq)||void 0;return{type:"success",chatCompletions:s_n(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>O3(r),"getProcessingTime")}}};p();p();p();p();var l_n=de(Io());var lr=class extends l_n.PromptElement{static{a(this,"CopilotPromptElement")}constructor(e){super(e)}async prepare(e,r,n){if(!this.prepareCopilot)return;let o=r?a_n(r):void 0,s=n?c_n(n):void 0;return await this.prepareCopilot(e,o,s)}render(e,r,n,o){let s=n?a_n(n):void 0,c=o?c_n(o):void 0;return this.renderCopilot(e,r,s,c)}};function a_n(t){return e=>{let r=e.text||"";if(t?.report&&r){let n={value:r};t.report(n)}}}a(a_n,"adaptProgressCallbackFromVSCode");function c_n(t){return{get isCancellationRequested(){return t?.isCancellationRequested??!1},onCancellationRequested:a((e,r)=>{let n=t?.onCancellationRequested(e,r);return{dispose:a(()=>{n?.dispose()},"dispose")}},"onCancellationRequested")}}a(c_n,"adaptCancellationTokenFromVSCode");var u_n="phase_data",VYe=class extends lr{static{a(this,"PhaseDataContainer")}renderCopilot(){let{phase:e}=this.props;return vscpp("opaque",{value:{type:u_n,phase:e}})}};function WYe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===u_n&&typeof r.phase=="string")return r.phase}a(WYe,"rawPartAsPhaseData");p();var d_n="thinking",oue=class extends lr{static{a(this,"ThinkingDataContainer")}renderCopilot(){let{thinking:e}=this.props;return vscpp("opaque",{value:{type:d_n,thinking:e},tokenUsage:e.tokens??0})}};function zYe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===d_n&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(zYe,"rawPartAsThinkingData");var WS=de(Io());function _Qo(t){let e=[];for(let r of t)switch(r.role){case"system":{let n=f_n(r);e.push({role:"system",content:n});break}case"user":{let n=f_n(r);e.push({role:"user",content:n});break}case"assistant":{if(r.thinking&&r.thinking.id&&r.thinking.encrypted){let o={type:"reasoning",id:r.thinking.id,summary:[],encrypted_content:r.thinking.encrypted};e.push(o)}let n=CQo(r);if(n.length>0){let o={type:"message",role:"assistant",id:"msg_123",status:"completed",content:n,...r.phase?{phase:r.phase}:{}};e.push(o)}if(r.tool_calls)for(let o of r.tool_calls)o.id&&e.push({type:"function_call",call_id:o.id,name:o.function.name,arguments:typeof o.function.arguments=="string"?o.function.arguments:JSON.stringify(o.function.arguments)});break}case"tool":{if(r.tool_call_id){let n=typeof r.content=="string"?r.content:Array.isArray(r.content)?r.content.map(o=>o.type==="text"?o.text:"").join(""):"";e.push({type:"function_call_output",call_id:r.tool_call_id,output:n})}break}}return e}a(_Qo,"convertToResponsesApiInput");function vQo(t){let e=[];for(let r of t)switch(r.role){case WS.Raw.ChatRole.Assistant:if(r.content&&r.content.length>0){let n=bQo(r.content);e.push(...n)}if(r.content&&r.content.length>0){let n=[];for(let o of r.content)o.type===WS.Raw.ChatCompletionContentPartKind.Text&&o.text.trim()&&n.push({type:"output_text",text:o.text,annotations:[]});if(n.length>0){let o=SQo(r.content),s={type:"message",role:"assistant",id:"msg_123",status:"completed",content:n,...o?{phase:o}:{}};e.push(s)}}if(r.toolCalls)for(let n of r.toolCalls)e.push({type:"function_call",name:n.function.name,arguments:n.function.arguments,call_id:n.id});break;case WS.Raw.ChatRole.Tool:if(r.toolCallId&&r.content){let n=r.content.filter(s=>s.type===WS.Raw.ChatCompletionContentPartKind.Text).map(s=>s.text).join("");n&&e.push({type:"function_call_output",call_id:r.toolCallId,output:n});let o=r.content.filter(s=>s.type===WS.Raw.ChatCompletionContentPartKind.Image).map(s=>({type:"input_image",image_url:s.imageUrl.url,detail:s.imageUrl.detail||"auto"}));o.length&&e.push({role:"user",content:[{type:"input_text",text:"Image associated with the above tool call:"},...o]})}break;case WS.Raw.ChatRole.User:if(r.content){let n=[];for(let o of r.content)o.type===WS.Raw.ChatCompletionContentPartKind.Text?n.push({type:"input_text",text:o.text}):o.type===WS.Raw.ChatCompletionContentPartKind.Image&&n.push({type:"input_image",image_url:o.imageUrl.url,detail:o.imageUrl.detail||"auto"});n.length>0&&e.push({role:"user",content:n})}break;case WS.Raw.ChatRole.System:if(r.content){let n=[];for(let o of r.content)o.type===WS.Raw.ChatCompletionContentPartKind.Text&&n.push({type:"input_text",text:o.text});n.length>0&&e.push({role:"system",content:n})}break}return{input:e}}a(vQo,"convertRawMessagesToResponsesApiInput");function f_n(t){return typeof t.content=="string"?[{type:"input_text",text:t.content.trim()}]:Array.isArray(t.content)?t.content.map(e=>e.type==="text"?{type:"input_text",text:e.text.trim()}:e.type==="image_url"?{type:"input_image",image_url:e.image_url.url,detail:e.image_url.detail||"auto"}:{type:"input_text",text:""}):[{type:"input_text",text:""}]}a(f_n,"convertMessageContentToInputParts");function CQo(t){if(typeof t.content=="string")return t.content.trim()?[{type:"output_text",text:t.content,annotations:[]}]:[];if(Array.isArray(t.content)){let e=[];for(let r of t.content)r.type==="text"&&r.text.trim()&&e.push({type:"output_text",text:r.text,annotations:[]});return e}return[]}a(CQo,"convertMessageContentToOutputParts");function bQo(t){let e=[];for(let r of t)if(r.type===WS.Raw.ChatCompletionContentPartKind.Opaque){let n=zYe(r);n&&n.id&&n.encrypted&&e.push({type:"reasoning",id:n.id,summary:[],encrypted_content:n.encrypted})}return e}a(bQo,"extractReasoningFromRawMessage");function SQo(t){for(let e of t)if(e.type===WS.Raw.ChatCompletionContentPartKind.Opaque){let r=WYe(e);if(r)return r}}a(SQo,"extractPhaseFromRawMessage");function p_n(t){let{messages:e,promptTsxRawMessages:r,model:n,tools:o,toolChoice:s,maxOutputTokens:c,enableThinking:l}=t,u;r&&r.length>0?u=vQo(r).input:u=_Qo(e);let d={model:n,input:u};return o&&o.length>0&&(d.tools=o.map(f=>({...f.function,type:"function",strict:!1,parameters:f.function.parameters||{}}))),s&&(typeof s=="object"&&"function"in s?d.tool_choice={type:"function",name:s.function.name}:d.tool_choice=s),c!==void 0&&(d.max_output_tokens=c),d.stream=!0,d.store=!1,d.truncation="disabled",l&&(d.reasoning={effort:t.reasoningEffort??"medium",summary:"detailed"},d.include=["reasoning.encrypted_content"]),d}a(p_n,"buildResponsesApiRequest");p();var rQt=new fe("responsesApiStream"),TQo=10,YYe=500,OK=class extends Error{static{a(this,"MidStreamError")}constructor(e){super(e),this.name="MidStreamError"}};function h_n(t,e,r){if(!t)return{};try{return JSON.parse(t)}catch(n){throw new Error(`Failed to parse JSON for ${e} '${r}': ${Xu(n)}. Input: '${t}'`)}}a(h_n,"parseCallArguments");async function*m_n(t,e,r,n,o,s,c){let l=e.body(),u=e.headers.get("X-Request-ID")||e.headers.get("x-request-id")||"unknown",d=e.headers.get("x-github-request-id")||"",f=new nQt(n,u,o,d,c),h=[],m,g=!1,A=[];try{let y=new iue(E=>{try{let _={type:E.type,...JSON.parse(E.data)},v=f.push(_,r);v&&h.push(v)}catch(_){m=_}},(E,_)=>{if(A.length>=TQo)return;let v=E.trim(),b=_?.trim(),T=v&&b?`${v}: ${b}`:v||b||"";T.length>0&&A.push(T.length>YYe?T.substring(0,YYe):T)});for await(let E of l){if(s?.isCancellationRequested)break;for(y.feed(new Uint8Array(E));h.length>0;)g=!0,yield h.shift();if(m)throw m}for(;h.length>0;)g=!0,yield h.shift();if(!g&&!s?.isCancellationRequested){let E=f.hasReceivedContentEvents();if(A.length>0){let _=A.join("; ");throw _.length>YYe&&(_=_.substring(0,YYe)+"\u2026"),rQt.error(t,`Non-SSE text received in stream for request ${u}: ${_}`),E?new OK(`The server disconnected unexpectedly while generating a response (${_}). The partial response above may be incomplete.`):new OK(`The server returned an error: ${_}`)}else if(E)throw rQt.error(t,`Stream ended without response.completed for request ${u} after receiving partial content`),new OK("The server disconnected unexpectedly while generating a response. The partial response above may be incomplete.")}}finally{try{l.destroy()}catch(y){rQt.exception(t,y,`Error destroying stream for Responses API request ${u}`)}}}a(m_n,"processResponsesApiStream");var nQt=class{constructor(e,r,n,o,s){this.telemetryData=e;this.requestId=r;this.copilotEditsSessionHeader=n;this.modelId=s;this.textAccumulator="";this.hasReceivedReasoningSummary=!1;this.thinking={id:"",text:[]};this.eventCount=0}static{a(this,"OpenAIResponsesProcessor")}hasReceivedContentEvents(){return this.eventCount>0}push(e,r){let n=a(o=>{this.textAccumulator+=o.text,r(this.textAccumulator,o)},"onProgress");switch(e.type){case"error":n({text:"",copilotErrors:[{code:e.code||"unknown",message:e.message,type:"error",identifier:e.param||""}]});return;case"response.output_text.delta":this.eventCount++,n({text:e.delta});return;case"response.output_item.added":this.eventCount++,e.item.type==="function_call"&&n({text:"",beginToolCalls:[{name:e.item.name}]});return;case"response.output_item.done":return this.handleOutputItemDone(e.item,n);case"response.reasoning_summary_text.delta":this.eventCount++,this.hasReceivedReasoningSummary=!0,e.delta&&Array.isArray(this.thinking.text)&&this.thinking.text.push(e.delta),n({text:"",thinking:{id:e.item_id,text:e.delta}});return;case"response.reasoning_summary_part.done":this.hasReceivedReasoningSummary=!0,Array.isArray(this.thinking.text)&&this.thinking.text.push(` +`)&&(this.dataBuffer=this.dataBuffer.substring(0,this.dataBuffer.length-1));let e={type:this.eventTypeBuffer||"message",data:this.dataBuffer};this.currentEventId!==void 0&&(e.id=this.currentEventId),this.reconnectionTime!==void 0&&(e.retry=this.reconnectionTime),this.onEventHandler(e),this.reset()}reset(){this.dataBuffer="",this.eventTypeBuffer="",this.currentEventId=void 0}};var jxe=new pe("messagesApiStream");async function*Lvn(t,e,r,n,o,s,c){let l=e.body(),u=e.headers.get("X-Request-ID")||e.headers.get("x-request-id")||"unknown",d=e.headers.get("x-github-request-id")||"",f=new WQt(t,n,u,d,o,c),h=[],m;try{let g=new hue(A=>{try{if(A.data==="[DONE]")return;let y;try{y={type:A.type,...JSON.parse(A.data)}}catch(_){jxe.warn(t,`Skipping malformed SSE event: ${String(_.message).substring(0,100)}`);return}let E=f.push(y,r);E&&h.push(E)}catch(y){m=y}});for await(let A of l){if(s?.isCancellationRequested)break;for(g.feed(new Uint8Array(A));h.length>0;)yield h.shift();if(m)throw m}for(;h.length>0;)yield h.shift()}finally{try{l.destroy()}catch(g){jxe.exception(t,g,`Error destroying stream for Messages API request ${u}`)}}}a(Lvn,"processMessagesApiStream");var WQt=class{constructor(e,r,n,o,s,c){this.ctx=e;this.telemetryData=r;this.requestId=n;this.ghRequestId=o;this.copilotEditsSessionHeader=s;this.modelId=c;this.textAccumulator="";this.toolCallAccumulator=new Map;this.thinkingAccumulator=new Map;this.completedToolCalls=[];this.completedThinking=[];this.inputTokens=0;this.outputTokens=0;this.cacheCreationTokens=0;this.cacheReadTokens=0;this.hasError=!1}static{a(this,"AnthropicMessagesProcessor")}push(e,r){if(this.hasError)return;let n=a((o,s)=>{this.textAccumulator+=o,r(this.textAccumulator,{text:this.textAccumulator,...s})},"onProgress");switch(e.type){case"message_start":e.message&&(this.inputTokens=e.message.usage.input_tokens??0,this.outputTokens=e.message.usage.output_tokens??0,this.cacheCreationTokens=e.message.usage.cache_creation_input_tokens??0,this.cacheReadTokens=e.message.usage.cache_read_input_tokens??0);return;case"content_block_start":e.content_block?.type==="tool_use"&&e.index!==void 0?this.toolCallAccumulator.set(e.index,{id:e.content_block.id||"",name:e.content_block.name||"",arguments:""}):e.content_block?.type==="thinking"&&e.index!==void 0?this.thinkingAccumulator.set(e.index,{thinking:"",signature:""}):e.content_block?.type==="redacted_thinking"&&e.index!==void 0&&e.content_block.data&&(n("",{thinking:{id:`redacted_thinking_${e.index}`,encrypted:e.content_block.data}}),this.completedThinking.push({index:e.index,thinking:"",signature:e.content_block.data}));return;case"content_block_delta":if(e.delta){if(e.delta.type==="text_delta"&&e.delta.text)n(e.delta.text,{});else if(e.delta.type==="thinking_delta"&&e.delta.thinking&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.thinking+=e.delta.thinking),n("",{thinking:{id:`thinking_${e.index}`,text:e.delta.thinking}})}else if(e.delta.type==="signature_delta"&&e.delta.signature&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.signature+=e.delta.signature)}else if(e.delta.type==="input_json_delta"&&e.delta.partial_json&&e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(o.arguments+=e.delta.partial_json)}}return;case"content_block_stop":if(e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(this.completedToolCalls.push(o),this.toolCallAccumulator.delete(e.index));let s=this.thinkingAccumulator.get(e.index);s&&(s.signature?n("",{thinking:{id:`thinking_${e.index}`,encrypted:s.signature}}):jxe.warn(this.ctx,`Thinking block ${e.index} finalized without signature (incomplete stream?)`),this.completedThinking.push({index:e.index,...s}),this.thinkingAccumulator.delete(e.index))}return;case"message_delta":e.usage&&(this.outputTokens=e.usage.output_tokens,this.inputTokens=e.usage.input_tokens??this.inputTokens,this.cacheCreationTokens=e.usage.cache_creation_input_tokens??this.cacheCreationTokens,this.cacheReadTokens=e.usage.cache_read_input_tokens??this.cacheReadTokens),e.delta?.stop_reason&&(this.stopReason=e.delta.stop_reason),e.copilot_usage&&(this.copilotUsage=e.copilot_usage);return;case"message_stop":return this.buildFinalCompletion();case"error":{let o=e.error,s=o?.message||"Unknown error",c=o?.type||"unknown";return jxe.warn(this.ctx,`Messages API error (${c}): ${s}`),n("",{copilotErrors:[{type:"error",code:c,message:s,identifier:""}]}),this.stopReason="error",this.hasError=!0,this.buildFinalCompletion()}}}buildFinalCompletion(){let e;switch(this.stopReason){case"max_tokens":case"model_context_window_exceeded":e="length";break;case"tool_use":e="tool_calls";break;case"refusal":e="content_filter";break;default:e="stop";break}let r=this.inputTokens+this.cacheCreationTokens+this.cacheReadTokens,n={prompt_tokens:r,completion_tokens:this.outputTokens,total_tokens:r+this.outputTokens,prompt_tokens_details:{cached_tokens:this.cacheReadTokens}},o=this.copilotUsage,s={role:"assistant",content:this.textAccumulator},c=[...this.completedThinking.map(d=>({index:d.index,thinking:d.thinking,signature:d.signature})),...[...this.thinkingAccumulator.entries()].map(([d,f])=>({index:d,...f}))],l;for(let d of c)if(d.thinking||d.signature)if(!l)l={id:`thinking_${d.index}`,text:d.thinking||void 0,encrypted:d.signature||void 0};else{if(d.thinking){let f=Array.isArray(l.text)?l.text.join(""):l.text??"";l.text=f+d.thinking}d.signature&&(l.encrypted&&jxe.warn(this.ctx,"Multiple thinking blocks with signatures; keeping last"),l.id=`thinking_${d.index}`,l.encrypted=d.signature)}l&&l.tokens===void 0&&(l.tokens=aue(l,this.modelId));let u={message:s,choiceIndex:0,requestId:{headerRequestId:this.requestId,deploymentId:"",serverExperiments:"",ghRequestId:this.ghRequestId},tokens:[],numTokens:0,blockFinished:!0,finishReason:e,telemetryData:this.telemetryData,usage:n,copilotEditsSessionHeader:this.copilotEditsSessionHeader,thinking:l,copilot_usage:o};return this.completedToolCalls.length>0&&(u.tool_calls=this.completedToolCalls.map(d=>({id:d.id,type:"function",function:{name:d.name,arguments:d.arguments},approxNumTokens:0}))),u}};var EKe=class{constructor(){this.name="v1/messages";this.engineName=""}static{a(this,"MessagesEndpointStrategy")}buildRequestBody(e,r){let n=r.postOptions,o=n?.thinking_budget,s=n?.adaptive_thinking,c=n?.thinking_effort;return Ovn({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,maxTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,thinkingBudget:o,adaptiveThinking:s,thinkingEffort:c,ctx:e})}processResponse(e,r,n,o,s){let c=r.headers.get(mq)||void 0;return{type:"success",chatCompletions:Lvn(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>H3(r),"getProcessingTime")}}};p();p();p();p();var Uvn=fe(Io());var lr=class extends Uvn.PromptElement{static{a(this,"CopilotPromptElement")}constructor(e){super(e)}async prepare(e,r,n){if(!this.prepareCopilot)return;let o=r?Bvn(r):void 0,s=n?Fvn(n):void 0;return await this.prepareCopilot(e,o,s)}render(e,r,n,o){let s=n?Bvn(n):void 0,c=o?Fvn(o):void 0;return this.renderCopilot(e,r,s,c)}};function Bvn(t){return e=>{let r=e.text||"";if(t?.report&&r){let n={value:r};t.report(n)}}}a(Bvn,"adaptProgressCallbackFromVSCode");function Fvn(t){return{get isCancellationRequested(){return t?.isCancellationRequested??!1},onCancellationRequested:a((e,r)=>{let n=t?.onCancellationRequested(e,r);return{dispose:a(()=>{n?.dispose()},"dispose")}},"onCancellationRequested")}}a(Fvn,"adaptCancellationTokenFromVSCode");var Qvn="phase_data",_Ke=class extends lr{static{a(this,"PhaseDataContainer")}renderCopilot(){let{phase:e}=this.props;return vscpp("opaque",{value:{type:Qvn,phase:e}})}};function vKe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===Qvn&&typeof r.phase=="string")return r.phase}a(vKe,"rawPartAsPhaseData");p();var qvn="thinking",mue=class extends lr{static{a(this,"ThinkingDataContainer")}renderCopilot(){let{thinking:e}=this.props;return vscpp("opaque",{value:{type:qvn,thinking:e},tokenUsage:e.tokens??0})}};function CKe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===qvn&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(CKe,"rawPartAsThinkingData");var eT=fe(Io());function Tjo(t){let e=[];for(let r of t)switch(r.role){case"system":{let n=jvn(r);e.push({role:"system",content:n});break}case"user":{let n=jvn(r);e.push({role:"user",content:n});break}case"assistant":{if(r.thinking&&r.thinking.id&&r.thinking.encrypted){let o={type:"reasoning",id:r.thinking.id,summary:[],encrypted_content:r.thinking.encrypted};e.push(o)}let n=xjo(r);if(n.length>0){let o={type:"message",role:"assistant",id:"msg_123",status:"completed",content:n,...r.phase?{phase:r.phase}:{}};e.push(o)}if(r.tool_calls)for(let o of r.tool_calls)o.id&&e.push({type:"function_call",call_id:o.id,name:o.function.name,arguments:typeof o.function.arguments=="string"?o.function.arguments:JSON.stringify(o.function.arguments)});break}case"tool":{if(r.tool_call_id){let n=typeof r.content=="string"?r.content:Array.isArray(r.content)?r.content.map(o=>o.type==="text"?o.text:"").join(""):"";e.push({type:"function_call_output",call_id:r.tool_call_id,output:n})}break}}return e}a(Tjo,"convertToResponsesApiInput");function Ijo(t){let e=[];for(let r of t)switch(r.role){case eT.Raw.ChatRole.Assistant:if(r.content&&r.content.length>0){let n=wjo(r.content);e.push(...n)}if(r.content&&r.content.length>0){let n=[];for(let o of r.content)o.type===eT.Raw.ChatCompletionContentPartKind.Text&&o.text.trim()&&n.push({type:"output_text",text:o.text,annotations:[]});if(n.length>0){let o=Rjo(r.content),s={type:"message",role:"assistant",id:"msg_123",status:"completed",content:n,...o?{phase:o}:{}};e.push(s)}}if(r.toolCalls)for(let n of r.toolCalls)e.push({type:"function_call",name:n.function.name,arguments:n.function.arguments,call_id:n.id});break;case eT.Raw.ChatRole.Tool:if(r.toolCallId&&r.content){let n=r.content.filter(s=>s.type===eT.Raw.ChatCompletionContentPartKind.Text).map(s=>s.text).join("");n&&e.push({type:"function_call_output",call_id:r.toolCallId,output:n});let o=r.content.filter(s=>s.type===eT.Raw.ChatCompletionContentPartKind.Image).map(s=>({type:"input_image",image_url:s.imageUrl.url,detail:s.imageUrl.detail||"auto"}));o.length&&e.push({role:"user",content:[{type:"input_text",text:"Image associated with the above tool call:"},...o]})}break;case eT.Raw.ChatRole.User:if(r.content){let n=[];for(let o of r.content)o.type===eT.Raw.ChatCompletionContentPartKind.Text?n.push({type:"input_text",text:o.text}):o.type===eT.Raw.ChatCompletionContentPartKind.Image&&n.push({type:"input_image",image_url:o.imageUrl.url,detail:o.imageUrl.detail||"auto"});n.length>0&&e.push({role:"user",content:n})}break;case eT.Raw.ChatRole.System:if(r.content){let n=[];for(let o of r.content)o.type===eT.Raw.ChatCompletionContentPartKind.Text&&n.push({type:"input_text",text:o.text});n.length>0&&e.push({role:"system",content:n})}break}return{input:e}}a(Ijo,"convertRawMessagesToResponsesApiInput");function jvn(t){return typeof t.content=="string"?[{type:"input_text",text:t.content.trim()}]:Array.isArray(t.content)?t.content.map(e=>e.type==="text"?{type:"input_text",text:e.text.trim()}:e.type==="image_url"?{type:"input_image",image_url:e.image_url.url,detail:e.image_url.detail||"auto"}:{type:"input_text",text:""}):[{type:"input_text",text:""}]}a(jvn,"convertMessageContentToInputParts");function xjo(t){if(typeof t.content=="string")return t.content.trim()?[{type:"output_text",text:t.content,annotations:[]}]:[];if(Array.isArray(t.content)){let e=[];for(let r of t.content)r.type==="text"&&r.text.trim()&&e.push({type:"output_text",text:r.text,annotations:[]});return e}return[]}a(xjo,"convertMessageContentToOutputParts");function wjo(t){let e=[];for(let r of t)if(r.type===eT.Raw.ChatCompletionContentPartKind.Opaque){let n=CKe(r);n&&n.id&&n.encrypted&&e.push({type:"reasoning",id:n.id,summary:[],encrypted_content:n.encrypted})}return e}a(wjo,"extractReasoningFromRawMessage");function Rjo(t){for(let e of t)if(e.type===eT.Raw.ChatCompletionContentPartKind.Opaque){let r=vKe(e);if(r)return r}}a(Rjo,"extractPhaseFromRawMessage");function Hvn(t){let{messages:e,promptTsxRawMessages:r,model:n,tools:o,toolChoice:s,maxOutputTokens:c,enableThinking:l}=t,u;r&&r.length>0?u=Ijo(r).input:u=Tjo(e);let d={model:n,input:u};return o&&o.length>0&&(d.tools=o.map(f=>({...f.function,type:"function",strict:!1,parameters:f.function.parameters||{}}))),s&&(typeof s=="object"&&"function"in s?d.tool_choice={type:"function",name:s.function.name}:d.tool_choice=s),c!==void 0&&(d.max_output_tokens=c),d.stream=!0,d.store=!1,d.truncation="disabled",l&&(d.reasoning={effort:t.reasoningEffort??"medium",summary:"detailed"},d.include=["reasoning.encrypted_content"]),d}a(Hvn,"buildResponsesApiRequest");p();var zQt=new pe("responsesApiStream"),kjo=10,bKe=500,$K=class extends Error{static{a(this,"MidStreamError")}constructor(e){super(e),this.name="MidStreamError"}};function Gvn(t,e,r){if(!t)return{};try{return JSON.parse(t)}catch(n){throw new Error(`Failed to parse JSON for ${e} '${r}': ${rd(n)}. Input: '${t}'`)}}a(Gvn,"parseCallArguments");async function*$vn(t,e,r,n,o,s,c){let l=e.body(),u=e.headers.get("X-Request-ID")||e.headers.get("x-request-id")||"unknown",d=e.headers.get("x-github-request-id")||"",f=new YQt(n,u,o,d,c),h=[],m,g=!1,A=[];try{let y=new hue(E=>{try{let _={type:E.type,...JSON.parse(E.data)},v=f.push(_,r);v&&h.push(v)}catch(_){m=_}},(E,_)=>{if(A.length>=kjo)return;let v=E.trim(),b=_?.trim(),T=v&&b?`${v}: ${b}`:v||b||"";T.length>0&&A.push(T.length>bKe?T.substring(0,bKe):T)});for await(let E of l){if(s?.isCancellationRequested)break;for(y.feed(new Uint8Array(E));h.length>0;)g=!0,yield h.shift();if(m)throw m}for(;h.length>0;)g=!0,yield h.shift();if(!g&&!s?.isCancellationRequested){let E=f.hasReceivedContentEvents();if(A.length>0){let _=A.join("; ");throw _.length>bKe&&(_=_.substring(0,bKe)+"\u2026"),zQt.error(t,`Non-SSE text received in stream for request ${u}: ${_}`),E?new $K(`The server disconnected unexpectedly while generating a response (${_}). The partial response above may be incomplete.`):new $K(`The server returned an error: ${_}`)}else if(E)throw zQt.error(t,`Stream ended without response.completed for request ${u} after receiving partial content`),new $K("The server disconnected unexpectedly while generating a response. The partial response above may be incomplete.")}}finally{try{l.destroy()}catch(y){zQt.exception(t,y,`Error destroying stream for Responses API request ${u}`)}}}a($vn,"processResponsesApiStream");var YQt=class{constructor(e,r,n,o,s){this.telemetryData=e;this.requestId=r;this.copilotEditsSessionHeader=n;this.modelId=s;this.textAccumulator="";this.hasReceivedReasoningSummary=!1;this.thinking={id:"",text:[]};this.eventCount=0}static{a(this,"OpenAIResponsesProcessor")}hasReceivedContentEvents(){return this.eventCount>0}push(e,r){let n=a(o=>{this.textAccumulator+=o.text,r(this.textAccumulator,o)},"onProgress");switch(e.type){case"error":n({text:"",copilotErrors:[{code:e.code||"unknown",message:e.message,type:"error",identifier:e.param||""}]});return;case"response.output_text.delta":this.eventCount++,n({text:e.delta});return;case"response.output_item.added":this.eventCount++,e.item.type==="function_call"&&n({text:"",beginToolCalls:[{name:e.item.name}]});return;case"response.output_item.done":return this.handleOutputItemDone(e.item,n);case"response.reasoning_summary_text.delta":this.eventCount++,this.hasReceivedReasoningSummary=!0,e.delta&&Array.isArray(this.thinking.text)&&this.thinking.text.push(e.delta),n({text:"",thinking:{id:e.item_id,text:e.delta}});return;case"response.reasoning_summary_part.done":this.hasReceivedReasoningSummary=!0,Array.isArray(this.thinking.text)&&this.thinking.text.push(` `),n({text:"",thinking:{id:e.item_id,text:` -`}});return;case"response.completed":return this.handleCompletedResponse(e,n);default:return}}handleOutputItemDone(e,r){if(this.eventCount++,e.type==="function_call"){let n=h_n(e.arguments,"tool call",e.name);r({text:"",toolCalls:[{id:e.call_id,type:"function",function:{name:e.name,arguments:n},approxNumTokens:0}],phase:e.phase})}else if(e.type==="reasoning")e.id&&(this.thinking.id=e.id),e.encrypted_content&&(this.thinking.encrypted=e.encrypted_content),r({text:"",thinking:e.encrypted_content?{id:e.id,text:this.hasReceivedReasoningSummary?void 0:e.summary.map(n=>n.text),encrypted:e.encrypted_content}:void 0});else if(e.type==="message"){let n=e.phase;n&&r({text:"",phase:n})}}handleCompletedResponse(e,r){r({text:"",statefulMarker:e.response.id});let n=[],o=[];for(let f of e.response.output)if(f.type==="message"){if(f.content)for(let h of f.content)h.type==="output_text"&&h.text?n.push(h.text):h.type==="refusal"&&h.refusal&&n.push(h.refusal)}else if(f.type==="function_call"){let h=h_n(f.arguments,"tool call",f.name);o.push({id:f.call_id,type:"function",function:{name:f.name,arguments:h},approxNumTokens:0})}let s={role:"assistant",content:n.join("")},c={prompt_tokens:e.response.usage?.input_tokens??0,completion_tokens:e.response.usage?.output_tokens??0,total_tokens:e.response.usage?.total_tokens??0,prompt_tokens_details:{cached_tokens:e.response.usage?.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.response.usage?.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0}},l={headerRequestId:this.requestId,serverExperiments:"",deploymentId:""},u=this.thinking.id?this.thinking:void 0;u&&u.tokens===void 0&&(u.tokens=Jle(u,this.modelId));let d=e.copilot_usage;return{message:s,choiceIndex:0,requestId:l,tokens:[],numTokens:c.completion_tokens,blockFinished:!0,finishReason:o.length>0?"tool_calls":"stop",telemetryData:this.telemetryData,tool_calls:o.length>0?o:void 0,thinking:u,copilotEditsSessionHeader:this.copilotEditsSessionHeader,usage:c,copilot_usage:d}}};var KYe=class{constructor(){this.name="responses";this.engineName=""}static{a(this,"ResponsesEndpointStrategy")}buildRequestBody(e,r){return p_n({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,toolChoice:r.tool_choice,topP:r.topP??Kle(e),maxOutputTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,store:!1,enableThinking:r.enableThinking,reasoningEffort:mO(r.modelConfiguration?.reasoningEfforts,r.modelConfiguration?.userSelectedReasoningEffort)})}processResponse(e,r,n,o,s){let c=r.headers.get(rq)||void 0;return{type:"success",chatCompletions:m_n(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>O3(r),"getProcessingTime")}}};BP.register(new KYe);BP.register(new pYe);BP.register(new $Ye);p();var JYe=require("fs"),zS=de(require("path"));function eKe(t){return Zae(()=>!!Ft(t,Ye.PromptPersistBasePath)?.trim(),!1)}a(eKe,"isPromptPersistEnabled");var IQo={mkdir:a((t,e)=>JYe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>JYe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>JYe.promises.appendFile(t,e,r),"appendFile")},jP,ZYe,sQt,iQt=new Map,g_n=0,oQt=new Map,aQt=new Map;function cQt(t){return t.toISOString().slice(0,19).replace(/-/g,"").replace(/:/g,"")}a(cQt,"formatHumanTimestamp");function lQt(t,e){return ZYe||(ZYe=xQo(t,e)),ZYe}a(lQt,"getSharedProcessRoot");async function xQo(t,e){let r=cQt(new Date);jP=zS.join(t,`pid-${process.pid}_${r}`),await e.mkdir(jP,{recursive:!0});let n=new Date().toISOString();sQt=n;let o={createdAt:n,updatedAt:n,pid:process.pid,processRoot:jP};return await e.writeFile(zS.join(jP,"session.json"),JSON.stringify(o,null,2),"utf8").catch(()=>{}),await RQo(jP,e).catch(()=>{}),await kQo(jP,e).catch(()=>{}),jP}a(xQo,"initProcessRoot");async function wQo(t){if(jP)try{let e=zS.join(jP,"session.json"),r=new Date().toISOString(),n={createdAt:sQt??r,updatedAt:r,pid:process.pid,processRoot:jP};await t.writeFile(e,JSON.stringify(n,null,2),"utf8")}catch{}}a(wQo,"touchProcessRootSessionJson");function uQt(t){return aQt.get(t)}a(uQt,"getTurnDir");function A_n(){jP=void 0,ZYe=void 0,sQt=void 0,iQt.clear(),g_n=0,oQt.clear(),aQt.clear()}a(A_n,"resetSharedProcessRoot");async function RQo(t,e){await e.writeFile(zS.join(t,"README.md"),`# Copilot Language Server \u2014 Request Logs +`}});return;case"response.completed":return this.handleCompletedResponse(e,n);default:return}}handleOutputItemDone(e,r){if(this.eventCount++,e.type==="function_call"){let n=Gvn(e.arguments,"tool call",e.name);r({text:"",toolCalls:[{id:e.call_id,type:"function",function:{name:e.name,arguments:n},approxNumTokens:0}],phase:e.phase})}else if(e.type==="reasoning")e.id&&(this.thinking.id=e.id),e.encrypted_content&&(this.thinking.encrypted=e.encrypted_content),r({text:"",thinking:e.encrypted_content?{id:e.id,text:this.hasReceivedReasoningSummary?void 0:e.summary.map(n=>n.text),encrypted:e.encrypted_content}:void 0});else if(e.type==="message"){let n=e.phase;n&&r({text:"",phase:n})}}handleCompletedResponse(e,r){r({text:"",statefulMarker:e.response.id});let n=[],o=[];for(let f of e.response.output)if(f.type==="message"){if(f.content)for(let h of f.content)h.type==="output_text"&&h.text?n.push(h.text):h.type==="refusal"&&h.refusal&&n.push(h.refusal)}else if(f.type==="function_call"){let h=Gvn(f.arguments,"tool call",f.name);o.push({id:f.call_id,type:"function",function:{name:f.name,arguments:h},approxNumTokens:0})}let s={role:"assistant",content:n.join("")},c={prompt_tokens:e.response.usage?.input_tokens??0,completion_tokens:e.response.usage?.output_tokens??0,total_tokens:e.response.usage?.total_tokens??0,prompt_tokens_details:{cached_tokens:e.response.usage?.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.response.usage?.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0}},l={headerRequestId:this.requestId,serverExperiments:"",deploymentId:""},u=this.thinking.id?this.thinking:void 0;u&&u.tokens===void 0&&(u.tokens=aue(u,this.modelId));let d=e.copilot_usage;return{message:s,choiceIndex:0,requestId:l,tokens:[],numTokens:c.completion_tokens,blockFinished:!0,finishReason:o.length>0?"tool_calls":"stop",telemetryData:this.telemetryData,tool_calls:o.length>0?o:void 0,thinking:u,copilotEditsSessionHeader:this.copilotEditsSessionHeader,usage:c,copilot_usage:d}}};var SKe=class{constructor(){this.name="responses";this.engineName=""}static{a(this,"ResponsesEndpointStrategy")}buildRequestBody(e,r){return Hvn({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,toolChoice:r.tool_choice,topP:r.topP??sue(e),maxOutputTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,store:!1,enableThinking:r.enableThinking,reasoningEffort:vO(r.modelConfiguration?.reasoningEfforts,r.modelConfiguration?.userSelectedReasoningEffort)})}processResponse(e,r,n,o,s){let c=r.headers.get(mq)||void 0;return{type:"success",chatCompletions:$vn(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>H3(r),"getProcessingTime")}}};VP.register(new SKe);VP.register(new qYe);VP.register(new EKe);p();var TKe=require("fs"),tT=fe(require("path"));function wKe(t){return kle(()=>!!Rt(t,ze.PromptPersistBasePath)?.trim(),!1)}a(wKe,"isPromptPersistEnabled");var Pjo={mkdir:a((t,e)=>TKe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>TKe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>TKe.promises.appendFile(t,e,r),"appendFile")},JP,IKe,ZQt,KQt=new Map,Vvn=0,JQt=new Map,XQt=new Map;function eqt(t){return t.toISOString().slice(0,19).replace(/-/g,"").replace(/:/g,"")}a(eqt,"formatHumanTimestamp");function tqt(t,e){return IKe||(IKe=Djo(t,e)),IKe}a(tqt,"getSharedProcessRoot");async function Djo(t,e){let r=eqt(new Date);JP=tT.join(t,`pid-${process.pid}_${r}`),await e.mkdir(JP,{recursive:!0});let n=new Date().toISOString();ZQt=n;let o={createdAt:n,updatedAt:n,pid:process.pid,processRoot:JP};return await e.writeFile(tT.join(JP,"session.json"),JSON.stringify(o,null,2),"utf8").catch(()=>{}),await Mjo(JP,e).catch(()=>{}),await Ojo(JP,e).catch(()=>{}),JP}a(Djo,"initProcessRoot");async function Njo(t){if(JP)try{let e=tT.join(JP,"session.json"),r=new Date().toISOString(),n={createdAt:ZQt??r,updatedAt:r,pid:process.pid,processRoot:JP};await t.writeFile(e,JSON.stringify(n,null,2),"utf8")}catch{}}a(Njo,"touchProcessRootSessionJson");function rqt(t){return XQt.get(t)}a(rqt,"getTurnDir");function Wvn(){JP=void 0,IKe=void 0,ZQt=void 0,KQt.clear(),Vvn=0,JQt.clear(),XQt.clear()}a(Wvn,"resetSharedProcessRoot");async function Mjo(t,e){await e.writeFile(tT.join(t,"README.md"),`# Copilot Language Server \u2014 Request Logs This directory contains persisted HTTP requests, LLM call logs, and tool-call trajectory data captured during a single CLS process. @@ -2508,7 +2508,7 @@ node generateHar.js http-log my-session.har \`\`\` Run from this directory, or pass absolute paths. -`,"utf8")}a(RQo,"writeReadme");async function kQo(t,e){await e.writeFile(zS.join(t,"generateHar.js"),`#!/usr/bin/env node +`,"utf8")}a(Mjo,"writeReadme");async function Ojo(t,e){await e.writeFile(tT.join(t,"generateHar.js"),`#!/usr/bin/env node "use strict"; /** * Converts per-request JSON files from an http-log directory into a single HAR @@ -2577,51 +2577,51 @@ async function main() { } main().catch(e => { console.error(e); process.exit(1); }); -`,"utf8")}a(kQo,"writeGenerateHarScript");var XYe=class{constructor(e,r,n,o,s,c,l,u){this.ctx=e;this.source=n;this.conversationId=o;this.turnId=s;this.parentConversationId=c;this.parentTurnId=l;this.subagentName=u;this.sequenceNumber=0;this.appendQueues=new Map;this.fileOps=r??IQo}static{a(this,"LLMRequestPersistence")}isEnabled(){return!!this.getBasePath()}async ensureInitialized(){if(this.isEnabled())try{await this.ensureSessionDir()}catch{}}getBasePath(){return Ft(this.ctx,Ye.PromptPersistBasePath)?.trim()||void 0}ensureSessionDir(){return this.sessionDirPromise||(this.sessionDirPromise=this.initSessionDir()),this.sessionDirPromise}async initSessionDir(){let e=this.getBasePath(),r=await lQt(e,this.fileOps);if(this.conversationId&&this.turnId){let n=this.conversationId.slice(0,8),o=this.turnId.slice(0,8),s=this.subagentName?this.subagentName.replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,50):void 0,c=s?`_subagent-${s}`:"",l=(iQt.get(this.conversationId)??0)+1;iQt.set(this.conversationId,l);let u=String(l).padStart(6,"0"),d=this.parentTurnId?uQt(this.parentTurnId):void 0;if(this.subagentName&&d)this.sessionDir=zS.join(d,"runSubAgent",n,`${u}_${o}${c}`);else{let f=oQt.get(this.conversationId);f||(f=String(++g_n).padStart(6,"0"),oQt.set(this.conversationId,f)),this.sessionDir=zS.join(r,"conversations",`${f}_${n}`,`${u}_${o}${c}`)}await this.fileOps.mkdir(this.sessionDir,{recursive:!0}),aQt.set(this.turnId,this.sessionDir),await this.writeTurnMetadata(),wQo(this.fileOps)}else this.sessionDir=r;return this.sessionDir}async writeTurnMetadata(){try{let e={createdAt:new Date().toISOString(),pid:process.pid,conversationId:this.conversationId,turnId:this.turnId,source:this.source,...this.parentConversationId?{parentConversationId:this.parentConversationId}:{},...this.parentTurnId?{parentTurnId:this.parentTurnId}:{},...this.subagentName?{subagentName:this.subagentName}:{}},r=zS.join(this.sessionDir,"turn.json");await this.fileOps.writeFile(r,JSON.stringify(e,null,2),"utf8")}catch{}}async persistLLMRequest(e){if(this.isEnabled())try{let r=await this.ensureSessionDir();this.sequenceNumber++;let n=e.conversationId??this.conversationId,o=e.turnId??this.turnId,s={requestId:e.requestId,sequenceNumber:this.sequenceNumber,timestamp:new Date().toISOString(),...n?{conversationId:n}:{},...o?{turnId:o}:{},messages:e.messages,tools:e.tools,model:e.model,response:e.response,durationMs:e.durationMs},c=zS.join(r,"fetchLog.jsonl"),l=JSON.stringify(s)+` -`;await this.serializedAppend(c,l)}catch(r){ot.debug(this.ctx,"Failed to persist LLM request",r)}}async appendTrajectoryStep(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=zS.join(r,"trajectory.jsonl"),o=JSON.stringify(e)+` -`;await this.serializedAppend(n,o)}catch(r){ot.debug(this.ctx,"Failed to append trajectory step",r)}}async appendSubagentLink(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=zS.join(r,"trajectory.jsonl"),o=JSON.stringify(e)+` -`;await this.serializedAppend(n,o)}catch(r){ot.debug(this.ctx,"Failed to append subagent link",r)}}async appendToolInOut(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=zS.join(r,"tool-in-out.jsonl"),o=JSON.stringify(e)+` -`;await this.serializedAppend(n,o)}catch(r){ot.debug(this.ctx,"Failed to append tool-in-out entry",r)}}serializedAppend(e,r){let o=(this.appendQueues.get(e)??Promise.resolve()).then(()=>this.fileOps.appendFile(e,r,"utf8"));return this.appendQueues.set(e,o.catch(()=>{})),o}};p();var rKe=require("fs"),bO=de(require("path"));var y_n=require("stream");var PQo={mkdir:a((t,e)=>rKe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>rKe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>rKe.promises.appendFile(t,e,r),"appendFile")},tKe,nKe=class t{constructor(e,r){this.ctx=e;this.fileOps=r??PQo,this.basePath=this.getBasePath(),this.isEnabled=!!this.basePath}static{a(this,"DebugRequestLogger")}static{this.sequence=0}static{this.requestSeqMap=new Map}static{this.requestInteractionMap=new Map}static{this.appendChainMap=new Map}static resetForTesting(){tKe=void 0,A_n(),t.sequence=0,t.requestSeqMap.clear(),t.requestInteractionMap.clear(),t.appendChainMap.clear()}getBasePath(){return Ft(this.ctx,Ye.PromptPersistBasePath)?.trim()||void 0}ensureDir(){return tKe||(tKe=this.initHttpLogDir()),tKe}toPersistenceFileOps(){return{mkdir:a((e,r)=>this.fileOps.mkdir(e,r),"mkdir"),writeFile:a((e,r,n)=>this.fileOps.writeFile(e,r,n),"writeFile"),appendFile:a((e,r,n)=>this.fileOps.appendFile(e,r,n),"appendFile")}}async initHttpLogDir(){let e=await lQt(this.basePath,this.toPersistenceFileOps()),r=bO.join(e,"http-log");return await this.fileOps.mkdir(r,{recursive:!0}),r}seqForRequest(e){let r=t.requestSeqMap.get(e);if(r!==void 0)return r;let n=++t.sequence;return t.requestSeqMap.set(e,n),n}logRequest(e){this.isEnabled&&this.writeRequestFile(e).catch(r=>{ot.debug(this.ctx,"Failed to persist enhanced request log",r)})}logResponse(e){this.isEnabled&&this.writeResponseFile(e).catch(r=>{ot.debug(this.ctx,"Failed to persist enhanced response log",r)})}static{this.SENSITIVE_HEADERS=new Set(["authorization","cookie","set-cookie","request-hmac","proxy-authorization"].map(e=>e.toLowerCase()))}static redactHeaders(e){let r={};for(let[n,o]of Object.entries(e))r[n]=t.SENSITIVE_HEADERS.has(n.toLowerCase())?"[REDACTED]":o;return r}async resolveTurnHttpLogDir(e){if(!e)return;let r=uQt(e);if(!r)return;let n=bO.join(r,"http-log");return await this.fileOps.mkdir(n,{recursive:!0}),n}static extractInteractionId(e){return Object.entries(e).find(([r])=>r.toLowerCase()==="x-interaction-id")?.[1]}async writeMessagesDump(e,r,n,o){if(!o||o.length===0)return;let s=`${r}_request_messages_dump_${n}.json`;await this.fileOps.writeFile(bO.join(e,s),JSON.stringify(o,null,2),"utf8")}appendResponseChunk(e,r){if(!this.isEnabled)return;let o=(t.appendChainMap.get(e)??Promise.resolve()).then(()=>this.doAppendChunk(e,r)).catch(s=>{ot.debug(this.ctx,"Failed to append SSE chunk",s)});t.appendChainMap.set(e,o)}async doAppendChunk(e,r){let n=await this.ensureDir(),o=this.seqForRequest(e),s=String(o).padStart(6,"0"),c=e.replace(/[^a-zA-Z0-9_-]/g,"_"),l=`${s}_response_sse_chunks_${c}.txt`;await this.fileOps.appendFile(bO.join(n,l),r,"utf8");let u=t.requestInteractionMap.get(e),d=await this.resolveTurnHttpLogDir(u);d&&await this.fileOps.appendFile(bO.join(d,l),r,"utf8")}async writeRequestFile(e){let r=await this.ensureDir(),n=this.seqForRequest(e.requestId),o=String(n).padStart(6,"0"),s=e.requestId.replace(/[^a-zA-Z0-9_-]/g,"_"),c=`${o}_request_${s}.json`,{messages:l,...u}=e,d={...u,headers:t.redactHeaders(e.headers)},f=JSON.stringify(d,null,2);await this.fileOps.writeFile(bO.join(r,c),f,"utf8"),await this.writeMessagesDump(r,o,s,l);let h=t.extractInteractionId(e.headers);h&&t.requestInteractionMap.set(e.requestId,h);let m=await this.resolveTurnHttpLogDir(h);m&&(await this.fileOps.writeFile(bO.join(m,c),f,"utf8"),await this.writeMessagesDump(m,o,s,l))}async writeResponseFile(e){let r=t.appendChainMap.get(e.requestId);r&&(await r,t.appendChainMap.delete(e.requestId));let n=await this.ensureDir(),o=this.seqForRequest(e.requestId),s=e.requestId.replace(/[^a-zA-Z0-9_-]/g,"_"),c=`${String(o).padStart(6,"0")}_response_headers_${s}.json`,{body:l,...u}=e,d={...u,headers:t.redactHeaders(e.headers)},f=JSON.stringify(d,null,2);await this.fileOps.writeFile(bO.join(n,c),f,"utf8");let h=t.requestInteractionMap.get(e.requestId),m=await this.resolveTurnHttpLogDir(h);m&&await this.fileOps.writeFile(bO.join(m,c),f,"utf8"),t.requestSeqMap.delete(e.requestId),t.requestInteractionMap.delete(e.requestId)}},iKe=class extends ex{static{a(this,"DebugLoggingResponseWrapper")}constructor(e,r,n,o){super(e.status,e.statusText,e.headers,()=>e.text(),()=>e.body()),this.logger=r,this.requestId=n,this.startTime=o}async text(){let e=await super.text();return this.logger.logResponse({timestamp:new Date().toISOString(),requestId:this.requestId,status:this.status,statusText:this.statusText,headers:this.headersToObject(),duration:Math.round(performance.now()-this.startTime)}),e}body(){let e=super.body();return e?this.createLoggingStream(e):null}createLoggingStream(e){let r=new y_n.PassThrough;return e.on("data",n=>{this.logger.appendResponseChunk(this.requestId,n.toString()),r.write(n)}),e.on("end",()=>{this.logger.logResponse({timestamp:new Date().toISOString(),requestId:this.requestId,status:this.status,statusText:this.statusText,headers:this.headersToObject(),duration:Math.round(performance.now()-this.startTime)}),r.end()}),e.on("error",n=>{r.emit("error",n)}),r}headersToObject(){let e={};for(let[r,n]of this.headers)e[r]=n;return e}};p();p();var LK=class t extends G_{constructor(r){super();this._autoModelCache=new Map;this._ongoingFetches=new Map;this._ctx=r,this._logger=new fe("AutoModelService"),this._register(bs(this._ctx,()=>{this._autoModelCache.clear(),this._reserveToken=void 0,this._ongoingFetches.clear(),this._logger.info(this._ctx,"Auto model cache cleared due to token update")}))}static{a(this,"AutoModelService")}static{this.EXPIRY_THRESHOLD_MS=300*1e3}async resolveModelConfiguration(r,n){let o=this._autoModelCache.get(r);o||(o={},this._autoModelCache.set(r,o)),this._pruneExpiredTokens(o),!o.active&&o.standby&&(o.active=o.standby,o.standby=void 0),o.active||(o.active=await this._acquireActiveToken(r)),(!o.standby||!this._isTokenValid(o.standby)||this._isExpiringSoon(o.standby)||this._isExpiringSoon(o.active))&&this._refreshStandbyInBackground(r),this._ensureReserveRefill();let s=await this._ctx.get(xs).getMetadata(),c=await this._ctx.get(el).getBestChatModelConfig([o.active.model]);c.copilotSessionToken=o.active.sessionToken,c.autoModeDiscountedCost=o.active.discountedCost;let l=s.find(u=>u.capabilities.family===o.active.model);return c.originalBillingMultiplier=l?.billing?.multiplier??0,c}_ensureReserveRefill(){if(this._isTokenValid(this._reserveToken))return;let r="reserve";if(this._ongoingFetches.has(r))return;let n=this._fetchToken("reserve");this._ongoingFetches.set(r,n),n.then(o=>{this._reserveToken=o}).catch(o=>{this._logger.error(this._ctx,`Failed to refresh reserve auto mode token: ${o instanceof Error?o.message:String(o)}`)}).finally(()=>{this._ongoingFetches.delete(r)})}async _acquireActiveToken(r){if(this._isTokenValid(this._reserveToken)){let c=this._reserveToken;return this._reserveToken=void 0,c}let n=`active:${r}`,o=this._ongoingFetches.get(n);if(o)return o;let s=this._fetchToken("active").finally(()=>{this._ongoingFetches.delete(n)});return this._ongoingFetches.set(n,s),s}_refreshStandbyInBackground(r){let n=`standby:${r}`;if(this._ongoingFetches.has(n))return;let o=this._fetchToken("standby");this._ongoingFetches.set(n,o),o.then(s=>{let c=this._autoModelCache.get(r);c&&(c.active&&c.active.sessionToken===s.sessionToken||(c.standby=s,this._ongoingFetches.delete(n)))}).catch(s=>{this._logger.error(this._ctx,`Failed to refresh standby auto mode token for ${r}: ${s instanceof Error?s.message:String(s)}`),this._ongoingFetches.delete(n)})}async _fetchToken(r){let n=Date.now();try{let o=await b$e(this._ctx,"/models/session",JSON.stringify({auto_mode:{model_hints:["auto"]}}));if(!o.ok)throw new Error(`Auto mode API returned status ${o.status}`);let s=await o.json(),c=s.selected_model,l=s.session_token,u=s.expires_at*1e3,d=s.discounted_costs?.[c];return this._logger.info(this._ctx,`Fetched auto model for ${r} in ${Date.now()-n}ms: ${c}`),{model:c,sessionToken:l,expiration:u,discountedCost:d}}catch(o){throw this._logger.error(this._ctx,`Failed to fetch auto mode model for ${r}: ${o instanceof Error?o.message:String(o)}`),o}}_pruneExpiredTokens(r){r.active&&!this._isTokenValid(r.active)&&(r.active=void 0),r.standby&&!this._isTokenValid(r.standby)&&(r.standby=void 0)}_isTokenValid(r){return!!r&&r.expiration>Date.now()}_isExpiringSoon(r){return r?r.expiration-Date.now()<=t.EXPIRY_THRESHOLD_MS:!1}};var oKe="Auto",V_="auto";var xo=class t{static{a(this,"ModelPickerUtils")}static async formatModelDisplayName(e,r,n){if(!r)return;let o=n?.trim();if(o){try{let u=(await new da(e.get(Yn)).getStoredModelConfigs(o))?.[r]?.modelCapabilities?.name?.trim();if(u)return`${u} (${o})`}catch{}return`${r} (${o})`}try{let l=(await e.get(xs).getMetadata()).find(u=>u.id===r);if(l)return`${l.name}`}catch{}return`${r}`}static async getModelConfiguration(e,r,n){let o=await e.get(Qt).getToken(),s=!!o.userInfo?.isTBBEnabled,c=!!o.userInfo?.isFreeUser,l=e.get(Au);if(!s&&l.quotaExhausted&&!c){let u=await e.get(xs).getFallbackModel();if(u?.id)return e.get(el).getBestChatModelConfig([u.id])}if(r)return e.get(el).getBestChatModelConfig(xS(r,s),n);throw new Error("Model is not specified")}static async getModelConfigurationById(e,r,n,o){if(!r)throw new Error("Model is not specified");if(r===V_)return await e.get(LK).resolveModelConfiguration(n??"unknown",o);let s=await e.get(el).getModelConfigurationById(r);if(!s)throw new Error(`No model configuration found for id '${r}'`);return s}static setUserSelectedReasoningEffort(e,r,n){if(!n)return r;let o=r.reasoningEfforts;return o&&o.length>0&&!o.includes(n)?(ot.warn(e,`User-selected reasoning effort '${n}' for model '${r.modelId}' is not in supported list [${o.join(", ")}].`),r):(r.userSelectedReasoningEffort=n,r)}static overrideMaxRequestTokens(e,r){return typeof r!="number"||!Number.isFinite(r)||r<=0||(e.maxRequestTokens=e.maxLongContextTokens===void 0?Math.min(e.maxRequestTokens,r):Math.min(e.maxLongContextTokens,r)),e}static applyModelConfigurationOverrides(e,r,n){return t.setUserSelectedReasoningEffort(e,r,n?.reasoningEffort),t.overrideMaxRequestTokens(r,n?.contextSize),r}static async resolveModelIdFromFamily(e,r){return r===V_?V_:(await e.get(xs).getMetadata()).find(o=>o.capabilities.family===r&&o.capabilities.type==="chat"&&o.model_picker_enabled===!0)?.id}static transformMessages(e,r){return r===Rn.O1Ga||r===Rn.O1Mini?e.map(n=>n.role!=="user"?{role:"user",content:n.content}:n):e}static parseModelNotSupportedReason(e){if(!e)return{};let r=e.indexOf(":");if(r===-1||r===e.length-1)return{};let n=e.slice(r+1).trim();if(!n)return{};let{modelName:o,provider:s}=dQt(n);return{modelName:o||void 0,modelProviderName:s!==void 0&&s!==""?s:void 0}}};var th=new fe("fetchChat"),DQo=new Set([500,502,504]),NQo=[1e3,1e4,1e4],sKe=class{static{a(this,"OpenAIChatMLFetcher")}async fetchAndStreamChat(e,r,n,o,s){let c=String(n.properties.headerRequestId??r.ourRequestId);if(s?.isCancellationRequested)return{type:"canceled",reason:"before fetch request"};let l;try{let f=await this.fetchWithParameters(e,r.endpoint,r,n,s);if(f==="not-sent")return{type:"canceled",reason:"before fetch request"};l=f}catch(f){if(Gm(f)||!XI(f))throw f;th.info(e,`Network error during fetch, checking connectivity before retry [${c}]: ${String(f)}`);let h=await this.retryAfterError(e,r,n,s,c);if(h&&"canceled"in h)return h.canceled;if(h&&"response"in h)l=h.response;else throw f}if(s?.isCancellationRequested)return this.destroyResponseBody(e,l),{type:"canceled",reason:"after fetch request"};if(LQo(l.status)){th.info(e,`Server returned ${l.status}, checking network connectivity before retry [${c}]`);let f=await this.retryAfterError(e,r,n,s,c);if(f&&"canceled"in f)return this.destroyResponseBody(e,l),f.canceled;f&&"response"in f&&(this.destroyResponseBody(e,l),l=f.response)}if(l.status!==200){let f=this.createTelemetryData(r.endpoint,e,r),h=await xo.formatModelDisplayName(e,r.model,r.modelProviderName),m=await this.handleError(e,f,l,h,r.uiKind);return m.type==="failed"?{...m,ghRequestId:l.headers.get("x-github-request-id")||void 0}:m}e.get(Au).processQuotaHeaders(l.headers),e.get(gO).processRateLimitHeaders(l.headers);let u=BP.getStrategy(r.endpoint),d={messages:r.messages,tools:r.tools,tool_choice:r.tool_choice,temperature:r.postOptions?.temperature,topP:r.postOptions?.top_p,modelConfiguration:{modelId:r.model,maxResponseTokens:r.postOptions?.max_tokens,stream:!!r.postOptions?.stream},repoInfo:r.repoInfo,count:r.count,postOptions:r.postOptions,intentParams:{intent:r.intent,intent_threshold:r.intent_threshold,intent_model:r.intent_model,intent_tokenizer:r.intent_tokenizer,intent_content:r.intent_content},copilot_thread_id:r.copilot_thread_id,prediction:r.prediction,cancel:s,enableThinking:r.enableThinking};return u.processResponse(e,l,o,n,d)}destroyResponseBody(e,r){try{let n=r.body();n&&"destroy"in n&&typeof n.destroy=="function"?n.destroy():n instanceof ReadableStream&&n.cancel()}catch(n){th.exception(e,n,"Error destroying response stream")}}async retryAfterError(e,r,n,o,s){if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled before connectivity check"}};let c=await BQo(e,r.copilotApiBaseUrl,r.authToken,o);if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled during connectivity check"}};if(!c.retryRequest){th.info(e,`Not retrying chat request as network connectivity could not be re-established [${s}]`);return}th.info(e,`Connectivity check passed, retrying request [${s}]`);let l=await this.fetchWithParameters(e,r.endpoint,r,n,o);return l==="not-sent"?{canceled:{type:"canceled",reason:"before retry fetch request"}}:o?.isCancellationRequested?(this.destroyResponseBody(e,l),{canceled:{type:"canceled",reason:"after retry fetch request"}}):{response:l}}createTelemetryData(e,r,n){return Wt.createAndMarkAsIssued({endpoint:e,engineName:n.engineName,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s){let c=BP.getStrategy(r),l={messages:n.messages,tools:n.tools,tool_choice:n.tool_choice,temperature:n.postOptions?.temperature,topP:n.postOptions?.top_p,modelConfiguration:{modelId:n.model,providerName:n.modelProviderName,maxResponseTokens:n.postOptions?.max_tokens,stream:n.postOptions?.stream!==!1,supportsThinking:n.supportsThinking,reasoningEfforts:n.reasoningEfforts,userSelectedReasoningEffort:n.userSelectedReasoningEffort,apiType:n.apiType},repoInfo:n.repoInfo,count:n.count,postOptions:n.postOptions,intentParams:{intent:n.intent,intent_threshold:n.intent_threshold,intent_model:n.intent_model,intent_tokenizer:n.intent_tokenizer,intent_content:n.intent_content},copilot_thread_id:n.copilot_thread_id,prediction:n.prediction,cancel:s,enableThinking:n.enableThinking},u=c.buildRequestBody(e,l);return gyn(u,l.modelConfiguration),s?.isCancellationRequested?"not-sent":await MQo(e,n.messages,n.copilotApiBaseUrl,n.engineName,r,n.ourRequestId,u,n.authToken,n.uiKind,o,n.llmInteraction,n.apiKey,n.modelProviderName,n.copilotEditsSessionHeader,n.copilotSessionToken,s,n.supportsAdaptiveThinking,n.apiType)}async handleError(e,r,n,o,s){if(n.clientError&&!n.headers.get("x-github-request-id")){let f=`Last response was a ${n.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;th.error(e,f),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else r.properties.error=`Response status was ${n.status}`;if(r.properties.status=String(n.status),Et(e,"request.shownWarning",r),n.status===401)try{let f=await n.text(),h=JSON.parse(f);if(h.authorize_url)return{type:"authRequired",reason:"not authorized",authUrl:h.authorize_url}}catch{}if(n.status===401||n.status===403)return e.get(Qt).resetToken("chat_messages",n.status),{type:"failed",reason:`token expired or invalid: ${n.status}`,code:n.status};if(n.status===499)return th.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server",code:n.status};let c=await n.text();if(n.status===429){let f=OU(n),h;try{let m=JSON.parse(c);h=m?.error?.code??m?.code}catch{}return At(e,"request.throttled",{requestSource:s??"unknown"},{retryAfter:f??-1}),{type:"failed",reason:"rate limit exceeded",code:n.status,retryAfter:f,capiErrorCode:h}}if(n.status===466)return th.info(e,c),{type:"failed",reason:`client not supported: ${c}`,code:n.status};if(n.status===400){let f=$_.translate400Reason(c,o);if(f!==void 0)return{type:"failed",reason:f,code:n.status}}if(n.status===424)return{type:"failedDependency",reason:c};let u=n.headers.get("retry-after"),d=await e.get(Qt).getToken();return n.status===402?{type:"failed",reason:$_.translate402Reason(c,{retryAfterHeader:u??void 0,retryAfterSeconds:OU(n),copilotPlan:d.userInfo?.copilotPlan,isTBBEnabled:d.userInfo?.isTBBEnabled,canUpgradePlan:d.userInfo?.canUpgradePlan,overageEnabled:e.get(Au).overageEnabled}),code:n.status}:n.status===503?{type:"failed",reason:c,code:n.status}:(th.error(e,"Unhandled status from server:",n.status,c),{type:"failed",reason:`unhandled status from server: ${n.status} ${c}`,code:n.status})}};async function MQo(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_){let v=n===""&&o===""?r:wa(r,n,o),b=d.extendedBy({endpoint:o,engineName:n,uiKind:u});dYe(c,b,["messages"]),b.properties.headerRequestId=s,Et(t,"request.sent",b);let T=yl(),w=wyn(u),R={...i0(t),...f.toCapiHeaders()};CB()&&(R=await C$e(t,R)),c.messages?.some(D=>Array.isArray(D.content)?D.content.some(N=>"image_url"in N):!1)&&(R["Copilot-Vision-Request"]="true");let x=_==="messages"&&!!h;h&&(_==="messages"?(R["x-api-key"]=h,R["anthropic-version"]=uyn):R["api-key"]=h),g&&(R[rq]=g),A&&(R["copilot-session-token"]=A),o==="v1/messages"&&!E&&(R["anthropic-beta"]=rYe),c.messages&&c.messages.forEach(D=>{OQo(D)&&D.tool_calls&&(D.tool_calls=D.tool_calls.map(N=>Oyn(N)))});let P=Zae(()=>eKe(t)?new nKe(t):void 0,void 0);return HW(t,v,l,w,s,c,y,R,void 0,m,P,e,x).then(D=>{let N=M3(D);b.extendWithRequestId(N);let L=yl()-T;return b.measurements.totalTimeMs=L,th.info(t,`Request ${s} at <${v}> finished with ${D.status} status after ${L}ms`),th.debug(t,"request.response properties",b.properties),th.debug(t,"request.response measurements",b.measurements),th.debug(t,"messages:",JSON.stringify(e)),Et(t,"request.response",b),P?new iKe(D,P,s,T):D}).catch(D=>{if(Gm(D))throw D;let N=b.extendedBy({error:"Network exception"});Et(t,"request.shownWarning",N),b.properties.message=String(Wh(D,"name")??""),b.properties.code=String(Wh(D,"code")??""),b.properties.errno=String(Wh(D,"errno")??""),b.properties.type=String(Wh(D,"type")??"");let L=yl()-T;throw b.measurements.totalTimeMs=L,th.info(t,`Request ${s} at <${v}> rejected with ${String(D)} after ${L}ms`),th.debug(t,"request.error properties",b.properties),th.debug(t,"request.error measurements",b.measurements),Et(t,"request.error",b),D}).finally(()=>{Zle(t,e,b)})}a(MQo,"fetchWithInstrumentation");function OQo(t){return"tool_calls"in t}a(OQo,"isChatMessageWithToolCalls");function LQo(t){return DQo.has(t)}a(LQo,"shouldRetryStatusCode");async function BQo(t,e,r,n,o=NQo){let s=t.get(tr),c=new URL("_ping",e).href,l,u;for(let d of o){if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};if(th.info(t,`Waiting ${d}ms before pinging CAPI to check network connectivity...`),n){let f;try{await Promise.race([bC(d),new Promise(h=>{if(n.isCancellationRequested){h();return}f=n.onCancellationRequested(()=>{h()})})])}finally{f?.dispose()}}else await bC(d);if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};try{let f=await s.fetch(c,{method:"GET",headers:{Authorization:`Bearer ${r}`}});if(f.status>=200&&f.status<300)return th.info(t,"CAPI ping successful, proceeding with chat request retry..."),{retryRequest:!0,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};l=`Status ${f.status}: ${f.statusText??""}`,u=f.headers.get("x-github-request-id")??void 0,th.info(t,`CAPI ping returned status ${f.status}, retrying ping...`)}catch(f){l=String(f),u=void 0,th.info(t,`CAPI ping failed with error, retrying ping: ${l}`)}}return th.info(t,`Network connectivity could not be re-established after ${o.length} attempts`),{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u}}a(BQo,"checkNetworkConnectivity");p();var FQo=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function aKe(t){let e=t.slice();return e.reverse(),E_n(e)||E_n(e.filter(r=>r.trim().length>0))}a(aKe,"isRepetitive");function E_n(t){let e=UQo(t);for(let r of FQo){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(UQo,"kmp_prefix_function");Mo();var oc=class{constructor(e){this.ctx=e;this.fetcher=new sKe}static{a(this,"ChatMLFetcher")}async fetchResponse(e,r,n,o,s,c){let l=performance.now(),u=Mt(),d={n:e.num_suggestions??1,temperature:e.temperature??0,stop:e.stop,top_p:e.topP??1,copilot_thread_id:e.copilot_thread_id,prediction:e.prediction},f=e.modelConfiguration;f&&(e.prediction?.content||delete d.prediction,e.prediction||e.modelConfiguration?.providerName===void 0&&f.maxResponseTokens!==void 0&&(d.max_tokens=f.maxResponseTokens),d.stream=!!f.stream),e.logitBias&&(d.logit_bias=e.logitBias);let h=e.chatModeKind==="Ask",m=await this.ctx.get(Qt).getToken(),g=!h&&Ft(this.ctx,Ye.EnableThinking);if(g&&e.modelConfiguration?.providerName===void 0&&myn(e.modelConfiguration?.modelId)&&e.uiKind==="agentPanel")if(e.endpoint==="v1/messages"&&e.modelConfiguration?.supportsAdaptiveThinking){d.adaptive_thinking=!0;let D=mO(e.modelConfiguration?.reasoningEfforts,e.modelConfiguration?.userSelectedReasoningEffort)??"medium";D!=="none"&&(d.thinking_effort=D)}else{let D=Ft(this.ctx,Ye.AnthropicThinkingBudgetToken);if(D&&D>0){let N=D<1024?1024:D;d.thinking_budget=Math.min(32e3,e.modelConfiguration.maxResponseTokens-1,N)}}let A,y,E,_;if(e.modelConfiguration?.providerName){if(!XQ(m))throw new Error("Bring Your Own Key (BYOK) is not available for your account.");if(E=await Wze(this.ctx,e.modelConfiguration?.providerName,e.modelConfiguration.modelId),_=e.modelConfiguration.providerName,e.intentParams=void 0,e.modelConfiguration?.providerName===io.Azure)if(e.modelConfiguration.deploymentUrl)A=zAn(e.modelConfiguration.modelId,e.modelConfiguration.deploymentUrl),y="",e.engineName="";else throw new Error(`No deployment URL found for Azure model: ${e.modelConfiguration.modelId}`);else if(jle(e.modelConfiguration?.providerName))A=zle[e.modelConfiguration?.providerName],y=e.endpoint??"completions",e.authToken=E;else{if(!e.modelConfiguration.deploymentUrl)throw new Error(`No endpoint URL found for custom endpoint provider "${e.modelConfiguration.providerName}" model: ${e.modelConfiguration.modelId}`);if(!E)throw new Error(`No API key found for custom endpoint provider "${e.modelConfiguration.providerName}" model: ${e.modelConfiguration.modelId}`);let D=e.modelConfiguration.apiType??XIe;A=Vze(e.modelConfiguration.deploymentUrl,D),y=WAn(D),e.authToken=E}}else{if(A=tx(this.ctx,m,e.copilotApiProvider??"api"),e.endpoint)y=e.endpoint;else{let D=f?oYe(this.ctx,f):!1;y=iYe(f,D)}ot.debug(this.ctx,`Endpoint routing: model=${f?.modelId}, supportedEndpoints=${JSON.stringify(f?.supportedEndpoints)}, selected=${y}`)}let v=f?.copilotSessionToken,b=e.authToken??m.token,T=BP.getStrategy(y),w=e.engineName??T.engineName,R={messages:e.messages,repoInfo:void 0,ourRequestId:u,copilotApiBaseUrl:A,engineName:w,endpoint:y,count:e.num_suggestions??1,uiKind:e.uiKind,postOptions:d,authToken:b,apiKey:E,modelProviderName:_,apiType:f?.apiType,...e.intentParams,llmInteraction:e.llmInteraction,prediction:e.prediction,copilotEditsSessionHeader:e.copilotEditsSessionHeader,copilotSessionToken:v,supportsThinking:f?.supportsThinking,supportsAdaptiveThinking:f?.supportsAdaptiveThinking,reasoningEfforts:f?.reasoningEfforts,userSelectedReasoningEffort:f?.userSelectedReasoningEffort,enableThinking:g};f&&(R.model=f.modelId),e.tools&&e.tools?.length>0&&(f===void 0||f.toolCalls)&&(R.tools=e.tools,R.tool_choice=e.tool_choice??"auto");let x=await this.fetch(R,o,r,n);if(c){let D=c.maxRetryAttempts??3;for(let N=1;N<=D&&!(!c.shouldRetry(x)||x.type==="failed"&&x.noRetry);N++){let L=x;if(await c.onRetry?.(L,N),L.type==="failed"&&L.retryAfter!==void 0&&L.retryAfter>0){let B=L.retryAfter;if(await new Promise(q=>{let M=setTimeout(()=>{O.dispose(),q()},B*1e3),O=r.onCancellationRequested(()=>{clearTimeout(M),O.dispose(),q()})}),r.isCancellationRequested)break}x=await this.fetch(R,o,r,n),At(this.ctx,"request.throttled.retry",{requestSource:e.uiKind??"unknown",resultType:x.type,modelId:f?f.providerName?"custom-byok":f.modelId:"unknown"},{retryAfter:L.type==="failed"?L.retryAfter??-1:-1,resultCode:x.type==="failed"?x.code??-1:-1})}}let P=Math.round(performance.now()-l);return this.sendFetchResponseTelemetry(e,x,n,P,y),this.trackTurnCredits(e,x),Jae(()=>{if(s)return s.persistLLMRequest({requestId:R.ourRequestId,messages:R.messages,tools:R.tools,model:R.model,response:x,durationMs:P})},D=>ot.debug(this.ctx,"persistLLMRequest failed",D)),x}async fetch(e,r,n,o){try{let s=await this.fetcher.fetchAndStreamChat(this.ctx,e,o.extendedBy({uiKind:e.uiKind}),r||(()=>{}),n);switch(s.type){case"success":return await this.processSuccessfulResponse(e,s,e.ourRequestId,o);case"canceled":return this.processCanceledResponse(s,e.ourRequestId);case"failed":case"failedDependency":return this.processFailedResponse(s,e.ourRequestId);case"authRequired":return{type:"agentAuthRequired",reason:"Agent authentication required.",authUrl:s.authUrl,requestId:e.ourRequestId}}}catch(s){return this.processError(s,e.ourRequestId)}}async processSuccessfulResponse(e,r,n,o){let s=[],c=ixe(r.chatCompletions,u=>this.postProcess(u,o));ot.debug(this.ctx,`Process success response for request ${e.ourRequestId} with chatParams: ${JSON.stringify(e,null,2)}`);let l=0;for await(let u of c)ot.debug(this.ctx,`Received choice #${l} for request ${e.ourRequestId}: ${JSON.stringify(u,null,2)}`),s.push(u),l++;if(s.length==1){let u=s[0];switch(u.finishReason){case"stop":return{type:"success",value:Pn(u.message?.content)??"",toolCalls:u.tool_calls,requestId:n,numTokens:u.numTokens,copilotEditsSessionHeader:u.copilotEditsSessionHeader,thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"tool_calls":return{type:"tool_calls",toolCalls:u.tool_calls,requestId:n,copilotEditsSessionHeader:u.copilotEditsSessionHeader,thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"content_filter":return{type:"filtered",reason:"Response got filtered.",requestId:n,usage:u.usage,copilot_usage:u.copilot_usage};case"length":return{type:"length",reason:"Response too long.",requestId:n,truncatedValue:Pn(u.message?.content)??"",thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"DONE":return{type:"no_finish_reason",reason:"No finish reason received.",requestId:n};default:return{type:"unknown",reason:"Unknown finish reason received.",requestId:n}}}else if(s.length>1){let u=s.filter(d=>d.finishReason=="stop"||d.finishReason=="tool_calls");if(u.length>0)return{type:"successMultiple",value:u.map(d=>Pn(d.message.content)),toolCalls:u.map(d=>d.tool_calls).filter(d=>d),requestId:n,copilotEditsSessionHeader:u[0].copilotEditsSessionHeader,usage:u[0].usage,copilot_usage:u[0].copilot_usage}}return{type:"no_choices",reason:"Response contained no choices.",requestId:n}}postProcess(e,r){return aKe(e.tokens)?(r.extendWithRequestId(e.requestId),Et(this.ctx,"conversation.repetition.detected",r,0),e.finishReason!==""?e:void 0):e.message?e:void 0}processCanceledResponse(e,r){return ot.debug(this.ctx,"Cancelled after awaiting fetchConversation"),{type:"canceled",reason:e.reason,requestId:r}}processFailedResponse(e,r){return e?.reason.includes("filtered as off_topic by intent classifier")?{type:"offTopic",reason:e.reason,requestId:r}:e?.reason.includes("model is not supported")?{type:"model_not_supported",reason:e.reason,requestId:r}:e?.reason.includes("model max prompt tokens exceeded")?{type:"model_max_prompt_tokens_exceeded",reason:e.reason,requestId:r}:{type:"failed",reason:e.reason,requestId:r,code:e.type==="failed"?e.code:void 0,retryAfter:e.type==="failed"?e.retryAfter:void 0,ghRequestId:e.type==="failed"?e.ghRequestId:void 0,capiErrorCode:e.type==="failed"?e.capiErrorCode:void 0}}processError(e,r){if(Gm(e))return{type:"canceled",reason:"network request aborted",requestId:r};{ot.exception(this.ctx,e,"Error on conversation request");let n="Error on conversation request. Read more from logs.";if(e instanceof Error){let o=e.message;if(o&&o.trim().length>0){let s=360;o.length<=s?n=`Error on conversation request: ${o}`:n=`Error on conversation request: ${o.substring(0,s)}... Read more from logs.`}}return{type:"failed",reason:n,requestId:r,noRetry:e instanceof OK?!0:void 0}}}trackTurnCredits(e,r){if(!e.turnId)return;let n="copilot_usage"in r?r.copilot_usage:void 0;!n||n.total_nano_aiu<=0||this.ctx.get(Au).setLastCopilotUsage(n.total_nano_aiu,e.turnId)}sendFetchResponseTelemetry(e,r,n,o,s){let c={responseType:r.type},l={duration:o};e.modelConfiguration&&!e.modelConfiguration?.providerName&&(c.modelId=e.modelConfiguration.modelId,c.modelFamily=e.modelConfiguration.modelFamily,c.maxRequestTokens=String(e.modelConfiguration.maxRequestTokens),c.userSelectedReasoningEffort=e.modelConfiguration.userSelectedReasoningEffort??""),"reason"in r&&r.reason&&(c.reason=r.reason.substring(0,360)),"code"in r&&r.code!==void 0&&(c.statusCode=String(r.code)),r.type==="failed"&&r.noRetry&&(c.isMidStreamError="true"),c.uiKind=e.uiKind,s&&(c.route=s),r.usage&&(l.completionTokens=r.usage.completion_tokens,l.promptTokens=r.usage.prompt_tokens,l.totalTokens=r.usage.total_tokens,r.usage.prompt_tokens_details?.cached_tokens!==void 0&&(l.cachedTokens=r.usage.prompt_tokens_details.cached_tokens)),r.copilot_usage&&(l.copilotUsageTotalNanoAiu=r.copilot_usage.total_nano_aiu,r.copilot_usage.token_details?.length&&(c.copilotUsageTokenDetails=JSON.stringify(r.copilot_usage.token_details))),n.properties.conversationId&&(c.conversationId=n.properties.conversationId),n.properties.messageId&&(c.messageId=n.properties.messageId),n.properties.messageSource&&(c.messageSource=n.properties.messageSource),At(this.ctx,"chatfetcher.response",c,l)}};p();p();p();p();p();p();p();p();var zh=class{static{a(this,"ConversationInspector")}};p();p();var Yh=class{constructor(){this.skills=[]}static{a(this,"ConversationSkillRegistry")}registerSkill(e){if(this.getSkill(e.id))throw new Error(`Skill with id '${e.id}' already registered`);this.skills.push(e)}getSkill(e){return this.skills.find(r=>r.id===e)}getDescriptors(){return[...this.skills]}},fQt=class{constructor(e,r,n){this.delegate=e;this.stepId=r;this.stepTitle=n}static{a(this,"StepReportingSkillResolver")}async resolveSkill(e){await e.steps.start(this.stepId,this.stepTitle);try{let r=await this.delegate.resolveSkill(e);return r||await e.steps.finish(this.stepId),r}catch(r){throw await e.steps.error(this.stepId,r instanceof Error?r.message:`Error resolving ${this.stepTitle}`),r}}},pQt=class{constructor(e,r){this.delegate=e;this.stepId=r}static{a(this,"StepReportingSkillProcessor")}value(){return this.delegate.value()}async processSkill(e,r){try{let n=await this.delegate.processSkill(e,r);return await r.steps.finish(this.stepId),n}catch(n){throw await r.steps.error(this.stepId,n instanceof Error?n.message:`Error processing ${this.stepId}`),n}}},gg=class{constructor(e,r,n,o,s,c="explicit",l=[],u=()=>!0){this.id=e;this._description=r;this.stepTitle=n;this._resolver=o;this._processor=s;this.type=c;this._examples=l;this._isAvailable=u}static{a(this,"SingleStepReportingSkill")}description(){return this._description}examples(){return this._examples}isAvailable(e){return this._isAvailable(e)}resolver(e){return new fQt(this._resolver(e),this.id,this.stepTitle)}processor(e){return new pQt(this._processor(e),this.id)}};p();p();var bl=class extends Error{constructor(r){super(`No instance of ${r.name} has been registered`);this.ctor=r;this.name=`UnregisteredContextErrorFor${r.name}`}static{a(this,"UnregisteredContextError")}},sue=class{constructor(){this.instances=new Map}static{a(this,"Context")}get(e){let r=this.tryGet(e);if(r)return r;throw new bl(e)}tryGet(e){let r=this.instances.get(e);if(r)return r}set(e,r){if(this.tryGet(e))throw new Error(`An instance of ${e.name} has already been registered. Use forceSet() if you're sure it's a good idea.`);this.assertIsInstance(e,r),this.instances.set(e,r)}forceSet(e,r){this.assertIsInstance(e,r),this.instances.set(e,r)}assertIsInstance(e,r){if(!(r instanceof e)){let n=JSON.stringify(r);throw new Error(`The instance you're trying to register for ${e.name} is not an instance of it (${n}).`)}}};p();var __n=new fe("EncodingConfigurationService"),SO=class{constructor(e){this.ctx=e;this.fileEncodingCache=new Map}static{a(this,"EncodingConfigurationService")}async getEncodingForFile(e){if(this.fileEncodingCache.has(e))return this.fileEncodingCache.get(e);let r=await this.requestEncodingFromClient(e)??"utf8";return this.fileEncodingCache.set(e,r),r}handleConfigurationChange(e){if(e.copilot?.encodingChanges){if(e.copilot.encodingChanges.length>0)for(let r of e.copilot.encodingChanges)this.fileEncodingCache.delete(r),__n.debug(this.ctx,`Cache invalidated for file: ${r}`)}else this.fileEncodingCache.clear(),__n.debug(this.ctx,"All encoding cache cleared")}clearCache(){this.fileEncodingCache.clear()}};p();p();p();p();p();var v_n=class t{static{a(this,"Node")}static{this.Undefined=new t(void 0)}constructor(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}};p();var QQo=globalThis.performance&&typeof globalThis.performance.now=="function",cKe=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=QQo&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}};var C_n=!1,qQo=!1,Sxe;(M=>{M.None=a(()=>G_.None,"None");function e(O){if(qQo){let{onDidAddListener:j}=O,Q=bxe.create(),U=0;O.onDidAddListener=()=>{++U===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),Q.print()),j?.()}}}a(e,"_addLeakageTraceLogic");function r(O,j){return g(O,()=>{},0,void 0,!0,void 0,j)}M.defer=r,a(r,"defer");function n(O){return(j,Q=null,U)=>{let Y=!1,W;return W=O(V=>{if(!Y)return W?W.dispose():Y=!0,j.call(Q,V)},null,U),Y&&W.dispose(),W}}M.once=n,a(n,"once");function o(O,j){return M.once(M.filter(O,j))}M.onceIf=o,a(o,"onceIf");function s(O,j,Q){return h((U,Y=null,W)=>O(V=>U.call(Y,j(V)),null,W),Q)}M.map=s,a(s,"map");function c(O,j,Q){return h((U,Y=null,W)=>O(V=>{j(V),U.call(Y,V)},null,W),Q)}M.forEach=c,a(c,"forEach");function l(O,j,Q){return h((U,Y=null,W)=>O(V=>j(V)&&U.call(Y,V),null,W),Q)}M.filter=l,a(l,"filter");function u(O){return O}M.signal=u,a(u,"signal");function d(...O){return(j,Q=null,U)=>{let Y=cyn(...O.map(W=>W(V=>j.call(Q,V))));return m(Y,U)}}M.any=d,a(d,"any");function f(O,j,Q,U){let Y=Q;return s(O,W=>(Y=j(Y,W),Y),U)}M.reduce=f,a(f,"reduce");function h(O,j){let Q,U={onWillAddFirstListener(){Q=O(Y.fire,Y)},onDidRemoveLastListener(){Q?.dispose()}};j||e(U);let Y=new YS(U);return j?.add(Y),Y.event}a(h,"snapshot");function m(O,j){return j instanceof Array?j.push(O):j&&j.add(O),O}a(m,"addAndReturnDisposable");function g(O,j,Q=100,U=!1,Y=!1,W,V){let z,ie,H,re=0,le,Le={leakWarningThreshold:W,onWillAddFirstListener(){z=O(Ue=>{re++,ie=j(ie,Ue),U&&!H&&(ge.fire(ie),ie=void 0),le=a(()=>{let ke=ie;ie=void 0,H=void 0,(!U||re>1)&&ge.fire(ke),re=0},"doFire"),typeof Q=="number"?(clearTimeout(H),H=setTimeout(le,Q)):H===void 0&&(H=0,queueMicrotask(le))})},onWillRemoveListener(){Y&&re>0&&le?.()},onDidRemoveLastListener(){le=void 0,z.dispose()}};V||e(Le);let ge=new YS(Le);return V?.add(ge),ge.event}M.debounce=g,a(g,"debounce");function A(O,j=0,Q){return M.debounce(O,(U,Y)=>U?(U.push(Y),U):[Y],j,void 0,!0,void 0,Q)}M.accumulate=A,a(A,"accumulate");function y(O,j=(U,Y)=>U===Y,Q){let U=!0,Y;return l(O,W=>{let V=U||!j(W,Y);return U=!1,Y=W,V},Q)}M.latch=y,a(y,"latch");function E(O,j,Q){return[M.filter(O,j,Q),M.filter(O,U=>!j(U),Q)]}M.split=E,a(E,"split");function _(O,j=!1,Q=[],U){let Y=Q.slice(),W=O(ie=>{Y?Y.push(ie):z.fire(ie)});U&&U.add(W);let V=a(()=>{Y?.forEach(ie=>z.fire(ie)),Y=null},"flush"),z=new YS({onWillAddFirstListener(){W||(W=O(ie=>z.fire(ie)),U&&U.add(W))},onDidAddFirstListener(){Y&&(j?setTimeout(V):V())},onDidRemoveLastListener(){W&&W.dispose(),W=null}});return U&&U.add(z),z.event}M.buffer=_,a(_,"buffer");function v(O,j){return a((U,Y,W)=>{let V=j(new T);return O(function(z){let ie=V.evaluate(z);ie!==b&&U.call(Y,ie)},void 0,W)},"fn")}M.chain=v,a(v,"chain");let b=Symbol("HaltChainable");class T{constructor(){this.steps=[]}static{a(this,"ChainableSynthesis")}map(j){return this.steps.push(j),this}forEach(j){return this.steps.push(Q=>(j(Q),Q)),this}filter(j){return this.steps.push(Q=>j(Q)?Q:b),this}reduce(j,Q){let U=Q;return this.steps.push(Y=>(U=j(U,Y),U)),this}latch(j=(Q,U)=>Q===U){let Q=!0,U;return this.steps.push(Y=>{let W=Q||!j(Y,U);return Q=!1,U=Y,W?Y:b}),this}evaluate(j){for(let Q of this.steps)if(j=Q(j),j===b)break;return j}}function w(O,j,Q=U=>U){let U=a((...z)=>V.fire(Q(...z)),"fn"),Y=a(()=>O.on(j,U),"onFirstListenerAdd"),W=a(()=>O.removeListener(j,U),"onLastListenerRemove"),V=new YS({onWillAddFirstListener:Y,onDidRemoveLastListener:W});return V.event}M.fromNodeEventEmitter=w,a(w,"fromNodeEventEmitter");function R(O,j,Q=U=>U){let U=a((...z)=>V.fire(Q(...z)),"fn"),Y=a(()=>O.addEventListener(j,U),"onFirstListenerAdd"),W=a(()=>O.removeEventListener(j,U),"onLastListenerRemove"),V=new YS({onWillAddFirstListener:Y,onDidRemoveLastListener:W});return V.event}M.fromDOMEventEmitter=R,a(R,"fromDOMEventEmitter");function x(O,j){return new Promise(Q=>n(O)(Q,null,j))}M.toPromise=x,a(x,"toPromise");function P(O){let j=new YS;return O.then(Q=>{j.fire(Q)},()=>{j.fire(void 0)}).finally(()=>{j.dispose()}),j.event}M.fromPromise=P,a(P,"fromPromise");function D(O,j){return O(Q=>j.fire(Q))}M.forward=D,a(D,"forward");function N(O,j,Q){return j(Q),O(U=>j(U))}M.runAndSubscribe=N,a(N,"runAndSubscribe");class L{constructor(j,Q){this._observable=j;this._counter=0;this._hasChanged=!1;let U={onWillAddFirstListener:a(()=>{j.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{j.removeObserver(this)},"onDidRemoveLastListener")};Q||e(U),this.emitter=new YS(U),Q&&Q.add(this.emitter)}static{a(this,"EmitterObserver")}beginUpdate(j){this._counter++}handlePossibleChange(j){}handleChange(j,Q){this._hasChanged=!0}endUpdate(j){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(O,j){return new L(O,j).emitter.event}M.fromObservable=B,a(B,"fromObservable");function q(O){return(j,Q,U)=>{let Y=0,W=!1,V={beginUpdate(){Y++},endUpdate(){Y--,Y===0&&(O.reportChanges(),W&&(W=!1,j.call(Q)))},handlePossibleChange(){},handleChange(){W=!0}};O.addObserver(V),O.reportChanges();let z={dispose(){O.removeObserver(V)}};return U instanceof eq?U.add(z):Array.isArray(U)&&U.push(z),z}}M.fromObservableLight=q,a(q,"fromObservableLight")})(Sxe||={});var hQt=class t{constructor(e){this.listenerCount=0;this.invocationCount=0;this.elapsedOverall=0;this.durations=[];this.name=`${e}_${t._idPool++}`,t.all.add(this)}static{a(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}start(e){this._stopWatch=new cKe,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}},b_n=-1;var mQt=class t{constructor(e,r,n=(t._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e;this.threshold=r;this.name=n;this._warnCountdown=0}static{a(this,"LeakageMonitor")}static{this._idPool=1}dispose(){this._stacks?.clear()}check(e,r){let n=this.threshold;if(n<=0||r{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[n,o]of this._stacks)(!e||rthis.fileOps.appendFile(e,r,"utf8"));return this.appendQueues.set(e,o.catch(()=>{})),o}};p();var kKe=require("fs"),RO=fe(require("path"));var zvn=require("stream");var Ljo={mkdir:a((t,e)=>kKe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>kKe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>kKe.promises.appendFile(t,e,r),"appendFile")},RKe,PKe=class t{constructor(e,r){this.ctx=e;this.fileOps=r??Ljo,this.basePath=this.getBasePath(),this.isEnabled=!!this.basePath}static{a(this,"DebugRequestLogger")}static{this.sequence=0}static{this.requestSeqMap=new Map}static{this.requestInteractionMap=new Map}static{this.appendChainMap=new Map}static resetForTesting(){RKe=void 0,Wvn(),t.sequence=0,t.requestSeqMap.clear(),t.requestInteractionMap.clear(),t.appendChainMap.clear()}getBasePath(){return Rt(this.ctx,ze.PromptPersistBasePath)?.trim()||void 0}ensureDir(){return RKe||(RKe=this.initHttpLogDir()),RKe}toPersistenceFileOps(){return{mkdir:a((e,r)=>this.fileOps.mkdir(e,r),"mkdir"),writeFile:a((e,r,n)=>this.fileOps.writeFile(e,r,n),"writeFile"),appendFile:a((e,r,n)=>this.fileOps.appendFile(e,r,n),"appendFile")}}async initHttpLogDir(){let e=await tqt(this.basePath,this.toPersistenceFileOps()),r=RO.join(e,"http-log");return await this.fileOps.mkdir(r,{recursive:!0}),r}seqForRequest(e){let r=t.requestSeqMap.get(e);if(r!==void 0)return r;let n=++t.sequence;return t.requestSeqMap.set(e,n),n}logRequest(e){this.isEnabled&&this.writeRequestFile(e).catch(r=>{ot.debug(this.ctx,"Failed to persist enhanced request log",r)})}logResponse(e){this.isEnabled&&this.writeResponseFile(e).catch(r=>{ot.debug(this.ctx,"Failed to persist enhanced response log",r)})}static{this.SENSITIVE_HEADERS=new Set(["authorization","cookie","set-cookie","request-hmac","proxy-authorization"].map(e=>e.toLowerCase()))}static redactHeaders(e){let r={};for(let[n,o]of Object.entries(e))r[n]=t.SENSITIVE_HEADERS.has(n.toLowerCase())?"[REDACTED]":o;return r}async resolveTurnHttpLogDir(e){if(!e)return;let r=rqt(e);if(!r)return;let n=RO.join(r,"http-log");return await this.fileOps.mkdir(n,{recursive:!0}),n}static extractInteractionId(e){return Object.entries(e).find(([r])=>r.toLowerCase()==="x-interaction-id")?.[1]}async writeMessagesDump(e,r,n,o){if(!o||o.length===0)return;let s=`${r}_request_messages_dump_${n}.json`;await this.fileOps.writeFile(RO.join(e,s),JSON.stringify(o,null,2),"utf8")}appendResponseChunk(e,r){if(!this.isEnabled)return;let o=(t.appendChainMap.get(e)??Promise.resolve()).then(()=>this.doAppendChunk(e,r)).catch(s=>{ot.debug(this.ctx,"Failed to append SSE chunk",s)});t.appendChainMap.set(e,o)}async doAppendChunk(e,r){let n=await this.ensureDir(),o=this.seqForRequest(e),s=String(o).padStart(6,"0"),c=e.replace(/[^a-zA-Z0-9_-]/g,"_"),l=`${s}_response_sse_chunks_${c}.txt`;await this.fileOps.appendFile(RO.join(n,l),r,"utf8");let u=t.requestInteractionMap.get(e),d=await this.resolveTurnHttpLogDir(u);d&&await this.fileOps.appendFile(RO.join(d,l),r,"utf8")}async writeRequestFile(e){let r=await this.ensureDir(),n=this.seqForRequest(e.requestId),o=String(n).padStart(6,"0"),s=e.requestId.replace(/[^a-zA-Z0-9_-]/g,"_"),c=`${o}_request_${s}.json`,{messages:l,...u}=e,d={...u,headers:t.redactHeaders(e.headers)},f=JSON.stringify(d,null,2);await this.fileOps.writeFile(RO.join(r,c),f,"utf8"),await this.writeMessagesDump(r,o,s,l);let h=t.extractInteractionId(e.headers);h&&t.requestInteractionMap.set(e.requestId,h);let m=await this.resolveTurnHttpLogDir(h);m&&(await this.fileOps.writeFile(RO.join(m,c),f,"utf8"),await this.writeMessagesDump(m,o,s,l))}async writeResponseFile(e){let r=t.appendChainMap.get(e.requestId);r&&(await r,t.appendChainMap.delete(e.requestId));let n=await this.ensureDir(),o=this.seqForRequest(e.requestId),s=e.requestId.replace(/[^a-zA-Z0-9_-]/g,"_"),c=`${String(o).padStart(6,"0")}_response_headers_${s}.json`,{body:l,...u}=e,d={...u,headers:t.redactHeaders(e.headers)},f=JSON.stringify(d,null,2);await this.fileOps.writeFile(RO.join(n,c),f,"utf8");let h=t.requestInteractionMap.get(e.requestId),m=await this.resolveTurnHttpLogDir(h);m&&await this.fileOps.writeFile(RO.join(m,c),f,"utf8"),t.requestSeqMap.delete(e.requestId),t.requestInteractionMap.delete(e.requestId)}},DKe=class extends lx{static{a(this,"DebugLoggingResponseWrapper")}constructor(e,r,n,o){super(e.status,e.statusText,e.headers,()=>e.text(),()=>e.body()),this.logger=r,this.requestId=n,this.startTime=o}async text(){let e=await super.text();return this.logger.logResponse({timestamp:new Date().toISOString(),requestId:this.requestId,status:this.status,statusText:this.statusText,headers:this.headersToObject(),duration:Math.round(performance.now()-this.startTime)}),e}body(){let e=super.body();return e?this.createLoggingStream(e):null}createLoggingStream(e){let r=new zvn.PassThrough;return e.on("data",n=>{this.logger.appendResponseChunk(this.requestId,n.toString()),r.write(n)}),e.on("end",()=>{this.logger.logResponse({timestamp:new Date().toISOString(),requestId:this.requestId,status:this.status,statusText:this.statusText,headers:this.headersToObject(),duration:Math.round(performance.now()-this.startTime)}),r.end()}),e.on("error",n=>{r.emit("error",n)}),r}headersToObject(){let e={};for(let[r,n]of this.headers)e[r]=n;return e}};p();p();var VK=class t extends z_{constructor(r){super();this._autoModelCache=new Map;this._ongoingFetches=new Map;this._ctx=r,this._logger=new pe("AutoModelService"),this._register(vs(this._ctx,()=>{this._autoModelCache.clear(),this._reserveToken=void 0,this._ongoingFetches.clear(),this._logger.info(this._ctx,"Auto model cache cleared due to token update")}))}static{a(this,"AutoModelService")}static{this.EXPIRY_THRESHOLD_MS=300*1e3}async resolveModelConfiguration(r,n){let o=this._autoModelCache.get(r);o||(o={},this._autoModelCache.set(r,o)),this._pruneExpiredTokens(o),!o.active&&o.standby&&(o.active=o.standby,o.standby=void 0),o.active||(o.active=await this._acquireActiveToken(r)),(!o.standby||!this._isTokenValid(o.standby)||this._isExpiringSoon(o.standby)||this._isExpiringSoon(o.active))&&this._refreshStandbyInBackground(r),this._ensureReserveRefill();let s=await this._ctx.get(xs).getMetadata(),c=await this._ctx.get(tl).getBestChatModelConfig([o.active.model]);c.copilotSessionToken=o.active.sessionToken,c.autoModeDiscountedCost=o.active.discountedCost;let l=s.find(u=>u.capabilities.family===o.active.model);return c.originalBillingMultiplier=l?.billing?.multiplier??0,c}_ensureReserveRefill(){if(this._isTokenValid(this._reserveToken))return;let r="reserve";if(this._ongoingFetches.has(r))return;let n=this._fetchToken("reserve");this._ongoingFetches.set(r,n),n.then(o=>{this._reserveToken=o}).catch(o=>{this._logger.error(this._ctx,`Failed to refresh reserve auto mode token: ${o instanceof Error?o.message:String(o)}`)}).finally(()=>{this._ongoingFetches.delete(r)})}async _acquireActiveToken(r){if(this._isTokenValid(this._reserveToken)){let c=this._reserveToken;return this._reserveToken=void 0,c}let n=`active:${r}`,o=this._ongoingFetches.get(n);if(o)return o;let s=this._fetchToken("active").finally(()=>{this._ongoingFetches.delete(n)});return this._ongoingFetches.set(n,s),s}_refreshStandbyInBackground(r){let n=`standby:${r}`;if(this._ongoingFetches.has(n))return;let o=this._fetchToken("standby");this._ongoingFetches.set(n,o),o.then(s=>{let c=this._autoModelCache.get(r);c&&(c.active&&c.active.sessionToken===s.sessionToken||(c.standby=s,this._ongoingFetches.delete(n)))}).catch(s=>{this._logger.error(this._ctx,`Failed to refresh standby auto mode token for ${r}: ${s instanceof Error?s.message:String(s)}`),this._ongoingFetches.delete(n)})}async _fetchToken(r){let n=Date.now();try{let o=await Y$e(this._ctx,"/models/session",JSON.stringify({auto_mode:{model_hints:["auto"]}}));if(!o.ok)throw new Error(`Auto mode API returned status ${o.status}`);let s=await o.json(),c=s.selected_model,l=s.session_token,u=s.expires_at*1e3,d=s.discounted_costs?.[c];return this._logger.info(this._ctx,`Fetched auto model for ${r} in ${Date.now()-n}ms: ${c}`),{model:c,sessionToken:l,expiration:u,discountedCost:d}}catch(o){throw this._logger.error(this._ctx,`Failed to fetch auto mode model for ${r}: ${o instanceof Error?o.message:String(o)}`),o}}_pruneExpiredTokens(r){r.active&&!this._isTokenValid(r.active)&&(r.active=void 0),r.standby&&!this._isTokenValid(r.standby)&&(r.standby=void 0)}_isTokenValid(r){return!!r&&r.expiration>Date.now()}_isExpiringSoon(r){return r?r.expiration-Date.now()<=t.EXPIRY_THRESHOLD_MS:!1}};var NKe="Auto",K_="auto";var xo=class t{static{a(this,"ModelPickerUtils")}static async formatModelDisplayName(e,r,n){if(!r)return;let o=n?.trim();if(o){try{let u=(await new $a(e.get(ti)).getStoredModelConfigs(o))?.[r]?.modelCapabilities?.name?.trim();if(u)return`${u} (${o})`}catch{}return`${r} (${o})`}try{let l=(await e.get(xs).getMetadata()).find(u=>u.id===r);if(l)return`${l.name}`}catch{}return`${r}`}static async getModelConfiguration(e,r,n){let o=await e.get(Ft).getToken(),s=!!o.userInfo?.isTBBEnabled,c=!!o.userInfo?.isFreeUser,l=e.get(Eu);if(!s&&l.quotaExhausted&&!c){let u=await e.get(xs).getFallbackModel();if(u?.id)return e.get(tl).getBestChatModelConfig([u.id])}if(r)return e.get(tl).getBestChatModelConfig(DS(r,s),n);throw new Error("Model is not specified")}static async getModelConfigurationById(e,r,n,o){if(!r)throw new Error("Model is not specified");if(r===K_)return await e.get(VK).resolveModelConfiguration(n??"unknown",o);let s=await e.get(tl).getModelConfigurationById(r);if(!s)throw new Error(`No model configuration found for id '${r}'`);return s}static setUserSelectedReasoningEffort(e,r,n){if(!n)return r;let o=r.reasoningEfforts;return o&&o.length>0&&!o.includes(n)?(ot.warn(e,`User-selected reasoning effort '${n}' for model '${r.modelId}' is not in supported list [${o.join(", ")}].`),r):(r.userSelectedReasoningEffort=n,r)}static overrideMaxRequestTokens(e,r){return typeof r!="number"||!Number.isFinite(r)||r<=0||(e.maxRequestTokens=e.maxLongContextTokens===void 0?Math.min(e.maxRequestTokens,r):Math.min(e.maxLongContextTokens,r)),e}static applyModelConfigurationOverrides(e,r,n){return t.setUserSelectedReasoningEffort(e,r,n?.reasoningEffort),t.overrideMaxRequestTokens(r,n?.contextSize),r}static async resolveModelIdFromFamily(e,r){return r===K_?K_:(await e.get(xs).getMetadata()).find(o=>o.capabilities.family===r&&o.capabilities.type==="chat"&&o.model_picker_enabled===!0)?.id}static transformMessages(e,r){return r===wn.O1Ga||r===wn.O1Mini?e.map(n=>n.role!=="user"?{role:"user",content:n.content}:n):e}static parseModelNotSupportedReason(e){if(!e)return{};let r=e.indexOf(":");if(r===-1||r===e.length-1)return{};let n=e.slice(r+1).trim();if(!n)return{};let{modelName:o,provider:s}=nqt(n);return{modelName:o||void 0,modelProviderName:s!==void 0&&s!==""?s:void 0}}};var ih=new pe("fetchChat"),Bjo=new Set([500,502,504]),Fjo=[1e3,1e4,1e4],MKe=class{static{a(this,"OpenAIChatMLFetcher")}async fetchAndStreamChat(e,r,n,o,s){let c=String(n.properties.headerRequestId??r.ourRequestId);if(s?.isCancellationRequested)return{type:"canceled",reason:"before fetch request"};let l;try{let f=await this.fetchWithParameters(e,r.endpoint,r,n,s);if(f==="not-sent")return{type:"canceled",reason:"before fetch request"};l=f}catch(f){if(Ym(f)||!ax(f))throw f;ih.info(e,`Network error during fetch, checking connectivity before retry [${c}]: ${String(f)}`);let h=await this.retryAfterError(e,r,n,s,c);if(h&&"canceled"in h)return h.canceled;if(h&&"response"in h)l=h.response;else throw f}if(s?.isCancellationRequested)return this.destroyResponseBody(e,l),{type:"canceled",reason:"after fetch request"};if(qjo(l.status)){ih.info(e,`Server returned ${l.status}, checking network connectivity before retry [${c}]`);let f=await this.retryAfterError(e,r,n,s,c);if(f&&"canceled"in f)return this.destroyResponseBody(e,l),f.canceled;f&&"response"in f&&(this.destroyResponseBody(e,l),l=f.response)}if(l.status!==200){let f=this.createTelemetryData(r.endpoint,e,r),h=await xo.formatModelDisplayName(e,r.model,r.modelProviderName),m=await this.handleError(e,f,l,h,r.uiKind);return m.type==="failed"?{...m,ghRequestId:l.headers.get("x-github-request-id")||void 0}:m}e.get(Eu).processQuotaHeaders(l.headers),e.get(CO).processRateLimitHeaders(l.headers);let u=VP.getStrategy(r.endpoint),d={messages:r.messages,tools:r.tools,tool_choice:r.tool_choice,temperature:r.postOptions?.temperature,topP:r.postOptions?.top_p,modelConfiguration:{modelId:r.model,maxResponseTokens:r.postOptions?.max_tokens,stream:!!r.postOptions?.stream},repoInfo:r.repoInfo,count:r.count,postOptions:r.postOptions,intentParams:{intent:r.intent,intent_threshold:r.intent_threshold,intent_model:r.intent_model,intent_tokenizer:r.intent_tokenizer,intent_content:r.intent_content},copilot_thread_id:r.copilot_thread_id,prediction:r.prediction,cancel:s,enableThinking:r.enableThinking};return u.processResponse(e,l,o,n,d)}destroyResponseBody(e,r){try{let n=r.body();n&&"destroy"in n&&typeof n.destroy=="function"?n.destroy():n instanceof ReadableStream&&n.cancel()}catch(n){ih.exception(e,n,"Error destroying response stream")}}async retryAfterError(e,r,n,o,s){if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled before connectivity check"}};let c=await jjo(e,r.copilotApiBaseUrl,r.authToken,o);if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled during connectivity check"}};if(!c.retryRequest){ih.info(e,`Not retrying chat request as network connectivity could not be re-established [${s}]`);return}ih.info(e,`Connectivity check passed, retrying request [${s}]`);let l=await this.fetchWithParameters(e,r.endpoint,r,n,o);return l==="not-sent"?{canceled:{type:"canceled",reason:"before retry fetch request"}}:o?.isCancellationRequested?(this.destroyResponseBody(e,l),{canceled:{type:"canceled",reason:"after retry fetch request"}}):{response:l}}createTelemetryData(e,r,n){return Vt.createAndMarkAsIssued({endpoint:e,engineName:n.engineName,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s){let c=VP.getStrategy(r),l={messages:n.messages,tools:n.tools,tool_choice:n.tool_choice,temperature:n.postOptions?.temperature,topP:n.postOptions?.top_p,modelConfiguration:{modelId:n.model,providerName:n.modelProviderName,maxResponseTokens:n.postOptions?.max_tokens,stream:n.postOptions?.stream!==!1,supportsThinking:n.supportsThinking,reasoningEfforts:n.reasoningEfforts,userSelectedReasoningEffort:n.userSelectedReasoningEffort,apiType:n.apiType},repoInfo:n.repoInfo,count:n.count,postOptions:n.postOptions,intentParams:{intent:n.intent,intent_threshold:n.intent_threshold,intent_model:n.intent_model,intent_tokenizer:n.intent_tokenizer,intent_content:n.intent_content},copilot_thread_id:n.copilot_thread_id,prediction:n.prediction,cancel:s,enableThinking:n.enableThinking},u=c.buildRequestBody(e,l);return VEn(u,l.modelConfiguration),s?.isCancellationRequested?"not-sent":await Ujo(e,n.messages,n.copilotApiBaseUrl,n.engineName,r,n.ourRequestId,u,n.authToken,n.uiKind,o,n.llmInteraction,n.apiKey,n.modelProviderName,n.copilotEditsSessionHeader,n.copilotSessionToken,s,n.supportsAdaptiveThinking,n.apiType)}async handleError(e,r,n,o,s){if(n.clientError&&!n.headers.get("x-github-request-id")){let f=`Last response was a ${n.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;ih.error(e,f),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else r.properties.error=`Response status was ${n.status}`;if(r.properties.status=String(n.status),ft(e,"request.shownWarning",r),n.status===401)try{let f=await n.text(),h=JSON.parse(f);if(h.authorize_url)return{type:"authRequired",reason:"not authorized",authUrl:h.authorize_url}}catch{}if(n.status===401||n.status===403)return e.get(Ft).resetToken("chat_messages",n.status),{type:"failed",reason:`token expired or invalid: ${n.status}`,code:n.status};if(n.status===499)return ih.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server",code:n.status};let c=await n.text();if(n.status===429){let f=mM(n),h;try{let m=JSON.parse(c);h=m?.error?.code??m?.code}catch{}return cr(e,"request.throttled",{requestSource:s??"unknown"},{retryAfter:f??-1}),{type:"failed",reason:"rate limit exceeded",code:n.status,retryAfter:f,capiErrorCode:h}}if(n.status===466)return ih.info(e,c),{type:"failed",reason:`client not supported: ${c}`,code:n.status};if(n.status===400){let f=Y_.translate400Reason(c,o);if(f!==void 0)return{type:"failed",reason:f,code:n.status}}if(n.status===424)return{type:"failedDependency",reason:c};let u=n.headers.get("retry-after"),d=await e.get(Ft).getToken();return n.status===402?{type:"failed",reason:Y_.translate402Reason(c,{retryAfterHeader:u??void 0,retryAfterSeconds:mM(n),copilotPlan:d.userInfo?.copilotPlan,isTBBEnabled:d.userInfo?.isTBBEnabled,canUpgradePlan:d.userInfo?.canUpgradePlan,overageEnabled:e.get(Eu).overageEnabled}),code:n.status}:n.status===503?{type:"failed",reason:c,code:n.status}:(ih.error(e,"Unhandled status from server:",n.status,c),{type:"failed",reason:`unhandled status from server: ${n.status} ${c}`,code:n.status})}};async function Ujo(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_){let v=n===""&&o===""?r:wa(r,n,o),b=d.extendedBy({endpoint:o,engineName:n,uiKind:u});UYe(c,b,["messages"]),b.properties.headerRequestId=s,ft(t,"request.sent",b);let T=El(),w=i_n(u),R={...Vh(t),...f.toCapiHeaders()};wB()&&(R=await z$e(t,R)),c.messages?.some(D=>Array.isArray(D.content)?D.content.some(N=>"image_url"in N):!1)&&(R["Copilot-Vision-Request"]="true");let x=_==="messages"&&!!h;h&&(_==="messages"?(R["x-api-key"]=h,R["anthropic-version"]=QEn):R["api-key"]=h),g&&(R[mq]=g),A&&(R["copilot-session-token"]=A),o==="v1/messages"&&!E&&(R["anthropic-beta"]=kYe),c.messages&&c.messages.forEach(D=>{Qjo(D)&&D.tool_calls&&(D.tool_calls=D.tool_calls.map(N=>d_n(N)))});let P=kle(()=>wKe(t)?new PKe(t):void 0,void 0);return tz(t,v,l,w,s,c,y,R,void 0,m,P,e,x).then(D=>{let N=j3(D);b.extendWithRequestId(N);let L=El()-T;return b.measurements.totalTimeMs=L,ih.info(t,`Request ${s} at <${v}> finished with ${D.status} status after ${L}ms`),ih.debug(t,"request.response properties",b.properties),ih.debug(t,"request.response measurements",b.measurements),ih.debug(t,"messages:",JSON.stringify(e)),ft(t,"request.response",b),P?new DKe(D,P,s,T):D}).catch(D=>{if(Ym(D))throw D;let N=b.extendedBy({error:"Network exception"});ft(t,"request.shownWarning",N),b.properties.message=String(Jh(D,"name")??""),b.properties.code=String(Jh(D,"code")??""),b.properties.errno=String(Jh(D,"errno")??""),b.properties.type=String(Jh(D,"type")??"");let L=El()-T;throw b.measurements.totalTimeMs=L,ih.info(t,`Request ${s} at <${v}> rejected with ${String(D)} after ${L}ms`),ih.debug(t,"request.error properties",b.properties),ih.debug(t,"request.error measurements",b.measurements),ft(t,"request.error",b),D}).finally(()=>{cue(t,e,b)})}a(Ujo,"fetchWithInstrumentation");function Qjo(t){return"tool_calls"in t}a(Qjo,"isChatMessageWithToolCalls");function qjo(t){return Bjo.has(t)}a(qjo,"shouldRetryStatusCode");async function jjo(t,e,r,n,o=Fjo){let s=t.get(nr),c=new URL("_ping",e).href,l,u;for(let d of o){if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};if(ih.info(t,`Waiting ${d}ms before pinging CAPI to check network connectivity...`),n){let f;try{await Promise.race([MC(d),new Promise(h=>{if(n.isCancellationRequested){h();return}f=n.onCancellationRequested(()=>{h()})})])}finally{f?.dispose()}}else await MC(d);if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};try{let f=await s.fetch(c,{method:"GET",headers:{Authorization:`Bearer ${r}`}});if(f.status>=200&&f.status<300)return ih.info(t,"CAPI ping successful, proceeding with chat request retry..."),{retryRequest:!0,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};l=`Status ${f.status}: ${f.statusText??""}`,u=f.headers.get("x-github-request-id")??void 0,ih.info(t,`CAPI ping returned status ${f.status}, retrying ping...`)}catch(f){l=String(f),u=void 0,ih.info(t,`CAPI ping failed with error, retrying ping: ${l}`)}}return ih.info(t,`Network connectivity could not be re-established after ${o.length} attempts`),{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u}}a(jjo,"checkNetworkConnectivity");p();var Hjo=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function OKe(t){let e=t.slice();return e.reverse(),Yvn(e)||Yvn(e.filter(r=>r.trim().length>0))}a(OKe,"isRepetitive");function Yvn(t){let e=Gjo(t);for(let r of Hjo){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(Gjo,"kmp_prefix_function");Mo();var cc=class{constructor(e){this.ctx=e;this.fetcher=new MKe}static{a(this,"ChatMLFetcher")}async fetchResponse(e,r,n,o,s,c){let l=performance.now(),u=Nt(),d={n:e.num_suggestions??1,temperature:e.temperature??0,stop:e.stop,top_p:e.topP??1,copilot_thread_id:e.copilot_thread_id,prediction:e.prediction},f=e.modelConfiguration;f&&(e.prediction?.content||delete d.prediction,e.prediction||e.modelConfiguration?.providerName===void 0&&f.maxResponseTokens!==void 0&&(d.max_tokens=f.maxResponseTokens),d.stream=!!f.stream),e.logitBias&&(d.logit_bias=e.logitBias);let h=e.chatModeKind==="Ask",m=await this.ctx.get(Ft).getToken(),g=!h&&Rt(this.ctx,ze.EnableThinking);if(g&&e.modelConfiguration?.providerName===void 0&&$En(e.modelConfiguration?.modelId)&&e.uiKind==="agentPanel")if(e.endpoint==="v1/messages"&&e.modelConfiguration?.supportsAdaptiveThinking){d.adaptive_thinking=!0;let D=vO(e.modelConfiguration?.reasoningEfforts,e.modelConfiguration?.userSelectedReasoningEffort)??"medium";D!=="none"&&(d.thinking_effort=D)}else{let D=Rt(this.ctx,ze.AnthropicThinkingBudgetToken);if(D&&D>0){let N=D<1024?1024:D;d.thinking_budget=Math.min(32e3,e.modelConfiguration.maxResponseTokens-1,N)}}let A,y,E,_;if(e.modelConfiguration?.providerName){if(!fq(m))throw new Error("Bring Your Own Key (BYOK) is not available for your account.");if(E=await _Ye(this.ctx,e.modelConfiguration?.providerName,e.modelConfiguration.modelId),_=e.modelConfiguration.providerName,e.intentParams=void 0,e.modelConfiguration?.providerName===no.Azure)if(e.modelConfiguration.deploymentUrl)A=SEn(e.modelConfiguration.modelId,e.modelConfiguration.deploymentUrl),y="",e.engineName="";else throw new Error(`No deployment URL found for Azure model: ${e.modelConfiguration.modelId}`);else if(Zle(e.modelConfiguration?.providerName))A=iue[e.modelConfiguration?.providerName],y=e.endpoint??"completions",e.authToken=E;else{if(!e.modelConfiguration.deploymentUrl)throw new Error(`No endpoint URL found for custom endpoint provider "${e.modelConfiguration.providerName}" model: ${e.modelConfiguration.modelId}`);if(!E)throw new Error(`No API key found for custom endpoint provider "${e.modelConfiguration.providerName}" model: ${e.modelConfiguration.modelId}`);let D=e.modelConfiguration.apiType??Exe;A=EYe(e.modelConfiguration.deploymentUrl,D),y=bEn(D),e.authToken=E}}else{if(A=ux(this.ctx,m,e.copilotApiProvider??"api"),e.endpoint)y=e.endpoint;else{let D=f?NYe(this.ctx,f):!1;y=DYe(f,D)}ot.debug(this.ctx,`Endpoint routing: model=${f?.modelId}, supportedEndpoints=${JSON.stringify(f?.supportedEndpoints)}, selected=${y}`)}let v=f?.copilotSessionToken,b=e.authToken??m.token,T=VP.getStrategy(y),w=e.engineName??T.engineName,R={messages:e.messages,repoInfo:void 0,ourRequestId:u,copilotApiBaseUrl:A,engineName:w,endpoint:y,count:e.num_suggestions??1,uiKind:e.uiKind,postOptions:d,authToken:b,apiKey:E,modelProviderName:_,apiType:f?.apiType,...e.intentParams,llmInteraction:e.llmInteraction,prediction:e.prediction,copilotEditsSessionHeader:e.copilotEditsSessionHeader,copilotSessionToken:v,supportsThinking:f?.supportsThinking,supportsAdaptiveThinking:f?.supportsAdaptiveThinking,reasoningEfforts:f?.reasoningEfforts,userSelectedReasoningEffort:f?.userSelectedReasoningEffort,enableThinking:g};f&&(R.model=f.modelId),e.tools&&e.tools?.length>0&&(f===void 0||f.toolCalls)&&(R.tools=e.tools,R.tool_choice=e.tool_choice??"auto");let x=await this.fetch(R,o,r,n);if(c){let D=c.maxRetryAttempts??3;for(let N=1;N<=D&&!(!c.shouldRetry(x)||x.type==="failed"&&x.noRetry);N++){let L=x;if(await c.onRetry?.(L,N),L.type==="failed"&&L.retryAfter!==void 0&&L.retryAfter>0){let B=L.retryAfter;if(await new Promise(j=>{let M=setTimeout(()=>{O.dispose(),j()},B*1e3),O=r.onCancellationRequested(()=>{clearTimeout(M),O.dispose(),j()})}),r.isCancellationRequested)break}x=await this.fetch(R,o,r,n),cr(this.ctx,"request.throttled.retry",{requestSource:e.uiKind??"unknown",resultType:x.type,modelId:f?f.providerName?"custom-byok":f.modelId:"unknown"},{retryAfter:L.type==="failed"?L.retryAfter??-1:-1,resultCode:x.type==="failed"?x.code??-1:-1})}}let P=Math.round(performance.now()-l);return this.sendFetchResponseTelemetry(e,x,n,P,y),this.trackTurnCredits(e,x),Rle(()=>{if(s)return s.persistLLMRequest({requestId:R.ourRequestId,messages:R.messages,tools:R.tools,model:R.model,response:x,durationMs:P})},D=>ot.debug(this.ctx,"persistLLMRequest failed",D)),x}async fetch(e,r,n,o){try{let s=await this.fetcher.fetchAndStreamChat(this.ctx,e,o.extendedBy({uiKind:e.uiKind}),r||(()=>{}),n);switch(s.type){case"success":return await this.processSuccessfulResponse(e,s,e.ourRequestId,o);case"canceled":return this.processCanceledResponse(s,e.ourRequestId);case"failed":case"failedDependency":return this.processFailedResponse(s,e.ourRequestId);case"authRequired":return{type:"agentAuthRequired",reason:"Agent authentication required.",authUrl:s.authUrl,requestId:e.ourRequestId}}}catch(s){return this.processError(s,e.ourRequestId)}}async processSuccessfulResponse(e,r,n,o){let s=[],c=Sxe(r.chatCompletions,u=>this.postProcess(u,o));ot.debug(this.ctx,`Process success response for request ${e.ourRequestId} with chatParams: ${JSON.stringify(e,null,2)}`);let l=0;for await(let u of c)ot.debug(this.ctx,`Received choice #${l} for request ${e.ourRequestId}: ${JSON.stringify(u,null,2)}`),s.push(u),l++;if(s.length==1){let u=s[0];switch(u.finishReason){case"stop":return{type:"success",value:Pn(u.message?.content)??"",toolCalls:u.tool_calls,requestId:n,numTokens:u.numTokens,copilotEditsSessionHeader:u.copilotEditsSessionHeader,thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"tool_calls":return{type:"tool_calls",toolCalls:u.tool_calls,requestId:n,copilotEditsSessionHeader:u.copilotEditsSessionHeader,thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"content_filter":return{type:"filtered",reason:"Response got filtered.",requestId:n,usage:u.usage,copilot_usage:u.copilot_usage};case"length":return{type:"length",reason:"Response too long.",requestId:n,truncatedValue:Pn(u.message?.content)??"",thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"DONE":return{type:"no_finish_reason",reason:"No finish reason received.",requestId:n};default:return{type:"unknown",reason:"Unknown finish reason received.",requestId:n}}}else if(s.length>1){let u=s.filter(d=>d.finishReason=="stop"||d.finishReason=="tool_calls");if(u.length>0)return{type:"successMultiple",value:u.map(d=>Pn(d.message.content)),toolCalls:u.map(d=>d.tool_calls).filter(d=>d),requestId:n,copilotEditsSessionHeader:u[0].copilotEditsSessionHeader,usage:u[0].usage,copilot_usage:u[0].copilot_usage}}return{type:"no_choices",reason:"Response contained no choices.",requestId:n}}postProcess(e,r){return OKe(e.tokens)?(r.extendWithRequestId(e.requestId),ft(this.ctx,"conversation.repetition.detected",r,0),e.finishReason!==""?e:void 0):e.message?e:void 0}processCanceledResponse(e,r){return ot.debug(this.ctx,"Cancelled after awaiting fetchConversation"),{type:"canceled",reason:e.reason,requestId:r}}processFailedResponse(e,r){return e?.reason.includes("filtered as off_topic by intent classifier")?{type:"offTopic",reason:e.reason,requestId:r}:e?.reason.includes("model is not supported")?{type:"model_not_supported",reason:e.reason,requestId:r}:e?.reason.includes("model max prompt tokens exceeded")?{type:"model_max_prompt_tokens_exceeded",reason:e.reason,requestId:r}:{type:"failed",reason:e.reason,requestId:r,code:e.type==="failed"?e.code:void 0,retryAfter:e.type==="failed"?e.retryAfter:void 0,ghRequestId:e.type==="failed"?e.ghRequestId:void 0,capiErrorCode:e.type==="failed"?e.capiErrorCode:void 0}}processError(e,r){if(Ym(e))return{type:"canceled",reason:"network request aborted",requestId:r};{ot.exception(this.ctx,e,"Error on conversation request");let n="Error on conversation request. Read more from logs.";if(e instanceof Error){let o=e.message;if(o&&o.trim().length>0){let s=360;o.length<=s?n=`Error on conversation request: ${o}`:n=`Error on conversation request: ${o.substring(0,s)}... Read more from logs.`}}return{type:"failed",reason:n,requestId:r,noRetry:e instanceof $K?!0:void 0}}}trackTurnCredits(e,r){if(!e.turnId)return;let n="copilot_usage"in r?r.copilot_usage:void 0;!n||n.total_nano_aiu<=0||this.ctx.get(Eu).setLastCopilotUsage(n.total_nano_aiu,e.turnId)}sendFetchResponseTelemetry(e,r,n,o,s){let c={responseType:r.type},l={duration:o};e.modelConfiguration&&!e.modelConfiguration?.providerName&&(c.modelId=e.modelConfiguration.modelId,c.modelFamily=e.modelConfiguration.modelFamily,c.maxRequestTokens=String(e.modelConfiguration.maxRequestTokens),c.userSelectedReasoningEffort=e.modelConfiguration.userSelectedReasoningEffort??""),"reason"in r&&r.reason&&(c.reason=r.reason.substring(0,360)),"code"in r&&r.code!==void 0&&(c.statusCode=String(r.code)),r.type==="failed"&&r.noRetry&&(c.isMidStreamError="true"),c.uiKind=e.uiKind,s&&(c.route=s),r.usage&&(l.completionTokens=r.usage.completion_tokens,l.promptTokens=r.usage.prompt_tokens,l.totalTokens=r.usage.total_tokens,r.usage.prompt_tokens_details?.cached_tokens!==void 0&&(l.cachedTokens=r.usage.prompt_tokens_details.cached_tokens)),r.copilot_usage&&(l.copilotUsageTotalNanoAiu=r.copilot_usage.total_nano_aiu,r.copilot_usage.token_details?.length&&(c.copilotUsageTokenDetails=JSON.stringify(r.copilot_usage.token_details))),n.properties.conversationId&&(c.conversationId=n.properties.conversationId),n.properties.messageId&&(c.messageId=n.properties.messageId),n.properties.messageSource&&(c.messageSource=n.properties.messageSource),cr(this.ctx,"chatfetcher.response",c,l)}};p();p();p();p();p();p();p();p();var Zh=class{static{a(this,"ConversationInspector")}};p();p();var Xh=class{constructor(){this.skills=[]}static{a(this,"ConversationSkillRegistry")}registerSkill(e){if(this.getSkill(e.id))throw new Error(`Skill with id '${e.id}' already registered`);this.skills.push(e)}getSkill(e){return this.skills.find(r=>r.id===e)}getDescriptors(){return[...this.skills]}},iqt=class{constructor(e,r,n){this.delegate=e;this.stepId=r;this.stepTitle=n}static{a(this,"StepReportingSkillResolver")}async resolveSkill(e){await e.steps.start(this.stepId,this.stepTitle);try{let r=await this.delegate.resolveSkill(e);return r||await e.steps.finish(this.stepId),r}catch(r){throw await e.steps.error(this.stepId,r instanceof Error?r.message:`Error resolving ${this.stepTitle}`),r}}},oqt=class{constructor(e,r){this.delegate=e;this.stepId=r}static{a(this,"StepReportingSkillProcessor")}value(){return this.delegate.value()}async processSkill(e,r){try{let n=await this.delegate.processSkill(e,r);return await r.steps.finish(this.stepId),n}catch(n){throw await r.steps.error(this.stepId,n instanceof Error?n.message:`Error processing ${this.stepId}`),n}}},_g=class{constructor(e,r,n,o,s,c="explicit",l=[],u=()=>!0){this.id=e;this._description=r;this.stepTitle=n;this._resolver=o;this._processor=s;this.type=c;this._examples=l;this._isAvailable=u}static{a(this,"SingleStepReportingSkill")}description(){return this._description}examples(){return this._examples}isAvailable(e){return this._isAvailable(e)}resolver(e){return new iqt(this._resolver(e),this.id,this.stepTitle)}processor(e){return new oqt(this._processor(e),this.id)}};p();p();var $l=class extends Error{constructor(r){super(`No instance of ${r.name} has been registered`);this.ctor=r;this.name=`UnregisteredContextErrorFor${r.name}`}static{a(this,"UnregisteredContextError")}},gue=class{constructor(){this.instances=new Map}static{a(this,"Context")}get(e){let r=this.tryGet(e);if(r)return r;throw new $l(e)}tryGet(e){let r=this.instances.get(e);if(r)return r}set(e,r){if(this.tryGet(e))throw new Error(`An instance of ${e.name} has already been registered. Use forceSet() if you're sure it's a good idea.`);this.assertIsInstance(e,r),this.instances.set(e,r)}forceSet(e,r){this.assertIsInstance(e,r),this.instances.set(e,r)}assertIsInstance(e,r){if(!(r instanceof e)){let n=JSON.stringify(r);throw new Error(`The instance you're trying to register for ${e.name} is not an instance of it (${n}).`)}}};p();var Kvn=new pe("EncodingConfigurationService"),kO=class{constructor(e){this.ctx=e;this.fileEncodingCache=new Map}static{a(this,"EncodingConfigurationService")}async getEncodingForFile(e){if(this.fileEncodingCache.has(e))return this.fileEncodingCache.get(e);let r=await this.requestEncodingFromClient(e)??"utf8";return this.fileEncodingCache.set(e,r),r}handleConfigurationChange(e){if(e.copilot?.encodingChanges){if(e.copilot.encodingChanges.length>0)for(let r of e.copilot.encodingChanges)this.fileEncodingCache.delete(r),Kvn.debug(this.ctx,`Cache invalidated for file: ${r}`)}else this.fileEncodingCache.clear(),Kvn.debug(this.ctx,"All encoding cache cleared")}clearCache(){this.fileEncodingCache.clear()}};p();p();p();p();p();var Jvn=class t{static{a(this,"Node")}static{this.Undefined=new t(void 0)}constructor(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}};p();var $jo=globalThis.performance&&typeof globalThis.performance.now=="function",LKe=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=$jo&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}};var Zvn=!1,Vjo=!1,Gxe;(M=>{M.None=a(()=>z_.None,"None");function e(O){if(Vjo){let{onDidAddListener:U}=O,q=Hxe.create(),Q=0;O.onDidAddListener=()=>{++Q===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),q.print()),U?.()}}}a(e,"_addLeakageTraceLogic");function r(O,U){return g(O,()=>{},0,void 0,!0,void 0,U)}M.defer=r,a(r,"defer");function n(O){return(U,q=null,Q)=>{let Y=!1,W;return W=O(V=>{if(!Y)return W?W.dispose():Y=!0,U.call(q,V)},null,Q),Y&&W.dispose(),W}}M.once=n,a(n,"once");function o(O,U){return M.once(M.filter(O,U))}M.onceIf=o,a(o,"onceIf");function s(O,U,q){return h((Q,Y=null,W)=>O(V=>Q.call(Y,U(V)),null,W),q)}M.map=s,a(s,"map");function c(O,U,q){return h((Q,Y=null,W)=>O(V=>{U(V),Q.call(Y,V)},null,W),q)}M.forEach=c,a(c,"forEach");function l(O,U,q){return h((Q,Y=null,W)=>O(V=>U(V)&&Q.call(Y,V),null,W),q)}M.filter=l,a(l,"filter");function u(O){return O}M.signal=u,a(u,"signal");function d(...O){return(U,q=null,Q)=>{let Y=FEn(...O.map(W=>W(V=>U.call(q,V))));return m(Y,Q)}}M.any=d,a(d,"any");function f(O,U,q,Q){let Y=q;return s(O,W=>(Y=U(Y,W),Y),Q)}M.reduce=f,a(f,"reduce");function h(O,U){let q,Q={onWillAddFirstListener(){q=O(Y.fire,Y)},onDidRemoveLastListener(){q?.dispose()}};U||e(Q);let Y=new rT(Q);return U?.add(Y),Y.event}a(h,"snapshot");function m(O,U){return U instanceof Array?U.push(O):U&&U.add(O),O}a(m,"addAndReturnDisposable");function g(O,U,q=100,Q=!1,Y=!1,W,V){let z,ie,H,te=0,le,Le={leakWarningThreshold:W,onWillAddFirstListener(){z=O(Oe=>{te++,ie=U(ie,Oe),Q&&!H&&(ge.fire(ie),ie=void 0),le=a(()=>{let we=ie;ie=void 0,H=void 0,(!Q||te>1)&&ge.fire(we),te=0},"doFire"),typeof q=="number"?(clearTimeout(H),H=setTimeout(le,q)):H===void 0&&(H=0,queueMicrotask(le))})},onWillRemoveListener(){Y&&te>0&&le?.()},onDidRemoveLastListener(){le=void 0,z.dispose()}};V||e(Le);let ge=new rT(Le);return V?.add(ge),ge.event}M.debounce=g,a(g,"debounce");function A(O,U=0,q){return M.debounce(O,(Q,Y)=>Q?(Q.push(Y),Q):[Y],U,void 0,!0,void 0,q)}M.accumulate=A,a(A,"accumulate");function y(O,U=(Q,Y)=>Q===Y,q){let Q=!0,Y;return l(O,W=>{let V=Q||!U(W,Y);return Q=!1,Y=W,V},q)}M.latch=y,a(y,"latch");function E(O,U,q){return[M.filter(O,U,q),M.filter(O,Q=>!U(Q),q)]}M.split=E,a(E,"split");function _(O,U=!1,q=[],Q){let Y=q.slice(),W=O(ie=>{Y?Y.push(ie):z.fire(ie)});Q&&Q.add(W);let V=a(()=>{Y?.forEach(ie=>z.fire(ie)),Y=null},"flush"),z=new rT({onWillAddFirstListener(){W||(W=O(ie=>z.fire(ie)),Q&&Q.add(W))},onDidAddFirstListener(){Y&&(U?setTimeout(V):V())},onDidRemoveLastListener(){W&&W.dispose(),W=null}});return Q&&Q.add(z),z.event}M.buffer=_,a(_,"buffer");function v(O,U){return a((Q,Y,W)=>{let V=U(new T);return O(function(z){let ie=V.evaluate(z);ie!==b&&Q.call(Y,ie)},void 0,W)},"fn")}M.chain=v,a(v,"chain");let b=Symbol("HaltChainable");class T{constructor(){this.steps=[]}static{a(this,"ChainableSynthesis")}map(U){return this.steps.push(U),this}forEach(U){return this.steps.push(q=>(U(q),q)),this}filter(U){return this.steps.push(q=>U(q)?q:b),this}reduce(U,q){let Q=q;return this.steps.push(Y=>(Q=U(Q,Y),Q)),this}latch(U=(q,Q)=>q===Q){let q=!0,Q;return this.steps.push(Y=>{let W=q||!U(Y,Q);return q=!1,Q=Y,W?Y:b}),this}evaluate(U){for(let q of this.steps)if(U=q(U),U===b)break;return U}}function w(O,U,q=Q=>Q){let Q=a((...z)=>V.fire(q(...z)),"fn"),Y=a(()=>O.on(U,Q),"onFirstListenerAdd"),W=a(()=>O.removeListener(U,Q),"onLastListenerRemove"),V=new rT({onWillAddFirstListener:Y,onDidRemoveLastListener:W});return V.event}M.fromNodeEventEmitter=w,a(w,"fromNodeEventEmitter");function R(O,U,q=Q=>Q){let Q=a((...z)=>V.fire(q(...z)),"fn"),Y=a(()=>O.addEventListener(U,Q),"onFirstListenerAdd"),W=a(()=>O.removeEventListener(U,Q),"onLastListenerRemove"),V=new rT({onWillAddFirstListener:Y,onDidRemoveLastListener:W});return V.event}M.fromDOMEventEmitter=R,a(R,"fromDOMEventEmitter");function x(O,U){return new Promise(q=>n(O)(q,null,U))}M.toPromise=x,a(x,"toPromise");function P(O){let U=new rT;return O.then(q=>{U.fire(q)},()=>{U.fire(void 0)}).finally(()=>{U.dispose()}),U.event}M.fromPromise=P,a(P,"fromPromise");function D(O,U){return O(q=>U.fire(q))}M.forward=D,a(D,"forward");function N(O,U,q){return U(q),O(Q=>U(Q))}M.runAndSubscribe=N,a(N,"runAndSubscribe");class L{constructor(U,q){this._observable=U;this._counter=0;this._hasChanged=!1;let Q={onWillAddFirstListener:a(()=>{U.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{U.removeObserver(this)},"onDidRemoveLastListener")};q||e(Q),this.emitter=new rT(Q),q&&q.add(this.emitter)}static{a(this,"EmitterObserver")}beginUpdate(U){this._counter++}handlePossibleChange(U){}handleChange(U,q){this._hasChanged=!0}endUpdate(U){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(O,U){return new L(O,U).emitter.event}M.fromObservable=B,a(B,"fromObservable");function j(O){return(U,q,Q)=>{let Y=0,W=!1,V={beginUpdate(){Y++},endUpdate(){Y--,Y===0&&(O.reportChanges(),W&&(W=!1,U.call(q)))},handlePossibleChange(){},handleChange(){W=!0}};O.addObserver(V),O.reportChanges();let z={dispose(){O.removeObserver(V)}};return Q instanceof pq?Q.add(z):Array.isArray(Q)&&Q.push(z),z}}M.fromObservableLight=j,a(j,"fromObservableLight")})(Gxe||={});var sqt=class t{constructor(e){this.listenerCount=0;this.invocationCount=0;this.elapsedOverall=0;this.durations=[];this.name=`${e}_${t._idPool++}`,t.all.add(this)}static{a(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}start(e){this._stopWatch=new LKe,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}},Xvn=-1;var aqt=class t{constructor(e,r,n=(t._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e;this.threshold=r;this.name=n;this._warnCountdown=0}static{a(this,"LeakageMonitor")}static{this._idPool=1}dispose(){this._stacks?.clear()}check(e,r){let n=this.threshold;if(n<=0||r{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[n,o]of this._stacks)(!e||r{if(t instanceof aue)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new mQt(e?.onListenerError??Hle,this._options?.leakWarningThreshold??b_n):void 0,this._perfMon=this._options?._profName?new hQt(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}static{a(this,"Emitter")}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(C_n){let e=this._listeners;queueMicrotask(()=>{GQo(e,r=>r.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,r,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let d=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=new AQt(`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0]);return(this._options?.onListenerError||Hle)(f),G_.None}if(this._disposed)return G_.None;r&&(e=e.bind(r));let o=new aue(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=bxe.create(),s=this._leakageMon.check(o.stack,this._size+1)),C_n&&(o.stack=c??bxe.create()),this._listeners?this._listeners instanceof aue?(this._deliveryQueue??=new yQt,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let l=eYe(()=>{s?.(),this._removeListener(o)});return n instanceof eq?n.add(l):Array.isArray(n)&&n.push(l),l},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,n=r.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[n]=void 0;let o=this._deliveryQueue.current===this;if(this._size*HQo<=r.length){let s=0;for(let c=0;c0}};var yQt=class{constructor(){this.i=-1;this.end=0}static{a(this,"EventDeliveryQueuePrivate")}enqueue(e,r,n){this.i=0,this.end=n,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}};var S_n=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),$Qo;(n=>{function t(o){return o===n.None||o===n.Cancelled||o instanceof EQt?!0:!o||typeof o!="object"?!1:typeof o.isCancellationRequested=="boolean"&&typeof o.onCancellationRequested=="function"}n.isCancellationToken=t,a(t,"isCancellationToken"),n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Sxe.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:S_n})})($Qo||={});var EQt=class{constructor(){this._isCancelled=!1;this._emitter=null}static{a(this,"MutableToken")}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?S_n:(this._emitter||(this._emitter=new YS),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};function WQo(t){return t}a(WQo,"identity");var lKe=class{constructor(e,r){this.lastCache=void 0;this.lastArgKey=void 0;typeof e=="function"?(this._fn=e,this._computeKey=WQo):(this._fn=r,this._computeKey=e.getCacheKey)}static{a(this,"LRUCachedFunction")}get(e){let r=this._computeKey(e);return this.lastArgKey!==r&&(this.lastArgKey=r,this.lastCache=this._fn(e)),this.lastCache}};p();p();var Aq=class{constructor(e){this.executor=e;this._didRun=!1}static{a(this,"Lazy")}get hasValue(){return this._didRun}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};p();function _Qt(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(_Qt,"escapeRegExpCharacters");function R_n(t,e){if(!t||!e)return t;let r=e.length;if(r===0||t.length===0)return t;let n=0;for(;t.indexOf(e,n)===n;)n=n+r;return t.substring(n)}a(R_n,"ltrim");function uKe(t){return t.split(/\r\n|\r|\n/)}a(uKe,"splitLines");function vQt(t,e){return te?1:0}a(vQt,"compare");function dKe(t,e,r=0,n=t.length,o=0,s=e.length){for(;rd)return 1}let c=n-r,l=s-o;return cl?1:0}a(dKe,"compareSubstring");function CQt(t,e){return Ixe(t,e,0,t.length,0,e.length)}a(CQt,"compareIgnoreCase");function Ixe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return dKe(t.toLowerCase(),e.toLowerCase(),r,n,o,s);T_n(u)&&(u-=32),T_n(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(Ixe,"compareSubstringIgnoreCase");function T_n(t){return t>=97&&t<=122}a(T_n,"isLowerAsciiLetter");function k_n(t,e){let r=e.length;return e.length>t.length?!1:Ixe(t,e,0,r)===0}a(k_n,"startsWithIgnoreCase");function cue(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n0&&t.charCodeAt(0)===65279)}a(zQo,"startsWithUTF8BOM");function P_n(t){return zQo(t)?t.substr(1):t}a(P_n,"stripUTF8BOM");var I_n=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=YQo()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let r=this._data,n=r.length/3,o=1;for(;o<=n;)if(er[3*o+1])o=2*o+1;else return r[3*o+2];return 0}};function YQo(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}a(YQo,"getGraphemeBreakRawData");var x_n=class t{constructor(e){this.confusableDictionary=e}static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new Aq(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'))}static{this.cache=new lKe({getCacheKey:JSON.stringify},e=>{function r(f){let h=new Map;for(let m=0;m!f.startsWith("_")&&f in s);c.length===0&&(c=["_default"]);let l;for(let f of c){let h=r(s[f]);l=o(l,h)}let u=r(s._common),d=n(u,l);return new t(d)})}static getInstance(e){return t.cache.get(Array.from(e))}static{this._locales=new Aq(()=>Object.keys(t.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return t._locales.value}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let r=0;rD_n)return{status:"notfound",message:"File too large"};let c=await Ble(this.ctx,{uri:e},o);return c.status==="valid"?{status:"valid",document:NS.create(e,"UNKNOWN",-1,o)}:c}catch{return{status:"notfound",message:"File not found"}}}async readFileWithSize(e){let r=to(e);if(la.isRegisteredScheme(r.scheme))try{let c=this.ctx.get(la),{text:l,stat:u}=await c.readFile(e);return{text:l,fileSizeMB:u.size/1024/1024}}catch(c){if(!(c instanceof bl))throw c}let o=(await this.ctx.get(Qo).stat(e)).size/1024/1024;return o>D_n?{text:"",fileSizeMB:o}:{text:await this.doReadFile(e),fileSizeMB:o}}async doReadFile(e){let r="utf8";try{r=await this.ctx.get(SO).getEncodingForFile(e)}catch(o){if(!(o instanceof bl))throw o}let n=await this.ctx.get(Qo).readFileString(e,r);return P_n(n)}};p();function wxe(t){for(var e=[],r=1;r{if(t instanceof Aue)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new aqt(e?.onListenerError??Xle,this._options?.leakWarningThreshold??Xvn):void 0,this._perfMon=this._options?._profName?new sqt(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}static{a(this,"Emitter")}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(Zvn){let e=this._listeners;queueMicrotask(()=>{Yjo(e,r=>r.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,r,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let d=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=new lqt(`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0]);return(this._options?.onListenerError||Xle)(f),z_.None}if(this._disposed)return z_.None;r&&(e=e.bind(r));let o=new Aue(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Hxe.create(),s=this._leakageMon.check(o.stack,this._size+1)),Zvn&&(o.stack=c??Hxe.create()),this._listeners?this._listeners instanceof Aue?(this._deliveryQueue??=new uqt,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let l=xYe(()=>{s?.(),this._removeListener(o)});return n instanceof pq?n.add(l):Array.isArray(n)&&n.push(l),l},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,n=r.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[n]=void 0;let o=this._deliveryQueue.current===this;if(this._size*zjo<=r.length){let s=0;for(let c=0;c0}};var uqt=class{constructor(){this.i=-1;this.end=0}static{a(this,"EventDeliveryQueuePrivate")}enqueue(e,r,n){this.i=0,this.end=n,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}};var eCn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),Kjo;(n=>{function t(o){return o===n.None||o===n.Cancelled||o instanceof dqt?!0:!o||typeof o!="object"?!1:typeof o.isCancellationRequested=="boolean"&&typeof o.onCancellationRequested=="function"}n.isCancellationToken=t,a(t,"isCancellationToken"),n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Gxe.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:eCn})})(Kjo||={});var dqt=class{constructor(){this._isCancelled=!1;this._emitter=null}static{a(this,"MutableToken")}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?eCn:(this._emitter||(this._emitter=new rT),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};function Zjo(t){return t}a(Zjo,"identity");var BKe=class{constructor(e,r){this.lastCache=void 0;this.lastArgKey=void 0;typeof e=="function"?(this._fn=e,this._computeKey=Zjo):(this._fn=r,this._computeKey=e.getCacheKey)}static{a(this,"LRUCachedFunction")}get(e){let r=this._computeKey(e);return this.lastArgKey!==r&&(this.lastArgKey=r,this.lastCache=this._fn(e)),this.lastCache}};p();p();var kq=class{constructor(e){this.executor=e;this._didRun=!1}static{a(this,"Lazy")}get hasValue(){return this._didRun}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};p();function fqt(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(fqt,"escapeRegExpCharacters");function oCn(t,e){if(!t||!e)return t;let r=e.length;if(r===0||t.length===0)return t;let n=0;for(;t.indexOf(e,n)===n;)n=n+r;return t.substring(n)}a(oCn,"ltrim");function FKe(t){return t.split(/\r\n|\r|\n/)}a(FKe,"splitLines");function pqt(t,e){return te?1:0}a(pqt,"compare");function UKe(t,e,r=0,n=t.length,o=0,s=e.length){for(;rd)return 1}let c=n-r,l=s-o;return cl?1:0}a(UKe,"compareSubstring");function hqt(t,e){return Vxe(t,e,0,t.length,0,e.length)}a(hqt,"compareIgnoreCase");function Vxe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return UKe(t.toLowerCase(),e.toLowerCase(),r,n,o,s);tCn(u)&&(u-=32),tCn(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(Vxe,"compareSubstringIgnoreCase");function tCn(t){return t>=97&&t<=122}a(tCn,"isLowerAsciiLetter");function sCn(t,e){let r=e.length;return e.length>t.length?!1:Vxe(t,e,0,r)===0}a(sCn,"startsWithIgnoreCase");function yue(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n0&&t.charCodeAt(0)===65279)}a(Xjo,"startsWithUTF8BOM");function aCn(t){return Xjo(t)?t.substr(1):t}a(aCn,"stripUTF8BOM");var rCn=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=eHo()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let r=this._data,n=r.length/3,o=1;for(;o<=n;)if(er[3*o+1])o=2*o+1;else return r[3*o+2];return 0}};function eHo(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}a(eHo,"getGraphemeBreakRawData");var nCn=class t{constructor(e){this.confusableDictionary=e}static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new kq(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'))}static{this.cache=new BKe({getCacheKey:JSON.stringify},e=>{function r(f){let h=new Map;for(let m=0;m!f.startsWith("_")&&f in s);c.length===0&&(c=["_default"]);let l;for(let f of c){let h=r(s[f]);l=o(l,h)}let u=r(s._common),d=n(u,l);return new t(d)})}static getInstance(e){return t.cache.get(Array.from(e))}static{this._locales=new kq(()=>Object.keys(t.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return t._locales.value}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let r=0;rcCn)return{status:"notfound",message:"File too large"};let c=await Wle(this.ctx,{uri:e},o);return c.status==="valid"?{status:"valid",document:US.create(e,"UNKNOWN",-1,o)}:c}catch{return{status:"notfound",message:"File not found"}}}async readFileWithSize(e){let r=eo(e);if(ua.isRegisteredScheme(r.scheme))try{let c=this.ctx.get(ua),{text:l,stat:u}=await c.readFile(e);return{text:l,fileSizeMB:u.size/1024/1024}}catch(c){if(!(c instanceof $l))throw c}let o=(await this.ctx.get(Qo).stat(e)).size/1024/1024;return o>cCn?{text:"",fileSizeMB:o}:{text:await this.doReadFile(e),fileSizeMB:o}}async doReadFile(e){let r="utf8";try{r=await this.ctx.get(kO).getEncodingForFile(e)}catch(o){if(!(o instanceof $l))throw o}let n=await this.ctx.get(Qo).readFileString(e,r);return aCn(n)}};p();function zxe(t){for(var e=[],r=1;rr.status!=="in-progress"&&(r.response===void 0||r.response?.type==="model")),e}a(N_n,"filterConversationTurns");function SQt(t){return N_n(t).getLastTurn()?.id}a(SQt,"getLastTurnId");async function M_n(t){let e=N_n(t.conversation),r=SQt(t.conversation);if(!r)return"Nothing to dump because no request has been sent to the model yet.";let o=t.ctx.get(Ag).getDump(r),s=ZQo(o,e.turns);Nr.debug(t.ctx,`conversation.dump +`)),c+=h+n[u+1]}),c}a(zxe,"dedent");var ns=zxe;var mqt=class{constructor(){this.resolvedSkills={};this.resolutions=[]}static{a(this,"SkillDump")}},vg=class{constructor(){this.dump=new Cn(25);this.promptsDump=new Cn(1)}static{a(this,"ConversationDumper")}addResolvedSkill(e,r,n){let o=this.getDump(e);o.resolvedSkills[r]=n}getResolvedSkill(e,r){return this.getDump(e).resolvedSkills[r]}addResolution(e,r){this.getDump(e).resolutions.push(r)}getDump(e){let r=this.dump.get(e);return r||(r=new mqt,this.dump.set(e,r)),r}addPrompt(e,r,n){let o=this.promptsDump.get(e);o===void 0&&(o=new Map,this.promptsDump.set(e,o)),o.set(n,r)}getLastTurnPrompts(){if(this.promptsDump===void 0)return;let e=this.promptsDump.values().next();if(!e.done)return e.value}};function lCn(t){let e=t.copy();return e.turns=e.turns.filter(r=>r.status!=="in-progress"&&(r.response===void 0||r.response?.type==="model")),e}a(lCn,"filterConversationTurns");function gqt(t){return lCn(t).getLastTurn()?.id}a(gqt,"getLastTurnId");async function uCn(t){let e=lCn(t.conversation),r=gqt(t.conversation);if(!r)return"Nothing to dump because no request has been sent to the model yet.";let o=t.ctx.get(vg).getDump(r),s=nHo(o,e.turns);Nr.debug(t.ctx,`conversation.dump `,` -`+s);let c=await XQo(o,t.ctx);return is` - ${JQo(t.conversation,r)} - ${KQo(t.ctx)} +`+s);let c=await iHo(o,t.ctx);return ns` + ${rHo(t.conversation,r)} + ${tHo(t.ctx)} The following code can be copied into a chat simulation \`yml\` file. This response has not polluted the conversation history and did not cause any model roundtrip. \`\`\`yaml ${s} \`\`\`${c?` ${c}`:""} - `}a(M_n,"getConversationDump");function KQo(t){let e=t.get(Ir);return is` + `}a(uCn,"getConversationDump");function tHo(t){let e=t.get(Ir);return ns` - IDE: \`${e.getEditorInfo().name} (${e.getEditorInfo().version})\` - Plugin: \`${e.getEditorPluginInfo().version}\` - `}a(KQo,"getEditorInfoDumpMessage");function JQo(t,e){return is` + `}a(tHo,"getEditorInfoDumpMessage");function rHo(t,e){return ns` Debug information for the last turn of the conversation. - ConversationId: \`${t.id}\` - MessageId: \`${e}\` - `}a(JQo,"getInfoDumpMessage");async function O_n(t,e,r){let n=t.ctx.get(Yh),o="# Available skills",s=n.getDescriptors().filter(c=>t.ctx.get(zo).getSupportedSkills(t.conversation.id).includes(c.id));if(r&&(s=s.filter(c=>c.id===r)),s.length===0)return`No skill with id ${r} available`;for(let c of s)o+=` + `}a(rHo,"getInfoDumpMessage");async function dCn(t,e,r){let n=t.ctx.get(Xh),o="# Available skills",s=n.getDescriptors().filter(c=>t.ctx.get(zo).getSupportedSkills(t.conversation.id).includes(c.id));if(r&&(s=s.filter(c=>c.id===r)),s.length===0)return`No skill with id ${r} available`;for(let c of s)o+=` - ${c.id}`;t.turn.request.message&&Pn(t.turn.request.message).trim().length>0&&(o+=` **User message**: ${Pn(t.turn.request.message)}`);for(let c of s){o+=` -## ${c.id}`,o+=is` +## ${c.id}`,o+=ns` \n\n **Description** - ${c.description()}`;let l=n.getSkill(c.id),u=await l?.resolver(t).resolveSkill(t);if(u){o+=is` + ${c.description()}`;let l=n.getSkill(c.id),u=await l?.resolver(t).resolveSkill(t);if(u){o+=ns` \n\n **Resolution** \`\`\`yaml - ${fK(u)} - \`\`\``;let d=await l?.processor(t).processSkill(u,t);if(d){let f=typeof d=="string"?d:d.elide(1e3).getText();o+=is` + ${bK(u)} + \`\`\``;let d=await l?.processor(t).processSkill(u,t);if(d){let f=typeof d=="string"?d:d.elide(1e3).getText();o+=ns` \n\n **Processed value** @@ -2629,17 +2629,17 @@ ${c}`:""} **Unprocessable**`}else o+=` -**Unresolvable**`}return o}a(O_n,"getSkillsDump");function ZQo(t,e){let r={state:{skills:t.resolvedSkills},turns:e.map((n,o)=>{let s={request:Pn(n.request.message)};return n.response&&(s.response=Pn(n.response.message)),s})};return fK(r)}a(ZQo,"toSimulationFormat");async function XQo(t,e){let r=t.resolutions.map(s=>s.files).flat(),n=r.filter((s,c)=>s&&r.indexOf(s)===c),o;for(let s of n)if(s&&s.status==="included"){o||(o=`The following files have been used: -`);let c=await e.get(ii).getOrReadTextDocument(s),l;c.status==="valid"&&(l=c.document);let u=l?.getText();Nr.debug(e,`conversation.dump.file +**Unresolvable**`}return o}a(dCn,"getSkillsDump");function nHo(t,e){let r={state:{skills:t.resolvedSkills},turns:e.map((n,o)=>{let s={request:Pn(n.request.message)};return n.response&&(s.response=Pn(n.response.message)),s})};return bK(r)}a(nHo,"toSimulationFormat");async function iHo(t,e){let r=t.resolutions.map(s=>s.files).flat(),n=r.filter((s,c)=>s&&r.indexOf(s)===c),o;for(let s of n)if(s&&s.status==="included"){o||(o=`The following files have been used: +`);let c=await e.get(ni).getOrReadTextDocument(s),l;c.status==="valid"&&(l=c.document);let u=l?.getText();Nr.debug(e,`conversation.dump.file `,u),o+=` **${s.uri}** \`\`\`${l?.detectedLanguageId} ${u} -\`\`\``}return o}a(XQo,"fileDump");p();function TQt(t,e){let r=ws(e.tokenizer),n=0;for(let o of t)n+=e.baseTokensPerMessage,o.role&&(n+=r.tokenize(o.role).length),o.name&&(n+=r.tokenize(o.name).length+e.baseTokensPerName),o.content&&(n+=r.tokenize(Pn(o.content)).length);return n+=e.baseTokensPerCompletion,n}a(TQt,"countMessagesTokens");p();function L_n(t,e,r,n,o){let s=["You are an AI programming assistant.",'When asked for your name, you must respond with "GitHub Copilot".',"Follow the user's requirements carefully & to the letter.","Follow Microsoft content policies.","Avoid content that violates copyrights.",`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,"Keep your answers short and impersonal.","You can answer general programming questions and perform the following tasks:","* Ask a question about the files in your current workspace","* Explain how the code in your active editor works","* Make changes to existing code","* Review the selected code in your active editor","* Generate unit tests for the selected code","* Propose a fix for the problems in the selected code","* Scaffold code for a new file or project in a workspace","* Create a new Jupyter Notebook","* Ask questions about VS Code","* Generate query parameters for workspace search","* Ask how to do something in the terminal","* Explain what just happened in the terminal"].join(` +\`\`\``}return o}a(iHo,"fileDump");p();function Aqt(t,e){let r=ws(e.tokenizer),n=0;for(let o of t)n+=e.baseTokensPerMessage,o.role&&(n+=r.tokenize(o.role).length),o.name&&(n+=r.tokenize(o.name).length+e.baseTokensPerName),o.content&&(n+=r.tokenize(Pn(o.content)).length);return n+=e.baseTokensPerCompletion,n}a(Aqt,"countMessagesTokens");p();function fCn(t,e,r,n,o){let s=["You are an AI programming assistant.",'When asked for your name, you must respond with "GitHub Copilot".',"Follow the user's requirements carefully & to the letter.","Follow Microsoft content policies.","Avoid content that violates copyrights.",`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,"Keep your answers short and impersonal.","You can answer general programming questions and perform the following tasks:","* Ask a question about the files in your current workspace","* Explain how the code in your active editor works","* Make changes to existing code","* Review the selected code in your active editor","* Generate unit tests for the selected code","* Propose a fix for the problems in the selected code","* Scaffold code for a new file or project in a workspace","* Create a new Jupyter Notebook","* Ask questions about VS Code","* Generate query parameters for workspace search","* Ask how to do something in the terminal","* Explain what just happened in the terminal"].join(` `),c=["The active document is the source code the user is looking at right now.","You have read access to the code in the active document, files the user has recently worked with and open tabs. You are able to retrieve, read and use this code to answer questions.","You cannot retrieve code that is outside of the current project.","You can only give one reply for each conversation turn."].join(` `),l=e?`The user works in an IDE called ${e} which can be used to edit code, run and debug the user's application as well as executing tests.`:"",u=n?`The user is using ${n} as their operating system.`:"",d=o?`You use the ${o} large language model.`:"",f=r?`The user is logged in as ${r} on GitHub.`:"";return[s,u,d,f,l,c].filter(h=>h&&h!="").join(` -`)}a(L_n,"chatBasePrompt");p();p();async function yq(t){return!!(await t.get(Qt).getToken()).userInfo?.isTBBEnabled}a(yq,"isTokenBasedBillingEnabled");p();p();p();p();p();p();p();function pKe(t){return!!t&&typeof t.then=="function"}a(pKe,"isThenable");var fKe=class{constructor(e,r){this._isDisposed=!1;this._token=-1,typeof e=="function"&&typeof r=="number"&&this.setIfNotSet(e,r)}static{a(this,"TimeoutTimer")}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,r){if(this._isDisposed)throw new Lc("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new Lc("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},r))}};var eqo;(r=>{async function t(n){let o,s=await Promise.all(n.map(c=>c.then(l=>l,l=>{o||(o=l)})));if(typeof o<"u")throw o;return s}r.settled=t,a(t,"settled");function e(n){return new Promise(async(o,s)=>{try{await n(o,s)}catch(c){s(c)}})}r.withAsyncBody=e,a(e,"withAsyncBody")})(eqo||={});var B_n=class t{static{a(this,"AsyncIterableObject")}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new YS,queueMicrotask(async()=>{let n={emitOne:a(o=>this.emitOne(o),"emitOne"),emitMany:a(o=>this.emitMany(o),"emitMany"),reject:a(o=>this.reject(o),"reject")};try{await Promise.resolve(e(n)),this.resolve()}catch(o){this.reject(o)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:a(async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0}),"return")}}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}map(e){return t.map(this,e)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static async toPromise(e){let r=[];for await(let n of e)r.push(n);return r}toPromise(){return t.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};p();p();p();p();var hKe=!1,mKe=!1,Rxe=!1,tqo=!1,rqo=!1,F_n=!1,nqo=!1,iqo=!1,oqo=!1,sqo=!1;var j3,H3=globalThis,Xx;typeof H3.vscode<"u"&&typeof H3.vscode.process<"u"?Xx=H3.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Xx=process);var U_n=typeof Xx?.versions?.electron=="string",aqo=U_n&&Xx?.type==="renderer";typeof Xx=="object"?(hKe=Xx.platform==="win32",mKe=Xx.platform==="darwin",Rxe=Xx.platform==="linux",tqo=Rxe&&!!Xx.env.SNAP&&!!Xx.env.SNAP_REVISION,nqo=U_n,oqo=!!Xx.env.CI||!!Xx.env.BUILD_ARTIFACTSTAGINGDIRECTORY,rqo=!0):typeof navigator=="object"&&!aqo?(j3=navigator.userAgent,hKe=j3.indexOf("Windows")>=0,mKe=j3.indexOf("Macintosh")>=0,iqo=(j3.indexOf("Macintosh")>=0||j3.indexOf("iPad")>=0||j3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Rxe=j3.indexOf("Linux")>=0,sqo=j3?.indexOf("Mobi")>=0,F_n=!0):console.error("Unable to resolve platform.");var IQt=0;mKe?IQt=1:hKe?IQt=3:Rxe&&(IQt=2);var xQt=hKe,Q_n=mKe,q_n=Rxe;var cqo=F_n&&typeof H3.importScripts=="function",YXu=cqo?H3.origin:void 0;var TO=j3;var lqo=typeof H3.postMessage=="function"&&!H3.importScripts,KXu=(()=>{if(lqo){let t=[];H3.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),H3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var uqo=!!(TO&&TO.indexOf("Chrome")>=0),JXu=!!(TO&&TO.indexOf("Firefox")>=0),ZXu=!!(!uqo&&TO&&TO.indexOf("Safari")>=0),XXu=!!(TO&&TO.indexOf("Edg/")>=0),eed=!!(TO&&TO.indexOf("Android")>=0);var BK,wQt=globalThis.vscode;if(typeof wQt<"u"&&typeof wQt.process<"u"){let t=wQt.process;BK={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?BK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:BK={get platform(){return xQt?"win32":Q_n?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};var kxe=BK.cwd,j_n=BK.env,H_n=BK.platform,sed=BK.arch;var fqo=65,pqo=97,hqo=90,mqo=122,vq=46,yg=47,QC=92,Eq=58,gqo=63,gKe=class extends Error{static{a(this,"ErrorInvalidArgType")}constructor(e,r,n){let o;typeof r=="string"&&r.indexOf("not ")===0?(o="must not be",r=r.replace(/^not /,"")):o="must be";let s=e.indexOf(".")!==-1?"property":"argument",c=`The "${e}" ${s} ${o} of type ${r}`;c+=`. Received type ${typeof n}`,super(c),this.code="ERR_INVALID_ARG_TYPE"}};function Aqo(t,e){if(t===null||typeof t!="object")throw new gKe(e,"Object",t)}a(Aqo,"validateObject");function op(t,e){if(typeof t!="string")throw new gKe(e,"string",t)}a(op,"validateString");var qC=H_n==="win32";function os(t){return t===yg||t===QC}a(os,"isPathSeparator");function RQt(t){return t===yg}a(RQt,"isPosixPathSeparator");function _q(t){return t>=fqo&&t<=hqo||t>=pqo&&t<=mqo}a(_q,"isWindowsDeviceRoot");function AKe(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===vq&&l!==-1?++l:l=-1}return o}a(AKe,"normalizeString");function yqo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(yqo,"formatExt");function G_n(t,e){Aqo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${yqo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(G_n,"_format");var Kh={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],op(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=kxe():(s=j_n[`=${e}`]||kxe(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===QC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)os(f)&&(l=1,d=!0);else if(os(f))if(d=!0,os(s.charCodeAt(1))){let h=2,m=h;for(;h2&&os(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=AKe(r,!n,"\\",os),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){op(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return RQt(s)?"\\":t;if(os(s))if(o=!0,os(t.charCodeAt(1))){let l=2,u=l;for(;l2&&os(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&os(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){op(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return os(r)||e>2&&_q(r)&&t.charCodeAt(1)===Eq&&os(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&os(r.charCodeAt(0))){++o;let s=r.length;s>1&&os(r.charCodeAt(1))&&(++o,s>2&&(os(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return Kh.normalize(e)},relative(t,e){if(op(t,"from"),op(e,"to"),t===e)return"";let r=Kh.resolve(t),n=Kh.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===QC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===QC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===QC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===QC?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===QC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===QC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Kh.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===QC){if(e.charCodeAt(1)===QC){let r=e.charCodeAt(2);if(r!==gqo&&r!==vq)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(_q(e.charCodeAt(0))&&e.charCodeAt(1)===Eq&&e.charCodeAt(2)===QC)return`\\\\?\\${e}`;return t},dirname(t){op(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return os(o)?t:".";if(os(o)){if(r=n=1,os(t.charCodeAt(1))){let l=2,u=l;for(;l2&&os(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(os(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&op(e,"suffix"),op(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&_q(t.charCodeAt(0))&&t.charCodeAt(1)===Eq&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(os(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(os(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){op(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===Eq&&_q(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(os(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===vq?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:G_n.bind(null,"\\"),parse(t){op(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return os(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(os(o)){if(n=1,os(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),os(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===vq?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},Eqo=(()=>{if(qC){let t=/\\/g;return()=>{let e=kxe().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>kxe()})(),Cf={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:Eqo();op(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===yg)}return e=AKe(e,!r,"/",RQt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(op(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===yg,r=t.charCodeAt(t.length-1)===yg;return t=AKe(t,!e,"/",RQt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return op(t,"path"),t.length>0&&t.charCodeAt(0)===yg},join(...t){if(t.length===0)return".";let e;for(let r=0;r0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":Cf.normalize(e)},relative(t,e){if(op(t,"from"),op(e,"to"),t===e||(t=Cf.resolve(t),e=Cf.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===yg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===yg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===yg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(op(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===yg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===yg){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&op(e,"ext"),op(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===yg){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===yg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){op(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t.charCodeAt(c);if(l===yg){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===vq?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:G_n.bind(null,"/"),parse(t){op(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===yg,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===yg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===vq?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Cf.win32=Kh.win32=Kh;Cf.posix=Kh.posix=Cf;var _qo=qC?Kh.normalize:Cf.normalize,vqo=qC?Kh.isAbsolute:Cf.isAbsolute,yKe=qC?Kh.join:Cf.join,ced=qC?Kh.resolve:Cf.resolve,led=qC?Kh.relative:Cf.relative,ued=qC?Kh.dirname:Cf.dirname,$_n=qC?Kh.basename:Cf.basename,V_n=qC?Kh.extname:Cf.extname,ded=qC?Kh.format:Cf.format,fed=qC?Kh.parse:Cf.parse,ped=qC?Kh.toNamespacedPath:Cf.toNamespacedPath,FK=qC?Kh.sep:Cf.sep,hed=qC?Kh.delimiter:Cf.delimiter;p();p();function UK(t,e="unexpected state"){if(!t)throw new Lc(`Assertion Failed: ${e}`)}a(UK,"assert");function kQt(t){if(!t()){debugger;t(),Hle(new Lc("Assertion Failed"))}}a(kQt,"assertFn");function Pxe(t,e){let r=0;for(;rt.length)return!1;if(r){if(!k_n(t,e))return!1;if(e.length===t.length)return!0;let s=e.length;return e.charAt(e.length-1)===n&&s--,t.charAt(s)===n}return e.charAt(e.length-1)!==n&&(e+=n),t.indexOf(e)===0}a(W_n,"isEqualOrParent");var EKe="**",z_n="/",_Ke="[/\\\\]",vKe="[^/\\\\]",bqo=/\//g;function Y_n(t,e){switch(t){case 0:return"";case 1:return`${vKe}*?`;default:return`(?:${_Ke}|${vKe}+${_Ke}${e?`|${_Ke}${vKe}+`:""})*?`}}a(Y_n,"starsToRegExp");function Dxe(t,e){if(!t)return[];let r=[],n=!1,o=!1,s="";for(let c of t){switch(c){case e:if(!n&&!o){r.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}s+=c}return s&&r.push(s),r}a(Dxe,"splitGlobAware");function X_n(t){if(!t)return"";let e="",r=Dxe(t,z_n);if(r.every(n=>n===EKe))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===EKe){if(n)return;e+=Y_n(2,s===r.length-1)}else{let c=!1,l="",u=!1,d="";for(let f of o){if(f!=="}"&&c){l+=f;continue}if(u&&(f!=="]"||!d)){let h;f==="-"?h=f:(f==="^"||f==="!")&&!d?h="^":f===z_n?h="":h=_Qt(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${Dxe(l,",").map(g=>X_n(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=vKe;continue;case"*":e+=Y_n(1);continue;default:e+=_Qt(f)}}sNQt(l,e)).filter(l=>l!==HP),t),n=r.length;if(!n)return HP;if(n===1)return r[0];let o=a(function(l,u){for(let d=0,f=r.length;d!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(Dqo,"trivia3");function Z_n(t,e,r){let n=FK===Cf.sep,o=n?t:t.replace(bqo,FK),s=FK+o,c=Cf.sep+t,l;return r?l=a(function(u,d){return typeof u=="string"&&(u===o||u.endsWith(s)||!n&&(u===t||u.endsWith(c)))?e:null},"parsedPattern"):l=a(function(u,d){return typeof u=="string"&&(u===o||!n&&u===t)?e:null},"parsedPattern"),l.allPaths=[(r?"*/":"./")+t],l}a(Z_n,"trivia4and5");function Nqo(t){try{let e=new RegExp(`^${X_n(t)}$`);return function(r){return e.lastIndex=0,typeof r=="string"&&e.test(r)?t:null}}catch{return HP}}a(Nqo,"toRegExp");function tvn(t,e,r){return!t||typeof e!="string"?!1:MQt(t)(e,void 0,r)}a(tvn,"match");function MQt(t,e={}){if(!t)return DQt;if(typeof t=="string"||Mqo(t)){let r=NQt(t,e);if(r===HP)return DQt;let n=a(function(o,s){return!!r(o,s)},"resultPattern");return r.allBasenames&&(n.allBasenames=r.allBasenames),r.allPaths&&(n.allPaths=r.allPaths),n}return Oqo(t,e)}a(MQt,"parse");function Mqo(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(Mqo,"isRelativePattern");function Oqo(t,e){let r=rvn(Object.getOwnPropertyNames(t).map(l=>Lqo(l,t[l],e)).filter(l=>l!==HP)),n=r.length;if(!n)return HP;if(!r.some(l=>!!l.requiresSiblings)){if(n===1)return r[0];let l=a(function(f,h){let m;for(let g=0,A=r.length;g{for(let g of m){let A=await g;if(typeof A=="string")return A}return null})():null},"resultExpression"),u=r.find(f=>!!f.allBasenames);u&&(l.allBasenames=u.allBasenames);let d=r.reduce((f,h)=>h.allPaths?f.concat(h.allPaths):f,[]);return d.length&&(l.allPaths=d),l}let o=a(function(l,u,d){let f,h;for(let m=0,g=r.length;m{for(let m of h){let g=await m;if(typeof g=="string")return g}return null})():null},"resultExpression"),s=r.find(l=>!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(Oqo,"parsedExpression");function Lqo(t,e,r){if(e===!1)return HP;let n=NQt(t,r);if(n===HP)return HP;if(typeof e=="boolean")return n;if(e){let o=e.when;if(typeof o=="string"){let s=a((c,l,u,d)=>{if(!d||!n(c,l))return null;let f=o.replace("$(basename)",()=>u),h=d(f);return pKe(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(Lqo,"parseExpressionPattern");function rvn(t,e){let r=t.filter(l=>!!l.basenames);if(r.length<2)return t;let n=r.reduce((l,u)=>{let d=u.basenames;return d?l.concat(d):l},[]),o;if(e){o=[];for(let l=0,u=n.length;l{let d=u.patterns;return d?l.concat(d):l},[]);let s=a(function(l,u){if(typeof l!="string")return null;if(!u){let f;for(f=l.length;f>0;f--){let h=l.charCodeAt(f-1);if(h===47||h===92)break}u=l.substr(f)}let d=n.indexOf(u);return d!==-1?o[d]:null},"aggregate");s.basenames=n,s.patterns=o,s.allBasenames=n;let c=t.filter(l=>!l.basenames);return c.push(s),c}a(rvn,"aggregateBasenameMatches");function nvn(t){if(!t||t.trim()==="")return{pattern:t,isValid:!1,error:"Pattern cannot be empty"};let e=t.trim();return Bqo(e)?{pattern:e,isValid:!0}:{pattern:e,isValid:!1,error:"Invalid glob pattern"}}a(nvn,"validate");function ivn(t,e){let r=Dxe(e,","),n=a(o=>{if(o=o.trim(),o.length!==0){if(o==="**"||o==="**/*"||o==="*")return{pattern:o};!o.startsWith("/")&&!o.startsWith("**/")&&(o="**/"+o);for(let s of t)if(tvn(o,s))return{pattern:o,file:s}}},"patternMatches");for(let o of r){let s=n(o);if(s)return s}}a(ivn,"matches");function Bqo(t){try{let e=Dxe(t,",");if(e.length===0)return!1;for(let r of e){let n=MQt(r);if(evn(n))return!1}return!0}catch{return!1}}a(Bqo,"isValidGlob");var svn=de(require("path"));var Jh={copilotInstructions:"copilotInstructions",gitCommitInstructions:"gitCommitInstructions",agentsMdInstructions:"agentsMdInstructions",nestedAgentsMdInstructions:"nestedAgentsMdInstructions",claudeMdInstructions:"claudeMdInstructions",nestedClaudeMdInstructions:"nestedClaudeMdInstructions",customInstructionFiles:"customInstructionFiles"};var LQt=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._name=r.name??n.header?.name??Ji(n.uri).replace(".instructions.md","")}static{a(this,"CustomInstruction")}get metadata(){return this.promptFileEntry.promptPath.metadata}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get matchKind(){return this.metadata?.length?this.metadata.some(e=>e.matchKind==="ApplyToPattern")?"ApplyToPattern":"AlwaysApplied":"ApplyToPattern"}get source(){if(this.metadata?.length)return this.metadata.map(e=>e.source)}get providers(){return x3(this.metadata)}get uri(){return this.parsedPromptFile.uri}get name(){return this._name}get applyTo(){return this.parsedPromptFile.header?.applyTo||void 0}get description(){return this.promptFileEntry.promptPath.description??this.parsedPromptFile.header?.description}get content(){return this.parsedPromptFile.body?.content??""}get isReadonly(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||qle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return zQ(this.promptFileEntry.promptPath)}},avn={name:"copilot-instructions",source:Jh.copilotInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/copilot-instructions.md"]},cvn={name:"git-commit-instructions",source:Jh.gitCommitInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/git-commit-instructions.md"]},lvn={name:"agents-md-instructions",source:Jh.agentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["AGENTS.md"]},Fqo={name:"nested-agents-md-instructions",source:Jh.nestedAgentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["**/AGENTS.md"],watchable:!1,cacheable:!1},uvn={name:"claude-md-instructions",source:Jh.claudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["CLAUDE.md","CLAUDE.local.md"]},Uqo={name:"nested-claude-md-instructions",source:Jh.nestedClaudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["**/CLAUDE.md","**/CLAUDE.local.md"],watchable:!1,cacheable:!1},Qqo=[avn,cvn,lvn,Fqo,uvn,Uqo],qqo={name:"instruction-file",source:Jh.customInstructionFiles,matchKind:"ApplyToPattern",defaultRegistration:[".github/instructions/**/*.instructions.md"],globSuffix:"**/*.instructions.md"},OQt={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!0},jqo={nestedAgentsMdInstructions:"agentsMdInstructions",nestedClaudeMdInstructions:"claudeMdInstructions"};function ovn(t){return`include${t.charAt(0).toUpperCase()}${t.slice(1)}`}a(ovn,"optionKey");function BQt(t,e){if(!t?.length)return;let r=!1;for(let n of t){let o=ovn(n);if(!(o in OQt)||(r=!0,!(e[o]??OQt[o])))continue;let c=jqo[n];if(c){let l=ovn(c);if(!(e[l]??OQt[l]))continue}return!0}return r?!1:void 0}a(BQt,"shouldIncludeSource");var FQt=class{constructor(){this.store=new Map}static{a(this,"InMemoryInstructionManager")}set(e,r){r.length===0?this.store.delete(e):this.store.set(e,r)}get(e){return this.store.get(e)??[]}getAll(e){let r=[];for(let[n,o]of this.store)BQt([n],e)!==!1&&r.push(...o);return r}},Hqo=new dO;function Gqo(t,e,r,n,o){if(!t)return;let s=`${WQ}${e}`,c=Hqo.parse(s,t),l=c.body?.content??t;if(l.trim())return{matchKind:r,uri:s,name:c.header?.name??e,applyTo:c.header?.applyTo||void 0,description:c.header?.description,content:l,isReadonly:!0,isBuiltIn:!1,source:[n],providers:x3(o?[{providers:o}]:void 0)}}a(Gqo,"resolveContent");var QK=class{constructor(e,r,n){this.descriptor=e;this.manager=r;this.registry=n;this.configsByKey=new Map}static{a(this,"InstructionSlot")}set(e,r="default"){let n=Array.isArray(e)?e:e?[e]:[];this.configsByKey.set(r,n);let o=[];for(let g of this.configsByKey.values())o.push(...g);let{name:s,matchKind:c,source:l}=this.descriptor,u=this.descriptor.providers,d=o.filter(g=>g.type==="content").map(g=>{let A=g.content?.trim();return A?Gqo(A,`global-${s}`,c,l,u):void 0}).filter(g=>g!==void 0);this.manager.set(l,d);let f={source:l,matchKind:c,providers:u},h=this.descriptor.globSuffix??"",m=new Set;for(let g of this.descriptor.defaultRegistration??[])m.add(g);for(let g of o)g.type==="location"?m.add(svn.default.posix.join(g.path,h)):g.type==="file"&&m.add(un(g.uri));this._registryDisposable=this.registry.replace(this._registryDisposable,"instructions",Array.from(m),{watchable:this.descriptor.watchable??!0,cacheable:this.descriptor.cacheable??!0,metadata:f})}};function $qo(t){switch(t.type){case"content":return{type:"content",content:t.content};case"file":return{type:"file",uri:t.uri};case"location":return{type:"location",path:t.path}}}a($qo,"stripSource");var Vqo="workspace",bf=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.inMemoryManager=new FQt;let n=this.promptFileLocationRegistry;this.slotsBySource=new Map([[Jh.copilotInstructions,new QK(avn,this.inMemoryManager,n)],[Jh.gitCommitInstructions,new QK(cvn,this.inMemoryManager,n)],[Jh.agentsMdInstructions,new QK(lvn,this.inMemoryManager,n)],[Jh.claudeMdInstructions,new QK(uvn,this.inMemoryManager,n)],[Jh.customInstructionFiles,new QK(qqo,this.inMemoryManager,n)]]);for(let o of Qqo)o.defaultRegistration&&n.register("instructions",o.defaultRegistration,{watchable:o.watchable??!0,cacheable:o.cacheable??!0,metadata:{source:o.source,matchKind:o.matchKind,providers:o.providers}});this.slotsBySource.get(Jh.customInstructionFiles).set([])}static{a(this,"CustomInstructionService")}async listCustomInstructions(e,r){return(await this.ctx.get(ug).collect(this.ctx,"instructions",e,{includePlugins:r?.includePlugins})).map(o=>new LQt(o))}async getCustomInstructionById(e,r){return(await this.listCustomInstructions(e)).find(o=>o.uri===r)}setInstructionFileLocations(e,r=Vqo){this.dispatchToSlots(e,r)}dispatchToSlots(e,r){let n=Array.isArray(e)?e:[],o=new Map;for(let s of n){let c;if(s.source===void 0)c=Jh.customInstructionFiles;else if(this.slotsBySource.has(s.source))c=s.source;else{Nr.warn(this.ctx,`Ignoring instruction setting with unknown source "${String(s.source)}".`);continue}let l=o.get(c)??[];l.push($qo(s)),o.set(c,l)}for(let[s,c]of this.slotsBySource)c.set(o.get(s)??[],r)}setGlobalInstructionFiles(e){let r=(e??[]).map(n=>({...n,source:Jh.customInstructionFiles}));this.dispatchToSlots(r,"global-instruction-files")}getGlobalInstructionFiles(){return this.inMemoryManager.get(Jh.customInstructionFiles)}setGlobalCopilotInstructions(e){let r=e?[{...e,source:Jh.copilotInstructions}]:[];this.dispatchToSlots(r,"global-copilot-instructions")}setGlobalGitCommitInstructions(e){let r=e?[{...e,source:Jh.gitCommitInstructions}]:[];this.dispatchToSlots(r,"global-git-commit-instructions")}setGlobalAgentsMdInstructions(e){let r=e?[{...e,source:Jh.agentsMdInstructions}]:[];this.dispatchToSlots(r,"global-agents-md-instructions")}setGlobalClaudeMdInstructions(e){let r=e?[{...e,source:Jh.claudeMdInstructions}]:[];this.dispatchToSlots(r,"global-claude-md-instructions")}async collectAllInstructions(e,r,n={},o){let s=[];for(let c of this.inMemoryManager.getAll(n))this.matchesApplyTo(c,o)&&s.push(c);for(let c of await this.listCustomInstructions(r))this.shouldIncludeRegisteredInstruction(c,n,o)&&s.push(c);return this.emitCollectedTelemetry(s,n),s}static formatInstructions(e,r={}){if(!e||e.length===0)return;let n=[];for(let s of e)s.content.trim()&&n.push(` +`)}a(fCn,"chatBasePrompt");p();p();async function Pq(t){return!!(await t.get(Ft).getToken()).userInfo?.isTBBEnabled}a(Pq,"isTokenBasedBillingEnabled");p();p();p();p();p();p();p();function qKe(t){return!!t&&typeof t.then=="function"}a(qKe,"isThenable");var QKe=class{constructor(e,r){this._isDisposed=!1;this._token=-1,typeof e=="function"&&typeof r=="number"&&this.setIfNotSet(e,r)}static{a(this,"TimeoutTimer")}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,r){if(this._isDisposed)throw new Qc("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new Qc("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},r))}};var oHo;(r=>{async function t(n){let o,s=await Promise.all(n.map(c=>c.then(l=>l,l=>{o||(o=l)})));if(typeof o<"u")throw o;return s}r.settled=t,a(t,"settled");function e(n){return new Promise(async(o,s)=>{try{await n(o,s)}catch(c){s(c)}})}r.withAsyncBody=e,a(e,"withAsyncBody")})(oHo||={});var pCn=class t{static{a(this,"AsyncIterableObject")}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new rT,queueMicrotask(async()=>{let n={emitOne:a(o=>this.emitOne(o),"emitOne"),emitMany:a(o=>this.emitMany(o),"emitMany"),reject:a(o=>this.reject(o),"reject")};try{await Promise.resolve(e(n)),this.resolve()}catch(o){this.reject(o)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:a(async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0}),"return")}}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}map(e){return t.map(this,e)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static async toPromise(e){let r=[];for await(let n of e)r.push(n);return r}toPromise(){return t.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};p();p();p();p();var jKe=!1,HKe=!1,Yxe=!1,sHo=!1,aHo=!1,hCn=!1,cHo=!1,lHo=!1,uHo=!1,dHo=!1;var K3,J3=globalThis,sw;typeof J3.vscode<"u"&&typeof J3.vscode.process<"u"?sw=J3.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(sw=process);var mCn=typeof sw?.versions?.electron=="string",fHo=mCn&&sw?.type==="renderer";typeof sw=="object"?(jKe=sw.platform==="win32",HKe=sw.platform==="darwin",Yxe=sw.platform==="linux",sHo=Yxe&&!!sw.env.SNAP&&!!sw.env.SNAP_REVISION,cHo=mCn,uHo=!!sw.env.CI||!!sw.env.BUILD_ARTIFACTSTAGINGDIRECTORY,aHo=!0):typeof navigator=="object"&&!fHo?(K3=navigator.userAgent,jKe=K3.indexOf("Windows")>=0,HKe=K3.indexOf("Macintosh")>=0,lHo=(K3.indexOf("Macintosh")>=0||K3.indexOf("iPad")>=0||K3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Yxe=K3.indexOf("Linux")>=0,dHo=K3?.indexOf("Mobi")>=0,hCn=!0):console.error("Unable to resolve platform.");var yqt=0;HKe?yqt=1:jKe?yqt=3:Yxe&&(yqt=2);var Eqt=jKe,gCn=HKe,ACn=Yxe;var pHo=hCn&&typeof J3.importScripts=="function",Krd=pHo?J3.origin:void 0;var PO=K3;var hHo=typeof J3.postMessage=="function"&&!J3.importScripts,Jrd=(()=>{if(hHo){let t=[];J3.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),J3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var mHo=!!(PO&&PO.indexOf("Chrome")>=0),Zrd=!!(PO&&PO.indexOf("Firefox")>=0),Xrd=!!(!mHo&&PO&&PO.indexOf("Safari")>=0),end=!!(PO&&PO.indexOf("Edg/")>=0),tnd=!!(PO&&PO.indexOf("Android")>=0);var WK,_qt=globalThis.vscode;if(typeof _qt<"u"&&typeof _qt.process<"u"){let t=_qt.process;WK={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?WK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:WK={get platform(){return Eqt?"win32":gCn?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};var Kxe=WK.cwd,yCn=WK.env,ECn=WK.platform,and=WK.arch;var AHo=65,yHo=97,EHo=90,_Ho=122,Mq=46,Cg=47,HC=92,Dq=58,vHo=63,GKe=class extends Error{static{a(this,"ErrorInvalidArgType")}constructor(e,r,n){let o;typeof r=="string"&&r.indexOf("not ")===0?(o="must not be",r=r.replace(/^not /,"")):o="must be";let s=e.indexOf(".")!==-1?"property":"argument",c=`The "${e}" ${s} ${o} of type ${r}`;c+=`. Received type ${typeof n}`,super(c),this.code="ERR_INVALID_ARG_TYPE"}};function CHo(t,e){if(t===null||typeof t!="object")throw new GKe(e,"Object",t)}a(CHo,"validateObject");function cp(t,e){if(typeof t!="string")throw new GKe(e,"string",t)}a(cp,"validateString");var GC=ECn==="win32";function is(t){return t===Cg||t===HC}a(is,"isPathSeparator");function vqt(t){return t===Cg}a(vqt,"isPosixPathSeparator");function Nq(t){return t>=AHo&&t<=EHo||t>=yHo&&t<=_Ho}a(Nq,"isWindowsDeviceRoot");function $Ke(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===Mq&&l!==-1?++l:l=-1}return o}a($Ke,"normalizeString");function bHo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(bHo,"formatExt");function _Cn(t,e){CHo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${bHo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(_Cn,"_format");var em={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],cp(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=Kxe():(s=yCn[`=${e}`]||Kxe(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===HC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)is(f)&&(l=1,d=!0);else if(is(f))if(d=!0,is(s.charCodeAt(1))){let h=2,m=h;for(;h2&&is(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=$Ke(r,!n,"\\",is),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){cp(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return vqt(s)?"\\":t;if(is(s))if(o=!0,is(t.charCodeAt(1))){let l=2,u=l;for(;l2&&is(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&is(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){cp(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return is(r)||e>2&&Nq(r)&&t.charCodeAt(1)===Dq&&is(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&is(r.charCodeAt(0))){++o;let s=r.length;s>1&&is(r.charCodeAt(1))&&(++o,s>2&&(is(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return em.normalize(e)},relative(t,e){if(cp(t,"from"),cp(e,"to"),t===e)return"";let r=em.resolve(t),n=em.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===HC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===HC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===HC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===HC?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===HC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===HC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=em.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===HC){if(e.charCodeAt(1)===HC){let r=e.charCodeAt(2);if(r!==vHo&&r!==Mq)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Nq(e.charCodeAt(0))&&e.charCodeAt(1)===Dq&&e.charCodeAt(2)===HC)return`\\\\?\\${e}`;return t},dirname(t){cp(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return is(o)?t:".";if(is(o)){if(r=n=1,is(t.charCodeAt(1))){let l=2,u=l;for(;l2&&is(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(is(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&cp(e,"suffix"),cp(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&Nq(t.charCodeAt(0))&&t.charCodeAt(1)===Dq&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(is(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(is(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){cp(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===Dq&&Nq(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(is(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===Mq?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:_Cn.bind(null,"\\"),parse(t){cp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return is(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(is(o)){if(n=1,is(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),is(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===Mq?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},SHo=(()=>{if(GC){let t=/\\/g;return()=>{let e=Kxe().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>Kxe()})(),xf={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:SHo();cp(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===Cg)}return e=$Ke(e,!r,"/",vqt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(cp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Cg,r=t.charCodeAt(t.length-1)===Cg;return t=$Ke(t,!e,"/",vqt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return cp(t,"path"),t.length>0&&t.charCodeAt(0)===Cg},join(...t){if(t.length===0)return".";let e;for(let r=0;r0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":xf.normalize(e)},relative(t,e){if(cp(t,"from"),cp(e,"to"),t===e||(t=xf.resolve(t),e=xf.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===Cg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===Cg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===Cg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(cp(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Cg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===Cg){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&cp(e,"ext"),cp(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===Cg){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===Cg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){cp(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t.charCodeAt(c);if(l===Cg){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===Mq?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:_Cn.bind(null,"/"),parse(t){cp(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===Cg,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===Cg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===Mq?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};xf.win32=em.win32=em;xf.posix=em.posix=xf;var THo=GC?em.normalize:xf.normalize,IHo=GC?em.isAbsolute:xf.isAbsolute,VKe=GC?em.join:xf.join,lnd=GC?em.resolve:xf.resolve,und=GC?em.relative:xf.relative,dnd=GC?em.dirname:xf.dirname,vCn=GC?em.basename:xf.basename,CCn=GC?em.extname:xf.extname,fnd=GC?em.format:xf.format,pnd=GC?em.parse:xf.parse,hnd=GC?em.toNamespacedPath:xf.toNamespacedPath,zK=GC?em.sep:xf.sep,mnd=GC?em.delimiter:xf.delimiter;p();p();function YK(t,e="unexpected state"){if(!t)throw new Qc(`Assertion Failed: ${e}`)}a(YK,"assert");function Cqt(t){if(!t()){debugger;t(),Xle(new Qc("Assertion Failed"))}}a(Cqt,"assertFn");function Jxe(t,e){let r=0;for(;rt.length)return!1;if(r){if(!sCn(t,e))return!1;if(e.length===t.length)return!0;let s=e.length;return e.charAt(e.length-1)===n&&s--,t.charAt(s)===n}return e.charAt(e.length-1)!==n&&(e+=n),t.indexOf(e)===0}a(bCn,"isEqualOrParent");var WKe="**",SCn="/",zKe="[/\\\\]",YKe="[^/\\\\]",wHo=/\//g;function TCn(t,e){switch(t){case 0:return"";case 1:return`${YKe}*?`;default:return`(?:${zKe}|${YKe}+${zKe}${e?`|${zKe}${YKe}+`:""})*?`}}a(TCn,"starsToRegExp");function Zxe(t,e){if(!t)return[];let r=[],n=!1,o=!1,s="";for(let c of t){switch(c){case e:if(!n&&!o){r.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}s+=c}return s&&r.push(s),r}a(Zxe,"splitGlobAware");function RCn(t){if(!t)return"";let e="",r=Zxe(t,SCn);if(r.every(n=>n===WKe))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===WKe){if(n)return;e+=TCn(2,s===r.length-1)}else{let c=!1,l="",u=!1,d="";for(let f of o){if(f!=="}"&&c){l+=f;continue}if(u&&(f!=="]"||!d)){let h;f==="-"?h=f:(f==="^"||f==="!")&&!d?h="^":f===SCn?h="":h=fqt(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${Zxe(l,",").map(g=>RCn(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=YKe;continue;case"*":e+=TCn(1);continue;default:e+=fqt(f)}}sTqt(l,e)).filter(l=>l!==ZP),t),n=r.length;if(!n)return ZP;if(n===1)return r[0];let o=a(function(l,u){for(let d=0,f=r.length;d!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(BHo,"trivia3");function wCn(t,e,r){let n=zK===xf.sep,o=n?t:t.replace(wHo,zK),s=zK+o,c=xf.sep+t,l;return r?l=a(function(u,d){return typeof u=="string"&&(u===o||u.endsWith(s)||!n&&(u===t||u.endsWith(c)))?e:null},"parsedPattern"):l=a(function(u,d){return typeof u=="string"&&(u===o||!n&&u===t)?e:null},"parsedPattern"),l.allPaths=[(r?"*/":"./")+t],l}a(wCn,"trivia4and5");function FHo(t){try{let e=new RegExp(`^${RCn(t)}$`);return function(r){return e.lastIndex=0,typeof r=="string"&&e.test(r)?t:null}}catch{return ZP}}a(FHo,"toRegExp");function PCn(t,e,r){return!t||typeof e!="string"?!1:Iqt(t)(e,void 0,r)}a(PCn,"match");function Iqt(t,e={}){if(!t)return Sqt;if(typeof t=="string"||UHo(t)){let r=Tqt(t,e);if(r===ZP)return Sqt;let n=a(function(o,s){return!!r(o,s)},"resultPattern");return r.allBasenames&&(n.allBasenames=r.allBasenames),r.allPaths&&(n.allPaths=r.allPaths),n}return QHo(t,e)}a(Iqt,"parse");function UHo(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(UHo,"isRelativePattern");function QHo(t,e){let r=DCn(Object.getOwnPropertyNames(t).map(l=>qHo(l,t[l],e)).filter(l=>l!==ZP)),n=r.length;if(!n)return ZP;if(!r.some(l=>!!l.requiresSiblings)){if(n===1)return r[0];let l=a(function(f,h){let m;for(let g=0,A=r.length;g{for(let g of m){let A=await g;if(typeof A=="string")return A}return null})():null},"resultExpression"),u=r.find(f=>!!f.allBasenames);u&&(l.allBasenames=u.allBasenames);let d=r.reduce((f,h)=>h.allPaths?f.concat(h.allPaths):f,[]);return d.length&&(l.allPaths=d),l}let o=a(function(l,u,d){let f,h;for(let m=0,g=r.length;m{for(let m of h){let g=await m;if(typeof g=="string")return g}return null})():null},"resultExpression"),s=r.find(l=>!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(QHo,"parsedExpression");function qHo(t,e,r){if(e===!1)return ZP;let n=Tqt(t,r);if(n===ZP)return ZP;if(typeof e=="boolean")return n;if(e){let o=e.when;if(typeof o=="string"){let s=a((c,l,u,d)=>{if(!d||!n(c,l))return null;let f=o.replace("$(basename)",()=>u),h=d(f);return qKe(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(qHo,"parseExpressionPattern");function DCn(t,e){let r=t.filter(l=>!!l.basenames);if(r.length<2)return t;let n=r.reduce((l,u)=>{let d=u.basenames;return d?l.concat(d):l},[]),o;if(e){o=[];for(let l=0,u=n.length;l{let d=u.patterns;return d?l.concat(d):l},[]);let s=a(function(l,u){if(typeof l!="string")return null;if(!u){let f;for(f=l.length;f>0;f--){let h=l.charCodeAt(f-1);if(h===47||h===92)break}u=l.substr(f)}let d=n.indexOf(u);return d!==-1?o[d]:null},"aggregate");s.basenames=n,s.patterns=o,s.allBasenames=n;let c=t.filter(l=>!l.basenames);return c.push(s),c}a(DCn,"aggregateBasenameMatches");function NCn(t){if(!t||t.trim()==="")return{pattern:t,isValid:!1,error:"Pattern cannot be empty"};let e=t.trim();return jHo(e)?{pattern:e,isValid:!0}:{pattern:e,isValid:!1,error:"Invalid glob pattern"}}a(NCn,"validate");function MCn(t,e){let r=Zxe(e,","),n=a(o=>{if(o=o.trim(),o.length!==0){if(o==="**"||o==="**/*"||o==="*")return{pattern:o};!o.startsWith("/")&&!o.startsWith("**/")&&(o="**/"+o);for(let s of t)if(PCn(o,s))return{pattern:o,file:s}}},"patternMatches");for(let o of r){let s=n(o);if(s)return s}}a(MCn,"matches");function jHo(t){try{let e=Zxe(t,",");if(e.length===0)return!1;for(let r of e){let n=Iqt(r);if(kCn(n))return!1}return!0}catch{return!1}}a(jHo,"isValidGlob");var LCn=fe(require("path"));var tm={copilotInstructions:"copilotInstructions",gitCommitInstructions:"gitCommitInstructions",agentsMdInstructions:"agentsMdInstructions",nestedAgentsMdInstructions:"nestedAgentsMdInstructions",claudeMdInstructions:"claudeMdInstructions",nestedClaudeMdInstructions:"nestedClaudeMdInstructions",customInstructionFiles:"customInstructionFiles"};var wqt=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._name=r.name??n.header?.name??Ki(n.uri).replace(".instructions.md","")}static{a(this,"CustomInstruction")}get metadata(){return this.promptFileEntry.promptPath.metadata}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get matchKind(){return this.metadata?.length?this.metadata.some(e=>e.matchKind==="ApplyToPattern")?"ApplyToPattern":"AlwaysApplied":"ApplyToPattern"}get source(){if(this.metadata?.length)return this.metadata.map(e=>e.source)}get providers(){return O3(this.metadata)}get uri(){return this.parsedPromptFile.uri}get name(){return this._name}get applyTo(){return this.parsedPromptFile.header?.applyTo||void 0}get description(){return this.promptFileEntry.promptPath.description??this.parsedPromptFile.header?.description}get content(){return this.parsedPromptFile.body?.content??""}get isReadonly(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||Jle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return sq(this.promptFileEntry.promptPath)}},BCn={name:"copilot-instructions",source:tm.copilotInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/copilot-instructions.md"]},FCn={name:"git-commit-instructions",source:tm.gitCommitInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/git-commit-instructions.md"]},UCn={name:"agents-md-instructions",source:tm.agentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["AGENTS.md"]},HHo={name:"nested-agents-md-instructions",source:tm.nestedAgentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["**/AGENTS.md"],watchable:!1,cacheable:!1},QCn={name:"claude-md-instructions",source:tm.claudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["CLAUDE.md","CLAUDE.local.md"]},GHo={name:"nested-claude-md-instructions",source:tm.nestedClaudeMdInstructions,matchKind:"AlwaysApplied",providers:["LOCAL","BACKGROUND","CLAUDE"],defaultRegistration:["**/CLAUDE.md","**/CLAUDE.local.md"],watchable:!1,cacheable:!1},$Ho=[BCn,FCn,UCn,HHo,QCn,GHo],VHo={name:"instruction-file",source:tm.customInstructionFiles,matchKind:"ApplyToPattern",defaultRegistration:[".github/instructions/**/*.instructions.md"],globSuffix:"**/*.instructions.md"},xqt={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!0},WHo={nestedAgentsMdInstructions:"agentsMdInstructions",nestedClaudeMdInstructions:"claudeMdInstructions"};function OCn(t){return`include${t.charAt(0).toUpperCase()}${t.slice(1)}`}a(OCn,"optionKey");function Rqt(t,e){if(!t?.length)return;let r=!1;for(let n of t){let o=OCn(n);if(!(o in xqt)||(r=!0,!(e[o]??xqt[o])))continue;let c=WHo[n];if(c){let l=OCn(c);if(!(e[l]??xqt[l]))continue}return!0}return r?!1:void 0}a(Rqt,"shouldIncludeSource");var kqt=class{constructor(){this.store=new Map}static{a(this,"InMemoryInstructionManager")}set(e,r){r.length===0?this.store.delete(e):this.store.set(e,r)}get(e){return this.store.get(e)??[]}getAll(e){let r=[];for(let[n,o]of this.store)Rqt([n],e)!==!1&&r.push(...o);return r}},zHo=new AO;function YHo(t,e,r,n,o){if(!t)return;let s=`${oq}${e}`,c=zHo.parse(s,t),l=c.body?.content??t;if(l.trim())return{matchKind:r,uri:s,name:c.header?.name??e,applyTo:c.header?.applyTo||void 0,description:c.header?.description,content:l,isReadonly:!0,isBuiltIn:!1,source:[n],providers:O3(o?[{providers:o}]:void 0)}}a(YHo,"resolveContent");var KK=class{constructor(e,r,n){this.descriptor=e;this.manager=r;this.registry=n;this.configsByKey=new Map}static{a(this,"InstructionSlot")}set(e,r="default"){let n=Array.isArray(e)?e:e?[e]:[];this.configsByKey.set(r,n);let o=[];for(let g of this.configsByKey.values())o.push(...g);let{name:s,matchKind:c,source:l}=this.descriptor,u=this.descriptor.providers,d=o.filter(g=>g.type==="content").map(g=>{let A=g.content?.trim();return A?YHo(A,`global-${s}`,c,l,u):void 0}).filter(g=>g!==void 0);this.manager.set(l,d);let f={source:l,matchKind:c,providers:u},h=this.descriptor.globSuffix??"",m=new Set;for(let g of this.descriptor.defaultRegistration??[])m.add(g);for(let g of o)g.type==="location"?m.add(LCn.default.posix.join(g.path,h)):g.type==="file"&&m.add(ln(g.uri));this._registryDisposable=this.registry.replace(this._registryDisposable,"instructions",Array.from(m),{watchable:this.descriptor.watchable??!0,cacheable:this.descriptor.cacheable??!0,metadata:f})}};function KHo(t){switch(t.type){case"content":return{type:"content",content:t.content};case"file":return{type:"file",uri:t.uri};case"location":return{type:"location",path:t.path}}}a(KHo,"stripSource");var JHo="workspace",wf=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.inMemoryManager=new kqt;let n=this.promptFileLocationRegistry;this.slotsBySource=new Map([[tm.copilotInstructions,new KK(BCn,this.inMemoryManager,n)],[tm.gitCommitInstructions,new KK(FCn,this.inMemoryManager,n)],[tm.agentsMdInstructions,new KK(UCn,this.inMemoryManager,n)],[tm.claudeMdInstructions,new KK(QCn,this.inMemoryManager,n)],[tm.customInstructionFiles,new KK(VHo,this.inMemoryManager,n)]]);for(let o of $Ho)o.defaultRegistration&&n.register("instructions",o.defaultRegistration,{watchable:o.watchable??!0,cacheable:o.cacheable??!0,metadata:{source:o.source,matchKind:o.matchKind,providers:o.providers}});this.slotsBySource.get(tm.customInstructionFiles).set([])}static{a(this,"CustomInstructionService")}async listCustomInstructions(e,r){return(await this.ctx.get(pg).collect(this.ctx,"instructions",e,{includePlugins:r?.includePlugins})).map(o=>new wqt(o))}async getCustomInstructionById(e,r){return(await this.listCustomInstructions(e)).find(o=>o.uri===r)}setInstructionFileLocations(e,r=JHo){this.dispatchToSlots(e,r)}dispatchToSlots(e,r){let n=Array.isArray(e)?e:[],o=new Map;for(let s of n){let c;if(s.source===void 0)c=tm.customInstructionFiles;else if(this.slotsBySource.has(s.source))c=s.source;else{Nr.warn(this.ctx,`Ignoring instruction setting with unknown source "${String(s.source)}".`);continue}let l=o.get(c)??[];l.push(KHo(s)),o.set(c,l)}for(let[s,c]of this.slotsBySource)c.set(o.get(s)??[],r)}setGlobalInstructionFiles(e){let r=(e??[]).map(n=>({...n,source:tm.customInstructionFiles}));this.dispatchToSlots(r,"global-instruction-files")}getGlobalInstructionFiles(){return this.inMemoryManager.get(tm.customInstructionFiles)}setGlobalCopilotInstructions(e){let r=e?[{...e,source:tm.copilotInstructions}]:[];this.dispatchToSlots(r,"global-copilot-instructions")}setGlobalGitCommitInstructions(e){let r=e?[{...e,source:tm.gitCommitInstructions}]:[];this.dispatchToSlots(r,"global-git-commit-instructions")}setGlobalAgentsMdInstructions(e){let r=e?[{...e,source:tm.agentsMdInstructions}]:[];this.dispatchToSlots(r,"global-agents-md-instructions")}setGlobalClaudeMdInstructions(e){let r=e?[{...e,source:tm.claudeMdInstructions}]:[];this.dispatchToSlots(r,"global-claude-md-instructions")}async collectAllInstructions(e,r,n={},o){let s=[];for(let c of this.inMemoryManager.getAll(n))this.matchesApplyTo(c,o)&&s.push(c);for(let c of await this.listCustomInstructions(r))this.shouldIncludeRegisteredInstruction(c,n,o)&&s.push(c);return this.emitCollectedTelemetry(s,n),s}static formatInstructions(e,r={}){if(!e||e.length===0)return;let n=[];for(let s of e)s.content.trim()&&n.push(` ${s.content} `);return n.length===0?void 0:`${r.customIntroduction||"When generating code, please follow these user provided coding instructions. You can ignore an instruction if it contradicts a system message."} @@ -2647,21 +2647,21 @@ ${s.content} ${n.join(` `)} -`}async getInstructions(e,r,n={},o){try{let s=await this.collectAllInstructions(e,r,n,o);if(s.length===0)return;let c=n;if(!n.customIntroduction){let l=s.filter(u=>u.matchKind==="ApplyToPattern");l.length>0&&(c={...n,customIntroduction:this.buildInstructionTable(l)})}return t.formatInstructions(s,c)}catch{return}}matchesApplyTo(e,r){if(e.matchKind==="AlwaysApplied")return!0;let n=e.applyTo;if(!n)return!1;let o=nvn(n);return o.isValid&&!!ivn(r||[],o.pattern)}shouldIncludeRegisteredInstruction(e,r,n){let o=BQt(e.source,r);return o!==void 0?o:r.includeCustomInstructionFiles===!1?!1:this.matchesApplyTo(e,n)}buildInstructionTable(e){let n=["Here is a list of instruction files that contain rules for modifying or creating new code.","These files are important for ensuring that the code is modified or created correctly.","Please make sure to follow the rules specified in these files when working with the codebase.","If the file is not already available as attachment, use the `read_file` tool to acquire it.","Make sure to acquire the instructions before making any changes to the code.","| Pattern | File Path | Description |","| ------- | --------- | ----------- |"],o=e.map(s=>`| \`${s.applyTo||"*"}\` | \`${s.uri}\` | ${s.description||""} |`);return n.concat(o).join(` -`)}emitCollectedTelemetry(e,r){let n=e.filter(o=>o.source&&BQt(o.source,r)!==void 0).length;At(this.ctx,"customization.instruction.collected",{},{workspaceInstructionCount:e.length-n,globalInstructionCount:n})}};p();p();function Cq(t,e){if(t.length==0)return new Ar([]);let r=t.map((n,o)=>{let s;switch(e){case"linear":s=1-o/t.length;break;case"inverseLinear":s=(o+1)/t.length;break;case"positional":s=1/(o+1);break;case"inversePositional":s=1/(t.length-o);break}return Array.isArray(n)&&n.length==2&&(s*=n[1],n=n[0]),[n,s]});return new Ar(r)}a(Cq,"weighElidableList");p();function dvn(t){let e=t.split(` -`),r=[],n=!1,o=[];for(let s of e)s.startsWith("```")?(n?(r.push([PS(o.join(` -`)),1]),o=[],r.push([new Ar([s]),1])):r.push([new Ar([s]),1]),n=!n):n?o.push(s):r.push([new Ar([s]),.8]);return n&&(r.push([PS(o.join(` -`)),1]),r.push([new Ar(["```"]),1])),new Ar(r)}a(dvn,"fromMessage");function lue(t){let e=QQt(t),r=[];for(let n=0;n`}async getInstructions(e,r,n={},o){try{let s=await this.collectAllInstructions(e,r,n,o);if(s.length===0)return;let c=n;if(!n.customIntroduction){let l=s.filter(u=>u.matchKind==="ApplyToPattern");l.length>0&&(c={...n,customIntroduction:this.buildInstructionTable(l)})}return t.formatInstructions(s,c)}catch{return}}matchesApplyTo(e,r){if(e.matchKind==="AlwaysApplied")return!0;let n=e.applyTo;if(!n)return!1;let o=NCn(n);return o.isValid&&!!MCn(r||[],o.pattern)}shouldIncludeRegisteredInstruction(e,r,n){let o=Rqt(e.source,r);return o!==void 0?o:r.includeCustomInstructionFiles===!1?!1:this.matchesApplyTo(e,n)}buildInstructionTable(e){let n=["Here is a list of instruction files that contain rules for modifying or creating new code.","These files are important for ensuring that the code is modified or created correctly.","Please make sure to follow the rules specified in these files when working with the codebase.","If the file is not already available as attachment, use the `read_file` tool to acquire it.","Make sure to acquire the instructions before making any changes to the code.","| Pattern | File Path | Description |","| ------- | --------- | ----------- |"],o=e.map(s=>`| \`${s.applyTo||"*"}\` | \`${s.uri}\` | ${s.description||""} |`);return n.concat(o).join(` +`)}emitCollectedTelemetry(e,r){let n=e.filter(o=>o.source&&Rqt(o.source,r)!==void 0).length;jl(this.ctx,"customization.instruction.collected",{},{workspaceInstructionCount:e.length-n,globalInstructionCount:n})}};p();p();function Oq(t,e){if(t.length==0)return new Ar([]);let r=t.map((n,o)=>{let s;switch(e){case"linear":s=1-o/t.length;break;case"inverseLinear":s=(o+1)/t.length;break;case"positional":s=1/(o+1);break;case"inversePositional":s=1/(t.length-o);break}return Array.isArray(n)&&n.length==2&&(s*=n[1],n=n[0]),[n,s]});return new Ar(r)}a(Oq,"weighElidableList");p();function qCn(t){let e=t.split(` +`),r=[],n=!1,o=[];for(let s of e)s.startsWith("```")?(n?(r.push([LS(o.join(` +`)),1]),o=[],r.push([new Ar([s]),1])):r.push([new Ar([s]),1]),n=!n):n?o.push(s):r.push([new Ar([s]),.8]);return n&&(r.push([LS(o.join(` +`)),1]),r.push([new Ar(["```"]),1])),new Ar(r)}a(qCn,"fromMessage");function Eue(t){let e=Dqt(t),r=[];for(let n=0;n1&&n!==e.length-1?` -`:"")),r.push(dvn(l))}return r.length>0?new Ar([[new Ar(["Consider the following conversation history:"]),1],[Cq(r,"inverseLinear"),1]]):null}a(lue,"fromHistory");var Wqo=5;function QQt(t,e){return t.filter(n=>(n.status==="success"||n.status==="in-progress")&&Pn(n.request.message)!=""&&n.agent?.agentSlug===e).reverse().slice(0,Wqo).reverse()}a(QQt,"filterTurns");function fvn(t,e=0){let r;switch(t.type){case"user":case"template":r="User";break;case"model":r="GitHub Copilot";break;default:r=t.type}let n=Pn(t.message).startsWith("```")?` -`:" ";return`${e>0?`${e}) `:""}${r}:${n}${Pn(t.message)}`}a(fvn,"formatTurnMessage");p();p();p();var zqo=4,qQt={skillIds:[]},CKe=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"MetaPromptFetcher")}async fetchPromptContext(e,r,n,o,s){let c=e.conversation.getLastTurn().request.message;if(r.length>0){let l=await xo.getModelConfiguration(e.ctx,"meta",{tool_calls:!0}),u={promptType:"meta",supportedSkillDescriptors:r,modelConfiguration:l},d=await this.ctx.get(kA).toPrompt(e,u),f=o.extendedBy({messageSource:"chat.metaprompt"},{promptTokenLen:d.tokens}),h={modelConfiguration:l,messages:d.messages,uiKind:s,llmInteraction:e.toLlmInteraction()};if(d.toolConfig===void 0)throw new Error("No tool call configuration found in meta prompt.");h.tool_choice=d.toolConfig.tool_choice,h.tools=d.toolConfig.tools;let m=await this.chatFetcher.fetchResponse(h,n,f);return m.type!=="success"&&(ot.error(this.ctx,"Failed to fetch prompt context, trying again..."),m=await this.chatFetcher.fetchResponse(h,n,f)),await e.ctx.get(zh).inspectFetchResult(m),this.handleResult(m,f,Pn(c),s,d.toolConfig)}else return qQt}handleResult(e,r,n,o,s){if(e.type!=="success")return this.telemetryError(r,e),qQt;let l;if(e.toolCalls&&e.toolCalls.length>0)l=s.extractArguments(e.toolCalls[0]).skillIds?.slice(0,zqo);else return ot.error(this.ctx,"Missing tool call in meta prompt response"),qQt;let u=r.extendedBy({uiKind:o,skillIds:l?.join(",")??""},{numTokens:e.numTokens+e.toolCalls[0].approxNumTokens}),d=u.extendedBy({messageText:n});return Et(this.ctx,`${aE(o)}.metaPrompt`,u,0),Et(this.ctx,`${aE(o)}.promptContext`,d,1),{skillIds:l??[]}}telemetryError(e,r){let n=e.extendedBy({resultType:r.type,reason:r.reason??""});Et(this.ctx,"conversation.promptContextError",n,1)}};p();p();var IO=class{constructor(e,r,n){this.doc=e;this.selection=r;this.visibleRange=n}static{a(this,"ElidableDocument")}fromSelectedCode(e){let r=this.getExpandedSelection(),n=r;if(e.trimNewLines){let s=this.doc.getText(r),c=s.match(/^\n*/)?.[0].length??0,l=s.match(/\n*$/)?.[0].length??0;n={start:this.getLineStart(r.start.line+c),end:this.expandLineToEnd(r.end.line-l)}}let o=new Ar([is(this.doc.getText(n)).trim()]);return[this.wrapInTicks(o),n]}fromAllCode(e){let r=this.getDocumentRange(),n=this.getExpandedSelection(),o;!this.visibleRange||!this.rangeContainedIn(this.visibleRange,n)?o=n:o={start:this.getLineStart(this.visibleRange.start.line),end:this.expandLineToEnd(this.visibleRange.end.line)};let s={start:r.start,end:o.start.line>0?this.expandLineToEnd(o.start.line-1):r.start},c={start:o.start,end:n.start.line>0&&n.start.line>o.start.line?this.expandLineToEnd(n.start.line-1):o.start},l={start:n.end.line!uue(h)||m===1).map(([h,m])=>{let g;return e.addLineNumbers?g=this.addLineNumbers(h):g=this.doc.getText(h),[m==1?g:PS(g),m]}));return this.wrapInTicks(f)}selectionIsDocument(){return this.rangeEquals(this.getExpandedSelection(),this.getDocumentRange())}selectionIsEmpty(){return this.selection==null||uue(this.selection)}getExpandedSelection(){return this.selection!==void 0?{start:this.getLineStart(this.selection.start.line),end:this.expandLineToEnd(this.selection.end.line)}:this.getDocumentRange()}getDocumentRange(){return{start:this.getLineStart(0),end:this.expandLineToEnd(this.doc.lineCount-1)}}getLineStart(e){return{line:e,character:0}}expandLineToEnd(e){return e>this.doc.lineCount-1&&(e=this.doc.lineCount-1),{line:e,character:this.doc.lineAt({line:e,character:0}).text.length}}rangeContainedIn(e,r){return e.start.line<=r.start.line&&e.end.line>=r.end.line}rangeEquals(e,r){return e.start.line==r.start.line&&e.end.line==r.end.line}wrapInTicks(e,r){return new Ar([["```"+this.doc.detectedLanguageId,1],[e,r??1],["```",1]])}addLineNumbers(e){let r=this.doc.getText(e).split(` +`:"")),r.push(qCn(l))}return r.length>0?new Ar([[new Ar(["Consider the following conversation history:"]),1],[Oq(r,"inverseLinear"),1]]):null}a(Eue,"fromHistory");var ZHo=5;function Dqt(t,e){return t.filter(n=>(n.status==="success"||n.status==="in-progress")&&Pn(n.request.message)!=""&&n.agent?.agentSlug===e).reverse().slice(0,ZHo).reverse()}a(Dqt,"filterTurns");function jCn(t,e=0){let r;switch(t.type){case"user":case"template":r="User";break;case"model":r="GitHub Copilot";break;default:r=t.type}let n=Pn(t.message).startsWith("```")?` +`:" ";return`${e>0?`${e}) `:""}${r}:${n}${Pn(t.message)}`}a(jCn,"formatTurnMessage");p();p();p();var XHo=4,Nqt={skillIds:[]},KKe=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"MetaPromptFetcher")}async fetchPromptContext(e,r,n,o,s){let c=e.conversation.getLastTurn().request.message;if(r.length>0){let l=await xo.getModelConfiguration(e.ctx,"meta",{tool_calls:!0}),u={promptType:"meta",supportedSkillDescriptors:r,modelConfiguration:l},d=await this.ctx.get(NA).toPrompt(e,u),f=o.extendedBy({messageSource:"chat.metaprompt"},{promptTokenLen:d.tokens}),h={modelConfiguration:l,messages:d.messages,uiKind:s,llmInteraction:e.toLlmInteraction()};if(d.toolConfig===void 0)throw new Error("No tool call configuration found in meta prompt.");h.tool_choice=d.toolConfig.tool_choice,h.tools=d.toolConfig.tools;let m=await this.chatFetcher.fetchResponse(h,n,f);return m.type!=="success"&&(ot.error(this.ctx,"Failed to fetch prompt context, trying again..."),m=await this.chatFetcher.fetchResponse(h,n,f)),await e.ctx.get(Zh).inspectFetchResult(m),this.handleResult(m,f,Pn(c),s,d.toolConfig)}else return Nqt}handleResult(e,r,n,o,s){if(e.type!=="success")return this.telemetryError(r,e),Nqt;let l;if(e.toolCalls&&e.toolCalls.length>0)l=s.extractArguments(e.toolCalls[0]).skillIds?.slice(0,XHo);else return ot.error(this.ctx,"Missing tool call in meta prompt response"),Nqt;let u=r.extendedBy({uiKind:o,skillIds:l?.join(",")??""},{numTokens:e.numTokens+e.toolCalls[0].approxNumTokens}),d=u.extendedBy({messageText:n});return ft(this.ctx,`${fE(o)}.metaPrompt`,u,0),ft(this.ctx,`${fE(o)}.promptContext`,d,1),{skillIds:l??[]}}telemetryError(e,r){let n=e.extendedBy({resultType:r.type,reason:r.reason??""});ft(this.ctx,"conversation.promptContextError",n,1)}};p();p();var DO=class{constructor(e,r,n){this.doc=e;this.selection=r;this.visibleRange=n}static{a(this,"ElidableDocument")}fromSelectedCode(e){let r=this.getExpandedSelection(),n=r;if(e.trimNewLines){let s=this.doc.getText(r),c=s.match(/^\n*/)?.[0].length??0,l=s.match(/\n*$/)?.[0].length??0;n={start:this.getLineStart(r.start.line+c),end:this.expandLineToEnd(r.end.line-l)}}let o=new Ar([ns(this.doc.getText(n)).trim()]);return[this.wrapInTicks(o),n]}fromAllCode(e){let r=this.getDocumentRange(),n=this.getExpandedSelection(),o;!this.visibleRange||!this.rangeContainedIn(this.visibleRange,n)?o=n:o={start:this.getLineStart(this.visibleRange.start.line),end:this.expandLineToEnd(this.visibleRange.end.line)};let s={start:r.start,end:o.start.line>0?this.expandLineToEnd(o.start.line-1):r.start},c={start:o.start,end:n.start.line>0&&n.start.line>o.start.line?this.expandLineToEnd(n.start.line-1):o.start},l={start:n.end.line!_ue(h)||m===1).map(([h,m])=>{let g;return e.addLineNumbers?g=this.addLineNumbers(h):g=this.doc.getText(h),[m==1?g:LS(g),m]}));return this.wrapInTicks(f)}selectionIsDocument(){return this.rangeEquals(this.getExpandedSelection(),this.getDocumentRange())}selectionIsEmpty(){return this.selection==null||_ue(this.selection)}getExpandedSelection(){return this.selection!==void 0?{start:this.getLineStart(this.selection.start.line),end:this.expandLineToEnd(this.selection.end.line)}:this.getDocumentRange()}getDocumentRange(){return{start:this.getLineStart(0),end:this.expandLineToEnd(this.doc.lineCount-1)}}getLineStart(e){return{line:e,character:0}}expandLineToEnd(e){return e>this.doc.lineCount-1&&(e=this.doc.lineCount-1),{line:e,character:this.doc.lineAt({line:e,character:0}).text.length}}rangeContainedIn(e,r){return e.start.line<=r.start.line&&e.end.line>=r.end.line}rangeEquals(e,r){return e.start.line==r.start.line&&e.end.line==r.end.line}wrapInTicks(e,r){return new Ar([["```"+this.doc.detectedLanguageId,1],[e,r??1],["```",1]])}addLineNumbers(e){let r=this.doc.getText(e).split(` `),n=this.doc.lineCount.toString().length;return r.map((s,c)=>`${(e.start.line+c+1).toString().padEnd(n," ")}:${s}`).join(` -`)}};function uue(t){return t.start.line==t.end.line&&t.start.character==t.end.character}a(uue,"isEmptyRange");p();p();var pvn=de(ri()),hvn=S.Object({accessToken:S.Optional(S.String({minLength:1})),handle:S.Optional(S.String({minLength:1})),login:S.Optional(S.String({minLength:1})),githubAppId:S.Optional(S.String({minLength:1})),apiUrl:S.Optional(S.String({})),serverUrl:S.Optional(S.String({})),tokenEndpoint:S.Optional(S.String({}))}),jQt;(r=>(r.method="github/didChangeAuth",r.type=new pvn.ProtocolNotificationType(r.method)))(jQt||={});p();var mvn=de(ri()),HQt;(r=>(r.method="copilot/ipCodeCitation",r.type=new mvn.NotificationType(r.method)))(HQt||={});p();var gvn=de(ri()),bKe;(r=>(r.method="context/update",r.type=new gvn.ProtocolRequestType(r.method)))(bKe||={});p();p();p();var Fn=de(ri()),Nxe=S.String(),jC=S.Object({uri:Nxe}),qK=S.Intersect([jC,S.Object({version:S.Optional(S.Integer())})]),ord=S.Required(qK),c0=S.Object({line:S.Integer({minimum:0}),character:S.Integer({minimum:0})}),Sf=S.Object({start:c0,end:c0}),GQt=S.Union([S.Integer(),S.String()]),srd=S.Object({isCancellationRequested:S.Boolean(),onCancellationRequested:S.Any()});p();var Avn=de(ri()),$Qt;(r=>(r.method="textDocument/didFocus",r.type=new Avn.ProtocolNotificationType(r.method)))($Qt||={});p();var Yqo=S.Object({didChangeFeatureFlags:S.Boolean(),fetch:S.Boolean(),ipCodeCitation:S.Boolean(),redirectedTelemetry:S.Boolean(),related:S.Boolean(),token:S.Boolean(),watchedFiles:S.Boolean(),showPanelMessage:S.Boolean(),mcpElicitation:S.Boolean(),mcpSampling:S.Boolean(),mcpAllowlist:S.Boolean(),stateDatabase:S.Boolean(),subAgent:S.Boolean(),mcpServerManagement:S.Boolean(),cveRemediatorAgent:S.Boolean(),debuggerAgent:S.Boolean(),contentProvider:S.Array(S.String()),manageTodoListTool:S.Boolean(),agentDebugLog:S.Boolean(),accountPickerEnabled:S.Boolean()}),Kqo=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),yvn=S.Object({name:S.String(),version:S.Optional(S.String()),readableName:S.Optional(S.String())}),Evn=S.Object({editorInfo:S.Optional(yvn),editorPluginInfo:S.Optional(yvn),relatedPluginInfo:S.Optional(S.Array(Kqo)),copilotIntegrationId:S.Optional(S.String()),copilotCapabilities:S.Optional(S.Partial(Yqo)),githubAppId:S.Optional(S.String()),sessionId:S.Optional(S.String())});p();var Mxe=de(ri());var VQt=(r=>(r[r.Invoked=1]="Invoked",r[r.Automatic=2]="Automatic",r))(VQt||{}),Jqo=S.Enum(VQt),Zqo=S.Object({triggerKind:Jqo,selectedCompletionInfo:S.Optional(S.Object({text:S.String(),range:Sf,tooltipSignature:S.Optional(S.String())}))}),_vn=S.Object({textDocument:qK,position:c0,formattingOptions:S.Optional(S.Object({tabSize:S.Optional(S.Union([S.Integer({minimum:1}),S.String()])),insertSpaces:S.Optional(S.Union([S.Boolean(),S.String()]))})),context:Zqo,data:S.Optional(S.Unknown())}),WQt;(r=>(r.method="textDocument/inlineCompletion",r.type=new Mxe.ProtocolRequestType(r.method)))(WQt||={});var vvn=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),Cvn=S.Object({item:vvn}),zQt;(r=>(r.method="textDocument/didShowCompletion",r.type=new Mxe.ProtocolNotificationType(r.method)))(zQt||={});var bvn=S.Object({item:vvn,acceptedLength:S.Integer({minimum:1})}),YQt;(r=>(r.method="textDocument/didPartiallyAcceptCompletion",r.type=new Mxe.ProtocolNotificationType(r.method)))(YQt||={});p();var Svn=de(ri()),Xqo;(r=>(r.method="textDocument/inlineCompletionPrompt",r.type=new Svn.ProtocolRequestType(r.method)))(Xqo||={});p();var Tvn=de(ri()),ejo=S.Object({severity:S.Union([S.Literal("error"),S.Literal("warning")]),message:S.String(),range:Sf,code:S.Optional(S.Union([S.String(),S.Number()])),source:S.Optional(S.String())}),Ivn=S.Object({textDocument:qK,position:c0,diagnostics:S.Optional(S.Array(ejo))}),tjo=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),xvn=S.Object({item:tjo}),KQt;(r=>(r.method="textDocument/didShowInlineEdit",r.type=new Tvn.ProtocolNotificationType(r.method)))(KQt||={});p();var SKe=de(ri());var wvn=S.Object({textDocument:qK,position:c0,partialResultToken:S.Optional(GQt),workDoneToken:S.Optional(GQt)}),TKe;(n=>(n.method="textDocument/copilotPanelCompletion",n.type=new SKe.ProtocolRequestType(n.method),n.partialResult=new SKe.ProgressType))(TKe||={});p();var Rvn=de(ri()),JQt;(r=>(r.method="copilot/related",r.type=new Rvn.ProtocolRequestType(r.method)))(JQt||={});p();var ZQt=de(ri()),XQt;(r=>(r.method="statusNotification",r.type=new ZQt.ProtocolNotificationType(r.method)))(XQt||={});var eqt;(r=>(r.method="didChangeStatus/v2",r.type=new ZQt.ProtocolNotificationType(r.method)))(eqt||={});var kvn=de(require("path"));var Pvn=S.Object({uri:S.String(),visibleRange:S.Optional(Sf),selection:S.Optional(Sf)}),tqt=class{constructor(e){this.turnContext=e}static{a(this,"CurrentEditorSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ii),n=await r.getOrReadTextDocument(e),o=td(n);if(await this.turnContext.collectFile(lE,e.uri,o),n.status==="valid"){let s=this.turnContext.conversation.source==="inline",c=new IO(n.document,e.selection,e.visibleRange),l=r.getRelativePath(n.document);if(o==="empty")return new Ar([`The currently open file \`${l}\` is empty.`]);let u=[[`Code excerpt from the currently open file \`${l}\`:`,1],[c.fromAllCode({addLineNumbers:s}),1]],d=[];if(c.selectionIsDocument())d=[["The user is selecting the entire file.",1]];else if(s){let[f,h]=c.fromSelectedCode({trimNewLines:!0}),m=h.start.line+1;if(uue(h))d=[[`The user is selecting line ${m}, which is empty.`,1]];else{let g=h.end.line+1;d=[["The user is selecting"+(m==g?` line ${m}:`:` lines ${m} to ${g} (inclusive):`),1],[f,1]]}}else c.selectionIsEmpty()||(d=[["The user is selecting this code:",1],[c.fromSelectedCode({trimNewLines:!1})[0],1]]);return new Ar([...u,...d])}else if(n.status==="invalid")return new Ar([`The currently open file \`${kvn.basename(e.uri)}\` is content excluded.`])}},lE="current-editor",IKe=class{constructor(e){this._resolver=e;this.id=lE;this.type="explicit"}static{a(this,"CurrentEditorSkill")}description(){return"The code from the user's currently open file"}resolver(){return this._resolver}processor(e){return new tqt(e)}};p();var Dvn=S.Object({labels:S.Array(S.String())}),rqt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectLabelsSkillProcessor")}value(){return 1}processSkill(e){let r=[];return r.push([new Ar(["The developer is working on a project with the following characteristics (languages, frameworks):"]),1]),e.labels.forEach(n=>{r.push([new Ar([`- ${n}`]),.9]),this.turnContext.collectLabel(GP,n)}),new Ar(r)}},GP="project-labels",xKe=class{constructor(e){this._resolver=e;this.id=GP;this.type="explicit"}static{a(this,"ProjectLabelsSkill")}description(){return"The characteristics of the project the developer is working on (languages, frameworks)"}resolver(){return this._resolver}processor(e){return new rqt(e)}};p();p();p();var wKe=class{constructor(){this.languageId=["java","kotlin","scala","groovy"]}static{a(this,"JavaProjectMetadataLookup")}determineBuildTools(e){return[...e.buildTools]}determineApplicationFrameworks(e){let r=[];return De(e,r,"org.springframework.boot","Spring Boot"),De(e,r,"jakarta.jakartaee-api","Jakarta EE"),De(e,r,"javax:javaee-api","Java EE"),De(e,r,"org.apache.struts:struts2-core","Apache Struts"),De(e,r,"org.hibernate:hibernate-core","Hibernate"),De(e,r,"org.apache.wicket:wicket-core","Apache Wicket"),De(e,r,"javax.faces:jsf-api","JSF"),De(e,r,"org.grails:grails-core","Grails"),r}determineCoreLibraries(e){let r=[];return De(e,r,"com.google.guava","Google Guava"),De(e,r,"org.apache.commons:commons-lang3","Apache Commons Lang"),De(e,r,"org.apache.commons:commons-io","Apache Commons IO"),De(e,r,"joda-time:joda-time","Joda-Time"),De(e,r,"com.google.code.gson:gson","Google Gson"),De(e,r,"org.apache.commons:commons-math3","Apache Commons Math"),De(e,r,"org.apache.commons:commons-collections4","Apache Commons Collections"),De(e,r,"org.apache.commons:commons-net","Apache Commons Net"),De(e,r,"org.apache.poi:poi","Apache POI"),De(e,r,"com.fasterxml.jackson.core:jackson-databind","Jackson"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"org.junit.jupiter:junit-jupiter","JUnit"),De(e,r,"junit:junit","JUnit"),De(e,r,"org.testng:testng","TestNG"),De(e,r,"org.spockframework:spock-core","Spock"),De(e,r,"io.cucumber:cucumber-java","Cucumber"),De(e,r,"org.jboss.arquillian.junit:arquillian-junit-container","Arquillian"),r}determineTestingLibraries(e){let r=[];return De(e,r,"org.mockito","Mockito"),De(e,r,"org.assertj","AssertJ"),De(e,r,"org.hamcrest","Hamcrest"),De(e,r,"org.powermock","PowerMock"),De(e,r,"org.jmock","JMock"),De(e,r,"org.easymock","EasyMock"),De(e,r,"org.jmockit:jmockit","JMockit"),De(e,r,"com.github.tomakehurst:wiremock","WireMock"),De(e,r,"org.dbunit:dbunit","DBUnit"),De(e,r,"com.icegreen:greenmail","GreenMail"),De(e,r,"net.sourceforge.htmlunit:htmlunit","HtmlUnit"),De(e,r,"org.seleniumhq.selenium:selenium-java","Selenium"),De(e,r,"io.rest-assured:rest-assured","Rest-Assured"),De(e,r,"io.gatling.highcharts:gatling-charts-highcharts","Gatling"),De(e,r,"org.apache.jmeter:ApacheJMeter","JMeter"),r}},RKe=class{constructor(){this.languageId=["javascript","javascriptreact","typescript","typescriptreact","vue"]}static{a(this,"JavaScriptProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"@types/node","Node.js"),De(e,r,"react-native","React Native"),r.find(n=>n.name==="React Native")||De(e,r,"react","React"),De(e,r,"angular","Angular"),De(e,r,"vue","Vue.js"),De(e,r,"ember","Ember.js"),De(e,r,"backbone","Backbone.js"),De(e,r,"meteor","Meteor"),De(e,r,"polymer","Polymer"),De(e,r,"aurelia","Aurelia"),De(e,r,"knockout","Knockout.js"),De(e,r,"dojo","Dojo Toolkit"),De(e,r,"mithril","Mithril.js"),De(e,r,"marionette","Marionette.js"),De(e,r,"marko","Marko.js"),De(e,r,"svelte","Svelte"),De(e,r,"hyperapp","Hyperapp"),De(e,r,"inferno","Inferno.js"),De(e,r,"preact","Preact"),De(e,r,"riot","Riot.js"),De(e,r,"moon","Moon.js"),De(e,r,"stencil","Stencil.js"),r}determineCoreLibraries(e){let r=[];return De(e,r,"lodash","Lodash"),De(e,r,"moment","Moment.js"),De(e,r,"axios","Axios"),De(e,r,"redux","Redux"),De(e,r,"recoil","Recoil"),De(e,r,"jquery","jQuery"),De(e,r,"d3","D3.js"),De(e,r,"underscore","Underscore.js"),De(e,r,"ramda","Ramda"),De(e,r,"immutable","Immutable.js"),De(e,r,"rxjs","RxJS"),De(e,r,"three","Three.js"),De(e,r,"socket.io","Socket.IO"),De(e,r,"express","Express.js"),De(e,r,"next","Next.js"),De(e,r,"puppeteer","Puppeteer"),De(e,r,"cheerio","Cheerio"),De(e,r,"nodemailer","Nodemailer"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"jest","Jest"),De(e,r,"mocha","Mocha"),De(e,r,"jasmine","Jasmine"),De(e,r,"ava","AVA"),De(e,r,"qunit","QUnit"),De(e,r,"tape","Tape"),r}determineTestingLibraries(e){let r=[];return De(e,r,"chai","Chai"),De(e,r,"sinon","Sinon"),De(e,r,"enzyme","Enzyme"),De(e,r,"protractor","Protractor"),De(e,r,"supertest","Supertest"),De(e,r,"nock","Nock"),De(e,r,"cypress","Cypress"),De(e,r,"@testing-library/react","React Testing Library"),r}},kKe=class{constructor(){this.languageId="go"}static{a(this,"GoProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"github.com/gorilla/mux","Gorilla Mux"),De(e,r,"github.com/go-chi/chi","Chi"),De(e,r,"github.com/gin-gonic/gin","Gin"),De(e,r,"github.com/labstack/echo","Echo"),De(e,r,"github.com/revel/revel","Revel"),De(e,r,"github.com/astaxie/beego","Beego"),De(e,r,"github.com/go-martini/martini","Martini"),De(e,r,"github.com/gobuffalo/buffalo","Buffalo"),De(e,r,"github.com/goji/goji","Goji"),De(e,r,"github.com/hoisie/web","Web.go"),r}determineCoreLibraries(e){let r=[];return De(e,r,"net/http","net/http"),De(e,r,"fmt","fmt"),De(e,r,"io","io"),De(e,r,"time","time"),De(e,r,"math","math"),De(e,r,"strconv","strconv"),De(e,r,"strings","strings"),De(e,r,"sort","sort"),De(e,r,"encoding/json","encoding/json"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"github.com/onsi/ginkgo","ginkgo"),De(e,r,"github.com/onsi/gomega","gomega"),De(e,r,"github.com/stretchr/testify","testify"),De(e,r,"gopkg.in/check.v1","gocheck"),De(e,r,"github.com/franela/goblin","goblin"),De(e,r,"github.com/DATA-DOG/godog","godog"),De(e,r,"github.com/stesla/gospec","gospec"),De(e,r,"github.com/rjeczalik/gotest","gotest"),De(e,r,"github.com/smartystreets/goconvey","goconvey"),r}determineTestingLibraries(e){let r=[];return De(e,r,"github.com/stretchr/testify","Testify"),De(e,r,"github.com/smartystreets/goconvey","GoConvey"),De(e,r,"github.com/onsi/ginkgo","Ginkgo"),De(e,r,"github.com/golang/mock","GoMock"),De(e,r,"gopkg.in/check.v1","GoCheck"),De(e,r,"github.com/franela/goblin","Goblin"),De(e,r,"github.com/DATA-DOG/godog","GoDog"),De(e,r,"github.com/onsi/gomega","Gomega"),De(e,r,"github.com/stesla/gospec","GoSpec"),De(e,r,"github.com/rjeczalik/gotest","GoTest"),r}},PKe=class{constructor(){this.languageId=["python","jupyter"]}static{a(this,"PythonProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"flask","Flask"),De(e,r,"django","Django"),De(e,r,"pyramid","Pyramid"),De(e,r,"tornado","Tornado"),De(e,r,"fastapi","FastAPI"),r}determineCoreLibraries(e){let r=[];return De(e,r,"requests","requests"),De(e,r,"numpy","numpy"),De(e,r,"pandas","pandas"),De(e,r,"scipy","scipy"),De(e,r,"matplotlib","matplotlib"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"pytest","Pytest"),De(e,r,"unittest","Unittest"),De(e,r,"doctest","Doctest"),De(e,r,"nose","Nose"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mock","Mock"),De(e,r,"hypothesis","Hypothesis"),De(e,r,"behave","Behave"),De(e,r,"lettuce","Lettuce"),De(e,r,"testify","Testify"),De(e,r,"pyhamcrest","PyHamcrest"),r}},DKe=class{constructor(){this.languageId=["php","blade"]}static{a(this,"PhpProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"laravel/framework","Laravel"),De(e,r,"symfony/symfony","Symfony"),De(e,r,"slim/slim","Slim"),De(e,r,"cakephp/cakephp","CakePHP"),De(e,r,"yiisoft/yii2","Yii"),De(e,r,"zendframework/zendframework","Zend Framework"),De(e,r,"phalcon/cphalcon","Phalcon"),De(e,r,"bcosca/fatfree","Fat-Free"),De(e,r,"fuel/fuel","FuelPHP"),De(e,r,"phpixie/framework","PHPixie"),r}determineCoreLibraries(e){let r=[];return De(e,r,"monolog/monolog","Monolog"),De(e,r,"vlucas/phpdotenv","PHP dotenv"),De(e,r,"symfony/console","Symfony Console"),De(e,r,"guzzlehttp/guzzle","GuzzleHttp"),De(e,r,"ramsey/uuid","Ramsey UUID"),De(e,r,"doctrine/orm","Doctrine ORM"),De(e,r,"php-di/php-di","PHP-DI"),De(e,r,"phpunit/php-timer","PHPUnit Timer"),De(e,r,"symfony/finder","Symfony Finder"),De(e,r,"symfony/yaml","Symfony Yaml"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"phpunit/phpunit","PHPUnit"),De(e,r,"behat/behat","Behat"),De(e,r,"phpspec/phpspec","PHPSpec"),De(e,r,"codeception/codeception","Codeception"),De(e,r,"atoum/atoum","Atoum"),De(e,r,"pestphp/pest","PestPHP"),De(e,r,"kahlan/kahlan","Kahlan"),De(e,r,"peridot-php/peridot","Peridot"),De(e,r,"phake/phake","Phake"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mockery/mockery","Mockery"),De(e,r,"php-mock/php-mock","PHP-Mock"),De(e,r,"php-mock/php-mock-phpunit","PHP-Mock PHPUnit"),De(e,r,"padraic/mockery","Padraic Mockery"),De(e,r,"phpspec/prophecy","PHPSpec Prophecy"),De(e,r,"phpunit/php-invoker","PHPUnit Invoker"),De(e,r,"phpunit/php-token-stream","PHPUnit Token Stream"),De(e,r,"phpunit/php-code-coverage","PHPUnit Code Coverage"),De(e,r,"phpunit/php-timer","PHPUnit Timer"),De(e,r,"phpunit/php-text-template","PHPUnit Text Template"),r}},NKe=class{constructor(){this.languageId="csharp"}static{a(this,"CSharpProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"Microsoft.NETCore.App",".NET Core"),De(e,r,"Microsoft.AspNetCore.App","ASP.NET Core"),r}determineCoreLibraries(e){let r=[];return De(e,r,"EntityFramework","Entity Framework"),De(e,r,"Newtonsoft.Json","Newtonsoft.Json"),De(e,r,"AutoMapper","AutoMapper"),De(e,r,"Serilog","Serilog"),De(e,r,"Dapper","Dapper"),De(e,r,"Polly","Polly"),De(e,r,"FluentValidation","FluentValidation"),De(e,r,"MediatR","MediatR"),De(e,r,"Hangfire","Hangfire"),De(e,r,"RabbitMQ.Client","RabbitMQ.Client"),De(e,r,"MassTransit","MassTransit"),De(e,r,"Microsoft.Extensions.Logging","Microsoft.Extensions.Logging"),De(e,r,"Microsoft.Extensions.DependencyInjection","Microsoft.Extensions.DependencyInjection"),De(e,r,"Microsoft.Extensions.Configuration","Microsoft.Extensions.Configuration"),De(e,r,"Microsoft.Extensions.Http","Microsoft.Extensions.Http"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"xunit","xUnit"),De(e,r,"NUnit","NUnit"),De(e,r,"SpecFlow","SpecFlow"),r}determineTestingLibraries(e){let r=[];return De(e,r,"Moq","Moq"),De(e,r,"FluentAssertions","FluentAssertions"),De(e,r,"Bogus","Bogus"),De(e,r,"RestSharp","RestSharp"),De(e,r,"Swashbuckle.AspNetCore","Swashbuckle.AspNetCore"),r}},MKe=class{constructor(){this.languageId="dart"}static{a(this,"DartProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"flutter","Flutter"),De(e,r,"angular","AngularDart"),r}determineCoreLibraries(e){let r=[];return De(e,r,"dartx","dartx"),De(e,r,"provider","Provider"),De(e,r,"rxdart","RxDart"),De(e,r,"dio","Dio"),De(e,r,"json_serializable","json_serializable"),De(e,r,"freezed","Freezed"),De(e,r,"moor","Moor"),De(e,r,"hive","Hive"),De(e,r,"http","http"),De(e,r,"path","path"),De(e,r,"intl","intl"),De(e,r,"equatable","equatable"),De(e,r,"get_it","get_it"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"test","test"),De(e,r,"flutter_test","flutter_test"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mockito","mockito"),De(e,r,"bloc_test","bloc_test"),r}},OKe=class{constructor(){this.languageId="ruby"}static{a(this,"RubyProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"rails","Rails"),De(e,r,"sinatra","Sinatra"),De(e,r,"hanami","Hanami"),De(e,r,"grape","Grape"),De(e,r,"roda","Roda"),De(e,r,"padrino","Padrino"),De(e,r,"cuba","Cuba"),De(e,r,"ramaze","Ramaze"),De(e,r,"nyara","Nyara"),De(e,r,"rack","Rack"),r}determineCoreLibraries(e){let r=[];return De(e,r,"active_record","ActiveRecord"),De(e,r,"sequel","Sequel"),De(e,r,"rom","ROM"),De(e,r,"datamapper","DataMapper"),De(e,r,"mongoid","Mongoid"),De(e,r,"neo4j","Neo4j"),De(e,r,"redis","Redis"),De(e,r,"cassandra","Cassandra"),De(e,r,"couchrest","CouchRest"),De(e,r,"riak","Riak"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"rspec","RSpec"),De(e,r,"minitest","Minitest"),De(e,r,"cucumber","Cucumber"),De(e,r,"spinach","Spinach"),De(e,r,"turnip","Turnip"),De(e,r,"bacon","Bacon"),De(e,r,"shoulda","Shoulda"),De(e,r,"test-unit","Test::Unit"),De(e,r,"wrong","Wrong"),De(e,r,"contest","Contest"),r}determineTestingLibraries(e){let r=[];return De(e,r,"factory_bot","FactoryBot"),De(e,r,"faker","Faker"),De(e,r,"ffaker","FFaker"),De(e,r,"fabrication","Fabrication"),De(e,r,"machinist","Machinist"),De(e,r,"mocha","Mocha"),De(e,r,"flexmock","FlexMock"),De(e,r,"rr","RR"),De(e,r,"bourne","Bourne"),De(e,r,"not_a_mock","NotAMock"),r}},LKe=class{constructor(){this.languageId="rust"}static{a(this,"RustProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"tokio","tokio"),De(e,r,"async-std","async-std"),De(e,r,"hyper","hyper"),De(e,r,"actix-web","actix-web"),De(e,r,"rocket","rocket"),r}determineCoreLibraries(e){let r=[];return De(e,r,"serde","serde"),De(e,r,"regex","regex"),De(e,r,"rand","rand"),De(e,r,"log","log"),De(e,r,"lazy_static","lazy_static"),De(e,r,"libc","libc"),De(e,r,"futures","futures"),De(e,r,"rayon","rayon"),De(e,r,"reqwest","reqwest"),De(e,r,"warp","warp"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"test-case","test-case"),De(e,r,"proptest","proptest"),De(e,r,"quickcheck","quickcheck"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mockall","mockall"),De(e,r,"double","double"),De(e,r,"rstest","rstest"),De(e,r,"mockiato","mockiato"),De(e,r,"mock_derive","mock_derive"),De(e,r,"mocktopus","mocktopus"),De(e,r,"mockers","mockers"),De(e,r,"mock_it","mock_it"),r}},BKe=class{constructor(){this.languageId=["c","cpp"]}static{a(this,"CProjectMetadataLookup")}determineBuildTools(e){return e.buildTools.filter(r=>["gcc","clang","make","cmake","autotools","ninja","meson"].includes(r.name))}determineApplicationFrameworks(e){return e.libraries.filter(r=>["libc","libuv","openssl","zlib","libevent","libcurl"].includes(r.name))}determineCoreLibraries(e){return e.libraries.filter(r=>["libpng","libjpeg","libxml2","sqlite","postgres","mysql"].includes(r.name))}determineTestingFrameworks(e){return e.libraries.filter(r=>["unity","criterion","cmocka","check","ctest","minunit"].includes(r.name))}determineTestingLibraries(e){return e.libraries.filter(r=>["cmock","fff","trompeloeil","fakeit"].includes(r.name))}};function De(t,e,r,n){let o=t.libraries.find(s=>s.name.toLowerCase().indexOf(r.toLowerCase())>-1);o&&e.push({name:n,version:o.version})}a(De,"addFromLibraries");var FKe=class{constructor(e,r){this.languageId=e;this.delegates=r}static{a(this,"CompositeProjectMetadataLookup")}determineBuildTools(e){return this.delegates.map(r=>r.determineBuildTools(e)).flat()}determineApplicationFrameworks(e){return this.delegates.map(r=>r.determineApplicationFrameworks(e)).flat()}determineCoreLibraries(e){return this.delegates.map(r=>r.determineCoreLibraries(e)).flat()}determineTestingFrameworks(e){return this.delegates.map(r=>r.determineTestingFrameworks(e)).flat()}determineTestingLibraries(e){return this.delegates.map(r=>r.determineTestingLibraries(e)).flat()}};function Mvn(t){return t.language.version?t.language.name+" "+t.language.version:t.language.name}a(Mvn,"determineProgrammingLanguage");var Nvn=[new wKe,new RKe,new kKe,new PKe,new DKe,new NKe,new MKe,new OKe,new LKe,new BKe];function Ovn(t){let e=Nvn.find(r=>typeof r.languageId=="string"?r.languageId===t:Array.isArray(r.languageId)?r.languageId.includes(t):!1)??new FKe(t,Nvn);return new nqt(e)}a(Ovn,"getMetadataLookup");var nqt=class{constructor(e){this.delegate=e;this.languageId=e.languageId}static{a(this,"DistinctProjectMetadataLookup")}determineBuildTools(e){return this.deduplicateDependencies(this.delegate.determineBuildTools(e))}determineApplicationFrameworks(e){return this.deduplicateDependencies(this.delegate.determineApplicationFrameworks(e))}determineCoreLibraries(e){return this.deduplicateDependencies(this.delegate.determineCoreLibraries(e))}determineTestingFrameworks(e){return this.deduplicateDependencies(this.delegate.determineTestingFrameworks(e))}determineTestingLibraries(e){return this.deduplicateDependencies(this.delegate.determineTestingLibraries(e))}deduplicateDependencies(e){let r=[];return e.forEach(n=>{r.find(o=>o.name===n.name)||r.push(n)}),r}};var Lvn=S.Object({name:S.String(),version:S.Optional(S.String())}),Bvn=S.Object({language:S.Object({id:S.String(),name:S.String(),version:S.Optional(S.String())}),libraries:S.Array(Lvn),buildTools:S.Array(Lvn)}),iqt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectMetadataSkillProcessor")}value(){return 1}processSkill(e){let r=[];r.push([new Ar([`The user is working on a project with the following characteristics: -`]),1]);let n=Ovn(e.language.id);return this.addProgrammingLanguage(e,r),this.addBuildTools(e,r,n),this.addApplicationFramework(e,r,n),this.addCoreLibraries(e,r,n),this.addTestingFrameworks(e,r,n),this.addTestingLibraries(e,r,n),new Ar(r)}addProgrammingLanguage(e,r){let n=Mvn(e);this.turnContext.collectLabel(xO,n),r.push([new Ar([`- programming language: ${n}`]),1])}addBuildTools(e,r,n){this.addToPrompt(r,"- build tools:",n.determineBuildTools(e))}addApplicationFramework(e,r,n){this.addToPrompt(r,"- application frameworks:",n.determineApplicationFrameworks(e))}addCoreLibraries(e,r,n){this.addToPrompt(r,"- core libraries:",n.determineCoreLibraries(e))}addTestingFrameworks(e,r,n){this.addToPrompt(r,"- testing frameworks:",n.determineTestingFrameworks(e))}addTestingLibraries(e,r,n){this.addToPrompt(r,"- testing libraries:",n.determineTestingLibraries(e))}addToPrompt(e,r,n){if(n.length>0){n.forEach(s=>{this.turnContext.collectLabel(xO,`${s.name}${s.version?" "+s.version:""}`)});let o=n.map(s=>` - ${s.name}${s.version?" "+s.version:""}`).join(` +`)}};function _ue(t){return t.start.line==t.end.line&&t.start.character==t.end.character}a(_ue,"isEmptyRange");p();p();var HCn=fe(ei()),GCn=S.Object({accessToken:S.Optional(S.String({minLength:1})),handle:S.Optional(S.String({minLength:1})),login:S.Optional(S.String({minLength:1})),githubAppId:S.Optional(S.String({minLength:1})),apiUrl:S.Optional(S.String({})),serverUrl:S.Optional(S.String({})),tokenEndpoint:S.Optional(S.String({}))}),Mqt;(r=>(r.method="github/didChangeAuth",r.type=new HCn.ProtocolNotificationType(r.method)))(Mqt||={});p();var $Cn=fe(ei()),Oqt;(r=>(r.method="copilot/ipCodeCitation",r.type=new $Cn.NotificationType(r.method)))(Oqt||={});p();var VCn=fe(ei()),JKe;(r=>(r.method="context/update",r.type=new VCn.ProtocolRequestType(r.method)))(JKe||={});p();p();p();var Fn=fe(ei()),Xxe=S.String(),$C=S.Object({uri:Xxe}),JK=S.Intersect([$C,S.Object({version:S.Optional(S.Integer())})]),sod=S.Required(JK),f0=S.Object({line:S.Integer({minimum:0}),character:S.Integer({minimum:0})}),Rf=S.Object({start:f0,end:f0}),Lqt=S.Union([S.Integer(),S.String()]),aod=S.Object({isCancellationRequested:S.Boolean(),onCancellationRequested:S.Any()});p();var WCn=fe(ei()),Bqt;(r=>(r.method="textDocument/didFocus",r.type=new WCn.ProtocolNotificationType(r.method)))(Bqt||={});p();var eGo=S.Object({didChangeFeatureFlags:S.Boolean(),didChangeManagedSettings:S.Boolean(),fetch:S.Boolean(),ipCodeCitation:S.Boolean(),redirectedTelemetry:S.Boolean(),related:S.Boolean(),token:S.Boolean(),watchedFiles:S.Boolean(),showPanelMessage:S.Boolean(),mcpElicitation:S.Boolean(),mcpSampling:S.Boolean(),mcpAllowlist:S.Boolean(),stateDatabase:S.Boolean(),subAgent:S.Boolean(),mcpServerManagement:S.Boolean(),cveRemediatorAgent:S.Boolean(),debuggerAgent:S.Boolean(),contentProvider:S.Array(S.String()),manageTodoListTool:S.Boolean(),agentDebugLog:S.Boolean(),accountPickerEnabled:S.Boolean()}),tGo=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),zCn=S.Object({name:S.String(),version:S.Optional(S.String()),readableName:S.Optional(S.String())}),YCn=S.Object({editorInfo:S.Optional(zCn),editorPluginInfo:S.Optional(zCn),relatedPluginInfo:S.Optional(S.Array(tGo)),copilotIntegrationId:S.Optional(S.String()),copilotCapabilities:S.Optional(S.Partial(eGo)),githubAppId:S.Optional(S.String()),sessionId:S.Optional(S.String())});p();var ewe=fe(ei());var Fqt=(r=>(r[r.Invoked=1]="Invoked",r[r.Automatic=2]="Automatic",r))(Fqt||{}),rGo=S.Enum(Fqt),nGo=S.Object({triggerKind:rGo,selectedCompletionInfo:S.Optional(S.Object({text:S.String(),range:Rf,tooltipSignature:S.Optional(S.String())}))}),KCn=S.Object({textDocument:JK,position:f0,formattingOptions:S.Optional(S.Object({tabSize:S.Optional(S.Union([S.Integer({minimum:1}),S.String()])),insertSpaces:S.Optional(S.Union([S.Boolean(),S.String()]))})),context:nGo,data:S.Optional(S.Unknown())}),Uqt;(r=>(r.method="textDocument/inlineCompletion",r.type=new ewe.ProtocolRequestType(r.method)))(Uqt||={});var JCn=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),ZCn=S.Object({item:JCn}),Qqt;(r=>(r.method="textDocument/didShowCompletion",r.type=new ewe.ProtocolNotificationType(r.method)))(Qqt||={});var XCn=S.Object({item:JCn,acceptedLength:S.Integer({minimum:1})}),qqt;(r=>(r.method="textDocument/didPartiallyAcceptCompletion",r.type=new ewe.ProtocolNotificationType(r.method)))(qqt||={});p();var ebn=fe(ei()),iGo;(r=>(r.method="textDocument/inlineCompletionPrompt",r.type=new ebn.ProtocolRequestType(r.method)))(iGo||={});p();var tbn=fe(ei()),oGo=S.Object({severity:S.Union([S.Literal("error"),S.Literal("warning")]),message:S.String(),range:Rf,code:S.Optional(S.Union([S.String(),S.Number()])),source:S.Optional(S.String())}),rbn=S.Object({textDocument:JK,position:f0,diagnostics:S.Optional(S.Array(oGo))}),sGo=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),nbn=S.Object({item:sGo}),jqt;(r=>(r.method="textDocument/didShowInlineEdit",r.type=new tbn.ProtocolNotificationType(r.method)))(jqt||={});p();var ZKe=fe(ei());var ibn=S.Object({textDocument:JK,position:f0,partialResultToken:S.Optional(Lqt),workDoneToken:S.Optional(Lqt)}),XKe;(n=>(n.method="textDocument/copilotPanelCompletion",n.type=new ZKe.ProtocolRequestType(n.method),n.partialResult=new ZKe.ProgressType))(XKe||={});p();var obn=fe(ei()),Hqt;(r=>(r.method="copilot/related",r.type=new obn.ProtocolRequestType(r.method)))(Hqt||={});p();var Gqt=fe(ei()),$qt;(r=>(r.method="statusNotification",r.type=new Gqt.ProtocolNotificationType(r.method)))($qt||={});var Vqt;(r=>(r.method="didChangeStatus/v2",r.type=new Gqt.ProtocolNotificationType(r.method)))(Vqt||={});var sbn=fe(require("path"));var abn=S.Object({uri:S.String(),visibleRange:S.Optional(Rf),selection:S.Optional(Rf)}),Wqt=class{constructor(e){this.turnContext=e}static{a(this,"CurrentEditorSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ni),n=await r.getOrReadTextDocument(e),o=id(n);if(await this.turnContext.collectFile(hE,e.uri,o),n.status==="valid"){let s=this.turnContext.conversation.source==="inline",c=new DO(n.document,e.selection,e.visibleRange),l=r.getRelativePath(n.document);if(o==="empty")return new Ar([`The currently open file \`${l}\` is empty.`]);let u=[[`Code excerpt from the currently open file \`${l}\`:`,1],[c.fromAllCode({addLineNumbers:s}),1]],d=[];if(c.selectionIsDocument())d=[["The user is selecting the entire file.",1]];else if(s){let[f,h]=c.fromSelectedCode({trimNewLines:!0}),m=h.start.line+1;if(_ue(h))d=[[`The user is selecting line ${m}, which is empty.`,1]];else{let g=h.end.line+1;d=[["The user is selecting"+(m==g?` line ${m}:`:` lines ${m} to ${g} (inclusive):`),1],[f,1]]}}else c.selectionIsEmpty()||(d=[["The user is selecting this code:",1],[c.fromSelectedCode({trimNewLines:!1})[0],1]]);return new Ar([...u,...d])}else if(n.status==="invalid")return new Ar([`The currently open file \`${sbn.basename(e.uri)}\` is content excluded.`])}},hE="current-editor",eJe=class{constructor(e){this._resolver=e;this.id=hE;this.type="explicit"}static{a(this,"CurrentEditorSkill")}description(){return"The code from the user's currently open file"}resolver(){return this._resolver}processor(e){return new Wqt(e)}};p();var cbn=S.Object({labels:S.Array(S.String())}),zqt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectLabelsSkillProcessor")}value(){return 1}processSkill(e){let r=[];return r.push([new Ar(["The developer is working on a project with the following characteristics (languages, frameworks):"]),1]),e.labels.forEach(n=>{r.push([new Ar([`- ${n}`]),.9]),this.turnContext.collectLabel(XP,n)}),new Ar(r)}},XP="project-labels",tJe=class{constructor(e){this._resolver=e;this.id=XP;this.type="explicit"}static{a(this,"ProjectLabelsSkill")}description(){return"The characteristics of the project the developer is working on (languages, frameworks)"}resolver(){return this._resolver}processor(e){return new zqt(e)}};p();p();p();var rJe=class{constructor(){this.languageId=["java","kotlin","scala","groovy"]}static{a(this,"JavaProjectMetadataLookup")}determineBuildTools(e){return[...e.buildTools]}determineApplicationFrameworks(e){let r=[];return De(e,r,"org.springframework.boot","Spring Boot"),De(e,r,"jakarta.jakartaee-api","Jakarta EE"),De(e,r,"javax:javaee-api","Java EE"),De(e,r,"org.apache.struts:struts2-core","Apache Struts"),De(e,r,"org.hibernate:hibernate-core","Hibernate"),De(e,r,"org.apache.wicket:wicket-core","Apache Wicket"),De(e,r,"javax.faces:jsf-api","JSF"),De(e,r,"org.grails:grails-core","Grails"),r}determineCoreLibraries(e){let r=[];return De(e,r,"com.google.guava","Google Guava"),De(e,r,"org.apache.commons:commons-lang3","Apache Commons Lang"),De(e,r,"org.apache.commons:commons-io","Apache Commons IO"),De(e,r,"joda-time:joda-time","Joda-Time"),De(e,r,"com.google.code.gson:gson","Google Gson"),De(e,r,"org.apache.commons:commons-math3","Apache Commons Math"),De(e,r,"org.apache.commons:commons-collections4","Apache Commons Collections"),De(e,r,"org.apache.commons:commons-net","Apache Commons Net"),De(e,r,"org.apache.poi:poi","Apache POI"),De(e,r,"com.fasterxml.jackson.core:jackson-databind","Jackson"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"org.junit.jupiter:junit-jupiter","JUnit"),De(e,r,"junit:junit","JUnit"),De(e,r,"org.testng:testng","TestNG"),De(e,r,"org.spockframework:spock-core","Spock"),De(e,r,"io.cucumber:cucumber-java","Cucumber"),De(e,r,"org.jboss.arquillian.junit:arquillian-junit-container","Arquillian"),r}determineTestingLibraries(e){let r=[];return De(e,r,"org.mockito","Mockito"),De(e,r,"org.assertj","AssertJ"),De(e,r,"org.hamcrest","Hamcrest"),De(e,r,"org.powermock","PowerMock"),De(e,r,"org.jmock","JMock"),De(e,r,"org.easymock","EasyMock"),De(e,r,"org.jmockit:jmockit","JMockit"),De(e,r,"com.github.tomakehurst:wiremock","WireMock"),De(e,r,"org.dbunit:dbunit","DBUnit"),De(e,r,"com.icegreen:greenmail","GreenMail"),De(e,r,"net.sourceforge.htmlunit:htmlunit","HtmlUnit"),De(e,r,"org.seleniumhq.selenium:selenium-java","Selenium"),De(e,r,"io.rest-assured:rest-assured","Rest-Assured"),De(e,r,"io.gatling.highcharts:gatling-charts-highcharts","Gatling"),De(e,r,"org.apache.jmeter:ApacheJMeter","JMeter"),r}},nJe=class{constructor(){this.languageId=["javascript","javascriptreact","typescript","typescriptreact","vue"]}static{a(this,"JavaScriptProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"@types/node","Node.js"),De(e,r,"react-native","React Native"),r.find(n=>n.name==="React Native")||De(e,r,"react","React"),De(e,r,"angular","Angular"),De(e,r,"vue","Vue.js"),De(e,r,"ember","Ember.js"),De(e,r,"backbone","Backbone.js"),De(e,r,"meteor","Meteor"),De(e,r,"polymer","Polymer"),De(e,r,"aurelia","Aurelia"),De(e,r,"knockout","Knockout.js"),De(e,r,"dojo","Dojo Toolkit"),De(e,r,"mithril","Mithril.js"),De(e,r,"marionette","Marionette.js"),De(e,r,"marko","Marko.js"),De(e,r,"svelte","Svelte"),De(e,r,"hyperapp","Hyperapp"),De(e,r,"inferno","Inferno.js"),De(e,r,"preact","Preact"),De(e,r,"riot","Riot.js"),De(e,r,"moon","Moon.js"),De(e,r,"stencil","Stencil.js"),r}determineCoreLibraries(e){let r=[];return De(e,r,"lodash","Lodash"),De(e,r,"moment","Moment.js"),De(e,r,"axios","Axios"),De(e,r,"redux","Redux"),De(e,r,"recoil","Recoil"),De(e,r,"jquery","jQuery"),De(e,r,"d3","D3.js"),De(e,r,"underscore","Underscore.js"),De(e,r,"ramda","Ramda"),De(e,r,"immutable","Immutable.js"),De(e,r,"rxjs","RxJS"),De(e,r,"three","Three.js"),De(e,r,"socket.io","Socket.IO"),De(e,r,"express","Express.js"),De(e,r,"next","Next.js"),De(e,r,"puppeteer","Puppeteer"),De(e,r,"cheerio","Cheerio"),De(e,r,"nodemailer","Nodemailer"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"jest","Jest"),De(e,r,"mocha","Mocha"),De(e,r,"jasmine","Jasmine"),De(e,r,"ava","AVA"),De(e,r,"qunit","QUnit"),De(e,r,"tape","Tape"),r}determineTestingLibraries(e){let r=[];return De(e,r,"chai","Chai"),De(e,r,"sinon","Sinon"),De(e,r,"enzyme","Enzyme"),De(e,r,"protractor","Protractor"),De(e,r,"supertest","Supertest"),De(e,r,"nock","Nock"),De(e,r,"cypress","Cypress"),De(e,r,"@testing-library/react","React Testing Library"),r}},iJe=class{constructor(){this.languageId="go"}static{a(this,"GoProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"github.com/gorilla/mux","Gorilla Mux"),De(e,r,"github.com/go-chi/chi","Chi"),De(e,r,"github.com/gin-gonic/gin","Gin"),De(e,r,"github.com/labstack/echo","Echo"),De(e,r,"github.com/revel/revel","Revel"),De(e,r,"github.com/astaxie/beego","Beego"),De(e,r,"github.com/go-martini/martini","Martini"),De(e,r,"github.com/gobuffalo/buffalo","Buffalo"),De(e,r,"github.com/goji/goji","Goji"),De(e,r,"github.com/hoisie/web","Web.go"),r}determineCoreLibraries(e){let r=[];return De(e,r,"net/http","net/http"),De(e,r,"fmt","fmt"),De(e,r,"io","io"),De(e,r,"time","time"),De(e,r,"math","math"),De(e,r,"strconv","strconv"),De(e,r,"strings","strings"),De(e,r,"sort","sort"),De(e,r,"encoding/json","encoding/json"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"github.com/onsi/ginkgo","ginkgo"),De(e,r,"github.com/onsi/gomega","gomega"),De(e,r,"github.com/stretchr/testify","testify"),De(e,r,"gopkg.in/check.v1","gocheck"),De(e,r,"github.com/franela/goblin","goblin"),De(e,r,"github.com/DATA-DOG/godog","godog"),De(e,r,"github.com/stesla/gospec","gospec"),De(e,r,"github.com/rjeczalik/gotest","gotest"),De(e,r,"github.com/smartystreets/goconvey","goconvey"),r}determineTestingLibraries(e){let r=[];return De(e,r,"github.com/stretchr/testify","Testify"),De(e,r,"github.com/smartystreets/goconvey","GoConvey"),De(e,r,"github.com/onsi/ginkgo","Ginkgo"),De(e,r,"github.com/golang/mock","GoMock"),De(e,r,"gopkg.in/check.v1","GoCheck"),De(e,r,"github.com/franela/goblin","Goblin"),De(e,r,"github.com/DATA-DOG/godog","GoDog"),De(e,r,"github.com/onsi/gomega","Gomega"),De(e,r,"github.com/stesla/gospec","GoSpec"),De(e,r,"github.com/rjeczalik/gotest","GoTest"),r}},oJe=class{constructor(){this.languageId=["python","jupyter"]}static{a(this,"PythonProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"flask","Flask"),De(e,r,"django","Django"),De(e,r,"pyramid","Pyramid"),De(e,r,"tornado","Tornado"),De(e,r,"fastapi","FastAPI"),r}determineCoreLibraries(e){let r=[];return De(e,r,"requests","requests"),De(e,r,"numpy","numpy"),De(e,r,"pandas","pandas"),De(e,r,"scipy","scipy"),De(e,r,"matplotlib","matplotlib"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"pytest","Pytest"),De(e,r,"unittest","Unittest"),De(e,r,"doctest","Doctest"),De(e,r,"nose","Nose"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mock","Mock"),De(e,r,"hypothesis","Hypothesis"),De(e,r,"behave","Behave"),De(e,r,"lettuce","Lettuce"),De(e,r,"testify","Testify"),De(e,r,"pyhamcrest","PyHamcrest"),r}},sJe=class{constructor(){this.languageId=["php","blade"]}static{a(this,"PhpProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"laravel/framework","Laravel"),De(e,r,"symfony/symfony","Symfony"),De(e,r,"slim/slim","Slim"),De(e,r,"cakephp/cakephp","CakePHP"),De(e,r,"yiisoft/yii2","Yii"),De(e,r,"zendframework/zendframework","Zend Framework"),De(e,r,"phalcon/cphalcon","Phalcon"),De(e,r,"bcosca/fatfree","Fat-Free"),De(e,r,"fuel/fuel","FuelPHP"),De(e,r,"phpixie/framework","PHPixie"),r}determineCoreLibraries(e){let r=[];return De(e,r,"monolog/monolog","Monolog"),De(e,r,"vlucas/phpdotenv","PHP dotenv"),De(e,r,"symfony/console","Symfony Console"),De(e,r,"guzzlehttp/guzzle","GuzzleHttp"),De(e,r,"ramsey/uuid","Ramsey UUID"),De(e,r,"doctrine/orm","Doctrine ORM"),De(e,r,"php-di/php-di","PHP-DI"),De(e,r,"phpunit/php-timer","PHPUnit Timer"),De(e,r,"symfony/finder","Symfony Finder"),De(e,r,"symfony/yaml","Symfony Yaml"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"phpunit/phpunit","PHPUnit"),De(e,r,"behat/behat","Behat"),De(e,r,"phpspec/phpspec","PHPSpec"),De(e,r,"codeception/codeception","Codeception"),De(e,r,"atoum/atoum","Atoum"),De(e,r,"pestphp/pest","PestPHP"),De(e,r,"kahlan/kahlan","Kahlan"),De(e,r,"peridot-php/peridot","Peridot"),De(e,r,"phake/phake","Phake"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mockery/mockery","Mockery"),De(e,r,"php-mock/php-mock","PHP-Mock"),De(e,r,"php-mock/php-mock-phpunit","PHP-Mock PHPUnit"),De(e,r,"padraic/mockery","Padraic Mockery"),De(e,r,"phpspec/prophecy","PHPSpec Prophecy"),De(e,r,"phpunit/php-invoker","PHPUnit Invoker"),De(e,r,"phpunit/php-token-stream","PHPUnit Token Stream"),De(e,r,"phpunit/php-code-coverage","PHPUnit Code Coverage"),De(e,r,"phpunit/php-timer","PHPUnit Timer"),De(e,r,"phpunit/php-text-template","PHPUnit Text Template"),r}},aJe=class{constructor(){this.languageId="csharp"}static{a(this,"CSharpProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"Microsoft.NETCore.App",".NET Core"),De(e,r,"Microsoft.AspNetCore.App","ASP.NET Core"),r}determineCoreLibraries(e){let r=[];return De(e,r,"EntityFramework","Entity Framework"),De(e,r,"Newtonsoft.Json","Newtonsoft.Json"),De(e,r,"AutoMapper","AutoMapper"),De(e,r,"Serilog","Serilog"),De(e,r,"Dapper","Dapper"),De(e,r,"Polly","Polly"),De(e,r,"FluentValidation","FluentValidation"),De(e,r,"MediatR","MediatR"),De(e,r,"Hangfire","Hangfire"),De(e,r,"RabbitMQ.Client","RabbitMQ.Client"),De(e,r,"MassTransit","MassTransit"),De(e,r,"Microsoft.Extensions.Logging","Microsoft.Extensions.Logging"),De(e,r,"Microsoft.Extensions.DependencyInjection","Microsoft.Extensions.DependencyInjection"),De(e,r,"Microsoft.Extensions.Configuration","Microsoft.Extensions.Configuration"),De(e,r,"Microsoft.Extensions.Http","Microsoft.Extensions.Http"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"xunit","xUnit"),De(e,r,"NUnit","NUnit"),De(e,r,"SpecFlow","SpecFlow"),r}determineTestingLibraries(e){let r=[];return De(e,r,"Moq","Moq"),De(e,r,"FluentAssertions","FluentAssertions"),De(e,r,"Bogus","Bogus"),De(e,r,"RestSharp","RestSharp"),De(e,r,"Swashbuckle.AspNetCore","Swashbuckle.AspNetCore"),r}},cJe=class{constructor(){this.languageId="dart"}static{a(this,"DartProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"flutter","Flutter"),De(e,r,"angular","AngularDart"),r}determineCoreLibraries(e){let r=[];return De(e,r,"dartx","dartx"),De(e,r,"provider","Provider"),De(e,r,"rxdart","RxDart"),De(e,r,"dio","Dio"),De(e,r,"json_serializable","json_serializable"),De(e,r,"freezed","Freezed"),De(e,r,"moor","Moor"),De(e,r,"hive","Hive"),De(e,r,"http","http"),De(e,r,"path","path"),De(e,r,"intl","intl"),De(e,r,"equatable","equatable"),De(e,r,"get_it","get_it"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"test","test"),De(e,r,"flutter_test","flutter_test"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mockito","mockito"),De(e,r,"bloc_test","bloc_test"),r}},lJe=class{constructor(){this.languageId="ruby"}static{a(this,"RubyProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"rails","Rails"),De(e,r,"sinatra","Sinatra"),De(e,r,"hanami","Hanami"),De(e,r,"grape","Grape"),De(e,r,"roda","Roda"),De(e,r,"padrino","Padrino"),De(e,r,"cuba","Cuba"),De(e,r,"ramaze","Ramaze"),De(e,r,"nyara","Nyara"),De(e,r,"rack","Rack"),r}determineCoreLibraries(e){let r=[];return De(e,r,"active_record","ActiveRecord"),De(e,r,"sequel","Sequel"),De(e,r,"rom","ROM"),De(e,r,"datamapper","DataMapper"),De(e,r,"mongoid","Mongoid"),De(e,r,"neo4j","Neo4j"),De(e,r,"redis","Redis"),De(e,r,"cassandra","Cassandra"),De(e,r,"couchrest","CouchRest"),De(e,r,"riak","Riak"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"rspec","RSpec"),De(e,r,"minitest","Minitest"),De(e,r,"cucumber","Cucumber"),De(e,r,"spinach","Spinach"),De(e,r,"turnip","Turnip"),De(e,r,"bacon","Bacon"),De(e,r,"shoulda","Shoulda"),De(e,r,"test-unit","Test::Unit"),De(e,r,"wrong","Wrong"),De(e,r,"contest","Contest"),r}determineTestingLibraries(e){let r=[];return De(e,r,"factory_bot","FactoryBot"),De(e,r,"faker","Faker"),De(e,r,"ffaker","FFaker"),De(e,r,"fabrication","Fabrication"),De(e,r,"machinist","Machinist"),De(e,r,"mocha","Mocha"),De(e,r,"flexmock","FlexMock"),De(e,r,"rr","RR"),De(e,r,"bourne","Bourne"),De(e,r,"not_a_mock","NotAMock"),r}},uJe=class{constructor(){this.languageId="rust"}static{a(this,"RustProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"tokio","tokio"),De(e,r,"async-std","async-std"),De(e,r,"hyper","hyper"),De(e,r,"actix-web","actix-web"),De(e,r,"rocket","rocket"),r}determineCoreLibraries(e){let r=[];return De(e,r,"serde","serde"),De(e,r,"regex","regex"),De(e,r,"rand","rand"),De(e,r,"log","log"),De(e,r,"lazy_static","lazy_static"),De(e,r,"libc","libc"),De(e,r,"futures","futures"),De(e,r,"rayon","rayon"),De(e,r,"reqwest","reqwest"),De(e,r,"warp","warp"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"test-case","test-case"),De(e,r,"proptest","proptest"),De(e,r,"quickcheck","quickcheck"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mockall","mockall"),De(e,r,"double","double"),De(e,r,"rstest","rstest"),De(e,r,"mockiato","mockiato"),De(e,r,"mock_derive","mock_derive"),De(e,r,"mocktopus","mocktopus"),De(e,r,"mockers","mockers"),De(e,r,"mock_it","mock_it"),r}},dJe=class{constructor(){this.languageId=["c","cpp"]}static{a(this,"CProjectMetadataLookup")}determineBuildTools(e){return e.buildTools.filter(r=>["gcc","clang","make","cmake","autotools","ninja","meson"].includes(r.name))}determineApplicationFrameworks(e){return e.libraries.filter(r=>["libc","libuv","openssl","zlib","libevent","libcurl"].includes(r.name))}determineCoreLibraries(e){return e.libraries.filter(r=>["libpng","libjpeg","libxml2","sqlite","postgres","mysql"].includes(r.name))}determineTestingFrameworks(e){return e.libraries.filter(r=>["unity","criterion","cmocka","check","ctest","minunit"].includes(r.name))}determineTestingLibraries(e){return e.libraries.filter(r=>["cmock","fff","trompeloeil","fakeit"].includes(r.name))}};function De(t,e,r,n){let o=t.libraries.find(s=>s.name.toLowerCase().indexOf(r.toLowerCase())>-1);o&&e.push({name:n,version:o.version})}a(De,"addFromLibraries");var fJe=class{constructor(e,r){this.languageId=e;this.delegates=r}static{a(this,"CompositeProjectMetadataLookup")}determineBuildTools(e){return this.delegates.map(r=>r.determineBuildTools(e)).flat()}determineApplicationFrameworks(e){return this.delegates.map(r=>r.determineApplicationFrameworks(e)).flat()}determineCoreLibraries(e){return this.delegates.map(r=>r.determineCoreLibraries(e)).flat()}determineTestingFrameworks(e){return this.delegates.map(r=>r.determineTestingFrameworks(e)).flat()}determineTestingLibraries(e){return this.delegates.map(r=>r.determineTestingLibraries(e)).flat()}};function ubn(t){return t.language.version?t.language.name+" "+t.language.version:t.language.name}a(ubn,"determineProgrammingLanguage");var lbn=[new rJe,new nJe,new iJe,new oJe,new sJe,new aJe,new cJe,new lJe,new uJe,new dJe];function dbn(t){let e=lbn.find(r=>typeof r.languageId=="string"?r.languageId===t:Array.isArray(r.languageId)?r.languageId.includes(t):!1)??new fJe(t,lbn);return new Yqt(e)}a(dbn,"getMetadataLookup");var Yqt=class{constructor(e){this.delegate=e;this.languageId=e.languageId}static{a(this,"DistinctProjectMetadataLookup")}determineBuildTools(e){return this.deduplicateDependencies(this.delegate.determineBuildTools(e))}determineApplicationFrameworks(e){return this.deduplicateDependencies(this.delegate.determineApplicationFrameworks(e))}determineCoreLibraries(e){return this.deduplicateDependencies(this.delegate.determineCoreLibraries(e))}determineTestingFrameworks(e){return this.deduplicateDependencies(this.delegate.determineTestingFrameworks(e))}determineTestingLibraries(e){return this.deduplicateDependencies(this.delegate.determineTestingLibraries(e))}deduplicateDependencies(e){let r=[];return e.forEach(n=>{r.find(o=>o.name===n.name)||r.push(n)}),r}};var fbn=S.Object({name:S.String(),version:S.Optional(S.String())}),pbn=S.Object({language:S.Object({id:S.String(),name:S.String(),version:S.Optional(S.String())}),libraries:S.Array(fbn),buildTools:S.Array(fbn)}),Kqt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectMetadataSkillProcessor")}value(){return 1}processSkill(e){let r=[];r.push([new Ar([`The user is working on a project with the following characteristics: +`]),1]);let n=dbn(e.language.id);return this.addProgrammingLanguage(e,r),this.addBuildTools(e,r,n),this.addApplicationFramework(e,r,n),this.addCoreLibraries(e,r,n),this.addTestingFrameworks(e,r,n),this.addTestingLibraries(e,r,n),new Ar(r)}addProgrammingLanguage(e,r){let n=ubn(e);this.turnContext.collectLabel(NO,n),r.push([new Ar([`- programming language: ${n}`]),1])}addBuildTools(e,r,n){this.addToPrompt(r,"- build tools:",n.determineBuildTools(e))}addApplicationFramework(e,r,n){this.addToPrompt(r,"- application frameworks:",n.determineApplicationFrameworks(e))}addCoreLibraries(e,r,n){this.addToPrompt(r,"- core libraries:",n.determineCoreLibraries(e))}addTestingFrameworks(e,r,n){this.addToPrompt(r,"- testing frameworks:",n.determineTestingFrameworks(e))}addTestingLibraries(e,r,n){this.addToPrompt(r,"- testing libraries:",n.determineTestingLibraries(e))}addToPrompt(e,r,n){if(n.length>0){n.forEach(s=>{this.turnContext.collectLabel(NO,`${s.name}${s.version?" "+s.version:""}`)});let o=n.map(s=>` - ${s.name}${s.version?" "+s.version:""}`).join(` `);e.push([new Ar([`${r} -${o}`]),1])}}},xO="project-metadata",UKe=class{constructor(e){this._resolver=e;this.id=xO;this.type="explicit"}static{a(this,"ProjectMetadataSkill")}description(){return"The characteristics of the project the developer is working on (languages, frameworks)"}resolver(){return this._resolver}processor(e){return new iqt(e)}};p();var Fvn=de(require("path"));var oqt=class{constructor(e){this.turnContext=e}static{a(this,"ReferencesSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ii),n=[],o=this.filterIncludedFiles(e),s=(await this.toFileChunks(o,r)).filter(c=>c!==void 0).flat();if(s.length>0)return n.push([new Ar(["The user wants you to consider the following referenced files when computing your answer."]),1]),n.push(...s),new Ar(n)}filterIncludedFiles(e){return e.filter(r=>r.type==="file"&&!this.turnContext.isFileIncluded(r.uri))}async toFileChunks(e,r){return await Promise.all(e.map(async n=>{if(n.type==="file"&&n.uri)return await this.elideReferencedFiles(r,n)}))}async elideReferencedFiles(e,r){let n=await e.getOrReadTextDocument(r),o=td(n);if(await this.turnContext.collectFile(qKe,r.uri,o),n.status==="valid"){let s=e.getRelativePath(n.document);if(o==="included"){let c=new IO(n.document,r.selection,r.visibleRange);return[[`Code excerpt from referenced file \`${s}\`:`,1],[c.fromAllCode({addLineNumbers:!1}),1]]}else if(o==="empty")return[[new Ar([`The referenced file \`${s}\` is empty.`]),1]]}else if(n.status==="invalid")return[[new Ar([`The referenced file \`${Fvn.basename(r.uri)}\` is content excluded.`]),1]]}},sqt=class{static{a(this,"ReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},qKe="references",QKe=class{constructor(){this.id=qKe;this.type="implicit"}static{a(this,"ReferencesSkill")}description(){return"The code from the user's referenced files"}resolver(){return new sqt}processor(e){return new oqt(e)}};var jK=a(()=>[xO,GP,qKe,lE],"mandatorySkills"),due=class{constructor(e,r){this.chatFetcher=r;this.metaPromptFetcher=new CKe(e,this.chatFetcher)}static{a(this,"ConversationContextCollector")}async collectContext(e,r,n,o,s,c){let l=[];if(s){let u=s.requiredSkills?await s.requiredSkills(e.ctx):[];l.push(...u.filter(d=>!jK().includes(d)))}else(await this.metaPromptFetcher.fetchPromptContext(e,await this.selectableSkillDescriptors(e.ctx,e.conversation,e.turn),r,n,o)).skillIds.reverse().forEach(d=>{!l.includes(d)&&!jK().includes(d)&&l.push(d)});if(c){let u=await c.additionalSkills(e.ctx);l.push(...u.filter(d=>!jK().includes(d)))}return l.push(...jK()),l=l.filter(u=>!this.isIgnoredSkill(u,e.turn)),{skillIds:e.ctx.get(zo).filterSupportedSkills(e.conversation.id,l)}}async selectableSkillDescriptors(e,r,n){let o=await this.getNonSelectableSkills(e),s=e.get(zo).getSupportedSkills(r.id),c=e.get(Yh).getDescriptors(),l=[];for(let u of c){if(o.includes(u.id)||!s.includes(u.id))continue;(!u.isAvailable||await u.isAvailable(e))&&!this.isIgnoredSkill(u.id,n)&&l.push(u)}return l}async getNonSelectableSkills(e){let r=await ew(e),n=(await Promise.all(r.map(o=>o.additionalSkills(e)))).flat();return[...jK(),...n]}isIgnoredSkill(e,r){return r.ignoredSkills?.some(n=>n.skillId===e)}};async function HKe(t,e){let[r,n,o]=await rjo(t,e);return o.push(...ojo(t)),r.length>0||n.length>0?[new Ar([[new Ar(["Consider the additional context:"]),1],[Cq(r,"inverseLinear"),.9],...n]),o]:[null,o]}a(HKe,"fromSkills");async function rjo(t,e){let r=[],n=[],o=[],s=[...t.turn.skills].reverse();for(let c of s){if(!await sjo(t,c.skillId,e?.languageId??""))continue;let[l,u]=await njo(t,c.skillId);l&&(jK().indexOf(c.skillId)===-1?n.push(l):o.push(l)),r.push(u)}return n.reverse(),o.reverse(),r.reverse(),[n,o,r]}a(rjo,"handleSkillsInReverse");async function njo(t,e){let n=t.ctx.get(Yh).getSkill(e);try{let o=Date.now(),s=await t.skillResolver.resolve(e),c=Date.now()-o;if(s){let l=n?.processor(t),u=Date.now(),d=await l?.processSkill(s,t),f=Date.now()-u;return d?await ijo(t,n,l,d,c,f):[void 0,await jKe(t,n,"unprocessable",void 0,c,f)]}else return[void 0,await jKe(t,n,"unresolvable",void 0,c)]}catch(o){if(ot.exception(t.ctx,o,`Error while resolving skill ${e}`),o instanceof Oxe)throw o;return[void 0,await jKe(t,n,"failed")]}}a(njo,"safelyProcessSkill");async function ijo(t,e,r,n,o,s){let c;return typeof n=="string"?c=new Ar([[n,1]]):c=n,[[c,r?.value()||0],await jKe(t,e,"resolved",c,o,s)]}a(ijo,"handleProcessedSkill");async function jKe(t,e,r,n,o,s){let l=t.collector.collectiblesForCollector(e?.id??"unknown").filter(d=>d.type==="file"),u={skillId:e?.id??"unknown",resolution:r,files:l,resolutionTimeMs:o,processingTimeMs:s};if(n){let d=await yq(t.ctx),f=await t.ctx.get(el).getBestChatModelConfig(xS("user",d)),h=n.elide(f.maxRequestTokens).getText();u.tokensPreEliding=ws(f.tokenizer).tokenLength(h)}return t.ctx.get(Ag).addResolution(t.turn.id,u),u}a(jKe,"determineResolution");function ojo(t){return t.turn.ignoredSkills.map(e=>({skillId:e.skillId,resolution:"ignored"}))}a(ojo,"handleIgnoredSkills");async function sjo(t,e,r){if(e!==xO&&e!==GP)return!0;let n=t.ctx.get(Zt),o=await n.fetchTokenAndUpdateExPValuesAndAssignments({languageId:r});return n.ideChatEnableProjectMetadata(o)?e===xO:e===GP}a(sjo,"includeSkill");var HK=class{static{a(this,"AbstractUserPromptStrategy")}async elidableContent(e,r){let n=[],o=lue(e.conversation.turns.slice(0,-1));o!==null&&n.push([o,.6]);let[s,c]=await this.elidableSkills(e,r);return s!==null&&(o!==null&&n.push(["",.1]),n.push([s,.8])),[new Ar(n),c]}async elidableSkills(e,r){return await HKe(e,r)}async promptContent(e,r,n){let o,s={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Ft(e.ctx,Ye.UseAgentsMd),includeNestedAgentsMdInstructions:Ft(e.ctx,Ye.UseNestedAgentsMd),includeClaudeMdInstructions:Ft(e.ctx,Ye.UseClaudeMd),includeNestedClaudeMdInstructions:Ft(e.ctx,Ye.UseNestedClaudeMd)},c=e.turn.extractContextFilesUri();e.turn.workspaceFolders&&e.turn.workspaceFolders.length>0?o=await e.ctx.get(bf).getInstructions(e.ctx,e.turn.workspaceFolders,s,c):e.turn.workspaceFolder&&(o=await e.ctx.get(bf).getInstructions(e.ctx,[e.turn.workspaceFolder],s,c));let l=GS(e.conversation.getLastTurn().request.message),u;o?typeof l=="string"?u=o+` +${o}`]),1])}}},NO="project-metadata",pJe=class{constructor(e){this._resolver=e;this.id=NO;this.type="explicit"}static{a(this,"ProjectMetadataSkill")}description(){return"The characteristics of the project the developer is working on (languages, frameworks)"}resolver(){return this._resolver}processor(e){return new Kqt(e)}};p();var hbn=fe(require("path"));var Jqt=class{constructor(e){this.turnContext=e}static{a(this,"ReferencesSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ni),n=[],o=this.filterIncludedFiles(e),s=(await this.toFileChunks(o,r)).filter(c=>c!==void 0).flat();if(s.length>0)return n.push([new Ar(["The user wants you to consider the following referenced files when computing your answer."]),1]),n.push(...s),new Ar(n)}filterIncludedFiles(e){return e.filter(r=>r.type==="file"&&!this.turnContext.isFileIncluded(r.uri))}async toFileChunks(e,r){return await Promise.all(e.map(async n=>{if(n.type==="file"&&n.uri)return await this.elideReferencedFiles(r,n)}))}async elideReferencedFiles(e,r){let n=await e.getOrReadTextDocument(r),o=id(n);if(await this.turnContext.collectFile(mJe,r.uri,o),n.status==="valid"){let s=e.getRelativePath(n.document);if(o==="included"){let c=new DO(n.document,r.selection,r.visibleRange);return[[`Code excerpt from referenced file \`${s}\`:`,1],[c.fromAllCode({addLineNumbers:!1}),1]]}else if(o==="empty")return[[new Ar([`The referenced file \`${s}\` is empty.`]),1]]}else if(n.status==="invalid")return[[new Ar([`The referenced file \`${hbn.basename(r.uri)}\` is content excluded.`]),1]]}},Zqt=class{static{a(this,"ReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},mJe="references",hJe=class{constructor(){this.id=mJe;this.type="implicit"}static{a(this,"ReferencesSkill")}description(){return"The code from the user's referenced files"}resolver(){return new Zqt}processor(e){return new Jqt(e)}};var ZK=a(()=>[NO,XP,mJe,hE],"mandatorySkills"),vue=class{constructor(e,r){this.chatFetcher=r;this.metaPromptFetcher=new KKe(e,this.chatFetcher)}static{a(this,"ConversationContextCollector")}async collectContext(e,r,n,o,s,c){let l=[];if(s){let u=s.requiredSkills?await s.requiredSkills(e.ctx):[];l.push(...u.filter(d=>!ZK().includes(d)))}else(await this.metaPromptFetcher.fetchPromptContext(e,await this.selectableSkillDescriptors(e.ctx,e.conversation,e.turn),r,n,o)).skillIds.reverse().forEach(d=>{!l.includes(d)&&!ZK().includes(d)&&l.push(d)});if(c){let u=await c.additionalSkills(e.ctx);l.push(...u.filter(d=>!ZK().includes(d)))}return l.push(...ZK()),l=l.filter(u=>!this.isIgnoredSkill(u,e.turn)),{skillIds:e.ctx.get(zo).filterSupportedSkills(e.conversation.id,l)}}async selectableSkillDescriptors(e,r,n){let o=await this.getNonSelectableSkills(e),s=e.get(zo).getSupportedSkills(r.id),c=e.get(Xh).getDescriptors(),l=[];for(let u of c){if(o.includes(u.id)||!s.includes(u.id))continue;(!u.isAvailable||await u.isAvailable(e))&&!this.isIgnoredSkill(u.id,n)&&l.push(u)}return l}async getNonSelectableSkills(e){let r=await aw(e),n=(await Promise.all(r.map(o=>o.additionalSkills(e)))).flat();return[...ZK(),...n]}isIgnoredSkill(e,r){return r.ignoredSkills?.some(n=>n.skillId===e)}};async function AJe(t,e){let[r,n,o]=await aGo(t,e);return o.push(...uGo(t)),r.length>0||n.length>0?[new Ar([[new Ar(["Consider the additional context:"]),1],[Oq(r,"inverseLinear"),.9],...n]),o]:[null,o]}a(AJe,"fromSkills");async function aGo(t,e){let r=[],n=[],o=[],s=[...t.turn.skills].reverse();for(let c of s){if(!await dGo(t,c.skillId,e?.languageId??""))continue;let[l,u]=await cGo(t,c.skillId);l&&(ZK().indexOf(c.skillId)===-1?n.push(l):o.push(l)),r.push(u)}return n.reverse(),o.reverse(),r.reverse(),[n,o,r]}a(aGo,"handleSkillsInReverse");async function cGo(t,e){let n=t.ctx.get(Xh).getSkill(e);try{let o=Date.now(),s=await t.skillResolver.resolve(e),c=Date.now()-o;if(s){let l=n?.processor(t),u=Date.now(),d=await l?.processSkill(s,t),f=Date.now()-u;return d?await lGo(t,n,l,d,c,f):[void 0,await gJe(t,n,"unprocessable",void 0,c,f)]}else return[void 0,await gJe(t,n,"unresolvable",void 0,c)]}catch(o){if(ot.exception(t.ctx,o,`Error while resolving skill ${e}`),o instanceof twe)throw o;return[void 0,await gJe(t,n,"failed")]}}a(cGo,"safelyProcessSkill");async function lGo(t,e,r,n,o,s){let c;return typeof n=="string"?c=new Ar([[n,1]]):c=n,[[c,r?.value()||0],await gJe(t,e,"resolved",c,o,s)]}a(lGo,"handleProcessedSkill");async function gJe(t,e,r,n,o,s){let l=t.collector.collectiblesForCollector(e?.id??"unknown").filter(d=>d.type==="file"),u={skillId:e?.id??"unknown",resolution:r,files:l,resolutionTimeMs:o,processingTimeMs:s};if(n){let d=await Pq(t.ctx),f=await t.ctx.get(tl).getBestChatModelConfig(DS("user",d)),h=n.elide(f.maxRequestTokens).getText();u.tokensPreEliding=ws(f.tokenizer).tokenLength(h)}return t.ctx.get(vg).addResolution(t.turn.id,u),u}a(gJe,"determineResolution");function uGo(t){return t.turn.ignoredSkills.map(e=>({skillId:e.skillId,resolution:"ignored"}))}a(uGo,"handleIgnoredSkills");async function dGo(t,e,r){if(e!==NO&&e!==XP)return!0;let n=t.ctx.get(Jt),o=await n.fetchTokenAndUpdateExPValuesAndAssignments({languageId:r});return n.ideChatEnableProjectMetadata(o)?e===NO:e===XP}a(dGo,"includeSkill");var XK=class{static{a(this,"AbstractUserPromptStrategy")}async elidableContent(e,r){let n=[],o=Eue(e.conversation.turns.slice(0,-1));o!==null&&n.push([o,.6]);let[s,c]=await this.elidableSkills(e,r);return s!==null&&(o!==null&&n.push(["",.1]),n.push([s,.8])),[new Ar(n),c]}async elidableSkills(e,r){return await AJe(e,r)}async promptContent(e,r,n){let o,s={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Rt(e.ctx,ze.UseAgentsMd),includeNestedAgentsMdInstructions:Rt(e.ctx,ze.UseNestedAgentsMd),includeClaudeMdInstructions:Rt(e.ctx,ze.UseClaudeMd),includeNestedClaudeMdInstructions:Rt(e.ctx,ze.UseNestedClaudeMd)},c=e.turn.extractContextFilesUri();e.turn.workspaceFolders&&e.turn.workspaceFolders.length>0?o=await e.ctx.get(wf).getInstructions(e.ctx,e.turn.workspaceFolders,s,c):e.turn.workspaceFolder&&(o=await e.ctx.get(wf).getInstructions(e.ctx,[e.turn.workspaceFolder],s,c));let l=JS(e.conversation.getLastTurn().request.message),u;o?typeof l=="string"?u=o+` -`+l:u=[{type:"text",text:o},...l]:u=l;let[d,f]=await this.elidableContent(e,n);return[[{role:"system",content:r},{role:"user",content:d},{role:"system",content:this.suffix(e)},{role:"user",content:u}],f]}},GKe=class extends HK{static{a(this,"PanelUserPromptStrategy")}suffix(e){return is` +`+l:u=[{type:"text",text:o},...l]:u=l;let[d,f]=await this.elidableContent(e,n);return[[{role:"system",content:r},{role:"user",content:d},{role:"system",content:this.suffix(e)},{role:"user",content:u}],f]}},yJe=class extends XK{static{a(this,"PanelUserPromptStrategy")}suffix(e){return ns` Use the above information, including the additional context and conversation history (if available) to answer the user's question below. Prioritize the context given in the user's question. When generating code, think step-by-step. Briefly explain the code and then output it in a single code block. @@ -2679,7 +2679,7 @@ ${o}`]),1])}}},xO="project-metadata",UKe=class{constructor(e){this._resolver=e;t Do not start your answer with a programming language name. Do not include follow up questions or suggestions for next turns. Respond in the following locale: ${e.conversation.userLanguage}. - `.trim()}};var $Ke=class extends HK{static{a(this,"InlineUserPromptStrategy")}suffix(e){return is` + `.trim()}};var EJe=class extends XK{static{a(this,"InlineUserPromptStrategy")}suffix(e){return ns` Use the above information, including the additional context and conversation history (if available) to answer the user's question below. Prioritize the context given in the user's question. Keep your answers short and impersonal. @@ -2734,7 +2734,7 @@ ${o}`]),1])}}},xO="project-metadata",UKe=class{constructor(e){this._resolver=e;t - The first row of a codeblock must never be indented. - Code in codeblocks must not contain line numbers. - You must not return a codeblock containing the final code, but only individual codeblocks for each change. - `.trim()}};p();var VKe=class{static{a(this,"MetaPromptStrategy")}elidableContent(e){let r=lue(e.turns.slice(0,-1)),n=[];return r!==null&&n.push([r,.6]),new Ar(n)}suffix(e){if(e.promptType!=="meta")throw new Error("Invalid prompt options for strategy");if(!e.supportedSkillDescriptors)throw new Error("Supported skills must be provided for meta prompts");return this.buildMetaPrompt(e.supportedSkillDescriptors)}buildMetaPrompt(e){return is` + `.trim()}};p();var _Je=class{static{a(this,"MetaPromptStrategy")}elidableContent(e){let r=Eue(e.turns.slice(0,-1)),n=[];return r!==null&&n.push([r,.6]),new Ar(n)}suffix(e){if(e.promptType!=="meta")throw new Error("Invalid prompt options for strategy");if(!e.supportedSkillDescriptors)throw new Error("Supported skills must be provided for meta prompts");return this.buildMetaPrompt(e.supportedSkillDescriptors)}buildMetaPrompt(e){return ns` Your task is to provide a helpful answer to the user's question. To help you create that answer, you can resolve skills that give you more context. Each skill has a description and some example user questions to help you understand when the skill may be useful. @@ -2743,14 +2743,14 @@ ${o}`]),1])}}},xO="project-metadata",UKe=class{constructor(e){this._resolver=e;t ${e.map(r=>`${this.skillToPrompt(r)} `).join(` `)} - `.trim()}createFunctionArgumentSchema(e){let r=Nyn(e.map(n=>n.id));return S.Object({skillIds:S.Array(r,{description:"The skill ids to resolve ranked from most to least useful"})})}toolConfig(e){if(e.promptType!=="meta")throw new Error("Invalid prompt options for strategy");return{tool_choice:{type:"function",function:{name:"resolveSkills"}},tools:[{type:"function",function:{name:"resolveSkills",description:"Resolves the skills by id to help answer the user question.",parameters:this.createFunctionArgumentSchema(e.supportedSkillDescriptors)}}],extractArguments(r){return{skillIds:B3(r).skillIds}}}}skillToPrompt(e){let r=e.description?e.description():e.id,n=`Skill Id: ${e.id} + `.trim()}createFunctionArgumentSchema(e){let r=l_n(e.map(n=>n.id));return S.Object({skillIds:S.Array(r,{description:"The skill ids to resolve ranked from most to least useful"})})}toolConfig(e){if(e.promptType!=="meta")throw new Error("Invalid prompt options for strategy");return{tool_choice:{type:"function",function:{name:"resolveSkills"}},tools:[{type:"function",function:{name:"resolveSkills",description:"Resolves the skills by id to help answer the user question.",parameters:this.createFunctionArgumentSchema(e.supportedSkillDescriptors)}}],extractArguments(r){return{skillIds:$3(r).skillIds}}}}skillToPrompt(e){let r=e.description?e.description():e.id,n=`Skill Id: ${e.id} Skill Description: ${r}`,o=e.examples?e.examples():[];return o.length>0&&(n+=` Skill Examples: ${o.map(s=>` - ${s}`).join(` -`)}`),n}promptContent(e,r,n){let o=e.conversation.getLastTurn().request.message,s=this.elidableContent(e.conversation);return[[{role:"system",content:r},{role:"user",content:s},{role:"system",content:this.suffix(n)},{role:"user",content:is` +`)}`),n}promptContent(e,r,n){let o=e.conversation.getLastTurn().request.message,s=this.elidableContent(e.conversation);return[[{role:"system",content:r},{role:"user",content:s},{role:"system",content:this.suffix(n)},{role:"user",content:ns` This is the user's question: ${Pn(o).trim()} - `.trim()}],[]]}};p();var WKe=class{static{a(this,"SuggestionsPromptStrategy")}toolConfig(){return{tool_choice:{type:"function",function:{name:"showSuggestions"}},tools:[{type:"function",function:{name:"showSuggestions",description:"Show the computed suggestions to the user",parameters:S.Object({suggestedTitle:S.String({description:"The suggested title for the conversation"}),followUp:S.String({description:"The suggested follow-up question for the conversation"})})}}],extractArguments(e){let r=B3(e);return{suggestedTitle:r.suggestedTitle,followUp:r.followUp}}}}suffix(e){return is` + `.trim()}],[]]}};p();var vJe=class{static{a(this,"SuggestionsPromptStrategy")}toolConfig(){return{tool_choice:{type:"function",function:{name:"showSuggestions"}},tools:[{type:"function",function:{name:"showSuggestions",description:"Show the computed suggestions to the user",parameters:S.Object({suggestedTitle:S.String({description:"The suggested title for the conversation"}),followUp:S.String({description:"The suggested follow-up question for the conversation"})})}}],extractArguments(e){let r=$3(e);return{suggestedTitle:r.suggestedTitle,followUp:r.followUp}}}}suffix(e){return ns` Your task is to come up with two suggestions: 1) Suggest a title for the current conversation based on the history of the conversation so far. @@ -2766,7 +2766,7 @@ ${o.map(s=>` - ${s}`).join(` - The question must not appear in the conversation history. - The question must not have already been answered. - The question must be in the following locale: ${e.conversation.userLanguage}. - `.trim()}elidableContent(e){let r=lue(e.turns.slice()),n=[];return r!==null&&n.push([r,.6]),new Ar(n)}promptContent(e,r,n){return[[{role:"system",content:r},{role:"user",content:this.elidableContent(e.conversation)},{role:"system",content:this.suffix(e)}],[]]}};p();var ajo=[{type:"function",function:{name:"queryWithKeywords",description:"Searches the workspace for synonyms and relevant keywords related to the original user query. These keywords could be used as file names, symbol names, abbreviations, or comments in the relevant code.",parameters:S.Object({keywords:S.Array(S.Object({keyword:S.String({description:"A keyword or phrase relevant to the original user query that a user could search to answer their question. Keywords are not generic and do not repeat."}),variations:S.Array(S.String(),{description:"An array of relevant variations of the keyword. Variations include synonyms and plural forms. Variations are not generic and do not repeat."})}))})}}],zKe=class extends HK{static{a(this,"UserQuerySynonymsPromptStrategy")}suffix(){return` + `.trim()}elidableContent(e){let r=Eue(e.turns.slice()),n=[];return r!==null&&n.push([r,.6]),new Ar(n)}promptContent(e,r,n){return[[{role:"system",content:r},{role:"user",content:this.elidableContent(e.conversation)},{role:"system",content:this.suffix(e)}],[]]}};p();var fGo=[{type:"function",function:{name:"queryWithKeywords",description:"Searches the workspace for synonyms and relevant keywords related to the original user query. These keywords could be used as file names, symbol names, abbreviations, or comments in the relevant code.",parameters:S.Object({keywords:S.Array(S.Object({keyword:S.String({description:"A keyword or phrase relevant to the original user query that a user could search to answer their question. Keywords are not generic and do not repeat."}),variations:S.Array(S.String(),{description:"An array of relevant variations of the keyword. Variations include synonyms and plural forms. Variations are not generic and do not repeat."})}))})}}],CJe=class extends XK{static{a(this,"UserQuerySynonymsPromptStrategy")}suffix(){return` You are a coding assistant that helps developers find relevant code in their workspace by providing a list of relevant keywords they can search for. The user will provide you with potentially relevant information from the workspace. This information may be incomplete. @@ -2789,39 +2789,39 @@ queryWithKeywords([ { "keyword": "base64", "variations": ["base 64"] }, { "keyword": "encode", "variations": ["encoding", "encoded", "encoder", "encoders"] } ]); -`.trim()}promptContent(e,r,n){if(n.promptType!=="synonyms")throw new Error("Invalid prompt options for user query strategy");let o=GS(e.conversation.getLastTurn().request.message),s=[{role:"system",content:r},{role:"system",content:this.suffix()},{role:"user",content:o}];return Promise.resolve([s,[]])}toolConfig(e){if(e.promptType!=="synonyms")throw new Error("Invalid prompt options for user query strategy");return{tools:ajo,tool_choice:{type:"function",function:{name:"queryWithKeywords"}},extractArguments(r){let n=B3(r).keywords;if(!n||!Array.isArray(n))return{keywords:[]};let o=new Set;for(let s of n)if(!(!uYe(s,"keyword")||!s.keyword||typeof s.keyword!="string")&&(o.add(s.keyword.toLowerCase()),!(!uYe(s,"variations")||!s.variations||!Array.isArray(s.variations))))for(let c of s.variations)typeof c=="string"&&o.add(c.toLowerCase());return{keywords:Array.from(o)??[]}}}}};var aqt=class{constructor(e,r,n){this.promptType=e;this.strategy=n;this.modelFamilies=Array.isArray(r)?r:[r]}static{a(this,"PromptStrategyDescriptor")}};function Lxe(t,e,r){return new aqt(t,e,r)}a(Lxe,"descriptor");var Uvn=[Lxe("user",xS("user"),()=>new GKe),Lxe("inline",xS("inline"),()=>new $Ke),Lxe("meta",xS("meta"),()=>new VKe),Lxe("suggestions",xS("suggestions"),()=>new WKe),Lxe("synonyms",xS("synonyms"),()=>new zKe)],YKe=class{static{a(this,"DefaultPromptStrategyFactory")}async createPromptStrategy(e,r,n){let o=await yq(e),s=xS(r,o),c=Uvn.find(l=>l.promptType===r&&s.includes(n));if(!c)throw new Error(`No prompt strategy found for promptType: ${r} and modelFamily: ${n}`);return c.strategy(e)}get descriptors(){return Uvn}};var qvn=require("console");var kA=class{constructor(e,r=new YKe){this.ctx=e;this.promptStrategyFactory=r}static{a(this,"ConversationPromptEngine")}async toPrompt(e,r){let n=await this.promptStrategyFactory.createPromptStrategy(this.ctx,r.promptType,r.modelConfiguration.modelFamily),o=await this.ctx.get(Ur).resolveSession(),[s,c]=await n.promptContent(e,this.safetyPrompt(r.userSelectedModelName??r.modelConfiguration.uiName,o),r),[l,u]=this.elideChatMessages(s,r.modelConfiguration);return await this.ctx.get(zh).inspectPrompt({type:r.promptType,prompt:Qvn(l),tokens:u}),this.ctx.get(Ag).addPrompt(e.turn.id,Qvn(l),r.promptType),{messages:l,tokens:u,skillResolutions:c,toolConfig:n.toolConfig?.(r)}}elideChatMessages(e,r){let n=e.filter(l=>!(typeof l.content=="string"||Array.isArray(l.content)));(0,qvn.assert)(n.length==1,"Only one elidable message is supported right now.");let o=this.computeNonElidableTokens(e,r),s=r.maxRequestTokens-o,c=e.map(l=>typeof l.content=="string"||Array.isArray(l.content)?l:{role:l.role,content:cjo(l.content.elide(s).getText())}).filter(l=>l.content.length>0);return[c,TQt(c,r)]}computeNonElidableTokens(e,r){let n=e.filter(o=>typeof o.content=="string");return n.push({role:"user",content:""}),TQt(n,r)}safetyPrompt(e,r){let n=this.ctx.get(Ir).getEditorInfo().readableName??this.ctx.get(Ir).getEditorInfo().name,o=ljo(process.platform);return L_n(this.ctx,n,r?.login,o,e)}};function cjo(t){return t.trimStart().replace(/^\[\.\.\.\]\n?/,"")}a(cjo,"processResultOfElidableText");function Qvn(t){return t.map(e=>Pn(e.content)).join(` +`.trim()}promptContent(e,r,n){if(n.promptType!=="synonyms")throw new Error("Invalid prompt options for user query strategy");let o=JS(e.conversation.getLastTurn().request.message),s=[{role:"system",content:r},{role:"system",content:this.suffix()},{role:"user",content:o}];return Promise.resolve([s,[]])}toolConfig(e){if(e.promptType!=="synonyms")throw new Error("Invalid prompt options for user query strategy");return{tools:fGo,tool_choice:{type:"function",function:{name:"queryWithKeywords"}},extractArguments(r){let n=$3(r).keywords;if(!n||!Array.isArray(n))return{keywords:[]};let o=new Set;for(let s of n)if(!(!FYe(s,"keyword")||!s.keyword||typeof s.keyword!="string")&&(o.add(s.keyword.toLowerCase()),!(!FYe(s,"variations")||!s.variations||!Array.isArray(s.variations))))for(let c of s.variations)typeof c=="string"&&o.add(c.toLowerCase());return{keywords:Array.from(o)??[]}}}}};var Xqt=class{constructor(e,r,n){this.promptType=e;this.strategy=n;this.modelFamilies=Array.isArray(r)?r:[r]}static{a(this,"PromptStrategyDescriptor")}};function rwe(t,e,r){return new Xqt(t,e,r)}a(rwe,"descriptor");var mbn=[rwe("user",DS("user"),()=>new yJe),rwe("inline",DS("inline"),()=>new EJe),rwe("meta",DS("meta"),()=>new _Je),rwe("suggestions",DS("suggestions"),()=>new vJe),rwe("synonyms",DS("synonyms"),()=>new CJe)],bJe=class{static{a(this,"DefaultPromptStrategyFactory")}async createPromptStrategy(e,r,n){let o=await Pq(e),s=DS(r,o),c=mbn.find(l=>l.promptType===r&&s.includes(n));if(!c)throw new Error(`No prompt strategy found for promptType: ${r} and modelFamily: ${n}`);return c.strategy(e)}get descriptors(){return mbn}};var Abn=require("console");var NA=class{constructor(e,r=new bJe){this.ctx=e;this.promptStrategyFactory=r}static{a(this,"ConversationPromptEngine")}async toPrompt(e,r){let n=await this.promptStrategyFactory.createPromptStrategy(this.ctx,r.promptType,r.modelConfiguration.modelFamily),o=await this.ctx.get(Mr).resolveSession(),[s,c]=await n.promptContent(e,this.safetyPrompt(r.userSelectedModelName??r.modelConfiguration.uiName,o),r),[l,u]=this.elideChatMessages(s,r.modelConfiguration);return await this.ctx.get(Zh).inspectPrompt({type:r.promptType,prompt:gbn(l),tokens:u}),this.ctx.get(vg).addPrompt(e.turn.id,gbn(l),r.promptType),{messages:l,tokens:u,skillResolutions:c,toolConfig:n.toolConfig?.(r)}}elideChatMessages(e,r){let n=e.filter(l=>!(typeof l.content=="string"||Array.isArray(l.content)));(0,Abn.assert)(n.length==1,"Only one elidable message is supported right now.");let o=this.computeNonElidableTokens(e,r),s=r.maxRequestTokens-o,c=e.map(l=>typeof l.content=="string"||Array.isArray(l.content)?l:{role:l.role,content:pGo(l.content.elide(s).getText())}).filter(l=>l.content.length>0);return[c,Aqt(c,r)]}computeNonElidableTokens(e,r){let n=e.filter(o=>typeof o.content=="string");return n.push({role:"user",content:""}),Aqt(n,r)}safetyPrompt(e,r){let n=this.ctx.get(Ir).getEditorInfo().readableName??this.ctx.get(Ir).getEditorInfo().name,o=hGo(process.platform);return fCn(this.ctx,n,r?.login,o,e)}};function pGo(t){return t.trimStart().replace(/^\[\.\.\.\]\n?/,"")}a(pGo,"processResultOfElidableText");function gbn(t){return t.map(e=>Pn(e.content)).join(` -`)}a(Qvn,"debugChatMessages");function ljo(t){switch(t){case"darwin":return"macOS";case"win32":return"Windows";case"linux":return"Linux";case"freebsd":return"FreeBSD";case"openbsd":return"OpenBSD";case"sunos":return"SunOS";case"aix":return"AIX";default:return}}a(ljo,"mapPlatformToOs");var bq=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"TurnSuggestions")}async fetchRawSuggestions(e,r,n,o){let s=await xo.getModelConfiguration(e.ctx,"suggestions",{tool_calls:!0}),c={promptType:"suggestions",modelConfiguration:s},l=await this.ctx.get(kA).toPrompt(e,c),u=o.extendedBy({messageSource:"chat.suggestions"},{promptTokenLen:l.tokens}),d={modelConfiguration:s,messages:l.messages,uiKind:n,llmInteraction:e.toLlmInteraction()};if(l.toolConfig===void 0)throw new Error("No tool call configuration found in suggestions prompt.");d.tool_choice=l.toolConfig.tool_choice,d.tools=l.toolConfig.tools;let f=await this.chatFetcher.fetchResponse(d,r,u);if(f.type!=="success"&&(ot.error(this.ctx,"Failed to fetch suggestions, trying again..."),f=await this.chatFetcher.fetchResponse(d,r,u)),f.type==="success"){if(!f.toolCalls||f.toolCalls.length===0){ot.error(this.ctx,"Missing tool call in suggestions response");return}let h=f.toolCalls[0],{followUp:m,suggestedTitle:g}=l.toolConfig.extractArguments(h);if(!m||!g){ot.error(this.ctx,"Missing follow-up or suggested title in suggestions response");return}return{followUp:m.trim(),suggestedTitle:g.trim(),promptTokenLen:l.tokens,numTokens:f.numTokens+h.approxNumTokens}}else if(f.type==="successMultiple"){ot.error(this.ctx,"successMultiple response is unexpected for suggestions");return}else if(f.type==="tool_calls"){ot.error(this.ctx,"tool_calls response is unexpected for suggestions");return}else{ot.error(this.ctx,`Failed to fetch suggestions due to reason: ${f.reason}`);return}}};p();p();var cqt="v1",$P=class extends Error{static{a(this,"CodingAgentError")}constructor(e){super(e),this.name=this.constructor.name}},tw=class extends $P{static{a(this,"CodingAgentAuthenticationError")}constructor(e){super(e)}},l0=class extends $P{static{a(this,"CodingAgentApiError")}constructor(e){super(e)}},sp=class extends $P{static{a(this,"CodingAgentValidationError")}constructor(e){super(e)}},Bxe=class extends $P{static{a(this,"CodingAgentInternalError")}constructor(e){super(e)}};p();var pue=new fe("codingAgentUtils"),fue=29950;function jvn(t,e,r){if(e.length>=fue)return pue.warn(t,`Truncation: Prompt length ${e.length} exceeds max of ${fue}`),e=e.slice(-fue),{problemStatement:e,isTruncated:!0};let n=!1;if(r&&e.length+r.length>=fue){let o=fue-e.length-2;pue.warn(t,`Truncation: Combined prompt and context length ${e.length+r.length} exceeds max of ${fue}`),r=o>0?r.slice(-o):"",n=!0}return{problemStatement:e+(r?` +`)}a(gbn,"debugChatMessages");function hGo(t){switch(t){case"darwin":return"macOS";case"win32":return"Windows";case"linux":return"Linux";case"freebsd":return"FreeBSD";case"openbsd":return"OpenBSD";case"sunos":return"SunOS";case"aix":return"AIX";default:return}}a(hGo,"mapPlatformToOs");var Lq=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"TurnSuggestions")}async fetchRawSuggestions(e,r,n,o){let s=await xo.getModelConfiguration(e.ctx,"suggestions",{tool_calls:!0}),c={promptType:"suggestions",modelConfiguration:s},l=await this.ctx.get(NA).toPrompt(e,c),u=o.extendedBy({messageSource:"chat.suggestions"},{promptTokenLen:l.tokens}),d={modelConfiguration:s,messages:l.messages,uiKind:n,llmInteraction:e.toLlmInteraction()};if(l.toolConfig===void 0)throw new Error("No tool call configuration found in suggestions prompt.");d.tool_choice=l.toolConfig.tool_choice,d.tools=l.toolConfig.tools;let f=await this.chatFetcher.fetchResponse(d,r,u);if(f.type!=="success"&&(ot.error(this.ctx,"Failed to fetch suggestions, trying again..."),f=await this.chatFetcher.fetchResponse(d,r,u)),f.type==="success"){if(!f.toolCalls||f.toolCalls.length===0){ot.error(this.ctx,"Missing tool call in suggestions response");return}let h=f.toolCalls[0],{followUp:m,suggestedTitle:g}=l.toolConfig.extractArguments(h);if(!m||!g){ot.error(this.ctx,"Missing follow-up or suggested title in suggestions response");return}return{followUp:m.trim(),suggestedTitle:g.trim(),promptTokenLen:l.tokens,numTokens:f.numTokens+h.approxNumTokens}}else if(f.type==="successMultiple"){ot.error(this.ctx,"successMultiple response is unexpected for suggestions");return}else if(f.type==="tool_calls"){ot.error(this.ctx,"tool_calls response is unexpected for suggestions");return}else{ot.error(this.ctx,`Failed to fetch suggestions due to reason: ${f.reason}`);return}}};p();p();var ejt="v1",cw=class extends Error{static{a(this,"CodingAgentError")}constructor(e){super(e),this.name=this.constructor.name}},lw=class extends cw{static{a(this,"CodingAgentAuthenticationError")}constructor(e){super(e)}},rm=class extends cw{static{a(this,"CodingAgentApiError")}constructor(e){super(e)}},lp=class extends cw{static{a(this,"CodingAgentValidationError")}constructor(e){super(e)}},Cue=class extends cw{static{a(this,"CodingAgentInternalError")}constructor(e){super(e)}};p();var Sue=new pe("codingAgentUtils"),bue=29950;function ybn(t,e,r){if(e.length>=bue)return Sue.warn(t,`Truncation: Prompt length ${e.length} exceeds max of ${bue}`),e=e.slice(-bue),{problemStatement:e,isTruncated:!0};let n=!1;if(r&&e.length+r.length>=bue){let o=bue-e.length-2;Sue.warn(t,`Truncation: Combined prompt and context length ${e.length+r.length} exceeds max of ${bue}`),r=o>0?r.slice(-o):"",n=!0}return{problemStatement:e+(r?` -${r}`:""),isTruncated:n}}a(jvn,"truncatePrompt");function hue(t){return t.length<=20?t:t.substring(0,20)+"..."}a(hue,"generateTitleFromUserPrompt");function Hvn(t){return`Cloud agent has begun work on **${t||"your request"}** and will update this pull request as work progresses.`}a(Hvn,"formatBodyPlaceholder");function Gvn(t,e,r){let n=t.get(ii),o=[],s=new Set;if(e)for(let c of e)try{if(c.type==="file"||c.type==="directory"){let l=n.getRelativePath({uri:c.uri});l&&!s.has(l)&&(o.push(l),s.add(l),pue.debug(t,`Added ${c.type} context: ${l}`))}}catch(l){let u=c.type==="file"||c.type==="directory"||c.type==="tool"?c.uri:`${c.type} reference`;pue.warn(t,`Error extracting relative path for ${u}`,l)}if(r?.uri)try{let c=n.getRelativePath({uri:r.uri});c&&!s.has(c)&&(o.push(c),s.add(c),pue.debug(t,`Added active editor: ${c}`))}catch(c){pue.warn(t,`Error extracting relative path for active editor ${r.uri}`,c)}return o}a(Gvn,"extractContextPaths");function $vn(t){return t.length===0?"":`The user has attached the following files from their workspace: +${r}`:""),isTruncated:n}}a(ybn,"truncatePrompt");function Tue(t){return t.length<=20?t:t.substring(0,20)+"..."}a(Tue,"generateTitleFromUserPrompt");function Ebn(t){return`Cloud agent has begun work on **${t||"your request"}** and will update this pull request as work progresses.`}a(Ebn,"formatBodyPlaceholder");function _bn(t,e,r){let n=t.get(ni),o=[],s=new Set;if(e)for(let c of e)try{if(c.type==="file"||c.type==="directory"){let l=n.getRelativePath({uri:c.uri});l&&!s.has(l)&&(o.push(l),s.add(l),Sue.debug(t,`Added ${c.type} context: ${l}`))}}catch(l){let u=c.type==="file"||c.type==="directory"||c.type==="tool"?c.uri:`${c.type} reference`;Sue.warn(t,`Error extracting relative path for ${u}`,l)}if(r?.uri)try{let c=n.getRelativePath({uri:r.uri});c&&!s.has(c)&&(o.push(c),s.add(c),Sue.debug(t,`Added active editor: ${c}`))}catch(c){Sue.warn(t,`Error extracting relative path for active editor ${r.uri}`,c)}return o}a(_bn,"extractContextPaths");function vbn(t){return t.length===0?"":`The user has attached the following files from their workspace: ${t.map(r=>`- ${r}`).join(` -`)}`}a($vn,"formatContextFiles");p();p();var KKe=class extends Error{static{a(this,"GitHubClientError")}constructor(e){super(e)}},uE=class extends KKe{static{a(this,"GitHubClientAuthenticationError")}constructor(e="No authenticated GitHub session available"){super(e)}},Fd=class extends KKe{constructor(r,n,o){super(o||`GitHub API request failed: ${r} ${n}`);this.status=r;this.statusText=n}static{a(this,"GitHubClientApiError")}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500&&this.status<600}};p();var lqt=(h=>(h.Actions="actions",h.Composer="composer",h.Erlang="erlang",h.Go="go",h.Maven="maven",h.Npm="npm",h.Nuget="nuget",h.Pip="pip",h.Pub="pub",h.RubyGems="rubygems",h.Rust="rust",h))(lqt||{});p();p();p();function Sq(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}a(Sq,"getUserAgent");p();p();function JKe(t,e,r,n){if(typeof r!="function")throw new Error("method for before hook must be a function");return n||(n={}),Array.isArray(e)?e.reverse().reduce((o,s)=>JKe.bind(null,t,s,o,n),r)():Promise.resolve().then(()=>t.registry[e]?t.registry[e].reduce((o,s)=>s.hook.bind(null,o,n),r)():r(n))}a(JKe,"register");p();function Vvn(t,e,r,n){let o=n;t.registry[r]||(t.registry[r]=[]),e==="before"&&(n=a((s,c)=>Promise.resolve().then(o.bind(null,c)).then(s.bind(null,c)),"hook")),e==="after"&&(n=a((s,c)=>{let l;return Promise.resolve().then(s.bind(null,c)).then(u=>(l=u,o(l,c))).then(()=>l)},"hook")),e==="error"&&(n=a((s,c)=>Promise.resolve().then(s.bind(null,c)).catch(l=>o(l,c)),"hook")),t.registry[r].push({hook:n,orig:o})}a(Vvn,"addHook");p();function Wvn(t,e,r){if(!t.registry[e])return;let n=t.registry[e].map(o=>o.orig).indexOf(r);n!==-1&&t.registry[e].splice(n,1)}a(Wvn,"removeHook");var zvn=Function.bind,Yvn=zvn.bind(zvn);function Kvn(t,e,r){let n=Yvn(Wvn,null).apply(null,r?[e,r]:[e]);t.api={remove:n},t.remove=n,["before","error","after","wrap"].forEach(o=>{let s=r?[e,o,r]:[e,o];t[o]=t.api[o]=Yvn(Vvn,null).apply(null,s)})}a(Kvn,"bindApi");function ujo(){let t=Symbol("Singular"),e={registry:{}},r=JKe.bind(null,e,t);return Kvn(r,e,t),r}a(ujo,"Singular");function djo(){let t={registry:{}},e=JKe.bind(null,t);return Kvn(e,t),e}a(djo,"Collection");var Jvn={Singular:ujo,Collection:djo};p();p();var fjo="0.0.0-development",pjo=`octokit-endpoint.js/${fjo} ${Sq()}`,hjo={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":pjo},mediaType:{format:""}};function mjo(t){return t?Object.keys(t).reduce((e,r)=>(e[r.toLowerCase()]=t[r],e),{}):{}}a(mjo,"lowercaseKeys");function gjo(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);if(e===null)return!0;let r=Object.prototype.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Function.prototype.call(r)===Function.prototype.call(t)}a(gjo,"isPlainObject");function eCn(t,e){let r=Object.assign({},t);return Object.keys(e).forEach(n=>{gjo(e[n])?n in t?r[n]=eCn(t[n],e[n]):Object.assign(r,{[n]:e[n]}):Object.assign(r,{[n]:e[n]})}),r}a(eCn,"mergeDeep");function Zvn(t){for(let e in t)t[e]===void 0&&delete t[e];return t}a(Zvn,"removeUndefinedProperties");function dqt(t,e,r){if(typeof e=="string"){let[o,s]=e.split(" ");r=Object.assign(s?{method:o,url:s}:{url:o},r)}else r=Object.assign({},e);r.headers=mjo(r.headers),Zvn(r),Zvn(r.headers);let n=eCn(t||{},r);return r.url==="/graphql"&&(t&&t.mediaType.previews?.length&&(n.mediaType.previews=t.mediaType.previews.filter(o=>!n.mediaType.previews.includes(o)).concat(n.mediaType.previews)),n.mediaType.previews=(n.mediaType.previews||[]).map(o=>o.replace(/-preview/,""))),n}a(dqt,"merge");function Ajo(t,e){let r=/\?/.test(t)?"&":"?",n=Object.keys(e);return n.length===0?t:t+r+n.map(o=>o==="q"?"q="+e.q.split("+").map(encodeURIComponent).join("+"):`${o}=${encodeURIComponent(e[o])}`).join("&")}a(Ajo,"addQueryParameters");var yjo=/\{[^{}}]+\}/g;function Ejo(t){return t.replace(/(?:^\W+)|(?:(?r.concat(n),[]):[]}a(_jo,"extractUrlVariableNames");function Xvn(t,e){let r={__proto__:null};for(let n of Object.keys(t))e.indexOf(n)===-1&&(r[n]=t[n]);return r}a(Xvn,"omit");function tCn(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")),e}).join("")}a(tCn,"encodeReserved");function gue(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}a(gue,"encodeUnreserved");function Fxe(t,e,r){return e=t==="+"||t==="#"?tCn(e):gue(e),r?gue(r)+"="+e:e}a(Fxe,"encodeValue");function mue(t){return t!=null}a(mue,"isDefined");function uqt(t){return t===";"||t==="&"||t==="?"}a(uqt,"isKeyOperator");function vjo(t,e,r,n){var o=t[r],s=[];if(mue(o)&&o!=="")if(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||typeof o=="boolean")o=o.toString(),n&&n!=="*"&&(o=o.substring(0,parseInt(n,10))),s.push(Fxe(e,o,uqt(e)?r:""));else if(n==="*")Array.isArray(o)?o.filter(mue).forEach(function(c){s.push(Fxe(e,c,uqt(e)?r:""))}):Object.keys(o).forEach(function(c){mue(o[c])&&s.push(Fxe(e,o[c],c))});else{let c=[];Array.isArray(o)?o.filter(mue).forEach(function(l){c.push(Fxe(e,l))}):Object.keys(o).forEach(function(l){mue(o[l])&&(c.push(gue(l)),c.push(Fxe(e,o[l].toString())))}),uqt(e)?s.push(gue(r)+"="+c.join(",")):c.length!==0&&s.push(c.join(","))}else e===";"?mue(o)&&s.push(gue(r)):o===""&&(e==="&"||e==="?")?s.push(gue(r)+"="):o===""&&s.push("");return s}a(vjo,"getValues");function Cjo(t){return{expand:bjo.bind(null,t)}}a(Cjo,"parseUrl");function bjo(t,e){var r=["+","#",".","/",";","?","&"];return t=t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(n,o,s){if(o){let l="",u=[];if(r.indexOf(o.charAt(0))!==-1&&(l=o.charAt(0),o=o.substr(1)),o.split(/,/g).forEach(function(d){var f=/([^:\*]*)(?::(\d+)|(\*))?/.exec(d);u.push(vjo(e,l,f[1],f[2]||f[3]))}),l&&l!=="+"){var c=",";return l==="?"?c="&":l!=="#"&&(c=l),(u.length!==0?l:"")+u.join(c)}else return u.join(",")}else return tCn(s)}),t==="/"?t:t.replace(/\/$/,"")}a(bjo,"expand");function rCn(t){let e=t.method.toUpperCase(),r=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},t.headers),o,s=Xvn(t,["method","baseUrl","url","headers","request","mediaType"]),c=_jo(r);r=Cjo(r).expand(s),/^http/.test(r)||(r=t.baseUrl+r);let l=Object.keys(t).filter(f=>c.includes(f)).concat("baseUrl"),u=Xvn(s,l);if(!/application\/octet-stream/i.test(n.accept)&&(t.mediaType.format&&(n.accept=n.accept.split(/,/).map(f=>f.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${t.mediaType.format}`)).join(",")),r.endsWith("/graphql")&&t.mediaType.previews?.length)){let f=n.accept.match(/(?{let m=t.mediaType.format?`.${t.mediaType.format}`:"+json";return`application/vnd.github.${h}-preview${m}`}).join(",")}return["GET","HEAD"].includes(e)?r=Ajo(r,u):"data"in u?o=u.data:Object.keys(u).length&&(o=u),!n["content-type"]&&typeof o<"u"&&(n["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(e)&&typeof o>"u"&&(o=""),Object.assign({method:e,url:r,headers:n},typeof o<"u"?{body:o}:null,t.request?{request:t.request}:null)}a(rCn,"parse");function Sjo(t,e,r){return rCn(dqt(t,e,r))}a(Sjo,"endpointWithDefaults");function nCn(t,e){let r=dqt(t,e),n=Sjo.bind(null,r);return Object.assign(n,{DEFAULTS:r,defaults:nCn.bind(null,r),merge:dqt.bind(null,r),parse:rCn})}a(nCn,"withDefaults");var iCn=nCn(null,hjo);var ACn=de(cCn(),1);p();var Tjo=/^-?\d+$/,dCn=/^-?\d+n+$/,fqt=JSON.stringify,lCn=JSON.parse,Ijo=/^-?\d+n$/,xjo=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,wjo=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,fCn=a((t,e,r)=>"rawJSON"in JSON?fqt(t,(c,l)=>typeof l=="bigint"?JSON.rawJSON(l.toString()):typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r):t?fqt(t,(c,l)=>typeof l=="string"&&dCn.test(l)||typeof l=="bigint"?l.toString()+"n":typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r).replace(xjo,"$1$2$3").replace(wjo,"$1$2$3"):fqt(t,e,r),"JSONStringify"),tJe=new Map,Rjo=a(()=>{let t=JSON.parse.toString();if(tJe.has(t))return tJe.get(t);try{let e=JSON.parse("1",(r,n,o)=>!!o?.source&&o.source==="1");return tJe.set(t,e),e}catch{return tJe.set(t,!1),!1}},"isContextSourceSupported"),kjo=a((t,e,r,n)=>typeof e=="string"&&Ijo.test(e)?BigInt(e.slice(0,-1)):typeof e=="string"&&dCn.test(e)?e.slice(0,-1):typeof n!="function"?e:n(t,e,r),"convertMarkedBigIntsReviver"),Pjo=a((t,e)=>JSON.parse(t,(r,n,o)=>{let s=typeof n=="number"&&(n>Number.MAX_SAFE_INTEGER||n{if(!t)return lCn(t,e);if(Rjo())return Pjo(t,e);let r=t.replace(Djo,(n,o,s,c)=>{let l=n[0]==='"';if(l&&Njo.test(n))return n.substring(0,n.length-1)+'n"';let d=s||c,f=o&&(o.lengthkjo(n,o,s,e))},"JSONParse");p();var $K=class extends Error{static{a(this,"RequestError")}name;status;request;response;constructor(e,r,n){super(e,{cause:n.cause}),this.name="HttpError",this.status=Number.parseInt(r),Number.isNaN(this.status)&&(this.status=0);"response"in n&&(this.response=n.response);let o=Object.assign({},n.request);n.request.headers.authorization&&(o.headers=Object.assign({},n.request.headers,{authorization:n.request.headers.authorization.replace(/(?"","noop");async function gCn(t){let e=t.request?.fetch||globalThis.fetch;if(!e)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let r=t.request?.log||console,n=t.request?.parseSuccessResponseBody!==!1,o=Ljo(t.body)||Array.isArray(t.body)?fCn(t.body):t.body,s=Object.fromEntries(Object.entries(t.headers).map(([h,m])=>[h,String(m)])),c;try{c=await e(t.url,{method:t.method,body:o,redirect:t.request?.redirect,headers:s,signal:t.request?.signal,...t.body&&{duplex:"half"}})}catch(h){let m="Unknown Error";if(h instanceof Error){if(h.name==="AbortError")throw h.status=500,h;m=h.message,h.name==="TypeError"&&"cause"in h&&(h.cause instanceof Error?m=h.cause.message:typeof h.cause=="string"&&(m=h.cause))}let g=new $K(m,500,{request:t});throw g.cause=h,g}let l=c.status,u=c.url,d={};for(let[h,m]of c.headers)d[h]=m;let f={url:u,status:l,headers:d,data:""};if("deprecation"in d){let h=d.link&&d.link.match(/<([^<>]+)>; rel="deprecation"/),m=h&&h.pop();r.warn(`[@octokit/request] "${t.method} ${t.url}" is deprecated. It is scheduled to be removed on ${d.sunset}${m?`. See ${m}`:""}`)}if(l===204||l===205)return f;if(t.method==="HEAD"){if(l<400)return f;throw new $K(c.statusText,l,{response:f,request:t})}if(l===304)throw f.data=await pqt(c),new $K("Not modified",l,{response:f,request:t});if(l>=400)throw f.data=await pqt(c),new $K(Fjo(f.data),l,{response:f,request:t});return f.data=n?await pqt(c):c.body,f}a(gCn,"fetchWrapper");async function pqt(t){let e=t.headers.get("content-type");if(!e)return t.text().catch(mCn);let r=(0,ACn.safeParse)(e);if(Bjo(r)){let n="";try{return n=await t.text(),hCn(n)}catch{return n}}else return r.type.startsWith("text/")||r.parameters.charset?.toLowerCase()==="utf-8"?t.text().catch(mCn):t.arrayBuffer().catch(()=>new ArrayBuffer(0))}a(pqt,"getResponseData");function Bjo(t){return t.type==="application/json"||t.type==="application/scim+json"}a(Bjo,"isJSONResponse");function Fjo(t){if(typeof t=="string")return t;if(t instanceof ArrayBuffer)return"Unknown error";if("message"in t){let e="documentation_url"in t?` - ${t.documentation_url}`:"";return Array.isArray(t.errors)?`${t.message}: ${t.errors.map(r=>JSON.stringify(r)).join(", ")}${e}`:`${t.message}${e}`}return`Unknown error: ${JSON.stringify(t)}`}a(Fjo,"toErrorMessage");function hqt(t,e){let r=t.defaults(e);return Object.assign(a(function(o,s){let c=r.merge(o,s);if(!c.request||!c.request.hook)return gCn(r.parse(c));let l=a((u,d)=>gCn(r.parse(r.merge(u,d))),"request2");return Object.assign(l,{endpoint:r,defaults:hqt.bind(null,r)}),c.request.hook(l,c)},"newApi"),{endpoint:r,defaults:hqt.bind(null,r)})}a(hqt,"withDefaults");var Qxe=hqt(iCn,Ojo);p();var Ujo="0.0.0-development";function Qjo(t){return`Request failed due to following response errors: +`)}`}a(vbn,"formatContextFiles");p();p();var SJe=class extends Error{static{a(this,"GitHubClientError")}constructor(e){super(e)}},mE=class extends SJe{static{a(this,"GitHubClientAuthenticationError")}constructor(e="No authenticated GitHub session available"){super(e)}},od=class extends SJe{constructor(r,n,o){super(o||`GitHub API request failed: ${r} ${n}`);this.status=r;this.statusText=n}static{a(this,"GitHubClientApiError")}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500&&this.status<600}};p();var tjt=(h=>(h.Actions="actions",h.Composer="composer",h.Erlang="erlang",h.Go="go",h.Maven="maven",h.Npm="npm",h.Nuget="nuget",h.Pip="pip",h.Pub="pub",h.RubyGems="rubygems",h.Rust="rust",h))(tjt||{});p();p();p();function Bq(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}a(Bq,"getUserAgent");p();p();function TJe(t,e,r,n){if(typeof r!="function")throw new Error("method for before hook must be a function");return n||(n={}),Array.isArray(e)?e.reverse().reduce((o,s)=>TJe.bind(null,t,s,o,n),r)():Promise.resolve().then(()=>t.registry[e]?t.registry[e].reduce((o,s)=>s.hook.bind(null,o,n),r)():r(n))}a(TJe,"register");p();function Cbn(t,e,r,n){let o=n;t.registry[r]||(t.registry[r]=[]),e==="before"&&(n=a((s,c)=>Promise.resolve().then(o.bind(null,c)).then(s.bind(null,c)),"hook")),e==="after"&&(n=a((s,c)=>{let l;return Promise.resolve().then(s.bind(null,c)).then(u=>(l=u,o(l,c))).then(()=>l)},"hook")),e==="error"&&(n=a((s,c)=>Promise.resolve().then(s.bind(null,c)).catch(l=>o(l,c)),"hook")),t.registry[r].push({hook:n,orig:o})}a(Cbn,"addHook");p();function bbn(t,e,r){if(!t.registry[e])return;let n=t.registry[e].map(o=>o.orig).indexOf(r);n!==-1&&t.registry[e].splice(n,1)}a(bbn,"removeHook");var Sbn=Function.bind,Tbn=Sbn.bind(Sbn);function Ibn(t,e,r){let n=Tbn(bbn,null).apply(null,r?[e,r]:[e]);t.api={remove:n},t.remove=n,["before","error","after","wrap"].forEach(o=>{let s=r?[e,o,r]:[e,o];t[o]=t.api[o]=Tbn(Cbn,null).apply(null,s)})}a(Ibn,"bindApi");function mGo(){let t=Symbol("Singular"),e={registry:{}},r=TJe.bind(null,e,t);return Ibn(r,e,t),r}a(mGo,"Singular");function gGo(){let t={registry:{}},e=TJe.bind(null,t);return Ibn(e,t),e}a(gGo,"Collection");var xbn={Singular:mGo,Collection:gGo};p();p();var AGo="0.0.0-development",yGo=`octokit-endpoint.js/${AGo} ${Bq()}`,EGo={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":yGo},mediaType:{format:""}};function _Go(t){return t?Object.keys(t).reduce((e,r)=>(e[r.toLowerCase()]=t[r],e),{}):{}}a(_Go,"lowercaseKeys");function vGo(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);if(e===null)return!0;let r=Object.prototype.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Function.prototype.call(r)===Function.prototype.call(t)}a(vGo,"isPlainObject");function kbn(t,e){let r=Object.assign({},t);return Object.keys(e).forEach(n=>{vGo(e[n])?n in t?r[n]=kbn(t[n],e[n]):Object.assign(r,{[n]:e[n]}):Object.assign(r,{[n]:e[n]})}),r}a(kbn,"mergeDeep");function wbn(t){for(let e in t)t[e]===void 0&&delete t[e];return t}a(wbn,"removeUndefinedProperties");function njt(t,e,r){if(typeof e=="string"){let[o,s]=e.split(" ");r=Object.assign(s?{method:o,url:s}:{url:o},r)}else r=Object.assign({},e);r.headers=_Go(r.headers),wbn(r),wbn(r.headers);let n=kbn(t||{},r);return r.url==="/graphql"&&(t&&t.mediaType.previews?.length&&(n.mediaType.previews=t.mediaType.previews.filter(o=>!n.mediaType.previews.includes(o)).concat(n.mediaType.previews)),n.mediaType.previews=(n.mediaType.previews||[]).map(o=>o.replace(/-preview/,""))),n}a(njt,"merge");function CGo(t,e){let r=/\?/.test(t)?"&":"?",n=Object.keys(e);return n.length===0?t:t+r+n.map(o=>o==="q"?"q="+e.q.split("+").map(encodeURIComponent).join("+"):`${o}=${encodeURIComponent(e[o])}`).join("&")}a(CGo,"addQueryParameters");var bGo=/\{[^{}}]+\}/g;function SGo(t){return t.replace(/(?:^\W+)|(?:(?r.concat(n),[]):[]}a(TGo,"extractUrlVariableNames");function Rbn(t,e){let r={__proto__:null};for(let n of Object.keys(t))e.indexOf(n)===-1&&(r[n]=t[n]);return r}a(Rbn,"omit");function Pbn(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")),e}).join("")}a(Pbn,"encodeReserved");function xue(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}a(xue,"encodeUnreserved");function nwe(t,e,r){return e=t==="+"||t==="#"?Pbn(e):xue(e),r?xue(r)+"="+e:e}a(nwe,"encodeValue");function Iue(t){return t!=null}a(Iue,"isDefined");function rjt(t){return t===";"||t==="&"||t==="?"}a(rjt,"isKeyOperator");function IGo(t,e,r,n){var o=t[r],s=[];if(Iue(o)&&o!=="")if(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||typeof o=="boolean")o=o.toString(),n&&n!=="*"&&(o=o.substring(0,parseInt(n,10))),s.push(nwe(e,o,rjt(e)?r:""));else if(n==="*")Array.isArray(o)?o.filter(Iue).forEach(function(c){s.push(nwe(e,c,rjt(e)?r:""))}):Object.keys(o).forEach(function(c){Iue(o[c])&&s.push(nwe(e,o[c],c))});else{let c=[];Array.isArray(o)?o.filter(Iue).forEach(function(l){c.push(nwe(e,l))}):Object.keys(o).forEach(function(l){Iue(o[l])&&(c.push(xue(l)),c.push(nwe(e,o[l].toString())))}),rjt(e)?s.push(xue(r)+"="+c.join(",")):c.length!==0&&s.push(c.join(","))}else e===";"?Iue(o)&&s.push(xue(r)):o===""&&(e==="&"||e==="?")?s.push(xue(r)+"="):o===""&&s.push("");return s}a(IGo,"getValues");function xGo(t){return{expand:wGo.bind(null,t)}}a(xGo,"parseUrl");function wGo(t,e){var r=["+","#",".","/",";","?","&"];return t=t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(n,o,s){if(o){let l="",u=[];if(r.indexOf(o.charAt(0))!==-1&&(l=o.charAt(0),o=o.substr(1)),o.split(/,/g).forEach(function(d){var f=/([^:\*]*)(?::(\d+)|(\*))?/.exec(d);u.push(IGo(e,l,f[1],f[2]||f[3]))}),l&&l!=="+"){var c=",";return l==="?"?c="&":l!=="#"&&(c=l),(u.length!==0?l:"")+u.join(c)}else return u.join(",")}else return Pbn(s)}),t==="/"?t:t.replace(/\/$/,"")}a(wGo,"expand");function Dbn(t){let e=t.method.toUpperCase(),r=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},t.headers),o,s=Rbn(t,["method","baseUrl","url","headers","request","mediaType"]),c=TGo(r);r=xGo(r).expand(s),/^http/.test(r)||(r=t.baseUrl+r);let l=Object.keys(t).filter(f=>c.includes(f)).concat("baseUrl"),u=Rbn(s,l);if(!/application\/octet-stream/i.test(n.accept)&&(t.mediaType.format&&(n.accept=n.accept.split(/,/).map(f=>f.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${t.mediaType.format}`)).join(",")),r.endsWith("/graphql")&&t.mediaType.previews?.length)){let f=n.accept.match(/(?{let m=t.mediaType.format?`.${t.mediaType.format}`:"+json";return`application/vnd.github.${h}-preview${m}`}).join(",")}return["GET","HEAD"].includes(e)?r=CGo(r,u):"data"in u?o=u.data:Object.keys(u).length&&(o=u),!n["content-type"]&&typeof o<"u"&&(n["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(e)&&typeof o>"u"&&(o=""),Object.assign({method:e,url:r,headers:n},typeof o<"u"?{body:o}:null,t.request?{request:t.request}:null)}a(Dbn,"parse");function RGo(t,e,r){return Dbn(njt(t,e,r))}a(RGo,"endpointWithDefaults");function Nbn(t,e){let r=njt(t,e),n=RGo.bind(null,r);return Object.assign(n,{DEFAULTS:r,defaults:Nbn.bind(null,r),merge:njt.bind(null,r),parse:Dbn})}a(Nbn,"withDefaults");var Mbn=Nbn(null,EGo);var Wbn=fe(Fbn(),1);p();var kGo=/^-?\d+$/,qbn=/^-?\d+n+$/,ijt=JSON.stringify,Ubn=JSON.parse,PGo=/^-?\d+n$/,DGo=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,NGo=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,jbn=a((t,e,r)=>"rawJSON"in JSON?ijt(t,(c,l)=>typeof l=="bigint"?JSON.rawJSON(l.toString()):typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r):t?ijt(t,(c,l)=>typeof l=="string"&&qbn.test(l)||typeof l=="bigint"?l.toString()+"n":typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r).replace(DGo,"$1$2$3").replace(NGo,"$1$2$3"):ijt(t,e,r),"JSONStringify"),RJe=new Map,MGo=a(()=>{let t=JSON.parse.toString();if(RJe.has(t))return RJe.get(t);try{let e=JSON.parse("1",(r,n,o)=>!!o?.source&&o.source==="1");return RJe.set(t,e),e}catch{return RJe.set(t,!1),!1}},"isContextSourceSupported"),OGo=a((t,e,r,n)=>typeof e=="string"&&PGo.test(e)?BigInt(e.slice(0,-1)):typeof e=="string"&&qbn.test(e)?e.slice(0,-1):typeof n!="function"?e:n(t,e,r),"convertMarkedBigIntsReviver"),LGo=a((t,e)=>JSON.parse(t,(r,n,o)=>{let s=typeof n=="number"&&(n>Number.MAX_SAFE_INTEGER||n{if(!t)return Ubn(t,e);if(MGo())return LGo(t,e);let r=t.replace(BGo,(n,o,s,c)=>{let l=n[0]==='"';if(l&&FGo.test(n))return n.substring(0,n.length-1)+'n"';let d=s||c,f=o&&(o.lengthOGo(n,o,s,e))},"JSONParse");p();var tJ=class extends Error{static{a(this,"RequestError")}name;status;request;response;constructor(e,r,n){super(e,{cause:n.cause}),this.name="HttpError",this.status=Number.parseInt(r),Number.isNaN(this.status)&&(this.status=0);"response"in n&&(this.response=n.response);let o=Object.assign({},n.request);n.request.headers.authorization&&(o.headers=Object.assign({},n.request.headers,{authorization:n.request.headers.authorization.replace(/(?"","noop");async function Vbn(t){let e=t.request?.fetch||globalThis.fetch;if(!e)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let r=t.request?.log||console,n=t.request?.parseSuccessResponseBody!==!1,o=qGo(t.body)||Array.isArray(t.body)?jbn(t.body):t.body,s=Object.fromEntries(Object.entries(t.headers).map(([h,m])=>[h,String(m)])),c;try{c=await e(t.url,{method:t.method,body:o,redirect:t.request?.redirect,headers:s,signal:t.request?.signal,...t.body&&{duplex:"half"}})}catch(h){let m="Unknown Error";if(h instanceof Error){if(h.name==="AbortError")throw h.status=500,h;m=h.message,h.name==="TypeError"&&"cause"in h&&(h.cause instanceof Error?m=h.cause.message:typeof h.cause=="string"&&(m=h.cause))}let g=new tJ(m,500,{request:t});throw g.cause=h,g}let l=c.status,u=c.url,d={};for(let[h,m]of c.headers)d[h]=m;let f={url:u,status:l,headers:d,data:""};if("deprecation"in d){let h=d.link&&d.link.match(/<([^<>]+)>; rel="deprecation"/),m=h&&h.pop();r.warn(`[@octokit/request] "${t.method} ${t.url}" is deprecated. It is scheduled to be removed on ${d.sunset}${m?`. See ${m}`:""}`)}if(l===204||l===205)return f;if(t.method==="HEAD"){if(l<400)return f;throw new tJ(c.statusText,l,{response:f,request:t})}if(l===304)throw f.data=await ojt(c),new tJ("Not modified",l,{response:f,request:t});if(l>=400)throw f.data=await ojt(c),new tJ(HGo(f.data),l,{response:f,request:t});return f.data=n?await ojt(c):c.body,f}a(Vbn,"fetchWrapper");async function ojt(t){let e=t.headers.get("content-type");if(!e)return t.text().catch($bn);let r=(0,Wbn.safeParse)(e);if(jGo(r)){let n="";try{return n=await t.text(),Gbn(n)}catch{return n}}else return r.type.startsWith("text/")||r.parameters.charset?.toLowerCase()==="utf-8"?t.text().catch($bn):t.arrayBuffer().catch(()=>new ArrayBuffer(0))}a(ojt,"getResponseData");function jGo(t){return t.type==="application/json"||t.type==="application/scim+json"}a(jGo,"isJSONResponse");function HGo(t){if(typeof t=="string")return t;if(t instanceof ArrayBuffer)return"Unknown error";if("message"in t){let e="documentation_url"in t?` - ${t.documentation_url}`:"";return Array.isArray(t.errors)?`${t.message}: ${t.errors.map(r=>JSON.stringify(r)).join(", ")}${e}`:`${t.message}${e}`}return`Unknown error: ${JSON.stringify(t)}`}a(HGo,"toErrorMessage");function sjt(t,e){let r=t.defaults(e);return Object.assign(a(function(o,s){let c=r.merge(o,s);if(!c.request||!c.request.hook)return Vbn(r.parse(c));let l=a((u,d)=>Vbn(r.parse(r.merge(u,d))),"request2");return Object.assign(l,{endpoint:r,defaults:sjt.bind(null,r)}),c.request.hook(l,c)},"newApi"),{endpoint:r,defaults:sjt.bind(null,r)})}a(sjt,"withDefaults");var owe=sjt(Mbn,QGo);p();var GGo="0.0.0-development";function $Go(t){return`Request failed due to following response errors: `+t.errors.map(e=>` - ${e.message}`).join(` -`)}a(Qjo,"_buildMessageForResponseErrors");var qjo=class extends Error{static{a(this,"GraphqlResponseError")}constructor(t,e,r){super(Qjo(r)),this.request=t,this.headers=e,this.response=r,this.errors=r.errors,this.data=r.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}name="GraphqlResponseError";errors;data},jjo=["method","baseUrl","url","headers","request","query","mediaType","operationName"],Hjo=["query","method","url"],yCn=/\/api\/v3\/?$/;function Gjo(t,e,r){if(r){if(typeof e=="string"&&"query"in r)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(let c in r)if(Hjo.includes(c))return Promise.reject(new Error(`[@octokit/graphql] "${c}" cannot be used as variable name`))}let n=typeof e=="string"?Object.assign({query:e},r):e,o=Object.keys(n).reduce((c,l)=>jjo.includes(l)?(c[l]=n[l],c):(c.variables||(c.variables={}),c.variables[l]=n[l],c),{}),s=n.baseUrl||t.endpoint.DEFAULTS.baseUrl;return yCn.test(s)&&(o.url=s.replace(yCn,"/api/graphql")),t(o).then(c=>{if(c.data.errors){let l={};for(let u of Object.keys(c.headers))l[u]=c.headers[u];throw new qjo(o,l,c.data)}return c.data.data})}a(Gjo,"graphql");function mqt(t,e){let r=t.defaults(e);return Object.assign(a((o,s)=>Gjo(r,o,s),"newApi"),{defaults:mqt.bind(null,r),endpoint:r.endpoint})}a(mqt,"withDefaults");var ECn=mqt(Qxe,{headers:{"user-agent":`octokit-graphql.js/${Ujo} ${Sq()}`},method:"POST",url:"/graphql"});function _Cn(t){return mqt(t,{method:"POST",url:"/graphql"})}a(_Cn,"withCustomRequest");p();var gqt="(?:[a-zA-Z0-9_-]+)",vCn="\\.",CCn=new RegExp(`^${gqt}${vCn}${gqt}${vCn}${gqt}$`),$jo=CCn.test.bind(CCn);async function Vjo(t){let e=$jo(t),r=t.startsWith("v1.")||t.startsWith("ghs_"),n=t.startsWith("ghu_");return{type:"token",token:t,tokenType:e?"app":r?"installation":n?"user-to-server":"oauth"}}a(Vjo,"auth");function Wjo(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}a(Wjo,"withAuthorizationPrefix");async function zjo(t,e,r,n){let o=e.endpoint.merge(r,n);return o.headers.authorization=Wjo(t),e(o)}a(zjo,"hook");var bCn=a(function(e){if(!e)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof e!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return e=e.replace(/^(token|bearer) +/i,""),Object.assign(Vjo.bind(null,e),{hook:zjo.bind(null,e)})},"createTokenAuth2");p();var Aqt="7.0.6";var SCn=a(()=>{},"noop"),Yjo=console.warn.bind(console),Kjo=console.error.bind(console);function Jjo(t={}){return typeof t.debug!="function"&&(t.debug=SCn),typeof t.info!="function"&&(t.info=SCn),typeof t.warn!="function"&&(t.warn=Yjo),typeof t.error!="function"&&(t.error=Kjo),t}a(Jjo,"createLogger");var TCn=`octokit-core.js/${Aqt} ${Sq()}`,rJe=class{static{a(this,"Octokit")}static VERSION=Aqt;static defaults(e){return class extends this{static{a(this,"OctokitWithDefaults")}constructor(...n){let o=n[0]||{};if(typeof e=="function"){super(e(o));return}super(Object.assign({},e,o,o.userAgent&&e.userAgent?{userAgent:`${o.userAgent} ${e.userAgent}`}:null))}}}static plugins=[];static plugin(...e){let r=this.plugins;return class extends this{static{a(this,"NewOctokit")}static plugins=r.concat(e.filter(o=>!r.includes(o)))}}constructor(e={}){let r=new Jvn.Collection,n={baseUrl:Qxe.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:r.bind(null,"request")}),mediaType:{previews:[],format:""}};if(n.headers["user-agent"]=e.userAgent?`${e.userAgent} ${TCn}`:TCn,e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers["time-zone"]=e.timeZone),this.request=Qxe.defaults(n),this.graphql=_Cn(this.request).defaults(n),this.log=Jjo(e.log),this.hook=r,e.authStrategy){let{authStrategy:s,...c}=e,l=s(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:c},e.auth));r.wrap("request",l.hook),this.auth=l}else if(!e.auth)this.auth=async()=>({type:"unauthenticated"});else{let s=bCn(e.auth);r.wrap("request",s.hook),this.auth=s}let o=this.constructor;for(let s=0;s{t.log.debug("request",r);let n=Date.now(),o=t.request.endpoint.parse(r),s=o.url.replace(r.baseUrl,"");return e(r).then(c=>{let l=c.headers["x-github-request-id"];return t.log.info(`${o.method} ${s} - ${c.status} with id ${l} in ${Date.now()-n}ms`),c}).catch(c=>{let l=c.response?.headers["x-github-request-id"]||"UNKNOWN";throw t.log.error(`${o.method} ${s} - ${c.status} with id ${l} in ${Date.now()-n}ms`),c})})}a(yqt,"requestLog");yqt.VERSION=ICn;p();var Zjo="0.0.0-development";function Xjo(t){if(!t.data)return{...t,data:[]};if(!(("total_count"in t.data||"total_commits"in t.data)&&!("url"in t.data)))return t;let r=t.data.incomplete_results,n=t.data.repository_selection,o=t.data.total_count,s=t.data.total_commits;delete t.data.incomplete_results,delete t.data.repository_selection,delete t.data.total_count,delete t.data.total_commits;let c=Object.keys(t.data)[0],l=t.data[c];return t.data=l,typeof r<"u"&&(t.data.incomplete_results=r),typeof n<"u"&&(t.data.repository_selection=n),t.data.total_count=o,t.data.total_commits=s,t}a(Xjo,"normalizePaginatedListResponse");function Eqt(t,e,r){let n=typeof e=="function"?e.endpoint(r):t.request.endpoint(e,r),o=typeof e=="function"?e:t.request,s=n.method,c=n.headers,l=n.url;return{[Symbol.asyncIterator]:()=>({async next(){if(!l)return{done:!0};try{let u=await o({method:s,url:l,headers:c}),d=Xjo(u);if(l=((d.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1],!l&&"total_commits"in d.data){let f=new URL(d.url),h=f.searchParams,m=parseInt(h.get("page")||"1",10),g=parseInt(h.get("per_page")||"250",10);m*g{if(o.done)return e;let s=!1;function c(){s=!0}return a(c,"done"),e=e.concat(n?n(o.value,c):o.value.data),s?e:wCn(t,e,r,n)})}a(wCn,"gather");var aad=Object.assign(xCn,{iterator:Eqt});function _qt(t){return{paginate:Object.assign(xCn.bind(null,t),{iterator:Eqt.bind(null,t)})}}a(_qt,"paginateRest");_qt.VERSION=Zjo;p();p();var vqt="17.0.0";p();p();var eHo={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repos/{owner}/{repo}/environments/{environment_name}/variables"],createHostedRunnerForOrg:["POST /orgs/{org}/actions/hosted-runners"],createOrUpdateEnvironmentSecret:["PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createOrgVariable:["POST /orgs/{org}/actions/variables"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createRepoVariable:["POST /repos/{owner}/{repo}/actions/variables"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteActionsCacheById:["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"],deleteActionsCacheByKey:["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteCustomImageFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],deleteCustomImageVersionFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],deleteEnvironmentSecret:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],deleteEnvironmentVariable:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],deleteHostedRunnerForOrg:["DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteRepoVariable:["DELETE /repos/{owner}/{repo}/actions/variables/{name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],disableSelectedRepositoryGithubActionsOrganization:["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"],disableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunAttemptLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],enableSelectedRepositoryGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"],enableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"],forceCancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"],generateRunnerJitconfigForOrg:["POST /orgs/{org}/actions/runners/generate-jitconfig"],generateRunnerJitconfigForRepo:["POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"],getActionsCacheList:["GET /repos/{owner}/{repo}/actions/caches"],getActionsCacheUsage:["GET /repos/{owner}/{repo}/actions/cache/usage"],getActionsCacheUsageByRepoForOrg:["GET /orgs/{org}/actions/cache/usage-by-repository"],getActionsCacheUsageForOrg:["GET /orgs/{org}/actions/cache/usage"],getAllowedActionsOrganization:["GET /orgs/{org}/actions/permissions/selected-actions"],getAllowedActionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getCustomImageForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],getCustomImageVersionForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],getCustomOidcSubClaimForRepo:["GET /repos/{owner}/{repo}/actions/oidc/customization/sub"],getEnvironmentPublicKey:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"],getEnvironmentSecret:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],getEnvironmentVariable:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],getGithubActionsDefaultWorkflowPermissionsOrganization:["GET /orgs/{org}/actions/permissions/workflow"],getGithubActionsDefaultWorkflowPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/workflow"],getGithubActionsPermissionsOrganization:["GET /orgs/{org}/actions/permissions"],getGithubActionsPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions"],getHostedRunnerForOrg:["GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],getHostedRunnersGithubOwnedImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/github-owned"],getHostedRunnersLimitsForOrg:["GET /orgs/{org}/actions/hosted-runners/limits"],getHostedRunnersMachineSpecsForOrg:["GET /orgs/{org}/actions/hosted-runners/machine-sizes"],getHostedRunnersPartnerImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/partner"],getHostedRunnersPlatformsForOrg:["GET /orgs/{org}/actions/hosted-runners/platforms"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getOrgVariable:["GET /orgs/{org}/actions/variables/{name}"],getPendingDeploymentsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],getRepoPermissions:["GET /repos/{owner}/{repo}/actions/permissions",{},{renamed:["actions","getGithubActionsPermissionsRepository"]}],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getRepoVariable:["GET /repos/{owner}/{repo}/actions/variables/{name}"],getReviewsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowAccessToRepository:["GET /repos/{owner}/{repo}/actions/permissions/access"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listCustomImageVersionsForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions"],listCustomImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom"],listEnvironmentSecrets:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"],listEnvironmentVariables:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables"],listGithubHostedRunnersInGroupForOrg:["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners"],listHostedRunnersForOrg:["GET /orgs/{org}/actions/hosted-runners"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listJobsForWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"],listLabelsForSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}/labels"],listLabelsForSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listOrgVariables:["GET /orgs/{org}/actions/variables"],listRepoOrganizationSecrets:["GET /repos/{owner}/{repo}/actions/organization-secrets"],listRepoOrganizationVariables:["GET /repos/{owner}/{repo}/actions/organization-variables"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoVariables:["GET /repos/{owner}/{repo}/actions/variables"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelectedReposForOrgVariable:["GET /orgs/{org}/actions/variables/{name}/repositories"],listSelectedRepositoriesEnabledGithubActionsOrganization:["GET /orgs/{org}/actions/permissions/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunJobForWorkflowRun:["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],reRunWorkflowFailedJobs:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"],removeAllCustomLabelsFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"],removeAllCustomLabelsFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],removeCustomLabelFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"],removeCustomLabelFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],reviewCustomGatesForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"],reviewPendingDeploymentsForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],setAllowedActionsOrganization:["PUT /orgs/{org}/actions/permissions/selected-actions"],setAllowedActionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"],setCustomLabelsForSelfHostedRunnerForOrg:["PUT /orgs/{org}/actions/runners/{runner_id}/labels"],setCustomLabelsForSelfHostedRunnerForRepo:["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],setCustomOidcSubClaimForRepo:["PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"],setGithubActionsDefaultWorkflowPermissionsOrganization:["PUT /orgs/{org}/actions/permissions/workflow"],setGithubActionsDefaultWorkflowPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/workflow"],setGithubActionsPermissionsOrganization:["PUT /orgs/{org}/actions/permissions"],setGithubActionsPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"],setSelectedReposForOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories"],setSelectedRepositoriesEnabledGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories"],setWorkflowAccessToRepository:["PUT /repos/{owner}/{repo}/actions/permissions/access"],updateEnvironmentVariable:["PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],updateHostedRunnerForOrg:["PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],updateOrgVariable:["PATCH /orgs/{org}/actions/variables/{name}"],updateRepoVariable:["PATCH /repos/{owner}/{repo}/actions/variables/{name}"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsDone:["DELETE /notifications/threads/{thread_id}"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","addRepoToInstallationForAuthenticatedUser"]}],addRepoToInstallationForAuthenticatedUser:["PUT /user/installations/{installation_id}/repositories/{repository_id}"],checkToken:["POST /applications/{client_id}/token"],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens"],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}"],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app"],getBySlug:["GET /apps/{app_slug}"],getInstallation:["GET /app/installations/{installation_id}"],getOrgInstallation:["GET /orgs/{org}/installation"],getRepoInstallation:["GET /repos/{owner}/{repo}/installation"],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation"],getWebhookConfigForApp:["GET /app/hook/config"],getWebhookDelivery:["GET /app/hook/deliveries/{delivery_id}"],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories"],listInstallationRequestsForAuthenticatedApp:["GET /app/installation-requests"],listInstallations:["GET /app/installations"],listInstallationsForAuthenticatedUser:["GET /user/installations"],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories"],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],listWebhookDeliveries:["GET /app/hook/deliveries"],redeliverWebhookDelivery:["POST /app/hook/deliveries/{delivery_id}/attempts"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","removeRepoFromInstallationForAuthenticatedUser"]}],removeRepoFromInstallationForAuthenticatedUser:["DELETE /user/installations/{installation_id}/repositories/{repository_id}"],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],scopeToken:["POST /applications/{client_id}/token/scoped"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"],updateWebhookConfigForApp:["PATCH /app/hook/config"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubBillingPremiumRequestUsageReportOrg:["GET /organizations/{org}/settings/billing/premium_request/usage"],getGithubBillingPremiumRequestUsageReportUser:["GET /users/{username}/settings/billing/premium_request/usage"],getGithubBillingUsageReportOrg:["GET /organizations/{org}/settings/billing/usage"],getGithubBillingUsageReportUser:["GET /users/{username}/settings/billing/usage"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},campaigns:{createCampaign:["POST /orgs/{org}/campaigns"],deleteCampaign:["DELETE /orgs/{org}/campaigns/{campaign_number}"],getCampaignSummary:["GET /orgs/{org}/campaigns/{campaign_number}"],listOrgCampaigns:["GET /orgs/{org}/campaigns"],updateCampaign:["PATCH /orgs/{org}/campaigns/{campaign_number}"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs"],createSuite:["POST /repos/{owner}/{repo}/check-suites"],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],rerequestRun:["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences"],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]},codeScanning:{commitAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits"],createAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],createVariantAnalysis:["POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"],deleteAnalysis:["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"],deleteCodeqlDatabase:["DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",{},{renamedParameters:{alert_id:"alert_number"}}],getAnalysis:["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"],getAutofix:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],getCodeqlDatabase:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getDefaultSetup:["GET /repos/{owner}/{repo}/code-scanning/default-setup"],getSarif:["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],getVariantAnalysis:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}"],getVariantAnalysisRepoTask:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}"],listAlertInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"],listAlertsForOrg:["GET /orgs/{org}/code-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"],listAlertsInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",{},{renamed:["codeScanning","listAlertInstances"]}],listCodeqlDatabases:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases"],listRecentAnalyses:["GET /repos/{owner}/{repo}/code-scanning/analyses"],updateAlert:["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"],updateDefaultSetup:["PATCH /repos/{owner}/{repo}/code-scanning/default-setup"],uploadSarif:["POST /repos/{owner}/{repo}/code-scanning/sarifs"]},codeSecurity:{attachConfiguration:["POST /orgs/{org}/code-security/configurations/{configuration_id}/attach"],attachEnterpriseConfiguration:["POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"],createConfiguration:["POST /orgs/{org}/code-security/configurations"],createConfigurationForEnterprise:["POST /enterprises/{enterprise}/code-security/configurations"],deleteConfiguration:["DELETE /orgs/{org}/code-security/configurations/{configuration_id}"],deleteConfigurationForEnterprise:["DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],detachConfiguration:["DELETE /orgs/{org}/code-security/configurations/detach"],getConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}"],getConfigurationForRepository:["GET /repos/{owner}/{repo}/code-security-configuration"],getConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations"],getConfigurationsForOrg:["GET /orgs/{org}/code-security/configurations"],getDefaultConfigurations:["GET /orgs/{org}/code-security/configurations/defaults"],getDefaultConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/defaults"],getRepositoriesForConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"],getRepositoriesForEnterpriseConfiguration:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"],getSingleConfigurationForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],setConfigurationAsDefault:["PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults"],setConfigurationAsDefaultForEnterprise:["PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"],updateConfiguration:["PATCH /orgs/{org}/code-security/configurations/{configuration_id}"],updateEnterpriseConfiguration:["PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct"],getConductCode:["GET /codes_of_conduct/{key}"]},codespaces:{addRepositoryForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],checkPermissionsForDevcontainer:["GET /repos/{owner}/{repo}/codespaces/permissions_check"],codespaceMachinesForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/machines"],createForAuthenticatedUser:["POST /user/codespaces"],createOrUpdateOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],createOrUpdateSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}"],createWithPrForAuthenticatedUser:["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"],createWithRepoForAuthenticatedUser:["POST /repos/{owner}/{repo}/codespaces"],deleteForAuthenticatedUser:["DELETE /user/codespaces/{codespace_name}"],deleteFromOrganization:["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"],deleteOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],deleteSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}"],exportForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/exports"],getCodespacesForUserInOrg:["GET /orgs/{org}/members/{username}/codespaces"],getExportDetailsForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/exports/{export_id}"],getForAuthenticatedUser:["GET /user/codespaces/{codespace_name}"],getOrgPublicKey:["GET /orgs/{org}/codespaces/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}"],getPublicKeyForAuthenticatedUser:["GET /user/codespaces/secrets/public-key"],getRepoPublicKey:["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],getSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}"],listDevcontainersInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/devcontainers"],listForAuthenticatedUser:["GET /user/codespaces"],listInOrganization:["GET /orgs/{org}/codespaces",{},{renamedParameters:{org_id:"org"}}],listInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces"],listOrgSecrets:["GET /orgs/{org}/codespaces/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/codespaces/secrets"],listRepositoriesForSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}/repositories"],listSecretsForAuthenticatedUser:["GET /user/codespaces/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],preFlightWithRepoForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/new"],publishForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/publish"],removeRepositoryForSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],repoMachinesForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/machines"],setRepositoriesForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],startForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/start"],stopForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/stop"],stopInOrganization:["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"],updateForAuthenticatedUser:["PATCH /user/codespaces/{codespace_name}"]},copilot:{addCopilotSeatsForTeams:["POST /orgs/{org}/copilot/billing/selected_teams"],addCopilotSeatsForUsers:["POST /orgs/{org}/copilot/billing/selected_users"],cancelCopilotSeatAssignmentForTeams:["DELETE /orgs/{org}/copilot/billing/selected_teams"],cancelCopilotSeatAssignmentForUsers:["DELETE /orgs/{org}/copilot/billing/selected_users"],copilotMetricsForOrganization:["GET /orgs/{org}/copilot/metrics"],copilotMetricsForTeam:["GET /orgs/{org}/team/{team_slug}/copilot/metrics"],getCopilotOrganizationDetails:["GET /orgs/{org}/copilot/billing"],getCopilotSeatDetailsForUser:["GET /orgs/{org}/members/{username}/copilot"],listCopilotSeats:["GET /orgs/{org}/copilot/billing/seats"]},credentials:{revoke:["POST /credentials/revoke"]},dependabot:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],deleteOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],getAlert:["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],getOrgPublicKey:["GET /orgs/{org}/dependabot/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/dependabot/alerts"],listAlertsForOrg:["GET /orgs/{org}/dependabot/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/dependabot/alerts"],listOrgSecrets:["GET /orgs/{org}/dependabot/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/dependabot/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],repositoryAccessForOrg:["GET /organizations/{org}/dependabot/repository-access"],setRepositoryAccessDefaultLevel:["PUT /organizations/{org}/dependabot/repository-access/default-level"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],updateAlert:["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],updateRepositoryAccessForOrg:["PATCH /organizations/{org}/dependabot/repository-access"]},dependencyGraph:{createRepositorySnapshot:["POST /repos/{owner}/{repo}/dependency-graph/snapshots"],diffRange:["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"],exportSbom:["GET /repos/{owner}/{repo}/dependency-graph/sbom"]},emojis:{get:["GET /emojis"]},enterpriseTeamMemberships:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove"],get:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],list:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"],remove:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"]},enterpriseTeamOrganizations:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove"],delete:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignment:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignments:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations"]},enterpriseTeams:{create:["POST /enterprises/{enterprise}/teams"],delete:["DELETE /enterprises/{enterprise}/teams/{team_slug}"],get:["GET /enterprises/{enterprise}/teams/{team_slug}"],list:["GET /enterprises/{enterprise}/teams"],update:["PATCH /enterprises/{enterprise}/teams/{team_slug}"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},hostedCompute:{createNetworkConfigurationForOrg:["POST /orgs/{org}/settings/network-configurations"],deleteNetworkConfigurationFromOrg:["DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkConfigurationForOrg:["GET /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkSettingsForOrg:["GET /orgs/{org}/settings/network-settings/{network_settings_id}"],listNetworkConfigurationsForOrg:["GET /orgs/{org}/settings/network-configurations"],updateNetworkConfigurationForOrg:["PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}"]},interactions:{getRestrictionsForAuthenticatedUser:["GET /user/interaction-limits"],getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits"],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits"],getRestrictionsForYourPublicRepos:["GET /user/interaction-limits",{},{renamed:["interactions","getRestrictionsForAuthenticatedUser"]}],removeRestrictionsForAuthenticatedUser:["DELETE /user/interaction-limits"],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits"],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits"],removeRestrictionsForYourPublicRepos:["DELETE /user/interaction-limits",{},{renamed:["interactions","removeRestrictionsForAuthenticatedUser"]}],setRestrictionsForAuthenticatedUser:["PUT /user/interaction-limits"],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits"],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits"],setRestrictionsForYourPublicRepos:["PUT /user/interaction-limits",{},{renamed:["interactions","setRestrictionsForAuthenticatedUser"]}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addBlockedByDependency:["POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],addSubIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],checkUserCanBeAssignedToIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],getParent:["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listDependenciesBlockedBy:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],listDependenciesBlocking:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],listSubIssues:["GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeDependencyBlockedBy:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],removeSubIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"],reprioritizeSubIssue:["PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"],getAllVersions:["GET /versions"],getOctocat:["GET /octocat"],getZen:["GET /zen"],root:["GET /"]},migrations:{deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive"],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive"],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive"],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive"],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}"],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}"],listForAuthenticatedUser:["GET /user/migrations"],listForOrg:["GET /orgs/{org}/migrations"],listReposForAuthenticatedUser:["GET /user/migrations/{migration_id}/repositories"],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories"],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{},{renamed:["migrations","listReposForAuthenticatedUser"]}],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"]},oidc:{getOidcCustomSubTemplateForOrg:["GET /orgs/{org}/actions/oidc/customization/sub"],updateOidcCustomSubTemplateForOrg:["PUT /orgs/{org}/actions/oidc/customization/sub"]},orgs:{addSecurityManagerTeam:["PUT /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team"}],assignTeamToOrgRole:["PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],assignUserToOrgRole:["PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"],blockUser:["PUT /orgs/{org}/blocks/{username}"],cancelInvitation:["DELETE /orgs/{org}/invitations/{invitation_id}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createArtifactStorageRecord:["POST /orgs/{org}/artifacts/metadata/storage-record"],createInvitation:["POST /orgs/{org}/invitations"],createIssueType:["POST /orgs/{org}/issue-types"],createWebhook:["POST /orgs/{org}/hooks"],customPropertiesForOrgsCreateOrUpdateOrganizationValues:["PATCH /organizations/{org}/org-properties/values"],customPropertiesForOrgsGetOrganizationValues:["GET /organizations/{org}/org-properties/values"],customPropertiesForReposCreateOrUpdateOrganizationDefinition:["PUT /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposCreateOrUpdateOrganizationDefinitions:["PATCH /orgs/{org}/properties/schema"],customPropertiesForReposCreateOrUpdateOrganizationValues:["PATCH /orgs/{org}/properties/values"],customPropertiesForReposDeleteOrganizationDefinition:["DELETE /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinition:["GET /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinitions:["GET /orgs/{org}/properties/schema"],customPropertiesForReposGetOrganizationValues:["GET /orgs/{org}/properties/values"],delete:["DELETE /orgs/{org}"],deleteAttestationsBulk:["POST /orgs/{org}/attestations/delete-request"],deleteAttestationsById:["DELETE /orgs/{org}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /orgs/{org}/attestations/digest/{subject_digest}"],deleteIssueType:["DELETE /orgs/{org}/issue-types/{issue_type_id}"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],disableSelectedRepositoryImmutableReleasesOrganization:["DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],enableSelectedRepositoryImmutableReleasesOrganization:["PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],get:["GET /orgs/{org}"],getImmutableReleasesSettings:["GET /orgs/{org}/settings/immutable-releases"],getImmutableReleasesSettingsRepositories:["GET /orgs/{org}/settings/immutable-releases/repositories"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getOrgRole:["GET /orgs/{org}/organization-roles/{role_id}"],getOrgRulesetHistory:["GET /orgs/{org}/rulesets/{ruleset_id}/history"],getOrgRulesetVersion:["GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],getWebhookConfigForOrg:["GET /orgs/{org}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations"],listArtifactStorageRecords:["GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records"],listAttestationRepositories:["GET /orgs/{org}/attestations/repositories"],listAttestations:["GET /orgs/{org}/attestations/{subject_digest}"],listAttestationsBulk:["POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}"],listBlockedUsers:["GET /orgs/{org}/blocks"],listFailedInvitations:["GET /orgs/{org}/failed_invitations"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listIssueTypes:["GET /orgs/{org}/issue-types"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOrgRoleTeams:["GET /orgs/{org}/organization-roles/{role_id}/teams"],listOrgRoleUsers:["GET /orgs/{org}/organization-roles/{role_id}/users"],listOrgRoles:["GET /orgs/{org}/organization-roles"],listOrganizationFineGrainedPermissions:["GET /orgs/{org}/organization-fine-grained-permissions"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPatGrantRepositories:["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"],listPatGrantRequestRepositories:["GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"],listPatGrantRequests:["GET /orgs/{org}/personal-access-token-requests"],listPatGrants:["GET /orgs/{org}/personal-access-tokens"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listSecurityManagerTeams:["GET /orgs/{org}/security-managers",{},{deprecated:"octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams"}],listWebhookDeliveries:["GET /orgs/{org}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /orgs/{org}/hooks"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],removeSecurityManagerTeam:["DELETE /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team"}],reviewPatGrantRequest:["POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"],reviewPatGrantRequestsInBulk:["POST /orgs/{org}/personal-access-token-requests"],revokeAllOrgRolesTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}"],revokeAllOrgRolesUser:["DELETE /orgs/{org}/organization-roles/users/{username}"],revokeOrgRoleTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],revokeOrgRoleUser:["DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"],setImmutableReleasesSettings:["PUT /orgs/{org}/settings/immutable-releases"],setImmutableReleasesSettingsRepositories:["PUT /orgs/{org}/settings/immutable-releases/repositories"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateIssueType:["PUT /orgs/{org}/issue-types/{issue_type_id}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updatePatAccess:["POST /orgs/{org}/personal-access-tokens/{pat_id}"],updatePatAccesses:["POST /orgs/{org}/personal-access-tokens"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"],updateWebhookConfigForOrg:["PATCH /orgs/{org}/hooks/{hook_id}/config"]},packages:{deletePackageForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}"],deletePackageForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}"],deletePackageForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}"],deletePackageVersionForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getAllPackageVersionsForAPackageOwnedByAnOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByOrg"]}],getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]}],getAllPackageVersionsForPackageOwnedByAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions"],getPackageForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}"],getPackageForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}"],getPackageForUser:["GET /users/{username}/packages/{package_type}/{package_name}"],getPackageVersionForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],listDockerMigrationConflictingPackagesForAuthenticatedUser:["GET /user/docker/conflicts"],listDockerMigrationConflictingPackagesForOrganization:["GET /orgs/{org}/docker/conflicts"],listDockerMigrationConflictingPackagesForUser:["GET /users/{username}/docker/conflicts"],listPackagesForAuthenticatedUser:["GET /user/packages"],listPackagesForOrganization:["GET /orgs/{org}/packages"],listPackagesForUser:["GET /users/{username}/packages"],restorePackageForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForUser:["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageVersionForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForUser:["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]},privateRegistries:{createOrgPrivateRegistry:["POST /orgs/{org}/private-registries"],deleteOrgPrivateRegistry:["DELETE /orgs/{org}/private-registries/{secret_name}"],getOrgPrivateRegistry:["GET /orgs/{org}/private-registries/{secret_name}"],getOrgPublicKey:["GET /orgs/{org}/private-registries/public-key"],listOrgPrivateRegistries:["GET /orgs/{org}/private-registries"],updateOrgPrivateRegistry:["PATCH /orgs/{org}/private-registries/{secret_name}"]},projects:{addItemForOrg:["POST /orgs/{org}/projectsV2/{project_number}/items"],addItemForUser:["POST /users/{username}/projectsV2/{project_number}/items"],deleteItemForOrg:["DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],deleteItemForUser:["DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}"],getFieldForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}"],getFieldForUser:["GET /users/{username}/projectsV2/{project_number}/fields/{field_id}"],getForOrg:["GET /orgs/{org}/projectsV2/{project_number}"],getForUser:["GET /users/{username}/projectsV2/{project_number}"],getOrgItem:["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],getUserItem:["GET /users/{username}/projectsV2/{project_number}/items/{item_id}"],listFieldsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields"],listFieldsForUser:["GET /users/{username}/projectsV2/{project_number}/fields"],listForOrg:["GET /orgs/{org}/projectsV2"],listForUser:["GET /users/{username}/projectsV2"],listItemsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/items"],listItemsForUser:["GET /users/{username}/projectsV2/{project_number}/items"],updateItemForOrg:["PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],updateItemForUser:["PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}"]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],createForRelease:["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"],deleteForRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],listForRelease:["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}",{},{renamed:["repos","acceptInvitationForAuthenticatedUser"]}],acceptInvitationForAuthenticatedUser:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],cancelPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"],checkAutomatedSecurityFixes:["GET /repos/{owner}/{repo}/automated-security-fixes"],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkImmutableReleases:["GET /repos/{owner}/{repo}/immutable-releases"],checkPrivateVulnerabilityReporting:["GET /repos/{owner}/{repo}/private-vulnerability-reporting"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts"],codeownersErrors:["GET /repos/{owner}/{repo}/codeowners/errors"],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],compareCommitsWithBasehead:["GET /repos/{owner}/{repo}/compare/{basehead}"],createAttestation:["POST /repos/{owner}/{repo}/attestations"],createAutolink:["POST /repos/{owner}/{repo}/autolinks"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentBranchPolicy:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],createDeploymentProtectionRule:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateEnvironment:["PUT /repos/{owner}/{repo}/environments/{environment_name}"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createOrgRuleset:["POST /orgs/{org}/rulesets"],createPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments"],createPagesSite:["POST /repos/{owner}/{repo}/pages"],createRelease:["POST /repos/{owner}/{repo}/releases"],createRepoRuleset:["POST /repos/{owner}/{repo}/rulesets"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate"],createWebhook:["POST /repos/{owner}/{repo}/hooks"],customPropertiesForReposCreateOrUpdateRepositoryValues:["PATCH /repos/{owner}/{repo}/properties/values"],customPropertiesForReposGetRepositoryValues:["GET /repos/{owner}/{repo}/properties/values"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}",{},{renamed:["repos","declineInvitationForAuthenticatedUser"]}],declineInvitationForAuthenticatedUser:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteAnEnvironment:["DELETE /repos/{owner}/{repo}/environments/{environment_name}"],deleteAutolink:["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteDeploymentBranchPolicy:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deleteOrgRuleset:["DELETE /orgs/{org}/rulesets/{ruleset_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages"],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteRepoRuleset:["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes"],disableDeploymentProtectionRule:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],disableImmutableReleases:["DELETE /repos/{owner}/{repo}/immutable-releases"],disablePrivateVulnerabilityReporting:["DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts"],downloadArchive:["GET /repos/{owner}/{repo}/zipball/{ref}",{},{renamed:["repos","downloadZipballArchive"]}],downloadTarballArchive:["GET /repos/{owner}/{repo}/tarball/{ref}"],downloadZipballArchive:["GET /repos/{owner}/{repo}/zipball/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes"],enableImmutableReleases:["PUT /repos/{owner}/{repo}/immutable-releases"],enablePrivateVulnerabilityReporting:["PUT /repos/{owner}/{repo}/private-vulnerability-reporting"],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts"],generateReleaseNotes:["POST /repos/{owner}/{repo}/releases/generate-notes"],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllDeploymentProtectionRules:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],getAllEnvironments:["GET /repos/{owner}/{repo}/environments"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics"],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getAutolink:["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getBranchRules:["GET /repos/{owner}/{repo}/rules/branches/{branch}"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile"],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getCustomDeploymentProtectionRule:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentBranchPolicy:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getEnvironment:["GET /repos/{owner}/{repo}/environments/{environment_name}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getOrgRuleSuite:["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],getOrgRuleSuites:["GET /orgs/{org}/rulesets/rule-suites"],getOrgRuleset:["GET /orgs/{org}/rulesets/{ruleset_id}"],getOrgRulesets:["GET /orgs/{org}/rulesets"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getPagesDeployment:["GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"],getPagesHealthCheck:["GET /repos/{owner}/{repo}/pages/health"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getReadmeInDirectory:["GET /repos/{owner}/{repo}/readme/{dir}"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getRepoRuleSuite:["GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"],getRepoRuleSuites:["GET /repos/{owner}/{repo}/rulesets/rule-suites"],getRepoRuleset:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],getRepoRulesetHistory:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history"],getRepoRulesetVersion:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}"],getRepoRulesets:["GET /repos/{owner}/{repo}/rulesets"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],getWebhookConfigForRepo:["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"],listActivities:["GET /repos/{owner}/{repo}/activity"],listAttestations:["GET /repos/{owner}/{repo}/attestations/{subject_digest}"],listAutolinks:["GET /repos/{owner}/{repo}/autolinks"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listCustomDeploymentRuleIntegrations:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentBranchPolicies:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhookDeliveries:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],mergeUpstream:["POST /repos/{owner}/{repo}/merge-upstream"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],renameBranch:["POST /repos/{owner}/{repo}/branches/{branch}/rename"],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics"],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateDeploymentBranchPolicy:["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updateOrgRuleset:["PUT /orgs/{org}/rulesets/{ruleset_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateRepoRuleset:["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",{},{renamed:["repos","updateStatusCheckProtection"]}],updateStatusCheckProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],updateWebhookConfigForRepo:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits"],issuesAndPullRequests:["GET /search/issues"],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics"],users:["GET /search/users"]},secretScanning:{createPushProtectionBypass:["POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses"],getAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],getScanHistory:["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],listAlertsForOrg:["GET /orgs/{org}/secret-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/secret-scanning/alerts"],listLocationsForAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"],listOrgPatternConfigs:["GET /orgs/{org}/secret-scanning/pattern-configurations"],updateAlert:["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],updateOrgPatternConfigs:["PATCH /orgs/{org}/secret-scanning/pattern-configurations"]},securityAdvisories:{createFork:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"],createPrivateVulnerabilityReport:["POST /repos/{owner}/{repo}/security-advisories/reports"],createRepositoryAdvisory:["POST /repos/{owner}/{repo}/security-advisories"],createRepositoryAdvisoryCveRequest:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"],getGlobalAdvisory:["GET /advisories/{ghsa_id}"],getRepositoryAdvisory:["GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"],listGlobalAdvisories:["GET /advisories"],listOrgRepositoryAdvisories:["GET /orgs/{org}/security-advisories"],listRepositoryAdvisories:["GET /repos/{owner}/{repo}/security-advisories"],updateRepositoryAdvisory:["PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails",{},{renamed:["users","addEmailForAuthenticatedUser"]}],addEmailForAuthenticatedUser:["POST /user/emails"],addSocialAccountForAuthenticatedUser:["POST /user/social_accounts"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys",{},{renamed:["users","createGpgKeyForAuthenticatedUser"]}],createGpgKeyForAuthenticatedUser:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys",{},{renamed:["users","createPublicSshKeyForAuthenticatedUser"]}],createPublicSshKeyForAuthenticatedUser:["POST /user/keys"],createSshSigningKeyForAuthenticatedUser:["POST /user/ssh_signing_keys"],deleteAttestationsBulk:["POST /users/{username}/attestations/delete-request"],deleteAttestationsById:["DELETE /users/{username}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /users/{username}/attestations/digest/{subject_digest}"],deleteEmailForAuthenticated:["DELETE /user/emails",{},{renamed:["users","deleteEmailForAuthenticatedUser"]}],deleteEmailForAuthenticatedUser:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","deleteGpgKeyForAuthenticatedUser"]}],deleteGpgKeyForAuthenticatedUser:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}",{},{renamed:["users","deletePublicSshKeyForAuthenticatedUser"]}],deletePublicSshKeyForAuthenticatedUser:["DELETE /user/keys/{key_id}"],deleteSocialAccountForAuthenticatedUser:["DELETE /user/social_accounts"],deleteSshSigningKeyForAuthenticatedUser:["DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getById:["GET /user/{account_id}"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","getGpgKeyForAuthenticatedUser"]}],getGpgKeyForAuthenticatedUser:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}",{},{renamed:["users","getPublicSshKeyForAuthenticatedUser"]}],getPublicSshKeyForAuthenticatedUser:["GET /user/keys/{key_id}"],getSshSigningKeyForAuthenticatedUser:["GET /user/ssh_signing_keys/{ssh_signing_key_id}"],list:["GET /users"],listAttestations:["GET /users/{username}/attestations/{subject_digest}"],listAttestationsBulk:["POST /users/{username}/attestations/bulk-list{?per_page,before,after}"],listBlockedByAuthenticated:["GET /user/blocks",{},{renamed:["users","listBlockedByAuthenticatedUser"]}],listBlockedByAuthenticatedUser:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails",{},{renamed:["users","listEmailsForAuthenticatedUser"]}],listEmailsForAuthenticatedUser:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following",{},{renamed:["users","listFollowedByAuthenticatedUser"]}],listFollowedByAuthenticatedUser:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys",{},{renamed:["users","listGpgKeysForAuthenticatedUser"]}],listGpgKeysForAuthenticatedUser:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails",{},{renamed:["users","listPublicEmailsForAuthenticatedUser"]}],listPublicEmailsForAuthenticatedUser:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys",{},{renamed:["users","listPublicSshKeysForAuthenticatedUser"]}],listPublicSshKeysForAuthenticatedUser:["GET /user/keys"],listSocialAccountsForAuthenticatedUser:["GET /user/social_accounts"],listSocialAccountsForUser:["GET /users/{username}/social_accounts"],listSshSigningKeysForAuthenticatedUser:["GET /user/ssh_signing_keys"],listSshSigningKeysForUser:["GET /users/{username}/ssh_signing_keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility",{},{renamed:["users","setPrimaryEmailVisibilityForAuthenticatedUser"]}],setPrimaryEmailVisibilityForAuthenticatedUser:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}},RCn=eHo;var VK=new Map;for(let[t,e]of Object.entries(RCn))for(let[r,n]of Object.entries(e)){let[o,s,c]=n,[l,u]=o.split(/ /),d=Object.assign({method:l,url:u},s);VK.has(t)||VK.set(t,new Map),VK.get(t).set(r,{scope:t,methodName:r,endpointDefaults:d,decorations:c})}var tHo={has({scope:t},e){return VK.get(t).has(e)},getOwnPropertyDescriptor(t,e){return{value:this.get(t,e),configurable:!0,writable:!0,enumerable:!0}},defineProperty(t,e,r){return Object.defineProperty(t.cache,e,r),!0},deleteProperty(t,e){return delete t.cache[e],!0},ownKeys({scope:t}){return[...VK.get(t).keys()]},set(t,e,r){return t.cache[e]=r},get({octokit:t,scope:e,cache:r},n){if(r[n])return r[n];let o=VK.get(e).get(n);if(!o)return;let{endpointDefaults:s,decorations:c}=o;return c?r[n]=rHo(t,e,n,s,c):r[n]=t.request.defaults(s),r[n]}};function Cqt(t){let e={};for(let r of VK.keys())e[r]=new Proxy({octokit:t,scope:r,cache:{}},tHo);return e}a(Cqt,"endpointsToMethods");function rHo(t,e,r,n,o){let s=t.request.defaults(n);function c(...l){let u=s.endpoint.merge(...l);if(o.mapToData)return u=Object.assign({},u,{data:u[o.mapToData],[o.mapToData]:void 0}),s(u);if(o.renamed){let[d,f]=o.renamed;t.log.warn(`octokit.${e}.${r}() has been renamed to octokit.${d}.${f}()`)}if(o.deprecated&&t.log.warn(o.deprecated),o.renamedParameters){let d=s.endpoint.merge(...l);for(let[f,h]of Object.entries(o.renamedParameters))f in d&&(t.log.warn(`"${f}" parameter is deprecated for "octokit.${e}.${r}()". Use "${h}" instead`),h in d||(d[h]=d[f]),delete d[f]);return s(d)}return s(...l)}return a(c,"withDecorations"),Object.assign(c,s)}a(rHo,"decorate");function nHo(t){return{rest:Cqt(t)}}a(nHo,"restEndpointMethods");nHo.VERSION=vqt;function bqt(t){let e=Cqt(t);return{...e,rest:e}}a(bqt,"legacyRestEndpointMethods");bqt.VERSION=vqt;p();var kCn="22.0.1";var PCn=rJe.plugin(yqt,bqt,_qt).defaults({userAgent:`octokit-rest.js/${kCn}`});var oHo=new Set(["copilot-pull-request-reviewer","copilot-swe-agent","Copilot"]),Ac=new fe("GitHubClient"),Zh=class{constructor(e){this.ctx=e;this.octokit=null}static{a(this,"GitHubClient")}async getOctokit(){if(this.octokit)return this.octokit;let e=await this.getApiSession(),r=this.ctx.get(tr);return this.octokit=new PCn({auth:e.accessToken,baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.octokit}async getCopilotTimelineEvents(e,r,n,o){if(!o||!oHo.has(o))return Ac.debug(this.ctx,`Skipping timeline events for ${e}/${r}#${n}: author '${o}' is not a Copilot account`),[];Ac.debug(this.ctx,`Fetching Copilot timeline events for ${e}/${r}#${n}`);let s=await this.getOctokit();try{let c=[],l=1,u=!0;for(;u;){Ac.debug(this.ctx,`Fetching timeline events page ${l} for ${e}/${r}#${n}`);let d=await s.rest.issues.listEventsForTimeline({owner:e,repo:r,issue_number:n,per_page:100,page:l});for(let h of d.data){let m=h;m.created_at&&m.node_id&&(h.event==="copilot_work_started"?c.push({id:m.node_id,eventType:"in_progress",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}):h.event==="copilot_work_finished"?c.push({id:m.node_id,eventType:"done",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}):h.event==="copilot_work_finished_failure"&&c.push({id:m.node_id,eventType:"error",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}))}let f=d.headers.link;u=f?f.includes('rel="next"'):!1,l++}return Ac.debug(this.ctx,`Found ${c.length} Copilot timeline events for ${e}/${r}#${n}`),c}catch(c){if(Ac.error(this.ctx,`Failed to fetch Copilot timeline events for ${e}/${r}#${n}:`,c),c&&typeof c=="object"&&"status"in c){let l=c;throw new Fd(l.status,l.message||"GitHub API error")}throw c}}async getCopilotWorkingStatus(e,r,n,o){Ac.debug(this.ctx,`Getting Copilot working status for ${e}/${r}#${n}`);try{let s=await this.getCopilotTimelineEvents(e,r,n,o),c;if(s.length>0){let l=s[s.length-1];l.eventType==="done"?c="done":l.eventType==="in_progress"?c="in_progress":l.eventType==="error"?c="error":c="not_copilot_issue"}else c="not_copilot_issue";return Ac.debug(this.ctx,`Copilot working status for ${e}/${r}#${n}: ${c}`),c}catch(s){return Ac.error(this.ctx,`Error getting Copilot working status for ${e}/${r}#${n}, treating as not Copilot issue:`,s),"not_copilot_issue"}}async cancelWorkflow(e,r,n){Ac.debug(this.ctx,`Cancelling workflow run ${n} for ${e}/${r}`);let o=await this.getOctokit();try{return await o.rest.actions.cancelWorkflowRun({owner:e,repo:r,run_id:n}),Ac.debug(this.ctx,`Successfully cancelled workflow run ${n} for ${e}/${r}`),!0}catch(s){if(Ac.error(this.ctx,`Failed to cancel workflow run ${n} for ${e}/${r}:`,s),s&&typeof s=="object"&&"status"in s){let c=s;throw new Fd(c.status,c.message||"GitHub API error")}throw s}}async listPullRequestFiles(e,r,n){Ac.debug(this.ctx,`Listing files for pull request ${e}/${r}#${n}`);let o=await this.getOctokit();try{let s=[],c=1,l=!0;for(;l;){Ac.debug(this.ctx,`Fetching pull request files page ${c} for ${e}/${r}#${n}`);let u=await o.rest.pulls.listFiles({owner:e,repo:r,pull_number:n,per_page:100,page:c});for(let f of u.data)s.push({fileName:f.filename});let d=u.headers.link;l=d?d.includes('rel="next"'):!1,c++}return Ac.debug(this.ctx,`Found ${s.length} files in pull request ${e}/${r}#${n}`),s}catch(s){if(Ac.error(this.ctx,`Failed to list files for pull request ${e}/${r}#${n}:`,s),s&&typeof s=="object"&&"status"in s){let c=s;throw new Fd(c.status,c.message||"GitHub API error")}throw s}}async getBranch(e,r,n){Ac.debug(this.ctx,`Getting branch ${n} from ${e}/${r}`);let o=await this.getOctokit();try{let s=await o.rest.repos.getBranch({owner:e,repo:r,branch:n});return Ac.debug(this.ctx,`Successfully retrieved branch ${n} from ${e}/${r}`),s.data}catch(s){if(s&&typeof s=="object"&&"status"in s){let c=s;throw Ac.debug(this.ctx,`GitHub API error getting branch ${n}: HTTP ${c.status} - ${c.message}`),new Fd(c.status,c.message||"GitHub API error")}throw Ac.error(this.ctx,`Unexpected error getting branch ${n} for ${e}/${r}:`,s),s}}async getPullRequest(e,r,n){Ac.debug(this.ctx,`Getting pull request ${e}/${r}#${n}`);let o=await this.getOctokit();try{let s=await o.rest.pulls.get({owner:e,repo:r,pull_number:n});return Ac.debug(this.ctx,`Successfully retrieved pull request ${e}/${r}#${n}`),{id:s.data.id,html_url:s.data.html_url,number:s.data.number,title:s.data.title,user:s.data.user?{login:s.data.user.login}:void 0,draft:s.data.draft,body:s.data.body||void 0,repository:{owner:{login:s.data.base.repo.owner.login},name:s.data.base.repo.name},updated_at:s.data.updated_at}}catch(s){if(s&&typeof s=="object"&&"status"in s){let c=s;throw Ac.debug(this.ctx,`GitHub API error getting pull request #${n}: HTTP ${c.status} - ${c.message}`),new Fd(c.status,c.message||"GitHub API error")}throw Ac.error(this.ctx,`Unexpected error getting pull request ${e}/${r}#${n}:`,s),s}}async addPullRequestComment(e,r,n,o){Ac.debug(this.ctx,`Adding comment to pull request ${e}/${r}#${n}`);let s=await this.getOctokit();try{let c=await s.rest.issues.createComment({owner:e,repo:r,issue_number:n,body:o});return Ac.debug(this.ctx,`Successfully added comment to ${e}/${r}#${n}`),{html_url:c.data.html_url}}catch(c){if(c&&typeof c=="object"&&"status"in c){let l=c;throw Ac.debug(this.ctx,`GitHub API error adding comment to #${n}: HTTP ${l.status} - ${l.message}`),new Fd(l.status,l.message||"GitHub API error")}throw Ac.error(this.ctx,`Unexpected error adding comment to pull request ${e}/${r}#${n}:`,c),c}}async listSecurityAdvisories(e,r,n=100){Ac.debug(this.ctx,`Listing security advisories for ${r.length} ${e} packages`);let o=await this.getOctokit();try{let s=[],c=1,l=!0;for(;l;){Ac.debug(this.ctx,`Fetching security advisories page ${c} for ${r.length} ${e} packages`);let u=await o.securityAdvisories.listGlobalAdvisories({ecosystem:e,affects:r,direction:"asc",sort:"published",per_page:n,page:c});s.push(...u.data);let d=u.headers.link;l=d?d.includes('rel="next"'):!1,c++}return Ac.debug(this.ctx,`Found ${s.length} security advisories for ${r.length} ${e} packages`),s}catch(s){if(Ac.error(this.ctx,"Failed to list security advisories:",s),s&&typeof s=="object"&&"status"in s){let c=s;throw Ac.debug(this.ctx,`GitHub API error listing security advisories for ${r.length} ${e} packages: HTTP ${c.status} - ${c.message}`),new Fd(c.status,c.message||"GitHub API error")}throw s}}async getApiSession(){let e=await this.ctx.get(Ur).resolveSession();if(!e)throw new uE;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var rl=new fe("CodingAgentClient"),HC=class{constructor(e,r){this.ctx=e;this.timeout=r??3e4}static{a(this,"CodingAgentClient")}getBaseUrl(){return"https://api.githubcopilot.com"}async createCodingTask(e,r,n,o,s,c){rl.debug(this.ctx,`Creating coding agent task for ${n}/${o} with title: ${e}`),this.validateCreateTaskParams(e,r,n,o);let l=await this.getAccessToken(),d=`${this.getBaseUrl()}/agents/swe/${cqt}/jobs/${n}/${o}`,f={problem_statement:r,event_type:"jetbrains",pull_request:{title:e,body_placeholder:Hvn(e),...s&&{base_ref:s}}},h={Authorization:`Bearer ${l}`,"Content-Type":"application/json",Accept:"application/json",...i0(this.ctx)};if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled before sending API request for ${n}/${o} with title: ${e}`),new H_;let g=await this.ctx.get(tr).fetch(d,{method:"POST",headers:h,body:JSON.stringify(f),timeout:this.timeout});if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled after sending API request for ${n}/${o} with title: ${e}`),new H_;let A=await this.handleCreateJobResponse(g);if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled after receiving job response for ${n}/${o} with title: ${e}`),new H_;let y=await this.waitForJobPullRequest(n,o,A.job_id,l,c);if(c?.isCancellationRequested)throw rl.debug(this.ctx,`Create coding task was cancelled after polling job ${A.job_id} for ${n}/${o}`),new H_;let E=y.pull_request?.number;if(typeof E!="number")throw new l0("No valid pull request number returned from job");let v=await new Zh(this.ctx).getPullRequest(n,o,E);return rl.debug(this.ctx,`Coding task created successfully for ${n}/${o}: job ${A.job_id}, session ${A.session_id}, PR #${v.number}`),{pullRequest:v,sessionId:A.session_id}}validateCreateTaskParams(e,r,n,o){if(!e?.trim())throw rl.debug(this.ctx,"Validation failed: Title is required and cannot be empty"),new sp("Title is required and cannot be empty");if(!r?.trim())throw rl.debug(this.ctx,"Validation failed: ProblemStatement is required and cannot be empty"),new sp("ProblemStatement is required and cannot be empty");if(!n?.trim())throw rl.debug(this.ctx,"Validation failed: Owner is required and cannot be empty"),new sp("Owner is required and cannot be empty");if(!o?.trim())throw rl.debug(this.ctx,"Validation failed: Repository name is required and cannot be empty"),new sp("Repository name is required and cannot be empty");rl.debug(this.ctx,`Validation passed for ${n}/${o}`)}async getAccessToken(){let r=await this.ctx.get(Ur).resolveSession();if(!r?.accessToken)throw rl.debug(this.ctx,"Failed to get access token"),new tw("Failed to call cloud agent API: Not authenticated with GitHub");return r.accessToken}async fetchWithCancellation(e,r,n){let o=new AbortController,s=n?.onCancellationRequested(()=>o.abort());try{return await this.ctx.get(tr).fetch(e,{timeout:this.timeout,signal:o.signal,...r})}finally{s?.dispose()}}async getAllSessions(e,r){rl.debug(this.ctx,`Getting all coding agent sessions for pull request ID: ${e}`);let n=await this.getAccessToken(),o=this.getBaseUrl();if(r?.isCancellationRequested)throw rl.debug(this.ctx,`Get all sessions operation was cancelled before sending API request for pull request ID: ${e}`),new H_;try{let s=`${o}/agents/sessions/resource/pull/${e}`,c={Authorization:`Bearer ${n}`,Accept:"application/json",...i0(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw rl.debug(this.ctx,`Get all sessions operation was cancelled after sending API request for pull request ID: ${e}`),new H_;if(!l.ok){let d=await l.text().catch(()=>l.statusText),f=`Failed to get cloud agent sessions: HTTP ${l.status} - ${d}`;throw rl.error(this.ctx,f),new l0(f)}let u=await l.json();return rl.debug(this.ctx,`Found ${u.sessions?.length||0} coding agent sessions for pull request ID: ${e}`),u.sessions||null}catch(s){if(s instanceof $P)throw s;let c=`Failed to get cloud agent sessions: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw rl.error(this.ctx,c),new Bxe(c)}}async getSessionLogs(e,r){if(rl.debug(this.ctx,`Getting coding agent session logs for session ID: ${e}`),!e?.trim())throw new sp("Session ID is required and cannot be empty");let n=await this.getAccessToken(),o=this.getBaseUrl();if(r?.isCancellationRequested)throw rl.debug(this.ctx,`Get session logs operation was cancelled before sending API request for session ID: ${e}`),new H_;try{let s=`${o}/agents/sessions/${e}/logs`,c={Authorization:`Bearer ${n}`,...i0(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw rl.debug(this.ctx,`Get session logs operation was cancelled after sending API request for session ID: ${e}`),new H_;if(!l.ok){let u=await l.text().catch(()=>l.statusText),d=`Failed to get cloud agent session logs: HTTP ${l.status} - ${u}`;throw rl.error(this.ctx,d),new l0(d)}return await l.text()}catch(s){if(s instanceof $P)throw s;let c=`Failed to get cloud agent session logs: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw rl.error(this.ctx,c),new Bxe(c)}}async waitForJobPullRequest(e,r,n,o,s){let c=Date.now(),l=3e4,u=2e3;for(;Date.now()-csetTimeout(r,e))}async handleCreateJobResponse(e){if(!e.ok){let n=await e.text().catch(()=>e.statusText);throw rl.error(this.ctx,`Cloud agent API request failed with status ${e.status}: ${n}`),e.status===403||e.status===401?new l0("Cloud agent is not enabled or you do not have access. Learn more about cloud agent at https://docs.github.com/copilot/concepts/agents/cloud-agent/about-cloud-agent"):new l0(`API request failed: HTTP ${e.status} - ${n}`)}let r;try{r=await e.json()}catch(n){let o=n instanceof Error?n.message:JSON.stringify(n);throw rl.error(this.ctx,`Failed to parse create coding task API response as JSON: ${o}`),new l0(`Failed to parse API response as JSON: ${o}`)}if(!r.job_id||!r.session_id)throw rl.error(this.ctx,"API response missing job_id or session_id",r),new l0("Invalid response from cloud agent");return r}};p();p();var wO=class{static{a(this,"LSPRequestSender")}};var DCn=de(ri());var nJe=class{constructor(){this.codingAgentMessageRequestType=new DCn.ProtocolRequestType("copilot/codingAgentMessage")}static{a(this,"CodingAgentMessageHandler")}async sendCodingAgentMessage(e,r,n,o){try{ot.debug(e.ctx,`Sending coding agent message to client: ${r} - ${o}`);let c=await e.ctx.get(wO).sendRequest(this.codingAgentMessageRequestType,{title:r,description:n,prLink:o,conversationId:e.conversation.id.toString(),turnId:e.turn.id.toString()});return ot.debug(e.ctx,"Successfully sent coding agent message to client"),c}catch(s){let c=`Failed to send coding agent message: ${s instanceof Error?s.message:JSON.stringify(s)}`;return ot.error(e.ctx,c,s),{success:!1,error:c}}}};p();p();p();p();var GC=de(Io());function Sqt(t){return{isCancellationRequested:t.isCancellationRequested,onCancellationRequested:a(e=>{let r=t.onCancellationRequested(e);return{dispose:a(()=>r.dispose(),"dispose")}},"onCancellationRequested")}}a(Sqt,"adaptCancellationToken");function NCn(t){return{report:a(e=>{"value"in e&&typeof e.value=="string"?t({text:e.value}):t({})},"report")}}a(NCn,"adaptProgressCallback");function MCn(t){return{modelMaxPromptTokens:t.maxRequestTokens}}a(MCn,"createEndpointInfo");function OCn(t){let e={role:sHo(t.role),content:aHo(t.content)};if(t.role===GC.Raw.ChatRole.Assistant&&"toolCalls"in t&&t.toolCalls&&(e.tool_calls=t.toolCalls.map(r=>({id:r.id,type:r.type,function:r.function,approxNumTokens:0}))),t.role===GC.Raw.ChatRole.Tool&&"toolCallId"in t&&t.toolCallId&&(e.tool_call_id=t.toolCallId),Array.isArray(t.content)){let r=!1;for(let n of t.content){if(n.type===GC.Raw.ChatCompletionContentPartKind.Opaque&&n.value){let o=zYe(n);o&&(e.thinking=o);let s=WYe(n);s&&(e.phase=s)}n.type===GC.Raw.ChatCompletionContentPartKind.CacheBreakpoint&&(r=!0)}r&&(e.copilot_cache_control={type:"ephemeral"})}return Object.entries(t).forEach(([r,n])=>{["role","content","toolCalls","toolCallId"].includes(r)||(e[r]=n)}),e}a(OCn,"convertToCopilotChatMessage");function sHo(t){switch(t){case GC.Raw.ChatRole.System:return"system";case GC.Raw.ChatRole.User:return"user";case GC.Raw.ChatRole.Assistant:return"assistant";case GC.Raw.ChatRole.Tool:return"tool";default:return"user"}}a(sHo,"convertRole");function aHo(t){if(typeof t=="string")return t;if(Array.isArray(t)){let e=t.filter(r=>r.type===GC.Raw.ChatCompletionContentPartKind.Text||r.type===GC.Raw.ChatCompletionContentPartKind.Image);return e.length===1&&e[0].type===GC.Raw.ChatCompletionContentPartKind.Text?e[0].text:e.length===0?"":e.map(r=>r.type===GC.Raw.ChatCompletionContentPartKind.Text?{type:"text",text:r.text}:r.type===GC.Raw.ChatCompletionContentPartKind.Image?{type:"image_url",image_url:r.imageUrl}:{type:"text",text:""})}return String(t)}a(aHo,"convertContent");p();var G3=de(Io());var iJe=class extends G3.PromptRenderer{constructor(r,n,o,s,c){super(o,r,n,s);this.options=c}static{a(this,"InternalPromptRenderer")}async renderWithOptions(r,n,o){let s=await super.render(r,n);return{...this.options,...o}.collapseSystemMessages&&this.collapseConsecutiveSystemMessages(s.messages),s}collapseConsecutiveSystemMessages(r){let n=[],o=null;for(let s of r)if(s.role===G3.Raw.ChatRole.System&&o?.role===G3.Raw.ChatRole.System){let c=o.content.at(-1),l=s.content.at(0);c&&l&&c.type===G3.Raw.ChatCompletionContentPartKind.Text&&l.type===G3.Raw.ChatCompletionContentPartKind.Text?(c.text=c.text.trimEnd()+` -`+l.text,o.content=o.content.concat(s.content.slice(1))):(o.content.push({type:G3.Raw.ChatCompletionContentPartKind.Text,text:` -`}),o.content=o.content.concat(s.content))}else n.push(s),o=s.role===G3.Raw.ChatRole.System?s:null;r.length=0,r.push(...n)}};p();p();function LCn(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(fHo(e)){case"image/png":return cHo(e);case"image/gif":return lHo(e);case"image/jpeg":case"image/jpg":return uHo(e);case"image/webp":return dHo(e);default:throw new Error("Unsupported image format")}}a(LCn,"getImageDimensions");function cHo(t){let e=atob(t.slice(0,50)).slice(16,24),r=Uint8Array.from(e,o=>o.charCodeAt(0)),n=new DataView(r.buffer);return{width:n.getUint32(0,!1),height:n.getUint32(4,!1)}}a(cHo,"getPngDimensions");function lHo(t){let e=atob(t.slice(0,50)),r=Uint8Array.from(e,o=>o.charCodeAt(0)),n=new DataView(r.buffer);return{width:n.getUint16(6,!0),height:n.getUint16(8,!0)}}a(lHo,"getGifDimensions");function uHo(t){let e=atob(t),r=Uint8Array.from(e,s=>s.charCodeAt(0)),n=r.length,o=2;for(;o=65472&&s<=65474){let l=new DataView(r.buffer,o+5,4);return{height:l.getUint16(0,!1),width:l.getUint16(2,!1)}}o+=2+c}throw new Error("JPEG dimensions not found")}a(uHo,"getJpegDimensions");function dHo(t){let e=atob(t),r=new Uint8Array(e.length);for(let o=0;o2048||o>2048){let l=2048/Math.max(n,o);n=Math.round(n*l),o=Math.round(o*l)}let s=768/Math.min(n,o);return n=Math.round(n*s),o=Math.round(o*s),Math.ceil(n/512)*Math.ceil(o/512)*170+85}};function oJe(t){let e=ws(t.tokenizer);return new Tqt(e,t)}a(oJe,"createPromptTsxTokenizer");function mHo(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(mHo,"estimateDocumentTokenCost");var ap=class t{static{a(this,"TsxPromptRenderer")}constructor(e,r,n,o={}){this._options=o;let s=MCn(n),c=oJe(n);this._internalRenderer=new iJe(e,r,s,c,o)}static create(e,r,n,o={}){return new t(e,r,n,o)}async renderPrompt(e,r,n){let o=e?NCn(e):void 0,s=r?Sqt(r):void 0,c=await this._internalRenderer.renderWithOptions(o,s,n);return{...this._options,...n}.enableCacheBreakpoints?t_n(c.messages):r_n(c.messages),{messages:c.messages.map(OCn),tokenCount:c.tokenCount,hasIgnoredFiles:c.hasIgnoredFiles}}async countTokens(e){let r=e?Sqt(e):void 0;return(await this._internalRenderer.renderWithOptions(void 0,r)).tokenCount}};async function Iqt(t,e,r,n,o,s){return await ap.create(t,e,r,s).renderPrompt(n,o,s)}a(Iqt,"renderTsxPrompt");p();p();p();var BCn=new fe("toolCallRoundsBuilder");function RO(t,e={}){let r=[],{ctx:n,identifier:o,enableWarnings:s=!1}=e,c=0;for(;c0){let u=new Set(l.tool_calls.map(m=>m.id)),d=[],f=c+1,h=!1;for(;f0){let u=r[r.length-1];u.followUpUserMessage||(u.followUpUserMessage=l)}c++}}return r}a(RO,"buildAssistantRounds");p();var W_=de(Io());var qxe=new fe("toolCalling"),rw=class extends lr{static{a(this,"ChatAssistantRounds")}renderCopilot(){if(!this.props.assistantRounds||this.props.assistantRounds.length===0)return vscpp(vscppf,null);let e=this.props.assistantRounds.length,r=this.props.assistantRounds.flatMap((o,s)=>this.renderOneAssistantRound(o,s,e));if(r.length===0)return vscpp(vscppf,null);let n=(0,W_.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},r))}renderOneAssistantRound(e,r,n){let o=e.assistantMessage;if(o.role!=="assistant")return qxe.warn(this.props.ctx,`Tool call round ${r} does not have a valid assistant message`),[];let s=o.modelId!==void 0&&this.props.modelConfiguration?.modelId===o.modelId,c=s&&o.thinking?vscpp(oue,{thinking:o.thinking}):vscpp(vscppf,null),l=o.phase&&s?vscpp(VYe,{phase:o.phase}):vscpp(vscppf,null);if(!o.tool_calls||o.tool_calls.length===0){let A=this.getMessageContent(o),y=s&&!!o.thinking,E=!!e.followUpUserMessage,_=[];if((A&&A.trim().length>0||y||E)&&_.push(vscpp(W_.AssistantMessage,null,vscpp(vscppf,null,A),c,l)),e.followUpUserMessage){let v=this.getMessageContent(e.followUpUserMessage);v&&_.push(vscpp(W_.UserMessage,null,vscpp(vscppf,null,v)))}return _}let u=new Set;for(let A of e.toolResults)A.role==="tool"&&A.tool_call_id&&u.add(A.tool_call_id);let d=o.tool_calls.filter(A=>A.id&&u.has(A.id));if(d.length===0){let A=this.props.isHistorical?"conversation history":`turn ${this.props.identifier||"unknown"}`;qxe.warn(this.props.ctx,`Tool call round ${r} has ${o.tool_calls.length} tool call(s) but none have corresponding results in ${A}. Rendering assistant message content only.`);let y=this.getMessageContent(o);if(!y||y.trim().length===0){if(e.followUpUserMessage){let _=this.getMessageContent(e.followUpUserMessage);if(_)return[vscpp(W_.AssistantMessage,null,vscpp(vscppf,null,""),c,l),vscpp(W_.UserMessage,null,vscpp(vscppf,null,_))]}return[]}let E=[vscpp(W_.AssistantMessage,null,vscpp(vscppf,null,y),c,l)];if(e.followUpUserMessage){let _=this.getMessageContent(e.followUpUserMessage);_&&E.push(vscpp(W_.UserMessage,null,vscpp(vscppf,null,_)))}return E}if(d.length{let y=(0,W_.useKeepWith)();return f.set(A.id,y),{type:"function",function:{name:A.function.name,arguments:typeof A.function.arguments=="string"?A.function.arguments:JSON.stringify(A.function.arguments)},id:A.id,keepWith:y}}),m=[];m.push(vscpp(W_.AssistantMessage,{toolCalls:h},vscpp(vscppf,null,this.getMessageContent(o)),c,l));let g=1/(n*4)/d.length;for(let A=0;AT.tool_call_id===y.id);if(!_){let T=this.props.isHistorical?"conversation history":`turn ${this.props.identifier||"unknown"}`;qxe.warn(this.props.ctx,`No tool result found for tool call ID ${y.id} in ${T}`);continue}let v=this.getMessageContent(_);this.props.truncateAt&&(v=this.truncateContent(v,this.props.truncateAt));let b=E;m.push(vscpp(b,{priority:r,flexGrow:r+1,flexReserve:`/${1/g}`},vscpp(W_.ToolMessage,{toolCallId:y.id},vscpp(vscppf,null,v))))}if(e.followUpUserMessage){let A=this.getMessageContent(e.followUpUserMessage);A&&m.push(vscpp(W_.UserMessage,null,vscpp(vscppf,null,A)))}return m}getMessageContent(e){return typeof e.content=="string"?e.content:Array.isArray(e.content)?e.content.map(r=>r.type==="text"?r.text:"").filter(r=>r.length>0).join(` -`):JSON.stringify(e.content)}truncateContent(e,r){let n=this.props.modelConfiguration;if(!n||e.lengthWGo.includes(l)?(c[l]=n[l],c):(c.variables||(c.variables={}),c.variables[l]=n[l],c),{}),s=n.baseUrl||t.endpoint.DEFAULTS.baseUrl;return zbn.test(s)&&(o.url=s.replace(zbn,"/api/graphql")),t(o).then(c=>{if(c.data.errors){let l={};for(let u of Object.keys(c.headers))l[u]=c.headers[u];throw new VGo(o,l,c.data)}return c.data.data})}a(YGo,"graphql");function ajt(t,e){let r=t.defaults(e);return Object.assign(a((o,s)=>YGo(r,o,s),"newApi"),{defaults:ajt.bind(null,r),endpoint:r.endpoint})}a(ajt,"withDefaults");var Ybn=ajt(owe,{headers:{"user-agent":`octokit-graphql.js/${GGo} ${Bq()}`},method:"POST",url:"/graphql"});function Kbn(t){return ajt(t,{method:"POST",url:"/graphql"})}a(Kbn,"withCustomRequest");p();var cjt="(?:[a-zA-Z0-9_-]+)",Jbn="\\.",Zbn=new RegExp(`^${cjt}${Jbn}${cjt}${Jbn}${cjt}$`),KGo=Zbn.test.bind(Zbn);async function JGo(t){let e=KGo(t),r=t.startsWith("v1.")||t.startsWith("ghs_"),n=t.startsWith("ghu_");return{type:"token",token:t,tokenType:e?"app":r?"installation":n?"user-to-server":"oauth"}}a(JGo,"auth");function ZGo(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}a(ZGo,"withAuthorizationPrefix");async function XGo(t,e,r,n){let o=e.endpoint.merge(r,n);return o.headers.authorization=ZGo(t),e(o)}a(XGo,"hook");var Xbn=a(function(e){if(!e)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof e!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return e=e.replace(/^(token|bearer) +/i,""),Object.assign(JGo.bind(null,e),{hook:XGo.bind(null,e)})},"createTokenAuth2");p();var ljt="7.0.6";var e1n=a(()=>{},"noop"),e$o=console.warn.bind(console),t$o=console.error.bind(console);function r$o(t={}){return typeof t.debug!="function"&&(t.debug=e1n),typeof t.info!="function"&&(t.info=e1n),typeof t.warn!="function"&&(t.warn=e$o),typeof t.error!="function"&&(t.error=t$o),t}a(r$o,"createLogger");var t1n=`octokit-core.js/${ljt} ${Bq()}`,kJe=class{static{a(this,"Octokit")}static VERSION=ljt;static defaults(e){return class extends this{static{a(this,"OctokitWithDefaults")}constructor(...n){let o=n[0]||{};if(typeof e=="function"){super(e(o));return}super(Object.assign({},e,o,o.userAgent&&e.userAgent?{userAgent:`${o.userAgent} ${e.userAgent}`}:null))}}}static plugins=[];static plugin(...e){let r=this.plugins;return class extends this{static{a(this,"NewOctokit")}static plugins=r.concat(e.filter(o=>!r.includes(o)))}}constructor(e={}){let r=new xbn.Collection,n={baseUrl:owe.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:r.bind(null,"request")}),mediaType:{previews:[],format:""}};if(n.headers["user-agent"]=e.userAgent?`${e.userAgent} ${t1n}`:t1n,e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers["time-zone"]=e.timeZone),this.request=owe.defaults(n),this.graphql=Kbn(this.request).defaults(n),this.log=r$o(e.log),this.hook=r,e.authStrategy){let{authStrategy:s,...c}=e,l=s(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:c},e.auth));r.wrap("request",l.hook),this.auth=l}else if(!e.auth)this.auth=async()=>({type:"unauthenticated"});else{let s=Xbn(e.auth);r.wrap("request",s.hook),this.auth=s}let o=this.constructor;for(let s=0;s{t.log.debug("request",r);let n=Date.now(),o=t.request.endpoint.parse(r),s=o.url.replace(r.baseUrl,"");return e(r).then(c=>{let l=c.headers["x-github-request-id"];return t.log.info(`${o.method} ${s} - ${c.status} with id ${l} in ${Date.now()-n}ms`),c}).catch(c=>{let l=c.response?.headers["x-github-request-id"]||"UNKNOWN";throw t.log.error(`${o.method} ${s} - ${c.status} with id ${l} in ${Date.now()-n}ms`),c})})}a(ujt,"requestLog");ujt.VERSION=r1n;p();var n$o="0.0.0-development";function i$o(t){if(!t.data)return{...t,data:[]};if(!(("total_count"in t.data||"total_commits"in t.data)&&!("url"in t.data)))return t;let r=t.data.incomplete_results,n=t.data.repository_selection,o=t.data.total_count,s=t.data.total_commits;delete t.data.incomplete_results,delete t.data.repository_selection,delete t.data.total_count,delete t.data.total_commits;let c=Object.keys(t.data)[0],l=t.data[c];return t.data=l,typeof r<"u"&&(t.data.incomplete_results=r),typeof n<"u"&&(t.data.repository_selection=n),t.data.total_count=o,t.data.total_commits=s,t}a(i$o,"normalizePaginatedListResponse");function djt(t,e,r){let n=typeof e=="function"?e.endpoint(r):t.request.endpoint(e,r),o=typeof e=="function"?e:t.request,s=n.method,c=n.headers,l=n.url;return{[Symbol.asyncIterator]:()=>({async next(){if(!l)return{done:!0};try{let u=await o({method:s,url:l,headers:c}),d=i$o(u);if(l=((d.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1],!l&&"total_commits"in d.data){let f=new URL(d.url),h=f.searchParams,m=parseInt(h.get("page")||"1",10),g=parseInt(h.get("per_page")||"250",10);m*g{if(o.done)return e;let s=!1;function c(){s=!0}return a(c,"done"),e=e.concat(n?n(o.value,c):o.value.data),s?e:i1n(t,e,r,n)})}a(i1n,"gather");var cud=Object.assign(n1n,{iterator:djt});function fjt(t){return{paginate:Object.assign(n1n.bind(null,t),{iterator:djt.bind(null,t)})}}a(fjt,"paginateRest");fjt.VERSION=n$o;p();p();var pjt="17.0.0";p();p();var o$o={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repos/{owner}/{repo}/environments/{environment_name}/variables"],createHostedRunnerForOrg:["POST /orgs/{org}/actions/hosted-runners"],createOrUpdateEnvironmentSecret:["PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createOrgVariable:["POST /orgs/{org}/actions/variables"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createRepoVariable:["POST /repos/{owner}/{repo}/actions/variables"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteActionsCacheById:["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"],deleteActionsCacheByKey:["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteCustomImageFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],deleteCustomImageVersionFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],deleteEnvironmentSecret:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],deleteEnvironmentVariable:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],deleteHostedRunnerForOrg:["DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteRepoVariable:["DELETE /repos/{owner}/{repo}/actions/variables/{name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],disableSelectedRepositoryGithubActionsOrganization:["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"],disableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunAttemptLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],enableSelectedRepositoryGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"],enableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"],forceCancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"],generateRunnerJitconfigForOrg:["POST /orgs/{org}/actions/runners/generate-jitconfig"],generateRunnerJitconfigForRepo:["POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"],getActionsCacheList:["GET /repos/{owner}/{repo}/actions/caches"],getActionsCacheUsage:["GET /repos/{owner}/{repo}/actions/cache/usage"],getActionsCacheUsageByRepoForOrg:["GET /orgs/{org}/actions/cache/usage-by-repository"],getActionsCacheUsageForOrg:["GET /orgs/{org}/actions/cache/usage"],getAllowedActionsOrganization:["GET /orgs/{org}/actions/permissions/selected-actions"],getAllowedActionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getCustomImageForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],getCustomImageVersionForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],getCustomOidcSubClaimForRepo:["GET /repos/{owner}/{repo}/actions/oidc/customization/sub"],getEnvironmentPublicKey:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"],getEnvironmentSecret:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],getEnvironmentVariable:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],getGithubActionsDefaultWorkflowPermissionsOrganization:["GET /orgs/{org}/actions/permissions/workflow"],getGithubActionsDefaultWorkflowPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/workflow"],getGithubActionsPermissionsOrganization:["GET /orgs/{org}/actions/permissions"],getGithubActionsPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions"],getHostedRunnerForOrg:["GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],getHostedRunnersGithubOwnedImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/github-owned"],getHostedRunnersLimitsForOrg:["GET /orgs/{org}/actions/hosted-runners/limits"],getHostedRunnersMachineSpecsForOrg:["GET /orgs/{org}/actions/hosted-runners/machine-sizes"],getHostedRunnersPartnerImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/partner"],getHostedRunnersPlatformsForOrg:["GET /orgs/{org}/actions/hosted-runners/platforms"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getOrgVariable:["GET /orgs/{org}/actions/variables/{name}"],getPendingDeploymentsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],getRepoPermissions:["GET /repos/{owner}/{repo}/actions/permissions",{},{renamed:["actions","getGithubActionsPermissionsRepository"]}],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getRepoVariable:["GET /repos/{owner}/{repo}/actions/variables/{name}"],getReviewsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowAccessToRepository:["GET /repos/{owner}/{repo}/actions/permissions/access"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listCustomImageVersionsForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions"],listCustomImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom"],listEnvironmentSecrets:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"],listEnvironmentVariables:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables"],listGithubHostedRunnersInGroupForOrg:["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners"],listHostedRunnersForOrg:["GET /orgs/{org}/actions/hosted-runners"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listJobsForWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"],listLabelsForSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}/labels"],listLabelsForSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listOrgVariables:["GET /orgs/{org}/actions/variables"],listRepoOrganizationSecrets:["GET /repos/{owner}/{repo}/actions/organization-secrets"],listRepoOrganizationVariables:["GET /repos/{owner}/{repo}/actions/organization-variables"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoVariables:["GET /repos/{owner}/{repo}/actions/variables"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelectedReposForOrgVariable:["GET /orgs/{org}/actions/variables/{name}/repositories"],listSelectedRepositoriesEnabledGithubActionsOrganization:["GET /orgs/{org}/actions/permissions/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunJobForWorkflowRun:["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],reRunWorkflowFailedJobs:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"],removeAllCustomLabelsFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"],removeAllCustomLabelsFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],removeCustomLabelFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"],removeCustomLabelFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],reviewCustomGatesForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"],reviewPendingDeploymentsForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],setAllowedActionsOrganization:["PUT /orgs/{org}/actions/permissions/selected-actions"],setAllowedActionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"],setCustomLabelsForSelfHostedRunnerForOrg:["PUT /orgs/{org}/actions/runners/{runner_id}/labels"],setCustomLabelsForSelfHostedRunnerForRepo:["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],setCustomOidcSubClaimForRepo:["PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"],setGithubActionsDefaultWorkflowPermissionsOrganization:["PUT /orgs/{org}/actions/permissions/workflow"],setGithubActionsDefaultWorkflowPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/workflow"],setGithubActionsPermissionsOrganization:["PUT /orgs/{org}/actions/permissions"],setGithubActionsPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"],setSelectedReposForOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories"],setSelectedRepositoriesEnabledGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories"],setWorkflowAccessToRepository:["PUT /repos/{owner}/{repo}/actions/permissions/access"],updateEnvironmentVariable:["PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],updateHostedRunnerForOrg:["PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],updateOrgVariable:["PATCH /orgs/{org}/actions/variables/{name}"],updateRepoVariable:["PATCH /repos/{owner}/{repo}/actions/variables/{name}"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsDone:["DELETE /notifications/threads/{thread_id}"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","addRepoToInstallationForAuthenticatedUser"]}],addRepoToInstallationForAuthenticatedUser:["PUT /user/installations/{installation_id}/repositories/{repository_id}"],checkToken:["POST /applications/{client_id}/token"],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens"],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}"],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app"],getBySlug:["GET /apps/{app_slug}"],getInstallation:["GET /app/installations/{installation_id}"],getOrgInstallation:["GET /orgs/{org}/installation"],getRepoInstallation:["GET /repos/{owner}/{repo}/installation"],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation"],getWebhookConfigForApp:["GET /app/hook/config"],getWebhookDelivery:["GET /app/hook/deliveries/{delivery_id}"],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories"],listInstallationRequestsForAuthenticatedApp:["GET /app/installation-requests"],listInstallations:["GET /app/installations"],listInstallationsForAuthenticatedUser:["GET /user/installations"],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories"],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],listWebhookDeliveries:["GET /app/hook/deliveries"],redeliverWebhookDelivery:["POST /app/hook/deliveries/{delivery_id}/attempts"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","removeRepoFromInstallationForAuthenticatedUser"]}],removeRepoFromInstallationForAuthenticatedUser:["DELETE /user/installations/{installation_id}/repositories/{repository_id}"],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],scopeToken:["POST /applications/{client_id}/token/scoped"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"],updateWebhookConfigForApp:["PATCH /app/hook/config"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubBillingPremiumRequestUsageReportOrg:["GET /organizations/{org}/settings/billing/premium_request/usage"],getGithubBillingPremiumRequestUsageReportUser:["GET /users/{username}/settings/billing/premium_request/usage"],getGithubBillingUsageReportOrg:["GET /organizations/{org}/settings/billing/usage"],getGithubBillingUsageReportUser:["GET /users/{username}/settings/billing/usage"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},campaigns:{createCampaign:["POST /orgs/{org}/campaigns"],deleteCampaign:["DELETE /orgs/{org}/campaigns/{campaign_number}"],getCampaignSummary:["GET /orgs/{org}/campaigns/{campaign_number}"],listOrgCampaigns:["GET /orgs/{org}/campaigns"],updateCampaign:["PATCH /orgs/{org}/campaigns/{campaign_number}"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs"],createSuite:["POST /repos/{owner}/{repo}/check-suites"],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],rerequestRun:["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences"],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]},codeScanning:{commitAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits"],createAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],createVariantAnalysis:["POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"],deleteAnalysis:["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"],deleteCodeqlDatabase:["DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",{},{renamedParameters:{alert_id:"alert_number"}}],getAnalysis:["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"],getAutofix:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],getCodeqlDatabase:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getDefaultSetup:["GET /repos/{owner}/{repo}/code-scanning/default-setup"],getSarif:["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],getVariantAnalysis:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}"],getVariantAnalysisRepoTask:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}"],listAlertInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"],listAlertsForOrg:["GET /orgs/{org}/code-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"],listAlertsInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",{},{renamed:["codeScanning","listAlertInstances"]}],listCodeqlDatabases:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases"],listRecentAnalyses:["GET /repos/{owner}/{repo}/code-scanning/analyses"],updateAlert:["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"],updateDefaultSetup:["PATCH /repos/{owner}/{repo}/code-scanning/default-setup"],uploadSarif:["POST /repos/{owner}/{repo}/code-scanning/sarifs"]},codeSecurity:{attachConfiguration:["POST /orgs/{org}/code-security/configurations/{configuration_id}/attach"],attachEnterpriseConfiguration:["POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"],createConfiguration:["POST /orgs/{org}/code-security/configurations"],createConfigurationForEnterprise:["POST /enterprises/{enterprise}/code-security/configurations"],deleteConfiguration:["DELETE /orgs/{org}/code-security/configurations/{configuration_id}"],deleteConfigurationForEnterprise:["DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],detachConfiguration:["DELETE /orgs/{org}/code-security/configurations/detach"],getConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}"],getConfigurationForRepository:["GET /repos/{owner}/{repo}/code-security-configuration"],getConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations"],getConfigurationsForOrg:["GET /orgs/{org}/code-security/configurations"],getDefaultConfigurations:["GET /orgs/{org}/code-security/configurations/defaults"],getDefaultConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/defaults"],getRepositoriesForConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"],getRepositoriesForEnterpriseConfiguration:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"],getSingleConfigurationForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],setConfigurationAsDefault:["PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults"],setConfigurationAsDefaultForEnterprise:["PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"],updateConfiguration:["PATCH /orgs/{org}/code-security/configurations/{configuration_id}"],updateEnterpriseConfiguration:["PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct"],getConductCode:["GET /codes_of_conduct/{key}"]},codespaces:{addRepositoryForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],checkPermissionsForDevcontainer:["GET /repos/{owner}/{repo}/codespaces/permissions_check"],codespaceMachinesForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/machines"],createForAuthenticatedUser:["POST /user/codespaces"],createOrUpdateOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],createOrUpdateSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}"],createWithPrForAuthenticatedUser:["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"],createWithRepoForAuthenticatedUser:["POST /repos/{owner}/{repo}/codespaces"],deleteForAuthenticatedUser:["DELETE /user/codespaces/{codespace_name}"],deleteFromOrganization:["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"],deleteOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],deleteSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}"],exportForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/exports"],getCodespacesForUserInOrg:["GET /orgs/{org}/members/{username}/codespaces"],getExportDetailsForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/exports/{export_id}"],getForAuthenticatedUser:["GET /user/codespaces/{codespace_name}"],getOrgPublicKey:["GET /orgs/{org}/codespaces/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}"],getPublicKeyForAuthenticatedUser:["GET /user/codespaces/secrets/public-key"],getRepoPublicKey:["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],getSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}"],listDevcontainersInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/devcontainers"],listForAuthenticatedUser:["GET /user/codespaces"],listInOrganization:["GET /orgs/{org}/codespaces",{},{renamedParameters:{org_id:"org"}}],listInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces"],listOrgSecrets:["GET /orgs/{org}/codespaces/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/codespaces/secrets"],listRepositoriesForSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}/repositories"],listSecretsForAuthenticatedUser:["GET /user/codespaces/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],preFlightWithRepoForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/new"],publishForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/publish"],removeRepositoryForSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],repoMachinesForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/machines"],setRepositoriesForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],startForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/start"],stopForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/stop"],stopInOrganization:["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"],updateForAuthenticatedUser:["PATCH /user/codespaces/{codespace_name}"]},copilot:{addCopilotSeatsForTeams:["POST /orgs/{org}/copilot/billing/selected_teams"],addCopilotSeatsForUsers:["POST /orgs/{org}/copilot/billing/selected_users"],cancelCopilotSeatAssignmentForTeams:["DELETE /orgs/{org}/copilot/billing/selected_teams"],cancelCopilotSeatAssignmentForUsers:["DELETE /orgs/{org}/copilot/billing/selected_users"],copilotMetricsForOrganization:["GET /orgs/{org}/copilot/metrics"],copilotMetricsForTeam:["GET /orgs/{org}/team/{team_slug}/copilot/metrics"],getCopilotOrganizationDetails:["GET /orgs/{org}/copilot/billing"],getCopilotSeatDetailsForUser:["GET /orgs/{org}/members/{username}/copilot"],listCopilotSeats:["GET /orgs/{org}/copilot/billing/seats"]},credentials:{revoke:["POST /credentials/revoke"]},dependabot:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],deleteOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],getAlert:["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],getOrgPublicKey:["GET /orgs/{org}/dependabot/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/dependabot/alerts"],listAlertsForOrg:["GET /orgs/{org}/dependabot/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/dependabot/alerts"],listOrgSecrets:["GET /orgs/{org}/dependabot/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/dependabot/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],repositoryAccessForOrg:["GET /organizations/{org}/dependabot/repository-access"],setRepositoryAccessDefaultLevel:["PUT /organizations/{org}/dependabot/repository-access/default-level"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],updateAlert:["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],updateRepositoryAccessForOrg:["PATCH /organizations/{org}/dependabot/repository-access"]},dependencyGraph:{createRepositorySnapshot:["POST /repos/{owner}/{repo}/dependency-graph/snapshots"],diffRange:["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"],exportSbom:["GET /repos/{owner}/{repo}/dependency-graph/sbom"]},emojis:{get:["GET /emojis"]},enterpriseTeamMemberships:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove"],get:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],list:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"],remove:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"]},enterpriseTeamOrganizations:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove"],delete:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignment:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignments:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations"]},enterpriseTeams:{create:["POST /enterprises/{enterprise}/teams"],delete:["DELETE /enterprises/{enterprise}/teams/{team_slug}"],get:["GET /enterprises/{enterprise}/teams/{team_slug}"],list:["GET /enterprises/{enterprise}/teams"],update:["PATCH /enterprises/{enterprise}/teams/{team_slug}"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},hostedCompute:{createNetworkConfigurationForOrg:["POST /orgs/{org}/settings/network-configurations"],deleteNetworkConfigurationFromOrg:["DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkConfigurationForOrg:["GET /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkSettingsForOrg:["GET /orgs/{org}/settings/network-settings/{network_settings_id}"],listNetworkConfigurationsForOrg:["GET /orgs/{org}/settings/network-configurations"],updateNetworkConfigurationForOrg:["PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}"]},interactions:{getRestrictionsForAuthenticatedUser:["GET /user/interaction-limits"],getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits"],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits"],getRestrictionsForYourPublicRepos:["GET /user/interaction-limits",{},{renamed:["interactions","getRestrictionsForAuthenticatedUser"]}],removeRestrictionsForAuthenticatedUser:["DELETE /user/interaction-limits"],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits"],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits"],removeRestrictionsForYourPublicRepos:["DELETE /user/interaction-limits",{},{renamed:["interactions","removeRestrictionsForAuthenticatedUser"]}],setRestrictionsForAuthenticatedUser:["PUT /user/interaction-limits"],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits"],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits"],setRestrictionsForYourPublicRepos:["PUT /user/interaction-limits",{},{renamed:["interactions","setRestrictionsForAuthenticatedUser"]}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addBlockedByDependency:["POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],addSubIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],checkUserCanBeAssignedToIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],getParent:["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listDependenciesBlockedBy:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],listDependenciesBlocking:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],listSubIssues:["GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeDependencyBlockedBy:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],removeSubIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"],reprioritizeSubIssue:["PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"],getAllVersions:["GET /versions"],getOctocat:["GET /octocat"],getZen:["GET /zen"],root:["GET /"]},migrations:{deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive"],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive"],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive"],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive"],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}"],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}"],listForAuthenticatedUser:["GET /user/migrations"],listForOrg:["GET /orgs/{org}/migrations"],listReposForAuthenticatedUser:["GET /user/migrations/{migration_id}/repositories"],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories"],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{},{renamed:["migrations","listReposForAuthenticatedUser"]}],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"]},oidc:{getOidcCustomSubTemplateForOrg:["GET /orgs/{org}/actions/oidc/customization/sub"],updateOidcCustomSubTemplateForOrg:["PUT /orgs/{org}/actions/oidc/customization/sub"]},orgs:{addSecurityManagerTeam:["PUT /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team"}],assignTeamToOrgRole:["PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],assignUserToOrgRole:["PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"],blockUser:["PUT /orgs/{org}/blocks/{username}"],cancelInvitation:["DELETE /orgs/{org}/invitations/{invitation_id}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createArtifactStorageRecord:["POST /orgs/{org}/artifacts/metadata/storage-record"],createInvitation:["POST /orgs/{org}/invitations"],createIssueType:["POST /orgs/{org}/issue-types"],createWebhook:["POST /orgs/{org}/hooks"],customPropertiesForOrgsCreateOrUpdateOrganizationValues:["PATCH /organizations/{org}/org-properties/values"],customPropertiesForOrgsGetOrganizationValues:["GET /organizations/{org}/org-properties/values"],customPropertiesForReposCreateOrUpdateOrganizationDefinition:["PUT /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposCreateOrUpdateOrganizationDefinitions:["PATCH /orgs/{org}/properties/schema"],customPropertiesForReposCreateOrUpdateOrganizationValues:["PATCH /orgs/{org}/properties/values"],customPropertiesForReposDeleteOrganizationDefinition:["DELETE /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinition:["GET /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinitions:["GET /orgs/{org}/properties/schema"],customPropertiesForReposGetOrganizationValues:["GET /orgs/{org}/properties/values"],delete:["DELETE /orgs/{org}"],deleteAttestationsBulk:["POST /orgs/{org}/attestations/delete-request"],deleteAttestationsById:["DELETE /orgs/{org}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /orgs/{org}/attestations/digest/{subject_digest}"],deleteIssueType:["DELETE /orgs/{org}/issue-types/{issue_type_id}"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],disableSelectedRepositoryImmutableReleasesOrganization:["DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],enableSelectedRepositoryImmutableReleasesOrganization:["PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],get:["GET /orgs/{org}"],getImmutableReleasesSettings:["GET /orgs/{org}/settings/immutable-releases"],getImmutableReleasesSettingsRepositories:["GET /orgs/{org}/settings/immutable-releases/repositories"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getOrgRole:["GET /orgs/{org}/organization-roles/{role_id}"],getOrgRulesetHistory:["GET /orgs/{org}/rulesets/{ruleset_id}/history"],getOrgRulesetVersion:["GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],getWebhookConfigForOrg:["GET /orgs/{org}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations"],listArtifactStorageRecords:["GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records"],listAttestationRepositories:["GET /orgs/{org}/attestations/repositories"],listAttestations:["GET /orgs/{org}/attestations/{subject_digest}"],listAttestationsBulk:["POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}"],listBlockedUsers:["GET /orgs/{org}/blocks"],listFailedInvitations:["GET /orgs/{org}/failed_invitations"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listIssueTypes:["GET /orgs/{org}/issue-types"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOrgRoleTeams:["GET /orgs/{org}/organization-roles/{role_id}/teams"],listOrgRoleUsers:["GET /orgs/{org}/organization-roles/{role_id}/users"],listOrgRoles:["GET /orgs/{org}/organization-roles"],listOrganizationFineGrainedPermissions:["GET /orgs/{org}/organization-fine-grained-permissions"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPatGrantRepositories:["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"],listPatGrantRequestRepositories:["GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"],listPatGrantRequests:["GET /orgs/{org}/personal-access-token-requests"],listPatGrants:["GET /orgs/{org}/personal-access-tokens"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listSecurityManagerTeams:["GET /orgs/{org}/security-managers",{},{deprecated:"octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams"}],listWebhookDeliveries:["GET /orgs/{org}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /orgs/{org}/hooks"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],removeSecurityManagerTeam:["DELETE /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team"}],reviewPatGrantRequest:["POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"],reviewPatGrantRequestsInBulk:["POST /orgs/{org}/personal-access-token-requests"],revokeAllOrgRolesTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}"],revokeAllOrgRolesUser:["DELETE /orgs/{org}/organization-roles/users/{username}"],revokeOrgRoleTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],revokeOrgRoleUser:["DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"],setImmutableReleasesSettings:["PUT /orgs/{org}/settings/immutable-releases"],setImmutableReleasesSettingsRepositories:["PUT /orgs/{org}/settings/immutable-releases/repositories"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateIssueType:["PUT /orgs/{org}/issue-types/{issue_type_id}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updatePatAccess:["POST /orgs/{org}/personal-access-tokens/{pat_id}"],updatePatAccesses:["POST /orgs/{org}/personal-access-tokens"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"],updateWebhookConfigForOrg:["PATCH /orgs/{org}/hooks/{hook_id}/config"]},packages:{deletePackageForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}"],deletePackageForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}"],deletePackageForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}"],deletePackageVersionForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getAllPackageVersionsForAPackageOwnedByAnOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByOrg"]}],getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]}],getAllPackageVersionsForPackageOwnedByAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions"],getPackageForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}"],getPackageForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}"],getPackageForUser:["GET /users/{username}/packages/{package_type}/{package_name}"],getPackageVersionForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],listDockerMigrationConflictingPackagesForAuthenticatedUser:["GET /user/docker/conflicts"],listDockerMigrationConflictingPackagesForOrganization:["GET /orgs/{org}/docker/conflicts"],listDockerMigrationConflictingPackagesForUser:["GET /users/{username}/docker/conflicts"],listPackagesForAuthenticatedUser:["GET /user/packages"],listPackagesForOrganization:["GET /orgs/{org}/packages"],listPackagesForUser:["GET /users/{username}/packages"],restorePackageForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForUser:["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageVersionForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForUser:["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]},privateRegistries:{createOrgPrivateRegistry:["POST /orgs/{org}/private-registries"],deleteOrgPrivateRegistry:["DELETE /orgs/{org}/private-registries/{secret_name}"],getOrgPrivateRegistry:["GET /orgs/{org}/private-registries/{secret_name}"],getOrgPublicKey:["GET /orgs/{org}/private-registries/public-key"],listOrgPrivateRegistries:["GET /orgs/{org}/private-registries"],updateOrgPrivateRegistry:["PATCH /orgs/{org}/private-registries/{secret_name}"]},projects:{addItemForOrg:["POST /orgs/{org}/projectsV2/{project_number}/items"],addItemForUser:["POST /users/{username}/projectsV2/{project_number}/items"],deleteItemForOrg:["DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],deleteItemForUser:["DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}"],getFieldForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}"],getFieldForUser:["GET /users/{username}/projectsV2/{project_number}/fields/{field_id}"],getForOrg:["GET /orgs/{org}/projectsV2/{project_number}"],getForUser:["GET /users/{username}/projectsV2/{project_number}"],getOrgItem:["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],getUserItem:["GET /users/{username}/projectsV2/{project_number}/items/{item_id}"],listFieldsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields"],listFieldsForUser:["GET /users/{username}/projectsV2/{project_number}/fields"],listForOrg:["GET /orgs/{org}/projectsV2"],listForUser:["GET /users/{username}/projectsV2"],listItemsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/items"],listItemsForUser:["GET /users/{username}/projectsV2/{project_number}/items"],updateItemForOrg:["PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],updateItemForUser:["PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}"]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],createForRelease:["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"],deleteForRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],listForRelease:["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}",{},{renamed:["repos","acceptInvitationForAuthenticatedUser"]}],acceptInvitationForAuthenticatedUser:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],cancelPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"],checkAutomatedSecurityFixes:["GET /repos/{owner}/{repo}/automated-security-fixes"],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkImmutableReleases:["GET /repos/{owner}/{repo}/immutable-releases"],checkPrivateVulnerabilityReporting:["GET /repos/{owner}/{repo}/private-vulnerability-reporting"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts"],codeownersErrors:["GET /repos/{owner}/{repo}/codeowners/errors"],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],compareCommitsWithBasehead:["GET /repos/{owner}/{repo}/compare/{basehead}"],createAttestation:["POST /repos/{owner}/{repo}/attestations"],createAutolink:["POST /repos/{owner}/{repo}/autolinks"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentBranchPolicy:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],createDeploymentProtectionRule:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateEnvironment:["PUT /repos/{owner}/{repo}/environments/{environment_name}"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createOrgRuleset:["POST /orgs/{org}/rulesets"],createPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments"],createPagesSite:["POST /repos/{owner}/{repo}/pages"],createRelease:["POST /repos/{owner}/{repo}/releases"],createRepoRuleset:["POST /repos/{owner}/{repo}/rulesets"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate"],createWebhook:["POST /repos/{owner}/{repo}/hooks"],customPropertiesForReposCreateOrUpdateRepositoryValues:["PATCH /repos/{owner}/{repo}/properties/values"],customPropertiesForReposGetRepositoryValues:["GET /repos/{owner}/{repo}/properties/values"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}",{},{renamed:["repos","declineInvitationForAuthenticatedUser"]}],declineInvitationForAuthenticatedUser:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteAnEnvironment:["DELETE /repos/{owner}/{repo}/environments/{environment_name}"],deleteAutolink:["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteDeploymentBranchPolicy:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deleteOrgRuleset:["DELETE /orgs/{org}/rulesets/{ruleset_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages"],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteRepoRuleset:["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes"],disableDeploymentProtectionRule:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],disableImmutableReleases:["DELETE /repos/{owner}/{repo}/immutable-releases"],disablePrivateVulnerabilityReporting:["DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts"],downloadArchive:["GET /repos/{owner}/{repo}/zipball/{ref}",{},{renamed:["repos","downloadZipballArchive"]}],downloadTarballArchive:["GET /repos/{owner}/{repo}/tarball/{ref}"],downloadZipballArchive:["GET /repos/{owner}/{repo}/zipball/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes"],enableImmutableReleases:["PUT /repos/{owner}/{repo}/immutable-releases"],enablePrivateVulnerabilityReporting:["PUT /repos/{owner}/{repo}/private-vulnerability-reporting"],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts"],generateReleaseNotes:["POST /repos/{owner}/{repo}/releases/generate-notes"],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllDeploymentProtectionRules:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],getAllEnvironments:["GET /repos/{owner}/{repo}/environments"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics"],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getAutolink:["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getBranchRules:["GET /repos/{owner}/{repo}/rules/branches/{branch}"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile"],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getCustomDeploymentProtectionRule:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentBranchPolicy:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getEnvironment:["GET /repos/{owner}/{repo}/environments/{environment_name}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getOrgRuleSuite:["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],getOrgRuleSuites:["GET /orgs/{org}/rulesets/rule-suites"],getOrgRuleset:["GET /orgs/{org}/rulesets/{ruleset_id}"],getOrgRulesets:["GET /orgs/{org}/rulesets"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getPagesDeployment:["GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"],getPagesHealthCheck:["GET /repos/{owner}/{repo}/pages/health"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getReadmeInDirectory:["GET /repos/{owner}/{repo}/readme/{dir}"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getRepoRuleSuite:["GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"],getRepoRuleSuites:["GET /repos/{owner}/{repo}/rulesets/rule-suites"],getRepoRuleset:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],getRepoRulesetHistory:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history"],getRepoRulesetVersion:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}"],getRepoRulesets:["GET /repos/{owner}/{repo}/rulesets"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],getWebhookConfigForRepo:["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"],listActivities:["GET /repos/{owner}/{repo}/activity"],listAttestations:["GET /repos/{owner}/{repo}/attestations/{subject_digest}"],listAutolinks:["GET /repos/{owner}/{repo}/autolinks"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listCustomDeploymentRuleIntegrations:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentBranchPolicies:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhookDeliveries:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],mergeUpstream:["POST /repos/{owner}/{repo}/merge-upstream"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],renameBranch:["POST /repos/{owner}/{repo}/branches/{branch}/rename"],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics"],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateDeploymentBranchPolicy:["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updateOrgRuleset:["PUT /orgs/{org}/rulesets/{ruleset_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateRepoRuleset:["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",{},{renamed:["repos","updateStatusCheckProtection"]}],updateStatusCheckProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],updateWebhookConfigForRepo:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits"],issuesAndPullRequests:["GET /search/issues"],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics"],users:["GET /search/users"]},secretScanning:{createPushProtectionBypass:["POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses"],getAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],getScanHistory:["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],listAlertsForOrg:["GET /orgs/{org}/secret-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/secret-scanning/alerts"],listLocationsForAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"],listOrgPatternConfigs:["GET /orgs/{org}/secret-scanning/pattern-configurations"],updateAlert:["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],updateOrgPatternConfigs:["PATCH /orgs/{org}/secret-scanning/pattern-configurations"]},securityAdvisories:{createFork:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"],createPrivateVulnerabilityReport:["POST /repos/{owner}/{repo}/security-advisories/reports"],createRepositoryAdvisory:["POST /repos/{owner}/{repo}/security-advisories"],createRepositoryAdvisoryCveRequest:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"],getGlobalAdvisory:["GET /advisories/{ghsa_id}"],getRepositoryAdvisory:["GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"],listGlobalAdvisories:["GET /advisories"],listOrgRepositoryAdvisories:["GET /orgs/{org}/security-advisories"],listRepositoryAdvisories:["GET /repos/{owner}/{repo}/security-advisories"],updateRepositoryAdvisory:["PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails",{},{renamed:["users","addEmailForAuthenticatedUser"]}],addEmailForAuthenticatedUser:["POST /user/emails"],addSocialAccountForAuthenticatedUser:["POST /user/social_accounts"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys",{},{renamed:["users","createGpgKeyForAuthenticatedUser"]}],createGpgKeyForAuthenticatedUser:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys",{},{renamed:["users","createPublicSshKeyForAuthenticatedUser"]}],createPublicSshKeyForAuthenticatedUser:["POST /user/keys"],createSshSigningKeyForAuthenticatedUser:["POST /user/ssh_signing_keys"],deleteAttestationsBulk:["POST /users/{username}/attestations/delete-request"],deleteAttestationsById:["DELETE /users/{username}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /users/{username}/attestations/digest/{subject_digest}"],deleteEmailForAuthenticated:["DELETE /user/emails",{},{renamed:["users","deleteEmailForAuthenticatedUser"]}],deleteEmailForAuthenticatedUser:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","deleteGpgKeyForAuthenticatedUser"]}],deleteGpgKeyForAuthenticatedUser:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}",{},{renamed:["users","deletePublicSshKeyForAuthenticatedUser"]}],deletePublicSshKeyForAuthenticatedUser:["DELETE /user/keys/{key_id}"],deleteSocialAccountForAuthenticatedUser:["DELETE /user/social_accounts"],deleteSshSigningKeyForAuthenticatedUser:["DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getById:["GET /user/{account_id}"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","getGpgKeyForAuthenticatedUser"]}],getGpgKeyForAuthenticatedUser:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}",{},{renamed:["users","getPublicSshKeyForAuthenticatedUser"]}],getPublicSshKeyForAuthenticatedUser:["GET /user/keys/{key_id}"],getSshSigningKeyForAuthenticatedUser:["GET /user/ssh_signing_keys/{ssh_signing_key_id}"],list:["GET /users"],listAttestations:["GET /users/{username}/attestations/{subject_digest}"],listAttestationsBulk:["POST /users/{username}/attestations/bulk-list{?per_page,before,after}"],listBlockedByAuthenticated:["GET /user/blocks",{},{renamed:["users","listBlockedByAuthenticatedUser"]}],listBlockedByAuthenticatedUser:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails",{},{renamed:["users","listEmailsForAuthenticatedUser"]}],listEmailsForAuthenticatedUser:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following",{},{renamed:["users","listFollowedByAuthenticatedUser"]}],listFollowedByAuthenticatedUser:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys",{},{renamed:["users","listGpgKeysForAuthenticatedUser"]}],listGpgKeysForAuthenticatedUser:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails",{},{renamed:["users","listPublicEmailsForAuthenticatedUser"]}],listPublicEmailsForAuthenticatedUser:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys",{},{renamed:["users","listPublicSshKeysForAuthenticatedUser"]}],listPublicSshKeysForAuthenticatedUser:["GET /user/keys"],listSocialAccountsForAuthenticatedUser:["GET /user/social_accounts"],listSocialAccountsForUser:["GET /users/{username}/social_accounts"],listSshSigningKeysForAuthenticatedUser:["GET /user/ssh_signing_keys"],listSshSigningKeysForUser:["GET /users/{username}/ssh_signing_keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility",{},{renamed:["users","setPrimaryEmailVisibilityForAuthenticatedUser"]}],setPrimaryEmailVisibilityForAuthenticatedUser:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}},o1n=o$o;var rJ=new Map;for(let[t,e]of Object.entries(o1n))for(let[r,n]of Object.entries(e)){let[o,s,c]=n,[l,u]=o.split(/ /),d=Object.assign({method:l,url:u},s);rJ.has(t)||rJ.set(t,new Map),rJ.get(t).set(r,{scope:t,methodName:r,endpointDefaults:d,decorations:c})}var s$o={has({scope:t},e){return rJ.get(t).has(e)},getOwnPropertyDescriptor(t,e){return{value:this.get(t,e),configurable:!0,writable:!0,enumerable:!0}},defineProperty(t,e,r){return Object.defineProperty(t.cache,e,r),!0},deleteProperty(t,e){return delete t.cache[e],!0},ownKeys({scope:t}){return[...rJ.get(t).keys()]},set(t,e,r){return t.cache[e]=r},get({octokit:t,scope:e,cache:r},n){if(r[n])return r[n];let o=rJ.get(e).get(n);if(!o)return;let{endpointDefaults:s,decorations:c}=o;return c?r[n]=a$o(t,e,n,s,c):r[n]=t.request.defaults(s),r[n]}};function hjt(t){let e={};for(let r of rJ.keys())e[r]=new Proxy({octokit:t,scope:r,cache:{}},s$o);return e}a(hjt,"endpointsToMethods");function a$o(t,e,r,n,o){let s=t.request.defaults(n);function c(...l){let u=s.endpoint.merge(...l);if(o.mapToData)return u=Object.assign({},u,{data:u[o.mapToData],[o.mapToData]:void 0}),s(u);if(o.renamed){let[d,f]=o.renamed;t.log.warn(`octokit.${e}.${r}() has been renamed to octokit.${d}.${f}()`)}if(o.deprecated&&t.log.warn(o.deprecated),o.renamedParameters){let d=s.endpoint.merge(...l);for(let[f,h]of Object.entries(o.renamedParameters))f in d&&(t.log.warn(`"${f}" parameter is deprecated for "octokit.${e}.${r}()". Use "${h}" instead`),h in d||(d[h]=d[f]),delete d[f]);return s(d)}return s(...l)}return a(c,"withDecorations"),Object.assign(c,s)}a(a$o,"decorate");function c$o(t){return{rest:hjt(t)}}a(c$o,"restEndpointMethods");c$o.VERSION=pjt;function mjt(t){let e=hjt(t);return{...e,rest:e}}a(mjt,"legacyRestEndpointMethods");mjt.VERSION=pjt;p();var s1n="22.0.1";var a1n=kJe.plugin(ujt,mjt,fjt).defaults({userAgent:`octokit-rest.js/${s1n}`});var u$o=new Set(["copilot-pull-request-reviewer","copilot-swe-agent","Copilot"]),yc=new pe("GitHubClient"),nm=class{constructor(e){this.ctx=e;this.octokit=null}static{a(this,"GitHubClient")}async getOctokit(){if(this.octokit)return this.octokit;let e=await this.getApiSession(),r=this.ctx.get(nr);return this.octokit=new a1n({auth:e.accessToken,baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.octokit}async getCopilotTimelineEvents(e,r,n,o){if(!o||!u$o.has(o))return yc.debug(this.ctx,`Skipping timeline events for ${e}/${r}#${n}: author '${o}' is not a Copilot account`),[];yc.debug(this.ctx,`Fetching Copilot timeline events for ${e}/${r}#${n}`);let s=await this.getOctokit();try{let c=[],l=1,u=!0;for(;u;){yc.debug(this.ctx,`Fetching timeline events page ${l} for ${e}/${r}#${n}`);let d=await s.rest.issues.listEventsForTimeline({owner:e,repo:r,issue_number:n,per_page:100,page:l});for(let h of d.data){let m=h;m.created_at&&m.node_id&&(h.event==="copilot_work_started"?c.push({id:m.node_id,eventType:"in_progress",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}):h.event==="copilot_work_finished"?c.push({id:m.node_id,eventType:"done",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}):h.event==="copilot_work_finished_failure"&&c.push({id:m.node_id,eventType:"error",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}))}let f=d.headers.link;u=f?f.includes('rel="next"'):!1,l++}return yc.debug(this.ctx,`Found ${c.length} Copilot timeline events for ${e}/${r}#${n}`),c}catch(c){if(yc.error(this.ctx,`Failed to fetch Copilot timeline events for ${e}/${r}#${n}:`,c),c&&typeof c=="object"&&"status"in c){let l=c;throw new od(l.status,l.message||"GitHub API error")}throw c}}async getCopilotWorkingStatus(e,r,n,o){yc.debug(this.ctx,`Getting Copilot working status for ${e}/${r}#${n}`);try{let s=await this.getCopilotTimelineEvents(e,r,n,o),c;if(s.length>0){let l=s[s.length-1];l.eventType==="done"?c="done":l.eventType==="in_progress"?c="in_progress":l.eventType==="error"?c="error":c="not_copilot_issue"}else c="not_copilot_issue";return yc.debug(this.ctx,`Copilot working status for ${e}/${r}#${n}: ${c}`),c}catch(s){return yc.error(this.ctx,`Error getting Copilot working status for ${e}/${r}#${n}, treating as not Copilot issue:`,s),"not_copilot_issue"}}async cancelWorkflow(e,r,n){yc.debug(this.ctx,`Cancelling workflow run ${n} for ${e}/${r}`);let o=await this.getOctokit();try{return await o.rest.actions.cancelWorkflowRun({owner:e,repo:r,run_id:n}),yc.debug(this.ctx,`Successfully cancelled workflow run ${n} for ${e}/${r}`),!0}catch(s){if(yc.error(this.ctx,`Failed to cancel workflow run ${n} for ${e}/${r}:`,s),s&&typeof s=="object"&&"status"in s){let c=s;throw new od(c.status,c.message||"GitHub API error")}throw s}}async listPullRequestFiles(e,r,n){yc.debug(this.ctx,`Listing files for pull request ${e}/${r}#${n}`);let o=await this.getOctokit();try{let s=[],c=1,l=!0;for(;l;){yc.debug(this.ctx,`Fetching pull request files page ${c} for ${e}/${r}#${n}`);let u=await o.rest.pulls.listFiles({owner:e,repo:r,pull_number:n,per_page:100,page:c});for(let f of u.data)s.push({fileName:f.filename});let d=u.headers.link;l=d?d.includes('rel="next"'):!1,c++}return yc.debug(this.ctx,`Found ${s.length} files in pull request ${e}/${r}#${n}`),s}catch(s){if(yc.error(this.ctx,`Failed to list files for pull request ${e}/${r}#${n}:`,s),s&&typeof s=="object"&&"status"in s){let c=s;throw new od(c.status,c.message||"GitHub API error")}throw s}}async getBranch(e,r,n){yc.debug(this.ctx,`Getting branch ${n} from ${e}/${r}`);let o=await this.getOctokit();try{let s=await o.rest.repos.getBranch({owner:e,repo:r,branch:n});return yc.debug(this.ctx,`Successfully retrieved branch ${n} from ${e}/${r}`),s.data}catch(s){if(s&&typeof s=="object"&&"status"in s){let c=s;throw yc.debug(this.ctx,`GitHub API error getting branch ${n}: HTTP ${c.status} - ${c.message}`),new od(c.status,c.message||"GitHub API error")}throw yc.error(this.ctx,`Unexpected error getting branch ${n} for ${e}/${r}:`,s),s}}async getPullRequest(e,r,n){yc.debug(this.ctx,`Getting pull request ${e}/${r}#${n}`);let o=await this.getOctokit();try{let s=await o.rest.pulls.get({owner:e,repo:r,pull_number:n});return yc.debug(this.ctx,`Successfully retrieved pull request ${e}/${r}#${n}`),{id:s.data.id,html_url:s.data.html_url,number:s.data.number,title:s.data.title,user:s.data.user?{login:s.data.user.login}:void 0,draft:s.data.draft,body:s.data.body||void 0,repository:{owner:{login:s.data.base.repo.owner.login},name:s.data.base.repo.name},updated_at:s.data.updated_at}}catch(s){if(s&&typeof s=="object"&&"status"in s){let c=s;throw yc.debug(this.ctx,`GitHub API error getting pull request #${n}: HTTP ${c.status} - ${c.message}`),new od(c.status,c.message||"GitHub API error")}throw yc.error(this.ctx,`Unexpected error getting pull request ${e}/${r}#${n}:`,s),s}}async addPullRequestComment(e,r,n,o){yc.debug(this.ctx,`Adding comment to pull request ${e}/${r}#${n}`);let s=await this.getOctokit();try{let c=await s.rest.issues.createComment({owner:e,repo:r,issue_number:n,body:o});return yc.debug(this.ctx,`Successfully added comment to ${e}/${r}#${n}`),{html_url:c.data.html_url}}catch(c){if(c&&typeof c=="object"&&"status"in c){let l=c;throw yc.debug(this.ctx,`GitHub API error adding comment to #${n}: HTTP ${l.status} - ${l.message}`),new od(l.status,l.message||"GitHub API error")}throw yc.error(this.ctx,`Unexpected error adding comment to pull request ${e}/${r}#${n}:`,c),c}}async listSecurityAdvisories(e,r,n=100){yc.debug(this.ctx,`Listing security advisories for ${r.length} ${e} packages`);let o=await this.getOctokit();try{let s=[],c=1,l=!0;for(;l;){yc.debug(this.ctx,`Fetching security advisories page ${c} for ${r.length} ${e} packages`);let u=await o.securityAdvisories.listGlobalAdvisories({ecosystem:e,affects:r,direction:"asc",sort:"published",per_page:n,page:c});s.push(...u.data);let d=u.headers.link;l=d?d.includes('rel="next"'):!1,c++}return yc.debug(this.ctx,`Found ${s.length} security advisories for ${r.length} ${e} packages`),s}catch(s){if(yc.error(this.ctx,"Failed to list security advisories:",s),s&&typeof s=="object"&&"status"in s){let c=s;throw yc.debug(this.ctx,`GitHub API error listing security advisories for ${r.length} ${e} packages: HTTP ${c.status} - ${c.message}`),new od(c.status,c.message||"GitHub API error")}throw s}}async getApiSession(){let e=await this.ctx.get(Mr).resolveSession();if(!e)throw new mE;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var Va=new pe("CodingAgentClient"),VC=class{constructor(e,r){this.ctx=e;this.timeout=r??3e4}static{a(this,"CodingAgentClient")}getBaseUrl(){return"https://api.githubcopilot.com"}async createCodingTask(e,r,n,o,s,c){Va.debug(this.ctx,`Creating coding agent task for ${n}/${o} with title: ${e}`),this.validateCreateTaskParams(e,r,n,o);let l=await this.getAccessToken(),d=`${this.getBaseUrl()}/agents/swe/${ejt}/jobs/${n}/${o}`,f={problem_statement:r,event_type:"jetbrains",pull_request:{title:e,body_placeholder:Ebn(e),...s&&{base_ref:s}}},h={Authorization:`Bearer ${l}`,"Content-Type":"application/json",Accept:"application/json",...Vh(this.ctx)};if(c?.isCancellationRequested)throw Va.debug(this.ctx,`Create coding task was cancelled before sending API request for ${n}/${o} with title: ${e}`),new mg;let g=await this.ctx.get(nr).fetch(d,{method:"POST",headers:h,body:JSON.stringify(f),timeout:this.timeout});if(c?.isCancellationRequested)throw Va.debug(this.ctx,`Create coding task was cancelled after sending API request for ${n}/${o} with title: ${e}`),new mg;let A=await this.handleCreateJobResponse(g);if(c?.isCancellationRequested)throw Va.debug(this.ctx,`Create coding task was cancelled after receiving job response for ${n}/${o} with title: ${e}`),new mg;let y=await this.waitForJobPullRequest(n,o,A.job_id,l,c);if(c?.isCancellationRequested)throw Va.debug(this.ctx,`Create coding task was cancelled after polling job ${A.job_id} for ${n}/${o}`),new mg;let E=y.pull_request?.number;if(typeof E!="number")throw new rm("No valid pull request number returned from job");let v=await new nm(this.ctx).getPullRequest(n,o,E);return Va.debug(this.ctx,`Coding task created successfully for ${n}/${o}: job ${A.job_id}, session ${A.session_id}, PR #${v.number}`),{pullRequest:v,sessionId:A.session_id}}validateCreateTaskParams(e,r,n,o){if(!e?.trim())throw Va.debug(this.ctx,"Validation failed: Title is required and cannot be empty"),new lp("Title is required and cannot be empty");if(!r?.trim())throw Va.debug(this.ctx,"Validation failed: ProblemStatement is required and cannot be empty"),new lp("ProblemStatement is required and cannot be empty");if(!n?.trim())throw Va.debug(this.ctx,"Validation failed: Owner is required and cannot be empty"),new lp("Owner is required and cannot be empty");if(!o?.trim())throw Va.debug(this.ctx,"Validation failed: Repository name is required and cannot be empty"),new lp("Repository name is required and cannot be empty");Va.debug(this.ctx,`Validation passed for ${n}/${o}`)}async getAccessToken(){let r=await this.ctx.get(Mr).resolveSession();if(!r?.accessToken)throw Va.debug(this.ctx,"Failed to get access token"),new lw("Failed to call cloud agent API: Not authenticated with GitHub");return r.accessToken}async fetchWithCancellation(e,r,n){let o=new AbortController,s=n?.onCancellationRequested(()=>o.abort());try{return await this.ctx.get(nr).fetch(e,{timeout:this.timeout,signal:o.signal,...r})}finally{s?.dispose()}}async getAllSessions(e,r){Va.debug(this.ctx,`Getting all coding agent sessions for pull request ID: ${e}`);let n=await this.getAccessToken(),o=this.getBaseUrl();if(r?.isCancellationRequested)throw Va.debug(this.ctx,`Get all sessions operation was cancelled before sending API request for pull request ID: ${e}`),new mg;try{let s=`${o}/agents/sessions/resource/pull/${e}`,c={Authorization:`Bearer ${n}`,Accept:"application/json",...Vh(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw Va.debug(this.ctx,`Get all sessions operation was cancelled after sending API request for pull request ID: ${e}`),new mg;if(!l.ok){let d=await l.text().catch(()=>l.statusText),f=`Failed to get cloud agent sessions: HTTP ${l.status} - ${d}`;throw Va.error(this.ctx,f),new rm(f)}let u=await l.json();return Va.debug(this.ctx,`Found ${u.sessions?.length||0} coding agent sessions for pull request ID: ${e}`),u.sessions||null}catch(s){if(s instanceof cw)throw s;let c=`Failed to get cloud agent sessions: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw Va.error(this.ctx,c),new Cue(c)}}async getRepoSessions(e,r){Va.debug(this.ctx,`Getting all coding agent sessions for repo: ${e}`);let n=await this.getAccessToken(),o=this.getBaseUrl(),s=20,c=[],l=1;try{for(;;){if(r?.isCancellationRequested)throw new mg;let u=`${o}/agents/sessions?page_size=${s}&page_number=${l}&resource_state=draft,open&repo_nwo=${e}`,d={Authorization:`Bearer ${n}`,Accept:"application/json",...Vh(this.ctx)},f=await this.fetchWithCancellation(u,{method:"GET",headers:d},r);if(r?.isCancellationRequested)throw Va.debug(this.ctx,`Get repo sessions operation was cancelled after sending API request for repo: ${e}`),new mg;if(!f.ok){let g=await f.text().catch(()=>f.statusText),A=`Failed to get repo cloud agent sessions: HTTP ${f.status} - ${g}`;throw Va.error(this.ctx,A),new rm(A)}let m=(await f.json()).sessions??[];if(c.push(...m),m.lengthl.statusText),d=`Failed to get cloud agent session logs: HTTP ${l.status} - ${u}`;throw Va.error(this.ctx,d),new rm(d)}return await l.text()}catch(s){if(s instanceof cw)throw s;let c=`Failed to get cloud agent session logs: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw Va.error(this.ctx,c),new Cue(c)}}async waitForJobPullRequest(e,r,n,o,s){let c=Date.now(),l=3e4,u=2e3;for(;Date.now()-csetTimeout(r,e))}async handleCreateJobResponse(e){if(!e.ok){let n=await e.text().catch(()=>e.statusText);throw Va.error(this.ctx,`Cloud agent API request failed with status ${e.status}: ${n}`),e.status===403||e.status===401?new rm("Cloud agent is not enabled or you do not have access. Learn more about cloud agent at https://docs.github.com/copilot/concepts/agents/cloud-agent/about-cloud-agent"):new rm(`API request failed: HTTP ${e.status} - ${n}`)}let r;try{r=await e.json()}catch(n){let o=n instanceof Error?n.message:JSON.stringify(n);throw Va.error(this.ctx,`Failed to parse create coding task API response as JSON: ${o}`),new rm(`Failed to parse API response as JSON: ${o}`)}if(!r.job_id||!r.session_id)throw Va.error(this.ctx,"API response missing job_id or session_id",r),new rm("Invalid response from cloud agent");return r}};p();p();var MO=class{static{a(this,"LSPRequestSender")}};var c1n=fe(ei());var PJe=class{constructor(){this.codingAgentMessageRequestType=new c1n.ProtocolRequestType("copilot/codingAgentMessage")}static{a(this,"CodingAgentMessageHandler")}async sendCodingAgentMessage(e,r,n,o){try{ot.debug(e.ctx,`Sending coding agent message to client: ${r} - ${o}`);let c=await e.ctx.get(MO).sendRequest(this.codingAgentMessageRequestType,{title:r,description:n,prLink:o,conversationId:e.conversation.id.toString(),turnId:e.turn.id.toString()});return ot.debug(e.ctx,"Successfully sent coding agent message to client"),c}catch(s){let c=`Failed to send coding agent message: ${s instanceof Error?s.message:JSON.stringify(s)}`;return ot.error(e.ctx,c,s),{success:!1,error:c}}}};p();p();p();p();var WC=fe(Io());function gjt(t){return{isCancellationRequested:t.isCancellationRequested,onCancellationRequested:a(e=>{let r=t.onCancellationRequested(e);return{dispose:a(()=>r.dispose(),"dispose")}},"onCancellationRequested")}}a(gjt,"adaptCancellationToken");function l1n(t){return{report:a(e=>{"value"in e&&typeof e.value=="string"?t({text:e.value}):t({})},"report")}}a(l1n,"adaptProgressCallback");function u1n(t){return{modelMaxPromptTokens:t.maxRequestTokens}}a(u1n,"createEndpointInfo");function d1n(t){let e={role:d$o(t.role),content:f$o(t.content)};if(t.role===WC.Raw.ChatRole.Assistant&&"toolCalls"in t&&t.toolCalls&&(e.tool_calls=t.toolCalls.map(r=>({id:r.id,type:r.type,function:r.function,approxNumTokens:0}))),t.role===WC.Raw.ChatRole.Tool&&"toolCallId"in t&&t.toolCallId&&(e.tool_call_id=t.toolCallId),Array.isArray(t.content)){let r=!1;for(let n of t.content){if(n.type===WC.Raw.ChatCompletionContentPartKind.Opaque&&n.value){let o=CKe(n);o&&(e.thinking=o);let s=vKe(n);s&&(e.phase=s)}n.type===WC.Raw.ChatCompletionContentPartKind.CacheBreakpoint&&(r=!0)}r&&(e.copilot_cache_control={type:"ephemeral"})}return Object.entries(t).forEach(([r,n])=>{["role","content","toolCalls","toolCallId"].includes(r)||(e[r]=n)}),e}a(d1n,"convertToCopilotChatMessage");function d$o(t){switch(t){case WC.Raw.ChatRole.System:return"system";case WC.Raw.ChatRole.User:return"user";case WC.Raw.ChatRole.Assistant:return"assistant";case WC.Raw.ChatRole.Tool:return"tool";default:return"user"}}a(d$o,"convertRole");function f$o(t){if(typeof t=="string")return t;if(Array.isArray(t)){let e=t.filter(r=>r.type===WC.Raw.ChatCompletionContentPartKind.Text||r.type===WC.Raw.ChatCompletionContentPartKind.Image);return e.length===1&&e[0].type===WC.Raw.ChatCompletionContentPartKind.Text?e[0].text:e.length===0?"":e.map(r=>r.type===WC.Raw.ChatCompletionContentPartKind.Text?{type:"text",text:r.text}:r.type===WC.Raw.ChatCompletionContentPartKind.Image?{type:"image_url",image_url:r.imageUrl}:{type:"text",text:""})}return String(t)}a(f$o,"convertContent");p();var Z3=fe(Io());var DJe=class extends Z3.PromptRenderer{constructor(r,n,o,s,c){super(o,r,n,s);this.options=c;this._promptTsxRemovedNodeCount=0}static{a(this,"InternalPromptRenderer")}get promptTsxRemovedNodeCount(){return this._promptTsxRemovedNodeCount}async renderWithOptions(r,n,o){this._promptTsxRemovedNodeCount=0,this.tracer={didMaterializeTree:a(l=>{this._promptTsxRemovedNodeCount=l.renderedTree.removed},"didMaterializeTree")};let s=await super.render(r,n);return{...this.options,...o}.collapseSystemMessages&&this.collapseConsecutiveSystemMessages(s.messages),s}collapseConsecutiveSystemMessages(r){let n=[],o=null;for(let s of r)if(s.role===Z3.Raw.ChatRole.System&&o?.role===Z3.Raw.ChatRole.System){let c=o.content.at(-1),l=s.content.at(0);c&&l&&c.type===Z3.Raw.ChatCompletionContentPartKind.Text&&l.type===Z3.Raw.ChatCompletionContentPartKind.Text?(c.text=c.text.trimEnd()+` +`+l.text,o.content=o.content.concat(s.content.slice(1))):(o.content.push({type:Z3.Raw.ChatCompletionContentPartKind.Text,text:` +`}),o.content=o.content.concat(s.content))}else n.push(s),o=s.role===Z3.Raw.ChatRole.System?s:null;r.length=0,r.push(...n)}};p();p();function f1n(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(A$o(e)){case"image/png":return p$o(e);case"image/gif":return h$o(e);case"image/jpeg":case"image/jpg":return m$o(e);case"image/webp":return g$o(e);default:throw new Error("Unsupported image format")}}a(f1n,"getImageDimensions");function p$o(t){let e=atob(t.slice(0,50)).slice(16,24),r=Uint8Array.from(e,o=>o.charCodeAt(0)),n=new DataView(r.buffer);return{width:n.getUint32(0,!1),height:n.getUint32(4,!1)}}a(p$o,"getPngDimensions");function h$o(t){let e=atob(t.slice(0,50)),r=Uint8Array.from(e,o=>o.charCodeAt(0)),n=new DataView(r.buffer);return{width:n.getUint16(6,!0),height:n.getUint16(8,!0)}}a(h$o,"getGifDimensions");function m$o(t){let e=atob(t),r=Uint8Array.from(e,s=>s.charCodeAt(0)),n=r.length,o=2;for(;o=65472&&s<=65474){let l=new DataView(r.buffer,o+5,4);return{height:l.getUint16(0,!1),width:l.getUint16(2,!1)}}o+=2+c}throw new Error("JPEG dimensions not found")}a(m$o,"getJpegDimensions");function g$o(t){let e=atob(t),r=new Uint8Array(e.length);for(let o=0;o2048||o>2048){let l=2048/Math.max(n,o);n=Math.round(n*l),o=Math.round(o*l)}let s=768/Math.min(n,o);return n=Math.round(n*s),o=Math.round(o*s),Math.ceil(n/512)*Math.ceil(o/512)*170+85}};function NJe(t){let e=ws(t.tokenizer);return new Ajt(e,t)}a(NJe,"createPromptTsxTokenizer");function _$o(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(_$o,"estimateDocumentTokenCost");var up=class t{static{a(this,"TsxPromptRenderer")}constructor(e,r,n,o={}){this._options=o;let s=u1n(n),c=NJe(n);this._internalRenderer=new DJe(e,r,s,c,o)}static create(e,r,n,o={}){return new t(e,r,n,o)}async renderPrompt(e,r,n){let o=e?l1n(e):void 0,s=r?gjt(r):void 0,c=await this._internalRenderer.renderWithOptions(o,s,n);return{...this._options,...n}.enableCacheBreakpoints?Pvn(c.messages):Dvn(c.messages),{messages:c.messages.map(d1n),tokenCount:c.tokenCount,hasIgnoredFiles:c.hasIgnoredFiles,promptTsxRemovedNodeCount:this._internalRenderer.promptTsxRemovedNodeCount}}async countTokens(e){let r=e?gjt(e):void 0;return(await this._internalRenderer.renderWithOptions(void 0,r)).tokenCount}};async function yjt(t,e,r,n,o,s){return await up.create(t,e,r,s).renderPrompt(n,o,s)}a(yjt,"renderTsxPrompt");p();p();p();var p1n=new pe("toolCallRoundsBuilder");function OO(t,e={}){let r=[],{ctx:n,identifier:o,enableWarnings:s=!1}=e,c=0;for(;c0){let u=new Set(l.tool_calls.map(m=>m.id)),d=[],f=c+1,h=!1;for(;f0){let u=r[r.length-1];u.followUpUserMessage||(u.followUpUserMessage=l)}c++}}return r}a(OO,"buildAssistantRounds");p();var J_=fe(Io());var swe=new pe("toolCalling"),uw=class extends lr{static{a(this,"ChatAssistantRounds")}renderCopilot(){if(!this.props.assistantRounds||this.props.assistantRounds.length===0)return vscpp(vscppf,null);let e=this.props.assistantRounds.length,r=this.props.assistantRounds.flatMap((o,s)=>this.renderOneAssistantRound(o,s,e));if(r.length===0)return vscpp(vscppf,null);let n=(0,J_.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},r))}renderOneAssistantRound(e,r,n){let o=e.assistantMessage;if(o.role!=="assistant")return swe.warn(this.props.ctx,`Tool call round ${r} does not have a valid assistant message`),[];let s=o.modelId!==void 0&&this.props.modelConfiguration?.modelId===o.modelId,c=s&&o.thinking?vscpp(mue,{thinking:o.thinking}):vscpp(vscppf,null),l=o.phase&&s?vscpp(_Ke,{phase:o.phase}):vscpp(vscppf,null);if(!o.tool_calls||o.tool_calls.length===0){let A=this.getMessageContent(o),y=s&&!!o.thinking,E=!!e.followUpUserMessage,_=[];if((A&&A.trim().length>0||y||E)&&_.push(vscpp(J_.AssistantMessage,null,vscpp(vscppf,null,A),c,l)),e.followUpUserMessage){let v=this.getMessageContent(e.followUpUserMessage);v&&_.push(vscpp(J_.UserMessage,null,vscpp(vscppf,null,v)))}return _}let u=new Set;for(let A of e.toolResults)A.role==="tool"&&A.tool_call_id&&u.add(A.tool_call_id);let d=o.tool_calls.filter(A=>A.id&&u.has(A.id));if(d.length===0){let A=this.props.isHistorical?"conversation history":`turn ${this.props.identifier||"unknown"}`;swe.warn(this.props.ctx,`Tool call round ${r} has ${o.tool_calls.length} tool call(s) but none have corresponding results in ${A}. Rendering assistant message content only.`);let y=this.getMessageContent(o);if(!y||y.trim().length===0){if(e.followUpUserMessage){let _=this.getMessageContent(e.followUpUserMessage);if(_)return[vscpp(J_.AssistantMessage,null,vscpp(vscppf,null,""),c,l),vscpp(J_.UserMessage,null,vscpp(vscppf,null,_))]}return[]}let E=[vscpp(J_.AssistantMessage,null,vscpp(vscppf,null,y),c,l)];if(e.followUpUserMessage){let _=this.getMessageContent(e.followUpUserMessage);_&&E.push(vscpp(J_.UserMessage,null,vscpp(vscppf,null,_)))}return E}if(d.length{let y=(0,J_.useKeepWith)();return f.set(A.id,y),{type:"function",function:{name:A.function.name,arguments:typeof A.function.arguments=="string"?A.function.arguments:JSON.stringify(A.function.arguments)},id:A.id,keepWith:y}}),m=[];m.push(vscpp(J_.AssistantMessage,{toolCalls:h},vscpp(vscppf,null,this.getMessageContent(o)),c,l));let g=1/(n*4)/d.length;for(let A=0;AT.tool_call_id===y.id);if(!_){let T=this.props.isHistorical?"conversation history":`turn ${this.props.identifier||"unknown"}`;swe.warn(this.props.ctx,`No tool result found for tool call ID ${y.id} in ${T}`);continue}let v=this.getMessageContent(_);this.props.truncateAt&&(v=this.truncateContent(v,this.props.truncateAt));let b=E;m.push(vscpp(b,{priority:r,flexGrow:r+1,flexReserve:`/${1/g}`},vscpp(J_.ToolMessage,{toolCallId:y.id},vscpp(vscppf,null,v))))}if(e.followUpUserMessage){let A=this.getMessageContent(e.followUpUserMessage);A&&m.push(vscpp(J_.UserMessage,null,vscpp(vscppf,null,A)))}return m}getMessageContent(e){return typeof e.content=="string"?e.content:Array.isArray(e.content)?e.content.map(r=>r.type==="text"?r.text:"").filter(r=>r.length>0).join(` +`):JSON.stringify(e.content)}truncateContent(e,r){let n=this.props.modelConfiguration;if(!n||e.lengthn.type==="image_url"),r=t.filter(n=>n.type==="text").map(n=>n.text).join("");return{imageUrls:e,textContent:r}}a(gHo,"separateTextAndImages");function AHo(t){return t.map(e=>vscpp(Xh.Image,{src:e.image_url.url,detail:e.image_url.detail}))}a(AHo,"createImageElements");function sJe(t){let{imageUrls:e,textContent:r}=gHo(t);return e.length===0?[vscpp(vscppf,null,r)]:[vscpp(Xh.TextChunk,null,vscpp(vscppf,null,r)),...AHo(e)]}a(sJe,"renderMixedContent");function xqt(t){return t==null?[]:t.map(r=>({id:r.id||"",type:"function",function:{name:r.function.name,arguments:typeof r.function.arguments=="string"?r.function.arguments:JSON.stringify(r.function.arguments)},approxNumTokens:r.approxNumTokens}))}a(xqt,"convertToPromptTsxToolCall");function aJe(t){switch(t.role){case"assistant":return yHo(t);case"tool":return EHo(t);case"user":return _Ho(t);case"system":return vHo(t);case"function":throw new Error("ChatRole.Function is not supported in prompt-tsx conversion. Use ChatRole.Tool instead.");default:throw new Error(`Unsupported chat role: ${String(t.role)}`)}}a(aJe,"convertChatMessageToPromptTsx");function yHo(t){let e=t.thinking?vscpp(oue,{thinking:t.thinking}):vscpp(vscppf,null);return typeof t.content=="string"?vscpp(Xh.AssistantMessage,{toolCalls:xqt(t.tool_calls)},vscpp(vscppf,null,t.content),e):Array.isArray(t.content)?vscpp(Xh.AssistantMessage,{toolCalls:xqt(t.tool_calls)},vscpp(vscppf,null,sJe(t.content)),e):vscpp(Xh.AssistantMessage,{toolCalls:xqt(t.tool_calls)},vscpp(vscppf,null,JSON.stringify(t.content)),e)}a(yHo,"renderAssistantMessage");function EHo(t){return typeof t.content=="string"?vscpp(Xh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Xh.ToolMessage,{toolCallId:t.tool_call_id||""},sJe(t.content)):vscpp(Xh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,JSON.stringify(t.content)))}a(EHo,"renderToolMessage");function _Ho(t){return typeof t.content=="string"?vscpp(Xh.UserMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Xh.UserMessage,null,sJe(t.content)):vscpp(Xh.UserMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(_Ho,"renderUserMessage");function vHo(t){return typeof t.content=="string"?vscpp(Xh.SystemMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Xh.SystemMessage,null,sJe(t.content)):vscpp(Xh.SystemMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(vHo,"renderSystemMessage");var CHo=new fe("conversationHistoryPrompt"),Aue=class extends lr{static{a(this,"ConversationHistoryPrompt")}fixToolCallsInResponse(e,r){if(e.tool_calls&&e.tool_calls.length){let n=e.tool_calls,o=[];for(let s of n)r.some(l=>l.role==="tool"&&l.tool_call_id===s.id)?o.push(s):CHo.warn(this.props.ctx,`Tool call ${s.id} does not have a result in the response. Removing it from the tool calls history.`);return{...e,tool_calls:o}}return e}renderCopilot(){return vscpp(vscppf,null,this.renderHistory())}renderHistory(){let e=[];for(let r=0;rthis.fixToolCallsInResponse(l,o)),c=RO(s,{ctx:this.props.ctx,identifier:"conversation history",enableWarnings:!0});c.length>0&&e.push(vscpp(rw,{assistantRounds:c,ctx:this.props.ctx,isHistorical:!0,identifier:"conversation-history",modelConfiguration:this.props.modelConfiguration}))}}return e}};var lJe=de(Io());var cJe=class extends lr{static{a(this,"SummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(lJe.SystemMessage,null,"You are an expert at summarizing chat conversations.",vscpp("br",null),vscpp("br",null),"You will be provided:",vscpp("br",null),vscpp("br",null),"- A series of user/assistant message pairs in chronological order",vscpp("br",null),"- A final user message indicating the user's intent.",vscpp("br",null),vscpp("br",null),"Your task is to:",vscpp("br",null),vscpp("br",null),"- Create a detailed summary of the conversation that captures the user's intent and key information.",vscpp("br",null),vscpp("br",null),"Keep in mind:",vscpp("br",null),vscpp("br",null),"- The user is iterating on a feature specification, bug fix, or other common programming task.",vscpp("br",null),"- There may be relevant code snippets or files referenced in the conversation.",vscpp("br",null),"- The user is collaborating with the assistant to refine their ideas and solutions, course-correcting the assistant as needed.",vscpp("br",null),"- The user will provide feedback on the assistant's suggestions and may request changes or improvements.",vscpp("br",null),"- Disregard messages that the user has indicated are incorrect, irrelevant, or unhelpful.",vscpp("br",null),"- Preserve relevant and actionable context and key information.",vscpp("br",null),"- If the conversation is long or discusses several tasks, keep the summary focused on the task indicated by the user's intent.",vscpp("br",null),"- Always prefer decisions in later messages over earlier ones.",vscpp("br",null),vscpp("br",null),"Structure your summary using the following format:",vscpp("br",null),vscpp("br",null),"TITLE: A brief title for the summary",vscpp("br",null),"USER INTENT: The user's goal or intent for the conversation",vscpp("br",null),"TASK DESCRIPTION: Main technical goals and user requirements",vscpp("br",null),"EXISTING: What has already been accomplished. Include file paths and other direct references.",vscpp("br",null),"PENDING: What still needs to be done. Include file paths and other direct references.",vscpp("br",null),"CODE STATE: A list of all files discussed or modified. Provide code snippets or diffs that illustrate important context.",vscpp("br",null),"RELEVANT CODE/DOCUMENTATION SNIPPETS: Key code or documentation snippets from referenced files or discussions.",vscpp("br",null),"OTHER NOTES: Any additional context or information that may be relevant."),vscpp(Aue,{priority:1,ctx:this.props.ctx,historyTurns:this.props.conversationTurns}),vscpp(lJe.UserMessage,null,vscpp(vscppf,null,"Here is the conversation to summarize above. Please provide a detailed summary following the specified format.")))}};function FCn(t){let e={title:"",userIntent:""},r=t.match(/\*{0,2}TITLE:\*{0,2}\s*(.+?)(?=\*{2}[A-Z]|\n|$)/);r&&(e.title=r[1].trim());let n=t.match(/\*{0,2}USER INTENT:\*{0,2}\s*(.+?)(?=\*{2}[A-Z]|\n|$)/);return n&&(e.userIntent=n[1].trim()),e}a(FCn,"parseStructuredSummary");var uJe=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"ChatMLConversationSummarizer")}async provideSummary(e,r,n){try{let o=e.turns.filter(m=>m.status==="success"&&m.request?.message&&m.response?.message),s=e.turns.length>0?e.turns[e.turns.length-1]:null,c=s&&s.request?.message?[...o,s]:o;if(c.length===0)return ot.debug(this.ctx,"No turns to summarize"),"";let l=n.modelProviderName&&n.userRequestedModelIdOrEmpty?await hO(this.ctx,n.modelProviderName,n.userRequestedModelIdOrEmpty):await xo.getModelConfigurationById(this.ctx,n.userRequestedModelIdOrEmpty,e.id.toString(),iq(c));xo.applyModelConfigurationOverrides(this.ctx,l,n.modelInfo);let f={messages:(await ap.create(cJe,{ctx:this.ctx,conversationTurns:c},l).renderPrompt(void 0,r)).messages,uiKind:n.uiKind,llmInteraction:n.llmInteraction,modelConfiguration:l,turnId:n.turnId},h=await this.chatFetcher.fetchResponse(f,r,n.telemetryWithExp,void 0);if(r.isCancellationRequested)return ot.debug(this.ctx,"Summarization cancelled"),"";if(h.type==="success"){let m=h.value.trim();return m.match(/^".*"$/)&&(m=m.slice(1,-1)),ot.debug(this.ctx,`Successfully generated conversation summary of length ${m.length}`),m}else{let m="reason"in h?h.reason:"unknown";return ot.error(this.ctx,`Failed to fetch conversation summary because of response type (${h.type}) and reason (${m})`),""}}catch(o){return ot.exception(this.ctx,o,"Error generating conversation summary"),""}}};p();var jxe=new fe("repository"),$3=class t{static{a(this,"GitBranchData")}constructor(e,r=!1){this.currentBranch=e,this.isDetachedHead=r}static detachedHead(){return new t(void 0,!0)}static branch(e){return new t(e,!1)}},nw=class{static{a(this,"GitBranchLoader")}},kO=class extends nw{constructor(r){super();this.loaders=r}static{a(this,"GitFallbackBranchLoader")}async getBranchInfo(r,n){for(let o of this.loaders){let s=await o.getBranchInfo(r,n);if(s)return s}}};p();var UCn=require("child_process");var PO=class extends nw{static{a(this,"GitCLIBranchLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,UCn.execFile)(r,n,{cwd:e},(c,l)=>{c?s(c):o(l)})})}async tryRunCommand(e,r,n,o){try{return await this.runCommand(r,n,o)}catch(s){jxe.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getBranchInfo(e,r){let n=rs(r);if(n===void 0)return;let o;try{o=(await lO()).path}catch(c){jxe.info(e,`Skipping git branch lookup: ${c.message}`);return}let s=await this.tryRunCommand(e,n,o,["-c","safe.directory=*","branch","--show-current",...this.extraArgs()]);if(s!==void 0){let c=s.trim();return c?$3.branch(c):$3.detachedHead()}}extraArgs(){return[]}};p();var DO=class extends nw{static{a(this,"GitParsingBranchLoader")}async getBranchInfo(e,r){try{let n=e.get(Qo),o=wa(r,".git","HEAD"),s=await n.readFileString(o);return this.parseHeadContent(s.trim())}catch(n){let o=typeof r=="string"?r:r.uri;jxe.info(e,`Failed to parse git HEAD file in ${o}:`,n);return}}parseHeadContent(e){if(e.startsWith("ref: refs/heads/")){let r=e.substring(16);return $3.branch(r)}else return this.isCommitSha(e)?$3.detachedHead():$3.detachedHead()}isCommitSha(e){return/^[a-f0-9]{40}$/i.test(e)}};var Tq=new fe("codingAgentTurnProcessor"),dJe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new oc(e.ctx),this.turnSuggestions=new bq(e.ctx,this.chatFetcher),this.codingAgentClient=new HC(e.ctx),this.gitHubClient=new Zh(e.ctx),this.codingAgentMessageHandler=new nJe,this.conversationSummarizer=new uJe(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn}static{a(this,"CodingAgentTurnProcessor")}async process(e,r,n,o,s){try{let c=await tl(this.turnContext.ctx,this.turnContext,{languageId:o?.detectedLanguageId??""});await this.processWithCodingAgent(e,r,this.turnContext,c,n,o,s)}catch(c){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,c),qa(this.turnContext.ctx,c,"codingAgent");let l=c instanceof Error?c.message:JSON.stringify(c);this.turn.status="error",this.updateTurnResponseWithError(l),await this.endProgress({error:{message:l,code:ZQ.Unknown,responseIsIncomplete:!0}})}finally{tYe(this.turnContext.ctx).catch(()=>{})}}async processWithCodingAgent(e,r,n,o,s,c,l){await this.conversationProgress.begin(this.conversation,this.turn,e),r.onCancellationRequested(async()=>{Tq.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});try{let u;if(this.turnContext.turn.workspaceFolders&&this.turnContext.turn.workspaceFolders.length>0?u=this.turnContext.turn.workspaceFolders[0]:u=this.turnContext.turn.workspaceFolder,!u)throw new sp("No workspace folder available for git repository detection");let f=await new _f(this.turnContext.ctx).getRepo(u);if(!f||!f.isGitHub())throw new sp("No GitHub repository found in the workspace folder");if(!f.owner||!f.name)throw new sp("Could not determine repository owner and name");let h={owner:f.owner,name:f.name},g=await new kO([new PO,new DO]).getBranchInfo(this.turnContext.ctx,u),A;if(g?.currentBranch&&!g.isDetachedHead){A=g.currentBranch,Tq.debug(this.turnContext.ctx,`Found current branch: ${A}`);try{await this.gitHubClient.getBranch(h.owner,h.name,A),Tq.debug(this.turnContext.ctx,`Branch ${A} exists remotely`)}catch(N){if(N instanceof Fd&&N.status===404){let L=`Base branch "${A}" does not exist remotely in ${h.owner}/${h.name}. Please push the branch to the remote repository before creating a cloud agent job.`;throw await this.conversationProgress.report(this.conversation,this.turn,{reply:`${L} +`,u=Math.round(c*(r-Math.floor(l.length/c))),d=Math.round(u*.4),f=u-d;return e.slice(0,d)+l+e.slice(-f)}};p();var im=fe(Io());function v$o(t){let e=t.filter(n=>n.type==="image_url"),r=t.filter(n=>n.type==="text").map(n=>n.text).join("");return{imageUrls:e,textContent:r}}a(v$o,"separateTextAndImages");function C$o(t){return t.map(e=>vscpp(im.Image,{src:e.image_url.url,detail:e.image_url.detail}))}a(C$o,"createImageElements");function MJe(t){let{imageUrls:e,textContent:r}=v$o(t);return e.length===0?[vscpp(vscppf,null,r)]:[vscpp(im.TextChunk,null,vscpp(vscppf,null,r)),...C$o(e)]}a(MJe,"renderMixedContent");function Ejt(t){return t==null?[]:t.map(r=>({id:r.id||"",type:"function",function:{name:r.function.name,arguments:typeof r.function.arguments=="string"?r.function.arguments:JSON.stringify(r.function.arguments)},approxNumTokens:r.approxNumTokens}))}a(Ejt,"convertToPromptTsxToolCall");function OJe(t){switch(t.role){case"assistant":return b$o(t);case"tool":return S$o(t);case"user":return T$o(t);case"system":return I$o(t);case"function":throw new Error("ChatRole.Function is not supported in prompt-tsx conversion. Use ChatRole.Tool instead.");default:throw new Error(`Unsupported chat role: ${String(t.role)}`)}}a(OJe,"convertChatMessageToPromptTsx");function b$o(t){let e=t.thinking?vscpp(mue,{thinking:t.thinking}):vscpp(vscppf,null);return typeof t.content=="string"?vscpp(im.AssistantMessage,{toolCalls:Ejt(t.tool_calls)},vscpp(vscppf,null,t.content),e):Array.isArray(t.content)?vscpp(im.AssistantMessage,{toolCalls:Ejt(t.tool_calls)},vscpp(vscppf,null,MJe(t.content)),e):vscpp(im.AssistantMessage,{toolCalls:Ejt(t.tool_calls)},vscpp(vscppf,null,JSON.stringify(t.content)),e)}a(b$o,"renderAssistantMessage");function S$o(t){return typeof t.content=="string"?vscpp(im.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(im.ToolMessage,{toolCallId:t.tool_call_id||""},MJe(t.content)):vscpp(im.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,JSON.stringify(t.content)))}a(S$o,"renderToolMessage");function T$o(t){return typeof t.content=="string"?vscpp(im.UserMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(im.UserMessage,null,MJe(t.content)):vscpp(im.UserMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(T$o,"renderUserMessage");function I$o(t){return typeof t.content=="string"?vscpp(im.SystemMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(im.SystemMessage,null,MJe(t.content)):vscpp(im.SystemMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(I$o,"renderSystemMessage");var x$o=new pe("conversationHistoryPrompt"),wue=class extends lr{static{a(this,"ConversationHistoryPrompt")}fixToolCallsInResponse(e,r){if(e.tool_calls&&e.tool_calls.length){let n=e.tool_calls,o=[];for(let s of n)r.some(l=>l.role==="tool"&&l.tool_call_id===s.id)?o.push(s):x$o.warn(this.props.ctx,`Tool call ${s.id} does not have a result in the response. Removing it from the tool calls history.`);return{...e,tool_calls:o}}return e}renderCopilot(){return vscpp(vscppf,null,this.renderHistory())}renderHistory(){let e=[];for(let r=0;rthis.fixToolCallsInResponse(l,o)),c=OO(s,{ctx:this.props.ctx,identifier:"conversation history",enableWarnings:!0});c.length>0&&e.push(vscpp(uw,{assistantRounds:c,ctx:this.props.ctx,isHistorical:!0,identifier:"conversation-history",modelConfiguration:this.props.modelConfiguration}))}}return e}};var BJe=fe(Io());var LJe=class extends lr{static{a(this,"SummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(BJe.SystemMessage,null,"You are an expert at summarizing chat conversations.",vscpp("br",null),vscpp("br",null),"You will be provided:",vscpp("br",null),vscpp("br",null),"- A series of user/assistant message pairs in chronological order",vscpp("br",null),"- A final user message indicating the user's intent.",vscpp("br",null),vscpp("br",null),"Your task is to:",vscpp("br",null),vscpp("br",null),"- Create a detailed summary of the conversation that captures the user's intent and key information.",vscpp("br",null),vscpp("br",null),"Keep in mind:",vscpp("br",null),vscpp("br",null),"- The user is iterating on a feature specification, bug fix, or other common programming task.",vscpp("br",null),"- There may be relevant code snippets or files referenced in the conversation.",vscpp("br",null),"- The user is collaborating with the assistant to refine their ideas and solutions, course-correcting the assistant as needed.",vscpp("br",null),"- The user will provide feedback on the assistant's suggestions and may request changes or improvements.",vscpp("br",null),"- Disregard messages that the user has indicated are incorrect, irrelevant, or unhelpful.",vscpp("br",null),"- Preserve relevant and actionable context and key information.",vscpp("br",null),"- If the conversation is long or discusses several tasks, keep the summary focused on the task indicated by the user's intent.",vscpp("br",null),"- Always prefer decisions in later messages over earlier ones.",vscpp("br",null),vscpp("br",null),"Structure your summary using the following format:",vscpp("br",null),vscpp("br",null),"TITLE: A brief title for the summary",vscpp("br",null),"USER INTENT: The user's goal or intent for the conversation",vscpp("br",null),"TASK DESCRIPTION: Main technical goals and user requirements",vscpp("br",null),"EXISTING: What has already been accomplished. Include file paths and other direct references.",vscpp("br",null),"PENDING: What still needs to be done. Include file paths and other direct references.",vscpp("br",null),"CODE STATE: A list of all files discussed or modified. Provide code snippets or diffs that illustrate important context.",vscpp("br",null),"RELEVANT CODE/DOCUMENTATION SNIPPETS: Key code or documentation snippets from referenced files or discussions.",vscpp("br",null),"OTHER NOTES: Any additional context or information that may be relevant."),vscpp(wue,{priority:1,ctx:this.props.ctx,historyTurns:this.props.conversationTurns}),vscpp(BJe.UserMessage,null,vscpp(vscppf,null,"Here is the conversation to summarize above. Please provide a detailed summary following the specified format.")))}};function h1n(t){let e={title:"",userIntent:""},r=t.match(/\*{0,2}TITLE:\*{0,2}\s*(.+?)(?=\*{2}[A-Z]|\n|$)/);r&&(e.title=r[1].trim());let n=t.match(/\*{0,2}USER INTENT:\*{0,2}\s*(.+?)(?=\*{2}[A-Z]|\n|$)/);return n&&(e.userIntent=n[1].trim()),e}a(h1n,"parseStructuredSummary");var FJe=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"ChatMLConversationSummarizer")}async provideSummary(e,r,n){try{let o=e.turns.filter(m=>m.status==="success"&&m.request?.message&&m.response?.message),s=e.turns.length>0?e.turns[e.turns.length-1]:null,c=s&&s.request?.message?[...o,s]:o;if(c.length===0)return ot.debug(this.ctx,"No turns to summarize"),"";let l=n.modelProviderName&&n.userRequestedModelIdOrEmpty?await _O(this.ctx,n.modelProviderName,n.userRequestedModelIdOrEmpty):await xo.getModelConfigurationById(this.ctx,n.userRequestedModelIdOrEmpty,e.id.toString(),Aq(c));xo.applyModelConfigurationOverrides(this.ctx,l,n.modelInfo);let f={messages:(await up.create(LJe,{ctx:this.ctx,conversationTurns:c},l).renderPrompt(void 0,r)).messages,uiKind:n.uiKind,llmInteraction:n.llmInteraction,modelConfiguration:l,turnId:n.turnId},h=await this.chatFetcher.fetchResponse(f,r,n.telemetryWithExp,void 0);if(r.isCancellationRequested)return ot.debug(this.ctx,"Summarization cancelled"),"";if(h.type==="success"){let m=h.value.trim();return m.match(/^".*"$/)&&(m=m.slice(1,-1)),ot.debug(this.ctx,`Successfully generated conversation summary of length ${m.length}`),m}else{let m="reason"in h?h.reason:"unknown";return ot.error(this.ctx,`Failed to fetch conversation summary because of response type (${h.type}) and reason (${m})`),""}}catch(o){return ot.exception(this.ctx,o,"Error generating conversation summary"),""}}};p();var awe=new pe("repository"),X3=class t{static{a(this,"GitBranchData")}constructor(e,r=!1){this.currentBranch=e,this.isDetachedHead=r}static detachedHead(){return new t(void 0,!0)}static branch(e){return new t(e,!1)}},dw=class{static{a(this,"GitBranchLoader")}},LO=class extends dw{constructor(r){super();this.loaders=r}static{a(this,"GitFallbackBranchLoader")}async getBranchInfo(r,n){for(let o of this.loaders){let s=await o.getBranchInfo(r,n);if(s)return s}}};p();var m1n=require("child_process");var BO=class extends dw{static{a(this,"GitCLIBranchLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,m1n.execFile)(r,n,{cwd:e},(c,l)=>{c?s(c):o(l)})})}async tryRunCommand(e,r,n,o){try{return await this.runCommand(r,n,o)}catch(s){awe.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getBranchInfo(e,r){let n=Us(r);if(n===void 0)return;let o;try{o=(await mO()).path}catch(c){awe.info(e,`Skipping git branch lookup: ${c.message}`);return}let s=await this.tryRunCommand(e,n,o,["-c","safe.directory=*","branch","--show-current",...this.extraArgs()]);if(s!==void 0){let c=s.trim();return c?X3.branch(c):X3.detachedHead()}}extraArgs(){return[]}};p();var FO=class extends dw{static{a(this,"GitParsingBranchLoader")}async getBranchInfo(e,r){try{let n=e.get(Qo),o=wa(r,".git","HEAD"),s=await n.readFileString(o);return this.parseHeadContent(s.trim())}catch(n){let o=typeof r=="string"?r:r.uri;awe.info(e,`Failed to parse git HEAD file in ${o}:`,n);return}}parseHeadContent(e){if(e.startsWith("ref: refs/heads/")){let r=e.substring(16);return X3.branch(r)}else return this.isCommitSha(e)?X3.detachedHead():X3.detachedHead()}isCommitSha(e){return/^[a-f0-9]{40}$/i.test(e)}};var Fq=new pe("codingAgentTurnProcessor"),UJe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(wc),this.chatFetcher=this.chatFetcher??new cc(e.ctx),this.turnSuggestions=new Lq(e.ctx,this.chatFetcher),this.codingAgentClient=new VC(e.ctx),this.gitHubClient=new nm(e.ctx),this.codingAgentMessageHandler=new PJe,this.conversationSummarizer=new FJe(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn}static{a(this,"CodingAgentTurnProcessor")}async process(e,r,n,o,s){try{let c=await rl(this.turnContext.ctx,this.turnContext,{languageId:o?.detectedLanguageId??""});await this.processWithCodingAgent(e,r,this.turnContext,c,n,o,s)}catch(c){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,c),xa(this.turnContext.ctx,c,"codingAgent");let l=c instanceof Error?c.message:JSON.stringify(c);this.turn.status="error",this.updateTurnResponseWithError(l),await this.endProgress({error:{message:l,code:uq.Unknown,responseIsIncomplete:!0}})}finally{wYe(this.turnContext.ctx).catch(()=>{})}}async processWithCodingAgent(e,r,n,o,s,c,l){await this.conversationProgress.begin(this.conversation,this.turn,e),r.onCancellationRequested(async()=>{Fq.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});try{let u;if(this.turnContext.turn.workspaceFolders&&this.turnContext.turn.workspaceFolders.length>0?u=this.turnContext.turn.workspaceFolders[0]:u=this.turnContext.turn.workspaceFolder,!u)throw new lp("No workspace folder available for git repository detection");let f=await new Tf(this.turnContext.ctx).getRepo(u);if(!f||!f.isGitHub())throw new lp("No GitHub repository found in the workspace folder");if(!f.owner||!f.name)throw new lp("Could not determine repository owner and name");let h={owner:f.owner,name:f.name},g=await new LO([new BO,new FO]).getBranchInfo(this.turnContext.ctx,u),A;if(g?.currentBranch&&!g.isDetachedHead){A=g.currentBranch,Fq.debug(this.turnContext.ctx,`Found current branch: ${A}`);try{await this.gitHubClient.getBranch(h.owner,h.name,A),Fq.debug(this.turnContext.ctx,`Branch ${A} exists remotely`)}catch(N){if(N instanceof od&&N.status===404){let L=`Base branch "${A}" does not exist remotely in ${h.owner}/${h.name}. Please push the branch to the remote repository before creating a cloud agent job.`;throw await this.conversationProgress.report(this.conversation,this.turn,{reply:`${L} -`}),Tq.error(this.turnContext.ctx,L),new sp(L)}throw N}}else throw new sp("No current branch found or detached HEAD state");if(r.isCancellationRequested)return;let y=Pn(this.turn.request.message),E=Gvn(this.turnContext.ctx,this.turn.request.references,this.turn.request.activeEditor),_=$vn(E);Tq.debug(this.turnContext.ctx,`Extracted ${E.length} context file paths (${_.length} characters formatted)`);let v="",b=hue(y);if(this.conversation.turns.length>1){await this.conversationProgress.report(this.conversation,this.turn,{reply:`Analyzing chat history... +`}),Fq.error(this.turnContext.ctx,L),new lp(L)}throw N}}else throw new lp("No current branch found or detached HEAD state");if(r.isCancellationRequested)return;let y=Pn(this.turn.request.message),E=_bn(this.turnContext.ctx,this.turn.request.references,this.turn.request.activeEditor),_=vbn(E);Fq.debug(this.turnContext.ctx,`Extracted ${E.length} context file paths (${_.length} characters formatted)`);let v="",b=Tue(y);if(this.conversation.turns.length>1){await this.conversationProgress.report(this.conversation,this.turn,{reply:`Analyzing chat history... `});let{structuredSummary:N,rawSummary:L}=await this.summarizeConversation(r,o,l);if(r.isCancellationRequested)return;N&&N.title&&(b=N.title),v=L||""}let T=_;v&&(T=_+(_?` -`:"")+v);let{problemStatement:w}=jvn(this.turnContext.ctx,y,T||void 0);await this.conversationProgress.report(this.conversation,this.turn,{reply:`Delegating to cloud agent... +`:"")+v);let{problemStatement:w}=ybn(this.turnContext.ctx,y,T||void 0);await this.conversationProgress.report(this.conversation,this.turn,{reply:`Delegating to cloud agent... -`});let R=await this.codingAgentClient.createCodingTask(b,w,h.owner,h.name,A,r);if(r.isCancellationRequested)return;try{await this.codingAgentMessageHandler.sendCodingAgentMessage(this.turnContext,R.pullRequest.title,R.pullRequest.body||"",R.pullRequest.html_url)}catch(N){Tq.warn(this.turnContext.ctx,"Failed to send coding agent message to client",N)}let x="Your work will be continued in this pull request:";await this.conversationProgress.report(this.conversation,this.turn,{reply:x}),this.turn.response={message:x,type:"model"},this.turn.status="success";let P={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let N=await this.fetchSuggestedTitle(r,o.extendedBy({messageSource:"chat.user"},{}));typeof N=="string"&&N!==""&&(P.suggestedTitle=N)}let D=o.extendedBy({modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});Et(this.turnContext.ctx,"codingAgent",D),ZI(this.turnContext.ctx,"codingAgent",D),await this.endProgress(P)}catch(u){if(n7e(this.turnContext.ctx,"codingAgent",u,o),u instanceof Oc)Tq.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,u),qa(this.turnContext.ctx,u,"codingAgent"),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(u instanceof $P)qa(this.turnContext.ctx,u,"codingAgent"),this.turn.status="error",this.updateTurnResponseWithError(u.message),await this.endProgress({error:{message:u.message,code:ZQ.Default,responseIsIncomplete:!0}});else throw Tq.error(this.turnContext.ctx,`Error in processing turn ${this.turn.id}`,u),u}}async summarizeConversation(e,r,n){let o=await this.conversationSummarizer.provideSummary(this.conversation,e,{userRequestedModelIdOrEmpty:n?.id||"",modelProviderName:n?.providerName||"",modelInfo:n||void 0,llmInteraction:this.turnContext.toLlmInteraction(),uiKind:this.strategy.uiKind,telemetryWithExp:r,turnId:String(this.turn.id)});if(!o)return{structuredSummary:null,rawSummary:null};let s=FCn(o);return ot.debug(this.turnContext.ctx,`Generated conversation summary - Title: ${s.title}, Intent: ${s.userIntent}`),{structuredSummary:s,rawSummary:o}}async fetchSuggestedTitle(e,r){let n=await this.turnSuggestions.fetchRawSuggestions(this.turnContext,e,this.strategy.uiKind,r);if(n)return ot.debug(this.turnContext.ctx,"Computed suggested title",n.suggestedTitle),n.suggestedTitle}updateTurnResponseWithError(e){this.turn.response?.message?this.turn.response.message=oq(this.turn.response?.message,{role:"assistant",content:e}):this.turn.response={message:e,type:"meta"}}async endProgress(e){await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}};p();p();var QCn="```",Hxe=String.raw``,bHo=String.raw`${QCn}[\w]*?\n(?[\s\S]*?)\n${QCn}`,SHo=new RegExp(Hxe+` -`+bHo,"gs"),wqt=["replace","delete"];function Rqt(t,e){let r=t.matchAll(SHo),n=Array.from(r),o=[];for(let s of n){let c=s.groups;if(!c||!wqt.includes(c.mode))continue;let l=c.start?parseInt(c.start)-1:-1,u=c.end?parseInt(c.end)-1:l,f=c.codeblock.split(` +`});let R=await this.codingAgentClient.createCodingTask(b,w,h.owner,h.name,A,r);if(r.isCancellationRequested)return;try{await this.codingAgentMessageHandler.sendCodingAgentMessage(this.turnContext,R.pullRequest.title,R.pullRequest.body||"",R.pullRequest.html_url)}catch(N){Fq.warn(this.turnContext.ctx,"Failed to send coding agent message to client",N)}let x="Your work will be continued in this pull request:";await this.conversationProgress.report(this.conversation,this.turn,{reply:x}),this.turn.response={message:x,type:"model"},this.turn.status="success";let P={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let N=await this.fetchSuggestedTitle(r,o.extendedBy({messageSource:"chat.user"},{}));typeof N=="string"&&N!==""&&(P.suggestedTitle=N)}let D=o.extendedBy({modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});ft(this.turnContext.ctx,"codingAgent",D),ox(this.turnContext.ctx,"codingAgent",D),await this.endProgress(P)}catch(u){if(R7e(this.turnContext.ctx,"codingAgent",u,o),u instanceof Uc)Fq.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,u),xa(this.turnContext.ctx,u,"codingAgent"),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(u instanceof cw)xa(this.turnContext.ctx,u,"codingAgent"),this.turn.status="error",this.updateTurnResponseWithError(u.message),await this.endProgress({error:{message:u.message,code:uq.Default,responseIsIncomplete:!0}});else throw Fq.error(this.turnContext.ctx,`Error in processing turn ${this.turn.id}`,u),u}}async summarizeConversation(e,r,n){let o=await this.conversationSummarizer.provideSummary(this.conversation,e,{userRequestedModelIdOrEmpty:n?.id||"",modelProviderName:n?.providerName||"",modelInfo:n||void 0,llmInteraction:this.turnContext.toLlmInteraction(),uiKind:this.strategy.uiKind,telemetryWithExp:r,turnId:String(this.turn.id)});if(!o)return{structuredSummary:null,rawSummary:null};let s=h1n(o);return ot.debug(this.turnContext.ctx,`Generated conversation summary - Title: ${s.title}, Intent: ${s.userIntent}`),{structuredSummary:s,rawSummary:o}}async fetchSuggestedTitle(e,r){let n=await this.turnSuggestions.fetchRawSuggestions(this.turnContext,e,this.strategy.uiKind,r);if(n)return ot.debug(this.turnContext.ctx,"Computed suggested title",n.suggestedTitle),n.suggestedTitle}updateTurnResponseWithError(e){this.turn.response?.message?this.turn.response.message=yq(this.turn.response?.message,{role:"assistant",content:e}):this.turn.response={message:e,type:"meta"}}async endProgress(e){await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}};p();p();var g1n="```",cwe=String.raw``,w$o=String.raw`${g1n}[\w]*?\n(?[\s\S]*?)\n${g1n}`,R$o=new RegExp(cwe+` +`+w$o,"gs"),_jt=["replace","delete"];function vjt(t,e){let r=t.matchAll(R$o),n=Array.from(r),o=[];for(let s of n){let c=s.groups;if(!c||!_jt.includes(c.mode))continue;let l=c.start?parseInt(c.start)-1:-1,u=c.end?parseInt(c.end)-1:l,f=c.codeblock.split(` `),h=f[0].match(/^\s*/)?.[0]??"";f.forEach((y,E)=>{f[E]=y.slice(h.length)});let m={mode:c.mode,codeblock:f.join(` -`),start:l,end:u},g=kqt([m],e);if(!g)continue;let A={text:g,uri:e.uri};o.push({...m,updatedDocument:A})}return o}a(Rqt,"extractEditsFromTaggedCodeblocks");function kqt(t,e){if(t.length===0)return;t.sort((n,o)=>n.start!==o.start?o.start-n.start:o.end-n.end);let r=e.getText().split(` +`),start:l,end:u},g=Cjt([m],e);if(!g)continue;let A={text:g,uri:e.uri};o.push({...m,updatedDocument:A})}return o}a(vjt,"extractEditsFromTaggedCodeblocks");function Cjt(t,e){if(t.length===0)return;t.sort((n,o)=>n.start!==o.start?o.start-n.start:o.end-n.end);let r=e.getText().split(` `);for(let n of t){let o=n.start,s=n.end,c=n.mode,l=n.codeblock.split(` `);if(!(o<0||s<0||s=r.length||s>=r.length)){if(c==="delete")r.splice(o,s-o+1);else if(c==="replace"){let u=r[o].match(/^\s*/)?.[0]??"";l.forEach((d,f)=>{l[f]=u+d}),r.splice(o,s-o+1,...l)}}}return r.join(` -`)}a(kqt,"applyEditsToDocument");var yue=class{constructor(e){this.ctx=e;this.earlyReturnResponse="Oops, an error has occurred. Please try again";this.uiKind="conversationPanel";this.computeSuggestions=!0}static{a(this,"PanelTurnProcessorStrategy")}processResponse(){return[]}async buildConversationPrompt(e,r,n,o){let s="user",c=await xo.getModelConfiguration(e.ctx,s),l={promptType:s,modelConfiguration:c,languageId:r,userSelectedModelName:o};return await this.ctx.get(kA).toPrompt(e,l)}extractEditsFromResponse(e,r){return[]}},fJe=class{constructor(e){this.ctx=e;this.earlyReturnResponse="Please open a file and select code for the inline chat to be available";this.uiKind="conversationInline";this.computeSuggestions=!1}static{a(this,"InlineTurnProcessorStrategy")}async buildConversationPrompt(e,r,n){let o=await this.getCurrentEditorSkill(e);if(!o)return;let s=await this.getDocumentIfValid(o.uri);if(!s)return;let c=n?.producesCodeEdits===!1?"user":"inline",l=await yq(e.ctx),u=await e.ctx.get(el).getBestChatModelConfig(xS(c,l)),d={promptType:c,modelConfiguration:u,languageId:r};return d.promptType==="inline"&&(this.currentDocument=s),await this.ctx.get(kA).toPrompt(e,d)}async processResponse(e){let r=[],n=Pn(e.response?.message??"");if(n&&e.status==="success"&&this.currentDocument){let o=await this.processInlineResponse(n,this.currentDocument);o&&r.push(o)}return r}async getCurrentEditorSkill(e){let r=await e.skillResolver.resolve(lE);if(r)return r}async getDocumentIfValid(e){let r=await this.ctx.get(ii).getOrReadTextDocument({uri:e});if(r.status==="valid")return r.document}async processInlineResponse(e,r){let o=Rqt(e,r).filter(c=>wqt.includes(c.mode)),s=kqt(o,r);if(s)return await this.ctx.get(zh).documentDiff({original:r.getText(),updated:s}),{uri:r.uri,text:s}}extractEditsFromResponse(e,r){return Rqt(e,r)}};var pJe=class{constructor(){this.slug="github-copilot-coding-agent";this.name="GitHub Copilot Coding Agent";this.description="Create coding tasks that are executed by GitHub Copilot Coding Agent";this.avatarUrl=void 0}static{a(this,"BackendCodingAgent")}additionalSkills(e){return[]}turnProcessor(e){let r=new yue(e.ctx);return new dJe(e,r)}};p();p();p();p();function qCn(t){return t?t.filter(e=>e.type==="github.web-search").map(e=>e):[]}a(qCn,"filterUnsupportedReferences");function jCn(t){return t?t.filter(e=>e.type==="github.web-search"):[]}a(jCn,"convertToCopilotReferences");var HCn=S.Object({type:S.Literal("github.web-search"),id:S.String(),data:S.Object({query:S.String(),type:S.String(),results:S.Optional(S.Array(S.Object({title:S.String(),excerpt:S.String(),url:S.String()})))}),metadata:S.Optional(S.Object({display_name:S.Optional(S.String()),display_icon:S.Optional(S.String())}))});var Iq=class{constructor(e){this.deltaApplier=e;this.appliedLength=0;this.appliedText="";this.appliedAnnotations=[]}static{a(this,"ConversationFinishCallback")}isFinishedAfter(e,r){let n=e.substring(this.appliedLength,e.length),s=this.mapAnnotations(r.annotations).filter(c=>!this.appliedAnnotations.includes(c.id));this.append(n,s,qCn(r.copilotReferences),r.copilotErrors??[],r.copilotConfirmation,r.thinking)}append(e,r,n,o,s,c){this.deltaApplier(e,r,n,o,s,c),this.appliedLength+=e.length,this.appliedText+=e,this.appliedAnnotations.push(...r.map(l=>l.id))}mapAnnotations(e){if(!e)return[];let r=[],n=e.for("CodeVulnerability").map(s=>({...s,type:"code_vulnerability"})),o=e.for("IPCodeCitations").map(s=>({...s,type:"ip_code_citations"}));return r.push(...n),r.push(...o),r}};p();p();var NO=class{constructor(e){this.ctx=e;this.githubRepositoryInfoCache=new Map}static{a(this,"GitHubRepositoryApi")}async getRepositoryInfo(e){let r=`${e.hostname}/${e.owner}/${e.repo}`,n=this.githubRepositoryInfoCache.get(r);if(n)return n;let o=await this._doGetRepositoryInfo(e);if(o?.ok){let s=await o.json();return this.githubRepositoryInfoCache.set(r,s),s}}async _doGetRepositoryInfo({owner:e,repo:r,hostname:n}){let o=await this.ctx.get(Ur).resolveSession(),s;if(o&&new URL(o.serverUrl).hostname===n)s=o;else{let u=await this.ctx.get(nx).findTokenByAuthority(n);u&&(s={accessToken:u.record.accessToken,apiUrl:`https://api.${n}/`})}if(!s&&!(n==="github.com"||n.endsWith(".ghe.com")))return;let c={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};s&&(c.Authorization=`Bearer ${s.accessToken}`);let l=new URL(`repos/${e}/${r}`,s?.apiUrl||`https://api.${n}`).href;return this.ctx.get(tr).fetch(l,{method:"GET",headers:c})}};p();p();var GCn=S.Object({name:S.String(),url:S.String()}),$Cn=S.Object({path:S.String(),head:S.Optional(S.Object({name:S.String(),upstream:S.Optional(GCn)})),remotes:S.Optional(S.Array(GCn))}),Pqt=class{constructor(e){this.turnContext=e}static{a(this,"GitMetadataSkillProcessor")}value(){return .8}processSkill(e){this.turnContext.collectLabel(MO,"git repository information");let r=[];return r.push([new Ar(["Metadata about the current git repository:"]),1]),e.head&&e.head.name?(r.push([new Ar([`- Current branch name: ${e.head.name}`]),1]),e.head.upstream&&r.push([new Ar([`- Upstream name and url: ${e.head.upstream.name} - ${e.head.upstream.url}`]),1])):r.push([new Ar(["- Detached HEAD: yes"]),1]),e.remotes&&e.remotes.length>0&&r.push([new Ar([`- Remotes: ${e.remotes.map(n=>n.name).join(", ")}`]),1]),new Ar(r)}},MO="git-metadata",hJe=class extends gg{static{a(this,"GitMetadataSkill")}constructor(e){super(MO,"Metadata about the current git repository, useful for questions about branch management and git related commands","Reading git information",()=>e,r=>new Pqt(r))}};async function VCn(t){let e=await t.skillResolver.resolve(lE);if(e){let c=e.uri,l=gQ(t.ctx,c);if(Sdn(l))return{repoInfo:l,skillUsed:lE}}let r=await t.skillResolver.resolve(MO);if(!r||!r.remotes||r.remotes.length===0){ot.debug(t.ctx,"Git metadata skill is not available or no remotes available.");return}let o=r.remotes.find(c=>c.name==="origin")??r.remotes[0],s=A8t(o.url);if(s)return{repoInfo:{baseFolder:{uri:r.path},url:o.url,...s},skillUsed:MO}}a(VCn,"extractRepoInfo");async function WCn(t){let e=[];return await THo(t,e),await IHo(t,e),await xHo(t,e),e}a(WCn,"skillsToReference");async function THo(t,e){let r=await wHo(t);r&&e.push(r)}a(THo,"addRepositoryReference");async function IHo(t,e){let r=await RHo(t);r&&e.push(r)}a(IHo,"addSelectionReference");async function xHo(t,e){let r=[],n=await PHo(t);n&&r.push(n),r.push(...await DHo(t)),r.length>0&&e.push(...r)}a(xHo,"addFileReferences");async function wHo(t){let e=await VCn(t);if(e){let r=t.ctx.get(NO),n=e.repoInfo.owner,o=e.repoInfo.repo,s=await r.getRepositoryInfo(e.repoInfo);if(s)return{type:"github.repository",id:`${n}/${o}`,data:{type:"repository",name:o,ownerLogin:n,id:s.id}}}}a(wHo,"gitMetadataToReference");async function RHo(t){let e=await t.skillResolver.resolve(lE);if(e&&e.selection){let n=await t.ctx.get(ii).getOrReadTextDocument(e),o=td(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o,e.selection),n.status==="valid")return kHo(e,n.document)}}a(RHo,"currentEditorToSelectionReference");function kHo(t,e){if(t.selection&&!uue(t.selection)){let r=e.getText(t.selection);return{type:"client.selection",id:t.uri,data:{start:{line:t.selection.start.line,col:t.selection.start.character},end:{line:t.selection.end.line,col:t.selection.end.character},content:r}}}}a(kHo,"extractSelection");async function PHo(t){let e=await t.skillResolver.resolve(lE);if(e){let n=await t.ctx.get(ii).getOrReadTextDocument(e),o=td(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o),n.status==="valid")return{type:"client.file",id:n.document.uri,data:{content:n.document.getText(),language:n.document.detectedLanguageId}}}}a(PHo,"currentEditorToFileReference");async function DHo(t){let e=[],r=t.turn.request.references;if(r&&r.length>0){let n=t.ctx.get(ii);for(let o of r)if(o.type==="file"){let s=await n.getOrReadTextDocument(o),c=td(s);if(await t.collectFile(t.turn.agent.agentSlug,o.uri,c,o.selection),s.status==="valid"){let l=s.document.getText();e.push({type:"client.file",id:o.uri,data:{content:l,language:s.document.detectedLanguageId}})}}}return e}a(DHo,"fileReferenceToPlatformFileReference");p();Mo();var NHo=new fe("ChatFetchResultPostProcessor"),Eue=class{constructor(e,r,n){this.turnContext=e;this.chatFetcher=r;this.computeSuggestions=n}static{a(this,"ChatFetchResultPostProcessor")}async postProcess(e,r,n,o,s,c,l,u){switch(Cyn(this.turnContext.ctx,l,c,e.type=="offTopic",e.requestId,u,s),await this.turnContext.ctx.get(zh).inspectFetchResult(e),e.type){case"success":return await this.processSuccessfulFetchResult(n,e.numTokens,e.requestId,r,l,o,s,u);case"offTopic":return this.processOffTopicFetchResult(s,l,u);case"canceled":return this.turnContext.turn.status="cancelled",this.turnContext.turn.response={message:"Cancelled",type:"user"},{error:{message:Pn(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}};case"failed":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:e.reason,type:"server"},NHo.error(this.turnContext.ctx,"Fetch failed:",e),{error:{message:$_.translateErrorMessage(e.code,e.reason,e.requestId,e.retryAfter,e.ghRequestId,{capiErrorCode:e.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===V_,copilotPlan:rx(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:e.code}};case"filtered":return this.turnContext.turn.status="filtered",{error:{message:"Oops, your response got filtered. Vote down if you think this shouldn't have happened.",responseIsFiltered:!0}};case"length":return this.turnContext.turn.status="error",{error:{message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0}};case"agentAuthRequired":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Authorization required",type:"server"},{error:{message:"Authorization required",responseIsFiltered:!1}};case"no_choices":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"No choices returned",type:"server"},{error:{message:"Oops, no choices received from the server. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0}};case"no_finish_reason":return this.turnContext.turn.status="error",n&&n.length>0?this.turnContext.turn.response={message:n,type:"model",references:this.turnContext.turn.response?.references}:this.turnContext.turn.response={message:"No finish reason",type:"server"},{error:{message:"Oops, unexpected end of stream. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0}};case"model_not_supported":{this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Model not supported",type:"server"};let{modelName:d,modelProviderName:f}=xo.parseModelNotSupportedReason(e.reason);return{error:{message:"Oops, the model is not supported. Please try again.",code:400,reason:"model_not_supported",responseIsFiltered:!1,modelName:d,modelProviderName:f}}}case"model_max_prompt_tokens_exceeded":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Model max prompt tokens exceeded",type:"server"},{error:{message:"Oops, the token limit exceeded. Try to shorten your prompt or start a new conversation.",code:400,reason:"model_max_prompt_tokens_exceeded",responseIsFiltered:!1}};case"successMultiple":case"tool_calls":case"unknown":return this.turnContext.turn.status="error",{error:{message:"Unknown server side error occurred. Please try again.",responseIsFiltered:!1}}}}async processSuccessfulFetchResult(e,r,n,o,s,c,l,u){if(e&&e.length>0){c.markAsDisplayed(),l.markAsDisplayed(),this.turnContext.turn.status="success",this.turnContext.turn.response={message:e,type:"model",references:this.turnContext.turn.response?.references},byn(this.turnContext,s,e,r,n,u,l);let d=this.computeSuggestions?await this.fetchSuggestions(o,s,c,u):void 0;if(d){let{followUp:f,suggestedTitle:h}=d;return{followup:f.message!==""?f:void 0,suggestedTitle:h!==""?h:void 0}}return{}}return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"The model returned successful but did not contain any response text.",type:"meta"},{error:{message:Pn(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}}}async fetchSuggestions(e,r,n,o){let c=await new bq(this.turnContext.ctx,this.chatFetcher).fetchRawSuggestions(this.turnContext,e,r,n);if(c===void 0)return;let l=this.enrichFollowup(c,r,n,o);return ot.debug(this.turnContext.ctx,"Computed followup",l),ot.debug(this.turnContext.ctx,"Computed suggested title",c.suggestedTitle),{followUp:l,suggestedTitle:c.suggestedTitle}}enrichFollowup(e,r,n,o){let s=n.extendedBy({messageSource:"chat.suggestions",suggestionId:Mt(),suggestion:"Follow-up from model"},{promptTokenLen:e.promptTokenLen,numTokens:e.numTokens});return xyn(this.turnContext.ctx,r,s,o),{message:e.followUp,id:s.properties.suggestionId,type:s.properties.suggestion}}processOffTopicFetchResult(e,r,n){let o="Sorry, but I can only assist with programming related questions.";return this.turnContext.turn.response={message:o,type:"offtopic-detection"},this.turnContext.turn.status="off-topic",Syn(this.turnContext.ctx,this.turnContext.conversation,r,o,e.properties.messageId,n,e),{error:{message:o,responseIsFiltered:!0}}}};p();var mJe=S.Union([S.String(),S.Number()]),WK=S.Union([S.String(),S.Number()]),MHo=S.Union([S.Literal("included"),S.Literal("blocked"),S.Literal("notfound"),S.Literal("empty")]),gJe=S.Object({uri:S.String(),position:S.Optional(c0)}),OHo=S.Object({type:S.Literal("file"),uri:S.String(),position:S.Optional(c0),visibleRange:S.Optional(Sf),selection:S.Optional(Sf),status:S.Optional(MHo),range:S.Optional(Sf)}),LHo=S.Object({type:S.Literal("directory"),uri:S.String()}),BHo=S.Object({type:S.Literal("tool"),uri:S.String(),name:S.Optional(S.String()),server:S.Optional(S.String()),description:S.Optional(S.String())}),OO=S.Union([OHo,LHo,HCn,BHo]),LO=S.Union([S.Literal("panel"),S.Literal("inline")]),FHo=S.Union([S.Object({type:S.Literal("text"),text:S.String()}),S.Object({type:S.Literal("image_url"),imageUrl:S.Object({url:S.String(),detail:S.Optional(S.Union([S.Literal("low"),S.Literal("high")]))})})]),Dqt=S.Union([S.String(),S.Array(FHo)]),zCn=S.Object({request:Dqt,response:S.Optional(S.String()),agentSlug:S.Optional(S.String()),turnId:S.Optional(WK),model:S.Optional(S.String())});function AJe(t){return typeof t=="string"?t:t.map(e=>e.type==="image_url"?{type:"image_url",image_url:{url:e.imageUrl.url,detail:e.imageUrl.detail}}:{type:"text",text:e.text})}a(AJe,"convertToMessageContent");function yJe(t,e){if(t=GS(t),typeof t=="string")return t+e;let r=t.map(n=>n.type==="text").lastIndexOf(!0);if(r>=0){let n=[...t],o=n[r];return n[r]={type:"text",text:o.text+e},n}return[...t,{type:"text",text:e}]}a(yJe,"appendToMessage");var EJe=S.Union([S.Literal("Ask"),S.Literal("Agent"),S.Literal("InlineAgent")]),UHo=S.Object({type:S.String(),description:S.String()}),YCn=S.Object({name:S.String(),description:S.String(),inputSchema:S.Optional(S.Object({type:S.String(),properties:S.Record(S.String(),UHo),required:S.Array(S.String())})),confirmationMessages:S.Optional(S.Object({title:S.String(),message:S.String()}))}),Bc=S.Object({uri:S.String(),name:S.String()}),QHo=S.Union([S.Literal("not-started"),S.Literal("in-progress"),S.Literal("completed")]),_Je=S.Object({id:S.Number(),title:S.String(),description:S.Optional(S.String()),status:QHo});Mo();var Nqt="generate-response",vJe=class extends Error{constructor(r,n,o,s){super(r);this.authorizationUri=n;this.agentSlug=o;this.agentName=s}static{a(this,"RemoteAgentAuthorizationError")}},Gxe=class{constructor(e,r,n){this.agent=e;this.turnContext=r;this.chatFetcher=n;this.conversationProgress=r.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new oc(r.ctx),this.postProcessor=new Eue(r,this.chatFetcher,!1),this.conversation=r.conversation,this.turn=r.turn}static{a(this,"RemoteAgentTurnProcessor")}async process(e,r,n,o){try{await this.processWithAgent(e,r,this.turnContext,o)}catch(s){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,s);let c=s instanceof Error?s.message:String(s);this.turn.status="error",this.turn.response={message:c,type:"meta"},s instanceof vJe?await this.endProgress({unauthorized:{authorizationUri:s.authorizationUri,agentSlug:s.agentSlug,agentName:s.agentName}}):await this.endProgress({error:{message:c,responseIsIncomplete:!0}})}}async processWithAgent(e,r,n,o){await this.conversationProgress.begin(this.conversation,this.turn,e);let s=await tl(this.turnContext.ctx,this.turnContext,{languageId:o?.detectedLanguageId??""});if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let c=await this.buildAgentPrompt(n);if(!c)await this.endTurnWithResponse(`No prompt created for agent ${this.agent.id}`,"error");else{let l={type:"user",prompt:JSON.stringify(c.messages,null,2),tokens:c.tokens};await n.ctx.get(zh).inspectPrompt(l),await n.steps.start(Nqt,"Generating response");let u=this.augmentTelemetry(c,s,this.turn.template,o);if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let d=await this.fetchConversationResponse(n,c.messages,r,s.extendedBy({messageSource:"chat.user"},{promptTokenLen:c.tokens}),u,o);this.turn.status==="cancelled"&&this.turn.response?.type==="user"?await this.cancelProgress():(await this.finishGenerateResponseStep(d,n),await this.endProgress({error:d.error,followUp:d.followup,suggestedTitle:d.suggestedTitle,skillResolutions:c.skillResolutions}))}}async buildAgentPrompt(e){let r=this.createMessagesFromHistory(e),n=await this.computeCopilotReferences(e),o=this.getOrCreateAgentSessionId(e);return this.turn.agent&&(this.turn.agent.sessionId=o),this.turn.confirmationResponse?this.addConfirmationResponse(this.turn.confirmationResponse,r):r.push({role:"user",content:GS(e.turn.request.message),copilot_references:n.length>0?n:void 0}),{messages:r,tokens:-1,skillResolutions:[]}}getOrCreateAgentSessionId(e){let r=this.turn.agent?.agentSlug;if(r){for(let n of e.conversation.turns)if(n.agent?.agentSlug===r&&n.agent.sessionId)return n.agent.sessionId}return Mt()}addConfirmationResponse(e,r){r.push({role:"user",content:"",copilot_confirmations:[e]})}createMessagesFromHistory(e){return QQt(e.conversation.turns.slice(0,-1),this.agent.slug).flatMap(r=>{let n=[];if(r.request&&n.push({role:"user",content:GS(r.request.message)}),r.response&&r.response.type==="model"){let o=jCn(r.response.references);n.push({role:"assistant",content:GS(r.response.message),copilot_references:o.length>0?o:void 0})}return n})}async computeCopilotReferences(e){return await WCn(e)}async endTurnWithResponse(e,r){this.turn.response={type:"meta",message:e},this.turn.status=r,await this.conversationProgress.report(this.conversation,this.turn,{reply:e}),await this.endProgress()}async fetchConversationResponse(e,r,n,o,s,c){n.onCancellationRequested(async()=>{await this.cancelProgress()});let l=new Iq((h,m,g,A,y,E)=>{let _=y?{...y,agentSlug:this.agent.slug}:void 0;this.conversationProgress.report(this.conversation,this.turn,{reply:h,annotations:m,references:g,notifications:A.map(v=>({message:v.message,severity:"warning"})),confirmationRequest:_,thinking:E}),this.turn.response?(this.turn.response.message=yJe(this.turn.response.message,h),this.turn.response.references.push(...g)):this.turn.response={message:h,type:"model",references:g},this.turn.annotations.push(...m??[]),_&&(this.turn.confirmationRequest=_)}),u=await this.turnContext.ctx.get(Qt).getGitHubSession(),d={engineName:"agents",endpoint:this.agent.endpoint??this.agent.slug,messages:r,uiKind:"conversationPanel",intentParams:{intent:!0,intent_threshold:.7,intent_content:Pn(this.turn.request.message)},authToken:u?.accessToken,copilot_thread_id:this.turn.agent?.sessionId,llmInteraction:e.toLlmInteraction(),turnId:String(this.turn.id)},f=await this.chatFetcher.fetchResponse(d,n,o,(h,m)=>l.isFinishedAfter(h,m));return this.ensureAgentIsAuthorized(f),await this.postProcessor.postProcess(f,n,l.appliedText,o,s.extendedBy(this.addExtensibilityInfoTelemetry()),Pn(this.turn.request.message),"conversationPanel",c)}ensureAgentIsAuthorized(e){if(e.type==="agentAuthRequired")throw this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Authorization required",type:"server"},new vJe("Authorization required",e.authUrl,this.agent.slug,this.agent.name)}augmentTelemetry(e,r,n,o){return cxe(this.conversation,"conversationPanel",Pn(this.turn.request.message).length,e.tokens,n?.templateId,void 0,r,e.skillResolutions)}addExtensibilityInfoTelemetry(){return{extensibilityInfoJson:JSON.stringify({agent:this.agent.slug,outgoingReferences:this.turn.request.references?.map(e=>e.type)??[],incomingReferences:this.turn.response?.references?.map(e=>e.type)??[]})}}async finishGenerateResponseStep(e,r){e.error?await r.steps.error(Nqt,e.error.message):await r.steps.finish(Nqt)}async endProgress(e){await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}};var $xe=class{constructor(e,r,n,o,s,c){this.id=e;this.slug=r;this.name=n;this.description=o;this.avatarUrl=s;this.endpoint=c}static{a(this,"RemoteAgent")}additionalSkills(){return[]}turnProcessor(e){return new Gxe(this,e)}},CJe=class extends $xe{static{a(this,"ExtensibilityPlatformAgent")}constructor(){super(0,"github","GitHub","Get answers grounded in web search, code search, and your enterprise's knowledge bases.","https://avatars.githubusercontent.com/u/9919?s=200&v=4","chat")}turnProcessor(e){return new Gxe(this,e)}};p();var qHo="github",WP=class{static{a(this,"RemoteAgentRegistry")}},bJe=class extends WP{constructor(r){super();this.ctx=r;this._agents=void 0;this._lastFetchTime=0}static{a(this,"CapiRemoteAgentRegistry")}async agents(){return this.shouldRefreshAgents()&&(this._agents=await this.fetchAgents()),this._agents!=null?this._agents.slice():[]}shouldRefreshAgents(){return!this._agents||!this._lastFetchTime?!0:this.isLastFetchOlderOneHour()}isLastFetchOlderOneHour(){return Date.now()-this._lastFetchTime>36e5}async fetchAgents(){let r=await PY(this.ctx,"/agents");return r.ok?(this._lastFetchTime=Date.now(),this.parseAgents(await r.text())):(Nr.error(this.ctx,"Failed to fetch agents from CAPI",{status:r.status,statusText:r.statusText}),[])}parseAgents(r){let n;try{n=JSON.parse(r).agents,Array.isArray(n)||Nr.error(this.ctx,"Expected 'agents' to be an array")}catch(o){return r.includes("access denied")||Nr.warn(this.ctx,"Invalid remote agent response:",r,o),[]}return n.filter(o=>o.slug!==qHo).map(o=>new $xe(o.id,o.slug,o.name,o.description,o.avatar_url))}};p();p();var KCn=de(require("fs")),z_=de(require("path"));var Mqt=[".test",".spec","_test","Test","_spec","_test","Tests",".Tests","Spec"],Oqt="test_",Vxe={js:{suffix:[".test",".spec"],location:"sameFolder"},ts:{suffix:[".test",".spec"],location:"sameFolder"},go:{suffix:["_test"],location:"sameFolder"},java:{suffix:["Test"],location:"testFolder"},php:{suffix:["Test"],location:"testFolder"},dart:{suffix:["_test"],location:"testFolder"},cs:{suffix:["Test"],location:"testFolder"},rb:{suffix:["_test","_spec"],location:"testFolder"},py:{prefix:"test_",location:"testFolder"},ps1:{suffix:[".Tests"],location:"testFolder"},kt:{suffix:["Test"],location:"testFolder"}},Wxe=class{constructor(e,r,n=void 0){this.ctx=e;this.fileExists=r;this.baseUri=n}static{a(this,"TestFileFinder")}async findTestFileForSourceFile(e){let r=Ji(e),n=z_.extname(r).replace(".",""),o=Vxe[n]??{location:"sameFolder",prefix:Oqt,suffix:Mqt},s=[];if(o.prefix&&s.push(o.prefix+r),o.suffix)for(let d of o.suffix??[]){let f=r.replace(`.${n}`,d+"."+n);s.push(f)}let c=o.location??"sameFolder",l;if(c==="sameFolder"){if(l=rs(uf(e)),l===void 0)return}else{let d=rs(e);if(d===void 0)return;l=this.determineTestFolder(d,c)}for(let d of s){let f=z_.join(l,d),h=this.parseTestFilePath(f);if(h&&await this.fileExists(h))return h}let u=Ks(l);if(await this.fileExists(u))return wa(u,s[0])}parseTestFilePath(e){try{return Ks(e)}catch(r){Nr.error(this.ctx,`Failed to parse test file path: ${e}`,r);return}}async findImplFileForTestFile(e){let r=Ji(e),n=z_.extname(r).replace(".",""),o=Vxe[n]??{location:"sameFolder",prefix:Oqt,suffix:Mqt},s=[];if(o.prefix&&s.push(r.substring(o.prefix.length)),o.suffix)for(let u of o.suffix??[]){let f=r.substring(0,r.length-u.length-1-n.length)+"."+n;s.push(f)}let c=o.location??"sameFolder",l;c==="sameFolder"?l=uf(e):l=this.determineImplFolder(e);for(let u of s){let d=wa(l,u);if(await this.fileExists(d))return d}}findExampleTestFile(e){let r=rs(e);if(r===void 0)return;let n=z_.extname(Ji(e)).replace(".",""),o,s=Vxe[n]?.location??"sameFolder";s==="sameFolder"?o=z_.dirname(r):o=this.determineTestFolder(r,s);let c=this.findFiles(o,`.${n}`,Vxe[n]);if(c.length>0)return Ks(c[0])}findFiles(e,r,n){let o=this._readdir(e),s=[];for(let c of o){let l=`${e}${z_.sep}${c}`;n?.prefix&&c.startsWith(n.prefix)&&s.push(l),n?.suffix&&n?.suffix.some(u=>c.endsWith(u+r))&&s.push(l)}return s}_readdir(e){return KCn.readdirSync(e,{withFileTypes:!0}).filter(r=>r.isFile()).map(r=>r.name)}determineTestFolder(e,r){let n=(this.baseUri&&rs(this.baseUri))??"",o=z_.extname(e).replace(".",""),s=this.getRelativeTestFolder(e,n,o,r);return[n,...s].filter(c=>c).join(z_.sep)}getRelativeTestFolder(e,r,n,o){let s=z_.dirname(e).replace(r,"");switch(n){case"php":case"dart":case"py":return["tests"];case"ps1":return["Tests"];case"rb":return["test",s];case"cs":return[s.replace("src","src/tests")];case"java":case"scala":case"kt":return[s.replace(/src[\\/]main/,"src/test")];default:return o==="testFolder"?[s.replace("src","test")]:[s]}}determineImplFolder(e){let r=z_.extname(Ji(e)).replace(".",""),n=uf(e);switch(r){case"php":case"dart":case"py":return n.replace("tests","src");case"ps1":return n.replace("Tests","src");case"rb":return n.replace("/test","");case"cs":return n.replace("src/tests","src");case"java":case"scala":case"kt":return n.replace("src/test","src/main");default:return n.replace("test/","src/")}}};function zxe(t){let e=Ji(t),r=z_.extname(e),n=Vxe[r.replace(".","")];return n?!(n.suffix&&!n.suffix.some(s=>e.endsWith(s+r))||n.prefix&&!e.startsWith(n.prefix)):!!(Mqt.some(s=>e.endsWith(s+r))||e.startsWith(Oqt))}a(zxe,"isTestFile");p();var Lqt=class extends Error{static{a(this,"UserQueryParserError")}constructor(e){super(String(e),{cause:e}),this.name="UserQueryParserError"}};async function JCn(t,e){let r=t.ctx,n=await xo.getModelConfiguration(r,"synonyms",{tool_calls:!0}),o={promptType:"synonyms",modelConfiguration:n},s=await r.get(kA).toPrompt(t,o);if(!s.toolConfig)return;let c={modelConfiguration:n,uiKind:"conversationPanel",messages:s.messages,tools:s.toolConfig?.tools,tool_choice:s.toolConfig?.tool_choice,llmInteraction:t.toLlmInteraction()},l=new oc(r),u=await tl(r,t),d=await l.fetchResponse(c,e,u.extendedBy({messageSource:"chat.synonyms"}));if(d.type==="success"&&d.toolCalls&&d.toolCalls.length>0){let f=d.toolCalls[0],h=s.toolConfig?.extractArguments(f).keywords;return!h||!Array.isArray(h)?void 0:(ot.debug(r,`UserQueryParser: Parsed ${h.length} keywords from the original user query: ${h.join(", ")}`),h.length?h:void 0)}else{let f="reason"in d?d.reason:"";qa(r,new Lqt(`Failed to request user query synonyms, result type: ${d.type}, reason: ${f}`),"UserQueryParser.parseUserQuery")}}a(JCn,"parseUserQuery");p();p();p();p();var Yo=class t{static{a(this,"Position")}constructor(e,r){this.lineNumber=e,this.column=r}with(e=this.lineNumber,r=this.column){return e===this.lineNumber&&r===this.column?this:new t(e,r)}delta(e=0,r=0){return this.with(this.lineNumber+e,this.column+r)}equals(e){return t.equals(this,e)}static equals(e,r){return!e&&!r?!0:!!e&&!!r&&e.lineNumber===r.lineNumber&&e.column===r.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,r){return e.lineNumbern||e===n&&r>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=e,this.endColumn=r):(this.startLineNumber=e,this.startColumn=r,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.columne.endColumn)}static strictContainsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.column<=e.startColumn||r.lineNumber===e.endLineNumber&&r.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumn<=e.startColumn||r.endLineNumber===e.endLineNumber&&r.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,r){let n,o,s,c;return r.startLineNumbere.endLineNumber?(s=r.endLineNumber,c=r.endColumn):r.endLineNumber===e.endLineNumber?(s=r.endLineNumber,c=Math.max(r.endColumn,e.endColumn)):(s=e.endLineNumber,c=e.endColumn),new t(n,o,s,c)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,r){let n=e.startLineNumber,o=e.startColumn,s=e.endLineNumber,c=e.endColumn,l=r.startLineNumber,u=r.startColumn,d=r.endLineNumber,f=r.endColumn;return nd?(s=d,c=f):s===d&&(c=Math.min(c,f)),n>s||n===s&&o>c?null:new t(n,o,s,c)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,r){return!e&&!r?!0:!!e&&!!r&&e.startLineNumber===r.startLineNumber&&e.startColumn===r.startColumn&&e.endLineNumber===r.endLineNumber&&e.endColumn===r.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new Yo(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new Yo(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,r){return new t(this.startLineNumber,this.startColumn,e,r)}setStartPosition(e,r){return new t(e,r,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,r=e){return new t(e.lineNumber,e.column,r.lineNumber,r.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,r){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};var ZCn=250;function PA(t){let e;if(typeof t.tokenBudget=="number"&&(e=Math.floor(t.tokenBudget/ZCn)),typeof t.maxResults=="number"&&(e=typeof e=="number"?Math.min(t.maxResults,e):t.maxResults),typeof e!="number")throw new Error("Either maxResults or tokenBudget must be provided");return e}a(PA,"getMaxChunks");var XCn=32e3,ebn=2e4,Yxe=.75;p();p();function DA(t){let e=t.matchAll(/^\s*(```+)/gm),r=Math.max(3,...Array.from(e,n=>n[1].length+1));return"`".repeat(r)}a(DA,"getFenceForCodeBlock");p();var B1n=de(Sl()),F1n=de(eh());p();var $C=class t{constructor(e){this.id=e}static{a(this,"EmbeddingType")}static{this.text3small_512=new t("text-embedding-3-small-512")}static{this.metis_1024_I16_Binary=new t("metis-1024-I16-Binary")}toString(){return this.id}equals(e){return this.id===e.id}};var JGo=Object.freeze({[$C.text3small_512.id]:{model:"text-embedding-3-small",dimensions:512,quantization:{query:"float32",document:"float32"}},[$C.metis_1024_I16_Binary.id]:{model:"metis-I16-Binary",dimensions:1024,quantization:{query:"float16",document:"binary"}}});function Jqt(t){return JGo[t.id]}a(Jqt,"getWellKnownEmbeddingTypeInfo");function ZGo(t,e){let r=0,n=Math.min(t.length,e.length);for(let o=0;o({distance:Kxe(l,t),value:c})).filter(c=>c.distance.value>o).sort((c,l)=>l.distance.value-c.distance.value).slice(0,r).map(c=>({distance:c.distance,value:c.value}));if(s.length&&typeof n?.maxSpread=="number"){let c=s.at(0).distance.value*(1-n.maxSpread);return s.filter(u=>u.distance.value>=c)}return s}a(fbn,"rankEmbeddings");p();p();var nF=de(nl()),L1n=de(eh());var qO=new fe("GitHubCodeSearch"),Hzo=300*1e3,pZe=class{constructor(e){this._indexedCommits=new Map;this._indexedRepos=new Map;this._ctx=e,this._refreshTimer=new nF.IntervalTimer,this.startPeriodicRefresh()}static{a(this,"GithubCodeSearchService")}getIndexedCommit(e){return this._indexedCommits.get(e)}setIndexedCommit(e,r){this._indexedCommits.get(e)!==r&&this._indexedCommits.set(e,r)}startPeriodicRefresh(){this._refreshTimer.cancelAndSet(()=>{this.updateIndexedRepoCommit()},Hzo)}updateIndexedRepoCommit(){if(this._indexedRepos.size!==0)for(let[e,r]of this._indexedRepos.entries())this._indexedCommits.get(e)&&(async()=>{try{let o=await this._ctx.get(Qt).getGitHubSession();if(!o)return;let{currentStatus:s,indexedCommit:c}=await this.getRemoteIndexState(o,r,{isCancellationRequested:!1});if(s==="ready"&&c){let l=this._indexedCommits.get(e);l!==c&&(this._indexedCommits.set(e,c),qO.info(this._ctx,`Updated indexed commit for ${r.owner}/${r.name}`,{oldCommit:l,newCommit:c}))}}catch(o){qO.warn(this._ctx,`Failed to update indexed commit for ${e}`,o)}})()}async ensureReposIndexed(e,r,n){return await Promise.all(r.map(async o=>{let s=o?.baseFolder.uri;if(!s||n.isCancellationRequested||this._indexedRepos.has(s))return;let{currentStatus:c,indexedCommit:l}=await this.getRemoteIndexState(e,o,n);if(qO.info(this._ctx,`Index status check for ${o.owner}/${o.name}`,{status:c,indexedCommit:l}),c==="ready")this._indexedRepos.set(s,o),l&&this.setIndexedCommit(s,l);else if(c==="not-yet-indexed")try{await this.tryToInstantIndexRepo(e,o,n),qO.info(this._ctx,`Instant indexing completed for ${o.owner}/${o.name}`)}catch(u){qO.warn(this._ctx,`Instant indexing failed for ${o.owner}/${o.name}`,u)}})),r.filter(o=>this._indexedRepos.has(o.baseFolder.uri))}async tryToInstantIndexRepo(e,r,n){await(0,nF.raceTimeout)((async()=>{if(!await(0,nF.raceCancellationError)(this.triggerIndexing(e,"auto",r,n),n))return!1;let c=5,l=1e3;for(;c-- >0;){await(0,nF.raceCancellationError)((0,nF.timeout)(l),n);let{currentStatus:u,indexedCommit:d}=await this.getRemoteIndexState(e,r,n);if(u==="ready"){this._indexedRepos.set(r.baseFolder.uri,r),d&&this.setIndexedCommit(r.baseFolder.uri,d);break}else if(u!=="building-index"){let f=`Instant indexing for '${r.owner}/${r.name}' failed. Found unexpected status: '${u}'`;throw qO.error(this._ctx,f),new Error(f)}}return!0})(),8e3)}async getRemoteIndexState(e,r,n){if(!r.owner||!r.name)return{currentStatus:"not-indexable"};let o=r.owner+"/"+r.name,s=await Gf(this._ctx,e,`repos/${o}/copilot_internal/embeddings_index`,{method:"GET"});if(!s.ok)return qO.error(this._ctx,`Failed to fetch indexing status. Response: ${s.status}.`),{currentStatus:"not-yet-indexed"};let c=await s.json();return qO.debug(this._ctx,`${o} - semantic_code_search_ok: ${c.semantic_code_search_ok}`),c.semantic_code_search_ok?{currentStatus:"ready",indexedCommit:c.semantic_commit_sha}:c.semantic_indexing_enabled?{currentStatus:"building-index"}:{currentStatus:"not-yet-indexed"}}async triggerIndexing(e,r,n,o){let s=Pue(this._ctx),c=n.owner+"/"+n.name,l=await Gf(this._ctx,e,`repos/${c}/copilot_internal/embeddings_index`,{headers:s,method:"POST",json:{auto:r==="auto"}});return l.ok?!0:(qO.error(this._ctx,`Failed to request indexing for '${c}'. Response: ${l.status}. ${await l.text()}`),!1)}async searchRepo(e,r,n,o,s,c){let l=Pue(this._ctx),u=await Gf(this._ctx,e,"embeddings/code/search",{headers:l,method:"POST",json:{scoping_query:`repo:${n.owner}/${n.name}`,prompt:$zo(o,7800),include_embeddings:!1,limit:s,embedding_model:r.id}});if(!u.ok)throw new Error(`Code search semantic search failed with status: ${u.status}`);let d=await u.json();if(!Array.isArray(d.results))throw new Error("Code search semantic search unexpected response json shape");return Gzo(this._ctx,d,n)}dispose(){this._refreshTimer.dispose(),this._indexedCommits.clear(),this._indexedRepos.clear()}};function Pue(t){let e=t.get(Ir);return{"X-Client-Application":`${M1(e.getEditorInfo())}`,"X-Client-Source":M1(e.getEditorPluginInfo()),"X-Client-Feature":"Agent <- codebaseTool"}}a(Pue,"editorVersionHeaders");async function Gzo(t,e,r){let o=[],s=new $C(e.embedding_model),c=Fs(r.baseFolder.uri);return await Promise.all(e.results.map(l=>{let u;try{u=wa(c,l.location.path)}catch(d){qO.error(t,`Error joining path for ${l.location.path}:`,d);return}o.push({chunk:{file:u,text:hZe(l.chunk.text),rawText:void 0,range:new L1n.Range(l.chunk.line_range.start+1,1,l.chunk.line_range.end+1,1),isFullFile:!1},distance:{embeddingType:s,value:l.distance}})})),{chunks:o,outOfSync:!1}}a(Gzo,"parseGithubCodeSearchResponse");function $zo(t,e){if(t.length*4<=e)return t;let o=new TextEncoder().encode(t);if(o.length<=e)return t;let s=o.slice(0,e);return new TextDecoder().decode(s,{stream:!0})}a($zo,"truncateToMaxUtf8Length");function hZe(t){let e=Vzo(t);return e.length>=3&&e[0].startsWith("File: ")&&e[1].startsWith("```")&&e.at(-1)?.startsWith("```")?e.slice(2,-1).join(` -`):t}a(hZe,"stripChunkTextMetadata");function Vzo(t){return t.split(/\r\n|\r|\n/)}a(Vzo,"splitLines");var XP=de(nl()),U1n=de(vue()),Q1n=de(em());var mwe=new fe("ChunkingEndpointClient"),wHt=class t{constructor(e){this.ctx=e;this._maxParallelChunksRequests=8;this._maxAttempts=3;this.targetQuota=80;this.requestQueue=new U1n.LinkedList;this._numberInFlightRequests=0;this._lastSendTime=Date.now();this._isPumping=!1}static{a(this,"RequestRateLimiter")}static{this._abuseLimit=1e3/40}async enqueue(e,r){let n=new XP.DeferredPromise;return r.onCancellationRequested(()=>n.cancel()),this.requestQueue.push({task:e,attempt:0,deferred:n,token:r}),await this.pump(),n.p}async pump(){if(!this._isPumping)try{for(this._isPumping=!0;!this.requestQueue.isEmpty();){this._rateLimitTimeout&&(await this._rateLimitTimeout,this._rateLimitTimeout=void 0);let e=Date.now()-this._lastSendTime;if(e=this._maxParallelChunksRequests){await(0,XP.timeout)(10);continue}if(this._latestRateLimitHint){let o=Date.now();if(othis.targetQuota){let o=Date.now(),s=this._latestQuotaUsed.quota-this.targetQuota,c=o-this._latestQuotaUsed.timestamp,l=2500,u=1e3,d=s/(100-this.targetQuota);d*=Math.max(1-c/l,0);let f=d*u;f>0&&await(0,XP.timeout)(Math.min(f,u))}let r=this.requestQueue.shift();if(r.token.isCancellationRequested){await r.deferred.cancel();continue}this._numberInFlightRequests++,this._lastSendTime=Date.now(),r.task(r.attempt).then(async o=>{if(this.updateQuotasFromResponse(o),r.token.isCancellationRequested){await r.deferred.cancel();return}if(o.ok){await r.deferred.complete(o);return}if(r.attempt0&&(this._rateLimitTimeout=(0,XP.timeout)(s*1e3)),this.requestQueue.unshift({task:r.task,attempt:r.attempt+1,deferred:r.deferred,token:r.token}),await this.pump();return}await r.deferred.complete(o)}).catch(async o=>{await r.deferred.error(o)}).finally(()=>{this._numberInFlightRequests--})}}finally{this._isPumping=!1}}updateQuotasFromResponse(e){let r=Date.now();try{let n=e.headers.get("x-ratelimit-remaining"),o=e.headers.get("x-ratelimit-reset");n&&o&&(this._latestRateLimitHint={timestamp:r,remaining:parseFloat(n),resetAt:parseFloat(o)*1e3});let s=e.headers.get("x-github-total-quota-used");s&&(this._latestQuotaUsed?this._latestQuotaUsed={timestamp:r,quota:parseFloat(s)}:this._latestQuotaUsed={timestamp:r,quota:parseFloat(s)})}catch(n){mwe.error(this.ctx,"Error parsing rate limit/quota headers",n)}}getRequestRetryDelay(e){try{let r=e.headers.get("retry-after");if(r){let n=parseFloat(r);if(!isNaN(n))return n}}catch{mwe.error(this.ctx,"Error parsing retry-after header")}try{let r=e.headers.get("x-ratelimit-reset");if(r){let n=parseFloat(r);if(!isNaN(n)){let o=Math.floor(Date.now()/1e3);return n-o}}}catch{mwe.error(this.ctx,"Error parsing x-ratelimit-reset header")}return e.status===408?.25:2}},mZe=class{constructor(e){this.ctx=e;this._requestLimiter=new wHt(e)}static{a(this,"ChunkingEndpointClientImpl")}computeChunks(e,r,n,o,s,c,l){return this.doComputeChunksAndEmbeddings(e,r,n,o,{qos:s,computeEmbeddings:!1},c,l)}async computeChunksAndEmbeddings(e,r,n,o,s,c,l){return await this.doComputeChunksAndEmbeddings(e,r,n,o,{qos:s,computeEmbeddings:!0},c,l)}async doComputeChunksAndEmbeddings(e,r,n,o,s,c,l){let u=await(0,XP.raceCancellationError)(n.getText(),l);if((0,Q1n.isFalsyOrWhitespace)(u))return[];try{let d=a(async m=>{let g=Pue(this.ctx);return await Gf(this.ctx,e,"chunks",{headers:g,method:"POST",json:{embed:s.computeEmbeddings,qos:s.qos,content:u,path:rs(n.uri),local_hashes:c?Array.from(c.keys()):[],embedding_model:r.id}})},"makeRequest");o.recomputedFileCount++,o.sentContentTextLength+=u.length;let f=await(0,XP.raceCancellationError)(this._requestLimiter.enqueue(d,l),l);if(!f.ok){mwe.error(this.ctx,`Error chunking '${n.uri.toString()}'. Status: ${f.status}.`);return}let h=await f.json();return h.chunks.length?(0,B1n.coalesce)(h.chunks.map(m=>{let g=new F1n.Range(m.line_range.start+1,1,m.line_range.end+1,1),A=c?.get(m.hash);if(A)return{chunk:{file:n.uri.toString(),text:hZe(A.chunk.text),rawText:void 0,range:g,isFullFile:A.chunk.isFullFile},chunkHash:m.hash,embedding:A.embedding};if(typeof m.text!="string")return;let y;if(m.embedding?.embedding){let E=new $C(h.embedding_model);if(!E.equals(r))throw new Error(`Unexpected embedding model. Got: ${E.id}. Expected: ${r.id}`);y={type:E,value:new Float32Array(m.embedding.embedding)}}if(!(s.computeEmbeddings&&!y))return{chunk:{file:n.uri.toString(),text:hZe(m.text),rawText:void 0,range:g,isFullFile:!1},chunkHash:m.hash,embedding:y}})):[]}catch(d){mwe.error(this.ctx,`Error chunking '${n.uri.toString()}'`,d);return}}};p();p();var fE={Tfidf:"semantic.search.tfidf",Embeddings:"semantic.search.embeddings",Remote:"semantic.search.remote",Aggregate:"semantic.search.aggregate"},f0=class t{static{a(this,"WorkspaceChunkSearchTelemetry")}static sendSuccess(e,r,n,o){let s={status_text:"success",...n},c=Wt.createAndMarkAsIssued(s,o);Et(e,r,c),At(e,r,c.properties,c.measurements)}static sendFailure(e,r,n){let o={status_text:"failure"};qa(e,n,r,o),Vn(e,r,n,o)}static sendTfidfSuccess(e,r,n,o,s,c,l,u,d){t.sendSuccess(e,fE.Tfidf,{source:d},{timeTakenMs:r,rankingTimeMs:n,rerankingTimeMs:o,localSnippetCount:l,chunkCount:s,fileCount:c,totalFileCount:u})}static sendTfidfFailure(e,r){t.sendSearchFailure(e,fE.Tfidf,r)}static sendEmbeddingsSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,fE.Embeddings,{source:l},{timeTakenMs:r,embeddingsTimeMs:n,chunkCount:o,fileCount:s,totalFileCount:c})}static sendEmbeddingsFailure(e,r){t.sendSearchFailure(e,fE.Embeddings,r)}static sendEmbeddingsSkipped(e,r){t.sendSkipped(e,fE.Embeddings,r)}static sendRemoteSuccess(e,r,n,o,s){t.sendSuccess(e,fE.Remote,{provider:s},{timeTakenMs:r,chunkCount:n,fileCount:o})}static sendRemoteFailure(e,r){t.sendSearchFailure(e,fE.Remote,r)}static sendRemoteSkipped(e,r){t.sendSkipped(e,fE.Remote,r)}static sendSearchFailure(e,r,n){t.sendFailure(e,r,n)}static sendSkipped(e,r,n){let o={status_text:"skipped",reason:n},s=Wt.createAndMarkAsIssued(o,{});Et(e,r,s),At(e,r,s.properties,s.measurements)}static sendAggregateSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,fE.Aggregate,{provider:r,source:l},{timeTakenMs:n,chunkCount:o,fileCount:s,workspaceCount:c})}static sendAggregateFailure(e,r){t.sendFailure(e,fE.Aggregate,r)}};var q1n=de(Sl()),j1n=de(nl()),RHt=de(FO());var iF=new fe("Remote Search"),gZe=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._localDiffSearch=n;this._githubCodeSearchService=o;this.id="codesearch";this.localDiffSearchTimeout=15e3}static{a(this,"CodeSearchChunkSearch")}async isAvailable(e){return(await this.getRepos(e)).length>0}async getRepos(e){if(!e?.length)return[];let r=this.ctx.get(_f),o=(await Promise.all(e.map(async c=>await r.getRepo({uri:c})))).filter(c=>c!==void 0).filter(c=>c.isGitHub()&&c.owner&&c.name),s=new Map;for(let c of o){let l=`${c.owner}/${c.name}`;s.has(l)||s.set(l,c)}return Array.from(s.values())}async searchWorkspace(e,r,n){let o=new RHt.StopWatch,s=await this.getRepos(r.workspaceFolders);if(iF.info(this.ctx,"Starting workspace search",{rawQuery:e.rawQuery,repoCount:s.length,repos:s.map(P=>`${P.owner}/${P.name}`),maxResults:PA(r)}),s.length===0)throw iF.error(this.ctx,"No GitHub repositories found"),f0.sendRemoteSkipped(this.ctx,"no_github_repos"),new Error("No GitHub repositories found in CodeSearchChunkSearch");let c=await this.ctx.get(Qt).getGitHubSession();if(!c)throw iF.error(this.ctx,"No GitHub session found"),f0.sendRemoteSkipped(this.ctx,"no_github_session"),new Error("No GitHub session found in CodeSearchChunkSearch");let l=await this._githubCodeSearchService.ensureReposIndexed(c,s,n);if(l.length===0)throw iF.error(this.ctx,"Remote index not ready for any repositories"),f0.sendRemoteSkipped(this.ctx,"remote_index_not_ready"),new Error("Remote index not ready");let u=PA(r),d=Promise.all(l.map(async P=>{Hh(n);let D=await e.resolveQuery(n),N=new RHt.StopWatch,L=await this._githubCodeSearchService.searchRepo(c,this._embeddingType,P,D,u,n);return iF.info(this.ctx,`Search completed for ${P.owner}/${P.name}`,{searchTime:N.elapsed(),chunkCount:L.chunks.length}),L})),f=await this._localDiffSearch.getLocalDiff(r.workspaceFolders),h=new Set(f),m=this._localDiffSearch.shouldDoLocalDiffSearch(f,r.workspaceFolders);iF.info(this.ctx,"Local diff files detected",{diffFileCount:f.length,allowLocalDiffSearch:m});let g;m&&(g=(0,j1n.raceTimeout)(this._localDiffSearch.searchLocalDiff(f,e,r,n),this.localDiffSearchTimeout,()=>{iF.warn(this.ctx,"Local diff search timed out",{timeout:this.localDiffSearchTimeout})}));let[A,y]=await Promise.all([d,g?.catch(P=>{iF.error(this.ctx,"Local diff search failed",P)})??Promise.resolve(void 0)]),E=(0,q1n.coalesce)(A).flatMap(P=>P.chunks),_=y?.isOk()?y.val.result.chunks:[],v=_.length>0?[...E.filter(P=>!h.has(P.chunk.file)),..._]:E,b=v.length,w=new Set(v.map(P=>P.chunk.file)).size,R=o.elapsed();iF.info(this.ctx,`Search completed successfully in ${R}ms`,{totalTime:R,totalChunkCount:b,uniqueFileCount:w,indexedRepoCount:l.length,localDiffChunkCount:_.length,localDiffStrategy:y?.isOk()?y.val.strategy:"none"});let x=y?.isOk()?"mixed":"codesearch";return f0.sendRemoteSuccess(this.ctx,R,b,w,x),{chunks:v}}};p();p();var FIn=require("node:url"),UIn=require("path");p();var DZe=de(G1n(),1);p();var kHt=new WeakMap;function Nue(...t){let e=new String(t);return kHt.set(e,t),e}a(Nue,"c");function ow(t){return t instanceof String&&kHt.has(t)}a(ow,"r");function Mue(t){return kHt.get(t)??[]}a(Mue,"o");var kZe=de(J1n(),1),xTn=require("child_process");var dIn=de(MHt(),1),CIn=require("node:path");p();function*Z1n(t,e){let r=e==="global";for(let n of t)n.isGlobal===r&&(yield n)}a(Z1n,"U");var EYo=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),_Yo=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),vYo=new Set(["edit","remove-section","rename-section","set","unset"]),CYo=new Set(["get","get-color","get-colorbool","list"]);function bYo(t,e){for(let{name:n}of Z1n(t,"task")){if(EYo.has(n))return Fue(!0,e);if(_Yo.has(n))return Fue(!1,e)}let r=e.at(0)?.toLowerCase();return r===void 0?null:vYo.has(r)?Fue(!0,e.slice(1)):CYo.has(r)?Fue(!1,e.slice(1)):e.length===1?Fue(!1,e):Fue(!0,e)}a(bYo,"F");function Fue(t=!1,e=[]){let r=e.at(0)?.toLowerCase();return r===void 0?null:{isWrite:t,isRead:!t,key:r,value:e.at(1)}}a(Fue,"p");function SYo(t,e){return e.isWrite&&e.value!==void 0?{key:e.key,value:e.value,scope:t}:{key:e.key,scope:t}}a(SYo,"A");function TYo(t){let e=t?.indexOf("=")||-1;return!t||e<0?null:{key:t.slice(0,e).trim().toLowerCase(),value:t.slice(e+1)}}a(TYo,"M");function IYo(t){for(let{name:e}of Z1n(t,"task"))switch(e){case"--global":return"global";case"--system":return"system";case"--worktree":return"worktree";case"--local":return"local";case"--file":case"-f":return"file"}return"local"}a(IYo,"N");function xYo({name:t}){if(t==="-c"||t==="--config")return"inline";if(t==="--config-env")return"env"}a(xYo,"G");function*wYo(t){for(let e of t){let r=xYo(e),n=r&&TYo(e.value);n&&(yield{...n,scope:r})}}a(wYo,"O");function RYo(t,e,r){let n={read:[],write:[...wYo(e)]};return t==="config"&&kYo(n,IYo(e),bYo(e,r)),n}a(RYo,"L");function kYo(t,e,r){if(r===null)return;let n=SYo(e,r);r.isWrite?t.write.push(n):t.read.push(n)}a(kYo,"$");var X1n={short:new Map([["c",!0]])},PYo={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...X1n.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},DYo={clone:{short:new Map([["b",!0],["j",!0],["l",!1],["n",!1],["o",!0],["q",!1],["s",!1],["u",!0]]),long:new Set(["branch","config","jobs","origin","upload-pack","u","template"])},commit:{short:new Map([["C",!0],["F",!0],["c",!0],["m",!0],["t",!0]]),long:new Set(["file","message","reedit-message","reuse-message","template"])},config:{short:new Map([["e",!1],["f",!0],["l",!1]]),long:new Set(["blob","comment","default","file","type","value"])},fetch:{short:new Map,long:new Set(["upload-pack"])},init:{short:new Map,long:new Set(["template"])},pull:{short:new Map,long:new Set(["upload-pack"])},push:{short:new Map,long:new Set(["exec","receive-pack"])}},NYo={short:new Map,long:new Set};function MYo(t){let e=DYo[t??""]??NYo;return{short:new Map([...X1n.short.entries(),...e.short.entries()]),long:e.long}}a(MYo,"I");function eSn(t,e=PYo){if(t.startsWith("--")){let r=t.indexOf("=");if(r>2)return[{name:t.slice(0,r),value:t.slice(r+1),needsNext:!1}];let n=t.slice(2);return[{name:t,needsNext:e.long.has(n)}]}if(t.length===2){let r=t.charAt(1),n=e.short.get(r);return[{name:t,needsNext:n===!0}]}return OYo(t,e.short)}a(eSn,"b");function OYo(t,e){let r=t.slice(1).split(""),n=[];for(let o=0;oe.has(u)))return n.push({name:`-${s}`,value:l,needsNext:!1}),n}n.push({name:`-${s}`,needsNext:c})}return n}a(OYo,"W");function LYo(t,e=[]){let r=0;for(;ra(function(){return t&&(e=(0,t[nGt(t)[0]])(t=0)),e},"__init"),"__esm"),JYo=a((t,e)=>a(function(){return e||(0,t[nGt(t)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),tm=a((t,e)=>{for(var r in e)rGt(t,r,{get:e[r],enumerable:!0})},"__export"),ZYo=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of nGt(e))!KYo.call(t,o)&&o!==r&&rGt(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=YYo(e,o))||n.enumerable});return t},"__copyProps"),rh=a(t=>ZYo(rGt({},"__esModule",{value:!0}),t),"__toCommonJS"),oF,Lq=Zr({"src/lib/errors/git-error.ts"(){"use strict";oF=class extends Error{static{a(this,"GitError")}constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),_we,jue=Zr({"src/lib/errors/git-response-error.ts"(){"use strict";Lq(),_we=class extends oF{static{a(this,"GitResponseError")}constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),LSn,BSn=Zr({"src/lib/errors/task-configuration-error.ts"(){"use strict";Lq(),LSn=class extends oF{static{a(this,"TaskConfigurationError")}constructor(t){super(void 0,t)}}}});function FSn(t){return typeof t!="function"?sJ:t}a(FSn,"asFunction");function USn(t){return typeof t=="function"&&t!==sJ}a(USn,"isUserFunction");function QSn(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}a(QSn,"splitOn");function qSn(t,e=0){return jSn(t)&&t.length>e?t[e]:void 0}a(qSn,"first");function oJ(t,e=0){if(jSn(t)&&t.length>e)return t[t.length-1-e]}a(oJ,"last");function jSn(t){return LZe(t)}a(jSn,"isArrayLike");function vwe(t="",e=!0,r=` -`){return t.split(r).reduce((n,o)=>{let s=e?o.trim():o;return s&&n.push(s),n},[])}a(vwe,"toLinesWithContent");function iGt(t,e){return vwe(t,!0).map(r=>e(r))}a(iGt,"forEachLineWithContent");function oGt(t){return(0,DZe.exists)(t,DZe.FOLDER)}a(oGt,"folderExists");function cw(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}a(cw,"append");function HSn(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}a(HSn,"including");function NZe(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}a(NZe,"remove");function jO(t){return Array.isArray(t)?t:[t]}a(jO,"asArray");function GSn(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}a(GSn,"asCamelCase");function Hue(t){return jO(t).map(e=>e instanceof String?e:String(e))}a(Hue,"asStringArray");function Eu(t,e=0){if(t==null)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}a(Eu,"asNumber");function ywe(t,e){let r=[];for(let n=0,o=t.length;n{t[n]!==void 0&&(r[n]=t[n])}),r}a($Sn,"pick");function qHt(t=0){return new Promise(e=>setTimeout(e,t))}a(qHt,"delay");function jHt(t){if(t!==!1)return t}a(jHt,"orVoid");var Que,sJ,Cwe,MZe=Zr({"src/lib/utils/util.ts"(){"use strict";sGt(),Que="\0",sJ=a(()=>{},"NOOP"),Cwe=Object.prototype.toString.call.bind(Object.prototype.toString)}});function pE(t,e,r){return e(t)?t:arguments.length>2?r:void 0}a(pE,"filterType");function HHt(t,e){let r=ow(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}a(HHt,"filterPrimitives");function OZe(t){return!!t&&Cwe(t)==="[object Object]"}a(OZe,"filterPlainObject");function VSn(t){return typeof t=="function"}a(VSn,"filterFunction");var bwe,WSn,lp,wZe,LZe,sGt=Zr({"src/lib/utils/argument-filters.ts"(){"use strict";MZe(),bwe=a(t=>Array.isArray(t),"filterArray"),WSn=a(t=>typeof t=="number","filterNumber"),lp=a(t=>typeof t=="string"||ow(t),"filterString"),wZe=a(t=>lp(t)||Array.isArray(t)&&t.every(lp),"filterStringOrStringArray"),LZe=a(t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number","filterHasLength")}}),GHt,XYo=Zr({"src/lib/utils/exit-codes.ts"(){"use strict";GHt=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(GHt||{})}}),RZe,eKo=Zr({"src/lib/utils/git-output-streams.ts"(){"use strict";RZe=class zSn{static{a(this,"_GitOutputStreams")}constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new zSn(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function tKo(){throw new Error("LineParser:useMatches not implemented")}a(tKo,"useMatchesDefault");var ko,Oq,rKo=Zr({"src/lib/utils/line-parser.ts"(){"use strict";ko=class{static{a(this,"LineParser")}constructor(t,e){this.matches=[],this.useMatches=tKo,this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((o,s)=>this.addMatch(o,s,r(s)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let n=r&&t.exec(r);return n&&this.pushMatch(e,n),!!n}pushMatch(t,e){this.matches.push(...e.slice(1))}},Oq=class extends ko{static{a(this,"RemoteLineParser")}addMatch(t,e,r){return/^remote:\s/.test(String(r))&&super.addMatch(t,e,r)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function YSn(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...KSn},...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}a(YSn,"createInstanceConfig");var KSn,nKo=Zr({"src/lib/utils/simple-git-options.ts"(){"use strict";KSn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function aGt(t,e=[]){return OZe(t)?Object.keys(t).reduce((r,n)=>{let o=t[n];if(ow(o))r.push(o);else if(HHt(o,["boolean"]))r.push(n+"="+o);else if(Array.isArray(o))for(let s of o)HHt(s,["string","number"])||r.push(n+"="+s);else r.push(n);return r},e):e}a(aGt,"appendTaskOptions");function J_(t,e=0,r=!1){let n=[];for(let o=0,s=e<0?t.length:e;o{for(let s=vwe(o,n),c=0,l=s.length;c{if(!(c+d>=l))return s[c+d]},"line");e.some(({parse:d})=>d(u,t))}}),t}a(JC,"parseStringResponse");var sKo=Zr({"src/lib/utils/task-parser.ts"(){"use strict";MZe()}}),JSn={};tm(JSn,{ExitCodes:a(()=>GHt,"ExitCodes"),GitOutputStreams:a(()=>RZe,"GitOutputStreams"),LineParser:a(()=>ko,"LineParser"),NOOP:a(()=>sJ,"NOOP"),NULL:a(()=>Que,"NULL"),RemoteLineParser:a(()=>Oq,"RemoteLineParser"),append:a(()=>cw,"append"),appendTaskOptions:a(()=>aGt,"appendTaskOptions"),asArray:a(()=>jO,"asArray"),asCamelCase:a(()=>GSn,"asCamelCase"),asFunction:a(()=>FSn,"asFunction"),asNumber:a(()=>Eu,"asNumber"),asStringArray:a(()=>Hue,"asStringArray"),bufferToString:a(()=>Ewe,"bufferToString"),callTaskParser:a(()=>$Ht,"callTaskParser"),createInstanceConfig:a(()=>YSn,"createInstanceConfig"),delay:a(()=>qHt,"delay"),filterArray:a(()=>bwe,"filterArray"),filterFunction:a(()=>VSn,"filterFunction"),filterHasLength:a(()=>LZe,"filterHasLength"),filterNumber:a(()=>WSn,"filterNumber"),filterPlainObject:a(()=>OZe,"filterPlainObject"),filterPrimitives:a(()=>HHt,"filterPrimitives"),filterString:a(()=>lp,"filterString"),filterStringOrStringArray:a(()=>wZe,"filterStringOrStringArray"),filterType:a(()=>pE,"filterType"),first:a(()=>qSn,"first"),folderExists:a(()=>oGt,"folderExists"),forEachLineWithContent:a(()=>iGt,"forEachLineWithContent"),getTrailingOptions:a(()=>J_,"getTrailingOptions"),including:a(()=>HSn,"including"),isUserFunction:a(()=>USn,"isUserFunction"),last:a(()=>oJ,"last"),objectToString:a(()=>Cwe,"objectToString"),orVoid:a(()=>jHt,"orVoid"),parseStringResponse:a(()=>JC,"parseStringResponse"),pick:a(()=>$Sn,"pick"),prefixedArray:a(()=>ywe,"prefixedArray"),remove:a(()=>NZe,"remove"),splitOn:a(()=>QSn,"splitOn"),toLinesWithContent:a(()=>vwe,"toLinesWithContent"),trailingFunctionArgument:a(()=>Qd,"trailingFunctionArgument"),trailingOptionsArgument:a(()=>cGt,"trailingOptionsArgument")});var oo=Zr({"src/lib/utils/index.ts"(){"use strict";sGt(),XYo(),eKo(),rKo(),nKo(),oKo(),sKo(),MZe()}}),ZSn={};tm(ZSn,{CheckRepoActions:a(()=>VHt,"CheckRepoActions"),checkIsBareRepoTask:a(()=>eTn,"checkIsBareRepoTask"),checkIsRepoRootTask:a(()=>XSn,"checkIsRepoRootTask"),checkIsRepoTask:a(()=>aKo,"checkIsRepoTask")});function aKo(t){switch(t){case"bare":return eTn();case"root":return XSn()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:BZe,parser:lGt}}a(aKo,"checkIsRepoTask");function XSn(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:BZe,parser(e){return/^\.(git)?$/.test(e.trim())}}}a(XSn,"checkIsRepoRootTask");function eTn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:BZe,parser:lGt}}a(eTn,"checkIsBareRepoTask");function cKo(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}a(cKo,"isNotRepoMessage");var VHt,BZe,lGt,tTn=Zr({"src/lib/tasks/check-is-repo.ts"(){"use strict";oo(),VHt=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(VHt||{}),BZe=a(({exitCode:t},e,r,n)=>{if(t===128&&cKo(e))return r(Buffer.from("false"));n(e)},"onError"),lGt=a(t=>t.trim()==="true","parser")}});function lKo(t,e){let r=new rTn(t),n=t?iTn:nTn;return vwe(e).forEach(o=>{let s=o.replace(n,"");r.paths.push(s),(oTn.test(s)?r.folders:r.files).push(s)}),r}a(lKo,"cleanSummaryParser");var rTn,nTn,iTn,oTn,uKo=Zr({"src/lib/responses/CleanSummary.ts"(){"use strict";oo(),rTn=class{static{a(this,"CleanResponse")}constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},nTn=/^[a-z]+\s*/i,iTn=/^[a-z]+\s+[a-z]+\s*/i,oTn=/\/$/}}),WHt={};tm(WHt,{EMPTY_COMMANDS:a(()=>FZe,"EMPTY_COMMANDS"),adhocExecTask:a(()=>sTn,"adhocExecTask"),configurationErrorTask:a(()=>KC,"configurationErrorTask"),isBufferTask:a(()=>cTn,"isBufferTask"),isEmptyTask:a(()=>lTn,"isEmptyTask"),straightThroughBufferTask:a(()=>aTn,"straightThroughBufferTask"),straightThroughStringTask:a(()=>Z_,"straightThroughStringTask")});function sTn(t){return{commands:FZe,format:"empty",parser:t}}a(sTn,"adhocExecTask");function KC(t){return{commands:FZe,format:"empty",parser(){throw typeof t=="string"?new LSn(t):t}}}a(KC,"configurationErrorTask");function Z_(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}a(Z_,"straightThroughStringTask");function aTn(t){return{commands:t,format:"buffer",parser(e){return e}}}a(aTn,"straightThroughBufferTask");function cTn(t){return t.format==="buffer"}a(cTn,"isBufferTask");function lTn(t){return t.format==="empty"||!t.commands.length}a(lTn,"isEmptyTask");var FZe,nh=Zr({"src/lib/tasks/task.ts"(){"use strict";BSn(),FZe=[]}}),uTn={};tm(uTn,{CONFIG_ERROR_INTERACTIVE_MODE:a(()=>uGt,"CONFIG_ERROR_INTERACTIVE_MODE"),CONFIG_ERROR_MODE_REQUIRED:a(()=>dGt,"CONFIG_ERROR_MODE_REQUIRED"),CONFIG_ERROR_UNKNOWN_OPTION:a(()=>fGt,"CONFIG_ERROR_UNKNOWN_OPTION"),CleanOptions:a(()=>SZe,"CleanOptions"),cleanTask:a(()=>dTn,"cleanTask"),cleanWithOptionsTask:a(()=>dKo,"cleanWithOptionsTask"),isCleanOptionsArray:a(()=>fKo,"isCleanOptionsArray")});function dKo(t,e){let{cleanMode:r,options:n,valid:o}=pKo(t);return r?o.options?(n.push(...e),n.some(gKo)?KC(uGt):dTn(r,n)):KC(fGt+JSON.stringify(t)):KC(dGt)}a(dKo,"cleanWithOptionsTask");function dTn(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(n){return lKo(t==="n",n)}}}a(dTn,"cleanTask");function fKo(t){return Array.isArray(t)&&t.every(e=>pGt.has(e))}a(fKo,"isCleanOptionsArray");function pKo(t){let e,r=[],n={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(o=>{hKo(o)?(e=o,n.cleanMode=!0):n.options=n.options&&mKo(r[r.length]=`-${o}`)}),{cleanMode:e,options:r,valid:n}}a(pKo,"getCleanOptions");function hKo(t){return t==="f"||t==="n"}a(hKo,"isCleanMode");function mKo(t){return/^-[a-z]$/i.test(t)&&pGt.has(t.charAt(1))}a(mKo,"isKnownOption");function gKo(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}a(gKo,"isInteractiveMode");var uGt,dGt,fGt,SZe,pGt,fTn=Zr({"src/lib/tasks/clean.ts"(){"use strict";uKo(),oo(),nh(),uGt="Git clean interactive mode is not supported",dGt='Git clean mode parameter ("n" or "f") is required',fGt="Git clean unknown option found in: ",SZe=(t=>(t.DRY_RUN="n",t.FORCE="f",t.IGNORED_INCLUDED="x",t.IGNORED_ONLY="X",t.EXCLUDING="e",t.QUIET="q",t.RECURSIVE="d",t))(SZe||{}),pGt=new Set(["i",...Hue(Object.values(SZe))])}});function AKo(t){let e=new hTn;for(let r of pTn(t))e.addValue(r.file,String(r.key),r.value);return e}a(AKo,"configListParser");function yKo(t,e){let r=null,n=[],o=new Map;for(let s of pTn(t,e))s.key===e&&(n.push(r=s.value),o.has(s.file)||o.set(s.file,[]),o.get(s.file).push(r));return{key:e,paths:Array.from(o.keys()),scopes:o,value:r,values:n}}a(yKo,"configGetParser");function EKo(t){return t.replace(/^(file):/,"")}a(EKo,"configFilePath");function*pTn(t,e=null){let r=t.split("\0");for(let n=0,o=r.length-1;nObject.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=oJ(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let n=this.addFile(t);Object.hasOwn(n,e)?Array.isArray(n[e])?n[e].push(r):n[e]=[n[e],r]:n[e]=r,this._all=void 0}}}});function OHt(t,e){return typeof t=="string"&&Object.hasOwn(zHt,t)?t:e}a(OHt,"asConfigScope");function vKo(t,e,r,n){let o=["config",`--${n}`];return r&&o.push("--add"),o.push(t,e),{commands:o,format:"utf-8",parser(s){return s}}}a(vKo,"addConfigTask");function CKo(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(n){return yKo(n,t)}}}a(CKo,"getConfigTask");function bKo(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return AKo(r)}}}a(bKo,"listConfigTask");function SKo(){return{addConfig(t,e,...r){return this._runTask(vKo(t,e,r[0]===!0,OHt(r[1],"local")),Qd(arguments))},getConfig(t,e){return this._runTask(CKo(t,OHt(e,void 0)),Qd(arguments))},listConfig(...t){return this._runTask(bKo(OHt(t[0],void 0)),Qd(arguments))}}}a(SKo,"config_default");var zHt,mTn=Zr({"src/lib/tasks/config.ts"(){"use strict";_Ko(),oo(),zHt=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(zHt||{})}});function TKo(t){return gTn.has(t)}a(TKo,"isDiffNameStatus");var LHt,gTn,ATn=Zr({"src/lib/tasks/diff-name-status.ts"(){"use strict";LHt=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))(LHt||{}),gTn=new Set(Object.values(LHt))}});function IKo(...t){return new ETn().param(...t)}a(IKo,"grepQueryBuilder");function xKo(t){let e=new Set,r={};return iGt(t,n=>{let[o,s,c]=n.split(Que);e.add(o),(r[o]=r[o]||[]).push({line:Eu(s),path:o,preview:c})}),{paths:e,results:r}}a(xKo,"parseGrep");function wKo(){return{grep(t){let e=Qd(arguments),r=J_(arguments);for(let o of yTn)if(r.includes(o))return this._runTask(KC(`git.grep: use of "${o}" is not supported.`),e);typeof t=="string"&&(t=IKo().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(o){return xKo(o)}},e)}}}a(wKo,"grep_default");var yTn,Awe,oSn,ETn,_Tn=Zr({"src/lib/tasks/grep.ts"(){"use strict";oo(),nh(),yTn=["-h"],Awe=Symbol("grepQuery"),ETn=class{static{a(this,"GrepQuery")}constructor(){this[oSn]=[]}*[(oSn=Awe,Symbol.iterator)](){for(let t of this[Awe])yield t}and(...t){return t.length&&this[Awe].push("--and","(",...ywe(t,"-e"),")"),this}param(...t){return this[Awe].push(...ywe(t,"-e")),this}}}}),vTn={};tm(vTn,{ResetMode:a(()=>TZe,"ResetMode"),getResetMode:a(()=>kKo,"getResetMode"),resetTask:a(()=>RKo,"resetTask")});function RKo(t,e){let r=["reset"];return CTn(t)&&r.push(`--${t}`),r.push(...e),Z_(r)}a(RKo,"resetTask");function kKo(t){if(CTn(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}a(kKo,"getResetMode");function CTn(t){return typeof t=="string"&&bTn.includes(t)}a(CTn,"isValidResetMode");var TZe,bTn,STn=Zr({"src/lib/tasks/reset.ts"(){"use strict";oo(),nh(),TZe=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(TZe||{}),bTn=Hue(Object.values(TZe))}});function PKo(){return(0,kZe.default)("simple-git")}a(PKo,"createLog");function sSn(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(n,...o)=>{t(n,...o),r(n,...o)}:t:(n,...o)=>{t(`%s ${n}`,e,...o),r&&r(n,...o)}}a(sSn,"prefixedLogger");function DKo(t,e,{namespace:r}){if(typeof t=="string")return t;let n=e&&e.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}a(DKo,"childLoggerName");function hGt(t,e,r,n=PKo()){let o=t&&`[${t}]`||"",s=[],c=typeof e=="string"?n.extend(e):e,l=DKo(pE(e,lp),c,n);return d(r);function u(f,h){return cw(s,hGt(t,l.replace(/^[^:]+/,f),h,n))}function d(f){let h=f&&`[${f}]`||"",m=c&&sSn(c,h)||sJ,g=sSn(n,`${o} ${h}`,m);return Object.assign(c?m:g,{label:t,sibling:u,info:g,step:d})}}a(hGt,"createLogger");var TTn=Zr({"src/lib/git-logger.ts"(){"use strict";oo(),kZe.default.formatters.L=t=>String(LZe(t)?t.length:"-"),kZe.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):Cwe(t)}}),ITn,NKo=Zr({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";Lq(),TTn(),ITn=class YHt{static{a(this,"_TasksPendingQueue")}constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let r=YHt.getName(e.commands[0]),n=hGt(this.logLabel,r);return{task:e,logger:n,name:r}}push(e){let r=this.createProgress(e);return r.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,r),r}fatal(e){for(let[r,{logger:n}]of Array.from(this._queue.entries()))r===e.task?(n.info("Failed %o",e),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(r);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let r=this.withProgress(e);if(!r)throw new oF(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(e="empty"){return`task:${e}:${++YHt.counter}`}static{this.counter=0}}}});function iJ(t,e){return{method:qSn(t.commands)||"",commands:e}}a(iJ,"pluginContext");function MKo(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}a(MKo,"onErrorReceived");function aSn(t,e,r,n){return o=>{r("%s received %L bytes",e,o),n("%B",o),t.push(o)}}a(aSn,"onDataReceived");var KHt,OKo=Zr({"src/lib/runners/git-executor-chain.ts"(){"use strict";Lq(),nh(),oo(),NKo(),KHt=class{static{a(this,"GitExecutorChain")}constructor(t,e,r){this._executor=t,this._scheduler=e,this._plugins=r,this._chain=Promise.resolve(),this._queue=new ITn}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){return this._queue.push(t),this._chain=this._chain.then(()=>this.attemptTask(t))}async attemptTask(t){let e=await this._scheduler.next(),r=a(()=>this._queue.complete(t),"onQueueComplete");try{let{logger:n}=this._queue.attempt(t);return await(lTn(t)?this.attemptEmptyTask(t,n):this.attemptRemoteTask(t,n))}catch(n){throw this.onFatalException(t,n)}finally{r(),e()}}onFatalException(t,e){let r=e instanceof oF?Object.assign(e,{task:t}):new oF(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(t,e){let r=this._plugins.exec("spawn.binary","",iJ(t,t.commands)),n=this._plugins.exec("spawn.args",[...t.commands],{...iJ(t,t.commands),env:{...this.env}}),o=await this.gitResponse(t,r,n,this.outputHandler,e.step("SPAWN")),s=await this.handleTaskData(t,n,o,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),cTn(t)?$Ht(t.parser,s):$Ht(t.parser,s.asStrings())}async attemptEmptyTask(t,e){return e("empty task bypassing child process to call to task's parser"),t.parser(this)}handleTaskData(t,e,r,n){let{exitCode:o,rejection:s,stdOut:c,stdErr:l}=r;return new Promise((u,d)=>{n("Preparing to handle process response exitCode=%d stdOut=",o);let{error:f}=this._plugins.exec("task.error",{error:s},{...iJ(t,e),...r});if(f&&t.onError)return n.info("exitCode=%s handling with custom error handler"),t.onError(r,f,h=>{n.info("custom error handler treated as success"),n("custom error returned a %s",Cwe(h)),u(new RZe(Array.isArray(h)?Buffer.concat(h):h,Buffer.concat(l)))},d);if(f)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",o,l.length,s),d(f);n.info("retrieving task output complete"),u(new RZe(Buffer.concat(c),Buffer.concat(l)))})}async gitResponse(t,e,r,n,o){let s=o.sibling("output"),c=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},iJ(t,t.commands));return new Promise(l=>{let u=[],d=[];o.info("%s %o",e,r),o("%O",c);let f=this._beforeSpawn(t,r);if(f)return l({stdOut:u,stdErr:d,exitCode:9901,rejection:f});this._plugins.exec("spawn.before",void 0,{...iJ(t,r),kill(m){f=m||f}});let h=(0,xTn.spawn)(e,r,c);h.stdout.on("data",aSn(u,"stdOut",o,s.step("stdOut"))),h.stderr.on("data",aSn(d,"stdErr",o,s.step("stdErr"))),h.on("error",MKo(d,o)),n&&(o("Passing child process stdOut/stdErr to custom outputHandler"),n(e,h.stdout,h.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...iJ(t,r),spawned:h,close(m,g){l({stdOut:u,stdErr:d,exitCode:m,rejection:f||g})},kill(m){h.killed||(f=m,h.kill("SIGINT"))}})})}_beforeSpawn(t,e){let r;return this._plugins.exec("spawn.before",void 0,{...iJ(t,e),kill(n){r=n||r}}),r}}}}),wTn={};tm(wTn,{GitExecutor:a(()=>RTn,"GitExecutor")});var RTn,LKo=Zr({"src/lib/runners/git-executor.ts"(){"use strict";OKo(),RTn=class{static{a(this,"GitExecutor")}constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new KHt(this,this._scheduler,this._plugins)}chain(){return new KHt(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function BKo(t,e,r=sJ){let n=a(s=>{r(null,s)},"onSuccess"),o=a(s=>{s?.task===t&&r(s instanceof _we?FKo(s):s,void 0)},"onError2");e.then(n,o)}a(BKo,"taskCallback");function FKo(t){let e=a(n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),e=sJ},"log");return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(r,{}));function r(n,o){return o in t||(n[o]={enumerable:!1,configurable:!1,get(){return e(o),t.git[o]}}),n}}a(FKo,"addDeprecationNoticeToError");var UKo=Zr({"src/lib/task-callback.ts"(){"use strict";jue(),oo()}});function cSn(t,e){return sTn(r=>{if(!oGt(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}a(cSn,"changeWorkingDirectoryTask");var QKo=Zr({"src/lib/tasks/change-working-directory.ts"(){"use strict";oo(),nh()}});function BHt(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=NZe(e,"-B")),Z_(e)}a(BHt,"checkoutTask");function qKo(){return{checkout(){return this._runTask(BHt(J_(arguments,1)),Qd(arguments))},checkoutBranch(t,e){return this._runTask(BHt(["-b",t,e,...J_(arguments)]),Qd(arguments))},checkoutLocalBranch(t){return this._runTask(BHt(["-b",t,...J_(arguments)]),Qd(arguments))}}}a(qKo,"checkout_default");var jKo=Zr({"src/lib/tasks/checkout.ts"(){"use strict";oo(),nh()}});function HKo(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}a(HKo,"countObjectsResponse");function GKo(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return JC(HKo(),[kTn],t)}})}}}a(GKo,"count_objects_default");var kTn,$Ko=Zr({"src/lib/tasks/count-objects.ts"(){"use strict";oo(),kTn=new ko(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let n=GSn(e);Object.hasOwn(t,n)&&(t[n]=Eu(r))})}});function VKo(t){return JC({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},PTn,t)}a(VKo,"parseCommitResult");var PTn,WKo=Zr({"src/lib/parsers/parse-commit.ts"(){"use strict";oo(),PTn=[new ko(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,n])=>{t.branch=e,t.commit=n,t.root=!!r}),new ko(/\s*Author:\s(.+)/i,(t,[e])=>{let r=e.split("<"),n=r.pop();!n||!n.includes("@")||(t.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new ko(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(r,10)||0,t.summary.deletions=parseInt(n,10)||0}),new ko(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0;let o=parseInt(r,10)||0;n==="-"?t.summary.deletions=o:n==="+"&&(t.summary.insertions=o)})]}});function zKo(t,e,r){return{commands:["-c","core.abbrev=40","commit",...ywe(t,"-m"),...e,...r],format:"utf-8",parser:VKo}}a(zKo,"commitTask");function YKo(){return{commit(e,...r){let n=Qd(arguments),o=t(e)||zKo(jO(e),jO(pE(r[0],wZe,[])),[...Hue(pE(r[1],bwe,[])),...J_(arguments,0,!0)]);return this._runTask(o,n)}};function t(e){return!wZe(e)&&KC("git.commit: requires the commit message to be supplied as a string/string[]")}}a(YKo,"commit_default");var KKo=Zr({"src/lib/tasks/commit.ts"(){"use strict";WKo(),oo(),nh()}});function JKo(){return{firstCommit(){return this._runTask(Z_(["rev-list","--max-parents=0","HEAD"],!0),Qd(arguments))}}}a(JKo,"first_commit_default");var ZKo=Zr({"src/lib/tasks/first-commit.ts"(){"use strict";oo(),nh()}});function XKo(t,e){let r=["hash-object",t];return e&&r.push("-w"),Z_(r,!0)}a(XKo,"hashObjectTask");var eJo=Zr({"src/lib/tasks/hash-object.ts"(){"use strict";nh()}});function tJo(t,e,r){let n=String(r).trim(),o;if(o=DTn.exec(n))return new IZe(t,e,!1,o[1]);if(o=NTn.exec(n))return new IZe(t,e,!0,o[1]);let s="",c=n.split(" ");for(;c.length;)if(c.shift()==="in"){s=c.join(" ");break}return new IZe(t,e,/^re/i.test(n),s)}a(tJo,"parseInit");var IZe,DTn,NTn,rJo=Zr({"src/lib/responses/InitSummary.ts"(){"use strict";IZe=class{static{a(this,"InitSummary")}constructor(t,e,r,n){this.bare=t,this.path=e,this.existing=r,this.gitDir=n}},DTn=/^Init.+ repository in (.+)$/,NTn=/^Rein.+ in (.+)$/}});function nJo(t){return t.includes(mGt)}a(nJo,"hasBareCommand");function iJo(t=!1,e,r){let n=["init",...r];return t&&!nJo(n)&&n.splice(1,0,mGt),{commands:n,format:"utf-8",parser(o){return tJo(n.includes("--bare"),e,o)}}}a(iJo,"initTask");var mGt,oJo=Zr({"src/lib/tasks/init.ts"(){"use strict";rJo(),mGt="--bare"}});function gGt(t){for(let e=0;eJC(new MTn,e,r,!1)}a(OTn,"getDiffParser");var FHt,lSn,uSn,dSn,LTn,BTn=Zr({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";Swe(),aJo(),ATn(),oo(),FHt=[new ko(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,n=""])=>{t.files.push({file:e.trim(),changes:Eu(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new ko(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,n])=>{t.files.push({file:e.trim(),before:Eu(r),after:Eu(n),binary:!0})}),new ko(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let n=/(\d+) i/.exec(r),o=/(\d+) d/.exec(r);t.changed=Eu(e),t.insertions=Eu(n?.[1]),t.deletions=Eu(o?.[1])})],lSn=[new ko(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,n])=>{let o=Eu(e),s=Eu(r);t.changed++,t.insertions+=o,t.deletions+=s,t.files.push({file:n,changes:o+s,insertions:o,deletions:s,binary:!1})}),new ko(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],uSn=[new ko(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],dSn=[new ko(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,r,n,o,s])=>{t.changed++,t.files.push({file:s??n,changes:0,insertions:0,deletions:0,binary:!1,status:jHt(TKo(e)&&e),from:jHt(!!s&&n!==s&&n),similarity:Eu(r)})})],LTn={"":FHt,"--stat":FHt,"--numstat":lSn,"--name-status":dSn,"--name-only":uSn}}});function cJo(t,e){return e.reduce((r,n,o)=>(r[n]=t[o]||"",r),Object.create({diff:null}))}a(cJo,"lineBuilder");function FTn(t=_Gt,e=UTn,r=""){let n=OTn(r);return function(o){let s=vwe(o.trim(),!1,yGt).map(function(c){let l=c.split(EGt),u=cJo(l[0].split(t),e);return l.length>1&&l[1].trim()&&(u.diff=n(l[1])),u});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}a(FTn,"createListLogSummaryParser");var yGt,EGt,_Gt,UTn,QTn=Zr({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";oo(),BTn(),Swe(),yGt="\xF2\xF2\xF2\xF2\xF2\xF2 ",EGt=" \xF2\xF2",_Gt=" \xF2 ",UTn=["hash","date","message","refs","author_name","author_email"]}}),qTn={};tm(qTn,{diffSummaryTask:a(()=>lJo,"diffSummaryTask"),validateLogFormatConfig:a(()=>UZe,"validateLogFormatConfig")});function lJo(t){let e=gGt(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),UZe(r)||{commands:r,format:"utf-8",parser:OTn(e)}}a(lJo,"diffSummaryTask");function UZe(t){let e=t.filter(sJo);if(e.length>1)return KC(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return KC(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}a(UZe,"validateLogFormatConfig");var vGt=Zr({"src/lib/tasks/diff.ts"(){"use strict";Swe(),BTn(),nh()}});function uJo(t,e){let r=[],n=[];return Object.keys(t).forEach(o=>{r.push(o),n.push(String(t[o]))}),[r,n.join(e)]}a(uJo,"prettyFormat");function dJo(t){return Object.keys(t).reduce((e,r)=>(r in JHt||(e[r]=t[r]),e),{})}a(dJo,"userOptions");function jTn(t={},e=[]){let r=pE(t.splitter,lp,_Gt),n=OZe(t.format)?t.format:{hash:"%H",date:t.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:t.mailMap!==!1?"%aN":"%an",author_email:t.mailMap!==!1?"%aE":"%ae"},[o,s]=uJo(n,r),c=[],l=[`--pretty=format:${yGt}${s}${EGt}`,...e],u=t.n||t["max-count"]||t.maxCount;if(u&&l.push(`--max-count=${u}`),t.from||t.to){let d=t.symmetric!==!1?"...":"..";c.push(`${t.from||""}${d}${t.to||""}`)}return lp(t.file)&&l.push("--follow",Nue(t.file)),aGt(dJo(t),l),{fields:o,splitter:r,commands:[...l,...c]}}a(jTn,"parseLogOptions");function fJo(t,e,r){let n=FTn(t,e,gGt(r));return{commands:["log",...r],format:"utf-8",parser:n}}a(fJo,"logTask");function pJo(){return{log(...r){let n=Qd(arguments),o=jTn(cGt(arguments),Hue(pE(arguments[0],bwe,[]))),s=e(...r)||UZe(o.commands)||t(o);return this._runTask(s,n)}};function t(r){return fJo(r.splitter,r.fields,r.commands)}function e(r,n){return lp(r)&&lp(n)&&KC("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}a(pJo,"log_default");var JHt,HTn=Zr({"src/lib/tasks/log.ts"(){"use strict";Swe(),QTn(),oo(),nh(),vGt(),JHt=(t=>(t[t["--pretty"]=0]="--pretty",t[t["max-count"]=1]="max-count",t[t.maxCount=2]="maxCount",t[t.n=3]="n",t[t.file=4]="file",t[t.format=5]="format",t[t.from=6]="from",t[t.to=7]="to",t[t.splitter=8]="splitter",t[t.symmetric=9]="symmetric",t[t.mailMap=10]="mailMap",t[t.multiLine=11]="multiLine",t[t.strictDate=12]="strictDate",t))(JHt||{})}}),xZe,GTn,hJo=Zr({"src/lib/responses/MergeSummary.ts"(){"use strict";xZe=class{static{a(this,"MergeSummaryConflict")}constructor(t,e=null,r){this.reason=t,this.file=e,this.meta=r}toString(){return`${this.file}:${this.reason}`}},GTn=class{static{a(this,"MergeSummaryDetail")}constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),ZHt,$Tn,mJo=Zr({"src/lib/responses/PullSummary.ts"(){"use strict";ZHt=class{static{a(this,"PullSummary")}constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},$Tn=class{static{a(this,"PullFailedSummary")}constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function UHt(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}a(UHt,"objectEnumerationResult");function fSn(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:Eu(e&&e[1]||"0"),delta:Eu(r&&r[1]||"0")}}a(fSn,"asObjectCount");var VTn,gJo=Zr({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";oo(),VTn=[new Oq(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=UHt(t.remoteMessages);Object.assign(o,{[n]:Eu(r)})}),new Oq(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=UHt(t.remoteMessages);Object.assign(o,{[n]:Eu(r)})}),new Oq(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,n])=>{let o=UHt(t.remoteMessages);o.total=fSn(e),o.reused=fSn(r),o.packReused=Eu(n)})]}});function WTn(t,e){return JC({remoteMessages:new YTn},zTn,e)}a(WTn,"parseRemoteMessages");var zTn,YTn,KTn=Zr({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";oo(),gJo(),zTn=[new Oq(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...VTn,new Oq([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new Oq([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,n])=>{t.remoteMessages.vulnerabilities={count:Eu(e),summary:r,url:n}})],YTn=class{static{a(this,"RemoteMessageSummary")}constructor(){this.all=[]}}}});function AJo(t,e){let r=JC(new $Tn,JTn,[t,e]);return r.message&&r}a(AJo,"parsePullErrorResult");var pSn,hSn,mSn,gSn,JTn,ASn,CGt,ZTn=Zr({"src/lib/parsers/parse-pull.ts"(){"use strict";mJo(),oo(),KTn(),pSn=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,hSn=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,mSn=/^(create|delete) mode \d+ (.+)/,gSn=[new ko(pSn,(t,[e,r,n])=>{t.files.push(e),r&&(t.insertions[e]=r.length),n&&(t.deletions[e]=n.length)}),new ko(hSn,(t,[e,,r,,n])=>r!==void 0||n!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+r||0,t.summary.deletions=+n||0,!0):!1),new ko(mSn,(t,[e,r])=>{cw(t.files,r),cw(e==="create"?t.created:t.deleted,r)})],JTn=[new ko(/^from\s(.+)$/i,(t,[e])=>{t.remote=e}),new ko(/^fatal:\s(.+)$/,(t,[e])=>{t.message=e}),new ko(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,r,n,o])=>{t.branch.local=n,t.hash.local=e,t.branch.remote=o,t.hash.remote=r})],ASn=a((t,e)=>JC(new ZHt,gSn,[t,e]),"parsePullDetail"),CGt=a((t,e)=>Object.assign(new ZHt,ASn(t,e),WTn(t,e)),"parsePullResult")}}),ySn,XTn,ESn,yJo=Zr({"src/lib/parsers/parse-merge.ts"(){"use strict";hJo(),oo(),ZTn(),ySn=[new ko(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new ko(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new xZe(e,r))}),new ko(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,n])=>{t.conflicts.push(new xZe(e,r,{deleteRef:n}))}),new ko(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new xZe(e,null))}),new ko(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],XTn=a((t,e)=>Object.assign(ESn(t,e),CGt(t,e)),"parseMergeResult"),ESn=a(t=>JC(new GTn,ySn,t),"parseMergeDetail")}});function _Sn(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let n=XTn(e,r);if(n.failed)throw new _we(n);return n}}:KC("Git.merge requires at least one option")}a(_Sn,"mergeTask");var EJo=Zr({"src/lib/tasks/merge.ts"(){"use strict";jue(),yJo(),nh()}});function _Jo(t,e,r){let n=r.includes("deleted"),o=r.includes("tag")||/^refs\/tags/.test(t),s=!r.includes("new");return{deleted:n,tag:o,branch:!o,new:!s,alreadyUpdated:s,local:t,remote:e}}a(_Jo,"pushResultPushedItem");var vSn,eIn,CSn,vJo=Zr({"src/lib/parsers/parse-push.ts"(){"use strict";oo(),KTn(),vSn=[new ko(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new ko(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new ko(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,n])=>{t.pushed.push(_Jo(e,r,n))}),new ko(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,n])=>{t.branch={...t.branch||{},local:e,remote:r,remoteName:n}}),new ko(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,r,n,o])=>{t.update={head:{local:e,remote:r},hash:{from:n,to:o}}})],eIn=a((t,e)=>{let r=CSn(t,e),n=WTn(t,e);return{...r,...n}},"parsePushResult"),CSn=a((t,e)=>JC({pushed:[]},vSn,[t,e]),"parsePushDetail")}}),tIn={};tm(tIn,{pushTagsTask:a(()=>CJo,"pushTagsTask"),pushTask:a(()=>bGt,"pushTask")});function CJo(t={},e){return cw(e,"--tags"),bGt(t,e)}a(CJo,"pushTagsTask");function bGt(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),NZe(r,"-v"),cw(r,"--verbose"),cw(r,"--porcelain"),{commands:r,format:"utf-8",parser:eIn}}a(bGt,"pushTask");var rIn=Zr({"src/lib/tasks/push.ts"(){"use strict";vJo(),oo()}});function bJo(){return{showBuffer(){let t=["show",...J_(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(aTn(t),Qd(arguments))},show(){let t=["show",...J_(arguments,1)];return this._runTask(Z_(t),Qd(arguments))}}}a(bJo,"show_default");var SJo=Zr({"src/lib/tasks/show.ts"(){"use strict";oo(),nh()}}),bSn,nIn,TJo=Zr({"src/lib/responses/FileStatusSummary.ts"(){"use strict";bSn=/^(.+)\0(.+)$/,nIn=class{static{a(this,"FileStatusSummary")}constructor(t,e,r){if(this.path=t,this.index=e,this.working_dir=r,e==="R"||r==="R"){let n=bSn.exec(t)||[null,t,t];this.from=n[2]||"",this.path=n[1]||""}}}}});function SSn(t){let[e,r]=t.split(Que);return{from:r||e,to:e}}a(SSn,"renamedFile");function XS(t,e,r){return[`${t}${e}`,r]}a(XS,"parser3");function QHt(t,...e){return e.map(r=>XS(t,r,(n,o)=>n.conflicted.push(o)))}a(QHt,"conflicts");function IJo(t,e){let r=e.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.slice(3));case r.charAt(1):return n(" ",r.charAt(0),r.slice(2));default:return}function n(o,s,c){let l=`${o}${s}`,u=iIn.get(l);u&&u(t,c),l!=="##"&&l!=="!!"&&t.files.push(new nIn(c,o,s))}a(n,"data")}a(IJo,"splitLine");var TSn,iIn,oIn,xJo=Zr({"src/lib/responses/StatusSummary.ts"(){"use strict";oo(),TJo(),TSn=class{static{a(this,"StatusSummary")}constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},iIn=new Map([XS(" ","A",(t,e)=>t.created.push(e)),XS(" ","D",(t,e)=>t.deleted.push(e)),XS(" ","M",(t,e)=>t.modified.push(e)),XS("A"," ",(t,e)=>{t.created.push(e),t.staged.push(e)}),XS("A","M",(t,e)=>{t.created.push(e),t.staged.push(e),t.modified.push(e)}),XS("D"," ",(t,e)=>{t.deleted.push(e),t.staged.push(e)}),XS("M"," ",(t,e)=>{t.modified.push(e),t.staged.push(e)}),XS("M","M",(t,e)=>{t.modified.push(e),t.staged.push(e)}),XS("R"," ",(t,e)=>{t.renamed.push(SSn(e))}),XS("R","M",(t,e)=>{let r=SSn(e);t.renamed.push(r),t.modified.push(r.to)}),XS("!","!",(t,e)=>{(t.ignored=t.ignored||[]).push(e)}),XS("?","?",(t,e)=>t.not_added.push(e)),...QHt("A","A","U"),...QHt("D","D","U"),...QHt("U","A","D","U"),["##",(t,e)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,o=/^(.+?(?=(?:\.{3}|\s|$)))/,s=/\.{3}(\S*)/,c=/\son\s(\S+?)(?=\.{3}|$)/,l=r.exec(e);t.ahead=l&&+l[1]||0,l=n.exec(e),t.behind=l&&+l[1]||0,l=o.exec(e),t.current=pE(l?.[1],lp,null),l=s.exec(e),t.tracking=pE(l?.[1],lp,null),l=c.exec(e),l&&(t.current=pE(l?.[1],lp,t.current)),t.detached=/\(no branch\)/.test(e)}]]),oIn=a(function(t){let e=t.split(Que),r=new TSn;for(let n=0,o=e.length;n!sIn.includes(r))],parser(r){return oIn(r)}}}a(wJo,"statusTask");var sIn,RJo=Zr({"src/lib/tasks/status.ts"(){"use strict";xJo(),sIn=["--null","-z"]}});function PZe(t=0,e=0,r=0,n="",o=!0){return Object.defineProperty({major:t,minor:e,patch:r,agent:n,installed:o},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}a(PZe,"versionResponse");function kJo(){return PZe(0,0,0,"",!1)}a(kJo,"notInstalledResponse");function PJo(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:DJo,onError(t,e,r,n){if(t.exitCode===-2)return r(Buffer.from(SGt));n(e)}})}}}a(PJo,"version_default");function DJo(t){return t===SGt?kJo():JC(PZe(0,0,0,t),aIn,t)}a(DJo,"versionParser");var SGt,aIn,NJo=Zr({"src/lib/tasks/version.ts"(){"use strict";oo(),SGt="installed=false",aIn=[new ko(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,n,o=""])=>{Object.assign(t,PZe(Eu(e),Eu(r),Eu(n),o))}),new ko(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,n,o=""])=>{Object.assign(t,PZe(Eu(e),Eu(r),n,o))})]}});function ISn(t,e,r,...n){return lp(r)?e(r,pE(n[0],lp),J_(arguments)):KC(`git.${t}() requires a string 'repoPath'`)}a(ISn,"createCloneTask");function MJo(){return{clone(t,...e){return this._runTask(ISn("clone",XHt,pE(t,lp),...e),Qd(arguments))},mirror(t,...e){return this._runTask(ISn("mirror",cIn,pE(t,lp),...e),Qd(arguments))}}}a(MJo,"clone_default");var XHt,cIn,OJo=Zr({"src/lib/tasks/clone.ts"(){"use strict";nh(),oo(),XHt=a((t,e,r)=>{let n=["clone",...r];return lp(t)&&n.push(Nue(t)),lp(e)&&n.push(Nue(e)),Z_(n)},"cloneTask"),cIn=a((t,e,r)=>(cw(r,"--mirror"),XHt(t,e,r)),"cloneMirrorTask")}}),lIn={};tm(lIn,{SimpleGitApi:a(()=>eGt,"SimpleGitApi")});var eGt,LJo=Zr({"src/lib/simple-git-api.ts"(){"use strict";UKo(),QKo(),jKo(),$Ko(),KKo(),mTn(),ZKo(),_Tn(),eJo(),oJo(),HTn(),EJo(),rIn(),SJo(),RJo(),nh(),NJo(),oo(),OJo(),eGt=class{static{a(this,"SimpleGitApi")}constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),n=r.push(t);return e&&BKo(t,n,e),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(t){return this._runTask(Z_(["add",...jO(t)]),Qd(arguments))}cwd(t){let e=Qd(arguments);return typeof t=="string"?this._runTask(cSn(t,this._executor),e):typeof t?.path=="string"?this._runTask(cSn(t.path,t.root&&this._executor||void 0),e):this._runTask(KC("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(XKo(t,e===!0),Qd(arguments))}init(t){return this._runTask(iJo(t===!0,this._executor.cwd,J_(arguments)),Qd(arguments))}merge(){return this._runTask(_Sn(J_(arguments)),Qd(arguments))}mergeFromTo(t,e){return lp(t)&&lp(e)?this._runTask(_Sn([t,e,...J_(arguments)]),Qd(arguments,!1)):this._runTask(KC("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=bGt({remote:pE(arguments[0],lp),branch:pE(arguments[1],lp)},J_(arguments));return this._runTask(t,Qd(arguments))}stash(){return this._runTask(Z_(["stash",...J_(arguments)]),Qd(arguments))}status(){return this._runTask(wJo(J_(arguments)),Qd(arguments))}},Object.assign(eGt.prototype,qKo(),MJo(),YKo(),SKo(),GKo(),JKo(),wKo(),pJo(),bJo(),PJo())}}),uIn={};tm(uIn,{Scheduler:a(()=>fIn,"Scheduler")});var xSn,fIn,BJo=Zr({"src/lib/runners/scheduler.ts"(){"use strict";oo(),TTn(),xSn=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,dIn.createDeferred)();return{promise:e,done:r,id:t}}})(),fIn=class{static{a(this,"Scheduler")}constructor(t=2){this.concurrency=t,this.logger=hGt("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",t)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let t=cw(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),NZe(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=cw(this.pending,xSn());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),pIn={};tm(pIn,{applyPatchTask:a(()=>FJo,"applyPatchTask")});function FJo(t,e){return Z_(["apply",...e,...t])}a(FJo,"applyPatchTask");var UJo=Zr({"src/lib/tasks/apply-patch.ts"(){"use strict";nh()}});function QJo(t,e){return{branch:t,hash:e,success:!0}}a(QJo,"branchDeletionSuccess");function qJo(t){return{branch:t,hash:null,success:!1}}a(qJo,"branchDeletionFailure");var hIn,jJo=Zr({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";hIn=class{static{a(this,"BranchDeletionBatch")}constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function mIn(t,e){return e===1&&tGt.test(t)}a(mIn,"hasBranchDeletionError");var wSn,tGt,RSn,QZe,HJo=Zr({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";jJo(),oo(),wSn=/(\S+)\s+\(\S+\s([^)]+)\)/,tGt=/^error[^']+'([^']+)'/m,RSn=[new ko(wSn,(t,[e,r])=>{let n=QJo(e,r);t.all.push(n),t.branches[e]=n}),new ko(tGt,(t,[e])=>{let r=qJo(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],QZe=a((t,e)=>JC(new hIn,RSn,[t,e]),"parseBranchDeletions")}}),gIn,GJo=Zr({"src/lib/responses/BranchSummary.ts"(){"use strict";gIn=class{static{a(this,"BranchSummaryResult")}constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,r,n,o){t==="*"&&(this.detached=e,this.current=r),this.all.push(r),this.branches[r]={current:t==="*",linkedWorkTree:t==="+",name:r,commit:n,label:o}}}}});function kSn(t){return t?t.charAt(0):""}a(kSn,"branchStatus");function AIn(t,e=!1){return JC(new gIn,e?[EIn]:yIn,t)}a(AIn,"parseBranchSummary");var yIn,EIn,$Jo=Zr({"src/lib/parsers/parse-branch.ts"(){"use strict";GJo(),oo(),yIn=[new ko(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,n,o])=>{t.push(kSn(e),!0,r,n,o)}),new ko(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,n,o])=>{t.push(kSn(e),!1,r,n,o)})],EIn=new ko(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),_In={};tm(_In,{branchLocalTask:a(()=>WJo,"branchLocalTask"),branchTask:a(()=>VJo,"branchTask"),containsDeleteBranchCommand:a(()=>vIn,"containsDeleteBranchCommand"),deleteBranchTask:a(()=>YJo,"deleteBranchTask"),deleteBranchesTask:a(()=>zJo,"deleteBranchesTask")});function vIn(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}a(vIn,"containsDeleteBranchCommand");function VJo(t){let e=vIn(t),r=t.includes("--show-current"),n=["branch",...t];return n.length===1&&n.push("-a"),n.includes("-v")||n.splice(1,0,"-v"),{format:"utf-8",commands:n,parser(o,s){return e?QZe(o,s).all[0]:AIn(o,r)}}}a(VJo,"branchTask");function WJo(){return{format:"utf-8",commands:["branch","-v"],parser(t){return AIn(t)}}}a(WJo,"branchLocalTask");function zJo(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,n){return QZe(r,n)},onError({exitCode:r,stdOut:n},o,s,c){if(!mIn(String(o),r))return c(o);s(n)}}}a(zJo,"deleteBranchesTask");function YJo(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(n,o){return QZe(n,o).branches[t]},onError({exitCode:n,stdErr:o,stdOut:s},c,l,u){if(!mIn(String(c),n))return u(c);throw new _we(r.parser(Ewe(s),Ewe(o)),String(c))}};return r}a(YJo,"deleteBranchTask");var KJo=Zr({"src/lib/tasks/branch.ts"(){"use strict";jue(),HJo(),$Jo(),oo()}});function JJo(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,CIn.normalize)(e)}a(JJo,"toPath");var bIn,ZJo=Zr({"src/lib/responses/CheckIgnore.ts"(){"use strict";bIn=a(t=>t.split(/\n/g).map(JJo).filter(Boolean),"parseCheckIgnore")}}),SIn={};tm(SIn,{checkIgnoreTask:a(()=>XJo,"checkIgnoreTask")});function XJo(t){return{commands:["check-ignore",...t],format:"utf-8",parser:bIn}}a(XJo,"checkIgnoreTask");var eZo=Zr({"src/lib/tasks/check-ignore.ts"(){"use strict";ZJo()}});function tZo(t,e){return JC({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},TIn,[t,e])}a(tZo,"parseFetchResult");var TIn,rZo=Zr({"src/lib/parsers/parse-fetch.ts"(){"use strict";oo(),TIn=[new ko(/From (.+)$/,(t,[e])=>{t.remote=e}),new ko(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new ko(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new ko(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new ko(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,n,o])=>{t.updated.push({name:n,tracking:o,to:r,from:e})})]}}),IIn={};tm(IIn,{fetchTask:a(()=>iZo,"fetchTask")});function nZo(t){return/^--upload-pack(=|$)/.test(t)}a(nZo,"disallowedCommand");function iZo(t,e,r){let n=["fetch",...r];return t&&e&&n.push(t,e),n.find(nZo)?KC("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:tZo}}a(iZo,"fetchTask");var oZo=Zr({"src/lib/tasks/fetch.ts"(){"use strict";rZo(),nh()}});function sZo(t){return JC({moves:[]},xIn,t)}a(sZo,"parseMoveResult");var xIn,aZo=Zr({"src/lib/parsers/parse-move.ts"(){"use strict";oo(),xIn=[new ko(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),wIn={};tm(wIn,{moveTask:a(()=>cZo,"moveTask")});function cZo(t,e){return{commands:["mv","-v",...jO(t),e],format:"utf-8",parser:sZo}}a(cZo,"moveTask");var lZo=Zr({"src/lib/tasks/move.ts"(){"use strict";aZo(),oo()}}),RIn={};tm(RIn,{pullTask:a(()=>uZo,"pullTask")});function uZo(t,e,r){let n=["pull",...r];return t&&e&&n.splice(1,0,t,e),{commands:n,format:"utf-8",parser(o,s){return CGt(o,s)},onError(o,s,c,l){let u=AJo(Ewe(o.stdOut),Ewe(o.stdErr));if(u)return l(new _we(u));l(s)}}}a(uZo,"pullTask");var dZo=Zr({"src/lib/tasks/pull.ts"(){"use strict";jue(),ZTn(),oo()}});function fZo(t){let e={};return kIn(t,([r])=>e[r]={name:r}),Object.values(e)}a(fZo,"parseGetRemotes");function pZo(t){let e={};return kIn(t,([r,n,o])=>{Object.hasOwn(e,r)||(e[r]={name:r,refs:{fetch:"",push:""}}),o&&n&&(e[r].refs[o.replace(/[^a-z]/g,"")]=n)}),Object.values(e)}a(pZo,"parseGetRemotesVerbose");function kIn(t,e){iGt(t,r=>e(r.split(/\s+/)))}a(kIn,"forEach");var hZo=Zr({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";oo()}}),PIn={};tm(PIn,{addRemoteTask:a(()=>mZo,"addRemoteTask"),getRemotesTask:a(()=>gZo,"getRemotesTask"),listRemotesTask:a(()=>AZo,"listRemotesTask"),remoteTask:a(()=>yZo,"remoteTask"),removeRemoteTask:a(()=>EZo,"removeRemoteTask")});function mZo(t,e,r){return Z_(["remote","add",...r,t,e])}a(mZo,"addRemoteTask");function gZo(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?pZo:fZo}}a(gZo,"getRemotesTask");function AZo(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),Z_(e)}a(AZo,"listRemotesTask");function yZo(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),Z_(e)}a(yZo,"remoteTask");function EZo(t){return Z_(["remote","remove",t])}a(EZo,"removeRemoteTask");var _Zo=Zr({"src/lib/tasks/remote.ts"(){"use strict";hZo(),nh()}}),DIn={};tm(DIn,{stashListTask:a(()=>vZo,"stashListTask")});function vZo(t={},e){let r=jTn(t),n=["stash","list",...r.commands,...e],o=FTn(r.splitter,r.fields,gGt(n));return UZe(n)||{commands:n,format:"utf-8",parser:o}}a(vZo,"stashListTask");var CZo=Zr({"src/lib/tasks/stash-list.ts"(){"use strict";Swe(),QTn(),vGt(),HTn()}}),NIn={};tm(NIn,{addSubModuleTask:a(()=>bZo,"addSubModuleTask"),initSubModuleTask:a(()=>SZo,"initSubModuleTask"),subModuleTask:a(()=>qZe,"subModuleTask"),updateSubModuleTask:a(()=>TZo,"updateSubModuleTask")});function bZo(t,e){return qZe(["add",t,e])}a(bZo,"addSubModuleTask");function SZo(t){return qZe(["init",...t])}a(SZo,"initSubModuleTask");function qZe(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),Z_(e)}a(qZe,"subModuleTask");function TZo(t){return qZe(["update",...t])}a(TZo,"updateSubModuleTask");var IZo=Zr({"src/lib/tasks/sub-module.ts"(){"use strict";nh()}});function xZo(t,e){let r=Number.isNaN(t),n=Number.isNaN(e);return r!==n?r?1:-1:r?MIn(t,e):0}a(xZo,"singleSorted");function MIn(t,e){return t===e?0:t>e?1:-1}a(MIn,"sorted");function wZo(t){return t.trim()}a(wZo,"trimmed");function bZe(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}a(bZe,"toNumber");var PSn,OIn,RZo=Zr({"src/lib/responses/TagList.ts"(){"use strict";PSn=class{static{a(this,"TagList")}constructor(t,e){this.all=t,this.latest=e}},OIn=a(function(t,e=!1){let r=t.split(` -`).map(wZo).filter(Boolean);e||r.sort(function(o,s){let c=o.split("."),l=s.split(".");if(c.length===1||l.length===1)return xZo(bZe(c[0]),bZe(l[0]));for(let u=0,d=Math.max(c.length,l.length);uo.indexOf(".")>=0);return new PSn(r,n)},"parseTagList")}}),LIn={};tm(LIn,{addAnnotatedTagTask:a(()=>DZo,"addAnnotatedTagTask"),addTagTask:a(()=>PZo,"addTagTask"),tagListTask:a(()=>kZo,"tagListTask")});function kZo(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return OIn(r,e)}}}a(kZo,"tagListTask");function PZo(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}a(PZo,"addTagTask");function DZo(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}a(DZo,"addAnnotatedTagTask");var NZo=Zr({"src/lib/tasks/tag.ts"(){"use strict";RZo()}}),MZo=JYo({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(LKo(),rh(wTn)),{SimpleGitApi:n}=(LJo(),rh(lIn)),{Scheduler:o}=(BJo(),rh(uIn)),{adhocExecTask:s,configurationErrorTask:c}=(nh(),rh(WHt)),{asArray:l,filterArray:u,filterPrimitives:d,filterString:f,filterStringOrStringArray:h,filterType:m,getTrailingOptions:g,trailingFunctionArgument:A,trailingOptionsArgument:y}=(oo(),rh(JSn)),{applyPatchTask:E}=(UJo(),rh(pIn)),{branchTask:_,branchLocalTask:v,deleteBranchesTask:b,deleteBranchTask:T}=(KJo(),rh(_In)),{checkIgnoreTask:w}=(eZo(),rh(SIn)),{checkIsRepoTask:R}=(tTn(),rh(ZSn)),{cleanWithOptionsTask:x,isCleanOptionsArray:P}=(fTn(),rh(uTn)),{diffSummaryTask:D}=(vGt(),rh(qTn)),{fetchTask:N}=(oZo(),rh(IIn)),{moveTask:L}=(lZo(),rh(wIn)),{pullTask:B}=(dZo(),rh(RIn)),{pushTagsTask:q}=(rIn(),rh(tIn)),{addRemoteTask:M,getRemotesTask:O,listRemotesTask:j,remoteTask:Q,removeRemoteTask:U}=(_Zo(),rh(PIn)),{getResetMode:Y,resetTask:W}=(STn(),rh(vTn)),{stashListTask:V}=(CZo(),rh(DIn)),{addSubModuleTask:z,initSubModuleTask:ie,subModuleTask:H,updateSubModuleTask:re}=(IZo(),rh(NIn)),{addAnnotatedTagTask:le,addTagTask:Le,tagListTask:ge}=(NZo(),rh(LIn)),{straightThroughBufferTask:Ue,straightThroughStringTask:ke}=(nh(),rh(WHt));function X(ee,K){this._plugins=K,this._executor=new r(ee.baseDir,new o(ee.maxConcurrentProcesses),K),this._trimmed=ee.trimmed}a(X,"Git2"),(X.prototype=Object.create(n.prototype)).constructor=X,X.prototype.customBinary=function(ee){return this._plugins.reconfigure("binary",ee),this},X.prototype.env=function(ee,K){return arguments.length===1&&typeof ee=="object"?this._executor.env=ee:(this._executor.env=this._executor.env||{})[ee]=K,this},X.prototype.stashList=function(ee){return this._runTask(V(y(arguments)||{},u(ee)&&ee||[]),A(arguments))},X.prototype.mv=function(ee,K){return this._runTask(L(ee,K),A(arguments))},X.prototype.checkoutLatestTag=function(ee){var K=this;return this.pull(function(){K.tags(function(he,Z){K.checkout(Z.latest,ee)})})},X.prototype.pull=function(ee,K,he,Z){return this._runTask(B(m(ee,f),m(K,f),g(arguments)),A(arguments))},X.prototype.fetch=function(ee,K){return this._runTask(N(m(ee,f),m(K,f),g(arguments)),A(arguments))},X.prototype.silent=function(ee){return this._runTask(s(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},X.prototype.tags=function(ee,K){return this._runTask(ge(g(arguments)),A(arguments))},X.prototype.rebase=function(){return this._runTask(ke(["rebase",...g(arguments)]),A(arguments))},X.prototype.reset=function(ee){return this._runTask(W(Y(ee),g(arguments)),A(arguments))},X.prototype.revert=function(ee){let K=A(arguments);return typeof ee!="string"?this._runTask(c("Commit must be a string"),K):this._runTask(ke(["revert",...g(arguments,0,!0),ee]),K)},X.prototype.addTag=function(ee){let K=typeof ee=="string"?Le(ee):c("Git.addTag requires a tag name");return this._runTask(K,A(arguments))},X.prototype.addAnnotatedTag=function(ee,K){return this._runTask(le(ee,K),A(arguments))},X.prototype.deleteLocalBranch=function(ee,K,he){return this._runTask(T(ee,typeof K=="boolean"?K:!1),A(arguments))},X.prototype.deleteLocalBranches=function(ee,K,he){return this._runTask(b(ee,typeof K=="boolean"?K:!1),A(arguments))},X.prototype.branch=function(ee,K){return this._runTask(_(g(arguments)),A(arguments))},X.prototype.branchLocal=function(ee){return this._runTask(v(),A(arguments))},X.prototype.raw=function(ee){let K=!Array.isArray(ee),he=[].slice.call(K?arguments:ee,0);for(let ue=0;ueconsole.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},X.prototype.checkIgnore=function(ee,K){return this._runTask(w(l(m(ee,h,[]))),A(arguments))},X.prototype.checkIsRepo=function(ee,K){return this._runTask(R(m(ee,f)),A(arguments))},e.exports=X}});Lq();var OZo=class extends oF{static{a(this,"GitConstructError")}constructor(t,e){super(void 0,e),this.config=t}};Lq();Lq();var que=class extends oF{static{a(this,"GitPluginError")}constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};jue();BSn();tTn();fTn();mTn();ATn();_Tn();STn();function LZo(t){return t?[{type:"spawn.before",action(n,o){t.aborted&&o.kill(new que(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,o){function s(){o.kill(new que(void 0,"abort","Abort signal received"))}a(s,"kill"),t.addEventListener("abort",s),o.spawned.on("close",()=>t.removeEventListener("abort",s))}}]:void 0}a(LZo,"abortPlugin");function BZo(t={}){return{type:"spawn.args",action(e,{env:r}){for(let n of iSn(e,r))if(t[n.category]!==!0)throw new que(void 0,"unsafe",n.message);return e}}}a(BZo,"blockUnsafeOperationsPlugin");oo();function FZo(t){let e=ywe(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}a(FZo,"commandConfigPrefixingPlugin");oo();var DSn=(0,Uue.deferred)().promise;function UZo({onClose:t=!0,onExit:e=50}={}){function r(){let o=-1,s={close:(0,Uue.deferred)(),closeTimeout:(0,Uue.deferred)(),exit:(0,Uue.deferred)(),exitTimeout:(0,Uue.deferred)()},c=Promise.race([t===!1?DSn:s.closeTimeout.promise,e===!1?DSn:s.exitTimeout.promise]);return n(t,s.close,s.closeTimeout),n(e,s.exit,s.exitTimeout),{close(l){o=l,s.close.done()},exit(l){o=l,s.exit.done()},get exitCode(){return o},result:c}}a(r,"createEvents");function n(o,s,c){o!==!1&&(o===!0?s.promise:s.promise.then(()=>qHt(o))).then(c.done)}return a(n,"configureTimeout"),{type:"spawn.after",async action(o,{spawned:s,close:c}){let l=r(),u=!0,d=a(()=>{u=!1},"quickClose");s.stdout?.on("data",d),s.stderr?.on("data",d),s.on("error",d),s.on("close",f=>l.close(f)),s.on("exit",f=>l.exit(f));try{await l.result,u&&await qHt(50),c(l.exitCode)}catch(f){c(l.exitCode,f)}}}}a(UZo,"completionDetectionPlugin");oo();var QZo="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",NSn="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function qZo(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(t)}a(qZo,"isBadArgument");function MSn(t,e){if(t.length<1||t.length>2)throw new que(void 0,"binary",QZo);if(t.some(qZo))if(e)console.warn(NSn);else throw new que(void 0,"binary",NSn);let[n,o]=t;return{binary:n,prefix:o}}a(MSn,"toBinaryConfig");function jZo(t,e=["git"],r=!1){let n=MSn(jO(e),r);t.on("binary",o=>{n=MSn(jO(o),r)}),t.append("spawn.binary",()=>n.binary),t.append("spawn.args",o=>n.prefix?[n.prefix,...o]:o)}a(jZo,"customBinaryPlugin");Lq();function HZo(t){return!!(t.exitCode&&t.stdErr.length)}a(HZo,"isTaskError");function GZo(t){return Buffer.concat([...t.stdOut,...t.stdErr])}a(GZo,"getErrorMessage");function $Zo(t=!1,e=HZo,r=GZo){return(n,o)=>!t&&n||!e(o)?n:r(o)}a($Zo,"errorDetectionHandler");function OSn(t){return{type:"task.error",action(e,r){let n=t(e.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new oF(void 0,n.toString("utf-8"))}:{error:n}}}}a(OSn,"errorDetectionPlugin");oo();var VZo=class{static{a(this,"PluginStore")}constructor(){this.plugins=new Set,this.events=new BIn.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=cw(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return jO(t).forEach(r=>r&&this.plugins.add(cw(e,r))),()=>{e.forEach(r=>this.plugins.delete(r))}}exec(t,e,r){let n=e,o=Object.freeze(Object.create(r));for(let s of this.plugins)s.type===t&&(n=s.action(n,o));return n}};oo();function WZo(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,c){return r.includes(c.method)?HSn(s,e):s}},{type:"spawn.after",action(s,c){c.commands.includes(e)&&c.spawned.stderr?.on("data",l=>{let u=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(l.toString("utf8"));u&&t({method:c.method,stage:zZo(u[1]),progress:Eu(u[2]),processed:Eu(u[3]),total:Eu(u[4])})})}}]}a(WZo,"progressMonitorPlugin");function zZo(t){return String(t.toLowerCase().split(" ",1))||"unknown"}a(zZo,"progressEventStage");oo();function YZo(t){let e=$Sn(t,["uid","gid"]);return{type:"spawn.options",action(r){return{...e,...r}}}}a(YZo,"spawnOptionsPlugin");function KZo({block:t,stdErr:e=!0,stdOut:r=!0}){if(t>0)return{type:"spawn.after",action(n,o){let s;function c(){s&&clearTimeout(s),s=setTimeout(u,t)}a(c,"wait");function l(){o.spawned.stdout?.off("data",c),o.spawned.stderr?.off("data",c),o.spawned.off("exit",l),o.spawned.off("close",l),s&&clearTimeout(s)}a(l,"stop");function u(){l(),o.kill(new que(void 0,"timeout","block timeout reached"))}a(u,"kill"),r&&o.spawned.stdout?.on("data",c),e&&o.spawned.stderr?.on("data",c),o.spawned.on("exit",l),o.spawned.on("close",l),c()}}}a(KZo,"timeoutPlugin");function JZo(){return{type:"spawn.args",action(t){let e=[],r;function n(o){(r=r||[]).push(...o)}a(n,"append2");for(let o=0;oow(c)&&Mue(c)||c));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}a(JZo,"suffixPathsPlugin");oo();var ZZo=MZo();function XZo(t,e){let r=new VZo,n=YSn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!oGt(n.baseDir))throw new OZo(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(FZo(n.config)),r.add(BZo(n.unsafe)),r.add(UZo(n.completion)),n.abort&&r.add(LZo(n.abort)),n.progress&&r.add(WZo(n.progress)),n.timeout&&r.add(KZo(n.timeout)),n.spawnOptions&&r.add(YZo(n.spawnOptions)),r.add(JZo()),r.add(OSn($Zo(!0))),n.errors&&r.add(OSn(n.errors)),jZo(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new ZZo(n,r)}a(XZo,"gitInstanceFactory");jue();var Gue=XZo;var lw=new fe("Git Service");var jZe=class t{constructor(e){this.ctx=e;this.gitInstances=new Map;this._upstreamCache=new Map}static{a(this,"GitService")}static{this._upstreamCacheTtlMs=300*1e3}async getGitInstance(e){let r=this.normalizeRepoPath(e),n=this.gitInstances.get(r);if(!n){let o=(await lO()).path;n=Gue({baseDir:r,binary:o,unsafe:{allowUnsafeCustomBinary:!0}}),this.gitInstances.set(r,n)}return n}constructFileUri(e,r){let n=this.normalizeRepoPath(e),o=(0,UIn.join)(n,r);return Ks(o)}parseStatus(e){switch(e){case"M":return 2;case"A":return 0;case"D":return 3;case"R":return 1;default:return 2}}parseDiffOutput(e,r){let n=[],o=r.split("\0").filter(s=>s.length>0);for(let s=0;s=o.length){lw.warn(this.ctx,`Malformed git diff output: rename status without both paths at position ${s}. Output: ${r}`);continue}let f=o[s+1],h=o[s+2];if(!f||!h){lw.warn(this.ctx,`Malformed git diff output: empty path(s) for rename at position ${s}. Paths: [${f}, ${h}]. Output: ${r}`);continue}let m=this.constructFileUri(e,f),g=this.constructFileUri(e,h);n.push({uri:g,originalUri:m,renameUri:g,status:1}),s+=2}else{if(s+1>=o.length){lw.warn(this.ctx,`Malformed git diff output: status without path at position ${s}. Status: ${u}. Output: ${r}`);continue}let f=o[s+1];if(!f){lw.warn(this.ctx,`Malformed git diff output: empty file path at position ${s}. Status: ${u}. Output: ${r}`);continue}let h=this.constructFileUri(e,f);n.push({uri:h,originalUri:h,renameUri:void 0,status:d}),s+=1}}return n}async diffWith(e,r){try{let o=await(await this.getGitInstance(e)).raw(["diff","--name-status","-z","--diff-filter=ADMR",r,"--"]);return!o||o.trim().length===0?[]:this.parseDiffOutput(e,o)}catch(n){lw.warn(this.ctx,`Failed to diff with ${r} for ${e}`,n);return}}async hasUpstream(e){let r=this.normalizeRepoPath(e),n=this._upstreamCache.get(r),o=Date.now();if(n&&o-n.checkedAt0}catch(o){return lw.warn(this.ctx,`Failed to query upstream config for ${e}`,o),!1}}clearUpstreamCache(e){e?this._upstreamCache.delete(this.normalizeRepoPath(e)):this._upstreamCache.clear()}async diffWithIndexedCommit(e,r){try{if(r){let o=await this.diffWith(e,r);if(o)return{changes:o,mayBeOutdated:!1};lw.warn(this.ctx,`Failed to diff with indexed commit ${r}, falling back to upstream`)}if(!await this.hasUpstream(e)){lw.debug(this.ctx,`No upstream branch configured for ${e}, cannot determine changes`);return}let n=await this.diffWith(e,"@{upstream}");return n?{changes:n,mayBeOutdated:!0}:void 0}catch(n){lw.warn(this.ctx,`Failed to diff with indexed commit for ${e}`,n);return}}normalizeRepoPath(e){if(e.startsWith("file://"))try{return(0,FIn.fileURLToPath)(e)}catch(r){lw.warn(this.ctx,`Failed to convert URI to path: ${e}, attempting fallback`,r);try{let n=new URL(e),o=decodeURIComponent(n.pathname);return process.platform==="win32"&&/^\/[a-zA-Z]:/.test(o)&&(o=o.slice(1).replace(/\//g,"\\")),o}catch(n){return lw.error(this.ctx,`Failed to parse URI with fallback: ${e}`,n),e}}return e}dispose(){this.gitInstances.clear(),this._upstreamCache.clear()}};var QIn=de(nl());var e2=new fe("Local Diff Tracker");var HZe=class t{constructor(e,r,n){this.ctx=e;this._workspaceFileIndex=r;this._githubCodeSearchService=n;this._repos=new Map;this._locallyChangedFiles=new Set;this._fileWatcherDisposables=[];this._gitService=new jZe(e),this._repositoryManager=e.get(_f),this._diffRefreshTimer=new QIn.IntervalTimer}static{a(this,"CodeSearchWorkspaceDiffTracker")}static{this._diffRefreshInterval=1e3*60*2}static{this._diffRefreshMaxInterval=1e3*60*30}static{this._maxDiffFiles=1e4}async initialize(){return this._initializePromise??=this.doInitialize(),this._initializePromise}async doInitialize(){try{e2.info(this.ctx,"Initializing Local Diff Tracker"),await this._workspaceFileIndex.initialize();let e=a(n=>{for(let o of n)this._locallyChangedFiles.add(o)},"addFiles");this._fileWatcherDisposables.push(this._workspaceFileIndex.onDidCreateFiles(e),this._workspaceFileIndex.onDidChangeFiles(e),this._workspaceFileIndex.onDidDeleteFiles(n=>{for(let o of n)this._locallyChangedFiles.delete(o)}));let r=await this._repositoryManager.getRepo({uri:this._workspaceFileIndex.workspaceFolder.uri});r||(r=await this.tryInferRepoFromFiles()),r&&r.isGitHub()&&r.owner&&r.name?await this.openRepo(r):e2.info(this.ctx,`Workspace folder ${this._workspaceFileIndex.workspaceFolder.uri} is not a GitHub repository`)}catch(e){e2.error(this.ctx,"Initialization failed",e)}}async tryInferRepoFromFiles(){try{let e=Array.from(this._workspaceFileIndex.values());if(e.length===0)return;for(let r=0;r{this.refreshRepoDiffs()},t._diffRefreshInterval),await this.refreshRepoDiff(n)}async tryGetDiffedIndexedFiles(e,r){let n=await this.tryGetDiff(e,r);if(!n)return;let o=new Set,s=n.changes.slice(0,t._maxDiffFiles);for(let c of s){let l=c.uri;this._workspaceFileIndex.get(l)&&o.add(l)}return o}async tryGetDiff(e,r){try{let n=e.baseFolder.uri,o=await this._gitService.diffWithIndexedCommit(n,r);return o?{changes:o.changes,mayBeOutdated:o.mayBeOutdated}:void 0}catch(n){e2.error(this.ctx,`Failed to get diff for ${e.baseFolder.uri}`,n);return}}async refreshRepoDiffs(){let e=Date.now(),r=Array.from(this._repos.values(),n=>n).filter(n=>n.nextRefreshAt<=e);await Promise.all(r.map(n=>this.refreshRepoDiff(n)))}getNextRefreshDelay(e){if(e<=0)return t._diffRefreshInterval;let r=Math.min(e,5),n=t._diffRefreshInterval*Math.pow(2,r);return Math.min(n,t._diffRefreshMaxInterval)}async refreshRepoDiff(e){try{let r=this._githubCodeSearchService.getIndexedCommit(e.repo.baseFolder.uri),n=await this.tryGetDiffedIndexedFiles(e.repo,r);if(n){e.initialChanges.clear();for(let c of n)e.initialChanges.add(c);let o=e.repo.baseFolder.uri,s=[];for(let c of this._locallyChangedFiles)if(c.startsWith(o)){let l=this._workspaceFileIndex.get(c);(!l||!l.isDirty())&&s.push(c)}for(let c of s)this._locallyChangedFiles.delete(c);(e.state===1||e.consecutiveFailures>0)&&e2.info(this.ctx,`Diff refresh recovered for ${e.repo.baseFolder.uri}`),e.state=2,e.consecutiveFailures=0,e.lastErrorKey=void 0}else this.handleDiffFailure(e,"no-diff",`Failed to get new diff for ${e.repo.baseFolder.uri}.`)}catch(r){this.handleDiffFailure(e,"exception",`Failed to refresh diff for ${e.repo.baseFolder.uri}.`,r)}finally{e.nextRefreshAt=Date.now()+this.getNextRefreshDelay(e.consecutiveFailures)}}handleDiffFailure(e,r,n,o){e.state=1,e.consecutiveFailures++;let s=e.lastErrorKey!==r;e.lastErrorKey=r,s?o!==void 0?e2.warn(this.ctx,n,o):e2.warn(this.ctx,n):o!==void 0?e2.debug(this.ctx,n,o):e2.debug(this.ctx,n)}dispose(){this._diffRefreshTimer.dispose(),this._gitService.dispose(),this._fileWatcherDisposables.forEach(e=>e.dispose())}};p();p();var Bq;(n=>{function t(o){return new TGt(o)}n.ok=t,a(t,"ok");function e(o){return new IGt(o)}n.error=e,a(e,"error");function r(o){return n.error(new Error(o))}n.fromString=r,a(r,"fromString")})(Bq||={});var TGt=class t{constructor(e){this.val=e}static{a(this,"ResultOk")}map(e){return new t(e(this.val))}flatMap(e){return e(this.val)}isOk(){return!0}isError(){return!1}},IGt=class{constructor(e){this.err=e}static{a(this,"ResultError")}map(e){return this}flatMap(e){return this}isOk(){return!1}isError(){return!0}};var xGt=new fe("GithubAvailableEmbeddingTypes"),GZe=class{constructor(e){this._ctx=e;this._cached=this._ctx.get(Qt).getGitHubSession().then(r=>r?this.doGetAvailableTypes(r):Bq.error({type:"noSession"}))}static{a(this,"GithubAvailableEmbeddingTypesManager")}async getAllAvailableTypes(){if(this._cached){let e=this._cached;try{let r=await this._cached;if(r.isOk())return r}catch{}this._cached===e&&(this._cached=void 0)}return this._cached??=(async()=>{let e=await this._ctx.get(Qt).getGitHubSession();return e?await this.doGetAvailableTypes(e):Bq.error({type:"noSession"})})(),this._cached}async doGetAvailableTypes(e){let r;try{let c=Pue(this._ctx);r=await Gf(this._ctx,e,"embeddings/models",{headers:c,method:"GET"})}catch(c){return xGt.error(this._ctx,"Error fetching available embedding types",c),Bq.error({type:"requestFailed",error:c})}if(!r.ok)return r.status===401||r.status===404?Bq.error({type:"unauthorized",status:r.status}):Bq.error({type:"badResponse",status:r.status});let n=await r.json(),o=[],s=[];for(let c of n.models){let l=new $C(c.id);c.active===!1?s.push(l):o.push(l)}return Bq.ok({primary:o,deprecated:s})}async getPreferredType(){let e=await this.getAllAvailableTypes();if(!e.isOk()){xGt.info(this._ctx,`Could not find any available embedding types. Error: ${e.err.type}`);return}let r=e.val;return xGt.info(this._ctx,`Got embeddings. Primary: ${r.primary.join(",")}. Deprecated: ${r.deprecated.join(",")}`),r.primary.at(0)??r.deprecated.at(0)}};p();var eXo=new fe("GithubEmbeddingComputer"),$ue=class{constructor(e){this.ctx=e;this.batchSize=100}static{a(this,"GithubEmbeddingComputer")}async computeEmbeddings(e,r,n,o){try{let s=await this.ctx.get(Qt).getGitHubSession();if(!s)throw new Error("No GitHub session available");let c=[],l;for(let u=0;u0&&(l=f[0].type),c.push(...f)}if(!l)throw new Error("No embedding type resolved from API response");return{type:l,values:c}}catch(s){eXo.error(this.ctx,"Error computing embeddings:",s);return}}async fetchBatchEmbeddings(e,r,n,o,s){try{let c={inputs:n};if(r&&(c.embedding_model=r.id),o?.inputType&&(c.input_type=o.inputType),s?.isCancellationRequested)return;let l=await Gf(this.ctx,e,"embeddings",{method:"POST",json:c});if(!l.ok)throw new Error(`Error fetching embeddings: ${l.status}. ${await l.text()}`);let u=await l.json(),d=new $C(u.embedding_model);if(r&&!d.equals(r))throw new Error(`Unexpected embedding model. Got: ${d.id}. Expected: ${r.id}`);if(n.length!==u.embeddings.length)throw new Error(`Mismatched embedding result count. Expected: ${n.length}. Got: ${u.embeddings.length}`);return u.embeddings.map(f=>({type:d,value:new Float32Array(f.embedding)}))}catch(c){throw new Error("Error fetching batch embeddings: "+(c instanceof Error?c.message:String(c)))}}};p();p();p();var Twe=class{constructor(){this.recomputedFileCount=0;this.sentContentTextLength=0}static{a(this,"ComputeBatchInfo")}};p();var qIn=de(NA()),jIn=de(dU()),HIn=require("os"),wGt=de(require("path")),Vue=require("process");function $Ze(t){let e=un(t.workspaceFolder.uri),r=(0,qIn.basename)(e),o=(0,jIn.SHA256)(e).toString().substring(0,8);return wGt.default.join(tXo(),"project-index",`${r}.${o}`)}a($Ze,"getWorkspaceCachePath");function tXo(){return Vue.env.XDG_CACHE_HOME&&wGt.default.isAbsolute(Vue.env.XDG_CACHE_HOME)?Vue.env.XDG_CACHE_HOME+"/github-copilot":(0,HIn.platform)()==="win32"?Vue.env.USERPROFILE+"\\AppData\\Local\\Temp\\github-copilot":Vue.env.HOME+"/.cache/github-copilot"}a(tXo,"getXdgCachePath");p();p();function GIn(t){if(Jqt(t.type)?.quantization.document==="binary"){if(t.value.length%8!==0)throw new Error(`Embedding value length must be a multiple of 8 for ${t.type.id}, got ${t.value.length}`);let n=new Uint8Array(t.value.length/8);for(let o=0;o=0?1:0)<=1024)){let o=new Float32Array(e.length*8);for(let s=0;s0?.03125:-.03125}return{type:t,value:o}}let n=new Float32Array(e.byteLength/4);return new Uint8Array(n.buffer).set(e),{type:t,value:n}}a(RGt,"unpackEmbedding");p();var $In=de(nl()),VIn=de(zP()),PGt=de(eh()),WIn=de(require("fs")),DGt=de(require("node:sqlite")),NGt=de(require("path"));var kGt=new fe("WorkspaceChunkAndEmbeddingCache");async function zIn(t,e,r,n){return await MGt.create(t,e,r??":memory:",n)}a(zIn,"createWorkspaceChunkAndEmbeddingCache");var MGt=class t{constructor(e,r){this.embeddingType=e;this.db=r;this._inMemory=new VIn.ResourceMap}static{a(this,"DbCache")}static{this.version="1.0.0"}static async create(e,r,n,o){let s={open:!0},c;if(n!==":memory:"){let d=NGt.default.join(n,"workspace-chunks.db");try{await WIn.default.promises.mkdir(NGt.default.dirname(d),{recursive:!0}),c=new DGt.default.DatabaseSync(d,s),kGt.debug(e,`DbWorkspaceChunkAndEmbeddingCache: Opened SQLite database on disk at ${d}`)}catch(f){kGt.error(e,"DbWorkspaceChunkAndEmbeddingCache: Failed to open SQLite database on disk, falling back to in-memory",f)}}c||(c=new DGt.default.DatabaseSync(":memory:",s),kGt.debug(e,"DbWorkspaceChunkAndEmbeddingCache: Using in-memory database")),c.exec(` +`)}a(Cjt,"applyEditsToDocument");var Rue=class{constructor(e){this.ctx=e;this.earlyReturnResponse="Oops, an error has occurred. Please try again";this.uiKind="conversationPanel";this.computeSuggestions=!0}static{a(this,"PanelTurnProcessorStrategy")}processResponse(){return[]}async buildConversationPrompt(e,r,n,o){let s="user",c=await xo.getModelConfiguration(e.ctx,s),l={promptType:s,modelConfiguration:c,languageId:r,userSelectedModelName:o};return await this.ctx.get(NA).toPrompt(e,l)}extractEditsFromResponse(e,r){return[]}},QJe=class{constructor(e){this.ctx=e;this.earlyReturnResponse="Please open a file and select code for the inline chat to be available";this.uiKind="conversationInline";this.computeSuggestions=!1}static{a(this,"InlineTurnProcessorStrategy")}async buildConversationPrompt(e,r,n){let o=await this.getCurrentEditorSkill(e);if(!o)return;let s=await this.getDocumentIfValid(o.uri);if(!s)return;let c=n?.producesCodeEdits===!1?"user":"inline",l=await Pq(e.ctx),u=await e.ctx.get(tl).getBestChatModelConfig(DS(c,l)),d={promptType:c,modelConfiguration:u,languageId:r};return d.promptType==="inline"&&(this.currentDocument=s),await this.ctx.get(NA).toPrompt(e,d)}async processResponse(e){let r=[],n=Pn(e.response?.message??"");if(n&&e.status==="success"&&this.currentDocument){let o=await this.processInlineResponse(n,this.currentDocument);o&&r.push(o)}return r}async getCurrentEditorSkill(e){let r=await e.skillResolver.resolve(hE);if(r)return r}async getDocumentIfValid(e){let r=await this.ctx.get(ni).getOrReadTextDocument({uri:e});if(r.status==="valid")return r.document}async processInlineResponse(e,r){let o=vjt(e,r).filter(c=>_jt.includes(c.mode)),s=Cjt(o,r);if(s)return await this.ctx.get(Zh).documentDiff({original:r.getText(),updated:s}),{uri:r.uri,text:s}}extractEditsFromResponse(e,r){return vjt(e,r)}};var qJe=class{constructor(){this.slug="github-copilot-coding-agent";this.name="GitHub Copilot Coding Agent";this.description="Create coding tasks that are executed by GitHub Copilot Coding Agent";this.avatarUrl=void 0}static{a(this,"BackendCodingAgent")}additionalSkills(e){return[]}turnProcessor(e){let r=new Rue(e.ctx);return new UJe(e,r)}};p();p();p();p();function A1n(t){return t?t.filter(e=>e.type==="github.web-search").map(e=>e):[]}a(A1n,"filterUnsupportedReferences");function y1n(t){return t?t.filter(e=>e.type==="github.web-search"):[]}a(y1n,"convertToCopilotReferences");var E1n=S.Object({type:S.Literal("github.web-search"),id:S.String(),data:S.Object({query:S.String(),type:S.String(),results:S.Optional(S.Array(S.Object({title:S.String(),excerpt:S.String(),url:S.String()})))}),metadata:S.Optional(S.Object({display_name:S.Optional(S.String()),display_icon:S.Optional(S.String())}))});var Uq=class{constructor(e){this.deltaApplier=e;this.appliedLength=0;this.appliedText="";this.appliedAnnotations=[]}static{a(this,"ConversationFinishCallback")}isFinishedAfter(e,r){let n=e.substring(this.appliedLength,e.length),s=this.mapAnnotations(r.annotations).filter(c=>!this.appliedAnnotations.includes(c.id));this.append(n,s,A1n(r.copilotReferences),r.copilotErrors??[],r.copilotConfirmation,r.thinking)}append(e,r,n,o,s,c){this.deltaApplier(e,r,n,o,s,c),this.appliedLength+=e.length,this.appliedText+=e,this.appliedAnnotations.push(...r.map(l=>l.id))}mapAnnotations(e){if(!e)return[];let r=[],n=e.for("CodeVulnerability").map(s=>({...s,type:"code_vulnerability"})),o=e.for("IPCodeCitations").map(s=>({...s,type:"ip_code_citations"}));return r.push(...n),r.push(...o),r}};p();p();var UO=class{constructor(e){this.ctx=e;this.githubRepositoryInfoCache=new Map}static{a(this,"GitHubRepositoryApi")}async getRepositoryInfo(e){let r=`${e.hostname}/${e.owner}/${e.repo}`,n=this.githubRepositoryInfoCache.get(r);if(n)return n;let o=await this._doGetRepositoryInfo(e);if(o?.ok){let s=await o.json();return this.githubRepositoryInfoCache.set(r,s),s}}async _doGetRepositoryInfo({owner:e,repo:r,hostname:n}){let o=await this.ctx.get(Mr).resolveSession(),s;if(o&&new URL(o.serverUrl).hostname===n)s=o;else{let u=await this.ctx.get(fx).findTokenByAuthority(n);u&&(s={accessToken:u.record.accessToken,apiUrl:`https://api.${n}/`})}if(!s&&!(n==="github.com"||n.endsWith(".ghe.com")))return;let c={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};s&&(c.Authorization=`Bearer ${s.accessToken}`);let l=new URL(`repos/${e}/${r}`,s?.apiUrl||`https://api.${n}`).href;return this.ctx.get(nr).fetch(l,{method:"GET",headers:c})}};p();p();var _1n=S.Object({name:S.String(),url:S.String()}),v1n=S.Object({path:S.String(),head:S.Optional(S.Object({name:S.String(),upstream:S.Optional(_1n)})),remotes:S.Optional(S.Array(_1n))}),bjt=class{constructor(e){this.turnContext=e}static{a(this,"GitMetadataSkillProcessor")}value(){return .8}processSkill(e){this.turnContext.collectLabel(QO,"git repository information");let r=[];return r.push([new Ar(["Metadata about the current git repository:"]),1]),e.head&&e.head.name?(r.push([new Ar([`- Current branch name: ${e.head.name}`]),1]),e.head.upstream&&r.push([new Ar([`- Upstream name and url: ${e.head.upstream.name} - ${e.head.upstream.url}`]),1])):r.push([new Ar(["- Detached HEAD: yes"]),1]),e.remotes&&e.remotes.length>0&&r.push([new Ar([`- Remotes: ${e.remotes.map(n=>n.name).join(", ")}`]),1]),new Ar(r)}},QO="git-metadata",jJe=class extends _g{static{a(this,"GitMetadataSkill")}constructor(e){super(QO,"Metadata about the current git repository, useful for questions about branch management and git related commands","Reading git information",()=>e,r=>new bjt(r))}};async function C1n(t){let e=await t.skillResolver.resolve(hE);if(e){let c=e.uri,l=IQ(t.ctx,c);if(kfn(l))return{repoInfo:l,skillUsed:hE}}let r=await t.skillResolver.resolve(QO);if(!r||!r.remotes||r.remotes.length===0){ot.debug(t.ctx,"Git metadata skill is not available or no remotes available.");return}let o=r.remotes.find(c=>c.name==="origin")??r.remotes[0],s=j8t(o.url);if(s)return{repoInfo:{baseFolder:{uri:r.path},url:o.url,...s},skillUsed:QO}}a(C1n,"extractRepoInfo");async function b1n(t){let e=[];return await k$o(t,e),await P$o(t,e),await D$o(t,e),e}a(b1n,"skillsToReference");async function k$o(t,e){let r=await N$o(t);r&&e.push(r)}a(k$o,"addRepositoryReference");async function P$o(t,e){let r=await M$o(t);r&&e.push(r)}a(P$o,"addSelectionReference");async function D$o(t,e){let r=[],n=await L$o(t);n&&r.push(n),r.push(...await B$o(t)),r.length>0&&e.push(...r)}a(D$o,"addFileReferences");async function N$o(t){let e=await C1n(t);if(e){let r=t.ctx.get(UO),n=e.repoInfo.owner,o=e.repoInfo.repo,s=await r.getRepositoryInfo(e.repoInfo);if(s)return{type:"github.repository",id:`${n}/${o}`,data:{type:"repository",name:o,ownerLogin:n,id:s.id}}}}a(N$o,"gitMetadataToReference");async function M$o(t){let e=await t.skillResolver.resolve(hE);if(e&&e.selection){let n=await t.ctx.get(ni).getOrReadTextDocument(e),o=id(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o,e.selection),n.status==="valid")return O$o(e,n.document)}}a(M$o,"currentEditorToSelectionReference");function O$o(t,e){if(t.selection&&!_ue(t.selection)){let r=e.getText(t.selection);return{type:"client.selection",id:t.uri,data:{start:{line:t.selection.start.line,col:t.selection.start.character},end:{line:t.selection.end.line,col:t.selection.end.character},content:r}}}}a(O$o,"extractSelection");async function L$o(t){let e=await t.skillResolver.resolve(hE);if(e){let n=await t.ctx.get(ni).getOrReadTextDocument(e),o=id(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o),n.status==="valid")return{type:"client.file",id:n.document.uri,data:{content:n.document.getText(),language:n.document.detectedLanguageId}}}}a(L$o,"currentEditorToFileReference");async function B$o(t){let e=[],r=t.turn.request.references;if(r&&r.length>0){let n=t.ctx.get(ni);for(let o of r)if(o.type==="file"){let s=await n.getOrReadTextDocument(o),c=id(s);if(await t.collectFile(t.turn.agent.agentSlug,o.uri,c,o.selection),s.status==="valid"){let l=s.document.getText();e.push({type:"client.file",id:o.uri,data:{content:l,language:s.document.detectedLanguageId}})}}}return e}a(B$o,"fileReferenceToPlatformFileReference");p();Mo();var F$o=new pe("ChatFetchResultPostProcessor"),kue=class{constructor(e,r,n){this.turnContext=e;this.chatFetcher=r;this.computeSuggestions=n}static{a(this,"ChatFetchResultPostProcessor")}async postProcess(e,r,n,o,s,c,l,u){switch(ZEn(this.turnContext.ctx,l,c,e.type=="offTopic",e.requestId,u,s),await this.turnContext.ctx.get(Zh).inspectFetchResult(e),e.type){case"success":return await this.processSuccessfulFetchResult(n,e.numTokens,e.requestId,r,l,o,s,u);case"offTopic":return this.processOffTopicFetchResult(s,l,u);case"canceled":return this.turnContext.turn.status="cancelled",this.turnContext.turn.response={message:"Cancelled",type:"user"},{error:{message:Pn(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}};case"failed":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:e.reason,type:"server"},F$o.error(this.turnContext.ctx,"Fetch failed:",e),{error:{message:Y_.translateErrorMessage(e.code,e.reason,e.requestId,e.retryAfter,e.ghRequestId,{capiErrorCode:e.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===K_,copilotPlan:dx(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:e.code}};case"filtered":return this.turnContext.turn.status="filtered",{error:{message:"Oops, your response got filtered. Vote down if you think this shouldn't have happened.",responseIsFiltered:!0}};case"length":return this.turnContext.turn.status="error",{error:{message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0}};case"agentAuthRequired":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Authorization required",type:"server"},{error:{message:"Authorization required",responseIsFiltered:!1}};case"no_choices":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"No choices returned",type:"server"},{error:{message:"Oops, no choices received from the server. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0}};case"no_finish_reason":return this.turnContext.turn.status="error",n&&n.length>0?this.turnContext.turn.response={message:n,type:"model",references:this.turnContext.turn.response?.references}:this.turnContext.turn.response={message:"No finish reason",type:"server"},{error:{message:"Oops, unexpected end of stream. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0}};case"model_not_supported":{this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Model not supported",type:"server"};let{modelName:d,modelProviderName:f}=xo.parseModelNotSupportedReason(e.reason);return{error:{message:"Oops, the model is not supported. Please try again.",code:400,reason:"model_not_supported",responseIsFiltered:!1,modelName:d,modelProviderName:f}}}case"model_max_prompt_tokens_exceeded":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Model max prompt tokens exceeded",type:"server"},{error:{message:"Oops, the token limit exceeded. Try to shorten your prompt or start a new conversation.",code:400,reason:"model_max_prompt_tokens_exceeded",responseIsFiltered:!1}};case"successMultiple":case"tool_calls":case"unknown":return this.turnContext.turn.status="error",{error:{message:"Unknown server side error occurred. Please try again.",responseIsFiltered:!1}}}}async processSuccessfulFetchResult(e,r,n,o,s,c,l,u){if(e&&e.length>0){c.markAsDisplayed(),l.markAsDisplayed(),this.turnContext.turn.status="success",this.turnContext.turn.response={message:e,type:"model",references:this.turnContext.turn.response?.references},XEn(this.turnContext,s,e,r,n,u,l);let d=this.computeSuggestions?await this.fetchSuggestions(o,s,c,u):void 0;if(d){let{followUp:f,suggestedTitle:h}=d;return{followup:f.message!==""?f:void 0,suggestedTitle:h!==""?h:void 0}}return{}}return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"The model returned successful but did not contain any response text.",type:"meta"},{error:{message:Pn(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}}}async fetchSuggestions(e,r,n,o){let c=await new Lq(this.turnContext.ctx,this.chatFetcher).fetchRawSuggestions(this.turnContext,e,r,n);if(c===void 0)return;let l=this.enrichFollowup(c,r,n,o);return ot.debug(this.turnContext.ctx,"Computed followup",l),ot.debug(this.turnContext.ctx,"Computed suggested title",c.suggestedTitle),{followUp:l,suggestedTitle:c.suggestedTitle}}enrichFollowup(e,r,n,o){let s=n.extendedBy({messageSource:"chat.suggestions",suggestionId:Nt(),suggestion:"Follow-up from model"},{promptTokenLen:e.promptTokenLen,numTokens:e.numTokens});return n_n(this.turnContext.ctx,r,s,o),{message:e.followUp,id:s.properties.suggestionId,type:s.properties.suggestion}}processOffTopicFetchResult(e,r,n){let o="Sorry, but I can only assist with programming related questions.";return this.turnContext.turn.response={message:o,type:"offtopic-detection"},this.turnContext.turn.status="off-topic",e_n(this.turnContext.ctx,this.turnContext.conversation,r,o,e.properties.messageId,n,e),{error:{message:o,responseIsFiltered:!0}}}};p();var HJe=S.Union([S.String(),S.Number()]),nJ=S.Union([S.String(),S.Number()]),U$o=S.Union([S.Literal("included"),S.Literal("blocked"),S.Literal("notfound"),S.Literal("empty")]),GJe=S.Object({uri:S.String(),position:S.Optional(f0)}),Q$o=S.Object({type:S.Literal("file"),uri:S.String(),position:S.Optional(f0),visibleRange:S.Optional(Rf),selection:S.Optional(Rf),status:S.Optional(U$o),range:S.Optional(Rf)}),q$o=S.Object({type:S.Literal("directory"),uri:S.String()}),j$o=S.Object({type:S.Literal("tool"),uri:S.String(),name:S.Optional(S.String()),server:S.Optional(S.String()),description:S.Optional(S.String())}),qO=S.Union([Q$o,q$o,E1n,j$o]),jO=S.Union([S.Literal("panel"),S.Literal("inline")]),H$o=S.Union([S.Object({type:S.Literal("text"),text:S.String()}),S.Object({type:S.Literal("image_url"),imageUrl:S.Object({url:S.String(),detail:S.Optional(S.Union([S.Literal("low"),S.Literal("high")]))})})]),Sjt=S.Union([S.String(),S.Array(H$o)]),S1n=S.Object({request:Sjt,response:S.Optional(S.String()),agentSlug:S.Optional(S.String()),turnId:S.Optional(nJ),model:S.Optional(S.String())});function $Je(t){return typeof t=="string"?t:t.map(e=>e.type==="image_url"?{type:"image_url",image_url:{url:e.imageUrl.url,detail:e.imageUrl.detail}}:{type:"text",text:e.text})}a($Je,"convertToMessageContent");function VJe(t,e){if(t=JS(t),typeof t=="string")return t+e;let r=t.map(n=>n.type==="text").lastIndexOf(!0);if(r>=0){let n=[...t],o=n[r];return n[r]={type:"text",text:o.text+e},n}return[...t,{type:"text",text:e}]}a(VJe,"appendToMessage");var WJe=S.Union([S.Literal("Ask"),S.Literal("Agent"),S.Literal("InlineAgent")]),G$o=S.Object({type:S.String(),description:S.String()}),T1n=S.Object({name:S.String(),description:S.String(),inputSchema:S.Optional(S.Object({type:S.String(),properties:S.Record(S.String(),G$o),required:S.Array(S.String())})),confirmationMessages:S.Optional(S.Object({title:S.String(),message:S.String()}))}),qc=S.Object({uri:S.String(),name:S.String()}),$$o=S.Union([S.Literal("not-started"),S.Literal("in-progress"),S.Literal("completed")]),zJe=S.Object({id:S.Number(),title:S.String(),description:S.Optional(S.String()),status:$$o});Mo();var Tjt="generate-response",YJe=class extends Error{constructor(r,n,o,s){super(r);this.authorizationUri=n;this.agentSlug=o;this.agentName=s}static{a(this,"RemoteAgentAuthorizationError")}},lwe=class{constructor(e,r,n){this.agent=e;this.turnContext=r;this.chatFetcher=n;this.conversationProgress=r.ctx.get(wc),this.chatFetcher=this.chatFetcher??new cc(r.ctx),this.postProcessor=new kue(r,this.chatFetcher,!1),this.conversation=r.conversation,this.turn=r.turn}static{a(this,"RemoteAgentTurnProcessor")}async process(e,r,n,o){try{await this.processWithAgent(e,r,this.turnContext,o)}catch(s){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,s);let c=s instanceof Error?s.message:String(s);this.turn.status="error",this.turn.response={message:c,type:"meta"},s instanceof YJe?await this.endProgress({unauthorized:{authorizationUri:s.authorizationUri,agentSlug:s.agentSlug,agentName:s.agentName}}):await this.endProgress({error:{message:c,responseIsIncomplete:!0}})}}async processWithAgent(e,r,n,o){await this.conversationProgress.begin(this.conversation,this.turn,e);let s=await rl(this.turnContext.ctx,this.turnContext,{languageId:o?.detectedLanguageId??""});if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let c=await this.buildAgentPrompt(n);if(!c)await this.endTurnWithResponse(`No prompt created for agent ${this.agent.id}`,"error");else{let l={type:"user",prompt:JSON.stringify(c.messages,null,2),tokens:c.tokens};await n.ctx.get(Zh).inspectPrompt(l),await n.steps.start(Tjt,"Generating response");let u=this.augmentTelemetry(c,s,this.turn.template,o);if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let d=await this.fetchConversationResponse(n,c.messages,r,s.extendedBy({messageSource:"chat.user"},{promptTokenLen:c.tokens}),u,o);this.turn.status==="cancelled"&&this.turn.response?.type==="user"?await this.cancelProgress():(await this.finishGenerateResponseStep(d,n),await this.endProgress({error:d.error,followUp:d.followup,suggestedTitle:d.suggestedTitle,skillResolutions:c.skillResolutions}))}}async buildAgentPrompt(e){let r=this.createMessagesFromHistory(e),n=await this.computeCopilotReferences(e),o=this.getOrCreateAgentSessionId(e);return this.turn.agent&&(this.turn.agent.sessionId=o),this.turn.confirmationResponse?this.addConfirmationResponse(this.turn.confirmationResponse,r):r.push({role:"user",content:JS(e.turn.request.message),copilot_references:n.length>0?n:void 0}),{messages:r,tokens:-1,skillResolutions:[]}}getOrCreateAgentSessionId(e){let r=this.turn.agent?.agentSlug;if(r){for(let n of e.conversation.turns)if(n.agent?.agentSlug===r&&n.agent.sessionId)return n.agent.sessionId}return Nt()}addConfirmationResponse(e,r){r.push({role:"user",content:"",copilot_confirmations:[e]})}createMessagesFromHistory(e){return Dqt(e.conversation.turns.slice(0,-1),this.agent.slug).flatMap(r=>{let n=[];if(r.request&&n.push({role:"user",content:JS(r.request.message)}),r.response&&r.response.type==="model"){let o=y1n(r.response.references);n.push({role:"assistant",content:JS(r.response.message),copilot_references:o.length>0?o:void 0})}return n})}async computeCopilotReferences(e){return await b1n(e)}async endTurnWithResponse(e,r){this.turn.response={type:"meta",message:e},this.turn.status=r,await this.conversationProgress.report(this.conversation,this.turn,{reply:e}),await this.endProgress()}async fetchConversationResponse(e,r,n,o,s,c){n.onCancellationRequested(async()=>{await this.cancelProgress()});let l=new Uq((h,m,g,A,y,E)=>{let _=y?{...y,agentSlug:this.agent.slug}:void 0;this.conversationProgress.report(this.conversation,this.turn,{reply:h,annotations:m,references:g,notifications:A.map(v=>({message:v.message,severity:"warning"})),confirmationRequest:_,thinking:E}),this.turn.response?(this.turn.response.message=VJe(this.turn.response.message,h),this.turn.response.references.push(...g)):this.turn.response={message:h,type:"model",references:g},this.turn.annotations.push(...m??[]),_&&(this.turn.confirmationRequest=_)}),u=await this.turnContext.ctx.get(Ft).getGitHubSession(),d={engineName:"agents",endpoint:this.agent.endpoint??this.agent.slug,messages:r,uiKind:"conversationPanel",intentParams:{intent:!0,intent_threshold:.7,intent_content:Pn(this.turn.request.message)},authToken:u?.accessToken,copilot_thread_id:this.turn.agent?.sessionId,llmInteraction:e.toLlmInteraction(),turnId:String(this.turn.id)},f=await this.chatFetcher.fetchResponse(d,n,o,(h,m)=>l.isFinishedAfter(h,m));return this.ensureAgentIsAuthorized(f),await this.postProcessor.postProcess(f,n,l.appliedText,o,s.extendedBy(this.addExtensibilityInfoTelemetry()),Pn(this.turn.request.message),"conversationPanel",c)}ensureAgentIsAuthorized(e){if(e.type==="agentAuthRequired")throw this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Authorization required",type:"server"},new YJe("Authorization required",e.authUrl,this.agent.slug,this.agent.name)}augmentTelemetry(e,r,n,o){return wxe(this.conversation,"conversationPanel",Pn(this.turn.request.message).length,e.tokens,n?.templateId,void 0,r,e.skillResolutions)}addExtensibilityInfoTelemetry(){return{extensibilityInfoJson:JSON.stringify({agent:this.agent.slug,outgoingReferences:this.turn.request.references?.map(e=>e.type)??[],incomingReferences:this.turn.response?.references?.map(e=>e.type)??[]})}}async finishGenerateResponseStep(e,r){e.error?await r.steps.error(Tjt,e.error.message):await r.steps.finish(Tjt)}async endProgress(e){await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}};var uwe=class{constructor(e,r,n,o,s,c){this.id=e;this.slug=r;this.name=n;this.description=o;this.avatarUrl=s;this.endpoint=c}static{a(this,"RemoteAgent")}additionalSkills(){return[]}turnProcessor(e){return new lwe(this,e)}},KJe=class extends uwe{static{a(this,"ExtensibilityPlatformAgent")}constructor(){super(0,"github","GitHub","Get answers grounded in web search, code search, and your enterprise's knowledge bases.","https://avatars.githubusercontent.com/u/9919?s=200&v=4","chat")}turnProcessor(e){return new lwe(this,e)}};p();var V$o="github",t2=class{static{a(this,"RemoteAgentRegistry")}},JJe=class extends t2{constructor(r){super();this.ctx=r;this._agents=void 0;this._lastFetchTime=0}static{a(this,"CapiRemoteAgentRegistry")}async agents(){return this.shouldRefreshAgents()&&(this._agents=await this.fetchAgents()),this._agents!=null?this._agents.slice():[]}shouldRefreshAgents(){return!this._agents||!this._lastFetchTime?!0:this.isLastFetchOlderOneHour()}isLastFetchOlderOneHour(){return Date.now()-this._lastFetchTime>36e5}async fetchAgents(){let r=await HY(this.ctx,"/agents");return r.ok?(this._lastFetchTime=Date.now(),this.parseAgents(await r.text())):(Nr.error(this.ctx,"Failed to fetch agents from CAPI",{status:r.status,statusText:r.statusText}),[])}parseAgents(r){let n;try{n=JSON.parse(r).agents,Array.isArray(n)||Nr.error(this.ctx,"Expected 'agents' to be an array")}catch(o){return r.includes("access denied")||Nr.warn(this.ctx,"Invalid remote agent response:",r,o),[]}return n.filter(o=>o.slug!==V$o).map(o=>new uwe(o.id,o.slug,o.name,o.description,o.avatar_url))}};p();p();var I1n=fe(require("fs")),Z_=fe(require("path"));var Ijt=[".test",".spec","_test","Test","_spec","_test","Tests",".Tests","Spec"],xjt="test_",dwe={js:{suffix:[".test",".spec"],location:"sameFolder"},ts:{suffix:[".test",".spec"],location:"sameFolder"},go:{suffix:["_test"],location:"sameFolder"},java:{suffix:["Test"],location:"testFolder"},php:{suffix:["Test"],location:"testFolder"},dart:{suffix:["_test"],location:"testFolder"},cs:{suffix:["Test"],location:"testFolder"},rb:{suffix:["_test","_spec"],location:"testFolder"},py:{prefix:"test_",location:"testFolder"},ps1:{suffix:[".Tests"],location:"testFolder"},kt:{suffix:["Test"],location:"testFolder"}},fwe=class{constructor(e,r,n=void 0){this.ctx=e;this.fileExists=r;this.baseUri=n}static{a(this,"TestFileFinder")}async findTestFileForSourceFile(e){let r=Ki(e),n=Z_.extname(r).replace(".",""),o=dwe[n]??{location:"sameFolder",prefix:xjt,suffix:Ijt},s=[];if(o.prefix&&s.push(o.prefix+r),o.suffix)for(let d of o.suffix??[]){let f=r.replace(`.${n}`,d+"."+n);s.push(f)}let c=o.location??"sameFolder",l;if(c==="sameFolder"){if(l=Us(mf(e)),l===void 0)return}else{let d=Us(e);if(d===void 0)return;l=this.determineTestFolder(d,c)}for(let d of s){let f=Z_.join(l,d),h=this.parseTestFilePath(f);if(h&&await this.fileExists(h))return h}let u=ts(l);if(await this.fileExists(u))return wa(u,s[0])}parseTestFilePath(e){try{return ts(e)}catch(r){Nr.error(this.ctx,`Failed to parse test file path: ${e}`,r);return}}async findImplFileForTestFile(e){let r=Ki(e),n=Z_.extname(r).replace(".",""),o=dwe[n]??{location:"sameFolder",prefix:xjt,suffix:Ijt},s=[];if(o.prefix&&s.push(r.substring(o.prefix.length)),o.suffix)for(let u of o.suffix??[]){let f=r.substring(0,r.length-u.length-1-n.length)+"."+n;s.push(f)}let c=o.location??"sameFolder",l;c==="sameFolder"?l=mf(e):l=this.determineImplFolder(e);for(let u of s){let d=wa(l,u);if(await this.fileExists(d))return d}}findExampleTestFile(e){let r=Us(e);if(r===void 0)return;let n=Z_.extname(Ki(e)).replace(".",""),o,s=dwe[n]?.location??"sameFolder";s==="sameFolder"?o=Z_.dirname(r):o=this.determineTestFolder(r,s);let c=this.findFiles(o,`.${n}`,dwe[n]);if(c.length>0)return ts(c[0])}findFiles(e,r,n){let o=this._readdir(e),s=[];for(let c of o){let l=`${e}${Z_.sep}${c}`;n?.prefix&&c.startsWith(n.prefix)&&s.push(l),n?.suffix&&n?.suffix.some(u=>c.endsWith(u+r))&&s.push(l)}return s}_readdir(e){return I1n.readdirSync(e,{withFileTypes:!0}).filter(r=>r.isFile()).map(r=>r.name)}determineTestFolder(e,r){let n=(this.baseUri&&Us(this.baseUri))??"",o=Z_.extname(e).replace(".",""),s=this.getRelativeTestFolder(e,n,o,r);return[n,...s].filter(c=>c).join(Z_.sep)}getRelativeTestFolder(e,r,n,o){let s=Z_.dirname(e).replace(r,"");switch(n){case"php":case"dart":case"py":return["tests"];case"ps1":return["Tests"];case"rb":return["test",s];case"cs":return[s.replace("src","src/tests")];case"java":case"scala":case"kt":return[s.replace(/src[\\/]main/,"src/test")];default:return o==="testFolder"?[s.replace("src","test")]:[s]}}determineImplFolder(e){let r=Z_.extname(Ki(e)).replace(".",""),n=mf(e);switch(r){case"php":case"dart":case"py":return n.replace("tests","src");case"ps1":return n.replace("Tests","src");case"rb":return n.replace("/test","");case"cs":return n.replace("src/tests","src");case"java":case"scala":case"kt":return n.replace("src/test","src/main");default:return n.replace("test/","src/")}}};function pwe(t){let e=Ki(t),r=Z_.extname(e),n=dwe[r.replace(".","")];return n?!(n.suffix&&!n.suffix.some(s=>e.endsWith(s+r))||n.prefix&&!e.startsWith(n.prefix)):!!(Ijt.some(s=>e.endsWith(s+r))||e.startsWith(xjt))}a(pwe,"isTestFile");p();var wjt=class extends Error{static{a(this,"UserQueryParserError")}constructor(e){super(String(e),{cause:e}),this.name="UserQueryParserError"}};async function x1n(t,e){let r=t.ctx,n=await xo.getModelConfiguration(r,"synonyms",{tool_calls:!0}),o={promptType:"synonyms",modelConfiguration:n},s=await r.get(NA).toPrompt(t,o);if(!s.toolConfig)return;let c={modelConfiguration:n,uiKind:"conversationPanel",messages:s.messages,tools:s.toolConfig?.tools,tool_choice:s.toolConfig?.tool_choice,llmInteraction:t.toLlmInteraction()},l=new cc(r),u=await rl(r,t),d=await l.fetchResponse(c,e,u.extendedBy({messageSource:"chat.synonyms"}));if(d.type==="success"&&d.toolCalls&&d.toolCalls.length>0){let f=d.toolCalls[0],h=s.toolConfig?.extractArguments(f).keywords;return!h||!Array.isArray(h)?void 0:(ot.debug(r,`UserQueryParser: Parsed ${h.length} keywords from the original user query: ${h.join(", ")}`),h.length?h:void 0)}else{let f="reason"in d?d.reason:"";xa(r,new wjt(`Failed to request user query synonyms, result type: ${d.type}, reason: ${f}`),"UserQueryParser.parseUserQuery")}}a(x1n,"parseUserQuery");p();p();p();p();var Yo=class t{static{a(this,"Position")}constructor(e,r){this.lineNumber=e,this.column=r}with(e=this.lineNumber,r=this.column){return e===this.lineNumber&&r===this.column?this:new t(e,r)}delta(e=0,r=0){return this.with(this.lineNumber+e,this.column+r)}equals(e){return t.equals(this,e)}static equals(e,r){return!e&&!r?!0:!!e&&!!r&&e.lineNumber===r.lineNumber&&e.column===r.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,r){return e.lineNumbern||e===n&&r>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=e,this.endColumn=r):(this.startLineNumber=e,this.startColumn=r,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.columne.endColumn)}static strictContainsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.column<=e.startColumn||r.lineNumber===e.endLineNumber&&r.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumn<=e.startColumn||r.endLineNumber===e.endLineNumber&&r.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,r){let n,o,s,c;return r.startLineNumbere.endLineNumber?(s=r.endLineNumber,c=r.endColumn):r.endLineNumber===e.endLineNumber?(s=r.endLineNumber,c=Math.max(r.endColumn,e.endColumn)):(s=e.endLineNumber,c=e.endColumn),new t(n,o,s,c)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,r){let n=e.startLineNumber,o=e.startColumn,s=e.endLineNumber,c=e.endColumn,l=r.startLineNumber,u=r.startColumn,d=r.endLineNumber,f=r.endColumn;return nd?(s=d,c=f):s===d&&(c=Math.min(c,f)),n>s||n===s&&o>c?null:new t(n,o,s,c)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,r){return!e&&!r?!0:!!e&&!!r&&e.startLineNumber===r.startLineNumber&&e.startColumn===r.startColumn&&e.endLineNumber===r.endLineNumber&&e.endColumn===r.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new Yo(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new Yo(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,r){return new t(this.startLineNumber,this.startColumn,e,r)}setStartPosition(e,r){return new t(e,r,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,r=e){return new t(e.lineNumber,e.column,r.lineNumber,r.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,r){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};var w1n=250;function MA(t){let e;if(typeof t.tokenBudget=="number"&&(e=Math.floor(t.tokenBudget/w1n)),typeof t.maxResults=="number"&&(e=typeof e=="number"?Math.min(t.maxResults,e):t.maxResults),typeof e!="number")throw new Error("Either maxResults or tokenBudget must be provided");return e}a(MA,"getMaxChunks");var R1n=32e3,k1n=2e4,hwe=.75;p();p();function OA(t){let e=t.matchAll(/^\s*(```+)/gm),r=Math.max(3,...Array.from(e,n=>n[1].length+1));return"`".repeat(r)}a(OA,"getFenceForCodeBlock");p();var pTn=fe(Sl()),hTn=fe(nh());p();var zC=class t{constructor(e){this.id=e}static{a(this,"EmbeddingType")}static{this.text3small_512=new t("text-embedding-3-small-512")}static{this.metis_1024_I16_Binary=new t("metis-1024-I16-Binary")}toString(){return this.id}equals(e){return this.id===e.id}};var rWo=Object.freeze({[zC.text3small_512.id]:{model:"text-embedding-3-small",dimensions:512,quantization:{query:"float32",document:"float32"}},[zC.metis_1024_I16_Binary.id]:{model:"metis-I16-Binary",dimensions:1024,quantization:{query:"float16",document:"binary"}}});function Hjt(t){return rWo[t.id]}a(Hjt,"getWellKnownEmbeddingTypeInfo");function nWo(t,e){let r=0,n=Math.min(t.length,e.length);for(let o=0;o({distance:mwe(l,t),value:c})).filter(c=>c.distance.value>o).sort((c,l)=>l.distance.value-c.distance.value).slice(0,r).map(c=>({distance:c.distance,value:c.value}));if(s.length&&typeof n?.maxSpread=="number"){let c=s.at(0).distance.value*(1-n.maxSpread);return s.filter(u=>u.distance.value>=c)}return s}a(j1n,"rankEmbeddings");p();p();var dF=fe(nl()),fTn=fe(nh());var WO=new pe("GitHubCodeSearch"),zKo=300*1e3,qZe=class{constructor(e){this._indexedCommits=new Map;this._indexedRepos=new Map;this._ctx=e,this._refreshTimer=new dF.IntervalTimer,this.startPeriodicRefresh()}static{a(this,"GithubCodeSearchService")}getIndexedCommit(e){return this._indexedCommits.get(e)}setIndexedCommit(e,r){this._indexedCommits.get(e)!==r&&this._indexedCommits.set(e,r)}startPeriodicRefresh(){this._refreshTimer.cancelAndSet(()=>{this.updateIndexedRepoCommit()},zKo)}updateIndexedRepoCommit(){if(this._indexedRepos.size!==0)for(let[e,r]of this._indexedRepos.entries())this._indexedCommits.get(e)&&(async()=>{try{let o=await this._ctx.get(Ft).getGitHubSession();if(!o)return;let{currentStatus:s,indexedCommit:c}=await this.getRemoteIndexState(o,r,{isCancellationRequested:!1});if(s==="ready"&&c){let l=this._indexedCommits.get(e);l!==c&&(this._indexedCommits.set(e,c),WO.info(this._ctx,`Updated indexed commit for ${r.owner}/${r.name}`,{oldCommit:l,newCommit:c}))}}catch(o){WO.warn(this._ctx,`Failed to update indexed commit for ${e}`,o)}})()}async ensureReposIndexed(e,r,n){return await Promise.all(r.map(async o=>{let s=o?.baseFolder.uri;if(!s||n.isCancellationRequested||this._indexedRepos.has(s))return;let{currentStatus:c,indexedCommit:l}=await this.getRemoteIndexState(e,o,n);if(WO.info(this._ctx,`Index status check for ${o.owner}/${o.name}`,{status:c,indexedCommit:l}),c==="ready")this._indexedRepos.set(s,o),l&&this.setIndexedCommit(s,l);else if(c==="not-yet-indexed")try{await this.tryToInstantIndexRepo(e,o,n),WO.info(this._ctx,`Instant indexing completed for ${o.owner}/${o.name}`)}catch(u){WO.warn(this._ctx,`Instant indexing failed for ${o.owner}/${o.name}`,u)}})),r.filter(o=>this._indexedRepos.has(o.baseFolder.uri))}async tryToInstantIndexRepo(e,r,n){await(0,dF.raceTimeout)((async()=>{if(!await(0,dF.raceCancellationError)(this.triggerIndexing(e,"auto",r,n),n))return!1;let c=5,l=1e3;for(;c-- >0;){await(0,dF.raceCancellationError)((0,dF.timeout)(l),n);let{currentStatus:u,indexedCommit:d}=await this.getRemoteIndexState(e,r,n);if(u==="ready"){this._indexedRepos.set(r.baseFolder.uri,r),d&&this.setIndexedCommit(r.baseFolder.uri,d);break}else if(u!=="building-index"){let f=`Instant indexing for '${r.owner}/${r.name}' failed. Found unexpected status: '${u}'`;throw WO.error(this._ctx,f),new Error(f)}}return!0})(),8e3)}async getRemoteIndexState(e,r,n){if(!r.owner||!r.name)return{currentStatus:"not-indexable"};let o=r.owner+"/"+r.name,s=await Bd(this._ctx,e,`repos/${o}/copilot_internal/embeddings_index`,{method:"GET"});if(!s.ok)return WO.error(this._ctx,`Failed to fetch indexing status. Response: ${s.status}.`),{currentStatus:"not-yet-indexed"};let c=await s.json();return WO.debug(this._ctx,`${o} - semantic_code_search_ok: ${c.semantic_code_search_ok}`),c.semantic_code_search_ok?{currentStatus:"ready",indexedCommit:c.semantic_commit_sha}:c.semantic_indexing_enabled?{currentStatus:"building-index"}:{currentStatus:"not-yet-indexed"}}async triggerIndexing(e,r,n,o){let s=jue(this._ctx),c=n.owner+"/"+n.name,l=await Bd(this._ctx,e,`repos/${c}/copilot_internal/embeddings_index`,{headers:s,method:"POST",json:{auto:r==="auto"}});return l.ok?!0:(WO.error(this._ctx,`Failed to request indexing for '${c}'. Response: ${l.status}. ${await l.text()}`),!1)}async searchRepo(e,r,n,o,s,c){let l=jue(this._ctx),u=await Bd(this._ctx,e,"embeddings/code/search",{headers:l,method:"POST",json:{scoping_query:`repo:${n.owner}/${n.name}`,prompt:KKo(o,7800),include_embeddings:!1,limit:s,embedding_model:r.id}});if(!u.ok)throw new Error(`Code search semantic search failed with status: ${u.status}`);let d=await u.json();if(!Array.isArray(d.results))throw new Error("Code search semantic search unexpected response json shape");return YKo(this._ctx,d,n)}dispose(){this._refreshTimer.dispose(),this._indexedCommits.clear(),this._indexedRepos.clear()}};function jue(t){let e=t.get(Ir);return{"X-Client-Application":`${U1(e.getEditorInfo())}`,"X-Client-Source":U1(e.getEditorPluginInfo()),"X-Client-Feature":"Agent <- codebaseTool"}}a(jue,"editorVersionHeaders");async function YKo(t,e,r){let o=[],s=new zC(e.embedding_model),c=Fs(r.baseFolder.uri);return await Promise.all(e.results.map(l=>{let u;try{u=wa(c,l.location.path)}catch(d){WO.error(t,`Error joining path for ${l.location.path}:`,d);return}o.push({chunk:{file:u,text:jZe(l.chunk.text),rawText:void 0,range:new fTn.Range(l.chunk.line_range.start+1,1,l.chunk.line_range.end+1,1),isFullFile:!1},distance:{embeddingType:s,value:l.distance}})})),{chunks:o,outOfSync:!1}}a(YKo,"parseGithubCodeSearchResponse");function KKo(t,e){if(t.length*4<=e)return t;let o=new TextEncoder().encode(t);if(o.length<=e)return t;let s=o.slice(0,e);return new TextDecoder().decode(s,{stream:!0})}a(KKo,"truncateToMaxUtf8Length");function jZe(t){let e=JKo(t);return e.length>=3&&e[0].startsWith("File: ")&&e[1].startsWith("```")&&e.at(-1)?.startsWith("```")?e.slice(2,-1).join(` +`):t}a(jZe,"stripChunkTextMetadata");function JKo(t){return t.split(/\r\n|\r|\n/)}a(JKo,"splitLines");var a2=fe(nl()),mTn=fe(Due()),gTn=fe(om());var Mwe=new pe("ChunkingEndpointClient"),_Gt=class t{constructor(e){this.ctx=e;this._maxParallelChunksRequests=8;this._maxAttempts=3;this.targetQuota=80;this.requestQueue=new mTn.LinkedList;this._numberInFlightRequests=0;this._lastSendTime=Date.now();this._isPumping=!1}static{a(this,"RequestRateLimiter")}static{this._abuseLimit=1e3/40}async enqueue(e,r){let n=new a2.DeferredPromise;return r.onCancellationRequested(()=>n.cancel()),this.requestQueue.push({task:e,attempt:0,deferred:n,token:r}),await this.pump(),n.p}async pump(){if(!this._isPumping)try{for(this._isPumping=!0;!this.requestQueue.isEmpty();){this._rateLimitTimeout&&(await this._rateLimitTimeout,this._rateLimitTimeout=void 0);let e=Date.now()-this._lastSendTime;if(e=this._maxParallelChunksRequests){await(0,a2.timeout)(10);continue}if(this._latestRateLimitHint){let o=Date.now();if(othis.targetQuota){let o=Date.now(),s=this._latestQuotaUsed.quota-this.targetQuota,c=o-this._latestQuotaUsed.timestamp,l=2500,u=1e3,d=s/(100-this.targetQuota);d*=Math.max(1-c/l,0);let f=d*u;f>0&&await(0,a2.timeout)(Math.min(f,u))}let r=this.requestQueue.shift();if(r.token.isCancellationRequested){await r.deferred.cancel();continue}this._numberInFlightRequests++,this._lastSendTime=Date.now(),r.task(r.attempt).then(async o=>{if(this.updateQuotasFromResponse(o),r.token.isCancellationRequested){await r.deferred.cancel();return}if(o.ok){await r.deferred.complete(o);return}if(r.attempt0&&(this._rateLimitTimeout=(0,a2.timeout)(s*1e3)),this.requestQueue.unshift({task:r.task,attempt:r.attempt+1,deferred:r.deferred,token:r.token}),await this.pump();return}await r.deferred.complete(o)}).catch(async o=>{await r.deferred.error(o)}).finally(()=>{this._numberInFlightRequests--})}}finally{this._isPumping=!1}}updateQuotasFromResponse(e){let r=Date.now();try{let n=e.headers.get("x-ratelimit-remaining"),o=e.headers.get("x-ratelimit-reset");n&&o&&(this._latestRateLimitHint={timestamp:r,remaining:parseFloat(n),resetAt:parseFloat(o)*1e3});let s=e.headers.get("x-github-total-quota-used");s&&(this._latestQuotaUsed?this._latestQuotaUsed={timestamp:r,quota:parseFloat(s)}:this._latestQuotaUsed={timestamp:r,quota:parseFloat(s)})}catch(n){Mwe.error(this.ctx,"Error parsing rate limit/quota headers",n)}}getRequestRetryDelay(e){try{let r=e.headers.get("retry-after");if(r){let n=parseFloat(r);if(!isNaN(n))return n}}catch{Mwe.error(this.ctx,"Error parsing retry-after header")}try{let r=e.headers.get("x-ratelimit-reset");if(r){let n=parseFloat(r);if(!isNaN(n)){let o=Math.floor(Date.now()/1e3);return n-o}}}catch{Mwe.error(this.ctx,"Error parsing x-ratelimit-reset header")}return e.status===408?.25:2}},HZe=class{constructor(e){this.ctx=e;this._requestLimiter=new _Gt(e)}static{a(this,"ChunkingEndpointClientImpl")}computeChunks(e,r,n,o,s,c,l){return this.doComputeChunksAndEmbeddings(e,r,n,o,{qos:s,computeEmbeddings:!1},c,l)}async computeChunksAndEmbeddings(e,r,n,o,s,c,l){return await this.doComputeChunksAndEmbeddings(e,r,n,o,{qos:s,computeEmbeddings:!0},c,l)}async doComputeChunksAndEmbeddings(e,r,n,o,s,c,l){let u=await(0,a2.raceCancellationError)(n.getText(),l);if((0,gTn.isFalsyOrWhitespace)(u))return[];try{let d=a(async m=>{let g=jue(this.ctx);return await Bd(this.ctx,e,"chunks",{headers:g,method:"POST",json:{embed:s.computeEmbeddings,qos:s.qos,content:u,path:Us(n.uri),local_hashes:c?Array.from(c.keys()):[],embedding_model:r.id}})},"makeRequest");o.recomputedFileCount++,o.sentContentTextLength+=u.length;let f=await(0,a2.raceCancellationError)(this._requestLimiter.enqueue(d,l),l);if(!f.ok){Mwe.error(this.ctx,`Error chunking '${n.uri.toString()}'. Status: ${f.status}.`);return}let h=await f.json();return h.chunks.length?(0,pTn.coalesce)(h.chunks.map(m=>{let g=new hTn.Range(m.line_range.start+1,1,m.line_range.end+1,1),A=c?.get(m.hash);if(A)return{chunk:{file:n.uri.toString(),text:jZe(A.chunk.text),rawText:void 0,range:g,isFullFile:A.chunk.isFullFile},chunkHash:m.hash,embedding:A.embedding};if(typeof m.text!="string")return;let y;if(m.embedding?.embedding){let E=new zC(h.embedding_model);if(!E.equals(r))throw new Error(`Unexpected embedding model. Got: ${E.id}. Expected: ${r.id}`);y={type:E,value:new Float32Array(m.embedding.embedding)}}if(!(s.computeEmbeddings&&!y))return{chunk:{file:n.uri.toString(),text:jZe(m.text),rawText:void 0,range:g,isFullFile:!1},chunkHash:m.hash,embedding:y}})):[]}catch(d){Mwe.error(this.ctx,`Error chunking '${n.uri.toString()}'`,d);return}}};p();p();var AE={Tfidf:"semantic.search.tfidf",Embeddings:"semantic.search.embeddings",Remote:"semantic.search.remote",Aggregate:"semantic.search.aggregate"},m0=class t{static{a(this,"WorkspaceChunkSearchTelemetry")}static sendSuccess(e,r,n,o){let s={status_text:"success",...n},c=Vt.createAndMarkAsIssued(s,o);ft(e,r,c),cr(e,r,c.properties,c.measurements)}static sendFailure(e,r,n){let o={status_text:"failure"};xa(e,n,r,o),Cs(e,r,n,o)}static sendTfidfSuccess(e,r,n,o,s,c,l,u,d){t.sendSuccess(e,AE.Tfidf,{source:d},{timeTakenMs:r,rankingTimeMs:n,rerankingTimeMs:o,localSnippetCount:l,chunkCount:s,fileCount:c,totalFileCount:u})}static sendTfidfFailure(e,r){t.sendSearchFailure(e,AE.Tfidf,r)}static sendEmbeddingsSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,AE.Embeddings,{source:l},{timeTakenMs:r,embeddingsTimeMs:n,chunkCount:o,fileCount:s,totalFileCount:c})}static sendEmbeddingsFailure(e,r){t.sendSearchFailure(e,AE.Embeddings,r)}static sendEmbeddingsSkipped(e,r){t.sendSkipped(e,AE.Embeddings,r)}static sendRemoteSuccess(e,r,n,o,s){t.sendSuccess(e,AE.Remote,{provider:s},{timeTakenMs:r,chunkCount:n,fileCount:o})}static sendRemoteFailure(e,r){t.sendSearchFailure(e,AE.Remote,r)}static sendRemoteSkipped(e,r){t.sendSkipped(e,AE.Remote,r)}static sendSearchFailure(e,r,n){t.sendFailure(e,r,n)}static sendSkipped(e,r,n){let o={status_text:"skipped",reason:n},s=Vt.createAndMarkAsIssued(o,{});ft(e,r,s),cr(e,r,s.properties,s.measurements)}static sendAggregateSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,AE.Aggregate,{provider:r,source:l},{timeTakenMs:n,chunkCount:o,fileCount:s,workspaceCount:c})}static sendAggregateFailure(e,r){t.sendFailure(e,AE.Aggregate,r)}};var ATn=fe(Sl()),yTn=fe(nl()),vGt=fe(GO());var fF=new pe("Remote Search"),GZe=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._localDiffSearch=n;this._githubCodeSearchService=o;this.id="codesearch";this.localDiffSearchTimeout=15e3}static{a(this,"CodeSearchChunkSearch")}async isAvailable(e){return(await this.getRepos(e)).length>0}async getRepos(e){if(!e?.length)return[];let r=this.ctx.get(Tf),o=(await Promise.all(e.map(async c=>await r.getRepo({uri:c})))).filter(c=>c!==void 0).filter(c=>c.isGitHub()&&c.owner&&c.name),s=new Map;for(let c of o){let l=`${c.owner}/${c.name}`;s.has(l)||s.set(l,c)}return Array.from(s.values())}async searchWorkspace(e,r,n){let o=new vGt.StopWatch,s=await this.getRepos(r.workspaceFolders);if(fF.info(this.ctx,"Starting workspace search",{rawQuery:e.rawQuery,repoCount:s.length,repos:s.map(P=>`${P.owner}/${P.name}`),maxResults:MA(r)}),s.length===0)throw fF.error(this.ctx,"No GitHub repositories found"),m0.sendRemoteSkipped(this.ctx,"no_github_repos"),new Error("No GitHub repositories found in CodeSearchChunkSearch");let c=await this.ctx.get(Ft).getGitHubSession();if(!c)throw fF.error(this.ctx,"No GitHub session found"),m0.sendRemoteSkipped(this.ctx,"no_github_session"),new Error("No GitHub session found in CodeSearchChunkSearch");let l=await this._githubCodeSearchService.ensureReposIndexed(c,s,n);if(l.length===0)throw fF.error(this.ctx,"Remote index not ready for any repositories"),m0.sendRemoteSkipped(this.ctx,"remote_index_not_ready"),new Error("Remote index not ready");let u=MA(r),d=Promise.all(l.map(async P=>{Wh(n);let D=await e.resolveQuery(n),N=new vGt.StopWatch,L=await this._githubCodeSearchService.searchRepo(c,this._embeddingType,P,D,u,n);return fF.info(this.ctx,`Search completed for ${P.owner}/${P.name}`,{searchTime:N.elapsed(),chunkCount:L.chunks.length}),L})),f=await this._localDiffSearch.getLocalDiff(r.workspaceFolders),h=new Set(f),m=this._localDiffSearch.shouldDoLocalDiffSearch(f,r.workspaceFolders);fF.info(this.ctx,"Local diff files detected",{diffFileCount:f.length,allowLocalDiffSearch:m});let g;m&&(g=(0,yTn.raceTimeout)(this._localDiffSearch.searchLocalDiff(f,e,r,n),this.localDiffSearchTimeout,()=>{fF.warn(this.ctx,"Local diff search timed out",{timeout:this.localDiffSearchTimeout})}));let[A,y]=await Promise.all([d,g?.catch(P=>{fF.error(this.ctx,"Local diff search failed",P)})??Promise.resolve(void 0)]),E=(0,ATn.coalesce)(A).flatMap(P=>P.chunks),_=y?.isOk()?y.val.result.chunks:[],v=_.length>0?[...E.filter(P=>!h.has(P.chunk.file)),..._]:E,b=v.length,w=new Set(v.map(P=>P.chunk.file)).size,R=o.elapsed();fF.info(this.ctx,`Search completed successfully in ${R}ms`,{totalTime:R,totalChunkCount:b,uniqueFileCount:w,indexedRepoCount:l.length,localDiffChunkCount:_.length,localDiffStrategy:y?.isOk()?y.val.strategy:"none"});let x=y?.isOk()?"mixed":"codesearch";return m0.sendRemoteSuccess(this.ctx,R,b,w,x),{chunks:v}}};p();p();var hwn=require("node:url"),mwn=require("path");p();var sXe=fe(_Tn(),1);p();var CGt=new WeakMap;function Gue(...t){let e=new String(t);return CGt.set(e,t),e}a(Gue,"c");function pw(t){return t instanceof String&&CGt.has(t)}a(pw,"r");function $ue(t){return CGt.get(t)??[]}a($ue,"o");var iXe=fe(xTn(),1),nxn=require("child_process");var qxn=fe(IGt(),1),Zxn=require("node:path");p();function*wTn(t,e){let r=e==="global";for(let n of t)n.isGlobal===r&&(yield n)}a(wTn,"U");var SJo=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),TJo=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),IJo=new Set(["edit","remove-section","rename-section","set","unset"]),xJo=new Set(["get","get-color","get-colorbool","list"]);function wJo(t,e){for(let{name:n}of wTn(t,"task")){if(SJo.has(n))return Yue(!0,e);if(TJo.has(n))return Yue(!1,e)}let r=e.at(0)?.toLowerCase();return r===void 0?null:IJo.has(r)?Yue(!0,e.slice(1)):xJo.has(r)?Yue(!1,e.slice(1)):e.length===1?Yue(!1,e):Yue(!0,e)}a(wJo,"F");function Yue(t=!1,e=[]){let r=e.at(0)?.toLowerCase();return r===void 0?null:{isWrite:t,isRead:!t,key:r,value:e.at(1)}}a(Yue,"p");function RJo(t,e){return e.isWrite&&e.value!==void 0?{key:e.key,value:e.value,scope:t}:{key:e.key,scope:t}}a(RJo,"A");function kJo(t){let e=t?.indexOf("=")||-1;return!t||e<0?null:{key:t.slice(0,e).trim().toLowerCase(),value:t.slice(e+1)}}a(kJo,"M");function PJo(t){for(let{name:e}of wTn(t,"task"))switch(e){case"--global":return"global";case"--system":return"system";case"--worktree":return"worktree";case"--local":return"local";case"--file":case"-f":return"file"}return"local"}a(PJo,"N");function DJo({name:t}){if(t==="-c"||t==="--config")return"inline";if(t==="--config-env")return"env"}a(DJo,"G");function*NJo(t){for(let e of t){let r=DJo(e),n=r&&kJo(e.value);n&&(yield{...n,scope:r})}}a(NJo,"O");function MJo(t,e,r){let n={read:[],write:[...NJo(e)]};return t==="config"&&OJo(n,PJo(e),wJo(e,r)),n}a(MJo,"L");function OJo(t,e,r){if(r===null)return;let n=RJo(e,r);r.isWrite?t.write.push(n):t.read.push(n)}a(OJo,"$");var RTn={short:new Map([["c",!0]])},LJo={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...RTn.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},BJo={clone:{short:new Map([["b",!0],["j",!0],["l",!1],["n",!1],["o",!0],["q",!1],["s",!1],["u",!0]]),long:new Set(["branch","config","jobs","origin","upload-pack","u","template"])},commit:{short:new Map([["C",!0],["F",!0],["c",!0],["m",!0],["t",!0]]),long:new Set(["file","message","reedit-message","reuse-message","template"])},config:{short:new Map([["e",!1],["f",!0],["l",!1]]),long:new Set(["blob","comment","default","file","type","value"])},fetch:{short:new Map,long:new Set(["upload-pack"])},init:{short:new Map,long:new Set(["template"])},pull:{short:new Map,long:new Set(["upload-pack"])},push:{short:new Map,long:new Set(["exec","receive-pack"])}},FJo={short:new Map,long:new Set};function UJo(t){let e=BJo[t??""]??FJo;return{short:new Map([...RTn.short.entries(),...e.short.entries()]),long:e.long}}a(UJo,"I");function kTn(t,e=LJo){if(t.startsWith("--")){let r=t.indexOf("=");if(r>2)return[{name:t.slice(0,r),value:t.slice(r+1),needsNext:!1}];let n=t.slice(2);return[{name:t,needsNext:e.long.has(n)}]}if(t.length===2){let r=t.charAt(1),n=e.short.get(r);return[{name:t,needsNext:n===!0}]}return QJo(t,e.short)}a(kTn,"b");function QJo(t,e){let r=t.slice(1).split(""),n=[];for(let o=0;oe.has(u)))return n.push({name:`-${s}`,value:l,needsNext:!1}),n}n.push({name:`-${s}`,needsNext:c})}return n}a(QJo,"W");function qJo(t,e=[]){let r=0;for(;ra(function(){return t&&(e=(0,t[YGt(t)[0]])(t=0)),e},"__init"),"__esm"),rZo=a((t,e)=>a(function(){return e||(0,t[YGt(t)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),sm=a((t,e)=>{for(var r in e)zGt(t,r,{get:e[r],enumerable:!0})},"__export"),nZo=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of YGt(e))!tZo.call(t,o)&&o!==r&&zGt(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=eZo(e,o))||n.enumerable});return t},"__copyProps"),oh=a(t=>nZo(zGt({},"__esModule",{value:!0}),t),"__toCommonJS"),pF,Yq=Zr({"src/lib/errors/git-error.ts"(){"use strict";pF=class extends Error{static{a(this,"GitError")}constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),Uwe,Xue=Zr({"src/lib/errors/git-response-error.ts"(){"use strict";Yq(),Uwe=class extends pF{static{a(this,"GitResponseError")}constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),fIn,pIn=Zr({"src/lib/errors/task-configuration-error.ts"(){"use strict";Yq(),fIn=class extends pF{static{a(this,"TaskConfigurationError")}constructor(t){super(void 0,t)}}}});function hIn(t){return typeof t!="function"?gJ:t}a(hIn,"asFunction");function mIn(t){return typeof t=="function"&&t!==gJ}a(mIn,"isUserFunction");function gIn(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}a(gIn,"splitOn");function AIn(t,e=0){return yIn(t)&&t.length>e?t[e]:void 0}a(AIn,"first");function mJ(t,e=0){if(yIn(t)&&t.length>e)return t[t.length-1-e]}a(mJ,"last");function yIn(t){return uXe(t)}a(yIn,"isArrayLike");function Qwe(t="",e=!0,r=` +`){return t.split(r).reduce((n,o)=>{let s=e?o.trim():o;return s&&n.push(s),n},[])}a(Qwe,"toLinesWithContent");function KGt(t,e){return Qwe(t,!0).map(r=>e(r))}a(KGt,"forEachLineWithContent");function JGt(t){return(0,sXe.exists)(t,sXe.FOLDER)}a(JGt,"folderExists");function gw(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}a(gw,"append");function EIn(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}a(EIn,"including");function aXe(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}a(aXe,"remove");function zO(t){return Array.isArray(t)?t:[t]}a(zO,"asArray");function _In(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}a(_In,"asCamelCase");function ede(t){return zO(t).map(e=>e instanceof String?e:String(e))}a(ede,"asStringArray");function vu(t,e=0){if(t==null)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}a(vu,"asNumber");function Bwe(t,e){let r=[];for(let n=0,o=t.length;n{t[n]!==void 0&&(r[n]=t[n])}),r}a(vIn,"pick");function NGt(t=0){return new Promise(e=>setTimeout(e,t))}a(NGt,"delay");function MGt(t){if(t!==!1)return t}a(MGt,"orVoid");var Jue,gJ,qwe,cXe=Zr({"src/lib/utils/util.ts"(){"use strict";ZGt(),Jue="\0",gJ=a(()=>{},"NOOP"),qwe=Object.prototype.toString.call.bind(Object.prototype.toString)}});function yE(t,e,r){return e(t)?t:arguments.length>2?r:void 0}a(yE,"filterType");function OGt(t,e){let r=pw(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}a(OGt,"filterPrimitives");function lXe(t){return!!t&&qwe(t)==="[object Object]"}a(lXe,"filterPlainObject");function CIn(t){return typeof t=="function"}a(CIn,"filterFunction");var jwe,bIn,fp,rXe,uXe,ZGt=Zr({"src/lib/utils/argument-filters.ts"(){"use strict";cXe(),jwe=a(t=>Array.isArray(t),"filterArray"),bIn=a(t=>typeof t=="number","filterNumber"),fp=a(t=>typeof t=="string"||pw(t),"filterString"),rXe=a(t=>fp(t)||Array.isArray(t)&&t.every(fp),"filterStringOrStringArray"),uXe=a(t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number","filterHasLength")}}),LGt,iZo=Zr({"src/lib/utils/exit-codes.ts"(){"use strict";LGt=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(LGt||{})}}),nXe,oZo=Zr({"src/lib/utils/git-output-streams.ts"(){"use strict";nXe=class SIn{static{a(this,"_GitOutputStreams")}constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new SIn(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function sZo(){throw new Error("LineParser:useMatches not implemented")}a(sZo,"useMatchesDefault");var ko,zq,aZo=Zr({"src/lib/utils/line-parser.ts"(){"use strict";ko=class{static{a(this,"LineParser")}constructor(t,e){this.matches=[],this.useMatches=sZo,this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((o,s)=>this.addMatch(o,s,r(s)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let n=r&&t.exec(r);return n&&this.pushMatch(e,n),!!n}pushMatch(t,e){this.matches.push(...e.slice(1))}},zq=class extends ko{static{a(this,"RemoteLineParser")}addMatch(t,e,r){return/^remote:\s/.test(String(r))&&super.addMatch(t,e,r)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function TIn(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...IIn},...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}a(TIn,"createInstanceConfig");var IIn,cZo=Zr({"src/lib/utils/simple-git-options.ts"(){"use strict";IIn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function XGt(t,e=[]){return lXe(t)?Object.keys(t).reduce((r,n)=>{let o=t[n];if(pw(o))r.push(o);else if(OGt(o,["boolean"]))r.push(n+"="+o);else if(Array.isArray(o))for(let s of o)OGt(s,["string","number"])||r.push(n+"="+s);else r.push(n);return r},e):e}a(XGt,"appendTaskOptions");function tv(t,e=0,r=!1){let n=[];for(let o=0,s=e<0?t.length:e;o{for(let s=Qwe(o,n),c=0,l=s.length;c{if(!(c+d>=l))return s[c+d]},"line");e.some(({parse:d})=>d(u,t))}}),t}a(eb,"parseStringResponse");var dZo=Zr({"src/lib/utils/task-parser.ts"(){"use strict";cXe()}}),xIn={};sm(xIn,{ExitCodes:a(()=>LGt,"ExitCodes"),GitOutputStreams:a(()=>nXe,"GitOutputStreams"),LineParser:a(()=>ko,"LineParser"),NOOP:a(()=>gJ,"NOOP"),NULL:a(()=>Jue,"NULL"),RemoteLineParser:a(()=>zq,"RemoteLineParser"),append:a(()=>gw,"append"),appendTaskOptions:a(()=>XGt,"appendTaskOptions"),asArray:a(()=>zO,"asArray"),asCamelCase:a(()=>_In,"asCamelCase"),asFunction:a(()=>hIn,"asFunction"),asNumber:a(()=>vu,"asNumber"),asStringArray:a(()=>ede,"asStringArray"),bufferToString:a(()=>Fwe,"bufferToString"),callTaskParser:a(()=>BGt,"callTaskParser"),createInstanceConfig:a(()=>TIn,"createInstanceConfig"),delay:a(()=>NGt,"delay"),filterArray:a(()=>jwe,"filterArray"),filterFunction:a(()=>CIn,"filterFunction"),filterHasLength:a(()=>uXe,"filterHasLength"),filterNumber:a(()=>bIn,"filterNumber"),filterPlainObject:a(()=>lXe,"filterPlainObject"),filterPrimitives:a(()=>OGt,"filterPrimitives"),filterString:a(()=>fp,"filterString"),filterStringOrStringArray:a(()=>rXe,"filterStringOrStringArray"),filterType:a(()=>yE,"filterType"),first:a(()=>AIn,"first"),folderExists:a(()=>JGt,"folderExists"),forEachLineWithContent:a(()=>KGt,"forEachLineWithContent"),getTrailingOptions:a(()=>tv,"getTrailingOptions"),including:a(()=>EIn,"including"),isUserFunction:a(()=>mIn,"isUserFunction"),last:a(()=>mJ,"last"),objectToString:a(()=>qwe,"objectToString"),orVoid:a(()=>MGt,"orVoid"),parseStringResponse:a(()=>eb,"parseStringResponse"),pick:a(()=>vIn,"pick"),prefixedArray:a(()=>Bwe,"prefixedArray"),remove:a(()=>aXe,"remove"),splitOn:a(()=>gIn,"splitOn"),toLinesWithContent:a(()=>Qwe,"toLinesWithContent"),trailingFunctionArgument:a(()=>$d,"trailingFunctionArgument"),trailingOptionsArgument:a(()=>e$t,"trailingOptionsArgument")});var io=Zr({"src/lib/utils/index.ts"(){"use strict";ZGt(),iZo(),oZo(),aZo(),cZo(),uZo(),dZo(),cXe()}}),wIn={};sm(wIn,{CheckRepoActions:a(()=>FGt,"CheckRepoActions"),checkIsBareRepoTask:a(()=>kIn,"checkIsBareRepoTask"),checkIsRepoRootTask:a(()=>RIn,"checkIsRepoRootTask"),checkIsRepoTask:a(()=>fZo,"checkIsRepoTask")});function fZo(t){switch(t){case"bare":return kIn();case"root":return RIn()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:dXe,parser:t$t}}a(fZo,"checkIsRepoTask");function RIn(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:dXe,parser(e){return/^\.(git)?$/.test(e.trim())}}}a(RIn,"checkIsRepoRootTask");function kIn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:dXe,parser:t$t}}a(kIn,"checkIsBareRepoTask");function pZo(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}a(pZo,"isNotRepoMessage");var FGt,dXe,t$t,PIn=Zr({"src/lib/tasks/check-is-repo.ts"(){"use strict";io(),FGt=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(FGt||{}),dXe=a(({exitCode:t},e,r,n)=>{if(t===128&&pZo(e))return r(Buffer.from("false"));n(e)},"onError"),t$t=a(t=>t.trim()==="true","parser")}});function hZo(t,e){let r=new DIn(t),n=t?MIn:NIn;return Qwe(e).forEach(o=>{let s=o.replace(n,"");r.paths.push(s),(OIn.test(s)?r.folders:r.files).push(s)}),r}a(hZo,"cleanSummaryParser");var DIn,NIn,MIn,OIn,mZo=Zr({"src/lib/responses/CleanSummary.ts"(){"use strict";io(),DIn=class{static{a(this,"CleanResponse")}constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},NIn=/^[a-z]+\s*/i,MIn=/^[a-z]+\s+[a-z]+\s*/i,OIn=/\/$/}}),UGt={};sm(UGt,{EMPTY_COMMANDS:a(()=>fXe,"EMPTY_COMMANDS"),adhocExecTask:a(()=>LIn,"adhocExecTask"),configurationErrorTask:a(()=>XC,"configurationErrorTask"),isBufferTask:a(()=>FIn,"isBufferTask"),isEmptyTask:a(()=>UIn,"isEmptyTask"),straightThroughBufferTask:a(()=>BIn,"straightThroughBufferTask"),straightThroughStringTask:a(()=>rv,"straightThroughStringTask")});function LIn(t){return{commands:fXe,format:"empty",parser:t}}a(LIn,"adhocExecTask");function XC(t){return{commands:fXe,format:"empty",parser(){throw typeof t=="string"?new fIn(t):t}}}a(XC,"configurationErrorTask");function rv(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}a(rv,"straightThroughStringTask");function BIn(t){return{commands:t,format:"buffer",parser(e){return e}}}a(BIn,"straightThroughBufferTask");function FIn(t){return t.format==="buffer"}a(FIn,"isBufferTask");function UIn(t){return t.format==="empty"||!t.commands.length}a(UIn,"isEmptyTask");var fXe,sh=Zr({"src/lib/tasks/task.ts"(){"use strict";pIn(),fXe=[]}}),QIn={};sm(QIn,{CONFIG_ERROR_INTERACTIVE_MODE:a(()=>r$t,"CONFIG_ERROR_INTERACTIVE_MODE"),CONFIG_ERROR_MODE_REQUIRED:a(()=>n$t,"CONFIG_ERROR_MODE_REQUIRED"),CONFIG_ERROR_UNKNOWN_OPTION:a(()=>i$t,"CONFIG_ERROR_UNKNOWN_OPTION"),CleanOptions:a(()=>ZZe,"CleanOptions"),cleanTask:a(()=>qIn,"cleanTask"),cleanWithOptionsTask:a(()=>gZo,"cleanWithOptionsTask"),isCleanOptionsArray:a(()=>AZo,"isCleanOptionsArray")});function gZo(t,e){let{cleanMode:r,options:n,valid:o}=yZo(t);return r?o.options?(n.push(...e),n.some(vZo)?XC(r$t):qIn(r,n)):XC(i$t+JSON.stringify(t)):XC(n$t)}a(gZo,"cleanWithOptionsTask");function qIn(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(n){return hZo(t==="n",n)}}}a(qIn,"cleanTask");function AZo(t){return Array.isArray(t)&&t.every(e=>o$t.has(e))}a(AZo,"isCleanOptionsArray");function yZo(t){let e,r=[],n={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(o=>{EZo(o)?(e=o,n.cleanMode=!0):n.options=n.options&&_Zo(r[r.length]=`-${o}`)}),{cleanMode:e,options:r,valid:n}}a(yZo,"getCleanOptions");function EZo(t){return t==="f"||t==="n"}a(EZo,"isCleanMode");function _Zo(t){return/^-[a-z]$/i.test(t)&&o$t.has(t.charAt(1))}a(_Zo,"isKnownOption");function vZo(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}a(vZo,"isInteractiveMode");var r$t,n$t,i$t,ZZe,o$t,jIn=Zr({"src/lib/tasks/clean.ts"(){"use strict";mZo(),io(),sh(),r$t="Git clean interactive mode is not supported",n$t='Git clean mode parameter ("n" or "f") is required',i$t="Git clean unknown option found in: ",ZZe=(t=>(t.DRY_RUN="n",t.FORCE="f",t.IGNORED_INCLUDED="x",t.IGNORED_ONLY="X",t.EXCLUDING="e",t.QUIET="q",t.RECURSIVE="d",t))(ZZe||{}),o$t=new Set(["i",...ede(Object.values(ZZe))])}});function CZo(t){let e=new GIn;for(let r of HIn(t))e.addValue(r.file,String(r.key),r.value);return e}a(CZo,"configListParser");function bZo(t,e){let r=null,n=[],o=new Map;for(let s of HIn(t,e))s.key===e&&(n.push(r=s.value),o.has(s.file)||o.set(s.file,[]),o.get(s.file).push(r));return{key:e,paths:Array.from(o.keys()),scopes:o,value:r,values:n}}a(bZo,"configGetParser");function SZo(t){return t.replace(/^(file):/,"")}a(SZo,"configFilePath");function*HIn(t,e=null){let r=t.split("\0");for(let n=0,o=r.length-1;nObject.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=mJ(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let n=this.addFile(t);Object.hasOwn(n,e)?Array.isArray(n[e])?n[e].push(r):n[e]=[n[e],r]:n[e]=r,this._all=void 0}}}});function xGt(t,e){return typeof t=="string"&&Object.hasOwn(QGt,t)?t:e}a(xGt,"asConfigScope");function IZo(t,e,r,n){let o=["config",`--${n}`];return r&&o.push("--add"),o.push(t,e),{commands:o,format:"utf-8",parser(s){return s}}}a(IZo,"addConfigTask");function xZo(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(n){return bZo(n,t)}}}a(xZo,"getConfigTask");function wZo(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return CZo(r)}}}a(wZo,"listConfigTask");function RZo(){return{addConfig(t,e,...r){return this._runTask(IZo(t,e,r[0]===!0,xGt(r[1],"local")),$d(arguments))},getConfig(t,e){return this._runTask(xZo(t,xGt(e,void 0)),$d(arguments))},listConfig(...t){return this._runTask(wZo(xGt(t[0],void 0)),$d(arguments))}}}a(RZo,"config_default");var QGt,$In=Zr({"src/lib/tasks/config.ts"(){"use strict";TZo(),io(),QGt=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(QGt||{})}});function kZo(t){return VIn.has(t)}a(kZo,"isDiffNameStatus");var wGt,VIn,WIn=Zr({"src/lib/tasks/diff-name-status.ts"(){"use strict";wGt=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))(wGt||{}),VIn=new Set(Object.values(wGt))}});function PZo(...t){return new YIn().param(...t)}a(PZo,"grepQueryBuilder");function DZo(t){let e=new Set,r={};return KGt(t,n=>{let[o,s,c]=n.split(Jue);e.add(o),(r[o]=r[o]||[]).push({line:vu(s),path:o,preview:c})}),{paths:e,results:r}}a(DZo,"parseGrep");function NZo(){return{grep(t){let e=$d(arguments),r=tv(arguments);for(let o of zIn)if(r.includes(o))return this._runTask(XC(`git.grep: use of "${o}" is not supported.`),e);typeof t=="string"&&(t=PZo().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(o){return DZo(o)}},e)}}}a(NZo,"grep_default");var zIn,Lwe,OTn,YIn,KIn=Zr({"src/lib/tasks/grep.ts"(){"use strict";io(),sh(),zIn=["-h"],Lwe=Symbol("grepQuery"),YIn=class{static{a(this,"GrepQuery")}constructor(){this[OTn]=[]}*[(OTn=Lwe,Symbol.iterator)](){for(let t of this[Lwe])yield t}and(...t){return t.length&&this[Lwe].push("--and","(",...Bwe(t,"-e"),")"),this}param(...t){return this[Lwe].push(...Bwe(t,"-e")),this}}}}),JIn={};sm(JIn,{ResetMode:a(()=>XZe,"ResetMode"),getResetMode:a(()=>OZo,"getResetMode"),resetTask:a(()=>MZo,"resetTask")});function MZo(t,e){let r=["reset"];return ZIn(t)&&r.push(`--${t}`),r.push(...e),rv(r)}a(MZo,"resetTask");function OZo(t){if(ZIn(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}a(OZo,"getResetMode");function ZIn(t){return typeof t=="string"&&XIn.includes(t)}a(ZIn,"isValidResetMode");var XZe,XIn,exn=Zr({"src/lib/tasks/reset.ts"(){"use strict";io(),sh(),XZe=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(XZe||{}),XIn=ede(Object.values(XZe))}});function LZo(){return(0,iXe.default)("simple-git")}a(LZo,"createLog");function LTn(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(n,...o)=>{t(n,...o),r(n,...o)}:t:(n,...o)=>{t(`%s ${n}`,e,...o),r&&r(n,...o)}}a(LTn,"prefixedLogger");function BZo(t,e,{namespace:r}){if(typeof t=="string")return t;let n=e&&e.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}a(BZo,"childLoggerName");function s$t(t,e,r,n=LZo()){let o=t&&`[${t}]`||"",s=[],c=typeof e=="string"?n.extend(e):e,l=BZo(yE(e,fp),c,n);return d(r);function u(f,h){return gw(s,s$t(t,l.replace(/^[^:]+/,f),h,n))}function d(f){let h=f&&`[${f}]`||"",m=c&<n(c,h)||gJ,g=LTn(n,`${o} ${h}`,m);return Object.assign(c?m:g,{label:t,sibling:u,info:g,step:d})}}a(s$t,"createLogger");var txn=Zr({"src/lib/git-logger.ts"(){"use strict";io(),iXe.default.formatters.L=t=>String(uXe(t)?t.length:"-"),iXe.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):qwe(t)}}),rxn,FZo=Zr({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";Yq(),txn(),rxn=class qGt{static{a(this,"_TasksPendingQueue")}constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let r=qGt.getName(e.commands[0]),n=s$t(this.logLabel,r);return{task:e,logger:n,name:r}}push(e){let r=this.createProgress(e);return r.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,r),r}fatal(e){for(let[r,{logger:n}]of Array.from(this._queue.entries()))r===e.task?(n.info("Failed %o",e),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(r);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let r=this.withProgress(e);if(!r)throw new pF(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(e="empty"){return`task:${e}:${++qGt.counter}`}static{this.counter=0}}}});function hJ(t,e){return{method:AIn(t.commands)||"",commands:e}}a(hJ,"pluginContext");function UZo(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}a(UZo,"onErrorReceived");function BTn(t,e,r,n){return o=>{r("%s received %L bytes",e,o),n("%B",o),t.push(o)}}a(BTn,"onDataReceived");var jGt,QZo=Zr({"src/lib/runners/git-executor-chain.ts"(){"use strict";Yq(),sh(),io(),FZo(),jGt=class{static{a(this,"GitExecutorChain")}constructor(t,e,r){this._executor=t,this._scheduler=e,this._plugins=r,this._chain=Promise.resolve(),this._queue=new rxn}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){return this._queue.push(t),this._chain=this._chain.then(()=>this.attemptTask(t))}async attemptTask(t){let e=await this._scheduler.next(),r=a(()=>this._queue.complete(t),"onQueueComplete");try{let{logger:n}=this._queue.attempt(t);return await(UIn(t)?this.attemptEmptyTask(t,n):this.attemptRemoteTask(t,n))}catch(n){throw this.onFatalException(t,n)}finally{r(),e()}}onFatalException(t,e){let r=e instanceof pF?Object.assign(e,{task:t}):new pF(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(t,e){let r=this._plugins.exec("spawn.binary","",hJ(t,t.commands)),n=this._plugins.exec("spawn.args",[...t.commands],{...hJ(t,t.commands),env:{...this.env}}),o=await this.gitResponse(t,r,n,this.outputHandler,e.step("SPAWN")),s=await this.handleTaskData(t,n,o,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),FIn(t)?BGt(t.parser,s):BGt(t.parser,s.asStrings())}async attemptEmptyTask(t,e){return e("empty task bypassing child process to call to task's parser"),t.parser(this)}handleTaskData(t,e,r,n){let{exitCode:o,rejection:s,stdOut:c,stdErr:l}=r;return new Promise((u,d)=>{n("Preparing to handle process response exitCode=%d stdOut=",o);let{error:f}=this._plugins.exec("task.error",{error:s},{...hJ(t,e),...r});if(f&&t.onError)return n.info("exitCode=%s handling with custom error handler"),t.onError(r,f,h=>{n.info("custom error handler treated as success"),n("custom error returned a %s",qwe(h)),u(new nXe(Array.isArray(h)?Buffer.concat(h):h,Buffer.concat(l)))},d);if(f)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",o,l.length,s),d(f);n.info("retrieving task output complete"),u(new nXe(Buffer.concat(c),Buffer.concat(l)))})}async gitResponse(t,e,r,n,o){let s=o.sibling("output"),c=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},hJ(t,t.commands));return new Promise(l=>{let u=[],d=[];o.info("%s %o",e,r),o("%O",c);let f=this._beforeSpawn(t,r);if(f)return l({stdOut:u,stdErr:d,exitCode:9901,rejection:f});this._plugins.exec("spawn.before",void 0,{...hJ(t,r),kill(m){f=m||f}});let h=(0,nxn.spawn)(e,r,c);h.stdout.on("data",BTn(u,"stdOut",o,s.step("stdOut"))),h.stderr.on("data",BTn(d,"stdErr",o,s.step("stdErr"))),h.on("error",UZo(d,o)),n&&(o("Passing child process stdOut/stdErr to custom outputHandler"),n(e,h.stdout,h.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...hJ(t,r),spawned:h,close(m,g){l({stdOut:u,stdErr:d,exitCode:m,rejection:f||g})},kill(m){h.killed||(f=m,h.kill("SIGINT"))}})})}_beforeSpawn(t,e){let r;return this._plugins.exec("spawn.before",void 0,{...hJ(t,e),kill(n){r=n||r}}),r}}}}),ixn={};sm(ixn,{GitExecutor:a(()=>oxn,"GitExecutor")});var oxn,qZo=Zr({"src/lib/runners/git-executor.ts"(){"use strict";QZo(),oxn=class{static{a(this,"GitExecutor")}constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new jGt(this,this._scheduler,this._plugins)}chain(){return new jGt(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function jZo(t,e,r=gJ){let n=a(s=>{r(null,s)},"onSuccess"),o=a(s=>{s?.task===t&&r(s instanceof Uwe?HZo(s):s,void 0)},"onError2");e.then(n,o)}a(jZo,"taskCallback");function HZo(t){let e=a(n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),e=gJ},"log");return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(r,{}));function r(n,o){return o in t||(n[o]={enumerable:!1,configurable:!1,get(){return e(o),t.git[o]}}),n}}a(HZo,"addDeprecationNoticeToError");var GZo=Zr({"src/lib/task-callback.ts"(){"use strict";Xue(),io()}});function FTn(t,e){return LIn(r=>{if(!JGt(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}a(FTn,"changeWorkingDirectoryTask");var $Zo=Zr({"src/lib/tasks/change-working-directory.ts"(){"use strict";io(),sh()}});function RGt(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=aXe(e,"-B")),rv(e)}a(RGt,"checkoutTask");function VZo(){return{checkout(){return this._runTask(RGt(tv(arguments,1)),$d(arguments))},checkoutBranch(t,e){return this._runTask(RGt(["-b",t,e,...tv(arguments)]),$d(arguments))},checkoutLocalBranch(t){return this._runTask(RGt(["-b",t,...tv(arguments)]),$d(arguments))}}}a(VZo,"checkout_default");var WZo=Zr({"src/lib/tasks/checkout.ts"(){"use strict";io(),sh()}});function zZo(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}a(zZo,"countObjectsResponse");function YZo(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return eb(zZo(),[sxn],t)}})}}}a(YZo,"count_objects_default");var sxn,KZo=Zr({"src/lib/tasks/count-objects.ts"(){"use strict";io(),sxn=new ko(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let n=_In(e);Object.hasOwn(t,n)&&(t[n]=vu(r))})}});function JZo(t){return eb({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},axn,t)}a(JZo,"parseCommitResult");var axn,ZZo=Zr({"src/lib/parsers/parse-commit.ts"(){"use strict";io(),axn=[new ko(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,n])=>{t.branch=e,t.commit=n,t.root=!!r}),new ko(/\s*Author:\s(.+)/i,(t,[e])=>{let r=e.split("<"),n=r.pop();!n||!n.includes("@")||(t.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new ko(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(r,10)||0,t.summary.deletions=parseInt(n,10)||0}),new ko(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0;let o=parseInt(r,10)||0;n==="-"?t.summary.deletions=o:n==="+"&&(t.summary.insertions=o)})]}});function XZo(t,e,r){return{commands:["-c","core.abbrev=40","commit",...Bwe(t,"-m"),...e,...r],format:"utf-8",parser:JZo}}a(XZo,"commitTask");function eXo(){return{commit(e,...r){let n=$d(arguments),o=t(e)||XZo(zO(e),zO(yE(r[0],rXe,[])),[...ede(yE(r[1],jwe,[])),...tv(arguments,0,!0)]);return this._runTask(o,n)}};function t(e){return!rXe(e)&&XC("git.commit: requires the commit message to be supplied as a string/string[]")}}a(eXo,"commit_default");var tXo=Zr({"src/lib/tasks/commit.ts"(){"use strict";ZZo(),io(),sh()}});function rXo(){return{firstCommit(){return this._runTask(rv(["rev-list","--max-parents=0","HEAD"],!0),$d(arguments))}}}a(rXo,"first_commit_default");var nXo=Zr({"src/lib/tasks/first-commit.ts"(){"use strict";io(),sh()}});function iXo(t,e){let r=["hash-object",t];return e&&r.push("-w"),rv(r,!0)}a(iXo,"hashObjectTask");var oXo=Zr({"src/lib/tasks/hash-object.ts"(){"use strict";sh()}});function sXo(t,e,r){let n=String(r).trim(),o;if(o=cxn.exec(n))return new eXe(t,e,!1,o[1]);if(o=lxn.exec(n))return new eXe(t,e,!0,o[1]);let s="",c=n.split(" ");for(;c.length;)if(c.shift()==="in"){s=c.join(" ");break}return new eXe(t,e,/^re/i.test(n),s)}a(sXo,"parseInit");var eXe,cxn,lxn,aXo=Zr({"src/lib/responses/InitSummary.ts"(){"use strict";eXe=class{static{a(this,"InitSummary")}constructor(t,e,r,n){this.bare=t,this.path=e,this.existing=r,this.gitDir=n}},cxn=/^Init.+ repository in (.+)$/,lxn=/^Rein.+ in (.+)$/}});function cXo(t){return t.includes(a$t)}a(cXo,"hasBareCommand");function lXo(t=!1,e,r){let n=["init",...r];return t&&!cXo(n)&&n.splice(1,0,a$t),{commands:n,format:"utf-8",parser(o){return sXo(n.includes("--bare"),e,o)}}}a(lXo,"initTask");var a$t,uXo=Zr({"src/lib/tasks/init.ts"(){"use strict";aXo(),a$t="--bare"}});function c$t(t){for(let e=0;eeb(new uxn,e,r,!1)}a(dxn,"getDiffParser");var kGt,UTn,QTn,qTn,fxn,pxn=Zr({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";Hwe(),fXo(),WIn(),io(),kGt=[new ko(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,n=""])=>{t.files.push({file:e.trim(),changes:vu(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new ko(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,n])=>{t.files.push({file:e.trim(),before:vu(r),after:vu(n),binary:!0})}),new ko(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let n=/(\d+) i/.exec(r),o=/(\d+) d/.exec(r);t.changed=vu(e),t.insertions=vu(n?.[1]),t.deletions=vu(o?.[1])})],UTn=[new ko(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,n])=>{let o=vu(e),s=vu(r);t.changed++,t.insertions+=o,t.deletions+=s,t.files.push({file:n,changes:o+s,insertions:o,deletions:s,binary:!1})}),new ko(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],QTn=[new ko(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],qTn=[new ko(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,r,n,o,s])=>{t.changed++,t.files.push({file:s??n,changes:0,insertions:0,deletions:0,binary:!1,status:MGt(kZo(e)&&e),from:MGt(!!s&&n!==s&&n),similarity:vu(r)})})],fxn={"":kGt,"--stat":kGt,"--numstat":UTn,"--name-status":qTn,"--name-only":QTn}}});function pXo(t,e){return e.reduce((r,n,o)=>(r[n]=t[o]||"",r),Object.create({diff:null}))}a(pXo,"lineBuilder");function hxn(t=f$t,e=mxn,r=""){let n=dxn(r);return function(o){let s=Qwe(o.trim(),!1,u$t).map(function(c){let l=c.split(d$t),u=pXo(l[0].split(t),e);return l.length>1&&l[1].trim()&&(u.diff=n(l[1])),u});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}a(hxn,"createListLogSummaryParser");var u$t,d$t,f$t,mxn,gxn=Zr({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";io(),pxn(),Hwe(),u$t="\xF2\xF2\xF2\xF2\xF2\xF2 ",d$t=" \xF2\xF2",f$t=" \xF2 ",mxn=["hash","date","message","refs","author_name","author_email"]}}),Axn={};sm(Axn,{diffSummaryTask:a(()=>hXo,"diffSummaryTask"),validateLogFormatConfig:a(()=>pXe,"validateLogFormatConfig")});function hXo(t){let e=c$t(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),pXe(r)||{commands:r,format:"utf-8",parser:dxn(e)}}a(hXo,"diffSummaryTask");function pXe(t){let e=t.filter(dXo);if(e.length>1)return XC(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return XC(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}a(pXe,"validateLogFormatConfig");var p$t=Zr({"src/lib/tasks/diff.ts"(){"use strict";Hwe(),pxn(),sh()}});function mXo(t,e){let r=[],n=[];return Object.keys(t).forEach(o=>{r.push(o),n.push(String(t[o]))}),[r,n.join(e)]}a(mXo,"prettyFormat");function gXo(t){return Object.keys(t).reduce((e,r)=>(r in HGt||(e[r]=t[r]),e),{})}a(gXo,"userOptions");function yxn(t={},e=[]){let r=yE(t.splitter,fp,f$t),n=lXe(t.format)?t.format:{hash:"%H",date:t.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:t.mailMap!==!1?"%aN":"%an",author_email:t.mailMap!==!1?"%aE":"%ae"},[o,s]=mXo(n,r),c=[],l=[`--pretty=format:${u$t}${s}${d$t}`,...e],u=t.n||t["max-count"]||t.maxCount;if(u&&l.push(`--max-count=${u}`),t.from||t.to){let d=t.symmetric!==!1?"...":"..";c.push(`${t.from||""}${d}${t.to||""}`)}return fp(t.file)&&l.push("--follow",Gue(t.file)),XGt(gXo(t),l),{fields:o,splitter:r,commands:[...l,...c]}}a(yxn,"parseLogOptions");function AXo(t,e,r){let n=hxn(t,e,c$t(r));return{commands:["log",...r],format:"utf-8",parser:n}}a(AXo,"logTask");function yXo(){return{log(...r){let n=$d(arguments),o=yxn(e$t(arguments),ede(yE(arguments[0],jwe,[]))),s=e(...r)||pXe(o.commands)||t(o);return this._runTask(s,n)}};function t(r){return AXo(r.splitter,r.fields,r.commands)}function e(r,n){return fp(r)&&fp(n)&&XC("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}a(yXo,"log_default");var HGt,Exn=Zr({"src/lib/tasks/log.ts"(){"use strict";Hwe(),gxn(),io(),sh(),p$t(),HGt=(t=>(t[t["--pretty"]=0]="--pretty",t[t["max-count"]=1]="max-count",t[t.maxCount=2]="maxCount",t[t.n=3]="n",t[t.file=4]="file",t[t.format=5]="format",t[t.from=6]="from",t[t.to=7]="to",t[t.splitter=8]="splitter",t[t.symmetric=9]="symmetric",t[t.mailMap=10]="mailMap",t[t.multiLine=11]="multiLine",t[t.strictDate=12]="strictDate",t))(HGt||{})}}),tXe,_xn,EXo=Zr({"src/lib/responses/MergeSummary.ts"(){"use strict";tXe=class{static{a(this,"MergeSummaryConflict")}constructor(t,e=null,r){this.reason=t,this.file=e,this.meta=r}toString(){return`${this.file}:${this.reason}`}},_xn=class{static{a(this,"MergeSummaryDetail")}constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),GGt,vxn,_Xo=Zr({"src/lib/responses/PullSummary.ts"(){"use strict";GGt=class{static{a(this,"PullSummary")}constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},vxn=class{static{a(this,"PullFailedSummary")}constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function PGt(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}a(PGt,"objectEnumerationResult");function jTn(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:vu(e&&e[1]||"0"),delta:vu(r&&r[1]||"0")}}a(jTn,"asObjectCount");var Cxn,vXo=Zr({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";io(),Cxn=[new zq(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=PGt(t.remoteMessages);Object.assign(o,{[n]:vu(r)})}),new zq(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=PGt(t.remoteMessages);Object.assign(o,{[n]:vu(r)})}),new zq(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,n])=>{let o=PGt(t.remoteMessages);o.total=jTn(e),o.reused=jTn(r),o.packReused=vu(n)})]}});function bxn(t,e){return eb({remoteMessages:new Txn},Sxn,e)}a(bxn,"parseRemoteMessages");var Sxn,Txn,Ixn=Zr({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";io(),vXo(),Sxn=[new zq(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...Cxn,new zq([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new zq([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,n])=>{t.remoteMessages.vulnerabilities={count:vu(e),summary:r,url:n}})],Txn=class{static{a(this,"RemoteMessageSummary")}constructor(){this.all=[]}}}});function CXo(t,e){let r=eb(new vxn,xxn,[t,e]);return r.message&&r}a(CXo,"parsePullErrorResult");var HTn,GTn,$Tn,VTn,xxn,WTn,h$t,wxn=Zr({"src/lib/parsers/parse-pull.ts"(){"use strict";_Xo(),io(),Ixn(),HTn=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,GTn=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,$Tn=/^(create|delete) mode \d+ (.+)/,VTn=[new ko(HTn,(t,[e,r,n])=>{t.files.push(e),r&&(t.insertions[e]=r.length),n&&(t.deletions[e]=n.length)}),new ko(GTn,(t,[e,,r,,n])=>r!==void 0||n!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+r||0,t.summary.deletions=+n||0,!0):!1),new ko($Tn,(t,[e,r])=>{gw(t.files,r),gw(e==="create"?t.created:t.deleted,r)})],xxn=[new ko(/^from\s(.+)$/i,(t,[e])=>{t.remote=e}),new ko(/^fatal:\s(.+)$/,(t,[e])=>{t.message=e}),new ko(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,r,n,o])=>{t.branch.local=n,t.hash.local=e,t.branch.remote=o,t.hash.remote=r})],WTn=a((t,e)=>eb(new GGt,VTn,[t,e]),"parsePullDetail"),h$t=a((t,e)=>Object.assign(new GGt,WTn(t,e),bxn(t,e)),"parsePullResult")}}),zTn,Rxn,YTn,bXo=Zr({"src/lib/parsers/parse-merge.ts"(){"use strict";EXo(),io(),wxn(),zTn=[new ko(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new ko(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new tXe(e,r))}),new ko(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,n])=>{t.conflicts.push(new tXe(e,r,{deleteRef:n}))}),new ko(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new tXe(e,null))}),new ko(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],Rxn=a((t,e)=>Object.assign(YTn(t,e),h$t(t,e)),"parseMergeResult"),YTn=a(t=>eb(new _xn,zTn,t),"parseMergeDetail")}});function KTn(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let n=Rxn(e,r);if(n.failed)throw new Uwe(n);return n}}:XC("Git.merge requires at least one option")}a(KTn,"mergeTask");var SXo=Zr({"src/lib/tasks/merge.ts"(){"use strict";Xue(),bXo(),sh()}});function TXo(t,e,r){let n=r.includes("deleted"),o=r.includes("tag")||/^refs\/tags/.test(t),s=!r.includes("new");return{deleted:n,tag:o,branch:!o,new:!s,alreadyUpdated:s,local:t,remote:e}}a(TXo,"pushResultPushedItem");var JTn,kxn,ZTn,IXo=Zr({"src/lib/parsers/parse-push.ts"(){"use strict";io(),Ixn(),JTn=[new ko(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new ko(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new ko(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,n])=>{t.pushed.push(TXo(e,r,n))}),new ko(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,n])=>{t.branch={...t.branch||{},local:e,remote:r,remoteName:n}}),new ko(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,r,n,o])=>{t.update={head:{local:e,remote:r},hash:{from:n,to:o}}})],kxn=a((t,e)=>{let r=ZTn(t,e),n=bxn(t,e);return{...r,...n}},"parsePushResult"),ZTn=a((t,e)=>eb({pushed:[]},JTn,[t,e]),"parsePushDetail")}}),Pxn={};sm(Pxn,{pushTagsTask:a(()=>xXo,"pushTagsTask"),pushTask:a(()=>m$t,"pushTask")});function xXo(t={},e){return gw(e,"--tags"),m$t(t,e)}a(xXo,"pushTagsTask");function m$t(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),aXe(r,"-v"),gw(r,"--verbose"),gw(r,"--porcelain"),{commands:r,format:"utf-8",parser:kxn}}a(m$t,"pushTask");var Dxn=Zr({"src/lib/tasks/push.ts"(){"use strict";IXo(),io()}});function wXo(){return{showBuffer(){let t=["show",...tv(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(BIn(t),$d(arguments))},show(){let t=["show",...tv(arguments,1)];return this._runTask(rv(t),$d(arguments))}}}a(wXo,"show_default");var RXo=Zr({"src/lib/tasks/show.ts"(){"use strict";io(),sh()}}),XTn,Nxn,kXo=Zr({"src/lib/responses/FileStatusSummary.ts"(){"use strict";XTn=/^(.+)\0(.+)$/,Nxn=class{static{a(this,"FileStatusSummary")}constructor(t,e,r){if(this.path=t,this.index=e,this.working_dir=r,e==="R"||r==="R"){let n=XTn.exec(t)||[null,t,t];this.from=n[2]||"",this.path=n[1]||""}}}}});function eIn(t){let[e,r]=t.split(Jue);return{from:r||e,to:e}}a(eIn,"renamedFile");function sT(t,e,r){return[`${t}${e}`,r]}a(sT,"parser3");function DGt(t,...e){return e.map(r=>sT(t,r,(n,o)=>n.conflicted.push(o)))}a(DGt,"conflicts");function PXo(t,e){let r=e.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.slice(3));case r.charAt(1):return n(" ",r.charAt(0),r.slice(2));default:return}function n(o,s,c){let l=`${o}${s}`,u=Mxn.get(l);u&&u(t,c),l!=="##"&&l!=="!!"&&t.files.push(new Nxn(c,o,s))}a(n,"data")}a(PXo,"splitLine");var tIn,Mxn,Oxn,DXo=Zr({"src/lib/responses/StatusSummary.ts"(){"use strict";io(),kXo(),tIn=class{static{a(this,"StatusSummary")}constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},Mxn=new Map([sT(" ","A",(t,e)=>t.created.push(e)),sT(" ","D",(t,e)=>t.deleted.push(e)),sT(" ","M",(t,e)=>t.modified.push(e)),sT("A"," ",(t,e)=>{t.created.push(e),t.staged.push(e)}),sT("A","M",(t,e)=>{t.created.push(e),t.staged.push(e),t.modified.push(e)}),sT("D"," ",(t,e)=>{t.deleted.push(e),t.staged.push(e)}),sT("M"," ",(t,e)=>{t.modified.push(e),t.staged.push(e)}),sT("M","M",(t,e)=>{t.modified.push(e),t.staged.push(e)}),sT("R"," ",(t,e)=>{t.renamed.push(eIn(e))}),sT("R","M",(t,e)=>{let r=eIn(e);t.renamed.push(r),t.modified.push(r.to)}),sT("!","!",(t,e)=>{(t.ignored=t.ignored||[]).push(e)}),sT("?","?",(t,e)=>t.not_added.push(e)),...DGt("A","A","U"),...DGt("D","D","U"),...DGt("U","A","D","U"),["##",(t,e)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,o=/^(.+?(?=(?:\.{3}|\s|$)))/,s=/\.{3}(\S*)/,c=/\son\s(\S+?)(?=\.{3}|$)/,l=r.exec(e);t.ahead=l&&+l[1]||0,l=n.exec(e),t.behind=l&&+l[1]||0,l=o.exec(e),t.current=yE(l?.[1],fp,null),l=s.exec(e),t.tracking=yE(l?.[1],fp,null),l=c.exec(e),l&&(t.current=yE(l?.[1],fp,t.current)),t.detached=/\(no branch\)/.test(e)}]]),Oxn=a(function(t){let e=t.split(Jue),r=new tIn;for(let n=0,o=e.length;n!Lxn.includes(r))],parser(r){return Oxn(r)}}}a(NXo,"statusTask");var Lxn,MXo=Zr({"src/lib/tasks/status.ts"(){"use strict";DXo(),Lxn=["--null","-z"]}});function oXe(t=0,e=0,r=0,n="",o=!0){return Object.defineProperty({major:t,minor:e,patch:r,agent:n,installed:o},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}a(oXe,"versionResponse");function OXo(){return oXe(0,0,0,"",!1)}a(OXo,"notInstalledResponse");function LXo(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:BXo,onError(t,e,r,n){if(t.exitCode===-2)return r(Buffer.from(g$t));n(e)}})}}}a(LXo,"version_default");function BXo(t){return t===g$t?OXo():eb(oXe(0,0,0,t),Bxn,t)}a(BXo,"versionParser");var g$t,Bxn,FXo=Zr({"src/lib/tasks/version.ts"(){"use strict";io(),g$t="installed=false",Bxn=[new ko(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,n,o=""])=>{Object.assign(t,oXe(vu(e),vu(r),vu(n),o))}),new ko(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,n,o=""])=>{Object.assign(t,oXe(vu(e),vu(r),n,o))})]}});function rIn(t,e,r,...n){return fp(r)?e(r,yE(n[0],fp),tv(arguments)):XC(`git.${t}() requires a string 'repoPath'`)}a(rIn,"createCloneTask");function UXo(){return{clone(t,...e){return this._runTask(rIn("clone",$Gt,yE(t,fp),...e),$d(arguments))},mirror(t,...e){return this._runTask(rIn("mirror",Fxn,yE(t,fp),...e),$d(arguments))}}}a(UXo,"clone_default");var $Gt,Fxn,QXo=Zr({"src/lib/tasks/clone.ts"(){"use strict";sh(),io(),$Gt=a((t,e,r)=>{let n=["clone",...r];return fp(t)&&n.push(Gue(t)),fp(e)&&n.push(Gue(e)),rv(n)},"cloneTask"),Fxn=a((t,e,r)=>(gw(r,"--mirror"),$Gt(t,e,r)),"cloneMirrorTask")}}),Uxn={};sm(Uxn,{SimpleGitApi:a(()=>VGt,"SimpleGitApi")});var VGt,qXo=Zr({"src/lib/simple-git-api.ts"(){"use strict";GZo(),$Zo(),WZo(),KZo(),tXo(),$In(),nXo(),KIn(),oXo(),uXo(),Exn(),SXo(),Dxn(),RXo(),MXo(),sh(),FXo(),io(),QXo(),VGt=class{static{a(this,"SimpleGitApi")}constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),n=r.push(t);return e&&jZo(t,n,e),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(t){return this._runTask(rv(["add",...zO(t)]),$d(arguments))}cwd(t){let e=$d(arguments);return typeof t=="string"?this._runTask(FTn(t,this._executor),e):typeof t?.path=="string"?this._runTask(FTn(t.path,t.root&&this._executor||void 0),e):this._runTask(XC("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(iXo(t,e===!0),$d(arguments))}init(t){return this._runTask(lXo(t===!0,this._executor.cwd,tv(arguments)),$d(arguments))}merge(){return this._runTask(KTn(tv(arguments)),$d(arguments))}mergeFromTo(t,e){return fp(t)&&fp(e)?this._runTask(KTn([t,e,...tv(arguments)]),$d(arguments,!1)):this._runTask(XC("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=m$t({remote:yE(arguments[0],fp),branch:yE(arguments[1],fp)},tv(arguments));return this._runTask(t,$d(arguments))}stash(){return this._runTask(rv(["stash",...tv(arguments)]),$d(arguments))}status(){return this._runTask(NXo(tv(arguments)),$d(arguments))}},Object.assign(VGt.prototype,VZo(),UXo(),eXo(),RZo(),YZo(),rXo(),NZo(),yXo(),wXo(),LXo())}}),Qxn={};sm(Qxn,{Scheduler:a(()=>jxn,"Scheduler")});var nIn,jxn,jXo=Zr({"src/lib/runners/scheduler.ts"(){"use strict";io(),txn(),nIn=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,qxn.createDeferred)();return{promise:e,done:r,id:t}}})(),jxn=class{static{a(this,"Scheduler")}constructor(t=2){this.concurrency=t,this.logger=s$t("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",t)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let t=gw(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),aXe(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=gw(this.pending,nIn());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),Hxn={};sm(Hxn,{applyPatchTask:a(()=>HXo,"applyPatchTask")});function HXo(t,e){return rv(["apply",...e,...t])}a(HXo,"applyPatchTask");var GXo=Zr({"src/lib/tasks/apply-patch.ts"(){"use strict";sh()}});function $Xo(t,e){return{branch:t,hash:e,success:!0}}a($Xo,"branchDeletionSuccess");function VXo(t){return{branch:t,hash:null,success:!1}}a(VXo,"branchDeletionFailure");var Gxn,WXo=Zr({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";Gxn=class{static{a(this,"BranchDeletionBatch")}constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function $xn(t,e){return e===1&&WGt.test(t)}a($xn,"hasBranchDeletionError");var iIn,WGt,oIn,hXe,zXo=Zr({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";WXo(),io(),iIn=/(\S+)\s+\(\S+\s([^)]+)\)/,WGt=/^error[^']+'([^']+)'/m,oIn=[new ko(iIn,(t,[e,r])=>{let n=$Xo(e,r);t.all.push(n),t.branches[e]=n}),new ko(WGt,(t,[e])=>{let r=VXo(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],hXe=a((t,e)=>eb(new Gxn,oIn,[t,e]),"parseBranchDeletions")}}),Vxn,YXo=Zr({"src/lib/responses/BranchSummary.ts"(){"use strict";Vxn=class{static{a(this,"BranchSummaryResult")}constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,r,n,o){t==="*"&&(this.detached=e,this.current=r),this.all.push(r),this.branches[r]={current:t==="*",linkedWorkTree:t==="+",name:r,commit:n,label:o}}}}});function sIn(t){return t?t.charAt(0):""}a(sIn,"branchStatus");function Wxn(t,e=!1){return eb(new Vxn,e?[Yxn]:zxn,t)}a(Wxn,"parseBranchSummary");var zxn,Yxn,KXo=Zr({"src/lib/parsers/parse-branch.ts"(){"use strict";YXo(),io(),zxn=[new ko(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,n,o])=>{t.push(sIn(e),!0,r,n,o)}),new ko(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,n,o])=>{t.push(sIn(e),!1,r,n,o)})],Yxn=new ko(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),Kxn={};sm(Kxn,{branchLocalTask:a(()=>ZXo,"branchLocalTask"),branchTask:a(()=>JXo,"branchTask"),containsDeleteBranchCommand:a(()=>Jxn,"containsDeleteBranchCommand"),deleteBranchTask:a(()=>ees,"deleteBranchTask"),deleteBranchesTask:a(()=>XXo,"deleteBranchesTask")});function Jxn(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}a(Jxn,"containsDeleteBranchCommand");function JXo(t){let e=Jxn(t),r=t.includes("--show-current"),n=["branch",...t];return n.length===1&&n.push("-a"),n.includes("-v")||n.splice(1,0,"-v"),{format:"utf-8",commands:n,parser(o,s){return e?hXe(o,s).all[0]:Wxn(o,r)}}}a(JXo,"branchTask");function ZXo(){return{format:"utf-8",commands:["branch","-v"],parser(t){return Wxn(t)}}}a(ZXo,"branchLocalTask");function XXo(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,n){return hXe(r,n)},onError({exitCode:r,stdOut:n},o,s,c){if(!$xn(String(o),r))return c(o);s(n)}}}a(XXo,"deleteBranchesTask");function ees(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(n,o){return hXe(n,o).branches[t]},onError({exitCode:n,stdErr:o,stdOut:s},c,l,u){if(!$xn(String(c),n))return u(c);throw new Uwe(r.parser(Fwe(s),Fwe(o)),String(c))}};return r}a(ees,"deleteBranchTask");var tes=Zr({"src/lib/tasks/branch.ts"(){"use strict";Xue(),zXo(),KXo(),io()}});function res(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,Zxn.normalize)(e)}a(res,"toPath");var Xxn,nes=Zr({"src/lib/responses/CheckIgnore.ts"(){"use strict";Xxn=a(t=>t.split(/\n/g).map(res).filter(Boolean),"parseCheckIgnore")}}),ewn={};sm(ewn,{checkIgnoreTask:a(()=>ies,"checkIgnoreTask")});function ies(t){return{commands:["check-ignore",...t],format:"utf-8",parser:Xxn}}a(ies,"checkIgnoreTask");var oes=Zr({"src/lib/tasks/check-ignore.ts"(){"use strict";nes()}});function ses(t,e){return eb({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},twn,[t,e])}a(ses,"parseFetchResult");var twn,aes=Zr({"src/lib/parsers/parse-fetch.ts"(){"use strict";io(),twn=[new ko(/From (.+)$/,(t,[e])=>{t.remote=e}),new ko(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new ko(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new ko(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new ko(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,n,o])=>{t.updated.push({name:n,tracking:o,to:r,from:e})})]}}),rwn={};sm(rwn,{fetchTask:a(()=>les,"fetchTask")});function ces(t){return/^--upload-pack(=|$)/.test(t)}a(ces,"disallowedCommand");function les(t,e,r){let n=["fetch",...r];return t&&e&&n.push(t,e),n.find(ces)?XC("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:ses}}a(les,"fetchTask");var ues=Zr({"src/lib/tasks/fetch.ts"(){"use strict";aes(),sh()}});function des(t){return eb({moves:[]},nwn,t)}a(des,"parseMoveResult");var nwn,fes=Zr({"src/lib/parsers/parse-move.ts"(){"use strict";io(),nwn=[new ko(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),iwn={};sm(iwn,{moveTask:a(()=>pes,"moveTask")});function pes(t,e){return{commands:["mv","-v",...zO(t),e],format:"utf-8",parser:des}}a(pes,"moveTask");var hes=Zr({"src/lib/tasks/move.ts"(){"use strict";fes(),io()}}),own={};sm(own,{pullTask:a(()=>mes,"pullTask")});function mes(t,e,r){let n=["pull",...r];return t&&e&&n.splice(1,0,t,e),{commands:n,format:"utf-8",parser(o,s){return h$t(o,s)},onError(o,s,c,l){let u=CXo(Fwe(o.stdOut),Fwe(o.stdErr));if(u)return l(new Uwe(u));l(s)}}}a(mes,"pullTask");var ges=Zr({"src/lib/tasks/pull.ts"(){"use strict";Xue(),wxn(),io()}});function Aes(t){let e={};return swn(t,([r])=>e[r]={name:r}),Object.values(e)}a(Aes,"parseGetRemotes");function yes(t){let e={};return swn(t,([r,n,o])=>{Object.hasOwn(e,r)||(e[r]={name:r,refs:{fetch:"",push:""}}),o&&n&&(e[r].refs[o.replace(/[^a-z]/g,"")]=n)}),Object.values(e)}a(yes,"parseGetRemotesVerbose");function swn(t,e){KGt(t,r=>e(r.split(/\s+/)))}a(swn,"forEach");var Ees=Zr({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";io()}}),awn={};sm(awn,{addRemoteTask:a(()=>_es,"addRemoteTask"),getRemotesTask:a(()=>ves,"getRemotesTask"),listRemotesTask:a(()=>Ces,"listRemotesTask"),remoteTask:a(()=>bes,"remoteTask"),removeRemoteTask:a(()=>Ses,"removeRemoteTask")});function _es(t,e,r){return rv(["remote","add",...r,t,e])}a(_es,"addRemoteTask");function ves(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?yes:Aes}}a(ves,"getRemotesTask");function Ces(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),rv(e)}a(Ces,"listRemotesTask");function bes(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),rv(e)}a(bes,"remoteTask");function Ses(t){return rv(["remote","remove",t])}a(Ses,"removeRemoteTask");var Tes=Zr({"src/lib/tasks/remote.ts"(){"use strict";Ees(),sh()}}),cwn={};sm(cwn,{stashListTask:a(()=>Ies,"stashListTask")});function Ies(t={},e){let r=yxn(t),n=["stash","list",...r.commands,...e],o=hxn(r.splitter,r.fields,c$t(n));return pXe(n)||{commands:n,format:"utf-8",parser:o}}a(Ies,"stashListTask");var xes=Zr({"src/lib/tasks/stash-list.ts"(){"use strict";Hwe(),gxn(),p$t(),Exn()}}),lwn={};sm(lwn,{addSubModuleTask:a(()=>wes,"addSubModuleTask"),initSubModuleTask:a(()=>Res,"initSubModuleTask"),subModuleTask:a(()=>mXe,"subModuleTask"),updateSubModuleTask:a(()=>kes,"updateSubModuleTask")});function wes(t,e){return mXe(["add",t,e])}a(wes,"addSubModuleTask");function Res(t){return mXe(["init",...t])}a(Res,"initSubModuleTask");function mXe(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),rv(e)}a(mXe,"subModuleTask");function kes(t){return mXe(["update",...t])}a(kes,"updateSubModuleTask");var Pes=Zr({"src/lib/tasks/sub-module.ts"(){"use strict";sh()}});function Des(t,e){let r=Number.isNaN(t),n=Number.isNaN(e);return r!==n?r?1:-1:r?uwn(t,e):0}a(Des,"singleSorted");function uwn(t,e){return t===e?0:t>e?1:-1}a(uwn,"sorted");function Nes(t){return t.trim()}a(Nes,"trimmed");function JZe(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}a(JZe,"toNumber");var aIn,dwn,Mes=Zr({"src/lib/responses/TagList.ts"(){"use strict";aIn=class{static{a(this,"TagList")}constructor(t,e){this.all=t,this.latest=e}},dwn=a(function(t,e=!1){let r=t.split(` +`).map(Nes).filter(Boolean);e||r.sort(function(o,s){let c=o.split("."),l=s.split(".");if(c.length===1||l.length===1)return Des(JZe(c[0]),JZe(l[0]));for(let u=0,d=Math.max(c.length,l.length);uo.indexOf(".")>=0);return new aIn(r,n)},"parseTagList")}}),fwn={};sm(fwn,{addAnnotatedTagTask:a(()=>Bes,"addAnnotatedTagTask"),addTagTask:a(()=>Les,"addTagTask"),tagListTask:a(()=>Oes,"tagListTask")});function Oes(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return dwn(r,e)}}}a(Oes,"tagListTask");function Les(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}a(Les,"addTagTask");function Bes(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}a(Bes,"addAnnotatedTagTask");var Fes=Zr({"src/lib/tasks/tag.ts"(){"use strict";Mes()}}),Ues=rZo({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(qZo(),oh(ixn)),{SimpleGitApi:n}=(qXo(),oh(Uxn)),{Scheduler:o}=(jXo(),oh(Qxn)),{adhocExecTask:s,configurationErrorTask:c}=(sh(),oh(UGt)),{asArray:l,filterArray:u,filterPrimitives:d,filterString:f,filterStringOrStringArray:h,filterType:m,getTrailingOptions:g,trailingFunctionArgument:A,trailingOptionsArgument:y}=(io(),oh(xIn)),{applyPatchTask:E}=(GXo(),oh(Hxn)),{branchTask:_,branchLocalTask:v,deleteBranchesTask:b,deleteBranchTask:T}=(tes(),oh(Kxn)),{checkIgnoreTask:w}=(oes(),oh(ewn)),{checkIsRepoTask:R}=(PIn(),oh(wIn)),{cleanWithOptionsTask:x,isCleanOptionsArray:P}=(jIn(),oh(QIn)),{diffSummaryTask:D}=(p$t(),oh(Axn)),{fetchTask:N}=(ues(),oh(rwn)),{moveTask:L}=(hes(),oh(iwn)),{pullTask:B}=(ges(),oh(own)),{pushTagsTask:j}=(Dxn(),oh(Pxn)),{addRemoteTask:M,getRemotesTask:O,listRemotesTask:U,remoteTask:q,removeRemoteTask:Q}=(Tes(),oh(awn)),{getResetMode:Y,resetTask:W}=(exn(),oh(JIn)),{stashListTask:V}=(xes(),oh(cwn)),{addSubModuleTask:z,initSubModuleTask:ie,subModuleTask:H,updateSubModuleTask:te}=(Pes(),oh(lwn)),{addAnnotatedTagTask:le,addTagTask:Le,tagListTask:ge}=(Fes(),oh(fwn)),{straightThroughBufferTask:Oe,straightThroughStringTask:we}=(sh(),oh(UGt));function re(ee,K){this._plugins=K,this._executor=new r(ee.baseDir,new o(ee.maxConcurrentProcesses),K),this._trimmed=ee.trimmed}a(re,"Git2"),(re.prototype=Object.create(n.prototype)).constructor=re,re.prototype.customBinary=function(ee){return this._plugins.reconfigure("binary",ee),this},re.prototype.env=function(ee,K){return arguments.length===1&&typeof ee=="object"?this._executor.env=ee:(this._executor.env=this._executor.env||{})[ee]=K,this},re.prototype.stashList=function(ee){return this._runTask(V(y(arguments)||{},u(ee)&&ee||[]),A(arguments))},re.prototype.mv=function(ee,K){return this._runTask(L(ee,K),A(arguments))},re.prototype.checkoutLatestTag=function(ee){var K=this;return this.pull(function(){K.tags(function(he,X){K.checkout(X.latest,ee)})})},re.prototype.pull=function(ee,K,he,X){return this._runTask(B(m(ee,f),m(K,f),g(arguments)),A(arguments))},re.prototype.fetch=function(ee,K){return this._runTask(N(m(ee,f),m(K,f),g(arguments)),A(arguments))},re.prototype.silent=function(ee){return this._runTask(s(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},re.prototype.tags=function(ee,K){return this._runTask(ge(g(arguments)),A(arguments))},re.prototype.rebase=function(){return this._runTask(we(["rebase",...g(arguments)]),A(arguments))},re.prototype.reset=function(ee){return this._runTask(W(Y(ee),g(arguments)),A(arguments))},re.prototype.revert=function(ee){let K=A(arguments);return typeof ee!="string"?this._runTask(c("Commit must be a string"),K):this._runTask(we(["revert",...g(arguments,0,!0),ee]),K)},re.prototype.addTag=function(ee){let K=typeof ee=="string"?Le(ee):c("Git.addTag requires a tag name");return this._runTask(K,A(arguments))},re.prototype.addAnnotatedTag=function(ee,K){return this._runTask(le(ee,K),A(arguments))},re.prototype.deleteLocalBranch=function(ee,K,he){return this._runTask(T(ee,typeof K=="boolean"?K:!1),A(arguments))},re.prototype.deleteLocalBranches=function(ee,K,he){return this._runTask(b(ee,typeof K=="boolean"?K:!1),A(arguments))},re.prototype.branch=function(ee,K){return this._runTask(_(g(arguments)),A(arguments))},re.prototype.branchLocal=function(ee){return this._runTask(v(),A(arguments))},re.prototype.raw=function(ee){let K=!Array.isArray(ee),he=[].slice.call(K?arguments:ee,0);for(let de=0;deconsole.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},re.prototype.checkIgnore=function(ee,K){return this._runTask(w(l(m(ee,h,[]))),A(arguments))},re.prototype.checkIsRepo=function(ee,K){return this._runTask(R(m(ee,f)),A(arguments))},e.exports=re}});Yq();var Qes=class extends pF{static{a(this,"GitConstructError")}constructor(t,e){super(void 0,e),this.config=t}};Yq();Yq();var Zue=class extends pF{static{a(this,"GitPluginError")}constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};Xue();pIn();PIn();jIn();$In();WIn();KIn();exn();function qes(t){return t?[{type:"spawn.before",action(n,o){t.aborted&&o.kill(new Zue(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,o){function s(){o.kill(new Zue(void 0,"abort","Abort signal received"))}a(s,"kill"),t.addEventListener("abort",s),o.spawned.on("close",()=>t.removeEventListener("abort",s))}}]:void 0}a(qes,"abortPlugin");function jes(t={}){return{type:"spawn.args",action(e,{env:r}){for(let n of MTn(e,r))if(t[n.category]!==!0)throw new Zue(void 0,"unsafe",n.message);return e}}}a(jes,"blockUnsafeOperationsPlugin");io();function Hes(t){let e=Bwe(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}a(Hes,"commandConfigPrefixingPlugin");io();var cIn=(0,Kue.deferred)().promise;function Ges({onClose:t=!0,onExit:e=50}={}){function r(){let o=-1,s={close:(0,Kue.deferred)(),closeTimeout:(0,Kue.deferred)(),exit:(0,Kue.deferred)(),exitTimeout:(0,Kue.deferred)()},c=Promise.race([t===!1?cIn:s.closeTimeout.promise,e===!1?cIn:s.exitTimeout.promise]);return n(t,s.close,s.closeTimeout),n(e,s.exit,s.exitTimeout),{close(l){o=l,s.close.done()},exit(l){o=l,s.exit.done()},get exitCode(){return o},result:c}}a(r,"createEvents");function n(o,s,c){o!==!1&&(o===!0?s.promise:s.promise.then(()=>NGt(o))).then(c.done)}return a(n,"configureTimeout"),{type:"spawn.after",async action(o,{spawned:s,close:c}){let l=r(),u=!0,d=a(()=>{u=!1},"quickClose");s.stdout?.on("data",d),s.stderr?.on("data",d),s.on("error",d),s.on("close",f=>l.close(f)),s.on("exit",f=>l.exit(f));try{await l.result,u&&await NGt(50),c(l.exitCode)}catch(f){c(l.exitCode,f)}}}}a(Ges,"completionDetectionPlugin");io();var $es="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",lIn="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function Ves(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(t)}a(Ves,"isBadArgument");function uIn(t,e){if(t.length<1||t.length>2)throw new Zue(void 0,"binary",$es);if(t.some(Ves))if(e)console.warn(lIn);else throw new Zue(void 0,"binary",lIn);let[n,o]=t;return{binary:n,prefix:o}}a(uIn,"toBinaryConfig");function Wes(t,e=["git"],r=!1){let n=uIn(zO(e),r);t.on("binary",o=>{n=uIn(zO(o),r)}),t.append("spawn.binary",()=>n.binary),t.append("spawn.args",o=>n.prefix?[n.prefix,...o]:o)}a(Wes,"customBinaryPlugin");Yq();function zes(t){return!!(t.exitCode&&t.stdErr.length)}a(zes,"isTaskError");function Yes(t){return Buffer.concat([...t.stdOut,...t.stdErr])}a(Yes,"getErrorMessage");function Kes(t=!1,e=zes,r=Yes){return(n,o)=>!t&&n||!e(o)?n:r(o)}a(Kes,"errorDetectionHandler");function dIn(t){return{type:"task.error",action(e,r){let n=t(e.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new pF(void 0,n.toString("utf-8"))}:{error:n}}}}a(dIn,"errorDetectionPlugin");io();var Jes=class{static{a(this,"PluginStore")}constructor(){this.plugins=new Set,this.events=new pwn.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=gw(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return zO(t).forEach(r=>r&&this.plugins.add(gw(e,r))),()=>{e.forEach(r=>this.plugins.delete(r))}}exec(t,e,r){let n=e,o=Object.freeze(Object.create(r));for(let s of this.plugins)s.type===t&&(n=s.action(n,o));return n}};io();function Zes(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,c){return r.includes(c.method)?EIn(s,e):s}},{type:"spawn.after",action(s,c){c.commands.includes(e)&&c.spawned.stderr?.on("data",l=>{let u=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(l.toString("utf8"));u&&t({method:c.method,stage:Xes(u[1]),progress:vu(u[2]),processed:vu(u[3]),total:vu(u[4])})})}}]}a(Zes,"progressMonitorPlugin");function Xes(t){return String(t.toLowerCase().split(" ",1))||"unknown"}a(Xes,"progressEventStage");io();function ets(t){let e=vIn(t,["uid","gid"]);return{type:"spawn.options",action(r){return{...e,...r}}}}a(ets,"spawnOptionsPlugin");function tts({block:t,stdErr:e=!0,stdOut:r=!0}){if(t>0)return{type:"spawn.after",action(n,o){let s;function c(){s&&clearTimeout(s),s=setTimeout(u,t)}a(c,"wait");function l(){o.spawned.stdout?.off("data",c),o.spawned.stderr?.off("data",c),o.spawned.off("exit",l),o.spawned.off("close",l),s&&clearTimeout(s)}a(l,"stop");function u(){l(),o.kill(new Zue(void 0,"timeout","block timeout reached"))}a(u,"kill"),r&&o.spawned.stdout?.on("data",c),e&&o.spawned.stderr?.on("data",c),o.spawned.on("exit",l),o.spawned.on("close",l),c()}}}a(tts,"timeoutPlugin");function rts(){return{type:"spawn.args",action(t){let e=[],r;function n(o){(r=r||[]).push(...o)}a(n,"append2");for(let o=0;opw(c)&&$ue(c)||c));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}a(rts,"suffixPathsPlugin");io();var nts=Ues();function its(t,e){let r=new Jes,n=TIn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!JGt(n.baseDir))throw new Qes(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(Hes(n.config)),r.add(jes(n.unsafe)),r.add(Ges(n.completion)),n.abort&&r.add(qes(n.abort)),n.progress&&r.add(Zes(n.progress)),n.timeout&&r.add(tts(n.timeout)),n.spawnOptions&&r.add(ets(n.spawnOptions)),r.add(rts()),r.add(dIn(Kes(!0))),n.errors&&r.add(dIn(n.errors)),Wes(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new nts(n,r)}a(its,"gitInstanceFactory");Xue();var tde=its;var Aw=new pe("Git Service");var gXe=class t{constructor(e){this.ctx=e;this.gitInstances=new Map;this._upstreamCache=new Map}static{a(this,"GitService")}static{this._upstreamCacheTtlMs=300*1e3}async getGitInstance(e){let r=this.normalizeRepoPath(e),n=this.gitInstances.get(r);if(!n){let o=(await mO()).path;n=tde({baseDir:r,binary:o,unsafe:{allowUnsafeCustomBinary:!0}}),this.gitInstances.set(r,n)}return n}constructFileUri(e,r){let n=this.normalizeRepoPath(e),o=(0,mwn.join)(n,r);return ts(o)}parseStatus(e){switch(e){case"M":return 2;case"A":return 0;case"D":return 3;case"R":return 1;default:return 2}}parseDiffOutput(e,r){let n=[],o=r.split("\0").filter(s=>s.length>0);for(let s=0;s=o.length){Aw.warn(this.ctx,`Malformed git diff output: rename status without both paths at position ${s}. Output: ${r}`);continue}let f=o[s+1],h=o[s+2];if(!f||!h){Aw.warn(this.ctx,`Malformed git diff output: empty path(s) for rename at position ${s}. Paths: [${f}, ${h}]. Output: ${r}`);continue}let m=this.constructFileUri(e,f),g=this.constructFileUri(e,h);n.push({uri:g,originalUri:m,renameUri:g,status:1}),s+=2}else{if(s+1>=o.length){Aw.warn(this.ctx,`Malformed git diff output: status without path at position ${s}. Status: ${u}. Output: ${r}`);continue}let f=o[s+1];if(!f){Aw.warn(this.ctx,`Malformed git diff output: empty file path at position ${s}. Status: ${u}. Output: ${r}`);continue}let h=this.constructFileUri(e,f);n.push({uri:h,originalUri:h,renameUri:void 0,status:d}),s+=1}}return n}async diffWith(e,r){try{let o=await(await this.getGitInstance(e)).raw(["diff","--name-status","-z","--diff-filter=ADMR",r,"--"]);return!o||o.trim().length===0?[]:this.parseDiffOutput(e,o)}catch(n){Aw.warn(this.ctx,`Failed to diff with ${r} for ${e}`,n);return}}async hasUpstream(e){let r=this.normalizeRepoPath(e),n=this._upstreamCache.get(r),o=Date.now();if(n&&o-n.checkedAt0}catch(o){return Aw.warn(this.ctx,`Failed to query upstream config for ${e}`,o),!1}}clearUpstreamCache(e){e?this._upstreamCache.delete(this.normalizeRepoPath(e)):this._upstreamCache.clear()}async diffWithIndexedCommit(e,r){try{if(r){let o=await this.diffWith(e,r);if(o)return{changes:o,mayBeOutdated:!1};Aw.warn(this.ctx,`Failed to diff with indexed commit ${r}, falling back to upstream`)}if(!await this.hasUpstream(e)){Aw.debug(this.ctx,`No upstream branch configured for ${e}, cannot determine changes`);return}let n=await this.diffWith(e,"@{upstream}");return n?{changes:n,mayBeOutdated:!0}:void 0}catch(n){Aw.warn(this.ctx,`Failed to diff with indexed commit for ${e}`,n);return}}normalizeRepoPath(e){if(e.startsWith("file://"))try{return(0,hwn.fileURLToPath)(e)}catch(r){Aw.warn(this.ctx,`Failed to convert URI to path: ${e}, attempting fallback`,r);try{let n=new URL(e),o=decodeURIComponent(n.pathname);return process.platform==="win32"&&/^\/[a-zA-Z]:/.test(o)&&(o=o.slice(1).replace(/\//g,"\\")),o}catch(n){return Aw.error(this.ctx,`Failed to parse URI with fallback: ${e}`,n),e}}return e}dispose(){this.gitInstances.clear(),this._upstreamCache.clear()}};var gwn=fe(nl());var c2=new pe("Local Diff Tracker");var AXe=class t{constructor(e,r,n){this.ctx=e;this._workspaceFileIndex=r;this._githubCodeSearchService=n;this._repos=new Map;this._locallyChangedFiles=new Set;this._fileWatcherDisposables=[];this._gitService=new gXe(e),this._repositoryManager=e.get(Tf),this._diffRefreshTimer=new gwn.IntervalTimer}static{a(this,"CodeSearchWorkspaceDiffTracker")}static{this._diffRefreshInterval=1e3*60*2}static{this._diffRefreshMaxInterval=1e3*60*30}static{this._maxDiffFiles=1e4}async initialize(){return this._initializePromise??=this.doInitialize(),this._initializePromise}async doInitialize(){try{c2.info(this.ctx,"Initializing Local Diff Tracker"),await this._workspaceFileIndex.initialize();let e=a(n=>{for(let o of n)this._locallyChangedFiles.add(o)},"addFiles");this._fileWatcherDisposables.push(this._workspaceFileIndex.onDidCreateFiles(e),this._workspaceFileIndex.onDidChangeFiles(e),this._workspaceFileIndex.onDidDeleteFiles(n=>{for(let o of n)this._locallyChangedFiles.delete(o)}));let r=await this._repositoryManager.getRepo({uri:this._workspaceFileIndex.workspaceFolder.uri});r||(r=await this.tryInferRepoFromFiles()),r&&r.isGitHub()&&r.owner&&r.name?await this.openRepo(r):c2.info(this.ctx,`Workspace folder ${this._workspaceFileIndex.workspaceFolder.uri} is not a GitHub repository`)}catch(e){c2.error(this.ctx,"Initialization failed",e)}}async tryInferRepoFromFiles(){try{let e=Array.from(this._workspaceFileIndex.values());if(e.length===0)return;for(let r=0;r{this.refreshRepoDiffs()},t._diffRefreshInterval),await this.refreshRepoDiff(n)}async tryGetDiffedIndexedFiles(e,r){let n=await this.tryGetDiff(e,r);if(!n)return;let o=new Set,s=n.changes.slice(0,t._maxDiffFiles);for(let c of s){let l=c.uri;this._workspaceFileIndex.get(l)&&o.add(l)}return o}async tryGetDiff(e,r){try{let n=e.baseFolder.uri,o=await this._gitService.diffWithIndexedCommit(n,r);return o?{changes:o.changes,mayBeOutdated:o.mayBeOutdated}:void 0}catch(n){c2.error(this.ctx,`Failed to get diff for ${e.baseFolder.uri}`,n);return}}async refreshRepoDiffs(){let e=Date.now(),r=Array.from(this._repos.values(),n=>n).filter(n=>n.nextRefreshAt<=e);await Promise.all(r.map(n=>this.refreshRepoDiff(n)))}getNextRefreshDelay(e){if(e<=0)return t._diffRefreshInterval;let r=Math.min(e,5),n=t._diffRefreshInterval*Math.pow(2,r);return Math.min(n,t._diffRefreshMaxInterval)}async refreshRepoDiff(e){try{let r=this._githubCodeSearchService.getIndexedCommit(e.repo.baseFolder.uri),n=await this.tryGetDiffedIndexedFiles(e.repo,r);if(n){e.initialChanges.clear();for(let c of n)e.initialChanges.add(c);let o=e.repo.baseFolder.uri,s=[];for(let c of this._locallyChangedFiles)if(c.startsWith(o)){let l=this._workspaceFileIndex.get(c);(!l||!l.isDirty())&&s.push(c)}for(let c of s)this._locallyChangedFiles.delete(c);(e.state===1||e.consecutiveFailures>0)&&c2.info(this.ctx,`Diff refresh recovered for ${e.repo.baseFolder.uri}`),e.state=2,e.consecutiveFailures=0,e.lastErrorKey=void 0}else this.handleDiffFailure(e,"no-diff",`Failed to get new diff for ${e.repo.baseFolder.uri}.`)}catch(r){this.handleDiffFailure(e,"exception",`Failed to refresh diff for ${e.repo.baseFolder.uri}.`,r)}finally{e.nextRefreshAt=Date.now()+this.getNextRefreshDelay(e.consecutiveFailures)}}handleDiffFailure(e,r,n,o){e.state=1,e.consecutiveFailures++;let s=e.lastErrorKey!==r;e.lastErrorKey=r,s?o!==void 0?c2.warn(this.ctx,n,o):c2.warn(this.ctx,n):o!==void 0?c2.debug(this.ctx,n,o):c2.debug(this.ctx,n)}dispose(){this._diffRefreshTimer.dispose(),this._gitService.dispose(),this._fileWatcherDisposables.forEach(e=>e.dispose())}};p();p();var Kq;(n=>{function t(o){return new A$t(o)}n.ok=t,a(t,"ok");function e(o){return new y$t(o)}n.error=e,a(e,"error");function r(o){return n.error(new Error(o))}n.fromString=r,a(r,"fromString")})(Kq||={});var A$t=class t{constructor(e){this.val=e}static{a(this,"ResultOk")}map(e){return new t(e(this.val))}flatMap(e){return e(this.val)}isOk(){return!0}isError(){return!1}},y$t=class{constructor(e){this.err=e}static{a(this,"ResultError")}map(e){return this}flatMap(e){return this}isOk(){return!1}isError(){return!0}};var E$t=new pe("GithubAvailableEmbeddingTypes"),yXe=class{constructor(e){this._ctx=e;this._cached=this._ctx.get(Ft).getGitHubSession().then(r=>r?this.doGetAvailableTypes(r):Kq.error({type:"noSession"}))}static{a(this,"GithubAvailableEmbeddingTypesManager")}async getAllAvailableTypes(){if(this._cached){let e=this._cached;try{let r=await this._cached;if(r.isOk())return r}catch{}this._cached===e&&(this._cached=void 0)}return this._cached??=(async()=>{let e=await this._ctx.get(Ft).getGitHubSession();return e?await this.doGetAvailableTypes(e):Kq.error({type:"noSession"})})(),this._cached}async doGetAvailableTypes(e){let r;try{let c=jue(this._ctx);r=await Bd(this._ctx,e,"embeddings/models",{headers:c,method:"GET"})}catch(c){return E$t.error(this._ctx,"Error fetching available embedding types",c),Kq.error({type:"requestFailed",error:c})}if(!r.ok)return r.status===401||r.status===404?Kq.error({type:"unauthorized",status:r.status}):Kq.error({type:"badResponse",status:r.status});let n=await r.json(),o=[],s=[];for(let c of n.models){let l=new zC(c.id);c.active===!1?s.push(l):o.push(l)}return Kq.ok({primary:o,deprecated:s})}async getPreferredType(){let e=await this.getAllAvailableTypes();if(!e.isOk()){E$t.info(this._ctx,`Could not find any available embedding types. Error: ${e.err.type}`);return}let r=e.val;return E$t.info(this._ctx,`Got embeddings. Primary: ${r.primary.join(",")}. Deprecated: ${r.deprecated.join(",")}`),r.primary.at(0)??r.deprecated.at(0)}};p();var ots=new pe("GithubEmbeddingComputer"),rde=class{constructor(e){this.ctx=e;this.batchSize=100}static{a(this,"GithubEmbeddingComputer")}async computeEmbeddings(e,r,n,o){try{let s=await this.ctx.get(Ft).getGitHubSession();if(!s)throw new Error("No GitHub session available");let c=[],l;for(let u=0;u0&&(l=f[0].type),c.push(...f)}if(!l)throw new Error("No embedding type resolved from API response");return{type:l,values:c}}catch(s){ots.error(this.ctx,"Error computing embeddings:",s);return}}async fetchBatchEmbeddings(e,r,n,o,s){try{let c={inputs:n};if(r&&(c.embedding_model=r.id),o?.inputType&&(c.input_type=o.inputType),s?.isCancellationRequested)return;let l=await Bd(this.ctx,e,"embeddings",{method:"POST",json:c});if(!l.ok)throw new Error(`Error fetching embeddings: ${l.status}. ${await l.text()}`);let u=await l.json(),d=new zC(u.embedding_model);if(r&&!d.equals(r))throw new Error(`Unexpected embedding model. Got: ${d.id}. Expected: ${r.id}`);if(n.length!==u.embeddings.length)throw new Error(`Mismatched embedding result count. Expected: ${n.length}. Got: ${u.embeddings.length}`);return u.embeddings.map(f=>({type:d,value:new Float32Array(f.embedding)}))}catch(c){throw new Error("Error fetching batch embeddings: "+(c instanceof Error?c.message:String(c)))}}};p();p();p();var Gwe=class{constructor(){this.recomputedFileCount=0;this.sentContentTextLength=0}static{a(this,"ComputeBatchInfo")}};p();var Awn=fe(LA()),ywn=fe(bU()),Ewn=require("os"),_$t=fe(require("path")),nde=require("process");function EXe(t){let e=ln(t.workspaceFolder.uri),r=(0,Awn.basename)(e),o=(0,ywn.SHA256)(e).toString().substring(0,8);return _$t.default.join(sts(),"project-index",`${r}.${o}`)}a(EXe,"getWorkspaceCachePath");function sts(){return nde.env.XDG_CACHE_HOME&&_$t.default.isAbsolute(nde.env.XDG_CACHE_HOME)?nde.env.XDG_CACHE_HOME+"/github-copilot":(0,Ewn.platform)()==="win32"?nde.env.USERPROFILE+"\\AppData\\Local\\Temp\\github-copilot":nde.env.HOME+"/.cache/github-copilot"}a(sts,"getXdgCachePath");p();p();function _wn(t){if(Hjt(t.type)?.quantization.document==="binary"){if(t.value.length%8!==0)throw new Error(`Embedding value length must be a multiple of 8 for ${t.type.id}, got ${t.value.length}`);let n=new Uint8Array(t.value.length/8);for(let o=0;o=0?1:0)<=1024)){let o=new Float32Array(e.length*8);for(let s=0;s0?.03125:-.03125}return{type:t,value:o}}let n=new Float32Array(e.byteLength/4);return new Uint8Array(n.buffer).set(e),{type:t,value:n}}a(v$t,"unpackEmbedding");p();var vwn=fe(nl()),Cwn=fe(r2()),b$t=fe(nh()),bwn=fe(require("fs")),S$t=fe(require("node:sqlite")),T$t=fe(require("path"));var C$t=new pe("WorkspaceChunkAndEmbeddingCache");async function Swn(t,e,r,n){return await I$t.create(t,e,r??":memory:",n)}a(Swn,"createWorkspaceChunkAndEmbeddingCache");var I$t=class t{constructor(e,r){this.embeddingType=e;this.db=r;this._inMemory=new Cwn.ResourceMap}static{a(this,"DbCache")}static{this.version="1.0.0"}static async create(e,r,n,o){let s={open:!0},c;if(n!==":memory:"){let d=T$t.default.join(n,"workspace-chunks.db");try{await bwn.default.promises.mkdir(T$t.default.dirname(d),{recursive:!0}),c=new S$t.default.DatabaseSync(d,s),C$t.debug(e,`DbWorkspaceChunkAndEmbeddingCache: Opened SQLite database on disk at ${d}`)}catch(f){C$t.error(e,"DbWorkspaceChunkAndEmbeddingCache: Failed to open SQLite database on disk, falling back to in-memory",f)}}c||(c=new S$t.default.DatabaseSync(":memory:",s),C$t.debug(e,"DbWorkspaceChunkAndEmbeddingCache: Using in-memory database")),c.exec(` PRAGMA journal_mode = OFF; PRAGMA synchronous = 0; PRAGMA cache_size = ${-32768}; @@ -2854,20 +2854,20 @@ ${t.map(r=>`- ${r}`).join(` CREATE INDEX IF NOT EXISTS idx_files_uri ON Files(uri); CREATE INDEX IF NOT EXISTS idx_filechunks_fileId ON FileChunks(fileId); - `);let l=c.prepare("SELECT version, embeddingModel FROM CacheMeta LIMIT 1").get();(!l||l.version!==this.version||l.embeddingModel!==r.id)&&c.exec("DELETE FROM CacheMeta; DELETE FROM Files; DELETE FROM FileChunks;"),c.exec("DELETE FROM CacheMeta;"),c.prepare("INSERT INTO CacheMeta (version, embeddingModel) VALUES (?, ?)").run(this.version,r.id),await o.initialize();let u=c.prepare("SELECT id, uri FROM Files");try{c.exec("BEGIN TRANSACTION");for(let d of u.all()){let f=d;try{if(o.get(f.uri))continue}catch{}c.prepare("DELETE FROM Files WHERE id = ?").run(f.id)}}finally{c.exec("COMMIT")}return new t(r,c)}dispose(){this.db.close()}async isIndexed(e){return(await this.getEntry(e))?.state==="resolved"}async get(e){return(await this.getEntry(e))?.value}getCurrentChunksForUri(e){let r=to(e),n=this._inMemory.get(r);if(n?.state==="pending"||n?.state==="rejected")return;let o=this.db.prepare("SELECT fc.text, fc.range_startLineNumber, fc.range_startColumn, fc.range_endLineNumber, fc.range_endColumn, fc.embedding, fc.chunkHash FROM Files f JOIN FileChunks fc ON f.id = fc.fileId WHERE f.uri = ?").all(e.toString());if(o.length>0){let s=new Map;for(let c of o){let l=RGt(this.embeddingType,c.embedding),u={chunk:{file:e.toString(),text:c.text,rawText:void 0,range:new PGt.Range(c.range_startLineNumber,c.range_startColumn,c.range_endLineNumber,c.range_endColumn)},embedding:l,chunkHash:c.chunkHash};u.chunkHash&&s.set(u.chunkHash,u)}return s}}async getEntry(e){let r=to(e.uri),n=this._inMemory.get(r),o=await e.getFastContentVersionId();if(n?.contentVersionId===o)return n;let s=this.db.prepare("SELECT id, contentVersionId FROM Files WHERE uri = ?").get(e.uri.toString());if(!s||s.contentVersionId!==o)return;let c=this.db.prepare("SELECT text, range_startLineNumber, range_startColumn, range_endLineNumber, range_endColumn, embedding, chunkHash FROM FileChunks WHERE fileId = ?").all(s.id);return{state:"resolved",contentVersionId:s.contentVersionId,fileHash:void 0,value:c.map(l=>({chunk:{file:e.uri.toString(),text:l.text,rawText:void 0,range:new PGt.Range(l.range_startLineNumber,l.range_startColumn,l.range_endLineNumber,l.range_endColumn)},embedding:RGt(this.embeddingType,l.embedding),chunkHash:l.chunkHash}))}}async update(e,r){let n=to(e.uri),o=this._inMemory.get(n),s=await e.getFastContentVersionId();if(o?.contentVersionId===s)return o.value;let c=await this.getEntry(e);if(c?.contentVersionId===s)return c.value;o?.state==="pending"&&o.value.cancel();let l=(0,$In.createCancelablePromise)(r),u={contentVersionId:s,fileHash:void 0,state:"pending",value:l};return this._inMemory.set(n,u),await l.then(d=>({contentVersionId:s,fileHash:void 0,state:Array.isArray(d)?"resolved":"rejected",value:d}),()=>({contentVersionId:s,fileHash:void 0,state:"rejected",value:void 0})).then(d=>{let f=this._inMemory.get(n);if(u===f)if(d.state==="rejected")this._inMemory.set(n,d),this.db.prepare("DELETE FROM Files WHERE uri = ?").run(n.toString());else{this._inMemory.delete(n);let h=this.db.prepare("INSERT OR REPLACE INTO Files (uri, contentVersionId) VALUES (?, ?)").run(e.uri.toString(),s);try{let m=this.db.prepare("INSERT INTO FileChunks (fileId, text, range_startLineNumber, range_startColumn, range_endLineNumber, range_endColumn, embedding, chunkHash) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");this.db.exec("BEGIN TRANSACTION");for(let g of d.value??[])m.run(h.lastInsertRowid,g.chunk.text,g.chunk.range.startLineNumber,g.chunk.range.startColumn,g.chunk.range.endLineNumber,g.chunk.range.endColumn,GIn(g.embedding),g.chunkHash??"")}finally{this.db.exec("COMMIT")}}}),l}};var YIn=de(Sl()),Iwe=de(nl()),KIn=de(eF());var VZe=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._workspaceFileIndex=n;this._chunkingEndpointClient=o;this._cache=new KIn.Lazy(async()=>(this._cacheRoot=$Ze(this._workspaceFileIndex),await zIn(this.ctx,this._embeddingType,this._cacheRoot,this._workspaceFileIndex)))}static{a(this,"WorkspaceChunkEmbeddingsIndex")}dispose(){this._cache.hasValue&&this._cache.value.then(e=>e.dispose())}async getIndexState(){if(!this._cache.hasValue)return;let e=await this._cache.value,r=Array.from(this._workspaceFileIndex.values()),n=0;return await Promise.all(r.map(async o=>{await e.isIndexed(o)&&n++})),{totalFileCount:r.length,indexedFileCount:n}}get fileCount(){return this._workspaceFileIndex.fileCount}async triggerIndexingOfWorkspace(e,r){let n=Array.from(this._workspaceFileIndex.values());await Promise.all(n.map(o=>this.triggerIndexingOfFile(o.uri,e,r)))}async triggerIndexingOfFile(e,r,n){let o=this._workspaceFileIndex.get(e);o&&await this.getChunksAndEmbeddings(r,o,new Twe,"Batch",n)}async searchWorkspace(e,r,n,o){let[s,c]=await(0,Iwe.raceCancellationError)(Promise.all([r,this.getAllWorkspaceEmbeddings(e,o)]),o);return this.rankEmbeddings(s,c,n)}async searchSubsetOfFiles(e,r,n,o,s){if(!r.length)return[];let[c,l]=await(0,Iwe.raceCancellationError)(Promise.all([n,this.getEmbeddingsForFiles(e,r,s)]),s);return this.rankEmbeddings(c,l,o)}rankEmbeddings(e,r,n){return fbn(e,r.map(o=>[o.chunk,o.embedding]),n).map(o=>({chunk:o.value,distance:o.distance}))}async getAllWorkspaceEmbeddings(e,r){let o=Array.from(this._workspaceFileIndex.values()).map(s=>s.uri);return this.getEmbeddingsForFiles(e,o,r)}async getEmbeddingsForFiles(e,r,n){let o=new Twe,s=await Promise.all(r.map(async c=>{let l=this._workspaceFileIndex.get(c);if(l)return await this.getChunksAndEmbeddings(e,l,o,"Batch",n)}));return(0,YIn.coalesce)(s).flat()}async getChunksAndEmbeddings(e,r,n,o,s){let c=await(0,Iwe.raceCancellationError)(this._cache.value,s),l=await(0,Iwe.raceCancellationError)(c.get(r),s);if(l)return l;let u=c.getCurrentChunksForUri(r.uri);return await c.update(r,async f=>this._chunkingEndpointClient.computeChunksAndEmbeddings(e,this._embeddingType,r,n,o,u,f))}};var JIn=de(nl()),ZIn=de(zP()),Wue=de(FO());var MA=new fe("Embeddings Search"),WZe=class t{constructor(e,r,n,o){this._ctx=e;this._workspaceFileIndex=r;this.embeddingType=n;this.chunkingEndpointClient=o;this.id="embeddings";this._state="unknown";this._disposeCts=new Fn.CancellationTokenSource;this._reindexRequests=new ZIn.ResourceMap}static{a(this,"EmbeddingsChunkSearch")}static{this.defaultAutomaticIndexingFileCap=750}dispose(){this._disposeCts.cancel(),this._disposeCts.dispose();for(let[,e]of this._reindexRequests)e.dispose();this._reindexRequests.clear(),this._embeddingsIndex?.dispose()}async triggerLocalIndexing(){if(MA.info(this._ctx,"Triggering local indexing..."),await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAutomaticIndexing"){MA.info(this._ctx,"Skipping automatic indexing: too many files",{fileCount:this._workspaceFileIndex.fileCount});return}await this.triggerIndexingOfWorkspace()}async searchWorkspace(e,r,n){let o=new Wue.StopWatch;MA.info(this._ctx,"Starting workspace embedding search",{rawQuery:e.rawQuery,maxResults:PA(r),indexStatus:this._state});let s=await this._ctx.get(Qt).getGitHubSession();if(!s)throw MA.error(this._ctx,"No GitHub session found"),new Error("No GitHub session found in EmbeddingsChunkSearch");let c=e.resolveQueryEmbeddings(n);if(await this.doInitialIndexing(),Hh(n),(this._state==="updatingIndex"||this._state==="ready")&&this._embeddingsIndex!==void 0){let u=new Wue.StopWatch,d=await this._embeddingsIndex.searchWorkspace(s,c,PA(r),n),f=u.elapsed(),h=o.elapsed(),m=d.length,A=new Set(d.map(E=>E.chunk.file)).size,y=this._workspaceFileIndex.fileCount;return MA.info(this._ctx,`Workspace search completed successfully in ${h}ms`,{totalTime:h,searchTime:f,chunkCount:m,uniqueFileCount:A,indexStatus:this._state}),f0.sendEmbeddingsSuccess(this._ctx,h,f,m,A,y,fE.Aggregate),{chunks:d}}else{MA.info(this._ctx,"Embeddings index is not ready for workspace search, skip searching.",{indexStatus:this._state}),f0.sendEmbeddingsSkipped(this._ctx,"index_not_ready");return}}async searchFiles(e,r,n,o){if(!n.length)return MA.info(this._ctx,"No files to search, returning empty results"),{chunks:[]};let s=new Wue.StopWatch;MA.info(this._ctx,"Starting file subset embedding search",{rawQuery:e.rawQuery,maxResults:PA(r),fileCount:n.length});let c=await this._ctx.get(Qt).getGitHubSession();if(!c)throw MA.error(this._ctx,"No GitHub session found"),new Error("No GitHub session found in EmbeddingsChunkSearch");let l=e.resolveQueryEmbeddings(o),u=await this.initializeForFileSubset(n.length);if(!u){MA.info(this._ctx,"Too many files for subset search",{fileCount:n.length});return}Hh(o);let d=new Wue.StopWatch,f=await u.searchSubsetOfFiles(c,n,l,PA(r),o),h=d.elapsed(),m=s.elapsed(),g=f.length,y=new Set(f.map(_=>_.chunk.file)).size,E=this._workspaceFileIndex.fileCount;return MA.info(this._ctx,`File subset search completed successfully in ${m}ms`,{totalTime:m,searchTime:h,chunkCount:g,uniqueFileCount:y}),f0.sendEmbeddingsSuccess(this._ctx,m,h,g,y,E,fE.Remote),{chunks:f}}async initializeForFileSubset(e){await this._workspaceFileIndex.initialize();let r=this.getAutoIndexFileCap();if(e>r){MA.info(this._ctx,`EmbeddingsChunkSearch: skipping subset search due to too many files. Found ${e} files. Max: ${r}`);return}return this.getOrCreateEmbeddingsIndex()}async initializeWorkspaceIndex(){return this._init??=(async()=>{await this._workspaceFileIndex.initialize();let e=this.checkWorkspaceIndexSizeLimits();return e?(MA.info(this._ctx,`EmbeddingsChunkSearch: skipping automatic indexing due to too many files. Found ${this._workspaceFileIndex.fileCount} files. Max: ${this.getAutoIndexFileCap()}`),this.setState(e),!0):(this.getOrCreateEmbeddingsIndex(),this.setState("ready"),!0)})(),this._init}getOrCreateEmbeddingsIndex(){return this._embeddingsIndex||(this._embeddingsIndex=new VZe(this._ctx,this.embeddingType,this._workspaceFileIndex,this.chunkingEndpointClient),MA.info(this._ctx,`EmbeddingsChunkSearch: initializing embeddings index for ${this._workspaceFileIndex.fileCount} files.`)),this._embeddingsIndex}checkWorkspaceIndexSizeLimits(){let e=this.getAutoIndexFileCap();if(this._workspaceFileIndex.fileCount>e)return"tooManyFilesForAutomaticIndexing"}async doInitialIndexing(){return this._initialIndexing??=(async()=>{if(await this.initializeWorkspaceIndex(),!(this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing"))return this.triggerIndexingOfWorkspace(),this.registerAutomaticReindexListeners(),!0})(),this._initialIndexing}async triggerIndexingOfWorkspace(){let e=new Wue.StopWatch;MA.info(this._ctx,"Starting workspace indexing...",{fileCount:this._workspaceFileIndex.fileCount}),this.setState("updatingIndex");try{let r=await this._ctx.get(Qt).getGitHubSession();if(!r)throw new Error("No GitHub session found");await this._embeddingsIndex?.triggerIndexingOfWorkspace(r,new Fn.CancellationTokenSource().token),this.setState("ready"),MA.info(this._ctx,`Workspace indexing completed in ${e.elapsed()}ms`,{status:"ready",indexingTime:e.elapsed()})}catch(r){MA.error(this._ctx,"Workspace indexing failed",r),this.setState("unknown")}}registerAutomaticReindexListeners(){this._reindexRequests.clear(),this._workspaceFileIndex.onDidCreateFiles(e=>{this.tryTriggerReindexing(e,!0)}),this._workspaceFileIndex.onDidChangeFiles(e=>this.tryTriggerReindexing(e,!0)),this._workspaceFileIndex.onDidDeleteFiles(e=>{for(let r of e){let n=to(r);this._reindexRequests.get(n)?.dispose(),this._reindexRequests.delete(n)}})}getAutoIndexFileCap(){return t.defaultAutomaticIndexingFileCap}setState(e){this._state!==e&&(this._state=e)}tryTriggerReindexing(e,r=!1){if(this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing")return;let n=6e4;for(let o of e){let s=to(o),c=this._reindexRequests.get(s);c||(c=new JIn.Delayer(n),this._reindexRequests.set(s,c)),c.trigger(async()=>{if(await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing")return;let l=await this._ctx.get(Qt).getGitHubSession();this._embeddingsIndex?.triggerIndexingOfFile(o,l,this._disposeCts.token)},r?0:n)}}};p();p();var wwe=de(uw());async function JZe(t){for(let r of t)r.then(n=>{n.isOk()&&t.forEach(o=>{o!==r&&o.cancel()})},()=>{});let e=await Promise.allSettled(t);for(let r of e)if(r.status==="fulfilled"&&r.value.isOk())return r.value;{let r=[];for(let n of e)n.status==="fulfilled"&&n.value.isError()&&r.push(n.value.err.errorDiagMessage);if(r.length)return wwe.Result.error({errorDiagMessage:r.join(", ")})}if(e.every(r=>r.status==="rejected"&&xP(r.reason)))return wwe.Result.error({errorDiagMessage:"cancelled"});for(let r of e)if(r.status==="rejected"&&!xP(r.reason))return wwe.Result.error({errorDiagMessage:r.reason+""});return wwe.Result.error({errorDiagMessage:"unknown error"})}a(JZe,"raceSearchOperations");var Rwe=de(uw()),kwe=de(nl());var fXo=2e3,pXo=.7,ixn=8e3,hXo=300,ZZe=class{constructor(e,r,n,o){this._embeddingsByWorkspace=e;this._tfidfByWorkspace=r;this._workspaceFileIndexes=n;this._diffTrackers=o}static{a(this,"LocalDiffSearch")}getTotalFileCount(e){let r=0;for(let n of e){let o=this._workspaceFileIndexes.get(n);o&&(r+=o.fileCount)}return r}async getLocalDiff(e){let r=new Set;for(let n of e){let o=this._diffTrackers.get(n);if(o){let s=await o.getDiffFiles();if(s)for(let c of s)r.add(c)}}return Array.from(r)}shouldDoLocalDiffSearch(e,r){if(e.length===0||e.length>fXo)return!1;let n=this.getTotalFileCount(r);return!(n>0&&e.length/n>pXo)}async searchLocalDiff(e,r,n,o){if(e.length===0)return Rwe.Result.ok({strategy:"none",result:{chunks:[]}});let s=[],c=[];for(let u of n.workspaceFolders){let d=this._embeddingsByWorkspace.get(u),f=this._tfidfByWorkspace.get(u);d&&s.push(d),f&&c.push(f)}if(s.length===0&&c.length===0)return Rwe.Result.error({errorDiagMessage:"No search instances available"});let l=a((u,d)=>(0,kwe.createCancelablePromise)(async f=>{let h=await Promise.all(u.map(g=>g.searchFiles(r,n,[...e],f))),m=this.mergeSearchResults(h);return Rwe.Result.ok({strategy:d,result:m})}),"createSearchOp");if(e.length>hXo){if(c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}return Rwe.Result.error({errorDiagMessage:"Diff size too large for embeddings and no TF-IDF available"})}if(s.length>0&&c.length>0){let u=l(s,"embeddings");o.onCancellationRequested(()=>u.cancel());let d=await(0,kwe.raceTimeout)(u,ixn),f=d===void 0;if(d?.isOk()&&d.val.result.chunks.length>0)return d;let h=l(c,"tfidf");return o.onCancellationRequested(()=>h.cancel()),f?(h.then(()=>u.cancel(),()=>u.cancel()),await JZe([u,h])):(u.cancel(),await h)}else if(s.length>0&&c.length===0){let u=l(s,"embeddings");o.onCancellationRequested(()=>u.cancel());let d=await(0,kwe.raceTimeout)(u,ixn);if(d?.isOk()&&d.val.result.chunks.length>0)return d;u.cancel();return}else if(s.length===0&&c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}}mergeSearchResults(e){let r=e.filter(o=>!!o);if(r.length===0)return{chunks:[]};if(r.length===1)return{chunks:[...r[0].chunks]};let n=new Map;for(let o of r)for(let s of o.chunks){let c=s.chunk.file,l=n.get(c),u=s.distance?.value??Number.MAX_VALUE,d=l?.distance?.value??Number.MAX_VALUE;(!l||ug.text.toLowerCase()),e.toLowerCase()],u=await s.computeEmbeddings(c,l,{inputType:"document"},o);if(!u||u.values.length===0)return[];if(o.isCancellationRequested)return[];let d=u.values[u.values.length-1],f=u.values.slice(0,-1);if(!r.length||f.length!==r.length)return[];let h=f[0].type,m=f.map((g,A)=>({chunk:r[A],score:Kxe(d,g).value}));return m.sort((g,A)=>A.score-g.score),m.slice(0,n).map(g=>({chunk:g.chunk,distance:{embeddingType:h,value:g.score}}))}};p();var oxn=de(require("path")),sxn=require("worker_threads");var QGt=class{constructor(){this.nextId=1;this.handlers=new Map}static{a(this,"RpcResponseHandler")}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};function mXo(t){let e={get:a((r,n)=>{if(typeof n=="string")return r[n]||(r[n]=(...o)=>t(n,o)),r[n]},"get")};return new Proxy(Object.create(null),e)}a(mXo,"createRpcProxy");var eXe=class{constructor(e,r,n){this.responseHandler=new QGt;this.worker=new sxn.Worker(e,r),CIe(this.worker,oxn.basename(e,".js")),this.worker.on("message",o=>{"fn"in o?(async()=>{try{let s=n?.[o.fn];if(!s)throw new Error(`Unknown method: ${o.fn}`);let c=await s.apply(n,o.args);this.worker.postMessage({id:o.id,res:c})}catch(s){this.worker.postMessage({id:o.id,err:s instanceof Error?s:new Error(String(s))})}})():this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=mXo((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}static{a(this,"WorkerWithRpcProxy")}terminate(){this.worker.removeAllListeners(),this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};var nXe=de(nl()),axn=de(eF()),cxn=de(Ro()),zue=de(FO()),lxn=require("fs"),tXe=de(require("path"));var rm=new fe("Tfidf Search"),gXo=100,rXe=class extends cxn.Disposable{constructor(r,n,o){super();this.id="tfidf";this._maxFileCount=25e3;this._isDisposed=!1;this._tokenizerName="o200k_base";this._workspaceFileIndex=n,this.ctx=r,this._embeddingReranker=new XZe(r,o?.embeddingType),this._customDbPath=o?.dbPath,this._tfIdfWorker=new axn.Lazy(()=>{let s=this.firstExistingPath([tXe.join(__dirname,"tfidfWorker.js"),tXe.join(__dirname,"../../../../dist/tfidfWorker.js")]);if(s===void 0)throw new Error("tfidfWorker file not found");let c={tokenizer:this._tokenizerName,dbPath:this.getDbPath()},l={readFile:a(async u=>{let f=await r.get(ii).getOrReadTextDocument({uri:u});if(f.status!=="valid")throw new Error(`Could not read file ${u}: ${f.status}`);return f.document.getText()},"readFile"),getContentVersionId:a(async u=>{try{return await this.getFastContentVersionId(u)}catch(d){throw new Error(`Could not find file ${u}, error: ${String(d)}`)}},"getContentVersionId"),logWarn:a((u,...d)=>(rm.warn(r,u,...d),Promise.resolve()),"logWarn"),logError:a((u,...d)=>(rm.error(r,u,...d),Promise.resolve()),"logError")};return new eXe(s,{workerData:c},l)}),this._register(this.registerFileWatchers())}static{a(this,"TfidfChunkSearch")}dispose(){this._isDisposed=!0,super.dispose(),this._tfIdfWorker.hasValue&&this._tfIdfWorker.value.terminate()}async initialize(){rm.info(this.ctx,"Starting initialization...");let r=new zue.StopWatch;this._initializePromise??=this.initializeWorkspace();let n=await this._initializePromise;return rm.info(this.ctx,`Initialization completed in ${r.elapsed()}ms`,{outOfSyncFileCount:n.outOfSyncFileCount,newFileCount:n.newFileCount,deletedFileCount:n.deletedFileCount,initTime:n.initTime,dbPath:this.getDbPath()}),n}async searchWorkspace(r,n,o){let s=new zue.StopWatch;rm.info(this.ctx,"Starting workspace search",{rawQuery:r.rawQuery,maxResults:PA(n)});try{if(await this.initialize(),this._isDisposed)throw f0.sendTfidfFailure(this.ctx,"disposed"),new Error("TfidfChunkSearch has been disposed");let c={maxResults:PA(n),maxSpread:Yxe},l=await r.resolveQuery(o),u=new zue.StopWatch,d=await this._tfIdfWorker.value.proxy.search(l,c),f=u.elapsed();rm.info(this.ctx,`TF-IDF search completed in ${f}ms`,{chunksFound:d.chunks.length,searchTelemetry:d.telemetry}),Hh(o);let h=await this.applyEmbeddingReranking(l,d.chunks,PA(n),o),m=h.chunks.length,A=new Set(h.chunks.map(_=>_.chunk.file)).size,y=this._workspaceFileIndex.fileCount,E=s.elapsed();return rm.info(this.ctx,`Search with reranking completed successfully in ${E}ms`,{totalTime:E,finalChunkCount:m,uniqueFileCount:A,rerankTime:h.telemetry.rerankTime}),f0.sendTfidfSuccess(this.ctx,E,f,h.telemetry.rerankTime,m,A,d.chunks.length,y,fE.Aggregate),{chunks:h.chunks}}catch(c){throw rm.error(this.ctx,"TF-IDF search failed",c),f0.sendTfidfFailure(this.ctx,c),c}}async searchFiles(r,n,o,s){let c=new zue.StopWatch;if(rm.info(this.ctx,"Starting file-scoped search",{query:r.rawQuery,fileCount:o.length,files:o}),!o.length)return rm.info(this.ctx,"No files to search, returning empty results"),{chunks:[]};if(await this.initializeFiles(o),this._isDisposed)throw new Error("TfidfChunkSearch has been disposed");let l={maxResults:PA(n),maxSpread:Yxe},u=await r.resolveQuery(s),d=await this._tfIdfWorker.value.proxy.search(u,l),f=new Set(o),h=d.chunks.filter(v=>f.has(v.file));rm.info(this.ctx,"Chunks filtered by file scope",{beforeFilter:d.chunks.length,afterFilter:h.length});let m=c.elapsed(),g=await this.applyEmbeddingReranking(u,h,PA(n),s),A=g.chunks.length,E=new Set(g.chunks.map(v=>v.chunk.file)).size,_=c.elapsed();return rm.info(this.ctx,`File-scoped search completed in ${_}ms`,{finalChunkCount:A,searchTelemetry:d.telemetry,rerankTime:g.telemetry.rerankTime}),f0.sendTfidfSuccess(this.ctx,_,m,g.telemetry.rerankTime,A,E,h.length,o.length,fE.Remote),{chunks:g.chunks}}async applyEmbeddingReranking(r,n,o,s){let c=new zue.StopWatch,l=[];if(rm.info(this.ctx,"Starting embedding reranking",{chunkCount:n.length,maxResults:o}),n.length>0){let u=s?void 0:new Fn.CancellationTokenSource,d=s??u.token,f=5e3;try{let h=this._embeddingReranker.rerankChunks(r,n,o,d),m=await(0,nXe.raceTimeout)(h,f,()=>{rm.warn(this.ctx,"Embedding reranking timed out, falling back to TF-IDF results"),u?.cancel()});m&&m.length>0?(l=m,rm.info(this.ctx,`Reranking completed in ${c.elapsed()}ms`,{rerankedCount:m.length})):(rm.warn(this.ctx,"Reranking returned no results, falling back to TF-IDF results"),l=n.slice(0,o).map(g=>({chunk:g,distance:void 0})))}catch(h){rm.error(this.ctx,"Error during embedding reranking, falling back to TF-IDF results:",h),l=n.slice(0,o).map(m=>({chunk:m,distance:void 0}))}}else rm.info(this.ctx,"No chunks to rerank");return{chunks:l,telemetry:{rerankTime:c.elapsed()}}}async initializeWorkspace(){if(await this._workspaceFileIndex.initialize(),this._isDisposed)throw new Error("TfidfChunkSearch disposed during initialization");let r=Array.from(this._workspaceFileIndex.values()),n=r;r.length>this._maxFileCount&&(n=r.slice(0,this._maxFileCount),rm.warn(this.ctx,`Workspace has too many files, limiting indexing from ${r.length} to ${this._maxFileCount}`)),rm.info(this.ctx,"Preparing files for indexing",{totalFiles:r.length,filesToIndex:n.length,maxFileCount:this._maxFileCount});let o=new nXe.Limiter(gXo),s=await Promise.all(n.map(c=>o.queue(async()=>({uri:c.uri,contentId:await c.getFastContentVersionId()}))));return await this._tfIdfWorker.value.proxy.initialize(s)}async getFastContentVersionId(r){let n=await this.ctx.get(Qo).stat(r);return`${n.size}-${n.mtime}`}async initializeFiles(r){let n=new Set(r),o=Array.from(this._workspaceFileIndex.values()).filter(s=>n.has(s.uri)).map(s=>s.uri);o.length&&await this._tfIdfWorker.value.proxy.addOrUpdate(o)}registerFileWatchers(){let r=[],n=this._workspaceFileIndex.onDidCreateFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.addOrUpdate(c).catch(l=>{console.error("Error handling file create event:",l)})});r.push(n);let o=this._workspaceFileIndex.onDidChangeFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.addOrUpdate(c).catch(l=>{console.error("Error handling file change event:",l)})});r.push(o);let s=this._workspaceFileIndex.onDidDeleteFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.delete(c).catch(l=>{console.error("Error handling file delete event:",l)})});return r.push(s),{dispose:a(()=>{r.forEach(c=>c.dispose())},"dispose")}}getDbPath(){if(this._customDbPath)return this._customDbPath;let r=$Ze(this._workspaceFileIndex);return tXe.join(r,"local-index.db")}firstExistingPath(r){for(let n of r)if((0,lxn.existsSync)(n))return n}};p();p();p();var qGt=class{constructor(){this._value="";this._pos=0}static{a(this,"StringIterator")}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;r--,this._valueLen--){let n=this._value.charCodeAt(r);if(!(n===47||this._splitOnBackslash&&n===92))break}return this.next()}hasNext(){return this._to!1,r=()=>!1){return new t(new HGt(e,r))}static forPaths(e=!1){return new t(new iXe(void 0,!e))}static forStrings(){return new t(new qGt)}static forConfigKeys(){return new t(new jGt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,r){if(r){let n=r.slice(0);UUt(n);for(let o of n)this.set(o,e)}else{let n=e.slice(0);UUt(n);for(let o of n)this.set(o[0],o[1])}}set(e,r){let n=this._iter.reset(e),o;this._root||(this._root=new Yue,this._root.segment=n.value());let s=[];for(o=this._root;;){let l=n.cmp(o.segment);if(l>0)o.left||(o.left=new Yue,o.left.segment=n.value()),s.push([-1,o]),o=o.left;else if(l<0)o.right||(o.right=new Yue,o.right.segment=n.value()),s.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new Yue,o.mid.segment=n.value()),s.push([0,o]),o=o.mid;else break}let c=sF.unwrap(o.value);o.value=sF.wrap(r),o.key=e;for(let l=s.length-1;l>=0;l--){let u=s[l][1];u.updateHeight();let d=u.balanceFactor();if(d<-1||d>1){let f=s[l][0],h=s[l+1][0];if(f===1&&h===1)s[l][1]=u.rotateLeft();else if(f===-1&&h===-1)s[l][1]=u.rotateRight();else if(f===1&&h===-1)u.right=s[l+1][1]=s[l+1][1].rotateRight(),s[l][1]=u.rotateLeft();else if(f===-1&&h===1)u.left=s[l+1][1]=s[l+1][1].rotateLeft(),s[l][1]=u.rotateRight();else throw new Error;if(l>0)switch(s[l-1][0]){case-1:s[l-1][1].left=s[l][1];break;case 1:s[l-1][1].right=s[l][1];break;case 0:s[l-1][1].mid=s[l][1];break}else this._root=s[0][1]}}return c}get(e){return sF.unwrap(this._getNode(e)?.value)}_getNode(e){let r=this._iter.reset(e),n=this._root;for(;n;){let o=r.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(r.hasNext())r.next(),n=n.mid;else break}return n}has(e){let r=this._getNode(e);return!(r?.value===void 0&&r?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,r){let n=this._iter.reset(e),o=[],s=this._root;for(;s;){let c=n.cmp(s.segment);if(c>0)o.push([-1,s]),s=s.left;else if(c<0)o.push([1,s]),s=s.right;else if(n.hasNext())n.next(),o.push([0,s]),s=s.mid;else break}if(s){if(r?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){let c=[[1,s]],l=this._min(s.right,c);if(l.key){s.key=l.key,s.value=l.value,s.segment=l.segment;let u=l.right;if(c.length>1){let[f,h]=c[c.length-1];switch(f){case-1:h.left=u;break;case 0:UK(!1);case 1:UK(!1)}}else s.right=u;let d=this._balanceByStack(c);if(o.length>0){let[f,h]=o[o.length-1];switch(f){case-1:h.left=d;break;case 0:h.mid=d;break;case 1:h.right=d;break}}else this._root=d}}else{let c=s.left??s.right;if(o.length>0){let[l,u]=o[o.length-1];switch(l){case-1:u.left=c;break;case 0:u.mid=c;break;case 1:u.right=c;break}}else this._root=c}this._root=this._balanceByStack(o)??this._root}}_min(e,r){for(;e.left;)r.push([-1,e]),e=e.left;return e}_balanceByStack(e){for(let r=e.length-1;r>=0;r--){let n=e[r][1];n.updateHeight();let o=n.balanceFactor();if(o>1?(n.right.balanceFactor()>=0||(n.right=n.right.rotateRight()),e[r][1]=n.rotateLeft()):o<-1&&(n.left.balanceFactor()<=0||(n.left=n.left.rotateLeft()),e[r][1]=n.rotateRight()),r>0)switch(e[r-1][0]){case-1:e[r-1][1].left=e[r][1];break;case 1:e[r-1][1].right=e[r][1];break;case 0:e[r-1][1].mid=e[r][1];break}else return e[0][1]}}findSubstr(e){let r=this._iter.reset(e),n=this._root,o;for(;n;){let s=r.cmp(n.segment);if(s>0)n=n.left;else if(s<0)n=n.right;else if(r.hasNext())r.next(),o=sF.unwrap(n.value)||o,n=n.mid;else break}return n&&sF.unwrap(n.value)||o}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,r){let n=this._iter.reset(e),o=this._root;for(;o;){let s=n.cmp(o.segment);if(s>0)o=o.left;else if(s<0)o=o.right;else if(n.hasNext())n.next(),o=o.mid;else return o.mid?this._entries(o.mid):r?sF.unwrap(o.value):void 0}}hasElementOrSubtree(e){return this._findSuperstrOrElement(e,!0)!==void 0}forEach(e){for(let[r,n]of this)e(n,r)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){let r=[];return this._dfsEntries(e,r),r[Symbol.iterator]()}_dfsEntries(e,r){e&&(e.left&&this._dfsEntries(e.left,r),e.value!==void 0&&r.push([e.key,sF.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,r),e.right&&this._dfsEntries(e.right,r))}_isBalanced(){let e=a(r=>{if(!r)return!0;let n=r.balanceFactor();return n<-1||n>1?!1:e(r.left)&&e(r.right)},"nodeIsBalanced");return e(this._root)}};var uxn=de(nl()),dxn=de(require("fs")),fxn=de(ri());var AXo=1.5*1024*1024,GGt=class{constructor(e){this._uri=e;this._isDisposed=!1;this._disposedCts=new fxn.CancellationTokenSource}static{a(this,"FileRepresentation")}dispose(){this._isDisposed=!0,this._disposedCts.cancel(),this._disposedCts.dispose()}get uri(){return this._uri}async getFastContentVersionId(){let e=await this.getStats();return`${e.size}-${e.mtime}`}},sXe=class extends GGt{constructor(r,n,o){super(r);this._ctx=o;this._fileReadLimiter=n}static{a(this,"FsFileRepresentation")}isDirty(){return!1}async getStats(){let r=await this._ctx.get(Qo).stat(this.uri.toString());return{size:r.size,mtime:r.mtime}}async getText(){try{let r=await this._readFile();if(!r||this._isDisposed)return"";let o=new TextDecoder().decode(r.data);return(await this._ctx.get(nc).evaluate(this.uri,o)).isBlocked?"":o}catch{return""}}async _readFile(){try{let r=un(this.uri);return await this._fileReadLimiter.queue(async()=>({data:await(0,uxn.raceCancellationError)(yXo(r,AXo),this._disposedCts.token)}))}catch{return}}};async function yXo(t,e){return new Promise((r,n)=>{let o=dxn.createReadStream(t,{start:0,end:e-1}),s=[],c=0;o.on("data",l=>(c+=l.length,s.push(l))),o.on("end",()=>r(Buffer.concat(s))),o.on("error",n)})}a(yXo,"readLocalTextFileUsingReadStream");var aXe=class{constructor(e,r,n){this.ctx=e;this.workspaceFolder=r;this.limiter=n;this._fsFileTree=new $Gt;this._onDidCreateFiles=new Wi;this.onDidCreateFiles=this._onDidCreateFiles.event;this._onDidChangeFiles=new Wi;this.onDidChangeFiles=this._onDidChangeFiles.event;this._onDidDeleteFiles=new Wi;this.onDidDeleteFiles=this._onDidDeleteFiles.event}static{a(this,"WorkspaceFileIndex")}get fileCount(){return this._fsFileTree.fileCount}*values(){yield*this._fsFileTree.values()}get(e){let r=rs(e);return r?this._fsFileTree.get(r):void 0}tryLoad(e){throw new Error("Method not implemented.")}tryRead(e){throw new Error("Method not implemented.")}createOrUpdateFsEntry(e){let r=this._fsFileTree.get(e);r&&r.dispose();let n=new sXe(e,this.limiter,this.ctx);return this._fsFileTree.addFile(e,n),n}async initialize(){return this._initializePromise??=(async()=>{let e=await this.ctx.get(zx).getWatchedFileUris(this.workspaceFolder),r=this.ctx.get(nc);(r.enabled?(await Promise.all(e.map(async o=>(await r.evaluate(o.uri,"")).isBlocked?void 0:o))).filter(o=>o!==void 0):e).forEach(o=>{let s=rs(o.uri);s&&this._fsFileTree.addFile(s,new sXe(o.uri,this.limiter,this.ctx))})})(),this._initializePromise}async didChangeFiles(e){if(e.type==="create"){let r=[];for(let n of e.documents){if(await this.statFileType(n.uri)!==1)continue;let s=n.uri;this._fsFileTree.get(s)||(this.createOrUpdateFsEntry(s),r.push(s))}r.length&&this._onDidCreateFiles.fire(r)}else if(e.type==="update"){let r=[];for(let n of e.documents){if(await this.statFileType(n.uri)!==1)continue;let s=n.uri;this.createOrUpdateFsEntry(s),r.push(s)}r.length&&this._onDidChangeFiles.fire(r)}else if(e.type==="delete"){let r=[];for(let n of e.documents){let o=n.uri,s=this._fsFileTree.get(o);if(s)s.dispose(),this._fsFileTree.delete(o),r.push(o);else{let c=this._fsFileTree.deleteFolder(o);c.length&&r.push(...c)}}r.length&&this._onDidDeleteFiles.fire(r)}}async statFileType(e){try{return(await this.ctx.get(Qo).stat(e)).type}catch{return}}},$Gt=class{constructor(){this._tree=oXe.forPaths();this._fileCount=0}static{a(this,"SimpleFsTree")}get fileCount(){return this._fileCount}get(e){return this._tree.get(e)}addFile(e,r){this._tree.get(e)||this._fileCount++,this._tree.set(e,r)}clear(){this._tree.clear()}delete(e){let r=!!this.get(e);return this._tree.delete(e),r&&(this._fileCount=Math.max(0,this._fileCount-1)),r}deleteFolder(e){let r=[];for(let[n]of this._tree.findSuperstr(e)??[])r.push(n);for(let n of r)this._tree.delete(n);return this._fileCount=Math.max(0,this._fileCount-r.length),r}*values(){for(let[,e]of this.entries())yield e}entries(){return this._tree}};var pxn=de(nl());var cXe=class extends HQ{constructor(r){super();this.ctx=r;this.workspaceFileIndexes=new Map;this._onDidWorkspaceAdded=new Wi;this.onDidWorkspaceAdded=this._onDidWorkspaceAdded.event;this._onDidWorkspaceRemoved=new Wi;this.onDidWorkspaceRemoved=this._onDidWorkspaceRemoved.event;this.ctx.get(US).addListener(this),this._fileReadLimiter=new pxn.Limiter(20)}static{a(this,"WorkspaceFileWatcher")}isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}async didAddWorkspace(r){if(!await this.isEnabled())return;let n=new aXe(this.ctx,r,this._fileReadLimiter);this.workspaceFileIndexes.set(r.uri,n),this._onDidWorkspaceAdded.fire(n)}async didRemoveWorkspace(r){if(!await this.isEnabled())return;let n=this.workspaceFileIndexes.get(r.uri);if(n){for(let o of n.values())o.dispose();this._onDidWorkspaceRemoved.fire(n),this.workspaceFileIndexes.delete(r.uri)}}async didChangeFiles(r){if(!await this.isEnabled())return;let n=this.workspaceFileIndexes.get(r.workspaceFolder.uri);n&&await n.didChangeFiles(r)}};var Pwe=de(uw()),hxn=de(Sl()),dw=de(nl()),Uq=de(FO());var il=new fe("Semantic Search"),t2=class{constructor(e){this._ctx=e;this._availableEmbeddingTypes=new GZe(e),this.tryInit()}static{a(this,"WorkspaceChunkSearchService")}dispose(){this._impl?.dispose()}async tryInit(){if(this._impl)return this._impl;let e=await this._availableEmbeddingTypes.getPreferredType();if(e)return this._impl=new VGt(this._ctx,e),this._impl}async searchWorkspace(e,r,n){let o=await this.tryInit();if(!o)throw new Error("Workspace chunk search service not available");return await o.searchWorkspace(e,r,n)}},VGt=class{constructor(e,r){this._ctx=e;this._embeddingType=r;this._localEmbeddingsByWorkspace=new Map;this._localTfidfByWorkspace=new Map;this._diffTrackersByWorkspace=new Map;this._workspaceFileIndexes=new Map;let n=new cXe(this._ctx),o=new mZe(this._ctx);this._localDiffSearch=new ZZe(this._localEmbeddingsByWorkspace,this._localTfidfByWorkspace,this._workspaceFileIndexes,this._diffTrackersByWorkspace),this._githubCodeSearchService=new pZe(this._ctx),this._codeSearchChunkSearch=new gZe(this._ctx,this._embeddingType,this._localDiffSearch,this._githubCodeSearchService),n.onDidWorkspaceAdded(s=>{this._workspaceFileIndexes.set(s.workspaceFolder.uri,s);let c=new WZe(this._ctx,s,this._embeddingType,o);this._localEmbeddingsByWorkspace.set(s.workspaceFolder.uri,c);let l=new rXe(this._ctx,s,{embeddingType:this._embeddingType});this._localTfidfByWorkspace.set(s.workspaceFolder.uri,l);let u=new HZe(this._ctx,s,this._githubCodeSearchService);this._diffTrackersByWorkspace.set(s.workspaceFolder.uri,u),process.env.GITHUB_COPILOT_SIMULATION!=="1"&&!IP(this._ctx)&&(u.initialize(),c.triggerLocalIndexing(),l.initialize())}),n.onDidWorkspaceRemoved(s=>{let c=s.workspaceFolder.uri,l=this._diffTrackersByWorkspace.get(c);l&&(l.dispose(),this._diffTrackersByWorkspace.delete(c));let u=this._localTfidfByWorkspace.get(c);u&&(u.dispose(),this._localTfidfByWorkspace.delete(c));let d=this._localEmbeddingsByWorkspace.get(c);d&&(d.dispose(),this._localEmbeddingsByWorkspace.delete(c))})}static{a(this,"WorkspaceChunkSearchServiceImpl")}dispose(){this._githubCodeSearchService.dispose();for(let e of this._localTfidfByWorkspace.values())e.dispose();this._localTfidfByWorkspace.clear();for(let e of this._localEmbeddingsByWorkspace.values())e.dispose();this._localEmbeddingsByWorkspace.clear();for(let e of this._diffTrackersByWorkspace.values())e.dispose();this._diffTrackersByWorkspace.clear(),this._workspaceFileIndexes.clear()}async searchWorkspace(e,r,n){let o=new Uq.StopWatch,s=await this.resolveQueryText(e,n);il.info(this._ctx,"Starting semantic search",{resolvedQuery:s,maxResults:PA(r),tokenBudget:r.tokenBudget,workspaceFolders:r.workspaceFolders});let c=this.toQueryWithEmbeddings(e,s),l=await this.doSearchFileChunks(c,r,n);if(l.isError())throw il.error(this._ctx,"Semantic search failed",l.err),f0.sendAggregateFailure(this._ctx,l.err),new Error(`Workspace chunk search failed: ${l.err.errorDiagMessage}`);il.info(this._ctx,`Search strategy '${l.val.strategy}' returned results`,{strategy:l.val.strategy,chunkCount:l.val.result.chunks.length});let u=await(0,dw.raceCancellationError)(this.filterIgnoredChunks(l.val.result.chunks),n);il.info(this._ctx,"Chunks filtered",{beforeFilter:l.val.result.chunks.length,afterFilter:u.length});let d=await this.rerankChunks(c,u,PA(r),n),f=d.length,m=new Set(d.map(A=>A.chunk.file)).size,g=o.elapsed();return il.info(this._ctx,`Search completed successfully in ${o.elapsed()}ms`,{totalTime:o.elapsed(),strategy:l.val.strategy,finalChunkCount:f,uniqueFileCount:m}),f0.sendAggregateSuccess(this._ctx,l.val.strategy,g,f,m,r.workspaceFolders.length,r.source),{chunks:d}}toQueryWithEmbeddings(e,r){let n;return{...e,resolveQueryEmbeddings:a(o=>(n??=this.computeQueryEmbedding(e,o,r),n),"resolveQueryEmbeddings")}}async computeQueryEmbedding(e,r,n){Hh(r);let o=n??await this.resolveQueryText(e,r),s=await this.getEmbeddingComputer().computeEmbeddings(this._embeddingType,[o],{inputType:"query"},r);if(!s?.values.length)throw new Error("Failed to compute query embeddings");return s.values[0]}async resolveQueryText(e,r){try{return await e.resolveQuery(r)}catch(n){if(xP(n))throw n;return il.debug(this._ctx,"Falling back to raw query text",n),e.rawQuery}}getEmbeddingComputer(){return this._embeddingComputer||(this._embeddingComputer=new $ue(this._ctx)),this._embeddingComputer}async doSearchFileChunks(e,r,n){il.info(this._ctx,"Starting semantic search with fallback strategy");let o=process.env.GITHUB_COPILOT_SIMULATION==="1"?1e6:12500;return this.runSearchStrategyWithFallback(this._codeSearchChunkSearch,()=>(0,dw.createCancelablePromise)(s=>this.doSearchFileChunksLocally(e,r,s)),o,e,r,n)}async runSearchStrategyWithFallback(e,r,n,o,s,c){let l=new Uq.StopWatch;il.info(this._ctx,`Attempting primary strategy '${e.id}'`,{timeout:n});let u=(0,dw.createCancelablePromise)(g=>this.runSearchStrategy(e,o,s,g));c.onCancellationRequested(()=>u.cancel());let d=await(0,dw.raceCancellationError)((0,dw.raceTimeout)(u,n),c);if(d?.isOk())return il.info(this._ctx,`Primary strategy '${e.id}' succeeded in ${l.elapsed()}ms`,{strategy:e.id,elapsedTime:l.elapsed()}),d;il.warn(this._ctx,`Primary strategy '${e.id}' failed or timed out, falling back to local search`,{elapsedTime:l.elapsed(),isTimeout:d===void 0,error:d?.isError()?d.err:void 0});let f=r();c.onCancellationRequested(()=>f.cancel()),f.then(()=>u.cancel(),()=>u.cancel());let h=new Uq.StopWatch,m=await JZe([u,f]);return il.info(this._ctx,`Search operation completed in ${l.elapsed()}ms (fallback took ${h.elapsed()}ms)`,{totalTime:l.elapsed(),fallbackTime:h.elapsed(),success:m.isOk()}),m}async doSearchFileChunksLocally(e,r,n){il.info(this._ctx,"Starting local file chunk search",{folderCount:r.workspaceFolders.length});let o=[],s=new Set;for(let l of r.workspaceFolders){let u=this._localEmbeddingsByWorkspace.get(l),d=this._localTfidfByWorkspace.get(l);if(u&&d){il.info(this._ctx,`Both strategies available for folder: ${l}, using embeddings with TF-IDF fallback`);let f=8e3,h=new Uq.StopWatch,m=await this.runSearchStrategyWithFallback(u,()=>(0,dw.createCancelablePromise)(g=>this.runSearchStrategy(d,e,r,g)),f,e,r,n);m.isOk()&&(o.push(...m.val.result.chunks),s.add(m.val.strategy),il.info(this._ctx,`Folder search completed in ${h.elapsed()}ms`,{folder:l,strategy:m.val.strategy,chunkCount:m.val.result.chunks.length,elapsedTime:h.elapsed()}))}else if(u){il.info(this._ctx,`Using embeddings search for folder: ${l}`);let f=new Uq.StopWatch,h=await this.runSearchStrategy(u,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(u.id),il.info(this._ctx,`Embeddings search completed in ${f.elapsed()}ms`,{folder:l,chunkCount:h.isOk()?h.val.result.chunks.length:0,elapsedTime:f.elapsed()})}else if(d){il.info(this._ctx,`Using TF-IDF search for folder: ${l}`);let f=new Uq.StopWatch,h=await this.runSearchStrategy(d,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(d.id),il.info(this._ctx,`TF-IDF search completed in ${f.elapsed()}ms`,{folder:l,chunkCount:h.isOk()?h.val.result.chunks.length:0,elapsedTime:f.elapsed()})}else il.warn(this._ctx,`No local search strategy available for folder: ${l}`)}let c=s.size===1?s.values().next().value:"mixed";return il.info(this._ctx,"Local search completed",{strategy:c,totalChunkCount:o.length,strategiesUsed:Array.from(s)}),Pwe.Result.ok({strategy:c,result:{chunks:o}})}async runSearchStrategy(e,r,n,o){let s=new Uq.StopWatch;il.info(this._ctx,`Running search strategy '${e.id}'`);try{let c=await(0,dw.raceCancellationError)(e.searchWorkspace(r,n,o),o);return c?(il.info(this._ctx,`Strategy '${e.id}' completed successfully in ${s.elapsed()}ms`,{strategy:e.id,chunkCount:c.chunks.length,elapsedTime:s.elapsed()}),Pwe.Result.ok({strategy:e.id,result:c})):(il.warn(this._ctx,`Strategy '${e.id}' returned no result`,{strategy:e.id,elapsedTime:s.elapsed()}),Pwe.Result.error({errorDiagMessage:`${e.id}: no result`}))}catch(c){if(xP(c))throw il.info(this._ctx,`Strategy '${e.id}' was cancelled`,{elapsedTime:s.elapsed()}),c;return il.error(this._ctx,c,`Error during '${e.id}' search, elapsed: ${s.elapsed()}ms`),Pwe.Result.error({errorDiagMessage:`${e.id} error: ${String(c)}`})}}async filterIgnoredChunks(e){return(0,hxn.coalesce)(await Promise.all(e.map(async r=>(await this._ctx.get(nc).evaluate(r.chunk.file,r.chunk.text)).isBlocked?null:r)))}async rerankChunks(e,r,n,o){if(!r.length)return[];try{let s,c=r.at(0)?.distance?.embeddingType;if(c&&r.every(f=>typeof f.distance<"u"&&f.distance.embeddingType.equals(c)))s=[...r].sort((f,h)=>h.distance.value-f.distance.value);else{let h=r.map((A,y)=>({...A.chunk,distance:A.distance,index:y})).filter(A=>typeof A.distance>"u"||!A.distance.embeddingType.equals(this._embeddingType)),m;if(h.length){il.debug(this._ctx,`WorkspaceChunkSearch.rerankChunks. Scoring ${h.length} new chunks`);let A=this.scoreChunks(e,h,o);m=await(0,dw.raceCancellationError)(A,o)}let g=[];for(let A=0;AA?.distance?.embeddingType.equals(this._embeddingType)).sort((A,y)=>y.distance.value-A.distance.value)}if(!s.length)return s;s=s.slice(0,n);let u=s[0].distance.value*Yxe,d=s.filter(f=>f.distance.value>=u);return il.debug(this._ctx,`Eagerly filtered out ${s.length-d.length} chunks due to low quality`),d}catch(s){return xP(s)||il.error(this._ctx,"Failed to search chunk embeddings index"),r.slice(0,n)}}async scoreChunks(e,r,n){if(!r.length)return[];let o=r.map(l=>this.chunkToIndexString(l)),[s,c]=await(0,dw.raceCancellationError)(Promise.all([e.resolveQueryEmbeddings(n),this.computeEmbeddings("document",o,n)]),n);return c.values.map((l,u)=>({chunk:r[u],distance:Kxe(s,l)}))}async computeEmbeddings(e,r,n){let o=await this.getEmbeddingComputer().computeEmbeddings(this._embeddingType,r,{inputType:e},n);if(!o)throw new Error("Failed to compute embeddings");return o}chunkToIndexString(e){return this.toStringForEmbeddingsComputer(e,rs(e.file)??e.file)}toStringForEmbeddingsComputer(e,r){let n=DA(e.text);return`File: \`${r}\` + `);let l=c.prepare("SELECT version, embeddingModel FROM CacheMeta LIMIT 1").get();(!l||l.version!==this.version||l.embeddingModel!==r.id)&&c.exec("DELETE FROM CacheMeta; DELETE FROM Files; DELETE FROM FileChunks;"),c.exec("DELETE FROM CacheMeta;"),c.prepare("INSERT INTO CacheMeta (version, embeddingModel) VALUES (?, ?)").run(this.version,r.id),await o.initialize();let u=c.prepare("SELECT id, uri FROM Files");try{c.exec("BEGIN TRANSACTION");for(let d of u.all()){let f=d;try{if(o.get(f.uri))continue}catch{}c.prepare("DELETE FROM Files WHERE id = ?").run(f.id)}}finally{c.exec("COMMIT")}return new t(r,c)}dispose(){this.db.close()}async isIndexed(e){return(await this.getEntry(e))?.state==="resolved"}async get(e){return(await this.getEntry(e))?.value}getCurrentChunksForUri(e){let r=eo(e),n=this._inMemory.get(r);if(n?.state==="pending"||n?.state==="rejected")return;let o=this.db.prepare("SELECT fc.text, fc.range_startLineNumber, fc.range_startColumn, fc.range_endLineNumber, fc.range_endColumn, fc.embedding, fc.chunkHash FROM Files f JOIN FileChunks fc ON f.id = fc.fileId WHERE f.uri = ?").all(e.toString());if(o.length>0){let s=new Map;for(let c of o){let l=v$t(this.embeddingType,c.embedding),u={chunk:{file:e.toString(),text:c.text,rawText:void 0,range:new b$t.Range(c.range_startLineNumber,c.range_startColumn,c.range_endLineNumber,c.range_endColumn)},embedding:l,chunkHash:c.chunkHash};u.chunkHash&&s.set(u.chunkHash,u)}return s}}async getEntry(e){let r=eo(e.uri),n=this._inMemory.get(r),o=await e.getFastContentVersionId();if(n?.contentVersionId===o)return n;let s=this.db.prepare("SELECT id, contentVersionId FROM Files WHERE uri = ?").get(e.uri.toString());if(!s||s.contentVersionId!==o)return;let c=this.db.prepare("SELECT text, range_startLineNumber, range_startColumn, range_endLineNumber, range_endColumn, embedding, chunkHash FROM FileChunks WHERE fileId = ?").all(s.id);return{state:"resolved",contentVersionId:s.contentVersionId,fileHash:void 0,value:c.map(l=>({chunk:{file:e.uri.toString(),text:l.text,rawText:void 0,range:new b$t.Range(l.range_startLineNumber,l.range_startColumn,l.range_endLineNumber,l.range_endColumn)},embedding:v$t(this.embeddingType,l.embedding),chunkHash:l.chunkHash}))}}async update(e,r){let n=eo(e.uri),o=this._inMemory.get(n),s=await e.getFastContentVersionId();if(o?.contentVersionId===s)return o.value;let c=await this.getEntry(e);if(c?.contentVersionId===s)return c.value;o?.state==="pending"&&o.value.cancel();let l=(0,vwn.createCancelablePromise)(r),u={contentVersionId:s,fileHash:void 0,state:"pending",value:l};return this._inMemory.set(n,u),await l.then(d=>({contentVersionId:s,fileHash:void 0,state:Array.isArray(d)?"resolved":"rejected",value:d}),()=>({contentVersionId:s,fileHash:void 0,state:"rejected",value:void 0})).then(d=>{let f=this._inMemory.get(n);if(u===f)if(d.state==="rejected")this._inMemory.set(n,d),this.db.prepare("DELETE FROM Files WHERE uri = ?").run(n.toString());else{this._inMemory.delete(n);let h=this.db.prepare("INSERT OR REPLACE INTO Files (uri, contentVersionId) VALUES (?, ?)").run(e.uri.toString(),s);try{let m=this.db.prepare("INSERT INTO FileChunks (fileId, text, range_startLineNumber, range_startColumn, range_endLineNumber, range_endColumn, embedding, chunkHash) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");this.db.exec("BEGIN TRANSACTION");for(let g of d.value??[])m.run(h.lastInsertRowid,g.chunk.text,g.chunk.range.startLineNumber,g.chunk.range.startColumn,g.chunk.range.endLineNumber,g.chunk.range.endColumn,_wn(g.embedding),g.chunkHash??"")}finally{this.db.exec("COMMIT")}}}),l}};var Twn=fe(Sl()),$we=fe(nl()),Iwn=fe(cF());var _Xe=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._workspaceFileIndex=n;this._chunkingEndpointClient=o;this._cache=new Iwn.Lazy(async()=>(this._cacheRoot=EXe(this._workspaceFileIndex),await Swn(this.ctx,this._embeddingType,this._cacheRoot,this._workspaceFileIndex)))}static{a(this,"WorkspaceChunkEmbeddingsIndex")}dispose(){this._cache.hasValue&&this._cache.value.then(e=>e.dispose())}async getIndexState(){if(!this._cache.hasValue)return;let e=await this._cache.value,r=Array.from(this._workspaceFileIndex.values()),n=0;return await Promise.all(r.map(async o=>{await e.isIndexed(o)&&n++})),{totalFileCount:r.length,indexedFileCount:n}}get fileCount(){return this._workspaceFileIndex.fileCount}async triggerIndexingOfWorkspace(e,r){let n=Array.from(this._workspaceFileIndex.values());await Promise.all(n.map(o=>this.triggerIndexingOfFile(o.uri,e,r)))}async triggerIndexingOfFile(e,r,n){let o=this._workspaceFileIndex.get(e);o&&await this.getChunksAndEmbeddings(r,o,new Gwe,"Batch",n)}async searchWorkspace(e,r,n,o){let[s,c]=await(0,$we.raceCancellationError)(Promise.all([r,this.getAllWorkspaceEmbeddings(e,o)]),o);return this.rankEmbeddings(s,c,n)}async searchSubsetOfFiles(e,r,n,o,s){if(!r.length)return[];let[c,l]=await(0,$we.raceCancellationError)(Promise.all([n,this.getEmbeddingsForFiles(e,r,s)]),s);return this.rankEmbeddings(c,l,o)}rankEmbeddings(e,r,n){return j1n(e,r.map(o=>[o.chunk,o.embedding]),n).map(o=>({chunk:o.value,distance:o.distance}))}async getAllWorkspaceEmbeddings(e,r){let o=Array.from(this._workspaceFileIndex.values()).map(s=>s.uri);return this.getEmbeddingsForFiles(e,o,r)}async getEmbeddingsForFiles(e,r,n){let o=new Gwe,s=await Promise.all(r.map(async c=>{let l=this._workspaceFileIndex.get(c);if(l)return await this.getChunksAndEmbeddings(e,l,o,"Batch",n)}));return(0,Twn.coalesce)(s).flat()}async getChunksAndEmbeddings(e,r,n,o,s){let c=await(0,$we.raceCancellationError)(this._cache.value,s),l=await(0,$we.raceCancellationError)(c.get(r),s);if(l)return l;let u=c.getCurrentChunksForUri(r.uri);return await c.update(r,async f=>this._chunkingEndpointClient.computeChunksAndEmbeddings(e,this._embeddingType,r,n,o,u,f))}};var xwn=fe(nl()),wwn=fe(r2()),ide=fe(GO());var BA=new pe("Embeddings Search"),vXe=class t{constructor(e,r,n,o){this._ctx=e;this._workspaceFileIndex=r;this.embeddingType=n;this.chunkingEndpointClient=o;this.id="embeddings";this._state="unknown";this._disposeCts=new Fn.CancellationTokenSource;this._reindexRequests=new wwn.ResourceMap}static{a(this,"EmbeddingsChunkSearch")}static{this.defaultAutomaticIndexingFileCap=750}dispose(){this._disposeCts.cancel(),this._disposeCts.dispose();for(let[,e]of this._reindexRequests)e.dispose();this._reindexRequests.clear(),this._embeddingsIndex?.dispose()}async triggerLocalIndexing(){if(BA.info(this._ctx,"Triggering local indexing..."),await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAutomaticIndexing"){BA.info(this._ctx,"Skipping automatic indexing: too many files",{fileCount:this._workspaceFileIndex.fileCount});return}await this.triggerIndexingOfWorkspace()}async searchWorkspace(e,r,n){let o=new ide.StopWatch;BA.info(this._ctx,"Starting workspace embedding search",{rawQuery:e.rawQuery,maxResults:MA(r),indexStatus:this._state});let s=await this._ctx.get(Ft).getGitHubSession();if(!s)throw BA.error(this._ctx,"No GitHub session found"),new Error("No GitHub session found in EmbeddingsChunkSearch");let c=e.resolveQueryEmbeddings(n);if(await this.doInitialIndexing(),Wh(n),(this._state==="updatingIndex"||this._state==="ready")&&this._embeddingsIndex!==void 0){let u=new ide.StopWatch,d=await this._embeddingsIndex.searchWorkspace(s,c,MA(r),n),f=u.elapsed(),h=o.elapsed(),m=d.length,A=new Set(d.map(E=>E.chunk.file)).size,y=this._workspaceFileIndex.fileCount;return BA.info(this._ctx,`Workspace search completed successfully in ${h}ms`,{totalTime:h,searchTime:f,chunkCount:m,uniqueFileCount:A,indexStatus:this._state}),m0.sendEmbeddingsSuccess(this._ctx,h,f,m,A,y,AE.Aggregate),{chunks:d}}else{BA.info(this._ctx,"Embeddings index is not ready for workspace search, skip searching.",{indexStatus:this._state}),m0.sendEmbeddingsSkipped(this._ctx,"index_not_ready");return}}async searchFiles(e,r,n,o){if(!n.length)return BA.info(this._ctx,"No files to search, returning empty results"),{chunks:[]};let s=new ide.StopWatch;BA.info(this._ctx,"Starting file subset embedding search",{rawQuery:e.rawQuery,maxResults:MA(r),fileCount:n.length});let c=await this._ctx.get(Ft).getGitHubSession();if(!c)throw BA.error(this._ctx,"No GitHub session found"),new Error("No GitHub session found in EmbeddingsChunkSearch");let l=e.resolveQueryEmbeddings(o),u=await this.initializeForFileSubset(n.length);if(!u){BA.info(this._ctx,"Too many files for subset search",{fileCount:n.length});return}Wh(o);let d=new ide.StopWatch,f=await u.searchSubsetOfFiles(c,n,l,MA(r),o),h=d.elapsed(),m=s.elapsed(),g=f.length,y=new Set(f.map(_=>_.chunk.file)).size,E=this._workspaceFileIndex.fileCount;return BA.info(this._ctx,`File subset search completed successfully in ${m}ms`,{totalTime:m,searchTime:h,chunkCount:g,uniqueFileCount:y}),m0.sendEmbeddingsSuccess(this._ctx,m,h,g,y,E,AE.Remote),{chunks:f}}async initializeForFileSubset(e){await this._workspaceFileIndex.initialize();let r=this.getAutoIndexFileCap();if(e>r){BA.info(this._ctx,`EmbeddingsChunkSearch: skipping subset search due to too many files. Found ${e} files. Max: ${r}`);return}return this.getOrCreateEmbeddingsIndex()}async initializeWorkspaceIndex(){return this._init??=(async()=>{await this._workspaceFileIndex.initialize();let e=this.checkWorkspaceIndexSizeLimits();return e?(BA.info(this._ctx,`EmbeddingsChunkSearch: skipping automatic indexing due to too many files. Found ${this._workspaceFileIndex.fileCount} files. Max: ${this.getAutoIndexFileCap()}`),this.setState(e),!0):(this.getOrCreateEmbeddingsIndex(),this.setState("ready"),!0)})(),this._init}getOrCreateEmbeddingsIndex(){return this._embeddingsIndex||(this._embeddingsIndex=new _Xe(this._ctx,this.embeddingType,this._workspaceFileIndex,this.chunkingEndpointClient),BA.info(this._ctx,`EmbeddingsChunkSearch: initializing embeddings index for ${this._workspaceFileIndex.fileCount} files.`)),this._embeddingsIndex}checkWorkspaceIndexSizeLimits(){let e=this.getAutoIndexFileCap();if(this._workspaceFileIndex.fileCount>e)return"tooManyFilesForAutomaticIndexing"}async doInitialIndexing(){return this._initialIndexing??=(async()=>{if(await this.initializeWorkspaceIndex(),!(this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing"))return this.triggerIndexingOfWorkspace(),this.registerAutomaticReindexListeners(),!0})(),this._initialIndexing}async triggerIndexingOfWorkspace(){let e=new ide.StopWatch;BA.info(this._ctx,"Starting workspace indexing...",{fileCount:this._workspaceFileIndex.fileCount}),this.setState("updatingIndex");try{let r=await this._ctx.get(Ft).getGitHubSession();if(!r)throw new Error("No GitHub session found");await this._embeddingsIndex?.triggerIndexingOfWorkspace(r,new Fn.CancellationTokenSource().token),this.setState("ready"),BA.info(this._ctx,`Workspace indexing completed in ${e.elapsed()}ms`,{status:"ready",indexingTime:e.elapsed()})}catch(r){BA.error(this._ctx,"Workspace indexing failed",r),this.setState("unknown")}}registerAutomaticReindexListeners(){this._reindexRequests.clear(),this._workspaceFileIndex.onDidCreateFiles(e=>{this.tryTriggerReindexing(e,!0)}),this._workspaceFileIndex.onDidChangeFiles(e=>this.tryTriggerReindexing(e,!0)),this._workspaceFileIndex.onDidDeleteFiles(e=>{for(let r of e){let n=eo(r);this._reindexRequests.get(n)?.dispose(),this._reindexRequests.delete(n)}})}getAutoIndexFileCap(){return t.defaultAutomaticIndexingFileCap}setState(e){this._state!==e&&(this._state=e)}tryTriggerReindexing(e,r=!1){if(this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing")return;let n=6e4;for(let o of e){let s=eo(o),c=this._reindexRequests.get(s);c||(c=new xwn.Delayer(n),this._reindexRequests.set(s,c)),c.trigger(async()=>{if(await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing")return;let l=await this._ctx.get(Ft).getGitHubSession();this._embeddingsIndex?.triggerIndexingOfFile(o,l,this._disposeCts.token)},r?0:n)}}};p();p();var Wwe=fe(yw());async function TXe(t){for(let r of t)r.then(n=>{n.isOk()&&t.forEach(o=>{o!==r&&o.cancel()})},()=>{});let e=await Promise.allSettled(t);for(let r of e)if(r.status==="fulfilled"&&r.value.isOk())return r.value;{let r=[];for(let n of e)n.status==="fulfilled"&&n.value.isError()&&r.push(n.value.err.errorDiagMessage);if(r.length)return Wwe.Result.error({errorDiagMessage:r.join(", ")})}if(e.every(r=>r.status==="rejected"&&LP(r.reason)))return Wwe.Result.error({errorDiagMessage:"cancelled"});for(let r of e)if(r.status==="rejected"&&!LP(r.reason))return Wwe.Result.error({errorDiagMessage:r.reason+""});return Wwe.Result.error({errorDiagMessage:"unknown error"})}a(TXe,"raceSearchOperations");var zwe=fe(yw()),Ywe=fe(nl());var Ats=2e3,yts=.7,Mwn=8e3,Ets=300,IXe=class{constructor(e,r,n,o){this._embeddingsByWorkspace=e;this._tfidfByWorkspace=r;this._workspaceFileIndexes=n;this._diffTrackers=o}static{a(this,"LocalDiffSearch")}getTotalFileCount(e){let r=0;for(let n of e){let o=this._workspaceFileIndexes.get(n);o&&(r+=o.fileCount)}return r}async getLocalDiff(e){let r=new Set;for(let n of e){let o=this._diffTrackers.get(n);if(o){let s=await o.getDiffFiles();if(s)for(let c of s)r.add(c)}}return Array.from(r)}shouldDoLocalDiffSearch(e,r){if(e.length===0||e.length>Ats)return!1;let n=this.getTotalFileCount(r);return!(n>0&&e.length/n>yts)}async searchLocalDiff(e,r,n,o){if(e.length===0)return zwe.Result.ok({strategy:"none",result:{chunks:[]}});let s=[],c=[];for(let u of n.workspaceFolders){let d=this._embeddingsByWorkspace.get(u),f=this._tfidfByWorkspace.get(u);d&&s.push(d),f&&c.push(f)}if(s.length===0&&c.length===0)return zwe.Result.error({errorDiagMessage:"No search instances available"});let l=a((u,d)=>(0,Ywe.createCancelablePromise)(async f=>{let h=await Promise.all(u.map(g=>g.searchFiles(r,n,[...e],f))),m=this.mergeSearchResults(h);return zwe.Result.ok({strategy:d,result:m})}),"createSearchOp");if(e.length>Ets){if(c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}return zwe.Result.error({errorDiagMessage:"Diff size too large for embeddings and no TF-IDF available"})}if(s.length>0&&c.length>0){let u=l(s,"embeddings");o.onCancellationRequested(()=>u.cancel());let d=await(0,Ywe.raceTimeout)(u,Mwn),f=d===void 0;if(d?.isOk()&&d.val.result.chunks.length>0)return d;let h=l(c,"tfidf");return o.onCancellationRequested(()=>h.cancel()),f?(h.then(()=>u.cancel(),()=>u.cancel()),await TXe([u,h])):(u.cancel(),await h)}else if(s.length>0&&c.length===0){let u=l(s,"embeddings");o.onCancellationRequested(()=>u.cancel());let d=await(0,Ywe.raceTimeout)(u,Mwn);if(d?.isOk()&&d.val.result.chunks.length>0)return d;u.cancel();return}else if(s.length===0&&c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}}mergeSearchResults(e){let r=e.filter(o=>!!o);if(r.length===0)return{chunks:[]};if(r.length===1)return{chunks:[...r[0].chunks]};let n=new Map;for(let o of r)for(let s of o.chunks){let c=s.chunk.file,l=n.get(c),u=s.distance?.value??Number.MAX_VALUE,d=l?.distance?.value??Number.MAX_VALUE;(!l||ug.text.toLowerCase()),e.toLowerCase()],u=await s.computeEmbeddings(c,l,{inputType:"document"},o);if(!u||u.values.length===0)return[];if(o.isCancellationRequested)return[];let d=u.values[u.values.length-1],f=u.values.slice(0,-1);if(!r.length||f.length!==r.length)return[];let h=f[0].type,m=f.map((g,A)=>({chunk:r[A],score:mwe(d,g).value}));return m.sort((g,A)=>A.score-g.score),m.slice(0,n).map(g=>({chunk:g.chunk,distance:{embeddingType:h,value:g.score}}))}};p();var Own=fe(require("path")),Lwn=require("worker_threads");var D$t=class{constructor(){this.nextId=1;this.handlers=new Map}static{a(this,"RpcResponseHandler")}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};function _ts(t){let e={get:a((r,n)=>{if(typeof n=="string")return r[n]||(r[n]=(...o)=>t(n,o)),r[n]},"get")};return new Proxy(Object.create(null),e)}a(_ts,"createRpcProxy");var wXe=class{constructor(e,r,n){this.responseHandler=new D$t;this.worker=new Lwn.Worker(e,r),jIe(this.worker,Own.basename(e,".js")),this.worker.on("message",o=>{"fn"in o?(async()=>{try{let s=n?.[o.fn];if(!s)throw new Error(`Unknown method: ${o.fn}`);let c=await s.apply(n,o.args);this.worker.postMessage({id:o.id,res:c})}catch(s){this.worker.postMessage({id:o.id,err:s instanceof Error?s:new Error(String(s))})}})():this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=_ts((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}static{a(this,"WorkerWithRpcProxy")}terminate(){this.worker.removeAllListeners(),this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};var PXe=fe(nl()),Bwn=fe(cF()),Fwn=fe(Ro()),ode=fe(GO()),Uwn=require("fs"),RXe=fe(require("path"));var am=new pe("Tfidf Search"),vts=100,kXe=class extends Fwn.Disposable{constructor(r,n,o){super();this.id="tfidf";this._maxFileCount=25e3;this._isDisposed=!1;this._tokenizerName="o200k_base";this._workspaceFileIndex=n,this.ctx=r,this._embeddingReranker=new xXe(r,o?.embeddingType),this._customDbPath=o?.dbPath,this._tfIdfWorker=new Bwn.Lazy(()=>{let s=this.firstExistingPath([RXe.join(__dirname,"tfidfWorker.js"),RXe.join(__dirname,"../../../../dist/tfidfWorker.js")]);if(s===void 0)throw new Error("tfidfWorker file not found");let c={tokenizer:this._tokenizerName,dbPath:this.getDbPath()},l={readFile:a(async u=>{let f=await r.get(ni).getOrReadTextDocument({uri:u});if(f.status!=="valid")throw new Error(`Could not read file ${u}: ${f.status}`);return f.document.getText()},"readFile"),getContentVersionId:a(async u=>{try{return await this.getFastContentVersionId(u)}catch(d){throw new Error(`Could not find file ${u}, error: ${String(d)}`)}},"getContentVersionId"),logWarn:a((u,...d)=>(am.warn(r,u,...d),Promise.resolve()),"logWarn"),logError:a((u,...d)=>(am.error(r,u,...d),Promise.resolve()),"logError")};return new wXe(s,{workerData:c},l)}),this._register(this.registerFileWatchers())}static{a(this,"TfidfChunkSearch")}dispose(){this._isDisposed=!0,super.dispose(),this._tfIdfWorker.hasValue&&this._tfIdfWorker.value.terminate()}async initialize(){am.info(this.ctx,"Starting initialization...");let r=new ode.StopWatch;this._initializePromise??=this.initializeWorkspace();let n=await this._initializePromise;return am.info(this.ctx,`Initialization completed in ${r.elapsed()}ms`,{outOfSyncFileCount:n.outOfSyncFileCount,newFileCount:n.newFileCount,deletedFileCount:n.deletedFileCount,initTime:n.initTime,dbPath:this.getDbPath()}),n}async searchWorkspace(r,n,o){let s=new ode.StopWatch;am.info(this.ctx,"Starting workspace search",{rawQuery:r.rawQuery,maxResults:MA(n)});try{if(await this.initialize(),this._isDisposed)throw m0.sendTfidfFailure(this.ctx,"disposed"),new Error("TfidfChunkSearch has been disposed");let c={maxResults:MA(n),maxSpread:hwe},l=await r.resolveQuery(o),u=new ode.StopWatch,d=await this._tfIdfWorker.value.proxy.search(l,c),f=u.elapsed();am.info(this.ctx,`TF-IDF search completed in ${f}ms`,{chunksFound:d.chunks.length,searchTelemetry:d.telemetry}),Wh(o);let h=await this.applyEmbeddingReranking(l,d.chunks,MA(n),o),m=h.chunks.length,A=new Set(h.chunks.map(_=>_.chunk.file)).size,y=this._workspaceFileIndex.fileCount,E=s.elapsed();return am.info(this.ctx,`Search with reranking completed successfully in ${E}ms`,{totalTime:E,finalChunkCount:m,uniqueFileCount:A,rerankTime:h.telemetry.rerankTime}),m0.sendTfidfSuccess(this.ctx,E,f,h.telemetry.rerankTime,m,A,d.chunks.length,y,AE.Aggregate),{chunks:h.chunks}}catch(c){throw am.error(this.ctx,"TF-IDF search failed",c),m0.sendTfidfFailure(this.ctx,c),c}}async searchFiles(r,n,o,s){let c=new ode.StopWatch;if(am.info(this.ctx,"Starting file-scoped search",{query:r.rawQuery,fileCount:o.length,files:o}),!o.length)return am.info(this.ctx,"No files to search, returning empty results"),{chunks:[]};if(await this.initializeFiles(o),this._isDisposed)throw new Error("TfidfChunkSearch has been disposed");let l={maxResults:MA(n),maxSpread:hwe},u=await r.resolveQuery(s),d=await this._tfIdfWorker.value.proxy.search(u,l),f=new Set(o),h=d.chunks.filter(v=>f.has(v.file));am.info(this.ctx,"Chunks filtered by file scope",{beforeFilter:d.chunks.length,afterFilter:h.length});let m=c.elapsed(),g=await this.applyEmbeddingReranking(u,h,MA(n),s),A=g.chunks.length,E=new Set(g.chunks.map(v=>v.chunk.file)).size,_=c.elapsed();return am.info(this.ctx,`File-scoped search completed in ${_}ms`,{finalChunkCount:A,searchTelemetry:d.telemetry,rerankTime:g.telemetry.rerankTime}),m0.sendTfidfSuccess(this.ctx,_,m,g.telemetry.rerankTime,A,E,h.length,o.length,AE.Remote),{chunks:g.chunks}}async applyEmbeddingReranking(r,n,o,s){let c=new ode.StopWatch,l=[];if(am.info(this.ctx,"Starting embedding reranking",{chunkCount:n.length,maxResults:o}),n.length>0){let u=s?void 0:new Fn.CancellationTokenSource,d=s??u.token,f=5e3;try{let h=this._embeddingReranker.rerankChunks(r,n,o,d),m=await(0,PXe.raceTimeout)(h,f,()=>{am.warn(this.ctx,"Embedding reranking timed out, falling back to TF-IDF results"),u?.cancel()});m&&m.length>0?(l=m,am.info(this.ctx,`Reranking completed in ${c.elapsed()}ms`,{rerankedCount:m.length})):(am.warn(this.ctx,"Reranking returned no results, falling back to TF-IDF results"),l=n.slice(0,o).map(g=>({chunk:g,distance:void 0})))}catch(h){am.error(this.ctx,"Error during embedding reranking, falling back to TF-IDF results:",h),l=n.slice(0,o).map(m=>({chunk:m,distance:void 0}))}}else am.info(this.ctx,"No chunks to rerank");return{chunks:l,telemetry:{rerankTime:c.elapsed()}}}async initializeWorkspace(){if(await this._workspaceFileIndex.initialize(),this._isDisposed)throw new Error("TfidfChunkSearch disposed during initialization");let r=Array.from(this._workspaceFileIndex.values()),n=r;r.length>this._maxFileCount&&(n=r.slice(0,this._maxFileCount),am.warn(this.ctx,`Workspace has too many files, limiting indexing from ${r.length} to ${this._maxFileCount}`)),am.info(this.ctx,"Preparing files for indexing",{totalFiles:r.length,filesToIndex:n.length,maxFileCount:this._maxFileCount});let o=new PXe.Limiter(vts),s=await Promise.all(n.map(c=>o.queue(async()=>({uri:c.uri,contentId:await c.getFastContentVersionId()}))));return await this._tfIdfWorker.value.proxy.initialize(s)}async getFastContentVersionId(r){let n=await this.ctx.get(Qo).stat(r);return`${n.size}-${n.mtime}`}async initializeFiles(r){let n=new Set(r),o=Array.from(this._workspaceFileIndex.values()).filter(s=>n.has(s.uri)).map(s=>s.uri);o.length&&await this._tfIdfWorker.value.proxy.addOrUpdate(o)}registerFileWatchers(){let r=[],n=this._workspaceFileIndex.onDidCreateFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.addOrUpdate(c).catch(l=>{console.error("Error handling file create event:",l)})});r.push(n);let o=this._workspaceFileIndex.onDidChangeFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.addOrUpdate(c).catch(l=>{console.error("Error handling file change event:",l)})});r.push(o);let s=this._workspaceFileIndex.onDidDeleteFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.delete(c).catch(l=>{console.error("Error handling file delete event:",l)})});return r.push(s),{dispose:a(()=>{r.forEach(c=>c.dispose())},"dispose")}}getDbPath(){if(this._customDbPath)return this._customDbPath;let r=EXe(this._workspaceFileIndex);return RXe.join(r,"local-index.db")}firstExistingPath(r){for(let n of r)if((0,Uwn.existsSync)(n))return n}};p();p();p();var N$t=class{constructor(){this._value="";this._pos=0}static{a(this,"StringIterator")}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;r--,this._valueLen--){let n=this._value.charCodeAt(r);if(!(n===47||this._splitOnBackslash&&n===92))break}return this.next()}hasNext(){return this._to!1,r=()=>!1){return new t(new O$t(e,r))}static forPaths(e=!1){return new t(new DXe(void 0,!e))}static forStrings(){return new t(new N$t)}static forConfigKeys(){return new t(new M$t)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,r){if(r){let n=r.slice(0);P7t(n);for(let o of n)this.set(o,e)}else{let n=e.slice(0);P7t(n);for(let o of n)this.set(o[0],o[1])}}set(e,r){let n=this._iter.reset(e),o;this._root||(this._root=new sde,this._root.segment=n.value());let s=[];for(o=this._root;;){let l=n.cmp(o.segment);if(l>0)o.left||(o.left=new sde,o.left.segment=n.value()),s.push([-1,o]),o=o.left;else if(l<0)o.right||(o.right=new sde,o.right.segment=n.value()),s.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new sde,o.mid.segment=n.value()),s.push([0,o]),o=o.mid;else break}let c=hF.unwrap(o.value);o.value=hF.wrap(r),o.key=e;for(let l=s.length-1;l>=0;l--){let u=s[l][1];u.updateHeight();let d=u.balanceFactor();if(d<-1||d>1){let f=s[l][0],h=s[l+1][0];if(f===1&&h===1)s[l][1]=u.rotateLeft();else if(f===-1&&h===-1)s[l][1]=u.rotateRight();else if(f===1&&h===-1)u.right=s[l+1][1]=s[l+1][1].rotateRight(),s[l][1]=u.rotateLeft();else if(f===-1&&h===1)u.left=s[l+1][1]=s[l+1][1].rotateLeft(),s[l][1]=u.rotateRight();else throw new Error;if(l>0)switch(s[l-1][0]){case-1:s[l-1][1].left=s[l][1];break;case 1:s[l-1][1].right=s[l][1];break;case 0:s[l-1][1].mid=s[l][1];break}else this._root=s[0][1]}}return c}get(e){return hF.unwrap(this._getNode(e)?.value)}_getNode(e){let r=this._iter.reset(e),n=this._root;for(;n;){let o=r.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(r.hasNext())r.next(),n=n.mid;else break}return n}has(e){let r=this._getNode(e);return!(r?.value===void 0&&r?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,r){let n=this._iter.reset(e),o=[],s=this._root;for(;s;){let c=n.cmp(s.segment);if(c>0)o.push([-1,s]),s=s.left;else if(c<0)o.push([1,s]),s=s.right;else if(n.hasNext())n.next(),o.push([0,s]),s=s.mid;else break}if(s){if(r?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){let c=[[1,s]],l=this._min(s.right,c);if(l.key){s.key=l.key,s.value=l.value,s.segment=l.segment;let u=l.right;if(c.length>1){let[f,h]=c[c.length-1];switch(f){case-1:h.left=u;break;case 0:YK(!1);case 1:YK(!1)}}else s.right=u;let d=this._balanceByStack(c);if(o.length>0){let[f,h]=o[o.length-1];switch(f){case-1:h.left=d;break;case 0:h.mid=d;break;case 1:h.right=d;break}}else this._root=d}}else{let c=s.left??s.right;if(o.length>0){let[l,u]=o[o.length-1];switch(l){case-1:u.left=c;break;case 0:u.mid=c;break;case 1:u.right=c;break}}else this._root=c}this._root=this._balanceByStack(o)??this._root}}_min(e,r){for(;e.left;)r.push([-1,e]),e=e.left;return e}_balanceByStack(e){for(let r=e.length-1;r>=0;r--){let n=e[r][1];n.updateHeight();let o=n.balanceFactor();if(o>1?(n.right.balanceFactor()>=0||(n.right=n.right.rotateRight()),e[r][1]=n.rotateLeft()):o<-1&&(n.left.balanceFactor()<=0||(n.left=n.left.rotateLeft()),e[r][1]=n.rotateRight()),r>0)switch(e[r-1][0]){case-1:e[r-1][1].left=e[r][1];break;case 1:e[r-1][1].right=e[r][1];break;case 0:e[r-1][1].mid=e[r][1];break}else return e[0][1]}}findSubstr(e){let r=this._iter.reset(e),n=this._root,o;for(;n;){let s=r.cmp(n.segment);if(s>0)n=n.left;else if(s<0)n=n.right;else if(r.hasNext())r.next(),o=hF.unwrap(n.value)||o,n=n.mid;else break}return n&&hF.unwrap(n.value)||o}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,r){let n=this._iter.reset(e),o=this._root;for(;o;){let s=n.cmp(o.segment);if(s>0)o=o.left;else if(s<0)o=o.right;else if(n.hasNext())n.next(),o=o.mid;else return o.mid?this._entries(o.mid):r?hF.unwrap(o.value):void 0}}hasElementOrSubtree(e){return this._findSuperstrOrElement(e,!0)!==void 0}forEach(e){for(let[r,n]of this)e(n,r)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){let r=[];return this._dfsEntries(e,r),r[Symbol.iterator]()}_dfsEntries(e,r){e&&(e.left&&this._dfsEntries(e.left,r),e.value!==void 0&&r.push([e.key,hF.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,r),e.right&&this._dfsEntries(e.right,r))}_isBalanced(){let e=a(r=>{if(!r)return!0;let n=r.balanceFactor();return n<-1||n>1?!1:e(r.left)&&e(r.right)},"nodeIsBalanced");return e(this._root)}};var Qwn=fe(nl()),qwn=fe(require("fs")),jwn=fe(ei());var Cts=1.5*1024*1024,L$t=class{constructor(e){this._uri=e;this._isDisposed=!1;this._disposedCts=new jwn.CancellationTokenSource}static{a(this,"FileRepresentation")}dispose(){this._isDisposed=!0,this._disposedCts.cancel(),this._disposedCts.dispose()}get uri(){return this._uri}async getFastContentVersionId(){let e=await this.getStats();return`${e.size}-${e.mtime}`}},MXe=class extends L$t{constructor(r,n,o){super(r);this._ctx=o;this._fileReadLimiter=n}static{a(this,"FsFileRepresentation")}isDirty(){return!1}async getStats(){let r=await this._ctx.get(Qo).stat(this.uri.toString());return{size:r.size,mtime:r.mtime}}async getText(){try{let r=await this._readFile();if(!r||this._isDisposed)return"";let o=new TextDecoder().decode(r.data);return(await this._ctx.get(sc).evaluate(this.uri,o)).isBlocked?"":o}catch{return""}}async _readFile(){try{let r=ln(this.uri);return await this._fileReadLimiter.queue(async()=>({data:await(0,Qwn.raceCancellationError)(bts(r,Cts),this._disposedCts.token)}))}catch{return}}};async function bts(t,e){return new Promise((r,n)=>{let o=qwn.createReadStream(t,{start:0,end:e-1}),s=[],c=0;o.on("data",l=>(c+=l.length,s.push(l))),o.on("end",()=>r(Buffer.concat(s))),o.on("error",n)})}a(bts,"readLocalTextFileUsingReadStream");var OXe=class{constructor(e,r,n){this.ctx=e;this.workspaceFolder=r;this.limiter=n;this._fsFileTree=new B$t;this._onDidCreateFiles=new Vi;this.onDidCreateFiles=this._onDidCreateFiles.event;this._onDidChangeFiles=new Vi;this.onDidChangeFiles=this._onDidChangeFiles.event;this._onDidDeleteFiles=new Vi;this.onDidDeleteFiles=this._onDidDeleteFiles.event}static{a(this,"WorkspaceFileIndex")}get fileCount(){return this._fsFileTree.fileCount}*values(){yield*this._fsFileTree.values()}get(e){let r=Us(e);return r?this._fsFileTree.get(r):void 0}tryLoad(e){throw new Error("Method not implemented.")}tryRead(e){throw new Error("Method not implemented.")}createOrUpdateFsEntry(e){let r=this._fsFileTree.get(e);r&&r.dispose();let n=new MXe(e,this.limiter,this.ctx);return this._fsFileTree.addFile(e,n),n}async initialize(){return this._initializePromise??=(async()=>{let e=await this.ctx.get(tw).getWatchedFileUris(this.workspaceFolder),r=this.ctx.get(sc);(r.enabled?(await Promise.all(e.map(async o=>(await r.evaluate(o.uri,"")).isBlocked?void 0:o))).filter(o=>o!==void 0):e).forEach(o=>{let s=Us(o.uri);s&&this._fsFileTree.addFile(s,new MXe(o.uri,this.limiter,this.ctx))})})(),this._initializePromise}async didChangeFiles(e){if(e.type==="create"){let r=[];for(let n of e.documents){if(await this.statFileType(n.uri)!==1)continue;let s=n.uri;this._fsFileTree.get(s)||(this.createOrUpdateFsEntry(s),r.push(s))}r.length&&this._onDidCreateFiles.fire(r)}else if(e.type==="update"){let r=[];for(let n of e.documents){if(await this.statFileType(n.uri)!==1)continue;let s=n.uri;this.createOrUpdateFsEntry(s),r.push(s)}r.length&&this._onDidChangeFiles.fire(r)}else if(e.type==="delete"){let r=[];for(let n of e.documents){let o=n.uri,s=this._fsFileTree.get(o);if(s)s.dispose(),this._fsFileTree.delete(o),r.push(o);else{let c=this._fsFileTree.deleteFolder(o);c.length&&r.push(...c)}}r.length&&this._onDidDeleteFiles.fire(r)}}async statFileType(e){try{return(await this.ctx.get(Qo).stat(e)).type}catch{return}}},B$t=class{constructor(){this._tree=NXe.forPaths();this._fileCount=0}static{a(this,"SimpleFsTree")}get fileCount(){return this._fileCount}get(e){return this._tree.get(e)}addFile(e,r){this._tree.get(e)||this._fileCount++,this._tree.set(e,r)}clear(){this._tree.clear()}delete(e){let r=!!this.get(e);return this._tree.delete(e),r&&(this._fileCount=Math.max(0,this._fileCount-1)),r}deleteFolder(e){let r=[];for(let[n]of this._tree.findSuperstr(e)??[])r.push(n);for(let n of r)this._tree.delete(n);return this._fileCount=Math.max(0,this._fileCount-r.length),r}*values(){for(let[,e]of this.entries())yield e}entries(){return this._tree}};var Hwn=fe(nl());var LXe=class extends tq{constructor(r){super();this.ctx=r;this.workspaceFileIndexes=new Map;this._onDidWorkspaceAdded=new Vi;this.onDidWorkspaceAdded=this._onDidWorkspaceAdded.event;this._onDidWorkspaceRemoved=new Vi;this.onDidWorkspaceRemoved=this._onDidWorkspaceRemoved.event;this.ctx.get(VS).addListener(this),this._fileReadLimiter=new Hwn.Limiter(20)}static{a(this,"WorkspaceFileWatcher")}isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}async didAddWorkspace(r){if(!await this.isEnabled())return;let n=new OXe(this.ctx,r,this._fileReadLimiter);this.workspaceFileIndexes.set(r.uri,n),this._onDidWorkspaceAdded.fire(n)}async didRemoveWorkspace(r){if(!await this.isEnabled())return;let n=this.workspaceFileIndexes.get(r.uri);if(n){for(let o of n.values())o.dispose();this._onDidWorkspaceRemoved.fire(n),this.workspaceFileIndexes.delete(r.uri)}}async didChangeFiles(r){if(!await this.isEnabled())return;let n=this.workspaceFileIndexes.get(r.workspaceFolder.uri);n&&await n.didChangeFiles(r)}};var Kwe=fe(yw()),Gwn=fe(Sl()),Ew=fe(nl()),Zq=fe(GO());var il=new pe("Semantic Search"),l2=class{constructor(e){this._ctx=e;this._availableEmbeddingTypes=new yXe(e),this.tryInit()}static{a(this,"WorkspaceChunkSearchService")}dispose(){this._impl?.dispose()}async tryInit(){if(this._impl)return this._impl;let e=await this._availableEmbeddingTypes.getPreferredType();if(e)return this._impl=new F$t(this._ctx,e),this._impl}async searchWorkspace(e,r,n){let o=await this.tryInit();if(!o)throw new Error("Workspace chunk search service not available");return await o.searchWorkspace(e,r,n)}},F$t=class{constructor(e,r){this._ctx=e;this._embeddingType=r;this._localEmbeddingsByWorkspace=new Map;this._localTfidfByWorkspace=new Map;this._diffTrackersByWorkspace=new Map;this._workspaceFileIndexes=new Map;let n=new LXe(this._ctx),o=new HZe(this._ctx);this._localDiffSearch=new IXe(this._localEmbeddingsByWorkspace,this._localTfidfByWorkspace,this._workspaceFileIndexes,this._diffTrackersByWorkspace),this._githubCodeSearchService=new qZe(this._ctx),this._codeSearchChunkSearch=new GZe(this._ctx,this._embeddingType,this._localDiffSearch,this._githubCodeSearchService),n.onDidWorkspaceAdded(s=>{this._workspaceFileIndexes.set(s.workspaceFolder.uri,s);let c=new vXe(this._ctx,s,this._embeddingType,o);this._localEmbeddingsByWorkspace.set(s.workspaceFolder.uri,c);let l=new kXe(this._ctx,s,{embeddingType:this._embeddingType});this._localTfidfByWorkspace.set(s.workspaceFolder.uri,l);let u=new AXe(this._ctx,s,this._githubCodeSearchService);this._diffTrackersByWorkspace.set(s.workspaceFolder.uri,u),process.env.GITHUB_COPILOT_SIMULATION!=="1"&&!OP(this._ctx)&&(u.initialize(),c.triggerLocalIndexing(),l.initialize())}),n.onDidWorkspaceRemoved(s=>{let c=s.workspaceFolder.uri,l=this._diffTrackersByWorkspace.get(c);l&&(l.dispose(),this._diffTrackersByWorkspace.delete(c));let u=this._localTfidfByWorkspace.get(c);u&&(u.dispose(),this._localTfidfByWorkspace.delete(c));let d=this._localEmbeddingsByWorkspace.get(c);d&&(d.dispose(),this._localEmbeddingsByWorkspace.delete(c))})}static{a(this,"WorkspaceChunkSearchServiceImpl")}dispose(){this._githubCodeSearchService.dispose();for(let e of this._localTfidfByWorkspace.values())e.dispose();this._localTfidfByWorkspace.clear();for(let e of this._localEmbeddingsByWorkspace.values())e.dispose();this._localEmbeddingsByWorkspace.clear();for(let e of this._diffTrackersByWorkspace.values())e.dispose();this._diffTrackersByWorkspace.clear(),this._workspaceFileIndexes.clear()}async searchWorkspace(e,r,n){let o=new Zq.StopWatch,s=await this.resolveQueryText(e,n);il.info(this._ctx,"Starting semantic search",{resolvedQuery:s,maxResults:MA(r),tokenBudget:r.tokenBudget,workspaceFolders:r.workspaceFolders});let c=this.toQueryWithEmbeddings(e,s),l=await this.doSearchFileChunks(c,r,n);if(l.isError())throw il.error(this._ctx,"Semantic search failed",l.err),m0.sendAggregateFailure(this._ctx,l.err),new Error(`Workspace chunk search failed: ${l.err.errorDiagMessage}`);il.info(this._ctx,`Search strategy '${l.val.strategy}' returned results`,{strategy:l.val.strategy,chunkCount:l.val.result.chunks.length});let u=await(0,Ew.raceCancellationError)(this.filterIgnoredChunks(l.val.result.chunks),n);il.info(this._ctx,"Chunks filtered",{beforeFilter:l.val.result.chunks.length,afterFilter:u.length});let d=await this.rerankChunks(c,u,MA(r),n),f=d.length,m=new Set(d.map(A=>A.chunk.file)).size,g=o.elapsed();return il.info(this._ctx,`Search completed successfully in ${o.elapsed()}ms`,{totalTime:o.elapsed(),strategy:l.val.strategy,finalChunkCount:f,uniqueFileCount:m}),m0.sendAggregateSuccess(this._ctx,l.val.strategy,g,f,m,r.workspaceFolders.length,r.source),{chunks:d}}toQueryWithEmbeddings(e,r){let n;return{...e,resolveQueryEmbeddings:a(o=>(n??=this.computeQueryEmbedding(e,o,r),n),"resolveQueryEmbeddings")}}async computeQueryEmbedding(e,r,n){Wh(r);let o=n??await this.resolveQueryText(e,r),s=await this.getEmbeddingComputer().computeEmbeddings(this._embeddingType,[o],{inputType:"query"},r);if(!s?.values.length)throw new Error("Failed to compute query embeddings");return s.values[0]}async resolveQueryText(e,r){try{return await e.resolveQuery(r)}catch(n){if(LP(n))throw n;return il.debug(this._ctx,"Falling back to raw query text",n),e.rawQuery}}getEmbeddingComputer(){return this._embeddingComputer||(this._embeddingComputer=new rde(this._ctx)),this._embeddingComputer}async doSearchFileChunks(e,r,n){il.info(this._ctx,"Starting semantic search with fallback strategy");let o=process.env.GITHUB_COPILOT_SIMULATION==="1"?1e6:12500;return this.runSearchStrategyWithFallback(this._codeSearchChunkSearch,()=>(0,Ew.createCancelablePromise)(s=>this.doSearchFileChunksLocally(e,r,s)),o,e,r,n)}async runSearchStrategyWithFallback(e,r,n,o,s,c){let l=new Zq.StopWatch;il.info(this._ctx,`Attempting primary strategy '${e.id}'`,{timeout:n});let u=(0,Ew.createCancelablePromise)(g=>this.runSearchStrategy(e,o,s,g));c.onCancellationRequested(()=>u.cancel());let d=await(0,Ew.raceCancellationError)((0,Ew.raceTimeout)(u,n),c);if(d?.isOk())return il.info(this._ctx,`Primary strategy '${e.id}' succeeded in ${l.elapsed()}ms`,{strategy:e.id,elapsedTime:l.elapsed()}),d;il.warn(this._ctx,`Primary strategy '${e.id}' failed or timed out, falling back to local search`,{elapsedTime:l.elapsed(),isTimeout:d===void 0,error:d?.isError()?d.err:void 0});let f=r();c.onCancellationRequested(()=>f.cancel()),f.then(()=>u.cancel(),()=>u.cancel());let h=new Zq.StopWatch,m=await TXe([u,f]);return il.info(this._ctx,`Search operation completed in ${l.elapsed()}ms (fallback took ${h.elapsed()}ms)`,{totalTime:l.elapsed(),fallbackTime:h.elapsed(),success:m.isOk()}),m}async doSearchFileChunksLocally(e,r,n){il.info(this._ctx,"Starting local file chunk search",{folderCount:r.workspaceFolders.length});let o=[],s=new Set;for(let l of r.workspaceFolders){let u=this._localEmbeddingsByWorkspace.get(l),d=this._localTfidfByWorkspace.get(l);if(u&&d){il.info(this._ctx,`Both strategies available for folder: ${l}, using embeddings with TF-IDF fallback`);let f=8e3,h=new Zq.StopWatch,m=await this.runSearchStrategyWithFallback(u,()=>(0,Ew.createCancelablePromise)(g=>this.runSearchStrategy(d,e,r,g)),f,e,r,n);m.isOk()&&(o.push(...m.val.result.chunks),s.add(m.val.strategy),il.info(this._ctx,`Folder search completed in ${h.elapsed()}ms`,{folder:l,strategy:m.val.strategy,chunkCount:m.val.result.chunks.length,elapsedTime:h.elapsed()}))}else if(u){il.info(this._ctx,`Using embeddings search for folder: ${l}`);let f=new Zq.StopWatch,h=await this.runSearchStrategy(u,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(u.id),il.info(this._ctx,`Embeddings search completed in ${f.elapsed()}ms`,{folder:l,chunkCount:h.isOk()?h.val.result.chunks.length:0,elapsedTime:f.elapsed()})}else if(d){il.info(this._ctx,`Using TF-IDF search for folder: ${l}`);let f=new Zq.StopWatch,h=await this.runSearchStrategy(d,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(d.id),il.info(this._ctx,`TF-IDF search completed in ${f.elapsed()}ms`,{folder:l,chunkCount:h.isOk()?h.val.result.chunks.length:0,elapsedTime:f.elapsed()})}else il.warn(this._ctx,`No local search strategy available for folder: ${l}`)}let c=s.size===1?s.values().next().value:"mixed";return il.info(this._ctx,"Local search completed",{strategy:c,totalChunkCount:o.length,strategiesUsed:Array.from(s)}),Kwe.Result.ok({strategy:c,result:{chunks:o}})}async runSearchStrategy(e,r,n,o){let s=new Zq.StopWatch;il.info(this._ctx,`Running search strategy '${e.id}'`);try{let c=await(0,Ew.raceCancellationError)(e.searchWorkspace(r,n,o),o);return c?(il.info(this._ctx,`Strategy '${e.id}' completed successfully in ${s.elapsed()}ms`,{strategy:e.id,chunkCount:c.chunks.length,elapsedTime:s.elapsed()}),Kwe.Result.ok({strategy:e.id,result:c})):(il.warn(this._ctx,`Strategy '${e.id}' returned no result`,{strategy:e.id,elapsedTime:s.elapsed()}),Kwe.Result.error({errorDiagMessage:`${e.id}: no result`}))}catch(c){if(LP(c))throw il.info(this._ctx,`Strategy '${e.id}' was cancelled`,{elapsedTime:s.elapsed()}),c;return il.error(this._ctx,c,`Error during '${e.id}' search, elapsed: ${s.elapsed()}ms`),Kwe.Result.error({errorDiagMessage:`${e.id} error: ${String(c)}`})}}async filterIgnoredChunks(e){return(0,Gwn.coalesce)(await Promise.all(e.map(async r=>(await this._ctx.get(sc).evaluate(r.chunk.file,r.chunk.text)).isBlocked?null:r)))}async rerankChunks(e,r,n,o){if(!r.length)return[];try{let s,c=r.at(0)?.distance?.embeddingType;if(c&&r.every(f=>typeof f.distance<"u"&&f.distance.embeddingType.equals(c)))s=[...r].sort((f,h)=>h.distance.value-f.distance.value);else{let h=r.map((A,y)=>({...A.chunk,distance:A.distance,index:y})).filter(A=>typeof A.distance>"u"||!A.distance.embeddingType.equals(this._embeddingType)),m;if(h.length){il.debug(this._ctx,`WorkspaceChunkSearch.rerankChunks. Scoring ${h.length} new chunks`);let A=this.scoreChunks(e,h,o);m=await(0,Ew.raceCancellationError)(A,o)}let g=[];for(let A=0;AA?.distance?.embeddingType.equals(this._embeddingType)).sort((A,y)=>y.distance.value-A.distance.value)}if(!s.length)return s;s=s.slice(0,n);let u=s[0].distance.value*hwe,d=s.filter(f=>f.distance.value>=u);return il.debug(this._ctx,`Eagerly filtered out ${s.length-d.length} chunks due to low quality`),d}catch(s){return LP(s)||il.error(this._ctx,"Failed to search chunk embeddings index"),r.slice(0,n)}}async scoreChunks(e,r,n){if(!r.length)return[];let o=r.map(l=>this.chunkToIndexString(l)),[s,c]=await(0,Ew.raceCancellationError)(Promise.all([e.resolveQueryEmbeddings(n),this.computeEmbeddings("document",o,n)]),n);return c.values.map((l,u)=>({chunk:r[u],distance:mwe(s,l)}))}async computeEmbeddings(e,r,n){let o=await this.getEmbeddingComputer().computeEmbeddings(this._embeddingType,r,{inputType:e},n);if(!o)throw new Error("Failed to compute embeddings");return o}chunkToIndexString(e){return this.toStringForEmbeddingsComputer(e,Us(e.file)??e.file)}toStringForEmbeddingsComputer(e,r){let n=OA(e.text);return`File: \`${r}\` ${n} ${e.text} -${n}`}};var mxn=new fe("ProjectContextSkill"),q_d=S.Object({uri:S.String(),snippet:S.String(),range:S.Object({start:S.Object({line:S.Number(),character:S.Number()}),end:S.Object({line:S.Number(),character:S.Number()})})}),EXo=47,WGt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectContextSkillProcessor")}value(){return 1}async processSkill(e){if(this.turnContext.cancelationToken.isCancellationRequested){await this.turnContext.steps.cancel(aF);return}let r=[],n=this.turnContext.ctx.get(ii),o=this.removeDuplicateSnippets(e);for(let s of o){let{uri:c,snippet:l,range:u}=s,d=await n.getOrReadTextDocument(s);if(d.status==="valid"){let f=new IO(d.document,u,u),h=new Ar([l]),g=zxe(c)?.5:.8;r.push([`Code excerpt from file \`${rs(c)}\`:`,1],[f.wrapInTicks(h,g),1]),await this.turnContext.collectFile(Kue,c,td(d),u)}}if(r.length>0)return r.unshift([new Ar(["The user wants you to consider the following snippets when computing your answer."]),1]),new Ar(r)}removeDuplicateSnippets(e){let r={};return e.forEach(n=>{let o=`${n.uri}#[${n.range.start.line},${n.range.start.character}]-[${n.range.end.line},${n.range.end.character}]`;r[o]||(r[o]=n)}),Object.values(r)}},aF="collect-project-context",lXe=class{constructor(e={}){this.dependencies=e}static{a(this,"SemanticSearchSkillResolver")}async resolveSkill(e){if(mxn.debug(e.ctx,"Resolving project context via semantic search skill resolver"),await e.steps.start(aF,"Collecting relevant project context"),IP(e.ctx)){await e.steps.error(aF,"Workspace indexing is disabled by configuration");return}await e.info(is`Project context is applied to this response, which may lead to slightly longer load times. For faster and more general Copilot responses, remove the project context option from your prompt.`);let r=e.ctx.get(t2);if(!r){await e.steps.error(aF,"Code search service for project context is unavailable");return}let n=[];if(e.turn.workspaceFolder&&n.push(e.turn.workspaceFolder.uri),e.turn.workspaceFolders)for(let u of e.turn.workspaceFolders)n.includes(u.uri)||n.push(u.uri);if(!n.length){await e.steps.error(aF,"No workspace folders available for search");return}let o=Pn(e.turn.request.message),c=await(this.dependencies.parseUserQuery??JCn)(e,e.cancelationToken);if(!c||c.length===0){await e.steps.error(aF,"No keywords parsed from user query");return}let l=c.join(" ");try{let u=await r.searchWorkspace({rawQuery:o,resolveQueryAndKeywords:a(async()=>Promise.resolve({rephrasedQuery:l,keywords:c.map(f=>({keyword:f,variations:[]}))}),"resolveQueryAndKeywords"),resolveQuery:a(async()=>Promise.resolve(l),"resolveQuery")},{tokenBudget:XCn,maxResults:Math.min(10*c.length,EXo),workspaceFolders:n,source:"projectContext"},e.cancelationToken);if(await(this.dependencies.telemetryIndexCodesearch??Iyn)(e,"semantic_search",{localSnippetCount:u.chunks.length}),u.chunks.length===0){await e.steps.error(aF,"No project context found");return}return await e.steps.finish(aF),u.chunks.map(f=>({uri:f.chunk.file,snippet:f.chunk.text,range:{start:{line:f.chunk.range.startLineNumber,character:f.chunk.range.startColumn},end:{line:f.chunk.range.endLineNumber,character:f.chunk.range.endColumn}}}))}catch(u){await e.steps.error(aF,"Project context search failed"),mxn.error(e.ctx,"Error during workspace chunk search for project context:",u);return}}},Kue="project-context",uXe=class extends gg{static{a(this,"ProjectContextSkill")}constructor(e){super(Kue,"Code snippets and documentation from the open project. This skill is useful when the user question is specific to the open project and its context. Do not include this skill for general programming questions.","Performing code search",()=>e,r=>new WGt(r),"implicit",["Relevant: How do I add a custom server route?","Relevant: Where is the code that processes the response from CopyableThreadElement?","Relevant: Where do I add tests for the InputValidation class?","Relevant: How to implement a shared buffer component","Not relevant: What does numpy do?"],r=>!IP(r))}};var zGt=class{constructor(){this.slug="project";this.name="Project";this.description="Ask about your project"}static{a(this,"ProjectAgent")}additionalSkills(){return[Kue]}};async function ew(t){let e=[];return e.push(new CJe),e.push(...await t.get(WP).agents()),e.push(new zGt),e.push(new pJe),e}a(ew,"getAgents");p();p();var fw=require("fs"),aJ=de(require("path"));Mo();var p0=class{constructor(e){this.ctx=e}static{a(this,"ConversationTranscriptPersistence")}isEnabled(){return!!this.getTranscriptDirectory()}getTranscriptDirectory(){return Ft(this.ctx,Ye.TranscriptDirectory)}async appendEvent(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=aJ.dirname(o);await fw.promises.mkdir(s,{recursive:!0,mode:448});let c=JSON.stringify(n)+` -`;await fw.promises.appendFile(o,c,{encoding:"utf8",mode:384})}catch(o){ot.error(this.ctx,`Failed to append transcript event: ${o instanceof Error?o.message:String(o)}`)}}async initializePartition(e,r,n){if(!this.isEnabled())return;let o={type:"partition.created",data:{conversationId:String(e),partitionId:r,...n},id:Mt(),timestamp:new Date().toISOString(),parentId:null};await this.appendEvent(e,r,o)}getTranscriptPath(e,r){return`${e}/partition-${r}.jsonl`}getTranscriptFilePath(e,r){let n=this.getTranscriptDirectory();if(!n)throw new Error("Transcript directory not configured");return aJ.join(n,String(e),`partition-${r}.jsonl`)}getConversationDirectory(e){let r=this.getTranscriptDirectory();if(!r)throw new Error("Transcript directory not configured");return aJ.join(r,String(e))}async readTranscriptFile(e,r){if(!this.isEnabled())return[];try{let n=this.getTranscriptFilePath(e,r);return(await fw.promises.readFile(n,"utf8")).trim().split(` -`).filter(c=>c.length>0).map(c=>JSON.parse(c))}catch(n){return n.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to read transcript file: ${n instanceof Error?n.message:String(n)}`),[])}}async listPartitionTranscripts(e){if(!this.isEnabled())return[];try{let r=this.getConversationDirectory(e);return(await fw.promises.readdir(r)).filter(o=>o.startsWith("partition-")&&o.endsWith(".jsonl")&&!o.includes(".v")).map(o=>{let s=o.match(/^partition-(\d+)\.jsonl$/);return s?parseInt(s[1],10):NaN}).filter(o=>!isNaN(o)).sort((o,s)=>o-s)}catch(r){return r.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to list partition transcripts: ${r instanceof Error?r.message:String(r)}`),[])}}async deleteTranscript(e,r){if(this.isEnabled())try{let n=this.getTranscriptFilePath(e,r);await fw.promises.unlink(n),ot.debug(this.ctx,`Deleted transcript: ${n}`)}catch(n){n.code!=="ENOENT"&&ot.error(this.ctx,`Failed to delete transcript: ${n instanceof Error?n.message:String(n)}`)}}async writeTranscriptFile(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=aJ.dirname(o);await fw.promises.mkdir(s,{recursive:!0,mode:448});let c=n.map(l=>JSON.stringify(l)).join(` +${n}`}};var $wn=new pe("ProjectContextSkill"),jbd=S.Object({uri:S.String(),snippet:S.String(),range:S.Object({start:S.Object({line:S.Number(),character:S.Number()}),end:S.Object({line:S.Number(),character:S.Number()})})}),Sts=47,U$t=class{constructor(e){this.turnContext=e}static{a(this,"ProjectContextSkillProcessor")}value(){return 1}async processSkill(e){if(this.turnContext.cancelationToken.isCancellationRequested){await this.turnContext.steps.cancel(mF);return}let r=[],n=this.turnContext.ctx.get(ni),o=this.removeDuplicateSnippets(e);for(let s of o){let{uri:c,snippet:l,range:u}=s,d=await n.getOrReadTextDocument(s);if(d.status==="valid"){let f=new DO(d.document,u,u),h=new Ar([l]),g=pwe(c)?.5:.8;r.push([`Code excerpt from file \`${Us(c)}\`:`,1],[f.wrapInTicks(h,g),1]),await this.turnContext.collectFile(ade,c,id(d),u)}}if(r.length>0)return r.unshift([new Ar(["The user wants you to consider the following snippets when computing your answer."]),1]),new Ar(r)}removeDuplicateSnippets(e){let r={};return e.forEach(n=>{let o=`${n.uri}#[${n.range.start.line},${n.range.start.character}]-[${n.range.end.line},${n.range.end.character}]`;r[o]||(r[o]=n)}),Object.values(r)}},mF="collect-project-context",BXe=class{constructor(e={}){this.dependencies=e}static{a(this,"SemanticSearchSkillResolver")}async resolveSkill(e){if($wn.debug(e.ctx,"Resolving project context via semantic search skill resolver"),await e.steps.start(mF,"Collecting relevant project context"),OP(e.ctx)){await e.steps.error(mF,"Workspace indexing is disabled by configuration");return}await e.info(ns`Project context is applied to this response, which may lead to slightly longer load times. For faster and more general Copilot responses, remove the project context option from your prompt.`);let r=e.ctx.get(l2);if(!r){await e.steps.error(mF,"Code search service for project context is unavailable");return}let n=[];if(e.turn.workspaceFolder&&n.push(e.turn.workspaceFolder.uri),e.turn.workspaceFolders)for(let u of e.turn.workspaceFolders)n.includes(u.uri)||n.push(u.uri);if(!n.length){await e.steps.error(mF,"No workspace folders available for search");return}let o=Pn(e.turn.request.message),c=await(this.dependencies.parseUserQuery??x1n)(e,e.cancelationToken);if(!c||c.length===0){await e.steps.error(mF,"No keywords parsed from user query");return}let l=c.join(" ");try{let u=await r.searchWorkspace({rawQuery:o,resolveQueryAndKeywords:a(async()=>Promise.resolve({rephrasedQuery:l,keywords:c.map(f=>({keyword:f,variations:[]}))}),"resolveQueryAndKeywords"),resolveQuery:a(async()=>Promise.resolve(l),"resolveQuery")},{tokenBudget:R1n,maxResults:Math.min(10*c.length,Sts),workspaceFolders:n,source:"projectContext"},e.cancelationToken);if(await(this.dependencies.telemetryIndexCodesearch??r_n)(e,"semantic_search",{localSnippetCount:u.chunks.length}),u.chunks.length===0){await e.steps.error(mF,"No project context found");return}return await e.steps.finish(mF),u.chunks.map(f=>({uri:f.chunk.file,snippet:f.chunk.text,range:{start:{line:f.chunk.range.startLineNumber,character:f.chunk.range.startColumn},end:{line:f.chunk.range.endLineNumber,character:f.chunk.range.endColumn}}}))}catch(u){await e.steps.error(mF,"Project context search failed"),$wn.error(e.ctx,"Error during workspace chunk search for project context:",u);return}}},ade="project-context",FXe=class extends _g{static{a(this,"ProjectContextSkill")}constructor(e){super(ade,"Code snippets and documentation from the open project. This skill is useful when the user question is specific to the open project and its context. Do not include this skill for general programming questions.","Performing code search",()=>e,r=>new U$t(r),"implicit",["Relevant: How do I add a custom server route?","Relevant: Where is the code that processes the response from CopyableThreadElement?","Relevant: Where do I add tests for the InputValidation class?","Relevant: How to implement a shared buffer component","Not relevant: What does numpy do?"],r=>!OP(r))}};var Q$t=class{constructor(){this.slug="project";this.name="Project";this.description="Ask about your project"}static{a(this,"ProjectAgent")}additionalSkills(){return[ade]}};async function aw(t){let e=[];return e.push(new KJe),e.push(...await t.get(t2).agents()),e.push(new Q$t),e.push(new qJe),e}a(aw,"getAgents");p();p();var _w=require("fs"),AJ=fe(require("path"));Mo();var g0=class{constructor(e){this.ctx=e}static{a(this,"ConversationTranscriptPersistence")}isEnabled(){return!!this.getTranscriptDirectory()}getTranscriptDirectory(){return Rt(this.ctx,ze.TranscriptDirectory)}async appendEvent(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=AJ.dirname(o);await _w.promises.mkdir(s,{recursive:!0,mode:448});let c=JSON.stringify(n)+` +`;await _w.promises.appendFile(o,c,{encoding:"utf8",mode:384})}catch(o){ot.error(this.ctx,`Failed to append transcript event: ${o instanceof Error?o.message:String(o)}`)}}async initializePartition(e,r,n){if(!this.isEnabled())return;let o={type:"partition.created",data:{conversationId:String(e),partitionId:r,...n},id:Nt(),timestamp:new Date().toISOString(),parentId:null};await this.appendEvent(e,r,o)}getTranscriptPath(e,r){return`${e}/partition-${r}.jsonl`}getTranscriptFilePath(e,r){let n=this.getTranscriptDirectory();if(!n)throw new Error("Transcript directory not configured");return AJ.join(n,String(e),`partition-${r}.jsonl`)}getConversationDirectory(e){let r=this.getTranscriptDirectory();if(!r)throw new Error("Transcript directory not configured");return AJ.join(r,String(e))}async readTranscriptFile(e,r){if(!this.isEnabled())return[];try{let n=this.getTranscriptFilePath(e,r);return(await _w.promises.readFile(n,"utf8")).trim().split(` +`).filter(c=>c.length>0).map(c=>JSON.parse(c))}catch(n){return n.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to read transcript file: ${n instanceof Error?n.message:String(n)}`),[])}}async listPartitionTranscripts(e){if(!this.isEnabled())return[];try{let r=this.getConversationDirectory(e);return(await _w.promises.readdir(r)).filter(o=>o.startsWith("partition-")&&o.endsWith(".jsonl")&&!o.includes(".v")).map(o=>{let s=o.match(/^partition-(\d+)\.jsonl$/);return s?parseInt(s[1],10):NaN}).filter(o=>!isNaN(o)).sort((o,s)=>o-s)}catch(r){return r.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to list partition transcripts: ${r instanceof Error?r.message:String(r)}`),[])}}async deleteTranscript(e,r){if(this.isEnabled())try{let n=this.getTranscriptFilePath(e,r);await _w.promises.unlink(n),ot.debug(this.ctx,`Deleted transcript: ${n}`)}catch(n){n.code!=="ENOENT"&&ot.error(this.ctx,`Failed to delete transcript: ${n instanceof Error?n.message:String(n)}`)}}async writeTranscriptFile(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=AJ.dirname(o);await _w.promises.mkdir(s,{recursive:!0,mode:448});let c=n.map(l=>JSON.stringify(l)).join(` `)+` -`;await fw.promises.writeFile(o,c,{encoding:"utf8",mode:384}),ot.debug(this.ctx,`Wrote ${n.length} events to transcript: ${o}`)}catch(o){ot.error(this.ctx,`Failed to write transcript file: ${o instanceof Error?o.message:String(o)}`)}}getVersionedTranscriptFilePath(e,r,n){let o=this.getTranscriptDirectory();if(!o)throw new Error("Transcript directory not configured");return aJ.join(o,String(e),`partition-${r}.v${n}.jsonl`)}async readVersionedTranscriptFile(e,r,n){if(!this.isEnabled())return[];try{let o=this.getVersionedTranscriptFilePath(e,r,n);return(await fw.promises.readFile(o,"utf8")).trim().split(` -`).filter(l=>l.length>0).map(l=>JSON.parse(l))}catch(o){return o.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to read versioned transcript file: ${o instanceof Error?o.message:String(o)}`),[])}}async buildPartitionFromVersionedTranscript(e,r,n){let o=await this.readVersionedTranscriptFile(e,r,n);if(o.length===0)return;let s=[];for(let l of o)switch(l.type){case"user.message":{let u=l.data.content,d=l.data.turnId,f=new Xf({message:u,type:"user"},d);f.timestamp=new Date(l.timestamp).getTime(),s.push(f);break}case"assistant.message":{if(s.length>0){let u=s[s.length-1],d=l.data.content,f=gxn(d);u.response={message:f,type:"model"}}break}case"assistant.turn_end":{if(s.length>0){let u=s[s.length-1];u.status==="in-progress"&&(u.status="success")}break}case"partition.created":{let u=l.data.summary;if(u&&l.data.compressedFrom){let d=new Xf({message:u,type:"meta"},l.data.turnId);d.timestamp=new Date(l.timestamp).getTime(),d.response={message:"",type:"model"},d.status="success",s.push(d)}break}case"user.message_rendered":{let u=l.data.turnId,d=l.data.renderedMessage;if(u&&d){for(let f=s.length-1;f>=0;f--)if(String(s[f].id)===u){s[f].renderedUserMessage=d;break}}break}case"tool.execution_start":case"tool.execution_complete":case"session.start":case"assistant.turn_start":break}let c=(r-1)*10+1;return{conversationId:e,partitionId:r,turns:s,status:"archived",createdAt:s[0]?.timestamp??Date.now(),startTurnNumber:c,endTurnNumber:c+s.length-1,turnCount:s.length}}async archiveTranscriptsAsVersion(e,r,n){if(this.isEnabled())for(let o of r)try{let s=this.getTranscriptFilePath(e,o),c=this.getVersionedTranscriptFilePath(e,o,n);try{await fw.promises.access(s)}catch{continue}await fw.promises.copyFile(s,c),ot.debug(this.ctx,`Archived transcript: ${s} -> ${c}`)}catch(s){ot.error(this.ctx,`Failed to archive transcript for partition ${o}: ${s instanceof Error?s.message:String(s)}`)}}async replayTranscriptToTurns(e,r,n){let o=await this.readTranscriptFile(e,r);if(o.length===0)return[];let s=[],c=!1,l=new Map,u=new Map;for(let d of o){if(c)break;switch(d.type){case"user.message":{let f=d.data.content,h=d.data.turnId,m=new Xf({message:f,type:"user"},h);m.timestamp=new Date(d.timestamp).getTime(),s.push(m),n!==void 0&&m.id===n&&(c=!0);break}case"assistant.message":{if(s.length>0){let f=s[s.length-1],h=d.data.content,m=gxn(h);f.response={message:m,type:"model"}}break}case"assistant.turn_end":{if(s.length>0){let f=s[s.length-1];f.status==="in-progress"&&(f.status="success"),n!==void 0&&f.id===n&&(c=!0)}break}case"partition.created":{let f=d.data.summary;if(f&&d.data.compressedFrom){let h=new Xf({message:f,type:"meta"},d.data.turnId);h.timestamp=new Date(d.timestamp).getTime(),h.response={message:"",type:"model"},h.status="success",s.push(h)}break}case"tool.execution_start":{let f=d.data.toolCallId;if(f){let h=l.get(f)||{};h.start=d,l.set(f,h),s.length>0&&u.set(f,s.length-1)}break}case"tool.execution_complete":{let f=d.data.toolCallId;if(f){let h=l.get(f)||{};h.complete=d,l.set(f,h)}break}case"user.message_rendered":{let f=d.data.turnId,h=d.data.renderedMessage;if(f&&h){for(let m=s.length-1;m>=0;m--)if(String(s[m].id)===f){s[m].renderedUserMessage=h;break}}break}case"session.start":case"assistant.turn_start":break}}return this.reconstructToolCallsForTurns(s,l,u),ot.debug(this.ctx,`Replayed transcript: partitionId=${r}, events=${o.length}, turns=${s.length}`),s}reconstructToolCallsForTurns(e,r,n){let o=new Map;for(let[s,c]of r){let l=n.get(s);if(l===void 0){ot.debug(this.ctx,`Tool call ${s} has no associated turn`);continue}let u=this.reconstructToolCallFromEvents(s,c);if(u){let d=o.get(l)||[];d.push(u),o.set(l,d)}}for(let[s,c]of o)if(s0){let l=e[s],u=[{roundId:1,toolCalls:c}];l.restoredToolCalls=u}}reconstructToolCallFromEvents(e,r){let{start:n,complete:o}=r;if(!n){ot.debug(this.ctx,`Tool call ${e} has no start event`);return}let s=n.data.toolName||"unknown",c=n.data.arguments,l="running",u,d,f,h,m;if(o){let A=o.data.success;o.data.status==="Cancelled"?l="cancelled":A?l="completed":l="error";let E=o.data.result;E&&(u=E.result,d=E.error,f=E.resultDetails,h=E.toolSpecificData,m=E.progressMessage)}let g={id:e,name:s,toolType:"default",status:l,input:c};return u&&(g.result=u),d&&(g.error=d),f&&(g.resultDetails=f),h&&(g.toolSpecificData=h),m&&(g.progressMessage=m),g}async buildPartitionFromTranscript(e,r){let n=await this.replayTranscriptToTurns(e,r);if(n.length===0&&(await this.readTranscriptFile(e,r)).length===0)return;let o=(r-1)*10+1;return{conversationId:e,partitionId:r,turns:n,status:"active",createdAt:n[0]?.timestamp??Date.now(),startTurnNumber:o,endTurnNumber:o+n.length-1,turnCount:n.length}}async findTurnInTranscripts(e,r){let n=await this.listPartitionTranscripts(e);if(n.length===0)return;let o=String(r);for(let s=n.length-1;s>=0;s--){let c=n[s];if(!(await this.readTranscriptFile(e,c)).some(h=>(h.type==="user.message"||h.type==="assistant.turn_end")&&h.data&&String(h.data.turnId)===o))continue;let d=await this.replayTranscriptToTurns(e,c),f=d.findIndex(h=>String(h.id)===o);if(f!==-1)return{partitionId:c,turnIndex:f};if(d.length>0){let h=d[d.length-1];return ot.info(this.ctx,`Turn ${o} referenced in partition ${c} events but not in replayed turns (split-turn from compression). Resolving to turn ${h.id}.`),{partitionId:c,turnIndex:d.length-1,resolvedTurnId:h.id}}}}async deriveMetadata(e){let r=await this.listPartitionTranscripts(e);if(r.length===0)return;let n=Math.max(...r),o=r.length,s=Date.now(),c=Math.min(...r),l=await this.readTranscriptFile(e,c);l.length>0&&(s=new Date(l[0].timestamp).getTime());let u=Date.now(),d=await this.readTranscriptFile(e,n);if(d.length>0){let h=d[d.length-1];u=new Date(h.timestamp).getTime()}let f=await this.listArchivedVersions(e);return{conversationId:e,currentPartitionId:n,totalPartitions:o,createdAt:s,lastActivity:u,archivedVersions:f.length>0?f:void 0}}async listArchivedVersions(e){if(!this.isEnabled())return[];try{let r=this.getConversationDirectory(e),n=await fw.promises.readdir(r),o=new Set;for(let s of n){let c=s.match(/partition-\d+\.v(\d+)\.jsonl$/);c&&o.add(parseInt(c[1],10))}return Array.from(o).sort((s,c)=>c-s)}catch(r){return r.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to list archived versions: ${r instanceof Error?r.message:String(r)}`),[])}}};function Axn(t,e,r=null,n){return{type:"user.message",data:{content:t,turnId:e,...n},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(Axn,"createUserMessageEvent");function yxn(t,e,r=null){return{type:"user.message_rendered",data:{turnId:t,renderedMessage:e},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(yxn,"createUserMessageRenderedEvent");function dXe(t,e,r=null,n){return{type:"assistant.message",data:{content:t,messageId:e,...n},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(dXe,"createAssistantMessageEvent");function Exn(t,e,r,n=null){return{type:"tool.execution_start",data:{toolCallId:t,toolName:e,arguments:r},id:Mt(),timestamp:new Date().toISOString(),parentId:n}}a(Exn,"createToolExecutionStartEvent");function _xn(t,e,r,n=null,o){return{type:"tool.execution_complete",data:{toolCallId:t,success:e,result:r,...o},id:Mt(),timestamp:new Date().toISOString(),parentId:n}}a(_xn,"createToolExecutionCompleteEvent");function fXe(t,e=null,r){return{type:"assistant.turn_start",data:{turnId:t,...r},id:Mt(),timestamp:new Date().toISOString(),parentId:e}}a(fXe,"createAssistantTurnStartEvent");function Jue(t,e,r=null,n){return{type:"assistant.turn_end",data:{turnId:t,status:e,...n},id:Mt(),timestamp:new Date().toISOString(),parentId:r}}a(Jue,"createAssistantTurnEndEvent");function gxn(t){try{let e=JSON.parse(t);if(Array.isArray(e)&&e.length>0&&typeof e[0]=="object"&&e[0]&&"role"in e[0])return e}catch{}return t}a(gxn,"parseAssistantMessageContent");var cF=class extends Error{constructor(r,n){super(r);this.code=n;this.name="RestorationError"}static{a(this,"RestorationError")}},HO=class{constructor(e){this.ctx=e;this.transcriptPersistence=new p0(e)}static{a(this,"ConversationRestoration")}async findTurnInPartitions(e,r){ot.debug(this.ctx,`Finding turn in partitions: conversationId=${e}, turnId=${r}`);let n=await this.transcriptPersistence.findTurnInTranscripts(e,r);if(n)return ot.debug(this.ctx,`Turn found in transcript: conversationId=${e}, turnId=${r}, partitionId=${n.partitionId}, turnIndex=${n.turnIndex}`),n;ot.debug(this.ctx,`Turn not found: conversationId=${e}, turnId=${r}`)}async loadPartitionForRestoration(e,r){ot.debug(this.ctx,`Loading partition for restoration: conversationId=${e}, partitionId=${r}`);let n=await this.transcriptPersistence.buildPartitionFromTranscript(e,r);if(!n){let o=new cF(`Partition not found: conversationId=${e}, partitionId=${r}`,"PARTITION_NOT_FOUND");throw ot.error(this.ctx,o.message),o}if(!Array.isArray(n.turns)){let o=new cF(`Invalid partition data: turns is not an array: conversationId=${e}, partitionId=${r}`,"INVALID_PARTITION_DATA");throw ot.error(this.ctx,o.message),o}return ot.debug(this.ctx,`Partition built from transcript: conversationId=${e}, partitionId=${r}, turnCount=${n.turns.length}`),n}async loadVersionedPartition(e,r,n){ot.debug(this.ctx,`Loading versioned partition: conversationId=${e}, partitionId=${r}, version=${n}`);let o=await this.transcriptPersistence.buildPartitionFromVersionedTranscript(e,r,n);if(!o){let s=new cF(`Versioned partition not found: conversationId=${e}, partitionId=${r}, version=${n}`,"PARTITION_NOT_FOUND");throw ot.error(this.ctx,s.message),s}if(!Array.isArray(o.turns)){let s=new cF("Invalid versioned partition data: turns is not an array","INVALID_PARTITION_DATA");throw ot.error(this.ctx,s.message),s}return o}reconstructTurns(e,r){let n=e.turns.findIndex(s=>s.id===r);if(n===-1)throw new cF(`Turn not found in partition: turnId=${r}, partitionId=${e.partitionId}`,"TURN_NOT_FOUND");let o=e.turns.slice(0,n+1);return ot.debug(this.ctx,`Reconstructed turns: partitionId=${e.partitionId}, targetTurnIndex=${n}, turnCount=${o.length}`),o.map(s=>this.ensureTurnInstance(s))}async isLatestTurn(e,r,n,o){if(n.partitionId!==o.currentPartitionId)return ot.debug(this.ctx,`Turn ${r} is not in current partition (in P${n.partitionId}, current is P${o.currentPartitionId})`),!1;let s=await this.transcriptPersistence.replayTranscriptToTurns(e,o.currentPartitionId);if(s.length===0)return!1;let c=s[s.length-1],l=c.id===r;return ot.debug(this.ctx,`Turn ${r} isLatest=${l} (last turn is ${c.id})`),l}async createVersionArchive(e,r,n,o){if(o.length===0)return r;ot.info(this.ctx,`Creating version archive: conversationId=${e}, versionTimestamp=${n}, partitions=${o.join(",")}`),await this.archiveTranscriptsAsVersion(e,o,n),ot.debug(this.ctx,`Archived ${o.length} transcript partitions with version ${n}`);for(let c of o)await this.transcriptPersistence.deleteTranscript(e,c);return{...r,archivedVersions:[...r.archivedVersions??[],n],lastActivity:Date.now()}}async archiveTranscriptsAsVersion(e,r,n){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.archiveTranscriptsAsVersion(e,r,n)}catch(o){ot.error(this.ctx,`Failed to archive transcripts: ${o instanceof Error?o.message:String(o)}`)}}async restoreConversation(e,r){let n=Date.now(),o=r;ot.debug(this.ctx,`Starting conversation restoration: conversationId=${e}, targetTurnId=${o}`),this.sendStartedTelemetry(e,o);try{let s=await this.transcriptPersistence.deriveMetadata(e);if(!s){let m=new cF(`No transcripts found for conversation: conversationId=${e}`,"CONVERSATION_NOT_FOUND");throw ot.error(this.ctx,m.message),this.sendFailedTelemetry(e,o,m.code,Date.now()-n),m}let c=await this.findTurnInPartitions(e,o);if(!c){ot.debug(this.ctx,`Turn not found for restoration: conversationId=${e}, targetTurnId=${o}`),this.sendFailedTelemetry(e,o,"TURN_NOT_FOUND",Date.now()-n);return}c.resolvedTurnId&&(ot.info(this.ctx,`Turn ${o} resolved to ${c.resolvedTurnId} in partition ${c.partitionId} (split-turn from compression)`),o=c.resolvedTurnId);let l=await this.isLatestTurn(e,o,c,s),u;if(!l){let m=Date.now(),A=(await this.transcriptPersistence.listPartitionTranscripts(e)).filter(y=>y>=c.partitionId);s=await this.createVersionArchive(e,s,m,A),u=m,ot.info(this.ctx,`Version created: conversationId=${e}, version=${m}`)}let d;u?d=await this.loadVersionedPartition(e,c.partitionId,u):d=await this.loadPartitionForRestoration(e,c.partitionId);let f=this.reconstructTurns(d,o);u&&(await this.rewritePartitionTranscriptFromVersion(e,c.partitionId,o,u),s={...s,currentPartitionId:c.partitionId,totalPartitions:c.partitionId,lastActivity:Date.now()});let h=Date.now()-n;return ot.info(this.ctx,`Conversation restored: conversationId=${e}, partitionId=${c.partitionId}, turnCount=${f.length}, versionCreated=${u??"none"}, duration=${h}ms`),this.sendCompletedTelemetry(e,o,c.partitionId,f.length,h),{partitionId:c.partitionId,turns:f,metadata:s,partition:d,versionCreated:u}}catch(s){throw s instanceof cF||(ot.exception(this.ctx,s,`Restoration failed: conversationId=${e}, targetTurnId=${o}`),this.sendFailedTelemetry(e,o,"UNKNOWN",Date.now()-n)),s}}ensureTurnInstance(e){if(e instanceof Xf)return e;let r=e,n=new Xf(r.request,r.id);return n.timestamp=r.timestamp??Date.now(),n.response=r.response,n.status=r.status??"success",n.skills=r.skills??[],n.ignoredSkills=r.ignoredSkills??[],n.annotations=r.annotations??[],n.workspaceFolder=r.workspaceFolder,n.workspaceFolders=r.workspaceFolders,n.agent=r.agent,n.template=r.template,n.confirmationRequest=r.confirmationRequest,n.confirmationResponse=r.confirmationResponse,n.chatMode=r.chatMode,n.needToolCallConfirmation=r.needToolCallConfirmation,n.userRequestedModel=r.userRequestedModel,n.resolvedModelConfiguration=r.resolvedModelConfiguration,n}async initializeRestoredTranscript(e,r){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.initializePartition(e,r,{source:"restoration"})}catch(n){ot.error(this.ctx,`Failed to initialize restored partition transcript: ${n instanceof Error?n.message:String(n)}`)}}sliceTranscriptEventsToTurn(e,r){let n=String(r),o=[],s=!1;for(let c of e){if(s&&c.type==="user.message"){let l=c.data.turnId;if(l!==void 0&&String(l)!==n)break}if(o.push(c),!s){if(c.type==="user.message"){let l=c.data.turnId;l!==void 0&&String(l)===n&&(s=!0)}else if(c.type==="partition.created"){let l=c.data.turnId;l!==void 0&&String(l)===n&&(s=!0)}}}return o}async rewritePartitionTranscriptFromVersion(e,r,n,o){if(this.transcriptPersistence.isEnabled())try{let s=await this.transcriptPersistence.readVersionedTranscriptFile(e,r,o);if(s.length===0){ot.warn(this.ctx,`No versioned transcript events found when rewriting: conversationId=${e}, partitionId=${r}, version=${o}`);return}let c=this.sliceTranscriptEventsToTurn(s,n);await this.transcriptPersistence.writeTranscriptFile(e,r,c)}catch(s){ot.error(this.ctx,`Failed to rewrite transcript from version: conversationId=${e}, partitionId=${r}, version=${o}, error=${s instanceof Error?s.message:String(s)}`)}}sendStartedTelemetry(e,r){let n=Wt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r)},{});Et(this.ctx,"conversationPartition.restoration.started",n,0)}sendCompletedTelemetry(e,r,n,o,s){let c=Wt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),partitionId:String(n)},{turnCount:o,restorationTimeMs:s});Et(this.ctx,"conversationPartition.restoration.completed",c,0)}sendFailedTelemetry(e,r,n,o){let s=Wt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),errorCode:n},{restorationTimeMs:o});Et(this.ctx,"conversationPartition.restoration.failed",s,0)}};p();p();p();p();var vxn={id:0,start_offset:0,stop_offset:0,type:"ip_code_citations",details:{},citations:{snippet:`html lang="en"> +`;await _w.promises.writeFile(o,c,{encoding:"utf8",mode:384}),ot.debug(this.ctx,`Wrote ${n.length} events to transcript: ${o}`)}catch(o){ot.error(this.ctx,`Failed to write transcript file: ${o instanceof Error?o.message:String(o)}`)}}getVersionedTranscriptFilePath(e,r,n){let o=this.getTranscriptDirectory();if(!o)throw new Error("Transcript directory not configured");return AJ.join(o,String(e),`partition-${r}.v${n}.jsonl`)}async readVersionedTranscriptFile(e,r,n){if(!this.isEnabled())return[];try{let o=this.getVersionedTranscriptFilePath(e,r,n);return(await _w.promises.readFile(o,"utf8")).trim().split(` +`).filter(l=>l.length>0).map(l=>JSON.parse(l))}catch(o){return o.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to read versioned transcript file: ${o instanceof Error?o.message:String(o)}`),[])}}async buildPartitionFromVersionedTranscript(e,r,n){let o=await this.readVersionedTranscriptFile(e,r,n);if(o.length===0)return;let s=[];for(let l of o)switch(l.type){case"user.message":{let u=l.data.content,d=l.data.turnId,f=new np({message:u,type:"user"},d);f.timestamp=new Date(l.timestamp).getTime(),s.push(f);break}case"assistant.message":{if(s.length>0){let u=s[s.length-1],d=l.data.content,f=Vwn(d);u.response={message:f,type:"model"}}break}case"assistant.turn_end":{if(s.length>0){let u=s[s.length-1];u.status==="in-progress"&&(u.status="success")}break}case"partition.created":{let u=l.data.summary;if(u&&l.data.compressedFrom){let d=new np({message:u,type:"meta"},l.data.turnId);d.timestamp=new Date(l.timestamp).getTime(),d.response={message:"",type:"model"},d.status="success",s.push(d)}break}case"user.message_rendered":{let u=l.data.turnId,d=l.data.renderedMessage;if(u&&d){for(let f=s.length-1;f>=0;f--)if(String(s[f].id)===u){s[f].renderedUserMessage=d;break}}break}case"tool.execution_start":case"tool.execution_complete":case"session.start":case"assistant.turn_start":break}let c=(r-1)*10+1;return{conversationId:e,partitionId:r,turns:s,status:"archived",createdAt:s[0]?.timestamp??Date.now(),startTurnNumber:c,endTurnNumber:c+s.length-1,turnCount:s.length}}async archiveTranscriptsAsVersion(e,r,n){if(this.isEnabled())for(let o of r)try{let s=this.getTranscriptFilePath(e,o),c=this.getVersionedTranscriptFilePath(e,o,n);try{await _w.promises.access(s)}catch{continue}await _w.promises.copyFile(s,c),ot.debug(this.ctx,`Archived transcript: ${s} -> ${c}`)}catch(s){ot.error(this.ctx,`Failed to archive transcript for partition ${o}: ${s instanceof Error?s.message:String(s)}`)}}async replayTranscriptToTurns(e,r,n){let o=await this.readTranscriptFile(e,r);if(o.length===0)return[];let s=[],c=!1,l=new Map,u=new Map;for(let d of o){if(c)break;switch(d.type){case"user.message":{let f=d.data.content,h=d.data.turnId,m=new np({message:f,type:"user"},h);m.timestamp=new Date(d.timestamp).getTime(),s.push(m),n!==void 0&&m.id===n&&(c=!0);break}case"assistant.message":{if(s.length>0){let f=s[s.length-1],h=d.data.content,m=Vwn(h);f.response={message:m,type:"model"}}break}case"assistant.turn_end":{if(s.length>0){let f=s[s.length-1];f.status==="in-progress"&&(f.status="success"),n!==void 0&&f.id===n&&(c=!0)}break}case"partition.created":{let f=d.data.summary;if(f&&d.data.compressedFrom){let h=new np({message:f,type:"meta"},d.data.turnId);h.timestamp=new Date(d.timestamp).getTime(),h.response={message:"",type:"model"},h.status="success",s.push(h)}break}case"tool.execution_start":{let f=d.data.toolCallId;if(f){let h=l.get(f)||{};h.start=d,l.set(f,h),s.length>0&&u.set(f,s.length-1)}break}case"tool.execution_complete":{let f=d.data.toolCallId;if(f){let h=l.get(f)||{};h.complete=d,l.set(f,h)}break}case"user.message_rendered":{let f=d.data.turnId,h=d.data.renderedMessage;if(f&&h){for(let m=s.length-1;m>=0;m--)if(String(s[m].id)===f){s[m].renderedUserMessage=h;break}}break}case"session.start":case"assistant.turn_start":break}}return this.reconstructToolCallsForTurns(s,l,u),ot.debug(this.ctx,`Replayed transcript: partitionId=${r}, events=${o.length}, turns=${s.length}`),s}reconstructToolCallsForTurns(e,r,n){let o=new Map;for(let[s,c]of r){let l=n.get(s);if(l===void 0){ot.debug(this.ctx,`Tool call ${s} has no associated turn`);continue}let u=this.reconstructToolCallFromEvents(s,c);if(u){let d=o.get(l)||[];d.push(u),o.set(l,d)}}for(let[s,c]of o)if(s0){let l=e[s],u=[{roundId:1,toolCalls:c}];l.restoredToolCalls=u}}reconstructToolCallFromEvents(e,r){let{start:n,complete:o}=r;if(!n){ot.debug(this.ctx,`Tool call ${e} has no start event`);return}let s=n.data.toolName||"unknown",c=n.data.arguments,l="running",u,d,f,h,m;if(o){let A=o.data.success;o.data.status==="Cancelled"?l="cancelled":A?l="completed":l="error";let E=o.data.result;E&&(u=E.result,d=E.error,f=E.resultDetails,h=E.toolSpecificData,m=E.progressMessage)}let g={id:e,name:s,toolType:"default",status:l,input:c};return u&&(g.result=u),d&&(g.error=d),f&&(g.resultDetails=f),h&&(g.toolSpecificData=h),m&&(g.progressMessage=m),g}async buildPartitionFromTranscript(e,r){let n=await this.replayTranscriptToTurns(e,r);if(n.length===0&&(await this.readTranscriptFile(e,r)).length===0)return;let o=(r-1)*10+1;return{conversationId:e,partitionId:r,turns:n,status:"active",createdAt:n[0]?.timestamp??Date.now(),startTurnNumber:o,endTurnNumber:o+n.length-1,turnCount:n.length}}async findTurnInTranscripts(e,r){let n=await this.listPartitionTranscripts(e);if(n.length===0)return;let o=String(r);for(let s=n.length-1;s>=0;s--){let c=n[s];if(!(await this.readTranscriptFile(e,c)).some(h=>(h.type==="user.message"||h.type==="assistant.turn_end")&&h.data&&String(h.data.turnId)===o))continue;let d=await this.replayTranscriptToTurns(e,c),f=d.findIndex(h=>String(h.id)===o);if(f!==-1)return{partitionId:c,turnIndex:f};if(d.length>0){let h=d[d.length-1];return ot.info(this.ctx,`Turn ${o} referenced in partition ${c} events but not in replayed turns (split-turn from compression). Resolving to turn ${h.id}.`),{partitionId:c,turnIndex:d.length-1,resolvedTurnId:h.id}}}}async deriveMetadata(e){let r=await this.listPartitionTranscripts(e);if(r.length===0)return;let n=Math.max(...r),o=r.length,s=Date.now(),c=Math.min(...r),l=await this.readTranscriptFile(e,c);l.length>0&&(s=new Date(l[0].timestamp).getTime());let u=Date.now(),d=await this.readTranscriptFile(e,n);if(d.length>0){let h=d[d.length-1];u=new Date(h.timestamp).getTime()}let f=await this.listArchivedVersions(e);return{conversationId:e,currentPartitionId:n,totalPartitions:o,createdAt:s,lastActivity:u,archivedVersions:f.length>0?f:void 0}}async listArchivedVersions(e){if(!this.isEnabled())return[];try{let r=this.getConversationDirectory(e),n=await _w.promises.readdir(r),o=new Set;for(let s of n){let c=s.match(/partition-\d+\.v(\d+)\.jsonl$/);c&&o.add(parseInt(c[1],10))}return Array.from(o).sort((s,c)=>c-s)}catch(r){return r.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to list archived versions: ${r instanceof Error?r.message:String(r)}`),[])}}};function Wwn(t,e,r=null,n){return{type:"user.message",data:{content:t,turnId:e,...n},id:Nt(),timestamp:new Date().toISOString(),parentId:r}}a(Wwn,"createUserMessageEvent");function zwn(t,e,r=null){return{type:"user.message_rendered",data:{turnId:t,renderedMessage:e},id:Nt(),timestamp:new Date().toISOString(),parentId:r}}a(zwn,"createUserMessageRenderedEvent");function UXe(t,e,r=null,n){return{type:"assistant.message",data:{content:t,messageId:e,...n},id:Nt(),timestamp:new Date().toISOString(),parentId:r}}a(UXe,"createAssistantMessageEvent");function Ywn(t,e,r,n=null){return{type:"tool.execution_start",data:{toolCallId:t,toolName:e,arguments:r},id:Nt(),timestamp:new Date().toISOString(),parentId:n}}a(Ywn,"createToolExecutionStartEvent");function Kwn(t,e,r,n=null,o){return{type:"tool.execution_complete",data:{toolCallId:t,success:e,result:r,...o},id:Nt(),timestamp:new Date().toISOString(),parentId:n}}a(Kwn,"createToolExecutionCompleteEvent");function QXe(t,e=null,r){return{type:"assistant.turn_start",data:{turnId:t,...r},id:Nt(),timestamp:new Date().toISOString(),parentId:e}}a(QXe,"createAssistantTurnStartEvent");function cde(t,e,r=null,n){return{type:"assistant.turn_end",data:{turnId:t,status:e,...n},id:Nt(),timestamp:new Date().toISOString(),parentId:r}}a(cde,"createAssistantTurnEndEvent");function Vwn(t){try{let e=JSON.parse(t);if(Array.isArray(e)&&e.length>0&&typeof e[0]=="object"&&e[0]&&"role"in e[0])return e}catch{}return t}a(Vwn,"parseAssistantMessageContent");var gF=class extends Error{constructor(r,n){super(r);this.code=n;this.name="RestorationError"}static{a(this,"RestorationError")}},YO=class{constructor(e){this.ctx=e;this.transcriptPersistence=new g0(e)}static{a(this,"ConversationRestoration")}async findTurnInPartitions(e,r){ot.debug(this.ctx,`Finding turn in partitions: conversationId=${e}, turnId=${r}`);let n=await this.transcriptPersistence.findTurnInTranscripts(e,r);if(n)return ot.debug(this.ctx,`Turn found in transcript: conversationId=${e}, turnId=${r}, partitionId=${n.partitionId}, turnIndex=${n.turnIndex}`),n;ot.debug(this.ctx,`Turn not found: conversationId=${e}, turnId=${r}`)}async loadPartitionForRestoration(e,r){ot.debug(this.ctx,`Loading partition for restoration: conversationId=${e}, partitionId=${r}`);let n=await this.transcriptPersistence.buildPartitionFromTranscript(e,r);if(!n){let o=new gF(`Partition not found: conversationId=${e}, partitionId=${r}`,"PARTITION_NOT_FOUND");throw ot.error(this.ctx,o.message),o}if(!Array.isArray(n.turns)){let o=new gF(`Invalid partition data: turns is not an array: conversationId=${e}, partitionId=${r}`,"INVALID_PARTITION_DATA");throw ot.error(this.ctx,o.message),o}return ot.debug(this.ctx,`Partition built from transcript: conversationId=${e}, partitionId=${r}, turnCount=${n.turns.length}`),n}async loadVersionedPartition(e,r,n){ot.debug(this.ctx,`Loading versioned partition: conversationId=${e}, partitionId=${r}, version=${n}`);let o=await this.transcriptPersistence.buildPartitionFromVersionedTranscript(e,r,n);if(!o){let s=new gF(`Versioned partition not found: conversationId=${e}, partitionId=${r}, version=${n}`,"PARTITION_NOT_FOUND");throw ot.error(this.ctx,s.message),s}if(!Array.isArray(o.turns)){let s=new gF("Invalid versioned partition data: turns is not an array","INVALID_PARTITION_DATA");throw ot.error(this.ctx,s.message),s}return o}reconstructTurns(e,r){let n=e.turns.findIndex(s=>s.id===r);if(n===-1)throw new gF(`Turn not found in partition: turnId=${r}, partitionId=${e.partitionId}`,"TURN_NOT_FOUND");let o=e.turns.slice(0,n+1);return ot.debug(this.ctx,`Reconstructed turns: partitionId=${e.partitionId}, targetTurnIndex=${n}, turnCount=${o.length}`),o.map(s=>this.ensureTurnInstance(s))}async isLatestTurn(e,r,n,o){if(n.partitionId!==o.currentPartitionId)return ot.debug(this.ctx,`Turn ${r} is not in current partition (in P${n.partitionId}, current is P${o.currentPartitionId})`),!1;let s=await this.transcriptPersistence.replayTranscriptToTurns(e,o.currentPartitionId);if(s.length===0)return!1;let c=s[s.length-1],l=c.id===r;return ot.debug(this.ctx,`Turn ${r} isLatest=${l} (last turn is ${c.id})`),l}async createVersionArchive(e,r,n,o){if(o.length===0)return r;ot.info(this.ctx,`Creating version archive: conversationId=${e}, versionTimestamp=${n}, partitions=${o.join(",")}`),await this.archiveTranscriptsAsVersion(e,o,n),ot.debug(this.ctx,`Archived ${o.length} transcript partitions with version ${n}`);for(let c of o)await this.transcriptPersistence.deleteTranscript(e,c);return{...r,archivedVersions:[...r.archivedVersions??[],n],lastActivity:Date.now()}}async archiveTranscriptsAsVersion(e,r,n){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.archiveTranscriptsAsVersion(e,r,n)}catch(o){ot.error(this.ctx,`Failed to archive transcripts: ${o instanceof Error?o.message:String(o)}`)}}async restoreConversation(e,r){let n=Date.now(),o=r;ot.debug(this.ctx,`Starting conversation restoration: conversationId=${e}, targetTurnId=${o}`),this.sendStartedTelemetry(e,o);try{let s=await this.transcriptPersistence.deriveMetadata(e);if(!s){let m=new gF(`No transcripts found for conversation: conversationId=${e}`,"CONVERSATION_NOT_FOUND");throw ot.error(this.ctx,m.message),this.sendFailedTelemetry(e,o,m.code,Date.now()-n),m}let c=await this.findTurnInPartitions(e,o);if(!c){ot.debug(this.ctx,`Turn not found for restoration: conversationId=${e}, targetTurnId=${o}`),this.sendFailedTelemetry(e,o,"TURN_NOT_FOUND",Date.now()-n);return}c.resolvedTurnId&&(ot.info(this.ctx,`Turn ${o} resolved to ${c.resolvedTurnId} in partition ${c.partitionId} (split-turn from compression)`),o=c.resolvedTurnId);let l=await this.isLatestTurn(e,o,c,s),u;if(!l){let m=Date.now(),A=(await this.transcriptPersistence.listPartitionTranscripts(e)).filter(y=>y>=c.partitionId);s=await this.createVersionArchive(e,s,m,A),u=m,ot.info(this.ctx,`Version created: conversationId=${e}, version=${m}`)}let d;u?d=await this.loadVersionedPartition(e,c.partitionId,u):d=await this.loadPartitionForRestoration(e,c.partitionId);let f=this.reconstructTurns(d,o);u&&(await this.rewritePartitionTranscriptFromVersion(e,c.partitionId,o,u),s={...s,currentPartitionId:c.partitionId,totalPartitions:c.partitionId,lastActivity:Date.now()});let h=Date.now()-n;return ot.info(this.ctx,`Conversation restored: conversationId=${e}, partitionId=${c.partitionId}, turnCount=${f.length}, versionCreated=${u??"none"}, duration=${h}ms`),this.sendCompletedTelemetry(e,o,c.partitionId,f.length,h),{partitionId:c.partitionId,turns:f,metadata:s,partition:d,versionCreated:u}}catch(s){throw s instanceof gF||(ot.exception(this.ctx,s,`Restoration failed: conversationId=${e}, targetTurnId=${o}`),this.sendFailedTelemetry(e,o,"UNKNOWN",Date.now()-n)),s}}ensureTurnInstance(e){if(e instanceof np)return e;let r=e,n=new np(r.request,r.id);return n.timestamp=r.timestamp??Date.now(),n.response=r.response,n.status=r.status??"success",n.skills=r.skills??[],n.ignoredSkills=r.ignoredSkills??[],n.annotations=r.annotations??[],n.workspaceFolder=r.workspaceFolder,n.workspaceFolders=r.workspaceFolders,n.agent=r.agent,n.template=r.template,n.confirmationRequest=r.confirmationRequest,n.confirmationResponse=r.confirmationResponse,n.chatMode=r.chatMode,n.needToolCallConfirmation=r.needToolCallConfirmation,n.userRequestedModel=r.userRequestedModel,n.resolvedModelConfiguration=r.resolvedModelConfiguration,n}async initializeRestoredTranscript(e,r){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.initializePartition(e,r,{source:"restoration"})}catch(n){ot.error(this.ctx,`Failed to initialize restored partition transcript: ${n instanceof Error?n.message:String(n)}`)}}sliceTranscriptEventsToTurn(e,r){let n=String(r),o=[],s=!1;for(let c of e){if(s&&c.type==="user.message"){let l=c.data.turnId;if(l!==void 0&&String(l)!==n)break}if(o.push(c),!s){if(c.type==="user.message"){let l=c.data.turnId;l!==void 0&&String(l)===n&&(s=!0)}else if(c.type==="partition.created"){let l=c.data.turnId;l!==void 0&&String(l)===n&&(s=!0)}}}return o}async rewritePartitionTranscriptFromVersion(e,r,n,o){if(this.transcriptPersistence.isEnabled())try{let s=await this.transcriptPersistence.readVersionedTranscriptFile(e,r,o);if(s.length===0){ot.warn(this.ctx,`No versioned transcript events found when rewriting: conversationId=${e}, partitionId=${r}, version=${o}`);return}let c=this.sliceTranscriptEventsToTurn(s,n);await this.transcriptPersistence.writeTranscriptFile(e,r,c)}catch(s){ot.error(this.ctx,`Failed to rewrite transcript from version: conversationId=${e}, partitionId=${r}, version=${o}, error=${s instanceof Error?s.message:String(s)}`)}}sendStartedTelemetry(e,r){let n=Vt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r)},{});ft(this.ctx,"conversationPartition.restoration.started",n,0)}sendCompletedTelemetry(e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),partitionId:String(n)},{turnCount:o,restorationTimeMs:s});ft(this.ctx,"conversationPartition.restoration.completed",c,0)}sendFailedTelemetry(e,r,n,o){let s=Vt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),errorCode:n},{restorationTimeMs:o});ft(this.ctx,"conversationPartition.restoration.failed",s,0)}};p();p();p();p();var Jwn={id:0,start_offset:0,stop_offset:0,type:"ip_code_citations",details:{},citations:{snippet:`html lang="en"> Canvas Example -<`,url:"https://github.com/duonghle285/gnoud9x.github.io/tree/c95127bc5b7a491d9223f21ac3b8c5100996e754/26062020-vehinhchunhat%2Findex.html",ip_type:"LICENSE",license:"NOASSERTION"}},Cxn="Alright, This response contains a code citation.";p();var bxn=` +<`,url:"https://github.com/duonghle285/gnoud9x.github.io/tree/c95127bc5b7a491d9223f21ac3b8c5100996e754/26062020-vehinhchunhat%2Findex.html",ip_type:"LICENSE",license:"NOASSERTION"}},Zwn="Alright, This response contains a code citation.";p();var Xwn=` # Should render ## Links @@ -3077,16 +3077,16 @@ Only img src/alt and a href attributes should make it to the dom. The following paragraph should not render the \`id\` attribute in the dom.

This is a paragraph with an id

-`;p();var Sxn="You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.",_Xo=95,vXo={agent:"agent_mode_limit_exceeded",overloaded:"model_overloaded",upstream:"upstream_provider_rate_limit",global:"user_global_rate_limited",model:"user_model_rate_limited",integration:"integration_rate_limited",unknown:"some_new_code"};function Txn(t){let e=t.match(/\b\d+\b/);return e?Number.parseInt(e[0],10):void 0}a(Txn,"parseFirstNumber");function CXo(t){return Math.min(100,Math.max(0,t))}a(CXo,"clampPercentage");function bXo(t){return t.includes("session")?"session":"weekly"}a(bXo,"getRateLimitNotificationKind");function SXo(t,e,r){let n=Wle(r);return t==="session"?`You've used ${e}% of your session rate limit. Your session rate limit will reset on ${n}.`:`You've used ${e}% of your weekly rate limit. Your weekly rate limit will reset on ${n}.`}a(SXo,"getRateLimitNotificationMessage");function TXo(t){return t.includes("agent")?"agent":t.includes("overloaded")?"overloaded":t.includes("upstream")?"upstream":t.includes("global")?"global":t.includes("model")?"model":t.includes("integration")?"integration":t.includes("unknown")?"unknown":"default"}a(TXo,"getRateLimitErrorVariant");var YGt=class{constructor(){this.id="debug.upgrade";this.description="upgrade for debugging purposes";this.shortDescription="upgrade";this.scopes=["chat-panel"]}static{a(this,"DebugUpgradePromptTemplate")}response(e){return new ih(Sxn,{message:"",code:402,responseIsIncomplete:!0,responseIsFiltered:!1})}},ZGt=new YGt,KGt=class{constructor(){this.id="debug.ratelimit.notify";this.description="Generate weekly or session rate limit notifications";this.shortDescription="RateLimit Notify";this.scopes=["chat-panel","inline"]}static{a(this,"DebugRateLimitNotificationPromptTemplate")}async response(e,r){let n=r.toLowerCase(),o=bXo(n),s=CXo(Txn(n)??_Xo),c=new Date(Date.now()+(o==="session"?3600*1e3:10080*60*1e3)).toISOString(),l=SXo(o,s,c);return await e.ctx.get(qS).notifyRateLimitWarning({type:o,rateLimit:{entitlement:100,percentRemaining:100-s,resetDate:c},message:l}),new ih("Alright, I'm producing a rate limit notification")}},XGt=new KGt,JGt=class{constructor(){this.id="debug.ratelimit.error";this.description="Generate 429 rate limit errors for agent, model, global, integration, or default cases";this.shortDescription="RateLimit Error";this.scopes=["chat-panel"]}static{a(this,"DebugRateLimitErrorPromptTemplate")}response(e,r){let n=r.toLowerCase(),o=TXo(n),s=Txn(n),c=$_.translateErrorMessage(429,void 0,void 0,s,void 0,{capiErrorCode:o==="default"?void 0:vXo[o],isAuto:n.includes("auto")});return new ih(c,{message:"",code:429,reason:"rate limit exceeded",retryAfter:s,responseIsIncomplete:!0,responseIsFiltered:!1})}},e$t=new JGt;p();function IXo(t,e,r){return{id:t,start_offset:e,stop_offset:r,type:"code_vulnerability",details:{type:"server-side-unvalidated-url-redirection",description:"Allows a URL to be redirected to a different URL that is specified by an external user.",ui_type:"test",ui_description:"test"}}}a(IXo,"createVulnerability");var xxn=wxe` +`;p();var eRn="You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.",Tts=95,Its={agent:"agent_mode_limit_exceeded",overloaded:"model_overloaded",upstream:"upstream_provider_rate_limit",global:"user_global_rate_limited",model:"user_model_rate_limited",integration:"integration_rate_limited",unknown:"some_new_code"};function tRn(t){let e=t.match(/\b\d+\b/);return e?Number.parseInt(e[0],10):void 0}a(tRn,"parseFirstNumber");function xts(t){return Math.min(100,Math.max(0,t))}a(xts,"clampPercentage");function wts(t){return t.includes("session")?"session":"weekly"}a(wts,"getRateLimitNotificationKind");function Rts(t,e,r){let n=nue(r);return t==="session"?`You've used ${e}% of your session rate limit. Your session rate limit will reset on ${n}.`:`You've used ${e}% of your weekly rate limit. Your weekly rate limit will reset on ${n}.`}a(Rts,"getRateLimitNotificationMessage");function kts(t){return t.includes("agent")?"agent":t.includes("overloaded")?"overloaded":t.includes("upstream")?"upstream":t.includes("global")?"global":t.includes("model")?"model":t.includes("integration")?"integration":t.includes("unknown")?"unknown":"default"}a(kts,"getRateLimitErrorVariant");var q$t=class{constructor(){this.id="debug.upgrade";this.description="upgrade for debugging purposes";this.shortDescription="upgrade";this.scopes=["chat-panel"]}static{a(this,"DebugUpgradePromptTemplate")}response(e){return new ah(eRn,{message:"",code:402,responseIsIncomplete:!0,responseIsFiltered:!1})}},G$t=new q$t,j$t=class{constructor(){this.id="debug.ratelimit.notify";this.description="Generate weekly or session rate limit notifications";this.shortDescription="RateLimit Notify";this.scopes=["chat-panel","inline"]}static{a(this,"DebugRateLimitNotificationPromptTemplate")}async response(e,r){let n=r.toLowerCase(),o=wts(n),s=xts(tRn(n)??Tts),c=new Date(Date.now()+(o==="session"?3600*1e3:10080*60*1e3)).toISOString(),l=Rts(o,s,c);return await e.ctx.get(zS).notifyRateLimitWarning({type:o,rateLimit:{entitlement:100,percentRemaining:100-s,resetDate:c},message:l}),new ah("Alright, I'm producing a rate limit notification")}},$$t=new j$t,H$t=class{constructor(){this.id="debug.ratelimit.error";this.description="Generate 429 rate limit errors for agent, model, global, integration, or default cases";this.shortDescription="RateLimit Error";this.scopes=["chat-panel"]}static{a(this,"DebugRateLimitErrorPromptTemplate")}response(e,r){let n=r.toLowerCase(),o=kts(n),s=tRn(n),c=Y_.translateErrorMessage(429,void 0,void 0,s,void 0,{capiErrorCode:o==="default"?void 0:Its[o],isAuto:n.includes("auto")});return new ah(c,{message:"",code:429,reason:"rate limit exceeded",retryAfter:s,responseIsIncomplete:!0,responseIsFiltered:!1})}},V$t=new H$t;p();function Pts(t,e,r){return{id:t,start_offset:e,stop_offset:r,type:"code_vulnerability",details:{type:"server-side-unvalidated-url-redirection",description:"Allows a URL to be redirected to a different URL that is specified by an external user.",ui_type:"test",ui_description:"test"}}}a(Pts,"createVulnerability");var nRn=zxe` Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. -`,pXe=wxe` +`,qXe=zxe` \`\`\`kotlin fun main() { println("Hello, World!") } \`\`\` -`,xXo=wxe` +`,Dts=zxe` ### Inputs \`p\` - paragraph message @@ -3102,20 +3102,20 @@ The following paragraph should not render the \`id\` attribute in the dom. \`/debug.vulnerability pcc2\` - 1 paragraph followed by 2 code blocks with 2 vulnerabilities each \`/debug.vulnerability cpc3\` - 1 code block followed by 1 paragraph followed by 1 code block--each code block has 3 vulnerabilities -`,t$t=` +`,W$t=` -`,Ixn=xxn+t$t+pXe;function wxn(t){let e=1,r="",n=[];if(t.length===0)r=Ixn;else if(t==="0")r=Ixn,e=0;else{if(t==="help")return{reply:xXo,vulnerabilities:[]};{let o=t.slice(-1);isNaN(Number(o))||(e=Number(o),t=t.slice(0,-1));for(let s of t)s==="p"?r+=xxn+t$t:s==="c"&&(r+=pXe+t$t);r=r.trimEnd()}}if(e>0){let o=0,s=0;for(;;){let c=r.indexOf(pXe,o);if(c===-1)break;let l=c+pXe.length;for(let u=0;u0?r:"Debug Fail")}},RXo=new r$t,n$t=class{constructor(){this.id="debug.notify";this.description="Notify for debugging purposes";this.shortDescription="Notify";this.scopes=["chat-panel","inline"]}static{a(this,"DebugNotificationPromptTemplate")}response(e,r){let n="warning";r.includes("info")&&(n="info");let o=r.replace("info","").replace("warning","").trim(),s=[{severity:n,message:o.length>0?o:"Debug Notification"}];return new ih("Alright, I'm producing a notification",void 0,[],s)}},kXo=new n$t,i$t=class{constructor(){this.id="debug.filter";this.description="Make the RAI filter kick in";this.shortDescription="RAI Filter";this.scopes=["chat-panel"]}static{a(this,"DebugFilterPromptTemplate")}response(e){return e.turn.status="filtered",new ih(wXo,{message:"",responseIsFiltered:!0,responseIsIncomplete:!1})}},PXo=new i$t,o$t=class{constructor(){this.id="debug.dump";this.description="Dump the conversation";this.shortDescription="Dump";this.scopes=["chat-panel"]}static{a(this,"DebugDumpPromptTemplate")}async response(e){return new ih(await M_n(e))}},DXo=new o$t,s$t=class{constructor(){this.id="debug.tree";this.description="Jingle bells, jingle bells, jingle all the way";this.shortDescription="Christmas Tree";this.scopes=["chat-panel"]}static{a(this,"DebugChristmasTreePromptTemplate")}requiredSkills(){return[GP,lE]}instructions(e,r){return"Create a function that prints a christmas tree"}},NXo=new s$t,a$t=class{constructor(){this.id="debug.echo";this.description="Echo the user message back to the user";this.shortDescription="Echo";this.scopes=["chat-panel"]}static{a(this,"DebugEchoPromptTemplate")}response(e){return new ih(Pn(e.turn.request.message))}},MXo=new a$t,c$t=class{constructor(){this.id="debug.prompt";this.description="Show the prompt for the last response or generate a new one";this.shortDescription="Prompt";this.scopes=["chat-panel"]}static{a(this,"DebugPromptPromptTemplate")}response(e,r){let n=e.ctx.get(Ag).getLastTurnPrompts();if(n!==void 0&&n.size>0){let o="Here are the prompts used in the last turn:";return n.forEach((s,c)=>{o+=is` +`,rRn=nRn+W$t+qXe;function iRn(t){let e=1,r="",n=[];if(t.length===0)r=rRn;else if(t==="0")r=rRn,e=0;else{if(t==="help")return{reply:Dts,vulnerabilities:[]};{let o=t.slice(-1);isNaN(Number(o))||(e=Number(o),t=t.slice(0,-1));for(let s of t)s==="p"?r+=nRn+W$t:s==="c"&&(r+=qXe+W$t);r=r.trimEnd()}}if(e>0){let o=0,s=0;for(;;){let c=r.indexOf(qXe,o);if(c===-1)break;let l=c+qXe.length;for(let u=0;u0?r:"Debug Fail")}},Mts=new z$t,Y$t=class{constructor(){this.id="debug.notify";this.description="Notify for debugging purposes";this.shortDescription="Notify";this.scopes=["chat-panel","inline"]}static{a(this,"DebugNotificationPromptTemplate")}response(e,r){let n="warning";r.includes("info")&&(n="info");let o=r.replace("info","").replace("warning","").trim(),s=[{severity:n,message:o.length>0?o:"Debug Notification"}];return new ah("Alright, I'm producing a notification",void 0,[],s)}},Ots=new Y$t,K$t=class{constructor(){this.id="debug.filter";this.description="Make the RAI filter kick in";this.shortDescription="RAI Filter";this.scopes=["chat-panel"]}static{a(this,"DebugFilterPromptTemplate")}response(e){return e.turn.status="filtered",new ah(Nts,{message:"",responseIsFiltered:!0,responseIsIncomplete:!1})}},Lts=new K$t,J$t=class{constructor(){this.id="debug.dump";this.description="Dump the conversation";this.shortDescription="Dump";this.scopes=["chat-panel"]}static{a(this,"DebugDumpPromptTemplate")}async response(e){return new ah(await uCn(e))}},Bts=new J$t,Z$t=class{constructor(){this.id="debug.tree";this.description="Jingle bells, jingle bells, jingle all the way";this.shortDescription="Christmas Tree";this.scopes=["chat-panel"]}static{a(this,"DebugChristmasTreePromptTemplate")}requiredSkills(){return[XP,hE]}instructions(e,r){return"Create a function that prints a christmas tree"}},Fts=new Z$t,X$t=class{constructor(){this.id="debug.echo";this.description="Echo the user message back to the user";this.shortDescription="Echo";this.scopes=["chat-panel"]}static{a(this,"DebugEchoPromptTemplate")}response(e){return new ah(Pn(e.turn.request.message))}},Uts=new X$t,eVt=class{constructor(){this.id="debug.prompt";this.description="Show the prompt for the last response or generate a new one";this.shortDescription="Prompt";this.scopes=["chat-panel"]}static{a(this,"DebugPromptPromptTemplate")}response(e,r){let n=e.ctx.get(vg).getLastTurnPrompts();if(n!==void 0&&n.size>0){let o="Here are the prompts used in the last turn:";return n.forEach((s,c)=>{o+=ns` ### ${c} prompt \`\`\`\` ${s} \`\`\`\` - `}),new ih(o)}return new ih("No prompt available")}},OXo=new c$t,l$t=class{constructor(){this.id="debug.skills";this.description="Resolves and displays all available skills or a single skill (id) if provided";this.shortDescription="Skills";this.scopes=["chat-panel"]}static{a(this,"DebugSkillsPromptTemplate")}async response(e,r,n){let o,s;if(r.length>0){let c=r.split(" ");o=c[0],s=c.slice(1).join(" ")}return e.turn.request.message=s??"",new ih(await O_n(e,n,o))}},LXo=new l$t,u$t=class{constructor(){this.id="debug.vulnerability";this.description="Create a message with a vulnerability annotation";this.shortDescription="Vulnerability";this.scopes=["chat-panel"]}static{a(this,"DebugVulnerabilityPromptTemplate")}response(e,r){let{reply:n,vulnerabilities:o}=wxn(r);return e.turn.annotations.push(...o),new ih(n,void 0,e.turn.annotations)}},BXo=new u$t,d$t=class{constructor(){this.id="debug.citation";this.description="Create a message with a code citation annotation";this.shortDescription="CodeCitation";this.scopes=["chat-panel"]}static{a(this,"DebugCodeCitationPromptTemplate")}response(e){return e.turn.annotations.push(vxn),new ih(Cxn,void 0,e.turn.annotations)}},FXo=new d$t,f$t=class{constructor(){this.id="debug.markdown";this.description="Markdown rendering specification by example";this.shortDescription="Markdown";this.scopes=["chat-panel","inline"]}static{a(this,"DebugMarkdownRenderingPromptTemplate")}response(){return new ih(bxn)}},UXo=new f$t,p$t=class{constructor(){this.id="debug.long";this.description="Generate a long response";this.shortDescription="Long";this.scopes=["chat-panel"]}static{a(this,"DebugLongPromptTemplate")}instructions(e,r){return"Write out the OWASP top 10 with code examples in java"}},QXo=new p$t,h$t=class{constructor(){this.id="debug.project";this.description="Generate a response using the project context skill";this.shortDescription="Project";this.scopes=["chat-panel","inline"]}static{a(this,"DebugProjectContextPromptTemplate")}requiredSkills(){return[Kue]}},qXo=new h$t,m$t=class{constructor(){this.id="debug.confirmation";this.description="Generate a response with a confirmation";this.shortDescription="Confirmation";this.scopes=["chat-panel","inline"]}static{a(this,"DebugConfirmationPromptTemplate")}response(){let e={type:"action",title:"Confirmation that you want to proceed",message:"Do you want to proceed?",agentSlug:"debug.confirmation",confirmation:{answer:"yes"}};return new ih("Alright, I'm producing a notification",void 0,[],[],[],e)}},jXo=new m$t;function Rxn(){return[RXo,ZGt,XGt,e$t,kXo,PXo,NXo,DXo,MXo,OXo,LXo,BXo,FXo,jXo,UXo,QXo,qXo]}a(Rxn,"getDebugTemplates");p();var kxn=S.Object({uri:S.String(),problems:S.Array(S.Object({message:S.String(),range:Sf}))}),g$t=class{constructor(e){this.turnContext=e}static{a(this,"ProblemsInActiveDocumentSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ii),n=await r.getOrReadTextDocument(e);if(await this.turnContext.collectFile(Qq,e.uri,td(n)),n.status==="valid"){let o=r.getRelativePath(n.document);this.turnContext.collectLabel(Qq,`problems in ${o}`);let s=this.getElidableProblems(e,n,o);return await this.preElideDocuments(s)}else this.turnContext.collectLabel(Qq,"problem markers")}getElidableProblems(e,r,n){let o=[];return o.push(new Ar([`Problems and errors in the active document (\`${n}\`):`])),o.push(...this.createElidableProblems(e,r)),Cq(o,"linear")}createElidableProblems(e,r){return e.problems.map(n=>{let o=[];o.push(new Ar([`- "${n.message}" at line ${n.range.start.line}.`+(r.document?" Excerpt from the code:":"")]));let s=n.range,c;if(s&&(this.isEmpty(s)?c=r.document.lineAt(s.start).text:c=r.document.getText(s),c)){let l=r.document.detectedLanguageId;o.push(new Ar([["```"+l,1],[PS(c),.8],["```",1]]))}return new Ar(o)})}isEmpty(e){return e.start.line===e.end.line&&e.start.character===e.end.character}async preElideDocuments(e){let r=(await xo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},Qq="problems-in-active-document",hXe=class extends gg{static{a(this,"ProblemsInActiveDocumentSkill")}constructor(e){super(Qq,"List of problems and errors in the active document, useful when the user question is about finding and fixing errors, non-functioning code, compilation issues, etc.","Analyzing problems and errors",()=>e,r=>new g$t(r),"explicit",["How can I fix the errors?","Why is my app not working?","Why am I getting compilation errors?","Raw error messages or stack traces"])}};p();p();var mXe=class{constructor(e){this.turnContext=e}static{a(this,"PromptForTestGeneration")}async fromImplementationFile(e){let r=this.turnContext.ctx.get($r).getWorkspaceFolder(e),n=this.fileExistFn(),o=new Wxe(this.turnContext.ctx,n,r?.uri),s=await o.findTestFileForSourceFile(e.uri),c=zxe(e.uri);if(s&&!c){let l=e.detectedLanguageId;if(await n(s))return await this.asTestFilePrompt(l,s);{let u=o.findExampleTestFile(e.uri);if(u)return await this.asExampleFilePrompt(l,u)}}}async fromTestFile(e){if(!zxe(e))return;let n=this.turnContext.ctx.get($r).getWorkspaceFolder(e),o=this.fileExistFn(),c=await new Wxe(this.turnContext.ctx,o,n?.uri).findImplFileForTestFile(e.uri);if(c){let l=e.detectedLanguageId;if(await o(c))return await this.asImplFilePrompt(l,c)}}async asImplFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new Ar([[`${HXo} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async asTestFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new Ar([[`${GXo} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async asExampleFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new Ar([[`${$Xo} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async fileInfoForPrompt(e){if(!this.turnContext.isFileIncluded(e)){let r=this.turnContext.ctx.get(ii),n=await r.getOrReadTextDocument({uri:e});if(await this.turnContext.collectFile(r2,e,td(n)),n.status==="valid"){let o=r.getRelativePath(n.document);return[PS(n.document.getText()),o]}}}fileExistFn(){return async e=>{try{return await this.turnContext.ctx.get(Qo).stat(e),!0}catch{return!1}}}},HXo="Code excerpt from the implementation source file",GXo="Code excerpt from the test file",$Xo="Code excerpt from an example test file";var Pxn=S.Object({currentFileUri:S.String(),sourceFileUri:S.Optional(S.String()),testFileUri:S.Optional(S.String())}),A$t=class{constructor(e){this.turnContext=e}static{a(this,"TestContextSkillProcessor")}value(){return .9}async processSkill(e){let r=this.turnContext.ctx.get(ii),n=new mXe(this.turnContext);if(e.sourceFileUri&&e.testFileUri){if(e.sourceFileUri!==e.currentFileUri&&e.testFileUri!==e.currentFileUri)return;if(e.testFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.testFileUri});if(await this.turnContext.collectFile(r2,e.testFileUri,td(o)),o.status==="valid")return await n.asImplFilePrompt(o.document.detectedLanguageId,e.sourceFileUri)}else if(e.sourceFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.sourceFileUri});if(await this.turnContext.collectFile(r2,e.sourceFileUri,td(o)),o.status==="valid")return await n.asTestFilePrompt(o.document.detectedLanguageId,e.testFileUri)}}else if(e.sourceFileUri&&e.sourceFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.sourceFileUri});if(await this.turnContext.collectFile(r2,e.sourceFileUri,td(o)),o.status==="valid")return await n.fromImplementationFile(o.document)}else if(e.testFileUri&&e.testFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.testFileUri});if(await this.turnContext.collectFile(r2,e.testFileUri,td(o)),o.status==="valid")return await n.fromTestFile(o.document)}}},r2="test-context",gXe=class extends gg{static{a(this,"TestContextSkill")}constructor(e){super(r2,"Example tests useful for creating, adding and fixing tests, to detect available test frameworks as well as finding the corresponding implementation to existing tests","Searching test examples",()=>e,r=>new A$t(r))}};p();var Dxn=S.Object({failures:S.Array(S.Object({testName:S.String(),testSuite:S.Optional(S.String()),testFileUri:S.String(),failureReason:S.Optional(S.String()),testLocation:Sf}))}),y$t=class{constructor(e){this.turnContext=e}static{a(this,"TestFailuresSkillProcessor")}value(){return .9}async processSkill(e){if(e.failures.length>0){this.turnContext.collectLabel(cJ,"test failures");let r=await this.createElidableFailures(e.failures);if(r){let n=new Ar(["The latest test run produced the following failures and errors:"]);return new Ar([[n,1],[r,1]])}}}async createElidableFailures(e){let r=this.turnContext.ctx.get(ii),n=[],o=this.groupFailuresByFile(e);for(let[s,c]of o.entries()){let l=await r.getOrReadTextDocument({uri:s});if(await this.turnContext.collectFile(cJ,s,td(l)),l.status==="valid"){let u=r.getRelativePath(l.document),d=this.createElidableFailuresOfDoc(c,u),f=this.appendCode(d,u,l.document);n.push([f,1])}}if(n.length>0)return new Ar(n)}groupFailuresByFile(e){let r=new Map;for(let n of e){let o=r.get(n.testFileUri)||[];o.push(n),r.set(n.testFileUri,o)}return r}createElidableFailuresOfDoc(e,r){let n=e.map(o=>{let s=`\`${o.testName}\``,c=`${o.testSuite?` in suite \`${o.testSuite}\``:""}`,l=` in file \`${r}\` `,u=". ";o.failureReason&&(u=" with the following error:",o.failureReason.includes(` -`)?u+="\n```\n"+o.failureReason+"\n```\n":u+=` \`${o.failureReason}\`. `);let d=`${o.testLocation.start.line==o.testLocation.end.line?"on line "+o.testLocation.start.line:"between lines "+o.testLocation.start.line+" and "+o.testLocation.end.line}`;return[new Ar([is`\n\n- Test ${s}${c}${l}failed${u}The failed test is ${d}.\n`]),1]});return new Ar(n)}appendCode(e,r,n){let o=[new Ar([` + `}),new ah(o)}return new ah("No prompt available")}},Qts=new eVt,tVt=class{constructor(){this.id="debug.skills";this.description="Resolves and displays all available skills or a single skill (id) if provided";this.shortDescription="Skills";this.scopes=["chat-panel"]}static{a(this,"DebugSkillsPromptTemplate")}async response(e,r,n){let o,s;if(r.length>0){let c=r.split(" ");o=c[0],s=c.slice(1).join(" ")}return e.turn.request.message=s??"",new ah(await dCn(e,n,o))}},qts=new tVt,rVt=class{constructor(){this.id="debug.vulnerability";this.description="Create a message with a vulnerability annotation";this.shortDescription="Vulnerability";this.scopes=["chat-panel"]}static{a(this,"DebugVulnerabilityPromptTemplate")}response(e,r){let{reply:n,vulnerabilities:o}=iRn(r);return e.turn.annotations.push(...o),new ah(n,void 0,e.turn.annotations)}},jts=new rVt,nVt=class{constructor(){this.id="debug.citation";this.description="Create a message with a code citation annotation";this.shortDescription="CodeCitation";this.scopes=["chat-panel"]}static{a(this,"DebugCodeCitationPromptTemplate")}response(e){return e.turn.annotations.push(Jwn),new ah(Zwn,void 0,e.turn.annotations)}},Hts=new nVt,iVt=class{constructor(){this.id="debug.markdown";this.description="Markdown rendering specification by example";this.shortDescription="Markdown";this.scopes=["chat-panel","inline"]}static{a(this,"DebugMarkdownRenderingPromptTemplate")}response(){return new ah(Xwn)}},Gts=new iVt,oVt=class{constructor(){this.id="debug.long";this.description="Generate a long response";this.shortDescription="Long";this.scopes=["chat-panel"]}static{a(this,"DebugLongPromptTemplate")}instructions(e,r){return"Write out the OWASP top 10 with code examples in java"}},$ts=new oVt,sVt=class{constructor(){this.id="debug.project";this.description="Generate a response using the project context skill";this.shortDescription="Project";this.scopes=["chat-panel","inline"]}static{a(this,"DebugProjectContextPromptTemplate")}requiredSkills(){return[ade]}},Vts=new sVt,aVt=class{constructor(){this.id="debug.confirmation";this.description="Generate a response with a confirmation";this.shortDescription="Confirmation";this.scopes=["chat-panel","inline"]}static{a(this,"DebugConfirmationPromptTemplate")}response(){let e={type:"action",title:"Confirmation that you want to proceed",message:"Do you want to proceed?",agentSlug:"debug.confirmation",confirmation:{answer:"yes"}};return new ah("Alright, I'm producing a notification",void 0,[],[],[],e)}},Wts=new aVt;function oRn(){return[Mts,G$t,$$t,V$t,Ots,Lts,Fts,Bts,Uts,Qts,qts,jts,Hts,Wts,Gts,$ts,Vts]}a(oRn,"getDebugTemplates");p();var sRn=S.Object({uri:S.String(),problems:S.Array(S.Object({message:S.String(),range:Rf}))}),cVt=class{constructor(e){this.turnContext=e}static{a(this,"ProblemsInActiveDocumentSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ni),n=await r.getOrReadTextDocument(e);if(await this.turnContext.collectFile(Xq,e.uri,id(n)),n.status==="valid"){let o=r.getRelativePath(n.document);this.turnContext.collectLabel(Xq,`problems in ${o}`);let s=this.getElidableProblems(e,n,o);return await this.preElideDocuments(s)}else this.turnContext.collectLabel(Xq,"problem markers")}getElidableProblems(e,r,n){let o=[];return o.push(new Ar([`Problems and errors in the active document (\`${n}\`):`])),o.push(...this.createElidableProblems(e,r)),Oq(o,"linear")}createElidableProblems(e,r){return e.problems.map(n=>{let o=[];o.push(new Ar([`- "${n.message}" at line ${n.range.start.line}.`+(r.document?" Excerpt from the code:":"")]));let s=n.range,c;if(s&&(this.isEmpty(s)?c=r.document.lineAt(s.start).text:c=r.document.getText(s),c)){let l=r.document.detectedLanguageId;o.push(new Ar([["```"+l,1],[LS(c),.8],["```",1]]))}return new Ar(o)})}isEmpty(e){return e.start.line===e.end.line&&e.start.character===e.end.character}async preElideDocuments(e){let r=(await xo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},Xq="problems-in-active-document",jXe=class extends _g{static{a(this,"ProblemsInActiveDocumentSkill")}constructor(e){super(Xq,"List of problems and errors in the active document, useful when the user question is about finding and fixing errors, non-functioning code, compilation issues, etc.","Analyzing problems and errors",()=>e,r=>new cVt(r),"explicit",["How can I fix the errors?","Why is my app not working?","Why am I getting compilation errors?","Raw error messages or stack traces"])}};p();p();var HXe=class{constructor(e){this.turnContext=e}static{a(this,"PromptForTestGeneration")}async fromImplementationFile(e){let r=this.turnContext.ctx.get($r).getWorkspaceFolder(e),n=this.fileExistFn(),o=new fwe(this.turnContext.ctx,n,r?.uri),s=await o.findTestFileForSourceFile(e.uri),c=pwe(e.uri);if(s&&!c){let l=e.detectedLanguageId;if(await n(s))return await this.asTestFilePrompt(l,s);{let u=o.findExampleTestFile(e.uri);if(u)return await this.asExampleFilePrompt(l,u)}}}async fromTestFile(e){if(!pwe(e))return;let n=this.turnContext.ctx.get($r).getWorkspaceFolder(e),o=this.fileExistFn(),c=await new fwe(this.turnContext.ctx,o,n?.uri).findImplFileForTestFile(e.uri);if(c){let l=e.detectedLanguageId;if(await o(c))return await this.asImplFilePrompt(l,c)}}async asImplFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new Ar([[`${zts} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async asTestFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new Ar([[`${Yts} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async asExampleFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new Ar([[`${Kts} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async fileInfoForPrompt(e){if(!this.turnContext.isFileIncluded(e)){let r=this.turnContext.ctx.get(ni),n=await r.getOrReadTextDocument({uri:e});if(await this.turnContext.collectFile(u2,e,id(n)),n.status==="valid"){let o=r.getRelativePath(n.document);return[LS(n.document.getText()),o]}}}fileExistFn(){return async e=>{try{return await this.turnContext.ctx.get(Qo).stat(e),!0}catch{return!1}}}},zts="Code excerpt from the implementation source file",Yts="Code excerpt from the test file",Kts="Code excerpt from an example test file";var aRn=S.Object({currentFileUri:S.String(),sourceFileUri:S.Optional(S.String()),testFileUri:S.Optional(S.String())}),lVt=class{constructor(e){this.turnContext=e}static{a(this,"TestContextSkillProcessor")}value(){return .9}async processSkill(e){let r=this.turnContext.ctx.get(ni),n=new HXe(this.turnContext);if(e.sourceFileUri&&e.testFileUri){if(e.sourceFileUri!==e.currentFileUri&&e.testFileUri!==e.currentFileUri)return;if(e.testFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.testFileUri});if(await this.turnContext.collectFile(u2,e.testFileUri,id(o)),o.status==="valid")return await n.asImplFilePrompt(o.document.detectedLanguageId,e.sourceFileUri)}else if(e.sourceFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.sourceFileUri});if(await this.turnContext.collectFile(u2,e.sourceFileUri,id(o)),o.status==="valid")return await n.asTestFilePrompt(o.document.detectedLanguageId,e.testFileUri)}}else if(e.sourceFileUri&&e.sourceFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.sourceFileUri});if(await this.turnContext.collectFile(u2,e.sourceFileUri,id(o)),o.status==="valid")return await n.fromImplementationFile(o.document)}else if(e.testFileUri&&e.testFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.testFileUri});if(await this.turnContext.collectFile(u2,e.testFileUri,id(o)),o.status==="valid")return await n.fromTestFile(o.document)}}},u2="test-context",GXe=class extends _g{static{a(this,"TestContextSkill")}constructor(e){super(u2,"Example tests useful for creating, adding and fixing tests, to detect available test frameworks as well as finding the corresponding implementation to existing tests","Searching test examples",()=>e,r=>new lVt(r))}};p();var cRn=S.Object({failures:S.Array(S.Object({testName:S.String(),testSuite:S.Optional(S.String()),testFileUri:S.String(),failureReason:S.Optional(S.String()),testLocation:Rf}))}),uVt=class{constructor(e){this.turnContext=e}static{a(this,"TestFailuresSkillProcessor")}value(){return .9}async processSkill(e){if(e.failures.length>0){this.turnContext.collectLabel(yJ,"test failures");let r=await this.createElidableFailures(e.failures);if(r){let n=new Ar(["The latest test run produced the following failures and errors:"]);return new Ar([[n,1],[r,1]])}}}async createElidableFailures(e){let r=this.turnContext.ctx.get(ni),n=[],o=this.groupFailuresByFile(e);for(let[s,c]of o.entries()){let l=await r.getOrReadTextDocument({uri:s});if(await this.turnContext.collectFile(yJ,s,id(l)),l.status==="valid"){let u=r.getRelativePath(l.document),d=this.createElidableFailuresOfDoc(c,u),f=this.appendCode(d,u,l.document);n.push([f,1])}}if(n.length>0)return new Ar(n)}groupFailuresByFile(e){let r=new Map;for(let n of e){let o=r.get(n.testFileUri)||[];o.push(n),r.set(n.testFileUri,o)}return r}createElidableFailuresOfDoc(e,r){let n=e.map(o=>{let s=`\`${o.testName}\``,c=`${o.testSuite?` in suite \`${o.testSuite}\``:""}`,l=` in file \`${r}\` `,u=". ";o.failureReason&&(u=" with the following error:",o.failureReason.includes(` +`)?u+="\n```\n"+o.failureReason+"\n```\n":u+=` \`${o.failureReason}\`. `);let d=`${o.testLocation.start.line==o.testLocation.end.line?"on line "+o.testLocation.start.line:"between lines "+o.testLocation.start.line+" and "+o.testLocation.end.line}`;return[new Ar([ns`\n\n- Test ${s}${c}${l}failed${u}The failed test is ${d}.\n`]),1]});return new Ar(n)}appendCode(e,r,n){let o=[new Ar([` The code of file \`${r}\` is: -`]),.6],s=[new Ar([["```"+n.detectedLanguageId,1],[PS(n.getText()),.9],["```",1]]),.7];return new Ar([[e,1],o,s])}},cJ="test-failures",AXe=class extends gg{static{a(this,"TestFailuresSkill")}constructor(e){super(cJ,"Test failures and errors of the latest test run","Collecting test failures",()=>e,r=>new y$t(r))}};var ih=class{constructor(e,r,n=[],o=[],s=[],c){this.message=e;this.error=r;this.annotations=n;this.notifications=o;this.references=s;this.confirmationRequest=c}static{a(this,"PromptTemplateResponse")}},pw=class{constructor(e,r,n,o,s=[],c=[],l,u=!1){this.id=e;this.description=r;this.shortDescription=n;this.prompt=o;this.skills=s;this.scopes=c;this.inlinePrompt=l;this.producesCodeEdits=u}static{a(this,"StaticPromptTemplate")}instructions(e,r,n="panel"){let o;return n==="inline"?o=this.inlinePrompt??this.prompt:o=this.prompt,o+` -`+r}requiredSkills(){return this.skills}},VXo=new pw("tests","Generate unit tests","Generate Tests",is` +`]),.6],s=[new Ar([["```"+n.detectedLanguageId,1],[LS(n.getText()),.9],["```",1]]),.7];return new Ar([[e,1],o,s])}},yJ="test-failures",$Xe=class extends _g{static{a(this,"TestFailuresSkill")}constructor(e){super(yJ,"Test failures and errors of the latest test run","Collecting test failures",()=>e,r=>new uVt(r))}};var ah=class{constructor(e,r,n=[],o=[],s=[],c){this.message=e;this.error=r;this.annotations=n;this.notifications=o;this.references=s;this.confirmationRequest=c}static{a(this,"PromptTemplateResponse")}},vw=class{constructor(e,r,n,o,s=[],c=[],l,u=!1){this.id=e;this.description=r;this.shortDescription=n;this.prompt=o;this.skills=s;this.scopes=c;this.inlinePrompt=l;this.producesCodeEdits=u}static{a(this,"StaticPromptTemplate")}instructions(e,r,n="panel"){let o;return n==="inline"?o=this.inlinePrompt??this.prompt:o=this.prompt,o+` +`+r}requiredSkills(){return this.skills}},Jts=new vw("tests","Generate unit tests","Generate Tests",ns` Write a set of unit tests for the code above, or for the selected code if provided. Provide tests for the functionality of the code and not the implementation details. The tests should test the happy path as well as the edge cases. @@ -3126,18 +3126,18 @@ The code of file \`${r}\` is: Follow the same test style as in existing tests if they exist. You must not create inline comments like "Arrange, Act, Assert", unless existing tests use inline comments as well. If existing tests use any mocking or stubbing libraries, use the same libraries before writing your own test doubles. - `,[r2,cJ],["chat-panel","agent-panel","editor"]),WXo=new pw("simplify","Simplify the code","Simplify This",is` + `,[u2,yJ],["chat-panel","agent-panel","editor"]),Zts=new vw("simplify","Simplify the code","Simplify This",ns` Provide a simplified version of the selected code above. Do not change the behavior of the code. The code should still be readable and easy to understand. Do not reply with the original code but only a simplified version. - Do only reply with one code snippet that contains the complete simplified code and explain what you have simplified after.`,[],["editor","chat-panel","agent-panel","inline","inline-agent"],is` + Do only reply with one code snippet that contains the complete simplified code and explain what you have simplified after.`,[],["editor","chat-panel","agent-panel","inline","inline-agent"],ns` Provide a simplified version of the selected code. Modify the selected code to make it simpler and easier to understand. Do not change the behavior of the code. Removing empty lines is not a simplification. You must not omit any code that is necessary for the code to compile and run, for example by replacing lines with ... or similar. - Do not reply with the original code but only a simplified version.`,!0),zXo=new pw("fix","Fix problems and compile errors","Fix This",is` + Do not reply with the original code but only a simplified version.`,!0),Xts=new vw("fix","Fix problems and compile errors","Fix This",ns` Fix the provided errors and problems. Do not invent new problems. The fixed code should still be readable and easy to understand. @@ -3148,28 +3148,28 @@ The code of file \`${r}\` is: Show how the error can be fixed by providing a code snippet that displays the code before and after it has been fixed after each group. Shorten fully qualified class names to the simple class name and full file paths to the file names only. When enumerating the groups, start with the word "Problem" followed by the number and a quick summary of the problem. Format this headline bold. - At last provide a completely fixed version of the code if the fixes required multiple code changes.`,[Qq],["editor","chat-panel","agent-panel","inline","inline-agent"],is` + At last provide a completely fixed version of the code if the fixes required multiple code changes.`,[Xq],["editor","chat-panel","agent-panel","inline","inline-agent"],ns` Fix the provided errors and problems. Do not invent new problems. The fixed code should still be readable and easy to understand. If there are no problems provided do reply that you can't detect any problems and the user should describe more precisely what they want to be fixed. Do not attempt to fix problems that are not provided, like unbalanced brackets or parentheses that are not causing errors. - Briefly explain the problems without repeating the detailed error message.`,!0),YXo=new pw("explain","Explain how the code works","Explain This",is` + Briefly explain the problems without repeating the detailed error message.`,!0),ers=new vw("explain","Explain how the code works","Explain This",ns` Write an explanation for the selected code above as paragraphs of text. Include excerpts of code snippets to underline your explanation. Do not repeat the complete code. - The explanation should be easy to understand for a developer who is familiar with the programming language used but not familiar with the code.`,[],["editor","chat-panel","agent-panel","inline"],is` + The explanation should be easy to understand for a developer who is familiar with the programming language used but not familiar with the code.`,[],["editor","chat-panel","agent-panel","inline"],ns` Write an explanation for the code the user is selecting. Include excerpts of code snippets to underline your explanation. Do not repeat the complete code. - Keep the explanation brief and easy to understand for a developer who is familiar with the programming language used but not familiar with the code.`,!1),KXo=new pw("doc","Document the current selection or file","Generate Docs",is` + Keep the explanation brief and easy to understand for a developer who is familiar with the programming language used but not familiar with the code.`,!1),trs=new vw("doc","Document the current selection or file","Generate Docs",ns` Write documentation for the selected code. If no code is explicitly selected, document the provided code in its entirety. The reply should be a codeblock containing the code with the documentation added as comments. - Use the most appropriate documentation style for the programming language used (e.g. JSDoc for JavaScript, docstrings for Python etc.)`,[],["editor","chat-panel","agent-panel","inline","inline-agent"],is` + Use the most appropriate documentation style for the programming language used (e.g. JSDoc for JavaScript, docstrings for Python etc.)`,[],["editor","chat-panel","agent-panel","inline","inline-agent"],ns` Add documentation to the provided code. If a specific selection is given, only document the selected code. Otherwise, document all the code provided. Modify the code by adding documentation as comments. Use the most appropriate documentation style for the programming language used (e.g. JSDoc for JavaScript, docstrings for Python etc.). - Place the comments before functions and methods, unless the language has a different convention (for example Python's docstring).`,!0),Nxn=new pw("create-agent","Create a new custom agent","Create Agent",is` + Place the comments before functions and methods, unless the language has a different convention (for example Python's docstring).`,!0),lRn=new vw("create-agent","Create a new custom agent","Create Agent",ns` Help the user create a new custom agent file (a Markdown file with a \`.agent.md\` extension). A custom agent defines a specialized persona with its own description and allowed tools. @@ -3188,7 +3188,7 @@ The code of file \`${r}\` is: --- - After the file is created, open it and briefly summarize what you created and how to use it.`,[],["chat-panel","agent-panel"]),Mxn=new pw("create-skill","Create a new custom skill","Create Skill",is` + After the file is created, open it and briefly summarize what you created and how to use it.`,[],["chat-panel","agent-panel"]),uRn=new vw("create-skill","Create a new custom skill","Create Skill",ns` Help the user create a new custom skill. A skill is a folder containing a \`SKILL.md\` file that provides domain-specific knowledge or a reusable workflow the agent can load on demand. @@ -3206,7 +3206,7 @@ The code of file \`${r}\` is: --- - After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),Oxn=new pw("create-instruction","Create a new instruction file","Create Instruction",is` + After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),dRn=new vw("create-instruction","Create a new instruction file","Create Instruction",ns` Help the user create a new instructions file (a Markdown file with an \`.instructions.md\` extension). Instructions provide always-on guidance that Copilot applies when working on matching files. @@ -3224,7 +3224,7 @@ The code of file \`${r}\` is: --- - After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),Lxn=new pw("create-prompt","Create a new prompt file","Create Prompt",is` + After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),fRn=new vw("create-prompt","Create a new prompt file","Create Prompt",ns` Help the user create a new prompt file (a Markdown file with a \`.prompt.md\` extension). A prompt file is a reusable task the user can run later. @@ -3242,7 +3242,7 @@ The code of file \`${r}\` is: --- - After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),Bxn=new pw("create-hook","Create a new hook configuration","Create Hook",is` + After the file is created, open it and briefly summarize what you created.`,[],["chat-panel","agent-panel"]),pRn=new vw("create-hook","Create a new hook configuration","Create Hook",ns` Help the user create a new hook configuration file (a JSON file under \`.github/hooks/\` with a \`.json\` extension). Hooks run shell scripts at specific agent lifecycle events — common uses include blocking dangerous @@ -3295,15 +3295,15 @@ The code of file \`${r}\` is: After the file is created, open it and briefly summarize what the hook does, which event it fires on, and how to test it (e.g. submitting a prompt for \`userPromptSubmitted\`, or running a tool that matches a - \`preToolUse\` filter).`,[],["chat-panel","agent-panel"]),E$t=class{constructor(){this.id="feedback";this.description="Steps to provide feedback";this.shortDescription="Feedback";this.scopes=["chat-panel","agent-panel"]}static{a(this,"FeedbackPromptTemplate")}response(e){let r=SQt(e.conversation),n=is` + \`preToolUse\` filter).`,[],["chat-panel","agent-panel"]),dVt=class{constructor(){this.id="feedback";this.description="Steps to provide feedback";this.shortDescription="Feedback";this.scopes=["chat-panel","agent-panel"]}static{a(this,"FeedbackPromptTemplate")}response(e){let r=gqt(e.conversation),n=ns` You can provide direct feedback by pressing the thumbs up/down buttons on a single message. In case you want to share more details, please click [here](https://aka.ms/copilot-jetbrains-feedback) to share your feedback. - `;return r?new ih(n+` + `;return r?new ah(n+` In order to help us understand your feedback better, you can include the following identifier in your feedback: by doing so, you are granting us permission to access the telemetry data associated with your feedback. \`\`\`yaml ${e.conversation.id}/${r} -\`\`\``):new ih(n)}},JXo=new E$t,_$t=class{constructor(){this.id="help";this.description="Get help on how to use Copilot chat";this.shortDescription="Help";this.scopes=["chat-panel","agent-panel"]}static{a(this,"HelpPromptTemplate")}response(e){let r=v$t(e.ctx).filter(o=>o!=this),n=is` +\`\`\``):new ah(n)}},rrs=new dVt,fVt=class{constructor(){this.id="help";this.description="Get help on how to use Copilot chat";this.shortDescription="Help";this.scopes=["chat-panel","agent-panel"]}static{a(this,"HelpPromptTemplate")}response(e){let r=pVt(e.ctx).filter(o=>o!=this),n=ns` You can ask me general programming questions, or use one of the following commands to get help with a specific task: ${r.map(o=>`- \`/${o.id}\` - ${o.description}`).join(` @@ -3315,39 +3315,39 @@ ${e.conversation.id}/${r} - On top of files, **I take different parts of your IDE into consideration** when answering questions. This includes, but is not limited to, test results and failures, build and runtime logs, active Git repository as well as details of the open project. - **Make refinements** by asking me follow-up questions, adding clarifications, providing errors, etc. - **Review my suggested code** and tell me about issues or improvements, so I can iterate on it. - `;return new ih(n)}},ZXo=new _$t,Fxn=new Set([Nxn.id,Mxn.id,Oxn.id,Lxn.id,Bxn.id]);function n2(){return[VXo,WXo,zXo,YXo,KXo,Nxn,Mxn,Oxn,Lxn,Bxn,JXo,ZXo,...Rxn()]}a(n2,"getPromptTemplates");function v$t(t){let e=n2();return!kCe(t)&&!O1(t)&&(e=e.filter(r=>!r.id.startsWith("debug."))),e}a(v$t,"getUserFacingPromptTemplates");var Uxn=de(require("path"));var C$t=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._name=r.name??n.header?.name??Ji(n.uri).replace(".prompt.md","")}static{a(this,"CustomPrompt")}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get uri(){return this.parsedPromptFile.uri}get name(){return this._name}get description(){return this.promptFileEntry.promptPath.description??this.parsedPromptFile.header?.description}get mode(){return this.parsedPromptFile.header?.agent}get model(){return this.parsedPromptFile.header?.model}get content(){return this.parsedPromptFile.body?.content??""}get isReadonly(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||qle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return zQ(this.promptFileEntry.promptPath)}get providers(){return x3(this.promptFileEntry.promptPath.metadata)}},Cg=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.promptTemplatesCache=null;this.promptBuffers=new Map;this.patternsByKey=new Map;this.syncRegistry()}static{a(this,"CustomPromptService")}static{this.DEFAULT_PROMPT_REGISTRATION=".github/prompts/**/*.prompt.md"}static{this.PROMPT_GLOB_SUFFIX="**/*.prompt.md"}syncRegistry(){let e=new Set([t.DEFAULT_PROMPT_REGISTRATION]);for(let r of this.patternsByKey.values())for(let n of r)e.add(n);this.registryPromptPatterns=this.promptFileLocationRegistry.replace(this.registryPromptPatterns,"prompt",Array.from(e),{watchable:!0})}static{this.parser=new dO}partitionSettings(e){let r=new Set,n=[];for(let o of e)if(o.type==="file")r.add(un(o.uri));else if(o.type==="location")r.add(Uxn.default.posix.join(o.path,t.PROMPT_GLOB_SUFFIX));else if(o.type==="content"){let s=this.resolvePrompt(o);s&&n.push(s)}return{patterns:Array.from(r),prompts:n}}setGlobalPromptFiles(e){this.setPromptSettingsForKey(e||[],"global-prompt-files")}collectBufferedPrompts(){return Array.from(this.promptBuffers.values()).flat()}resolvePrompt(e){if(!e.content?.trim())return;let r=t.parser.parse(`${WQ}global-prompt`,e.content);if(!r.body?.content?.trim())return;let n=r.header?.name??"global-prompt";return{uri:`${WQ}${n}`,name:n,description:r.header?.description,mode:r.header?.agent,model:r.header?.model,content:r.body.content,isReadonly:!0,isBuiltIn:!1}}setPromptFileLocations(e,r="workspace"){this.setPromptSettingsForKey(e,r)}setPromptSettingsForKey(e,r){let{patterns:n,prompts:o}=this.partitionSettings(e);this.promptBuffers.set(r,o),this.patternsByKey.set(r,n),this.promptTemplatesCache=null,this.syncRegistry()}async getPromptTemplate(e,r){let n=this.promptTemplatesCache?.get(e);return n?n.pluginUri!==void 0&&!r?.includePlugins?void 0:Promise.resolve(n):Promise.resolve(this.collectBufferedPrompts().find(o=>o.name===e))}async listCustomPrompts(e,r){let s=(await this.ctx.get(ug).collect(this.ctx,"prompt",e,{includePlugins:r?.includePlugins})).map(u=>new C$t(u));this.promptTemplatesCache?this.promptTemplatesCache.clear():this.promptTemplatesCache=new Map;let c=[...s],l=new Set(s.map(u=>u.name));for(let u of this.collectBufferedPrompts())l.has(u.name)||(l.add(u.name),c.push(u));for(let u of c)this.promptTemplatesCache.set(u.name,u);return c}async getCustomPromptById(e,r){return(await this.listCustomPrompts(e)).find(o=>o.uri===r)}async getCustomPromptByName(e,r,n){return(await this.listCustomPrompts(e,n)).find(s=>s.name===r)}async applyPromptTemplateToRequest(e,r,n,o){let s=e.message.trim();if(!s.startsWith("/"))return!1;let[c,...l]=s.split(" "),u=c.replace("/",""),d=l.join(" ");if(!u)return!1;let f=r?.length?await this.getCustomPromptByName(r,u,o):await this.getPromptTemplate(u,o);if(f){if(f.uri.startsWith(WQ))return e.message=`Follow instructions: ${f.content} + `;return new ah(n)}},nrs=new fVt,hRn=new Set([lRn.id,uRn.id,dRn.id,fRn.id,pRn.id]);function d2(){return[Jts,Zts,Xts,ers,trs,lRn,uRn,dRn,fRn,pRn,rrs,nrs,...oRn()]}a(d2,"getPromptTemplates");function pVt(t){let e=d2();return!KCe(t)&&!Q1(t)&&(e=e.filter(r=>!r.id.startsWith("debug."))),e}a(pVt,"getUserFacingPromptTemplates");var mRn=fe(require("path"));var hVt=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._name=r.name??n.header?.name??Ki(n.uri).replace(".prompt.md","")}static{a(this,"CustomPrompt")}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get uri(){return this.parsedPromptFile.uri}get name(){return this._name}get description(){return this.promptFileEntry.promptPath.description??this.parsedPromptFile.header?.description}get mode(){return this.parsedPromptFile.header?.agent}get model(){return this.parsedPromptFile.header?.model}get content(){return this.parsedPromptFile.body?.content??""}get isReadonly(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||Jle(e)}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get pluginUri(){return sq(this.promptFileEntry.promptPath)}get providers(){return O3(this.promptFileEntry.promptPath.metadata)}},Ig=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.promptTemplatesCache=null;this.promptBuffers=new Map;this.patternsByKey=new Map;this.syncRegistry()}static{a(this,"CustomPromptService")}static{this.DEFAULT_PROMPT_REGISTRATION=".github/prompts/**/*.prompt.md"}static{this.PROMPT_GLOB_SUFFIX="**/*.prompt.md"}syncRegistry(){let e=new Set([t.DEFAULT_PROMPT_REGISTRATION]);for(let r of this.patternsByKey.values())for(let n of r)e.add(n);this.registryPromptPatterns=this.promptFileLocationRegistry.replace(this.registryPromptPatterns,"prompt",Array.from(e),{watchable:!0})}static{this.parser=new AO}partitionSettings(e){let r=new Set,n=[];for(let o of e)if(o.type==="file")r.add(ln(o.uri));else if(o.type==="location")r.add(mRn.default.posix.join(o.path,t.PROMPT_GLOB_SUFFIX));else if(o.type==="content"){let s=this.resolvePrompt(o);s&&n.push(s)}return{patterns:Array.from(r),prompts:n}}setGlobalPromptFiles(e){this.setPromptSettingsForKey(e||[],"global-prompt-files")}collectBufferedPrompts(){return Array.from(this.promptBuffers.values()).flat()}resolvePrompt(e){if(!e.content?.trim())return;let r=t.parser.parse(`${oq}global-prompt`,e.content);if(!r.body?.content?.trim())return;let n=r.header?.name??"global-prompt";return{uri:`${oq}${n}`,name:n,description:r.header?.description,mode:r.header?.agent,model:r.header?.model,content:r.body.content,isReadonly:!0,isBuiltIn:!1}}setPromptFileLocations(e,r="workspace"){this.setPromptSettingsForKey(e,r)}setPromptSettingsForKey(e,r){let{patterns:n,prompts:o}=this.partitionSettings(e);this.promptBuffers.set(r,o),this.patternsByKey.set(r,n),this.promptTemplatesCache=null,this.syncRegistry()}async getPromptTemplate(e,r){let n=this.promptTemplatesCache?.get(e);return n?n.pluginUri!==void 0&&!r?.includePlugins?void 0:Promise.resolve(n):Promise.resolve(this.collectBufferedPrompts().find(o=>o.name===e))}async listCustomPrompts(e,r){let s=(await this.ctx.get(pg).collect(this.ctx,"prompt",e,{includePlugins:r?.includePlugins})).map(u=>new hVt(u));this.promptTemplatesCache?this.promptTemplatesCache.clear():this.promptTemplatesCache=new Map;let c=[...s],l=new Set(s.map(u=>u.name));for(let u of this.collectBufferedPrompts())l.has(u.name)||(l.add(u.name),c.push(u));for(let u of c)this.promptTemplatesCache.set(u.name,u);return c}async getCustomPromptById(e,r){return(await this.listCustomPrompts(e)).find(o=>o.uri===r)}async getCustomPromptByName(e,r,n){return(await this.listCustomPrompts(e,n)).find(s=>s.name===r)}async applyPromptTemplateToRequest(e,r,n,o){let s=e.message.trim();if(!s.startsWith("/"))return!1;let[c,...l]=s.split(" "),u=c.replace("/",""),d=l.join(" ");if(!u)return!1;let f=r?.length?await this.getCustomPromptByName(r,u,o):await this.getPromptTemplate(u,o);if(f){if(f.uri.startsWith(oq))return e.message=`Follow instructions: ${f.content} -${d}`,!0;e.message=`Follow instructions in [${f.name}](${f.uri}). ${d}`;let g=e.references??[];return g.some(A=>A.type==="file"&&A.uri===f.uri)||g.push({type:"file",uri:f.uri}),e.references=g,!0}if(!n)return!1;let h="inline",m=n2().find(g=>g.id===u&&g.scopes.includes(h));return m?.instructions?(e.message=m.instructions(this.ctx,d,"inline"),!0):!1}};var yXe=class{constructor(e,r){this.conversation=e;this.capabilities=r}static{a(this,"ConversationHolder")}},zo=class{constructor(e){this.ctx=e;this.conversations=new Cn(100)}static{a(this,"Conversations")}create({capabilities:e,source:r,userLanguage:n,conversationId:o}={}){let s=new lK([],r??"panel",n,o),c=e?.skills??[];return e?.allSkills&&(c=this.ctx.get(Yh).getDescriptors().map(l=>l.id)),this.conversations.set(s.id,new yXe(s,{skills:c})),this.initializePartitionTranscript(s),s}destroy(e){this.conversations.delete(e)}async restore(e){let{conversationId:r,targetTurnId:n,capabilities:o,source:s,userLanguage:c}=e;ot.debug(this.ctx,`Restoring conversation: conversationId=${r}, targetTurnId=${n}`);let u=await this.ctx.get(HO).restoreConversation(r,n);if(!u){ot.debug(this.ctx,`Restoration returned undefined: conversationId=${r}, targetTurnId=${n}`);return}let d=new lK(u.turns,s??"panel",c,r);d.currentPartitionId=u.partitionId;let f=o?.skills??[];return o?.allSkills&&(f=this.ctx.get(Yh).getDescriptors().map(h=>h.id)),this.conversations.set(d.id,new yXe(d,{skills:f})),this.initializeRestoredPartitionTranscript(d),ot.info(this.ctx,`Conversation restored: conversationId=${r}, partitionId=${u.partitionId}, turnCount=${u.turns.length}`),{conversation:d,partitionId:u.partitionId,turnCount:u.turns.length}}async createOrRestore(e={}){let{restoreToTurnId:r,conversationId:n,...o}=e;if(r&&n){try{let s=await this.restore({conversationId:n,targetTurnId:r,capabilities:o.capabilities,source:o.source,userLanguage:o.userLanguage});if(s)return s.conversation}catch(s){ot.warn(this.ctx,`Failed to restore conversation: conversationId=${n}, turnId=${r}, error=${s instanceof Error?s.message:String(s)}`)}return ot.info(this.ctx,`Creating new conversation after failed restoration: originalConversationId=${n}`),At(this.ctx,"conversationPartition.restoration.fallbackToNew",{conversationId:String(n),targetTurnId:String(r)}),this.create(o)}return this.create(e)}initializeRestoredPartitionTranscript(e){try{let r=new p0(this.ctx);if(!r.isEnabled())return;r.initializePartition(e.id,e.currentPartitionId,{source:"restoration"}).catch(n=>{ot.error(this.ctx,`Failed to initialize restored partition transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){ot.error(this.ctx,`Failed to create transcript persistence for restoration: ${r instanceof Error?r.message:String(r)}`)}}async addTurn(e,r,n,o,s,c,l,u){let d=this.get(e);r.request.references=n&&n.length>0?n:[],o&&(r.request.activeEditor=o),s&&(r.workspaceFolder=s),c&&c.length>0&&(r.workspaceFolders=c),l&&l.length>0&&(r.ignoredSkills=l.map(g=>({skillId:g}))),u&&(r.agent={agentSlug:u.agentSlug},r.confirmationResponse=u);let f=n?.filter(g=>g.type==="file"&&!GW.has(to(g.uri).scheme)).map(g=>g.uri)??[],h=o?.uri,m=c?.map(g=>g.uri).filter(g=>!!g&&!GW.has(to(g).scheme))??[];d.uriSchemeCache.addUris([...f,h,...m]),await this.determineAndApplyAgent(d,r),await this.determineAndApplyTemplate(d,r),await this.determineAndApplyPromptTemplate(this.ctx,d,r),d.addTurn(r);try{await this.writeUserMessageTranscriptEvent(d,r)}catch(g){ot.error(this.ctx,`Failed to write user message transcript event: ${g instanceof Error?g.message:String(g)}`)}if(r.response)try{await this.writeAssistantResponseTranscriptEvents(d,r)}catch(g){ot.error(this.ctx,`Failed to write assistant response transcript events: ${g instanceof Error?g.message:String(g)}`)}return r}async writeUserMessageTranscriptEvent(e,r){let n=new p0(this.ctx);if(!n.isEnabled())return;let o=Axn(Pn(r.request.message),String(r.id));await n.appendEvent(e.id,e.currentPartitionId,o)}async writeAssistantResponseTranscriptEvents(e,r){let n=new p0(this.ctx);if(!n.isEnabled()||!r.response)return;let o=Pn(r.response.message),s=String(r.id),c=dXe(o,s,null,{text:o,iterationNumber:1});await n.appendEvent(e.id,e.currentPartitionId,c);let l=r.status==="error"?"error":r.status==="cancelled"?"cancelled":"success",u=Jue(s,l);await n.appendEvent(e.id,e.currentPartitionId,u)}async determineAndApplyAgent(e,r){if(e.source==="panel"&&Pn(r.request.message).trim().startsWith("@")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Pn(r.request.message),"@");(await ew(this.ctx)).find(l=>l.slug===n)&&(r.request.message=o,r.request.type="user",r.agent={agentSlug:n})}}async determineAndApplyTemplate(e,r){if(Pn(r.request.message).trim().startsWith("/")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Pn(r.request.message),"/"),s=n2().find(c=>c.id===n);if(s){r.request.message=o,r.request.type="user",await this.determineAndApplyAgent(e,r);let c=s.instructions?s.instructions(this.ctx,r.request.message,e.source):o;r.template={templateId:n,userQuestion:r.request.message},r.request.message=c,r.request.type="template"}}}async determineAndApplyPromptTemplate(e,r,n){if(Pn(n.request.message).trim().startsWith("/")){let[o,s]=this.extractKeywordAndQuestionFromRequest(Pn(n.request.message),"/"),l=await e.get(Cg).getPromptTemplate(o);l&&(l.uri.startsWith(WQ)?n.request.message=`Follow instructions: ${l.content} +${d}`,!0;e.message=`Follow instructions in [${f.name}](${f.uri}). ${d}`;let g=e.references??[];return g.some(A=>A.type==="file"&&A.uri===f.uri)||g.push({type:"file",uri:f.uri}),e.references=g,!0}if(!n)return!1;let h="inline",m=d2().find(g=>g.id===u&&g.scopes.includes(h));return m?.instructions?(e.message=m.instructions(this.ctx,d,"inline"),!0):!1}};var VXe=class{constructor(e,r){this.conversation=e;this.capabilities=r}static{a(this,"ConversationHolder")}},zo=class{constructor(e){this.ctx=e;this.conversations=new Cn(100)}static{a(this,"Conversations")}create({capabilities:e,source:r,userLanguage:n,conversationId:o}={}){let s=new vK([],r??"panel",n,o),c=e?.skills??[];return e?.allSkills&&(c=this.ctx.get(Xh).getDescriptors().map(l=>l.id)),this.conversations.set(s.id,new VXe(s,{skills:c})),this.initializePartitionTranscript(s),s}destroy(e){this.conversations.delete(e)}async restore(e){let{conversationId:r,targetTurnId:n,capabilities:o,source:s,userLanguage:c}=e;ot.debug(this.ctx,`Restoring conversation: conversationId=${r}, targetTurnId=${n}`);let u=await this.ctx.get(YO).restoreConversation(r,n);if(!u){ot.debug(this.ctx,`Restoration returned undefined: conversationId=${r}, targetTurnId=${n}`);return}let d=new vK(u.turns,s??"panel",c,r);d.currentPartitionId=u.partitionId;let f=o?.skills??[];return o?.allSkills&&(f=this.ctx.get(Xh).getDescriptors().map(h=>h.id)),this.conversations.set(d.id,new VXe(d,{skills:f})),this.initializeRestoredPartitionTranscript(d),ot.info(this.ctx,`Conversation restored: conversationId=${r}, partitionId=${u.partitionId}, turnCount=${u.turns.length}`),{conversation:d,partitionId:u.partitionId,turnCount:u.turns.length}}async createOrRestore(e={}){let{restoreToTurnId:r,conversationId:n,...o}=e;if(r&&n){try{let s=await this.restore({conversationId:n,targetTurnId:r,capabilities:o.capabilities,source:o.source,userLanguage:o.userLanguage});if(s)return s.conversation}catch(s){ot.warn(this.ctx,`Failed to restore conversation: conversationId=${n}, turnId=${r}, error=${s instanceof Error?s.message:String(s)}`)}return ot.info(this.ctx,`Creating new conversation after failed restoration: originalConversationId=${n}`),jl(this.ctx,"conversationPartition.restoration.fallbackToNew",{conversationId:String(n),targetTurnId:String(r)}),this.create(o)}return this.create(e)}initializeRestoredPartitionTranscript(e){try{let r=new g0(this.ctx);if(!r.isEnabled())return;r.initializePartition(e.id,e.currentPartitionId,{source:"restoration"}).catch(n=>{ot.error(this.ctx,`Failed to initialize restored partition transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){ot.error(this.ctx,`Failed to create transcript persistence for restoration: ${r instanceof Error?r.message:String(r)}`)}}async addTurn(e,r,n,o,s,c,l,u){let d=this.get(e);r.request.references=n&&n.length>0?n:[],o&&(r.request.activeEditor=o),s&&(r.workspaceFolder=s),c&&c.length>0&&(r.workspaceFolders=c),l&&l.length>0&&(r.ignoredSkills=l.map(g=>({skillId:g}))),u&&(r.agent={agentSlug:u.agentSlug},r.confirmationResponse=u);let f=n?.filter(g=>g.type==="file"&&!rz.has(eo(g.uri).scheme)).map(g=>g.uri)??[],h=o?.uri,m=c?.map(g=>g.uri).filter(g=>!!g&&!rz.has(eo(g).scheme))??[];d.uriSchemeCache.addUris([...f,h,...m]),await this.determineAndApplyAgent(d,r),await this.determineAndApplyTemplate(d,r),await this.determineAndApplyPromptTemplate(this.ctx,d,r),d.addTurn(r);try{await this.writeUserMessageTranscriptEvent(d,r)}catch(g){ot.error(this.ctx,`Failed to write user message transcript event: ${g instanceof Error?g.message:String(g)}`)}if(r.response)try{await this.writeAssistantResponseTranscriptEvents(d,r)}catch(g){ot.error(this.ctx,`Failed to write assistant response transcript events: ${g instanceof Error?g.message:String(g)}`)}return r}async writeUserMessageTranscriptEvent(e,r){let n=new g0(this.ctx);if(!n.isEnabled())return;let o=Wwn(Pn(r.request.message),String(r.id));await n.appendEvent(e.id,e.currentPartitionId,o)}async writeAssistantResponseTranscriptEvents(e,r){let n=new g0(this.ctx);if(!n.isEnabled()||!r.response)return;let o=Pn(r.response.message),s=String(r.id),c=UXe(o,s,null,{text:o,iterationNumber:1});await n.appendEvent(e.id,e.currentPartitionId,c);let l=r.status==="error"?"error":r.status==="cancelled"?"cancelled":"success",u=cde(s,l);await n.appendEvent(e.id,e.currentPartitionId,u)}async determineAndApplyAgent(e,r){if(e.source==="panel"&&Pn(r.request.message).trim().startsWith("@")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Pn(r.request.message),"@");(await aw(this.ctx)).find(l=>l.slug===n)&&(r.request.message=o,r.request.type="user",r.agent={agentSlug:n})}}async determineAndApplyTemplate(e,r){if(Pn(r.request.message).trim().startsWith("/")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Pn(r.request.message),"/"),s=d2().find(c=>c.id===n);if(s){r.request.message=o,r.request.type="user",await this.determineAndApplyAgent(e,r);let c=s.instructions?s.instructions(this.ctx,r.request.message,e.source):o;r.template={templateId:n,userQuestion:r.request.message},r.request.message=c,r.request.type="template"}}}async determineAndApplyPromptTemplate(e,r,n){if(Pn(n.request.message).trim().startsWith("/")){let[o,s]=this.extractKeywordAndQuestionFromRequest(Pn(n.request.message),"/"),l=await e.get(Ig).getPromptTemplate(o);l&&(l.uri.startsWith(oq)?n.request.message=`Follow instructions: ${l.content} -${s}`:(n.request.message=`Follow instructions in [${l.name}](${l.uri}). ${s}`,n.request.references=[...n.request.references||[],{type:"file",uri:l.uri}]))}}extractKeywordAndQuestionFromRequest(e,r){let[n,...o]=e.trim().split(" "),s=o.join(" ");return[n.replace(r,""),s]}deleteTurn(e,r){this.get(e).deleteTurn(r)}get(e){return this.getHolder(e).conversation}getCapabilities(e){return this.getHolder(e).capabilities}getSupportedSkills(e){let r=this.ctx.get(Yh).getDescriptors().filter(o=>o.type==="implicit").map(o=>o.id),n=this.getCapabilities(e).skills;return[...r,...n]}filterSupportedSkills(e,r){let n=this.getSupportedSkills(e);return r.filter(o=>n.includes(o))}getHolder(e){let r=this.conversations.get(e);if(!r)throw new Error(`Conversation with id ${e} does not exist`);return r}getAll(){let e=this.conversations.values();return Array.from(e).map(r=>r.conversation)}findByTurnId(e){for(let r of this.getAll()){let n=r.findTurn(e);if(n)return{conversation:r,turn:n}}}initializePartitionTranscript(e){try{let r=new p0(this.ctx);if(!r.isEnabled())return;r.initializePartition(e.id,e.currentPartitionId,{source:e.source,createdAt:e.timestamp}).catch(n=>{ot.error(this.ctx,`Failed to initialize partition transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){ot.error(this.ctx,`Failed to create transcript persistence: ${r instanceof Error?r.message:String(r)}`)}}};p();var EXe=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.progress=o;this.rounds=[]}static{a(this,"AgentToolCalls")}getRound(e){return this.rounds.find(r=>r.roundId===e)}getToolCallById(e){for(let r of this.rounds){let n=r.toolCalls?.find(o=>o.id===e);if(n)return n}}init(e,r,n,o,s,c){let l=this.getRound(e);if(l||(l={roundId:e,reply:""},this.rounds.push(l)),l.toolCalls?.find(d=>d.id===r))ot.error(this.ctx,`Tool call ${r} already exists for the round ${e} in conversation ${this.conversation.id} and turn ${this.turn.id}`);else{let d={id:r,name:n,toolType:o,status:"not started",input:s,inputMessage:c};l.toolCalls=[d]}}async running(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.progressMessage=n,o.status="running"})}async finish(e,r){await this.update({roundId:e,toolCallId:r},n=>{n.status="completed"})}async result(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.status="completed",o.result=n.data,n.toolResultMessage&&(o.progressMessage=n.toolResultMessage),o.resultDetails=n.toolResultDetails,o.toolSpecificData=n.toolSpecificData})}async cancel(e,r){await this.update({roundId:e,toolCallId:r},n=>{n.status="cancelled"})}async finishAll(e="completed"){let r=this.rounds.filter(n=>{let o=n.toolCalls?.filter(s=>s.status==="running").map(s=>(s.status=e,s));if(o&&o.length>0)return n.toolCalls=o,!0});r.length>0&&await this.progress.report(this.conversation,this.turn,{editAgentRounds:r})}async error(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.status="error",o.error=n||"Unknown error"})}async updateProgressMessage(e,r,n){await this.update({roundId:e,toolCallId:r,silent:!0},o=>{o.progressMessage=n})}async update({roundId:e,toolCallId:r,silent:n=!1},o){let s=this.rounds.find(l=>l.roundId===e);s||(s={roundId:e,reply:""},this.rounds.push(s));let c=s.toolCalls?.find(l=>l.id===r);c?(o(c),n||await this.progress.report(this.conversation,this.turn,{editAgentRounds:[s]})):ot.error(this.ctx,`Tool call ${r} not found for the agent round ${e} in conversation ${this.conversation.id} and turn ${this.turn.id}`)}};p();var _Xe=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.progress=o;this.steps=[]}static{a(this,"Steps")}async start(e,r,n){let o=this.steps.find(s=>s.id===e);if(!o)o={id:e,title:r,description:n,status:"running"},this.steps.push(o),await this.progress.report(this.conversation,this.turn,{steps:[o]});else throw new Error(`Step with id "${e}" already started`)}async finish(e){await this.updateStep(e,r=>{r.status="completed"})}async cancel(e){await this.updateStep(e,r=>{r.status="cancelled"})}async finishAll(e="completed"){let r=this.steps.filter(n=>n.status==="running").map(n=>(n.status=e,n));r.length>0&&await this.progress.report(this.conversation,this.turn,{steps:r})}async error(e,r){return this.updateStep(e,n=>{n.status="failed",n.error={message:r||"Unknown error"}})}async updateStep(e,r){let n=this.steps.find(o=>o.id===e);n?(r(n),await this.progress.report(this.conversation,this.turn,{steps:[n]})):ot.error(this.ctx,`Step ${e} not found for conversation ${this.conversation.id} and turn ${this.turn.id}`)}};p();var XXo="X-Initiator",ees="X-Interaction-ID",tes="X-Interaction-Type";var vXe=class{static{a(this,"LlmInteractionInitiator")}static id(){throw new Error("Must be implemented by subclass")}},b$t=class extends vXe{static{a(this,"User")}static id(){return"user"}},S$t=class extends vXe{static{a(this,"Agent")}static id(){return"agent"}},T$t=class{static{a(this,"GenericLlmInteraction")}constructor(e,r,n){this.initiator=e.id(),this.interactionType=r,this.interactionId=n}toCapiHeaders(){return{[XXo]:this.initiator,[ees]:this.interactionId,[tes]:this.interactionType.toString()}}cloneAsAgentInteraction(e){return OA.agent(e??this.interactionType,this.interactionId)}},OA=class t extends T$t{static{a(this,"LlmInteraction")}static user(e,r){return new t(b$t,e,r)}static agent(e,r){return new t(S$t,e,r)}};function Qxn(t){switch(t){case"Ask":return"conversation-panel";case"Agent":case"InlineAgent":return"conversation-agent";default:return"conversation-other"}}a(Qxn,"interactionTypeForChatMode");var hw=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.cancelationToken=o;this.skillResolver=new I$t(this),this.steps=new _Xe(e,r,n,e.get(Tc)),this.collector=new x$t(r,n,e.get(Tc)),this.agentToolCalls=new EXe(e,r,n,e.get(Tc))}static{a(this,"TurnContext")}get uriSchemeCache(){return this.conversation.uriSchemeCache}setResolvedModelConfiguration(e){this.turn.resolvedModelConfiguration=e}toLlmInteraction(){if(this.turn.isSubagent()&&this.turn.parentLlmInteraction)return this.turn.parentLlmInteraction.cloneAsAgentInteraction("conversation-subagent");if(this.conversation.source==="inline")return OA.user("conversation-inline",this.turn.telemetryId);{let e=this.turn.chatMode?.kind==="Agent"?"conversation-agent":"conversation-panel";return this.agentToolCalls.rounds.length?OA.agent(e,this.turn.telemetryId):OA.user(e,this.turn.telemetryId)}}async collectFile(e,r,n,o){let s={type:"file",collector:e,uri:r,status:n};o&&(s.range=o),await this.collector.collect(s)}collectLabel(e,r){this.collector.collect({type:"label",collector:e,label:r})}isFileIncluded(e){return this.collector.collectibles.some(r=>r.type==="file"&&r.status==="included"&&r.uri===e)}async info(e){await this.sendChatNotification(e,"info")}async warn(e){await this.sendChatNotification(e,"warning")}async sendChatNotification(e,r){await this.ctx.get(Tc).report(this.conversation,this.turn,{notifications:[{severity:r,message:e}]})}clearCopilotEditsSessionHeader(){this.copilotEditsSessionHeader=void 0}setCopilotEditsSessionHeader(e){this.copilotEditsSessionHeader=e}},CXe=class extends Error{constructor(r,n){super(`Cycle detected while resolving skills: ${n.join(" -> ")} -> ${r}`);this.skillId=r;this.skillStack=n}static{a(this,"CycleError")}},Oxe=class extends Error{static{a(this,"ConversationAbortError")}constructor(e){super(e)}},I$t=class{constructor(e){this.turnContext=e;this.resolveStack=[]}static{a(this,"SkillResolver")}async resolve(e){if(this.turnContext.ctx.get(zo).getSupportedSkills(this.turnContext.conversation.id).includes(e)){this.ensureNoCycle(e);let n=this.turnContext.ctx.get(Ag).getResolvedSkill(this.turnContext.turn.id,e);if(n)return this.resolveStack.pop(),n;let o=await this.newlyResolve(e);return this.resolveStack.pop(),o}}ensureNoCycle(e){if(this.resolveStack.includes(e))throw new CXe(e,this.resolveStack);this.resolveStack.push(e)}async newlyResolve(e){let n=this.turnContext.ctx.get(Yh).getSkill(e);try{let o=await n?.resolver(this.turnContext).resolveSkill(this.turnContext);if(o)return this.turnContext.ctx.get(Ag).addResolvedSkill(this.turnContext.turn.id,e,o),o}catch(o){if(o instanceof CXe||o instanceof Oxe)throw o;ot.exception(this.turnContext.ctx,o,`Error while resolving skill ${e}`)}}},x$t=class{constructor(e,r,n){this.conversation=e;this.turn=r;this.conversationProgress=n;this.collectibles=[]}static{a(this,"Collector")}async collect(e){this.collectibles.push(e),await this.reportCollectedFile(e)}async reportCollectedFile(e){e.type==="file"&&await this.conversationProgress.report(this.conversation,this.turn,{references:[{type:"file",uri:e.uri,status:e.status,range:e.range}]})}collectiblesForCollector(e){return this.collectibles.filter(r=>r.collector===e)}};p();p();p();var res={preTurnThreshold:.85,postToolCallThreshold:.9,enabled:!1};function qxn(t){let e=Ft(t,Ye.AutoCompress);return{...res,enabled:e}}a(qxn,"getAutomaticCompressionConfig");p();var qq=class t{static{a(this,"TokenBudgetEstimator")}static{this.CHARS_PER_TOKEN=4}static{this.MESSAGE_OVERHEAD_MULTIPLIER=1.15}constructor(){}estimateToolDefinitionTokens(e,r){try{let o=e.get(gs).getToolsForModel(r),s=0;for(let c of o){let l={type:"function",function:{name:c.nameForModel,description:c.description,parameters:c.inputSchema}},u=JSON.stringify(l);s+=Math.ceil(u.length/t.CHARS_PER_TOKEN)}return s}catch{return(r?.customTools?.length??0)*100}}estimateTokensFromText(e){return e?Math.ceil(e.length/t.CHARS_PER_TOKEN):0}estimateSystemMessageTokens(e){return 1500+e.baseTokensPerMessage}shouldCompressWithContextSize(e,r){let{totalTokenLimit:n,totalUsedTokens:o}=e;return!Number.isFinite(n)||n<=0?!1:o/n>=r}calculateContextSize(e,r,n){let o=this.estimateSystemMessageTokens(n),s=r.turns[r.turns.length-1],c=s?this.estimateToolDefinitionTokens(e,s.chatMode):0,l=0,u=0,d=0,f=0;for(let y of r.turns){let E=Pn(y.request.message),_=this.estimateTokensFromText(E)+n.baseTokensPerMessage;if(l+=Math.ceil(_*t.MESSAGE_OVERHEAD_MULTIPLIER),y.request.references?.length&&(d+=Math.ceil(y.request.references.length*50*t.MESSAGE_OVERHEAD_MULTIPLIER)),y.response){let v=Pn(y.response.message),b=this.estimateTokensFromText(v)+n.baseTokensPerMessage;if(u+=Math.ceil(b*t.MESSAGE_OVERHEAD_MULTIPLIER),TK(y.response.message))for(let T of y.response.message){if(T.role==="tool"&&T.content){let w=typeof T.content=="string"?T.content:JSON.stringify(T.content),R=this.estimateTokensFromText(w)+n.baseTokensPerMessage;f+=Math.ceil(R*t.MESSAGE_OVERHEAD_MULTIPLIER)}if(T.thinking){let w=T.thinking;if(typeof w.tokens=="number"&&w.tokens>0)u+=w.tokens;else if(w.text!==void 0){let R=0;if(typeof w.text=="string")R=w.text.length;else if(Array.isArray(w.text))for(let x of w.text)R+=x.length;if(R>0){let x=Math.ceil(R/t.CHARS_PER_TOKEN);u+=Math.ceil(x*t.MESSAGE_OVERHEAD_MULTIPLIER)}}}}}if(y.restoredToolCalls?.length){for(let v of y.restoredToolCalls)if(v.toolCalls?.length){for(let b of v.toolCalls)if(b.result&&Array.isArray(b.result)){let T="";for(let w of b.result)w.type==="text"?T+=w.value:w.type==="data"&&(T+=JSON.stringify(w.value));if(T){let w=this.estimateTokensFromText(T)+n.baseTokensPerMessage;f+=Math.ceil(w*t.MESSAGE_OVERHEAD_MULTIPLIER)}}}}}let h=o+c+l+u+d+f,m=n.maxRequestTokens,g=n.maxResponseTokens,A=m>0?h/m*100:0;return{totalTokenLimit:m,reservedOutputTokens:g,systemPromptTokens:o,toolDefinitionTokens:c,userMessagesTokens:l,assistantMessagesTokens:u,attachedFilesTokens:d,toolResultsTokens:f,totalUsedTokens:h,utilizationPercentage:Math.min(100,Math.round(A*100)/100)}}};var ZC=class{constructor(e,r,n){this.compressor=e;this.notifier=r;this.ctx=n;this.tokenEstimator=new qq}static{a(this,"AutomaticCompressionManager")}async checkAndCompress(e,r,n,o,s){let c=this.tokenEstimator.calculateContextSize(this.ctx,e,r),l={estimatedTokens:c.totalUsedTokens,maxTokens:c.totalTokenLimit,utilizationRatio:c.utilizationPercentage/100,turnCount:e.turns.length},u=qxn(this.ctx);if(!u.enabled)return this.sendSkippedTelemetry(e,n,"disabled",l,r),{triggered:!1,tokenEstimate:l,skipReason:"disabled"};let d=n==="pre-turn"?u.preTurnThreshold:u.postToolCallThreshold;return this.tokenEstimator.shouldCompressWithContextSize(c,d)?(ot.info(this.ctx,`Automatic compression triggered: conversationId=${e.id}, trigger=${n}, tokens=${l.estimatedTokens}/${l.maxTokens} (${(l.utilizationRatio*100).toFixed(1)}%)`),await this.performCompression(e,r,n,o,l,s)):(this.sendSkippedTelemetry(e,n,"below_threshold",l,r),{triggered:!1,tokenEstimate:l,skipReason:"below_threshold"})}async performCompression(e,r,n,o,s,c){let l=Date.now(),u=String(e.id),d=e.currentPartitionId,f=e.turns.length;try{await this.notifier.notifyCompressionStarted({conversationId:u,partitionId:d,reason:n});let h=await this.compressor.compressCurrentPartition(e,r,o,c),m=Date.now()-l;if(h.success){let g=e.turns[0],A=typeof g?.request?.message=="string"?g.request.message.length:0,y;try{y=this.tokenEstimator.calculateContextSize(this.ctx,e,r)}catch(E){ot.warn(this.ctx,`Failed to calculate context size after compression: ${E instanceof Error?E.message:String(E)}`)}return await this.notifier.notifyCompressionCompleted({conversationId:u,archivedPartitionId:h.archivedPartitionId,newPartitionId:h.newPartitionId,summaryLength:A,turnCount:f,durationMs:m,contextInfo:y}),this.sendTriggeredTelemetry(e,n,"success",s,h,m,r),{triggered:!0,compressionResult:h,tokenEstimate:s}}else return ot.error(this.ctx,`Automatic compression failed: conversationId=${u}, error=${h.error}`),this.sendTriggeredTelemetry(e,n,"failed",s,h,m,r),{triggered:!0,compressionResult:h,tokenEstimate:s,skipReason:"compression_failed"}}catch(h){let m=Date.now()-l,g=h instanceof Error?h.message:String(h);return ot.exception(this.ctx,h,`Automatic compression exception: conversationId=${u}`),this.sendExceptionTelemetry(e,n,g,s,m,r),{triggered:!0,tokenEstimate:s,skipReason:"compression_failed"}}}sendSkippedTelemetry(e,r,n,o,s){let c=Wt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,reason:n,...s?{modelId:s.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount});Et(this.ctx,"automaticCompression.skipped",c,0)}sendTriggeredTelemetry(e,r,n,o,s,c,l){let u=Wt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,outcome:n,archivedPartitionId:String(s.archivedPartitionId),newPartitionId:String(s.newPartitionId),...s.error&&{error:s.error},...l?{modelId:l.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount,durationMs:c});Et(this.ctx,"automaticCompression.triggered",u,0)}sendExceptionTelemetry(e,r,n,o,s,c){let l=Wt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,outcome:"exception",error:n,...c?{modelId:c.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount,durationMs:s});Et(this.ctx,"automaticCompression.triggered",l,0)}};p();var LA=class extends Error{constructor(r){super(r.message);this.conversationError=r;this.name="AgentConversationError"}static{a(this,"AgentConversationError")}};p();var qd=class{constructor(e){this.ctx=e}static{a(this,"AbstractClientToolConfirmationInvoker")}};p();p();var bXe=de(ale());var jxn=new Map;function hE(t,e){return Array.from({length:e-t+1},(r,n)=>(t+n).toString())}a(hE,"createNumberRange");function w$t(t){return[...t].sort((e,r)=>r.length-e.length)}a(w$t,"sortByStringLengthDesc");async function nes(t){let e=jxn.get(t);if(e)return e;let r=(async()=>{try{let n=await k$e(`tree-sitter-${t}.wasm`);return await bXe.default.Language.load(n)}catch(n){throw new Error(`Could not load tree-sitter-${t}.wasm: ${n instanceof Error?n.message:String(n)}`)}})();return jxn.set(t,r),r}a(nes,"loadShellLanguage");function Hxn(t){let r=t.replace(/\.exe$/i,"").toLowerCase().split(/[/\\]/).pop()||"";return/^(?:powershell|pwsh)(?:-preview)?$/.test(r)}a(Hxn,"isPowerShell");var ies=new Map([["sh",w$t([...hE(1,9).concat("").map(t=>`${t}<<<`),...hE(1,9).concat("").flatMap(t=>hE(1,9).map(e=>`${t}>&${e}`)),...hE(1,9).concat("").map(t=>`${t}<>`),...hE(1,9).concat("&","").map(t=>`${t}>>`),...hE(1,9).concat("&","").map(t=>`${t}>`),"0<","||","&&","|&","<<","&",";","{",">","<","|","%"])],["zsh",w$t([...hE(1,9).concat("").map(t=>`${t}<<<`),...hE(1,9).concat("").flatMap(t=>hE(1,9).map(e=>`${t}>&${e}`)),...hE(1,9).concat("").map(t=>`${t}<>`),...hE(1,9).concat("&","").map(t=>`${t}>>`),...hE(1,9).concat("&","").map(t=>`${t}>`),"<(","||",">|",">!","&&","|&","&",";","{","<","|","%"])],["pwsh",w$t([...hE(1,6).concat("*","").flatMap(t=>hE(1,6).map(e=>`${t}>&${e}`)),...hE(1,6).concat("*","").map(t=>`${t}>>`),...hE(1,6).concat("*","").map(t=>`${t}>`),"&&","<","|",";","!","&","%"])]]);function oes(t,e){let r,n=e.replace(/\.exe$/,"");Hxn(e)?r="pwsh":r=(n.split(/[/\\]/).pop()||"")==="zsh"?"zsh":"sh";let o=[t],s=ies.get(r);if(s)for(let c of s)for(let l=0;ld.trim())),l--)}return o.filter(c=>c.trim().length>0)}a(oes,"splitCommandLineIntoSubCommands");async function SXe(t,e){try{let r;Hxn(e)?r="powershell":r="bash",await bXe.default.init();let n,o;try{n=new bXe.default;let s=await nes(r);return n.setLanguage(s),o=n.parse(t),s.query("(command) @command").captures(o.rootNode).map(u=>u.node.text.trim()).filter(u=>u.length>0)}finally{o?.delete(),n?.delete()}}catch{return oes(t,e)}}a(SXe,"extractSubCommandsWithTreeSitter");var ses=new Set(["sudo","env"]),aes=/^[A-Za-z_][A-Za-z0-9_]*=/;function R$t(t){let e=t.trim().split(/\s+/).filter(r=>r.length>0);for(let r of e){if(aes.test(r)&&!r.startsWith("/")&&!r.startsWith(".")||ses.has(r.toLowerCase()))continue;let n=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\")),o=n>=0?r.substring(n+1):r;return o.length>0?o:void 0}}a(R$t,"extractCommandNameFromSubCommand");var Zue=new fe("CommandLineAutoApprover"),Gxn=/(?!.*)/,ces=/^[A-Z_][A-Z0-9_]*=/i,tT=class{constructor(e){this.ctx=e;this._denyListRules=[];this._allowListRules=[]}static{a(this,"CommandLineAutoApprover")}updateConfiguration(e){let{denyListRules:r,allowListRules:n}=this._mapAutoApproveConfigToRules(e);this._allowListRules=n,this._denyListRules=r}isCommandAutoApproved(e){if(ces.test(e))return{result:"denied",reason:`Command '${e}' is denied because it contains transient environment variables`};for(let r of this._denyListRules)if(this._commandMatchesRegex(r.regex,e))return{result:"denied",reason:`Command '${e}' is denied by deny list rule: ${r.sourceText}`};for(let r of this._allowListRules)if(this._commandMatchesRegex(r.regex,e))return{result:"approved",reason:`Command '${e}' is approved by allow list rule: ${r.sourceText}`};return{result:"noMatch",reason:`Command '${e}' has no matching auto approve entries`}}async isTerminalCommandApprovalRequired(e,r){let n=await SXe(e,r);Zue.info(this.ctx,`Command '${e}' is split into sub-commands: ${JSON.stringify(n)}`);let o=n.map(l=>this.isCommandAutoApproved(l)),s=o.find(l=>l.result==="denied");if(s)return Zue.info(this.ctx,`Command '${e}' is denied, reason:'${s.reason}'`),s;if(o.every(l=>l.result==="approved")){let l=`Command '${e}' is approved, reason:'${o.map(u=>u.reason).join("; ")}'`;return Zue.info(this.ctx,l),{result:"approved",reason:l}}let c=`Command '${e}' has no matching auto approve entries`;return Zue.info(this.ctx,c),{result:"noMatch",reason:c}}async parseTerminalCommand(e,r){let n=await SXe(e,r),o=[...new Set(n.map(R$t).filter(s=>s!==void 0))];return{subCommands:n,commandNames:o}}async parseTerminalCommandDetailed(e,r){let n=await SXe(e,r),o=n.map(s=>R$t(s)??"");return{subCommands:n,commandNames:o}}_commandMatchesRegex(e,r){return!!e.test(r)}_mapAutoApproveConfigToRules(e){if(!e||typeof e!="object")return{denyListRules:[],allowListRules:[]};let r=[],n=[];return Object.entries(e).forEach(([o,s])=>{if(typeof s=="boolean"){let c=this._convertAutoApproveEntryToRegex(o);s===!0?n.push({regex:c,sourceText:o}):s===!1&&r.push({regex:c,sourceText:o})}else if(typeof s=="object"&&s!==null){let c=s;if(typeof c.approve=="boolean"){let l=this._convertAutoApproveEntryToRegex(o);c.approve===!0?n.push({regex:l,sourceText:o}):c.approve===!1&&r.push({regex:l,sourceText:o})}}}),Zue.debug(this.ctx,"Update CommandLineAutoApprover denyListRules",r),Zue.debug(this.ctx,"Update CommandLineAutoApprover allowListRules",n),{denyListRules:r,allowListRules:n}}_convertAutoApproveEntryToRegex(e){let r=e.match(/^\/(?.+)\/(?[dgimsuvy]*)$/),n=r?.groups?.pattern;if(n){let s=r.groups?.flags;s&&(s=s.replaceAll("g",""));try{let c=new RegExp(n,s||void 0);return this._regExpLeadsToEndlessLoop(c)?Gxn:c}catch{return Gxn}}let o=e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return new RegExp(`^${o}\\b`)}_regExpLeadsToEndlessLoop(e){return e.source==="^"||e.source==="^$"||e.source==="$"||e.source==="^\\s*$"?!1:!!(e.exec("")&&e.lastIndex===0)}};p();var TXe=class{constructor(e){this.cache=new Map;this.inner=e}static{a(this,"SnapshotTextDocumentProvider")}getByUri(e){let r=this.cache.get(e);return r||(r=this.inner.getByUri(e),this.cache.set(e,r)),r}};p();var IXe=class{constructor(e){this.ctx=e}static{a(this,"DefaultTextDocumentProvider")}async getByUri(e){return await this.ctx.get(ii).getOrReadTextDocument({uri:e})}};p();p();p();p();p();p();var xXe=class{constructor(e,r,n,o,s){this.event=e;this.hook=r;this.exitCode=n;this.stdout=o;this.stderr=s;this.type="command";this.output=les(this.stdout)}static{a(this,"CommandHookResult")}};function les(t){try{return t.trim().length===0?void 0:JSON.parse(t)}catch{return}}a(les,"parseOutput");var D$t=require("child_process");var wXe=new fe("HookExecutor"),RXe=class{constructor(){this.handlers=[new k$t,new P$t]}static{a(this,"HookExecutor")}async execute(e,r,n,o){if(!e.get(tp).isTrusted(r.source)){wXe.warn(e,`Refusing to execute hook from untrusted workspace folder: ${r.source}`);return}for(let s of this.handlers)if(s.isAcceptable(n))try{return await s.handle(e,r,n,o)}catch(c){wXe.error(e,`Hook execution failed: ${c instanceof Error?c.message:String(c)}`);return}wXe.warn(e,`Unsupported hook type or platform for hook: ${JSON.stringify(n)}`)}},kXe=class{static{a(this,"CommandHookHandler")}async handle(e,r,n,o){o.cwd=n.cwd??o.cwd??process.cwd();let s=this.spawnProcess(n,o);if(!s.stdout||!s.stderr||!s.stdin)throw new Error("Failed to create child process with stdio pipes");let{stdout:c,stderr:l,stdin:u}=s,d="",f="",h=10*1024*1024;c.on("data",g=>{if(d+=g.toString(),d.length>h)throw s.kill(),new Error("Command output exceeded maximum size")}),l.on("data",g=>{if(f+=g.toString(),f.length>h)throw s.kill(),new Error("Command error output exceeded maximum size")}),u.on("error",g=>{g.code!=="EPIPE"&&wXe.warn(e,`stdin error: ${g instanceof Error?g.message:String(g)}`)});let m=JSON.stringify(o);return u.write(m),u.end(),new Promise((g,A)=>{let y=n.timeoutSec??30,E=setTimeout(()=>{s.kill("SIGTERM"),A(new Error(`Command timed out after ${y} seconds`))},y*1e3),_=a(()=>{clearTimeout(E)},"cleanup");s.on("error",v=>{_(),A(new Error(`Failed to execute command: ${v.message}`))}),s.on("close",v=>{_(),g(new xXe(r,n,v??0,d,f))})})}buildSpawnOptions(e,r){return{cwd:r.cwd,env:e.env?{...process.env,...e.env}:process.env,stdio:["pipe","pipe","pipe"]}}},k$t=class extends kXe{static{a(this,"BashCommandHookHandler")}isAcceptable(e){return process.platform!=="win32"&&e.type==="command"&&e.bash!==void 0}spawnProcess(e,r){let n={...this.buildSpawnOptions(e,r),shell:!0};return(0,D$t.spawn)(e.bash,[],n)}},P$t=class extends kXe{static{a(this,"PowerShellCommandHookHandler")}isAcceptable(e){return process.platform==="win32"&&e.type==="command"&&e.powershell!==void 0}spawnProcess(e,r){let n=this.buildSpawnOptions(e,r);return(0,D$t.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e.powershell],n)}};var ues=new RXe,XC=class{constructor(e,r,n=[]){this.source=e;this.eventType=r;this.hooks=n}static{a(this,"HookEvent")}async fire(e,r){let n=this.hooks.map(async o=>await ues.execute(e,this,o,r));return(await Promise.all(n)).filter(o=>o!==void 0)}};var lF=class extends XC{static{a(this,"ErrorOccurredEvent")}constructor(e,r=[]){super(e,"errorOccurred",r)}};p();var i2=class extends XC{static{a(this,"PostToolUseEvent")}constructor(e,r=[]){super(e,"postToolUse",r)}};p();var Xue={allow:"allow",deny:"deny",ask:"ask"},o2=class extends XC{static{a(this,"PreToolUseEvent")}constructor(e,r=[]){super(e,"preToolUse",r)}};p();var lJ=class extends XC{static{a(this,"SessionEndEvent")}constructor(e,r=[]){super(e,"sessionEnd",r)}};p();var uJ=class extends XC{static{a(this,"SessionStartEvent")}constructor(e,r=[]){super(e,"sessionStart",r)}};p();var s2=class extends XC{static{a(this,"UserPromptSubmittedEvent")}constructor(e,r=[]){super(e,"userPromptSubmitted",r)}};p();var dJ=class{constructor(e,r,n){this.conversation=e;this.turn=r;this.conversationProgress=n}static{a(this,"HookProgress")}async reportPlanned(e){let r=[];for(let n of e)for(let o of n.hooks)r.push({eventType:n.eventType,source:n.source,status:"planned"});r.length>0&&await this.conversationProgress.report(this.conversation,this.turn,{hookExecutions:r})}async reportResults(e){if(e.length===0)return;let r=e.map(n=>n.type!=="command"?{eventType:n.event.eventType,source:n.event.source,status:"failure"}:{eventType:n.event.eventType,source:n.event.source,status:n.exitCode===0?"success":"failure",result:{exitCode:n.exitCode,stdout:n.stdout,stderr:n.stderr}});await this.conversationProgress.report(this.conversation,this.turn,{hookExecutions:r})}};p();p();function fJ(t){try{return!(!Ft(t,Ye.EnableHooks)||t.get(jl).getPolicyValue("customHook.enabled")===!1)}catch{return!1}}a(fJ,"hooksEnabled");var des=".github/hooks/**/*.json",fes="agentHook.execution",pes={sessionStart:uJ,sessionEnd:lJ,userPromptSubmitted:s2,preToolUse:o2,postToolUse:i2,errorOccurred:lF},mE=class{constructor(e){this.logger=new fe("HookService");this.gateSubscriptions=[];this.ctx=e,this.registration=this.ctx.get(wA).register("hook",[des]),this.subscribeToGateChanges()}static{a(this,"HookService")}dispose(){this.registration.dispose();for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0}async hook(e,r,n,o,s){if(!this.areHooksEnabled())return[];let c=await this.collect(e,r,o);s&&await s(c),c.length>0&&At(e,fes,{eventType:c[0].eventType,eventCount:c.length.toString(),hookCount:c.reduce((u,d)=>u+d.hooks.length,0).toString()});let l=c.map(async u=>await u.fire(e,n));return(await Promise.all(l)).flat()}async listHooks(e){return this.areHooksEnabled()?this.ctx.get(ug).collect(this.ctx,"hook",e):[]}areHooksEnabled(){let e=fJ(this.ctx);return e||this.logger.debug(this.ctx,"Hooks are disabled by configuration or customHook.enabled policy."),e}subscribeToGateChanges(){try{let e=this.ctx.get(Lo);this.lastEnableHooks=Ft(this.ctx,Ye.EnableHooks),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Ft(this.ctx,Ye.EnableHooks);r!==this.lastEnableHooks&&(this.lastEnableHooks=r,this.notifyHookListChanged())}))}catch{}try{let e=this.ctx.get(jl);this.lastCustomHookPolicyEnabled=e.getPolicyValue("customHook.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customHook.enabled");r!==this.lastCustomHookPolicyEnabled&&(this.lastCustomHookPolicyEnabled=r,this.notifyHookListChanged())}))}catch{}}notifyHookListChanged(){try{this.ctx.get(a0).notify("hook").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(hook) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(hook) failed:",e)}}async collect(e,r,n){let o=Object.entries(pes).find(([,l])=>l===r)?.[0];if(!o)return this.logger.warn(this.ctx,`Unknown hook event constructor: ${r.name}`),[];let s=await this.ctx.get(ug).collect(e,"hook",[n]),c=[];for(let l of s){let u=l.parsedPromptFile,d=u.hooks[o];d!==void 0&&c.push(new r(u.uri,[...d]))}return c}};p();function BA(t){return`[${Ji(t)}](${t})`}a(BA,"formatUriForFileWidget");function id(t,e){let r=hes(t,e);if(!r)throw new Error(`Invalid input path: ${t}. Be sure to use an absolute path.`);return r}a(id,"resolvePathInput");function hes(t,e){let r=e?.resolveFromCache(t);if(r)return r;let n=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):\/\//);if(n){let s=n[1].toLowerCase();return GW.has(s)||la.isRegisteredScheme(s)?t:void 0}let o=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(o){let s=o[1].toLowerCase();if(la.isRegisteredScheme(s))return t.replace(/\\/g,"/")}if(t.startsWith("/")||$xn()&&ges(t)||$xn()&&t.startsWith("\\\\"))return Ks(t)}a(hes,"resolveFsUri");function $xn(){return process.platform==="win32"}a($xn,"isWindows");function mes(t){return t>=65&&t<=90||t>=97&&t<=122}a(mes,"isWindowsDriveLetter");function ges(t){return mes(t.charCodeAt(0))&&t.charCodeAt(1)===58}a(ges,"hasDriveLetter");function GO(t){let e="";return t.length>0&&(e=t.map(r=>r instanceof Rr?r.value:r instanceof _K?"":r instanceof KQ?JSON.stringify(r.value):"").join(` -`)),e===""?"(empty)":e}a(GO,"parseToolResultToString");function PXe(t){let{content:e}=t;return{message:GO(e)}}a(PXe,"formatToolErrorResult");function Vxn(t){let{content:e}=t,r={data:e.map(n=>n instanceof Rr?{type:"text",value:n.value}:n instanceof _K?{type:"text",value:""}:n instanceof KQ?{type:"data",value:{mimeType:n.value.mimeType,data:n.value.data}}:{type:"text",value:""})};return t instanceof JQ&&(t.toolResultMessage!==void 0&&(r.toolResultMessage=t.toolResultMessage),t.toolResultDetails!==void 0&&(r.toolResultDetails=t.toolResultDetails),t.toolSpecificData!==void 0&&(r.toolSpecificData=t.toolSpecificData)),r}a(Vxn,"formatToolSuccessResult");function pJ(t){let e=t.match(/(?:Shell:\s*)([a-zA-Z0-9._/-]+)/i);return e?e[1].replace(/[.,;!?]+$/,"").trim():null}a(pJ,"extractShellFromToolDescription");var DXe=new fe("HookTrigger"),ede=class{constructor(e,r,n){this.ctx=e;this.conversation=r;this.workspaceFolders=n}static{a(this,"HookTrigger")}async firePreToolUseHook(e,r,n,o){try{let s=this.ctx.get(mE),c=o?new dJ(this.conversation,o.turn,o.conversationProgress):void 0,l=[];for(let u of this.workspaceFolders){let d=await s.hook(this.ctx,o2,{timestamp:Date.now(),cwd:un(u.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r)},u,c?async f=>{u===this.workspaceFolders[0]&&await c.reportPlanned(f)}:void 0);l.push(...d)}return c&&await c.reportResults(l),this.checkPreToolUseHookResults(l)}catch(s){return DXe.error(this.ctx,`Failed to execute PreToolUse hook for tool ${e.name}`,s),{denied:!1}}}async firePostToolUseHook(e,r,n,o,s){try{let c=this.ctx.get(mE),l=s?new dJ(this.conversation,s.turn,s.conversationProgress):void 0,u=[];for(let d of this.workspaceFolders){let f=await c.hook(this.ctx,i2,{timestamp:Date.now(),cwd:un(d.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r),toolResult:{resultType:this.toToolResultType(n.status),textResultForLlm:GO(n.content)}},d,l?async h=>{d===this.workspaceFolders[0]&&await l.reportPlanned(h)}:void 0);u.push(...f)}l&&await l.reportResults(u)}catch(c){DXe.error(this.ctx,`Failed to execute PostToolUse hook for tool ${e.name}`,c)}}async fireUserPromptSubmittedHook(e,r){try{let n=this.ctx.get(mE),o=this.extractPromptFromMessage(e),s=r?new dJ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,s2,{timestamp:Date.now(),cwd:un(l.uri),prompt:o},l,s?async d=>{l===this.workspaceFolders[0]&&await s.reportPlanned(d)}:void 0);c.push(...u)}s&&await s.reportResults(c)}catch(n){DXe.error(this.ctx,"Failed to execute UserPromptSubmitted hook",n)}}async fireErrorOccurredHook(e,r){try{let n=this.ctx.get(mE),o=Ft(this.ctx,Ye.HookErrorOccurredStackTrace),s=r?new dJ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,lF,{timestamp:Date.now(),cwd:un(l.uri),error:{message:e.message,name:e.name,stack:o?e.stack:void 0}},l,s?async d=>{l===this.workspaceFolders[0]&&await s.reportPlanned(d)}:void 0);c.push(...u)}s&&await s.reportResults(c)}catch(n){DXe.error(this.ctx,"Failed to execute ErrorOccurred hook",n)}}extractPromptFromMessage(e){return typeof e=="string"?e:Array.isArray(e)?e.map(r=>typeof r=="string"?r:typeof r=="object"&&r!==null&&"content"in r&&typeof r.content=="string"?r.content:typeof r=="object"&&r!==null&&"text"in r&&typeof r.text=="string"?r.text:"").filter(Boolean).join(" "):""}checkPreToolUseHookResults(e){for(let r of e){let n=r.output;if(n&&n.permissionDecision===Xue.deny)return{denied:!0,reason:n.permissionDecisionReason||"Tool execution denied by hook"}}return{denied:!1}}toToolResultType(e){switch(e){case"success":return"success";case"error":return"failure";case"cancelled":return"denied";default:return"failure"}}};p();p();var N$t=class{static{a(this,"TurnMetadata")}toString(){return this.constructor.name}},Nwe=class extends N$t{constructor(r){super();this.renderedGlobalContext=r}static{a(this,"GlobalContextMessageMetadata")}};p();p();var hJ=de(Io());var Hn=class t extends hJ.PromptElement{static{a(this,"Tag")}static{this._regex=/^[a-zA-Z_][\w.-]*$/}render(){let{name:e,children:r,attrs:n={}}=this.props;if(!t._regex.test(e))throw new Error(`Invalid tag name: ${this.props.name}. Tag names must start with a letter or underscore, and can contain letters, digits, underscores, hyphens, or periods.`);let o="";for(let[c,l]of Object.entries(n))l!==void 0&&(o+=` ${c}=${JSON.stringify(l)}`);if(r?.length===0)return o?vscpp(hJ.TextChunk,null,vscpp(vscppf,null,`<${e}${o} />`)):void 0;let s=(0,hJ.useKeepWith)();return vscpp(vscppf,null,vscpp(s,null,vscpp(vscppf,null,`<${e}${o}> -`)),vscpp(M$t,{priority:1,flexGrow:1},r,vscpp("br",null)),vscpp(s,null,vscpp(vscppf,null,``)),vscpp("br",null))}},M$t=class extends hJ.PromptElement{static{a(this,"TagInner")}render(){return vscpp(vscppf,null,this.props.children)}};function Wxn(){return vscpp(Hn,{name:"modeInstructions"},'You are currently running in "Ask" mode. Below are your instructions for this mode, they must take precedence over any instructions above.',vscpp("br",null),vscpp("br",null),"You are an ASK AGENT \u2014 a knowledgeable assistant that answers questions, explains code, and provides information.",vscpp("br",null),vscpp("br",null),"You are strictly read-only: NEVER modify files or run commands that change state.",vscpp("br",null),vscpp("br",null),vscpp(Hn,{name:"rules"},"- NEVER use file editing tools, terminal commands that modify state, or any write operations",vscpp("br",null),"- Focus on answering questions, explaining concepts, and providing information",vscpp("br",null),"- Use search and read tools to gather context from the codebase when needed",vscpp("br",null),"- Provide code examples in your responses when helpful, but do NOT apply them",vscpp("br",null),"- When the user's question is about code, reference specific files and symbols",vscpp("br",null),"- If a question would require making changes, explain what changes would be needed but do NOT make them",vscpp("br",null),"- SKIP a plan when: The task is simple and direct. Breaking it down would only produce literal or trivial steps.",vscpp("br",null),"- Keep your response focused and proportional to the question. Don't over-explain simple concepts unless the user asks for more detail."),vscpp("br",null),vscpp(Hn,{name:"capabilities"},"You can help with:",vscpp("br",null),"- **Code explanation**: How does this code work? What does this function do?",vscpp("br",null),"- **Architecture questions**: How is the project structured? How do components interact?",vscpp("br",null),"- **Debugging guidance**: Why might this error occur? What could cause this behavior?",vscpp("br",null),"- **Best practices**: What's the recommended approach for X? How should I structure Y?",vscpp("br",null),"- **API and library questions**: How do I use this API? What does this method expect?",vscpp("br",null),"- **Codebase navigation**: Where is X defined? Where is Y used?",vscpp("br",null),"- **General programming**: Language features, algorithms, design patterns, etc."),vscpp("br",null),vscpp(Hn,{name:"workflow"},"1. **Understand** the question \u2014 identify what the user needs to know",vscpp("br",null),"2. **Research** the codebase if needed \u2014 use search and read tools to find relevant code",vscpp("br",null),"3. **Answer** clearly \u2014 provide a well-structured response with references to relevant code"))}a(Wxn,"renderAskModeInstructionBody");p();p();var jq=class extends lr{static{a(this,"UserOSPrompt")}renderCopilot(e,r,n,o){let s=process.platform;return vscpp(vscppf,null,"The user's current OS is: ",s==="win32"?"Windows":s==="darwin"?"macOS":s==="linux"?"Linux":"Unknown")}};p();var NXe=class extends lr{static{a(this,"UserPreferences")}renderCopilot(e,r,n,o){return vscpp(vscppf,null)}};p();var zxn=require("path");var MXe=class extends lr{static{a(this,"UserShellPrompt")}renderCopilot(e,r,n,o){let s=this.getUserShell(),c=(0,zxn.basename)(s),l=c==="powershell.exe"?" (Windows PowerShell v5.1)":"",u="";return c==="powershell.exe"&&(u=" Use the `;` character if joining commands on a single line is needed."),vscpp(vscppf,null,`The user's default shell is: "`,c,'"',l,". When you generate terminal commands, please generate them correctly for this shell.",u)}getUserShell(){let n=this.props.ctx.get(gs).getToolsForModel().find(o=>o.name==="run_in_terminal"||o.nameForModel==="run_in_terminal");if(n){let o=pJ(n.description);if(o)return o}if(process.env.SHELL)return process.env.SHELL;switch(process.platform){case"win32":return process.env.ComSpec||"cmd.exe";case"darwin":case"linux":return"/bin/bash";default:return"sh"}}};p();var Hq=class extends lr{static{a(this,"WorkspaceFoldersHint")}renderCopilot(e,r,n,o){if(this.props.workspaceFolders&&this.props.workspaceFolders.length>0){let s=this.props.workspaceFolders.map(c=>{let l=to(c.uri);return` - ${la.isRegisteredScheme(l.scheme)?c.uri:rs(c.uri)}`}).join(` -`);return vscpp(vscppf,null,"I am working in a workspace with the following folders:",vscpp("br",null),s)}else return vscpp(vscppf,null,"There is no workspace currently open.")}};p();p();p();function Yxn(t){return t.reduce((r,n)=>r+n.value.length,0)+Math.max(0,t.length-1)}a(Yxn,"partsLength");async function Jxn(t,e=1/0,r){let n=Kxn(0,t,e),o=e-Yxn(n);for(;;){let s=!1,c=[];for(let l of n)if(l.type==="text")c.push(l);else if(l.type==="dir"){c.push({type:"text",uri:l.uri,value:l.value});let u=await l.getChildren();if(r?.isCancellationRequested)return Aes();let d=Kxn(l.level+1,u,o-1);d.length&&(s=!0,o-=Yxn(d)+1,c.push(...d))}if(n=c,!s)break}return{files:n.map(s=>s.uri).filter(s=>s!==void 0),tree:n.map(s=>s.value).join(` -`)}}a(Jxn,"visualFileTree");function Kxn(t,e,r){let n=" ".repeat(t),o=[],s=r;for(let c=0;cs){let d=n+"...";for(;d.length>s&&o.length>0;)s+=o.pop().value.length+1;d.length<=s&&o.push({type:"text",uri:void 0,value:d});break}l.type===2?o.push({type:"dir",uri:l.uri,level:t,value:u,getChildren:l.getChildren}):o.push({type:"text",uri:l.uri,value:u}),s-=u.length,c!==e.length-1&&(s-=1)}return o}a(Kxn,"toParts");var Aes=a(()=>({tree:"",files:[]}),"emptyTree");p();async function OXe(t,e){let r=to(e);return la.isRegisteredScheme(r.scheme)?(await t.get(la).readDirectory(e)).entries.map(s=>[s.name,s.type]):t.get(Qo).readDirectory(e)}a(OXe,"readDirectory");var yes=new fe("fileReferencesPrompt");async function Zxn(t,e,r,n){let o=await Xxn(t,e,r,n);if(!o.length)return"";let s="";for(let{label:l,uri:u,tree:d}of o){let f=to(u),h=la.isRegisteredScheme(f.scheme)?u:un(u);s+=`${l} (Absolute Path: ${h})/ +${s}`:(n.request.message=`Follow instructions in [${l.name}](${l.uri}). ${s}`,n.request.references=[...n.request.references||[],{type:"file",uri:l.uri}]))}}extractKeywordAndQuestionFromRequest(e,r){let[n,...o]=e.trim().split(" "),s=o.join(" ");return[n.replace(r,""),s]}deleteTurn(e,r){this.get(e).deleteTurn(r)}get(e){return this.getHolder(e).conversation}getCapabilities(e){return this.getHolder(e).capabilities}getSupportedSkills(e){let r=this.ctx.get(Xh).getDescriptors().filter(o=>o.type==="implicit").map(o=>o.id),n=this.getCapabilities(e).skills;return[...r,...n]}filterSupportedSkills(e,r){let n=this.getSupportedSkills(e);return r.filter(o=>n.includes(o))}getHolder(e){let r=this.conversations.get(e);if(!r)throw new Error(`Conversation with id ${e} does not exist`);return r}getAll(){let e=this.conversations.values();return Array.from(e).map(r=>r.conversation)}findByTurnId(e){for(let r of this.getAll()){let n=r.findTurn(e);if(n)return{conversation:r,turn:n}}}initializePartitionTranscript(e){try{let r=new g0(this.ctx);if(!r.isEnabled())return;r.initializePartition(e.id,e.currentPartitionId,{source:e.source,createdAt:e.timestamp}).catch(n=>{ot.error(this.ctx,`Failed to initialize partition transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){ot.error(this.ctx,`Failed to create transcript persistence: ${r instanceof Error?r.message:String(r)}`)}}};p();var WXe=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.progress=o;this.rounds=[]}static{a(this,"AgentToolCalls")}getRound(e){return this.rounds.find(r=>r.roundId===e)}getToolCallById(e){for(let r of this.rounds){let n=r.toolCalls?.find(o=>o.id===e);if(n)return n}}init(e,r,n,o,s,c){let l=this.getRound(e);if(l||(l={roundId:e,reply:""},this.rounds.push(l)),l.toolCalls?.find(d=>d.id===r))ot.error(this.ctx,`Tool call ${r} already exists for the round ${e} in conversation ${this.conversation.id} and turn ${this.turn.id}`);else{let d={id:r,name:n,toolType:o,status:"not started",input:s,inputMessage:c};l.toolCalls=[d]}}async running(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.progressMessage=n,o.status="running"})}async finish(e,r){await this.update({roundId:e,toolCallId:r},n=>{n.status="completed"})}async result(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.status="completed",o.result=n.data,n.toolResultMessage&&(o.progressMessage=n.toolResultMessage),o.resultDetails=n.toolResultDetails,o.toolSpecificData=n.toolSpecificData})}async cancel(e,r){await this.update({roundId:e,toolCallId:r},n=>{n.status="cancelled"})}async finishAll(e="completed"){let r=this.rounds.filter(n=>{let o=n.toolCalls?.filter(s=>s.status==="running").map(s=>(s.status=e,s));if(o&&o.length>0)return n.toolCalls=o,!0});r.length>0&&await this.progress.report(this.conversation,this.turn,{editAgentRounds:r})}async error(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.status="error",o.error=n||"Unknown error"})}async updateProgressMessage(e,r,n){await this.update({roundId:e,toolCallId:r,silent:!0},o=>{o.progressMessage=n})}async update({roundId:e,toolCallId:r,silent:n=!1},o){let s=this.rounds.find(l=>l.roundId===e);s||(s={roundId:e,reply:""},this.rounds.push(s));let c=s.toolCalls?.find(l=>l.id===r);c?(o(c),n||await this.progress.report(this.conversation,this.turn,{editAgentRounds:[s]})):ot.error(this.ctx,`Tool call ${r} not found for the agent round ${e} in conversation ${this.conversation.id} and turn ${this.turn.id}`)}};p();var zXe=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.progress=o;this.steps=[]}static{a(this,"Steps")}async start(e,r,n){let o=this.steps.find(s=>s.id===e);if(!o)o={id:e,title:r,description:n,status:"running"},this.steps.push(o),await this.progress.report(this.conversation,this.turn,{steps:[o]});else throw new Error(`Step with id "${e}" already started`)}async finish(e){await this.updateStep(e,r=>{r.status="completed"})}async cancel(e){await this.updateStep(e,r=>{r.status="cancelled"})}async finishAll(e="completed"){let r=this.steps.filter(n=>n.status==="running").map(n=>(n.status=e,n));r.length>0&&await this.progress.report(this.conversation,this.turn,{steps:r})}async error(e,r){return this.updateStep(e,n=>{n.status="failed",n.error={message:r||"Unknown error"}})}async updateStep(e,r){let n=this.steps.find(o=>o.id===e);n?(r(n),await this.progress.report(this.conversation,this.turn,{steps:[n]})):ot.error(this.ctx,`Step ${e} not found for conversation ${this.conversation.id} and turn ${this.turn.id}`)}};p();var irs="X-Initiator",ors="X-Interaction-ID",srs="X-Interaction-Type";var YXe=class{static{a(this,"LlmInteractionInitiator")}static id(){throw new Error("Must be implemented by subclass")}},mVt=class extends YXe{static{a(this,"User")}static id(){return"user"}},gVt=class extends YXe{static{a(this,"Agent")}static id(){return"agent"}},AVt=class{static{a(this,"GenericLlmInteraction")}constructor(e,r,n){this.initiator=e.id(),this.interactionType=r,this.interactionId=n}toCapiHeaders(){return{[irs]:this.initiator,[ors]:this.interactionId,[srs]:this.interactionType.toString()}}cloneAsAgentInteraction(e){return FA.agent(e??this.interactionType,this.interactionId)}},FA=class t extends AVt{static{a(this,"LlmInteraction")}static user(e,r){return new t(mVt,e,r)}static agent(e,r){return new t(gVt,e,r)}};function gRn(t){switch(t){case"Ask":return"conversation-panel";case"Agent":case"InlineAgent":return"conversation-agent";default:return"conversation-other"}}a(gRn,"interactionTypeForChatMode");var Cw=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.cancelationToken=o;this.skillResolver=new yVt(this),this.steps=new zXe(e,r,n,e.get(wc)),this.collector=new EVt(r,n,e.get(wc)),this.agentToolCalls=new WXe(e,r,n,e.get(wc))}static{a(this,"TurnContext")}get uriSchemeCache(){return this.conversation.uriSchemeCache}setResolvedModelConfiguration(e){this.turn.resolvedModelConfiguration=e}toLlmInteraction(){if(this.turn.isSubagent()&&this.turn.parentLlmInteraction)return this.turn.parentLlmInteraction.cloneAsAgentInteraction("conversation-subagent");if(this.conversation.source==="inline")return FA.user("conversation-inline",this.turn.telemetryId);{let e=this.turn.chatMode?.kind==="Agent"?"conversation-agent":"conversation-panel";return this.agentToolCalls.rounds.length?FA.agent(e,this.turn.telemetryId):FA.user(e,this.turn.telemetryId)}}async collectFile(e,r,n,o){let s={type:"file",collector:e,uri:r,status:n};o&&(s.range=o),await this.collector.collect(s)}collectLabel(e,r){this.collector.collect({type:"label",collector:e,label:r})}isFileIncluded(e){return this.collector.collectibles.some(r=>r.type==="file"&&r.status==="included"&&r.uri===e)}async info(e){await this.sendChatNotification(e,"info")}async warn(e){await this.sendChatNotification(e,"warning")}async sendChatNotification(e,r){await this.ctx.get(wc).report(this.conversation,this.turn,{notifications:[{severity:r,message:e}]})}clearCopilotEditsSessionHeader(){this.copilotEditsSessionHeader=void 0}setCopilotEditsSessionHeader(e){this.copilotEditsSessionHeader=e}},KXe=class extends Error{constructor(r,n){super(`Cycle detected while resolving skills: ${n.join(" -> ")} -> ${r}`);this.skillId=r;this.skillStack=n}static{a(this,"CycleError")}},twe=class extends Error{static{a(this,"ConversationAbortError")}constructor(e){super(e)}},yVt=class{constructor(e){this.turnContext=e;this.resolveStack=[]}static{a(this,"SkillResolver")}async resolve(e){if(this.turnContext.ctx.get(zo).getSupportedSkills(this.turnContext.conversation.id).includes(e)){this.ensureNoCycle(e);let n=this.turnContext.ctx.get(vg).getResolvedSkill(this.turnContext.turn.id,e);if(n)return this.resolveStack.pop(),n;let o=await this.newlyResolve(e);return this.resolveStack.pop(),o}}ensureNoCycle(e){if(this.resolveStack.includes(e))throw new KXe(e,this.resolveStack);this.resolveStack.push(e)}async newlyResolve(e){let n=this.turnContext.ctx.get(Xh).getSkill(e);try{let o=await n?.resolver(this.turnContext).resolveSkill(this.turnContext);if(o)return this.turnContext.ctx.get(vg).addResolvedSkill(this.turnContext.turn.id,e,o),o}catch(o){if(o instanceof KXe||o instanceof twe)throw o;ot.exception(this.turnContext.ctx,o,`Error while resolving skill ${e}`)}}},EVt=class{constructor(e,r,n){this.conversation=e;this.turn=r;this.conversationProgress=n;this.collectibles=[]}static{a(this,"Collector")}async collect(e){this.collectibles.push(e),await this.reportCollectedFile(e)}async reportCollectedFile(e){e.type==="file"&&await this.conversationProgress.report(this.conversation,this.turn,{references:[{type:"file",uri:e.uri,status:e.status,range:e.range}]})}collectiblesForCollector(e){return this.collectibles.filter(r=>r.collector===e)}};p();p();p();var ars={preTurnThreshold:.85,postToolCallThreshold:.9,enabled:!1};function ARn(t){let e=Rt(t,ze.AutoCompress);return{...ars,enabled:e}}a(ARn,"getAutomaticCompressionConfig");p();var ej=class t{static{a(this,"TokenBudgetEstimator")}static{this.CHARS_PER_TOKEN=4}static{this.MESSAGE_OVERHEAD_MULTIPLIER=1.15}constructor(){}estimateToolDefinitionTokens(e,r){try{let o=e.get(hs).getToolsForModel(r),s=0;for(let c of o){let l={type:"function",function:{name:c.nameForModel,description:c.description,parameters:c.inputSchema}},u=JSON.stringify(l);s+=Math.ceil(u.length/t.CHARS_PER_TOKEN)}return s}catch{return(r?.customTools?.length??0)*100}}estimateTokensFromText(e){return e?Math.ceil(e.length/t.CHARS_PER_TOKEN):0}estimateSystemMessageTokens(e){return 1500+e.baseTokensPerMessage}shouldCompressWithContextSize(e,r){let{totalTokenLimit:n,totalUsedTokens:o}=e;return!Number.isFinite(n)||n<=0?!1:o/n>=r}calculateContextSize(e,r,n){let o=this.estimateSystemMessageTokens(n),s=r.turns[r.turns.length-1],c=s?this.estimateToolDefinitionTokens(e,s.chatMode):0,l=0,u=0,d=0,f=0;for(let y of r.turns){let E=Pn(y.request.message),_=this.estimateTokensFromText(E)+n.baseTokensPerMessage;if(l+=Math.ceil(_*t.MESSAGE_OVERHEAD_MULTIPLIER),y.request.references?.length&&(d+=Math.ceil(y.request.references.length*50*t.MESSAGE_OVERHEAD_MULTIPLIER)),y.response){let v=Pn(y.response.message),b=this.estimateTokensFromText(v)+n.baseTokensPerMessage;if(u+=Math.ceil(b*t.MESSAGE_OVERHEAD_MULTIPLIER),OK(y.response.message))for(let T of y.response.message){if(T.role==="tool"&&T.content){let w=typeof T.content=="string"?T.content:JSON.stringify(T.content),R=this.estimateTokensFromText(w)+n.baseTokensPerMessage;f+=Math.ceil(R*t.MESSAGE_OVERHEAD_MULTIPLIER)}if(T.thinking){let w=T.thinking;if(typeof w.tokens=="number"&&w.tokens>0)u+=w.tokens;else if(w.text!==void 0){let R=0;if(typeof w.text=="string")R=w.text.length;else if(Array.isArray(w.text))for(let x of w.text)R+=x.length;if(R>0){let x=Math.ceil(R/t.CHARS_PER_TOKEN);u+=Math.ceil(x*t.MESSAGE_OVERHEAD_MULTIPLIER)}}}}}if(y.restoredToolCalls?.length){for(let v of y.restoredToolCalls)if(v.toolCalls?.length){for(let b of v.toolCalls)if(b.result&&Array.isArray(b.result)){let T="";for(let w of b.result)w.type==="text"?T+=w.value:w.type==="data"&&(T+=JSON.stringify(w.value));if(T){let w=this.estimateTokensFromText(T)+n.baseTokensPerMessage;f+=Math.ceil(w*t.MESSAGE_OVERHEAD_MULTIPLIER)}}}}}let h=o+c+l+u+d+f,m=n.maxRequestTokens,g=n.maxResponseTokens,A=m>0?h/m*100:0;return{totalTokenLimit:m,reservedOutputTokens:g,systemPromptTokens:o,toolDefinitionTokens:c,userMessagesTokens:l,assistantMessagesTokens:u,attachedFilesTokens:d,toolResultsTokens:f,totalUsedTokens:h,utilizationPercentage:Math.min(100,Math.round(A*100)/100)}}};var tb=class{constructor(e,r,n){this.compressor=e;this.notifier=r;this.ctx=n;this.tokenEstimator=new ej}static{a(this,"AutomaticCompressionManager")}async checkAndCompress(e,r,n,o,s){let c=this.tokenEstimator.calculateContextSize(this.ctx,e,r),l={estimatedTokens:c.totalUsedTokens,maxTokens:c.totalTokenLimit,utilizationRatio:c.utilizationPercentage/100,turnCount:e.turns.length},u=ARn(this.ctx);if(!u.enabled)return this.sendSkippedTelemetry(e,n,"disabled",l,r),{triggered:!1,tokenEstimate:l,skipReason:"disabled"};let d=n==="pre-turn"?u.preTurnThreshold:u.postToolCallThreshold;return this.tokenEstimator.shouldCompressWithContextSize(c,d)?(ot.info(this.ctx,`Automatic compression triggered: conversationId=${e.id}, trigger=${n}, tokens=${l.estimatedTokens}/${l.maxTokens} (${(l.utilizationRatio*100).toFixed(1)}%)`),await this.performCompression(e,r,n,o,l,s)):(this.sendSkippedTelemetry(e,n,"below_threshold",l,r),{triggered:!1,tokenEstimate:l,skipReason:"below_threshold"})}async performCompression(e,r,n,o,s,c){let l=Date.now(),u=String(e.id),d=e.currentPartitionId,f=e.turns.length;try{await this.notifier.notifyCompressionStarted({conversationId:u,partitionId:d,reason:n});let h=await this.compressor.compressCurrentPartition(e,r,o,c),m=Date.now()-l;if(h.success){let g=e.turns[0],A=typeof g?.request?.message=="string"?g.request.message.length:0,y;try{y=this.tokenEstimator.calculateContextSize(this.ctx,e,r)}catch(E){ot.warn(this.ctx,`Failed to calculate context size after compression: ${E instanceof Error?E.message:String(E)}`)}return await this.notifier.notifyCompressionCompleted({conversationId:u,archivedPartitionId:h.archivedPartitionId,newPartitionId:h.newPartitionId,summaryLength:A,turnCount:f,durationMs:m,contextInfo:y}),this.sendTriggeredTelemetry(e,n,"success",s,h,m,r),{triggered:!0,compressionResult:h,tokenEstimate:s}}else return ot.error(this.ctx,`Automatic compression failed: conversationId=${u}, error=${h.error}`),this.sendTriggeredTelemetry(e,n,"failed",s,h,m,r),{triggered:!0,compressionResult:h,tokenEstimate:s,skipReason:"compression_failed"}}catch(h){let m=Date.now()-l,g=h instanceof Error?h.message:String(h);return ot.exception(this.ctx,h,`Automatic compression exception: conversationId=${u}`),this.sendExceptionTelemetry(e,n,g,s,m,r),{triggered:!0,tokenEstimate:s,skipReason:"compression_failed"}}}sendSkippedTelemetry(e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,reason:n,...s?{modelId:s.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount});ft(this.ctx,"automaticCompression.skipped",c,0)}sendTriggeredTelemetry(e,r,n,o,s,c,l){let u=Vt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,outcome:n,archivedPartitionId:String(s.archivedPartitionId),newPartitionId:String(s.newPartitionId),...s.error&&{error:s.error},...l?{modelId:l.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount,durationMs:c});ft(this.ctx,"automaticCompression.triggered",u,0)}sendExceptionTelemetry(e,r,n,o,s,c){let l=Vt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,outcome:"exception",error:n,...c?{modelId:c.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount,durationMs:s});ft(this.ctx,"automaticCompression.triggered",l,0)}};p();var UA=class extends Error{constructor(r){super(r.message);this.conversationError=r;this.name="AgentConversationError"}static{a(this,"AgentConversationError")}};p();var Vd=class{constructor(e){this.ctx=e}static{a(this,"AbstractClientToolConfirmationInvoker")}};p();p();var JXe=fe(mle());var yRn=new Map;function EE(t,e){return Array.from({length:e-t+1},(r,n)=>(t+n).toString())}a(EE,"createNumberRange");function _Vt(t){return[...t].sort((e,r)=>r.length-e.length)}a(_Vt,"sortByStringLengthDesc");async function crs(t){let e=yRn.get(t);if(e)return e;let r=(async()=>{try{let n=await rVe(`tree-sitter-${t}.wasm`);return await JXe.default.Language.load(n)}catch(n){throw new Error(`Could not load tree-sitter-${t}.wasm: ${n instanceof Error?n.message:String(n)}`)}})();return yRn.set(t,r),r}a(crs,"loadShellLanguage");function ERn(t){let r=t.replace(/\.exe$/i,"").toLowerCase().split(/[/\\]/).pop()||"";return/^(?:powershell|pwsh)(?:-preview)?$/.test(r)}a(ERn,"isPowerShell");var lrs=new Map([["sh",_Vt([...EE(1,9).concat("").map(t=>`${t}<<<`),...EE(1,9).concat("").flatMap(t=>EE(1,9).map(e=>`${t}>&${e}`)),...EE(1,9).concat("").map(t=>`${t}<>`),...EE(1,9).concat("&","").map(t=>`${t}>>`),...EE(1,9).concat("&","").map(t=>`${t}>`),"0<","||","&&","|&","<<","&",";","{",">","<","|","%"])],["zsh",_Vt([...EE(1,9).concat("").map(t=>`${t}<<<`),...EE(1,9).concat("").flatMap(t=>EE(1,9).map(e=>`${t}>&${e}`)),...EE(1,9).concat("").map(t=>`${t}<>`),...EE(1,9).concat("&","").map(t=>`${t}>>`),...EE(1,9).concat("&","").map(t=>`${t}>`),"<(","||",">|",">!","&&","|&","&",";","{","<","|","%"])],["pwsh",_Vt([...EE(1,6).concat("*","").flatMap(t=>EE(1,6).map(e=>`${t}>&${e}`)),...EE(1,6).concat("*","").map(t=>`${t}>>`),...EE(1,6).concat("*","").map(t=>`${t}>`),"&&","<","|",";","!","&","%"])]]);function urs(t,e){let r,n=e.replace(/\.exe$/,"");ERn(e)?r="pwsh":r=(n.split(/[/\\]/).pop()||"")==="zsh"?"zsh":"sh";let o=[t],s=lrs.get(r);if(s)for(let c of s)for(let l=0;ld.trim())),l--)}return o.filter(c=>c.trim().length>0)}a(urs,"splitCommandLineIntoSubCommands");async function ZXe(t,e){try{let r;ERn(e)?r="powershell":r="bash",await JXe.default.init();let n,o;try{n=new JXe.default;let s=await crs(r);return n.setLanguage(s),o=n.parse(t),s.query("(command) @command").captures(o.rootNode).map(u=>u.node.text.trim()).filter(u=>u.length>0)}finally{o?.delete(),n?.delete()}}catch{return urs(t,e)}}a(ZXe,"extractSubCommandsWithTreeSitter");var drs=new Set(["sudo","env"]),frs=/^[A-Za-z_][A-Za-z0-9_]*=/;function vVt(t){let e=t.trim().split(/\s+/).filter(r=>r.length>0);for(let r of e){if(frs.test(r)&&!r.startsWith("/")&&!r.startsWith(".")||drs.has(r.toLowerCase()))continue;let n=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\")),o=n>=0?r.substring(n+1):r;return o.length>0?o:void 0}}a(vVt,"extractCommandNameFromSubCommand");var lde=new pe("CommandLineAutoApprover"),_Rn=/(?!.*)/,prs=/^[A-Z_][A-Z0-9_]*=/i,cT=class{constructor(e){this.ctx=e;this._denyListRules=[];this._allowListRules=[]}static{a(this,"CommandLineAutoApprover")}updateConfiguration(e){let{denyListRules:r,allowListRules:n}=this._mapAutoApproveConfigToRules(e);this._allowListRules=n,this._denyListRules=r}isCommandAutoApproved(e){if(prs.test(e))return{result:"denied",reason:`Command '${e}' is denied because it contains transient environment variables`};for(let r of this._denyListRules)if(this._commandMatchesRegex(r.regex,e))return{result:"denied",reason:`Command '${e}' is denied by deny list rule: ${r.sourceText}`};for(let r of this._allowListRules)if(this._commandMatchesRegex(r.regex,e))return{result:"approved",reason:`Command '${e}' is approved by allow list rule: ${r.sourceText}`};return{result:"noMatch",reason:`Command '${e}' has no matching auto approve entries`}}async isTerminalCommandApprovalRequired(e,r){let n=await ZXe(e,r);lde.info(this.ctx,`Command '${e}' is split into sub-commands: ${JSON.stringify(n)}`);let o=n.map(l=>this.isCommandAutoApproved(l)),s=o.find(l=>l.result==="denied");if(s)return lde.info(this.ctx,`Command '${e}' is denied, reason:'${s.reason}'`),s;if(o.every(l=>l.result==="approved")){let l=`Command '${e}' is approved, reason:'${o.map(u=>u.reason).join("; ")}'`;return lde.info(this.ctx,l),{result:"approved",reason:l}}let c=`Command '${e}' has no matching auto approve entries`;return lde.info(this.ctx,c),{result:"noMatch",reason:c}}async parseTerminalCommand(e,r){let n=await ZXe(e,r),o=[...new Set(n.map(vVt).filter(s=>s!==void 0))];return{subCommands:n,commandNames:o}}async parseTerminalCommandDetailed(e,r){let n=await ZXe(e,r),o=n.map(s=>vVt(s)??"");return{subCommands:n,commandNames:o}}_commandMatchesRegex(e,r){return!!e.test(r)}_mapAutoApproveConfigToRules(e){if(!e||typeof e!="object")return{denyListRules:[],allowListRules:[]};let r=[],n=[];return Object.entries(e).forEach(([o,s])=>{if(typeof s=="boolean"){let c=this._convertAutoApproveEntryToRegex(o);s===!0?n.push({regex:c,sourceText:o}):s===!1&&r.push({regex:c,sourceText:o})}else if(typeof s=="object"&&s!==null){let c=s;if(typeof c.approve=="boolean"){let l=this._convertAutoApproveEntryToRegex(o);c.approve===!0?n.push({regex:l,sourceText:o}):c.approve===!1&&r.push({regex:l,sourceText:o})}}}),lde.debug(this.ctx,"Update CommandLineAutoApprover denyListRules",r),lde.debug(this.ctx,"Update CommandLineAutoApprover allowListRules",n),{denyListRules:r,allowListRules:n}}_convertAutoApproveEntryToRegex(e){let r=e.match(/^\/(?.+)\/(?[dgimsuvy]*)$/),n=r?.groups?.pattern;if(n){let s=r.groups?.flags;s&&(s=s.replaceAll("g",""));try{let c=new RegExp(n,s||void 0);return this._regExpLeadsToEndlessLoop(c)?_Rn:c}catch{return _Rn}}let o=e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return new RegExp(`^${o}\\b`)}_regExpLeadsToEndlessLoop(e){return e.source==="^"||e.source==="^$"||e.source==="$"||e.source==="^\\s*$"?!1:!!(e.exec("")&&e.lastIndex===0)}};p();var XXe=class{constructor(e){this.cache=new Map;this.inner=e}static{a(this,"SnapshotTextDocumentProvider")}getByUri(e){let r=this.cache.get(e);return r||(r=this.inner.getByUri(e),this.cache.set(e,r)),r}};p();var eet=class{constructor(e){this.ctx=e}static{a(this,"DefaultTextDocumentProvider")}async getByUri(e){return await this.ctx.get(ni).getOrReadTextDocument({uri:e})}};p();p();p();p();p();p();var tet=class{constructor(e,r,n,o,s){this.event=e;this.hook=r;this.exitCode=n;this.stdout=o;this.stderr=s;this.type="command";this.output=hrs(this.stdout)}static{a(this,"CommandHookResult")}};function hrs(t){try{return t.trim().length===0?void 0:JSON.parse(t)}catch{return}}a(hrs,"parseOutput");var SVt=require("child_process");var ret=new pe("HookExecutor"),net=class{constructor(){this.handlers=[new CVt,new bVt]}static{a(this,"HookExecutor")}async execute(e,r,n,o){if(!e.get(ip).isTrusted(r.source)){ret.warn(e,`Refusing to execute hook from untrusted workspace folder: ${r.source}`);return}for(let s of this.handlers)if(s.isAcceptable(n))try{return await s.handle(e,r,n,o)}catch(c){ret.error(e,`Hook execution failed: ${c instanceof Error?c.message:String(c)}`);return}ret.warn(e,`Unsupported hook type or platform for hook: ${JSON.stringify(n)}`)}},iet=class{static{a(this,"CommandHookHandler")}async handle(e,r,n,o){o.cwd=n.cwd??o.cwd??process.cwd();let s=this.spawnProcess(n,o);if(!s.stdout||!s.stderr||!s.stdin)throw new Error("Failed to create child process with stdio pipes");let{stdout:c,stderr:l,stdin:u}=s,d="",f="",h=10*1024*1024;c.on("data",g=>{if(d+=g.toString(),d.length>h)throw s.kill(),new Error("Command output exceeded maximum size")}),l.on("data",g=>{if(f+=g.toString(),f.length>h)throw s.kill(),new Error("Command error output exceeded maximum size")}),u.on("error",g=>{g.code!=="EPIPE"&&ret.warn(e,`stdin error: ${g instanceof Error?g.message:String(g)}`)});let m=JSON.stringify(o);return u.write(m),u.end(),new Promise((g,A)=>{let y=n.timeoutSec??30,E=setTimeout(()=>{s.kill("SIGTERM"),A(new Error(`Command timed out after ${y} seconds`))},y*1e3),_=a(()=>{clearTimeout(E)},"cleanup");s.on("error",v=>{_(),A(new Error(`Failed to execute command: ${v.message}`))}),s.on("close",v=>{_(),g(new tet(r,n,v??0,d,f))})})}buildSpawnOptions(e,r){return{cwd:r.cwd,env:e.env?{...process.env,...e.env}:process.env,stdio:["pipe","pipe","pipe"]}}},CVt=class extends iet{static{a(this,"BashCommandHookHandler")}isAcceptable(e){return process.platform!=="win32"&&e.type==="command"&&e.bash!==void 0}spawnProcess(e,r){let n={...this.buildSpawnOptions(e,r),shell:!0};return(0,SVt.spawn)(e.bash,[],n)}},bVt=class extends iet{static{a(this,"PowerShellCommandHookHandler")}isAcceptable(e){return process.platform==="win32"&&e.type==="command"&&e.powershell!==void 0}spawnProcess(e,r){let n=this.buildSpawnOptions(e,r);return(0,SVt.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e.powershell],n)}};var mrs=new net,rb=class{constructor(e,r,n=[]){this.source=e;this.eventType=r;this.hooks=n}static{a(this,"HookEvent")}async fire(e,r){let n=this.hooks.map(async o=>await mrs.execute(e,this,o,r));return(await Promise.all(n)).filter(o=>o!==void 0)}};var AF=class extends rb{static{a(this,"ErrorOccurredEvent")}constructor(e,r=[]){super(e,"errorOccurred",r)}};p();var f2=class extends rb{static{a(this,"PostToolUseEvent")}constructor(e,r=[]){super(e,"postToolUse",r)}};p();var ude={allow:"allow",deny:"deny",ask:"ask"},p2=class extends rb{static{a(this,"PreToolUseEvent")}constructor(e,r=[]){super(e,"preToolUse",r)}};p();var EJ=class extends rb{static{a(this,"SessionEndEvent")}constructor(e,r=[]){super(e,"sessionEnd",r)}};p();var _J=class extends rb{static{a(this,"SessionStartEvent")}constructor(e,r=[]){super(e,"sessionStart",r)}};p();var h2=class extends rb{static{a(this,"UserPromptSubmittedEvent")}constructor(e,r=[]){super(e,"userPromptSubmitted",r)}};p();var vJ=class{constructor(e,r,n){this.conversation=e;this.turn=r;this.conversationProgress=n}static{a(this,"HookProgress")}async reportPlanned(e){let r=[];for(let n of e)for(let o of n.hooks)r.push({eventType:n.eventType,source:n.source,status:"planned"});r.length>0&&await this.conversationProgress.report(this.conversation,this.turn,{hookExecutions:r})}async reportResults(e){if(e.length===0)return;let r=e.map(n=>n.type!=="command"?{eventType:n.event.eventType,source:n.event.source,status:"failure"}:{eventType:n.event.eventType,source:n.event.source,status:n.exitCode===0?"success":"failure",result:{exitCode:n.exitCode,stdout:n.stdout,stderr:n.stderr}});await this.conversationProgress.report(this.conversation,this.turn,{hookExecutions:r})}};p();p();function CJ(t){try{return!(!Rt(t,ze.EnableHooks)||t.get(Hl).getPolicyValue("customHook.enabled")===!1)}catch{return!1}}a(CJ,"hooksEnabled");var grs=".github/hooks/**/*.json",vRn="agentHook.execution",Ars={sessionStart:_J,sessionEnd:EJ,userPromptSubmitted:h2,preToolUse:p2,postToolUse:f2,errorOccurred:AF},_E=class{constructor(e){this.logger=new pe("HookService");this.gateSubscriptions=[];this.ctx=e,this.registration=this.ctx.get(PA).register("hook",[grs]),this.subscribeToGateChanges()}static{a(this,"HookService")}dispose(){this.registration.dispose();for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0}async hook(e,r,n,o,s){if(!this.areHooksEnabled())return[];let c=await this.collect(e,r,o);s&&await s(c),c.length>0&&(ft(e,vRn),cr(e,vRn,{eventType:c[0].eventType,eventCount:c.length.toString(),hookCount:c.reduce((u,d)=>u+d.hooks.length,0).toString()}));let l=c.map(async u=>await u.fire(e,n));return(await Promise.all(l)).flat()}async listHooks(e){return this.areHooksEnabled()?this.ctx.get(pg).collect(this.ctx,"hook",e):[]}areHooksEnabled(){let e=CJ(this.ctx);return e||this.logger.debug(this.ctx,"Hooks are disabled by configuration or customHook.enabled policy."),e}subscribeToGateChanges(){try{let e=this.ctx.get(Lo);this.lastEnableHooks=Rt(this.ctx,ze.EnableHooks),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Rt(this.ctx,ze.EnableHooks);r!==this.lastEnableHooks&&(this.lastEnableHooks=r,this.notifyHookListChanged())}))}catch{}try{let e=this.ctx.get(Hl);this.lastCustomHookPolicyEnabled=e.getPolicyValue("customHook.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customHook.enabled");r!==this.lastCustomHookPolicyEnabled&&(this.lastCustomHookPolicyEnabled=r,this.notifyHookListChanged())}))}catch{}}notifyHookListChanged(){try{this.ctx.get(d0).notify("hook").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(hook) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(hook) failed:",e)}}async collect(e,r,n){let o=Object.entries(Ars).find(([,l])=>l===r)?.[0];if(!o)return this.logger.warn(this.ctx,`Unknown hook event constructor: ${r.name}`),[];let s=await this.ctx.get(pg).collect(e,"hook",[n]),c=[];for(let l of s){let u=l.parsedPromptFile,d=u.hooks[o];d!==void 0&&c.push(new r(u.uri,[...d]))}return c}};p();function QA(t){return`[${Ki(t)}](${t})`}a(QA,"formatUriForFileWidget");function cd(t,e){let r=yrs(t,e);if(!r)throw new Error(`Invalid input path: ${t}. Be sure to use an absolute path.`);return r}a(cd,"resolvePathInput");function yrs(t,e){let r=e?.resolveFromCache(t);if(r)return r;let n=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):\/\//);if(n){let s=n[1].toLowerCase();return rz.has(s)||ua.isRegisteredScheme(s)?t:void 0}let o=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(o){let s=o[1].toLowerCase();if(ua.isRegisteredScheme(s))return t.replace(/\\/g,"/")}if(t.startsWith("/")||CRn()&&_rs(t)||CRn()&&t.startsWith("\\\\"))return ts(t)}a(yrs,"resolveFsUri");function CRn(){return process.platform==="win32"}a(CRn,"isWindows");function Ers(t){return t>=65&&t<=90||t>=97&&t<=122}a(Ers,"isWindowsDriveLetter");function _rs(t){return Ers(t.charCodeAt(0))&&t.charCodeAt(1)===58}a(_rs,"hasDriveLetter");function KO(t){let e="";return t.length>0&&(e=t.map(r=>r instanceof Pr?r.value:r instanceof PK?"":r instanceof cq?JSON.stringify(r.value):"").join(` +`)),e===""?"(empty)":e}a(KO,"parseToolResultToString");function oet(t){let{content:e}=t;return{message:KO(e)}}a(oet,"formatToolErrorResult");function bRn(t){let{content:e}=t,r={data:e.map(n=>n instanceof Pr?{type:"text",value:n.value}:n instanceof PK?{type:"text",value:""}:n instanceof cq?{type:"data",value:{mimeType:n.value.mimeType,data:n.value.data}}:{type:"text",value:""})};return t instanceof lq&&(t.toolResultMessage!==void 0&&(r.toolResultMessage=t.toolResultMessage),t.toolResultDetails!==void 0&&(r.toolResultDetails=t.toolResultDetails),t.toolSpecificData!==void 0&&(r.toolSpecificData=t.toolSpecificData)),r}a(bRn,"formatToolSuccessResult");function bJ(t){let e=t.match(/(?:Shell:\s*)([a-zA-Z0-9._/-]+)/i);return e?e[1].replace(/[.,;!?]+$/,"").trim():null}a(bJ,"extractShellFromToolDescription");var set=new pe("HookTrigger"),dde=class{constructor(e,r,n){this.ctx=e;this.conversation=r;this.workspaceFolders=n}static{a(this,"HookTrigger")}async firePreToolUseHook(e,r,n,o){try{let s=this.ctx.get(_E),c=o?new vJ(this.conversation,o.turn,o.conversationProgress):void 0,l=[];for(let u of this.workspaceFolders){let d=await s.hook(this.ctx,p2,{timestamp:Date.now(),cwd:ln(u.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r)},u,c?async f=>{u===this.workspaceFolders[0]&&await c.reportPlanned(f)}:void 0);l.push(...d)}return c&&await c.reportResults(l),this.checkPreToolUseHookResults(l)}catch(s){return set.error(this.ctx,`Failed to execute PreToolUse hook for tool ${e.name}`,s),{denied:!1}}}async firePostToolUseHook(e,r,n,o,s){try{let c=this.ctx.get(_E),l=s?new vJ(this.conversation,s.turn,s.conversationProgress):void 0,u=[];for(let d of this.workspaceFolders){let f=await c.hook(this.ctx,f2,{timestamp:Date.now(),cwd:ln(d.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r),toolResult:{resultType:this.toToolResultType(n.status),textResultForLlm:KO(n.content)}},d,l?async h=>{d===this.workspaceFolders[0]&&await l.reportPlanned(h)}:void 0);u.push(...f)}l&&await l.reportResults(u)}catch(c){set.error(this.ctx,`Failed to execute PostToolUse hook for tool ${e.name}`,c)}}async fireUserPromptSubmittedHook(e,r){try{let n=this.ctx.get(_E),o=this.extractPromptFromMessage(e),s=r?new vJ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,h2,{timestamp:Date.now(),cwd:ln(l.uri),prompt:o},l,s?async d=>{l===this.workspaceFolders[0]&&await s.reportPlanned(d)}:void 0);c.push(...u)}s&&await s.reportResults(c)}catch(n){set.error(this.ctx,"Failed to execute UserPromptSubmitted hook",n)}}async fireErrorOccurredHook(e,r){try{let n=this.ctx.get(_E),o=Rt(this.ctx,ze.HookErrorOccurredStackTrace),s=r?new vJ(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,AF,{timestamp:Date.now(),cwd:ln(l.uri),error:{message:e.message,name:e.name,stack:o?e.stack:void 0}},l,s?async d=>{l===this.workspaceFolders[0]&&await s.reportPlanned(d)}:void 0);c.push(...u)}s&&await s.reportResults(c)}catch(n){set.error(this.ctx,"Failed to execute ErrorOccurred hook",n)}}extractPromptFromMessage(e){return typeof e=="string"?e:Array.isArray(e)?e.map(r=>typeof r=="string"?r:typeof r=="object"&&r!==null&&"content"in r&&typeof r.content=="string"?r.content:typeof r=="object"&&r!==null&&"text"in r&&typeof r.text=="string"?r.text:"").filter(Boolean).join(" "):""}checkPreToolUseHookResults(e){for(let r of e){let n=r.output;if(n&&n.permissionDecision===ude.deny)return{denied:!0,reason:n.permissionDecisionReason||"Tool execution denied by hook"}}return{denied:!1}}toToolResultType(e){switch(e){case"success":return"success";case"error":return"failure";case"cancelled":return"denied";default:return"failure"}}};p();p();var TVt=class{static{a(this,"TurnMetadata")}toString(){return this.constructor.name}},Zwe=class extends TVt{constructor(r){super();this.renderedGlobalContext=r}static{a(this,"GlobalContextMessageMetadata")}};p();p();var SJ=fe(Io());var Hn=class t extends SJ.PromptElement{static{a(this,"Tag")}static{this._regex=/^[a-zA-Z_][\w.-]*$/}render(){let{name:e,children:r,attrs:n={}}=this.props;if(!t._regex.test(e))throw new Error(`Invalid tag name: ${this.props.name}. Tag names must start with a letter or underscore, and can contain letters, digits, underscores, hyphens, or periods.`);let o="";for(let[c,l]of Object.entries(n))l!==void 0&&(o+=` ${c}=${JSON.stringify(l)}`);if(r?.length===0)return o?vscpp(SJ.TextChunk,null,vscpp(vscppf,null,`<${e}${o} />`)):void 0;let s=(0,SJ.useKeepWith)();return vscpp(vscppf,null,vscpp(s,null,vscpp(vscppf,null,`<${e}${o}> +`)),vscpp(IVt,{priority:1,flexGrow:1},r,vscpp("br",null)),vscpp(s,null,vscpp(vscppf,null,``)),vscpp("br",null))}},IVt=class extends SJ.PromptElement{static{a(this,"TagInner")}render(){return vscpp(vscppf,null,this.props.children)}};function SRn(){return vscpp(Hn,{name:"modeInstructions"},'You are currently running in "Ask" mode. Below are your instructions for this mode, they must take precedence over any instructions above.',vscpp("br",null),vscpp("br",null),"You are an ASK AGENT \u2014 a knowledgeable assistant that answers questions, explains code, and provides information.",vscpp("br",null),vscpp("br",null),"You are strictly read-only: NEVER modify files or run commands that change state.",vscpp("br",null),vscpp("br",null),vscpp(Hn,{name:"rules"},"- NEVER use file editing tools, terminal commands that modify state, or any write operations",vscpp("br",null),"- Focus on answering questions, explaining concepts, and providing information",vscpp("br",null),"- Use search and read tools to gather context from the codebase when needed",vscpp("br",null),"- Provide code examples in your responses when helpful, but do NOT apply them",vscpp("br",null),"- When the user's question is about code, reference specific files and symbols",vscpp("br",null),"- If a question would require making changes, explain what changes would be needed but do NOT make them",vscpp("br",null),"- SKIP a plan when: The task is simple and direct. Breaking it down would only produce literal or trivial steps.",vscpp("br",null),"- Keep your response focused and proportional to the question. Don't over-explain simple concepts unless the user asks for more detail."),vscpp("br",null),vscpp(Hn,{name:"capabilities"},"You can help with:",vscpp("br",null),"- **Code explanation**: How does this code work? What does this function do?",vscpp("br",null),"- **Architecture questions**: How is the project structured? How do components interact?",vscpp("br",null),"- **Debugging guidance**: Why might this error occur? What could cause this behavior?",vscpp("br",null),"- **Best practices**: What's the recommended approach for X? How should I structure Y?",vscpp("br",null),"- **API and library questions**: How do I use this API? What does this method expect?",vscpp("br",null),"- **Codebase navigation**: Where is X defined? Where is Y used?",vscpp("br",null),"- **General programming**: Language features, algorithms, design patterns, etc."),vscpp("br",null),vscpp(Hn,{name:"workflow"},"1. **Understand** the question \u2014 identify what the user needs to know",vscpp("br",null),"2. **Research** the codebase if needed \u2014 use search and read tools to find relevant code",vscpp("br",null),"3. **Answer** clearly \u2014 provide a well-structured response with references to relevant code"))}a(SRn,"renderAskModeInstructionBody");p();p();var tj=class extends lr{static{a(this,"UserOSPrompt")}renderCopilot(e,r,n,o){let s=process.platform;return vscpp(vscppf,null,"The user's current OS is: ",s==="win32"?"Windows":s==="darwin"?"macOS":s==="linux"?"Linux":"Unknown")}};p();var aet=class extends lr{static{a(this,"UserPreferences")}renderCopilot(e,r,n,o){return vscpp(vscppf,null)}};p();var TRn=require("path");var cet=class extends lr{static{a(this,"UserShellPrompt")}renderCopilot(e,r,n,o){let s=this.getUserShell(),c=(0,TRn.basename)(s),l=c==="powershell.exe"?" (Windows PowerShell v5.1)":"",u="";return c==="powershell.exe"&&(u=" Use the `;` character if joining commands on a single line is needed."),vscpp(vscppf,null,`The user's default shell is: "`,c,'"',l,". When you generate terminal commands, please generate them correctly for this shell.",u)}getUserShell(){let n=this.props.ctx.get(hs).getToolsForModel().find(o=>o.name==="run_in_terminal"||o.nameForModel==="run_in_terminal");if(n){let o=bJ(n.description);if(o)return o}if(process.env.SHELL)return process.env.SHELL;switch(process.platform){case"win32":return process.env.ComSpec||"cmd.exe";case"darwin":case"linux":return"/bin/bash";default:return"sh"}}};p();var rj=class extends lr{static{a(this,"WorkspaceFoldersHint")}renderCopilot(e,r,n,o){if(this.props.workspaceFolders&&this.props.workspaceFolders.length>0){let s=this.props.workspaceFolders.map(c=>{let l=eo(c.uri);return` - ${ua.isRegisteredScheme(l.scheme)?c.uri:Us(c.uri)}`}).join(` +`);return vscpp(vscppf,null,"I am working in a workspace with the following folders:",vscpp("br",null),s)}else return vscpp(vscppf,null,"There is no workspace currently open.")}};p();p();p();function IRn(t){return t.reduce((r,n)=>r+n.value.length,0)+Math.max(0,t.length-1)}a(IRn,"partsLength");async function wRn(t,e=1/0,r){let n=xRn(0,t,e),o=e-IRn(n);for(;;){let s=!1,c=[];for(let l of n)if(l.type==="text")c.push(l);else if(l.type==="dir"){c.push({type:"text",uri:l.uri,value:l.value});let u=await l.getChildren();if(r?.isCancellationRequested)return vrs();let d=xRn(l.level+1,u,o-1);d.length&&(s=!0,o-=IRn(d)+1,c.push(...d))}if(n=c,!s)break}return{files:n.map(s=>s.uri).filter(s=>s!==void 0),tree:n.map(s=>s.value).join(` +`)}}a(wRn,"visualFileTree");function xRn(t,e,r){let n=" ".repeat(t),o=[],s=r;for(let c=0;cs){let d=n+"...";for(;d.length>s&&o.length>0;)s+=o.pop().value.length+1;d.length<=s&&o.push({type:"text",uri:void 0,value:d});break}l.type===2?o.push({type:"dir",uri:l.uri,level:t,value:u,getChildren:l.getChildren}):o.push({type:"text",uri:l.uri,value:u}),s-=u.length,c!==e.length-1&&(s-=1)}return o}a(xRn,"toParts");var vrs=a(()=>({tree:"",files:[]}),"emptyTree");p();async function uet(t,e){let r=eo(e);return ua.isRegisteredScheme(r.scheme)?(await t.get(ua).readDirectory(e)).entries.map(s=>[s.name,s.type]):t.get(Qo).readDirectory(e)}a(uet,"readDirectory");var Crs=new pe("fileReferencesPrompt");async function RRn(t,e,r,n){let o=await kRn(t,e,r,n);if(!o.length)return"";let s="";for(let{label:l,uri:u,tree:d}of o){let f=eo(u),h=ua.isRegisteredScheme(f.scheme)?u:ln(u);s+=`${l} (Absolute Path: ${h})/ `;for(let m of d.tree.split(` `))s+=` ${m} -`}let c=DA(s);return["I am working in a workspace that has the following structure:",c,s,c,"This view of the workspace structure may be truncated. You can use tools to collect more context if needed."].join(` -`)}a(Zxn,"generateWorkspaceStructurePrompt");async function Xxn(t,e,r,n){return e.length?Promise.all(e.map(async o=>{let s=o.name,c=o.uri,l=await Jxn(await ewn(t,o.uri,r,n),r.maxLength/e.length,n);return{label:s,uri:c,tree:l}})):[]}a(Xxn,"generateWorkspaceStructure");async function ewn(t,e,r,n){if(n.isCancellationRequested)return[];let o;try{o=await OXe(t,e)}catch{return[]}return n.isCancellationRequested?[]:(o.sort((s,c)=>s[1]===c[1]?s[0].localeCompare(c[0]):s[1]&2?1:-1),Promise.all(o.map(([s,c])=>{let l=wa(e,s);return!la.isRegisteredScheme(to(e).scheme)&&r.excludeDotFiles&&s.startsWith(".")||ves(l)?null:c&2?{type:2,uri:l,name:s,getChildren:a(()=>ewn(t,l,r,n),"getChildren")}:{type:1,uri:l,name:s}})).then(s=>s.filter(c=>c!=null)))}a(ewn,"buildFileList");var Ees=["node_modules","venv","out","dist",".git",".yarn",".npm",".venv","foo.asar",".vscode-test"],_es=[".ds_store","thumbs.db","package-lock.json","yarn.lock",".cache"];function ves(t){return!!(_es.includes(Ji(t).toLowerCase())||rs(t)?.toLowerCase()?.split(/[/\\]/g)?.some(r=>Ees.includes(r)))}a(ves,"shouldAlwaysIgnoreFile");async function LXe(t,e,r){if(r.length===0)return[];try{let n=r.map(c=>({uri:c.uri,name:Ji(c.uri)})),o=await Xxn(t,n,{maxLength:2e3,excludeDotFiles:!0},e),s=[];for(let{label:c,uri:l,tree:u}of o)s.push(""),s.push(`Directory: ${c} (${un(l)})`),s.push(u.tree),s.push("");return s}catch(n){return yes.warn(t,`Failed to generate directory structure: ${String(n)}`),[]}}a(LXe,"processDirectoryReferences");var tde=class extends lr{static{a(this,"WorkspaceStructure")}async renderCopilot(e,r,n,o){if(!this.props.workspaceFolders)return vscpp(vscppf,null);let s=await Zxn(this.props.ctx,this.props.workspaceFolders,{maxLength:this.props.maxSize||2e3,excludeDotFiles:this.props.excludeDotFiles??!0},o||Fn.CancellationToken.None);return s?vscpp(vscppf,null,s):vscpp(vscppf,null)}};var twn=de(Io());var Mwe=class extends lr{static{a(this,"GlobalAgentContext")}renderCopilot(e,r,n,o){return vscpp(twn.UserMessage,null,vscpp(Hn,{name:"environment_info"},vscpp(jq,{ctx:this.props.ctx}),vscpp(MXe,{ctx:this.props.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Hq,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders}),vscpp(tde,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders,maxSize:2e3,excludeDotFiles:!0})),vscpp(NXe,{ctx:this.props.ctx,flexGrow:7,priority:800}))}};p();p();var BXe=de(require("path"));function L$t(t){let e=Ft(t,Ye.EnableSkills),r=t.get(jl).getPolicyValue("customSkill.enabled")!==!1;return e&&r}a(L$t,"isSkillsEnabled");var O$t=class{constructor(e){this.promptFileEntry=e}static{a(this,"CustomSkill")}get id(){return this.promptFileEntry.promptPath.uri}get uri(){return this.promptFileEntry.promptPath.uri}get name(){return this.promptFileEntry.parsedPromptFile.header?.name||Ji(uf(this.uri))}get description(){return this.promptFileEntry.parsedPromptFile.header?.description}get storage(){return this.promptFileEntry.promptPath.storage}get pluginUri(){return zQ(this.promptFileEntry.promptPath)}get providers(){return x3(this.promptFileEntry.promptPath.metadata)}},h0=class t{constructor(e,r,n){this.ctx=e;this.configProvider=r;this.promptFileLocationRegistry=n;this.registrySkillPatterns=[];this.skillFileLocationsPatterns=[];this.logger=new fe("CustomSkillService");this._onDidChangeSkillsEnabled=new ep;this.onDidChangeSkillsEnabled=this._onDidChangeSkillsEnabled.event;this.gateSubscriptions=[];this.lastSkillsEnabled=!1;this.syncRegistry(),this.configProvider.onDidChangeCopilotSettings(this.skipIfSkillsEnabledUnchanged(()=>{this.syncRegistry(),this.fireSkillsEnabledIfChanged()})),this.subscribeToGateChanges(),this.lastSkillsEnabled=this.isSkillsEnabled()}static{a(this,"CustomSkillService")}static{this.WORKSPACE_AGENTS_SKILLS=".agents/skills/**/SKILL.md"}static{this.WORKSPACE_GITHUB_SKILLS=".github/skills/**/SKILL.md"}static{this.GLOBAL_AGENTS_SKILLS="~/.agents/skills/**/SKILL.md"}static{this.GLOBAL_COPILOT_SKILLS="~/.copilot/skills/**/SKILL.md"}static{this.CLAUDE_SKILL_PATTERNS=[".claude/skills/**/SKILL.md","~/.claude/skills/**/SKILL.md"]}static{this.SKILL_PATTERNS_BY_PROVIDER={LOCAL:[t.WORKSPACE_AGENTS_SKILLS,t.WORKSPACE_GITHUB_SKILLS,t.GLOBAL_AGENTS_SKILLS,t.GLOBAL_COPILOT_SKILLS,...t.CLAUDE_SKILL_PATTERNS],BACKGROUND:[t.WORKSPACE_AGENTS_SKILLS,t.WORKSPACE_GITHUB_SKILLS,t.GLOBAL_AGENTS_SKILLS,t.GLOBAL_COPILOT_SKILLS,...t.CLAUDE_SKILL_PATTERNS],CLAUDE:t.CLAUDE_SKILL_PATTERNS}}static{this.SKILL_GLOB_SUFFIX="**/SKILL.md"}fireSkillsEnabledIfChanged(){let e=this.isSkillsEnabled();e!==this.lastSkillsEnabled&&(this.lastSkillsEnabled=e,this._onDidChangeSkillsEnabled.fire(e))}subscribeToGateChanges(){try{let e=this.ctx.get(jl);this.lastCustomSkillPolicyEnabled=e.getPolicyValue("customSkill.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customSkill.enabled");r!==this.lastCustomSkillPolicyEnabled&&(this.lastCustomSkillPolicyEnabled=r,this.notifySkillListChanged(),this.fireSkillsEnabledIfChanged())}))}catch{}}notifySkillListChanged(){try{this.ctx.get(a0).notify("skill").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(skill) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(skill) failed:",e)}}dispose(){for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0,this.disposeSkillPatterns(),this._onDidChangeSkillsEnabled.dispose()}disposeSkillPatterns(){for(let e of this.registrySkillPatterns)try{e.dispose()}catch{}this.registrySkillPatterns=[]}skipIfSkillsEnabledUnchanged(e){let r=Ft(this.ctx,Ye.EnableSkills);return()=>{let n=Ft(this.ctx,Ye.EnableSkills);r!==n&&(r=n,e())}}isSkillsEnabled(){return L$t(this.ctx)}syncRegistry(){if(this.disposeSkillPatterns(),!Ft(this.ctx,Ye.EnableSkills))return;let e=new Map;for(let r of Object.keys(t.SKILL_PATTERNS_BY_PROVIDER))for(let n of t.SKILL_PATTERNS_BY_PROVIDER[r]){let o=e.get(n);o||(o=new Set,e.set(n,o)),o.add(r)}for(let[r,n]of e)this.registrySkillPatterns.push(this.promptFileLocationRegistry.register("skill",[r],{metadata:{providers:[...n]}}));this.skillFileLocationsPatterns.length>0&&this.registrySkillPatterns.push(this.promptFileLocationRegistry.register("skill",[...this.skillFileLocationsPatterns],{metadata:{providers:["LOCAL","BACKGROUND"]}}))}setSkillFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(un(n.uri)):n.type==="location"&&r.add(BXe.default.posix.join(n.path,t.SKILL_GLOB_SUFFIX));this.skillFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listSkills(e,r){return this.isSkillsEnabled()?(await this.ctx.get(ug).collect(this.ctx,"skill",e,{includePlugins:r?.includePlugins})).map(s=>new O$t(s)):[]}getSkillDirectories(e){if(!this.isSkillsEnabled())return[];let r=this.promptFileLocationRegistry.resolvePatterns("skill",[e]),n=new Set;for(let{pattern:o}of r){let s=t.extractDirectoryFromResolvedPattern(o);s&&n.add(s)}return Array.from(n)}static extractDirectoryFromResolvedPattern(e){let r=e;if(r.endsWith(t.SKILL_GLOB_SUFFIX)?(r=r.slice(0,-t.SKILL_GLOB_SUFFIX.length),r.endsWith("/")&&(r=r.slice(0,-1))):r.endsWith("SKILL.md")&&(r=BXe.default.dirname(r)),!!r)return BXe.default.normalize(r)}};var FXe=class extends lr{static{a(this,"SkillListPrompt")}async renderCopilot(){if(this.props.turnContext.cachedSkillListPrompt!==void 0)return this.props.turnContext.cachedSkillListPrompt??vscpp(vscppf,null);let e=this.props.workspaceFolders?this.props.workspaceFolders.map(c=>({uri:c.uri})):[];if(e.length===0)return this.props.turnContext.cachedSkillListPrompt=null,vscpp(vscppf,null);let n=await this.props.turnContext.ctx.get(h0).listSkills(e);if(At(this.props.turnContext.ctx,"skills.list_in_prompt",void 0,{count:n.length}),n.length===0)return this.props.turnContext.cachedSkillListPrompt=null,vscpp(vscppf,null);let o=n.map(c=>` +`}let c=OA(s);return["I am working in a workspace that has the following structure:",c,s,c,"This view of the workspace structure may be truncated. You can use tools to collect more context if needed."].join(` +`)}a(RRn,"generateWorkspaceStructurePrompt");async function kRn(t,e,r,n){return e.length?Promise.all(e.map(async o=>{let s=o.name,c=o.uri,l=await wRn(await PRn(t,o.uri,r,n),r.maxLength/e.length,n);return{label:s,uri:c,tree:l}})):[]}a(kRn,"generateWorkspaceStructure");async function PRn(t,e,r,n){if(n.isCancellationRequested)return[];let o;try{o=await uet(t,e)}catch{return[]}return n.isCancellationRequested?[]:(o.sort((s,c)=>s[1]===c[1]?s[0].localeCompare(c[0]):s[1]&2?1:-1),Promise.all(o.map(([s,c])=>{let l=wa(e,s);return!ua.isRegisteredScheme(eo(e).scheme)&&r.excludeDotFiles&&s.startsWith(".")||Trs(l)?null:c&2?{type:2,uri:l,name:s,getChildren:a(()=>PRn(t,l,r,n),"getChildren")}:{type:1,uri:l,name:s}})).then(s=>s.filter(c=>c!=null)))}a(PRn,"buildFileList");var brs=["node_modules","venv","out","dist",".git",".yarn",".npm",".venv","foo.asar",".vscode-test"],Srs=[".ds_store","thumbs.db","package-lock.json","yarn.lock",".cache"];function Trs(t){return!!(Srs.includes(Ki(t).toLowerCase())||Us(t)?.toLowerCase()?.split(/[/\\]/g)?.some(r=>brs.includes(r)))}a(Trs,"shouldAlwaysIgnoreFile");async function det(t,e,r){if(r.length===0)return[];try{let n=r.map(c=>({uri:c.uri,name:Ki(c.uri)})),o=await kRn(t,n,{maxLength:2e3,excludeDotFiles:!0},e),s=[];for(let{label:c,uri:l,tree:u}of o)s.push(""),s.push(`Directory: ${c} (${ln(l)})`),s.push(u.tree),s.push("");return s}catch(n){return Crs.warn(t,`Failed to generate directory structure: ${String(n)}`),[]}}a(det,"processDirectoryReferences");var fde=class extends lr{static{a(this,"WorkspaceStructure")}async renderCopilot(e,r,n,o){if(!this.props.workspaceFolders)return vscpp(vscppf,null);let s=await RRn(this.props.ctx,this.props.workspaceFolders,{maxLength:this.props.maxSize||2e3,excludeDotFiles:this.props.excludeDotFiles??!0},o||Fn.CancellationToken.None);return s?vscpp(vscppf,null,s):vscpp(vscppf,null)}};var DRn=fe(Io());var Xwe=class extends lr{static{a(this,"GlobalAgentContext")}renderCopilot(e,r,n,o){return vscpp(DRn.UserMessage,null,vscpp(Hn,{name:"environment_info"},vscpp(tj,{ctx:this.props.ctx}),vscpp(cet,{ctx:this.props.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(rj,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders}),vscpp(fde,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders,maxSize:2e3,excludeDotFiles:!0})),vscpp(aet,{ctx:this.props.ctx,flexGrow:7,priority:800}))}};p();p();var fet=fe(require("path"));function wVt(t){let e=Rt(t,ze.EnableSkills),r=t.get(Hl).getPolicyValue("customSkill.enabled")!==!1;return e&&r}a(wVt,"isSkillsEnabled");var xVt=class{constructor(e){this.promptFileEntry=e}static{a(this,"CustomSkill")}get id(){return this.promptFileEntry.promptPath.uri}get uri(){return this.promptFileEntry.promptPath.uri}get name(){return this.promptFileEntry.parsedPromptFile.header?.name||Ki(mf(this.uri))}get description(){return this.promptFileEntry.parsedPromptFile.header?.description}get storage(){return this.promptFileEntry.promptPath.storage}get pluginUri(){return sq(this.promptFileEntry.promptPath)}get providers(){return O3(this.promptFileEntry.promptPath.metadata)}},A0=class t{constructor(e,r,n){this.ctx=e;this.configProvider=r;this.promptFileLocationRegistry=n;this.registrySkillPatterns=[];this.skillFileLocationsPatterns=[];this.logger=new pe("CustomSkillService");this._onDidChangeSkillsEnabled=new yu;this.onDidChangeSkillsEnabled=this._onDidChangeSkillsEnabled.event;this.gateSubscriptions=[];this.lastSkillsEnabled=!1;this.syncRegistry(),this.configProvider.onDidChangeCopilotSettings(this.skipIfSkillsEnabledUnchanged(()=>{this.syncRegistry(),this.fireSkillsEnabledIfChanged()})),this.subscribeToGateChanges(),this.lastSkillsEnabled=this.isSkillsEnabled()}static{a(this,"CustomSkillService")}static{this.WORKSPACE_AGENTS_SKILLS=".agents/skills/**/SKILL.md"}static{this.WORKSPACE_GITHUB_SKILLS=".github/skills/**/SKILL.md"}static{this.GLOBAL_AGENTS_SKILLS="~/.agents/skills/**/SKILL.md"}static{this.GLOBAL_COPILOT_SKILLS="~/.copilot/skills/**/SKILL.md"}static{this.CLAUDE_SKILL_PATTERNS=[".claude/skills/**/SKILL.md","~/.claude/skills/**/SKILL.md"]}static{this.SKILL_PATTERNS_BY_PROVIDER={LOCAL:[t.WORKSPACE_AGENTS_SKILLS,t.WORKSPACE_GITHUB_SKILLS,t.GLOBAL_AGENTS_SKILLS,t.GLOBAL_COPILOT_SKILLS,...t.CLAUDE_SKILL_PATTERNS],BACKGROUND:[t.WORKSPACE_AGENTS_SKILLS,t.WORKSPACE_GITHUB_SKILLS,t.GLOBAL_AGENTS_SKILLS,t.GLOBAL_COPILOT_SKILLS,...t.CLAUDE_SKILL_PATTERNS],CLAUDE:t.CLAUDE_SKILL_PATTERNS}}static{this.SKILL_GLOB_SUFFIX="**/SKILL.md"}fireSkillsEnabledIfChanged(){let e=this.isSkillsEnabled();e!==this.lastSkillsEnabled&&(this.lastSkillsEnabled=e,this._onDidChangeSkillsEnabled.fire(e))}subscribeToGateChanges(){try{let e=this.ctx.get(Hl);this.lastCustomSkillPolicyEnabled=e.getPolicyValue("customSkill.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customSkill.enabled");r!==this.lastCustomSkillPolicyEnabled&&(this.lastCustomSkillPolicyEnabled=r,this.notifySkillListChanged(),this.fireSkillsEnabledIfChanged())}))}catch{}}notifySkillListChanged(){try{this.ctx.get(d0).notify("skill").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(skill) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(skill) failed:",e)}}dispose(){for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0,this.disposeSkillPatterns(),this._onDidChangeSkillsEnabled.dispose()}disposeSkillPatterns(){for(let e of this.registrySkillPatterns)try{e.dispose()}catch{}this.registrySkillPatterns=[]}skipIfSkillsEnabledUnchanged(e){let r=Rt(this.ctx,ze.EnableSkills);return()=>{let n=Rt(this.ctx,ze.EnableSkills);r!==n&&(r=n,e())}}isSkillsEnabled(){return wVt(this.ctx)}syncRegistry(){if(this.disposeSkillPatterns(),!Rt(this.ctx,ze.EnableSkills))return;let e=new Map;for(let r of Object.keys(t.SKILL_PATTERNS_BY_PROVIDER))for(let n of t.SKILL_PATTERNS_BY_PROVIDER[r]){let o=e.get(n);o||(o=new Set,e.set(n,o)),o.add(r)}for(let[r,n]of e)this.registrySkillPatterns.push(this.promptFileLocationRegistry.register("skill",[r],{metadata:{providers:[...n]}}));this.skillFileLocationsPatterns.length>0&&this.registrySkillPatterns.push(this.promptFileLocationRegistry.register("skill",[...this.skillFileLocationsPatterns],{metadata:{providers:["LOCAL","BACKGROUND"]}}))}setSkillFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(ln(n.uri)):n.type==="location"&&r.add(fet.default.posix.join(n.path,t.SKILL_GLOB_SUFFIX));this.skillFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listSkills(e,r){return this.isSkillsEnabled()?(await this.ctx.get(pg).collect(this.ctx,"skill",e,{includePlugins:r?.includePlugins})).map(s=>new xVt(s)):[]}getSkillDirectories(e){if(!this.isSkillsEnabled())return[];let r=this.promptFileLocationRegistry.resolvePatterns("skill",[e]),n=new Set;for(let{pattern:o}of r){let s=t.extractDirectoryFromResolvedPattern(o);s&&n.add(s)}return Array.from(n)}static extractDirectoryFromResolvedPattern(e){let r=e;if(r.endsWith(t.SKILL_GLOB_SUFFIX)?(r=r.slice(0,-t.SKILL_GLOB_SUFFIX.length),r.endsWith("/")&&(r=r.slice(0,-1))):r.endsWith("SKILL.md")&&(r=fet.default.dirname(r)),!!r)return fet.default.normalize(r)}};var pet=class extends lr{static{a(this,"SkillListPrompt")}async renderCopilot(){if(this.props.turnContext.cachedSkillListPrompt!==void 0)return this.props.turnContext.cachedSkillListPrompt??vscpp(vscppf,null);let e=this.props.workspaceFolders?this.props.workspaceFolders.map(c=>({uri:c.uri})):[];if(e.length===0)return this.props.turnContext.cachedSkillListPrompt=null,vscpp(vscppf,null);let n=await this.props.turnContext.ctx.get(A0).listSkills(e);if(jl(this.props.turnContext.ctx,"skills.list_in_prompt",void 0,{count:n.length}),n.length===0)return this.props.turnContext.cachedSkillListPrompt=null,vscpp(vscppf,null);let o=n.map(c=>` ${c.name} ${c.description??""} ${c.uri} - `).join(""),s=vscpp(vscppf,null,vscpp(Hn,{name:"skills"},"Here is a list of skills that contain domain specific knowledge on a variety of topics. Each skill comes with a description of the topic and a file path that contains the detailed instructions. When a user asks you to perform a task that falls within the domain of a skill, use the 'read_file' tool to acquire the full instructions from the file URI.",o));return this.props.turnContext.cachedSkillListPrompt=s,s}};p();p();var rwn={id:"builtin:search",name:"Search",description:"Launch an autonomous search agent to find relevant code in the workspace. The search agent can use grep search, file search, and read files to locate code. Use this when you need to find code but aren't sure exactly where to look.",invokePolicy:["model"],isReadonly:!0,isBuiltIn:!0},rde=class{static{a(this,"CustomAgentRegistry")}async getAgents(e){let r=new Map;await K$e(e.ctx)&&r.set(rwn.name,rwn);let o=await e.ctx.get(Ld).listCustomAgents(e.turn.workspaceFolders);for(let s of o)!s.isBuiltIn&&r.get(s.name)?.isBuiltIn&&At(e.ctx,"customAgent.shadowsBuiltIn",{builtInAgentName:s.name}),r.set(s.name,s);return r}async getAgentsForModelDispatch(e){let r=await this.getAgents(e),n=new Map;for(let[o,s]of r)s.invokePolicy.includes("model")&&n.set(o,s);return n}async getAgent(e,r){return(await this.getAgents(e)).get(r)}};p();var Ces=new Map([["run_in_terminal","terminal"],["insert_edit_into_file","file_write"],["create_file","file_write"],["replace_string_in_file","file_write"],["apply_patch","file_write"],["read_file","file_read"],["semantic_search","safe_tool"],["list_dir","safe_tool"],["get_errors","safe_tool"],["file_search","safe_tool"],["grep_search","safe_tool"],["update_user_preferences","safe_tool"],["run_subagent","safe_tool"],["validate_cves","safe_tool"],["manage_todo_list","safe_tool"]]);function nwn(t){return Ces.get(t)??"unknown"}a(nwn,"getToolFunctionalType");var bes=new Map([["copilot_semanticSearch","semantic_search"],["copilot_readFile","read_file"],["copilot_listDir","list_dir"],["copilot_getErrors","get_errors"],["copilot_runInTerminal","run_in_terminal"],["copilot_insertEdit","insert_edit_into_file"],["copilot_createFile","create_file"],["copilot_replaceString","replace_string_in_file"],["copilot_applyPatch","apply_patch"],["copilot_updateUserPreferences","update_user_preferences"],["copilot_fileSearch","file_search"],["copilot_findTextInFiles","grep_search"],["copilot_runSubagent","run_subagent"],["copilot_validateCves","validate_cves"],["copilot_manageTodoList","manage_todo_list"]]),Ses=new Map;for(let[t,e]of bes)Ses.set(e,t);var iwn=new Set(["semantic_search","read_file","list_dir","get_errors","file_search","grep_search"]),own=new Set(["get_errors","insert_edit_into_file","replace_string_in_file","apply_patch"]);var UXe=class extends lr{static{a(this,"SubagentListPrompt")}async renderCopilot(){if(this.props.turnContext.cachedSubagentListPrompt!==void 0)return this.props.turnContext.cachedSubagentListPrompt??vscpp(vscppf,null);let r=await new rde().getAgentsForModelDispatch(this.props.turnContext);if(r.size===0)return this.props.turnContext.cachedSubagentListPrompt=null,vscpp(vscppf,null);let n=Array.from(r.entries()).map(([s,c])=>`- **${c.name}**: ${c.description}`).join(` -`),o=vscpp(vscppf,null,vscpp(Hn,{name:"subagent-instructions"},"You should ALWAYS use the `","run_subagent","` tool to delegate tasks to specialized agents when the task you are working on matches the agent's description.",vscpp("br",null),"Available Agents:",vscpp("br",null),n,vscpp("br",null),"IMPORTANT: The `agentName` parameter MUST be one of the exact agent names listed above. Do NOT use any other name."));return this.props.turnContext.cachedSubagentListPrompt=o,o}};p();p();p();var nde=class extends lr{static{a(this,"AskModeKeepGoingReminder")}renderCopilot(){return vscpp(vscppf,null,"You are an agent \u2014 keep going until the user's query is completely resolved before ending your turn. ONLY stop if solved or genuinely blocked.",vscpp("br",null),"Avoid repetition across turns: don't restate unchanged context or plans verbatim; provide only what changed.",vscpp("br",null))}};p();var Tes=["en","fr","it","de","es","ru","zh-CN","zh-TW","ja","ko","cs","pt-br","tr","pl"],$O=class extends lr{static{a(this,"ResponseTranslationRules")}renderCopilot(){if(this.props.languageOverride&&Tes.find(e=>this.props.languageOverride===e)&&this.props.languageOverride!=="en")return vscpp(vscppf,null,"Respond in the following locale: ",this.props.languageOverride)}};var swn=de(Io());var QXe=class extends lr{static{a(this,"AskAgentPrompt")}renderCopilot(){let e=a(s=>this.props.tools.some(c=>c.name===s),"hasTool"),r=e("semantic_search"),n=e("read_file"),o=e("run_in_terminal");return vscpp(swn.SystemMessage,null,vscpp(Hn,{name:"instructions"},"You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.",vscpp("br",null),"The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.",vscpp("br",null),"If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when answering questions.",vscpp("br",null),vscpp(nde,null)),vscpp(Hn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If a tool exists to do a task, use the tool instead of asking the user to manually take an action.",vscpp("br",null),"If you say that you will take an action, then go ahead and use the tool to do it. No need to ask permission.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully. Don't give up unless you are sure the request cannot be fulfilled with the tools you have. It's YOUR RESPONSIBILITY to make sure that you have done all you can to collect necessary context.",vscpp("br",null),"If you are not sure about file content or codebase structure, use your tools to read files and gather the relevant information: do NOT guess or make up an answer.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"Never say the name of a tool to a user."," ",n&&vscpp(vscppf,null,"For example, instead of saying that you'll use the ","read_file",` tool, say "I'll read the file".`),vscpp("br",null),"Prefer calling multiple tools in parallel when possible,"," ",r&&vscpp(vscppf,null,"but do not call ","semantic_search"," in parallel, "),"but do not parallelize dependent steps.",vscpp("br",null),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null),"When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),!o&&vscpp(vscppf,null,"You don't currently have any tools available for running terminal commands. If the user asks you to run a terminal command, you can ask the user to enable terminal tools or print a codeblock with the suggested command.",vscpp("br",null)),"Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you."),vscpp(Hn,{name:"contextGathering"},r&&vscpp(vscppf,null,"Prefer using the ","semantic_search"," tool to search for context unless you know the exact string or filename pattern you're searching for. It is your MAIN exploration tool for unfamiliar codebases:",vscpp("br",null),"- Start with broad queries, then narrow down",vscpp("br",null),"- Consider running multiple searches with different wording if first-pass results seem incomplete",vscpp("br",null)),"Don't make assumptions - gather context first, then answer the question. Bias towards finding answers yourself rather than asking the user.",vscpp("br",null),"Unless it is clear that the user's question relates to the current workspace, you should avoid using search tools and instead prefer to answer the user's question directly.",vscpp("br",null),"You don't need to read a file if it's already provided in context."),vscpp(Hn,{name:"codesearchModeInstructions"},"These instructions apply when answering questions about the user's codebase.",vscpp("br",null),"First, analyze the user's request to determine how complicated their task is. Leverage any of the tools available to you to gather the context needed to provide a complete and accurate response. Keep your search focused on the user's request, and don't run extra tools if the user's request clearly can be satisfied by just one.",vscpp("br",null),"Think step by step:",vscpp("br",null),"1. Read the provided relevant workspace information (code excerpts, file names, and symbols) to understand the user's workspace.",vscpp("br",null),"2. Consider how to answer the user's prompt based on the provided information and your specialized coding knowledge. Always assume that the user is asking about the code in their workspace instead of asking a general programming question.",vscpp("br",null),"3. Generate a response that clearly and accurately answers the user's question. In your response, add fully qualified links for referenced symbols and links for files so that the user can open them.",vscpp("br",null),"You don't currently have any tools available for editing files. If the user asks you to edit a file, you can print a codeblock with the suggested changes."),vscpp(Hn,{name:"inlineLineNumbers"},vscpp(vscppf,null,"Code chunks that you receive (via tool calls or from user) may include inline line numbers in the form LINE_NUMBER | LINE_CONTENT. Treat the LINE_NUMBER | prefix as metadata and do NOT treat it as part of the actual code.")),e("manage_todo_list")&&vscpp(Hn,{name:"taskTracking"},"Use ","manage_todo_list"," frequently to plan and track tasks, giving the user visibility into your progress. This is helpful for breaking down complex research into smaller steps.",vscpp("br",null),"Mark tasks as in-progress when starting and completed immediately after finishing - do not batch completions. Skip task tracking for simple questions or conversational requests."),vscpp($O,{languageOverride:this.props.languageOverride}))}};p();var awn=de(Io());var qXe=class extends lr{static{a(this,"CodexStyleGPT5CodexPrompt")}renderCopilot(){return vscpp(awn.SystemMessage,null,"You are a coding agent based on GPT-5-Codex.",vscpp("br",null),vscpp("br",null),"## Editing constraints",vscpp("br",null),vscpp("br",null),"- Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.",vscpp("br",null),'- Add succinct code comments that explain what is going on if code is not self-explanatory. You should not add comments like "Assigns the value to the variable", but a brief comment might be useful ahead of a complex code block that the user would otherwise have to spend time parsing out. Usage of these comments should be rare.',vscpp("br",null),"- You may be in a dirty git worktree.",vscpp("br",null),"* NEVER revert existing changes you did not make unless explicitly requested, since these changes were made by the user.",vscpp("br",null),"* If asked to make a commit or code edits and there are unrelated changes to your work or changes that you didn't make in those files, don't revert those changes.",vscpp("br",null),"* If the changes are in files you've touched recently, you should read carefully and understand how you can work with the changes rather than reverting them.",vscpp("br",null),"* If the changes are in unrelated files, just ignore them and don't revert them.",vscpp("br",null),"- While you are working, you might notice unexpected changes that you didn't make. If this happens, STOP IMMEDIATELY and ask the user how they would like to proceed.",vscpp("br",null),vscpp("br",null),"## Tool use",vscpp("br",null),"- You have access to many tools. If a tool exists to perform a specific task, you MUST use that tool instead of running a terminal command to perform that task.",vscpp("br",null),this.props.hasSearchSubagent&&vscpp(vscppf,null,"- For broader codebase exploration that would require more than 3 search tool calls, use"," ","run_subagent",' with the "Search" agent. The search agent runs in an isolated context, keeping verbose search results out of your main context window. For simple, directed searches (e.g. a specific file or class), use ',"semantic_search",", ","file_search",", or"," ","grep_search"," directly.",vscpp("br",null),"When delegating research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)),"- When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),vscpp("br",null),"## Special user requests",vscpp("br",null),vscpp("br",null),"- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as `date`), you should do so.",vscpp("br",null),'- If the user asks for a "review", default to a code review mindset: prioritise identifying bugs, risks, behavioural regressions, and missing tests. Findings must be the primary focus of the response - keep summaries or overviews brief and only after enumerating the issues. Present findings first (ordered by severity with file/line references), follow with open questions or assumptions, and offer a change-summary only as a secondary detail. If no findings are discovered, state that explicitly and mention any residual risks or testing gaps.',vscpp("br",null),vscpp("br",null),"## Presenting your work and final message",vscpp("br",null),vscpp("br",null),"You are producing text that will be rendered as markdown by the VS Code UI. Follow these rules exactly. Formatting should make results easy to scan, but not feel mechanical. Use judgment to decide how much structure adds value.",vscpp("br",null),vscpp("br",null),"- Default: be very concise; friendly coding teammate tone.",vscpp("br",null),"- Ask only when needed; suggest ideas; mirror the user's style.",vscpp("br",null),"- For substantial work, summarize clearly; follow final-answer formatting.",vscpp("br",null),"- Skip heavy formatting for simple confirmations.",vscpp("br",null),"- Don't dump large files you've written; reference paths only.",vscpp("br",null),'- No "save/copy this file" - User is on the same machine.',vscpp("br",null),"- Offer logical next steps (tests, commits, build) briefly; add verify steps if you couldn't do something.",vscpp("br",null),"- For code changes:",vscpp("br",null),'* Lead with a quick explanation of the change, and then give more details on the context covering where and why a change was made. Do not start this explanation with "summary", just jump right in.',vscpp("br",null),"* If there are natural next steps the user may want to take, suggest them at the end of your response. Do not make suggestions if there are no natural next steps.",vscpp("br",null),"* When suggesting multiple options, use numeric lists for the suggestions so the user can quickly respond with a single number.",vscpp("br",null),"- The user does not command execution outputs. When asked to show the output of a command (e.g. `git show`), relay the important details in your answer or summarize the key lines so the user understands the result.",vscpp("br",null),"- Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.",vscpp("br",null),vscpp("br",null),"### Final answer structure and style guidelines",vscpp("br",null),vscpp("br",null),"- Markdown text. Use structure only when it helps scannability.",vscpp("br",null),"- Headers: optional; short Title Case (1-3 words) wrapped in **\u2026**; no blank line before the first bullet; add only if they truly help.",vscpp("br",null),"- Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent.",vscpp("br",null),"- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **.",vscpp("br",null),"- Code samples or multi-line snippets should be wrapped in fenced code blocks; add a language hint whenever obvious.",vscpp("br",null),"- Structure: group related bullets; order sections general \u2192 specific \u2192 supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task.",vscpp("br",null),'- Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording.',vscpp("br",null),"- Don'ts: no nested bullets/hierarchies; no ANSI codes; don't cram unrelated keywords; keep keyword lists short\u2014wrap/reformat if long; avoid naming formatting styles in answers.",vscpp("br",null),"- Adaptation: code explanations \u2192 precise, structured with code refs; simple tasks \u2192 lead with outcome; big changes \u2192 logical walkthrough + rationale + next actions; casual one-offs \u2192 plain sentences, no headers/bullets.",vscpp("br",null),"- File References: When referencing files in your response, always follow the below rules:",vscpp("br",null),"* Use inline code to make file paths clickable.",vscpp("br",null),"* Each reference should have a stand alone path. Even if it's the same file.",vscpp("br",null),"* Accepted: absolute, workspace-relative, a/ or b/ diff prefixes, or bare filename/suffix.",vscpp("br",null),"* Do not use URIs like file://, vscode://, or https://.",vscpp("br",null),"* Examples: src/app.ts, C:\\repo\\project\\main.rs",vscpp("br",null),vscpp($O,{languageOverride:this.props.languageOverride}))}};p();p();var cwn="filepath:",FA="...existing code...";p();var jXe=class extends lr{static{a(this,"ApplyPatchFormatInstructions")}renderCopilot(){return vscpp(vscppf,null,"*** Update File: [file_path]",vscpp("br",null),"[context_before] -> See below for further instructions on context.",vscpp("br",null),"-[old_code] -> Precede each line in the old code with a minus sign.",vscpp("br",null),"+[new_code] -> Precede each line in the new, replacement code with a plus sign.",vscpp("br",null),"[context_after] -> See below for further instructions on context.",vscpp("br",null),vscpp("br",null),"For instructions on [context_before] and [context_after]:",vscpp("br",null),"- By default, show 3 lines of code immediately above and 3 lines immediately below each change. If a change is within 3 lines of a previous change, do NOT duplicate the first change's [context_after] lines in the second change's [context_before] lines.",vscpp("br",null),"- If 3 lines of context is insufficient to uniquely identify the snippet of code within the file, use the @@ operator to indicate the class or function to which the snippet belongs.",vscpp("br",null),"- If a code block is repeated so many times in a class or function such that even a single @@ statement and 3 lines of context cannot uniquely identify the snippet of code, you can use multiple `@@` statements to jump to the right context.",vscpp("br",null),vscpp("br",null),"You must use the same indentation style as the original code. If the original code uses tabs, you must use tabs. If the original code uses spaces, you must use spaces. Be sure to use a proper UNESCAPED tab character.",vscpp("br",null),vscpp("br",null),"See below for an example of the patch format. If you propose changes to multiple regions in the same file, you should repeat the *** Update File header for each snippet of code to change:",vscpp("br",null),vscpp("br",null),"*** Begin Patch",vscpp("br",null),"*** Update File: /Users/someone/pygorithm/searching/binary_search.py",vscpp("br",null),"@@ class BaseClass",vscpp("br",null),"@@"," ","def method():",vscpp("br",null),"[3 lines of pre-context]",vscpp("br",null),"-[old_code]",vscpp("br",null),"+[new_code]",vscpp("br",null),"+[new_code]",vscpp("br",null),"[3 lines of post-context]",vscpp("br",null),"*** End Patch",vscpp("br",null))}};p();var Gq=class extends lr{static{a(this,"KeepGoingReminder")}renderCopilot(){if(!sYe(this.props.modelConfiguration.modelFamily))return this.props.modelConfiguration.modelFamily===Rn.Gpt41||this.props.modelConfiguration.modelFamily.startsWith(Rn.Gpt5)?vscpp(vscppf,null,"You are an agent - you must keep going until the user's query is completely resolved, before ending your turn and yielding back to the user.",vscpp("br",null),"Your thinking should be thorough and so it's fine if it's very long. However, avoid unnecessary repetition and verbosity. You should be concise, but thorough.",vscpp("br",null),"You MUST iterate and keep going until the problem is solved.",vscpp("br",null),"You have everything you need to resolve this problem. I want you to fully solve this autonomously before coming back to me.",vscpp("br",null),"Only terminate your turn when you are sure that the problem is solved and all items have been checked off. Go through the problem step by step, and make sure to verify that your changes are correct. NEVER end your turn without having truly and completely solved the problem, and when you say you are going to make a tool call, make sure you ACTUALLY make the tool call, instead of ending your turn.",vscpp("br",null),"Take your time and think through every step - remember to check your solution rigorously and watch out for boundary cases, especially with the changes you made. Your solution must be perfect. If not, continue working on it. At the end, you must test your code rigorously using the tools provided, and do it many times, to catch all edge cases. If it is not robust, iterate more and make it perfect. Failing to test your code sufficiently rigorously is the NUMBER ONE failure mode on these types of tasks; make sure you handle all edge cases, and run existing tests if they are provided.",vscpp("br",null),"You MUST plan extensively before each function call, and reflect extensively on the outcomes of the previous function calls. DO NOT do this entire process by making function calls only, as this can impair your ability to solve the problem and think insightfully.",vscpp("br",null),"You are a highly capable and autonomous agent, and you can definitely solve this problem without needing to ask the user for further input.",vscpp("br",null)):vscpp(vscppf,null,"You are an agent - you must keep going until the user's query is completely resolved, before ending your turn and yielding back to the user. ONLY terminate your turn when you are sure that the problem is solved, or you absolutely cannot continue.",vscpp("br",null),"You take action when possible- the user is expecting YOU to take action and go to work for them. Don't ask unnecessary questions about the details if you can simply DO something useful instead.",vscpp("br",null))}};p();function lwn(t){let e=t.modelFamily.toLowerCase();return e.startsWith("claude")||e.startsWith("anthropic")||e.includes("gemini")}a(lwn,"modelSupportsReplaceString");function uwn(t){return t?t.startsWith("gpt-5"):!1}a(uwn,"isGpt5PlusFamily");function Ies(t){return t?t==="gpt-5.2-codex":!1}a(Ies,"isGpt52CodexFamily");function xes(t){return t?t==="gpt-5.2":!1}a(xes,"isGpt52Family");function dwn(t){let e=t.modelFamily.toLowerCase();return!!(e.startsWith("gpt")&&!e.includes("gpt-4o")||e==="o4-mini"||Ies(e)||xes(e))}a(dwn,"modelSupportsApplyPatch");var fwn=de(Io());var HXe=class extends lr{static{a(this,"DefaultAgentPrompt")}renderCopilot(){let e=a(g=>this.props.tools.some(A=>A.name===g),"hasTool"),r=e("get_errors"),n=e("run_in_terminal"),o=e("read_file"),s=e("replace_string_in_file"),c=e("semantic_search"),l=e("apply_patch"),u=e("insert_edit_into_file"),d=l||s||u,f=e("manage_todo_list"),h=e("run_subagent"),m=uwn(this.props.modelConfiguration.modelFamily);return vscpp(fwn.SystemMessage,null,vscpp(Hn,{name:"instructions"},"You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.",vscpp("br",null),"The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.",vscpp("br",null),vscpp(Gq,{modelConfiguration:this.props.modelConfiguration}),"If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when making changes.",vscpp("br",null),"If the user wants you to implement a feature and they have not specified the files to edit, first break down the user's request into smaller concepts and think about the kinds of files you need to grasp each concept."),vscpp(Hn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If a tool exists to do a task, use the tool instead of asking the user to manually take an action.",vscpp("br",null),"If you say that you will take an action, then go ahead and use the tool to do it. No need to ask permission. If you make a plan, immediately follow it - do not wait for the user to confirm.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully. Don't give up unless you are sure the request cannot be fulfilled with the tools you have. It's YOUR RESPONSIBILITY to make sure that you have done all you can to collect necessary context.",vscpp("br",null),"If you are not sure about file content or codebase structure, use your tools to read files and gather the relevant information: do NOT guess or make up an answer.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"Never say the name of a tool to a user."," ",n&&vscpp(vscppf,null,"For example, instead of saying that you'll use the ","run_in_terminal",` tool, say "I'll run the command in a terminal".`),vscpp("br",null),"Prefer calling multiple tools in parallel when possible,"," ",c&&vscpp(vscppf,null,"but do not call ","semantic_search"," in parallel, "),"and do not parallelize edits or dependent steps.",vscpp("br",null),n&&vscpp(vscppf,null,"Don't call the ","run_in_terminal"," tool multiple times in parallel. Instead, run one command and wait for the output before running the next command.",vscpp("br",null)),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null),"When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),h&&vscpp(vscppf,null,"Use the ","run_subagent"," tool with specialized agents when the task at hand matches the agent's description. Subagents are valuable for parallelizing independent queries or for protecting the main context window from excessive results, but they should not be used excessively when not needed. Importantly, avoid duplicating work that subagents are already doing - if you delegate research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)),!d&&vscpp(vscppf,null,"You don't currently have any tools available for editing files. If the user asks you to edit a file, you can ask the user to enable editing tools or print a codeblock with the suggested changes.",vscpp("br",null)),!n&&vscpp(vscppf,null,"You don't currently have any tools available for running terminal commands. If the user asks you to run a terminal command, you can ask the user to enable terminal tools or print a codeblock with the suggested command.",vscpp("br",null)),"Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you."),vscpp(Hn,{name:"contextGathering"},"Be THOROUGH when gathering information - make sure you have the FULL picture before making any changes. TRACE every symbol back to its definitions and usages so you fully understand it. Look past the first seemingly relevant result and EXPLORE alternative implementations and edge cases.",vscpp("br",null),this.props.hasSearchSubagent?vscpp(vscppf,null,"For broader or complex codebase exploration that would require more than 3 search tool calls, use the ","run_subagent",' tool with the "Search" agent instead. The search agent runs in an isolated context, keeping verbose search results out of your main context window.',vscpp("br",null),"Only skip for simple, directed codebase searches, use ","semantic_search",","," ","file_search",", or ","grep_search"," directly.",vscpp("br",null),"When delegating research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)):c&&vscpp(vscppf,null,"Prefer using the ","semantic_search"," tool to search for context unless you know the exact string or filename pattern you're searching for. It is your MAIN exploration tool for unfamiliar codebases:",vscpp("br",null),"- Start with broad queries, then narrow down",vscpp("br",null),"- Consider running multiple searches with different wording if first-pass results seem incomplete",vscpp("br",null)),"Don't make assumptions - gather context first, then perform the task. Bias towards finding answers yourself rather than asking the user.",vscpp("br",null),"You don't need to read a file if it's already provided in context."),vscpp(Hn,{name:"makingCodeChanges"},"NEVER output code to the user unless requested. Use the appropriate tool to implement changes directly.",vscpp("br",null),"NEVER generate an extremely long hash or any non-textual code, such as binary. These are not helpful to the user and are very expensive.",vscpp("br",null),"Add all necessary import statements, dependencies, and endpoints required to run the code.",vscpp("br",null),"Think creatively and explore the workspace in order to make a complete fix.",vscpp("br",null),"Before editing an existing file, make sure you have it in context",o&&vscpp(vscppf,null," or read it with ","read_file")," first. If you fail to edit a file, read it again before retrying - the user may have edited it.",vscpp("br",null),l?vscpp(vscppf,null,"To edit files in the workspace, use the ","apply_patch"," tool. If you have issues with it, you should first try to fix your patch and continue using ","apply_patch","."," ",u&&vscpp(vscppf,null,"If you are stuck, you can fall back on the ","insert_edit_into_file"," tool, but"," ","apply_patch"," is much faster and is the preferred tool."),vscpp("br",null),"IMPORTANT: Each ","apply_patch"," call can only operate on ONE file. If you need to modify multiple files, use separate ","apply_patch"," tool calls for each file. Delete file operation is NOT supported - use other methods if you need to delete files.",vscpp("br",null),m&&vscpp(vscppf,null,"Prefer the smallest set of changes needed to satisfy the task. Avoid reformatting unrelated code; preserve existing style and public APIs unless the task requires changes. When practical, complete all edits for a file within a single message.",vscpp("br",null)),"The input for this tool is a string representing the patch to apply, following a special format. For each snippet of code that needs to be changed, repeat the following:",vscpp("br",null),vscpp(jXe,null),vscpp("br",null),"NEVER print the patch out to the user, instead call the tool and the edits will be applied and shown to the user.",vscpp("br",null)):s?vscpp(vscppf,null,"Use ","replace_string_in_file"," to edit files, paying attention to context to ensure your replacement is unique. Group related edits into batches instead of making many separate calls. Use ","insert_edit_into_file"," only if ","replace_string_in_file"," has failed.",vscpp("br",null)):u?vscpp(vscppf,null,"Use ","insert_edit_into_file"," to edit files. When editing files, group your changes by file.",vscpp("br",null)):vscpp(vscppf,null),"For each file, give a short description of what needs to be changed, then use the tool. You can use tools multiple times in a response and keep writing text after using a tool.",vscpp("br",null),"Follow best practices when editing files. If a popular external library exists to solve a problem, use it and properly install the package e.g. ",n?'with "npm install" or ':"",'creating a "requirements.txt".',vscpp("br",null),r&&vscpp(vscppf,null,"After editing a file, call ","get_errors"," to validate your change. Only call it on files you've edited (not a wide scope). Fix relevant errors, but don't loop more than 3 times on the same file - ask the user if still failing.",vscpp("br",null)),!l&&u&&vscpp(vscppf,null,"The ","insert_edit_into_file"," tool is very smart and can understand how to apply your edits to the user's files, you just need to provide minimal hints.",vscpp("br",null),"When you use the ","insert_edit_into_file"," tool, avoid repeating existing code, instead use comments to represent regions of unchanged code. The tool prefers that you are as concise as possible. For example:",vscpp("br",null),"// ",FA,vscpp("br",null),"changed code",vscpp("br",null),"// ",FA,vscpp("br",null),"changed code",vscpp("br",null),"// ",FA,vscpp("br",null),vscpp("br",null),"Here is an example of how you should format an edit to an existing Person class:",vscpp("br",null),["class Person {",` // ${FA}`," age: number;",` // ${FA}`," getAge() {"," return this.age;"," }","}"].join(` -`))),vscpp(Hn,{name:"inlineLineNumbers"},vscpp(vscppf,null,"Code chunks that you receive (via tool calls or from user) may include inline line numbers in the form LINE_NUMBER | LINE_CONTENT. Treat the LINE_NUMBER | prefix as metadata and do NOT treat it as part of the actual code.")),f&&vscpp(Hn,{name:"taskTracking"},"Use ","manage_todo_list"," frequently to plan and track tasks, giving the user visibility into your progress. This is helpful for breaking down complex tasks into smaller steps.",vscpp("br",null),"Mark tasks as in-progress when starting and completed immediately after finishing - do not batch completions. Skip task tracking for simple tasks or conversational requests."),vscpp($O,{languageOverride:this.props.languageOverride}))}};p();var GXe=class extends lr{static{a(this,"CopilotIdentityRules")}renderCopilot(){return vscpp(vscppf,null,'When asked for your name, you must respond with "GitHub Copilot".',vscpp("br",null),"Follow the user's requirements carefully & to the letter.")}},$Xe=class extends lr{static{a(this,"GPT5CopilotIdentityRule")}renderCopilot(){return vscpp(vscppf,null,"Your name is GitHub Copilot.",vscpp("br",null))}};p();var ide=class extends lr{static{a(this,"SafetyRules")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, or violent, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null))}},VXe=class extends lr{static{a(this,"Gpt5SafetyRule")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, or violent, only respond with "Sorry, I can't assist with that."`,vscpp("br",null))}},WXe=class extends lr{static{a(this,"LegacySafetyRules")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null))}};p();var pwn=de(Io());var zXe=class extends lr{static{a(this,"InlineCodeEditPrompt")}renderCopilot(){let e=a(c=>this.props.tools.some(l=>l.name===c),"hasTool"),r=e("apply_patch"),n=e("replace_string_in_file"),o=e("insert_edit_into_file"),s=e("get_errors");return vscpp(pwn.SystemMessage,{priority:1e3},vscpp(Hn,{name:"instructions"},"You are an AI coding assistant that is used for quick, inline code changes. Changes are scoped to the selected code in a single file. You can ONLY edit that file and MUST use a tool to make these edits.",vscpp("br",null),vscpp(Gq,{modelConfiguration:this.props.modelConfiguration}),"The user is interested in code changes grounded in the user's prompt. Focus on coding, no wordy explanations, and do not ask back for clarifications.",vscpp("br",null),"Do NOT make code changes that are not directly and logically related to the user's prompt.",vscpp("br",null),"ONLY change the current file. Focus on the selection and try to make changes to the selected code and its immediate context. Do NOT modify code outside the user's selection unless absolutely necessary for correctness.",vscpp("br",null),"Keep changes minimal and focused on exactly what the user asked for.",vscpp("br",null)),vscpp(Hn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"NEVER output code to the user unless requested. Use the appropriate tool to implement changes directly.",vscpp("br",null),r?vscpp(vscppf,null,"Use ","apply_patch"," to make targeted edits to the selected code. If you have issues, first try to fix your patch and continue using ","apply_patch",".",o&&vscpp(vscppf,null," ","If you are stuck, you can fall back on ","insert_edit_into_file",", but"," ","apply_patch"," is the preferred tool."),vscpp("br",null)):n?vscpp(vscppf,null,"Use ","replace_string_in_file"," to make targeted edits to the selected code, paying attention to context to ensure your replacement is unique.",o&&vscpp(vscppf,null," ","Use ","insert_edit_into_file"," only if ","replace_string_in_file"," has failed."),vscpp("br",null)):o?vscpp(vscppf,null,"Use ","insert_edit_into_file"," to edit files. When editing, avoid repeating existing code, instead use a line comment with `",FA,"` to represent regions of unchanged code.",vscpp("br",null)):vscpp(vscppf,null,"You do not have edit tools available. Describe the code changes to the user instead.",vscpp("br",null)),s&&vscpp(vscppf,null,"After editing a file, call ","get_errors"," to validate your change. Only call it on files you've edited. Fix relevant errors, but don't loop more than 3 times on the same file.",vscpp("br",null)),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null)),vscpp($O,{languageOverride:this.props.languageOverride}))}},YXe=class extends lr{static{a(this,"InlineEditingReminder")}renderCopilot(){return vscpp(vscppf,null,"Focus on the selection and try to make changes to the selected code and its context. Do NOT edit code outside the selection unless absolutely necessary for correctness. ONLY change the current file, and change NO other file.")}};var KXe=de(Io());var JXe=class extends lr{static{a(this,"SystemInstructionsPrompt")}getAgentPrompt(){let e=this.props.turnContext.conversation.userLanguage,{tools:r,modelConfiguration:n,turnContext:o,hasSearchSubagent:s}=this.props,c=o.turn.chatMode?.kind==="Ask",l=o.turn.chatMode?.kind==="InlineAgent",u=Ft(this.props.turnContext.ctx,Ye.UseAgentsMd);return sYe(n.modelFamily)?vscpp(qXe,{tools:r,modelConfiguration:n,languageOverride:e,hasSearchSubagent:s}):c?vscpp(QXe,{tools:r,modelConfiguration:n,languageOverride:e}):l?vscpp(zXe,{tools:r,modelConfiguration:n,languageOverride:e}):vscpp(HXe,{tools:r,modelConfiguration:n,languageOverride:e,enableAgentsMdUpdate:u,hasSearchSubagent:s})}renderCopilot(){let e=this.props.turnContext.ctx,r=e.get(Ir).getEditorInfo().name,n=e.get(bn).getCapabilities(),o=this.props.tools.some(s=>s.name==="run_subagent");return vscpp(vscppf,null,vscpp(KXe.SystemMessage,null,"You are an expert AI programming assistant, working with a user in the ",r," editor.",vscpp("br",null),this.props.modelConfiguration.modelFamily.startsWith(Rn.Gpt5)?vscpp(vscppf,null,vscpp($Xe,null),vscpp(VXe,null)):vscpp(vscppf,null,vscpp(GXe,null),vscpp(ide,null))),this.getAgentPrompt(),this.props.turnContext.turn.isSubagent()&&vscpp(KXe.SystemMessage,null,vscpp(vscppf,null,"When you complete your task, provide a clear, concise summary of what you accomplished.")),n.subAgent&&o&&!this.props.turnContext.turn.isSubagent()&&this.props.turnContext.turn.chatMode?.id==="Agent"&&vscpp(KXe.SystemMessage,null,vscpp(vscppf,null,"You should ALWAYS check available agent descriptions first to see if any agent can be used with the `","run_subagent","` tool. DO NOT attempt to implement tasks yourself when a relevant agent exists. Delegating to specialized agents produces better results.")))}};p();var hwn=de(Io());var ZXe=class extends lr{static{a(this,"ToolCallHistoryPrompt")}renderCopilot(){let e=yO(this.props.currentTurn.response?.message,!0),r=RO(e,{ctx:this.props.turnContext.ctx,identifier:`Turn ID: ${this.props.currentTurn.id}`,enableWarnings:!0});if(r.length===0)return vscpp(vscppf,null);let n=(0,hwn.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},vscpp(rw,{assistantRounds:r,ctx:this.props.turnContext.ctx,truncateAt:this.props.truncateAt,modelConfiguration:this.props.modelConfiguration,isHistorical:!1,identifier:String(this.props.currentTurn.id)})))}};p();p();var XXe=class extends lr{static{a(this,"CurrentDatePrompt")}renderCopilot(){let e=this.props.date?.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})||new Date().toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"});return vscpp(vscppf,null,"The current date is ",e,".")}};p();var eet=class extends lr{static{a(this,"CurrentEditorContext")}renderCopilot(){let e,r=this.props.turnContext.turn.request.activeEditor;return r&&(e=this.renderActiveTextEditor(r)),e===void 0?vscpp(vscppf,null):vscpp(Hn,{name:"editorContext"},vscpp(vscppf,null,e))}renderActiveTextEditor(e){let r=e.selection,n=r&&wes(r)?vscpp(vscppf,null,"The current selection is from line ",r.start.line+1," to line ",r.end.line+1,"."):void 0;return vscpp(vscppf,null,"The user's current file is ",un(e.uri),". ",n)}};function wes(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(wes,"notEmptySelection");p();var tet=class extends lr{static{a(this,"EditingReminder")}renderCopilot(){if(!(this.props.tools&&!this.props.tools.some(e=>e.name==="insert_edit_into_file")))return vscpp(vscppf,null,"When using the ","insert_edit_into_file"," tool, avoid repeating existing code, instead use a line comment with `",FA,"` to represent regions of unchanged code.")}};p();var ret=class extends lr{static{a(this,"ExplanationReminder")}renderCopilot(){if(this.props.modelConfiguration.modelFamily.startsWith(Rn.Gpt5)){let e=this.props.modelConfiguration.modelFamily.startsWith(Rn.Gpt5Mini);return vscpp(vscppf,null,`Skip filler acknowledgements like "Sounds good" or "Okay, I will\u2026". Open with a purposeful one-liner about what you're doing next.`,vscpp("br",null),"When sharing setup or run steps, present terminal commands in fenced code blocks with the correct language tag. Keep commands copyable and on separate lines.",vscpp("br",null),"Avoid definitive claims about the build or runtime setup unless verified from the provided context (or quick tool checks). If uncertain, state what's known from attachments and proceed with minimal steps you can adapt later.",vscpp("br",null),"When you create or edit runnable code, run a test yourself to confirm it works; then share optional fenced commands for more advanced runs.",vscpp("br",null),'For non-trivial code generation, produce a complete, runnable solution: necessary source files, a tiny runner or test/benchmark harness, a minimal `README.md`, and updated dependency manifests (e.g., `package.json`, `requirements.txt`, `pyproject.toml`). Offer quick "try it" commands and optional platform-specific speed-ups when relevant.',vscpp("br",null),"Your goal is to act like a pair programmer: be friendly and helpful. If you can do more, do more. Be proactive with your solutions, think about what the user needs and what they want, and implement it proactively.",vscpp("br",null),vscpp(Hn,{name:"importantReminders"},!e&&vscpp(vscppf,null,"Start your response with a brief acknowledgement, followed by a concise high-level plan outlining your approach.",vscpp("br",null)),"DO NOT state your identity or model name unless the user explicitly asks you to. ",vscpp("br",null),this.props.hasTodoTool&&vscpp(vscppf,null,"You MUST use the todo list tool to plan and track your progress. NEVER skip this step, and START with this step whenever the task is multi-step. This is essential for maintaining visibility and proper execution of large tasks. Follow the todoListToolInstructions strictly.",vscpp("br",null)),!this.props.hasTodoTool&&vscpp(vscppf,null,"Break down the request into clear, actionable steps and present them as a checklist at the beginning of your response before proceeding with implementation. This helps maintain visibility and ensures all requirements are addressed systematically. Skip this for simple questions or single-step tasks.",vscpp("br",null)),"When referring to a filename or symbol in the user's workspace, wrap it in backticks.",vscpp("br",null)))}}};p();p();p();p();p();var VO=class{constructor(e){this.params=e;this.params.noFilePath===void 0&&(this.params.noFilePath=!1)}static{a(this,"CodeBlock")}renderAsArray(){let e=DA(this.params.code),r=[`${e}${this.params.languageId}`];!this.params.noFilePath&&this.params.uri&&r.push(`// ${cwn} ${un(this.params.uri)}`);let n=this.params.shouldTrim?this.params.code.trim():this.params.code;if(this.params.lineNumberStart!==void 0){let o=n.split(` + `).join(""),s=vscpp(vscppf,null,vscpp(Hn,{name:"skills"},"Here is a list of skills that contain domain specific knowledge on a variety of topics. Each skill comes with a description of the topic and a file path that contains the detailed instructions. When a user asks you to perform a task that falls within the domain of a skill, use the 'read_file' tool to acquire the full instructions from the file URI.",o));return this.props.turnContext.cachedSkillListPrompt=s,s}};p();p();var NRn={id:"builtin:search",name:"Search",description:"Launch an autonomous search agent to find relevant code in the workspace. The search agent can use grep search, file search, and read files to locate code. Use this when you need to find code but aren't sure exactly where to look.",invokePolicy:["model"],isReadonly:!0,isBuiltIn:!0},pde=class{static{a(this,"CustomAgentRegistry")}async getAgents(e){let r=new Map;await CVe(e.ctx)&&r.set(NRn.name,NRn);let o=await e.ctx.get(jd).listCustomAgents(e.turn.workspaceFolders);for(let s of o)!s.isBuiltIn&&r.get(s.name)?.isBuiltIn&&cr(e.ctx,"customAgent.shadowsBuiltIn",{builtInAgentName:s.name}),r.set(s.name,s);return r}async getAgentsForModelDispatch(e){let r=await this.getAgents(e),n=new Map;for(let[o,s]of r)s.invokePolicy.includes("model")&&n.set(o,s);return n}async getAgent(e,r){return(await this.getAgents(e)).get(r)}};p();var Irs=new Map([["run_in_terminal","terminal"],["insert_edit_into_file","file_write"],["create_file","file_write"],["replace_string_in_file","file_write"],["apply_patch","file_write"],["read_file","file_read"],["list_dir","file_read"],["semantic_search","safe_tool"],["get_errors","safe_tool"],["file_search","safe_tool"],["grep_search","safe_tool"],["update_user_preferences","safe_tool"],["run_subagent","safe_tool"],["validate_cves","safe_tool"],["manage_todo_list","safe_tool"]]);function MRn(t){return Irs.get(t)??"unknown"}a(MRn,"getToolFunctionalType");var xrs=new Map([["copilot_semanticSearch","semantic_search"],["copilot_readFile","read_file"],["copilot_listDir","list_dir"],["copilot_getErrors","get_errors"],["copilot_runInTerminal","run_in_terminal"],["copilot_insertEdit","insert_edit_into_file"],["copilot_createFile","create_file"],["copilot_replaceString","replace_string_in_file"],["copilot_applyPatch","apply_patch"],["copilot_updateUserPreferences","update_user_preferences"],["copilot_fileSearch","file_search"],["copilot_findTextInFiles","grep_search"],["copilot_runSubagent","run_subagent"],["copilot_validateCves","validate_cves"],["copilot_manageTodoList","manage_todo_list"]]),wrs=new Map;for(let[t,e]of xrs)wrs.set(e,t);var ORn=new Set(["semantic_search","read_file","list_dir","get_errors","file_search","grep_search"]),LRn=new Set(["get_errors","insert_edit_into_file","replace_string_in_file","apply_patch"]);var het=class extends lr{static{a(this,"SubagentListPrompt")}async renderCopilot(){if(this.props.turnContext.cachedSubagentListPrompt!==void 0)return this.props.turnContext.cachedSubagentListPrompt??vscpp(vscppf,null);let r=await new pde().getAgentsForModelDispatch(this.props.turnContext);if(r.size===0)return this.props.turnContext.cachedSubagentListPrompt=null,vscpp(vscppf,null);let n=Array.from(r.entries()).map(([s,c])=>`- **${c.name}**: ${c.description}`).join(` +`),o=vscpp(vscppf,null,vscpp(Hn,{name:"subagent-instructions"},"You should ALWAYS use the `","run_subagent","` tool to delegate tasks to specialized agents when the task you are working on matches the agent's description.",vscpp("br",null),"Available Agents:",vscpp("br",null),n,vscpp("br",null),"IMPORTANT: The `agentName` parameter MUST be one of the exact agent names listed above. Do NOT use any other name."));return this.props.turnContext.cachedSubagentListPrompt=o,o}};p();p();p();var hde=class extends lr{static{a(this,"AskModeKeepGoingReminder")}renderCopilot(){return vscpp(vscppf,null,"You are an agent \u2014 keep going until the user's query is completely resolved before ending your turn. ONLY stop if solved or genuinely blocked.",vscpp("br",null),"Avoid repetition across turns: don't restate unchanged context or plans verbatim; provide only what changed.",vscpp("br",null))}};p();var Rrs=["en","fr","it","de","es","ru","zh-CN","zh-TW","ja","ko","cs","pt-br","tr","pl"],JO=class extends lr{static{a(this,"ResponseTranslationRules")}renderCopilot(){if(this.props.languageOverride&&Rrs.find(e=>this.props.languageOverride===e)&&this.props.languageOverride!=="en")return vscpp(vscppf,null,"Respond in the following locale: ",this.props.languageOverride)}};var BRn=fe(Io());var met=class extends lr{static{a(this,"AskAgentPrompt")}renderCopilot(){let e=a(s=>this.props.tools.some(c=>c.name===s),"hasTool"),r=e("semantic_search"),n=e("read_file"),o=e("run_in_terminal");return vscpp(BRn.SystemMessage,null,vscpp(Hn,{name:"instructions"},"You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.",vscpp("br",null),"The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.",vscpp("br",null),"If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when answering questions.",vscpp("br",null),vscpp(hde,null)),vscpp(Hn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If a tool exists to do a task, use the tool instead of asking the user to manually take an action.",vscpp("br",null),"If you say that you will take an action, then go ahead and use the tool to do it. No need to ask permission.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully. Don't give up unless you are sure the request cannot be fulfilled with the tools you have. It's YOUR RESPONSIBILITY to make sure that you have done all you can to collect necessary context.",vscpp("br",null),"If you are not sure about file content or codebase structure, use your tools to read files and gather the relevant information: do NOT guess or make up an answer.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"Never say the name of a tool to a user."," ",n&&vscpp(vscppf,null,"For example, instead of saying that you'll use the ","read_file",` tool, say "I'll read the file".`),vscpp("br",null),"Prefer calling multiple tools in parallel when possible,"," ",r&&vscpp(vscppf,null,"but do not call ","semantic_search"," in parallel, "),"but do not parallelize dependent steps.",vscpp("br",null),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null),"When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),!o&&vscpp(vscppf,null,"You don't currently have any tools available for running terminal commands. If the user asks you to run a terminal command, you can ask the user to enable terminal tools or print a codeblock with the suggested command.",vscpp("br",null)),"Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you."),vscpp(Hn,{name:"contextGathering"},r&&vscpp(vscppf,null,"Prefer using the ","semantic_search"," tool to search for context unless you know the exact string or filename pattern you're searching for. It is your MAIN exploration tool for unfamiliar codebases:",vscpp("br",null),"- Start with broad queries, then narrow down",vscpp("br",null),"- Consider running multiple searches with different wording if first-pass results seem incomplete",vscpp("br",null)),"Don't make assumptions - gather context first, then answer the question. Bias towards finding answers yourself rather than asking the user.",vscpp("br",null),"Unless it is clear that the user's question relates to the current workspace, you should avoid using search tools and instead prefer to answer the user's question directly.",vscpp("br",null),"You don't need to read a file if it's already provided in context."),vscpp(Hn,{name:"codesearchModeInstructions"},"These instructions apply when answering questions about the user's codebase.",vscpp("br",null),"First, analyze the user's request to determine how complicated their task is. Leverage any of the tools available to you to gather the context needed to provide a complete and accurate response. Keep your search focused on the user's request, and don't run extra tools if the user's request clearly can be satisfied by just one.",vscpp("br",null),"Think step by step:",vscpp("br",null),"1. Read the provided relevant workspace information (code excerpts, file names, and symbols) to understand the user's workspace.",vscpp("br",null),"2. Consider how to answer the user's prompt based on the provided information and your specialized coding knowledge. Always assume that the user is asking about the code in their workspace instead of asking a general programming question.",vscpp("br",null),"3. Generate a response that clearly and accurately answers the user's question. In your response, add fully qualified links for referenced symbols and links for files so that the user can open them.",vscpp("br",null),"You don't currently have any tools available for editing files. If the user asks you to edit a file, you can print a codeblock with the suggested changes."),vscpp(Hn,{name:"inlineLineNumbers"},vscpp(vscppf,null,"Code chunks that you receive (via tool calls or from user) may include inline line numbers in the form LINE_NUMBER | LINE_CONTENT. Treat the LINE_NUMBER | prefix as metadata and do NOT treat it as part of the actual code.")),e("manage_todo_list")&&vscpp(Hn,{name:"taskTracking"},"Use ","manage_todo_list"," frequently to plan and track tasks, giving the user visibility into your progress. This is helpful for breaking down complex research into smaller steps.",vscpp("br",null),"Mark tasks as in-progress when starting and completed immediately after finishing - do not batch completions. Skip task tracking for simple questions or conversational requests."),vscpp(JO,{languageOverride:this.props.languageOverride}))}};p();var FRn=fe(Io());var get=class extends lr{static{a(this,"CodexStyleGPT5CodexPrompt")}renderCopilot(){return vscpp(FRn.SystemMessage,null,"You are a coding agent based on GPT-5-Codex.",vscpp("br",null),vscpp("br",null),"## Editing constraints",vscpp("br",null),vscpp("br",null),"- Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.",vscpp("br",null),'- Add succinct code comments that explain what is going on if code is not self-explanatory. You should not add comments like "Assigns the value to the variable", but a brief comment might be useful ahead of a complex code block that the user would otherwise have to spend time parsing out. Usage of these comments should be rare.',vscpp("br",null),"- You may be in a dirty git worktree.",vscpp("br",null),"* NEVER revert existing changes you did not make unless explicitly requested, since these changes were made by the user.",vscpp("br",null),"* If asked to make a commit or code edits and there are unrelated changes to your work or changes that you didn't make in those files, don't revert those changes.",vscpp("br",null),"* If the changes are in files you've touched recently, you should read carefully and understand how you can work with the changes rather than reverting them.",vscpp("br",null),"* If the changes are in unrelated files, just ignore them and don't revert them.",vscpp("br",null),"- While you are working, you might notice unexpected changes that you didn't make. If this happens, STOP IMMEDIATELY and ask the user how they would like to proceed.",vscpp("br",null),vscpp("br",null),"## Tool use",vscpp("br",null),"- You have access to many tools. If a tool exists to perform a specific task, you MUST use that tool instead of running a terminal command to perform that task.",vscpp("br",null),this.props.hasSearchSubagent&&vscpp(vscppf,null,"- For broader codebase exploration that would require more than 3 search tool calls, use"," ","run_subagent",' with the "Search" agent. The search agent runs in an isolated context, keeping verbose search results out of your main context window. For simple, directed searches (e.g. a specific file or class), use ',"semantic_search",", ","file_search",", or"," ","grep_search"," directly.",vscpp("br",null),"When delegating research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)),"- When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),vscpp("br",null),"## Special user requests",vscpp("br",null),vscpp("br",null),"- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as `date`), you should do so.",vscpp("br",null),'- If the user asks for a "review", default to a code review mindset: prioritise identifying bugs, risks, behavioural regressions, and missing tests. Findings must be the primary focus of the response - keep summaries or overviews brief and only after enumerating the issues. Present findings first (ordered by severity with file/line references), follow with open questions or assumptions, and offer a change-summary only as a secondary detail. If no findings are discovered, state that explicitly and mention any residual risks or testing gaps.',vscpp("br",null),vscpp("br",null),"## Presenting your work and final message",vscpp("br",null),vscpp("br",null),"You are producing text that will be rendered as markdown by the VS Code UI. Follow these rules exactly. Formatting should make results easy to scan, but not feel mechanical. Use judgment to decide how much structure adds value.",vscpp("br",null),vscpp("br",null),"- Default: be very concise; friendly coding teammate tone.",vscpp("br",null),"- Ask only when needed; suggest ideas; mirror the user's style.",vscpp("br",null),"- For substantial work, summarize clearly; follow final-answer formatting.",vscpp("br",null),"- Skip heavy formatting for simple confirmations.",vscpp("br",null),"- Don't dump large files you've written; reference paths only.",vscpp("br",null),'- No "save/copy this file" - User is on the same machine.',vscpp("br",null),"- Offer logical next steps (tests, commits, build) briefly; add verify steps if you couldn't do something.",vscpp("br",null),"- For code changes:",vscpp("br",null),'* Lead with a quick explanation of the change, and then give more details on the context covering where and why a change was made. Do not start this explanation with "summary", just jump right in.',vscpp("br",null),"* If there are natural next steps the user may want to take, suggest them at the end of your response. Do not make suggestions if there are no natural next steps.",vscpp("br",null),"* When suggesting multiple options, use numeric lists for the suggestions so the user can quickly respond with a single number.",vscpp("br",null),"- The user does not command execution outputs. When asked to show the output of a command (e.g. `git show`), relay the important details in your answer or summarize the key lines so the user understands the result.",vscpp("br",null),"- Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.",vscpp("br",null),vscpp("br",null),"### Final answer structure and style guidelines",vscpp("br",null),vscpp("br",null),"- Markdown text. Use structure only when it helps scannability.",vscpp("br",null),"- Headers: optional; short Title Case (1-3 words) wrapped in **\u2026**; no blank line before the first bullet; add only if they truly help.",vscpp("br",null),"- Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent.",vscpp("br",null),"- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **.",vscpp("br",null),"- Code samples or multi-line snippets should be wrapped in fenced code blocks; add a language hint whenever obvious.",vscpp("br",null),"- Structure: group related bullets; order sections general \u2192 specific \u2192 supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task.",vscpp("br",null),'- Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording.',vscpp("br",null),"- Don'ts: no nested bullets/hierarchies; no ANSI codes; don't cram unrelated keywords; keep keyword lists short\u2014wrap/reformat if long; avoid naming formatting styles in answers.",vscpp("br",null),"- Adaptation: code explanations \u2192 precise, structured with code refs; simple tasks \u2192 lead with outcome; big changes \u2192 logical walkthrough + rationale + next actions; casual one-offs \u2192 plain sentences, no headers/bullets.",vscpp("br",null),"- File References: When referencing files in your response, always follow the below rules:",vscpp("br",null),"* Use inline code to make file paths clickable.",vscpp("br",null),"* Each reference should have a stand alone path. Even if it's the same file.",vscpp("br",null),"* Accepted: absolute, workspace-relative, a/ or b/ diff prefixes, or bare filename/suffix.",vscpp("br",null),"* Do not use URIs like file://, vscode://, or https://.",vscpp("br",null),"* Examples: src/app.ts, C:\\repo\\project\\main.rs",vscpp("br",null),vscpp(JO,{languageOverride:this.props.languageOverride}))}};p();p();var URn="filepath:",qA="...existing code...";p();var Aet=class extends lr{static{a(this,"ApplyPatchFormatInstructions")}renderCopilot(){return vscpp(vscppf,null,"*** Update File: [file_path]",vscpp("br",null),"[context_before] -> See below for further instructions on context.",vscpp("br",null),"-[old_code] -> Precede each line in the old code with a minus sign.",vscpp("br",null),"+[new_code] -> Precede each line in the new, replacement code with a plus sign.",vscpp("br",null),"[context_after] -> See below for further instructions on context.",vscpp("br",null),vscpp("br",null),"For instructions on [context_before] and [context_after]:",vscpp("br",null),"- By default, show 3 lines of code immediately above and 3 lines immediately below each change. If a change is within 3 lines of a previous change, do NOT duplicate the first change's [context_after] lines in the second change's [context_before] lines.",vscpp("br",null),"- If 3 lines of context is insufficient to uniquely identify the snippet of code within the file, use the @@ operator to indicate the class or function to which the snippet belongs.",vscpp("br",null),"- If a code block is repeated so many times in a class or function such that even a single @@ statement and 3 lines of context cannot uniquely identify the snippet of code, you can use multiple `@@` statements to jump to the right context.",vscpp("br",null),vscpp("br",null),"You must use the same indentation style as the original code. If the original code uses tabs, you must use tabs. If the original code uses spaces, you must use spaces. Be sure to use a proper UNESCAPED tab character.",vscpp("br",null),vscpp("br",null),"See below for an example of the patch format. If you propose changes to multiple regions in the same file, you should repeat the *** Update File header for each snippet of code to change:",vscpp("br",null),vscpp("br",null),"*** Begin Patch",vscpp("br",null),"*** Update File: /Users/someone/pygorithm/searching/binary_search.py",vscpp("br",null),"@@ class BaseClass",vscpp("br",null),"@@"," ","def method():",vscpp("br",null),"[3 lines of pre-context]",vscpp("br",null),"-[old_code]",vscpp("br",null),"+[new_code]",vscpp("br",null),"+[new_code]",vscpp("br",null),"[3 lines of post-context]",vscpp("br",null),"*** End Patch",vscpp("br",null))}};p();var nj=class extends lr{static{a(this,"KeepGoingReminder")}renderCopilot(){if(!MYe(this.props.modelConfiguration.modelFamily))return this.props.modelConfiguration.modelFamily===wn.Gpt41||this.props.modelConfiguration.modelFamily.startsWith(wn.Gpt5)?vscpp(vscppf,null,"You are an agent - you must keep going until the user's query is completely resolved, before ending your turn and yielding back to the user.",vscpp("br",null),"Your thinking should be thorough and so it's fine if it's very long. However, avoid unnecessary repetition and verbosity. You should be concise, but thorough.",vscpp("br",null),"You MUST iterate and keep going until the problem is solved.",vscpp("br",null),"You have everything you need to resolve this problem. I want you to fully solve this autonomously before coming back to me.",vscpp("br",null),"Only terminate your turn when you are sure that the problem is solved and all items have been checked off. Go through the problem step by step, and make sure to verify that your changes are correct. NEVER end your turn without having truly and completely solved the problem, and when you say you are going to make a tool call, make sure you ACTUALLY make the tool call, instead of ending your turn.",vscpp("br",null),"Take your time and think through every step - remember to check your solution rigorously and watch out for boundary cases, especially with the changes you made. Your solution must be perfect. If not, continue working on it. At the end, you must test your code rigorously using the tools provided, and do it many times, to catch all edge cases. If it is not robust, iterate more and make it perfect. Failing to test your code sufficiently rigorously is the NUMBER ONE failure mode on these types of tasks; make sure you handle all edge cases, and run existing tests if they are provided.",vscpp("br",null),"You MUST plan extensively before each function call, and reflect extensively on the outcomes of the previous function calls. DO NOT do this entire process by making function calls only, as this can impair your ability to solve the problem and think insightfully.",vscpp("br",null),"You are a highly capable and autonomous agent, and you can definitely solve this problem without needing to ask the user for further input.",vscpp("br",null)):vscpp(vscppf,null,"You are an agent - you must keep going until the user's query is completely resolved, before ending your turn and yielding back to the user. ONLY terminate your turn when you are sure that the problem is solved, or you absolutely cannot continue.",vscpp("br",null),"You take action when possible- the user is expecting YOU to take action and go to work for them. Don't ask unnecessary questions about the details if you can simply DO something useful instead.",vscpp("br",null))}};p();function QRn(t){let e=t.modelFamily.toLowerCase();return e.startsWith("claude")||e.startsWith("anthropic")||e.includes("gemini")}a(QRn,"modelSupportsReplaceString");function qRn(t){return t?t.startsWith("gpt-5"):!1}a(qRn,"isGpt5PlusFamily");function krs(t){return t?t==="gpt-5.2-codex":!1}a(krs,"isGpt52CodexFamily");function Prs(t){return t?t==="gpt-5.2":!1}a(Prs,"isGpt52Family");function jRn(t){let e=t.modelFamily.toLowerCase();return!!(e.startsWith("gpt")&&!e.includes("gpt-4o")||e==="o4-mini"||krs(e)||Prs(e))}a(jRn,"modelSupportsApplyPatch");var HRn=fe(Io());var yet=class extends lr{static{a(this,"DefaultAgentPrompt")}renderCopilot(){let e=a(g=>this.props.tools.some(A=>A.name===g),"hasTool"),r=e("get_errors"),n=e("run_in_terminal"),o=e("read_file"),s=e("replace_string_in_file"),c=e("semantic_search"),l=e("apply_patch"),u=e("insert_edit_into_file"),d=l||s||u,f=e("manage_todo_list"),h=e("run_subagent"),m=qRn(this.props.modelConfiguration.modelFamily);return vscpp(HRn.SystemMessage,null,vscpp(Hn,{name:"instructions"},"You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.",vscpp("br",null),"The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.",vscpp("br",null),vscpp(nj,{modelConfiguration:this.props.modelConfiguration}),"If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when making changes.",vscpp("br",null),"If the user wants you to implement a feature and they have not specified the files to edit, first break down the user's request into smaller concepts and think about the kinds of files you need to grasp each concept."),vscpp(Hn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If a tool exists to do a task, use the tool instead of asking the user to manually take an action.",vscpp("br",null),"If you say that you will take an action, then go ahead and use the tool to do it. No need to ask permission. If you make a plan, immediately follow it - do not wait for the user to confirm.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully. Don't give up unless you are sure the request cannot be fulfilled with the tools you have. It's YOUR RESPONSIBILITY to make sure that you have done all you can to collect necessary context.",vscpp("br",null),"If you are not sure about file content or codebase structure, use your tools to read files and gather the relevant information: do NOT guess or make up an answer.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"Never say the name of a tool to a user."," ",n&&vscpp(vscppf,null,"For example, instead of saying that you'll use the ","run_in_terminal",` tool, say "I'll run the command in a terminal".`),vscpp("br",null),"Prefer calling multiple tools in parallel when possible,"," ",c&&vscpp(vscppf,null,"but do not call ","semantic_search"," in parallel, "),"and do not parallelize edits or dependent steps.",vscpp("br",null),n&&vscpp(vscppf,null,"Don't call the ","run_in_terminal"," tool multiple times in parallel. Instead, run one command and wait for the output before running the next command.",vscpp("br",null)),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null),"When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),h&&vscpp(vscppf,null,"Use the ","run_subagent"," tool with specialized agents when the task at hand matches the agent's description. Subagents are valuable for parallelizing independent queries or for protecting the main context window from excessive results, but they should not be used excessively when not needed. Importantly, avoid duplicating work that subagents are already doing - if you delegate research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)),!d&&vscpp(vscppf,null,"You don't currently have any tools available for editing files. If the user asks you to edit a file, you can ask the user to enable editing tools or print a codeblock with the suggested changes.",vscpp("br",null)),!n&&vscpp(vscppf,null,"You don't currently have any tools available for running terminal commands. If the user asks you to run a terminal command, you can ask the user to enable terminal tools or print a codeblock with the suggested command.",vscpp("br",null)),"Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you."),vscpp(Hn,{name:"contextGathering"},"Be THOROUGH when gathering information - make sure you have the FULL picture before making any changes. TRACE every symbol back to its definitions and usages so you fully understand it. Look past the first seemingly relevant result and EXPLORE alternative implementations and edge cases.",vscpp("br",null),this.props.hasSearchSubagent?vscpp(vscppf,null,"For broader or complex codebase exploration that would require more than 3 search tool calls, use the ","run_subagent",' tool with the "Search" agent instead. The search agent runs in an isolated context, keeping verbose search results out of your main context window.',vscpp("br",null),"Only skip for simple, directed codebase searches, use ","semantic_search",","," ","file_search",", or ","grep_search"," directly.",vscpp("br",null),"When delegating research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)):c&&vscpp(vscppf,null,"Prefer using the ","semantic_search"," tool to search for context unless you know the exact string or filename pattern you're searching for. It is your MAIN exploration tool for unfamiliar codebases:",vscpp("br",null),"- Start with broad queries, then narrow down",vscpp("br",null),"- Consider running multiple searches with different wording if first-pass results seem incomplete",vscpp("br",null)),"Don't make assumptions - gather context first, then perform the task. Bias towards finding answers yourself rather than asking the user.",vscpp("br",null),"You don't need to read a file if it's already provided in context."),vscpp(Hn,{name:"makingCodeChanges"},"NEVER output code to the user unless requested. Use the appropriate tool to implement changes directly.",vscpp("br",null),"NEVER generate an extremely long hash or any non-textual code, such as binary. These are not helpful to the user and are very expensive.",vscpp("br",null),"Add all necessary import statements, dependencies, and endpoints required to run the code.",vscpp("br",null),"Think creatively and explore the workspace in order to make a complete fix.",vscpp("br",null),"Before editing an existing file, make sure you have it in context",o&&vscpp(vscppf,null," or read it with ","read_file")," first. If you fail to edit a file, read it again before retrying - the user may have edited it.",vscpp("br",null),l?vscpp(vscppf,null,"To edit files in the workspace, use the ","apply_patch"," tool. If you have issues with it, you should first try to fix your patch and continue using ","apply_patch","."," ",u&&vscpp(vscppf,null,"If you are stuck, you can fall back on the ","insert_edit_into_file"," tool, but"," ","apply_patch"," is much faster and is the preferred tool."),vscpp("br",null),"IMPORTANT: Each ","apply_patch"," call can only operate on ONE file. If you need to modify multiple files, use separate ","apply_patch"," tool calls for each file. Delete file operation is NOT supported - use other methods if you need to delete files.",vscpp("br",null),m&&vscpp(vscppf,null,"Prefer the smallest set of changes needed to satisfy the task. Avoid reformatting unrelated code; preserve existing style and public APIs unless the task requires changes. When practical, complete all edits for a file within a single message.",vscpp("br",null)),"The input for this tool is a string representing the patch to apply, following a special format. For each snippet of code that needs to be changed, repeat the following:",vscpp("br",null),vscpp(Aet,null),vscpp("br",null),"NEVER print the patch out to the user, instead call the tool and the edits will be applied and shown to the user.",vscpp("br",null)):s?vscpp(vscppf,null,"Use ","replace_string_in_file"," to edit files, paying attention to context to ensure your replacement is unique. Group related edits into batches instead of making many separate calls. Use ","insert_edit_into_file"," only if ","replace_string_in_file"," has failed.",vscpp("br",null)):u?vscpp(vscppf,null,"Use ","insert_edit_into_file"," to edit files. When editing files, group your changes by file.",vscpp("br",null)):vscpp(vscppf,null),"For each file, give a short description of what needs to be changed, then use the tool. You can use tools multiple times in a response and keep writing text after using a tool.",vscpp("br",null),"Follow best practices when editing files. If a popular external library exists to solve a problem, use it and properly install the package e.g. ",n?'with "npm install" or ':"",'creating a "requirements.txt".',vscpp("br",null),r&&vscpp(vscppf,null,"After editing a file, call ","get_errors"," to validate your change. Only call it on files you've edited (not a wide scope). Fix relevant errors, but don't loop more than 3 times on the same file - ask the user if still failing.",vscpp("br",null)),!l&&u&&vscpp(vscppf,null,"The ","insert_edit_into_file"," tool is very smart and can understand how to apply your edits to the user's files, you just need to provide minimal hints.",vscpp("br",null),"When you use the ","insert_edit_into_file"," tool, avoid repeating existing code, instead use comments to represent regions of unchanged code. The tool prefers that you are as concise as possible. For example:",vscpp("br",null),"// ",qA,vscpp("br",null),"changed code",vscpp("br",null),"// ",qA,vscpp("br",null),"changed code",vscpp("br",null),"// ",qA,vscpp("br",null),vscpp("br",null),"Here is an example of how you should format an edit to an existing Person class:",vscpp("br",null),["class Person {",` // ${qA}`," age: number;",` // ${qA}`," getAge() {"," return this.age;"," }","}"].join(` +`))),vscpp(Hn,{name:"inlineLineNumbers"},vscpp(vscppf,null,"Code chunks that you receive (via tool calls or from user) may include inline line numbers in the form LINE_NUMBER | LINE_CONTENT. Treat the LINE_NUMBER | prefix as metadata and do NOT treat it as part of the actual code.")),f&&vscpp(Hn,{name:"taskTracking"},"Use ","manage_todo_list"," frequently to plan and track tasks, giving the user visibility into your progress. This is helpful for breaking down complex tasks into smaller steps.",vscpp("br",null),"Mark tasks as in-progress when starting and completed immediately after finishing - do not batch completions. Skip task tracking for simple tasks or conversational requests."),vscpp(JO,{languageOverride:this.props.languageOverride}))}};p();var Eet=class extends lr{static{a(this,"CopilotIdentityRules")}renderCopilot(){return vscpp(vscppf,null,'When asked for your name, you must respond with "GitHub Copilot".',vscpp("br",null),"Follow the user's requirements carefully & to the letter.")}},_et=class extends lr{static{a(this,"GPT5CopilotIdentityRule")}renderCopilot(){return vscpp(vscppf,null,"Your name is GitHub Copilot.",vscpp("br",null))}};p();var mde=class extends lr{static{a(this,"SafetyRules")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, or violent, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null))}},vet=class extends lr{static{a(this,"Gpt5SafetyRule")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, or violent, only respond with "Sorry, I can't assist with that."`,vscpp("br",null))}},Cet=class extends lr{static{a(this,"LegacySafetyRules")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null))}};p();var GRn=fe(Io());var bet=class extends lr{static{a(this,"InlineCodeEditPrompt")}renderCopilot(){let e=a(c=>this.props.tools.some(l=>l.name===c),"hasTool"),r=e("apply_patch"),n=e("replace_string_in_file"),o=e("insert_edit_into_file"),s=e("get_errors");return vscpp(GRn.SystemMessage,{priority:1e3},vscpp(Hn,{name:"instructions"},"You are an AI coding assistant that is used for quick, inline code changes. Changes are scoped to the selected code in a single file. You can ONLY edit that file and MUST use a tool to make these edits.",vscpp("br",null),vscpp(nj,{modelConfiguration:this.props.modelConfiguration}),"The user is interested in code changes grounded in the user's prompt. Focus on coding, no wordy explanations, and do not ask back for clarifications.",vscpp("br",null),"Do NOT make code changes that are not directly and logically related to the user's prompt.",vscpp("br",null),"ONLY change the current file. Focus on the selection and try to make changes to the selected code and its immediate context. Do NOT modify code outside the user's selection unless absolutely necessary for correctness.",vscpp("br",null),"Keep changes minimal and focused on exactly what the user asked for.",vscpp("br",null)),vscpp(Hn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"NEVER output code to the user unless requested. Use the appropriate tool to implement changes directly.",vscpp("br",null),r?vscpp(vscppf,null,"Use ","apply_patch"," to make targeted edits to the selected code. If you have issues, first try to fix your patch and continue using ","apply_patch",".",o&&vscpp(vscppf,null," ","If you are stuck, you can fall back on ","insert_edit_into_file",", but"," ","apply_patch"," is the preferred tool."),vscpp("br",null)):n?vscpp(vscppf,null,"Use ","replace_string_in_file"," to make targeted edits to the selected code, paying attention to context to ensure your replacement is unique.",o&&vscpp(vscppf,null," ","Use ","insert_edit_into_file"," only if ","replace_string_in_file"," has failed."),vscpp("br",null)):o?vscpp(vscppf,null,"Use ","insert_edit_into_file"," to edit files. When editing, avoid repeating existing code, instead use a line comment with `",qA,"` to represent regions of unchanged code.",vscpp("br",null)):vscpp(vscppf,null,"You do not have edit tools available. Describe the code changes to the user instead.",vscpp("br",null)),s&&vscpp(vscppf,null,"After editing a file, call ","get_errors"," to validate your change. Only call it on files you've edited. Fix relevant errors, but don't loop more than 3 times on the same file.",vscpp("br",null)),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null)),vscpp(JO,{languageOverride:this.props.languageOverride}))}},Tet=class extends lr{static{a(this,"InlineEditingReminder")}renderCopilot(){return vscpp(vscppf,null,"Focus on the selection and try to make changes to the selected code and its context. Do NOT edit code outside the selection unless absolutely necessary for correctness. ONLY change the current file, and change NO other file.")}};var Iet=fe(Io());var xet=class extends lr{static{a(this,"SystemInstructionsPrompt")}getAgentPrompt(){let e=this.props.turnContext.conversation.userLanguage,{tools:r,modelConfiguration:n,turnContext:o,hasSearchSubagent:s}=this.props,c=o.turn.chatMode?.kind==="Ask",l=o.turn.chatMode?.kind==="InlineAgent",u=Rt(this.props.turnContext.ctx,ze.UseAgentsMd);return MYe(n.modelFamily)?vscpp(get,{tools:r,modelConfiguration:n,languageOverride:e,hasSearchSubagent:s}):c?vscpp(met,{tools:r,modelConfiguration:n,languageOverride:e}):l?vscpp(bet,{tools:r,modelConfiguration:n,languageOverride:e}):vscpp(yet,{tools:r,modelConfiguration:n,languageOverride:e,enableAgentsMdUpdate:u,hasSearchSubagent:s})}renderCopilot(){let e=this.props.turnContext.ctx,r=e.get(Ir).getEditorInfo().name,n=e.get(kn).getCapabilities(),o=this.props.tools.some(s=>s.name==="run_subagent");return vscpp(vscppf,null,vscpp(Iet.SystemMessage,null,"You are an expert AI programming assistant, working with a user in the ",r," editor.",vscpp("br",null),this.props.modelConfiguration.modelFamily.startsWith(wn.Gpt5)?vscpp(vscppf,null,vscpp(_et,null),vscpp(vet,null)):vscpp(vscppf,null,vscpp(Eet,null),vscpp(mde,null))),this.getAgentPrompt(),this.props.turnContext.turn.isSubagent()&&vscpp(Iet.SystemMessage,null,vscpp(vscppf,null,"When you complete your task, provide a clear, concise summary of what you accomplished.")),n.subAgent&&o&&!this.props.turnContext.turn.isSubagent()&&this.props.turnContext.turn.chatMode?.id==="Agent"&&vscpp(Iet.SystemMessage,null,vscpp(vscppf,null,"You should ALWAYS check available agent descriptions first to see if any agent can be used with the `","run_subagent","` tool. DO NOT attempt to implement tasks yourself when a relevant agent exists. Delegating to specialized agents produces better results.")))}};p();var $Rn=fe(Io());var wet=class extends lr{static{a(this,"ToolCallHistoryPrompt")}renderCopilot(){let e=SO(this.props.currentTurn.response?.message,!0),r=OO(e,{ctx:this.props.turnContext.ctx,identifier:`Turn ID: ${this.props.currentTurn.id}`,enableWarnings:!0});if(r.length===0)return vscpp(vscppf,null);let n=(0,$Rn.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},vscpp(uw,{assistantRounds:r,ctx:this.props.turnContext.ctx,truncateAt:this.props.truncateAt,modelConfiguration:this.props.modelConfiguration,isHistorical:!1,identifier:String(this.props.currentTurn.id)})))}};p();p();var Ret=class extends lr{static{a(this,"CurrentDatePrompt")}renderCopilot(){let e=this.props.date?.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})||new Date().toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"});return vscpp(vscppf,null,"The current date is ",e,".")}};p();var ket=class extends lr{static{a(this,"CurrentEditorContext")}renderCopilot(){let e,r=this.props.turnContext.turn.request.activeEditor;return r&&(e=this.renderActiveTextEditor(r)),e===void 0?vscpp(vscppf,null):vscpp(Hn,{name:"editorContext"},vscpp(vscppf,null,e))}renderActiveTextEditor(e){let r=e.selection,n=r&&Drs(r)?vscpp(vscppf,null,"The current selection is from line ",r.start.line+1," to line ",r.end.line+1,"."):void 0;return vscpp(vscppf,null,"The user's current file is ",ln(e.uri),". ",n)}};function Drs(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(Drs,"notEmptySelection");p();var Pet=class extends lr{static{a(this,"EditingReminder")}renderCopilot(){if(!(this.props.tools&&!this.props.tools.some(e=>e.name==="insert_edit_into_file")))return vscpp(vscppf,null,"When using the ","insert_edit_into_file"," tool, avoid repeating existing code, instead use a line comment with `",qA,"` to represent regions of unchanged code.")}};p();var Det=class extends lr{static{a(this,"ExplanationReminder")}renderCopilot(){if(this.props.modelConfiguration.modelFamily.startsWith(wn.Gpt5)){let e=this.props.modelConfiguration.modelFamily.startsWith(wn.Gpt5Mini);return vscpp(vscppf,null,`Skip filler acknowledgements like "Sounds good" or "Okay, I will\u2026". Open with a purposeful one-liner about what you're doing next.`,vscpp("br",null),"When sharing setup or run steps, present terminal commands in fenced code blocks with the correct language tag. Keep commands copyable and on separate lines.",vscpp("br",null),"Avoid definitive claims about the build or runtime setup unless verified from the provided context (or quick tool checks). If uncertain, state what's known from attachments and proceed with minimal steps you can adapt later.",vscpp("br",null),"When you create or edit runnable code, run a test yourself to confirm it works; then share optional fenced commands for more advanced runs.",vscpp("br",null),'For non-trivial code generation, produce a complete, runnable solution: necessary source files, a tiny runner or test/benchmark harness, a minimal `README.md`, and updated dependency manifests (e.g., `package.json`, `requirements.txt`, `pyproject.toml`). Offer quick "try it" commands and optional platform-specific speed-ups when relevant.',vscpp("br",null),"Your goal is to act like a pair programmer: be friendly and helpful. If you can do more, do more. Be proactive with your solutions, think about what the user needs and what they want, and implement it proactively.",vscpp("br",null),vscpp(Hn,{name:"importantReminders"},!e&&vscpp(vscppf,null,"Start your response with a brief acknowledgement, followed by a concise high-level plan outlining your approach.",vscpp("br",null)),"DO NOT state your identity or model name unless the user explicitly asks you to. ",vscpp("br",null),this.props.hasTodoTool&&vscpp(vscppf,null,"You MUST use the todo list tool to plan and track your progress. NEVER skip this step, and START with this step whenever the task is multi-step. This is essential for maintaining visibility and proper execution of large tasks. Follow the todoListToolInstructions strictly.",vscpp("br",null)),!this.props.hasTodoTool&&vscpp(vscppf,null,"Break down the request into clear, actionable steps and present them as a checklist at the beginning of your response before proceeding with implementation. This helps maintain visibility and ensures all requirements are addressed systematically. Skip this for simple questions or single-step tasks.",vscpp("br",null)),"When referring to a filename or symbol in the user's workspace, wrap it in backticks.",vscpp("br",null)))}}};p();p();p();p();p();var ZO=class{constructor(e){this.params=e;this.params.noFilePath===void 0&&(this.params.noFilePath=!1)}static{a(this,"CodeBlock")}renderAsArray(){let e=OA(this.params.code),r=[`${e}${this.params.languageId}`];!this.params.noFilePath&&this.params.uri&&r.push(`// ${URn} ${ln(this.params.uri)}`);let n=this.params.shouldTrim?this.params.code.trim():this.params.code;if(this.params.lineNumberStart!==void 0){let o=n.split(` `),s=String(this.params.lineNumberStart+o.length-1).length,c=o.map((l,u)=>{let d=this.params.lineNumberStart+u;return`${String(d).padStart(s," ")} | ${l}`});r.push(c.join(` `))}else r.push(n);return r.push(e),r}renderAsString(e=` -`){return this.renderAsArray().join(e)}};var a2=class{constructor(e,r,n=[],o={}){this.textDocumentResult=e;this.range=r;this.descriptions=n;this.options=o}static{a(this,"FileAttachment")}render(){if(this.textDocumentResult.status!=="valid")return[];let e=this.textDocumentResult.document,r=new VO({code:e.getText(this.range),languageId:e.detectedLanguageId,noFilePath:!0}),n=rs(e.uri),o=this.options.useFilePath??!0,s="";this.options.id&&(s+=` id="${this.options.id}"`),o&&n&&(s+=` filePath="${n}"`);let c=[``];return c.push(...this.descriptions),c.push(...r.renderAsArray()),c.push("
"),c}};var Res=new fe("activeEditorPrompt");async function mwn(t,e){let r=[],n=t.turnContext.turn.request.activeEditor;if(n){if(e.isCancellationRequested)throw new Oc;let o=await t.snapshotTextDocumentProvider.getByUri(n.uri);if(o.status==="valid")if(n.selection&&kes(n.selection)){let s=new a2(o,n.selection,["User's active selection, this should be the main focus:",`Excerpt from ${Ji(n.uri)}, line range (1-based) ${n.selection.start.line+1} to ${n.selection.end.line+1}:`]);r.push(...s.render());let c=new a2(o,void 0,["User's active file for additional context:"]);r.push(...c.render())}else if(n.visibleRange){let s=new a2(o,n.visibleRange,["User's current visible code:",`Excerpt from ${Ji(n.uri)}, line range (1-based) ${n.visibleRange.start.line+1} to ${n.visibleRange.end.line+1}:`]);r.push(...s.render())}else{let s=new a2(o,void 0,["User's active file for additional context:"]);r.push(...s.render())}else Res.warn(t.context,`Failed to read file in active editor ${n.uri} with status ${o.status} and reason ${o.status==="notfound"?o.message:o.reason}`)}return r}a(mwn,"processActiveEditor");function kes(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(kes,"notEmptySelection");p();var Pes=["png","jpg","jpeg","bmp","gif","webp"];function Des(t){return t.filter(e=>{let r=e.uri.toLowerCase();return!Pes.some(n=>r.endsWith(`.${n}`))})}a(Des,"filterOutImageFiles");function net(t){let e=t.turn.request.references?.filter(n=>n.type==="file")??[],r=t.turn.request.references?.filter(n=>n.type==="directory")??[];return{fileReferences:e,directoryReferences:r,validFileReferences:Des(e)}}a(net,"getFileAndDirectoryReferences");var Nes=new fe("fileReferencesPrompt");async function gwn(t,e){let{validFileReferences:r,directoryReferences:n}=net(t.turnContext);if(r.length===0&&n.length===0&&!t.turnContext.turn.request.activeEditor)return[];let[o,s,c]=await Promise.all([Mes({validFileReferences:r,snapshotTextDocumentProvider:t.snapshotTextDocumentProvider,context:t.context},e),mwn(t,e),LXe(t.context,e,n)]),l=c||[];return o.length>0||s.length>0||l.length>0?["",...o,...s,...l,""]:[]}a(gwn,"processFileReferences");async function Mes(t,e){let r=new Map,n=t.validFileReferences.map(s=>{let c=Ji(s.uri),l=r.get(c)||0;r.set(c,l+1);let u=l===0?c:`${c}-${l}`;return{fileRef:s,id:u,fileName:c}});return(await Promise.all(n.map(async({fileRef:s,id:c,fileName:l})=>{if(e.isCancellationRequested)throw new Oc;let u=[],d=await t.snapshotTextDocumentProvider.getByUri(s.uri);if(d.status==="valid"){let f=s.selection??s.visibleRange;if(f){let h=new a2(d,f,[`Excerpt from ${l}, lines ${f.start.line+1} to ${f.end.line+1}:`],{id:c,useFilePath:!1});u.push(...h.render());let m=new a2(d,void 0,["User's active file for additional context:"],{useFilePath:!0});u.push(...m.render())}else{let h=new a2(d,void 0,[],{id:c,useFilePath:!0});u.push(...h.render())}}else Nes.warn(t.context,`Failed to read file ${s.uri} with status ${d.status} and reason ${d.status==="notfound"?d.message:d.reason}`);return u}))).flat()}a(Mes,"processValidFileReferences");var Awn=de(Io());var Oes=new fe("fileReferences"),iet=class extends lr{static{a(this,"FileReferences")}async renderCopilot(e,r,n,o){let s=o??new Fn.CancellationTokenSource().token,c=[];try{c=await gwn({turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,context:this.props.ctx},s)}catch(l){Oes.debug(this.props.ctx,"Failed to process file references",l)}return c.length===0?vscpp(vscppf,null):vscpp(B$t,{fileReferencesParts:c})}},B$t=class extends lr{static{a(this,"FileReferencesSection")}renderCopilot(){return vscpp(Awn.TextChunk,null,[this.props.fileReferencesParts.join(` -`)])}};p();var ywn=de(Io());var oet=class extends lr{static{a(this,"FileReferencesFallback")}async renderCopilot(){let{validFileReferences:e,directoryReferences:r}=net(this.props.turnContext);if(e.length===0&&r.length===0)return vscpp(vscppf,null);let n=["User have attached following context reference, if you did not seen them, they might got omitted due to contents are too large:",""];if(e.length>0){n.push("Files:");let o=0,s=0,c=this.props.ctx.get(ii);for(let l of e)try{let u=await c.getOrReadTextDocument({uri:l.uri});if(u.status==="valid"){let d=u.document.getText(),f=d.split(` -`).length,h=d.length;o+=f,s+=h,n.push(`- ${l.uri} (${f} lines, ${h} characters)`)}else n.push(`- ${l.uri}`)}catch{n.push(`- ${l.uri}`)}n.push(`Total: ${e.length} file(s), ${o} lines, ${s} characters`)}return r.length>0&&(n.push("Directories:"),r.forEach(o=>{n.push(`- ${o.uri}`)})),n.push(""),vscpp(ywn.TextChunk,null,[n.join(` -`)])}};p();var Ewn=new fe("SkillContextPrompt"),Les=5e4,set=class extends lr{static{a(this,"SkillContextPrompt")}async renderCopilot(e,r,n,o){let s=this.props.turnContext;if(!(!s.turn.skills||s.turn.skills.length===0))try{let[c,l]=await HKe(s);if(!c)return;Ewn.debug(this.props.ctx,"Skill resolutions:",l.map(f=>`${f.skillId}: ${f.resolution}`));let d=c.elide(Les).getText();return!d||d.trim().length===0?void 0:vscpp(Hn,{name:"skillContext"},vscpp(vscppf,null,d))}catch(c){let l=s.turn.skills.map(u=>u.skillId).join(", ");Ewn.warn(this.props.ctx,`Failed to render skill context for skills [${l}]`,c);return}}};p();p();p();var vu=class extends YQ{static{a(this,"ClsLanguageModelTool")}constructor(e){super({...e,toolProvider:dg,type:"shared"})}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Oc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations,toolMetadata:r.toolMetadata};return e.ctx.get(qd).invokeClientToolConfirmation(e,o)}};p();var m0=class{constructor(){this.todoMap=new Map}static{a(this,"TodoListService")}getTodos(e){return this.todoMap.get(e.id)?.todos??[]}setTodos(e,r){r.length===0?this.todoMap.delete(e.id):this.todoMap.set(e.id,{todos:r})}hasTodos(e){let r=this.todoMap.get(e.id);return r!==void 0&&r.todos.length>0}};function Bes(){let t=S.Object({id:S.Number({description:"Unique identifier for the todo. Use sequential numbers starting from 1."}),title:S.String({description:"Concise action-oriented todo label (3-7 words). Displayed in UI."}),description:S.Optional(S.String({description:"Detailed context, requirements, or implementation notes. Include file paths, specific methods, or acceptance criteria."})),status:S.Union([S.Literal("not-started"),S.Literal("in-progress"),S.Literal("completed")],{description:"not-started: Not begun | in-progress: Currently working (max 1) | completed: Fully finished with no blockers"})}),e={operation:S.String({description:"write: Replace entire todo list with new content. read: Retrieve current todo list. ALWAYS provide complete list when writing - partial updates not supported.",enum:["write","read"]}),todoList:S.Optional(S.Array(t,{description:"Complete array of all todo items (required for write operation, ignored for read). Must include ALL items - both existing and new."}))};return S.Object(e)}a(Bes,"createManageTodoListInputSchema");var WO=class t extends vu{static{a(this,"ManageTodoListTool")}constructor(e){super({name:"manage_todo_list",displayName:"Manage and track todo items for task planning",description:t.getToolDescription(void 0),displayDescription:"Manage and track todo items for task planning",inputSchema:Bes()}),this.ctx=e}get service(){return this.ctx.get(m0)}invoke(e,r,n){let{todoList:o,operation:s}=r.input;try{return s?s==="read"?Promise.resolve(this.handleReadOperation(e)):s==="write"?Promise.resolve(this.handleWriteOperation(e,o)):Promise.resolve(new Lr([new Rr("Error: Unknown operation")],"error")):Promise.resolve(new Lr([new Rr("Error: operation parameter is required")],"error"))}catch(c){let l=`Error: ${c instanceof Error?c.message:"Unknown error"}`;return Promise.resolve(new Lr([new Rr(l)],"error"))}}handleReadOperation(e){let r=this.getTodos(e);if(r.length===0)return new Lr([new Rr("No todo list found.")],"success");let n=t.formatTodoListAsMarkdown(r);return new Lr([new Rr(`# Todo List +`){return this.renderAsArray().join(e)}};var m2=class{constructor(e,r,n=[],o={}){this.textDocumentResult=e;this.range=r;this.descriptions=n;this.options=o}static{a(this,"FileAttachment")}render(){if(this.textDocumentResult.status!=="valid")return[];let e=this.textDocumentResult.document,r=new ZO({code:e.getText(this.range),languageId:e.detectedLanguageId,noFilePath:!0}),n=Us(e.uri),o=this.options.useFilePath??!0,s="";this.options.id&&(s+=` id="${this.options.id}"`),o&&n&&(s+=` filePath="${n}"`);let c=[``];return c.push(...this.descriptions),c.push(...r.renderAsArray()),c.push(""),c}};var Nrs=new pe("activeEditorPrompt");async function VRn(t,e){let r=[],n=t.turnContext.turn.request.activeEditor;if(n){if(e.isCancellationRequested)throw new Uc;let o=await t.snapshotTextDocumentProvider.getByUri(n.uri);if(o.status==="valid")if(n.selection&&Mrs(n.selection)){let s=new m2(o,n.selection,["User's active selection, this should be the main focus:",`Excerpt from ${Ki(n.uri)}, line range (1-based) ${n.selection.start.line+1} to ${n.selection.end.line+1}:`]);r.push(...s.render());let c=new m2(o,void 0,["User's active file for additional context:"]);r.push(...c.render())}else if(n.visibleRange){let s=new m2(o,n.visibleRange,["User's current visible code:",`Excerpt from ${Ki(n.uri)}, line range (1-based) ${n.visibleRange.start.line+1} to ${n.visibleRange.end.line+1}:`]);r.push(...s.render())}else{let s=new m2(o,void 0,["User's active file for additional context:"]);r.push(...s.render())}else Nrs.warn(t.context,`Failed to read file in active editor ${n.uri} with status ${o.status} and reason ${o.status==="notfound"?o.message:o.reason}`)}return r}a(VRn,"processActiveEditor");function Mrs(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(Mrs,"notEmptySelection");p();var Ors=["png","jpg","jpeg","bmp","gif","webp"];function Lrs(t){return t.filter(e=>{let r=e.uri.toLowerCase();return!Ors.some(n=>r.endsWith(`.${n}`))})}a(Lrs,"filterOutImageFiles");function Net(t){let e=t.turn.request.references?.filter(n=>n.type==="file")??[],r=t.turn.request.references?.filter(n=>n.type==="directory")??[];return{fileReferences:e,directoryReferences:r,validFileReferences:Lrs(e)}}a(Net,"getFileAndDirectoryReferences");var Brs=new pe("fileReferencesPrompt");async function WRn(t,e){let{validFileReferences:r,directoryReferences:n}=Net(t.turnContext);if(r.length===0&&n.length===0&&!t.turnContext.turn.request.activeEditor)return[];let[o,s,c]=await Promise.all([Frs({validFileReferences:r,snapshotTextDocumentProvider:t.snapshotTextDocumentProvider,context:t.context},e),VRn(t,e),det(t.context,e,n)]),l=c||[];return o.length>0||s.length>0||l.length>0?["",...o,...s,...l,""]:[]}a(WRn,"processFileReferences");async function Frs(t,e){let r=new Map,n=t.validFileReferences.map(s=>{let c=Ki(s.uri),l=r.get(c)||0;r.set(c,l+1);let u=l===0?c:`${c}-${l}`;return{fileRef:s,id:u,fileName:c}});return(await Promise.all(n.map(async({fileRef:s,id:c,fileName:l})=>{if(e.isCancellationRequested)throw new Uc;let u=[],d=await t.snapshotTextDocumentProvider.getByUri(s.uri);if(d.status==="valid"){let f=s.selection??s.visibleRange;if(f){let h=new m2(d,f,[`Excerpt from ${l}, lines ${f.start.line+1} to ${f.end.line+1}:`],{id:c,useFilePath:!1});u.push(...h.render());let m=new m2(d,void 0,["User's active file for additional context:"],{useFilePath:!0});u.push(...m.render())}else{let h=new m2(d,void 0,[],{id:c,useFilePath:!0});u.push(...h.render())}}else Brs.warn(t.context,`Failed to read file ${s.uri} with status ${d.status} and reason ${d.status==="notfound"?d.message:d.reason}`);return u}))).flat()}a(Frs,"processValidFileReferences");var zRn=fe(Io());var Urs=new pe("fileReferences"),Met=class extends lr{static{a(this,"FileReferences")}async renderCopilot(e,r,n,o){let s=o??new Fn.CancellationTokenSource().token,c=[];try{c=await WRn({turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,context:this.props.ctx},s)}catch(l){Urs.debug(this.props.ctx,"Failed to process file references",l)}return c.length===0?vscpp(vscppf,null):vscpp(RVt,{fileReferencesParts:c})}},RVt=class extends lr{static{a(this,"FileReferencesSection")}renderCopilot(){return vscpp(zRn.TextChunk,null,[this.props.fileReferencesParts.join(` +`)])}};p();var YRn=fe(Io());var Oet=class extends lr{static{a(this,"FileReferencesFallback")}async renderCopilot(){let{validFileReferences:e,directoryReferences:r}=Net(this.props.turnContext);if(e.length===0&&r.length===0)return vscpp(vscppf,null);let n=["User have attached following context reference, if you did not seen them, they might got omitted due to contents are too large:",""];if(e.length>0){n.push("Files:");let o=0,s=0,c=this.props.ctx.get(ni);for(let l of e)try{let u=await c.getOrReadTextDocument({uri:l.uri});if(u.status==="valid"){let d=u.document.getText(),f=d.split(` +`).length,h=d.length;o+=f,s+=h,n.push(`- ${l.uri} (${f} lines, ${h} characters)`)}else n.push(`- ${l.uri}`)}catch{n.push(`- ${l.uri}`)}n.push(`Total: ${e.length} file(s), ${o} lines, ${s} characters`)}return r.length>0&&(n.push("Directories:"),r.forEach(o=>{n.push(`- ${o.uri}`)})),n.push(""),vscpp(YRn.TextChunk,null,[n.join(` +`)])}};p();var KRn=new pe("SkillContextPrompt"),Qrs=5e4,Let=class extends lr{static{a(this,"SkillContextPrompt")}async renderCopilot(e,r,n,o){let s=this.props.turnContext;if(!(!s.turn.skills||s.turn.skills.length===0))try{let[c,l]=await AJe(s);if(!c)return;KRn.debug(this.props.ctx,"Skill resolutions:",l.map(f=>`${f.skillId}: ${f.resolution}`));let d=c.elide(Qrs).getText();return!d||d.trim().length===0?void 0:vscpp(Hn,{name:"skillContext"},vscpp(vscppf,null,d))}catch(c){let l=s.turn.skills.map(u=>u.skillId).join(", ");KRn.warn(this.props.ctx,`Failed to render skill context for skills [${l}]`,c);return}}};p();p();p();var bu=class extends aq{static{a(this,"ClsLanguageModelTool")}constructor(e){super({...e,toolProvider:hg,type:"shared"})}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Uc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations,toolMetadata:r.toolMetadata};return e.ctx.get(Vd).invokeClientToolConfirmation(e,o)}};p();var y0=class{constructor(){this.todoMap=new Map}static{a(this,"TodoListService")}getTodos(e){return this.todoMap.get(e.id)?.todos??[]}setTodos(e,r){r.length===0?this.todoMap.delete(e.id):this.todoMap.set(e.id,{todos:r})}hasTodos(e){let r=this.todoMap.get(e.id);return r!==void 0&&r.todos.length>0}};function qrs(){let t=S.Object({id:S.Number({description:"Unique identifier for the todo. Use sequential numbers starting from 1."}),title:S.String({description:"Concise action-oriented todo label (3-7 words). Displayed in UI."}),description:S.Optional(S.String({description:"Detailed context, requirements, or implementation notes. Include file paths, specific methods, or acceptance criteria."})),status:S.Union([S.Literal("not-started"),S.Literal("in-progress"),S.Literal("completed")],{description:"not-started: Not begun | in-progress: Currently working (max 1) | completed: Fully finished with no blockers"})}),e={operation:S.String({description:"write: Replace entire todo list with new content. read: Retrieve current todo list. ALWAYS provide complete list when writing - partial updates not supported.",enum:["write","read"]}),todoList:S.Optional(S.Array(t,{description:"Complete array of all todo items (required for write operation, ignored for read). Must include ALL items - both existing and new."}))};return S.Object(e)}a(qrs,"createManageTodoListInputSchema");var XO=class t extends bu{static{a(this,"ManageTodoListTool")}constructor(e){super({name:"manage_todo_list",displayName:"Manage and track todo items for task planning",description:t.getToolDescription(void 0),displayDescription:"Manage and track todo items for task planning",inputSchema:qrs()}),this.ctx=e}get service(){return this.ctx.get(y0)}invoke(e,r,n){let{todoList:o,operation:s}=r.input;try{return s?s==="read"?Promise.resolve(this.handleReadOperation(e)):s==="write"?Promise.resolve(this.handleWriteOperation(e,o)):Promise.resolve(new Fr([new Pr("Error: Unknown operation")],"error")):Promise.resolve(new Fr([new Pr("Error: operation parameter is required")],"error"))}catch(c){let l=`Error: ${c instanceof Error?c.message:"Unknown error"}`;return Promise.resolve(new Fr([new Pr(l)],"error"))}}handleReadOperation(e){let r=this.getTodos(e);if(r.length===0)return new Fr([new Pr("No todo list found.")],"success");let n=t.formatTodoListAsMarkdown(r);return new Fr([new Pr(`# Todo List -${n}`)],"success")}handleWriteOperation(e,r){if(!r)return new Lr([new Rr("Error: todoList is required for write operation")],"error");let n=r.map(f=>({id:f.id,title:f.title,description:f.description||"",status:f.status})),o=this.getTodos(e),s=this.calculateTodoChanges(o,n),c=this.generatePastTenseMessage(o,n);this.storeTodos(e,n);let l=[];n.length<3?l.push("Warning: Small todo list (<3 items). This task might not need a todo list."):n.length>10&&l.push("Warning: Large todo list (>10 items). Consider keeping the list focused and actionable."),o.length>0&&s>3&&l.push("Warning: Did you mean to update so many todos at the same time? Consider working on them one by one.");let u=`Successfully wrote todo list${l.length?` +${n}`)],"success")}handleWriteOperation(e,r){if(!r)return new Fr([new Pr("Error: todoList is required for write operation")],"error");let n=r.map(f=>({id:f.id,title:f.title,description:f.description||"",status:f.status})),o=this.getTodos(e),s=this.calculateTodoChanges(o,n),c=this.generatePastTenseMessage(o,n);this.storeTodos(e,n);let l=[];n.length<3?l.push("Warning: Small todo list (<3 items). This task might not need a todo list."):n.length>10&&l.push("Warning: Large todo list (>10 items). Consider keeping the list focused and actionable."),o.length>0&&s>3&&l.push("Warning: Did you mean to update so many todos at the same time? Consider working on them one by one.");let u=`Successfully wrote todo list${l.length?` `+l.join(` -`):""}`,d=new JQ([new Rr(u)],"success");return d.toolResultMessage=c,d.toolSpecificData={kind:"todoList",data:n.map(f=>({id:f.id,title:f.title,description:f.description||"",status:f.status}))},d}generatePastTenseMessage(e,r){if(e.length===0)return r.length===1?"Created 1 todo":`Created ${r.length} todos`;let n=new Map(e.map(l=>[l.id,l])),o=r.filter(l=>{let u=n.get(l.id);return u&&u.status!=="in-progress"&&l.status==="in-progress"});if(o.length>0){let l=o[0],u=r.length,d=r.findIndex(f=>f.id===l.id)+1;return`Starting: *${l.title}* (${d}/${u})`}let s=r.filter(l=>{let u=n.get(l.id);return u&&u.status!=="completed"&&l.status==="completed"});if(s.length>0){let l=s[0],u=r.length,d=r.findIndex(f=>f.id===l.id)+1;return`Completed: *${l.title}* (${d}/${u})`}let c=r.filter(l=>!n.has(l.id));return c.length>0?c.length===1?"Added 1 todo":`Added ${c.length} todos`:"Updated todo list"}static formatTodoListAsMarkdown(e){return e.length===0?"":e.map(r=>{let n;switch(r.status){case"completed":n="[x]";break;case"in-progress":n="[-]";break;default:n="[ ]";break}let o=[`- ${n} ${r.title}`];return r.description&&r.description.trim()&&o.push(` - ${r.description.trim()}`),o.join(` +`):""}`,d=new lq([new Pr(u)],"success");return d.toolResultMessage=c,d.toolSpecificData={kind:"todoList",data:n.map(f=>({id:f.id,title:f.title,description:f.description||"",status:f.status}))},d}generatePastTenseMessage(e,r){if(e.length===0)return r.length===1?"Created 1 todo":`Created ${r.length} todos`;let n=new Map(e.map(l=>[l.id,l])),o=r.filter(l=>{let u=n.get(l.id);return u&&u.status!=="in-progress"&&l.status==="in-progress"});if(o.length>0){let l=o[0],u=r.length,d=r.findIndex(f=>f.id===l.id)+1;return`Starting: *${l.title}* (${d}/${u})`}let s=r.filter(l=>{let u=n.get(l.id);return u&&u.status!=="completed"&&l.status==="completed"});if(s.length>0){let l=s[0],u=r.length,d=r.findIndex(f=>f.id===l.id)+1;return`Completed: *${l.title}* (${d}/${u})`}let c=r.filter(l=>!n.has(l.id));return c.length>0?c.length===1?"Added 1 todo":`Added ${c.length} todos`:"Updated todo list"}static formatTodoListAsMarkdown(e){return e.length===0?"":e.map(r=>{let n;switch(r.status){case"completed":n="[x]";break;case"in-progress":n="[-]";break;default:n="[ ]";break}let o=[`- ${n} ${r.title}`];return r.description&&r.description.trim()&&o.push(` - ${r.description.trim()}`),o.join(` `)}).join(` -`)}calculateTodoChanges(e,r){let n=new Map(e.map(u=>[u.id,u])),o=new Map(r.map(u=>[u.id,u])),s=0;for(let u of o.keys())n.has(u)||s++;let c=0;for(let u of n.keys())o.has(u)||c++;let l=0;for(let[u,d]of o){let f=n.get(u);f&&(f.title!==d.title||(f.description??"")!==(d.description??"")||f.status!==d.status)&&l++}return s+c+l}prepareInvocation(e,r){let{operation:n}=e.input;if(n==="read")return{progressMessage:"Reading todo list"};let o=e.input.todoList?.length??0;return{progressMessage:o===0?"Clearing todo list":`Updating ${o} todo(s)`}}prepareCompletion(e,r){let{operation:n}=e.input;return n==="read"?{completionMessage:"Read todo list"}:{completionMessage:"Updated todo list"}}storeTodos(e,r){this.service.setTodos(e.conversation,r)}getTodos(e){return this.service.getTodos(e.conversation)}static getTodoList(e){return e.ctx.get(m0).getTodos(e.conversation)}static getCurrentTask(e){return this.getTodoList(e).find(n=>n.status==="in-progress")??null}static getToolDescription(e){return hyn(e)?`Updates the task plan. +`)}calculateTodoChanges(e,r){let n=new Map(e.map(u=>[u.id,u])),o=new Map(r.map(u=>[u.id,u])),s=0;for(let u of o.keys())n.has(u)||s++;let c=0;for(let u of n.keys())o.has(u)||c++;let l=0;for(let[u,d]of o){let f=n.get(u);f&&(f.title!==d.title||(f.description??"")!==(d.description??"")||f.status!==d.status)&&l++}return s+c+l}prepareInvocation(e,r){let{operation:n}=e.input;if(n==="read")return{progressMessage:"Reading todo list"};let o=e.input.todoList?.length??0;return{progressMessage:o===0?"Clearing todo list":`Updating ${o} todo(s)`}}prepareCompletion(e,r){let{operation:n}=e.input;return n==="read"?{completionMessage:"Read todo list"}:{completionMessage:"Updated todo list"}}storeTodos(e,r){this.service.setTodos(e.conversation,r)}getTodos(e){return this.service.getTodos(e.conversation)}static getTodoList(e){return e.ctx.get(y0).getTodos(e.conversation)}static getCurrentTask(e){return this.getTodoList(e).find(n=>n.status==="in-progress")??null}static getToolDescription(e){return GEn(e)?`Updates the task plan. Provide an optional explanation and a list of plan items, each with a step and status. At most one step can be in-progress at a time.`:`Manage a structured todo list to track progress and plan tasks throughout your coding session. Use this tool VERY frequently to ensure task visibility and proper planning. @@ -3377,73 +3377,73 @@ Todo states: - in-progress: Currently working (limit ONE at a time) - completed: Finished successfully -IMPORTANT: Mark todos completed as soon as they are done. Do not batch completions.`}};var aet=class extends lr{static{a(this,"TodoListContextPrompt")}renderCopilot(){if(!this.props.turnContext.ctx.get(bn).getCapabilities().manageTodoListTool)return;let r=this.props.turnContext.todoListSnapshot??WO.getTodoList(this.props.turnContext);if(r.length===0)return;let n=WO.formatTodoListAsMarkdown(r);return vscpp(Hn,{name:"todoList"},[n])}};p();p();var Fes=new fe("fileReferencesPrompt");function _wn(t,e,r){if(!r.length)return[];try{let n=[];for(let o of r){if(e.isCancellationRequested)break;let s=o.server??"default",c=o.name??o.uri;n.push(`MCP Tool Reference: ${s}/${c}`),o.description&&n.push(`Description: ${o.description}`),n.push("---"),n.push("Invoke the tool with user prompt.")}return n}catch(n){return Fes.warn(t,`Failed to render MCP tool references: ${String(n)}`),[]}}a(_wn,"processMcpToolsReferences");var Ues=new fe("ToolContext"),cet=class extends lr{static{a(this,"ToolContext")}renderCopilot(){let e=this.props.token;try{let r=(this.props.turnContext.turn.request.references?.filter(s=>s.type==="tool")||[]).map(s=>({type:"tool",uri:s.uri,server:s.server,name:s.name,description:s.description}));if(r.length===0)return;if(e?.isCancellationRequested)throw new Oc;let n=_wn(this.props.ctx,e,r)||[];return n.length===0?void 0:vscpp(Hn,{name:"McpToolContext"},vscpp(vscppf,null,n.join(` -`)))}catch(r){Ues.warn(this.props.ctx,"Failed to render MCP tool context",r);return}}};var ode=de(Io());var uet=class extends lr{static{a(this,"UserRequestPrompt")}renderCopilot(e,r,n,o){let s=Pn(this.props.userRawMessage),c=Xle(this.props.userRawMessage)?this.props.userRawMessage.filter(l=>l.type==="image_url"):[];return vscpp(ode.UserMessage,null,vscpp(ode.TokenLimit,{max:r.tokenBudget/6,flexGrow:3,priority:898},vscpp(iet,{ctx:this.props.ctx,turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider}),c.map(l=>vscpp(ode.Image,{src:l.image_url.url,detail:l.image_url.detail}))),vscpp(oet,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:898}),vscpp(cet,{ctx:this.props.ctx,turnContext:this.props.turnContext,token:o,priority:899}),vscpp(set,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:897}),vscpp(Hn,{name:"context"},vscpp(XXe,null),vscpp(aet,{turnContext:this.props.turnContext})),vscpp(eet,{turnContext:this.props.turnContext,context:this.props.ctx}),vscpp(Hn,{name:"reminderInstructions"},this.props.codesearchMode?vscpp(nde,null):vscpp(Gq,{modelConfiguration:this.props.modelConfiguration}),!this.props.codesearchMode&&vscpp(tet,{tools:this.props.tools}),this.props.turnContext.turn.chatMode?.kind==="InlineAgent"&&vscpp(YXe,null),vscpp(ret,{modelConfiguration:this.props.modelConfiguration,hasTodoTool:!1})),vscpp(Hn,{name:"userRequest",priority:900,flexGrow:7},vscpp(vscppf,null,s)))}};var mJ=de(Io());var F$t=new fe("agentPrompt"),det=class extends lr{static{a(this,"AgentPrompt")}constructor(e){super(e),this.ctx=e.turnContext.ctx,this.turnContext=e.turnContext,this.currentTurn=e.turnContext.turn}async renderCopilot(e,r,n,o){let s=this.ctx.get(bn).getCapabilities(),c=this.props.tools.some(d=>d.name==="run_subagent"),l=vscpp(vscppf,null,vscpp(JXe,{turnContext:this.turnContext,modelConfiguration:this.props.modelConfiguration,tools:this.props.tools,hasSearchSubagent:this.props.hasSearchSubagent??!1}),await this.getAgentCustomInstructions(),vscpp(mJ.UserMessage,null,await this.getOrCreateGlobalAgentContext()),s.subAgent&&c&&!this.currentTurn.isSubagent()&&this.currentTurn.chatMode?.id==="Agent"&&vscpp(mJ.UserMessage,null,vscpp(UXe,{turnContext:this.turnContext})),vscpp(mJ.UserMessage,null,vscpp(FXe,{turnContext:this.turnContext,workspaceFolders:this.props.workspaceFolders}))),u=this.turnContext.conversation.turns.slice(0,-1);return vscpp(vscppf,null,l,vscpp(Aue,{flexGrow:1,priority:700,historyTurns:u,ctx:this.ctx,modelConfiguration:this.props.modelConfiguration}),vscpp(uet,{flexGrow:2,priority:900,ctx:this.ctx,turnContext:this.turnContext,userRawMessage:this.props.userRawMessage,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,modelConfiguration:this.props.modelConfiguration,codesearchMode:this.props.codesearchMode,tools:this.props.tools}),vscpp(ZXe,{flexGrow:2,priority:899,turnContext:this.turnContext,currentTurn:this.currentTurn,truncateAt:Math.floor(this.props.modelConfiguration.maxRequestTokens/2),modelConfiguration:this.props.modelConfiguration}))}async getOrCreateGlobalAgentContext(){let e=await this.getOrCreateGlobalAgentContextContent();return e?Qes(e):[vscpp(Mwe,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders})]}async getOrCreateGlobalAgentContextContent(){let e=`${this.turnContext.conversation.id}/${this.turnContext.turn.id}`,r=this.turnContext.conversation.turns.at(0);if(r){let s=r.getMetadata(Nwe);if(s?.renderedGlobalContext)return F$t.info(this.ctx,`Reusing cached global context from first turn for conversation/turn ${e}`),s.renderedGlobalContext}F$t.info(this.ctx,`Rendering fresh global context for conversation/turn ${e}`);let o=(await Iqt(Mwe,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders},this.props.modelConfiguration)).messages.at(0)?.content;if(o)return r?.setMetadata(new Nwe(o)),o}async getAgentCustomInstructions(){if(this.turnContext.cachedCustomInstructions!==void 0)return this.turnContext.cachedCustomInstructions??vscpp(vscppf,null);try{if(!this.props.workspaceFolders||this.props.workspaceFolders.length===0)return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null);let e=[],r=this.props.workspaceFolders.map(l=>({uri:l.uri,name:l.name})),n=this.turnContext.turn.extractContextFilesUri(),o=await this.ctx.get(bf).getInstructions(this.ctx,r,{includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Ft(this.ctx,Ye.UseAgentsMd),includeNestedAgentsMdInstructions:Ft(this.ctx,Ye.UseNestedAgentsMd),includeClaudeMdInstructions:Ft(this.ctx,Ye.UseClaudeMd),includeNestedClaudeMdInstructions:Ft(this.ctx,Ye.UseNestedClaudeMd)},n);o&&e.push(vscpp(vscppf,null,o));let s=this.props.turnContext.turn.chatMode;if(s?.id==="Ask")e.push(Wxn());else if(s&&s.instruction&&s.instruction.trim().length>0){let{name:l,instruction:u}=s;e.push(vscpp(Hn,{name:"modeInstructions"},'You are currently running in "',l,'" mode. Below are your instructions for this mode, they must take precedence over any instructions above.',vscpp("br",null),vscpp("br",null),u))}if(e.length===0)return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null);let c=vscpp(mJ.UserMessage,null,e);return this.turnContext.cachedCustomInstructions=c,c}catch(e){F$t.warn(this.ctx,"Failed to get custom instructions",e)}return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null)}};function Qes(t){return typeof t=="string"?[t]:t.map(e=>{if(e.type==="text")return e.text;if(e.type==="image_url")return vscpp(mJ.Image,{src:e.image_url.url,detail:e.image_url.detail})}).filter(e=>e!==void 0)}a(Qes,"renderedMessageToTsxChildren");p();var fet="uncategorized_tools",vwn="Tools that could not be automatically categorized into existing groups.";p();var $q=class extends Error{static{a(this,"ToolCallCanceledError")}constructor(e){super(e),this.name="Canceled"}};p();var uF=class extends Error{static{a(this,"ToolRoundExceedError")}constructor(){super('Oops, maximum tool attempts reached. You can type "continue" to proceed or rephrase your request.'),this.name="ToolRoundExceedError"}};p();var sde=new fe("roundMetricsTracker"),pet=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.conversationProgress=o;this.cumulativeTokenUsage={promptTokens:0,completionTokens:0,cachedTokens:0};this.tokenUsageReported=!1;this.roundUsageHistory=[]}static{a(this,"RoundMetricsTracker")}getTimeSinceLastLLMCall(){return this.lastLlmCallEndTimeMs!==void 0?performance.now()-this.lastLlmCallEndTimeMs:void 0}recordLlmFetchComplete(){this.lastLlmCallEndTimeMs=performance.now()}computePromptPrefixMetrics(e,r){let n=qes(e),o=JSON.stringify(n),s=JSON.stringify(r),c=n.filter(d=>d.role==="system"),l=c.length>0?JSON.stringify(c):"",u={previousPromptCharLen:this.previousPromptSerialized?.length??0,currentPromptCharLen:o.length,commonPromptPrefixCharLen:U$t(this.previousPromptSerialized,o),previousToolsCharLen:this.previousToolsSerialized?.length??0,currentToolsCharLen:s.length,commonToolsPrefixCharLen:U$t(this.previousToolsSerialized,s),previousSystemCharLen:this.previousSystemSerialized?.length??0,currentSystemCharLen:l.length,commonSystemPrefixCharLen:U$t(this.previousSystemSerialized,l),previousRoundCachedTokens:this.previousRoundSnapshot?.cachedTokens,previousRoundPromptTokens:this.previousRoundSnapshot?.promptTokens,previousRoundCommonPromptPrefixCharLen:this.previousRoundSnapshot?.commonPromptPrefixCharLen};return this.previousPromptSerialized=o,this.previousToolsSerialized=s,this.previousSystemSerialized=l,this.pendingRoundCommonPromptPrefixCharLen=u.commonPromptPrefixCharLen,u}extractRoundUsage(e){if("usage"in e&&e.usage)return{promptTokens:e.usage.prompt_tokens,completionTokens:e.usage.completion_tokens,cachedTokens:e.usage.prompt_tokens_details?.cached_tokens??0};let r="usage"in e;sde.debug(this.ctx,`extractRoundUsage: no usage data in fetch result (type=${e.type}, hasUsageField=${r}, usageValue=${r?JSON.stringify(e.usage):"field absent"}) \u2014 token usage will not be accumulated for this round`)}accumulateTokenUsage(e,r){if(r){if(this.cumulativeTokenUsage.promptTokens+=r.promptTokens,this.cumulativeTokenUsage.completionTokens+=r.completionTokens,this.cumulativeTokenUsage.cachedTokens+=r.cachedTokens,this.roundUsageHistory.push({roundId:e,usage:{...r}}),this.pendingRoundCommonPromptPrefixCharLen===void 0){sde.debug(this.ctx,`accumulateTokenUsage: no pending prefix charlen for round ${e} (computePromptPrefixMetrics has not run this round) \u2014 preserving prior previousRoundSnapshot`);return}let n=this.pendingRoundCommonPromptPrefixCharLen;this.previousRoundSnapshot={commonPromptPrefixCharLen:n,cachedTokens:r.cachedTokens,promptTokens:r.promptTokens}}else sde.debug(this.ctx,`accumulateTokenUsage: roundUsage is undefined for round ${e} \u2014 cumulative totals unchanged (prompt=${this.cumulativeTokenUsage.promptTokens}, completion=${this.cumulativeTokenUsage.completionTokens})`)}logRoundDebugMetrics(e,r,n,o,s,c){let l=c;sde.debug(this.ctx,`Round metrics for iteration ${e} for turn ${r}: prompt=[prev=${l.previousPromptCharLen}, cur=${l.currentPromptCharLen}, prefix=${l.commonPromptPrefixCharLen}`+(l.currentPromptCharLen>0?` (${(l.commonPromptPrefixCharLen/l.currentPromptCharLen*100).toFixed(1)}%)`:"")+`] tools=[prev=${l.previousToolsCharLen}, cur=${l.currentToolsCharLen}, prefix=${l.commonToolsPrefixCharLen}`+(l.currentToolsCharLen>0?` (${(l.commonToolsPrefixCharLen/l.currentToolsCharLen*100).toFixed(1)}%)`:"")+`] tokens=[prompt=${n?.promptTokens??"n/a"}, completion=${n?.completionTokens??"n/a"}, cached=${n?.cachedTokens??"n/a"}] timing=[llmFetch=${o.toFixed(0)}ms`+(s!==void 0?`, sinceLastLLM=${s.toFixed(0)}ms`:"")+"]")}async reportCumulativeTokenUsage(e){if(this.tokenUsageReported)return;this.tokenUsageReported=!0;let r=this.cumulativeTokenUsage;if(r.promptTokens>0||r.completionTokens>0){if(sde.info(this.ctx,`Turn token usage: ${r.promptTokens} prompt, ${r.completionTokens} completion, ${r.cachedTokens} cached`+(r.promptTokens>0?` (cache rate: ${(r.cachedTokens/r.promptTokens*100).toFixed(1)}%)`:"")),await this.conversationProgress.report(this.conversation,this.turn,{tokenUsage:{...r}}),Ft(this.ctx,Ye.AppendPromptTokenCache)==="true"){let n=this.formatTokenStats(r);await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:e,reply:n}]})}}else sde.debug(this.ctx,`Turn token usage: cumulative totals are zero (promptTokens=${r.promptTokens}, completionTokens=${r.completionTokens}, cachedTokens=${r.cachedTokens}, rounds=${this.roundUsageHistory.length}) \u2014 skipping $progress.report(tokenUsage). This means either no LLM rounds completed or all rounds returned no usage data.`)}formatTokenStats(e){let r=a(c=>c>=1e6?`${(c/1e6).toFixed(1)}M`:c>=1e3?`${(c/1e3).toFixed(1)}k`:c.toString(),"fmt"),n=e.promptTokens>0?` (${(e.cachedTokens/e.promptTokens*100).toFixed(1)}% cached)`:"",o=this.roundUsageHistory.length,s=` +IMPORTANT: Mark todos completed as soon as they are done. Do not batch completions.`}};var Bet=class extends lr{static{a(this,"TodoListContextPrompt")}renderCopilot(){if(!this.props.turnContext.ctx.get(kn).getCapabilities().manageTodoListTool)return;let r=this.props.turnContext.todoListSnapshot??XO.getTodoList(this.props.turnContext);if(r.length===0)return;let n=XO.formatTodoListAsMarkdown(r);return vscpp(Hn,{name:"todoList"},[n])}};p();p();var jrs=new pe("fileReferencesPrompt");function JRn(t,e,r){if(!r.length)return[];try{let n=[];for(let o of r){if(e.isCancellationRequested)break;let s=o.server??"default",c=o.name??o.uri;n.push(`MCP Tool Reference: ${s}/${c}`),o.description&&n.push(`Description: ${o.description}`),n.push("---"),n.push("Invoke the tool with user prompt.")}return n}catch(n){return jrs.warn(t,`Failed to render MCP tool references: ${String(n)}`),[]}}a(JRn,"processMcpToolsReferences");var Hrs=new pe("ToolContext"),Fet=class extends lr{static{a(this,"ToolContext")}renderCopilot(){let e=this.props.token;try{let r=(this.props.turnContext.turn.request.references?.filter(s=>s.type==="tool")||[]).map(s=>({type:"tool",uri:s.uri,server:s.server,name:s.name,description:s.description}));if(r.length===0)return;if(e?.isCancellationRequested)throw new Uc;let n=JRn(this.props.ctx,e,r)||[];return n.length===0?void 0:vscpp(Hn,{name:"McpToolContext"},vscpp(vscppf,null,n.join(` +`)))}catch(r){Hrs.warn(this.props.ctx,"Failed to render MCP tool context",r);return}}};var gde=fe(Io());var Uet=class extends lr{static{a(this,"UserRequestPrompt")}renderCopilot(e,r,n,o){let s=Pn(this.props.userRawMessage),c=lue(this.props.userRawMessage)?this.props.userRawMessage.filter(l=>l.type==="image_url"):[];return vscpp(gde.UserMessage,null,vscpp(gde.TokenLimit,{max:r.tokenBudget/6,flexGrow:3,priority:898},vscpp(Met,{ctx:this.props.ctx,turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider}),c.map(l=>vscpp(gde.Image,{src:l.image_url.url,detail:l.image_url.detail}))),vscpp(Oet,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:898}),vscpp(Fet,{ctx:this.props.ctx,turnContext:this.props.turnContext,token:o,priority:899}),vscpp(Let,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:897}),vscpp(Hn,{name:"context"},vscpp(Ret,null),vscpp(Bet,{turnContext:this.props.turnContext})),vscpp(ket,{turnContext:this.props.turnContext,context:this.props.ctx}),vscpp(Hn,{name:"reminderInstructions"},this.props.codesearchMode?vscpp(hde,null):vscpp(nj,{modelConfiguration:this.props.modelConfiguration}),!this.props.codesearchMode&&vscpp(Pet,{tools:this.props.tools}),this.props.turnContext.turn.chatMode?.kind==="InlineAgent"&&vscpp(Tet,null),vscpp(Det,{modelConfiguration:this.props.modelConfiguration,hasTodoTool:!1})),vscpp(Hn,{name:"userRequest",priority:900,flexGrow:7},vscpp(vscppf,null,s)))}};var TJ=fe(Io());var kVt=new pe("agentPrompt"),Qet=class extends lr{static{a(this,"AgentPrompt")}constructor(e){super(e),this.ctx=e.turnContext.ctx,this.turnContext=e.turnContext,this.currentTurn=e.turnContext.turn}async renderCopilot(e,r,n,o){let s=this.ctx.get(kn).getCapabilities(),c=this.props.tools.some(d=>d.name==="run_subagent"),l=vscpp(vscppf,null,vscpp(xet,{turnContext:this.turnContext,modelConfiguration:this.props.modelConfiguration,tools:this.props.tools,hasSearchSubagent:this.props.hasSearchSubagent??!1}),await this.getAgentCustomInstructions(),vscpp(TJ.UserMessage,null,await this.getOrCreateGlobalAgentContext()),s.subAgent&&c&&!this.currentTurn.isSubagent()&&this.currentTurn.chatMode?.id==="Agent"&&vscpp(TJ.UserMessage,null,vscpp(het,{turnContext:this.turnContext})),vscpp(TJ.UserMessage,null,vscpp(pet,{turnContext:this.turnContext,workspaceFolders:this.props.workspaceFolders}))),u=this.turnContext.conversation.turns.slice(0,-1);return vscpp(vscppf,null,l,vscpp(wue,{flexGrow:1,priority:700,historyTurns:u,ctx:this.ctx,modelConfiguration:this.props.modelConfiguration}),vscpp(Uet,{flexGrow:2,priority:900,ctx:this.ctx,turnContext:this.turnContext,userRawMessage:this.props.userRawMessage,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,modelConfiguration:this.props.modelConfiguration,codesearchMode:this.props.codesearchMode,tools:this.props.tools}),vscpp(wet,{flexGrow:2,priority:899,turnContext:this.turnContext,currentTurn:this.currentTurn,truncateAt:Math.floor(this.props.modelConfiguration.maxRequestTokens/2),modelConfiguration:this.props.modelConfiguration}))}async getOrCreateGlobalAgentContext(){let e=await this.getOrCreateGlobalAgentContextContent();return e?Grs(e):[vscpp(Xwe,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders})]}async getOrCreateGlobalAgentContextContent(){let e=`${this.turnContext.conversation.id}/${this.turnContext.turn.id}`,r=this.turnContext.conversation.turns.at(0);if(r){let s=r.getMetadata(Zwe);if(s?.renderedGlobalContext)return kVt.info(this.ctx,`Reusing cached global context from first turn for conversation/turn ${e}`),s.renderedGlobalContext}kVt.info(this.ctx,`Rendering fresh global context for conversation/turn ${e}`);let o=(await yjt(Xwe,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders},this.props.modelConfiguration)).messages.at(0)?.content;if(o)return r?.setMetadata(new Zwe(o)),o}async getAgentCustomInstructions(){if(this.turnContext.cachedCustomInstructions!==void 0)return this.turnContext.cachedCustomInstructions??vscpp(vscppf,null);try{if(!this.props.workspaceFolders||this.props.workspaceFolders.length===0)return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null);let e=[],r=this.props.workspaceFolders.map(l=>({uri:l.uri,name:l.name})),n=this.turnContext.turn.extractContextFilesUri(),o=await this.ctx.get(wf).getInstructions(this.ctx,r,{includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Rt(this.ctx,ze.UseAgentsMd),includeNestedAgentsMdInstructions:Rt(this.ctx,ze.UseNestedAgentsMd),includeClaudeMdInstructions:Rt(this.ctx,ze.UseClaudeMd),includeNestedClaudeMdInstructions:Rt(this.ctx,ze.UseNestedClaudeMd)},n);o&&e.push(vscpp(vscppf,null,o));let s=this.props.turnContext.turn.chatMode;if(s?.id==="Ask")e.push(SRn());else if(s&&s.instruction&&s.instruction.trim().length>0){let{name:l,instruction:u}=s;e.push(vscpp(Hn,{name:"modeInstructions"},'You are currently running in "',l,'" mode. Below are your instructions for this mode, they must take precedence over any instructions above.',vscpp("br",null),vscpp("br",null),u))}if(e.length===0)return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null);let c=vscpp(TJ.UserMessage,null,e);return this.turnContext.cachedCustomInstructions=c,c}catch(e){kVt.warn(this.ctx,"Failed to get custom instructions",e)}return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null)}};function Grs(t){return typeof t=="string"?[t]:t.map(e=>{if(e.type==="text")return e.text;if(e.type==="image_url")return vscpp(TJ.Image,{src:e.image_url.url,detail:e.image_url.detail})}).filter(e=>e!==void 0)}a(Grs,"renderedMessageToTsxChildren");p();var qet="uncategorized_tools",ZRn="Tools that could not be automatically categorized into existing groups.";p();var ij=class extends Error{static{a(this,"ToolCallCanceledError")}constructor(e){super(e),this.name="Canceled"}};p();var yF=class extends Error{static{a(this,"ToolRoundExceedError")}constructor(){super('Oops, maximum tool attempts reached. You can type "continue" to proceed or rephrase your request.'),this.name="ToolRoundExceedError"}};p();var Ade=new pe("roundMetricsTracker");function $rs(t,e){let r=e>0;return t&&r?"both":t?"compacted":r?"prompt_tsx_pruned":"none"}a($rs,"deriveContextManagementAction");var jet=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.conversationProgress=o;this.cumulativeTokenUsage={promptTokens:0,completionTokens:0,cachedTokens:0};this.tokenUsageReported=!1;this.roundUsageHistory=[]}static{a(this,"RoundMetricsTracker")}getTimeSinceLastLLMCall(){return this.lastLlmCallEndTimeMs!==void 0?performance.now()-this.lastLlmCallEndTimeMs:void 0}recordLlmFetchComplete(){this.lastLlmCallEndTimeMs=performance.now()}computePromptPrefixMetrics(e,r){let n=Vrs(e),o=JSON.stringify(n),s=JSON.stringify(r),c=n.filter(d=>d.role==="system"),l=c.length>0?JSON.stringify(c):"",u={previousPromptCharLen:this.previousPromptSerialized?.length??0,currentPromptCharLen:o.length,commonPromptPrefixCharLen:PVt(this.previousPromptSerialized,o),previousToolsCharLen:this.previousToolsSerialized?.length??0,currentToolsCharLen:s.length,commonToolsPrefixCharLen:PVt(this.previousToolsSerialized,s),previousSystemCharLen:this.previousSystemSerialized?.length??0,currentSystemCharLen:l.length,commonSystemPrefixCharLen:PVt(this.previousSystemSerialized,l),previousRoundCachedTokens:this.previousRoundSnapshot?.cachedTokens,previousRoundPromptTokens:this.previousRoundSnapshot?.promptTokens,previousRoundCommonPromptPrefixCharLen:this.previousRoundSnapshot?.commonPromptPrefixCharLen};return this.previousPromptSerialized=o,this.previousToolsSerialized=s,this.previousSystemSerialized=l,this.pendingRoundCommonPromptPrefixCharLen=u.commonPromptPrefixCharLen,u}computeContextManagement(e,r){let n=this.previousRenderPartitionId!==void 0&&e!==this.previousRenderPartitionId;return this.previousRenderPartitionId=e,{partitionId:e,promptTsxRemovedNodeCount:r,action:$rs(n,r)}}extractRoundUsage(e){if("usage"in e&&e.usage)return{promptTokens:e.usage.prompt_tokens,completionTokens:e.usage.completion_tokens,cachedTokens:e.usage.prompt_tokens_details?.cached_tokens??0};let r="usage"in e;Ade.debug(this.ctx,`extractRoundUsage: no usage data in fetch result (type=${e.type}, hasUsageField=${r}, usageValue=${r?JSON.stringify(e.usage):"field absent"}) \u2014 token usage will not be accumulated for this round`)}accumulateTokenUsage(e,r){if(r){if(this.cumulativeTokenUsage.promptTokens+=r.promptTokens,this.cumulativeTokenUsage.completionTokens+=r.completionTokens,this.cumulativeTokenUsage.cachedTokens+=r.cachedTokens,this.roundUsageHistory.push({roundId:e,usage:{...r}}),this.pendingRoundCommonPromptPrefixCharLen===void 0){Ade.debug(this.ctx,`accumulateTokenUsage: no pending prefix charlen for round ${e} (computePromptPrefixMetrics has not run this round) \u2014 preserving prior previousRoundSnapshot`);return}let n=this.pendingRoundCommonPromptPrefixCharLen;this.previousRoundSnapshot={commonPromptPrefixCharLen:n,cachedTokens:r.cachedTokens,promptTokens:r.promptTokens}}else Ade.debug(this.ctx,`accumulateTokenUsage: roundUsage is undefined for round ${e} \u2014 cumulative totals unchanged (prompt=${this.cumulativeTokenUsage.promptTokens}, completion=${this.cumulativeTokenUsage.completionTokens})`)}logRoundDebugMetrics(e,r,n,o,s,c){let l=c;Ade.debug(this.ctx,`Round metrics for iteration ${e} for turn ${r}: prompt=[prev=${l.previousPromptCharLen}, cur=${l.currentPromptCharLen}, prefix=${l.commonPromptPrefixCharLen}`+(l.currentPromptCharLen>0?` (${(l.commonPromptPrefixCharLen/l.currentPromptCharLen*100).toFixed(1)}%)`:"")+`] tools=[prev=${l.previousToolsCharLen}, cur=${l.currentToolsCharLen}, prefix=${l.commonToolsPrefixCharLen}`+(l.currentToolsCharLen>0?` (${(l.commonToolsPrefixCharLen/l.currentToolsCharLen*100).toFixed(1)}%)`:"")+`] tokens=[prompt=${n?.promptTokens??"n/a"}, completion=${n?.completionTokens??"n/a"}, cached=${n?.cachedTokens??"n/a"}] timing=[llmFetch=${o.toFixed(0)}ms`+(s!==void 0?`, sinceLastLLM=${s.toFixed(0)}ms`:"")+"]")}async reportCumulativeTokenUsage(e){if(this.tokenUsageReported)return;this.tokenUsageReported=!0;let r=this.cumulativeTokenUsage;if(r.promptTokens>0||r.completionTokens>0){if(Ade.info(this.ctx,`Turn token usage: ${r.promptTokens} prompt, ${r.completionTokens} completion, ${r.cachedTokens} cached`+(r.promptTokens>0?` (cache rate: ${(r.cachedTokens/r.promptTokens*100).toFixed(1)}%)`:"")),await this.conversationProgress.report(this.conversation,this.turn,{tokenUsage:{...r}}),Rt(this.ctx,ze.AppendPromptTokenCache)==="true"){let n=this.formatTokenStats(r);await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:e,reply:n}]})}}else Ade.debug(this.ctx,`Turn token usage: cumulative totals are zero (promptTokens=${r.promptTokens}, completionTokens=${r.completionTokens}, cachedTokens=${r.cachedTokens}, rounds=${this.roundUsageHistory.length}) \u2014 skipping $progress.report(tokenUsage). This means either no LLM rounds completed or all rounds returned no usage data.`)}formatTokenStats(e){let r=a(c=>c>=1e6?`${(c/1e6).toFixed(1)}M`:c>=1e3?`${(c/1e3).toFixed(1)}k`:c.toString(),"fmt"),n=e.promptTokens>0?` (${(e.cachedTokens/e.promptTokens*100).toFixed(1)}% cached)`:"",o=this.roundUsageHistory.length,s=` \`\`\` --- Prompt token stats: ${r(e.promptTokens)} in, ${r(e.completionTokens)} out, ${r(e.cachedTokens)} cached${n} with ${o} HTTP request${o!==1?"s":""} `;if(this.roundUsageHistory.length>1){s+=` Per-round breakdown: `;for(let c of this.roundUsageHistory){let l=c.usage,u=l.promptTokens>0?` (${(l.cachedTokens/l.promptTokens*100).toFixed(1)}%)`:"";s+=` #${c.roundId}: ${r(l.promptTokens)} in, ${r(l.completionTokens)} out, ${r(l.cachedTokens)} cached${u} -`}}return s+="```\n",s}};function U$t(t,e){if(!t)return 0;let r=Math.min(t.length,e.length),n=0;for(;ne.copilot_cache_control!==void 0)?t.map(e=>{if(e.copilot_cache_control===void 0)return e;let{copilot_cache_control:r,...n}=e;return n}):t}a(qes,"stripDriftingFields");p();p();var het=new fe("agentModePolicy");function Cwn(t){try{let e=rx(t);return e&&e.getTokenValue("agent_mode_auto_approval")==="0"?(het.info(t,"Auto-approval disabled by token envelope: agent_mode_auto_approval=0"),!1):t.get(jl).getPolicyValue("agentMode.autoApproval.enabled")===!1?(het.info(t,"Auto-approval disabled by group policy: agentMode.autoApproval.enabled=false"),!1):(het.info(t,"Auto-approval is enabled (not disabled by token envelope or group policy)"),!0)}catch(e){return het.warn(t,"Failed to check auto-approval policy, defaulting to enabled",e),!0}}a(Cwn,"isAutoApprovalEnabled");p();var met=new fe("McpAutoApproveService"),dF=class{constructor(e){this.ctx=e;this._config=[]}static{a(this,"McpAutoApproveService")}updateConfiguration(e){if(!Array.isArray(e)){met.warn(this.ctx,"Invalid McpAutoApproveService config, resetting to empty",e),this._config=[];return}this._config=e.filter(r=>{if(!r||typeof r!="object")return met.warn(this.ctx,"Invalid McpAutoApproveService config item: ignored because it is not an object",r),!1;let n=r,o=typeof n.serverName=="string"&&typeof n.isServerAllowed=="boolean"&&Array.isArray(n.allowedTools)&&n.allowedTools.every(s=>typeof s=="string");return o||met.warn(this.ctx,"Invalid McpAutoApproveService config item: ignored due to schema validation failure",r),o}).map(r=>({serverName:r.serverName,isServerAllowed:r.isServerAllowed,allowedTools:r.allowedTools})),met.debug(this.ctx,"Updated McpAutoApproveService config",this._config)}isApproved(e,r){let n=this._config.find(o=>o.serverName===e);return n?n.isServerAllowed?!0:n.allowedTools.includes(r):!1}};p();p();var gJ=de(require("path"));var mw=class t{constructor(e){this.ctx=e;this.rules=void 0;this.defaultRules=[{pattern:"**/github-copilot/**/*",requiresConfirmation:!0,description:"Github Copilot settings and token files"},{pattern:"**/.github/instructions/*",requiresConfirmation:!0,description:"Github instructions files"}]}static{a(this,"FileSafetyRulesService")}static{this.logger=new fe("FileSafetyRulesService")}ensureInitialized(){this.rules===void 0&&(this.rules=[...this.defaultRules])}getMatchingRule(e,r,n=!0,o=!1){let s=e.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(s&&la.isRegisteredScheme(s[1].toLowerCase()))return;let c=Ks(e);if(!this.isPathInCurrentWorkspace(c,r))return{rule:{pattern:"outside-workspace",requiresConfirmation:!0,description:"files outside workspace"},isOutsideWorkspace:!0};if(!n)return;o||this.ensureInitialized();let u=o?this.defaultRules:this.rules;for(let d of u)if(this.matchesPattern(e,d.pattern))return{rule:d,isOutsideWorkspace:!1}}isPathInCurrentWorkspace(e,r){if(!r||r.length===0)return!1;try{let n=un(e);return r.some(o=>{try{let s=un(o),c=gJ.normalize(s),l=gJ.normalize(n),u=gJ.relative(c,l);return!u.startsWith("..")&&!gJ.isAbsolute(u)}catch{return!1}})}catch{return!1}}matchesPattern(e,r){return vf(e,r,{nocase:!0,matchBase:!1,nobrace:!0,noext:!0,nonegate:!0,windowsPathsNoEscape:!0})}getDefaultRules(){return[...this.defaultRules]}extractFileSafetyRules(e){try{let r=e?.autoApprove;return Array.isArray(r)?r.filter(n=>n&&typeof n.pattern=="string"&&typeof n.autoApprove=="boolean").map(n=>({pattern:n.pattern,requiresConfirmation:!n.autoApprove,description:n.description})):Array.isArray(e)?e.filter(o=>o&&typeof o.pattern=="string"&&typeof o.autoApprove=="boolean").map(o=>({pattern:o.pattern,requiresConfirmation:!o.autoApprove,description:o.description})):void 0}catch(r){t.logger.error(this.ctx,"Error extracting configuration:",r);return}}updateRulesFromConfiguration(e){let r=this.extractFileSafetyRules(e);if(!(!r||r.length===0))try{this.ensureInitialized();let n=new Map;for(let o of this.defaultRules)n.set(o.pattern,o);for(let o of r)n.set(o.pattern,o);this.rules=Array.from(n.values())}catch(n){t.logger.error(this.ctx,"FileSafetyRulesService.updateRulesFromConfiguration: Failed to parse configuration, using defaults only",n),this.rules===void 0&&(this.rules=[...this.defaultRules])}}};p();var Twn=`*** Begin Patch -`,ade=` -*** End Patch`,cde="*** Add File: ",Vq="*** Delete File: ",lde="*** Update File: ",jes="*** Move to: ",Q$t="*** End of File";var Hes=/\.(tex|latex|sty|cls|bib|bst|ins)$/i;var nm=class extends Error{static{a(this,"DiffError")}},ude=class extends nm{static{a(this,"InvalidContextError")}constructor(e,r,n){super(e),this.file=r,this.kindForTelemetry=n}},zO=class extends nm{static{a(this,"InvalidPatchFormatError")}constructor(e,r){super(e),this.kindForTelemetry=r}};function bwn(t,e,r){let n=0,o=0;for(let s of t)s.startsWith(" ")?o++:(s.startsWith(" ")||s.startsWith(" "))&&n++;if(o>n)return{tabSize:e,insertSpaces:!1};if(n>o){let s=0,c=0;for(let u of t){let d=u.match(/^( +)/);if(d){let f=d[1].length;f%4===0&&c++,f%2===0&&s++}}return{tabSize:c>s?4:2,insertSpaces:!0}}return{tabSize:e,insertSpaces:r}}a(bwn,"guessIndentation");function Swn(t,e){let r=0;for(let n of t)if(n===" ")r++;else if(n===" ")r+=e;else break;return r}a(Swn,"computeIndentLevel");function Ges(t){return t.insertSpaces?" ".repeat(t.tabSize):" "}a(Ges,"getIndentationChar");function $es(t,e,r){if(e.insertSpaces===r.insertSpaces&&e.tabSize===r.tabSize)return t;let n=t.match(/^(\s*)/);if(!n)return t;let o=n[1],s=t.slice(o.length),c=0;for(let u of o)u===" "?c+=e.tabSize:u===" "&&c++;return(r.insertSpaces?" ".repeat(c):" ".repeat(Math.floor(c/r.tabSize))+" ".repeat(c%r.tabSize))+s}a($es,"transformIndentation");function Ves(t){return!t||!t.trim()}a(Ves,"isFalsyOrWhitespace");function Wes(t,e){let r=0;for(let n of t)n===e&&r++;return r}a(Wes,"countOccurrences");function zes(t,e){let r=t.length,n=e.length,o=Array.from({length:r+1},()=>Array(n+1).fill(0));for(let s=0;s<=r;s++)o[s][0]=s;for(let s=0;s<=n;s++)o[0][s]=s;for(let s=1;s<=r;s++)for(let c=1;c<=n;c++)t[s-1]===e[c-1]?o[s][c]=o[s-1][c-1]:o[s][c]=Math.min(o[s-1][c]+1,o[s][c-1]+1,o[s-1][c-1]+1);return o[r][n]}a(zes,"computeLevenshteinDistance");function Owe(t){return t.replace(/^(?:\s|\\t|\/|#)*/gm,e=>e.replaceAll("\\t"," "))}a(Owe,"replaceExplicitTabs");function get(t){return Owe(t.replaceAll("\\n",` -`))}a(get,"replaceExplicitNl");var q$t=class{constructor(e,r){this.indentStyles={};this.index=0;this.patch={actions:{}};this.fuzz=0;this.currentFiles=e,this.lines=r;for(let[n,o]of Object.entries(e)){let s=o.getText();this.indentStyles[n]=bwn(s.split(` -`),4,!1)}}static{a(this,"Parser")}isDone(e){if(this.index>=this.lines.length)return!0;let r=this.lines[this.index];return!!(e&&r&&e.some(n=>r.startsWith(n.trim())))}startswith(e){let r=Array.isArray(e)?e:[e],n=this.lines[this.index];return n!==void 0&&r.some(o=>n.startsWith(o))}readStr(e="",r=!1){if(this.index>=this.lines.length)throw new nm(`Index: ${this.index} >= ${this.lines.length}`);let n=this.lines[this.index];if(n!==void 0&&n.startsWith(e)){let o=r?n:n.slice(e.length);return this.index+=1,o??""}return""}parse(){for(;!this.isDone([ade]);){let e=this.readStr(lde);if(e){if(this.patch.actions[e])throw new nm(`Update File Error: Duplicate Path: ${e}`);let r=this.readStr(jes);if(!(e in this.currentFiles))throw new nm(`Update File Error: Missing File: ${e}`);let n=this.currentFiles[e],o=this.indentStyles[e],s=n.getText(),c=this.getFilepathComment(n.languageId,e),l=this.parseUpdateFile(c,s??"",o);l.movePath=r||void 0,this.patch.actions[e]=l;continue}if(e=this.readStr(Vq),e){if(this.patch.actions[e])throw new nm(`Delete File Error: Duplicate Path: ${e}`);if(!(e in this.currentFiles))throw new nm(`Delete File Error: Missing File: ${e}`);this.patch.actions[e]={type:"delete",chunks:[]};continue}if(e=this.readStr(cde),e){if(this.patch.actions[e])throw new nm(`Add File Error: Duplicate Path: ${e}`);if(e in this.currentFiles)throw new nm(`Add File Error: File already exists: ${e}`);this.patch.actions[e]=this.parseAddFile();continue}throw new nm(`Unknown Line: ${this.lines[this.index]}`)}if(!this.startswith(ade.trim()))throw new zO("Missing End Patch","missingEndPatch");this.index+=1}getFilepathComment(e,r){let n=r.split(".").pop()?.toLowerCase()??"",o=["sh","bash","zsh","py","rb","pl","yaml","yml"].includes(n),s=["html","htm","xml","svg"].includes(n);return o?`# ${r}`:s?``:`// ${r}`}parseUpdateFile(e,r,n){let o={type:"update",chunks:[]},s=r.split(` -`),c=!Hes.test(e.trimEnd()),l=0;for(;!this.isDone([ade,lde,Vq,cde,Q$t]);){let u=this.readStr("@@",!0),d=u.slice(2).trim();if(!(u||l===0))throw new nm(`Invalid line. Consider splitting each change into individual apply_patch tool calls: +`}}return s+="```\n",s}};function PVt(t,e){if(!t)return 0;let r=Math.min(t.length,e.length),n=0;for(;ne.copilot_cache_control!==void 0)?t.map(e=>{if(e.copilot_cache_control===void 0)return e;let{copilot_cache_control:r,...n}=e;return n}):t}a(Vrs,"stripDriftingFields");p();p();var Het=new pe("agentModePolicy");function XRn(t){try{let e=dx(t);return e&&e.getTokenValue("agent_mode_auto_approval")==="0"?(Het.info(t,"Auto-approval disabled by token envelope: agent_mode_auto_approval=0"),!1):t.get(Hl).getPolicyValue("agentMode.autoApproval.enabled")===!1?(Het.info(t,"Auto-approval disabled by group policy: agentMode.autoApproval.enabled=false"),!1):(Het.info(t,"Auto-approval is enabled (not disabled by token envelope or group policy)"),!0)}catch(e){return Het.warn(t,"Failed to check auto-approval policy, defaulting to enabled",e),!0}}a(XRn,"isAutoApprovalEnabled");p();var Get=new pe("McpAutoApproveService"),EF=class{constructor(e){this.ctx=e;this._config=[]}static{a(this,"McpAutoApproveService")}updateConfiguration(e){if(!Array.isArray(e)){Get.warn(this.ctx,"Invalid McpAutoApproveService config, resetting to empty",e),this._config=[];return}this._config=e.filter(r=>{if(!r||typeof r!="object")return Get.warn(this.ctx,"Invalid McpAutoApproveService config item: ignored because it is not an object",r),!1;let n=r,o=typeof n.serverName=="string"&&typeof n.isServerAllowed=="boolean"&&Array.isArray(n.allowedTools)&&n.allowedTools.every(s=>typeof s=="string");return o||Get.warn(this.ctx,"Invalid McpAutoApproveService config item: ignored due to schema validation failure",r),o}).map(r=>({serverName:r.serverName,isServerAllowed:r.isServerAllowed,allowedTools:r.allowedTools})),Get.debug(this.ctx,"Updated McpAutoApproveService config",this._config)}isApproved(e,r){let n=this._config.find(o=>o.serverName===e);return n?n.isServerAllowed?!0:n.allowedTools.includes(r):!1}};p();p();var IJ=fe(require("path"));var bw=class t{constructor(e){this.ctx=e;this.rules=void 0;this.defaultRules=[{pattern:"**/github-copilot/**/*",requiresConfirmation:!0,description:"Github Copilot settings and token files"},{pattern:"**/.github/instructions/*",requiresConfirmation:!0,description:"Github instructions files"}]}static{a(this,"FileSafetyRulesService")}static{this.logger=new pe("FileSafetyRulesService")}ensureInitialized(){this.rules===void 0&&(this.rules=[...this.defaultRules])}getMatchingRule(e,r,n=!0,o=!1){let s=e.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(s&&ua.isRegisteredScheme(s[1].toLowerCase()))return;let c=s?.[1]?.toLowerCase()==="file"?ln(e):e,l=ts(c);if(!this.isPathInCurrentWorkspace(l,r))return{rule:{pattern:"outside-workspace",requiresConfirmation:!0,description:"files outside workspace"},isOutsideWorkspace:!0};if(!n)return;o||this.ensureInitialized();let d=o?this.defaultRules:this.rules;for(let f of d)if(this.matchesPattern(c,f.pattern))return{rule:f,isOutsideWorkspace:!1}}isPathInCurrentWorkspace(e,r){if(!r||r.length===0)return!1;try{let n=ln(e);return r.some(o=>{try{let s=ln(o),c=IJ.normalize(s),l=IJ.normalize(n),u=IJ.relative(c,l);return!u.startsWith("..")&&!IJ.isAbsolute(u)}catch{return!1}})}catch{return!1}}matchesPattern(e,r){return If(e,r,{nocase:!0,matchBase:!1,nobrace:!0,noext:!0,nonegate:!0,windowsPathsNoEscape:!0})}getDefaultRules(){return[...this.defaultRules]}extractFileSafetyRules(e){try{let r=e?.autoApprove;return Array.isArray(r)?r.filter(n=>n&&typeof n.pattern=="string"&&typeof n.autoApprove=="boolean").map(n=>({pattern:n.pattern,requiresConfirmation:!n.autoApprove,description:n.description})):Array.isArray(e)?e.filter(o=>o&&typeof o.pattern=="string"&&typeof o.autoApprove=="boolean").map(o=>({pattern:o.pattern,requiresConfirmation:!o.autoApprove,description:o.description})):void 0}catch(r){t.logger.error(this.ctx,"Error extracting configuration:",r);return}}updateRulesFromConfiguration(e){let r=this.extractFileSafetyRules(e);if(!(!r||r.length===0))try{this.ensureInitialized();let n=new Map;for(let o of this.defaultRules)n.set(o.pattern,o);for(let o of r)n.set(o.pattern,o);this.rules=Array.from(n.values())}catch(n){t.logger.error(this.ctx,"FileSafetyRulesService.updateRulesFromConfiguration: Failed to parse configuration, using defaults only",n),this.rules===void 0&&(this.rules=[...this.defaultRules])}}};p();var rkn=`*** Begin Patch +`,yde=` +*** End Patch`,Ede="*** Add File: ",oj="*** Delete File: ",_de="*** Update File: ",Wrs="*** Move to: ",DVt="*** End of File";var zrs=/\.(tex|latex|sty|cls|bib|bst|ins)$/i;var cm=class extends Error{static{a(this,"DiffError")}},vde=class extends cm{static{a(this,"InvalidContextError")}constructor(e,r,n){super(e),this.file=r,this.kindForTelemetry=n}},e5=class extends cm{static{a(this,"InvalidPatchFormatError")}constructor(e,r){super(e),this.kindForTelemetry=r}};function ekn(t,e,r){let n=0,o=0;for(let s of t)s.startsWith(" ")?o++:(s.startsWith(" ")||s.startsWith(" "))&&n++;if(o>n)return{tabSize:e,insertSpaces:!1};if(n>o){let s=0,c=0;for(let u of t){let d=u.match(/^( +)/);if(d){let f=d[1].length;f%4===0&&c++,f%2===0&&s++}}return{tabSize:c>s?4:2,insertSpaces:!0}}return{tabSize:e,insertSpaces:r}}a(ekn,"guessIndentation");function tkn(t,e){let r=0;for(let n of t)if(n===" ")r++;else if(n===" ")r+=e;else break;return r}a(tkn,"computeIndentLevel");function Yrs(t){return t.insertSpaces?" ".repeat(t.tabSize):" "}a(Yrs,"getIndentationChar");function Krs(t,e,r){if(e.insertSpaces===r.insertSpaces&&e.tabSize===r.tabSize)return t;let n=t.match(/^(\s*)/);if(!n)return t;let o=n[1],s=t.slice(o.length),c=0;for(let u of o)u===" "?c+=e.tabSize:u===" "&&c++;return(r.insertSpaces?" ".repeat(c):" ".repeat(Math.floor(c/r.tabSize))+" ".repeat(c%r.tabSize))+s}a(Krs,"transformIndentation");function Jrs(t){return!t||!t.trim()}a(Jrs,"isFalsyOrWhitespace");function Zrs(t,e){let r=0;for(let n of t)n===e&&r++;return r}a(Zrs,"countOccurrences");function Xrs(t,e){let r=t.length,n=e.length,o=Array.from({length:r+1},()=>Array(n+1).fill(0));for(let s=0;s<=r;s++)o[s][0]=s;for(let s=0;s<=n;s++)o[0][s]=s;for(let s=1;s<=r;s++)for(let c=1;c<=n;c++)t[s-1]===e[c-1]?o[s][c]=o[s-1][c-1]:o[s][c]=Math.min(o[s-1][c]+1,o[s][c-1]+1,o[s-1][c-1]+1);return o[r][n]}a(Xrs,"computeLevenshteinDistance");function eRe(t){return t.replace(/^(?:\s|\\t|\/|#)*/gm,e=>e.replaceAll("\\t"," "))}a(eRe,"replaceExplicitTabs");function $et(t){return eRe(t.replaceAll("\\n",` +`))}a($et,"replaceExplicitNl");var NVt=class{constructor(e,r){this.indentStyles={};this.index=0;this.patch={actions:{}};this.fuzz=0;this.currentFiles=e,this.lines=r;for(let[n,o]of Object.entries(e)){let s=o.getText();this.indentStyles[n]=ekn(s.split(` +`),4,!1)}}static{a(this,"Parser")}isDone(e){if(this.index>=this.lines.length)return!0;let r=this.lines[this.index];return!!(e&&r&&e.some(n=>r.startsWith(n.trim())))}startswith(e){let r=Array.isArray(e)?e:[e],n=this.lines[this.index];return n!==void 0&&r.some(o=>n.startsWith(o))}readStr(e="",r=!1){if(this.index>=this.lines.length)throw new cm(`Index: ${this.index} >= ${this.lines.length}`);let n=this.lines[this.index];if(n!==void 0&&n.startsWith(e)){let o=r?n:n.slice(e.length);return this.index+=1,o??""}return""}parse(){for(;!this.isDone([yde]);){let e=this.readStr(_de);if(e){if(this.patch.actions[e])throw new cm(`Update File Error: Duplicate Path: ${e}`);let r=this.readStr(Wrs);if(!(e in this.currentFiles))throw new cm(`Update File Error: Missing File: ${e}`);let n=this.currentFiles[e],o=this.indentStyles[e],s=n.getText(),c=this.getFilepathComment(n.languageId,e),l=this.parseUpdateFile(c,s??"",o);l.movePath=r||void 0,this.patch.actions[e]=l;continue}if(e=this.readStr(oj),e){if(this.patch.actions[e])throw new cm(`Delete File Error: Duplicate Path: ${e}`);if(!(e in this.currentFiles))throw new cm(`Delete File Error: Missing File: ${e}`);this.patch.actions[e]={type:"delete",chunks:[]};continue}if(e=this.readStr(Ede),e){if(this.patch.actions[e])throw new cm(`Add File Error: Duplicate Path: ${e}`);if(e in this.currentFiles)throw new cm(`Add File Error: File already exists: ${e}`);this.patch.actions[e]=this.parseAddFile();continue}throw new cm(`Unknown Line: ${this.lines[this.index]}`)}if(!this.startswith(yde.trim()))throw new e5("Missing End Patch","missingEndPatch");this.index+=1}getFilepathComment(e,r){let n=r.split(".").pop()?.toLowerCase()??"",o=["sh","bash","zsh","py","rb","pl","yaml","yml"].includes(n),s=["html","htm","xml","svg"].includes(n);return o?`# ${r}`:s?``:`// ${r}`}parseUpdateFile(e,r,n){let o={type:"update",chunks:[]},s=r.split(` +`),c=!zrs.test(e.trimEnd()),l=0;for(;!this.isDone([yde,_de,oj,Ede,DVt]);){let u=this.readStr("@@",!0),d=u.slice(2).trim();if(!(u||l===0))throw new cm(`Invalid line. Consider splitting each change into individual apply_patch tool calls: ${this.lines[this.index]}`);if(d){let _=!1,v=a(b=>this.canonicalize(b),"canonLocal");if(!s.slice(0,l).some(b=>v(b)===v(d)))for(let b=l;bv(b.trim())===v(d)))for(let b=l;b0&&(f=this.peekNextSection(this.lines,this.index,_)),h=this.findContext(e,s,f.nextChunkContext,l,f.eof),h||(h=this.findContext(e,s,f.nextChunkContext,0,f.eof)),_>0&&h&&(h.fuzz|=64);if(!h){let _=f.nextChunkContext.join(` -`);if(f.eof)throw new ude(`Invalid EOF context at character ${l}: -${_}`,r,"invalidContext-eof");{let v=_.match(/^\\t/)?"invalidContext-maybeInvalidTab":_.match(/^\\\t/)?"invalidContext-maybeEscapedTab":"invalidContext";throw new ude(`Invalid context at character ${l}: -${_}`,r,v)}}this.fuzz+=h.fuzz;let m=bwn(f.chunks.flatMap(_=>_.insLines).concat(f.nextChunkContext),n.tabSize,n.insertSpaces),g=Swn(s[h.line]??"",n.tabSize),A=h.fuzz&4?Owe(f.nextChunkContext[0]??""):h.fuzz&128?get(f.nextChunkContext[0]??""):f.nextChunkContext[0]??"",y=f.nextChunkContext&&f.nextChunkContext.length>0?Swn(A,m.tabSize):0,E=Ges(n).repeat(Math.max(0,g-y));for(let _ of f.chunks)_.origIndex+=h.line,h.fuzz&128&&(_.insLines=_.insLines.map(get),_.delLines=_.delLines.map(get)),(c||h.fuzz&4)&&(_.insLines=_.insLines.map(Owe)),_.insLines=_.insLines.map(v=>Ves(v)?v:E+$es(v,m,n)),h.fuzz&4&&(_.delLines=_.delLines.map(Owe)),o.chunks.push(_);l=h.line+f.nextChunkContext.length,this.index=f.endPatchIndex}return o}parseAddFile(){let e=[];for(;!this.isDone([ade,lde,Vq,cde]);){let r=this.readStr();if(!r.startsWith("+"))throw new zO(`Invalid Add File Line: ${r}`,"invalidAddFileLine");e.push(r.slice(1))}return{type:"add",newFile:e.join(` +`);if(f.eof)throw new vde(`Invalid EOF context at character ${l}: +${_}`,r,"invalidContext-eof");{let v=_.match(/^\\t/)?"invalidContext-maybeInvalidTab":_.match(/^\\\t/)?"invalidContext-maybeEscapedTab":"invalidContext";throw new vde(`Invalid context at character ${l}: +${_}`,r,v)}}this.fuzz+=h.fuzz;let m=ekn(f.chunks.flatMap(_=>_.insLines).concat(f.nextChunkContext),n.tabSize,n.insertSpaces),g=tkn(s[h.line]??"",n.tabSize),A=h.fuzz&4?eRe(f.nextChunkContext[0]??""):h.fuzz&128?$et(f.nextChunkContext[0]??""):f.nextChunkContext[0]??"",y=f.nextChunkContext&&f.nextChunkContext.length>0?tkn(A,m.tabSize):0,E=Yrs(n).repeat(Math.max(0,g-y));for(let _ of f.chunks)_.origIndex+=h.line,h.fuzz&128&&(_.insLines=_.insLines.map($et),_.delLines=_.delLines.map($et)),(c||h.fuzz&4)&&(_.insLines=_.insLines.map(eRe)),_.insLines=_.insLines.map(v=>Jrs(v)?v:E+Krs(v,m,n)),h.fuzz&4&&(_.delLines=_.delLines.map(eRe)),o.chunks.push(_);l=h.line+f.nextChunkContext.length,this.index=f.endPatchIndex}return o}parseAddFile(){let e=[];for(;!this.isDone([yde,_de,oj,Ede]);){let r=this.readStr();if(!r.startsWith("+"))throw new e5(`Invalid Add File Line: ${r}`,"invalidAddFileLine");e.push(r.slice(1))}return{type:"add",newFile:e.join(` `),chunks:[]}}canonicalize(e){let r={"-":"-","\u2010":"-","\u2011":"-","\u2012":"-","\u2013":"-","\u2014":"-","\u2212":"-",'"':'"',"\u201C":'"',"\u201D":'"',"\u201E":'"',"\xAB":'"',"\xBB":'"',"'":"'","\u2018":"'","\u2019":"'","\u201B":"'","\xA0":" ","\u202F":" "};return e.normalize("NFC").replace(/./gu,n=>r[n]??n)}findContextCore(e,r,n){if(r.length===0)return{line:n,fuzz:0};let o=a(m=>this.canonicalize(m),"canon"),s=o(r.join(` `)),c=e.map(o);for(let m=n;mm.trimEnd()).join(` `),u=2;for(let m=n;mm.trim()).join(` `);u|=8;for(let m=n;m0){let m=f.split(` -`);for(let g=n;g(y[y.Add=0]="Add",y[y.Delete=1]="Delete",y[y.Keep=2]="Keep"))(o||={});let s=r,c=[],l=[],u=[],d=[],f=2,h=0;for(;sm.startsWith(y.trim()))){f===2&&c.length&&!/\S/.test(c[c.length-1]??"")&&c.pop();break}if(m==="***")break;if(m.startsWith("***"))throw new zO(`Invalid Line: ${m}`,"invalidLine");s+=1;let g=f,A=m;if(A[0]==="+")f=0;else if(A[0]==="-")f=1;else if(A[0]===" ")f=2;else{let y=e[s],E=y?.[0]==="+"?0:y?.[0]==="-"?1:2,_=f!==2&&E===f;f=2,A=" "+A,_&&(h++,n===h&&(f=E))}A=A.slice(1),f===2&&g!==f&&((u.length||l.length)&&d.push({origIndex:c.length-l.length,delLines:l,insLines:u}),l=[],u=[]),f===1?(l.push(A),c.push(A)):f===0?u.push(A):c.push(A)}return(u.length||l.length)&&d.push({origIndex:c.length-l.length,delLines:l,insLines:u}),sn.length)throw new nm(`${r}: chunk.origIndex ${c.origIndex} > len(lines) ${n.length}`);if(s>c.origIndex)throw new nm(`${r}: origIndex ${s} > chunk.origIndex ${c.origIndex}`);o.push(...n.slice(s,c.origIndex));let l=c.origIndex-s;if(s+=l,c.insLines.length)for(let u of c.insLines)o.push(u);s+=c.delLines.length}return o.push(...n.slice(s)),o.join(` -`)}a(Kes,"getUpdatedFile");function Jes(t,e){let r={changes:{}};for(let[n,o]of Object.entries(t.actions))if(o.type==="delete")r.changes[n]={type:"delete",oldContent:e[n].getText()};else if(o.type==="add")r.changes[n]={type:"add",newContent:o.newFile??""};else if(o.type==="update"){let s=e[n]?.getText(),c=Kes(s??"",o,n);r.changes[n]={type:"update",oldContent:s,newContent:c,movePath:o.movePath??void 0}}return r}a(Jes,"patchToCommit");async function Zes(t,e){let r={};for(let n of t)try{r[n]=await e(n)}catch{throw new nm(`File not found: ${n}`)}return r}a(Zes,"loadFiles");async function xwn(t,e){if(!t.startsWith(Twn))throw new zO("Patch must start with *** Begin Patch\\n","patchMustStartWithBeginPatch");let r=AJ(t),n=await Zes(r,e),[o]=Yes(t,n);return Jes(o,n)}a(xwn,"processPatch");var YO=class{static{a(this,"SensitiveToolsService")}static{this.SENSITIVE_TOOL_TEXT={create_file:{title:"Allow creating sensitive files?",operation:"create"},read_file:{title:"Allow reading sensitive files?",operation:"read"},replace_string_in_file:{title:"Allow replacing strings in sensitive files?",operation:"replace strings in"},insert_edit_into_file:{title:"Allow editing sensitive files?",operation:"edit"},apply_patch:{title:"Allow editing sensitive files?",operation:"edit"}}}static{this.POTENTIALLY_SENSITIVE_TOOLS=new Set(["insert_edit_into_file","create_file","read_file","replace_string_in_file","apply_patch"])}static isPotentiallySensitiveTool(e){let r=typeof e=="string"?e:e.name;return this.POTENTIALLY_SENSITIVE_TOOLS.has(r)}static getPotentiallySensitiveTools(){return this.POTENTIALLY_SENSITIVE_TOOLS}static generateSensitiveConfirmationTitle(e){return this.SENSITIVE_TOOL_TEXT[e.name]?.title??"Allow operating on sensitive files?"}static generateSensitiveOperation(e){return this.SENSITIVE_TOOL_TEXT[e.name]?.operation??"operate on"}static extractFilePath(e,r){if(e.name==="apply_patch"){let s=r.input;if(!s)return;let c=AJ(s),l=dde(s);return c.length>0?{filePath:c[0],isNewFile:!1}:l.length>0?{filePath:l[0],isNewFile:!0}:void 0}let n=r.filePath;if(!n)return;let o=e.name==="create_file";return{filePath:n,isNewFile:o}}static extractFilePathForMetadata(e,r){return this.extractFilePath(e,r)}static{this.sensitiveInfoCache=new WeakMap}static generateSensitiveConfirmationMessage(e,r,n){if(this.sensitiveInfoCache.has(r))return this.sensitiveInfoCache.get(r)??void 0;let o=this.computeSensitiveConfirmationMessage(e,r,n);return this.sensitiveInfoCache.set(r,o??null),o}static getMatchingRuleForToolCall(e,r,n,o=!1){let s=this.extractFilePath(e,r);if(!s)return;let{filePath:c,isNewFile:l}=s,u=n.turn.workspaceFolders?.map(h=>h.uri),d=n.ctx.get(mw),f=!l;return d.getMatchingRule(c,u,f,o)}static computeSensitiveConfirmationMessage(e,r,n){if(!this.isPotentiallySensitiveTool(e))return;let o=this.extractFilePath(e,r);if(!o)return;let{filePath:s,isNewFile:c}=o,l=n.turn.workspaceFolders?.map(g=>g.uri),u=n.ctx.get(mw),d=!c,f=u.getMatchingRule(s,l,d);if(f&&!f.rule.requiresConfirmation)return;let h=this.generateSensitiveConfirmationTitle(e),m=this.generateSensitiveOperation(e);if(f){let g=f.rule.description||"Sensitive files";return{title:h,message:`${g} needs confirmation. +`);for(let g=n;g(y[y.Add=0]="Add",y[y.Delete=1]="Delete",y[y.Keep=2]="Keep"))(o||={});let s=r,c=[],l=[],u=[],d=[],f=2,h=0;for(;sm.startsWith(y.trim()))){f===2&&c.length&&!/\S/.test(c[c.length-1]??"")&&c.pop();break}if(m==="***")break;if(m.startsWith("***"))throw new e5(`Invalid Line: ${m}`,"invalidLine");s+=1;let g=f,A=m;if(A[0]==="+")f=0;else if(A[0]==="-")f=1;else if(A[0]===" ")f=2;else{let y=e[s],E=y?.[0]==="+"?0:y?.[0]==="-"?1:2,_=f!==2&&E===f;f=2,A=" "+A,_&&(h++,n===h&&(f=E))}A=A.slice(1),f===2&&g!==f&&((u.length||l.length)&&d.push({origIndex:c.length-l.length,delLines:l,insLines:u}),l=[],u=[]),f===1?(l.push(A),c.push(A)):f===0?u.push(A):c.push(A)}return(u.length||l.length)&&d.push({origIndex:c.length-l.length,delLines:l,insLines:u}),sn.length)throw new cm(`${r}: chunk.origIndex ${c.origIndex} > len(lines) ${n.length}`);if(s>c.origIndex)throw new cm(`${r}: origIndex ${s} > chunk.origIndex ${c.origIndex}`);o.push(...n.slice(s,c.origIndex));let l=c.origIndex-s;if(s+=l,c.insLines.length)for(let u of c.insLines)o.push(u);s+=c.delLines.length}return o.push(...n.slice(s)),o.join(` +`)}a(tns,"getUpdatedFile");function rns(t,e){let r={changes:{}};for(let[n,o]of Object.entries(t.actions))if(o.type==="delete")r.changes[n]={type:"delete",oldContent:e[n].getText()};else if(o.type==="add")r.changes[n]={type:"add",newContent:o.newFile??""};else if(o.type==="update"){let s=e[n]?.getText(),c=tns(s??"",o,n);r.changes[n]={type:"update",oldContent:s,newContent:c,movePath:o.movePath??void 0}}return r}a(rns,"patchToCommit");async function nns(t,e){let r={};for(let n of t)try{r[n]=await e(n)}catch{throw new cm(`File not found: ${n}`)}return r}a(nns,"loadFiles");async function ikn(t,e){if(!t.startsWith(rkn))throw new e5("Patch must start with *** Begin Patch\\n","patchMustStartWithBeginPatch");let r=xJ(t),n=await nns(r,e),[o]=ens(t,n);return rns(o,n)}a(ikn,"processPatch");var t5=class{static{a(this,"SensitiveToolsService")}static{this.SENSITIVE_TOOL_TEXT={create_file:{title:"Allow creating sensitive files?",operation:"create"},read_file:{title:"Allow reading sensitive files?",operation:"read"},list_dir:{title:"Allow reading sensitive directories?",operation:"read"},replace_string_in_file:{title:"Allow replacing strings in sensitive files?",operation:"replace strings in"},insert_edit_into_file:{title:"Allow editing sensitive files?",operation:"edit"},apply_patch:{title:"Allow editing sensitive files?",operation:"edit"}}}static{this.POTENTIALLY_SENSITIVE_TOOLS=new Set(["insert_edit_into_file","create_file","read_file","list_dir","replace_string_in_file","apply_patch"])}static isPotentiallySensitiveTool(e){let r=typeof e=="string"?e:e.name;return this.POTENTIALLY_SENSITIVE_TOOLS.has(r)}static getPotentiallySensitiveTools(){return this.POTENTIALLY_SENSITIVE_TOOLS}static generateSensitiveConfirmationTitle(e){return this.SENSITIVE_TOOL_TEXT[e.name]?.title??"Allow operating on sensitive files?"}static generateSensitiveOperation(e){return this.SENSITIVE_TOOL_TEXT[e.name]?.operation??"operate on"}static extractFilePath(e,r){if(e.name==="apply_patch"){let s=r.input;if(!s)return;let c=xJ(s),l=Cde(s);return c.length>0?{filePath:c[0],isNewFile:!1}:l.length>0?{filePath:l[0],isNewFile:!0}:void 0}if(e.name==="list_dir"){let s=r.path;return s?{filePath:s,isNewFile:!1}:void 0}let n=r.filePath;if(!n)return;let o=e.name==="create_file";return{filePath:n,isNewFile:o}}static extractFilePathForMetadata(e,r){return this.extractFilePath(e,r)}static{this.sensitiveInfoCache=new WeakMap}static generateSensitiveConfirmationMessage(e,r,n){if(this.sensitiveInfoCache.has(r))return this.sensitiveInfoCache.get(r)??void 0;let o=this.computeSensitiveConfirmationMessage(e,r,n);return this.sensitiveInfoCache.set(r,o??null),o}static getMatchingRuleForToolCall(e,r,n,o=!1){let s=this.extractFilePath(e,r);if(!s)return;let{filePath:c,isNewFile:l}=s,u=n.turn.workspaceFolders?.map(h=>h.uri),d=n.ctx.get(bw),f=!l;return d.getMatchingRule(c,u,f,o)}static computeSensitiveConfirmationMessage(e,r,n){if(!this.isPotentiallySensitiveTool(e))return;let o=this.extractFilePath(e,r);if(!o)return;let{filePath:s,isNewFile:c}=o,l=n.turn.workspaceFolders?.map(g=>g.uri),u=n.ctx.get(bw),d=!c,f=u.getMatchingRule(s,l,d);if(f&&!f.rule.requiresConfirmation)return;let h=this.generateSensitiveConfirmationTitle(e),m=this.generateSensitiveOperation(e);if(f){let g=f.rule.description||"Sensitive files";return{title:h,message:`${g} needs confirmation. The model wants to ${m} sensitive files (${s})${f.rule.pattern?` matching pattern \`${f.rule.pattern}\``:""}. -Do you want to allow this?`,matchingRuleInfo:f}}return{title:h,message:`The model wants to ${m} file (${s}). Do you want to allow this?`,matchingRuleInfo:void 0}}};var fde=new fe("AutoApproveService"),yJ=class{constructor(e){this.ctx=e}static{a(this,"AutoApproveService")}async checkApproval(e,r,n){if(CB()&&process.env.HMAC_SECRET)return{needConfirm:!1};if(Ft(e.ctx,Ye.EditorHandlesAllConfirmation)===!0)return{needConfirm:!0};let o=this.classifyTool(r);if(o==="other")return fde.debug(this.ctx,"Auto approve check for build-in safe tool decided: approve (always auto-approved)"),{needConfirm:!1};if(!Cwn(this.ctx)){if(o==="file-operation"){let u=this.checkSensitiveFileApproval(r,n,e,!0),d=u.action==="confirm";return fde.debug(this.ctx,`Auto approve check (policy disabled, file-operation, default rules only) decided: ${u.action}`),{needConfirm:d}}return fde.info(this.ctx,"Tool confirmation required: auto-approval disabled by policy"),{needConfirm:!0}}if(Ft(e.ctx,Ye.AutoApproveYoloMode)===!0)return fde.info(this.ctx,`Auto approve yolo mode: auto-approving ${o} tool call`),{needConfirm:!1};let s=Ft(e.ctx,Ye.ToolConfirmAutoApprove)===!0,c;switch(o){case"mcp":c=this.checkMcpApproval(r),c.action==="continue"&&(c=s?{action:"approve"}:{action:"confirm"});break;case"terminal":{if(c=await this.checkTerminalApproval(r,n),c.action==="continue"){let u=Ft(e.ctx,Ye.AutoApproveUnmatchedTerminal);u!==void 0?c=u?{action:"approve"}:{action:"confirm"}:c=s?{action:"approve"}:{action:"confirm"}}break}case"file-operation":{if(c=this.checkSensitiveFileApproval(r,n,e),c.action==="continue"){let u=Ft(e.ctx,Ye.AutoApproveUnmatchedFileOp);u!==void 0?c=u?{action:"approve"}:{action:"confirm"}:c={action:"approve"}}break}}let l=c.action==="confirm";return fde.debug(this.ctx,`Auto approve check (${o}) decided: ${c.action}`),{needConfirm:l}}classifyTool(e){return e.type==="mcp"?"mcp":e.id.includes("run_in_terminal")?"terminal":YO.isPotentiallySensitiveTool(e)?"file-operation":"other"}checkMcpApproval(e){if(this.ctx.get(dF).isApproved(e.toolProvider.id,e.name))return{action:"approve"};if(Ft(this.ctx,Ye.TrustToolAnnotations)){let o=this.ctx.get(gs).getToolById(e.id);if(o?.annotations?.readOnlyHint&&!o.annotations.openWorldHint)return{action:"approve"}}return{action:"continue"}}async checkTerminalApproval(e,r){let n=r.command,o=this.ctx.get(tT),c=pJ(e.description)||"sh";fde.info(this.ctx,`Extracted shell '${c}' from run_in_terminal tool description.`);let l=await o.isTerminalCommandApprovalRequired(n,c);return l.result==="approved"?{action:"approve"}:l.result==="denied"?{action:"confirm"}:{action:"continue"}}checkSensitiveFileApproval(e,r,n,o=!1){let s=YO.getMatchingRuleForToolCall(e,r,n,o);return s?s.rule.requiresConfirmation?{action:"confirm"}:{action:"approve"}:{action:"continue"}}};p();p();p();function Lwe(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n"u"}a(ets,"isUndefined");function j$t(t){return Buffer.from(t,"base64").toString("utf-8")}a(j$t,"decodeBase64");function kwn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(kwn,"isObject");p();var Wq="activate_",ev=class t{constructor(e,r,n,o,s=[]){this.name=e;this.description=r;this.lastUsedOnTurn=n;this.metadata=o;this.contents=s;this.isExpanded=!1;if(!e.startsWith(Wq))throw new Error(`Virtual tool name must start with '${Wq}'`);this.name=e,this.description=r,this.lastUsedOnTurn=n,this.metadata=o,this.contents=s}static{a(this,"VirtualTool")}cloneWithPrefix(e){return new t(Wq+e+this.name.slice(Wq.length),this.description,this.lastUsedOnTurn,{...this.metadata,possiblePrefix:void 0},this.contents)}find(e){if(this.name===e)return{tool:this,path:[]};for(let r of this.contents)if(r instanceof t){let n=r.find(e);if(n)return n.path.unshift(this),n}else if(r.nameForModel===e)return{tool:r,path:[this]}}getLowestExpandedTool(){let e;for(let r of this.all())r instanceof t&&r.isExpanded&&(!e||r.lastUsedOnTurn${e.description}`,vscpp("br",null))}},H$t=class extends lr{static{a(this,"ExistingGroupInformation")}renderCopilot(){let{group:e}=this.props;return vscpp(vscppf,null,``,vscpp("br",null),`${e.summary}`,vscpp("br",null),e.tools.map(r=>` -`),"",vscpp("br",null))}},Aet=class extends lr{static{a(this,"GeneralSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(zq.SystemMessage,null,"Context: There are many tools available for a user. However, the number of tools can be large, and it is not always practical to present all of them at once. We need to create a summary of them that accurately reflects the capabilities they provide.",vscpp("br",null),vscpp("br",null),"The user present you with the tools available to them, and you must create a summary of the tools that is accurate and comprehensive. The summary should include the capabilities of the tools and when they should be used.",vscpp("br",null)),vscpp(zq.UserMessage,null,this.props.tools.map(e=>vscpp(Bwe,{tool:e})),vscpp("br",null),vscpp("br",null),"Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"object",required:["name","summary"],properties:{summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'},name:{type:"string",description:"A short name for the group. It may only contain the characters a-z, A-Z, 0-9, and underscores.",example:"foo_language_tools"}}},null,2)))}},yet=class extends lr{static{a(this,"CategorizerSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(zq.SystemMessage,null,"Context: There are many tools available for a user. However, the number of tools can be large, and it is not always practical to present all of them at once. We need to create logical groups for the user to pick from at a glance.",vscpp("br",null),vscpp("br",null),"The user present you with the tools available to them, and you must group them into logical categories and provide a summary of each one. The summary should include the capabilities of the tools and when they should be used. Every tool MUST be a part of EXACTLY one category. Category names in your response MUST be unique\u2014do not reuse the same name for different categories. If two categories would share a base name, append a short, descriptive suffix to disambiguate (e.g., python_tools_testing vs python_tools_packaging).",vscpp("br",null)),vscpp(zq.UserMessage,null,this.props.tools.map(e=>vscpp(Bwe,{tool:e})),vscpp("br",null),vscpp("br",null),"You MUST make sure every tool is part of a category. Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"array",items:{type:"object",required:["name","tools","summary"],properties:{name:{type:"string",description:"A short, unique name for the category across this response. It may only contain the characters a-z, A-Z, 0-9, and underscores. If a potential collision exists, add a short suffix to keep names unique (e.g., _testing, _packaging).",example:"foo_language_tools"},tools:{type:"array",description:"The tool names that are part of this category.",items:{type:"string"}},summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'}}}},null,2)))}},Eet=class extends lr{static{a(this,"ExistingGroupCategorizerPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(zq.SystemMessage,null,"Context: There are existing tool categories that have been previously established. New tools have become available and need to be categorized. You must decide whether each new tool fits into an existing category or requires a new category to be created.",vscpp("br",null),vscpp("br",null),"The user will provide you with the existing categories and their current tools, as well as the new tools that need to be categorized. You must assign each new tool to either an existing category (if it fits well) or create new categories as needed. You should also return all existing tools in their current categories unless there's a compelling reason to reorganize them.",vscpp("br",null),vscpp("br",null),"Every tool (both existing and new) MUST be part of EXACTLY one category in your response. Category names MUST be unique within the response. If a new category would conflict with an existing category name, choose a distinct, disambiguating name.",vscpp("br",null)),vscpp(zq.UserMessage,null,"**Existing Categories:**",vscpp("br",null),this.props.existingGroups.map(e=>vscpp(H$t,{group:e})),vscpp("br",null),"**New Tools to Categorize:**",vscpp("br",null),this.props.newTools.map(e=>vscpp(Bwe,{tool:e})),vscpp("br",null),vscpp("br",null),"Instructions:",vscpp("br",null),"1. For each new tool, determine if it fits well into an existing category or if it needs a new category",vscpp("br",null),"2. Keep existing tools in their current categories unless there's a strong reason to move them",vscpp("br",null),"3. Create new categories only when new tools don't fit well into existing ones",vscpp("br",null),"4. Every tool (existing + new) MUST appear in exactly one category",vscpp("br",null),vscpp("br",null),"Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"array",items:{type:"object",required:["name","tools","summary"],properties:{name:{type:"string",description:"A short, unique name for the category across this response. It may only contain the characters a-z, A-Z, 0-9, and underscores. Do not reuse names; add a short suffix if needed to avoid collisions.",example:"foo_language_tools"},tools:{type:"array",description:"The tool names that are part of this category.",items:{type:"string"}},summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'}}}},null,2)))}};p();p();p();var Z$t={};ki(Z$t,{arrayReplaceAt:()=>J$t,asciiTrim:()=>bJ,assign:()=>gde,escapeHtml:()=>pF,escapeRE:()=>Lts,fromCodePoint:()=>Ade,has:()=>Tts,isMdAsciiPunct:()=>vJ,isPunctChar:()=>Jwn,isPunctCharCode:()=>_J,isSpace:()=>Zs,isString:()=>Det,isValidEntityCode:()=>Net,isWhiteSpace:()=>EJ,lib:()=>Bts,normalizeReference:()=>CJ,unescapeAll:()=>fF,unescapeMd:()=>kts});p();var Tet={};ki(Tet,{decode:()=>Fwe,encode:()=>Cet,format:()=>pde,parse:()=>Uwe});p();p();var Pwn={};function tts(t){let e=Pwn[t];if(e)return e;e=Pwn[t]=[];for(let r=0;r<128;r++){let n=String.fromCharCode(r);e.push(n)}for(let r=0;r=55296&&f<=57343?o+="\uFFFD\uFFFD\uFFFD":o+=String.fromCharCode(f),s+=6;continue}}if((l&248)===240&&s+91114111?o+="\uFFFD\uFFFD\uFFFD\uFFFD":(h-=65536,o+=String.fromCharCode(55296+(h>>10),56320+(h&1023))),s+=9;continue}}o+="\uFFFD"}return o})}a(_et,"decode");_et.defaultChars=";/?:@&=+$,#";_et.componentChars="";var Fwe=_et;p();var Dwn={};function rts(t){let e=Dwn[t];if(e)return e;e=Dwn[t]=[];for(let r=0;r<128;r++){let n=String.fromCharCode(r);/^[0-9a-z]$/i.test(n)?e.push(n):e.push("%"+("0"+r.toString(16).toUpperCase()).slice(-2))}for(let r=0;r"u"&&(r=!0);let n=rts(e),o="";for(let s=0,c=t.length;s=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1=56320&&u<=57343){o+=encodeURIComponent(t[s]+t[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(t[s])}return o}a(vet,"encode");vet.defaultChars=";/?:@&=+$,-_.!~*'()#";vet.componentChars="-_.!~*'()";var Cet=vet;p();function pde(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}a(pde,"format");p();function bet(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}a(bet,"Url");var nts=/^([a-z0-9.+-]+:)/i,its=/:[0-9]*$/,ots=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,sts=["<",">",'"',"`"," ","\r",` -`," "],ats=["{","}","|","\\","^","`"].concat(sts),cts=["'"].concat(ats),Nwn=["%","/","?",";","#"].concat(cts),Mwn=["/","?","#"],lts=255,Own=/^[+a-z0-9A-Z_-]{0,63}$/,uts=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Lwn={javascript:!0,"javascript:":!0},Bwn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function dts(t,e){if(t&&t instanceof bet)return t;let r=new bet;return r.parse(t,e),r}a(dts,"urlParse");bet.prototype.parse=function(t,e){let r,n,o,s=t;if(s=s.trim(),!e&&t.split("#").length===1){let d=ots.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let c=nts.exec(s);if(c&&(c=c[0],r=c.toLowerCase(),this.protocol=c,s=s.substr(c.length)),(e||c||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(c&&Lwn[c])&&(s=s.substr(2),this.slashes=!0)),!Lwn[c]&&(o||c&&!Bwn[c])){let d=-1;for(let A=0;A127?v+="x":v+=_[b];if(!v.match(Own)){let b=A.slice(0,y),T=A.slice(y+1),w=_.match(uts);w&&(b.push(w[1]),T.unshift(w[2])),T.length&&(s=T.join(".")+s),this.hostname=b.join(".");break}}}}this.hostname.length>lts&&(this.hostname=""),g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));let u=s.indexOf("?");return u!==-1&&(this.search=s.substr(u),s=s.slice(0,u)),s&&(this.pathname=s),Bwn[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};bet.prototype.parseHost=function(t){let e=its.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var Uwe=dts;var G$t={};ki(G$t,{Any:()=>Iet,Cc:()=>xet,Cf:()=>Fwn,P:()=>hde,S:()=>wet,Z:()=>Ret});p();p();var Iet=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;p();var xet=/[\0-\x1F\x7F-\x9F]/;p();var Fwn=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/;p();var hde=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;p();var wet=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/;p();var Ret=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;p();p();p();var Uwn=new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(t=>t.charCodeAt(0)));p();var Qwn=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(t=>t.charCodeAt(0)));p();var $$t,fts=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),V$t=($$t=String.fromCodePoint)!==null&&$$t!==void 0?$$t:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function W$t(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=fts.get(t))!==null&&e!==void 0?e:t}a(W$t,"replaceCodePoint");var Tg;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Tg||(Tg={}));var pts=32,Yq;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Yq||(Yq={}));function z$t(t){return t>=Tg.ZERO&&t<=Tg.NINE}a(z$t,"isNumber");function hts(t){return t>=Tg.UPPER_A&&t<=Tg.UPPER_F||t>=Tg.LOWER_A&&t<=Tg.LOWER_F}a(hts,"isHexadecimalCharacter");function mts(t){return t>=Tg.UPPER_A&&t<=Tg.UPPER_Z||t>=Tg.LOWER_A&&t<=Tg.LOWER_Z||z$t(t)}a(mts,"isAsciiAlphaNumeric");function gts(t){return t===Tg.EQUALS||mts(t)}a(gts,"isEntityInAttributeInvalidEnd");var Sg;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(Sg||(Sg={}));var c2;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(c2||(c2={}));var ket=class{static{a(this,"EntityDecoder")}constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=Sg.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=c2.Strict}startEntity(e){this.decodeMode=e,this.state=Sg.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case Sg.EntityStart:return e.charCodeAt(r)===Tg.NUM?(this.state=Sg.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=Sg.NamedEntity,this.stateNamedEntity(e,r));case Sg.NumericStart:return this.stateNumericStart(e,r);case Sg.NumericDecimal:return this.stateNumericDecimal(e,r);case Sg.NumericHex:return this.stateNumericHex(e,r);case Sg.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|pts)===Tg.LOWER_X?(this.state=Sg.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=Sg.NumericDecimal,this.stateNumericDecimal(e,r))}addToNumericResult(e,r,n,o){if(r!==n){let s=n-r;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(r,s),o),this.consumed+=s}}stateNumericHex(e,r){let n=r;for(;r>14;for(;r>14,s!==0){if(c===Tg.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==c2.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:r,decodeTree:n}=this,o=(n[r]&Yq.VALUE_LENGTH)>>14;return this.emitNamedEntityData(r,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,r,n){let{decodeTree:o}=this;return this.emitCodePoint(r===1?o[e]&~Yq.VALUE_LENGTH:o[e+1],n),r===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case Sg.NamedEntity:return this.result!==0&&(this.decodeMode!==c2.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Sg.NumericDecimal:return this.emitNumericEntity(0,2);case Sg.NumericHex:return this.emitNumericEntity(0,3);case Sg.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Sg.EntityStart:return 0}}};function qwn(t){let e="",r=new ket(t,n=>e+=V$t(n));return a(function(o,s){let c=0,l=0;for(;(l=o.indexOf("&",l))>=0;){e+=o.slice(c,l),r.startEntity(s);let d=r.write(o,l+1);if(d<0){c=l+r.end();break}c=l+d,l=d===0?c+1:c}let u=e+o.slice(c);return e="",u},"decodeWithTrie")}a(qwn,"getDecoder");function Ats(t,e,r,n){let o=(e&Yq.BRANCH_LENGTH)>>7,s=e&Yq.JUMP_TABLE;if(o===0)return s!==0&&n===s?r:-1;if(s){let u=n-s;return u<0||u>=o?-1:t[r+u]-1}let c=r,l=c+o-1;for(;c<=l;){let u=c+l>>>1,d=t[u];if(dn)l=u-1;else return t[u+o]}return-1}a(Ats,"determineBranch");var jwn=qwn(Uwn),vMd=qwn(Qwn);function mde(t,e=c2.Legacy){return jwn(t,e)}a(mde,"decodeHTML");function Qwe(t){return jwn(t,c2.Strict)}a(Qwe,"decodeHTMLStrict");p();p();function Pet(t){for(let e=1;et.codePointAt(e):(t,e)=>(t.charCodeAt(e)&64512)===55296?(t.charCodeAt(e)-55296)*1024+t.charCodeAt(e+1)-56320+65536:t.charCodeAt(e);function Y$t(t,e){return a(function(n){let o,s=0,c="";for(;o=t.exec(n);)s!==o.index&&(c+=n.substring(s,o.index)),c+=e.get(o[0].charCodeAt(0)),s=o.index+1;return c+n.substring(s)},"escape")}a(Y$t,"getEscaper");var Hwn=Y$t(/[&<>'"]/g,Ets),Gwn=Y$t(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),$wn=Y$t(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var Vwn;(function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"})(Vwn||(Vwn={}));var Wwn;(function(t){t[t.UTF8=0]="UTF8",t[t.ASCII=1]="ASCII",t[t.Extensive=2]="Extensive",t[t.Attribute=3]="Attribute",t[t.Text=4]="Text"})(Wwn||(Wwn={}));function bts(t){return Object.prototype.toString.call(t)}a(bts,"_class");function Det(t){return bts(t)==="[object String]"}a(Det,"isString");var Sts=Object.prototype.hasOwnProperty;function Tts(t,e){return Sts.call(t,e)}a(Tts,"has");function gde(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){if(r){if(typeof r!="object")throw new TypeError(r+"must be object");Object.keys(r).forEach(function(n){t[n]=r[n]})}}),t}a(gde,"assign");function J$t(t,e,r){return[].concat(t.slice(0,e),r,t.slice(e+1))}a(J$t,"arrayReplaceAt");function Net(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}a(Net,"isValidEntityCode");function Ade(t){if(t>65535){t-=65536;let e=55296+(t>>10),r=56320+(t&1023);return String.fromCharCode(e,r)}return String.fromCharCode(t)}a(Ade,"fromCodePoint");var Kwn=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Its=/&([a-z#][a-z0-9]{1,31});/gi,xts=new RegExp(Kwn.source+"|"+Its.source,"gi"),wts=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Rts(t,e){if(e.charCodeAt(0)===35&&wts.test(e)){let n=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return Net(n)?Ade(n):t}let r=mde(t);return r!==t?r:t}a(Rts,"replaceEntityPattern");function kts(t){return t.indexOf("\\")<0?t:t.replace(Kwn,"$1")}a(kts,"unescapeMd");function fF(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(xts,function(e,r,n){return r||Rts(e,n)})}a(fF,"unescapeAll");var Pts=/[&<>"]/,Dts=/[&<>"]/g,Nts={"&":"&","<":"<",">":">",'"':"""};function Mts(t){return Nts[t]}a(Mts,"replaceUnsafeChar");function pF(t){return Pts.test(t)?t.replace(Dts,Mts):t}a(pF,"escapeHtml");var Ots=/[.?*+^$[\]\\(){}|-]/g;function Lts(t){return t.replace(Ots,"\\$&")}a(Lts,"escapeRE");function Zs(t){switch(t){case 9:case 32:return!0}return!1}a(Zs,"isSpace");function EJ(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}a(EJ,"isWhiteSpace");function Jwn(t){return hde.test(t)||wet.test(t)}a(Jwn,"isPunctChar");function _J(t){return Jwn(Ade(t))}a(_J,"isPunctCharCode");function vJ(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}a(vJ,"isMdAsciiPunct");function CJ(t){return t=t.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(t=t.replace(/ẞ/g,"\xDF")),t.toLowerCase().toUpperCase()}a(CJ,"normalizeReference");function Ywn(t){return t===32||t===9||t===10||t===13}a(Ywn,"isAsciiTrimmable");function bJ(t){let e=0;for(;e=e&&Ywn(t.charCodeAt(r));r--);return t.slice(e,r+1)}a(bJ,"asciiTrim");var Bts={mdurl:Tet,ucmicro:G$t};var rVt={};ki(rVt,{parseLinkDestination:()=>eVt,parseLinkLabel:()=>X$t,parseLinkTitle:()=>tVt});p();p();function X$t(t,e,r){let n,o,s,c,l=t.posMax,u=t.pos;for(t.pos=e+1,n=1;t.pos32))return s;if(n===41){if(c===0)break;c--}o++}return e===o||c!==0||(s.str=fF(t.slice(e,o)),s.pos=o,s.ok=!0),s}a(eVt,"parseLinkDestination");p();function tVt(t,e,r,n){let o,s=e,c={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(n)c.str=n.str,c.marker=n.marker;else{if(s>=r)return c;let l=t.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return c;e++,s++,l===40&&(l=41),c.marker=l}for(;s"+pF(s.content)+""};KO.code_block=function(t,e,r,n,o){let s=t[e];return""+pF(t[e].content)+` -`};KO.fence=function(t,e,r,n,o){let s=t[e],c=s.info?fF(s.info).trim():"",l="",u="";if(c){let f=c.split(/(\s+)/g);l=f[0],u=f.slice(2).join("")}let d;if(r.highlight?d=r.highlight(s.content,l,u)||pF(s.content):d=pF(s.content),d.indexOf("n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n"u"}a(ons,"isUndefined");function MVt(t){return Buffer.from(t,"base64").toString("utf-8")}a(MVt,"decodeBase64");function akn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(akn,"isObject");p();var sj="activate_",iv=class t{constructor(e,r,n,o,s=[]){this.name=e;this.description=r;this.lastUsedOnTurn=n;this.metadata=o;this.contents=s;this.isExpanded=!1;if(!e.startsWith(sj))throw new Error(`Virtual tool name must start with '${sj}'`);this.name=e,this.description=r,this.lastUsedOnTurn=n,this.metadata=o,this.contents=s}static{a(this,"VirtualTool")}cloneWithPrefix(e){return new t(sj+e+this.name.slice(sj.length),this.description,this.lastUsedOnTurn,{...this.metadata,possiblePrefix:void 0},this.contents)}find(e){if(this.name===e)return{tool:this,path:[]};for(let r of this.contents)if(r instanceof t){let n=r.find(e);if(n)return n.path.unshift(this),n}else if(r.nameForModel===e)return{tool:r,path:[this]}}getLowestExpandedTool(){let e;for(let r of this.all())r instanceof t&&r.isExpanded&&(!e||r.lastUsedOnTurn${e.description}`,vscpp("br",null))}},OVt=class extends lr{static{a(this,"ExistingGroupInformation")}renderCopilot(){let{group:e}=this.props;return vscpp(vscppf,null,``,vscpp("br",null),`${e.summary}`,vscpp("br",null),e.tools.map(r=>` +`),"",vscpp("br",null))}},Vet=class extends lr{static{a(this,"GeneralSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(aj.SystemMessage,null,"Context: There are many tools available for a user. However, the number of tools can be large, and it is not always practical to present all of them at once. We need to create a summary of them that accurately reflects the capabilities they provide.",vscpp("br",null),vscpp("br",null),"The user present you with the tools available to them, and you must create a summary of the tools that is accurate and comprehensive. The summary should include the capabilities of the tools and when they should be used.",vscpp("br",null)),vscpp(aj.UserMessage,null,this.props.tools.map(e=>vscpp(rRe,{tool:e})),vscpp("br",null),vscpp("br",null),"Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"object",required:["name","summary"],properties:{summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'},name:{type:"string",description:"A short name for the group. It may only contain the characters a-z, A-Z, 0-9, and underscores.",example:"foo_language_tools"}}},null,2)))}},Wet=class extends lr{static{a(this,"CategorizerSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(aj.SystemMessage,null,"Context: There are many tools available for a user. However, the number of tools can be large, and it is not always practical to present all of them at once. We need to create logical groups for the user to pick from at a glance.",vscpp("br",null),vscpp("br",null),"The user present you with the tools available to them, and you must group them into logical categories and provide a summary of each one. The summary should include the capabilities of the tools and when they should be used. Every tool MUST be a part of EXACTLY one category. Category names in your response MUST be unique\u2014do not reuse the same name for different categories. If two categories would share a base name, append a short, descriptive suffix to disambiguate (e.g., python_tools_testing vs python_tools_packaging).",vscpp("br",null)),vscpp(aj.UserMessage,null,this.props.tools.map(e=>vscpp(rRe,{tool:e})),vscpp("br",null),vscpp("br",null),"You MUST make sure every tool is part of a category. Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"array",items:{type:"object",required:["name","tools","summary"],properties:{name:{type:"string",description:"A short, unique name for the category across this response. It may only contain the characters a-z, A-Z, 0-9, and underscores. If a potential collision exists, add a short suffix to keep names unique (e.g., _testing, _packaging).",example:"foo_language_tools"},tools:{type:"array",description:"The tool names that are part of this category.",items:{type:"string"}},summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'}}}},null,2)))}},zet=class extends lr{static{a(this,"ExistingGroupCategorizerPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(aj.SystemMessage,null,"Context: There are existing tool categories that have been previously established. New tools have become available and need to be categorized. You must decide whether each new tool fits into an existing category or requires a new category to be created.",vscpp("br",null),vscpp("br",null),"The user will provide you with the existing categories and their current tools, as well as the new tools that need to be categorized. You must assign each new tool to either an existing category (if it fits well) or create new categories as needed. You should also return all existing tools in their current categories unless there's a compelling reason to reorganize them.",vscpp("br",null),vscpp("br",null),"Every tool (both existing and new) MUST be part of EXACTLY one category in your response. Category names MUST be unique within the response. If a new category would conflict with an existing category name, choose a distinct, disambiguating name.",vscpp("br",null)),vscpp(aj.UserMessage,null,"**Existing Categories:**",vscpp("br",null),this.props.existingGroups.map(e=>vscpp(OVt,{group:e})),vscpp("br",null),"**New Tools to Categorize:**",vscpp("br",null),this.props.newTools.map(e=>vscpp(rRe,{tool:e})),vscpp("br",null),vscpp("br",null),"Instructions:",vscpp("br",null),"1. For each new tool, determine if it fits well into an existing category or if it needs a new category",vscpp("br",null),"2. Keep existing tools in their current categories unless there's a strong reason to move them",vscpp("br",null),"3. Create new categories only when new tools don't fit well into existing ones",vscpp("br",null),"4. Every tool (existing + new) MUST appear in exactly one category",vscpp("br",null),vscpp("br",null),"Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"array",items:{type:"object",required:["name","tools","summary"],properties:{name:{type:"string",description:"A short, unique name for the category across this response. It may only contain the characters a-z, A-Z, 0-9, and underscores. Do not reuse names; add a short suffix if needed to avoid collisions.",example:"foo_language_tools"},tools:{type:"array",description:"The tool names that are part of this category.",items:{type:"string"}},summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'}}}},null,2)))}};p();p();p();var GVt={};Ri(GVt,{arrayReplaceAt:()=>HVt,asciiTrim:()=>NJ,assign:()=>xde,escapeHtml:()=>vF,escapeRE:()=>qns,fromCodePoint:()=>wde,has:()=>kns,isMdAsciiPunct:()=>PJ,isPunctChar:()=>wkn,isPunctCharCode:()=>kJ,isSpace:()=>Zs,isString:()=>stt,isValidEntityCode:()=>att,isWhiteSpace:()=>RJ,lib:()=>jns,normalizeReference:()=>DJ,unescapeAll:()=>_F,unescapeMd:()=>Ons});p();var Xet={};Ri(Xet,{decode:()=>nRe,encode:()=>Jet,format:()=>Sde,parse:()=>iRe});p();p();var ckn={};function sns(t){let e=ckn[t];if(e)return e;e=ckn[t]=[];for(let r=0;r<128;r++){let n=String.fromCharCode(r);e.push(n)}for(let r=0;r=55296&&f<=57343?o+="\uFFFD\uFFFD\uFFFD":o+=String.fromCharCode(f),s+=6;continue}}if((l&248)===240&&s+91114111?o+="\uFFFD\uFFFD\uFFFD\uFFFD":(h-=65536,o+=String.fromCharCode(55296+(h>>10),56320+(h&1023))),s+=9;continue}}o+="\uFFFD"}return o})}a(Yet,"decode");Yet.defaultChars=";/?:@&=+$,#";Yet.componentChars="";var nRe=Yet;p();var lkn={};function ans(t){let e=lkn[t];if(e)return e;e=lkn[t]=[];for(let r=0;r<128;r++){let n=String.fromCharCode(r);/^[0-9a-z]$/i.test(n)?e.push(n):e.push("%"+("0"+r.toString(16).toUpperCase()).slice(-2))}for(let r=0;r"u"&&(r=!0);let n=ans(e),o="";for(let s=0,c=t.length;s=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1=56320&&u<=57343){o+=encodeURIComponent(t[s]+t[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(t[s])}return o}a(Ket,"encode");Ket.defaultChars=";/?:@&=+$,-_.!~*'()#";Ket.componentChars="-_.!~*'()";var Jet=Ket;p();function Sde(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}a(Sde,"format");p();function Zet(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}a(Zet,"Url");var cns=/^([a-z0-9.+-]+:)/i,lns=/:[0-9]*$/,uns=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,dns=["<",">",'"',"`"," ","\r",` +`," "],fns=["{","}","|","\\","^","`"].concat(dns),pns=["'"].concat(fns),ukn=["%","/","?",";","#"].concat(pns),dkn=["/","?","#"],hns=255,fkn=/^[+a-z0-9A-Z_-]{0,63}$/,mns=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,pkn={javascript:!0,"javascript:":!0},hkn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function gns(t,e){if(t&&t instanceof Zet)return t;let r=new Zet;return r.parse(t,e),r}a(gns,"urlParse");Zet.prototype.parse=function(t,e){let r,n,o,s=t;if(s=s.trim(),!e&&t.split("#").length===1){let d=uns.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let c=cns.exec(s);if(c&&(c=c[0],r=c.toLowerCase(),this.protocol=c,s=s.substr(c.length)),(e||c||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(c&&pkn[c])&&(s=s.substr(2),this.slashes=!0)),!pkn[c]&&(o||c&&!hkn[c])){let d=-1;for(let A=0;A127?v+="x":v+=_[b];if(!v.match(fkn)){let b=A.slice(0,y),T=A.slice(y+1),w=_.match(mns);w&&(b.push(w[1]),T.unshift(w[2])),T.length&&(s=T.join(".")+s),this.hostname=b.join(".");break}}}}this.hostname.length>hns&&(this.hostname=""),g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));let u=s.indexOf("?");return u!==-1&&(this.search=s.substr(u),s=s.slice(0,u)),s&&(this.pathname=s),hkn[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Zet.prototype.parseHost=function(t){let e=lns.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var iRe=gns;var LVt={};Ri(LVt,{Any:()=>ett,Cc:()=>ttt,Cf:()=>mkn,P:()=>Tde,S:()=>rtt,Z:()=>ntt});p();p();var ett=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;p();var ttt=/[\0-\x1F\x7F-\x9F]/;p();var mkn=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/;p();var Tde=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;p();var rtt=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/;p();var ntt=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;p();p();p();var gkn=new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(t=>t.charCodeAt(0)));p();var Akn=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(t=>t.charCodeAt(0)));p();var BVt,Ans=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),FVt=(BVt=String.fromCodePoint)!==null&&BVt!==void 0?BVt:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function UVt(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=Ans.get(t))!==null&&e!==void 0?e:t}a(UVt,"replaceCodePoint");var Rg;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Rg||(Rg={}));var yns=32,cj;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(cj||(cj={}));function QVt(t){return t>=Rg.ZERO&&t<=Rg.NINE}a(QVt,"isNumber");function Ens(t){return t>=Rg.UPPER_A&&t<=Rg.UPPER_F||t>=Rg.LOWER_A&&t<=Rg.LOWER_F}a(Ens,"isHexadecimalCharacter");function _ns(t){return t>=Rg.UPPER_A&&t<=Rg.UPPER_Z||t>=Rg.LOWER_A&&t<=Rg.LOWER_Z||QVt(t)}a(_ns,"isAsciiAlphaNumeric");function vns(t){return t===Rg.EQUALS||_ns(t)}a(vns,"isEntityInAttributeInvalidEnd");var wg;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(wg||(wg={}));var g2;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(g2||(g2={}));var itt=class{static{a(this,"EntityDecoder")}constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=wg.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=g2.Strict}startEntity(e){this.decodeMode=e,this.state=wg.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case wg.EntityStart:return e.charCodeAt(r)===Rg.NUM?(this.state=wg.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=wg.NamedEntity,this.stateNamedEntity(e,r));case wg.NumericStart:return this.stateNumericStart(e,r);case wg.NumericDecimal:return this.stateNumericDecimal(e,r);case wg.NumericHex:return this.stateNumericHex(e,r);case wg.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|yns)===Rg.LOWER_X?(this.state=wg.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=wg.NumericDecimal,this.stateNumericDecimal(e,r))}addToNumericResult(e,r,n,o){if(r!==n){let s=n-r;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(r,s),o),this.consumed+=s}}stateNumericHex(e,r){let n=r;for(;r>14;for(;r>14,s!==0){if(c===Rg.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==g2.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:r,decodeTree:n}=this,o=(n[r]&cj.VALUE_LENGTH)>>14;return this.emitNamedEntityData(r,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,r,n){let{decodeTree:o}=this;return this.emitCodePoint(r===1?o[e]&~cj.VALUE_LENGTH:o[e+1],n),r===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case wg.NamedEntity:return this.result!==0&&(this.decodeMode!==g2.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case wg.NumericDecimal:return this.emitNumericEntity(0,2);case wg.NumericHex:return this.emitNumericEntity(0,3);case wg.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case wg.EntityStart:return 0}}};function ykn(t){let e="",r=new itt(t,n=>e+=FVt(n));return a(function(o,s){let c=0,l=0;for(;(l=o.indexOf("&",l))>=0;){e+=o.slice(c,l),r.startEntity(s);let d=r.write(o,l+1);if(d<0){c=l+r.end();break}c=l+d,l=d===0?c+1:c}let u=e+o.slice(c);return e="",u},"decodeWithTrie")}a(ykn,"getDecoder");function Cns(t,e,r,n){let o=(e&cj.BRANCH_LENGTH)>>7,s=e&cj.JUMP_TABLE;if(o===0)return s!==0&&n===s?r:-1;if(s){let u=n-s;return u<0||u>=o?-1:t[r+u]-1}let c=r,l=c+o-1;for(;c<=l;){let u=c+l>>>1,d=t[u];if(dn)l=u-1;else return t[u+o]}return-1}a(Cns,"determineBranch");var Ekn=ykn(gkn),C4d=ykn(Akn);function Ide(t,e=g2.Legacy){return Ekn(t,e)}a(Ide,"decodeHTML");function oRe(t){return Ekn(t,g2.Strict)}a(oRe,"decodeHTMLStrict");p();p();function ott(t){for(let e=1;et.codePointAt(e):(t,e)=>(t.charCodeAt(e)&64512)===55296?(t.charCodeAt(e)-55296)*1024+t.charCodeAt(e+1)-56320+65536:t.charCodeAt(e);function qVt(t,e){return a(function(n){let o,s=0,c="";for(;o=t.exec(n);)s!==o.index&&(c+=n.substring(s,o.index)),c+=e.get(o[0].charCodeAt(0)),s=o.index+1;return c+n.substring(s)},"escape")}a(qVt,"getEscaper");var _kn=qVt(/[&<>'"]/g,Sns),vkn=qVt(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),Ckn=qVt(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var bkn;(function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"})(bkn||(bkn={}));var Skn;(function(t){t[t.UTF8=0]="UTF8",t[t.ASCII=1]="ASCII",t[t.Extensive=2]="Extensive",t[t.Attribute=3]="Attribute",t[t.Text=4]="Text"})(Skn||(Skn={}));function wns(t){return Object.prototype.toString.call(t)}a(wns,"_class");function stt(t){return wns(t)==="[object String]"}a(stt,"isString");var Rns=Object.prototype.hasOwnProperty;function kns(t,e){return Rns.call(t,e)}a(kns,"has");function xde(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){if(r){if(typeof r!="object")throw new TypeError(r+"must be object");Object.keys(r).forEach(function(n){t[n]=r[n]})}}),t}a(xde,"assign");function HVt(t,e,r){return[].concat(t.slice(0,e),r,t.slice(e+1))}a(HVt,"arrayReplaceAt");function att(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}a(att,"isValidEntityCode");function wde(t){if(t>65535){t-=65536;let e=55296+(t>>10),r=56320+(t&1023);return String.fromCharCode(e,r)}return String.fromCharCode(t)}a(wde,"fromCodePoint");var xkn=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Pns=/&([a-z#][a-z0-9]{1,31});/gi,Dns=new RegExp(xkn.source+"|"+Pns.source,"gi"),Nns=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Mns(t,e){if(e.charCodeAt(0)===35&&Nns.test(e)){let n=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return att(n)?wde(n):t}let r=Ide(t);return r!==t?r:t}a(Mns,"replaceEntityPattern");function Ons(t){return t.indexOf("\\")<0?t:t.replace(xkn,"$1")}a(Ons,"unescapeMd");function _F(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(Dns,function(e,r,n){return r||Mns(e,n)})}a(_F,"unescapeAll");var Lns=/[&<>"]/,Bns=/[&<>"]/g,Fns={"&":"&","<":"<",">":">",'"':"""};function Uns(t){return Fns[t]}a(Uns,"replaceUnsafeChar");function vF(t){return Lns.test(t)?t.replace(Bns,Uns):t}a(vF,"escapeHtml");var Qns=/[.?*+^$[\]\\(){}|-]/g;function qns(t){return t.replace(Qns,"\\$&")}a(qns,"escapeRE");function Zs(t){switch(t){case 9:case 32:return!0}return!1}a(Zs,"isSpace");function RJ(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}a(RJ,"isWhiteSpace");function wkn(t){return Tde.test(t)||rtt.test(t)}a(wkn,"isPunctChar");function kJ(t){return wkn(wde(t))}a(kJ,"isPunctCharCode");function PJ(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}a(PJ,"isMdAsciiPunct");function DJ(t){return t=t.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(t=t.replace(/ẞ/g,"\xDF")),t.toLowerCase().toUpperCase()}a(DJ,"normalizeReference");function Ikn(t){return t===32||t===9||t===10||t===13}a(Ikn,"isAsciiTrimmable");function NJ(t){let e=0;for(;e=e&&Ikn(t.charCodeAt(r));r--);return t.slice(e,r+1)}a(NJ,"asciiTrim");var jns={mdurl:Xet,ucmicro:LVt};var zVt={};Ri(zVt,{parseLinkDestination:()=>VVt,parseLinkLabel:()=>$Vt,parseLinkTitle:()=>WVt});p();p();function $Vt(t,e,r){let n,o,s,c,l=t.posMax,u=t.pos;for(t.pos=e+1,n=1;t.pos32))return s;if(n===41){if(c===0)break;c--}o++}return e===o||c!==0||(s.str=_F(t.slice(e,o)),s.pos=o,s.ok=!0),s}a(VVt,"parseLinkDestination");p();function WVt(t,e,r,n){let o,s=e,c={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(n)c.str=n.str,c.marker=n.marker;else{if(s>=r)return c;let l=t.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return c;e++,s++,l===40&&(l=41),c.marker=l}for(;s"+vF(s.content)+""};r5.code_block=function(t,e,r,n,o){let s=t[e];return""+vF(t[e].content)+` +`};r5.fence=function(t,e,r,n,o){let s=t[e],c=s.info?_F(s.info).trim():"",l="",u="";if(c){let f=c.split(/(\s+)/g);l=f[0],u=f.slice(2).join("")}let d;if(r.highlight?d=r.highlight(s.content,l,u)||vF(s.content):d=vF(s.content),d.indexOf("${d} `}return`
${d}
-`};KO.image=function(t,e,r,n,o){let s=t[e];return s.attrs[s.attrIndex("alt")][1]=o.renderInlineAsText(s.children,r,n),o.renderToken(t,e,r)};KO.hardbreak=function(t,e,r){return r.xhtmlOut?`
+`};r5.image=function(t,e,r,n,o){let s=t[e];return s.attrs[s.attrIndex("alt")][1]=o.renderInlineAsText(s.children,r,n),o.renderToken(t,e,r)};r5.hardbreak=function(t,e,r){return r.xhtmlOut?`
`:`
-`};KO.softbreak=function(t,e,r){return r.breaks?r.xhtmlOut?`
+`};r5.softbreak=function(t,e,r){return r.breaks?r.xhtmlOut?`
`:`
`:` -`};KO.text=function(t,e){return pF(t[e].content)};KO.html_block=function(t,e){return t[e].content};KO.html_inline=function(t,e){return t[e].content};function yde(){this.rules=gde({},KO)}a(yde,"Renderer");yde.prototype.renderAttrs=a(function(e){let r,n,o;if(!e.attrs)return"";for(o="",r=0,n=e.attrs.length;r -`:">",s},"renderToken");yde.prototype.renderInline=function(t,e,r){let n="",o=this.rules;for(let s=0,c=t.length;s=0&&(n=this.attrs[r][1]),n},"attrGet");Ede.prototype.attrJoin=a(function(e,r){let n=this.attrIndex(e);n<0?this.attrPush([e,r]):this.attrs[n][1]=this.attrs[n][1]+" "+r},"attrJoin");var hF=Ede;function Xwn(t,e,r){this.src=t,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}a(Xwn,"StateCore");Xwn.prototype.Token=hF;var eRn=Xwn;p();var Fts=/\r\n?|\n/g,Uts=/\0/g;function nVt(t){let e;e=t.src.replace(Fts,` -`),e=e.replace(Uts,"\uFFFD"),t.src=e}a(nVt,"normalize");p();function iVt(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}a(iVt,"block");p();function oVt(t){let e=t.tokens;for(let r=0,n=e.length;r\s]/i.test(t)}a(Qts,"isLinkOpen");function qts(t){return/^<\/a\s*>/i.test(t)}a(qts,"isLinkClose");function sVt(t){let e=t.tokens;if(t.md.options.linkify)for(let r=0,n=e.length;r=0;c--){let l=o[c];if(l.type==="link_close"){for(c--;o[c].level!==l.level&&o[c].type!=="link_open";)c--;continue}if(l.type==="html_inline"&&(Qts(l.content)&&s>0&&s--,qts(l.content)&&s++),!(s>0)&&l.type==="text"&&t.md.linkify.test(l.content)){let u=l.content,d=t.md.linkify.match(u),f=[],h=l.level,m=0;d.length>0&&d[0].index===0&&c>0&&o[c-1].type==="text_special"&&(d=d.slice(1));for(let g=0;gm){let w=new t.Token("text","",0);w.content=u.slice(m,_),w.level=h,f.push(w)}let v=new t.Token("link_open","a",1);v.attrs=[["href",y]],v.level=h++,v.markup="linkify",v.info="auto",f.push(v);let b=new t.Token("text","",0);b.content=E,b.level=h,f.push(b);let T=new t.Token("link_close","a",-1);T.level=--h,T.markup="linkify",T.info="auto",f.push(T),m=d[g].lastIndex}if(m=0;r--){let n=t[r];n.type==="text"&&!e&&(n.content=n.content.replace(Hts,$ts)),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(Vts,"replace_scoped");function Wts(t){let e=0;for(let r=t.length-1;r>=0;r--){let n=t[r];n.type==="text"&&!e&&tRn.test(n.content)&&(n.content=n.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\s)--(?=\s|$)/mg,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1\u2013")),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(Wts,"replace_rare");function aVt(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(jts.test(t.tokens[e].content)&&Vts(t.tokens[e].children),tRn.test(t.tokens[e].content)&&Wts(t.tokens[e].children))}a(aVt,"replace");p();var zts=/['"]/,rRn=/['"]/g,nRn="\u2019";function Met(t,e,r,n){t[e]||(t[e]=[]),t[e].push({pos:r,ch:n})}a(Met,"addReplacement");function Yts(t,e){let r="",n=0;e.sort((o,s)=>o.pos-s.pos);for(let o=0;o=0&&!(n[r].level<=l);r--);if(n.length=r+1,c.type!=="text")continue;let u=c.content,d=0,f=u.length;e:for(;d=0)y=u.charCodeAt(h.index-1);else for(r=s-1;r>=0&&!(t[r].type==="softbreak"||t[r].type==="hardbreak");r--)if(t[r].content){y=t[r].content.charCodeAt(t[r].content.length-1);break}let E=32;if(d=48&&y<=57&&(g=m=!1),m&&g&&(m=_,g=v),!m&&!g){A&&Met(o,s,h.index,nRn);continue}if(g)for(r=n.length-1;r>=0;r--){let w=n[r];if(n[r].level=0;e--)t.tokens[e].type!=="inline"||!zts.test(t.tokens[e].content)||Kts(t.tokens[e].children,t)}a(cVt,"smartquotes");p();function lVt(t){let e,r,n=t.tokens,o=n.length;for(let s=0;s0&&this.level++,this.tokens.push(n),n};JO.prototype.isEmpty=a(function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},"isEmpty");JO.prototype.skipEmptyLines=a(function(e){for(let r=this.lineMax;er;)if(!Zs(this.src.charCodeAt(--e)))return e+1;return e},"skipSpacesBack");JO.prototype.skipChars=a(function(e,r){for(let n=this.src.length;en;)if(r!==this.src.charCodeAt(--e))return e+1;return e},"skipCharsBack");JO.prototype.getLines=a(function(e,r,n,o){if(e>=r)return"";let s=new Array(r-e);for(let c=0,l=e;ln?s[c]=new Array(u-n+1).join(" ")+this.src.slice(f,h):s[c]=this.src.slice(f,h)}return s.join("")},"getLines");JO.prototype.Token=hF;var oRn=JO;p();var Jts=65536;function fVt(t,e){let r=t.bMarks[e]+t.tShift[e],n=t.eMarks[e];return t.src.slice(r,n)}a(fVt,"getLine");function sRn(t){let e=[],r=t.length,n=0,o=t.charCodeAt(n),s=!1,c=0,l="";for(;nr)return!1;let o=e+1;if(t.sCount[o]=4)return!1;let s=t.bMarks[o]+t.tShift[o];if(s>=t.eMarks[o])return!1;let c=t.src.charCodeAt(s++);if(c!==124&&c!==45&&c!==58||s>=t.eMarks[o])return!1;let l=t.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!Zs(l)||c===45&&Zs(l))return!1;for(;s=4)return!1;d=sRn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop();let h=d.length;if(h===0||h!==f.length)return!1;if(n)return!0;let m=t.parentType;t.parentType="table";let g=t.md.block.ruler.getRules("blockquote"),A=t.push("table_open","table",1),y=[e,0];A.map=y;let E=t.push("thead_open","thead",1);E.map=[e,e+1];let _=t.push("tr_open","tr",1);_.map=[e,e+1];for(let T=0;T=4||(d=sRn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),b+=h-d.length,b>Jts))break;if(o===e+2){let R=t.push("tbody_open","tbody",1);R.map=v=[e+2,0]}let w=t.push("tr_open","tr",1);w.map=[o,o+1];for(let R=0;R=4){n++,o=n;continue}break}t.line=o;let s=t.push("code_block","code",0);return s.content=t.getLines(e,o,4+t.blkIndent,!1)+` -`,s.map=[e,t.line],!0}a(hVt,"code");p();function mVt(t,e,r,n){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||o+3>s)return!1;let c=t.src.charCodeAt(o);if(c!==126&&c!==96)return!1;let l=o;o=t.skipChars(o,c);let u=o-l;if(u<3)return!1;let d=t.src.slice(l,o),f=t.src.slice(o,s);if(c===96&&f.indexOf(String.fromCharCode(c))>=0)return!1;if(n)return!0;let h=e,m=!1;for(;h++,!(h>=r||(o=l=t.bMarks[h]+t.tShift[h],s=t.eMarks[h],o=4)&&(o=t.skipChars(o,c),!(o-l=4||t.src.charCodeAt(o)!==62)return!1;if(n)return!0;let l=[],u=[],d=[],f=[],h=t.md.block.ruler.getRules("blockquote"),m=t.parentType;t.parentType="blockquote";let g=!1,A;for(A=e;A=s)break;if(t.src.charCodeAt(o++)===62&&!b){let w=t.sCount[A]+1,R,x;t.src.charCodeAt(o)===32?(o++,w++,x=!1,R=!0):t.src.charCodeAt(o)===9?(R=!0,(t.bsCount[A]+w)%4===3?(o++,w++,x=!1):x=!0):R=!1;let P=w;for(l.push(t.bMarks[A]),t.bMarks[A]=o;o=s,u.push(t.bsCount[A]),t.bsCount[A]=t.sCount[A]+1+(R?1:0),d.push(t.sCount[A]),t.sCount[A]=P-w,f.push(t.tShift[A]),t.tShift[A]=o-t.bMarks[A];continue}if(g)break;let T=!1;for(let w=0,R=h.length;w";let _=[e,0];E.map=_,t.md.block.tokenize(t,e,A);let v=t.push("blockquote_close","blockquote",-1);v.markup=">",t.lineMax=c,t.parentType=m,_[1]=t.line;for(let b=0;b=4)return!1;let s=t.bMarks[e]+t.tShift[e],c=t.src.charCodeAt(s++);if(c!==42&&c!==45&&c!==95)return!1;let l=1;for(;s=n)return-1;let s=t.src.charCodeAt(o++);if(s<48||s>57)return-1;for(;;){if(o>=n)return-1;if(s=t.src.charCodeAt(o++),s>=48&&s<=57){if(o-r>=10)return-1;continue}if(s===41||s===46)break;return-1}return o=4||t.listIndent>=0&&t.sCount[u]-t.listIndent>=4&&t.sCount[u]=t.blkIndent&&(f=!0);let h,m,g;if((g=cRn(t,u))>=0){if(h=!0,c=t.bMarks[u]+t.tShift[u],m=Number(t.src.slice(c,g-1)),f&&m!==1)return!1}else if((g=aRn(t,u))>=0)h=!1;else return!1;if(f&&t.skipSpaces(g)>=t.eMarks[u])return!1;if(n)return!0;let A=t.src.charCodeAt(g-1),y=t.tokens.length;h?(l=t.push("ordered_list_open","ol",1),m!==1&&(l.attrs=[["start",m]])):l=t.push("bullet_list_open","ul",1);let E=[u,0];l.map=E,l.markup=String.fromCharCode(A);let _=!1,v=t.md.block.ruler.getRules("list"),b=t.parentType;for(t.parentType="list";u=o?x=1:x=w-T,x>4&&(x=1);let P=T+x;l=t.push("list_item_open","li",1),l.markup=String.fromCharCode(A);let D=[u,0];l.map=D,h&&(l.info=t.src.slice(c,g-1));let N=t.tight,L=t.tShift[u],B=t.sCount[u],q=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=P,t.tight=!0,t.tShift[u]=R-t.bMarks[u],t.sCount[u]=w,R>=o&&t.isEmpty(u+1)?t.line=Math.min(t.line+2,r):t.md.block.tokenize(t,u,r,!0),(!t.tight||_)&&(d=!1),_=t.line-u>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=q,t.tShift[u]=L,t.sCount[u]=B,t.tight=N,l=t.push("list_item_close","li",-1),l.markup=String.fromCharCode(A),u=t.line,D[1]=u,u>=r||t.sCount[u]=4)break;let M=!1;for(let O=0,j=v.length;O=4||t.src.charCodeAt(o)!==91)return!1;function l(v){let b=t.lineMax;if(v>=b||t.isEmpty(v))return null;let T=!1;if(t.sCount[v]-t.blkIndent>3&&(T=!0),t.sCount[v]<0&&(T=!0),!T){let x=t.md.block.ruler.getRules("reference"),P=t.parentType;t.parentType="reference";let D=!1;for(let N=0,L=x.length;N"u"&&(t.env.references={}),typeof t.env.references[_]>"u"&&(t.env.references[_]={title:E,href:h}),t.line=c),!0):!1}a(EVt,"reference");p();p();var lRn=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"];p();var Xts="[a-zA-Z_:][a-zA-Z0-9:._-]*",ers="[^\"'=<>`\\x00-\\x20]+",trs="'[^']*'",rrs='"[^"]*"',nrs="(?:"+ers+"|"+trs+"|"+rrs+")",irs="(?:\\s+"+Xts+"(?:\\s*=\\s*"+nrs+")?)",uRn="<[A-Za-z][A-Za-z0-9\\-]*"+irs+"*\\s*\\/?>",dRn="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",ors="",srs="<[?][\\s\\S]*?[?]>",ars="]*>",crs="",fRn=new RegExp("^(?:"+uRn+"|"+dRn+"|"+ors+"|"+srs+"|"+ars+"|"+crs+")"),pRn=new RegExp("^(?:"+uRn+"|"+dRn+")");var TJ=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(pRn.source+"\\s*$"),/^$/,!1]];function _Vt(t,e,r,n){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(o)!==60)return!1;let c=t.src.slice(o,s),l=0;for(;l=4)return!1;let c=t.src.charCodeAt(o);if(c!==35||o>=s)return!1;let l=1;for(c=t.src.charCodeAt(++o);c===35&&o6||oo&&Zs(t.src.charCodeAt(u-1))&&(s=u),t.line=e+1;let d=t.push("heading_open","h"+String(l),1);d.markup="########".slice(0,l),d.map=[e,t.line];let f=t.push("inline","",0);f.content=bJ(t.src.slice(o,s)),f.map=[e,t.line],f.children=[];let h=t.push("heading_close","h"+String(l),-1);return h.markup="########".slice(0,l),!0}a(vVt,"heading");p();function CVt(t,e,r){let n=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;let o=t.parentType;t.parentType="paragraph";let s=0,c,l=e+1;for(;l3)continue;if(t.sCount[l]>=t.blkIndent){let g=t.bMarks[l]+t.tShift[l],A=t.eMarks[l];if(g=A))){s=c===61?1:2;break}}if(t.sCount[l]<0)continue;let m=!1;for(let g=0,A=n.length;g3||t.sCount[s]<0)continue;let d=!1;for(let f=0,h=n.length;f=r||t.sCount[c]=s){t.line=r;break}let u=t.line,d=!1;for(let f=0;f=t.line)throw new Error("block rule didn't increment state.line");break}if(!d)throw new Error("none of the block rules matched");t.tight=!l,t.isEmpty(t.line-1)&&(l=!0),c=t.line,c0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(o),n};qwe.prototype.scanDelims=function(t,e){let r=this.posMax,n=this.src.charCodeAt(t),o;if(t===0)o=32;else if(t===1)o=this.src.charCodeAt(0),(o&63488)===55296&&(o=65533);else if(o=this.src.charCodeAt(t-1),(o&64512)===56320){let E=this.src.charCodeAt(t-2);o=(E&64512)===55296?65536+(E-55296<<10)+(o-56320):65533}else(o&64512)===55296&&(o=65533);let s=t;for(;s0)return!1;let r=t.pos,n=t.posMax;if(r+3>n||t.src.charCodeAt(r)!==58||t.src.charCodeAt(r+1)!==47||t.src.charCodeAt(r+2)!==47)return!1;let o=t.pending.match(urs);if(!o)return!1;let s=o[1],c=t.md.linkify.matchAtStart(t.src.slice(r-s.length));if(!c)return!1;let l=c.url;if(l.length<=s.length)return!1;let u=l.length;for(;u>0&&l.charCodeAt(u-1)===42;)u--;u!==l.length&&(l=l.slice(0,u));let d=t.md.normalizeLink(l);if(!t.md.validateLink(d))return!1;if(!e){t.pending=t.pending.slice(0,-s.length);let f=t.push("link_open","a",1);f.attrs=[["href",d]],f.markup="linkify",f.info="auto";let h=t.push("text","",0);h.content=t.md.normalizeLinkText(l);let m=t.push("link_close","a",-1);m.markup="linkify",m.info="auto"}return t.pos+=l.length-s.length,!0}a(TVt,"linkify");p();function IVt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==10)return!1;let n=t.pending.length-1,o=t.posMax;if(!e)if(n>=0&&t.pending.charCodeAt(n)===32)if(n>=1&&t.pending.charCodeAt(n-1)===32){let s=n-1;for(;s>=1&&t.pending.charCodeAt(s-1)===32;)s--;t.pending=t.pending.slice(0,s),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(r++;r?@[]^_`{|}~-".split("").forEach(function(t){xVt[t.charCodeAt(0)]=1});function wVt(t,e){let r=t.pos,n=t.posMax;if(t.src.charCodeAt(r)!==92||(r++,r>=n))return!1;let o=t.src.charCodeAt(r);if(o===10){for(e||t.push("hardbreak","br",0),r++;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(s+=t.src[r+1],r++)}let c="\\"+s;if(!e){let l=t.push("text_special","",0);o<256&&xVt[o]!==0?l.content=s:l.content=c,l.markup=c,l.info="escape"}return t.pos=r+1,!0}a(wVt,"escape");p();function RVt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==96)return!1;let o=r;r++;let s=t.posMax;for(;r=0;n--){let o=e[n];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;let s=e[o.end],c=n>0&&e[n-1].end===o.end+1&&e[n-1].marker===o.marker&&e[n-1].token===o.token-1&&e[o.end+1].token===s.token+1,l=String.fromCharCode(o.marker),u=t.tokens[o.token];u.type=c?"strong_open":"em_open",u.tag=c?"strong":"em",u.nesting=1,u.markup=c?l+l:l,u.content="";let d=t.tokens[s.token];d.type=c?"strong_close":"em_close",d.tag=c?"strong":"em",d.nesting=-1,d.markup=c?l+l:l,d.content="",c&&(t.tokens[e[n-1].token].content="",t.tokens[e[o.end+1].token].content="",n--)}}a(ARn,"postProcess");function hrs(t){let e=t.tokens_meta,r=t.tokens_meta.length;ARn(t,t.delimiters);for(let n=0;n=h)return!1;if(u=A,o=t.md.helpers.parseLinkDestination(t.src,A,t.posMax),o.ok){for(c=t.md.normalizeLink(o.str),t.md.validateLink(c)?A=o.pos:c="",u=A;A=h||t.src.charCodeAt(A)!==41)&&(d=!0),A++}if(d){if(typeof t.env.references>"u")return!1;if(A=0?n=t.src.slice(u,A++):A=g+1):A=g+1,n||(n=t.src.slice(m,g)),s=t.env.references[CJ(n)],!s)return t.pos=f,!1;c=s.href,l=s.title}if(!e){t.pos=m,t.posMax=g;let y=t.push("link_open","a",1),E=[["href",c]];y.attrs=E,l&&E.push(["title",l]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=A,t.posMax=h,!0}a(DVt,"link");p();function NVt(t,e){let r,n,o,s,c,l,u,d,f="",h=t.pos,m=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;let g=t.pos+2,A=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(A<0)return!1;if(s=A+1,s=m)return!1;for(d=s,l=t.md.helpers.parseLinkDestination(t.src,s,t.posMax),l.ok&&(f=t.md.normalizeLink(l.str),t.md.validateLink(f)?s=l.pos:f=""),d=s;s=m||t.src.charCodeAt(s)!==41)return t.pos=h,!1;s++}else{if(typeof t.env.references>"u")return!1;if(s=0?o=t.src.slice(d,s++):s=A+1):s=A+1,o||(o=t.src.slice(g,A)),c=t.env.references[CJ(o)],!c)return t.pos=h,!1;f=c.href,u=c.title}if(!e){n=t.src.slice(g,A);let y=[];t.md.inline.parse(n,t.md,t.env,y);let E=t.push("image","img",0),_=[["src",f],["alt",""]];E.attrs=_,E.children=y,E.content=n,u&&_.push(["title",u])}return t.pos=s,t.posMax=m,!0}a(NVt,"image");p();var mrs=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,grs=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function MVt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==60)return!1;let n=t.pos,o=t.posMax;for(;;){if(++r>=o)return!1;let c=t.src.charCodeAt(r);if(c===60)return!1;if(c===62)break}let s=t.src.slice(n+1,r);if(grs.test(s)){let c=t.md.normalizeLink(s);if(!t.md.validateLink(c))return!1;if(!e){let l=t.push("link_open","a",1);l.attrs=[["href",c]],l.markup="autolink",l.info="auto";let u=t.push("text","",0);u.content=t.md.normalizeLinkText(s);let d=t.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return t.pos+=s.length+2,!0}if(mrs.test(s)){let c=t.md.normalizeLink("mailto:"+s);if(!t.md.validateLink(c))return!1;if(!e){let l=t.push("link_open","a",1);l.attrs=[["href",c]],l.markup="autolink",l.info="auto";let u=t.push("text","",0);u.content=t.md.normalizeLinkText(s);let d=t.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return t.pos+=s.length+2,!0}return!1}a(MVt,"autolink");p();function Ars(t){return/^\s]/i.test(t)}a(Ars,"isLinkOpen");function yrs(t){return/^<\/a\s*>/i.test(t)}a(yrs,"isLinkClose");function Ers(t){let e=t|32;return e>=97&&e<=122}a(Ers,"isLetter");function OVt(t,e){if(!t.md.options.html)return!1;let r=t.posMax,n=t.pos;if(t.src.charCodeAt(n)!==60||n+2>=r)return!1;let o=t.src.charCodeAt(n+1);if(o!==33&&o!==63&&o!==47&&!Ers(o))return!1;let s=t.src.slice(n).match(fRn);if(!s)return!1;if(!e){let c=t.push("html_inline","",0);c.content=s[0],Ars(c.content)&&t.linkLevel++,yrs(c.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}a(OVt,"html_inline");p();var _rs=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,vrs=/^&([a-z][a-z0-9]{1,31});/i;function LVt(t,e){let r=t.pos,n=t.posMax;if(t.src.charCodeAt(r)!==38||r+1>=n)return!1;if(t.src.charCodeAt(r+1)===35){let s=t.src.slice(r).match(_rs);if(s){if(!e){let c=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),l=t.push("text_special","",0);l.content=Net(c)?Ade(c):Ade(65533),l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}else{let s=t.src.slice(r).match(vrs);if(s){let c=Qwe(s[0]);if(c!==s[0]){if(!e){let l=t.push("text_special","",0);l.content=c,l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}}return!1}a(LVt,"entity");p();function yRn(t){let e={},r=t.length;if(!r)return;let n=0,o=-2,s=[];for(let c=0;cu;d-=s[d]+1){let h=t[d];if(h.marker===l.marker&&h.open&&h.end<0){let m=!1;if((h.close||l.open)&&(h.length+l.length)%3===0&&(h.length%3!==0||l.length%3!==0)&&(m=!0),!m){let g=d>0&&!t[d-1].open?s[d-1]+1:0;s[c]=c-d+g,s[d]=g,l.open=!1,h.end=c,h.close=!1,f=-1,o=-2;break}}}f!==-1&&(e[l.marker][(l.open?3:0)+(l.length||0)%3]=f)}}a(yRn,"processDelimiters");function BVt(t){let e=t.tokens_meta,r=t.tokens_meta.length;yRn(t.delimiters);for(let n=0;n0&&n++,o[e].type==="text"&&e+1=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;c||t.pos++,s[e]=t.pos};jwe.prototype.tokenize=function(t){let e=this.ruler.getRules(""),r=e.length,n=t.posMax,o=t.md.options.maxNesting;for(;t.pos=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(c){if(t.pos>=n)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};jwe.prototype.parse=function(t,e,r,n){let o=new this.State(t,e,r,n);this.tokenize(o);let s=this.ruler2.getRules(""),c=s.length;for(let l=0;l|$))",e.tpl_email_fuzzy="(^|"+r+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+e.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+e.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}a(qVt,"default");function jVt(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){r&&Object.keys(r).forEach(function(n){t[n]=r[n]})}),t}a(jVt,"assign");function Fet(t){return Object.prototype.toString.call(t)}a(Fet,"_class");function Crs(t){return Fet(t)==="[object String]"}a(Crs,"isString");function brs(t){return Fet(t)==="[object Object]"}a(brs,"isObject");function Srs(t){return Fet(t)==="[object RegExp]"}a(Srs,"isRegExp");function _Rn(t){return Fet(t)==="[object Function]"}a(_Rn,"isFunction");function Trs(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}a(Trs,"escapeRE");var CRn={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Irs(t){return Object.keys(t||{}).reduce(function(e,r){return e||CRn.hasOwnProperty(r)},!1)}a(Irs,"isOptionsObj");var xrs={"http:":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.http||(r.re.http=new RegExp("^\\/\\/"+r.re.src_auth+r.re.src_host_port_strict+r.re.src_path,"i")),r.re.http.test(n)?n.match(r.re.http)[0].length:0},"validate")},"https:":"http:","ftp:":"http:","//":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.no_http||(r.re.no_http=new RegExp("^"+r.re.src_auth+"(?:localhost|(?:(?:"+r.re.src_domain+")\\.)+"+r.re.src_domain_root+")"+r.re.src_port+r.re.src_host_terminator+r.re.src_path,"i")),r.re.no_http.test(n)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:n.match(r.re.no_http)[0].length:0},"validate")},"mailto:":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.mailto||(r.re.mailto=new RegExp("^"+r.re.src_email_name+"@"+r.re.src_host_strict,"i")),r.re.mailto.test(n)?n.match(r.re.mailto)[0].length:0},"validate")}},wrs="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",Rrs="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function krs(t){return function(e,r){let n=e.slice(r);return t.test(n)?n.match(t)[0].length:0}}a(krs,"createValidator");function vRn(){return function(t,e){e.normalize(t)}}a(vRn,"createNormalizer");function Bet(t){let e=t.re=qVt(t.__opts__),r=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||r.push(wrs),r.push(e.src_xn),e.src_tlds=r.join("|");function n(l){return l.replace("%TLDS%",e.src_tlds)}a(n,"untpl"),e.email_fuzzy=RegExp(n(e.tpl_email_fuzzy),"i"),e.email_fuzzy_global=RegExp(n(e.tpl_email_fuzzy),"ig"),e.link_fuzzy=RegExp(n(e.tpl_link_fuzzy),"i"),e.link_fuzzy_global=RegExp(n(e.tpl_link_fuzzy),"ig"),e.link_no_ip_fuzzy=RegExp(n(e.tpl_link_no_ip_fuzzy),"i"),e.link_no_ip_fuzzy_global=RegExp(n(e.tpl_link_no_ip_fuzzy),"ig"),e.host_fuzzy_test=RegExp(n(e.tpl_host_fuzzy_test),"i");let o=[];t.__compiled__={};function s(l,u){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+u)}a(s,"schemaError"),Object.keys(t.__schemas__).forEach(function(l){let u=t.__schemas__[l];if(u===null)return;let d={validate:null,link:null};if(t.__compiled__[l]=d,brs(u)){Srs(u.validate)?d.validate=krs(u.validate):_Rn(u.validate)?d.validate=u.validate:s(l,u),_Rn(u.normalize)?d.normalize=u.normalize:u.normalize?s(l,u):d.normalize=vRn();return}if(Crs(u)){o.push(l);return}s(l,u)}),o.forEach(function(l){t.__compiled__[t.__schemas__[l]]&&(t.__compiled__[l].validate=t.__compiled__[t.__schemas__[l]].validate,t.__compiled__[l].normalize=t.__compiled__[t.__schemas__[l]].normalize)}),t.__compiled__[""]={validate:null,normalize:vRn()};let c=Object.keys(t.__compiled__).filter(function(l){return l.length>0&&t.__compiled__[l]}).map(Trs).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><\uFF5C]|"+e.src_ZPCc+"))("+c+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><\uFF5C]|"+e.src_ZPCc+"))("+c+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i")}a(Bet,"compile");function bRn(t,e,r,n){let o=t.slice(r,n);this.schema=e.toLowerCase(),this.index=r,this.lastIndex=n,this.raw=o,this.text=o,this.url=o}a(bRn,"Match");function rT(t,e){if(!(this instanceof rT))return new rT(t,e);e||Irs(t)&&(e=t,t={}),this.__opts__=jVt({},CRn,e),this.__schemas__=jVt({},xrs,t),this.__compiled__={},this.__tlds__=Rrs,this.__tlds_replaced__=!1,this.re={},Bet(this)}a(rT,"LinkifyIt");rT.prototype.add=a(function(e,r){return this.__schemas__[e]=r,Bet(this),this},"add");rT.prototype.set=a(function(e){return this.__opts__=jVt(this.__opts__,e),this},"set");rT.prototype.test=a(function(e){if(!e.length)return!1;let r,n;if(this.re.schema_test.test(e)){for(n=this.re.schema_search,n.lastIndex=0;(r=n.exec(e))!==null;)if(this.testSchemaAt(e,r[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&e.match(this.re.email_fuzzy)!==null)},"test");rT.prototype.pretest=a(function(e){return this.re.pretest.test(e)},"pretest");rT.prototype.testSchemaAt=a(function(e,r,n){return this.__compiled__[r.toLowerCase()]?this.__compiled__[r.toLowerCase()].validate(e,n,this):0},"testSchemaAt");rT.prototype.match=a(function(e){let r=[],n=[],o=[],s=[],c,l,u;function d(m,g){return m?g?m.index!==g.index?m.index=g.lastIndex?m:g:m:g}if(a(d,"choose"),!e.length)return null;if(this.re.schema_test.test(e))for(u=this.re.schema_search,u.lastIndex=0;(c=u.exec(e))!==null;)l=this.testSchemaAt(e,c[2],u.lastIndex),l&&n.push({schema:c[2],index:c.index+c[1].length,lastIndex:c.index+c[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(u=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,u.lastIndex=0;(c=u.exec(e))!==null;)o.push({schema:"",index:c.index+c[1].length,lastIndex:c.index+c[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(u=this.re.email_fuzzy_global,u.lastIndex=0;(c=u.exec(e))!==null;)s.push({schema:"mailto:",index:c.index+c[1].length,lastIndex:c.index+c[0].length});let f=[0,0,0],h=0;for(;;){let m=[n[f[0]],s[f[1]],o[f[2]]],g=d(d(m[0],m[1]),m[2]);if(!g)break;if(g===m[0]?f[0]++:g===m[1]?f[1]++:f[2]++,g.index= 0x80 (not a basic code point)","invalid-input":"Invalid input"},HVt=35,ZO=Math.floor,GVt=String.fromCharCode;function Kq(t){throw new RangeError(Mrs[t])}a(Kq,"error");function Ors(t,e){let r=[],n=t.length;for(;n--;)r[n]=e(t[n]);return r}a(Ors,"map");function IRn(t,e){let r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(Nrs,".");let o=t.split("."),s=Ors(o,e).join(".");return n+s}a(IRn,"mapDomain");function xRn(t){let e=[],r=0,n=t.length;for(;r=55296&&o<=56319&&rString.fromCodePoint(...t),"ucs2encode"),Brs=a(function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:36},"basicToDigit"),TRn=a(function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},"digitToBasic"),wRn=a(function(t,e,r){let n=0;for(t=r?ZO(t/700):t>>1,t+=ZO(t/e);t>HVt*26>>1;n+=36)t=ZO(t/HVt);return ZO(n+(HVt+1)*t/(t+38))},"adapt"),RRn=a(function(t){let e=[],r=t.length,n=0,o=128,s=72,c=t.lastIndexOf("-");c<0&&(c=0);for(let l=0;l=128&&Kq("not-basic"),e.push(t.charCodeAt(l));for(let l=c>0?c+1:0;l=r&&Kq("invalid-input");let m=Brs(t.charCodeAt(l++));m>=36&&Kq("invalid-input"),m>ZO((2147483647-n)/f)&&Kq("overflow"),n+=m*f;let g=h<=s?1:h>=s+26?26:h-s;if(mZO(2147483647/A)&&Kq("overflow"),f*=A}let d=e.length+1;s=wRn(n-u,d,u==0),ZO(n/d)>2147483647-o&&Kq("overflow"),o+=ZO(n/d),n%=d,e.splice(n++,0,o)}return String.fromCodePoint(...e)},"decode"),kRn=a(function(t){let e=[];t=xRn(t);let r=t.length,n=128,o=0,s=72;for(let u of t)u<128&&e.push(GVt(u));let c=e.length,l=c;for(c&&e.push("-");l=n&&fZO((2147483647-o)/d)&&Kq("overflow"),o+=(u-n)*d,n=u;for(let f of t)if(f2147483647&&Kq("overflow"),f===n){let h=o;for(let m=36;;m+=36){let g=m<=s?1:m>=s+26?26:m-s;if(h=0))try{e.hostname=$Vt.toASCII(e.hostname)}catch{}return Cet(pde(e))}a($rs,"normalizeLink");function Vrs(t){let e=Uwe(t,!0);if(e.hostname&&(!e.protocol||MRn.indexOf(e.protocol)>=0))try{e.hostname=$Vt.toUnicode(e.hostname)}catch{}return Fwe(pde(e),Fwe.defaultChars+"%")}a(Vrs,"normalizeLinkText");function gw(t,e){if(!(this instanceof gw))return new gw(t,e);e||Det(t)||(e=t||{},t="default"),this.inline=new ERn,this.block=new hRn,this.core=new iRn,this.renderer=new Zwn,this.linkify=new SRn,this.validateLink=Grs,this.normalizeLink=$rs,this.normalizeLinkText=Vrs,this.utils=Z$t,this.helpers=gde({},rVt),this.options={},this.configure(t),e&&this.set(e)}a(gw,"MarkdownIt");gw.prototype.set=function(t){return gde(this.options,t),this};gw.prototype.configure=function(t){let e=this;if(Det(t)){let r=t;if(t=qrs[r],!t)throw new Error('Wrong `markdown-it` preset "'+r+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(r){t.components[r].rules&&e[r].ruler.enableOnly(t.components[r].rules),t.components[r].rules2&&e[r].ruler2.enableOnly(t.components[r].rules2)}),this};gw.prototype.enable=function(t,e){let r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){r=r.concat(this[o].ruler.enable(t,!0))},this),r=r.concat(this.inline.ruler2.enable(t,!0));let n=t.filter(function(o){return r.indexOf(o)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this};gw.prototype.disable=function(t,e){let r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){r=r.concat(this[o].ruler.disable(t,!0))},this),r=r.concat(this.inline.ruler2.disable(t,!0));let n=t.filter(function(o){return r.indexOf(o)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this};gw.prototype.use=function(t){let e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};gw.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");let r=new this.core.State(t,this,e);return this.core.process(r),r.tokens};gw.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};gw.prototype.parseInline=function(t,e){let r=new this.core.State(t,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens};gw.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};var VVt=gw;function WVt(t){return Array.isArray(t)}a(WVt,"isArray");function Wrs(t){if(t.type!=="fence")return!1;let{map:e,markup:r,content:n,info:o}=t;return(e===null||WVt(e)&&e.length===2&&e.every(c=>typeof c=="number"))&&typeof r=="string"&&typeof n=="string"&&typeof o=="string"}a(Wrs,"isFenceToken");function*ORn(t){for(let e of t)if(yield e,e&&typeof e=="object"&&"children"in e){let r=e;WVt(r.children)&&(yield*ORn(r.children))}}a(ORn,"flattenTokensLists");function zrs(){return new VVt}a(zrs,"createMarkdownIt");function LRn(t){let e=[],n=zrs().parse(t,{});if(!WVt(n))return e;for(let o of ORn(n)){if(!o||typeof o!="object")continue;let s=o;if(Wrs(s)&&s.map){let c=s.map;e.push({startMarkup:s.markup,code:s.content.replace(/\n$/,""),language:s.info.trim(),startLine:c[0],endLine:c[1]})}}return e}a(LRn,"extractCodeBlocks");function zVt(t){let e=["script","style","iframe","object","embed","form","base","meta","link"],r=/(```[\s\S]*?```|`[^`\n]+?`)/g;return t.split(r).map((o,s)=>{if(s%2===1)return o;let l=new RegExp(`]*)?/?>`,"gi");return o.replace(l,u=>u.replace(//g,">"))}).join("")}a(zVt,"escapeProblematicHtmlTags");var KVt=Rn.Gpt4oMini,BRn=new fe("virtualToolSummarizer"),Hwe=class extends Error{static{a(this,"SummarizerError")}};function FRn(t){return typeof t=="object"&&t!==null&&"name"in t&&"summary"in t&&typeof t.name=="string"&&typeof t.summary=="string"}a(FRn,"isValidCategoryItem");function URn(t,e){if(!Array.isArray(t))throw new Hwe(`Invalid response from ${e}: ${JSON.stringify(t)}`);if(!t.every(FRn))throw new Hwe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(URn,"validateCategoriesWithoutToolsResponse");function Yrs(t){return FRn(t)&&"tools"in t&&Array.isArray(t.tools)&&t.tools.every(e=>typeof e=="string")}a(Yrs,"isValidCategorizationItem");function QRn(t,e){if(URn(t,e),!t.every(Yrs))throw new Hwe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(QRn,"validateCategorizationResponse");function qRn(t,e=new Set){return t.filter(r=>{let n=e.has(r.name);return e.add(r.name),!n})}a(qRn,"deduplicateTools");function Krs(t){let e=new Map;for(let r of t){let n=HRn(r.name),o=e.get(n);o?(r.summary&&r.summary!==o.summary&&(o.summary=`${o.summary} +`:">",s},"renderToken");Rde.prototype.renderInline=function(t,e,r){let n="",o=this.rules;for(let s=0,c=t.length;s=0&&(n=this.attrs[r][1]),n},"attrGet");kde.prototype.attrJoin=a(function(e,r){let n=this.attrIndex(e);n<0?this.attrPush([e,r]):this.attrs[n][1]=this.attrs[n][1]+" "+r},"attrJoin");var CF=kde;function kkn(t,e,r){this.src=t,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}a(kkn,"StateCore");kkn.prototype.Token=CF;var Pkn=kkn;p();var Hns=/\r\n?|\n/g,Gns=/\0/g;function YVt(t){let e;e=t.src.replace(Hns,` +`),e=e.replace(Gns,"\uFFFD"),t.src=e}a(YVt,"normalize");p();function KVt(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}a(KVt,"block");p();function JVt(t){let e=t.tokens;for(let r=0,n=e.length;r\s]/i.test(t)}a($ns,"isLinkOpen");function Vns(t){return/^<\/a\s*>/i.test(t)}a(Vns,"isLinkClose");function ZVt(t){let e=t.tokens;if(t.md.options.linkify)for(let r=0,n=e.length;r=0;c--){let l=o[c];if(l.type==="link_close"){for(c--;o[c].level!==l.level&&o[c].type!=="link_open";)c--;continue}if(l.type==="html_inline"&&($ns(l.content)&&s>0&&s--,Vns(l.content)&&s++),!(s>0)&&l.type==="text"&&t.md.linkify.test(l.content)){let u=l.content,d=t.md.linkify.match(u),f=[],h=l.level,m=0;d.length>0&&d[0].index===0&&c>0&&o[c-1].type==="text_special"&&(d=d.slice(1));for(let g=0;gm){let w=new t.Token("text","",0);w.content=u.slice(m,_),w.level=h,f.push(w)}let v=new t.Token("link_open","a",1);v.attrs=[["href",y]],v.level=h++,v.markup="linkify",v.info="auto",f.push(v);let b=new t.Token("text","",0);b.content=E,b.level=h,f.push(b);let T=new t.Token("link_close","a",-1);T.level=--h,T.markup="linkify",T.info="auto",f.push(T),m=d[g].lastIndex}if(m=0;r--){let n=t[r];n.type==="text"&&!e&&(n.content=n.content.replace(zns,Kns)),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(Jns,"replace_scoped");function Zns(t){let e=0;for(let r=t.length-1;r>=0;r--){let n=t[r];n.type==="text"&&!e&&Dkn.test(n.content)&&(n.content=n.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\s)--(?=\s|$)/mg,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1\u2013")),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(Zns,"replace_rare");function XVt(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(Wns.test(t.tokens[e].content)&&Jns(t.tokens[e].children),Dkn.test(t.tokens[e].content)&&Zns(t.tokens[e].children))}a(XVt,"replace");p();var Xns=/['"]/,Nkn=/['"]/g,Mkn="\u2019";function ctt(t,e,r,n){t[e]||(t[e]=[]),t[e].push({pos:r,ch:n})}a(ctt,"addReplacement");function eis(t,e){let r="",n=0;e.sort((o,s)=>o.pos-s.pos);for(let o=0;o=0&&!(n[r].level<=l);r--);if(n.length=r+1,c.type!=="text")continue;let u=c.content,d=0,f=u.length;e:for(;d=0)y=u.charCodeAt(h.index-1);else for(r=s-1;r>=0&&!(t[r].type==="softbreak"||t[r].type==="hardbreak");r--)if(t[r].content){y=t[r].content.charCodeAt(t[r].content.length-1);break}let E=32;if(d=48&&y<=57&&(g=m=!1),m&&g&&(m=_,g=v),!m&&!g){A&&ctt(o,s,h.index,Mkn);continue}if(g)for(r=n.length-1;r>=0;r--){let w=n[r];if(n[r].level=0;e--)t.tokens[e].type!=="inline"||!Xns.test(t.tokens[e].content)||tis(t.tokens[e].children,t)}a(eWt,"smartquotes");p();function tWt(t){let e,r,n=t.tokens,o=n.length;for(let s=0;s0&&this.level++,this.tokens.push(n),n};n5.prototype.isEmpty=a(function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},"isEmpty");n5.prototype.skipEmptyLines=a(function(e){for(let r=this.lineMax;er;)if(!Zs(this.src.charCodeAt(--e)))return e+1;return e},"skipSpacesBack");n5.prototype.skipChars=a(function(e,r){for(let n=this.src.length;en;)if(r!==this.src.charCodeAt(--e))return e+1;return e},"skipCharsBack");n5.prototype.getLines=a(function(e,r,n,o){if(e>=r)return"";let s=new Array(r-e);for(let c=0,l=e;ln?s[c]=new Array(u-n+1).join(" ")+this.src.slice(f,h):s[c]=this.src.slice(f,h)}return s.join("")},"getLines");n5.prototype.Token=CF;var Lkn=n5;p();var ris=65536;function iWt(t,e){let r=t.bMarks[e]+t.tShift[e],n=t.eMarks[e];return t.src.slice(r,n)}a(iWt,"getLine");function Bkn(t){let e=[],r=t.length,n=0,o=t.charCodeAt(n),s=!1,c=0,l="";for(;nr)return!1;let o=e+1;if(t.sCount[o]=4)return!1;let s=t.bMarks[o]+t.tShift[o];if(s>=t.eMarks[o])return!1;let c=t.src.charCodeAt(s++);if(c!==124&&c!==45&&c!==58||s>=t.eMarks[o])return!1;let l=t.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!Zs(l)||c===45&&Zs(l))return!1;for(;s=4)return!1;d=Bkn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop();let h=d.length;if(h===0||h!==f.length)return!1;if(n)return!0;let m=t.parentType;t.parentType="table";let g=t.md.block.ruler.getRules("blockquote"),A=t.push("table_open","table",1),y=[e,0];A.map=y;let E=t.push("thead_open","thead",1);E.map=[e,e+1];let _=t.push("tr_open","tr",1);_.map=[e,e+1];for(let T=0;T=4||(d=Bkn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),b+=h-d.length,b>ris))break;if(o===e+2){let R=t.push("tbody_open","tbody",1);R.map=v=[e+2,0]}let w=t.push("tr_open","tr",1);w.map=[o,o+1];for(let R=0;R=4){n++,o=n;continue}break}t.line=o;let s=t.push("code_block","code",0);return s.content=t.getLines(e,o,4+t.blkIndent,!1)+` +`,s.map=[e,t.line],!0}a(sWt,"code");p();function aWt(t,e,r,n){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||o+3>s)return!1;let c=t.src.charCodeAt(o);if(c!==126&&c!==96)return!1;let l=o;o=t.skipChars(o,c);let u=o-l;if(u<3)return!1;let d=t.src.slice(l,o),f=t.src.slice(o,s);if(c===96&&f.indexOf(String.fromCharCode(c))>=0)return!1;if(n)return!0;let h=e,m=!1;for(;h++,!(h>=r||(o=l=t.bMarks[h]+t.tShift[h],s=t.eMarks[h],o=4)&&(o=t.skipChars(o,c),!(o-l=4||t.src.charCodeAt(o)!==62)return!1;if(n)return!0;let l=[],u=[],d=[],f=[],h=t.md.block.ruler.getRules("blockquote"),m=t.parentType;t.parentType="blockquote";let g=!1,A;for(A=e;A=s)break;if(t.src.charCodeAt(o++)===62&&!b){let w=t.sCount[A]+1,R,x;t.src.charCodeAt(o)===32?(o++,w++,x=!1,R=!0):t.src.charCodeAt(o)===9?(R=!0,(t.bsCount[A]+w)%4===3?(o++,w++,x=!1):x=!0):R=!1;let P=w;for(l.push(t.bMarks[A]),t.bMarks[A]=o;o=s,u.push(t.bsCount[A]),t.bsCount[A]=t.sCount[A]+1+(R?1:0),d.push(t.sCount[A]),t.sCount[A]=P-w,f.push(t.tShift[A]),t.tShift[A]=o-t.bMarks[A];continue}if(g)break;let T=!1;for(let w=0,R=h.length;w";let _=[e,0];E.map=_,t.md.block.tokenize(t,e,A);let v=t.push("blockquote_close","blockquote",-1);v.markup=">",t.lineMax=c,t.parentType=m,_[1]=t.line;for(let b=0;b=4)return!1;let s=t.bMarks[e]+t.tShift[e],c=t.src.charCodeAt(s++);if(c!==42&&c!==45&&c!==95)return!1;let l=1;for(;s=n)return-1;let s=t.src.charCodeAt(o++);if(s<48||s>57)return-1;for(;;){if(o>=n)return-1;if(s=t.src.charCodeAt(o++),s>=48&&s<=57){if(o-r>=10)return-1;continue}if(s===41||s===46)break;return-1}return o=4||t.listIndent>=0&&t.sCount[u]-t.listIndent>=4&&t.sCount[u]=t.blkIndent&&(f=!0);let h,m,g;if((g=Ukn(t,u))>=0){if(h=!0,c=t.bMarks[u]+t.tShift[u],m=Number(t.src.slice(c,g-1)),f&&m!==1)return!1}else if((g=Fkn(t,u))>=0)h=!1;else return!1;if(f&&t.skipSpaces(g)>=t.eMarks[u])return!1;if(n)return!0;let A=t.src.charCodeAt(g-1),y=t.tokens.length;h?(l=t.push("ordered_list_open","ol",1),m!==1&&(l.attrs=[["start",m]])):l=t.push("bullet_list_open","ul",1);let E=[u,0];l.map=E,l.markup=String.fromCharCode(A);let _=!1,v=t.md.block.ruler.getRules("list"),b=t.parentType;for(t.parentType="list";u=o?x=1:x=w-T,x>4&&(x=1);let P=T+x;l=t.push("list_item_open","li",1),l.markup=String.fromCharCode(A);let D=[u,0];l.map=D,h&&(l.info=t.src.slice(c,g-1));let N=t.tight,L=t.tShift[u],B=t.sCount[u],j=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=P,t.tight=!0,t.tShift[u]=R-t.bMarks[u],t.sCount[u]=w,R>=o&&t.isEmpty(u+1)?t.line=Math.min(t.line+2,r):t.md.block.tokenize(t,u,r,!0),(!t.tight||_)&&(d=!1),_=t.line-u>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=j,t.tShift[u]=L,t.sCount[u]=B,t.tight=N,l=t.push("list_item_close","li",-1),l.markup=String.fromCharCode(A),u=t.line,D[1]=u,u>=r||t.sCount[u]=4)break;let M=!1;for(let O=0,U=v.length;O=4||t.src.charCodeAt(o)!==91)return!1;function l(v){let b=t.lineMax;if(v>=b||t.isEmpty(v))return null;let T=!1;if(t.sCount[v]-t.blkIndent>3&&(T=!0),t.sCount[v]<0&&(T=!0),!T){let x=t.md.block.ruler.getRules("reference"),P=t.parentType;t.parentType="reference";let D=!1;for(let N=0,L=x.length;N"u"&&(t.env.references={}),typeof t.env.references[_]>"u"&&(t.env.references[_]={title:E,href:h}),t.line=c),!0):!1}a(dWt,"reference");p();p();var Qkn=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"];p();var iis="[a-zA-Z_:][a-zA-Z0-9:._-]*",ois="[^\"'=<>`\\x00-\\x20]+",sis="'[^']*'",ais='"[^"]*"',cis="(?:"+ois+"|"+sis+"|"+ais+")",lis="(?:\\s+"+iis+"(?:\\s*=\\s*"+cis+")?)",qkn="<[A-Za-z][A-Za-z0-9\\-]*"+lis+"*\\s*\\/?>",jkn="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",uis="",dis="<[?][\\s\\S]*?[?]>",fis="]*>",pis="",Hkn=new RegExp("^(?:"+qkn+"|"+jkn+"|"+uis+"|"+dis+"|"+fis+"|"+pis+")"),Gkn=new RegExp("^(?:"+qkn+"|"+jkn+")");var OJ=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(Gkn.source+"\\s*$"),/^$/,!1]];function fWt(t,e,r,n){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(o)!==60)return!1;let c=t.src.slice(o,s),l=0;for(;l=4)return!1;let c=t.src.charCodeAt(o);if(c!==35||o>=s)return!1;let l=1;for(c=t.src.charCodeAt(++o);c===35&&o6||oo&&Zs(t.src.charCodeAt(u-1))&&(s=u),t.line=e+1;let d=t.push("heading_open","h"+String(l),1);d.markup="########".slice(0,l),d.map=[e,t.line];let f=t.push("inline","",0);f.content=NJ(t.src.slice(o,s)),f.map=[e,t.line],f.children=[];let h=t.push("heading_close","h"+String(l),-1);return h.markup="########".slice(0,l),!0}a(pWt,"heading");p();function hWt(t,e,r){let n=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;let o=t.parentType;t.parentType="paragraph";let s=0,c,l=e+1;for(;l3)continue;if(t.sCount[l]>=t.blkIndent){let g=t.bMarks[l]+t.tShift[l],A=t.eMarks[l];if(g=A))){s=c===61?1:2;break}}if(t.sCount[l]<0)continue;let m=!1;for(let g=0,A=n.length;g3||t.sCount[s]<0)continue;let d=!1;for(let f=0,h=n.length;f=r||t.sCount[c]=s){t.line=r;break}let u=t.line,d=!1;for(let f=0;f=t.line)throw new Error("block rule didn't increment state.line");break}if(!d)throw new Error("none of the block rules matched");t.tight=!l,t.isEmpty(t.line-1)&&(l=!0),c=t.line,c0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(o),n};sRe.prototype.scanDelims=function(t,e){let r=this.posMax,n=this.src.charCodeAt(t),o;if(t===0)o=32;else if(t===1)o=this.src.charCodeAt(0),(o&63488)===55296&&(o=65533);else if(o=this.src.charCodeAt(t-1),(o&64512)===56320){let E=this.src.charCodeAt(t-2);o=(E&64512)===55296?65536+(E-55296<<10)+(o-56320):65533}else(o&64512)===55296&&(o=65533);let s=t;for(;s0)return!1;let r=t.pos,n=t.posMax;if(r+3>n||t.src.charCodeAt(r)!==58||t.src.charCodeAt(r+1)!==47||t.src.charCodeAt(r+2)!==47)return!1;let o=t.pending.match(mis);if(!o)return!1;let s=o[1],c=t.md.linkify.matchAtStart(t.src.slice(r-s.length));if(!c)return!1;let l=c.url;if(l.length<=s.length)return!1;let u=l.length;for(;u>0&&l.charCodeAt(u-1)===42;)u--;u!==l.length&&(l=l.slice(0,u));let d=t.md.normalizeLink(l);if(!t.md.validateLink(d))return!1;if(!e){t.pending=t.pending.slice(0,-s.length);let f=t.push("link_open","a",1);f.attrs=[["href",d]],f.markup="linkify",f.info="auto";let h=t.push("text","",0);h.content=t.md.normalizeLinkText(l);let m=t.push("link_close","a",-1);m.markup="linkify",m.info="auto"}return t.pos+=l.length-s.length,!0}a(AWt,"linkify");p();function yWt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==10)return!1;let n=t.pending.length-1,o=t.posMax;if(!e)if(n>=0&&t.pending.charCodeAt(n)===32)if(n>=1&&t.pending.charCodeAt(n-1)===32){let s=n-1;for(;s>=1&&t.pending.charCodeAt(s-1)===32;)s--;t.pending=t.pending.slice(0,s),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(r++;r?@[]^_`{|}~-".split("").forEach(function(t){EWt[t.charCodeAt(0)]=1});function _Wt(t,e){let r=t.pos,n=t.posMax;if(t.src.charCodeAt(r)!==92||(r++,r>=n))return!1;let o=t.src.charCodeAt(r);if(o===10){for(e||t.push("hardbreak","br",0),r++;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(s+=t.src[r+1],r++)}let c="\\"+s;if(!e){let l=t.push("text_special","",0);o<256&&EWt[o]!==0?l.content=s:l.content=c,l.markup=c,l.info="escape"}return t.pos=r+1,!0}a(_Wt,"escape");p();function vWt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==96)return!1;let o=r;r++;let s=t.posMax;for(;r=0;n--){let o=e[n];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;let s=e[o.end],c=n>0&&e[n-1].end===o.end+1&&e[n-1].marker===o.marker&&e[n-1].token===o.token-1&&e[o.end+1].token===s.token+1,l=String.fromCharCode(o.marker),u=t.tokens[o.token];u.type=c?"strong_open":"em_open",u.tag=c?"strong":"em",u.nesting=1,u.markup=c?l+l:l,u.content="";let d=t.tokens[s.token];d.type=c?"strong_close":"em_close",d.tag=c?"strong":"em",d.nesting=-1,d.markup=c?l+l:l,d.content="",c&&(t.tokens[e[n-1].token].content="",t.tokens[e[o.end+1].token].content="",n--)}}a(zkn,"postProcess");function Eis(t){let e=t.tokens_meta,r=t.tokens_meta.length;zkn(t,t.delimiters);for(let n=0;n=h)return!1;if(u=A,o=t.md.helpers.parseLinkDestination(t.src,A,t.posMax),o.ok){for(c=t.md.normalizeLink(o.str),t.md.validateLink(c)?A=o.pos:c="",u=A;A=h||t.src.charCodeAt(A)!==41)&&(d=!0),A++}if(d){if(typeof t.env.references>"u")return!1;if(A=0?n=t.src.slice(u,A++):A=g+1):A=g+1,n||(n=t.src.slice(m,g)),s=t.env.references[DJ(n)],!s)return t.pos=f,!1;c=s.href,l=s.title}if(!e){t.pos=m,t.posMax=g;let y=t.push("link_open","a",1),E=[["href",c]];y.attrs=E,l&&E.push(["title",l]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=A,t.posMax=h,!0}a(SWt,"link");p();function TWt(t,e){let r,n,o,s,c,l,u,d,f="",h=t.pos,m=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;let g=t.pos+2,A=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(A<0)return!1;if(s=A+1,s=m)return!1;for(d=s,l=t.md.helpers.parseLinkDestination(t.src,s,t.posMax),l.ok&&(f=t.md.normalizeLink(l.str),t.md.validateLink(f)?s=l.pos:f=""),d=s;s=m||t.src.charCodeAt(s)!==41)return t.pos=h,!1;s++}else{if(typeof t.env.references>"u")return!1;if(s=0?o=t.src.slice(d,s++):s=A+1):s=A+1,o||(o=t.src.slice(g,A)),c=t.env.references[DJ(o)],!c)return t.pos=h,!1;f=c.href,u=c.title}if(!e){n=t.src.slice(g,A);let y=[];t.md.inline.parse(n,t.md,t.env,y);let E=t.push("image","img",0),_=[["src",f],["alt",""]];E.attrs=_,E.children=y,E.content=n,u&&_.push(["title",u])}return t.pos=s,t.posMax=m,!0}a(TWt,"image");p();var _is=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,vis=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function IWt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==60)return!1;let n=t.pos,o=t.posMax;for(;;){if(++r>=o)return!1;let c=t.src.charCodeAt(r);if(c===60)return!1;if(c===62)break}let s=t.src.slice(n+1,r);if(vis.test(s)){let c=t.md.normalizeLink(s);if(!t.md.validateLink(c))return!1;if(!e){let l=t.push("link_open","a",1);l.attrs=[["href",c]],l.markup="autolink",l.info="auto";let u=t.push("text","",0);u.content=t.md.normalizeLinkText(s);let d=t.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return t.pos+=s.length+2,!0}if(_is.test(s)){let c=t.md.normalizeLink("mailto:"+s);if(!t.md.validateLink(c))return!1;if(!e){let l=t.push("link_open","a",1);l.attrs=[["href",c]],l.markup="autolink",l.info="auto";let u=t.push("text","",0);u.content=t.md.normalizeLinkText(s);let d=t.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return t.pos+=s.length+2,!0}return!1}a(IWt,"autolink");p();function Cis(t){return/^\s]/i.test(t)}a(Cis,"isLinkOpen");function bis(t){return/^<\/a\s*>/i.test(t)}a(bis,"isLinkClose");function Sis(t){let e=t|32;return e>=97&&e<=122}a(Sis,"isLetter");function xWt(t,e){if(!t.md.options.html)return!1;let r=t.posMax,n=t.pos;if(t.src.charCodeAt(n)!==60||n+2>=r)return!1;let o=t.src.charCodeAt(n+1);if(o!==33&&o!==63&&o!==47&&!Sis(o))return!1;let s=t.src.slice(n).match(Hkn);if(!s)return!1;if(!e){let c=t.push("html_inline","",0);c.content=s[0],Cis(c.content)&&t.linkLevel++,bis(c.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}a(xWt,"html_inline");p();var Tis=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Iis=/^&([a-z][a-z0-9]{1,31});/i;function wWt(t,e){let r=t.pos,n=t.posMax;if(t.src.charCodeAt(r)!==38||r+1>=n)return!1;if(t.src.charCodeAt(r+1)===35){let s=t.src.slice(r).match(Tis);if(s){if(!e){let c=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),l=t.push("text_special","",0);l.content=att(c)?wde(c):wde(65533),l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}else{let s=t.src.slice(r).match(Iis);if(s){let c=oRe(s[0]);if(c!==s[0]){if(!e){let l=t.push("text_special","",0);l.content=c,l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}}return!1}a(wWt,"entity");p();function Ykn(t){let e={},r=t.length;if(!r)return;let n=0,o=-2,s=[];for(let c=0;cu;d-=s[d]+1){let h=t[d];if(h.marker===l.marker&&h.open&&h.end<0){let m=!1;if((h.close||l.open)&&(h.length+l.length)%3===0&&(h.length%3!==0||l.length%3!==0)&&(m=!0),!m){let g=d>0&&!t[d-1].open?s[d-1]+1:0;s[c]=c-d+g,s[d]=g,l.open=!1,h.end=c,h.close=!1,f=-1,o=-2;break}}}f!==-1&&(e[l.marker][(l.open?3:0)+(l.length||0)%3]=f)}}a(Ykn,"processDelimiters");function RWt(t){let e=t.tokens_meta,r=t.tokens_meta.length;Ykn(t.delimiters);for(let n=0;n0&&n++,o[e].type==="text"&&e+1=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;c||t.pos++,s[e]=t.pos};aRe.prototype.tokenize=function(t){let e=this.ruler.getRules(""),r=e.length,n=t.posMax,o=t.md.options.maxNesting;for(;t.pos=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(c){if(t.pos>=n)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};aRe.prototype.parse=function(t,e,r,n){let o=new this.State(t,e,r,n);this.tokenize(o);let s=this.ruler2.getRules(""),c=s.length;for(let l=0;l|$))`,e.tpl_email_fuzzy=`(^|${r}|"|\\(|${e.src_ZCc})(${e.src_email_name}@${e.tpl_host_fuzzy_strict})`,e.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${e.src_ZPCc}))((?![$+<=>^\`|\uFF5C])${e.tpl_host_port_fuzzy_strict}${e.src_path})`,e.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${e.src_ZPCc}))((?![$+<=>^\`|\uFF5C])${e.tpl_host_port_no_ip_fuzzy_strict}${e.src_path})`,e}a(NWt,"default");function MWt(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){r&&Object.keys(r).forEach(function(n){t[n]=r[n]})}),t}a(MWt,"assign");function ftt(t){return Object.prototype.toString.call(t)}a(ftt,"_class");function xis(t){return ftt(t)==="[object String]"}a(xis,"isString");function wis(t){return ftt(t)==="[object Object]"}a(wis,"isObject");function Ris(t){return ftt(t)==="[object RegExp]"}a(Ris,"isRegExp");function Jkn(t){return ftt(t)==="[object Function]"}a(Jkn,"isFunction");function kis(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}a(kis,"escapeRE");var Xkn={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Pis(t){return Object.keys(t||{}).reduce(function(e,r){return e||Xkn.hasOwnProperty(r)},!1)}a(Pis,"isOptionsObj");var Dis={"http:":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.http||(r.re.http=new RegExp(`^\\/\\/${r.re.src_auth}${r.re.src_host_port_strict}${r.re.src_path}`,"i")),r.re.http.test(n)?n.match(r.re.http)[0].length:0},"validate")},"https:":"http:","ftp:":"http:","//":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.no_http||(r.re.no_http=new RegExp("^"+r.re.src_auth+`(?:localhost|(?:(?:${r.re.src_domain})\\.)+${r.re.src_domain_root})`+r.re.src_port+r.re.src_host_terminator+r.re.src_path,"i")),r.re.no_http.test(n)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:n.match(r.re.no_http)[0].length:0},"validate")},"mailto:":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.mailto||(r.re.mailto=new RegExp(`^${r.re.src_email_name}@${r.re.src_host_strict}`,"i")),r.re.mailto.test(n)?n.match(r.re.mailto)[0].length:0},"validate")}},Nis="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",Mis="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function Ois(t){return function(e,r){let n=e.slice(r);return t.test(n)?n.match(t)[0].length:0}}a(Ois,"createValidator");function Zkn(){return function(t,e){e.normalize(t)}}a(Zkn,"createNormalizer");function dtt(t){let e=t.re=NWt(t.__opts__),r=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||r.push(Nis),r.push(e.src_xn),e.src_tlds=r.join("|");function n(l){return l.replace("%TLDS%",e.src_tlds)}a(n,"untpl"),e.email_fuzzy=RegExp(n(e.tpl_email_fuzzy),"i"),e.email_fuzzy_global=RegExp(n(e.tpl_email_fuzzy),"ig"),e.link_fuzzy=RegExp(n(e.tpl_link_fuzzy),"i"),e.link_fuzzy_global=RegExp(n(e.tpl_link_fuzzy),"ig"),e.link_no_ip_fuzzy=RegExp(n(e.tpl_link_no_ip_fuzzy),"i"),e.link_no_ip_fuzzy_global=RegExp(n(e.tpl_link_no_ip_fuzzy),"ig"),e.host_fuzzy_test=RegExp(n(e.tpl_host_fuzzy_test),"i");let o=[];t.__compiled__={};function s(l,u){throw new Error(`(LinkifyIt) Invalid schema "${l}": ${u}`)}a(s,"schemaError"),Object.keys(t.__schemas__).forEach(function(l){let u=t.__schemas__[l];if(u===null)return;let d={validate:null,link:null};if(t.__compiled__[l]=d,wis(u)){Ris(u.validate)?d.validate=Ois(u.validate):Jkn(u.validate)?d.validate=u.validate:s(l,u),Jkn(u.normalize)?d.normalize=u.normalize:u.normalize?s(l,u):d.normalize=Zkn();return}if(xis(u)){o.push(l);return}s(l,u)}),o.forEach(function(l){t.__compiled__[t.__schemas__[l]]&&(t.__compiled__[l].validate=t.__compiled__[t.__schemas__[l]].validate,t.__compiled__[l].normalize=t.__compiled__[t.__schemas__[l]].normalize)}),t.__compiled__[""]={validate:null,normalize:Zkn()};let c=Object.keys(t.__compiled__).filter(function(l){return l.length>0&&t.__compiled__[l]}).map(kis).join("|");t.re.schema_test=RegExp(`(^|(?!_)(?:[><\uFF5C]|${e.src_ZPCc}))(${c})`,"i"),t.re.schema_search=RegExp(`(^|(?!_)(?:[><\uFF5C]|${e.src_ZPCc}))(${c})`,"ig"),t.re.schema_at_start=RegExp(`^${t.re.schema_search.source}`,"i"),t.re.pretest=RegExp(`(${t.re.schema_test.source})|(${t.re.host_fuzzy_test.source})|@`,"i")}a(dtt,"compile");function ePn(t,e,r,n){let o=t.slice(r,n);this.schema=e.toLowerCase(),this.index=r,this.lastIndex=n,this.raw=o,this.text=o,this.url=o}a(ePn,"Match");function lT(t,e){if(!(this instanceof lT))return new lT(t,e);e||Pis(t)&&(e=t,t={}),this.__opts__=MWt({},Xkn,e),this.__schemas__=MWt({},Dis,t),this.__compiled__={},this.__tlds__=Mis,this.__tlds_replaced__=!1,this.re={},dtt(this)}a(lT,"LinkifyIt");lT.prototype.add=a(function(e,r){return this.__schemas__[e]=r,dtt(this),this},"add");lT.prototype.set=a(function(e){return this.__opts__=MWt(this.__opts__,e),this},"set");lT.prototype.test=a(function(e){if(!e.length)return!1;let r,n;if(this.re.schema_test.test(e)){for(n=this.re.schema_search,n.lastIndex=0;(r=n.exec(e))!==null;)if(this.testSchemaAt(e,r[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&e.match(this.re.email_fuzzy)!==null)},"test");lT.prototype.pretest=a(function(e){return this.re.pretest.test(e)},"pretest");lT.prototype.testSchemaAt=a(function(e,r,n){return this.__compiled__[r.toLowerCase()]?this.__compiled__[r.toLowerCase()].validate(e,n,this):0},"testSchemaAt");lT.prototype.match=a(function(e){let r=[],n=[],o=[],s=[],c,l,u;function d(m,g){return m?g?m.index!==g.index?m.index=g.lastIndex?m:g:m:g}if(a(d,"choose"),!e.length)return null;if(this.re.schema_test.test(e))for(u=this.re.schema_search,u.lastIndex=0;(c=u.exec(e))!==null;)l=this.testSchemaAt(e,c[2],u.lastIndex),l&&n.push({schema:c[2],index:c.index+c[1].length,lastIndex:c.index+c[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(u=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,u.lastIndex=0;(c=u.exec(e))!==null;)o.push({schema:"",index:c.index+c[1].length,lastIndex:c.index+c[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(u=this.re.email_fuzzy_global,u.lastIndex=0;(c=u.exec(e))!==null;)s.push({schema:"mailto:",index:c.index+c[1].length,lastIndex:c.index+c[0].length});let f=[0,0,0],h=0;for(;;){let m=[n[f[0]],s[f[1]],o[f[2]]],g=d(d(m[0],m[1]),m[2]);if(!g)break;if(g===m[0]?f[0]++:g===m[1]?f[1]++:f[2]++,g.index= 0x80 (not a basic code point)","invalid-input":"Invalid input"},OWt=35,i5=Math.floor,LWt=String.fromCharCode;function lj(t){throw new RangeError(Uis[t])}a(lj,"error");function Qis(t,e){let r=[],n=t.length;for(;n--;)r[n]=e(t[n]);return r}a(Qis,"map");function nPn(t,e){let r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(Fis,".");let o=t.split("."),s=Qis(o,e).join(".");return n+s}a(nPn,"mapDomain");function iPn(t){let e=[],r=0,n=t.length;for(;r=55296&&o<=56319&&rString.fromCodePoint(...t),"ucs2encode"),jis=a(function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:36},"basicToDigit"),rPn=a(function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},"digitToBasic"),oPn=a(function(t,e,r){let n=0;for(t=r?i5(t/700):t>>1,t+=i5(t/e);t>OWt*26>>1;n+=36)t=i5(t/OWt);return i5(n+(OWt+1)*t/(t+38))},"adapt"),sPn=a(function(t){let e=[],r=t.length,n=0,o=128,s=72,c=t.lastIndexOf("-");c<0&&(c=0);for(let l=0;l=128&&lj("not-basic"),e.push(t.charCodeAt(l));for(let l=c>0?c+1:0;l=r&&lj("invalid-input");let m=jis(t.charCodeAt(l++));m>=36&&lj("invalid-input"),m>i5((2147483647-n)/f)&&lj("overflow"),n+=m*f;let g=h<=s?1:h>=s+26?26:h-s;if(mi5(2147483647/A)&&lj("overflow"),f*=A}let d=e.length+1;s=oPn(n-u,d,u==0),i5(n/d)>2147483647-o&&lj("overflow"),o+=i5(n/d),n%=d,e.splice(n++,0,o)}return String.fromCodePoint(...e)},"decode"),aPn=a(function(t){let e=[];t=iPn(t);let r=t.length,n=128,o=0,s=72;for(let u of t)u<128&&e.push(LWt(u));let c=e.length,l=c;for(c&&e.push("-");l=n&&fi5((2147483647-o)/d)&&lj("overflow"),o+=(u-n)*d,n=u;for(let f of t)if(f2147483647&&lj("overflow"),f===n){let h=o;for(let m=36;;m+=36){let g=m<=s?1:m>=s+26?26:m-s;if(h=0))try{e.hostname=BWt.toASCII(e.hostname)}catch{}return Jet(Sde(e))}a(Kis,"normalizeLink");function Jis(t){let e=iRe(t,!0);if(e.hostname&&(!e.protocol||dPn.indexOf(e.protocol)>=0))try{e.hostname=BWt.toUnicode(e.hostname)}catch{}return nRe(Sde(e),nRe.defaultChars+"%")}a(Jis,"normalizeLinkText");function Sw(t,e){if(!(this instanceof Sw))return new Sw(t,e);e||stt(t)||(e=t||{},t="default"),this.inline=new Kkn,this.block=new $kn,this.core=new Okn,this.renderer=new Rkn,this.linkify=new tPn,this.validateLink=Yis,this.normalizeLink=Kis,this.normalizeLinkText=Jis,this.utils=GVt,this.helpers=xde({},zVt),this.options={},this.configure(t),e&&this.set(e)}a(Sw,"MarkdownIt");Sw.prototype.set=function(t){return xde(this.options,t),this};Sw.prototype.configure=function(t){let e=this;if(stt(t)){let r=t;if(t=Vis[r],!t)throw new Error('Wrong `markdown-it` preset "'+r+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(r){t.components[r].rules&&e[r].ruler.enableOnly(t.components[r].rules),t.components[r].rules2&&e[r].ruler2.enableOnly(t.components[r].rules2)}),this};Sw.prototype.enable=function(t,e){let r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){r=r.concat(this[o].ruler.enable(t,!0))},this),r=r.concat(this.inline.ruler2.enable(t,!0));let n=t.filter(function(o){return r.indexOf(o)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this};Sw.prototype.disable=function(t,e){let r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){r=r.concat(this[o].ruler.disable(t,!0))},this),r=r.concat(this.inline.ruler2.disable(t,!0));let n=t.filter(function(o){return r.indexOf(o)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this};Sw.prototype.use=function(t){let e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};Sw.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");let r=new this.core.State(t,this,e);return this.core.process(r),r.tokens};Sw.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};Sw.prototype.parseInline=function(t,e){let r=new this.core.State(t,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens};Sw.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};var FWt=Sw;function UWt(t){return Array.isArray(t)}a(UWt,"isArray");function Zis(t){if(t.type!=="fence")return!1;let{map:e,markup:r,content:n,info:o}=t;return(e===null||UWt(e)&&e.length===2&&e.every(c=>typeof c=="number"))&&typeof r=="string"&&typeof n=="string"&&typeof o=="string"}a(Zis,"isFenceToken");function*fPn(t){for(let e of t)if(yield e,e&&typeof e=="object"&&"children"in e){let r=e;UWt(r.children)&&(yield*fPn(r.children))}}a(fPn,"flattenTokensLists");function Xis(){return new FWt}a(Xis,"createMarkdownIt");function pPn(t){let e=[],n=Xis().parse(t,{});if(!UWt(n))return e;for(let o of fPn(n)){if(!o||typeof o!="object")continue;let s=o;if(Zis(s)&&s.map){let c=s.map;e.push({startMarkup:s.markup,code:s.content.replace(/\n$/,""),language:s.info.trim(),startLine:c[0],endLine:c[1]})}}return e}a(pPn,"extractCodeBlocks");function QWt(t){let e=["script","style","iframe","object","embed","form","base","meta","link"],r=/(```[\s\S]*?```|`[^`\n]+?`)/g;return t.split(r).map((o,s)=>{if(s%2===1)return o;let l=new RegExp(`]*)?/?>`,"gi");return o.replace(l,u=>u.replace(//g,">"))}).join("")}a(QWt,"escapeProblematicHtmlTags");var jWt=wn.Gpt4oMini,hPn=new pe("virtualToolSummarizer"),cRe=class extends Error{static{a(this,"SummarizerError")}};function mPn(t){return typeof t=="object"&&t!==null&&"name"in t&&"summary"in t&&typeof t.name=="string"&&typeof t.summary=="string"}a(mPn,"isValidCategoryItem");function gPn(t,e){if(!Array.isArray(t))throw new cRe(`Invalid response from ${e}: ${JSON.stringify(t)}`);if(!t.every(mPn))throw new cRe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(gPn,"validateCategoriesWithoutToolsResponse");function eos(t){return mPn(t)&&"tools"in t&&Array.isArray(t.tools)&&t.tools.every(e=>typeof e=="string")}a(eos,"isValidCategorizationItem");function APn(t,e){if(gPn(t,e),!t.every(eos))throw new cRe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(APn,"validateCategorizationResponse");function yPn(t,e=new Set){return t.filter(r=>{let n=e.has(r.name);return e.add(r.name),!n})}a(yPn,"deduplicateTools");function tos(t){let e=new Map;for(let r of t){let n=_Pn(r.name),o=e.get(n);o?(r.summary&&r.summary!==o.summary&&(o.summary=`${o.summary} -${r.summary}`),o.tools=o.tools.concat(r.tools)):e.set(r.name,{tools:r.tools,name:n,summary:r.summary})}for(let r of e.values())r.tools=qRn(r.tools);return[...e.values()]}a(Krs,"validateAndCleanupCategories");function jRn(t,e){let r=t.map(n=>({name:n.name,summary:n.summary,tools:n.tools.map(o=>e.get(o)).filter(Rwn)}));return Krs(r)}a(jRn,"processCategorizationResponse");function HRn(t){return t.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase()}a(HRn,"normalizeGroupName");function YVt(t,e){let r=new Map(e);for(let n of t)for(let o of n.tools)r.delete(o.name);return r.size>0&&t.push({name:fet,summary:vwn,tools:[...r.values()]}),t}a(YVt,"addUncategorizedToolsIfNeeded");async function JVt(t,e,r,n){if(n.isCancellationRequested)return BRn.debug(t.ctx,"Summarization cancelled"),null;let o=OA.agent("conversation-other",t.turn.telemetryId),s={messages:e.messages,uiKind:"agentPanel",llmInteraction:o,modelConfiguration:r},c=await tl(t.ctx,t,{languageId:""});c=c.extendedBy({messageSource:"virtualTools.generate",modelId:r.modelId});let u=await new oc(t.ctx).fetchResponse(s,n,c,void 0);if(n.isCancellationRequested)return BRn.debug(t.ctx,"Summarization cancelled"),null;if(u.type!=="success")return null;for(let f of LRn(u.value))try{return JSON.parse(f.code)}catch{}let d=u.value.indexOf("{");return JSON.parse(u.value.slice(d))||null}a(JVt,"getResponse");async function GRn(t,e,r){let n=await t.ctx.get(el).getBestChatModelConfig([KVt]),s=await ap.create(Aet,{tools:e},n).renderPrompt(void 0,r),c=await JVt(t,s,n,r);if(!c)return;let l=[c];return URn(l,"categorizer"),{...l[0],tools:qRn(e),name:HRn(l[0].name)}}a(GRn,"summarizeToolGroup");async function $Rn(t,e,r){let n=await t.ctx.get(el).getBestChatModelConfig([KVt]),s=await ap.create(yet,{tools:e},n).renderPrompt(void 0,r),c=await JVt(t,s,n,r);if(!c)return;QRn(c,"categorizer");let l=new Map(e.map(h=>[h.name,h])),u=jRn(c,l),d=new Set(u.flatMap(h=>h.tools.map(m=>m.name))),f=e.filter(h=>!d.has(h.name));if(f.length>0){let h=await ZVt(t,u,f,r);h&&(u=h),u=YVt(u,l)}return u}a($Rn,"divideToolsIntoGroups");async function ZVt(t,e,r,n){let o=await t.ctx.get(el).getBestChatModelConfig([KVt]),c=await ap.create(Eet,{existingGroups:e,newTools:r},o).renderPrompt(void 0,n),l=await JVt(t,c,o,n);if(!l)return;QRn(l,"existing group categorizer");let u=[...e.flatMap(h=>h.tools),...r],d=new Map(u.map(h=>[h.name,h])),f=jRn(l,d);return YVt(f,d)}a(ZVt,"divideToolsIntoExistingGroups");var zRn=de(require("crypto"));var XVt=new fe("virtualToolGrouper"),WRn="builtin",ens=`Call this tool when you need access to a new category of tools. The category of tools is described as follows: +${r.summary}`),o.tools=o.tools.concat(r.tools)):e.set(r.name,{tools:r.tools,name:n,summary:r.summary})}for(let r of e.values())r.tools=yPn(r.tools);return[...e.values()]}a(tos,"validateAndCleanupCategories");function EPn(t,e){let r=t.map(n=>({name:n.name,summary:n.summary,tools:n.tools.map(o=>e.get(o)).filter(skn)}));return tos(r)}a(EPn,"processCategorizationResponse");function _Pn(t){return t.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase()}a(_Pn,"normalizeGroupName");function qWt(t,e){let r=new Map(e);for(let n of t)for(let o of n.tools)r.delete(o.name);return r.size>0&&t.push({name:qet,summary:ZRn,tools:[...r.values()]}),t}a(qWt,"addUncategorizedToolsIfNeeded");async function HWt(t,e,r,n){if(n.isCancellationRequested)return hPn.debug(t.ctx,"Summarization cancelled"),null;let o=FA.agent("conversation-other",t.turn.telemetryId),s={messages:e.messages,uiKind:"agentPanel",llmInteraction:o,modelConfiguration:r},c=await rl(t.ctx,t,{languageId:""});c=c.extendedBy({messageSource:"virtualTools.generate",modelId:r.modelId});let u=await new cc(t.ctx).fetchResponse(s,n,c,void 0);if(n.isCancellationRequested)return hPn.debug(t.ctx,"Summarization cancelled"),null;if(u.type!=="success")return null;for(let f of pPn(u.value))try{return JSON.parse(f.code)}catch{}let d=u.value.indexOf("{");return JSON.parse(u.value.slice(d))||null}a(HWt,"getResponse");async function vPn(t,e,r){let n=await t.ctx.get(tl).getBestChatModelConfig([jWt]),s=await up.create(Vet,{tools:e},n).renderPrompt(void 0,r),c=await HWt(t,s,n,r);if(!c)return;let l=[c];return gPn(l,"categorizer"),{...l[0],tools:yPn(e),name:_Pn(l[0].name)}}a(vPn,"summarizeToolGroup");async function CPn(t,e,r){let n=await t.ctx.get(tl).getBestChatModelConfig([jWt]),s=await up.create(Wet,{tools:e},n).renderPrompt(void 0,r),c=await HWt(t,s,n,r);if(!c)return;APn(c,"categorizer");let l=new Map(e.map(h=>[h.name,h])),u=EPn(c,l),d=new Set(u.flatMap(h=>h.tools.map(m=>m.name))),f=e.filter(h=>!d.has(h.name));if(f.length>0){let h=await GWt(t,u,f,r);h&&(u=h),u=qWt(u,l)}return u}a(CPn,"divideToolsIntoGroups");async function GWt(t,e,r,n){let o=await t.ctx.get(tl).getBestChatModelConfig([jWt]),c=await up.create(zet,{existingGroups:e,newTools:r},o).renderPrompt(void 0,n),l=await HWt(t,c,o,n);if(!l)return;APn(l,"existing group categorizer");let u=[...e.flatMap(h=>h.tools),...r],d=new Map(u.map(h=>[h.name,h])),f=EPn(l,d);return qWt(f,d)}a(GWt,"divideToolsIntoExistingGroups");var TPn=fe(require("crypto"));var $Wt=new pe("virtualToolGrouper"),SPn="builtin",oos=`Call this tool when you need access to a new category of tools. The category of tools is described as follows: -`,tns=` +`,sos=` -Be sure to call this tool if you need a capability related to the above.`,Uet=class{static{a(this,"VirtualToolGrouper")}constructor(e){this.turnContext=e}async addGroups(e,r,n){if(r.lengthu.type==="mcp"?"mcp_"+u.toolProvider.id:u.type==="client"||u.type==="shared"?WRn:"unexpected_"+u.toolProvider.id),s=new Map,c=new Map;for(let u of e.all())u instanceof ev&&(s.set(u.name,u),u.metadata.toolsetKey&&c.set(u.metadata.toolsetKey,u.metadata.groups));if(n.isCancellationRequested)return;let l=await Promise.all(Object.entries(o).map(([u,d])=>{if(u===WRn)return d;{let f=s.get(u);if(f){let h=f.all().filter(m=>m instanceof EK);if(this.getKey(h)===this.getKey(d))return f}return this._generateGroupsFromToolset(u,d,c.get(u),n)}}));e.contents=this._deduplicateGroups(l.flat());for(let u of e.all())if(u instanceof ev){let d=s.get(u.name);d&&(u.isExpanded=d.isExpanded,u.metadata.preExpanded=d.metadata.preExpanded,u.lastUsedOnTurn=d.lastUsedOnTurn)}this._reExpandToolsToHitBudget(e)}async _generateGroupsFromToolset(e,r,n,o){if(r.length<=2)return r;let s=0,c;for(;!c&&s<3;s++){if(o.isCancellationRequested)return[];try{c=await(r.length<=16?this._summarizeToolGroup(r,o):this._divideToolsIntoGroups(r,n,o))}catch(d){XVt.error(this.turnContext.ctx,`Failed to categorize tools: ${Xu(d)}`)}}XVt.info(this.turnContext.ctx,`Tool categorization completed after ${s} attempt(s).`);let l=[];if(!c)l=r;else{let d=c.findIndex(f=>f.name===fet);d>=0&&(l=c[d].tools,c.splice(d,1))}return(c?.map(d=>{let f=r[0].toolProvider,h=f.displayNamePrefix??f.id;return new ev(Wq+d.name,ens+d.summary+tns,0,{toolsetKey:e,groups:c,possiblePrefix:h?.replaceAll(/[^a-zA-Z0-9]/g,"_").slice(0,10)+"_"},d.tools)})||[]).concat(l)}_reExpandToolsToHitBudget(e){let r=e.tools().length;if(r>64)return;let n=e.contents.filter(o=>o instanceof ev&&!o.isExpanded).sort((o,s)=>o.contents.length-s.contents.length);for(let o of n){let s=r-1+o.contents.length;if(s>128||(o.isExpanded=!0,o.metadata.preExpanded=!0,r=s,r>64))break}}async _summarizeToolGroup(e,r){let n=await GRn(this.turnContext,e,r);return n&&[n]}async _divideToolsIntoGroups(e,r,n){if(r){let s=new Set(e.map(c=>c.name));r=r.map(c=>({...c,tools:c.tools.filter(l=>s.has(l.name))})).filter(c=>c.tools.length>0)}let o=r?.length?await ZVt(this.turnContext,r,e,n):await $Rn(this.turnContext,e,n);if(o)return o}_deduplicateGroups(e){let r=new Map;for(let n of e){let o=r.get(n.name);if(!o){r.set(n.name,n);continue}if(o instanceof ev&&o.metadata.possiblePrefix){r.delete(o.name);let s=o.cloneWithPrefix(o.metadata.possiblePrefix);r.set(s.name,s),r.set(n.name,n)}else if(n instanceof ev&&n.metadata.possiblePrefix){let s=n.cloneWithPrefix(n.metadata.possiblePrefix);r.set(s.name,s)}}return[...r.values()]}getKey(e){let r=e.map(n=>n.name+"\0"+n.description).sort().join(",");return zRn.createHash("sha256").update(r).digest("hex")}};var Qet=class{constructor(e){this._root=new ev(Wq,"",1/0,{groups:[],toolsetKey:"",preExpanded:!0});this._didToolsChange=!0;this._turnNo=0;this._trimOnNextCompute=!1;this._tools=e,this._root.isExpanded=!0}static{a(this,"ToolGrouping")}get tools(){return this._tools}get isEnabled(){return this._tools.length>128}get root(){return this._root}set tools(e){Lwe(this._tools,e,(r,n)=>r.name===n.name)||(this._tools=[...e],this._didToolsChange=!0)}async compute(e,r){if(this._didToolsChange&&(await new Uet(e).addGroups(this._root,this._tools.slice(),r),this._didToolsChange=!1),this._expandOnNext){for(let o of this._expandOnNext)this._root.find(o)?.path.forEach(s=>{s.isExpanded=!0,s.lastUsedOnTurn=this._turnNo});this._expandOnNext=void 0}let n=128;for(this._trimOnNextCompute&&(n=96,this._trimOnNextCompute=!1),this._root.lastUsedOnTurn=1/0;this._root.tools().length>n;){let o=this._root.getLowestExpandedTool();if(!o||o===this._root)break;o.isExpanded=!1,o.metadata.preExpanded=!1}return this._trimOnNextCompute=!1,[...this._root.tools()]}ensureExpanded(e){this._expandOnNext??=new Set,this._expandOnNext.add(e)}didInvalidateCache(){this._trimOnNextCompute=!0}didTakeTurn(){this._turnNo++}didCall(e){let r=this._root.find(e);if(!r)return;let{path:n,tool:o}=r;for(let s of n)s.lastUsedOnTurn=this._turnNo;if(o instanceof ev)return o.isExpanded=!0,new Lr([new Rr(`Tools activated: ${[...o.tools()].map(s=>s.name).join(", ")}`)],"success")}};var XO=class{constructor(){this._groups=new Map}static{a(this,"ToolGroupingService")}get groups(){return[...this._groups.values()]}getGroupKey(e){let r=e.turn.chatMode;return r===void 0||r===Cl.Agent?"_global_":r.id}getGroup(e){let r=this.getGroupKey(e);return this._groups.get(r)}create(e,r){let n=this.getGroupKey(e),o=this._groups.get(n);return o?o.tools=r:(o=new Qet(r),this._groups.set(n,o)),o}didTakeTurn(e){this.getGroup(e)?.didTakeTurn()}didCall(e,r){return this.getGroup(e)?.didCall(r)}isEnabled(e){return this.getGroup(e)?.isEnabled??!1}compute(e,r){return this.getGroup(e)?.compute(e,r)}findTool(e,r){return this.getGroup(e)?.root.find(r)?.tool??null}};p();function YRn(t){let e=t*.05,r=Math.min(Math.max(e,1e3),3e3);return t-r}a(YRn,"calculateReducedMaxRequestTokens");Mo();var ons=500,qet=3,Ig=new fe("toolCallingLoop"),sns="internal.tool_calling_loop_continue_confirmation",_de=class t{constructor(e,r,n,o,s){this.turnContext=e;this.chatFetcher=r;this.modelConfiguration=n;this.baseTelemetryWithExp=o;this.subagentConfig=s;this.nextTrajectoryOrder=0;this.toolCallRounds=[];this.maxOutputTokenRecoveryCount=0;this.conversationProgress=e.ctx.get(Tc),this.conversation=e.conversation,this.turn=e.turn,this.toolsService=e.ctx.get(gs),this.transcriptPersistence=new p0(e.ctx),this.llmRequestPersistence=Zae(()=>{if(!eKe(e.ctx))return;let d=e.subagentInfo;return new XYe(e.ctx,void 0,"ToolCallingLoop",e.conversation.id.toString(),e.turn.id.toString(),void 0,e.turn.parentTurnId?.toString(),d?.name)},void 0),this.hookTrigger=new ede(e.ctx,e.conversation,e.turn.workspaceFolders||[]),this.metricsTracker=new pet(e.ctx,this.conversation,this.turn,this.conversationProgress);let c=this.modelConfiguration.maxRequestTokens,l=YRn(c),u=c-l;Ig.debug(this.turnContext.ctx,`Token reduction applied: original=${c}, reduced=${l}, reduction=${u} tokens`),this.modelConfiguration={...this.modelConfiguration,maxRequestTokens:l},this.requestId=Mt(),this.baseTelemetryWithExp=this.baseTelemetryWithExp.extendedBy({requestId:this.requestId}),this.maxToolCallingLoop=s?.getMaxRounds?.()??Math.min(ons,Ft(e.ctx,Ye.MaxToolCallingLoop)),this.requestLimitIncrement=this.maxToolCallingLoop,this.snapshotTextDocumentProvider=new TXe(new IXe(e.ctx))}static{a(this,"ToolCallingLoop")}static{this.NextToolCallId=Date.now()}async run(e){this.abortIfCanceled(e);let r=0,n;this.turnContext.todoListSnapshot=this.turnContext.ctx.get(m0).getTodos(this.conversation),await this.llmRequestPersistence?.ensureInitialized(),this.cachedUseMessagesEndpoint=oYe(this.turnContext.ctx,this.modelConfiguration);let o=this.toolsService.getToolsForModel(this.turnContext.turn.chatMode).some(s=>s.name==="run_subagent");for(this.cachedHasSearchSubagent=o&&await K$e(this.turnContext.ctx);;)try{r++,this.abortIfCanceled(e),await this.validateIteration(r,n,e),this.turnContext.clearCopilotEditsSessionHeader();let s=performance.now(),c=await this.runOne(r,e),l=this.metricsTracker.extractRoundUsage(c.response);if(Ryn(this.turnContext.ctx,this.turnContext,r,performance.now()-s,this.baseTelemetryWithExp,l,c.llmFetchTimeMs,c.timeSinceLastLLMCallMs,c.promptPrefixMetrics,c.routeForTelemetry),this.metricsTracker.logRoundDebugMetrics(r,this.turn.id,l,c.llmFetchTimeMs,c.timeSinceLastLLMCallMs,c.promptPrefixMetrics),this.metricsTracker.accumulateTokenUsage(r,l),n={...c},this.toolCallRounds.push(c.round),await this.checkCompressionAfterToolCall(e),!c.round.toolCalls.length||c.response.type!=="success"&&c.response.type!=="tool_calls"){this.turn.status==="in-progress"&&(this.turn.status="success"),this.turnContext.subagentInfo&&(r++,await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:r,reply:`\u2726\uFE0E **${this.turnContext.subagentInfo.name}** completed +Be sure to call this tool if you need a capability related to the above.`,ptt=class{static{a(this,"VirtualToolGrouper")}constructor(e){this.turnContext=e}async addGroups(e,r,n){if(r.length<_7t){e.contents=r;return}$Wt.info(this.turnContext.ctx,`Grouping ${r.length} tools into virtual tools.`,r);let o=okn(r,u=>u.type==="mcp"?"mcp_"+u.toolProvider.id:u.type==="client"||u.type==="shared"?SPn:"unexpected_"+u.toolProvider.id),s=new Map,c=new Map;for(let u of e.all())u instanceof iv&&(s.set(u.name,u),u.metadata.toolsetKey&&c.set(u.metadata.toolsetKey,u.metadata.groups));if(n.isCancellationRequested)return;let l=await Promise.all(Object.entries(o).map(([u,d])=>{if(u===SPn)return d;{let f=s.get(u);if(f){let h=f.all().filter(m=>m instanceof kK);if(this.getKey(h)===this.getKey(d))return f}return this._generateGroupsFromToolset(u,d,c.get(u),n)}}));e.contents=this._deduplicateGroups(l.flat());for(let u of e.all())if(u instanceof iv){let d=s.get(u.name);d&&(u.isExpanded=d.isExpanded,u.metadata.preExpanded=d.metadata.preExpanded,u.lastUsedOnTurn=d.lastUsedOnTurn)}this._reExpandToolsToHitBudget(e)}async _generateGroupsFromToolset(e,r,n,o){if(r.length<=2)return r;let s=0,c;for(;!c&&s<3;s++){if(o.isCancellationRequested)return[];try{c=await(r.length<=16?this._summarizeToolGroup(r,o):this._divideToolsIntoGroups(r,n,o))}catch(d){$Wt.error(this.turnContext.ctx,`Failed to categorize tools: ${rd(d)}`)}}$Wt.info(this.turnContext.ctx,`Tool categorization completed after ${s} attempt(s).`);let l=[];if(!c)l=r;else{let d=c.findIndex(f=>f.name===qet);d>=0&&(l=c[d].tools,c.splice(d,1))}return(c?.map(d=>{let f=r[0].toolProvider,h=f.displayNamePrefix??f.id;return new iv(sj+d.name,oos+d.summary+sos,0,{toolsetKey:e,groups:c,possiblePrefix:h?.replaceAll(/[^a-zA-Z0-9]/g,"_").slice(0,10)+"_"},d.tools)})||[]).concat(l)}_reExpandToolsToHitBudget(e){let r=e.tools().length;if(r>64)return;let n=e.contents.filter(o=>o instanceof iv&&!o.isExpanded).sort((o,s)=>o.contents.length-s.contents.length);for(let o of n){let s=r-1+o.contents.length;if(s>128||(o.isExpanded=!0,o.metadata.preExpanded=!0,r=s,r>64))break}}async _summarizeToolGroup(e,r){let n=await vPn(this.turnContext,e,r);return n&&[n]}async _divideToolsIntoGroups(e,r,n){if(r){let s=new Set(e.map(c=>c.name));r=r.map(c=>({...c,tools:c.tools.filter(l=>s.has(l.name))})).filter(c=>c.tools.length>0)}let o=r?.length?await GWt(this.turnContext,r,e,n):await CPn(this.turnContext,e,n);if(o)return o}_deduplicateGroups(e){let r=new Map;for(let n of e){let o=r.get(n.name);if(!o){r.set(n.name,n);continue}if(o instanceof iv&&o.metadata.possiblePrefix){r.delete(o.name);let s=o.cloneWithPrefix(o.metadata.possiblePrefix);r.set(s.name,s),r.set(n.name,n)}else if(n instanceof iv&&n.metadata.possiblePrefix){let s=n.cloneWithPrefix(n.metadata.possiblePrefix);r.set(s.name,s)}}return[...r.values()]}getKey(e){let r=e.map(n=>n.name+"\0"+n.description).sort().join(",");return TPn.createHash("sha256").update(r).digest("hex")}};var htt=class{constructor(e){this._root=new iv(sj,"",1/0,{groups:[],toolsetKey:"",preExpanded:!0});this._didToolsChange=!0;this._turnNo=0;this._trimOnNextCompute=!1;this._tools=e,this._root.isExpanded=!0}static{a(this,"ToolGrouping")}get tools(){return this._tools}get isEnabled(){return this._tools.length>128}get root(){return this._root}set tools(e){tRe(this._tools,e,(r,n)=>r.name===n.name)||(this._tools=[...e],this._didToolsChange=!0)}async compute(e,r){if(this._didToolsChange&&(await new ptt(e).addGroups(this._root,this._tools.slice(),r),this._didToolsChange=!1),this._expandOnNext){for(let o of this._expandOnNext)this._root.find(o)?.path.forEach(s=>{s.isExpanded=!0,s.lastUsedOnTurn=this._turnNo});this._expandOnNext=void 0}let n=128;for(this._trimOnNextCompute&&(n=96,this._trimOnNextCompute=!1),this._root.lastUsedOnTurn=1/0;this._root.tools().length>n;){let o=this._root.getLowestExpandedTool();if(!o||o===this._root)break;o.isExpanded=!1,o.metadata.preExpanded=!1}return this._trimOnNextCompute=!1,[...this._root.tools()]}ensureExpanded(e){this._expandOnNext??=new Set,this._expandOnNext.add(e)}didInvalidateCache(){this._trimOnNextCompute=!0}didTakeTurn(){this._turnNo++}didCall(e){let r=this._root.find(e);if(!r)return;let{path:n,tool:o}=r;for(let s of n)s.lastUsedOnTurn=this._turnNo;if(o instanceof iv)return o.isExpanded=!0,new Fr([new Pr(`Tools activated: ${[...o.tools()].map(s=>s.name).join(", ")}`)],"success")}};var s5=class{constructor(){this._groups=new Map}static{a(this,"ToolGroupingService")}get groups(){return[...this._groups.values()]}getGroupKey(e){let r=e.turn.chatMode;return r===void 0||r===bl.Agent?"_global_":r.id}getGroup(e){let r=this.getGroupKey(e);return this._groups.get(r)}create(e,r){let n=this.getGroupKey(e),o=this._groups.get(n);return o?o.tools=r:(o=new htt(r),this._groups.set(n,o)),o}didTakeTurn(e){this.getGroup(e)?.didTakeTurn()}didCall(e,r){return this.getGroup(e)?.didCall(r)}isEnabled(e){return this.getGroup(e)?.isEnabled??!1}compute(e,r){return this.getGroup(e)?.compute(e,r)}findTool(e,r){return this.getGroup(e)?.root.find(r)?.tool??null}};p();function IPn(t){let e=t*.05,r=Math.min(Math.max(e,1e3),3e3);return t-r}a(IPn,"calculateReducedMaxRequestTokens");Mo();var uos=500,mtt=3,kg=new pe("toolCallingLoop"),dos="internal.tool_calling_loop_continue_confirmation",Pde=class t{constructor(e,r,n,o,s){this.turnContext=e;this.chatFetcher=r;this.modelConfiguration=n;this.baseTelemetryWithExp=o;this.subagentConfig=s;this.nextTrajectoryOrder=0;this.toolCallRounds=[];this.maxOutputTokenRecoveryCount=0;this.conversationProgress=e.ctx.get(wc),this.conversation=e.conversation,this.turn=e.turn,this.toolsService=e.ctx.get(hs),this.transcriptPersistence=new g0(e.ctx),this.llmRequestPersistence=kle(()=>{if(!wKe(e.ctx))return;let d=e.subagentInfo;return new xKe(e.ctx,void 0,"ToolCallingLoop",e.conversation.id.toString(),e.turn.id.toString(),void 0,e.turn.parentTurnId?.toString(),d?.name)},void 0),this.hookTrigger=new dde(e.ctx,e.conversation,e.turn.workspaceFolders||[]),this.metricsTracker=new jet(e.ctx,this.conversation,this.turn,this.conversationProgress);let c=this.modelConfiguration.maxRequestTokens,l=IPn(c),u=c-l;kg.debug(this.turnContext.ctx,`Token reduction applied: original=${c}, reduced=${l}, reduction=${u} tokens`),this.modelConfiguration={...this.modelConfiguration,maxRequestTokens:l},this.requestId=Nt(),this.baseTelemetryWithExp=this.baseTelemetryWithExp.extendedBy({requestId:this.requestId}),this.maxToolCallingLoop=s?.getMaxRounds?.()??Math.min(uos,Rt(e.ctx,ze.MaxToolCallingLoop)),this.requestLimitIncrement=this.maxToolCallingLoop,this.snapshotTextDocumentProvider=new XXe(new eet(e.ctx))}static{a(this,"ToolCallingLoop")}static{this.NextToolCallId=Date.now()}async run(e){this.abortIfCanceled(e);let r=0,n;this.turnContext.todoListSnapshot=this.turnContext.ctx.get(y0).getTodos(this.conversation),await this.llmRequestPersistence?.ensureInitialized(),this.cachedUseMessagesEndpoint=NYe(this.turnContext.ctx,this.modelConfiguration);let o=this.toolsService.getToolsForModel(this.turnContext.turn.chatMode).some(s=>s.name==="run_subagent");for(this.cachedHasSearchSubagent=o&&await CVe(this.turnContext.ctx);;)try{r++,this.abortIfCanceled(e),await this.validateIteration(r,n,e),this.turnContext.clearCopilotEditsSessionHeader();let s=performance.now(),c=await this.runOne(r,e),l=this.metricsTracker.extractRoundUsage(c.response);if(o_n(this.turnContext.ctx,this.turnContext,r,performance.now()-s,this.baseTelemetryWithExp,l,c.llmFetchTimeMs,c.timeSinceLastLLMCallMs,c.promptPrefixMetrics,c.routeForTelemetry,c.contextManagement),this.metricsTracker.logRoundDebugMetrics(r,this.turn.id,l,c.llmFetchTimeMs,c.timeSinceLastLLMCallMs,c.promptPrefixMetrics),this.metricsTracker.accumulateTokenUsage(r,l),n={...c},this.toolCallRounds.push(c.round),await this.checkCompressionAfterToolCall(e),!c.round.toolCalls.length||c.response.type!=="success"&&c.response.type!=="tool_calls"){this.turn.status==="in-progress"&&(this.turn.status="success"),this.turnContext.subagentInfo&&(r++,await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:r,reply:`\u2726\uFE0E **${this.turnContext.subagentInfo.name}** completed -`}]}));try{await this.metricsTracker.reportCumulativeTokenUsage(r)}catch{}return}}catch(s){try{await this.metricsTracker.reportCumulativeTokenUsage(r)}catch{}if(this.turnContext.subagentInfo){r++;let c="";s instanceof uF?c="maximum tool attempts reached":c=s instanceof Error?s.message:String(s),await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:r,reply:`\u2726\uFE0E **${this.turnContext.subagentInfo.name}** stopped due to ${c} +`}]}));try{await this.metricsTracker.reportCumulativeTokenUsage(r)}catch{}return}}catch(s){try{await this.metricsTracker.reportCumulativeTokenUsage(r)}catch{}if(this.turnContext.subagentInfo){r++;let c="";s instanceof yF?c="maximum tool attempts reached":c=s instanceof Error?s.message:String(s),await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:r,reply:`\u2726\uFE0E **${this.turnContext.subagentInfo.name}** stopped due to ${c} -`}]})}throw s}}async runOne(e,r){this.abortIfCanceled(r);let n=this.toolsService.getToolsForModel(this.turnContext.turn.chatMode),o=this.getAvailableLanguageModelTools(n),s;if(this.subagentConfig){let R=this.subagentConfig.filterTools?.(o);R!==void 0&&(o=R),s=this.subagentConfig.createPromptRenderer(this.turnContext,o,this.modelConfiguration,{oneBasedIterationNum:e,maxRounds:this.maxToolCallingLoop})}else{let R=this.createAgentPromptProps(o);s=ap.create(det,R,this.modelConfiguration)}let c=this.cachedUseMessagesEndpoint,l=iYe(this.modelConfiguration,c),u=(await s.renderPrompt(void 0,r,{collapseSystemMessages:!0,enableCacheBreakpoints:c})).messages;if(e===1&&!this.turn.renderedUserMessage)for(let R=u.length-1;R>=0;R--){let x=u[R];if(x.role==="user"&&x.content){this.turn.renderedUserMessage=x.content,this.recordRenderedUserMessageTranscript(x.content);break}}let d="",f=new Iq((R,x,P,D,N,L)=>{let B=R.trim(),M=B.match(Hxe)!==null&&B.endsWith("-->")||!!this.subagentConfig?.hideReplyText;this.conversationProgress.report(this.conversation,this.turn,{annotations:x,references:P,hideText:M,notifications:D.map(O=>({severity:"warning",message:O.message})),thinking:L,editAgentRounds:[{roundId:e,reply:M?"":R}]}),this.turn.annotations.push(...x??[]),d+=R});this.abortIfCanceled(r);let h=await this.getAvailableChatTools(o,r);this.abortIfCanceled(r);let m=this.metricsTracker.computePromptPrefixMetrics(u,h),g={messages:u,modelConfiguration:this.modelConfiguration,uiKind:"agentPanel",chatModeKind:this.turnContext.turn.chatMode?.kind,tools:h,intentParams:{intent:!0},llmInteraction:this.turnContext.toLlmInteraction(),endpoint:l,turnId:String(this.turn.id)};this.checkChatPayload(g),Ig.debug(this.turnContext.ctx,`Send request for iteration ${e} for turn ${this.turn.id} with: ${JSON.stringify(g,null,2)}`);let A,y=this.metricsTracker.getTimeSinceLastLLMCall(),E=performance.now(),_=30,v={shouldRetry:a(R=>R.type==="failed"&&R.code===429&&R.retryAfter!==void 0&&R.retryAfter>=0&&R.retryAfter<=_,"shouldRetry"),onRetry:a(async R=>{let x=R.type==="failed"?R.retryAfter:void 0;x!==void 0&&(Ig.info(this.turnContext.ctx,`Rate limited in iteration ${e} for turn ${this.turn.id}, retrying in ${x}s`),await this.turnContext.warn("Service is busy. Retrying shortly \u2014 you can cancel anytime."))},"onRetry"),maxRetryAttempts:3},b=await this.chatFetcher.fetchResponse(g,r,this.baseTelemetryWithExp,(R,x)=>(x.phase&&(A=x.phase),f.isFinishedAfter(R,x)),this.llmRequestPersistence,v),T=performance.now()-E;if(this.metricsTracker.recordLlmFetchComplete(),b.type==="length"){if(this.addToolCallModelResponseToTurn(d,[],b.thinking,A),this.recordAssistantRoundTranscript(d,e,b.thinking),this.maxOutputTokenRecoveryCount0?await this.handleToolCalls({type:"tool_calls",requestId:r.requestId,toolCalls:r.toolCalls,copilotEditsSessionHeader:r.copilotEditsSessionHeader,thinking:r.thinking,usage:r.usage},n,o,e,s,c):(this.turn.status="success",this.addToolCallModelResponseToTurn(n,[],r.thinking,c),this.recordAssistantRoundTranscript(n,e,r.thinking),{response:r,round:{response:r.value,toolInputRetry:0,toolCalls:[],phase:c}});case"offTopic":throw this.turn.status="off-topic",new LA({message:"Sorry, but I can only assist with programming related questions.",responseIsFiltered:!0});case"canceled":throw new Oc;case"failed":throw this.turn.status="error",Ig.error(this.turnContext.ctx,"Fetch failed:",r),new LA({message:$_.translateErrorMessage(r.code,r.reason,r.requestId,r.retryAfter,r.ghRequestId,{capiErrorCode:r.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===V_,copilotPlan:rx(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:r.code,retryAfter:r.retryAfter});case"filtered":throw this.turn.status="filtered",new LA({message:"Oops, your response got filtered.",responseIsFiltered:!0});case"length":throw this.turn.status="error",new LA({message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0});case"agentAuthRequired":throw this.turn.status="error",new LA({message:"Authorization required",responseIsFiltered:!1});case"no_choices":throw this.turn.status="error",new LA({message:"Oops, no choices received from the server. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0});case"no_finish_reason":throw this.turn.status="error",new LA({message:"Oops, unexpected end of stream. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0});case"model_not_supported":{this.turn.status="error";let{modelName:l,modelProviderName:u}=xo.parseModelNotSupportedReason(r.reason);throw new LA({message:"Oops, the model is not supported. Please try again.",code:400,reason:"model_not_supported",responseIsFiltered:!1,modelName:l,modelProviderName:u})}case"model_max_prompt_tokens_exceeded":throw this.turn.status="error",new LA({message:"Oops, the token limit exceeded. Try to shorten your prompt or start a new conversation.",responseIsFiltered:!1});case"tool_calls":return await this.handleToolCalls(r,n,o,e,s,c);default:throw this.turn.status="error",new LA({message:"Unknown server side error occurred. Please try again.",responseIsFiltered:!1})}}async handleToolCalls(e,r,n,o,s,c){if(e.type!=="tool_calls")throw new Error(`Expected tool_calls type but got ${e.type}`);if(!e.toolCalls)throw new Error("Tool calls are required but were not provided");this.turnContext.setCopilotEditsSessionHeader(e.copilotEditsSessionHeader);let l=e.toolCalls.map(u=>{if(!u.id){let d=`cls_${t.NextToolCallId++}`;u.id=d}return u});this.addToolCallModelResponseToTurn(r,l,e.thinking,c),this.recordAssistantRoundTranscript(r,o,e.thinking),this.recordTrajectorySteps(e);for(let u of l)await this.handleSingleToolCall(u,n,o,s,e.usage);return{response:e,round:{response:r,toolInputRetry:0,toolCalls:l.map(u=>({id:u.id,name:u.function.name,arguments:JSON.stringify(u.function.arguments)})),phase:c}}}async handleSingleToolCall(e,r,n,o,s){if(!e.id)throw new Error(`Tool call id is required but was not provided for function ${e.function.name}`);let c=this.findToolByName(r,e.function.name);if(c instanceof ev)this.handleVirtualToolCall(c,e,n);else if(c instanceof EK)await this.handleLanguageModelToolCall(c,e,n,o,s);else{let l=`Tool with name ${e.function.name} not found in registered tools`;Ig.error(this.turnContext.ctx,l);let u=new Lr([new Rr(l)],"error");this.addToolCallResultToTurn(u,e.id);let d=PXe(u);await this.turnContext.agentToolCalls.error(n,e.id,d.message)}}handleVirtualToolCall(e,r,n){if(!r.id)throw new Error(`Tool call id is required but was not provided for function ${r.function.name}`);let o=performance.now(),s=this.turnContext.ctx.get(XO).didCall(this.turnContext,e.name),c,l;s?(l=s,c=s.status):(c="error",l=new Lr([new Rr(`Failed to activate virtual tool group ${e.name}`)],"error")),this.addToolCallResultToTurn(l,r.id);let u=performance.now()-o;a7t(this.turnContext.ctx,this.turnContext,{name:e.name,type:"virtual",toolProvider:{id:e.metadata.toolsetKey||"virtual"}},r.id,n,u,c,this.baseTelemetryWithExp)}async handleLanguageModelToolCall(e,r,n,o,s){let c=performance.now(),l="success";try{let u=B3(r);this.turnContext.agentToolCalls.init(n,r.id,e.name,e.type,u,this.formatInputForDisplay(u));let d=this.toolsService.prepareInvocation(e.id,{input:u,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o),{needConfirm:f}=await this.prepareToolConfirmation(e,u);await this.requestToolInvocationApproval(d,f,e,u,n,r.id,o),this.abortIfCanceled(o);let h=await this.hookTrigger.firePreToolUseHook(e,u,o,{turn:this.turn,conversationProgress:this.conversationProgress});if(h.denied){Ig.info(this.turnContext.ctx,`Tool execution denied by hook: ${h.reason||"No reason provided"}`),l="cancelled";let A=new Lr([new Rr(h.reason||"Tool execution denied by hook")],"cancelled");this.addToolCallResultToTurn(A,r.id),await this.turnContext.agentToolCalls.cancel(n,r.id);return}let m=d.progressMessage||`Running ${e.displayName} tool`;await this.turnContext.agentToolCalls.running(n,r.id,m),this.recordToolExecutionStartTranscript(r.id,e.name,u);let g=await this.toolsService.invokeTool(this.turnContext,e.id,{toolInvocationToken:r.id,input:u,roundId:n,toolCallId:r.id},o);if(this.abortIfCanceled(o),await this.updateCompletionMessage(e,r,n,o),g.status==="success"){let A=Vxn(g);await this.turnContext.agentToolCalls.result(n,r.id,A)}else if(g.status==="error"){let A=PXe(g);await this.turnContext.agentToolCalls.error(n,r.id,A.message)}else await this.turnContext.agentToolCalls.cancel(n,r.id);await this.hookTrigger.firePostToolUseHook(e,u,g,o,{turn:this.turn,conversationProgress:this.conversationProgress}),this.addToolCallResultToTurn(g,r.id),this.recordSubagentTrajectoryLink(e,g,r.id),this.recordToolInOut(r,u,g,c)}catch(u){if(await this.updateCompletionMessage(e,r,n,o),u instanceof $q||u instanceof Oc)this.turn.status="cancelled",l="cancelled",this.addToolCallResultToTurn(new Lr([new Rr("The user chose to skip the tool call, they want to proceed without running it")],"cancelled"),r.id),await this.turnContext.agentToolCalls.cancel(n,r.id);else{Ig.error(this.turnContext.ctx,`Error while invoking tool ${r.id}: ${Xu(u)}`,u),l="error";let d=new Lr([new Rr(Xu(u).substring(0,300))],"error");this.addToolCallResultToTurn(d,r.id);let f=PXe(d);await this.turnContext.agentToolCalls.error(n,r.id,f.message)}}finally{let u=performance.now()-c;this.recordToolExecutionCompleteTranscript(r.id,l==="success",l),a7t(this.turnContext.ctx,this.turnContext,e,r.id,n,u,l,this.baseTelemetryWithExp)}}async updateCompletionMessage(e,r,n,o){let s=`Ran ${e.displayName} tool`;try{let c=B3(r);s=this.toolsService.prepareCompletion(e.id,{input:c,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o).completionMessage||s}catch(c){Ig.debug(this.turnContext.ctx,`Failed to prepare completion message for tool ${e.id}: ${Xu(c)}, using default message`)}await this.turnContext.agentToolCalls.updateProgressMessage(n,r.id,s)}async getAvailableChatTools(e,r){let n=(await Promise.all(e.map(async c=>this.shouldIncludeTool(c)&&await c.isEnabled(this.turnContext)?c:null))).filter(c=>c!==null),o=this.turnContext.ctx.get(XO);if(o.create(this.turnContext,n),!o.isEnabled(this.turnContext))return n.map(c=>({type:"function",function:{name:c.nameForModel,description:this.getToolDescription(c),parameters:c.inputSchema}}));let s=n;try{s=await o.compute(this.turnContext,r)||[]}catch(c){return Ig.error(this.turnContext.ctx,`Error while computing tool grouping: ${Xu(c)}`),this.abortIfCanceled(r),[]}return s.map(c=>c instanceof ev?{type:"function",function:{name:c.name,description:c.description}}:{type:"function",function:{name:c.nameForModel,description:this.getToolDescription(c),parameters:c.inputSchema}})}getAvailableLanguageModelTools(e){return e.filter(r=>this.shouldIncludeTool(r))}shouldIncludeTool(e){return e.name==="replace_string_in_file"?lwn(this.modelConfiguration):e.name==="apply_patch"?dwn(this.modelConfiguration):!0}getToolDescription(e){return e.name==="manage_todo_list"?WO.getToolDescription(this.modelConfiguration.modelFamily):e.description}createAgentPromptProps(e){return{turnContext:this.turnContext,userRawMessage:this.turnContext.turn.request.message,workspaceFolders:this.turnContext.turn.workspaceFolders,snapshotTextDocumentProvider:this.snapshotTextDocumentProvider,tools:e,modelConfiguration:this.modelConfiguration,codesearchMode:this.turnContext.turn.chatMode?.kind==="Ask",hasSearchSubagent:this.cachedHasSearchSubagent??!1}}addToolCallModelResponseToTurn(e,r,n,o){let s={role:"assistant",content:e,tool_calls:r.length?r:void 0,thinking:n,phase:o,modelId:this.modelConfiguration.modelId};this.turn.response?this.turn.response.message=oq(this.turn.response.message,s):this.turn.response={message:[s],type:"model"}}addToolCallResultToTurn(e,r){let n="";switch(e.status){case"error":n="Tool call failed with error: ";break;case"cancelled":n="Tool call is cancelled with result: ";break;default:case"success":n=""}let o=n+GO(e.content),s={role:"tool",content:o,tool_call_id:r};if(!this.turn.response)this.turn.response={message:[s],type:"model"};else{if(TK(this.turn.response.message)&&this.turn.response.message.find(l=>l.role==="tool"&&l.tool_call_id===r)){Ig.info(this.turnContext.ctx,`Tool call result for ${r} already exists in the turn response. Ignoring the new one.`);return}this.turn.response.message=oq(this.turn.response.message,s)}}findToolByName(e,r){return this.turnContext.ctx.get(XO).findTool(this.turnContext,r)??e.find(n=>n.nameForModel===r)}async prepareToolConfirmation(e,r){return this.turnContext.ctx.get(yJ).checkApproval(this.turnContext,e,r)}async buildTerminalCommandData(e,r){if(!e.id.includes("run_in_terminal"))return;let n=r.command,o=this.turnContext.ctx.get(tT),c=pJ(e.description)||"sh",{subCommands:l,commandNames:u}=await o.parseTerminalCommand(n,c);return{subCommands:l,commandNames:u}}buildSensitiveFileData(e,r){if(!YO.isPotentiallySensitiveTool(e))return;let n=YO.getMatchingRuleForToolCall(e,r,this.turnContext),o=YO.extractFilePathForMetadata(e,r);if(o)return{filePath:o.filePath,matchingRule:n?.rule.pattern,ruleDescription:n?.rule.description,isGlobal:n?n.isOutsideWorkspace:void 0}}abortIfCanceled(e){if(e.isCancellationRequested)throw this.turn.status="cancelled",new Oc}async requestToolInvocationApproval(e,r,n,o,s,c,l){if(!r){Ig.debug(this.turnContext.ctx,`Tool call confirmation not required for ${n.id}`);return}let u=YO.generateSensitiveConfirmationMessage(n,o,this.turnContext);u&&(e.confirmationMessages={title:u.title,message:u.message});let d=e.confirmationMessages??{title:`Run ${n.id}`,message:`Do you want to allow "${n.id}" to run?`},f=await this.buildTerminalCommandData(n,o),h=this.buildSensitiveFileData(n,o),m=f||h?{terminalCommandData:f,sensitiveFileData:h}:void 0,g=nwn(n.name),A=n.type==="mcp"?"mcp_tool":g!=="unknown"?g:n.type==="client"?"safe_tool":"unknown",y=A==="terminal"?pJ(n.description)||"sh":void 0,E=await this.toolsService.invokeToolConfirmation(this.turnContext,n.id,{title:d.title,message:d.message,input:{...o,toolType:A,...y?{commandLineType:y}:{},...n.type==="mcp"?{mcpServerName:n.toolProvider.id,mcpToolName:n.name,mcpType:"tool"}:{}},roundId:s,toolCallId:c,annotations:n.annotations,toolMetadata:m},l);switch(E.result){case"dismiss":throw this.turn.status="cancelled",new $q("Cancelled by user");case"accept":return Promise.resolve();default:throw new $q(`Invalid confirmation result ${E.result}`)}}async validateIteration(e,r,n){if(!(!r||e<=this.maxToolCallingLoop)){if(Ig.debug(this.turnContext.ctx,`Tool calling loop exceeds configured max iterations ${this.maxToolCallingLoop} for turn ${this.turn.id}`),this.turn.isSubagent()&&this.subagentConfig?.allowIterationExtension!==!1&&await this.requestAdditionalToolIterations(e,n)){let s=this.maxToolCallingLoop;this.maxToolCallingLoop=this.maxToolCallingLoop+this.requestLimitIncrement,Ig.debug(this.turnContext.ctx,`Tool calling loop limit increased from ${s} to ${this.maxToolCallingLoop} for turn ${this.turn.id}`);return}throw new uF}}async requestAdditionalToolIterations(e,r){this.abortIfCanceled(r);let n;try{n=this.turnContext.ctx.get(qd)}catch(s){return Ig.error(this.turnContext.ctx,`Tool confirmation invoker unavailable: ${Xu(s)}, stopping tool calling loop.`),!1}let o=`cls_${t.NextToolCallId++}`;try{let s=await n.invokeClientToolConfirmation(this.turnContext,{name:sns,title:"Continue to iterate?",message:"Copilot has been working on this problem for a while. Do you want it to continue to iterate? You can also set the maximum request limit in settings.",input:void 0,conversationId:this.conversation.id,turnId:this.turn.id,roundId:e,toolCallId:o});return this.abortIfCanceled(r),s.result==="accept"}catch(s){return Ig.error(this.turnContext.ctx,`Failed to request continuation confirmation: ${Xu(s)}`),!1}}checkChatPayload(e){if(e.messages.length===0)throw new LA({message:"No messages provided",responseIsFiltered:!1});if(e.tools&&e.tools.length>128)throw new LA({message:`You may not include more than ${128} tools in your request.`,responseIsFiltered:!1})}formatInputForDisplay(e){try{return JSON.stringify(e,null,2)}catch{return}}async checkCompressionAfterToolCall(e){try{await this.turnContext.ctx.get(ZC).checkAndCompress(this.conversation,this.modelConfiguration,"post-tool-call",e,String(this.turn.id))}catch(r){Ig.error(this.turnContext.ctx,`Post-tool-call compression check failed: ${Xu(r)}`)}}recordAssistantRoundTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o={text:e,iterationNumber:r};n&&(o.thinking={id:n.id,text:Array.isArray(n.text)?n.text.join(""):n.text});let s=dXe(e,String(this.turn.id),null,o);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,s).catch(c=>{ot.error(this.turnContext.ctx,`Failed to record assistant round transcript: ${c instanceof Error?c.message:String(c)}`)})}catch(o){ot.error(this.turnContext.ctx,`Failed to create assistant round transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordRenderedUserMessageTranscript(e){if(this.transcriptPersistence.isEnabled())try{let r=yxn(String(this.turn.id),e);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r).catch(n=>{ot.error(this.turnContext.ctx,`Failed to record rendered user message transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){ot.error(this.turnContext.ctx,`Failed to create rendered user message transcript event: ${r instanceof Error?r.message:String(r)}`)}}recordToolExecutionStartTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o=Exn(e,r,n);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,o).catch(s=>{ot.error(this.turnContext.ctx,`Failed to record tool execution start transcript: ${s instanceof Error?s.message:String(s)}`)})}catch(o){ot.error(this.turnContext.ctx,`Failed to create tool execution start transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordToolExecutionCompleteTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o=this.turnContext.agentToolCalls.getToolCallById(e),s=o?{result:o.result,error:o.error,resultDetails:o.resultDetails,toolSpecificData:o.toolSpecificData,progressMessage:o.progressMessage}:void 0,c=_xn(e,r,s,null,{status:n.toString()});this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,c).catch(l=>{ot.error(this.turnContext.ctx,`Failed to record tool execution complete transcript: ${l instanceof Error?l.message:String(l)}`)})}catch(o){ot.error(this.turnContext.ctx,`Failed to create tool execution complete transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordTrajectorySteps(e){if(!this.llmRequestPersistence?.isEnabled()||e.type!=="tool_calls"||!e.toolCalls)return;let r=this.turnContext.subagentInfo,n=e.toolCalls.map(o=>({tool:o.function.name,tool_call_id:o.id}));Jae(()=>this.llmRequestPersistence?.appendTrajectoryStep({tool_calls:n,input_tokens:e.usage?.prompt_tokens,output_tokens:e.usage?.completion_tokens,cached_input_tokens:e.usage?.prompt_tokens_details?.cached_tokens,loop_type:r?"subagent":"parent",subagent_name:r?.name,loop_order:this.nextTrajectoryOrder++,conversationId:this.conversation.id.toString(),turnId:this.turn.id.toString()}),o=>ot.debug(this.turnContext.ctx,"Failed to record trajectory step",o))}recordSubagentTrajectoryLink(e,r,n){if(e.name!=="run_subagent"||!this.llmRequestPersistence?.isEnabled()||!n)return;let o=r.subagentConversationId,s=r.subagentTurnId;!o||!s||Jae(()=>this.llmRequestPersistence?.appendSubagentLink({type:"subagent_link",tool_call_id:n,subagent_conversationId:o,subagent_turnId:s,conversationId:this.conversation.id.toString(),turnId:this.turn.id.toString()}),c=>ot.debug(this.turnContext.ctx,"Failed to record subagent link",c))}recordToolInOut(e,r,n,o){if(!this.llmRequestPersistence?.isEnabled()||!e.id)return;let s=GO(n.content),c=Math.round(performance.now()-o);Jae(()=>this.llmRequestPersistence?.appendToolInOut({tool_call_id:e.id,tool:e.function.name,input:r,output:s,status:n.status,timestamp:new Date().toISOString(),duration_ms:c}),l=>ot.debug(this.turnContext.ctx,"Failed to record tool-in-out entry",l))}};var eWt=class{static{a(this,"DummyProgressHandler")}async begin(){}async report(){}async end(){}async cancel(){}},tWt=class{constructor(e,r){this.handler=e;this.parentTurnId=r}static{a(this,"SubagentProgressHandler")}async begin(e,r,n,o){await this.handler.begin(e,r,n,{...o,parentTurnId:this.parentTurnId})}async report(e,r,n,o){await this.handler.report(e,r,n,{...o,parentTurnId:this.parentTurnId})}async end(e,r,n,o){await this.handler.end(e,r,n,o)}async cancel(e,r,n,o){await this.handler.cancel(e,r,n,o)}};function dQt(t){let e=t.match(/^(.+?)\s*\(([^)]+)\)$/);return e?{modelName:e[1].trim(),provider:e[2].trim()}:{modelName:t.trim(),provider:""}}a(dQt,"parseModelString");var jet=class{static{a(this,"CustomAgentExecutor")}constructor(e,r){this.config=e,this.subagentConfig=r}async invoke(e,r,n,o){let s=r.task,c=new Xf({message:s,type:"user"}),l=this.config.model||e.turn.userRequestedModel;c.userRequestedModel=l,c.needToolCallConfirmation=r.needToolCallConfirmation,c.workspaceFolder=e.turn.workspaceFolder,c.workspaceFolders=e.turn.workspaceFolders,c.parentTurnId=e.turn.id,c.chatMode=new JIe(this.config);let u=e.toLlmInteraction();c.parentLlmInteraction=u;let d=new lK([c],e.conversation.source,e.conversation.userLanguage),f=new hw(e.ctx,d,c,o||e.cancelationToken),h,m=!1;if(this.config.model){let b=dQt(this.config.model),T=b.modelName.toLowerCase(),w=b.provider.toLowerCase()||"copilot";if(w==="copilot"){let P=(await f.ctx.get(xs).getMetadata()).find(D=>D.name.toLowerCase()===T);if(P)h=await xo.getModelConfigurationById(e.ctx,P.id);else if(T===oKe.toLowerCase())m=!0,h=await xo.getModelConfigurationById(e.ctx,V_,d.id.toString(),iq(d.turns));else throw new Error(`Model "${b.modelName}" not found in available models`)}else{let P=(await new da(f.ctx.get(Yn)).getAllModels(f.ctx)).find(D=>D.provider.toLowerCase()===w&&D.capabilities?.name.toLowerCase()===T);if(P)h=await hO(f.ctx,P.provider,P.name);else throw new Error(`BYOK model "${b.modelName}" with provider "${b.provider}" not found`)}}else this.subagentConfig.resolveModelFamily&&e.turn.resolvedModelConfiguration?.providerName===void 0?h=await ans(e,b=>this.subagentConfig.resolveModelFamily(b)):h=e.turn.resolvedModelConfiguration;f.setResolvedModelConfiguration(h),f.subagentInfo={name:this.config.name,model:m?h.uiName:h.uiName||l,isAutoModel:m};let g=new oc(e.ctx),A=await tl(e.ctx,f,{languageId:""}),y=n||new eWt,E=new tWt(y,e.turn.id);await e.ctx.get(Tc).begin(d,c,E),await new _de(f,g,h,A,this.subagentConfig).run(o||e.cancelationToken),e.ctx.get(Au).transferTurnCredits(String(c.id),String(e.turn.id));let v=c.response?Pn(c.response.message):"";return this.subagentConfig.postProcess&&(v=await this.subagentConfig.postProcess(f,v)),{response:v,conversationId:d.id.toString(),turnId:c.id.toString()}}};async function ans(t,e){let r=t.turn.resolvedModelConfiguration,n=e(r.modelFamily);if(!n||n.length===0)return r;let o=r.originalBillingMultiplier;for(let s of n)try{let c=await xo.resolveModelIdFromFamily(t.ctx,s);if(!c)continue;let l=await xo.getModelConfigurationById(t.ctx,c);if(o!==void 0&&l.originalBillingMultiplier!==void 0&&l.originalBillingMultiplier>o)continue;return l}catch{continue}return r}a(ans,"resolvePreferredSubagentModel");p();p();p();var Jq=de(Io());var Het=class extends lr{static{a(this,"SearchSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,isLastTurn:o}=this.props,s=Pn(r.request.message),c=yO(r.response?.message,!0),l=RO(c,{ctx:e.ctx,identifier:`SearchSubagent Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,Jq.useKeepWith)();return vscpp(vscppf,null,vscpp(Jq.SystemMessage,{priority:1e3},"You are a codebase exploration specialist focused exclusively on searching and analyzing existing code. Your main goal is to explore the codebase based on a query provided by the user.",vscpp("br",null),vscpp("br",null),"Your strengths:",vscpp("br",null),"- Rapidly finding files using file search patterns",vscpp("br",null),"- Searching code and text with powerful text search",vscpp("br",null),"- Reading and analyzing file contents",vscpp("br",null),vscpp("br",null),"## Guidelines",vscpp("br",null),vscpp("br",null),"- For file searches: search broadly when you don't know where something lives. Use read file when you know the specific file path.",vscpp("br",null),"- For analysis: Start broad and narrow down. Use multiple search strategies if the first doesn't yield results.",vscpp("br",null),"- Be thorough: Check multiple locations, consider different naming conventions, look for related files.",vscpp("br",null),vscpp("br",null),"IMPORTANT: You are meant to be a fast agent that returns output as quickly as possible. In order to achieve this you must:",vscpp("br",null),"- Make efficient use of the tools at your disposal: be smart about how you search for files and implementations.",vscpp("br",null),"- Wherever possible you should try to spawn multiple parallel tool calls for searching and reading files.",vscpp("br",null),"- Maximum of ",this.props.maxSearchTurns," tool-calling rounds is allowed to complete the task.",vscpp("br",null),vscpp("br",null),"## Required Output",vscpp("br",null),vscpp("br",null),"End your response with an optional brief explanation of your findings (3 sentences max), followed by a tag containing absolute file paths and line ranges of relevant code snippets.",vscpp("br",null),vscpp("br",null),"Output Example:",vscpp("br",null),"The core routing logic lives in two files.",vscpp("br",null),vscpp("br",null),"",vscpp("br",null),"/absolute/path/to/file.py:10-20 (Optional Brief Reason)",vscpp("br",null),"/absolute/path/to/another/file.cc:100-120",vscpp("br",null),""),vscpp(Jq.UserMessage,{priority:950},vscpp(Hn,{name:"environment_info"},vscpp(jq,{ctx:e.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Hq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}),vscpp(tde,{ctx:e.ctx,workspaceFolders:r.workspaceFolders,maxSize:2e3,excludeDotFiles:!0}))),vscpp(Jq.UserMessage,{priority:900},vscpp(vscppf,null,s)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(rw,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`SearchSubagent-${r.id}`})),o&&vscpp(Jq.UserMessage,{priority:900},vscpp(vscppf,null,"CRITICAL: Your allotted iterations are finished. Do NOT make any more tool calls. You MUST immediately output your final results using the format described above. If you call any tool instead of responding, your results will be lost and the caller will receive an error. If you are not confident in your results, state what was unclear or incomplete so the caller can narrow down the search or continue from where you left off.")))}};var rWt=10,cns=new Set(["file_search","grep_search","read_file"]),Get=class{constructor(){this.allowIterationExtension=!1;this.hideReplyText=!0}static{a(this,"SearchSubagentConfig")}resolveModelFamily(e){return[Rn.ClaudeHaiku45,Rn.Gemini3Flash]}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,maxSearchTurns:rWt,isLastTurn:o.oneBasedIterationNum>rWt};return ap.create(Het,s,n)}filterTools(e){return e.filter(r=>cns.has(r.name))}getMaxRounds(){return rWt+1}};p();var xJ=de(Io());var $et=class extends lr{static{a(this,"RunSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,agentName:o,agentInstruction:s}=this.props,c=yO(r.response?.message,!0),l=RO(c,{ctx:e.ctx,identifier:`Subagent "${o}" Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,xJ.useKeepWith)(),d=Pn(r.request.message);return vscpp(vscppf,null,vscpp(xJ.SystemMessage,{priority:1e3},vscpp(ide,null),vscpp("br",null),vscpp("br",null),'You are "',o,'", a specialized agent. Follow your instructions carefully and complete the assigned task.',s&&vscpp(vscppf,null,vscpp("br",null),vscpp("br",null),s),vscpp("br",null),vscpp("br",null),"When you complete your task, provide a clear, concise summary of what you accomplished. Do not include unnecessary preamble."),vscpp(xJ.UserMessage,{priority:950},vscpp(Hn,{name:"environment_info"},vscpp(jq,{ctx:e.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(Hq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}))),vscpp(xJ.UserMessage,{priority:900},vscpp(vscppf,null,d)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(rw,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`Subagent-${o}-${r.id}`})))}};var nWt=class{constructor(e){this.agentConfig=e}static{a(this,"DefaultSubagentConfig")}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,agentName:this.agentConfig.name,agentInstruction:this.agentConfig.instruction};return ap.create($et,s,n)}};function KRn(t){return t.isBuiltIn&&t.name==="Search"?new Get:new nWt(t)}a(KRn,"resolveSubagentConfig");var vde=class extends vu{constructor(){super({name:"run_subagent",displayName:"Run Sub Agent",description:`Launch a new agent to handle complex, multi-step tasks autonomously. +`}]})}throw s}}async runOne(e,r){this.abortIfCanceled(r);let n=this.toolsService.getToolsForModel(this.turnContext.turn.chatMode),o=this.getAvailableLanguageModelTools(n),s;if(this.subagentConfig){let D=this.subagentConfig.filterTools?.(o);D!==void 0&&(o=D),s=this.subagentConfig.createPromptRenderer(this.turnContext,o,this.modelConfiguration,{oneBasedIterationNum:e,maxRounds:this.maxToolCallingLoop})}else{let D=this.createAgentPromptProps(o);s=up.create(Qet,D,this.modelConfiguration)}let c=this.cachedUseMessagesEndpoint,l=DYe(this.modelConfiguration,c),u=await s.renderPrompt(void 0,r,{collapseSystemMessages:!0,enableCacheBreakpoints:c}),d=u.messages,f=u.promptTsxRemovedNodeCount??0;if(e===1&&!this.turn.renderedUserMessage)for(let D=d.length-1;D>=0;D--){let N=d[D];if(N.role==="user"&&N.content){this.turn.renderedUserMessage=N.content,this.recordRenderedUserMessageTranscript(N.content);break}}let h="",m=new Uq((D,N,L,B,j,M)=>{let O=D.trim(),q=O.match(cwe)!==null&&O.endsWith("-->")||!!this.subagentConfig?.hideReplyText;this.conversationProgress.report(this.conversation,this.turn,{annotations:N,references:L,hideText:q,notifications:B.map(Q=>({severity:"warning",message:Q.message})),thinking:M,editAgentRounds:[{roundId:e,reply:q?"":D}]}),this.turn.annotations.push(...N??[]),h+=D});this.abortIfCanceled(r);let g=await this.getAvailableChatTools(o,r);this.abortIfCanceled(r);let A=this.metricsTracker.computePromptPrefixMetrics(d,g),y=this.metricsTracker.computeContextManagement(this.conversation.currentPartitionId,f),E={messages:d,modelConfiguration:this.modelConfiguration,uiKind:"agentPanel",chatModeKind:this.turnContext.turn.chatMode?.kind,tools:g,intentParams:{intent:!0},llmInteraction:this.turnContext.toLlmInteraction(),endpoint:l,turnId:String(this.turn.id)};this.checkChatPayload(E),kg.debug(this.turnContext.ctx,`Send request for iteration ${e} for turn ${this.turn.id} with: ${JSON.stringify(E,null,2)}`);let _,v=this.metricsTracker.getTimeSinceLastLLMCall(),b=performance.now(),T=30,w={shouldRetry:a(D=>D.type==="failed"&&D.code===429&&D.retryAfter!==void 0&&D.retryAfter>=0&&D.retryAfter<=T,"shouldRetry"),onRetry:a(async D=>{let N=D.type==="failed"?D.retryAfter:void 0;N!==void 0&&(kg.info(this.turnContext.ctx,`Rate limited in iteration ${e} for turn ${this.turn.id}, retrying in ${N}s`),await this.turnContext.warn("Service is busy. Retrying shortly \u2014 you can cancel anytime."))},"onRetry"),maxRetryAttempts:3},R=await this.chatFetcher.fetchResponse(E,r,this.baseTelemetryWithExp,(D,N)=>(N.phase&&(_=N.phase),m.isFinishedAfter(D,N)),this.llmRequestPersistence,w),x=performance.now()-b;if(this.metricsTracker.recordLlmFetchComplete(),R.type==="length"){if(this.addToolCallModelResponseToTurn(h,[],R.thinking,_),this.recordAssistantRoundTranscript(h,e,R.thinking),this.maxOutputTokenRecoveryCount0?await this.handleToolCalls({type:"tool_calls",requestId:r.requestId,toolCalls:r.toolCalls,copilotEditsSessionHeader:r.copilotEditsSessionHeader,thinking:r.thinking,usage:r.usage},n,o,e,s,c):(this.turn.status="success",this.addToolCallModelResponseToTurn(n,[],r.thinking,c),this.recordAssistantRoundTranscript(n,e,r.thinking),{response:r,round:{response:r.value,toolInputRetry:0,toolCalls:[],phase:c}});case"offTopic":throw this.turn.status="off-topic",new UA({message:"Sorry, but I can only assist with programming related questions.",responseIsFiltered:!0});case"canceled":throw new Uc;case"failed":throw this.turn.status="error",kg.error(this.turnContext.ctx,"Fetch failed:",r),new UA({message:Y_.translateErrorMessage(r.code,r.reason,r.requestId,r.retryAfter,r.ghRequestId,{capiErrorCode:r.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===K_,copilotPlan:dx(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:r.code,retryAfter:r.retryAfter});case"filtered":throw this.turn.status="filtered",new UA({message:"Oops, your response got filtered.",responseIsFiltered:!0});case"length":throw this.turn.status="error",new UA({message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0});case"agentAuthRequired":throw this.turn.status="error",new UA({message:"Authorization required",responseIsFiltered:!1});case"no_choices":throw this.turn.status="error",new UA({message:"Oops, no choices received from the server. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0});case"no_finish_reason":throw this.turn.status="error",new UA({message:"Oops, unexpected end of stream. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0});case"model_not_supported":{this.turn.status="error";let{modelName:l,modelProviderName:u}=xo.parseModelNotSupportedReason(r.reason);throw new UA({message:"Oops, the model is not supported. Please try again.",code:400,reason:"model_not_supported",responseIsFiltered:!1,modelName:l,modelProviderName:u})}case"model_max_prompt_tokens_exceeded":throw this.turn.status="error",new UA({message:"Oops, the token limit exceeded. Try to shorten your prompt or start a new conversation.",responseIsFiltered:!1});case"tool_calls":return await this.handleToolCalls(r,n,o,e,s,c);default:throw this.turn.status="error",new UA({message:"Unknown server side error occurred. Please try again.",responseIsFiltered:!1})}}async handleToolCalls(e,r,n,o,s,c){if(e.type!=="tool_calls")throw new Error(`Expected tool_calls type but got ${e.type}`);if(!e.toolCalls)throw new Error("Tool calls are required but were not provided");this.turnContext.setCopilotEditsSessionHeader(e.copilotEditsSessionHeader);let l=e.toolCalls.map(u=>{if(!u.id){let d=`cls_${t.NextToolCallId++}`;u.id=d}return u});this.addToolCallModelResponseToTurn(r,l,e.thinking,c),this.recordAssistantRoundTranscript(r,o,e.thinking),this.recordTrajectorySteps(e);for(let u of l)await this.handleSingleToolCall(u,n,o,s,e.usage);return{response:e,round:{response:r,toolInputRetry:0,toolCalls:l.map(u=>({id:u.id,name:u.function.name,arguments:JSON.stringify(u.function.arguments)})),phase:c}}}async handleSingleToolCall(e,r,n,o,s){if(!e.id)throw new Error(`Tool call id is required but was not provided for function ${e.function.name}`);let c=this.findToolByName(r,e.function.name);if(c instanceof iv)this.handleVirtualToolCall(c,e,n);else if(c instanceof kK)await this.handleLanguageModelToolCall(c,e,n,o,s);else{let l=`Tool with name ${e.function.name} not found in registered tools`;kg.error(this.turnContext.ctx,l);let u=new Fr([new Pr(l)],"error");this.addToolCallResultToTurn(u,e.id);let d=oet(u);await this.turnContext.agentToolCalls.error(n,e.id,d.message)}}handleVirtualToolCall(e,r,n){if(!r.id)throw new Error(`Tool call id is required but was not provided for function ${r.function.name}`);let o=performance.now(),s=this.turnContext.ctx.get(s5).didCall(this.turnContext,e.name),c,l;s?(l=s,c=s.status):(c="error",l=new Fr([new Pr(`Failed to activate virtual tool group ${e.name}`)],"error")),this.addToolCallResultToTurn(l,r.id);let u=performance.now()-o;X7t(this.turnContext.ctx,this.turnContext,{name:e.name,type:"virtual",toolProvider:{id:e.metadata.toolsetKey||"virtual"}},r.id,n,u,c,this.baseTelemetryWithExp)}async handleLanguageModelToolCall(e,r,n,o,s){let c=performance.now(),l="success";try{let u=$3(r);this.turnContext.agentToolCalls.init(n,r.id,e.name,e.type,u,this.formatInputForDisplay(u));let d=this.toolsService.prepareInvocation(e.id,{input:u,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o),{needConfirm:f}=await this.prepareToolConfirmation(e,u);await this.requestToolInvocationApproval(d,f,e,u,n,r.id,o),this.abortIfCanceled(o);let h=await this.hookTrigger.firePreToolUseHook(e,u,o,{turn:this.turn,conversationProgress:this.conversationProgress});if(h.denied){kg.info(this.turnContext.ctx,`Tool execution denied by hook: ${h.reason||"No reason provided"}`),l="cancelled";let A=new Fr([new Pr(h.reason||"Tool execution denied by hook")],"cancelled");this.addToolCallResultToTurn(A,r.id),await this.turnContext.agentToolCalls.cancel(n,r.id);return}let m=d.progressMessage||`Running ${e.displayName} tool`;await this.turnContext.agentToolCalls.running(n,r.id,m),this.recordToolExecutionStartTranscript(r.id,e.name,u);let g=await this.toolsService.invokeTool(this.turnContext,e.id,{toolInvocationToken:r.id,input:u,roundId:n,toolCallId:r.id},o);if(this.abortIfCanceled(o),await this.updateCompletionMessage(e,r,n,o),g.status==="success"){let A=bRn(g);await this.turnContext.agentToolCalls.result(n,r.id,A)}else if(g.status==="error"){let A=oet(g);await this.turnContext.agentToolCalls.error(n,r.id,A.message)}else await this.turnContext.agentToolCalls.cancel(n,r.id);await this.hookTrigger.firePostToolUseHook(e,u,g,o,{turn:this.turn,conversationProgress:this.conversationProgress}),this.addToolCallResultToTurn(g,r.id),this.recordSubagentTrajectoryLink(e,g,r.id),this.recordToolInOut(r,u,g,c)}catch(u){if(await this.updateCompletionMessage(e,r,n,o),u instanceof ij||u instanceof Uc)this.turn.status="cancelled",l="cancelled",this.addToolCallResultToTurn(new Fr([new Pr("The user chose to skip the tool call, they want to proceed without running it")],"cancelled"),r.id),await this.turnContext.agentToolCalls.cancel(n,r.id);else{kg.error(this.turnContext.ctx,`Error while invoking tool ${r.id}: ${rd(u)}`,u),l="error";let d=new Fr([new Pr(rd(u).substring(0,300))],"error");this.addToolCallResultToTurn(d,r.id);let f=oet(d);await this.turnContext.agentToolCalls.error(n,r.id,f.message)}}finally{let u=performance.now()-c;this.recordToolExecutionCompleteTranscript(r.id,l==="success",l),X7t(this.turnContext.ctx,this.turnContext,e,r.id,n,u,l,this.baseTelemetryWithExp)}}async updateCompletionMessage(e,r,n,o){let s=`Ran ${e.displayName} tool`;try{let c=$3(r);s=this.toolsService.prepareCompletion(e.id,{input:c,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o).completionMessage||s}catch(c){kg.debug(this.turnContext.ctx,`Failed to prepare completion message for tool ${e.id}: ${rd(c)}, using default message`)}await this.turnContext.agentToolCalls.updateProgressMessage(n,r.id,s)}async getAvailableChatTools(e,r){let n=(await Promise.all(e.map(async c=>this.shouldIncludeTool(c)&&await c.isEnabled(this.turnContext)?c:null))).filter(c=>c!==null),o=this.turnContext.ctx.get(s5);if(o.create(this.turnContext,n),!o.isEnabled(this.turnContext))return n.map(c=>({type:"function",function:{name:c.nameForModel,description:this.getToolDescription(c),parameters:c.inputSchema}}));let s=n;try{s=await o.compute(this.turnContext,r)||[]}catch(c){return kg.error(this.turnContext.ctx,`Error while computing tool grouping: ${rd(c)}`),this.abortIfCanceled(r),[]}return s.map(c=>c instanceof iv?{type:"function",function:{name:c.name,description:c.description}}:{type:"function",function:{name:c.nameForModel,description:this.getToolDescription(c),parameters:c.inputSchema}})}getAvailableLanguageModelTools(e){return e.filter(r=>this.shouldIncludeTool(r))}shouldIncludeTool(e){return e.name==="replace_string_in_file"?QRn(this.modelConfiguration):e.name==="apply_patch"?jRn(this.modelConfiguration):!0}getToolDescription(e){return e.name==="manage_todo_list"?XO.getToolDescription(this.modelConfiguration.modelFamily):e.description}createAgentPromptProps(e){return{turnContext:this.turnContext,userRawMessage:this.turnContext.turn.request.message,workspaceFolders:this.turnContext.turn.workspaceFolders,snapshotTextDocumentProvider:this.snapshotTextDocumentProvider,tools:e,modelConfiguration:this.modelConfiguration,codesearchMode:this.turnContext.turn.chatMode?.kind==="Ask",hasSearchSubagent:this.cachedHasSearchSubagent??!1}}addToolCallModelResponseToTurn(e,r,n,o){let s={role:"assistant",content:e,tool_calls:r.length?r:void 0,thinking:n,phase:o,modelId:this.modelConfiguration.modelId};this.turn.response?this.turn.response.message=yq(this.turn.response.message,s):this.turn.response={message:[s],type:"model"}}addToolCallResultToTurn(e,r){let n="";switch(e.status){case"error":n="Tool call failed with error: ";break;case"cancelled":n="Tool call is cancelled with result: ";break;default:case"success":n=""}let o=n+KO(e.content),s={role:"tool",content:o,tool_call_id:r};if(!this.turn.response)this.turn.response={message:[s],type:"model"};else{if(OK(this.turn.response.message)&&this.turn.response.message.find(l=>l.role==="tool"&&l.tool_call_id===r)){kg.info(this.turnContext.ctx,`Tool call result for ${r} already exists in the turn response. Ignoring the new one.`);return}this.turn.response.message=yq(this.turn.response.message,s)}}findToolByName(e,r){return this.turnContext.ctx.get(s5).findTool(this.turnContext,r)??e.find(n=>n.nameForModel===r)}async prepareToolConfirmation(e,r){return this.turnContext.ctx.get(wJ).checkApproval(this.turnContext,e,r)}async buildTerminalCommandData(e,r){if(!e.id.includes("run_in_terminal"))return;let n=r.command,o=this.turnContext.ctx.get(cT),c=bJ(e.description)||"sh",{subCommands:l,commandNames:u}=await o.parseTerminalCommand(n,c);return{subCommands:l,commandNames:u}}buildSensitiveFileData(e,r){if(!t5.isPotentiallySensitiveTool(e))return;let n=t5.getMatchingRuleForToolCall(e,r,this.turnContext),o=t5.extractFilePathForMetadata(e,r);if(o)return{filePath:o.filePath,matchingRule:n?.rule.pattern,ruleDescription:n?.rule.description,isGlobal:n?n.isOutsideWorkspace:void 0}}abortIfCanceled(e){if(e.isCancellationRequested)throw this.turn.status="cancelled",new Uc}async requestToolInvocationApproval(e,r,n,o,s,c,l){if(!r){kg.debug(this.turnContext.ctx,`Tool call confirmation not required for ${n.id}`);return}let u=t5.generateSensitiveConfirmationMessage(n,o,this.turnContext);u&&(e.confirmationMessages={title:u.title,message:u.message});let d=e.confirmationMessages??{title:`Run ${n.id}`,message:`Do you want to allow "${n.id}" to run?`},f=await this.buildTerminalCommandData(n,o),h=this.buildSensitiveFileData(n,o),m=f||h?{terminalCommandData:f,sensitiveFileData:h}:void 0,g=MRn(n.name),A=n.type==="mcp"?"mcp_tool":g!=="unknown"?g:n.type==="client"?"safe_tool":"unknown",y=A==="terminal"?bJ(n.description)||"sh":void 0,E=await this.toolsService.invokeToolConfirmation(this.turnContext,n.id,{title:d.title,message:d.message,input:{...o,toolType:A,...h?.filePath?{filePath:h.filePath}:{},...y?{commandLineType:y}:{},...n.type==="mcp"?{mcpServerName:n.toolProvider.id,mcpToolName:n.name,mcpType:"tool"}:{}},roundId:s,toolCallId:c,annotations:n.annotations,toolMetadata:m},l);switch(E.result){case"dismiss":throw this.turn.status="cancelled",new ij("Cancelled by user");case"accept":return Promise.resolve();default:throw new ij(`Invalid confirmation result ${E.result}`)}}async validateIteration(e,r,n){if(!(!r||e<=this.maxToolCallingLoop)){if(kg.debug(this.turnContext.ctx,`Tool calling loop exceeds configured max iterations ${this.maxToolCallingLoop} for turn ${this.turn.id}`),this.turn.isSubagent()&&this.subagentConfig?.allowIterationExtension!==!1&&await this.requestAdditionalToolIterations(e,n)){let s=this.maxToolCallingLoop;this.maxToolCallingLoop=this.maxToolCallingLoop+this.requestLimitIncrement,kg.debug(this.turnContext.ctx,`Tool calling loop limit increased from ${s} to ${this.maxToolCallingLoop} for turn ${this.turn.id}`);return}throw new yF}}async requestAdditionalToolIterations(e,r){this.abortIfCanceled(r);let n;try{n=this.turnContext.ctx.get(Vd)}catch(s){return kg.error(this.turnContext.ctx,`Tool confirmation invoker unavailable: ${rd(s)}, stopping tool calling loop.`),!1}let o=`cls_${t.NextToolCallId++}`;try{let s=await n.invokeClientToolConfirmation(this.turnContext,{name:dos,title:"Continue to iterate?",message:"Copilot has been working on this problem for a while. Do you want it to continue to iterate? You can also set the maximum request limit in settings.",input:void 0,conversationId:this.conversation.id,turnId:this.turn.id,roundId:e,toolCallId:o});return this.abortIfCanceled(r),s.result==="accept"}catch(s){return kg.error(this.turnContext.ctx,`Failed to request continuation confirmation: ${rd(s)}`),!1}}checkChatPayload(e){if(e.messages.length===0)throw new UA({message:"No messages provided",responseIsFiltered:!1});if(e.tools&&e.tools.length>128)throw new UA({message:`You may not include more than ${128} tools in your request.`,responseIsFiltered:!1})}formatInputForDisplay(e){try{return JSON.stringify(e,null,2)}catch{return}}async checkCompressionAfterToolCall(e){try{await this.turnContext.ctx.get(tb).checkAndCompress(this.conversation,this.modelConfiguration,"post-tool-call",e,String(this.turn.id))}catch(r){kg.error(this.turnContext.ctx,`Post-tool-call compression check failed: ${rd(r)}`)}}recordAssistantRoundTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o={text:e,iterationNumber:r};n&&(o.thinking={id:n.id,text:Array.isArray(n.text)?n.text.join(""):n.text});let s=UXe(e,String(this.turn.id),null,o);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,s).catch(c=>{ot.error(this.turnContext.ctx,`Failed to record assistant round transcript: ${c instanceof Error?c.message:String(c)}`)})}catch(o){ot.error(this.turnContext.ctx,`Failed to create assistant round transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordRenderedUserMessageTranscript(e){if(this.transcriptPersistence.isEnabled())try{let r=zwn(String(this.turn.id),e);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r).catch(n=>{ot.error(this.turnContext.ctx,`Failed to record rendered user message transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){ot.error(this.turnContext.ctx,`Failed to create rendered user message transcript event: ${r instanceof Error?r.message:String(r)}`)}}recordToolExecutionStartTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o=Ywn(e,r,n);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,o).catch(s=>{ot.error(this.turnContext.ctx,`Failed to record tool execution start transcript: ${s instanceof Error?s.message:String(s)}`)})}catch(o){ot.error(this.turnContext.ctx,`Failed to create tool execution start transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordToolExecutionCompleteTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o=this.turnContext.agentToolCalls.getToolCallById(e),s=o?{result:o.result,error:o.error,resultDetails:o.resultDetails,toolSpecificData:o.toolSpecificData,progressMessage:o.progressMessage}:void 0,c=Kwn(e,r,s,null,{status:n.toString()});this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,c).catch(l=>{ot.error(this.turnContext.ctx,`Failed to record tool execution complete transcript: ${l instanceof Error?l.message:String(l)}`)})}catch(o){ot.error(this.turnContext.ctx,`Failed to create tool execution complete transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordTrajectorySteps(e){if(!this.llmRequestPersistence?.isEnabled()||e.type!=="tool_calls"||!e.toolCalls)return;let r=this.turnContext.subagentInfo,n=e.toolCalls.map(o=>({tool:o.function.name,tool_call_id:o.id}));Rle(()=>this.llmRequestPersistence?.appendTrajectoryStep({tool_calls:n,input_tokens:e.usage?.prompt_tokens,output_tokens:e.usage?.completion_tokens,cached_input_tokens:e.usage?.prompt_tokens_details?.cached_tokens,loop_type:r?"subagent":"parent",subagent_name:r?.name,loop_order:this.nextTrajectoryOrder++,conversationId:this.conversation.id.toString(),turnId:this.turn.id.toString()}),o=>ot.debug(this.turnContext.ctx,"Failed to record trajectory step",o))}recordSubagentTrajectoryLink(e,r,n){if(e.name!=="run_subagent"||!this.llmRequestPersistence?.isEnabled()||!n)return;let o=r.subagentConversationId,s=r.subagentTurnId;!o||!s||Rle(()=>this.llmRequestPersistence?.appendSubagentLink({type:"subagent_link",tool_call_id:n,subagent_conversationId:o,subagent_turnId:s,conversationId:this.conversation.id.toString(),turnId:this.turn.id.toString()}),c=>ot.debug(this.turnContext.ctx,"Failed to record subagent link",c))}recordToolInOut(e,r,n,o){if(!this.llmRequestPersistence?.isEnabled()||!e.id)return;let s=KO(n.content),c=Math.round(performance.now()-o);Rle(()=>this.llmRequestPersistence?.appendToolInOut({tool_call_id:e.id,tool:e.function.name,input:r,output:s,status:n.status,timestamp:new Date().toISOString(),duration_ms:c}),l=>ot.debug(this.turnContext.ctx,"Failed to record tool-in-out entry",l))}};var VWt=class{static{a(this,"DummyProgressHandler")}async begin(){}async report(){}async end(){}async cancel(){}},WWt=class{constructor(e,r){this.handler=e;this.parentTurnId=r}static{a(this,"SubagentProgressHandler")}async begin(e,r,n,o){await this.handler.begin(e,r,n,{...o,parentTurnId:this.parentTurnId})}async report(e,r,n,o){await this.handler.report(e,r,n,{...o,parentTurnId:this.parentTurnId})}async end(e,r,n,o){await this.handler.end(e,r,n,o)}async cancel(e,r,n,o){await this.handler.cancel(e,r,n,o)}};function nqt(t){let e=t.match(/^(.+?)\s*\(([^)]+)\)$/);return e?{modelName:e[1].trim(),provider:e[2].trim()}:{modelName:t.trim(),provider:""}}a(nqt,"parseModelString");var gtt=class{static{a(this,"CustomAgentExecutor")}constructor(e,r){this.config=e,this.subagentConfig=r}async invoke(e,r,n,o){let s=r.task,c=new np({message:s,type:"user"}),l=this.config.model||e.turn.userRequestedModel;c.userRequestedModel=l,c.needToolCallConfirmation=r.needToolCallConfirmation,c.workspaceFolder=e.turn.workspaceFolder,c.workspaceFolders=e.turn.workspaceFolders,c.parentTurnId=e.turn.id,c.chatMode=new Axe(this.config);let u=e.toLlmInteraction();c.parentLlmInteraction=u;let d=new vK([c],e.conversation.source,e.conversation.userLanguage),f=new Cw(e.ctx,d,c,o||e.cancelationToken),h,m=!1;if(this.config.model){let b=nqt(this.config.model),T=b.modelName.toLowerCase(),w=b.provider.toLowerCase()||"copilot";if(w==="copilot"){let P=(await f.ctx.get(xs).getMetadata()).find(D=>D.name.toLowerCase()===T);if(P)h=await xo.getModelConfigurationById(e.ctx,P.id);else if(T===NKe.toLowerCase())m=!0,h=await xo.getModelConfigurationById(e.ctx,K_,d.id.toString(),Aq(d.turns));else throw new Error(`Model "${b.modelName}" not found in available models`)}else{let P=(await new $a(f.ctx.get(ti)).getAllModels(f.ctx)).find(D=>D.provider.toLowerCase()===w&&D.capabilities?.name.toLowerCase()===T);if(P)h=await _O(f.ctx,P.provider,P.name);else throw new Error(`BYOK model "${b.modelName}" with provider "${b.provider}" not found`)}}else this.subagentConfig.resolveModelFamily&&e.turn.resolvedModelConfiguration?.providerName===void 0?h=await fos(e,b=>this.subagentConfig.resolveModelFamily(b)):h=e.turn.resolvedModelConfiguration;f.setResolvedModelConfiguration(h),f.subagentInfo={name:this.config.name,model:m?h.uiName:h.uiName||l,isAutoModel:m};let g=new cc(e.ctx),A=await rl(e.ctx,f,{languageId:""}),y=n||new VWt,E=new WWt(y,e.turn.id);await e.ctx.get(wc).begin(d,c,E),await new Pde(f,g,h,A,this.subagentConfig).run(o||e.cancelationToken),e.ctx.get(Eu).transferTurnCredits(String(c.id),String(e.turn.id));let v=c.response?Pn(c.response.message):"";return this.subagentConfig.postProcess&&(v=await this.subagentConfig.postProcess(f,v)),{response:v,conversationId:d.id.toString(),turnId:c.id.toString()}}};async function fos(t,e){let r=t.turn.resolvedModelConfiguration,n=e(r.modelFamily);if(!n||n.length===0)return r;let o=r.originalBillingMultiplier;for(let s of n)try{let c=await xo.resolveModelIdFromFamily(t.ctx,s);if(!c)continue;let l=await xo.getModelConfigurationById(t.ctx,c);if(o!==void 0&&l.originalBillingMultiplier!==void 0&&l.originalBillingMultiplier>o)continue;return l}catch{continue}return r}a(fos,"resolvePreferredSubagentModel");p();p();p();var uj=fe(Io());var Att=class extends lr{static{a(this,"SearchSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,isLastTurn:o}=this.props,s=Pn(r.request.message),c=SO(r.response?.message,!0),l=OO(c,{ctx:e.ctx,identifier:`SearchSubagent Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,uj.useKeepWith)();return vscpp(vscppf,null,vscpp(uj.SystemMessage,{priority:1e3},"You are a codebase exploration specialist focused exclusively on searching and analyzing existing code. Your main goal is to explore the codebase based on a query provided by the user.",vscpp("br",null),vscpp("br",null),"Your strengths:",vscpp("br",null),"- Rapidly finding files using file search patterns",vscpp("br",null),"- Searching code and text with powerful text search",vscpp("br",null),"- Reading and analyzing file contents",vscpp("br",null),vscpp("br",null),"## Guidelines",vscpp("br",null),vscpp("br",null),"- For file searches: search broadly when you don't know where something lives. Use read file when you know the specific file path.",vscpp("br",null),"- For analysis: Start broad and narrow down. Use multiple search strategies if the first doesn't yield results.",vscpp("br",null),"- Be thorough: Check multiple locations, consider different naming conventions, look for related files.",vscpp("br",null),vscpp("br",null),"IMPORTANT: You are meant to be a fast agent that returns output as quickly as possible. In order to achieve this you must:",vscpp("br",null),"- Make efficient use of the tools at your disposal: be smart about how you search for files and implementations.",vscpp("br",null),"- Wherever possible you should try to spawn multiple parallel tool calls for searching and reading files.",vscpp("br",null),"- Maximum of ",this.props.maxSearchTurns," tool-calling rounds is allowed to complete the task.",vscpp("br",null),vscpp("br",null),"## Required Output",vscpp("br",null),vscpp("br",null),"End your response with an optional brief explanation of your findings (3 sentences max), followed by a tag containing absolute file paths and line ranges of relevant code snippets.",vscpp("br",null),vscpp("br",null),"Output Example:",vscpp("br",null),"The core routing logic lives in two files.",vscpp("br",null),vscpp("br",null),"",vscpp("br",null),"/absolute/path/to/file.py:10-20 (Optional Brief Reason)",vscpp("br",null),"/absolute/path/to/another/file.cc:100-120",vscpp("br",null),""),vscpp(uj.UserMessage,{priority:950},vscpp(Hn,{name:"environment_info"},vscpp(tj,{ctx:e.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(rj,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}),vscpp(fde,{ctx:e.ctx,workspaceFolders:r.workspaceFolders,maxSize:2e3,excludeDotFiles:!0}))),vscpp(uj.UserMessage,{priority:900},vscpp(vscppf,null,s)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(uw,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`SearchSubagent-${r.id}`})),o&&vscpp(uj.UserMessage,{priority:900},vscpp(vscppf,null,"CRITICAL: Your allotted iterations are finished. Do NOT make any more tool calls. You MUST immediately output your final results using the format described above. If you call any tool instead of responding, your results will be lost and the caller will receive an error. If you are not confident in your results, state what was unclear or incomplete so the caller can narrow down the search or continue from where you left off.")))}};var zWt=10,pos=new Set(["file_search","grep_search","read_file"]),ytt=class{constructor(){this.allowIterationExtension=!1;this.hideReplyText=!0}static{a(this,"SearchSubagentConfig")}resolveModelFamily(e){return[wn.ClaudeHaiku45,wn.Gemini3Flash]}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,maxSearchTurns:zWt,isLastTurn:o.oneBasedIterationNum>zWt};return up.create(Att,s,n)}filterTools(e){return e.filter(r=>pos.has(r.name))}getMaxRounds(){return zWt+1}};p();var BJ=fe(Io());var Ett=class extends lr{static{a(this,"RunSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,agentName:o,agentInstruction:s}=this.props,c=SO(r.response?.message,!0),l=OO(c,{ctx:e.ctx,identifier:`Subagent "${o}" Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,BJ.useKeepWith)(),d=Pn(r.request.message);return vscpp(vscppf,null,vscpp(BJ.SystemMessage,{priority:1e3},vscpp(mde,null),vscpp("br",null),vscpp("br",null),'You are "',o,'", a specialized agent. Follow your instructions carefully and complete the assigned task.',s&&vscpp(vscppf,null,vscpp("br",null),vscpp("br",null),s),vscpp("br",null),vscpp("br",null),"When you complete your task, provide a clear, concise summary of what you accomplished. Do not include unnecessary preamble."),vscpp(BJ.UserMessage,{priority:950},vscpp(Hn,{name:"environment_info"},vscpp(tj,{ctx:e.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(rj,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}))),vscpp(BJ.UserMessage,{priority:900},vscpp(vscppf,null,d)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(uw,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`Subagent-${o}-${r.id}`})))}};var YWt=class{constructor(e){this.agentConfig=e}static{a(this,"DefaultSubagentConfig")}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,agentName:this.agentConfig.name,agentInstruction:this.agentConfig.instruction};return up.create(Ett,s,n)}};function xPn(t){return t.isBuiltIn&&t.name==="Search"?new ytt:new YWt(t)}a(xPn,"resolveSubagentConfig");var Dde=class extends bu{constructor(){super({name:"run_subagent",displayName:"Run Sub Agent",description:`Launch a new agent to handle complex, multi-step tasks autonomously. The run_subagent tool launches specialized agents that autonomously handle complex tasks. Each agent type has specific capabilities and tools available to it. @@ -3460,9 +3460,9 @@ Usage notes: - Always include a short description (3-5 words) summarizing what the agent will do. - Provide clear, detailed prompts so the agent can work autonomously and return exactly the information you need. - Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, etc.), since it is not aware of the user's intent. -- When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.`,displayDescription:"Delegate work to a specialized agent.",inputSchema:S.Object({task:S.String({description:"A detailed description of the task for the agent to perform. Should be clear and specific about what the agent should accomplish."}),agentName:S.String({description:"The name of the agent to invoke. Must be one of the exact agent names from the available agents list. Do not make up agent names."}),description:S.Optional(S.String({description:"A short (3-5 word) summary of what the agent will do, shown to the user as a progress message."}))})});this.registry=new rde}static{a(this,"RunSubagentTool")}async invoke(r,n,o){let{task:s,agentName:c}=n.input,l=await tl(r.ctx,r),u;try{let d=await this.registry.getAgent(r,c);if(d?.isBuiltIn?l.properties.mode=d.name:l.properties.mode="custom",!d)return l.properties.message="Custom agent not found",eg(r.ctx,"runSubagentTool.error",l),ZI(r.ctx,"runSubagentTool.error",l),new Lr([new Rr(`Custom agent '${c}' not found`)],"error");if(!d.invokePolicy.includes("model"))return l.properties.message="Agent model invocation disabled",eg(r.ctx,"runSubagentTool.error",l),ZI(r.ctx,"runSubagentTool.error",l),new Lr([new Rr(`Agent '${c}' is not available for model invocation`)],"error");u=KRn(d);let f=new jet(d,u),h={task:s,needToolCallConfirmation:r.turn.needToolCallConfirmation},g=r.ctx.get(Tc).getCurrentHandler(r.conversation),A=await f.invoke(r,h,g,o),y=l.extendedBy({modelId:r.turn.getResolvedModelId()??"unknown",modelFamily:r.turn.getResolvedModelFamily()??"unknown"});Et(r.ctx,"runSubagentTool.success",y),ZI(r.ctx,"runSubagentTool.success",y);let E=`This is what has been accomplished by Custom Agent "${c}": +- When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.`,displayDescription:"Delegate work to a specialized agent.",inputSchema:S.Object({task:S.String({description:"A detailed description of the task for the agent to perform. Should be clear and specific about what the agent should accomplish."}),agentName:S.String({description:"The name of the agent to invoke. Must be one of the exact agent names from the available agents list. Do not make up agent names."}),description:S.Optional(S.String({description:"A short (3-5 word) summary of what the agent will do, shown to the user as a progress message."}))})});this.registry=new pde}static{a(this,"RunSubagentTool")}async invoke(r,n,o){let{task:s,agentName:c}=n.input,l=await rl(r.ctx,r),u;try{let d=await this.registry.getAgent(r,c);if(d?.isBuiltIn?l.properties.mode=d.name:l.properties.mode="custom",!d)return l.properties.message="Custom agent not found",rg(r.ctx,"runSubagentTool.error",l),ox(r.ctx,"runSubagentTool.error",l),new Fr([new Pr(`Custom agent '${c}' not found`)],"error");if(!d.invokePolicy.includes("model"))return l.properties.message="Agent model invocation disabled",rg(r.ctx,"runSubagentTool.error",l),ox(r.ctx,"runSubagentTool.error",l),new Fr([new Pr(`Agent '${c}' is not available for model invocation`)],"error");u=xPn(d);let f=new gtt(d,u),h={task:s,needToolCallConfirmation:r.turn.needToolCallConfirmation},g=r.ctx.get(wc).getCurrentHandler(r.conversation),A=await f.invoke(r,h,g,o),y=l.extendedBy({modelId:r.turn.getResolvedModelId()??"unknown",modelFamily:r.turn.getResolvedModelFamily()??"unknown"});ft(r.ctx,"runSubagentTool.success",y),ox(r.ctx,"runSubagentTool.success",y);let E=`This is what has been accomplished by Custom Agent "${c}": -${A.response}`,_=new Lr([new Rr(E)],"success");return _.subagentConversationId=A.conversationId,_.subagentTurnId=A.turnId,_}catch(d){let f="";return d instanceof uF?(l.properties.message="Tool call round exceed",eg(r.ctx,"runSubagentTool.error",l),u?.allowIterationExtension===!1?f=`Agent "${c}" reached its iteration limit and may have returned partial results. Use whatever information was gathered and continue the task yourself.`:f=`Custom Agent "${c}" reached the maximum number of tool calls. The agent may have made partial progress. Break down the task into smaller steps or rephrase your request and try again before you finish the task by yourself. Explain this error and suggest the user to increase the tool request limit in settings before continue.`):f=d instanceof Error?`Error invoking custom agent: ${d.message}`:"An unknown error occurred while invoking the custom agent",n7e(r.ctx,"runSubagentTool.error",d,l.extendedBy({message:f})),new Lr([new Rr(f)],"error")}}prepareInvocation(r,n){let{agentName:o,task:s,description:c}=r.input,l=c||`${s.substring(0,50)}${s.length>50?"...":""}`;return{progressMessage:`${o}: ${l}`}}prepareCompletion(r,n){let{agentName:o}=r.input;return{completionMessage:`Custom agent "${o}" finished execution`}}};p();var wJ=new fe("applyPatchTool"),lns=`Use the \`apply_patch\` tool to edit files. +${A.response}`,_=new Fr([new Pr(E)],"success");return _.subagentConversationId=A.conversationId,_.subagentTurnId=A.turnId,_}catch(d){let f="";return d instanceof yF?(l.properties.message="Tool call round exceed",rg(r.ctx,"runSubagentTool.error",l),u?.allowIterationExtension===!1?f=`Agent "${c}" reached its iteration limit and may have returned partial results. Use whatever information was gathered and continue the task yourself.`:f=`Custom Agent "${c}" reached the maximum number of tool calls. The agent may have made partial progress. Break down the task into smaller steps or rephrase your request and try again before you finish the task by yourself. Explain this error and suggest the user to increase the tool request limit in settings before continue.`):f=d instanceof Error?`Error invoking custom agent: ${d.message}`:"An unknown error occurred while invoking the custom agent",R7e(r.ctx,"runSubagentTool.error",d,l.extendedBy({message:f})),new Fr([new Pr(f)],"error")}}prepareInvocation(r,n){let{agentName:o,task:s,description:c}=r.input,l=c||`${s.substring(0,50)}${s.length>50?"...":""}`;return{progressMessage:`${o}: ${l}`}}prepareCompletion(r,n){let{agentName:o}=r.input;return{completionMessage:`Custom agent "${o}" finished execution`}}};p();var FJ=new pe("applyPatchTool"),hos=`Use the \`apply_patch\` tool to edit files. Your patch language is a stripped-down, file-oriented diff format designed to be easy to parse and safe to apply. You can think of it as a high-level envelope: *** Begin Patch @@ -3531,7 +3531,7 @@ It is important to remember: - Delete File is NOT supported. - You must include a header with your intended action (Add/Update) - You must prefix new lines with \`+\` even when creating a new file -- File references must be ABSOLUTE, NEVER RELATIVE.`,Vet=class extends vu{static{a(this,"ApplyPatchTool")}constructor(){super({name:"apply_patch",displayName:"Apply Patch",description:lns,displayDescription:"Apply a patch to edit a single file in the workspace.",inputSchema:S.Object({input:S.String({description:"The patch content following the apply_patch format specification."}),explanation:S.String({description:"A brief explanation of what the patch accomplishes."}),filePath:S.String({description:"The absolute path of the file for apply_patch tool to edit."})})})}async invoke(e,r,n){let{input:o,explanation:s}=r.input;if(!o)return new Lr([new Rr("Missing patch text")],"error");let c=Iwn(o);if(c.length>0){let h=`Delete file operation is not supported. Files attempted to delete: ${c.join(", ")}. Please use other methods to delete files.`;return wJ.warn(e.ctx,h),new Lr([new Rr(h)],"error")}let l=AJ(o),u=dde(o),d=[...new Set([...l,...u])];if(d.length>1){let h=`Each apply_patch call can only operate on one file. Found ${d.length} files: ${d.join(", ")}. Please use separate apply_patch tool calls for each file.`;return wJ.warn(e.ctx,h),new Lr([new Rr(h)],"error")}let f={};try{wJ.debug(e.ctx,`Start to process apply_patch with explanation: ${s}`);let h=await this.buildCommit(o,f,e,n);return await this.applyCommit(e,r,h,n)}catch(h){if(h instanceof ude)return wJ.warn(e.ctx,`Apply patch failed with InvalidContextError: ${h.message}, kind: ${h.kindForTelemetry}`),new Lr([new Rr(`Applying patch failed: ${h.message}`)],"error");if(h instanceof zO)return wJ.warn(e.ctx,`Apply patch failed with InvalidPatchFormatError: ${h.message}, kind: ${h.kindForTelemetry}`),new Lr([new Rr(`Invalid patch format: ${h.message}`)],"error");if(h instanceof nm)return wJ.warn(e.ctx,`Apply patch failed with DiffError: ${h.message}`),new Lr([new Rr(`Applying patch failed: ${h.message}`)],"error");let m=h instanceof Error?h.message:"An unknown error occurred";return wJ.error(e.ctx,`Apply patch failed with unexpected error: ${m}`),new Lr([new Rr(m)],"error")}}async buildCommit(e,r,n,o){return xwn(e,a(async c=>{if(o.isCancellationRequested)throw new Error("Operation cancelled");let l=id(c,n.uriSchemeCache),d=await n.ctx.get(ii).getOrReadTextDocument({uri:l});if(d.status==="notfound")throw new nm(`File not found: ${c}`);if(d.status==="invalid")throw new nm(`Invalid file: ${c}. Reason: ${d.reason}`);let f=d.document.getText();return r[c]={text:f},{getText:a(()=>f,"getText"),languageId:d.document.detectedLanguageId}},"openFn"))}async applyCommit(e,r,n,o){let s=[],c=[],l=[];for(let[f,h]of Object.entries(n.changes)){if(o.isCancellationRequested)throw new Error("Operation cancelled");switch(h.type){case"add":{let m=await this.invokeClientCreateFileTool(e,r,f,h.newContent??"",o);if(m.status!=="success")return m;c.push(f);break}case"delete":{l.push(f);break}case"update":{let m=h.movePath??f,g=await this.invokeClientEditFileTool(e,r,m,h.newContent??"",r.input.explanation,o);if(g.status!=="success")return g;s.push(m);break}}}let u=[];s.length>0&&u.push(`Edited files: +- File references must be ABSOLUTE, NEVER RELATIVE.`,_tt=class extends bu{static{a(this,"ApplyPatchTool")}constructor(){super({name:"apply_patch",displayName:"Apply Patch",description:hos,displayDescription:"Apply a patch to edit a single file in the workspace.",inputSchema:S.Object({input:S.String({description:"The patch content following the apply_patch format specification."}),explanation:S.String({description:"A brief explanation of what the patch accomplishes."}),filePath:S.String({description:"The absolute path of the file for apply_patch tool to edit."})})})}async invoke(e,r,n){let{input:o,explanation:s}=r.input;if(!o)return new Fr([new Pr("Missing patch text")],"error");let c=nkn(o);if(c.length>0){let h=`Delete file operation is not supported. Files attempted to delete: ${c.join(", ")}. Please use other methods to delete files.`;return FJ.warn(e.ctx,h),new Fr([new Pr(h)],"error")}let l=xJ(o),u=Cde(o),d=[...new Set([...l,...u])];if(d.length>1){let h=`Each apply_patch call can only operate on one file. Found ${d.length} files: ${d.join(", ")}. Please use separate apply_patch tool calls for each file.`;return FJ.warn(e.ctx,h),new Fr([new Pr(h)],"error")}let f={};try{FJ.debug(e.ctx,`Start to process apply_patch with explanation: ${s}`);let h=await this.buildCommit(o,f,e,n);return await this.applyCommit(e,r,h,n)}catch(h){if(h instanceof vde)return FJ.warn(e.ctx,`Apply patch failed with InvalidContextError: ${h.message}, kind: ${h.kindForTelemetry}`),new Fr([new Pr(`Applying patch failed: ${h.message}`)],"error");if(h instanceof e5)return FJ.warn(e.ctx,`Apply patch failed with InvalidPatchFormatError: ${h.message}, kind: ${h.kindForTelemetry}`),new Fr([new Pr(`Invalid patch format: ${h.message}`)],"error");if(h instanceof cm)return FJ.warn(e.ctx,`Apply patch failed with DiffError: ${h.message}`),new Fr([new Pr(`Applying patch failed: ${h.message}`)],"error");let m=h instanceof Error?h.message:"An unknown error occurred";return FJ.error(e.ctx,`Apply patch failed with unexpected error: ${m}`),new Fr([new Pr(m)],"error")}}async buildCommit(e,r,n,o){return ikn(e,a(async c=>{if(o.isCancellationRequested)throw new Error("Operation cancelled");let l=cd(c,n.uriSchemeCache),d=await n.ctx.get(ni).getOrReadTextDocument({uri:l});if(d.status==="notfound")throw new cm(`File not found: ${c}`);if(d.status==="invalid")throw new cm(`Invalid file: ${c}. Reason: ${d.reason}`);let f=d.document.getText();return r[c]={text:f},{getText:a(()=>f,"getText"),languageId:d.document.detectedLanguageId}},"openFn"))}async applyCommit(e,r,n,o){let s=[],c=[],l=[];for(let[f,h]of Object.entries(n.changes)){if(o.isCancellationRequested)throw new Error("Operation cancelled");switch(h.type){case"add":{let m=await this.invokeClientCreateFileTool(e,r,f,h.newContent??"",o);if(m.status!=="success")return m;c.push(f);break}case"delete":{l.push(f);break}case"update":{let m=h.movePath??f,g=await this.invokeClientEditFileTool(e,r,m,h.newContent??"",r.input.explanation,o);if(g.status!=="success")return g;s.push(m);break}}}let u=[];s.length>0&&u.push(`Edited files: ${s.map(f=>` - ${f}`).join(` `)}`),c.length>0&&u.push(`Created files: ${c.map(f=>` - ${f}`).join(` @@ -3539,7 +3539,7 @@ ${c.map(f=>` - ${f}`).join(` ${l.map(f=>` - ${f}`).join(` `)}`);let d=u.length>0?u.join(` -`):"No changes were applied.";return new Lr([new Rr(d)],"success")}async invokeClientEditFileTool(e,r,n,o,s,c){let l=e.ctx.get(gs).getToolByNameAndProvider("insert_edit_into_file",rp);if(!l)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(gs).invokeTool(e,l.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:n,code:o,explanation:s},roundId:r.roundId,toolCallId:r.toolCallId},c)}async invokeClientCreateFileTool(e,r,n,o,s){let c=e.ctx.get(gs).getToolByNameAndProvider("create_file",rp);if(!c)throw new Error("Client tool create_file is not registered");return e.ctx.get(gs).invokeTool(e,c.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:n,content:o},roundId:r.roundId,toolCallId:r.toolCallId},s)}prepareInvocation(e,r){let{input:n}=e;if(!n.input||!n.input.length)return{progressMessage:"Running apply_patch tool"};let o=AJ(n.input),s=dde(n.input),c=[...o,...s];return c.length>0?{progressMessage:`Editing ${c.map(u=>{let d=id(u,e.uriSchemeCache);return BA(d)}).join(", ")} with apply_patch tool`}:{progressMessage:"Running apply_patch tool"}}prepareCompletion(e,r){let{input:n}=e;if(!n.input||!n.input.length)return{completionMessage:"Ran apply_patch tool"};let o=AJ(n.input),s=dde(n.input),c=[...o,...s];return c.length>0?{completionMessage:`Edited ${c.map(u=>{let d=id(u,e.uriSchemeCache);return BA(d)}).join(", ")} with apply_patch tool`}:{completionMessage:"Ran apply_patch tool"}}static toApplyPatchParams(e){if(typeof e.input!="string")throw new Error("input must be a string");if(typeof e.explanation!="string")throw new Error("explanation must be a string");if(typeof e.filePath!="string")throw new Error("filePath must be a string");return{input:e.input,explanation:e.explanation,filePath:e.filePath}}};p();var JRn=require("path");var uns=16,Gwe=class extends vu{static{a(this,"CodebaseTool")}constructor(){super({name:"semantic_search",displayName:"Codebase",description:`Semantic search that finds code by meaning, not exact text. Returns relevant code snippets from the user's workspace. +`):"No changes were applied.";return new Fr([new Pr(d)],"success")}async invokeClientEditFileTool(e,r,n,o,s,c){let l=e.ctx.get(hs).getToolByNameAndProvider("insert_edit_into_file",op);if(!l)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(hs).invokeTool(e,l.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:n,code:o,explanation:s},roundId:r.roundId,toolCallId:r.toolCallId},c)}async invokeClientCreateFileTool(e,r,n,o,s){let c=e.ctx.get(hs).getToolByNameAndProvider("create_file",op);if(!c)throw new Error("Client tool create_file is not registered");return e.ctx.get(hs).invokeTool(e,c.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:n,content:o},roundId:r.roundId,toolCallId:r.toolCallId},s)}prepareInvocation(e,r){let{input:n}=e;if(!n.input||!n.input.length)return{progressMessage:"Running apply_patch tool"};let o=xJ(n.input),s=Cde(n.input),c=[...o,...s];return c.length>0?{progressMessage:`Editing ${c.map(u=>{let d=cd(u,e.uriSchemeCache);return QA(d)}).join(", ")} with apply_patch tool`}:{progressMessage:"Running apply_patch tool"}}prepareCompletion(e,r){let{input:n}=e;if(!n.input||!n.input.length)return{completionMessage:"Ran apply_patch tool"};let o=xJ(n.input),s=Cde(n.input),c=[...o,...s];return c.length>0?{completionMessage:`Edited ${c.map(u=>{let d=cd(u,e.uriSchemeCache);return QA(d)}).join(", ")} with apply_patch tool`}:{completionMessage:"Ran apply_patch tool"}}static toApplyPatchParams(e){if(typeof e.input!="string")throw new Error("input must be a string");if(typeof e.explanation!="string")throw new Error("explanation must be a string");if(typeof e.filePath!="string")throw new Error("filePath must be a string");return{input:e.input,explanation:e.explanation,filePath:e.filePath}}};p();var wPn=require("path");var mos=16,lRe=class extends bu{static{a(this,"CodebaseTool")}constructor(){super({name:"semantic_search",displayName:"Codebase",description:`Semantic search that finds code by meaning, not exact text. Returns relevant code snippets from the user's workspace. When to Use: - Explore unfamiliar codebases @@ -3558,37 +3558,37 @@ Search Strategy: Query Guidelines: - Use keywords that likely appear in code: function names, class names, variable names, error types, package names -- AVOID generic words like "return", "code", "function", "method"`,displayDescription:"Find relevant file chunks, symbols, and other information in your codebase",inputSchema:S.Object({query:S.String({description:'The query keywords to search the codebase for, each keyword separated with space, like: "email message DNS_NAME". IMPORTANT: Use keywords that likely appear in code, such as: exact function names, class names, variable names, error types, package names, or domain-specific technical terms. AVOID generic words like "return", "code", "function", "method" and so on. The more specific your keywords, the better the search results.'}),maxResults:S.Optional(S.Number({description:"Maximum number of code chunks to return. Default is 16. Usually no need to change. Only increase when initial results are insufficient and broader context is required.",minimum:1,maximum:128}))})})}async invoke(e,r,n){if(!r.input.query)throw new Error("Invalid input");let o=e.ctx.get(t2),s=[];if(e.turn.workspaceFolder&&s.push(e.turn.workspaceFolder.uri),e.turn.workspaceFolders)for(let f of e.turn.workspaceFolders)s.includes(f.uri)||s.push(f.uri);let c=r.input.query,l=await o.searchWorkspace({rawQuery:c,resolveQueryAndKeywords:a(async()=>Promise.resolve({rephrasedQuery:c,keywords:this.getKeywordsForContent(c)}),"resolveQueryAndKeywords"),resolveQuery:a(async()=>Promise.resolve(c),"resolveQuery")},{tokenBudget:ebn,maxResults:r.input.maxResults??uns,workspaceFolders:s,source:"codebaseTool"},n);if(l.chunks.length===0)return new Lr([new Rr("No relevant code found")],"success");let u=l.chunks.map(f=>{let h=un(f.chunk.file),m=DA(f.chunk.text);return new Rr(`Here is a potentially relevant text excerpt in \`${h}\` starting at line ${f.chunk.range.startLineNumber-1}: +- AVOID generic words like "return", "code", "function", "method"`,displayDescription:"Find relevant file chunks, symbols, and other information in your codebase",inputSchema:S.Object({query:S.String({description:'The query keywords to search the codebase for, each keyword separated with space, like: "email message DNS_NAME". IMPORTANT: Use keywords that likely appear in code, such as: exact function names, class names, variable names, error types, package names, or domain-specific technical terms. AVOID generic words like "return", "code", "function", "method" and so on. The more specific your keywords, the better the search results.'}),maxResults:S.Optional(S.Number({description:"Maximum number of code chunks to return. Default is 16. Usually no need to change. Only increase when initial results are insufficient and broader context is required.",minimum:1,maximum:128}))})})}async invoke(e,r,n){if(!r.input.query)throw new Error("Invalid input");let o=e.ctx.get(l2),s=[];if(e.turn.workspaceFolder&&s.push(e.turn.workspaceFolder.uri),e.turn.workspaceFolders)for(let f of e.turn.workspaceFolders)s.includes(f.uri)||s.push(f.uri);let c=r.input.query,l=await o.searchWorkspace({rawQuery:c,resolveQueryAndKeywords:a(async()=>Promise.resolve({rephrasedQuery:c,keywords:this.getKeywordsForContent(c)}),"resolveQueryAndKeywords"),resolveQuery:a(async()=>Promise.resolve(c),"resolveQuery")},{tokenBudget:k1n,maxResults:r.input.maxResults??mos,workspaceFolders:s,source:"codebaseTool"},n);if(l.chunks.length===0)return new Fr([new Pr("No relevant code found")],"success");let u=l.chunks.map(f=>{let h=ln(f.chunk.file),m=OA(f.chunk.text);return new Pr(`Here is a potentially relevant text excerpt in \`${h}\` starting at line ${f.chunk.range.startLineNumber-1}: ${m} ${f.chunk.text} -${m}`)}),d=new JQ(u,"success");return d.toolResultMessage=u.length===0?`Searched ${this.getDisplaySearchTarget(r.input)} for "${r.input.query}", no results`:u.length===1?`Searched ${this.getDisplaySearchTarget(r.input)} for "${r.input.query}", 1 result`:`Searched ${this.getDisplaySearchTarget(r.input)} for "${r.input.query}", ${u.length} results`,d.toolResultDetails=l.chunks.map(f=>({type:"fileLocation",value:{uri:f.chunk.file,range:{start:{line:f.chunk.range.startLineNumber,character:f.chunk.range.startColumn},end:{line:f.chunk.range.endLineNumber,character:f.chunk.range.endColumn}}}})),d}prepareInvocation(e,r){return{progressMessage:`Searching ${this.getDisplaySearchTarget(e.input)} for "${e.input.query}"`}}getDisplaySearchTarget(e){let r;return e.scopedDirectories&&e.scopedDirectories.length===1?r=`${(0,JRn.basename)(e.scopedDirectories[0])}`:e.scopedDirectories&&e.scopedDirectories.length>1?r=`${e.scopedDirectories.length} directories`:r="codebase",r}isEnabled(e){if(IP(e.ctx))return Promise.resolve(!1);let r=e.ctx.get(bn).getCapabilities();return Promise.resolve(!!r.watchedFiles)}getKeywordsForContent(e){let r=new Set;for(let n of e.matchAll(/(-?\d*\.\d\w*)|([^`~!@#%^&*()\-=+[{\]}\\|;:'",.<>/?\s]+)/g))r.add(n[0]);return Array.from(r.values(),n=>({keyword:n,variations:[]}))}};p();var Wet=class extends vu{static{a(this,"CreateFileTool")}constructor(){super({name:"create_file",displayName:"Create File",description:"Create a new file in the workspace with the specified content. Use this tool to create new files.",displayDescription:"Create a new file in the workspace.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to create."}),content:S.String({description:"The content to write to the new file."})})})}async invoke(e,r,n){try{let o=await this.invokeClientCreateFileTool(e,r,n);return this.getFinalCreateFileResult(e,r,o)}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Lr([new Rr(s)],"error")}}async invokeClientCreateFileTool(e,r,n){let o=e.ctx.get(gs).getToolByNameAndProvider("create_file",rp);if(!o)throw new Error("Client tool create_file is not registered");return e.ctx.get(gs).invokeTool(e,o.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,content:r.input.content},roundId:r.roundId,toolCallId:r.toolCallId},n)}getFinalCreateFileResult(e,r,n){if(n.status!=="success")return n;let o=nO({uri:id(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"}),s=GO(n.content),c=[];c.push(``),c.push("This is the new file that was created. You can reference this file in future operations.");let l=new VO({code:s,languageId:o,noFilePath:!0});return c.push(...l.renderAsArray()),c.push(""),new Lr([new Rr(c.join(` -`))],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running create_file tool"};let o=id(n.filePath,e.uriSchemeCache);return{progressMessage:`Creating ${BA(o)}`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(qd),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran create_file tool"};let o=id(n.filePath,e.uriSchemeCache);return{completionMessage:`Created ${BA(o)}`}}static toCreateFileParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.content!="string")throw new Error("content must be a string");return{filePath:e.filePath,content:e.content}}};p();p();p();Mo();function RJ(){return Mt()}a(RJ,"uuidV4");p();var oh={FILEPATH:"---FILEPATH",FIND:"---FIND",REPLACE:"---REPLACE",COMPLETE:"---COMPLETE"};function ekn(t){let e=[],r=[],n=[],o,s;for(let c of dns(t))switch(c.marker){case void 0:r=c.content;break;case oh.FILEPATH:o=c.content.join(` -`).trim();break;case oh.FIND:s=ZRn(c.content);break;case oh.REPLACE:if(o&&s){let l=ZRn(c.content);e.push({filePath:o,find:s,replace:l})}o=void 0,s=void 0;break;case oh.COMPLETE:n=c.content;break}return{patches:e,contentBefore:r,contentAfter:n}}a(ekn,"parsePatchResponse");function ZRn(t){if(t.length===0)return[""];let e=[],r=!1,n=0,o=!1,s=/^(`{3,})/;for(let c of t){let l=c.match(s);if(l&&!r)n=l[1].length,r=!0;else if(r){let u=c.match(s);if(u&&u[1].length>=n){o=!0;break}e.push(c)}}return o?e:t}a(ZRn,"extractCodeBlock");function*dns(t){let e=t.split(/\r?\n/),r,n=[];for(let o of e){let s;if(o.startsWith("---")){o.startsWith(oh.FILEPATH)?s=oh.FILEPATH:o.startsWith(oh.FIND)?s=oh.FIND:o.startsWith(oh.REPLACE)?s=oh.REPLACE:o.startsWith(oh.COMPLETE)?s=oh.COMPLETE:s=o,yield{marker:r,content:n},n=[o.substring(s.length)],r=s;continue}n.push(o)}yield{marker:r,content:n}}a(dns,"iterateSections");function fns(t,e){let r=t.split(/\r?\n/),{find:n,replace:o}=e;if(n.length===0)return;let s=pns(r,n);if(s===void 0)return;let{startIndex:c,endIndex:l,indentLevel:u,indentCharCount:d}=s,f="";if(d>0)for(let E=c;E<=l;E++){let _=r[E],v=$we(_);if(v===d&&v<_.length){f=_.substring(0,d);break}}let h=!1;for(let E=c;E<=l&&!h;E++){let _=r[E];if(/^\s*\/\*|^\s*\*/.test(_))continue;let v=$we(_);if(v>0&&v<_.length){h=_.substring(0,v).indexOf(" ")!==-1;break}}let m=mns(o,u,f,h),g=r.slice(0,c),A=r.slice(l+1);return[...g,...m,...A].join(` -`)}a(fns,"applyPatch");function pns(t,e,r=4){if(e.length===0)return;let n=0;for(;n=0&&o>=r&&t.charCodeAt(n)===e.charCodeAt(o);)n--,o--;if(o>=r)return!1;for(;n>=0&&tkn(t.charCodeAt(n));)n--;return n<0}a(XRn,"endsWith");function hns(t,e,r,n=4){let o=Number.MAX_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,c=0;for(let l=e;l<=r;l++){let u=t[l],{level:d,length:f}=rkn(u,n),h=f;if(hs&&zet(t[c-1]);)c--;if(s===c)return[];let l=Number.MAX_SAFE_INTEGER,u=[];for(let f=s;f0)if(m===l)y=r;else{let E=m-l;n?y=r+" ".repeat(E):y=r+" ".repeat(o*E)}else n?y=" ".repeat(A):y=" ".repeat(o*A);d.push(y+h.substring(g))}}return d}a(mns,"adjustIndentation");function nkn(t,e){let r=t;for(let n of e){let o=fns(r,n);o!==void 0&&(r=o)}return r}a(nkn,"applyPatches");p();var gns="InstantApplyChat";function Ans(t){return typeof t=="object"&&t!==null&&typeof t.serviceType=="string"&&typeof t.name=="string"&&typeof t.provider=="string"&&typeof t.capabilities=="object"&&t.capabilities!==null&&typeof t.capabilities.promptStrategy=="string"}a(Ans,"isProxyModel");function yns(t){if(typeof t!="object"||t===null)return[];let e=t;return Array.isArray(e.models)?e.models.filter(Ans):[]}a(yns,"parseProxyModels");var Zq=class{constructor(e){this.ctx=e;this.logger=new fe("ProxyModelService");this.models=[];bs(e,n=>{this.fetchModels(n)});let r=e.get(Qt).getLastToken();r&&this.fetchModels(r)}static{a(this,"ProxyModelService")}get instantApplyModels(){return this.models.filter(e=>e.serviceType===gns)}async fetchModels(e){try{let r=tx(this.ctx,e,"proxy","models"),n=await this.ctx.get(tr).fetch(r,{method:"GET",headers:{Authorization:`Bearer ${e.token}`,...Gy(this.ctx)}});if(!n.ok){this.logger.error(this.ctx,`Failed to fetch proxy models: ${n.status} ${n.statusText}`);return}let o=await n.json();this.logger.debug(this.ctx,`Proxy models response body: ${JSON.stringify(o)}`);let s=yns(o);this.models=s,this.logger.debug(this.ctx,`Fetched ${s.length} proxy models, ${this.instantApplyModels.length} instant-apply`)}catch(r){this.logger.exception(this.ctx,r,"Failed to fetch proxy models")}}};p();var Yet=class extends Error{static{a(this,"CopilotEditsCancelledByUserException")}constructor(){super("Operation cancelled by user"),this.name="CopilotEditsCancelledByUserException"}};p();var gE=class extends Error{static{a(this,"CopilotEditsProcessCodeBlockException")}constructor(e){super(e),this.name="CopilotEditsProcessCodeBlockException"}};p();var kJ=de(Io());var Cde=class extends lr{static{a(this,"CodeMapperFullRewritePrompt")}renderCopilot(e,r){let{existingDocument:n,codeBlock:o,markdownBeforeBlock:s,inProgressRewriteContent:c}=this.props;if(n.status!=="valid")return vscpp(vscppf,null);let l=n.document,u=l.detectedLanguageId,d=l.getText(),f=l.lineCount,h=d.trim().length>0,m=DA(d),g=DA(o);return vscpp(vscppf,null,vscpp(kJ.SystemMessage,{priority:1e3},"You are an AI programming assistant that is specialized in applying code changes to an existing document.",vscpp("br",null),"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null),"The user has a code block that represents a suggestion for a code change and a ",u," file opened in a code editor.",vscpp("br",null),"Rewrite the existing document to fully incorporate the code changes in the provided code block.",vscpp("br",null),"For the response, always follow these instructions:",vscpp("br",null),"1. Analyze the code block and the existing document to decide if the code block should replace existing code or should be inserted.",vscpp("br",null),"2. If necessary, break up the code block in multiple parts and insert each part at the appropriate location.",vscpp("br",null),"3. Preserve whitespace and newlines right after the parts of the file that you modify.",vscpp("br",null),"4. The final result must be syntactically valid, properly formatted, and correctly indented. It should not contain any ",FA," comments.",vscpp("br",null),"5. Finally, provide the fully rewritten file. You must output the complete file.",vscpp("br",null)),vscpp(kJ.UserMessage,{priority:700},h?vscpp(vscppf,null,"I have the following code open in the editor, starting from line 1 to line ",f,".",vscpp("br",null),vscpp(vscppf,null,m,u,vscpp("br",null),d,vscpp("br",null),m),vscpp("br",null)):vscpp(vscppf,null,"I am in an empty editor.",vscpp("br",null)),s&&vscpp(vscppf,null,"This is the description of what the code block changes:",vscpp("br",null),vscpp(Hn,{name:"changeDescription"},vscpp(vscppf,null,s)),vscpp("br",null)),"This is the code block that represents the suggested code change:",vscpp("br",null),vscpp(vscppf,null,g,u,vscpp("br",null),o,vscpp("br",null),g),vscpp("br",null),vscpp(Hn,{name:"userPrompt"},vscpp(vscppf,null,"Provide the fully rewritten file, incorporating the suggested code change. You must produce the complete file."))),c&&vscpp(vscppf,null,vscpp(kJ.AssistantMessage,{priority:800},vscpp(vscppf,null,c)),vscpp(kJ.UserMessage,{priority:900},vscpp(vscppf,null,"Please continue providing the next part of the response."))))}};p();var Jet=de(Io());var iWt=class extends lr{static{a(this,"PatchEditRules")}renderCopilot(){return vscpp(vscppf,null,"When proposing a code change, provide one or more modifications in the following format:",vscpp("br",null),"Each modification consist of three sections headed by `",oh.FILEPATH,"`, `",oh.FIND,"` and `",oh.REPLACE,"`.",vscpp("br",null),"After ",oh.FILEPATH," add the path to the file that needs to be changed.",vscpp("br",null),"After ",oh.FIND," add a code block containing a section of the program that will be replaced.",vscpp("br",null),"Add multiple lines so that a find tool can find and identify a section of the program. Start and end with a line that will not be modified. ",vscpp("br",null),"Include all comments and empty lines exactly as they appear in the original source code. Do not abbreviate any line or summarize the code with `...`. ",vscpp("br",null),"After ",oh.REPLACE," add a code block with the updated version of the original code in the find section. Maintain the same indentation and code style as in the original code.",vscpp("br",null),"After all modifications, add ",oh.COMPLETE,".",vscpp("br",null))}},Ket=class extends lr{static{a(this,"CodeMapperPatchRewritePrompt")}renderCopilot(e,r){let{existingDocument:n,codeBlock:o,markdownBeforeBlock:s}=this.props;if(n.status!=="valid")return vscpp(vscppf,null);let c=n.document,l=c.detectedLanguageId,u=c.getText(),d=c.lineCount,f=DA(u),h=DA(o),m=rs(this.props.uri);return vscpp(vscppf,null,vscpp(Jet.SystemMessage,{priority:1e3},"You are an AI programming assistant that is specialized in applying code changes to an existing document.",vscpp("br",null),"I have a code block that represents a suggestion for a code change and I have a ",l," ","file opened in a code editor.",vscpp("br",null),"I expect you to come up with code changes that apply the code block to the editor.",vscpp("br",null),"I want the changes to be applied in a way that is safe and does not break the existing code, is correctly indented and matching the code style.",vscpp("br",null),"For the response, always follow these instructions:",vscpp("br",null),"1. Analyze the code block, the content of the editor and the current selection to decide if the code block should replace existing code or is to be inserted.",vscpp("br",null),"2. A line comment with `",FA,"` indicates a section of code that has not changed.",vscpp("br",null),"3. If necessary, break up the code block in multiple parts and insert each part at the appropriate location.",vscpp("br",null),"4. If necessary, make changes to other parts in the editor so that the final result is valid, properly formatted and indented.",vscpp("br",null),"5. Finally, provide the code modifications",vscpp("br",null),vscpp(iWt,null),vscpp("br",null),vscpp(WXe,null),vscpp(Hn,{name:"example"},vscpp(Hn,{name:"user"},vscpp(vscppf,null,"I have the following code open in the editor.",vscpp("br",null),"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"```typescript",vscpp("br",null),"import ","{ readFileSync }"," from 'fs';",vscpp("br",null),vscpp("br",null),"class C ","{ }",vscpp("br",null),"```",vscpp("br",null),"This is the code block that represents a suggestion for a code change:",vscpp("br",null),"```typescript",vscpp("br",null),"private _stream: Stream;",vscpp("br",null),"```",vscpp("br",null),"Please find out how the code block can be applied to the editor.")),vscpp(Hn,{name:"assistant"},vscpp(vscppf,null,"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"---FIND",vscpp("br",null),"```",vscpp("br",null),"import { readFileSync } from 'fs';",vscpp("br",null),"```",vscpp("br",null),"---REPLACE",vscpp("br",null),"```",vscpp("br",null),"import { readFileSync } from 'fs';",vscpp("br",null),"import { Stream } from 'stream';",vscpp("br",null),"```",vscpp("br",null),"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"---FIND",vscpp("br",null),"```",vscpp("br",null),"class C ","{ }",vscpp("br",null),"```",vscpp("br",null),"---REPLACE",vscpp("br",null),"```",vscpp("br",null),'class C {"{"}',vscpp("br",null)," private _stream: Stream;",vscpp("br",null),"}",vscpp("br",null),"```",vscpp("br",null),"---COMPLETE"))),vscpp("br",null)),vscpp(Jet.UserMessage,{priority:700},"I have the following code open in the editor, starting from line 1 to line ",d,".",vscpp("br",null),m?`${oh.FILEPATH} ${m}`:"",vscpp("br",null),vscpp(vscppf,null,f,l,vscpp("br",null),u,vscpp("br",null),f),vscpp("br",null),s&&vscpp(vscppf,null,"This is the description of what the code block changes:",vscpp("br",null),vscpp(Hn,{name:"changeDescription"},vscpp(vscppf,null,s)),vscpp("br",null)),"This is the code block that represents the suggested code change:",vscpp("br",null),vscpp(vscppf,null,h,l,vscpp("br",null),o,vscpp("br",null),h),vscpp("br",null),vscpp(Hn,{name:"userPrompt"},vscpp(vscppf,null,"Please find out how the code block can be applied to the editor. Provide the code changes in the format as described above."))))}};p();p();p();p();p();p();var yc=class t{constructor(e,r){this.start=e;this.endExclusive=r;if(e>r)throw new Lc(`Invalid range: ${this.toString()}`)}static{a(this,"OffsetRange")}static fromTo(e,r){return new t(e,r)}static addRange(e,r){let n=0;for(;nr))return new t(e,r)}static ofLength(e){return new t(0,e)}static ofStartAndLength(e,r){return new t(e,e+r)}static emptyAt(e){return new t(e,e)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new t(this.start+e,this.endExclusive+e)}deltaStart(e){return new t(this.start+e,this.endExclusive)}deltaEnd(e){return new t(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Lc(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Lc(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){let r=[];for(let n=this.start;ne.startLineNumber,$le)}static subtract(e,r){return r?e.startLineNumberr)throw new Lc(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=CK(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)this._normalizedRanges.splice(r,0,e);else if(r===n-1){let o=this._normalizedRanges[r];this._normalizedRanges[r]=o.join(e)}else{let o=this._normalizedRanges[r].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(r,n-r,o)}}contains(e){let r=MUt(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=MUt(this._normalizedRanges,n=>n.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;let r=[],n=0,o=0,s=null;for(;n=c.startLineNumber?s=new $l(s.startLineNumber,Math.max(s.endLineNumberExclusive,c.endLineNumberExclusive)):(r.push(s),s=c)}return s!==null&&r.push(s),new t(r)}subtractFrom(e){let r=Yze(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=CK(this._normalizedRanges,c=>c.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)return new t([e]);let o=[],s=e.startLineNumber;for(let c=r;cs&&o.push(new $l(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};var e5=class t{constructor(e,r){this.lineCount=e;this.columnCount=r}static{a(this,"TextLength")}static{this.zero=new t(0,0)}static lengthDiffNonNegative(e,r){return r.isLessThan(e)?t.zero:e.lineCount===r.lineCount?new t(0,r.columnCount-e.columnCount):new t(r.lineCount-e.lineCount,r.columnCount)}static betweenPositions(e,r){return e.lineNumber===r.lineNumber?new t(0,r.column-e.column):new t(r.lineNumber-e.lineNumber,r.column-1)}static fromPosition(e){return new t(e.lineNumber-1,e.column-1)}static ofRange(e){return t.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let r=0,n=0;for(let o of e)o===` -`?(r++,n=0):n++;return new t(r,n)}isZero(){return this.lineCount===0&&this.columnCount===0}isLessThan(e){return this.lineCount!==e.lineCount?this.lineCounte.lineCount:this.columnCount>e.columnCount}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}equals(e){return this.lineCount===e.lineCount&&this.columnCount===e.columnCount}compare(e){return this.lineCount!==e.lineCount?this.lineCount-e.lineCount:this.columnCount-e.columnCount}add(e){return e.lineCount===0?new t(this.lineCount,this.columnCount+e.columnCount):new t(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new Ui(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Ui(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Ui(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return $l.ofLength(1,this.lineCount)}addToPosition(e){return this.lineCount===0?new Yo(e.lineNumber,e.column+this.columnCount):new Yo(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return Ui.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};var Vwe=class{constructor(e){this.text=e;this.lineStartOffsetByLineIdx=[],this.lineEndOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let r=0;r0&&e.charAt(r-1)==="\r"?this.lineEndOffsetByLineIdx.push(r-1):this.lineEndOffsetByLineIdx.push(r));this.lineEndOffsetByLineIdx.push(e.length)}static{a(this,"PositionOffsetTransformer")}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}getOffsetRange(e){return new yc(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getPosition(e){let r=CK(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new Yo(n,o)}getRange(e){return Ui.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return e5.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new e5(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};var oWt=class{constructor(){this._transformer=void 0}static{a(this,"AbstractText")}get endPositionExclusive(){return this.length.addToPosition(new Yo(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getLineLength(e){return this.getValueOfRange(new Ui(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new Vwe(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new Ui(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return uKe(e)}equals(e){return this===e?!0:this.getValue()===e.getValue()}};var mF=class extends oWt{constructor(r){super();this.value=r;this._t=new Vwe(this.value)}static{a(this,"StringText")}getValueOfRange(r){return this._t.getOffsetRange(r).substring(this.value)}get length(){return this._t.textLength}};p();p();p();var Wwe=class{constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new Lc(`Edits must be disjoint and sorted. Found ${n} after ${r}`);r=n.replaceRange.endExclusive}}static{a(this,"BaseEdit")}equals(e){if(this.replacements.length!==e.replacements.length)return!1;for(let r=0;rr.toString()).join(", ")}]`}normalize(){let e=[],r;for(let n of this.replacements)if(!(n.getNewLength()===0&&n.replaceRange.length===0)){if(r&&r.replaceRange.endExclusive===n.replaceRange.start){let o=r.tryJoinTouching(n);if(o){r=o;continue}}r&&e.push(r),r=n}return r&&e.push(r),this._createNew(e)}compose(e){let r=this.normalize(),n=e.normalize();if(r.isEmpty())return n;if(n.isEmpty())return r;let o=[...r.replacements],s=[],c=0;for(let l of n.replacements){for(;;){let h=o[0];if(!h||h.replaceRange.start+c+h.getNewLength()>=l.replaceRange.start)break;o.shift(),s.push(h),c+=h.getNewLength()-h.replaceRange.length}let u=c,d,f;for(;;){let h=o[0];if(!h||h.replaceRange.start+c>l.replaceRange.endExclusive)break;d||(d=h),f=h,o.shift(),c+=h.getNewLength()-h.replaceRange.length}if(!d)s.push(l.delta(-c));else{let h=Math.min(d.replaceRange.start,l.replaceRange.start-u),m=l.replaceRange.start-(d.replaceRange.start+u);if(m>0){let E=d.slice(yc.emptyAt(h),new yc(0,m));s.push(E)}if(!f)throw new Lc("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(yc.ofStartAndLength(f.replaceRange.endExclusive,0),new yc(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new yc(h,l.replaceRange.endExclusive-c),y=l.slice(A,new yc(0,l.getNewLength()));s.push(y)}}for(;;){let l=o.shift();if(!l)break;s.push(l)}return this._createNew(s).normalize()}decomposeSplit(e){let r=[],n=[],o=0;for(let s of this.replacements)e(s)?(r.push(s),o+=s.getNewLength()-s.replaceRange.length):n.push(s.slice(s.replaceRange.delta(o),new yc(0,s.getNewLength())));return{e1:this._createNew(r),e2:this._createNew(n)}}getNewRanges(){let e=[],r=0;for(let n of this.replacements)e.push(yc.ofStartAndLength(n.replaceRange.start+r,n.getNewLength())),r+=n.getLengthDelta();return e}getJoinedReplaceRange(){if(this.replacements.length!==0)return this.replacements[0].replaceRange.join(this.replacements.at(-1).replaceRange)}isEmpty(){return this.replacements.length===0}getLengthDelta(){return txe(this.replacements,e=>e.getLengthDelta())}getNewDataLength(e){return e+this.getLengthDelta()}applyToOffset(e){let r=0;for(let n of this.replacements)if(n.replaceRange.start<=e){if(e ${this.getNewLength()} }`}get isEmpty(){return this.getNewLength()===0&&this.replaceRange.length===0}getRangeAfterReplace(){return new yc(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}},ikn=class t extends Wwe{static{a(this,"Edit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}_createNew(e){return new t(e)}};var ett=class extends Wwe{static{a(this,"BaseStringEdit")}get TReplacement(){throw new Error("TReplacement is not defined for BaseStringEdit")}static composeOrUndefined(e){if(e.length===0)return;let r=e[0];for(let n=1;n" ".repeat(l-c)),o=r.tryRebase(n);if(!o)return;let s=e.tryRebase(o);if(s)return{e1:o,e2:s}}apply(e){let r=[],n=0;for(let o of this.replacements)r.push(e.substring(n,o.replaceRange.start)),r.push(o.newText),n=o.replaceRange.endExclusive;return r.push(e.substring(n)),r.join("")}inverseOnSlice(e){let r=[],n=0;for(let o of this.replacements)r.push(UA.replace(yc.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new tv(r)}inverse(e){return this.inverseOnSlice((r,n)=>e.substring(r,n))}tryRebase(e,r=!0){let n=[],o=0,s=0,c=0;for(;s({txt:e.newText,pos:e.replaceRange.start,len:e.replaceRange.length}))}isNeutralOn(e){return this.replacements.every(r=>r.isNeutralOn(e))}removeCommonSuffixPrefix(e){let r=[];for(let n of this.replacements){let o=n.removeCommonSuffixPrefix(e);o.isEmpty||r.push(o)}return new tv(r)}normalizeEOL(e){return new tv(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=UA.replace(yc.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?tv.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new mF(this.apply(e.value))}mapData(e){return new sWt(this.replacements.map(r=>new bde(r.replaceRange,r.newText,e(r))))}},ttt=class extends Xet{constructor(r,n){super(r);this.newText=n}static{a(this,"BaseStringReplacement")}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(r){return r.substring(0,this.replaceRange.start)+this.newText+r.substring(this.replaceRange.endExclusive)}isNeutralOn(r){return this.newText===r.substring(this.replaceRange.start,this.replaceRange.endExclusive)}removeCommonSuffixPrefix(r){let n=r.substring(this.replaceRange.start,this.replaceRange.endExclusive),o=cue(n,this.newText),s=Math.min(n.length-o,this.newText.length-o,xxe(n,this.newText)),c=new yc(this.replaceRange.start+o,this.replaceRange.endExclusive-s),l=this.newText.substring(o,this.newText.length-s);return new UA(c,l)}normalizeEOL(r){let n=this.newText.replace(/\r\n|\n/g,r);return new UA(this.replaceRange,n)}removeCommonSuffixAndPrefix(r){return this.removeCommonSuffix(r).removeCommonPrefix(r)}removeCommonPrefix(r){let n=this.replaceRange.substring(r),o=cue(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaStart(o),new yc(o,this.newText.length))}removeCommonSuffix(r){let n=this.replaceRange.substring(r),o=xxe(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaEnd(-o),new yc(0,this.newText.length-o))}toEdit(){return new tv([this])}},tv=class t extends ett{static{a(this,"StringEdit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r){return new t([new UA(e,r)])}static insert(e,r){return new t([new UA(yc.emptyAt(e),r)])}static delete(e){return new t([new UA(e,"")])}static fromJson(e){return new t(e.map(UA.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;nnew UA(e.replaceRange,e.newText)))}},bde=class t extends ttt{constructor(r,n,o){super(r,n);this.data=o}static{a(this,"AnnotatedStringReplacement")}static insert(r,n,o){return new t(yc.emptyAt(r),n,o)}static replace(r,n,o){return new t(r,n,o)}static delete(r,n){return new t(r,"",n)}equals(r){return this.replaceRange.equals(r.replaceRange)&&this.newText===r.newText&&this.data===r.data}tryJoinTouching(r){let n=this.data.join(r.data);if(n!==void 0)return new t(this.replaceRange.joinRightTouching(r.replaceRange),this.newText+r.newText,n)}slice(r,n){return new t(r,n?n.substring(this.newText):this.newText,this.data)}};p();var zwe=class t{constructor(e){this.replacements=e;kQt(()=>Pxe(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>AE.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new AE(e,r)])}static insert(e,r){return new t([new AE(Ui.fromPositions(e,e),r)])}normalize(){let e=[];for(let r of this.replacements)if(e.length>0&&e[e.length-1].range.getEndPosition().equals(r.range.getStartPosition())){let n=e[e.length-1];e[e.length-1]=new AE(n.range.plusRange(r.range),n.text+r.text)}else r.isEmpty||e.push(r);return new t(e)}mapPosition(e){let r=0,n=0,o=0;for(let s of this.replacements){let c=s.range.getStartPosition();if(e.isBeforeOrEqual(c))break;let l=s.range.getEndPosition(),u=e5.ofText(s.text);if(e.isBefore(l)){let d=new Yo(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return rtt(d,f)}c.lineNumber+r!==n&&(o=0),r+=u.lineCount-(s.range.endLineNumber-s.range.startLineNumber),u.lineCount===0?l.lineNumber!==c.lineNumber?o+=u.columnCount-(l.column-1):o+=u.columnCount-(l.column-c.column):o=u.columnCount,n=l.lineNumber+r}return new Yo(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof Yo?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof Yo?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return rtt(o,s)}inverseMapPosition(e,r){return this.inverse(r).mapPosition(e)}inverseMapRange(e,r){return this.inverse(r).mapRange(e)}apply(e){let r="",n=new Yo(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=rtt(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=rtt(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new mF(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new AE(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=e5.ofText(s.text),l=Yo.lift({lineNumber:s.range.startLineNumber+n,column:s.range.startColumn+(s.range.startLineNumber===r?o:0)}),u=c.createRange(l);e.push(u),n=u.endLineNumber-s.range.endLineNumber,o=u.endColumn-s.range.endColumn,r=s.range.endLineNumber}return e}toReplacement(e){if(this.replacements.length===0)throw new Lc;if(this.replacements.length===1)return this.replacements[0];let r=this.replacements[0].range.getStartPosition(),n=this.replacements[this.replacements.length-1].range.getEndPosition(),o="";for(let s=0;sr.equals(n))}toString(e){return e===void 0?this.replacements.map(r=>r.toString()).join(` -`):typeof e=="string"?this.toString(new mF(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=Ui.fromPositions(new Yo(Math.max(1,r.range.startLineNumber-1),1),r.range.getStartPosition()),c=e.getValueOfRange(s);c.length>10&&(c="..."+c.substring(c.length-10));let l=Ui.fromPositions(r.range.getEndPosition(),new Yo(r.range.endLineNumber+1,1)),u=e.getValueOfRange(l);u.length>10&&(u=u.substring(0,10)+"...");let d=o;if(d.length>10){let h=Math.floor(5);d=d.substring(0,h)+"..."+d.substring(d.length-h)}let f=r.text;if(f.length>10){let h=Math.floor(5);f=f.substring(0,h)+"..."+f.substring(f.length-h)}return d.length===0?`${c}\u2770${f}\u2771${u}`:`${c}\u2770${d}\u21A6${f}\u2771${u}`}).join(` -`)}},AE=class t{constructor(e,r){this.range=e;this.text=r}static{a(this,"TextReplacement")}static joinReplacements(e,r){if(e.length===0)throw new Lc;if(e.length===1)return e[0];let n=e[0].range.getStartPosition(),o=e[e.length-1].range.getEndPosition(),s="";for(let c=0;c({type:"fileLocation",value:{uri:f.chunk.file,range:{start:{line:f.chunk.range.startLineNumber,character:f.chunk.range.startColumn},end:{line:f.chunk.range.endLineNumber,character:f.chunk.range.endColumn}}}})),d}prepareInvocation(e,r){return{progressMessage:`Searching ${this.getDisplaySearchTarget(e.input)} for "${e.input.query}"`}}getDisplaySearchTarget(e){let r;return e.scopedDirectories&&e.scopedDirectories.length===1?r=`${(0,wPn.basename)(e.scopedDirectories[0])}`:e.scopedDirectories&&e.scopedDirectories.length>1?r=`${e.scopedDirectories.length} directories`:r="codebase",r}isEnabled(e){if(OP(e.ctx))return Promise.resolve(!1);let r=e.ctx.get(kn).getCapabilities();return Promise.resolve(!!r.watchedFiles)}getKeywordsForContent(e){let r=new Set;for(let n of e.matchAll(/(-?\d*\.\d\w*)|([^`~!@#%^&*()\-=+[{\]}\\|;:'",.<>/?\s]+)/g))r.add(n[0]);return Array.from(r.values(),n=>({keyword:n,variations:[]}))}};p();var vtt=class extends bu{static{a(this,"CreateFileTool")}constructor(){super({name:"create_file",displayName:"Create File",description:"Create a new file in the workspace with the specified content. Use this tool to create new files.",displayDescription:"Create a new file in the workspace.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to create."}),content:S.String({description:"The content to write to the new file."})})})}async invoke(e,r,n){try{let o=await this.invokeClientCreateFileTool(e,r,n);return this.getFinalCreateFileResult(e,r,o)}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Fr([new Pr(s)],"error")}}async invokeClientCreateFileTool(e,r,n){let o=e.ctx.get(hs).getToolByNameAndProvider("create_file",op);if(!o)throw new Error("Client tool create_file is not registered");return e.ctx.get(hs).invokeTool(e,o.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,content:r.input.content},roundId:r.roundId,toolCallId:r.toolCallId},n)}getFinalCreateFileResult(e,r,n){if(n.status!=="success")return n;let o=uO({uri:cd(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"}),s=KO(n.content),c=[];c.push(``),c.push("This is the new file that was created. You can reference this file in future operations.");let l=new ZO({code:s,languageId:o,noFilePath:!0});return c.push(...l.renderAsArray()),c.push(""),new Fr([new Pr(c.join(` +`))],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running create_file tool"};let o=cd(n.filePath,e.uriSchemeCache);return{progressMessage:`Creating ${QA(o)}`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Vd),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran create_file tool"};let o=cd(n.filePath,e.uriSchemeCache);return{completionMessage:`Created ${QA(o)}`}}static toCreateFileParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.content!="string")throw new Error("content must be a string");return{filePath:e.filePath,content:e.content}}};p();p();p();Mo();function UJ(){return Nt()}a(UJ,"uuidV4");p();var ch={FILEPATH:"---FILEPATH",FIND:"---FIND",REPLACE:"---REPLACE",COMPLETE:"---COMPLETE"};function PPn(t){let e=[],r=[],n=[],o,s;for(let c of gos(t))switch(c.marker){case void 0:r=c.content;break;case ch.FILEPATH:o=c.content.join(` +`).trim();break;case ch.FIND:s=RPn(c.content);break;case ch.REPLACE:if(o&&s){let l=RPn(c.content);e.push({filePath:o,find:s,replace:l})}o=void 0,s=void 0;break;case ch.COMPLETE:n=c.content;break}return{patches:e,contentBefore:r,contentAfter:n}}a(PPn,"parsePatchResponse");function RPn(t){if(t.length===0)return[""];let e=[],r=!1,n=0,o=!1,s=/^(`{3,})/;for(let c of t){let l=c.match(s);if(l&&!r)n=l[1].length,r=!0;else if(r){let u=c.match(s);if(u&&u[1].length>=n){o=!0;break}e.push(c)}}return o?e:t}a(RPn,"extractCodeBlock");function*gos(t){let e=t.split(/\r?\n/),r,n=[];for(let o of e){let s;if(o.startsWith("---")){o.startsWith(ch.FILEPATH)?s=ch.FILEPATH:o.startsWith(ch.FIND)?s=ch.FIND:o.startsWith(ch.REPLACE)?s=ch.REPLACE:o.startsWith(ch.COMPLETE)?s=ch.COMPLETE:s=o,yield{marker:r,content:n},n=[o.substring(s.length)],r=s;continue}n.push(o)}yield{marker:r,content:n}}a(gos,"iterateSections");function Aos(t,e){let r=t.split(/\r?\n/),{find:n,replace:o}=e;if(n.length===0)return;let s=yos(r,n);if(s===void 0)return;let{startIndex:c,endIndex:l,indentLevel:u,indentCharCount:d}=s,f="";if(d>0)for(let E=c;E<=l;E++){let _=r[E],v=uRe(_);if(v===d&&v<_.length){f=_.substring(0,d);break}}let h=!1;for(let E=c;E<=l&&!h;E++){let _=r[E];if(/^\s*\/\*|^\s*\*/.test(_))continue;let v=uRe(_);if(v>0&&v<_.length){h=_.substring(0,v).indexOf(" ")!==-1;break}}let m=_os(o,u,f,h),g=r.slice(0,c),A=r.slice(l+1);return[...g,...m,...A].join(` +`)}a(Aos,"applyPatch");function yos(t,e,r=4){if(e.length===0)return;let n=0;for(;n=0&&o>=r&&t.charCodeAt(n)===e.charCodeAt(o);)n--,o--;if(o>=r)return!1;for(;n>=0&&DPn(t.charCodeAt(n));)n--;return n<0}a(kPn,"endsWith");function Eos(t,e,r,n=4){let o=Number.MAX_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,c=0;for(let l=e;l<=r;l++){let u=t[l],{level:d,length:f}=NPn(u,n),h=f;if(hs&&Ctt(t[c-1]);)c--;if(s===c)return[];let l=Number.MAX_SAFE_INTEGER,u=[];for(let f=s;f0)if(m===l)y=r;else{let E=m-l;n?y=r+" ".repeat(E):y=r+" ".repeat(o*E)}else n?y=" ".repeat(A):y=" ".repeat(o*A);d.push(y+h.substring(g))}}return d}a(_os,"adjustIndentation");function MPn(t,e){let r=t;for(let n of e){let o=Aos(r,n);o!==void 0&&(r=o)}return r}a(MPn,"applyPatches");p();var vos="InstantApplyChat";function Cos(t){return typeof t=="object"&&t!==null&&typeof t.serviceType=="string"&&typeof t.name=="string"&&typeof t.provider=="string"&&typeof t.capabilities=="object"&&t.capabilities!==null&&typeof t.capabilities.promptStrategy=="string"}a(Cos,"isProxyModel");function bos(t){if(typeof t!="object"||t===null)return[];let e=t;return Array.isArray(e.models)?e.models.filter(Cos):[]}a(bos,"parseProxyModels");var dj=class{constructor(e){this.ctx=e;this.logger=new pe("ProxyModelService");this.models=[];vs(e,n=>{this.fetchModels(n)});let r=e.get(Ft).getLastToken();r&&this.fetchModels(r)}static{a(this,"ProxyModelService")}get instantApplyModels(){return this.models.filter(e=>e.serviceType===vos)}async fetchModels(e){try{let r=ux(this.ctx,e,"proxy","models"),n=await this.ctx.get(nr).fetch(r,{method:"GET",headers:{Authorization:`Bearer ${e.token}`,...zy(this.ctx)}});if(!n.ok){this.logger.error(this.ctx,`Failed to fetch proxy models: ${n.status} ${n.statusText}`);return}let o=await n.json();this.logger.debug(this.ctx,`Proxy models response body: ${JSON.stringify(o)}`);let s=bos(o);this.models=s,this.logger.debug(this.ctx,`Fetched ${s.length} proxy models, ${this.instantApplyModels.length} instant-apply`)}catch(r){this.logger.exception(this.ctx,r,"Failed to fetch proxy models")}}};p();var btt=class extends Error{static{a(this,"CopilotEditsCancelledByUserException")}constructor(){super("Operation cancelled by user"),this.name="CopilotEditsCancelledByUserException"}};p();var vE=class extends Error{static{a(this,"CopilotEditsProcessCodeBlockException")}constructor(e){super(e),this.name="CopilotEditsProcessCodeBlockException"}};p();var QJ=fe(Io());var Nde=class extends lr{static{a(this,"CodeMapperFullRewritePrompt")}renderCopilot(e,r){let{existingDocument:n,codeBlock:o,markdownBeforeBlock:s,inProgressRewriteContent:c}=this.props;if(n.status!=="valid")return vscpp(vscppf,null);let l=n.document,u=l.detectedLanguageId,d=l.getText(),f=l.lineCount,h=d.trim().length>0,m=OA(d),g=OA(o);return vscpp(vscppf,null,vscpp(QJ.SystemMessage,{priority:1e3},"You are an AI programming assistant that is specialized in applying code changes to an existing document.",vscpp("br",null),"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null),"The user has a code block that represents a suggestion for a code change and a ",u," file opened in a code editor.",vscpp("br",null),"Rewrite the existing document to fully incorporate the code changes in the provided code block.",vscpp("br",null),"For the response, always follow these instructions:",vscpp("br",null),"1. Analyze the code block and the existing document to decide if the code block should replace existing code or should be inserted.",vscpp("br",null),"2. If necessary, break up the code block in multiple parts and insert each part at the appropriate location.",vscpp("br",null),"3. Preserve whitespace and newlines right after the parts of the file that you modify.",vscpp("br",null),"4. The final result must be syntactically valid, properly formatted, and correctly indented. It should not contain any ",qA," comments.",vscpp("br",null),"5. Finally, provide the fully rewritten file. You must output the complete file.",vscpp("br",null)),vscpp(QJ.UserMessage,{priority:700},h?vscpp(vscppf,null,"I have the following code open in the editor, starting from line 1 to line ",f,".",vscpp("br",null),vscpp(vscppf,null,m,u,vscpp("br",null),d,vscpp("br",null),m),vscpp("br",null)):vscpp(vscppf,null,"I am in an empty editor.",vscpp("br",null)),s&&vscpp(vscppf,null,"This is the description of what the code block changes:",vscpp("br",null),vscpp(Hn,{name:"changeDescription"},vscpp(vscppf,null,s)),vscpp("br",null)),"This is the code block that represents the suggested code change:",vscpp("br",null),vscpp(vscppf,null,g,u,vscpp("br",null),o,vscpp("br",null),g),vscpp("br",null),vscpp(Hn,{name:"userPrompt"},vscpp(vscppf,null,"Provide the fully rewritten file, incorporating the suggested code change. You must produce the complete file."))),c&&vscpp(vscppf,null,vscpp(QJ.AssistantMessage,{priority:800},vscpp(vscppf,null,c)),vscpp(QJ.UserMessage,{priority:900},vscpp(vscppf,null,"Please continue providing the next part of the response."))))}};p();var Ttt=fe(Io());var KWt=class extends lr{static{a(this,"PatchEditRules")}renderCopilot(){return vscpp(vscppf,null,"When proposing a code change, provide one or more modifications in the following format:",vscpp("br",null),"Each modification consist of three sections headed by `",ch.FILEPATH,"`, `",ch.FIND,"` and `",ch.REPLACE,"`.",vscpp("br",null),"After ",ch.FILEPATH," add the path to the file that needs to be changed.",vscpp("br",null),"After ",ch.FIND," add a code block containing a section of the program that will be replaced.",vscpp("br",null),"Add multiple lines so that a find tool can find and identify a section of the program. Start and end with a line that will not be modified. ",vscpp("br",null),"Include all comments and empty lines exactly as they appear in the original source code. Do not abbreviate any line or summarize the code with `...`. ",vscpp("br",null),"After ",ch.REPLACE," add a code block with the updated version of the original code in the find section. Maintain the same indentation and code style as in the original code.",vscpp("br",null),"After all modifications, add ",ch.COMPLETE,".",vscpp("br",null))}},Stt=class extends lr{static{a(this,"CodeMapperPatchRewritePrompt")}renderCopilot(e,r){let{existingDocument:n,codeBlock:o,markdownBeforeBlock:s}=this.props;if(n.status!=="valid")return vscpp(vscppf,null);let c=n.document,l=c.detectedLanguageId,u=c.getText(),d=c.lineCount,f=OA(u),h=OA(o),m=Us(this.props.uri);return vscpp(vscppf,null,vscpp(Ttt.SystemMessage,{priority:1e3},"You are an AI programming assistant that is specialized in applying code changes to an existing document.",vscpp("br",null),"I have a code block that represents a suggestion for a code change and I have a ",l," ","file opened in a code editor.",vscpp("br",null),"I expect you to come up with code changes that apply the code block to the editor.",vscpp("br",null),"I want the changes to be applied in a way that is safe and does not break the existing code, is correctly indented and matching the code style.",vscpp("br",null),"For the response, always follow these instructions:",vscpp("br",null),"1. Analyze the code block, the content of the editor and the current selection to decide if the code block should replace existing code or is to be inserted.",vscpp("br",null),"2. A line comment with `",qA,"` indicates a section of code that has not changed.",vscpp("br",null),"3. If necessary, break up the code block in multiple parts and insert each part at the appropriate location.",vscpp("br",null),"4. If necessary, make changes to other parts in the editor so that the final result is valid, properly formatted and indented.",vscpp("br",null),"5. Finally, provide the code modifications",vscpp("br",null),vscpp(KWt,null),vscpp("br",null),vscpp(Cet,null),vscpp(Hn,{name:"example"},vscpp(Hn,{name:"user"},vscpp(vscppf,null,"I have the following code open in the editor.",vscpp("br",null),"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"```typescript",vscpp("br",null),"import ","{ readFileSync }"," from 'fs';",vscpp("br",null),vscpp("br",null),"class C ","{ }",vscpp("br",null),"```",vscpp("br",null),"This is the code block that represents a suggestion for a code change:",vscpp("br",null),"```typescript",vscpp("br",null),"private _stream: Stream;",vscpp("br",null),"```",vscpp("br",null),"Please find out how the code block can be applied to the editor.")),vscpp(Hn,{name:"assistant"},vscpp(vscppf,null,"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"---FIND",vscpp("br",null),"```",vscpp("br",null),"import { readFileSync } from 'fs';",vscpp("br",null),"```",vscpp("br",null),"---REPLACE",vscpp("br",null),"```",vscpp("br",null),"import { readFileSync } from 'fs';",vscpp("br",null),"import { Stream } from 'stream';",vscpp("br",null),"```",vscpp("br",null),"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"---FIND",vscpp("br",null),"```",vscpp("br",null),"class C ","{ }",vscpp("br",null),"```",vscpp("br",null),"---REPLACE",vscpp("br",null),"```",vscpp("br",null),'class C {"{"}',vscpp("br",null)," private _stream: Stream;",vscpp("br",null),"}",vscpp("br",null),"```",vscpp("br",null),"---COMPLETE"))),vscpp("br",null)),vscpp(Ttt.UserMessage,{priority:700},"I have the following code open in the editor, starting from line 1 to line ",d,".",vscpp("br",null),m?`${ch.FILEPATH} ${m}`:"",vscpp("br",null),vscpp(vscppf,null,f,l,vscpp("br",null),u,vscpp("br",null),f),vscpp("br",null),s&&vscpp(vscppf,null,"This is the description of what the code block changes:",vscpp("br",null),vscpp(Hn,{name:"changeDescription"},vscpp(vscppf,null,s)),vscpp("br",null)),"This is the code block that represents the suggested code change:",vscpp("br",null),vscpp(vscppf,null,h,l,vscpp("br",null),o,vscpp("br",null),h),vscpp("br",null),vscpp(Hn,{name:"userPrompt"},vscpp(vscppf,null,"Please find out how the code block can be applied to the editor. Provide the code changes in the format as described above."))))}};p();p();p();p();p();p();var Ec=class t{constructor(e,r){this.start=e;this.endExclusive=r;if(e>r)throw new Qc(`Invalid range: ${this.toString()}`)}static{a(this,"OffsetRange")}static fromTo(e,r){return new t(e,r)}static addRange(e,r){let n=0;for(;nr))return new t(e,r)}static ofLength(e){return new t(0,e)}static ofStartAndLength(e,r){return new t(e,e+r)}static emptyAt(e){return new t(e,e)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new t(this.start+e,this.endExclusive+e)}deltaStart(e){return new t(this.start+e,this.endExclusive)}deltaEnd(e){return new t(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Qc(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Qc(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){let r=[];for(let n=this.start;ne.startLineNumber,tue)}static subtract(e,r){return r?e.startLineNumberr)throw new Qc(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=DK(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)this._normalizedRanges.splice(r,0,e);else if(r===n-1){let o=this._normalizedRanges[r];this._normalizedRanges[r]=o.join(e)}else{let o=this._normalizedRanges[r].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(r,n-r,o)}}contains(e){let r=I7t(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=I7t(this._normalizedRanges,n=>n.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;let r=[],n=0,o=0,s=null;for(;n=c.startLineNumber?s=new Wl(s.startLineNumber,Math.max(s.endLineNumberExclusive,c.endLineNumberExclusive)):(r.push(s),s=c)}return s!==null&&r.push(s),new t(r)}subtractFrom(e){let r=CYe(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=DK(this._normalizedRanges,c=>c.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)return new t([e]);let o=[],s=e.startLineNumber;for(let c=r;cs&&o.push(new Wl(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};var c5=class t{constructor(e,r){this.lineCount=e;this.columnCount=r}static{a(this,"TextLength")}static{this.zero=new t(0,0)}static lengthDiffNonNegative(e,r){return r.isLessThan(e)?t.zero:e.lineCount===r.lineCount?new t(0,r.columnCount-e.columnCount):new t(r.lineCount-e.lineCount,r.columnCount)}static betweenPositions(e,r){return e.lineNumber===r.lineNumber?new t(0,r.column-e.column):new t(r.lineNumber-e.lineNumber,r.column-1)}static fromPosition(e){return new t(e.lineNumber-1,e.column-1)}static ofRange(e){return t.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let r=0,n=0;for(let o of e)o===` +`?(r++,n=0):n++;return new t(r,n)}isZero(){return this.lineCount===0&&this.columnCount===0}isLessThan(e){return this.lineCount!==e.lineCount?this.lineCounte.lineCount:this.columnCount>e.columnCount}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}equals(e){return this.lineCount===e.lineCount&&this.columnCount===e.columnCount}compare(e){return this.lineCount!==e.lineCount?this.lineCount-e.lineCount:this.columnCount-e.columnCount}add(e){return e.lineCount===0?new t(this.lineCount,this.columnCount+e.columnCount):new t(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new Fi(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Fi(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Fi(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return Wl.ofLength(1,this.lineCount)}addToPosition(e){return this.lineCount===0?new Yo(e.lineNumber,e.column+this.columnCount):new Yo(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return Fi.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};var dRe=class{constructor(e){this.text=e;this.lineStartOffsetByLineIdx=[],this.lineEndOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let r=0;r0&&e.charAt(r-1)==="\r"?this.lineEndOffsetByLineIdx.push(r-1):this.lineEndOffsetByLineIdx.push(r));this.lineEndOffsetByLineIdx.push(e.length)}static{a(this,"PositionOffsetTransformer")}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}getOffsetRange(e){return new Ec(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getPosition(e){let r=DK(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new Yo(n,o)}getRange(e){return Fi.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return c5.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new c5(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};var JWt=class{constructor(){this._transformer=void 0}static{a(this,"AbstractText")}get endPositionExclusive(){return this.length.addToPosition(new Yo(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getLineLength(e){return this.getValueOfRange(new Fi(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new dRe(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new Fi(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return FKe(e)}equals(e){return this===e?!0:this.getValue()===e.getValue()}};var bF=class extends JWt{constructor(r){super();this.value=r;this._t=new dRe(this.value)}static{a(this,"StringText")}getValueOfRange(r){return this._t.getOffsetRange(r).substring(this.value)}get length(){return this._t.textLength}};p();p();p();var fRe=class{constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new Qc(`Edits must be disjoint and sorted. Found ${n} after ${r}`);r=n.replaceRange.endExclusive}}static{a(this,"BaseEdit")}equals(e){if(this.replacements.length!==e.replacements.length)return!1;for(let r=0;rr.toString()).join(", ")}]`}normalize(){let e=[],r;for(let n of this.replacements)if(!(n.getNewLength()===0&&n.replaceRange.length===0)){if(r&&r.replaceRange.endExclusive===n.replaceRange.start){let o=r.tryJoinTouching(n);if(o){r=o;continue}}r&&e.push(r),r=n}return r&&e.push(r),this._createNew(e)}compose(e){let r=this.normalize(),n=e.normalize();if(r.isEmpty())return n;if(n.isEmpty())return r;let o=[...r.replacements],s=[],c=0;for(let l of n.replacements){for(;;){let h=o[0];if(!h||h.replaceRange.start+c+h.getNewLength()>=l.replaceRange.start)break;o.shift(),s.push(h),c+=h.getNewLength()-h.replaceRange.length}let u=c,d,f;for(;;){let h=o[0];if(!h||h.replaceRange.start+c>l.replaceRange.endExclusive)break;d||(d=h),f=h,o.shift(),c+=h.getNewLength()-h.replaceRange.length}if(!d)s.push(l.delta(-c));else{let h=Math.min(d.replaceRange.start,l.replaceRange.start-u),m=l.replaceRange.start-(d.replaceRange.start+u);if(m>0){let E=d.slice(Ec.emptyAt(h),new Ec(0,m));s.push(E)}if(!f)throw new Qc("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(Ec.ofStartAndLength(f.replaceRange.endExclusive,0),new Ec(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new Ec(h,l.replaceRange.endExclusive-c),y=l.slice(A,new Ec(0,l.getNewLength()));s.push(y)}}for(;;){let l=o.shift();if(!l)break;s.push(l)}return this._createNew(s).normalize()}decomposeSplit(e){let r=[],n=[],o=0;for(let s of this.replacements)e(s)?(r.push(s),o+=s.getNewLength()-s.replaceRange.length):n.push(s.slice(s.replaceRange.delta(o),new Ec(0,s.getNewLength())));return{e1:this._createNew(r),e2:this._createNew(n)}}getNewRanges(){let e=[],r=0;for(let n of this.replacements)e.push(Ec.ofStartAndLength(n.replaceRange.start+r,n.getNewLength())),r+=n.getLengthDelta();return e}getJoinedReplaceRange(){if(this.replacements.length!==0)return this.replacements[0].replaceRange.join(this.replacements.at(-1).replaceRange)}isEmpty(){return this.replacements.length===0}getLengthDelta(){return Cxe(this.replacements,e=>e.getLengthDelta())}getNewDataLength(e){return e+this.getLengthDelta()}applyToOffset(e){let r=0;for(let n of this.replacements)if(n.replaceRange.start<=e){if(e ${this.getNewLength()} }`}get isEmpty(){return this.getNewLength()===0&&this.replaceRange.length===0}getRangeAfterReplace(){return new Ec(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}},OPn=class t extends fRe{static{a(this,"Edit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}_createNew(e){return new t(e)}};var wtt=class extends fRe{static{a(this,"BaseStringEdit")}get TReplacement(){throw new Error("TReplacement is not defined for BaseStringEdit")}static composeOrUndefined(e){if(e.length===0)return;let r=e[0];for(let n=1;n" ".repeat(l-c)),o=r.tryRebase(n);if(!o)return;let s=e.tryRebase(o);if(s)return{e1:o,e2:s}}apply(e){let r=[],n=0;for(let o of this.replacements)r.push(e.substring(n,o.replaceRange.start)),r.push(o.newText),n=o.replaceRange.endExclusive;return r.push(e.substring(n)),r.join("")}inverseOnSlice(e){let r=[],n=0;for(let o of this.replacements)r.push(jA.replace(Ec.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new ov(r)}inverse(e){return this.inverseOnSlice((r,n)=>e.substring(r,n))}tryRebase(e,r=!0){let n=[],o=0,s=0,c=0;for(;s({txt:e.newText,pos:e.replaceRange.start,len:e.replaceRange.length}))}isNeutralOn(e){return this.replacements.every(r=>r.isNeutralOn(e))}removeCommonSuffixPrefix(e){let r=[];for(let n of this.replacements){let o=n.removeCommonSuffixPrefix(e);o.isEmpty||r.push(o)}return new ov(r)}normalizeEOL(e){return new ov(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=jA.replace(Ec.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?ov.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new bF(this.apply(e.value))}mapData(e){return new ZWt(this.replacements.map(r=>new Mde(r.replaceRange,r.newText,e(r))))}},Rtt=class extends xtt{constructor(r,n){super(r);this.newText=n}static{a(this,"BaseStringReplacement")}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(r){return r.substring(0,this.replaceRange.start)+this.newText+r.substring(this.replaceRange.endExclusive)}isNeutralOn(r){return this.newText===r.substring(this.replaceRange.start,this.replaceRange.endExclusive)}removeCommonSuffixPrefix(r){let n=r.substring(this.replaceRange.start,this.replaceRange.endExclusive),o=yue(n,this.newText),s=Math.min(n.length-o,this.newText.length-o,Wxe(n,this.newText)),c=new Ec(this.replaceRange.start+o,this.replaceRange.endExclusive-s),l=this.newText.substring(o,this.newText.length-s);return new jA(c,l)}normalizeEOL(r){let n=this.newText.replace(/\r\n|\n/g,r);return new jA(this.replaceRange,n)}removeCommonSuffixAndPrefix(r){return this.removeCommonSuffix(r).removeCommonPrefix(r)}removeCommonPrefix(r){let n=this.replaceRange.substring(r),o=yue(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaStart(o),new Ec(o,this.newText.length))}removeCommonSuffix(r){let n=this.replaceRange.substring(r),o=Wxe(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaEnd(-o),new Ec(0,this.newText.length-o))}toEdit(){return new ov([this])}},ov=class t extends wtt{static{a(this,"StringEdit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r){return new t([new jA(e,r)])}static insert(e,r){return new t([new jA(Ec.emptyAt(e),r)])}static delete(e){return new t([new jA(e,"")])}static fromJson(e){return new t(e.map(jA.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;nnew jA(e.replaceRange,e.newText)))}},Mde=class t extends Rtt{constructor(r,n,o){super(r,n);this.data=o}static{a(this,"AnnotatedStringReplacement")}static insert(r,n,o){return new t(Ec.emptyAt(r),n,o)}static replace(r,n,o){return new t(r,n,o)}static delete(r,n){return new t(r,"",n)}equals(r){return this.replaceRange.equals(r.replaceRange)&&this.newText===r.newText&&this.data===r.data}tryJoinTouching(r){let n=this.data.join(r.data);if(n!==void 0)return new t(this.replaceRange.joinRightTouching(r.replaceRange),this.newText+r.newText,n)}slice(r,n){return new t(r,n?n.substring(this.newText):this.newText,this.data)}};p();var pRe=class t{constructor(e){this.replacements=e;Cqt(()=>Jxe(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>CE.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new CE(e,r)])}static insert(e,r){return new t([new CE(Fi.fromPositions(e,e),r)])}normalize(){let e=[];for(let r of this.replacements)if(e.length>0&&e[e.length-1].range.getEndPosition().equals(r.range.getStartPosition())){let n=e[e.length-1];e[e.length-1]=new CE(n.range.plusRange(r.range),n.text+r.text)}else r.isEmpty||e.push(r);return new t(e)}mapPosition(e){let r=0,n=0,o=0;for(let s of this.replacements){let c=s.range.getStartPosition();if(e.isBeforeOrEqual(c))break;let l=s.range.getEndPosition(),u=c5.ofText(s.text);if(e.isBefore(l)){let d=new Yo(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return ktt(d,f)}c.lineNumber+r!==n&&(o=0),r+=u.lineCount-(s.range.endLineNumber-s.range.startLineNumber),u.lineCount===0?l.lineNumber!==c.lineNumber?o+=u.columnCount-(l.column-1):o+=u.columnCount-(l.column-c.column):o=u.columnCount,n=l.lineNumber+r}return new Yo(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof Yo?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof Yo?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return ktt(o,s)}inverseMapPosition(e,r){return this.inverse(r).mapPosition(e)}inverseMapRange(e,r){return this.inverse(r).mapRange(e)}apply(e){let r="",n=new Yo(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=ktt(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=ktt(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new bF(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new CE(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=c5.ofText(s.text),l=Yo.lift({lineNumber:s.range.startLineNumber+n,column:s.range.startColumn+(s.range.startLineNumber===r?o:0)}),u=c.createRange(l);e.push(u),n=u.endLineNumber-s.range.endLineNumber,o=u.endColumn-s.range.endColumn,r=s.range.endLineNumber}return e}toReplacement(e){if(this.replacements.length===0)throw new Qc;if(this.replacements.length===1)return this.replacements[0];let r=this.replacements[0].range.getStartPosition(),n=this.replacements[this.replacements.length-1].range.getEndPosition(),o="";for(let s=0;sr.equals(n))}toString(e){return e===void 0?this.replacements.map(r=>r.toString()).join(` +`):typeof e=="string"?this.toString(new bF(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=Fi.fromPositions(new Yo(Math.max(1,r.range.startLineNumber-1),1),r.range.getStartPosition()),c=e.getValueOfRange(s);c.length>10&&(c="..."+c.substring(c.length-10));let l=Fi.fromPositions(r.range.getEndPosition(),new Yo(r.range.endLineNumber+1,1)),u=e.getValueOfRange(l);u.length>10&&(u=u.substring(0,10)+"...");let d=o;if(d.length>10){let h=Math.floor(5);d=d.substring(0,h)+"..."+d.substring(d.length-h)}let f=r.text;if(f.length>10){let h=Math.floor(5);f=f.substring(0,h)+"..."+f.substring(f.length-h)}return d.length===0?`${c}\u2770${f}\u2771${u}`:`${c}\u2770${d}\u21A6${f}\u2771${u}`}).join(` +`)}},CE=class t{constructor(e,r){this.range=e;this.text=r}static{a(this,"TextReplacement")}static joinReplacements(e,r){if(e.length===0)throw new Qc;if(e.length===1)return e[0];let n=e[0].range.getStartPosition(),o=e[e.length-1].range.getEndPosition(),s="";for(let c=0;cr.lineRange.endLineNumberExclusive<=n.lineRange.startLineNumber))}static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>Sde.deserialize(r)))}static fromEdit(e,r){let n=zwe.fromStringEdit(e,r);return t.fromTextEdit(n,r)}static fromTextEdit(e,r){let n=e.replacements,o=[],s=[];for(let c=0;cn.lineRange.startLineNumber,$le)),new t(r)}isEmpty(){return this.replacements.length===0}toEdit(e){let r=[];for(let n of this.replacements){let o=n.toSingleEdit(e);r.push(o)}return new tv(r)}toString(){return this.replacements.map(e=>e.toString()).join(",")}serialize(){return this.replacements.map(e=>e.serialize())}getNewLineRanges(){let e=[],r=0;for(let n of this.replacements)e.push($l.ofLength(n.lineRange.startLineNumber+r,n.newLines.length)),r+=n.newLines.length-n.lineRange.length;return e}mapLineNumber(e){let r=0;for(let n of this.replacements){if(n.lineRange.endLineNumberExclusive>e)break;r+=n.newLines.length-n.lineRange.length}return e+r}mapLineRange(e){return new $l(this.mapLineNumber(e.startLineNumber),this.mapLineNumber(e.endLineNumberExclusive))}mapBackLineRange(e,r){return this.inverse(r).mapLineRange(e)}touches(e){return this.replacements.some(r=>e.replacements.some(n=>r.lineRange.intersect(n.lineRange)))}rebase(e){return new t(this.replacements.map(r=>new Sde(e.mapLineRange(r.lineRange),r.newLines)))}humanReadablePatch(e){let r=[];function n(l,u,d,f){let h=d==="unmodified"?" ":d==="deleted"?"-":"+";f===void 0&&(f="[[[[[ WARNING: LINE DOES NOT EXIST ]]]]]");let m=l===-1?" ":l.toString().padStart(3," "),g=u===-1?" ":u.toString().padStart(3," ");r.push(`${h} ${m} ${g} ${f}`)}a(n,"pushLine");function o(){r.push("---")}a(o,"pushSeperator");let s=0,c=!0;for(let l of FUt(this.replacements,(u,d)=>u.lineRange.distanceToRange(d.lineRange)<=5)){c?c=!1:o();let u=l[0].lineRange.startLineNumber-2;for(let d of l){for(let m=Math.max(1,u);mg)){let g=e[m-1];n(m,-1,"deleted",g)}for(let m=0;mnew Sde(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}},Sde=class t{constructor(e,r){this.lineRange=e;this.newLines=r}static{a(this,"LineReplacement")}static deserialize(e){return new t($l.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=uKe(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Ui.fromPositions(new Yo(e.range.startLineNumber,1),e.range.getStartPosition()));n[0]=s+n[0];let c=e.range.endLineNumber+1,l=r.getTransformer().getLineLength(e.range.endLineNumber)+1,u=r.getValueOfRange(Ui.fromPositions(e.range.getEndPosition(),new Yo(e.range.endLineNumber,l)));n[n.length-1]=n[n.length-1]+u;let d=e.range.startColumn===r.getTransformer().getLineLength(e.range.startLineNumber)+1,f=e.range.endColumn===1;return d&&n[0].length===s.length&&(o++,n.shift()),n.length>0&&o1){let s=this.lineRange.startLineNumber-1,c=e.getTransformer().getLineLength(s)+1;n=new Yo(s,c)}else n=new Yo(1,1);let o=r.addToPosition(new Yo(1,1));return new AE(Ui.fromPositions(n,o),"")}else return new AE(new Ui(this.lineRange.startLineNumber,1,this.lineRange.endLineNumberExclusive,1),"")}else if(this.lineRange.isEmpty){let r,n,o,s=this.lineRange.startLineNumber;return s===e.getTransformer().textLength.lineCount+2?(r=s-1,n=e.getTransformer().getLineLength(r)+1,o=this.newLines.map(c=>` +`),o=yue(r,n);r=r.substring(o),n=n.substring(o);let s=Wxe(r,n);return r=r.substring(0,r.length-s),n=n.substring(0,n.length-s),r===""}};function ktt(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return Fi.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new Qc("start must be before end");return new Fi(t.lineNumber,t.column,e.lineNumber,e.column)}a(ktt,"rangeFromPositions");var hRe=class t{constructor(e){this.replacements=e;YK(Jxe(e,(r,n)=>r.lineRange.endLineNumberExclusive<=n.lineRange.startLineNumber))}static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>Ode.deserialize(r)))}static fromEdit(e,r){let n=pRe.fromStringEdit(e,r);return t.fromTextEdit(n,r)}static fromTextEdit(e,r){let n=e.replacements,o=[],s=[];for(let c=0;cn.lineRange.startLineNumber,tue)),new t(r)}isEmpty(){return this.replacements.length===0}toEdit(e){let r=[];for(let n of this.replacements){let o=n.toSingleEdit(e);r.push(o)}return new ov(r)}toString(){return this.replacements.map(e=>e.toString()).join(",")}serialize(){return this.replacements.map(e=>e.serialize())}getNewLineRanges(){let e=[],r=0;for(let n of this.replacements)e.push(Wl.ofLength(n.lineRange.startLineNumber+r,n.newLines.length)),r+=n.newLines.length-n.lineRange.length;return e}mapLineNumber(e){let r=0;for(let n of this.replacements){if(n.lineRange.endLineNumberExclusive>e)break;r+=n.newLines.length-n.lineRange.length}return e+r}mapLineRange(e){return new Wl(this.mapLineNumber(e.startLineNumber),this.mapLineNumber(e.endLineNumberExclusive))}mapBackLineRange(e,r){return this.inverse(r).mapLineRange(e)}touches(e){return this.replacements.some(r=>e.replacements.some(n=>r.lineRange.intersect(n.lineRange)))}rebase(e){return new t(this.replacements.map(r=>new Ode(e.mapLineRange(r.lineRange),r.newLines)))}humanReadablePatch(e){let r=[];function n(l,u,d,f){let h=d==="unmodified"?" ":d==="deleted"?"-":"+";f===void 0&&(f="[[[[[ WARNING: LINE DOES NOT EXIST ]]]]]");let m=l===-1?" ":l.toString().padStart(3," "),g=u===-1?" ":u.toString().padStart(3," ");r.push(`${h} ${m} ${g} ${f}`)}a(n,"pushLine");function o(){r.push("---")}a(o,"pushSeperator");let s=0,c=!0;for(let l of k7t(this.replacements,(u,d)=>u.lineRange.distanceToRange(d.lineRange)<=5)){c?c=!1:o();let u=l[0].lineRange.startLineNumber-2;for(let d of l){for(let m=Math.max(1,u);mg)){let g=e[m-1];n(m,-1,"deleted",g)}for(let m=0;mnew Ode(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}},Ode=class t{constructor(e,r){this.lineRange=e;this.newLines=r}static{a(this,"LineReplacement")}static deserialize(e){return new t(Wl.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=FKe(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Fi.fromPositions(new Yo(e.range.startLineNumber,1),e.range.getStartPosition()));n[0]=s+n[0];let c=e.range.endLineNumber+1,l=r.getTransformer().getLineLength(e.range.endLineNumber)+1,u=r.getValueOfRange(Fi.fromPositions(e.range.getEndPosition(),new Yo(e.range.endLineNumber,l)));n[n.length-1]=n[n.length-1]+u;let d=e.range.startColumn===r.getTransformer().getLineLength(e.range.startLineNumber)+1,f=e.range.endColumn===1;return d&&n[0].length===s.length&&(o++,n.shift()),n.length>0&&o1){let s=this.lineRange.startLineNumber-1,c=e.getTransformer().getLineLength(s)+1;n=new Yo(s,c)}else n=new Yo(1,1);let o=r.addToPosition(new Yo(1,1));return new CE(Fi.fromPositions(n,o),"")}else return new CE(new Fi(this.lineRange.startLineNumber,1,this.lineRange.endLineNumberExclusive,1),"")}else if(this.lineRange.isEmpty){let r,n,o,s=this.lineRange.startLineNumber;return s===e.getTransformer().textLength.lineCount+2?(r=s-1,n=e.getTransformer().getLineLength(r)+1,o=this.newLines.map(c=>` `+c).join("")):(r=s,n=1,o=this.newLines.map(c=>c+` -`).join("")),new AE(Ui.fromPositions(new Yo(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new Ui(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` -`);return new AE(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new UA(n,r.text)}toString(){return`${this.lineRange}->${JSON.stringify(this.newLines)}`}serialize(){return[this.lineRange.startLineNumber,this.lineRange.endLineNumberExclusive,this.newLines]}removeCommonSuffixPrefixLines(e){let r=this.lineRange.startLineNumber,n=this.lineRange.endLineNumberExclusive,o=0;for(;r{function t(r){return Array.isArray(r)&&r.length===3&&typeof r[0]=="number"&&typeof r[1]=="number"&&Array.isArray(r[2])&&r[2].every(n=>typeof n=="string")}e.is=t,a(t,"is")})(Ens||={});var Tde=class{constructor(e,r){this.originalText=e;this._trackedEdit=r;let n=r.removeCommonSuffixPrefix(e);this._updatedTrackedEdit=n.mapData(()=>new ntt(!0))}static{a(this,"ArcTracker")}handleEdits(e){let r=e.mapData(s=>new ntt(!1)),o=this._updatedTrackedEdit.compose(r).decomposeSplit(s=>!s.data.isTrackedEdit).e2;this._updatedTrackedEdit=o}getTrackedEdit(){return this._updatedTrackedEdit.toStringEdit()}getAcceptedRetainedCharactersCount(){return okn(this._updatedTrackedEdit.replacements,r=>r.getNewLength())}getOriginalCharacterCount(){return okn(this._trackedEdit.replacements,e=>e.getNewLength())}getTrackedEditLineMetrics(){let e=this.getTrackedEdit();if(!e)return{deletedLineCounts:0,insertedLineCounts:0};let r=Ywe.fromEdit(e,new mF(this.originalText)),n=txe(r.replacements,s=>s.lineRange.length),o=txe(r.getNewLineRanges(),s=>s.length);return{deletedLineCounts:n,insertedLineCounts:o}}getDebugState(){return{edits:this._updatedTrackedEdit.replacements.map(e=>({range:e.replaceRange.toString(),newText:e.newText,isTrackedEdit:e.data.isTrackedEdit}))}}},ntt=class{constructor(e){this.isTrackedEdit=e}static{a(this,"IsTrackedEditData")}join(e){if(this.isTrackedEdit===e.isTrackedEdit)return this}};function okn(t,e){let r=0;for(let n of t)r+=e(n);return r}a(okn,"sum");p();var Ide=class{constructor(e,r){this.originalText=e;this._combinedEditsSinceStart=tv.empty;this._debugLog=[];this._text=r.apply(this.originalText),this._textAfterTrackedEdits=this._text,this._originalEdits=r,this._debugLog.push(`[INIT] Original: "${this.originalText}"`),this._debugLog.push(`[INIT] TrackedEdits(${r.replacements.length}): ${this._formatEditsCompact(r,this.originalText)}`),this._debugLog.push(`[INIT] Result: "${this._text}"`),this._debugLog.push("")}static{a(this,"EditSurvivalTracker")}_formatEditsCompact(e,r){return e.replacements.length===0?"[]":e.replacements.map(n=>{let o=r.substring(n.replaceRange.start,n.replaceRange.endExclusive);return`[${n.replaceRange.start}:${n.replaceRange.endExclusive}]"${o}"->"${n.newText}"`}).join(", ")}handleEdits(e){let r=this._text,n=e.apply(this._text),o=this._combinedEditsSinceStart.compose(e);o=o.removeCommonSuffixPrefix(this._textAfterTrackedEdits),this._combinedEditsSinceStart=o,this._text=n,this._debugLog.push(`[EDIT] Input(${e.replacements.length}): ${this._formatEditsCompact(e,r)} -> "${n}"`),this._debugLog.push(`[EDIT] Accumulated(${this._combinedEditsSinceStart.replacements.length}): ${this._formatEditsCompact(this._combinedEditsSinceStart,this._textAfterTrackedEdits)}`)}getCurrentText(){return this._text}getTextAfterMarkedEdits(){return this._textAfterTrackedEdits}getOriginalText(){return this.originalText}getDebugLog(){return this._debugLog.join(` -`)}computeTrackedEditsSurvivalScore(){this._debugLog.push(`[CALC] Current: "${this._text}" | Original: "${this.originalText}"`);let e=0,r=0,n=0,o=0,s=this._originalEdits.getNewRanges(),c=_ns(s,this._combinedEditsSinceStart);this._debugLog.push(`[CALC] Processing ${s.length} edits:`);for(let d=0;d"${m}"->"${A}" | 4gram:${y.toFixed(2)} noRevert:(${E.toFixed(2)},${_.toFixed(2)})`),E!==1){let v=1-Math.max(_-E,0)/(1-E);n+=f.replaceRange.length*v,o+=f.replaceRange.length}e+=f.newText.length*y,r+=f.newText.length}let l=r===0?1:e/r,u=o===0?1:n/o;return this._debugLog.push(`[RESULT] fourGram: ${l.toFixed(3)} (${e.toFixed(1)}/${r.toFixed(1)}) | noRevert: ${u.toFixed(3)} (${n.toFixed(1)}/${o.toFixed(1)})`),{fourGram:l,noRevert:u}}};function aWt(t,e){if(t.length<4||e.length<4)return t===e?1:0;let n=new Map;for(let l=0;l<=t.length-4;l++){let u=t.substring(l,l+4),d=n.get(u)||0;n.set(u,d+1)}for(let l=0;l<=e.length-4;l++){let u=e.substring(l,l+4),d=n.get(u)||0;n.set(u,d-1)}let o=t.length-4+1+e.length-4+1,s=0;for(let l of n.values())s+=Math.abs(l);return(o-s)/o}a(aWt,"compute4GramTextSimilarity");function _ns(t,e){t=t.slice();let r=[],n=0;for(let o of e.replacements){for(;;){let c=t[0];if(!c||c.endExclusive>=o.replaceRange.start)break;t.shift(),r.push(c.delta(n))}let s=[];for(;;){let c=t[0];if(!c||!c.intersectsOrTouches(o.replaceRange))break;t.shift(),s.push(c)}for(let c=s.length-1;c>=0;c--){let l=s[c],u=l.intersect(o.replaceRange).length;l=l.deltaEnd(-u+(c===0?o.newText.length:0));let d=l.start-o.replaceRange.start;d>0&&(l=l.delta(-d)),c!==0&&(l=l.delta(o.newText.length)),l=l.delta(-(o.newText.length-o.replaceRange.length)),t.unshift(l)}n+=o.newText.length-o.replaceRange.length}for(;;){let o=t[0];if(!o)break;t.shift(),r.push(o.delta(n))}return r}a(_ns,"applyEditsToRanges");p();p();var Kwe=class{static{a(this,"OffsetLineColumnConverter")}get lines(){return this._lineStartOffsets.length}constructor(e){this._lineStartOffsets=[0];let r=0;for(;re);r++);let n=e-this._lineStartOffsets[r-1];return new Yo(r,n+1)}startOffsetOfLineContaining(e){let r=1;for(;re);r++);return this._lineStartOffsets[r-1]}positionToOffset(e){return e.lineNumber>=this._lineStartOffsets.length?this._lineStartOffsets[this._lineStartOffsets.length-1]+e.column-1:this._lineStartOffsets[e.lineNumber-1]+e.column-1}};async function itt(t,e,r,n=5e3){let o=await r.computeDiff(t,e,{maxComputationTimeMs:n,computeMoves:!1,ignoreTrimWhitespace:!1}),s=new Kwe(t),c=new Kwe(e),l=[];for(let u of o.changes)for(let d of u.innerChanges??[]){let f=c.positionToOffset(d.modifiedRange.getStartPosition()),h=c.positionToOffset(d.modifiedRange.getEndPosition()),m=e.substring(f,h),g=s.positionToOffset(d.originalRange.getStartPosition()),A=s.positionToOffset(d.originalRange.getEndPosition()),y=new yc(g,A);l.push(new UA(y,m))}return new tv(l)}a(itt,"stringEditFromDiff");p();p();var skn=de(require("path")),akn=require("worker_threads");var cWt=class{constructor(){this.nextId=1;this.handlers=new Map}static{a(this,"RpcResponseHandler")}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};function vns(t){let e={get:a((r,n)=>(typeof n=="string"&&!r[n]&&(r[n]=(...o)=>t(n,o)),r[n]),"get")};return new Proxy(Object.create(null),e)}a(vns,"createRpcProxy");var ott=class{constructor(e,r,n){this.responseHandler=new cWt;this.worker=new akn.Worker(e,r),CIe(this.worker,skn.basename(e,".js")),this.worker.on("message",async o=>{if("fn"in o)try{let s=await n?.[o.fn].apply(n,o.args);this.worker.postMessage({id:o.id,res:s})}catch(s){let c=s instanceof Error?s:new Error(String(s));this.worker.postMessage({id:o.id,err:c})}else this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=vns((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}static{a(this,"WorkerWithRpcProxy")}async terminate(){this.worker.removeAllListeners(),await this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};p();var stt=class t{static{a(this,"MovedText")}constructor(e,r){this.lineRangeMapping=e,this.changes=r}flip(){return new t(this.lineRangeMapping.flip(),this.changes.map(e=>e.flip()))}};p();var Jwe=class t{static{a(this,"LineRangeMapping")}static inverse(e,r,n){let o=[],s=1,c=1;for(let u of e){let d=new t(new $l(s,u.original.startLineNumber),new $l(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new $l(s,r+1),new $l(c,n+1));return l.modified.isEmpty||o.push(l),o}static clip(e,r,n){let o=[];for(let s of e){let c=s.original.intersect(r),l=s.modified.intersect(n);c&&!c.isEmpty&&l&&!l.isEmpty&&o.push(new t(c,l))}return o}constructor(e,r){this.original=e,this.modified=r}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new t(this.modified,this.original)}join(e){return new t(this.original.join(e.original),this.modified.join(e.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){let e=this.original.toInclusiveRange(),r=this.modified.toInclusiveRange();if(e&&r)return new t5(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Lc("not a valid diff");return new t5(new Ui(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Ui(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new t5(new Ui(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new Ui(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(ckn(this.original.endLineNumberExclusive,e)&&ckn(this.modified.endLineNumberExclusive,r))return new t5(new Ui(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Ui(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new t5(Ui.fromPositions(new Yo(this.original.startLineNumber,1),xde(new Yo(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Ui.fromPositions(new Yo(this.modified.startLineNumber,1),xde(new Yo(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new t5(Ui.fromPositions(xde(new Yo(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),xde(new Yo(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Ui.fromPositions(xde(new Yo(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),xde(new Yo(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new Lc}};function xde(t,e){if(t.lineNumber<1)return new Yo(1,1);if(t.lineNumber>e.length)return new Yo(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new Yo(t.lineNumber,r.length+1):t}a(xde,"normalizePosition");function ckn(t,e){return t>=1&&t<=e.length}a(ckn,"isValidLineNumber");var att=class t extends Jwe{static{a(this,"DetailedLineRangeMapping")}static fromRangeMappings(e){let r=$l.join(e.map(o=>$l.fromRangeInclusive(o.originalRange))),n=$l.join(e.map(o=>$l.fromRangeInclusive(o.modifiedRange)));return new t(r,n,e)}constructor(e,r,n){super(e,r),this.innerChanges=n}flip(){return new t(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new t(this.original,this.modified,[this.toRangeMapping()])}},t5=class t{static{a(this,"RangeMapping")}static fromEdit(e){let r=e.getNewRanges();return e.replacements.map((o,s)=>new t(o.range,r[s]))}static fromEditJoin(e){let r=e.getNewRanges(),n=e.replacements.map((o,s)=>new t(o.range,r[s]));return t.join(n)}static join(e){if(e.length===0)throw new Lc("Cannot join an empty list of range mappings");let r=e[0];for(let n=1;n${this.modifiedRange.toString()}}`}flip(){return new t(this.modifiedRange,this.originalRange)}toTextEdit(e){let r=e.getValueOfRange(this.modifiedRange);return new AE(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};var ukn=require("fs");var Aw=class{static{a(this,"DiffServiceImpl")}constructor(){this._worker=new Aq(()=>{let e=Cns([yKe(__dirname,"diffWorker.js"),yKe(__dirname,"../../../../../../../../dist/diffWorker.js")]);if(e===void 0)throw new Error("DiffServiceImpl: worker file not found");return new ott(e,{name:"Diff worker"})})}dispose(){this._worker.rawValue?.terminate()}async computeDiff(e,r,n){let o=await this._worker.value.proxy.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:lkn(o.changes),moves:o.moves.map(c=>new stt(new Jwe(new $l(c[0],c[1]),new $l(c[2],c[3])),lkn(c[4])))}}};function lkn(t){return t.map(e=>new att(new $l(e[0],e[1]),new $l(e[2],e[3]),e[4]?.map(r=>new t5(new Ui(r[0],r[1],r[2],r[3]),new Ui(r[4],r[5],r[6],r[7])))))}a(lkn,"toLineRangeMappings");function Cns(t){for(let e of t)if((0,ukn.existsSync)(e))return e}a(Cns,"firstExistingPath");var ctt=new fe("editSurvivalReporter"),lWt=class{constructor(e,r,n,o,s,c,l){this.ctx=e;this._document=r;this._documentTextBeforeMarkedEdits=n;this._documentTextAfterMarkedEdits=o;this._markedEdits=s;this._sendTelemetryEvent=c;this._customTimeouts=l;this._store=new eq;this._editSurvivalTracker=new Ide(this._documentTextBeforeMarkedEdits,this._markedEdits),this.captureInitialBranchInfo().then(()=>{this.setupTimeouts()}).catch(()=>{this.setupTimeouts()})}static{a(this,"BaseEditSurvivalReporter")}setupTimeouts(){if(this._store.isDisposed)return;let e=this._customTimeouts||[30*1e3,120*1e3,300*1e3,600*1e3];for(let r=0;rthis._store.dispose():void 0,r===0)}}async report(e){let r=await this.createEditSurvivalResult(this._editSurvivalTracker,e,this._readDocumentTimeMs,this._diffComputationTimeMs,this._arcTracker);this._sendTelemetryEvent(r)}_getLineCountInfo(){if(this._arcTracker)return this._arcTracker.getTrackedEditLineMetrics()}async triggerReport(e){await this.report(e)}get editSurvivalTracker(){return this._editSurvivalTracker}getInitializationTimings(){return{readDocumentTimeMs:this._readDocumentTimeMs,diffComputationTimeMs:this._diffComputationTimeMs}}async readCurrentDocument(){let e=await this.readCurrentDocumentWithTiming(this.ctx,this._document);return this._readDocumentTimeMs=e.readDocumentTimeMs,e.text}async captureInitialBranchInfo(){try{let e=uf(this._document.uri),r=this.ctx.get(nw);this._initialBranchInfo=await r.getBranchInfo(this.ctx,e)}catch(e){ctt.warn(this.ctx,"Failed to capture initial branch info",e),this._initialBranchInfo=void 0}}async checkBranchChange(){try{let e=uf(this._document.uri),n=await this.ctx.get(nw).getBranchInfo(this.ctx,e);if(!this._initialBranchInfo||!n)return 0;let o=this._initialBranchInfo.currentBranch,s=n.currentBranch,c=this._initialBranchInfo.isDetachedHead,l=n.isDetachedHead;return o!==s||c!==l?1:0}catch(e){return ctt.warn(this.ctx,"Failed to check branch change",e),0}}async createEditSurvivalResult(e,r,n,o,s){let c=e.computeTrackedEditsSurvivalScore(),l=await this.checkBranchChange(),u=this._getLineCountInfo(),d={fourGram:c.fourGram,noRevert:c.noRevert,timeDelayMs:r,didBranchChange:l,arc:s?.getAcceptedRetainedCharactersCount(),originalCharCount:s?.getOriginalCharacterCount(),currentLineCount:u?.insertedLineCounts,currentDeletedLineCount:u?.deletedLineCounts,originalLineCount:this._initialLineCounts?.insertedLineCounts,originalDeletedLineCount:this._initialLineCounts?.deletedLineCounts,currentFileContent:e.getCurrentText(),originalFileText:e.getOriginalText(),textAfterMarkedEdits:e.getTextAfterMarkedEdits(),debugLog:e.getDebugLog(),readDocumentTimeMs:n,diffComputationTimeMs:o};return{...d,currentLineCount:d.currentLineCount&&d.originalLineCount&&d.currentLineCount>d.originalLineCount?d.originalLineCount:d.currentLineCount,currentDeletedLineCount:d.currentDeletedLineCount&&d.originalDeletedLineCount&&d.currentDeletedLineCount>d.originalDeletedLineCount?d.originalDeletedLineCount:d.currentDeletedLineCount}}async readCurrentDocumentWithTiming(e,r){let n=performance.now(),o=await e.get(ii).getOrReadTextDocument({uri:r.uri}),s=performance.now()-n;if(o.status!=="valid")throw new Lc(`Document ${r.uri} is not valid, details ${JSON.stringify(o)}`);return{text:o.document.getText(),readDocumentTimeMs:s}}async computeDiffWithTiming(e,r,n){let o=performance.now(),s=await itt(r,n,e.get(Aw)),c=performance.now()-o;return{edits:s,diffComputationTimeMs:c}}};var ltt=class extends lWt{static{a(this,"DiffBasedEditSurvivalReporter")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s,c,l),this._arcTracker=new Tde(this._documentTextBeforeMarkedEdits,this._markedEdits),this._initialLineCounts=this._getLineCountInfo()}scheduleReport(e,r){let n=new fKe(()=>{this.updateAndReport(e).then(()=>{n.dispose(),r&&r()}).catch(o=>{ctt.error(this.ctx,`DiffBasedEditSurvivalReporter: Failed to update and report at ${e}ms`,o),n.dispose(),r&&r()})},e);this._store.add(n)}cancel(){this._store.dispose()}async updateAndReport(e){try{let r=await this.readCurrentDocument();if(r!==this._documentTextAfterMarkedEdits){let n=await this.computeDiffWithTiming(this.ctx,this._documentTextAfterMarkedEdits,r);this._diffComputationTimeMs=n.diffComputationTimeMs,this._editSurvivalTracker=new Ide(this._documentTextBeforeMarkedEdits,this._markedEdits),this._editSurvivalTracker.handleEdits(n.edits),this._arcTracker=new Tde(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker.handleEdits(n.edits)}else this._diffComputationTimeMs=void 0,this._editSurvivalTracker=new Ide(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker=new Tde(this._documentTextBeforeMarkedEdits,this._markedEdits);await this.report(e)}catch(r){throw ctt.error(this.ctx,`Failed to update and report at ${e}ms for document ${this._document.uri}`,r),r}}};var dkn=new fe("editSurvivalTrackerService"),bns=[0,30*1e3,120*1e3,300*1e3,600*1e3],nT=class{constructor(e){this.ctx=e}static{a(this,"EditSurvivalTrackerService")}initialize(e,r,n,o){dkn.debug(this.ctx,`Initializing edit survival tracking for document uri: ${e.uri}`);let s=o?.timeouts??bns,c;return{startReporter:a(l=>{(async()=>{try{let u=await itt(r,n,this.ctx.get(Aw));c=new ltt(this.ctx,e,r,n,u,l,s)}catch(u){dkn.error(this.ctx,`Failed to initialize EditSurvivalReporter: ${Xu(u)}`,u)}})()},"startReporter"),cancel:a(()=>{c?.cancel()},"cancel")}}};var Sns=1e3,fkn=256e3,pkn=64e3;function Tns(t){return{modelId:t,uiName:t,modelFamily:t,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1}}a(Tns,"makeProxyInstantApplyModelConfiguration");var Ins=8e3,hkn={modelId:"gpt-4o-instant-apply-full-ft-v66",uiName:"gpt-4o-instant-apply-full-ft-v66",modelFamily:Rn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},xns={modelId:"gpt-4o-instant-apply-full-ft-v66-short",uiName:"gpt-4o-instant-apply-full-ft-v66-short",modelFamily:Rn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},utt=class{static{a(this,"CodeMapper")}constructor(e){this.ctx=e,this.logger=new fe("codeMapper")}async mapCode(e,r,n,o,s,c=!1,l){if(!e.resource)throw new gE("No uri found in code block");if(o.isCancellationRequested)throw new Yet;e.code.includes(FA)||this.logger.debug(this.ctx,`Code block for uri ${e.resource} does not contain existing code marker`);let u=await this.ctx.get(ii).getOrReadTextDocument({uri:e.resource});if(u.status==="notfound")return s&&await this.reportCodeBlock(e,s),{code:e.code};if(u.status==="invalid"){let g=`Failed to find file ${e.resource} with status ${u.status} and reason ${u.reason}`,A=new gE(g);throw this.logger.error(this.ctx,g,A),A}let d=u.document.getText();if(d.length===0&&!e.code.includes(FA))return s&&await this.reportCodeBlock(e,s),{code:e.code};s&&await s({fileGenerationStatus:"edit-plan-generated",uri:e.resource,basename:Ji(e.resource),editDescription:e.markdownBeforeBlock});let f=await this.ctx.get(Qt).getToken(),h=await this.ctx.get(Zt).updateExPValuesAndAssignments(f),m=this.ctx.get(Zt).instantApplyModelMigration(h);try{return await this.mapCodeUsingFastEdit(e,u,r,n,o,h,s,c,l)}catch(g){if(this.logger.exception(this.ctx,g,`Fast Edit failed for ${e.resource}. Error: ${Xu(g)}`),Vn(this.ctx,"codeMapper.fastEditFailed",g,{modelId:m?this.ctx.get(Zq).instantApplyModels[0]?.name??"unknown":"default"}),Ft(this.ctx,Ye.EnableMapCodeFallback)==="enabled")return await this.codeMapperUsingSlowEdit(e,u,d,r,n,o,s,c,l);throw g}}async codeMapperUsingSlowEdit(e,r,n,o,s,c,l,u,d){let h=ws("o200k_base").tokenLength(n),g=h<3072;return this.logger.info(this.ctx,`Document has ${h} tokens. Falling back to ${g?"Full Rewrite":"Patch mode"} for ${e.resource}`),g?await this.mapCodeUsingFullRewrite(e,r,o,s,c,l,u,d):await this.mapCodeUsingPatch(e,r,o,s,c,l,u,d)}async mapCodeUsingFastEdit(e,r,n,o,s,c,l,u=!1,d){if(r.status!=="valid")throw new gE("Invalid document result in mapCodeUsingFastEdit");let f=r.document.getText(),h=await this.buildPromptAndSelectEndpoint(e,r,s,c),m=h.messages,g=h.modelConfiguration,A=h.tokenCount;this.logger.info(this.ctx,`Selected model: ${g.modelId}, Token count: ${A} for ${e.resource}`);let y=this.ctx.get(nT),E=RJ(),_=[],v=0,b=0,T=f.length+e.code.length+Sns;for(;;){let w={copilotApiProvider:"proxy",modelConfiguration:g,messages:m,uiKind:"agentPanel",temperature:0,llmInteraction:n.cloneAsAgentInteraction(),prediction:{type:"content",content:f},copilotEditsSessionHeader:d};this.logger.debug(this.ctx,`Send map code request ${E} in iteration ${b} with params: ${JSON.stringify(w,null,2)}`);let x=await this.ctx.get(oc).fetchResponse(w,s,c);if(this.logger.debug(this.ctx,`Received map code response ${E} in iteration ${b} with result: ${JSON.stringify(x,null,2)}`),v=this.calculateResponseLength(x,_,v),x.type==="length"){if(v>T)throw new gE(`Code mapper might be in a loop: Rewritten length: ${v}, Document length: ${f.length}, Code block length ${e.code.length}`);m=(await ap.create(Cde,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:x.truncatedValue},g).renderPrompt(void 0,s)).messages}else if(x.type==="success"){let P=_.join("");if(P){l&&await l({fileGenerationStatus:"updated-code-generated",uri:e.resource,basename:Ji(e.resource),partialText:P,languageId:r.document.detectedLanguageId,markdownCodeFence:DA(P)});let D=y.initialize(r.document,f,P);return{code:P,editSurvivalTrackingSession:D,telemetry:{requestSource:o.chatRequestSource,chatRequestModel:o.chatRequestModel,mapper:g.modelId,headerRequestId:x.requestId}}}else{let D=`No valid completion found for uri ${e.resource}`;throw new gE(D)}}else{if(x.type==="canceled")throw new Oc;{let P=`Failed to map code for uri ${e.resource} with result type ${x.type}`;throw this.logger.error(this.ctx,P,x),new gE(P)}}b+=1}}async mapCodeUsingFullRewrite(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("full-rewrite",Cde,e,r,n,o,s,c,l,u,d=>wns(d))}async mapCodeUsingPatch(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("patch",Ket,e,r,n,o,s,c,l,u,(d,f)=>{this.logger.info(this.ctx,`Patch response for uri ${e.resource}: ${d.substring(0,500)}...`);let h=ekn(d);if(h.patches.length===0)throw new gE(`Patch mode failed: no valid patches found in response for uri ${e.resource}`);this.logger.info(this.ctx,`Parsed ${h.patches.length} patch(es) for uri ${e.resource}`);let m=nkn(f,h.patches);if(m===void 0)throw new gE(`Patch mode failed: could not apply patches to document for uri ${e.resource}`);return this.logger.info(this.ctx,`Patch mode succeeded for uri ${e.resource}`),m})}async mapCodeUsingCAPI(e,r,n,o,s,c,l,u,d,f,h){if(o.status!=="valid")throw new gE(`Invalid document result in mapCodeUsing${e==="full-rewrite"?"FullRewrite":"Patch"}`);let m=o.document.getText(),g=await xo.getModelConfiguration(this.ctx,"codeMapper");this.logger.info(this.ctx,`${e==="full-rewrite"?"Full Rewrite":"Patch mode"} fallback using model: ${g.modelId} for ${n.resource}`);let A={codeBlock:n.code,uri:n.resource,existingDocument:o,markdownBeforeBlock:n.markdownBeforeBlock,...e==="full-rewrite"?{inProgressRewriteContent:void 0}:{}},_=(await ap.create(r,A,g).renderPrompt(void 0,l)).messages,v=this.ctx.get(nT),b=await this.ctx.get(Qt).getToken(),T=await this.ctx.get(Zt).updateExPValuesAndAssignments(b),w=RJ(),R={copilotApiProvider:"api",modelConfiguration:g,messages:_,uiKind:"agentPanel",temperature:0,llmInteraction:s.cloneAsAgentInteraction(),copilotEditsSessionHeader:f};this.logger.debug(this.ctx,`Send ${e} request ${w} with params: ${JSON.stringify(R,null,2)}`);let P=await this.ctx.get(oc).fetchResponse(R,l,T);if(this.logger.debug(this.ctx,`Received ${e} response ${w} with result: ${JSON.stringify(P,null,2)}`),P.type==="success"){let D=P.value;if(!D)throw new gE(`No valid completion found for uri ${n.resource}`);let N=h(D,m);u&&await u({fileGenerationStatus:"updated-code-generated",uri:n.resource,basename:Ji(n.resource),partialText:N,languageId:o.document.detectedLanguageId,markdownCodeFence:DA(N)});let L=v.initialize(o.document,m,N);return{code:N,editSurvivalTrackingSession:L,telemetry:{requestSource:c.chatRequestSource,chatRequestModel:c.chatRequestModel,mapper:`${g.modelId}-${e}`,headerRequestId:P.requestId}}}else{if(P.type==="canceled")throw new Oc;{let D=`${e==="full-rewrite"?"Full Rewrite":"Patch mode"} failed for uri ${n.resource} with result type ${P.type}`;throw this.logger.error(this.ctx,D,P),new gE(D)}}}async buildPromptAndSelectEndpoint(e,r,n,o,s){let l=(r.status==="valid"?r.document.getText():"").length+e.code.length;if(l>fkn)throw new gE(`Document too large: ${l} characters (limit: ${fkn})`);let u=this.ctx.get(Zq).instantApplyModels[0],d=u?Tns(u.name):void 0,h=await ap.create(Cde,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:s},d??hkn).renderPrompt(void 0,n),m=h.tokenCount;if(m>pkn)throw new gE(`Prompt too large: ${m} tokens (limit: ${pkn})`);let g=h.messages.map(_=>typeof _.content=="string"?_.content:JSON.stringify(_.content)).join(` -`),A=this.ctx.get(Zt).instantApplyModelMigration(o),y;return A&&d?y=d:y=g.length{let o=Pn(n.content);return n.role==="system"?`${r} +`).join("")),new CE(Fi.fromPositions(new Yo(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new Fi(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` +`);return new CE(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new jA(n,r.text)}toString(){return`${this.lineRange}->${JSON.stringify(this.newLines)}`}serialize(){return[this.lineRange.startLineNumber,this.lineRange.endLineNumberExclusive,this.newLines]}removeCommonSuffixPrefixLines(e){let r=this.lineRange.startLineNumber,n=this.lineRange.endLineNumberExclusive,o=0;for(;r{function t(r){return Array.isArray(r)&&r.length===3&&typeof r[0]=="number"&&typeof r[1]=="number"&&Array.isArray(r[2])&&r[2].every(n=>typeof n=="string")}e.is=t,a(t,"is")})(Sos||={});var Lde=class{constructor(e,r){this.originalText=e;this._trackedEdit=r;let n=r.removeCommonSuffixPrefix(e);this._updatedTrackedEdit=n.mapData(()=>new Ptt(!0))}static{a(this,"ArcTracker")}handleEdits(e){let r=e.mapData(s=>new Ptt(!1)),o=this._updatedTrackedEdit.compose(r).decomposeSplit(s=>!s.data.isTrackedEdit).e2;this._updatedTrackedEdit=o}getTrackedEdit(){return this._updatedTrackedEdit.toStringEdit()}getAcceptedRetainedCharactersCount(){return LPn(this._updatedTrackedEdit.replacements,r=>r.getNewLength())}getOriginalCharacterCount(){return LPn(this._trackedEdit.replacements,e=>e.getNewLength())}getTrackedEditLineMetrics(){let e=this.getTrackedEdit();if(!e)return{deletedLineCounts:0,insertedLineCounts:0};let r=hRe.fromEdit(e,new bF(this.originalText)),n=Cxe(r.replacements,s=>s.lineRange.length),o=Cxe(r.getNewLineRanges(),s=>s.length);return{deletedLineCounts:n,insertedLineCounts:o}}getDebugState(){return{edits:this._updatedTrackedEdit.replacements.map(e=>({range:e.replaceRange.toString(),newText:e.newText,isTrackedEdit:e.data.isTrackedEdit}))}}},Ptt=class{constructor(e){this.isTrackedEdit=e}static{a(this,"IsTrackedEditData")}join(e){if(this.isTrackedEdit===e.isTrackedEdit)return this}};function LPn(t,e){let r=0;for(let n of t)r+=e(n);return r}a(LPn,"sum");p();var Bde=class{constructor(e,r){this.originalText=e;this._combinedEditsSinceStart=ov.empty;this._debugLog=[];this._text=r.apply(this.originalText),this._textAfterTrackedEdits=this._text,this._originalEdits=r,this._debugLog.push(`[INIT] Original: "${this.originalText}"`),this._debugLog.push(`[INIT] TrackedEdits(${r.replacements.length}): ${this._formatEditsCompact(r,this.originalText)}`),this._debugLog.push(`[INIT] Result: "${this._text}"`),this._debugLog.push("")}static{a(this,"EditSurvivalTracker")}_formatEditsCompact(e,r){return e.replacements.length===0?"[]":e.replacements.map(n=>{let o=r.substring(n.replaceRange.start,n.replaceRange.endExclusive);return`[${n.replaceRange.start}:${n.replaceRange.endExclusive}]"${o}"->"${n.newText}"`}).join(", ")}handleEdits(e){let r=this._text,n=e.apply(this._text),o=this._combinedEditsSinceStart.compose(e);o=o.removeCommonSuffixPrefix(this._textAfterTrackedEdits),this._combinedEditsSinceStart=o,this._text=n,this._debugLog.push(`[EDIT] Input(${e.replacements.length}): ${this._formatEditsCompact(e,r)} -> "${n}"`),this._debugLog.push(`[EDIT] Accumulated(${this._combinedEditsSinceStart.replacements.length}): ${this._formatEditsCompact(this._combinedEditsSinceStart,this._textAfterTrackedEdits)}`)}getCurrentText(){return this._text}getTextAfterMarkedEdits(){return this._textAfterTrackedEdits}getOriginalText(){return this.originalText}getDebugLog(){return this._debugLog.join(` +`)}computeTrackedEditsSurvivalScore(){this._debugLog.push(`[CALC] Current: "${this._text}" | Original: "${this.originalText}"`);let e=0,r=0,n=0,o=0,s=this._originalEdits.getNewRanges(),c=Tos(s,this._combinedEditsSinceStart);this._debugLog.push(`[CALC] Processing ${s.length} edits:`);for(let d=0;d"${m}"->"${A}" | 4gram:${y.toFixed(2)} noRevert:(${E.toFixed(2)},${_.toFixed(2)})`),E!==1){let v=1-Math.max(_-E,0)/(1-E);n+=f.replaceRange.length*v,o+=f.replaceRange.length}e+=f.newText.length*y,r+=f.newText.length}let l=r===0?1:e/r,u=o===0?1:n/o;return this._debugLog.push(`[RESULT] fourGram: ${l.toFixed(3)} (${e.toFixed(1)}/${r.toFixed(1)}) | noRevert: ${u.toFixed(3)} (${n.toFixed(1)}/${o.toFixed(1)})`),{fourGram:l,noRevert:u}}};function XWt(t,e){if(t.length<4||e.length<4)return t===e?1:0;let n=new Map;for(let l=0;l<=t.length-4;l++){let u=t.substring(l,l+4),d=n.get(u)||0;n.set(u,d+1)}for(let l=0;l<=e.length-4;l++){let u=e.substring(l,l+4),d=n.get(u)||0;n.set(u,d-1)}let o=t.length-4+1+e.length-4+1,s=0;for(let l of n.values())s+=Math.abs(l);return(o-s)/o}a(XWt,"compute4GramTextSimilarity");function Tos(t,e){t=t.slice();let r=[],n=0;for(let o of e.replacements){for(;;){let c=t[0];if(!c||c.endExclusive>=o.replaceRange.start)break;t.shift(),r.push(c.delta(n))}let s=[];for(;;){let c=t[0];if(!c||!c.intersectsOrTouches(o.replaceRange))break;t.shift(),s.push(c)}for(let c=s.length-1;c>=0;c--){let l=s[c],u=l.intersect(o.replaceRange).length;l=l.deltaEnd(-u+(c===0?o.newText.length:0));let d=l.start-o.replaceRange.start;d>0&&(l=l.delta(-d)),c!==0&&(l=l.delta(o.newText.length)),l=l.delta(-(o.newText.length-o.replaceRange.length)),t.unshift(l)}n+=o.newText.length-o.replaceRange.length}for(;;){let o=t[0];if(!o)break;t.shift(),r.push(o.delta(n))}return r}a(Tos,"applyEditsToRanges");p();p();var mRe=class{static{a(this,"OffsetLineColumnConverter")}get lines(){return this._lineStartOffsets.length}constructor(e){this._lineStartOffsets=[0];let r=0;for(;re);r++);let n=e-this._lineStartOffsets[r-1];return new Yo(r,n+1)}startOffsetOfLineContaining(e){let r=1;for(;re);r++);return this._lineStartOffsets[r-1]}positionToOffset(e){return e.lineNumber>=this._lineStartOffsets.length?this._lineStartOffsets[this._lineStartOffsets.length-1]+e.column-1:this._lineStartOffsets[e.lineNumber-1]+e.column-1}};async function Dtt(t,e,r,n=5e3){let o=await r.computeDiff(t,e,{maxComputationTimeMs:n,computeMoves:!1,ignoreTrimWhitespace:!1}),s=new mRe(t),c=new mRe(e),l=[];for(let u of o.changes)for(let d of u.innerChanges??[]){let f=c.positionToOffset(d.modifiedRange.getStartPosition()),h=c.positionToOffset(d.modifiedRange.getEndPosition()),m=e.substring(f,h),g=s.positionToOffset(d.originalRange.getStartPosition()),A=s.positionToOffset(d.originalRange.getEndPosition()),y=new Ec(g,A);l.push(new jA(y,m))}return new ov(l)}a(Dtt,"stringEditFromDiff");p();p();var BPn=fe(require("path")),FPn=require("worker_threads");var ezt=class{constructor(){this.nextId=1;this.handlers=new Map}static{a(this,"RpcResponseHandler")}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};function Ios(t){let e={get:a((r,n)=>(typeof n=="string"&&!r[n]&&(r[n]=(...o)=>t(n,o)),r[n]),"get")};return new Proxy(Object.create(null),e)}a(Ios,"createRpcProxy");var Ntt=class{constructor(e,r,n){this.responseHandler=new ezt;this.worker=new FPn.Worker(e,r),jIe(this.worker,BPn.basename(e,".js")),this.worker.on("message",async o=>{if("fn"in o)try{let s=await n?.[o.fn].apply(n,o.args);this.worker.postMessage({id:o.id,res:s})}catch(s){let c=s instanceof Error?s:new Error(String(s));this.worker.postMessage({id:o.id,err:c})}else this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=Ios((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}static{a(this,"WorkerWithRpcProxy")}async terminate(){this.worker.removeAllListeners(),await this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};p();var Mtt=class t{static{a(this,"MovedText")}constructor(e,r){this.lineRangeMapping=e,this.changes=r}flip(){return new t(this.lineRangeMapping.flip(),this.changes.map(e=>e.flip()))}};p();var gRe=class t{static{a(this,"LineRangeMapping")}static inverse(e,r,n){let o=[],s=1,c=1;for(let u of e){let d=new t(new Wl(s,u.original.startLineNumber),new Wl(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new Wl(s,r+1),new Wl(c,n+1));return l.modified.isEmpty||o.push(l),o}static clip(e,r,n){let o=[];for(let s of e){let c=s.original.intersect(r),l=s.modified.intersect(n);c&&!c.isEmpty&&l&&!l.isEmpty&&o.push(new t(c,l))}return o}constructor(e,r){this.original=e,this.modified=r}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new t(this.modified,this.original)}join(e){return new t(this.original.join(e.original),this.modified.join(e.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){let e=this.original.toInclusiveRange(),r=this.modified.toInclusiveRange();if(e&&r)return new l5(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Qc("not a valid diff");return new l5(new Fi(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Fi(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new l5(new Fi(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new Fi(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(UPn(this.original.endLineNumberExclusive,e)&&UPn(this.modified.endLineNumberExclusive,r))return new l5(new Fi(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Fi(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new l5(Fi.fromPositions(new Yo(this.original.startLineNumber,1),Fde(new Yo(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Fi.fromPositions(new Yo(this.modified.startLineNumber,1),Fde(new Yo(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new l5(Fi.fromPositions(Fde(new Yo(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),Fde(new Yo(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Fi.fromPositions(Fde(new Yo(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),Fde(new Yo(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new Qc}};function Fde(t,e){if(t.lineNumber<1)return new Yo(1,1);if(t.lineNumber>e.length)return new Yo(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new Yo(t.lineNumber,r.length+1):t}a(Fde,"normalizePosition");function UPn(t,e){return t>=1&&t<=e.length}a(UPn,"isValidLineNumber");var Ott=class t extends gRe{static{a(this,"DetailedLineRangeMapping")}static fromRangeMappings(e){let r=Wl.join(e.map(o=>Wl.fromRangeInclusive(o.originalRange))),n=Wl.join(e.map(o=>Wl.fromRangeInclusive(o.modifiedRange)));return new t(r,n,e)}constructor(e,r,n){super(e,r),this.innerChanges=n}flip(){return new t(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new t(this.original,this.modified,[this.toRangeMapping()])}},l5=class t{static{a(this,"RangeMapping")}static fromEdit(e){let r=e.getNewRanges();return e.replacements.map((o,s)=>new t(o.range,r[s]))}static fromEditJoin(e){let r=e.getNewRanges(),n=e.replacements.map((o,s)=>new t(o.range,r[s]));return t.join(n)}static join(e){if(e.length===0)throw new Qc("Cannot join an empty list of range mappings");let r=e[0];for(let n=1;n${this.modifiedRange.toString()}}`}flip(){return new t(this.modifiedRange,this.originalRange)}toTextEdit(e){let r=e.getValueOfRange(this.modifiedRange);return new CE(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};var qPn=require("fs");var Tw=class{static{a(this,"DiffServiceImpl")}constructor(){this._worker=new kq(()=>{let e=xos([VKe(__dirname,"diffWorker.js"),VKe(__dirname,"../../../../../../../../dist/diffWorker.js")]);if(e===void 0)throw new Error("DiffServiceImpl: worker file not found");return new Ntt(e,{name:"Diff worker"})})}dispose(){this._worker.rawValue?.terminate()}async computeDiff(e,r,n){let o=await this._worker.value.proxy.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:QPn(o.changes),moves:o.moves.map(c=>new Mtt(new gRe(new Wl(c[0],c[1]),new Wl(c[2],c[3])),QPn(c[4])))}}};function QPn(t){return t.map(e=>new Ott(new Wl(e[0],e[1]),new Wl(e[2],e[3]),e[4]?.map(r=>new l5(new Fi(r[0],r[1],r[2],r[3]),new Fi(r[4],r[5],r[6],r[7])))))}a(QPn,"toLineRangeMappings");function xos(t){for(let e of t)if((0,qPn.existsSync)(e))return e}a(xos,"firstExistingPath");var Ltt=new pe("editSurvivalReporter"),tzt=class{constructor(e,r,n,o,s,c,l){this.ctx=e;this._document=r;this._documentTextBeforeMarkedEdits=n;this._documentTextAfterMarkedEdits=o;this._markedEdits=s;this._sendTelemetryEvent=c;this._customTimeouts=l;this._store=new pq;this._editSurvivalTracker=new Bde(this._documentTextBeforeMarkedEdits,this._markedEdits),this.captureInitialBranchInfo().then(()=>{this.setupTimeouts()}).catch(()=>{this.setupTimeouts()})}static{a(this,"BaseEditSurvivalReporter")}setupTimeouts(){if(this._store.isDisposed)return;let e=this._customTimeouts||[30*1e3,120*1e3,300*1e3,600*1e3];for(let r=0;rthis._store.dispose():void 0,r===0)}}async report(e){let r=await this.createEditSurvivalResult(this._editSurvivalTracker,e,this._readDocumentTimeMs,this._diffComputationTimeMs,this._arcTracker);this._sendTelemetryEvent(r)}_getLineCountInfo(){if(this._arcTracker)return this._arcTracker.getTrackedEditLineMetrics()}async triggerReport(e){await this.report(e)}get editSurvivalTracker(){return this._editSurvivalTracker}getInitializationTimings(){return{readDocumentTimeMs:this._readDocumentTimeMs,diffComputationTimeMs:this._diffComputationTimeMs}}async readCurrentDocument(){let e=await this.readCurrentDocumentWithTiming(this.ctx,this._document);return this._readDocumentTimeMs=e.readDocumentTimeMs,e.text}async captureInitialBranchInfo(){try{let e=mf(this._document.uri),r=this.ctx.get(dw);this._initialBranchInfo=await r.getBranchInfo(this.ctx,e)}catch(e){Ltt.warn(this.ctx,"Failed to capture initial branch info",e),this._initialBranchInfo=void 0}}async checkBranchChange(){try{let e=mf(this._document.uri),n=await this.ctx.get(dw).getBranchInfo(this.ctx,e);if(!this._initialBranchInfo||!n)return 0;let o=this._initialBranchInfo.currentBranch,s=n.currentBranch,c=this._initialBranchInfo.isDetachedHead,l=n.isDetachedHead;return o!==s||c!==l?1:0}catch(e){return Ltt.warn(this.ctx,"Failed to check branch change",e),0}}async createEditSurvivalResult(e,r,n,o,s){let c=e.computeTrackedEditsSurvivalScore(),l=await this.checkBranchChange(),u=this._getLineCountInfo(),d={fourGram:c.fourGram,noRevert:c.noRevert,timeDelayMs:r,didBranchChange:l,arc:s?.getAcceptedRetainedCharactersCount(),originalCharCount:s?.getOriginalCharacterCount(),currentLineCount:u?.insertedLineCounts,currentDeletedLineCount:u?.deletedLineCounts,originalLineCount:this._initialLineCounts?.insertedLineCounts,originalDeletedLineCount:this._initialLineCounts?.deletedLineCounts,currentFileContent:e.getCurrentText(),originalFileText:e.getOriginalText(),textAfterMarkedEdits:e.getTextAfterMarkedEdits(),debugLog:e.getDebugLog(),readDocumentTimeMs:n,diffComputationTimeMs:o};return{...d,currentLineCount:d.currentLineCount&&d.originalLineCount&&d.currentLineCount>d.originalLineCount?d.originalLineCount:d.currentLineCount,currentDeletedLineCount:d.currentDeletedLineCount&&d.originalDeletedLineCount&&d.currentDeletedLineCount>d.originalDeletedLineCount?d.originalDeletedLineCount:d.currentDeletedLineCount}}async readCurrentDocumentWithTiming(e,r){let n=performance.now(),o=await e.get(ni).getOrReadTextDocument({uri:r.uri}),s=performance.now()-n;if(o.status!=="valid")throw new Qc(`Document ${r.uri} is not valid, details ${JSON.stringify(o)}`);return{text:o.document.getText(),readDocumentTimeMs:s}}async computeDiffWithTiming(e,r,n){let o=performance.now(),s=await Dtt(r,n,e.get(Tw)),c=performance.now()-o;return{edits:s,diffComputationTimeMs:c}}};var Btt=class extends tzt{static{a(this,"DiffBasedEditSurvivalReporter")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s,c,l),this._arcTracker=new Lde(this._documentTextBeforeMarkedEdits,this._markedEdits),this._initialLineCounts=this._getLineCountInfo()}scheduleReport(e,r){let n=new QKe(()=>{this.updateAndReport(e).then(()=>{n.dispose(),r&&r()}).catch(o=>{Ltt.error(this.ctx,`DiffBasedEditSurvivalReporter: Failed to update and report at ${e}ms`,o),n.dispose(),r&&r()})},e);this._store.add(n)}cancel(){this._store.dispose()}async updateAndReport(e){try{let r=await this.readCurrentDocument();if(r!==this._documentTextAfterMarkedEdits){let n=await this.computeDiffWithTiming(this.ctx,this._documentTextAfterMarkedEdits,r);this._diffComputationTimeMs=n.diffComputationTimeMs,this._editSurvivalTracker=new Bde(this._documentTextBeforeMarkedEdits,this._markedEdits),this._editSurvivalTracker.handleEdits(n.edits),this._arcTracker=new Lde(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker.handleEdits(n.edits)}else this._diffComputationTimeMs=void 0,this._editSurvivalTracker=new Bde(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker=new Lde(this._documentTextBeforeMarkedEdits,this._markedEdits);await this.report(e)}catch(r){throw Ltt.error(this.ctx,`Failed to update and report at ${e}ms for document ${this._document.uri}`,r),r}}};var jPn=new pe("editSurvivalTrackerService"),wos=[0,30*1e3,120*1e3,300*1e3,600*1e3],uT=class{constructor(e){this.ctx=e}static{a(this,"EditSurvivalTrackerService")}initialize(e,r,n,o){jPn.debug(this.ctx,`Initializing edit survival tracking for document uri: ${e.uri}`);let s=o?.timeouts??wos,c;return{startReporter:a(l=>{(async()=>{try{let u=await Dtt(r,n,this.ctx.get(Tw));c=new Btt(this.ctx,e,r,n,u,l,s)}catch(u){jPn.error(this.ctx,`Failed to initialize EditSurvivalReporter: ${rd(u)}`,u)}})()},"startReporter"),cancel:a(()=>{c?.cancel()},"cancel")}}};var Ros=1e3,HPn=256e3,GPn=64e3;function kos(t){return{modelId:t,uiName:t,modelFamily:t,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1}}a(kos,"makeProxyInstantApplyModelConfiguration");var Pos=8e3,$Pn={modelId:"gpt-4o-instant-apply-full-ft-v66",uiName:"gpt-4o-instant-apply-full-ft-v66",modelFamily:wn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},Dos={modelId:"gpt-4o-instant-apply-full-ft-v66-short",uiName:"gpt-4o-instant-apply-full-ft-v66-short",modelFamily:wn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},Ftt=class{static{a(this,"CodeMapper")}constructor(e){this.ctx=e,this.logger=new pe("codeMapper")}async mapCode(e,r,n,o,s,c=!1,l){if(!e.resource)throw new vE("No uri found in code block");if(o.isCancellationRequested)throw new btt;e.code.includes(qA)||this.logger.debug(this.ctx,`Code block for uri ${e.resource} does not contain existing code marker`);let u=await this.ctx.get(ni).getOrReadTextDocument({uri:e.resource});if(u.status==="notfound")return s&&await this.reportCodeBlock(e,s),{code:e.code};if(u.status==="invalid"){let g=`Failed to find file ${e.resource} with status ${u.status} and reason ${u.reason}`,A=new vE(g);throw this.logger.error(this.ctx,g,A),A}let d=u.document.getText();if(d.length===0&&!e.code.includes(qA))return s&&await this.reportCodeBlock(e,s),{code:e.code};s&&await s({fileGenerationStatus:"edit-plan-generated",uri:e.resource,basename:Ki(e.resource),editDescription:e.markdownBeforeBlock});let f=await this.ctx.get(Ft).getToken(),h=await this.ctx.get(Jt).updateExPValuesAndAssignments(f),m=this.ctx.get(Jt).instantApplyModelMigration(h);try{return await this.mapCodeUsingFastEdit(e,u,r,n,o,h,s,c,l)}catch(g){if(this.logger.exception(this.ctx,g,`Fast Edit failed for ${e.resource}. Error: ${rd(g)}`),ft(this.ctx,"codeMapper.fastEditFailed"),Cs(this.ctx,"codeMapper.fastEditFailed",g,{modelId:m?this.ctx.get(dj).instantApplyModels[0]?.name??"unknown":"default"}),Rt(this.ctx,ze.EnableMapCodeFallback)==="enabled")return await this.codeMapperUsingSlowEdit(e,u,d,r,n,o,s,c,l);throw g}}async codeMapperUsingSlowEdit(e,r,n,o,s,c,l,u,d){let h=ws("o200k_base").tokenLength(n),g=h<3072;return this.logger.info(this.ctx,`Document has ${h} tokens. Falling back to ${g?"Full Rewrite":"Patch mode"} for ${e.resource}`),g?await this.mapCodeUsingFullRewrite(e,r,o,s,c,l,u,d):await this.mapCodeUsingPatch(e,r,o,s,c,l,u,d)}async mapCodeUsingFastEdit(e,r,n,o,s,c,l,u=!1,d){if(r.status!=="valid")throw new vE("Invalid document result in mapCodeUsingFastEdit");let f=r.document.getText(),h=await this.buildPromptAndSelectEndpoint(e,r,s,c),m=h.messages,g=h.modelConfiguration,A=h.tokenCount;this.logger.info(this.ctx,`Selected model: ${g.modelId}, Token count: ${A} for ${e.resource}`);let y=this.ctx.get(uT),E=UJ(),_=[],v=0,b=0,T=f.length+e.code.length+Ros;for(;;){let w={copilotApiProvider:"proxy",modelConfiguration:g,messages:m,uiKind:"agentPanel",temperature:0,llmInteraction:n.cloneAsAgentInteraction(),prediction:{type:"content",content:f},copilotEditsSessionHeader:d};this.logger.debug(this.ctx,`Send map code request ${E} in iteration ${b} with params: ${JSON.stringify(w,null,2)}`);let x=await this.ctx.get(cc).fetchResponse(w,s,c);if(this.logger.debug(this.ctx,`Received map code response ${E} in iteration ${b} with result: ${JSON.stringify(x,null,2)}`),v=this.calculateResponseLength(x,_,v),x.type==="length"){if(v>T)throw new vE(`Code mapper might be in a loop: Rewritten length: ${v}, Document length: ${f.length}, Code block length ${e.code.length}`);m=(await up.create(Nde,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:x.truncatedValue},g).renderPrompt(void 0,s)).messages}else if(x.type==="success"){let P=_.join("");if(P){l&&await l({fileGenerationStatus:"updated-code-generated",uri:e.resource,basename:Ki(e.resource),partialText:P,languageId:r.document.detectedLanguageId,markdownCodeFence:OA(P)});let D=y.initialize(r.document,f,P);return{code:P,editSurvivalTrackingSession:D,telemetry:{requestSource:o.chatRequestSource,chatRequestModel:o.chatRequestModel,mapper:g.modelId,headerRequestId:x.requestId}}}else{let D=`No valid completion found for uri ${e.resource}`;throw new vE(D)}}else{if(x.type==="canceled")throw new Uc;{let P=`Failed to map code for uri ${e.resource} with result type ${x.type}`;throw this.logger.error(this.ctx,P,x),new vE(P)}}b+=1}}async mapCodeUsingFullRewrite(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("full-rewrite",Nde,e,r,n,o,s,c,l,u,d=>Nos(d))}async mapCodeUsingPatch(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("patch",Stt,e,r,n,o,s,c,l,u,(d,f)=>{this.logger.info(this.ctx,`Patch response for uri ${e.resource}: ${d.substring(0,500)}...`);let h=PPn(d);if(h.patches.length===0)throw new vE(`Patch mode failed: no valid patches found in response for uri ${e.resource}`);this.logger.info(this.ctx,`Parsed ${h.patches.length} patch(es) for uri ${e.resource}`);let m=MPn(f,h.patches);if(m===void 0)throw new vE(`Patch mode failed: could not apply patches to document for uri ${e.resource}`);return this.logger.info(this.ctx,`Patch mode succeeded for uri ${e.resource}`),m})}async mapCodeUsingCAPI(e,r,n,o,s,c,l,u,d,f,h){if(o.status!=="valid")throw new vE(`Invalid document result in mapCodeUsing${e==="full-rewrite"?"FullRewrite":"Patch"}`);let m=o.document.getText(),g=await xo.getModelConfiguration(this.ctx,"codeMapper");this.logger.info(this.ctx,`${e==="full-rewrite"?"Full Rewrite":"Patch mode"} fallback using model: ${g.modelId} for ${n.resource}`);let A={codeBlock:n.code,uri:n.resource,existingDocument:o,markdownBeforeBlock:n.markdownBeforeBlock,...e==="full-rewrite"?{inProgressRewriteContent:void 0}:{}},_=(await up.create(r,A,g).renderPrompt(void 0,l)).messages,v=this.ctx.get(uT),b=await this.ctx.get(Ft).getToken(),T=await this.ctx.get(Jt).updateExPValuesAndAssignments(b),w=UJ(),R={copilotApiProvider:"api",modelConfiguration:g,messages:_,uiKind:"agentPanel",temperature:0,llmInteraction:s.cloneAsAgentInteraction(),copilotEditsSessionHeader:f};this.logger.debug(this.ctx,`Send ${e} request ${w} with params: ${JSON.stringify(R,null,2)}`);let P=await this.ctx.get(cc).fetchResponse(R,l,T);if(this.logger.debug(this.ctx,`Received ${e} response ${w} with result: ${JSON.stringify(P,null,2)}`),P.type==="success"){let D=P.value;if(!D)throw new vE(`No valid completion found for uri ${n.resource}`);let N=h(D,m);u&&await u({fileGenerationStatus:"updated-code-generated",uri:n.resource,basename:Ki(n.resource),partialText:N,languageId:o.document.detectedLanguageId,markdownCodeFence:OA(N)});let L=v.initialize(o.document,m,N);return{code:N,editSurvivalTrackingSession:L,telemetry:{requestSource:c.chatRequestSource,chatRequestModel:c.chatRequestModel,mapper:`${g.modelId}-${e}`,headerRequestId:P.requestId}}}else{if(P.type==="canceled")throw new Uc;{let D=`${e==="full-rewrite"?"Full Rewrite":"Patch mode"} failed for uri ${n.resource} with result type ${P.type}`;throw this.logger.error(this.ctx,D,P),new vE(D)}}}async buildPromptAndSelectEndpoint(e,r,n,o,s){let l=(r.status==="valid"?r.document.getText():"").length+e.code.length;if(l>HPn)throw new vE(`Document too large: ${l} characters (limit: ${HPn})`);let u=this.ctx.get(dj).instantApplyModels[0],d=u?kos(u.name):void 0,h=await up.create(Nde,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:s},d??$Pn).renderPrompt(void 0,n),m=h.tokenCount;if(m>GPn)throw new vE(`Prompt too large: ${m} tokens (limit: ${GPn})`);let g=h.messages.map(_=>typeof _.content=="string"?_.content:JSON.stringify(_.content)).join(` +`),A=this.ctx.get(Jt).instantApplyModelMigration(o),y;return A&&d?y=d:y=g.length{let o=Pn(n.content);return n.role==="system"?`${r} ${o} -`:r+o},"")}]}calculateResponseLength(e,r,n){return e.type==="success"?(r.push(e.value),n+=e.value.length):e.type==="length"&&(r.push(e.truncatedValue),n+=e.truncatedValue.length),n}async reportCodeBlock(e,r){await r({fileGenerationStatus:"edit-plan-generated",uri:e.resource,basename:Ji(e.resource),editDescription:e.markdownBeforeBlock}),await r({fileGenerationStatus:"updated-code-generated",partialText:e.code,uri:e.resource,basename:Ji(e.resource)})}};function wns(t){let e=t.split(/\r?\n/),r=/^(`{3,})/,n=!1,o=0,s=!1,c=[];for(let l of e){let u=l.match(r);if(u&&!n)o=u[1].length,n=!0;else if(n){let d=l.match(r);if(d&&d[1].length>=o){s=!0;break}c.push(l)}}return s?c.join(` -`):t}a(wns,"extractCodeBlock");var dtt=class extends vu{static{a(this,"EditFileTool")}constructor(){super({name:"insert_edit_into_file",displayName:"Edit File",description:`Edit a file in the workspace. Use this tool once per file that needs to be modified, even if there are multiple changes for a file. Generate the "explanation" property first. +`:r+o},"")}]}calculateResponseLength(e,r,n){return e.type==="success"?(r.push(e.value),n+=e.value.length):e.type==="length"&&(r.push(e.truncatedValue),n+=e.truncatedValue.length),n}async reportCodeBlock(e,r){await r({fileGenerationStatus:"edit-plan-generated",uri:e.resource,basename:Ki(e.resource),editDescription:e.markdownBeforeBlock}),await r({fileGenerationStatus:"updated-code-generated",partialText:e.code,uri:e.resource,basename:Ki(e.resource)})}};function Nos(t){let e=t.split(/\r?\n/),r=/^(`{3,})/,n=!1,o=0,s=!1,c=[];for(let l of e){let u=l.match(r);if(u&&!n)o=u[1].length,n=!0;else if(n){let d=l.match(r);if(d&&d[1].length>=o){s=!0;break}c.push(l)}}return s?c.join(` +`):t}a(Nos,"extractCodeBlock");var Utt=class extends bu{static{a(this,"EditFileTool")}constructor(){super({name:"insert_edit_into_file",displayName:"Edit File",description:`Edit a file in the workspace. Use this tool once per file that needs to be modified, even if there are multiple changes for a file. Generate the "explanation" property first. The system is very smart and can understand how to apply your edits to the files, you just need to provide minimal hints. Avoid repeating existing code, instead use comments to represent regions of unchanged code. Be as concise as possible. For example: // ...existing code... @@ -3622,9 +3622,9 @@ class Person { getAge() { return this.age; } -}`}),explanation:S.String({description:"A short explanation of the edit being made."})})})}async invoke(e,r,n){try{let o=await this.mapCode(r.input,e,n),s=o.code,c=await this.invokeClientEditFileTool(e,r,s,n);return await this.getFinalEditFileResult(e,r,c,o.editSurvivalTrackingSession,o.telemetry)}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Lr([new Rr(s)],"error")}}async mapCode(e,r,n){let{filePath:o}=e,s=id(o,r.uriSchemeCache);if(!s)throw new Error(`Invalid file path: ${o}`);return await new utt(r.ctx).mapCode({code:e.code,resource:s,markdownBeforeBlock:e.explanation},r.toLlmInteraction(),{chatRequestSource:r.conversation.source,chatRequestModel:r.turn.resolvedModelConfiguration?.modelFamily??r.turn.userRequestedModel},n,void 0,!0,r.copilotEditsSessionHeader)}async invokeClientEditFileTool(e,r,n,o){let s=e.ctx.get(gs).getToolByNameAndProvider("insert_edit_into_file",rp);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(gs).invokeTool(e,s.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,code:n,explanation:r.input.explanation},roundId:r.roundId,toolCallId:r.toolCallId},o)}async getFinalEditFileResult(e,r,n,o,s){if(n.status!=="success")return n;let c=nO({uri:id(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"});if(o){let f=await tl(e.ctx,e,void 0);o.startReporter(h=>{this.handleEditSurvivalTelemetry(e,h,f,c,s)})}let l=GO(n.content),u=[];u.push(``),u.push("This is the new state of the file after the edit. Base future edits off of this file, no need to read it again, unless a terminal command may have changed it.");let d=new VO({code:l,languageId:c,noFilePath:!0});return u.push(...d.renderAsArray()),u.push(""),new Lr([new Rr(u.join(` -`))],"success")}handleEditSurvivalTelemetry(e,r,n,o,s){Pyn(e.ctx,"agentPanel",{requestSource:s?.requestSource??"",chatRequestModel:s?.chatRequestModel??"",mapper:s?.mapper??"",headerRequestId:s?.headerRequestId??"",mode:e.turn.getChatModeForTelemetry(),modelId:e.turn.getResolvedModelId()??"unknown",languageId:o},{survivalRateFourGram:r.fourGram,survivalRateNoRevert:r.noRevert,timeDelayMs:r.timeDelayMs,didBranchChange:r.didBranchChange,readDocumentTimeMs:r.readDocumentTimeMs??-1,diffComputationTimeMs:r.diffComputationTimeMs??-1,arc:r.arc??-1,originalCharCount:r.originalCharCount??-1,currentLineCount:r.currentLineCount??-1,currentDeletedLineCount:r.currentDeletedLineCount??-1,originalLineCount:r.originalLineCount??-1,originalDeletedLineCount:r.originalDeletedLineCount??-1},{currentFileContent:r.currentFileContent},n,"codeMapper.trackEditSurvival")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running insert_edit_into_file tool"};let o=id(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${BA(o)} with insert_edit_into_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(qd),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran insert_edit_into_file tool"};let o=id(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${BA(o)} with insert_edit_into_file tool`}}static toEditFileParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.code!="string")throw new Error("code must be a string");if(typeof e.explanation!="string")throw new Error("explanation must be a string");return{filePath:e.filePath,code:e.code,explanation:e.explanation}}};p();p();p();var mkn=require("crypto"),n5=de(require("fs/promises")),gkn=require("os"),r5=de(require("path"));var gF=class{constructor(e){this.ctx=e;this.logger=new fe("ripgrep");this.resolvePath()}static{a(this,"RipgrepPathResolver")}async resolvePath(){if(this.rgPath)return this.rgPath;let e=process.platform,r=process.arch;return this.rgPath=await this.resolvePathByOs(e,r),process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE?this.logger.info(this.ctx,`GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE already set to: ${process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE}`):(process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE=this.rgPath,this.logger.info(this.ctx,`Set GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE=${this.rgPath}`)),this.rgPath}async resolvePathByOs(e,r){this.logger.debug(this.ctx,`Start resolving ripgrep path for platform: ${e} and architecture: ${r}`);let n=process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE;if(n)return this.logger.info(this.ctx,`Using ripgrep from GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE: ${n}`),n;if(r!=="arm64"&&r!=="x64")throw new Error(`Unsupported architecture: ${r}`);let o=e==="win32"?"rg.exe":"rg";this.logger.debug(this.ctx,`__filename is ${__filename}, __dirname is ${__dirname}`);let s=r5.extname(__filename)===".ts"?r5.resolve(__dirname,"../../../packages/ripgrep/bin"):r5.resolve(__dirname,"./bin"),c=r5.resolve(s,e,r,o);if("pkg"in process){this.logger.debug(this.ctx,"Running inside pkg binary, start to copy ripgrep to a temporary location");let l=await n5.readFile(c),u=(0,mkn.createHash)("sha256").update(l).digest("hex"),d=process.env.PKG_NATIVE_CACHE_PATH||r5.join((0,gkn.homedir)(),".cache"),f=r5.join(d,"pkg",u);this.logger.info(this.ctx,`Using tmpFolder for ripgrep: ${f}`),await n5.mkdir(f,{recursive:!0});let h=Ji(Ks(c)),m=r5.join(f,h);try{await n5.stat(m)}catch{await n5.copyFile(c,m),this.logger.debug(this.ctx,`Copied ripgrep to ${m}`)}c=m,e!=="win32"&&await n5.chmod(c,493).catch(g=>{this.logger.error(this.ctx,`Failed to set executable permission for ${c}: ${g}`)})}return this.logger.info(this.ctx,`Resolved ripgrep path: ${c}`),c}};p();var Akn=require("child_process"),uWt=require("perf_hooks");var AF=new fe("ripgrepProcessManager"),yF=class{constructor(e,r,n){this.ctx=e;this.defaultTimeoutInMs=30*1e3;this.maxProcesses=4;this.maxPendingTasks=20;this.taskQueue=[];this.activeProcesses=new Set;this.maxProcesses=r??this.maxProcesses,this.maxPendingTasks=n??this.maxPendingTasks,AF.debug(this.ctx,`initialized with maxProcesses: ${this.maxProcesses} and maxPendingTasks: ${this.maxPendingTasks}`)}static{a(this,"RipgrepProcessManager")}dispose(){AF.debug(this.ctx,`Disposing ripgrep process manager with ${this.activeProcesses.size} active processes`),this.activeProcesses.forEach(e=>{if(!e.killed)try{e.kill()}catch(r){AF.error(this.ctx,"Failed to kill process. ",r)}}),this.activeProcesses.clear()}execute(e,r,n,o,s){return new Promise((c,l)=>{if(this.taskQueue.length>=this.maxPendingTasks){AF.error(this.ctx,`Task queue limit reached: ${this.maxPendingTasks}`),l(new Error(`Task queue limit of ${this.maxPendingTasks} reached`));return}if(s!==void 0&&s<=0){AF.error(this.ctx,`Invalid timeout value: ${s}`),l(new Error(`Invalid timeout value: ${s}`));return}AF.debug(this.ctx,`Adding task to queue: ${e} ${r.join(" ")}`),this.taskQueue.push({id:RJ(),command:e,args:r,options:o,resolve:c,reject:l,timeoutInMs:s??this.defaultTimeoutInMs,token:n});let u=this.taskQueue.map(d=>this.getTaskSimpleInfo(d)).join(` -`);AF.debug(this.ctx,`Current task queue length: ${this.taskQueue.length}, task list: ${u}`),this.runNextTask()})}runNextTask(){if(this.taskQueue.length===0||this.activeProcesses.size>=this.maxProcesses)return;let e=this.taskQueue.shift(),r=uWt.performance.now();AF.debug(this.ctx,`Starting task: ${this.getTaskSimpleInfo(e)}`);try{let n=(0,Akn.spawn)(e.command,e.args,e.options);this.activeProcesses.add(n);let o="",s="",c,l=a(()=>{c&&clearTimeout(c),this.activeProcesses.delete(n),n.stdout?.removeAllListeners(),n.stderr?.removeAllListeners(),n.removeAllListeners()},"cleanup");e.timeoutInMs&&(c=setTimeout(()=>{n.killed||(n.kill(),e.reject(new Error(`Process timed out after ${e.timeoutInMs} ms. Partial output: ${o}`))),l(),this.runNextTask()},e.timeoutInMs)),e.token&&e.token.onCancellationRequested(()=>{n.killed||(n.kill(),e.reject(new Error("Process was cancelled. Partial output: "+o))),l(),this.runNextTask()}),n.stdout?.on("data",u=>{o+=u.toString()}),n.stderr?.on("data",u=>{s+=u.toString()}),n.on("close",u=>{let f=uWt.performance.now()-r;AF.debug(this.ctx,`Task ${e.id} completed in ${f} ms`),l(),u===0?e.resolve(o):u===1?e.resolve(""):e.reject(new Error(`Process exited with code ${u}: ${s}`)),this.runNextTask()}),n.on("error",u=>{l(),e.reject(new Error(`Failed to start process: ${u.message}`)),this.runNextTask()})}catch(n){e.reject(new Error(`Error spawning process: ${n.message}`)),this.runNextTask()}}getTaskSimpleInfo(e){return`${e.id} - ${e.command} ${e.args.join(" ")}`}};function ftt(t){return t.some(e=>!la.isRegisteredScheme(to(e.uri).scheme))}a(ftt,"hasRipgrepWorkspaceFolder");async function ptt(t,e){try{return{rgPath:await t.ctx.get(gF).resolvePath(),ripgrepManager:t.ctx.get(yF)}}catch(r){throw new Error(`Failed to run ${e} since failed to get ripgrep path: ${String(r)}`)}}a(ptt,"resolveRipgrepResources");var ykn=new fe("findFilesTool"),htt=class t extends vu{static{a(this,"FindFilesTool")}static{this.timeOutInSeconds=15}constructor(){super({name:"file_search",displayName:"Find Files",description:`Search for files in the workspace by glob pattern. Returns matching file paths sorted by modification time. +}`}),explanation:S.String({description:"A short explanation of the edit being made."})})})}async invoke(e,r,n){try{let o=await this.mapCode(r.input,e,n),s=o.code,c=await this.invokeClientEditFileTool(e,r,s,n);return await this.getFinalEditFileResult(e,r,c,o.editSurvivalTrackingSession,o.telemetry)}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Fr([new Pr(s)],"error")}}async mapCode(e,r,n){let{filePath:o}=e,s=cd(o,r.uriSchemeCache);if(!s)throw new Error(`Invalid file path: ${o}`);return await new Ftt(r.ctx).mapCode({code:e.code,resource:s,markdownBeforeBlock:e.explanation},r.toLlmInteraction(),{chatRequestSource:r.conversation.source,chatRequestModel:r.turn.resolvedModelConfiguration?.modelFamily??r.turn.userRequestedModel},n,void 0,!0,r.copilotEditsSessionHeader)}async invokeClientEditFileTool(e,r,n,o){let s=e.ctx.get(hs).getToolByNameAndProvider("insert_edit_into_file",op);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(hs).invokeTool(e,s.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,code:n,explanation:r.input.explanation},roundId:r.roundId,toolCallId:r.toolCallId},o)}async getFinalEditFileResult(e,r,n,o,s){if(n.status!=="success")return n;let c=uO({uri:cd(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"});if(o){let f=await rl(e.ctx,e,void 0);o.startReporter(h=>{this.handleEditSurvivalTelemetry(e,h,f,c,s)})}let l=KO(n.content),u=[];u.push(``),u.push("This is the new state of the file after the edit. Base future edits off of this file, no need to read it again, unless a terminal command may have changed it.");let d=new ZO({code:l,languageId:c,noFilePath:!0});return u.push(...d.renderAsArray()),u.push(""),new Fr([new Pr(u.join(` +`))],"success")}handleEditSurvivalTelemetry(e,r,n,o,s){a_n(e.ctx,"agentPanel",{requestSource:s?.requestSource??"",chatRequestModel:s?.chatRequestModel??"",mapper:s?.mapper??"",headerRequestId:s?.headerRequestId??"",mode:e.turn.getChatModeForTelemetry(),modelId:e.turn.getResolvedModelId()??"unknown",languageId:o},{survivalRateFourGram:r.fourGram,survivalRateNoRevert:r.noRevert,timeDelayMs:r.timeDelayMs,didBranchChange:r.didBranchChange,readDocumentTimeMs:r.readDocumentTimeMs??-1,diffComputationTimeMs:r.diffComputationTimeMs??-1,arc:r.arc??-1,originalCharCount:r.originalCharCount??-1,currentLineCount:r.currentLineCount??-1,currentDeletedLineCount:r.currentDeletedLineCount??-1,originalLineCount:r.originalLineCount??-1,originalDeletedLineCount:r.originalDeletedLineCount??-1},{currentFileContent:r.currentFileContent},n,"codeMapper.trackEditSurvival")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running insert_edit_into_file tool"};let o=cd(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${QA(o)} with insert_edit_into_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Vd),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran insert_edit_into_file tool"};let o=cd(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${QA(o)} with insert_edit_into_file tool`}}static toEditFileParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.code!="string")throw new Error("code must be a string");if(typeof e.explanation!="string")throw new Error("explanation must be a string");return{filePath:e.filePath,code:e.code,explanation:e.explanation}}};p();p();p();var VPn=require("crypto"),d5=fe(require("fs/promises")),WPn=require("os"),u5=fe(require("path"));var SF=class{constructor(e){this.ctx=e;this.logger=new pe("ripgrep");this.resolvePath()}static{a(this,"RipgrepPathResolver")}async resolvePath(){if(this.rgPath)return this.rgPath;let e=process.platform,r=process.arch;return this.rgPath=await this.resolvePathByOs(e,r),process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE?this.logger.info(this.ctx,`GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE already set to: ${process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE}`):(process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE=this.rgPath,this.logger.info(this.ctx,`Set GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE=${this.rgPath}`)),this.rgPath}async resolvePathByOs(e,r){this.logger.debug(this.ctx,`Start resolving ripgrep path for platform: ${e} and architecture: ${r}`);let n=process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE;if(n)return this.logger.info(this.ctx,`Using ripgrep from GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE: ${n}`),n;if(r!=="arm64"&&r!=="x64")throw new Error(`Unsupported architecture: ${r}`);let o=e==="win32"?"rg.exe":"rg";this.logger.debug(this.ctx,`__filename is ${__filename}, __dirname is ${__dirname}`);let s=u5.extname(__filename)===".ts"?u5.resolve(__dirname,"../../../packages/ripgrep/bin"):u5.resolve(__dirname,"./bin"),c=u5.resolve(s,e,r,o);if("pkg"in process){this.logger.debug(this.ctx,"Running inside pkg binary, start to copy ripgrep to a temporary location");let l=await d5.readFile(c),u=(0,VPn.createHash)("sha256").update(l).digest("hex"),d=process.env.PKG_NATIVE_CACHE_PATH||u5.join((0,WPn.homedir)(),".cache"),f=u5.join(d,"pkg",u);this.logger.info(this.ctx,`Using tmpFolder for ripgrep: ${f}`),await d5.mkdir(f,{recursive:!0});let h=Ki(ts(c)),m=u5.join(f,h);try{await d5.stat(m)}catch{await d5.copyFile(c,m),this.logger.debug(this.ctx,`Copied ripgrep to ${m}`)}c=m,e!=="win32"&&await d5.chmod(c,493).catch(g=>{this.logger.error(this.ctx,`Failed to set executable permission for ${c}: ${g}`)})}return this.logger.info(this.ctx,`Resolved ripgrep path: ${c}`),c}};p();var zPn=require("child_process"),rzt=require("perf_hooks");var TF=new pe("ripgrepProcessManager"),IF=class{constructor(e,r,n){this.ctx=e;this.defaultTimeoutInMs=30*1e3;this.maxProcesses=4;this.maxPendingTasks=20;this.taskQueue=[];this.activeProcesses=new Set;this.maxProcesses=r??this.maxProcesses,this.maxPendingTasks=n??this.maxPendingTasks,TF.debug(this.ctx,`initialized with maxProcesses: ${this.maxProcesses} and maxPendingTasks: ${this.maxPendingTasks}`)}static{a(this,"RipgrepProcessManager")}dispose(){TF.debug(this.ctx,`Disposing ripgrep process manager with ${this.activeProcesses.size} active processes`),this.activeProcesses.forEach(e=>{if(!e.killed)try{e.kill()}catch(r){TF.error(this.ctx,"Failed to kill process. ",r)}}),this.activeProcesses.clear()}execute(e,r,n,o,s){return new Promise((c,l)=>{if(this.taskQueue.length>=this.maxPendingTasks){TF.error(this.ctx,`Task queue limit reached: ${this.maxPendingTasks}`),l(new Error(`Task queue limit of ${this.maxPendingTasks} reached`));return}if(s!==void 0&&s<=0){TF.error(this.ctx,`Invalid timeout value: ${s}`),l(new Error(`Invalid timeout value: ${s}`));return}TF.debug(this.ctx,`Adding task to queue: ${e} ${r.join(" ")}`),this.taskQueue.push({id:UJ(),command:e,args:r,options:o,resolve:c,reject:l,timeoutInMs:s??this.defaultTimeoutInMs,token:n});let u=this.taskQueue.map(d=>this.getTaskSimpleInfo(d)).join(` +`);TF.debug(this.ctx,`Current task queue length: ${this.taskQueue.length}, task list: ${u}`),this.runNextTask()})}runNextTask(){if(this.taskQueue.length===0||this.activeProcesses.size>=this.maxProcesses)return;let e=this.taskQueue.shift(),r=rzt.performance.now();TF.debug(this.ctx,`Starting task: ${this.getTaskSimpleInfo(e)}`);try{let n=(0,zPn.spawn)(e.command,e.args,e.options);this.activeProcesses.add(n);let o="",s="",c,l=a(()=>{c&&clearTimeout(c),this.activeProcesses.delete(n),n.stdout?.removeAllListeners(),n.stderr?.removeAllListeners(),n.removeAllListeners()},"cleanup");e.timeoutInMs&&(c=setTimeout(()=>{n.killed||(n.kill(),e.reject(new Error(`Process timed out after ${e.timeoutInMs} ms. Partial output: ${o}`))),l(),this.runNextTask()},e.timeoutInMs)),e.token&&e.token.onCancellationRequested(()=>{n.killed||(n.kill(),e.reject(new Error("Process was cancelled. Partial output: "+o))),l(),this.runNextTask()}),n.stdout?.on("data",u=>{o+=u.toString()}),n.stderr?.on("data",u=>{s+=u.toString()}),n.on("close",u=>{let f=rzt.performance.now()-r;TF.debug(this.ctx,`Task ${e.id} completed in ${f} ms`),l(),u===0?e.resolve(o):u===1?e.resolve(""):e.reject(new Error(`Process exited with code ${u}: ${s}`)),this.runNextTask()}),n.on("error",u=>{l(),e.reject(new Error(`Failed to start process: ${u.message}`)),this.runNextTask()})}catch(n){e.reject(new Error(`Error spawning process: ${n.message}`)),this.runNextTask()}}getTaskSimpleInfo(e){return`${e.id} - ${e.command} ${e.args.join(" ")}`}};function Qtt(t){return t.some(e=>!ua.isRegisteredScheme(eo(e.uri).scheme))}a(Qtt,"hasRipgrepWorkspaceFolder");async function qtt(t,e){try{return{rgPath:await t.ctx.get(SF).resolvePath(),ripgrepManager:t.ctx.get(IF)}}catch(r){throw new Error(`Failed to run ${e} since failed to get ripgrep path: ${String(r)}`)}}a(qtt,"resolveRipgrepResources");var YPn=new pe("findFilesTool"),jtt=class t extends bu{static{a(this,"FindFilesTool")}static{this.timeOutInSeconds=15}constructor(){super({name:"file_search",displayName:"Find Files",description:`Search for files in the workspace by glob pattern. Returns matching file paths sorted by modification time. When to Use: - Find files by name or extension pattern @@ -3640,12 +3640,12 @@ Usage: Glob pattern examples: - **/*.{js,ts} to match all js/ts files in the workspace - src/** to match all files under the top-level src folder -- **/foo/**/*.js to match all js files under any foo folder`,displayDescription:"Search for files in the workspace by glob pattern.",inputSchema:S.Object({query:S.String({description:"Search for files with names or paths matching this glob pattern."}),maxResults:S.Optional(S.Number({description:"The maximum number of results to return. Do not use this unless necessary, it can slow things down. By default, only some matches are returned. If you use this and don't see what you're looking for, you can try again with a more specific query or a larger maxResults."}))})})}async invoke(e,r,n){try{let{query:o,maxResults:s=20}=r.input,c=e.turn.workspaceFolders;if(!c?.length)return new Lr([new Rr("Failed to invoke tool file_search since no workspace folders found")],"error");let l,u;if(ftt(c)){if(n.isCancellationRequested)return new Lr([new Rr("Cancelled")],"cancelled");({rgPath:l,ripgrepManager:u}=await ptt(e,"file_search"))}let d={},f=c.map(async A=>{if(n.isCancellationRequested)throw new Error("Canceled");let y=A.uri.toString();try{ykn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${y}`),la.isRegisteredScheme(to(A.uri).scheme)?d[y]=await this.searchViaContentProvider(e,A,o,s):d[y]=await this.searchViaRipgrep(u,l,A,o,n),ykn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${y} with results: ${d[y].join(` -`)}`)}catch(E){if(E instanceof bl){d[y]=[];return}let _=E instanceof Error?E.message:"An unknown error occurred";throw new Error(`Error processing workspace folder ${y}: ${_}`)}});try{await Promise.all(f)}catch(A){let y=A instanceof Error?A.message:"An unknown error occurred";return new Lr([new Rr(y)],"error")}let h=[],m=s;for(;m>0;){let A=!1;for(let y in d)d[y].length>0&&m>0&&(h.push(d[y].shift()),m--,A=!0);if(!A)break}let g=h.length===0?`No files found matching query: ${o}`:h.length===1?`Found 1 file matching query: ${o} +- **/foo/**/*.js to match all js files under any foo folder`,displayDescription:"Search for files in the workspace by glob pattern.",inputSchema:S.Object({query:S.String({description:"Search for files with names or paths matching this glob pattern."}),maxResults:S.Optional(S.Number({description:"The maximum number of results to return. Do not use this unless necessary, it can slow things down. By default, only some matches are returned. If you use this and don't see what you're looking for, you can try again with a more specific query or a larger maxResults."}))})})}async invoke(e,r,n){try{let{query:o,maxResults:s=20}=r.input,c=e.turn.workspaceFolders;if(!c?.length)return new Fr([new Pr("Failed to invoke tool file_search since no workspace folders found")],"error");let l,u;if(Qtt(c)){if(n.isCancellationRequested)return new Fr([new Pr("Cancelled")],"cancelled");({rgPath:l,ripgrepManager:u}=await qtt(e,"file_search"))}let d={},f=c.map(async A=>{if(n.isCancellationRequested)throw new Error("Canceled");let y=A.uri.toString();try{YPn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${y}`),ua.isRegisteredScheme(eo(A.uri).scheme)?d[y]=await this.searchViaContentProvider(e,A,o,s):d[y]=await this.searchViaRipgrep(u,l,A,o,n),YPn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${y} with results: ${d[y].join(` +`)}`)}catch(E){if(E instanceof $l){d[y]=[];return}let _=E instanceof Error?E.message:"An unknown error occurred";throw new Error(`Error processing workspace folder ${y}: ${_}`)}});try{await Promise.all(f)}catch(A){let y=A instanceof Error?A.message:"An unknown error occurred";return new Fr([new Pr(y)],"error")}let h=[],m=s;for(;m>0;){let A=!1;for(let y in d)d[y].length>0&&m>0&&(h.push(d[y].shift()),m--,A=!0);if(!A)break}let g=h.length===0?`No files found matching query: ${o}`:h.length===1?`Found 1 file matching query: ${o} ${h[0]}`:`Found ${h.length} files matching query: ${o} ${h.join(` -`)}`;return new Lr([new Rr(g)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Lr([new Rr(s)],"error")}}async searchViaContentProvider(e,r,n,o){return(await e.ctx.get(la).findFiles({baseUri:r.uri.toString(),pattern:n,maxResults:o})).uris.slice()}async searchViaRipgrep(e,r,n,o,s){return(await e.execute(r,["--files","-g",o],s,{cwd:un(n.uri)},t.timeOutInSeconds*1e3)).split(` -`).map(l=>l.trim()).filter(l=>l.length>0).map(l=>`${un(wa(n.uri,l))}`)}prepareInvocation(e,r){let{input:n}=e;return n.query.length?{progressMessage:`Searching for files matching query: ${n.query}`}:{progressMessage:"Running file_search tool"}}prepareCompletion(e,r){let{input:n}=e;return n.query.length?{completionMessage:`Searched for files matching query: ${n.query}`}:{completionMessage:"Ran file_search tool"}}static toFindFilesParams(e){if(typeof e.query!="string")throw new Error("query must be a string");if(e.maxResults!=null&&(typeof e.maxResults!="number"||e.maxResults<0))throw new Error("maxResults must be a positive number or undefined");return{query:e.query,maxResults:typeof e.maxResults=="number"?e.maxResults:void 0}}};p();var Ekn=new fe("findTextInFilesTool"),mtt=class t extends vu{static{a(this,"FindTextInFilesTool")}static{this.timeOutInSeconds=15}constructor(){super({name:"grep_search",displayName:"Find Text In Files",description:`A text search tool for finding exact text or regex patterns in files. +`)}`;return new Fr([new Pr(g)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Fr([new Pr(s)],"error")}}async searchViaContentProvider(e,r,n,o){return(await e.ctx.get(ua).findFiles({baseUri:r.uri.toString(),pattern:n,maxResults:o})).uris.slice()}async searchViaRipgrep(e,r,n,o,s){return(await e.execute(r,["--files","-g",o],s,{cwd:ln(n.uri)},t.timeOutInSeconds*1e3)).split(` +`).map(l=>l.trim()).filter(l=>l.length>0).map(l=>`${ln(wa(n.uri,l))}`)}prepareInvocation(e,r){let{input:n}=e;return n.query.length?{progressMessage:`Searching for files matching query: ${n.query}`}:{progressMessage:"Running file_search tool"}}prepareCompletion(e,r){let{input:n}=e;return n.query.length?{completionMessage:`Searched for files matching query: ${n.query}`}:{completionMessage:"Ran file_search tool"}}static toFindFilesParams(e){if(typeof e.query!="string")throw new Error("query must be a string");if(e.maxResults!=null&&(typeof e.maxResults!="number"||e.maxResults<0))throw new Error("maxResults must be a positive number or undefined");return{query:e.query,maxResults:typeof e.maxResults=="number"?e.maxResults:void 0}}};p();var KPn=new pe("findTextInFilesTool"),Htt=class t extends bu{static{a(this,"FindTextInFilesTool")}static{this.timeOutInSeconds=15}constructor(){super({name:"grep_search",displayName:"Find Text In Files",description:`A text search tool for finding exact text or regex patterns in files. When to Use: - Exact text or symbol searches (function names, variable names, imports) @@ -3658,13 +3658,13 @@ When NOT to Use: Usage: - Supports regex syntax when isRegexp is true (e.g., "log.*Error", "function\\s+\\w+") -- Use includePattern to filter by file type (e.g., "*.js", "*.{ts,tsx}")`,displayDescription:"Do a text search in the workspace.",inputSchema:S.Object({query:S.String({description:"The pattern to search for in files in the workspace. Can be a regex or plain text pattern"}),isRegexp:S.Optional(S.Boolean({description:"Whether the pattern is a regex. False by default."})),includePattern:S.Optional(S.String({description:"Search files matching this glob pattern. Will be applied to the relative path of files within the workspace."}))})})}async invoke(e,r,n){try{let{query:o,isRegexp:s=!1,includePattern:c}=r.input,l=20,u=e.turn.workspaceFolders;if(!u?.length)return new Lr([new Rr("Failed to invoke tool grep_search since no workspace folders found")],"error");let d,f;if(ftt(u)){if(n.isCancellationRequested)return new Lr([new Rr("Cancelled")],"cancelled");({rgPath:d,ripgrepManager:f}=await ptt(e,"grep_search"))}let h={},m=u.map(async E=>{if(n.isCancellationRequested)throw new Error("Canceled");let _=E.uri.toString();try{Ekn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${_}`),la.isRegisteredScheme(to(E.uri).scheme)?h[_]=await this.searchViaContentProvider(e,E,o,s,c,l):h[_]=await this.searchViaRipgrep(f,d,E,o,s,c,n),Ekn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${_} with results: ${h[_].join(` -`)}`)}catch(v){if(v instanceof bl){h[_]=[];return}let b=v instanceof Error?v.message:"An unknown error occurred";throw new Error(`Error processing workspace folder ${_}: ${b}`)}});try{await Promise.all(m)}catch(E){let _=E instanceof Error?E.message:"An unknown error occurred";return new Lr([new Rr(_)],"error")}let g=[],A=l;for(;A>0;){let E=!1;for(let _ in h)h[_].length>0&&A>0&&(g.push(h[_].shift()),A--,E=!0);if(!E)break}let y=g.length===0?`Searched text for ${o}, no results`:g.length===1?`Searched text for: ${o}, 1 result +- Use includePattern to filter by file type (e.g., "*.js", "*.{ts,tsx}")`,displayDescription:"Do a text search in the workspace.",inputSchema:S.Object({query:S.String({description:"The pattern to search for in files in the workspace. Can be a regex or plain text pattern"}),isRegexp:S.Optional(S.Boolean({description:"Whether the pattern is a regex. False by default."})),includePattern:S.Optional(S.String({description:"Search files matching this glob pattern. Will be applied to the relative path of files within the workspace."}))})})}async invoke(e,r,n){try{let{query:o,isRegexp:s=!1,includePattern:c}=r.input,l=20,u=e.turn.workspaceFolders;if(!u?.length)return new Fr([new Pr("Failed to invoke tool grep_search since no workspace folders found")],"error");let d,f;if(Qtt(u)){if(n.isCancellationRequested)return new Fr([new Pr("Cancelled")],"cancelled");({rgPath:d,ripgrepManager:f}=await qtt(e,"grep_search"))}let h={},m=u.map(async E=>{if(n.isCancellationRequested)throw new Error("Canceled");let _=E.uri.toString();try{KPn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${_}`),ua.isRegisteredScheme(eo(E.uri).scheme)?h[_]=await this.searchViaContentProvider(e,E,o,s,c,l):h[_]=await this.searchViaRipgrep(f,d,E,o,s,c,n),KPn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${_} with results: ${h[_].join(` +`)}`)}catch(v){if(v instanceof $l){h[_]=[];return}let b=v instanceof Error?v.message:"An unknown error occurred";throw new Error(`Error processing workspace folder ${_}: ${b}`)}});try{await Promise.all(m)}catch(E){let _=E instanceof Error?E.message:"An unknown error occurred";return new Fr([new Pr(_)],"error")}let g=[],A=l;for(;A>0;){let E=!1;for(let _ in h)h[_].length>0&&A>0&&(g.push(h[_].shift()),A--,E=!0);if(!E)break}let y=g.length===0?`Searched text for ${o}, no results`:g.length===1?`Searched text for: ${o}, 1 result ${g[0]}`:`Searched text for: ${o}, ${g.length} results ${g.join(` -`)}`;return new Lr([new Rr(y)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Lr([new Rr(s)],"error")}}async searchViaContentProvider(e,r,n,o,s,c){return(await e.ctx.get(la).findTextInFiles({baseUri:r.uri.toString(),query:n,isRegexp:o,includePattern:s,maxResults:c})).matches.map(d=>`${d.uri}:${d.lineNumber}:${d.lineText}`)}async searchViaRipgrep(e,r,n,o,s,c,l){let u=[s?"--regexp":"--fixed-strings",o,...c?["-g",c]:[],"--no-heading","--line-number","--color","never",un(n.uri)];return(await e.execute(r,u,l,{cwd:un(n.uri)},t.timeOutInSeconds*1e3)).split(` -`).map(f=>f.trim()).filter(f=>f.length>0)}prepareInvocation(e,r){let{input:n}=e;return n.query.length?{progressMessage:`Searching for text in files matching query: ${n.query}`}:{progressMessage:"Running grep_search tool"}}prepareCompletion(e,r){let{input:n}=e;return n.query.length?{completionMessage:`Searched for text in files matching query: ${n.query}`}:{completionMessage:"Ran grep_search tool"}}static toFindTextInFilesParams(e){if(typeof e.query!="string")throw new Error("query must be a string");if(e.isRegexp!==void 0&&typeof e.isRegexp!="boolean")throw new Error("isRegexp must be a boolean");if(e.includePattern!==void 0&&typeof e.includePattern!="string")throw new Error("includePattern must be a string");return{query:e.query,isRegexp:e.isRegexp??!1,includePattern:e.includePattern}}};p();var Att=de(require("path"));var gtt=class extends vu{static{a(this,"ListDirTool")}constructor(){super({name:"list_dir",displayName:"List Directory",description:"List the contents of a directory. Result will have the name of the child. If the name ends in /, it's a folder, otherwise a file",displayDescription:"List the contents of a directory",inputSchema:S.Object({path:S.String({description:"The absolute path to the directory to list."})})})}async invoke(e,r,n){let{path:o}=r.input,s=e.turn.workspaceFolders,c=e.turn.workspaceFolder,l=id(o,e.uriSchemeCache);if(!this.isPathWithinWorkspace(l,s,c))return new Lr([new Rr("Error: Path is outside of workspace folders")],"error");let u=await OXe(e.ctx,l.toString());return u.length===0?new Lr([new Rr("Folder is empty")],"success"):new Lr([new Rr(u.map(([d,f])=>`${d}${f&2?"/":""}`).join(` -`))],"success")}prepareInvocation(e,r){let n=id(e.input.path,e.uriSchemeCache);return{progressMessage:`Reading directory ${BA(n)}`}}prepareCompletion(e,r){let n=id(e.input.path,e.uriSchemeCache);return{completionMessage:`Read directory ${BA(n)}`}}isPathWithinWorkspace(e,r,n){return!r&&!n?!0:r&&r.length>0?r.some(o=>this.isUriWithinDirectory(e,o.uri)):n?this.isUriWithinDirectory(e,n.uri):!1}isUriWithinDirectory(e,r){let n=rs(e),o=rs(r);if(!n||!o)return!1;let s=Att.relative(o,n);return s===""?!0:!s.startsWith("..")&&!Att.isAbsolute(s)}static toListDirParams(e){if(typeof e.path!="string")throw new Error("path must be a string");return{path:e.path}}};p();var ytt=2e3,Ett=class t extends vu{static{a(this,"ReadFileTool")}constructor(){super({name:"read_file",displayName:"Read File",description:`Read the contents of a file from the local filesystem. +`)}`;return new Fr([new Pr(y)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Fr([new Pr(s)],"error")}}async searchViaContentProvider(e,r,n,o,s,c){return(await e.ctx.get(ua).findTextInFiles({baseUri:r.uri.toString(),query:n,isRegexp:o,includePattern:s,maxResults:c})).matches.map(d=>`${d.uri}:${d.lineNumber}:${d.lineText}`)}async searchViaRipgrep(e,r,n,o,s,c,l){let u=[s?"--regexp":"--fixed-strings",o,...c?["-g",c]:[],"--no-heading","--line-number","--color","never",ln(n.uri)];return(await e.execute(r,u,l,{cwd:ln(n.uri)},t.timeOutInSeconds*1e3)).split(` +`).map(f=>f.trim()).filter(f=>f.length>0)}prepareInvocation(e,r){let{input:n}=e;return n.query.length?{progressMessage:`Searching for text in files matching query: ${n.query}`}:{progressMessage:"Running grep_search tool"}}prepareCompletion(e,r){let{input:n}=e;return n.query.length?{completionMessage:`Searched for text in files matching query: ${n.query}`}:{completionMessage:"Ran grep_search tool"}}static toFindTextInFilesParams(e){if(typeof e.query!="string")throw new Error("query must be a string");if(e.isRegexp!==void 0&&typeof e.isRegexp!="boolean")throw new Error("isRegexp must be a boolean");if(e.includePattern!==void 0&&typeof e.includePattern!="string")throw new Error("includePattern must be a string");return{query:e.query,isRegexp:e.isRegexp??!1,includePattern:e.includePattern}}};p();var Gtt=class extends bu{static{a(this,"ListDirTool")}constructor(){super({name:"list_dir",displayName:"List Directory",description:"List the contents of a directory. Result will have the name of the child. If the name ends in /, it's a folder, otherwise a file",displayDescription:"List the contents of a directory",inputSchema:S.Object({path:S.String({description:"The absolute path to the directory to list."})})})}async invoke(e,r,n){let{path:o}=r.input,s=cd(o,e.uriSchemeCache),c=await uet(e.ctx,s.toString());return c.length===0?new Fr([new Pr("Folder is empty")],"success"):new Fr([new Pr(c.map(([l,u])=>`${l}${u&2?"/":""}`).join(` +`))],"success")}prepareInvocation(e,r){let n=cd(e.input.path,e.uriSchemeCache);return{progressMessage:`Reading directory ${QA(n)}`}}prepareCompletion(e,r){let n=cd(e.input.path,e.uriSchemeCache);return{completionMessage:`Read directory ${QA(n)}`}}static toListDirParams(e){if(typeof e.path!="string")throw new Error("path must be a string");return{path:e.path}}};p();var $tt=2e3,Vtt=class t extends bu{static{a(this,"ReadFileTool")}constructor(){super({name:"read_file",displayName:"Read File",description:`Read the contents of a file from the local filesystem. When to Use: - Reading known files you've already located @@ -3675,33 +3675,33 @@ Usage: - Prefer reading larger meaningful chunks over doing many small reads - You can call this tool again if initial contents are insufficient - It is always better to speculatively read multiple files as a batch that are potentially useful -- You don't need to read a file if it's already provided in context`,displayDescription:"Read a file in the workspace.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to read."}),offset:S.Optional(S.Number({description:"Optional: the 1-based line number to start reading from. Only use this if the file is too large to read at once. If not specified, the file will be read from the beginning."})),limit:S.Optional(S.Number({description:"Optional: the maximum number of lines to read. Only use this together with `offset` if the file is too large to read at once."}))})})}async invoke(e,r,n){try{let{filePath:o,offset:s,limit:c}=t.toReadFileParams(r.input),l=Math.min(Math.max(1,c??ytt),ytt),u=Math.max(1,s??1),d=u+l-1,f=id(o,e.uriSchemeCache);if(!f)throw new Error(`Invalid file path: ${o}`);let m=await e.ctx.get(ii).getOrReadTextDocument({uri:f});if(m.status==="valid"){let g=m.document.getText();if(g.length===0)return new Lr([new Rr(`The file \`${o}\` exists, but is empty.`)],"success");if(g.trim().length===0)return new Lr([new Rr(`The file \`${o}\` exists, but contains only whitespace.`)],"success");let A=m.document.lineCount,y=Math.min(d,A),E=l!==c&&y= 1), received: ${n}`)}if(o!==void 0){if(typeof o!="number")throw new Error(`limit must be a number, received: ${typeof o}`);if(o<1)throw new Error(`limit must be positive (>= 1), received: ${o}`)}return{filePath:r,offset:n,limit:o}}};p();p();var Zwe=class extends Error{static{a(this,"EditError")}constructor(e,r){super(e),this.kindForTelemetry=r}},_tt=class extends Zwe{static{a(this,"NoMatchError")}constructor(e,r){super(e,"noMatchFound"),this.file=r}},vtt=class extends Zwe{static{a(this,"MultipleMatchesError")}constructor(e,r){super(e,"multipleMatchesFound"),this.file=r}},Ctt=class extends Zwe{static{a(this,"NoChangeError")}constructor(e,r){super(e,"noChange"),this.file=r}};function Rns(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Rns,"escapeRegex");function kns(t,e){if(t===e)return 1;if(t.length===0||e.length===0)return 0;let r=[];for(let s=0;s<=t.length;s++)r[s]=[s];for(let s=0;s<=e.length;s++)r[0][s]=s;for(let s=1;s<=t.length;s++)for(let c=1;c<=e.length;c++){let l=t[s-1]===e[c-1]?0:1;r[s][c]=Math.min(r[s-1][c]+1,r[s][c-1]+1,r[s-1][c-1]+l)}let n=r[t.length][e.length],o=Math.max(t.length,e.length);return 1-n/o}a(kns,"calculateSimilarity");function dWt(t,e,r,n){let o=r.replace(/\r\n/g,` -`).replace(/\n/g,n),s=Pns(t,e,o);if(s.type!=="none")return s;let c=Dns(t,e,o,n);if(c.type!=="none")return c;let l=Nns(t,e,o,n);if(l.type!=="none")return l;let u=Mns(t,e,o,n,.8);return u.type!=="none"?u:{text:t,type:"none",editPosition:[],suggestion:"Try making your search string more specific or checking for whitespace/formatting differences."}}a(dWt,"findAndReplaceOne");function Pns(t,e,r){if(e.length===0)return{text:t,editPosition:[],type:"none"};let n=[];for(let c=0;;){let l=t.indexOf(e,c);if(l===-1)break;n.push(l),c=l+e.length}if(n.length===0)return{text:t,editPosition:[],type:"none"};if(n.length>1)return{text:t,type:"multiple",editPosition:n.map(c=>[c,c+e.length]),strategy:"exact",matchPositions:n,suggestion:"Multiple exact matches found. Make your search string more specific."};let o=n[0];return{text:t.slice(0,o)+r+t.slice(o+e.length),type:"exact",editPosition:[[o,o+e.length]]}}a(Pns,"tryExactMatch");function Dns(t,e,r,n){let o=t.split(n),s=e.split(n),c=o.map(m=>m.trim()),l=s.map(m=>m.trim()),u=[];for(let m=0;m<=c.length-l.length;m++){let g=!0;for(let A=0;A1)return{text:t,type:"multiple",editPosition:[],matchPositions:u,suggestion:"Multiple matches found with flexible whitespace. Make your search string more unique.",strategy:"whitespace"};let d=u[0],f=d+l.length;return{text:[...o.slice(0,d),r,...o.slice(f)].join(n),editPosition:[[d,f]],type:"whitespace"}}a(Dns,"tryWhitespaceFlexibleMatch");function Nns(t,e,r,n){if(!e.trim())return{text:t,editPosition:[],type:"none",suggestion:"Cannot perform fuzzy match with empty search string."};let o=t.replace(/\r\n/g,` +- You don't need to read a file if it's already provided in context`,displayDescription:"Read a file in the workspace.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to read."}),offset:S.Optional(S.Number({description:"Optional: the 1-based line number to start reading from. Only use this if the file is too large to read at once. If not specified, the file will be read from the beginning."})),limit:S.Optional(S.Number({description:"Optional: the maximum number of lines to read. Only use this together with `offset` if the file is too large to read at once."}))})})}async invoke(e,r,n){try{let{filePath:o,offset:s,limit:c}=t.toReadFileParams(r.input),l=Math.min(Math.max(1,c??$tt),$tt),u=Math.max(1,s??1),d=u+l-1,f=cd(o,e.uriSchemeCache);if(!f)throw new Error(`Invalid file path: ${o}`);let m=await e.ctx.get(ni).getOrReadTextDocument({uri:f});if(m.status==="valid"){let g=m.document.getText();if(g.length===0)return new Fr([new Pr(`The file \`${o}\` exists, but is empty.`)],"success");if(g.trim().length===0)return new Fr([new Pr(`The file \`${o}\` exists, but contains only whitespace.`)],"success");let A=m.document.lineCount,y=Math.min(d,A),E=l!==c&&y= 1), received: ${n}`)}if(o!==void 0){if(typeof o!="number")throw new Error(`limit must be a number, received: ${typeof o}`);if(o<1)throw new Error(`limit must be positive (>= 1), received: ${o}`)}return{filePath:r,offset:n,limit:o}}};p();p();var ARe=class extends Error{static{a(this,"EditError")}constructor(e,r){super(e),this.kindForTelemetry=r}},Wtt=class extends ARe{static{a(this,"NoMatchError")}constructor(e,r){super(e,"noMatchFound"),this.file=r}},ztt=class extends ARe{static{a(this,"MultipleMatchesError")}constructor(e,r){super(e,"multipleMatchesFound"),this.file=r}},Ytt=class extends ARe{static{a(this,"NoChangeError")}constructor(e,r){super(e,"noChange"),this.file=r}};function Mos(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Mos,"escapeRegex");function Oos(t,e){if(t===e)return 1;if(t.length===0||e.length===0)return 0;let r=[];for(let s=0;s<=t.length;s++)r[s]=[s];for(let s=0;s<=e.length;s++)r[0][s]=s;for(let s=1;s<=t.length;s++)for(let c=1;c<=e.length;c++){let l=t[s-1]===e[c-1]?0:1;r[s][c]=Math.min(r[s-1][c]+1,r[s][c-1]+1,r[s-1][c-1]+l)}let n=r[t.length][e.length],o=Math.max(t.length,e.length);return 1-n/o}a(Oos,"calculateSimilarity");function nzt(t,e,r,n){let o=r.replace(/\r\n/g,` +`).replace(/\n/g,n),s=Los(t,e,o);if(s.type!=="none")return s;let c=Bos(t,e,o,n);if(c.type!=="none")return c;let l=Fos(t,e,o,n);if(l.type!=="none")return l;let u=Uos(t,e,o,n,.8);return u.type!=="none"?u:{text:t,type:"none",editPosition:[],suggestion:"Try making your search string more specific or checking for whitespace/formatting differences."}}a(nzt,"findAndReplaceOne");function Los(t,e,r){if(e.length===0)return{text:t,editPosition:[],type:"none"};let n=[];for(let c=0;;){let l=t.indexOf(e,c);if(l===-1)break;n.push(l),c=l+e.length}if(n.length===0)return{text:t,editPosition:[],type:"none"};if(n.length>1)return{text:t,type:"multiple",editPosition:n.map(c=>[c,c+e.length]),strategy:"exact",matchPositions:n,suggestion:"Multiple exact matches found. Make your search string more specific."};let o=n[0];return{text:t.slice(0,o)+r+t.slice(o+e.length),type:"exact",editPosition:[[o,o+e.length]]}}a(Los,"tryExactMatch");function Bos(t,e,r,n){let o=t.split(n),s=e.split(n),c=o.map(m=>m.trim()),l=s.map(m=>m.trim()),u=[];for(let m=0;m<=c.length-l.length;m++){let g=!0;for(let A=0;A1)return{text:t,type:"multiple",editPosition:[],matchPositions:u,suggestion:"Multiple matches found with flexible whitespace. Make your search string more unique.",strategy:"whitespace"};let d=u[0],f=d+l.length;return{text:[...o.slice(0,d),r,...o.slice(f)].join(n),editPosition:[[d,f]],type:"whitespace"}}a(Bos,"tryWhitespaceFlexibleMatch");function Fos(t,e,r,n){if(!e.trim())return{text:t,editPosition:[],type:"none",suggestion:"Cannot perform fuzzy match with empty search string."};let o=t.replace(/\r\n/g,` `).replace(/\r/g,` `),s=e.replace(/\r\n/g,` `).replace(/\r/g,` `);if(o.includes(s)){let E=o.indexOf(s),_=0,v=0;for(let x=0;x0;x++)t[x]==="\r"&&t[x+1]===` -`?(x++,T--,b=x+1):(T--,b=x+1);let w=t.substring(0,_),R=t.substring(b);return{text:w+r+R,editPosition:[[_,b]],type:"fuzzy"}}let c=e.endsWith(n),l=e;c&&(l=e.slice(0,-n.length));let u=l.split(n),d=u.map((E,_)=>{let v=Rns(E);return _1)return{text:t,type:"multiple",editPosition:[],suggestion:"Multiple fuzzy matches found. Try including more context in your search string.",strategy:"fuzzy",matchPositions:h.map(E=>E.index||0)};let m=h[0],g=m.index||0,A=g+m[0].length;return{text:t.slice(0,g)+r+t.slice(A),type:"fuzzy",editPosition:[[g,A]]}}a(Nns,"tryFuzzyMatch");function Mns(t,e,r,n,o=.95){if(e.length>1e3||e.split(n).length>20)return{text:t,editPosition:[],type:"none"};let s=t.split(n),c=e.split(n);if(s.length>1e3)return{text:t,editPosition:[],type:"none"};let l={index:-1,similarity:0,length:0};for(let u=0;u<=s.length-c.length;u++){let d=0;for(let h=0;ho&&f>l.similarity&&(l={index:u,similarity:f,length:c.length})}if(l.index!==-1){let u=l.index,d=[...s];return d.splice(u,l.length,...r.split(n)),{text:d.join(n),type:"similarity",editPosition:[[u,u+l.length]],similarity:l.similarity,suggestion:`Used similarity matching (${(l.similarity*100).toFixed(1)}% similar). Verify the replacement.`}}return{text:t,editPosition:[],type:"none"}}a(Mns,"trySimilarityMatch");var _kn=new fe("replaceStringTool"),btt=class extends vu{static{a(this,"ReplaceStringTool")}constructor(){super({name:"replace_string_in_file",displayName:"Replace String",description:"Replace a specific string in a file with new content. Use this tool when you need to make precise text replacements. For best results, include sufficient context (3-5 lines before and after) to make the old string unique. The system will try multiple matching strategies if exact matching fails.",displayDescription:"Replace a specific string in a file.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),oldString:S.String({description:"The exact literal text to replace. Must uniquely identify the single instance to change. Include at least 3 lines of context BEFORE and AFTER the target text, matching whitespace and indentation precisely."}),newString:S.String({description:"The exact literal text to replace oldString with."}),explanation:S.Optional(S.String({description:"A short explanation of the string replacement being made."}))})})}async invoke(e,r,n){let{filePath:o,oldString:s,newString:c}=r.input;try{_kn.debug(e.ctx,`Start to replace string in file: ${o}`);let l=id(o,e.uriSchemeCache);if(s===c)throw new Ctt("Input and output are identical",o);let u=await this.readFileContent(e,l,n),d=u.includes(`\r +`?(x++,T--,b=x+1):(T--,b=x+1);let w=t.substring(0,_),R=t.substring(b);return{text:w+r+R,editPosition:[[_,b]],type:"fuzzy"}}let c=e.endsWith(n),l=e;c&&(l=e.slice(0,-n.length));let u=l.split(n),d=u.map((E,_)=>{let v=Mos(E);return _1)return{text:t,type:"multiple",editPosition:[],suggestion:"Multiple fuzzy matches found. Try including more context in your search string.",strategy:"fuzzy",matchPositions:h.map(E=>E.index||0)};let m=h[0],g=m.index||0,A=g+m[0].length;return{text:t.slice(0,g)+r+t.slice(A),type:"fuzzy",editPosition:[[g,A]]}}a(Fos,"tryFuzzyMatch");function Uos(t,e,r,n,o=.95){if(e.length>1e3||e.split(n).length>20)return{text:t,editPosition:[],type:"none"};let s=t.split(n),c=e.split(n);if(s.length>1e3)return{text:t,editPosition:[],type:"none"};let l={index:-1,similarity:0,length:0};for(let u=0;u<=s.length-c.length;u++){let d=0;for(let h=0;ho&&f>l.similarity&&(l={index:u,similarity:f,length:c.length})}if(l.index!==-1){let u=l.index,d=[...s];return d.splice(u,l.length,...r.split(n)),{text:d.join(n),type:"similarity",editPosition:[[u,u+l.length]],similarity:l.similarity,suggestion:`Used similarity matching (${(l.similarity*100).toFixed(1)}% similar). Verify the replacement.`}}return{text:t,editPosition:[],type:"none"}}a(Uos,"trySimilarityMatch");var JPn=new pe("replaceStringTool"),Ktt=class extends bu{static{a(this,"ReplaceStringTool")}constructor(){super({name:"replace_string_in_file",displayName:"Replace String",description:"Replace a specific string in a file with new content. Use this tool when you need to make precise text replacements. For best results, include sufficient context (3-5 lines before and after) to make the old string unique. The system will try multiple matching strategies if exact matching fails.",displayDescription:"Replace a specific string in a file.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),oldString:S.String({description:"The exact literal text to replace. Must uniquely identify the single instance to change. Include at least 3 lines of context BEFORE and AFTER the target text, matching whitespace and indentation precisely."}),newString:S.String({description:"The exact literal text to replace oldString with."}),explanation:S.Optional(S.String({description:"A short explanation of the string replacement being made."}))})})}async invoke(e,r,n){let{filePath:o,oldString:s,newString:c}=r.input;try{JPn.debug(e.ctx,`Start to replace string in file: ${o}`);let l=cd(o,e.uriSchemeCache);if(s===c)throw new Ytt("Input and output are identical",o);let u=await this.readFileContent(e,l,n),d=u.includes(`\r `)?`\r `:` -`,f=dWt(u,s,c,d);if(f.type==="none"&&s.endsWith(` +`,f=nzt(u,s,c,d);if(f.type==="none"&&s.endsWith(` `)){let m=s.endsWith(`\r `)?`\r `:` -`,g=s.substring(0,s.length-m.length);u.endsWith(g)&&(_kn.info(e.ctx,`Adjusting oldString by removing trailing EOL: ${JSON.stringify(m)} for file ${o}`),f=dWt(u,g,c,d))}if(f.type==="none")throw new _tt(`Could not find the specified text in the file. ${f.suggestion||""}`,o);if(f.type==="multiple")throw new vtt(`Found multiple matches for the specified text. ${f.suggestion||""}`,o);if(n.isCancellationRequested)throw new Error(`Cancellation token triggered when replace string for file ${o}`);let h=await this.invokeClientEditFileTool(e,r,f.text,n);return this.getFinalReplaceStringResult(o,h)}catch(l){let u=l instanceof Error?l.message:`An unknown error occurred when updating file ${o} with oldString '${s}' to newString '${c}'`;return new Lr([new Rr(u)],"error")}}async readFileContent(e,r,n){let s=await e.ctx.get(ii).getOrReadTextDocument({uri:r});if(s.status==="notfound")throw new Error(`File not found: ${r}. Details: ${s.message}`);if(s.status==="invalid")throw new Error(`Invalid file: ${r}. Reason: ${s.reason}`);return s.document.getText()}async invokeClientEditFileTool(e,r,n,o){let s=e.ctx.get(gs).getToolByNameAndProvider("insert_edit_into_file",rp);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(gs).invokeTool(e,s.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,code:n,explanation:r.input.explanation??""},roundId:r.roundId,toolCallId:r.toolCallId},o)}getFinalReplaceStringResult(e,r){if(r.status!=="success")return r;let n=`The following files were successfully edited: -${e}`;return new Lr([new Rr(n)],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running replace_string_in_file tool"};let o=id(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${BA(o)} with replace_string_in_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(qd),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran replace_string_in_file tool"};let o=id(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${BA(o)} with replace_string_in_file tool`}}static toReplaceStringParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.oldString!="string")throw new Error("oldString must be a string");if(typeof e.newString!="string")throw new Error("newString must be a string");if(e.explanation!==void 0&&typeof e.explanation!="string")throw new Error("explanation must be a string");return{filePath:e.filePath,oldString:e.oldString,newString:e.newString,explanation:e.explanation}}};p();var Ttt=de(AP());var up=new fe("validateCvesTool"),Stt=class t extends vu{static{a(this,"ValidateCvesTool")}static{this.COORDINATE_BATCH_SIZE=30}static{this.ADVISORY_PAGE_SIZE=100}constructor(){super({name:"validate_cves",displayName:"Validate CVEs",description:"Validates dependencies for known security vulnerabilities (CVEs). Returns CVE details for each affected dependency and the minimum version that resolves all known vulnerabilities.",displayDescription:"Check dependencies for CVEs",inputSchema:S.Object({dependencies:S.Array(S.String({description:'Dependencies to check for CVEs. Format: package@version (Maven uses groupId:artifactId@version, e.g., "org.springframework:spring-core@5.3.20"; others use package@version, e.g., "django@3.2.0")'})),ecosystem:S.Enum(lqt,{description:"Package ecosystem (actions, composer, erlang, go, maven, npm, nuget, pip, pub, rubygems, rust)"})})})}async invoke(e,r,n){if(n.isCancellationRequested)return up.debug(e.ctx,"CVE validation cancelled at start"),new Lr([new Rr("CVE validation cancelled")],"cancelled");let{dependencies:o,ecosystem:s}=r.input;try{if(!o?.length)return up.debug(e.ctx,"No dependencies provided to validate"),new Lr([new Rr("validate_cves: No dependencies to validate. Please provide a list of dependencies to check for CVEs.")],"success");if(up.info(e.ctx,`Validating ${o.length} ${s} dependencies for CVEs`,o),n.isCancellationRequested)return up.debug(e.ctx,"CVE validation cancelled before GitHub API calls"),new Lr([new Rr("CVE validation cancelled")],"cancelled");let c=await this.batchGetCVEs(e,o,s,n),l=this.formatCVEResults(c);if(up.info(e.ctx,`Found ${c.length} dependencies with CVEs`),c.length>0){let u=c.map(d=>`${d.dep}: ${d.cves.length} CVEs`).join(", ");up.debug(e.ctx,`CVE summary: ${u}`)}return new Lr([new Rr(l)],"success")}catch(c){if(xP(c))return up.debug(e.ctx,"CVE validation cancelled"),new Lr([new Rr("CVE validation cancelled")],"cancelled");let l=c instanceof Error?c.message:String(c);return up.exception(e.ctx,c,".invoke"),new Lr([new Rr(`validate_cves: Error validating CVEs: ${l}`)],"error")}}prepareInvocation(e,r){let{dependencies:n,ecosystem:o}=e.input;return{progressMessage:`validate_cves: Validating ${n.length} ${o} dependencies for CVEs...`}}prepareCompletion(e,r){let{dependencies:n,ecosystem:o}=e.input;return{completionMessage:`validate_cves: Validated ${n.length} ${o} dependencies for CVEs`}}async batchGetCVEs(e,r,n,o){up.debug(e.ctx,`Fetching CVEs for ${r.length} dependencies in batches`);let s=[];for(let c=0;c!u.withdrawn_at?.trim()).map(u=>({id:u.cve_id||u.ghsa_id,ghsa_id:u.ghsa_id,severity:u.severity,summary:u.summary,description:u.description||u.summary,html_url:u.html_url,affectedDeps:(u.vulnerabilities??[]).map(d=>({name:d.package?.name,vulVersions:d.vulnerable_version_range,patchedVersion:d.first_patched_version}))})),l=s.length-c.length;return up.debug(e.ctx,`Filtered to ${c.length} active CVEs (${l} withdrawn advisories excluded)`),this.groupCVEsByDependency(e,c,r)}catch(o){throw up.exception(e.ctx,o,".getCVEs"),o}}groupCVEsByDependency(e,r,n){up.debug(e.ctx,`Grouping CVEs by dependency for ${n.length} dependencies`);let o=[];for(let s of n){let c=s.lastIndexOf("@"),l=c>0?s.substring(0,c):s,u=r.filter(h=>h.affectedDeps.some(m=>m.name===l));if(u.length<1)continue;let d=null,f=[];for(let h of u){let m=h.affectedDeps.find(A=>A.name===l)?.patchedVersion;if(!m){f.push(h.id),up.debug(e.ctx,`CVE ${h.id} for ${s}: no patched version available (unfixable)`);continue}let g=Ttt.coerce(m);if(!g){f.push(h.id),up.warn(e.ctx,`CVE ${h.id} for ${s}: invalid version string "${m}" (treating as unfixable)`);continue}up.debug(e.ctx,`CVE ${h.id} for ${s}: patched version ${m}, current max ${d||"none"}`),(d===null||Ttt.gt(g,d))&&(d=g.version)}o.push({dep:s,cves:u,minVersion:d,unfixableCves:f})}return up.debug(e.ctx,`Grouped into ${o.length} dependencies with CVEs`),o}formatCVEResults(e){return e.length===0?"No known CVEs are found for the given dependencies.":`The following dependencies have known CVEs: -${e.map(n=>{let o=n.cves.map(f=>{let h=`[${f.id}](${f.html_url}): ${zVt(f.summary)} +`,g=s.substring(0,s.length-m.length);u.endsWith(g)&&(JPn.info(e.ctx,`Adjusting oldString by removing trailing EOL: ${JSON.stringify(m)} for file ${o}`),f=nzt(u,g,c,d))}if(f.type==="none")throw new Wtt(`Could not find the specified text in the file. ${f.suggestion||""}`,o);if(f.type==="multiple")throw new ztt(`Found multiple matches for the specified text. ${f.suggestion||""}`,o);if(n.isCancellationRequested)throw new Error(`Cancellation token triggered when replace string for file ${o}`);let h=await this.invokeClientEditFileTool(e,r,f.text,n);return this.getFinalReplaceStringResult(o,h)}catch(l){let u=l instanceof Error?l.message:`An unknown error occurred when updating file ${o} with oldString '${s}' to newString '${c}'`;return new Fr([new Pr(u)],"error")}}async readFileContent(e,r,n){let s=await e.ctx.get(ni).getOrReadTextDocument({uri:r});if(s.status==="notfound")throw new Error(`File not found: ${r}. Details: ${s.message}`);if(s.status==="invalid")throw new Error(`Invalid file: ${r}. Reason: ${s.reason}`);return s.document.getText()}async invokeClientEditFileTool(e,r,n,o){let s=e.ctx.get(hs).getToolByNameAndProvider("insert_edit_into_file",op);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(hs).invokeTool(e,s.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,code:n,explanation:r.input.explanation??""},roundId:r.roundId,toolCallId:r.toolCallId},o)}getFinalReplaceStringResult(e,r){if(r.status!=="success")return r;let n=`The following files were successfully edited: +${e}`;return new Fr([new Pr(n)],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running replace_string_in_file tool"};let o=cd(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${QA(o)} with replace_string_in_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Vd),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran replace_string_in_file tool"};let o=cd(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${QA(o)} with replace_string_in_file tool`}}static toReplaceStringParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.oldString!="string")throw new Error("oldString must be a string");if(typeof e.newString!="string")throw new Error("newString must be a string");if(e.explanation!==void 0&&typeof e.explanation!="string")throw new Error("explanation must be a string");return{filePath:e.filePath,oldString:e.oldString,newString:e.newString,explanation:e.explanation}}};p();var Ztt=fe(IP());var pp=new pe("validateCvesTool"),Jtt=class t extends bu{static{a(this,"ValidateCvesTool")}static{this.COORDINATE_BATCH_SIZE=30}static{this.ADVISORY_PAGE_SIZE=100}constructor(){super({name:"validate_cves",displayName:"Validate CVEs",description:"Validates dependencies for known security vulnerabilities (CVEs). Returns CVE details for each affected dependency and the minimum version that resolves all known vulnerabilities.",displayDescription:"Check dependencies for CVEs",inputSchema:S.Object({dependencies:S.Array(S.String({description:'Dependencies to check for CVEs. Format: package@version (Maven uses groupId:artifactId@version, e.g., "org.springframework:spring-core@5.3.20"; others use package@version, e.g., "django@3.2.0")'})),ecosystem:S.Enum(tjt,{description:"Package ecosystem (actions, composer, erlang, go, maven, npm, nuget, pip, pub, rubygems, rust)"})})})}async invoke(e,r,n){if(n.isCancellationRequested)return pp.debug(e.ctx,"CVE validation cancelled at start"),new Fr([new Pr("CVE validation cancelled")],"cancelled");let{dependencies:o,ecosystem:s}=r.input;try{if(!o?.length)return pp.debug(e.ctx,"No dependencies provided to validate"),new Fr([new Pr("validate_cves: No dependencies to validate. Please provide a list of dependencies to check for CVEs.")],"success");if(pp.info(e.ctx,`Validating ${o.length} ${s} dependencies for CVEs`,o),n.isCancellationRequested)return pp.debug(e.ctx,"CVE validation cancelled before GitHub API calls"),new Fr([new Pr("CVE validation cancelled")],"cancelled");let c=await this.batchGetCVEs(e,o,s,n),l=this.formatCVEResults(c);if(pp.info(e.ctx,`Found ${c.length} dependencies with CVEs`),c.length>0){let u=c.map(d=>`${d.dep}: ${d.cves.length} CVEs`).join(", ");pp.debug(e.ctx,`CVE summary: ${u}`)}return new Fr([new Pr(l)],"success")}catch(c){if(LP(c))return pp.debug(e.ctx,"CVE validation cancelled"),new Fr([new Pr("CVE validation cancelled")],"cancelled");let l=c instanceof Error?c.message:String(c);return pp.exception(e.ctx,c,".invoke"),new Fr([new Pr(`validate_cves: Error validating CVEs: ${l}`)],"error")}}prepareInvocation(e,r){let{dependencies:n,ecosystem:o}=e.input;return{progressMessage:`validate_cves: Validating ${n.length} ${o} dependencies for CVEs...`}}prepareCompletion(e,r){let{dependencies:n,ecosystem:o}=e.input;return{completionMessage:`validate_cves: Validated ${n.length} ${o} dependencies for CVEs`}}async batchGetCVEs(e,r,n,o){pp.debug(e.ctx,`Fetching CVEs for ${r.length} dependencies in batches`);let s=[];for(let c=0;c!u.withdrawn_at?.trim()).map(u=>({id:u.cve_id||u.ghsa_id,ghsa_id:u.ghsa_id,severity:u.severity,summary:u.summary,description:u.description||u.summary,html_url:u.html_url,affectedDeps:(u.vulnerabilities??[]).map(d=>({name:d.package?.name,vulVersions:d.vulnerable_version_range,patchedVersion:d.first_patched_version}))})),l=s.length-c.length;return pp.debug(e.ctx,`Filtered to ${c.length} active CVEs (${l} withdrawn advisories excluded)`),this.groupCVEsByDependency(e,c,r)}catch(o){throw pp.exception(e.ctx,o,".getCVEs"),o}}groupCVEsByDependency(e,r,n){pp.debug(e.ctx,`Grouping CVEs by dependency for ${n.length} dependencies`);let o=[];for(let s of n){let c=s.lastIndexOf("@"),l=c>0?s.substring(0,c):s,u=r.filter(h=>h.affectedDeps.some(m=>m.name===l));if(u.length<1)continue;let d=null,f=[];for(let h of u){let m=h.affectedDeps.find(A=>A.name===l)?.patchedVersion;if(!m){f.push(h.id),pp.debug(e.ctx,`CVE ${h.id} for ${s}: no patched version available (unfixable)`);continue}let g=Ztt.coerce(m);if(!g){f.push(h.id),pp.warn(e.ctx,`CVE ${h.id} for ${s}: invalid version string "${m}" (treating as unfixable)`);continue}pp.debug(e.ctx,`CVE ${h.id} for ${s}: patched version ${m}, current max ${d||"none"}`),(d===null||Ztt.gt(g,d))&&(d=g.version)}o.push({dep:s,cves:u,minVersion:d,unfixableCves:f})}return pp.debug(e.ctx,`Grouped into ${o.length} dependencies with CVEs`),o}formatCVEResults(e){return e.length===0?"No known CVEs are found for the given dependencies.":`The following dependencies have known CVEs: +${e.map(n=>{let o=n.cves.map(f=>{let h=`[${f.id}](${f.html_url}): ${QWt(f.summary)} `;return h+=` - **Severity**: **${f.severity.toUpperCase()}** -`,h+=` - **Details**: ${zVt(f.description)}`,h}).join(` +`,h+=` - **Details**: ${QWt(f.description)}`,h}).join(` - `),s=`- Dependency \`${n.dep}\` has **${n.cves.length}** known CVEs`,c=n.cves.filter(f=>!n.unfixableCves.includes(f.id)),l=c.map(f=>f.id).join(", "),u=n.unfixableCves.join(", "),d;return n.unfixableCves.length===0?d=`Upgrade to **${n.minVersion}** or higher to fix all CVEs: [${l}]`:c.length===0?d=`[${u}] cannot be fixed yet because patched versions are not available`:d=`Upgrade to **${n.minVersion}** or higher to fix [${l}]; however, [${u}] cannot be fixed yet because patched versions are not available`,`${s}: ${d} - ${o}`}).join(` -`)}`}};function Ons(t){return[new gtt,new Ett,new dtt,new btt,new Vet,new Wet,new htt,new mtt,new Stt]}a(Ons,"getAllClsTools");function vkn(t,e){Ons(t).forEach(e.registerTool.bind(e)),t.get(bn).onDidSetCapabilities(r=>{t.get(jl).getPolicyValue("subagent.enabled")===!1?e.unregisterTool(new vde):r.subAgent?e.registerTool(new vde):e.unregisterTool(new vde),r.manageTodoListTool?e.registerTool(new WO(t)):e.unregisterTool(new WO(t)),r.watchedFiles?e.registerTool(new Gwe):e.unregisterTool(new Gwe)})}a(vkn,"registerAllClsTools");var gs=class{constructor(e){this.ctx=e;this._toolRegistry=new $ze;vkn(e,this)}static{a(this,"ToolsService")}registerTool(e){this._toolRegistry.registerTool(e)}unregisterTool(e){return typeof e=="string"?this._toolRegistry.unregisterTool(e):this._toolRegistry.unregisterTool(e.id)}prepareInvocation(e,r,n){let o=this._toolRegistry.getTool(e);if(!o)throw new Error(`Tool with id '${e}' is undefined`);return o.prepareInvocation?.(r,n)??{}}prepareCompletion(e,r,n){let o=this._toolRegistry.getTool(e);if(!o)throw new Error(`Tool with id '${e}' is undefined`);return o.prepareCompletion?.(r,n)??{}}async invokeTool(e,r,n,o){if(o.isCancellationRequested)throw new Oc;let s=this._toolRegistry.getTool(r);if(!s)throw new Error(`Tool with id '${r}' is undefined`);return await s.invoke?.(e,n,o)??new Lr([],"success")}async invokeToolConfirmation(e,r,n,o){if(o.isCancellationRequested)throw new Oc;let s=this._toolRegistry.getTool(r);if(!s)throw new Error(`Tool with id '${r}' is undefined`);return await s.invokeConfirmation?.(e,n,o)??{result:"dismiss"}}getToolById(e){return this._toolRegistry.getTool(e)}getToolByNameAndProvider(e,r){return this._toolRegistry.listTools().find(n=>n.name===e&&n.toolProvider.id===r.id)}getToolsForModel(e){if(e&&e.customTools!==void 0){if(e.customTools.length===0)return[];let r=new Set(e.customTools);return Array.from(this.getToolMapForModel().values()).filter(n=>r.has(n.configurationKey))}return e?.kind==="Ask"?Array.from(this.getToolMapForModel().values()).filter(r=>iwn.has(r.name)):e?.kind==="InlineAgent"?Array.from(this.getToolMapForModel().values()).filter(r=>own.has(r.name)):Array.from(this.getToolMapForModel().values()).filter(r=>r.status==="enabled")}getToolMapForModel(){let e=new Map;for(let m of this._toolRegistry.listTools())e.has(m.toolProvider.id)||e.set(m.toolProvider.id,[]),e.get(m.toolProvider.id)?.push(m);let r=e.get(dg.id)?.find(m=>m.name==="insert_edit_into_file");if(r){let m=e.get(dg.id),g=m?.indexOf(r)??-1;g>=0&&m?.splice(g,1)}let n=e.get(dg.id)?.find(m=>m.name==="replace_string_in_file");if(n){let m=e.get(dg.id),g=m?.indexOf(n)??-1;g>=0&&m?.splice(g,1)}let o=e.get(rp.id)?.find(m=>m.name==="insert_edit_into_file");if(o){let m=e.get(rp.id),g=m?.indexOf(o)??-1;g>=0&&m?.splice(g,1)}let s=e.get(dg.id)?.find(m=>m.name==="create_file");if(s){let m=e.get(dg.id),g=m?.indexOf(s)??-1;g>=0&&m?.splice(g,1)}let c=e.get(rp.id)?.find(m=>m.name==="create_file");if(c){let m=e.get(rp.id),g=m?.indexOf(c)??-1;g>=0&&m?.splice(g,1)}let l=e.get(dg.id)?.find(m=>m.name==="apply_patch");if(l){let m=e.get(dg.id),g=m?.indexOf(l)??-1;g>=0&&m?.splice(g,1)}let u=new Map;r&&o&&u.set(r.nameForModel,r),n&&o&&u.set(n.nameForModel,n),s&&c&&u.set(s.nameForModel,s),l&&o&&c&&u.set(l.nameForModel,l);let d=e.get(rp.id)??[],f=e.get(dg.id)??[],h=Array.from(e.entries()).filter(([m])=>m!==dg.id&&m!==rp.id).flatMap(([,m])=>m);return d.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),f.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),h.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),u}async updateToolStatusByName(e,r,n){let o=this.guessTool(e,r);o.length!==0&&await this.doUpdateToolStatus(e,o,n)}async updateToolStatus(e,r,n){let o=this.getToolsToUpdate(r);o.length!==0&&await this.doUpdateToolStatus(e,o,n)}async doUpdateToolStatus(e,r,n){let o;Array.isArray(r)?o=r:o=[r],await this.doUpdateToolsStatus(e,o.map(s=>({tool:s,status:n})))}async updateToolsStatusByName(e,r){let n=r.flatMap(({toolName:o,status:s})=>this.guessTool(e,o).map(l=>({tool:l,status:s})));await this.doUpdateToolsStatus(e,n)}async updateToolsStatus(e,r){let n=r.flatMap(({toolId:o,status:s})=>this.getToolsToUpdate(o).map(l=>({tool:l,status:s})));await this.doUpdateToolsStatus(e,n)}async doUpdateToolsStatus(e,r){let n=r.map(({tool:c,status:l})=>this.prepareUpdateToolStatus(e,c,l)).flat();function o(c){return c.shouldUpdate?c.shouldUpdate():!0}a(o,"shouldUpdate");let s=new Map;for(let c of n)!c||!o(c)||(c.type==="memory"?c.tool.status=c.status:c.type==="customAgent"&&(s.has(c.customAgent.id)||s.set(c.customAgent.id,{agent:c.customAgent,options:[]}),s.get(c.customAgent.id).options.push({toolConfigurationKey:c.tool.configurationKey,status:c.status})));if(s.size>0){let c=this.ctx.get(Ld);for(let[l,{agent:u,options:d}]of s)await c.updateCustomAgent(u,{updateToolOptions:d})}}guessTool(e,r){let n=this._toolRegistry.listTools().filter(o=>o.name===r);if(!ZIe(e)){let o=new Set,s=[];for(let c of n)o.has(c.configurationKey)||(o.add(c.configurationKey),s.push(c));return s}if(r==="insert_edit_into_file"||r==="replace_string_in_file"){let o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===dg.id&&c.name===r),s=this._toolRegistry.listTools().find(c=>c.toolProvider.id===rp.id&&c.name==="insert_edit_into_file");return o&&s?[o,s]:[]}return n.length===0?[]:n.length===1||n.length===2&&n.every(o=>o.toolProvider.id===dg.id||o.toolProvider.id===rp.id)?n:[]}getToolsToUpdate(e){let r=this._toolRegistry.getTool(e);if(!r)return[];if((r.name==="insert_edit_into_file"||r.name==="replace_string_in_file")&&r.toolProvider.id===dg.id){let n=this._toolRegistry.listTools().find(o=>o.toolProvider.id===rp.id&&o.name==="insert_edit_into_file");if(n)return[r,n]}return[r]}prepareUpdateToolStatus(e,r,n){if(ZIe(e))return r.name==="insert_edit_into_file"&&r.toolProvider.id===rp.id?[this.prepareUpdateEditorEditFileToolStatus(r,n)]:[{type:"memory",tool:r,status:n}];if(e.source&&!e.source.isReadonly){let o=e.source;return!o.tools||(o.tools.some(c=>c==r?.configurationKey)?"enabled":"disabled")===n?void 0:[{type:"customAgent",customAgent:o,tool:r,status:n}]}}prepareUpdateEditorEditFileToolStatus(e,r){if(r==="enabled")return{type:"memory",tool:e,status:"enabled"};let n=this._toolRegistry.listTools().find(c=>c.toolProvider.id===dg.id&&c.name==="insert_edit_into_file"),o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===dg.id&&c.name==="replace_string_in_file");function s(c){return!c||c.status==="disabled"}return a(s,"isToolDisabled"),{type:"memory",tool:e,status:"disabled",shouldUpdate:a(()=>s(n)&&s(o),"shouldUpdate")}}};p();var Xq=class extends YQ{static{a(this,"ClientLanguageModelTool")}constructor(e){super({...e,toolProvider:rp,type:"client"}),this.confirmationMessages=e.confirmationMessages}prepareInvocation(e,r){return{progressMessage:`Running ${this.name} tool`,confirmationMessages:this.confirmationMessages}}prepareCompletion(e,r){return{completionMessage:`Ran ${this.name} tool`}}async invoke(e,r,n){let o={name:this.name,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId};try{return await e.ctx.get(F_).invokeClientTool(e,o)}catch(s){throw new Error(`Failed to invoke client tool ${this.name}: ${String(s)}`)}}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Oc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations,toolMetadata:r.toolMetadata};try{return await e.ctx.get(qd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};p();p();var k={};ki(k,{$brand:()=>fWt,$input:()=>cKt,$output:()=>aKt,NEVER:()=>eRe,TimePrecision:()=>dKt,ZodAny:()=>Xkn,ZodArray:()=>nPn,ZodBase64:()=>vJt,ZodBase64URL:()=>CJt,ZodBigInt:()=>QRe,ZodBigIntFormat:()=>TJt,ZodBoolean:()=>URe,ZodCIDRv4:()=>EJt,ZodCIDRv6:()=>_Jt,ZodCUID:()=>fJt,ZodCUID2:()=>pJt,ZodCatch:()=>yPn,ZodCustom:()=>_rt,ZodCustomStringFormat:()=>Ykn,ZodDate:()=>Art,ZodDefault:()=>fPn,ZodDiscriminatedUnion:()=>iPn,ZodE164:()=>bJt,ZodEmail:()=>aJt,ZodEmoji:()=>uJt,ZodEnum:()=>LRe,ZodError:()=>_os,ZodFile:()=>uPn,ZodGUID:()=>frt,ZodIPv4:()=>AJt,ZodIPv6:()=>yJt,ZodISODate:()=>lrt,ZodISODateTime:()=>crt,ZodISODuration:()=>drt,ZodISOTime:()=>urt,ZodIntersection:()=>oPn,ZodIssueCode:()=>OJt,ZodJWT:()=>SJt,ZodKSUID:()=>gJt,ZodLazy:()=>SPn,ZodLiteral:()=>lPn,ZodMap:()=>aPn,ZodNaN:()=>_Pn,ZodNanoID:()=>dJt,ZodNever:()=>tPn,ZodNonOptional:()=>DJt,ZodNull:()=>Zkn,ZodNullable:()=>dPn,ZodNumber:()=>FRe,ZodNumberFormat:()=>qde,ZodObject:()=>yrt,ZodOptional:()=>PJt,ZodPipe:()=>NJt,ZodPrefault:()=>hPn,ZodPromise:()=>IPn,ZodReadonly:()=>vPn,ZodRealError:()=>Qde,ZodRecord:()=>wJt,ZodSet:()=>cPn,ZodString:()=>BRe,ZodStringFormat:()=>Cu,ZodSuccess:()=>APn,ZodSymbol:()=>Kkn,ZodTemplateLiteral:()=>bPn,ZodTransform:()=>RJt,ZodTuple:()=>sPn,ZodType:()=>ks,ZodULID:()=>hJt,ZodURL:()=>cJt,ZodUUID:()=>SF,ZodUndefined:()=>Jkn,ZodUnion:()=>xJt,ZodUnknown:()=>ePn,ZodVoid:()=>rPn,ZodXID:()=>mJt,_ZodString:()=>sJt,_default:()=>pPn,any:()=>IJt,array:()=>Fr,base64:()=>Uos,base64url:()=>Qos,bigint:()=>zos,boolean:()=>ol,catch:()=>EPn,check:()=>xPn,cidrv4:()=>Bos,cidrv6:()=>Fos,clone:()=>iT,coerce:()=>jRe,config:()=>im,core:()=>bF,cuid:()=>kos,cuid2:()=>Pos,custom:()=>MJt,date:()=>ess,discriminatedUnion:()=>Ert,e164:()=>qos,email:()=>Cos,emoji:()=>wos,endsWith:()=>wRe,enum:()=>rv,file:()=>css,flattenError:()=>lRe,float32:()=>Gos,float64:()=>$os,formatError:()=>uRe,function:()=>YKt,getErrorMap:()=>yss,globalRegistry:()=>s5,gt:()=>vF,gte:()=>tb,guid:()=>bos,includes:()=>IRe,instanceof:()=>hss,int:()=>oJt,int32:()=>Vos,int64:()=>Yos,intersection:()=>qRe,ipv4:()=>Oos,ipv6:()=>Los,iso:()=>Ude,json:()=>gss,jwt:()=>jos,keyof:()=>tss,ksuid:()=>Mos,lazy:()=>TPn,length:()=>Fde,literal:()=>Gn,locales:()=>_Re,looseObject:()=>om,lowercase:()=>SRe,lt:()=>_F,lte:()=>yw,map:()=>oss,maxLength:()=>Bde,maxSize:()=>Lde,mime:()=>RRe,minLength:()=>tj,minSize:()=>FJ,multipleOf:()=>BJ,nan:()=>dss,nanoid:()=>Ros,nativeEnum:()=>ass,negative:()=>UKt,never:()=>grt,nonnegative:()=>qKt,nonoptional:()=>gPn,nonpositive:()=>QKt,normalize:()=>kRe,null:()=>mrt,nullable:()=>prt,nullish:()=>lss,number:()=>ka,object:()=>zr,optional:()=>bu,overwrite:()=>CF,parse:()=>tJt,parseAsync:()=>rJt,partialRecord:()=>iss,pipe:()=>hrt,positive:()=>FKt,prefault:()=>mPn,preprocess:()=>vrt,prettifyError:()=>TWt,promise:()=>pss,property:()=>jKt,readonly:()=>CPn,record:()=>xl,refine:()=>wPn,regex:()=>bRe,regexes:()=>MJ,registry:()=>Utt,safeParse:()=>nJt,safeParseAsync:()=>iJt,set:()=>sss,setErrorMap:()=>Ass,size:()=>CRe,startsWith:()=>xRe,strictObject:()=>rss,string:()=>Je,stringFormat:()=>Hos,stringbool:()=>mss,success:()=>uss,superRefine:()=>RPn,symbol:()=>Jos,templateLiteral:()=>fss,toJSONSchema:()=>KKt,toLowerCase:()=>DRe,toUpperCase:()=>NRe,transform:()=>kJt,treeifyError:()=>SWt,trim:()=>PRe,tuple:()=>nss,uint32:()=>Wos,uint64:()=>Kos,ulid:()=>Dos,undefined:()=>Zos,union:()=>Il,unknown:()=>od,uppercase:()=>TRe,url:()=>lJt,uuid:()=>Sos,uuidv4:()=>Tos,uuidv6:()=>Ios,uuidv7:()=>xos,void:()=>Xos,xid:()=>Nos});p();var bF={};ki(bF,{$ZodAny:()=>Jzt,$ZodArray:()=>gRe,$ZodAsyncError:()=>i5,$ZodBase64:()=>qzt,$ZodBase64URL:()=>jzt,$ZodBigInt:()=>Btt,$ZodBigIntFormat:()=>Wzt,$ZodBoolean:()=>mRe,$ZodCIDRv4:()=>Fzt,$ZodCIDRv6:()=>Uzt,$ZodCUID:()=>xzt,$ZodCUID2:()=>wzt,$ZodCatch:()=>gYt,$ZodCheck:()=>Tf,$ZodCheckBigIntFormat:()=>nzt,$ZodCheckEndsWith:()=>mzt,$ZodCheckGreaterThan:()=>Ntt,$ZodCheckIncludes:()=>pzt,$ZodCheckLengthEquals:()=>lzt,$ZodCheckLessThan:()=>Dtt,$ZodCheckLowerCase:()=>dzt,$ZodCheckMaxLength:()=>azt,$ZodCheckMaxSize:()=>izt,$ZodCheckMimeType:()=>Azt,$ZodCheckMinLength:()=>czt,$ZodCheckMinSize:()=>ozt,$ZodCheckMultipleOf:()=>tzt,$ZodCheckNumberFormat:()=>rzt,$ZodCheckOverwrite:()=>yzt,$ZodCheckProperty:()=>gzt,$ZodCheckRegex:()=>uzt,$ZodCheckSizeEquals:()=>szt,$ZodCheckStartsWith:()=>hzt,$ZodCheckStringFormat:()=>Dde,$ZodCheckUpperCase:()=>fzt,$ZodCustom:()=>CYt,$ZodCustomStringFormat:()=>$zt,$ZodDate:()=>eYt,$ZodDefault:()=>fYt,$ZodDiscriminatedUnion:()=>rYt,$ZodE164:()=>Hzt,$ZodEmail:()=>bzt,$ZodEmoji:()=>Tzt,$ZodEnum:()=>aYt,$ZodError:()=>cRe,$ZodFile:()=>lYt,$ZodFunction:()=>art,$ZodGUID:()=>vzt,$ZodIPv4:()=>Lzt,$ZodIPv6:()=>Bzt,$ZodISODate:()=>Nzt,$ZodISODateTime:()=>Dzt,$ZodISODuration:()=>Ozt,$ZodISOTime:()=>Mzt,$ZodIntersection:()=>nYt,$ZodJWT:()=>Gzt,$ZodKSUID:()=>Pzt,$ZodLazy:()=>vYt,$ZodLiteral:()=>cYt,$ZodMap:()=>oYt,$ZodNaN:()=>AYt,$ZodNanoID:()=>Izt,$ZodNever:()=>Zzt,$ZodNonOptional:()=>hYt,$ZodNull:()=>Kzt,$ZodNullable:()=>dYt,$ZodNumber:()=>Ltt,$ZodNumberFormat:()=>Vzt,$ZodObject:()=>tYt,$ZodOptional:()=>uYt,$ZodPipe:()=>yRe,$ZodPrefault:()=>pYt,$ZodPromise:()=>_Yt,$ZodReadonly:()=>yYt,$ZodRealError:()=>kde,$ZodRecord:()=>iYt,$ZodRegistry:()=>Mde,$ZodSet:()=>sYt,$ZodString:()=>OJ,$ZodStringFormat:()=>Vl,$ZodSuccess:()=>mYt,$ZodSymbol:()=>zzt,$ZodTemplateLiteral:()=>EYt,$ZodTransform:()=>ARe,$ZodTuple:()=>LJ,$ZodType:()=>uo,$ZodULID:()=>Rzt,$ZodURL:()=>Szt,$ZodUUID:()=>Czt,$ZodUndefined:()=>Yzt,$ZodUnion:()=>Ftt,$ZodUnknown:()=>Nde,$ZodVoid:()=>Xzt,$ZodXID:()=>kzt,$brand:()=>fWt,$constructor:()=>dt,$input:()=>cKt,$output:()=>aKt,Doc:()=>hRe,JSONSchema:()=>Vkn,JSONSchemaGenerator:()=>ORe,NEVER:()=>eRe,TimePrecision:()=>dKt,_any:()=>DKt,_array:()=>MRe,_base64:()=>nrt,_base64url:()=>irt,_bigint:()=>TKt,_boolean:()=>bKt,_catch:()=>pos,_cidrv4:()=>trt,_cidrv6:()=>rrt,_coercedBigint:()=>IKt,_coercedBoolean:()=>SKt,_coercedDate:()=>LKt,_coercedNumber:()=>AKt,_coercedString:()=>uKt,_cuid:()=>ztt,_cuid2:()=>Ytt,_custom:()=>$Kt,_date:()=>OKt,_default:()=>uos,_discriminatedUnion:()=>Xis,_e164:()=>ort,_email:()=>Qtt,_emoji:()=>Vtt,_endsWith:()=>wRe,_enum:()=>ios,_file:()=>GKt,_float32:()=>EKt,_float64:()=>_Kt,_gt:()=>vF,_gte:()=>tb,_guid:()=>vRe,_includes:()=>IRe,_int:()=>yKt,_int32:()=>vKt,_int64:()=>xKt,_intersection:()=>eos,_ipv4:()=>Xtt,_ipv6:()=>ert,_isoDate:()=>pKt,_isoDateTime:()=>fKt,_isoDuration:()=>mKt,_isoTime:()=>hKt,_jwt:()=>srt,_ksuid:()=>Ztt,_lazy:()=>Aos,_length:()=>Fde,_literal:()=>sos,_lowercase:()=>SRe,_lt:()=>_F,_lte:()=>yw,_map:()=>ros,_max:()=>yw,_maxLength:()=>Bde,_maxSize:()=>Lde,_mime:()=>RRe,_min:()=>tb,_minLength:()=>tj,_minSize:()=>FJ,_multipleOf:()=>BJ,_nan:()=>BKt,_nanoid:()=>Wtt,_nativeEnum:()=>oos,_negative:()=>UKt,_never:()=>NKt,_nonnegative:()=>qKt,_nonoptional:()=>dos,_nonpositive:()=>QKt,_normalize:()=>kRe,_null:()=>PKt,_nullable:()=>los,_number:()=>gKt,_optional:()=>cos,_overwrite:()=>CF,_parse:()=>xtt,_parseAsync:()=>wtt,_pipe:()=>hos,_positive:()=>FKt,_promise:()=>yos,_property:()=>jKt,_readonly:()=>mos,_record:()=>tos,_refine:()=>VKt,_regex:()=>bRe,_safeParse:()=>Rtt,_safeParseAsync:()=>ktt,_set:()=>nos,_size:()=>CRe,_startsWith:()=>xRe,_string:()=>lKt,_stringFormat:()=>zKt,_stringbool:()=>WKt,_success:()=>fos,_symbol:()=>RKt,_templateLiteral:()=>gos,_toLowerCase:()=>DRe,_toUpperCase:()=>NRe,_transform:()=>aos,_trim:()=>PRe,_tuple:()=>HKt,_uint32:()=>CKt,_uint64:()=>wKt,_ulid:()=>Ktt,_undefined:()=>kKt,_union:()=>Zis,_unknown:()=>Ode,_uppercase:()=>TRe,_url:()=>$tt,_uuid:()=>qtt,_uuidv4:()=>jtt,_uuidv6:()=>Htt,_uuidv7:()=>Gtt,_void:()=>MKt,_xid:()=>Jtt,clone:()=>iT,config:()=>im,flattenError:()=>lRe,formatError:()=>uRe,function:()=>YKt,globalConfig:()=>Xwe,globalRegistry:()=>s5,isValidBase64:()=>Qzt,isValidBase64URL:()=>qkn,isValidJWT:()=>jkn,locales:()=>_Re,parse:()=>dRe,parseAsync:()=>fRe,prettifyError:()=>TWt,regexes:()=>MJ,registry:()=>Utt,safeParse:()=>Pde,safeParseAsync:()=>pRe,toDotPath:()=>bkn,toJSONSchema:()=>KKt,treeifyError:()=>SWt,util:()=>qr,version:()=>Ezt});p();p();var eRe=Object.freeze({status:"aborted"});function dt(t,e,r){function n(l,u){var d;Object.defineProperty(l,"_zod",{value:l._zod??{},enumerable:!1}),(d=l._zod).traits??(d.traits=new Set),l._zod.traits.add(t),e(l,u);for(let f in c.prototype)f in l||Object.defineProperty(l,f,{value:c.prototype[f].bind(l)});l._zod.constr=c,l._zod.def=u}a(n,"init");let o=r?.Parent??Object;class s extends o{static{a(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function c(l){var u;let d=r?.Parent?new s:this;n(d,l),(u=d._zod).deferred??(u.deferred=[]);for(let f of d._zod.deferred)f();return d}return a(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:a(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}a(dt,"$constructor");var fWt=Symbol("zod_brand"),i5=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Xwe={};function im(t){return t&&Object.assign(Xwe,t),Xwe}a(im,"config");p();p();var qr={};ki(qr,{BIGINT_FORMAT_RANGES:()=>CWt,Class:()=>hWt,NUMBER_FORMAT_RANGES:()=>vWt,aborted:()=>DJ,allowsEval:()=>yWt,assert:()=>Qns,assertEqual:()=>Lns,assertIs:()=>Fns,assertNever:()=>Uns,assertNotEqual:()=>Bns,assignProp:()=>AWt,cached:()=>nRe,captureStackTrace:()=>Itt,cleanEnum:()=>Xns,cleanRegex:()=>iRe,clone:()=>iT,createTransparentProxy:()=>Vns,defineLazy:()=>xc,esc:()=>PJ,escapeRegex:()=>EF,extend:()=>Yns,finalizeIssue:()=>oT,floatSafeRemainder:()=>gWt,getElementAtPath:()=>qns,getEnumValues:()=>rRe,getLengthableOrigin:()=>aRe,getParsedType:()=>$ns,getSizableOrigin:()=>sRe,isObject:()=>wde,isPlainObject:()=>Rde,issue:()=>bWt,joinValues:()=>jt,jsonStringifyReplacer:()=>mWt,merge:()=>Kns,normalizeParams:()=>Tr,nullish:()=>ej,numKeys:()=>Gns,omit:()=>zns,optionalKeys:()=>_Wt,partial:()=>Jns,pick:()=>Wns,prefixIssues:()=>eb,primitiveTypes:()=>EWt,promiseAllObject:()=>jns,propertyKeyTypes:()=>oRe,randomString:()=>Hns,required:()=>Zns,stringifyPrimitive:()=>Qr,unwrapMessage:()=>tRe});p();function Lns(t){return t}a(Lns,"assertEqual");function Bns(t){return t}a(Bns,"assertNotEqual");function Fns(t){}a(Fns,"assertIs");function Uns(t){throw new Error}a(Uns,"assertNever");function Qns(t){}a(Qns,"assert");function rRe(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,o])=>e.indexOf(+n)===-1).map(([n,o])=>o)}a(rRe,"getEnumValues");function jt(t,e="|"){return t.map(r=>Qr(r)).join(e)}a(jt,"joinValues");function mWt(t,e){return typeof e=="bigint"?e.toString():e}a(mWt,"jsonStringifyReplacer");function nRe(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(nRe,"cached");function ej(t){return t==null}a(ej,"nullish");function iRe(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}a(iRe,"cleanRegex");function gWt(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return s%c/10**o}a(gWt,"floatSafeRemainder");function xc(t,e,r){Object.defineProperty(t,e,{get(){{let o=r();return t[e]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}a(xc,"defineLazy");function AWt(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}a(AWt,"assignProp");function qns(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}a(qns,"getElementAtPath");function jns(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s{};function wde(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(wde,"isObject");var yWt=nRe(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Rde(t){if(wde(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(wde(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(Rde,"isPlainObject");function Gns(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}a(Gns,"numKeys");var $ns=a(t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},"getParsedType"),oRe=new Set(["string","number","symbol"]),EWt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function EF(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(EF,"escapeRegex");function iT(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}a(iT,"clone");function Tr(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:a(()=>e,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:a(()=>e.error,"error")}:e}a(Tr,"normalizeParams");function Vns(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}a(Vns,"createTransparentProxy");function Qr(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}a(Qr,"stringifyPrimitive");function _Wt(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}a(_Wt,"optionalKeys");var vWt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},CWt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Wns(t,e){let r={},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(r[o]=n.shape[o])}return iT(t,{...t._zod.def,shape:r,checks:[]})}a(Wns,"pick");function zns(t,e){let r={...t._zod.def.shape},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete r[o]}return iT(t,{...t._zod.def,shape:r,checks:[]})}a(zns,"omit");function Yns(t,e){if(!Rde(e))throw new Error("Invalid input to extend: expected a plain object");let r={...t._zod.def,get shape(){let n={...t._zod.def.shape,...e};return AWt(this,"shape",n),n},checks:[]};return iT(t,r)}a(Yns,"extend");function Kns(t,e){return iT(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return AWt(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}a(Kns,"merge");function Jns(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=t?new t({type:"optional",innerType:n[s]}):n[s])}else for(let s in n)o[s]=t?new t({type:"optional",innerType:n[s]}):n[s];return iT(e,{...e._zod.def,shape:o,checks:[]})}a(Jns,"partial");function Zns(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return iT(e,{...e._zod.def,shape:o,checks:[]})}a(Zns,"required");function DJ(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}a(eb,"prefixIssues");function tRe(t){return typeof t=="string"?t:t?.message}a(tRe,"unwrapMessage");function oT(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=tRe(t.inst?._zod.def?.error?.(t))??tRe(e?.error?.(t))??tRe(r.customError?.(t))??tRe(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}a(oT,"finalizeIssue");function sRe(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}a(sRe,"getSizableOrigin");function aRe(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}a(aRe,"getLengthableOrigin");function bWt(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}a(bWt,"issue");function Xns(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a(Xns,"cleanEnum");var hWt=class{static{a(this,"Class")}constructor(...e){}};var Ckn=a((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,mWt,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:a(()=>t.message,"value"),enumerable:!1})},"initializer"),cRe=dt("$ZodError",Ckn),kde=dt("$ZodError",Ckn,{Parent:Error});function lRe(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}a(lRe,"flattenError");function uRe(t,e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>o({issues:l}));else if(c.code==="invalid_key")o({issues:c.issues});else if(c.code==="invalid_element")o({issues:c.issues});else if(c.path.length===0)n._errors.push(r(c));else{let l=n,u=0;for(;u{var l,u;for(let d of s.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(f=>o({issues:f},d.path));else if(d.code==="invalid_key")o({issues:d.issues},d.path);else if(d.code==="invalid_element")o({issues:d.issues},d.path);else{let f=[...c,...d.path];if(f.length===0){n.errors.push(r(d));continue}let h=n,m=0;for(;mn.path.length-o.path.length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${bkn(n.path)}`);return e.join(` -`)}a(TWt,"prettifyError");var xtt=a(t=>(e,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new i5;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>oT(u,s,im())));throw Itt(l,o?.callee),l}return c.value},"_parse"),dRe=xtt(kde),wtt=a(t=>async(e,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>oT(u,s,im())));throw Itt(l,o?.callee),l}return c.value},"_parseAsync"),fRe=wtt(kde),Rtt=a(t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new i5;return s.issues.length?{success:!1,error:new(t??cRe)(s.issues.map(c=>oT(c,o,im())))}:{success:!0,data:s.value}},"_safeParse"),Pde=Rtt(kde),ktt=a(t=>async(e,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>oT(c,o,im())))}:{success:!0,data:s.value}},"_safeParseAsync"),pRe=ktt(kde);p();p();var MJ={};ki(MJ,{_emoji:()=>Skn,base64:()=>QWt,base64url:()=>Ptt,bigint:()=>WWt,boolean:()=>KWt,browserEmail:()=>cis,cidrv4:()=>FWt,cidrv6:()=>UWt,cuid:()=>IWt,cuid2:()=>xWt,date:()=>HWt,datetime:()=>$Wt,domain:()=>lis,duration:()=>DWt,e164:()=>jWt,email:()=>MWt,emoji:()=>OWt,extendedDuration:()=>tis,guid:()=>NWt,hostname:()=>qWt,html5Email:()=>ois,integer:()=>zWt,ipv4:()=>LWt,ipv6:()=>BWt,ksuid:()=>kWt,lowercase:()=>XWt,nanoid:()=>PWt,null:()=>JWt,number:()=>YWt,rfc5322Email:()=>sis,string:()=>VWt,time:()=>GWt,ulid:()=>wWt,undefined:()=>ZWt,unicodeEmail:()=>ais,uppercase:()=>ezt,uuid:()=>NJ,uuid4:()=>ris,uuid6:()=>nis,uuid7:()=>iis,xid:()=>RWt});p();var IWt=/^[cC][^\s-]{8,}$/,xWt=/^[0-9a-z]+$/,wWt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,RWt=/^[0-9a-vA-V]{20}$/,kWt=/^[A-Za-z0-9]{27}$/,PWt=/^[a-zA-Z0-9_-]{21}$/,DWt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tis=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,NWt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,NJ=a(t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,"uuid"),ris=NJ(4),nis=NJ(6),iis=NJ(7),MWt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ois=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,sis=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,ais=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,cis=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Skn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function OWt(){return new RegExp(Skn,"u")}a(OWt,"emoji");var LWt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,BWt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,FWt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,UWt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,QWt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ptt=/^[A-Za-z0-9_-]*$/,qWt=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,lis=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,jWt=/^\+(?:[0-9]){6,14}[0-9]$/,Tkn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",HWt=new RegExp(`^${Tkn}$`);function Ikn(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}a(Ikn,"timeSource");function GWt(t){return new RegExp(`^${Ikn(t)}$`)}a(GWt,"time");function $Wt(t){let e=Ikn({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Tkn}T(?:${n})$`)}a($Wt,"datetime");var VWt=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),WWt=/^\d+n?$/,zWt=/^\d+$/,YWt=/^-?\d+(?:\.\d+)?/i,KWt=/true|false/i,JWt=/null/i;var ZWt=/undefined/i;var XWt=/^[^A-Z]*$/,ezt=/^[^a-z]*$/;var Tf=dt("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),wkn={number:"number",bigint:"bigint",object:"date"},Dtt=dt("$ZodCheckLessThan",(t,e)=>{Tf.init(t,e);let r=wkn[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?n.value<=e.value:n.value{Tf.init(t,e);let r=wkn[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),tzt=dt("$ZodCheckMultipleOf",(t,e)=>{Tf.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):gWt(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),rzt=dt("$ZodCheckNumberFormat",(t,e)=>{Tf.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=vWt[e.format];t._zod.onattach.push(c=>{let l=c._zod.bag;l.format=e.format,l.minimum=o,l.maximum=s,r&&(l.pattern=zWt)}),t._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:e.format,code:"invalid_type",input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort});return}}ls&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inst:t})}}),nzt=dt("$ZodCheckBigIntFormat",(t,e)=>{Tf.init(t,e);let[r,n]=CWt[e.format];t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,s.minimum=r,s.maximum=n}),t._zod.check=o=>{let s=o.value;sn&&o.issues.push({origin:"bigint",input:s,code:"too_big",maximum:n,inst:t})}}),izt=dt("$ZodCheckMaxSize",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let o=n.value;o.size<=e.maximum||n.issues.push({origin:sRe(o),code:"too_big",maximum:e.maximum,input:o,inst:t,continue:!e.abort})}}),ozt=dt("$ZodCheckMinSize",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;o.size>=e.minimum||n.issues.push({origin:sRe(o),code:"too_small",minimum:e.minimum,input:o,inst:t,continue:!e.abort})}}),szt=dt("$ZodCheckSizeEquals",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.size,o.maximum=e.size,o.size=e.size}),t._zod.check=n=>{let o=n.value,s=o.size;if(s===e.size)return;let c=s>e.size;n.issues.push({origin:sRe(o),...c?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),azt=dt("$ZodCheckMaxLength",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let o=n.value;if(o.length<=e.maximum)return;let c=aRe(o);n.issues.push({origin:c,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),czt=dt("$ZodCheckMinLength",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let c=aRe(o);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),lzt=dt("$ZodCheckLengthEquals",(t,e)=>{var r;Tf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!ej(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),t._zod.check=n=>{let o=n.value,s=o.length;if(s===e.length)return;let c=aRe(o),l=s>e.length;n.issues.push({origin:c,...l?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),Dde=dt("$ZodCheckStringFormat",(t,e)=>{var r,n;Tf.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),uzt=dt("$ZodCheckRegex",(t,e)=>{Dde.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),dzt=dt("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=XWt),Dde.init(t,e)}),fzt=dt("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=ezt),Dde.init(t,e)}),pzt=dt("$ZodCheckIncludes",(t,e)=>{Tf.init(t,e);let r=EF(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),hzt=dt("$ZodCheckStartsWith",(t,e)=>{Tf.init(t,e);let r=new RegExp(`^${EF(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),mzt=dt("$ZodCheckEndsWith",(t,e)=>{Tf.init(t,e);let r=new RegExp(`.*${EF(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});function xkn(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues))}a(xkn,"handleCheckPropertyResult");var gzt=dt("$ZodCheckProperty",(t,e)=>{Tf.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>xkn(o,r,e.property));xkn(n,r,e.property)}}),Azt=dt("$ZodCheckMimeType",(t,e)=>{Tf.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t})}}),yzt=dt("$ZodCheckOverwrite",(t,e)=>{Tf.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});p();var hRe=class{static{a(this,"Doc")}constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(` +`)}`}};function Qos(t){return[new Gtt,new Vtt,new Utt,new Ktt,new _tt,new vtt,new jtt,new Htt,new Jtt]}a(Qos,"getAllClsTools");function ZPn(t,e){Qos(t).forEach(e.registerTool.bind(e)),t.get(kn).onDidSetCapabilities(r=>{t.get(Hl).getPolicyValue("subagent.enabled")===!1?e.unregisterTool(new Dde):r.subAgent?e.registerTool(new Dde):e.unregisterTool(new Dde),r.manageTodoListTool?e.registerTool(new XO(t)):e.unregisterTool(new XO(t)),r.watchedFiles?e.registerTool(new lRe):e.unregisterTool(new lRe)})}a(ZPn,"registerAllClsTools");var hs=class{constructor(e){this.ctx=e;this._toolRegistry=new yYe;ZPn(e,this)}static{a(this,"ToolsService")}registerTool(e){this._toolRegistry.registerTool(e)}unregisterTool(e){return typeof e=="string"?this._toolRegistry.unregisterTool(e):this._toolRegistry.unregisterTool(e.id)}prepareInvocation(e,r,n){let o=this._toolRegistry.getTool(e);if(!o)throw new Error(`Tool with id '${e}' is undefined`);return o.prepareInvocation?.(r,n)??{}}prepareCompletion(e,r,n){let o=this._toolRegistry.getTool(e);if(!o)throw new Error(`Tool with id '${e}' is undefined`);return o.prepareCompletion?.(r,n)??{}}async invokeTool(e,r,n,o){if(o.isCancellationRequested)throw new Uc;let s=this._toolRegistry.getTool(r);if(!s)throw new Error(`Tool with id '${r}' is undefined`);return await s.invoke?.(e,n,o)??new Fr([],"success")}async invokeToolConfirmation(e,r,n,o){if(o.isCancellationRequested)throw new Uc;let s=this._toolRegistry.getTool(r);if(!s)throw new Error(`Tool with id '${r}' is undefined`);return await s.invokeConfirmation?.(e,n,o)??{result:"dismiss"}}getToolById(e){return this._toolRegistry.getTool(e)}getToolByNameAndProvider(e,r){return this._toolRegistry.listTools().find(n=>n.name===e&&n.toolProvider.id===r.id)}getToolsForModel(e){if(e&&e.customTools!==void 0){if(e.customTools.length===0)return[];let r=new Set(e.customTools);return Array.from(this.getToolMapForModel().values()).filter(n=>r.has(n.configurationKey))}return e?.kind==="Ask"?Array.from(this.getToolMapForModel().values()).filter(r=>ORn.has(r.name)):e?.kind==="InlineAgent"?Array.from(this.getToolMapForModel().values()).filter(r=>LRn.has(r.name)):Array.from(this.getToolMapForModel().values()).filter(r=>r.status==="enabled")}getToolMapForModel(){let e=new Map;for(let m of this._toolRegistry.listTools())e.has(m.toolProvider.id)||e.set(m.toolProvider.id,[]),e.get(m.toolProvider.id)?.push(m);let r=e.get(hg.id)?.find(m=>m.name==="insert_edit_into_file");if(r){let m=e.get(hg.id),g=m?.indexOf(r)??-1;g>=0&&m?.splice(g,1)}let n=e.get(hg.id)?.find(m=>m.name==="replace_string_in_file");if(n){let m=e.get(hg.id),g=m?.indexOf(n)??-1;g>=0&&m?.splice(g,1)}let o=e.get(op.id)?.find(m=>m.name==="insert_edit_into_file");if(o){let m=e.get(op.id),g=m?.indexOf(o)??-1;g>=0&&m?.splice(g,1)}let s=e.get(hg.id)?.find(m=>m.name==="create_file");if(s){let m=e.get(hg.id),g=m?.indexOf(s)??-1;g>=0&&m?.splice(g,1)}let c=e.get(op.id)?.find(m=>m.name==="create_file");if(c){let m=e.get(op.id),g=m?.indexOf(c)??-1;g>=0&&m?.splice(g,1)}let l=e.get(hg.id)?.find(m=>m.name==="apply_patch");if(l){let m=e.get(hg.id),g=m?.indexOf(l)??-1;g>=0&&m?.splice(g,1)}let u=new Map;r&&o&&u.set(r.nameForModel,r),n&&o&&u.set(n.nameForModel,n),s&&c&&u.set(s.nameForModel,s),l&&o&&c&&u.set(l.nameForModel,l);let d=e.get(op.id)??[],f=e.get(hg.id)??[],h=Array.from(e.entries()).filter(([m])=>m!==hg.id&&m!==op.id).flatMap(([,m])=>m);return d.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),f.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),h.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),u}async updateToolStatusByName(e,r,n){let o=this.guessTool(e,r);o.length!==0&&await this.doUpdateToolStatus(e,o,n)}async updateToolStatus(e,r,n){let o=this.getToolsToUpdate(r);o.length!==0&&await this.doUpdateToolStatus(e,o,n)}async doUpdateToolStatus(e,r,n){let o;Array.isArray(r)?o=r:o=[r],await this.doUpdateToolsStatus(e,o.map(s=>({tool:s,status:n})))}async updateToolsStatusByName(e,r){let n=r.flatMap(({toolName:o,status:s})=>this.guessTool(e,o).map(l=>({tool:l,status:s})));await this.doUpdateToolsStatus(e,n)}async updateToolsStatus(e,r){let n=r.flatMap(({toolId:o,status:s})=>this.getToolsToUpdate(o).map(l=>({tool:l,status:s})));await this.doUpdateToolsStatus(e,n)}async doUpdateToolsStatus(e,r){let n=r.map(({tool:c,status:l})=>this.prepareUpdateToolStatus(e,c,l)).flat();function o(c){return c.shouldUpdate?c.shouldUpdate():!0}a(o,"shouldUpdate");let s=new Map;for(let c of n)!c||!o(c)||(c.type==="memory"?c.tool.status=c.status:c.type==="customAgent"&&(s.has(c.customAgent.id)||s.set(c.customAgent.id,{agent:c.customAgent,options:[]}),s.get(c.customAgent.id).options.push({toolConfigurationKey:c.tool.configurationKey,status:c.status})));if(s.size>0){let c=this.ctx.get(jd);for(let[l,{agent:u,options:d}]of s)await c.updateCustomAgent(u,{updateToolOptions:d})}}guessTool(e,r){let n=this._toolRegistry.listTools().filter(o=>o.name===r);if(!yxe(e)){let o=new Set,s=[];for(let c of n)o.has(c.configurationKey)||(o.add(c.configurationKey),s.push(c));return s}if(r==="insert_edit_into_file"||r==="replace_string_in_file"){let o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===hg.id&&c.name===r),s=this._toolRegistry.listTools().find(c=>c.toolProvider.id===op.id&&c.name==="insert_edit_into_file");return o&&s?[o,s]:[]}return n.length===0?[]:n.length===1||n.length===2&&n.every(o=>o.toolProvider.id===hg.id||o.toolProvider.id===op.id)?n:[]}getToolsToUpdate(e){let r=this._toolRegistry.getTool(e);if(!r)return[];if((r.name==="insert_edit_into_file"||r.name==="replace_string_in_file")&&r.toolProvider.id===hg.id){let n=this._toolRegistry.listTools().find(o=>o.toolProvider.id===op.id&&o.name==="insert_edit_into_file");if(n)return[r,n]}return[r]}prepareUpdateToolStatus(e,r,n){if(yxe(e))return r.name==="insert_edit_into_file"&&r.toolProvider.id===op.id?[this.prepareUpdateEditorEditFileToolStatus(r,n)]:[{type:"memory",tool:r,status:n}];if(e.source&&!e.source.isReadonly){let o=e.source;return!o.tools||(o.tools.some(c=>c==r?.configurationKey)?"enabled":"disabled")===n?void 0:[{type:"customAgent",customAgent:o,tool:r,status:n}]}}prepareUpdateEditorEditFileToolStatus(e,r){if(r==="enabled")return{type:"memory",tool:e,status:"enabled"};let n=this._toolRegistry.listTools().find(c=>c.toolProvider.id===hg.id&&c.name==="insert_edit_into_file"),o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===hg.id&&c.name==="replace_string_in_file");function s(c){return!c||c.status==="disabled"}return a(s,"isToolDisabled"),{type:"memory",tool:e,status:"disabled",shouldUpdate:a(()=>s(n)&&s(o),"shouldUpdate")}}};p();var fj=class extends aq{static{a(this,"ClientLanguageModelTool")}constructor(e){super({...e,toolProvider:op,type:"client"}),this.confirmationMessages=e.confirmationMessages}prepareInvocation(e,r){return{progressMessage:`Running ${this.name} tool`,confirmationMessages:this.confirmationMessages}}prepareCompletion(e,r){return{completionMessage:`Ran ${this.name} tool`}}async invoke(e,r,n){let o={name:this.name,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId};try{return await e.ctx.get(j_).invokeClientTool(e,o)}catch(s){throw new Error(`Failed to invoke client tool ${this.name}: ${String(s)}`)}}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Uc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations,toolMetadata:r.toolMetadata};try{return await e.ctx.get(Vd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};p();p();var k={};Ri(k,{$brand:()=>izt,$input:()=>eJt,$output:()=>XKt,NEVER:()=>ERe,TimePrecision:()=>nJt,ZodAny:()=>k2n,ZodArray:()=>M2n,ZodBase64:()=>pZt,ZodBase64URL:()=>hZt,ZodBigInt:()=>oke,ZodBigIntFormat:()=>AZt,ZodBoolean:()=>ike,ZodCIDRv4:()=>dZt,ZodCIDRv6:()=>fZt,ZodCUID:()=>iZt,ZodCUID2:()=>oZt,ZodCatch:()=>Y2n,ZodCustom:()=>Wrt,ZodCustomStringFormat:()=>I2n,ZodDate:()=>Grt,ZodDefault:()=>H2n,ZodDiscriminatedUnion:()=>O2n,ZodE164:()=>mZt,ZodEmail:()=>XJt,ZodEmoji:()=>rZt,ZodEnum:()=>tke,ZodError:()=>Tas,ZodFile:()=>q2n,ZodGUID:()=>Urt,ZodIPv4:()=>lZt,ZodIPv6:()=>uZt,ZodISODate:()=>Lrt,ZodISODateTime:()=>Ort,ZodISODuration:()=>Frt,ZodISOTime:()=>Brt,ZodIntersection:()=>L2n,ZodIssueCode:()=>xZt,ZodJWT:()=>gZt,ZodKSUID:()=>cZt,ZodLazy:()=>tDn,ZodLiteral:()=>Q2n,ZodMap:()=>F2n,ZodNaN:()=>J2n,ZodNanoID:()=>nZt,ZodNever:()=>D2n,ZodNonOptional:()=>SZt,ZodNull:()=>R2n,ZodNullable:()=>j2n,ZodNumber:()=>nke,ZodNumberFormat:()=>Zde,ZodObject:()=>$rt,ZodOptional:()=>bZt,ZodPipe:()=>TZt,ZodPrefault:()=>$2n,ZodPromise:()=>nDn,ZodReadonly:()=>Z2n,ZodRealError:()=>Jde,ZodRecord:()=>_Zt,ZodSet:()=>U2n,ZodString:()=>rke,ZodStringFormat:()=>Su,ZodSuccess:()=>z2n,ZodSymbol:()=>x2n,ZodTemplateLiteral:()=>eDn,ZodTransform:()=>vZt,ZodTuple:()=>B2n,ZodType:()=>ks,ZodULID:()=>sZt,ZodURL:()=>eZt,ZodUUID:()=>DF,ZodUndefined:()=>w2n,ZodUnion:()=>EZt,ZodUnknown:()=>P2n,ZodVoid:()=>N2n,ZodXID:()=>aZt,_ZodString:()=>ZJt,_default:()=>G2n,any:()=>yZt,array:()=>Ur,base64:()=>Gas,base64url:()=>$as,bigint:()=>Xas,boolean:()=>ol,catch:()=>K2n,check:()=>iDn,cidrv4:()=>jas,cidrv6:()=>Has,clone:()=>dT,coerce:()=>ake,config:()=>lm,core:()=>PF,cuid:()=>Oas,cuid2:()=>Las,custom:()=>IZt,date:()=>ocs,discriminatedUnion:()=>Vrt,e164:()=>Vas,email:()=>xas,emoji:()=>Nas,endsWith:()=>WRe,enum:()=>sv,file:()=>pcs,flattenError:()=>wRe,float32:()=>Yas,float64:()=>Kas,formatError:()=>RRe,function:()=>qJt,getErrorMap:()=>bcs,globalRegistry:()=>p5,gt:()=>RF,gte:()=>ib,guid:()=>was,includes:()=>$Re,instanceof:()=>Ecs,int:()=>JJt,int32:()=>Jas,int64:()=>ecs,intersection:()=>ske,ipv4:()=>Qas,ipv6:()=>qas,iso:()=>Kde,json:()=>vcs,jwt:()=>Was,keyof:()=>scs,ksuid:()=>Uas,lazy:()=>rDn,length:()=>Yde,literal:()=>Gn,locales:()=>URe,looseObject:()=>um,lowercase:()=>HRe,lt:()=>wF,lte:()=>Iw,map:()=>ucs,maxLength:()=>zde,maxSize:()=>Wde,mime:()=>zRe,minLength:()=>hj,minSize:()=>zJ,multipleOf:()=>WJ,nan:()=>gcs,nanoid:()=>Mas,nativeEnum:()=>fcs,negative:()=>PJt,never:()=>Hrt,nonnegative:()=>NJt,nonoptional:()=>W2n,nonpositive:()=>DJt,normalize:()=>YRe,null:()=>jrt,nullable:()=>Qrt,nullish:()=>hcs,number:()=>ka,object:()=>zr,optional:()=>Tu,overwrite:()=>kF,parse:()=>WJt,parseAsync:()=>zJt,partialRecord:()=>lcs,pipe:()=>qrt,positive:()=>kJt,prefault:()=>V2n,preprocess:()=>zrt,prettifyError:()=>Azt,promise:()=>ycs,property:()=>MJt,readonly:()=>X2n,record:()=>xl,refine:()=>oDn,regex:()=>jRe,regexes:()=>GJ,registry:()=>frt,safeParse:()=>YJt,safeParseAsync:()=>KJt,set:()=>dcs,setErrorMap:()=>Ccs,size:()=>qRe,startsWith:()=>VRe,strictObject:()=>acs,string:()=>Ze,stringFormat:()=>zas,stringbool:()=>_cs,success:()=>mcs,superRefine:()=>sDn,symbol:()=>rcs,templateLiteral:()=>Acs,toJSONSchema:()=>jJt,toLowerCase:()=>JRe,toUpperCase:()=>ZRe,transform:()=>CZt,treeifyError:()=>gzt,trim:()=>KRe,tuple:()=>ccs,uint32:()=>Zas,uint64:()=>tcs,ulid:()=>Bas,undefined:()=>ncs,union:()=>Il,unknown:()=>ld,uppercase:()=>GRe,url:()=>tZt,uuid:()=>Ras,uuidv4:()=>kas,uuidv6:()=>Pas,uuidv7:()=>Das,void:()=>ics,xid:()=>Fas});p();var PF={};Ri(PF,{$ZodAny:()=>HYt,$ZodArray:()=>ORe,$ZodAsyncError:()=>f5,$ZodBase64:()=>NYt,$ZodBase64URL:()=>MYt,$ZodBigInt:()=>urt,$ZodBigIntFormat:()=>UYt,$ZodBoolean:()=>MRe,$ZodCIDRv4:()=>kYt,$ZodCIDRv6:()=>PYt,$ZodCUID:()=>EYt,$ZodCUID2:()=>_Yt,$ZodCatch:()=>cKt,$ZodCheck:()=>kf,$ZodCheckBigIntFormat:()=>Yzt,$ZodCheckEndsWith:()=>aYt,$ZodCheckGreaterThan:()=>srt,$ZodCheckIncludes:()=>oYt,$ZodCheckLengthEquals:()=>tYt,$ZodCheckLessThan:()=>ort,$ZodCheckLowerCase:()=>nYt,$ZodCheckMaxLength:()=>Xzt,$ZodCheckMaxSize:()=>Kzt,$ZodCheckMimeType:()=>lYt,$ZodCheckMinLength:()=>eYt,$ZodCheckMinSize:()=>Jzt,$ZodCheckMultipleOf:()=>Wzt,$ZodCheckNumberFormat:()=>zzt,$ZodCheckOverwrite:()=>uYt,$ZodCheckProperty:()=>cYt,$ZodCheckRegex:()=>rYt,$ZodCheckSizeEquals:()=>Zzt,$ZodCheckStartsWith:()=>sYt,$ZodCheckStringFormat:()=>Hde,$ZodCheckUpperCase:()=>iYt,$ZodCustom:()=>hKt,$ZodCustomStringFormat:()=>BYt,$ZodDate:()=>VYt,$ZodDefault:()=>iKt,$ZodDiscriminatedUnion:()=>zYt,$ZodE164:()=>OYt,$ZodEmail:()=>mYt,$ZodEmoji:()=>AYt,$ZodEnum:()=>XYt,$ZodError:()=>xRe,$ZodFile:()=>tKt,$ZodFunction:()=>Mrt,$ZodGUID:()=>pYt,$ZodIPv4:()=>wYt,$ZodIPv6:()=>RYt,$ZodISODate:()=>TYt,$ZodISODateTime:()=>SYt,$ZodISODuration:()=>xYt,$ZodISOTime:()=>IYt,$ZodIntersection:()=>YYt,$ZodJWT:()=>LYt,$ZodKSUID:()=>bYt,$ZodLazy:()=>pKt,$ZodLiteral:()=>eKt,$ZodMap:()=>JYt,$ZodNaN:()=>lKt,$ZodNanoID:()=>yYt,$ZodNever:()=>GYt,$ZodNonOptional:()=>sKt,$ZodNull:()=>jYt,$ZodNullable:()=>nKt,$ZodNumber:()=>lrt,$ZodNumberFormat:()=>FYt,$ZodObject:()=>WYt,$ZodOptional:()=>rKt,$ZodPipe:()=>BRe,$ZodPrefault:()=>oKt,$ZodPromise:()=>fKt,$ZodReadonly:()=>uKt,$ZodRealError:()=>qde,$ZodRecord:()=>KYt,$ZodRegistry:()=>$de,$ZodSet:()=>ZYt,$ZodString:()=>$J,$ZodStringFormat:()=>zl,$ZodSuccess:()=>aKt,$ZodSymbol:()=>QYt,$ZodTemplateLiteral:()=>dKt,$ZodTransform:()=>LRe,$ZodTuple:()=>VJ,$ZodType:()=>co,$ZodULID:()=>vYt,$ZodURL:()=>gYt,$ZodUUID:()=>hYt,$ZodUndefined:()=>qYt,$ZodUnion:()=>drt,$ZodUnknown:()=>Gde,$ZodVoid:()=>$Yt,$ZodXID:()=>CYt,$brand:()=>izt,$constructor:()=>dt,$input:()=>eJt,$output:()=>XKt,Doc:()=>NRe,JSONSchema:()=>b2n,JSONSchemaGenerator:()=>eke,NEVER:()=>ERe,TimePrecision:()=>nJt,_any:()=>SJt,_array:()=>XRe,_base64:()=>krt,_base64url:()=>Prt,_bigint:()=>AJt,_boolean:()=>mJt,_catch:()=>yas,_cidrv4:()=>wrt,_cidrv6:()=>Rrt,_coercedBigint:()=>yJt,_coercedBoolean:()=>gJt,_coercedDate:()=>wJt,_coercedNumber:()=>lJt,_coercedString:()=>rJt,_cuid:()=>vrt,_cuid2:()=>Crt,_custom:()=>BJt,_date:()=>xJt,_default:()=>mas,_discriminatedUnion:()=>ias,_e164:()=>Drt,_email:()=>prt,_emoji:()=>Ert,_endsWith:()=>WRe,_enum:()=>las,_file:()=>LJt,_float32:()=>dJt,_float64:()=>fJt,_gt:()=>RF,_gte:()=>ib,_guid:()=>QRe,_includes:()=>$Re,_int:()=>uJt,_int32:()=>pJt,_int64:()=>EJt,_intersection:()=>oas,_ipv4:()=>Irt,_ipv6:()=>xrt,_isoDate:()=>oJt,_isoDateTime:()=>iJt,_isoDuration:()=>aJt,_isoTime:()=>sJt,_jwt:()=>Nrt,_ksuid:()=>Trt,_lazy:()=>Cas,_length:()=>Yde,_literal:()=>das,_lowercase:()=>HRe,_lt:()=>wF,_lte:()=>Iw,_map:()=>aas,_max:()=>Iw,_maxLength:()=>zde,_maxSize:()=>Wde,_mime:()=>zRe,_min:()=>ib,_minLength:()=>hj,_minSize:()=>zJ,_multipleOf:()=>WJ,_nan:()=>RJt,_nanoid:()=>_rt,_nativeEnum:()=>uas,_negative:()=>PJt,_never:()=>TJt,_nonnegative:()=>NJt,_nonoptional:()=>gas,_nonpositive:()=>DJt,_normalize:()=>YRe,_null:()=>bJt,_nullable:()=>has,_number:()=>cJt,_optional:()=>pas,_overwrite:()=>kF,_parse:()=>ert,_parseAsync:()=>trt,_pipe:()=>Eas,_positive:()=>kJt,_promise:()=>bas,_property:()=>MJt,_readonly:()=>_as,_record:()=>sas,_refine:()=>FJt,_regex:()=>jRe,_safeParse:()=>rrt,_safeParseAsync:()=>nrt,_set:()=>cas,_size:()=>qRe,_startsWith:()=>VRe,_string:()=>tJt,_stringFormat:()=>QJt,_stringbool:()=>UJt,_success:()=>Aas,_symbol:()=>vJt,_templateLiteral:()=>vas,_toLowerCase:()=>JRe,_toUpperCase:()=>ZRe,_transform:()=>fas,_trim:()=>KRe,_tuple:()=>OJt,_uint32:()=>hJt,_uint64:()=>_Jt,_ulid:()=>brt,_undefined:()=>CJt,_union:()=>nas,_unknown:()=>Vde,_uppercase:()=>GRe,_url:()=>yrt,_uuid:()=>hrt,_uuidv4:()=>mrt,_uuidv6:()=>grt,_uuidv7:()=>Art,_void:()=>IJt,_xid:()=>Srt,clone:()=>dT,config:()=>lm,flattenError:()=>wRe,formatError:()=>RRe,function:()=>qJt,globalConfig:()=>yRe,globalRegistry:()=>p5,isValidBase64:()=>DYt,isValidBase64URL:()=>y2n,isValidJWT:()=>E2n,locales:()=>URe,parse:()=>kRe,parseAsync:()=>PRe,prettifyError:()=>Azt,regexes:()=>GJ,registry:()=>frt,safeParse:()=>jde,safeParseAsync:()=>DRe,toDotPath:()=>e2n,toJSONSchema:()=>jJt,treeifyError:()=>gzt,util:()=>qr,version:()=>dYt});p();p();var ERe=Object.freeze({status:"aborted"});function dt(t,e,r){function n(l,u){var d;Object.defineProperty(l,"_zod",{value:l._zod??{},enumerable:!1}),(d=l._zod).traits??(d.traits=new Set),l._zod.traits.add(t),e(l,u);for(let f in c.prototype)f in l||Object.defineProperty(l,f,{value:c.prototype[f].bind(l)});l._zod.constr=c,l._zod.def=u}a(n,"init");let o=r?.Parent??Object;class s extends o{static{a(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function c(l){var u;let d=r?.Parent?new s:this;n(d,l),(u=d._zod).deferred??(u.deferred=[]);for(let f of d._zod.deferred)f();return d}return a(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:a(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}a(dt,"$constructor");var izt=Symbol("zod_brand"),f5=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},yRe={};function lm(t){return t&&Object.assign(yRe,t),yRe}a(lm,"config");p();p();var qr={};Ri(qr,{BIGINT_FORMAT_RANGES:()=>hzt,Class:()=>szt,NUMBER_FORMAT_RANGES:()=>pzt,aborted:()=>jJ,allowsEval:()=>uzt,assert:()=>$os,assertEqual:()=>qos,assertIs:()=>Hos,assertNever:()=>Gos,assertNotEqual:()=>jos,assignProp:()=>lzt,cached:()=>CRe,captureStackTrace:()=>Xtt,cleanEnum:()=>iss,cleanRegex:()=>bRe,clone:()=>dT,createTransparentProxy:()=>Jos,defineLazy:()=>kc,esc:()=>qJ,escapeRegex:()=>xF,extend:()=>ess,finalizeIssue:()=>fT,floatSafeRemainder:()=>czt,getElementAtPath:()=>Vos,getEnumValues:()=>vRe,getLengthableOrigin:()=>IRe,getParsedType:()=>Kos,getSizableOrigin:()=>TRe,isObject:()=>Ude,isPlainObject:()=>Qde,issue:()=>mzt,joinValues:()=>qt,jsonStringifyReplacer:()=>azt,merge:()=>tss,normalizeParams:()=>Tr,nullish:()=>pj,numKeys:()=>Yos,omit:()=>Xos,optionalKeys:()=>fzt,partial:()=>rss,pick:()=>Zos,prefixIssues:()=>nb,primitiveTypes:()=>dzt,promiseAllObject:()=>Wos,propertyKeyTypes:()=>SRe,randomString:()=>zos,required:()=>nss,stringifyPrimitive:()=>Qr,unwrapMessage:()=>_Re});p();function qos(t){return t}a(qos,"assertEqual");function jos(t){return t}a(jos,"assertNotEqual");function Hos(t){}a(Hos,"assertIs");function Gos(t){throw new Error}a(Gos,"assertNever");function $os(t){}a($os,"assert");function vRe(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,o])=>e.indexOf(+n)===-1).map(([n,o])=>o)}a(vRe,"getEnumValues");function qt(t,e="|"){return t.map(r=>Qr(r)).join(e)}a(qt,"joinValues");function azt(t,e){return typeof e=="bigint"?e.toString():e}a(azt,"jsonStringifyReplacer");function CRe(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(CRe,"cached");function pj(t){return t==null}a(pj,"nullish");function bRe(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}a(bRe,"cleanRegex");function czt(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return s%c/10**o}a(czt,"floatSafeRemainder");function kc(t,e,r){Object.defineProperty(t,e,{get(){{let o=r();return t[e]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}a(kc,"defineLazy");function lzt(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}a(lzt,"assignProp");function Vos(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}a(Vos,"getElementAtPath");function Wos(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s{};function Ude(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(Ude,"isObject");var uzt=CRe(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Qde(t){if(Ude(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(Ude(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(Qde,"isPlainObject");function Yos(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}a(Yos,"numKeys");var Kos=a(t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},"getParsedType"),SRe=new Set(["string","number","symbol"]),dzt=new Set(["string","number","bigint","boolean","symbol","undefined"]);function xF(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(xF,"escapeRegex");function dT(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}a(dT,"clone");function Tr(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:a(()=>e,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:a(()=>e.error,"error")}:e}a(Tr,"normalizeParams");function Jos(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}a(Jos,"createTransparentProxy");function Qr(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}a(Qr,"stringifyPrimitive");function fzt(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}a(fzt,"optionalKeys");var pzt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},hzt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Zos(t,e){let r={},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(r[o]=n.shape[o])}return dT(t,{...t._zod.def,shape:r,checks:[]})}a(Zos,"pick");function Xos(t,e){let r={...t._zod.def.shape},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete r[o]}return dT(t,{...t._zod.def,shape:r,checks:[]})}a(Xos,"omit");function ess(t,e){if(!Qde(e))throw new Error("Invalid input to extend: expected a plain object");let r={...t._zod.def,get shape(){let n={...t._zod.def.shape,...e};return lzt(this,"shape",n),n},checks:[]};return dT(t,r)}a(ess,"extend");function tss(t,e){return dT(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return lzt(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}a(tss,"merge");function rss(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=t?new t({type:"optional",innerType:n[s]}):n[s])}else for(let s in n)o[s]=t?new t({type:"optional",innerType:n[s]}):n[s];return dT(e,{...e._zod.def,shape:o,checks:[]})}a(rss,"partial");function nss(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return dT(e,{...e._zod.def,shape:o,checks:[]})}a(nss,"required");function jJ(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}a(nb,"prefixIssues");function _Re(t){return typeof t=="string"?t:t?.message}a(_Re,"unwrapMessage");function fT(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=_Re(t.inst?._zod.def?.error?.(t))??_Re(e?.error?.(t))??_Re(r.customError?.(t))??_Re(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}a(fT,"finalizeIssue");function TRe(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}a(TRe,"getSizableOrigin");function IRe(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}a(IRe,"getLengthableOrigin");function mzt(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}a(mzt,"issue");function iss(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a(iss,"cleanEnum");var szt=class{static{a(this,"Class")}constructor(...e){}};var XPn=a((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,azt,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:a(()=>t.message,"value"),enumerable:!1})},"initializer"),xRe=dt("$ZodError",XPn),qde=dt("$ZodError",XPn,{Parent:Error});function wRe(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}a(wRe,"flattenError");function RRe(t,e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>o({issues:l}));else if(c.code==="invalid_key")o({issues:c.issues});else if(c.code==="invalid_element")o({issues:c.issues});else if(c.path.length===0)n._errors.push(r(c));else{let l=n,u=0;for(;u{var l,u;for(let d of s.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(f=>o({issues:f},d.path));else if(d.code==="invalid_key")o({issues:d.issues},d.path);else if(d.code==="invalid_element")o({issues:d.issues},d.path);else{let f=[...c,...d.path];if(f.length===0){n.errors.push(r(d));continue}let h=n,m=0;for(;mn.path.length-o.path.length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${e2n(n.path)}`);return e.join(` +`)}a(Azt,"prettifyError");var ert=a(t=>(e,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new f5;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>fT(u,s,lm())));throw Xtt(l,o?.callee),l}return c.value},"_parse"),kRe=ert(qde),trt=a(t=>async(e,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>fT(u,s,lm())));throw Xtt(l,o?.callee),l}return c.value},"_parseAsync"),PRe=trt(qde),rrt=a(t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new f5;return s.issues.length?{success:!1,error:new(t??xRe)(s.issues.map(c=>fT(c,o,lm())))}:{success:!0,data:s.value}},"_safeParse"),jde=rrt(qde),nrt=a(t=>async(e,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>fT(c,o,lm())))}:{success:!0,data:s.value}},"_safeParseAsync"),DRe=nrt(qde);p();p();var GJ={};Ri(GJ,{_emoji:()=>t2n,base64:()=>Dzt,base64url:()=>irt,bigint:()=>Uzt,boolean:()=>jzt,browserEmail:()=>pss,cidrv4:()=>kzt,cidrv6:()=>Pzt,cuid:()=>yzt,cuid2:()=>Ezt,date:()=>Ozt,datetime:()=>Bzt,domain:()=>hss,duration:()=>Szt,e164:()=>Mzt,email:()=>Izt,emoji:()=>xzt,extendedDuration:()=>sss,guid:()=>Tzt,hostname:()=>Nzt,html5Email:()=>uss,integer:()=>Qzt,ipv4:()=>wzt,ipv6:()=>Rzt,ksuid:()=>Czt,lowercase:()=>$zt,nanoid:()=>bzt,null:()=>Hzt,number:()=>qzt,rfc5322Email:()=>dss,string:()=>Fzt,time:()=>Lzt,ulid:()=>_zt,undefined:()=>Gzt,unicodeEmail:()=>fss,uppercase:()=>Vzt,uuid:()=>HJ,uuid4:()=>ass,uuid6:()=>css,uuid7:()=>lss,xid:()=>vzt});p();var yzt=/^[cC][^\s-]{8,}$/,Ezt=/^[0-9a-z]+$/,_zt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,vzt=/^[0-9a-vA-V]{20}$/,Czt=/^[A-Za-z0-9]{27}$/,bzt=/^[a-zA-Z0-9_-]{21}$/,Szt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,sss=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Tzt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,HJ=a(t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,"uuid"),ass=HJ(4),css=HJ(6),lss=HJ(7),Izt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,uss=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,dss=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,fss=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,pss=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,t2n="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function xzt(){return new RegExp(t2n,"u")}a(xzt,"emoji");var wzt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Rzt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,kzt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Pzt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Dzt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,irt=/^[A-Za-z0-9_-]*$/,Nzt=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,hss=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Mzt=/^\+(?:[0-9]){6,14}[0-9]$/,r2n="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Ozt=new RegExp(`^${r2n}$`);function n2n(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}a(n2n,"timeSource");function Lzt(t){return new RegExp(`^${n2n(t)}$`)}a(Lzt,"time");function Bzt(t){let e=n2n({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${r2n}T(?:${n})$`)}a(Bzt,"datetime");var Fzt=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),Uzt=/^\d+n?$/,Qzt=/^\d+$/,qzt=/^-?\d+(?:\.\d+)?/i,jzt=/true|false/i,Hzt=/null/i;var Gzt=/undefined/i;var $zt=/^[^A-Z]*$/,Vzt=/^[^a-z]*$/;var kf=dt("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),o2n={number:"number",bigint:"bigint",object:"date"},ort=dt("$ZodCheckLessThan",(t,e)=>{kf.init(t,e);let r=o2n[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?n.value<=e.value:n.value{kf.init(t,e);let r=o2n[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Wzt=dt("$ZodCheckMultipleOf",(t,e)=>{kf.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):czt(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),zzt=dt("$ZodCheckNumberFormat",(t,e)=>{kf.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=pzt[e.format];t._zod.onattach.push(c=>{let l=c._zod.bag;l.format=e.format,l.minimum=o,l.maximum=s,r&&(l.pattern=Qzt)}),t._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:e.format,code:"invalid_type",input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort});return}}ls&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inst:t})}}),Yzt=dt("$ZodCheckBigIntFormat",(t,e)=>{kf.init(t,e);let[r,n]=hzt[e.format];t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,s.minimum=r,s.maximum=n}),t._zod.check=o=>{let s=o.value;sn&&o.issues.push({origin:"bigint",input:s,code:"too_big",maximum:n,inst:t})}}),Kzt=dt("$ZodCheckMaxSize",(t,e)=>{var r;kf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!pj(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let o=n.value;o.size<=e.maximum||n.issues.push({origin:TRe(o),code:"too_big",maximum:e.maximum,input:o,inst:t,continue:!e.abort})}}),Jzt=dt("$ZodCheckMinSize",(t,e)=>{var r;kf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!pj(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;o.size>=e.minimum||n.issues.push({origin:TRe(o),code:"too_small",minimum:e.minimum,input:o,inst:t,continue:!e.abort})}}),Zzt=dt("$ZodCheckSizeEquals",(t,e)=>{var r;kf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!pj(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.size,o.maximum=e.size,o.size=e.size}),t._zod.check=n=>{let o=n.value,s=o.size;if(s===e.size)return;let c=s>e.size;n.issues.push({origin:TRe(o),...c?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),Xzt=dt("$ZodCheckMaxLength",(t,e)=>{var r;kf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!pj(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let o=n.value;if(o.length<=e.maximum)return;let c=IRe(o);n.issues.push({origin:c,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),eYt=dt("$ZodCheckMinLength",(t,e)=>{var r;kf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!pj(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let c=IRe(o);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),tYt=dt("$ZodCheckLengthEquals",(t,e)=>{var r;kf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!pj(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),t._zod.check=n=>{let o=n.value,s=o.length;if(s===e.length)return;let c=IRe(o),l=s>e.length;n.issues.push({origin:c,...l?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),Hde=dt("$ZodCheckStringFormat",(t,e)=>{var r,n;kf.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),rYt=dt("$ZodCheckRegex",(t,e)=>{Hde.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),nYt=dt("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=$zt),Hde.init(t,e)}),iYt=dt("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Vzt),Hde.init(t,e)}),oYt=dt("$ZodCheckIncludes",(t,e)=>{kf.init(t,e);let r=xF(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),sYt=dt("$ZodCheckStartsWith",(t,e)=>{kf.init(t,e);let r=new RegExp(`^${xF(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),aYt=dt("$ZodCheckEndsWith",(t,e)=>{kf.init(t,e);let r=new RegExp(`.*${xF(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});function i2n(t,e,r){t.issues.length&&e.issues.push(...nb(r,t.issues))}a(i2n,"handleCheckPropertyResult");var cYt=dt("$ZodCheckProperty",(t,e)=>{kf.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>i2n(o,r,e.property));i2n(n,r,e.property)}}),lYt=dt("$ZodCheckMimeType",(t,e)=>{kf.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t})}}),uYt=dt("$ZodCheckOverwrite",(t,e)=>{kf.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});p();var NRe=class{static{a(this,"Doc")}constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(` `).filter(c=>c),o=Math.min(...n.map(c=>c.length-c.trimStart().length)),s=n.map(c=>c.slice(o)).map(c=>" ".repeat(this.indent*2)+c);for(let c of s)this.content.push(c)}compile(){let e=Function,r=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new e(...r,o.join(` -`))}};p();var Ezt={major:4,minor:0,patch:0};var uo=dt("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Ezt;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=a((s,c,l)=>{let u=DJ(s),d;for(let f of c){if(f._zod.def.when){if(!f._zod.def.when(s))continue}else if(u)continue;let h=s.issues.length,m=f._zod.check(s);if(m instanceof Promise&&l?.async===!1)throw new i5;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=DJ(s,h)))});else{if(s.issues.length===h)continue;u||(u=DJ(s,h))}}return d?d.then(()=>s):s},"runChecks");t._zod.run=(s,c)=>{let l=t._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new i5;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=Pde(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return pRe(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),OJ=dt("$ZodString",(t,e)=>{uo.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??VWt(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),Vl=dt("$ZodStringFormat",(t,e)=>{Dde.init(t,e),OJ.init(t,e)}),vzt=dt("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=NWt),Vl.init(t,e)}),Czt=dt("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=NJ(n))}else e.pattern??(e.pattern=NJ());Vl.init(t,e)}),bzt=dt("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=MWt),Vl.init(t,e)}),Szt=dt("$ZodURL",(t,e)=>{Vl.init(t,e),t._zod.check=r=>{try{let n=r.value,o=new URL(n),s=o.href;e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:qWt.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),!n.endsWith("/")&&s.endsWith("/")?r.value=s.slice(0,-1):r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),Tzt=dt("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=OWt()),Vl.init(t,e)}),Izt=dt("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=PWt),Vl.init(t,e)}),xzt=dt("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=IWt),Vl.init(t,e)}),wzt=dt("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=xWt),Vl.init(t,e)}),Rzt=dt("$ZodULID",(t,e)=>{e.pattern??(e.pattern=wWt),Vl.init(t,e)}),kzt=dt("$ZodXID",(t,e)=>{e.pattern??(e.pattern=RWt),Vl.init(t,e)}),Pzt=dt("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=kWt),Vl.init(t,e)}),Dzt=dt("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=$Wt(e)),Vl.init(t,e)}),Nzt=dt("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=HWt),Vl.init(t,e)}),Mzt=dt("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=GWt(e)),Vl.init(t,e)}),Ozt=dt("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=DWt),Vl.init(t,e)}),Lzt=dt("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=LWt),Vl.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Bzt=dt("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=BWt),Vl.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),Fzt=dt("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=FWt),Vl.init(t,e)}),Uzt=dt("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=UWt),Vl.init(t,e),t._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function Qzt(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}a(Qzt,"isValidBase64");var qzt=dt("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=QWt),Vl.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{Qzt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function qkn(t){if(!Ptt.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Qzt(r)}a(qkn,"isValidBase64URL");var jzt=dt("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Ptt),Vl.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{qkn(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Hzt=dt("$ZodE164",(t,e)=>{e.pattern??(e.pattern=jWt),Vl.init(t,e)});function jkn(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}a(jkn,"isValidJWT");var Gzt=dt("$ZodJWT",(t,e)=>{Vl.init(t,e),t._zod.check=r=>{jkn(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),$zt=dt("$ZodCustomStringFormat",(t,e)=>{Vl.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),Ltt=dt("$ZodNumber",(t,e)=>{uo.init(t,e),t._zod.pattern=t._zod.bag.pattern??YWt,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),Vzt=dt("$ZodNumber",(t,e)=>{rzt.init(t,e),Ltt.init(t,e)}),mRe=dt("$ZodBoolean",(t,e)=>{uo.init(t,e),t._zod.pattern=KWt,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}}),Btt=dt("$ZodBigInt",(t,e)=>{uo.init(t,e),t._zod.pattern=WWt,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),Wzt=dt("$ZodBigInt",(t,e)=>{nzt.init(t,e),Btt.init(t,e)}),zzt=dt("$ZodSymbol",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:t}),r}}),Yzt=dt("$ZodUndefined",(t,e)=>{uo.init(t,e),t._zod.pattern=ZWt,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:t}),r}}),Kzt=dt("$ZodNull",(t,e)=>{uo.init(t,e),t._zod.pattern=JWt,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}}),Jzt=dt("$ZodAny",(t,e)=>{uo.init(t,e),t._zod.parse=r=>r}),Nde=dt("$ZodUnknown",(t,e)=>{uo.init(t,e),t._zod.parse=r=>r}),Zzt=dt("$ZodNever",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),Xzt=dt("$ZodVoid",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:t}),r}}),eYt=dt("$ZodDate",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:t}),r}});function kkn(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues)),e.value[r]=t.value}a(kkn,"handleArrayResult");var gRe=dt("$ZodArray",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let c=0;ckkn(d,r,c))):kkn(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Mtt(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues)),e.value[r]=t.value}a(Mtt,"handleObjectResult");function Pkn(t,e,r,n){t.issues.length?n[r]===void 0?r in n?e.value[r]=void 0:e.value[r]=t.value:e.issues.push(...eb(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}a(Pkn,"handleOptionalObjectResult");var tYt=dt("$ZodObject",(t,e)=>{uo.init(t,e);let r=nRe(()=>{let h=Object.keys(e.shape);for(let g of h)if(!(e.shape[g]instanceof uo))throw new Error(`Invalid element at key "${g}": expected a Zod schema`);let m=_Wt(e.shape);return{shape:e.shape,keys:h,keySet:new Set(h),numKeys:h.length,optionalKeys:new Set(m)}});xc(t._zod,"propValues",()=>{let h=e.shape,m={};for(let g in h){let A=h[g]._zod;if(A.values){m[g]??(m[g]=new Set);for(let y of A.values)m[g].add(y)}}return m});let n=a(h=>{let m=new hRe(["shape","payload","ctx"]),g=r.value,A=a(v=>{let b=PJ(v);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`},"parseStr");m.write("const input = payload.value;");let y=Object.create(null),E=0;for(let v of g.keys)y[v]=`key_${E++}`;m.write("const newResult = {}");for(let v of g.keys)if(g.optionalKeys.has(v)){let b=y[v];m.write(`const ${b} = ${A(v)};`);let T=PJ(v);m.write(` +`))}};p();var dYt={major:4,minor:0,patch:0};var co=dt("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=dYt;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=a((s,c,l)=>{let u=jJ(s),d;for(let f of c){if(f._zod.def.when){if(!f._zod.def.when(s))continue}else if(u)continue;let h=s.issues.length,m=f._zod.check(s);if(m instanceof Promise&&l?.async===!1)throw new f5;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=jJ(s,h)))});else{if(s.issues.length===h)continue;u||(u=jJ(s,h))}}return d?d.then(()=>s):s},"runChecks");t._zod.run=(s,c)=>{let l=t._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new f5;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=jde(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return DRe(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),$J=dt("$ZodString",(t,e)=>{co.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Fzt(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),zl=dt("$ZodStringFormat",(t,e)=>{Hde.init(t,e),$J.init(t,e)}),pYt=dt("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Tzt),zl.init(t,e)}),hYt=dt("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=HJ(n))}else e.pattern??(e.pattern=HJ());zl.init(t,e)}),mYt=dt("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Izt),zl.init(t,e)}),gYt=dt("$ZodURL",(t,e)=>{zl.init(t,e),t._zod.check=r=>{try{let n=r.value,o=new URL(n),s=o.href;e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Nzt.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),!n.endsWith("/")&&s.endsWith("/")?r.value=s.slice(0,-1):r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),AYt=dt("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=xzt()),zl.init(t,e)}),yYt=dt("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=bzt),zl.init(t,e)}),EYt=dt("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=yzt),zl.init(t,e)}),_Yt=dt("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Ezt),zl.init(t,e)}),vYt=dt("$ZodULID",(t,e)=>{e.pattern??(e.pattern=_zt),zl.init(t,e)}),CYt=dt("$ZodXID",(t,e)=>{e.pattern??(e.pattern=vzt),zl.init(t,e)}),bYt=dt("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Czt),zl.init(t,e)}),SYt=dt("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Bzt(e)),zl.init(t,e)}),TYt=dt("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Ozt),zl.init(t,e)}),IYt=dt("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Lzt(e)),zl.init(t,e)}),xYt=dt("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Szt),zl.init(t,e)}),wYt=dt("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=wzt),zl.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),RYt=dt("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Rzt),zl.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),kYt=dt("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=kzt),zl.init(t,e)}),PYt=dt("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Pzt),zl.init(t,e),t._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function DYt(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}a(DYt,"isValidBase64");var NYt=dt("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Dzt),zl.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{DYt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function y2n(t){if(!irt.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return DYt(r)}a(y2n,"isValidBase64URL");var MYt=dt("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=irt),zl.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{y2n(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),OYt=dt("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Mzt),zl.init(t,e)});function E2n(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}a(E2n,"isValidJWT");var LYt=dt("$ZodJWT",(t,e)=>{zl.init(t,e),t._zod.check=r=>{E2n(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),BYt=dt("$ZodCustomStringFormat",(t,e)=>{zl.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),lrt=dt("$ZodNumber",(t,e)=>{co.init(t,e),t._zod.pattern=t._zod.bag.pattern??qzt,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),FYt=dt("$ZodNumber",(t,e)=>{zzt.init(t,e),lrt.init(t,e)}),MRe=dt("$ZodBoolean",(t,e)=>{co.init(t,e),t._zod.pattern=jzt,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}}),urt=dt("$ZodBigInt",(t,e)=>{co.init(t,e),t._zod.pattern=Uzt,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),UYt=dt("$ZodBigInt",(t,e)=>{Yzt.init(t,e),urt.init(t,e)}),QYt=dt("$ZodSymbol",(t,e)=>{co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:t}),r}}),qYt=dt("$ZodUndefined",(t,e)=>{co.init(t,e),t._zod.pattern=Gzt,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:t}),r}}),jYt=dt("$ZodNull",(t,e)=>{co.init(t,e),t._zod.pattern=Hzt,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}}),HYt=dt("$ZodAny",(t,e)=>{co.init(t,e),t._zod.parse=r=>r}),Gde=dt("$ZodUnknown",(t,e)=>{co.init(t,e),t._zod.parse=r=>r}),GYt=dt("$ZodNever",(t,e)=>{co.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),$Yt=dt("$ZodVoid",(t,e)=>{co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:t}),r}}),VYt=dt("$ZodDate",(t,e)=>{co.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:t}),r}});function a2n(t,e,r){t.issues.length&&e.issues.push(...nb(r,t.issues)),e.value[r]=t.value}a(a2n,"handleArrayResult");var ORe=dt("$ZodArray",(t,e)=>{co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let c=0;ca2n(d,r,c))):a2n(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function art(t,e,r){t.issues.length&&e.issues.push(...nb(r,t.issues)),e.value[r]=t.value}a(art,"handleObjectResult");function c2n(t,e,r,n){t.issues.length?n[r]===void 0?r in n?e.value[r]=void 0:e.value[r]=t.value:e.issues.push(...nb(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}a(c2n,"handleOptionalObjectResult");var WYt=dt("$ZodObject",(t,e)=>{co.init(t,e);let r=CRe(()=>{let h=Object.keys(e.shape);for(let g of h)if(!(e.shape[g]instanceof co))throw new Error(`Invalid element at key "${g}": expected a Zod schema`);let m=fzt(e.shape);return{shape:e.shape,keys:h,keySet:new Set(h),numKeys:h.length,optionalKeys:new Set(m)}});kc(t._zod,"propValues",()=>{let h=e.shape,m={};for(let g in h){let A=h[g]._zod;if(A.values){m[g]??(m[g]=new Set);for(let y of A.values)m[g].add(y)}}return m});let n=a(h=>{let m=new NRe(["shape","payload","ctx"]),g=r.value,A=a(v=>{let b=qJ(v);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`},"parseStr");m.write("const input = payload.value;");let y=Object.create(null),E=0;for(let v of g.keys)y[v]=`key_${E++}`;m.write("const newResult = {}");for(let v of g.keys)if(g.optionalKeys.has(v)){let b=y[v];m.write(`const ${b} = ${A(v)};`);let T=qJ(v);m.write(` if (${b}.issues.length) { if (input[${T}] === undefined) { if (${T} in input) { @@ -3723,162 +3723,216 @@ ${e.map(n=>{let o=n.cves.map(f=>{let h=`[${f.id}](${f.html_url}): ${zVt(f.summar `)}else{let b=y[v];m.write(`const ${b} = ${A(v)};`),m.write(` if (${b}.issues.length) payload.issues = payload.issues.concat(${b}.issues.map(iss => ({ ...iss, - path: iss.path ? [${PJ(v)}, ...iss.path] : [${PJ(v)}] - })));`),m.write(`newResult[${PJ(v)}] = ${b}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");let _=m.compile();return(v,b)=>_(h,v,b)},"generateFastpass"),o,s=wde,c=!Xwe.jitless,u=c&&yWt.value,d=e.catchall,f;t._zod.parse=(h,m)=>{f??(f=r.value);let g=h.value;if(!s(g))return h.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),h;let A=[];if(c&&u&&m?.async===!1&&m.jitless!==!0)o||(o=n(e.shape)),h=o(h,m);else{h.value={};let b=f.shape;for(let T of f.keys){let w=b[T],R=w._zod.run({value:g[T],issues:[]},m),x=w._zod.optin==="optional"&&w._zod.optout==="optional";R instanceof Promise?A.push(R.then(P=>x?Pkn(P,h,T,g):Mtt(P,h,T))):x?Pkn(R,h,T,g):Mtt(R,h,T)}}if(!d)return A.length?Promise.all(A).then(()=>h):h;let y=[],E=f.keySet,_=d._zod,v=_.def.type;for(let b of Object.keys(g)){if(E.has(b))continue;if(v==="never"){y.push(b);continue}let T=_.run({value:g[b],issues:[]},m);T instanceof Promise?A.push(T.then(w=>Mtt(w,h,b))):Mtt(T,h,b)}return y.length&&h.issues.push({code:"unrecognized_keys",keys:y,input:g,inst:t}),A.length?Promise.all(A).then(()=>h):h}});function Dkn(t,e,r,n){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>oT(s,n,im())))}),e}a(Dkn,"handleUnionResults");var Ftt=dt("$ZodUnion",(t,e)=>{uo.init(t,e),xc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),xc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),xc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),xc(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){let r=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>iRe(n.source)).join("|")})$`)}}),t._zod.parse=(r,n)=>{let o=!1,s=[];for(let c of e.options){let l=c._zod.run({value:r.value,issues:[]},n);if(l instanceof Promise)s.push(l),o=!0;else{if(l.issues.length===0)return l;s.push(l)}}return o?Promise.all(s).then(c=>Dkn(c,r,t,n)):Dkn(s,r,t,n)}}),rYt=dt("$ZodDiscriminatedUnion",(t,e)=>{Ftt.init(t,e);let r=t._zod.parse;xc(t._zod,"propValues",()=>{let o={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[l,u]of Object.entries(c)){o[l]||(o[l]=new Set);for(let d of u)o[l].add(d)}}return o});let n=nRe(()=>{let o=e.options,s=new Map;for(let c of o){let l=c._zod.propValues[e.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let u of l){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,c)}}return s});t._zod.parse=(o,s)=>{let c=o.value;if(!wde(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),o;let l=n.value.get(c?.[e.discriminator]);return l?l._zod.run(o,s):e.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:c,path:[e.discriminator],inst:t}),o)}}),nYt=dt("$ZodIntersection",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),c=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||c instanceof Promise?Promise.all([s,c]).then(([u,d])=>Nkn(r,u,d)):Nkn(r,s,c)}});function _zt(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Rde(t)&&Rde(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let c=_zt(t[s],e[s]);if(!c.valid)return{valid:!1,mergeErrorPath:[s,...c.mergeErrorPath]};o[s]=c.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n{uo.init(t,e);let r=e.items,n=r.length-[...r].reverse().findIndex(o=>o._zod.optin!=="optional");t._zod.parse=(o,s)=>{let c=o.value;if(!Array.isArray(c))return o.issues.push({input:c,inst:t,expected:"tuple",code:"invalid_type"}),o;o.value=[];let l=[];if(!e.rest){let d=c.length>r.length,f=c.length=c.length&&u>=n)continue;let f=d._zod.run({value:c[u],issues:[]},s);f instanceof Promise?l.push(f.then(h=>Ott(h,o,u))):Ott(f,o,u)}if(e.rest){let d=c.slice(r.length);for(let f of d){u++;let h=e.rest._zod.run({value:f,issues:[]},s);h instanceof Promise?l.push(h.then(m=>Ott(m,o,u))):Ott(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});function Ott(t,e,r){t.issues.length&&e.issues.push(...eb(r,t.issues)),e.value[r]=t.value}a(Ott,"handleTupleResult");var iYt=dt("$ZodRecord",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Rde(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[];if(e.keyType._zod.values){let c=e.keyType._zod.values;r.value={};for(let u of c)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let d=e.valueType._zod.run({value:o[u],issues:[]},n);d instanceof Promise?s.push(d.then(f=>{f.issues.length&&r.issues.push(...eb(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...eb(u,d.issues)),r.value[u]=d.value)}let l;for(let u in o)c.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:l})}else{r.value={};for(let c of Reflect.ownKeys(o)){if(c==="__proto__")continue;let l=e.keyType._zod.run({value:c,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:l.issues.map(d=>oT(d,n,im())),input:c,path:[c],inst:t}),r.value[l.value]=l.value;continue}let u=e.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?s.push(u.then(d=>{d.issues.length&&r.issues.push(...eb(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...eb(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),oYt=dt("$ZodMap",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:t}),r;let s=[];r.value=new Map;for(let[c,l]of o){let u=e.keyType._zod.run({value:c,issues:[]},n),d=e.valueType._zod.run({value:l,issues:[]},n);u instanceof Promise||d instanceof Promise?s.push(Promise.all([u,d]).then(([f,h])=>{Mkn(f,h,r,c,o,t,n)})):Mkn(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});function Mkn(t,e,r,n,o,s,c){t.issues.length&&(oRe.has(typeof n)?r.issues.push(...eb(n,t.issues)):r.issues.push({origin:"map",code:"invalid_key",input:o,inst:s,issues:t.issues.map(l=>oT(l,c,im()))})),e.issues.length&&(oRe.has(typeof n)?r.issues.push(...eb(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>oT(l,c,im()))})),r.value.set(t.value,e.value)}a(Mkn,"handleMapResult");var sYt=dt("$ZodSet",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:t,expected:"set",code:"invalid_type"}),r;let s=[];r.value=new Set;for(let c of o){let l=e.valueType._zod.run({value:c,issues:[]},n);l instanceof Promise?s.push(l.then(u=>Okn(u,r))):Okn(l,r)}return s.length?Promise.all(s).then(()=>r):r}});function Okn(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}a(Okn,"handleSetResult");var aYt=dt("$ZodEnum",(t,e)=>{uo.init(t,e);let r=rRe(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>oRe.has(typeof n)).map(n=>typeof n=="string"?EF(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return t._zod.values.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),cYt=dt("$ZodLiteral",(t,e)=>{uo.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?EF(r):r?r.toString():String(r)).join("|")})$`),t._zod.parse=(r,n)=>{let o=r.value;return t._zod.values.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),r}}),lYt=dt("$ZodFile",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:t}),r}}),ARe=dt("$ZodTransform",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new i5;return r.value=o,r}}),uYt=dt("$ZodOptional",(t,e)=>{uo.init(t,e),t._zod.optin="optional",t._zod.optout="optional",xc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),xc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${iRe(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(r,n):r.value===void 0?r:e.innerType._zod.run(r,n)}),dYt=dt("$ZodNullable",(t,e)=>{uo.init(t,e),xc(t._zod,"optin",()=>e.innerType._zod.optin),xc(t._zod,"optout",()=>e.innerType._zod.optout),xc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${iRe(r.source)}|null)$`):void 0}),xc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),fYt=dt("$ZodDefault",(t,e)=>{uo.init(t,e),t._zod.optin="optional",xc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Lkn(s,e)):Lkn(o,e)}});function Lkn(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}a(Lkn,"handleDefaultResult");var pYt=dt("$ZodPrefault",(t,e)=>{uo.init(t,e),t._zod.optin="optional",xc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),hYt=dt("$ZodNonOptional",(t,e)=>{uo.init(t,e),xc(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Bkn(s,t)):Bkn(o,t)}});function Bkn(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}a(Bkn,"handleNonOptionalResult");var mYt=dt("$ZodSuccess",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.issues.length===0,r)):(r.value=o.issues.length===0,r)}}),gYt=dt("$ZodCatch",(t,e)=>{uo.init(t,e),t._zod.optin="optional",xc(t._zod,"optout",()=>e.innerType._zod.optout),xc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(c=>oT(c,n,im()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>oT(s,n,im()))},input:r.value}),r.issues=[]),r)}}),AYt=dt("$ZodNaN",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),yRe=dt("$ZodPipe",(t,e)=>{uo.init(t,e),xc(t._zod,"values",()=>e.in._zod.values),xc(t._zod,"optin",()=>e.in._zod.optin),xc(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(r,n)=>{let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Fkn(s,e,n)):Fkn(o,e,n)}});function Fkn(t,e,r){return DJ(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}a(Fkn,"handlePipeResult");var yYt=dt("$ZodReadonly",(t,e)=>{uo.init(t,e),xc(t._zod,"propValues",()=>e.innerType._zod.propValues),xc(t._zod,"values",()=>e.innerType._zod.values),xc(t._zod,"optin",()=>e.innerType._zod.optin),xc(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(Ukn):Ukn(o)}});function Ukn(t){return t.value=Object.freeze(t.value),t}a(Ukn,"handleReadonlyResult");var EYt=dt("$ZodTemplateLiteral",(t,e)=>{uo.init(t,e);let r=[];for(let n of e.parts)if(n instanceof uo){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let o=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!o)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let s=o.startsWith("^")?1:0,c=o.endsWith("$")?o.length-1:o.length;r.push(o.slice(s,c))}else if(n===null||EWt.has(typeof n))r.push(EF(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"template_literal",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:"template_literal",pattern:t._zod.pattern.source}),n)}),_Yt=dt("$ZodPromise",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),vYt=dt("$ZodLazy",(t,e)=>{uo.init(t,e),xc(t._zod,"innerType",()=>e.getter()),xc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),xc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),xc(t._zod,"optin",()=>t._zod.innerType._zod.optin),xc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),CYt=dt("$ZodCustom",(t,e)=>{Tf.init(t,e),uo.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>Qkn(s,r,n,t));Qkn(o,r,n,t)}});function Qkn(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(bWt(o))}}a(Qkn,"handleRefineResult");var _Re={};ki(_Re,{ar:()=>bYt,az:()=>SYt,be:()=>TYt,ca:()=>IYt,cs:()=>xYt,de:()=>wYt,en:()=>ERe,eo:()=>RYt,es:()=>kYt,fa:()=>PYt,fi:()=>DYt,fr:()=>NYt,frCA:()=>MYt,he:()=>OYt,hu:()=>LYt,id:()=>BYt,it:()=>FYt,ja:()=>UYt,kh:()=>QYt,ko:()=>qYt,mk:()=>jYt,ms:()=>HYt,nl:()=>GYt,no:()=>$Yt,ota:()=>VYt,pl:()=>zYt,ps:()=>WYt,pt:()=>YYt,ru:()=>KYt,sl:()=>JYt,sv:()=>ZYt,ta:()=>XYt,th:()=>eKt,tr:()=>tKt,ua:()=>rKt,ur:()=>nKt,vi:()=>iKt,zhCN:()=>oKt,zhTW:()=>sKt});p();p();var uis=a(()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return o=>{switch(o.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${Qr(o.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()} ${c.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${o.prefix}"`:s.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${s.suffix}"`:s.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${s.includes}"`:s.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${s.pattern}`:`${n[s.format]??o.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${o.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${o.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${o.keys.length>1?"\u0629":""}: ${jt(o.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"error");function bYt(){return{localeError:uis()}}a(bYt,"default");p();var dis=a(()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o.expected}, daxil olan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${Qr(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()} ${c.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${s.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:s.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${s.suffix}" il\u0259 bitm\u0259lidir`:s.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${s.includes}" daxil olmal\u0131d\u0131r`:s.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${s.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[s.format]??o.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${o.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${o.keys.length>1?"lar":""}: ${jt(o.keys,", ")}`;case"invalid_key":return`${o.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${o.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"error");function SYt(){return{localeError:dis()}}a(SYt,"default");p();function Gkn(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}a(Gkn,"getBelarusianPlural");var fis=a(()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0456\u045E";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${Qr(o.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=Gkn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=Gkn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${o.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${jt(o.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${o.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"error");function TYt(){return{localeError:fis()}}a(TYt,"default");p();var pis=a(()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${o.expected}, s'ha rebut ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Valor inv\xE0lid: s'esperava ${Qr(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${jt(o.values," o ")}`;case"too_big":{let s=o.inclusive?"com a m\xE0xim":"menys de",c=e(o.origin);return c?`Massa gran: s'esperava que ${o.origin??"el valor"} contingu\xE9s ${s} ${o.maximum.toString()} ${c.unit??"elements"}`:`Massa gran: s'esperava que ${o.origin??"el valor"} fos ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"com a m\xEDnim":"m\xE9s de",c=e(o.origin);return c?`Massa petit: s'esperava que ${o.origin} contingu\xE9s ${s} ${o.minimum.toString()} ${c.unit}`:`Massa petit: s'esperava que ${o.origin} fos ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${s.prefix}"`:s.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format inv\xE0lid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${s.pattern}`:`Format inv\xE0lid per a ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${o.divisor}`;case"unrecognized_keys":return`Clau${o.keys.length>1?"s":""} no reconeguda${o.keys.length>1?"s":""}: ${jt(o.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${o.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${o.origin}`;default:return"Entrada inv\xE0lida"}}},"error");function IYt(){return{localeError:pis()}}a(IYt,"default");p();var his=a(()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(o))return"pole";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return o=>{switch(o.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o.expected}, obdr\u017Eeno ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${Qr(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.maximum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.minimum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${s.prefix}"`:s.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${s.suffix}"`:s.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${s.includes}"`:s.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${s.pattern}`:`Neplatn\xFD form\xE1t ${n[s.format]??o.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${o.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${jt(o.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${o.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${o.origin}`;default:return"Neplatn\xFD vstup"}}},"error");function xYt(){return{localeError:his()}}a(xYt,"default");p();var mis=a(()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"Zahl";case"object":{if(Array.isArray(o))return"Array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return o=>{switch(o.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${o.expected}, erhalten ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ung\xFCltige Eingabe: erwartet ${Qr(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ${c.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ist`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ${c.unit} hat`:`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ist`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ung\xFCltiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ung\xFCltiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ung\xFCltiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${s.pattern} entsprechen`:`Ung\xFCltig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${o.divisor} sein`;case"unrecognized_keys":return`${o.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${jt(o.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${o.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${o.origin}`;default:return"Ung\xFCltige Eingabe"}}},"error");function wYt(){return{localeError:mis()}}a(wYt,"default");p();var gis=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"parsedType"),Ais=a(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(n){return t[n]??null}a(e,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${gis(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${Qr(n.values[0])}`:`Invalid option: expected one of ${jt(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${jt(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}},"error");function ERe(){return{localeError:Ais()}}a(ERe,"default");p();var yis=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"nombro";case"object":{if(Array.isArray(t))return"tabelo";if(t===null)return"senvalora";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"parsedType"),Eis=a(()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[n]??null}a(e,"getSizing");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return n=>{switch(n.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${n.expected}, ricevi\u011Dis ${yis(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${Qr(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${jt(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${jt(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}},"error");function RYt(){return{localeError:Eis()}}a(RYt,"default");p();var _is=a(()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"arreglo";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype)return o.constructor.name}}return s},"parsedType"),n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${o.expected}, recibido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: se esperaba ${Qr(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Demasiado grande: se esperaba que ${o.origin??"valor"} tuviera ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: se esperaba que ${o.origin??"valor"} fuera ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Demasiado peque\xF1o: se esperaba que ${o.origin} tuviera ${s}${o.minimum.toString()} ${c.unit}`:`Demasiado peque\xF1o: se esperaba que ${o.origin} fuera ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Llave${o.keys.length>1?"s":""} desconocida${o.keys.length>1?"s":""}: ${jt(o.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function kYt(){return{localeError:_is()}}a(kYt,"default");p();var vis=a(()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0622\u0631\u0627\u06CC\u0647";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return o=>{switch(o.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${r(o.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return o.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${Qr(o.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${jt(o.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:s.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:s.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${s.includes}" \u0628\u0627\u0634\u062F`:s.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${s.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[s.format]??o.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${o.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${o.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${jt(o.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${o.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${o.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"error");function PYt(){return{localeError:vis()}}a(PYt,"default");p();var Cis=a(()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return o=>{switch(o.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${o.expected}, oli ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${Qr(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Liian suuri: ${c.subject} t\xE4ytyy olla ${s}${o.maximum.toString()} ${c.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Liian pieni: ${c.subject} t\xE4ytyy olla ${s}${o.minimum.toString()} ${c.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${s.includes}"`:s.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${s.pattern}`:`Virheellinen ${n[s.format]??o.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${o.divisor} monikerta`;case"unrecognized_keys":return`${o.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${jt(o.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"error");function DYt(){return{localeError:Cis()}}a(DYt,"default");p();var bis=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombre";case"object":{if(Array.isArray(o))return"tableau";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : ${o.expected} attendu, ${r(o.input)} re\xE7u`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : ${Qr(o.values[0])} attendu`:`Option invalide : une valeur parmi ${jt(o.values,"|")} attendue`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Trop grand : ${o.origin??"valeur"} doit ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o.origin??"valeur"} doit \xEAtre ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Trop petit : ${o.origin} doit ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : ${o.origin} doit \xEAtre ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${jt(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"error");function NYt(){return{localeError:bis()}}a(NYt,"default");p();var Sis=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${o.expected}, re\xE7u ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : attendu ${Qr(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u2264":"<",c=e(o.origin);return c?`Trop grand : attendu que ${o.origin??"la valeur"} ait ${s}${o.maximum.toString()} ${c.unit}`:`Trop grand : attendu que ${o.origin??"la valeur"} soit ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u2265":">",c=e(o.origin);return c?`Trop petit : attendu que ${o.origin} ait ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : attendu que ${o.origin} soit ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${jt(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"error");function MYt(){return{localeError:Sis()}}a(MYt,"default");p();var Tis=a(()=>{let t={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return o=>{switch(o.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${o.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${Qr(o.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()} ${c.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()} ${c.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${s.prefix}"`:s.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${s.suffix}"`:s.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${s.includes}"`:s.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${s.pattern}`:`${n[s.format]??o.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${o.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${o.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${o.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${jt(o.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function OYt(){return{localeError:Tis()}}a(OYt,"default");p();var Iis=a(()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(o))return"t\xF6mb";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return o=>{switch(o.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o.expected}, a kapott \xE9rt\xE9k ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${Qr(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`T\xFAl nagy: ${o.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${s}${o.maximum.toString()} ${c.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${o.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} m\xE9rete t\xFAl kicsi ${s}${o.minimum.toString()} ${c.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} t\xFAl kicsi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\xC9rv\xE9nytelen string: "${s.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:s.format==="ends_with"?`\xC9rv\xE9nytelen string: "${s.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:s.format==="includes"?`\xC9rv\xE9nytelen string: "${s.includes}" \xE9rt\xE9ket kell tartalmaznia`:s.format==="regex"?`\xC9rv\xE9nytelen string: ${s.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[s.format]??o.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${o.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${o.keys.length>1?"s":""}: ${jt(o.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${o.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${o.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"error");function LYt(){return{localeError:Iis()}}a(LYt,"default");p();var xis=a(()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak valid: diharapkan ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak valid: diharapkan ${Qr(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: diharapkan ${o.origin??"value"} memiliki ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: diharapkan ${o.origin??"value"} menjadi ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: diharapkan ${o.origin} memiliki ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: diharapkan ${o.origin} menjadi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${n[s.format]??o.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${o.keys.length>1?"s":""}: ${jt(o.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${o.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${o.origin}`;default:return"Input tidak valid"}}},"error");function BYt(){return{localeError:xis()}}a(BYt,"default");p();var wis=a(()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numero";case"object":{if(Array.isArray(o))return"vettore";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input non valido: atteso ${o.expected}, ricevuto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input non valido: atteso ${Qr(o.values[0])}`:`Opzione non valida: atteso uno tra ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Troppo grande: ${o.origin??"valore"} deve avere ${s}${o.maximum.toString()} ${c.unit??"elementi"}`:`Troppo grande: ${o.origin??"valore"} deve essere ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Troppo piccolo: ${o.origin} deve avere ${s}${o.minimum.toString()} ${c.unit}`:`Troppo piccolo: ${o.origin} deve essere ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${o.divisor}`;case"unrecognized_keys":return`Chiav${o.keys.length>1?"i":"e"} non riconosciut${o.keys.length>1?"e":"a"}: ${jt(o.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${o.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${o.origin}`;default:return"Input non valido"}}},"error");function FYt(){return{localeError:wis()}}a(FYt,"default");p();var Ris=a(()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(o))return"\u914D\u5217";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${o.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${r(o.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return o.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${Qr(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${jt(o.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let s=o.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",c=e(o.origin);return c?`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${c.unit??"\u8981\u7D20"}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let s=o.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",c=e(o.origin);return c?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${c.unit}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${s.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${o.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${o.keys.length>1?"\u7FA4":""}: ${jt(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"error");function UYt(){return{localeError:Ris()}}a(UYt,"default");p();var kis=a(()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(o))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(o===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return o=>{switch(o.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${Qr(o.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()} ${c.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()} ${c.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${s.prefix}"`:s.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${s.suffix}"`:s.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${s.includes}"`:s.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${s.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${o.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${jt(o.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"error");function QYt(){return{localeError:kis()}}a(QYt,"default");p();var Pis=a(()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return o=>{switch(o.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${r(o.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return o.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${Qr(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${jt(o.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let s=o.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",c=s==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()} ${s}${c}`}case"too_small":{let s=o.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",c=s==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()} ${s}${c}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:s.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${s.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[s.format]??o.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${o.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${jt(o.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${o.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${o.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"error");function qYt(){return{localeError:Pis()}}a(qYt,"default");p();var Dis=a(()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(o))return"\u043D\u0438\u0437\u0430";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return o=>{switch(o.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${Qr(o.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.minimum.toString()} ${c.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${jt(o.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${o.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${o.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"error");function jYt(){return{localeError:Dis()}}a(jYt,"default");p();var Nis=a(()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombor";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak sah: dijangka ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak sah: dijangka ${Qr(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: dijangka ${o.origin??"nilai"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: dijangka ${o.origin??"nilai"} adalah ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: dijangka ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: dijangka ${o.origin} adalah ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${n[s.format]??o.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${jt(o.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${o.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${o.origin}`;default:return"Input tidak sah"}}},"error");function HYt(){return{localeError:Nis()}}a(HYt,"default");p();var Mis=a(()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"getal";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return o=>{switch(o.code){case"invalid_type":return`Ongeldige invoer: verwacht ${o.expected}, ontving ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ongeldige invoer: verwacht ${Qr(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} ${c.unit??"elementen"} bevat`:`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} is`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} ${c.unit} bevat`:`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} is`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${o.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${o.keys.length>1?"s":""}: ${jt(o.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${o.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${o.origin}`;default:return"Ongeldige invoer"}}},"error");function GYt(){return{localeError:Mis()}}a(GYt,"default");p();var Ois=a(()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"tall";case"object":{if(Array.isArray(o))return"liste";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Ugyldig input: forventet ${o.expected}, fikk ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ugyldig verdi: forventet ${Qr(o.values[0])}`:`Ugyldig valg: forventet en av ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()} ${c.unit??"elementer"}`:`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()} ${c.unit}`:`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${n[s.format]??o.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${jt(o.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${o.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${o.origin}`;default:return"Ugyldig input"}}},"error");function $Yt(){return{localeError:Ois()}}a($Yt,"default");p();var Lis=a(()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numara";case"object":{if(Array.isArray(o))return"saf";if(o===null)return"gayb";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return o=>{switch(o.code){case"invalid_type":return`F\xE2sit giren: umulan ${o.expected}, al\u0131nan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`F\xE2sit giren: umulan ${Qr(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} ${c.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} ${c.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let s=o;return s.format==="starts_with"?`F\xE2sit metin: "${s.prefix}" ile ba\u015Flamal\u0131.`:s.format==="ends_with"?`F\xE2sit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`F\xE2sit metin: "${s.includes}" ihtiv\xE2 etmeli.`:s.format==="regex"?`F\xE2sit metin: ${s.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[s.format]??o.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${o.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${o.keys.length>1?"s":""}: ${jt(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${o.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"error");function VYt(){return{localeError:Lis()}}a(VYt,"default");p();var Bis=a(()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0627\u0631\u06D0";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return o=>{switch(o.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${r(o.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return o.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${Qr(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${jt(o.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0648\u064A`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0648\u064A`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:s.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:s.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${s.includes}" \u0648\u0644\u0631\u064A`:s.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${s.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[s.format]??o.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${o.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${o.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${jt(o.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${o.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${o.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"error");function WYt(){return{localeError:Bis()}}a(WYt,"default");p();var Fis=a(()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"liczba";case"object":{if(Array.isArray(o))return"tablica";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return o=>{switch(o.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o.expected}, otrzymano ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${Qr(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.maximum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.minimum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${s.prefix}"`:s.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${s.suffix}"`:s.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${s.includes}"`:s.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${s.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[s.format]??o.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${o.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${o.keys.length>1?"s":""}: ${jt(o.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${o.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${o.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"error");function zYt(){return{localeError:Fis()}}a(zYt,"default");p();var Uis=a(()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"array";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${o.expected}, recebido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: esperado ${Qr(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Muito grande: esperado que ${o.origin??"valor"} tivesse ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Muito grande: esperado que ${o.origin??"valor"} fosse ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Muito pequeno: esperado que ${o.origin} tivesse ${s}${o.minimum.toString()} ${c.unit}`:`Muito pequeno: esperado que ${o.origin} fosse ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`${n[s.format]??o.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Chave${o.keys.length>1?"s":""} desconhecida${o.keys.length>1?"s":""}: ${jt(o.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${o.origin}`;default:return"Campo inv\xE1lido"}}},"error");function YYt(){return{localeError:Uis()}}a(YYt,"default");p();function $kn(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}a($kn,"getRussianPlural");var Qis=a(()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${Qr(o.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=$kn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=$kn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${o.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0438":""}: ${jt(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${o.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"error");function KYt(){return{localeError:Qis()}}a(KYt,"default");p();var qis=a(()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(o))return"tabela";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return o=>{switch(o.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${o.expected}, prejeto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${Qr(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} imelo ${s}${o.maximum.toString()} ${c.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Premajhno: pri\u010Dakovano, da bo ${o.origin} imelo ${s}${o.minimum.toString()} ${c.unit}`:`Premajhno: pri\u010Dakovano, da bo ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${n[s.format]??o.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${o.divisor}`;case"unrecognized_keys":return`Neprepoznan${o.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${jt(o.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${o.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${o.origin}`;default:return"Neveljaven vnos"}}},"error");function JYt(){return{localeError:qis()}}a(JYt,"default");p();var jis=a(()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"antal";case"object":{if(Array.isArray(o))return"lista";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return o=>{switch(o.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${o.expected}, fick ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${Qr(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`F\xF6r stor(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()} ${c.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()} ${c.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${s.includes}"`:s.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${s.pattern}"`:`Ogiltig(t) ${n[s.format]??o.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${jt(o.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${o.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${o.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"error");function ZYt(){return{localeError:jis()}}a(ZYt,"default");p();var His=a(()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(o))return"\u0B85\u0BA3\u0BBF";if(o===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Qr(o.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${jt(o.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} ${c.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} ${c.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${s.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${o.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${o.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${jt(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"error");function XYt(){return{localeError:His()}}a(XYt,"default");p();var Gis=a(()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(o))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(o===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return o=>{switch(o.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${Qr(o.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()} ${c.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()} ${c.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${s.prefix}"`:s.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${s.suffix}"`:s.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${s.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:s.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${s.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${o.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${jt(o.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"error");function eKt(){return{localeError:Gis()}}a(eKt,"default");p();var $is=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"parsedType"),Vis=a(()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return t[n]??null}a(e,"getSizing");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return n=>{switch(n.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${n.expected}, al\u0131nan ${$is(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${Qr(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${jt(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${jt(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"error");function tKt(){return{localeError:Vis()}}a(tKt,"default");p();var Wis=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${Qr(o.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} \u0431\u0443\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0456":""}: ${jt(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${o.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"error");function rKt(){return{localeError:Wis()}}a(rKt,"default");p();var zis=a(()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(o))return"\u0622\u0631\u06D2";if(o===null)return"\u0646\u0644";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return o=>{switch(o.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${r(o.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return o.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${Qr(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${jt(o.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${s}${o.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u06D2 ${s}${o.minimum.toString()} ${c.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u0627 ${s}${o.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${s.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${o.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${o.keys.length>1?"\u0632":""}: ${jt(o.keys,"\u060C ")}`;case"invalid_key":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"error");function nKt(){return{localeError:zis()}}a(nKt,"default");p();var Yis=a(()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(o))return"m\u1EA3ng";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return o=>{switch(o.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${Qr(o.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${s.prefix}"`:s.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${s.suffix}"`:s.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${s.includes}"`:s.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${s.pattern}`:`${n[s.format]??o.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${o.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${jt(o.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"error");function iKt(){return{localeError:Yis()}}a(iKt,"default");p();var Kis=a(()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(o))return"\u6570\u7EC4";if(o===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${Qr(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()} ${c.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.prefix}" \u5F00\u5934`:s.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.suffix}" \u7ED3\u5C3E`:s.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${s.pattern}`:`\u65E0\u6548${n[s.format]??o.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${o.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${jt(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${o.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"error");function oKt(){return{localeError:Kis()}}a(oKt,"default");p();var Jis=a(()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o.expected}\uFF0C\u4F46\u6536\u5230 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${Qr(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${jt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()} ${c.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()} ${c.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.prefix}" \u958B\u982D`:s.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.suffix}" \u7D50\u5C3E`:s.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${s.pattern}`:`\u7121\u6548\u7684 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${o.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${o.keys.length>1?"\u5011":""}\uFF1A${jt(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"error");function sKt(){return{localeError:Jis()}}a(sKt,"default");p();var aKt=Symbol("ZodOutput"),cKt=Symbol("ZodInput"),Mde=class{static{a(this,"$ZodRegistry")}constructor(){this._map=new Map,this._idmap=new Map}add(e,...r){let n=r[0];if(this._map.set(e,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function Utt(){return new Mde}a(Utt,"registry");var s5=Utt();p();p();function lKt(t,e){return new t({type:"string",...Tr(e)})}a(lKt,"_string");function uKt(t,e){return new t({type:"string",coerce:!0,...Tr(e)})}a(uKt,"_coercedString");function Qtt(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Tr(e)})}a(Qtt,"_email");function vRe(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Tr(e)})}a(vRe,"_guid");function qtt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Tr(e)})}a(qtt,"_uuid");function jtt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Tr(e)})}a(jtt,"_uuidv4");function Htt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Tr(e)})}a(Htt,"_uuidv6");function Gtt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Tr(e)})}a(Gtt,"_uuidv7");function $tt(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Tr(e)})}a($tt,"_url");function Vtt(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Tr(e)})}a(Vtt,"_emoji");function Wtt(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Tr(e)})}a(Wtt,"_nanoid");function ztt(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Tr(e)})}a(ztt,"_cuid");function Ytt(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Tr(e)})}a(Ytt,"_cuid2");function Ktt(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Tr(e)})}a(Ktt,"_ulid");function Jtt(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Tr(e)})}a(Jtt,"_xid");function Ztt(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Tr(e)})}a(Ztt,"_ksuid");function Xtt(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Tr(e)})}a(Xtt,"_ipv4");function ert(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Tr(e)})}a(ert,"_ipv6");function trt(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Tr(e)})}a(trt,"_cidrv4");function rrt(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Tr(e)})}a(rrt,"_cidrv6");function nrt(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Tr(e)})}a(nrt,"_base64");function irt(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Tr(e)})}a(irt,"_base64url");function ort(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Tr(e)})}a(ort,"_e164");function srt(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Tr(e)})}a(srt,"_jwt");var dKt={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function fKt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Tr(e)})}a(fKt,"_isoDateTime");function pKt(t,e){return new t({type:"string",format:"date",check:"string_format",...Tr(e)})}a(pKt,"_isoDate");function hKt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Tr(e)})}a(hKt,"_isoTime");function mKt(t,e){return new t({type:"string",format:"duration",check:"string_format",...Tr(e)})}a(mKt,"_isoDuration");function gKt(t,e){return new t({type:"number",checks:[],...Tr(e)})}a(gKt,"_number");function AKt(t,e){return new t({type:"number",coerce:!0,checks:[],...Tr(e)})}a(AKt,"_coercedNumber");function yKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Tr(e)})}a(yKt,"_int");function EKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Tr(e)})}a(EKt,"_float32");function _Kt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Tr(e)})}a(_Kt,"_float64");function vKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Tr(e)})}a(vKt,"_int32");function CKt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Tr(e)})}a(CKt,"_uint32");function bKt(t,e){return new t({type:"boolean",...Tr(e)})}a(bKt,"_boolean");function SKt(t,e){return new t({type:"boolean",coerce:!0,...Tr(e)})}a(SKt,"_coercedBoolean");function TKt(t,e){return new t({type:"bigint",...Tr(e)})}a(TKt,"_bigint");function IKt(t,e){return new t({type:"bigint",coerce:!0,...Tr(e)})}a(IKt,"_coercedBigint");function xKt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Tr(e)})}a(xKt,"_int64");function wKt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Tr(e)})}a(wKt,"_uint64");function RKt(t,e){return new t({type:"symbol",...Tr(e)})}a(RKt,"_symbol");function kKt(t,e){return new t({type:"undefined",...Tr(e)})}a(kKt,"_undefined");function PKt(t,e){return new t({type:"null",...Tr(e)})}a(PKt,"_null");function DKt(t){return new t({type:"any"})}a(DKt,"_any");function Ode(t){return new t({type:"unknown"})}a(Ode,"_unknown");function NKt(t,e){return new t({type:"never",...Tr(e)})}a(NKt,"_never");function MKt(t,e){return new t({type:"void",...Tr(e)})}a(MKt,"_void");function OKt(t,e){return new t({type:"date",...Tr(e)})}a(OKt,"_date");function LKt(t,e){return new t({type:"date",coerce:!0,...Tr(e)})}a(LKt,"_coercedDate");function BKt(t,e){return new t({type:"nan",...Tr(e)})}a(BKt,"_nan");function _F(t,e){return new Dtt({check:"less_than",...Tr(e),value:t,inclusive:!1})}a(_F,"_lt");function yw(t,e){return new Dtt({check:"less_than",...Tr(e),value:t,inclusive:!0})}a(yw,"_lte");function vF(t,e){return new Ntt({check:"greater_than",...Tr(e),value:t,inclusive:!1})}a(vF,"_gt");function tb(t,e){return new Ntt({check:"greater_than",...Tr(e),value:t,inclusive:!0})}a(tb,"_gte");function FKt(t){return vF(0,t)}a(FKt,"_positive");function UKt(t){return _F(0,t)}a(UKt,"_negative");function QKt(t){return yw(0,t)}a(QKt,"_nonpositive");function qKt(t){return tb(0,t)}a(qKt,"_nonnegative");function BJ(t,e){return new tzt({check:"multiple_of",...Tr(e),value:t})}a(BJ,"_multipleOf");function Lde(t,e){return new izt({check:"max_size",...Tr(e),maximum:t})}a(Lde,"_maxSize");function FJ(t,e){return new ozt({check:"min_size",...Tr(e),minimum:t})}a(FJ,"_minSize");function CRe(t,e){return new szt({check:"size_equals",...Tr(e),size:t})}a(CRe,"_size");function Bde(t,e){return new azt({check:"max_length",...Tr(e),maximum:t})}a(Bde,"_maxLength");function tj(t,e){return new czt({check:"min_length",...Tr(e),minimum:t})}a(tj,"_minLength");function Fde(t,e){return new lzt({check:"length_equals",...Tr(e),length:t})}a(Fde,"_length");function bRe(t,e){return new uzt({check:"string_format",format:"regex",...Tr(e),pattern:t})}a(bRe,"_regex");function SRe(t){return new dzt({check:"string_format",format:"lowercase",...Tr(t)})}a(SRe,"_lowercase");function TRe(t){return new fzt({check:"string_format",format:"uppercase",...Tr(t)})}a(TRe,"_uppercase");function IRe(t,e){return new pzt({check:"string_format",format:"includes",...Tr(e),includes:t})}a(IRe,"_includes");function xRe(t,e){return new hzt({check:"string_format",format:"starts_with",...Tr(e),prefix:t})}a(xRe,"_startsWith");function wRe(t,e){return new mzt({check:"string_format",format:"ends_with",...Tr(e),suffix:t})}a(wRe,"_endsWith");function jKt(t,e,r){return new gzt({check:"property",property:t,schema:e,...Tr(r)})}a(jKt,"_property");function RRe(t,e){return new Azt({check:"mime_type",mime:t,...Tr(e)})}a(RRe,"_mime");function CF(t){return new yzt({check:"overwrite",tx:t})}a(CF,"_overwrite");function kRe(t){return CF(e=>e.normalize(t))}a(kRe,"_normalize");function PRe(){return CF(t=>t.trim())}a(PRe,"_trim");function DRe(){return CF(t=>t.toLowerCase())}a(DRe,"_toLowerCase");function NRe(){return CF(t=>t.toUpperCase())}a(NRe,"_toUpperCase");function MRe(t,e,r){return new t({type:"array",element:e,...Tr(r)})}a(MRe,"_array");function Zis(t,e,r){return new t({type:"union",options:e,...Tr(r)})}a(Zis,"_union");function Xis(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...Tr(n)})}a(Xis,"_discriminatedUnion");function eos(t,e,r){return new t({type:"intersection",left:e,right:r})}a(eos,"_intersection");function HKt(t,e,r,n){let o=r instanceof uo,s=o?n:r,c=o?r:null;return new t({type:"tuple",items:e,rest:c,...Tr(s)})}a(HKt,"_tuple");function tos(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...Tr(n)})}a(tos,"_record");function ros(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...Tr(n)})}a(ros,"_map");function nos(t,e,r){return new t({type:"set",valueType:e,...Tr(r)})}a(nos,"_set");function ios(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...Tr(r)})}a(ios,"_enum");function oos(t,e,r){return new t({type:"enum",entries:e,...Tr(r)})}a(oos,"_nativeEnum");function sos(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Tr(r)})}a(sos,"_literal");function GKt(t,e){return new t({type:"file",...Tr(e)})}a(GKt,"_file");function aos(t,e){return new t({type:"transform",transform:e})}a(aos,"_transform");function cos(t,e){return new t({type:"optional",innerType:e})}a(cos,"_optional");function los(t,e){return new t({type:"nullable",innerType:e})}a(los,"_nullable");function uos(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}a(uos,"_default");function dos(t,e,r){return new t({type:"nonoptional",innerType:e,...Tr(r)})}a(dos,"_nonoptional");function fos(t,e){return new t({type:"success",innerType:e})}a(fos,"_success");function pos(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}a(pos,"_catch");function hos(t,e,r){return new t({type:"pipe",in:e,out:r})}a(hos,"_pipe");function mos(t,e){return new t({type:"readonly",innerType:e})}a(mos,"_readonly");function gos(t,e,r){return new t({type:"template_literal",parts:e,...Tr(r)})}a(gos,"_templateLiteral");function Aos(t,e){return new t({type:"lazy",getter:e})}a(Aos,"_lazy");function yos(t,e){return new t({type:"promise",innerType:e})}a(yos,"_promise");function $Kt(t,e,r){let n=Tr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}a($Kt,"_custom");function VKt(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Tr(r)})}a(VKt,"_refine");function WKt(t,e){let r=Tr(e),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(A=>typeof A=="string"?A.toLowerCase():A),o=o.map(A=>typeof A=="string"?A.toLowerCase():A));let s=new Set(n),c=new Set(o),l=t.Pipe??yRe,u=t.Boolean??mRe,d=t.String??OJ,f=t.Transform??ARe,h=new f({type:"transform",transform:a((A,y)=>{let E=A;return r.case!=="sensitive"&&(E=E.toLowerCase()),s.has(E)?!0:c.has(E)?!1:(y.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...c],input:y.value,inst:h}),{})},"transform"),error:r.error}),m=new l({type:"pipe",in:new d({type:"string",error:r.error}),out:h,error:r.error});return new l({type:"pipe",in:m,out:new u({type:"boolean",error:r.error}),error:r.error})}a(WKt,"_stringbool");function zKt(t,e,r,n={}){let o=Tr(n),s={...Tr(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:l=>r.test(l),...o};return r instanceof RegExp&&(s.pattern=r),new t(s)}a(zKt,"_stringFormat");var art=class{static{a(this,"$ZodFunction")}constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=a(((...n)=>{let o=this._def.input?dRe(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw new Error("Invalid arguments schema: not an array or tuple schema.");let s=e(...o);return this._def.output?dRe(this._def.output,s,void 0,{callee:r}):s}),"impl");return r}implementAsync(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=a((async(...n)=>{let o=this._def.input?await fRe(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw new Error("Invalid arguments schema: not an array or tuple schema.");let s=await e(...o);return this._def.output?fRe(this._def.output,s,void 0,{callee:r}):s}),"impl");return r}input(...e){let r=this.constructor;return Array.isArray(e[0])?new r({type:"function",input:new LJ({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output}):new r({type:"function",input:e[0],output:this._def.output})}output(e){let r=this.constructor;return new r({type:"function",input:this._def.input,output:e})}};function YKt(t){return new art({type:"function",input:Array.isArray(t?.input)?HKt(LJ,t?.input):t?.input??MRe(gRe,Ode(Nde)),output:t?.output??Ode(Nde)})}a(YKt,"_function");p();var ORe=class{static{a(this,"JSONSchemaGenerator")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??s5,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,s={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},c=this.seen.get(e);if(c)return c.count++,r.schemaPath.includes(e)&&(c.cycle=r.path),c.schema;let l={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(e,l);let u=e._zod.toJSONSchema?.();if(u)l.schema=u;else{let h={...r,schemaPath:[...r.schemaPath,e],path:r.path},m=e._zod.parent;if(m)l.ref=m,this.process(m,h),this.seen.get(m).isParent=!0;else{let g=l.schema;switch(o.type){case"string":{let A=g;A.type="string";let{minimum:y,maximum:E,format:_,patterns:v,contentEncoding:b}=e._zod.bag;if(typeof y=="number"&&(A.minLength=y),typeof E=="number"&&(A.maxLength=E),_&&(A.format=s[_]??_,A.format===""&&delete A.format),b&&(A.contentEncoding=b),v&&v.size>0){let T=[...v];T.length===1?A.pattern=T[0].source:T.length>1&&(l.schema.allOf=[...T.map(w=>({...this.target==="draft-7"?{type:"string"}:{},pattern:w.source}))])}break}case"number":{let A=g,{minimum:y,maximum:E,format:_,multipleOf:v,exclusiveMaximum:b,exclusiveMinimum:T}=e._zod.bag;typeof _=="string"&&_.includes("int")?A.type="integer":A.type="number",typeof T=="number"&&(A.exclusiveMinimum=T),typeof y=="number"&&(A.minimum=y,typeof T=="number"&&(T>=y?delete A.minimum:delete A.exclusiveMinimum)),typeof b=="number"&&(A.exclusiveMaximum=b),typeof E=="number"&&(A.maximum=E,typeof b=="number"&&(b<=E?delete A.maximum:delete A.exclusiveMaximum)),typeof v=="number"&&(A.multipleOf=v);break}case"boolean":{let A=g;A.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{g.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{g.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let A=g,{minimum:y,maximum:E}=e._zod.bag;typeof y=="number"&&(A.minItems=y),typeof E=="number"&&(A.maxItems=E),A.type="array",A.items=this.process(o.element,{...h,path:[...h.path,"items"]});break}case"object":{let A=g;A.type="object",A.properties={};let y=o.shape;for(let v in y)A.properties[v]=this.process(y[v],{...h,path:[...h.path,"properties",v]});let E=new Set(Object.keys(y)),_=new Set([...E].filter(v=>{let b=o.shape[v]._zod;return this.io==="input"?b.optin===void 0:b.optout===void 0}));_.size>0&&(A.required=Array.from(_)),o.catchall?._zod.def.type==="never"?A.additionalProperties=!1:o.catchall?o.catchall&&(A.additionalProperties=this.process(o.catchall,{...h,path:[...h.path,"additionalProperties"]})):this.io==="output"&&(A.additionalProperties=!1);break}case"union":{let A=g;A.anyOf=o.options.map((y,E)=>this.process(y,{...h,path:[...h.path,"anyOf",E]}));break}case"intersection":{let A=g,y=this.process(o.left,{...h,path:[...h.path,"allOf",0]}),E=this.process(o.right,{...h,path:[...h.path,"allOf",1]}),_=a(b=>"allOf"in b&&Object.keys(b).length===1,"isSimpleIntersection"),v=[..._(y)?y.allOf:[y],..._(E)?E.allOf:[E]];A.allOf=v;break}case"tuple":{let A=g;A.type="array";let y=o.items.map((v,b)=>this.process(v,{...h,path:[...h.path,"prefixItems",b]}));if(this.target==="draft-2020-12"?A.prefixItems=y:A.items=y,o.rest){let v=this.process(o.rest,{...h,path:[...h.path,"items"]});this.target==="draft-2020-12"?A.items=v:A.additionalItems=v}o.rest&&(A.items=this.process(o.rest,{...h,path:[...h.path,"items"]}));let{minimum:E,maximum:_}=e._zod.bag;typeof E=="number"&&(A.minItems=E),typeof _=="number"&&(A.maxItems=_);break}case"record":{let A=g;A.type="object",A.propertyNames=this.process(o.keyType,{...h,path:[...h.path,"propertyNames"]}),A.additionalProperties=this.process(o.valueType,{...h,path:[...h.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let A=g,y=rRe(o.entries);y.every(E=>typeof E=="number")&&(A.type="number"),y.every(E=>typeof E=="string")&&(A.type="string"),A.enum=y;break}case"literal":{let A=g,y=[];for(let E of o.values)if(E===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof E=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");y.push(Number(E))}else y.push(E);if(y.length!==0)if(y.length===1){let E=y[0];A.type=E===null?"null":typeof E,A.const=E}else y.every(E=>typeof E=="number")&&(A.type="number"),y.every(E=>typeof E=="string")&&(A.type="string"),y.every(E=>typeof E=="boolean")&&(A.type="string"),y.every(E=>E===null)&&(A.type="null"),A.enum=y;break}case"file":{let A=g,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:E,maximum:_,mime:v}=e._zod.bag;E!==void 0&&(y.minLength=E),_!==void 0&&(y.maxLength=_),v?v.length===1?(y.contentMediaType=v[0],Object.assign(A,y)):A.anyOf=v.map(b=>({...y,contentMediaType:b})):Object.assign(A,y);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let A=this.process(o.innerType,h);g.anyOf=[A,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,h),l.ref=o.innerType;break}case"success":{let A=g;A.type="boolean";break}case"default":{this.process(o.innerType,h),l.ref=o.innerType,g.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,h),l.ref=o.innerType,this.io==="input"&&(g._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,h),l.ref=o.innerType;let A;try{A=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}g.default=A;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let A=g,y=e._zod.pattern;if(!y)throw new Error("Pattern not found in template literal");A.type="string",A.pattern=y.source;break}case"pipe":{let A=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(A,h),l.ref=A;break}case"readonly":{this.process(o.innerType,h),l.ref=o.innerType,g.readOnly=!0;break}case"promise":{this.process(o.innerType,h),l.ref=o.innerType;break}case"optional":{this.process(o.innerType,h),l.ref=o.innerType;break}case"lazy":{let A=e._zod.innerType;this.process(A,h),l.ref=A;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let d=this.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),this.io==="input"&&g0(e)&&(delete l.schema.examples,delete l.schema.default),this.io==="input"&&l.schema._prefault&&((n=l.schema).default??(n.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(e).schema}emit(e,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(e);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let s=a(f=>{let h=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let y=n.external.registry.get(f[0])?.id,E=n.external.uri??(v=>v);if(y)return{ref:E(y)};let _=f[1].defId??f[1].schema.id??`schema${this.counter++}`;return f[1].defId=_,{defId:_,ref:`${E("__shared")}#/${h}/${_}`}}if(f[1]===o)return{ref:"#"};let g=`#/${h}/`,A=f[1].schema.id??`__schema${this.counter++}`;return{defId:A,ref:g+A}},"makeURI"),c=a(f=>{if(f[1].schema.$ref)return;let h=f[1],{ref:m,defId:g}=s(f);h.def={...h.schema},g&&(h.defId=g);let A=h.schema;for(let y in A)delete A[y];A.$ref=m},"extractToDef");if(n.cycles==="throw")for(let f of this.seen.entries()){let h=f[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/ + path: iss.path ? [${qJ(v)}, ...iss.path] : [${qJ(v)}] + })));`),m.write(`newResult[${qJ(v)}] = ${b}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");let _=m.compile();return(v,b)=>_(h,v,b)},"generateFastpass"),o,s=Ude,c=!yRe.jitless,u=c&&uzt.value,d=e.catchall,f;t._zod.parse=(h,m)=>{f??(f=r.value);let g=h.value;if(!s(g))return h.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),h;let A=[];if(c&&u&&m?.async===!1&&m.jitless!==!0)o||(o=n(e.shape)),h=o(h,m);else{h.value={};let b=f.shape;for(let T of f.keys){let w=b[T],R=w._zod.run({value:g[T],issues:[]},m),x=w._zod.optin==="optional"&&w._zod.optout==="optional";R instanceof Promise?A.push(R.then(P=>x?c2n(P,h,T,g):art(P,h,T))):x?c2n(R,h,T,g):art(R,h,T)}}if(!d)return A.length?Promise.all(A).then(()=>h):h;let y=[],E=f.keySet,_=d._zod,v=_.def.type;for(let b of Object.keys(g)){if(E.has(b))continue;if(v==="never"){y.push(b);continue}let T=_.run({value:g[b],issues:[]},m);T instanceof Promise?A.push(T.then(w=>art(w,h,b))):art(T,h,b)}return y.length&&h.issues.push({code:"unrecognized_keys",keys:y,input:g,inst:t}),A.length?Promise.all(A).then(()=>h):h}});function l2n(t,e,r,n){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>fT(s,n,lm())))}),e}a(l2n,"handleUnionResults");var drt=dt("$ZodUnion",(t,e)=>{co.init(t,e),kc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),kc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),kc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),kc(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){let r=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>bRe(n.source)).join("|")})$`)}}),t._zod.parse=(r,n)=>{let o=!1,s=[];for(let c of e.options){let l=c._zod.run({value:r.value,issues:[]},n);if(l instanceof Promise)s.push(l),o=!0;else{if(l.issues.length===0)return l;s.push(l)}}return o?Promise.all(s).then(c=>l2n(c,r,t,n)):l2n(s,r,t,n)}}),zYt=dt("$ZodDiscriminatedUnion",(t,e)=>{drt.init(t,e);let r=t._zod.parse;kc(t._zod,"propValues",()=>{let o={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[l,u]of Object.entries(c)){o[l]||(o[l]=new Set);for(let d of u)o[l].add(d)}}return o});let n=CRe(()=>{let o=e.options,s=new Map;for(let c of o){let l=c._zod.propValues[e.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let u of l){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,c)}}return s});t._zod.parse=(o,s)=>{let c=o.value;if(!Ude(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),o;let l=n.value.get(c?.[e.discriminator]);return l?l._zod.run(o,s):e.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:c,path:[e.discriminator],inst:t}),o)}}),YYt=dt("$ZodIntersection",(t,e)=>{co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),c=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||c instanceof Promise?Promise.all([s,c]).then(([u,d])=>u2n(r,u,d)):u2n(r,s,c)}});function fYt(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Qde(t)&&Qde(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let c=fYt(t[s],e[s]);if(!c.valid)return{valid:!1,mergeErrorPath:[s,...c.mergeErrorPath]};o[s]=c.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n{co.init(t,e);let r=e.items,n=r.length-[...r].reverse().findIndex(o=>o._zod.optin!=="optional");t._zod.parse=(o,s)=>{let c=o.value;if(!Array.isArray(c))return o.issues.push({input:c,inst:t,expected:"tuple",code:"invalid_type"}),o;o.value=[];let l=[];if(!e.rest){let d=c.length>r.length,f=c.length=c.length&&u>=n)continue;let f=d._zod.run({value:c[u],issues:[]},s);f instanceof Promise?l.push(f.then(h=>crt(h,o,u))):crt(f,o,u)}if(e.rest){let d=c.slice(r.length);for(let f of d){u++;let h=e.rest._zod.run({value:f,issues:[]},s);h instanceof Promise?l.push(h.then(m=>crt(m,o,u))):crt(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});function crt(t,e,r){t.issues.length&&e.issues.push(...nb(r,t.issues)),e.value[r]=t.value}a(crt,"handleTupleResult");var KYt=dt("$ZodRecord",(t,e)=>{co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Qde(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[];if(e.keyType._zod.values){let c=e.keyType._zod.values;r.value={};for(let u of c)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let d=e.valueType._zod.run({value:o[u],issues:[]},n);d instanceof Promise?s.push(d.then(f=>{f.issues.length&&r.issues.push(...nb(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...nb(u,d.issues)),r.value[u]=d.value)}let l;for(let u in o)c.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:l})}else{r.value={};for(let c of Reflect.ownKeys(o)){if(c==="__proto__")continue;let l=e.keyType._zod.run({value:c,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:l.issues.map(d=>fT(d,n,lm())),input:c,path:[c],inst:t}),r.value[l.value]=l.value;continue}let u=e.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?s.push(u.then(d=>{d.issues.length&&r.issues.push(...nb(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...nb(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),JYt=dt("$ZodMap",(t,e)=>{co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:t}),r;let s=[];r.value=new Map;for(let[c,l]of o){let u=e.keyType._zod.run({value:c,issues:[]},n),d=e.valueType._zod.run({value:l,issues:[]},n);u instanceof Promise||d instanceof Promise?s.push(Promise.all([u,d]).then(([f,h])=>{d2n(f,h,r,c,o,t,n)})):d2n(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});function d2n(t,e,r,n,o,s,c){t.issues.length&&(SRe.has(typeof n)?r.issues.push(...nb(n,t.issues)):r.issues.push({origin:"map",code:"invalid_key",input:o,inst:s,issues:t.issues.map(l=>fT(l,c,lm()))})),e.issues.length&&(SRe.has(typeof n)?r.issues.push(...nb(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>fT(l,c,lm()))})),r.value.set(t.value,e.value)}a(d2n,"handleMapResult");var ZYt=dt("$ZodSet",(t,e)=>{co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:t,expected:"set",code:"invalid_type"}),r;let s=[];r.value=new Set;for(let c of o){let l=e.valueType._zod.run({value:c,issues:[]},n);l instanceof Promise?s.push(l.then(u=>f2n(u,r))):f2n(l,r)}return s.length?Promise.all(s).then(()=>r):r}});function f2n(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}a(f2n,"handleSetResult");var XYt=dt("$ZodEnum",(t,e)=>{co.init(t,e);let r=vRe(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>SRe.has(typeof n)).map(n=>typeof n=="string"?xF(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return t._zod.values.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),eKt=dt("$ZodLiteral",(t,e)=>{co.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?xF(r):r?r.toString():String(r)).join("|")})$`),t._zod.parse=(r,n)=>{let o=r.value;return t._zod.values.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),r}}),tKt=dt("$ZodFile",(t,e)=>{co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:t}),r}}),LRe=dt("$ZodTransform",(t,e)=>{co.init(t,e),t._zod.parse=(r,n)=>{let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new f5;return r.value=o,r}}),rKt=dt("$ZodOptional",(t,e)=>{co.init(t,e),t._zod.optin="optional",t._zod.optout="optional",kc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),kc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${bRe(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(r,n):r.value===void 0?r:e.innerType._zod.run(r,n)}),nKt=dt("$ZodNullable",(t,e)=>{co.init(t,e),kc(t._zod,"optin",()=>e.innerType._zod.optin),kc(t._zod,"optout",()=>e.innerType._zod.optout),kc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${bRe(r.source)}|null)$`):void 0}),kc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),iKt=dt("$ZodDefault",(t,e)=>{co.init(t,e),t._zod.optin="optional",kc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>p2n(s,e)):p2n(o,e)}});function p2n(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}a(p2n,"handleDefaultResult");var oKt=dt("$ZodPrefault",(t,e)=>{co.init(t,e),t._zod.optin="optional",kc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),sKt=dt("$ZodNonOptional",(t,e)=>{co.init(t,e),kc(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>h2n(s,t)):h2n(o,t)}});function h2n(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}a(h2n,"handleNonOptionalResult");var aKt=dt("$ZodSuccess",(t,e)=>{co.init(t,e),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.issues.length===0,r)):(r.value=o.issues.length===0,r)}}),cKt=dt("$ZodCatch",(t,e)=>{co.init(t,e),t._zod.optin="optional",kc(t._zod,"optout",()=>e.innerType._zod.optout),kc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(c=>fT(c,n,lm()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>fT(s,n,lm()))},input:r.value}),r.issues=[]),r)}}),lKt=dt("$ZodNaN",(t,e)=>{co.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),BRe=dt("$ZodPipe",(t,e)=>{co.init(t,e),kc(t._zod,"values",()=>e.in._zod.values),kc(t._zod,"optin",()=>e.in._zod.optin),kc(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(r,n)=>{let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>m2n(s,e,n)):m2n(o,e,n)}});function m2n(t,e,r){return jJ(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}a(m2n,"handlePipeResult");var uKt=dt("$ZodReadonly",(t,e)=>{co.init(t,e),kc(t._zod,"propValues",()=>e.innerType._zod.propValues),kc(t._zod,"values",()=>e.innerType._zod.values),kc(t._zod,"optin",()=>e.innerType._zod.optin),kc(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(g2n):g2n(o)}});function g2n(t){return t.value=Object.freeze(t.value),t}a(g2n,"handleReadonlyResult");var dKt=dt("$ZodTemplateLiteral",(t,e)=>{co.init(t,e);let r=[];for(let n of e.parts)if(n instanceof co){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let o=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!o)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let s=o.startsWith("^")?1:0,c=o.endsWith("$")?o.length-1:o.length;r.push(o.slice(s,c))}else if(n===null||dzt.has(typeof n))r.push(xF(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"template_literal",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:"template_literal",pattern:t._zod.pattern.source}),n)}),fKt=dt("$ZodPromise",(t,e)=>{co.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),pKt=dt("$ZodLazy",(t,e)=>{co.init(t,e),kc(t._zod,"innerType",()=>e.getter()),kc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),kc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),kc(t._zod,"optin",()=>t._zod.innerType._zod.optin),kc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),hKt=dt("$ZodCustom",(t,e)=>{kf.init(t,e),co.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>A2n(s,r,n,t));A2n(o,r,n,t)}});function A2n(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(mzt(o))}}a(A2n,"handleRefineResult");var URe={};Ri(URe,{ar:()=>mKt,az:()=>gKt,be:()=>AKt,ca:()=>yKt,cs:()=>EKt,de:()=>_Kt,en:()=>FRe,eo:()=>vKt,es:()=>CKt,fa:()=>bKt,fi:()=>SKt,fr:()=>TKt,frCA:()=>IKt,he:()=>xKt,hu:()=>wKt,id:()=>RKt,it:()=>kKt,ja:()=>PKt,kh:()=>DKt,ko:()=>NKt,mk:()=>MKt,ms:()=>OKt,nl:()=>LKt,no:()=>BKt,ota:()=>FKt,pl:()=>QKt,ps:()=>UKt,pt:()=>qKt,ru:()=>jKt,sl:()=>HKt,sv:()=>GKt,ta:()=>$Kt,th:()=>VKt,tr:()=>WKt,ua:()=>zKt,ur:()=>YKt,vi:()=>KKt,zhCN:()=>JKt,zhTW:()=>ZKt});p();p();var mss=a(()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return o=>{switch(o.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${Qr(o.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()} ${c.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${o.prefix}"`:s.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${s.suffix}"`:s.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${s.includes}"`:s.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${s.pattern}`:`${n[s.format]??o.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${o.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${o.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${o.keys.length>1?"\u0629":""}: ${qt(o.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"error");function mKt(){return{localeError:mss()}}a(mKt,"default");p();var gss=a(()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o.expected}, daxil olan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${Qr(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()} ${c.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${s.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:s.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${s.suffix}" il\u0259 bitm\u0259lidir`:s.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${s.includes}" daxil olmal\u0131d\u0131r`:s.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${s.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[s.format]??o.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${o.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${o.keys.length>1?"lar":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`${o.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${o.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"error");function gKt(){return{localeError:gss()}}a(gKt,"default");p();function v2n(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}a(v2n,"getBelarusianPlural");var Ass=a(()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0456\u045E";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${Qr(o.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=v2n(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=v2n(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${o.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${qt(o.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${o.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"error");function AKt(){return{localeError:Ass()}}a(AKt,"default");p();var yss=a(()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${o.expected}, s'ha rebut ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Valor inv\xE0lid: s'esperava ${Qr(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${qt(o.values," o ")}`;case"too_big":{let s=o.inclusive?"com a m\xE0xim":"menys de",c=e(o.origin);return c?`Massa gran: s'esperava que ${o.origin??"el valor"} contingu\xE9s ${s} ${o.maximum.toString()} ${c.unit??"elements"}`:`Massa gran: s'esperava que ${o.origin??"el valor"} fos ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"com a m\xEDnim":"m\xE9s de",c=e(o.origin);return c?`Massa petit: s'esperava que ${o.origin} contingu\xE9s ${s} ${o.minimum.toString()} ${c.unit}`:`Massa petit: s'esperava que ${o.origin} fos ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${s.prefix}"`:s.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format inv\xE0lid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${s.pattern}`:`Format inv\xE0lid per a ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${o.divisor}`;case"unrecognized_keys":return`Clau${o.keys.length>1?"s":""} no reconeguda${o.keys.length>1?"s":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${o.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${o.origin}`;default:return"Entrada inv\xE0lida"}}},"error");function yKt(){return{localeError:yss()}}a(yKt,"default");p();var Ess=a(()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(o))return"pole";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return o=>{switch(o.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o.expected}, obdr\u017Eeno ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${Qr(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.maximum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.minimum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${s.prefix}"`:s.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${s.suffix}"`:s.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${s.includes}"`:s.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${s.pattern}`:`Neplatn\xFD form\xE1t ${n[s.format]??o.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${o.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${qt(o.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${o.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${o.origin}`;default:return"Neplatn\xFD vstup"}}},"error");function EKt(){return{localeError:Ess()}}a(EKt,"default");p();var _ss=a(()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"Zahl";case"object":{if(Array.isArray(o))return"Array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return o=>{switch(o.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${o.expected}, erhalten ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ung\xFCltige Eingabe: erwartet ${Qr(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ${c.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ist`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ${c.unit} hat`:`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ist`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ung\xFCltiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ung\xFCltiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ung\xFCltiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${s.pattern} entsprechen`:`Ung\xFCltig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${o.divisor} sein`;case"unrecognized_keys":return`${o.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${qt(o.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${o.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${o.origin}`;default:return"Ung\xFCltige Eingabe"}}},"error");function _Kt(){return{localeError:_ss()}}a(_Kt,"default");p();var vss=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"parsedType"),Css=a(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(n){return t[n]??null}a(e,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${vss(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${Qr(n.values[0])}`:`Invalid option: expected one of ${qt(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${qt(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}},"error");function FRe(){return{localeError:Css()}}a(FRe,"default");p();var bss=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"nombro";case"object":{if(Array.isArray(t))return"tabelo";if(t===null)return"senvalora";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"parsedType"),Sss=a(()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[n]??null}a(e,"getSizing");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return n=>{switch(n.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${n.expected}, ricevi\u011Dis ${bss(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${Qr(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${qt(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${qt(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}},"error");function vKt(){return{localeError:Sss()}}a(vKt,"default");p();var Tss=a(()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"arreglo";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype)return o.constructor.name}}return s},"parsedType"),n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${o.expected}, recibido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: se esperaba ${Qr(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Demasiado grande: se esperaba que ${o.origin??"valor"} tuviera ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: se esperaba que ${o.origin??"valor"} fuera ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Demasiado peque\xF1o: se esperaba que ${o.origin} tuviera ${s}${o.minimum.toString()} ${c.unit}`:`Demasiado peque\xF1o: se esperaba que ${o.origin} fuera ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Llave${o.keys.length>1?"s":""} desconocida${o.keys.length>1?"s":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function CKt(){return{localeError:Tss()}}a(CKt,"default");p();var Iss=a(()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0622\u0631\u0627\u06CC\u0647";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return o=>{switch(o.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${r(o.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return o.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${Qr(o.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${qt(o.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:s.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:s.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${s.includes}" \u0628\u0627\u0634\u062F`:s.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${s.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[s.format]??o.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${o.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${o.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${qt(o.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${o.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${o.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"error");function bKt(){return{localeError:Iss()}}a(bKt,"default");p();var xss=a(()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return o=>{switch(o.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${o.expected}, oli ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${Qr(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Liian suuri: ${c.subject} t\xE4ytyy olla ${s}${o.maximum.toString()} ${c.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Liian pieni: ${c.subject} t\xE4ytyy olla ${s}${o.minimum.toString()} ${c.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${s.includes}"`:s.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${s.pattern}`:`Virheellinen ${n[s.format]??o.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${o.divisor} monikerta`;case"unrecognized_keys":return`${o.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${qt(o.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"error");function SKt(){return{localeError:xss()}}a(SKt,"default");p();var wss=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombre";case"object":{if(Array.isArray(o))return"tableau";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : ${o.expected} attendu, ${r(o.input)} re\xE7u`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : ${Qr(o.values[0])} attendu`:`Option invalide : une valeur parmi ${qt(o.values,"|")} attendue`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Trop grand : ${o.origin??"valeur"} doit ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o.origin??"valeur"} doit \xEAtre ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Trop petit : ${o.origin} doit ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : ${o.origin} doit \xEAtre ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${qt(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"error");function TKt(){return{localeError:wss()}}a(TKt,"default");p();var Rss=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${o.expected}, re\xE7u ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : attendu ${Qr(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u2264":"<",c=e(o.origin);return c?`Trop grand : attendu que ${o.origin??"la valeur"} ait ${s}${o.maximum.toString()} ${c.unit}`:`Trop grand : attendu que ${o.origin??"la valeur"} soit ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u2265":">",c=e(o.origin);return c?`Trop petit : attendu que ${o.origin} ait ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : attendu que ${o.origin} soit ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${qt(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"error");function IKt(){return{localeError:Rss()}}a(IKt,"default");p();var kss=a(()=>{let t={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return o=>{switch(o.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${o.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${Qr(o.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()} ${c.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()} ${c.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${s.prefix}"`:s.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${s.suffix}"`:s.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${s.includes}"`:s.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${s.pattern}`:`${n[s.format]??o.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${o.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${o.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${o.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${qt(o.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function xKt(){return{localeError:kss()}}a(xKt,"default");p();var Pss=a(()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(o))return"t\xF6mb";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return o=>{switch(o.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o.expected}, a kapott \xE9rt\xE9k ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${Qr(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`T\xFAl nagy: ${o.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${s}${o.maximum.toString()} ${c.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${o.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} m\xE9rete t\xFAl kicsi ${s}${o.minimum.toString()} ${c.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} t\xFAl kicsi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\xC9rv\xE9nytelen string: "${s.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:s.format==="ends_with"?`\xC9rv\xE9nytelen string: "${s.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:s.format==="includes"?`\xC9rv\xE9nytelen string: "${s.includes}" \xE9rt\xE9ket kell tartalmaznia`:s.format==="regex"?`\xC9rv\xE9nytelen string: ${s.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[s.format]??o.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${o.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${o.keys.length>1?"s":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${o.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${o.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"error");function wKt(){return{localeError:Pss()}}a(wKt,"default");p();var Dss=a(()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak valid: diharapkan ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak valid: diharapkan ${Qr(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: diharapkan ${o.origin??"value"} memiliki ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: diharapkan ${o.origin??"value"} menjadi ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: diharapkan ${o.origin} memiliki ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: diharapkan ${o.origin} menjadi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${n[s.format]??o.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${o.keys.length>1?"s":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${o.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${o.origin}`;default:return"Input tidak valid"}}},"error");function RKt(){return{localeError:Dss()}}a(RKt,"default");p();var Nss=a(()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numero";case"object":{if(Array.isArray(o))return"vettore";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input non valido: atteso ${o.expected}, ricevuto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input non valido: atteso ${Qr(o.values[0])}`:`Opzione non valida: atteso uno tra ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Troppo grande: ${o.origin??"valore"} deve avere ${s}${o.maximum.toString()} ${c.unit??"elementi"}`:`Troppo grande: ${o.origin??"valore"} deve essere ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Troppo piccolo: ${o.origin} deve avere ${s}${o.minimum.toString()} ${c.unit}`:`Troppo piccolo: ${o.origin} deve essere ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${o.divisor}`;case"unrecognized_keys":return`Chiav${o.keys.length>1?"i":"e"} non riconosciut${o.keys.length>1?"e":"a"}: ${qt(o.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${o.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${o.origin}`;default:return"Input non valido"}}},"error");function kKt(){return{localeError:Nss()}}a(kKt,"default");p();var Mss=a(()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(o))return"\u914D\u5217";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${o.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${r(o.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return o.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${Qr(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${qt(o.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let s=o.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",c=e(o.origin);return c?`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${c.unit??"\u8981\u7D20"}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let s=o.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",c=e(o.origin);return c?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${c.unit}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${s.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${o.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${o.keys.length>1?"\u7FA4":""}: ${qt(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"error");function PKt(){return{localeError:Mss()}}a(PKt,"default");p();var Oss=a(()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(o))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(o===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return o=>{switch(o.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${Qr(o.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()} ${c.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()} ${c.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${s.prefix}"`:s.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${s.suffix}"`:s.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${s.includes}"`:s.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${s.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${o.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${qt(o.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"error");function DKt(){return{localeError:Oss()}}a(DKt,"default");p();var Lss=a(()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return o=>{switch(o.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${r(o.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return o.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${Qr(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${qt(o.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let s=o.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",c=s==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()} ${s}${c}`}case"too_small":{let s=o.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",c=s==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()} ${s}${c}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:s.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${s.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[s.format]??o.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${o.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${qt(o.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${o.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${o.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"error");function NKt(){return{localeError:Lss()}}a(NKt,"default");p();var Bss=a(()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(o))return"\u043D\u0438\u0437\u0430";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return o=>{switch(o.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${Qr(o.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.minimum.toString()} ${c.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${qt(o.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${o.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${o.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"error");function MKt(){return{localeError:Bss()}}a(MKt,"default");p();var Fss=a(()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombor";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak sah: dijangka ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak sah: dijangka ${Qr(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: dijangka ${o.origin??"nilai"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: dijangka ${o.origin??"nilai"} adalah ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: dijangka ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: dijangka ${o.origin} adalah ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${n[s.format]??o.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${qt(o.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${o.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${o.origin}`;default:return"Input tidak sah"}}},"error");function OKt(){return{localeError:Fss()}}a(OKt,"default");p();var Uss=a(()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"getal";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return o=>{switch(o.code){case"invalid_type":return`Ongeldige invoer: verwacht ${o.expected}, ontving ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ongeldige invoer: verwacht ${Qr(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} ${c.unit??"elementen"} bevat`:`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} is`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} ${c.unit} bevat`:`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} is`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${o.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${o.keys.length>1?"s":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${o.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${o.origin}`;default:return"Ongeldige invoer"}}},"error");function LKt(){return{localeError:Uss()}}a(LKt,"default");p();var Qss=a(()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"tall";case"object":{if(Array.isArray(o))return"liste";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Ugyldig input: forventet ${o.expected}, fikk ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ugyldig verdi: forventet ${Qr(o.values[0])}`:`Ugyldig valg: forventet en av ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()} ${c.unit??"elementer"}`:`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()} ${c.unit}`:`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${n[s.format]??o.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${qt(o.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${o.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${o.origin}`;default:return"Ugyldig input"}}},"error");function BKt(){return{localeError:Qss()}}a(BKt,"default");p();var qss=a(()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numara";case"object":{if(Array.isArray(o))return"saf";if(o===null)return"gayb";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return o=>{switch(o.code){case"invalid_type":return`F\xE2sit giren: umulan ${o.expected}, al\u0131nan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`F\xE2sit giren: umulan ${Qr(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} ${c.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} ${c.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let s=o;return s.format==="starts_with"?`F\xE2sit metin: "${s.prefix}" ile ba\u015Flamal\u0131.`:s.format==="ends_with"?`F\xE2sit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`F\xE2sit metin: "${s.includes}" ihtiv\xE2 etmeli.`:s.format==="regex"?`F\xE2sit metin: ${s.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[s.format]??o.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${o.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${o.keys.length>1?"s":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${o.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"error");function FKt(){return{localeError:qss()}}a(FKt,"default");p();var jss=a(()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0627\u0631\u06D0";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return o=>{switch(o.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${r(o.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return o.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${Qr(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${qt(o.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0648\u064A`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0648\u064A`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:s.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:s.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${s.includes}" \u0648\u0644\u0631\u064A`:s.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${s.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[s.format]??o.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${o.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${o.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${qt(o.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${o.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${o.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"error");function UKt(){return{localeError:jss()}}a(UKt,"default");p();var Hss=a(()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"liczba";case"object":{if(Array.isArray(o))return"tablica";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return o=>{switch(o.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o.expected}, otrzymano ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${Qr(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.maximum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.minimum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${s.prefix}"`:s.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${s.suffix}"`:s.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${s.includes}"`:s.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${s.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[s.format]??o.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${o.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${o.keys.length>1?"s":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${o.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${o.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"error");function QKt(){return{localeError:Hss()}}a(QKt,"default");p();var Gss=a(()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"array";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${o.expected}, recebido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: esperado ${Qr(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Muito grande: esperado que ${o.origin??"valor"} tivesse ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Muito grande: esperado que ${o.origin??"valor"} fosse ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Muito pequeno: esperado que ${o.origin} tivesse ${s}${o.minimum.toString()} ${c.unit}`:`Muito pequeno: esperado que ${o.origin} fosse ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`${n[s.format]??o.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Chave${o.keys.length>1?"s":""} desconhecida${o.keys.length>1?"s":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${o.origin}`;default:return"Campo inv\xE1lido"}}},"error");function qKt(){return{localeError:Gss()}}a(qKt,"default");p();function C2n(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}a(C2n,"getRussianPlural");var $ss=a(()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${Qr(o.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=C2n(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=C2n(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${o.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0438":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${o.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"error");function jKt(){return{localeError:$ss()}}a(jKt,"default");p();var Vss=a(()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(o))return"tabela";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return o=>{switch(o.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${o.expected}, prejeto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${Qr(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} imelo ${s}${o.maximum.toString()} ${c.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Premajhno: pri\u010Dakovano, da bo ${o.origin} imelo ${s}${o.minimum.toString()} ${c.unit}`:`Premajhno: pri\u010Dakovano, da bo ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${n[s.format]??o.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${o.divisor}`;case"unrecognized_keys":return`Neprepoznan${o.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${qt(o.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${o.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${o.origin}`;default:return"Neveljaven vnos"}}},"error");function HKt(){return{localeError:Vss()}}a(HKt,"default");p();var Wss=a(()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"antal";case"object":{if(Array.isArray(o))return"lista";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return o=>{switch(o.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${o.expected}, fick ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${Qr(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`F\xF6r stor(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()} ${c.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()} ${c.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${s.includes}"`:s.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${s.pattern}"`:`Ogiltig(t) ${n[s.format]??o.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${qt(o.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${o.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${o.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"error");function GKt(){return{localeError:Wss()}}a(GKt,"default");p();var zss=a(()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(o))return"\u0B85\u0BA3\u0BBF";if(o===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Qr(o.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${qt(o.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} ${c.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} ${c.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${s.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${o.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${o.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"error");function $Kt(){return{localeError:zss()}}a($Kt,"default");p();var Yss=a(()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(o))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(o===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return o=>{switch(o.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${Qr(o.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()} ${c.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()} ${c.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${s.prefix}"`:s.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${s.suffix}"`:s.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${s.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:s.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${s.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${o.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${qt(o.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"error");function VKt(){return{localeError:Yss()}}a(VKt,"default");p();var Kss=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"parsedType"),Jss=a(()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return t[n]??null}a(e,"getSizing");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return n=>{switch(n.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${n.expected}, al\u0131nan ${Kss(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${Qr(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${qt(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${qt(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"error");function WKt(){return{localeError:Jss()}}a(WKt,"default");p();var Zss=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${Qr(o.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} \u0431\u0443\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0456":""}: ${qt(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${o.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"error");function zKt(){return{localeError:Zss()}}a(zKt,"default");p();var Xss=a(()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(o))return"\u0622\u0631\u06D2";if(o===null)return"\u0646\u0644";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return o=>{switch(o.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${r(o.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return o.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${Qr(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${qt(o.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${s}${o.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u06D2 ${s}${o.minimum.toString()} ${c.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u0627 ${s}${o.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${s.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${o.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${o.keys.length>1?"\u0632":""}: ${qt(o.keys,"\u060C ")}`;case"invalid_key":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"error");function YKt(){return{localeError:Xss()}}a(YKt,"default");p();var eas=a(()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(o))return"m\u1EA3ng";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return o=>{switch(o.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${Qr(o.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${s.prefix}"`:s.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${s.suffix}"`:s.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${s.includes}"`:s.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${s.pattern}`:`${n[s.format]??o.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${o.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${qt(o.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"error");function KKt(){return{localeError:eas()}}a(KKt,"default");p();var tas=a(()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(o))return"\u6570\u7EC4";if(o===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${Qr(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()} ${c.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.prefix}" \u5F00\u5934`:s.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.suffix}" \u7ED3\u5C3E`:s.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${s.pattern}`:`\u65E0\u6548${n[s.format]??o.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${o.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${qt(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${o.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"error");function JKt(){return{localeError:tas()}}a(JKt,"default");p();var ras=a(()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o.expected}\uFF0C\u4F46\u6536\u5230 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${Qr(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()} ${c.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()} ${c.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.prefix}" \u958B\u982D`:s.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.suffix}" \u7D50\u5C3E`:s.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${s.pattern}`:`\u7121\u6548\u7684 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${o.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${o.keys.length>1?"\u5011":""}\uFF1A${qt(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"error");function ZKt(){return{localeError:ras()}}a(ZKt,"default");p();var XKt=Symbol("ZodOutput"),eJt=Symbol("ZodInput"),$de=class{static{a(this,"$ZodRegistry")}constructor(){this._map=new Map,this._idmap=new Map}add(e,...r){let n=r[0];if(this._map.set(e,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function frt(){return new $de}a(frt,"registry");var p5=frt();p();p();function tJt(t,e){return new t({type:"string",...Tr(e)})}a(tJt,"_string");function rJt(t,e){return new t({type:"string",coerce:!0,...Tr(e)})}a(rJt,"_coercedString");function prt(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Tr(e)})}a(prt,"_email");function QRe(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Tr(e)})}a(QRe,"_guid");function hrt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Tr(e)})}a(hrt,"_uuid");function mrt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Tr(e)})}a(mrt,"_uuidv4");function grt(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Tr(e)})}a(grt,"_uuidv6");function Art(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Tr(e)})}a(Art,"_uuidv7");function yrt(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Tr(e)})}a(yrt,"_url");function Ert(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Tr(e)})}a(Ert,"_emoji");function _rt(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Tr(e)})}a(_rt,"_nanoid");function vrt(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Tr(e)})}a(vrt,"_cuid");function Crt(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Tr(e)})}a(Crt,"_cuid2");function brt(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Tr(e)})}a(brt,"_ulid");function Srt(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Tr(e)})}a(Srt,"_xid");function Trt(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Tr(e)})}a(Trt,"_ksuid");function Irt(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Tr(e)})}a(Irt,"_ipv4");function xrt(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Tr(e)})}a(xrt,"_ipv6");function wrt(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Tr(e)})}a(wrt,"_cidrv4");function Rrt(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Tr(e)})}a(Rrt,"_cidrv6");function krt(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Tr(e)})}a(krt,"_base64");function Prt(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Tr(e)})}a(Prt,"_base64url");function Drt(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Tr(e)})}a(Drt,"_e164");function Nrt(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Tr(e)})}a(Nrt,"_jwt");var nJt={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function iJt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Tr(e)})}a(iJt,"_isoDateTime");function oJt(t,e){return new t({type:"string",format:"date",check:"string_format",...Tr(e)})}a(oJt,"_isoDate");function sJt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Tr(e)})}a(sJt,"_isoTime");function aJt(t,e){return new t({type:"string",format:"duration",check:"string_format",...Tr(e)})}a(aJt,"_isoDuration");function cJt(t,e){return new t({type:"number",checks:[],...Tr(e)})}a(cJt,"_number");function lJt(t,e){return new t({type:"number",coerce:!0,checks:[],...Tr(e)})}a(lJt,"_coercedNumber");function uJt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Tr(e)})}a(uJt,"_int");function dJt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Tr(e)})}a(dJt,"_float32");function fJt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Tr(e)})}a(fJt,"_float64");function pJt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Tr(e)})}a(pJt,"_int32");function hJt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Tr(e)})}a(hJt,"_uint32");function mJt(t,e){return new t({type:"boolean",...Tr(e)})}a(mJt,"_boolean");function gJt(t,e){return new t({type:"boolean",coerce:!0,...Tr(e)})}a(gJt,"_coercedBoolean");function AJt(t,e){return new t({type:"bigint",...Tr(e)})}a(AJt,"_bigint");function yJt(t,e){return new t({type:"bigint",coerce:!0,...Tr(e)})}a(yJt,"_coercedBigint");function EJt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Tr(e)})}a(EJt,"_int64");function _Jt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Tr(e)})}a(_Jt,"_uint64");function vJt(t,e){return new t({type:"symbol",...Tr(e)})}a(vJt,"_symbol");function CJt(t,e){return new t({type:"undefined",...Tr(e)})}a(CJt,"_undefined");function bJt(t,e){return new t({type:"null",...Tr(e)})}a(bJt,"_null");function SJt(t){return new t({type:"any"})}a(SJt,"_any");function Vde(t){return new t({type:"unknown"})}a(Vde,"_unknown");function TJt(t,e){return new t({type:"never",...Tr(e)})}a(TJt,"_never");function IJt(t,e){return new t({type:"void",...Tr(e)})}a(IJt,"_void");function xJt(t,e){return new t({type:"date",...Tr(e)})}a(xJt,"_date");function wJt(t,e){return new t({type:"date",coerce:!0,...Tr(e)})}a(wJt,"_coercedDate");function RJt(t,e){return new t({type:"nan",...Tr(e)})}a(RJt,"_nan");function wF(t,e){return new ort({check:"less_than",...Tr(e),value:t,inclusive:!1})}a(wF,"_lt");function Iw(t,e){return new ort({check:"less_than",...Tr(e),value:t,inclusive:!0})}a(Iw,"_lte");function RF(t,e){return new srt({check:"greater_than",...Tr(e),value:t,inclusive:!1})}a(RF,"_gt");function ib(t,e){return new srt({check:"greater_than",...Tr(e),value:t,inclusive:!0})}a(ib,"_gte");function kJt(t){return RF(0,t)}a(kJt,"_positive");function PJt(t){return wF(0,t)}a(PJt,"_negative");function DJt(t){return Iw(0,t)}a(DJt,"_nonpositive");function NJt(t){return ib(0,t)}a(NJt,"_nonnegative");function WJ(t,e){return new Wzt({check:"multiple_of",...Tr(e),value:t})}a(WJ,"_multipleOf");function Wde(t,e){return new Kzt({check:"max_size",...Tr(e),maximum:t})}a(Wde,"_maxSize");function zJ(t,e){return new Jzt({check:"min_size",...Tr(e),minimum:t})}a(zJ,"_minSize");function qRe(t,e){return new Zzt({check:"size_equals",...Tr(e),size:t})}a(qRe,"_size");function zde(t,e){return new Xzt({check:"max_length",...Tr(e),maximum:t})}a(zde,"_maxLength");function hj(t,e){return new eYt({check:"min_length",...Tr(e),minimum:t})}a(hj,"_minLength");function Yde(t,e){return new tYt({check:"length_equals",...Tr(e),length:t})}a(Yde,"_length");function jRe(t,e){return new rYt({check:"string_format",format:"regex",...Tr(e),pattern:t})}a(jRe,"_regex");function HRe(t){return new nYt({check:"string_format",format:"lowercase",...Tr(t)})}a(HRe,"_lowercase");function GRe(t){return new iYt({check:"string_format",format:"uppercase",...Tr(t)})}a(GRe,"_uppercase");function $Re(t,e){return new oYt({check:"string_format",format:"includes",...Tr(e),includes:t})}a($Re,"_includes");function VRe(t,e){return new sYt({check:"string_format",format:"starts_with",...Tr(e),prefix:t})}a(VRe,"_startsWith");function WRe(t,e){return new aYt({check:"string_format",format:"ends_with",...Tr(e),suffix:t})}a(WRe,"_endsWith");function MJt(t,e,r){return new cYt({check:"property",property:t,schema:e,...Tr(r)})}a(MJt,"_property");function zRe(t,e){return new lYt({check:"mime_type",mime:t,...Tr(e)})}a(zRe,"_mime");function kF(t){return new uYt({check:"overwrite",tx:t})}a(kF,"_overwrite");function YRe(t){return kF(e=>e.normalize(t))}a(YRe,"_normalize");function KRe(){return kF(t=>t.trim())}a(KRe,"_trim");function JRe(){return kF(t=>t.toLowerCase())}a(JRe,"_toLowerCase");function ZRe(){return kF(t=>t.toUpperCase())}a(ZRe,"_toUpperCase");function XRe(t,e,r){return new t({type:"array",element:e,...Tr(r)})}a(XRe,"_array");function nas(t,e,r){return new t({type:"union",options:e,...Tr(r)})}a(nas,"_union");function ias(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...Tr(n)})}a(ias,"_discriminatedUnion");function oas(t,e,r){return new t({type:"intersection",left:e,right:r})}a(oas,"_intersection");function OJt(t,e,r,n){let o=r instanceof co,s=o?n:r,c=o?r:null;return new t({type:"tuple",items:e,rest:c,...Tr(s)})}a(OJt,"_tuple");function sas(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...Tr(n)})}a(sas,"_record");function aas(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...Tr(n)})}a(aas,"_map");function cas(t,e,r){return new t({type:"set",valueType:e,...Tr(r)})}a(cas,"_set");function las(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...Tr(r)})}a(las,"_enum");function uas(t,e,r){return new t({type:"enum",entries:e,...Tr(r)})}a(uas,"_nativeEnum");function das(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Tr(r)})}a(das,"_literal");function LJt(t,e){return new t({type:"file",...Tr(e)})}a(LJt,"_file");function fas(t,e){return new t({type:"transform",transform:e})}a(fas,"_transform");function pas(t,e){return new t({type:"optional",innerType:e})}a(pas,"_optional");function has(t,e){return new t({type:"nullable",innerType:e})}a(has,"_nullable");function mas(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}a(mas,"_default");function gas(t,e,r){return new t({type:"nonoptional",innerType:e,...Tr(r)})}a(gas,"_nonoptional");function Aas(t,e){return new t({type:"success",innerType:e})}a(Aas,"_success");function yas(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}a(yas,"_catch");function Eas(t,e,r){return new t({type:"pipe",in:e,out:r})}a(Eas,"_pipe");function _as(t,e){return new t({type:"readonly",innerType:e})}a(_as,"_readonly");function vas(t,e,r){return new t({type:"template_literal",parts:e,...Tr(r)})}a(vas,"_templateLiteral");function Cas(t,e){return new t({type:"lazy",getter:e})}a(Cas,"_lazy");function bas(t,e){return new t({type:"promise",innerType:e})}a(bas,"_promise");function BJt(t,e,r){let n=Tr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}a(BJt,"_custom");function FJt(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Tr(r)})}a(FJt,"_refine");function UJt(t,e){let r=Tr(e),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(A=>typeof A=="string"?A.toLowerCase():A),o=o.map(A=>typeof A=="string"?A.toLowerCase():A));let s=new Set(n),c=new Set(o),l=t.Pipe??BRe,u=t.Boolean??MRe,d=t.String??$J,f=t.Transform??LRe,h=new f({type:"transform",transform:a((A,y)=>{let E=A;return r.case!=="sensitive"&&(E=E.toLowerCase()),s.has(E)?!0:c.has(E)?!1:(y.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...c],input:y.value,inst:h}),{})},"transform"),error:r.error}),m=new l({type:"pipe",in:new d({type:"string",error:r.error}),out:h,error:r.error});return new l({type:"pipe",in:m,out:new u({type:"boolean",error:r.error}),error:r.error})}a(UJt,"_stringbool");function QJt(t,e,r,n={}){let o=Tr(n),s={...Tr(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:l=>r.test(l),...o};return r instanceof RegExp&&(s.pattern=r),new t(s)}a(QJt,"_stringFormat");var Mrt=class{static{a(this,"$ZodFunction")}constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=a(((...n)=>{let o=this._def.input?kRe(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw new Error("Invalid arguments schema: not an array or tuple schema.");let s=e(...o);return this._def.output?kRe(this._def.output,s,void 0,{callee:r}):s}),"impl");return r}implementAsync(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=a((async(...n)=>{let o=this._def.input?await PRe(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw new Error("Invalid arguments schema: not an array or tuple schema.");let s=await e(...o);return this._def.output?PRe(this._def.output,s,void 0,{callee:r}):s}),"impl");return r}input(...e){let r=this.constructor;return Array.isArray(e[0])?new r({type:"function",input:new VJ({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output}):new r({type:"function",input:e[0],output:this._def.output})}output(e){let r=this.constructor;return new r({type:"function",input:this._def.input,output:e})}};function qJt(t){return new Mrt({type:"function",input:Array.isArray(t?.input)?OJt(VJ,t?.input):t?.input??XRe(ORe,Vde(Gde)),output:t?.output??Vde(Gde)})}a(qJt,"_function");p();var eke=class{static{a(this,"JSONSchemaGenerator")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??p5,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,s={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},c=this.seen.get(e);if(c)return c.count++,r.schemaPath.includes(e)&&(c.cycle=r.path),c.schema;let l={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(e,l);let u=e._zod.toJSONSchema?.();if(u)l.schema=u;else{let h={...r,schemaPath:[...r.schemaPath,e],path:r.path},m=e._zod.parent;if(m)l.ref=m,this.process(m,h),this.seen.get(m).isParent=!0;else{let g=l.schema;switch(o.type){case"string":{let A=g;A.type="string";let{minimum:y,maximum:E,format:_,patterns:v,contentEncoding:b}=e._zod.bag;if(typeof y=="number"&&(A.minLength=y),typeof E=="number"&&(A.maxLength=E),_&&(A.format=s[_]??_,A.format===""&&delete A.format),b&&(A.contentEncoding=b),v&&v.size>0){let T=[...v];T.length===1?A.pattern=T[0].source:T.length>1&&(l.schema.allOf=[...T.map(w=>({...this.target==="draft-7"?{type:"string"}:{},pattern:w.source}))])}break}case"number":{let A=g,{minimum:y,maximum:E,format:_,multipleOf:v,exclusiveMaximum:b,exclusiveMinimum:T}=e._zod.bag;typeof _=="string"&&_.includes("int")?A.type="integer":A.type="number",typeof T=="number"&&(A.exclusiveMinimum=T),typeof y=="number"&&(A.minimum=y,typeof T=="number"&&(T>=y?delete A.minimum:delete A.exclusiveMinimum)),typeof b=="number"&&(A.exclusiveMaximum=b),typeof E=="number"&&(A.maximum=E,typeof b=="number"&&(b<=E?delete A.maximum:delete A.exclusiveMaximum)),typeof v=="number"&&(A.multipleOf=v);break}case"boolean":{let A=g;A.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{g.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{g.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let A=g,{minimum:y,maximum:E}=e._zod.bag;typeof y=="number"&&(A.minItems=y),typeof E=="number"&&(A.maxItems=E),A.type="array",A.items=this.process(o.element,{...h,path:[...h.path,"items"]});break}case"object":{let A=g;A.type="object",A.properties={};let y=o.shape;for(let v in y)A.properties[v]=this.process(y[v],{...h,path:[...h.path,"properties",v]});let E=new Set(Object.keys(y)),_=new Set([...E].filter(v=>{let b=o.shape[v]._zod;return this.io==="input"?b.optin===void 0:b.optout===void 0}));_.size>0&&(A.required=Array.from(_)),o.catchall?._zod.def.type==="never"?A.additionalProperties=!1:o.catchall?o.catchall&&(A.additionalProperties=this.process(o.catchall,{...h,path:[...h.path,"additionalProperties"]})):this.io==="output"&&(A.additionalProperties=!1);break}case"union":{let A=g;A.anyOf=o.options.map((y,E)=>this.process(y,{...h,path:[...h.path,"anyOf",E]}));break}case"intersection":{let A=g,y=this.process(o.left,{...h,path:[...h.path,"allOf",0]}),E=this.process(o.right,{...h,path:[...h.path,"allOf",1]}),_=a(b=>"allOf"in b&&Object.keys(b).length===1,"isSimpleIntersection"),v=[..._(y)?y.allOf:[y],..._(E)?E.allOf:[E]];A.allOf=v;break}case"tuple":{let A=g;A.type="array";let y=o.items.map((v,b)=>this.process(v,{...h,path:[...h.path,"prefixItems",b]}));if(this.target==="draft-2020-12"?A.prefixItems=y:A.items=y,o.rest){let v=this.process(o.rest,{...h,path:[...h.path,"items"]});this.target==="draft-2020-12"?A.items=v:A.additionalItems=v}o.rest&&(A.items=this.process(o.rest,{...h,path:[...h.path,"items"]}));let{minimum:E,maximum:_}=e._zod.bag;typeof E=="number"&&(A.minItems=E),typeof _=="number"&&(A.maxItems=_);break}case"record":{let A=g;A.type="object",A.propertyNames=this.process(o.keyType,{...h,path:[...h.path,"propertyNames"]}),A.additionalProperties=this.process(o.valueType,{...h,path:[...h.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let A=g,y=vRe(o.entries);y.every(E=>typeof E=="number")&&(A.type="number"),y.every(E=>typeof E=="string")&&(A.type="string"),A.enum=y;break}case"literal":{let A=g,y=[];for(let E of o.values)if(E===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof E=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");y.push(Number(E))}else y.push(E);if(y.length!==0)if(y.length===1){let E=y[0];A.type=E===null?"null":typeof E,A.const=E}else y.every(E=>typeof E=="number")&&(A.type="number"),y.every(E=>typeof E=="string")&&(A.type="string"),y.every(E=>typeof E=="boolean")&&(A.type="string"),y.every(E=>E===null)&&(A.type="null"),A.enum=y;break}case"file":{let A=g,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:E,maximum:_,mime:v}=e._zod.bag;E!==void 0&&(y.minLength=E),_!==void 0&&(y.maxLength=_),v?v.length===1?(y.contentMediaType=v[0],Object.assign(A,y)):A.anyOf=v.map(b=>({...y,contentMediaType:b})):Object.assign(A,y);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let A=this.process(o.innerType,h);g.anyOf=[A,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,h),l.ref=o.innerType;break}case"success":{let A=g;A.type="boolean";break}case"default":{this.process(o.innerType,h),l.ref=o.innerType,g.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,h),l.ref=o.innerType,this.io==="input"&&(g._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,h),l.ref=o.innerType;let A;try{A=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}g.default=A;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let A=g,y=e._zod.pattern;if(!y)throw new Error("Pattern not found in template literal");A.type="string",A.pattern=y.source;break}case"pipe":{let A=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(A,h),l.ref=A;break}case"readonly":{this.process(o.innerType,h),l.ref=o.innerType,g.readOnly=!0;break}case"promise":{this.process(o.innerType,h),l.ref=o.innerType;break}case"optional":{this.process(o.innerType,h),l.ref=o.innerType;break}case"lazy":{let A=e._zod.innerType;this.process(A,h),l.ref=A;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let d=this.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),this.io==="input"&&E0(e)&&(delete l.schema.examples,delete l.schema.default),this.io==="input"&&l.schema._prefault&&((n=l.schema).default??(n.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(e).schema}emit(e,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(e);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let s=a(f=>{let h=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let y=n.external.registry.get(f[0])?.id,E=n.external.uri??(v=>v);if(y)return{ref:E(y)};let _=f[1].defId??f[1].schema.id??`schema${this.counter++}`;return f[1].defId=_,{defId:_,ref:`${E("__shared")}#/${h}/${_}`}}if(f[1]===o)return{ref:"#"};let g=`#/${h}/`,A=f[1].schema.id??`__schema${this.counter++}`;return{defId:A,ref:g+A}},"makeURI"),c=a(f=>{if(f[1].schema.$ref)return;let h=f[1],{ref:m,defId:g}=s(f);h.def={...h.schema},g&&(h.defId=g);let A=h.schema;for(let y in A)delete A[y];A.$ref=m},"extractToDef");if(n.cycles==="throw")for(let f of this.seen.entries()){let h=f[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let f of this.seen.entries()){let h=f[1];if(e===f[0]){c(f);continue}if(n.external){let g=n.external.registry.get(f[0])?.id;if(e!==f[0]&&g){c(f);continue}}if(this.metadataRegistry.get(f[0])?.id){c(f);continue}if(h.cycle){c(f);continue}if(h.count>1&&n.reused==="ref"){c(f);continue}}let l=a((f,h)=>{let m=this.seen.get(f),g=m.def??m.schema,A={...g};if(m.ref===null)return;let y=m.ref;if(m.ref=null,y){l(y,h);let E=this.seen.get(y).schema;E.$ref&&h.target==="draft-7"?(g.allOf=g.allOf??[],g.allOf.push(E)):(Object.assign(g,E),Object.assign(g,A))}m.isParent||this.override({zodSchema:f,jsonSchema:g,path:m.path??[]})},"flattenRef");for(let f of[...this.seen.entries()].reverse())l(f[0],{target:this.target});let u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){let f=n.external.registry.get(e)?.id;if(!f)throw new Error("Schema is missing an `id` property");u.$id=n.external.uri(f)}Object.assign(u,o.def);let d=n.external?.defs??{};for(let f of this.seen.entries()){let h=f[1];h.def&&h.defId&&(d[h.defId]=h.def)}n.external||Object.keys(d).length>0&&(this.target==="draft-2020-12"?u.$defs=d:u.definitions=d);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}};function KKt(t,e){if(t instanceof Mde){let n=new ORe(e),o={};for(let l of t._idmap.entries()){let[u,d]=l;n.process(d)}let s={},c={registry:t,uri:e?.uri,defs:o};for(let l of t._idmap.entries()){let[u,d]=l;s[u]=n.emit(d,{...e,external:c})}if(Object.keys(o).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:o}}return{schemas:s}}let r=new ORe(e);return r.process(t),r.emit(t,e)}a(KKt,"toJSONSchema");function g0(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let o=t._zod.def;switch(o.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return g0(o.element,r);case"object":{for(let s in o.shape)if(g0(o.shape[s],r))return!0;return!1}case"union":{for(let s of o.options)if(g0(s,r))return!0;return!1}case"intersection":return g0(o.left,r)||g0(o.right,r);case"tuple":{for(let s of o.items)if(g0(s,r))return!0;return!!(o.rest&&g0(o.rest,r))}case"record":return g0(o.keyType,r)||g0(o.valueType,r);case"map":return g0(o.keyType,r)||g0(o.valueType,r);case"set":return g0(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return g0(o.innerType,r);case"lazy":return g0(o.getter(),r);case"default":return g0(o.innerType,r);case"prefault":return g0(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return g0(o.in,r)||g0(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}a(g0,"isTransforming");var Vkn={};p();p();p();var Ude={};ki(Ude,{ZodISODate:()=>lrt,ZodISODateTime:()=>crt,ZodISODuration:()=>drt,ZodISOTime:()=>urt,date:()=>ZKt,datetime:()=>JKt,duration:()=>eJt,time:()=>XKt});p();var crt=dt("ZodISODateTime",(t,e)=>{Dzt.init(t,e),Cu.init(t,e)});function JKt(t){return fKt(crt,t)}a(JKt,"datetime");var lrt=dt("ZodISODate",(t,e)=>{Nzt.init(t,e),Cu.init(t,e)});function ZKt(t){return pKt(lrt,t)}a(ZKt,"date");var urt=dt("ZodISOTime",(t,e)=>{Mzt.init(t,e),Cu.init(t,e)});function XKt(t){return hKt(urt,t)}a(XKt,"time");var drt=dt("ZodISODuration",(t,e)=>{Ozt.init(t,e),Cu.init(t,e)});function eJt(t){return mKt(drt,t)}a(eJt,"duration");p();p();var zkn=a((t,e)=>{cRe.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>uRe(t,r),"value")},flatten:{value:a(r=>lRe(t,r),"value")},addIssue:{value:a(r=>t.issues.push(r),"value")},addIssues:{value:a(r=>t.issues.push(...r),"value")},isEmpty:{get(){return t.issues.length===0}}})},"initializer"),_os=dt("ZodError",zkn),Qde=dt("ZodError",zkn,{Parent:Error});var tJt=xtt(Qde),rJt=wtt(Qde),nJt=Rtt(Qde),iJt=ktt(Qde);var ks=dt("ZodType",(t,e)=>(uo.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>iT(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.parse=(r,n)=>tJt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>nJt(t,r,n),t.parseAsync=async(r,n)=>rJt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>iJt(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(wPn(r,n)),t.superRefine=r=>t.check(RPn(r)),t.overwrite=r=>t.check(CF(r)),t.optional=()=>bu(t),t.nullable=()=>prt(t),t.nullish=()=>bu(prt(t)),t.nonoptional=r=>gPn(t,r),t.array=()=>Fr(t),t.or=r=>Il([t,r]),t.and=r=>qRe(t,r),t.transform=r=>hrt(t,kJt(r)),t.default=r=>pPn(t,r),t.prefault=r=>mPn(t,r),t.catch=r=>EPn(t,r),t.pipe=r=>hrt(t,r),t.readonly=()=>CPn(t),t.describe=r=>{let n=t.clone();return s5.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return s5.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return s5.get(t);let n=t.clone();return s5.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),sJt=dt("_ZodString",(t,e)=>{OJ.init(t,e),ks.init(t,e);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check(bRe(...n)),t.includes=(...n)=>t.check(IRe(...n)),t.startsWith=(...n)=>t.check(xRe(...n)),t.endsWith=(...n)=>t.check(wRe(...n)),t.min=(...n)=>t.check(tj(...n)),t.max=(...n)=>t.check(Bde(...n)),t.length=(...n)=>t.check(Fde(...n)),t.nonempty=(...n)=>t.check(tj(1,...n)),t.lowercase=n=>t.check(SRe(n)),t.uppercase=n=>t.check(TRe(n)),t.trim=()=>t.check(PRe()),t.normalize=(...n)=>t.check(kRe(...n)),t.toLowerCase=()=>t.check(DRe()),t.toUpperCase=()=>t.check(NRe())}),BRe=dt("ZodString",(t,e)=>{OJ.init(t,e),sJt.init(t,e),t.email=r=>t.check(Qtt(aJt,r)),t.url=r=>t.check($tt(cJt,r)),t.jwt=r=>t.check(srt(SJt,r)),t.emoji=r=>t.check(Vtt(uJt,r)),t.guid=r=>t.check(vRe(frt,r)),t.uuid=r=>t.check(qtt(SF,r)),t.uuidv4=r=>t.check(jtt(SF,r)),t.uuidv6=r=>t.check(Htt(SF,r)),t.uuidv7=r=>t.check(Gtt(SF,r)),t.nanoid=r=>t.check(Wtt(dJt,r)),t.guid=r=>t.check(vRe(frt,r)),t.cuid=r=>t.check(ztt(fJt,r)),t.cuid2=r=>t.check(Ytt(pJt,r)),t.ulid=r=>t.check(Ktt(hJt,r)),t.base64=r=>t.check(nrt(vJt,r)),t.base64url=r=>t.check(irt(CJt,r)),t.xid=r=>t.check(Jtt(mJt,r)),t.ksuid=r=>t.check(Ztt(gJt,r)),t.ipv4=r=>t.check(Xtt(AJt,r)),t.ipv6=r=>t.check(ert(yJt,r)),t.cidrv4=r=>t.check(trt(EJt,r)),t.cidrv6=r=>t.check(rrt(_Jt,r)),t.e164=r=>t.check(ort(bJt,r)),t.datetime=r=>t.check(JKt(r)),t.date=r=>t.check(ZKt(r)),t.time=r=>t.check(XKt(r)),t.duration=r=>t.check(eJt(r))});function Je(t){return lKt(BRe,t)}a(Je,"string");var Cu=dt("ZodStringFormat",(t,e)=>{Vl.init(t,e),sJt.init(t,e)}),aJt=dt("ZodEmail",(t,e)=>{bzt.init(t,e),Cu.init(t,e)});function Cos(t){return Qtt(aJt,t)}a(Cos,"email");var frt=dt("ZodGUID",(t,e)=>{vzt.init(t,e),Cu.init(t,e)});function bos(t){return vRe(frt,t)}a(bos,"guid");var SF=dt("ZodUUID",(t,e)=>{Czt.init(t,e),Cu.init(t,e)});function Sos(t){return qtt(SF,t)}a(Sos,"uuid");function Tos(t){return jtt(SF,t)}a(Tos,"uuidv4");function Ios(t){return Htt(SF,t)}a(Ios,"uuidv6");function xos(t){return Gtt(SF,t)}a(xos,"uuidv7");var cJt=dt("ZodURL",(t,e)=>{Szt.init(t,e),Cu.init(t,e)});function lJt(t){return $tt(cJt,t)}a(lJt,"url");var uJt=dt("ZodEmoji",(t,e)=>{Tzt.init(t,e),Cu.init(t,e)});function wos(t){return Vtt(uJt,t)}a(wos,"emoji");var dJt=dt("ZodNanoID",(t,e)=>{Izt.init(t,e),Cu.init(t,e)});function Ros(t){return Wtt(dJt,t)}a(Ros,"nanoid");var fJt=dt("ZodCUID",(t,e)=>{xzt.init(t,e),Cu.init(t,e)});function kos(t){return ztt(fJt,t)}a(kos,"cuid");var pJt=dt("ZodCUID2",(t,e)=>{wzt.init(t,e),Cu.init(t,e)});function Pos(t){return Ytt(pJt,t)}a(Pos,"cuid2");var hJt=dt("ZodULID",(t,e)=>{Rzt.init(t,e),Cu.init(t,e)});function Dos(t){return Ktt(hJt,t)}a(Dos,"ulid");var mJt=dt("ZodXID",(t,e)=>{kzt.init(t,e),Cu.init(t,e)});function Nos(t){return Jtt(mJt,t)}a(Nos,"xid");var gJt=dt("ZodKSUID",(t,e)=>{Pzt.init(t,e),Cu.init(t,e)});function Mos(t){return Ztt(gJt,t)}a(Mos,"ksuid");var AJt=dt("ZodIPv4",(t,e)=>{Lzt.init(t,e),Cu.init(t,e)});function Oos(t){return Xtt(AJt,t)}a(Oos,"ipv4");var yJt=dt("ZodIPv6",(t,e)=>{Bzt.init(t,e),Cu.init(t,e)});function Los(t){return ert(yJt,t)}a(Los,"ipv6");var EJt=dt("ZodCIDRv4",(t,e)=>{Fzt.init(t,e),Cu.init(t,e)});function Bos(t){return trt(EJt,t)}a(Bos,"cidrv4");var _Jt=dt("ZodCIDRv6",(t,e)=>{Uzt.init(t,e),Cu.init(t,e)});function Fos(t){return rrt(_Jt,t)}a(Fos,"cidrv6");var vJt=dt("ZodBase64",(t,e)=>{qzt.init(t,e),Cu.init(t,e)});function Uos(t){return nrt(vJt,t)}a(Uos,"base64");var CJt=dt("ZodBase64URL",(t,e)=>{jzt.init(t,e),Cu.init(t,e)});function Qos(t){return irt(CJt,t)}a(Qos,"base64url");var bJt=dt("ZodE164",(t,e)=>{Hzt.init(t,e),Cu.init(t,e)});function qos(t){return ort(bJt,t)}a(qos,"e164");var SJt=dt("ZodJWT",(t,e)=>{Gzt.init(t,e),Cu.init(t,e)});function jos(t){return srt(SJt,t)}a(jos,"jwt");var Ykn=dt("ZodCustomStringFormat",(t,e)=>{$zt.init(t,e),Cu.init(t,e)});function Hos(t,e,r={}){return zKt(Ykn,t,e,r)}a(Hos,"stringFormat");var FRe=dt("ZodNumber",(t,e)=>{Ltt.init(t,e),ks.init(t,e),t.gt=(n,o)=>t.check(vF(n,o)),t.gte=(n,o)=>t.check(tb(n,o)),t.min=(n,o)=>t.check(tb(n,o)),t.lt=(n,o)=>t.check(_F(n,o)),t.lte=(n,o)=>t.check(yw(n,o)),t.max=(n,o)=>t.check(yw(n,o)),t.int=n=>t.check(oJt(n)),t.safe=n=>t.check(oJt(n)),t.positive=n=>t.check(vF(0,n)),t.nonnegative=n=>t.check(tb(0,n)),t.negative=n=>t.check(_F(0,n)),t.nonpositive=n=>t.check(yw(0,n)),t.multipleOf=(n,o)=>t.check(BJ(n,o)),t.step=(n,o)=>t.check(BJ(n,o)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function ka(t){return gKt(FRe,t)}a(ka,"number");var qde=dt("ZodNumberFormat",(t,e)=>{Vzt.init(t,e),FRe.init(t,e)});function oJt(t){return yKt(qde,t)}a(oJt,"int");function Gos(t){return EKt(qde,t)}a(Gos,"float32");function $os(t){return _Kt(qde,t)}a($os,"float64");function Vos(t){return vKt(qde,t)}a(Vos,"int32");function Wos(t){return CKt(qde,t)}a(Wos,"uint32");var URe=dt("ZodBoolean",(t,e)=>{mRe.init(t,e),ks.init(t,e)});function ol(t){return bKt(URe,t)}a(ol,"boolean");var QRe=dt("ZodBigInt",(t,e)=>{Btt.init(t,e),ks.init(t,e),t.gte=(n,o)=>t.check(tb(n,o)),t.min=(n,o)=>t.check(tb(n,o)),t.gt=(n,o)=>t.check(vF(n,o)),t.gte=(n,o)=>t.check(tb(n,o)),t.min=(n,o)=>t.check(tb(n,o)),t.lt=(n,o)=>t.check(_F(n,o)),t.lte=(n,o)=>t.check(yw(n,o)),t.max=(n,o)=>t.check(yw(n,o)),t.positive=n=>t.check(vF(BigInt(0),n)),t.negative=n=>t.check(_F(BigInt(0),n)),t.nonpositive=n=>t.check(yw(BigInt(0),n)),t.nonnegative=n=>t.check(tb(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(BJ(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function zos(t){return TKt(QRe,t)}a(zos,"bigint");var TJt=dt("ZodBigIntFormat",(t,e)=>{Wzt.init(t,e),QRe.init(t,e)});function Yos(t){return xKt(TJt,t)}a(Yos,"int64");function Kos(t){return wKt(TJt,t)}a(Kos,"uint64");var Kkn=dt("ZodSymbol",(t,e)=>{zzt.init(t,e),ks.init(t,e)});function Jos(t){return RKt(Kkn,t)}a(Jos,"symbol");var Jkn=dt("ZodUndefined",(t,e)=>{Yzt.init(t,e),ks.init(t,e)});function Zos(t){return kKt(Jkn,t)}a(Zos,"_undefined");var Zkn=dt("ZodNull",(t,e)=>{Kzt.init(t,e),ks.init(t,e)});function mrt(t){return PKt(Zkn,t)}a(mrt,"_null");var Xkn=dt("ZodAny",(t,e)=>{Jzt.init(t,e),ks.init(t,e)});function IJt(){return DKt(Xkn)}a(IJt,"any");var ePn=dt("ZodUnknown",(t,e)=>{Nde.init(t,e),ks.init(t,e)});function od(){return Ode(ePn)}a(od,"unknown");var tPn=dt("ZodNever",(t,e)=>{Zzt.init(t,e),ks.init(t,e)});function grt(t){return NKt(tPn,t)}a(grt,"never");var rPn=dt("ZodVoid",(t,e)=>{Xzt.init(t,e),ks.init(t,e)});function Xos(t){return MKt(rPn,t)}a(Xos,"_void");var Art=dt("ZodDate",(t,e)=>{eYt.init(t,e),ks.init(t,e),t.min=(n,o)=>t.check(tb(n,o)),t.max=(n,o)=>t.check(yw(n,o));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function ess(t){return OKt(Art,t)}a(ess,"date");var nPn=dt("ZodArray",(t,e)=>{gRe.init(t,e),ks.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(tj(r,n)),t.nonempty=r=>t.check(tj(1,r)),t.max=(r,n)=>t.check(Bde(r,n)),t.length=(r,n)=>t.check(Fde(r,n)),t.unwrap=()=>t.element});function Fr(t,e){return MRe(nPn,t,e)}a(Fr,"array");function tss(t){let e=t._zod.def.shape;return Gn(Object.keys(e))}a(tss,"keyof");var yrt=dt("ZodObject",(t,e)=>{tYt.init(t,e),ks.init(t,e),qr.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>rv(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:od()}),t.loose=()=>t.clone({...t._zod.def,catchall:od()}),t.strict=()=>t.clone({...t._zod.def,catchall:grt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>qr.extend(t,r),t.merge=r=>qr.merge(t,r),t.pick=r=>qr.pick(t,r),t.omit=r=>qr.omit(t,r),t.partial=(...r)=>qr.partial(PJt,t,r[0]),t.required=(...r)=>qr.required(DJt,t,r[0])});function zr(t,e){let r={type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},...qr.normalizeParams(e)};return new yrt(r)}a(zr,"object");function rss(t,e){return new yrt({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:grt(),...qr.normalizeParams(e)})}a(rss,"strictObject");function om(t,e){return new yrt({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:od(),...qr.normalizeParams(e)})}a(om,"looseObject");var xJt=dt("ZodUnion",(t,e)=>{Ftt.init(t,e),ks.init(t,e),t.options=e.options});function Il(t,e){return new xJt({type:"union",options:t,...qr.normalizeParams(e)})}a(Il,"union");var iPn=dt("ZodDiscriminatedUnion",(t,e)=>{xJt.init(t,e),rYt.init(t,e)});function Ert(t,e,r){return new iPn({type:"union",options:e,discriminator:t,...qr.normalizeParams(r)})}a(Ert,"discriminatedUnion");var oPn=dt("ZodIntersection",(t,e)=>{nYt.init(t,e),ks.init(t,e)});function qRe(t,e){return new oPn({type:"intersection",left:t,right:e})}a(qRe,"intersection");var sPn=dt("ZodTuple",(t,e)=>{LJ.init(t,e),ks.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});function nss(t,e,r){let n=e instanceof uo,o=n?r:e,s=n?e:null;return new sPn({type:"tuple",items:t,rest:s,...qr.normalizeParams(o)})}a(nss,"tuple");var wJt=dt("ZodRecord",(t,e)=>{iYt.init(t,e),ks.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function xl(t,e,r){return new wJt({type:"record",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(xl,"record");function iss(t,e,r){return new wJt({type:"record",keyType:Il([t,grt()]),valueType:e,...qr.normalizeParams(r)})}a(iss,"partialRecord");var aPn=dt("ZodMap",(t,e)=>{oYt.init(t,e),ks.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function oss(t,e,r){return new aPn({type:"map",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(oss,"map");var cPn=dt("ZodSet",(t,e)=>{sYt.init(t,e),ks.init(t,e),t.min=(...r)=>t.check(FJ(...r)),t.nonempty=r=>t.check(FJ(1,r)),t.max=(...r)=>t.check(Lde(...r)),t.size=(...r)=>t.check(CRe(...r))});function sss(t,e){return new cPn({type:"set",valueType:t,...qr.normalizeParams(e)})}a(sss,"set");var LRe=dt("ZodEnum",(t,e)=>{aYt.init(t,e),ks.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let c of n)if(r.has(c))s[c]=e.entries[c];else throw new Error(`Key ${c} not found in enum`);return new LRe({...e,checks:[],...qr.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let c of n)if(r.has(c))delete s[c];else throw new Error(`Key ${c} not found in enum`);return new LRe({...e,checks:[],...qr.normalizeParams(o),entries:s})}});function rv(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new LRe({type:"enum",entries:r,...qr.normalizeParams(e)})}a(rv,"_enum");function ass(t,e){return new LRe({type:"enum",entries:t,...qr.normalizeParams(e)})}a(ass,"nativeEnum");var lPn=dt("ZodLiteral",(t,e)=>{cYt.init(t,e),ks.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function Gn(t,e){return new lPn({type:"literal",values:Array.isArray(t)?t:[t],...qr.normalizeParams(e)})}a(Gn,"literal");var uPn=dt("ZodFile",(t,e)=>{lYt.init(t,e),ks.init(t,e),t.min=(r,n)=>t.check(FJ(r,n)),t.max=(r,n)=>t.check(Lde(r,n)),t.mime=(r,n)=>t.check(RRe(Array.isArray(r)?r:[r],n))});function css(t){return GKt(uPn,t)}a(css,"file");var RJt=dt("ZodTransform",(t,e)=>{ARe.init(t,e),ks.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(qr.issue(s,r.value,e));else{let c=s;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=r.value),c.inst??(c.inst=t),c.continue??(c.continue=!0),r.issues.push(qr.issue(c))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function kJt(t){return new RJt({type:"transform",transform:t})}a(kJt,"transform");var PJt=dt("ZodOptional",(t,e)=>{uYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function bu(t){return new PJt({type:"optional",innerType:t})}a(bu,"optional");var dPn=dt("ZodNullable",(t,e)=>{dYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function prt(t){return new dPn({type:"nullable",innerType:t})}a(prt,"nullable");function lss(t){return bu(prt(t))}a(lss,"nullish");var fPn=dt("ZodDefault",(t,e)=>{fYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function pPn(t,e){return new fPn({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(pPn,"_default");var hPn=dt("ZodPrefault",(t,e)=>{pYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function mPn(t,e){return new hPn({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(mPn,"prefault");var DJt=dt("ZodNonOptional",(t,e)=>{hYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function gPn(t,e){return new DJt({type:"nonoptional",innerType:t,...qr.normalizeParams(e)})}a(gPn,"nonoptional");var APn=dt("ZodSuccess",(t,e)=>{mYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function uss(t){return new APn({type:"success",innerType:t})}a(uss,"success");var yPn=dt("ZodCatch",(t,e)=>{gYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function EPn(t,e){return new yPn({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}a(EPn,"_catch");var _Pn=dt("ZodNaN",(t,e)=>{AYt.init(t,e),ks.init(t,e)});function dss(t){return BKt(_Pn,t)}a(dss,"nan");var NJt=dt("ZodPipe",(t,e)=>{yRe.init(t,e),ks.init(t,e),t.in=e.in,t.out=e.out});function hrt(t,e){return new NJt({type:"pipe",in:t,out:e})}a(hrt,"pipe");var vPn=dt("ZodReadonly",(t,e)=>{yYt.init(t,e),ks.init(t,e)});function CPn(t){return new vPn({type:"readonly",innerType:t})}a(CPn,"readonly");var bPn=dt("ZodTemplateLiteral",(t,e)=>{EYt.init(t,e),ks.init(t,e)});function fss(t,e){return new bPn({type:"template_literal",parts:t,...qr.normalizeParams(e)})}a(fss,"templateLiteral");var SPn=dt("ZodLazy",(t,e)=>{vYt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.getter()});function TPn(t){return new SPn({type:"lazy",getter:t})}a(TPn,"lazy");var IPn=dt("ZodPromise",(t,e)=>{_Yt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function pss(t){return new IPn({type:"promise",innerType:t})}a(pss,"promise");var _rt=dt("ZodCustom",(t,e)=>{CYt.init(t,e),ks.init(t,e)});function xPn(t){let e=new Tf({check:"custom"});return e._zod.check=t,e}a(xPn,"check");function MJt(t,e){return $Kt(_rt,t??(()=>!0),e)}a(MJt,"custom");function wPn(t,e={}){return VKt(_rt,t,e)}a(wPn,"refine");function RPn(t){let e=xPn(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(qr.issue(n,r.value,e._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),o.continue??(o.continue=!e._zod.def.abort),r.issues.push(qr.issue(o))}},t(r.value,r)));return e}a(RPn,"superRefine");function hss(t,e={error:`Input not instance of ${t.name}`}){let r=new _rt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...qr.normalizeParams(e)});return r._zod.bag.Class=t,r}a(hss,"_instanceof");var mss=a((...t)=>WKt({Pipe:NJt,Boolean:URe,String:BRe,Transform:RJt},...t),"stringbool");function gss(t){let e=TPn(()=>Il([Je(t),ka(),ol(),mrt(),Fr(e),xl(Je(),e)]));return e}a(gss,"json");function vrt(t,e){return hrt(kJt(t),e)}a(vrt,"preprocess");p();var OJt={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Ass(t){im({customError:t})}a(Ass,"setErrorMap");function yss(){return im().customError}a(yss,"getErrorMap");var jRe={};ki(jRe,{bigint:()=>Css,boolean:()=>vss,date:()=>bss,number:()=>_ss,string:()=>Ess});p();function Ess(t){return uKt(BRe,t)}a(Ess,"string");function _ss(t){return AKt(FRe,t)}a(_ss,"number");function vss(t){return SKt(URe,t)}a(vss,"boolean");function Css(t){return IKt(QRe,t)}a(Css,"bigint");function bss(t){return LKt(Art,t)}a(bss,"date");im(ERe());p();var ci={authenticate:"authenticate",document_did_change:"document/didChange",document_did_close:"document/didClose",document_did_focus:"document/didFocus",document_did_open:"document/didOpen",document_did_save:"document/didSave",initialize:"initialize",logout:"logout",mcp_message:"mcp/message",nes_accept:"nes/accept",nes_close:"nes/close",nes_reject:"nes/reject",nes_start:"nes/start",nes_suggest:"nes/suggest",providers_disable:"providers/disable",providers_list:"providers/list",providers_set:"providers/set",session_cancel:"session/cancel",session_close:"session/close",session_delete:"session/delete",session_fork:"session/fork",session_list:"session/list",session_load:"session/load",session_new:"session/new",session_prompt:"session/prompt",session_resume:"session/resume",session_set_config_option:"session/set_config_option",session_set_mode:"session/set_mode",session_set_model:"session/set_model"},If={elicitation_complete:"elicitation/complete",elicitation_create:"elicitation/create",fs_read_text_file:"fs/read_text_file",fs_write_text_file:"fs/write_text_file",mcp_connect:"mcp/connect",mcp_disconnect:"mcp/disconnect",mcp_message:"mcp/message",session_request_permission:"session/request_permission",session_update:"session/update",terminal_create:"terminal/create",terminal_kill:"terminal/kill",terminal_output:"terminal/output",terminal_release:"terminal/release",terminal_wait_for_exit:"terminal/wait_for_exit"},Crt=1;p();var Tss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminal:k.boolean().optional().default(!1)}),Iss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),label:k.string().nullish(),name:k.string(),optional:k.boolean().optional().default(!1),secret:k.boolean().optional().default(!0)}),xss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:k.string(),name:k.string()}),wss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:k.string(),link:k.string().nullish(),name:k.string(),vars:k.array(Iss)}),Rss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()).optional(),description:k.string().nullish(),env:k.record(k.string(),k.string()).optional(),id:k.string(),name:k.string()}),kss=k.union([wss.and(k.object({type:k.literal("env_var")})),Rss.and(k.object({type:k.literal("terminal")})),xss]),BJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),methodId:k.string()}),Pss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Dss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),blob:k.string(),mimeType:k.string().nullish(),uri:k.string()}),Nss=k.object({default:k.boolean().nullish(),description:k.string().nullish(),title:k.string().nullish()}),Mss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Oss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Lss=k.object({amount:k.number(),currency:k.string()}),Bss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),Fss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Uss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),newText:k.string(),oldText:k.string().nullish(),path:k.string()}),FJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string()}),Qss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),qss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),jss=k.union([k.string(),k.number(),k.number(),k.boolean(),k.array(k.string())]),Hss=k.object({content:k.record(k.string(),jss).nullish()}),Gss=k.intersection(k.union([Hss.and(k.object({action:k.literal("accept")})),k.object({action:k.literal("decline")}),k.object({action:k.literal("cancel")})]),k.object({_meta:k.record(k.string(),k.unknown()).nullish()})),$ss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),kPn=k.string(),UJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),elicitationId:kPn}),Vss=k.literal("object"),Wss=k.literal("string"),zss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Yss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),form:$ss.nullish(),url:zss.nullish()}),PPn=k.object({const:k.string(),title:k.string()}),DPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),Kss=k.union([k.literal(-32700),k.literal(-32600),k.literal(-32601),k.literal(-32602),k.literal(-32603),k.literal(-32800),k.literal(-32e3),k.literal(-32002),k.literal(-32042),k.number().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),NPn=k.object({code:Kss,data:k.unknown().optional(),message:k.string()}),MPn=k.unknown(),OPn=k.unknown(),LPn=k.unknown(),Jss=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),readTextFile:k.boolean().optional().default(!1),writeTextFile:k.boolean().optional().default(!1)}),BPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),FPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),title:k.string().nullish(),version:k.string()}),Zss=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),Xss=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),QJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),qJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cursor:k.string().nullish(),cwd:k.string().nullish()}),jJt=k.union([k.literal("anthropic"),k.literal("openai"),k.literal("azure"),k.literal("vertex"),k.literal("bedrock"),k.string()]),eas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),tas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),logout:eas.nullish()}),HJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),ras=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),nas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),acp:k.boolean().optional().default(!1),http:k.boolean().optional().default(!1),sse:k.boolean().optional().default(!1)}),brt=k.string(),ias=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:brt}),oas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:brt}),UPn=k.string(),sas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),acpId:UPn}),aas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:UPn,name:k.string()}),cas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(BPn),name:k.string(),url:k.string()}),las=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(BPn),name:k.string(),url:k.string()}),uas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()),command:k.string(),env:k.array(DPn),name:k.string()}),Srt=k.union([cas.and(k.object({type:k.literal("http")})),las.and(k.object({type:k.literal("sse")})),aas.and(k.object({type:k.literal("acp")})),uas]),QPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:brt,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),qPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:brt,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),jPn=k.unknown(),GJt=k.string(),das=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),modelId:GJt,name:k.string()}),fas=k.union([k.literal("error"),k.literal("warning"),k.literal("information"),k.literal("hint")]),pas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),has=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),mas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),gas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Aas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),yas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),maxCount:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Eas=k.object({diff:k.string(),uri:k.string()}),_as=k.object({endLine:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:k.string()}),vas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Cas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),bas=k.object({languageId:k.string(),text:k.string(),uri:k.string()}),Sas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),maxCount:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Tas=k.union([k.literal("rejected"),k.literal("ignored"),k.literal("replaced"),k.literal("cancelled")]),Ias=k.object({excerpts:k.array(_as),uri:k.string()}),xas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),was=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Ras=k.object({name:k.string(),owner:k.string(),remoteUrl:k.string()}),kas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Pas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),jump:vas.nullish(),rename:was.nullish(),searchAndReplace:kas.nullish()}),Das=k.object({id:k.string(),isRegex:k.boolean().nullish(),replace:k.string(),search:k.string(),uri:k.string()}),Nas=k.union([k.literal("automatic"),k.literal("diagnostic"),k.literal("manual")]),Mas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),maxCount:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Oas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:pas.nullish(),editHistory:yas.nullish(),openFiles:Cas.nullish(),recentFiles:Sas.nullish(),relatedSnippets:xas.nullish(),userActions:Mas.nullish()}),$Jt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Srt)}),Las=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),HPn=k.string(),Bas=k.union([k.literal("allow_once"),k.literal("allow_always"),k.literal("reject_once"),k.literal("reject_always")]),Fas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),kind:Bas,name:k.string(),optionId:HPn}),Uas=k.union([k.literal("high"),k.literal("medium"),k.literal("low")]),Qas=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed")]),qas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),priority:Uas,status:Qas}),jas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),entries:k.array(qas)}),rj=k.object({character:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),Has=k.object({id:k.string(),position:rj,uri:k.string()}),Gas=k.object({id:k.string(),newName:k.string(),position:rj,uri:k.string()}),$as=k.object({action:k.string(),position:rj,timestampMs:k.number(),uri:k.string()}),GPn=k.union([k.literal("utf-16"),k.literal("utf-32"),k.literal("utf-8")]),Vas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:Tss.optional().default({terminal:!1}),elicitation:Yss.nullish(),fs:Jss.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Pas.nullish(),positionEncodings:k.array(GPn).optional(),terminal:k.boolean().optional().default(!1)}),Was=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),audio:k.boolean().optional().default(!1),embeddedContext:k.boolean().optional().default(!1),image:k.boolean().optional().default(!1)}),$Pn=k.number().int().gte(0).lte(65535),VJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),clientCapabilities:Vas.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:FPn.nullish(),protocolVersion:$Pn}),zas=k.object({apiType:jJt,baseUrl:k.string()}),Yas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),current:zas.nullish(),id:k.string(),required:k.boolean(),supported:k.array(jJt)}),Kas=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),providers:k.array(Yas)}),Jas=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),jde=k.object({end:rj,start:rj}),Zas=k.object({message:k.string(),range:jde,severity:fas,uri:k.string()}),Xas=k.object({languageId:k.string(),lastFocusedMs:k.number().nullish(),uri:k.string(),visibleRange:jde.nullish()}),ecs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:k.array(Zas).nullish(),editHistory:k.array(Eas).nullish(),openFiles:k.array(Xas).nullish(),recentFiles:k.array(bas).nullish(),relatedSnippets:k.array(Ias).nullish(),userActions:k.array($as).nullish()}),tcs=k.object({newText:k.string(),range:jde}),rcs=k.object({cursorPosition:rj.nullish(),edits:k.array(tcs),id:k.string(),uri:k.string()}),ncs=k.union([rcs.and(k.object({kind:k.literal("edit")})),Has.and(k.object({kind:k.literal("jump")})),Gas.and(k.object({kind:k.literal("rename")})),Das.and(k.object({kind:k.literal("searchAndReplace")}))]),ics=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string()}),ocs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),nj=k.union([k.number(),k.string()]).nullable(),zYd=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),requestId:nj}),VPn=k.object({requestId:nj}),scs=k.enum(["assistant","user"]),HRe=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),audience:k.array(scs).nullish(),lastModified:k.string().nullish(),priority:k.number().nullish()}),acs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),data:k.string(),mimeType:k.string()}),ccs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),data:k.string(),mimeType:k.string(),uri:k.string().nullish()}),lcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),description:k.string().nullish(),mimeType:k.string().nullish(),name:k.string(),size:k.number().nullish(),title:k.string().nullish(),uri:k.string()}),ucs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),optionId:HPn}),dcs=k.union([k.object({outcome:k.literal("cancelled")}),ucs.and(k.object({outcome:k.literal("selected")}))]),fcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),outcome:dcs}),pcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),hcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),mcs=k.object({currentValue:k.boolean()}),gcs=k.string(),WPn=k.string(),Acs=k.union([k.literal("mode"),k.literal("model"),k.literal("thought_level"),k.string()]),WJt=k.string(),zPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),name:k.string(),value:WJt}),ycs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),group:gcs,name:k.string(),options:k.array(zPn)}),Ecs=k.union([k.array(zPn),k.array(ycs)]),_cs=k.object({currentValue:WJt,options:Ecs}),Hde=k.intersection(k.union([_cs.and(k.object({type:k.literal("select")})),mcs.and(k.object({type:k.literal("boolean")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),category:Acs.nullish(),description:k.string().nullish(),id:WPn,name:k.string()})),vcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde)}),Ccs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),bcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),sc=k.string(),zJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),sessionId:sc}),YJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),KJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),JJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),ZJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()).optional(),command:k.string(),cwd:k.string().nullish(),env:k.array(DPn).optional(),outputByteLimit:k.number().nullish(),sessionId:sc}),XJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),eZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,uri:k.string()}),tZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),position:rj,sessionId:sc,uri:k.string(),version:k.number(),visibleRange:jde}),rZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),languageId:k.string(),sessionId:sc,text:k.string(),uri:k.string(),version:k.number()}),nZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,uri:k.string()}),iZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Srt).optional(),sessionId:sc}),oZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,terminalId:k.string()}),sZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Srt),sessionId:sc}),aZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),limit:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:k.string(),sessionId:sc}),cZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),reason:Tas.nullish(),sessionId:sc}),lZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,terminalId:k.string()}),uZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Srt).optional(),sessionId:sc}),Scs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),sessionId:sc,title:k.string().nullish(),updatedAt:k.string().nullish()}),Tcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),nextCursor:k.string().nullish(),sessions:k.array(Scs)}),Ics=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),title:k.string().nullish(),updatedAt:k.string().nullish()}),xcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Trt=k.string(),wcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),currentModeId:Trt}),Rcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:Trt,name:k.string()}),Irt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModes:k.array(Rcs),currentModeId:Trt}),xrt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModels:k.array(das),currentModelId:GJt}),kcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde).nullish(),models:xrt.nullish(),modes:Irt.nullish(),sessionId:sc}),Pcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde).nullish(),models:xrt.nullish(),modes:Irt.nullish()}),Dcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde).nullish(),models:xrt.nullish(),modes:Irt.nullish(),sessionId:sc}),Ncs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde).nullish(),models:xrt.nullish(),modes:Irt.nullish()}),Mcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Ocs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:pcs.nullish(),close:hcs.nullish(),delete:Ccs.nullish(),fork:bcs.nullish(),list:xcs.nullish(),resume:Mcs.nullish()}),dZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),apiType:jJt,baseUrl:k.string(),headers:k.record(k.string(),k.string()).optional(),id:k.string()}),Lcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),fZt=k.intersection(k.union([k.object({type:k.literal("boolean"),value:k.boolean()}),k.object({value:WJt})]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configId:WPn,sessionId:sc})),Bcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Hde)}),pZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modeId:Trt,sessionId:sc}),Fcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),hZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modelId:GJt,sessionId:sc}),Ucs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Qcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc}),qcs=k.union([k.literal("end_turn"),k.literal("max_tokens"),k.literal("max_turn_requests"),k.literal("refusal"),k.literal("cancelled")]),jcs=k.union([k.literal("email"),k.literal("uri"),k.literal("date"),k.literal("date-time")]),Hcs=k.object({default:k.string().nullish(),description:k.string().nullish(),enum:k.array(k.string()).nullish(),format:jcs.nullish(),maxLength:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:k.array(PPn).nullish(),pattern:k.string().nullish(),title:k.string().nullish()}),mZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:ecs.nullish(),position:rj,selection:jde.nullish(),sessionId:sc,triggerKind:Nas,uri:k.string(),version:k.number()}),Gcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),suggestions:k.array(ncs)}),$cs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),Vcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitCode:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:k.string().nullish()}),gZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,terminalId:k.string()}),Wcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitStatus:Vcs.nullish(),output:k.string(),truncated:k.boolean()}),zcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),text:k.string()}),Ycs=k.object({range:jde.nullish(),text:k.string()}),AZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),contentChanges:k.array(Ycs),sessionId:sc,uri:k.string(),version:k.number()}),YYd=k.object({method:k.string(),params:k.union([YJt,rZt,AZt,eZt,nZt,tZt,zJt,cZt,QPn,MPn]).nullish()}),Kcs=k.union([k.literal("full"),k.literal("incremental")]),Jcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),syncKind:Kcs}),Zcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),didChange:Jcs.nullish(),didClose:has.nullish(),didFocus:mas.nullish(),didOpen:gas.nullish(),didSave:Aas.nullish()}),Xcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),document:Zcs.nullish()}),els=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:Oas.nullish(),events:Xcs.nullish()}),tls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:tas.optional().default({}),loadSession:k.boolean().optional().default(!1),mcpCapabilities:nas.optional().default({acp:!1,http:!1,sse:!1}),nes:els.nullish(),positionEncoding:GPn.nullish(),promptCapabilities:Was.optional().default({audio:!1,embeddedContext:!1,image:!1}),providers:Jas.nullish(),sessionCapabilities:Ocs.optional().default({})}),rls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),agentCapabilities:tls.optional().default({auth:{},loadSession:!1,mcpCapabilities:{acp:!1,http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:FPn.nullish(),authMethods:k.array(kss).optional().default([]),protocolVersion:$Pn}),nls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),mimeType:k.string().nullish(),text:k.string(),uri:k.string()}),ils=k.union([nls,Dss]),ols=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:HRe.nullish(),resource:ils}),yZt=k.union([zcs.and(k.object({type:k.literal("text")})),ccs.and(k.object({type:k.literal("image")})),acs.and(k.object({type:k.literal("audio")})),lcs.and(k.object({type:k.literal("resource_link")})),ols.and(k.object({type:k.literal("resource")}))]),sls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:yZt}),LJt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:yZt,messageId:k.string().nullish()}),EZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),messageId:k.string().nullish(),prompt:k.array(yZt),sessionId:sc}),als=k.object({anyOf:k.array(PPn)}),YPn=k.union([sls.and(k.object({type:k.literal("content")})),Uss.and(k.object({type:k.literal("diff")})),$cs.and(k.object({type:k.literal("terminal")}))]),_Zt=k.string(),KPn=k.object({sessionId:sc,toolCallId:_Zt.nullish()}),cls=k.intersection(k.union([KPn,VPn]),k.object({elicitationId:kPn,url:k.string().url()})),JPn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),line:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:k.string()}),ZPn=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed"),k.literal("failed")]),XPn=k.union([k.literal("read"),k.literal("edit"),k.literal("delete"),k.literal("move"),k.literal("search"),k.literal("execute"),k.literal("think"),k.literal("fetch"),k.literal("switch_mode"),k.literal("other")]),lls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(YPn).optional(),kind:XPn.optional(),locations:k.array(JPn).optional(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:ZPn.optional(),title:k.string(),toolCallId:_Zt}),e2n=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(YPn).nullish(),kind:XPn.nullish(),locations:k.array(JPn).nullish(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:ZPn.nullish(),title:k.string().nullish(),toolCallId:_Zt}),vZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),options:k.array(Fas),sessionId:sc,toolCall:e2n}),uls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),hint:k.string()}),dls=uls,fls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string(),input:dls.nullish(),name:k.string()}),pls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableCommands:k.array(fls)}),hls=k.object({enum:k.array(k.string()),type:Wss}),mls=k.union([hls,als]),gls=k.object({default:k.array(k.string()).nullish(),description:k.string().nullish(),items:mls,maxItems:k.number().nullish(),minItems:k.number().nullish(),title:k.string().nullish()}),Als=k.union([Hcs.and(k.object({type:k.literal("string")})),Las.and(k.object({type:k.literal("number")})),Zss.and(k.object({type:k.literal("integer")})),Nss.and(k.object({type:k.literal("boolean")})),gls.and(k.object({type:k.literal("array")}))]),yls=k.object({description:k.string().nullish(),properties:k.record(k.string(),Als).optional().default({}),required:k.array(k.string()).nullish(),title:k.string().nullish(),type:Vss.optional().default("object")}),Els=k.intersection(k.union([KPn,VPn]),k.object({requestedSchema:yls})),CZt=k.intersection(k.union([Els.and(k.object({mode:k.literal("form")})),cls.and(k.object({mode:k.literal("url")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),message:k.string()})),_ls=k.object({cachedReadTokens:k.number().nullish(),cachedWriteTokens:k.number().nullish(),inputTokens:k.number(),outputTokens:k.number(),thoughtTokens:k.number().nullish(),totalTokens:k.number()}),vls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),stopReason:qcs,usage:_ls.nullish(),userMessageId:k.string().nullish()}),KYd=k.union([k.object({id:nj,result:k.union([rls,Pss,Kas,Lcs,Qss,ras,Dcs,Pcs,Tcs,Fss,kcs,Ncs,Oss,Fcs,Bcs,vls,Ucs,Qcs,Gcs,Mss,LPn,jPn])}),k.object({error:NPn,id:nj})]),Cls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cost:Lss.nullish(),size:k.number(),used:k.number()}),bls=k.union([LJt.and(k.object({sessionUpdate:k.literal("user_message_chunk")})),LJt.and(k.object({sessionUpdate:k.literal("agent_message_chunk")})),LJt.and(k.object({sessionUpdate:k.literal("agent_thought_chunk")})),lls.and(k.object({sessionUpdate:k.literal("tool_call")})),e2n.and(k.object({sessionUpdate:k.literal("tool_call_update")})),jas.and(k.object({sessionUpdate:k.literal("plan")})),pls.and(k.object({sessionUpdate:k.literal("available_commands_update")})),wcs.and(k.object({sessionUpdate:k.literal("current_mode_update")})),vcs.and(k.object({sessionUpdate:k.literal("config_option_update")})),Ics.and(k.object({sessionUpdate:k.literal("session_info_update")})),Cls.and(k.object({sessionUpdate:k.literal("usage_update")}))]),bZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,update:bls}),JYd=k.object({method:k.string(),params:k.union([bZt,UJt,QPn,MPn]).nullish()}),SZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:sc,terminalId:k.string()}),Sls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitCode:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:k.string().nullish()}),Tls=k.object({name:k.string(),uri:k.string()}),TZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),repository:Ras.nullish(),workspaceFolders:k.array(Tls).nullish(),workspaceUri:k.string().nullish()}),ZYd=k.object({id:nj,method:k.string(),params:k.union([VJt,BJt,QJt,dZt,FJt,HJt,$Jt,sZt,qJt,XJt,iZt,uZt,JJt,pZt,fZt,EZt,hZt,TZt,mZt,KJt,qPn,OPn]).nullish()}),IZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),path:k.string(),sessionId:sc}),XYd=k.object({id:nj,method:k.string(),params:k.union([IZt,aZt,vZt,ZJt,gZt,lZt,SZt,oZt,CZt,sas,qPn,oas,OPn]).nullish()}),Ils=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),eKd=k.union([k.object({id:nj,result:k.union([Ils,ics,fcs,Bss,Wcs,ocs,Sls,Xss,Gss,ias,qss,LPn,jPn])}),k.object({error:NPn,id:nj})]);p();function GRe(t,e){let r=new TextEncoder,n=new TextDecoder,o=new ReadableStream({async start(c){let l="",u=e.getReader();try{for(;;){let{value:f,done:h}=await u.read();if(h){l+=n.decode();break}if(!f)continue;l+=n.decode(f,{stream:!0});let m=l.split(` +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let f of this.seen.entries()){let h=f[1];if(e===f[0]){c(f);continue}if(n.external){let g=n.external.registry.get(f[0])?.id;if(e!==f[0]&&g){c(f);continue}}if(this.metadataRegistry.get(f[0])?.id){c(f);continue}if(h.cycle){c(f);continue}if(h.count>1&&n.reused==="ref"){c(f);continue}}let l=a((f,h)=>{let m=this.seen.get(f),g=m.def??m.schema,A={...g};if(m.ref===null)return;let y=m.ref;if(m.ref=null,y){l(y,h);let E=this.seen.get(y).schema;E.$ref&&h.target==="draft-7"?(g.allOf=g.allOf??[],g.allOf.push(E)):(Object.assign(g,E),Object.assign(g,A))}m.isParent||this.override({zodSchema:f,jsonSchema:g,path:m.path??[]})},"flattenRef");for(let f of[...this.seen.entries()].reverse())l(f[0],{target:this.target});let u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){let f=n.external.registry.get(e)?.id;if(!f)throw new Error("Schema is missing an `id` property");u.$id=n.external.uri(f)}Object.assign(u,o.def);let d=n.external?.defs??{};for(let f of this.seen.entries()){let h=f[1];h.def&&h.defId&&(d[h.defId]=h.def)}n.external||Object.keys(d).length>0&&(this.target==="draft-2020-12"?u.$defs=d:u.definitions=d);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}};function jJt(t,e){if(t instanceof $de){let n=new eke(e),o={};for(let l of t._idmap.entries()){let[u,d]=l;n.process(d)}let s={},c={registry:t,uri:e?.uri,defs:o};for(let l of t._idmap.entries()){let[u,d]=l;s[u]=n.emit(d,{...e,external:c})}if(Object.keys(o).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:o}}return{schemas:s}}let r=new eke(e);return r.process(t),r.emit(t,e)}a(jJt,"toJSONSchema");function E0(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let o=t._zod.def;switch(o.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return E0(o.element,r);case"object":{for(let s in o.shape)if(E0(o.shape[s],r))return!0;return!1}case"union":{for(let s of o.options)if(E0(s,r))return!0;return!1}case"intersection":return E0(o.left,r)||E0(o.right,r);case"tuple":{for(let s of o.items)if(E0(s,r))return!0;return!!(o.rest&&E0(o.rest,r))}case"record":return E0(o.keyType,r)||E0(o.valueType,r);case"map":return E0(o.keyType,r)||E0(o.valueType,r);case"set":return E0(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return E0(o.innerType,r);case"lazy":return E0(o.getter(),r);case"default":return E0(o.innerType,r);case"prefault":return E0(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return E0(o.in,r)||E0(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}a(E0,"isTransforming");var b2n={};p();p();p();var Kde={};Ri(Kde,{ZodISODate:()=>Lrt,ZodISODateTime:()=>Ort,ZodISODuration:()=>Frt,ZodISOTime:()=>Brt,date:()=>GJt,datetime:()=>HJt,duration:()=>VJt,time:()=>$Jt});p();var Ort=dt("ZodISODateTime",(t,e)=>{SYt.init(t,e),Su.init(t,e)});function HJt(t){return iJt(Ort,t)}a(HJt,"datetime");var Lrt=dt("ZodISODate",(t,e)=>{TYt.init(t,e),Su.init(t,e)});function GJt(t){return oJt(Lrt,t)}a(GJt,"date");var Brt=dt("ZodISOTime",(t,e)=>{IYt.init(t,e),Su.init(t,e)});function $Jt(t){return sJt(Brt,t)}a($Jt,"time");var Frt=dt("ZodISODuration",(t,e)=>{xYt.init(t,e),Su.init(t,e)});function VJt(t){return aJt(Frt,t)}a(VJt,"duration");p();p();var T2n=a((t,e)=>{xRe.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>RRe(t,r),"value")},flatten:{value:a(r=>wRe(t,r),"value")},addIssue:{value:a(r=>t.issues.push(r),"value")},addIssues:{value:a(r=>t.issues.push(...r),"value")},isEmpty:{get(){return t.issues.length===0}}})},"initializer"),Tas=dt("ZodError",T2n),Jde=dt("ZodError",T2n,{Parent:Error});var WJt=ert(Jde),zJt=trt(Jde),YJt=rrt(Jde),KJt=nrt(Jde);var ks=dt("ZodType",(t,e)=>(co.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>dT(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.parse=(r,n)=>WJt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>YJt(t,r,n),t.parseAsync=async(r,n)=>zJt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>KJt(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(oDn(r,n)),t.superRefine=r=>t.check(sDn(r)),t.overwrite=r=>t.check(kF(r)),t.optional=()=>Tu(t),t.nullable=()=>Qrt(t),t.nullish=()=>Tu(Qrt(t)),t.nonoptional=r=>W2n(t,r),t.array=()=>Ur(t),t.or=r=>Il([t,r]),t.and=r=>ske(t,r),t.transform=r=>qrt(t,CZt(r)),t.default=r=>G2n(t,r),t.prefault=r=>V2n(t,r),t.catch=r=>K2n(t,r),t.pipe=r=>qrt(t,r),t.readonly=()=>X2n(t),t.describe=r=>{let n=t.clone();return p5.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return p5.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return p5.get(t);let n=t.clone();return p5.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),ZJt=dt("_ZodString",(t,e)=>{$J.init(t,e),ks.init(t,e);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check(jRe(...n)),t.includes=(...n)=>t.check($Re(...n)),t.startsWith=(...n)=>t.check(VRe(...n)),t.endsWith=(...n)=>t.check(WRe(...n)),t.min=(...n)=>t.check(hj(...n)),t.max=(...n)=>t.check(zde(...n)),t.length=(...n)=>t.check(Yde(...n)),t.nonempty=(...n)=>t.check(hj(1,...n)),t.lowercase=n=>t.check(HRe(n)),t.uppercase=n=>t.check(GRe(n)),t.trim=()=>t.check(KRe()),t.normalize=(...n)=>t.check(YRe(...n)),t.toLowerCase=()=>t.check(JRe()),t.toUpperCase=()=>t.check(ZRe())}),rke=dt("ZodString",(t,e)=>{$J.init(t,e),ZJt.init(t,e),t.email=r=>t.check(prt(XJt,r)),t.url=r=>t.check(yrt(eZt,r)),t.jwt=r=>t.check(Nrt(gZt,r)),t.emoji=r=>t.check(Ert(rZt,r)),t.guid=r=>t.check(QRe(Urt,r)),t.uuid=r=>t.check(hrt(DF,r)),t.uuidv4=r=>t.check(mrt(DF,r)),t.uuidv6=r=>t.check(grt(DF,r)),t.uuidv7=r=>t.check(Art(DF,r)),t.nanoid=r=>t.check(_rt(nZt,r)),t.guid=r=>t.check(QRe(Urt,r)),t.cuid=r=>t.check(vrt(iZt,r)),t.cuid2=r=>t.check(Crt(oZt,r)),t.ulid=r=>t.check(brt(sZt,r)),t.base64=r=>t.check(krt(pZt,r)),t.base64url=r=>t.check(Prt(hZt,r)),t.xid=r=>t.check(Srt(aZt,r)),t.ksuid=r=>t.check(Trt(cZt,r)),t.ipv4=r=>t.check(Irt(lZt,r)),t.ipv6=r=>t.check(xrt(uZt,r)),t.cidrv4=r=>t.check(wrt(dZt,r)),t.cidrv6=r=>t.check(Rrt(fZt,r)),t.e164=r=>t.check(Drt(mZt,r)),t.datetime=r=>t.check(HJt(r)),t.date=r=>t.check(GJt(r)),t.time=r=>t.check($Jt(r)),t.duration=r=>t.check(VJt(r))});function Ze(t){return tJt(rke,t)}a(Ze,"string");var Su=dt("ZodStringFormat",(t,e)=>{zl.init(t,e),ZJt.init(t,e)}),XJt=dt("ZodEmail",(t,e)=>{mYt.init(t,e),Su.init(t,e)});function xas(t){return prt(XJt,t)}a(xas,"email");var Urt=dt("ZodGUID",(t,e)=>{pYt.init(t,e),Su.init(t,e)});function was(t){return QRe(Urt,t)}a(was,"guid");var DF=dt("ZodUUID",(t,e)=>{hYt.init(t,e),Su.init(t,e)});function Ras(t){return hrt(DF,t)}a(Ras,"uuid");function kas(t){return mrt(DF,t)}a(kas,"uuidv4");function Pas(t){return grt(DF,t)}a(Pas,"uuidv6");function Das(t){return Art(DF,t)}a(Das,"uuidv7");var eZt=dt("ZodURL",(t,e)=>{gYt.init(t,e),Su.init(t,e)});function tZt(t){return yrt(eZt,t)}a(tZt,"url");var rZt=dt("ZodEmoji",(t,e)=>{AYt.init(t,e),Su.init(t,e)});function Nas(t){return Ert(rZt,t)}a(Nas,"emoji");var nZt=dt("ZodNanoID",(t,e)=>{yYt.init(t,e),Su.init(t,e)});function Mas(t){return _rt(nZt,t)}a(Mas,"nanoid");var iZt=dt("ZodCUID",(t,e)=>{EYt.init(t,e),Su.init(t,e)});function Oas(t){return vrt(iZt,t)}a(Oas,"cuid");var oZt=dt("ZodCUID2",(t,e)=>{_Yt.init(t,e),Su.init(t,e)});function Las(t){return Crt(oZt,t)}a(Las,"cuid2");var sZt=dt("ZodULID",(t,e)=>{vYt.init(t,e),Su.init(t,e)});function Bas(t){return brt(sZt,t)}a(Bas,"ulid");var aZt=dt("ZodXID",(t,e)=>{CYt.init(t,e),Su.init(t,e)});function Fas(t){return Srt(aZt,t)}a(Fas,"xid");var cZt=dt("ZodKSUID",(t,e)=>{bYt.init(t,e),Su.init(t,e)});function Uas(t){return Trt(cZt,t)}a(Uas,"ksuid");var lZt=dt("ZodIPv4",(t,e)=>{wYt.init(t,e),Su.init(t,e)});function Qas(t){return Irt(lZt,t)}a(Qas,"ipv4");var uZt=dt("ZodIPv6",(t,e)=>{RYt.init(t,e),Su.init(t,e)});function qas(t){return xrt(uZt,t)}a(qas,"ipv6");var dZt=dt("ZodCIDRv4",(t,e)=>{kYt.init(t,e),Su.init(t,e)});function jas(t){return wrt(dZt,t)}a(jas,"cidrv4");var fZt=dt("ZodCIDRv6",(t,e)=>{PYt.init(t,e),Su.init(t,e)});function Has(t){return Rrt(fZt,t)}a(Has,"cidrv6");var pZt=dt("ZodBase64",(t,e)=>{NYt.init(t,e),Su.init(t,e)});function Gas(t){return krt(pZt,t)}a(Gas,"base64");var hZt=dt("ZodBase64URL",(t,e)=>{MYt.init(t,e),Su.init(t,e)});function $as(t){return Prt(hZt,t)}a($as,"base64url");var mZt=dt("ZodE164",(t,e)=>{OYt.init(t,e),Su.init(t,e)});function Vas(t){return Drt(mZt,t)}a(Vas,"e164");var gZt=dt("ZodJWT",(t,e)=>{LYt.init(t,e),Su.init(t,e)});function Was(t){return Nrt(gZt,t)}a(Was,"jwt");var I2n=dt("ZodCustomStringFormat",(t,e)=>{BYt.init(t,e),Su.init(t,e)});function zas(t,e,r={}){return QJt(I2n,t,e,r)}a(zas,"stringFormat");var nke=dt("ZodNumber",(t,e)=>{lrt.init(t,e),ks.init(t,e),t.gt=(n,o)=>t.check(RF(n,o)),t.gte=(n,o)=>t.check(ib(n,o)),t.min=(n,o)=>t.check(ib(n,o)),t.lt=(n,o)=>t.check(wF(n,o)),t.lte=(n,o)=>t.check(Iw(n,o)),t.max=(n,o)=>t.check(Iw(n,o)),t.int=n=>t.check(JJt(n)),t.safe=n=>t.check(JJt(n)),t.positive=n=>t.check(RF(0,n)),t.nonnegative=n=>t.check(ib(0,n)),t.negative=n=>t.check(wF(0,n)),t.nonpositive=n=>t.check(Iw(0,n)),t.multipleOf=(n,o)=>t.check(WJ(n,o)),t.step=(n,o)=>t.check(WJ(n,o)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function ka(t){return cJt(nke,t)}a(ka,"number");var Zde=dt("ZodNumberFormat",(t,e)=>{FYt.init(t,e),nke.init(t,e)});function JJt(t){return uJt(Zde,t)}a(JJt,"int");function Yas(t){return dJt(Zde,t)}a(Yas,"float32");function Kas(t){return fJt(Zde,t)}a(Kas,"float64");function Jas(t){return pJt(Zde,t)}a(Jas,"int32");function Zas(t){return hJt(Zde,t)}a(Zas,"uint32");var ike=dt("ZodBoolean",(t,e)=>{MRe.init(t,e),ks.init(t,e)});function ol(t){return mJt(ike,t)}a(ol,"boolean");var oke=dt("ZodBigInt",(t,e)=>{urt.init(t,e),ks.init(t,e),t.gte=(n,o)=>t.check(ib(n,o)),t.min=(n,o)=>t.check(ib(n,o)),t.gt=(n,o)=>t.check(RF(n,o)),t.gte=(n,o)=>t.check(ib(n,o)),t.min=(n,o)=>t.check(ib(n,o)),t.lt=(n,o)=>t.check(wF(n,o)),t.lte=(n,o)=>t.check(Iw(n,o)),t.max=(n,o)=>t.check(Iw(n,o)),t.positive=n=>t.check(RF(BigInt(0),n)),t.negative=n=>t.check(wF(BigInt(0),n)),t.nonpositive=n=>t.check(Iw(BigInt(0),n)),t.nonnegative=n=>t.check(ib(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(WJ(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function Xas(t){return AJt(oke,t)}a(Xas,"bigint");var AZt=dt("ZodBigIntFormat",(t,e)=>{UYt.init(t,e),oke.init(t,e)});function ecs(t){return EJt(AZt,t)}a(ecs,"int64");function tcs(t){return _Jt(AZt,t)}a(tcs,"uint64");var x2n=dt("ZodSymbol",(t,e)=>{QYt.init(t,e),ks.init(t,e)});function rcs(t){return vJt(x2n,t)}a(rcs,"symbol");var w2n=dt("ZodUndefined",(t,e)=>{qYt.init(t,e),ks.init(t,e)});function ncs(t){return CJt(w2n,t)}a(ncs,"_undefined");var R2n=dt("ZodNull",(t,e)=>{jYt.init(t,e),ks.init(t,e)});function jrt(t){return bJt(R2n,t)}a(jrt,"_null");var k2n=dt("ZodAny",(t,e)=>{HYt.init(t,e),ks.init(t,e)});function yZt(){return SJt(k2n)}a(yZt,"any");var P2n=dt("ZodUnknown",(t,e)=>{Gde.init(t,e),ks.init(t,e)});function ld(){return Vde(P2n)}a(ld,"unknown");var D2n=dt("ZodNever",(t,e)=>{GYt.init(t,e),ks.init(t,e)});function Hrt(t){return TJt(D2n,t)}a(Hrt,"never");var N2n=dt("ZodVoid",(t,e)=>{$Yt.init(t,e),ks.init(t,e)});function ics(t){return IJt(N2n,t)}a(ics,"_void");var Grt=dt("ZodDate",(t,e)=>{VYt.init(t,e),ks.init(t,e),t.min=(n,o)=>t.check(ib(n,o)),t.max=(n,o)=>t.check(Iw(n,o));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function ocs(t){return xJt(Grt,t)}a(ocs,"date");var M2n=dt("ZodArray",(t,e)=>{ORe.init(t,e),ks.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(hj(r,n)),t.nonempty=r=>t.check(hj(1,r)),t.max=(r,n)=>t.check(zde(r,n)),t.length=(r,n)=>t.check(Yde(r,n)),t.unwrap=()=>t.element});function Ur(t,e){return XRe(M2n,t,e)}a(Ur,"array");function scs(t){let e=t._zod.def.shape;return Gn(Object.keys(e))}a(scs,"keyof");var $rt=dt("ZodObject",(t,e)=>{WYt.init(t,e),ks.init(t,e),qr.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>sv(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:ld()}),t.loose=()=>t.clone({...t._zod.def,catchall:ld()}),t.strict=()=>t.clone({...t._zod.def,catchall:Hrt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>qr.extend(t,r),t.merge=r=>qr.merge(t,r),t.pick=r=>qr.pick(t,r),t.omit=r=>qr.omit(t,r),t.partial=(...r)=>qr.partial(bZt,t,r[0]),t.required=(...r)=>qr.required(SZt,t,r[0])});function zr(t,e){let r={type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},...qr.normalizeParams(e)};return new $rt(r)}a(zr,"object");function acs(t,e){return new $rt({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:Hrt(),...qr.normalizeParams(e)})}a(acs,"strictObject");function um(t,e){return new $rt({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:ld(),...qr.normalizeParams(e)})}a(um,"looseObject");var EZt=dt("ZodUnion",(t,e)=>{drt.init(t,e),ks.init(t,e),t.options=e.options});function Il(t,e){return new EZt({type:"union",options:t,...qr.normalizeParams(e)})}a(Il,"union");var O2n=dt("ZodDiscriminatedUnion",(t,e)=>{EZt.init(t,e),zYt.init(t,e)});function Vrt(t,e,r){return new O2n({type:"union",options:e,discriminator:t,...qr.normalizeParams(r)})}a(Vrt,"discriminatedUnion");var L2n=dt("ZodIntersection",(t,e)=>{YYt.init(t,e),ks.init(t,e)});function ske(t,e){return new L2n({type:"intersection",left:t,right:e})}a(ske,"intersection");var B2n=dt("ZodTuple",(t,e)=>{VJ.init(t,e),ks.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});function ccs(t,e,r){let n=e instanceof co,o=n?r:e,s=n?e:null;return new B2n({type:"tuple",items:t,rest:s,...qr.normalizeParams(o)})}a(ccs,"tuple");var _Zt=dt("ZodRecord",(t,e)=>{KYt.init(t,e),ks.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function xl(t,e,r){return new _Zt({type:"record",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(xl,"record");function lcs(t,e,r){return new _Zt({type:"record",keyType:Il([t,Hrt()]),valueType:e,...qr.normalizeParams(r)})}a(lcs,"partialRecord");var F2n=dt("ZodMap",(t,e)=>{JYt.init(t,e),ks.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function ucs(t,e,r){return new F2n({type:"map",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(ucs,"map");var U2n=dt("ZodSet",(t,e)=>{ZYt.init(t,e),ks.init(t,e),t.min=(...r)=>t.check(zJ(...r)),t.nonempty=r=>t.check(zJ(1,r)),t.max=(...r)=>t.check(Wde(...r)),t.size=(...r)=>t.check(qRe(...r))});function dcs(t,e){return new U2n({type:"set",valueType:t,...qr.normalizeParams(e)})}a(dcs,"set");var tke=dt("ZodEnum",(t,e)=>{XYt.init(t,e),ks.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let c of n)if(r.has(c))s[c]=e.entries[c];else throw new Error(`Key ${c} not found in enum`);return new tke({...e,checks:[],...qr.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let c of n)if(r.has(c))delete s[c];else throw new Error(`Key ${c} not found in enum`);return new tke({...e,checks:[],...qr.normalizeParams(o),entries:s})}});function sv(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new tke({type:"enum",entries:r,...qr.normalizeParams(e)})}a(sv,"_enum");function fcs(t,e){return new tke({type:"enum",entries:t,...qr.normalizeParams(e)})}a(fcs,"nativeEnum");var Q2n=dt("ZodLiteral",(t,e)=>{eKt.init(t,e),ks.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function Gn(t,e){return new Q2n({type:"literal",values:Array.isArray(t)?t:[t],...qr.normalizeParams(e)})}a(Gn,"literal");var q2n=dt("ZodFile",(t,e)=>{tKt.init(t,e),ks.init(t,e),t.min=(r,n)=>t.check(zJ(r,n)),t.max=(r,n)=>t.check(Wde(r,n)),t.mime=(r,n)=>t.check(zRe(Array.isArray(r)?r:[r],n))});function pcs(t){return LJt(q2n,t)}a(pcs,"file");var vZt=dt("ZodTransform",(t,e)=>{LRe.init(t,e),ks.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(qr.issue(s,r.value,e));else{let c=s;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=r.value),c.inst??(c.inst=t),c.continue??(c.continue=!0),r.issues.push(qr.issue(c))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function CZt(t){return new vZt({type:"transform",transform:t})}a(CZt,"transform");var bZt=dt("ZodOptional",(t,e)=>{rKt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Tu(t){return new bZt({type:"optional",innerType:t})}a(Tu,"optional");var j2n=dt("ZodNullable",(t,e)=>{nKt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Qrt(t){return new j2n({type:"nullable",innerType:t})}a(Qrt,"nullable");function hcs(t){return Tu(Qrt(t))}a(hcs,"nullish");var H2n=dt("ZodDefault",(t,e)=>{iKt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function G2n(t,e){return new H2n({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(G2n,"_default");var $2n=dt("ZodPrefault",(t,e)=>{oKt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function V2n(t,e){return new $2n({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(V2n,"prefault");var SZt=dt("ZodNonOptional",(t,e)=>{sKt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function W2n(t,e){return new SZt({type:"nonoptional",innerType:t,...qr.normalizeParams(e)})}a(W2n,"nonoptional");var z2n=dt("ZodSuccess",(t,e)=>{aKt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function mcs(t){return new z2n({type:"success",innerType:t})}a(mcs,"success");var Y2n=dt("ZodCatch",(t,e)=>{cKt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function K2n(t,e){return new Y2n({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}a(K2n,"_catch");var J2n=dt("ZodNaN",(t,e)=>{lKt.init(t,e),ks.init(t,e)});function gcs(t){return RJt(J2n,t)}a(gcs,"nan");var TZt=dt("ZodPipe",(t,e)=>{BRe.init(t,e),ks.init(t,e),t.in=e.in,t.out=e.out});function qrt(t,e){return new TZt({type:"pipe",in:t,out:e})}a(qrt,"pipe");var Z2n=dt("ZodReadonly",(t,e)=>{uKt.init(t,e),ks.init(t,e)});function X2n(t){return new Z2n({type:"readonly",innerType:t})}a(X2n,"readonly");var eDn=dt("ZodTemplateLiteral",(t,e)=>{dKt.init(t,e),ks.init(t,e)});function Acs(t,e){return new eDn({type:"template_literal",parts:t,...qr.normalizeParams(e)})}a(Acs,"templateLiteral");var tDn=dt("ZodLazy",(t,e)=>{pKt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.getter()});function rDn(t){return new tDn({type:"lazy",getter:t})}a(rDn,"lazy");var nDn=dt("ZodPromise",(t,e)=>{fKt.init(t,e),ks.init(t,e),t.unwrap=()=>t._zod.def.innerType});function ycs(t){return new nDn({type:"promise",innerType:t})}a(ycs,"promise");var Wrt=dt("ZodCustom",(t,e)=>{hKt.init(t,e),ks.init(t,e)});function iDn(t){let e=new kf({check:"custom"});return e._zod.check=t,e}a(iDn,"check");function IZt(t,e){return BJt(Wrt,t??(()=>!0),e)}a(IZt,"custom");function oDn(t,e={}){return FJt(Wrt,t,e)}a(oDn,"refine");function sDn(t){let e=iDn(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(qr.issue(n,r.value,e._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),o.continue??(o.continue=!e._zod.def.abort),r.issues.push(qr.issue(o))}},t(r.value,r)));return e}a(sDn,"superRefine");function Ecs(t,e={error:`Input not instance of ${t.name}`}){let r=new Wrt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...qr.normalizeParams(e)});return r._zod.bag.Class=t,r}a(Ecs,"_instanceof");var _cs=a((...t)=>UJt({Pipe:TZt,Boolean:ike,String:rke,Transform:vZt},...t),"stringbool");function vcs(t){let e=rDn(()=>Il([Ze(t),ka(),ol(),jrt(),Ur(e),xl(Ze(),e)]));return e}a(vcs,"json");function zrt(t,e){return qrt(CZt(t),e)}a(zrt,"preprocess");p();var xZt={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Ccs(t){lm({customError:t})}a(Ccs,"setErrorMap");function bcs(){return lm().customError}a(bcs,"getErrorMap");var ake={};Ri(ake,{bigint:()=>xcs,boolean:()=>Ics,date:()=>wcs,number:()=>Tcs,string:()=>Scs});p();function Scs(t){return rJt(rke,t)}a(Scs,"string");function Tcs(t){return lJt(nke,t)}a(Tcs,"number");function Ics(t){return gJt(ike,t)}a(Ics,"boolean");function xcs(t){return yJt(oke,t)}a(xcs,"bigint");function wcs(t){return wJt(Grt,t)}a(wcs,"date");lm(FRe());p();var ai={authenticate:"authenticate",document_did_change:"document/didChange",document_did_close:"document/didClose",document_did_focus:"document/didFocus",document_did_open:"document/didOpen",document_did_save:"document/didSave",initialize:"initialize",logout:"logout",mcp_message:"mcp/message",nes_accept:"nes/accept",nes_close:"nes/close",nes_reject:"nes/reject",nes_start:"nes/start",nes_suggest:"nes/suggest",providers_disable:"providers/disable",providers_list:"providers/list",providers_set:"providers/set",session_cancel:"session/cancel",session_close:"session/close",session_delete:"session/delete",session_fork:"session/fork",session_list:"session/list",session_load:"session/load",session_new:"session/new",session_prompt:"session/prompt",session_resume:"session/resume",session_set_config_option:"session/set_config_option",session_set_mode:"session/set_mode",session_set_model:"session/set_model"},Pf={elicitation_complete:"elicitation/complete",elicitation_create:"elicitation/create",fs_read_text_file:"fs/read_text_file",fs_write_text_file:"fs/write_text_file",mcp_connect:"mcp/connect",mcp_disconnect:"mcp/disconnect",mcp_message:"mcp/message",session_request_permission:"session/request_permission",session_update:"session/update",terminal_create:"terminal/create",terminal_kill:"terminal/kill",terminal_output:"terminal/output",terminal_release:"terminal/release",terminal_wait_for_exit:"terminal/wait_for_exit"},Yrt=1;p();var kcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminal:k.boolean().optional().default(!1)}),Pcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),label:k.string().nullish(),name:k.string(),optional:k.boolean().optional().default(!1),secret:k.boolean().optional().default(!0)}),Dcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:k.string(),name:k.string()}),Ncs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:k.string(),link:k.string().nullish(),name:k.string(),vars:k.array(Pcs)}),Mcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()).optional(),description:k.string().nullish(),env:k.record(k.string(),k.string()).optional(),id:k.string(),name:k.string()}),Ocs=k.union([Ncs.and(k.object({type:k.literal("env_var")})),Mcs.and(k.object({type:k.literal("terminal")})),Dcs]),RZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),methodId:k.string()}),Lcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Bcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),blob:k.string(),mimeType:k.string().nullish(),uri:k.string()}),Fcs=k.object({default:k.boolean().nullish(),description:k.string().nullish(),title:k.string().nullish()}),Ucs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Qcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),qcs=k.object({amount:k.number(),currency:k.string()}),jcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),Hcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Gcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),newText:k.string(),oldText:k.string().nullish(),path:k.string()}),kZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string()}),$cs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Vcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Wcs=k.union([k.string(),k.number(),k.number(),k.boolean(),k.array(k.string())]),zcs=k.object({content:k.record(k.string(),Wcs).nullish()}),Ycs=k.intersection(k.union([zcs.and(k.object({action:k.literal("accept")})),k.object({action:k.literal("decline")}),k.object({action:k.literal("cancel")})]),k.object({_meta:k.record(k.string(),k.unknown()).nullish()})),Kcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),aDn=k.string(),PZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),elicitationId:aDn}),Jcs=k.literal("object"),Zcs=k.literal("string"),Xcs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),els=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),form:Kcs.nullish(),url:Xcs.nullish()}),cDn=k.object({const:k.string(),title:k.string()}),lDn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),tls=k.union([k.literal(-32700),k.literal(-32600),k.literal(-32601),k.literal(-32602),k.literal(-32603),k.literal(-32800),k.literal(-32e3),k.literal(-32002),k.literal(-32042),k.number().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),uDn=k.object({code:tls,data:k.unknown().optional(),message:k.string()}),dDn=k.unknown(),fDn=k.unknown(),pDn=k.unknown(),rls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),readTextFile:k.boolean().optional().default(!1),writeTextFile:k.boolean().optional().default(!1)}),hDn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),mDn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),title:k.string().nullish(),version:k.string()}),nls=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),ils=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),DZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),NZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cursor:k.string().nullish(),cwd:k.string().nullish()}),MZt=k.union([k.literal("anthropic"),k.literal("openai"),k.literal("azure"),k.literal("vertex"),k.literal("bedrock"),k.string()]),ols=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),sls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),logout:ols.nullish()}),OZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),als=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),cls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),acp:k.boolean().optional().default(!1),http:k.boolean().optional().default(!1),sse:k.boolean().optional().default(!1)}),Krt=k.string(),lls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:Krt}),uls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:Krt}),gDn=k.string(),dls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),acpId:gDn}),fls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:gDn,name:k.string()}),pls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(hDn),name:k.string(),url:k.string()}),hls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(hDn),name:k.string(),url:k.string()}),mls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()),command:k.string(),env:k.array(lDn),name:k.string()}),Jrt=k.union([pls.and(k.object({type:k.literal("http")})),hls.and(k.object({type:k.literal("sse")})),fls.and(k.object({type:k.literal("acp")})),mls]),ADn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:Krt,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),yDn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:Krt,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),EDn=k.unknown(),LZt=k.string(),gls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),modelId:LZt,name:k.string()}),Als=k.union([k.literal("error"),k.literal("warning"),k.literal("information"),k.literal("hint")]),yls=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Els=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),_ls=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),vls=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Cls=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),bls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),maxCount:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Sls=k.object({diff:k.string(),uri:k.string()}),Tls=k.object({endLine:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:k.string()}),Ils=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),xls=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),wls=k.object({languageId:k.string(),text:k.string(),uri:k.string()}),Rls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),maxCount:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),kls=k.union([k.literal("rejected"),k.literal("ignored"),k.literal("replaced"),k.literal("cancelled")]),Pls=k.object({excerpts:k.array(Tls),uri:k.string()}),Dls=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Nls=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Mls=k.object({name:k.string(),owner:k.string(),remoteUrl:k.string()}),Ols=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Lls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),jump:Ils.nullish(),rename:Nls.nullish(),searchAndReplace:Ols.nullish()}),Bls=k.object({id:k.string(),isRegex:k.boolean().nullish(),replace:k.string(),search:k.string(),uri:k.string()}),Fls=k.union([k.literal("automatic"),k.literal("diagnostic"),k.literal("manual")]),Uls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),maxCount:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Qls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:yls.nullish(),editHistory:bls.nullish(),openFiles:xls.nullish(),recentFiles:Rls.nullish(),relatedSnippets:Dls.nullish(),userActions:Uls.nullish()}),BZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Jrt)}),qls=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),_Dn=k.string(),jls=k.union([k.literal("allow_once"),k.literal("allow_always"),k.literal("reject_once"),k.literal("reject_always")]),Hls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),kind:jls,name:k.string(),optionId:_Dn}),Gls=k.union([k.literal("high"),k.literal("medium"),k.literal("low")]),$ls=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed")]),Vls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),priority:Gls,status:$ls}),Wls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),entries:k.array(Vls)}),mj=k.object({character:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),zls=k.object({id:k.string(),position:mj,uri:k.string()}),Yls=k.object({id:k.string(),newName:k.string(),position:mj,uri:k.string()}),Kls=k.object({action:k.string(),position:mj,timestampMs:k.number(),uri:k.string()}),vDn=k.union([k.literal("utf-16"),k.literal("utf-32"),k.literal("utf-8")]),Jls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:kcs.optional().default({terminal:!1}),elicitation:els.nullish(),fs:rls.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Lls.nullish(),positionEncodings:k.array(vDn).optional(),terminal:k.boolean().optional().default(!1)}),Zls=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),audio:k.boolean().optional().default(!1),embeddedContext:k.boolean().optional().default(!1),image:k.boolean().optional().default(!1)}),CDn=k.number().int().gte(0).lte(65535),FZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),clientCapabilities:Jls.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:mDn.nullish(),protocolVersion:CDn}),Xls=k.object({apiType:MZt,baseUrl:k.string()}),eus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),current:Xls.nullish(),id:k.string(),required:k.boolean(),supported:k.array(MZt)}),tus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),providers:k.array(eus)}),rus=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Xde=k.object({end:mj,start:mj}),nus=k.object({message:k.string(),range:Xde,severity:Als,uri:k.string()}),ius=k.object({languageId:k.string(),lastFocusedMs:k.number().nullish(),uri:k.string(),visibleRange:Xde.nullish()}),ous=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:k.array(nus).nullish(),editHistory:k.array(Sls).nullish(),openFiles:k.array(ius).nullish(),recentFiles:k.array(wls).nullish(),relatedSnippets:k.array(Pls).nullish(),userActions:k.array(Kls).nullish()}),sus=k.object({newText:k.string(),range:Xde}),aus=k.object({cursorPosition:mj.nullish(),edits:k.array(sus),id:k.string(),uri:k.string()}),cus=k.union([aus.and(k.object({kind:k.literal("edit")})),zls.and(k.object({kind:k.literal("jump")})),Yls.and(k.object({kind:k.literal("rename")})),Bls.and(k.object({kind:k.literal("searchAndReplace")}))]),lus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string()}),uus=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),gj=k.union([k.number(),k.string()]).nullable(),YZd=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),requestId:gj}),bDn=k.object({requestId:gj}),dus=k.enum(["assistant","user"]),cke=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),audience:k.array(dus).nullish(),lastModified:k.string().nullish(),priority:k.number().nullish()}),fus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:cke.nullish(),data:k.string(),mimeType:k.string()}),pus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:cke.nullish(),data:k.string(),mimeType:k.string(),uri:k.string().nullish()}),hus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:cke.nullish(),description:k.string().nullish(),mimeType:k.string().nullish(),name:k.string(),size:k.number().nullish(),title:k.string().nullish(),uri:k.string()}),mus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),optionId:_Dn}),gus=k.union([k.object({outcome:k.literal("cancelled")}),mus.and(k.object({outcome:k.literal("selected")}))]),Aus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),outcome:gus}),yus=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Eus=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),_us=k.object({currentValue:k.boolean()}),vus=k.string(),SDn=k.string(),Cus=k.union([k.literal("mode"),k.literal("model"),k.literal("thought_level"),k.string()]),UZt=k.string(),TDn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),name:k.string(),value:UZt}),bus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),group:vus,name:k.string(),options:k.array(TDn)}),Sus=k.union([k.array(TDn),k.array(bus)]),Tus=k.object({currentValue:UZt,options:Sus}),efe=k.intersection(k.union([Tus.and(k.object({type:k.literal("select")})),_us.and(k.object({type:k.literal("boolean")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),category:Cus.nullish(),description:k.string().nullish(),id:SDn,name:k.string()})),Ius=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(efe)}),xus=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),wus=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),lc=k.string(),QZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),sessionId:lc}),qZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:lc}),jZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:lc}),HZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:lc}),GZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()).optional(),command:k.string(),cwd:k.string().nullish(),env:k.array(lDn).optional(),outputByteLimit:k.number().nullish(),sessionId:lc}),$Zt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:lc}),VZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:lc,uri:k.string()}),WZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),position:mj,sessionId:lc,uri:k.string(),version:k.number(),visibleRange:Xde}),zZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),languageId:k.string(),sessionId:lc,text:k.string(),uri:k.string(),version:k.number()}),YZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:lc,uri:k.string()}),KZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Jrt).optional(),sessionId:lc}),JZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:lc,terminalId:k.string()}),ZZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Jrt),sessionId:lc}),XZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),limit:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:k.string(),sessionId:lc}),eXt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),reason:kls.nullish(),sessionId:lc}),tXt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:lc,terminalId:k.string()}),rXt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(Jrt).optional(),sessionId:lc}),Rus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),sessionId:lc,title:k.string().nullish(),updatedAt:k.string().nullish()}),kus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),nextCursor:k.string().nullish(),sessions:k.array(Rus)}),Pus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),title:k.string().nullish(),updatedAt:k.string().nullish()}),Dus=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Zrt=k.string(),Nus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),currentModeId:Zrt}),Mus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:Zrt,name:k.string()}),Xrt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModes:k.array(Mus),currentModeId:Zrt}),ent=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModels:k.array(gls),currentModelId:LZt}),Ous=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(efe).nullish(),models:ent.nullish(),modes:Xrt.nullish(),sessionId:lc}),Lus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(efe).nullish(),models:ent.nullish(),modes:Xrt.nullish()}),Bus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(efe).nullish(),models:ent.nullish(),modes:Xrt.nullish(),sessionId:lc}),Fus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(efe).nullish(),models:ent.nullish(),modes:Xrt.nullish()}),Uus=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Qus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:yus.nullish(),close:Eus.nullish(),delete:xus.nullish(),fork:wus.nullish(),list:Dus.nullish(),resume:Uus.nullish()}),nXt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),apiType:MZt,baseUrl:k.string(),headers:k.record(k.string(),k.string()).optional(),id:k.string()}),qus=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),iXt=k.intersection(k.union([k.object({type:k.literal("boolean"),value:k.boolean()}),k.object({value:UZt})]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configId:SDn,sessionId:lc})),jus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(efe)}),oXt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modeId:Zrt,sessionId:lc}),Hus=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),sXt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modelId:LZt,sessionId:lc}),Gus=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),$us=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:lc}),Vus=k.union([k.literal("end_turn"),k.literal("max_tokens"),k.literal("max_turn_requests"),k.literal("refusal"),k.literal("cancelled")]),Wus=k.union([k.literal("email"),k.literal("uri"),k.literal("date"),k.literal("date-time")]),zus=k.object({default:k.string().nullish(),description:k.string().nullish(),enum:k.array(k.string()).nullish(),format:Wus.nullish(),maxLength:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:k.array(cDn).nullish(),pattern:k.string().nullish(),title:k.string().nullish()}),aXt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:ous.nullish(),position:mj,selection:Xde.nullish(),sessionId:lc,triggerKind:Fls,uri:k.string(),version:k.number()}),Yus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),suggestions:k.array(cus)}),Kus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),Jus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitCode:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:k.string().nullish()}),cXt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:lc,terminalId:k.string()}),Zus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitStatus:Jus.nullish(),output:k.string(),truncated:k.boolean()}),Xus=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:cke.nullish(),text:k.string()}),eds=k.object({range:Xde.nullish(),text:k.string()}),lXt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),contentChanges:k.array(eds),sessionId:lc,uri:k.string(),version:k.number()}),KZd=k.object({method:k.string(),params:k.union([qZt,zZt,lXt,VZt,YZt,WZt,QZt,eXt,ADn,dDn]).nullish()}),tds=k.union([k.literal("full"),k.literal("incremental")]),rds=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),syncKind:tds}),nds=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),didChange:rds.nullish(),didClose:Els.nullish(),didFocus:_ls.nullish(),didOpen:vls.nullish(),didSave:Cls.nullish()}),ids=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),document:nds.nullish()}),ods=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:Qls.nullish(),events:ids.nullish()}),sds=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:sls.optional().default({}),loadSession:k.boolean().optional().default(!1),mcpCapabilities:cls.optional().default({acp:!1,http:!1,sse:!1}),nes:ods.nullish(),positionEncoding:vDn.nullish(),promptCapabilities:Zls.optional().default({audio:!1,embeddedContext:!1,image:!1}),providers:rus.nullish(),sessionCapabilities:Qus.optional().default({})}),ads=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),agentCapabilities:sds.optional().default({auth:{},loadSession:!1,mcpCapabilities:{acp:!1,http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:mDn.nullish(),authMethods:k.array(Ocs).optional().default([]),protocolVersion:CDn}),cds=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),mimeType:k.string().nullish(),text:k.string(),uri:k.string()}),lds=k.union([cds,Bcs]),uds=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:cke.nullish(),resource:lds}),uXt=k.union([Xus.and(k.object({type:k.literal("text")})),pus.and(k.object({type:k.literal("image")})),fus.and(k.object({type:k.literal("audio")})),hus.and(k.object({type:k.literal("resource_link")})),uds.and(k.object({type:k.literal("resource")}))]),dds=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:uXt}),wZt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:uXt,messageId:k.string().nullish()}),dXt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),messageId:k.string().nullish(),prompt:k.array(uXt),sessionId:lc}),fds=k.object({anyOf:k.array(cDn)}),IDn=k.union([dds.and(k.object({type:k.literal("content")})),Gcs.and(k.object({type:k.literal("diff")})),Kus.and(k.object({type:k.literal("terminal")}))]),fXt=k.string(),xDn=k.object({sessionId:lc,toolCallId:fXt.nullish()}),pds=k.intersection(k.union([xDn,bDn]),k.object({elicitationId:aDn,url:k.string().url()})),wDn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),line:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:k.string()}),RDn=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed"),k.literal("failed")]),kDn=k.union([k.literal("read"),k.literal("edit"),k.literal("delete"),k.literal("move"),k.literal("search"),k.literal("execute"),k.literal("think"),k.literal("fetch"),k.literal("switch_mode"),k.literal("other")]),hds=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(IDn).optional(),kind:kDn.optional(),locations:k.array(wDn).optional(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:RDn.optional(),title:k.string(),toolCallId:fXt}),PDn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(IDn).nullish(),kind:kDn.nullish(),locations:k.array(wDn).nullish(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:RDn.nullish(),title:k.string().nullish(),toolCallId:fXt}),pXt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),options:k.array(Hls),sessionId:lc,toolCall:PDn}),mds=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),hint:k.string()}),gds=mds,Ads=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string(),input:gds.nullish(),name:k.string()}),yds=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableCommands:k.array(Ads)}),Eds=k.object({enum:k.array(k.string()),type:Zcs}),_ds=k.union([Eds,fds]),vds=k.object({default:k.array(k.string()).nullish(),description:k.string().nullish(),items:_ds,maxItems:k.number().nullish(),minItems:k.number().nullish(),title:k.string().nullish()}),Cds=k.union([zus.and(k.object({type:k.literal("string")})),qls.and(k.object({type:k.literal("number")})),nls.and(k.object({type:k.literal("integer")})),Fcs.and(k.object({type:k.literal("boolean")})),vds.and(k.object({type:k.literal("array")}))]),bds=k.object({description:k.string().nullish(),properties:k.record(k.string(),Cds).optional().default({}),required:k.array(k.string()).nullish(),title:k.string().nullish(),type:Jcs.optional().default("object")}),Sds=k.intersection(k.union([xDn,bDn]),k.object({requestedSchema:bds})),hXt=k.intersection(k.union([Sds.and(k.object({mode:k.literal("form")})),pds.and(k.object({mode:k.literal("url")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),message:k.string()})),Tds=k.object({cachedReadTokens:k.number().nullish(),cachedWriteTokens:k.number().nullish(),inputTokens:k.number(),outputTokens:k.number(),thoughtTokens:k.number().nullish(),totalTokens:k.number()}),Ids=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),stopReason:Vus,usage:Tds.nullish(),userMessageId:k.string().nullish()}),JZd=k.union([k.object({id:gj,result:k.union([ads,Lcs,tus,qus,$cs,als,Bus,Lus,kus,Hcs,Ous,Fus,Qcs,Hus,jus,Ids,Gus,$us,Yus,Ucs,pDn,EDn])}),k.object({error:uDn,id:gj})]),xds=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cost:qcs.nullish(),size:k.number(),used:k.number()}),wds=k.union([wZt.and(k.object({sessionUpdate:k.literal("user_message_chunk")})),wZt.and(k.object({sessionUpdate:k.literal("agent_message_chunk")})),wZt.and(k.object({sessionUpdate:k.literal("agent_thought_chunk")})),hds.and(k.object({sessionUpdate:k.literal("tool_call")})),PDn.and(k.object({sessionUpdate:k.literal("tool_call_update")})),Wls.and(k.object({sessionUpdate:k.literal("plan")})),yds.and(k.object({sessionUpdate:k.literal("available_commands_update")})),Nus.and(k.object({sessionUpdate:k.literal("current_mode_update")})),Ius.and(k.object({sessionUpdate:k.literal("config_option_update")})),Pus.and(k.object({sessionUpdate:k.literal("session_info_update")})),xds.and(k.object({sessionUpdate:k.literal("usage_update")}))]),mXt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:lc,update:wds}),ZZd=k.object({method:k.string(),params:k.union([mXt,PZt,ADn,dDn]).nullish()}),gXt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:lc,terminalId:k.string()}),Rds=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitCode:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:k.string().nullish()}),kds=k.object({name:k.string(),uri:k.string()}),AXt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),repository:Mls.nullish(),workspaceFolders:k.array(kds).nullish(),workspaceUri:k.string().nullish()}),XZd=k.object({id:gj,method:k.string(),params:k.union([FZt,RZt,DZt,nXt,kZt,OZt,BZt,ZZt,NZt,$Zt,KZt,rXt,HZt,oXt,iXt,dXt,sXt,AXt,aXt,jZt,yDn,fDn]).nullish()}),yXt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),path:k.string(),sessionId:lc}),eXd=k.object({id:gj,method:k.string(),params:k.union([yXt,XZt,pXt,GZt,cXt,tXt,gXt,JZt,hXt,dls,yDn,uls,fDn]).nullish()}),Pds=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),tXd=k.union([k.object({id:gj,result:k.union([Pds,lus,Aus,jcs,Zus,uus,Rds,ils,Ycs,lls,Vcs,pDn,EDn])}),k.object({error:uDn,id:gj})]);p();function lke(t,e){let r=new TextEncoder,n=new TextDecoder,o=new ReadableStream({async start(c){let l="",u=e.getReader();try{for(;;){let{value:f,done:h}=await u.read();if(h){l+=n.decode();break}if(!f)continue;l+=n.decode(f,{stream:!0});let m=l.split(` `);l=m.pop()||"";for(let g of m){let A=g.trim();if(A)try{let y=JSON.parse(A);c.enqueue(y)}catch(y){console.error("Failed to parse JSON message:",A,y)}}}let d=l.trim();if(d)try{let f=JSON.parse(d);c.enqueue(f)}catch(f){console.error("Failed to parse JSON message:",d,f)}}catch(d){c.error(d);return}finally{u.releaseLock()}c.close()}}),s=new WritableStream({async write(c){let l=JSON.stringify(c)+` -`,u=t.getWriter();try{await u.write(r.encode(l))}finally{u.releaseLock()}}});return{readable:o,writable:s}}a(GRe,"ndJsonStream");function Ew(t){return t??{}}a(Ew,"emptyObjectResponse");function t2n(t){let e=Promise.reject(t);return e.catch(()=>{}),e}a(t2n,"rejectedPromise");var $Re=class{static{a(this,"AgentSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case ci.initialize:{let u=VJt.parse(l);return n.initialize(u)}case ci.session_new:{let u=$Jt.parse(l);return n.newSession(u)}case ci.session_load:{if(!n.loadSession)throw fo.methodNotFound(c);let u=sZt.parse(l);return n.loadSession(u)}case ci.session_list:{if(!n.listSessions)throw fo.methodNotFound(c);let u=qJt.parse(l);return n.listSessions(u)}case ci.session_delete:{if(!n.unstable_deleteSession)throw fo.methodNotFound(c);let u=XJt.parse(l);return await n.unstable_deleteSession(u)??{}}case ci.session_fork:{if(!n.unstable_forkSession)throw fo.methodNotFound(c);let u=iZt.parse(l);return n.unstable_forkSession(u)}case ci.session_resume:{if(!n.resumeSession)throw fo.methodNotFound(c);let u=uZt.parse(l);return n.resumeSession(u)}case ci.session_close:{if(!n.closeSession)throw fo.methodNotFound(c);let u=JJt.parse(l);return await n.closeSession(u)??{}}case ci.session_set_mode:{if(!n.setSessionMode)throw fo.methodNotFound(c);let u=pZt.parse(l);return await n.setSessionMode(u)??{}}case ci.authenticate:{let u=BJt.parse(l);return await n.authenticate(u)??{}}case ci.providers_list:{if(!n.unstable_listProviders)throw fo.methodNotFound(c);let u=QJt.parse(l);return n.unstable_listProviders(u)}case ci.providers_set:{if(!n.unstable_setProvider)throw fo.methodNotFound(c);let u=dZt.parse(l);return await n.unstable_setProvider(u)??{}}case ci.providers_disable:{if(!n.unstable_disableProvider)throw fo.methodNotFound(c);let u=FJt.parse(l);return await n.unstable_disableProvider(u)??{}}case ci.logout:{if(!n.unstable_logout)throw fo.methodNotFound(c);let u=HJt.parse(l);return await n.unstable_logout(u)??{}}case ci.session_prompt:{let u=EZt.parse(l);return n.prompt(u)}case ci.session_set_model:{if(!n.unstable_setSessionModel)throw fo.methodNotFound(c);let u=hZt.parse(l);return await n.unstable_setSessionModel(u)??{}}case ci.session_set_config_option:{if(!n.setSessionConfigOption)throw fo.methodNotFound(c);let u=fZt.parse(l);return n.setSessionConfigOption(u)}case ci.nes_start:{if(!n.unstable_startNes)throw fo.methodNotFound(c);let u=TZt.parse(l);return n.unstable_startNes(u)}case ci.nes_suggest:{if(!n.unstable_suggestNes)throw fo.methodNotFound(c);let u=mZt.parse(l);return n.unstable_suggestNes(u)}case ci.nes_close:{if(!n.unstable_closeNes)throw fo.methodNotFound(c);let u=KJt.parse(l);return await n.unstable_closeNes(u)??{}}default:if(n.extMethod)return n.extMethod(c,l);throw fo.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case ci.session_cancel:{let u=YJt.parse(l);return n.cancel(u)}case ci.document_did_open:{if(!n.unstable_didOpenDocument)return;let u=rZt.parse(l);return n.unstable_didOpenDocument(u)}case ci.document_did_change:{if(!n.unstable_didChangeDocument)return;let u=AZt.parse(l);return n.unstable_didChangeDocument(u)}case ci.document_did_close:{if(!n.unstable_didCloseDocument)return;let u=eZt.parse(l);return n.unstable_didCloseDocument(u)}case ci.document_did_save:{if(!n.unstable_didSaveDocument)return;let u=nZt.parse(l);return n.unstable_didSaveDocument(u)}case ci.document_did_focus:{if(!n.unstable_didFocusDocument)return;let u=tZt.parse(l);return n.unstable_didFocusDocument(u)}case ci.nes_accept:{if(!n.unstable_acceptNes)return;let u=zJt.parse(l);return n.unstable_acceptNes(u)}case ci.nes_reject:{if(!n.unstable_rejectNes)return;let u=cZt.parse(l);return n.unstable_rejectNes(u)}default:if(n.extNotification)return n.extNotification(c,l);throw fo.methodNotFound(c)}},"notificationHandler");this.connection=new Rrt(o,s,r)}sessionUpdate(e){return this.connection.sendNotification(If.session_update,e)}requestPermission(e){return this.connection.sendRequest(If.session_request_permission,e)}readTextFile(e){return this.connection.sendRequest(If.fs_read_text_file,e)}writeTextFile(e){return this.connection.sendRequest(If.fs_write_text_file,e,Ew)}createTerminal(e){return this.connection.sendRequest(If.terminal_create,e,r=>new xZt(r.terminalId,e.sessionId,this.connection))}unstable_createElicitation(e){return this.connection.sendRequest(If.elicitation_create,e)}unstable_completeElicitation(e){return this.connection.sendNotification(If.elicitation_complete,e)}extMethod(e,r){return this.connection.sendRequest(e,r)}extNotification(e,r){return this.connection.sendNotification(e,r)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}},xZt=class{static{a(this,"TerminalHandle")}id;sessionId;connection;constructor(e,r,n){this.id=e,this.sessionId=r,this.connection=n}currentOutput(){return this.connection.sendRequest(If.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}waitForExit(){return this.connection.sendRequest(If.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}kill(){return this.connection.sendRequest(If.terminal_kill,{sessionId:this.sessionId,terminalId:this.id},Ew)}release(){return this.connection.sendRequest(If.terminal_release,{sessionId:this.sessionId,terminalId:this.id},Ew)}async[Symbol.asyncDispose](){await this.release()}},wrt=class{static{a(this,"ClientSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case If.fs_write_text_file:{let u=IZt.parse(l);return await n.writeTextFile?.(u)??{}}case If.fs_read_text_file:{let u=aZt.parse(l);return n.readTextFile?.(u)}case If.session_request_permission:{let u=vZt.parse(l);return n.requestPermission(u)}case If.terminal_create:{let u=ZJt.parse(l);return n.createTerminal?.(u)}case If.terminal_output:{let u=gZt.parse(l);return n.terminalOutput?.(u)}case If.terminal_release:{let u=lZt.parse(l);return await n.releaseTerminal?.(u)??{}}case If.terminal_wait_for_exit:{let u=SZt.parse(l);return n.waitForTerminalExit?.(u)}case If.terminal_kill:{let u=oZt.parse(l);return await n.killTerminal?.(u)??{}}case If.elicitation_create:{if(!n.unstable_createElicitation)throw fo.methodNotFound(c);let u=CZt.parse(l);return n.unstable_createElicitation(u)}default:if(n.extMethod)return n.extMethod(c,l);throw fo.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case If.session_update:{let u=bZt.parse(l);return n.sessionUpdate(u)}case If.elicitation_complete:{if(!n.unstable_completeElicitation)return;let u=UJt.parse(l);return n.unstable_completeElicitation(u)}default:if(n.extNotification)return n.extNotification(c,l);throw fo.methodNotFound(c)}},"notificationHandler");this.connection=new Rrt(o,s,r)}initialize(e){return this.connection.sendRequest(ci.initialize,e)}newSession(e){return this.connection.sendRequest(ci.session_new,e)}loadSession(e){return this.connection.sendRequest(ci.session_load,e,Ew)}unstable_forkSession(e){return this.connection.sendRequest(ci.session_fork,e)}listSessions(e){return this.connection.sendRequest(ci.session_list,e)}unstable_deleteSession(e){return this.connection.sendRequest(ci.session_delete,e,Ew)}resumeSession(e){return this.connection.sendRequest(ci.session_resume,e)}closeSession(e){return this.connection.sendRequest(ci.session_close,e)}setSessionMode(e){return this.connection.sendRequest(ci.session_set_mode,e,Ew)}unstable_setSessionModel(e){return this.connection.sendRequest(ci.session_set_model,e,Ew)}setSessionConfigOption(e){return this.connection.sendRequest(ci.session_set_config_option,e)}authenticate(e){return this.connection.sendRequest(ci.authenticate,e,Ew)}unstable_listProviders(e){return this.connection.sendRequest(ci.providers_list,e)}unstable_setProvider(e){return this.connection.sendRequest(ci.providers_set,e,Ew)}unstable_disableProvider(e){return this.connection.sendRequest(ci.providers_disable,e,Ew)}unstable_logout(e){return this.connection.sendRequest(ci.logout,e,Ew)}prompt(e){return this.connection.sendRequest(ci.session_prompt,e)}cancel(e){return this.connection.sendNotification(ci.session_cancel,e)}unstable_startNes(e){return this.connection.sendRequest(ci.nes_start,e)}unstable_suggestNes(e){return this.connection.sendRequest(ci.nes_suggest,e)}unstable_closeNes(e){return this.connection.sendRequest(ci.nes_close,e,Ew)}unstable_didOpenDocument(e){return this.connection.sendNotification(ci.document_did_open,e)}unstable_didChangeDocument(e){return this.connection.sendNotification(ci.document_did_change,e)}unstable_didCloseDocument(e){return this.connection.sendNotification(ci.document_did_close,e)}unstable_didSaveDocument(e){return this.connection.sendNotification(ci.document_did_save,e)}unstable_didFocusDocument(e){return this.connection.sendNotification(ci.document_did_focus,e)}unstable_acceptNes(e){return this.connection.sendNotification(ci.nes_accept,e)}unstable_rejectNes(e){return this.connection.sendNotification(ci.nes_reject,e)}extMethod(e,r){return this.connection.sendRequest(e,r)}extNotification(e,r){return this.connection.sendNotification(e,r)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}},Rrt=class{static{a(this,"Connection")}pendingResponses=new Map;nextRequestId=0;requestHandler;notificationHandler;stream;writeQueue=Promise.resolve();abortController=new AbortController;closedPromise;constructor(e,r,n){this.requestHandler=e,this.notificationHandler=r,this.stream=n,this.closedPromise=new Promise(o=>{this.abortController.signal.addEventListener("abort",()=>o())}),this.receive()}get signal(){return this.abortController.signal}get closed(){return this.closedPromise}async receive(){let e;try{let r=this.stream.readable.getReader();try{for(;!this.abortController.signal.aborted;){let{value:n,done:o}=await r.read();if(o)break;if(n)try{this.processMessage(n)}catch(s){console.error("Unexpected error during message processing:",n,s),"id"in n&&n.id!==void 0&&this.sendMessage({jsonrpc:"2.0",id:n.id,error:{code:-32700,message:"Parse error"}})}}}finally{r.releaseLock()}}catch(r){e=r}finally{this.close(e)}}close(e){if(this.abortController.signal.aborted)return;let r=e??new Error("ACP connection closed");for(let n of this.pendingResponses.values())n.reject(r);this.pendingResponses.clear(),this.abortController.abort(r)}async processMessage(e){if("method"in e&&"id"in e){let r=await this.tryCallRequestHandler(e.method,e.params);"error"in r&&console.error("Error handling request",e,r.error),await this.sendMessage({jsonrpc:"2.0",id:e.id,...r})}else if("method"in e){let r=await this.tryCallNotificationHandler(e.method,e.params);"error"in r&&console.error("Error handling notification",e,r.error)}else"id"in e?this.handleResponse(e):console.error("Invalid message",{message:e})}async tryCallRequestHandler(e,r){try{return{result:await this.requestHandler(e,r)??null}}catch(n){if(n instanceof fo)return n.toResult();if(n instanceof k.ZodError)return fo.invalidParams(n.format()).toResult();let o;(n instanceof Error||typeof n=="object"&&n!=null&&"message"in n&&typeof n.message=="string")&&(o=n.message);try{return fo.internalError(o?JSON.parse(o):{}).toResult()}catch{return fo.internalError({details:o}).toResult()}}}async tryCallNotificationHandler(e,r){try{return await this.notificationHandler(e,r),{result:null}}catch(n){if(n instanceof fo)return n.toResult();if(n instanceof k.ZodError)return fo.invalidParams(n.format()).toResult();let o;(n instanceof Error||typeof n=="object"&&n!=null&&"message"in n&&typeof n.message=="string")&&(o=n.message);try{return fo.internalError(o?JSON.parse(o):{}).toResult()}catch{return fo.internalError({details:o}).toResult()}}}handleResponse(e){let r=this.pendingResponses.get(e.id);if(r){if("result"in e)r.resolve(e.result);else if("error"in e){let{code:n,message:o,data:s}=e.error;r.reject(new fo(n,o,s))}this.pendingResponses.delete(e.id)}else console.error("Got response to unknown request",e.id)}sendRequest(e,r,n){if(this.abortController.signal.aborted)return t2n(this.closedReason());let o=this.nextRequestId++,s=new Promise((c,l)=>{this.pendingResponses.set(o,{resolve:a(u=>{try{c(n?n(u):u)}catch(d){l(d)}},"resolve"),reject:l})});return s.catch(()=>{}),this.sendMessage({jsonrpc:"2.0",id:o,method:e,params:r}),s}sendNotification(e,r){return this.abortController.signal.aborted?t2n(this.closedReason()):this.sendMessage({jsonrpc:"2.0",method:e,params:r})}closedReason(){return this.abortController.signal.reason??new Error("ACP connection closed")}async sendMessage(e){return this.writeQueue=this.writeQueue.then(async()=>{let r=this.stream.writable.getWriter();try{await r.write(e)}finally{r.releaseLock()}}).catch(r=>{this.close(r)}),this.writeQueue}},fo=class t extends Error{static{a(this,"RequestError")}code;data;constructor(e,r,n){super(r),this.code=e,this.name="RequestError",this.data=n}static parseError(e,r){return new t(-32700,`Parse error${r?`: ${r}`:""}`,e)}static invalidRequest(e,r){return new t(-32600,`Invalid request${r?`: ${r}`:""}`,e)}static methodNotFound(e){return new t(-32601,`"Method not found": ${e}`,{method:e})}static invalidParams(e,r){return new t(-32602,`Invalid params${r?`: ${r}`:""}`,e)}static internalError(e,r){return new t(-32603,`Internal error${r?`: ${r}`:""}`,e)}static authRequired(e,r){return new t(-32e3,`Authentication required${r?`: ${r}`:""}`,e)}static resourceNotFound(e){return new t(-32002,`Resource not found${e?`: ${e}`:""}`,e&&{uri:e})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}};var aCe=require("node:stream");p();Mo();p();var rb=class extends OY{constructor(r){super(new fle,new Map);this.envSettings=new Map;this.env={...r};let n;this.#e=new Promise(s=>{n=s}),this.markReady=n,["DebugOverrideEngine","DebugOverrideProxyUrl","DebugOverrideCapiUrl","DebugUseEditorFetcher","UseSubsetMatching","UseChatLibCompletions","AppendPromptTokenCache","PromptPersistBasePath","AnthropicMessagesEndpoint","EnableCopilotNesNonFree","EnableMapCodeFallback","SearchAgent","UseHelixFetcher","PerfEnabled","TransparentTokenRefresh","AuthTokenEncryption","DisableWorkspaceIndex"].forEach(s=>{for(let c of["AGENT_DEBUG_","GITHUB_COPILOT_","GH_COPILOT_"]){let l=`${c}${wls(s.replace(/^Debug/,""))}`;l in this.env&&this.envSettings.set(Ye[s],this.env[l])}})}static{a(this,"AgentConfigProvider")}#e;async requireReady(){await this.#e}getOptionalOverride(r){return super.getOptionalOverride(r)??this.envSettings.get(r)}};function wls(t){return t.replace(/([a-z])([A-Z]+)/g,"$1_$2").toUpperCase()}a(wls,"camelCaseToSnakeCaseAllCaps");var Rls="unknown-editor",r2n="unknown-editor-plugin",ij=class extends Ir{static{a(this,"AgentEditorInfo")}setEditorAndPluginInfo(e,r,n=[]){this._editorInfo=r,this._editorPluginInfo=e,this._relatedPluginInfo=n}setCopilotIntegrationId(e){this._copilotIntegrationId=e}getEditorInfo(){return this._editorInfo?this._editorInfo:{name:Rls,version:"0"}}getEditorPluginInfo(){return this._editorPluginInfo?this._editorPluginInfo:{name:r2n,version:"0"}}getRelatedPluginInfo(){return this._relatedPluginInfo??[]}getCopilotIntegrationId(){return this._copilotIntegrationId}isEditorPluginInfoKnown(){return this._editorPluginInfo!==void 0&&this._editorPluginInfo.name!==r2n}};p();p();var krt=new fe("agenticTurnProcessor"),WRe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new oc(e.ctx),this.turnSuggestions=new bq(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new p0(e.ctx),this.hookTrigger=new ede(e.ctx,e.conversation,e.turn.workspaceFolders||[])}static{a(this,"AgenticTurnProcessor")}async process(e,r,n,o,s){try{await this.processWithModelAndToolCall(e,r,this.turnContext,n,o,s)}catch(c){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,c);let l=c instanceof Error?c.message:String(c);this.turn.status="error",this.updateTurnResponseWithError(l),c instanceof Error?await this.fireErrorOccurredHook(c):await this.fireErrorOccurredHook(new Error(String(c))),await this.endProgress({error:{message:l,code:ZQ.Unknown,responseIsIncomplete:!0}})}}async processWithModelAndToolCall(e,r,n,o,s,c){if(r.isCancellationRequested)return;await this.conversationProgress.begin(this.conversation,this.turn,e),await this.fireUserPromptSubmittedHook(this.turn.request.message),await this.recordAssistantTurnStart();let l=await tl(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(this.turn.chatMode!==void 0&&!VAn(this.turn.chatMode)){let h=l.extendedBy({mode:this.turn.getChatModeForTelemetry(),modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});Et(this.turnContext.ctx,"customAgent.turn",h),ZI(this.turnContext.ctx,"customAgent.turn",h)}r.onCancellationRequested(async()=>{krt.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});let u=n2().find(h=>h.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let f=(await ew(this.turnContext.ctx)).find(h=>h.slug===this.turn.agent?.agentSlug);await this.collectContext(n,r,l,u,f);try{let h=c?.id,m=c?.providerName,g=m&&h?await hO(this.turnContext.ctx,m,h):await xo.getModelConfigurationById(this.turnContext.ctx,h,this.conversation.id.toString(),iq(this.conversation.turns));xo.applyModelConfigurationOverrides(this.turnContext.ctx,g,c),this.turnContext.setResolvedModelConfiguration(g);try{await this.turnContext.ctx.get(ZC).checkAndCompress(this.conversation,g,"pre-turn",r,String(this.turn.id))}catch(E){ot.exception(this.turnContext.ctx,E,"Pre-turn automatic compression check failed")}await new _de(this.turnContext,this.chatFetcher,g,l).run(r);let y={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let E=await this.fetchSuggestedTitle(r,l.extendedBy({messageSource:"chat.user"},{}));typeof E=="string"&&E!==""&&(y.suggestedTitle=E)}await this.endProgress(y)}catch(h){if(h instanceof $q)krt.info(this.turnContext.ctx,`Tool call canceled for turn ${this.turn.id}`,h),this.turn.status="cancelled",await this.cancelProgress();else if(h instanceof Oc)krt.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,h),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(h instanceof uF)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:{message:h.message,code:ZQ.ToolRoundExceedError,responseIsIncomplete:!0}});else if(h instanceof LA)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:h.conversationError});else throw krt.error(this.turnContext.ctx,`Error in processing turn ${this.turn.id}`,h),h}}async collectContext(e,r,n,o,s){let c=!!s&&typeof s.additionalSkills=="function",l=!!o&&typeof o.requiredSkills=="function";if(!c&&!l)return;let d=await new due(this.turnContext.ctx,this.chatFetcher).collectContext(e,r,n,this.strategy.uiKind,o,s);this.turn.skills=d.skillIds.map(f=>({skillId:f}))}async fetchSuggestedTitle(e,r){let n=await this.turnSuggestions.fetchRawSuggestions(this.turnContext,e,this.strategy.uiKind,r);if(n)return ot.debug(this.turnContext.ctx,"Computed suggested title",n.suggestedTitle),n.suggestedTitle}updateTurnResponseWithError(e){this.turn.response?.message?this.turn.response.message=oq(this.turn.response?.message,{role:"assistant",content:e}):this.turn.response={message:e,type:"meta"}}async endProgress(e){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.recordAssistantTurnEnd(),await this.turnContext.agentToolCalls.finishAll("cancelled"),await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}async handleTemplateResponse(e,r,n){if(!e.response)return;let o=await e.response(this.turnContext,r,n);this.turn.response={type:"meta",message:o.message},this.turn.status=o.error?.responseIsFiltered?"filtered":o.error?.responseIsIncomplete?"error":"success",o.error?.responseIsFiltered||o.error?.responseIsIncomplete?(await this.conversationProgress.report(this.conversation,this.turn,{reply:"Sure, I can definitely do that!",annotations:o.annotations,notifications:o.notifications,references:o.references}),await this.turnContext.steps.finishAll(),await this.endProgress({error:{message:o.message,code:o.error?.code||0,responseIsIncomplete:o.error?.responseIsIncomplete,responseIsFiltered:o.error?.responseIsFiltered}})):(await this.conversationProgress.report(this.conversation,this.turn,{reply:o.message,annotations:o.annotations,notifications:o.notifications,references:o.references,confirmationRequest:o.confirmationRequest}),await this.endProgress())}async recordAssistantTurnStart(){if(this.transcriptPersistence.isEnabled())try{let e=fXe(String(this.turn.id),null);await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,e)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn start transcript: ${e instanceof Error?e.message:String(e)}`)}}async recordAssistantTurnEnd(){if(this.transcriptPersistence.isEnabled())try{let e=this.turn.status==="error"?"error":this.turn.status==="cancelled"?"cancelled":"success",r=Jue(String(this.turn.id),e,null,{turnStatus:this.turn.status});await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn end transcript: ${e instanceof Error?e.message:String(e)}`)}}async fireUserPromptSubmittedHook(e){let r=e??this.turn.request.message;await this.hookTrigger.fireUserPromptSubmittedHook(r,{turn:this.turn,conversationProgress:this.conversationProgress})}async fireErrorOccurredHook(e){await this.hookTrigger.fireErrorOccurredHook(e,{turn:this.turn,conversationProgress:this.conversationProgress})}};p();var wZt="collect-context",RZt="generate-response",Prt=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(Tc),this.chatFetcher=this.chatFetcher??new oc(e.ctx),this.postProcessor=new Eue(e,this.chatFetcher,r.computeSuggestions),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new p0(e.ctx)}static{a(this,"ModelTurnProcessor")}async process(e,r,n,o,s){try{await this.processWithModel(e,r,this.turnContext,n,o,s)}catch(c){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,c);let l=c instanceof Error?c.message:String(c);this.turn.status="error",this.turn.response={message:l,type:"meta"},await this.endProgress({error:{message:l,code:ZQ.Unknown,responseIsIncomplete:!0}})}}async processWithModel(e,r,n,o,s,c){await this.conversationProgress.begin(this.conversation,this.turn,e),await this.recordAssistantTurnStart();let l=await tl(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(l=l.extendedBy({mode:this.turn.getChatModeForTelemetry(),...this.turn.userRequestedModel&&{modelId:this.turn.userRequestedModel}}),r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let u=n2().find(A=>A.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let d=(await ew(this.turnContext.ctx)).find(A=>A.slug===this.turn.agent?.agentSlug);if(d){let A=await this.checkAgentPreconditions(d);if(A){await this.endProgress(A);return}}await n.steps.start(wZt,"Collecting context"),await this.collectContext(n,r,l,this.strategy.uiKind,u,d);let f=c?.id,h=c?.providerName,m;h?m="customized":f?m=(await xo.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),iq(this.conversation.turns))).uiName:m=void 0;let g=await this.strategy.buildConversationPrompt(n,s?.detectedLanguageId??"",void 0,m);if(!g)await n.steps.error(wZt,"Failed to collect context"),await this.endTurnWithResponse(this.strategy.earlyReturnResponse,"error");else{await n.steps.finish(wZt),await n.steps.start(RZt,"Generating response");let A=this.augmentTelemetry(g,l,u,o,s);if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let y=await this.fetchConversationResponse(g.messages,r,l.extendedBy({messageSource:"chat.user"},{promptTokenLen:g.tokens}),A,s,c),E=await this.strategy.processResponse(this.turn);this.turn.status==="cancelled"&&this.turn.response?.type==="user"?await this.cancelProgress():(await this.finishGenerateResponseStep(y,n),await this.endProgress({error:y.error,followUp:y.followup,suggestedTitle:y.suggestedTitle,skillResolutions:g.skillResolutions,updatedDocuments:E}))}}async checkAgentPreconditions(e){try{let r=e.checkPreconditions?await e.checkPreconditions(this.turnContext.ctx,this.turn):void 0;if(r&&r.type==="authorizationRequired")return{unauthorized:{...r,agentName:e.name,agentSlug:e.slug}}}catch(r){ot.error(this.turnContext.ctx,`Error checking preconditions for agent ${e.slug}`,r);let n=r instanceof Error?r.message:String(r);return this.turn.status="error",this.turn.response={message:n,type:"meta"},{error:{message:n,responseIsIncomplete:!0}}}}async endTurnWithResponse(e,r){this.turn.response={type:"meta",message:e},this.turn.status=r,await this.conversationProgress.report(this.conversation,this.turn,{reply:e}),await this.endProgress()}async handleTemplateResponse(e,r,n){if(!e.response)return;let o=await e.response(this.turnContext,r,n);this.turn.response={type:"meta",message:o.message},this.turn.status=o.error?.responseIsFiltered?"filtered":o.error?.responseIsIncomplete?"error":"success",o.error?.responseIsFiltered||o.error?.responseIsIncomplete?(await this.conversationProgress.report(this.conversation,this.turn,{reply:"Sure, I can definitely do that!",annotations:o.annotations,notifications:o.notifications,references:o.references}),await this.turnContext.steps.finishAll(),await this.endProgress({error:{message:o.message,code:o.error?.code||0,responseIsIncomplete:o.error?.responseIsIncomplete,responseIsFiltered:o.error?.responseIsFiltered}})):(await this.conversationProgress.report(this.conversation,this.turn,{reply:o.message,annotations:o.annotations,notifications:o.notifications,references:o.references,confirmationRequest:o.confirmationRequest}),await this.endProgress())}async collectContext(e,r,n,o,s,c){let u=await new due(this.turnContext.ctx,this.chatFetcher).collectContext(e,r,n,o,s,c);return this.turn.skills=u.skillIds.map(d=>({skillId:d})),u}async fetchConversationResponse(e,r,n,o,s,c){r.onCancellationRequested(async()=>{await this.cancelProgress()});let l="",u=0,d=new Iq((E,_,v,b,T,w)=>{let R=E.trim(),x=R.match(Hxe)!==null&&R.endsWith("-->");if(this.conversationProgress.report(this.conversation,this.turn,{reply:E,annotations:_,references:v,hideText:x,notifications:b.map(P=>({severity:"warning",message:P.message})),thinking:w}),this.turn.response?this.turn.response.message=yJe(this.turn.response.message,E):this.turn.response={message:E,type:"model"},this.turn.annotations.push(..._??[]),l+=E,this.strategy.currentDocument){let P=this.strategy.extractEditsFromResponse(l,this.strategy.currentDocument);P&&P.length>0&&(l="",this.conversationProgress.report(this.conversation,this.turn,{codeEdits:P}),u+=P.length)}}),f=c?.id,h=c?.providerName,m=h&&f?await hO(this.turnContext.ctx,h,f):await xo.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),Dyn(e));xo.applyModelConfigurationOverrides(this.turnContext.ctx,m,c),e=xo.transformMessages(e,m.modelFamily),this.turnContext.setResolvedModelConfiguration(m);try{await this.turnContext.ctx.get(ZC).checkAndCompress(this.conversation,m,"pre-turn",r,String(this.turn.id))}catch(E){ot.exception(this.turnContext.ctx,E,"Pre-turn automatic compression check failed")}let g=this.turn.getResolvedModelId();g&&(o=o.extendedBy({modelId:g}));let A={modelConfiguration:m,messages:e,uiKind:this.strategy.uiKind,intentParams:{intent:!0,intent_threshold:.7,intent_content:Pn(this.turn.request.message)},llmInteraction:this.turnContext.toLlmInteraction(),turnId:String(this.turn.id)},y=await this.chatFetcher.fetchResponse(A,r,n,(E,_)=>d.isFinishedAfter(E,_));return o=o.extendedBy(void 0,{numCodeEdits:u}),await this.postProcessor.postProcess(y,r,d.appliedText,n,o,Pn(this.turn.request.message),this.strategy.uiKind,s)}augmentTelemetry(e,r,n,o,s){let c;return o?(this.turn.request.type="follow-up",Tyn(this.turnContext.ctx,this.conversation,this.strategy.uiKind,Pn(this.turn.request.message),e.tokens,o.type,o.id,s,r),c=cxe(this.conversation,this.strategy.uiKind,Pn(this.turn.request.message).length,e.tokens,o.type,o.id,r,e.skillResolutions)):c=cxe(this.conversation,this.strategy.uiKind,Pn(this.turn.request.message).length,e.tokens,n?.id,void 0,r,e.skillResolutions),c}async finishGenerateResponseStep(e,r){e.error?await r.steps.error(RZt,e.error.message):await r.steps.finish(RZt)}async endProgress(e){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}async recordAssistantTurnStart(){if(this.transcriptPersistence.isEnabled())try{let e=fXe(String(this.turn.id),null);await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,e)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn start transcript: ${e instanceof Error?e.message:String(e)}`)}}async recordAssistantTurnEnd(){if(this.transcriptPersistence.isEnabled())try{let e=this.turn.status==="error"?"error":this.turn.status==="cancelled"?"cancelled":"success",r=Jue(String(this.turn.id),e,null,{turnStatus:this.turn.status});await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn end transcript: ${e instanceof Error?e.message:String(e)}`)}}};p();Mo();p();var RYi=de(Xc()),kYi=de(PP());p();p();var Ze={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,ServerNotInitialized:-32002,RequestCancelled:-32800,ContentModified:-32801,ServerCancelled:-32802,NoCopilotToken:1e3,DeviceFlowFailed:1001,CopilotNotAvailable:1002,NoGitHubToken:1003,CodeFlowFailed:1004,NoBrowserAvailable:1005,AuthEnvVarConflict:1006,NoGitHubRepository:1007};var QA=class extends Error{static{a(this,"SchemaValidationError")}constructor(e){super(n2n(e))}};function Oe(t,e){let r=qu.Compile(t);return async(n,o,s)=>{if(!r.Check(s)){let c=n2n(r.Errors(s));return[null,{code:Ze.InvalidParams,message:c}]}return e(n,o,s)}}a(Oe,"addMethodHandlerValidation");function n2n(t){return`Schema validation failed with the following errors: +`,u=t.getWriter();try{await u.write(r.encode(l))}finally{u.releaseLock()}}});return{readable:o,writable:s}}a(lke,"ndJsonStream");function xw(t){return t??{}}a(xw,"emptyObjectResponse");function DDn(t){let e=Promise.reject(t);return e.catch(()=>{}),e}a(DDn,"rejectedPromise");var uke=class{static{a(this,"AgentSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case ai.initialize:{let u=FZt.parse(l);return n.initialize(u)}case ai.session_new:{let u=BZt.parse(l);return n.newSession(u)}case ai.session_load:{if(!n.loadSession)throw lo.methodNotFound(c);let u=ZZt.parse(l);return n.loadSession(u)}case ai.session_list:{if(!n.listSessions)throw lo.methodNotFound(c);let u=NZt.parse(l);return n.listSessions(u)}case ai.session_delete:{if(!n.unstable_deleteSession)throw lo.methodNotFound(c);let u=$Zt.parse(l);return await n.unstable_deleteSession(u)??{}}case ai.session_fork:{if(!n.unstable_forkSession)throw lo.methodNotFound(c);let u=KZt.parse(l);return n.unstable_forkSession(u)}case ai.session_resume:{if(!n.resumeSession)throw lo.methodNotFound(c);let u=rXt.parse(l);return n.resumeSession(u)}case ai.session_close:{if(!n.closeSession)throw lo.methodNotFound(c);let u=HZt.parse(l);return await n.closeSession(u)??{}}case ai.session_set_mode:{if(!n.setSessionMode)throw lo.methodNotFound(c);let u=oXt.parse(l);return await n.setSessionMode(u)??{}}case ai.authenticate:{let u=RZt.parse(l);return await n.authenticate(u)??{}}case ai.providers_list:{if(!n.unstable_listProviders)throw lo.methodNotFound(c);let u=DZt.parse(l);return n.unstable_listProviders(u)}case ai.providers_set:{if(!n.unstable_setProvider)throw lo.methodNotFound(c);let u=nXt.parse(l);return await n.unstable_setProvider(u)??{}}case ai.providers_disable:{if(!n.unstable_disableProvider)throw lo.methodNotFound(c);let u=kZt.parse(l);return await n.unstable_disableProvider(u)??{}}case ai.logout:{if(!n.unstable_logout)throw lo.methodNotFound(c);let u=OZt.parse(l);return await n.unstable_logout(u)??{}}case ai.session_prompt:{let u=dXt.parse(l);return n.prompt(u)}case ai.session_set_model:{if(!n.unstable_setSessionModel)throw lo.methodNotFound(c);let u=sXt.parse(l);return await n.unstable_setSessionModel(u)??{}}case ai.session_set_config_option:{if(!n.setSessionConfigOption)throw lo.methodNotFound(c);let u=iXt.parse(l);return n.setSessionConfigOption(u)}case ai.nes_start:{if(!n.unstable_startNes)throw lo.methodNotFound(c);let u=AXt.parse(l);return n.unstable_startNes(u)}case ai.nes_suggest:{if(!n.unstable_suggestNes)throw lo.methodNotFound(c);let u=aXt.parse(l);return n.unstable_suggestNes(u)}case ai.nes_close:{if(!n.unstable_closeNes)throw lo.methodNotFound(c);let u=jZt.parse(l);return await n.unstable_closeNes(u)??{}}default:if(n.extMethod)return n.extMethod(c,l);throw lo.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case ai.session_cancel:{let u=qZt.parse(l);return n.cancel(u)}case ai.document_did_open:{if(!n.unstable_didOpenDocument)return;let u=zZt.parse(l);return n.unstable_didOpenDocument(u)}case ai.document_did_change:{if(!n.unstable_didChangeDocument)return;let u=lXt.parse(l);return n.unstable_didChangeDocument(u)}case ai.document_did_close:{if(!n.unstable_didCloseDocument)return;let u=VZt.parse(l);return n.unstable_didCloseDocument(u)}case ai.document_did_save:{if(!n.unstable_didSaveDocument)return;let u=YZt.parse(l);return n.unstable_didSaveDocument(u)}case ai.document_did_focus:{if(!n.unstable_didFocusDocument)return;let u=WZt.parse(l);return n.unstable_didFocusDocument(u)}case ai.nes_accept:{if(!n.unstable_acceptNes)return;let u=QZt.parse(l);return n.unstable_acceptNes(u)}case ai.nes_reject:{if(!n.unstable_rejectNes)return;let u=eXt.parse(l);return n.unstable_rejectNes(u)}default:if(n.extNotification)return n.extNotification(c,l);throw lo.methodNotFound(c)}},"notificationHandler");this.connection=new rnt(o,s,r)}sessionUpdate(e){return this.connection.sendNotification(Pf.session_update,e)}requestPermission(e){return this.connection.sendRequest(Pf.session_request_permission,e)}readTextFile(e){return this.connection.sendRequest(Pf.fs_read_text_file,e)}writeTextFile(e){return this.connection.sendRequest(Pf.fs_write_text_file,e,xw)}createTerminal(e){return this.connection.sendRequest(Pf.terminal_create,e,r=>new EXt(r.terminalId,e.sessionId,this.connection))}unstable_createElicitation(e){return this.connection.sendRequest(Pf.elicitation_create,e)}unstable_completeElicitation(e){return this.connection.sendNotification(Pf.elicitation_complete,e)}extMethod(e,r){return this.connection.sendRequest(e,r)}extNotification(e,r){return this.connection.sendNotification(e,r)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}},EXt=class{static{a(this,"TerminalHandle")}id;sessionId;connection;constructor(e,r,n){this.id=e,this.sessionId=r,this.connection=n}currentOutput(){return this.connection.sendRequest(Pf.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}waitForExit(){return this.connection.sendRequest(Pf.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}kill(){return this.connection.sendRequest(Pf.terminal_kill,{sessionId:this.sessionId,terminalId:this.id},xw)}release(){return this.connection.sendRequest(Pf.terminal_release,{sessionId:this.sessionId,terminalId:this.id},xw)}async[Symbol.asyncDispose](){await this.release()}},tnt=class{static{a(this,"ClientSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case Pf.fs_write_text_file:{let u=yXt.parse(l);return await n.writeTextFile?.(u)??{}}case Pf.fs_read_text_file:{let u=XZt.parse(l);return n.readTextFile?.(u)}case Pf.session_request_permission:{let u=pXt.parse(l);return n.requestPermission(u)}case Pf.terminal_create:{let u=GZt.parse(l);return n.createTerminal?.(u)}case Pf.terminal_output:{let u=cXt.parse(l);return n.terminalOutput?.(u)}case Pf.terminal_release:{let u=tXt.parse(l);return await n.releaseTerminal?.(u)??{}}case Pf.terminal_wait_for_exit:{let u=gXt.parse(l);return n.waitForTerminalExit?.(u)}case Pf.terminal_kill:{let u=JZt.parse(l);return await n.killTerminal?.(u)??{}}case Pf.elicitation_create:{if(!n.unstable_createElicitation)throw lo.methodNotFound(c);let u=hXt.parse(l);return n.unstable_createElicitation(u)}default:if(n.extMethod)return n.extMethod(c,l);throw lo.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case Pf.session_update:{let u=mXt.parse(l);return n.sessionUpdate(u)}case Pf.elicitation_complete:{if(!n.unstable_completeElicitation)return;let u=PZt.parse(l);return n.unstable_completeElicitation(u)}default:if(n.extNotification)return n.extNotification(c,l);throw lo.methodNotFound(c)}},"notificationHandler");this.connection=new rnt(o,s,r)}initialize(e){return this.connection.sendRequest(ai.initialize,e)}newSession(e){return this.connection.sendRequest(ai.session_new,e)}loadSession(e){return this.connection.sendRequest(ai.session_load,e,xw)}unstable_forkSession(e){return this.connection.sendRequest(ai.session_fork,e)}listSessions(e){return this.connection.sendRequest(ai.session_list,e)}unstable_deleteSession(e){return this.connection.sendRequest(ai.session_delete,e,xw)}resumeSession(e){return this.connection.sendRequest(ai.session_resume,e)}closeSession(e){return this.connection.sendRequest(ai.session_close,e)}setSessionMode(e){return this.connection.sendRequest(ai.session_set_mode,e,xw)}unstable_setSessionModel(e){return this.connection.sendRequest(ai.session_set_model,e,xw)}setSessionConfigOption(e){return this.connection.sendRequest(ai.session_set_config_option,e)}authenticate(e){return this.connection.sendRequest(ai.authenticate,e,xw)}unstable_listProviders(e){return this.connection.sendRequest(ai.providers_list,e)}unstable_setProvider(e){return this.connection.sendRequest(ai.providers_set,e,xw)}unstable_disableProvider(e){return this.connection.sendRequest(ai.providers_disable,e,xw)}unstable_logout(e){return this.connection.sendRequest(ai.logout,e,xw)}prompt(e){return this.connection.sendRequest(ai.session_prompt,e)}cancel(e){return this.connection.sendNotification(ai.session_cancel,e)}unstable_startNes(e){return this.connection.sendRequest(ai.nes_start,e)}unstable_suggestNes(e){return this.connection.sendRequest(ai.nes_suggest,e)}unstable_closeNes(e){return this.connection.sendRequest(ai.nes_close,e,xw)}unstable_didOpenDocument(e){return this.connection.sendNotification(ai.document_did_open,e)}unstable_didChangeDocument(e){return this.connection.sendNotification(ai.document_did_change,e)}unstable_didCloseDocument(e){return this.connection.sendNotification(ai.document_did_close,e)}unstable_didSaveDocument(e){return this.connection.sendNotification(ai.document_did_save,e)}unstable_didFocusDocument(e){return this.connection.sendNotification(ai.document_did_focus,e)}unstable_acceptNes(e){return this.connection.sendNotification(ai.nes_accept,e)}unstable_rejectNes(e){return this.connection.sendNotification(ai.nes_reject,e)}extMethod(e,r){return this.connection.sendRequest(e,r)}extNotification(e,r){return this.connection.sendNotification(e,r)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}},rnt=class{static{a(this,"Connection")}pendingResponses=new Map;nextRequestId=0;requestHandler;notificationHandler;stream;writeQueue=Promise.resolve();abortController=new AbortController;closedPromise;constructor(e,r,n){this.requestHandler=e,this.notificationHandler=r,this.stream=n,this.closedPromise=new Promise(o=>{this.abortController.signal.addEventListener("abort",()=>o())}),this.receive()}get signal(){return this.abortController.signal}get closed(){return this.closedPromise}async receive(){let e;try{let r=this.stream.readable.getReader();try{for(;!this.abortController.signal.aborted;){let{value:n,done:o}=await r.read();if(o)break;if(n)try{this.processMessage(n)}catch(s){console.error("Unexpected error during message processing:",n,s),"id"in n&&n.id!==void 0&&this.sendMessage({jsonrpc:"2.0",id:n.id,error:{code:-32700,message:"Parse error"}})}}}finally{r.releaseLock()}}catch(r){e=r}finally{this.close(e)}}close(e){if(this.abortController.signal.aborted)return;let r=e??new Error("ACP connection closed");for(let n of this.pendingResponses.values())n.reject(r);this.pendingResponses.clear(),this.abortController.abort(r)}async processMessage(e){if("method"in e&&"id"in e){let r=await this.tryCallRequestHandler(e.method,e.params);"error"in r&&console.error("Error handling request",e,r.error),await this.sendMessage({jsonrpc:"2.0",id:e.id,...r})}else if("method"in e){let r=await this.tryCallNotificationHandler(e.method,e.params);"error"in r&&console.error("Error handling notification",e,r.error)}else"id"in e?this.handleResponse(e):console.error("Invalid message",{message:e})}async tryCallRequestHandler(e,r){try{return{result:await this.requestHandler(e,r)??null}}catch(n){if(n instanceof lo)return n.toResult();if(n instanceof k.ZodError)return lo.invalidParams(n.format()).toResult();let o;(n instanceof Error||typeof n=="object"&&n!=null&&"message"in n&&typeof n.message=="string")&&(o=n.message);try{return lo.internalError(o?JSON.parse(o):{}).toResult()}catch{return lo.internalError({details:o}).toResult()}}}async tryCallNotificationHandler(e,r){try{return await this.notificationHandler(e,r),{result:null}}catch(n){if(n instanceof lo)return n.toResult();if(n instanceof k.ZodError)return lo.invalidParams(n.format()).toResult();let o;(n instanceof Error||typeof n=="object"&&n!=null&&"message"in n&&typeof n.message=="string")&&(o=n.message);try{return lo.internalError(o?JSON.parse(o):{}).toResult()}catch{return lo.internalError({details:o}).toResult()}}}handleResponse(e){let r=this.pendingResponses.get(e.id);if(r){if("result"in e)r.resolve(e.result);else if("error"in e){let{code:n,message:o,data:s}=e.error;r.reject(new lo(n,o,s))}this.pendingResponses.delete(e.id)}else console.error("Got response to unknown request",e.id)}sendRequest(e,r,n){if(this.abortController.signal.aborted)return DDn(this.closedReason());let o=this.nextRequestId++,s=new Promise((c,l)=>{this.pendingResponses.set(o,{resolve:a(u=>{try{c(n?n(u):u)}catch(d){l(d)}},"resolve"),reject:l})});return s.catch(()=>{}),this.sendMessage({jsonrpc:"2.0",id:o,method:e,params:r}),s}sendNotification(e,r){return this.abortController.signal.aborted?DDn(this.closedReason()):this.sendMessage({jsonrpc:"2.0",method:e,params:r})}closedReason(){return this.abortController.signal.reason??new Error("ACP connection closed")}async sendMessage(e){return this.writeQueue=this.writeQueue.then(async()=>{let r=this.stream.writable.getWriter();try{await r.write(e)}finally{r.releaseLock()}}).catch(r=>{this.close(r)}),this.writeQueue}},lo=class t extends Error{static{a(this,"RequestError")}code;data;constructor(e,r,n){super(r),this.code=e,this.name="RequestError",this.data=n}static parseError(e,r){return new t(-32700,`Parse error${r?`: ${r}`:""}`,e)}static invalidRequest(e,r){return new t(-32600,`Invalid request${r?`: ${r}`:""}`,e)}static methodNotFound(e){return new t(-32601,`"Method not found": ${e}`,{method:e})}static invalidParams(e,r){return new t(-32602,`Invalid params${r?`: ${r}`:""}`,e)}static internalError(e,r){return new t(-32603,`Internal error${r?`: ${r}`:""}`,e)}static authRequired(e,r){return new t(-32e3,`Authentication required${r?`: ${r}`:""}`,e)}static resourceNotFound(e){return new t(-32002,`Resource not found${e?`: ${e}`:""}`,e&&{uri:e})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}};var xCe=require("node:stream");p();Mo();p();var ob=class extends WY{constructor(r){super(new _le,new Map);this.envSettings=new Map;this.env={...r};let n;this.#e=new Promise(s=>{n=s}),this.markReady=n,["DebugOverrideEngine","DebugOverrideProxyUrl","DebugOverrideCapiUrl","DebugUseEditorFetcher","UseSubsetMatching","UseChatLibCompletions","AppendPromptTokenCache","PromptPersistBasePath","AnthropicMessagesEndpoint","EnableCopilotNesNonFree","EnableMapCodeFallback","SearchAgent","UseHelixFetcher","PerfEnabled","AuthTokenEncryption","DisableWorkspaceIndex"].forEach(s=>{for(let c of["AGENT_DEBUG_","GITHUB_COPILOT_","GH_COPILOT_"]){let l=`${c}${Nds(s.replace(/^Debug/,""))}`;l in this.env&&this.envSettings.set(ze[s],this.env[l])}})}static{a(this,"AgentConfigProvider")}#e;async requireReady(){await this.#e}getOptionalOverride(r){return super.getOptionalOverride(r)??this.envSettings.get(r)}};function Nds(t){return t.replace(/([a-z])([A-Z]+)/g,"$1_$2").toUpperCase()}a(Nds,"camelCaseToSnakeCaseAllCaps");var Mds="unknown-editor",NDn="unknown-editor-plugin",Aj=class extends Ir{static{a(this,"AgentEditorInfo")}setEditorAndPluginInfo(e,r,n=[]){this._editorInfo=r,this._editorPluginInfo=e,this._relatedPluginInfo=n}setCopilotIntegrationId(e){this._copilotIntegrationId=e}getEditorInfo(){return this._editorInfo?this._editorInfo:{name:Mds,version:"0"}}getEditorPluginInfo(){return this._editorPluginInfo?this._editorPluginInfo:{name:NDn,version:"0"}}getRelatedPluginInfo(){return this._relatedPluginInfo??[]}getCopilotIntegrationId(){return this._copilotIntegrationId}isEditorPluginInfoKnown(){return this._editorPluginInfo!==void 0&&this._editorPluginInfo.name!==NDn}};p();p();var nnt=new pe("agenticTurnProcessor"),fke=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(wc),this.chatFetcher=this.chatFetcher??new cc(e.ctx),this.turnSuggestions=new Lq(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new g0(e.ctx),this.hookTrigger=new dde(e.ctx,e.conversation,e.turn.workspaceFolders||[])}static{a(this,"AgenticTurnProcessor")}async process(e,r,n,o,s){try{await this.processWithModelAndToolCall(e,r,this.turnContext,n,o,s)}catch(c){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,c);let l=c instanceof Error?c.message:String(c);this.turn.status="error",this.updateTurnResponseWithError(l),c instanceof Error?await this.fireErrorOccurredHook(c):await this.fireErrorOccurredHook(new Error(String(c))),await this.endProgress({error:{message:l,code:uq.Unknown,responseIsIncomplete:!0}})}}async processWithModelAndToolCall(e,r,n,o,s,c){if(r.isCancellationRequested)return;await this.conversationProgress.begin(this.conversation,this.turn,e),await this.fireUserPromptSubmittedHook(this.turn.request.message),await this.recordAssistantTurnStart();let l=await rl(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(this.turn.chatMode!==void 0&&!CEn(this.turn.chatMode)){let h=l.extendedBy({mode:this.turn.getChatModeForTelemetry(),modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});ft(this.turnContext.ctx,"customAgent.turn",h),ox(this.turnContext.ctx,"customAgent.turn",h)}r.onCancellationRequested(async()=>{nnt.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});let u=d2().find(h=>h.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let f=(await aw(this.turnContext.ctx)).find(h=>h.slug===this.turn.agent?.agentSlug);await this.collectContext(n,r,l,u,f);try{let h=c?.id,m=c?.providerName,g=m&&h?await _O(this.turnContext.ctx,m,h):await xo.getModelConfigurationById(this.turnContext.ctx,h,this.conversation.id.toString(),Aq(this.conversation.turns));xo.applyModelConfigurationOverrides(this.turnContext.ctx,g,c),this.turnContext.setResolvedModelConfiguration(g);try{await this.turnContext.ctx.get(tb).checkAndCompress(this.conversation,g,"pre-turn",r,String(this.turn.id))}catch(E){ot.exception(this.turnContext.ctx,E,"Pre-turn automatic compression check failed")}await new Pde(this.turnContext,this.chatFetcher,g,l).run(r);let y={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let E=await this.fetchSuggestedTitle(r,l.extendedBy({messageSource:"chat.user"},{}));typeof E=="string"&&E!==""&&(y.suggestedTitle=E)}await this.endProgress(y)}catch(h){if(h instanceof ij)nnt.info(this.turnContext.ctx,`Tool call canceled for turn ${this.turn.id}`,h),this.turn.status="cancelled",await this.cancelProgress();else if(h instanceof Uc)nnt.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,h),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(h instanceof yF)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:{message:h.message,code:uq.ToolRoundExceedError,responseIsIncomplete:!0}});else if(h instanceof UA)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:h.conversationError});else throw nnt.error(this.turnContext.ctx,`Error in processing turn ${this.turn.id}`,h),h}}async collectContext(e,r,n,o,s){let c=!!s&&typeof s.additionalSkills=="function",l=!!o&&typeof o.requiredSkills=="function";if(!c&&!l)return;let d=await new vue(this.turnContext.ctx,this.chatFetcher).collectContext(e,r,n,this.strategy.uiKind,o,s);this.turn.skills=d.skillIds.map(f=>({skillId:f}))}async fetchSuggestedTitle(e,r){let n=await this.turnSuggestions.fetchRawSuggestions(this.turnContext,e,this.strategy.uiKind,r);if(n)return ot.debug(this.turnContext.ctx,"Computed suggested title",n.suggestedTitle),n.suggestedTitle}updateTurnResponseWithError(e){this.turn.response?.message?this.turn.response.message=yq(this.turn.response?.message,{role:"assistant",content:e}):this.turn.response={message:e,type:"meta"}}async endProgress(e){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.recordAssistantTurnEnd(),await this.turnContext.agentToolCalls.finishAll("cancelled"),await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}async handleTemplateResponse(e,r,n){if(!e.response)return;let o=await e.response(this.turnContext,r,n);this.turn.response={type:"meta",message:o.message},this.turn.status=o.error?.responseIsFiltered?"filtered":o.error?.responseIsIncomplete?"error":"success",o.error?.responseIsFiltered||o.error?.responseIsIncomplete?(await this.conversationProgress.report(this.conversation,this.turn,{reply:"Sure, I can definitely do that!",annotations:o.annotations,notifications:o.notifications,references:o.references}),await this.turnContext.steps.finishAll(),await this.endProgress({error:{message:o.message,code:o.error?.code||0,responseIsIncomplete:o.error?.responseIsIncomplete,responseIsFiltered:o.error?.responseIsFiltered}})):(await this.conversationProgress.report(this.conversation,this.turn,{reply:o.message,annotations:o.annotations,notifications:o.notifications,references:o.references,confirmationRequest:o.confirmationRequest}),await this.endProgress())}async recordAssistantTurnStart(){if(this.transcriptPersistence.isEnabled())try{let e=QXe(String(this.turn.id),null);await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,e)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn start transcript: ${e instanceof Error?e.message:String(e)}`)}}async recordAssistantTurnEnd(){if(this.transcriptPersistence.isEnabled())try{let e=this.turn.status==="error"?"error":this.turn.status==="cancelled"?"cancelled":"success",r=cde(String(this.turn.id),e,null,{turnStatus:this.turn.status});await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn end transcript: ${e instanceof Error?e.message:String(e)}`)}}async fireUserPromptSubmittedHook(e){let r=e??this.turn.request.message;await this.hookTrigger.fireUserPromptSubmittedHook(r,{turn:this.turn,conversationProgress:this.conversationProgress})}async fireErrorOccurredHook(e){await this.hookTrigger.fireErrorOccurredHook(e,{turn:this.turn,conversationProgress:this.conversationProgress})}};p();var _Xt="collect-context",vXt="generate-response",int=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(wc),this.chatFetcher=this.chatFetcher??new cc(e.ctx),this.postProcessor=new kue(e,this.chatFetcher,r.computeSuggestions),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new g0(e.ctx)}static{a(this,"ModelTurnProcessor")}async process(e,r,n,o,s){try{await this.processWithModel(e,r,this.turnContext,n,o,s)}catch(c){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,c);let l=c instanceof Error?c.message:String(c);this.turn.status="error",this.turn.response={message:l,type:"meta"},await this.endProgress({error:{message:l,code:uq.Unknown,responseIsIncomplete:!0}})}}async processWithModel(e,r,n,o,s,c){await this.conversationProgress.begin(this.conversation,this.turn,e),await this.recordAssistantTurnStart();let l=await rl(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(l=l.extendedBy({mode:this.turn.getChatModeForTelemetry(),...this.turn.userRequestedModel&&{modelId:this.turn.userRequestedModel}}),r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let u=d2().find(A=>A.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let d=(await aw(this.turnContext.ctx)).find(A=>A.slug===this.turn.agent?.agentSlug);if(d){let A=await this.checkAgentPreconditions(d);if(A){await this.endProgress(A);return}}await n.steps.start(_Xt,"Collecting context"),await this.collectContext(n,r,l,this.strategy.uiKind,u,d);let f=c?.id,h=c?.providerName,m;h?m="customized":f?m=(await xo.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),Aq(this.conversation.turns))).uiName:m=void 0;let g=await this.strategy.buildConversationPrompt(n,s?.detectedLanguageId??"",void 0,m);if(!g)await n.steps.error(_Xt,"Failed to collect context"),await this.endTurnWithResponse(this.strategy.earlyReturnResponse,"error");else{await n.steps.finish(_Xt),await n.steps.start(vXt,"Generating response");let A=this.augmentTelemetry(g,l,u,o,s);if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let y=await this.fetchConversationResponse(g.messages,r,l.extendedBy({messageSource:"chat.user"},{promptTokenLen:g.tokens}),A,s,c),E=await this.strategy.processResponse(this.turn);this.turn.status==="cancelled"&&this.turn.response?.type==="user"?await this.cancelProgress():(await this.finishGenerateResponseStep(y,n),await this.endProgress({error:y.error,followUp:y.followup,suggestedTitle:y.suggestedTitle,skillResolutions:g.skillResolutions,updatedDocuments:E}))}}async checkAgentPreconditions(e){try{let r=e.checkPreconditions?await e.checkPreconditions(this.turnContext.ctx,this.turn):void 0;if(r&&r.type==="authorizationRequired")return{unauthorized:{...r,agentName:e.name,agentSlug:e.slug}}}catch(r){ot.error(this.turnContext.ctx,`Error checking preconditions for agent ${e.slug}`,r);let n=r instanceof Error?r.message:String(r);return this.turn.status="error",this.turn.response={message:n,type:"meta"},{error:{message:n,responseIsIncomplete:!0}}}}async endTurnWithResponse(e,r){this.turn.response={type:"meta",message:e},this.turn.status=r,await this.conversationProgress.report(this.conversation,this.turn,{reply:e}),await this.endProgress()}async handleTemplateResponse(e,r,n){if(!e.response)return;let o=await e.response(this.turnContext,r,n);this.turn.response={type:"meta",message:o.message},this.turn.status=o.error?.responseIsFiltered?"filtered":o.error?.responseIsIncomplete?"error":"success",o.error?.responseIsFiltered||o.error?.responseIsIncomplete?(await this.conversationProgress.report(this.conversation,this.turn,{reply:"Sure, I can definitely do that!",annotations:o.annotations,notifications:o.notifications,references:o.references}),await this.turnContext.steps.finishAll(),await this.endProgress({error:{message:o.message,code:o.error?.code||0,responseIsIncomplete:o.error?.responseIsIncomplete,responseIsFiltered:o.error?.responseIsFiltered}})):(await this.conversationProgress.report(this.conversation,this.turn,{reply:o.message,annotations:o.annotations,notifications:o.notifications,references:o.references,confirmationRequest:o.confirmationRequest}),await this.endProgress())}async collectContext(e,r,n,o,s,c){let u=await new vue(this.turnContext.ctx,this.chatFetcher).collectContext(e,r,n,o,s,c);return this.turn.skills=u.skillIds.map(d=>({skillId:d})),u}async fetchConversationResponse(e,r,n,o,s,c){r.onCancellationRequested(async()=>{await this.cancelProgress()});let l="",u=0,d=new Uq((E,_,v,b,T,w)=>{let R=E.trim(),x=R.match(cwe)!==null&&R.endsWith("-->");if(this.conversationProgress.report(this.conversation,this.turn,{reply:E,annotations:_,references:v,hideText:x,notifications:b.map(P=>({severity:"warning",message:P.message})),thinking:w}),this.turn.response?this.turn.response.message=VJe(this.turn.response.message,E):this.turn.response={message:E,type:"model"},this.turn.annotations.push(..._??[]),l+=E,this.strategy.currentDocument){let P=this.strategy.extractEditsFromResponse(l,this.strategy.currentDocument);P&&P.length>0&&(l="",this.conversationProgress.report(this.conversation,this.turn,{codeEdits:P}),u+=P.length)}}),f=c?.id,h=c?.providerName,m=h&&f?await _O(this.turnContext.ctx,h,f):await xo.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),c_n(e));xo.applyModelConfigurationOverrides(this.turnContext.ctx,m,c),e=xo.transformMessages(e,m.modelFamily),this.turnContext.setResolvedModelConfiguration(m);try{await this.turnContext.ctx.get(tb).checkAndCompress(this.conversation,m,"pre-turn",r,String(this.turn.id))}catch(E){ot.exception(this.turnContext.ctx,E,"Pre-turn automatic compression check failed")}let g=this.turn.getResolvedModelId();g&&(o=o.extendedBy({modelId:g}));let A={modelConfiguration:m,messages:e,uiKind:this.strategy.uiKind,intentParams:{intent:!0,intent_threshold:.7,intent_content:Pn(this.turn.request.message)},llmInteraction:this.turnContext.toLlmInteraction(),turnId:String(this.turn.id)},y=await this.chatFetcher.fetchResponse(A,r,n,(E,_)=>d.isFinishedAfter(E,_));return o=o.extendedBy(void 0,{numCodeEdits:u}),await this.postProcessor.postProcess(y,r,d.appliedText,n,o,Pn(this.turn.request.message),this.strategy.uiKind,s)}augmentTelemetry(e,r,n,o,s){let c;return o?(this.turn.request.type="follow-up",t_n(this.turnContext.ctx,this.conversation,this.strategy.uiKind,Pn(this.turn.request.message),e.tokens,o.type,o.id,s,r),c=wxe(this.conversation,this.strategy.uiKind,Pn(this.turn.request.message).length,e.tokens,o.type,o.id,r,e.skillResolutions)):c=wxe(this.conversation,this.strategy.uiKind,Pn(this.turn.request.message).length,e.tokens,n?.id,void 0,r,e.skillResolutions),c}async finishGenerateResponseStep(e,r){e.error?await r.steps.error(vXt,e.error.message):await r.steps.finish(vXt)}async endProgress(e){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}async recordAssistantTurnStart(){if(this.transcriptPersistence.isEnabled())try{let e=QXe(String(this.turn.id),null);await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,e)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn start transcript: ${e instanceof Error?e.message:String(e)}`)}}async recordAssistantTurnEnd(){if(this.transcriptPersistence.isEnabled())try{let e=this.turn.status==="error"?"error":this.turn.status==="cancelled"?"cancelled":"success",r=cde(String(this.turn.id),e,null,{turnStatus:this.turn.status});await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn end transcript: ${e instanceof Error?e.message:String(e)}`)}}};p();Mo();p();var wJi=fe(Fc()),RJi=fe(QP());p();p();var Xe={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,ServerNotInitialized:-32002,RequestCancelled:-32800,ContentModified:-32801,ServerCancelled:-32802,NoCopilotToken:1e3,DeviceFlowFailed:1001,CopilotNotAvailable:1002,NoGitHubToken:1003,CodeFlowFailed:1004,NoBrowserAvailable:1005,AuthEnvVarConflict:1006,NoGitHubRepository:1007};var HA=class extends Error{static{a(this,"SchemaValidationError")}constructor(e){super(MDn(e))}};function xe(t,e){let r=$u.Compile(t);return async(n,o,s)=>{if(!r.Check(s)){let c=MDn(r.Errors(s));return[null,{code:Xe.InvalidParams,message:c}]}return e(n,o,s)}}a(xe,"addMethodHandlerValidation");function MDn(t){return`Schema validation failed with the following errors: ${Array.from(t).map(r=>`- ${r.path}: ${r.message}`).join(` -`)}`}a(n2n,"createErrorMessage");p();p();p();p();function Drt(t){let e=t.capabilities.supports?.reasoning_effort,r=!!e&&e.length>0,n=t.capabilities.supports,o=t.capabilities.limits,s=t.billing,c=s&&{...s.multiplier!==void 0?{multiplier:s.multiplier}:{},...s.token_prices!==void 0?{token_prices:s.token_prices}:{}},l=!!c&&Object.keys(c).length>0;return{id:t.id,name:t.name,...t.preview!==void 0?{preview:t.preview}:{},...t.vendor!==void 0?{vendor:t.vendor}:{},...t.model_picker_category!==void 0?{model_picker_category:t.model_picker_category}:{},...t.model_picker_price_category!==void 0?{model_picker_price_category:t.model_picker_price_category}:{},...t.supported_endpoints!==void 0?{supported_endpoints:t.supported_endpoints}:{},...t.policy!==void 0?{policy:t.policy}:{},...l?{billing:c}:{},...t.custom_model!==void 0?{custom_model:t.custom_model}:{},...t.warning_messages!==void 0?{warning_messages:t.warning_messages}:{},capabilities:{family:t.capabilities.family,supports:{...n?.streaming!==void 0?{streaming:n.streaming}:{},...n?.tool_calls!==void 0?{tool_calls:n.tool_calls}:{},...n?.vision!==void 0?{vision:n.vision}:{},...e!==void 0?{reasoning_effort:e}:{},reasoningEffort:r},limits:{...o?.max_prompt_tokens!==void 0?{max_prompt_tokens:o.max_prompt_tokens}:{},...o?.max_output_tokens!==void 0?{max_output_tokens:o.max_output_tokens}:{},max_context_window_tokens:o?.max_context_window_tokens??0}},...e!==void 0?{supportedReasoningEfforts:e}:{},...r?{defaultReasoningEffort:mO(e)}:{}}}a(Drt,"toAgentModelInfo");p();var i2n=new fe("BackgroundAgent.AuthBinding"),Nrt=class{constructor(e){this.ctx=e}static{a(this,"AuthBinding")}async buildAuthInfo(){let r=await this.ctx.get(Ur).resolveSession();if(!r)throw new Error("Not authenticated. Please sign in first.");let n=r.serverUrl.replace(/\/+$/,"")||"https://github.com",o;try{let l=(await this.ctx.get(Qt).getToken()).endpoints.api;l&&(o={endpoints:{api:l}})}catch(s){i2n.warn(this.ctx,"Could not retrieve CopilotToken endpoints for SDK authInfo",{error:s instanceof Error?s.message:String(s)})}return{type:"token",token:r.accessToken,host:n,...o&&{copilotUser:o}}}async detectIdentityChange(){let e;try{e=(await this.ctx.get(Ur).resolveSession())?.accessToken}catch(o){return i2n.warn(this.ctx,"Failed to read GitHub session on auth change; skipping cache invalidation",{error:o instanceof Error?o.message:String(o)}),{changed:!1,hadPrevious:this.lastAccessToken!==void 0,hasCurrent:!1}}let r=this.lastAccessToken!==void 0,n=e!==void 0;return this.lastAccessToken===e?{changed:!1,hadPrevious:r,hasCurrent:n}:(this.lastAccessToken=e,{changed:!0,hadPrevious:r,hasCurrent:n})}setObservedAccessTokenForTesting(e){this.lastAccessToken=e}getLastAccessTokenForTesting(){return this.lastAccessToken}};p();var kls=new fe("BackgroundAgent.Attachments");function o2n(t,e){let r=[];for(let n of t){let o=Pls(n);o?r.push(o):kls.debug(e,`Skipping unsupported reference type for SDK attachment: ${n.type}`)}return r}a(o2n,"convertReferencesToAttachments");function Pls(t){switch(t.type){case"file":{let e=to(t.uri).fsPath;return t.selection?{type:"selection",filePath:e,displayName:e,text:"",selection:{start:{line:t.selection.start.line,character:t.selection.start.character},end:{line:t.selection.end.line,character:t.selection.end.character}}}:{type:"file",path:e,displayName:e}}case"directory":{let e=to(t.uri).fsPath;return{type:"directory",path:e,displayName:e}}default:return null}}a(Pls,"convertReferenceToAttachment");p();var UJ=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredServiceError"}static{a(this,"StructuredServiceError")}};function kZt(t,e=100){if(!(t instanceof Error))return;let r=[],n=new Set,o=t.cause,s=0;for(;o instanceof Error&&!n.has(o)&&s0?r.join(": "):void 0}a(kZt,"describeCauseChain");function Mrt(t){let e=t instanceof Error?t.message:String(t),r=kZt(t);return r?`${e} (cause: ${r})`:e}a(Mrt,"formatErrorWithCause");var zRe=class extends UJ{static{a(this,"BYOKMisconfiguredError")}constructor(e,r,n){let o={kind:"byokMisconfigured",providerName:r,modelId:n};super(e,o),this.name="BYOKMisconfiguredError"}},YRe=class extends UJ{static{a(this,"BYOKDisabledError")}constructor(e,r,n){let o={kind:"byokDisabled",providerName:r,modelId:n};super(e,o),this.name="BYOKDisabledError"}};p();function s2n(t,e){switch(e.type){case"permission":t.respondToPermission(e.requestId,e.result);break;case"user_input":t.respondToUserInput(e.requestId,e.response);break;case"elicitation":t.respondToElicitation(e.requestId,e.response);break;case"exit_plan_mode":t.respondToExitPlanMode(e.requestId,e.response);break;case"queued_command":t.respondToQueuedCommand(e.requestId,e.result);break;case"external_tool":t.respondToExternalTool(e.requestId,e.result);break;default:throw new Error(`Unknown interaction type: ${e.type}`)}return{success:!0}}a(s2n,"routeInteraction");p();var a2n=new fe("BackgroundAgent.OTelEnv"),PZt=new Map,DZt=new Set;function Ort(t,e){process.env[t]||(PZt.has(t)||PZt.set(t,process.env[t]),process.env[t]=e,DZt.add(t))}a(Ort,"setEnvIfAbsent");function c2n(){for(let t of DZt){let e=PZt.get(t);e===void 0?delete process.env[t]:process.env[t]=e}DZt.clear()}a(c2n,"restoreOTelEnvironment");function l2n(t){if(!t.get(bn).getCapabilities().agentDebugLog)return;process.env.COPILOT_OTEL_ENABLED&&process.env.COPILOT_OTEL_ENABLED!=="true"&&a2n.info(t,"COPILOT_OTEL_ENABLED already set by user, skipping OTel env setup",{value:process.env.COPILOT_OTEL_ENABLED}),Ort("COPILOT_OTEL_ENABLED","true");let e=!!process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||!!process.env.OTEL_EXPORTER_OTLP_ENDPOINT,r=process.env.COPILOT_OTEL_EXPORTER_TYPE==="file";!e&&!r&&(Ort("COPILOT_OTEL_EXPORTER_TYPE","file"),Ort("COPILOT_OTEL_FILE_EXPORTER_PATH",process.platform==="win32"?"NUL":"/dev/null"),Ort("OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT","true")),a2n.info(t,"Applied OTel environment for SDK bridge",{userConfiguredOtlpEndpoint:e,userConfiguredFileExporter:r})}a(l2n,"applyOTelEnvironment");p();p();var i8n=de(require("crypto")),o8n=de(require("fs")),dot=de(r8n()),s8n=require("tls"),a8n=de(n8n());var epe=new fe("certificates"),pp=class{static{a(this,"RootCertificateReader")}};function fot(t,e=process.platform){return new onr(t,[new snr,new anr,kSs(t,e)])}a(fot,"getRootCertificateReader");function kSs(t,e){switch(e){case"linux":return new cnr(t);case"darwin":return new lnr(t);case"win32":return new unr(t);default:return new dnr}}a(kSs,"createPlatformReader");var inr=class extends pp{constructor(r,n){super();this.ctx=r;this.delegate=n}static{a(this,"ErrorHandlingCertificateReader")}async getAllRootCAs(){try{return await this.delegate.getAllRootCAs()}catch(r){return epe.warn(this.ctx,"Failed to read root certificates:",r),[]}}},onr=class extends pp{constructor(r,n){super();this.ctx=r;this.delegates=n.map(o=>new inr(r,o))}static{a(this,"CachingRootCertificateReader")}async getAllRootCAs(){return this.certificates||(this.certificates=this.removeExpiredCertificates((await Promise.all(this.delegates.map(r=>r.getAllRootCAs()))).flat())),this.certificates}removeExpiredCertificates(r){let n=Date.now(),o=r.filter(s=>{try{let c=new i8n.X509Certificate(s),l=Date.parse(c.validTo);return isNaN(l)||l>n}catch(c){return epe.warn(this.ctx,"Failed to parse certificate",s,c),!1}});return r.length!==o.length&&epe.info(this.ctx,`Removed ${r.length-o.length} expired certificates`),o}},snr=class extends pp{static{a(this,"NodeTlsRootCertificateReader")}getAllRootCAs(){return s8n.rootCertificates}},anr=class extends pp{static{a(this,"EnvironmentVariableRootCertificateReader")}async getAllRootCAs(){let e=process.env.NODE_EXTRA_CA_CERTS;return e?await c8n(e):[]}},cnr=class extends pp{constructor(r){super();this.ctx=r}static{a(this,"LinuxRootCertificateReader")}async getAllRootCAs(){let r=[];for(let n of["/etc/ssl/certs/ca-certificates.crt","/etc/ssl/certs/ca-bundle.crt"]){let o=await c8n(n);epe.debug(this.ctx,`Read ${o.length} certificates from ${n}`),r=r.concat(o)}return r}},lnr=class extends pp{constructor(r){super();this.ctx=r}static{a(this,"MacRootCertificateReader")}getAllRootCAs(){let r=dot.get({excludeBundled:!1,format:dot.Format.pem});return epe.debug(this.ctx,`Read ${r.length} certificates from Mac keychain`),r}},unr=class extends pp{constructor(r){super();this.ctx=r}static{a(this,"WindowsRootCertificateReader")}getAllRootCAs(){let r=a8n.all();return epe.debug(this.ctx,`Read ${r.length} certificates from Windows store`),r}},dnr=class extends pp{static{a(this,"UnsupportedPlatformRootCertificateReader")}getAllRootCAs(){return Promise.reject(new Error("No certificate reader available for unsupported platform"))}};async function c8n(t){let e;try{e=await o8n.promises.readFile(t,{encoding:"utf8"})}catch{return[]}let r=e.match(/-----BEGIN CERTIFICATE-----[\s\S]*?-----END CERTIFICATE-----/g);if(!r)return[];let n=r.filter(s=>s.length>0),o=new Set(n);return Array.from(o)}a(c8n,"readCertsFromFile");var oH=de($ar());var War=new fe("BackgroundAgent.ProxyEnv"),zar=new Map,Yar=new Set,A2e;function Kar(){for(let t of Yar){let e=zar.get(t);e===void 0?delete process.env[t]:process.env[t]=e}Yar.clear(),A2e&&((0,oH.setGlobalDispatcher)(A2e),A2e=void 0)}a(Kar,"restoreProxyEnvironment");function Var(t,e,r){process.env[t]||process.env[e]||(zar.has(t)||zar.set(t,process.env[t]),process.env[t]=r,Yar.add(t))}a(Var,"setEnvIfAbsent");function QBs(t,e){if(!e)return t;try{let r=new URL(t),n=e.indexOf(":"),o=n===-1?e:e.slice(0,n),s=n===-1?"":e.slice(n+1);return o&&(r.username=encodeURIComponent(o),s&&(r.password=encodeURIComponent(s))),r.toString()}catch{return t}}a(QBs,"buildProxyUrl");async function qBs(t,e){if(e===!1){let r={rejectUnauthorized:!1};return{requestTls:r,proxyTls:r}}try{let r=await t.get(pp).getAllRootCAs();if(r.length>0){let n={ca:r};return{requestTls:n,proxyTls:n}}}catch{War.warn(t,"Failed to load system CA certificates for SDK proxy dispatcher")}return{}}a(qBs,"buildTlsOptions");async function uat(t){try{Kar();let e=t.get(Lo).getHttpSettings();if(!e.proxy)return;let r=QBs(e.proxy,e.proxyAuthorization);Var("HTTPS_PROXY","https_proxy",r),Var("HTTP_PROXY","http_proxy",r);let n=e.noProxy?.length?e.noProxy.join(","):void 0;n&&Var("NO_PROXY","no_proxy",n),A2e||(A2e=(0,oH.getGlobalDispatcher)());let o=await qBs(t,e.proxyStrictSSL);(0,oH.setGlobalDispatcher)(new oH.EnvHttpProxyAgent({allowH2:!0,httpProxy:r,httpsProxy:r,noProxy:n,...o})),War.info(t,"Applied proxy settings to environment for SDK",{hasProxy:!0,hasAuth:!!e.proxyAuthorization,hasNoProxy:!!n,proxyStrictSSL:e.proxyStrictSSL!==!1,hasTlsCa:!!o.requestTls,dispatcherType:(0,oH.getGlobalDispatcher)().constructor.name})}catch(e){War.warn(t,"Failed to apply proxy settings to environment:",e)}}a(uat,"applyProxyToEnvironment");p();var jBs=["read_file","view","grep_search","file_search","semantic_search","grep","rg","glob","tool_search_tool_regex","fetch_copilot_cli_documentation","think"],dat=["get_errors"],Jar=[...dat,"edit","str_replace_editor","apply_patch"],HBs=["ask","inline-ask","inline"];function fat(t){return t!==void 0&&HBs.includes(t)}a(fat,"isClampedChatMode");var GBs={ask:jBs,inline:Jar,"inline-ask":dat};async function MGn(t,e,r){let n,o,s,c;e==="agent"?(n=null,o=await r.loadCustomAgents(),s=new Set(await r.getPolicyDisabledSkillNames()),c=await r.getMcpServers()):(n=[...GBs[e]],o=[],s=new Set(await r.getAllLoadedSkillNames()),c={});let l={availableTools:n,customAgents:o,disabledSkills:s,mcpServers:c};t.updateOptions(l,{emitToolDefinitionsChanged:!0})}a(MGn,"applyChatMode");p();var wT=de(require("node:path"));var BGn="copilot-language-server:inline-chat",$Bs=["file","path","filePath","file_path"],VBs=new Set(["edit","create","str_replace_editor","write"]),WBs=new Set(["git_apply_patch"]),OGn=/^\*\*\* (?:Add File|Delete File|Update File|Move to): (.+)$/gm;function zBs(t){let e=wT.dirname(t);return{confinedFsPath:t,confinedName:wT.basename(t),baseDir:e,confinedComparable:Zar(t,e)}}a(zBs,"buildContext");function YBs(t){if(typeof t=="string")try{let e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}return t&&typeof t=="object"?t:{}}a(YBs,"parseToolArgs");function KBs(t){if(typeof t=="string")return t;if(t&&typeof t=="object"){let e=t;if(typeof e.input=="string")return e.input;if(typeof e.patch=="string")return e.patch}}a(KBs,"extractApplyPatchBody");function JBs(t){if(!t.includes("*** Begin Patch"))return;let e=[];OGn.lastIndex=0;for(let r of t.matchAll(OGn)){let n=r[1].trim();n.length>0&&e.push(n)}return e}a(JBs,"extractApplyPatchPaths");function ZBs(t){for(let e of $Bs){let r=t[e];if(typeof r=="string"&&r.trim().length>0)return r}}a(ZBs,"extractTargetPath");function Zar(t,e){let r=t.startsWith("file:")?un(t):t,n=wT.isAbsolute(r)?wT.normalize(r):wT.resolve(e,r);return process.platform==="win32"||process.platform==="darwin"?n.toLowerCase():n}a(Zar,"toComparablePath");function LGn(t,e){return wT.isAbsolute(t)?wT.normalize(t):wT.resolve(e,t)}a(LGn,"resolveTargetPath");function XBs(t,e,r){if(WBs.has(t))return{allowed:!1,reason:`Inline chat may only edit ${r.confinedName}. The ${t} tool cannot be confined to a single file and is not available in inline chat.`};if(t==="apply_patch"){let o=KBs(e);if(o===void 0)return{allowed:!1,reason:`Inline chat denied an apply_patch call with no readable patch body. Only ${r.confinedName} may be edited.`};let s=JBs(o);if(s===void 0)return{allowed:!1,reason:`Inline chat denied an apply_patch call whose body could not be parsed. Only ${r.confinedName} may be edited.`};if(s.length===0)return{allowed:!1,reason:`Inline chat denied an apply_patch call with no file headers. Only ${r.confinedName} may be edited.`};for(let c of s)if(Zar(c,r.baseDir)!==r.confinedComparable)return{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${LGn(c,r.baseDir)} (apply_patch header: ${c}).`};return{allowed:!0}}if(!VBs.has(t))return{allowed:!0};let n=ZBs(YBs(e));return n?Zar(n,r.baseDir)!==r.confinedComparable?{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${LGn(n,r.baseDir)} (${t} arg: ${n}).`}:{allowed:!0}:{allowed:!1,reason:`Inline chat denied a ${t} call with no resolvable file path. Only ${r.confinedName} may be edited.`}}a(XBs,"evaluateWithContext");function FGn(t){let e=0;return{hook:{source:BGn,handler:a(()=>e>t?Promise.resolve({permissionDecision:"deny",permissionDecisionReason:`Inline chat is limited to ${t} tool-calling turns. No further tool calls are allowed.`}):Promise.resolve(),"handler")},onTurnStart(){e++},reset(){e=0}}}a(FGn,"createInlineTurnLimitHook");function UGn(t){let e=t.startsWith("file:")?un(t):t,r=zBs(e);return{source:BGn,handler:a(n=>{let o=XBs(n.toolName,n.toolArgs,r);return o.allowed?Promise.resolve():Promise.resolve({permissionDecision:"deny",permissionDecisionReason:o.reason??"Edit denied: inline chat is confined to the active file."})},"handler")}}a(UGn,"createInlineEditConfinementHook");p();var Xar=de(require("fs"));var jpe=new fe("BackgroundAgent.InlineFileContext"),e3s=50*1024,pat=100,t3s=.4,QGn=25;async function qGn(t,e,r){let n;try{n=to(t).fsPath}catch{return jpe.debug(r,`buildInlineFileContext: failed to parse URI ${t}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let o;try{o=await Xar.promises.stat(n)}catch{return jpe.debug(r,`buildInlineFileContext: failed to stat ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let s=o.size>e3s,c;try{c=await Xar.promises.readFile(n,"utf-8")}catch{return jpe.debug(r,`buildInlineFileContext: failed to read ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:s}}let l=e?.selection,u=e?.position,d="",f=!1;if(!s)d=` +`)}`}a(MDn,"createErrorMessage");p();p();p();p();function tfe(t){let e=t.capabilities.supports?.reasoning_effort,r=!!e&&e.length>0,n=t.capabilities.supports,o=t.capabilities.limits,s=t.billing,c=s&&{...s.multiplier!==void 0?{multiplier:s.multiplier}:{},...s.token_prices!==void 0?{token_prices:s.token_prices}:{}},l=!!c&&Object.keys(c).length>0;return{id:t.id,name:t.name,...t.preview!==void 0?{preview:t.preview}:{},...t.vendor!==void 0?{vendor:t.vendor}:{},...t.model_picker_category!==void 0?{model_picker_category:t.model_picker_category}:{},...t.model_picker_price_category!==void 0?{model_picker_price_category:t.model_picker_price_category}:{},...t.supported_endpoints!==void 0?{supported_endpoints:t.supported_endpoints}:{},...t.policy!==void 0?{policy:t.policy}:{},...l?{billing:c}:{},...t.custom_model!==void 0?{custom_model:t.custom_model}:{},...t.warning_messages!==void 0?{warning_messages:t.warning_messages}:{},capabilities:{family:t.capabilities.family,supports:{...n?.streaming!==void 0?{streaming:n.streaming}:{},...n?.tool_calls!==void 0?{tool_calls:n.tool_calls}:{},...n?.vision!==void 0?{vision:n.vision}:{},...e!==void 0?{reasoning_effort:e}:{},reasoningEffort:r},limits:{...o?.max_prompt_tokens!==void 0?{max_prompt_tokens:o.max_prompt_tokens}:{},...o?.max_output_tokens!==void 0?{max_output_tokens:o.max_output_tokens}:{},max_context_window_tokens:o?.max_context_window_tokens??0}},...e!==void 0?{supportedReasoningEfforts:e}:{},...r?{defaultReasoningEffort:vO(e)}:{}}}a(tfe,"toAgentModelInfo");p();var ODn=new pe("BackgroundAgent.AuthBinding"),ont=class{constructor(e){this.ctx=e}static{a(this,"AuthBinding")}async buildAuthInfo(){let r=await this.ctx.get(Mr).resolveSession();if(!r)throw new Error("Not authenticated. Please sign in first.");let n=r.serverUrl.replace(/\/+$/,"")||"https://github.com",o;try{let l=(await this.ctx.get(Ft).getToken()).endpoints.api;l&&(o={endpoints:{api:l}})}catch(s){ODn.warn(this.ctx,"Could not retrieve CopilotToken endpoints for SDK authInfo",{error:s instanceof Error?s.message:String(s)})}return{type:"token",token:r.accessToken,host:n,...o&&{copilotUser:o}}}async detectIdentityChange(){let e;try{e=(await this.ctx.get(Mr).resolveSession())?.accessToken}catch(o){return ODn.warn(this.ctx,"Failed to read GitHub session on auth change; skipping cache invalidation",{error:o instanceof Error?o.message:String(o)}),{changed:!1,hadPrevious:this.lastAccessToken!==void 0,hasCurrent:!1}}let r=this.lastAccessToken!==void 0,n=e!==void 0;return this.lastAccessToken===e?{changed:!1,hadPrevious:r,hasCurrent:n}:(this.lastAccessToken=e,{changed:!0,hadPrevious:r,hasCurrent:n})}setObservedAccessTokenForTesting(e){this.lastAccessToken=e}getLastAccessTokenForTesting(){return this.lastAccessToken}};p();var Ods=new pe("BackgroundAgent.Attachments");function LDn(t,e){let r=[];for(let n of t){let o=Lds(n);o?r.push(o):Ods.debug(e,`Skipping unsupported reference type for SDK attachment: ${n.type}`)}return r}a(LDn,"convertReferencesToAttachments");function Lds(t){switch(t.type){case"file":{let e=eo(t.uri).fsPath;return t.selection?{type:"selection",filePath:e,displayName:e,text:"",selection:{start:{line:t.selection.start.line,character:t.selection.start.character},end:{line:t.selection.end.line,character:t.selection.end.character}}}:{type:"file",path:e,displayName:e}}case"directory":{let e=eo(t.uri).fsPath;return{type:"directory",path:e,displayName:e}}default:return null}}a(Lds,"convertReferenceToAttachment");p();var YJ=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredServiceError"}static{a(this,"StructuredServiceError")}};function CXt(t,e=100){if(!(t instanceof Error))return;let r=[],n=new Set,o=t.cause,s=0;for(;o instanceof Error&&!n.has(o)&&s0?r.join(": "):void 0}a(CXt,"describeCauseChain");function snt(t){let e=t instanceof Error?t.message:String(t),r=CXt(t);return r?`${e} (cause: ${r})`:e}a(snt,"formatErrorWithCause");var pke=class extends YJ{static{a(this,"BYOKMisconfiguredError")}constructor(e,r,n){let o={kind:"byokMisconfigured",providerName:r,modelId:n};super(e,o),this.name="BYOKMisconfiguredError"}},hke=class extends YJ{static{a(this,"BYOKDisabledError")}constructor(e,r,n){let o={kind:"byokDisabled",providerName:r,modelId:n};super(e,o),this.name="BYOKDisabledError"}};p();function BDn(t,e){switch(e.type){case"permission":t.respondToPermission(e.requestId,e.result);break;case"user_input":t.respondToUserInput(e.requestId,e.response);break;case"elicitation":t.respondToElicitation(e.requestId,e.response);break;case"exit_plan_mode":t.respondToExitPlanMode(e.requestId,e.response);break;case"queued_command":t.respondToQueuedCommand(e.requestId,e.result);break;case"external_tool":t.respondToExternalTool(e.requestId,e.result);break;default:throw new Error(`Unknown interaction type: ${e.type}`)}return{success:!0}}a(BDn,"routeInteraction");p();var FDn=new pe("BackgroundAgent.McpSync"),ant=class{constructor(e,r){this.ctx=e;this.registry=r}static{a(this,"BackgroundAgentMcpSyncTarget")}async syncToActiveSessions(e){this.registry.size()!==0&&(FDn.info(this.ctx,"Syncing MCP servers to active sessions",{sessionCount:this.registry.size()}),await Promise.all([...this.registry.entries()].map(async([r,n])=>{let o=this.registry.getMcpDirectory(r)??this.registry.getWorkspaceFolderUri(r),s=e.buildMcpServers(o);try{await n.reloadMcpServers({mcpServers:s})}catch(c){FDn.warn(this.ctx,"Failed to push MCP servers to session",{sessionId:r,error:c instanceof Error?c.message:String(c)})}})))}};p();p();p();function NF(t){return t.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\/\/)[^/@\s]*@/g,"$1")}a(NF,"redactUrlCredentials");var yj=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredPluginError"}static{a(this,"StructuredPluginError")}},cnt=class extends yj{static{a(this,"PluginSourceNotSupportedError")}constructor(e){let r={kind:"pluginSourceNotSupported",sourceKind:e};super(`Plugin source kind '${e}' is not supported in this environment`,r),this.name="PluginSourceNotSupportedError"}},rfe=class extends yj{static{a(this,"PluginCloneError")}constructor(e,r){let n=NF(e),o=NF(r instanceof Error?r.message:String(r)),s={kind:"pluginCloneFailed",cloneUrl:n,cause:o};super(o,s),this.name="PluginCloneError"}},nfe=class extends yj{static{a(this,"LocalMarketplaceMissingError")}constructor(e){let r={kind:"localMarketplaceMissing",repositoryPath:e};super(`Local marketplace repository does not exist: ${e}`,r),this.name="LocalMarketplaceMissingError"}},ife=class extends yj{static{a(this,"InvalidPluginSourceError")}constructor(e,r="plugin source"){let n=NF(e),o={kind:"invalidPluginSource",source:n};super(`Invalid ${r}: ${n}`,o),this.name="InvalidPluginSourceError"}};var mke=new pe("AgentOTelConfig");function qDn(t){let e=t.OTEL_EXPORTER_OTLP_ENDPOINT;return e===void 0?t:{...t,OTEL_EXPORTER_OTLP_ENDPOINT:NF(e)}}a(qDn,"redactEnvForLog");var Bds="http://localhost:4318";function Fds(t,e){if(!t)return;let r=t.trim().replace(/^["']|["']$/g,"");if(r)try{let n=new URL(r);return e==="grpc"?n.origin:n.href}catch{return}}a(Fds,"parseOtlpEndpoint");function UDn(t){if(t===void 0)return;let e=t.trim().toLowerCase();if(e==="true"||e==="1")return!0;if(e==="false"||e==="0")return!1}a(UDn,"envBool");function QDn(t){if(t==="otlp-http"||t==="otlp-grpc"||t==="console"||t==="file")return t}a(QDn,"normalizeExporterType");function lnt(t,e=process.env){let r=Rt(t,ze.OtelEnabled),n=Rt(t,ze.OtelEndpoint),o=Rt(t,ze.OtelCaptureContent),s=Rt(t,ze.OtelExporterType),c=Rt(t,ze.OtelProtocol),l=Rt(t,ze.OtelOutfile),u=UDn(e.COPILOT_OTEL_ENABLED),d=!!e.COPILOT_OTEL_ENDPOINT||!!e.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||!!e.OTEL_EXPORTER_OTLP_ENDPOINT,f=u===!1?!1:u===!0||r||d,h=e.COPILOT_OTEL_FILE_EXPORTER_PATH||void 0,m=h||l||void 0,g=e.OTEL_EXPORTER_OTLP_PROTOCOL??e.COPILOT_OTEL_PROTOCOL??(s==="otlp-grpc"?"grpc":c||void 0),A=g==="grpc"?"grpc":"http",y=A==="grpc"?"grpc":g==="http/protobuf"?"http/protobuf":"http/json",E=QDn(e.COPILOT_OTEL_EXPORTER_TYPE),_=QDn(s),v;E?v=E:h||l&&_!=="console"?v="file":_?v=_:v=A==="grpc"?"otlp-grpc":"otlp-http";let b=e.COPILOT_OTEL_ENDPOINT||e.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||e.OTEL_EXPORTER_OTLP_ENDPOINT||n||Bds,T=Fds(b,A)??"",w=UDn(e.OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT)??o??!1,R={enabled:!!f,exporterType:v,otlpEndpoint:T,otlpProtocol:y,captureContent:!!w,fileExporterPath:v==="file"?m:void 0};return mke.debug(t,"Resolved agent OTel configuration",{config:{...R,otlpEndpoint:NF(R.otlpEndpoint)}}),R}a(lnt,"resolveAgentOTelConfig");function jDn(t,e,r=process.env){if(!e.enabled)return{};let n={COPILOT_OTEL_ENABLED:"true"};e.captureContent&&(n.OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT="true"),e.exporterType==="file"&&e.fileExporterPath?(n.COPILOT_OTEL_EXPORTER_TYPE="file",n.COPILOT_OTEL_FILE_EXPORTER_PATH=e.fileExporterPath):e.otlpEndpoint&&(n.OTEL_EXPORTER_OTLP_ENDPOINT=e.otlpEndpoint),mke.debug(t,"Copilot CLI OTel env",{env:qDn(n)});let o={};for(let[s,c]of Object.entries(n))r[s]||(o[s]=c);return o}a(jDn,"deriveCopilotCliOTelEnv");function HDn(t,e,r=process.env){if(!e.enabled)return{};if(!e.otlpEndpoint)return mke.warn(t,"Claude OTel: no valid OTLP endpoint; skipping telemetry env"),{};(e.exporterType==="file"||e.exporterType==="console")&&mke.debug(t,`Claude OTel: exporterType='${e.exporterType}' is not supported by Claude; exporting over OTLP to ${NF(e.otlpEndpoint)} instead`);let n={CLAUDE_CODE_ENABLE_TELEMETRY:"1",OTEL_METRICS_EXPORTER:"otlp",OTEL_LOGS_EXPORTER:"otlp",OTEL_EXPORTER_OTLP_ENDPOINT:e.otlpEndpoint,OTEL_EXPORTER_OTLP_PROTOCOL:e.otlpProtocol};return e.captureContent&&(n.OTEL_LOG_USER_PROMPTS="1",n.OTEL_LOG_TOOL_DETAILS="1"),mke.debug(t,"Claude OTel env",{env:qDn(n)}),n}a(HDn,"deriveClaudeOTelEnv");var bXt=new Map,SXt=new Set;function Uds(t,e){process.env[t]||(bXt.has(t)||bXt.set(t,process.env[t]),process.env[t]=e,SXt.add(t))}a(Uds,"setEnvIfAbsent");function GDn(){for(let t of SXt){let e=bXt.get(t);e===void 0?delete process.env[t]:process.env[t]=e}SXt.clear()}a(GDn,"restoreOTelEnvironment");function $Dn(t){let e=lnt(t);if(!e.enabled)return;let r=jDn(t,e);for(let[n,o]of Object.entries(r))Uds(n,o)}a($Dn,"applyOTelEnvironment");p();p();var Q6n=fe(require("crypto")),q6n=fe(require("fs")),Uot=fe(F6n()),j6n=require("tls"),H6n=fe(U6n());var mpe=new pe("certificates"),gp=class{static{a(this,"RootCertificateReader")}};function Qot(t,e=process.platform){return new Jnr(t,[new Znr,new Xnr,FIs(t,e)])}a(Qot,"getRootCertificateReader");function FIs(t,e){switch(e){case"linux":return new eir(t);case"darwin":return new tir(t);case"win32":return new rir(t);default:return new nir}}a(FIs,"createPlatformReader");var Knr=class extends gp{constructor(r,n){super();this.ctx=r;this.delegate=n}static{a(this,"ErrorHandlingCertificateReader")}async getAllRootCAs(){try{return await this.delegate.getAllRootCAs()}catch(r){return mpe.warn(this.ctx,"Failed to read root certificates:",r),[]}}},Jnr=class extends gp{constructor(r,n){super();this.ctx=r;this.delegates=n.map(o=>new Knr(r,o))}static{a(this,"CachingRootCertificateReader")}async getAllRootCAs(){return this.certificates||(this.certificates=this.removeExpiredCertificates((await Promise.all(this.delegates.map(r=>r.getAllRootCAs()))).flat())),this.certificates}removeExpiredCertificates(r){let n=Date.now(),o=r.filter(s=>{try{let c=new Q6n.X509Certificate(s),l=Date.parse(c.validTo);return isNaN(l)||l>n}catch(c){return mpe.warn(this.ctx,"Failed to parse certificate",s,c),!1}});return r.length!==o.length&&mpe.info(this.ctx,`Removed ${r.length-o.length} expired certificates`),o}},Znr=class extends gp{static{a(this,"NodeTlsRootCertificateReader")}getAllRootCAs(){return j6n.rootCertificates}},Xnr=class extends gp{static{a(this,"EnvironmentVariableRootCertificateReader")}async getAllRootCAs(){let e=process.env.NODE_EXTRA_CA_CERTS;return e?await G6n(e):[]}},eir=class extends gp{constructor(r){super();this.ctx=r}static{a(this,"LinuxRootCertificateReader")}async getAllRootCAs(){let r=[];for(let n of["/etc/ssl/certs/ca-certificates.crt","/etc/ssl/certs/ca-bundle.crt"]){let o=await G6n(n);mpe.debug(this.ctx,`Read ${o.length} certificates from ${n}`),r=r.concat(o)}return r}},tir=class extends gp{constructor(r){super();this.ctx=r}static{a(this,"MacRootCertificateReader")}getAllRootCAs(){let r=Uot.get({excludeBundled:!1,format:Uot.Format.pem});return mpe.debug(this.ctx,`Read ${r.length} certificates from Mac keychain`),r}},rir=class extends gp{constructor(r){super();this.ctx=r}static{a(this,"WindowsRootCertificateReader")}getAllRootCAs(){let r=H6n.all();return mpe.debug(this.ctx,`Read ${r.length} certificates from Windows store`),r}},nir=class extends gp{static{a(this,"UnsupportedPlatformRootCertificateReader")}getAllRootCAs(){return Promise.reject(new Error("No certificate reader available for unsupported platform"))}};async function G6n(t){let e;try{e=await q6n.promises.readFile(t,{encoding:"utf8"})}catch{return[]}let r=e.match(/-----BEGIN CERTIFICATE-----[\s\S]*?-----END CERTIFICATE-----/g);if(!r)return[];let n=r.filter(s=>s.length>0),o=new Set(n);return Array.from(o)}a(G6n,"readCertsFromFile");var EH=fe(Bcr());var Ucr=new pe("BackgroundAgent.ProxyEnv"),Qcr=new Map,qcr=new Set,B2e;function jcr(){for(let t of qcr){let e=Qcr.get(t);e===void 0?delete process.env[t]:process.env[t]=e}qcr.clear(),B2e&&((0,EH.setGlobalDispatcher)(B2e),B2e=void 0)}a(jcr,"restoreProxyEnvironment");function Fcr(t,e,r){process.env[t]||process.env[e]||(Qcr.has(t)||Qcr.set(t,process.env[t]),process.env[t]=r,qcr.add(t))}a(Fcr,"setEnvIfAbsent");function zFs(t,e){if(!e)return t;try{let r=new URL(t),n=e.indexOf(":"),o=n===-1?e:e.slice(0,n),s=n===-1?"":e.slice(n+1);return o&&(r.username=encodeURIComponent(o),s&&(r.password=encodeURIComponent(s))),r.toString()}catch{return t}}a(zFs,"buildProxyUrl");async function YFs(t,e){if(e===!1){let r={rejectUnauthorized:!1};return{requestTls:r,proxyTls:r}}try{let r=await t.get(gp).getAllRootCAs();if(r.length>0){let n={ca:r};return{requestTls:n,proxyTls:n}}}catch{Ucr.warn(t,"Failed to load system CA certificates for SDK proxy dispatcher")}return{}}a(YFs,"buildTlsOptions");async function Fat(t){try{jcr();let e=t.get(Lo).getHttpSettings();if(!e.proxy)return;let r=zFs(e.proxy,e.proxyAuthorization);Fcr("HTTPS_PROXY","https_proxy",r),Fcr("HTTP_PROXY","http_proxy",r);let n=e.noProxy?.length?e.noProxy.join(","):void 0;n&&Fcr("NO_PROXY","no_proxy",n),B2e||(B2e=(0,EH.getGlobalDispatcher)());let o=await YFs(t,e.proxyStrictSSL);(0,EH.setGlobalDispatcher)(new EH.EnvHttpProxyAgent({allowH2:!0,httpProxy:r,httpsProxy:r,noProxy:n,...o})),Ucr.info(t,"Applied proxy settings to environment for SDK",{hasProxy:!0,hasAuth:!!e.proxyAuthorization,hasNoProxy:!!n,proxyStrictSSL:e.proxyStrictSSL!==!1,hasTlsCa:!!o.requestTls,dispatcherType:(0,EH.getGlobalDispatcher)().constructor.name})}catch(e){Ucr.warn(t,"Failed to apply proxy settings to environment:",e)}}a(Fat,"applyProxyToEnvironment");p();var yVn=fe(AVn());var XFs=new pe("BackgroundAgent.Todos");async function e8s(t){let{rows:e,dependencies:r}=await t.plan.readSqlTodosWithDependencies();return t8s(e,r)}a(e8s,"readSessionTodos");function t8s(t,e){let r=a(c=>({id:c.id,title:c.title,status:c.status}),"toItem"),n=a(()=>t.map(r),"unsorted");if(t.length===0||e.length===0)return n();let o=new Map;for(let c=0;cr(t[l]))}catch{return n()}}a(t8s,"orderTodosByDependency");async function Uat(t,e,r,n){try{let o=await e8s(n);await e.sendBackgroundAgentTodosChanged({sessionId:r,todos:o})}catch(o){XFs.warn(t,"Failed to read/emit session todos",{sessionId:r,error:o instanceof Error?o.message:String(o)})}}a(Uat,"emitTodosChanged");p();var r8s=["read_file","view","grep_search","file_search","semantic_search","grep","rg","glob","tool_search_tool_regex","fetch_copilot_cli_documentation","think"],Qat=["get_errors"],Gcr=[...Qat,"edit","str_replace_editor","apply_patch"],n8s=["ask","inline-ask","inline"];function qat(t){return t!==void 0&&n8s.includes(t)}a(qat,"isClampedChatMode");var i8s={ask:r8s,inline:Gcr,"inline-ask":Qat};async function EVn(t,e,r){let n,o,s,c;e==="agent"?(n=null,o=await r.loadCustomAgents(),s=new Set(await r.getPolicyDisabledSkillNames()),c=await r.getMcpServers()):(n=[...i8s[e]],o=[],s=new Set(await r.getAllLoadedSkillNames()),c={});let l={availableTools:n,customAgents:o,disabledSkills:s,mcpServers:c};t.updateOptions(l,{emitToolDefinitionsChanged:!0})}a(EVn,"applyChatMode");p();var OT=fe(require("node:path"));var CVn="copilot-language-server:inline-chat",o8s=["file","path","filePath","file_path"],s8s=new Set(["edit","create","str_replace_editor","write"]),a8s=new Set(["git_apply_patch"]),_Vn=/^\*\*\* (?:Add File|Delete File|Update File|Move to): (.+)$/gm;function c8s(t){let e=OT.dirname(t);return{confinedFsPath:t,confinedName:OT.basename(t),baseDir:e,confinedComparable:$cr(t,e)}}a(c8s,"buildContext");function l8s(t){if(typeof t=="string")try{let e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}return t&&typeof t=="object"?t:{}}a(l8s,"parseToolArgs");function u8s(t){if(typeof t=="string")return t;if(t&&typeof t=="object"){let e=t;if(typeof e.input=="string")return e.input;if(typeof e.patch=="string")return e.patch}}a(u8s,"extractApplyPatchBody");function d8s(t){if(!t.includes("*** Begin Patch"))return;let e=[];_Vn.lastIndex=0;for(let r of t.matchAll(_Vn)){let n=r[1].trim();n.length>0&&e.push(n)}return e}a(d8s,"extractApplyPatchPaths");function f8s(t){for(let e of o8s){let r=t[e];if(typeof r=="string"&&r.trim().length>0)return r}}a(f8s,"extractTargetPath");function $cr(t,e){let r=t.startsWith("file:")?ln(t):t,n=OT.isAbsolute(r)?OT.normalize(r):OT.resolve(e,r);return process.platform==="win32"||process.platform==="darwin"?n.toLowerCase():n}a($cr,"toComparablePath");function vVn(t,e){return OT.isAbsolute(t)?OT.normalize(t):OT.resolve(e,t)}a(vVn,"resolveTargetPath");function p8s(t,e,r){if(a8s.has(t))return{allowed:!1,reason:`Inline chat may only edit ${r.confinedName}. The ${t} tool cannot be confined to a single file and is not available in inline chat.`};if(t==="apply_patch"){let o=u8s(e);if(o===void 0)return{allowed:!1,reason:`Inline chat denied an apply_patch call with no readable patch body. Only ${r.confinedName} may be edited.`};let s=d8s(o);if(s===void 0)return{allowed:!1,reason:`Inline chat denied an apply_patch call whose body could not be parsed. Only ${r.confinedName} may be edited.`};if(s.length===0)return{allowed:!1,reason:`Inline chat denied an apply_patch call with no file headers. Only ${r.confinedName} may be edited.`};for(let c of s)if($cr(c,r.baseDir)!==r.confinedComparable)return{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${vVn(c,r.baseDir)} (apply_patch header: ${c}).`};return{allowed:!0}}if(!s8s.has(t))return{allowed:!0};let n=f8s(l8s(e));return n?$cr(n,r.baseDir)!==r.confinedComparable?{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${vVn(n,r.baseDir)} (${t} arg: ${n}).`}:{allowed:!0}:{allowed:!1,reason:`Inline chat denied a ${t} call with no resolvable file path. Only ${r.confinedName} may be edited.`}}a(p8s,"evaluateWithContext");function bVn(t){let e=0;return{hook:{source:CVn,handler:a(()=>e>t?Promise.resolve({permissionDecision:"deny",permissionDecisionReason:`Inline chat is limited to ${t} tool-calling turns. No further tool calls are allowed.`}):Promise.resolve(),"handler")},onTurnStart(){e++},reset(){e=0}}}a(bVn,"createInlineTurnLimitHook");function SVn(t){let e=t.startsWith("file:")?ln(t):t,r=c8s(e);return{source:CVn,handler:a(n=>{let o=p8s(n.toolName,n.toolArgs,r);return o.allowed?Promise.resolve():Promise.resolve({permissionDecision:"deny",permissionDecisionReason:o.reason??"Edit denied: inline chat is confined to the active file."})},"handler")}}a(SVn,"createInlineEditConfinementHook");p();var Vcr=fe(require("fs"));var nhe=new pe("BackgroundAgent.InlineFileContext"),h8s=50*1024,jat=100,m8s=.4,TVn=25;async function IVn(t,e,r){let n;try{n=eo(t).fsPath}catch{return nhe.debug(r,`buildInlineFileContext: failed to parse URI ${t}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let o;try{o=await Vcr.promises.stat(n)}catch{return nhe.debug(r,`buildInlineFileContext: failed to stat ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let s=o.size>h8s,c;try{c=await Vcr.promises.readFile(n,"utf-8")}catch{return nhe.debug(r,`buildInlineFileContext: failed to read ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:s}}let l=e?.selection,u=e?.position,d="",f=!1;if(!s)d=` Here is the current content of \`${n}\`: \`\`\` ${c} -\`\`\``,f=!0;else if(l)d=n3s(c,n,l),jpe.debug(r,`buildInlineFileContext: cropped large file around selection: ${n}`);else if(u)d=i3s(c,n,u),jpe.debug(r,`buildInlineFileContext: cropped large file around cursor: ${n}`);else return jpe.debug(r,`buildInlineFileContext: large file (${o.size} bytes), no cursor or selection: ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!0};if(l)d+=r3s(c,n,l);else if(u){let h=Math.min(u.line,c.split(` +\`\`\``,f=!0;else if(l)d=A8s(c,n,l),nhe.debug(r,`buildInlineFileContext: cropped large file around selection: ${n}`);else if(u)d=y8s(c,n,u),nhe.debug(r,`buildInlineFileContext: cropped large file around cursor: ${n}`);else return nhe.debug(r,`buildInlineFileContext: large file (${o.size} bytes), no cursor or selection: ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!0};if(l)d+=g8s(c,n,l);else if(u){let h=Math.min(u.line,c.split(` `).length-1);d+=` -The cursor is at 1-based line ${h+1}.`}return{promptFragment:d,isFullContent:f,isLargeFile:s}}a(qGn,"buildInlineFileContext");function r3s(t,e,r){let n=t.split(` +The cursor is at 1-based line ${h+1}.`}return{promptFragment:d,isFullContent:f,isLargeFile:s}}a(IVn,"buildInlineFileContext");function g8s(t,e,r){let n=t.split(` `),o=n.length,s=Math.max(0,r.start.line),c=Math.min(o-1,r.end.line),u=n.slice(s,c+1).map((d,f)=>`${s+f+1} | ${d}`).join(` `);return` Here is the selected code in \`${e}\` (1-based lines ${s+1}-${c+1} of ${o}): \`\`\` ${u} -\`\`\``}a(r3s,"buildSelectionFragment");function n3s(t,e,r){let n=t.split(` -`),o=n.length,s=Math.max(0,r.start.line),c=Math.min(o-1,r.end.line),l=Math.max(0,s-QGn),u=Math.min(o-1,c+QGn),f=n.slice(l,u+1).map((h,m)=>`${l+m+1} | ${h}`).join(` +\`\`\``}a(g8s,"buildSelectionFragment");function A8s(t,e,r){let n=t.split(` +`),o=n.length,s=Math.max(0,r.start.line),c=Math.min(o-1,r.end.line),l=Math.max(0,s-TVn),u=Math.min(o-1,c+TVn),f=n.slice(l,u+1).map((h,m)=>`${l+m+1} | ${h}`).join(` `);return` Here is a portion of \`${e}\` (1-based lines ${l+1}-${u+1} of ${o}): \`\`\` ${f} -\`\`\``}a(n3s,"buildCropAroundSelectionFragment");function i3s(t,e,r){let n=t.split(` -`),o=n.length,s=Math.min(r.line,o-1),c=Math.floor(pat*t3s),l=pat-c,u=Math.max(0,s-c),d=Math.min(o,s+l);u===0?d=Math.min(o,pat):d>=o&&(u=Math.max(0,o-pat));let h=n.slice(u,d).map((m,g)=>`${u+g+1} | ${m}`).join(` +\`\`\``}a(A8s,"buildCropAroundSelectionFragment");function y8s(t,e,r){let n=t.split(` +`),o=n.length,s=Math.min(r.line,o-1),c=Math.floor(jat*m8s),l=jat-c,u=Math.max(0,s-c),d=Math.min(o,s+l);u===0?d=Math.min(o,jat):d>=o&&(u=Math.max(0,o-jat));let h=n.slice(u,d).map((m,g)=>`${u+g+1} | ${m}`).join(` `);return` Here is a portion of \`${e}\` (1-based lines ${u+1}-${d} of ${o}, cursor at line ${s+1}): \`\`\` ${h} -\`\`\``}a(i3s,"buildCursorCropFragment");p();p();var jGn=require("node:crypto"),hat=de(require("node:fs")),Hw=de(require("node:fs/promises")),HGn=require("node:os"),H5=de(require("node:path"));var nX=new fe("BackgroundAgent.SandboxBinaryResolver");async function GGn(t){if(!process.env.MXC_BIN_DIR)try{let e=H5.join(__dirname,"node_modules","@github","copilot","mxc-bin");if(!hat.existsSync(e)){nX.debug(t,`Local sandbox binaries not found at ${e}; sandbox will be unavailable`);return}if(!("pkg"in process)){process.env.MXC_BIN_DIR=e,nX.debug(t,`Local sandbox binaries located; MXC_BIN_DIR=${e}`);return}let r=await s3s(t,e);r&&(process.env.MXC_BIN_DIR=r,nX.debug(t,`Local sandbox binaries extracted; MXC_BIN_DIR=${r}`))}catch(e){nX.warn(t,"Failed to resolve MXC_BIN_DIR for the local sandbox",{error:e instanceof Error?e.message:String(e)})}}a(GGn,"ensureSandboxBinDirEnv");function o3s(){switch(process.platform){case"win32":return"wxc-exec.exe";case"darwin":return"mxc-exec-mac";default:return"lxc-exec"}}a(o3s,"sandboxMainBinaryName");async function s3s(t,e){if(process.arch!=="x64"&&process.arch!=="arm64"){nX.debug(t,`Local sandbox unsupported on architecture ${process.arch}; sandbox will be unavailable`);return}let r=process.arch,n=H5.join(e,r),o=o3s(),s=H5.join(n,o);if(!hat.existsSync(s)){nX.warn(t,`Local sandbox binary ${r}/${o} not embedded; sandbox will be unavailable`);return}let c=(0,jGn.createHash)("sha256").update(await Hw.readFile(s)).digest("hex"),l=process.env.PKG_NATIVE_CACHE_PATH||H5.join((0,HGn.homedir)(),".cache"),u=H5.join(l,"pkg",`mxc-bin-${c}`),d=H5.join(u,r),f=H5.join(d,".extraction-complete");if(hat.existsSync(f))return u;await Hw.mkdir(d,{recursive:!0});let h=await Hw.readdir(n,{withFileTypes:!0});for(let m of h){if(!m.isFile())continue;let g=H5.join(d,m.name);await Hw.copyFile(H5.join(n,m.name),g),process.platform!=="win32"&&await Hw.chmod(g,493).catch(A=>nX.warn(t,`Failed to set executable permission for ${g}`,{error:A instanceof Error?A.message:String(A)}))}return await Hw.writeFile(f,""),u}a(s3s,"extractSandboxBinDirFromPkg");p();function $Gn(t,e){let r=t,n=r.permissions?.setRequired;if(typeof n=="function"){Promise.resolve(n.call(r.permissions,{required:e}));return}typeof r.setPermissionsRequired=="function"&&r.setPermissionsRequired(e)}a($Gn,"setPermissionsRequired");function VGn(t,e){let r=t;return typeof r.setRemoteDelegate!="function"?!1:(r.setRemoteDelegate(e),!0)}a(VGn,"setRemoteDelegate");function ecr(t,e,r){let n=t;return typeof n.emit!="function"?!1:(n.emit(e,r),!0)}a(ecr,"emitSessionEvent");function tcr(t){let r=t.remote;if(!(!r||typeof r.enable!="function"||typeof r.disable!="function"))return r}a(tcr,"getRemoteHandle");function WGn(t){let e=t.AutoModeSessionManager;if(typeof e=="function")try{return new e}catch{return}}a(WGn,"createAutoModeSessionManager");function zGn(t){if(t)try{t.clear()}catch{}}a(zGn,"clearAutoModeManager");p();p();p();var mat=require("fs"),gat=de(require("path"));var rcr=new fe("OtelSpanFilePersistence"),a3s="debug.jsonl",pv=class{constructor(e){this.ctx=e}static{a(this,"OTelSpanFilePersistence")}isEnabled(){return!!this.getDirectory()}getDirectory(){let e=Ft(this.ctx,Ye.AgentDebugLogsDirectory);return typeof e=="string"&&e.length>0?e:void 0}async appendSpans(e){if(!this.isEnabled()||e.length===0)return;let r=new Map;for(let n of e){let o=c3s(n);if(!o){rcr.warn(this.ctx,`Dropping span without gen_ai.conversation.id (traceId=${n.traceId})`);continue}let s=r.get(o);s?s.push(n):r.set(o,[n])}for(let[n,o]of r)try{let s=this.getFilePath(n);await mat.promises.mkdir(gat.dirname(s),{recursive:!0,mode:448});let c=o.map(l=>JSON.stringify(l)).join(` -`)+` -`;await mat.promises.appendFile(s,c,{encoding:"utf8",mode:384})}catch(s){rcr.warn(this.ctx,`Failed to persist spans for conversation=${n}: ${s instanceof Error?s.message:String(s)}`)}}async readSpans(e){if(!this.isEnabled())return[];try{let r=await mat.promises.readFile(this.getFilePath(e),"utf8"),n=[];for(let o of r.split(` -`))if(o.trim())try{n.push(JSON.parse(o))}catch{}return n}catch(r){return r.code==="ENOENT"?[]:(rcr.warn(this.ctx,`Failed to read spans for conversation=${e}: ${r instanceof Error?r.message:String(r)}`),[])}}getFilePath(e){let r=this.getDirectory();if(!r)throw new Error("Agent debug logs directory not configured");return gat.join(r,l3s(e),a3s)}};function c3s(t){for(let e of t.attributes??[])if(e.key==="gen_ai.conversation.id"){let r=e.value.stringValue;if(r&&r.length>0)return r}}a(c3s,"conversationIdOf");function l3s(t){let e=t.replace(/[^A-Za-z0-9._-]/g,"_").slice(0,120);return e.length>0?e:"unknown"}a(l3s,"sanitizeForPath");p();var u3s={0:1,1:2,2:3,3:4,4:5};function ncr(t){return String(BigInt(t[0])*BigInt(1e9)+BigInt(t[1]))}a(ncr,"hrTimeToNano");function YGn(t){if(t!=null)return typeof t=="string"?{stringValue:t}:typeof t=="boolean"?{boolValue:t}:typeof t=="number"?Number.isInteger(t)?{intValue:String(t)}:{doubleValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(r=>YGn(r)).filter(r=>r!==void 0)}}:{stringValue:JSON.stringify(t)}}a(YGn,"encodeAnyValue");function k2(t){if(!t)return[];let e=[];for(let[r,n]of Object.entries(t)){let o=YGn(n);o!==void 0&&e.push({key:r,value:o})}return e}a(k2,"encodeAttributes");function KGn(t){let e=t.spanContext(),r={traceId:e.traceId,spanId:e.spanId,name:t.name,kind:u3s[t.kind]??1,startTimeUnixNano:ncr(t.startTime),endTimeUnixNano:ncr(t.endTime),attributes:k2(t.attributes),events:t.events.map(n=>({name:n.name,timeUnixNano:ncr(n.time),attributes:k2(n.attributes)})),status:t.status.message?{code:t.status.code??0,message:t.status.message}:{code:t.status.code??0}};return t.parentSpanContext?.spanId&&(r.parentSpanId=t.parentSpanContext.spanId),r}a(KGn,"encodeSpan");function d3s(t,e){return{resourceSpans:[{resource:{attributes:Object.entries(e).map(([r,n])=>({key:r,value:{stringValue:n}}))},scopeSpans:[{scope:{name:"copilot-chat"},spans:t}]}]}}a(d3s,"wrapInResourceSpans");function JGn(t,e){let r=d3s(t,{"service.name":"copilot-chat","session.id":e.conversationId});return r.copilotChat={exportedAt:new Date().toISOString(),exporterVersion:"",sessionId:e.conversationId,...e.sessionTitle?{sessionTitle:e.sessionTitle}:{}},r}a(JGn,"buildChatDebugLogExport");var x2e=new fe("OtelBridge"),nFs=1e3,w2e=class t{constructor(e){this.pending=[];this.flushTimer=null;this.disposed=!1;this.ctx=e,this.persistence=e.get(pv)}static{a(this,"BridgeSpanProcessor")}static installInto(e){try{let n=(co(),ba(V5)).trace.getTracerProvider(),o=n._delegate??n,c=o._activeSpanProcessor?._spanProcessors;if(!Array.isArray(c)){let u=o?Object.keys(o).join(", "):"null";return x2e.warn(e,`Could not access SDK TracerProvider internals. delegate keys: [${u}]`),{installed:!1}}let l=new t(e);return c.push(l),x2e.info(e,`Bridge SpanProcessor installed (total processors=${c.length}).`),{installed:!0,processor:l}}catch(r){return x2e.warn(e,`Failed to install bridge SpanProcessor: ${String(r)}`),{installed:!1}}}onStart(e,r){}onEnd(e){this.disposed||(this.pending.push(e),this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flush()},nFs)))}async forceFlush(){await this.flush()}async shutdown(){this.disposed=!0,this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),await this.flush()}async flush(){if(this.flushTimer=null,this.pending.length===0)return;let e=this.pending;this.pending=[];let r;try{r=e.map(KGn)}catch(n){x2e.warn(this.ctx,`Failed to encode spans: ${String(n)}`);return}try{await this.persistence.appendSpans(r)}catch(n){x2e.warn(this.ctx,`Failed to persist otel spans: ${String(n)}`)}}};var oVn=require("node:module");var iVn=new fe("BackgroundAgent.ManagerLifecycle");async function iFs(){return"pkg"in process?(0,oVn.createRequire)(__filename)("./node_modules/@github/copilot/sdk/index.cjs"):import("@github/copilot/sdk")}a(iFs,"importSdk");var kat=class{constructor(e){this.ctx=e}static{a(this,"ManagerLifecycle")}async ensureManager(){if(this.manager)return this.manager;this.managerInitPromise||(this.managerInitPromise=this.initManager());try{await this.managerInitPromise}catch(e){throw this.managerInitPromise=void 0,e}if(!this.manager)throw new Error("LocalSessionManager initialization succeeded but manager is undefined");return this.manager}getSdk(){return this.sdk}getAutoModeManager(){return this.autoModeManager}ensureBridgeInstalled(){if(this.installedBridge!==void 0||!this.ctx.get(bn).getCapabilities().agentDebugLog)return;let e=w2e.installInto(this.ctx);this.installedBridge=e.processor}clearAutoMode(){zGn(this.autoModeManager)}async dispose(){this.manager&&(await this.manager.dispose(),this.manager=void 0),this.sdk=void 0,this.autoModeManager=void 0,this.managerInitPromise=void 0}setStubManagerForTesting(e){this.manager=e}setStubSdkForTesting(e){this.sdk=e}setAutoModeManagerForTesting(e){this.autoModeManager=e}async initManager(){iVn.info(this.ctx,"Initializing LocalSessionManager (in-process SDK)..."),l2n(this.ctx);let e=performance.now();try{this.sdk=await iFs(),At(this.ctx,"backgroundAgent.importSdk",{status_text:"success"},{duration_ms:performance.now()-e})}catch(o){throw Vn(this.ctx,"backgroundAgent.importSdk",o,{status_text:"failure"},{duration_ms:performance.now()-e}),o}await GGn(this.ctx),await uat(this.ctx);let r={telemetryService:new this.sdk.internal.NoopTelemetryService};typeof this.sdk.createLocalFeatureFlagServiceCreator=="function"&&(r.createFeatureFlagService=this.sdk.createLocalFeatureFlagServiceCreator()),typeof this.sdk.createLocalFeatureFlagService=="function"&&(r.featureFlagService=this.sdk.createLocalFeatureFlagService());let n=WGn(this.sdk);n!==void 0&&(r.autoModeManager=n),this.autoModeManager=n,this.manager=new this.sdk.internal.LocalSessionManager(r),iVn.info(this.ctx,"LocalSessionManager initialized.")}};p();p();p();p();function W5(t){try{return Ft(t,Ye.EnablePlugins)===!0}catch{return!1}}a(W5,"pluginsEnabled");var PT=class{static{a(this,"McpGatewayHost")}constructor(e,r,n){this._ctx=e,this._service=r,this._manager=n}get service(){return this._service}buildMcpServers(e){let r=this._manager.listReadyEntries(),n=W5(this._ctx),o=new Map,s=new Map,c=new Map;for(let u of r){if(u.url===null)continue;let d=u.key.source;d.kind==="user"?o.set(u.key.name,{type:"http",url:u.url,tools:["*"]}):d.kind==="project"&&e!==void 0&&d.workspaceFolder===e?s.set(u.key.name,{type:"http",url:u.url,tools:["*"]}):d.kind==="plugin"&&n&&c.set(u.key.name,{type:"http",url:u.url,tools:["*"]})}let l={};for(let[u,d]of c)l[u]=d;for(let[u,d]of o)l[u]=d;for(let[u,d]of s)l[u]=d;return l}async dispose(){}};p();p();var zl={ToolsListChanged:"tools/listChanged",ResourcesListChanged:"resources/listChanged",PromptsListChanged:"prompts/listChanged",LoggingMessage:"logging/message"};p();p();var Icr;Icr=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(t=>t.webcrypto);async function oFs(t){return(await Icr).getRandomValues(new Uint8Array(t))}a(oFs,"getRandomValues");async function sFs(t){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r="",n=await oFs(t);for(let o=0;o128)throw`Expected a length between 43 and 128. Received ${t}.`;let e=await aFs(t),r=await cFs(e);return{code_verifier:e,code_challenge:r}}a(xcr,"pkceChallenge");p();var Gw="2025-11-25";var Dat=[Gw,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],cH="io.modelcontextprotocol/related-task",Nat="2.0",y0=MJt(t=>t!==null&&(typeof t=="object"||typeof t=="function")),sVn=Il([Je(),ka().int()]),aVn=Je(),L0f=om({ttl:ka().optional(),pollInterval:ka().optional()}),uFs=zr({ttl:ka().optional()}),dFs=zr({taskId:Je()}),Rcr=om({progressToken:sVn.optional(),[cH]:dFs.optional()}),DT=zr({_meta:Rcr.optional()}),R2e=DT.extend({task:uFs.optional()}),cVn=a(t=>R2e.safeParse(t).success,"isTaskAugmentedRequestParams"),WA=zr({method:Je(),params:DT.loose().optional()}),$w=zr({_meta:Rcr.optional()}),Vw=zr({method:Je(),params:$w.loose().optional()}),zA=om({_meta:Rcr.optional()}),Mat=Il([Je(),ka().int()]),lVn=zr({jsonrpc:Gn(Nat),id:Mat,...WA.shape}).strict(),k2e=a(t=>lVn.safeParse(t).success,"isJSONRPCRequest"),uVn=zr({jsonrpc:Gn(Nat),...Vw.shape}).strict(),dVn=a(t=>uVn.safeParse(t).success,"isJSONRPCNotification"),kcr=zr({jsonrpc:Gn(Nat),id:Mat,result:zA}).strict(),lX=a(t=>kcr.safeParse(t).success,"isJSONRPCResultResponse");var ei;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(ei||(ei={}));var Pcr=zr({jsonrpc:Gn(Nat),id:Mat.optional(),error:zr({code:ka().int(),message:Je(),data:od().optional()})}).strict();var fVn=a(t=>Pcr.safeParse(t).success,"isJSONRPCErrorResponse");var lH=Il([lVn,uVn,kcr,Pcr]),B0f=Il([kcr,Pcr]),uX=zA.strict(),fFs=$w.extend({requestId:Mat.optional(),reason:Je().optional()}),Oat=Vw.extend({method:Gn("notifications/cancelled"),params:fFs}),pFs=zr({src:Je(),mimeType:Je().optional(),sizes:Fr(Je()).optional(),theme:rv(["light","dark"]).optional()}),P2e=zr({icons:Fr(pFs).optional()}),Wpe=zr({name:Je(),title:Je().optional()}),pVn=Wpe.extend({...Wpe.shape,...P2e.shape,version:Je(),websiteUrl:Je().optional(),description:Je().optional()}),hFs=qRe(zr({applyDefaults:ol().optional()}),xl(Je(),od())),mFs=vrt(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,qRe(zr({form:hFs.optional(),url:y0.optional()}),xl(Je(),od()).optional())),gFs=om({list:y0.optional(),cancel:y0.optional(),requests:om({sampling:om({createMessage:y0.optional()}).optional(),elicitation:om({create:y0.optional()}).optional()}).optional()}),AFs=om({list:y0.optional(),cancel:y0.optional(),requests:om({tools:om({call:y0.optional()}).optional()}).optional()}),yFs=zr({experimental:xl(Je(),y0).optional(),sampling:zr({context:y0.optional(),tools:y0.optional()}).optional(),elicitation:mFs.optional(),roots:zr({listChanged:ol().optional()}).optional(),tasks:gFs.optional(),extensions:xl(Je(),y0).optional()}),EFs=DT.extend({protocolVersion:Je(),capabilities:yFs,clientInfo:pVn}),_Fs=WA.extend({method:Gn("initialize"),params:EFs});var vFs=zr({experimental:xl(Je(),y0).optional(),logging:y0.optional(),completions:y0.optional(),prompts:zr({listChanged:ol().optional()}).optional(),resources:zr({subscribe:ol().optional(),listChanged:ol().optional()}).optional(),tools:zr({listChanged:ol().optional()}).optional(),tasks:AFs.optional(),extensions:xl(Je(),y0).optional()}),Dcr=zA.extend({protocolVersion:Je(),capabilities:vFs,serverInfo:pVn,instructions:Je().optional()}),hVn=Vw.extend({method:Gn("notifications/initialized"),params:$w.optional()}),mVn=a(t=>hVn.safeParse(t).success,"isInitializedNotification"),Lat=WA.extend({method:Gn("ping"),params:DT.optional()}),CFs=zr({progress:ka(),total:bu(ka()),message:bu(Je())}),bFs=zr({...$w.shape,...CFs.shape,progressToken:sVn}),Bat=Vw.extend({method:Gn("notifications/progress"),params:bFs}),SFs=DT.extend({cursor:aVn.optional()}),D2e=WA.extend({params:SFs.optional()}),N2e=zA.extend({nextCursor:aVn.optional()}),TFs=rv(["working","input_required","completed","failed","cancelled"]),M2e=zr({taskId:Je(),status:TFs,ttl:Il([ka(),mrt()]),createdAt:Je(),lastUpdatedAt:Je(),pollInterval:bu(ka()),statusMessage:bu(Je())}),dX=zA.extend({task:M2e}),IFs=$w.merge(M2e),O2e=Vw.extend({method:Gn("notifications/tasks/status"),params:IFs}),Fat=WA.extend({method:Gn("tasks/get"),params:DT.extend({taskId:Je()})}),Uat=zA.merge(M2e),Qat=WA.extend({method:Gn("tasks/result"),params:DT.extend({taskId:Je()})}),F0f=zA.loose(),qat=D2e.extend({method:Gn("tasks/list")}),jat=N2e.extend({tasks:Fr(M2e)}),Hat=WA.extend({method:Gn("tasks/cancel"),params:DT.extend({taskId:Je()})}),gVn=zA.merge(M2e),AVn=zr({uri:Je(),mimeType:bu(Je()),_meta:xl(Je(),od()).optional()}),yVn=AVn.extend({text:Je()}),Ncr=Je().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),EVn=AVn.extend({blob:Ncr}),L2e=rv(["user","assistant"]),zpe=zr({audience:Fr(L2e).optional(),priority:ka().min(0).max(1).optional(),lastModified:Ude.datetime({offset:!0}).optional()}),_Vn=zr({...Wpe.shape,...P2e.shape,uri:Je(),description:bu(Je()),mimeType:bu(Je()),size:bu(ka()),annotations:zpe.optional(),_meta:bu(om({}))}),xFs=zr({...Wpe.shape,...P2e.shape,uriTemplate:Je(),description:bu(Je()),mimeType:bu(Je()),annotations:zpe.optional(),_meta:bu(om({}))}),wFs=D2e.extend({method:Gn("resources/list")}),Mcr=N2e.extend({resources:Fr(_Vn)}),RFs=D2e.extend({method:Gn("resources/templates/list")}),Ocr=N2e.extend({resourceTemplates:Fr(xFs)}),Lcr=DT.extend({uri:Je()}),kFs=Lcr,PFs=WA.extend({method:Gn("resources/read"),params:kFs}),Bcr=zA.extend({contents:Fr(Il([yVn,EVn]))}),o8=Vw.extend({method:Gn("notifications/resources/list_changed"),params:$w.optional()}),DFs=Lcr,NFs=WA.extend({method:Gn("resources/subscribe"),params:DFs}),MFs=Lcr,OFs=WA.extend({method:Gn("resources/unsubscribe"),params:MFs}),LFs=$w.extend({uri:Je()}),Fcr=Vw.extend({method:Gn("notifications/resources/updated"),params:LFs}),BFs=zr({name:Je(),description:bu(Je()),required:bu(ol())}),FFs=zr({...Wpe.shape,...P2e.shape,description:bu(Je()),arguments:bu(Fr(BFs)),_meta:bu(om({}))}),UFs=D2e.extend({method:Gn("prompts/list")}),Ucr=N2e.extend({prompts:Fr(FFs)}),QFs=DT.extend({name:Je(),arguments:xl(Je(),Je()).optional()}),qFs=WA.extend({method:Gn("prompts/get"),params:QFs}),Qcr=zr({type:Gn("text"),text:Je(),annotations:zpe.optional(),_meta:xl(Je(),od()).optional()}),qcr=zr({type:Gn("image"),data:Ncr,mimeType:Je(),annotations:zpe.optional(),_meta:xl(Je(),od()).optional()}),jcr=zr({type:Gn("audio"),data:Ncr,mimeType:Je(),annotations:zpe.optional(),_meta:xl(Je(),od()).optional()}),jFs=zr({type:Gn("tool_use"),name:Je(),id:Je(),input:xl(Je(),od()),_meta:xl(Je(),od()).optional()}),HFs=zr({type:Gn("resource"),resource:Il([yVn,EVn]),annotations:zpe.optional(),_meta:xl(Je(),od()).optional()}),GFs=_Vn.extend({type:Gn("resource_link")}),Hcr=Il([Qcr,qcr,jcr,GFs,HFs]),$Fs=zr({role:L2e,content:Hcr}),Gcr=zA.extend({description:Je().optional(),messages:Fr($Fs)}),s8=Vw.extend({method:Gn("notifications/prompts/list_changed"),params:$w.optional()}),VFs=zr({title:Je().optional(),readOnlyHint:ol().optional(),destructiveHint:ol().optional(),idempotentHint:ol().optional(),openWorldHint:ol().optional()}),WFs=zr({taskSupport:rv(["required","optional","forbidden"]).optional()}),vVn=zr({...Wpe.shape,...P2e.shape,description:Je().optional(),inputSchema:zr({type:Gn("object"),properties:xl(Je(),y0).optional(),required:Fr(Je()).optional()}).catchall(od()),outputSchema:zr({type:Gn("object"),properties:xl(Je(),y0).optional(),required:Fr(Je()).optional()}).catchall(od()).optional(),annotations:VFs.optional(),execution:WFs.optional(),_meta:xl(Je(),od()).optional()}),zFs=D2e.extend({method:Gn("tools/list")}),$cr=N2e.extend({tools:Fr(vVn)}),uH=zA.extend({content:Fr(Hcr).default([]),structuredContent:xl(Je(),od()).optional(),isError:ol().optional()}),U0f=uH.or(zA.extend({toolResult:od()})),YFs=R2e.extend({name:Je(),arguments:xl(Je(),od()).optional()}),KFs=WA.extend({method:Gn("tools/call"),params:YFs}),a8=Vw.extend({method:Gn("notifications/tools/list_changed"),params:$w.optional()}),CVn=zr({autoRefresh:ol().default(!0),debounceMs:ka().int().nonnegative().default(300)}),bVn=rv(["debug","info","notice","warning","error","critical","alert","emergency"]),JFs=DT.extend({level:bVn}),ZFs=WA.extend({method:Gn("logging/setLevel"),params:JFs}),XFs=$w.extend({level:bVn,logger:Je().optional(),data:od()}),fX=Vw.extend({method:Gn("notifications/message"),params:XFs}),e8s=zr({name:Je().optional()}),t8s=zr({hints:Fr(e8s).optional(),costPriority:ka().min(0).max(1).optional(),speedPriority:ka().min(0).max(1).optional(),intelligencePriority:ka().min(0).max(1).optional()}),r8s=zr({mode:rv(["auto","required","none"]).optional()}),n8s=zr({type:Gn("tool_result"),toolUseId:Je().describe("The unique identifier for the corresponding tool call."),content:Fr(Hcr).default([]),structuredContent:zr({}).loose().optional(),isError:ol().optional(),_meta:xl(Je(),od()).optional()}),i8s=Ert("type",[Qcr,qcr,jcr]),Pat=Ert("type",[Qcr,qcr,jcr,jFs,n8s]),o8s=zr({role:L2e,content:Il([Pat,Fr(Pat)]),_meta:xl(Je(),od()).optional()}),s8s=R2e.extend({messages:Fr(o8s),modelPreferences:t8s.optional(),systemPrompt:Je().optional(),includeContext:rv(["none","thisServer","allServers"]).optional(),temperature:ka().optional(),maxTokens:ka().int(),stopSequences:Fr(Je()).optional(),metadata:y0.optional(),tools:Fr(vVn).optional(),toolChoice:r8s.optional()}),B2e=WA.extend({method:Gn("sampling/createMessage"),params:s8s}),Vcr=zA.extend({model:Je(),stopReason:bu(rv(["endTurn","stopSequence","maxTokens"]).or(Je())),role:L2e,content:i8s}),Wcr=zA.extend({model:Je(),stopReason:bu(rv(["endTurn","stopSequence","maxTokens","toolUse"]).or(Je())),role:L2e,content:Il([Pat,Fr(Pat)])}),a8s=zr({type:Gn("boolean"),title:Je().optional(),description:Je().optional(),default:ol().optional()}),c8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),minLength:ka().optional(),maxLength:ka().optional(),format:rv(["email","uri","date","date-time"]).optional(),default:Je().optional()}),l8s=zr({type:rv(["number","integer"]),title:Je().optional(),description:Je().optional(),minimum:ka().optional(),maximum:ka().optional(),default:ka().optional()}),u8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),enum:Fr(Je()),default:Je().optional()}),d8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),oneOf:Fr(zr({const:Je(),title:Je()})),default:Je().optional()}),f8s=zr({type:Gn("string"),title:Je().optional(),description:Je().optional(),enum:Fr(Je()),enumNames:Fr(Je()).optional(),default:Je().optional()}),p8s=Il([u8s,d8s]),h8s=zr({type:Gn("array"),title:Je().optional(),description:Je().optional(),minItems:ka().optional(),maxItems:ka().optional(),items:zr({type:Gn("string"),enum:Fr(Je())}),default:Fr(Je()).optional()}),m8s=zr({type:Gn("array"),title:Je().optional(),description:Je().optional(),minItems:ka().optional(),maxItems:ka().optional(),items:zr({anyOf:Fr(zr({const:Je(),title:Je()}))}),default:Fr(Je()).optional()}),g8s=Il([h8s,m8s]),A8s=Il([f8s,p8s,g8s]),y8s=Il([A8s,a8s,c8s,l8s]),E8s=R2e.extend({mode:Gn("form").optional(),message:Je(),requestedSchema:zr({type:Gn("object"),properties:xl(Je(),y8s),required:Fr(Je()).optional()})}),_8s=R2e.extend({mode:Gn("url"),message:Je(),elicitationId:Je(),url:Je().url()}),v8s=Il([E8s,_8s]),F2e=WA.extend({method:Gn("elicitation/create"),params:v8s}),C8s=$w.extend({elicitationId:Je()}),b8s=Vw.extend({method:Gn("notifications/elicitation/complete"),params:C8s}),zcr=zA.extend({action:rv(["accept","decline","cancel"]),content:vrt(t=>t===null?void 0:t,xl(Je(),Il([Je(),ka(),ol(),Fr(Je())])).optional())}),S8s=zr({type:Gn("ref/resource"),uri:Je()});var T8s=zr({type:Gn("ref/prompt"),name:Je()}),I8s=DT.extend({ref:Il([T8s,S8s]),argument:zr({name:Je(),value:Je()}),context:zr({arguments:xl(Je(),Je()).optional()}).optional()}),x8s=WA.extend({method:Gn("completion/complete"),params:I8s});var Ycr=zA.extend({completion:om({values:Fr(Je()).max(100),total:bu(ka().int()),hasMore:bu(ol())})}),w8s=zr({uri:Je().startsWith("file://"),name:Je().optional(),_meta:xl(Je(),od()).optional()}),Kcr=WA.extend({method:Gn("roots/list"),params:DT.optional()}),R8s=zA.extend({roots:Fr(w8s)}),k8s=Vw.extend({method:Gn("notifications/roots/list_changed"),params:$w.optional()}),Q0f=Il([Lat,_Fs,x8s,ZFs,qFs,UFs,wFs,RFs,PFs,NFs,OFs,KFs,zFs,Fat,Qat,qat,Hat]),q0f=Il([Oat,Bat,hVn,k8s,O2e]),j0f=Il([uX,Vcr,Wcr,zcr,R8s,Uat,jat,dX]),H0f=Il([Lat,B2e,F2e,Kcr,Fat,Qat,qat,Hat]),G0f=Il([Oat,Bat,fX,Fcr,o8,a8,s8,O2e,b8s]),$0f=Il([uX,Dcr,Ycr,Gcr,Ucr,Mcr,Ocr,Bcr,uH,$cr,Uat,jat,dX]),Un=class t extends Error{static{a(this,"McpError")}constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===ei.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new wcr(o.elicitations,r)}return new t(e,r,n)}},wcr=class extends Un{static{a(this,"UrlElicitationRequiredError")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(ei.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};p();var YA=lJt().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:OJt.custom,message:"URL must be parseable",fatal:!0}),eRe}).refine(t=>{let e=new URL(t);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),TVn=om({resource:Je().url(),authorization_servers:Fr(YA).optional(),jwks_uri:Je().url().optional(),scopes_supported:Fr(Je()).optional(),bearer_methods_supported:Fr(Je()).optional(),resource_signing_alg_values_supported:Fr(Je()).optional(),resource_name:Je().optional(),resource_documentation:Je().optional(),resource_policy_uri:Je().url().optional(),resource_tos_uri:Je().url().optional(),tls_client_certificate_bound_access_tokens:ol().optional(),authorization_details_types_supported:Fr(Je()).optional(),dpop_signing_alg_values_supported:Fr(Je()).optional(),dpop_bound_access_tokens_required:ol().optional()}),Jcr=om({issuer:Je(),authorization_endpoint:YA,token_endpoint:YA,registration_endpoint:YA.optional(),scopes_supported:Fr(Je()).optional(),response_types_supported:Fr(Je()),response_modes_supported:Fr(Je()).optional(),grant_types_supported:Fr(Je()).optional(),token_endpoint_auth_methods_supported:Fr(Je()).optional(),token_endpoint_auth_signing_alg_values_supported:Fr(Je()).optional(),service_documentation:YA.optional(),revocation_endpoint:YA.optional(),revocation_endpoint_auth_methods_supported:Fr(Je()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Fr(Je()).optional(),introspection_endpoint:Je().optional(),introspection_endpoint_auth_methods_supported:Fr(Je()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Fr(Je()).optional(),code_challenge_methods_supported:Fr(Je()).optional(),client_id_metadata_document_supported:ol().optional()}),P8s=om({issuer:Je(),authorization_endpoint:YA,token_endpoint:YA,userinfo_endpoint:YA.optional(),jwks_uri:YA,registration_endpoint:YA.optional(),scopes_supported:Fr(Je()).optional(),response_types_supported:Fr(Je()),response_modes_supported:Fr(Je()).optional(),grant_types_supported:Fr(Je()).optional(),acr_values_supported:Fr(Je()).optional(),subject_types_supported:Fr(Je()),id_token_signing_alg_values_supported:Fr(Je()),id_token_encryption_alg_values_supported:Fr(Je()).optional(),id_token_encryption_enc_values_supported:Fr(Je()).optional(),userinfo_signing_alg_values_supported:Fr(Je()).optional(),userinfo_encryption_alg_values_supported:Fr(Je()).optional(),userinfo_encryption_enc_values_supported:Fr(Je()).optional(),request_object_signing_alg_values_supported:Fr(Je()).optional(),request_object_encryption_alg_values_supported:Fr(Je()).optional(),request_object_encryption_enc_values_supported:Fr(Je()).optional(),token_endpoint_auth_methods_supported:Fr(Je()).optional(),token_endpoint_auth_signing_alg_values_supported:Fr(Je()).optional(),display_values_supported:Fr(Je()).optional(),claim_types_supported:Fr(Je()).optional(),claims_supported:Fr(Je()).optional(),service_documentation:Je().optional(),claims_locales_supported:Fr(Je()).optional(),ui_locales_supported:Fr(Je()).optional(),claims_parameter_supported:ol().optional(),request_parameter_supported:ol().optional(),request_uri_parameter_supported:ol().optional(),require_request_uri_registration:ol().optional(),op_policy_uri:YA.optional(),op_tos_uri:YA.optional(),client_id_metadata_document_supported:ol().optional()}),IVn=zr({...P8s.shape,...Jcr.pick({code_challenge_methods_supported:!0}).shape}),xVn=zr({access_token:Je(),id_token:Je().optional(),token_type:Je(),expires_in:jRe.number().optional(),scope:Je().optional(),refresh_token:Je().optional()}).strip(),wVn=zr({error:Je(),error_description:Je().optional(),error_uri:Je().optional()}),SVn=YA.optional().or(Gn("").transform(()=>{})),D8s=zr({redirect_uris:Fr(YA),token_endpoint_auth_method:Je().optional(),grant_types:Fr(Je()).optional(),response_types:Fr(Je()).optional(),client_name:Je().optional(),client_uri:YA.optional(),logo_uri:SVn,scope:Je().optional(),contacts:Fr(Je()).optional(),tos_uri:SVn,policy_uri:Je().optional(),jwks_uri:YA.optional(),jwks:IJt().optional(),software_id:Je().optional(),software_version:Je().optional(),software_statement:Je().optional()}).strip(),N8s=zr({client_id:Je(),client_secret:Je().optional(),client_id_issued_at:ka().optional(),client_secret_expires_at:ka().optional()}).strip(),RVn=D8s.merge(N8s),Y0f=zr({error:Je(),error_description:Je().optional()}).strip(),K0f=zr({token:Je(),token_type_hint:Je().optional()}).strip();p();function kVn(t){let e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}a(kVn,"resourceUrlFromServerUrl");function PVn({requestedResource:t,configuredResource:e}){let r=typeof t=="string"?new URL(t):new URL(t.href),n=typeof e=="string"?new URL(e):new URL(e.href);if(r.origin!==n.origin||r.pathname.length=400&&t.status<500&&e!=="/"}a(H8s,"shouldAttemptFallback");async function G8s(t,e,r,n){let o=new URL(t),s=n?.protocolVersion??Gw,c;if(n?.metadataUrl)c=new URL(n.metadataUrl);else{let u=j8s(e,o.pathname);c=new URL(u,n?.metadataServerUrl??o),c.search=o.search}let l=await NVn(c,s,r);if(!n?.metadataUrl&&H8s(l,o.pathname)){let u=new URL(`/.well-known/${e}`,o);l=await NVn(u,s,r)}return l}a(G8s,"discoverMetadataWithFallback");function $8s(t){let e=typeof t=="string"?new URL(t):t,r=e.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",e.origin),type:"oidc"}),n;let o=e.pathname;return o.endsWith("/")&&(o=o.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${o}`,e.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${o}`,e.origin),type:"oidc"}),n.push({url:new URL(`${o}/.well-known/openid-configuration`,e.origin),type:"oidc"}),n}a($8s,"buildDiscoveryUrls");async function LVn(t,{fetchFn:e=fetch,protocolVersion:r=Gw}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=$8s(t);for(let{url:s,type:c}of o){let l=await rlr(s,n,e);if(l){if(!l.ok){if(await l.body?.cancel(),l.status>=400&&l.status<500)continue;throw new Error(`HTTP ${l.status} trying to load ${c==="oauth"?"OAuth":"OpenID provider"} metadata from ${s}`)}return c==="oauth"?Jcr.parse(await l.json()):IVn.parse(await l.json())}}}a(LVn,"discoverAuthorizationServerMetadata");async function V8s(t,e){let r,n;try{r=await OVn(t,{resourceMetadataUrl:e?.resourceMetadataUrl},e?.fetchFn),r.authorization_servers&&r.authorization_servers.length>0&&(n=r.authorization_servers[0])}catch{}n||(n=String(new URL("/",t)));let o=await LVn(n,{fetchFn:e?.fetchFn});return{authorizationServerUrl:n,authorizationServerMetadata:o,resourceMetadata:r}}a(V8s,"discoverOAuthServerInfo");async function W8s(t,{metadata:e,clientInformation:r,redirectUrl:n,scope:o,state:s,resource:c}){let l;if(e){if(l=new URL(e.authorization_endpoint),!e.response_types_supported.includes(Zcr))throw new Error(`Incompatible auth server: does not support response type ${Zcr}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(Xcr))throw new Error(`Incompatible auth server: does not support code challenge method ${Xcr}`)}else l=new URL("/authorize",t);let u=await xcr(),d=u.code_verifier,f=u.code_challenge;return l.searchParams.set("response_type",Zcr),l.searchParams.set("client_id",r.client_id),l.searchParams.set("code_challenge",f),l.searchParams.set("code_challenge_method",Xcr),l.searchParams.set("redirect_uri",String(n)),s&&l.searchParams.set("state",s),o&&l.searchParams.set("scope",o),o?.includes("offline_access")&&l.searchParams.append("prompt","consent"),c&&l.searchParams.set("resource",c.href),{authorizationUrl:l,codeVerifier:d}}a(W8s,"startAuthorization");function z8s(t,e,r){return new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:e,redirect_uri:String(r)})}a(z8s,"prepareAuthorizationCodeRequest");async function BVn(t,{metadata:e,tokenRequestParams:r,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c}){let l=e?.token_endpoint?new URL(e.token_endpoint):new URL("/token",t),u=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(s&&r.set("resource",s.href),o)await o(u,r,l,e);else if(n){let f=e?.token_endpoint_auth_methods_supported??[],h=O8s(n,f);L8s(h,n,u,r)}let d=await(c??fetch)(l,{method:"POST",headers:u,body:r});if(!d.ok)throw await MVn(d);return xVn.parse(await d.json())}a(BVn,"executeTokenRequest");async function Y8s(t,{metadata:e,clientInformation:r,refreshToken:n,resource:o,addClientAuthentication:s,fetchFn:c}){let l=new URLSearchParams({grant_type:"refresh_token",refresh_token:n}),u=await BVn(t,{metadata:e,tokenRequestParams:l,clientInformation:r,addClientAuthentication:s,resource:o,fetchFn:c});return{refresh_token:n,...u}}a(Y8s,"refreshAuthorization");async function K8s(t,e,{metadata:r,resource:n,authorizationCode:o,fetchFn:s}={}){let c=t.clientMetadata.scope,l;if(t.prepareTokenRequest&&(l=await t.prepareTokenRequest(c)),!l){if(!o)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!t.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let d=await t.codeVerifier();l=z8s(o,d,t.redirectUrl)}let u=await t.clientInformation();return BVn(e,{metadata:r,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:t.addClientAuthentication,resource:n,fetchFn:s})}a(K8s,"fetchToken");async function J8s(t,{metadata:e,clientMetadata:r,scope:n,fetchFn:o}){let s;if(e){if(!e.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");s=new URL(e.registration_endpoint)}else s=new URL("/register",t);let c=await(o??fetch)(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...r,...n!==void 0?{scope:n}:{}})});if(!c.ok)throw await MVn(c);return RVn.parse(await c.json())}a(J8s,"registerClient");p();p();p();p();function Kpe(t){return!!t._zod}a(Kpe,"isZ4Schema");function P2(t,e){return Kpe(t)?Pde(t,e):t.safeParse(e)}a(P2,"safeParse");function Gat(t){if(!t)return;let e;if(Kpe(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}a(Gat,"getObjectShape");function FVn(t){if(Kpe(t)){let s=t._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}a(FVn,"getLiteralValue");p();function dH(t){return t==="completed"||t==="failed"||t==="cancelled"}a(dH,"isTerminal");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();var NAf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();function nlr(t){let r=Gat(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=FVn(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}a(nlr,"getMethodLiteral");function ilr(t,e){let r=P2(t,e);if(!r.success)throw r.error;return r.data}a(ilr,"parseWithCompat");var n6s=6e4,$at=class{static{a(this,"Protocol")}constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Oat,r=>{this._oncancel(r)}),this.setNotificationHandler(Bat,r=>{this._onprogress(r)}),this.setRequestHandler(Lat,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Fat,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Un(ei.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Qat,async(r,n)=>{let o=a(async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let l;for(;l=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(l.type==="response"||l.type==="error"){let u=l.message,d=u.id,f=this._requestResolvers.get(d);if(f)if(this._requestResolvers.delete(d),l.type==="response")f(u);else{let h=u,m=new Un(h.error.code,h.error.message,h.error.data);f(m)}else{let h=l.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${d}`))}continue}await this._transport?.send(l.message,{relatedRequestId:n.requestId})}}let c=await this._taskStore.getTask(s,n.sessionId);if(!c)throw new Un(ei.InvalidParams,`Task not found: ${s}`);if(!dH(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(dH(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[cH]:{taskId:s}}}}return await o()},"handleTaskResult");return await o()}),this.setRequestHandler(qat,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new Un(ei.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Hat,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Un(ei.InvalidParams,`Task not found: ${r.params.taskId}`);if(dH(o.status))throw new Un(ei.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new Un(ei.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof Un?o:new Un(ei.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),Un.fromError(ei.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,c)=>{o?.(s,c),lX(s)||fVn(s)?this._onresponse(s):k2e(s)?this._onrequest(s,c):dVn(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=Un.fromError(ei.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[cH]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:ei.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:f,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):o?.send(f).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}let c=new AbortController;this._requestHandlerAbortControllers.set(e.id,c);let l=cVn(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,d={signal:c.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:a(async f=>{if(c.signal.aborted)return;let h={relatedRequestId:e.id};s&&(h.relatedTask={taskId:s}),await this.notification(f,h)},"sendNotification"),sendRequest:a(async(f,h,m)=>{if(c.signal.aborted)throw new Un(ei.ConnectionClosed,"Request was cancelled");let g={...m,relatedRequestId:e.id};s&&!g.relatedTask&&(g.relatedTask={taskId:s});let A=g.relatedTask?.taskId??s;return A&&u&&await u.updateTaskStatus(A,"input_required"),await this.request(f,h,g)},"sendRequest"),authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:u,taskRequestedTtl:l?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{l&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,d)).then(async f=>{if(c.signal.aborted)return;let h={result:f,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async f=>{if(c.signal.aborted)return;let h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:ei.InternalError,message:f.message??"Internal error",...f.data!==void 0&&{data:f.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(f=>this._onerror(new Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===c&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let c=this._responseHandlers.get(o),l=this._timeoutInfo.get(o);if(l&&c&&l.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(u){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),c(u);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),lX(e))n(e);else{let c=new Un(e.error.code,e.error.message,e.error.data);n(c)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(lX(e)&&e.result&&typeof e.result=="object"){let c=e.result;if(c.task&&typeof c.task=="object"){let l=c.task;typeof l.taskId=="string"&&(s=!0,this._taskProgressTokens.set(l.taskId,r))}}if(s||this._progressHandlers.delete(r),lX(e))o(e);else{let c=Un.fromError(e.error.code,e.error.message,e.error.data);o(c)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(c){yield{type:"error",error:c instanceof Un?c:new Un(ei.InternalError,String(c))}}return}let s;try{let c=await this.request(e,dX,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new Un(ei.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},dH(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new Un(ei.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new Un(ei.InternalError,`Task ${s} was cancelled`)});return}if(l.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let u=l.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(d=>setTimeout(d,u)),n?.signal?.throwIfAborted()}}catch(c){yield{type:"error",error:c instanceof Un?c:new Un(ei.InternalError,String(c))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c,task:l,relatedTask:u}=n??{};return new Promise((d,f)=>{let h=a(v=>{f(v)},"earlyReject");if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),l&&this.assertTaskCapability(e.method)}catch(v){h(v);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),l&&(g.params={...g.params,task:l}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[cH]:u}});let A=a(v=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(v)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(T=>this._onerror(new Error(`Failed to send cancellation: ${T}`)));let b=v instanceof Un?v:new Un(ei.RequestTimeout,String(v));f(b)},"cancel");this._responseHandlers.set(m,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return f(v);try{let b=P2(r,v.result);b.success?d(b.data):f(b.error)}catch(b){f(b)}}}),n?.signal?.addEventListener("abort",()=>{A(n?.signal?.reason)});let y=n?.timeout??n6s,E=a(()=>A(Un.fromError(ei.RequestTimeout,"Request timed out",{timeout:y})),"timeoutHandler");this._setupTimeout(m,y,n?.maxTotalTimeout,E,n?.resetTimeoutOnProgress??!1);let _=u?.taskId;if(_){let v=a(b=>{let T=this._responseHandlers.get(m);T?T(b):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))},"responseResolver");this._requestResolvers.set(m,v),this._enqueueTaskMessage(_,{type:"request",message:g,timestamp:Date.now()}).catch(b=>{this._cleanupTimeout(m),f(b)})}else this._transport.send(g,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(v=>{this._cleanupTimeout(m),f(v)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Uat,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},jat,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},gVn,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let l={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[cH]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:l,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let l={...e,jsonrpc:"2.0"};r?.relatedTask&&(l={...l,params:{...l.params,_meta:{...l.params?._meta||{},[cH]:r.relatedTask}}}),this._transport?.send(l,r).catch(u=>this._onerror(u))});return}let c={...e,jsonrpc:"2.0"};r?.relatedTask&&(c={...c,params:{...c.params,_meta:{...c.params?._meta||{},[cH]:r.relatedTask}}}),await this._transport.send(c,r)}setRequestHandler(e,r){let n=nlr(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=ilr(e,o);return Promise.resolve(r(c,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=nlr(e);this._notificationHandlers.set(n,o=>{let s=ilr(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&k2e(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new Un(ei.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new Un(ei.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new Un(ei.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:a(async o=>{if(!e)throw new Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},"createTask"),getTask:a(async o=>{let s=await n.getTask(o,r);if(!s)throw new Un(ei.InvalidParams,"Failed to retrieve task: Task not found");return s},"getTask"),storeTaskResult:a(async(o,s,c)=>{await n.storeTaskResult(o,s,c,r);let l=await n.getTask(o,r);if(l){let u=O2e.parse({method:"notifications/tasks/status",params:l});await this.notification(u),dH(l.status)&&this._cleanupTaskProgressHandler(o)}},"storeTaskResult"),getTaskResult:a(o=>n.getTaskResult(o,r),"getTaskResult"),updateTaskStatus:a(async(o,s,c)=>{let l=await n.getTask(o,r);if(!l)throw new Un(ei.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(dH(l.status))throw new Un(ei.InvalidParams,`Cannot update task "${o}" from terminal status "${l.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,c,r);let u=await n.getTask(o,r);if(u){let d=O2e.parse({method:"notifications/tasks/status",params:u});await this.notification(d),dH(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};function UVn(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}a(UVn,"isPlainObject");function QVn(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let c=r[o];UVn(c)&&UVn(s)?r[o]={...c,...s}:r[o]=s}return r}a(QVn,"mergeCapabilities");p();var PYn=de(Gur(),1),DYn=de(kYn(),1);function sjs(){let t=new PYn.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,DYn.default)(t),t}a(sjs,"createDefaultAjvInstance");var Ict=class{static{a(this,"AjvJsonSchemaValidator")}constructor(e){this._ajv=e??sjs()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};p();var xct=class{static{a(this,"ExperimentalClientTasks")}constructor(e){this._client=e}async*callToolStream(e,r=uH,n){let o=this._client,s={...n,task:n?.task??(o.isToolTask(e.name)?{}:void 0)},c=o.requestStream({method:"tools/call",params:e},r,s),l=o.getToolOutputValidator(e.name);for await(let u of c){if(u.type==="result"&&l){let d=u.result;if(!d.structuredContent&&!d.isError){yield{type:"error",error:new Un(ei.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(d.structuredContent)try{let f=l(d.structuredContent);if(!f.valid){yield{type:"error",error:new Un(ei.InvalidParams,`Structured content does not match the tool's output schema: ${f.errorMessage}`)};return}}catch(f){if(f instanceof Un){yield{type:"error",error:f};return}yield{type:"error",error:new Un(ei.InvalidParams,`Failed to validate structured content: ${f instanceof Error?f.message:String(f)}`)};return}}yield u}}async getTask(e,r){return this._client.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._client.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._client.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._client.cancelTask({taskId:e},r)}requestStream(e,r,n){return this._client.requestStream(e,r,n)}};p();function NYn(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}a(NYn,"assertToolsCallTaskCapability");function MYn(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}a(MYn,"assertClientRequestTaskCapability");function wct(t,e){if(!(!t||e===null||typeof e!="object")){if(t.type==="object"&&t.properties&&typeof t.properties=="object"){let r=e,n=t.properties;for(let o of Object.keys(n)){let s=n[o];r[o]===void 0&&Object.prototype.hasOwnProperty.call(s,"default")&&(r[o]=s.default),r[o]!==void 0&&wct(s,r[o])}}if(Array.isArray(t.anyOf))for(let r of t.anyOf)typeof r!="boolean"&&wct(r,e);if(Array.isArray(t.oneOf))for(let r of t.oneOf)typeof r!="boolean"&&wct(r,e)}}a(wct,"applyElicitationDefaults");function ajs(t){if(!t)return{supportsFormMode:!1,supportsUrlMode:!1};let e=t.form!==void 0,r=t.url!==void 0;return{supportsFormMode:e||!e&&!r,supportsUrlMode:r}}a(ajs,"getSupportedElicitationModes");var _H=class extends $at{static{a(this,"Client")}constructor(e,r){super(r),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=r?.capabilities??{},this._jsonSchemaValidator=r?.jsonSchemaValidator??new Ict,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",a8,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",s8,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",o8,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new xct(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=QVn(this._capabilities,e)}setRequestHandler(e,r){let o=Gat(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(Kpe(o)){let l=o;s=l._zod?.def?.value??l.value}else{let l=o;s=l._def?.value??l.value}if(typeof s!="string")throw new Error("Schema method literal must be a string");let c=s;if(c==="elicitation/create"){let l=a(async(u,d)=>{let f=P2(F2e,u);if(!f.success){let v=f.error instanceof Error?f.error.message:String(f.error);throw new Un(ei.InvalidParams,`Invalid elicitation request: ${v}`)}let{params:h}=f.data;h.mode=h.mode??"form";let{supportsFormMode:m,supportsUrlMode:g}=ajs(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new Un(ei.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new Un(ei.InvalidParams,"Client does not support URL-mode elicitation requests");let A=await Promise.resolve(r(u,d));if(h.task){let v=P2(dX,A);if(!v.success){let b=v.error instanceof Error?v.error.message:String(v.error);throw new Un(ei.InvalidParams,`Invalid task creation result: ${b}`)}return v.data}let y=P2(zcr,A);if(!y.success){let v=y.error instanceof Error?y.error.message:String(y.error);throw new Un(ei.InvalidParams,`Invalid elicitation result: ${v}`)}let E=y.data,_=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&E.action==="accept"&&E.content&&_&&this._capabilities.elicitation?.form?.applyDefaults)try{wct(_,E.content)}catch{}return E},"wrappedHandler");return super.setRequestHandler(e,l)}if(c==="sampling/createMessage"){let l=a(async(u,d)=>{let f=P2(B2e,u);if(!f.success){let E=f.error instanceof Error?f.error.message:String(f.error);throw new Un(ei.InvalidParams,`Invalid sampling request: ${E}`)}let{params:h}=f.data,m=await Promise.resolve(r(u,d));if(h.task){let E=P2(dX,m);if(!E.success){let _=E.error instanceof Error?E.error.message:String(E.error);throw new Un(ei.InvalidParams,`Invalid task creation result: ${_}`)}return E.data}let A=h.tools||h.toolChoice?Wcr:Vcr,y=P2(A,m);if(!y.success){let E=y.error instanceof Error?y.error.message:String(y.error);throw new Un(ei.InvalidParams,`Invalid sampling result: ${E}`)}return y.data},"wrappedHandler");return super.setRequestHandler(e,l)}return super.setRequestHandler(e,r)}assertCapability(e,r){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${r})`)}async connect(e,r){if(await super.connect(e),e.sessionId===void 0)try{let n=await this.request({method:"initialize",params:{protocolVersion:Gw,capabilities:this._capabilities,clientInfo:this._clientInfo}},Dcr,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!Dat.includes(n.protocolVersion))throw new Error(`Server's protocol version is not supported: ${n.protocolVersion}`);this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(n.protocolVersion),this._instructions=n.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(n){throw this.close(),n}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break;case"ping":break}}assertTaskCapability(e){NYn(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&MYn(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},uX,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},Ycr,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},uX,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},Gcr,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},Ucr,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},Mcr,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},Ocr,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},Bcr,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},uX,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},uX,r)}async callTool(e,r=uH,n){if(this.isToolTaskRequired(e.name))throw new Un(ei.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let o=await this.request({method:"tools/call",params:e},r,n),s=this.getToolOutputValidator(e.name);if(s){if(!o.structuredContent&&!o.isError)throw new Un(ei.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent)try{let c=s(o.structuredContent);if(!c.valid)throw new Un(ei.InvalidParams,`Structured content does not match the tool's output schema: ${c.errorMessage}`)}catch(c){throw c instanceof Un?c:new Un(ei.InvalidParams,`Failed to validate structured content: ${c instanceof Error?c.message:String(c)}`)}}return o}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(let r of e){if(r.outputSchema){let o=this._jsonSchemaValidator.getValidator(r.outputSchema);this._cachedToolOutputValidators.set(r.name,o)}let n=r.execution?.taskSupport;(n==="required"||n==="optional")&&this._cachedKnownTaskTools.add(r.name),n==="required"&&this._cachedRequiredTaskTools.add(r.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,r){let n=await this.request({method:"tools/list",params:e},$cr,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,r,n,o){let s=CVn.safeParse(n);if(!s.success)throw new Error(`Invalid ${e} listChanged options: ${s.error.message}`);if(typeof n.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:c,debounceMs:l}=s.data,{onChanged:u}=n,d=a(async()=>{if(!c){u(null,null);return}try{let h=await o();u(null,h)}catch(h){let m=h instanceof Error?h:new Error(String(h));u(m,null)}},"refresh"),f=a(()=>{if(l){let h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);let m=setTimeout(d,l);this._listChangedDebounceTimers.set(e,m)}else d()},"handler");this.setNotificationHandler(r,f)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};p();p();p();var Rct=class extends Error{static{a(this,"ParseError")}constructor(e,r){super(e),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}};function Zur(t){}a(Zur,"noop");function kct(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:e=Zur,onError:r=Zur,onRetry:n=Zur,onComment:o}=t,s="",c=!0,l,u="",d="";function f(y){let E=c?y.replace(/^\xEF\xBB\xBF/,""):y,[_,v]=cjs(`${s}${E}`);for(let b of _)h(b);s=v,c=!1}a(f,"feed");function h(y){if(y===""){g();return}if(y.startsWith(":")){o&&o(y.slice(y.startsWith(": ")?2:1));return}let E=y.indexOf(":");if(E!==-1){let _=y.slice(0,E),v=y[E+1]===" "?2:1,b=y.slice(E+v);m(_,b,y);return}m(y,"",y)}a(h,"parseLine");function m(y,E,_){switch(y){case"event":d=E;break;case"data":u=`${u}${E} -`;break;case"id":l=E.includes("\0")?void 0:E;break;case"retry":/^\d+$/.test(E)?n(parseInt(E,10)):r(new Rct(`Invalid \`retry\` value: "${E}"`,{type:"invalid-retry",value:E,line:_}));break;default:r(new Rct(`Unknown field "${y.length>20?`${y.slice(0,20)}\u2026`:y}"`,{type:"unknown-field",field:y,value:E,line:_}));break}}a(m,"processField");function g(){u.length>0&&e({id:l,event:d||void 0,data:u.endsWith(` -`)?u.slice(0,-1):u}),l=void 0,u="",d=""}a(g,"dispatchEvent");function A(y={}){s&&y.consume&&h(s),c=!0,l=void 0,u="",d="",s=""}return a(A,"reset"),{feed:f,reset:A}}a(kct,"createParser");function cjs(t){let e=[],r="",n=0;for(;n{throw TypeError(t)},"__typeError"),adr=a((t,e,r)=>e.has(t)||BYn("Cannot "+r),"__accessCheck"),na=a((t,e,r)=>(adr(t,e,"read from private field"),r?r.call(t):e.get(t)),"__privateGet"),E0=a((t,e,r)=>e.has(t)?BYn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),"__privateAdd"),Vd=a((t,e,r,n)=>(adr(t,e,"write to private field"),e.set(t,r),r),"__privateSet"),m8=a((t,e,r)=>(adr(t,e,"access private method"),r),"__privateMethod"),xb,wX,mhe,Pct,Nct,RDe,yhe,kDe,vH,ghe,Ehe,Ahe,xDe,B2,edr,tdr,rdr,LYn,ndr,idr,wDe,odr,sdr,RX=class extends EventTarget{static{a(this,"EventSource")}constructor(e,r){var n,o;super(),E0(this,B2),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,E0(this,xb),E0(this,wX),E0(this,mhe),E0(this,Pct),E0(this,Nct),E0(this,RDe),E0(this,yhe),E0(this,kDe,null),E0(this,vH),E0(this,ghe),E0(this,Ehe,null),E0(this,Ahe,null),E0(this,xDe,null),E0(this,tdr,async s=>{var c;na(this,ghe).reset();let{body:l,redirected:u,status:d,headers:f}=s;if(d===204){m8(this,B2,wDe).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(u?Vd(this,mhe,new URL(s.url)):Vd(this,mhe,void 0),d!==200){m8(this,B2,wDe).call(this,`Non-200 status code (${d})`,d);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){m8(this,B2,wDe).call(this,'Invalid content type, expected "text/event-stream"',d);return}if(na(this,xb)===this.CLOSED)return;Vd(this,xb,this.OPEN);let h=new Event("open");if((c=na(this,xDe))==null||c.call(this,h),this.dispatchEvent(h),typeof l!="object"||!l||!("getReader"in l)){m8(this,B2,wDe).call(this,"Invalid response body, expected a web ReadableStream",d),this.close();return}let m=new TextDecoder,g=l.getReader(),A=!0;do{let{done:y,value:E}=await g.read();E&&na(this,ghe).feed(m.decode(E,{stream:!y})),y&&(A=!1,na(this,ghe).reset(),m8(this,B2,odr).call(this))}while(A)}),E0(this,rdr,s=>{Vd(this,vH,void 0),!(s.name==="AbortError"||s.type==="aborted")&&m8(this,B2,odr).call(this,Xur(s))}),E0(this,ndr,s=>{typeof s.id=="string"&&Vd(this,kDe,s.id);let c=new MessageEvent(s.event||"message",{data:s.data,origin:na(this,mhe)?na(this,mhe).origin:na(this,wX).origin,lastEventId:s.id||""});na(this,Ahe)&&(!s.event||s.event==="message")&&na(this,Ahe).call(this,c),this.dispatchEvent(c)}),E0(this,idr,s=>{Vd(this,RDe,s)}),E0(this,sdr,()=>{Vd(this,yhe,void 0),na(this,xb)===this.CONNECTING&&m8(this,B2,edr).call(this)});try{if(e instanceof URL)Vd(this,wX,e);else if(typeof e=="string")Vd(this,wX,new URL(e,ujs()));else throw new Error("Invalid URL")}catch{throw ljs("An invalid or illegal string was specified")}Vd(this,ghe,kct({onEvent:na(this,ndr),onRetry:na(this,idr)})),Vd(this,xb,this.CONNECTING),Vd(this,RDe,3e3),Vd(this,Nct,(n=r?.fetch)!=null?n:globalThis.fetch),Vd(this,Pct,(o=r?.withCredentials)!=null?o:!1),m8(this,B2,edr).call(this)}get readyState(){return na(this,xb)}get url(){return na(this,wX).href}get withCredentials(){return na(this,Pct)}get onerror(){return na(this,Ehe)}set onerror(e){Vd(this,Ehe,e)}get onmessage(){return na(this,Ahe)}set onmessage(e){Vd(this,Ahe,e)}get onopen(){return na(this,xDe)}set onopen(e){Vd(this,xDe,e)}addEventListener(e,r,n){let o=r;super.addEventListener(e,o,n)}removeEventListener(e,r,n){let o=r;super.removeEventListener(e,o,n)}close(){na(this,yhe)&&clearTimeout(na(this,yhe)),na(this,xb)!==this.CLOSED&&(na(this,vH)&&na(this,vH).abort(),Vd(this,xb,this.CLOSED),Vd(this,vH,void 0))}};xb=new WeakMap,wX=new WeakMap,mhe=new WeakMap,Pct=new WeakMap,Nct=new WeakMap,RDe=new WeakMap,yhe=new WeakMap,kDe=new WeakMap,vH=new WeakMap,ghe=new WeakMap,Ehe=new WeakMap,Ahe=new WeakMap,xDe=new WeakMap,B2=new WeakSet,edr=a(function(){Vd(this,xb,this.CONNECTING),Vd(this,vH,new AbortController),na(this,Nct)(na(this,wX),m8(this,B2,LYn).call(this)).then(na(this,tdr)).catch(na(this,rdr))},"connect_fn"),tdr=new WeakMap,rdr=new WeakMap,LYn=a(function(){var t;let e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...na(this,kDe)?{"Last-Event-ID":na(this,kDe)}:void 0},cache:"no-store",signal:(t=na(this,vH))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},"getRequestOptions_fn"),ndr=new WeakMap,idr=new WeakMap,wDe=a(function(t,e){var r;na(this,xb)!==this.CLOSED&&Vd(this,xb,this.CLOSED);let n=new Dct("error",{code:e,message:t});(r=na(this,Ehe))==null||r.call(this,n),this.dispatchEvent(n)},"failConnection_fn"),odr=a(function(t,e){var r;if(na(this,xb)===this.CLOSED)return;Vd(this,xb,this.CONNECTING);let n=new Dct("error",{code:e,message:t});(r=na(this,Ehe))==null||r.call(this,n),this.dispatchEvent(n),Vd(this,yhe,setTimeout(na(this,sdr),na(this,RDe)))},"scheduleReconnect_fn"),sdr=new WeakMap,RX.CONNECTING=0,RX.OPEN=1,RX.CLOSED=2;function ujs(){let t="document"in globalThis?globalThis.document:void 0;return t&&typeof t=="object"&&"baseURI"in t&&typeof t.baseURI=="string"?t.baseURI:void 0}a(ujs,"getBaseURL");p();function _he(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):{...t}:{}}a(_he,"normalizeHeaders");function Mct(t=fetch,e){return e?async(r,n)=>{let o={...e,...n,headers:n?.headers?{..._he(e.headers),..._he(n.headers)}:e.headers};return t(r,o)}:t}a(Mct,"createFetchWithInit");var PDe=class extends Error{static{a(this,"SseError")}constructor(e,r,n){super(`SSE error: ${r}`),this.code=e,this.event=n}},vhe=class{static{a(this,"SSEClientTransport")}constructor(e,r){this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=r?.eventSourceInit,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=Mct(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new KA("No auth provider");let e;try{e=await l8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new KA;return await this._startOrAuth()}async _commonHeaders(){let e={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);let r=_he(this._requestInit?.headers);return new Headers({...e,...r})}_startOrAuth(){let e=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((r,n)=>{this._eventSource=new RX(this._url.href,{...this._eventSourceInit,fetch:a(async(o,s)=>{let c=await this._commonHeaders();c.set("Accept","text/event-stream");let l=await e(o,{...s,headers:c});if(l.status===401&&l.headers.has("www-authenticate")){let{resourceMetadataUrl:u,scope:d}=Ype(l);this._resourceMetadataUrl=u,this._scope=d}return l},"fetch")}),this._abortController=new AbortController,this._eventSource.onerror=o=>{if(o.code===401&&this._authProvider){this._authThenStart().then(r,n);return}let s=new PDe(o.code,o.message,o);n(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",o=>{let s=o;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(c){n(c),this.onerror?.(c),this.close();return}r()}),this._eventSource.onmessage=o=>{let s=o,c;try{c=lH.parse(JSON.parse(s.data))}catch(l){this.onerror?.(l);return}this.onmessage?.(c)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(e){if(!this._authProvider)throw new KA("No auth provider");if(await l8(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new KA("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(e){if(!this._endpoint)throw new Error("Not connected");try{let r=await this._commonHeaders();r.set("content-type","application/json");let n={...this._requestInit,method:"POST",headers:r,body:JSON.stringify(e),signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._endpoint,n);if(!o.ok){let s=await o.text().catch(()=>null);if(o.status===401&&this._authProvider){let{resourceMetadataUrl:c,scope:l}=Ype(o);if(this._resourceMetadataUrl=c,this._scope=l,await l8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new KA;return this.send(e)}throw new Error(`Error POSTing to endpoint (HTTP ${o.status}): ${s}`)}await o.body?.cancel()}catch(r){throw this.onerror?.(r),r}}setProtocolVersion(e){this._protocolVersion=e}};p();p();var Oct=class extends TransformStream{static{a(this,"EventSourceParserStream")}constructor({onError:e,onRetry:r,onComment:n}={}){let o;super({start(s){o=kct({onEvent:a(c=>{s.enqueue(c)},"onEvent"),onError(c){e==="terminate"?s.error(c):typeof e=="function"&&e(c)},onRetry:r,onComment:n})},transform(s){o.feed(s)}})}};var djs={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Jw=class extends Error{static{a(this,"StreamableHTTPError")}constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}},Che=class{static{a(this,"StreamableHTTPClientTransport")}constructor(e,r){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=Mct(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??djs}async _authThenStart(){if(!this._authProvider)throw new KA("No auth provider");let e;try{e=await l8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new KA;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let e={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);let r=_he(this._requestInit?.headers);return new Headers({...e,...r})}async _startOrAuthSse(e){let{resumptionToken:r}=e;try{let n=await this._commonHeaders();n.set("Accept","text/event-stream"),r&&n.set("last-event-id",r);let o=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!o.ok){if(await o.body?.cancel(),o.status===401&&this._authProvider)return await this._authThenStart();if(o.status===405)return;throw new Jw(o.status,`Failed to open SSE stream: ${o.statusText}`)}this._handleSseStream(o.body,e,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,o=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,e),o)}_scheduleReconnection(e,r=0){let n=this._reconnectionOptions.maxRetries;if(r>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}let o=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(s=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${s instanceof Error?s.message:String(s)}`)),this._scheduleReconnection(e,r+1)})},o)}_handleSseStream(e,r,n){if(!e)return;let{onresumptiontoken:o,replayMessageId:s}=r,c,l=!1,u=!1;a(async()=>{try{let f=e.pipeThrough(new TextDecoderStream).pipeThrough(new Oct({onRetry:a(g=>{this._serverRetryMs=g},"onRetry")})).getReader();for(;;){let{value:g,done:A}=await f.read();if(A)break;if(g.id&&(c=g.id,l=!0,o?.(g.id)),!!g.data&&(!g.event||g.event==="message"))try{let y=lH.parse(JSON.parse(g.data));lX(y)&&(u=!0,s!==void 0&&(y.id=s)),this.onmessage?.(y)}catch(y){this.onerror?.(y)}}(n||l)&&!u&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:c,onresumptiontoken:o,replayMessageId:s},0)}catch(f){if(this.onerror?.(new Error(`SSE stream disconnected: ${f}`)),(n||l)&&!u&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:c,onresumptiontoken:o,replayMessageId:s},0)}catch(g){this.onerror?.(new Error(`Failed to reconnect: ${g instanceof Error?g.message:String(g)}`))}}},"processStream")()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new KA("No auth provider");if(await l8(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new KA("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,r){try{let{resumptionToken:n,onresumptiontoken:o}=r||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:k2e(e)?e.id:void 0}).catch(m=>this.onerror?.(m));return}let s=await this._commonHeaders();s.set("content-type","application/json"),s.set("accept","application/json, text/event-stream");let c={...this._requestInit,method:"POST",headers:s,body:JSON.stringify(e),signal:this._abortController?.signal},l=await(this._fetch??fetch)(this._url,c),u=l.headers.get("mcp-session-id");if(u&&(this._sessionId=u),!l.ok){let m=await l.text().catch(()=>null);if(l.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new Jw(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:g,scope:A}=Ype(l);if(this._resourceMetadataUrl=g,this._scope=A,await l8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new KA;return this._hasCompletedAuthFlow=!0,this.send(e)}if(l.status===403&&this._authProvider){let{resourceMetadataUrl:g,scope:A,error:y}=Ype(l);if(y==="insufficient_scope"){let E=l.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===E)throw new Jw(403,"Server returned 403 after trying upscoping");if(A&&(this._scope=A),g&&(this._resourceMetadataUrl=g),this._lastUpscopingHeader=E??void 0,await l8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new KA;return this.send(e)}}throw new Jw(l.status,`Error POSTing to endpoint: ${m}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,l.status===202){await l.body?.cancel(),mVn(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(m=>this.onerror?.(m));return}let f=(Array.isArray(e)?e:[e]).filter(m=>"method"in m&&"id"in m&&m.id!==void 0).length>0,h=l.headers.get("content-type");if(f)if(h?.includes("text/event-stream"))this._handleSseStream(l.body,{onresumptiontoken:o},!1);else if(h?.includes("application/json")){let m=await l.json(),g=Array.isArray(m)?m.map(A=>lH.parse(A)):[lH.parse(m)];for(let A of g)this.onmessage?.(A)}else throw await l.body?.cancel(),new Jw(-1,`Unexpected content type: ${h}`);else await l.body?.cancel()}catch(n){throw this.onerror?.(n),n}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,r);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new Jw(n.status,`Failed to terminate session: ${n.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,r){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:r?.onresumptiontoken})}};var QYn=require("events");var bhe=class extends Error{static{a(this,"HttpInvokerUnauthorizedError")}constructor(e="Upstream MCP server requires authorization"){super(e),this.name="HttpInvokerUnauthorizedError"}},DDe=class{constructor(e){this._transport=null;this._emitter=new QYn.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._effectiveType=e.type,this._emitter.setMaxListeners(0),this._client=new _H({name:e.clientInfo.name,version:e.clientInfo.version},{capabilities:{}})}static{a(this,"HttpInvoker")}get isConnected(){return this._connected}async start(){if(this._connected)return;this._effectiveType=this._options.type;let e=!1,r=this._options.authProvider?["none","silent","interactive"]:["none"],n;for(let o=0;o{}),this._transport=null,!e&&s==="none"&&this._effectiveType==="http"){let u=fjs(l);if(u!==void 0){e=!0,this._effectiveType="sse",this._options.onFallback?.({fromCode:u}),o--;continue}}if(!FYn(l))throw l}}throw FYn(n)?new bhe:n instanceof Error?n:new Error("HttpInvoker.start exhausted retries without a recoverable error")}async _connectOnce(e){let r=new URL(this._options.url),n=this._effectiveType==="sse"?new vhe(r,UYn(this._options.sseOptions,e)):new Che(r,UYn(this._options.httpOptions,e));this._transport=n,this._client.onerror=o=>this._options.onError?.(o),this._client.onclose=()=>{this._connected=!1},this._client.setNotificationHandler(a8,()=>{this._emitter.emit(zl.ToolsListChanged)}),this._client.setNotificationHandler(o8,()=>{this._emitter.emit(zl.ResourcesListChanged)}),this._client.setNotificationHandler(s8,()=>{this._emitter.emit(zl.PromptsListChanged)}),this._client.setNotificationHandler(fX,o=>{this._emitter.emit(zl.LoggingMessage,o)}),await this._client.connect(n)}async stop(){if(!this._transport){this._connected=!1;return}this._transport=null,await this._client.close().catch(()=>{}),this._connected=!1}listTools(){return this._client.listTools()}callTool(e,r){return this._client.callTool({name:e,arguments:r})}listResources(){return this._client.listResources()}readResource(e){return this._client.readResource({uri:e})}listResourceTemplates(){return this._client.listResourceTemplates()}listPrompts(){return this._client.listPrompts()}getPrompt(e,r){return this._client.getPrompt({name:e,arguments:r})}async setLoggingLevel(e){await this._client.setLoggingLevel(e.level)}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}};function FYn(t){if(t instanceof KA)return!0;if(!t||typeof t!="object")return!1;let e=t;return e.name==="UnauthorizedError"||e.status===401||e.code===401}a(FYn,"isUnauthorized");function fjs(t){if(!t||typeof t!="object")return;let e=t;if(!(t instanceof Jw||e.name==="StreamableHTTPError"))return;let n=typeof e.code=="number"?e.code:typeof e.status=="number"?e.status:void 0;if(!(n===void 0||n===401||n<400||n>=500))return n}a(fjs,"httpFallbackCode");function UYn(t,e){if(!e)return t;let r={...t?.requestInit??{}},n=new Headers(r.headers);return n.set("Authorization",`Bearer ${e}`),r.headers=Object.fromEntries(n.entries()),{...t,requestInit:r}}a(UYn,"withBearer");p();function Lct(t){if(typeof t!="object"||t===null||t.jsonrpc!=="2.0"||typeof t.method!="string"||!("id"in t))return!1;let e=t.id;return typeof e=="string"||typeof e=="number"}a(Lct,"isJsonRpcRequest");function qYn(t){return typeof t=="object"&&t!==null&&t.jsonrpc==="2.0"&&typeof t.method=="string"&&!("id"in t)}a(qYn,"isJsonRpcNotification");var Xw={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603},Zw=class extends Error{constructor(r,n,o){super(n);this.code=r;this.data=o;this.name="JsonRpcError"}static{a(this,"JsonRpcError")}};p();p();p();p();p();var F2=class{static{a(this,"McpRuntimeNotifier")}},Bct=class extends F2{static{a(this,"NoOpMcpRuntimeNotifier")}async notifyLog(e){}};var sr=new fe("CopilotMCP");async function cdr(t,e){await t.get(F2).notifyLog(e)}a(cdr,"notifyMCPRuntimeLog");async function _0(t,e){await cdr(t,{...e,level:"error"})}a(_0,"notifyMCPRuntimeError");async function kX(t,e){await cdr(t,{...e,level:"warning"})}a(kX,"notifyMCPRuntimeWarning");async function lc(t,e){await cdr(t,{...e,level:"info"})}a(lc,"notifyMCPRuntimeInfo");p();async function PX(t,e,r,n,o){return await t.get(tr).fetch(new URL(e).href,{method:r,headers:n,body:o})}a(PX,"fetchOauthServer");async function ldr(t){try{return await t.text()}catch{return t.statusText}}a(ldr,"getErrText");p();var jYn="/.well-known",udr=`${jYn}/oauth-protected-resource`,HYn=`${jYn}/oauth-authorization-server`,GYn=" ";function $Yn(t){return typeof t!="object"||t===null?!1:t.resource!==void 0}a($Yn,"isAuthorizationProtectedResourceMetadata");function VYn(t){return typeof t!="object"||t===null?!1:t.issuer!==void 0}a(VYn,"isAuthorizationServerMetadata");function Fct(t){let e=t.split(" "),r=e[0],n={};return e.length>1&&e.slice(1).join(" ").split(",").forEach(s=>{let[c,l]=s.split("=").map(u=>u.trim().replace(/"/g,""));n[c]=l}),{scheme:r,params:n}}a(Fct,"parseWWWAuthenticateHeader");function WYn(t){let e=new URL(t.issuer);return{...t,authorization_endpoint:t.authorization_endpoint??new URL("/authorize",e).toString(),token_endpoint:t.token_endpoint??new URL("/token",e).toString(),registration_endpoint:t.registration_endpoint??new URL("/register",e).toString()}}a(WYn,"getMetadataWithDefaultValues");function zYn(t){return{issuer:t.toString(),authorization_endpoint:new URL("/authorize",t).toString(),token_endpoint:new URL("/token",t).toString(),registration_endpoint:new URL("/register",t).toString(),response_types_supported:["code","id_token","id_token token"]}}a(zYn,"getDefaultMetadataForUrl");function YYn(t){let e=new URL(t);if(!e.pathname.startsWith(udr))throw new Error(`Invalid discovery URL: expected path to start with ${udr}`);let r=e.pathname.substring(udr.length),n=new URL(e.origin);return n.pathname=r||"/",n.toString()}a(YYn,"getResourceServerBaseUrlFromDiscoveryUrl");function KYn(t){return typeof t!="object"||t===null?!1:t.client_id!==void 0}a(KYn,"isAuthorizationDynamicClientRegistrationResponse");function Uct(t){if(typeof t!="object"||t===null)return!1;let e=t;return e.access_token!==void 0&&e.token_type!==void 0}a(Uct,"isAuthorizationTokenResponse");function ddr(t){let e=t.split(".");if(e.length!==3)throw new Error("Invalid JWT token format: token must have three parts separated by dots");let[r,n,o]=e;try{if(typeof JSON.parse(j$t(r))!="object")throw new Error("Invalid JWT token format: header is not a JSON object");let c=JSON.parse(j$t(n));if(typeof c!="object")throw new Error("Invalid JWT token format: payload is not a JSON object");return c}catch(s){throw s instanceof Error?new Error(`Failed to parse JWT token: ${s.message}`):new Error("Failed to parse JWT token")}}a(ddr,"getClaimsFromJWT");var fdr=class{static{a(this,"AuthMetadata")}},She=class extends fdr{static{a(this,"MCPAuthMetadata")}constructor(e){super(),this.ctx=e}async getMetadataFromOriginalUrl(e,r){let n=await this.getResourceMetadataChallenge(e),o,s,c,l=await this.getResourceMetadata(n,{url:e,headers:r??{}});l.resource&&(o=l.authorization_servers?.[0],s=l.scopes_supported,c=l);let u=new URL(e).origin,d={};o||(o=u,d=r??{});let f;try{let m=await this.getAuthorizationServerMetadata(o,d),g=WYn(m);return f={authorizationServer:o,serverMetadata:g,resourceMetadata:c},sr.info(this.ctx,"authMetadata",f),f}catch(m){sr.warn(this.ctx,`Error populating auth metadata: ${String(m)}`)}let h=zYn(new URL(u));return h.scopes_supported=s??h.scopes_supported??[],f={authorizationServer:o,serverMetadata:h,resourceMetadata:c},f}async getResourceMetadataChallenge(e){let r=await PX(this.ctx,e,"POST"),n;if(r.status===401&&r.headers.has("WWW-Authenticate")){let o=r.headers.get("WWW-Authenticate"),{scheme:s,params:c}=Fct(o);s==="Bearer"&&c.resource_metadata&&(n=c.resource_metadata)}return n}async getResourceMetadata(e,r){if(!e)return{resource:""};let n=new URL(e),o=new URL(r.url),s={};n.origin===o.origin&&(s=r.headers);let c=await PX(this.ctx,e,"GET",{...s,Accept:"application/json","MCP-Protocol-Version":Gw});if(c.status!==200)throw new Error(`Failed to fetch resource metadata: ${c.status} ${await ldr(c)}`);let l=await c.json();if($Yn(l)){let u=YYn(e),d=new URL(l.resource).toString(),f=new URL(u).toString();if(d!==f)throw new Error(`Protected Resource Metadata resource "${d}" does not match MCP server resolved resource "${f}". The MCP server must follow OAuth spec https://datatracker.ietf.org/doc/html/rfc9728#PRConfigurationValidation`);return l}else throw new Error(`Invalid resource metadata: ${JSON.stringify(l)}`)}async getAuthorizationServerMetadata(e,r){let n=new URL(e),o=n.pathname==="/"?"":n.pathname,s=new URL(HYn,e).toString()+o,c=await PX(this.ctx,s,"GET",{...r,Accept:"application/json","MCP-Protocol-Version":Gw});if(c.status!==200&&(c=await PX(this.ctx,wa(e,".well-known","openid-configuration"),"GET",{...r,Accept:"application/json","MCP-Protocol-Version":Gw}),c.status!==200))throw new Error(`Failed to fetch authorization server metadata: ${c.status} ${await ldr(c)}`);let l=await c.json();if(VYn(l))return l;throw new Error(`Invalid authorization server metadata: ${JSON.stringify(l)}`)}};p();var wb=class{static{a(this,"McpAuthService")}};var X5=new fe("mcpGateway");async function JYn(t,e,r){X5.info(t,`OAuth discovery: probing ${e}`);try{let n=await new She(t).getMetadataFromOriginalUrl(e,r),o=n.resourceMetadata?.scopes_supported||n.serverMetadata.scopes_supported||[];return X5.info(t,`OAuth discovery: authServer=${n.authorizationServer}, scopes=[${o.join(", ")}], hasPRM=${!!n.resourceMetadata}`),At(t,"mcpGateway.oauth.discovery",{result:"success",hasPRM:n.resourceMetadata?"true":"false"}),{authorizationServer:n.authorizationServer,serverMetadata:n.serverMetadata,resourceMetadata:n.resourceMetadata,scopes:o}}catch(n){X5.warn(t,`OAuth discovery failed for ${e}: ${String(n)}`),Vn(t,"mcpGateway.oauth.discovery",n,{result:"failure"});return}}a(JYn,"discoverAuthMetadata");async function Qct(t,e,r,n){let o=e.getOrActivateProviderIdForServer(r.authorizationServer);if(!o){let l=e.createAuthenticationProvider(r.authorizationServer,r.serverMetadata,r.resourceMetadata);if(l||(l=await e.createDynamicAuthenticationProvider(r.authorizationServer,r.serverMetadata,r.resourceMetadata)),!l)throw new Error(`Failed to create auth provider for ${r.authorizationServer}`);o=l.id}let s=await e.getSessions(o,r.scopes,{authorizationServer:r.authorizationServer},!0),c=XYn(t)?.getAccountPreference(n,o);if(c){let l=s.find(u=>u.account.label===c);if(l)return At(t,"mcpGateway.oauth.silent",{result:"hit",via:"preference"}),{token:l.accessToken,providerId:o,sessions:s}}return At(t,"mcpGateway.oauth.silent",{result:"miss",sessions:String(s.length)}),{token:void 0,providerId:o,sessions:s}}a(Qct,"acquireSilent");async function ZYn(t,e,r,n,o,s,c=[]){let l=e.getProvider(n),u=pjs(t),d=XYn(t);if(c.length>0&&u){let f="Sign in to another account";try{let h=c.map(g=>({title:g.account.label}));h.push({title:f}),h.push({title:"Cancel"});let m=await u.showInformationModal(`The MCP server ${o} wants to access a ${l.label} account. Select an account for ${o} to use.`,...h);if(!m||m.title==="Cancel"){X5.warn(t,`mount '${o}': user cancelled the account selection`),At(t,"mcpGateway.oauth.picker",{result:"cancelled"});return}if(m.title!==f){let g=c.find(A=>A.account.label===m.title);if(!g){X5.warn(t,`mount '${o}': picked account not found in sessions`);return}return d?.updateAccountPreference(o,n,g.account),At(t,"mcpGateway.oauth.picker",{result:"picked"}),g.accessToken}At(t,"mcpGateway.oauth.picker",{result:"add_account"})}catch(h){X5.error(t,`mount '${o}': failed during account selection`,h),Vn(t,"mcpGateway.oauth.picker",h,{result:"failed"});return}}else if(c.length===0&&u)try{if((await u.showInformationModal(`The MCP Server Definition '${s}' wants to authenticate to ${l.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){X5.warn(t,`mount '${o}': user declined OAuth confirmation`),At(t,"mcpGateway.oauth.interactive",{result:"declined"});return}At(t,"mcpGateway.oauth.interactive",{result:"confirmed"})}catch(f){X5.error(t,`mount '${o}': failed to show auth confirmation`,f),Vn(t,"mcpGateway.oauth.interactive",f,{result:"confirm_failed"});return}else u||X5.debug(t,`mount '${o}': no NotificationSender, skipping UI gates`);try{let f=await l.createSession(r.scopes,{});return d?.updateAccountPreference(o,n,f.account),u&&u.showInformationMessageOnlyOnce(`mcpGateway:auth-success:${n}`,`You have authenticated with ${l.label}.`),At(t,"mcpGateway.oauth.flow",{result:"success"}),f.accessToken}catch(f){X5.error(t,`Interactive OAuth failed for ${r.authorizationServer}`,f),u&&u.showWarningMessageOnlyOnce(`mcpGateway:auth-fail:${n}`,`Authentication failed. You need to restart the IDE to authenticate the MCP server again. ${f instanceof Error?f.message:String(f)}`),Vn(t,"mcpGateway.oauth.flow",f,{result:"failure"});return}}a(ZYn,"acquireInteractive");function pjs(t){try{return t.get(ts)}catch{return}}a(pjs,"tryGetNotificationSender");function XYn(t){try{return t.get(wb)}catch{return}}a(XYn,"tryGetMcpAuthService");p();var U2=new fe("mcpGateway"),MDe="Copilot MCP Gateway",ODe="0.1.0",NDe=class{constructor(e,r,n,o){this.id=e;this._ctx=r;this._invoker=n;this._onDidDispose=o;this._sseClients=new Set;this._lastEventId=0;this._isInitialized=!1;this._disposed=!1;this._onToolsListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/tools/list_changed"}),this._onResourcesListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/resources/list_changed"}),this._onPromptsListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/prompts/list_changed"}),this._onLoggingMessage=s=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/message",params:s.params}),this._invoker.on(zl.ToolsListChanged,this._onToolsListChanged),this._invoker.on(zl.ResourcesListChanged,this._onResourcesListChanged),this._invoker.on(zl.PromptsListChanged,this._onPromptsListChanged),this._invoker.on(zl.LoggingMessage,this._onLoggingMessage)}static{a(this,"McpGatewaySession")}attachSseClient(e){if(this._disposed){e.writeHead(410),e.end();return}e.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"}),e.write(`: connected - -`),this._sseClients.add(e),U2.debug(this._ctx,`[session ${this.id}] SSE client attached (total: ${this._sseClients.size})`),e.on("close",()=>{this._sseClients.delete(e),U2.debug(this._ctx,`[session ${this.id}] SSE client detached (total: ${this._sseClients.size})`)})}async handleIncoming(e){let r=Array.isArray(e)?e:[e],n=[];for(let o of r)Lct(o)?n.push(await this._dispatchRequest(o)):qYn(o)?this._dispatchNotification(o):U2.warn(this._ctx,`[session ${this.id}] ignored unsupported inbound frame`);return n}dispose(){if(!this._disposed){this._disposed=!0,U2.info(this._ctx,`[session ${this.id}] disposing (SSE clients: ${this._sseClients.size})`);for(let e of this._sseClients)e.destroyed||e.end();this._sseClients.clear(),this._invoker.off(zl.ToolsListChanged,this._onToolsListChanged),this._invoker.off(zl.ResourcesListChanged,this._onResourcesListChanged),this._invoker.off(zl.PromptsListChanged,this._onPromptsListChanged),this._invoker.off(zl.LoggingMessage,this._onLoggingMessage),this._onDidDispose()}}async _dispatchRequest(e){U2.debug(this._ctx,`[session ${this.id}] <-- request: ${e.method} (id=${String(e.id)})`);try{let r=await this._handleRequest(e);return{jsonrpc:"2.0",id:e.id,result:r}}catch(r){return r instanceof Zw?{jsonrpc:"2.0",id:e.id,error:{code:r.code,message:r.message,data:r.data}}:(U2.error(this._ctx,`[session ${this.id}] request '${e.method}' failed`,r),{jsonrpc:"2.0",id:e.id,error:{code:Xw.InternalError,message:r instanceof Error?r.message:String(r)}})}}async _handleRequest(e){if(e.method==="initialize")return this._handleInitialize(e);if(!this._isInitialized)throw new Zw(Xw.InvalidRequest,"Session is not initialized");switch(e.method){case"ping":return{};case"tools/list":return this._invoker.listTools();case"tools/call":return this._handleCallTool(e);case"resources/list":return this._invoker.listResources();case"resources/read":return this._handleReadResource(e);case"resources/templates/list":return this._invoker.listResourceTemplates();case"prompts/list":return this._invoker.listPrompts();case"prompts/get":return this._handleGetPrompt(e);case"logging/setLevel":return this._handleSetLoggingLevel(e);default:throw new Zw(Xw.MethodNotFound,`Method not found: ${e.method}`)}}_handleInitialize(e){let r=e.params&&typeof e.params=="object"?e.params:void 0,n=typeof r?.protocolVersion=="string"?r.protocolVersion:void 0,o=r?.clientInfo,s=n&&Dat.includes(n)?n:Gw;return U2.info(this._ctx,`[session ${this.id}] initialize: client=${o?.name??"unknown"}/${o?.version??"?"}, clientProtocol=${n??"(none)"}, negotiated=${s}`),n&&n!==s&&U2.warn(this._ctx,`[session ${this.id}] unsupported client protocol version '${n}', falling back to '${s}'`),{protocolVersion:s,capabilities:{tools:{listChanged:!0},resources:{listChanged:!0},prompts:{listChanged:!0},logging:{}},serverInfo:{name:MDe,version:ODe}}}_handleCallTool(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new Zw(Xw.InvalidParams,"Missing tool name");let n=r.arguments&&typeof r.arguments=="object"?r.arguments:{};return this._invoker.callTool(r.name,n)}_handleReadResource(e){let r=this._requireObjectParams(e);if(typeof r.uri!="string")throw new Zw(Xw.InvalidParams,"Missing resource uri");return this._invoker.readResource(r.uri)}_handleGetPrompt(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new Zw(Xw.InvalidParams,"Missing prompt name");let n=r.arguments&&typeof r.arguments=="object"?r.arguments:{};return this._invoker.getPrompt(r.name,n)}async _handleSetLoggingLevel(e){let r=this._requireObjectParams(e);if(typeof r.level!="string")throw new Zw(Xw.InvalidParams,"Missing logging level");return await this._invoker.setLoggingLevel({level:r.level}),{}}_requireObjectParams(e){if(!e.params||typeof e.params!="object")throw new Zw(Xw.InvalidParams,"Missing params");return e.params}_dispatchNotification(e){U2.debug(this._ctx,`[session ${this.id}] <-- notification: ${e.method}`),e.method==="notifications/initialized"&&(this._isInitialized=!0,U2.info(this._ctx,`[session ${this.id}] initialized`))}_broadcastIfReady(e){!this._isInitialized||this._disposed||this._broadcast(e)}_broadcast(e){if(this._sseClients.size===0){U2.debug(this._ctx,`[session ${this.id}] no SSE clients, dropping ${e.method}`);return}let r=JSON.stringify(e),n=String(++this._lastEventId),o=r.split(/\r?\n/g),s=[`id: ${n}`,"event: message",...o.map(c=>`data: ${c}`),"",""].join(` -`);for(let c of[...this._sseClients]){if(c.destroyed||c.writableEnded){this._sseClients.delete(c);continue}c.write(s)}}};function eKn(t){let e=Array.isArray(t)?t[0]:t;return!!e&&typeof e.method=="string"&&e.method==="initialize"}a(eKn,"isInitializeMessage");p();p();var GKn=de(jKn(),1),Hct=de(require("node:process"),1),$Kn=require("node:stream");p();var jct=class{static{a(this,"ReadBuffer")}append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(` -`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),Qjs(r)}clear(){this._buffer=void 0}};function Qjs(t){return lH.parse(JSON.parse(t))}a(Qjs,"deserializeMessage");function HKn(t){return JSON.stringify(t)+` -`}a(HKn,"serializeMessage");var qjs=Hct.default.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function jjs(){let t={};for(let e of qjs){let r=Hct.default.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(jjs,"getDefaultEnvironment");var xhe=class{static{a(this,"StdioClientTransport")}constructor(e){this._readBuffer=new jct,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new $Kn.PassThrough)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,r)=>{this._process=(0,GKn.default)(this._serverParams.command,this._serverParams.args??[],{env:{...jjs(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:Hct.default.platform==="win32",cwd:this._serverParams.cwd}),this._process.on("error",n=>{r(n),this.onerror?.(n)}),this._process.on("spawn",()=>{e()}),this._process.on("close",n=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on("error",n=>{this.onerror?.(n)}),this._process.stdout?.on("data",n=>{this._readBuffer.append(n),this.processReadBuffer()}),this._process.stdout?.on("error",n=>{this.onerror?.(n)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){if(this._process){let e=this._process;this._process=void 0;let r=new Promise(n=>{e.once("close",()=>{n()})});try{e.stdin?.end()}catch{}if(await Promise.race([r,new Promise(n=>setTimeout(n,2e3).unref())]),e.exitCode===null){try{e.kill("SIGTERM")}catch{}await Promise.race([r,new Promise(n=>setTimeout(n,2e3).unref())])}if(e.exitCode===null)try{e.kill("SIGKILL")}catch{}}this._readBuffer.clear()}send(e){return new Promise(r=>{if(!this._process?.stdin)throw new Error("Not connected");let n=HKn(e);this._process.stdin.write(n)?r():this._process.stdin.once("drain",r)})}};var VKn=require("child_process"),WKn=require("events"),zKn=require("util");var Cdr=1e4,Hjs=(0,zKn.promisify)(VKn.exec),LDe=class{constructor(e){this._transport=null;this._emitter=new WKn.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._emitter.setMaxListeners(0),this._client=new _H({name:e.clientInfo.name,version:e.clientInfo.version},{capabilities:{}})}static{a(this,"StdioInvoker")}get isConnected(){return this._connected}async start(){if(this._connected)return;let e={...this._options.params,stderr:"pipe"},r=new xhe(e);this._transport=r,this._client.onerror=n=>this._options.onError?.(n),this._client.onclose=()=>{this._connected=!1},r.stderr&&r.stderr.on("data",n=>{this._options.onStderr?.(n.toString())}),this._client.setNotificationHandler(a8,()=>{this._emitter.emit(zl.ToolsListChanged)}),this._client.setNotificationHandler(o8,()=>{this._emitter.emit(zl.ResourcesListChanged)}),this._client.setNotificationHandler(s8,()=>{this._emitter.emit(zl.PromptsListChanged)}),this._client.setNotificationHandler(fX,n=>{this._emitter.emit(zl.LoggingMessage,n)}),await this._client.connect(r),this._connected=!0}async stop(){if(!this._transport){this._connected=!1;return}let e=this._transport;this._transport=null;let r=this._client.close().catch(()=>{}),n=await Promise.race([r.then(()=>!0),new Promise(s=>setTimeout(()=>s(!1),Cdr))]),o;if("pid"in e&&typeof e.pid=="number"&&(o=e.pid),!n&&o===void 0&&this._options.onError?.(new Error(`stdio transport exposed no pid; cannot force-kill '${this.id}'`)),!n&&o!==void 0&&process.platform==="win32")try{await Hjs(`taskkill /pid ${o} /t /f`,{timeout:Cdr})}catch{}else if(!n&&o!==void 0){try{process.kill(o,"SIGTERM")}catch{}await new Promise(s=>setTimeout(s,Cdr));try{process.kill(o,"SIGKILL")}catch{}}this._connected=!1}listTools(){return this._client.listTools()}callTool(e,r){return this._client.callTool({name:e,arguments:r})}listResources(){return this._client.listResources()}readResource(e){return this._client.readResource({uri:e})}listResourceTemplates(){return this._client.listResourceTemplates()}listPrompts(){return this._client.listPrompts()}getPrompt(e,r){return this._client.getPrompt({name:e,arguments:r})}async setLoggingLevel(e){await this._client.setLoggingLevel(e.level)}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}};p();var dm=class{static{a(this,"AuthenticationService")}};var NT=new fe("mcpGateway.manager"),bH=class extends Error{constructor(r,n){super(n);this.code=r}static{a(this,"ServerActionError")}},Gjs={tools:[],resources:[],resourceTemplates:[],prompts:[]},ey=class{constructor(e,r,n){this._entries=new Map;this._disposed=!1;this._applyChain=Promise.resolve();this._oauthChain=Promise.resolve();this._actionChains=new Map;this._ctx=e,this._service=r,this._sender=n,this._unregister=n}static{a(this,"McpServerManager")}listServers(e){let r=[];for(let n of this._entries.values())Wjs(n.key.source,e)&&r.push({name:n.key.name,source:n.key.source,status:n.status,error:n.error,authInfo:n.authInfo,registryInfo:n.registryInfo});return r}getServerDetails(e){let r=this._entries.get(CH(e));return r?{tools:r.contents.tools,resources:r.contents.resources,resourceTemplates:r.contents.resourceTemplates,prompts:r.contents.prompts}:null}listReadyEntries(){let e=[];for(let r of this._entries.values()){if(r.status!=="running")continue;let n=CH(r.key),o=this._service.listMounts().find(s=>s.id===n);e.push({key:r.key,url:o?.url??null})}return e}async applyConfig(e){if(this._disposed)throw new Error("McpServerManager is disposed");let r=this._applyChain.then(()=>this._applyConfigLocked(e));return this._applyChain=r.catch(()=>{}),r}async removeProject(e){if(this._disposed)return;let r=this._applyChain.then(()=>this._removeProjectLocked(e));return this._applyChain=r.catch(()=>{}),r}async applyPluginServers(e,r){if(this._disposed)throw new Error("McpServerManager is disposed");let n=this._applyChain.then(()=>this._applyScope({kind:"plugin",pluginId:e},r));return this._applyChain=n.catch(()=>{}),n}async removePluginServers(e){return this.applyPluginServers(e,{})}async _applyConfigLocked(e){let{workspaceFolder:r,user:n,project:o}=e,s=$js(n),c=s!==this._lastUserHash;c&&(await this._applyScope({kind:"user"},n),this._lastUserHash=s),await this._applyScope({kind:"project",workspaceFolder:r},o),At(this._ctx,"mcpGateway.applyConfig",{userChanged:String(c),hasProject:String(Object.keys(o).length>0)},{userServerCount:Object.keys(n).length,projectServerCount:Object.keys(o).length})}async _applyScope(e,r){let n=new Map,o=[];for(let[l,u]of Object.entries(r)){let d=Yjs(l,u);if(!d){o.push(l);continue}n.set(CH({source:e,name:l}),{classified:d,hash:YKn(u)})}o.length>0&&NT.warn(this._ctx,`applyConfig: skipped ${o.length} unrecognised entries in ${zjs(e)}: [${o.join(", ")}]`);let s=[];for(let[l,u]of this._entries)Vjs(u.key.source,e)&&!n.has(l)&&s.push(l);for(let l of s)await this._removeEntry(l);let c=!1;for(let[l,{classified:u,hash:d}]of n){let f=this._entries.get(l);f?f.entryHash!==d&&(await this._stopInvoker(f,"starting"),f.classified=u,f.entryHash=d,f.error=void 0,c=!0,this._beginStart(l)):(this._createEntry({source:e,name:u.name},u,d),c=!0,this._beginStart(l))}c&&this._sender.serversChanged(e4(e))}async _removeProjectLocked(e){let r=[];for(let[n,o]of this._entries)o.key.source.kind==="project"&&o.key.source.workspaceFolder===e&&r.push(n);if(r.length!==0)for(let n of r)await this._removeEntry(n)}serverAction(e,r){let n=CH(e),o=this._entries.get(n);if(!o)throw new bH("unknownServer",`Unknown MCP server: ${e.name}`);switch(r){case"start":case"restart":if(o.status==="blocked")throw new bH("startBlocked",`Server '${e.name}' is blocked by policy and cannot be started`);break;case"logout":case"clearOAuth":if(!o.authInfo&&!o.authDiscovery)throw new bH("noAuth",`Server '${e.name}' has no auth state to clear`);break}let c=(this._actionChains.get(n)??Promise.resolve()).then(()=>this._runAction(n,r));return this._actionChains.set(n,c.catch(()=>{})),Promise.resolve()}async _runAction(e,r){let n=this._entries.get(e);if(n)switch(r){case"start":if(n.status==="running"||n.status==="starting")return;await this._beginStart(e);return;case"stop":if(n.status==="stopped")return;await this._stopInvoker(n,"stopped"),this._sender.serversChanged(e4(n.key.source));return;case"restart":await this._stopInvoker(n,"starting"),this._sender.serversChanged(e4(n.key.source)),await this._beginStart(e);return;case"logout":await this._performLogout(n,!1);return;case"clearOAuth":await this._performLogout(n,!0),await this._beginStart(e);return}}async dispose(){if(this._disposed)return;this._disposed=!0;let e=[...this._entries.values()].map(r=>this._stopInvoker(r,"stopped").catch(()=>{}));this._entries.clear(),await Promise.all(e)}_createEntry(e,r,n){let o={key:e,classified:r,entryHash:n,invoker:null,status:"stopped",contents:{...Gjs},listeners:null};return this._entries.set(CH(e),o),o}async _removeEntry(e){let r=this._entries.get(e);if(!r)return;let n=e4(r.key.source);await this._stopInvoker(r,"stopped").catch(()=>{}),this._entries.delete(e),this._sender.serversChanged(n)}async _beginStart(e){let r=this._entries.get(e);if(!r)return;r.invoker?await this._stopInvoker(r,"starting"):(r.status="starting",r.error=void 0,this._sender.serversChanged(e4(r.key.source)));let n=this._buildInvoker(r);r.invoker=n,this._wireInvokerEvents(r);try{if(await n.start(),r.invoker!==n){await n.stop().catch(()=>{});return}r.status="running",r.error=void 0;try{await this._service.registerMount(n,r.key.name)}catch(o){throw NT.error(this._ctx,`failed to register mount for '${r.key.name}'`,o),o}if(r.invoker!==n){this._service.unregisterMount(CH(r.key)),await n.stop().catch(()=>{});return}if(await this._refreshContents(r).catch(o=>{NT.warn(this._ctx,`failed to refresh contents for '${r.key.name}': ${String(o)}`)}),r.invoker!==n)return;this._sender.serversChanged(e4(r.key.source)),this._sender.serverDetailsChanged(r.key)}catch(o){if(r.invoker!==n){await n.stop().catch(()=>{});return}o instanceof bhe?(r.status="unauthorized",r.error=void 0,NT.warn(this._ctx,`server '${r.key.name}' requires authorization`)):(r.status="error",r.error=o instanceof Error?o.message:String(o),NT.error(this._ctx,`server '${r.key.name}' failed to start`,o)),await n.stop().catch(()=>{}),this._unwireInvokerEvents(r),r.invoker=null,this._sender.serversChanged(e4(r.key.source))}}async _stopInvoker(e,r){let n=e.invoker;this._unwireInvokerEvents(e),e.invoker=null,e.status=r,r!=="error"&&r!=="blocked"&&(e.error=void 0),this._service.unregisterMount(CH(e.key)),this._sender.serversChanged(e4(e.key.source)),n&&await n.stop().catch(o=>{NT.warn(this._ctx,`failed to stop invoker '${e.key.name}': ${String(o)}`)})}_wireInvokerEvents(e){let r=e.invoker;if(!r)return;let n={toolsChanged:a(()=>{this._onUpstreamListChanged(e,"tools")},"toolsChanged"),resourcesChanged:a(()=>{this._onUpstreamListChanged(e,"resources")},"resourcesChanged"),promptsChanged:a(()=>{this._onUpstreamListChanged(e,"prompts")},"promptsChanged")};r.on(zl.ToolsListChanged,n.toolsChanged),r.on(zl.ResourcesListChanged,n.resourcesChanged),r.on(zl.PromptsListChanged,n.promptsChanged),e.listeners=n}_unwireInvokerEvents(e){let r=e.invoker,n=e.listeners;r&&n&&(r.off(zl.ToolsListChanged,n.toolsChanged),r.off(zl.ResourcesListChanged,n.resourcesChanged),r.off(zl.PromptsListChanged,n.promptsChanged)),e.listeners=null}async _onUpstreamListChanged(e,r){if(e.invoker)try{if(r==="tools"){let n=await e.invoker.listTools();e.contents.tools=n.tools}else if(r==="resources"){let[n,o]=await Promise.all([e.invoker.listResources(),e.invoker.listResourceTemplates()]);e.contents.resources=n.resources,e.contents.resourceTemplates=o.resourceTemplates}else{let n=await e.invoker.listPrompts();e.contents.prompts=n.prompts}this._sender.serverDetailsChanged(e.key)}catch(n){NT.warn(this._ctx,`failed to refresh ${r} for '${e.key.name}': ${String(n)}`)}}async _refreshContents(e){if(!e.invoker)return;let r=await Promise.allSettled([e.invoker.listTools(),e.invoker.listResources(),e.invoker.listResourceTemplates(),e.invoker.listPrompts()]);e.contents={tools:r[0].status==="fulfilled"?r[0].value.tools:[],resources:r[1].status==="fulfilled"?r[1].value.resources:[],resourceTemplates:r[2].status==="fulfilled"?r[2].value.resourceTemplates:[],prompts:r[3].status==="fulfilled"?r[3].value.prompts:[]}}_buildInvoker(e){let r=e.classified,n=CH(e.key),o=e.key.name;return r.kind==="stdio"?new LDe({id:n,label:o,params:r.params,clientInfo:{name:MDe,version:ODe}}):new DDe({id:n,label:o,url:r.url,type:r.type,httpOptions:r.type==="http"?r.httpOptions:void 0,sseOptions:r.type==="sse"?r.sseOptions:void 0,clientInfo:{name:MDe,version:ODe},authProvider:this._tryGetAuthSvc()?this._buildAuthProvider(e,r.url,r.httpOptions?.requestInit?.headers):void 0,onFallback:a(({fromCode:s})=>{NT.info(this._ctx,`'${e.key.name}': Streamable HTTP returned ${s}, falling back to legacy SSE`),At(this._ctx,"mcpGateway.transport.fallbackToSse",{fromCode:String(s)})},"onFallback")})}_tryGetAuthSvc(){try{return this._ctx.get(dm)}catch{return}}_buildAuthProvider(e,r,n){let o=a(async()=>{if(e.authDiscovery)return e.authDiscovery;let s=await JYn(this._ctx,r,n);if(!s){NT.warn(this._ctx,`'${e.key.name}': OAuth discovery failed`);return}try{let c=this._tryGetAuthSvc(),l=await Qct(this._ctx,c,s,e.key.name);if(e.authDiscovery={discovery:s,providerId:l.providerId},l.token){let u=l.sessions.find(d=>d.accessToken===l.token);u&&this._setAuthInfo(e,{providerId:l.providerId,accountName:u.account.label})}return e.authDiscovery}catch(c){NT.error(this._ctx,`'${e.key.name}': dynamic provider setup failed`,c);return}},"ensureDiscovery");return async s=>{let c=this._tryGetAuthSvc();if(!c)return;let l=await o();if(!l)return;if(s==="silent"){let f=await Qct(this._ctx,c,l.discovery,e.key.name);if(f.token){let h=f.sessions.find(m=>m.accessToken===f.token);h&&this._setAuthInfo(e,{providerId:l.providerId,accountName:h.account.label})}return f.token}let u,d=this._oauthChain.then(async()=>{let f=await Qct(this._ctx,c,l.discovery,e.key.name);if(f.token){u=f.token;let h=f.sessions.find(m=>m.accessToken===u);h&&this._setAuthInfo(e,{providerId:l.providerId,accountName:h.account.label});return}if(u=await ZYn(this._ctx,c,l.discovery,l.providerId,e.key.name,r,f.sessions),u){let m=(await c.getSessions(l.providerId,l.discovery.scopes,{authorizationServer:l.discovery.authorizationServer},!0)).find(g=>g.accessToken===u);m&&this._setAuthInfo(e,{providerId:l.providerId,accountName:m.account.label})}});return this._oauthChain=d.catch(()=>{}),await d,u}}_setAuthInfo(e,r){e.authInfo?.providerId===r.providerId&&e.authInfo?.accountName===r.accountName||(e.authInfo=r,this._sender.serversChanged(e4(e.key.source)))}async _performLogout(e,r){await this._stopInvoker(e,"stopped").catch(()=>{});let n=this._tryGetAuthSvc(),o=e.authInfo?.providerId??e.authDiscovery?.providerId;if(n&&o)try{let s=n.getProvider(o),c=await n.getSessions(o,e.authDiscovery?.discovery.scopes??[],e.authDiscovery?{authorizationServer:e.authDiscovery.discovery.authorizationServer}:void 0,!0);for(let l of c)await s.removeSession(l.id).catch(u=>NT.warn(this._ctx,`removeSession failed for '${e.key.name}': ${String(u)}`))}catch(s){NT.warn(this._ctx,`logout enumeration failed for '${e.key.name}': ${String(s)}`)}if(r&&o){try{await this._unregister.unregisterProvider(o)}catch(s){NT.warn(this._ctx,`unregisterProvider failed for '${e.key.name}': ${String(s)}`)}e.authDiscovery=void 0}e.authInfo=void 0,this._sender.serversChanged(e4(e.key.source))}};function CH(t){switch(t.source.kind){case"user":return`user::${t.name}`;case"project":return`project::${t.source.workspaceFolder}::${t.name}`;case"plugin":return`plugin::${t.source.pluginId}::${t.name}`}}a(CH,"serializeKey");function YKn(t){if(!t||typeof t!="object")return JSON.stringify(t);let e=t,r=Object.keys(e).sort(),n={};for(let o of r)n[o]=e[o];return JSON.stringify(n)}a(YKn,"canonicalEntryHash");function $js(t){let e=Object.keys(t).sort(),r={};for(let n of e)r[n]=YKn(t[n]);return JSON.stringify(r)}a($js,"canonicalConfigHash");function e4(t){return t.kind==="project"?{kind:"project",workspaceFolder:t.workspaceFolder}:{kind:"user"}}a(e4,"notificationScopeFor");function Vjs(t,e){return t.kind!==e.kind?!1:t.kind==="project"&&e.kind==="project"?t.workspaceFolder===e.workspaceFolder:t.kind==="plugin"&&e.kind==="plugin"?t.pluginId===e.pluginId:t.kind==="user"&&e.kind==="user"}a(Vjs,"sameScope");function Wjs(t,e){return e===void 0||t.kind==="user"||t.kind==="plugin"?!0:t.kind==="project"&&e.kind==="project"?t.workspaceFolder===e.workspaceFolder:!1}a(Wjs,"entryInScope");function zjs(t){switch(t.kind){case"user":return"user";case"project":return`project<${t.workspaceFolder}>`;case"plugin":return`plugin<${t.pluginId}>`}}a(zjs,"describeScope");function Yjs(t,e){if(!e||typeof e!="object")return;let r=e;if(typeof r.command=="string")return{kind:"stdio",name:t,params:e};if(typeof r.url=="string"){let o=(typeof r.type=="string"?r.type:void 0)==="sse"?"sse":"http";return{kind:"http",name:t,url:r.url,type:o,httpOptions:o==="http"?e:void 0,sseOptions:o==="sse"?e:void 0}}}a(Yjs,"classifyEntry");p();var bdr=require("crypto"),KKn=require("events"),JKn=de(require("http"));var SH=new fe("mcpGateway"),Kjs="mcp-session-id",Jjs=1024*1024,Zjs=5e3,ZKn={Ready:"ready",Unauthorized:"unauthorized",Error:"error"},DX={MountsChanged:"mountsChanged"},TH=class{constructor(e,r={}){this._routes=new Map;this._idToRouteId=new Map;this._emitter=new KKn.EventEmitter;this._connections=new Set;this._ctx=e,this._host=r.host??"127.0.0.1"}static{a(this,"McpGatewayService")}get port(){return this._port}listMounts(){let e=[];for(let[r,n]of this._routes)e.push(this._buildMountInfo(n.invoker.id,n.label,r,n.status));return e}setMountStatus(e,r){let n=this._idToRouteId.get(e);if(!n)return;let o=this._routes.get(n);if(!o||o.status===r)return;let s=o.status;o.status=r,SH.info(this._ctx,`mount '${o.label}' (${e}) status -> ${r}`),At(this._ctx,"mcpGateway.mount.statusChanged",{from:s,to:r}),this._emitter.emit(DX.MountsChanged,this.listMounts())}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}async registerMount(e,r,n=ZKn.Ready){if(await this._ensureServer(),this._port===void 0)throw new Error("Gateway server failed to start");if(this._idToRouteId.get(e.id))throw new Error(`Mount already registered for id '${e.id}'`);let s=(0,bdr.randomUUID)(),c=r??e.label;this._routes.set(s,{invoker:e,label:c,sessions:new Map,status:n}),this._idToRouteId.set(e.id,s);let l=this._buildMountInfo(e.id,c,s,n);return SH.info(this._ctx,`registered mount '${c}' (${e.id}) at ${l.url} [${n}]`),At(this._ctx,"mcpGateway.mount.registered",{status:n}),this._emitter.emit(DX.MountsChanged,this.listMounts()),l}unregisterMount(e){let r=this._idToRouteId.get(e);if(!r)return;let n=this._routes.get(r);if(n){for(let o of n.sessions.values())o.dispose();n.sessions.clear(),this._routes.delete(r),this._idToRouteId.delete(e),SH.info(this._ctx,`unregistered mount '${n.label}' (${e})`),At(this._ctx,"mcpGateway.mount.unregistered",{finalStatus:n.status}),this._emitter.emit(DX.MountsChanged,this.listMounts())}}dispose(){for(let e of this._routes.values()){for(let r of e.sessions.values())r.dispose();e.sessions.clear()}this._routes.clear(),this._idToRouteId.clear(),this._stopServer()}async _ensureServer(){if(!this._server?.listening){if(this._startPromise)return this._startPromise;this._startPromise=this._startServer();try{await this._startPromise}finally{this._startPromise=void 0}}}_startServer(){return new Promise((e,r)=>{let n=JKn.createServer((s,c)=>this._handleRequest(s,c));n.requestTimeout=0,this._server=n,n.on("connection",s=>{this._connections.add(s),s.on("close",()=>this._connections.delete(s))});let o=setTimeout(()=>r(new Error("Gateway listen timeout")),Zjs);n.once("listening",()=>{let s=n.address();s&&typeof s=="object"&&(this._port=s.port),clearTimeout(o),SH.info(this._ctx,`listening on http://${this._host}:${this._port}`),e()}),n.on("error",s=>{if(s.code==="EADDRINUSE"){n.listen(0,this._host);return}clearTimeout(o),r(s)}),n.listen(0,this._host)})}_stopServer(){if(this._server){SH.info(this._ctx,"stopping HTTP server");for(let e of this._connections)e.destroy();this._connections.clear(),this._server.close(),this._server=void 0,this._port=void 0}}_handleRequest(e,r){let o=new URL(e.url??"/",`http://${e.headers.host??"127.0.0.1"}`).pathname.split("/").filter(Boolean);if(o.length<2||o[1]!=="mcp"){this._respondHttpError(r,404,"Not found");return}let s=o[0],c=this._routes.get(s);if(!c){this._respondHttpError(r,404,"Mount not found");return}if(e.method==="POST"){this._handlePost(c,e,r);return}if(e.method==="GET"){this._handleGet(c,e,r);return}if(e.method==="DELETE"){this._handleDelete(c,e,r);return}this._respondHttpError(r,405,"Method not allowed")}async _handlePost(e,r,n){let o=await this._readBody(r);if(o===void 0){this._respondHttpError(n,413,"Payload too large");return}let s;try{s=JSON.parse(o)}catch(u){let d={jsonrpc:"2.0",id:null,error:{code:Xw.ParseError,message:u instanceof Error?u.message:String(u)}};n.writeHead(400,{"Content-Type":"application/json"}),n.end(JSON.stringify(d));return}let c=this._getSessionId(r),l=this._resolveSession(e,c,s,n);if(l)try{let u=await l.handleIncoming(s),d={"Content-Type":"application/json","Mcp-Session-Id":l.id};if(u.length===0||!this._hasRequest(s)){n.writeHead(202,d),n.end();return}let f=JSON.stringify(Array.isArray(s)?u:u[0]);n.writeHead(200,d),n.end(f)}catch(u){SH.error(this._ctx,"POST handler failed",u),this._respondHttpError(n,500,"Internal server error")}}_handleGet(e,r,n){let o=this._getSessionId(r);if(!o){this._respondHttpError(n,400,"Missing Mcp-Session-Id header");return}let s=e.sessions.get(o);if(!s){this._respondHttpError(n,404,"Session not found");return}s.attachSseClient(n)}_handleDelete(e,r,n){let o=this._getSessionId(r);if(!o){this._respondHttpError(n,400,"Missing Mcp-Session-Id header");return}let s=e.sessions.get(o);if(!s){this._respondHttpError(n,404,"Session not found");return}s.dispose(),n.writeHead(204),n.end()}_resolveSession(e,r,n,o){if(r){let l=e.sessions.get(r);if(!l){this._respondHttpError(o,404,"Session not found");return}return l}if(!eKn(n)){this._respondHttpError(o,400,"Missing Mcp-Session-Id header");return}let s=(0,bdr.randomUUID)(),c=new NDe(s,this._ctx,e.invoker,()=>{e.sessions.delete(s)&&SH.info(this._ctx,`mount '${e.label}' session detached (sid=${s}, active sessions: ${e.sessions.size})`)});return e.sessions.set(s,c),SH.info(this._ctx,`mount '${e.label}' session attached (sid=${s}, active sessions: ${e.sessions.size})`),c}_hasRequest(e){return(Array.isArray(e)?e:[e]).some(Lct)}_getSessionId(e){let r=e.headers[Kjs];return Array.isArray(r)?r[0]:r}async _readBody(e){let r=[],n=0;for await(let o of e){let s=Buffer.isBuffer(o)?o:Buffer.from(o);if(n+=s.byteLength,n>Jjs)return;r.push(s)}return Buffer.concat(r).toString("utf8")}_respondHttpError(e,r,n){e.writeHead(r,{"Content-Type":"application/json"});let o={jsonrpc:"2.0",id:null,error:{code:r,message:n}};e.end(JSON.stringify(o))}_buildMountInfo(e,r,n,o){return{id:e,label:r,routeId:n,url:`http://${this._host}:${this._port}/${n}/mcp`,status:o}}};var Sdr=new fe("BackgroundAgent.McpSync"),Gct=class{constructor(e,r){this.ctx=e;this.registry=r;this.syncScheduled=!1;try{let n=e.get(PT);this.host=n,this.mountsChangedListener=()=>this.schedule(),n.service.on(DX.MountsChanged,this.mountsChangedListener)}catch(n){if(!(n instanceof bl))throw n}}static{a(this,"McpSync")}dispose(){this.host&&this.mountsChangedListener&&(this.host.service.off(DX.MountsChanged,this.mountsChangedListener),this.mountsChangedListener=void 0,this.host=void 0)}schedule(){this.syncScheduled||(this.syncScheduled=!0,queueMicrotask(()=>{this.syncScheduled=!1,this.syncToActiveSessions()}))}async syncToActiveSessions(){if(this.registry.size()===0)return;let e;try{e=this.ctx.get(PT)}catch(r){r instanceof bl||Sdr.warn(this.ctx,"Failed to read MCP gateway host for active-session sync",{error:r instanceof Error?r.message:String(r)});return}Sdr.info(this.ctx,"Syncing MCP servers to active sessions",{sessionCount:this.registry.size()}),await Promise.all([...this.registry.entries()].map(async([r,n])=>{let o=this.registry.getMcpDirectory(r)??this.registry.getWorkspaceFolderUri(r),s=e.buildMcpServers(o);try{await n.reloadMcpServers({mcpServers:s})}catch(c){Sdr.warn(this.ctx,"Failed to push MCP servers to session",{sessionId:r,error:c instanceof Error?c.message:String(c)})}}))}};p();p();var $ct="/agents/sessions",Vct=class{constructor(e,r,n){this.ctx=e;this.logger=r;this.opts=n;this.fetchImpl=n.fetch??fetch}static{a(this,"MissionControlApiClient")}async createSession(e,r,n){let o=await this.buildUrl($ct),s=await this.buildHeaders();s["Content-Type"]="application/json";let c=Date.now();this.logger.info(this.ctx,`MissionControl POST ${o}`,{ownerId:e,repoId:r,agentTaskId:n,integrationId:this.opts.integrationId});let l=await this.fetchWithTimeout(o,{method:"POST",headers:s,body:JSON.stringify({owner_id:e,repo_id:r,agent_task_id:n})});if(!l.ok){let f=await XKn(l);throw this.logger.warn(this.ctx,`MissionControl createSession \u2190 ${l.status} ${l.statusText}`,{durationMs:Date.now()-c,body:f.slice(0,500)}),new Error(`MissionControl createSession failed: ${l.status} ${l.statusText} ${f}`)}let u=await l.json();if(typeof u.id!="string")throw new Error("MissionControl createSession: response missing id");let d=typeof u.task_id=="string"?u.task_id:u.id;return this.logger.info(this.ctx,"MissionControl createSession \u2190 200",{durationMs:Date.now()-c,mcSessionId:u.id,mcTaskId:d}),{id:u.id,taskId:d}}async submitEvents(e,r,n){let o=await this.buildUrl(`${$ct}/${encodeURIComponent(e)}/events`),s=Date.now();this.logger.info(this.ctx,`MissionControl POST ${o}`,{eventCount:r.length,ackCount:n.length,eventTypes:r.slice(0,10).map(c=>c.type)});try{let c=await this.buildHeaders();c["Content-Type"]="application/json";let l={events:r};n.length>0&&(l.completed_command_ids=n);let u=await this.fetchWithTimeout(o,{method:"POST",headers:c,body:JSON.stringify(l)});if(!u.ok){let d=await XKn(u);return this.logger.warn(this.ctx,`MissionControl submitEvents \u2190 ${u.status} ${u.statusText}`,{durationMs:Date.now()-s,body:d.slice(0,500)}),!1}return this.logger.info(this.ctx,"MissionControl submitEvents \u2190 200",{durationMs:Date.now()-s,eventCount:r.length,ackCount:n.length}),!0}catch(c){return this.logger.warn(this.ctx,`MissionControl submitEvents error: ${c instanceof Error?c.message:String(c)}`,{durationMs:Date.now()-s}),!1}}async getPendingCommands(e){let r=await this.buildUrl(`${$ct}/${encodeURIComponent(e)}/commands`),n=Date.now();try{let o=await this.buildHeaders(),s=await this.fetchWithTimeout(r,{method:"GET",headers:o});if(!s.ok)return this.logger.warn(this.ctx,`MissionControl GET ${r} \u2190 ${s.status} ${s.statusText}`,{durationMs:Date.now()-n}),[];let c=await s.json(),l=Array.isArray(c.commands)?c.commands:[];return l.length>0?this.logger.info(this.ctx,`MissionControl GET ${r} \u2190 200`,{durationMs:Date.now()-n,commandCount:l.length,commandIds:l.map(u=>u.id)}):this.logger.debug(this.ctx,`MissionControl GET ${r} \u2190 200 (no commands)`,{durationMs:Date.now()-n}),l}catch(o){return this.logger.warn(this.ctx,`MissionControl getPendingCommands error: ${o instanceof Error?o.message:String(o)}`,{durationMs:Date.now()-n}),[]}}async deleteSession(e){let r=await this.buildUrl(`${$ct}/${encodeURIComponent(e)}/`),n=Date.now();this.logger.info(this.ctx,`MissionControl DELETE ${r}`);try{let o=await this.buildHeaders(),s=await this.fetchWithTimeout(r,{method:"DELETE",headers:o});this.logger.info(this.ctx,`MissionControl DELETE ${r} \u2190 ${s.status}`,{durationMs:Date.now()-n})}catch(o){this.logger.warn(this.ctx,`MissionControl deleteSession error: ${o instanceof Error?o.message:String(o)}`,{durationMs:Date.now()-n})}}async buildUrl(e){return`${(await this.opts.getApiBase()).replace(/\/+$/,"")}${e.startsWith("/")?e:`/${e}`}`}async buildHeaders(){return{Authorization:`Bearer ${await this.opts.getAuthToken()}`,"Copilot-Integration-Id":this.opts.integrationId,Accept:"application/json","User-Agent":"GitHubCopilotChat/0.0.0"}}async fetchWithTimeout(e,r){let n=new AbortController,o=setTimeout(()=>n.abort(),1e4);try{return await this.fetchImpl(e,{...r,signal:n.signal})}finally{clearTimeout(o)}}};async function XKn(t){try{return await t.text()}catch{return""}}a(XKn,"safeReadText");p();p();var Wct=class{constructor(e){this.opts=e;this.failureCount=0;this.state=0;this.nextRetryAt=0;this.currentTimeoutMs=e.resetTimeoutMs}static{a(this,"CircuitBreaker")}canRequest(){return this.state===0?!0:this.state===1&&Date.now()>=this.nextRetryAt?(this.state=2,!0):this.state===2}recordSuccess(){this.failureCount=0,this.state=0,this.currentTimeoutMs=this.opts.resetTimeoutMs}recordFailure(){this.failureCount++,(this.state===2||this.failureCount>=this.opts.failureThreshold)&&(this.state=1,this.nextRetryAt=Date.now()+this.currentTimeoutMs,this.currentTimeoutMs=Math.min(this.currentTimeoutMs*2,this.opts.maxResetTimeoutMs))}getState(){return this.state}getFailureCount(){return this.failureCount}get name(){return this.opts.name}};p();var Xjs=new Set(["assistant.message_delta","assistant.streaming_delta","session.shutdown","session.error","session.usage_info","assistant.usage","pending_messages.modified","session.mcp_server_status_changed","session.mcp_servers_loaded","session.skills_loaded","session.tools_updated"]);function eJn(t){return!(!t.type||Xjs.has(t.type)||t.type.startsWith("tool.execution_")&&t.data?.toolName==="report_intent")}a(eJn,"shouldForwardMissionControlEvent");function Tdr(t){let e=t.data;return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}a(Tdr,"getMissionControlEventData");function tJn(t,e){if(e.type!=="user.message")return;let r=e.data?.source;if(typeof r!="string"||!r.startsWith("command-"))return;let n=r.slice(8);n&&t.completedCommandIds.push(n)}a(tJn,"maybeAcknowledgeMissionControlCommandFromEvent");var iJn=require("node:crypto");var eHs=500,tHs=3e3,rHs=1e4,nHs=500,BDe=2e3,iHs=256,rJn=80,zct=class{constructor(e,r,n){this.sessionId=e;this.sdkSession=r;this.remoteCtx=n;this.circuitBreaker=new Wct({failureThreshold:5,resetTimeoutMs:1e3,maxResetTimeoutMs:3e4,name:"mc-events"})}static{a(this,"MissionControlRemoteDelegate")}async enable(){if(this.state&&!this.state.disposed)return{url:this.state.frontendUrl,remoteSteerable:!0};let{workingDir:e,getGithubToken:r,client:n,logger:o,ctx:s}=this.remoteCtx,c=await W0n(e);if(!c)throw new Error("Mission Control: not_a_github_repo");let l=await r(),u=await z0n(c,l);if(!u)throw new Error("Mission Control: repo_id_resolution_failed");let d=`${Date.now()}-${Math.random().toString(36).slice(2,10)}`,f=await n.createSession(u.ownerId,u.repoId,d),h={mcSessionId:f.id,mcTaskId:f.taskId,nwo:c,frontendUrl:`https://github.com/${c.owner}/${c.repo}/tasks/${f.taskId}`,eventBuffer:[],completedCommandIds:[],toolCallIdToRequestId:new Map,lastEventId:null,lastSubmitAttemptTimeMs:Date.now(),processedCommandIds:new Set,disposed:!1,titleSent:!!this.remoteCtx.sessionTitle,flushInFlight:!1,pollInFlight:!1};this.state=h;let m=sHs(e);h.eventBuffer.push(this.createEvent(h,"session.start",{sessionId:h.mcSessionId,version:1,producer:"copilot-developer-cli",copilotVersion:"1.0.0",startTime:new Date().toISOString(),remoteSteerable:!0,context:{cwd:m,gitRoot:m,repository:`${c.owner}/${c.repo}`}}));let g=new Set(["user.message","assistant.message","assistant.turn_start","assistant.turn_complete","tool.execution_start","tool.execution_complete"]);try{let A=Array.from(this.sdkSession.getEvents()),y=0;for(let E of A)E.type&&g.has(E.type)&&(this.bufferEvent(h,E),y++);o.info(s,`Mission Control replayed ${y}/${A.length} historical events`)}catch(A){o.warn(s,`Mission Control history replay failed: ${NX(A)}`)}try{let A=this.sdkSession.on("*",y=>{!this.state||this.state.disposed||this.bufferEvent(this.state,y)});h.eventListenerDispose=typeof A=="function"?A:void 0,o.info(s,"Mission Control listener attached")}catch(A){o.warn(s,`Mission Control session.on('*') failed: ${NX(A)}`)}try{ecr(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!0})}catch(A){o.warn(s,`sdk.emit(remote_steerable_changed=true) failed: ${NX(A)}`)}return this.remoteCtx.sessionTitle&&h.eventBuffer.push(this.createEvent(h,"session.title_changed",{title:this.remoteCtx.sessionTitle},!0)),await this.flush(),h.flushInterval=setInterval(()=>{this.flush().catch(A=>o.warn(s,`mc flush err: ${A}`))},eHs),h.pollInterval=setInterval(()=>{this.poll().catch(A=>o.warn(s,`mc poll err: ${A}`))},tHs),o.info(s,`Mission Control enabled for session ${this.sessionId}`,{mcSessionId:f.id,mcTaskId:f.taskId,url:h.frontendUrl}),{url:h.frontendUrl,remoteSteerable:!0}}async disable(){let e=this.state;if(!(!e||e.disposed)){e.pollInterval&&clearInterval(e.pollInterval),e.flushInterval&&clearInterval(e.flushInterval),e.eventListenerDispose?.(),e.eventListenerDispose=void 0,e.toolCallIdToRequestId.clear();try{ecr(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!1})}catch(r){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`sdk.emit(remote_steerable_changed=false) failed: ${NX(r)}`)}e.eventBuffer.push(this.createEvent(e,"session.remote_steerable_changed",{remoteSteerable:!1})),e.eventBuffer.push(this.createEvent(e,"session.idle",{})),await this.flush(),e.disposed=!0,this.remoteCtx.logger.info(this.remoteCtx.ctx,`Mission Control disabled for session ${this.sessionId}`)}}getMcSessionId(){return this.state?.mcSessionId}async deleteRemote(){let e=this.state?.mcSessionId;e&&await this.remoteCtx.client.deleteSession(e)}getStatus(){let e=this.state;return!e||e.disposed?{remoteSteerable:!1}:{url:e.frontendUrl,remoteSteerable:!0}}createEvent(e,r,n,o){let s=(0,iJn.randomUUID)(),c={id:s,timestamp:new Date().toISOString(),parentId:e.lastEventId??null,type:r,data:n,...o!==void 0?{ephemeral:o}:{}};return e.lastEventId=s,c}bufferEvent(e,r){if(!eJn(r))return;tJn(e,r),this.trackInteractionRequestId(e,r),this.maybeAutoDeriveTitle(e,r);let n=r.id,o=r.timestamp,s=r.parentId,c=r.ephemeral;typeof n=="string"&&typeof o=="string"?(e.eventBuffer.push({id:n,timestamp:o,parentId:typeof s=="string"?s:e.lastEventId??null,...typeof c=="boolean"?{ephemeral:c}:{},type:r.type??"unknown",data:Tdr(r)}),e.lastEventId=n):e.eventBuffer.push(this.createEvent(e,r.type??"unknown",Tdr(r))),e.eventBuffer.length>BDe&&e.eventBuffer.splice(0,e.eventBuffer.length-BDe)}maybeAutoDeriveTitle(e,r){if(e.titleSent)return;if(r.type==="session.title_changed"){e.titleSent=!0;return}if(r.type!=="user.message")return;let n=r.data?.content,o=oHs(typeof n=="string"?n:"");o&&(e.eventBuffer.push(this.createEvent(e,"session.title_changed",{title:o},!0)),e.titleSent=!0)}trackInteractionRequestId(e,r){let n=r.data;if(n)switch(r.type){case"permission.requested":{let o=n.requestId,s=n.permissionRequest?.toolCallId;typeof o=="string"&&typeof s=="string"&&this.registerInteractionMapping(e,s,o);return}case"user_input.requested":{let o=n.requestId,s=n.toolCallId;typeof o=="string"&&typeof s=="string"&&this.registerInteractionMapping(e,s,o);return}case"permission.completed":{let o=n.toolCallId;typeof o=="string"&&e.toolCallIdToRequestId.delete(o);return}case"user_input.completed":{let o=n.requestId;if(typeof o=="string"){for(let[s,c]of e.toolCallIdToRequestId)if(c===o){e.toolCallIdToRequestId.delete(s);break}}return}}}registerInteractionMapping(e,r,n){if(e.toolCallIdToRequestId.size>=iHs){let o=e.toolCallIdToRequestId.keys().next().value;o!==void 0&&e.toolCallIdToRequestId.delete(o)}e.toolCallIdToRequestId.set(r,n)}async flush(){let e=this.state;if(!e||e.disposed||e.flushInFlight)return;if(!this.circuitBreaker.canRequest()){e.eventBuffer.length>BDe&&e.eventBuffer.splice(0,e.eventBuffer.length-BDe);return}let r=e.eventBuffer.length>0,n=e.completedCommandIds.length>0,o=!r&&!n&&Date.now()-e.lastSubmitAttemptTimeMs>=rHs;if(!r&&!n&&!o)return;e.flushInFlight=!0;let s=e.completedCommandIds.splice(0),c=e.eventBuffer.splice(0,nHs);e.lastSubmitAttemptTimeMs=Date.now();try{await this.remoteCtx.client.submitEvents(e.mcSessionId,c,s)?this.circuitBreaker.recordSuccess():(this.circuitBreaker.recordFailure(),e.eventBuffer.length+c.length<=BDe&&e.eventBuffer.unshift(...c),e.completedCommandIds.unshift(...s))}finally{e.flushInFlight=!1}}async poll(){let e=this.state;if(!(!e||e.disposed)&&!e.pollInFlight){e.pollInFlight=!0;try{let r=await this.remoteCtx.client.getPendingCommands(e.mcSessionId),n=new Set(r.map(o=>o.id));for(let o of e.processedCommandIds)n.has(o)||e.processedCommandIds.delete(o);for(let o of r){if(o.state!=="in_progress"||e.processedCommandIds.has(o.id))continue;e.processedCommandIds.add(o.id);let s=typeof o.content=="string"?o.content.length>120?o.content.slice(0,120)+"\u2026":o.content:"";this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc dispatch start: id=${o.id} type=${o.type??""} preview=${JSON.stringify(s)}`);try{await this.dispatchCommand(e,o),this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc dispatch ok: id=${o.id} type=${o.type??""}`)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc dispatch ${o.type??"user_message"} failed: ${NX(c)}`)}o.type!==void 0&&o.type!==""&&o.type!=="user_message"&&e.completedCommandIds.push(o.id)}}finally{e.pollInFlight=!1}}}async dispatchCommand(e,r){switch(r.type){case"abort":{await this.sdkSession.abort?.();return}case"permission_response":{let n=nJn(r.content);if(!n?.promptId)return;let o=e.toolCallIdToRequestId.get(n.promptId)??n.promptId,s=n.approved?{kind:n.scope==="session"?"approve-session":"approve-once"}:{kind:"denied-interactively-by-user",...n.feedback?{feedback:n.feedback}:{}};try{this.sdkSession.respondToPermission(o,s)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc permission_response forward failed (promptId=${n.promptId}, requestId=${o}): ${NX(c)}`)}return}case"ask_user_response":{let n=nJn(r.content);if(!n?.promptId)return;let o=e.toolCallIdToRequestId.get(n.promptId)??n.promptId,s={answer:typeof n.answer=="string"?n.answer:"",wasFreeform:n.wasFreeform===!0};try{this.sdkSession.respondToUserInput(o,s)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc ask_user_response forward failed (promptId=${n.promptId}, requestId=${o}): ${NX(c)}`)}return}case"mode_switch":{this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc mode_switch ignored (cmd ${r.id})`);return}default:{await this.remoteCtx.injectUserMessage(this.sessionId,r.content,`command-${r.id}`);return}}}};function nJn(t){try{return JSON.parse(t)}catch{return}}a(nJn,"safeJsonParse");function NX(t){return t instanceof Error?t.message:String(t)}a(NX,"errMsg");function oHs(t){if(!t)return"";let e=t.split(/\r?\n/).map(r=>r.trim()).find(r=>r.length>0);return e?e.length>rJn?e.slice(0,rJn-1).trimEnd()+"\u2026":e:""}a(oHs,"deriveTitleFromMessage");function sHs(t){if(/^[a-zA-Z]:[\\/]/.test(t)){let r=t[0],n=t.slice(2).replace(/\\/g,"/").replace(/^\/+/,""),o=`/${r.toLowerCase()}:/${n}`,s=`file:///${r.toLowerCase()}%3A/${encodeURI(n).replace(/%2F/g,"/")}`;return{$mid:1,fsPath:t,_sep:1,external:s,path:o,scheme:"file"}}return{$mid:1,fsPath:t,external:`file://${encodeURI(t).replace(/%2F/g,"/")}`,path:t,scheme:"file"}}a(sHs,"toVscodeUriShape");var Idr=new fe("BackgroundAgent.RemoteController"),Yct=class{constructor(e,r){this.ctx=e;this.deps=r;this.delegates=new Map}static{a(this,"RemoteController")}attachLazy(e,r){let n=this.delegates.get(e);if(n)return n;let o=this.deps.registry.getWorkingDir(e);if(!o)throw new Error(`Mission Control: working directory unknown for session ${e}; cannot attach delegate.`);let s=new Vct(this.ctx,Idr,{getApiBase:a(()=>this.getMissionControlApiBase(),"getApiBase"),getAuthToken:a(()=>this.getGithubAccessToken(),"getAuthToken"),integrationId:this.getCopilotIntegrationId()}),c=new zct(e,r,{workingDir:o,getGithubToken:a(()=>this.getGithubAccessToken(),"getGithubToken"),client:s,logger:Idr,ctx:this.ctx,injectUserMessage:a((l,u,d)=>this.deps.injectUserMessage(l,u,d),"injectUserMessage")});if(!VGn(r,c))throw new Error("SDK capability missing: LocalSession.setRemoteDelegate");return this.delegates.set(e,c),this.deps.registry.registerChild(e,{dispose:a(()=>this.fireAndForgetTearDown(e),"dispose")}),c}async enableForSession(e,r){this.attachLazy(e,r);let n=tcr(r);if(!n)throw new Error("Remote steering not supported by this SDK version");return n.enable()}async disableForSession(e){let r=tcr(e);r&&await r.disable()}getStatus(e){let r=this.delegates.get(e);return r?r.getStatus():{remoteSteerable:!1}}delegateCount(){return this.delegates.size}fireAndForgetTearDown(e){let r=this.delegates.get(e);r&&(this.delegates.delete(e),r.disable().catch(()=>{}))}async tearDownForDestroy(e){let r=this.delegates.get(e);if(r){try{await r.disable()}catch{}try{await r.deleteRemote()}catch(n){Idr.warn(this.ctx,"Mission Control deleteSession failed during destroySession",{sessionId:e,error:n instanceof Error?n.message:String(n)})}this.delegates.delete(e)}}async getMissionControlApiBase(){let n=(await this.ctx.get(Qt).getToken()).endpoints.api;if(!n)throw new Error("Copilot API endpoint not available");return n}async getGithubAccessToken(){let e=await this.ctx.get(Ur).resolveSession();if(!e?.accessToken)throw new Error("Not authenticated");return e.accessToken}getCopilotIntegrationId(){return"vscode-chat"}addDelegateForTesting(e,r){this.delegates.set(e,r),this.deps.registry.registerChild(e,{dispose:a(()=>this.fireAndForgetTearDown(e),"dispose")})}delegatesForTesting(){return this.delegates}};p();p();var xdr=new fe("BackgroundAgent.CustomAgents");async function Kct(t,e){try{if(Ft(t,Ye.EnableCustomAgents)===!1)return xdr.info(t,"Custom agents are disabled by configuration"),[];let o=await t.get(Ld).listCustomAgents([e],{includePlugins:!0});return o.length>0&&xdr.info(t,`Loaded ${o.length} custom agent(s) for session`),o.map(s=>aHs(s))}catch(r){return xdr.warn(t,"Failed to load custom agents:",r),[]}}a(Kct,"loadCustomAgents");function aHs(t){let e=t.instruction??"";return{name:t.name,displayName:t.name,description:t.description??"",tools:t.tools??null,prompt:a(()=>Promise.resolve(e),"prompt"),disableModelInvocation:!1,model:t.model}}a(aHs,"toSweCustomAgent");p();var wdr=new fe("BackgroundAgent.Hooks"),Rdr="copilot-language-server";function oJn(t,e){return{preToolUse:[cHs(t,e)],postToolUse:[lHs(t,e)],userPromptSubmitted:[uHs(t,e)]}}a(oJn,"buildSessionHooks");function cHs(t,e){return{source:Rdr,handler:a(async r=>{try{let o=await t.get(mE).hook(t,o2,{timestamp:r.timestamp,cwd:un(e.uri),toolName:r.toolName,toolArgs:FDe(r.toolArgs)},e);for(let s of o){let c=s.output;if(c&&c.permissionDecision===Xue.deny)return{permissionDecision:"deny",permissionDecisionReason:c.permissionDecisionReason||"Tool execution denied by hook"}}return}catch(n){wdr.error(t,`Failed to execute PreToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(cHs,"createPreToolUseHandler");function lHs(t,e){return{source:Rdr,handler:a(async r=>{try{await t.get(mE).hook(t,i2,{timestamp:r.timestamp,cwd:un(e.uri),toolName:r.toolName,toolArgs:FDe(r.toolArgs),toolResult:{resultType:kdr(r.toolResult.resultType),textResultForLlm:r.toolResult.textResultForLlm}},e);return}catch(n){wdr.error(t,`Failed to execute PostToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(lHs,"createPostToolUseHandler");function uHs(t,e){return{source:Rdr,handler:a(async r=>{try{await t.get(mE).hook(t,s2,{timestamp:r.timestamp,cwd:un(e.uri),prompt:r.prompt},e);return}catch(n){wdr.error(t,"Failed to execute UserPromptSubmitted hook",n);return}},"handler")}}a(uHs,"createUserPromptSubmittedHandler");function FDe(t){if(typeof t=="string")return t;try{return JSON.stringify(t)??""}catch{return""}}a(FDe,"safeStringifyToolArgs");function kdr(t){switch(t){case"success":case"failure":case"denied":return t;case"rejected":return"denied";case"timeout":return"failure";default:return"failure"}}a(kdr,"toClsToolResultType");p();var dHs=["model-agents-md","cwd-model-agents-md"],fHs=["model-claude-md","cwd-model-claude-md"],pHs="nested-agents";function sJn(t){let e=new Set;if(t.useAgentsMdFile===!1)for(let r of dHs)e.add(r);if(t.useClaudeMdFile===!1)for(let r of fHs)e.add(r);return t.useNestedAgentsMdFiles===!1&&e.add(pHs),e}a(sJn,"computeDisabledInstructionSources");var hHs=new Set(["node_modules",".git","vendor","dist","build",".next",".nuxt","out","coverage"]),mHs=2,gHs="CLAUDE.md",AHs="AGENTS.md";function yHs(t,e){if(e.length===0)return t;let r=t.includes("\\")&&!t.includes("/")?"\\":"/";return[t.endsWith("/")||t.endsWith("\\")?t.slice(0,-1):t,...e].join(r)}a(yHs,"joinPath");async function EHs(t,e,r){let n=[],o=a(async(s,c)=>{let l;try{l=await t(yHs(e,s))}catch{return}for(let[u,d]of l){let f=(d&1)!==0,h=(d&2)!==0;f&&u===r&&s.length>0?n.push([...s,r].join("/")):h&&co.content.trim().length>0);if(r.length===0)return;let n=r.map(o=>[`<${e}-instructions path="${o.relativePath}">`,o.content.trim(),``].join(` +\`\`\``}a(y8s,"buildCursorCropFragment");p();p();var xVn=require("node:crypto"),Hat=fe(require("node:fs")),Jw=fe(require("node:fs/promises")),wVn=require("node:os"),Y5=fe(require("node:path"));var pX=new pe("BackgroundAgent.SandboxBinaryResolver");async function RVn(t){if(!process.env.MXC_BIN_DIR)try{let e=Y5.join(__dirname,"node_modules","@github","copilot","mxc-bin");if(!Hat.existsSync(e)){pX.debug(t,`Local sandbox binaries not found at ${e}; sandbox will be unavailable`);return}if(!("pkg"in process)){process.env.MXC_BIN_DIR=e,pX.debug(t,`Local sandbox binaries located; MXC_BIN_DIR=${e}`);return}let r=await _8s(t,e);r&&(process.env.MXC_BIN_DIR=r,pX.debug(t,`Local sandbox binaries extracted; MXC_BIN_DIR=${r}`))}catch(e){pX.warn(t,"Failed to resolve MXC_BIN_DIR for the local sandbox",{error:e instanceof Error?e.message:String(e)})}}a(RVn,"ensureSandboxBinDirEnv");function E8s(){switch(process.platform){case"win32":return"wxc-exec.exe";case"darwin":return"mxc-exec-mac";default:return"lxc-exec"}}a(E8s,"sandboxMainBinaryName");async function _8s(t,e){if(process.arch!=="x64"&&process.arch!=="arm64"){pX.debug(t,`Local sandbox unsupported on architecture ${process.arch}; sandbox will be unavailable`);return}let r=process.arch,n=Y5.join(e,r),o=E8s(),s=Y5.join(n,o);if(!Hat.existsSync(s)){pX.warn(t,`Local sandbox binary ${r}/${o} not embedded; sandbox will be unavailable`);return}let c=(0,xVn.createHash)("sha256").update(await Jw.readFile(s)).digest("hex"),l=process.env.PKG_NATIVE_CACHE_PATH||Y5.join((0,wVn.homedir)(),".cache"),u=Y5.join(l,"pkg",`mxc-bin-${c}`),d=Y5.join(u,r),f=Y5.join(d,".extraction-complete");if(Hat.existsSync(f))return u;await Jw.mkdir(d,{recursive:!0});let h=await Jw.readdir(n,{withFileTypes:!0});for(let m of h){if(!m.isFile())continue;let g=Y5.join(d,m.name);await Jw.copyFile(Y5.join(n,m.name),g),process.platform!=="win32"&&await Jw.chmod(g,493).catch(A=>pX.warn(t,`Failed to set executable permission for ${g}`,{error:A instanceof Error?A.message:String(A)}))}return await Jw.writeFile(f,""),u}a(_8s,"extractSandboxBinDirFromPkg");p();function kVn(t,e){let r=t,n=r.permissions?.setRequired;if(typeof n=="function"){Promise.resolve(n.call(r.permissions,{required:e}));return}typeof r.setPermissionsRequired=="function"&&r.setPermissionsRequired(e)}a(kVn,"setPermissionsRequired");function PVn(t,e){let r=t;return typeof r.setRemoteDelegate!="function"?!1:(r.setRemoteDelegate(e),!0)}a(PVn,"setRemoteDelegate");function Wcr(t,e,r){let n=t;return typeof n.emit!="function"?!1:(n.emit(e,r),!0)}a(Wcr,"emitSessionEvent");function zcr(t){let r=t.remote;if(!(!r||typeof r.enable!="function"||typeof r.disable!="function"))return r}a(zcr,"getRemoteHandle");function DVn(t){let e=t.AutoModeSessionManager;if(typeof e=="function")try{return new e}catch{return}}a(DVn,"createAutoModeSessionManager");function NVn(t){if(t)try{t.clear()}catch{}}a(NVn,"clearAutoModeManager");var OVn=require("node:module");var MVn=new pe("BackgroundAgent.ManagerLifecycle");async function v8s(){return"pkg"in process?(0,OVn.createRequire)(__filename)("./node_modules/@github/copilot/sdk/index.cjs"):import("@github/copilot/sdk")}a(v8s,"importSdk");var Gat=class{constructor(e){this.ctx=e}static{a(this,"ManagerLifecycle")}async ensureManager(){if(this.manager)return this.manager;this.managerInitPromise||(this.managerInitPromise=this.initManager());try{await this.managerInitPromise}catch(e){throw this.managerInitPromise=void 0,e}if(!this.manager)throw new Error("LocalSessionManager initialization succeeded but manager is undefined");return this.manager}getSdk(){return this.sdk}getAutoModeManager(){return this.autoModeManager}clearAutoMode(){NVn(this.autoModeManager)}async dispose(){this.manager&&(await this.manager.dispose(),this.manager=void 0),this.sdk=void 0,this.autoModeManager=void 0,this.managerInitPromise=void 0}setStubManagerForTesting(e){this.manager=e}setStubSdkForTesting(e){this.sdk=e}setAutoModeManagerForTesting(e){this.autoModeManager=e}async initManager(){MVn.info(this.ctx,"Initializing LocalSessionManager (in-process SDK)..."),$Dn(this.ctx);let e=performance.now();try{this.sdk=await v8s(),cr(this.ctx,"backgroundAgent.importSdk",{status_text:"success"},{duration_ms:performance.now()-e})}catch(o){throw Cs(this.ctx,"backgroundAgent.importSdk",o,{status_text:"failure"},{duration_ms:performance.now()-e}),o}await RVn(this.ctx),await Fat(this.ctx);let r={telemetryService:new this.sdk.internal.NoopTelemetryService};typeof this.sdk.createLocalFeatureFlagServiceCreator=="function"&&(r.createFeatureFlagService=this.sdk.createLocalFeatureFlagServiceCreator()),typeof this.sdk.createLocalFeatureFlagService=="function"&&(r.featureFlagService=this.sdk.createLocalFeatureFlagService());let n=DVn(this.sdk);n!==void 0&&(r.autoModeManager=n),this.autoModeManager=n,this.manager=new this.sdk.internal.LocalSessionManager(r),MVn.info(this.ctx,"LocalSessionManager initialized.")}};p();p();var $at="/agents/sessions",Vat=class{constructor(e,r,n){this.ctx=e;this.logger=r;this.opts=n;this.fetchImpl=n.fetch??fetch}static{a(this,"MissionControlApiClient")}async createSession(e,r,n){let o=await this.buildUrl($at),s=await this.buildHeaders();s["Content-Type"]="application/json";let c=Date.now();this.logger.info(this.ctx,`MissionControl POST ${o}`,{ownerId:e,repoId:r,agentTaskId:n,integrationId:this.opts.integrationId});let l=await this.fetchWithTimeout(o,{method:"POST",headers:s,body:JSON.stringify({owner_id:e,repo_id:r,agent_task_id:n})});if(!l.ok){let f=await LVn(l);throw this.logger.warn(this.ctx,`MissionControl createSession \u2190 ${l.status} ${l.statusText}`,{durationMs:Date.now()-c,body:f.slice(0,500)}),new Error(`MissionControl createSession failed: ${l.status} ${l.statusText} ${f}`)}let u=await l.json();if(typeof u.id!="string")throw new Error("MissionControl createSession: response missing id");let d=typeof u.task_id=="string"?u.task_id:u.id;return this.logger.info(this.ctx,"MissionControl createSession \u2190 200",{durationMs:Date.now()-c,mcSessionId:u.id,mcTaskId:d}),{id:u.id,taskId:d}}async submitEvents(e,r,n){let o=await this.buildUrl(`${$at}/${encodeURIComponent(e)}/events`),s=Date.now();this.logger.info(this.ctx,`MissionControl POST ${o}`,{eventCount:r.length,ackCount:n.length,eventTypes:r.slice(0,10).map(c=>c.type)});try{let c=await this.buildHeaders();c["Content-Type"]="application/json";let l={events:r};n.length>0&&(l.completed_command_ids=n);let u=await this.fetchWithTimeout(o,{method:"POST",headers:c,body:JSON.stringify(l)});if(!u.ok){let d=await LVn(u);return this.logger.warn(this.ctx,`MissionControl submitEvents \u2190 ${u.status} ${u.statusText}`,{durationMs:Date.now()-s,body:d.slice(0,500)}),!1}return this.logger.info(this.ctx,"MissionControl submitEvents \u2190 200",{durationMs:Date.now()-s,eventCount:r.length,ackCount:n.length}),!0}catch(c){return this.logger.warn(this.ctx,`MissionControl submitEvents error: ${c instanceof Error?c.message:String(c)}`,{durationMs:Date.now()-s}),!1}}async getPendingCommands(e){let r=await this.buildUrl(`${$at}/${encodeURIComponent(e)}/commands`),n=Date.now();try{let o=await this.buildHeaders(),s=await this.fetchWithTimeout(r,{method:"GET",headers:o});if(!s.ok)return this.logger.warn(this.ctx,`MissionControl GET ${r} \u2190 ${s.status} ${s.statusText}`,{durationMs:Date.now()-n}),[];let c=await s.json(),l=Array.isArray(c.commands)?c.commands:[];return l.length>0?this.logger.info(this.ctx,`MissionControl GET ${r} \u2190 200`,{durationMs:Date.now()-n,commandCount:l.length,commandIds:l.map(u=>u.id)}):this.logger.debug(this.ctx,`MissionControl GET ${r} \u2190 200 (no commands)`,{durationMs:Date.now()-n}),l}catch(o){return this.logger.warn(this.ctx,`MissionControl getPendingCommands error: ${o instanceof Error?o.message:String(o)}`,{durationMs:Date.now()-n}),[]}}async deleteSession(e){let r=await this.buildUrl(`${$at}/${encodeURIComponent(e)}/`),n=Date.now();this.logger.info(this.ctx,`MissionControl DELETE ${r}`);try{let o=await this.buildHeaders(),s=await this.fetchWithTimeout(r,{method:"DELETE",headers:o});this.logger.info(this.ctx,`MissionControl DELETE ${r} \u2190 ${s.status}`,{durationMs:Date.now()-n})}catch(o){this.logger.warn(this.ctx,`MissionControl deleteSession error: ${o instanceof Error?o.message:String(o)}`,{durationMs:Date.now()-n})}}async buildUrl(e){return`${(await this.opts.getApiBase()).replace(/\/+$/,"")}${e.startsWith("/")?e:`/${e}`}`}async buildHeaders(){return{Authorization:`Bearer ${await this.opts.getAuthToken()}`,"Copilot-Integration-Id":this.opts.integrationId,Accept:"application/json","User-Agent":"GitHubCopilotChat/0.0.0"}}async fetchWithTimeout(e,r){let n=new AbortController,o=setTimeout(()=>n.abort(),1e4);try{return await this.fetchImpl(e,{...r,signal:n.signal})}finally{clearTimeout(o)}}};async function LVn(t){try{return await t.text()}catch{return""}}a(LVn,"safeReadText");p();p();var Wat=class{constructor(e){this.opts=e;this.failureCount=0;this.state=0;this.nextRetryAt=0;this.currentTimeoutMs=e.resetTimeoutMs}static{a(this,"CircuitBreaker")}canRequest(){return this.state===0?!0:this.state===1&&Date.now()>=this.nextRetryAt?(this.state=2,!0):this.state===2}recordSuccess(){this.failureCount=0,this.state=0,this.currentTimeoutMs=this.opts.resetTimeoutMs}recordFailure(){this.failureCount++,(this.state===2||this.failureCount>=this.opts.failureThreshold)&&(this.state=1,this.nextRetryAt=Date.now()+this.currentTimeoutMs,this.currentTimeoutMs=Math.min(this.currentTimeoutMs*2,this.opts.maxResetTimeoutMs))}getState(){return this.state}getFailureCount(){return this.failureCount}get name(){return this.opts.name}};p();var C8s=new Set(["assistant.message_delta","assistant.streaming_delta","session.shutdown","session.error","session.usage_info","assistant.usage","pending_messages.modified","session.mcp_server_status_changed","session.mcp_servers_loaded","session.skills_loaded","session.tools_updated"]);function BVn(t){return!(!t.type||C8s.has(t.type)||t.type.startsWith("tool.execution_")&&t.data?.toolName==="report_intent")}a(BVn,"shouldForwardMissionControlEvent");function Ycr(t){let e=t.data;return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}a(Ycr,"getMissionControlEventData");function FVn(t,e){if(e.type!=="user.message")return;let r=e.data?.source;if(typeof r!="string"||!r.startsWith("command-"))return;let n=r.slice(8);n&&t.completedCommandIds.push(n)}a(FVn,"maybeAcknowledgeMissionControlCommandFromEvent");var qVn=require("node:crypto");var b8s=500,S8s=3e3,T8s=1e4,I8s=500,F2e=2e3,x8s=256,UVn=80,zat=class{constructor(e,r,n){this.sessionId=e;this.sdkSession=r;this.remoteCtx=n;this.circuitBreaker=new Wat({failureThreshold:5,resetTimeoutMs:1e3,maxResetTimeoutMs:3e4,name:"mc-events"})}static{a(this,"MissionControlRemoteDelegate")}async enable(){if(this.state&&!this.state.disposed)return{url:this.state.frontendUrl,remoteSteerable:!0};let{workingDir:e,getGithubToken:r,client:n,logger:o,ctx:s}=this.remoteCtx,c=await Xgn(e);if(!c)throw new Error("Mission Control: not_a_github_repo");let l=await r(),u=await eAn(c,l);if(!u)throw new Error("Mission Control: repo_id_resolution_failed");let d=`${Date.now()}-${Math.random().toString(36).slice(2,10)}`,f=await n.createSession(u.ownerId,u.repoId,d),h={mcSessionId:f.id,mcTaskId:f.taskId,nwo:c,frontendUrl:`https://github.com/${c.owner}/${c.repo}/tasks/${f.taskId}`,eventBuffer:[],completedCommandIds:[],toolCallIdToRequestId:new Map,lastEventId:null,lastSubmitAttemptTimeMs:Date.now(),processedCommandIds:new Set,disposed:!1,titleSent:!!this.remoteCtx.sessionTitle,flushInFlight:!1,pollInFlight:!1};this.state=h;let m=R8s(e);h.eventBuffer.push(this.createEvent(h,"session.start",{sessionId:h.mcSessionId,version:1,producer:"copilot-developer-cli",copilotVersion:"1.0.0",startTime:new Date().toISOString(),remoteSteerable:!0,context:{cwd:m,gitRoot:m,repository:`${c.owner}/${c.repo}`}}));let g=new Set(["user.message","assistant.message","assistant.turn_start","assistant.turn_complete","tool.execution_start","tool.execution_complete"]);try{let A=Array.from(this.sdkSession.getEvents()),y=0;for(let E of A)E.type&&g.has(E.type)&&(this.bufferEvent(h,E),y++);o.info(s,`Mission Control replayed ${y}/${A.length} historical events`)}catch(A){o.warn(s,`Mission Control history replay failed: ${hX(A)}`)}try{let A=this.sdkSession.on("*",y=>{!this.state||this.state.disposed||this.bufferEvent(this.state,y)});h.eventListenerDispose=typeof A=="function"?A:void 0,o.info(s,"Mission Control listener attached")}catch(A){o.warn(s,`Mission Control session.on('*') failed: ${hX(A)}`)}try{Wcr(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!0})}catch(A){o.warn(s,`sdk.emit(remote_steerable_changed=true) failed: ${hX(A)}`)}return this.remoteCtx.sessionTitle&&h.eventBuffer.push(this.createEvent(h,"session.title_changed",{title:this.remoteCtx.sessionTitle},!0)),await this.flush(),h.flushInterval=setInterval(()=>{this.flush().catch(A=>o.warn(s,`mc flush err: ${A}`))},b8s),h.pollInterval=setInterval(()=>{this.poll().catch(A=>o.warn(s,`mc poll err: ${A}`))},S8s),o.info(s,`Mission Control enabled for session ${this.sessionId}`,{mcSessionId:f.id,mcTaskId:f.taskId,url:h.frontendUrl}),{url:h.frontendUrl,remoteSteerable:!0}}async disable(){let e=this.state;if(!(!e||e.disposed)){e.pollInterval&&clearInterval(e.pollInterval),e.flushInterval&&clearInterval(e.flushInterval),e.eventListenerDispose?.(),e.eventListenerDispose=void 0,e.toolCallIdToRequestId.clear();try{Wcr(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!1})}catch(r){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`sdk.emit(remote_steerable_changed=false) failed: ${hX(r)}`)}e.eventBuffer.push(this.createEvent(e,"session.remote_steerable_changed",{remoteSteerable:!1})),e.eventBuffer.push(this.createEvent(e,"session.idle",{})),await this.flush(),e.disposed=!0,this.remoteCtx.logger.info(this.remoteCtx.ctx,`Mission Control disabled for session ${this.sessionId}`)}}getMcSessionId(){return this.state?.mcSessionId}async deleteRemote(){let e=this.state?.mcSessionId;e&&await this.remoteCtx.client.deleteSession(e)}getStatus(){let e=this.state;return!e||e.disposed?{remoteSteerable:!1}:{url:e.frontendUrl,remoteSteerable:!0}}createEvent(e,r,n,o){let s=(0,qVn.randomUUID)(),c={id:s,timestamp:new Date().toISOString(),parentId:e.lastEventId??null,type:r,data:n,...o!==void 0?{ephemeral:o}:{}};return e.lastEventId=s,c}bufferEvent(e,r){if(!BVn(r))return;FVn(e,r),this.trackInteractionRequestId(e,r),this.maybeAutoDeriveTitle(e,r);let n=r.id,o=r.timestamp,s=r.parentId,c=r.ephemeral;typeof n=="string"&&typeof o=="string"?(e.eventBuffer.push({id:n,timestamp:o,parentId:typeof s=="string"?s:e.lastEventId??null,...typeof c=="boolean"?{ephemeral:c}:{},type:r.type??"unknown",data:Ycr(r)}),e.lastEventId=n):e.eventBuffer.push(this.createEvent(e,r.type??"unknown",Ycr(r))),e.eventBuffer.length>F2e&&e.eventBuffer.splice(0,e.eventBuffer.length-F2e)}maybeAutoDeriveTitle(e,r){if(e.titleSent)return;if(r.type==="session.title_changed"){e.titleSent=!0;return}if(r.type!=="user.message")return;let n=r.data?.content,o=w8s(typeof n=="string"?n:"");o&&(e.eventBuffer.push(this.createEvent(e,"session.title_changed",{title:o},!0)),e.titleSent=!0)}trackInteractionRequestId(e,r){let n=r.data;if(n)switch(r.type){case"permission.requested":{let o=n.requestId,s=n.permissionRequest?.toolCallId;typeof o=="string"&&typeof s=="string"&&this.registerInteractionMapping(e,s,o);return}case"user_input.requested":{let o=n.requestId,s=n.toolCallId;typeof o=="string"&&typeof s=="string"&&this.registerInteractionMapping(e,s,o);return}case"permission.completed":{let o=n.toolCallId;typeof o=="string"&&e.toolCallIdToRequestId.delete(o);return}case"user_input.completed":{let o=n.requestId;if(typeof o=="string"){for(let[s,c]of e.toolCallIdToRequestId)if(c===o){e.toolCallIdToRequestId.delete(s);break}}return}}}registerInteractionMapping(e,r,n){if(e.toolCallIdToRequestId.size>=x8s){let o=e.toolCallIdToRequestId.keys().next().value;o!==void 0&&e.toolCallIdToRequestId.delete(o)}e.toolCallIdToRequestId.set(r,n)}async flush(){let e=this.state;if(!e||e.disposed||e.flushInFlight)return;if(!this.circuitBreaker.canRequest()){e.eventBuffer.length>F2e&&e.eventBuffer.splice(0,e.eventBuffer.length-F2e);return}let r=e.eventBuffer.length>0,n=e.completedCommandIds.length>0,o=!r&&!n&&Date.now()-e.lastSubmitAttemptTimeMs>=T8s;if(!r&&!n&&!o)return;e.flushInFlight=!0;let s=e.completedCommandIds.splice(0),c=e.eventBuffer.splice(0,I8s);e.lastSubmitAttemptTimeMs=Date.now();try{await this.remoteCtx.client.submitEvents(e.mcSessionId,c,s)?this.circuitBreaker.recordSuccess():(this.circuitBreaker.recordFailure(),e.eventBuffer.length+c.length<=F2e&&e.eventBuffer.unshift(...c),e.completedCommandIds.unshift(...s))}finally{e.flushInFlight=!1}}async poll(){let e=this.state;if(!(!e||e.disposed)&&!e.pollInFlight){e.pollInFlight=!0;try{let r=await this.remoteCtx.client.getPendingCommands(e.mcSessionId),n=new Set(r.map(o=>o.id));for(let o of e.processedCommandIds)n.has(o)||e.processedCommandIds.delete(o);for(let o of r){if(o.state!=="in_progress"||e.processedCommandIds.has(o.id))continue;e.processedCommandIds.add(o.id);let s=typeof o.content=="string"?o.content.length>120?o.content.slice(0,120)+"\u2026":o.content:"";this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc dispatch start: id=${o.id} type=${o.type??""} preview=${JSON.stringify(s)}`);try{await this.dispatchCommand(e,o),this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc dispatch ok: id=${o.id} type=${o.type??""}`)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc dispatch ${o.type??"user_message"} failed: ${hX(c)}`)}o.type!==void 0&&o.type!==""&&o.type!=="user_message"&&e.completedCommandIds.push(o.id)}}finally{e.pollInFlight=!1}}}async dispatchCommand(e,r){switch(r.type){case"abort":{await this.sdkSession.abort?.();return}case"permission_response":{let n=QVn(r.content);if(!n?.promptId)return;let o=e.toolCallIdToRequestId.get(n.promptId)??n.promptId,s=n.approved?{kind:n.scope==="session"?"approve-session":"approve-once"}:{kind:"denied-interactively-by-user",...n.feedback?{feedback:n.feedback}:{}};try{this.sdkSession.respondToPermission(o,s)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc permission_response forward failed (promptId=${n.promptId}, requestId=${o}): ${hX(c)}`)}return}case"ask_user_response":{let n=QVn(r.content);if(!n?.promptId)return;let o=e.toolCallIdToRequestId.get(n.promptId)??n.promptId,s={answer:typeof n.answer=="string"?n.answer:"",wasFreeform:n.wasFreeform===!0};try{this.sdkSession.respondToUserInput(o,s)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc ask_user_response forward failed (promptId=${n.promptId}, requestId=${o}): ${hX(c)}`)}return}case"mode_switch":{this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc mode_switch ignored (cmd ${r.id})`);return}default:{await this.remoteCtx.injectUserMessage(this.sessionId,r.content,`command-${r.id}`);return}}}};function QVn(t){try{return JSON.parse(t)}catch{return}}a(QVn,"safeJsonParse");function hX(t){return t instanceof Error?t.message:String(t)}a(hX,"errMsg");function w8s(t){if(!t)return"";let e=t.split(/\r?\n/).map(r=>r.trim()).find(r=>r.length>0);return e?e.length>UVn?e.slice(0,UVn-1).trimEnd()+"\u2026":e:""}a(w8s,"deriveTitleFromMessage");function R8s(t){if(/^[a-zA-Z]:[\\/]/.test(t)){let r=t[0],n=t.slice(2).replace(/\\/g,"/").replace(/^\/+/,""),o=`/${r.toLowerCase()}:/${n}`,s=`file:///${r.toLowerCase()}%3A/${encodeURI(n).replace(/%2F/g,"/")}`;return{$mid:1,fsPath:t,_sep:1,external:s,path:o,scheme:"file"}}return{$mid:1,fsPath:t,external:`file://${encodeURI(t).replace(/%2F/g,"/")}`,path:t,scheme:"file"}}a(R8s,"toVscodeUriShape");var Kcr=new pe("BackgroundAgent.RemoteController"),Yat=class{constructor(e,r){this.ctx=e;this.deps=r;this.delegates=new Map}static{a(this,"RemoteController")}attachLazy(e,r){let n=this.delegates.get(e);if(n)return n;let o=this.deps.registry.getWorkingDir(e);if(!o)throw new Error(`Mission Control: working directory unknown for session ${e}; cannot attach delegate.`);let s=new Vat(this.ctx,Kcr,{getApiBase:a(()=>this.getMissionControlApiBase(),"getApiBase"),getAuthToken:a(()=>this.getGithubAccessToken(),"getAuthToken"),integrationId:this.getCopilotIntegrationId()}),c=new zat(e,r,{workingDir:o,getGithubToken:a(()=>this.getGithubAccessToken(),"getGithubToken"),client:s,logger:Kcr,ctx:this.ctx,injectUserMessage:a((l,u,d)=>this.deps.injectUserMessage(l,u,d),"injectUserMessage")});if(!PVn(r,c))throw new Error("SDK capability missing: LocalSession.setRemoteDelegate");return this.delegates.set(e,c),this.deps.registry.registerChild(e,{dispose:a(()=>this.fireAndForgetTearDown(e),"dispose")}),c}async enableForSession(e,r){this.attachLazy(e,r);let n=zcr(r);if(!n)throw new Error("Remote steering not supported by this SDK version");return n.enable()}async disableForSession(e){let r=zcr(e);r&&await r.disable()}getStatus(e){let r=this.delegates.get(e);return r?r.getStatus():{remoteSteerable:!1}}delegateCount(){return this.delegates.size}fireAndForgetTearDown(e){let r=this.delegates.get(e);r&&(this.delegates.delete(e),r.disable().catch(()=>{}))}async tearDownForDestroy(e){let r=this.delegates.get(e);if(r){try{await r.disable()}catch{}try{await r.deleteRemote()}catch(n){Kcr.warn(this.ctx,"Mission Control deleteSession failed during destroySession",{sessionId:e,error:n instanceof Error?n.message:String(n)})}this.delegates.delete(e)}}async getMissionControlApiBase(){let n=(await this.ctx.get(Ft).getToken()).endpoints.api;if(!n)throw new Error("Copilot API endpoint not available");return n}async getGithubAccessToken(){let e=await this.ctx.get(Mr).resolveSession();if(!e?.accessToken)throw new Error("Not authenticated");return e.accessToken}getCopilotIntegrationId(){return"vscode-chat"}addDelegateForTesting(e,r){this.delegates.set(e,r),this.deps.registry.registerChild(e,{dispose:a(()=>this.fireAndForgetTearDown(e),"dispose")})}delegatesForTesting(){return this.delegates}};p();p();var Jcr=new pe("BackgroundAgent.CustomAgents");async function Kat(t,e){try{if(Rt(t,ze.EnableCustomAgents)===!1)return Jcr.info(t,"Custom agents are disabled by configuration"),[];let o=await t.get(jd).listCustomAgents([e],{includePlugins:!0});return o.length>0&&Jcr.info(t,`Loaded ${o.length} custom agent(s) for session`),o.map(s=>k8s(s))}catch(r){return Jcr.warn(t,"Failed to load custom agents:",r),[]}}a(Kat,"loadCustomAgents");function k8s(t){let e=t.instruction??"";return{name:t.name,displayName:t.name,description:t.description??"",tools:D8s(t.tools),prompt:a(()=>Promise.resolve(e),"prompt"),disableModelInvocation:!1,model:t.model}}a(k8s,"toSweCustomAgent");var P8s=new Map([["semantic_search",["grep","rg","glob","view"]],["read_file",["view"]],["list_dir",["glob"]],["file_search",["glob"]],["grep_search",["grep","rg"]],["insert_edit_into_file",["edit","str_replace_editor","apply_patch"]],["replace_string_in_file",["edit","str_replace_editor","apply_patch"]],["create_file",["create"]],["run_in_terminal",["bash","powershell"]],["get_terminal_output",["read_bash","read_powershell"]],["run_subagent",["task"]],["manage_todo_list",["update_todo"]],["validate_cves",["gh-advisory-database"]],["ask_questions",["ask_user"]]]);function D8s(t){if(t===void 0)return null;let e=[],r=new Set;for(let n of t){let s=P8s.get(n)??[n];for(let c of s)r.has(c)||(r.add(c),e.push(c))}return e}a(D8s,"mapCustomAgentTools");p();var Zcr=new pe("BackgroundAgent.Hooks"),Xcr="copilot-language-server";function jVn(t,e){return{preToolUse:[N8s(t,e)],postToolUse:[M8s(t,e)],userPromptSubmitted:[O8s(t,e)]}}a(jVn,"buildSessionHooks");function N8s(t,e){return{source:Xcr,handler:a(async r=>{try{let o=await t.get(_E).hook(t,p2,{timestamp:r.timestamp,cwd:ln(e.uri),toolName:r.toolName,toolArgs:U2e(r.toolArgs)},e);for(let s of o){let c=s.output;if(c&&c.permissionDecision===ude.deny)return{permissionDecision:"deny",permissionDecisionReason:c.permissionDecisionReason||"Tool execution denied by hook"}}return}catch(n){Zcr.error(t,`Failed to execute PreToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(N8s,"createPreToolUseHandler");function M8s(t,e){return{source:Xcr,handler:a(async r=>{try{await t.get(_E).hook(t,f2,{timestamp:r.timestamp,cwd:ln(e.uri),toolName:r.toolName,toolArgs:U2e(r.toolArgs),toolResult:{resultType:elr(r.toolResult.resultType),textResultForLlm:r.toolResult.textResultForLlm}},e);return}catch(n){Zcr.error(t,`Failed to execute PostToolUse hook for tool ${r.toolName}`,n);return}},"handler")}}a(M8s,"createPostToolUseHandler");function O8s(t,e){return{source:Xcr,handler:a(async r=>{try{await t.get(_E).hook(t,h2,{timestamp:r.timestamp,cwd:ln(e.uri),prompt:r.prompt},e);return}catch(n){Zcr.error(t,"Failed to execute UserPromptSubmitted hook",n);return}},"handler")}}a(O8s,"createUserPromptSubmittedHandler");function U2e(t){if(typeof t=="string")return t;try{return JSON.stringify(t)??""}catch{return""}}a(U2e,"safeStringifyToolArgs");function elr(t){switch(t){case"success":case"failure":case"denied":return t;case"rejected":return"denied";case"timeout":return"failure";default:return"failure"}}a(elr,"toClsToolResultType");p();var L8s=["model-agents-md","cwd-model-agents-md"],B8s=["model-claude-md","cwd-model-claude-md"],F8s="nested-agents";function HVn(t){let e=new Set;if(t.useAgentsMdFile===!1)for(let r of L8s)e.add(r);if(t.useClaudeMdFile===!1)for(let r of B8s)e.add(r);return t.useNestedAgentsMdFiles===!1&&e.add(F8s),e}a(HVn,"computeDisabledInstructionSources");var U8s=new Set(["node_modules",".git","vendor","dist","build",".next",".nuxt","out","coverage"]),Q8s=2,q8s="CLAUDE.md",j8s="AGENTS.md";function H8s(t,e){if(e.length===0)return t;let r=t.includes("\\")&&!t.includes("/")?"\\":"/";return[t.endsWith("/")||t.endsWith("\\")?t.slice(0,-1):t,...e].join(r)}a(H8s,"joinPath");async function G8s(t,e,r){let n=[],o=a(async(s,c)=>{let l;try{l=await t(H8s(e,s))}catch{return}for(let[u,d]of l){let f=(d&1)!==0,h=(d&2)!==0;f&&u===r&&s.length>0?n.push([...s,r].join("/")):h&&co.content.trim().length>0);if(r.length===0)return;let n=r.map(o=>[`<${e}-instructions path="${o.relativePath}">`,o.content.trim(),``].join(` `));return[`Here are nested ${e} files that contain additional agent instructions.`,...n].join(` -`)}a(_Hs,"buildNestedInstructionsSection");async function aJn(t,e,r,n){let o=await EHs(t,r,n),s=await Promise.all(o.map(async c=>({relativePath:c,content:await e(c)??""})));return _Hs(s,n)}a(aJn,"scanNestedInstructionsSection");function cJn(t,e,r){return aJn(t,e,r,gHs)}a(cJn,"scanNestedClaudeInstructions");function lJn(t,e,r){return aJn(t,e,r,AHs)}a(lJn,"scanNestedAgentsInstructions");function uJn(t){let e=[];if(t.gitCommitInstructions&&e.push(t.gitCommitInstructions),t.globalAgentsMdInstructions&&e.push(t.globalAgentsMdInstructions),t.nestedAgentsInstructions&&e.push(t.nestedAgentsInstructions),t.globalClaudeMdInstructions&&e.push(t.globalClaudeMdInstructions),t.nestedClaudeInstructions&&e.push(t.nestedClaudeInstructions),e.length!==0)return e.join(` +`)}a($8s,"buildNestedInstructionsSection");async function GVn(t,e,r,n){let o=await G8s(t,r,n),s=await Promise.all(o.map(async c=>({relativePath:c,content:await e(c)??""})));return $8s(s,n)}a(GVn,"scanNestedInstructionsSection");function $Vn(t,e,r){return GVn(t,e,r,q8s)}a($Vn,"scanNestedClaudeInstructions");function VVn(t,e,r){return GVn(t,e,r,j8s)}a(VVn,"scanNestedAgentsInstructions");function WVn(t){let e=[];if(t.gitCommitInstructions&&e.push(t.gitCommitInstructions),t.globalAgentsMdInstructions&&e.push(t.globalAgentsMdInstructions),t.nestedAgentsInstructions&&e.push(t.nestedAgentsInstructions),t.globalClaudeMdInstructions&&e.push(t.globalClaudeMdInstructions),t.nestedClaudeInstructions&&e.push(t.nestedClaudeInstructions),e.length!==0)return e.join(` -`)}a(uJn,"composeBackgroundAgentSystemMessage");p();p();p();p();var UDe=(n=>(n.Copilot="copilot",n.Claude="claude",n.OpenPlugin="openPlugin",n))(UDe||{});var MX=(n=>(n.GitHubShorthand="githubShorthand",n.GitUri="gitUri",n.LocalFileUri="localFileUri",n))(MX||{});p();p();var OX=require("fs"),whe=de(require("path"));var vHs=32,CHs=5e3,bHs=5*1024*1024,SHs=32,THs=xtn(SHs);async function MT(t,e){return THs.run(()=>o3(t(),CHs,e))}a(MT,"boundedFsOp");async function Pdr(t){let e=await MT(()=>OX.promises.stat(t),void 0);if(e)return{path:t,isFile:e.isFile(),isDirectory:e.isDirectory(),isSymlink:!1}}a(Pdr,"statEntry");async function QDe(t){let e=await MT(()=>OX.promises.readdir(t,{withFileTypes:!0}),void 0);return e?vx(e,vHs,async r=>{let n=whe.join(t,r.name);if(r.isSymbolicLink()){let o=await Pdr(n);return{path:n,isFile:o?.isFile??!1,isDirectory:o?.isDirectory??!1,isSymlink:!0}}return{path:n,isFile:r.isFile(),isDirectory:r.isDirectory(),isSymlink:!1}}):[]}a(QDe,"readChildren");var dJn=process.platform==="linux";function wE(t,e){let r=dJn?t:t.toLowerCase(),n=dJn?e:e.toLowerCase(),o=whe.relative(r,n);return o===""||!o.startsWith("..")&&!whe.isAbsolute(o)}a(wE,"isAtOrUnder");async function eR(t,e){if(t===void 0)return!0;let r=await MT(()=>OX.promises.realpath(e),void 0);return r!==void 0&&wE(t,r)}a(eR,"withinRealBoundary");async function LX(t){if(t!==void 0)return MT(()=>OX.promises.realpath(t),t)}a(LX,"resolveRealBoundary");async function Jct(t){let e=await MT(()=>OX.promises.stat(t),void 0);if(!(!e||!e.isFile()||e.size>bHs))return MT(()=>OX.promises.readFile(t,"utf8"),void 0)}a(Jct,"readTextFileCapped");var fJn=require("fs"),Ddr=de(require("path"));function OT(t){let e=t.replace(/[\\/:*?"<>|]/g,"_");return/^\.+$/.test(e)?e.replace(/\./g,"_"):e}a(OT,"sanitizeCacheSegment");function Rhe(t){return t?[`ref_${encodeURIComponent(t)}`]:[]}a(Rhe,"refCacheSegment");function Zct(t,e){return e?[`sha_${encodeURIComponent(e)}`]:Rhe(t)}a(Zct,"gitRevisionCacheSuffix");function pJn(t,e,r){try{let n=new URL(t),o=OT((n.host||"unknown").toLowerCase()),s=n.pathname.replace(/\/+/g,"/").replace(/^\/+/,"").replace(/\/+$/g,"").replace(/\.git$/i,""),c=s?s.split("/").map(OT):[];return[o,...c,...Zct(e,r)]}catch{return["git",OT(t),...Zct(e,r)]}}a(pJn,"gitUrlToCacheSegments");async function Wd(t){return MT(()=>fJn.promises.stat(t).then(()=>!0,()=>!1),!1)}a(Wd,"exists");function qDe(t,e){let r=Ddr.join(t,...e);if(!wE(t,r))throw new Error(`plugin cache path escapes the cache root: ${e.join("/")}`);return r}a(qDe,"joinCacheSegments");function jDe(t,e){if(!e)return t;let r=e.trim().replace(/^\.?\/+|\/+$/g,"");if(!r)return t;let n=Ddr.join(t,r);return wE(t,n)?n:t}a(jDe,"joinContained");var Xct=require("node:url");function hJn(t){let e=new Map;for(let r of t){let n=LT(r);n&&!e.has(n.canonicalId)&&e.set(n.canonicalId,n)}return[...e.values()]}a(hJn,"parseMarketplaceReferences");function LT(t){let e=t.trim();if(e)return xHs(e)??wHs(e)??IHs(e)}a(LT,"parseMarketplaceReference");function IHs(t){let e=/^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)(?:#(.+))?$/.exec(t);if(!e)return;let[,r,n,o]=e;return{rawValue:t,displayLabel:t,cloneUrl:`https://github.com/${r}/${n}.git`,canonicalId:gJn(r,n,o),cacheSegments:["github.com",OT(r),OT(n),...Rhe(o)],kind:"githubShorthand",ref:o,githubRepo:`${r}/${n}`}}a(IHs,"parseShorthandMarketplaceReference");function xHs(t){let e;try{e=new URL(t)}catch{return}let r=e.protocol.replace(/:$/,"").toLowerCase();if(r==="file"&&/^file:\/\//i.test(t)){if(e.hash)return;let y;try{y=(0,Xct.fileURLToPath)(e)}catch{return}return{rawValue:t,displayLabel:y,cloneUrl:t,canonicalId:`file:${(0,Xct.pathToFileURL)(y).toString().toLowerCase()}`,cacheSegments:[],kind:"localFileUri",localRepositoryUri:y}}if(r!=="http"&&r!=="https"&&r!=="ssh"||!e.host)return;let n=e.hash?e.hash.slice(1):void 0,o=RHs(e),s=e.host.toLowerCase(),c=OT(s),l=e.pathname.replace(/\/+/g,"/").replace(/\/+$/g,"").replace(/^\/+/,"");if(!l)return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:Ndr(`git:${s}/`,n),cacheSegments:[c,...Rhe(n)],kind:"gitUri",ref:n};let u=".git",d=l.toLowerCase().endsWith(u),f=d?l.slice(0,-u.length):l,h=f.split("/").map(OT),m=d?l.toLowerCase():`${l.toLowerCase()}${u}`,g=mJn(s,f),A=AJn(g,n,`git:${s}/${m}`);return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:A,cacheSegments:[c,...h,...Rhe(n)],kind:"gitUri",ref:n,githubRepo:g}}a(xHs,"parseUriMarketplaceReference");function wHs(t){let e=/^([^@\s]+)@([^:\s]+):(.+?\.git)(?:#(.+))?$/i.exec(t);if(!e)return;let r=".git",[,n,o,s,c]=e,l=s.replace(/^\/+/,"");if(!l.toLowerCase().endsWith(r))return;let u=l.slice(0,-r.length),d=u.split("/").map(OT),f=mJn(o,u),h=AJn(f,c,`git:${o.toLowerCase()}/${l.toLowerCase()}`);return{rawValue:t,displayLabel:t,cloneUrl:`${n}@${o}:${l}`,canonicalId:h,cacheSegments:[OT(o.toLowerCase()),...d,...Rhe(c)],kind:"gitUri",ref:c,githubRepo:f}}a(wHs,"parseScpMarketplaceReference");function RHs(t){if(!t.hash)return t.toString();let e=new URL(t.toString());return e.hash="",e.toString()}a(RHs,"refStrippedUrl");function mJn(t,e){if(t.toLowerCase()!=="github.com")return;let r=e.split("/");if(r.length>=2&&r[0]&&r[1])return`${r[0]}/${r[1]}`}a(mJn,"extractGitHubRepo");function gJn(t,e,r){return Ndr(`github:${t.toLowerCase()}/${e.toLowerCase()}`,r)}a(gJn,"getGitHubCanonicalId");function AJn(t,e,r){if(t){let[n,o]=t.split("/");return gJn(n,o,e)}return Ndr(r,e)}a(AJn,"gitCanonicalId");function Ndr(t,e){return e?`${t}#${encodeURIComponent(e)}`:t}a(Ndr,"appendRefSuffix");p();p();p();p();function yJn(t,e){return/^~(?=$|[/\\])/.test(t)?e+t.slice(1):t}a(yJn,"untildify");var kHs=200;function elt(t,e){return Mdr(t,e,new Set,0)}a(elt,"cloneAndChange");function Mdr(t,e,r,n){if(t==null)return t;let o=e(t);if(o!==void 0)return o;if(n>=kHs)throw new Error("Cannot clone: structure nested too deeply");if(Array.isArray(t))return t.map(s=>Mdr(s,e,r,n+1));if(typeof t=="object"){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let s={};for(let c of Object.keys(t))s[c]=Mdr(t[c],e,r,n+1);return r.delete(t),s}return t}a(Mdr,"cloneAndChangeInner");function HDe(t,e=!1){if(!t||typeof t!="object")return;let r={};for(let[n,o]of Object.entries(t))typeof o=="string"?r[n]=o:e&&typeof o=="number"&&(r[n]=String(o));return Object.keys(r).length>0?r:void 0}a(HDe,"toStringRecord");var tlt=de(require("path"));var DHs=/[\s&|<>()^;!`"'$]/;function NHs(t){return t.replace(/(\\*)("|$)/g,(e,r,n)=>r+r+(n?'\\"':""))}a(NHs,"escapeWindowsDoubleQuoted");function MHs(t,e,r){if(!t.includes(r))return t;if(!DHs.test(e))return t.replaceAll(r,e);let n=process.platform==="win32",o=new RegExp(`(["']?)${Toe(r)}([\\w./\\\\~:@-]*)`,"g");return t.replace(o,(s,c,l)=>{let u=e+l;if(c==="'")return c+u.replace(/'/g,"'\\''");let d=n?NHs(u):u.replace(/([\\"$`])/g,"\\$&");return c?c+d:'"'+d+'"'})}a(MHs,"shellQuotePluginRootInCommand");var OHs={SessionStart:"SessionStart",SessionEnd:"SessionEnd",UserPromptSubmit:"UserPromptSubmit",PreToolUse:"PreToolUse",PostToolUse:"PostToolUse",PreCompact:"PreCompact",SubagentStart:"SubagentStart",SubagentStop:"SubagentStop",Stop:"Stop",ErrorOccurred:"ErrorOccurred",sessionStart:"SessionStart",sessionEnd:"SessionEnd",userPromptSubmitted:"UserPromptSubmit",preToolUse:"PreToolUse",postToolUse:"PostToolUse",agentStop:"Stop",subagentStop:"SubagentStop",errorOccurred:"ErrorOccurred"};function LHs(t){if(t.type!==void 0&&t.type!=="command")return;let e=a(f=>typeof f=="string"&&f.length>0?f:void 0,"str"),r=e(t.command),n=e(t.bash),o=e(t.powershell),s=e(t.windows)??o,c=e(t.linux)??n,l=e(t.osx)??n;if(!r&&!s&&!c&&!l)return;let u=typeof t.timeout=="number"?t.timeout:typeof t.timeoutSec=="number"?t.timeoutSec:void 0,d=HDe(t.env,!0);return{...r&&{command:r},...s&&{windows:s},...c&&{linux:c},...l&&{osx:l},...d&&{env:d},...u!==void 0&&{timeout:u}}}a(LHs,"normalizeHookCommand");function EJn(t,e){let r=LHs(t);if(!r)return;let n,o=typeof t.cwd=="string"?t.cwd:void 0;if(o){let s=yJn(o,e);n=tlt.isAbsolute(s)?tlt.normalize(s):s}return{...r,...n!==void 0&&{cwd:n}}}a(EJn,"resolveHookCommand");function BHs(t,e){if(!t||typeof t!="object")return[];let r=t,n=[],o=r.hooks;if(Array.isArray(o)){for(let s of o)if(s&&typeof s=="object"){let c=EJn(s,e);c&&n.push(c)}}else{let s=EJn(r,e);s&&n.push(s)}return n}a(BHs,"extractHookCommands");function Ldr(t,e,r){if(!e||typeof e!="object")return[];let n=e;if(n.disableAllHooks===!0)return[];let o=n.hooks;if(!o||typeof o!="object")return[];let s=o,c=[];for(let l of Object.keys(s)){let u=OHs[l];if(!u)continue;let d=s[l];if(!Array.isArray(d))continue;let f=[];for(let h of d)f.push(...BHs(h,r));f.length>0&&c.push({type:u,hooks:f,uri:t,originalId:l})}return c}a(Ldr,"parseHooksJson");function Odr(t,e,r){if(Array.isArray(t)){let n=t;for(let o=0;o{for(let d of["command","windows","linux","osx"]){let f=u[d];typeof f=="string"&&(u[d]=MHs(f,c,o))}(!u.env||typeof u.env!="object")&&(u.env={}),u.env[s]=c},"mutateHookCommand");try{let u=elt(e,()=>{});for(let d of Object.values(u.hooks??{}))if(Array.isArray(d))for(let f of d){if(!f||typeof f!="object")continue;let h=f;if(Array.isArray(h.hooks))for(let m of h.hooks)m&&typeof m=="object"&&l(m);else l(h)}return Odr(u,o,c),Ldr(t,u,n)}catch{return[]}}a(Bdr,"interpolateHookPluginRoot");p();var Ydr=require("fs");zdr();function YDe(t){try{return Wdr(t)}catch{return}}a(YDe,"parseJsonc");async function Nhe(t,e){let r=await MT(()=>Ydr.promises.stat(t),void 0);if(!r||!r.isFile()||e!==void 0&&r.size>e)return;let n=await MT(()=>Ydr.promises.readFile(t,"utf8"),void 0);if(n!==void 0)return YDe(n)}a(Nhe,"readJsoncFile");var IH=de(require("path"));var iGs={format:0,manifestPath:"plugin.json",altManifestPaths:[".github/plugin/plugin.json"],hookConfigPath:"hooks.json",altHookConfigPaths:["hooks/hooks.json"],pluginRootToken:void 0,pluginRootEnvVar:void 0,parseHooks(t,e,r,n){return Ldr(t,e,n)}},oGs={format:1,manifestPath:".claude-plugin/plugin.json",hookConfigPath:"hooks/hooks.json",pluginRootToken:"${CLAUDE_PLUGIN_ROOT}",pluginRootEnvVar:"CLAUDE_PLUGIN_ROOT",parseHooks(t,e,r,n){return Bdr(t,e,r,n,"${CLAUDE_PLUGIN_ROOT}","CLAUDE_PLUGIN_ROOT")}},sGs={format:2,manifestPath:".plugin/plugin.json",hookConfigPath:"hooks/hooks.json",pluginRootToken:"${PLUGIN_ROOT}",pluginRootEnvVar:"PLUGIN_ROOT",parseHooks(t,e,r,n){return Bdr(t,e,r,n,"${PLUGIN_ROOT}","PLUGIN_ROOT")}};async function PJn(t){return await Wd(IH.join(t,".plugin","plugin.json"))?sGs:t.split(/[/\\]/).includes(".claude")||await Wd(IH.join(t,".claude-plugin","plugin.json"))?oGs:iGs}a(PJn,"detectPluginFormat");async function DJn(t,e,r){let n=await LX(r);for(let o of[e.manifestPath,...e.altManifestPaths??[]]){let s=IH.join(t,o);if(!await eR(n,s))continue;let c=await Jct(s),l=c===void 0?void 0:YDe(c);if(l&&typeof l=="object"&&!Array.isArray(l))return{manifest:l,manifestUri:s}}}a(DJn,"readPluginManifest");function NJn(t){return[t.hookConfigPath,...t.altHookConfigPaths??[]]}a(NJn,"defaultHookConfigPaths");var Kdr={paths:[],exclusive:!1};function Mhe(t){if(t==null)return Kdr;if(typeof t=="string"){let e=t.trim();return e?{paths:[e],exclusive:!1}:Kdr}if(Array.isArray(t))return{paths:kJn(t),exclusive:!1};if(typeof t=="object"){let e=t;if(Array.isArray(e.paths))return{paths:kJn(e.paths),exclusive:e.exclusive===!0}}return Kdr}a(Mhe,"parseComponentPathConfig");function kJn(t){return t.filter(e=>typeof e=="string").map(e=>e.trim()).filter(e=>e.length>0)}a(kJn,"cleanPaths");function alt(t,e,r,n){let o=n&&wE(n,t)?n:t,s=[];r.exclusive||s.push(IH.join(t,e));for(let c of r.paths){let l=IH.normalize(IH.join(t,c));wE(o,l)&&s.push(l)}return s}a(alt,"resolveComponentDirs");p();p();var FT=de(require("path"));var aGs=new dO,clt=16,MJn=".md",cGs=[".instructions.md",".mdc",".md"];async function lGs(t){let e=FT.basename(t).replace(/(\.agent)?\.md$/i,"");return OJn(t,e)}a(lGs,"parseAgentFile");async function uGs(t){return OJn(t,FT.basename(FT.dirname(t)))}a(uGs,"parseSkillFile");async function OJn(t,e){let r=await Jct(t);if(r===void 0)return{name:e};try{let n=aGs.parse(t,r).header,o=n?.name?.trim()||e,s=n?.description?.trim();return{name:o,...s&&{description:s}}}catch{return{name:e}}}a(OJn,"readNameDescription");async function LJn(t,e,r){let n=await LX(r),s=(await vx(e,clt,async d=>{if(!await eR(n,d))return[];let f=FT.join(d,"SKILL.md");if(await Wd(f)&&await eR(n,f))return[f];let h=(await QDe(d)).filter(g=>g.isDirectory);return h.sort((g,A)=>g.path.localeCompare(A.path)),(await vx(h,clt,async g=>{if(g.isSymlink&&!await eR(n,g.path))return;let A=FT.join(g.path,"SKILL.md");if(!(!await Wd(A)||!await eR(n,A)))return A})).filter(g=>g!==void 0)})).flat();if(s.length===0){let d=FT.join(t,"SKILL.md");await Wd(d)&&await eR(n,d)&&s.push(d)}let c=await vx(s,clt,async d=>({uri:d,...await uGs(d)})),l=new Set,u=[];for(let{uri:d,name:f,description:h}of c)l.has(d)||(l.add(d),u.push({uri:d,name:f,...h&&{description:h}}));return u.sort((d,f)=>d.name.localeCompare(f.name)),u}a(LJn,"readSkills");async function BJn(t,e,r){let n=await LX(r),o=new Set,s=[],c=a(l=>{let u=e(l);u&&!o.has(u)&&(o.add(u),s.push({uri:l,name:u}))},"addItem");for(let l of t){if(!await eR(n,l))continue;let u=await Pdr(l);if(!u)continue;if(u.isFile){c(l);continue}if(!u.isDirectory)continue;let d=await QDe(l);d.sort((f,h)=>f.path.localeCompare(h.path));for(let f of d)f.isFile&&(f.isSymlink&&!await eR(n,f.path)||c(f.path))}return s.sort((l,u)=>l.name.localeCompare(u.name)),s}a(BJn,"scanComponentFiles");function dGs(t){return FT.extname(t).toLowerCase()===MJn?FT.basename(t).slice(0,-MJn.length):void 0}a(dGs,"getMarkdownComponentName");function Jdr(t,e){return BJn(t,dGs,e)}a(Jdr,"readMarkdownComponents");async function FJn(t,e){let r=await Jdr(t,e);if(r.length===0)return r;let n=await vx(r,clt,async c=>{let{name:l,description:u}=await lGs(c.uri);return{uri:c.uri,name:l||c.name,...u&&{description:u}}}),o=new Set,s=n.filter(c=>o.has(c.name)?!1:(o.add(c.name),!0));return s.sort((c,l)=>c.name.localeCompare(l.name)),s}a(FJn,"readAgentComponents");function fGs(t){let e=FT.basename(t),r=e.toLowerCase(),n=cGs.find(o=>r.endsWith(o));return n?e.slice(0,-n.length):void 0}a(fGs,"getInstructionFileName");function UJn(t,e){return BJn(t,fGs,e)}a(UJn,"readInstructionComponents");p();function pGs(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t;if(Object.hasOwn(e,"mcpServers")){let r=e.mcpServers;return!r||typeof r!="object"||Array.isArray(r)?void 0:r}return e}a(pGs,"resolveMcpServersMap");function hGs(t){if(!t||typeof t!="object")return;let e=t,r=a(h=>typeof h=="string"&&h.trim()?h.trim():void 0,"str"),n=r(e.type),o=r(e.command),s=r(e.url),c=Array.isArray(e.args)?e.args.filter(h=>typeof h=="string"):void 0,l=HDe(e.env,!0),u=r(e.envFile),d=r(e.cwd),f=HDe(e.headers);if(n!=="ws"){if(n==="stdio"||!n&&o)return o?{type:"stdio",command:o,...c&&{args:c},...l&&{env:l},...d!==void 0&&{cwd:d},...u!==void 0&&{envFile:u}}:void 0;if(n==="http"||n==="sse"||!n&&s)return s?{type:"http",url:s,...f&&{headers:f}}:void 0}}a(hGs,"normalizeMcpServerConfiguration");function mGs(t,e,r,n){let o=a(l=>l.replaceAll(r,()=>e),"replace"),s=t.configuration,c;if(s.type==="stdio"){let l={};for(let[u,d]of Object.entries(s.env??{}))l[u]=o(d);l[n]=e,c={type:"stdio",command:o(s.command),...s.args&&{args:s.args.map(o)},env:l,...s.cwd!==void 0&&{cwd:o(s.cwd)},...s.envFile!==void 0&&{envFile:o(s.envFile)}}}else c={type:"http",url:o(s.url),...s.headers&&{headers:Object.fromEntries(Object.entries(s.headers).map(([l,u])=>[l,o(u)]))}};return{name:t.name,configuration:c,uri:t.uri}}a(mGs,"interpolateMcpPluginRoot");var gGs=/\$\{(?![A-Za-z]+:)([A-Z_][A-Z0-9_]*)\}/g;function AGs(t){return elt(t,e=>{if(typeof e=="string"){let r=e.replace(gGs,"${env:$1}");return r!==e?r:void 0}})}a(AGs,"convertBareEnvVarsToVsCodeSyntax");function Zdr(t,e,r,n){let o=pGs(e);if(!o)return[];let s=[];for(let[c,l]of Object.entries(o)){let u=hGs(l);if(!u)continue;let d={name:c,configuration:u,uri:t};n.pluginRootToken&&n.pluginRootEnvVar&&(d=mGs(d,r,n.pluginRootToken,n.pluginRootEnvVar)),d=AGs(d),s.push(d)}return s}a(Zdr,"parseMcpServerDefinitionMap");p();var UX=require("fs"),Rb=de(require("path"));var efr=".copilot",tfr="installed-plugins",Mkf=Rb.join(efr,tfr),QJn="config.json",llt=5e3,ult=16,rfr=5*1024*1024;async function Ohe(t){return MT(()=>t().then(e=>({ok:!0,value:e}),e=>({ok:!1,code:e.code??"error"})),{ok:!1,code:"timeout"})}a(Ohe,"boundedFsResult");function Xdr(t){return t==="ENOENT"||t==="ENOTDIR"}a(Xdr,"isAbsentCode");async function qJn(t){let e=await Ohe(()=>UX.promises.stat(Rb.dirname(t)));return e.ok&&e.value.isDirectory()}a(qJn,"parentDirSurvives");async function nfr(t){let e=await Ohe(()=>UX.promises.stat(t));return e.ok||e.code!=="ENOENT"?!1:qJn(t)}a(nfr,"isDefinitivelyGone");var yGs={name:"marketplace",discover:_Gs},EGs={name:"copilotCli",discover:vGs,changeSignal:{dir:a(t=>t.copilotHome,"dir"),files:new Set([QJn]),createDir:!1,listing:a(t=>CGs(t.copilotHome),"listing")}},Lhe=[yGs,EGs];async function jJn(t){let e=await Promise.all(Lhe.map(o=>o.discover(t))),r=new Set,n=[];for(let o of e)for(let s of o){let c=lg(s.fsPath);r.has(c)||(r.add(c),n.push(s))}return n}a(jJn,"discoverPlugins");async function _Gs(t){return(await vx(t.installed,ult,async r=>{let n;if(Rb.isAbsolute(r.pluginUri))n=r.pluginUri;else{let u=Rb.resolve(t.sharedContentDir,r.pluginUri);if(!wE(t.sharedContentDir,u))return;n=u}let o=await Ohe(()=>UX.promises.stat(n));if(o.ok){if(!o.value.isDirectory())return}else if(o.code==="ENOENT"&&await qJn(n))return;let s=LT(r.marketplace),c;if(s)try{c=t.getRepositoryUri(s)}catch{c=void 0}let l=await t.resolveMarketplace(r);return{uri:r.pluginUri,fsPath:n,displayName:r.name,readOnly:ifr(n,t.copilotHome),...l&&{fromMarketplace:l},...c!==void 0&&{repositoryBoundary:c}}})).filter(r=>r!==void 0)}a(_Gs,"discoverMarketplace");async function vGs(t){return(await HJn(t.copilotHome)??[]).map(r=>({uri:r.fsPath,fsPath:r.fsPath,readOnly:!0,...r.displayName!==void 0&&{displayName:r.displayName}}))}a(vGs,"discoverCopilotCli");async function HJn(t){return o3(bGs(t),llt,void 0)}a(HJn,"listCopilotCliInstalls");async function CGs(t){return(await HJn(t))?.map(e=>e.fsPath)}a(CGs,"listCopilotCliPluginDirs");async function bGs(t){let e=Rb.join(t,tfr),[r,n]=await Promise.all([SGs(t),TGs(e)]);if(r===void 0&&n===void 0)return;let o=[];for(let u of r??[]){let f=(u.cachePath!==void 0&&Rb.isAbsolute(u.cachePath)?u.cachePath:void 0)??(u.name!==void 0&&u.marketplace!==void 0?Rb.join(e,u.marketplace,u.name):void 0);f!==void 0&&o.push({fsPath:f,...u.name!==void 0&&{displayName:u.name}})}let s=await vx(o,ult,async u=>await nfr(u.fsPath)?void 0:u),c=[],l=new Set;for(let u of s){if(u===void 0)continue;let d=lg(u.fsPath);l.has(d)||(l.add(d),c.push({fsPath:u.fsPath,...u.displayName!==void 0&&{displayName:u.displayName}}))}for(let u of n??[]){let d=lg(u);l.has(d)||(l.add(d),c.push({fsPath:u}))}return c}a(bGs,"collectCopilotCliInstalls");async function SGs(t){let e=Rb.join(t,QJn),r=await Ohe(()=>UX.promises.stat(e));if(!r.ok)return Xdr(r.code)?[]:void 0;if(!r.value.isFile()||r.value.size>rfr)return;let n=await Ohe(()=>UX.promises.readFile(e,"utf8"));if(!n.ok)return Xdr(n.code)?[]:void 0;let o=n.value,s;try{s=JSON.parse(o)}catch{return}let c=s?.installedPlugins;if(!Array.isArray(c))return[];let l=[];for(let u of c){if(u===null||typeof u!="object")continue;let d=u;l.push({name:typeof d.name=="string"?d.name:void 0,marketplace:typeof d.marketplace=="string"?d.marketplace:void 0,cachePath:typeof d.cache_path=="string"?d.cache_path:void 0})}return l}a(SGs,"readCliInstalledPlugins");async function TGs(t){let e=await Ohe(()=>UX.promises.readdir(t,{withFileTypes:!0}));if(!e.ok)return Xdr(e.code)?[]:void 0;let r=e.value,n=[];for(let o of r)if(o.isDirectory())for(let s of await QDe(Rb.join(t,o.name)))s.isDirectory&&n.push(s.path);return n}a(TGs,"scanCopilotCliPluginDirs");function ifr(t,e){return wE(Rb.join(e,tfr),t)}a(ifr,"isCopilotCliPath");var ofr=de(require("path"));var IGs="commands",xGs="skills",wGs="agents",RGs="rules",kGs=".mcp.json";async function $Jn(t,e,r){let n=r.repositoryBoundary,o=n&&wE(n,t)?n:t,s=await LX(o),c=await DJn(t,e,s),l=c?.manifest,u=c?.manifestUri??ofr.join(t,e.manifestPath),d=a((v,b)=>alt(t,b,Mhe(l?.[v]),n),"dirsFor"),[f,h,m,g,A,y]=await Promise.all([Jdr(d("commands",IGs),s),LJn(t,d("skills",xGs),s),FJn(d("agents",wGs),s),UJn(d("rules",RGs),s),PGs(t,l,u,e,n,s,r),NGs(t,l,u,e,n,s)]),E=l?.name,_=typeof E=="string"&&E.trim()?E.trim():void 0;return{hooks:A,commands:f,skills:h,agents:m,instructions:g,mcpServerDefinitions:y,..._&&{manifestName:_}}}a($Jn,"readPluginContributions");function dlt(t){return!!t&&typeof t=="object"&&!Array.isArray(t)&&!Object.hasOwn(t,"paths")}a(dlt,"isEmbeddedSection");async function VJn(t,e){if(await eR(e,t))return Nhe(t,rfr)}a(VJn,"readJsoncWithinBoundary");async function PGs(t,e,r,n,o,s,c){let l=e?.hooks;if(dlt(l)){let h=Object.hasOwn(l,"hooks")||Object.hasOwn(l,"disableAllHooks")?l:{hooks:l},m=GJn(n,r,h,t,c);if(m.length>0)return m}let u=dlt(l)?Mhe(void 0):Mhe(l),d=DGs(t,n,u,o);for(let f of d){let h=await VJn(f,s);if(h)return GJn(n,f,h,t,c)}return[]}a(PGs,"readHooks");function GJn(t,e,r,n,o){try{return t.parseHooks(e,r,n,o.userHome)}catch{return[]}}a(GJn,"parseHooksSafely");function DGs(t,e,r,n){let o=[];if(!r.exclusive)for(let s of NJn(e))o.push(ofr.join(t,s));for(let s of alt(t,"",{paths:r.paths,exclusive:!0},n))o.includes(s)||o.push(s);return o}a(DGs,"resolveHookConfigPaths");async function NGs(t,e,r,n,o,s){let c=new Map,l=a(d=>{for(let f of d)c.has(f.name)||c.set(f.name,f)},"add"),u=e?.mcpServers;if(dlt(u)&&l(Zdr(r,{mcpServers:u},t,n)),c.size===0){let d=dlt(u)?Mhe(void 0):Mhe(u),f=alt(t,kGs,d,o);for(let h of f){let m=await VJn(h,s);m&&l(Zdr(h,m,t,n))}}return[...c.values()].sort((d,f)=>d.name.localeCompare(f.name))}a(NGs,"readMcpServers");p();function KDe(t){return t.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\/\/)[^/@\s]*@/g,"$1")}a(KDe,"redactUrlCredentials");var xH=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredPluginError"}static{a(this,"StructuredPluginError")}},flt=class extends xH{static{a(this,"PluginSourceNotSupportedError")}constructor(e){let r={kind:"pluginSourceNotSupported",sourceKind:e};super(`Plugin source kind '${e}' is not supported in this environment`,r),this.name="PluginSourceNotSupportedError"}},Bhe=class extends xH{static{a(this,"PluginCloneError")}constructor(e,r){let n=KDe(e),o=KDe(r instanceof Error?r.message:String(r)),s={kind:"pluginCloneFailed",cloneUrl:n,cause:o};super(`Failed to clone plugin source '${n}': ${o}`,s),this.name="PluginCloneError"}},Fhe=class extends xH{static{a(this,"LocalMarketplaceMissingError")}constructor(e){let r={kind:"localMarketplaceMissing",repositoryPath:e};super(`Local marketplace repository does not exist: ${e}`,r),this.name="LocalMarketplaceMissingError"}},Uhe=class extends xH{static{a(this,"InvalidPluginSourceError")}constructor(e,r="plugin source"){let n=KDe(e),o={kind:"invalidPluginSource",source:n};super(`Invalid ${r}: ${n}`,o),this.name="InvalidPluginSourceError"}};p();var WJn=require("fs"),sfr=de(require("path"));var MGs=new Set(["installed.json","enablement.json"]);function afr(t){return(e,r)=>{let n=lg(e.path);return sfr.posix.dirname(n)===r&&t.has(sfr.posix.basename(n))}}a(afr,"matchNamedFiles");var zJn=afr(MGs),JDe=class{constructor(e,r,n,o,s=50){this.ctx=e;this.dir=r;this.debounceMs=s;this.logger=new fe("PluginFileWatcher");this._onDidChange=new ep;this.onDidChange=this._onDidChange.event;this._disposed=!1;this._dirKey=lg(r),this._recursive=n.recursive??!1,this._createDir=n.createDir??!0,this._matches=n.matches,this._watcher=o??Bze(e),this._ownsWatcher=o===void 0}static{a(this,"PluginFileWatcher")}async start(){if(!this._disposed)try{if(this._createDir)await WJn.promises.mkdir(this.dir,{recursive:!0,mode:448});else if(!await Wd(this.dir))return;if(this._disposed)return;this._changeSubscription=this._watcher.onDidChange(e=>this.onEvents(e)),this._watchHandle=this._watcher.watch({path:this.dir,recursive:this._recursive})}catch(e){this.logger.warn(this.ctx,"failed to start watching plugin dir",{dir:this.dir,err:String(e)})}}onEvents(e){this._disposed||e.some(r=>this._matches(r,this._dirKey))&&this.scheduleFire()}scheduleFire(){this._debounceTimer===void 0&&(this._debounceTimer=setTimeout(()=>{this._debounceTimer=void 0,this._disposed||this._onDidChange.fire()},this.debounceMs))}dispose(){this._disposed||(this._disposed=!0,this._debounceTimer!==void 0&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0),this._watchHandle?.dispose(),this._changeSubscription?.dispose(),this._ownsWatcher&&this._watcher.dispose(),this._onDidChange.dispose())}};p();var YJn=require("fs"),KJn=de(require("path"));var OGs=new fe("plugins.git"),LGs=12e4,plt=class{constructor(e){this.ctx=e;this.gitInstances=new Map}static{a(this,"PluginGitService")}async cloneRepository(e,r,n){try{let o=KJn.dirname(r);await YJn.promises.mkdir(o,{recursive:!0,mode:448}),await(await this.instanceFor(o)).clone(e,r)}catch(o){throw OGs.warn(this.ctx,`clone failed for ${KDe(e)}`,o),new Bhe(e,o)}}async checkout(e,r,n){await(await this.instanceFor(e)).checkout(n?["--detach",r]:[r])}async pull(e){if(!await this.isOnBranch(e))return!1;let r=await this.instanceFor(e),n=await this.revParse(e,"HEAD").catch(()=>{});await r.pull();let o=await this.revParse(e,"HEAD").catch(()=>{});return n!==o}async isOnBranch(e){let n=(await(await this.instanceFor(e)).raw(["rev-parse","--abbrev-ref","HEAD"])).trim();return n!==""&&n!=="HEAD"}async revParse(e,r){return(await(await this.instanceFor(e)).revparse([r])).trim()}async fetch(e){await(await this.instanceFor(e)).fetch()}async revListCount(e,r,n){let s=(await(await this.instanceFor(e)).raw(["rev-list","--count",`${r}..${n}`])).trim(),c=Number.parseInt(s,10);return Number.isFinite(c)?c:0}async instanceFor(e){let r=this.gitInstances.get(e);return r||(this._binary===void 0&&(this._binary=(await lO()).path),r=Gue({baseDir:e,binary:this._binary,unsafe:{allowUnsafeCustomBinary:!0},timeout:{block:LGs}}),this.gitInstances.set(e,r)),r}forget(e){this.gitInstances.delete(e)}dispose(){this.gitInstances.clear()}};p();var hlt=class{constructor(e,r){this.repository=e;this.marketplace=r}static{a(this,"PluginInstallService")}async acquirePlugin(e){let r=await this.repository.ensurePluginSource(e);if(!await Wd(r))throw new Bhe(e.marketplaceReference.cloneUrl,"plugin content not found after acquisition");return r}async resolveFromSource(e){let r=await this.repository.ensureRepository(e),n=await this.marketplace.readPluginsFromDirectory(r,e);if(n.length>0)return{reference:e,plugins:n,isSinglePluginRepo:!1};let o=await this.marketplace.readSinglePluginManifest(r,e);return o?{reference:e,plugins:[o],isSinglePluginRepo:!0}:{reference:e,plugins:[],isSinglePluginRepo:!1}}async resolveInstalled(e){let r=LT(e.marketplace);if(!r)return;let n=this.repository.getRepositoryUri(r);if(await Wd(n)){let s=(await this.marketplace.readPluginsFromDirectory(n,r)).find(l=>l.name===e.name);if(s)return s;let c=await this.marketplace.readSinglePluginManifest(n,r);if(c)return c}if(r.kind==="githubShorthand"&&r.githubRepo)return JJn({kind:"github",repo:r.githubRepo},r,e.name);if(r.kind==="gitUri")return JJn({kind:"url",url:r.cloneUrl},r,e.name)}};function JJn(t,e,r){return{name:r,description:"",version:"",sourceDescriptor:t,marketplace:e.displayLabel,marketplaceReference:e,marketplaceType:"openPlugin"}}a(JJn,"synthesizePlugin");p();p();var BGs=new fe("plugins.catalog");function cfr(t,e,r,n){return Array.isArray(t.plugins)?t.plugins.filter(s=>s!=null&&typeof s.name=="string"&&s.name.length>0).flatMap(s=>{let c=s.name,l=FGs(s.source,t.metadata?.pluginRoot,c,n);return l?[{name:c,description:typeof s.description=="string"?s.description:"",version:typeof s.version=="string"?s.version:"",sourceDescriptor:l,marketplace:e.displayLabel,marketplaceReference:e,marketplaceType:r}]:[]}):[]}a(cfr,"parseMarketplaceCatalog");function FGs(t,e,r,n){let o=a(s=>{n&&BGs.warn(n,`skipping plugin '${r}': ${s}`)},"skip");if(t==null||typeof t=="string"){let c=UGs(typeof e=="string"?e:void 0,t??"");return c===void 0?o("could not resolve relative source path"):{kind:"relativePath",path:c}}if(typeof t!="object"||typeof t.source!="string")return o("source object is missing a 'source' discriminant");switch(t.source){case"github":return typeof t.repo!="string"||!t.repo?o("github source is missing required 'repo' field"):qGs(t.repo)?!Qhe(t.ref)||!Qhe(t.path)?o("github source 'ref'/'path' must be strings when provided"):XJn(t.sha)?{kind:"github",repo:t.repo,ref:t.ref,sha:t.sha,path:t.path}:o("github source 'sha' must be a 40-character commit hash when provided"):o("github source 'repo' must be in 'owner/repo' format");case"url":case"git-subdir":return typeof t.url!="string"||!t.url?o(`${t.source} source is missing required 'url' field`):t.source==="url"&&!t.url.toLowerCase().endsWith(".git")?o("url source must end with '.git'"):Qhe(t.ref)?XJn(t.sha)?t.source==="git-subdir"&&(typeof t.path!="string"||!t.path)?o("git-subdir source is missing required 'path' field"):t.source==="url"&&!Qhe(t.path)?o("url source 'path' must be a string when provided"):{kind:"url",url:t.url,ref:t.ref,sha:t.sha,path:t.path}:o(`${t.source} source 'sha' must be a 40-character commit hash when provided`):o(`${t.source} source 'ref' must be a string when provided`);case"npm":case"pip":return typeof t.package!="string"||!t.package?o(`${t.source} source is missing required 'package' field`):!Qhe(t.version)||!Qhe(t.registry)?o(`${t.source} source 'version'/'registry' must be strings when provided`):{kind:t.source==="npm"?"npm":"pip",package:t.package,version:t.version,registry:t.registry};default:return o(`unknown source kind '${t.source}'`)}}a(FGs,"parsePluginSource");function UGs(t,e){let r=ZJn(t??""),n=ZJn(e);return r&&(n===r||n.startsWith(`${r}/`))?n:QGs(`/${r}/${n}`).replace(/^\/+/,"")}a(UGs,"resolvePluginSource");function ZJn(t){return t.trim().replace(/\\/g,"/").replace(/^\.?\/+/,"").replace(/\/+$/g,"")}a(ZJn,"normalizeMarketplacePath");function QGs(t){let e=[];for(let r of t.split("/"))r===""||r==="."||(r===".."?e.pop():e.push(r));return`/${e.join("/")}`}a(QGs,"posixNormalize");function Qhe(t){return t===void 0||typeof t=="string"}a(Qhe,"isOptionalString");function XJn(t){return t===void 0||typeof t=="string"&&/^[0-9a-fA-F]{40}$/.test(t)}a(XJn,"isOptionalGitSha");function qGs(t){return/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(t)}a(qGs,"isValidGitHubRepo");var XDe=de(require("path"));var qhe=new fe("plugins.marketplace"),jGs=480*60*1e3,HGs=3e4,GGs=15e4,eZn=[{type:"openPlugin",path:"marketplace.json"},{type:"openPlugin",path:".plugin/marketplace.json"},{type:"copilot",path:".github/plugin/marketplace.json"},{type:"claude",path:".claude-plugin/marketplace.json"}],$Gs=[{type:"openPlugin",path:".plugin/plugin.json"},{type:"claude",path:".claude-plugin/plugin.json"},{type:"copilot",path:"plugin.json"}],mlt=class{constructor(e,r){this.ctx=e;this.repository=r;this.githubCatalogCache=new Map}static{a(this,"PluginMarketplaceService")}async fetchMarketplacePlugins(e,r){let n=await Promise.all(e.map(o=>this.fetchOneBounded(o,r)));return{plugins:n.flatMap(o=>o.plugins),errors:n.flatMap(o=>o.error?[o.error]:[])}}fetchOneBounded(e,r){let n=e.kind==="githubShorthand"&&e.githubRepo?this.fetchFromGitHubRepo(e,e.githubRepo,r):this.fetchFromClonedRepo(e,r);return this.withReferenceDeadline(n,e,r)}withReferenceDeadline(e,r,n){return new Promise(o=>{let s=!1,c=a(d=>{s||(s=!0,clearTimeout(l),u?.dispose(),o(d))},"finish"),l=setTimeout(()=>{qhe.debug(this.ctx,"marketplace fetch exceeded deadline",{reference:r.rawValue}),c({plugins:[],error:WGs(r)})},GGs);l.unref?.();let u=n?.onCancellationRequested(()=>c({plugins:[]}));n?.isCancellationRequested&&c({plugins:[]}),e.then(c,d=>c({plugins:[],error:tZn(r,d)}))})}async readPluginsFromDirectory(e,r,n){return this.readPluginsFromDefinitions(r,async o=>{if(!n?.isCancellationRequested)return Nhe(XDe.join(e,o))},e)}async readAllPluginsFromDirectory(e,r,n){let o=new Map;for(let s of eZn){if(n?.isCancellationRequested)return[];let c=await Nhe(XDe.join(e,s.path));if(!(!c?.plugins||!Array.isArray(c.plugins)))for(let l of cfr(c,r,s.type,this.ctx))o.has(l.name)||o.set(l.name,rZn(l,e))}return[...o.values()]}async readSinglePluginManifest(e,r){if(!(r.kind!=="githubShorthand"&&r.kind!=="gitUri")){for(let n of $Gs){let o=await Nhe(XDe.join(e,n.path));if(!o||typeof o!="object"||Array.isArray(o))continue;let s=r.kind==="githubShorthand"?{kind:"github",repo:r.githubRepo}:{kind:"url",url:r.cloneUrl};return{name:typeof o.name=="string"&&o.name?o.name:r.displayLabel,description:typeof o.description=="string"?o.description:"",version:typeof o.version=="string"?o.version:"",sourceDescriptor:s,marketplace:r.displayLabel,marketplaceReference:r,marketplaceType:n.type,readmeUri:r.githubRepo?oZn(r.githubRepo,""):iZn(e,"")}}qhe.debug(this.ctx,"no single-plugin manifest found",{reference:r.rawValue})}}clearCache(){this.githubCatalogCache.clear()}async fetchFromGitHubRepo(e,r,n){let o=this.getCachedCatalog(e.canonicalId);if(o)return{plugins:o.map(d=>zGs(d,e))};let s=!0,c,l=encodeURIComponent(e.ref??"main"),u=await this.readPluginsFromDefinitions(e,async d=>{if(n?.isCancellationRequested)return;let f=`https://raw.githubusercontent.com/${r}/${l}/${d}`,h=VGs(n);try{let m=await this.ctx.get(tr).fetch(f,{method:"GET",timeout:HGs,signal:h.signal});if(m.status!==200){m.status>=500&&(c=m.status),s&&=m.status>=400&&m.status<500;return}return YDe(await m.text())}catch(m){qhe.debug(this.ctx,"raw marketplace fetch failed",{url:f,err:String(m)});return}finally{h.dispose()}});return u.length>0?(this.setCachedCatalog(e.canonicalId,u),{plugins:u}):s?(qhe.debug(this.ctx,"repo may be private; falling back to clone",{repo:r}),this.fetchFromClonedRepo(e,n)):c!==void 0?{plugins:[],error:{reference:e.displayLabel,canonicalId:e.canonicalId,kind:"unavailable",status:c,message:`Marketplace '${e.displayLabel}' is temporarily unavailable (HTTP ${c})`}}:{plugins:[]}}async fetchFromClonedRepo(e,r){if(r?.isCancellationRequested)return{plugins:[]};let n;try{n=await this.repository.ensureRepository(e)}catch(o){return qhe.debug(this.ctx,"failed to prepare marketplace repository",{reference:e.rawValue,err:String(o)}),{plugins:[],error:tZn(e,o)}}return{plugins:await this.readPluginsFromDirectory(n,e,r)}}async readPluginsFromDefinitions(e,r,n){for(let o of eZn){let s=await r(o.path);if(!(!s?.plugins||!Array.isArray(s.plugins)))return cfr(s,e,o.type,this.ctx).map(c=>rZn(c,n))}return qhe.debug(this.ctx,"no marketplace catalog found",{reference:e.rawValue}),[]}now(){return this.ctx.get(Cx).now().getTime()}getCachedCatalog(e){let r=this.githubCatalogCache.get(e);if(r){if(r.expiresAt<=this.now()){this.githubCatalogCache.delete(e);return}return r.plugins}}setCachedCatalog(e,r){this.githubCatalogCache.set(e,{plugins:r,expiresAt:this.now()+jGs})}};function VGs(t){let e={dispose(){}};if(!t)return e;let r=new AbortController;if(t.isCancellationRequested)return r.abort(),{signal:r.signal,...e};let n=t.onCancellationRequested(()=>r.abort());return{signal:r.signal,dispose:a(()=>n.dispose(),"dispose")}}a(VGs,"abortSignalFor");function WGs(t){return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:"unavailable",message:`Marketplace '${t.displayLabel}' did not respond in time`}}a(WGs,"deadlineError");function tZn(t,e){let r=e instanceof Error?e.message:String(e),n=e instanceof Fhe?"localMissing":"cloneFailed";return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:n,message:r}}a(tZn,"toFetchError");function zGs(t,e){return{...t,marketplace:e.displayLabel,marketplaceReference:e}}a(zGs,"restamp");function rZn(t,e){let r=t.sourceDescriptor.kind==="relativePath"?t.sourceDescriptor.path:"",n=e?iZn(e,r):oZn(t.marketplaceReference.githubRepo??"",r);return{...t,readmeUri:n}}a(rZn,"withReadme");function nZn(t){let e=t.trim().replace(/^\.?\/+|\/+$/g,"");return e?`${e}/README.md`:"README.md"}a(nZn,"readmeRelPath");function iZn(t,e){return XDe.join(t,nZn(e))}a(iZn,"fileReadmeUri");function oZn(t,e){return`https://github.com/${t}/blob/main/${nZn(e)}`}a(oZn,"githubBlobReadmeUri");p();p();var jhe=require("fs"),sZn=de(require("path"));var YGs=1e4,KGs=3e4,JGs=25;async function Hhe(t,e){await jhe.promises.mkdir(sZn.dirname(t),{recursive:!0,mode:448});let r=Date.now()+KGs;for(;;)try{await jhe.promises.writeFile(t,`${process.pid} -`,{flag:"wx",mode:384});break}catch(n){if(n.code!=="EEXIST")throw n;if(Date.now()>r)throw new Error(`withFileLock: timed out acquiring lock ${JSON.stringify(t)}`);await ZGs(t)>YGs&&await jhe.promises.rm(t,{force:!0}).catch(()=>{}),await bC(JGs)}try{return await e()}finally{await jhe.promises.rm(t,{force:!0}).catch(()=>{})}}a(Hhe,"withFileLock");async function ZGs(t){try{let e=await jhe.promises.stat(t);return Date.now()-e.mtimeMs}catch{return 1/0}}a(ZGs,"lockAgeMs");p();var Ghe=require("fs"),QX=de(require("path"));var XGs=new fe("plugins.source"),e$s=0,aZn=".clone-tmp";function t$s(t){try{return process.kill(t,0),!0}catch(e){return e.code==="EPERM"}}a(t$s,"isProcessAlive");async function r$s(t){let e=QX.dirname(t),r=`${QX.basename(t)}.`,n;try{n=await Ghe.promises.readdir(e)}catch{return}await Promise.all(n.map(async o=>{if(!o.startsWith(r)||!o.endsWith(aZn))return;let s=Number.parseInt(o.slice(r.length).split(".")[0],10);!Number.isInteger(s)||s<=0||s===process.pid||t$s(s)||await Ghe.promises.rm(QX.join(e,o),{recursive:!0,force:!0}).catch(()=>{})}))}a(r$s,"sweepOrphanedCloneTemps");async function lfr(t,e,r,n,o){if(await Wd(r))return;await r$s(r);let s=`${r}.${process.pid}.${e$s++}${aZn}`;try{await t.git.cloneRepository(e,s,n),o?await t.git.checkout(s,o,!0):n&&await t.git.checkout(s,n),await Hhe(`${r}.lock`,async()=>{await Wd(r)||(await Ghe.promises.mkdir(QX.dirname(r),{recursive:!0,mode:448}),await Ghe.promises.rename(s,r))})}finally{t.git.forget(s),await Ghe.promises.rm(s,{recursive:!0,force:!0}).catch(()=>{})}}a(lfr,"cloneIntoPlace");var glt=class{constructor(){this.kind="relativePath"}static{a(this,"RelativePathPluginSource")}getInstallUri(){throw new Error("Use PluginRepositoryService.getPluginInstallUri() for relative-path sources")}ensure(){throw new Error("Use PluginRepositoryService.ensureRepository() for relative-path sources")}update(){throw new Error("Use PluginRepositoryService.pullRepository() for relative-path sources")}getCleanupTarget(){}getLabel(e){return e.path||"."}},Alt=class{constructor(e){this.deps=e}static{a(this,"AbstractGitPluginSource")}getCleanupTarget(e,r){return this.getRepoDir(e,r)}async ensure(e,r){let n=r.sourceDescriptor,o=this.getRepoDir(e,n);return await Wd(o)?await this.checkoutRevision(o,n):await lfr(this.deps,this.cloneUrl(n),o,n.ref,n.sha),this.getInstallUri(e,n)}async update(e,r){let n=r.sourceDescriptor,o=this.getRepoDir(e,n);if(!await Wd(o))return XGs.warn(this.deps.ctx,`cannot update '${r.name}': source repository not cloned`,{repoDir:o}),!1;if(!n.sha&&await this.deps.git.isOnBranch(o)){let l=await this.deps.git.pull(o);return await this.checkoutRevision(o,n),l}let s=await this.deps.git.revParse(o,"HEAD").catch(()=>{});await this.deps.git.fetch(o),await this.checkoutRevision(o,n);let c=await this.deps.git.revParse(o,"HEAD").catch(()=>{});return s!==c}async checkoutRevision(e,r){r.sha?await this.deps.git.checkout(e,r.sha,!0):r.ref&&await this.deps.git.checkout(e,r.ref)}},ylt=class extends Alt{constructor(){super(...arguments);this.kind="github"}static{a(this,"GitHubPluginSource")}getInstallUri(r,n){let o=n;return jDe(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n,[s,c]=o.repo.split("/");return qDe(r,["github.com",OT(s),OT(c),...Zct(o.ref,o.sha)])}getLabel(r){let n=r;return n.path?`${n.repo}/${n.path}`:n.repo}cloneUrl(r){return`https://github.com/${r.repo}.git`}},Elt=class extends Alt{constructor(){super(...arguments);this.kind="url"}static{a(this,"GitUrlPluginSource")}getInstallUri(r,n){let o=n;return jDe(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n;return qDe(r,pJn(o.url,o.ref,o.sha))}getLabel(r){let n=r;return n.path?`${n.url}/${n.path}`:n.url}cloneUrl(r){return r.url}};var eNe=require("fs"),qX=de(require("path"));var n$s=0,_lt=class{constructor(e,r,n){this.ctx=e;this.store=r;this.git=n;this.logger=new fe("plugins.repository");this.cloneSequencer=new Vx;this.cacheRoot=r.sharedContentDir;let o={ctx:e,git:n};this.sources=new Map([["relativePath",new glt],["github",new ylt(o)],["url",new Elt(o)]])}static{a(this,"PluginRepositoryService")}getPluginSource(e){let r=this.sources.get(e);if(!r)throw new flt(e);return r}getRepositoryUri(e){return e.kind==="localFileUri"&&e.localRepositoryUri?e.localRepositoryUri:qDe(this.cacheRoot,e.cacheSegments)}getPluginInstallUri(e){let r=e.sourceDescriptor;if(r.kind!=="relativePath")return this.getPluginSourceInstallUri(r);let n=this.getRepositoryUri(e.marketplaceReference);return jDe(n,r.path)}getPluginSourceInstallUri(e){return this.getPluginSource(e.kind).getInstallUri(this.cacheRoot,e)}async ensureRepository(e){let r=this.getRepositoryUri(e);return this.cloneSequencer.queue(r,async()=>{if(await Wd(r))return r;if(e.kind==="localFileUri")throw new Fhe(r);return await lfr({ctx:this.ctx,git:this.git},e.cloneUrl,r,e.ref),r})}async ensurePluginSource(e){return e.sourceDescriptor.kind==="relativePath"?(await this.ensureRepository(e.marketplaceReference),this.getPluginInstallUri(e)):this.getPluginSource(e.sourceDescriptor.kind).ensure(this.cacheRoot,e)}async updatePluginSource(e){return e.sourceDescriptor.kind==="relativePath"?this.pullRepository(e.marketplaceReference):this.getPluginSource(e.sourceDescriptor.kind).update(this.cacheRoot,e)}async pullRepository(e){if(e.kind==="localFileUri")return!1;let r=this.getRepositoryUri(e);return await Wd(r)?this.git.pull(r):(this.logger.warn(this.ctx,"cannot pull: repository not cloned",{repoDir:r}),!1)}async fetchRepository(e){if(e.kind==="localFileUri")return!1;let r=this.getRepositoryUri(e);if(!await Wd(r))return!1;try{return await this.git.fetch(r),await this.git.revListCount(r,"HEAD","@{u}")>0}catch(n){return this.logger.debug(this.ctx,"silent fetch failed",{repoDir:r,err:String(n)}),!1}}async cleanupPluginSource(e){let r=this.sources.get(e.sourceDescriptor.kind);if(!r)return;let n=r.getCleanupTarget(this.cacheRoot,e.sourceDescriptor);if(!n||!wE(this.cacheRoot,n))return;let o=!1,s=`${n}.gc-${process.pid}-${n$s++}`;if(await Hhe(`${n}.lock`,async()=>{if(await this.isCloneReferenced(n)){this.logger.info(this.ctx,"skipping cleanup: clone still referenced by another editor",{cleanupDir:n});return}try{await Wd(n)&&await eNe.promises.rename(n,s),o=!0}catch(c){this.logger.warn(this.ctx,"failed to vacate plugin clone",{cleanupDir:n,err:String(c)})}}),!!o){try{await eNe.promises.rm(s,{recursive:!0,force:!0}),this.logger.info(this.ctx,"removed plugin clone",{cleanupDir:n})}catch(c){this.logger.warn(this.ctx,"failed to remove vacated plugin clone",{tombstone:s,err:String(c)})}await this.pruneEmptyParents(n).catch(c=>this.logger.warn(this.ctx,"failed to prune empty parents",{cleanupDir:n,err:String(c)}))}}async isCloneReferenced(e){return(await this.store.readInstalledForAllEditors()).some(n=>{let o=qX.isAbsolute(n.pluginUri)?n.pluginUri:qX.resolve(this.cacheRoot,n.pluginUri);return wE(e,o)})}async pruneEmptyParents(e){let r=qX.dirname(e);for(;wE(this.cacheRoot,r)&&r!==this.cacheRoot;){try{if((await eNe.promises.readdir(r)).length>0)break;await eNe.promises.rmdir(r)}catch{break}r=qX.dirname(r)}}};p();p();function cZn(t){if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.pluginUri=="string"&&typeof e.name=="string"&&typeof e.marketplace=="string"}a(cZn,"isInstalledEntry");var wH=require("fs"),Q2=de(require("path"));var lZn="plugins",a$s="plugins",c$s="installed.json",l$s="enablement.json",u$s="marketplaces.json",d$s=".lock",f$s=0,uZn=a(t=>typeof t=="string","isString"),tNe=class t{constructor(e){this.rootDir=e}static{a(this,"PluginStore")}get sharedContentDir(){return Q2.join(this.rootDir,lZn)}editorPluginsDir(e){return Q2.join(this.rootDir,this.safeEditorSegment(e),a$s)}installedJsonPath(e){return Q2.join(this.editorPluginsDir(e),c$s)}enablementJsonPath(e){return Q2.join(this.editorPluginsDir(e),l$s)}marketplacesJsonPath(e){return Q2.join(this.editorPluginsDir(e),u$s)}async readInstalled(e){let{version:r,items:n}=await this.readManifest(this.installedJsonPath(e),"installed",1,cZn);return{version:r,installed:n}}async readEnablement(e){let{version:r,items:n}=await this.readManifest(this.enablementJsonPath(e),"disabled",1,uZn);return{version:r,disabled:n}}async readMarketplaces(e){let{version:r,items:n}=await this.readManifest(this.marketplacesJsonPath(e),"marketplaces",1,uZn);return{version:r,marketplaces:n}}async readManifest(e,r,n,o){let s=await this.readJson(e),c=s?.[r];return Array.isArray(c)?{version:typeof s?.version=="number"?s.version:n,items:c.filter(o)}:{version:n,items:[]}}async writeInstalled(e,r){await this.writeJsonAtomic(this.installedJsonPath(e),r)}async writeEnablement(e,r){await this.writeJsonAtomic(this.enablementJsonPath(e),r)}async writeMarketplaces(e,r){await this.writeJsonAtomic(this.marketplacesJsonPath(e),r)}async withLock(e,r){let n=Q2.join(this.editorPluginsDir(e),d$s);return Hhe(n,r)}async listEditorIds(){let e;try{e=await wH.promises.readdir(this.rootDir,{withFileTypes:!0})}catch{return[]}let r=e.filter(o=>(o.isDirectory()||o.isSymbolicLink())&&t.isSafeEditorId(o.name)),n=await Promise.all(r.map(o=>wH.promises.stat(this.installedJsonPath(o.name)).then(s=>s.isFile(),()=>!1)));return r.filter((o,s)=>n[s]).map(o=>o.name)}async readInstalledForAllEditors(){let e=await this.listEditorIds();return(await Promise.all(e.map(n=>this.readInstalled(n)))).flatMap(n=>n.installed)}static isSafeEditorId(e){return!(!e||e==="."||e===".."||e.toLowerCase()===lZn||e!==Q2.basename(e)||/[/\\]/.test(e)||process.platform==="win32"&&/[<>:"|?*]/.test(e))}safeEditorSegment(e){if(!t.isSafeEditorId(e))throw new Error(`PluginStore: unsafe editorId ${JSON.stringify(e)}`);return e}async readJson(e){try{let r=await wH.promises.readFile(e,{encoding:"utf8"});return JSON.parse(r)}catch{return}}async writeJsonAtomic(e,r){let n=Q2.dirname(e);await wH.promises.mkdir(n,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${f$s++}.tmp`,s=JSON.stringify(r,null,2)+` -`;try{await wH.promises.writeFile(o,s,{encoding:"utf8",mode:384}),await wH.promises.rename(o,e)}catch(c){throw await wH.promises.rm(o,{force:!0}).catch(()=>{}),c}}};var pZn=require("os"),$he=de(require("path"));var dZn={hooks:[],commands:[],skills:[],agents:[],instructions:[],mcpServerDefinitions:[]},fZn=new Set,p$s=new Set(Lhe.filter(t=>t.changeSignal).map(t=>t.name)),uc=class{constructor(e,r,n=50,o=(0,pZn.homedir)(),s=process.env.COPILOT_HOME||$he.join(o,efr)){this.ctx=e;this.watchDebounceMs=n;this.userHome=o;this.copilotHome=s;this.logger=new fe("AgentPluginService");this._onDidChangePlugins=new ep;this.onDidChangePlugins=a((e,r,n)=>(this.ensureWatching(),this._onDidChangePlugins.event(e,r,n)),"onDidChangePlugins");this.mutationSequencer=new Vx;this._sourceWatchers=[];this._sourceSubscriptions=[];this._watchStarted=!1;this._disposed=!1;this._lastSourceListings=new Map;this._injectedWatcher=r,this.ensureWatching()}static{a(this,"AgentPluginService")}get store(){return this._store||(this._store=new tNe(this.ctx.get(Yn).directory)),this._store}get repository(){return this._repository||(this._git??=new plt(this.ctx),this._repository=new _lt(this.ctx,this.store,this._git)),this._repository}get marketplace(){return this._marketplace||(this._marketplace=new mlt(this.ctx,this.repository)),this._marketplace}get install(){return this._install||(this._install=new hlt(this.repository,this.marketplace)),this._install}get editorId(){return this.ctx.get(Ir).getEditorIdentity().editorId}guardEditorId(e){let r=this.editorId;if(tNe.isSafeEditorId(r))return r;this.logger.warn(this.ctx,`${e} skipped: unsafe editorId`,{editorId:r})}async listPlugins(){this.ensureWatching();let e=this.guardEditorId("listPlugins");if(e===void 0)return[];let[{installed:r},{disabled:n}]=await Promise.all([this.store.readInstalled(e),this.store.readEnablement(e)]),o=new Set(n),s=await jJn(this.discoveryDeps(r)),c=await vx(s,ult,l=>this.toPlugin(l,o));return c.sort((l,u)=>l.uri.localeCompare(u.uri)),c}async toPlugin(e,r){let n=await this.readContributionsSafely(e),o=e.fromMarketplace?.name||n.manifestName||e.displayName||$he.basename(e.fsPath);return{uri:e.uri,label:o,enabled:!r.has(e.uri),hooks:n.hooks,commands:n.commands,skills:n.skills,agents:n.agents,instructions:n.instructions,mcpServerDefinitions:n.mcpServerDefinitions,...e.fromMarketplace&&{fromMarketplace:e.fromMarketplace}}}readContributionsSafely(e){let r=(async()=>{let n=await PJn(e.fsPath);return $Jn(e.fsPath,n,{userHome:this.userHome,...e.repositoryBoundary!==void 0&&{repositoryBoundary:e.repositoryBoundary}})})().catch(n=>(this.logger.debug(this.ctx,"listPlugins: reading contributions failed",{uri:e.uri,err:String(n)}),dZn));return o3(r,llt,dZn)}discoveryRoots(){return{sharedContentDir:this.store.sharedContentDir,copilotHome:this.copilotHome}}isReadOnlyPlugin(e){return ifr(e,this.copilotHome)}discoveryDeps(e){let r=new Map;return{...this.discoveryRoots(),installed:e,getRepositoryUri:a(n=>this.repository.getRepositoryUri(n),"getRepositoryUri"),resolveMarketplace:a(n=>this.resolveMarketplaceForList(n,r),"resolveMarketplace")}}resolveMarketplaceForList(e,r){let n=LT(e.marketplace);if(!n)return Promise.resolve(void 0);let o=(async()=>{let s=this.repository.getRepositoryUri(n),c=await this.readMarketplacePluginFromDir(s,n,e.name,r);if(c)return c;if(e.pluginUri&&e.pluginUri!==s)return await this.readMarketplacePluginFromDir(e.pluginUri,n,e.name)})().catch(s=>{this.logger.debug(this.ctx,"listPlugins: resolving marketplace metadata failed",{pluginUri:e.pluginUri,err:String(s)})});return o3(o,llt,void 0)}async readMarketplacePluginFromDir(e,r,n,o){if(!await Wd(e))return;let s=o?.get(e);s||(s=this.marketplace.readAllPluginsFromDirectory(e,r),o?.set(e,s));let l=(await s).find(u=>u.name===n);return l||(await this.marketplace.readSinglePluginManifest(e,r)??void 0)}async enablePlugin(e){await this.setPluginEnabled(e,!0)}async disablePlugin(e){await this.setPluginEnabled(e,!1)}async setPluginEnabled(e,r){this.ensureWatching(),await this.mutate(async n=>{let o=await this.store.readEnablement(n),s=o.disabled.includes(e);if(r===!s)return!1;let c=r?o.disabled.filter(l=>l!==e):[...o.disabled,e];return await this.store.writeEnablement(n,{...o,disabled:c}),this.logger.info(this.ctx,`${r?"enabled":"disabled"} plugin`,{pluginUri:e}),!0})}async mutate(e){let r=this.guardEditorId("mutation");if(r===void 0)return;await this.mutationSequencer.queue(r,()=>this.store.withLock(r,()=>e(r)))&&await this.refreshAndMaybeFire(fZn)}async reconcile(){this.ensureWatching();let e=this.guardEditorId("reconcile");if(e===void 0)return;let r=await this.store.readInstalled(e),n=await Promise.all(r.installed.map(s=>this.shouldDrop(s))),o=new Set(r.installed.filter((s,c)=>n[c]).map(s=>s.pluginUri));o.size!==0&&await this.mutate(async s=>{let c=await this.store.readInstalled(s),l=await Promise.all(c.installed.map(f=>o.has(f.pluginUri)?this.shouldDrop(f):Promise.resolve(!1))),u=c.installed.filter((f,h)=>!l[h]),d=c.installed.filter((f,h)=>l[h]);for(let f of d)this.logger.info(this.ctx,"reconcile dropped missing plugin",{name:f.name,pluginUri:f.pluginUri});return d.length===0?!1:(await this.store.writeInstalled(s,{...c,installed:u}),await this.pruneEnablement(s,d.map(f=>f.pluginUri)),!0)})}async pruneEnablement(e,r){let n=new Set(r),o=await this.store.readEnablement(e),s=o.disabled.filter(c=>!n.has(c));s.length!==o.disabled.length&&await this.store.writeEnablement(e,{...o,disabled:s})}async shouldDrop(e){return $he.isAbsolute(e.pluginUri)?nfr(e.pluginUri):!1}ensureWatching(){if(this._watchStarted||this._disposed||!this.ctx.get(Ir).isEditorPluginInfoKnown())return;this._watchStarted=!0;let e=this.guardEditorId("plugin watch");if(e===void 0)return;let r=this.store.editorPluginsDir(e);this._fileWatcher=new JDe(this.ctx,r,{matches:zJn},this._injectedWatcher,this.watchDebounceMs),this._watchSubscription=this._fileWatcher.onDidChange(()=>{this.refreshAndMaybeFire(fZn)});let n=this.discoveryRoots();for(let o of Lhe){let s=o.changeSignal;if(!s)continue;let c=new JDe(this.ctx,s.dir(n),{createDir:s.createDir,matches:afr(s.files)},this._injectedWatcher,this.watchDebounceMs);this._sourceSubscriptions.push(c.onDidChange(()=>{this.refreshAndMaybeFire(new Set([o.name]))})),this._sourceWatchers.push(c)}this.seedAndStart()}async seedAndStart(){await this.mutationSequencer.queue(this.editorId,async()=>{if(this._lastStateKey===void 0)try{this._lastStateKey=await this.stateKey(p$s)}catch{}}),!this._disposed&&await Promise.all([this._fileWatcher?.start(),...this._sourceWatchers.map(e=>e.start())])}refreshAndMaybeFire(e){return this.mutationSequencer.queue(this.editorId,async()=>{if(this._disposed)return;let r;try{r=await this.stateKey(e)}catch(n){this.logger.warn(this.ctx,"plugin refresh failed",{err:String(n)});return}r!==this._lastStateKey&&(this._lastStateKey=r,this._onDidChangePlugins.fire())})}async stateKey(e){let r=this.editorId,[{installed:n},{disabled:o}]=await Promise.all([this.store.readInstalled(r),this.store.readEnablement(r)]),s=this.discoveryRoots();for(let l of Lhe){let u=l.changeSignal;if(!u||!e.has(l.name)&&this._lastSourceListings.has(l.name))continue;let d=await u.listing(s);d!==void 0&&this._lastSourceListings.set(l.name,d)}let c={};for(let l of Lhe)l.changeSignal&&(c[l.name]=[...this._lastSourceListings.get(l.name)??[]].sort());return JSON.stringify({installed:n.map(l=>[l.pluginUri,l.name]).sort((l,u)=>l[0].localeCompare(u[0])||l[1].localeCompare(u[1])),disabled:[...o].sort(),sources:c})}async installPlugin(e){let r=await this.install.acquirePlugin(e);return await this.mutate(async n=>{let o=await this.store.readInstalled(n),s={pluginUri:r,marketplace:e.marketplaceReference.rawValue,name:e.name},c=o.installed.find(u=>u.pluginUri===r);if(c&&c.name===s.name&&c.marketplace===s.marketplace)return!1;let l=c?o.installed.map(u=>u.pluginUri===r?s:u):[...o.installed,s];return await this.store.writeInstalled(n,{...o,installed:l}),this.logger.info(this.ctx,"installed plugin",{pluginUri:r,name:s.name}),!0}),r}async uninstallPlugin(e){let r;if(await this.mutate(async o=>{let s=await this.store.readInstalled(o),c=s.installed.findIndex(u=>u.pluginUri===e);if(c<0)return!1;r=s.installed[c];let l=s.installed.filter((u,d)=>d!==c);return await this.store.writeInstalled(o,{...s,installed:l}),await this.pruneEnablement(o,[e]),this.logger.info(this.ctx,"uninstalled plugin",{pluginUri:e,name:r.name}),!0}),!r)return;let n;try{n=await this.install.resolveInstalled(r)}catch(o){this.logger.warn(this.ctx,"skip clone GC: resolving installed plugin source failed",{pluginUri:e,err:String(o)});return}if(!n){this.logger.debug(this.ctx,"skip clone GC: could not resolve installed plugin source",{pluginUri:e});return}await this.repository.cleanupPluginSource(n).catch(o=>this.logger.warn(this.ctx,"plugin clone cleanup failed",{pluginUri:e,err:String(o)}))}async installPluginFromSource(e,r){let n=LT(e);if(!n)throw new Uhe(e);let o=await this.install.resolveFromSource(n);if(o.plugins.length===0)return{installed:!1,candidates:[]};let s;if(r!==void 0){if(s=o.plugins.find(l=>l.name===r),!s)return{installed:!1,candidates:o.plugins}}else if(o.plugins.length===1)s=o.plugins[0];else return{installed:!1,candidates:o.plugins};return o.isSinglePluginRepo||await this.addMarketplaceReference(n),{installed:!0,pluginUri:await this.installPlugin(s),plugin:s}}async updatePlugin(e){let r=this.guardEditorId("updatePlugin");if(r===void 0)return!1;let{installed:n}=await this.store.readInstalled(r),o=n.find(l=>l.pluginUri===e);if(!o)return this.logger.warn(this.ctx,"updatePlugin: not installed for this editor",{pluginUri:e}),!1;let s;try{s=await this.install.resolveInstalled(o)}catch(l){return this.logger.warn(this.ctx,"updatePlugin: resolving plugin source failed",{pluginUri:e,err:String(l)}),!1}if(!s)return this.logger.warn(this.ctx,"updatePlugin: could not resolve plugin source",{pluginUri:e}),!1;let c=!1;try{c=await this.repository.updatePluginSource(s)}catch(l){return this.logger.warn(this.ctx,"updatePlugin: pulling latest content failed",{pluginUri:e,err:String(l)}),!1}return c&&this.logger.info(this.ctx,"updated plugin",{pluginUri:e,name:o.name}),c}async addMarketplaceReference(e){await this.mutate(async r=>{let n=await this.store.readMarketplaces(r);return n.marketplaces.some(s=>LT(s)?.canonicalId===e.canonicalId)?!1:(await this.store.writeMarketplaces(r,{...n,marketplaces:[...n.marketplaces,e.rawValue]}),this.logger.info(this.ctx,"registered marketplace",{reference:e.rawValue}),!0)})}async listMarketplaces(){let e=this.guardEditorId("listMarketplaces");if(e===void 0)return[];let{marketplaces:r}=await this.store.readMarketplaces(e);return hJn(r)}async addMarketplace(e){let r=LT(e);if(!r)throw new Uhe(e,"marketplace source");await this.addMarketplaceReference(r)}async removeMarketplace(e){let r=LT(e);await this.mutate(async n=>{let o=await this.store.readMarketplaces(n),s=o.marketplaces.filter(c=>c===e?!1:r?LT(c)?.canonicalId!==r.canonicalId:!0);return s.length===o.marketplaces.length?!1:(await this.store.writeMarketplaces(n,{...o,marketplaces:s}),this.logger.info(this.ctx,"removed marketplace",{source:e}),!0)})}async browseMarketplace(e){let r;if(e!==void 0){let n=LT(e);if(!n)throw new Uhe(e,"marketplace source");r=[n]}else r=await this.listMarketplaces();return this.marketplace.fetchMarketplacePlugins(r)}dispose(){if(!this._disposed){this._disposed=!0,this._watchSubscription?.dispose(),this._fileWatcher?.dispose();for(let e of this._sourceSubscriptions)e.dispose();for(let e of this._sourceWatchers)e.dispose();this._git?.dispose(),this._onDidChangePlugins.dispose()}}};var vlt=de(require("path"));var jX=new fe("BackgroundAgent.PluginHooks"),Vhe="copilot-plugin",ufr={SessionStart:"sessionStart",SessionEnd:"sessionEnd",UserPromptSubmit:"userPromptSubmitted",PreToolUse:"preToolUse",PostToolUse:"postToolUse",ErrorOccurred:"errorOccurred"};function h$s(t,e){let r={};for(let o of t)for(let s of o.hooks){let c=ufr[s.type];if(c!==void 0)for(let l of s.hooks){let u=dfr(l,e);if(!u)continue;let d=r[c]??=new Map,f=d.get(s.uri);f?f.push(u):d.set(s.uri,[u])}}let n={};for(let[o,s]of Object.entries(r))n[o]=[...s].map(([c,l])=>({source:c,hooks:l}));return n}a(h$s,"groupPluginHooksBySource");async function hZn(t,e){if(!W5(t)||!fJ(t))return{};let r;try{r=(await t.get(uc).listPlugins()).filter(c=>c.enabled)}catch(c){return c instanceof bl?{}:(jX.warn(t,"failed to list plugins for hook injection",{err:String(c)}),{})}if(r.length===0)return{};let n=un(e.uri),o=h$s(r,n),s={};return o.preToolUse&&(s.preToolUse=[g$s(t,n,o.preToolUse)]),o.postToolUse&&(s.postToolUse=[A$s(t,n,o.postToolUse)]),o.userPromptSubmitted&&(s.userPromptSubmitted=[y$s(t,n,o.userPromptSubmitted)]),o.sessionStart&&(s.sessionStart=[E$s(t,n,o.sessionStart)]),o.sessionEnd&&(s.sessionEnd=[_$s(t,n,o.sessionEnd)]),o.errorOccurred&&(s.errorOccurred=[v$s(t,n,o.errorOccurred)]),s}a(hZn,"buildPluginHookHandlers");function mZn(t,e){let r={...t};return e.preToolUse?.length&&(r.preToolUse=[...t.preToolUse??[],...e.preToolUse]),e.postToolUse?.length&&(r.postToolUse=[...t.postToolUse??[],...e.postToolUse]),e.userPromptSubmitted?.length&&(r.userPromptSubmitted=[...t.userPromptSubmitted??[],...e.userPromptSubmitted]),e.sessionStart?.length&&(r.sessionStart=[...t.sessionStart??[],...e.sessionStart]),e.sessionEnd?.length&&(r.sessionEnd=[...t.sessionEnd??[],...e.sessionEnd]),e.errorOccurred?.length&&(r.errorOccurred=[...t.errorOccurred??[],...e.errorOccurred]),r}a(mZn,"mergePluginHooks");function dfr(t,e){let r=process.platform==="darwin"?t.osx:process.platform==="linux"?t.linux:void 0,n=t.command??r??t.linux??t.osx,o=t.windows??t.command;if(n===void 0&&o===void 0)return;let s=m$s(t.cwd,e);return{type:"command",...n!==void 0&&{bash:n},...o!==void 0&&{powershell:o},...s!==void 0&&{cwd:s},...t.env&&{env:t.env},...t.timeout!==void 0&&{timeoutSec:t.timeout}}}a(dfr,"toCommandHook");function m$s(t,e){if(t!==void 0)return vlt.isAbsolute(t)?t:vlt.join(e,t)}a(m$s,"resolveHookCwd");function Whe(t,e){return async r=>{if(fJ(t))return e(r)}}a(Whe,"gated");function g$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,toolName:n.toolName,toolArgs:FDe(n.toolArgs)};for(let s of r){let c=await new o2(s.source,s.hooks).fire(t,o);for(let l of c){let u=l.output;if(u&&u.permissionDecision===Xue.deny)return{permissionDecision:"deny",permissionDecisionReason:u.permissionDecisionReason||"Tool execution denied by plugin hook"}}}return}catch(o){jX.error(t,`Failed to execute plugin PreToolUse hook for tool ${n.toolName}`,o);return}})}}a(g$s,"pluginPreToolUseHandler");function A$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,toolName:n.toolName,toolArgs:FDe(n.toolArgs),toolResult:{resultType:kdr(n.toolResult.resultType),textResultForLlm:n.toolResult.textResultForLlm}};for(let s of r)await new i2(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,`Failed to execute plugin PostToolUse hook for tool ${n.toolName}`,o)}})}}a(A$s,"pluginPostToolUseHandler");function y$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,prompt:n.prompt};for(let s of r)await new s2(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,"Failed to execute plugin UserPromptSubmitted hook",o)}})}}a(y$s,"pluginUserPromptSubmittedHandler");function E$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,source:n.source,...n.initialPrompt!==void 0&&{initialPrompt:n.initialPrompt}};for(let s of r)await new uJ(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,"Failed to execute plugin SessionStart hook",o)}})}}a(E$s,"pluginSessionStartHandler");function _$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,reason:n.reason};for(let s of r)await new lJ(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,"Failed to execute plugin SessionEnd hook",o)}})}}a(_$s,"pluginSessionEndHandler");function v$s(t,e,r){return{source:Vhe,handler:Whe(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,error:{message:n.error.message,name:n.error.name,...n.error.stack!==void 0&&{stack:n.error.stack}}};for(let s of r)await new lF(s.source,s.hooks).fire(t,o)}catch(o){jX.error(t,"Failed to execute plugin ErrorOccurred hook",o)}})}}a(v$s,"pluginErrorOccurredHandler");p();var gZn=de(require("node:path"));function AZn(t){let e="";for(let r of t){let n=r.codePointAt(0)??0;n>=32&&n!==127&&(e+=r)}return e.trim()}a(AZn,"sanitizeForPrompt");function C$s(t){let e=t.startsWith("file:")?un(t):t;return AZn(gZn.basename(e))}a(C$s,"confinedBasename");function b$s(t){let e=t.startsWith("file:")?un(t):t;return AZn(e)}a(b$s,"confinedAbsolutePath");function yZn(t){let e=C$s(t),r=b$s(t);return[`You are operating in inline mode for quick, focused code changes. Regardless of any other instructions, you are confined to a single file \u2014 \`${e}\` (absolute path: \`${r}\`) \u2014 and MUST NOT read, create, or modify any other file.`,"Focus on the user's selected code and its immediate context. Make changes grounded directly in the user's prompt: do NOT make changes that are not directly and logically related to it, and do NOT modify code outside the selection unless absolutely necessary for correctness. Keep changes minimal and focused on exactly what was asked.","Be concise: NO wordy explanations, NO progress messages about what you are doing or about to do. Do not ask the user for clarification \u2014 make your best effort.","Note that you may be in inline-ask mode and do not have any edit tools available \u2014 show the code snippet that needs to be changed in a code block. Do not claim to have made edits.",`For edit turns, make all changes in a single invocation of the edit tool \u2014 there is no tool calling loop. Use whichever edit tool you have available (\`edit\`, \`str_replace_editor\`, or \`apply_patch\`) to apply changes to \`${e}\`; follow its schema carefully, include all required properties, and match the existing code exactly. Always use the ABSOLUTE PATH \`${r}\` when supplying a file path or patch header \u2014 never a relative path or bare basename, because the working directory may differ from the project root and a relative path will be denied. If you use \`apply_patch\`, every \`*** Add File\`, \`*** Delete File\`, \`*** Update File\`, and \`*** Move to\` header must spell out the full \`${r}\` \u2014 any patch touching another path will be denied. Never output code to the user instead of editing. Don't repeat yourself after a tool call \u2014 pick up where you left off.`,`You have at most 2 tool-calling turns total. If you need to read the file or check diagnostics, do so in the first turn (e.g. call \`view\` or \`get_errors\` on \`${r}\`). Use the second turn to apply your edit. Do NOT spend additional turns validating or re-reading after editing \u2014 make your best effort in one shot. If you already have the file content and diagnostics in the conversation, skip the first turn and edit immediately. Any tool call beyond the 2-turn limit will be rejected with an error.`,"When the file content is provided in the conversation (in full or as a portion around the cursor), use it directly for your edit \u2014 do NOT re-read it with `view`. If only a portion is shown, line numbers indicate exact positions in the file; use them for your edits. If the user's request targets code outside the shown portion, use `view` to read that part first."].join(` +`)}a(WVn,"composeBackgroundAgentSystemMessage");p();p();p();p();var Q2e=(n=>(n.Copilot="copilot",n.Claude="claude",n.OpenPlugin="openPlugin",n))(Q2e||{});var mX=(n=>(n.GitHubShorthand="githubShorthand",n.GitUri="gitUri",n.LocalFileUri="localFileUri",n))(mX||{});p();p();var gX=require("fs"),ihe=fe(require("path"));var V8s=32,W8s=5e3,z8s=5*1024*1024,Y8s=32,K8s=Npn(Y8s);async function LT(t,e){return K8s.run(()=>k3(t(),W8s,e))}a(LT,"boundedFsOp");async function tlr(t){let e=await LT(()=>gX.promises.stat(t),void 0);if(e)return{path:t,isFile:e.isFile(),isDirectory:e.isDirectory(),isSymlink:!1}}a(tlr,"statEntry");async function q2e(t){let e=await LT(()=>gX.promises.readdir(t,{withFileTypes:!0}),void 0);return e?FS(e,V8s,async r=>{let n=ihe.join(t,r.name);if(r.isSymbolicLink()){let o=await tlr(n);return{path:n,isFile:o?.isFile??!1,isDirectory:o?.isDirectory??!1,isSymlink:!0}}return{path:n,isFile:r.isFile(),isDirectory:r.isDirectory(),isSymlink:!1}}):[]}a(q2e,"readChildren");var zVn=process.platform==="linux";function RE(t,e){let r=zVn?t:t.toLowerCase(),n=zVn?e:e.toLowerCase(),o=ihe.relative(r,n);return o===""||!o.startsWith("..")&&!ihe.isAbsolute(o)}a(RE,"isAtOrUnder");async function Zw(t,e){if(t===void 0)return!0;let r=await LT(()=>gX.promises.realpath(e),void 0);return r!==void 0&&RE(t,r)}a(Zw,"withinRealBoundary");async function AX(t){if(t!==void 0)return LT(()=>gX.promises.realpath(t),t)}a(AX,"resolveRealBoundary");async function j2e(t){let e=await LT(()=>gX.promises.stat(t),void 0);if(!(!e||!e.isFile()||e.size>z8s))return LT(()=>gX.promises.readFile(t,"utf8"),void 0)}a(j2e,"readTextFileCapped");var YVn=require("fs"),rlr=fe(require("path"));function BT(t){let e=t.replace(/[\\/:*?"<>|]/g,"_");return/^\.+$/.test(e)?e.replace(/\./g,"_"):e}a(BT,"sanitizeCacheSegment");function ohe(t){return t?[`ref_${encodeURIComponent(t)}`]:[]}a(ohe,"refCacheSegment");function Jat(t,e){return e?[`sha_${encodeURIComponent(e)}`]:ohe(t)}a(Jat,"gitRevisionCacheSuffix");function KVn(t,e,r){try{let n=new URL(t),o=BT((n.host||"unknown").toLowerCase()),s=n.pathname.replace(/\/+/g,"/").replace(/^\/+/,"").replace(/\/+$/g,"").replace(/\.git$/i,""),c=s?s.split("/").map(BT):[];return[o,...c,...Jat(e,r)]}catch{return["git",BT(t),...Jat(e,r)]}}a(KVn,"gitUrlToCacheSegments");async function Jd(t){return LT(()=>YVn.promises.stat(t).then(()=>!0,()=>!1),!1)}a(Jd,"exists");function H2e(t,e){let r=rlr.join(t,...e);if(!RE(t,r))throw new Error(`plugin cache path escapes the cache root: ${e.join("/")}`);return r}a(H2e,"joinCacheSegments");function G2e(t,e){if(!e)return t;let r=e.trim().replace(/^\.?\/+|\/+$/g,"");if(!r)return t;let n=rlr.join(t,r);return RE(t,n)?n:t}a(G2e,"joinContained");var Zat=require("node:url");function JVn(t){let e=new Map;for(let r of t){let n=FT(r);n&&!e.has(n.canonicalId)&&e.set(n.canonicalId,n)}return[...e.values()]}a(JVn,"parseMarketplaceReferences");function FT(t){let e=t.trim();if(e)return Z8s(e)??X8s(e)??J8s(e)}a(FT,"parseMarketplaceReference");function J8s(t){let e=/^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)(?:#(.+))?$/.exec(t);if(!e)return;let[,r,n,o]=e;return{rawValue:t,displayLabel:t,cloneUrl:`https://github.com/${r}/${n}.git`,canonicalId:XVn(r,n,o),cacheSegments:["github.com",BT(r),BT(n),...ohe(o)],kind:"githubShorthand",ref:o,githubRepo:`${r}/${n}`}}a(J8s,"parseShorthandMarketplaceReference");function Z8s(t){let e;try{e=new URL(t)}catch{return}let r=e.protocol.replace(/:$/,"").toLowerCase();if(r==="file"&&/^file:\/\//i.test(t)){if(e.hash)return;let y;try{y=(0,Zat.fileURLToPath)(e)}catch{return}return{rawValue:t,displayLabel:y,cloneUrl:t,canonicalId:`file:${(0,Zat.pathToFileURL)(y).toString().toLowerCase()}`,cacheSegments:[],kind:"localFileUri",localRepositoryUri:y}}if(r!=="http"&&r!=="https"&&r!=="ssh"||!e.host)return;let n=e.hash?e.hash.slice(1):void 0,o=e6s(e),s=e.host.toLowerCase(),c=BT(s),l=e.pathname.replace(/\/+/g,"/").replace(/\/+$/g,"").replace(/^\/+/,"");if(!l)return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:nlr(`git:${s}/`,n),cacheSegments:[c,...ohe(n)],kind:"gitUri",ref:n};let u=".git",d=l.toLowerCase().endsWith(u),f=d?l.slice(0,-u.length):l,h=f.split("/").map(BT),m=d?l.toLowerCase():`${l.toLowerCase()}${u}`,g=ZVn(s,f),A=eWn(g,n,`git:${s}/${m}`);return{rawValue:t,displayLabel:t,cloneUrl:o,canonicalId:A,cacheSegments:[c,...h,...ohe(n)],kind:"gitUri",ref:n,githubRepo:g}}a(Z8s,"parseUriMarketplaceReference");function X8s(t){let e=/^([^@\s]+)@([^:\s]+):(.+?\.git)(?:#(.+))?$/i.exec(t);if(!e)return;let r=".git",[,n,o,s,c]=e,l=s.replace(/^\/+/,"");if(!l.toLowerCase().endsWith(r))return;let u=l.slice(0,-r.length),d=u.split("/").map(BT),f=ZVn(o,u),h=eWn(f,c,`git:${o.toLowerCase()}/${l.toLowerCase()}`);return{rawValue:t,displayLabel:t,cloneUrl:`${n}@${o}:${l}`,canonicalId:h,cacheSegments:[BT(o.toLowerCase()),...d,...ohe(c)],kind:"gitUri",ref:c,githubRepo:f}}a(X8s,"parseScpMarketplaceReference");function e6s(t){if(!t.hash)return t.toString();let e=new URL(t.toString());return e.hash="",e.toString()}a(e6s,"refStrippedUrl");function ZVn(t,e){if(t.toLowerCase()!=="github.com")return;let r=e.split("/");if(r.length>=2&&r[0]&&r[1])return`${r[0]}/${r[1]}`}a(ZVn,"extractGitHubRepo");function XVn(t,e,r){return nlr(`github:${t.toLowerCase()}/${e.toLowerCase()}`,r)}a(XVn,"getGitHubCanonicalId");function eWn(t,e,r){if(t){let[n,o]=t.split("/");return XVn(n,o,e)}return nlr(r,e)}a(eWn,"gitCanonicalId");function nlr(t,e){return e?`${t}#${encodeURIComponent(e)}`:t}a(nlr,"appendRefSuffix");p();p();p();p();function tWn(t,e){return/^~(?=$|[/\\])/.test(t)?e+t.slice(1):t}a(tWn,"untildify");var t6s=200;function Xat(t,e){return ilr(t,e,new Set,0)}a(Xat,"cloneAndChange");function ilr(t,e,r,n){if(t==null)return t;let o=e(t);if(o!==void 0)return o;if(n>=t6s)throw new Error("Cannot clone: structure nested too deeply");if(Array.isArray(t))return t.map(s=>ilr(s,e,r,n+1));if(typeof t=="object"){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let s={};for(let c of Object.keys(t))s[c]=ilr(t[c],e,r,n+1);return r.delete(t),s}return t}a(ilr,"cloneAndChangeInner");function $2e(t,e=!1){if(!t||typeof t!="object")return;let r={};for(let[n,o]of Object.entries(t))typeof o=="string"?r[n]=o:e&&typeof o=="number"&&(r[n]=String(o));return Object.keys(r).length>0?r:void 0}a($2e,"toStringRecord");var ect=fe(require("path"));var n6s=/[\s&|<>()^;!`"'$]/;function i6s(t){return t.replace(/(\\*)("|$)/g,(e,r,n)=>r+r+(n?'\\"':""))}a(i6s,"escapeWindowsDoubleQuoted");function o6s(t,e,r){if(!t.includes(r))return t;if(!n6s.test(e))return t.replaceAll(r,e);let n=process.platform==="win32",o=new RegExp(`(["']?)${Ooe(r)}([\\w./\\\\~:@-]*)`,"g");return t.replace(o,(s,c,l)=>{let u=e+l;if(c==="'")return c+u.replace(/'/g,"'\\''");let d=n?i6s(u):u.replace(/([\\"$`])/g,"\\$&");return c?c+d:'"'+d+'"'})}a(o6s,"shellQuotePluginRootInCommand");var s6s={SessionStart:"SessionStart",SessionEnd:"SessionEnd",UserPromptSubmit:"UserPromptSubmit",PreToolUse:"PreToolUse",PostToolUse:"PostToolUse",PreCompact:"PreCompact",SubagentStart:"SubagentStart",SubagentStop:"SubagentStop",Stop:"Stop",ErrorOccurred:"ErrorOccurred",sessionStart:"SessionStart",sessionEnd:"SessionEnd",userPromptSubmitted:"UserPromptSubmit",preToolUse:"PreToolUse",postToolUse:"PostToolUse",agentStop:"Stop",subagentStop:"SubagentStop",errorOccurred:"ErrorOccurred"};function a6s(t){if(t.type!==void 0&&t.type!=="command")return;let e=a(f=>typeof f=="string"&&f.length>0?f:void 0,"str"),r=e(t.command),n=e(t.bash),o=e(t.powershell),s=e(t.windows)??o,c=e(t.linux)??n,l=e(t.osx)??n;if(!r&&!s&&!c&&!l)return;let u=typeof t.timeout=="number"?t.timeout:typeof t.timeoutSec=="number"?t.timeoutSec:void 0,d=$2e(t.env,!0);return{...r&&{command:r},...s&&{windows:s},...c&&{linux:c},...l&&{osx:l},...d&&{env:d},...u!==void 0&&{timeout:u}}}a(a6s,"normalizeHookCommand");function rWn(t,e){let r=a6s(t);if(!r)return;let n,o=typeof t.cwd=="string"?t.cwd:void 0;if(o){let s=tWn(o,e);n=ect.isAbsolute(s)?ect.normalize(s):s}return{...r,...n!==void 0&&{cwd:n}}}a(rWn,"resolveHookCommand");function c6s(t,e){if(!t||typeof t!="object")return[];let r=t,n=[],o=r.hooks;if(Array.isArray(o)){for(let s of o)if(s&&typeof s=="object"){let c=rWn(s,e);c&&n.push(c)}}else{let s=rWn(r,e);s&&n.push(s)}return n}a(c6s,"extractHookCommands");function slr(t,e,r){if(!e||typeof e!="object")return[];let n=e;if(n.disableAllHooks===!0)return[];let o=n.hooks;if(!o||typeof o!="object")return[];let s=o,c=[];for(let l of Object.keys(s)){let u=s6s[l];if(!u)continue;let d=s[l];if(!Array.isArray(d))continue;let f=[];for(let h of d)f.push(...c6s(h,r));f.length>0&&c.push({type:u,hooks:f,uri:t,originalId:l})}return c}a(slr,"parseHooksJson");function olr(t,e,r){if(Array.isArray(t)){let n=t;for(let o=0;o{for(let d of["command","windows","linux","osx"]){let f=u[d];typeof f=="string"&&(u[d]=o6s(f,c,o))}(!u.env||typeof u.env!="object")&&(u.env={}),u.env[s]=c},"mutateHookCommand");try{let u=Xat(e,()=>{});for(let d of Object.values(u.hooks??{}))if(Array.isArray(d))for(let f of d){if(!f||typeof f!="object")continue;let h=f;if(Array.isArray(h.hooks))for(let m of h.hooks)m&&typeof m=="object"&&l(m);else l(h)}return olr(u,o,c),slr(t,u,n)}catch{return[]}}a(alr,"interpolateHookPluginRoot");p();var Elr=require("fs");ylr();function J2e(t){try{return Alr(t)}catch{return}}a(J2e,"parseJsonc");async function lhe(t,e){let r=await LT(()=>Elr.promises.stat(t),void 0);if(!r||!r.isFile()||e!==void 0&&r.size>e)return;let n=await LT(()=>Elr.promises.readFile(t,"utf8"),void 0);if(n!==void 0)return J2e(n)}a(lhe,"readJsoncFile");var _H=fe(require("path"));var R6s={format:0,manifestPath:"plugin.json",altManifestPaths:[".github/plugin/plugin.json"],hookConfigPath:"hooks.json",altHookConfigPaths:["hooks/hooks.json"],pluginRootToken:void 0,pluginRootEnvVar:void 0,parseHooks(t,e,r,n){return slr(t,e,n)}},k6s={format:1,manifestPath:".claude-plugin/plugin.json",hookConfigPath:"hooks/hooks.json",pluginRootToken:"${CLAUDE_PLUGIN_ROOT}",pluginRootEnvVar:"CLAUDE_PLUGIN_ROOT",parseHooks(t,e,r,n){return alr(t,e,r,n,"${CLAUDE_PLUGIN_ROOT}","CLAUDE_PLUGIN_ROOT")}},P6s={format:2,manifestPath:".plugin/plugin.json",hookConfigPath:"hooks/hooks.json",pluginRootToken:"${PLUGIN_ROOT}",pluginRootEnvVar:"PLUGIN_ROOT",parseHooks(t,e,r,n){return alr(t,e,r,n,"${PLUGIN_ROOT}","PLUGIN_ROOT")}};async function hWn(t){return await Jd(_H.join(t,".plugin","plugin.json"))?P6s:t.split(/[/\\]/).includes(".claude")||await Jd(_H.join(t,".claude-plugin","plugin.json"))?k6s:R6s}a(hWn,"detectPluginFormat");async function mWn(t,e,r){let n=await AX(r);for(let o of[e.manifestPath,...e.altManifestPaths??[]]){let s=_H.join(t,o);if(!await Zw(n,s))continue;let c=await j2e(s),l=c===void 0?void 0:J2e(c);if(l&&typeof l=="object"&&!Array.isArray(l))return{manifest:l,manifestUri:s}}}a(mWn,"readPluginManifest");function gWn(t){return[t.hookConfigPath,...t.altHookConfigPaths??[]]}a(gWn,"defaultHookConfigPaths");var _lr={paths:[],exclusive:!1};function uhe(t){if(t==null)return _lr;if(typeof t=="string"){let e=t.trim();return e?{paths:[e],exclusive:!1}:_lr}if(Array.isArray(t))return{paths:pWn(t),exclusive:!1};if(typeof t=="object"){let e=t;if(Array.isArray(e.paths))return{paths:pWn(e.paths),exclusive:e.exclusive===!0}}return _lr}a(uhe,"parseComponentPathConfig");function pWn(t){return t.filter(e=>typeof e=="string").map(e=>e.trim()).filter(e=>e.length>0)}a(pWn,"cleanPaths");function sct(t,e,r,n){let o=n&&RE(n,t)?n:t,s=[];r.exclusive||s.push(_H.join(t,e));for(let c of r.paths){let l=_H.normalize(_H.join(t,c));RE(o,l)&&s.push(l)}return s}a(sct,"resolveComponentDirs");p();p();var QT=fe(require("path"));var yWn=new AO,Z2e=16,AWn=".md",D6s=[".instructions.md",".mdc",".md"];async function N6s(t){let e=QT.basename(t).replace(/(\.agent)?\.md$/i,"");return EWn(t,e)}a(N6s,"parseAgentFile");async function M6s(t){return EWn(t,QT.basename(QT.dirname(t)))}a(M6s,"parseSkillFile");async function EWn(t,e){let r=await j2e(t);if(r===void 0)return{name:e};try{let n=yWn.parse(t,r).header,o=n?.name?.trim()||e,s=n?.description?.trim();return{name:o,...s&&{description:s}}}catch{return{name:e}}}a(EWn,"readNameDescription");async function O6s(t){let e=await j2e(t);if(e!==void 0)try{return yWn.parse(t,e).header?.description?.trim()||void 0}catch{return}}a(O6s,"parseCommandDescription");async function _Wn(t,e,r){let n=await AX(r),s=(await FS(e,Z2e,async d=>{if(!await Zw(n,d))return[];let f=QT.join(d,"SKILL.md");if(await Jd(f)&&await Zw(n,f))return[f];let h=(await q2e(d)).filter(g=>g.isDirectory);return h.sort((g,A)=>g.path.localeCompare(A.path)),(await FS(h,Z2e,async g=>{if(g.isSymlink&&!await Zw(n,g.path))return;let A=QT.join(g.path,"SKILL.md");if(!(!await Jd(A)||!await Zw(n,A)))return A})).filter(g=>g!==void 0)})).flat();if(s.length===0){let d=QT.join(t,"SKILL.md");await Jd(d)&&await Zw(n,d)&&s.push(d)}let c=await FS(s,Z2e,async d=>({uri:d,...await M6s(d)})),l=new Set,u=[];for(let{uri:d,name:f,description:h}of c)l.has(d)||(l.add(d),u.push({uri:d,name:f,...h&&{description:h}}));return u.sort((d,f)=>d.name.localeCompare(f.name)),u}a(_Wn,"readSkills");async function vWn(t,e,r){let n=await AX(r),o=new Set,s=[],c=a(l=>{let u=e(l);u&&!o.has(u)&&(o.add(u),s.push({uri:l,name:u}))},"addItem");for(let l of t){if(!await Zw(n,l))continue;let u=await tlr(l);if(!u)continue;if(u.isFile){c(l);continue}if(!u.isDirectory)continue;let d=await q2e(l);d.sort((f,h)=>f.path.localeCompare(h.path));for(let f of d)f.isFile&&(f.isSymlink&&!await Zw(n,f.path)||c(f.path))}return s.sort((l,u)=>l.name.localeCompare(u.name)),s}a(vWn,"scanComponentFiles");function L6s(t){return QT.extname(t).toLowerCase()===AWn?QT.basename(t).slice(0,-AWn.length):void 0}a(L6s,"getMarkdownComponentName");function CWn(t,e){return vWn(t,L6s,e)}a(CWn,"readMarkdownComponents");async function bWn(t,e){let r=await CWn(t,e);return FS(r,Z2e,async n=>{let o=await O6s(n.uri);return{...n,...o&&{description:o}}})}a(bWn,"readCommandComponents");async function SWn(t,e){let r=await CWn(t,e);if(r.length===0)return r;let n=await FS(r,Z2e,async c=>{let{name:l,description:u}=await N6s(c.uri);return{uri:c.uri,name:l||c.name,...u&&{description:u}}}),o=new Set,s=n.filter(c=>o.has(c.name)?!1:(o.add(c.name),!0));return s.sort((c,l)=>c.name.localeCompare(l.name)),s}a(SWn,"readAgentComponents");function B6s(t){let e=QT.basename(t),r=e.toLowerCase(),n=D6s.find(o=>r.endsWith(o));return n?e.slice(0,-n.length):void 0}a(B6s,"getInstructionFileName");function TWn(t,e){return vWn(t,B6s,e)}a(TWn,"readInstructionComponents");p();function F6s(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t;if(Object.hasOwn(e,"mcpServers")){let r=e.mcpServers;return!r||typeof r!="object"||Array.isArray(r)?void 0:r}return e}a(F6s,"resolveMcpServersMap");function U6s(t){if(!t||typeof t!="object")return;let e=t,r=a(h=>typeof h=="string"&&h.trim()?h.trim():void 0,"str"),n=r(e.type),o=r(e.command),s=r(e.url),c=Array.isArray(e.args)?e.args.filter(h=>typeof h=="string"):void 0,l=$2e(e.env,!0),u=r(e.envFile),d=r(e.cwd),f=$2e(e.headers);if(n!=="ws"){if(n==="stdio"||!n&&o)return o?{type:"stdio",command:o,...c&&{args:c},...l&&{env:l},...d!==void 0&&{cwd:d},...u!==void 0&&{envFile:u}}:void 0;if(n==="http"||n==="sse"||!n&&s)return s?{type:"http",url:s,...f&&{headers:f}}:void 0}}a(U6s,"normalizeMcpServerConfiguration");function Q6s(t,e,r,n){let o=a(l=>l.replaceAll(r,()=>e),"replace"),s=t.configuration,c;if(s.type==="stdio"){let l={};for(let[u,d]of Object.entries(s.env??{}))l[u]=o(d);l[n]=e,c={type:"stdio",command:o(s.command),...s.args&&{args:s.args.map(o)},env:l,...s.cwd!==void 0&&{cwd:o(s.cwd)},...s.envFile!==void 0&&{envFile:o(s.envFile)}}}else c={type:"http",url:o(s.url),...s.headers&&{headers:Object.fromEntries(Object.entries(s.headers).map(([l,u])=>[l,o(u)]))}};return{name:t.name,configuration:c,uri:t.uri}}a(Q6s,"interpolateMcpPluginRoot");var q6s=/\$\{(?![A-Za-z]+:)([A-Z_][A-Z0-9_]*)\}/g;function j6s(t){return Xat(t,e=>{if(typeof e=="string"){let r=e.replace(q6s,"${env:$1}");return r!==e?r:void 0}})}a(j6s,"convertBareEnvVarsToVsCodeSyntax");function vlr(t,e,r,n){let o=F6s(e);if(!o)return[];let s=[];for(let[c,l]of Object.entries(o)){let u=U6s(l);if(!u)continue;let d={name:c,configuration:u,uri:t};n.pluginRootToken&&n.pluginRootEnvVar&&(d=Q6s(d,r,n.pluginRootToken,n.pluginRootEnvVar)),d=j6s(d),s.push(d)}return s}a(vlr,"parseMcpServerDefinitionMap");p();var _X=require("fs"),bb=fe(require("path"));var blr=".copilot",Slr="installed-plugins",Ygf=bb.join(blr,Slr),IWn="config.json",act=5e3,cct=16,Tlr=5*1024*1024;async function dhe(t){return LT(()=>t().then(e=>({ok:!0,value:e}),e=>({ok:!1,code:e.code??"error"})),{ok:!1,code:"timeout"})}a(dhe,"boundedFsResult");function Clr(t){return t==="ENOENT"||t==="ENOTDIR"}a(Clr,"isAbsentCode");async function xWn(t){let e=await dhe(()=>_X.promises.stat(bb.dirname(t)));return e.ok&&e.value.isDirectory()}a(xWn,"parentDirSurvives");async function Ilr(t){let e=await dhe(()=>_X.promises.stat(t));return e.ok||e.code!=="ENOENT"?!1:xWn(t)}a(Ilr,"isDefinitivelyGone");var H6s={name:"marketplace",discover:$6s},G6s={name:"copilotCli",discover:V6s,changeSignal:{dir:a(t=>t.copilotHome,"dir"),files:new Set([IWn]),createDir:!1,listing:a(t=>W6s(t.copilotHome),"listing")}},fhe=[H6s,G6s];async function wWn(t){let e=await Promise.all(fhe.map(o=>o.discover(t))),r=new Set,n=[];for(let o of e)for(let s of o){let c=fg(s.fsPath);r.has(c)||(r.add(c),n.push(s))}return n}a(wWn,"discoverPlugins");async function $6s(t){return(await FS(t.installed,cct,async r=>{let n;if(bb.isAbsolute(r.pluginUri))n=r.pluginUri;else{let u=bb.resolve(t.sharedContentDir,r.pluginUri);if(!RE(t.sharedContentDir,u))return;n=u}let o=await dhe(()=>_X.promises.stat(n));if(o.ok){if(!o.value.isDirectory())return}else if(o.code==="ENOENT"&&await xWn(n))return;let s=FT(r.marketplace),c;if(s)try{c=t.getRepositoryUri(s)}catch{c=void 0}let l=await t.resolveMarketplace(r);return{uri:r.pluginUri,fsPath:n,displayName:r.name,readOnly:xlr(n,t.copilotHome),...l&&{fromMarketplace:l},...c!==void 0&&{repositoryBoundary:c}}})).filter(r=>r!==void 0)}a($6s,"discoverMarketplace");async function V6s(t){return(await RWn(t.copilotHome)??[]).map(r=>({uri:r.fsPath,fsPath:r.fsPath,readOnly:!0,...r.displayName!==void 0&&{displayName:r.displayName}}))}a(V6s,"discoverCopilotCli");async function RWn(t){return k3(z6s(t),act,void 0)}a(RWn,"listCopilotCliInstalls");async function W6s(t){return(await RWn(t))?.map(e=>e.fsPath)}a(W6s,"listCopilotCliPluginDirs");async function z6s(t){let e=bb.join(t,Slr),[r,n]=await Promise.all([Y6s(t),K6s(e)]);if(r===void 0&&n===void 0)return;let o=[];for(let u of r??[]){let f=(u.cachePath!==void 0&&bb.isAbsolute(u.cachePath)?u.cachePath:void 0)??(u.name!==void 0&&u.marketplace!==void 0?bb.join(e,u.marketplace,u.name):void 0);f!==void 0&&o.push({fsPath:f,...u.name!==void 0&&{displayName:u.name}})}let s=await FS(o,cct,async u=>await Ilr(u.fsPath)?void 0:u),c=[],l=new Set;for(let u of s){if(u===void 0)continue;let d=fg(u.fsPath);l.has(d)||(l.add(d),c.push({fsPath:u.fsPath,...u.displayName!==void 0&&{displayName:u.displayName}}))}for(let u of n??[]){let d=fg(u);l.has(d)||(l.add(d),c.push({fsPath:u}))}return c}a(z6s,"collectCopilotCliInstalls");async function Y6s(t){let e=bb.join(t,IWn),r=await dhe(()=>_X.promises.stat(e));if(!r.ok)return Clr(r.code)?[]:void 0;if(!r.value.isFile()||r.value.size>Tlr)return;let n=await dhe(()=>_X.promises.readFile(e,"utf8"));if(!n.ok)return Clr(n.code)?[]:void 0;let o=n.value,s;try{s=JSON.parse(o)}catch{return}let c=s?.installedPlugins;if(!Array.isArray(c))return[];let l=[];for(let u of c){if(u===null||typeof u!="object")continue;let d=u;l.push({name:typeof d.name=="string"?d.name:void 0,marketplace:typeof d.marketplace=="string"?d.marketplace:void 0,cachePath:typeof d.cache_path=="string"?d.cache_path:void 0})}return l}a(Y6s,"readCliInstalledPlugins");async function K6s(t){let e=await dhe(()=>_X.promises.readdir(t,{withFileTypes:!0}));if(!e.ok)return Clr(e.code)?[]:void 0;let r=e.value,n=[];for(let o of r)if(o.isDirectory())for(let s of await q2e(bb.join(t,o.name)))s.isDirectory&&n.push(s.path);return n}a(K6s,"scanCopilotCliPluginDirs");function xlr(t,e){return RE(bb.join(e,Slr),t)}a(xlr,"isCopilotCliPath");var wlr=fe(require("path"));var J6s="commands",Z6s="skills",X6s="agents",e9s="rules",t9s=".mcp.json";async function PWn(t,e,r){let n=r.repositoryBoundary,o=n&&RE(n,t)?n:t,s=await AX(o),c=await mWn(t,e,s),l=c?.manifest,u=c?.manifestUri??wlr.join(t,e.manifestPath),d=a((v,b)=>sct(t,b,uhe(l?.[v]),n),"dirsFor"),[f,h,m,g,A,y]=await Promise.all([bWn(d("commands",J6s),s),_Wn(t,d("skills",Z6s),s),SWn(d("agents",X6s),s),TWn(d("rules",e9s),s),r9s(t,l,u,e,n,s,r),i9s(t,l,u,e,n,s)]),E=l?.name,_=typeof E=="string"&&E.trim()?E.trim():void 0;return{hooks:A,commands:f,skills:h,agents:m,instructions:g,mcpServerDefinitions:y,..._&&{manifestName:_}}}a(PWn,"readPluginContributions");function lct(t){return!!t&&typeof t=="object"&&!Array.isArray(t)&&!Object.hasOwn(t,"paths")}a(lct,"isEmbeddedSection");async function DWn(t,e){if(await Zw(e,t))return lhe(t,Tlr)}a(DWn,"readJsoncWithinBoundary");async function r9s(t,e,r,n,o,s,c){let l=e?.hooks;if(lct(l)){let h=Object.hasOwn(l,"hooks")||Object.hasOwn(l,"disableAllHooks")?l:{hooks:l},m=kWn(n,r,h,t,c);if(m.length>0)return m}let u=lct(l)?uhe(void 0):uhe(l),d=n9s(t,n,u,o);for(let f of d){let h=await DWn(f,s);if(h)return kWn(n,f,h,t,c)}return[]}a(r9s,"readHooks");function kWn(t,e,r,n,o){try{return t.parseHooks(e,r,n,o.userHome)}catch{return[]}}a(kWn,"parseHooksSafely");function n9s(t,e,r,n){let o=[];if(!r.exclusive)for(let s of gWn(e))o.push(wlr.join(t,s));for(let s of sct(t,"",{paths:r.paths,exclusive:!0},n))o.includes(s)||o.push(s);return o}a(n9s,"resolveHookConfigPaths");async function i9s(t,e,r,n,o,s){let c=new Map,l=a(d=>{for(let f of d)c.has(f.name)||c.set(f.name,f)},"add"),u=e?.mcpServers;if(lct(u)&&l(vlr(r,{mcpServers:u},t,n)),c.size===0){let d=lct(u)?uhe(void 0):uhe(u),f=sct(t,t9s,d,o);for(let h of f){let m=await DWn(h,s);m&&l(vlr(h,m,t,n))}}return[...c.values()].sort((d,f)=>d.name.localeCompare(f.name))}a(i9s,"readMcpServers");p();var NWn=require("fs"),Rlr=fe(require("path"));var o9s=new Set(["installed.json","enablement.json"]);function klr(t){return(e,r)=>{let n=fg(e.path);return Rlr.posix.dirname(n)===r&&t.has(Rlr.posix.basename(n))}}a(klr,"matchNamedFiles");var MWn=klr(o9s),X2e=class{constructor(e,r,n,o,s=50){this.ctx=e;this.dir=r;this.debounceMs=s;this.logger=new pe("PluginFileWatcher");this._onDidChange=new yu;this.onDidChange=this._onDidChange.event;this._disposed=!1;this._dirKey=fg(r),this._recursive=n.recursive??!1,this._createDir=n.createDir??!0,this._matches=n.matches,this._watcher=o??uYe(e),this._ownsWatcher=o===void 0}static{a(this,"PluginFileWatcher")}async start(){if(!this._disposed)try{if(this._createDir)await NWn.promises.mkdir(this.dir,{recursive:!0,mode:448});else if(!await Jd(this.dir))return;if(this._disposed)return;this._changeSubscription=this._watcher.onDidChange(e=>this.onEvents(e)),this._watchHandle=this._watcher.watch({path:this.dir,recursive:this._recursive})}catch(e){this.logger.warn(this.ctx,"failed to start watching plugin dir",{dir:this.dir,err:String(e)})}}onEvents(e){this._disposed||e.some(r=>this._matches(r,this._dirKey))&&this.scheduleFire()}scheduleFire(){this._debounceTimer===void 0&&(this._debounceTimer=setTimeout(()=>{this._debounceTimer=void 0,this._disposed||this._onDidChange.fire()},this.debounceMs))}dispose(){this._disposed||(this._disposed=!0,this._debounceTimer!==void 0&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0),this._watchHandle?.dispose(),this._changeSubscription?.dispose(),this._ownsWatcher&&this._watcher.dispose(),this._onDidChange.dispose())}};p();var OWn=require("fs"),LWn=fe(require("path"));var s9s=new pe("plugins.git"),a9s=12e4,uct=class{constructor(e){this.ctx=e;this.gitInstances=new Map}static{a(this,"PluginGitService")}async cloneRepository(e,r,n){try{let o=LWn.dirname(r);await OWn.promises.mkdir(o,{recursive:!0,mode:448}),await(await this.instanceFor(o)).clone(e,r)}catch(o){throw s9s.warn(this.ctx,`clone failed for ${NF(e)}`,o),new rfe(e,o)}}async checkout(e,r,n){await(await this.instanceFor(e)).checkout(n?["--detach",r]:[r])}async pull(e){if(!await this.isOnBranch(e))return!1;let r=await this.instanceFor(e),n=await this.revParse(e,"HEAD").catch(()=>{});await r.pull();let o=await this.revParse(e,"HEAD").catch(()=>{});return n!==o}async isOnBranch(e){let n=(await(await this.instanceFor(e)).raw(["rev-parse","--abbrev-ref","HEAD"])).trim();return n!==""&&n!=="HEAD"}async revParse(e,r){return(await(await this.instanceFor(e)).revparse([r])).trim()}async fetch(e){await(await this.instanceFor(e)).fetch()}async revListCount(e,r,n){let s=(await(await this.instanceFor(e)).raw(["rev-list","--count",`${r}..${n}`])).trim(),c=Number.parseInt(s,10);return Number.isFinite(c)?c:0}async instanceFor(e){let r=this.gitInstances.get(e);return r||(this._binary===void 0&&(this._binary=(await mO()).path),r=tde({baseDir:e,binary:this._binary,unsafe:{allowUnsafeCustomBinary:!0},timeout:{block:a9s}}),this.gitInstances.set(e,r)),r}forget(e){this.gitInstances.delete(e)}dispose(){this.gitInstances.clear()}};p();var dct=class{constructor(e,r){this.repository=e;this.marketplace=r}static{a(this,"PluginInstallService")}async acquirePlugin(e){let r=await this.repository.ensurePluginSource(e);if(!await Jd(r))throw new rfe(e.marketplaceReference.cloneUrl,"plugin content not found after acquisition");return r}async resolveFromSource(e){let r=await this.repository.ensureRepository(e),n=await this.marketplace.readPluginsFromDirectory(r,e);if(n.length>0)return{reference:e,plugins:n,isSinglePluginRepo:!1};let o=await this.marketplace.readSinglePluginManifest(r,e);return o?{reference:e,plugins:[o],isSinglePluginRepo:!0}:{reference:e,plugins:[],isSinglePluginRepo:!1}}async resolveInstalled(e){let r=FT(e.marketplace);if(!r)return;let n=this.repository.getRepositoryUri(r);if(await Jd(n)){let s=(await this.marketplace.readPluginsFromDirectory(n,r)).find(l=>l.name===e.name);if(s)return s;let c=await this.marketplace.readSinglePluginManifest(n,r);if(c)return c}if(r.kind==="githubShorthand"&&r.githubRepo)return BWn({kind:"github",repo:r.githubRepo},r,e.name);if(r.kind==="gitUri")return BWn({kind:"url",url:r.cloneUrl},r,e.name)}};function BWn(t,e,r){return{name:r,description:"",version:"",sourceDescriptor:t,marketplace:e.displayLabel,marketplaceReference:e,marketplaceType:"openPlugin"}}a(BWn,"synthesizePlugin");p();p();var c9s=new pe("plugins.catalog");function Plr(t,e,r,n){return Array.isArray(t.plugins)?t.plugins.filter(s=>s!=null&&typeof s.name=="string"&&s.name.length>0).flatMap(s=>{let c=s.name,l=l9s(s.source,t.metadata?.pluginRoot,c,n);return l?[{name:c,description:typeof s.description=="string"?s.description:"",version:typeof s.version=="string"?s.version:"",sourceDescriptor:l,marketplace:e.displayLabel,marketplaceReference:e,marketplaceType:r}]:[]}):[]}a(Plr,"parseMarketplaceCatalog");function l9s(t,e,r,n){let o=a(s=>{n&&c9s.warn(n,`skipping plugin '${r}': ${s}`)},"skip");if(t==null||typeof t=="string"){let c=u9s(typeof e=="string"?e:void 0,t??"");return c===void 0?o("could not resolve relative source path"):{kind:"relativePath",path:c}}if(typeof t!="object"||typeof t.source!="string")return o("source object is missing a 'source' discriminant");switch(t.source){case"github":return typeof t.repo!="string"||!t.repo?o("github source is missing required 'repo' field"):f9s(t.repo)?!phe(t.ref)||!phe(t.path)?o("github source 'ref'/'path' must be strings when provided"):UWn(t.sha)?{kind:"github",repo:t.repo,ref:t.ref,sha:t.sha,path:t.path}:o("github source 'sha' must be a 40-character commit hash when provided"):o("github source 'repo' must be in 'owner/repo' format");case"url":case"git-subdir":return typeof t.url!="string"||!t.url?o(`${t.source} source is missing required 'url' field`):t.source==="url"&&!t.url.toLowerCase().endsWith(".git")?o("url source must end with '.git'"):phe(t.ref)?UWn(t.sha)?t.source==="git-subdir"&&(typeof t.path!="string"||!t.path)?o("git-subdir source is missing required 'path' field"):t.source==="url"&&!phe(t.path)?o("url source 'path' must be a string when provided"):{kind:"url",url:t.url,ref:t.ref,sha:t.sha,path:t.path}:o(`${t.source} source 'sha' must be a 40-character commit hash when provided`):o(`${t.source} source 'ref' must be a string when provided`);case"npm":case"pip":return typeof t.package!="string"||!t.package?o(`${t.source} source is missing required 'package' field`):!phe(t.version)||!phe(t.registry)?o(`${t.source} source 'version'/'registry' must be strings when provided`):{kind:t.source==="npm"?"npm":"pip",package:t.package,version:t.version,registry:t.registry};default:return o(`unknown source kind '${t.source}'`)}}a(l9s,"parsePluginSource");function u9s(t,e){let r=FWn(t??""),n=FWn(e);return r&&(n===r||n.startsWith(`${r}/`))?n:d9s(`/${r}/${n}`).replace(/^\/+/,"")}a(u9s,"resolvePluginSource");function FWn(t){return t.trim().replace(/\\/g,"/").replace(/^\.?\/+/,"").replace(/\/+$/g,"")}a(FWn,"normalizeMarketplacePath");function d9s(t){let e=[];for(let r of t.split("/"))r===""||r==="."||(r===".."?e.pop():e.push(r));return`/${e.join("/")}`}a(d9s,"posixNormalize");function phe(t){return t===void 0||typeof t=="string"}a(phe,"isOptionalString");function UWn(t){return t===void 0||typeof t=="string"&&/^[0-9a-fA-F]{40}$/.test(t)}a(UWn,"isOptionalGitSha");function f9s(t){return/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(t)}a(f9s,"isValidGitHubRepo");var tDe=fe(require("path"));var hhe=new pe("plugins.marketplace"),p9s=480*60*1e3,h9s=3e4,m9s=15e4,QWn=[{type:"openPlugin",path:"marketplace.json"},{type:"openPlugin",path:".plugin/marketplace.json"},{type:"copilot",path:".github/plugin/marketplace.json"},{type:"claude",path:".claude-plugin/marketplace.json"}],g9s=[{type:"openPlugin",path:".plugin/plugin.json"},{type:"claude",path:".claude-plugin/plugin.json"},{type:"copilot",path:"plugin.json"}],fct=class{constructor(e,r){this.ctx=e;this.repository=r;this.githubCatalogCache=new Map}static{a(this,"PluginMarketplaceService")}async fetchMarketplacePlugins(e,r){let n=await Promise.all(e.map(o=>this.fetchOneBounded(o,r)));return{plugins:n.flatMap(o=>o.plugins),errors:n.flatMap(o=>o.error?[o.error]:[])}}fetchOneBounded(e,r){let n=e.kind==="githubShorthand"&&e.githubRepo?this.fetchFromGitHubRepo(e,e.githubRepo,r):this.fetchFromClonedRepo(e,r);return this.withReferenceDeadline(n,e,r)}withReferenceDeadline(e,r,n){return new Promise(o=>{let s=!1,c=a(d=>{s||(s=!0,clearTimeout(l),u?.dispose(),o(d))},"finish"),l=setTimeout(()=>{hhe.debug(this.ctx,"marketplace fetch exceeded deadline",{reference:r.rawValue}),c({plugins:[],error:y9s(r)})},m9s);l.unref?.();let u=n?.onCancellationRequested(()=>c({plugins:[]}));n?.isCancellationRequested&&c({plugins:[]}),e.then(c,d=>c({plugins:[],error:qWn(r,d)}))})}async readPluginsFromDirectory(e,r,n){return this.readPluginsFromDefinitions(r,async o=>{if(!n?.isCancellationRequested)return lhe(tDe.join(e,o))},e)}async readAllPluginsFromDirectory(e,r,n){let o=new Map;for(let s of QWn){if(n?.isCancellationRequested)return[];let c=await lhe(tDe.join(e,s.path));if(!(!c?.plugins||!Array.isArray(c.plugins)))for(let l of Plr(c,r,s.type,this.ctx))o.has(l.name)||o.set(l.name,jWn(l,e))}return[...o.values()]}async readSinglePluginManifest(e,r){if(!(r.kind!=="githubShorthand"&&r.kind!=="gitUri")){for(let n of g9s){let o=await lhe(tDe.join(e,n.path));if(!o||typeof o!="object"||Array.isArray(o))continue;let s=r.kind==="githubShorthand"?{kind:"github",repo:r.githubRepo}:{kind:"url",url:r.cloneUrl};return{name:typeof o.name=="string"&&o.name?o.name:r.displayLabel,description:typeof o.description=="string"?o.description:"",version:typeof o.version=="string"?o.version:"",sourceDescriptor:s,marketplace:r.displayLabel,marketplaceReference:r,marketplaceType:n.type,readmeUri:r.githubRepo?$Wn(r.githubRepo,""):GWn(e,"")}}hhe.debug(this.ctx,"no single-plugin manifest found",{reference:r.rawValue})}}clearCache(){this.githubCatalogCache.clear()}async fetchFromGitHubRepo(e,r,n){let o=this.getCachedCatalog(e.canonicalId);if(o)return{plugins:o.map(d=>E9s(d,e))};let s=!0,c,l=encodeURIComponent(e.ref??"main"),u=await this.readPluginsFromDefinitions(e,async d=>{if(n?.isCancellationRequested)return;let f=`https://raw.githubusercontent.com/${r}/${l}/${d}`,h=A9s(n);try{let m=await this.ctx.get(nr).fetch(f,{method:"GET",timeout:h9s,signal:h.signal});if(m.status!==200){m.status>=500&&(c=m.status),s&&=m.status>=400&&m.status<500;return}return J2e(await m.text())}catch(m){hhe.debug(this.ctx,"raw marketplace fetch failed",{url:f,err:String(m)});return}finally{h.dispose()}});return u.length>0?(this.setCachedCatalog(e.canonicalId,u),{plugins:u}):s?(hhe.debug(this.ctx,"repo may be private; falling back to clone",{repo:r}),this.fetchFromClonedRepo(e,n)):c!==void 0?{plugins:[],error:{reference:e.displayLabel,canonicalId:e.canonicalId,kind:"unavailable",status:c,message:`Marketplace '${e.displayLabel}' is temporarily unavailable (HTTP ${c})`}}:{plugins:[]}}async fetchFromClonedRepo(e,r){if(r?.isCancellationRequested)return{plugins:[]};let n;try{n=await this.repository.ensureRepository(e)}catch(o){return hhe.debug(this.ctx,"failed to prepare marketplace repository",{reference:e.rawValue,err:String(o)}),{plugins:[],error:qWn(e,o)}}return{plugins:await this.readPluginsFromDirectory(n,e,r)}}async readPluginsFromDefinitions(e,r,n){for(let o of QWn){let s=await r(o.path);if(!(!s?.plugins||!Array.isArray(s.plugins)))return Plr(s,e,o.type,this.ctx).map(c=>jWn(c,n))}return hhe.debug(this.ctx,"no marketplace catalog found",{reference:e.rawValue}),[]}now(){return this.ctx.get(IC).now().getTime()}getCachedCatalog(e){let r=this.githubCatalogCache.get(e);if(r){if(r.expiresAt<=this.now()){this.githubCatalogCache.delete(e);return}return r.plugins}}setCachedCatalog(e,r){this.githubCatalogCache.set(e,{plugins:r,expiresAt:this.now()+p9s})}};function A9s(t){let e={dispose(){}};if(!t)return e;let r=new AbortController;if(t.isCancellationRequested)return r.abort(),{signal:r.signal,...e};let n=t.onCancellationRequested(()=>r.abort());return{signal:r.signal,dispose:a(()=>n.dispose(),"dispose")}}a(A9s,"abortSignalFor");function y9s(t){return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:"unavailable",message:`Marketplace '${t.displayLabel}' did not respond in time`}}a(y9s,"deadlineError");function qWn(t,e){let r=e instanceof Error?e.message:String(e),n=e instanceof nfe?"localMissing":"cloneFailed";return{reference:t.displayLabel,canonicalId:t.canonicalId,kind:n,message:r}}a(qWn,"toFetchError");function E9s(t,e){return{...t,marketplace:e.displayLabel,marketplaceReference:e}}a(E9s,"restamp");function jWn(t,e){let r=t.sourceDescriptor.kind==="relativePath"?t.sourceDescriptor.path:"",n=e?GWn(e,r):$Wn(t.marketplaceReference.githubRepo??"",r);return{...t,readmeUri:n}}a(jWn,"withReadme");function HWn(t){let e=t.trim().replace(/^\.?\/+|\/+$/g,"");return e?`${e}/README.md`:"README.md"}a(HWn,"readmeRelPath");function GWn(t,e){return tDe.join(t,HWn(e))}a(GWn,"fileReadmeUri");function $Wn(t,e){return`https://github.com/${t}/blob/main/${HWn(e)}`}a($Wn,"githubBlobReadmeUri");p();p();var mhe=require("fs"),VWn=fe(require("path"));var _9s=1e4,v9s=3e4,C9s=25;async function ghe(t,e){await mhe.promises.mkdir(VWn.dirname(t),{recursive:!0,mode:448});let r=Date.now()+v9s;for(;;)try{await mhe.promises.writeFile(t,`${process.pid} +`,{flag:"wx",mode:384});break}catch(n){if(n.code!=="EEXIST")throw n;if(Date.now()>r)throw new Error(`withFileLock: timed out acquiring lock ${JSON.stringify(t)}`);await b9s(t)>_9s&&await mhe.promises.rm(t,{force:!0}).catch(()=>{}),await MC(C9s)}try{return await e()}finally{await mhe.promises.rm(t,{force:!0}).catch(()=>{})}}a(ghe,"withFileLock");async function b9s(t){try{let e=await mhe.promises.stat(t);return Date.now()-e.mtimeMs}catch{return 1/0}}a(b9s,"lockAgeMs");p();var Ahe=require("fs"),vX=fe(require("path"));var S9s=new pe("plugins.source"),T9s=0,WWn=".clone-tmp";function I9s(t){try{return process.kill(t,0),!0}catch(e){return e.code==="EPERM"}}a(I9s,"isProcessAlive");async function x9s(t){let e=vX.dirname(t),r=`${vX.basename(t)}.`,n;try{n=await Ahe.promises.readdir(e)}catch{return}await Promise.all(n.map(async o=>{if(!o.startsWith(r)||!o.endsWith(WWn))return;let s=Number.parseInt(o.slice(r.length).split(".")[0],10);!Number.isInteger(s)||s<=0||s===process.pid||I9s(s)||await Ahe.promises.rm(vX.join(e,o),{recursive:!0,force:!0}).catch(()=>{})}))}a(x9s,"sweepOrphanedCloneTemps");async function Dlr(t,e,r,n,o){if(await Jd(r))return;await x9s(r);let s=`${r}.${process.pid}.${T9s++}${WWn}`;try{await t.git.cloneRepository(e,s,n),o?await t.git.checkout(s,o,!0):n&&await t.git.checkout(s,n),await ghe(`${r}.lock`,async()=>{await Jd(r)||(await Ahe.promises.mkdir(vX.dirname(r),{recursive:!0,mode:448}),await Ahe.promises.rename(s,r))})}finally{t.git.forget(s),await Ahe.promises.rm(s,{recursive:!0,force:!0}).catch(()=>{})}}a(Dlr,"cloneIntoPlace");var pct=class{constructor(){this.kind="relativePath"}static{a(this,"RelativePathPluginSource")}getInstallUri(){throw new Error("Use PluginRepositoryService.getPluginInstallUri() for relative-path sources")}ensure(){throw new Error("Use PluginRepositoryService.ensureRepository() for relative-path sources")}update(){throw new Error("Use PluginRepositoryService.pullRepository() for relative-path sources")}getCleanupTarget(){}getLabel(e){return e.path||"."}},hct=class{constructor(e){this.deps=e}static{a(this,"AbstractGitPluginSource")}getCleanupTarget(e,r){return this.getRepoDir(e,r)}async ensure(e,r){let n=r.sourceDescriptor,o=this.getRepoDir(e,n);return await Jd(o)?await this.checkoutRevision(o,n):await Dlr(this.deps,this.cloneUrl(n),o,n.ref,n.sha),this.getInstallUri(e,n)}async update(e,r){let n=r.sourceDescriptor,o=this.getRepoDir(e,n);if(!await Jd(o))return S9s.warn(this.deps.ctx,`cannot update '${r.name}': source repository not cloned`,{repoDir:o}),!1;if(!n.sha&&await this.deps.git.isOnBranch(o)){let l=await this.deps.git.pull(o);return await this.checkoutRevision(o,n),l}let s=await this.deps.git.revParse(o,"HEAD").catch(()=>{});await this.deps.git.fetch(o),await this.checkoutRevision(o,n);let c=await this.deps.git.revParse(o,"HEAD").catch(()=>{});return s!==c}async checkoutRevision(e,r){r.sha?await this.deps.git.checkout(e,r.sha,!0):r.ref&&await this.deps.git.checkout(e,r.ref)}},mct=class extends hct{constructor(){super(...arguments);this.kind="github"}static{a(this,"GitHubPluginSource")}getInstallUri(r,n){let o=n;return G2e(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n,[s,c]=o.repo.split("/");return H2e(r,["github.com",BT(s),BT(c),...Jat(o.ref,o.sha)])}getLabel(r){let n=r;return n.path?`${n.repo}/${n.path}`:n.repo}cloneUrl(r){return`https://github.com/${r.repo}.git`}},gct=class extends hct{constructor(){super(...arguments);this.kind="url"}static{a(this,"GitUrlPluginSource")}getInstallUri(r,n){let o=n;return G2e(this.getRepoDir(r,o),o.path)}getRepoDir(r,n){let o=n;return H2e(r,KVn(o.url,o.ref,o.sha))}getLabel(r){let n=r;return n.path?`${n.url}/${n.path}`:n.url}cloneUrl(r){return r.url}};var rDe=require("fs"),CX=fe(require("path"));var w9s=0,Act=class{constructor(e,r,n){this.ctx=e;this.store=r;this.git=n;this.logger=new pe("plugins.repository");this.cloneSequencer=new Xx;this.cacheRoot=r.sharedContentDir;let o={ctx:e,git:n};this.sources=new Map([["relativePath",new pct],["github",new mct(o)],["url",new gct(o)]])}static{a(this,"PluginRepositoryService")}getPluginSource(e){let r=this.sources.get(e);if(!r)throw new cnt(e);return r}getRepositoryUri(e){return e.kind==="localFileUri"&&e.localRepositoryUri?e.localRepositoryUri:H2e(this.cacheRoot,e.cacheSegments)}getPluginInstallUri(e){let r=e.sourceDescriptor;if(r.kind!=="relativePath")return this.getPluginSourceInstallUri(r);let n=this.getRepositoryUri(e.marketplaceReference);return G2e(n,r.path)}getPluginSourceInstallUri(e){return this.getPluginSource(e.kind).getInstallUri(this.cacheRoot,e)}async ensureRepository(e){let r=this.getRepositoryUri(e);return this.cloneSequencer.queue(r,async()=>{if(await Jd(r))return r;if(e.kind==="localFileUri")throw new nfe(r);return await Dlr({ctx:this.ctx,git:this.git},e.cloneUrl,r,e.ref),r})}async ensurePluginSource(e){return e.sourceDescriptor.kind==="relativePath"?(await this.ensureRepository(e.marketplaceReference),this.getPluginInstallUri(e)):this.getPluginSource(e.sourceDescriptor.kind).ensure(this.cacheRoot,e)}async updatePluginSource(e){return e.sourceDescriptor.kind==="relativePath"?this.pullRepository(e.marketplaceReference):this.getPluginSource(e.sourceDescriptor.kind).update(this.cacheRoot,e)}async pullRepository(e){if(e.kind==="localFileUri")return!1;let r=this.getRepositoryUri(e);return await Jd(r)?this.git.pull(r):(this.logger.warn(this.ctx,"cannot pull: repository not cloned",{repoDir:r}),!1)}async fetchRepository(e){if(e.kind==="localFileUri")return!1;let r=this.getRepositoryUri(e);if(!await Jd(r))return!1;try{return await this.git.fetch(r),await this.git.revListCount(r,"HEAD","@{u}")>0}catch(n){return this.logger.debug(this.ctx,"silent fetch failed",{repoDir:r,err:String(n)}),!1}}async cleanupPluginSource(e){let r=this.sources.get(e.sourceDescriptor.kind);if(!r)return;let n=r.getCleanupTarget(this.cacheRoot,e.sourceDescriptor);if(!n||!RE(this.cacheRoot,n))return;let o=!1,s=`${n}.gc-${process.pid}-${w9s++}`;if(await ghe(`${n}.lock`,async()=>{if(await this.isCloneReferenced(n)){this.logger.info(this.ctx,"skipping cleanup: clone still referenced by another editor",{cleanupDir:n});return}try{await Jd(n)&&await rDe.promises.rename(n,s),o=!0}catch(c){this.logger.warn(this.ctx,"failed to vacate plugin clone",{cleanupDir:n,err:String(c)})}}),!!o){try{await rDe.promises.rm(s,{recursive:!0,force:!0}),this.logger.info(this.ctx,"removed plugin clone",{cleanupDir:n})}catch(c){this.logger.warn(this.ctx,"failed to remove vacated plugin clone",{tombstone:s,err:String(c)})}await this.pruneEmptyParents(n).catch(c=>this.logger.warn(this.ctx,"failed to prune empty parents",{cleanupDir:n,err:String(c)}))}}async isCloneReferenced(e){return(await this.store.readInstalledForAllEditors()).some(n=>{let o=CX.isAbsolute(n.pluginUri)?n.pluginUri:CX.resolve(this.cacheRoot,n.pluginUri);return RE(e,o)})}async pruneEmptyParents(e){let r=CX.dirname(e);for(;RE(this.cacheRoot,r)&&r!==this.cacheRoot;){try{if((await rDe.promises.readdir(r)).length>0)break;await rDe.promises.rmdir(r)}catch{break}r=CX.dirname(r)}}};p();p();function zWn(t){if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.pluginUri=="string"&&typeof e.name=="string"&&typeof e.marketplace=="string"}a(zWn,"isInstalledEntry");var vH=require("fs"),F2=fe(require("path"));var YWn="plugins",D9s="plugins",N9s="installed.json",M9s="enablement.json",O9s="marketplaces.json",L9s=".lock",B9s=0,KWn=a(t=>typeof t=="string","isString"),nDe=class t{constructor(e){this.rootDir=e}static{a(this,"PluginStore")}get sharedContentDir(){return F2.join(this.rootDir,YWn)}editorPluginsDir(e){return F2.join(this.rootDir,this.safeEditorSegment(e),D9s)}installedJsonPath(e){return F2.join(this.editorPluginsDir(e),N9s)}enablementJsonPath(e){return F2.join(this.editorPluginsDir(e),M9s)}marketplacesJsonPath(e){return F2.join(this.editorPluginsDir(e),O9s)}async readInstalled(e){let{version:r,items:n}=await this.readManifest(this.installedJsonPath(e),"installed",1,zWn);return{version:r,installed:n}}async readEnablement(e){let{version:r,items:n}=await this.readManifest(this.enablementJsonPath(e),"disabled",1,KWn);return{version:r,disabled:n}}async readMarketplaces(e){let{version:r,items:n}=await this.readManifest(this.marketplacesJsonPath(e),"marketplaces",1,KWn);return{version:r,marketplaces:n}}async readManifest(e,r,n,o){let s=await this.readJson(e),c=s?.[r];return Array.isArray(c)?{version:typeof s?.version=="number"?s.version:n,items:c.filter(o)}:{version:n,items:[]}}async writeInstalled(e,r){await this.writeJsonAtomic(this.installedJsonPath(e),r)}async writeEnablement(e,r){await this.writeJsonAtomic(this.enablementJsonPath(e),r)}async writeMarketplaces(e,r){await this.writeJsonAtomic(this.marketplacesJsonPath(e),r)}async withLock(e,r){let n=F2.join(this.editorPluginsDir(e),L9s);return ghe(n,r)}async listEditorIds(){let e;try{e=await vH.promises.readdir(this.rootDir,{withFileTypes:!0})}catch{return[]}let r=e.filter(o=>(o.isDirectory()||o.isSymbolicLink())&&t.isSafeEditorId(o.name)),n=await Promise.all(r.map(o=>vH.promises.stat(this.installedJsonPath(o.name)).then(s=>s.isFile(),()=>!1)));return r.filter((o,s)=>n[s]).map(o=>o.name)}async readInstalledForAllEditors(){let e=await this.listEditorIds();return(await Promise.all(e.map(n=>this.readInstalled(n)))).flatMap(n=>n.installed)}static isSafeEditorId(e){return!(!e||e==="."||e===".."||e.toLowerCase()===YWn||e!==F2.basename(e)||/[/\\]/.test(e)||process.platform==="win32"&&/[<>:"|?*]/.test(e))}safeEditorSegment(e){if(!t.isSafeEditorId(e))throw new Error(`PluginStore: unsafe editorId ${JSON.stringify(e)}`);return e}async readJson(e){try{let r=await vH.promises.readFile(e,{encoding:"utf8"});return JSON.parse(r)}catch{return}}async writeJsonAtomic(e,r){let n=F2.dirname(e);await vH.promises.mkdir(n,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${B9s++}.tmp`,s=JSON.stringify(r,null,2)+` +`;try{await vH.promises.writeFile(o,s,{encoding:"utf8",mode:384}),await vH.promises.rename(o,e)}catch(c){throw await vH.promises.rm(o,{force:!0}).catch(()=>{}),c}}};var XWn=require("os"),yhe=fe(require("path"));var JWn={hooks:[],commands:[],skills:[],agents:[],instructions:[],mcpServerDefinitions:[]},ZWn=new Set,F9s=new Set(fhe.filter(t=>t.changeSignal).map(t=>t.name)),dc=class{constructor(e,r,n=50,o=(0,XWn.homedir)(),s=process.env.COPILOT_HOME||yhe.join(o,blr)){this.ctx=e;this.watchDebounceMs=n;this.userHome=o;this.copilotHome=s;this.logger=new pe("AgentPluginService");this._onDidChangePlugins=new yu;this.onDidChangePlugins=a((e,r,n)=>(this.ensureWatching(),this._onDidChangePlugins.event(e,r,n)),"onDidChangePlugins");this.mutationSequencer=new Xx;this._sourceWatchers=[];this._sourceSubscriptions=[];this._watchStarted=!1;this._disposed=!1;this._lastSourceListings=new Map;this._injectedWatcher=r,this.ensureWatching()}static{a(this,"AgentPluginService")}get store(){return this._store||(this._store=new nDe(this.ctx.get(ti).directory)),this._store}get repository(){return this._repository||(this._git??=new uct(this.ctx),this._repository=new Act(this.ctx,this.store,this._git)),this._repository}get marketplace(){return this._marketplace||(this._marketplace=new fct(this.ctx,this.repository)),this._marketplace}get install(){return this._install||(this._install=new dct(this.repository,this.marketplace)),this._install}get editorId(){return this.ctx.get(Ir).getEditorIdentity().editorId}guardEditorId(e){let r=this.editorId;if(nDe.isSafeEditorId(r))return r;this.logger.warn(this.ctx,`${e} skipped: unsafe editorId`,{editorId:r})}async listPlugins(){this.ensureWatching();let e=this.guardEditorId("listPlugins");if(e===void 0)return[];let[{installed:r},{disabled:n}]=await Promise.all([this.store.readInstalled(e),this.store.readEnablement(e)]),o=new Set(n),s=await wWn(this.discoveryDeps(r)),c=await FS(s,cct,l=>this.toPlugin(l,o));return c.sort((l,u)=>l.uri.localeCompare(u.uri)),c}async toPlugin(e,r){let n=await this.readContributionsSafely(e),o=e.fromMarketplace?.name||n.manifestName||e.displayName||yhe.basename(e.fsPath);return{uri:e.uri,label:o,enabled:!r.has(e.uri),hooks:n.hooks,commands:n.commands,skills:n.skills,agents:n.agents,instructions:n.instructions,mcpServerDefinitions:n.mcpServerDefinitions,...e.fromMarketplace&&{fromMarketplace:e.fromMarketplace}}}readContributionsSafely(e){let r=(async()=>{let n=await hWn(e.fsPath);return PWn(e.fsPath,n,{userHome:this.userHome,...e.repositoryBoundary!==void 0&&{repositoryBoundary:e.repositoryBoundary}})})().catch(n=>(this.logger.debug(this.ctx,"listPlugins: reading contributions failed",{uri:e.uri,err:String(n)}),JWn));return k3(r,act,JWn)}discoveryRoots(){return{sharedContentDir:this.store.sharedContentDir,copilotHome:this.copilotHome}}isReadOnlyPlugin(e){return xlr(e,this.copilotHome)}discoveryDeps(e){let r=new Map;return{...this.discoveryRoots(),installed:e,getRepositoryUri:a(n=>this.repository.getRepositoryUri(n),"getRepositoryUri"),resolveMarketplace:a(n=>this.resolveMarketplaceForList(n,r),"resolveMarketplace")}}resolveMarketplaceForList(e,r){let n=FT(e.marketplace);if(!n)return Promise.resolve(void 0);let o=(async()=>{let s=this.repository.getRepositoryUri(n),c=await this.readMarketplacePluginFromDir(s,n,e.name,r);if(c)return c;if(e.pluginUri&&e.pluginUri!==s)return await this.readMarketplacePluginFromDir(e.pluginUri,n,e.name)})().catch(s=>{this.logger.debug(this.ctx,"listPlugins: resolving marketplace metadata failed",{pluginUri:e.pluginUri,err:String(s)})});return k3(o,act,void 0)}async readMarketplacePluginFromDir(e,r,n,o){if(!await Jd(e))return;let s=o?.get(e);s||(s=this.marketplace.readAllPluginsFromDirectory(e,r),o?.set(e,s));let l=(await s).find(u=>u.name===n);return l||(await this.marketplace.readSinglePluginManifest(e,r)??void 0)}async enablePlugin(e){await this.setPluginEnabled(e,!0)}async disablePlugin(e){await this.setPluginEnabled(e,!1)}async setPluginEnabled(e,r){this.ensureWatching(),await this.mutate(async n=>{let o=await this.store.readEnablement(n),s=o.disabled.includes(e);if(r===!s)return!1;let c=r?o.disabled.filter(l=>l!==e):[...o.disabled,e];return await this.store.writeEnablement(n,{...o,disabled:c}),this.logger.info(this.ctx,`${r?"enabled":"disabled"} plugin`,{pluginUri:e}),!0})}async mutate(e){let r=this.guardEditorId("mutation");if(r===void 0)return;await this.mutationSequencer.queue(r,()=>this.store.withLock(r,()=>e(r)))&&await this.refreshAndMaybeFire(ZWn)}async reconcile(){this.ensureWatching();let e=this.guardEditorId("reconcile");if(e===void 0)return;let r=await this.store.readInstalled(e),n=await Promise.all(r.installed.map(s=>this.shouldDrop(s))),o=new Set(r.installed.filter((s,c)=>n[c]).map(s=>s.pluginUri));o.size!==0&&await this.mutate(async s=>{let c=await this.store.readInstalled(s),l=await Promise.all(c.installed.map(f=>o.has(f.pluginUri)?this.shouldDrop(f):Promise.resolve(!1))),u=c.installed.filter((f,h)=>!l[h]),d=c.installed.filter((f,h)=>l[h]);for(let f of d)this.logger.info(this.ctx,"reconcile dropped missing plugin",{name:f.name,pluginUri:f.pluginUri});return d.length===0?!1:(await this.store.writeInstalled(s,{...c,installed:u}),await this.pruneEnablement(s,d.map(f=>f.pluginUri)),!0)})}async pruneEnablement(e,r){let n=new Set(r),o=await this.store.readEnablement(e),s=o.disabled.filter(c=>!n.has(c));s.length!==o.disabled.length&&await this.store.writeEnablement(e,{...o,disabled:s})}async shouldDrop(e){return yhe.isAbsolute(e.pluginUri)?Ilr(e.pluginUri):!1}ensureWatching(){if(this._watchStarted||this._disposed||!this.ctx.get(Ir).isEditorPluginInfoKnown())return;this._watchStarted=!0;let e=this.guardEditorId("plugin watch");if(e===void 0)return;let r=this.store.editorPluginsDir(e);this._fileWatcher=new X2e(this.ctx,r,{matches:MWn},this._injectedWatcher,this.watchDebounceMs),this._watchSubscription=this._fileWatcher.onDidChange(()=>{this.refreshAndMaybeFire(ZWn)});let n=this.discoveryRoots();for(let o of fhe){let s=o.changeSignal;if(!s)continue;let c=new X2e(this.ctx,s.dir(n),{createDir:s.createDir,matches:klr(s.files)},this._injectedWatcher,this.watchDebounceMs);this._sourceSubscriptions.push(c.onDidChange(()=>{this.refreshAndMaybeFire(new Set([o.name]))})),this._sourceWatchers.push(c)}this.seedAndStart()}async seedAndStart(){await this.mutationSequencer.queue(this.editorId,async()=>{if(this._lastStateKey===void 0)try{this._lastStateKey=await this.stateKey(F9s)}catch{}}),!this._disposed&&await Promise.all([this._fileWatcher?.start(),...this._sourceWatchers.map(e=>e.start())])}refreshAndMaybeFire(e){return this.mutationSequencer.queue(this.editorId,async()=>{if(this._disposed)return;let r;try{r=await this.stateKey(e)}catch(n){this.logger.warn(this.ctx,"plugin refresh failed",{err:String(n)});return}r!==this._lastStateKey&&(this._lastStateKey=r,this._onDidChangePlugins.fire())})}async stateKey(e){let r=this.editorId,[{installed:n},{disabled:o}]=await Promise.all([this.store.readInstalled(r),this.store.readEnablement(r)]),s=this.discoveryRoots();for(let l of fhe){let u=l.changeSignal;if(!u||!e.has(l.name)&&this._lastSourceListings.has(l.name))continue;let d=await u.listing(s);d!==void 0&&this._lastSourceListings.set(l.name,d)}let c={};for(let l of fhe)l.changeSignal&&(c[l.name]=[...this._lastSourceListings.get(l.name)??[]].sort());return JSON.stringify({installed:n.map(l=>[l.pluginUri,l.name]).sort((l,u)=>l[0].localeCompare(u[0])||l[1].localeCompare(u[1])),disabled:[...o].sort(),sources:c})}async installPlugin(e){let r=await this.install.acquirePlugin(e);return await this.mutate(async n=>{let o=await this.store.readInstalled(n),s={pluginUri:r,marketplace:e.marketplaceReference.rawValue,name:e.name},c=o.installed.find(u=>u.pluginUri===r);if(c&&c.name===s.name&&c.marketplace===s.marketplace)return!1;let l=c?o.installed.map(u=>u.pluginUri===r?s:u):[...o.installed,s];return await this.store.writeInstalled(n,{...o,installed:l}),this.logger.info(this.ctx,"installed plugin",{pluginUri:r,name:s.name}),!0}),r}async uninstallPlugin(e){let r;if(await this.mutate(async o=>{let s=await this.store.readInstalled(o),c=s.installed.findIndex(u=>u.pluginUri===e);if(c<0)return!1;r=s.installed[c];let l=s.installed.filter((u,d)=>d!==c);return await this.store.writeInstalled(o,{...s,installed:l}),await this.pruneEnablement(o,[e]),this.logger.info(this.ctx,"uninstalled plugin",{pluginUri:e,name:r.name}),!0}),!r)return;let n;try{n=await this.install.resolveInstalled(r)}catch(o){this.logger.warn(this.ctx,"skip clone GC: resolving installed plugin source failed",{pluginUri:e,err:String(o)});return}if(!n){this.logger.debug(this.ctx,"skip clone GC: could not resolve installed plugin source",{pluginUri:e});return}await this.repository.cleanupPluginSource(n).catch(o=>this.logger.warn(this.ctx,"plugin clone cleanup failed",{pluginUri:e,err:String(o)}))}async installPluginFromSource(e,r){let n=FT(e);if(!n)throw new ife(e);let o=await this.install.resolveFromSource(n);if(o.plugins.length===0)return{installed:!1,candidates:[]};let s;if(r!==void 0){if(s=o.plugins.find(l=>l.name===r),!s)return{installed:!1,candidates:o.plugins}}else if(o.plugins.length===1)s=o.plugins[0];else return{installed:!1,candidates:o.plugins};return o.isSinglePluginRepo||await this.addMarketplaceReference(n),{installed:!0,pluginUri:await this.installPlugin(s),plugin:s}}async updatePlugin(e){let r=this.guardEditorId("updatePlugin");if(r===void 0)return!1;let{installed:n}=await this.store.readInstalled(r),o=n.find(l=>l.pluginUri===e);if(!o)return this.logger.warn(this.ctx,"updatePlugin: not installed for this editor",{pluginUri:e}),!1;let s;try{s=await this.install.resolveInstalled(o)}catch(l){return this.logger.warn(this.ctx,"updatePlugin: resolving plugin source failed",{pluginUri:e,err:String(l)}),!1}if(!s)return this.logger.warn(this.ctx,"updatePlugin: could not resolve plugin source",{pluginUri:e}),!1;let c=!1;try{c=await this.repository.updatePluginSource(s)}catch(l){return this.logger.warn(this.ctx,"updatePlugin: pulling latest content failed",{pluginUri:e,err:String(l)}),!1}return c&&this.logger.info(this.ctx,"updated plugin",{pluginUri:e,name:o.name}),c}async addMarketplaceReference(e){await this.mutate(async r=>{let n=await this.store.readMarketplaces(r);return n.marketplaces.some(s=>FT(s)?.canonicalId===e.canonicalId)?!1:(await this.store.writeMarketplaces(r,{...n,marketplaces:[...n.marketplaces,e.rawValue]}),this.logger.info(this.ctx,"registered marketplace",{reference:e.rawValue}),!0)})}async listMarketplaces(){let e=this.guardEditorId("listMarketplaces");if(e===void 0)return[];let{marketplaces:r}=await this.store.readMarketplaces(e);return JVn(r)}async addMarketplace(e){let r=FT(e);if(!r)throw new ife(e,"marketplace source");await this.addMarketplaceReference(r)}async removeMarketplace(e){let r=FT(e);await this.mutate(async n=>{let o=await this.store.readMarketplaces(n),s=o.marketplaces.filter(c=>c===e?!1:r?FT(c)?.canonicalId!==r.canonicalId:!0);return s.length===o.marketplaces.length?!1:(await this.store.writeMarketplaces(n,{...o,marketplaces:s}),this.logger.info(this.ctx,"removed marketplace",{source:e}),!0)})}async browseMarketplace(e){let r;if(e!==void 0){let n=FT(e);if(!n)throw new ife(e,"marketplace source");r=[n]}else r=await this.listMarketplaces();return this.marketplace.fetchMarketplacePlugins(r)}dispose(){if(!this._disposed){this._disposed=!0,this._watchSubscription?.dispose(),this._fileWatcher?.dispose();for(let e of this._sourceSubscriptions)e.dispose();for(let e of this._sourceWatchers)e.dispose();this._git?.dispose(),this._onDidChangePlugins.dispose()}}};p();function CH(t){try{return Rt(t,ze.EnablePlugins)===!0}catch{return!1}}a(CH,"pluginsEnabled");var yct=fe(require("path"));var bX=new pe("BackgroundAgent.PluginHooks"),Ehe="copilot-plugin",Nlr={SessionStart:"sessionStart",SessionEnd:"sessionEnd",UserPromptSubmit:"userPromptSubmitted",PreToolUse:"preToolUse",PostToolUse:"postToolUse",ErrorOccurred:"errorOccurred"};function U9s(t,e){let r={};for(let o of t)for(let s of o.hooks){let c=Nlr[s.type];if(c!==void 0)for(let l of s.hooks){let u=Mlr(l,e);if(!u)continue;let d=r[c]??=new Map,f=d.get(s.uri);f?f.push(u):d.set(s.uri,[u])}}let n={};for(let[o,s]of Object.entries(r))n[o]=[...s].map(([c,l])=>({source:c,hooks:l}));return n}a(U9s,"groupPluginHooksBySource");async function ezn(t,e){if(!CH(t)||!CJ(t))return{};let r;try{r=(await t.get(dc).listPlugins()).filter(c=>c.enabled)}catch(c){return c instanceof $l?{}:(bX.warn(t,"failed to list plugins for hook injection",{err:String(c)}),{})}if(r.length===0)return{};let n=ln(e.uri),o=U9s(r,n),s={};return o.preToolUse&&(s.preToolUse=[q9s(t,n,o.preToolUse)]),o.postToolUse&&(s.postToolUse=[j9s(t,n,o.postToolUse)]),o.userPromptSubmitted&&(s.userPromptSubmitted=[H9s(t,n,o.userPromptSubmitted)]),o.sessionStart&&(s.sessionStart=[G9s(t,n,o.sessionStart)]),o.sessionEnd&&(s.sessionEnd=[$9s(t,n,o.sessionEnd)]),o.errorOccurred&&(s.errorOccurred=[V9s(t,n,o.errorOccurred)]),s}a(ezn,"buildPluginHookHandlers");function tzn(t,e){let r={...t};return e.preToolUse?.length&&(r.preToolUse=[...t.preToolUse??[],...e.preToolUse]),e.postToolUse?.length&&(r.postToolUse=[...t.postToolUse??[],...e.postToolUse]),e.userPromptSubmitted?.length&&(r.userPromptSubmitted=[...t.userPromptSubmitted??[],...e.userPromptSubmitted]),e.sessionStart?.length&&(r.sessionStart=[...t.sessionStart??[],...e.sessionStart]),e.sessionEnd?.length&&(r.sessionEnd=[...t.sessionEnd??[],...e.sessionEnd]),e.errorOccurred?.length&&(r.errorOccurred=[...t.errorOccurred??[],...e.errorOccurred]),r}a(tzn,"mergePluginHooks");function Mlr(t,e){let r=process.platform==="darwin"?t.osx:process.platform==="linux"?t.linux:void 0,n=t.command??r??t.linux??t.osx,o=t.windows??t.command;if(n===void 0&&o===void 0)return;let s=Q9s(t.cwd,e);return{type:"command",...n!==void 0&&{bash:n},...o!==void 0&&{powershell:o},...s!==void 0&&{cwd:s},...t.env&&{env:t.env},...t.timeout!==void 0&&{timeoutSec:t.timeout}}}a(Mlr,"toCommandHook");function Q9s(t,e){if(t!==void 0)return yct.isAbsolute(t)?t:yct.join(e,t)}a(Q9s,"resolveHookCwd");function _he(t,e){return async r=>{if(CJ(t))return e(r)}}a(_he,"gated");function q9s(t,e,r){return{source:Ehe,handler:_he(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,toolName:n.toolName,toolArgs:U2e(n.toolArgs)};for(let s of r){let c=await new p2(s.source,s.hooks).fire(t,o);for(let l of c){let u=l.output;if(u&&u.permissionDecision===ude.deny)return{permissionDecision:"deny",permissionDecisionReason:u.permissionDecisionReason||"Tool execution denied by plugin hook"}}}return}catch(o){bX.error(t,`Failed to execute plugin PreToolUse hook for tool ${n.toolName}`,o);return}})}}a(q9s,"pluginPreToolUseHandler");function j9s(t,e,r){return{source:Ehe,handler:_he(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,toolName:n.toolName,toolArgs:U2e(n.toolArgs),toolResult:{resultType:elr(n.toolResult.resultType),textResultForLlm:n.toolResult.textResultForLlm}};for(let s of r)await new f2(s.source,s.hooks).fire(t,o)}catch(o){bX.error(t,`Failed to execute plugin PostToolUse hook for tool ${n.toolName}`,o)}})}}a(j9s,"pluginPostToolUseHandler");function H9s(t,e,r){return{source:Ehe,handler:_he(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,prompt:n.prompt};for(let s of r)await new h2(s.source,s.hooks).fire(t,o)}catch(o){bX.error(t,"Failed to execute plugin UserPromptSubmitted hook",o)}})}}a(H9s,"pluginUserPromptSubmittedHandler");function G9s(t,e,r){return{source:Ehe,handler:_he(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,source:n.source,...n.initialPrompt!==void 0&&{initialPrompt:n.initialPrompt}};for(let s of r)await new _J(s.source,s.hooks).fire(t,o)}catch(o){bX.error(t,"Failed to execute plugin SessionStart hook",o)}})}}a(G9s,"pluginSessionStartHandler");function $9s(t,e,r){return{source:Ehe,handler:_he(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,reason:n.reason};for(let s of r)await new EJ(s.source,s.hooks).fire(t,o)}catch(o){bX.error(t,"Failed to execute plugin SessionEnd hook",o)}})}}a($9s,"pluginSessionEndHandler");function V9s(t,e,r){return{source:Ehe,handler:_he(t,async n=>{try{let o={timestamp:n.timestamp,cwd:e,error:{message:n.error.message,name:n.error.name,...n.error.stack!==void 0&&{stack:n.error.stack}}};for(let s of r)await new AF(s.source,s.hooks).fire(t,o)}catch(o){bX.error(t,"Failed to execute plugin ErrorOccurred hook",o)}})}}a(V9s,"pluginErrorOccurredHandler");p();var rzn=fe(require("node:path"));function nzn(t){let e="";for(let r of t){let n=r.codePointAt(0)??0;n>=32&&n!==127&&(e+=r)}return e.trim()}a(nzn,"sanitizeForPrompt");function W9s(t){let e=t.startsWith("file:")?ln(t):t;return nzn(rzn.basename(e))}a(W9s,"confinedBasename");function z9s(t){let e=t.startsWith("file:")?ln(t):t;return nzn(e)}a(z9s,"confinedAbsolutePath");function izn(t){let e=W9s(t),r=z9s(t);return[`You are operating in inline mode for quick, focused code changes. Regardless of any other instructions, you are confined to a single file \u2014 \`${e}\` (absolute path: \`${r}\`) \u2014 and MUST NOT read, create, or modify any other file.`,"Focus on the user's selected code and its immediate context. Make changes grounded directly in the user's prompt: do NOT make changes that are not directly and logically related to it, and do NOT modify code outside the selection unless absolutely necessary for correctness. Keep changes minimal and focused on exactly what was asked.","Be concise: NO wordy explanations, NO progress messages about what you are doing or about to do. Do not ask the user for clarification \u2014 make your best effort.","Note that you may be in inline-ask mode and do not have any edit tools available \u2014 show the code snippet that needs to be changed in a code block. Do not claim to have made edits.",`For edit turns, make all changes in a single invocation of the edit tool \u2014 there is no tool calling loop. Use whichever edit tool you have available (\`edit\`, \`str_replace_editor\`, or \`apply_patch\`) to apply changes to \`${e}\`; follow its schema carefully, include all required properties, and match the existing code exactly. Always use the ABSOLUTE PATH \`${r}\` when supplying a file path or patch header \u2014 never a relative path or bare basename, because the working directory may differ from the project root and a relative path will be denied. If you use \`apply_patch\`, every \`*** Add File\`, \`*** Delete File\`, \`*** Update File\`, and \`*** Move to\` header must spell out the full \`${r}\` \u2014 any patch touching another path will be denied. Never output code to the user instead of editing. Don't repeat yourself after a tool call \u2014 pick up where you left off.`,`You have at most 2 tool-calling turns total. If you need to read the file or check diagnostics, do so in the first turn (e.g. call \`view\` or \`get_errors\` on \`${r}\`). Use the second turn to apply your edit. Do NOT spend additional turns validating or re-reading after editing \u2014 make your best effort in one shot. If you already have the file content and diagnostics in the conversation, skip the first turn and edit immediately. Any tool call beyond the 2-turn limit will be rejected with an error.`,"When the file content is provided in the conversation (in full or as a portion around the cursor), use it directly for your edit \u2014 do NOT re-read it with `view`. If only a portion is shown, line numbers indicate exact positions in the file; use them for your edits. If the user's request targets code outside the shown portion, use `view` to read that part first."].join(` -`)}a(yZn,"buildInlineSystemPrompt");p();function S$s(t){return Ft(t,Ye.EnableSandbox)===!0}a(S$s,"isSandboxEnabled");function Clt(t){if(!S$s(t))return;let e={enabled:!0},r=Ft(t,Ye.SandboxAddCurrentWorkingDirectory);typeof r=="boolean"&&(e.addCurrentWorkingDirectory=r);let n=Ft(t,Ye.SandboxUserPolicy);return typeof n=="object"&&n!==null&&!Array.isArray(n)&&(e.userPolicy=n),e}a(Clt,"getSandboxConfig");p();Mo();var T$s={includeCopilotInstructions:!1,includeGitCommitInstructions:!0,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!1,customIntroduction:"When generating the commit message, please use the following custom instructions provided by the user."};async function ffr(t,e){return t.get(bf).getInstructions(t,e,T$s)}a(ffr,"getGitCommitInstructions");var HX=class{constructor(){this.lastChanges=[];this.attemptCount=0;this.DEFAULT_TEMPERATURE=.1}static{a(this,"GitCommitGenerateService")}buildSystemMessage(e,r){let n=["You are an AI programming assistant, helping a software developer to come up with the best git commit message for their code changes.","You excel in interpreting the purpose behind code changes to craft succinct, clear commit messages that adhere to the repository's guidelines.","","# First, think step-by-step:","1. Analyze the CODE CHANGES thoroughly to understand what's been modified.","2. Identify the purpose of the changes to answer the *why* for the commit messages, also considering the optionally provided RECENT USER COMMITS.","3. Review the provided RECENT REPOSITORY COMMITS to identify established commit message conventions. Focus on the format and style, ignoring commit-specific details like refs, tags, and authors.","4. Generate a thoughtful and succinct commit message for the given CODE CHANGES. It MUST follow the established writing conventions.","5. Remove any meta information like issue references, tags, or author names from the commit message. The developer will add them.","6. Now only show your message, wrapped with a single markdown ```text codeblock! Do not provide any explanations or details"];return r&&n.push(` +`)}a(izn,"buildInlineSystemPrompt");p();function Y9s(t){return Rt(t,ze.EnableSandbox)===!0}a(Y9s,"isSandboxEnabled");function Ect(t){if(!Y9s(t))return;let e={enabled:!0},r=Rt(t,ze.SandboxAddCurrentWorkingDirectory);typeof r=="boolean"&&(e.addCurrentWorkingDirectory=r);let n=Rt(t,ze.SandboxUserPolicy);return typeof n=="object"&&n!==null&&!Array.isArray(n)&&(e.userPolicy=n),e}a(Ect,"getSandboxConfig");p();Mo();var K9s={includeCopilotInstructions:!1,includeGitCommitInstructions:!0,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!1,customIntroduction:"When generating the commit message, please use the following custom instructions provided by the user."};async function Olr(t,e){return t.get(wf).getInstructions(t,e,K9s)}a(Olr,"getGitCommitInstructions");var SX=class{constructor(){this.lastChanges=[];this.attemptCount=0;this.DEFAULT_TEMPERATURE=.1}static{a(this,"GitCommitGenerateService")}buildSystemMessage(e,r){let n=["You are an AI programming assistant, helping a software developer to come up with the best git commit message for their code changes.","You excel in interpreting the purpose behind code changes to craft succinct, clear commit messages that adhere to the repository's guidelines.","","# First, think step-by-step:","1. Analyze the CODE CHANGES thoroughly to understand what's been modified.","2. Identify the purpose of the changes to answer the *why* for the commit messages, also considering the optionally provided RECENT USER COMMITS.","3. Review the provided RECENT REPOSITORY COMMITS to identify established commit message conventions. Focus on the format and style, ignoring commit-specific details like refs, tags, and authors.","4. Generate a thoughtful and succinct commit message for the given CODE CHANGES. It MUST follow the established writing conventions.","5. Remove any meta information like issue references, tags, or author names from the commit message. The developer will add them.","6. Now only show your message, wrapped with a single markdown ```text codeblock! Do not provide any explanations or details"];return r&&n.push(` Current git branch name: ${r}`),e&&n.push(` Respond in the following locale: ${e}`),n.join(` `)}buildUserMessage(e,r){let n=[];return e.userCommits.length>0&&n.push("# RECENT USER COMMITS (For reference only, do not copy!):",e.userCommits.map(o=>`- ${o}`).join(` `),""),e.recentCommits.length>0&&n.push("# RECENT REPOSITORY COMMITS (For reference only, do not copy!):",e.recentCommits.map(o=>`- ${o}`).join(` `),""),n.push("# CODE CHANGES:",e.changes.join(` `),"","","Now generate a commit message that describes the CODE CHANGES.","DO NOT COPY commits from RECENT COMMITS, but use them as reference for the commit style.","ONLY return a single markdown code block, NO OTHER PROSE!","```text","commit message goes here","```",""),r&&n.push("",r,""),n.join(` -`)}updateAttemptCount(e){if(e.length!==this.lastChanges.length){this.attemptCount=0;return}for(let r=0;rt.skills,"pick")},{type:"agent",pick:a(t=>t.agents,"pick")},{type:"instructions",pick:a(t=>t.instructions,"pick")},{type:"prompt",pick:a(t=>t.commands,"pick")}],g8=class{constructor(e,r){this.ctx=e;this.service=r;this.logger=new fe("PluginContributionInjector");this.registered=new Map;this.disposed=!1;this.syncChain=Promise.resolve();this.changeSubscription=this.service.onDidChangePlugins(()=>this.scheduleSync()),this.gateSubscription=this.subscribeToGateChanges()}static{a(this,"PluginContributionInjector")}subscribeToGateChanges(){try{let e=this.ctx.get(Lo);return this.lastPluginsEnabled=W5(this.ctx),e.onDidChangeCopilotSettings(()=>{let r=W5(this.ctx);r!==this.lastPluginsEnabled&&(this.lastPluginsEnabled=r,this.initialSyncPromise=void 0,this.scheduleSync())})}catch{return}}async ensureInitialSync(){if(this.disposed)return;if(this.initialSyncPromise)return this.initialSyncPromise;if(!this.isEditorIdentityKnown())return;let e,r=new Promise(n=>e=n);return this.initialSyncPromise=r,this.syncChain=this.syncChain.then(()=>this.sync()).then(n=>{n||(this.initialSyncPromise=void 0)}).catch(n=>{this.initialSyncPromise=void 0,this.logger.warn(this.ctx,"plugin contribution initial sync failed",{err:String(n)})}).finally(()=>e()),r}isEditorIdentityKnown(){try{return this.ctx.get(Ir).isEditorPluginInfoKnown()}catch{return!0}}scheduleSync(){this.syncChain=this.syncChain.then(()=>this.sync()).then(()=>{}).catch(e=>{this.logger.warn(this.ctx,"plugin contribution sync failed",{err:String(e)})})}syncedForTesting(){return this.syncChain}async sync(){if(this.disposed)return!0;if(!W5(this.ctx))return this.teardownAll(),!0;let e;try{e=(await this.service.listPlugins()).filter(n=>n.enabled)}catch(n){return this.logger.warn(this.ctx,"listPlugins failed during sync",{err:String(n)}),!1}if(this.disposed)return!0;let r=new Map(e.map(n=>[n.uri,n]));for(let n of[...this.registered.keys()])r.has(n)||this.teardownPlugin(n);for(let[n,o]of r)if(await this.reconcilePlugin(n,o),this.disposed)return!0;return!0}async reconcilePlugin(e,r){let n=this.registered.get(e),o=I$s(r),s=x$s(r),c=n?.disposables??[];if(!n||n.fileHash!==o){for(let u of c)u.dispose();c=this.registerFiles(e,r)}let l=n?.mcpApplied??!1;if((!n||n.mcpHash!==s||!n.mcpApplied)&&(l=await this.applyMcp(e,r,n)),this.disposed){for(let u of c)u.dispose();l&&this.tryManager()?.removePluginServers(e).catch(d=>this.logger.warn(this.ctx,"removePluginServers failed",{uri:e,err:String(d)}));return}this.registered.set(e,{fileHash:o,mcpHash:s,mcpApplied:l,disposables:c})}registerFiles(e,r){let n=this.tryRegistry();if(!n)return[];let o=[];for(let{type:s,pick:c}of EZn)for(let l of c(r))o.push(n.register(s,[w$s(l.uri)],{watchable:!1,classification:{storage:"plugin",pluginInfo:{name:l.name,description:l.description??"",pluginUri:e}}}));return o}async applyMcp(e,r,n){let o=this.tryManager();if(!o)return!0;let s=R$s(r.mcpServerDefinitions);if(Object.keys(s).length===0&&!n?.mcpApplied)return!0;try{return await o.applyPluginServers(e,s),!0}catch(c){return this.logger.warn(this.ctx,"applyPluginServers failed",{uri:e,err:String(c)}),!1}}teardownPlugin(e){let r=this.registered.get(e);if(!r)return;for(let o of r.disposables)o.dispose();let n=this.tryManager();n&&n.removePluginServers(e).catch(o=>this.logger.warn(this.ctx,"removePluginServers failed",{uri:e,err:String(o)})),this.registered.delete(e)}teardownAll(){for(let e of[...this.registered.keys()])this.teardownPlugin(e)}tryRegistry(){return this.tryGet(wA)}tryManager(){return this.tryGet(ey)}tryGet(e){try{return this.ctx.get(e)}catch(r){if(r instanceof bl)return;throw r}}dispose(){this.disposed||(this.disposed=!0,this.changeSubscription.dispose(),this.gateSubscription?.dispose(),this.teardownAll())}};function I$s(t){let e=EZn.flatMap(({pick:r})=>r(t).map(n=>JSON.stringify([n.uri,n.name,n.description??""]))).sort();return JSON.stringify(e)}a(I$s,"fileContentHash");function x$s(t){let e=t.mcpServerDefinitions.map(r=>JSON.stringify([r.name,r.configuration])).sort();return JSON.stringify(e)}a(x$s,"mcpContentHash");function w$s(t){return t.includes("://")?un(t):t}a(w$s,"toPathPattern");function R$s(t){let e={};for(let{name:r,configuration:n}of t)n.type==="stdio"?e[r]={command:n.command,...n.args&&{args:[...n.args]},...n.env&&{env:{...n.env}},...n.cwd&&{cwd:n.cwd}}:e[r]={url:n.url,...n.headers&&{headers:{...n.headers}}};return e}a(R$s,"toMcpServersConfig");var _Zn=de(require("node:path"));var blt=new fe("BackgroundAgent.SessionOptionsBuilder"),k$s=5e3;async function vZn(t,e,r,n){let o=o3((async()=>{try{await t.get(g8).ensureInitialSync()}catch(A){if(!(A instanceof bl))throw A}})(),k$s,void 0),s=await n.buildAuthInfo(),c=to(r.workspaceFolder.uri).fsPath;await o;let l;try{l=t.get(h0).getSkillDirectories(c),l.length===0&&(l=void 0)}catch{}let u={clientName:t.get(Ir).getEditorPluginInfo().name,integrationId:S$e(t.get(Ir))??"jetbrains-chat",sessionId:e,authInfo:s,model:r.model,reasoningEffort:r.reasoningEffort,enableStreaming:r.enableStreaming??!0,excludedTools:r.excludedTools,skillDirectories:l,disabledSkills:r.disabledSkills?new Set(r.disabledSkills):void 0,workingDirectory:c};try{await t.get(w3)._handleWorkspaceAdded({uri:r.workspaceFolder.uri,name:r.workspaceFolder.name??""})}catch{}let d=await Kct(t,r.workspaceFolder);d.length>0&&(u.customAgents=d);let f=r.mcpDirectory??r.workspaceFolder.uri;try{let A=t.get(PT).buildMcpServers(f);blt.info(t,"Built MCP gateway servers for SDK options",{sessionId:e,gatewayServers:A}),Object.keys(A).length>0&&(u.mcpServers=A)}catch(A){if(!(A instanceof bl))throw A}u.hooks=oJn(t,r.workspaceFolder);let h=await hZn(t,r.workspaceFolder);if(u.hooks=mZn(u.hooks,h),r.inlineConfinedFile){let A=[...u.hooks.preToolUse??[]];r.inlineConfinementHook&&A.unshift(r.inlineConfinementHook),r.inlineTurnLimiter&&A.unshift(r.inlineTurnLimiter.hook),u.hooks={...u.hooks,preToolUse:A},u.systemMessage={mode:"append",content:yZn(r.inlineConfinedFile)}}else{let A=await ffr(t,[r.workspaceFolder]).catch(v=>{blt.warn(t,"Failed to load git commit instructions for systemMessage",v)}),y=r.useNestedAgentsMdFiles===!0?await D$s(t,c):void 0,E=r.useNestedClaudeMdFiles===!0?await P$s(t,c):void 0,_=uJn({gitCommitInstructions:A,globalAgentsMdInstructions:r.globalAgentsMdInstructions,nestedAgentsInstructions:y,globalClaudeMdInstructions:r.globalClaudeMdInstructions,nestedClaudeInstructions:E});_!==void 0&&(u.systemMessage={mode:"append",content:_})}r.externalToolDefinitions?.length&&(u.externalToolDefinitions=r.externalToolDefinitions);let m=sJn(r);m.size>0&&(u.disabledInstructionSources=m);let g=Clt(t);return g&&(u.sandboxConfig=g),u}a(vZn,"buildSessionOptions");async function P$s(t,e){let r;try{r=t.get(Qo)}catch{return}try{return await cJn(async n=>r.readDirectory(Ks(n)),async n=>CZn(r,e,n),e)}catch(n){blt.warn(t,"Failed to scan nested CLAUDE.md files",n);return}}a(P$s,"scanNestedClaudeSection");async function D$s(t,e){let r;try{r=t.get(Qo)}catch{return}try{return await lJn(async n=>r.readDirectory(Ks(n)),async n=>CZn(r,e,n),e)}catch(n){blt.warn(t,"Failed to scan nested AGENTS.md files",n);return}}a(D$s,"scanNestedAgentsSection");async function CZn(t,e,r){try{return await t.readFileString(Ks(_Zn.join(e,r)))}catch{return}}a(CZn,"readNestedFile");p();var N$s=20,Slt=new fe("BackgroundAgent.SessionRegistry"),Tlt=class{constructor(e){this.ctx=e;this.sessions=new Map;this.workingDirs=new Map;this.workspaceFolderUris=new Map;this.mcpDirectories=new Map;this.turnIndexes=new Map;this.chatModes=new Map;this.providerModels=new Map;this.appliedSandboxConfig=new Map;this.confinedFiles=new Map;this.turnLimiters=new Map;this.children=new Map}static{a(this,"SessionRegistry")}set(e,r){if(this.sessions.has(e)&&this.sessions.delete(e),this.sessions.set(e,r),this.sessions.size>N$s){let n=this.sessions.keys().next().value;n!==void 0&&n!==e&&(Slt.debug(this.ctx,`Evicting oldest cached session: ${n}`),this.remove(n).catch(o=>Slt.warn(this.ctx,`Failed to evict session ${n}`,{error:o instanceof Error?o.message:String(o)})))}}get(e){return this.sessions.get(e)}has(e){return this.sessions.has(e)}size(){return this.sessions.size}entries(){return this.sessions.entries()}forgetSession(e){this.sessions.delete(e)}setWorkingDir(e,r){this.workingDirs.set(e,r)}getWorkingDir(e){return this.workingDirs.get(e)}workingDirEntries(){return this.workingDirs}setWorkspaceFolderUri(e,r){this.workspaceFolderUris.set(e,r)}getWorkspaceFolderUri(e){return this.workspaceFolderUris.get(e)}setMcpDirectory(e,r){this.mcpDirectories.set(e,r)}getMcpDirectory(e){return this.mcpDirectories.get(e)}incrementTurnIndex(e){let r=(this.turnIndexes.get(e)??-1)+1;return this.turnIndexes.set(e,r),r}seedTurnIndexIfAbsent(e,r){this.turnIndexes.has(e)||this.turnIndexes.set(e,r)}setChatMode(e,r){this.chatModes.set(e,r)}getChatMode(e){return this.chatModes.get(e)}deleteChatMode(e){this.chatModes.delete(e)}clearChatMode(){this.chatModes.clear()}chatModeEntries(){return this.chatModes}setProviderModel(e,r){this.providerModels.set(e,r)}getProviderModel(e){return this.providerModels.get(e)}deleteProviderModel(e){this.providerModels.delete(e)}setAppliedSandboxConfig(e,r){this.appliedSandboxConfig.set(e,r)}getAppliedSandboxConfig(e){return this.appliedSandboxConfig.get(e)}deleteAppliedSandboxConfig(e){this.appliedSandboxConfig.delete(e)}setConfinedFile(e,r){this.confinedFiles.set(e,r)}getConfinedFile(e){return this.confinedFiles.get(e)}hasConfinedFile(e){return this.confinedFiles.has(e)}setTurnLimiter(e,r){this.turnLimiters.set(e,r)}getTurnLimiter(e){return this.turnLimiters.get(e)}registerChild(e,r){let n=this.children.get(e);n||(n=[],this.children.set(e,n)),n.push(r)}async remove(e){let r=this.sessions.get(e),n=this.children.get(e);this.children.delete(e),n&&await Promise.all(n.map(async s=>{try{await Promise.resolve(s.dispose())}catch(c){Slt.warn(this.ctx,"Child Disposable failed during session removal",{sessionId:e,error:c instanceof Error?c.message:String(c)})}}));let o=this.sessions.get(e);if(r!==void 0&&o!==r){Slt.debug(this.ctx,`Skipping map clear for session ${e}: re-cached during removal`);return}this.sessions.delete(e),this.workingDirs.delete(e),this.workspaceFolderUris.delete(e),this.mcpDirectories.delete(e),this.turnIndexes.delete(e),this.chatModes.delete(e),this.providerModels.delete(e),this.appliedSandboxConfig.delete(e),this.confinedFiles.delete(e),this.turnLimiters.delete(e)}async removeAll(){let e=[...this.sessions.keys(),...this.children.keys()],r=Array.from(new Set(e));await Promise.all(r.map(n=>this.remove(n))),this.sessions.clear(),this.workingDirs.clear(),this.workspaceFolderUris.clear(),this.mcpDirectories.clear(),this.turnIndexes.clear(),this.chatModes.clear(),this.providerModels.clear(),this.appliedSandboxConfig.clear(),this.confinedFiles.clear(),this.turnLimiters.clear(),this.children.clear()}};p();p();var pfr=require("node:fs"),GX=de(require("node:path"));function bZn(t){return t.replace(/[/\\:]/g,"_").split("\0").join("_")}a(bZn,"sanitizePathSegment");function xlt(t){return typeof t=="string"?t:void 0}a(xlt,"asString");function Ilt(t){return typeof t=="number"?t:void 0}a(Ilt,"asNumber");function M$s(t){return Array.isArray(t)?t.map(e=>{if(!e||typeof e!="object")return{};let r=e;return{tool_call_id:xlt(r.toolCallId),tool:xlt(r.name)}}):[]}a(M$s,"asToolCallArray");function O$s(t){if(!t||typeof t!="object")return"";let e=t;return typeof e.detailedContent=="string"?e.detailedContent:typeof e.content=="string"?e.content:""}a(O$s,"toToolResultText");function L$s(t){try{return JSON.stringify(t)}catch{return}}a(L$s,"safeStringify");var hfr=class{constructor(e,r,n){this.sessionId=r;this.usageByKey=new Map;this.pendingTools=new Map;this.appendQueues=new Map;this.activeTurnId=n;let o=cQt(new Date),s=bZn(r);this.sessionDir=GX.join(e,`pid-${process.pid}_${o}_bgagent`,"sessions",s)}static{a(this,"BackgroundAgentPersistence")}persistEvent(e){if(e.type==="assistant.turn_start"){this.activeTurnId=e.data.turnId;return}switch(e.type){case"assistant.usage":this.handleUsage(e);break;case"assistant.message":this.handleMessage(e);break;case"tool.execution_start":this.handleToolStart(e);break;case"tool.execution_complete":this.handleToolComplete(e);break;default:break}}outputDir(e){return e?GX.join(this.sessionDir,"runSubAgent",bZn(e)):this.sessionDir}appendJsonl(e,r){let n=L$s(r);if(n===void 0)return;let s=(this.appendQueues.get(e)??Promise.resolve()).then(async()=>{await pfr.promises.mkdir(GX.dirname(e),{recursive:!0}),await pfr.promises.appendFile(e,`${n} -`,"utf8")});this.appendQueues.set(e,s.catch(()=>{}))}handleUsage(e){let r=e.data.parentToolCallId??"main";this.usageByKey.set(r,{inputTokens:Ilt(e.data.inputTokens),outputTokens:Ilt(e.data.outputTokens),cacheReadTokens:Ilt(e.data.cacheReadTokens)})}handleMessage(e){let r=e.data.parentToolCallId,n=r??"main",o=this.usageByKey.get(n),s=M$s(e.data.toolRequests),c=this.outputDir(r);s.length>0&&this.appendJsonl(GX.join(c,"trajectory.jsonl"),{tool_calls:s,input_tokens:o?.inputTokens,output_tokens:Ilt(e.data.outputTokens)??o?.outputTokens,cached_input_tokens:o?.cacheReadTokens,conversationId:this.sessionId,turnId:this.activeTurnId})}handleToolStart(e){let r=xlt(e.data.toolCallId);r&&this.pendingTools.set(r,{toolCallId:r,toolName:e.data.toolName,arguments:e.data.arguments,parentToolCallId:e.data.parentToolCallId,startTimestamp:e.timestamp})}handleToolComplete(e){let r=xlt(e.data.toolCallId);if(!r)return;let n=this.pendingTools.get(r);this.pendingTools.delete(r);let o=this.outputDir(n?.parentToolCallId),s=n?.startTimestamp?new Date(n.startTimestamp).getTime():void 0,c=new Date(e.timestamp).getTime(),l=s?c-s:void 0;this.appendJsonl(GX.join(o,"tool-in-out.jsonl"),{tool_call_id:r,tool:n?.toolName??"",input:typeof n?.arguments=="object"&&n.arguments!==null?n.arguments:{},output:O$s(e.data.result),status:e.data.success?"success":"error",timestamp:e.timestamp,duration_ms:l})}};function SZn(t,e,r){let n=Ft(t,Ye.PromptPersistBasePath)?.trim()||void 0;if(n)return new hfr(n,e,r)}a(SZn,"createBackgroundAgentPersistence");p();var wlt=class{constructor(){this.pendingWaits=new Map;this.data={permission:{totalMs:0,count:0},user_input:{totalMs:0,count:0},exit_plan_mode:{totalMs:0,count:0}}}static{a(this,"UserWaitTracker")}trackEvent(e){let r=e.type,n=e.data;if(r==="permission.requested"||r==="user_input.requested"||r==="exit_plan_mode.requested"){let o=typeof n?.requestId=="string"?n.requestId:void 0;if(!o)return;let s=r.replace(".requested","");this.pendingWaits.set(o,{waitType:s,startTimeMs:performance.now()})}else if(r==="permission.completed"||r==="user_input.completed"||r==="exit_plan_mode.completed"){let o=typeof n?.requestId=="string"?n.requestId:void 0;if(!o)return;let s=this.pendingWaits.get(o);if(s){let c=performance.now()-s.startTimeMs;this.pendingWaits.delete(o);let l=this.data[s.waitType];l.totalMs+=c,l.count+=1}}}};p();p();var Jo={OPERATION_NAME:"gen_ai.operation.name",AGENT_NAME:"gen_ai.agent.name",SYSTEM:"gen_ai.system",REQUEST_MODEL:"gen_ai.request.model",RESPONSE_MODEL:"gen_ai.response.model",SYSTEM_INSTRUCTIONS:"gen_ai.system_instructions",INPUT_MESSAGES:"gen_ai.input.messages",OUTPUT_MESSAGES:"gen_ai.output.messages",CONVERSATION_ID:"gen_ai.conversation.id",USAGE_INPUT_TOKENS:"gen_ai.usage.input_tokens",USAGE_OUTPUT_TOKENS:"gen_ai.usage.output_tokens",USAGE_CACHE_READ_INPUT_TOKENS:"gen_ai.usage.cache_read.input_tokens",USAGE_CACHE_CREATION_INPUT_TOKENS:"gen_ai.usage.cache_creation.input_tokens",TURN_COUNT:"gen_ai.turn_count",TOTAL_COST_USD:"gen_ai.total_cost_usd",TOOL_NAME:"gen_ai.tool.name",TOOL_CALL_ID:"gen_ai.tool.call.id",TOOL_CALL_ARGUMENTS:"gen_ai.tool.call.arguments",TOOL_CALL_RESULT:"gen_ai.tool.call.result"};var xZn=require("crypto");var mfr=new fe("BackgroundAgent.CliOTelTracker"),B$s={USER_REQUEST:"copilot_chat.user_request"},gfr="main";function zhe(t){return(0,xZn.randomUUID)().replace(/-/g,"").slice(0,t*2)}a(zhe,"generateHexId");function wZn(){return BigInt(Date.now())*1000000n}a(wZn,"nowNano");function Yhe(t){if(t){let e=Date.parse(t);if(!Number.isNaN(e))return BigInt(e)*1000000n}return wZn()}a(Yhe,"isoToNano");function TZn(t){if(t!=null){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return}}}a(TZn,"toAttributeString");function IZn(t){return JSON.stringify([{role:"assistant",parts:[{type:"text",content:t}]}])}a(IZn,"outputMessagesJson");function RZn(t,e,r){if(!t.get(bn).getCapabilities().agentDebugLog)return;let n=t.get(pv);if(n.isEnabled())return new Afr(t,e,r,n)}a(RZn,"createCliOTelTracker");var Afr=class{constructor(e,r,n,o){this._ctx=e;this._sessionId=r;this._session=n;this._persistence=o;this._pendingTools=new Map}static{a(this,"CliOTelTracker")}onEvent(e){switch(e.type){case"user.message":this._pendingUserRequest=e.data.content;break;case"assistant.turn_start":this._ensureRequest(Yhe(e.timestamp));break;case"assistant.usage":this._onUsage(e);break;case"assistant.message":this._onAssistantMessage(e);break;case"tool.execution_start":this._onToolStart(e);break;case"tool.execution_complete":this._onToolComplete(e);break;case"session.idle":case"session.error":this._flushRequest().catch(r=>{mfr.warn(this._ctx,`Failed to flush debug spans for session=${this._sessionId}: ${r instanceof Error?r.message:String(r)}`)});break;default:break}}_ensureRequest(e){return this._request||(this._request={traceId:zhe(16),invokeAgentSpanId:zhe(8),startNano:e,userRequest:this._pendingUserRequest,usages:[],responseByAgent:new Map,toolSpanIds:new Map,pendingReads:[]},this._pendingUserRequest=void 0),this._request}_onUsage(e){let r=this._ensureRequest(Yhe(e.timestamp)),n={data:e.data,endNano:Yhe(e.timestamp),agentKey:e.data.parentToolCallId??gfr,parentToolCallId:e.data.parentToolCallId};r.usages.push(n),r.pendingReads.push(this._readAssembled().then(({inputMessagesJson:o,systemInstructions:s})=>{n.inputMessagesJson=o,n.systemInstructions=s}))}_onAssistantMessage(e){let r=this._request;if(!r)return;let n=e.data.content;if(!n)return;let o=e.data.parentToolCallId??gfr;r.responseByAgent.set(o,(r.responseByAgent.get(o)??"")+n)}_onToolStart(e){let r=e.data.toolCallId;if(!r)return;let n=this._ensureRequest(Yhe(e.timestamp)),o=e.data.parentToolCallId,s=(o?n.toolSpanIds.get(o):void 0)??n.invokeAgentSpanId,c=zhe(8);this._pendingTools.set(r,{traceId:n.traceId,spanId:c,parentSpanId:s,toolName:e.data.toolName??"unknown",arguments:e.data.arguments,startNano:Yhe(e.timestamp)}),n.toolSpanIds.set(r,c)}_onToolComplete(e){let r=e.data.toolCallId;if(!r)return;let n=this._pendingTools.get(r);if(!n)return;this._pendingTools.delete(r);let o=Yhe(e.timestamp),s=e.data.success===!1,c=e.data.error?.message,l={[Jo.OPERATION_NAME]:"execute_tool",[Jo.CONVERSATION_ID]:this._sessionId,[Jo.TOOL_NAME]:n.toolName,[Jo.TOOL_CALL_ID]:r},u=TZn(n.arguments);u!==void 0&&(l[Jo.TOOL_CALL_ARGUMENTS]=u);let d=e.data.result??e.data.error,f=TZn(d);f!==void 0&&(l[Jo.TOOL_CALL_RESULT]=f),this._appendSpans([{traceId:n.traceId,spanId:n.spanId,parentSpanId:n.parentSpanId,name:`execute_tool ${n.toolName}`,kind:1,startTimeUnixNano:n.startNano.toString(),endTimeUnixNano:o.toString(),attributes:k2(l),events:[],status:s?{code:2,message:c??"Tool execution error"}:{code:1}}])}async _flushRequest(){let e=this._request;if(!e)return;this._request=void 0,await Promise.allSettled(e.pendingReads);let r=wZn(),n=[this._buildInvokeAgentSpan(e,r)],o=this._buildUserMessageSpan(e);o&&n.push(o);let s=new Map;e.usages.forEach((c,l)=>{c.data.model&&s.set(c.agentKey,l)}),e.usages.forEach((c,l)=>{let u=s.get(c.agentKey)===l,d=this._buildChatSpan(e,c,u);d&&n.push(d)}),n.push(...this._buildAgentResponseSpans(e)),this._appendSpans(n)}_buildInvokeAgentSpan(e,r){return{traceId:e.traceId,spanId:e.invokeAgentSpanId,name:"invoke_agent copilotcli",kind:1,startTimeUnixNano:e.startNano.toString(),endTimeUnixNano:r.toString(),attributes:k2({[Jo.OPERATION_NAME]:"invoke_agent",[Jo.AGENT_NAME]:"copilotcli",[Jo.CONVERSATION_ID]:this._sessionId}),events:[],status:{code:1}}}_buildUserMessageSpan(e){if(!e.userRequest)return;let r=e.startNano.toString();return{traceId:e.traceId,spanId:zhe(8),parentSpanId:e.invokeAgentSpanId,name:"user_message",kind:1,startTimeUnixNano:r,endTimeUnixNano:r,attributes:k2({[Jo.OPERATION_NAME]:"user_message",[Jo.CONVERSATION_ID]:this._sessionId,[B$s.USER_REQUEST]:e.userRequest}),events:[{name:"user_message",timeUnixNano:r,attributes:k2({content:e.userRequest})}],status:{code:1}}}_buildAgentResponseSpans(e){let r=new Map;for(let o of e.usages)o.data.model&&r.set(o.agentKey,o.endNano);let n=[];for(let[o,s]of e.responseByAgent){if(!s)continue;let c=o===gfr?e.invokeAgentSpanId:e.toolSpanIds.get(o)??e.invokeAgentSpanId,l=(r.get(o)??e.startNano).toString();n.push({traceId:e.traceId,spanId:zhe(8),parentSpanId:c,name:"agent_response",kind:1,startTimeUnixNano:l,endTimeUnixNano:l,attributes:k2({[Jo.OPERATION_NAME]:"agent_response",[Jo.CONVERSATION_ID]:this._sessionId,[Jo.OUTPUT_MESSAGES]:IZn(s)}),events:[],status:{code:1}})}return n}_buildChatSpan(e,r,n){let o=r.data.model;if(!o)return;let s=(r.parentToolCallId?e.toolSpanIds.get(r.parentToolCallId):void 0)??e.invokeAgentSpanId,c={[Jo.OPERATION_NAME]:"chat",[Jo.CONVERSATION_ID]:this._sessionId,[Jo.RESPONSE_MODEL]:o},l=r.data.inputTokens,u=r.data.outputTokens,d=r.data.cacheReadTokens,f=r.data.cacheWriteTokens;typeof l=="number"&&(c[Jo.USAGE_INPUT_TOKENS]=l),typeof u=="number"&&(c[Jo.USAGE_OUTPUT_TOKENS]=u),typeof d=="number"&&(c[Jo.USAGE_CACHE_READ_INPUT_TOKENS]=d),typeof f=="number"&&(c[Jo.USAGE_CACHE_CREATION_INPUT_TOKENS]=f),r.systemInstructions&&(c[Jo.SYSTEM_INSTRUCTIONS]=r.systemInstructions),r.inputMessagesJson&&(c[Jo.INPUT_MESSAGES]=r.inputMessagesJson);let h=n?e.responseByAgent.get(r.agentKey):void 0;h&&(c[Jo.OUTPUT_MESSAGES]=IZn(h));let m=r.endNano,g=r.data.duration,A=typeof g=="number"&&g>=0?m-BigInt(Math.round(g))*1000000n:m;return{traceId:e.traceId,spanId:zhe(8),parentSpanId:s,name:`chat ${o}`,kind:1,startTimeUnixNano:A.toString(),endTimeUnixNano:m.toString(),attributes:k2(c),events:[],status:{code:1}}}async _readAssembled(){try{let e=await this._session.getChatContextMessages();return{inputMessagesJson:e.length>0?JSON.stringify(e):void 0,systemInstructions:this._session.getCurrentSystemMessage()}}catch(e){return mfr.warn(this._ctx,`Failed to read assembled messages for session=${this._sessionId}: ${e instanceof Error?e.message:String(e)}`),{}}}_appendSpans(e){if(e.length!==0)try{this._persistence.appendSpans(e).catch(r=>this._warnPersistFailure(r))}catch(r){this._warnPersistFailure(r)}}_warnPersistFailure(e){mfr.warn(this._ctx,`Failed to persist debug spans for session=${this._sessionId}: ${e instanceof Error?e.message:String(e)}`)}};Mo();var A8=new fe("BackgroundAgent.TurnDriver"),yfr="backgroundAgent",Rlt=class{constructor(e,r,n){this.ctx=e;this.registry=r;this.notificationSender=n;this.processedEventIds=new Map;this.registeredBackstops=new Set;this.lastNanoAiu=new Map}static{a(this,"TurnDriver")}wireAndSend(e,r,n,o,s,c){let l=performance.now(),u=SZn(this.ctx,e,`bg-turn-${Mt()}`),d=RZn(this.ctx,e,r);this.processedEventIds.set(e,new Set),this.registeredBackstops.has(e)||(this.registeredBackstops.add(e),this.registry.registerChild(e,{dispose:a(()=>{this.registeredBackstops.delete(e),this.lastNanoAiu.delete(e),this.forget(e)},"dispose")}));let f=a(()=>{},"noop"),h=r.on("user_input.requested",f),m=r.on("permission.requested",f),g=r.on("exit_plan_mode.requested",f);$Gn(r,!0);let A=new wlt,y=r.on("*",w=>{if(w.type==="assistant.turn_start"&&this.registry.getTurnLimiter(e)?.onTurnStart(),u)try{u.persistEvent(w)}catch(R){A8.warn(this.ctx,"Failed to persist background-agent event",{eventType:w.type,error:R instanceof Error?R.message:String(R)})}if(A.trackEvent(w),d)try{d.onEvent(w)}catch(R){A8.warn(this.ctx,"Failed to synthesize debug span",{eventType:w.type,error:R instanceof Error?R.message:String(R)})}this.handleSessionEvent(e,w,o)}),E=!1,_=a(()=>{E||(E=!0,this.emitTurnCompleteTelemetry(e,r,l,A.data,o),this.emitSessionMetricsTelemetry(e,r,o,c)),T?.dispose(),h(),m(),g(),y(),v(),b(),this.forget(e)},"cleanup"),v=r.on("session.idle",()=>{_()}),b=r.on("session.error",()=>{_()}),T;s&&(T=s.onCancellationRequested(()=>{A8.info(this.ctx,"Cancellation requested, aborting session:",e),r.clearPendingItems(),r.abort()})),r.send(n).catch(w=>{_();let R=Mrt(w);s?.isCancellationRequested?A8.info(this.ctx,"session.send aborted by cancellation",{sessionId:e,turnIndex:o}):(A8.error(this.ctx,"session.send failed",{sessionId:e,turnIndex:o,error:R,stack:w instanceof Error?w.stack:void 0}),this.emitTurnFailedTelemetry(e,o,"SendMessageError"));let x={type:"session.error",id:Mt(),timestamp:new Date().toISOString(),parentId:null,data:{errorType:"SendMessageError",message:R}};this.sendSessionUpdateNotification(e,x,o)})}forget(e){this.processedEventIds.delete(e)}processedEventIdsForTesting(){return this.processedEventIds}seedProcessedEventIdsForTesting(e){this.processedEventIds.set(e,new Set),this.registeredBackstops.has(e)||(this.registeredBackstops.add(e),this.registry.registerChild(e,{dispose:a(()=>{this.registeredBackstops.delete(e),this.lastNanoAiu.delete(e),this.forget(e)},"dispose")}))}async handleSessionEvent(e,r,n){let o=r.id,s=this.processedEventIds.get(e);if(s?.has(o)){A8.debug(this.ctx,`Skipping duplicate SDK event: ${r.type} (id=${o})`);return}s?.add(o),await this.sendSessionUpdateNotification(e,r,n)}async sendSessionUpdateNotification(e,r,n){try{await this.notificationSender.sendBackgroundAgentSessionUpdate(e,r,void 0,n)}catch(o){A8.error(this.ctx,"Failed to send session update notification:",o)}}async emitTurnCompleteTelemetry(e,r,n,o,s){try{let c=performance.now()-n,l=this.registry.getChatMode(e)??"agent",d=(await r.usage.getMetrics()).totalNanoAiu,f=this.lastNanoAiu.get(e)??0,h=typeof d=="number"&&Number.isFinite(d),m=h?Math.min(f,d):f;h&&this.lastNanoAiu.set(e,d);let g=h?(d-m)/1e9:0;At(this.ctx,"backgroundAgent.turn.complete",{requestSource:yfr,sessionId:e,chatMode:l,agentProvider:"BACKGROUND",turnIndex:s!=null?String(s):""},{totalDurationMs:c,totalUserWaitMs:o?o.permission.totalMs+o.user_input.totalMs+o.exit_plan_mode.totalMs:0,permissionWaitMs:o?.permission.totalMs??0,permissionWaitCount:o?.permission.count??0,userInputWaitMs:o?.user_input.totalMs??0,userInputWaitCount:o?.user_input.count??0,exitPlanModeWaitMs:o?.exit_plan_mode.totalMs??0,exitPlanModeWaitCount:o?.exit_plan_mode.count??0,credits:g})}catch(c){A8.warn(this.ctx,"Failed to emit turn.complete telemetry",{sessionId:e,error:c instanceof Error?c.message:String(c)})}}emitTurnFailedTelemetry(e,r,n){At(this.ctx,"backgroundAgent.turn.failed",{requestSource:yfr,sessionId:e,agentProvider:"BACKGROUND",errorType:n,turnIndex:r!=null?String(r):""})}async emitSessionMetricsTelemetry(e,r,n,o){try{let s=await r.usage.getMetrics(),c=0,l=0,u=0,d=0,f=0,h=0,m=[];for(let[g,A]of Object.entries(s.modelMetrics))c+=A.usage.inputTokens,l+=A.usage.outputTokens,u+=A.usage.cacheReadTokens,d+=A.usage.cacheWriteTokens,f+=A.usage.reasoningTokens??0,h+=A.requests.count,m.push(o?"byok models":g);At(this.ctx,"backgroundAgent.session.metrics",{requestSource:yfr,sessionId:e,agentProvider:"BACKGROUND",modelNames:m.join(","),turnIndex:n!=null?String(n):""},{totalApiDurationMs:s.totalApiDurationMs,totalInputTokens:c,totalOutputTokens:l,totalCacheReadTokens:u,totalCacheWriteTokens:d,totalReasoningTokens:f,llmCallCount:h,totalPremiumRequestCost:s.totalPremiumRequestCost})}catch(s){A8.warn(this.ctx,"Failed to emit session.metrics telemetry",{sessionId:e,error:s instanceof Error?s.message:String(s)})}}};p();function kZn(t,e,r){e.agentMode&&(t.currentMode=e.agentMode,r.agentMode=e.agentMode)}a(kZn,"applyAgentModeOverride");p();async function PZn(t,e,r,n,o){let s=n.chatMode??"agent",c=fat(s)?s:"agent";if((c==="inline"||c==="inline-ask")&&!o.hasConfinedFile(e))throw new Error(`Cannot apply chatMode '${c}' for session ${e}: no confined file registered (session was not created with inlineConfinedFile)`);if(o.getChatMode(e)===c)return;let u=o.getWorkingDir(e);if(!u)throw new Error(`Cannot apply chatMode for session ${e}: working directory is not cached`);let d={uri:Ks(u)};o.deleteChatMode(e),await MGn(r,c,{loadCustomAgents:a(()=>Kct(t,d),"loadCustomAgents"),getAllLoadedSkillNames:a(async()=>(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(f=>f.name)),"getAllLoadedSkillNames"),getPolicyDisabledSkillNames:a(async()=>{let f;try{f=t.get(h0)}catch{return[]}return f.isSkillsEnabled()?[]:(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(h=>h.name))},"getPolicyDisabledSkillNames"),getMcpServers:a(()=>{let f=o.getMcpDirectory(e)??o.getWorkspaceFolderUri(e);try{return Promise.resolve(t.get(PT).buildMcpServers(f))}catch(h){if(h instanceof bl)return Promise.resolve({});throw h}},"getMcpServers")}),o.setChatMode(e,c)}a(PZn,"applyChatModeOverride");p();var DZn=new fe("BackgroundAgent.applyChatModeSelection");async function NZn(t,e,r){if(r.chatMode===void 0||fat(r.chatMode))return;let n=r.chatMode==="agent";try{n?(await e.agent.deselect(),DZn.info(t,`Cleared custom agent selection for session ${r.sessionId}`)):(await e.agent.select({name:r.chatMode}),DZn.info(t,`Applied custom agent '${r.chatMode}' for session ${r.sessionId}`))}catch(o){let s=o instanceof Error?o.message:String(o);throw n?new Error(`Failed to clear custom agent selection on session ${r.sessionId}: ${s}`):new Error(`Failed to select custom agent '${r.chatMode}' on session ${r.sessionId}: ${s}. Verify the agent is registered via a workspace .agent.md file.`)}}a(NZn,"applyChatModeSelection");p();var MZn=require("node:util");function OZn(t,e,r,n){let o=Clt(t)??{enabled:!1},s=n.getAppliedSandboxConfig(e);s!==void 0&&(0,MZn.isDeepStrictEqual)(s,o)||(r.updateOptions({sandboxConfig:o}),n.setAppliedSandboxConfig(e,o))}a(OZn,"applySandboxOverride");p();p();var $X=new fe("BackgroundAgent.ProviderConfig");async function LZn(t,e,r){if(!e)return;let n=await Wze(t,e,r);if(!n){$X.warn(t,`BYOK provider '${e}' selected but no API key found for model '${r??""}'.`);return}let o,s,c;try{let d=await new da(t.get(Yn)).getStoredModelConfigs(e),f=r?d[r]:void 0;o=f?.deploymentUrl,s=f?.modelCapabilities?.maxInputTokens,c=f?.modelCapabilities?.maxOutputTokens}catch(u){$X.warn(t,"Failed to load BYOK model config; using defaults",{providerName:e,modelId:r,error:u instanceof Error?u.message:String(u)})}let l={...s!==void 0&&{maxPromptTokens:s},...c!==void 0&&{maxOutputTokens:c}};if(e===io.Anthropic)return{type:"anthropic",baseUrl:o??zle[e],apiKey:n,modelId:r,wireModel:r,...l};if(e===io.Azure){if(!o){$X.warn(t,`Azure provider requires a per-model deployment URL but none configured for '${r??""}'.`);return}return U$s(t,o,n,r,l)}if(jle(e))return{type:"openai",baseUrl:o??zle[e],apiKey:n,modelId:r,wireModel:r,...l};if(vK(e))return F$s(t,e,n,r,o,l);$X.warn(t,`Unknown BYOK provider '${e}', skipping provider config.`)}a(LZn,"buildProviderConfig");async function F$s(t,e,r,n,o,s){if(!o){$X.warn(t,`Custom endpoint '${e}' has no configured URL; skipping provider config.`);return}let u=(await new da(t.get(Yn)).getProviderConfig(e))?.apiType,d=u==="chatCompletions"||u==="responses"||u==="messages"?u:XIe,f=Vze(o,d);return d==="messages"?{type:"anthropic",baseUrl:f,apiKey:r,modelId:n,wireModel:n,...s}:{type:"openai",wireApi:d==="responses"?"responses":"completions",baseUrl:f,apiKey:r,modelId:n,wireModel:n,...s}}a(F$s,"buildCustomEndpointProviderConfig");function U$s(t,e,r,n,o){let s;try{s=new URL(e)}catch{$X.warn(t,`Invalid Azure deployment URL: ${e}`);return}let c=`${s.protocol}//${s.hostname}`;if(s.hostname.endsWith(".openai.azure.com"))return{type:"azure",baseUrl:c,apiKey:r,modelId:n,wireModel:n,azure:{apiVersion:"2025-01-01-preview"},...o};if(s.hostname.endsWith(".models.ai.azure.com")||s.hostname.endsWith(".inference.ml.azure.com"))return{type:"openai",baseUrl:`${c}/v1`,apiKey:r,modelId:n,wireModel:n,...o};$X.warn(t,`Unrecognized Azure deployment URL host '${s.hostname}' for model '${n??""}'.`)}a(U$s,"buildAzureProviderConfig");var Efr=new fe("BackgroundAgent.applyTurnOverrides");async function BZn(t,e,r,n){let o=r.providerName?r.providerName:void 0;if(o!==void 0&&!XQ(await t.get(Qt).getToken()))throw new YRe(`BYOK is disabled for this account. Provider '${o}' cannot be used for model '${r.model??""}'.`,o,r.model);let s=await LZn(t,o,r.model);if(o!==void 0&&s===void 0)throw new zRe(`BYOK provider '${o}' is misconfigured for model '${r.model??""}'. Verify the API key`+(o===io.Azure?" and per-model deployment URL":"")+" is configured for this provider/model.",o,r.model);let c=n.registry.getProviderModel(r.sessionId),l=r.model,u=l!==void 0&&c?.model!==l,d=c!==void 0&&c.provider!==o,f=c!==void 0&&(d||u),h=e,m=!1;if(f){Efr.info(t,`Provider/model changed for session ${r.sessionId} (${c?.provider??"(built-in)"}/${c?.model??"(unchanged)"} \u2192 ${o??"(built-in)"}/${l??"(unchanged)"}); forcing close+resume cycle to strip provider-bound reasoning state.`);let g=await n.managerLifecycle.ensureManager();n.registry.forgetSession(r.sessionId),n.registry.deleteChatMode(r.sessionId);try{await g.closeSession(r.sessionId),m=!0,h=await n.getOrResumeSession(r.sessionId)}catch(A){if(m)throw n.registry.deleteProviderModel(r.sessionId),new Error(`Failed to resume session ${r.sessionId} after provider/model change: `+(A instanceof Error?A.message:String(A)));Efr.warn(t,`Failed to close session ${r.sessionId} for provider/model change; continuing with existing session: `+(A instanceof Error?A.message:String(A))),h=e}}try{h.updateOptions({provider:s??null,...l?{model:l}:{},...r.reasoningEffort?{reasoningEffort:r.reasoningEffort}:{},...r.contextTier?{contextTier:r.contextTier}:{}})}catch(g){throw new Error(`Failed to bind BYOK provider '${o??"(built-in)"}' to session ${r.sessionId}: ${g instanceof Error?g.message:String(g)}`)}return n.registry.setProviderModel(r.sessionId,{provider:o,model:l??c?.model}),Efr.info(t,`Rebound session ${r.sessionId} for this turn: provider=${o??"(built-in)"}, model=${l??"(unchanged)"}, reasoningEffort=${r.reasoningEffort??"(unchanged)"}`),h}a(BZn,"applyTurnOverrides");p();async function FZn(t,e,r,n,o){let s=q$s(e,n),c=o==="inline"||o==="inline-ask";await t.get(Cg).applyPromptTemplateToRequest(r,s?[s]:[],c,{includePlugins:!0})||Q$s(t,r)}a(FZn,"expandPromptTemplate");function Q$s(t,e){let r=e.message.trim();if(!r.startsWith("/"))return!1;let[n,...o]=r.split(" "),s=n.slice(1);if(!Fxn.has(s))return!1;let c=n2().find(l=>l.id===s);return c?.instructions?(e.message=c.instructions(t,o.join(" ")),!0):!1}a(Q$s,"applyBuiltinCreateTemplate");function q$s(t,e){let r=e.getWorkingDir(t);return r?{uri:Ks(r)}:void 0}a(q$s,"getWorkspaceFolderForSession");Mo();var ty=new fe("BackgroundAgent"),RH="backgroundAgent",j$s="backgroundAgent.remote",H$s=new Set(["system.message","hook.start","hook.end"]),Hs=class{constructor(e){this.ctx=e;this.pendingExternalToolDefs=new Map;this.notificationSender=e.get(ts),this.managerLifecycle=new kat(e),this.authBinding=new Nrt(e),this.registry=new Tlt(e),this.mcpSync=new Gct(e,this.registry),this.remoteController=new Yct(e,{registry:this.registry,injectUserMessage:a((n,o,s)=>this.injectRemoteUserMessage(n,o,s),"injectUserMessage")}),this.turnDriver=new Rlt(e,this.registry,this.notificationSender),e.get(Lo).onDidChangeHttpSettings(()=>{uat(this.ctx)}),bs(e,()=>{this.handleAuthStateChange()});try{this._skillsEnabledListener=this.ctx.get(h0).onDidChangeSkillsEnabled(()=>{this.registry.clearChatMode()})}catch(n){if(!(n instanceof bl))throw n}}static{a(this,"BackgroundAgentService")}async handleAuthStateChange(){let{changed:e,hadPrevious:r,hasCurrent:n}=await this.authBinding.detectIdentityChange();e&&(ty.info(this.ctx,"GitHub identity changed, clearing cached sessions",{hadPrevious:r,hasCurrent:n,cachedSessionCount:this.registry.size(),remoteDelegateCount:this.remoteController.delegateCount()}),await this.clearUserScopedState())}async clearUserScopedState(){this.pendingExternalToolDefs.clear(),await this.registry.removeAll(),this.managerLifecycle.clearAutoMode()}ensureManager(){return this.managerLifecycle.ensureManager()}get sdk(){return this.managerLifecycle.getSdk()}get autoModeManager(){return this.managerLifecycle.getAutoModeManager()}installBridgeSpanProcessor(){this.managerLifecycle.ensureBridgeInstalled()}async handleInteraction(e){let r=performance.now(),n=await this.getOrResumeSession(e.sessionId),o=s2n(n,e);return At(this.ctx,"backgroundAgent.interaction",{requestSource:RH,sessionId:e.sessionId,requestId:e.requestId,interactionType:e.type,resultKind:e.type==="permission"?e.result.kind:""},{totalTimeMs:performance.now()-r}),o}buildAuthInfo(){return this.authBinding.buildAuthInfo()}applyTurnOverrides(e,r){return BZn(this.ctx,e,r,{registry:this.registry,managerLifecycle:this.managerLifecycle,getOrResumeSession:a(n=>this.getOrResumeSession(n),"getOrResumeSession")})}applyChatModeSelection(e,r){return NZn(this.ctx,e,r)}buildSessionOptions(e,r){return vZn(this.ctx,e,r,{buildAuthInfo:a(()=>this.buildAuthInfo(),"buildAuthInfo")})}async createSession(e){let r=performance.now();ty.info(this.ctx,"createSession called:",{model:e.model,workspaceFolder:e.workspaceFolder});let n=await this.ensureManager(),o=e.sessionId??Mt(),s=e.inlineConfinedFile?FGn(2):void 0,c=e.inlineConfinedFile?UGn(e.inlineConfinedFile):void 0,l=await this.buildSessionOptions(o,{...e,inlineTurnLimiter:s,inlineConfinementHook:c}),u=await n.createSession(l);return s&&this.registry.setTurnLimiter(o,s),ty.info(this.ctx,"Session created:",o),this.installBridgeSpanProcessor(),At(this.ctx,"backgroundAgent.create",{requestSource:RH,reasoningEffort:e.reasoningEffort??"",sessionId:o},{totalTimeMs:performance.now()-r}),this.registry.set(o,u),this.registry.setWorkingDir(o,to(e.workspaceFolder.uri).fsPath),this.registry.setWorkspaceFolderUri(o,e.workspaceFolder.uri),e.mcpDirectory&&this.registry.setMcpDirectory(o,e.mcpDirectory),e.inlineConfinedFile&&this.registry.setConfinedFile(o,e.inlineConfinedFile),{sessionId:o,workspacePath:u.workspacePath}}registerExternalTools(e,r){r?.length&&(this.pendingExternalToolDefs.set(e,r),ty.info(this.ctx,"Stored pending external tool definitions",{sessionId:e,toolCount:r.length}))}async getOrResumeSession(e,r={}){let n=this.registry.get(e);if(n){let h=this.pendingExternalToolDefs.get(e);return h&&(this.pendingExternalToolDefs.delete(e),n.updateOptions({externalToolDefinitions:h}),ty.info(this.ctx,"Applied pending external tool definitions to cached session",{sessionId:e,toolCount:h.length})),n}let o=await this.ensureManager(),s=r.workspaceFolder;if(!s){let h=await o.getSessionMetadata({sessionId:e});if(!h)throw new Error(`Session not found: ${e}`);let m=h.context?.cwd;if(!m)throw new Error(`Cannot resume session ${e} from disk: persisted metadata is missing working-directory context`);s={uri:Ks(m)},ty.info(this.ctx,"Resuming session from disk via metadata fallback",{sessionId:e})}let c=this.pendingExternalToolDefs.get(e);c&&this.pendingExternalToolDefs.delete(e);let l=await this.buildSessionOptions(e,{...r,externalToolDefinitions:r.externalToolDefinitions??c,workspaceFolder:s}),u=await o.getSession(l,!0);if(!u)throw new Error(`Session not found: ${e}`);this.registry.set(e,u);let d=Array.from(u.getEvents()).filter(h=>h.type==="user.message").length;d>0&&this.registry.seedTurnIndexIfAbsent(e,d-1),this.registry.deleteChatMode(e),this.registry.deleteAppliedSandboxConfig(e),this.installBridgeSpanProcessor();let f=s?.uri?to(s.uri).fsPath:void 0;return f&&this.registry.setWorkingDir(e,f),s?.uri&&this.registry.setWorkspaceFolderUri(e,s.uri),r.mcpDirectory&&this.registry.setMcpDirectory(e,r.mcpDirectory),u}async sendMessage(e,r){let n=await this.getOrResumeSession(e.sessionId),o=await this.applyTurnOverrides(n,e);await this.applyChatModeOverride(e.sessionId,o,e),this.applySandboxOverride(e.sessionId,o);let s=e.message;await this.expandPromptTemplate(e.sessionId,e,e.chatMode),await this.applyChatModeSelection(o,e);let c={prompt:e.message,...e.message!==s?{displayPrompt:s}:{},...e.sendMode?{mode:e.sendMode}:{}};this.applyAgentModeOverride(o,e,c);let l=e.chatMode==="inline-ask"||e.chatMode==="inline";if(e.references?.length&&!l){let m=o2n(e.references,this.ctx);m.length>0&&(c.attachments=m)}if(l){let m=this.registry.getConfinedFile(e.sessionId);if(m){let g=e.references?.find(y=>y.type==="file"&&y.uri===m),A=await qGn(m,g,this.ctx);if(A.promptFragment&&(c.prompt=`${c.prompt}${A.promptFragment}`),A.isLargeFile){let y=e.chatMode==="inline-ask"?dat:Jar;o.updateOptions({availableTools:[...y,"view"]},{emitToolDefinitionsChanged:!0})}}}this.registry.getTurnLimiter(e.sessionId)?.reset();let u=performance.now(),d=this.registry.incrementTurnIndex(e.sessionId);this.turnDriver.wireAndSend(e.sessionId,o,c,d,r,!!e.providerName);let f={requestSource:RH,chatMode:this.registry.getChatMode(e.sessionId)??"agent",sessionId:e.sessionId,safeModelId:G$s(e.model,e.providerName),providerName:e.providerName??"",reasoningEffort:e.reasoningEffort??"",contextTier:e.contextTier??"",hasReferences:String((e.references?.length??0)>0),turnIndex:String(d)},h={totalTimeMs:performance.now()-u,messageCharLen:e.message.length,referenceCount:e.references?.length??0};return At(this.ctx,"backgroundAgent.send",f,h),Et(this.ctx,"backgroundAgent.send",Wt.createAndMarkAsIssued(f,h)),{}}async truncateHistory(e){let r=performance.now(),o=await(await this.getOrResumeSession(e.sessionId)).history.truncate({eventId:e.eventId});return At(this.ctx,"backgroundAgent.truncateHistory",{requestSource:RH,providerName:e.providerName,sessionId:e.sessionId,eventId:e.eventId},{totalTimeMs:performance.now()-r,eventsRemoved:o.eventsRemoved}),{eventId:e.eventId,eventsRemoved:o.eventsRemoved}}applyChatModeOverride(e,r,n){return PZn(this.ctx,e,r,n,this.registry)}applySandboxOverride(e,r){OZn(this.ctx,e,r,this.registry)}applyAgentModeOverride(e,r,n){kZn(e,r,n)}async injectRemoteUserMessage(e,r,n){let o=await this.getOrResumeSession(e),s={message:r};await this.expandPromptTemplate(e,s);let c={prompt:s.message,...s.message!==r?{displayPrompt:r}:{},source:n},l=performance.now(),u=this.registry.incrementTurnIndex(e);this.turnDriver.wireAndSend(e,o,c,u),At(this.ctx,"backgroundAgent.send",{requestSource:j$s,sessionId:e,safeModelId:"",providerName:"",reasoningEffort:"",contextTier:"",hasReferences:"false",turnIndex:String(u)},{totalTimeMs:performance.now()-l,messageCharLen:s.message.length,referenceCount:0})}expandPromptTemplate(e,r,n){return FZn(this.ctx,e,r,this.registry,n)}async destroySession(e){try{return await this.remoteController.tearDownForDestroy(e.sessionId),this.pendingExternalToolDefs.delete(e.sessionId),await this.registry.remove(e.sessionId),await(await this.ensureManager()).deleteSession(e.sessionId),{success:!0}}catch(r){return ty.error(this.ctx,`Failed to destroy session ${e.sessionId}:`,r),{success:!1}}}async stopSession(e){let r=performance.now(),n=await this.getOrResumeSession(e);ty.info(this.ctx,"Stopping session via abort:",e),n.abortManualCompaction()&&ty.info(this.ctx,"Aborted in-progress manual compaction:",e),n.clearPendingItems(),await n.abort(),At(this.ctx,"backgroundAgent.stop",{requestSource:RH,sessionId:e},{totalTimeMs:performance.now()-r})}async compactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);ty.info(this.ctx,"Compacting history for session:",e);let o=await n.compactHistory();return At(this.ctx,"backgroundAgent.compactHistory",{requestSource:RH,sessionId:e},{totalTimeMs:performance.now()-r,tokensRemoved:o.tokensRemoved,messagesRemoved:o.messagesRemoved}),{success:o.success,tokensRemoved:o.tokensRemoved,messagesRemoved:o.messagesRemoved,summaryContent:o.summaryContent,contextWindow:o.contextWindow}}async stopCompactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);ty.info(this.ctx,"Aborting manual compaction for session:",e);let o=n.abortManualCompaction();return At(this.ctx,"backgroundAgent.stopCompactHistory",{requestSource:RH,sessionId:e,aborted:String(o)},{totalTimeMs:performance.now()-r}),{aborted:o}}async getPlanPath(e){return(await this.getOrResumeSession(e)).getPlanPath()}async resumeSession(e){let r=performance.now();ty.info(this.ctx,"resumeSession called:",e.sessionId);let n=await this.getOrResumeSession(e.sessionId,e),o=Array.from(n.getEvents());At(this.ctx,"backgroundAgent.resume",{requestSource:RH,reasoningEffort:e.reasoningEffort??"",sessionId:e.sessionId},{totalTimeMs:performance.now()-r});let s=o.filter(c=>!H$s.has(c.type));return{sessionId:e.sessionId,workspacePath:n.workspacePath,events:s}}async listSessions(e){let n=await(await this.ensureManager()).listSessions(),o=n;return e&&(o=n.filter(s=>!(e.cwd&&s.context?.cwd!==e.cwd||e.gitRoot&&s.context?.gitRoot!==e.gitRoot||e.repository&&s.context?.repository!==e.repository||e.branch&&s.context?.branch!==e.branch))),{sessions:o.map(s=>({sessionId:s.sessionId,startTime:s.startTime instanceof Date?s.startTime.toISOString():String(s.startTime),modifiedTime:s.modifiedTime instanceof Date?s.modifiedTime.toISOString():String(s.modifiedTime),summary:s.summary,isRemote:s.isRemote,context:s.context}))}}async listModels(e){ty.info(this.ctx,"listModels called",{forceRefresh:e}),await this.managerLifecycle.ensureManager();let r=performance.now();try{let n=await this.ctx.get(xs).getMetadata(e),o=this.sdk?.EXCLUDED_MODELS,s=n.filter(u=>u.model_picker_enabled===!0).filter(u=>u.capabilities.type==="chat").filter(u=>!o?.has(u.id)).map(Drt);s.length===0?ty.warn(this.ctx,"No models available. Check authentication and Copilot subscription status."):ty.info(this.ctx,`Successfully retrieved ${s.length} models`);let c=[];this.ctx.get(jl).getPolicyValue("autoModel.enabled")!==!1&&c.push(this.buildAutoModelEntry());let l=[...c,...s];return ty.debug(this.ctx,"Models retrieved:",l.map(u=>u.id)),At(this.ctx,"backgroundAgent.listModels",{status_text:"success"},{duration_ms:performance.now()-r,model_count:l.length}),{models:l}}catch(n){let o=n instanceof Error?n.message:String(n),s=kZt(n);throw ty.error(this.ctx,"listModels failed",{error:o,cause:s,stack:n instanceof Error?n.stack:void 0}),Vn(this.ctx,"backgroundAgent.listModels",n,{status_text:"failure",...s?{errorCause:s}:{}},{duration_ms:performance.now()-r}),new Error("Failed to retrieve models",{cause:n})}}buildAutoModelEntry(){return{id:this.sdk.AUTO_MODEL_ID,name:"Auto",preview:!1,capabilities:{family:this.sdk.AUTO_MODEL_ID,supports:{vision:!0},limits:{max_context_window_tokens:0}}}}async enableRemote(e){let r=await this.getOrResumeSession(e);return this.remoteController.enableForSession(e,r)}async disableRemote(e){let r=await this.getOrResumeSession(e);await this.remoteController.disableForSession(r)}getRemoteStatus(e){return this.remoteController.getStatus(e)}async shutdown(){this.mcpSync.dispose(),this._skillsEnabledListener?.dispose(),this._skillsEnabledListener=void 0,await this.clearUserScopedState(),Kar(),c2n(),await this.managerLifecycle.dispose()}};function G$s(t,e){return e?"byok models":t??""}a(G$s,"safeModelId");p();p();var Ap=(o=>(o.Background="BACKGROUND",o.Claude="CLAUDE",o.Codex="CODEX",o.Cloud="CLOUD",o))(Ap||{});p();async function kb(t,e,r){let n=performance.now(),o={properties:{},measurements:{}};try{let s=await r(o);return UZn(t,e,n,o),s}catch(s){throw o.error??=s,UZn(t,e,n,o),s}}a(kb,"runWithTelemetry");function UZn(t,e,r,n){let s={success:n.error?"false":n.ok??!0?"true":"false",...n.properties},c={totalTimeMs:performance.now()-r,...n.measurements};n.error!==void 0?Vn(t,`${e}.failure`,n.error,s,c):At(t,e,s,c)}a(UZn,"flushTelemetry");p();var QZn=de(require("path"));p();var _fr=["default","acceptEdits","bypassPermissions","plan","auto"];function VX(t,e){if(e!=="CLAUDE")throw new Error(`ClaudeCodeAgentService.${t}: expected agentProvider='CLAUDE', got '${String(e)}'`)}a(VX,"assertClaudeProvider");function Khe(t,e,r){if(typeof r!="string"||r.length===0)throw new Error(`${t}: ${e} is required`)}a(Khe,"assertNonEmptyString");function $$s(t,e,r){if(r===void 0)throw new Error(`${t}: ${e} is required`);try{to(r)}catch(n){throw new Error(`${t}: ${e} is not a valid URI: ${r}`,{cause:n})}}a($$s,"assertFsUri");function V$s(t,e,r){if(!QZn.isAbsolute(r))throw new Error(`${t}: ${e} must be an absolute path, got '${r}'`)}a(V$s,"assertAbsolutePath");function W$s(t,e){if(e!==void 0&&!_fr.includes(e))throw new Error(`${t}: agentMode must be one of ${_fr.join(", ")}, got '${e}'`)}a(W$s,"assertAllowedAgentMode");async function rNe(t,e){if(e===void 0)return;let n=(await t.get(xs).getMetadata()).find(o=>o.id===e);if(!n)throw new Error(`Unknown model id: ${e}`);if(!w$e(n.capabilities.family))throw new Error(`Model ${e} is not a Claude model (family: ${n.capabilities.family})`)}a(rNe,"validateClaudeModel");async function qZn(t,e){VX("createSession",e.agentProvider),$$s("createSession","workspaceFolder.uri",e.workspaceFolder?.uri),await rNe(t,e.model)}a(qZn,"validateAgentCreate");async function jZn(t,e){VX("resumeSession",e.agentProvider),Khe("resumeSession","sessionId",e.sessionId),await rNe(t,e.model)}a(jZn,"validateAgentResume");async function HZn(t,e){VX("sendMessage",e.agentProvider),Khe("sendMessage","sessionId",e.sessionId),Khe("sendMessage","message",e.message),W$s("sendMessage",e.agentMode),await rNe(t,e.model)}a(HZn,"validateAgentSend");function GZn(t,e){VX("stopSession",e.agentProvider),Khe("stopSession","sessionId",e.sessionId)}a(GZn,"validateAgentStop");function $Zn(t,e){VX("destroySession",e.agentProvider),Khe("destroySession","sessionId",e.sessionId)}a($Zn,"validateAgentDestroy");function VZn(t,e){VX("listSessions",e.agentProvider),Khe("listSessions","cwd",e.cwd),V$s("listSessions","cwd",e.cwd)}a(VZn,"validateAgentListSessions");function WZn(t,e){VX("listModels",e.agentProvider)}a(WZn,"validateAgentListModels");p();p();p();var JZn=require("child_process"),Jhe=de(require("path")),ZZn=de(AP()),XZn=require("util");var zZn=5e3,YZn=200,Zhe=class{constructor(e){this.execFile=(0,XZn.promisify)(JZn.execFile);this.cache=new Map;this.config=e}static{a(this,"BaseCliVersionChecker")}check(e){if(!e)return Promise.resolve({severity:"error",message:this.config.notConfiguredMessage});let r=Jhe.resolve(e),n=this.cache.get(r);if(n)return n;let o=this.computeStatus(r).then(s=>(s.severity==="error"&&this.cache.delete(r),s));return this.cache.set(r,o),o}clearCache(e){if(e){this.cache.delete(Jhe.resolve(e));return}this.cache.clear()}async computeStatus(e){let r=this.validateBasename(e);if(r)return{severity:"error",message:r};let n;try{n=(await this.execFile(e,["--version"],{timeout:zZn,windowsHide:!0})).stdout}catch(c){return{severity:"error",message:this.formatSpawnError(e,c)}}let o=ZZn.coerce(n);if(!o)return{severity:"error",message:`Could not parse ${this.config.displayName} version from "${e}" --version output: "${KZn(n)}". Cannot verify compatibility.`};let s=this.config.validateVersion(o,e);return s||{severity:"ok"}}validateBasename(e){let r=this.config.allowedBasenames;if(!r||r.length===0)return;let n=Jhe.basename(e).toLowerCase();if(!r.includes(n))return`${this.config.displayName} path "${e}" must point at the "${r[0]}" executable, but the basename is "${Jhe.basename(e)}".`}formatSpawnError(e,r){let n=r;if(n?.code==="ENOENT")return`${this.config.displayName} not found at "${e}". Check that the file exists and is executable.`;if(n?.killed&&n?.signal==="SIGTERM")return`${this.config.displayName} at "${e}" did not respond to --version within ${zZn/1e3}s.`;let o=typeof n?.stderr=="string"?KZn(n.stderr):"",s=n?.code!==void 0?` (exit code ${String(n.code)})`:"",c=o?` stderr: "${o}"`:"",l=n?.message?`: ${n.message}`:"";return`Failed to run "${e} --version"${s}${l}${c}`}};function KZn(t){let e=t.trim();return e.length<=YZn?e:`${e.slice(0,YZn)}\u2026`}a(KZn,"truncate");var klt=de(AP());function z$s(){let t=oIe.anthropicClaude?.cliPackageVersion;return typeof t=="string"?t:""}a(z$s,"getExpectedVersionRaw");var vfr=class extends Zhe{static{a(this,"ClaudeCliVersionChecker")}constructor(){super({displayName:"Claude Code CLI",allowedBasenames:process.platform==="win32"?["claude.exe"]:["claude"],notConfiguredMessage:"Claude Code CLI path is not configured. Install @anthropic-ai/claude-code (e.g. `npm install -g @anthropic-ai/claude-code`), then open your editor's Copilot settings and set the Claude Code CLI Path field to the absolute path of the `claude` executable.",validateVersion(e,r){let n=z$s(),o=klt.coerce(n);if(!o)return{severity:"error",message:`Could not parse expected Claude Code CLI version "${n}" from packaged metadata. This is an internal error; please report it.`};if(!klt.satisfies(e,`~${o.major}.${o.minor}.0`))return{severity:"warning",message:`Claude Code CLI at "${r}" reports version ${e.version}, but this language server was built against ${o.version}. The session will still start, but SDK behavior may be unstable on protocol drift. Run \`npm install -g @anthropic-ai/claude-code@${o.version}\` to align versions.`}}})}},Xhe=new vfr;p();var eme=class{constructor(){this._entries=new Map}static{a(this,"PendingRequestRegistry")}register(e){if(this._entries.has(e))throw new Error(`PendingRequestRegistry: duplicate key ${e}`);return{promise:new Promise((n,o)=>{this._entries.set(e,{resolve:n,reject:o})}),isSettled:a(()=>!this._entries.has(e),"isSettled")}}respond(e,r){let n=this._entries.get(e);return n?(this._entries.delete(e),n.resolve(r),!0):!1}rejectOne(e,r){let n=this._entries.get(e);return n?(this._entries.delete(e),n.reject(r),!0):!1}has(e){return this._entries.has(e)}respondAll(e){let r=[...this._entries.values()];this._entries.clear();for(let n of r)n.resolve(e)}rejectAll(e){let r=[...this._entries.values()];this._entries.clear();for(let n of r)n.reject(e)}};p();function eXn(t,e,r){let n=r.toolUseID,s={intention:r.title??`${t} tool call`,...n!==void 0&&{toolCallId:n}},c=a(l=>typeof l=="string"?l:void 0,"str");switch(t){case"Bash":return{...s,kind:"shell",fullCommandText:c(e.command)??""};case"Write":case"Edit":case"MultiEdit":case"NotebookEdit":return{...s,kind:"write",fileName:c(r.blockedPath)??c(e.file_path)??c(e.notebook_path)??""};case"Read":return{...s,kind:"read",path:c(r.blockedPath)??c(e.file_path)??""};case"WebFetch":return{...s,kind:"url",url:c(e.url)??""};default:{if(t.startsWith("mcp__")){let l=t.split("__");return{...s,kind:"mcp",serverName:l[1]??"",toolName:l.slice(2).join("__"),args:e}}return{...s,kind:"custom-tool",toolName:t,args:e}}}}a(eXn,"buildPermissionRequest");function tXn(t,e){return t.kind==="approve-once"?{behavior:"allow",updatedInput:e}:{behavior:"deny",message:Y$s(t)}}a(tXn,"translatePermissionResult");function Y$s(t){switch(t.kind){case"denied-by-rules":return"Permission denied by approval rules";case"denied-no-approval-rule-and-could-not-request-from-user":return"Permission denied: no approval rule and user prompt unavailable";case"denied-interactively-by-user":return t.feedback?`Permission denied by user: ${t.feedback}`:"Permission denied by user";case"denied-by-content-exclusion-policy":return`Permission denied by content-exclusion policy: ${t.message}`;default:return`Permission denied: ${t.kind}`}}a(Y$s,"formatDenyMessage");function rXn(t){let e=t;if(!Array.isArray(e.questions))return null;let r=[];for(let n of e.questions){if(typeof n?.question!="string"||n.question.length===0)return null;r.push({questionText:n.question,header:typeof n.header=="string"&&n.header.length>0?n.header:void 0,choices:Array.isArray(n.options)?n.options.map(o=>o?.label).filter(o=>typeof o=="string"):void 0})}return r}a(rXn,"buildPreparedQuestions");function nXn(t,e){return{question:t.header?`${t.header} -${t.questionText}`:t.questionText,...t.choices!==void 0&&{choices:t.choices},allowFreeform:!0,...e!==void 0&&{toolCallId:e}}}a(nXn,"buildUserInputRequest");p();var iXn=require("crypto");var K$s=new fe("ClaudeOTelTracker");function Cfr(t){return(0,iXn.randomUUID)().replace(/-/g,"").slice(0,t*2)}a(Cfr,"generateHexId");function Plt(){return BigInt(Date.now())*1000000n}a(Plt,"nowNano");var Dlt=class{constructor(e,r,n){this._ctx=e;this._sessionId=r;this._persistence=n;this._toolSpans=new Map;this._inputTokens=0;this._outputTokens=0;this._cacheReadTokens=0;this._cacheCreationTokens=0}static{a(this,"ClaudeOTelTracker")}startRequest(e){this._rootSpan&&this._endRootSpan(2,"New request started before previous ended");let r=Cfr(16),n=Cfr(8);this._rootSpan={traceId:r,spanId:n,name:"invoke_agent claude",startNano:Plt(),attributes:{[Jo.OPERATION_NAME]:"invoke_agent",[Jo.AGENT_NAME]:"claude",[Jo.SYSTEM]:"anthropic",[Jo.CONVERSATION_ID]:this._sessionId,...e?{[Jo.REQUEST_MODEL]:e}:{}}},this._inputTokens=0,this._outputTokens=0,this._cacheReadTokens=0,this._cacheCreationTokens=0,this._toolSpans.clear()}onMessage(e){if(this._rootSpan)switch(e.type){case"assistant":this._onAssistantMessage(e);break;case"user":this._onUserMessage(e);break;case"result":this._onResultMessage(e);break}}endRequest(){this._endRootSpan(1)}endRequestWithError(e){this._endRootSpan(2,e)}_onAssistantMessage(e){if(e.parent_tool_use_id!=null)return;let r=e.message?.content;if(Array.isArray(r))for(let n of r)n.type==="tool_use"&&this._startToolSpan(n.id,n.name)}_onUserMessage(e){let r=e.message?.content;if(Array.isArray(r)){for(let n of r)if(n.type==="tool_result"&&typeof n.tool_use_id=="string"){let o=n.is_error===!0;this._endToolSpan(n.tool_use_id,o)}}}_onResultMessage(e){if(!this._rootSpan)return;let r=e.usage;if(r&&(this._inputTokens=r.input_tokens??0,this._outputTokens=r.output_tokens??0,this._cacheReadTokens=r.cache_read_input_tokens??0,this._cacheCreationTokens=r.cache_creation_input_tokens??0),e.modelUsage){let n=Object.keys(e.modelUsage);n.length>0&&(this._rootSpan.attributes[Jo.RESPONSE_MODEL]=n[0])}typeof e.num_turns=="number"&&(this._rootSpan.attributes[Jo.TURN_COUNT]=e.num_turns),typeof e.total_cost_usd=="number"&&(this._rootSpan.attributes[Jo.TOTAL_COST_USD]=e.total_cost_usd)}_startToolSpan(e,r){!this._rootSpan||this._toolSpans.has(e)||this._toolSpans.set(e,{traceId:this._rootSpan.traceId,spanId:Cfr(8),parentSpanId:this._rootSpan.spanId,name:`execute_tool ${r}`,startNano:Plt(),attributes:{[Jo.OPERATION_NAME]:"execute_tool",[Jo.TOOL_NAME]:r,[Jo.TOOL_CALL_ID]:e,[Jo.CONVERSATION_ID]:this._sessionId}})}_endToolSpan(e,r){let n=this._toolSpans.get(e);if(!n)return;this._toolSpans.delete(e);let o=Plt(),s=this._buildOtlpSpan(n,o,r?2:1,r?"Tool execution error":void 0);this._flush([s])}_endRootSpan(e,r){let n=this._rootSpan;if(!n)return;this._rootSpan=void 0,this._inputTokens>0&&(n.attributes[Jo.USAGE_INPUT_TOKENS]=this._inputTokens),this._outputTokens>0&&(n.attributes[Jo.USAGE_OUTPUT_TOKENS]=this._outputTokens),this._cacheReadTokens>0&&(n.attributes[Jo.USAGE_CACHE_READ_INPUT_TOKENS]=this._cacheReadTokens),this._cacheCreationTokens>0&&(n.attributes[Jo.USAGE_CACHE_CREATION_INPUT_TOKENS]=this._cacheCreationTokens);let o=Plt(),s=[];for(let[,l]of this._toolSpans)s.push(this._buildOtlpSpan(l,o,2,"Tool span orphaned at turn end"));this._toolSpans.clear();let c=this._buildOtlpSpan(n,o,e,r);this._flush([...s,c])}_buildOtlpSpan(e,r,n,o){let s={traceId:e.traceId,spanId:e.spanId,name:e.name,kind:1,startTimeUnixNano:e.startNano.toString(),endTimeUnixNano:r.toString(),attributes:k2(e.attributes),events:[],status:o?{code:n,message:o}:{code:n}};return e.parentSpanId&&(s.parentSpanId=e.parentSpanId),s}_flush(e){e.length!==0&&this._persistence.appendSpans(e).catch(r=>{K$s.warn(this._ctx,`Failed to persist OTel spans for session=${this._sessionId}: ${r instanceof Error?r.message:String(r)}`)})}};p();var bfr=require("fs"),sXn=de(require("path"));var nNe=new fe("ClaudeCode.ReferenceFormatter"),J$s={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp"},oXn=5*1024*1024;async function aXn(t,e){if(!t?.length)return[];let r=[],n=[];for(let s of t)switch(s.type){case"file":{let c=rs(s.uri);if(!c){nNe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}let l=X$s(c);if(l){let u=await Z$s(c,l,e);u&&r.push(u)}else{let u=s.selection?`:L${s.selection.start.line+1}-L${s.selection.end.line+1}`:"";n.push(`- ${c}${u}`)}break}case"directory":{let c=rs(s.uri);if(!c){nNe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}n.push(`- ${c}/`);break}default:nNe.debug(e,`Skipping unsupported reference type: ${s.type}`);break}let o=[...r];return n.length>0&&o.push({type:"text",text:eVs(n)}),o}a(aXn,"buildReferences");async function Z$s(t,e,r){try{let n=await bfr.promises.stat(t);if(n.size>oXn){nNe.debug(r,`Skipping oversize image reference (${n.size} > ${oXn} bytes): ${t}`);return}let o=(await bfr.promises.readFile(t)).toString("base64");return{type:"image",source:{type:"base64",media_type:e,data:o}}}catch(n){nNe.debug(r,`Failed to read image reference ${t}: ${n instanceof Error?n.message:String(n)}`);return}}a(Z$s,"tryReadImageBlock");function X$s(t){return J$s[sXn.extname(t).toLowerCase()]}a(X$s,"imageMediaTypeForPath");function eVs(t){return` +`)}updateAttemptCount(e){if(e.length!==this.lastChanges.length){this.attemptCount=0;return}for(let r=0;rt.webcrypto);async function J9s(t){return(await Llr).getRandomValues(new Uint8Array(t))}a(J9s,"getRandomValues");async function Z9s(t){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r="",n=await J9s(t);for(let o=0;o128)throw`Expected a length between 43 and 128. Received ${t}.`;let e=await X9s(t),r=await eUs(e);return{code_verifier:e,code_challenge:r}}a(Blr,"pkceChallenge");p();var eR="2025-11-25";var Cct=[eR,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],bH="io.modelcontextprotocol/related-task",bct="2.0",v0=IZt(t=>t!==null&&(typeof t=="object"||typeof t=="function")),ozn=Il([Ze(),ka().int()]),szn=Ze(),P_f=um({ttl:ka().optional(),pollInterval:ka().optional()}),rUs=zr({ttl:ka().optional()}),nUs=zr({taskId:Ze()}),Ulr=um({progressToken:ozn.optional(),[bH]:nUs.optional()}),qT=zr({_meta:Ulr.optional()}),iDe=qT.extend({task:rUs.optional()}),azn=a(t=>iDe.safeParse(t).success,"isTaskAugmentedRequestParams"),KA=zr({method:Ze(),params:qT.loose().optional()}),tR=zr({_meta:Ulr.optional()}),rR=zr({method:Ze(),params:tR.loose().optional()}),JA=um({_meta:Ulr.optional()}),Sct=Il([Ze(),ka().int()]),czn=zr({jsonrpc:Gn(bct),id:Sct,...KA.shape}).strict(),oDe=a(t=>czn.safeParse(t).success,"isJSONRPCRequest"),lzn=zr({jsonrpc:Gn(bct),...rR.shape}).strict(),uzn=a(t=>lzn.safeParse(t).success,"isJSONRPCNotification"),Qlr=zr({jsonrpc:Gn(bct),id:Sct,result:JA}).strict(),TX=a(t=>Qlr.safeParse(t).success,"isJSONRPCResultResponse");var Zn;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Zn||(Zn={}));var qlr=zr({jsonrpc:Gn(bct),id:Sct.optional(),error:zr({code:ka().int(),message:Ze(),data:ld().optional()})}).strict();var dzn=a(t=>qlr.safeParse(t).success,"isJSONRPCErrorResponse");var SH=Il([czn,lzn,Qlr,qlr]),D_f=Il([Qlr,qlr]),IX=JA.strict(),iUs=tR.extend({requestId:Sct.optional(),reason:Ze().optional()}),Tct=rR.extend({method:Gn("notifications/cancelled"),params:iUs}),oUs=zr({src:Ze(),mimeType:Ze().optional(),sizes:Ur(Ze()).optional(),theme:sv(["light","dark"]).optional()}),sDe=zr({icons:Ur(oUs).optional()}),vhe=zr({name:Ze(),title:Ze().optional()}),fzn=vhe.extend({...vhe.shape,...sDe.shape,version:Ze(),websiteUrl:Ze().optional(),description:Ze().optional()}),sUs=ske(zr({applyDefaults:ol().optional()}),xl(Ze(),ld())),aUs=zrt(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,ske(zr({form:sUs.optional(),url:v0.optional()}),xl(Ze(),ld()).optional())),cUs=um({list:v0.optional(),cancel:v0.optional(),requests:um({sampling:um({createMessage:v0.optional()}).optional(),elicitation:um({create:v0.optional()}).optional()}).optional()}),lUs=um({list:v0.optional(),cancel:v0.optional(),requests:um({tools:um({call:v0.optional()}).optional()}).optional()}),uUs=zr({experimental:xl(Ze(),v0).optional(),sampling:zr({context:v0.optional(),tools:v0.optional()}).optional(),elicitation:aUs.optional(),roots:zr({listChanged:ol().optional()}).optional(),tasks:cUs.optional(),extensions:xl(Ze(),v0).optional()}),dUs=qT.extend({protocolVersion:Ze(),capabilities:uUs,clientInfo:fzn}),fUs=KA.extend({method:Gn("initialize"),params:dUs});var pUs=zr({experimental:xl(Ze(),v0).optional(),logging:v0.optional(),completions:v0.optional(),prompts:zr({listChanged:ol().optional()}).optional(),resources:zr({subscribe:ol().optional(),listChanged:ol().optional()}).optional(),tools:zr({listChanged:ol().optional()}).optional(),tasks:lUs.optional(),extensions:xl(Ze(),v0).optional()}),jlr=JA.extend({protocolVersion:Ze(),capabilities:pUs,serverInfo:fzn,instructions:Ze().optional()}),pzn=rR.extend({method:Gn("notifications/initialized"),params:tR.optional()}),hzn=a(t=>pzn.safeParse(t).success,"isInitializedNotification"),Ict=KA.extend({method:Gn("ping"),params:qT.optional()}),hUs=zr({progress:ka(),total:Tu(ka()),message:Tu(Ze())}),mUs=zr({...tR.shape,...hUs.shape,progressToken:ozn}),xct=rR.extend({method:Gn("notifications/progress"),params:mUs}),gUs=qT.extend({cursor:szn.optional()}),aDe=KA.extend({params:gUs.optional()}),cDe=JA.extend({nextCursor:szn.optional()}),AUs=sv(["working","input_required","completed","failed","cancelled"]),lDe=zr({taskId:Ze(),status:AUs,ttl:Il([ka(),jrt()]),createdAt:Ze(),lastUpdatedAt:Ze(),pollInterval:Tu(ka()),statusMessage:Tu(Ze())}),xX=JA.extend({task:lDe}),yUs=tR.merge(lDe),uDe=rR.extend({method:Gn("notifications/tasks/status"),params:yUs}),wct=KA.extend({method:Gn("tasks/get"),params:qT.extend({taskId:Ze()})}),Rct=JA.merge(lDe),kct=KA.extend({method:Gn("tasks/result"),params:qT.extend({taskId:Ze()})}),N_f=JA.loose(),Pct=aDe.extend({method:Gn("tasks/list")}),Dct=cDe.extend({tasks:Ur(lDe)}),Nct=KA.extend({method:Gn("tasks/cancel"),params:qT.extend({taskId:Ze()})}),mzn=JA.merge(lDe),gzn=zr({uri:Ze(),mimeType:Tu(Ze()),_meta:xl(Ze(),ld()).optional()}),Azn=gzn.extend({text:Ze()}),Hlr=Ze().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),yzn=gzn.extend({blob:Hlr}),dDe=sv(["user","assistant"]),Che=zr({audience:Ur(dDe).optional(),priority:ka().min(0).max(1).optional(),lastModified:Kde.datetime({offset:!0}).optional()}),Ezn=zr({...vhe.shape,...sDe.shape,uri:Ze(),description:Tu(Ze()),mimeType:Tu(Ze()),size:Tu(ka()),annotations:Che.optional(),_meta:Tu(um({}))}),EUs=zr({...vhe.shape,...sDe.shape,uriTemplate:Ze(),description:Tu(Ze()),mimeType:Tu(Ze()),annotations:Che.optional(),_meta:Tu(um({}))}),_Us=aDe.extend({method:Gn("resources/list")}),Glr=cDe.extend({resources:Ur(Ezn)}),vUs=aDe.extend({method:Gn("resources/templates/list")}),$lr=cDe.extend({resourceTemplates:Ur(EUs)}),Vlr=qT.extend({uri:Ze()}),CUs=Vlr,bUs=KA.extend({method:Gn("resources/read"),params:CUs}),Wlr=JA.extend({contents:Ur(Il([Azn,yzn]))}),p8=rR.extend({method:Gn("notifications/resources/list_changed"),params:tR.optional()}),SUs=Vlr,TUs=KA.extend({method:Gn("resources/subscribe"),params:SUs}),IUs=Vlr,xUs=KA.extend({method:Gn("resources/unsubscribe"),params:IUs}),wUs=tR.extend({uri:Ze()}),zlr=rR.extend({method:Gn("notifications/resources/updated"),params:wUs}),RUs=zr({name:Ze(),description:Tu(Ze()),required:Tu(ol())}),kUs=zr({...vhe.shape,...sDe.shape,description:Tu(Ze()),arguments:Tu(Ur(RUs)),_meta:Tu(um({}))}),PUs=aDe.extend({method:Gn("prompts/list")}),Ylr=cDe.extend({prompts:Ur(kUs)}),DUs=qT.extend({name:Ze(),arguments:xl(Ze(),Ze()).optional()}),NUs=KA.extend({method:Gn("prompts/get"),params:DUs}),Klr=zr({type:Gn("text"),text:Ze(),annotations:Che.optional(),_meta:xl(Ze(),ld()).optional()}),Jlr=zr({type:Gn("image"),data:Hlr,mimeType:Ze(),annotations:Che.optional(),_meta:xl(Ze(),ld()).optional()}),Zlr=zr({type:Gn("audio"),data:Hlr,mimeType:Ze(),annotations:Che.optional(),_meta:xl(Ze(),ld()).optional()}),MUs=zr({type:Gn("tool_use"),name:Ze(),id:Ze(),input:xl(Ze(),ld()),_meta:xl(Ze(),ld()).optional()}),OUs=zr({type:Gn("resource"),resource:Il([Azn,yzn]),annotations:Che.optional(),_meta:xl(Ze(),ld()).optional()}),LUs=Ezn.extend({type:Gn("resource_link")}),Xlr=Il([Klr,Jlr,Zlr,LUs,OUs]),BUs=zr({role:dDe,content:Xlr}),eur=JA.extend({description:Ze().optional(),messages:Ur(BUs)}),h8=rR.extend({method:Gn("notifications/prompts/list_changed"),params:tR.optional()}),FUs=zr({title:Ze().optional(),readOnlyHint:ol().optional(),destructiveHint:ol().optional(),idempotentHint:ol().optional(),openWorldHint:ol().optional()}),UUs=zr({taskSupport:sv(["required","optional","forbidden"]).optional()}),_zn=zr({...vhe.shape,...sDe.shape,description:Ze().optional(),inputSchema:zr({type:Gn("object"),properties:xl(Ze(),v0).optional(),required:Ur(Ze()).optional()}).catchall(ld()),outputSchema:zr({type:Gn("object"),properties:xl(Ze(),v0).optional(),required:Ur(Ze()).optional()}).catchall(ld()).optional(),annotations:FUs.optional(),execution:UUs.optional(),_meta:xl(Ze(),ld()).optional()}),QUs=aDe.extend({method:Gn("tools/list")}),tur=cDe.extend({tools:Ur(_zn)}),TH=JA.extend({content:Ur(Xlr).default([]),structuredContent:xl(Ze(),ld()).optional(),isError:ol().optional()}),M_f=TH.or(JA.extend({toolResult:ld()})),qUs=iDe.extend({name:Ze(),arguments:xl(Ze(),ld()).optional()}),jUs=KA.extend({method:Gn("tools/call"),params:qUs}),m8=rR.extend({method:Gn("notifications/tools/list_changed"),params:tR.optional()}),vzn=zr({autoRefresh:ol().default(!0),debounceMs:ka().int().nonnegative().default(300)}),Czn=sv(["debug","info","notice","warning","error","critical","alert","emergency"]),HUs=qT.extend({level:Czn}),GUs=KA.extend({method:Gn("logging/setLevel"),params:HUs}),$Us=tR.extend({level:Czn,logger:Ze().optional(),data:ld()}),wX=rR.extend({method:Gn("notifications/message"),params:$Us}),VUs=zr({name:Ze().optional()}),WUs=zr({hints:Ur(VUs).optional(),costPriority:ka().min(0).max(1).optional(),speedPriority:ka().min(0).max(1).optional(),intelligencePriority:ka().min(0).max(1).optional()}),zUs=zr({mode:sv(["auto","required","none"]).optional()}),YUs=zr({type:Gn("tool_result"),toolUseId:Ze().describe("The unique identifier for the corresponding tool call."),content:Ur(Xlr).default([]),structuredContent:zr({}).loose().optional(),isError:ol().optional(),_meta:xl(Ze(),ld()).optional()}),KUs=Vrt("type",[Klr,Jlr,Zlr]),vct=Vrt("type",[Klr,Jlr,Zlr,MUs,YUs]),JUs=zr({role:dDe,content:Il([vct,Ur(vct)]),_meta:xl(Ze(),ld()).optional()}),ZUs=iDe.extend({messages:Ur(JUs),modelPreferences:WUs.optional(),systemPrompt:Ze().optional(),includeContext:sv(["none","thisServer","allServers"]).optional(),temperature:ka().optional(),maxTokens:ka().int(),stopSequences:Ur(Ze()).optional(),metadata:v0.optional(),tools:Ur(_zn).optional(),toolChoice:zUs.optional()}),fDe=KA.extend({method:Gn("sampling/createMessage"),params:ZUs}),rur=JA.extend({model:Ze(),stopReason:Tu(sv(["endTurn","stopSequence","maxTokens"]).or(Ze())),role:dDe,content:KUs}),nur=JA.extend({model:Ze(),stopReason:Tu(sv(["endTurn","stopSequence","maxTokens","toolUse"]).or(Ze())),role:dDe,content:Il([vct,Ur(vct)])}),XUs=zr({type:Gn("boolean"),title:Ze().optional(),description:Ze().optional(),default:ol().optional()}),e7s=zr({type:Gn("string"),title:Ze().optional(),description:Ze().optional(),minLength:ka().optional(),maxLength:ka().optional(),format:sv(["email","uri","date","date-time"]).optional(),default:Ze().optional()}),t7s=zr({type:sv(["number","integer"]),title:Ze().optional(),description:Ze().optional(),minimum:ka().optional(),maximum:ka().optional(),default:ka().optional()}),r7s=zr({type:Gn("string"),title:Ze().optional(),description:Ze().optional(),enum:Ur(Ze()),default:Ze().optional()}),n7s=zr({type:Gn("string"),title:Ze().optional(),description:Ze().optional(),oneOf:Ur(zr({const:Ze(),title:Ze()})),default:Ze().optional()}),i7s=zr({type:Gn("string"),title:Ze().optional(),description:Ze().optional(),enum:Ur(Ze()),enumNames:Ur(Ze()).optional(),default:Ze().optional()}),o7s=Il([r7s,n7s]),s7s=zr({type:Gn("array"),title:Ze().optional(),description:Ze().optional(),minItems:ka().optional(),maxItems:ka().optional(),items:zr({type:Gn("string"),enum:Ur(Ze())}),default:Ur(Ze()).optional()}),a7s=zr({type:Gn("array"),title:Ze().optional(),description:Ze().optional(),minItems:ka().optional(),maxItems:ka().optional(),items:zr({anyOf:Ur(zr({const:Ze(),title:Ze()}))}),default:Ur(Ze()).optional()}),c7s=Il([s7s,a7s]),l7s=Il([i7s,o7s,c7s]),u7s=Il([l7s,XUs,e7s,t7s]),d7s=iDe.extend({mode:Gn("form").optional(),message:Ze(),requestedSchema:zr({type:Gn("object"),properties:xl(Ze(),u7s),required:Ur(Ze()).optional()})}),f7s=iDe.extend({mode:Gn("url"),message:Ze(),elicitationId:Ze(),url:Ze().url()}),p7s=Il([d7s,f7s]),pDe=KA.extend({method:Gn("elicitation/create"),params:p7s}),h7s=tR.extend({elicitationId:Ze()}),m7s=rR.extend({method:Gn("notifications/elicitation/complete"),params:h7s}),iur=JA.extend({action:sv(["accept","decline","cancel"]),content:zrt(t=>t===null?void 0:t,xl(Ze(),Il([Ze(),ka(),ol(),Ur(Ze())])).optional())}),g7s=zr({type:Gn("ref/resource"),uri:Ze()});var A7s=zr({type:Gn("ref/prompt"),name:Ze()}),y7s=qT.extend({ref:Il([A7s,g7s]),argument:zr({name:Ze(),value:Ze()}),context:zr({arguments:xl(Ze(),Ze()).optional()}).optional()}),E7s=KA.extend({method:Gn("completion/complete"),params:y7s});var our=JA.extend({completion:um({values:Ur(Ze()).max(100),total:Tu(ka().int()),hasMore:Tu(ol())})}),_7s=zr({uri:Ze().startsWith("file://"),name:Ze().optional(),_meta:xl(Ze(),ld()).optional()}),sur=KA.extend({method:Gn("roots/list"),params:qT.optional()}),v7s=JA.extend({roots:Ur(_7s)}),C7s=rR.extend({method:Gn("notifications/roots/list_changed"),params:tR.optional()}),O_f=Il([Ict,fUs,E7s,GUs,NUs,PUs,_Us,vUs,bUs,TUs,xUs,jUs,QUs,wct,kct,Pct,Nct]),L_f=Il([Tct,xct,pzn,C7s,uDe]),B_f=Il([IX,rur,nur,iur,v7s,Rct,Dct,xX]),F_f=Il([Ict,fDe,pDe,sur,wct,kct,Pct,Nct]),U_f=Il([Tct,xct,wX,zlr,p8,m8,h8,uDe,m7s]),Q_f=Il([IX,jlr,our,eur,Ylr,Glr,$lr,Wlr,TH,tur,Rct,Dct,xX]),Un=class t extends Error{static{a(this,"McpError")}constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===Zn.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Flr(o.elicitations,r)}return new t(e,r,n)}},Flr=class extends Un{static{a(this,"UrlElicitationRequiredError")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Zn.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};p();var ZA=tZt().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:xZt.custom,message:"URL must be parseable",fatal:!0}),ERe}).refine(t=>{let e=new URL(t);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Szn=um({resource:Ze().url(),authorization_servers:Ur(ZA).optional(),jwks_uri:Ze().url().optional(),scopes_supported:Ur(Ze()).optional(),bearer_methods_supported:Ur(Ze()).optional(),resource_signing_alg_values_supported:Ur(Ze()).optional(),resource_name:Ze().optional(),resource_documentation:Ze().optional(),resource_policy_uri:Ze().url().optional(),resource_tos_uri:Ze().url().optional(),tls_client_certificate_bound_access_tokens:ol().optional(),authorization_details_types_supported:Ur(Ze()).optional(),dpop_signing_alg_values_supported:Ur(Ze()).optional(),dpop_bound_access_tokens_required:ol().optional()}),aur=um({issuer:Ze(),authorization_endpoint:ZA,token_endpoint:ZA,registration_endpoint:ZA.optional(),scopes_supported:Ur(Ze()).optional(),response_types_supported:Ur(Ze()),response_modes_supported:Ur(Ze()).optional(),grant_types_supported:Ur(Ze()).optional(),token_endpoint_auth_methods_supported:Ur(Ze()).optional(),token_endpoint_auth_signing_alg_values_supported:Ur(Ze()).optional(),service_documentation:ZA.optional(),revocation_endpoint:ZA.optional(),revocation_endpoint_auth_methods_supported:Ur(Ze()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Ur(Ze()).optional(),introspection_endpoint:Ze().optional(),introspection_endpoint_auth_methods_supported:Ur(Ze()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Ur(Ze()).optional(),code_challenge_methods_supported:Ur(Ze()).optional(),client_id_metadata_document_supported:ol().optional()}),b7s=um({issuer:Ze(),authorization_endpoint:ZA,token_endpoint:ZA,userinfo_endpoint:ZA.optional(),jwks_uri:ZA,registration_endpoint:ZA.optional(),scopes_supported:Ur(Ze()).optional(),response_types_supported:Ur(Ze()),response_modes_supported:Ur(Ze()).optional(),grant_types_supported:Ur(Ze()).optional(),acr_values_supported:Ur(Ze()).optional(),subject_types_supported:Ur(Ze()),id_token_signing_alg_values_supported:Ur(Ze()),id_token_encryption_alg_values_supported:Ur(Ze()).optional(),id_token_encryption_enc_values_supported:Ur(Ze()).optional(),userinfo_signing_alg_values_supported:Ur(Ze()).optional(),userinfo_encryption_alg_values_supported:Ur(Ze()).optional(),userinfo_encryption_enc_values_supported:Ur(Ze()).optional(),request_object_signing_alg_values_supported:Ur(Ze()).optional(),request_object_encryption_alg_values_supported:Ur(Ze()).optional(),request_object_encryption_enc_values_supported:Ur(Ze()).optional(),token_endpoint_auth_methods_supported:Ur(Ze()).optional(),token_endpoint_auth_signing_alg_values_supported:Ur(Ze()).optional(),display_values_supported:Ur(Ze()).optional(),claim_types_supported:Ur(Ze()).optional(),claims_supported:Ur(Ze()).optional(),service_documentation:Ze().optional(),claims_locales_supported:Ur(Ze()).optional(),ui_locales_supported:Ur(Ze()).optional(),claims_parameter_supported:ol().optional(),request_parameter_supported:ol().optional(),request_uri_parameter_supported:ol().optional(),require_request_uri_registration:ol().optional(),op_policy_uri:ZA.optional(),op_tos_uri:ZA.optional(),client_id_metadata_document_supported:ol().optional()}),Tzn=zr({...b7s.shape,...aur.pick({code_challenge_methods_supported:!0}).shape}),Izn=zr({access_token:Ze(),id_token:Ze().optional(),token_type:Ze(),expires_in:ake.number().optional(),scope:Ze().optional(),refresh_token:Ze().optional()}).strip(),xzn=zr({error:Ze(),error_description:Ze().optional(),error_uri:Ze().optional()}),bzn=ZA.optional().or(Gn("").transform(()=>{})),S7s=zr({redirect_uris:Ur(ZA),token_endpoint_auth_method:Ze().optional(),grant_types:Ur(Ze()).optional(),response_types:Ur(Ze()).optional(),client_name:Ze().optional(),client_uri:ZA.optional(),logo_uri:bzn,scope:Ze().optional(),contacts:Ur(Ze()).optional(),tos_uri:bzn,policy_uri:Ze().optional(),jwks_uri:ZA.optional(),jwks:yZt().optional(),software_id:Ze().optional(),software_version:Ze().optional(),software_statement:Ze().optional()}).strip(),T7s=zr({client_id:Ze(),client_secret:Ze().optional(),client_id_issued_at:ka().optional(),client_secret_expires_at:ka().optional()}).strip(),wzn=S7s.merge(T7s),G_f=zr({error:Ze(),error_description:Ze().optional()}).strip(),$_f=zr({token:Ze(),token_type_hint:Ze().optional()}).strip();p();function Rzn(t){let e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}a(Rzn,"resourceUrlFromServerUrl");function kzn({requestedResource:t,configuredResource:e}){let r=typeof t=="string"?new URL(t):new URL(t.href),n=typeof e=="string"?new URL(e):new URL(e.href);if(r.origin!==n.origin||r.pathname.length=400&&t.status<500&&e!=="/"}a(O7s,"shouldAttemptFallback");async function L7s(t,e,r,n){let o=new URL(t),s=n?.protocolVersion??eR,c;if(n?.metadataUrl)c=new URL(n.metadataUrl);else{let u=M7s(e,o.pathname);c=new URL(u,n?.metadataServerUrl??o),c.search=o.search}let l=await Dzn(c,s,r);if(!n?.metadataUrl&&O7s(l,o.pathname)){let u=new URL(`/.well-known/${e}`,o);l=await Dzn(u,s,r)}return l}a(L7s,"discoverMetadataWithFallback");function B7s(t){let e=typeof t=="string"?new URL(t):t,r=e.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",e.origin),type:"oidc"}),n;let o=e.pathname;return o.endsWith("/")&&(o=o.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${o}`,e.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${o}`,e.origin),type:"oidc"}),n.push({url:new URL(`${o}/.well-known/openid-configuration`,e.origin),type:"oidc"}),n}a(B7s,"buildDiscoveryUrls");async function Ozn(t,{fetchFn:e=fetch,protocolVersion:r=eR}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=B7s(t);for(let{url:s,type:c}of o){let l=await fur(s,n,e);if(l){if(!l.ok){if(await l.body?.cancel(),l.status>=400&&l.status<500)continue;throw new Error(`HTTP ${l.status} trying to load ${c==="oauth"?"OAuth":"OpenID provider"} metadata from ${s}`)}return c==="oauth"?aur.parse(await l.json()):Tzn.parse(await l.json())}}}a(Ozn,"discoverAuthorizationServerMetadata");async function F7s(t,e){let r,n;try{r=await Mzn(t,{resourceMetadataUrl:e?.resourceMetadataUrl},e?.fetchFn),r.authorization_servers&&r.authorization_servers.length>0&&(n=r.authorization_servers[0])}catch{}n||(n=String(new URL("/",t)));let o=await Ozn(n,{fetchFn:e?.fetchFn});return{authorizationServerUrl:n,authorizationServerMetadata:o,resourceMetadata:r}}a(F7s,"discoverOAuthServerInfo");async function U7s(t,{metadata:e,clientInformation:r,redirectUrl:n,scope:o,state:s,resource:c}){let l;if(e){if(l=new URL(e.authorization_endpoint),!e.response_types_supported.includes(cur))throw new Error(`Incompatible auth server: does not support response type ${cur}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(lur))throw new Error(`Incompatible auth server: does not support code challenge method ${lur}`)}else l=new URL("/authorize",t);let u=await Blr(),d=u.code_verifier,f=u.code_challenge;return l.searchParams.set("response_type",cur),l.searchParams.set("client_id",r.client_id),l.searchParams.set("code_challenge",f),l.searchParams.set("code_challenge_method",lur),l.searchParams.set("redirect_uri",String(n)),s&&l.searchParams.set("state",s),o&&l.searchParams.set("scope",o),o?.includes("offline_access")&&l.searchParams.append("prompt","consent"),c&&l.searchParams.set("resource",c.href),{authorizationUrl:l,codeVerifier:d}}a(U7s,"startAuthorization");function Q7s(t,e,r){return new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:e,redirect_uri:String(r)})}a(Q7s,"prepareAuthorizationCodeRequest");async function Lzn(t,{metadata:e,tokenRequestParams:r,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c}){let l=e?.token_endpoint?new URL(e.token_endpoint):new URL("/token",t),u=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(s&&r.set("resource",s.href),o)await o(u,r,l,e);else if(n){let f=e?.token_endpoint_auth_methods_supported??[],h=x7s(n,f);w7s(h,n,u,r)}let d=await(c??fetch)(l,{method:"POST",headers:u,body:r});if(!d.ok)throw await Nzn(d);return Izn.parse(await d.json())}a(Lzn,"executeTokenRequest");async function q7s(t,{metadata:e,clientInformation:r,refreshToken:n,resource:o,addClientAuthentication:s,fetchFn:c}){let l=new URLSearchParams({grant_type:"refresh_token",refresh_token:n}),u=await Lzn(t,{metadata:e,tokenRequestParams:l,clientInformation:r,addClientAuthentication:s,resource:o,fetchFn:c});return{refresh_token:n,...u}}a(q7s,"refreshAuthorization");async function j7s(t,e,{metadata:r,resource:n,authorizationCode:o,fetchFn:s}={}){let c=t.clientMetadata.scope,l;if(t.prepareTokenRequest&&(l=await t.prepareTokenRequest(c)),!l){if(!o)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!t.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let d=await t.codeVerifier();l=Q7s(o,d,t.redirectUrl)}let u=await t.clientInformation();return Lzn(e,{metadata:r,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:t.addClientAuthentication,resource:n,fetchFn:s})}a(j7s,"fetchToken");async function H7s(t,{metadata:e,clientMetadata:r,scope:n,fetchFn:o}){let s;if(e){if(!e.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");s=new URL(e.registration_endpoint)}else s=new URL("/register",t);let c=await(o??fetch)(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...r,...n!==void 0?{scope:n}:{}})});if(!c.ok)throw await Nzn(c);return wzn.parse(await c.json())}a(H7s,"registerClient");p();p();p();p();function She(t){return!!t._zod}a(She,"isZ4Schema");function U2(t,e){return She(t)?jde(t,e):t.safeParse(e)}a(U2,"safeParse");function Mct(t){if(!t)return;let e;if(She(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}a(Mct,"getObjectShape");function Bzn(t){if(She(t)){let s=t._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}a(Bzn,"getLiteralValue");p();function IH(t){return t==="completed"||t==="failed"||t==="cancelled"}a(IH,"isTerminal");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();var wCf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();function pur(t){let r=Mct(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Bzn(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}a(pur,"getMethodLiteral");function hur(t,e){let r=U2(t,e);if(!r.success)throw r.error;return r.data}a(hur,"parseWithCompat");var Y7s=6e4,Oct=class{static{a(this,"Protocol")}constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Tct,r=>{this._oncancel(r)}),this.setNotificationHandler(xct,r=>{this._onprogress(r)}),this.setRequestHandler(Ict,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(wct,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Un(Zn.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(kct,async(r,n)=>{let o=a(async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let l;for(;l=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(l.type==="response"||l.type==="error"){let u=l.message,d=u.id,f=this._requestResolvers.get(d);if(f)if(this._requestResolvers.delete(d),l.type==="response")f(u);else{let h=u,m=new Un(h.error.code,h.error.message,h.error.data);f(m)}else{let h=l.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${d}`))}continue}await this._transport?.send(l.message,{relatedRequestId:n.requestId})}}let c=await this._taskStore.getTask(s,n.sessionId);if(!c)throw new Un(Zn.InvalidParams,`Task not found: ${s}`);if(!IH(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(IH(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[bH]:{taskId:s}}}}return await o()},"handleTaskResult");return await o()}),this.setRequestHandler(Pct,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new Un(Zn.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Nct,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Un(Zn.InvalidParams,`Task not found: ${r.params.taskId}`);if(IH(o.status))throw new Un(Zn.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new Un(Zn.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof Un?o:new Un(Zn.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),Un.fromError(Zn.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,c)=>{o?.(s,c),TX(s)||dzn(s)?this._onresponse(s):oDe(s)?this._onrequest(s,c):uzn(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=Un.fromError(Zn.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[bH]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:Zn.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:f,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):o?.send(f).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}let c=new AbortController;this._requestHandlerAbortControllers.set(e.id,c);let l=azn(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,d={signal:c.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:a(async f=>{if(c.signal.aborted)return;let h={relatedRequestId:e.id};s&&(h.relatedTask={taskId:s}),await this.notification(f,h)},"sendNotification"),sendRequest:a(async(f,h,m)=>{if(c.signal.aborted)throw new Un(Zn.ConnectionClosed,"Request was cancelled");let g={...m,relatedRequestId:e.id};s&&!g.relatedTask&&(g.relatedTask={taskId:s});let A=g.relatedTask?.taskId??s;return A&&u&&await u.updateTaskStatus(A,"input_required"),await this.request(f,h,g)},"sendRequest"),authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:u,taskRequestedTtl:l?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{l&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,d)).then(async f=>{if(c.signal.aborted)return;let h={result:f,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async f=>{if(c.signal.aborted)return;let h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:Zn.InternalError,message:f.message??"Internal error",...f.data!==void 0&&{data:f.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(f=>this._onerror(new Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===c&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let c=this._responseHandlers.get(o),l=this._timeoutInfo.get(o);if(l&&c&&l.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(u){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),c(u);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),TX(e))n(e);else{let c=new Un(e.error.code,e.error.message,e.error.data);n(c)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(TX(e)&&e.result&&typeof e.result=="object"){let c=e.result;if(c.task&&typeof c.task=="object"){let l=c.task;typeof l.taskId=="string"&&(s=!0,this._taskProgressTokens.set(l.taskId,r))}}if(s||this._progressHandlers.delete(r),TX(e))o(e);else{let c=Un.fromError(e.error.code,e.error.message,e.error.data);o(c)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(c){yield{type:"error",error:c instanceof Un?c:new Un(Zn.InternalError,String(c))}}return}let s;try{let c=await this.request(e,xX,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new Un(Zn.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},IH(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new Un(Zn.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new Un(Zn.InternalError,`Task ${s} was cancelled`)});return}if(l.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let u=l.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(d=>setTimeout(d,u)),n?.signal?.throwIfAborted()}}catch(c){yield{type:"error",error:c instanceof Un?c:new Un(Zn.InternalError,String(c))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c,task:l,relatedTask:u}=n??{};return new Promise((d,f)=>{let h=a(v=>{f(v)},"earlyReject");if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),l&&this.assertTaskCapability(e.method)}catch(v){h(v);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),l&&(g.params={...g.params,task:l}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[bH]:u}});let A=a(v=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(v)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(T=>this._onerror(new Error(`Failed to send cancellation: ${T}`)));let b=v instanceof Un?v:new Un(Zn.RequestTimeout,String(v));f(b)},"cancel");this._responseHandlers.set(m,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return f(v);try{let b=U2(r,v.result);b.success?d(b.data):f(b.error)}catch(b){f(b)}}}),n?.signal?.addEventListener("abort",()=>{A(n?.signal?.reason)});let y=n?.timeout??Y7s,E=a(()=>A(Un.fromError(Zn.RequestTimeout,"Request timed out",{timeout:y})),"timeoutHandler");this._setupTimeout(m,y,n?.maxTotalTimeout,E,n?.resetTimeoutOnProgress??!1);let _=u?.taskId;if(_){let v=a(b=>{let T=this._responseHandlers.get(m);T?T(b):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))},"responseResolver");this._requestResolvers.set(m,v),this._enqueueTaskMessage(_,{type:"request",message:g,timestamp:Date.now()}).catch(b=>{this._cleanupTimeout(m),f(b)})}else this._transport.send(g,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(v=>{this._cleanupTimeout(m),f(v)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Rct,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Dct,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},mzn,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let l={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[bH]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:l,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let l={...e,jsonrpc:"2.0"};r?.relatedTask&&(l={...l,params:{...l.params,_meta:{...l.params?._meta||{},[bH]:r.relatedTask}}}),this._transport?.send(l,r).catch(u=>this._onerror(u))});return}let c={...e,jsonrpc:"2.0"};r?.relatedTask&&(c={...c,params:{...c.params,_meta:{...c.params?._meta||{},[bH]:r.relatedTask}}}),await this._transport.send(c,r)}setRequestHandler(e,r){let n=pur(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=hur(e,o);return Promise.resolve(r(c,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=pur(e);this._notificationHandlers.set(n,o=>{let s=hur(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&oDe(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new Un(Zn.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new Un(Zn.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new Un(Zn.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:a(async o=>{if(!e)throw new Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},"createTask"),getTask:a(async o=>{let s=await n.getTask(o,r);if(!s)throw new Un(Zn.InvalidParams,"Failed to retrieve task: Task not found");return s},"getTask"),storeTaskResult:a(async(o,s,c)=>{await n.storeTaskResult(o,s,c,r);let l=await n.getTask(o,r);if(l){let u=uDe.parse({method:"notifications/tasks/status",params:l});await this.notification(u),IH(l.status)&&this._cleanupTaskProgressHandler(o)}},"storeTaskResult"),getTaskResult:a(o=>n.getTaskResult(o,r),"getTaskResult"),updateTaskStatus:a(async(o,s,c)=>{let l=await n.getTask(o,r);if(!l)throw new Un(Zn.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(IH(l.status))throw new Un(Zn.InvalidParams,`Cannot update task "${o}" from terminal status "${l.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,c,r);let u=await n.getTask(o,r);if(u){let d=uDe.parse({method:"notifications/tasks/status",params:u});await this.notification(d),IH(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};function Fzn(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}a(Fzn,"isPlainObject");function Uzn(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let c=r[o];Fzn(c)&&Fzn(s)?r[o]={...c,...s}:r[o]=s}return r}a(Uzn,"mergeCapabilities");p();var kJn=fe(efr(),1),PJn=fe(RJn(),1);function Z$s(){let t=new kJn.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,PJn.default)(t),t}a(Z$s,"createDefaultAjvInstance");var glt=class{static{a(this,"AjvJsonSchemaValidator")}constructor(e){this._ajv=e??Z$s()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};p();var Alt=class{static{a(this,"ExperimentalClientTasks")}constructor(e){this._client=e}async*callToolStream(e,r=TH,n){let o=this._client,s={...n,task:n?.task??(o.isToolTask(e.name)?{}:void 0)},c=o.requestStream({method:"tools/call",params:e},r,s),l=o.getToolOutputValidator(e.name);for await(let u of c){if(u.type==="result"&&l){let d=u.result;if(!d.structuredContent&&!d.isError){yield{type:"error",error:new Un(Zn.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(d.structuredContent)try{let f=l(d.structuredContent);if(!f.valid){yield{type:"error",error:new Un(Zn.InvalidParams,`Structured content does not match the tool's output schema: ${f.errorMessage}`)};return}}catch(f){if(f instanceof Un){yield{type:"error",error:f};return}yield{type:"error",error:new Un(Zn.InvalidParams,`Failed to validate structured content: ${f instanceof Error?f.message:String(f)}`)};return}}yield u}}async getTask(e,r){return this._client.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._client.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._client.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._client.cancelTask({taskId:e},r)}requestStream(e,r,n){return this._client.requestStream(e,r,n)}};p();function DJn(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}a(DJn,"assertToolsCallTaskCapability");function NJn(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}a(NJn,"assertClientRequestTaskCapability");function ylt(t,e){if(!(!t||e===null||typeof e!="object")){if(t.type==="object"&&t.properties&&typeof t.properties=="object"){let r=e,n=t.properties;for(let o of Object.keys(n)){let s=n[o];r[o]===void 0&&Object.prototype.hasOwnProperty.call(s,"default")&&(r[o]=s.default),r[o]!==void 0&&ylt(s,r[o])}}if(Array.isArray(t.anyOf))for(let r of t.anyOf)typeof r!="boolean"&&ylt(r,e);if(Array.isArray(t.oneOf))for(let r of t.oneOf)typeof r!="boolean"&&ylt(r,e)}}a(ylt,"applyElicitationDefaults");function X$s(t){if(!t)return{supportsFormMode:!1,supportsUrlMode:!1};let e=t.form!==void 0,r=t.url!==void 0;return{supportsFormMode:e||!e&&!r,supportsUrlMode:r}}a(X$s,"getSupportedElicitationModes");var OH=class extends Oct{static{a(this,"Client")}constructor(e,r){super(r),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=r?.capabilities??{},this._jsonSchemaValidator=r?.jsonSchemaValidator??new glt,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",m8,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",h8,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",p8,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new Alt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Uzn(this._capabilities,e)}setRequestHandler(e,r){let o=Mct(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(She(o)){let l=o;s=l._zod?.def?.value??l.value}else{let l=o;s=l._def?.value??l.value}if(typeof s!="string")throw new Error("Schema method literal must be a string");let c=s;if(c==="elicitation/create"){let l=a(async(u,d)=>{let f=U2(pDe,u);if(!f.success){let v=f.error instanceof Error?f.error.message:String(f.error);throw new Un(Zn.InvalidParams,`Invalid elicitation request: ${v}`)}let{params:h}=f.data;h.mode=h.mode??"form";let{supportsFormMode:m,supportsUrlMode:g}=X$s(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new Un(Zn.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new Un(Zn.InvalidParams,"Client does not support URL-mode elicitation requests");let A=await Promise.resolve(r(u,d));if(h.task){let v=U2(xX,A);if(!v.success){let b=v.error instanceof Error?v.error.message:String(v.error);throw new Un(Zn.InvalidParams,`Invalid task creation result: ${b}`)}return v.data}let y=U2(iur,A);if(!y.success){let v=y.error instanceof Error?y.error.message:String(y.error);throw new Un(Zn.InvalidParams,`Invalid elicitation result: ${v}`)}let E=y.data,_=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&E.action==="accept"&&E.content&&_&&this._capabilities.elicitation?.form?.applyDefaults)try{ylt(_,E.content)}catch{}return E},"wrappedHandler");return super.setRequestHandler(e,l)}if(c==="sampling/createMessage"){let l=a(async(u,d)=>{let f=U2(fDe,u);if(!f.success){let E=f.error instanceof Error?f.error.message:String(f.error);throw new Un(Zn.InvalidParams,`Invalid sampling request: ${E}`)}let{params:h}=f.data,m=await Promise.resolve(r(u,d));if(h.task){let E=U2(xX,m);if(!E.success){let _=E.error instanceof Error?E.error.message:String(E.error);throw new Un(Zn.InvalidParams,`Invalid task creation result: ${_}`)}return E.data}let A=h.tools||h.toolChoice?nur:rur,y=U2(A,m);if(!y.success){let E=y.error instanceof Error?y.error.message:String(y.error);throw new Un(Zn.InvalidParams,`Invalid sampling result: ${E}`)}return y.data},"wrappedHandler");return super.setRequestHandler(e,l)}return super.setRequestHandler(e,r)}assertCapability(e,r){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${r})`)}async connect(e,r){if(await super.connect(e),e.sessionId===void 0)try{let n=await this.request({method:"initialize",params:{protocolVersion:eR,capabilities:this._capabilities,clientInfo:this._clientInfo}},jlr,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!Cct.includes(n.protocolVersion))throw new Error(`Server's protocol version is not supported: ${n.protocolVersion}`);this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(n.protocolVersion),this._instructions=n.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(n){throw this.close(),n}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break;case"ping":break}}assertTaskCapability(e){DJn(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&NJn(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},IX,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},our,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},IX,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},eur,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},Ylr,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},Glr,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},$lr,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},Wlr,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},IX,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},IX,r)}async callTool(e,r=TH,n){if(this.isToolTaskRequired(e.name))throw new Un(Zn.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let o=await this.request({method:"tools/call",params:e},r,n),s=this.getToolOutputValidator(e.name);if(s){if(!o.structuredContent&&!o.isError)throw new Un(Zn.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent)try{let c=s(o.structuredContent);if(!c.valid)throw new Un(Zn.InvalidParams,`Structured content does not match the tool's output schema: ${c.errorMessage}`)}catch(c){throw c instanceof Un?c:new Un(Zn.InvalidParams,`Failed to validate structured content: ${c instanceof Error?c.message:String(c)}`)}}return o}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(let r of e){if(r.outputSchema){let o=this._jsonSchemaValidator.getValidator(r.outputSchema);this._cachedToolOutputValidators.set(r.name,o)}let n=r.execution?.taskSupport;(n==="required"||n==="optional")&&this._cachedKnownTaskTools.add(r.name),n==="required"&&this._cachedRequiredTaskTools.add(r.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,r){let n=await this.request({method:"tools/list",params:e},tur,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,r,n,o){let s=vzn.safeParse(n);if(!s.success)throw new Error(`Invalid ${e} listChanged options: ${s.error.message}`);if(typeof n.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:c,debounceMs:l}=s.data,{onChanged:u}=n,d=a(async()=>{if(!c){u(null,null);return}try{let h=await o();u(null,h)}catch(h){let m=h instanceof Error?h:new Error(String(h));u(m,null)}},"refresh"),f=a(()=>{if(l){let h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);let m=setTimeout(d,l);this._listChangedDebounceTimers.set(e,m)}else d()},"handler");this.setNotificationHandler(r,f)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};p();p();p();var Elt=class extends Error{static{a(this,"ParseError")}constructor(e,r){super(e),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}};function cfr(t){}a(cfr,"noop");function _lt(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:e=cfr,onError:r=cfr,onRetry:n=cfr,onComment:o}=t,s="",c=!0,l,u="",d="";function f(y){let E=c?y.replace(/^\xEF\xBB\xBF/,""):y,[_,v]=eVs(`${s}${E}`);for(let b of _)h(b);s=v,c=!1}a(f,"feed");function h(y){if(y===""){g();return}if(y.startsWith(":")){o&&o(y.slice(y.startsWith(": ")?2:1));return}let E=y.indexOf(":");if(E!==-1){let _=y.slice(0,E),v=y[E+1]===" "?2:1,b=y.slice(E+v);m(_,b,y);return}m(y,"",y)}a(h,"parseLine");function m(y,E,_){switch(y){case"event":d=E;break;case"data":u=`${u}${E} +`;break;case"id":l=E.includes("\0")?void 0:E;break;case"retry":/^\d+$/.test(E)?n(parseInt(E,10)):r(new Elt(`Invalid \`retry\` value: "${E}"`,{type:"invalid-retry",value:E,line:_}));break;default:r(new Elt(`Unknown field "${y.length>20?`${y.slice(0,20)}\u2026`:y}"`,{type:"unknown-field",field:y,value:E,line:_}));break}}a(m,"processField");function g(){u.length>0&&e({id:l,event:d||void 0,data:u.endsWith(` +`)?u.slice(0,-1):u}),l=void 0,u="",d=""}a(g,"dispatchEvent");function A(y={}){s&&y.consume&&h(s),c=!0,l=void 0,u="",d="",s=""}return a(A,"reset"),{feed:f,reset:A}}a(_lt,"createParser");function eVs(t){let e=[],r="",n=0;for(;n{throw TypeError(t)},"__typeError"),Afr=a((t,e,r)=>e.has(t)||LJn("Cannot "+r),"__accessCheck"),na=a((t,e,r)=>(Afr(t,e,"read from private field"),r?r.call(t):e.get(t)),"__privateGet"),C0=a((t,e,r)=>e.has(t)?LJn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),"__privateAdd"),Zd=a((t,e,r,n)=>(Afr(t,e,"write to private field"),e.set(t,r),r),"__privateSet"),b8=a((t,e,r)=>(Afr(t,e,"access private method"),r),"__privateMethod"),wb,GX,Hhe,vlt,blt,iNe,Vhe,oNe,LH,Ghe,Whe,$he,rNe,$2,ufr,dfr,ffr,OJn,pfr,hfr,nNe,mfr,gfr,$X=class extends EventTarget{static{a(this,"EventSource")}constructor(e,r){var n,o;super(),C0(this,$2),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,C0(this,wb),C0(this,GX),C0(this,Hhe),C0(this,vlt),C0(this,blt),C0(this,iNe),C0(this,Vhe),C0(this,oNe,null),C0(this,LH),C0(this,Ghe),C0(this,Whe,null),C0(this,$he,null),C0(this,rNe,null),C0(this,dfr,async s=>{var c;na(this,Ghe).reset();let{body:l,redirected:u,status:d,headers:f}=s;if(d===204){b8(this,$2,nNe).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(u?Zd(this,Hhe,new URL(s.url)):Zd(this,Hhe,void 0),d!==200){b8(this,$2,nNe).call(this,`Non-200 status code (${d})`,d);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){b8(this,$2,nNe).call(this,'Invalid content type, expected "text/event-stream"',d);return}if(na(this,wb)===this.CLOSED)return;Zd(this,wb,this.OPEN);let h=new Event("open");if((c=na(this,rNe))==null||c.call(this,h),this.dispatchEvent(h),typeof l!="object"||!l||!("getReader"in l)){b8(this,$2,nNe).call(this,"Invalid response body, expected a web ReadableStream",d),this.close();return}let m=new TextDecoder,g=l.getReader(),A=!0;do{let{done:y,value:E}=await g.read();E&&na(this,Ghe).feed(m.decode(E,{stream:!y})),y&&(A=!1,na(this,Ghe).reset(),b8(this,$2,mfr).call(this))}while(A)}),C0(this,ffr,s=>{Zd(this,LH,void 0),!(s.name==="AbortError"||s.type==="aborted")&&b8(this,$2,mfr).call(this,lfr(s))}),C0(this,pfr,s=>{typeof s.id=="string"&&Zd(this,oNe,s.id);let c=new MessageEvent(s.event||"message",{data:s.data,origin:na(this,Hhe)?na(this,Hhe).origin:na(this,GX).origin,lastEventId:s.id||""});na(this,$he)&&(!s.event||s.event==="message")&&na(this,$he).call(this,c),this.dispatchEvent(c)}),C0(this,hfr,s=>{Zd(this,iNe,s)}),C0(this,gfr,()=>{Zd(this,Vhe,void 0),na(this,wb)===this.CONNECTING&&b8(this,$2,ufr).call(this)});try{if(e instanceof URL)Zd(this,GX,e);else if(typeof e=="string")Zd(this,GX,new URL(e,rVs()));else throw new Error("Invalid URL")}catch{throw tVs("An invalid or illegal string was specified")}Zd(this,Ghe,_lt({onEvent:na(this,pfr),onRetry:na(this,hfr)})),Zd(this,wb,this.CONNECTING),Zd(this,iNe,3e3),Zd(this,blt,(n=r?.fetch)!=null?n:globalThis.fetch),Zd(this,vlt,(o=r?.withCredentials)!=null?o:!1),b8(this,$2,ufr).call(this)}get readyState(){return na(this,wb)}get url(){return na(this,GX).href}get withCredentials(){return na(this,vlt)}get onerror(){return na(this,Whe)}set onerror(e){Zd(this,Whe,e)}get onmessage(){return na(this,$he)}set onmessage(e){Zd(this,$he,e)}get onopen(){return na(this,rNe)}set onopen(e){Zd(this,rNe,e)}addEventListener(e,r,n){let o=r;super.addEventListener(e,o,n)}removeEventListener(e,r,n){let o=r;super.removeEventListener(e,o,n)}close(){na(this,Vhe)&&clearTimeout(na(this,Vhe)),na(this,wb)!==this.CLOSED&&(na(this,LH)&&na(this,LH).abort(),Zd(this,wb,this.CLOSED),Zd(this,LH,void 0))}};wb=new WeakMap,GX=new WeakMap,Hhe=new WeakMap,vlt=new WeakMap,blt=new WeakMap,iNe=new WeakMap,Vhe=new WeakMap,oNe=new WeakMap,LH=new WeakMap,Ghe=new WeakMap,Whe=new WeakMap,$he=new WeakMap,rNe=new WeakMap,$2=new WeakSet,ufr=a(function(){Zd(this,wb,this.CONNECTING),Zd(this,LH,new AbortController),na(this,blt)(na(this,GX),b8(this,$2,OJn).call(this)).then(na(this,dfr)).catch(na(this,ffr))},"connect_fn"),dfr=new WeakMap,ffr=new WeakMap,OJn=a(function(){var t;let e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...na(this,oNe)?{"Last-Event-ID":na(this,oNe)}:void 0},cache:"no-store",signal:(t=na(this,LH))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},"getRequestOptions_fn"),pfr=new WeakMap,hfr=new WeakMap,nNe=a(function(t,e){var r;na(this,wb)!==this.CLOSED&&Zd(this,wb,this.CLOSED);let n=new Clt("error",{code:e,message:t});(r=na(this,Whe))==null||r.call(this,n),this.dispatchEvent(n)},"failConnection_fn"),mfr=a(function(t,e){var r;if(na(this,wb)===this.CLOSED)return;Zd(this,wb,this.CONNECTING);let n=new Clt("error",{code:e,message:t});(r=na(this,Whe))==null||r.call(this,n),this.dispatchEvent(n),Zd(this,Vhe,setTimeout(na(this,gfr),na(this,iNe)))},"scheduleReconnect_fn"),gfr=new WeakMap,$X.CONNECTING=0,$X.OPEN=1,$X.CLOSED=2;function rVs(){let t="document"in globalThis?globalThis.document:void 0;return t&&typeof t=="object"&&"baseURI"in t&&typeof t.baseURI=="string"?t.baseURI:void 0}a(rVs,"getBaseURL");p();function zhe(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):{...t}:{}}a(zhe,"normalizeHeaders");function Slt(t=fetch,e){return e?async(r,n)=>{let o={...e,...n,headers:n?.headers?{...zhe(e.headers),...zhe(n.headers)}:e.headers};return t(r,o)}:t}a(Slt,"createFetchWithInit");var sNe=class extends Error{static{a(this,"SseError")}constructor(e,r,n){super(`SSE error: ${r}`),this.code=e,this.event=n}},Yhe=class{static{a(this,"SSEClientTransport")}constructor(e,r){this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=r?.eventSourceInit,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=Slt(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new XA("No auth provider");let e;try{e=await A8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new XA;return await this._startOrAuth()}async _commonHeaders(){let e={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);let r=zhe(this._requestInit?.headers);return new Headers({...e,...r})}_startOrAuth(){let e=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((r,n)=>{this._eventSource=new $X(this._url.href,{...this._eventSourceInit,fetch:a(async(o,s)=>{let c=await this._commonHeaders();c.set("Accept","text/event-stream");let l=await e(o,{...s,headers:c});if(l.status===401&&l.headers.has("www-authenticate")){let{resourceMetadataUrl:u,scope:d}=bhe(l);this._resourceMetadataUrl=u,this._scope=d}return l},"fetch")}),this._abortController=new AbortController,this._eventSource.onerror=o=>{if(o.code===401&&this._authProvider){this._authThenStart().then(r,n);return}let s=new sNe(o.code,o.message,o);n(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",o=>{let s=o;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(c){n(c),this.onerror?.(c),this.close();return}r()}),this._eventSource.onmessage=o=>{let s=o,c;try{c=SH.parse(JSON.parse(s.data))}catch(l){this.onerror?.(l);return}this.onmessage?.(c)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(e){if(!this._authProvider)throw new XA("No auth provider");if(await A8(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new XA("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(e){if(!this._endpoint)throw new Error("Not connected");try{let r=await this._commonHeaders();r.set("content-type","application/json");let n={...this._requestInit,method:"POST",headers:r,body:JSON.stringify(e),signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._endpoint,n);if(!o.ok){let s=await o.text().catch(()=>null);if(o.status===401&&this._authProvider){let{resourceMetadataUrl:c,scope:l}=bhe(o);if(this._resourceMetadataUrl=c,this._scope=l,await A8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new XA;return this.send(e)}throw new Error(`Error POSTing to endpoint (HTTP ${o.status}): ${s}`)}await o.body?.cancel()}catch(r){throw this.onerror?.(r),r}}setProtocolVersion(e){this._protocolVersion=e}};p();p();var Tlt=class extends TransformStream{static{a(this,"EventSourceParserStream")}constructor({onError:e,onRetry:r,onComment:n}={}){let o;super({start(s){o=_lt({onEvent:a(c=>{s.enqueue(c)},"onEvent"),onError(c){e==="terminate"?s.error(c):typeof e=="function"&&e(c)},onRetry:r,onComment:n})},transform(s){o.feed(s)}})}};var nVs={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},aR=class extends Error{static{a(this,"StreamableHTTPError")}constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}},Khe=class{static{a(this,"StreamableHTTPClientTransport")}constructor(e,r){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=Slt(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??nVs}async _authThenStart(){if(!this._authProvider)throw new XA("No auth provider");let e;try{e=await A8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new XA;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let e={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);let r=zhe(this._requestInit?.headers);return new Headers({...e,...r})}async _startOrAuthSse(e){let{resumptionToken:r}=e;try{let n=await this._commonHeaders();n.set("Accept","text/event-stream"),r&&n.set("last-event-id",r);let o=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!o.ok){if(await o.body?.cancel(),o.status===401&&this._authProvider)return await this._authThenStart();if(o.status===405)return;throw new aR(o.status,`Failed to open SSE stream: ${o.statusText}`)}this._handleSseStream(o.body,e,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,o=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,e),o)}_scheduleReconnection(e,r=0){let n=this._reconnectionOptions.maxRetries;if(r>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}let o=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(s=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${s instanceof Error?s.message:String(s)}`)),this._scheduleReconnection(e,r+1)})},o)}_handleSseStream(e,r,n){if(!e)return;let{onresumptiontoken:o,replayMessageId:s}=r,c,l=!1,u=!1;a(async()=>{try{let f=e.pipeThrough(new TextDecoderStream).pipeThrough(new Tlt({onRetry:a(g=>{this._serverRetryMs=g},"onRetry")})).getReader();for(;;){let{value:g,done:A}=await f.read();if(A)break;if(g.id&&(c=g.id,l=!0,o?.(g.id)),!!g.data&&(!g.event||g.event==="message"))try{let y=SH.parse(JSON.parse(g.data));TX(y)&&(u=!0,s!==void 0&&(y.id=s)),this.onmessage?.(y)}catch(y){this.onerror?.(y)}}(n||l)&&!u&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:c,onresumptiontoken:o,replayMessageId:s},0)}catch(f){if(this.onerror?.(new Error(`SSE stream disconnected: ${f}`)),(n||l)&&!u&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:c,onresumptiontoken:o,replayMessageId:s},0)}catch(g){this.onerror?.(new Error(`Failed to reconnect: ${g instanceof Error?g.message:String(g)}`))}}},"processStream")()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new XA("No auth provider");if(await A8(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new XA("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,r){try{let{resumptionToken:n,onresumptiontoken:o}=r||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:oDe(e)?e.id:void 0}).catch(m=>this.onerror?.(m));return}let s=await this._commonHeaders();s.set("content-type","application/json"),s.set("accept","application/json, text/event-stream");let c={...this._requestInit,method:"POST",headers:s,body:JSON.stringify(e),signal:this._abortController?.signal},l=await(this._fetch??fetch)(this._url,c),u=l.headers.get("mcp-session-id");if(u&&(this._sessionId=u),!l.ok){let m=await l.text().catch(()=>null);if(l.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new aR(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:g,scope:A}=bhe(l);if(this._resourceMetadataUrl=g,this._scope=A,await A8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new XA;return this._hasCompletedAuthFlow=!0,this.send(e)}if(l.status===403&&this._authProvider){let{resourceMetadataUrl:g,scope:A,error:y}=bhe(l);if(y==="insufficient_scope"){let E=l.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===E)throw new aR(403,"Server returned 403 after trying upscoping");if(A&&(this._scope=A),g&&(this._resourceMetadataUrl=g),this._lastUpscopingHeader=E??void 0,await A8(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new XA;return this.send(e)}}throw new aR(l.status,`Error POSTing to endpoint: ${m}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,l.status===202){await l.body?.cancel(),hzn(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(m=>this.onerror?.(m));return}let f=(Array.isArray(e)?e:[e]).filter(m=>"method"in m&&"id"in m&&m.id!==void 0).length>0,h=l.headers.get("content-type");if(f)if(h?.includes("text/event-stream"))this._handleSseStream(l.body,{onresumptiontoken:o},!1);else if(h?.includes("application/json")){let m=await l.json(),g=Array.isArray(m)?m.map(A=>SH.parse(A)):[SH.parse(m)];for(let A of g)this.onmessage?.(A)}else throw await l.body?.cancel(),new aR(-1,`Unexpected content type: ${h}`);else await l.body?.cancel()}catch(n){throw this.onerror?.(n),n}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,r);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new aR(n.status,`Failed to terminate session: ${n.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,r){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:r?.onresumptiontoken})}};var UJn=require("events");var Jhe=class extends Error{static{a(this,"HttpInvokerUnauthorizedError")}constructor(e="Upstream MCP server requires authorization"){super(e),this.name="HttpInvokerUnauthorizedError"}},aNe=class{constructor(e){this._transport=null;this._emitter=new UJn.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._effectiveType=e.type,this._emitter.setMaxListeners(0),this._client=new OH({name:e.clientInfo.name,version:e.clientInfo.version},{capabilities:{}})}static{a(this,"HttpInvoker")}get isConnected(){return this._connected}async start(){if(this._connected)return;this._effectiveType=this._options.type;let e=!1,r=this._options.authProvider?["none","silent","interactive"]:["none"],n;for(let o=0;o{}),this._transport=null,!e&&s==="none"&&this._effectiveType==="http"){let u=iVs(l);if(u!==void 0){e=!0,this._effectiveType="sse",this._options.onFallback?.({fromCode:u}),o--;continue}}if(!BJn(l))throw l}}throw BJn(n)?new Jhe:n instanceof Error?n:new Error("HttpInvoker.start exhausted retries without a recoverable error")}async _connectOnce(e){let r=new URL(this._options.url),n=this._effectiveType==="sse"?new Yhe(r,FJn(this._options.sseOptions,e)):new Khe(r,FJn(this._options.httpOptions,e));this._transport=n,this._client.onerror=o=>this._options.onError?.(o),this._client.onclose=()=>{this._connected=!1},this._client.setNotificationHandler(m8,()=>{this._emitter.emit(ul.ToolsListChanged)}),this._client.setNotificationHandler(p8,()=>{this._emitter.emit(ul.ResourcesListChanged)}),this._client.setNotificationHandler(h8,()=>{this._emitter.emit(ul.PromptsListChanged)}),this._client.setNotificationHandler(wX,o=>{this._emitter.emit(ul.LoggingMessage,o)}),await this._client.connect(n)}async stop(){if(!this._transport){this._connected=!1;return}this._transport=null,await this._client.close().catch(()=>{}),this._connected=!1}listTools(){return this._client.listTools()}callTool(e,r){return this._client.callTool({name:e,arguments:r})}listResources(){return this._client.listResources()}readResource(e){return this._client.readResource({uri:e})}listResourceTemplates(){return this._client.listResourceTemplates()}listPrompts(){return this._client.listPrompts()}getPrompt(e,r){return this._client.getPrompt({name:e,arguments:r})}async setLoggingLevel(e){await this._client.setLoggingLevel(e.level)}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}};function BJn(t){if(t instanceof XA)return!0;if(!t||typeof t!="object")return!1;let e=t;return e.name==="UnauthorizedError"||e.status===401||e.code===401}a(BJn,"isUnauthorized");function iVs(t){if(!t||typeof t!="object")return;let e=t;if(!(t instanceof aR||e.name==="StreamableHTTPError"))return;let n=typeof e.code=="number"?e.code:typeof e.status=="number"?e.status:void 0;if(!(n===void 0||n===401||n<400||n>=500))return n}a(iVs,"httpFallbackCode");function FJn(t,e){if(!e)return t;let r={...t?.requestInit??{}},n=new Headers(r.headers);return n.set("Authorization",`Bearer ${e}`),r.headers=Object.fromEntries(n.entries()),{...t,requestInit:r}}a(FJn,"withBearer");p();function Ilt(t){if(typeof t!="object"||t===null||t.jsonrpc!=="2.0"||typeof t.method!="string"||!("id"in t))return!1;let e=t.id;return typeof e=="string"||typeof e=="number"}a(Ilt,"isJsonRpcRequest");function QJn(t){return typeof t=="object"&&t!==null&&t.jsonrpc==="2.0"&&typeof t.method=="string"&&!("id"in t)}a(QJn,"isJsonRpcNotification");var lR={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603},cR=class extends Error{constructor(r,n,o){super(n);this.code=r;this.data=o;this.name="JsonRpcError"}static{a(this,"JsonRpcError")}};p();var lNe="Blocked by your organization's MCP allowlist";function yfr(t,e){let r=e?.allowed;if(r===void 0)return{allowed:!0};if(r.length===0)return{allowed:!1,reason:`${lNe}: the allowlist permits no servers.`};let n=t.transport;if(n.kind==="stdio"){let s=r.filter(sVs);return s.length>0?s.some(c=>cVs(n.command,c.serverCommand))?{allowed:!0}:{allowed:!1,reason:`${lNe}: the server command does not match any allowed server command.`}:qJn(t.name,r)}let o=r.filter(oVs);return o.length>0?o.some(s=>fVs(n.url,s.serverUrl))?{allowed:!0}:{allowed:!1,reason:`${lNe}: "${n.url}" does not match any allowed server URL.`}:qJn(t.name,r)}a(yfr,"evaluateMcpAllowlist");function qJn(t,e){let r=e.filter(aVs);return r.length===0?{allowed:!1,reason:`${lNe}: the allowlist has no rules that apply to "${t}".`}:r.some(n=>n.serverName===t)?{allowed:!0}:{allowed:!1,reason:`${lNe}: "${t}" does not match any allowed server name.`}}a(qJn,"evaluateNameFallback");function oVs(t){return"serverUrl"in t}a(oVs,"isUrlEntry");function sVs(t){return"serverCommand"in t}a(sVs,"isCommandEntry");function aVs(t){return"serverName"in t}a(aVs,"isNameEntry");function cVs(t,e){return t.length===e.length&&t.every((r,n)=>r===e[n])}a(cVs,"commandsEqual");function lVs(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(lVs,"escapeRegExp");function jJn(t){return t.toLowerCase().replace(/\.$/,"")}a(jJn,"normalizeHost");function cNe(t,e){let r=t.split("*").map(lVs).join(".*");return new RegExp(`^${r}$`).test(e)}a(cNe,"componentMatches");function uVs(t){let e;try{e=new URL(t)}catch{return}return{scheme:e.protocol.replace(/:$/,"").toLowerCase(),host:jJn(e.hostname),port:e.port,path:e.pathname||"/",search:e.search}}a(uVs,"parseUrlParts");function dVs(t){let e=t.indexOf("://");if(e<0)return;let r=t.slice(0,e).toLowerCase(),n=t.slice(e+3),o=n.search(/[/?#]/),s=o<0?n:n.slice(0,o),c=o<0?"":n.slice(o),l=s,u="",d=s.lastIndexOf(":");d>=0&&(l=s.slice(0,d),u=s.slice(d+1));let f=c.split("#",1)[0],h=f.indexOf("?"),m=h<0?f:f.slice(0,h),g=h<0?"":f.slice(h);return{scheme:r,host:jJn(l),port:u,path:m,search:g}}a(dVs,"parsePatternParts");function fVs(t,e){let r=uVs(t),n=dVs(e);if(!n)return r===void 0?!1:cNe(e,t);if(!r||!cNe(n.scheme,r.scheme)||!cNe(n.host,r.host))return!1;if(n.port===""){if(r.port!=="")return!1}else if(!cNe(n.port,r.port))return!1;return!(n.path!==""&&!cNe(n.path,r.path)||n.search!==""&&n.search!==r.search)}a(fVs,"urlMatchesPattern");var pVs=/^[A-Za-z0-9_-]+$/;function Efr(t){if(!t||typeof t!="object")return;let e=t.mcpServers;if(!e||typeof e!="object")return;let r=e.allowed;if(!(r===void 0||!Array.isArray(r)))return{allowed:r.flatMap(n=>hVs(n)??[])}}a(Efr,"parseMcpServersSettings");function hVs(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t,r=["serverUrl","serverCommand","serverName"].filter(n=>e[n]!==void 0);if(r.length===1)switch(r[0]){case"serverUrl":return typeof e.serverUrl=="string"&&e.serverUrl.length>0?{serverUrl:e.serverUrl}:void 0;case"serverCommand":{let n=e.serverCommand;return Array.isArray(n)&&n.length>0&&n.every(o=>typeof o=="string")?{serverCommand:n}:void 0}case"serverName":return typeof e.serverName=="string"&&pVs.test(e.serverName)?{serverName:e.serverName}:void 0}}a(hVs,"parseEntry");p();p();p();var V2=class{static{a(this,"McpRuntimeNotifier")}},xlt=class extends V2{static{a(this,"NoOpMcpRuntimeNotifier")}async notifyLog(e){}};var sr=new pe("CopilotMCP");async function _fr(t,e){await t.get(V2).notifyLog(e)}a(_fr,"notifyMCPRuntimeLog");async function yd(t,e){await _fr(t,{...e,level:"error"})}a(yd,"notifyMCPRuntimeError");async function W2(t,e){await _fr(t,{...e,level:"warning"})}a(W2,"notifyMCPRuntimeWarning");async function ia(t,e){await _fr(t,{...e,level:"info"})}a(ia,"notifyMCPRuntimeInfo");p();p();p();async function VX(t,e,r,n,o){return await t.get(nr).fetch(new URL(e).href,{method:r,headers:n,body:o})}a(VX,"fetchOauthServer");async function vfr(t){try{return await t.text()}catch{return t.statusText}}a(vfr,"getErrText");p();var HJn="/.well-known",Cfr=`${HJn}/oauth-protected-resource`,GJn=`${HJn}/oauth-authorization-server`,$Jn=" ";function VJn(t){return typeof t!="object"||t===null?!1:t.resource!==void 0}a(VJn,"isAuthorizationProtectedResourceMetadata");function WJn(t){return typeof t!="object"||t===null?!1:t.issuer!==void 0}a(WJn,"isAuthorizationServerMetadata");function wlt(t){let e=t.split(" "),r=e[0],n={};return e.length>1&&e.slice(1).join(" ").split(",").forEach(s=>{let[c,l]=s.split("=").map(u=>u.trim().replace(/"/g,""));n[c]=l}),{scheme:r,params:n}}a(wlt,"parseWWWAuthenticateHeader");function zJn(t){let e=new URL(t.issuer);return{...t,authorization_endpoint:t.authorization_endpoint??new URL("/authorize",e).toString(),token_endpoint:t.token_endpoint??new URL("/token",e).toString(),registration_endpoint:t.registration_endpoint??new URL("/register",e).toString()}}a(zJn,"getMetadataWithDefaultValues");function YJn(t){return{issuer:t.toString(),authorization_endpoint:new URL("/authorize",t).toString(),token_endpoint:new URL("/token",t).toString(),registration_endpoint:new URL("/register",t).toString(),response_types_supported:["code","id_token","id_token token"]}}a(YJn,"getDefaultMetadataForUrl");function KJn(t){let e=new URL(t);if(!e.pathname.startsWith(Cfr))throw new Error(`Invalid discovery URL: expected path to start with ${Cfr}`);let r=e.pathname.substring(Cfr.length),n=new URL(e.origin);return n.pathname=r||"/",n.toString()}a(KJn,"getResourceServerBaseUrlFromDiscoveryUrl");function JJn(t){return typeof t!="object"||t===null?!1:t.client_id!==void 0}a(JJn,"isAuthorizationDynamicClientRegistrationResponse");function Rlt(t){if(typeof t!="object"||t===null)return!1;let e=t;return e.access_token!==void 0&&e.token_type!==void 0}a(Rlt,"isAuthorizationTokenResponse");function bfr(t){let e=t.split(".");if(e.length!==3)throw new Error("Invalid JWT token format: token must have three parts separated by dots");let[r,n,o]=e;try{if(typeof JSON.parse(MVt(r))!="object")throw new Error("Invalid JWT token format: header is not a JSON object");let c=JSON.parse(MVt(n));if(typeof c!="object")throw new Error("Invalid JWT token format: payload is not a JSON object");return c}catch(s){throw s instanceof Error?new Error(`Failed to parse JWT token: ${s.message}`):new Error("Failed to parse JWT token")}}a(bfr,"getClaimsFromJWT");var Sfr=class{static{a(this,"AuthMetadata")}},Zhe=class extends Sfr{static{a(this,"MCPAuthMetadata")}constructor(e){super(),this.ctx=e}async getMetadataFromOriginalUrl(e,r){let n=await this.getResourceMetadataChallenge(e),o,s,c,l=await this.getResourceMetadata(n,{url:e,headers:r??{}});l.resource&&(o=l.authorization_servers?.[0],s=l.scopes_supported,c=l);let u=new URL(e).origin,d={};o||(o=u,d=r??{});let f;try{let m=await this.getAuthorizationServerMetadata(o,d),g=zJn(m);return f={authorizationServer:o,serverMetadata:g,resourceMetadata:c},sr.info(this.ctx,"authMetadata",f),f}catch(m){sr.warn(this.ctx,`Error populating auth metadata: ${String(m)}`)}let h=YJn(new URL(u));return h.scopes_supported=s??h.scopes_supported??[],f={authorizationServer:o,serverMetadata:h,resourceMetadata:c},f}async getResourceMetadataChallenge(e){let r=await VX(this.ctx,e,"POST"),n;if(r.status===401&&r.headers.has("WWW-Authenticate")){let o=r.headers.get("WWW-Authenticate"),{scheme:s,params:c}=wlt(o);s==="Bearer"&&c.resource_metadata&&(n=c.resource_metadata)}return n}async getResourceMetadata(e,r){if(!e)return{resource:""};let n=new URL(e),o=new URL(r.url),s={};n.origin===o.origin&&(s=r.headers);let c=await VX(this.ctx,e,"GET",{...s,Accept:"application/json","MCP-Protocol-Version":eR});if(c.status!==200)throw new Error(`Failed to fetch resource metadata: ${c.status} ${await vfr(c)}`);let l=await c.json();if(VJn(l)){let u=KJn(e),d=new URL(l.resource).toString(),f=new URL(u).toString();if(d!==f)throw new Error(`Protected Resource Metadata resource "${d}" does not match MCP server resolved resource "${f}". The MCP server must follow OAuth spec https://datatracker.ietf.org/doc/html/rfc9728#PRConfigurationValidation`);return l}else throw new Error(`Invalid resource metadata: ${JSON.stringify(l)}`)}async getAuthorizationServerMetadata(e,r){let n=new URL(e),o=n.pathname==="/"?"":n.pathname,s=new URL(GJn,e).toString()+o,c=await VX(this.ctx,s,"GET",{...r,Accept:"application/json","MCP-Protocol-Version":eR});if(c.status!==200&&(c=await VX(this.ctx,wa(e,".well-known","openid-configuration"),"GET",{...r,Accept:"application/json","MCP-Protocol-Version":eR}),c.status!==200))throw new Error(`Failed to fetch authorization server metadata: ${c.status} ${await vfr(c)}`);let l=await c.json();if(WJn(l))return l;throw new Error(`Invalid authorization server metadata: ${JSON.stringify(l)}`)}};p();var Rb=class{static{a(this,"McpAuthService")}};var t4=new pe("mcpGateway");async function ZJn(t,e,r){t4.info(t,`OAuth discovery: probing ${e}`);try{let n=await new Zhe(t).getMetadataFromOriginalUrl(e,r),o=n.resourceMetadata?.scopes_supported||n.serverMetadata.scopes_supported||[];return t4.info(t,`OAuth discovery: authServer=${n.authorizationServer}, scopes=[${o.join(", ")}], hasPRM=${!!n.resourceMetadata}`),cr(t,"mcpGateway.oauth.discovery",{result:"success",hasPRM:n.resourceMetadata?"true":"false"}),{authorizationServer:n.authorizationServer,serverMetadata:n.serverMetadata,resourceMetadata:n.resourceMetadata,scopes:o}}catch(n){t4.warn(t,`OAuth discovery failed for ${e}: ${String(n)}`),Cs(t,"mcpGateway.oauth.discovery",n,{result:"failure"});return}}a(ZJn,"discoverAuthMetadata");async function klt(t,e,r,n){let o=e.getOrActivateProviderIdForServer(r.authorizationServer);if(!o){let l=e.createAuthenticationProvider(r.authorizationServer,r.serverMetadata,r.resourceMetadata);if(l||(l=await e.createDynamicAuthenticationProvider(r.authorizationServer,r.serverMetadata,r.resourceMetadata)),!l)throw new Error(`Failed to create auth provider for ${r.authorizationServer}`);o=l.id}let s=await e.getSessions(o,r.scopes,{authorizationServer:r.authorizationServer},!0),c=eZn(t)?.getAccountPreference(n,o);if(c){let l=s.find(u=>u.account.label===c);if(l)return cr(t,"mcpGateway.oauth.silent",{result:"hit",via:"preference"}),{token:l.accessToken,providerId:o,sessions:s}}return cr(t,"mcpGateway.oauth.silent",{result:"miss",sessions:String(s.length)}),{token:void 0,providerId:o,sessions:s}}a(klt,"acquireSilent");async function XJn(t,e,r,n,o,s,c=[]){let l=e.getProvider(n),u=mVs(t),d=eZn(t);if(c.length>0&&u){let f="Sign in to another account";try{let h=c.map(g=>({title:g.account.label}));h.push({title:f}),h.push({title:"Cancel"});let m=await u.showInformationModal(`The MCP server ${o} wants to access a ${l.label} account. Select an account for ${o} to use.`,...h);if(!m||m.title==="Cancel"){t4.warn(t,`mount '${o}': user cancelled the account selection`),cr(t,"mcpGateway.oauth.picker",{result:"cancelled"});return}if(m.title!==f){let g=c.find(A=>A.account.label===m.title);if(!g){t4.warn(t,`mount '${o}': picked account not found in sessions`);return}return d?.updateAccountPreference(o,n,g.account),cr(t,"mcpGateway.oauth.picker",{result:"picked"}),g.accessToken}cr(t,"mcpGateway.oauth.picker",{result:"add_account"})}catch(h){t4.error(t,`mount '${o}': failed during account selection`,h),Cs(t,"mcpGateway.oauth.picker",h,{result:"failed"});return}}else if(c.length===0&&u)try{if((await u.showInformationModal(`The MCP Server Definition '${s}' wants to authenticate to ${l.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){t4.warn(t,`mount '${o}': user declined OAuth confirmation`),cr(t,"mcpGateway.oauth.interactive",{result:"declined"});return}cr(t,"mcpGateway.oauth.interactive",{result:"confirmed"})}catch(f){t4.error(t,`mount '${o}': failed to show auth confirmation`,f),Cs(t,"mcpGateway.oauth.interactive",f,{result:"confirm_failed"});return}else u||t4.debug(t,`mount '${o}': no NotificationSender, skipping UI gates`);try{let f=await l.createSession(r.scopes,{});return d?.updateAccountPreference(o,n,f.account),u&&u.showInformationMessageOnlyOnce(`mcpGateway:auth-success:${n}`,`You have authenticated with ${l.label}.`),cr(t,"mcpGateway.oauth.flow",{result:"success"}),f.accessToken}catch(f){t4.error(t,`Interactive OAuth failed for ${r.authorizationServer}`,f),u&&u.showWarningMessageOnlyOnce(`mcpGateway:auth-fail:${n}`,`Authentication failed. You need to restart the IDE to authenticate the MCP server again. ${f instanceof Error?f.message:String(f)}`),Cs(t,"mcpGateway.oauth.flow",f,{result:"failure"});return}}a(XJn,"acquireInteractive");function mVs(t){try{return t.get(es)}catch{return}}a(mVs,"tryGetNotificationSender");function eZn(t){try{return t.get(Rb)}catch{return}}a(eZn,"tryGetMcpAuthService");p();var z2=new pe("mcpGateway"),dNe="Copilot MCP Gateway",fNe="0.1.0",uNe=class{constructor(e,r,n,o){this.id=e;this._ctx=r;this._invoker=n;this._onDidDispose=o;this._sseClients=new Set;this._lastEventId=0;this._isInitialized=!1;this._disposed=!1;this._onToolsListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/tools/list_changed"}),this._onResourcesListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/resources/list_changed"}),this._onPromptsListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/prompts/list_changed"}),this._onLoggingMessage=s=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/message",params:s.params}),this._invoker.on(ul.ToolsListChanged,this._onToolsListChanged),this._invoker.on(ul.ResourcesListChanged,this._onResourcesListChanged),this._invoker.on(ul.PromptsListChanged,this._onPromptsListChanged),this._invoker.on(ul.LoggingMessage,this._onLoggingMessage)}static{a(this,"McpGatewaySession")}attachSseClient(e){if(this._disposed){e.writeHead(410),e.end();return}e.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"}),e.write(`: connected + +`),this._sseClients.add(e),z2.debug(this._ctx,`[session ${this.id}] SSE client attached (total: ${this._sseClients.size})`),e.on("close",()=>{this._sseClients.delete(e),z2.debug(this._ctx,`[session ${this.id}] SSE client detached (total: ${this._sseClients.size})`)})}async handleIncoming(e){let r=Array.isArray(e)?e:[e],n=[];for(let o of r)Ilt(o)?n.push(await this._dispatchRequest(o)):QJn(o)?this._dispatchNotification(o):z2.warn(this._ctx,`[session ${this.id}] ignored unsupported inbound frame`);return n}dispose(){if(!this._disposed){this._disposed=!0,z2.info(this._ctx,`[session ${this.id}] disposing (SSE clients: ${this._sseClients.size})`);for(let e of this._sseClients)e.destroyed||e.end();this._sseClients.clear(),this._invoker.off(ul.ToolsListChanged,this._onToolsListChanged),this._invoker.off(ul.ResourcesListChanged,this._onResourcesListChanged),this._invoker.off(ul.PromptsListChanged,this._onPromptsListChanged),this._invoker.off(ul.LoggingMessage,this._onLoggingMessage),this._onDidDispose()}}async _dispatchRequest(e){z2.debug(this._ctx,`[session ${this.id}] <-- request: ${e.method} (id=${String(e.id)})`);try{let r=await this._handleRequest(e);return{jsonrpc:"2.0",id:e.id,result:r}}catch(r){return r instanceof cR?{jsonrpc:"2.0",id:e.id,error:{code:r.code,message:r.message,data:r.data}}:(z2.error(this._ctx,`[session ${this.id}] request '${e.method}' failed`,r),{jsonrpc:"2.0",id:e.id,error:{code:lR.InternalError,message:r instanceof Error?r.message:String(r)}})}}async _handleRequest(e){if(e.method==="initialize")return this._handleInitialize(e);if(!this._isInitialized)throw new cR(lR.InvalidRequest,"Session is not initialized");switch(e.method){case"ping":return{};case"tools/list":return this._invoker.listTools();case"tools/call":return this._handleCallTool(e);case"resources/list":return this._invoker.listResources();case"resources/read":return this._handleReadResource(e);case"resources/templates/list":return this._invoker.listResourceTemplates();case"prompts/list":return this._invoker.listPrompts();case"prompts/get":return this._handleGetPrompt(e);case"logging/setLevel":return this._handleSetLoggingLevel(e);default:throw new cR(lR.MethodNotFound,`Method not found: ${e.method}`)}}_handleInitialize(e){let r=e.params&&typeof e.params=="object"?e.params:void 0,n=typeof r?.protocolVersion=="string"?r.protocolVersion:void 0,o=r?.clientInfo,s=n&&Cct.includes(n)?n:eR;return z2.info(this._ctx,`[session ${this.id}] initialize: client=${o?.name??"unknown"}/${o?.version??"?"}, clientProtocol=${n??"(none)"}, negotiated=${s}`),n&&n!==s&&z2.warn(this._ctx,`[session ${this.id}] unsupported client protocol version '${n}', falling back to '${s}'`),{protocolVersion:s,capabilities:{tools:{listChanged:!0},resources:{listChanged:!0},prompts:{listChanged:!0},logging:{}},serverInfo:{name:dNe,version:fNe}}}async _handleCallTool(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new cR(lR.InvalidParams,"Missing tool name");let n=r.arguments&&typeof r.arguments=="object"?r.arguments:{};try{return await this._invoker.callTool(r.name,n)}catch(o){throw yd(this._ctx,{message:`Error calling tool ${r.name}: ${o instanceof Error?o.message:String(o)}`,server:this._invoker.label}),o}}_handleReadResource(e){let r=this._requireObjectParams(e);if(typeof r.uri!="string")throw new cR(lR.InvalidParams,"Missing resource uri");return this._invoker.readResource(r.uri)}_handleGetPrompt(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new cR(lR.InvalidParams,"Missing prompt name");let n=r.arguments&&typeof r.arguments=="object"?r.arguments:{};return this._invoker.getPrompt(r.name,n)}async _handleSetLoggingLevel(e){let r=this._requireObjectParams(e);if(typeof r.level!="string")throw new cR(lR.InvalidParams,"Missing logging level");return await this._invoker.setLoggingLevel({level:r.level}),{}}_requireObjectParams(e){if(!e.params||typeof e.params!="object")throw new cR(lR.InvalidParams,"Missing params");return e.params}_dispatchNotification(e){z2.debug(this._ctx,`[session ${this.id}] <-- notification: ${e.method}`),e.method==="notifications/initialized"&&(this._isInitialized=!0,z2.info(this._ctx,`[session ${this.id}] initialized`))}_broadcastIfReady(e){!this._isInitialized||this._disposed||this._broadcast(e)}_broadcast(e){if(this._sseClients.size===0){z2.debug(this._ctx,`[session ${this.id}] no SSE clients, dropping ${e.method}`);return}let r=JSON.stringify(e),n=String(++this._lastEventId),o=r.split(/\r?\n/g),s=[`id: ${n}`,"event: message",...o.map(c=>`data: ${c}`),"",""].join(` +`);for(let c of[...this._sseClients]){if(c.destroyed||c.writableEnded){this._sseClients.delete(c);continue}c.write(s)}}};function tZn(t){let e=Array.isArray(t)?t[0]:t;return!!e&&typeof e.method=="string"&&e.method==="initialize"}a(tZn,"isInitializeMessage");p();p();var $Zn=fe(HZn(),1),Nlt=fe(require("node:process"),1),VZn=require("node:stream");p();var Dlt=class{static{a(this,"ReadBuffer")}append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(` +`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),jVs(r)}clear(){this._buffer=void 0}};function jVs(t){return SH.parse(JSON.parse(t))}a(jVs,"deserializeMessage");function GZn(t){return JSON.stringify(t)+` +`}a(GZn,"serializeMessage");var HVs=Nlt.default.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function GVs(){let t={};for(let e of HVs){let r=Nlt.default.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(GVs,"getDefaultEnvironment");var tme=class{static{a(this,"StdioClientTransport")}constructor(e){this._readBuffer=new Dlt,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new VZn.PassThrough)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,r)=>{this._process=(0,$Zn.default)(this._serverParams.command,this._serverParams.args??[],{env:{...GVs(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:Nlt.default.platform==="win32",cwd:this._serverParams.cwd}),this._process.on("error",n=>{r(n),this.onerror?.(n)}),this._process.on("spawn",()=>{e()}),this._process.on("close",n=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on("error",n=>{this.onerror?.(n)}),this._process.stdout?.on("data",n=>{this._readBuffer.append(n),this.processReadBuffer()}),this._process.stdout?.on("error",n=>{this.onerror?.(n)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){if(this._process){let e=this._process;this._process=void 0;let r=new Promise(n=>{e.once("close",()=>{n()})});try{e.stdin?.end()}catch{}if(await Promise.race([r,new Promise(n=>setTimeout(n,2e3).unref())]),e.exitCode===null){try{e.kill("SIGTERM")}catch{}await Promise.race([r,new Promise(n=>setTimeout(n,2e3).unref())])}if(e.exitCode===null)try{e.kill("SIGKILL")}catch{}}this._readBuffer.clear()}send(e){return new Promise(r=>{if(!this._process?.stdin)throw new Error("Not connected");let n=GZn(e);this._process.stdin.write(n)?r():this._process.stdin.once("drain",r)})}};var WZn=require("child_process"),zZn=require("events"),YZn=require("util");var Mfr=1e4,$Vs=(0,YZn.promisify)(WZn.exec),pNe=class{constructor(e){this._transport=null;this._emitter=new zZn.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._emitter.setMaxListeners(0),this._client=new OH({name:e.clientInfo.name,version:e.clientInfo.version},{capabilities:{}})}static{a(this,"StdioInvoker")}get isConnected(){return this._connected}async start(){if(this._connected)return;let e={...this._options.params,stderr:"pipe"},r=new tme(e);this._transport=r,this._client.onerror=n=>this._options.onError?.(n),this._client.onclose=()=>{this._connected=!1},r.stderr&&r.stderr.on("data",n=>{this._options.onStderr?.(n.toString())}),this._client.setNotificationHandler(m8,()=>{this._emitter.emit(ul.ToolsListChanged)}),this._client.setNotificationHandler(p8,()=>{this._emitter.emit(ul.ResourcesListChanged)}),this._client.setNotificationHandler(h8,()=>{this._emitter.emit(ul.PromptsListChanged)}),this._client.setNotificationHandler(wX,n=>{this._emitter.emit(ul.LoggingMessage,n)}),await this._client.connect(r),this._connected=!0}async stop(){if(!this._transport){this._connected=!1;return}let e=this._transport;this._transport=null;let r=this._client.close().catch(()=>{}),n=await Promise.race([r.then(()=>!0),new Promise(s=>setTimeout(()=>s(!1),Mfr))]),o;if("pid"in e&&typeof e.pid=="number"&&(o=e.pid),!n&&o===void 0&&this._options.onError?.(new Error(`stdio transport exposed no pid; cannot force-kill '${this.id}'`)),!n&&o!==void 0&&process.platform==="win32")try{await $Vs(`taskkill /pid ${o} /t /f`,{timeout:Mfr})}catch{}else if(!n&&o!==void 0){try{process.kill(o,"SIGTERM")}catch{}await new Promise(s=>setTimeout(s,Mfr));try{process.kill(o,"SIGKILL")}catch{}}this._connected=!1}listTools(){return this._client.listTools()}callTool(e,r){return this._client.callTool({name:e,arguments:r})}listResources(){return this._client.listResources()}readResource(e){return this._client.readResource({uri:e})}listResourceTemplates(){return this._client.listResourceTemplates()}listPrompts(){return this._client.listPrompts()}getPrompt(e,r){return this._client.getPrompt({name:e,arguments:r})}async setLoggingLevel(e){await this._client.setLoggingLevel(e.level)}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}};p();var gm=class{static{a(this,"AuthenticationService")}};var jT=new pe("mcpGateway.manager");function KZn(t){return Efr(t.raw)}a(KZn,"selectManagedMcpSettings");var FH=class extends Error{constructor(r,n){super(n);this.code=r}static{a(this,"ServerActionError")}},VVs={tools:[],resources:[],resourceTemplates:[],prompts:[]},ny=class{constructor(e,r,n,o){this._entries=new Map;this._disposed=!1;this._applyChain=Promise.resolve();this._oauthChain=Promise.resolve();this._actionChains=new Map;this._ctx=e,this._service=r,this._sender=n,this._unregister=n,this._managedSettings=o,this._managedSettingsSub=o?.observe(KZn,()=>this._onMcpSettingsChanged())}static{a(this,"McpServerManager")}listServers(e){let r=[];for(let n of this._entries.values())YVs(n.key.source,e)&&r.push({name:n.key.name,source:n.key.source,status:n.status,error:n.error,authInfo:n.authInfo,registryInfo:n.registryInfo});return r}getServerDetails(e){let r=this._entries.get(BH(e));return r?{tools:r.contents.tools,resources:r.contents.resources,resourceTemplates:r.contents.resourceTemplates,prompts:r.contents.prompts}:null}listReadyEntries(){let e=[];for(let r of this._entries.values()){if(r.status!=="running"||!this._evaluateAllowlist(r).allowed)continue;let n=BH(r.key),o=this._service.listMounts().find(s=>s.id===n);e.push({key:r.key,url:o?.url??null})}return e}async applyConfig(e){if(this._disposed)throw new Error("McpServerManager is disposed");let r=this._applyChain.then(()=>this._applyConfigLocked(e));return this._applyChain=r.catch(()=>{}),r}async removeProject(e){if(this._disposed)return;let r=this._applyChain.then(()=>this._removeProjectLocked(e));return this._applyChain=r.catch(()=>{}),r}async applyPluginServers(e,r){if(this._disposed)throw new Error("McpServerManager is disposed");let n=this._applyChain.then(()=>this._applyScope({kind:"plugin",pluginId:e},r));return this._applyChain=n.catch(()=>{}),n}async removePluginServers(e){return this.applyPluginServers(e,{})}async _applyConfigLocked(e){let{workspaceFolder:r,user:n,project:o}=e,s=WVs(n),c=s!==this._lastUserHash;c&&(await this._applyScope({kind:"user"},n),this._lastUserHash=s),await this._applyScope({kind:"project",workspaceFolder:r},o),cr(this._ctx,"mcpGateway.applyConfig",{userChanged:String(c),hasProject:String(Object.keys(o).length>0)},{userServerCount:Object.keys(n).length,projectServerCount:Object.keys(o).length})}async _applyScope(e,r){let n=new Map,o=[];for(let[l,u]of Object.entries(r)){let d=JVs(l,u);if(!d){o.push(l);continue}n.set(BH({source:e,name:l}),{classified:d,hash:JZn(u)})}o.length>0&&jT.warn(this._ctx,`applyConfig: skipped ${o.length} unrecognised entries in ${KVs(e)}: [${o.join(", ")}]`);let s=[];for(let[l,u]of this._entries)zVs(u.key.source,e)&&!n.has(l)&&s.push(l);for(let l of s)await this._removeEntry(l);let c=!1;for(let[l,{classified:u,hash:d}]of n){let f=this._entries.get(l);f?f.entryHash!==d&&(await this._stopInvoker(f,"starting"),f.classified=u,f.entryHash=d,f.error=void 0,c=!0,this._beginStart(l)):(this._createEntry({source:e,name:u.name},u,d),c=!0,this._beginStart(l))}c&&this._sender.serversChanged(r4(e))}async _removeProjectLocked(e){let r=[];for(let[n,o]of this._entries)o.key.source.kind==="project"&&o.key.source.workspaceFolder===e&&r.push(n);if(r.length!==0)for(let n of r)await this._removeEntry(n)}serverAction(e,r){let n=BH(e),o=this._entries.get(n);if(!o)throw new FH("unknownServer",`Unknown MCP server: ${e.name}`);switch(r){case"start":case"restart":if(o.status==="blocked")throw new FH("startBlocked",`Server '${e.name}' is blocked by policy and cannot be started`);break;case"logout":case"clearOAuth":if(!o.authInfo&&!o.authDiscovery)throw new FH("noAuth",`Server '${e.name}' has no auth state to clear`);break}let c=(this._actionChains.get(n)??Promise.resolve()).then(()=>this._runAction(n,r));return this._actionChains.set(n,c.catch(()=>{})),Promise.resolve()}async _runAction(e,r){let n=this._entries.get(e);if(n)switch(r){case"start":if(n.status==="running"||n.status==="starting")return;await this._beginStart(e);return;case"stop":if(n.status==="stopped")return;await this._stopInvoker(n,"stopped"),this._sender.serversChanged(r4(n.key.source));return;case"restart":await this._stopInvoker(n,"starting"),this._sender.serversChanged(r4(n.key.source)),await this._beginStart(e);return;case"logout":await this._performLogout(n,!1);return;case"clearOAuth":await this._performLogout(n,!0),await this._beginStart(e);return}}async dispose(){if(this._disposed)return;this._disposed=!0,this._managedSettingsSub?.dispose(),this._managedSettingsSub=void 0;let e=[...this._entries.values()].map(r=>this._stopInvoker(r,"stopped").catch(()=>{}));this._entries.clear(),await Promise.all(e)}_toEvalServer(e){let r=e.classified;if(r.kind==="stdio"){let{command:n,args:o}=r.params;return{name:e.key.name,transport:{kind:"stdio",command:[n,...o??[]]}}}return{name:e.key.name,transport:{kind:r.type,url:r.url}}}_evaluateAllowlist(e){let r=this._managedSettings?KZn(this._managedSettings.get()):void 0;return yfr(this._toEvalServer(e),r)}async _markBlocked(e,r){e.error=r,await this._stopInvoker(e,"blocked")}_onMcpSettingsChanged(){if(this._disposed)return;let e=this._applyChain.then(()=>this._reEnforceAllowlistLocked());this._applyChain=e.catch(()=>{})}async _reEnforceAllowlistLocked(){for(let[e,r]of this._entries){let n=this._evaluateAllowlist(r);!n.allowed&&r.status!=="blocked"?await this._markBlocked(r,n.reason):n.allowed&&r.status==="blocked"&&(r.error=void 0,this._beginStart(e))}}_createEntry(e,r,n){let o={key:e,classified:r,entryHash:n,invoker:null,status:"stopped",contents:{...VVs},listeners:null};return this._entries.set(BH(e),o),o}async _removeEntry(e){let r=this._entries.get(e);if(!r)return;let n=r4(r.key.source);await this._stopInvoker(r,"stopped").catch(()=>{}),this._entries.delete(e),this._sender.serversChanged(n)}async _beginStart(e){let r=this._entries.get(e);if(!r)return;let n=this._evaluateAllowlist(r);if(!n.allowed){await this._markBlocked(r,n.reason);return}r.invoker?await this._stopInvoker(r,"starting"):(r.status="starting",r.error=void 0,this._sender.serversChanged(r4(r.key.source)));let o=this._buildInvoker(r);r.invoker=o,this._wireInvokerEvents(r);try{if(await o.start(),r.invoker!==o){await o.stop().catch(()=>{});return}r.status="running",r.error=void 0;try{await this._service.registerMount(o,r.key.name)}catch(s){throw jT.error(this._ctx,`failed to register mount for '${r.key.name}'`,s),s}if(r.invoker!==o){this._service.unregisterMount(BH(r.key)),await o.stop().catch(()=>{});return}if(await this._refreshContents(r).catch(s=>{jT.warn(this._ctx,`failed to refresh contents for '${r.key.name}': ${String(s)}`)}),r.invoker!==o)return;this._sender.serversChanged(r4(r.key.source)),this._sender.serverDetailsChanged(r.key),ia(this._ctx,{message:"Connection state: Running",server:r.key.name})}catch(s){if(r.invoker!==o){await o.stop().catch(()=>{});return}s instanceof Jhe?(r.status="unauthorized",r.error=void 0,jT.warn(this._ctx,`server '${r.key.name}' requires authorization`),W2(this._ctx,{message:"Connection state: Unauthorized (authorization required)",server:r.key.name})):(r.status="error",r.error=s instanceof Error?s.message:String(s),jT.error(this._ctx,`server '${r.key.name}' failed to start`,s),yd(this._ctx,{message:`Connection state: Error: ${r.error}`,server:r.key.name})),await o.stop().catch(()=>{}),this._unwireInvokerEvents(r),r.invoker=null,this._sender.serversChanged(r4(r.key.source))}}async _stopInvoker(e,r){let n=e.invoker;this._unwireInvokerEvents(e),e.invoker=null,e.status=r,r!=="error"&&r!=="blocked"&&(e.error=void 0),this._service.unregisterMount(BH(e.key)),this._sender.serversChanged(r4(e.key.source)),n&&(r==="stopped"&&ia(this._ctx,{message:"Connection state: Stopped",server:e.key.name}),await n.stop().catch(o=>{jT.warn(this._ctx,`failed to stop invoker '${e.key.name}': ${String(o)}`)}))}_wireInvokerEvents(e){let r=e.invoker;if(!r)return;let n={toolsChanged:a(()=>{this._onUpstreamListChanged(e,"tools")},"toolsChanged"),resourcesChanged:a(()=>{this._onUpstreamListChanged(e,"resources")},"resourcesChanged"),promptsChanged:a(()=>{this._onUpstreamListChanged(e,"prompts")},"promptsChanged"),loggingMessage:a(o=>this._onUpstreamLog(e,o),"loggingMessage")};r.on(ul.ToolsListChanged,n.toolsChanged),r.on(ul.ResourcesListChanged,n.resourcesChanged),r.on(ul.PromptsListChanged,n.promptsChanged),r.on(ul.LoggingMessage,n.loggingMessage),e.listeners=n}_unwireInvokerEvents(e){let r=e.invoker,n=e.listeners;r&&n&&(r.off(ul.ToolsListChanged,n.toolsChanged),r.off(ul.ResourcesListChanged,n.resourcesChanged),r.off(ul.PromptsListChanged,n.promptsChanged),r.off(ul.LoggingMessage,n.loggingMessage)),e.listeners=null}_onUpstreamLog(e,r){let n=r.params.data,o=typeof n=="string"?n:JSON.stringify(n),s=r.params.logger?`${r.params.logger}: ${o}`:o,c=e.key.name;switch(r.params.level){case"warning":W2(this._ctx,{message:s,server:c});break;case"error":case"critical":case"alert":case"emergency":yd(this._ctx,{message:s,server:c});break;default:ia(this._ctx,{message:s,server:c})}}async _onUpstreamListChanged(e,r){if(e.invoker)try{if(r==="tools"){let n=await e.invoker.listTools();e.contents.tools=n.tools}else if(r==="resources"){let[n,o]=await Promise.all([e.invoker.listResources(),e.invoker.listResourceTemplates()]);e.contents.resources=n.resources,e.contents.resourceTemplates=o.resourceTemplates}else{let n=await e.invoker.listPrompts();e.contents.prompts=n.prompts}this._sender.serverDetailsChanged(e.key)}catch(n){jT.warn(this._ctx,`failed to refresh ${r} for '${e.key.name}': ${String(n)}`)}}async _refreshContents(e){if(!e.invoker)return;let r=await Promise.allSettled([e.invoker.listTools(),e.invoker.listResources(),e.invoker.listResourceTemplates(),e.invoker.listPrompts()]);e.contents={tools:r[0].status==="fulfilled"?r[0].value.tools:[],resources:r[1].status==="fulfilled"?r[1].value.resources:[],resourceTemplates:r[2].status==="fulfilled"?r[2].value.resourceTemplates:[],prompts:r[3].status==="fulfilled"?r[3].value.prompts:[]}}_buildInvoker(e){let r=e.classified,n=BH(e.key),o=e.key.name,s=a(c=>{yd(this._ctx,{message:`Connection state: Error: ${c.message}`,server:o})},"onError");return r.kind==="stdio"?new pNe({id:n,label:o,params:r.params,clientInfo:{name:dNe,version:fNe},onStderr:a(c=>{W2(this._ctx,{message:`[server stderr] ${c.trimEnd()}`,server:o})},"onStderr"),onError:s}):new aNe({id:n,label:o,url:r.url,type:r.type,httpOptions:r.type==="http"?r.httpOptions:void 0,sseOptions:r.type==="sse"?r.sseOptions:void 0,clientInfo:{name:dNe,version:fNe},onError:s,authProvider:this._tryGetAuthSvc()?this._buildAuthProvider(e,r.url,r.httpOptions?.requestInit?.headers):void 0,onFallback:a(({fromCode:c})=>{jT.info(this._ctx,`'${e.key.name}': Streamable HTTP returned ${c}, falling back to legacy SSE`),cr(this._ctx,"mcpGateway.transport.fallbackToSse",{fromCode:String(c)})},"onFallback")})}_tryGetAuthSvc(){try{return this._ctx.get(gm)}catch{return}}_buildAuthProvider(e,r,n){let o=a(async()=>{if(e.authDiscovery)return e.authDiscovery;let s=await ZJn(this._ctx,r,n);if(!s){jT.warn(this._ctx,`'${e.key.name}': OAuth discovery failed`);return}try{let c=this._tryGetAuthSvc(),l=await klt(this._ctx,c,s,e.key.name);if(e.authDiscovery={discovery:s,providerId:l.providerId},l.token){let u=l.sessions.find(d=>d.accessToken===l.token);u&&this._setAuthInfo(e,{providerId:l.providerId,accountName:u.account.label})}return e.authDiscovery}catch(c){jT.error(this._ctx,`'${e.key.name}': dynamic provider setup failed`,c);return}},"ensureDiscovery");return async s=>{let c=this._tryGetAuthSvc();if(!c)return;let l=await o();if(!l)return;if(s==="silent"){let f=await klt(this._ctx,c,l.discovery,e.key.name);if(f.token){let h=f.sessions.find(m=>m.accessToken===f.token);h&&this._setAuthInfo(e,{providerId:l.providerId,accountName:h.account.label})}return f.token}let u,d=this._oauthChain.then(async()=>{let f=await klt(this._ctx,c,l.discovery,e.key.name);if(f.token){u=f.token;let h=f.sessions.find(m=>m.accessToken===u);h&&this._setAuthInfo(e,{providerId:l.providerId,accountName:h.account.label});return}if(u=await XJn(this._ctx,c,l.discovery,l.providerId,e.key.name,r,f.sessions),u){let m=(await c.getSessions(l.providerId,l.discovery.scopes,{authorizationServer:l.discovery.authorizationServer},!0)).find(g=>g.accessToken===u);m&&this._setAuthInfo(e,{providerId:l.providerId,accountName:m.account.label})}});return this._oauthChain=d.catch(()=>{}),await d,u}}_setAuthInfo(e,r){e.authInfo?.providerId===r.providerId&&e.authInfo?.accountName===r.accountName||(e.authInfo=r,this._sender.serversChanged(r4(e.key.source)))}async _performLogout(e,r){await this._stopInvoker(e,"stopped").catch(()=>{});let n=this._tryGetAuthSvc(),o=e.authInfo?.providerId??e.authDiscovery?.providerId;if(n&&o)try{let s=n.getProvider(o),c=await n.getSessions(o,e.authDiscovery?.discovery.scopes??[],e.authDiscovery?{authorizationServer:e.authDiscovery.discovery.authorizationServer}:void 0,!0);for(let l of c)await s.removeSession(l.id).catch(u=>jT.warn(this._ctx,`removeSession failed for '${e.key.name}': ${String(u)}`))}catch(s){jT.warn(this._ctx,`logout enumeration failed for '${e.key.name}': ${String(s)}`)}if(r&&o){try{await this._unregister.unregisterProvider(o)}catch(s){jT.warn(this._ctx,`unregisterProvider failed for '${e.key.name}': ${String(s)}`)}e.authDiscovery=void 0}e.authInfo=void 0,this._sender.serversChanged(r4(e.key.source))}};function BH(t){switch(t.source.kind){case"user":return`user::${t.name}`;case"project":return`project::${t.source.workspaceFolder}::${t.name}`;case"plugin":return`plugin::${t.source.pluginId}::${t.name}`}}a(BH,"serializeKey");function JZn(t){if(!t||typeof t!="object")return JSON.stringify(t);let e=t,r=Object.keys(e).sort(),n={};for(let o of r)n[o]=e[o];return JSON.stringify(n)}a(JZn,"canonicalEntryHash");function WVs(t){let e=Object.keys(t).sort(),r={};for(let n of e)r[n]=JZn(t[n]);return JSON.stringify(r)}a(WVs,"canonicalConfigHash");function r4(t){return t.kind==="project"?{kind:"project",workspaceFolder:t.workspaceFolder}:{kind:"user"}}a(r4,"notificationScopeFor");function zVs(t,e){return t.kind!==e.kind?!1:t.kind==="project"&&e.kind==="project"?t.workspaceFolder===e.workspaceFolder:t.kind==="plugin"&&e.kind==="plugin"?t.pluginId===e.pluginId:t.kind==="user"&&e.kind==="user"}a(zVs,"sameScope");function YVs(t,e){return e===void 0||t.kind==="user"||t.kind==="plugin"?!0:t.kind==="project"&&e.kind==="project"?t.workspaceFolder===e.workspaceFolder:!1}a(YVs,"entryInScope");function KVs(t){switch(t.kind){case"user":return"user";case"project":return`project<${t.workspaceFolder}>`;case"plugin":return`plugin<${t.pluginId}>`}}a(KVs,"describeScope");function JVs(t,e){if(!e||typeof e!="object")return;let r=e;if(typeof r.command=="string")return{kind:"stdio",name:t,params:e};if(typeof r.url=="string"){let o=(typeof r.type=="string"?r.type:void 0)==="sse"?"sse":"http";return{kind:"http",name:t,url:r.url,type:o,httpOptions:o==="http"?e:void 0,sseOptions:o==="sse"?e:void 0}}}a(JVs,"classifyEntry");p();var Ofr=require("crypto"),ZZn=require("events"),XZn=fe(require("http"));var UH=new pe("mcpGateway"),ZVs="mcp-session-id",XVs=1024*1024,eWs=5e3,eXn={Ready:"ready",Unauthorized:"unauthorized",Error:"error"},WX={MountsChanged:"mountsChanged"},QH=class{constructor(e,r={}){this._routes=new Map;this._idToRouteId=new Map;this._emitter=new ZZn.EventEmitter;this._connections=new Set;this._ctx=e,this._host=r.host??"127.0.0.1"}static{a(this,"McpGatewayService")}get port(){return this._port}get origin(){return this._port===void 0?void 0:`http://${this._host}:${this._port}`}listMounts(){let e=[];for(let[r,n]of this._routes)e.push(this._buildMountInfo(n.invoker.id,n.label,r,n.status));return e}setMountStatus(e,r){let n=this._idToRouteId.get(e);if(!n)return;let o=this._routes.get(n);if(!o||o.status===r)return;let s=o.status;o.status=r,UH.info(this._ctx,`mount '${o.label}' (${e}) status -> ${r}`),cr(this._ctx,"mcpGateway.mount.statusChanged",{from:s,to:r}),this._emitter.emit(WX.MountsChanged,this.listMounts())}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}async registerMount(e,r,n=eXn.Ready){if(await this._ensureServer(),this._port===void 0)throw new Error("Gateway server failed to start");if(this._idToRouteId.get(e.id))throw new Error(`Mount already registered for id '${e.id}'`);let s=(0,Ofr.randomUUID)(),c=r??e.label;this._routes.set(s,{invoker:e,label:c,sessions:new Map,status:n}),this._idToRouteId.set(e.id,s);let l=this._buildMountInfo(e.id,c,s,n);return UH.info(this._ctx,`registered mount '${c}' (${e.id}) at ${l.url} [${n}]`),cr(this._ctx,"mcpGateway.mount.registered",{status:n}),this._emitter.emit(WX.MountsChanged,this.listMounts()),l}unregisterMount(e){let r=this._idToRouteId.get(e);if(!r)return;let n=this._routes.get(r);if(n){for(let o of n.sessions.values())o.dispose();n.sessions.clear(),this._routes.delete(r),this._idToRouteId.delete(e),UH.info(this._ctx,`unregistered mount '${n.label}' (${e})`),cr(this._ctx,"mcpGateway.mount.unregistered",{finalStatus:n.status}),this._emitter.emit(WX.MountsChanged,this.listMounts())}}dispose(){for(let e of this._routes.values()){for(let r of e.sessions.values())r.dispose();e.sessions.clear()}this._routes.clear(),this._idToRouteId.clear(),this._stopServer()}async _ensureServer(){if(!this._server?.listening){if(this._startPromise)return this._startPromise;this._startPromise=this._startServer();try{await this._startPromise}finally{this._startPromise=void 0}}}_startServer(){return new Promise((e,r)=>{let n=XZn.createServer((s,c)=>this._handleRequest(s,c));n.requestTimeout=0,this._server=n,n.on("connection",s=>{this._connections.add(s),s.on("close",()=>this._connections.delete(s))});let o=setTimeout(()=>r(new Error("Gateway listen timeout")),eWs);n.once("listening",()=>{let s=n.address();s&&typeof s=="object"&&(this._port=s.port),clearTimeout(o),UH.info(this._ctx,`listening on http://${this._host}:${this._port}`),e()}),n.on("error",s=>{if(s.code==="EADDRINUSE"){n.listen(0,this._host);return}clearTimeout(o),r(s)}),n.listen(0,this._host)})}_stopServer(){if(this._server){UH.info(this._ctx,"stopping HTTP server");for(let e of this._connections)e.destroy();this._connections.clear(),this._server.close(),this._server=void 0,this._port=void 0}}_handleRequest(e,r){let o=new URL(e.url??"/",`http://${e.headers.host??"127.0.0.1"}`).pathname.split("/").filter(Boolean);if(o.length<2||o[1]!=="mcp"){this._respondHttpError(r,404,"Not found");return}let s=o[0],c=this._routes.get(s);if(!c){this._respondHttpError(r,404,"Mount not found");return}if(e.method==="POST"){this._handlePost(c,e,r);return}if(e.method==="GET"){this._handleGet(c,e,r);return}if(e.method==="DELETE"){this._handleDelete(c,e,r);return}this._respondHttpError(r,405,"Method not allowed")}async _handlePost(e,r,n){let o=await this._readBody(r);if(o===void 0){this._respondHttpError(n,413,"Payload too large");return}let s;try{s=JSON.parse(o)}catch(u){let d={jsonrpc:"2.0",id:null,error:{code:lR.ParseError,message:u instanceof Error?u.message:String(u)}};n.writeHead(400,{"Content-Type":"application/json"}),n.end(JSON.stringify(d));return}let c=this._getSessionId(r),l=this._resolveSession(e,c,s,n);if(l)try{let u=await l.handleIncoming(s),d={"Content-Type":"application/json","Mcp-Session-Id":l.id};if(u.length===0||!this._hasRequest(s)){n.writeHead(202,d),n.end();return}let f=JSON.stringify(Array.isArray(s)?u:u[0]);n.writeHead(200,d),n.end(f)}catch(u){UH.error(this._ctx,"POST handler failed",u),this._respondHttpError(n,500,"Internal server error")}}_handleGet(e,r,n){let o=this._getSessionId(r);if(!o){this._respondHttpError(n,400,"Missing Mcp-Session-Id header");return}let s=e.sessions.get(o);if(!s){this._respondHttpError(n,404,"Session not found");return}s.attachSseClient(n)}_handleDelete(e,r,n){let o=this._getSessionId(r);if(!o){this._respondHttpError(n,400,"Missing Mcp-Session-Id header");return}let s=e.sessions.get(o);if(!s){this._respondHttpError(n,404,"Session not found");return}s.dispose(),n.writeHead(204),n.end()}_resolveSession(e,r,n,o){if(r){let l=e.sessions.get(r);if(!l){this._respondHttpError(o,404,"Session not found");return}return l}if(!tZn(n)){this._respondHttpError(o,400,"Missing Mcp-Session-Id header");return}let s=(0,Ofr.randomUUID)(),c=new uNe(s,this._ctx,e.invoker,()=>{e.sessions.delete(s)&&UH.info(this._ctx,`mount '${e.label}' session detached (sid=${s}, active sessions: ${e.sessions.size})`)});return e.sessions.set(s,c),UH.info(this._ctx,`mount '${e.label}' session attached (sid=${s}, active sessions: ${e.sessions.size})`),c}_hasRequest(e){return(Array.isArray(e)?e:[e]).some(Ilt)}_getSessionId(e){let r=e.headers[ZVs];return Array.isArray(r)?r[0]:r}async _readBody(e){let r=[],n=0;for await(let o of e){let s=Buffer.isBuffer(o)?o:Buffer.from(o);if(n+=s.byteLength,n>XVs)return;r.push(s)}return Buffer.concat(r).toString("utf8")}_respondHttpError(e,r,n){e.writeHead(r,{"Content-Type":"application/json"});let o={jsonrpc:"2.0",id:null,error:{code:r,message:n}};e.end(JSON.stringify(o))}_buildMountInfo(e,r,n,o){return{id:e,label:r,routeId:n,url:`${this.origin}/${n}/mcp`,status:o}}};p();var tXn=[{type:"skill",pick:a(t=>t.skills,"pick")},{type:"agent",pick:a(t=>t.agents,"pick")},{type:"instructions",pick:a(t=>t.instructions,"pick")},{type:"prompt",pick:a(t=>t.commands,"pick")}],S8=class{constructor(e,r){this.ctx=e;this.service=r;this.logger=new pe("PluginContributionInjector");this.registered=new Map;this.disposed=!1;this.syncChain=Promise.resolve();this.changeSubscription=this.service.onDidChangePlugins(()=>this.scheduleSync()),this.gateSubscription=this.subscribeToGateChanges()}static{a(this,"PluginContributionInjector")}subscribeToGateChanges(){try{let e=this.ctx.get(Lo);return this.lastPluginsEnabled=CH(this.ctx),e.onDidChangeCopilotSettings(()=>{let r=CH(this.ctx);r!==this.lastPluginsEnabled&&(this.lastPluginsEnabled=r,this.initialSyncPromise=void 0,this.scheduleSync())})}catch{return}}async ensureInitialSync(){if(this.disposed)return;if(this.initialSyncPromise)return this.initialSyncPromise;if(!this.isEditorIdentityKnown())return;let e,r=new Promise(n=>e=n);return this.initialSyncPromise=r,this.syncChain=this.syncChain.then(()=>this.sync()).then(n=>{n||(this.initialSyncPromise=void 0)}).catch(n=>{this.initialSyncPromise=void 0,this.logger.warn(this.ctx,"plugin contribution initial sync failed",{err:String(n)})}).finally(()=>e()),r}isEditorIdentityKnown(){try{return this.ctx.get(Ir).isEditorPluginInfoKnown()}catch{return!0}}scheduleSync(){this.syncChain=this.syncChain.then(()=>this.sync()).then(()=>{}).catch(e=>{this.logger.warn(this.ctx,"plugin contribution sync failed",{err:String(e)})})}syncedForTesting(){return this.syncChain}async sync(){if(this.disposed)return!0;if(!CH(this.ctx))return this.teardownAll(),!0;let e;try{e=(await this.service.listPlugins()).filter(n=>n.enabled)}catch(n){return this.logger.warn(this.ctx,"listPlugins failed during sync",{err:String(n)}),!1}if(this.disposed)return!0;let r=new Map(e.map(n=>[n.uri,n]));for(let n of[...this.registered.keys()])r.has(n)||this.teardownPlugin(n);for(let[n,o]of r)if(await this.reconcilePlugin(n,o),this.disposed)return!0;return!0}async reconcilePlugin(e,r){let n=this.registered.get(e),o=tWs(r),s=rWs(r),c=n?.disposables??[];if(!n||n.fileHash!==o){for(let u of c)u.dispose();c=this.registerFiles(e,r)}let l=n?.mcpApplied??!1;if((!n||n.mcpHash!==s||!n.mcpApplied)&&(l=await this.applyMcp(e,r,n)),this.disposed){for(let u of c)u.dispose();l&&this.tryManager()?.removePluginServers(e).catch(d=>this.logger.warn(this.ctx,"removePluginServers failed",{uri:e,err:String(d)}));return}this.registered.set(e,{fileHash:o,mcpHash:s,mcpApplied:l,disposables:c})}registerFiles(e,r){let n=this.tryRegistry();if(!n)return[];let o=[];for(let{type:s,pick:c}of tXn)for(let l of c(r))o.push(n.register(s,[nWs(l.uri)],{watchable:!1,classification:{storage:"plugin",pluginInfo:{name:l.name,description:l.description??"",pluginUri:e}}}));return o}async applyMcp(e,r,n){let o=this.tryManager();if(!o)return!0;let s=iWs(r.mcpServerDefinitions);if(Object.keys(s).length===0&&!n?.mcpApplied)return!0;try{return await o.applyPluginServers(e,s),!0}catch(c){return this.logger.warn(this.ctx,"applyPluginServers failed",{uri:e,err:String(c)}),!1}}teardownPlugin(e){let r=this.registered.get(e);if(!r)return;for(let o of r.disposables)o.dispose();let n=this.tryManager();n&&n.removePluginServers(e).catch(o=>this.logger.warn(this.ctx,"removePluginServers failed",{uri:e,err:String(o)})),this.registered.delete(e)}teardownAll(){for(let e of[...this.registered.keys()])this.teardownPlugin(e)}tryRegistry(){return this.tryGet(PA)}tryManager(){return this.tryGet(ny)}tryGet(e){try{return this.ctx.get(e)}catch(r){if(r instanceof $l)return;throw r}}dispose(){this.disposed||(this.disposed=!0,this.changeSubscription.dispose(),this.gateSubscription?.dispose(),this.teardownAll())}};function tWs(t){let e=tXn.flatMap(({pick:r})=>r(t).map(n=>JSON.stringify([n.uri,n.name,n.description??""]))).sort();return JSON.stringify(e)}a(tWs,"fileContentHash");function rWs(t){let e=t.mcpServerDefinitions.map(r=>JSON.stringify([r.name,r.configuration])).sort();return JSON.stringify(e)}a(rWs,"mcpContentHash");function nWs(t){return t.includes("://")?ln(t):t}a(nWs,"toPathPattern");function iWs(t){let e={};for(let{name:r,configuration:n}of t)n.type==="stdio"?e[r]={command:n.command,...n.args&&{args:[...n.args]},...n.env&&{env:{...n.env}},...n.cwd&&{cwd:n.cwd}}:e[r]={url:n.url,...n.headers&&{headers:{...n.headers}}};return e}a(iWs,"toMcpServersConfig");var rXn=fe(require("node:path"));var Mlt=new pe("BackgroundAgent.SessionOptionsBuilder"),oWs=5e3;async function nXn(t,e,r,n){let o=k3((async()=>{try{await t.get(S8).ensureInitialSync()}catch(A){if(!(A instanceof $l))throw A}})(),oWs,void 0),s=await n.buildAuthInfo(),c=eo(r.workspaceFolder.uri).fsPath;await o;let l;try{l=t.get(A0).getSkillDirectories(c),l.length===0&&(l=void 0)}catch{}let u={clientName:t.get(Ir).getEditorPluginInfo().name,integrationId:K$e(t.get(Ir))??"jetbrains-chat",sessionId:e,authInfo:s,model:r.model,reasoningEffort:r.reasoningEffort,enableStreaming:r.enableStreaming??!0,excludedTools:r.excludedTools,skillDirectories:l,disabledSkills:r.disabledSkills?new Set(r.disabledSkills):void 0,workingDirectory:c};try{await t.get(L3)._handleWorkspaceAdded({uri:r.workspaceFolder.uri,name:r.workspaceFolder.name??""})}catch{}let d=await Kat(t,r.workspaceFolder);d.length>0&&(u.customAgents=d);let f=r.mcpDirectory??r.workspaceFolder.uri;try{let A=t.get(Xw).buildMcpServers(f);Mlt.info(t,"Built MCP gateway servers for SDK options",{sessionId:e,gatewayServers:A}),Object.keys(A).length>0&&(u.mcpServers=A)}catch(A){if(!(A instanceof $l))throw A}u.hooks=jVn(t,r.workspaceFolder);let h=await ezn(t,r.workspaceFolder);if(u.hooks=tzn(u.hooks,h),r.inlineConfinedFile){let A=[...u.hooks.preToolUse??[]];r.inlineConfinementHook&&A.unshift(r.inlineConfinementHook),r.inlineTurnLimiter&&A.unshift(r.inlineTurnLimiter.hook),u.hooks={...u.hooks,preToolUse:A},u.systemMessage={mode:"append",content:izn(r.inlineConfinedFile)}}else{let A=await Olr(t,[r.workspaceFolder]).catch(v=>{Mlt.warn(t,"Failed to load git commit instructions for systemMessage",v)}),y=r.useNestedAgentsMdFiles===!0?await aWs(t,c):void 0,E=r.useNestedClaudeMdFiles===!0?await sWs(t,c):void 0,_=WVn({gitCommitInstructions:A,globalAgentsMdInstructions:r.globalAgentsMdInstructions,nestedAgentsInstructions:y,globalClaudeMdInstructions:r.globalClaudeMdInstructions,nestedClaudeInstructions:E});_!==void 0&&(u.systemMessage={mode:"append",content:_})}r.externalToolDefinitions?.length&&(u.externalToolDefinitions=r.externalToolDefinitions);let m=HVn(r);m.size>0&&(u.disabledInstructionSources=m);let g=Ect(t);return g&&(u.sandboxConfig=g),u}a(nXn,"buildSessionOptions");async function sWs(t,e){let r;try{r=t.get(Qo)}catch{return}try{return await $Vn(async n=>r.readDirectory(ts(n)),async n=>iXn(r,e,n),e)}catch(n){Mlt.warn(t,"Failed to scan nested CLAUDE.md files",n);return}}a(sWs,"scanNestedClaudeSection");async function aWs(t,e){let r;try{r=t.get(Qo)}catch{return}try{return await VVn(async n=>r.readDirectory(ts(n)),async n=>iXn(r,e,n),e)}catch(n){Mlt.warn(t,"Failed to scan nested AGENTS.md files",n);return}}a(aWs,"scanNestedAgentsSection");async function iXn(t,e,r){try{return await t.readFileString(ts(rXn.join(e,r)))}catch{return}}a(iXn,"readNestedFile");p();var cWs=20,Olt=new pe("BackgroundAgent.SessionRegistry"),Llt=class{constructor(e){this.ctx=e;this.sessions=new Map;this.workingDirs=new Map;this.workspaceFolderUris=new Map;this.mcpDirectories=new Map;this.turnIndexes=new Map;this.chatModes=new Map;this.providerModels=new Map;this.appliedSandboxConfig=new Map;this.confinedFiles=new Map;this.turnLimiters=new Map;this.children=new Map}static{a(this,"SessionRegistry")}set(e,r){if(this.sessions.has(e)&&this.sessions.delete(e),this.sessions.set(e,r),this.sessions.size>cWs){let n=this.sessions.keys().next().value;n!==void 0&&n!==e&&(Olt.debug(this.ctx,`Evicting oldest cached session: ${n}`),this.remove(n).catch(o=>Olt.warn(this.ctx,`Failed to evict session ${n}`,{error:o instanceof Error?o.message:String(o)})))}}get(e){return this.sessions.get(e)}has(e){return this.sessions.has(e)}size(){return this.sessions.size}entries(){return this.sessions.entries()}forgetSession(e){this.sessions.delete(e)}setWorkingDir(e,r){this.workingDirs.set(e,r)}getWorkingDir(e){return this.workingDirs.get(e)}workingDirEntries(){return this.workingDirs}setWorkspaceFolderUri(e,r){this.workspaceFolderUris.set(e,r)}getWorkspaceFolderUri(e){return this.workspaceFolderUris.get(e)}setMcpDirectory(e,r){this.mcpDirectories.set(e,r)}getMcpDirectory(e){return this.mcpDirectories.get(e)}incrementTurnIndex(e){let r=(this.turnIndexes.get(e)??-1)+1;return this.turnIndexes.set(e,r),r}seedTurnIndexIfAbsent(e,r){this.turnIndexes.has(e)||this.turnIndexes.set(e,r)}setChatMode(e,r){this.chatModes.set(e,r)}getChatMode(e){return this.chatModes.get(e)}deleteChatMode(e){this.chatModes.delete(e)}clearChatMode(){this.chatModes.clear()}chatModeEntries(){return this.chatModes}setProviderModel(e,r){this.providerModels.set(e,r)}getProviderModel(e){return this.providerModels.get(e)}deleteProviderModel(e){this.providerModels.delete(e)}setAppliedSandboxConfig(e,r){this.appliedSandboxConfig.set(e,r)}getAppliedSandboxConfig(e){return this.appliedSandboxConfig.get(e)}deleteAppliedSandboxConfig(e){this.appliedSandboxConfig.delete(e)}setConfinedFile(e,r){this.confinedFiles.set(e,r)}getConfinedFile(e){return this.confinedFiles.get(e)}hasConfinedFile(e){return this.confinedFiles.has(e)}setTurnLimiter(e,r){this.turnLimiters.set(e,r)}getTurnLimiter(e){return this.turnLimiters.get(e)}registerChild(e,r){let n=this.children.get(e);n||(n=[],this.children.set(e,n)),n.push(r)}async remove(e){let r=this.sessions.get(e),n=this.children.get(e);this.children.delete(e),n&&await Promise.all(n.map(async s=>{try{await Promise.resolve(s.dispose())}catch(c){Olt.warn(this.ctx,"Child Disposable failed during session removal",{sessionId:e,error:c instanceof Error?c.message:String(c)})}}));let o=this.sessions.get(e);if(r!==void 0&&o!==r){Olt.debug(this.ctx,`Skipping map clear for session ${e}: re-cached during removal`);return}this.sessions.delete(e),this.workingDirs.delete(e),this.workspaceFolderUris.delete(e),this.mcpDirectories.delete(e),this.turnIndexes.delete(e),this.chatModes.delete(e),this.providerModels.delete(e),this.appliedSandboxConfig.delete(e),this.confinedFiles.delete(e),this.turnLimiters.delete(e)}async removeAll(){let e=[...this.sessions.keys(),...this.children.keys()],r=Array.from(new Set(e));await Promise.all(r.map(n=>this.remove(n))),this.sessions.clear(),this.workingDirs.clear(),this.workspaceFolderUris.clear(),this.mcpDirectories.clear(),this.turnIndexes.clear(),this.chatModes.clear(),this.providerModels.clear(),this.appliedSandboxConfig.clear(),this.confinedFiles.clear(),this.turnLimiters.clear(),this.children.clear()}};p();p();var Lfr=require("node:fs"),zX=fe(require("node:path"));function oXn(t){return t.replace(/[/\\:]/g,"_").split("\0").join("_")}a(oXn,"sanitizePathSegment");function Flt(t){return typeof t=="string"?t:void 0}a(Flt,"asString");function Blt(t){return typeof t=="number"?t:void 0}a(Blt,"asNumber");function lWs(t){return Array.isArray(t)?t.map(e=>{if(!e||typeof e!="object")return{};let r=e;return{tool_call_id:Flt(r.toolCallId),tool:Flt(r.name)}}):[]}a(lWs,"asToolCallArray");function uWs(t){if(!t||typeof t!="object")return"";let e=t;return typeof e.detailedContent=="string"?e.detailedContent:typeof e.content=="string"?e.content:""}a(uWs,"toToolResultText");function dWs(t){try{return JSON.stringify(t)}catch{return}}a(dWs,"safeStringify");var Bfr=class{constructor(e,r,n){this.sessionId=r;this.usageByKey=new Map;this.pendingTools=new Map;this.appendQueues=new Map;this.activeTurnId=n;let o=eqt(new Date),s=oXn(r);this.sessionDir=zX.join(e,`pid-${process.pid}_${o}_bgagent`,"sessions",s)}static{a(this,"BackgroundAgentPersistence")}persistEvent(e){if(e.type==="assistant.turn_start"){this.activeTurnId=e.data.turnId;return}switch(e.type){case"assistant.usage":this.handleUsage(e);break;case"assistant.message":this.handleMessage(e);break;case"tool.execution_start":this.handleToolStart(e);break;case"tool.execution_complete":this.handleToolComplete(e);break;default:break}}outputDir(e){return e?zX.join(this.sessionDir,"runSubAgent",oXn(e)):this.sessionDir}appendJsonl(e,r){let n=dWs(r);if(n===void 0)return;let s=(this.appendQueues.get(e)??Promise.resolve()).then(async()=>{await Lfr.promises.mkdir(zX.dirname(e),{recursive:!0}),await Lfr.promises.appendFile(e,`${n} +`,"utf8")});this.appendQueues.set(e,s.catch(()=>{}))}handleUsage(e){let r=e.data.parentToolCallId??"main";this.usageByKey.set(r,{inputTokens:Blt(e.data.inputTokens),outputTokens:Blt(e.data.outputTokens),cacheReadTokens:Blt(e.data.cacheReadTokens)})}handleMessage(e){let r=e.data.parentToolCallId,n=r??"main",o=this.usageByKey.get(n),s=lWs(e.data.toolRequests),c=this.outputDir(r);s.length>0&&this.appendJsonl(zX.join(c,"trajectory.jsonl"),{tool_calls:s,input_tokens:o?.inputTokens,output_tokens:Blt(e.data.outputTokens)??o?.outputTokens,cached_input_tokens:o?.cacheReadTokens,conversationId:this.sessionId,turnId:this.activeTurnId})}handleToolStart(e){let r=Flt(e.data.toolCallId);r&&this.pendingTools.set(r,{toolCallId:r,toolName:e.data.toolName,arguments:e.data.arguments,parentToolCallId:e.data.parentToolCallId,startTimestamp:e.timestamp})}handleToolComplete(e){let r=Flt(e.data.toolCallId);if(!r)return;let n=this.pendingTools.get(r);this.pendingTools.delete(r);let o=this.outputDir(n?.parentToolCallId),s=n?.startTimestamp?new Date(n.startTimestamp).getTime():void 0,c=new Date(e.timestamp).getTime(),l=s?c-s:void 0;this.appendJsonl(zX.join(o,"tool-in-out.jsonl"),{tool_call_id:r,tool:n?.toolName??"",input:typeof n?.arguments=="object"&&n.arguments!==null?n.arguments:{},output:uWs(e.data.result),status:e.data.success?"success":"error",timestamp:e.timestamp,duration_ms:l})}};function sXn(t,e,r){let n=Rt(t,ze.PromptPersistBasePath)?.trim()||void 0;if(n)return new Bfr(n,e,r)}a(sXn,"createBackgroundAgentPersistence");p();var Ult=class{constructor(){this.pendingWaits=new Map;this.data={permission:{totalMs:0,count:0},user_input:{totalMs:0,count:0},exit_plan_mode:{totalMs:0,count:0}}}static{a(this,"UserWaitTracker")}trackEvent(e){let r=e.type,n=e.data;if(r==="permission.requested"||r==="user_input.requested"||r==="exit_plan_mode.requested"){let o=typeof n?.requestId=="string"?n.requestId:void 0;if(!o)return;let s=r.replace(".requested","");this.pendingWaits.set(o,{waitType:s,startTimeMs:performance.now()})}else if(r==="permission.completed"||r==="user_input.completed"||r==="exit_plan_mode.completed"){let o=typeof n?.requestId=="string"?n.requestId:void 0;if(!o)return;let s=this.pendingWaits.get(o);if(s){let c=performance.now()-s.startTimeMs;this.pendingWaits.delete(o);let l=this.data[s.waitType];l.totalMs+=c,l.count+=1}}}};p();p();var Ffr={INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool"},fo={OPERATION_NAME:"gen_ai.operation.name",AGENT_NAME:"gen_ai.agent.name",SYSTEM:"gen_ai.system",REQUEST_MODEL:"gen_ai.request.model",RESPONSE_MODEL:"gen_ai.response.model",SYSTEM_INSTRUCTIONS:"gen_ai.system_instructions",INPUT_MESSAGES:"gen_ai.input.messages",OUTPUT_MESSAGES:"gen_ai.output.messages",CONVERSATION_ID:"gen_ai.conversation.id",USAGE_INPUT_TOKENS:"gen_ai.usage.input_tokens",USAGE_OUTPUT_TOKENS:"gen_ai.usage.output_tokens",USAGE_CACHE_READ_INPUT_TOKENS:"gen_ai.usage.cache_read.input_tokens",USAGE_CACHE_CREATION_INPUT_TOKENS:"gen_ai.usage.cache_creation.input_tokens",TURN_COUNT:"gen_ai.turn_count",TOTAL_COST_USD:"gen_ai.total_cost_usd",TOOL_NAME:"gen_ai.tool.name",TOOL_CALL_ID:"gen_ai.tool.call.id",TOOL_CALL_ARGUMENTS:"gen_ai.tool.call.arguments",TOOL_CALL_RESULT:"gen_ai.tool.call.result"};function rme(t,e){return JSON.stringify([{role:t,parts:[{type:"text",content:e}]}])}a(rme,"genAiMessagesJson");p();var hNe=require("fs"),nme=fe(require("path"));var Ufr=new pe("OtelSpanFilePersistence"),fWs="debug.jsonl",iy=class{constructor(e){this.ctx=e}static{a(this,"OTelSpanFilePersistence")}isEnabled(){return!!this.getDirectory()}getDirectory(){let e=Rt(this.ctx,ze.AgentDebugLogsDirectory);return typeof e=="string"&&e.length>0?e:void 0}async appendSpans(e){if(!this.isEnabled()||e.length===0)return;let r=new Map;for(let n of e){let o=pWs(n);if(!o){Ufr.warn(this.ctx,`Dropping span without gen_ai.conversation.id (traceId=${n.traceId})`);continue}let s=r.get(o);s?s.push(n):r.set(o,[n])}for(let[n,o]of r)try{let s=this.getFilePath(n);await hNe.promises.mkdir(nme.dirname(s),{recursive:!0,mode:448});let c=o.map(l=>JSON.stringify(l)).join(` +`)+` +`;await hNe.promises.appendFile(s,c,{encoding:"utf8",mode:384})}catch(s){Ufr.warn(this.ctx,`Failed to persist spans for conversation=${n}: ${s instanceof Error?s.message:String(s)}`)}}async readSpans(e){if(!this.isEnabled())return[];try{let r=await hNe.promises.readFile(this.getFilePath(e),"utf8"),n=[];for(let o of r.split(` +`))if(o.trim())try{n.push(JSON.parse(o))}catch{}return n}catch(r){return r.code==="ENOENT"?[]:(Ufr.warn(this.ctx,`Failed to read spans for conversation=${e}: ${r instanceof Error?r.message:String(r)}`),[])}}getFilePath(e){let r=this.getDirectory();if(!r)throw new Error("Agent debug logs directory not configured");return nme.join(r,hWs(e),fWs)}async getLogFilePath(e){if(!this.isEnabled())return null;let r=nme.resolve(this.getFilePath(e));try{return await hNe.promises.access(r),r}catch{return null}}};function pWs(t){for(let e of t.attributes??[])if(e.key==="gen_ai.conversation.id"){let r=e.value.stringValue;if(r&&r.length>0)return r}}a(pWs,"conversationIdOf");function hWs(t){let e=t.replace(/[^A-Za-z0-9._-]/g,"_").slice(0,120);return e.length>0?e:"unknown"}a(hWs,"sanitizeForPath");p();function aXn(t){if(t!=null)return typeof t=="string"?{stringValue:t}:typeof t=="boolean"?{boolValue:t}:typeof t=="number"?Number.isInteger(t)?{intValue:String(t)}:{doubleValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(r=>aXn(r)).filter(r=>r!==void 0)}}:{stringValue:JSON.stringify(t)}}a(aXn,"encodeAnyValue");function T8(t){if(!t)return[];let e=[];for(let[r,n]of Object.entries(t)){let o=aXn(n);o!==void 0&&e.push({key:r,value:o})}return e}a(T8,"encodeAttributes");function mWs(t,e){return{resourceSpans:[{resource:{attributes:Object.entries(e).map(([r,n])=>({key:r,value:{stringValue:n}}))},scopeSpans:[{scope:{name:"copilot-chat"},spans:t}]}]}}a(mWs,"wrapInResourceSpans");function Qlt(t,e){let r=mWs(t,{"service.name":"copilot-chat","session.id":e.conversationId});return r.copilotChat={exportedAt:new Date().toISOString(),exporterVersion:"",sessionId:e.conversationId,...e.sessionTitle?{sessionTitle:e.sessionTitle}:{}},r}a(Qlt,"buildChatDebugLogExport");var lXn=require("crypto");var Qfr=new pe("BackgroundAgent.CliOTelTracker"),gWs={USER_REQUEST:"copilot_chat.user_request"},qfr="main";function ime(t){return(0,lXn.randomUUID)().replace(/-/g,"").slice(0,t*2)}a(ime,"generateHexId");function uXn(){return BigInt(Date.now())*1000000n}a(uXn,"nowNano");function ome(t){if(t){let e=Date.parse(t);if(!Number.isNaN(e))return BigInt(e)*1000000n}return uXn()}a(ome,"isoToNano");function cXn(t){if(t!=null){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return}}}a(cXn,"toAttributeString");function dXn(t,e,r){if(!t.get(kn).getCapabilities().agentDebugLog)return;let n=t.get(iy);if(n.isEnabled())return new jfr(t,e,r,n)}a(dXn,"createCliOTelTracker");var jfr=class{constructor(e,r,n,o){this._ctx=e;this._sessionId=r;this._session=n;this._persistence=o;this._pendingTools=new Map}static{a(this,"CliOTelTracker")}onEvent(e){switch(e.type){case"user.message":this._pendingUserRequest=e.data.content;break;case"assistant.turn_start":this._ensureRequest(ome(e.timestamp));break;case"assistant.usage":this._onUsage(e);break;case"assistant.message":this._onAssistantMessage(e);break;case"tool.execution_start":this._onToolStart(e);break;case"tool.execution_complete":this._onToolComplete(e);break;case"session.idle":case"session.error":this._flushRequest().catch(r=>{Qfr.warn(this._ctx,`Failed to flush debug spans for session=${this._sessionId}: ${r instanceof Error?r.message:String(r)}`)});break;default:break}}_ensureRequest(e){return this._request||(this._request={traceId:ime(16),invokeAgentSpanId:ime(8),startNano:e,userRequest:this._pendingUserRequest,usages:[],responseByAgent:new Map,toolSpanIds:new Map,pendingReads:[]},this._pendingUserRequest=void 0),this._request}_onUsage(e){let r=this._ensureRequest(ome(e.timestamp)),n={data:e.data,endNano:ome(e.timestamp),agentKey:e.data.parentToolCallId??qfr,parentToolCallId:e.data.parentToolCallId};r.usages.push(n),r.pendingReads.push(this._readAssembled().then(({inputMessagesJson:o,systemInstructions:s})=>{n.inputMessagesJson=o,n.systemInstructions=s}))}_onAssistantMessage(e){let r=this._request;if(!r)return;let n=e.data.content;if(!n)return;let o=e.data.parentToolCallId??qfr;r.responseByAgent.set(o,(r.responseByAgent.get(o)??"")+n)}_onToolStart(e){let r=e.data.toolCallId;if(!r)return;let n=this._ensureRequest(ome(e.timestamp)),o=e.data.parentToolCallId,s=(o?n.toolSpanIds.get(o):void 0)??n.invokeAgentSpanId,c=ime(8);this._pendingTools.set(r,{traceId:n.traceId,spanId:c,parentSpanId:s,toolName:e.data.toolName??"unknown",arguments:e.data.arguments,startNano:ome(e.timestamp)}),n.toolSpanIds.set(r,c)}_onToolComplete(e){let r=e.data.toolCallId;if(!r)return;let n=this._pendingTools.get(r);if(!n)return;this._pendingTools.delete(r);let o=ome(e.timestamp),s=e.data.success===!1,c=e.data.error?.message,l={[fo.OPERATION_NAME]:"execute_tool",[fo.CONVERSATION_ID]:this._sessionId,[fo.TOOL_NAME]:n.toolName,[fo.TOOL_CALL_ID]:r},u=cXn(n.arguments);u!==void 0&&(l[fo.TOOL_CALL_ARGUMENTS]=u);let d=e.data.result??e.data.error,f=cXn(d);f!==void 0&&(l[fo.TOOL_CALL_RESULT]=f),this._appendSpans([{traceId:n.traceId,spanId:n.spanId,parentSpanId:n.parentSpanId,name:`execute_tool ${n.toolName}`,kind:1,startTimeUnixNano:n.startNano.toString(),endTimeUnixNano:o.toString(),attributes:T8(l),events:[],status:s?{code:2,message:c??"Tool execution error"}:{code:1}}])}async _flushRequest(){let e=this._request;if(!e)return;this._request=void 0,await Promise.allSettled(e.pendingReads);let r=uXn(),n=[this._buildInvokeAgentSpan(e,r)],o=this._buildUserMessageSpan(e);o&&n.push(o);let s=new Map;e.usages.forEach((c,l)=>{c.data.model&&s.set(c.agentKey,l)}),e.usages.forEach((c,l)=>{let u=s.get(c.agentKey)===l,d=this._buildChatSpan(e,c,u);d&&n.push(d)}),n.push(...this._buildAgentResponseSpans(e)),this._appendSpans(n)}_buildInvokeAgentSpan(e,r){return{traceId:e.traceId,spanId:e.invokeAgentSpanId,name:"invoke_agent copilotcli",kind:1,startTimeUnixNano:e.startNano.toString(),endTimeUnixNano:r.toString(),attributes:T8({[fo.OPERATION_NAME]:"invoke_agent",[fo.AGENT_NAME]:"copilotcli",[fo.CONVERSATION_ID]:this._sessionId}),events:[],status:{code:1}}}_buildUserMessageSpan(e){if(!e.userRequest)return;let r=e.startNano.toString();return{traceId:e.traceId,spanId:ime(8),parentSpanId:e.invokeAgentSpanId,name:"user_message",kind:1,startTimeUnixNano:r,endTimeUnixNano:r,attributes:T8({[fo.OPERATION_NAME]:"user_message",[fo.CONVERSATION_ID]:this._sessionId,[gWs.USER_REQUEST]:e.userRequest}),events:[{name:"user_message",timeUnixNano:r,attributes:T8({content:e.userRequest})}],status:{code:1}}}_buildAgentResponseSpans(e){let r=new Map;for(let o of e.usages)o.data.model&&r.set(o.agentKey,o.endNano);let n=[];for(let[o,s]of e.responseByAgent){if(!s)continue;let c=o===qfr?e.invokeAgentSpanId:e.toolSpanIds.get(o)??e.invokeAgentSpanId,l=(r.get(o)??e.startNano).toString();n.push({traceId:e.traceId,spanId:ime(8),parentSpanId:c,name:"agent_response",kind:1,startTimeUnixNano:l,endTimeUnixNano:l,attributes:T8({[fo.OPERATION_NAME]:"agent_response",[fo.CONVERSATION_ID]:this._sessionId,[fo.OUTPUT_MESSAGES]:rme("assistant",s)}),events:[],status:{code:1}})}return n}_buildChatSpan(e,r,n){let o=r.data.model;if(!o)return;let s=(r.parentToolCallId?e.toolSpanIds.get(r.parentToolCallId):void 0)??e.invokeAgentSpanId,c={[fo.OPERATION_NAME]:"chat",[fo.CONVERSATION_ID]:this._sessionId,[fo.RESPONSE_MODEL]:o},l=r.data.inputTokens,u=r.data.outputTokens,d=r.data.cacheReadTokens,f=r.data.cacheWriteTokens;typeof l=="number"&&(c[fo.USAGE_INPUT_TOKENS]=l),typeof u=="number"&&(c[fo.USAGE_OUTPUT_TOKENS]=u),typeof d=="number"&&(c[fo.USAGE_CACHE_READ_INPUT_TOKENS]=d),typeof f=="number"&&(c[fo.USAGE_CACHE_CREATION_INPUT_TOKENS]=f),r.systemInstructions&&(c[fo.SYSTEM_INSTRUCTIONS]=r.systemInstructions),r.inputMessagesJson&&(c[fo.INPUT_MESSAGES]=r.inputMessagesJson);let h=n?e.responseByAgent.get(r.agentKey):void 0;h&&(c[fo.OUTPUT_MESSAGES]=rme("assistant",h));let m=r.endNano,g=r.data.duration,A=typeof g=="number"&&g>=0?m-BigInt(Math.round(g))*1000000n:m;return{traceId:e.traceId,spanId:ime(8),parentSpanId:s,name:`chat ${o}`,kind:1,startTimeUnixNano:A.toString(),endTimeUnixNano:m.toString(),attributes:T8(c),events:[],status:{code:1}}}async _readAssembled(){try{let e=await this._session.getChatContextMessages();return{inputMessagesJson:e.length>0?JSON.stringify(e):void 0,systemInstructions:this._session.getCurrentSystemMessage()}}catch(e){return Qfr.warn(this._ctx,`Failed to read assembled messages for session=${this._sessionId}: ${e instanceof Error?e.message:String(e)}`),{}}}_appendSpans(e){if(e.length!==0)try{this._persistence.appendSpans(e).catch(r=>this._warnPersistFailure(r))}catch(r){this._warnPersistFailure(r)}}_warnPersistFailure(e){Qfr.warn(this._ctx,`Failed to persist debug spans for session=${this._sessionId}: ${e instanceof Error?e.message:String(e)}`)}};Mo();var I8=new pe("BackgroundAgent.TurnDriver"),Hfr="backgroundAgent",qlt=class{constructor(e,r,n){this.ctx=e;this.registry=r;this.notificationSender=n;this.processedEventIds=new Map;this.registeredBackstops=new Set;this.lastNanoAiu=new Map}static{a(this,"TurnDriver")}wireAndSend(e,r,n,o,s,c){let l=performance.now(),u=sXn(this.ctx,e,`bg-turn-${Nt()}`),d=dXn(this.ctx,e,r);this.processedEventIds.set(e,new Set),this.registeredBackstops.has(e)||(this.registeredBackstops.add(e),this.registry.registerChild(e,{dispose:a(()=>{this.registeredBackstops.delete(e),this.lastNanoAiu.delete(e),this.forget(e)},"dispose")}));let f=a(()=>{},"noop"),h=r.on("user_input.requested",f),m=r.on("permission.requested",f),g=r.on("exit_plan_mode.requested",f);kVn(r,!0);let A=new Ult,y=r.on("*",w=>{if(w.type==="assistant.turn_start"&&this.registry.getTurnLimiter(e)?.onTurnStart(),u)try{u.persistEvent(w)}catch(R){I8.warn(this.ctx,"Failed to persist background-agent event",{eventType:w.type,error:R instanceof Error?R.message:String(R)})}if(A.trackEvent(w),d)try{d.onEvent(w)}catch(R){I8.warn(this.ctx,"Failed to synthesize debug span",{eventType:w.type,error:R instanceof Error?R.message:String(R)})}this.handleSessionEvent(e,w,o),w.type==="session.todos_changed"&&Uat(this.ctx,this.notificationSender,e,r)}),E=!1,_=a(()=>{E||(E=!0,this.emitTurnCompleteTelemetry(e,r,l,A.data,o),this.emitSessionMetricsTelemetry(e,r,o,c)),T?.dispose(),h(),m(),g(),y(),v(),b(),this.forget(e)},"cleanup"),v=r.on("session.idle",()=>{_()}),b=r.on("session.error",()=>{_()}),T;s&&(T=s.onCancellationRequested(()=>{I8.info(this.ctx,"Cancellation requested, aborting session:",e),r.clearPendingItems(),r.abort()})),r.send(n).catch(w=>{_();let R=snt(w);s?.isCancellationRequested?I8.info(this.ctx,"session.send aborted by cancellation",{sessionId:e,turnIndex:o}):(I8.error(this.ctx,"session.send failed",{sessionId:e,turnIndex:o,error:R,stack:w instanceof Error?w.stack:void 0}),this.emitTurnFailedTelemetry(e,o,"SendMessageError"));let x={type:"session.error",id:Nt(),timestamp:new Date().toISOString(),parentId:null,data:{errorType:"SendMessageError",message:R}};this.sendSessionUpdateNotification(e,x,o)})}forget(e){this.processedEventIds.delete(e)}processedEventIdsForTesting(){return this.processedEventIds}seedProcessedEventIdsForTesting(e){this.processedEventIds.set(e,new Set),this.registeredBackstops.has(e)||(this.registeredBackstops.add(e),this.registry.registerChild(e,{dispose:a(()=>{this.registeredBackstops.delete(e),this.lastNanoAiu.delete(e),this.forget(e)},"dispose")}))}async handleSessionEvent(e,r,n){let o=r.id,s=this.processedEventIds.get(e);if(s?.has(o)){I8.debug(this.ctx,`Skipping duplicate SDK event: ${r.type} (id=${o})`);return}s?.add(o),await this.sendSessionUpdateNotification(e,r,n)}async sendSessionUpdateNotification(e,r,n){try{await this.notificationSender.sendBackgroundAgentSessionUpdate(e,r,void 0,n)}catch(o){I8.error(this.ctx,"Failed to send session update notification:",o)}}async emitTurnCompleteTelemetry(e,r,n,o,s){try{let c=performance.now()-n,l=this.registry.getChatMode(e)??"agent",d=(await r.usage.getMetrics()).totalNanoAiu,f=this.lastNanoAiu.get(e)??0,h=typeof d=="number"&&Number.isFinite(d),m=h?Math.min(f,d):f;h&&this.lastNanoAiu.set(e,d);let g=h?(d-m)/1e9:0;cr(this.ctx,"backgroundAgent.turn.complete",{requestSource:Hfr,sessionId:e,chatMode:l,agentProvider:"BACKGROUND",turnIndex:s!=null?String(s):""},{totalDurationMs:c,totalUserWaitMs:o?o.permission.totalMs+o.user_input.totalMs+o.exit_plan_mode.totalMs:0,permissionWaitMs:o?.permission.totalMs??0,permissionWaitCount:o?.permission.count??0,userInputWaitMs:o?.user_input.totalMs??0,userInputWaitCount:o?.user_input.count??0,exitPlanModeWaitMs:o?.exit_plan_mode.totalMs??0,exitPlanModeWaitCount:o?.exit_plan_mode.count??0,credits:g})}catch(c){I8.warn(this.ctx,"Failed to emit turn.complete telemetry",{sessionId:e,error:c instanceof Error?c.message:String(c)})}}emitTurnFailedTelemetry(e,r,n){cr(this.ctx,"backgroundAgent.turn.failed",{requestSource:Hfr,sessionId:e,agentProvider:"BACKGROUND",errorType:n,turnIndex:r!=null?String(r):""})}async emitSessionMetricsTelemetry(e,r,n,o){try{let s=await r.usage.getMetrics(),c=0,l=0,u=0,d=0,f=0,h=0,m=[];for(let[g,A]of Object.entries(s.modelMetrics))c+=A.usage.inputTokens,l+=A.usage.outputTokens,u+=A.usage.cacheReadTokens,d+=A.usage.cacheWriteTokens,f+=A.usage.reasoningTokens??0,h+=A.requests.count,m.push(o?"byok models":g);cr(this.ctx,"backgroundAgent.session.metrics",{requestSource:Hfr,sessionId:e,agentProvider:"BACKGROUND",modelNames:m.join(","),turnIndex:n!=null?String(n):""},{totalApiDurationMs:s.totalApiDurationMs,totalInputTokens:c,totalOutputTokens:l,totalCacheReadTokens:u,totalCacheWriteTokens:d,totalReasoningTokens:f,llmCallCount:h,totalPremiumRequestCost:s.totalPremiumRequestCost})}catch(s){I8.warn(this.ctx,"Failed to emit session.metrics telemetry",{sessionId:e,error:s instanceof Error?s.message:String(s)})}}};p();function fXn(t,e,r){e.agentMode&&(t.currentMode=e.agentMode,r.agentMode=e.agentMode)}a(fXn,"applyAgentModeOverride");p();async function pXn(t,e,r,n,o){let s=n.chatMode??"agent",c=qat(s)?s:"agent";if((c==="inline"||c==="inline-ask")&&!o.hasConfinedFile(e))throw new Error(`Cannot apply chatMode '${c}' for session ${e}: no confined file registered (session was not created with inlineConfinedFile)`);if(o.getChatMode(e)===c)return;let u=o.getWorkingDir(e);if(!u)throw new Error(`Cannot apply chatMode for session ${e}: working directory is not cached`);let d={uri:ts(u)};o.deleteChatMode(e),await EVn(r,c,{loadCustomAgents:a(()=>Kat(t,d),"loadCustomAgents"),getAllLoadedSkillNames:a(async()=>(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(f=>f.name)),"getAllLoadedSkillNames"),getPolicyDisabledSkillNames:a(async()=>{let f;try{f=t.get(A0)}catch{return[]}return f.isSkillsEnabled()?[]:(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(h=>h.name))},"getPolicyDisabledSkillNames"),getMcpServers:a(()=>{let f=o.getMcpDirectory(e)??o.getWorkspaceFolderUri(e);try{return Promise.resolve(t.get(Xw).buildMcpServers(f))}catch(h){if(h instanceof $l)return Promise.resolve({});throw h}},"getMcpServers")}),o.setChatMode(e,c)}a(pXn,"applyChatModeOverride");p();var hXn=new pe("BackgroundAgent.applyChatModeSelection");async function mXn(t,e,r){if(r.chatMode===void 0||qat(r.chatMode))return;let n=r.chatMode==="agent";try{n?(await e.agent.deselect(),hXn.info(t,`Cleared custom agent selection for session ${r.sessionId}`)):(await e.agent.select({name:r.chatMode}),hXn.info(t,`Applied custom agent '${r.chatMode}' for session ${r.sessionId}`))}catch(o){let s=o instanceof Error?o.message:String(o);throw n?new Error(`Failed to clear custom agent selection on session ${r.sessionId}: ${s}`):new Error(`Failed to select custom agent '${r.chatMode}' on session ${r.sessionId}: ${s}. Verify the agent is registered via a workspace .agent.md file.`)}}a(mXn,"applyChatModeSelection");p();var gXn=require("node:util");function AXn(t,e,r,n){let o=Ect(t)??{enabled:!1},s=n.getAppliedSandboxConfig(e);s!==void 0&&(0,gXn.isDeepStrictEqual)(s,o)||(r.updateOptions({sandboxConfig:o}),n.setAppliedSandboxConfig(e,o))}a(AXn,"applySandboxOverride");p();p();var YX=new pe("BackgroundAgent.ProviderConfig");async function yXn(t,e,r){if(!e)return;let n=await _Ye(t,e,r);if(!n){YX.warn(t,`BYOK provider '${e}' selected but no API key found for model '${r??""}'.`);return}let o,s,c;try{let f=await new $a(t.get(ti)).getStoredModelConfigs(e),h=r?f[r]:void 0;o=h?.deploymentUrl,s=h?.modelCapabilities?.maxInputTokens,c=h?.modelCapabilities?.maxOutputTokens}catch(d){YX.warn(t,"Failed to load BYOK model config; using defaults",{providerName:e,modelId:r,error:d instanceof Error?d.message:String(d)})}let l=_xe(e),u={maxPromptTokens:s??l.maxInputTokens,maxOutputTokens:c??l.maxOutputTokens};if(e===no.Anthropic)return{type:"anthropic",baseUrl:o??iue[e],apiKey:n,modelId:r,wireModel:r,...u};if(e===no.Azure){if(!o){YX.warn(t,`Azure provider requires a per-model deployment URL but none configured for '${r??""}'.`);return}return yWs(t,o,n,r,u)}if(Zle(e))return{type:"openai",baseUrl:o??iue[e],apiKey:n,modelId:r,wireModel:r,...u};if(dq(e))return AWs(t,e,n,r,o,u);YX.warn(t,`Unknown BYOK provider '${e}', skipping provider config.`)}a(yXn,"buildProviderConfig");async function AWs(t,e,r,n,o,s){if(!o){YX.warn(t,`Custom endpoint '${e}' has no configured URL; skipping provider config.`);return}let u=(await new $a(t.get(ti)).getProviderConfig(e))?.apiType,d=u==="chatCompletions"||u==="responses"||u==="messages"?u:Exe,f=EYe(o,d);return d==="messages"?{type:"anthropic",baseUrl:f,apiKey:r,modelId:n,wireModel:n,...s}:{type:"openai",wireApi:d==="responses"?"responses":"completions",baseUrl:f,apiKey:r,modelId:n,wireModel:n,...s}}a(AWs,"buildCustomEndpointProviderConfig");function yWs(t,e,r,n,o){let s;try{s=new URL(e)}catch{YX.warn(t,`Invalid Azure deployment URL: ${e}`);return}let c=`${s.protocol}//${s.hostname}`;if(s.hostname.endsWith(".openai.azure.com"))return{type:"azure",baseUrl:c,apiKey:r,modelId:n,wireModel:n,azure:{apiVersion:"2025-01-01-preview"},...o};if(s.hostname.endsWith(".models.ai.azure.com")||s.hostname.endsWith(".inference.ml.azure.com"))return{type:"openai",baseUrl:`${c}/v1`,apiKey:r,modelId:n,wireModel:n,...o};YX.warn(t,`Unrecognized Azure deployment URL host '${s.hostname}' for model '${n??""}'.`)}a(yWs,"buildAzureProviderConfig");var Gfr=new pe("BackgroundAgent.applyTurnOverrides");async function EXn(t,e,r,n){let o=r.providerName?r.providerName:void 0;if(o!==void 0&&!fq(await t.get(Ft).getToken()))throw new hke(`BYOK is disabled for this account. Provider '${o}' cannot be used for model '${r.model??""}'.`,o,r.model);let s=await yXn(t,o,r.model);if(o!==void 0&&s===void 0)throw new pke(`BYOK provider '${o}' is misconfigured for model '${r.model??""}'. Verify the API key`+(o===no.Azure?" and per-model deployment URL":"")+" is configured for this provider/model.",o,r.model);let c=n.registry.getProviderModel(r.sessionId),l=r.model,u=l!==void 0&&c?.model!==l,d=c!==void 0&&c.provider!==o,f=c!==void 0&&(d||u),h=e,m=!1;if(f){Gfr.info(t,`Provider/model changed for session ${r.sessionId} (${c?.provider??"(built-in)"}/${c?.model??"(unchanged)"} \u2192 ${o??"(built-in)"}/${l??"(unchanged)"}); forcing close+resume cycle to strip provider-bound reasoning state.`);let g=await n.managerLifecycle.ensureManager();n.registry.forgetSession(r.sessionId),n.registry.deleteChatMode(r.sessionId);try{await g.closeSession(r.sessionId),m=!0,h=await n.getOrResumeSession(r.sessionId)}catch(A){if(m)throw n.registry.deleteProviderModel(r.sessionId),new Error(`Failed to resume session ${r.sessionId} after provider/model change: `+(A instanceof Error?A.message:String(A)));Gfr.warn(t,`Failed to close session ${r.sessionId} for provider/model change; continuing with existing session: `+(A instanceof Error?A.message:String(A))),h=e}}try{h.updateOptions({provider:s??null,...l?{model:l}:{},...r.reasoningEffort?{reasoningEffort:r.reasoningEffort}:{},...r.contextTier?{contextTier:r.contextTier}:{}})}catch(g){throw new Error(`Failed to bind BYOK provider '${o??"(built-in)"}' to session ${r.sessionId}: ${g instanceof Error?g.message:String(g)}`)}return n.registry.setProviderModel(r.sessionId,{provider:o,model:l??c?.model}),Gfr.info(t,`Rebound session ${r.sessionId} for this turn: provider=${o??"(built-in)"}, model=${l??"(unchanged)"}, reasoningEffort=${r.reasoningEffort??"(unchanged)"}`),h}a(EXn,"applyTurnOverrides");p();async function _Xn(t,e,r,n,o){let s=_Ws(e,n),c=o==="inline"||o==="inline-ask";await t.get(Ig).applyPromptTemplateToRequest(r,s?[s]:[],c,{includePlugins:!0})||EWs(t,r)}a(_Xn,"expandPromptTemplate");function EWs(t,e){let r=e.message.trim();if(!r.startsWith("/"))return!1;let[n,...o]=r.split(" "),s=n.slice(1);if(!hRn.has(s))return!1;let c=d2().find(l=>l.id===s);return c?.instructions?(e.message=c.instructions(t,o.join(" ")),!0):!1}a(EWs,"applyBuiltinCreateTemplate");function _Ws(t,e){let r=e.getWorkingDir(t);return r?{uri:ts(r)}:void 0}a(_Ws,"getWorkspaceFolderForSession");p();var sme=class{constructor(e,r,n){this.ctx=e;this.target=n;this.syncScheduled=!1;this.logger=new pe(r);let o=_ct(e);o&&(this.host=o,this.mountsChangedListener=()=>this.schedule(),o.service.on(WX.MountsChanged,this.mountsChangedListener))}static{a(this,"GatewayMountsSync")}dispose(){this.host&&this.mountsChangedListener&&(this.host.service.off(WX.MountsChanged,this.mountsChangedListener),this.mountsChangedListener=void 0,this.host=void 0)}schedule(){this.syncScheduled||(this.syncScheduled=!0,queueMicrotask(()=>{this.syncScheduled=!1;let e=this.host;e&&this.target.syncToActiveSessions(e).catch(r=>this.onSyncError(r))}))}onSyncError(e){this.logger.warn(this.ctx,"MCP active-session sync failed",{error:e instanceof Error?e.message:String(e)})}};Mo();var oy=new pe("BackgroundAgent"),x8="backgroundAgent",vWs="backgroundAgent.remote",CWs=new Set(["system.message","hook.start","hook.end"]),Gs=class{constructor(e){this.ctx=e;this.pendingExternalToolDefs=new Map;this.notificationSender=e.get(es),this.managerLifecycle=new Gat(e),this.authBinding=new ont(e),this.registry=new Llt(e),this.remoteController=new Yat(e,{registry:this.registry,injectUserMessage:a((o,s,c)=>this.injectRemoteUserMessage(o,s,c),"injectUserMessage")}),this.turnDriver=new qlt(e,this.registry,this.notificationSender);let r=new ant(e,this.registry);this._mcpSync=new sme(e,"BackgroundAgent.McpSync",r),e.get(Lo).onDidChangeHttpSettings(()=>{Fat(this.ctx)}),vs(e,()=>{this.handleAuthStateChange()});try{this._skillsEnabledListener=this.ctx.get(A0).onDidChangeSkillsEnabled(()=>{this.registry.clearChatMode()})}catch(o){if(!(o instanceof $l))throw o}}static{a(this,"BackgroundAgentService")}async handleAuthStateChange(){let{changed:e,hadPrevious:r,hasCurrent:n}=await this.authBinding.detectIdentityChange();e&&(oy.info(this.ctx,"GitHub identity changed, clearing cached sessions",{hadPrevious:r,hasCurrent:n,cachedSessionCount:this.registry.size(),remoteDelegateCount:this.remoteController.delegateCount()}),await this.clearUserScopedState())}async clearUserScopedState(){this.pendingExternalToolDefs.clear(),await this.registry.removeAll(),this.managerLifecycle.clearAutoMode()}ensureManager(){return this.managerLifecycle.ensureManager()}get sdk(){return this.managerLifecycle.getSdk()}get autoModeManager(){return this.managerLifecycle.getAutoModeManager()}async handleInteraction(e){let r=performance.now(),n=await this.getOrResumeSession(e.sessionId),o=BDn(n,e);return sx(this.ctx,"backgroundAgent.interaction",{requestSource:x8,sessionId:e.sessionId,requestId:e.requestId,interactionType:e.type,resultKind:e.type==="permission"?e.result.kind:""},{totalTimeMs:performance.now()-r}),o}buildAuthInfo(){return this.authBinding.buildAuthInfo()}applyTurnOverrides(e,r){return EXn(this.ctx,e,r,{registry:this.registry,managerLifecycle:this.managerLifecycle,getOrResumeSession:a(n=>this.getOrResumeSession(n),"getOrResumeSession")})}applyChatModeSelection(e,r){return mXn(this.ctx,e,r)}buildSessionOptions(e,r){return nXn(this.ctx,e,r,{buildAuthInfo:a(()=>this.buildAuthInfo(),"buildAuthInfo")})}async createSession(e){let r=performance.now();oy.info(this.ctx,"createSession called:",{model:e.model,workspaceFolder:e.workspaceFolder});let n=await this.ensureManager(),o=e.sessionId??Nt(),s=e.inlineConfinedFile?bVn(2):void 0,c=e.inlineConfinedFile?SVn(e.inlineConfinedFile):void 0,l=await this.buildSessionOptions(o,{...e,inlineTurnLimiter:s,inlineConfinementHook:c}),u=await n.createSession(l);return s&&this.registry.setTurnLimiter(o,s),oy.info(this.ctx,"Session created:",o),sx(this.ctx,"backgroundAgent.create",{requestSource:x8,reasoningEffort:e.reasoningEffort??"",sessionId:o},{totalTimeMs:performance.now()-r}),this.registry.set(o,u),this.registry.setWorkingDir(o,eo(e.workspaceFolder.uri).fsPath),this.registry.setWorkspaceFolderUri(o,e.workspaceFolder.uri),e.mcpDirectory&&this.registry.setMcpDirectory(o,e.mcpDirectory),e.inlineConfinedFile&&this.registry.setConfinedFile(o,e.inlineConfinedFile),{sessionId:o,workspacePath:u.workspacePath}}registerExternalTools(e,r){r?.length&&(this.pendingExternalToolDefs.set(e,r),oy.info(this.ctx,"Stored pending external tool definitions",{sessionId:e,toolCount:r.length}))}async getOrResumeSession(e,r={}){let n=this.registry.get(e);if(n){let h=this.pendingExternalToolDefs.get(e);return h&&(this.pendingExternalToolDefs.delete(e),n.updateOptions({externalToolDefinitions:h}),oy.info(this.ctx,"Applied pending external tool definitions to cached session",{sessionId:e,toolCount:h.length})),n}let o=await this.ensureManager(),s=r.workspaceFolder;if(!s){let h=await o.getSessionMetadata({sessionId:e});if(!h)throw new Error(`Session not found: ${e}`);let m=h.context?.cwd;if(!m)throw new Error(`Cannot resume session ${e} from disk: persisted metadata is missing working-directory context`);s={uri:ts(m)},oy.info(this.ctx,"Resuming session from disk via metadata fallback",{sessionId:e})}let c=this.pendingExternalToolDefs.get(e);c&&this.pendingExternalToolDefs.delete(e);let l=await this.buildSessionOptions(e,{...r,externalToolDefinitions:r.externalToolDefinitions??c,workspaceFolder:s}),u=await o.getSession(l,!0);if(!u)throw new Error(`Session not found: ${e}`);this.registry.set(e,u);let d=Array.from(u.getEvents()).filter(h=>h.type==="user.message").length;d>0&&this.registry.seedTurnIndexIfAbsent(e,d-1),this.registry.deleteChatMode(e),this.registry.deleteAppliedSandboxConfig(e);let f=s?.uri?eo(s.uri).fsPath:void 0;return f&&this.registry.setWorkingDir(e,f),s?.uri&&this.registry.setWorkspaceFolderUri(e,s.uri),r.mcpDirectory&&this.registry.setMcpDirectory(e,r.mcpDirectory),u}async sendMessage(e,r){let n=await this.getOrResumeSession(e.sessionId),o=await this.applyTurnOverrides(n,e);await this.applyChatModeOverride(e.sessionId,o,e),this.applySandboxOverride(e.sessionId,o);let s=e.message;await this.expandPromptTemplate(e.sessionId,e,e.chatMode);let c=e.message!==s||await vXn(o,s);await this.applyChatModeSelection(o,e);let l={prompt:e.message,...c?{displayPrompt:s}:{},...e.sendMode?{mode:e.sendMode}:{}};this.applyAgentModeOverride(o,e,l);let u=e.chatMode==="inline-ask"||e.chatMode==="inline";if(e.references?.length&&!u){let g=LDn(e.references,this.ctx);g.length>0&&(l.attachments=g)}if(u){let g=this.registry.getConfinedFile(e.sessionId);if(g){let A=e.references?.find(E=>E.type==="file"&&E.uri===g),y=await IVn(g,A,this.ctx);if(y.promptFragment&&(l.prompt=`${l.prompt}${y.promptFragment}`),y.isLargeFile){let E=e.chatMode==="inline-ask"?Qat:Gcr;o.updateOptions({availableTools:[...E,"view"]},{emitToolDefinitionsChanged:!0})}}}this.registry.getTurnLimiter(e.sessionId)?.reset();let d=performance.now(),f=this.registry.incrementTurnIndex(e.sessionId);this.turnDriver.wireAndSend(e.sessionId,o,l,f,r,!!e.providerName);let h={requestSource:x8,chatMode:this.registry.getChatMode(e.sessionId)??"agent",sessionId:e.sessionId,safeModelId:bWs(e.model,e.providerName),providerName:e.providerName??"",reasoningEffort:e.reasoningEffort??"",contextTier:e.contextTier??"",hasReferences:String((e.references?.length??0)>0),turnIndex:String(f)},m={totalTimeMs:performance.now()-d,messageCharLen:e.message.length,referenceCount:e.references?.length??0};return sx(this.ctx,"backgroundAgent.send",h,m),{}}async truncateHistory(e){let r=performance.now(),o=await(await this.getOrResumeSession(e.sessionId)).history.truncate({eventId:e.eventId});return sx(this.ctx,"backgroundAgent.truncateHistory",{requestSource:x8,providerName:e.providerName,sessionId:e.sessionId,eventId:e.eventId},{totalTimeMs:performance.now()-r,eventsRemoved:o.eventsRemoved}),{eventId:e.eventId,eventsRemoved:o.eventsRemoved}}async forkSession(e){let r=performance.now(),o=await(await this.ensureManager()).forkSession(e.sessionId,{toEventId:e.toEventId,name:e.name});return sx(this.ctx,"backgroundAgent.fork",{requestSource:x8,providerName:e.providerName},{totalTimeMs:performance.now()-r}),{sessionId:o.sessionId}}applyChatModeOverride(e,r,n){return pXn(this.ctx,e,r,n,this.registry)}applySandboxOverride(e,r){AXn(this.ctx,e,r,this.registry)}applyAgentModeOverride(e,r,n){fXn(e,r,n)}async injectRemoteUserMessage(e,r,n){let o=await this.getOrResumeSession(e),s={message:r};await this.expandPromptTemplate(e,s);let c=s.message!==r||await vXn(o,r),l={prompt:s.message,...c?{displayPrompt:r}:{},source:n},u=performance.now(),d=this.registry.incrementTurnIndex(e);this.turnDriver.wireAndSend(e,o,l,d),sx(this.ctx,"backgroundAgent.send",{requestSource:vWs,sessionId:e,safeModelId:"",providerName:"",reasoningEffort:"",contextTier:"",hasReferences:"false",turnIndex:String(d)},{totalTimeMs:performance.now()-u,messageCharLen:s.message.length,referenceCount:0})}expandPromptTemplate(e,r,n){return _Xn(this.ctx,e,r,this.registry,n)}async destroySession(e){try{return await this.remoteController.tearDownForDestroy(e.sessionId),this.pendingExternalToolDefs.delete(e.sessionId),await this.registry.remove(e.sessionId),await(await this.ensureManager()).deleteSession(e.sessionId),{success:!0}}catch(r){return oy.error(this.ctx,`Failed to destroy session ${e.sessionId}:`,r),{success:!1}}}async stopSession(e){let r=performance.now(),n=await this.getOrResumeSession(e);oy.info(this.ctx,"Stopping session via abort:",e),n.abortManualCompaction()&&oy.info(this.ctx,"Aborted in-progress manual compaction:",e),n.clearPendingItems(),await n.abort(),sx(this.ctx,"backgroundAgent.stop",{requestSource:x8,sessionId:e},{totalTimeMs:performance.now()-r})}async compactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);oy.info(this.ctx,"Compacting history for session:",e);let o=await n.compactHistory();return sx(this.ctx,"backgroundAgent.compactHistory",{requestSource:x8,sessionId:e},{totalTimeMs:performance.now()-r,tokensRemoved:o.tokensRemoved,messagesRemoved:o.messagesRemoved}),{success:o.success,tokensRemoved:o.tokensRemoved,messagesRemoved:o.messagesRemoved,summaryContent:o.summaryContent,contextWindow:o.contextWindow}}async stopCompactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);oy.info(this.ctx,"Aborting manual compaction for session:",e);let o=n.abortManualCompaction();return sx(this.ctx,"backgroundAgent.stopCompactHistory",{requestSource:x8,sessionId:e,aborted:String(o)},{totalTimeMs:performance.now()-r}),{aborted:o}}async getPlanPath(e){return(await this.getOrResumeSession(e)).getPlanPath()}async resumeSession(e){let r=performance.now();oy.info(this.ctx,"resumeSession called:",e.sessionId);let n=await this.getOrResumeSession(e.sessionId,e),o=Array.from(n.getEvents());Uat(this.ctx,this.notificationSender,e.sessionId,n),sx(this.ctx,"backgroundAgent.resume",{requestSource:x8,reasoningEffort:e.reasoningEffort??"",sessionId:e.sessionId},{totalTimeMs:performance.now()-r});let s=o.filter(c=>!CWs.has(c.type));return{sessionId:e.sessionId,workspacePath:n.workspacePath,events:s}}async listSessions(e){let n=await(await this.ensureManager()).listSessions(),o=n;return e&&(o=n.filter(s=>!(e.cwd&&s.context?.cwd!==e.cwd||e.gitRoot&&s.context?.gitRoot!==e.gitRoot||e.repository&&s.context?.repository!==e.repository||e.branch&&s.context?.branch!==e.branch))),{sessions:o.map(s=>({sessionId:s.sessionId,startTime:s.startTime instanceof Date?s.startTime.toISOString():String(s.startTime),modifiedTime:s.modifiedTime instanceof Date?s.modifiedTime.toISOString():String(s.modifiedTime),summary:s.summary,isRemote:s.isRemote,context:s.context}))}}async listModels(e){oy.info(this.ctx,"listModels called",{forceRefresh:e}),await this.managerLifecycle.ensureManager();let r=performance.now();try{let n=await this.ctx.get(xs).getMetadata(e),o=this.sdk?.EXCLUDED_MODELS,s=n.filter(u=>u.model_picker_enabled===!0).filter(u=>u.capabilities.type==="chat").filter(u=>!o?.has(u.id)).map(tfe);s.length===0?oy.warn(this.ctx,"No models available. Check authentication and Copilot subscription status."):oy.info(this.ctx,`Successfully retrieved ${s.length} models`);let c=[];this.ctx.get(Hl).getPolicyValue("autoModel.enabled")!==!1&&c.push(this.buildAutoModelEntry());let l=[...c,...s];return oy.debug(this.ctx,"Models retrieved:",l.map(u=>u.id)),sx(this.ctx,"backgroundAgent.listModels",{status_text:"success"},{duration_ms:performance.now()-r,model_count:l.length}),{models:l}}catch(n){let o=n instanceof Error?n.message:String(n),s=CXt(n);throw oy.error(this.ctx,"listModels failed",{error:o,cause:s,stack:n instanceof Error?n.stack:void 0}),ng(this.ctx,"backgroundAgent.listModels",n,{status_text:"failure",...s?{errorCause:s}:{}},{duration_ms:performance.now()-r}),new Error("Failed to retrieve models",{cause:n})}}buildAutoModelEntry(){return{id:this.sdk.AUTO_MODEL_ID,name:"Auto",preview:!1,capabilities:{family:this.sdk.AUTO_MODEL_ID,supports:{vision:!0},limits:{max_context_window_tokens:0}}}}async enableRemote(e){let r=await this.getOrResumeSession(e);return this.remoteController.enableForSession(e,r)}async disableRemote(e){let r=await this.getOrResumeSession(e);await this.remoteController.disableForSession(r)}getRemoteStatus(e){return this.remoteController.getStatus(e)}async shutdown(){this._mcpSync.dispose(),this._skillsEnabledListener?.dispose(),this._skillsEnabledListener=void 0,await this.clearUserScopedState(),jcr(),GDn(),await this.managerLifecycle.dispose()}};async function vXn(t,e){let r=e.trim().match(/^\/(\S+)(?:\s|$)/)?.[1];return r?(await t.ensureSkillsLoaded(),t.getLoadedSkills().some(n=>{let o=n.pluginName?`${n.pluginName}:${n.name}`:n.name;return n.userInvocable&&o.toLowerCase()===r.toLowerCase()})):!1}a(vXn,"isUserInvocableSkillCommand");function bWs(t,e){return e?"byok models":t??""}a(bWs,"safeModelId");p();p();var _p=(o=>(o.Background="BACKGROUND",o.Claude="CLAUDE",o.Codex="CODEX",o.Cloud="CLOUD",o))(_p||{});p();async function kb(t,e,r){let n=performance.now(),o={properties:{},measurements:{}};try{let s=await r(o);return CXn(t,e,n,o),s}catch(s){throw o.error??=s,CXn(t,e,n,o),s}}a(kb,"runWithTelemetry");function CXn(t,e,r,n){let s={success:n.error?"false":n.ok??!0?"true":"false",...n.properties},c={totalTimeMs:performance.now()-r,...n.measurements};n.error!==void 0?ng(t,`${e}.failure`,n.error,s,c):jl(t,e,s,c)}a(CXn,"flushTelemetry");p();var bXn=fe(require("path"));p();var $fr=["default","acceptEdits","bypassPermissions","plan","auto"];function KX(t,e){if(e!=="CLAUDE")throw new Error(`ClaudeCodeAgentService.${t}: expected agentProvider='CLAUDE', got '${String(e)}'`)}a(KX,"assertClaudeProvider");function ame(t,e,r){if(typeof r!="string"||r.length===0)throw new Error(`${t}: ${e} is required`)}a(ame,"assertNonEmptyString");function SWs(t,e,r){if(r===void 0)throw new Error(`${t}: ${e} is required`);try{eo(r)}catch(n){throw new Error(`${t}: ${e} is not a valid URI: ${r}`,{cause:n})}}a(SWs,"assertFsUri");function TWs(t,e,r){if(!bXn.isAbsolute(r))throw new Error(`${t}: ${e} must be an absolute path, got '${r}'`)}a(TWs,"assertAbsolutePath");function IWs(t,e){if(e!==void 0&&!$fr.includes(e))throw new Error(`${t}: agentMode must be one of ${$fr.join(", ")}, got '${e}'`)}a(IWs,"assertAllowedAgentMode");async function mNe(t,e){if(e===void 0)return;let n=(await t.get(xs).getMetadata()).find(o=>o.id===e);if(!n)throw new Error(`Unknown model id: ${e}`);if(!eVe(n.capabilities.family))throw new Error(`Model ${e} is not a Claude model (family: ${n.capabilities.family})`)}a(mNe,"validateClaudeModel");async function SXn(t,e){KX("createSession",e.agentProvider),SWs("createSession","workspaceFolder.uri",e.workspaceFolder?.uri),await mNe(t,e.model)}a(SXn,"validateAgentCreate");async function TXn(t,e){KX("resumeSession",e.agentProvider),ame("resumeSession","sessionId",e.sessionId),await mNe(t,e.model)}a(TXn,"validateAgentResume");async function IXn(t,e){KX("sendMessage",e.agentProvider),ame("sendMessage","sessionId",e.sessionId),ame("sendMessage","message",e.message),IWs("sendMessage",e.agentMode),await mNe(t,e.model)}a(IXn,"validateAgentSend");function xXn(t,e){KX("stopSession",e.agentProvider),ame("stopSession","sessionId",e.sessionId)}a(xXn,"validateAgentStop");function wXn(t,e){KX("destroySession",e.agentProvider),ame("destroySession","sessionId",e.sessionId)}a(wXn,"validateAgentDestroy");function RXn(t,e){KX("listSessions",e.agentProvider),ame("listSessions","cwd",e.cwd),TWs("listSessions","cwd",e.cwd)}a(RXn,"validateAgentListSessions");function kXn(t,e){KX("listModels",e.agentProvider)}a(kXn,"validateAgentListModels");p();p();p();var MXn=require("child_process"),cme=fe(require("path")),OXn=fe(IP()),LXn=require("util");var PXn=5e3,DXn=200,lme=class{constructor(e){this.execFile=(0,LXn.promisify)(MXn.execFile);this.cache=new Map;this.config=e}static{a(this,"BaseCliVersionChecker")}check(e){if(!e)return Promise.resolve({severity:"error",message:this.config.notConfiguredMessage});let r=cme.resolve(e),n=this.cache.get(r);if(n)return n;let o=this.computeStatus(r).then(s=>(s.severity==="error"&&this.cache.delete(r),s));return this.cache.set(r,o),o}clearCache(e){if(e){this.cache.delete(cme.resolve(e));return}this.cache.clear()}async computeStatus(e){let r=this.validateBasename(e);if(r)return{severity:"error",message:r};let n;try{n=(await this.execFile(e,["--version"],{timeout:PXn,windowsHide:!0})).stdout}catch(c){return{severity:"error",message:this.formatSpawnError(e,c)}}let o=OXn.coerce(n);if(!o)return{severity:"error",message:`Could not parse ${this.config.displayName} version from the input path --version output: "${NXn(n)}". Cannot verify compatibility.`};let s=this.config.validateVersion(o,e);return s||{severity:"ok"}}validateBasename(e){let r=this.config.allowedBasenames;if(!r||r.length===0)return;let n=cme.basename(e).toLowerCase();if(!r.includes(n))return`${this.config.displayName} at the input path must point at the "${r[0]}" executable, but the basename is "${cme.basename(e)}".`}formatSpawnError(e,r){let n=r;if(n?.code==="ENOENT")return`${this.config.displayName} not found at the input path. Check that the file exists and is executable.`;if(n?.killed&&n?.signal==="SIGTERM")return`${this.config.displayName} at the input path did not respond to --version within ${PXn/1e3}s.`;let o=typeof n?.stderr=="string"?NXn(n.stderr):"",s="";switch(typeof n?.code){case"number":s=` (exit code ${n.code})`;break;case"string":s=` (error code ${n.code})`;break}let c=o?` stderr: "${o}"`:"",l=n?.message?`: ${n.message}`:"";return`Failed to run "the input path --version"${s}${l}${c}`}};function NXn(t){let e=t.trim();return e.length<=DXn?e:`${e.slice(0,DXn)}\u2026`}a(NXn,"truncate");var jlt=fe(IP());function xWs(){let t=TIe.anthropicClaude?.cliPackageVersion;return typeof t=="string"?t:""}a(xWs,"getExpectedVersionRaw");var Vfr=class extends lme{static{a(this,"ClaudeCliVersionChecker")}constructor(){super({displayName:"Claude Code CLI",allowedBasenames:process.platform==="win32"?["claude.exe"]:["claude"],notConfiguredMessage:"Claude Code CLI path is not configured. Install @anthropic-ai/claude-code (e.g. `npm install -g @anthropic-ai/claude-code`), then open your editor's Copilot settings and set the Claude Code CLI Path field to the absolute path of the `claude` executable.",validateVersion(e){let r=xWs(),n=jlt.coerce(r);if(!n)return{severity:"error",message:`Could not parse expected Claude Code CLI version "${r}" from packaged metadata. This is an internal error; please report it.`};if(!jlt.satisfies(e,`~${n.major}.${n.minor}.0`))return{severity:"warning",message:`Claude Code CLI at the input path reports version ${e.version}, but this language server was built against ${n.version}. The session will still start, but SDK behavior may be unstable on protocol drift. Run \`npm install -g @anthropic-ai/claude-code@${n.version}\` to align versions.`}}})}},ume=new Vfr;p();var dme=class{constructor(){this._entries=new Map}static{a(this,"PendingRequestRegistry")}register(e){if(this._entries.has(e))throw new Error(`PendingRequestRegistry: duplicate key ${e}`);return{promise:new Promise((n,o)=>{this._entries.set(e,{resolve:n,reject:o})}),isSettled:a(()=>!this._entries.has(e),"isSettled")}}respond(e,r){let n=this._entries.get(e);return n?(this._entries.delete(e),n.resolve(r),!0):!1}rejectOne(e,r){let n=this._entries.get(e);return n?(this._entries.delete(e),n.reject(r),!0):!1}has(e){return this._entries.has(e)}respondAll(e){let r=[...this._entries.values()];this._entries.clear();for(let n of r)n.resolve(e)}rejectAll(e){let r=[...this._entries.values()];this._entries.clear();for(let n of r)n.reject(e)}};p();function BXn(t,e,r){let n=r.toolUseID,s={intention:r.title??`${t} tool call`,...n!==void 0&&{toolCallId:n}},c=a(l=>typeof l=="string"?l:void 0,"str");switch(t){case"Bash":return{...s,kind:"shell",fullCommandText:c(e.command)??""};case"Write":case"Edit":case"MultiEdit":case"NotebookEdit":return{...s,kind:"write",fileName:c(r.blockedPath)??c(e.file_path)??c(e.notebook_path)??""};case"Read":return{...s,kind:"read",path:c(r.blockedPath)??c(e.file_path)??""};case"WebFetch":return{...s,kind:"url",url:c(e.url)??""};default:{if(t.startsWith("mcp__")){let l=t.split("__");return{...s,kind:"mcp",serverName:l[1]??"",toolName:l.slice(2).join("__"),args:e}}return{...s,kind:"custom-tool",toolName:t,args:e}}}}a(BXn,"buildPermissionRequest");function FXn(t,e){return t.kind==="approve-once"?{behavior:"allow",updatedInput:e}:{behavior:"deny",message:wWs(t)}}a(FXn,"translatePermissionResult");function wWs(t){switch(t.kind){case"denied-by-rules":return"Permission denied by approval rules";case"denied-no-approval-rule-and-could-not-request-from-user":return"Permission denied: no approval rule and user prompt unavailable";case"denied-interactively-by-user":return t.feedback?`Permission denied by user: ${t.feedback}`:"Permission denied by user";case"denied-by-content-exclusion-policy":return`Permission denied by content-exclusion policy: ${t.message}`;default:return`Permission denied: ${t.kind}`}}a(wWs,"formatDenyMessage");function UXn(t){let e=t;if(!Array.isArray(e.questions))return null;let r=[];for(let n of e.questions){if(typeof n?.question!="string"||n.question.length===0)return null;r.push({questionText:n.question,header:typeof n.header=="string"&&n.header.length>0?n.header:void 0,choices:Array.isArray(n.options)?n.options.map(o=>o?.label).filter(o=>typeof o=="string"):void 0})}return r}a(UXn,"buildPreparedQuestions");function QXn(t,e){return{question:t.header?`${t.header} +${t.questionText}`:t.questionText,...t.choices!==void 0&&{choices:t.choices},allowFreeform:!0,...e!==void 0&&{toolCallId:e}}}a(QXn,"buildUserInputRequest");p();function qXn(t,e){let r=t.buildMcpServers(ts(e)),n=Object.create(null);for(let[o,s]of Object.entries(r))n[o]={type:"http",url:s.url};return{servers:n,names:new Set(Object.keys(n))}}a(qXn,"buildInjectedMcpServers");function jXn(t,e){if(Object.keys(e).length===0)return;let r=t.service.origin;if(r)return[{serverUrl:`${r}/*`}]}a(jXn,"buildAllowedMcpServers");p();var HXn=require("crypto");var RWs=new pe("ClaudeOTelTracker");function GXn(t){if(t!=null){if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return}}}a(GXn,"toAttributeString");function kWs(t){if(typeof t=="string")return t;if(Array.isArray(t)){let e=t.filter(r=>{if(typeof r!="object"||r===null)return!1;let n=r;return n.type==="text"&&typeof n.text=="string"}).map(r=>r.text);if(e.length===t.length&&e.length>0)return e.join("")}return GXn(t)}a(kWs,"stringifyToolResult");function Wfr(t){return(0,HXn.randomUUID)().replace(/-/g,"").slice(0,t*2)}a(Wfr,"generateHexId");function Hlt(){return BigInt(Date.now())*1000000n}a(Hlt,"nowNano");var Glt=class{constructor(e,r,n){this._ctx=e;this._sessionId=r;this._persistence=n;this._toolSpans=new Map;this._responseText="";this._inputTokens=0;this._outputTokens=0;this._cacheReadTokens=0;this._cacheCreationTokens=0}static{a(this,"ClaudeOTelTracker")}startRequest(e,r){this._rootSpan&&this._endRootSpan(2,"New request started before previous ended");let n=Wfr(16),o=Wfr(8);this._rootSpan={traceId:n,spanId:o,name:"invoke_agent claude",startNano:Hlt(),attributes:{[fo.OPERATION_NAME]:Ffr.INVOKE_AGENT,[fo.AGENT_NAME]:"claude",[fo.SYSTEM]:"anthropic",[fo.CONVERSATION_ID]:this._sessionId,...e?{[fo.REQUEST_MODEL]:e}:{},...r?{[fo.INPUT_MESSAGES]:rme("user",r)}:{}}},this._inputTokens=0,this._outputTokens=0,this._cacheReadTokens=0,this._cacheCreationTokens=0,this._responseText="",this._toolSpans.clear()}onMessage(e){if(this._rootSpan)switch(e.type){case"assistant":this._onAssistantMessage(e);break;case"user":this._onUserMessage(e);break;case"result":this._onResultMessage(e);break}}endRequest(){this._endRootSpan(1)}endRequestWithError(e){this._endRootSpan(2,e)}_onAssistantMessage(e){if(e.parent_tool_use_id!=null)return;let r=e.message?.content;if(Array.isArray(r))for(let n of r)n.type==="tool_use"?this._startToolSpan(n.id,n.name,n.input):n.type==="text"&&typeof n.text=="string"&&(this._responseText+=n.text)}_onUserMessage(e){let r=e.message?.content;if(Array.isArray(r)){for(let n of r)if(n.type==="tool_result"&&typeof n.tool_use_id=="string"){let o=n.is_error===!0;this._endToolSpan(n.tool_use_id,o,n.content)}}}_onResultMessage(e){if(!this._rootSpan)return;let r=e.usage;if(r&&(this._inputTokens=r.input_tokens??0,this._outputTokens=r.output_tokens??0,this._cacheReadTokens=r.cache_read_input_tokens??0,this._cacheCreationTokens=r.cache_creation_input_tokens??0),e.modelUsage){let n=Object.keys(e.modelUsage);n.length>0&&(this._rootSpan.attributes[fo.RESPONSE_MODEL]=n[0])}typeof e.num_turns=="number"&&(this._rootSpan.attributes[fo.TURN_COUNT]=e.num_turns),typeof e.total_cost_usd=="number"&&(this._rootSpan.attributes[fo.TOTAL_COST_USD]=e.total_cost_usd)}_startToolSpan(e,r,n){if(!this._rootSpan||this._toolSpans.has(e))return;let o={[fo.OPERATION_NAME]:Ffr.EXECUTE_TOOL,[fo.TOOL_NAME]:r,[fo.TOOL_CALL_ID]:e,[fo.CONVERSATION_ID]:this._sessionId},s=GXn(n);s!==void 0&&(o[fo.TOOL_CALL_ARGUMENTS]=s),this._toolSpans.set(e,{traceId:this._rootSpan.traceId,spanId:Wfr(8),parentSpanId:this._rootSpan.spanId,name:`execute_tool ${r}`,startNano:Hlt(),attributes:o})}_endToolSpan(e,r,n){let o=this._toolSpans.get(e);if(!o)return;this._toolSpans.delete(e);let s=kWs(n);s!==void 0&&(o.attributes[fo.TOOL_CALL_RESULT]=s);let c=Hlt(),l=this._buildOtlpSpan(o,c,r?2:1,r?"Tool execution error":void 0);this._flush([l])}_endRootSpan(e,r){let n=this._rootSpan;if(!n)return;this._rootSpan=void 0,this._inputTokens>0&&(n.attributes[fo.USAGE_INPUT_TOKENS]=this._inputTokens),this._outputTokens>0&&(n.attributes[fo.USAGE_OUTPUT_TOKENS]=this._outputTokens),this._cacheReadTokens>0&&(n.attributes[fo.USAGE_CACHE_READ_INPUT_TOKENS]=this._cacheReadTokens),this._cacheCreationTokens>0&&(n.attributes[fo.USAGE_CACHE_CREATION_INPUT_TOKENS]=this._cacheCreationTokens);let o=Hlt(),s=[];for(let[,l]of this._toolSpans)s.push(this._buildOtlpSpan(l,o,2,"Tool span orphaned at turn end"));this._toolSpans.clear(),this._responseText&&(n.attributes[fo.OUTPUT_MESSAGES]=rme("assistant",this._responseText)),this._responseText="";let c=this._buildOtlpSpan(n,o,e,r);this._flush([...s,c])}_buildOtlpSpan(e,r,n,o){let s={traceId:e.traceId,spanId:e.spanId,name:e.name,kind:1,startTimeUnixNano:e.startNano.toString(),endTimeUnixNano:r.toString(),attributes:T8(e.attributes),events:[],status:o?{code:n,message:o}:{code:n}};return e.parentSpanId&&(s.parentSpanId=e.parentSpanId),s}_flush(e){e.length!==0&&this._persistence.appendSpans(e).catch(r=>{RWs.warn(this._ctx,`Failed to persist OTel spans for session=${this._sessionId}: ${r instanceof Error?r.message:String(r)}`)})}};p();var zfr=require("fs"),VXn=fe(require("path"));var gNe=new pe("ClaudeCode.ReferenceFormatter"),PWs={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp"},$Xn=5*1024*1024;async function WXn(t,e){if(!t?.length)return[];let r=[],n=[];for(let s of t)switch(s.type){case"file":{let c=Us(s.uri);if(!c){gNe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}let l=NWs(c);if(l){let u=await DWs(c,l,e);u&&r.push(u)}else{let u=s.selection?`:L${s.selection.start.line+1}-L${s.selection.end.line+1}`:"";n.push(`- ${c}${u}`)}break}case"directory":{let c=Us(s.uri);if(!c){gNe.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}n.push(`- ${c}/`);break}default:gNe.debug(e,`Skipping unsupported reference type: ${s.type}`);break}let o=[...r];return n.length>0&&o.push({type:"text",text:MWs(n)}),o}a(WXn,"buildReferences");async function DWs(t,e,r){try{let n=await zfr.promises.stat(t);if(n.size>$Xn){gNe.debug(r,`Skipping oversize image reference (${n.size} > ${$Xn} bytes): ${t}`);return}let o=(await zfr.promises.readFile(t)).toString("base64");return{type:"image",source:{type:"base64",media_type:e,data:o}}}catch(n){gNe.debug(r,`Failed to read image reference ${t}: ${n instanceof Error?n.message:String(n)}`);return}}a(DWs,"tryReadImageBlock");function NWs(t){return PWs[VXn.extname(t).toLowerCase()]}a(NWs,"imageMediaTypeForPath");function MWs(t){return` The user provided the following references: `+t.join(` `)+` IMPORTANT: this context may or may not be relevant to your tasks. You should not respond to this context unless it is highly relevant to your task. -`}a(eVs,"wrapInSystemReminder");p();var uXn=require("crypto");var tVs=new Set(["ExitPlanMode"]);function Sfr(t,e={}){let r=e.timestamp??new Date().toISOString();if(t.type==="error"&&typeof t.error=="string")return[pXn(r,"synthetic",t.error)];switch(t.type){case"system":return rVs(t,r);case"assistant":return cXn(nVs(t,r,e.streamingEnabled===!0,e.blockCursor,e.interactionId,e.mapModelId),e.suppressedToolUseIds);case"user":return cXn(e.includeUserText===!0?oVs(t,r):iVs(t,r),e.suppressedToolUseIds);case"result":return cVs(t,r,e.sessionModel,e.copilotUsageNanoAiu);default:return[]}}a(Sfr,"translate");function cXn(t,e){return e?t.filter(r=>{if(r.type==="tool.execution_start"){let{toolName:n,toolCallId:o}=r.data;if(typeof o=="string"&&n!==void 0&&tVs.has(n))return e.add(o),!1}if(r.type==="tool.execution_complete"){let{toolCallId:n}=r.data;if(typeof n=="string"&&e.has(n))return e.delete(n),!1}return!0}):t}a(cXn,"dropDedicatedChannelToolEvents");function dXn(t,e,r){if(t.parent_tool_use_id!==null)return[];let n=t.event,o=new Date().toISOString();switch(n.type){case"message_start":return[{id:e,timestamp:o,parentId:null,type:"assistant.turn_start",data:{turnId:e,interactionId:r??e}}];case"content_block_delta":{let s=n.delta;switch(s.type){case"text_delta":return[{id:Lg(),timestamp:o,parentId:null,type:"assistant.message_delta",ephemeral:!0,data:{messageId:`${e}:${n.index}`,deltaContent:s.text}}];case"thinking_delta":return[{id:Lg(),timestamp:o,parentId:null,type:"assistant.reasoning_delta",ephemeral:!0,data:{reasoningId:`${e}:${n.index}`,deltaContent:s.thinking}}];default:return[]}}case"content_block_start":case"content_block_stop":case"message_delta":case"message_stop":return[];default:return[]}}a(dXn,"translatePartial");function rVs(t,e){let r=t.subtype;if(r==="init"){let n=t;return[{id:Lg(),timestamp:e,parentId:null,type:"session.start",data:{sessionId:n.session_id,version:1,producer:"claude-code-sdk",copilotVersion:"",startTime:e,selectedModel:n.model,context:n.cwd?{cwd:n.cwd}:void 0}}]}return r==="compact_boundary"?[{id:Lg(),timestamp:e,parentId:null,type:"session.compaction_start",data:{}},{id:Lg(),timestamp:e,parentId:null,type:"session.compaction_complete",data:{success:!0}}]:[]}a(rVs,"translateSystem");function nVs(t,e,r,n,o,s){let c=t.message?.id??Lg(),l=[],u=t.message?.model,d=u;if(typeof u=="string"&&s)try{d=s(u)}catch{d=u}r||l.push({id:c,timestamp:e,parentId:null,type:"assistant.turn_start",data:{turnId:c,interactionId:o??c}});let f=t.message?.content??[],h=n??new Map,m=h.get(c)??0;return f.forEach(g=>{let A=m++;switch(g.type){case"text":{let y=g.text;typeof y=="string"&&y.length>0&&l.push({id:Lg(),timestamp:e,parentId:null,type:"assistant.message",data:{messageId:`${c}:${A}`,content:y,model:d}});break}case"thinking":{let y=g.thinking;typeof y=="string"&&y.length>0&&l.push({id:Lg(),timestamp:e,parentId:null,type:"assistant.reasoning",data:{reasoningId:`${c}:${A}`,content:y}});break}case"tool_use":{let y=g;l.push({id:Lg(),timestamp:e,parentId:null,type:"tool.execution_start",data:{toolCallId:typeof y.id=="string"?y.id:Lg(),toolName:typeof y.name=="string"?y.name:"unknown",arguments:y.input}});break}default:break}}),h.set(c,m),l}a(nVs,"translateAssistant");function iVs(t,e){let r=t.message?.content;if(!Array.isArray(r))return[];let n=[];for(let o of r)o.type==="tool_result"&&n.push(fXn(o,e));return n}a(iVs,"translateUserLive");function oVs(t,e){let r=[],n=t.message?.content;if(typeof n=="string"){let o=Nlt(n);return o.length>0&&r.push(lXn(e,o)),r}if(!Array.isArray(n))return r;for(let o of n){if(o.type==="tool_result"){r.push(fXn(o,e));continue}if(o.type==="text"){let s=o.text;if(typeof s=="string"){let c=Nlt(s);c.length>0&&r.push(lXn(e,c))}}}return r}a(oVs,"translateUserHistory");function fXn(t,e){let r=t.tool_use_id,n=t.is_error===!0,o=lVs(t.content);return{id:Lg(),timestamp:e,parentId:null,type:"tool.execution_complete",data:{toolCallId:typeof r=="string"?r:Lg(),success:!n,result:n?void 0:{content:o??""},error:n?{message:o??"Tool execution failed"}:void 0}}}a(fXn,"buildToolExecutionComplete");function lXn(t,e){return{id:Lg(),timestamp:t,parentId:null,type:"user.message",data:{content:e}}}a(lXn,"buildUserMessage");function sVs(t){return t.replace(/[\s\S]*?<\/system-reminder>\s*/g,"").trim()}a(sVs,"stripSystemReminders");var aVs=/^\[Request interrupted by user[^\]]*\]$/;function Nlt(t){let e=sVs(t);return aVs.test(e)?"":e}a(Nlt,"sanitizeUserText");function cVs(t,e,r,n){let o=[],s=t.usage;if(s&&o.push({id:Lg(),timestamp:e,parentId:null,type:"assistant.usage",ephemeral:!0,data:{model:r??"unknown",inputTokens:s.input_tokens,outputTokens:s.output_tokens,cacheWriteTokens:s.cache_creation_input_tokens,cacheReadTokens:s.cache_read_input_tokens,...n!==void 0&&n>0?{copilotUsage:{totalNanoAiu:n}}:{}}}),t.is_error===!0){let l=t.subtype,u=t.errors,d=t.result,f=Array.isArray(u)&&u.find(h=>typeof h=="string"&&h.length>0)||(typeof d=="string"&&d.length>0?d:void 0)||"Claude turn ended with error";o.push(pXn(e,typeof l=="string"?l:"error",f))}return o.push({id:Lg(),timestamp:e,parentId:null,type:"session.idle",ephemeral:!0,data:{}}),o}a(cVs,"translateResult");function pXn(t,e,r){return{id:Lg(),timestamp:t,parentId:null,type:"session.error",data:{errorType:e,message:r}}}a(pXn,"buildSessionError");function lVs(t){if(t!=null){if(typeof t=="string")return t;if(Array.isArray(t)){let e=[];for(let n of t)if(n&&typeof n=="object"){let o=n.text;typeof o=="string"&&e.push(o)}let r=e.join(` -`);return r.length>0?r:void 0}try{return JSON.stringify(t)}catch{return}}}a(lVs,"flattenToolResultContent");function Lg(){return(0,uXn.randomUUID)()}a(Lg,"newId");function hXn(t,e){let r=[],n=new Map,o=new Set,s;for(let c of t){let l=dVs(c);if(!l)continue;(l.type==="user"&&uVs(l)||l.type==="assistant"&&s===void 0)&&(s=Lg());let u=l.type==="assistant"?s:void 0,d=c.timestamp,f=typeof d=="string"?d:void 0;try{r.push(...Sfr(l,{streamingEnabled:!1,includeUserText:!0,blockCursor:n,suppressedToolUseIds:o,timestamp:f,interactionId:u,mapModelId:e}))}catch{}}return r}a(hXn,"translateHistory");function uVs(t){let e=(t.message??{}).content;if(typeof e=="string")return Nlt(e).length>0;if(!Array.isArray(e))return!1;for(let r of e)if(r.type==="text"&&typeof r.text=="string"&&Nlt(r.text).length>0)return!0;return!1}a(uVs,"userMessageStartsInteraction");function dVs(t){if(!(!t||typeof t!="object"||!t.message||typeof t.message!="object")&&(t.type==="user"||t.type==="assistant"))return t.type==="user"&&fVs(t)?void 0:{type:t.type,message:t.message,parent_tool_use_id:t.parent_tool_use_id,uuid:t.uuid,session_id:t.session_id}}a(dVs,"adaptHistoryMessage");function fVs(t){let e=t;return e.isMeta===!0||e.isCompactSummary===!0||e.isVisibleInTranscriptOnly===!0||e.isSynthetic===!0}a(fVs,"isSyntheticReplayUserMessage");p();var fm=class{constructor(){this._modelBySession=new Map;this._permissionModeBySession=new Map;this._reasoningEffortBySession=new Map;this._copilotUsageNanoAiuBySession=new Map}static{a(this,"ClaudeSessionStateService")}setModelForSession(e,r){if(r===void 0){this._modelBySession.delete(e);return}this._modelBySession.set(e,r)}getModelForSession(e){return this._modelBySession.get(e)}setPermissionModeForSession(e,r){if(r===void 0){this._permissionModeBySession.delete(e);return}this._permissionModeBySession.set(e,r)}getPermissionModeForSession(e){return this._permissionModeBySession.get(e)}setReasoningEffortForSession(e,r){if(r===void 0){this._reasoningEffortBySession.delete(e);return}this._reasoningEffortBySession.set(e,r)}getReasoningEffortForSession(e){return this._reasoningEffortBySession.get(e)}addCopilotUsageNanoAiuForSession(e,r){if(!Number.isFinite(r)||r<=0)return;let n=this._copilotUsageNanoAiuBySession.get(e)??0;this._copilotUsageNanoAiuBySession.set(e,n+r)}takeCopilotUsageNanoAiuForSession(e){let r=this._copilotUsageNanoAiuBySession.get(e);return this._copilotUsageNanoAiuBySession.delete(e),r}clear(e){this._modelBySession.delete(e),this._permissionModeBySession.delete(e),this._reasoningEffortBySession.delete(e),this._copilotUsageNanoAiuBySession.delete(e)}};var Mlt=de(require("path"));Mo();var qc=new fe("ClaudeCodeAgent.session"),jc="ClaudeCodeSession",iNe=class{constructor(e,r,n,o){this.ctx=e;this.sdkWrapper=r;this.notificationSender=n;this._terminalErrorEmittedForTurn=!1;this._assistantBlockCursor=new Map;this._suppressedToolUseIds=new Set;this._abortController=new AbortController;this._isResumed=!1;this._isProcessing=!1;this._disposed=!1;this._permissionRegistry=new eme;this._userInputRegistry=new eme;this._exitPlanModeRegistry=new eme;this._handleCanUseTool=a((e,r,n)=>this._disposed?Promise.resolve({behavior:"deny",message:`Session ${this.sessionId} disposed`}):e==="AskUserQuestion"?this._handleAskUserQuestion(r,n):e==="ExitPlanMode"?this._handleExitPlanMode(r,n):e==="ToolSearch"?Promise.resolve({behavior:"allow",updatedInput:r}):this._handlePermissionRequest(e,r,n),"_handleCanUseTool");this.sessionId=o.sessionId,this._cwd=o.cwd,this._model=o.model,this._permissionMode=o.permissionMode,this._isResumed=!(o.isNewSession??!0),this._proxyConfig=o.proxyConfig;let s=this.ctx.get(fm);if(s.setModelForSession(this.sessionId,this._model),s.setPermissionModeForSession(this.sessionId,this._permissionMode),this.ctx.get(bn).getCapabilities().agentDebugLog){let c=new pv(this.ctx);c.isEnabled()&&(this._otelTracker=new Dlt(this.ctx,this.sessionId,c))}}static{a(this,"ClaudeCodeSession")}get cwd(){return this._cwd}async invoke(e){if(this._disposed){let r=`Session ${this.sessionId} has been disposed`;throw await this._sendSessionUpdate({type:"error",error:r}),new Error(r)}if(this._isProcessing){let r=`Session ${this.sessionId} is busy: a previous invoke is still streaming. Wait for the terminal sessionUpdate before sending another prompt.`;throw await this._sendSessionUpdate({type:"error",error:r}),new Error(r)}this._isProcessing=!0;try{await this._runInvoke(e)}finally{this._isProcessing=!1}}async setModel(e){if(e!==this._model&&(this._model=e,this.ctx.get(fm).setModelForSession(this.sessionId,e),this._query))try{await this._query.setModel(e)}catch(r){qc.warn(this.ctx,`${jc}: setModel on active query failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async supportedAgents(){if(!this._query)return[];try{return await this._query.supportedAgents()}catch(e){return qc.warn(this.ctx,`${jc}: supportedAgents query failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)}),[]}}_notifyAgentListChanged(){try{this.ctx.get(a0).notify("agent").catch(e=>{qc.warn(this.ctx,`${jc}: notify(agent) failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)})})}catch(e){qc.warn(this.ctx,`${jc}: notify(agent) failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)})}}async setPermissionMode(e){if(e===void 0&&this._permissionMode!==void 0){qc.info(this.ctx,`${jc}: setPermissionMode skipped (undefined preserves existing)`,{sessionId:this.sessionId,existingMode:this._permissionMode});return}let r=e??"default";if(this._permissionMode=r,this.ctx.get(fm).setPermissionModeForSession(this.sessionId,r),this._query)try{await this._query.setPermissionMode(r),qc.info(this.ctx,`${jc}: setPermissionMode propagated to live Query`,{sessionId:this.sessionId,effectiveMode:r})}catch(n){qc.warn(this.ctx,`${jc}: setPermissionMode on active query failed`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)})}}async interrupt(){let e=this._query;if(e)try{await e.interrupt()}catch(r){qc.warn(this.ctx,`${jc}: interrupt() failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}dispose(){if(this._disposed)return;this._disposed=!0,this._dropAllPending("disposed"),this._abortController.abort(),this.ctx.get(fm).clear(this.sessionId);let e=this._promptWaiter;this._promptWaiter=void 0,e?.resolve();let r=this._currentInvokeDone;this._currentInvokeDone=void 0,r?.reject(new Error(`Session ${this.sessionId} disposed`));let n=this._query;n&&n.interrupt().catch(o=>{qc.warn(this.ctx,`${jc}: interrupt during dispose failed`,{sessionId:this.sessionId,error:o instanceof Error?o.message:String(o)})})}async _runInvoke(e){e.model!==void 0&&e.model!==this._model&&await this.setModel(e.model),e.permissionMode!==void 0&&await this.setPermissionMode(e.permissionMode),this.ctx.get(fm).setReasoningEffortForSession(this.sessionId,e.reasoningEffort),this.ctx.get(fm).takeCopilotUsageNanoAiuForSession(this.sessionId);let r=new vA;this._currentInvokeDone=r,this._terminalErrorEmittedForTurn=!1,this._currentTurnInteractionId=Mt();let n;try{this._query||await this._startQuery();let o=this._query;n=e.token?.onCancellationRequested(()=>{qc.info(this.ctx,`${jc}: cancellation requested`,{sessionId:this.sessionId}),o.interrupt()}),qc.info(this.ctx,`${jc}.invoke`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,messageCharLen:e.message.length,referenceCount:e.references?.length??0});let s=await aXn(e.references,this.ctx),l={type:"user",message:{role:"user",content:[{type:"text",text:e.message},...s]},parent_tool_use_id:null,session_id:this.sessionId,uuid:e.messageId??Mt()};this._otelTracker?.startRequest(this._model),this._pendingPromptInput=l;let u=this._promptWaiter;this._promptWaiter=void 0,u?.resolve(),await r.promise}catch(o){throw await this._emitTerminalError(o),o}finally{n?.dispose(),this._currentInvokeDone===r&&(this._currentInvokeDone=void 0)}}async _startQuery(){let e=this._proxyConfig,r=this._isResumed,n=Ft(this.ctx,Ye.ClaudeCliPath)||process.env.CLAUDE_CLI_PATH,o=await Xhe.check(n);if(o.severity==="error")throw new Error(o.message);o.severity==="warning"&&(qc.warn(this.ctx,`${jc}: ${o.message}`,{sessionId:this.sessionId}),this.notificationSender.showWarningMessageOnlyOnce("claude.cliVersionMismatch",o.message));let s={cwd:this._cwd,executable:process.execPath,pathToClaudeCodeExecutable:n,abortController:this._abortController,settings:{env:{ANTHROPIC_BASE_URL:`http://127.0.0.1:${e.port}`,ANTHROPIC_AUTH_TOKEN:`${e.nonce}.${this.sessionId}`,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1",USE_BUILTIN_RIPGREP:"0",PATH:await this._buildPathWithBundledRipgrep()}},systemPrompt:{type:"preset",preset:"claude_code"},settingSources:["user","project","local"],...L$t(this.ctx)?{}:{skills:[]},disallowedTools:["WebSearch"],canUseTool:this._handleCanUseTool,thinking:{type:"adaptive"},includePartialMessages:!0,allowDangerouslySkipPermissions:!0,...this._model&&{model:this._model},...this._permissionMode&&{permissionMode:this._permissionMode},...r?{resume:this.sessionId}:{sessionId:this.sessionId}},c=await this.sdkWrapper.query({prompt:this._createPromptIterable(),options:s});this._query=c,this._isResumed=!0,this._notifyAgentListChanged(),qc.info(this.ctx,`${jc}: started long-lived Query`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,isResumed:r}),this._processMessages(c).catch(l=>{qc.error(this.ctx,`${jc}: consume loop crashed`,{sessionId:this.sessionId,error:l instanceof Error?l.message:String(l)})})}async _buildPathWithBundledRipgrep(){try{let e=await this.ctx.get(gF).resolvePath();return`${Mlt.dirname(e)}${Mlt.delimiter}${process.env.PATH??""}`}catch(e){return qc.warn(this.ctx,`${jc}: bundled ripgrep unavailable, falling back to process PATH`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)}),process.env.PATH??""}}async*_createPromptIterable(){for(;!this._disposed;){if(this._pendingPromptInput){let r=this._pendingPromptInput;this._pendingPromptInput=void 0,yield r;continue}let e=new vA;this._promptWaiter=e,await e.promise}}async _processMessages(e){let r;try{for await(let n of e){if(this._checkSessionIdConsistency(n),this._isPartialAssistantMessage(n)){let o=n.event;o.type==="message_start"&&(r=o.message.id),r!==void 0&&await this._sendPartialUpdate(n,r),o.type==="message_stop"&&(r=void 0)}else await this._sendSessionUpdate(n);if(this._isTerminalTurnMessage(n)){n.type==="result"?this._otelTracker?.endRequest():this._otelTracker?.endRequestWithError(n.error??"Turn ended with error"),this._assistantBlockCursor.clear(),this._suppressedToolUseIds.clear(),this._currentTurnInteractionId=void 0;let s=this._currentInvokeDone;this._currentInvokeDone=void 0,s?.resolve()}}this._otelTracker?.endRequestWithError("SDK Query ended unexpectedly"),this._currentInvokeDone&&await this._emitTerminalError(new Error("SDK Query ended unexpectedly")),this._cleanupLiveQuery(e,new Error("SDK Query ended unexpectedly"))}catch(n){qc.error(this.ctx,`${jc}: query error`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)}),this._otelTracker?.endRequestWithError(n instanceof Error?n.message:String(n)),await this._emitTerminalError(n),this._cleanupLiveQuery(e,n instanceof Error?n:new Error(String(n)))}}_isPartialAssistantMessage(e){return typeof e=="object"&&e!==null&&e.type==="stream_event"}_isTerminalTurnMessage(e){if(typeof e!="object"||e===null)return!1;let r=e.type;return r==="result"||r==="error"}_cleanupLiveQuery(e,r){this._query===e&&(this._query=void 0),this._dropAllPending("query ended",r.message),this._assistantBlockCursor.clear(),this._suppressedToolUseIds.clear(),this._currentTurnInteractionId=void 0;let n=this._currentInvokeDone;this._currentInvokeDone=void 0,n?.reject(r)}_checkSessionIdConsistency(e){if(typeof e!="object"||e===null)return;let r=e.session_id;typeof r=="string"&&r!==this.sessionId&&qc.error(this.ctx,`${jc}: SDK reported session_id mismatch`,{expected:this.sessionId,reported:r})}async _sendSessionUpdate(e){try{this._otelTracker?.onMessage(e);let n=e?.type==="result"?this.ctx.get(fm).takeCopilotUsageNanoAiuForSession(this.sessionId):void 0,o=Sfr(e,{streamingEnabled:!0,sessionModel:this._model,copilotUsageNanoAiu:n,blockCursor:this._assistantBlockCursor,suppressedToolUseIds:this._suppressedToolUseIds,interactionId:this._currentTurnInteractionId});for(let s of o)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,s,"CLAUDE")}catch(r){qc.error(this.ctx,`${jc}: failed to send agent/sessionUpdate`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async _sendPartialUpdate(e,r){try{let n=dXn(e,r,this._currentTurnInteractionId);for(let o of n)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}catch(n){qc.error(this.ctx,`${jc}: failed to send partial agent/sessionUpdate`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)})}}async _emitTerminalError(e){if(this._terminalErrorEmittedForTurn)return;this._terminalErrorEmittedForTurn=!0;let r=e instanceof Error?e.message:String(e);await this._sendSessionUpdate({type:"error",error:r})}respondToInteraction(e){if(e.sessionId!==this.sessionId)return qc.warn(this.ctx,`${jc}: respondToInteraction sessionId mismatch`,{ownSessionId:this.sessionId,paramSessionId:e.sessionId,requestId:e.requestId}),!1;switch(e.type){case"permission":return this._respondFromRegistry(this._permissionRegistry,e.type,e.requestId,e.result);case"user_input":return this._respondFromRegistry(this._userInputRegistry,e.type,e.requestId,e.response);case"exit_plan_mode":return this._respondFromRegistry(this._exitPlanModeRegistry,e.type,e.requestId,e.response);default:return qc.warn(this.ctx,`${jc}: unsupported interaction type`,{sessionId:this.sessionId,requestId:e.requestId,interactionType:e.type}),!1}}_respondFromRegistry(e,r,n,o){let s=e.respond(n,o);return s||qc.warn(this.ctx,`${jc}: respondToInteraction for unknown ${r} requestId`,{sessionId:this.sessionId,requestId:n}),s}_dropAllPending(e,r){let n=r?`: ${r}`:"";this._permissionRegistry.respondAll({kind:"denied-interactively-by-user",feedback:`Session ${this.sessionId} ${e} before permission resolved${n}`}),this._userInputRegistry.rejectAll(new Error(`Session ${this.sessionId} ${e} before user_input resolved${n}`)),this._exitPlanModeRegistry.respondAll({approved:!1,feedback:`Session ${this.sessionId} ${e} before exit_plan_mode resolved${n}`})}_handlePermissionRequest(e,r,n){let o=n.toolUseID??Mt();if(n.signal.aborted)return Promise.resolve({behavior:"deny",message:"Permission request aborted"});let s=eXn(e,r,n);return this._requestPermissionFromIde(o,e,r,s,n)}async _handleAskUserQuestion(e,r){if(r.signal.aborted)return{behavior:"deny",message:"AskUserQuestion aborted"};let n=rXn(e);if(!n)return{behavior:"deny",message:"AskUserQuestion: invalid input"};try{let o=await Promise.all(n.map(async c=>{let l=Mt(),u=await this._requestUserInputFromIde(l,nXn(c,r.toolUseID),r.signal);return{questionText:c.questionText,answer:u.answer}})),s={};for(let{questionText:c,answer:l}of o)s[c]=l;return{behavior:"allow",updatedInput:{...e,answers:s}}}catch(o){return{behavior:"deny",message:o instanceof Error?o.message:`AskUserQuestion failed: ${String(o)}`}}}_handleExitPlanMode(e,r){let n=r.toolUseID??Mt();return r.signal.aborted?Promise.resolve({behavior:"deny",message:"ExitPlanMode request aborted"}):this._requestExitPlanModeFromIde(n,e,r)}async _requestExitPlanModeFromIde(e,r,n){let{promise:o,isSettled:s}=this._exitPlanModeRegistry.register(e),c=a(()=>{this._exitPlanModeRegistry.respond(e,{approved:!1,feedback:"ExitPlanMode request aborted"})},"onAbort"),l=a(()=>n.signal.removeEventListener("abort",c),"cleanupAbort");n.signal.addEventListener("abort",c,{once:!0});let u=typeof r.plan=="string"?r.plan:"",d=this._emitExitPlanModeRequested(e,{planContent:u,summary:u,actions:["exit_only","interactive"],recommendedAction:"interactive",toolCallId:n.toolUseID});d.catch(m=>{s()||(qc.error(this.ctx,`${jc}: failed to emit exit_plan_mode.requested, denying`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)}),l(),this._exitPlanModeRegistry.respond(e,{approved:!1,feedback:"Failed to deliver exit_plan_mode request to client"}))});let f;try{f=await o}finally{l()}let h=this._translateExitPlanModeResponse(f,r);return qc.info(this.ctx,`${jc}: exit_plan_mode resolved`,{sessionId:this.sessionId,requestId:e,behavior:h.behavior,selectedAction:f.selectedAction,autoApproveEdits:f.autoApproveEdits}),d.catch(()=>{}).then(()=>this._emitExitPlanModeCompleted(e,f)).catch(m=>{qc.warn(this.ctx,`${jc}: failed to emit exit_plan_mode.completed`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)})}),h}_translateExitPlanModeResponse(e,r){if(!e.approved){let c=e.feedback?.trim();return{behavior:"deny",message:c?`Plan not approved: ${c}`:"Plan not approved by user"}}if(e.selectedAction==="exit_only")return{behavior:"deny",message:"The user approved the plan but will implement it themselves. Do not make any code changes or take any further action. Stop and wait for the user."};let o=e.autoApproveEdits===!0?"acceptEdits":"default";return this._permissionMode=o,this.ctx.get(fm).setPermissionModeForSession(this.sessionId,o),{behavior:"allow",updatedInput:r,updatedPermissions:[{type:"setMode",mode:o,destination:"session"}]}}async _requestPermissionFromIde(e,r,n,o,s){let{promise:c,isSettled:l}=this._permissionRegistry.register(e),u=a(()=>{this._permissionRegistry.respond(e,{kind:"denied-interactively-by-user",feedback:"Permission request aborted"})},"onAbort"),d=a(()=>s.signal.removeEventListener("abort",u),"cleanupAbort");s.signal.addEventListener("abort",u,{once:!0});let f=this._emitPermissionRequested(e,o);f.catch(A=>{l()||(qc.error(this.ctx,`${jc}: failed to emit permission.requested, denying`,{sessionId:this.sessionId,requestId:e,toolName:r,error:A instanceof Error?A.message:String(A)}),d(),this._permissionRegistry.respond(e,{kind:"denied-interactively-by-user",feedback:"Failed to deliver permission request to client"}))});let h;try{h=await c}finally{d()}let m=tXn(h,n);qc.info(this.ctx,`${jc}: permission resolved`,{sessionId:this.sessionId,requestId:e,toolName:r,behavior:m.behavior});let g=m.behavior==="allow"?"approved":"denied";return f.catch(()=>{}).then(()=>this._emitPermissionCompleted(e,g,s.toolUseID)).catch(A=>{qc.warn(this.ctx,`${jc}: failed to emit permission.completed`,{sessionId:this.sessionId,requestId:e,error:A instanceof Error?A.message:String(A)})}),m}async _requestUserInputFromIde(e,r,n){let{promise:o,isSettled:s}=this._userInputRegistry.register(e),c=a(()=>{this._userInputRegistry.rejectOne(e,new Error("AskUserQuestion aborted"))},"onAbort"),l=a(()=>n.removeEventListener("abort",c),"cleanupAbort");n.addEventListener("abort",c,{once:!0});let u=this._emitUserInputRequested(e,r);u.catch(m=>{s()||(qc.error(this.ctx,`${jc}: failed to emit user_input.requested, rejecting`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)}),l(),this._userInputRegistry.rejectOne(e,m instanceof Error?m:new Error(String(m))))});let d,f;try{d=await o}catch(m){f=m instanceof Error?m:new Error(String(m))}finally{l()}let h=d??{answer:"",wasFreeform:!1};if(u.catch(()=>{}).then(()=>this._emitUserInputCompleted(e,h)).catch(m=>{qc.warn(this.ctx,`${jc}: failed to emit user_input.completed`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)})}),f!==void 0)throw f;return d}async _emitPermissionRequested(e,r){let n={id:Mt(),timestamp:new Date().toISOString(),parentId:null,type:"permission.requested",data:{requestId:e,permissionRequest:r}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitPermissionCompleted(e,r,n){let o={id:Mt(),timestamp:new Date().toISOString(),parentId:null,type:"permission.completed",data:{requestId:e,result:{kind:r},...n!==void 0?{toolCallId:n}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}async _emitUserInputRequested(e,r){let n={id:Mt(),timestamp:new Date().toISOString(),parentId:null,type:"user_input.requested",data:{requestId:e,question:r.question,...r.choices!==void 0?{choices:r.choices}:{},...r.allowFreeform!==void 0?{allowFreeform:r.allowFreeform}:{},...r.toolCallId!==void 0?{toolCallId:r.toolCallId}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitUserInputCompleted(e,r){let n={id:Mt(),timestamp:new Date().toISOString(),parentId:null,type:"user_input.completed",data:{requestId:e,answer:r.answer,wasFreeform:r.wasFreeform}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitExitPlanModeRequested(e,r){let n={id:Mt(),timestamp:new Date().toISOString(),parentId:null,type:"exit_plan_mode.requested",data:{requestId:e,planContent:r.planContent,summary:r.summary,actions:r.actions,recommendedAction:r.recommendedAction,...r.toolCallId!==void 0?{toolCallId:r.toolCallId}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitExitPlanModeCompleted(e,r){let n={id:Mt(),timestamp:new Date().toISOString(),parentId:null,type:"exit_plan_mode.completed",data:{requestId:e,approved:r.approved,...r.selectedAction!==void 0?{selectedAction:r.selectedAction}:{},...r.autoApproveEdits!==void 0?{autoApproveEdits:r.autoApproveEdits}:{},...r.feedback!==void 0?{feedback:r.feedback}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}};p();var AXn=de(require("http")),yXn=require("node:stream"),Ifr=require("node:stream/promises"),EXn=require("node:string_decoder");Mo();var Bg=new fe("ClaudeMessagesProxyServer"),pVs=["interleaved-thinking","context-management","advanced-tool-use"],Tfr="cls_claude_agent",Fg={InvalidRequest:"invalid_request_error",Authentication:"authentication_error",Permission:"permission_error",NotFound:"not_found_error",RequestTooLarge:"request_too_large",RateLimit:"rate_limit_error",Api:"api_error",Overloaded:"overloaded_error"},hVs=new Map([[400,Fg.InvalidRequest],[401,Fg.Authentication],[402,Fg.Permission],[403,Fg.Permission],[404,Fg.NotFound],[413,Fg.RequestTooLarge],[424,Fg.InvalidRequest],[429,Fg.RateLimit],[466,Fg.InvalidRequest],[529,Fg.Overloaded]]),mXn=1024,mVs=32e3,WX=class{constructor(e){this.ctx=e}static{a(this,"ClaudeMessagesProxyServer")}async start(){if(this._startPromise)return this._startPromise;let e=this._startInternal().catch(r=>{throw this._startPromise===e&&(this._startPromise=void 0),r});return this._startPromise=e,e}async stop(){let e=this._server;e&&(e.closeAllConnections(),await new Promise(r=>e.close(()=>r())),this._server=void 0,this._startPromise=void 0,this._config=void 0)}getConfig(){if(!this._config)throw new Error("ClaudeMessagesProxyServer: start() has not completed yet");return this._config}async _startInternal(){let e=`cls-claude-${Mt()}`,r=AXn.createServer((n,o)=>{this._handleRequest(n,o,e)});return new Promise((n,o)=>{r.once("error",o),r.listen(0,"127.0.0.1",()=>{let s=r.address();if(!s||typeof s!="object"){o(new Error("ClaudeMessagesProxyServer: failed to obtain bound address"));return}this._server=r,this._config={port:s.port,nonce:e},Bg.info(this.ctx,`proxy listening on http://127.0.0.1:${s.port}`),r.removeListener("error",o),n(this._config)})})}async _handleRequest(e,r,n){try{if(Bg.debug(this.ctx,`incoming request: ${e.method} ${e.url}`),e.method==="OPTIONS"){r.writeHead(200),r.end();return}if(e.method==="GET"&&e.url==="/"){r.writeHead(200,{"Content-Type":"text/plain"}),r.end("Hello from ClaudeMessagesProxyServer");return}if(e.method==="POST"&&this._isMessagesPath(e.url)){await this._handleMessagesRequest(e,r,n);return}this._sendErrorResponse(r,404,Fg.NotFound,"Not found")}catch(o){Bg.exception(this.ctx,o,"._handleRequest"),this._sendErrorResponse(r,500,Fg.Api,"Internal proxy error")}}_isMessagesPath(e){if(!e)return!1;let r=e.startsWith("//")?e.slice(1):e,n;try{n=new URL(r,"http://127.0.0.1").pathname}catch{return!1}return n==="/v1/messages"||n==="/messages"}async _handleMessagesRequest(e,r,n){let o=gVs(e.headers,n);if(!o.valid){Bg.error(this.ctx,"rejected request with invalid Authorization header"),this._sendErrorResponse(r,401,Fg.Authentication,"Invalid authentication");return}o.sessionId&&Bg.debug(this.ctx,`authorized request for session ${o.sessionId}`);let s=await IVs(e),c;try{c=JSON.parse(s)}catch(l){Bg.error(this.ctx,`invalid JSON in request body: ${l instanceof Error?l.message:String(l)}`),this._sendErrorResponse(r,400,Fg.InvalidRequest,"Request body is not valid JSON");return}await this._forwardToCAPI(c,s,e.headers,r,o.sessionId)}async _forwardToCAPI(e,r,n,o,s){let c=this.ctx.get(Qt),l=this.ctx.get(tr),u;try{u=await c.getToken()}catch(_){Bg.exception(this.ctx,_,"._forwardToCAPI/getToken"),this._sendErrorResponse(o,401,Fg.Authentication,"Failed to acquire Copilot token");return}let d=await this._lookupModelMetadata(e),f=this._maybeStripCacheControl(e,r),h=this._maybeRewriteThinking(e,f,d,s),m=ile(this.ctx,u,"v1/messages"),g=yVs(this.ctx,n,d),A;try{({headers:A}=await nle(this.ctx,g,u.token))}catch(_){Bg.exception(this.ctx,_,"._forwardToCAPI/applyMsBenchAuth"),this._sendErrorResponse(o,401,Fg.Authentication,"Failed to acquire MSBench credentials");return}let y=new AbortController,E=a(()=>{y.signal.aborted||(Bg.debug(this.ctx,"client disconnected \u2014 aborting upstream request"),y.abort())},"onClose");o.on("close",E);try{let _=await l.fetch(m,{method:"POST",headers:A,body:h,signal:y.signal});if(ole(this.ctx,_,"v1/messages"),!_.ok){let w=await _.text(),R=w.length<=360?w:w.slice(0,360)+"\u2026";Bg.error(this.ctx,`upstream CAPI returned ${_.status} ${_.statusText}: ${R}`),this._sendErrorResponse(o,_.status,xVs(_.status),this._buildTranslatedErrorMessage(_,w,u));return}let v=_.headers.get("content-type")??"text/event-stream";o.writeHead(_.status,{"Content-Type":v,"Cache-Control":"no-cache",Connection:"keep-alive"});let b=_.body();if(!b){o.end();return}let T=v.toLowerCase().includes("text/event-stream");if(s&&T){let w=this.ctx.get(fm),R=wVs(x=>{w.addCopilotUsageNanoAiuForSession(s,x)});await(0,Ifr.pipeline)(b,R,o)}else await(0,Ifr.pipeline)(b,o)}catch(_){if(y.signal.aborted){Bg.debug(this.ctx,"upstream fetch aborted by client disconnect"),o.writableEnded||o.end();return}if(Bg.exception(this.ctx,_,"._forwardToCAPI"),o.headersSent||o.writableEnded){o.destroy();return}this._sendErrorResponse(o,500,Fg.Api,"Upstream request failed")}finally{o.removeListener("close",E)}}async _lookupModelMetadata(e){let r=typeof e.model=="string"?e.model:void 0;if(r)try{return(await this.ctx.get(xs).getMetadata()).find(s=>s.id===r)}catch(n){Bg.debug(this.ctx,`model metadata lookup failed for "${r}": ${n instanceof Error?n.message:String(n)}`);return}}_maybeRewriteThinking(e,r,n,o){if(!n)return xfr(e)?(Bg.debug(this.ctx,"stripped output_config.effort for request with unresolved model metadata"),JSON.stringify(e)):r;let s=o?this.ctx.get(fm).getReasoningEffortForSession(o):void 0;if(s&&n.capabilities?.supports?.adaptive_thinking){let l=n.capabilities?.supports?.reasoning_effort;(!l||!l.includes(s))&&Bg.warn(this.ctx,`dropping unsupported reasoning_effort "${s}" for model ${n.id}; advertised=[${l?.join(",")??""}]`)}return vVs(e,n,s)?(Bg.debug(this.ctx,`normalized thinking field for model ${n.id} to ${n.capabilities?.supports?.adaptive_thinking?"adaptive":"legacy"} shape`),JSON.stringify(e)):r}_maybeStripCacheControl(e,r){return _Vs(e)?(Bg.debug(this.ctx,"stripped unknown sub-fields from cache_control.ephemeral before forwarding to CAPI"),JSON.stringify(e)):r}_buildTranslatedErrorMessage(e,r,n){let o=e.status,s=this._buildReasonForStatus(e,r,n),c=o===429?{capiErrorCode:RVs(r),copilotPlan:n.userInfo?.copilotPlan,suggestSwitchToAuto:!1}:void 0;return $_.translateErrorMessage(o,s,void 0,OU(e),void 0,c)}_buildReasonForStatus(e,r,n){let o=e.status;if(o===402)try{let s=this.ctx.get(Au).overageEnabled;return $_.translate402Reason(r,{retryAfterHeader:e.headers.get("retry-after")??void 0,retryAfterSeconds:OU(e),copilotPlan:n.userInfo?.copilotPlan,isTBBEnabled:n.userInfo?.isTBBEnabled,canUpgradePlan:n.userInfo?.canUpgradePlan,overageEnabled:s})}catch(s){return Bg.exception(this.ctx,s,"._buildReasonForStatus/402"),gXn(r)??"Quota Exceeded."}if(o===400){let s=$_.translate400Reason(r);if(s!==void 0)return s}return gXn(r)}_sendErrorResponse(e,r,n,o){let s={type:"error",error:{type:n,message:o}};e.writeHead(r,{"Content-Type":"application/json"}),e.end(JSON.stringify(s))}};function gVs(t,e){let r=t.authorization;if(typeof r!="string"||!r.startsWith("Bearer "))return{valid:!1,sessionId:void 0};let n=r.slice(7),o=n.indexOf(".");if(o===-1)return{valid:n===e,sessionId:void 0};let s=n.slice(0,o),c=n.slice(o+1).trim();return s===e?{valid:!0,sessionId:c.length>0?c:void 0}:{valid:!1,sessionId:void 0}}a(gVs,"extractSessionId");function AVs(t){let e=t.split(",").map(r=>r.trim()).filter(r=>r&&pVs.some(n=>r===n||r.startsWith(n+"-")));return e.length>0?e.join(","):void 0}a(AVs,"filterSupportedBetas");function yVs(t,e,r){let n=e.accept,o=typeof n=="string"&&n.length>0?n:"text/event-stream",s={...i0(t),"Content-Type":"application/json",Accept:o},c=e["anthropic-beta"],l=Array.isArray(c)?c.join(","):c,u=l?AVs(l):void 0,d=r!==void 0&&!r.capabilities?.supports?.adaptive_thinking,f=EVs(u,d?rYe:void 0);f&&(s["anthropic-beta"]=f);let h=e["user-agent"];if(h){let m=h.indexOf("/");s["User-Agent"]=m===-1?`${Tfr}/${h}`:`${Tfr}${h.substring(m)}`}else s["User-Agent"]=Tfr;return s}a(yVs,"buildUpstreamHeaders");function EVs(t,e){let r=new Set;for(let n of[t,e])if(n)for(let o of n.split(",")){let s=o.trim();s&&r.add(s)}return r.size>0?[...r].join(","):void 0}a(EVs,"mergeBetas");function _Vs(t){let e=!1,r=a(c=>!!c&&typeof c=="object","isObject"),n=a(c=>{if(!r(c))return;let l=c.cache_control;if(r(l)&&l.type==="ephemeral")for(let u of Object.keys(l))u!=="type"&&(delete l[u],e=!0)},"stripBlock"),o=a(c=>{if(Array.isArray(c))for(let l of c)n(l)},"stripBlocks");o(t.system);let s=t.messages;if(Array.isArray(s))for(let c of s){if(!r(c))continue;let l=c.content;if(Array.isArray(l))for(let u of l)n(u),r(u)&&o(u.content)}return o(t.tools),e}a(_Vs,"sanitizeCacheControl");function vVs(t,e,r){if(!e)return!1;let n=t.thinking,o=n&&typeof n=="object"?n.type:void 0;return o==="adaptive"||o==="enabled"?e.capabilities?.supports?.adaptive_thinking?CVs(t,n,e,r):TVs(t,n):bVs(t,e)}a(vVs,"normalizeThinkingForModel");function CVs(t,e,r,n){let o=r.capabilities?.supports?.reasoning_effort,s=!!o&&o.length>0,c=e.type==="adaptive"&&Object.keys(e).length===1,l=t.output_config;if(!s){let h=!!l&&typeof l=="object"&&"effort"in l;return c&&!h?!1:(t.thinking={type:"adaptive"},xfr(t),!0)}let u=SVs(n,o),d=mO(o,u)??"medium",f=typeof l?.effort=="string"&&l.effort===d;return c&&f?!1:(t.thinking={type:"adaptive"},t.output_config={...l??{},effort:d},!0)}a(CVs,"_writeAdaptiveShape");function xfr(t){let e=t.output_config;if(!e||typeof e!="object")return!1;let r=e;return"effort"in r?(delete r.effort,Object.keys(r).length===0&&delete t.output_config,!0):!1}a(xfr,"_deleteEffortKey");function bVs(t,e){let r=e.capabilities?.supports?.reasoning_effort;return!!r&&r.length>0?!1:xfr(t)}a(bVs,"_stripUnsupportedThinkingEffort");function SVs(t,e){if(t&&!(!e||!e.includes(t)))return t}a(SVs,"_normaliseUserEffortForCapi");function TVs(t,e){let r=e.budget_tokens,n=typeof r=="number"&&Number.isFinite(r)&&r>0?r:mXn,o=Math.min(mVs,Math.max(mXn,n)),s=e.type==="enabled"&&e.budget_tokens===o,c=t.output_config!==void 0;return s&&!c?!1:(t.thinking={type:"enabled",budget_tokens:o},c&&delete t.output_config,!0)}a(TVs,"_writeLegacyShape");function IVs(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{n.push(typeof o=="string"?Buffer.from(o,"utf8"):o)}),t.on("end",()=>e(Buffer.concat(n).toString("utf8"))),t.on("error",r)})}a(IVs,"readRequestBody");function xVs(t){return hVs.get(t)??Fg.Api}a(xVs,"mapStatusToAnthropicErrorType");function wVs(t){let e=new EXn.StringDecoder("utf8"),r="",n=0,o=a(s=>{if(!s.startsWith("data:"))return;let c=s.slice(5).trimStart();if(!(!c||c==="[DONE]")&&c.includes("copilot_usage"))try{let u=JSON.parse(c).copilot_usage?.total_nano_aiu;typeof u=="number"&&Number.isFinite(u)&&u>0&&(n=u)}catch{}},"inspectLine");return new yXn.Transform({transform(s,c,l){try{r+=e.write(s);let u=r.indexOf(` -`);for(;u!==-1;){let d=r.slice(0,u).replace(/\r$/,"");r=r.slice(u+1),o(d),u=r.indexOf(` -`)}}catch{}l(null,s)},flush(s){try{r+=e.end(),r&&o(r.replace(/\r$/,"")),n>0&&t(n)}catch{}s()}})}a(wVs,"createCopilotUsageSniffer");function gXn(t){if(t)try{let e=JSON.parse(t),r=e.error;if(r&&typeof r=="object"&&"message"in r){let n=r.message;if(typeof n=="string")return n}if(typeof e.message=="string")return e.message}catch{}}a(gXn,"extractErrorMessage");function RVs(t){if(t)try{let e=JSON.parse(t),r=e.error;if(r&&typeof r=="object"&&"code"in r){let n=r.code;if(typeof n=="string")return n}if(typeof e.code=="string")return e.code}catch{}}a(RVs,"extractErrorCode");p();function _Xn(t){return t.replace(/[-.]/g,"").toLowerCase()}a(_Xn,"normalizeModelId");function vXn(t,e){if(!t||e.some(s=>s.id===t))return t;let r=t.replace(/-\d{8}$/,""),n=_Xn(r);return e.find(s=>_Xn(s.id)===n)?.id??t}a(vXn,"mapCapiModelIdToPickerId");Mo();var Ug=new fe("ClaudeCodeAgent"),Qg="ClaudeCodeAgentService";function kVs(t){return{id:`claude-code:/agents/${encodeURIComponent(t.name)}`,name:t.name,description:t.description,providers:["CLAUDE"],invokePolicy:PUt,isReadonly:!0,isBuiltIn:!0}}a(kVs,"toRuntimeClaudeAgent");var y8=class{constructor(e,r){this.ctx=e;this.sdkWrapper=r;this._sessions=new Map;this.notificationSender=e.get(ts);try{this.runtimeSourceRegistration=e.get(Ld).registerRuntimeAgentSource({provider:"CLAUDE",getAgents:a(async n=>(await this.getSupportedAgentsForWorkspace(n)).map(kVs),"getAgents")})}catch(n){if(!(n instanceof bl&&n.ctor===Ld))throw n}}static{a(this,"ClaudeCodeAgentService")}async getSupportedAgentsForWorkspace(e){let r=new Set(e.map(c=>lg(un(c.uri)))),n=[...this._sessions.values()].filter(c=>r.has(lg(c.cwd)));if(n.length===0)return[];let o=await Promise.all(n.map(c=>c.supportedAgents())),s=new Map;for(let c of o)for(let l of c){let u=l.name.toLowerCase();s.has(u)||s.set(u,l)}return[...s.values()]}async createSession(e){return kb(this.ctx,"claudeCodeAgent.createSession",async r=>{await qZn(this.ctx,e);let n=e.sessionId??Mt(),o=this._sessions.get(n);if(o)return Ug.info(this.ctx,`${Qg}.createSession: returning existing in-memory session`,{sessionId:n}),r.properties.reason="idempotentHit",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:o.cwd};let s=un(e.workspaceFolder.uri),c=await this._ensureProxyConfig(),l=new iNe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:s,model:e.model,isNewSession:!0,proxyConfig:c});return this._sessions.set(n,l),Ug.info(this.ctx,`${Qg}.createSession`,{sessionId:n,cwd:s}),r.properties.reason="created",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:s}})}async resumeSession(e){return kb(this.ctx,"claudeCodeAgent.resumeSession",async r=>{await jZn(this.ctx,e);let{sessionId:n}=e,o,s,c=this._sessions.get(n);if(c)Ug.info(this.ctx,`${Qg}.resumeSession: returning existing in-memory session`,{sessionId:n}),o=c.cwd,s="memory";else{let u=await this.sdkWrapper.getSessionInfo(n);if(!u?.cwd)throw new Error(`Session not found: ${n}`);let d=u.cwd,f=await this._ensureProxyConfig(),h=new iNe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:d,model:e.model,isNewSession:!1,proxyConfig:f});this._sessions.set(n,h),Ug.info(this.ctx,`${Qg}.resumeSession: resumed from SDK transcript`,{sessionId:n,cwd:d}),o=d,s="disk"}let l;try{let u=this.sdkWrapper.getSessionMessages(n,{includeSystemMessages:!0}),d=this.ctx.get(xs).getMetadata().catch(m=>(Ug.debug(this.ctx,`${Qg}.resumeSession: model metadata unavailable for id mapping`,{sessionId:n,error:m instanceof Error?m.message:String(m)}),[])),[f,h]=await Promise.all([u,d]);l=hXn(f,m=>vXn(m,h)),r.properties.transcriptOk="true"}catch(u){Ug.warn(this.ctx,`${Qg}.resumeSession: failed to translate on-disk transcript`,{sessionId:n,error:u instanceof Error?u.message:String(u)}),r.properties.transcriptOk="false",r.properties.transcriptErrorName=u instanceof Error?u.name:"Unknown"}return r.properties.reason=s,r.properties.modelId=e.model??"",r.measurements.eventCount=l?.length??0,{sessionId:n,workspacePath:o,events:l}})}async sendMessage(e,r){return kb(this.ctx,"claudeCodeAgent.sendMessage",async n=>{await HZn(this.ctx,e);let o=e.sessionId,s=this._sessions.get(o);if(!s)throw new Error(`Session not found: ${o} \u2014 call createSession or resumeSession before sendMessage`);let c={uri:Ks(s.cwd)};await this.ctx.get(Cg).applyPromptTemplateToRequest(e,[c]);let l=Mt(),u=performance.now();return s.invoke({message:e.message,references:e.references,model:e.model,permissionMode:e.agentMode,reasoningEffort:e.reasoningEffort,messageId:l,token:r}).catch(d=>{Ug.warn(this.ctx,`${Qg}.sendMessage: invoke rejected`,{sessionId:o,error:d instanceof Error?d.message:String(d)}),Vn(this.ctx,"claudeCodeAgent.sendMessage.failure",d,{success:"false",reason:"invoke"},{totalTimeMs:performance.now()-u})}),n.properties.reason="dispatched",n.properties.modelId=e.model??"",n.properties.hasReferences=String((e.references?.length??0)>0),n.measurements.messageCharLen=e.message.length,n.measurements.referenceCount=e.references?.length??0,{messageId:l}})}truncateHistory(e){return Promise.reject(this.unsupported("truncateHistory"))}async listSessions(e){return kb(this.ctx,"claudeCodeAgent.listSessions",async r=>{VZn(this.ctx,e),Ug.info(this.ctx,`${Qg}.listSessions`,e);let o=(await this.sdkWrapper.listSessions({dir:e.cwd})).map(s=>({sessionId:s.sessionId,summary:s.summary,startTime:new Date(s.createdAt??s.lastModified).toISOString(),modifiedTime:new Date(s.lastModified).toISOString(),isRemote:!1,context:s.cwd!==void 0?{cwd:s.cwd,branch:s.gitBranch}:void 0}));return Ug.info(this.ctx,`${Qg}.listSessions returned`,{count:o.length}),r.measurements.count=o.length,{sessions:o}})}async listModels(e){return kb(this.ctx,"claudeCodeAgent.listModels",async r=>{WZn(this.ctx,{agentProvider:"CLAUDE",forceRefresh:e}),Ug.info(this.ctx,`${Qg}.listModels`,{forceRefresh:e});let s=(await this.ctx.get(xs).getMetadata(e)).filter(c=>c.model_picker_enabled===!0).filter(c=>c.capabilities.type==="chat").filter(c=>w$e(c.capabilities.family)).map(Drt);return Ug.info(this.ctx,`${Qg}.listModels returned`,{count:s.length}),r.properties.forceRefresh=String(e??!1),r.measurements.count=s.length,{models:s}})}async stopSession(e){await kb(this.ctx,"claudeCodeAgent.stopSession",async r=>{GZn(this.ctx,{agentProvider:"CLAUDE",sessionId:e});let n=this._sessions.get(e);if(!n){Ug.info(this.ctx,`${Qg}.stopSession: unknown session`,{sessionId:e}),r.properties.reason="unknownSession";return}await n.interrupt()})}destroySession(e){return kb(this.ctx,"claudeCodeAgent.destroySession",r=>{$Zn(this.ctx,e);let{sessionId:n}=e;try{let o=this._sessions.get(n);return o?(o.dispose(),this._sessions.delete(n),Ug.info(this.ctx,`${Qg}.destroySession`,{sessionId:n}),{success:!0}):(Ug.info(this.ctx,`${Qg}.destroySession: unknown session`,{sessionId:n}),r.properties.reason="unknownSession",{success:!0})}catch(o){return Ug.error(this.ctx,`${Qg}.destroySession: failed`,{sessionId:n,error:o instanceof Error?o.message:String(o)}),r.error=o,r.properties.reason="exception",{success:!1}}})}async setModel(e,r){await kb(this.ctx,"claudeCodeAgent.setModel",async n=>{let o=this._sessions.get(e);if(!o){Ug.info(this.ctx,`${Qg}.setModel: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await rNe(this.ctx,r),await o.setModel(r),n.properties.modelId=r??""})}async setPermissionMode(e,r){await kb(this.ctx,"claudeCodeAgent.setPermissionMode",async n=>{let o=this._sessions.get(e);if(!o){Ug.info(this.ctx,`${Qg}.setPermissionMode: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await o.setPermissionMode(r),n.properties.permissionMode=r??""})}get sessionCount(){return this._sessions.size}unsupported(e){return new Error(`${e} is not supported by ClaudeCodeAgentService`)}handleInteraction(e){let r=this._sessions.get(e.sessionId);if(!r)return Ug.warn(this.ctx,`${Qg}.handleInteraction: unknown session`,{sessionId:e.sessionId,requestId:e.requestId,interactionType:e.type}),Promise.resolve({success:!1});let n=r.respondToInteraction(e);return Promise.resolve({success:n})}getPlanPath(){return Promise.reject(this.unsupported("getPlanPath"))}enableRemote(){return Promise.reject(this.unsupported("enableRemote"))}disableRemote(){return Promise.reject(this.unsupported("disableRemote"))}getRemoteStatus(){throw this.unsupported("getRemoteStatus")}compactHistory(){return Promise.reject(this.unsupported("compactHistory"))}stopCompactHistory(){return Promise.reject(this.unsupported("stopCompactHistory"))}dispose(){this.runtimeSourceRegistration?.dispose(),this.runtimeSourceRegistration=void 0;for(let e of this._sessions.values())e.dispose();this._sessions.clear()}async _ensureProxyConfig(){return this.ctx.get(WX).start()}};p();var wfr=new Cn;function CXn(t){return[...t].sort((e,r)=>{let n=wfr.get(e.uri)??0;return(wfr.get(r.uri)??0)-n})}a(CXn,"sortByAccessTimes");var bXn=a(t=>t.get($r).onDidFocusTextDocument(e=>{e.document&&wfr.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");p();p();p();var SXn=de(require("events"));var Olt="CompletionRequested",t4=class{constructor(e){this.ctx=e}static{a(this,"CompletionNotifier")}#e=new SXn.default;notifyRequest(e,r,n,o,s){return this.#e.emit(Olt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=z0(this.ctx,e,`event.${Olt}`);return this.#e.on(Olt,r),Fn.Disposable.create(()=>this.#e.off(Olt,r))}};p();p();var Rfr=class{constructor(){this.observers=new Set}static{a(this,"Subject")}subscribe(e){return this.observers.add(e),()=>this.observers.delete(e)}next(e){for(let r of this.observers)r.next(e)}error(e){for(let r of this.observers)r.error?.(e)}complete(){for(let e of this.observers)e.complete?.()}},Llt=class extends Rfr{static{a(this,"ReplaySubject")}subscribe(e){let r=super.subscribe(e);return this._value!==void 0&&e.next(this._value),r}next(e){this._value=e,super.next(e)}};var Pb=class{constructor(e){this.ctx=e;this.#e=new fe("AsyncCompletionManager");this.requests=new Cn(100);this.mostRecentRequestId=""}static{a(this,"AsyncCompletionManager")}#e;clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(kfr(e,r,o))return!0;return!1}updateCompletion(e,r){let n=this.requests.get(e);n!==void 0&&(n.partialCompletionText=r,n.subject.next(n))}queueCompletionRequest(e,r,n,o,s){this.#e.debug(this.ctx,`[${e}] Queueing async completion request:`,r.substring(r.lastIndexOf(` -`)+1));let c=new Llt;return this.requests.set(e,{state:2,cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c}),s.then(l=>{if(this.requests.delete(e),l.type!=="success"){this.#e.debug(this.ctx,`[${e}] Request failed with`,l.reason),c.error(l.reason);return}let u={cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c,choice:l.value[0],result:l,state:0,allChoicesPromise:l.value[1]};this.requests.set(e,u),c.next(u),c.complete()}).catch(l=>{this.#e.error(this.ctx,`[${e}] Request errored with`,l),this.requests.delete(e),c.error(l)})}getFirstMatchingRequestWithTimeout(e,r,n,o,s){let c=this.ctx.get(Zt).asyncCompletionsTimeout(s);return c<0?(this.#e.debug(this.ctx,`[${e}] Waiting for completions without timeout`),this.getFirstMatchingRequest(e,r,n,o)):(this.#e.debug(this.ctx,`[${e}] Waiting for completions with timeout of ${c}ms`),Promise.race([this.getFirstMatchingRequest(e,r,n,o),new Promise(l=>setTimeout(()=>l(null),c))]).then(l=>{if(l===null){this.#e.debug(this.ctx,`[${e}] Timed out waiting for completion`);return}return l}))}async getFirstMatchingRequest(e,r,n,o){o||(this.mostRecentRequestId=e);let s=!1,c=new vA,l=new Map,u=a(f=>()=>{let h=l.get(f);h!==void 0&&(h(),l.delete(f),!s&&l.size===0&&(s=!0,this.#e.debug(this.ctx,`[${e}] No matching completions found`),c.resolve(void 0)))},"finishRequest"),d=a(f=>{if(kfr(r,n,f)){if(f.state===0){let h=r.substring(f.prefix.length),{completionText:m}=f.choice;if(!m.startsWith(h)||m.length<=h.length){u(f.headerRequestId)();return}m=m.substring(h.length),f.choice.telemetryData.measurements.foundOffset=h.length,this.#e.debug(this.ctx,`[${e}] Found completion at offset ${h.length}: ${JSON.stringify(m)}`),c.resolve([{...f.choice,completionText:m},f.allChoicesPromise]),s=!0}}else this.cancelRequest(e,f),u(f.headerRequestId)()},"next");for(let[f,h]of this.requests)kfr(r,n,h)?l.set(f,h.subject.subscribe({next:d,error:u(f),complete:u(f)})):this.cancelRequest(e,h);return c.promise.finally(()=>{for(let f of l.values())f()})}cancelRequest(e,r){e===this.mostRecentRequestId&&r.state!==0&&(this.#e.debug(this.ctx,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};function kfr(t,e,r){if(r.prompt.suffix!==e.suffix||!t.startsWith(r.prefix))return!1;let n=t.substring(r.prefix.length);return r.state===0?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(kfr,"isCandidate");p();p();var sNe=class{constructor(e){this.maxSize=e;this.root=new oNe;this.leafNodes=new Set}static{a(this,"LRURadixTrie")}set(e,r){let{node:n,remainingKey:o}=this.findClosestNode(e);if(o.length>0){for(let[s,c]of n.children)if(s.startsWith(o)){let l=s.slice(0,o.length),u=new oNe;n.removeChild(s),n.addChild(l,u),u.addChild(s.slice(l.length),c),n=u,o=o.slice(l.length);break}if(o.length>0){let s=new oNe;n.addChild(o,s),n=s}}n.value=r,this.leafNodes.add(n),this.leafNodes.size>this.maxSize&&this.evictLeastRecentlyUsed()}findAll(e){return this.findClosestNode(e).stack.map(({node:r,remainingKey:n})=>r.value!==void 0?{remainingKey:n,value:r.value}:void 0).filter(r=>r!==void 0)}delete(e){let{node:r,remainingKey:n}=this.findClosestNode(e);n.length>0||this.deleteNode(r)}findClosestNode(e){let r=!0,n=this.root,o=[{node:n,remainingKey:e}];for(;e.length>0&&r;){r=!1;for(let[s,c]of n.children)if(e.startsWith(s)){e=e.slice(s.length),o.unshift({node:c,remainingKey:e}),n=c,r=!0;break}}return{node:n,remainingKey:e,stack:o}}deleteNode(e){if(e.value=void 0,this.leafNodes.delete(e),e.parent===void 0||e.childCount>1)return;let{node:r,edge:n}=e.parent;if(e.childCount===1){let[s,c]=Array.from(e.children)[0];e.removeChild(s),r.removeChild(n),r.addChild(n+s,c);return}if(r.removeChild(n),r.parent===void 0)return;let o=r.parent;if(r.value===void 0&&r.childCount===1){let[s,c]=Array.from(r.children)[0],l=o.edge+s;r.removeChild(s),o.node.removeChild(o.edge),o.node.addChild(l,c)}}evictLeastRecentlyUsed(){let e=this.findLeastRecentlyUsed();e&&this.deleteNode(e)}findLeastRecentlyUsed(){let e;for(let r of this.leafNodes)(e===void 0||r.touchedo.content.filter(s=>s.suffix===r&&s.choice.completionText.startsWith(n)&&s.choice.completionText.length>n.length).map(s=>({...s.choice,completionText:s.choice.completionText.slice(n.length),telemetryData:s.choice.telemetryData.extendedBy({},{foundOffset:n.length})})))}append(e,r,n){let o=this.cache.findAll(e);if(o.length>0&&o[0].remainingKey===""){let s=o[0].value.content;this.cache.set(e,{content:[...s,{suffix:r,choice:n}]})}else this.cache.set(e,{content:[{suffix:r,choice:n}]})}clear(){this.cache=new sNe(100)}};p();var Db=class{constructor(){this.choices=[]}static{a(this,"CurrentGhostText")}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==2&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&TXn(this.choices[0].completionText,n))return PVs(this.choices,n)}hasAcceptedCurrentCompletion(e,r){let n=this.getRemainingPrefix(e,r);if(n===void 0)return!1;let o=n===this.choices?.[0].completionText,s=this.choices?.[0].finishReason;return o&&s==="stop"}getRemainingPrefix(e,r){if(!(this.prefix===void 0||this.suffix===void 0||this.choices.length===0)&&this.suffix===r&&e.startsWith(this.prefix))return e.substring(this.prefix.length)}};function PVs(t,e){return t.filter(r=>TXn(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(PVs,"adjustChoicesStart");function TXn(t,e){return t.startsWith(e)&&t.length>e.length}a(TXn,"startsWithAndExceeds");p();p();var E8={" ":1,"!":2,'"':3,"#":4,$:5,"%":6,"&":7,"'":8,"(":9,")":10,"*":11,"+":12,",":13,"-":14,".":15,"/":16,0:17,1:18,2:19,3:20,4:21,5:22,6:23,7:24,8:25,9:26,":":27,";":28,"<":29,"=":30,">":31,"?":32,"@":33,A:34,B:35,C:36,D:37,E:38,F:39,G:40,H:41,I:42,J:43,K:44,L:45,M:46,N:47,O:48,P:49,Q:50,R:51,S:52,T:53,U:54,V:55,W:56,X:57,Y:58,Z:59,"[":60,"\\":61,"]":62,"^":63,_:64,"`":65,a:66,b:67,c:68,d:69,e:70,f:71,g:72,h:73,i:74,j:75,k:76,l:77,m:78,n:79,o:80,p:81,q:82,r:83,s:84,t:85,u:86,v:87,w:88,x:89,y:90,z:91,"{":92,"|":93,"}":94,"~":95};p();function IXn(t){let e;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>427.50000000000006?t[9]>13.500000000000002?t[121]>1e-35?e=-.3793786744885956:t[149]>1e-35?e=-.34717430705356905:e=-.26126834451035963:e=-.2431318366096852:t[5]>888.5000000000001?e=-.20600463586387135:e=-.2568037008471491:t[308]>1e-35?e=-.2363064824497454:t[8]>370.50000000000006?e=-.37470755210284723:e=-.321978453730494:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?e=-.26259136509758885:e=-.3096719634039438:t[4]>30.500000000000004?t[9]>18.500000000000004?e=-.34254903852890883:t[2]>98.50000000000001?e=-.41585250791146294:e=-.3673574858887241:t[9]>6.500000000000001?e=-.31688079287876225:t[31]>1e-35?e=-.29110977864003823:t[308]>1e-35?e=-.3201411739040839:e=-.36874023066055506:t[8]>691.5000000000001?t[82]>1e-35?e=-.41318393149040566:t[133]>1e-35?e=-.3741272613525161:t[32]>1e-35?e=-.4112378041027121:t[227]>1e-35?e=-.37726615155719356:t[10]>3.5000000000000004?e=-.3164502293560397:e=-.2930071546509045:t[9]>13.500000000000002?e=-.277366858539218:t[308]>1e-35?t[4]>10.500000000000002?e=-.30975610686807187:t[4]>1.5000000000000002?e=-.2549142136728043:e=-.3271325650785176:t[127]>1e-35?t[0]>1937.5000000000002?e=-.2533046188098832:e=-.325520883579:e=-.331628896481776;let r;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?t[9]>13.500000000000002?r=.031231253521808708:r=.05380836288014532:t[5]>423.00000000000006?t[8]>114.50000000000001?r=.06751619128429062:r=.09625089153176467:r=.027268163053989804:t[308]>1e-35?r=.060174483556283756:r=-.049062854038919135:t[3]>24.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?r=-.03969241799174589:r=.01086816842550381:t[31]>1e-35?r=-.003284694817583201:t[9]>6.500000000000001?t[4]>30.500000000000004?r=-.04224490699947552:r=-.011834162944360616:t[308]>1e-35?t[32]>1e-35?r=-.13448447971850278:r=-.019569456707046823:t[19]>1e-35?t[9]>1.5000000000000002?r=-.07256260662659254:t[4]>60.50000000000001?r=-.08227503453609311:r=-.020596416747563847:r=-.07396549241564149:t[8]>691.5000000000001?t[82]>1e-35?r=-.10046536995362734:t[133]>1e-35?r=-.06407649822752297:t[225]>1e-35?r=.08035785003303324:t[92]>1e-35?r=.018901360933204676:t[20]>1e-35?r=.05252546973665552:t[8]>2592.5000000000005?r=-.040543705016462955:r=-.011236043818320725:t[9]>17.500000000000004?r=.025560632674895334:t[308]>1e-35?t[0]>1847.5000000000002?r=.03527165701669741:r=-.0071847350825815035:t[127]>1e-35?r=.024373016379595405:t[9]>2.5000000000000004?r=-.0035090719709448288:r=-.03514829488063766;let n;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?n=.03848674861536988:t[5]>423.00000000000006?t[8]>114.50000000000001?t[9]>56.50000000000001?n=-.003764520033319488:n=.06570817919969299:t[4]>61.50000000000001?n=.028346156293069538:n=.0908154644362606:n=.02445594243234816:t[308]>1e-35?t[8]>65.50000000000001?n=.0019305229020073053:n=.09279357295883772:n=-.04458984161917124:t[3]>24.500000000000004?t[23]>1e-35?n=.0027405390271277013:t[4]>29.500000000000004?t[52]>1e-35?n=.044727478132905285:t[115]>1e-35?n=.10245804828855934:t[9]>17.500000000000004?n=-.03353173647469207:t[2]>98.50000000000001?n=-.10048106638102179:n=-.05484231104348874:t[31]>1e-35?n=.016807537467116516:t[9]>6.500000000000001?n=-.012113620535295137:t[4]>8.500000000000002?t[308]>1e-35?n=-.01882594250504289:n=-.05585658862796076:n=.04279591277938338:t[8]>691.5000000000001?t[82]>1e-35?n=-.09262278043707878:t[133]>1e-35?n=-.058454257768893625:t[32]>1e-35?n=-.09769348447126434:t[25]>1e-35?n=-.0725430043727677:t[122]>1e-35?n=-.10047841601578077:n=-.00580671054458958:t[9]>13.500000000000002?n=.021399199032818294:t[308]>1e-35?t[4]>10.500000000000002?n=-.0076376731757173515:n=.03394923033036848:t[127]>1e-35?n=.02070489091204209:n=-.02290162726126496;let o;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?o=.010230295672324606:o=.038540509248742805:t[8]>125.50000000000001?t[1]>49.50000000000001?o=.03086356292895467:o=.057128750867458604:t[5]>888.5000000000001?o=.07861602941396924:o=.030523262699070908:t[308]>1e-35?o=.048236117667577356:t[8]>370.50000000000006?o=-.05642125069212264:o=-.007232836777168195:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?o=.03640661467213915:o=-.005889820723907028:t[31]>1e-35?o=-.0009007166998276938:t[9]>6.500000000000001?o=-.022590340093882378:t[308]>1e-35?t[32]>1e-35?o=-.1215445089091064:o=-.01435612266219722:t[19]>1e-35?t[9]>1.5000000000000002?o=-.061555513040777825:t[4]>60.50000000000001?o=-.07053475504569347:o=-.013733369453963092:o=-.06302097189114152:t[227]>1e-35?o=-.05820440333190048:t[8]>683.5000000000001?t[82]>1e-35?o=-.08466979526809346:t[10]>24.500000000000004?o=-.017092159721119944:t[92]>1e-35?o=.03592901452463749:o=-.00359310519524756:t[5]>1809.5000000000002?t[243]>1e-35?o=-.03963116207386097:t[118]>1e-35?o=-.09483996283536394:t[217]>1e-35?o=-.03394542089519989:t[242]>1e-35?o=-.07985899422287938:o=.019706602160656964:t[9]>12.500000000000002?o=.014072998937735146:o=-.021156294523894684;let s;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?s=.009197756540516563:s=.03458896869535166:t[5]>5082.500000000001?s=.08265545468131008:t[131]>1e-35?s=.0740738432473315:s=.045159136632942756:t[8]>319.50000000000006?s=-.04653401534465376:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?s=-.011400839766681709:s=.11149800187510031:s=-.08683250977599462:s=.08355310136724753:t[4]>23.500000000000004?t[23]>1e-35?t[131]>1e-35?s=.040389083779932555:s=-.009887614274108602:t[52]>1e-35?s=.03705353499757327:t[9]>6.500000000000001?s=-.025401260429257562:t[2]>98.50000000000001?s=-.09237673187534504:s=-.04298556869281803:t[222]>1e-35?s=-.045221965895986184:t[8]>691.5000000000001?t[133]>1e-35?s=-.05435318330148897:t[128]>1e-35?s=-.08672907303184191:t[227]>1e-35?s=-.05568304584186561:t[122]>1e-35?s=-.09623059693538563:t[225]>1e-35?s=.07558331642202279:t[82]>1e-35?s=-.07360566227233566:s=-.005646164647395919:t[242]>1e-35?s=-.08203758341228108:t[9]>13.500000000000002?s=.018726123829696042:t[308]>1e-35?t[4]>10.500000000000002?s=-.011153942154062704:s=.03132858912391067:t[127]>1e-35?s=.021455228822345174:t[23]>1e-35?s=.01959966745346997:s=-.021764790177579325;let c;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>284.50000000000006?t[121]>1e-35?t[18]>1e-35?c=.07547602514276922:c=-.08529678832140396:c=.030314822344598043:t[5]>888.5000000000001?t[4]>61.50000000000001?c=.011143589009415464:c=.0654700456802118:c=.021794712646632755:t[308]>1e-35?c=.04231872551095028:c=-.034381999950549455:t[4]>23.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?c=-.03678981254332261:c=.010518160384496255:t[8]>825.5000000000001?c=-.04506534842082387:t[9]>38.50000000000001?c=.01004983052203438:c=-.030580958620701027:t[39]>1e-35?c=-.12802435021505382:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>6.500000000000001?c=.030426957004611704:c=-.0726407693060581:c=.017395521646964375:t[4]>7.500000000000001?t[0]>93.50000000000001?t[9]>7.500000000000001?c=-.008024349629981291:t[31]>1e-35?c=.01296539930850471:t[308]>1e-35?c=-.012855016509024084:c=-.04564527976851505:c=-.15681420504058596:t[10]>4.500000000000001?t[243]>1e-35?c=-.1012064426380198:c=-.0062808850924854194:c=.030706323726162416:t[9]>13.500000000000002?c=.017081636133736405:t[308]>1e-35?t[4]>10.500000000000002?c=-.009306613091760644:t[4]>1.5000000000000002?c=.03655523200850989:c=-.02671654212893341:t[127]>1e-35?c=.019261510468604387:c=-.017627818570628936;let l;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[308]>1e-35?l=.036100405995889276:l=.011709313297015793:t[0]>119.50000000000001?t[8]>125.50000000000001?l=.03622542297472574:l=.05595579157301536:l=-.02234751038146796:t[8]>319.50000000000006?l=-.040132029478400735:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?l=-.009306153573847916:l=.10058509567064988:l=-.0785668890966017:t[9]>28.500000000000004?l=-.04781977604130416:l=.09753292614937459:t[4]>23.500000000000004?t[131]>1e-35?l=.02372493254975127:t[148]>1e-35?l=.028103095989516644:t[4]>58.50000000000001?t[10]>1e-35?l=-.05000852203469597:l=.02922366846119705:t[23]>1e-35?l=-.0026335076988151292:l=-.03073993752935585:t[222]>1e-35?l=-.03867374428185713:t[32]>1e-35?l=-.07220729365053084:t[39]>1e-35?l=-.11624524614351733:t[8]>691.5000000000001?t[133]>1e-35?l=-.04836360271198036:t[8]>4968.500000000001?l=-.10873681915578029:t[149]>1e-35?l=-.11847484033769298:t[122]>1e-35?l=-.08916172460307559:t[82]>1e-35?l=-.06774726602152634:l=-.0033469147714351327:t[126]>1e-35?l=-.09474445392080015:t[8]>131.50000000000003?t[118]>1e-35?l=-.09002547031023511:l=.015475385187009489:t[25]>1e-35?l=-.08175501232759151:l=-.000429679055394914;let u;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?u=.021942996005324917:u=.042349138084484074:t[308]>1e-35?u=.036507270845732874:u=-.028981850556764995:t[3]>24.500000000000004?t[23]>1e-35?u=.00210930790963475:t[31]>1e-35?u=.006825358293027163:t[9]>6.500000000000001?u=-.013772084269062394:t[308]>1e-35?u=-.008307929099892574:t[19]>1e-35?u=-.027706313312904487:u=-.04891108984170914:t[134]>1e-35?u=-.0605730733844732:t[25]>1e-35?u=-.05347926493253117:t[227]>1e-35?u=-.049415829249003666:t[32]>1e-35?u=-.06807799662179595:t[308]>1e-35?t[4]>10.500000000000002?t[2]>13.500000000000002?u=-.00016302718260794637:u=-.10247095758122947:t[210]>1e-35?u=-.022149002072787024:t[95]>1e-35?u=.15222631630626304:u=.027393884520465712:t[9]>7.500000000000001?t[225]>1e-35?u=.13483346577752245:t[3]>9.500000000000002?t[243]>1e-35?u=-.045352728133789516:t[8]>683.5000000000001?u=.00474372227519902:u=.02635476098707525:t[92]>1e-35?u=.05659380819933452:t[105]>1e-35?u=.07431443210341222:t[186]>1e-35?u=.0915821133384904:u=-.016414750130401053:t[127]>1e-35?u=.011824693641866162:t[23]>1e-35?u=.0228468674288774:t[284]>1e-35?u=.06606936863302432:u=-.02872463273902358;let d;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>125.50000000000001?t[288]>1e-35?d=-.019844363904157558:t[1]>50.50000000000001?t[131]>1e-35?d=.044961338592245194:d=.003659599513761676:t[121]>1e-35?d=-.04057103630479994:d=.03158560697078578:t[0]>421.50000000000006?t[4]>61.50000000000001?d=-.0003708603406529278:d=.05331312264472391:d=.0006575958601218936:t[8]>319.50000000000006?d=-.034654694051901545:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?d=-.0076053515916517005:d=.09116695486305336:d=-.07137458699162028:d=.06633130654035282:t[4]>29.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?d=-.0308520802187302:d=.013156423968295541:t[115]>1e-35?d=.11581171687488252:t[52]>1e-35?t[10]>22.500000000000004?d=.12264179915175587:d=-.021905727233873535:t[8]>799.5000000000001?d=-.04181869575935412:d=-.023695901673350575:t[222]>1e-35?d=-.034612899265371776:t[8]>691.5000000000001?t[9]>98.50000000000001?d=-.06892116536821917:t[149]>1e-35?d=-.11194586444154514:t[133]>1e-35?d=-.04269583234000504:t[128]>1e-35?d=-.0644631966969502:t[8]>4968.500000000001?d=-.09650726096330133:d=-.004219129180139438:t[126]>1e-35?d=-.08038306745347751:t[5]>1809.5000000000002?d=.009265335288169993:t[9]>2.5000000000000004?d=.006447645462117438:d=-.021047132609551503;let f;t[13]>1e-35?t[3]>1.5000000000000002?t[9]>21.500000000000004?t[121]>1e-35?f=-.08436540015142402:t[8]>1861.5000000000002?f=-.01621425699342421:f=.01878613821895428:f=.031052879158242532:t[8]>319.50000000000006?f=-.031536619360997865:t[7]>3.5000000000000004?f=-.004510586962343298:f=.0596524941011746:t[4]>18.500000000000004?t[23]>1e-35?f=.004757490541310808:t[9]>6.500000000000001?f=-.008842393772207996:t[31]>1e-35?f=.0010536183837006993:t[308]>1e-35?f=-.008145882815435419:t[2]>98.50000000000001?f=-.08404937622173021:t[276]>1e-35?f=.0020072791321856663:t[19]>1e-35?f=-.023031820639490178:f=-.04553314326377875:t[8]>2134.5000000000005?f=-.02244583113572251:t[134]>1e-35?f=-.05592137394753121:t[308]>1e-35?t[49]>1e-35?f=.09989109704064947:t[4]>10.500000000000002?t[2]>13.500000000000002?f=-.00447733056482096:f=-.10191061664873849:f=.021765308380331864:t[9]>7.500000000000001?t[118]>1e-35?f=-.07570059131536411:t[243]>1e-35?f=-.040983393346598646:t[3]>9.500000000000002?f=.014763759061483812:t[92]>1e-35?f=.05136368898963024:f=-.008162398981149495:t[127]>1e-35?f=.013999119696708346:t[23]>1e-35?t[20]>1e-35?f=.14138985500120907:f=.008668274102844162:t[284]>1e-35?f=.06356484011042893:f=-.024781304572706303;let h;t[13]>1e-35?t[3]>8.500000000000002?t[8]>892.5000000000001?t[0]>384.50000000000006?h=.014387526569215037:t[8]>2266.5000000000005?h=-.1397298649743087:h=.007953931014097788:t[0]>119.50000000000001?t[4]>61.50000000000001?h=.0029819092211896296:t[218]>1e-35?h=.08450459375645737:h=.031646488019280654:h=-.03544960151460596:t[9]>9.500000000000002?h=-.026002317735915183:t[7]>1.5000000000000002?h=.005074258810794793:h=.0745247650477651:t[4]>29.500000000000004?t[131]>1e-35?h=.023269218675640847:t[148]>1e-35?h=.03812942399144545:t[115]>1e-35?h=.10512283476967227:h=-.02607307479736138:t[227]>1e-35?h=-.036576708299046294:t[101]>1e-35?h=.027948683650881864:t[149]>1e-35?h=-.08195628451594297:t[50]>1e-35?h=-.16997544922278504:t[8]>691.5000000000001?t[9]>101.50000000000001?h=-.06860333850762075:t[225]>1e-35?h=.06066641950951723:t[10]>22.500000000000004?t[1]>29.500000000000004?t[127]>1e-35?h=.028599705845427533:h=-.010746719511640914:t[0]>4877.500000000001?h=-.07251187886096228:h=-.021299712241446785:t[118]>1e-35?h=-.11902023760964736:h=15874469526809387e-21:t[8]>267.50000000000006?h=.01317292185402293:t[148]>1e-35?t[9]>20.500000000000004?h=.09614842415142123:h=.006049073167176467:t[189]>1e-35?h=.05562696451900713:h=-.006257541923837303;let m;t[13]>1e-35?t[9]>14.500000000000002?t[2]>11.500000000000002?t[1]>71.50000000000001?t[8]>1252.5000000000002?m=-.10069846585436666:m=-.010577995535809317:t[146]>1e-35?m=-.008877238274428668:t[280]>1e-35?m=.10076055897012692:t[6]>70.50000000000001?m=-.020603523042565547:t[7]>1.5000000000000002?m=.02819095420813202:m=-.1223354167911277:m=-.025073583348334844:t[8]>416.50000000000006?m=.01718560189149466:t[230]>1e-35?m=.12281803224342265:m=.03281276971308565:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?m=-.13070568109867683:t[4]>63.50000000000001?m=-.027221825262496814:m=.01530862490082352:t[9]>6.500000000000001?t[5]>4320.500000000001?t[2]>31.500000000000004?m=-.00605574271293711:m=.04739407327741249:m=-.012537528620315956:t[31]>1e-35?t[20]>1e-35?m=.1252215087035768:m=.003905888677601057:t[52]>1e-35?m=.045466299731038815:t[2]>100.50000000000001?m=-.07815624550168065:t[308]>1e-35?m=-.007715815250508057:t[276]>1e-35?t[9]>1.5000000000000002?m=-.03538265083203445:t[18]>1e-35?m=.1591211669800727:m=.015151475408241136:t[8]>557.5000000000001?m=-.04225569725456342:m=-.022455546324243267:t[308]>1e-35?m=.01325441736085826:t[197]>1e-35?m=.03752194600682512:t[225]>1e-35?m=.06583712394533976:m=-.005205289866839043;let g;t[13]>1e-35?t[9]>21.500000000000004?t[2]>12.500000000000002?g=.010264022580774884:g=-.02335958814489217:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?g=-.0936747137352166:t[0]>384.50000000000006?g=.019846244507320695:g=-.0751102554077272:g=-.026885329334203723:t[0]>966.5000000000001?t[10]>48.50000000000001?g=.11654906890054273:g=.0346250587613322:t[4]>39.50000000000001?g=-.08568002378645614:t[9]>16.500000000000004?g=-.12010535752923689:g=.021321923389033808:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?g=-.12056431231412057:t[131]>1e-35?g=.03652965550568472:g=.002563006128791669:t[9]>6.500000000000001?t[30]>1e-35?g=-.10141481732178981:g=-.003936457893178248:t[31]>1e-35?g=.008215898756249477:t[52]>1e-35?t[0]>4188.500000000001?g=.12972828769588213:g=-.003137412232297087:t[2]>100.50000000000001?g=-.0730872929087944:t[308]>1e-35?g=-.006958622747243333:t[35]>1e-35?t[0]>3707.5000000000005?g=.07934620723812878:g=-.018598568353702116:g=-.030635505446410763:t[128]>1e-35?g=-.06962290453843294:t[84]>1e-35?g=-.15290337844960322:t[308]>1e-35?t[8]>2543.5000000000005?g=-.034938657503885584:g=.016339322898966915:t[197]>1e-35?g=.03358907965870046:t[18]>1e-35?g=-.01754013791515288:g=-.0004944586067698557;let A;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?A=.005888790687820524:A=.0429676533834978:t[2]>7.500000000000001?t[0]>119.50000000000001?t[6]>79.50000000000001?A=-.0224319889201976:t[212]>1e-35?A=.06249587051783863:t[8]>963.5000000000001?t[8]>1156.5000000000002?A=.010357273289123324:A=-.029749145161304082:t[218]>1e-35?A=.06449336340743606:A=.018047654539345502:A=-.07350502390293116:A=-.019594829995832414:t[4]>39.50000000000001?A=-.019338083179859314:t[39]>1e-35?A=-.10427066919173111:t[222]>1e-35?t[0]>612.5000000000001?A=-.019197415255018464:A=-.0836562507048181:t[149]>1e-35?A=-.07679624472577429:t[32]>1e-35?A=-.05097506748590604:t[191]>1e-35?A=.04670476485250936:t[30]>1e-35?A=-.05313073892148652:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>8.500000000000002?A=.03930363008271334:A=-.06029171685615689:A=.016203086182431294:t[4]>7.500000000000001?A=-.013824248237085224:t[10]>4.500000000000001?t[94]>1e-35?A=-.09817668643367765:t[10]>40.50000000000001?A=-.023558078753593125:A=.0065113494780482326:t[8]>809.5000000000001?t[297]>1e-35?A=-.1352063548573715:A=.058203900441270634:A=-.035243959159285736:t[10]>59.50000000000001?t[1]>43.50000000000001?A=-.012552876807800442:A=.05991247777734298:A=.0035893102109330177;let y;t[13]>1e-35?t[9]>21.500000000000004?t[145]>1e-35?y=.03507251990078782:t[2]>14.500000000000002?y=.004905698363309292:t[8]>2421.5000000000005?y=-.10306119951984316:y=-.018951037816654928:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?y=-.08503171085833393:y=.015130974593044409:y=-.024425267075198206:y=.02624054905103126:t[4]>19.500000000000004?t[131]>1e-35?y=.02100191580704534:t[32]>1e-35?t[8]>2302.5000000000005?y=.09908783187786288:y=-.06920877329925636:t[8]>241.50000000000003?y=-.016756131804203496:t[9]>33.50000000000001?y=.04903179955263626:t[217]>1e-35?y=-.047416847619291644:y=-.0017200891991431119:t[39]>1e-35?y=-.10389927604977028:t[134]>1e-35?y=-.050480365434872866:t[178]>1e-35?y=-.05167855791556937:t[8]>2134.5000000000005?y=-.01663197335585307:t[242]>1e-35?y=-.05361323756615453:t[118]>1e-35?y=-.05299780866211368:t[10]>24.500000000000004?t[10]>55.50000000000001?t[8]>764.5000000000001?y=-.0016544848369620534:y=.04494144460483587:y=-.009283616456736156:t[121]>1e-35?t[0]>4463.500000000001?y=.051166688553608355:y=-.06623908820705383:t[84]>1e-35?y=-.12990936092409747:t[306]>1e-35?y=-.07020596855118943:t[49]>1e-35?y=.06272964802556856:t[192]>1e-35?y=.06540204627162581:y=.008277910531592885;let E;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?E=.003325460510319164:E=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?E=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?E=.0697359767152808:t[230]>1e-35?E=.06513506845651572:E=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?E=.013616385013146277:E=.04171540100223404:E=-.04360396575094823:t[212]>1e-35?E=.025945477945627522:E=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?E=-.07856453318384411:E=-.014803893522351739:t[39]>1e-35?E=-.09185452630751932:t[149]>1e-35?E=-.07122426086157027:t[134]>1e-35?E=-.04231052091434186:t[227]>1e-35?E=-.029815824273994197:t[50]>1e-35?E=-.15736496271211153:t[222]>1e-35?E=-.02360285356956629:t[128]>1e-35?E=-.03922080193836443:t[136]>1e-35?E=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?E=-.0029736170756835783:E=-.06482902102259112:t[84]>1e-35?E=-.11340924635708383:t[94]>1e-35?E=-.03635703457792193:t[118]>1e-35?E=-.058181913914186034:t[126]>1e-35?E=-.062030576241517366:t[116]>1e-35?E=-.045086301850604006:t[25]>1e-35?E=-.031665223656767286:t[203]>1e-35?E=-.009444685731407691:E=.0112265153772187;let _;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?_=.022717227245241684:_=-.049700413274686266:_=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?_=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?_=-.12263724050601095:_=.0070743478891288035:t[288]>1e-35?_=-.050439138582109:_=.0255701593657891:_=-.005812703740580558:t[6]>49.50000000000001?_=-.008542694147899113:_=.035147383686665:_=-.0960461939274094:t[32]>1e-35?_=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?_=-.01800870272656664:_=-.07817304234604389:t[30]>1e-35?_=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?_=.08778416018479411:_=-.026563982720830256:_=-.05296139548112329:t[50]>1e-35?_=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?_=-.036572140520852024:t[183]>1e-35?_=-.10766853736801459:_=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?_=.09513215942486053:_=-.03641865277445567:t[10]>59.50000000000001?_=.03177172388687933:t[39]>1e-35?_=-.10234241303898953:t[243]>1e-35?_=-.02966738115984321:t[190]>1e-35?_=-.04312785336449181:t[118]>1e-35?_=-.05808521194081524:_=.006720381600740378;let v;t[308]>1e-35?t[5]>423.00000000000006?t[133]>1e-35?v=-.046284053681928526:t[210]>1e-35?v=49778070699847876e-21:t[13]>1e-35?v=.03328070054739309:t[128]>1e-35?v=-.054790214922938896:t[126]>1e-35?v=-.08524792218532945:v=.014414055975542446:t[1]>38.50000000000001?v=-.07287851335872973:v=.005263371501687163:t[9]>7.500000000000001?t[21]>1e-35?t[10]>4.500000000000001?v=-.12459748864088374:v=-.004626323021331593:t[298]>1e-35?t[4]>64.50000000000001?v=.13044981041138526:t[9]>71.50000000000001?v=-.056068402282406865:t[9]>12.500000000000002?v=.038957722962512764:v=-.04598815982492169:t[8]>691.5000000000001?t[126]>1e-35?v=-.0852126122372075:t[225]>1e-35?v=.10082066771689505:t[1]>161.50000000000003?v=-.11609832500613824:t[3]>8.500000000000002?t[8]>1685.5000000000002?v=-.010835400874777133:v=.004607419973807752:v=-.016989075258564062:v=.009205417251698097:t[23]>1e-35?t[20]>1e-35?v=.10184317139657878:t[0]>5724.500000000001?v=-.1163666496650542:t[1]>106.50000000000001?v=.1303850608190687:t[129]>1e-35?v=.10745031509534769:v=.006166901738036226:t[31]>1e-35?v=.010177092833155127:t[13]>1e-35?t[0]>213.50000000000003?v=.005004582564506611:v=-.10481581731668346:t[19]>1e-35?v=-.009850706427306281:v=-.02608226348051303;let b;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?b=-.0024117174588695603:b=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?b=.04575380761203418:b=-.10025595041353463:t[15]>1e-35?b=.17705790384964004:b=.0073813837628615014:b=.07676373681392407:b=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?b=.07078572910026419:t[4]>23.500000000000004?b=.005513918674164821:b=.0206586476926392:t[0]>5269.500000000001?b=.07706773525822633:b=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?b=-.03204783603215824:b=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?b=-.0930246911392012:b=.011173087289703683:t[3]>24.500000000000004?b=.03281421918878597:b=.12449335091369843:t[204]>1e-35?b=.06634531187326123:b=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?b=-.041196758517013515:t[4]>7.500000000000001?b=-2942718111029724e-20:t[4]>6.500000000000001?b=.11953909558532852:b=.03188615019450534:t[122]>1e-35?b=-.0616037324662157:t[101]>1e-35?b=.027230889593349412:t[8]>4968.500000000001?b=-.1113986516540856:t[3]>2.5000000000000004?b=-.002045140426885727:t[129]>1e-35?b=.12641163374304432:b=.014909826232873194;let T;t[308]>1e-35?t[0]>7277.500000000001?T=-.09337446795435:t[5]>423.00000000000006?t[133]>1e-35?T=-.040884836258675006:t[210]>1e-35?T=-.0003719413278428804:t[13]>1e-35?T=.030287610160818174:T=.011174130013595384:t[1]>38.50000000000001?T=-.0662442170185784:T=.004332185707008564:t[9]>7.500000000000001?t[145]>1e-35?t[285]>1e-35?T=-.08092286307197555:T=.029866363328584986:t[21]>1e-35?t[10]>4.500000000000001?T=-.1155211149523894:T=-.0032903546638958538:t[149]>1e-35?T=-.03632198993199768:t[3]>9.500000000000002?t[8]>999.5000000000001?T=-.003507023626534306:t[128]>1e-35?t[4]>13.500000000000002?t[0]>3459.5000000000005?T=-.025416927789760076:T=.02777568919793122:T=-.10310351509769732:T=.013549608903688785:t[186]>1e-35?T=.08513865847420551:T=-.009306721292510369:t[31]>1e-35?T=.009780833952582307:t[23]>1e-35?T=.011143773934157629:t[210]>1e-35?T=.025354797285173356:t[17]>1e-35?t[10]>3.5000000000000004?T=-.04846287537743046:T=-.014647271080376757:t[2]>5.500000000000001?t[7]>57.50000000000001?T=-.034224938681445764:t[8]>1641.5000000000002?T=-.027298372075800673:t[191]>1e-35?t[10]>18.500000000000004?T=-.027950103994861836:T=.14575930827829034:T=-.007124740389354946:t[10]>22.500000000000004?T=.013173304107866726:T=-.11119620042551365;let w;t[131]>1e-35?w=.01892225243240137:t[308]>1e-35?t[5]>691.5000000000001?t[133]>1e-35?w=-.037118314390013646:t[1]>51.50000000000001?t[5]>3749.5000000000005?t[8]>58.50000000000001?w=-.022305242912035072:w=.024792895826340516:w=.013666137278072166:t[88]>1e-35?t[10]>27.500000000000004?w=.2080083584805785:w=.04247197078083379:t[10]>40.50000000000001?t[18]>1e-35?t[1]>27.500000000000004?w=.060783227455868206:w=-.056904865557409035:w=-.03278952553107572:t[192]>1e-35?w=.13117402617043625:w=.01647119888257836:w=-.01825870445636398:t[9]>6.500000000000001?t[298]>1e-35?w=.026536210945939682:t[8]>691.5000000000001?t[126]>1e-35?w=-.07927319604548912:t[10]>3.5000000000000004?t[21]>1e-35?w=-.11083976837572328:t[146]>1e-35?w=-.03359294484446772:w=-.0042815953591236475:t[190]>1e-35?w=-.09264239592903775:t[10]>1e-35?w=.022282638485105657:w=-.0205994057928458:t[5]>4918.500000000001?w=.03430715695199153:t[243]>1e-35?t[2]>57.50000000000001?w=.08935072241972036:w=-.03781647876237494:w=.0062655753179671515:t[31]>1e-35?w=.008603500300349887:t[230]>1e-35?w=.03350056932774173:t[23]>1e-35?t[241]>1e-35?w=.10277555508503314:w=.0017901817172993888:t[2]>98.50000000000001?w=-.05920081229672715:w=-.015722173275739208;let R;t[13]>1e-35?t[118]>1e-35?R=.07957905150112207:t[1]>125.50000000000001?R=-.0662620579858685:t[145]>1e-35?R=.029682040828779843:t[19]>1e-35?t[6]>15.500000000000002?R=-.0009597832580977798:R=-.081474760755753:t[212]>1e-35?R=.03637001492325179:R=.006912305498963309:t[32]>1e-35?R=-.03919900630910754:t[134]>1e-35?R=-.036225295529777886:t[4]>4.500000000000001?t[5]>384.50000000000006?t[204]>1e-35?R=.06671440854602108:t[136]>1e-35?R=-.07577364230133474:t[148]>1e-35?t[4]>7.500000000000001?R=.026430947016830915:R=-.04075501264495112:t[9]>93.50000000000001?R=-.04353169430417609:t[50]>1e-35?R=-.1411224537622882:t[17]>1e-35?t[49]>1e-35?R=.068392679163672:t[10]>1.5000000000000002?R=-.0209659792007492:R=-.0004393235559249831:t[133]>1e-35?t[9]>64.50000000000001?R=.07254524592323175:R=-.0319087835282534:R=.00037444813327793425:R=-.025138768151370408:t[243]>1e-35?R=-.050010891710502096:t[94]>1e-35?R=-.0817513550778599:t[122]>1e-35?R=-.061038875809822285:t[19]>1e-35?t[8]>1085.5000000000002?R=-.008408408775061623:t[2]>5.500000000000001?t[218]>1e-35?R=.1454877641381946:R=.053787998331240316:t[9]>33.50000000000001?R=.08602629796680285:R=-.03895127455803038:R=.008830878042315722;let x;t[131]>1e-35?x=.01687979707990516:t[8]>2915.5000000000005?t[297]>1e-35?x=.07473600489975568:t[0]>93.50000000000001?x=-.021596848506011502:x=-.13840802327735696:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?x=.10264284346448256:x=.031042487183181262:x=-.016653982936827776:t[4]>60.50000000000001?t[10]>75.50000000000001?x=.04226403420647408:t[10]>1e-35?t[0]>4733.500000000001?x=.006271403149804702:x=-.030013637555715046:t[0]>4449.500000000001?x=-.06556876058654929:x=.06437994816903034:t[32]>1e-35?x=-.043814577251655815:t[308]>1e-35?t[0]>7277.500000000001?x=-.09349726304052086:t[210]>1e-35?x=-.0035960132209098003:t[5]>691.5000000000001?t[133]>1e-35?x=-.029188394315052574:x=.017219308333820193:x=-.017378928852189585:t[9]>6.500000000000001?t[0]>2653.5000000000005?t[149]>1e-35?x=-.04428555753857688:x=.0001456106867817353:t[5]>213.50000000000003?x=.01740292726636365:x=-.011361718115556464:t[7]>4.500000000000001?t[0]>316.50000000000006?t[19]>1e-35?t[10]>54.50000000000001?x=.03410288911259329:t[121]>1e-35?x=-.06056527462120627:t[8]>2592.5000000000005?x=.12166808844363577:t[191]>1e-35?x=.11669879218998758:x=-.001664858391716235:x=-.01262927450503166:x=-.04506589951879664:t[227]>1e-35?x=-.08548904959752329:x=.02156080776537726;let P;t[306]>1e-35?t[149]>1e-35?P=-.1389218965136736:P=-.032218642644416894:t[13]>1e-35?P=.006465035217331847:t[50]>1e-35?P=-.1381687930130022:t[179]>1e-35?P=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?P=-.03262719498763048:P=.023342916702125613:t[191]>1e-35?P=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?P=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?P=-.09989343595668776:P=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?P=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?P=-.09165257825246746:t[9]>32.50000000000001?P=.02484870392366004:P=-.008499493096971395:t[8]>24.500000000000004?P=.02459679192828244:P=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?P=.0015644546318714849:P=-.06579524865022705:P=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?P=.03331853632960164:P=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?P=-.019091477207111116:P=.037878468575478504:t[94]>1e-35?P=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?P=.16919658785098224:t[243]>1e-35?P=-.06580584936754524:P=.01567555159935563:t[129]>1e-35?P=.06721746994993226:t[10]>32.50000000000001?P=-.046394462507797975:P=-.006436180519584767;let D;t[131]>1e-35?D=.015039096856208693:t[8]>779.5000000000001?t[145]>1e-35?D=.019122095523977856:t[298]>1e-35?D=.023828936462317443:t[1]>23.500000000000004?t[5]>384.50000000000006?t[7]>59.50000000000001?D=-.026094309429557913:t[204]>1e-35?D=.09163404305658318:t[1]>27.500000000000004?t[149]>1e-35?t[6]>34.50000000000001?D=.012643810980689466:D=-.07884161741497837:D=-.0025267379810891104:t[2]>43.50000000000001?t[0]>2860.5000000000005?D=.04493082949897325:D=.18046359750455776:t[7]>18.500000000000004?D=-.018667348656891496:D=.02584325784698236:D=-.045696524897545915:t[0]>3321.5000000000005?t[201]>1e-35?D=.04749240016989375:D=-.0333334578246718:t[5]>3276.5000000000005?D=.11330554740098908:t[7]>94.50000000000001?D=.1296600395033268:D=-.003576436308940934:t[15]>1e-35?t[183]>1e-35?D=-.13787130789142835:t[0]>1847.5000000000002?D=.017915229729920556:t[10]>23.500000000000004?t[10]>31.500000000000004?t[6]>7.500000000000001?D=.028856848462727104:D=-.11197632885851168:D=.08169801342016791:t[1]>22.500000000000004?D=-.021052888644970163:D=.019048604298876753:t[7]>4.500000000000001?D=-.002603328695276418:t[7]>1.5000000000000002?t[2]>5.500000000000001?D=.03432638833359197:D=-.0036767863082454973:t[1]>48.50000000000001?D=.03087375270128195:t[2]>3.5000000000000004?D=-.04219917149740248:D=.018818493993207935;let N;t[306]>1e-35?N=-.04076858123502297:t[13]>1e-35?t[1]>67.50000000000001?t[9]>14.500000000000002?t[9]>53.50000000000001?t[8]>1971.5000000000002?N=-.09091897542577475:N=.04042943082645558:t[218]>1e-35?N=.056254985867151:N=-.053848117950183044:N=.003881630017086845:t[5]>5152.500000000001?t[8]>857.5000000000001?t[6]>28.500000000000004?N=.021581808008986944:N=-.05639286496176611:N=.052838875036198954:t[5]>50.50000000000001?t[5]>4082.5000000000005?t[17]>1e-35?N=.023061479860228728:t[145]>1e-35?t[9]>10.500000000000002?N=.023885302967553288:N=.1617794086125622:t[212]>1e-35?N=.04504545345658806:t[3]>17.500000000000004?t[4]>45.50000000000001?N=-.03948072448245435:t[1]>47.50000000000001?t[9]>18.500000000000004?N=.01894935813286188:N=-.06449356357429188:N=.012297239104320094:t[1]>26.500000000000004?t[8]>33.50000000000001?N=-.034718828212885515:N=.0898976288814321:t[1]>17.500000000000004?N=-.15440137451988326:N=-.03864183216821465:N=.009988507307006308:N=-.08540311947043305:t[50]>1e-35?N=-.13323659732101975:t[134]>1e-35?N=-.031820386486894385:t[32]>1e-35?t[8]>2302.5000000000005?N=.08082476177379844:N=-.041665761903645876:t[179]>1e-35?N=-.12405023987936657:t[39]>1e-35?N=-.06247416524997478:t[138]>1e-35?N=-.10724031753676487:N=-.0005423122305122404;let L;t[308]>1e-35?L=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?L=.023223358334607133:L=-.04383410185346742:L=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?L=.023406489302867494:L=-.085521220804058:L=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?L=.028120059780969632:L=-.04211009474298743:t[294]>1e-35?L=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?L=-.0993035220737934:L=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?L=.029770210551187937:L=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?L=.06421359317599738:L=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?L=.024368404612215164:L=-.04045232374803373:t[131]>1e-35?L=.017372701982485795:t[120]>1e-35?L=.08812710275150198:t[18]>1e-35?t[90]>1e-35?L=.18451364351180236:t[7]>33.50000000000001?L=-.03850813130183531:t[195]>1e-35?L=.06966114053446336:t[3]>16.500000000000004?L=-.0012869181693341211:t[0]>4242.500000000001?L=-.054625548611291035:L=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?L=.006302103427145562:L=.13967622319898698:t[121]>1e-35?L=-.038798585213145644:t[5]>4544.500000000001?L=-.08050498033009466:L=-.002986974112681435;let B;t[0]>384.50000000000006?t[2]>101.50000000000001?t[1]>16.500000000000004?B=-.03461119351456781:B=.05659026566680352:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?B=-.12404435523286539:B=-.0034376913880382956:B=-.09821622245095822:t[131]>1e-35?t[9]>1.5000000000000002?B=.0037507103585310234:B=.03610387965829944:t[8]>999.5000000000001?t[9]>137.50000000000003?B=-.11985021663179699:t[0]>1847.5000000000002?t[126]>1e-35?B=-.04832024079663151:t[37]>1e-35?B=-.037103393468366934:B=-.004248086592531705:t[8]>3084.0000000000005?t[9]>43.50000000000001?B=.032539071163832034:t[5]>1643.5000000000002?B=.036408625378035665:t[0]>1500.5000000000002?B=-.1346358322854993:B=-.027586559522081014:t[3]>1e-35?t[190]>1e-35?B=-.1133991164577881:t[9]>52.50000000000001?B=-.024478640359723122:B=.03673777861098756:B=-.1037451237591819:t[230]>1e-35?t[9]>48.50000000000001?t[10]>20.500000000000004?B=.002583438691776944:B=.10773520810108106:t[9]>12.500000000000002?t[1]>16.500000000000004?B=-.02141222346712401:B=.06392462314316179:t[4]>12.500000000000002?B=.08700122294434816:t[8]>267.50000000000006?B=.056923170082743224:B=-.07716309825583327:t[32]>1e-35?B=-.03961343943752142:B=.002674914122888783:t[1]>42.50000000000001?B=-.05217539654421676:t[145]>1e-35?B=.09553630282946368:B=-.009424791262477729;let q;t[183]>1e-35?q=-.05753337139158443:t[308]>1e-35?q=.00562436671450989:t[9]>7.500000000000001?t[21]>1e-35?t[10]>8.500000000000002?q=-.10477869875380448:q=-.0070301869937306055:t[3]>9.500000000000002?t[8]>1765.5000000000002?t[0]>4571.500000000001?q=-.12526505173232894:t[10]>1e-35?t[9]>71.50000000000001?q=-.04442302951713574:q=.00012409888451734224:q=-.092199119633697:t[225]>1e-35?q=.13773072450201831:t[0]>2882.5000000000005?q=.0028540012229920533:t[298]>1e-35?q=.07134486044361629:q=.014297412329837425:t[145]>1e-35?q=.05608385321902638:t[92]>1e-35?q=.038298413603926135:t[107]>1e-35?t[2]>6.500000000000001?q=-.0039957800609801315:q=.0776927564241081:t[203]>1e-35?q=-.05502900859432093:t[105]>1e-35?q=.06062892720841595:q=-.009574839629252128:t[31]>1e-35?q=.009488858841144216:t[23]>1e-35?t[20]>1e-35?q=.08818126313644752:t[8]>161.50000000000003?q=.014353968957885408:q=-.022240738532827903:t[210]>1e-35?q=.024648862719806694:t[2]>5.500000000000001?t[4]>4.500000000000001?t[17]>1e-35?t[10]>16.500000000000004?q=-.043902062079383485:q=-.014741559220396223:q=-.00934935734853194:t[6]>32.50000000000001?q=.1514593126307404:q=.010771222510801532:t[10]>22.500000000000004?q=.01412495209334078:q=-.08576940379502533;let M;t[0]>384.50000000000006?t[84]>1e-35?M=-.06647690967306838:t[2]>101.50000000000001?M=-.024451334501552457:t[306]>1e-35?M=-.034517188927733505:t[131]>1e-35?t[9]>1.5000000000000002?M=.0031858381443673127:M=.032574927024450646:t[204]>1e-35?t[1]>62.50000000000001?M=-.08601340441214533:t[1]>29.500000000000004?M=.10487598629539963:t[8]>597.5000000000001?M=-.0786529133673238:M=.08689436600511559:t[8]>779.5000000000001?t[10]>2.5000000000000004?t[9]>100.50000000000001?M=-.04883600353740688:t[126]>1e-35?M=-.03794042763348827:M=-.003358871967539988:t[210]>1e-35?M=.054991356498447566:t[6]>19.500000000000004?M=-.007418396981635549:M=.018032606049498613:t[18]>1e-35?t[7]>35.50000000000001?t[2]>44.50000000000001?M=-.02143003429501711:M=-.09016000554055564:t[1]>19.500000000000004?t[1]>42.50000000000001?t[8]>17.500000000000004?M=-.006636355416244082:M=-.06483095743431454:t[4]>21.500000000000004?M=-.028975965946833545:M=.022012264796522657:M=-.06653648243193663:t[5]>4593.500000000001?M=.01753551428088607:t[217]>1e-35?M=-.028864824937700297:t[94]>1e-35?M=-.04885192273020658:t[279]>1e-35?M=.08105715462329498:t[121]>1e-35?M=-.04576676034750651:M=.004795141324949362:t[1]>42.50000000000001?M=-.047446619702809195:t[145]>1e-35?M=.08400495571952321:M=-.00854528836489364;let O;t[294]>1e-35?O=-.042529778074638265:t[266]>1e-35?O=-.1180276669679798:t[134]>1e-35?O=-.026818144353279623:t[183]>1e-35?O=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?O=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?O=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?O=-.03049646619610203:t[1]>50.50000000000001?O=.20634590755061122:O=.06956378103625731:t[0]>3770.5000000000005?O=-.07946414366134913:t[19]>1e-35?O=.17083312065604694:t[2]>21.500000000000004?O=-.02327981978127724:O=.129717297518715:t[145]>1e-35?O=.006891245076133524:O=-.0789123467863741:t[3]>99.50000000000001?O=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?O=.06447639919732716:O=-.05457561977645972:t[306]>1e-35?O=-.029995903305383882:t[191]>1e-35?O=.030596508110850414:t[242]>1e-35?O=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?O=.09518584795377832:O=-.018197744600833596:t[13]>1e-35?O=.006751790086127549:t[148]>1e-35?O=.01904174573618417:t[99]>1e-35?O=.025287735102561926:t[4]>14.500000000000002?O=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?O=-.09467943982430241:t[243]>1e-35?O=-.02521824751996268:O=.005437570718352172:O=-.022476214821960674;let j;t[0]>384.50000000000006?t[84]>1e-35?j=-.06088131453064195:t[147]>1e-35?j=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?j=.04219361472548491:j=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?j=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?j=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?j=-.11431764534511478:j=.013549717238356157:j=-.020987333767091276:t[6]>2.5000000000000004?j=-.02914877855133127:j=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?j=-.10087072787978416:t[37]>1e-35?j=-.030467397753331196:t[229]>1e-35?j=-.1017559811057469:t[4]>20.500000000000004?j=-.00413177742240167:t[20]>1e-35?j=.05213315982685969:j=.0037921635866823133:t[8]>51.50000000000001?j=.07327913092421544:t[6]>49.50000000000001?j=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?j=.02744420891894289:j=.11288946357194463:j=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?j=-.012329314369909049:j=.026816658655600168:j=-.0872405354618811:j=.007872673500247845:t[1]>42.50000000000001?j=-.04309044198258254:t[145]>1e-35?j=.07572529147860785:t[7]>5.500000000000001?j=-.013837187093264945:t[1]>17.500000000000004?j=.04208698439539668:j=-.06284346769019863;let Q;t[294]>1e-35?Q=-.0384794324818203:t[266]>1e-35?Q=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?Q=.07432960094940501:Q=-.035248735855751855:t[134]>1e-35?Q=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?Q=-.01706896375068821:Q=.08212247914968074:t[2]>59.50000000000001?Q=-.09546478958824225:t[6]>53.50000000000001?Q=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?Q=.02816463285971267:Q=.15449139016588445:Q=-.10199787406123524:Q=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?Q=-.13924786681478077:Q=-.0072772442570213335:t[39]>1e-35?Q=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?Q=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?Q=-.11174465335620831:Q=.00013144040097180107:Q=-.08493919336681105:t[42]>1e-35?Q=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?Q=-.015540659878839153:Q=-.14442609417300142:t[21]>1e-35?Q=-.025251979447574083:Q=.0023698372645272847:t[18]>1e-35?Q=.07269739695712212:t[8]>2592.5000000000005?Q=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?Q=-.01835130329646532:t[9]>45.50000000000001?Q=.02023047454629885:Q=.16469378262221102:Q=-.042975030085836426;let U;t[8]>2915.5000000000005?t[297]>1e-35?U=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?U=-.01034964686484714:U=-.07357437440667927:U=-.11987794734779106:t[298]>1e-35?t[8]>81.50000000000001?t[0]>3370.5000000000005?t[8]>155.50000000000003?t[8]>660.5000000000001?t[8]>2134.5000000000005?U=-.09476398869062203:t[9]>72.50000000000001?U=-.0757383854264379:U=.02806542779508718:U=-.05147742568418084:U=.10212721564444344:U=.0518263760642861:U=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?U=-.10669213185972036:U=.027050434286384796:t[302]>1e-35?U=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?U=.06354599160071946:t[1]>67.50000000000001?U=.05317447949011187:U=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?U=-.09369289448773599:t[0]>2215.5000000000005?U=.04077965380363924:t[0]>807.5000000000001?U=-.0591771776458298:U=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?U=-.016323380219241672:U=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?U=.03720704290087811:U=-.008730548158766654:t[4]>80.50000000000001?U=-.05346644687473197:U=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?U=.019984510398089086:U=-.03917825025861855:t[9]>170.50000000000003?U=-.09759719821334525:U=-.0023586682752856298;let Y;t[183]>1e-35?t[17]>1e-35?Y=.030100940443356424:t[10]>1.5000000000000002?Y=-.10861112216742408:Y=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?Y=-.032062878390325456:Y=-.10808232631806887:t[8]>1641.5000000000002?Y=-.06147013392655731:t[4]>12.500000000000002?Y=.03324767551088266:t[145]>1e-35?Y=.028851633810612017:Y=-.054871239091792784:t[134]>1e-35?Y=-.023813968121342108:t[266]>1e-35?Y=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?Y=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?Y=-.025350325484720576:Y=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?Y=.056817276537534815:Y=-.07674158463557636:Y=-.06335553143454145:t[1]>56.50000000000001?Y=.16390494217299284:Y=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?Y=.041717597065890205:Y=-.10357913492269129:t[10]>29.500000000000004?Y=.1365512866715726:Y=.020600048310575665:Y=.09708785634773187:Y=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?Y=-.03146213719547347:Y=.11784024316238083:Y=-.050940520532045355:Y=-.047988344143075616:t[191]>1e-35?Y=.028764654731460032:Y=.0011911575567860023;let W;t[294]>1e-35?t[10]>50.50000000000001?W=-.11630092297244568:t[0]>2432.5000000000005?t[0]>4199.500000000001?W=-.05103908560370243:W=.05002066201169583:W=-.09976646725732496:t[32]>1e-35?t[0]>4242.500000000001?W=-.0648838712201258:t[5]>3721.5000000000005?t[9]>4.500000000000001?W=.127983140816313:W=-.05436534163636867:W=-.024514536544596455:t[121]>1e-35?t[0]>4449.500000000001?t[4]>9.500000000000002?W=-.009504203657088933:t[8]>819.5000000000001?W=.18689664822602375:W=.03635576744011826:W=-.029862411809998525:t[223]>1e-35?W=-.06474496692999487:t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?W=-.09405026597863717:t[0]>4153.500000000001?W=.053577663326799765:W=-.05062127873995668:W=.06512222894425874:t[39]>1e-35?W=-.04985311717827547:t[51]>1e-35?W=-.04541229517934797:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?W=-.02860634573675884:W=.08863753005590103:W=.11158892111063744:t[0]>655.5000000000001?W=-.031005736641654926:W=-.1439827004505974:t[222]>1e-35?t[1]>11.500000000000002?t[0]>612.5000000000001?W=-.00843386136334982:W=-.05273594615999777:W=.1060183822015004:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?W=-.015774115523598486:W=.10147367091236065:W=-.048307000563071016:W=.002118376117677254;let V;t[8]>1014.5000000000001?t[9]>137.50000000000003?V=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?V=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?V=.07211107542565391:V=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?V=-.0751486415451188:t[1]>59.50000000000001?V=.13459005084554104:V=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?V=.06715575425741895:V=-.005895690393702183:t[8]>2915.5000000000005?V=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?V=-.00029068886245881074:V=.0613467393188786:t[148]>1e-35?V=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?V=.003887223773199377:V=-.08553893131979015:V=.025654192706396767:V=-.05651733979610658:V=-.02039913645229667:t[2]>7.500000000000001?V=-.1058450646728524:V=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?V=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?V=.1283258201586378:V=-.01718135372229775:V=-.07702452408491414:t[125]>1e-35?V=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?V=.04273051857848212:V=-.04533122948101463:t[2]>196.50000000000003?V=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?V=.0231032972703664:V=-.04807386814498683:V=.002729435991332102;let z;t[179]>1e-35?z=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?z=.026484626664041125:t[10]>1.5000000000000002?z=-.10187000872941615:z=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?z=.09574540795390041:z=-.06454986703691233:z=-.11411849349353141:t[266]>1e-35?z=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?z=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?z=-.04403391373512386:z=.1132928075412222:t[2]>47.50000000000001?z=-.09700191391838056:z=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?z=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?z=-.001668912999010927:z=-.02363511102970245:t[8]>58.50000000000001?z=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?z=.0911011436534449:t[1]>28.500000000000004?z=-.07192390493729035:z=.06913818091291246:z=-.012312625373699222:z=.06784496312307986:z=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?z=.0026564453057705273:z=-.025425772389361445:t[122]>1e-35?z=-.12046786388602149:t[0]>3183.5000000000005?z=.01162092842804907:t[91]>1e-35?z=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?z=-.0001647792543020228:z=-.023664538532907665:z=.01609078206180752;let ie;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ie=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ie=-.017696526862422682:ie=.1450050954613223:ie=-.05406930069823832:ie=-.08308700260259043:t[120]>1e-35?ie=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ie=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ie=.038431826961746934:ie=-.05937462906539856:t[9]>65.50000000000001?ie=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ie=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ie=-.09579030954062734:ie=.025064711572811746:ie=.02579440518821548:ie=.1044440128091862:ie=-.058348633139536844:ie=.07766788227934436:ie=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ie=.07463684068207214:ie=.18244269035484484:t[6]>39.50000000000001?ie=-.06050050067471004:ie=.05787759066913493:ie=.010783225857972171:ie=.1674891243602606:t[4]>9.500000000000002?ie=-.004814132027475892:ie=-.14543299413454813:ie=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ie=-.07634466313617769:ie=.0287825335169114:ie=-.06894721943300268:ie=-.00023988459059521937;let H;t[131]>1e-35?t[1]>93.50000000000001?H=-.05706887458825395:t[2]>1.5000000000000002?H=.011446637886629108:H=-.10616119878749211:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?H=.08424281276381033:t[3]>17.500000000000004?t[20]>1e-35?H=.11146885439601915:t[8]>61.50000000000001?t[0]>3530.5000000000005?t[9]>48.50000000000001?t[9]>61.50000000000001?H=.026278724448495064:H=.17053138400480508:t[0]>4463.500000000001?H=-.06482289890096041:H=.03026516489536295:H=-.031785170717683144:H=.1312690622980455:t[13]>1e-35?H=.14336922540461444:H=.03523850945454039:H=-.015407465968975714:t[39]>1e-35?H=-.054809635385158186:t[32]>1e-35?t[0]>4242.500000000001?H=-.0659975068798723:H=-.008386582621403979:t[4]>60.50000000000001?t[10]>75.50000000000001?t[3]>107.50000000000001?H=-.04225314193574262:t[3]>70.50000000000001?t[1]>29.500000000000004?H=.057409156184759516:H=.2024322059866388:H=-.030670938454461245:t[10]>1e-35?t[0]>4733.500000000001?H=.010648654146284154:t[308]>1e-35?H=.008728141696325391:t[4]>64.50000000000001?t[298]>1e-35?H=.12364025998551711:H=-.02247495081065243:t[1]>22.500000000000004?H=-.0726295464624251:H=.03481895086048152:t[0]>4331.500000000001?H=-.04775443357020673:H=.07172377425057568:t[2]>89.50000000000001?H=-.11782645274716962:H=.00010092665257989378;let re;t[147]>1e-35?re=-.041560228567115574:t[302]>1e-35?t[10]>47.50000000000001?re=.062292114082780084:t[10]>5.500000000000001?t[7]>22.500000000000004?re=-.016101990375700172:t[0]>2579.5000000000005?re=-.13045089661551845:re=-.02874367814784938:re=.025835149631944995:t[167]>1e-35?t[0]>3928.5000000000005?re=.17084176915326055:re=-.019195947948312853:t[222]>1e-35?t[30]>1e-35?t[1]>36.50000000000001?t[8]>45.50000000000001?t[8]>578.5000000000001?t[1]>67.50000000000001?re=.10591712319944074:re=-.024082167264285:re=.16497698867036126:re=-.04985066326861431:t[0]>1937.5000000000002?t[2]>16.500000000000004?re=-.021012910475524206:re=-.13058422554298485:t[0]>1102.5000000000002?re=.10955864175201457:re=-.03566689354348996:t[1]>11.500000000000002?re=-.02093884208606101:re=.09107244766183857:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?re=-.013861861436128482:re=.09756849802202777:t[224]>1e-35?t[1]>51.50000000000001?re=.10163873449625677:re=-.02779270277623805:t[1]>26.500000000000004?re=-.08035058228527389:re=.0005719695099064484:t[191]>1e-35?t[9]>9.500000000000002?re=-.007028075523033826:re=.0489470913925288:t[1]>61.50000000000001?t[132]>1e-35?re=.11230846723576784:t[0]>350.50000000000006?t[2]>1.5000000000000002?re=-.0032075580718124892:re=-.04442829143298883:re=-.06597073245775804:re=.0015594090939337751;let le;t[223]>1e-35?t[8]>668.5000000000001?le=-.12803889879260094:le=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?le=.08967966612917375:t[1]>39.50000000000001?le=-.059791671514498074:le=.05648934961902822:t[2]>59.50000000000001?le=-.08633234097449628:t[6]>53.50000000000001?le=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?le=.025606129643140924:le=.13835395886271978:le=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?le=-.09975506556937946:t[10]>36.50000000000001?le=-.09427724661655643:t[10]>24.500000000000004?le=.07329330653410447:le=-.02271182965807972:le=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?le=-.05082091374050816:le=.1687114435254966:t[0]>2314.5000000000005?le=-.06422664016383926:le=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?le=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?le=-.1274167728754332:le=.01308079126447365:t[4]>73.50000000000001?le=.13854015371106546:t[4]>48.50000000000001?le=-.03684255740123261:t[6]>45.50000000000001?le=.10329912215813097:t[10]>77.50000000000001?le=-.08630788656925215:le=.031022006843800853:t[1]>25.500000000000004?le=-.08278381528048026:le=.06664374548141594:t[84]>1e-35?le=-.05624227409079396:le=.00012184182357340415;let Le;t[179]>1e-35?Le=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Le=-.07595415373151816:Le=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Le=.022822510448266862:Le=.17491569312933697:Le=-.058362287133533565:t[2]>2.5000000000000004?Le=-.03633895806364428:Le=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Le=-.07294848747514579:Le=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Le=-.07009535282685533:t[8]>2640.0000000000005?Le=-.051761240111316276:t[131]>1e-35?Le=-.06245774419231631:Le=.03495606662854905:Le=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Le=.0015036626973581122:Le=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Le=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Le=.022343994371919224:Le=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Le=.07724450228328664:t[0]>3853.5000000000005?Le=-.15671707454435677:t[10]>28.500000000000004?Le=-.10179090671841723:Le=.014878216919760927:Le=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Le=.14054154485273487:Le=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Le=-.08632985141410315:Le=.005524157938954954:Le=-.08802502622523681:Le=-.0004649168897260341;let ge;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ge=-.007458687464321174:ge=-.09444966249102484:t[1]>23.500000000000004?ge=.08564129697360716:ge=-.07105002902845851:ge=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ge=-.10326216566705966:t[1]>26.500000000000004?ge=.0050539832484585365:ge=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ge=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ge=.05783632021087773:t[10]>17.500000000000004?ge=-.06720598671764105:t[1]>47.50000000000001?ge=.097495825172558:ge=-.013372242800584872:ge=-.06463226787713715:t[42]>1e-35?ge=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ge=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ge=.11051270080118503:ge=.027719462817590454:t[8]>597.5000000000001?ge=-.08441503592016869:ge=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ge=-.12190088985091102:ge=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ge=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ge=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ge=.016585157185448045:ge=-.11032043771149425:ge=.01586986028570486:t[8]>388.50000000000006?ge=-.10592413013261853:ge=.04930703248769364:t[13]>1e-35?ge=.003621937787920821:ge=-.0013786331198611841;let Ue;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Ue=.009769895322846493:Ue=-.10620052926943656:t[9]>19.500000000000004?Ue=.03781202525403449:t[9]>14.500000000000002?Ue=-.11485785321365344:t[9]>6.500000000000001?Ue=.07677177833073881:t[0]>4342.500000000001?Ue=-.07079285609687631:t[49]>1e-35?Ue=.06156814809246001:Ue=-.014788509042554625:Ue=-.032659201618470655:t[5]>5207.500000000001?Ue=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Ue=-.03094160322187924:t[1]>29.500000000000004?Ue=.09474646043921069:Ue=.023445783928231618:Ue=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Ue=-.07164443768784848:t[1]>29.500000000000004?Ue=.089473622509272:t[8]>597.5000000000001?Ue=-.08155349903101317:Ue=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Ue=-.004003900679358653:t[190]>1e-35?Ue=-.09236113461485262:t[8]>3198.5000000000005?Ue=-.0124130160451179:Ue=.018453070064009328:t[15]>1e-35?Ue=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Ue=-.0009580759587680961:Ue=-.03227283036698222:Ue=.01369287669536875:t[1]>50.50000000000001?Ue=-.04213060332500437:t[35]>1e-35?Ue=-.11508095777767471:t[190]>1e-35?Ue=-.08611884672400155:t[297]>1e-35?Ue=.05723551879433584:Ue=-.004829340082311461;let ke;t[183]>1e-35?ke=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?ke=-.11753465135886734:ke=-.007515490299047085:ke=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?ke=-.12371142493530439:t[1]>36.50000000000001?ke=.032189417575190435:ke=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?ke=-.0784518658439288:t[2]>54.50000000000001?ke=.12477882322370665:ke=.000313468482399738:ke=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?ke=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?ke=.0353146070135579:ke=-.06327619611098285:ke=.02813577701641991:ke=-.12354390728506215:t[34]>1e-35?ke=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?ke=-.01245803535276381:ke=-.07169472553475001:t[1]>11.500000000000002?ke=.12989984824561698:ke=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?ke=.010390226893521422:t[10]>14.500000000000002?ke=.16790888126487719:ke=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?ke=-.043398307129729134:ke=.09963544907820426:t[9]>30.500000000000004?ke=-.13540713124984502:t[9]>17.500000000000004?ke=.0509435850590757:ke=-.04761897852404613:t[4]>78.50000000000001?ke=.09197086656470652:ke=.0006771050176682337;let X;t[122]>1e-35?t[6]>36.50000000000001?X=.05686884451670743:X=-.05334759543084309:t[266]>1e-35?X=-.08603579519816038:t[157]>1e-35?X=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?X=-.0499592651503952:t[0]>725.5000000000001?X=.11780353905132664:X=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?X=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?X=-.03190157229022304:X=.07985197845805492:X=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?X=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?X=-.027174047777029083:X=.057117284879796476:t[3]>43.50000000000001?X=-.0016147040913107311:X=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?X=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?X=-.01466076988151239:X=.13375695925484857:X=-.04885873081899647:t[0]>5566.500000000001?X=.11086813028591343:t[8]>992.5000000000001?X=-.07622304217072383:X=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?X=.03285858361708423:X=-.12354858211764992:X=.0672788301823281:t[15]>1e-35?X=.08658836986585006:X=-.02741484278509758:t[290]>1e-35?X=-.08161310335133287:t[135]>1e-35?X=-.04824156054814152:X=.0009156904299554183;let ee;t[3]>7.500000000000001?ee=.0006791852818377787:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ee=.03642374718166293:ee=.16379973756366603:ee=-.03946685266127979:t[186]>1e-35?ee=.07618896623420895:t[96]>1e-35?ee=.0680272261319657:t[107]>1e-35?t[1]>48.50000000000001?ee=-.022822371600847505:ee=.0501405836324949:t[203]>1e-35?t[1]>77.50000000000001?ee=.044416424920571296:ee=-.0648450593196238:t[5]>3921.5000000000005?t[1]>110.50000000000001?ee=-.11110466767595227:t[9]>5.500000000000001?t[9]>52.50000000000001?t[1]>50.50000000000001?ee=.1061937286809567:t[7]>54.50000000000001?ee=.11487507743121311:t[8]>819.5000000000001?ee=-.07181278009001418:t[10]>25.500000000000004?ee=.13499019430369633:t[1]>31.500000000000004?ee=.09032979489780704:ee=-.12754166393372374:t[9]>37.50000000000001?ee=-.05093963635361407:ee=-.005026651151683848:t[9]>2.5000000000000004?ee=.07619735785573735:ee=.012363301341532136:t[26]>1e-35?ee=-.10685800454968203:t[8]>125.50000000000001?t[8]>446.50000000000006?t[0]>3842.5000000000005?ee=-.08783796894105043:t[282]>1e-35?t[1]>47.50000000000001?t[9]>40.50000000000001?ee=-.10764172927882483:ee=.01890760098464703:ee=.06573095405846417:t[8]>634.5000000000001?ee=-.00783575973273707:ee=-.050612689680229306:t[1]>22.500000000000004?ee=-.0016842490401359626:ee=.0738227088444087:ee=-.02663970950432175;let K;t[31]>1e-35?t[8]>17.500000000000004?K=.013678038624884814:t[1]>35.50000000000001?t[1]>51.50000000000001?K=.007191286124908192:K=-.09347881647636902:t[10]>1.5000000000000002?K=.07938758708008091:K=-.008702935600305113:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?K=.12321804057595996:K=-.018281109320672437:t[23]>1e-35?t[4]>62.50000000000001?K=-.04644244754790671:K=.024546310702263208:t[8]>862.5000000000001?t[0]>3429.5000000000005?t[4]>9.500000000000002?t[52]>1e-35?K=.0706108609273337:t[2]>40.50000000000001?K=-.028046629962303716:K=-.06497613993109329:K=.01076489668586676:t[1]>33.50000000000001?t[0]>966.5000000000001?t[2]>14.500000000000002?t[1]>38.50000000000001?K=-.03056331974267756:K=-.11886389712497057:K=.053364962175658184:t[8]>2233.5000000000005?K=-.0448152521157682:K=.1508651602190868:t[2]>33.50000000000001?t[0]>2882.5000000000005?t[0]>3183.5000000000005?K=.03818796510453344:K=.23673992112982362:K=.02858814226507374:t[10]>44.50000000000001?K=-.1125863771551199:K=.009129996952394916:t[1]>7.500000000000001?K=-.004374525302461639:K=-.07858519434925451:t[149]>1e-35?t[6]>23.500000000000004?K=.0005231594491642136:t[0]>4053.5000000000005?t[8]>660.5000000000001?K=-.13677189943034931:t[10]>2.5000000000000004?K=.039591891437078086:K=-.09312596849507347:K=-.02423172142089822:K=.0009836986075266283;let he;t[189]>1e-35?t[0]>5269.500000000001?he=-.103183298350443:t[2]>51.50000000000001?he=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?he=-.05186168947388339:he=.0496996365539082:t[10]>23.500000000000004?he=.1404445738719:t[93]>1e-35?he=.0027146310074558505:t[5]>3821.5000000000005?he=.002153033152069652:t[4]>2.5000000000000004?he=.007663539551317215:he=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?he=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?he=-.021479467709980358:he=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?he=.021660293256233334:he=-.0927396152303864:he=.0665074081601698:t[0]>1550.5000000000002?he=.08972407105958534:he=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?he=.06761927942466854:he=-.015762168112653286:t[17]>1e-35?he=.10311304131145381:he=-.017672785252336027:he=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?he=-.10638321435298535:he=.0007073011744385905:t[18]>1e-35?he=-.027056185501334325:t[145]>1e-35?he=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?he=.09762140519655171:t[9]>110.50000000000001?he=-.06581942957595835:t[6]>54.50000000000001?he=.04959634035251596:he=.0022616298654554207:he=-.007437620924990854;let Z;t[179]>1e-35?Z=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?Z=.1470294450403005:Z=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?Z=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?Z=.07965955447707423:t[10]>10.500000000000002?Z=-.09236156404262426:Z=.03396273196231458:Z=-.13246465021467432:Z=.07092822261735353:Z=-.08753829085942:Z=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?Z=.004705878789890202:Z=.13775378964952867:Z=-.04770928980587811:t[10]>29.500000000000004?Z=.011221519891071544:t[0]>3853.5000000000005?Z=.06365381191628273:Z=.15506252245336827:t[1]>37.50000000000001?Z=-.07254777021042061:Z=.026514587757252385:t[308]>1e-35?Z=.04115804816617256:t[10]>26.500000000000004?Z=.02077721353011946:t[5]>3548.5000000000005?Z=-.1280907116663952:Z=-.021974774274438:t[306]>1e-35?Z=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?Z=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?Z=-.005710865560475598:t[94]>1e-35?Z=-.06751507982853555:Z=.027250040757588703:t[9]>52.50000000000001?Z=.07060357924595577:Z=-.030297760713011795:Z=-.0006005400085266517;let ue;t[113]>1e-35?ue=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?ue=-.06996356565314456:ue=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?ue=-.08317707559926495:t[21]>1e-35?ue=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?ue=-.010538203005984922:ue=.08454819465349446:t[9]>124.50000000000001?ue=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?ue=-.08542251249346582:t[9]>50.50000000000001?ue=-.023428882537657472:ue=.010042500833979073:ue=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?ue=.03006025206979096:t[9]>108.50000000000001?ue=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?ue=.04222035773042132:ue=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?ue=-.07209095448054853:ue=.028065954981903313:ue=.08714651929917122:ue=-.006678820669279169:t[10]>40.50000000000001?ue=.006982396294941626:ue=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?ue=-.09351114982645548:t[4]>3.5000000000000004?ue=-.004837550129223451:ue=-.08324141237464677:t[303]>1e-35?ue=.10703037493990825:t[9]>156.50000000000003?ue=-.10803018621648303:t[116]>1e-35?ue=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?ue=.10261721665006701:ue=.018994509090668264:ue=.0011244262442038839;let qe;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?qe=-.08404263465005328:t[0]>3682.5000000000005?qe=.041259223920298876:t[1]>29.500000000000004?qe=-.09541257493441671:qe=.001482192721625409:qe=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?qe=-.08268996098437432:t[230]>1e-35?qe=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?qe=-913218977737457e-19:t[4]>10.500000000000002?qe=-.056334165674005156:t[127]>1e-35?qe=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?qe=-.04231200150318989:t[10]>42.50000000000001?qe=.10182973257894812:qe=.015934763950068445:qe=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?qe=-.041117068322885315:qe=.1167767830037126:qe=.13611206992387337:t[10]>41.50000000000001?qe=-.07120286010564107:qe=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?qe=-.07702290997669524:t[198]>1e-35?qe=.08776558554437136:qe=-.008290740324975692:t[2]>32.50000000000001?qe=.07198457624219955:qe=.005463113714361629:qe=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?qe=.03295785445437507:qe=.15140250150674536:qe=-.035613213948910254:t[186]>1e-35?qe=.06849425535860769:t[96]>1e-35?qe=.06028225812727254:qe=-.007582543288662308;let ne;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ne=.08396556264106572:ne=-.0562516995099192:ne=-.10593011018789432:t[183]>1e-35?t[15]>1e-35?ne=-.09705176473553752:t[7]>18.500000000000004?t[2]>37.50000000000001?ne=.0052017514017035915:ne=-.11194119432743639:ne=.03724337696163019:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?ne=-.025692451287403446:ne=-.09511862672123193:t[8]>1661.5000000000002?t[10]>37.50000000000001?ne=-.11892250746801664:t[10]>22.500000000000004?ne=.07548493166973796:ne=-.05973048107712209:t[4]>12.500000000000002?t[0]>4319.500000000001?t[10]>4.500000000000001?t[10]>37.50000000000001?ne=.13750699058082427:t[18]>1e-35?ne=.06535408879552801:ne=-.054118179035040674:ne=.1344282838979622:t[0]>3982.5000000000005?ne=-.10409582202467015:t[19]>1e-35?ne=.12672850705810795:t[8]>587.5000000000001?t[1]>35.50000000000001?ne=.012705935670766466:ne=.14149359442527545:ne=-.047977876173706004:t[20]>1e-35?ne=.057945228080337946:t[0]>3642.5000000000005?ne=-.008726535792122467:ne=-.08424769891378858:t[34]>1e-35?ne=-.0699329538228602:t[134]>1e-35?t[11]>1e-35?t[4]>15.500000000000002?t[0]>1187.5000000000002?ne=.01196849566739346:ne=.1614642278429876:ne=-.043022338150701625:t[3]>5.500000000000001?ne=-.03907848255033881:ne=.018280601026175593:ne=.0006654540402589085;let ce;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?ce=-.01386103677247845:ce=.11386694333005128:t[4]>27.500000000000004?ce=-.021862617610091336:t[2]>31.500000000000004?ce=.0828858469030438:ce=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?ce=.11303635767048735:ce=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?ce=-.04238798044549342:ce=.022091190130494303:t[5]>5082.500000000001?ce=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?ce=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?ce=-.04291104140431434:t[17]>1e-35?ce=.11256797532342613:ce=-.017206916368289193:ce=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?ce=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?ce=.03581712466863222:ce=.14770264307668884:t[8]>73.50000000000001?ce=-.13093289429740068:ce=.042461737442702936:t[52]>1e-35?ce=.0501831919044939:ce=-.010450249720465756:ce=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?ce=.0005381332165438493:ce=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?ce=.04849637311285226:ce=-.036671377119808564:t[0]>421.50000000000006?ce=.00020968499911058945:ce=.11636422423182405:ce=-.12687837788222575:ce=.0012774367867215346;let Ne;t[120]>1e-35?Ne=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Ne=-.042799574885345304:Ne=.07412430171193245:Ne=-.11248270469336048:t[193]>1e-35?Ne=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Ne=.028911612178122104:Ne=.12326369727728437:t[0]>4091.5000000000005?Ne=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ne=.1159839898100149:Ne=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Ne=-.0216343737351583:Ne=-.1220272260878369:t[2]>18.500000000000004?Ne=.09152924475072398:t[8]>55.50000000000001?Ne=.039508716651005665:Ne=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Ne=.06793009902674053:Ne=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Ne=-.04391068849624096:Ne=.04009967593394672:t[8]>1085.5000000000002?Ne=-.024773826356034825:Ne=-.13919707884246582:Ne=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Ne=-.11567917501901476:Ne=-.006813640337684114:t[3]>7.500000000000001?Ne=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Ne=-.001754586408351048:Ne=-.055422422450722056:Ne=-.06090032532532226:t[0]>5269.500000000001?Ne=.11787981735983527:Ne=-.00198119768540783:Ne=.00210412924303036;let we;t[294]>1e-35?t[10]>50.50000000000001?we=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?we=-.06063239096209816:we=.03317022411417386:we=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?we=-.013608609329298802:we=.09078000157330264:t[99]>1e-35?we=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?we=-.07536137260189814:we=.006253266595455118:t[10]>28.500000000000004?we=-.006106041147592768:t[9]>156.50000000000003?we=-.11828932797811101:t[94]>1e-35?we=-.02566078479505714:t[303]>1e-35?we=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?we=-.08401252789168523:t[5]>4244.500000000001?we=.026372887658499107:t[1]>16.500000000000004?we=-.027836756345634026:we=.09205362097909099:we=.00934612788718244:t[203]>1e-35?we=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?we=-.09580979052540028:t[1]>50.50000000000001?we=-.06402211827281554:we=.08342858760095972:t[2]>36.50000000000001?we=.008114897658204584:t[92]>1e-35?we=.09541587072672864:we=-.022342147210555434:we=-.01660492519175128:we=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?we=.15846731118501817:we=.039498507912023195:t[245]>1e-35?we=.07008718676813333:we=.0019806389728814727;let Be;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Be=-.01192072916082109:Be=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Be=.06874032717466054:t[4]>40.50000000000001?Be=-.07752510020707537:t[1]>76.50000000000001?Be=-.09944032260703917:t[8]>1381.5000000000002?Be=-.054466635810800745:t[1]>32.50000000000001?Be=.05974084520839573:Be=-.0384718740755954:Be=-.11374190719134032:t[0]>2151.5000000000005?Be=-.13703645155803298:Be=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Be=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Be=.013539805885738608:Be=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Be=.09941880179344399:Be=-.01608127391210995:Be=.08025226531247417:t[9]>67.50000000000001?Be=.13525448212444113:t[6]>61.50000000000001?Be=-.05511099182158894:t[94]>1e-35?Be=-.06821509831783572:t[128]>1e-35?Be=.11361314817714643:Be=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Be=-.09954181329804547:t[197]>1e-35?Be=.10102833149755386:t[188]>1e-35?Be=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Be=-.03781554214742005:Be=.09927933385592314:Be=-.020006000056720083:Be=-.10520473615957895:Be=-.12006990846253787:Be=-.00026111570975317574;let rt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[0]>1725.5000000000002?t[7]>14.500000000000002?t[2]>38.50000000000001?rt=-.019188245509744628:rt=-.13354864350075848:t[0]>2461.5000000000005?rt=.051885477468354396:rt=-.0833581968852119:rt=.08233441701532287:rt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?rt=.09926337893072812:rt=-.027753610497327715:t[0]>1972.5000000000002?rt=-.09780045823152517:rt=.032380915168504935:rt=.11502632261226381:t[17]>1e-35?rt=-.06094965899579662:t[10]>40.50000000000001?rt=-.07500475582440802:rt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?rt=-.09584538995220808:rt=-.00908705814304442:rt=.03203281520813893:t[10]>49.50000000000001?rt=-.03146271513986384:t[2]>63.50000000000001?rt=.13172001315536286:t[224]>1e-35?rt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?rt=.09521549382082259:rt=-.04414925613522197:t[0]>1847.5000000000002?rt=-.09118580379557353:rt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?rt=.03525144509943896:rt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?rt=-.04766112322938157:t[2]>10.500000000000002?rt=.0728516504357201:rt=-.05049625965272536:rt=-.10868663055825774:rt=.0005382613419948969;let st;t[147]>1e-35?t[1]>53.50000000000001?st=-.10615739288764095:t[0]>2604.5000000000005?t[0]>3629.5000000000005?st=-.030504020655417463:st=.07102458639110094:st=-.07058131985243714:t[302]>1e-35?t[10]>47.50000000000001?st=.055304563442710876:t[1]>53.50000000000001?st=.033723409577443623:t[8]>175.50000000000003?t[0]>2628.5000000000005?t[9]>40.50000000000001?st=-.1568835288372895:st=-.0279829124400056:st=.04493843959601833:st=-.11637042729644327:t[191]>1e-35?t[282]>1e-35?st=-.054133834303687026:t[9]>48.50000000000001?st=.11263810289007213:t[9]>9.500000000000002?st=-.02202034562838259:t[4]>45.50000000000001?st=-.03410927569045158:st=.04381615166534081:t[242]>1e-35?t[0]>3615.5000000000005?t[3]>19.500000000000004?t[1]>56.50000000000001?t[4]>28.500000000000004?st=-.029687297407295893:st=.10673602850001934:t[4]>42.50000000000001?st=.0036275562945108117:st=-.0760789221330622:st=-.10385623431741903:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?st=.08274426793676076:st=-.07076234425516396:st=.13890177606150175:st=-.019863286503635686:t[53]>1e-35?t[18]>1e-35?st=-.09250637750836187:st=-.0031531727902009026:t[2]>107.50000000000001?t[4]>91.50000000000001?t[1]>16.500000000000004?st=-.01897867921812603:st=.04890781705365262:st=-.11569892307597907:t[2]>106.50000000000001?st=.09032697440623969:st=.00047935919155035045;let _t;t[115]>1e-35?_t=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?_t=-.10131179514695865:t[8]>938.5000000000001?_t=.10203729808015481:_t=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?_t=.03574015165562999:_t=-.07763042506449493:_t=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?_t=.0665706259130275:_t=-.06586817559309924:_t=.11925564412287476:_t=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?_t=.046017146627455346:_t=-.08623321630086885:t[8]>1765.5000000000002?_t=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?_t=.11143827902215087:_t=-.01817808730473413:_t=.16980985030210127:_t=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?_t=.010168994879727824:_t=-.09099594488792513:t[9]>1.5000000000000002?_t=.0533459678147928:_t=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?_t=-.062346959148773695:t[1]>47.50000000000001?_t=-.0021578343835599316:t[2]>27.500000000000004?_t=.19567373210166172:_t=.07851555379116423:t[18]>1e-35?_t=.03711549097804649:t[8]>359.50000000000006?_t=.012492346746905587:t[4]>20.500000000000004?_t=.047511695735697544:_t=-.07999269063948773:_t=6802045404471004e-20;let Dt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Dt=.0011484728213539738:Dt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Dt=-.09828874964938798:t[8]>1586.5000000000002?Dt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Dt=.011938269926919522:Dt=.17541983715953954:t[19]>1e-35?Dt=.023002786011088672:Dt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Dt=.06508934844183291:Dt=-.10168553534835639:Dt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Dt=.021140806225203937:Dt=-.1167833342453639:t[2]>33.50000000000001?Dt=.13163585734056618:Dt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Dt=.06314479201263888:Dt=-.09639088327091713:t[10]>29.500000000000004?Dt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Dt=40577156464836036e-21:Dt=.12322387121810757:Dt=-.03697224045046014:t[1]>22.500000000000004?Dt=.016474835887320276:Dt=.16919298733903063:Dt=.07633203630214054:Dt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Dt=.14150493354700563:Dt=-.01831155354975749:t[1]>28.500000000000004?Dt=-.07952557178685365:t[10]>28.500000000000004?Dt=.0665695554984927:Dt=-.053640139319277094:Dt=.0004754840665898665;let $t;t[76]>1e-35?$t=-.06814884255939921:t[179]>1e-35?$t=-.06325743795510681:t[122]>1e-35?t[6]>36.50000000000001?$t=.05052338063261613:t[8]>626.5000000000001?t[1]>38.50000000000001?$t=.004193658608848433:$t=-.1066968975983452:t[8]>302.50000000000006?$t=.05476730110440451:$t=-.06382970920394895:t[218]>1e-35?t[2]>3.5000000000000004?t[6]>13.500000000000002?t[2]>19.500000000000004?t[0]>3200.5000000000005?t[4]>91.50000000000001?$t=-.12156071809840739:t[9]>21.500000000000004?t[5]>3883.5000000000005?t[8]>919.5000000000001?t[8]>1085.5000000000002?$t=.013555772109446666:$t=-.09856116699770784:$t=.0284329611813383:t[2]>52.50000000000001?$t=.04008708444763762:t[9]>29.500000000000004?$t=-.1289599546008197:$t=-.018566534248335896:t[8]>747.5000000000001?$t=.02236484980076122:$t=.1148871655157582:t[8]>3084.0000000000005?$t=-.05573875952902531:t[10]>17.500000000000004?t[2]>51.50000000000001?$t=.03164751204281298:$t=.11752140436184891:t[9]>42.50000000000001?$t=-.07180559595410106:t[22]>1e-35?$t=.09325040416256854:$t=-.016041122807939914:$t=-.02765708954618808:t[1]>30.500000000000004?t[1]>66.50000000000001?$t=-.010718250133458515:$t=.09818827994853763:$t=.010180038981174032:$t=-.039472162599295535:t[9]>170.50000000000003?$t=-.08536729235976731:t[189]>1e-35?t[0]>5269.500000000001?$t=-.08674788057474031:$t=.02077653508548371:$t=-.0003536561382007414;let Gt;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?Gt=.018337297491457794:Gt=-.05926206443180149:Gt=.024026520855881126:t[288]>1e-35?t[184]>1e-35?Gt=.10747078482128616:t[126]>1e-35?Gt=-.10550625192391357:t[7]>71.50000000000001?Gt=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?Gt=.1317396472229434:Gt=-.025035791351328947:Gt=-.0728334305864372:t[8]>963.5000000000001?Gt=.023642201723096064:Gt=.183010326734258:t[128]>1e-35?Gt=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?Gt=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?Gt=-.1088876900335281:Gt=.02758317023002635:Gt=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?Gt=-.01928020117446408:Gt=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?Gt=.07893723375925096:Gt=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?Gt=-.10301657587280551:Gt=.005787463140224318:Gt=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?Gt=-.019296977889522397:Gt=-.07274529751752634:t[1]>30.500000000000004?Gt=-.050368901143148286:Gt=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?Gt=.0015332402792773946:Gt=.09930153676749967:Gt=-.06370844564357069:Gt=.00042272155209927616;let Ie;t[71]>1e-35?t[4]>17.500000000000004?Ie=.12586844370423247:Ie=-.006791999603126354:t[222]>1e-35?t[1]>10.500000000000002?t[30]>1e-35?t[1]>36.50000000000001?t[9]>1.5000000000000002?t[10]>25.500000000000004?Ie=-.08474891624263797:t[8]>125.50000000000001?Ie=.08125086980439704:Ie=-.04082085238068532:t[0]>3863.5000000000005?Ie=.020481535807469208:Ie=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?Ie=-.019110200161573936:Ie=-.12387719685855114:t[0]>1102.5000000000002?Ie=.08376595701957407:Ie=-.031821919580524834:t[9]>4.500000000000001?Ie=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?Ie=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?Ie=.1349841206807871:Ie=.011864053595560297:t[1]>41.50000000000001?Ie=-.08203662486612544:t[2]>18.500000000000004?Ie=-.009541865642346947:Ie=.08345043168501759:t[2]>10.500000000000002?Ie=-.09585031818030947:Ie=.019432330487099865:Ie=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Ie=.11951517733981365:Ie=-.016651014735738538:t[1]>28.500000000000004?Ie=-.07410922545030711:t[10]>28.500000000000004?Ie=.05886430683844788:Ie=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?Ie=.04802269879144705:Ie=-.026208212831796737:t[4]>45.50000000000001?Ie=-.03227476944664786:Ie=.05124575625622705:Ie=.00020506696916003137;let F;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?F=-.03042091758483443:t[10]>14.500000000000002?F=.09816619204768777:F=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?F=-.02381165060401718:F=-.10950361804974783:F=.03538211665111128:t[212]>1e-35?t[19]>1e-35?F=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?F=-.06371052144380579:F=.0835500621252692:F=-.10408255929333915:t[1]>74.50000000000001?F=.13208968122712403:t[1]>64.50000000000001?F=-.04778844603644965:t[8]>51.50000000000001?t[8]>201.50000000000003?t[8]>660.5000000000001?t[6]>4.500000000000001?t[9]>5.500000000000001?t[1]>29.500000000000004?t[0]>3830.5000000000005?F=.09922816902423433:F=.016366955328796718:F=.1592412560903584:t[1]>39.50000000000001?F=.05409467990258923:F=-.08260633210459611:F=-.06307205775247567:t[9]>36.50000000000001?F=.040253940015648144:F=.14202568969471283:F=-.028761848341594044:F=.08994073058773508:t[0]>807.5000000000001?F=-.043427848826323195:F=.04573516446846493:t[20]>1e-35?t[188]>1e-35?F=-.0758877731600639:t[23]>1e-35?F=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?F=.08124700978741987:F=.013296063087086852:t[7]>5.500000000000001?F=-.01640196088612987:F=-.12685498840146067:F=-.0004940792382459551;let be;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?be=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?be=.08513773825688947:be=-.1184664832315282:be=.05676963535893477:be=.14263843210340613:be=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?be=-.10669720555606924:be=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?be=.0664744575868955:be=-.08469256188890871:be=-.026746678040592144:t[281]>1e-35?be=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?be=.012131807587207655:be=-.12776015795398743:be=.04320472481083551:be=.08390980661550446:t[10]>227.50000000000003?be=-.09771783809101153:t[10]>130.50000000000003?be=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?be=-.07610698254064358:t[8]>902.5000000000001?be=-.03136381213599649:t[131]>1e-35?be=.0704821739127936:t[224]>1e-35?be=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?be=.10431473040024908:t[8]>841.5000000000001?be=.07304745320500514:be=-.038011541882439825:be=-.01679746695007364:t[0]>3129.5000000000005?be=.05589952587431965:t[210]>1e-35?be=.06227198085800842:be=-.0011341890997947812:t[8]>740.5000000000001?be=.04817300084412584:be=-.000577001010789238;let Qe;t[187]>1e-35?t[6]>12.500000000000002?t[10]>8.500000000000002?t[10]>16.500000000000004?t[8]>234.50000000000003?t[4]>43.50000000000001?t[0]>4476.500000000001?Qe=-.10504730480402079:t[5]>3341.5000000000005?Qe=.11087894671081754:Qe=-.0406668834674614:Qe=.03308382165616109:t[8]>104.50000000000001?Qe=-.10431436764549162:Qe=.0073928337244891455:t[4]>34.50000000000001?Qe=-.10571751512748416:Qe=-.006081128814142983:t[13]>1e-35?Qe=.1299673566095023:t[4]>60.50000000000001?Qe=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?Qe=.04857126072645073:Qe=-.03431365358104773:t[4]>16.500000000000004?Qe=.04101865986596709:Qe=.16480274980378218:t[10]>26.500000000000004?Qe=.03673978504199255:t[10]>9.500000000000002?Qe=-.10996402743800027:t[308]>1e-35?Qe=.0553693735082498:Qe=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?Qe=.010902983761213922:Qe=.1325118659895645:Qe=-.064362945508595:t[1]>66.50000000000001?Qe=.033416767779331176:Qe=-.054080316225040496:t[42]>1e-35?Qe=-.07762364337810815:t[10]>1089.5000000000002?Qe=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?Qe=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?Qe=.0220102041325908:Qe=-.06516708740003069:Qe=.012833498905748267:t[224]>1e-35?Qe=-.007038418272997865:Qe=.00037666304316290967;let pe;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?pe=.07554189644995735:pe=-.052089349455904946:pe=-.10148206848169845:t[113]>1e-35?pe=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?pe=.07172653627995676:pe=-.07602959317610998:pe=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?pe=-.0399322883690891:pe=.06523495517476098:pe=-.10358715295743802:t[193]>1e-35?pe=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?pe=.015928764772252406:pe=.1341513061552287:pe=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?pe=-.033592997607280156:pe=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?pe=-.08402551858097379:pe=.017401984506038796:t[1]>25.500000000000004?pe=.13337205393591278:pe=-.01160208350090984:pe=.06708317942315471:t[8]>227.50000000000003?pe=-.08486943882418681:pe=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?pe=-.10496268177586783:pe=-.020921489532370493:pe=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?pe=.11639296062157028:pe=-.004275784356569115:t[32]>1e-35?pe=-.07297384970166025:pe=.006026841626381599:pe=.002034611134960428;let Se;t[248]>1e-35?Se=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Se=-.06455513326540585:t[1]>29.500000000000004?Se=.07718474591552532:t[4]>7.500000000000001?Se=.040139336931404826:Se=-.09685734690563386:Se=.00015327283570347363:t[9]>88.50000000000001?Se=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?Se=-.04077257804338707:Se=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?Se=.03778141591008941:Se=-.06459919920634845:Se=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?Se=.14063930759326346:t[0]>179.50000000000003?Se=.07287482250668585:t[8]>1180.5000000000002?Se=-.14419393112726253:t[10]>28.500000000000004?Se=-.07993142770099469:t[17]>1e-35?Se=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?Se=.05527969663610186:Se=-.10824385941441346:t[3]>11.500000000000002?Se=.12358502961047915:Se=-.017509147119622873:t[0]>74.50000000000001?Se=-.014907705458730486:t[8]>95.50000000000001?Se=-.02225118168342062:Se=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?Se=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?Se=.04962819555610421:Se=-.07213577821855309:Se=.09139529824708481:t[19]>1e-35?Se=.013439401088345224:Se=-.049274647207292056:Se=.10531673719686951;let Fe;t[40]>1e-35?t[0]>1937.5000000000002?Fe=-.06421671152073961:Fe=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Fe=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Fe=-.03520420769287065:t[8]>1085.5000000000002?Fe=-.019817352506127633:Fe=.11444439424520964:Fe=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Fe=-.010490117519863269:Fe=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Fe=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Fe=.06619344145920268:t[0]>4091.5000000000005?Fe=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Fe=.10016091391222309:Fe=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Fe=-.019511460451434884:Fe=-.11643672465055221:t[2]>18.500000000000004?Fe=.07848228087333317:t[8]>55.50000000000001?Fe=.032583027899956235:Fe=-.11209832692153521:t[11]>1e-35?Fe=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Fe=-.09996887746328006:t[9]>2.5000000000000004?Fe=.02157682011863397:Fe=-.05247727848991843:Fe=.07409150201483244:t[1]>38.50000000000001?Fe=-.11378466075449625:t[224]>1e-35?Fe=-.10741749127732923:t[1]>26.500000000000004?Fe=.07343136534146562:Fe=-.07013573628594773:t[25]>1e-35?Fe=-.04626669734164317:Fe=.05518333197956482:Fe=.00032434010867555516;let te;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?te=.026313251010808853:te=-.08997339150292381:te=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?te=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?te=.0905155504503746:t[8]>1049.5000000000002?te=-.062312558183394054:t[8]>719.5000000000001?te=.09583836191410239:t[0]>3719.5000000000005?te=-.0778097309430818:te=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?te=-.12920865648544927:t[0]>2699.5000000000005?te=-.07086587879041864:te=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?te=-.11377786322600797:te=-.009486325820117998:t[1]>55.50000000000001?te=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?te=-.07938291201004219:t[2]>36.50000000000001?te=.01520046732530246:te=.13649854049662832:te=-.07145015938528873:t[8]>407.50000000000006?te=-.00350257360822279:te=.11332047082193297:te=-.10060624458629897:te=.05429496612497562:t[8]>1446.5000000000002?te=.006073419197482838:te=-.08718676350883998:te=-.11532497988252638:te=.10766270463068293:t[34]>1e-35?te=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?te=-.0004109812623829506:te=.021601073497455662:te=-7343540098965853e-20;let Te;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?Te=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?Te=.05995640200798119:t[0]>3443.5000000000005?Te=-.14698883458733583:Te=-.030039164579240187:t[189]>1e-35?Te=-.06086763220538141:t[1]>86.50000000000001?Te=-.05096727866142538:t[4]>64.50000000000001?Te=.11240554253834577:t[4]>45.50000000000001?Te=-.030279760168394117:t[6]>45.50000000000001?Te=.10161088917815142:t[10]>77.50000000000001?Te=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?Te=-.06672020005240323:Te=.08831457502630258:t[8]>2592.5000000000005?Te=-.052617701047376654:t[10]>29.500000000000004?Te=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?Te=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?Te=-.064099222705728:Te=.044332487521538365:t[0]>2882.5000000000005?Te=.031099546885005065:Te=.12938467051623853:t[0]>4221.500000000001?Te=-.0928676413498701:t[9]>30.500000000000004?Te=-.05781824812803708:Te=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?Te=-.06648105454098469:Te=.05985487552383097:Te=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?Te=.05282385499619401:t[1]>66.50000000000001?Te=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?Te=.027885690791379255:Te=-.08407126408362446:Te=.014432924125571093:Te=-9903435845205118e-20;let Ge;t[76]>1e-35?Ge=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?Ge=.013633653464240465:Ge=-.10164319411983509:Ge=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?Ge=.00632864847804078:Ge=-.08393000368134668:Ge=.07870508617440916:t[284]>1e-35?Ge=.1092302727710421:Ge=-.0025505047582483234:t[248]>1e-35?Ge=.07101822393621864:t[274]>1e-35?Ge=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?Ge=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?Ge=.025081789181021243:Ge=-.014813325803582618:t[9]>33.50000000000001?Ge=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?Ge=.11926990418060353:Ge=.01852125513565268:Ge=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?Ge=-.1178464984373743:t[283]>1e-35?Ge=.043370859226927405:t[5]>4320.500000000001?Ge=-.01103141226366587:t[8]>1104.5000000000002?Ge=-.023053423988095886:Ge=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?Ge=.000579145585864887:Ge=.03389152834202143:t[128]>1e-35?Ge=-.14527722052568462:t[210]>1e-35?Ge=-.08915971541902741:t[7]>9.500000000000002?Ge=-.03307314577076116:t[18]>1e-35?Ge=-.05521712302023565:Ge=.009315605032770029:Ge=.0036332551852289933;let J;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?J=-.07583539600416284:t[188]>1e-35?J=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?J=-.011038193049597113:J=.08154028164397753:t[1]>85.50000000000001?J=.10259361975201933:J=.011640408330521594:J=-.00023319159023748508:t[92]>1e-35?J=.13771692859530546:J=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?J=.09967230141007705:t[30]>1e-35?J=-.08888529037551285:J=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?J=.08284665960761373:J=-.029292565021289504:t[7]>7.500000000000001?J=-.09945093355204493:J=-.008381393701708593:t[20]>1e-35?J=-.04218678460370465:t[10]>6.500000000000001?t[9]>2.5000000000000004?t[1]>13.500000000000002?t[8]>143.50000000000003?t[4]>7.500000000000001?t[2]>36.50000000000001?J=.07585582641438211:t[8]>284.50000000000006?J=-.029387993239886723:J=.07716738177321587:t[1]>18.500000000000004?J=.026745348497993746:J=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?J=.02337306890530338:J=-.10390355904767366:J=.07390521199638532:J=-.06788247515155237:J=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?J=-.06360325615644084:J=.04342192339836601:J=-.10598779152030145:J=.05253384605768211;let se;t[3]>7.500000000000001?t[157]>1e-35?se=-.07514182877923786:se=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?se=.028692053800951845:se=.14081686716133598:se=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?se=.0037139292567243084:se=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?se=.01202688580305612:se=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?se=.043935495082738626:se=-.05639305759669704:t[247]>1e-35?se=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?se=.10331836202616368:se=.0006926658459781341:t[96]>1e-35?se=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?se=-.0741403257305367:se=.022900127535540854:t[7]>3.5000000000000004?se=.038110741403836294:se=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?se=-.09552842289807008:t[1]>27.500000000000004?se=.012505935885798007:se=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?se=-.1046104767723845:se=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?se=.023466328488582572:se=.11730925774586994:se=-.04771965631104874:se=.17059689880751394:se=-.08181850955999449:t[26]>1e-35?se=-.12727482696678769:se=-.014343123272734182;let me;t[147]>1e-35?t[1]>53.50000000000001?me=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?me=-.02763546051134888:me=.06423344777499343:me=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?me=.049825139823021586:t[7]>22.500000000000004?me=-.01131680751379858:t[0]>2579.5000000000005?me=-.10673674485369694:me=-.015387212937189957:me=.04347325151148724:t[179]>1e-35?me=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?me=.0650355590939066:me=-.0473332870892226:me=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?me=.11139543329789044:t[126]>1e-35?me=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?me=.06370903833231022:t[10]>29.500000000000004?me=.03415223859607161:t[10]>3.5000000000000004?me=-.07415518117873297:me=-.0014119203473324082:me=.12617652343819508:t[9]>41.50000000000001?me=-.10311145857176976:t[8]>2757.5000000000005?me=-.08106484219011428:t[7]>71.50000000000001?me=-.09783384432091176:t[1]>88.50000000000001?me=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?me=-.008884084501608536:me=.061339437777743616:me=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?me=.01526664064166223:me=.13534828515415498:me=-.06985484465894776:me=.0005758961943178744;let Ce;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Ce=-.029152732370514342:Ce=.07173628916139178:t[1]>36.50000000000001?Ce=-.08859111297255318:Ce=.0018030071815630785:Ce=.13652461563759322:Ce=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Ce=-.07145140450454163:t[21]>1e-35?Ce=-.07422841663493233:Ce=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Ce=.11864240653986852:t[3]>33.50000000000001?Ce=-.08821209591953476:Ce=.05706392280054726:Ce=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Ce=.01953613016837112:Ce=-.059781039130025006:t[148]>1e-35?Ce=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Ce=.07207826841738371:t[202]>1e-35?Ce=.08163917539410503:Ce=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Ce=-.06858280496900336:Ce=-.1781828899516648:Ce=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Ce=.018232649414147116:Ce=-.04419781124222661:Ce=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Ce=.11452368095776105:Ce=-.036496437259924026:Ce=-.040445338739465486:Ce=.0816572651001145:Ce=-.08968914517368663:Ce=.0002826343082585516;let He;t[189]>1e-35?t[0]>5269.500000000001?He=-.08839493050459957:t[10]>85.50000000000001?He=.10046908365702462:t[8]>2592.5000000000005?He=-.09632233975926387:t[8]>2000.5000000000002?He=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?He=.035504970430426296:t[1]>31.500000000000004?He=-.1133764813142531:He=-.01138280942244812:t[8]>1125.5000000000002?He=.09800530246229806:He=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?He=.07316772160107896:He=-.059095014819051765:He=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?He=-.09150209066166894:t[8]>3084.0000000000005?He=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?He=-.04449234460408263:He=.05568837973347338:He=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?He=.12741077850267066:He=.007372371864985329:t[2]>39.50000000000001?He=.02295917234617787:He=.14966532083907075:t[1]>39.50000000000001?He=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?He=-.02511861881285652:t[1]>27.500000000000004?He=.08683660011672288:He=.02956214835267301:t[9]>15.500000000000002?He=-.016538805462996232:He=.04352738094981517:He=-.05561856645643868:t[9]>170.50000000000003?He=-.07996752635874248:t[179]>1e-35?He=-.09065975936933919:He=-.00042817975060427177;let $e;t[39]>1e-35?t[4]>25.500000000000004?$e=.03443173196222934:$e=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?$e=-.0013415395759330318:$e=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?$e=.002297618040307216:$e=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?$e=-.015297257305397608:$e=.09651828834062742:$e=-.06636003334371929:t[10]>11.500000000000002?$e=.17631616138309397:t[0]>1639.5000000000002?$e=3804386478092585e-20:$e=-.09099296398683193:$e=-.06874415876172972:t[0]>2151.5000000000005?$e=-.1311264883406766:$e=.00809052010141122:t[253]>1e-35?$e=-.06338558211939296:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?t[10]>10.500000000000002?t[0]>3615.5000000000005?$e=.045038497754638605:$e=-.07770167665661752:$e=-.08596294280650517:$e=.08538655727027213:$e=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?$e=.054627956617973275:t[1]>61.50000000000001?$e=-.11994465088415499:t[4]>8.500000000000002?$e=.06676200239406452:$e=-.027503148069376867:t[8]>676.5000000000001?$e=-.10363964928357075:t[4]>8.500000000000002?$e=-.07589816227175682:$e=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?$e=.009093153189012338:$e=-.06119765876605404:$e=.0004668642103528348;let et;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?et=-.10100794502567233:et=.08000205636470442:et=-.11945419826856896:t[113]>1e-35?et=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?et=.1224302423880318:et=-.01875566982911468:t[222]>1e-35?t[1]>8.500000000000002?t[1]>24.500000000000004?t[4]>3.5000000000000004?t[0]>725.5000000000001?t[0]>1682.5000000000002?t[0]>2860.5000000000005?et=.0019277012166729114:t[1]>28.500000000000004?et=-.054445821715687494:et=.045645722976713245:t[30]>1e-35?et=.13402660155331655:et=.008921176001777645:et=-.058547426505451076:et=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?et=-.13526418192218206:et=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?et=.0007263224246135398:et=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?et=-.11575657261278308:et=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?et=-.01995960178292952:et=.11216586049153021:et=-.10050961087149474:et=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?et=.10303451081526649:et=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?et=-.043799548968209395:et=-.12451444314954115:t[4]>12.500000000000002?et=-.03838117361958468:et=.06504990789767144:t[57]>1e-35?et=.06890006938293915:et=.0003914274695562949;let ct;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?ct=.004271749009686975:ct=-.10523878297127605:ct=.04633982158107851:ct=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?ct=-.08655730561951676:t[8]>919.5000000000001?ct=-.0676453705610183:t[7]>18.500000000000004?ct=-.027787974193650575:ct=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?ct=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?ct=-.03473877164537313:t[8]>719.5000000000001?ct=.10471053866934404:ct=.008236107678382981:t[4]>57.50000000000001?ct=.09412219478825269:t[10]>66.50000000000001?ct=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?ct=-.040681323751002293:ct=.06374650297561021:ct=.12884615227401788:t[10]>5.500000000000001?ct=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?ct=-.05474068967150784:ct=.03744700650806603:ct=-.07846396348680855:t[1]>42.50000000000001?ct=.018972315810821302:ct=.10953621007604744:t[5]>4439.500000000001?ct=.010999776705494586:t[1]>40.50000000000001?ct=-.12394200059775967:t[10]>2.5000000000000004?ct=.013528093962849453:ct=-.09222088417048682:ct=-.12662967149701485:ct=.09327296405849603:t[3]>99.50000000000001?ct=-.013581954439986752:ct=.0005526498251862075;let bt;t[187]>1e-35?t[243]>1e-35?bt=-.08392792551692502:t[10]>68.50000000000001?bt=.07871769409454053:t[10]>8.500000000000002?t[10]>16.500000000000004?t[2]>17.500000000000004?t[3]>31.500000000000004?t[91]>1e-35?t[10]>21.500000000000004?t[10]>33.50000000000001?t[10]>48.50000000000001?bt=-.0825306209711224:bt=.049559996084532945:bt=-.1064938580886302:bt=.03353240732240275:bt=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?bt=.16966001471529374:t[1]>57.50000000000001?bt=-.005772777673676247:bt=.09383677041525058:t[8]>747.5000000000001?bt=.054068175469351235:bt=-.049968216310277036:t[8]>753.5000000000001?bt=-.0679383555784074:t[4]>8.500000000000002?bt=-.059757341189735386:bt=.05701083682780414:bt=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?bt=.05820296128730006:bt=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?bt=.15340611616954566:bt=.04385036188666874:t[0]>4449.500000000001?bt=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?bt=.004840354641006495:bt=.09967827580276283:bt=.11605363537391578:t[9]>19.500000000000004?bt=-.0735831692725717:bt=.019973331823355176:t[306]>1e-35?t[149]>1e-35?bt=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?bt=-.02442182361342386:bt=.10334853004243093:bt=-.030431948680167104:bt=-956078595250818e-19;let ht;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?ht=-.040232505718244854:t[0]>3030.5000000000005?ht=.0634109586813073:ht=-.04043617034245621:ht=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?ht=-.007859096946435131:ht=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?ht=.05515771679628051:ht=-.04214471312668263:ht=-.09589322222261765:t[193]>1e-35?ht=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?ht=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?ht=-.08152604001147906:t[11]>1e-35?ht=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?ht=.13100930780107503:t[10]>25.500000000000004?ht=.05921074710011526:ht=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?ht=.0009447118243153454:ht=-.09820565036865991:ht=.057146909749745546:t[0]>2115.5000000000005?ht=-.12331216726611678:ht=.007281983677694285:t[2]>56.50000000000001?ht=.012310154675612615:ht=-.08873665774670461:t[6]>25.500000000000004?ht=.134708740821879:t[9]>5.500000000000001?ht=-.0805901581148979:t[224]>1e-35?ht=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?ht=.10842593386554122:t[2]>13.500000000000002?ht=.06466798320378395:ht=-.08578130788886655:ht=-.03590892078300114:ht=.0003499894043880708;let We;t[134]>1e-35?t[6]>50.50000000000001?t[0]>3601.5000000000005?We=.10839808814624702:We=-.028043875308180352:t[7]>30.500000000000004?t[8]>932.5000000000001?We=-.007478368069393829:We=-.09066751344326617:t[0]>3588.5000000000005?t[5]>4748.500000000001?We=.04035247751736232:t[0]>4255.500000000001?We=-.1310865624507367:t[0]>4004.5000000000005?We=.06647367311982634:We=-.08339693352955757:t[4]>10.500000000000002?t[1]>34.50000000000001?We=-.011618902907510411:We=.1114646660406691:t[10]>2.5000000000000004?t[0]>3072.5000000000005?We=.09356028223727986:We=-.03811765057032162:We=-.09456215497345526:t[280]>1e-35?t[7]>70.50000000000001?We=.10322956436499003:t[2]>22.500000000000004?t[1]>83.50000000000001?We=.1146142460964847:t[1]>62.50000000000001?We=-.09679869865322362:t[9]>71.50000000000001?We=-.07377580769927583:t[4]>19.500000000000004?t[0]>4571.500000000001?We=-.039046426387852974:We=.04558778688367152:We=.11220830937352602:t[7]>5.500000000000001?t[9]>17.500000000000004?t[8]>1067.5000000000002?We=.03261697816211156:t[15]>1e-35?We=.02586252542264368:t[2]>14.500000000000002?We=-.016420452667484604:We=-.1011799626006976:We=-.13787471318963773:t[6]>4.500000000000001?t[8]>427.50000000000006?t[10]>36.50000000000001?We=.010193588102560583:We=.11748729525930773:We=-.04468162226743652:We=-.028365274393617957:t[71]>1e-35?We=.05115139346588793:We=-.0001510425316936658;let ae;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ae=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ae=.020637047900190317:ae=-.1017300802134141:t[1]>23.500000000000004?t[9]>12.500000000000002?t[0]>2815.5000000000005?t[0]>3183.5000000000005?t[3]>23.500000000000004?t[3]>45.50000000000001?t[4]>48.50000000000001?ae=-.04632587527094407:ae=.08603684785510396:ae=-.05101401015448496:ae=.025466432054358498:ae=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ae=.020385355430046367:ae=.12032592051335252:ae=-.012387370292173013:t[2]>23.500000000000004?ae=-.12568545484492677:ae=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ae=.043528764484784536:ae=.14352071657196003:ae=-.009332833816977268:ae=.11186782227735846:ae=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ae=-.05649104643152564:ae=.03884200719305747:t[42]>1e-35?ae=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ae=-.04103416502526736:ae=.04881823954656287:t[4]>15.500000000000002?ae=.009342724662897898:t[0]>3969.5000000000005?ae=-.025637309961309498:ae=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ae=-.08185697075265091:t[0]>2215.5000000000005?ae=.030063975892297354:t[0]>807.5000000000001?ae=-.03924325550733229:ae=.0415330999189793:ae=-.00024374664461674863;let Re;t[3]>7.500000000000001?Re=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Re=.025798416259686565:Re=.13251610353146012:Re=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?Re=-.11098564237775424:Re=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?Re=.15347826616466054:t[3]>4.500000000000001?Re=.10379320730958941:Re=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?Re=.03159791088468647:Re=-.10612873364104258:Re=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?Re=-.02335760775001469:Re=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?Re=-.011164334474672973:Re=-.06594044410501655:t[207]>1e-35?Re=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?Re=-.01725821503981916:Re=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?Re=-.04226531631656534:Re=-.14409800530171432:Re=-.03245576341206398:t[8]>4214.500000000001?Re=.0895409165534886:t[247]>1e-35?Re=-.06506383629143335:t[118]>1e-35?Re=-.07214270121257443:t[8]>546.5000000000001?Re=-.004385020865473831:Re=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?Re=.046278501133958524:Re=-.030835570926968044:t[0]>493.50000000000006?Re=-.12794504651610425:Re=.009415039807550776;let Me;t[304]>1e-35?Me=-.04717777269217453:t[76]>1e-35?Me=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Me=-.09648224457374217:t[132]>1e-35?Me=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Me=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Me=.10838431695638147:t[230]>1e-35?Me=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Me=.050071316251979:Me=-.006356941111525215:t[6]>8.500000000000002?Me=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Me=.10217402850540398:Me=-.048840949025349197:Me=-.03668313197909846:t[7]>39.50000000000001?Me=-.0562642841496003:t[10]>2.5000000000000004?Me=.09749777369987417:Me=-.04848223121417616:t[0]>5453.500000000001?Me=.08316648226133942:Me=-.0261979698267618:t[212]>1e-35?Me=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Me=.04837009746506856:Me=-.09184360565631328:Me=.0032411047845613606:t[0]>4733.500000000001?Me=.0977378556864798:Me=.010776545559325588:Me=-.012483310473120218:Me=-.049284121449103935:Me=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Me=-.08380361910948711:Me=.07375088778585813:Me=-.1084864186071348:Me=.0007819503469605476;let ye;t[7]>17.500000000000004?t[115]>1e-35?ye=.08741852531696623:t[167]>1e-35?ye=.10078975495600809:ye=-.0018324767784017562:t[290]>1e-35?ye=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?ye=.1379733311640402:ye=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?ye=-.09360083033774169:ye=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?ye=-.015599362579530679:t[0]>4593.500000000001?ye=-.12029549262691491:ye=-.018917032256501397:ye=.04632831686576592:ye=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?ye=-.05894883236412263:ye=.05213944998315824:ye=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?ye=.07577412405680808:ye=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?ye=-.0277076900736147:t[1]>65.50000000000001?ye=-.023587471585763506:ye=.10184896592433082:ye=-.057699270527916825:ye=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?ye=.06566902102799584:t[10]>25.500000000000004?ye=-.07033633753181047:ye=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?ye=-.08108035861059537:ye=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?ye=-.12431182772561139:ye=.01886235886984271:ye=.0025579594894418116;let oe;t[8]>2915.5000000000005?t[101]>1e-35?oe=.08648323956719083:t[0]>93.50000000000001?t[196]>1e-35?oe=-.09509320772734361:t[4]>1.5000000000000002?t[5]>1106.5000000000002?t[5]>1191.5000000000002?t[283]>1e-35?oe=-.11268313808648661:t[10]>12.500000000000002?t[131]>1e-35?oe=.0687641681341721:t[10]>102.50000000000001?oe=-.09667920080214842:t[4]>15.500000000000002?t[8]>2992.5000000000005?t[1]>24.500000000000004?t[1]>71.50000000000001?oe=-.06762578396473291:t[10]>65.50000000000001?oe=-.05226727783610509:t[282]>1e-35?oe=.09911438410640917:t[19]>1e-35?oe=.06915156336429933:oe=-.006565637886508241:oe=-.08344300251849307:oe=-.0928863907927501:t[1]>60.50000000000001?t[2]>17.500000000000004?oe=.19428463865406298:oe=.016073883020956765:t[13]>1e-35?oe=.06864077097923665:oe=-.01388867527034731:t[0]>1847.5000000000002?oe=.004655280608161356:t[1]>40.50000000000001?oe=.031406054057765996:oe=.12798062439212832:oe=.09859670536264255:t[10]>2.5000000000000004?t[9]>68.50000000000001?oe=.08821759640665892:t[9]>32.50000000000001?t[8]>3960.0000000000005?t[1]>31.500000000000004?oe=-.0706095614785733:oe=.04227164041372561:oe=-.1056906923176064:t[2]>8.500000000000002?t[19]>1e-35?oe=-.07139533369873902:oe=.008952586782921625:oe=.06086212582180936:oe=-.0816938490403437:oe=-.051224901945956025:oe=-.10525399124186095:oe=.000270924147208224;let ze;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?ze=.029186512383291244:t[7]>1.5000000000000002?ze=-.14984127276725573:t[1]>40.50000000000001?ze=.032757060730648144:ze=-.07675575422749602:t[6]>8.500000000000002?ze=.10599766037117893:ze=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?ze=-.051394622947855385:ze=.03237141302699347:ze=.12526173027943244:ze=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?ze=-.07383912482657777:t[0]>5147.500000000001?ze=.07008813937042091:t[10]>38.50000000000001?ze=-.06779203808365307:ze=-.013782769999524498:ze=.0880038869117715:ze=-.12846294176070952:t[281]>1e-35?ze=-.06810806903850834:t[10]>227.50000000000003?ze=-.08937977001661111:t[10]>130.50000000000003?ze=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?ze=.011036530162093841:ze=-.11500797478569702:ze=.03702229366129399:ze=.07242026683784307:t[189]>1e-35?ze=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?ze=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?ze=-.02608892716555304:ze=.09609599320761308:t[9]>105.50000000000001?ze=-.06848127135991534:ze=.0023675721254089715:t[86]>1e-35?ze=-.11049635625500497:ze=-.004847764219432233;let at;t[125]>1e-35?t[0]>3969.5000000000005?at=-.09462233499115416:at=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?at=-.030700661288166148:at=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?at=.03149547314036763:at=-.08166208257451366:t[0]>5850.500000000001?at=-.10228136324773157:t[102]>1e-35?at=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?at=.01782894842128785:t[13]>1e-35?at=.002680190260979968:at=.1773965720476949:t[2]>72.50000000000001?at=.09090831938627947:t[1]>59.50000000000001?at=-.12297206702816128:t[0]>4977.500000000001?at=.09899015653118268:at=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?at=-.0675900954187773:at=.012336403425364092:at=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?at=-.02671721777458802:at=-.09242452991958029:t[284]>1e-35?at=-.08585691288582491:at=.013332890564324447:t[4]>14.500000000000002?at=-.005245022074799553:t[23]>1e-35?at=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?at=-.09289852307936758:t[116]>1e-35?at=-.09686573010015055:t[8]>804.5000000000001?at=.03812547148215318:at=.005162744968176633:t[9]>43.50000000000001?at=-.059246106396159376:at=.050370113808135275:at=.000794041852811028;let Vt;t[3]>7.500000000000001?Vt=.0004981426543104341:t[9]>114.50000000000001?Vt=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Vt=-.019061766497948867:Vt=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Vt=-.006044199577160493:Vt=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Vt=.11486607015912494:t[9]>16.500000000000004?Vt=-.08686820858087294:Vt=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Vt=-.022230207980026437:Vt=.1056683690528792:Vt=-.05859530800943035:Vt=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Vt=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Vt=-.05177544573528314:Vt=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Vt=.15159657923771555:Vt=-.0060542654587671055:t[9]>5.500000000000001?Vt=-.042808028205051786:t[1]>48.50000000000001?Vt=-.010449538258110742:Vt=.10026907521968294:Vt=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Vt=-.02272452389409874:Vt=-.11202691218244319:t[5]>1809.5000000000002?Vt=-.04460413584255906:Vt=.08196329474205256:t[10]>69.50000000000001?Vt=.10221481166238167:Vt=.0004063052701699382:t[243]>1e-35?Vt=-.07563941678849846:t[18]>1e-35?Vt=.02563513231103432:Vt=-.004740081147303786;let gr;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?gr=.057446442918106:gr=-.04404018270156349:gr=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?gr=-.05930486238817954:t[1]>29.500000000000004?gr=.06955866121256543:t[8]>597.5000000000001?gr=-.06538593556505168:gr=.06212512595497445:gr=.00021102929959182257:t[9]>90.50000000000001?gr=.0958061289119631:t[102]>1e-35?gr=.07172059675638813:t[1]>47.50000000000001?gr=-.03879798603977766:t[297]>1e-35?gr=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?gr=.003805910996312012:gr=.09304295674749524:t[11]>1e-35?t[18]>1e-35?gr=.11252376801858695:t[288]>1e-35?gr=-.10293901912180432:gr=.014669268837893872:t[1]>42.50000000000001?gr=-.05988274123836837:t[145]>1e-35?gr=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?gr=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?gr=-.03366718308159971:gr=.11936550608549797:t[1]>31.500000000000004?gr=-.07454716789539667:gr=.027859650621164217:t[10]>10.500000000000002?gr=-.11806374092321247:gr=-.03506042229223101:gr=-.0007080765837654515:t[10]>6.500000000000001?gr=-.028077713664996503:t[2]>7.500000000000001?gr=.15803724124216814:gr=.0351381284833169:gr=-.07877953381054767;let cr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?cr=.14144941521975005:cr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?cr=.10514088112381886:t[7]>18.500000000000004?cr=-.10370643555956745:cr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?cr=-.0508129468802936:t[224]>1e-35?cr=-.037816066368733595:t[10]>43.50000000000001?cr=.07793408602607932:cr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?cr=.036972453794202324:cr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?cr=.09475302525132188:cr=-.03580104945898193:cr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?cr=-.1282448778804823:cr=-.014395808269207212:cr=-.008940927190750592:cr=-.1459118815453748:t[0]>4897.500000000001?cr=-.09733068457286576:t[1]>57.50000000000001?cr=.06575271409540207:cr=-.019556422817450115:cr=-.10623959222984136:t[18]>1e-35?cr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?cr=.008125645893104896:cr=-.11084368630465868:cr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?cr=-.05854904579626861:t[4]>5.500000000000001?cr=.02985784951394175:cr=-.03247600140149334:cr=-.11152899295304973:cr=-.00035424577714215764;let Mr;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Mr=-.06563670567578264:Mr=.067656954313663:Mr=-.10388217548685377:t[8]>2302.5000000000005?Mr=.07190621943790435:t[4]>67.50000000000001?Mr=.060020507643618604:t[4]>38.50000000000001?Mr=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Mr=-.06568134366461277:t[8]>1075.5000000000002?Mr=-.004768057709758692:Mr=.11785959165999467:Mr=-.05080221682879267:Mr=.14814206127494542:Mr=-.07241946332311736:t[253]>1e-35?Mr=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Mr=-.02471195342450034:Mr=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Mr=-.10741850739482771:Mr=.010051635824944:Mr=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Mr=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Mr=-.08992396138178163:Mr=.010944365997007212:Mr=.06221307021813793:Mr=.1286024087559141:t[127]>1e-35?Mr=.06568148624531012:t[10]>40.50000000000001?Mr=-.07567979134643352:t[5]>5647.500000000001?Mr=.07594672895572069:Mr=-.018158016446439187:t[6]>55.50000000000001?Mr=.009293422430111872:t[4]>45.50000000000001?Mr=-.017749818406964022:t[2]>46.50000000000001?Mr=.01714136511113982:Mr=-724762291423549e-19;let Hr;t[1]>24.500000000000004?t[103]>1e-35?t[8]>48.50000000000001?t[17]>1e-35?Hr=-.048689215588703864:t[9]>27.500000000000004?t[0]>3916.5000000000005?Hr=.07084726276890757:Hr=-.11232323677722932:Hr=.04812773089510436:Hr=.11757502216780046:t[5]>1464.5000000000002?t[5]>1505.5000000000002?t[167]>1e-35?Hr=.07470606002425358:t[1]>53.50000000000001?t[132]>1e-35?Hr=.0879462816013881:Hr=-.002966662093626573:t[306]>1e-35?Hr=-.04588085188342676:Hr=.0031910005157084823:t[3]>10.500000000000002?t[10]>20.500000000000004?Hr=-.006600332774461143:Hr=.1272481351557754:Hr=-.09030973597154808:t[284]>1e-35?t[1]>38.50000000000001?t[10]>2.5000000000000004?Hr=.011884312066620044:Hr=.11678751052403374:t[4]>8.500000000000002?Hr=.03627129613273813:Hr=-.12132783497902287:Hr=-.006784372643244717:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Hr=-.06830131718398992:t[0]>5147.500000000001?Hr=.062360406249609306:t[4]>4.500000000000001?Hr=-.013162203864592055:Hr=-.07153029184927609:Hr=.07628618062271557:Hr=-.12085065687320373:t[190]>1e-35?Hr=-.045816889524231186:t[137]>1e-35?Hr=-.07956001795911584:t[199]>1e-35?t[0]>3853.5000000000005?Hr=.025895337822752502:Hr=-.06503949350616421:t[10]>227.50000000000003?Hr=-.09989456525790491:t[10]>130.50000000000003?Hr=.08616651057030683:Hr=.0001234981796706021;let Gr;t[8]>1014.5000000000001?t[9]>137.50000000000003?Gr=-.08778879924617534:t[8]>1022.5000000000001?t[285]>1e-35?t[9]>64.50000000000001?Gr=.04955806187281689:t[0]>3670.5000000000005?t[10]>32.50000000000001?Gr=-.141732381961068:Gr=-.0317152307496497:Gr=-.02074638849097191:t[0]>93.50000000000001?t[0]>3072.5000000000005?t[10]>100.50000000000001?t[4]>24.500000000000004?t[8]>1336.5000000000002?Gr=.12191801556691254:Gr=-.0003444689085397977:Gr=.005739668504631604:t[146]>1e-35?t[308]>1e-35?Gr=.015237524791728777:t[6]>61.50000000000001?t[4]>63.50000000000001?Gr=-.05676033995381961:Gr=.10933961076803381:t[4]>26.500000000000004?Gr=-.11667582544549814:t[8]>1765.5000000000002?Gr=.032174455312047705:Gr=-.0755016390126608:t[293]>1e-35?Gr=-.08234885407658332:t[9]>41.50000000000001?t[0]>3830.5000000000005?Gr=.026571311956824436:t[15]>1e-35?Gr=.06175459479851121:Gr=-.018778084411148754:t[9]>40.50000000000001?Gr=-.09420232889965811:Gr=-.004578248021263184:t[2]>1.5000000000000002?Gr=.005453714644971445:Gr=-.03907138175699279:Gr=-.055296364182154736:t[23]>1e-35?Gr=.036555134842143476:t[0]>4188.500000000001?t[6]>29.500000000000004?Gr=-.09358146510580179:Gr=.060524657996178094:Gr=-.11245101144669545:t[125]>1e-35?t[9]>1.5000000000000002?Gr=-.12698331085931538:Gr=.006059605604079918:t[2]>196.50000000000003?Gr=-.09451315810804783:Gr=.0011390147031687425;let Yt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?Yt=.05517359070460923:Yt=-.04758751221404857:Yt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?Yt=.1040436595565776:t[9]>21.500000000000004?Yt=.04032250517675179:t[107]>1e-35?Yt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?Yt=.1192453009230486:t[1]>51.50000000000001?Yt=.0443376336292195:Yt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?Yt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?Yt=-.08999822408398037:Yt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?Yt=-.061850439226075:Yt=.08849196353361093:Yt=.10536348167793089:t[92]>1e-35?Yt=.04894947712119185:t[9]>16.500000000000004?Yt=.05900227903883853:t[9]>5.500000000000001?Yt=-.11946594348916476:Yt=-.03652096348071964:t[1]>41.50000000000001?Yt=-.07411603110840567:Yt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?Yt=.08493634342741495:t[11]>1e-35?Yt=-.10899097825564363:Yt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?Yt=.08356655906359918:t[7]>25.500000000000004?Yt=-.09475076526194888:t[10]>5.500000000000001?Yt=-.01999406228763778:Yt=.06696212545889428:t[6]>20.500000000000004?Yt=.14713592661393468:Yt=.0459917279002218:Yt=.00027445928493734093;let _r;t[223]>1e-35?t[1]>31.500000000000004?t[8]>634.5000000000001?_r=-.06904501553217077:_r=.05696231672035904:_r=-.1124703178077813:t[99]>1e-35?t[1]>89.50000000000001?_r=-.05074261170009721:t[1]>57.50000000000001?t[8]>969.5000000000001?_r=-.011419256378538392:t[0]>3830.5000000000005?_r=.140315841503076:_r=.02403434913963024:t[1]>31.500000000000004?t[8]>65.50000000000001?t[2]>10.500000000000002?_r=-.04027822909411164:_r=.03176085103667189:_r=.06779515865838849:t[4]>15.500000000000002?_r=.0762878389015175:t[8]>175.50000000000003?t[0]>3030.5000000000005?t[8]>1041.5000000000002?_r=.06124039747298539:_r=-.04312732764434027:_r=.09161522761808062:_r=-.09663512235460074:t[280]>1e-35?t[6]>45.50000000000001?t[1]>46.50000000000001?_r=.11211681010488772:t[13]>1e-35?_r=.06725735814960367:_r=-.046744031455827846:t[10]>44.50000000000001?t[0]>3400.5000000000005?t[0]>4004.5000000000005?t[2]>22.500000000000004?_r=.11743605068905603:_r=-.011309033539148687:_r=-.07896094707523052:_r=.12862714793172117:t[10]>1.5000000000000002?t[8]>455.50000000000006?t[0]>4706.500000000001?_r=-.09218756798869711:t[10]>19.500000000000004?t[0]>1894.5000000000002?t[0]>3719.5000000000005?_r=.02836295848998302:_r=.12210680366745175:_r=-.058302317470509096:t[5]>4144.500000000001?_r=.06123341960495106:_r=-.03840046906926525:_r=-.05221474543453495:_r=.03988215485860711:_r=-.00033074684693083496;let $0=DVs(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+E+_+v+b+T+w+R+x+P+D+N+L+B+q+M+O+j+Q+U+Y+W+V+z+ie+H+re+le+Le+ge+Ue+ke+X+ee+K+he+Z+ue+qe+ne+ce+Ne+we+Be+rt+st+_t+Dt+$t+Gt+Ie+F+be+Qe+pe+Se+Fe+te+Te+Ge+J+se+me+Ce+He+$e+et+ct+bt+ht+We+ae+Re+Me+ye+oe+ze+at+Vt+gr+cr+Mr+Hr+Gr+Yt+_r);return[1-$0,$0]}a(IXn,"multilineModelPredict");function DVs(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(DVs,"sigmoid");var NVs={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},xXn={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function wXn(t,e,r,n=!0){let o=t.split(` -`);if(n&&(o=o.filter(l=>l.trim().length>0)),Math.abs(e)>o.length||e>=o.length)return!1;e<0&&(e=o.length+e);let s=o[e];return(NVs[r]??[]).some(l=>s.includes(l))}a(wXn,"hasComment");var Blt=class{static{a(this,"PromptFeatures")}constructor(e,r){let[n,o]=this.firstAndLast(e),s=this.firstAndLast(e.trimEnd());this.language=r,this.length=e.length,this.firstLineLength=n.length,this.lastLineLength=o.length,this.lastLineRstripLength=o.trimEnd().length,this.lastLineStripLength=o.trim().length,this.rstripLength=e.trimEnd().length,this.stripLength=e.trim().length,this.rstripLastLineLength=s[1].length,this.rstripLastLineStripLength=s[1].trim().length,this.secondToLastLineHasComment=wXn(e,-2,r),this.rstripSecondToLastLineHasComment=wXn(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` +`}a(MWs,"wrapInSystemReminder");p();var KXn=require("crypto");var OWs=new Set(["ExitPlanMode"]);function Yfr(t,e={}){let r=e.timestamp??new Date().toISOString();if(t.type==="error"&&typeof t.error=="string")return[XXn(r,"synthetic",t.error)];switch(t.type){case"system":return LWs(t,r);case"assistant":return zXn(BWs(t,r,e.streamingEnabled===!0,e.blockCursor,e.interactionId,e.mapModelId),e.suppressedToolUseIds);case"user":return zXn(e.includeUserText===!0?UWs(t,r):FWs(t,r),e.suppressedToolUseIds);case"result":return jWs(t,r,e.sessionModel,e.copilotUsageNanoAiu);default:return[]}}a(Yfr,"translate");function zXn(t,e){return e?t.filter(r=>{if(r.type==="tool.execution_start"){let{toolName:n,toolCallId:o}=r.data;if(typeof o=="string"&&n!==void 0&&OWs.has(n))return e.add(o),!1}if(r.type==="tool.execution_complete"){let{toolCallId:n}=r.data;if(typeof n=="string"&&e.has(n))return e.delete(n),!1}return!0}):t}a(zXn,"dropDedicatedChannelToolEvents");function JXn(t,e,r){if(t.parent_tool_use_id!==null)return[];let n=t.event,o=new Date().toISOString();switch(n.type){case"message_start":return[{id:e,timestamp:o,parentId:null,type:"assistant.turn_start",data:{turnId:e,interactionId:r??e}}];case"content_block_delta":{let s=n.delta;switch(s.type){case"text_delta":return[{id:Ug(),timestamp:o,parentId:null,type:"assistant.message_delta",ephemeral:!0,data:{messageId:`${e}:${n.index}`,deltaContent:s.text}}];case"thinking_delta":return[{id:Ug(),timestamp:o,parentId:null,type:"assistant.reasoning_delta",ephemeral:!0,data:{reasoningId:`${e}:${n.index}`,deltaContent:s.thinking}}];default:return[]}}case"content_block_start":case"content_block_stop":case"message_delta":case"message_stop":return[];default:return[]}}a(JXn,"translatePartial");function LWs(t,e){let r=t.subtype;if(r==="init"){let n=t;return[{id:Ug(),timestamp:e,parentId:null,type:"session.start",data:{sessionId:n.session_id,version:1,producer:"claude-code-sdk",copilotVersion:"",startTime:e,selectedModel:n.model,context:n.cwd?{cwd:n.cwd}:void 0}}]}return r==="compact_boundary"?[{id:Ug(),timestamp:e,parentId:null,type:"session.compaction_start",data:{}},{id:Ug(),timestamp:e,parentId:null,type:"session.compaction_complete",data:{success:!0}}]:[]}a(LWs,"translateSystem");function BWs(t,e,r,n,o,s){let c=t.message?.id??Ug(),l=[],u=t.message?.model,d=u;if(typeof u=="string"&&s)try{d=s(u)}catch{d=u}r||l.push({id:c,timestamp:e,parentId:null,type:"assistant.turn_start",data:{turnId:c,interactionId:o??c}});let f=t.message?.content??[],h=n??new Map,m=h.get(c)??0;return f.forEach(g=>{let A=m++;switch(g.type){case"text":{let y=g.text;typeof y=="string"&&y.length>0&&l.push({id:Ug(),timestamp:e,parentId:null,type:"assistant.message",data:{messageId:`${c}:${A}`,content:y,model:d}});break}case"thinking":{let y=g.thinking;typeof y=="string"&&y.length>0&&l.push({id:Ug(),timestamp:e,parentId:null,type:"assistant.reasoning",data:{reasoningId:`${c}:${A}`,content:y}});break}case"tool_use":{let y=g;l.push({id:Ug(),timestamp:e,parentId:null,type:"tool.execution_start",data:{toolCallId:typeof y.id=="string"?y.id:Ug(),toolName:typeof y.name=="string"?y.name:"unknown",arguments:y.input}});break}default:break}}),h.set(c,m),l}a(BWs,"translateAssistant");function FWs(t,e){let r=t.message?.content;if(!Array.isArray(r))return[];let n=[];for(let o of r)o.type==="tool_result"&&n.push(ZXn(o,e));return n}a(FWs,"translateUserLive");function UWs(t,e){let r=[],n=t.message?.content;if(typeof n=="string"){let o=$lt(n);return o.length>0&&r.push(YXn(e,o)),r}if(!Array.isArray(n))return r;for(let o of n){if(o.type==="tool_result"){r.push(ZXn(o,e));continue}if(o.type==="text"){let s=o.text;if(typeof s=="string"){let c=$lt(s);c.length>0&&r.push(YXn(e,c))}}}return r}a(UWs,"translateUserHistory");function ZXn(t,e){let r=t.tool_use_id,n=t.is_error===!0,o=HWs(t.content);return{id:Ug(),timestamp:e,parentId:null,type:"tool.execution_complete",data:{toolCallId:typeof r=="string"?r:Ug(),success:!n,result:n?void 0:{content:o??""},error:n?{message:o??"Tool execution failed"}:void 0}}}a(ZXn,"buildToolExecutionComplete");function YXn(t,e){return{id:Ug(),timestamp:t,parentId:null,type:"user.message",data:{content:e}}}a(YXn,"buildUserMessage");function QWs(t){return t.replace(/[\s\S]*?<\/system-reminder>\s*/g,"").trim()}a(QWs,"stripSystemReminders");var qWs=/^\[Request interrupted by user[^\]]*\]$/;function $lt(t){let e=QWs(t);return qWs.test(e)?"":e}a($lt,"sanitizeUserText");function jWs(t,e,r,n){let o=[],s=t.usage;if(s&&o.push({id:Ug(),timestamp:e,parentId:null,type:"assistant.usage",ephemeral:!0,data:{model:r??"unknown",inputTokens:s.input_tokens,outputTokens:s.output_tokens,cacheWriteTokens:s.cache_creation_input_tokens,cacheReadTokens:s.cache_read_input_tokens,...n!==void 0&&n>0?{copilotUsage:{totalNanoAiu:n}}:{}}}),t.is_error===!0){let l=t.subtype,u=t.errors,d=t.result,f=Array.isArray(u)&&u.find(h=>typeof h=="string"&&h.length>0)||(typeof d=="string"&&d.length>0?d:void 0)||"Claude turn ended with error";o.push(XXn(e,typeof l=="string"?l:"error",f))}return o.push({id:Ug(),timestamp:e,parentId:null,type:"session.idle",ephemeral:!0,data:{}}),o}a(jWs,"translateResult");function XXn(t,e,r){return{id:Ug(),timestamp:t,parentId:null,type:"session.error",data:{errorType:e,message:r}}}a(XXn,"buildSessionError");function HWs(t){if(t!=null){if(typeof t=="string")return t;if(Array.isArray(t)){let e=[];for(let n of t)if(n&&typeof n=="object"){let o=n.text;typeof o=="string"&&e.push(o)}let r=e.join(` +`);return r.length>0?r:void 0}try{return JSON.stringify(t)}catch{return}}}a(HWs,"flattenToolResultContent");function Ug(){return(0,KXn.randomUUID)()}a(Ug,"newId");function eei(t,e){let r=[],n=new Map,o=new Set,s;for(let c of t){let l=$Ws(c);if(!l)continue;(l.type==="user"&&GWs(l)||l.type==="assistant"&&s===void 0)&&(s=Ug());let u=l.type==="assistant"?s:void 0,d=c.timestamp,f=typeof d=="string"?d:void 0;try{r.push(...Yfr(l,{streamingEnabled:!1,includeUserText:!0,blockCursor:n,suppressedToolUseIds:o,timestamp:f,interactionId:u,mapModelId:e}))}catch{}}return r}a(eei,"translateHistory");function GWs(t){let e=(t.message??{}).content;if(typeof e=="string")return $lt(e).length>0;if(!Array.isArray(e))return!1;for(let r of e)if(r.type==="text"&&typeof r.text=="string"&&$lt(r.text).length>0)return!0;return!1}a(GWs,"userMessageStartsInteraction");function $Ws(t){if(!(!t||typeof t!="object"||!t.message||typeof t.message!="object")&&(t.type==="user"||t.type==="assistant"))return t.type==="user"&&VWs(t)?void 0:{type:t.type,message:t.message,parent_tool_use_id:t.parent_tool_use_id,uuid:t.uuid,session_id:t.session_id}}a($Ws,"adaptHistoryMessage");function VWs(t){let e=t;return e.isMeta===!0||e.isCompactSummary===!0||e.isVisibleInTranscriptOnly===!0||e.isSynthetic===!0}a(VWs,"isSyntheticReplayUserMessage");p();p();var tei=require("node:stream"),rei=require("node:string_decoder");function ANe(t){let e=new rei.StringDecoder("utf8"),r="",n=0,o=a(l=>{if(typeof l!="number"||!Number.isFinite(l)||l<=n)return;let u=l-n;n=l;try{t(u)}catch{}},"consider"),s=a(l=>{if(l.includes("copilot_usage"))try{let u=JSON.parse(l);o(u.copilot_usage?.total_nano_aiu)}catch{}},"inspectPayload"),c=a(l=>{if(!l.startsWith("data:"))return;let u=l.slice(5).trimStart();!u||u==="[DONE]"||s(u)},"inspectLine");return new tei.Transform({transform(l,u,d){try{r+=e.write(l);let f=r.indexOf(` +`);for(;f!==-1;){let h=r.slice(0,f).replace(/\r$/,"");r=r.slice(f+1),c(h),f=r.indexOf(` +`)}}catch{}d(null,l)},flush(l){try{if(r+=e.end(),!r){l();return}let u=r.replace(/\r$/,"");c(u),n===0&&s(u)}catch{}l()}})}a(ANe,"createCopilotUsageSniffer");var fme=class{constructor(){this._byKey=new Map}static{a(this,"CopilotUsageAccumulator")}add(e,r){if(!Number.isFinite(r)||r<=0)return;let n=this._byKey.get(e)??0;this._byKey.set(e,n+r)}take(e){let r=this._byKey.get(e);return this._byKey.delete(e),r}clear(e){this._byKey.delete(e)}};var Am=class{constructor(){this._modelBySession=new Map;this._permissionModeBySession=new Map;this._reasoningEffortBySession=new Map;this._copilotUsage=new fme}static{a(this,"ClaudeSessionStateService")}setModelForSession(e,r){if(r===void 0){this._modelBySession.delete(e);return}this._modelBySession.set(e,r)}getModelForSession(e){return this._modelBySession.get(e)}setPermissionModeForSession(e,r){if(r===void 0){this._permissionModeBySession.delete(e);return}this._permissionModeBySession.set(e,r)}getPermissionModeForSession(e){return this._permissionModeBySession.get(e)}setReasoningEffortForSession(e,r){if(r===void 0){this._reasoningEffortBySession.delete(e);return}this._reasoningEffortBySession.set(e,r)}getReasoningEffortForSession(e){return this._reasoningEffortBySession.get(e)}addCopilotUsageNanoAiuForSession(e,r){this._copilotUsage.add(e,r)}takeCopilotUsageNanoAiuForSession(e){return this._copilotUsage.take(e)}clear(e){this._modelBySession.delete(e),this._permissionModeBySession.delete(e),this._reasoningEffortBySession.delete(e),this._copilotUsage.clear(e)}};var Vlt=fe(require("path"));Mo();var vc=new pe("ClaudeCodeAgent.session"),Cc="ClaudeCodeSession",yNe=class{constructor(e,r,n,o){this.ctx=e;this.sdkWrapper=r;this.notificationSender=n;this._terminalErrorEmittedForTurn=!1;this._assistantBlockCursor=new Map;this._suppressedToolUseIds=new Set;this._abortController=new AbortController;this._isResumed=!1;this._isProcessing=!1;this._disposed=!1;this._permissionRegistry=new dme;this._userInputRegistry=new dme;this._exitPlanModeRegistry=new dme;this._injectedServerNames=new Set;this._handleCanUseTool=a((e,r,n)=>this._disposed?Promise.resolve({behavior:"deny",message:`Session ${this.sessionId} disposed`}):e==="AskUserQuestion"?this._handleAskUserQuestion(r,n):e==="ExitPlanMode"?this._handleExitPlanMode(r,n):e==="ToolSearch"?Promise.resolve({behavior:"allow",updatedInput:r}):this._handlePermissionRequest(e,r,n),"_handleCanUseTool");this.sessionId=o.sessionId,this._cwd=o.cwd,this._model=o.model,this._permissionMode=o.permissionMode,this._isResumed=!(o.isNewSession??!0),this._proxyConfig=o.proxyConfig;let s=this.ctx.get(Am);if(s.setModelForSession(this.sessionId,this._model),s.setPermissionModeForSession(this.sessionId,this._permissionMode),this.ctx.get(kn).getCapabilities().agentDebugLog){let c=new iy(this.ctx);c.isEnabled()&&(this._otelTracker=new Glt(this.ctx,this.sessionId,c))}}static{a(this,"ClaudeCodeSession")}get cwd(){return this._cwd}async invoke(e){if(this._disposed){let r=`Session ${this.sessionId} has been disposed`;throw await this._sendSessionUpdate({type:"error",error:r}),new Error(r)}if(this._isProcessing){let r=`Session ${this.sessionId} is busy: a previous invoke is still streaming. Wait for the terminal sessionUpdate before sending another prompt.`;throw await this._sendSessionUpdate({type:"error",error:r}),new Error(r)}this._isProcessing=!0;try{await this._runInvoke(e)}finally{this._isProcessing=!1}}async setModel(e){if(e!==this._model&&(this._model=e,this.ctx.get(Am).setModelForSession(this.sessionId,e),this._query))try{await this._query.setModel(e)}catch(r){vc.warn(this.ctx,`${Cc}: setModel on active query failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async supportedAgents(){if(!this._query)return[];try{return await this._query.supportedAgents()}catch(e){return vc.warn(this.ctx,`${Cc}: supportedAgents query failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)}),[]}}_notifyAgentListChanged(){try{this.ctx.get(d0).notify("agent").catch(e=>{vc.warn(this.ctx,`${Cc}: notify(agent) failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)})})}catch(e){vc.warn(this.ctx,`${Cc}: notify(agent) failed`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)})}}async setPermissionMode(e){if(e===void 0&&this._permissionMode!==void 0){vc.info(this.ctx,`${Cc}: setPermissionMode skipped (undefined preserves existing)`,{sessionId:this.sessionId,existingMode:this._permissionMode});return}let r=e??"default";if(this._permissionMode=r,this.ctx.get(Am).setPermissionModeForSession(this.sessionId,r),this._query)try{await this._query.setPermissionMode(r),vc.info(this.ctx,`${Cc}: setPermissionMode propagated to live Query`,{sessionId:this.sessionId,effectiveMode:r})}catch(n){vc.warn(this.ctx,`${Cc}: setPermissionMode on active query failed`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)})}}async interrupt(){let e=this._query;if(e)try{await e.interrupt()}catch(r){vc.warn(this.ctx,`${Cc}: interrupt() failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}dispose(){if(this._disposed)return;this._disposed=!0,this._dropAllPending("disposed"),this._abortController.abort(),this.ctx.get(Am).clear(this.sessionId);let e=this._promptWaiter;this._promptWaiter=void 0,e?.resolve();let r=this._currentInvokeDone;this._currentInvokeDone=void 0,r?.reject(new Error(`Session ${this.sessionId} disposed`));let n=this._query;n&&n.interrupt().catch(o=>{vc.warn(this.ctx,`${Cc}: interrupt during dispose failed`,{sessionId:this.sessionId,error:o instanceof Error?o.message:String(o)})})}async _runInvoke(e){e.model!==void 0&&e.model!==this._model&&await this.setModel(e.model),e.permissionMode!==void 0&&await this.setPermissionMode(e.permissionMode),this.ctx.get(Am).setReasoningEffortForSession(this.sessionId,e.reasoningEffort),this.ctx.get(Am).takeCopilotUsageNanoAiuForSession(this.sessionId);let r=new kA;this._currentInvokeDone=r,this._terminalErrorEmittedForTurn=!1,this._currentTurnInteractionId=Nt();let n;try{this._query||await this._startQuery();let o=this._query;n=e.token?.onCancellationRequested(()=>{vc.info(this.ctx,`${Cc}: cancellation requested`,{sessionId:this.sessionId}),o.interrupt()}),vc.info(this.ctx,`${Cc}.invoke`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,messageCharLen:e.message.length,referenceCount:e.references?.length??0});let s=await WXn(e.references,this.ctx),l={type:"user",message:{role:"user",content:[{type:"text",text:e.message},...s]},parent_tool_use_id:null,session_id:this.sessionId,uuid:e.messageId??Nt()};this._otelTracker?.startRequest(this._model,e.message),this._pendingPromptInput=l;let u=this._promptWaiter;this._promptWaiter=void 0,u?.resolve(),await r.promise}catch(o){throw await this._emitTerminalError(o),o}finally{n?.dispose(),this._currentInvokeDone===r&&(this._currentInvokeDone=void 0)}}async _startQuery(){let e=this._proxyConfig,r=this._isResumed,n=Rt(this.ctx,ze.ClaudeCliPath)||process.env.CLAUDE_CLI_PATH,o=await ume.check(n);if(o.severity==="error")throw new Error(o.message);o.severity==="warning"&&(vc.warn(this.ctx,`${Cc}: ${o.message}`,{sessionId:this.sessionId}),this.notificationSender.showWarningMessageOnlyOnce("claude.cliVersionMismatch",o.message));let s=_ct(this.ctx),c=this._buildInjectedMcpServers(s),l=this._buildAllowedMcpServers(s,c),u={cwd:this._cwd,executable:process.execPath,pathToClaudeCodeExecutable:n,abortController:this._abortController,settings:{env:{ANTHROPIC_BASE_URL:`http://127.0.0.1:${e.port}`,ANTHROPIC_AUTH_TOKEN:`${e.nonce}.${this.sessionId}`,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1",USE_BUILTIN_RIPGREP:"0",PATH:await this._buildPathWithBundledRipgrep(),...this._deriveClaudeOTelEnv()},...l&&{allowedMcpServers:l}},systemPrompt:{type:"preset",preset:"claude_code"},settingSources:["user","project","local"],...wVt(this.ctx)?{}:{skills:[]},disallowedTools:["WebSearch"],canUseTool:this._handleCanUseTool,...Object.keys(c).length>0&&{mcpServers:c},thinking:{type:"adaptive"},includePartialMessages:!0,allowDangerouslySkipPermissions:!0,...this._model&&{model:this._model},...this._permissionMode&&{permissionMode:this._permissionMode},...r?{resume:this.sessionId}:{sessionId:this.sessionId}},d=await this.sdkWrapper.query({prompt:this._createPromptIterable(),options:u});this._query=d,this._isResumed=!0,this._notifyAgentListChanged(),vc.info(this.ctx,`${Cc}: started long-lived Query`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,isResumed:r}),this._processMessages(d).catch(f=>{vc.error(this.ctx,`${Cc}: consume loop crashed`,{sessionId:this.sessionId,error:f instanceof Error?f.message:String(f)})})}_buildInjectedMcpServers(e){if(!e)return this._injectedServerNames=new Set,{};let{servers:r,names:n}=qXn(e,this._cwd);return this._injectedServerNames=n,r}_buildAllowedMcpServers(e,r){return e?jXn(e,r):void 0}async reloadInjectedMcpServers(e){let r=this._query;if(!r||this._disposed)return;let n=this._buildInjectedMcpServers(e);try{await r.setMcpServers(n),await r.applyFlagSettings({allowedMcpServers:this._buildAllowedMcpServers(e,n)??null}),vc.info(this.ctx,`${Cc}: reloaded injected MCP servers`,{sessionId:this.sessionId,count:Object.keys(n).length})}catch(o){vc.warn(this.ctx,`${Cc}: reloadInjectedMcpServers failed`,{sessionId:this.sessionId,error:o instanceof Error?o.message:String(o)})}}get injectedServerNames(){return this._injectedServerNames}async _buildPathWithBundledRipgrep(){try{let e=await this.ctx.get(SF).resolvePath();return`${Vlt.dirname(e)}${Vlt.delimiter}${process.env.PATH??""}`}catch(e){return vc.warn(this.ctx,`${Cc}: bundled ripgrep unavailable, falling back to process PATH`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)}),process.env.PATH??""}}_deriveClaudeOTelEnv(){let e=lnt(this.ctx);return HDn(this.ctx,e)}async*_createPromptIterable(){for(;!this._disposed;){if(this._pendingPromptInput){let r=this._pendingPromptInput;this._pendingPromptInput=void 0,yield r;continue}let e=new kA;this._promptWaiter=e,await e.promise}}async _processMessages(e){let r;try{for await(let n of e){if(this._checkSessionIdConsistency(n),this._isPartialAssistantMessage(n)){let o=n.event;o.type==="message_start"&&(r=o.message.id),r!==void 0&&await this._sendPartialUpdate(n,r),o.type==="message_stop"&&(r=void 0)}else await this._sendSessionUpdate(n);if(this._isTerminalTurnMessage(n)){n.type==="result"?this._otelTracker?.endRequest():this._otelTracker?.endRequestWithError(n.error??"Turn ended with error"),this._assistantBlockCursor.clear(),this._suppressedToolUseIds.clear(),this._currentTurnInteractionId=void 0;let s=this._currentInvokeDone;this._currentInvokeDone=void 0,s?.resolve()}}this._otelTracker?.endRequestWithError("SDK Query ended unexpectedly"),this._currentInvokeDone&&await this._emitTerminalError(new Error("SDK Query ended unexpectedly")),this._cleanupLiveQuery(e,new Error("SDK Query ended unexpectedly"))}catch(n){vc.error(this.ctx,`${Cc}: query error`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)}),this._otelTracker?.endRequestWithError(n instanceof Error?n.message:String(n)),await this._emitTerminalError(n),this._cleanupLiveQuery(e,n instanceof Error?n:new Error(String(n)))}}_isPartialAssistantMessage(e){return typeof e=="object"&&e!==null&&e.type==="stream_event"}_isTerminalTurnMessage(e){if(typeof e!="object"||e===null)return!1;let r=e.type;return r==="result"||r==="error"}_cleanupLiveQuery(e,r){this._query===e&&(this._query=void 0),this._dropAllPending("query ended",r.message),this._assistantBlockCursor.clear(),this._suppressedToolUseIds.clear(),this._currentTurnInteractionId=void 0;let n=this._currentInvokeDone;this._currentInvokeDone=void 0,n?.reject(r)}_checkSessionIdConsistency(e){if(typeof e!="object"||e===null)return;let r=e.session_id;typeof r=="string"&&r!==this.sessionId&&vc.error(this.ctx,`${Cc}: SDK reported session_id mismatch`,{expected:this.sessionId,reported:r})}async _sendSessionUpdate(e){try{this._otelTracker?.onMessage(e);let n=e?.type==="result"?this.ctx.get(Am).takeCopilotUsageNanoAiuForSession(this.sessionId):void 0,o=Yfr(e,{streamingEnabled:!0,sessionModel:this._model,copilotUsageNanoAiu:n,blockCursor:this._assistantBlockCursor,suppressedToolUseIds:this._suppressedToolUseIds,interactionId:this._currentTurnInteractionId});for(let s of o)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,s,"CLAUDE")}catch(r){vc.error(this.ctx,`${Cc}: failed to send agent/sessionUpdate`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async _sendPartialUpdate(e,r){try{let n=JXn(e,r,this._currentTurnInteractionId);for(let o of n)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}catch(n){vc.error(this.ctx,`${Cc}: failed to send partial agent/sessionUpdate`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)})}}async _emitTerminalError(e){if(this._terminalErrorEmittedForTurn)return;this._terminalErrorEmittedForTurn=!0;let r=e instanceof Error?e.message:String(e);await this._sendSessionUpdate({type:"error",error:r})}respondToInteraction(e){if(e.sessionId!==this.sessionId)return vc.warn(this.ctx,`${Cc}: respondToInteraction sessionId mismatch`,{ownSessionId:this.sessionId,paramSessionId:e.sessionId,requestId:e.requestId}),!1;switch(e.type){case"permission":return this._respondFromRegistry(this._permissionRegistry,e.type,e.requestId,e.result);case"user_input":return this._respondFromRegistry(this._userInputRegistry,e.type,e.requestId,e.response);case"exit_plan_mode":return this._respondFromRegistry(this._exitPlanModeRegistry,e.type,e.requestId,e.response);default:return vc.warn(this.ctx,`${Cc}: unsupported interaction type`,{sessionId:this.sessionId,requestId:e.requestId,interactionType:e.type}),!1}}_respondFromRegistry(e,r,n,o){let s=e.respond(n,o);return s||vc.warn(this.ctx,`${Cc}: respondToInteraction for unknown ${r} requestId`,{sessionId:this.sessionId,requestId:n}),s}_dropAllPending(e,r){let n=r?`: ${r}`:"";this._permissionRegistry.respondAll({kind:"denied-interactively-by-user",feedback:`Session ${this.sessionId} ${e} before permission resolved${n}`}),this._userInputRegistry.rejectAll(new Error(`Session ${this.sessionId} ${e} before user_input resolved${n}`)),this._exitPlanModeRegistry.respondAll({approved:!1,feedback:`Session ${this.sessionId} ${e} before exit_plan_mode resolved${n}`})}_handlePermissionRequest(e,r,n){let o=n.toolUseID??Nt();if(n.signal.aborted)return Promise.resolve({behavior:"deny",message:"Permission request aborted"});let s=BXn(e,r,n);return this._requestPermissionFromIde(o,e,r,s,n)}async _handleAskUserQuestion(e,r){if(r.signal.aborted)return{behavior:"deny",message:"AskUserQuestion aborted"};let n=UXn(e);if(!n)return{behavior:"deny",message:"AskUserQuestion: invalid input"};try{let o=await Promise.all(n.map(async c=>{let l=Nt(),u=await this._requestUserInputFromIde(l,QXn(c,r.toolUseID),r.signal);return{questionText:c.questionText,answer:u.answer}})),s={};for(let{questionText:c,answer:l}of o)s[c]=l;return{behavior:"allow",updatedInput:{...e,answers:s}}}catch(o){return{behavior:"deny",message:o instanceof Error?o.message:`AskUserQuestion failed: ${String(o)}`}}}_handleExitPlanMode(e,r){let n=r.toolUseID??Nt();return r.signal.aborted?Promise.resolve({behavior:"deny",message:"ExitPlanMode request aborted"}):this._requestExitPlanModeFromIde(n,e,r)}async _requestExitPlanModeFromIde(e,r,n){let{promise:o,isSettled:s}=this._exitPlanModeRegistry.register(e),c=a(()=>{this._exitPlanModeRegistry.respond(e,{approved:!1,feedback:"ExitPlanMode request aborted"})},"onAbort"),l=a(()=>n.signal.removeEventListener("abort",c),"cleanupAbort");n.signal.addEventListener("abort",c,{once:!0});let u=typeof r.plan=="string"?r.plan:"",d=this._emitExitPlanModeRequested(e,{planContent:u,summary:u,actions:["exit_only","interactive"],recommendedAction:"interactive",toolCallId:n.toolUseID});d.catch(m=>{s()||(vc.error(this.ctx,`${Cc}: failed to emit exit_plan_mode.requested, denying`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)}),l(),this._exitPlanModeRegistry.respond(e,{approved:!1,feedback:"Failed to deliver exit_plan_mode request to client"}))});let f;try{f=await o}finally{l()}let h=this._translateExitPlanModeResponse(f,r);return vc.info(this.ctx,`${Cc}: exit_plan_mode resolved`,{sessionId:this.sessionId,requestId:e,behavior:h.behavior,selectedAction:f.selectedAction,autoApproveEdits:f.autoApproveEdits}),d.catch(()=>{}).then(()=>this._emitExitPlanModeCompleted(e,f)).catch(m=>{vc.warn(this.ctx,`${Cc}: failed to emit exit_plan_mode.completed`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)})}),h}_translateExitPlanModeResponse(e,r){if(!e.approved){let c=e.feedback?.trim();return{behavior:"deny",message:c?`Plan not approved: ${c}`:"Plan not approved by user"}}if(e.selectedAction==="exit_only")return{behavior:"deny",message:"The user approved the plan but will implement it themselves. Do not make any code changes or take any further action. Stop and wait for the user."};let o=e.autoApproveEdits===!0?"acceptEdits":"default";return this._permissionMode=o,this.ctx.get(Am).setPermissionModeForSession(this.sessionId,o),{behavior:"allow",updatedInput:r,updatedPermissions:[{type:"setMode",mode:o,destination:"session"}]}}async _requestPermissionFromIde(e,r,n,o,s){let{promise:c,isSettled:l}=this._permissionRegistry.register(e),u=a(()=>{this._permissionRegistry.respond(e,{kind:"denied-interactively-by-user",feedback:"Permission request aborted"})},"onAbort"),d=a(()=>s.signal.removeEventListener("abort",u),"cleanupAbort");s.signal.addEventListener("abort",u,{once:!0});let f=this._emitPermissionRequested(e,o);f.catch(A=>{l()||(vc.error(this.ctx,`${Cc}: failed to emit permission.requested, denying`,{sessionId:this.sessionId,requestId:e,toolName:r,error:A instanceof Error?A.message:String(A)}),d(),this._permissionRegistry.respond(e,{kind:"denied-interactively-by-user",feedback:"Failed to deliver permission request to client"}))});let h;try{h=await c}finally{d()}let m=FXn(h,n);vc.info(this.ctx,`${Cc}: permission resolved`,{sessionId:this.sessionId,requestId:e,toolName:r,behavior:m.behavior});let g=m.behavior==="allow"?"approved":"denied";return f.catch(()=>{}).then(()=>this._emitPermissionCompleted(e,g,s.toolUseID)).catch(A=>{vc.warn(this.ctx,`${Cc}: failed to emit permission.completed`,{sessionId:this.sessionId,requestId:e,error:A instanceof Error?A.message:String(A)})}),m}async _requestUserInputFromIde(e,r,n){let{promise:o,isSettled:s}=this._userInputRegistry.register(e),c=a(()=>{this._userInputRegistry.rejectOne(e,new Error("AskUserQuestion aborted"))},"onAbort"),l=a(()=>n.removeEventListener("abort",c),"cleanupAbort");n.addEventListener("abort",c,{once:!0});let u=this._emitUserInputRequested(e,r);u.catch(m=>{s()||(vc.error(this.ctx,`${Cc}: failed to emit user_input.requested, rejecting`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)}),l(),this._userInputRegistry.rejectOne(e,m instanceof Error?m:new Error(String(m))))});let d,f;try{d=await o}catch(m){f=m instanceof Error?m:new Error(String(m))}finally{l()}let h=d??{answer:"",wasFreeform:!1};if(u.catch(()=>{}).then(()=>this._emitUserInputCompleted(e,h)).catch(m=>{vc.warn(this.ctx,`${Cc}: failed to emit user_input.completed`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)})}),f!==void 0)throw f;return d}async _emitPermissionRequested(e,r){let n={id:Nt(),timestamp:new Date().toISOString(),parentId:null,type:"permission.requested",data:{requestId:e,permissionRequest:r}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitPermissionCompleted(e,r,n){let o={id:Nt(),timestamp:new Date().toISOString(),parentId:null,type:"permission.completed",data:{requestId:e,result:{kind:r},...n!==void 0?{toolCallId:n}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}async _emitUserInputRequested(e,r){let n={id:Nt(),timestamp:new Date().toISOString(),parentId:null,type:"user_input.requested",data:{requestId:e,question:r.question,...r.choices!==void 0?{choices:r.choices}:{},...r.allowFreeform!==void 0?{allowFreeform:r.allowFreeform}:{},...r.toolCallId!==void 0?{toolCallId:r.toolCallId}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitUserInputCompleted(e,r){let n={id:Nt(),timestamp:new Date().toISOString(),parentId:null,type:"user_input.completed",data:{requestId:e,answer:r.answer,wasFreeform:r.wasFreeform}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitExitPlanModeRequested(e,r){let n={id:Nt(),timestamp:new Date().toISOString(),parentId:null,type:"exit_plan_mode.requested",data:{requestId:e,planContent:r.planContent,summary:r.summary,actions:r.actions,recommendedAction:r.recommendedAction,...r.toolCallId!==void 0?{toolCallId:r.toolCallId}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitExitPlanModeCompleted(e,r){let n={id:Nt(),timestamp:new Date().toISOString(),parentId:null,type:"exit_plan_mode.completed",data:{requestId:e,approved:r.approved,...r.selectedAction!==void 0?{selectedAction:r.selectedAction}:{},...r.autoApproveEdits!==void 0?{autoApproveEdits:r.autoApproveEdits}:{},...r.feedback!==void 0?{feedback:r.feedback}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}};p();var Wlt=class{constructor(e){this.getSessions=e}static{a(this,"ClaudeMcpSyncTarget")}async syncToActiveSessions(e){await Promise.all(this.getSessions().map(r=>r.reloadInjectedMcpServers(e)))}};p();var oei=fe(require("http")),Jfr=require("node:stream/promises");Mo();var Qg=new pe("ClaudeMessagesProxyServer"),WWs=["interleaved-thinking","context-management","advanced-tool-use"],Kfr="cls_claude_agent",qg={InvalidRequest:"invalid_request_error",Authentication:"authentication_error",Permission:"permission_error",NotFound:"not_found_error",RequestTooLarge:"request_too_large",RateLimit:"rate_limit_error",Api:"api_error",Overloaded:"overloaded_error"},zWs=new Map([[400,qg.InvalidRequest],[401,qg.Authentication],[402,qg.Permission],[403,qg.Permission],[404,qg.NotFound],[413,qg.RequestTooLarge],[424,qg.InvalidRequest],[429,qg.RateLimit],[466,qg.InvalidRequest],[529,qg.Overloaded]]),nei=1024,YWs=32e3,JX=class{constructor(e){this.ctx=e}static{a(this,"ClaudeMessagesProxyServer")}async start(){if(this._startPromise)return this._startPromise;let e=this._startInternal().catch(r=>{throw this._startPromise===e&&(this._startPromise=void 0),r});return this._startPromise=e,e}async stop(){let e=this._server;e&&(e.closeAllConnections(),await new Promise(r=>e.close(()=>r())),this._server=void 0,this._startPromise=void 0,this._config=void 0)}getConfig(){if(!this._config)throw new Error("ClaudeMessagesProxyServer: start() has not completed yet");return this._config}async _startInternal(){let e=`cls-claude-${Nt()}`,r=oei.createServer((n,o)=>{this._handleRequest(n,o,e)});return new Promise((n,o)=>{r.once("error",o),r.listen(0,"127.0.0.1",()=>{let s=r.address();if(!s||typeof s!="object"){o(new Error("ClaudeMessagesProxyServer: failed to obtain bound address"));return}this._server=r,this._config={port:s.port,nonce:e},Qg.info(this.ctx,`proxy listening on http://127.0.0.1:${s.port}`),r.removeListener("error",o),n(this._config)})})}async _handleRequest(e,r,n){try{if(Qg.debug(this.ctx,`incoming request: ${e.method} ${e.url}`),e.method==="OPTIONS"){r.writeHead(200),r.end();return}if(e.method==="GET"&&e.url==="/"){r.writeHead(200,{"Content-Type":"text/plain"}),r.end("Hello from ClaudeMessagesProxyServer");return}if(e.method==="POST"&&this._isMessagesPath(e.url)){await this._handleMessagesRequest(e,r,n);return}this._sendErrorResponse(r,404,qg.NotFound,"Not found")}catch(o){Qg.exception(this.ctx,o,"._handleRequest"),this._sendErrorResponse(r,500,qg.Api,"Internal proxy error")}}_isMessagesPath(e){if(!e)return!1;let r=e.startsWith("//")?e.slice(1):e,n;try{n=new URL(r,"http://127.0.0.1").pathname}catch{return!1}return n==="/v1/messages"||n==="/messages"}async _handleMessagesRequest(e,r,n){let o=KWs(e.headers,n);if(!o.valid){Qg.error(this.ctx,"rejected request with invalid Authorization header"),this._sendErrorResponse(r,401,qg.Authentication,"Invalid authentication");return}o.sessionId&&Qg.debug(this.ctx,`authorized request for session ${o.sessionId}`);let s=await szs(e),c;try{c=JSON.parse(s)}catch(l){Qg.error(this.ctx,`invalid JSON in request body: ${l instanceof Error?l.message:String(l)}`),this._sendErrorResponse(r,400,qg.InvalidRequest,"Request body is not valid JSON");return}await this._forwardToCAPI(c,s,e.headers,r,o.sessionId)}async _forwardToCAPI(e,r,n,o,s){let c=this.ctx.get(Ft),l=this.ctx.get(nr),u;try{u=await c.getToken()}catch(_){Qg.exception(this.ctx,_,"._forwardToCAPI/getToken"),this._sendErrorResponse(o,401,qg.Authentication,"Failed to acquire Copilot token");return}let d=await this._lookupModelMetadata(e),f=this._maybeStripCacheControl(e,r),h=this._maybeRewriteThinking(e,f,d,s),m=fle(this.ctx,u,"v1/messages"),g=ZWs(this.ctx,n,d),A;try{({headers:A}=await dle(this.ctx,g,u.token))}catch(_){Qg.exception(this.ctx,_,"._forwardToCAPI/applyMsBenchAuth"),this._sendErrorResponse(o,401,qg.Authentication,"Failed to acquire MSBench credentials");return}let y=new AbortController,E=a(()=>{y.signal.aborted||(Qg.debug(this.ctx,"client disconnected \u2014 aborting upstream request"),y.abort())},"onClose");o.on("close",E);try{let _=await l.fetch(m,{method:"POST",headers:A,body:h,signal:y.signal});if(ple(this.ctx,_,"v1/messages"),!_.ok){let w=await _.text(),R=w.length<=360?w:w.slice(0,360)+"\u2026";Qg.error(this.ctx,`upstream CAPI returned ${_.status} ${_.statusText}: ${R}`),this._sendErrorResponse(o,_.status,azs(_.status),this._buildTranslatedErrorMessage(_,w,u));return}let v=_.headers.get("content-type")??"text/event-stream";o.writeHead(_.status,{"Content-Type":v,"Cache-Control":"no-cache",Connection:"keep-alive"});let b=_.body();if(!b){o.end();return}let T=v.toLowerCase().includes("text/event-stream");if(s&&T){let w=this.ctx.get(Am),R=ANe(x=>{w.addCopilotUsageNanoAiuForSession(s,x)});await(0,Jfr.pipeline)(b,R,o)}else await(0,Jfr.pipeline)(b,o)}catch(_){if(y.signal.aborted){Qg.debug(this.ctx,"upstream fetch aborted by client disconnect"),o.writableEnded||o.end();return}if(Qg.exception(this.ctx,_,"._forwardToCAPI"),o.headersSent||o.writableEnded){o.destroy();return}this._sendErrorResponse(o,500,qg.Api,"Upstream request failed")}finally{o.removeListener("close",E)}}async _lookupModelMetadata(e){let r=typeof e.model=="string"?e.model:void 0;if(r)try{return(await this.ctx.get(xs).getMetadata()).find(s=>s.id===r)}catch(n){Qg.debug(this.ctx,`model metadata lookup failed for "${r}": ${n instanceof Error?n.message:String(n)}`);return}}_maybeRewriteThinking(e,r,n,o){if(!n)return Zfr(e)?(Qg.debug(this.ctx,"stripped output_config.effort for request with unresolved model metadata"),JSON.stringify(e)):r;let s=o?this.ctx.get(Am).getReasoningEffortForSession(o):void 0;if(s&&n.capabilities?.supports?.adaptive_thinking){let l=n.capabilities?.supports?.reasoning_effort;(!l||!l.includes(s))&&Qg.warn(this.ctx,`dropping unsupported reasoning_effort "${s}" for model ${n.id}; advertised=[${l?.join(",")??""}]`)}return tzs(e,n,s)?(Qg.debug(this.ctx,`normalized thinking field for model ${n.id} to ${n.capabilities?.supports?.adaptive_thinking?"adaptive":"legacy"} shape`),JSON.stringify(e)):r}_maybeStripCacheControl(e,r){return ezs(e)?(Qg.debug(this.ctx,"stripped unknown sub-fields from cache_control.ephemeral before forwarding to CAPI"),JSON.stringify(e)):r}_buildTranslatedErrorMessage(e,r,n){let o=e.status,s=this._buildReasonForStatus(e,r,n),c=o===429?{capiErrorCode:czs(r),copilotPlan:n.userInfo?.copilotPlan,suggestSwitchToAuto:!1}:void 0;return Y_.translateErrorMessage(o,s,void 0,mM(e),void 0,c)}_buildReasonForStatus(e,r,n){let o=e.status;if(o===402)try{let s=this.ctx.get(Eu).overageEnabled;return Y_.translate402Reason(r,{retryAfterHeader:e.headers.get("retry-after")??void 0,retryAfterSeconds:mM(e),copilotPlan:n.userInfo?.copilotPlan,isTBBEnabled:n.userInfo?.isTBBEnabled,canUpgradePlan:n.userInfo?.canUpgradePlan,overageEnabled:s})}catch(s){return Qg.exception(this.ctx,s,"._buildReasonForStatus/402"),iei(r)??"Quota Exceeded."}if(o===400){let s=Y_.translate400Reason(r);if(s!==void 0)return s}return iei(r)}_sendErrorResponse(e,r,n,o){let s={type:"error",error:{type:n,message:o}};e.writeHead(r,{"Content-Type":"application/json"}),e.end(JSON.stringify(s))}};function KWs(t,e){let r=t.authorization;if(typeof r!="string"||!r.startsWith("Bearer "))return{valid:!1,sessionId:void 0};let n=r.slice(7),o=n.indexOf(".");if(o===-1)return{valid:n===e,sessionId:void 0};let s=n.slice(0,o),c=n.slice(o+1).trim();return s===e?{valid:!0,sessionId:c.length>0?c:void 0}:{valid:!1,sessionId:void 0}}a(KWs,"extractSessionId");function JWs(t){let e=t.split(",").map(r=>r.trim()).filter(r=>r&&WWs.some(n=>r===n||r.startsWith(n+"-")));return e.length>0?e.join(","):void 0}a(JWs,"filterSupportedBetas");function ZWs(t,e,r){let n=e.accept,o=typeof n=="string"&&n.length>0?n:"text/event-stream",s={...Vh(t),"Content-Type":"application/json",Accept:o},c=e["anthropic-beta"],l=Array.isArray(c)?c.join(","):c,u=l?JWs(l):void 0,d=r!==void 0&&!r.capabilities?.supports?.adaptive_thinking,f=XWs(u,d?kYe:void 0);f&&(s["anthropic-beta"]=f);let h=e["user-agent"];if(h){let m=h.indexOf("/");s["User-Agent"]=m===-1?`${Kfr}/${h}`:`${Kfr}${h.substring(m)}`}else s["User-Agent"]=Kfr;return s}a(ZWs,"buildUpstreamHeaders");function XWs(t,e){let r=new Set;for(let n of[t,e])if(n)for(let o of n.split(",")){let s=o.trim();s&&r.add(s)}return r.size>0?[...r].join(","):void 0}a(XWs,"mergeBetas");function ezs(t){let e=!1,r=a(c=>!!c&&typeof c=="object","isObject"),n=a(c=>{if(!r(c))return;let l=c.cache_control;if(r(l)&&l.type==="ephemeral")for(let u of Object.keys(l))u!=="type"&&(delete l[u],e=!0)},"stripBlock"),o=a(c=>{if(Array.isArray(c))for(let l of c)n(l)},"stripBlocks");o(t.system);let s=t.messages;if(Array.isArray(s))for(let c of s){if(!r(c))continue;let l=c.content;if(Array.isArray(l))for(let u of l)n(u),r(u)&&o(u.content)}return o(t.tools),e}a(ezs,"sanitizeCacheControl");function tzs(t,e,r){if(!e)return!1;let n=t.thinking,o=n&&typeof n=="object"?n.type:void 0;return o==="adaptive"||o==="enabled"?e.capabilities?.supports?.adaptive_thinking?rzs(t,n,e,r):ozs(t,n):nzs(t,e)}a(tzs,"normalizeThinkingForModel");function rzs(t,e,r,n){let o=r.capabilities?.supports?.reasoning_effort,s=!!o&&o.length>0,c=e.type==="adaptive"&&Object.keys(e).length===1,l=t.output_config;if(!s){let h=!!l&&typeof l=="object"&&"effort"in l;return c&&!h?!1:(t.thinking={type:"adaptive"},Zfr(t),!0)}let u=izs(n,o),d=vO(o,u)??"medium",f=typeof l?.effort=="string"&&l.effort===d;return c&&f?!1:(t.thinking={type:"adaptive"},t.output_config={...l??{},effort:d},!0)}a(rzs,"_writeAdaptiveShape");function Zfr(t){let e=t.output_config;if(!e||typeof e!="object")return!1;let r=e;return"effort"in r?(delete r.effort,Object.keys(r).length===0&&delete t.output_config,!0):!1}a(Zfr,"_deleteEffortKey");function nzs(t,e){let r=e.capabilities?.supports?.reasoning_effort;return!!r&&r.length>0?!1:Zfr(t)}a(nzs,"_stripUnsupportedThinkingEffort");function izs(t,e){if(t&&!(!e||!e.includes(t)))return t}a(izs,"_normaliseUserEffortForCapi");function ozs(t,e){let r=e.budget_tokens,n=typeof r=="number"&&Number.isFinite(r)&&r>0?r:nei,o=Math.min(YWs,Math.max(nei,n)),s=e.type==="enabled"&&e.budget_tokens===o,c=t.output_config!==void 0;return s&&!c?!1:(t.thinking={type:"enabled",budget_tokens:o},c&&delete t.output_config,!0)}a(ozs,"_writeLegacyShape");function szs(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{n.push(typeof o=="string"?Buffer.from(o,"utf8"):o)}),t.on("end",()=>e(Buffer.concat(n).toString("utf8"))),t.on("error",r)})}a(szs,"readRequestBody");function azs(t){return zWs.get(t)??qg.Api}a(azs,"mapStatusToAnthropicErrorType");function iei(t){if(t)try{let e=JSON.parse(t),r=e.error;if(r&&typeof r=="object"&&"message"in r){let n=r.message;if(typeof n=="string")return n}if(typeof e.message=="string")return e.message}catch{}}a(iei,"extractErrorMessage");function czs(t){if(t)try{let e=JSON.parse(t),r=e.error;if(r&&typeof r=="object"&&"code"in r){let n=r.code;if(typeof n=="string")return n}if(typeof e.code=="string")return e.code}catch{}}a(czs,"extractErrorCode");p();function sei(t){return t.replace(/[-.]/g,"").toLowerCase()}a(sei,"normalizeModelId");function aei(t,e){if(!t||e.some(s=>s.id===t))return t;let r=t.replace(/-\d{8}$/,""),n=sei(r);return e.find(s=>sei(s.id)===n)?.id??t}a(aei,"mapCapiModelIdToPickerId");Mo();var jg=new pe("ClaudeCodeAgent"),Hg="ClaudeCodeAgentService";function lzs(t){return{id:`claude-code:/agents/${encodeURIComponent(t.name)}`,name:t.name,description:t.description,providers:["CLAUDE"],invokePolicy:b7t,isReadonly:!0,isBuiltIn:!0}}a(lzs,"toRuntimeClaudeAgent");var w8=class{constructor(e,r){this.ctx=e;this.sdkWrapper=r;this._sessions=new Map;this.notificationSender=e.get(es);try{this.runtimeSourceRegistration=e.get(jd).registerRuntimeAgentSource({provider:"CLAUDE",getAgents:a(async o=>(await this.getSupportedAgentsForWorkspace(o)).map(lzs),"getAgents")})}catch(o){if(!(o instanceof $l&&o.ctor===jd))throw o}let n=new Wlt(()=>[...this._sessions.values()]);this._mcpSync=new sme(this.ctx,"ClaudeCode.McpSync",n)}static{a(this,"ClaudeCodeAgentService")}async getSupportedAgentsForWorkspace(e){let r=new Set(e.map(c=>fg(ln(c.uri)))),n=[...this._sessions.values()].filter(c=>r.has(fg(c.cwd)));if(n.length===0)return[];let o=await Promise.all(n.map(c=>c.supportedAgents())),s=new Map;for(let c of o)for(let l of c){let u=l.name.toLowerCase();s.has(u)||s.set(u,l)}return[...s.values()]}async createSession(e){return kb(this.ctx,"claudeCodeAgent.createSession",async r=>{await SXn(this.ctx,e);let n=e.sessionId??Nt(),o=this._sessions.get(n);if(o)return jg.info(this.ctx,`${Hg}.createSession: returning existing in-memory session`,{sessionId:n}),r.properties.reason="idempotentHit",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:o.cwd};let s=ln(e.workspaceFolder.uri),c=await this._ensureProxyConfig(),l=new yNe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:s,model:e.model,isNewSession:!0,proxyConfig:c});return this._sessions.set(n,l),jg.info(this.ctx,`${Hg}.createSession`,{sessionId:n,cwd:s}),r.properties.reason="created",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:s}})}async resumeSession(e){return kb(this.ctx,"claudeCodeAgent.resumeSession",async r=>{await TXn(this.ctx,e);let{sessionId:n}=e,o,s,c=this._sessions.get(n);if(c)jg.info(this.ctx,`${Hg}.resumeSession: returning existing in-memory session`,{sessionId:n}),o=c.cwd,s="memory";else{let u=await this.sdkWrapper.getSessionInfo(n);if(!u?.cwd)throw new Error(`Session not found: ${n}`);let d=u.cwd,f=await this._ensureProxyConfig(),h=new yNe(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:d,model:e.model,isNewSession:!1,proxyConfig:f});this._sessions.set(n,h),jg.info(this.ctx,`${Hg}.resumeSession: resumed from SDK transcript`,{sessionId:n,cwd:d}),o=d,s="disk"}let l;try{let u=this.sdkWrapper.getSessionMessages(n,{includeSystemMessages:!0}),d=this.ctx.get(xs).getMetadata().catch(m=>(jg.debug(this.ctx,`${Hg}.resumeSession: model metadata unavailable for id mapping`,{sessionId:n,error:m instanceof Error?m.message:String(m)}),[])),[f,h]=await Promise.all([u,d]);l=eei(f,m=>aei(m,h)),r.properties.transcriptOk="true"}catch(u){jg.warn(this.ctx,`${Hg}.resumeSession: failed to translate on-disk transcript`,{sessionId:n,error:u instanceof Error?u.message:String(u)}),r.properties.transcriptOk="false",r.properties.transcriptErrorName=u instanceof Error?u.name:"Unknown"}return r.properties.reason=s,r.properties.modelId=e.model??"",r.measurements.eventCount=l?.length??0,{sessionId:n,workspacePath:o,events:l}})}async sendMessage(e,r){return kb(this.ctx,"claudeCodeAgent.sendMessage",async n=>{await IXn(this.ctx,e);let o=e.sessionId,s=this._sessions.get(o);if(!s)throw new Error(`Session not found: ${o} \u2014 call createSession or resumeSession before sendMessage`);let c={uri:ts(s.cwd)};await this.ctx.get(Ig).applyPromptTemplateToRequest(e,[c]);let l=Nt(),u=performance.now();return s.invoke({message:e.message,references:e.references,model:e.model,permissionMode:e.agentMode,reasoningEffort:e.reasoningEffort,messageId:l,token:r}).catch(d=>{jg.warn(this.ctx,`${Hg}.sendMessage: invoke rejected`,{sessionId:o,error:d instanceof Error?d.message:String(d)}),ng(this.ctx,"claudeCodeAgent.sendMessage.failure",d,{success:"false",reason:"invoke"},{totalTimeMs:performance.now()-u})}),n.properties.reason="dispatched",n.properties.modelId=e.model??"",n.properties.hasReferences=String((e.references?.length??0)>0),n.measurements.messageCharLen=e.message.length,n.measurements.referenceCount=e.references?.length??0,{messageId:l}})}truncateHistory(e){return Promise.reject(this.unsupported("truncateHistory"))}forkSession(e){return Promise.reject(this.unsupported("forkSession"))}async listSessions(e){return kb(this.ctx,"claudeCodeAgent.listSessions",async r=>{RXn(this.ctx,e),jg.info(this.ctx,`${Hg}.listSessions`,e);let o=(await this.sdkWrapper.listSessions({dir:e.cwd})).map(s=>({sessionId:s.sessionId,summary:s.summary,startTime:new Date(s.createdAt??s.lastModified).toISOString(),modifiedTime:new Date(s.lastModified).toISOString(),isRemote:!1,context:s.cwd!==void 0?{cwd:s.cwd,branch:s.gitBranch}:void 0}));return jg.info(this.ctx,`${Hg}.listSessions returned`,{count:o.length}),r.measurements.count=o.length,{sessions:o}})}async listModels(e){return kb(this.ctx,"claudeCodeAgent.listModels",async r=>{kXn(this.ctx,{agentProvider:"CLAUDE",forceRefresh:e}),jg.info(this.ctx,`${Hg}.listModels`,{forceRefresh:e});let s=(await this.ctx.get(xs).getMetadata(e)).filter(c=>c.model_picker_enabled===!0).filter(c=>c.capabilities.type==="chat").filter(c=>eVe(c.capabilities.family)).map(tfe);return jg.info(this.ctx,`${Hg}.listModels returned`,{count:s.length}),r.properties.forceRefresh=String(e??!1),r.measurements.count=s.length,{models:s}})}async stopSession(e){await kb(this.ctx,"claudeCodeAgent.stopSession",async r=>{xXn(this.ctx,{agentProvider:"CLAUDE",sessionId:e});let n=this._sessions.get(e);if(!n){jg.info(this.ctx,`${Hg}.stopSession: unknown session`,{sessionId:e}),r.properties.reason="unknownSession";return}await n.interrupt()})}destroySession(e){return kb(this.ctx,"claudeCodeAgent.destroySession",r=>{wXn(this.ctx,e);let{sessionId:n}=e;try{let o=this._sessions.get(n);return o?(o.dispose(),this._sessions.delete(n),jg.info(this.ctx,`${Hg}.destroySession`,{sessionId:n}),{success:!0}):(jg.info(this.ctx,`${Hg}.destroySession: unknown session`,{sessionId:n}),r.properties.reason="unknownSession",{success:!0})}catch(o){return jg.error(this.ctx,`${Hg}.destroySession: failed`,{sessionId:n,error:o instanceof Error?o.message:String(o)}),r.error=o,r.properties.reason="exception",{success:!1}}})}async setModel(e,r){await kb(this.ctx,"claudeCodeAgent.setModel",async n=>{let o=this._sessions.get(e);if(!o){jg.info(this.ctx,`${Hg}.setModel: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await mNe(this.ctx,r),await o.setModel(r),n.properties.modelId=r??""})}async setPermissionMode(e,r){await kb(this.ctx,"claudeCodeAgent.setPermissionMode",async n=>{let o=this._sessions.get(e);if(!o){jg.info(this.ctx,`${Hg}.setPermissionMode: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await o.setPermissionMode(r),n.properties.permissionMode=r??""})}get sessionCount(){return this._sessions.size}unsupported(e){return new Error(`${e} is not supported by ClaudeCodeAgentService`)}handleInteraction(e){let r=this._sessions.get(e.sessionId);if(!r)return jg.warn(this.ctx,`${Hg}.handleInteraction: unknown session`,{sessionId:e.sessionId,requestId:e.requestId,interactionType:e.type}),Promise.resolve({success:!1});let n=r.respondToInteraction(e);return Promise.resolve({success:n})}getPlanPath(){return Promise.reject(this.unsupported("getPlanPath"))}enableRemote(){return Promise.reject(this.unsupported("enableRemote"))}disableRemote(){return Promise.reject(this.unsupported("disableRemote"))}getRemoteStatus(){throw this.unsupported("getRemoteStatus")}compactHistory(){return Promise.reject(this.unsupported("compactHistory"))}stopCompactHistory(){return Promise.reject(this.unsupported("stopCompactHistory"))}dispose(){this.runtimeSourceRegistration?.dispose(),this.runtimeSourceRegistration=void 0,this._mcpSync.dispose();for(let e of this._sessions.values())e.dispose();this._sessions.clear()}async _ensureProxyConfig(){return this.ctx.get(JX).start()}};p();var Xfr=new Cn;function cei(t){return[...t].sort((e,r)=>{let n=Xfr.get(e.uri)??0;return(Xfr.get(r.uri)??0)-n})}a(cei,"sortByAccessTimes");var lei=a(t=>t.get($r).onDidFocusTextDocument(e=>{e.document&&Xfr.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");p();p();p();var uei=fe(require("events"));var zlt="CompletionRequested",n4=class{constructor(e){this.ctx=e}static{a(this,"CompletionNotifier")}#e=new uei.default;notifyRequest(e,r,n,o,s){return this.#e.emit(zlt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=K0(this.ctx,e,`event.${zlt}`);return this.#e.on(zlt,r),Fn.Disposable.create(()=>this.#e.off(zlt,r))}};p();p();var epr=class{constructor(){this.observers=new Set}static{a(this,"Subject")}subscribe(e){return this.observers.add(e),()=>this.observers.delete(e)}next(e){for(let r of this.observers)r.next(e)}error(e){for(let r of this.observers)r.error?.(e)}complete(){for(let e of this.observers)e.complete?.()}},Ylt=class extends epr{static{a(this,"ReplaySubject")}subscribe(e){let r=super.subscribe(e);return this._value!==void 0&&e.next(this._value),r}next(e){this._value=e,super.next(e)}};var Pb=class{constructor(e){this.ctx=e;this.#e=new pe("AsyncCompletionManager");this.requests=new Cn(100);this.mostRecentRequestId=""}static{a(this,"AsyncCompletionManager")}#e;clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(tpr(e,r,o))return!0;return!1}updateCompletion(e,r){let n=this.requests.get(e);n!==void 0&&(n.partialCompletionText=r,n.subject.next(n))}queueCompletionRequest(e,r,n,o,s){this.#e.debug(this.ctx,`[${e}] Queueing async completion request:`,r.substring(r.lastIndexOf(` +`)+1));let c=new Ylt;return this.requests.set(e,{state:2,cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c}),s.then(l=>{if(this.requests.delete(e),l.type!=="success"){this.#e.debug(this.ctx,`[${e}] Request failed with`,l.reason),c.error(l.reason);return}let u={cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c,choice:l.value[0],result:l,state:0,allChoicesPromise:l.value[1]};this.requests.set(e,u),c.next(u),c.complete()}).catch(l=>{this.#e.error(this.ctx,`[${e}] Request errored with`,l),this.requests.delete(e),c.error(l)})}getFirstMatchingRequestWithTimeout(e,r,n,o,s){let c=this.ctx.get(Jt).asyncCompletionsTimeout(s);return c<0?(this.#e.debug(this.ctx,`[${e}] Waiting for completions without timeout`),this.getFirstMatchingRequest(e,r,n,o)):(this.#e.debug(this.ctx,`[${e}] Waiting for completions with timeout of ${c}ms`),Promise.race([this.getFirstMatchingRequest(e,r,n,o),new Promise(l=>setTimeout(()=>l(null),c))]).then(l=>{if(l===null){this.#e.debug(this.ctx,`[${e}] Timed out waiting for completion`);return}return l}))}async getFirstMatchingRequest(e,r,n,o){o||(this.mostRecentRequestId=e);let s=!1,c=new kA,l=new Map,u=a(f=>()=>{let h=l.get(f);h!==void 0&&(h(),l.delete(f),!s&&l.size===0&&(s=!0,this.#e.debug(this.ctx,`[${e}] No matching completions found`),c.resolve(void 0)))},"finishRequest"),d=a(f=>{if(tpr(r,n,f)){if(f.state===0){let h=r.substring(f.prefix.length),{completionText:m}=f.choice;if(!m.startsWith(h)||m.length<=h.length){u(f.headerRequestId)();return}m=m.substring(h.length),f.choice.telemetryData.measurements.foundOffset=h.length,this.#e.debug(this.ctx,`[${e}] Found completion at offset ${h.length}: ${JSON.stringify(m)}`),c.resolve([{...f.choice,completionText:m},f.allChoicesPromise]),s=!0}}else this.cancelRequest(e,f),u(f.headerRequestId)()},"next");for(let[f,h]of this.requests)tpr(r,n,h)?l.set(f,h.subject.subscribe({next:d,error:u(f),complete:u(f)})):this.cancelRequest(e,h);return c.promise.finally(()=>{for(let f of l.values())f()})}cancelRequest(e,r){e===this.mostRecentRequestId&&r.state!==0&&(this.#e.debug(this.ctx,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};function tpr(t,e,r){if(r.prompt.suffix!==e.suffix||!t.startsWith(r.prefix))return!1;let n=t.substring(r.prefix.length);return r.state===0?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(tpr,"isCandidate");p();p();var _Ne=class{constructor(e){this.maxSize=e;this.root=new ENe;this.leafNodes=new Set}static{a(this,"LRURadixTrie")}set(e,r){let{node:n,remainingKey:o}=this.findClosestNode(e);if(o.length>0){for(let[s,c]of n.children)if(s.startsWith(o)){let l=s.slice(0,o.length),u=new ENe;n.removeChild(s),n.addChild(l,u),u.addChild(s.slice(l.length),c),n=u,o=o.slice(l.length);break}if(o.length>0){let s=new ENe;n.addChild(o,s),n=s}}n.value=r,this.leafNodes.add(n),this.leafNodes.size>this.maxSize&&this.evictLeastRecentlyUsed()}findAll(e){return this.findClosestNode(e).stack.map(({node:r,remainingKey:n})=>r.value!==void 0?{remainingKey:n,value:r.value}:void 0).filter(r=>r!==void 0)}delete(e){let{node:r,remainingKey:n}=this.findClosestNode(e);n.length>0||this.deleteNode(r)}findClosestNode(e){let r=!0,n=this.root,o=[{node:n,remainingKey:e}];for(;e.length>0&&r;){r=!1;for(let[s,c]of n.children)if(e.startsWith(s)){e=e.slice(s.length),o.unshift({node:c,remainingKey:e}),n=c,r=!0;break}}return{node:n,remainingKey:e,stack:o}}deleteNode(e){if(e.value=void 0,this.leafNodes.delete(e),e.parent===void 0||e.childCount>1)return;let{node:r,edge:n}=e.parent;if(e.childCount===1){let[s,c]=Array.from(e.children)[0];e.removeChild(s),r.removeChild(n),r.addChild(n+s,c);return}if(r.removeChild(n),r.parent===void 0)return;let o=r.parent;if(r.value===void 0&&r.childCount===1){let[s,c]=Array.from(r.children)[0],l=o.edge+s;r.removeChild(s),o.node.removeChild(o.edge),o.node.addChild(l,c)}}evictLeastRecentlyUsed(){let e=this.findLeastRecentlyUsed();e&&this.deleteNode(e)}findLeastRecentlyUsed(){let e;for(let r of this.leafNodes)(e===void 0||r.touchedo.content.filter(s=>s.suffix===r&&s.choice.completionText.startsWith(n)&&s.choice.completionText.length>n.length).map(s=>({...s.choice,completionText:s.choice.completionText.slice(n.length),telemetryData:s.choice.telemetryData.extendedBy({},{foundOffset:n.length})})))}append(e,r,n){let o=this.cache.findAll(e);if(o.length>0&&o[0].remainingKey===""){let s=o[0].value.content;this.cache.set(e,{content:[...s,{suffix:r,choice:n}]})}else this.cache.set(e,{content:[{suffix:r,choice:n}]})}clear(){this.cache=new _Ne(100)}};p();var Db=class{constructor(){this.choices=[]}static{a(this,"CurrentGhostText")}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==2&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&dei(this.choices[0].completionText,n))return uzs(this.choices,n)}hasAcceptedCurrentCompletion(e,r){let n=this.getRemainingPrefix(e,r);if(n===void 0)return!1;let o=n===this.choices?.[0].completionText,s=this.choices?.[0].finishReason;return o&&s==="stop"}getRemainingPrefix(e,r){if(!(this.prefix===void 0||this.suffix===void 0||this.choices.length===0)&&this.suffix===r&&e.startsWith(this.prefix))return e.substring(this.prefix.length)}};function uzs(t,e){return t.filter(r=>dei(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(uzs,"adjustChoicesStart");function dei(t,e){return t.startsWith(e)&&t.length>e.length}a(dei,"startsWithAndExceeds");p();p();var R8={" ":1,"!":2,'"':3,"#":4,$:5,"%":6,"&":7,"'":8,"(":9,")":10,"*":11,"+":12,",":13,"-":14,".":15,"/":16,0:17,1:18,2:19,3:20,4:21,5:22,6:23,7:24,8:25,9:26,":":27,";":28,"<":29,"=":30,">":31,"?":32,"@":33,A:34,B:35,C:36,D:37,E:38,F:39,G:40,H:41,I:42,J:43,K:44,L:45,M:46,N:47,O:48,P:49,Q:50,R:51,S:52,T:53,U:54,V:55,W:56,X:57,Y:58,Z:59,"[":60,"\\":61,"]":62,"^":63,_:64,"`":65,a:66,b:67,c:68,d:69,e:70,f:71,g:72,h:73,i:74,j:75,k:76,l:77,m:78,n:79,o:80,p:81,q:82,r:83,s:84,t:85,u:86,v:87,w:88,x:89,y:90,z:91,"{":92,"|":93,"}":94,"~":95};p();function fei(t){let e;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>427.50000000000006?t[9]>13.500000000000002?t[121]>1e-35?e=-.3793786744885956:t[149]>1e-35?e=-.34717430705356905:e=-.26126834451035963:e=-.2431318366096852:t[5]>888.5000000000001?e=-.20600463586387135:e=-.2568037008471491:t[308]>1e-35?e=-.2363064824497454:t[8]>370.50000000000006?e=-.37470755210284723:e=-.321978453730494:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?e=-.26259136509758885:e=-.3096719634039438:t[4]>30.500000000000004?t[9]>18.500000000000004?e=-.34254903852890883:t[2]>98.50000000000001?e=-.41585250791146294:e=-.3673574858887241:t[9]>6.500000000000001?e=-.31688079287876225:t[31]>1e-35?e=-.29110977864003823:t[308]>1e-35?e=-.3201411739040839:e=-.36874023066055506:t[8]>691.5000000000001?t[82]>1e-35?e=-.41318393149040566:t[133]>1e-35?e=-.3741272613525161:t[32]>1e-35?e=-.4112378041027121:t[227]>1e-35?e=-.37726615155719356:t[10]>3.5000000000000004?e=-.3164502293560397:e=-.2930071546509045:t[9]>13.500000000000002?e=-.277366858539218:t[308]>1e-35?t[4]>10.500000000000002?e=-.30975610686807187:t[4]>1.5000000000000002?e=-.2549142136728043:e=-.3271325650785176:t[127]>1e-35?t[0]>1937.5000000000002?e=-.2533046188098832:e=-.325520883579:e=-.331628896481776;let r;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?t[9]>13.500000000000002?r=.031231253521808708:r=.05380836288014532:t[5]>423.00000000000006?t[8]>114.50000000000001?r=.06751619128429062:r=.09625089153176467:r=.027268163053989804:t[308]>1e-35?r=.060174483556283756:r=-.049062854038919135:t[3]>24.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?r=-.03969241799174589:r=.01086816842550381:t[31]>1e-35?r=-.003284694817583201:t[9]>6.500000000000001?t[4]>30.500000000000004?r=-.04224490699947552:r=-.011834162944360616:t[308]>1e-35?t[32]>1e-35?r=-.13448447971850278:r=-.019569456707046823:t[19]>1e-35?t[9]>1.5000000000000002?r=-.07256260662659254:t[4]>60.50000000000001?r=-.08227503453609311:r=-.020596416747563847:r=-.07396549241564149:t[8]>691.5000000000001?t[82]>1e-35?r=-.10046536995362734:t[133]>1e-35?r=-.06407649822752297:t[225]>1e-35?r=.08035785003303324:t[92]>1e-35?r=.018901360933204676:t[20]>1e-35?r=.05252546973665552:t[8]>2592.5000000000005?r=-.040543705016462955:r=-.011236043818320725:t[9]>17.500000000000004?r=.025560632674895334:t[308]>1e-35?t[0]>1847.5000000000002?r=.03527165701669741:r=-.0071847350825815035:t[127]>1e-35?r=.024373016379595405:t[9]>2.5000000000000004?r=-.0035090719709448288:r=-.03514829488063766;let n;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?n=.03848674861536988:t[5]>423.00000000000006?t[8]>114.50000000000001?t[9]>56.50000000000001?n=-.003764520033319488:n=.06570817919969299:t[4]>61.50000000000001?n=.028346156293069538:n=.0908154644362606:n=.02445594243234816:t[308]>1e-35?t[8]>65.50000000000001?n=.0019305229020073053:n=.09279357295883772:n=-.04458984161917124:t[3]>24.500000000000004?t[23]>1e-35?n=.0027405390271277013:t[4]>29.500000000000004?t[52]>1e-35?n=.044727478132905285:t[115]>1e-35?n=.10245804828855934:t[9]>17.500000000000004?n=-.03353173647469207:t[2]>98.50000000000001?n=-.10048106638102179:n=-.05484231104348874:t[31]>1e-35?n=.016807537467116516:t[9]>6.500000000000001?n=-.012113620535295137:t[4]>8.500000000000002?t[308]>1e-35?n=-.01882594250504289:n=-.05585658862796076:n=.04279591277938338:t[8]>691.5000000000001?t[82]>1e-35?n=-.09262278043707878:t[133]>1e-35?n=-.058454257768893625:t[32]>1e-35?n=-.09769348447126434:t[25]>1e-35?n=-.0725430043727677:t[122]>1e-35?n=-.10047841601578077:n=-.00580671054458958:t[9]>13.500000000000002?n=.021399199032818294:t[308]>1e-35?t[4]>10.500000000000002?n=-.0076376731757173515:n=.03394923033036848:t[127]>1e-35?n=.02070489091204209:n=-.02290162726126496;let o;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?o=.010230295672324606:o=.038540509248742805:t[8]>125.50000000000001?t[1]>49.50000000000001?o=.03086356292895467:o=.057128750867458604:t[5]>888.5000000000001?o=.07861602941396924:o=.030523262699070908:t[308]>1e-35?o=.048236117667577356:t[8]>370.50000000000006?o=-.05642125069212264:o=-.007232836777168195:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?o=.03640661467213915:o=-.005889820723907028:t[31]>1e-35?o=-.0009007166998276938:t[9]>6.500000000000001?o=-.022590340093882378:t[308]>1e-35?t[32]>1e-35?o=-.1215445089091064:o=-.01435612266219722:t[19]>1e-35?t[9]>1.5000000000000002?o=-.061555513040777825:t[4]>60.50000000000001?o=-.07053475504569347:o=-.013733369453963092:o=-.06302097189114152:t[227]>1e-35?o=-.05820440333190048:t[8]>683.5000000000001?t[82]>1e-35?o=-.08466979526809346:t[10]>24.500000000000004?o=-.017092159721119944:t[92]>1e-35?o=.03592901452463749:o=-.00359310519524756:t[5]>1809.5000000000002?t[243]>1e-35?o=-.03963116207386097:t[118]>1e-35?o=-.09483996283536394:t[217]>1e-35?o=-.03394542089519989:t[242]>1e-35?o=-.07985899422287938:o=.019706602160656964:t[9]>12.500000000000002?o=.014072998937735146:o=-.021156294523894684;let s;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?s=.009197756540516563:s=.03458896869535166:t[5]>5082.500000000001?s=.08265545468131008:t[131]>1e-35?s=.0740738432473315:s=.045159136632942756:t[8]>319.50000000000006?s=-.04653401534465376:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?s=-.011400839766681709:s=.11149800187510031:s=-.08683250977599462:s=.08355310136724753:t[4]>23.500000000000004?t[23]>1e-35?t[131]>1e-35?s=.040389083779932555:s=-.009887614274108602:t[52]>1e-35?s=.03705353499757327:t[9]>6.500000000000001?s=-.025401260429257562:t[2]>98.50000000000001?s=-.09237673187534504:s=-.04298556869281803:t[222]>1e-35?s=-.045221965895986184:t[8]>691.5000000000001?t[133]>1e-35?s=-.05435318330148897:t[128]>1e-35?s=-.08672907303184191:t[227]>1e-35?s=-.05568304584186561:t[122]>1e-35?s=-.09623059693538563:t[225]>1e-35?s=.07558331642202279:t[82]>1e-35?s=-.07360566227233566:s=-.005646164647395919:t[242]>1e-35?s=-.08203758341228108:t[9]>13.500000000000002?s=.018726123829696042:t[308]>1e-35?t[4]>10.500000000000002?s=-.011153942154062704:s=.03132858912391067:t[127]>1e-35?s=.021455228822345174:t[23]>1e-35?s=.01959966745346997:s=-.021764790177579325;let c;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>284.50000000000006?t[121]>1e-35?t[18]>1e-35?c=.07547602514276922:c=-.08529678832140396:c=.030314822344598043:t[5]>888.5000000000001?t[4]>61.50000000000001?c=.011143589009415464:c=.0654700456802118:c=.021794712646632755:t[308]>1e-35?c=.04231872551095028:c=-.034381999950549455:t[4]>23.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?c=-.03678981254332261:c=.010518160384496255:t[8]>825.5000000000001?c=-.04506534842082387:t[9]>38.50000000000001?c=.01004983052203438:c=-.030580958620701027:t[39]>1e-35?c=-.12802435021505382:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>6.500000000000001?c=.030426957004611704:c=-.0726407693060581:c=.017395521646964375:t[4]>7.500000000000001?t[0]>93.50000000000001?t[9]>7.500000000000001?c=-.008024349629981291:t[31]>1e-35?c=.01296539930850471:t[308]>1e-35?c=-.012855016509024084:c=-.04564527976851505:c=-.15681420504058596:t[10]>4.500000000000001?t[243]>1e-35?c=-.1012064426380198:c=-.0062808850924854194:c=.030706323726162416:t[9]>13.500000000000002?c=.017081636133736405:t[308]>1e-35?t[4]>10.500000000000002?c=-.009306613091760644:t[4]>1.5000000000000002?c=.03655523200850989:c=-.02671654212893341:t[127]>1e-35?c=.019261510468604387:c=-.017627818570628936;let l;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[308]>1e-35?l=.036100405995889276:l=.011709313297015793:t[0]>119.50000000000001?t[8]>125.50000000000001?l=.03622542297472574:l=.05595579157301536:l=-.02234751038146796:t[8]>319.50000000000006?l=-.040132029478400735:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?l=-.009306153573847916:l=.10058509567064988:l=-.0785668890966017:t[9]>28.500000000000004?l=-.04781977604130416:l=.09753292614937459:t[4]>23.500000000000004?t[131]>1e-35?l=.02372493254975127:t[148]>1e-35?l=.028103095989516644:t[4]>58.50000000000001?t[10]>1e-35?l=-.05000852203469597:l=.02922366846119705:t[23]>1e-35?l=-.0026335076988151292:l=-.03073993752935585:t[222]>1e-35?l=-.03867374428185713:t[32]>1e-35?l=-.07220729365053084:t[39]>1e-35?l=-.11624524614351733:t[8]>691.5000000000001?t[133]>1e-35?l=-.04836360271198036:t[8]>4968.500000000001?l=-.10873681915578029:t[149]>1e-35?l=-.11847484033769298:t[122]>1e-35?l=-.08916172460307559:t[82]>1e-35?l=-.06774726602152634:l=-.0033469147714351327:t[126]>1e-35?l=-.09474445392080015:t[8]>131.50000000000003?t[118]>1e-35?l=-.09002547031023511:l=.015475385187009489:t[25]>1e-35?l=-.08175501232759151:l=-.000429679055394914;let u;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?u=.021942996005324917:u=.042349138084484074:t[308]>1e-35?u=.036507270845732874:u=-.028981850556764995:t[3]>24.500000000000004?t[23]>1e-35?u=.00210930790963475:t[31]>1e-35?u=.006825358293027163:t[9]>6.500000000000001?u=-.013772084269062394:t[308]>1e-35?u=-.008307929099892574:t[19]>1e-35?u=-.027706313312904487:u=-.04891108984170914:t[134]>1e-35?u=-.0605730733844732:t[25]>1e-35?u=-.05347926493253117:t[227]>1e-35?u=-.049415829249003666:t[32]>1e-35?u=-.06807799662179595:t[308]>1e-35?t[4]>10.500000000000002?t[2]>13.500000000000002?u=-.00016302718260794637:u=-.10247095758122947:t[210]>1e-35?u=-.022149002072787024:t[95]>1e-35?u=.15222631630626304:u=.027393884520465712:t[9]>7.500000000000001?t[225]>1e-35?u=.13483346577752245:t[3]>9.500000000000002?t[243]>1e-35?u=-.045352728133789516:t[8]>683.5000000000001?u=.00474372227519902:u=.02635476098707525:t[92]>1e-35?u=.05659380819933452:t[105]>1e-35?u=.07431443210341222:t[186]>1e-35?u=.0915821133384904:u=-.016414750130401053:t[127]>1e-35?u=.011824693641866162:t[23]>1e-35?u=.0228468674288774:t[284]>1e-35?u=.06606936863302432:u=-.02872463273902358;let d;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>125.50000000000001?t[288]>1e-35?d=-.019844363904157558:t[1]>50.50000000000001?t[131]>1e-35?d=.044961338592245194:d=.003659599513761676:t[121]>1e-35?d=-.04057103630479994:d=.03158560697078578:t[0]>421.50000000000006?t[4]>61.50000000000001?d=-.0003708603406529278:d=.05331312264472391:d=.0006575958601218936:t[8]>319.50000000000006?d=-.034654694051901545:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?d=-.0076053515916517005:d=.09116695486305336:d=-.07137458699162028:d=.06633130654035282:t[4]>29.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?d=-.0308520802187302:d=.013156423968295541:t[115]>1e-35?d=.11581171687488252:t[52]>1e-35?t[10]>22.500000000000004?d=.12264179915175587:d=-.021905727233873535:t[8]>799.5000000000001?d=-.04181869575935412:d=-.023695901673350575:t[222]>1e-35?d=-.034612899265371776:t[8]>691.5000000000001?t[9]>98.50000000000001?d=-.06892116536821917:t[149]>1e-35?d=-.11194586444154514:t[133]>1e-35?d=-.04269583234000504:t[128]>1e-35?d=-.0644631966969502:t[8]>4968.500000000001?d=-.09650726096330133:d=-.004219129180139438:t[126]>1e-35?d=-.08038306745347751:t[5]>1809.5000000000002?d=.009265335288169993:t[9]>2.5000000000000004?d=.006447645462117438:d=-.021047132609551503;let f;t[13]>1e-35?t[3]>1.5000000000000002?t[9]>21.500000000000004?t[121]>1e-35?f=-.08436540015142402:t[8]>1861.5000000000002?f=-.01621425699342421:f=.01878613821895428:f=.031052879158242532:t[8]>319.50000000000006?f=-.031536619360997865:t[7]>3.5000000000000004?f=-.004510586962343298:f=.0596524941011746:t[4]>18.500000000000004?t[23]>1e-35?f=.004757490541310808:t[9]>6.500000000000001?f=-.008842393772207996:t[31]>1e-35?f=.0010536183837006993:t[308]>1e-35?f=-.008145882815435419:t[2]>98.50000000000001?f=-.08404937622173021:t[276]>1e-35?f=.0020072791321856663:t[19]>1e-35?f=-.023031820639490178:f=-.04553314326377875:t[8]>2134.5000000000005?f=-.02244583113572251:t[134]>1e-35?f=-.05592137394753121:t[308]>1e-35?t[49]>1e-35?f=.09989109704064947:t[4]>10.500000000000002?t[2]>13.500000000000002?f=-.00447733056482096:f=-.10191061664873849:f=.021765308380331864:t[9]>7.500000000000001?t[118]>1e-35?f=-.07570059131536411:t[243]>1e-35?f=-.040983393346598646:t[3]>9.500000000000002?f=.014763759061483812:t[92]>1e-35?f=.05136368898963024:f=-.008162398981149495:t[127]>1e-35?f=.013999119696708346:t[23]>1e-35?t[20]>1e-35?f=.14138985500120907:f=.008668274102844162:t[284]>1e-35?f=.06356484011042893:f=-.024781304572706303;let h;t[13]>1e-35?t[3]>8.500000000000002?t[8]>892.5000000000001?t[0]>384.50000000000006?h=.014387526569215037:t[8]>2266.5000000000005?h=-.1397298649743087:h=.007953931014097788:t[0]>119.50000000000001?t[4]>61.50000000000001?h=.0029819092211896296:t[218]>1e-35?h=.08450459375645737:h=.031646488019280654:h=-.03544960151460596:t[9]>9.500000000000002?h=-.026002317735915183:t[7]>1.5000000000000002?h=.005074258810794793:h=.0745247650477651:t[4]>29.500000000000004?t[131]>1e-35?h=.023269218675640847:t[148]>1e-35?h=.03812942399144545:t[115]>1e-35?h=.10512283476967227:h=-.02607307479736138:t[227]>1e-35?h=-.036576708299046294:t[101]>1e-35?h=.027948683650881864:t[149]>1e-35?h=-.08195628451594297:t[50]>1e-35?h=-.16997544922278504:t[8]>691.5000000000001?t[9]>101.50000000000001?h=-.06860333850762075:t[225]>1e-35?h=.06066641950951723:t[10]>22.500000000000004?t[1]>29.500000000000004?t[127]>1e-35?h=.028599705845427533:h=-.010746719511640914:t[0]>4877.500000000001?h=-.07251187886096228:h=-.021299712241446785:t[118]>1e-35?h=-.11902023760964736:h=15874469526809387e-21:t[8]>267.50000000000006?h=.01317292185402293:t[148]>1e-35?t[9]>20.500000000000004?h=.09614842415142123:h=.006049073167176467:t[189]>1e-35?h=.05562696451900713:h=-.006257541923837303;let m;t[13]>1e-35?t[9]>14.500000000000002?t[2]>11.500000000000002?t[1]>71.50000000000001?t[8]>1252.5000000000002?m=-.10069846585436666:m=-.010577995535809317:t[146]>1e-35?m=-.008877238274428668:t[280]>1e-35?m=.10076055897012692:t[6]>70.50000000000001?m=-.020603523042565547:t[7]>1.5000000000000002?m=.02819095420813202:m=-.1223354167911277:m=-.025073583348334844:t[8]>416.50000000000006?m=.01718560189149466:t[230]>1e-35?m=.12281803224342265:m=.03281276971308565:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?m=-.13070568109867683:t[4]>63.50000000000001?m=-.027221825262496814:m=.01530862490082352:t[9]>6.500000000000001?t[5]>4320.500000000001?t[2]>31.500000000000004?m=-.00605574271293711:m=.04739407327741249:m=-.012537528620315956:t[31]>1e-35?t[20]>1e-35?m=.1252215087035768:m=.003905888677601057:t[52]>1e-35?m=.045466299731038815:t[2]>100.50000000000001?m=-.07815624550168065:t[308]>1e-35?m=-.007715815250508057:t[276]>1e-35?t[9]>1.5000000000000002?m=-.03538265083203445:t[18]>1e-35?m=.1591211669800727:m=.015151475408241136:t[8]>557.5000000000001?m=-.04225569725456342:m=-.022455546324243267:t[308]>1e-35?m=.01325441736085826:t[197]>1e-35?m=.03752194600682512:t[225]>1e-35?m=.06583712394533976:m=-.005205289866839043;let g;t[13]>1e-35?t[9]>21.500000000000004?t[2]>12.500000000000002?g=.010264022580774884:g=-.02335958814489217:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?g=-.0936747137352166:t[0]>384.50000000000006?g=.019846244507320695:g=-.0751102554077272:g=-.026885329334203723:t[0]>966.5000000000001?t[10]>48.50000000000001?g=.11654906890054273:g=.0346250587613322:t[4]>39.50000000000001?g=-.08568002378645614:t[9]>16.500000000000004?g=-.12010535752923689:g=.021321923389033808:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?g=-.12056431231412057:t[131]>1e-35?g=.03652965550568472:g=.002563006128791669:t[9]>6.500000000000001?t[30]>1e-35?g=-.10141481732178981:g=-.003936457893178248:t[31]>1e-35?g=.008215898756249477:t[52]>1e-35?t[0]>4188.500000000001?g=.12972828769588213:g=-.003137412232297087:t[2]>100.50000000000001?g=-.0730872929087944:t[308]>1e-35?g=-.006958622747243333:t[35]>1e-35?t[0]>3707.5000000000005?g=.07934620723812878:g=-.018598568353702116:g=-.030635505446410763:t[128]>1e-35?g=-.06962290453843294:t[84]>1e-35?g=-.15290337844960322:t[308]>1e-35?t[8]>2543.5000000000005?g=-.034938657503885584:g=.016339322898966915:t[197]>1e-35?g=.03358907965870046:t[18]>1e-35?g=-.01754013791515288:g=-.0004944586067698557;let A;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?A=.005888790687820524:A=.0429676533834978:t[2]>7.500000000000001?t[0]>119.50000000000001?t[6]>79.50000000000001?A=-.0224319889201976:t[212]>1e-35?A=.06249587051783863:t[8]>963.5000000000001?t[8]>1156.5000000000002?A=.010357273289123324:A=-.029749145161304082:t[218]>1e-35?A=.06449336340743606:A=.018047654539345502:A=-.07350502390293116:A=-.019594829995832414:t[4]>39.50000000000001?A=-.019338083179859314:t[39]>1e-35?A=-.10427066919173111:t[222]>1e-35?t[0]>612.5000000000001?A=-.019197415255018464:A=-.0836562507048181:t[149]>1e-35?A=-.07679624472577429:t[32]>1e-35?A=-.05097506748590604:t[191]>1e-35?A=.04670476485250936:t[30]>1e-35?A=-.05313073892148652:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>8.500000000000002?A=.03930363008271334:A=-.06029171685615689:A=.016203086182431294:t[4]>7.500000000000001?A=-.013824248237085224:t[10]>4.500000000000001?t[94]>1e-35?A=-.09817668643367765:t[10]>40.50000000000001?A=-.023558078753593125:A=.0065113494780482326:t[8]>809.5000000000001?t[297]>1e-35?A=-.1352063548573715:A=.058203900441270634:A=-.035243959159285736:t[10]>59.50000000000001?t[1]>43.50000000000001?A=-.012552876807800442:A=.05991247777734298:A=.0035893102109330177;let y;t[13]>1e-35?t[9]>21.500000000000004?t[145]>1e-35?y=.03507251990078782:t[2]>14.500000000000002?y=.004905698363309292:t[8]>2421.5000000000005?y=-.10306119951984316:y=-.018951037816654928:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?y=-.08503171085833393:y=.015130974593044409:y=-.024425267075198206:y=.02624054905103126:t[4]>19.500000000000004?t[131]>1e-35?y=.02100191580704534:t[32]>1e-35?t[8]>2302.5000000000005?y=.09908783187786288:y=-.06920877329925636:t[8]>241.50000000000003?y=-.016756131804203496:t[9]>33.50000000000001?y=.04903179955263626:t[217]>1e-35?y=-.047416847619291644:y=-.0017200891991431119:t[39]>1e-35?y=-.10389927604977028:t[134]>1e-35?y=-.050480365434872866:t[178]>1e-35?y=-.05167855791556937:t[8]>2134.5000000000005?y=-.01663197335585307:t[242]>1e-35?y=-.05361323756615453:t[118]>1e-35?y=-.05299780866211368:t[10]>24.500000000000004?t[10]>55.50000000000001?t[8]>764.5000000000001?y=-.0016544848369620534:y=.04494144460483587:y=-.009283616456736156:t[121]>1e-35?t[0]>4463.500000000001?y=.051166688553608355:y=-.06623908820705383:t[84]>1e-35?y=-.12990936092409747:t[306]>1e-35?y=-.07020596855118943:t[49]>1e-35?y=.06272964802556856:t[192]>1e-35?y=.06540204627162581:y=.008277910531592885;let E;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?E=.003325460510319164:E=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?E=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?E=.0697359767152808:t[230]>1e-35?E=.06513506845651572:E=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?E=.013616385013146277:E=.04171540100223404:E=-.04360396575094823:t[212]>1e-35?E=.025945477945627522:E=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?E=-.07856453318384411:E=-.014803893522351739:t[39]>1e-35?E=-.09185452630751932:t[149]>1e-35?E=-.07122426086157027:t[134]>1e-35?E=-.04231052091434186:t[227]>1e-35?E=-.029815824273994197:t[50]>1e-35?E=-.15736496271211153:t[222]>1e-35?E=-.02360285356956629:t[128]>1e-35?E=-.03922080193836443:t[136]>1e-35?E=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?E=-.0029736170756835783:E=-.06482902102259112:t[84]>1e-35?E=-.11340924635708383:t[94]>1e-35?E=-.03635703457792193:t[118]>1e-35?E=-.058181913914186034:t[126]>1e-35?E=-.062030576241517366:t[116]>1e-35?E=-.045086301850604006:t[25]>1e-35?E=-.031665223656767286:t[203]>1e-35?E=-.009444685731407691:E=.0112265153772187;let _;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?_=.022717227245241684:_=-.049700413274686266:_=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?_=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?_=-.12263724050601095:_=.0070743478891288035:t[288]>1e-35?_=-.050439138582109:_=.0255701593657891:_=-.005812703740580558:t[6]>49.50000000000001?_=-.008542694147899113:_=.035147383686665:_=-.0960461939274094:t[32]>1e-35?_=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?_=-.01800870272656664:_=-.07817304234604389:t[30]>1e-35?_=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?_=.08778416018479411:_=-.026563982720830256:_=-.05296139548112329:t[50]>1e-35?_=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?_=-.036572140520852024:t[183]>1e-35?_=-.10766853736801459:_=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?_=.09513215942486053:_=-.03641865277445567:t[10]>59.50000000000001?_=.03177172388687933:t[39]>1e-35?_=-.10234241303898953:t[243]>1e-35?_=-.02966738115984321:t[190]>1e-35?_=-.04312785336449181:t[118]>1e-35?_=-.05808521194081524:_=.006720381600740378;let v;t[308]>1e-35?t[5]>423.00000000000006?t[133]>1e-35?v=-.046284053681928526:t[210]>1e-35?v=49778070699847876e-21:t[13]>1e-35?v=.03328070054739309:t[128]>1e-35?v=-.054790214922938896:t[126]>1e-35?v=-.08524792218532945:v=.014414055975542446:t[1]>38.50000000000001?v=-.07287851335872973:v=.005263371501687163:t[9]>7.500000000000001?t[21]>1e-35?t[10]>4.500000000000001?v=-.12459748864088374:v=-.004626323021331593:t[298]>1e-35?t[4]>64.50000000000001?v=.13044981041138526:t[9]>71.50000000000001?v=-.056068402282406865:t[9]>12.500000000000002?v=.038957722962512764:v=-.04598815982492169:t[8]>691.5000000000001?t[126]>1e-35?v=-.0852126122372075:t[225]>1e-35?v=.10082066771689505:t[1]>161.50000000000003?v=-.11609832500613824:t[3]>8.500000000000002?t[8]>1685.5000000000002?v=-.010835400874777133:v=.004607419973807752:v=-.016989075258564062:v=.009205417251698097:t[23]>1e-35?t[20]>1e-35?v=.10184317139657878:t[0]>5724.500000000001?v=-.1163666496650542:t[1]>106.50000000000001?v=.1303850608190687:t[129]>1e-35?v=.10745031509534769:v=.006166901738036226:t[31]>1e-35?v=.010177092833155127:t[13]>1e-35?t[0]>213.50000000000003?v=.005004582564506611:v=-.10481581731668346:t[19]>1e-35?v=-.009850706427306281:v=-.02608226348051303;let b;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?b=-.0024117174588695603:b=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?b=.04575380761203418:b=-.10025595041353463:t[15]>1e-35?b=.17705790384964004:b=.0073813837628615014:b=.07676373681392407:b=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?b=.07078572910026419:t[4]>23.500000000000004?b=.005513918674164821:b=.0206586476926392:t[0]>5269.500000000001?b=.07706773525822633:b=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?b=-.03204783603215824:b=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?b=-.0930246911392012:b=.011173087289703683:t[3]>24.500000000000004?b=.03281421918878597:b=.12449335091369843:t[204]>1e-35?b=.06634531187326123:b=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?b=-.041196758517013515:t[4]>7.500000000000001?b=-2942718111029724e-20:t[4]>6.500000000000001?b=.11953909558532852:b=.03188615019450534:t[122]>1e-35?b=-.0616037324662157:t[101]>1e-35?b=.027230889593349412:t[8]>4968.500000000001?b=-.1113986516540856:t[3]>2.5000000000000004?b=-.002045140426885727:t[129]>1e-35?b=.12641163374304432:b=.014909826232873194;let T;t[308]>1e-35?t[0]>7277.500000000001?T=-.09337446795435:t[5]>423.00000000000006?t[133]>1e-35?T=-.040884836258675006:t[210]>1e-35?T=-.0003719413278428804:t[13]>1e-35?T=.030287610160818174:T=.011174130013595384:t[1]>38.50000000000001?T=-.0662442170185784:T=.004332185707008564:t[9]>7.500000000000001?t[145]>1e-35?t[285]>1e-35?T=-.08092286307197555:T=.029866363328584986:t[21]>1e-35?t[10]>4.500000000000001?T=-.1155211149523894:T=-.0032903546638958538:t[149]>1e-35?T=-.03632198993199768:t[3]>9.500000000000002?t[8]>999.5000000000001?T=-.003507023626534306:t[128]>1e-35?t[4]>13.500000000000002?t[0]>3459.5000000000005?T=-.025416927789760076:T=.02777568919793122:T=-.10310351509769732:T=.013549608903688785:t[186]>1e-35?T=.08513865847420551:T=-.009306721292510369:t[31]>1e-35?T=.009780833952582307:t[23]>1e-35?T=.011143773934157629:t[210]>1e-35?T=.025354797285173356:t[17]>1e-35?t[10]>3.5000000000000004?T=-.04846287537743046:T=-.014647271080376757:t[2]>5.500000000000001?t[7]>57.50000000000001?T=-.034224938681445764:t[8]>1641.5000000000002?T=-.027298372075800673:t[191]>1e-35?t[10]>18.500000000000004?T=-.027950103994861836:T=.14575930827829034:T=-.007124740389354946:t[10]>22.500000000000004?T=.013173304107866726:T=-.11119620042551365;let w;t[131]>1e-35?w=.01892225243240137:t[308]>1e-35?t[5]>691.5000000000001?t[133]>1e-35?w=-.037118314390013646:t[1]>51.50000000000001?t[5]>3749.5000000000005?t[8]>58.50000000000001?w=-.022305242912035072:w=.024792895826340516:w=.013666137278072166:t[88]>1e-35?t[10]>27.500000000000004?w=.2080083584805785:w=.04247197078083379:t[10]>40.50000000000001?t[18]>1e-35?t[1]>27.500000000000004?w=.060783227455868206:w=-.056904865557409035:w=-.03278952553107572:t[192]>1e-35?w=.13117402617043625:w=.01647119888257836:w=-.01825870445636398:t[9]>6.500000000000001?t[298]>1e-35?w=.026536210945939682:t[8]>691.5000000000001?t[126]>1e-35?w=-.07927319604548912:t[10]>3.5000000000000004?t[21]>1e-35?w=-.11083976837572328:t[146]>1e-35?w=-.03359294484446772:w=-.0042815953591236475:t[190]>1e-35?w=-.09264239592903775:t[10]>1e-35?w=.022282638485105657:w=-.0205994057928458:t[5]>4918.500000000001?w=.03430715695199153:t[243]>1e-35?t[2]>57.50000000000001?w=.08935072241972036:w=-.03781647876237494:w=.0062655753179671515:t[31]>1e-35?w=.008603500300349887:t[230]>1e-35?w=.03350056932774173:t[23]>1e-35?t[241]>1e-35?w=.10277555508503314:w=.0017901817172993888:t[2]>98.50000000000001?w=-.05920081229672715:w=-.015722173275739208;let R;t[13]>1e-35?t[118]>1e-35?R=.07957905150112207:t[1]>125.50000000000001?R=-.0662620579858685:t[145]>1e-35?R=.029682040828779843:t[19]>1e-35?t[6]>15.500000000000002?R=-.0009597832580977798:R=-.081474760755753:t[212]>1e-35?R=.03637001492325179:R=.006912305498963309:t[32]>1e-35?R=-.03919900630910754:t[134]>1e-35?R=-.036225295529777886:t[4]>4.500000000000001?t[5]>384.50000000000006?t[204]>1e-35?R=.06671440854602108:t[136]>1e-35?R=-.07577364230133474:t[148]>1e-35?t[4]>7.500000000000001?R=.026430947016830915:R=-.04075501264495112:t[9]>93.50000000000001?R=-.04353169430417609:t[50]>1e-35?R=-.1411224537622882:t[17]>1e-35?t[49]>1e-35?R=.068392679163672:t[10]>1.5000000000000002?R=-.0209659792007492:R=-.0004393235559249831:t[133]>1e-35?t[9]>64.50000000000001?R=.07254524592323175:R=-.0319087835282534:R=.00037444813327793425:R=-.025138768151370408:t[243]>1e-35?R=-.050010891710502096:t[94]>1e-35?R=-.0817513550778599:t[122]>1e-35?R=-.061038875809822285:t[19]>1e-35?t[8]>1085.5000000000002?R=-.008408408775061623:t[2]>5.500000000000001?t[218]>1e-35?R=.1454877641381946:R=.053787998331240316:t[9]>33.50000000000001?R=.08602629796680285:R=-.03895127455803038:R=.008830878042315722;let x;t[131]>1e-35?x=.01687979707990516:t[8]>2915.5000000000005?t[297]>1e-35?x=.07473600489975568:t[0]>93.50000000000001?x=-.021596848506011502:x=-.13840802327735696:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?x=.10264284346448256:x=.031042487183181262:x=-.016653982936827776:t[4]>60.50000000000001?t[10]>75.50000000000001?x=.04226403420647408:t[10]>1e-35?t[0]>4733.500000000001?x=.006271403149804702:x=-.030013637555715046:t[0]>4449.500000000001?x=-.06556876058654929:x=.06437994816903034:t[32]>1e-35?x=-.043814577251655815:t[308]>1e-35?t[0]>7277.500000000001?x=-.09349726304052086:t[210]>1e-35?x=-.0035960132209098003:t[5]>691.5000000000001?t[133]>1e-35?x=-.029188394315052574:x=.017219308333820193:x=-.017378928852189585:t[9]>6.500000000000001?t[0]>2653.5000000000005?t[149]>1e-35?x=-.04428555753857688:x=.0001456106867817353:t[5]>213.50000000000003?x=.01740292726636365:x=-.011361718115556464:t[7]>4.500000000000001?t[0]>316.50000000000006?t[19]>1e-35?t[10]>54.50000000000001?x=.03410288911259329:t[121]>1e-35?x=-.06056527462120627:t[8]>2592.5000000000005?x=.12166808844363577:t[191]>1e-35?x=.11669879218998758:x=-.001664858391716235:x=-.01262927450503166:x=-.04506589951879664:t[227]>1e-35?x=-.08548904959752329:x=.02156080776537726;let P;t[306]>1e-35?t[149]>1e-35?P=-.1389218965136736:P=-.032218642644416894:t[13]>1e-35?P=.006465035217331847:t[50]>1e-35?P=-.1381687930130022:t[179]>1e-35?P=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?P=-.03262719498763048:P=.023342916702125613:t[191]>1e-35?P=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?P=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?P=-.09989343595668776:P=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?P=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?P=-.09165257825246746:t[9]>32.50000000000001?P=.02484870392366004:P=-.008499493096971395:t[8]>24.500000000000004?P=.02459679192828244:P=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?P=.0015644546318714849:P=-.06579524865022705:P=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?P=.03331853632960164:P=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?P=-.019091477207111116:P=.037878468575478504:t[94]>1e-35?P=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?P=.16919658785098224:t[243]>1e-35?P=-.06580584936754524:P=.01567555159935563:t[129]>1e-35?P=.06721746994993226:t[10]>32.50000000000001?P=-.046394462507797975:P=-.006436180519584767;let D;t[131]>1e-35?D=.015039096856208693:t[8]>779.5000000000001?t[145]>1e-35?D=.019122095523977856:t[298]>1e-35?D=.023828936462317443:t[1]>23.500000000000004?t[5]>384.50000000000006?t[7]>59.50000000000001?D=-.026094309429557913:t[204]>1e-35?D=.09163404305658318:t[1]>27.500000000000004?t[149]>1e-35?t[6]>34.50000000000001?D=.012643810980689466:D=-.07884161741497837:D=-.0025267379810891104:t[2]>43.50000000000001?t[0]>2860.5000000000005?D=.04493082949897325:D=.18046359750455776:t[7]>18.500000000000004?D=-.018667348656891496:D=.02584325784698236:D=-.045696524897545915:t[0]>3321.5000000000005?t[201]>1e-35?D=.04749240016989375:D=-.0333334578246718:t[5]>3276.5000000000005?D=.11330554740098908:t[7]>94.50000000000001?D=.1296600395033268:D=-.003576436308940934:t[15]>1e-35?t[183]>1e-35?D=-.13787130789142835:t[0]>1847.5000000000002?D=.017915229729920556:t[10]>23.500000000000004?t[10]>31.500000000000004?t[6]>7.500000000000001?D=.028856848462727104:D=-.11197632885851168:D=.08169801342016791:t[1]>22.500000000000004?D=-.021052888644970163:D=.019048604298876753:t[7]>4.500000000000001?D=-.002603328695276418:t[7]>1.5000000000000002?t[2]>5.500000000000001?D=.03432638833359197:D=-.0036767863082454973:t[1]>48.50000000000001?D=.03087375270128195:t[2]>3.5000000000000004?D=-.04219917149740248:D=.018818493993207935;let N;t[306]>1e-35?N=-.04076858123502297:t[13]>1e-35?t[1]>67.50000000000001?t[9]>14.500000000000002?t[9]>53.50000000000001?t[8]>1971.5000000000002?N=-.09091897542577475:N=.04042943082645558:t[218]>1e-35?N=.056254985867151:N=-.053848117950183044:N=.003881630017086845:t[5]>5152.500000000001?t[8]>857.5000000000001?t[6]>28.500000000000004?N=.021581808008986944:N=-.05639286496176611:N=.052838875036198954:t[5]>50.50000000000001?t[5]>4082.5000000000005?t[17]>1e-35?N=.023061479860228728:t[145]>1e-35?t[9]>10.500000000000002?N=.023885302967553288:N=.1617794086125622:t[212]>1e-35?N=.04504545345658806:t[3]>17.500000000000004?t[4]>45.50000000000001?N=-.03948072448245435:t[1]>47.50000000000001?t[9]>18.500000000000004?N=.01894935813286188:N=-.06449356357429188:N=.012297239104320094:t[1]>26.500000000000004?t[8]>33.50000000000001?N=-.034718828212885515:N=.0898976288814321:t[1]>17.500000000000004?N=-.15440137451988326:N=-.03864183216821465:N=.009988507307006308:N=-.08540311947043305:t[50]>1e-35?N=-.13323659732101975:t[134]>1e-35?N=-.031820386486894385:t[32]>1e-35?t[8]>2302.5000000000005?N=.08082476177379844:N=-.041665761903645876:t[179]>1e-35?N=-.12405023987936657:t[39]>1e-35?N=-.06247416524997478:t[138]>1e-35?N=-.10724031753676487:N=-.0005423122305122404;let L;t[308]>1e-35?L=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?L=.023223358334607133:L=-.04383410185346742:L=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?L=.023406489302867494:L=-.085521220804058:L=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?L=.028120059780969632:L=-.04211009474298743:t[294]>1e-35?L=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?L=-.0993035220737934:L=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?L=.029770210551187937:L=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?L=.06421359317599738:L=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?L=.024368404612215164:L=-.04045232374803373:t[131]>1e-35?L=.017372701982485795:t[120]>1e-35?L=.08812710275150198:t[18]>1e-35?t[90]>1e-35?L=.18451364351180236:t[7]>33.50000000000001?L=-.03850813130183531:t[195]>1e-35?L=.06966114053446336:t[3]>16.500000000000004?L=-.0012869181693341211:t[0]>4242.500000000001?L=-.054625548611291035:L=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?L=.006302103427145562:L=.13967622319898698:t[121]>1e-35?L=-.038798585213145644:t[5]>4544.500000000001?L=-.08050498033009466:L=-.002986974112681435;let B;t[0]>384.50000000000006?t[2]>101.50000000000001?t[1]>16.500000000000004?B=-.03461119351456781:B=.05659026566680352:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?B=-.12404435523286539:B=-.0034376913880382956:B=-.09821622245095822:t[131]>1e-35?t[9]>1.5000000000000002?B=.0037507103585310234:B=.03610387965829944:t[8]>999.5000000000001?t[9]>137.50000000000003?B=-.11985021663179699:t[0]>1847.5000000000002?t[126]>1e-35?B=-.04832024079663151:t[37]>1e-35?B=-.037103393468366934:B=-.004248086592531705:t[8]>3084.0000000000005?t[9]>43.50000000000001?B=.032539071163832034:t[5]>1643.5000000000002?B=.036408625378035665:t[0]>1500.5000000000002?B=-.1346358322854993:B=-.027586559522081014:t[3]>1e-35?t[190]>1e-35?B=-.1133991164577881:t[9]>52.50000000000001?B=-.024478640359723122:B=.03673777861098756:B=-.1037451237591819:t[230]>1e-35?t[9]>48.50000000000001?t[10]>20.500000000000004?B=.002583438691776944:B=.10773520810108106:t[9]>12.500000000000002?t[1]>16.500000000000004?B=-.02141222346712401:B=.06392462314316179:t[4]>12.500000000000002?B=.08700122294434816:t[8]>267.50000000000006?B=.056923170082743224:B=-.07716309825583327:t[32]>1e-35?B=-.03961343943752142:B=.002674914122888783:t[1]>42.50000000000001?B=-.05217539654421676:t[145]>1e-35?B=.09553630282946368:B=-.009424791262477729;let j;t[183]>1e-35?j=-.05753337139158443:t[308]>1e-35?j=.00562436671450989:t[9]>7.500000000000001?t[21]>1e-35?t[10]>8.500000000000002?j=-.10477869875380448:j=-.0070301869937306055:t[3]>9.500000000000002?t[8]>1765.5000000000002?t[0]>4571.500000000001?j=-.12526505173232894:t[10]>1e-35?t[9]>71.50000000000001?j=-.04442302951713574:j=.00012409888451734224:j=-.092199119633697:t[225]>1e-35?j=.13773072450201831:t[0]>2882.5000000000005?j=.0028540012229920533:t[298]>1e-35?j=.07134486044361629:j=.014297412329837425:t[145]>1e-35?j=.05608385321902638:t[92]>1e-35?j=.038298413603926135:t[107]>1e-35?t[2]>6.500000000000001?j=-.0039957800609801315:j=.0776927564241081:t[203]>1e-35?j=-.05502900859432093:t[105]>1e-35?j=.06062892720841595:j=-.009574839629252128:t[31]>1e-35?j=.009488858841144216:t[23]>1e-35?t[20]>1e-35?j=.08818126313644752:t[8]>161.50000000000003?j=.014353968957885408:j=-.022240738532827903:t[210]>1e-35?j=.024648862719806694:t[2]>5.500000000000001?t[4]>4.500000000000001?t[17]>1e-35?t[10]>16.500000000000004?j=-.043902062079383485:j=-.014741559220396223:j=-.00934935734853194:t[6]>32.50000000000001?j=.1514593126307404:j=.010771222510801532:t[10]>22.500000000000004?j=.01412495209334078:j=-.08576940379502533;let M;t[0]>384.50000000000006?t[84]>1e-35?M=-.06647690967306838:t[2]>101.50000000000001?M=-.024451334501552457:t[306]>1e-35?M=-.034517188927733505:t[131]>1e-35?t[9]>1.5000000000000002?M=.0031858381443673127:M=.032574927024450646:t[204]>1e-35?t[1]>62.50000000000001?M=-.08601340441214533:t[1]>29.500000000000004?M=.10487598629539963:t[8]>597.5000000000001?M=-.0786529133673238:M=.08689436600511559:t[8]>779.5000000000001?t[10]>2.5000000000000004?t[9]>100.50000000000001?M=-.04883600353740688:t[126]>1e-35?M=-.03794042763348827:M=-.003358871967539988:t[210]>1e-35?M=.054991356498447566:t[6]>19.500000000000004?M=-.007418396981635549:M=.018032606049498613:t[18]>1e-35?t[7]>35.50000000000001?t[2]>44.50000000000001?M=-.02143003429501711:M=-.09016000554055564:t[1]>19.500000000000004?t[1]>42.50000000000001?t[8]>17.500000000000004?M=-.006636355416244082:M=-.06483095743431454:t[4]>21.500000000000004?M=-.028975965946833545:M=.022012264796522657:M=-.06653648243193663:t[5]>4593.500000000001?M=.01753551428088607:t[217]>1e-35?M=-.028864824937700297:t[94]>1e-35?M=-.04885192273020658:t[279]>1e-35?M=.08105715462329498:t[121]>1e-35?M=-.04576676034750651:M=.004795141324949362:t[1]>42.50000000000001?M=-.047446619702809195:t[145]>1e-35?M=.08400495571952321:M=-.00854528836489364;let O;t[294]>1e-35?O=-.042529778074638265:t[266]>1e-35?O=-.1180276669679798:t[134]>1e-35?O=-.026818144353279623:t[183]>1e-35?O=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?O=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?O=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?O=-.03049646619610203:t[1]>50.50000000000001?O=.20634590755061122:O=.06956378103625731:t[0]>3770.5000000000005?O=-.07946414366134913:t[19]>1e-35?O=.17083312065604694:t[2]>21.500000000000004?O=-.02327981978127724:O=.129717297518715:t[145]>1e-35?O=.006891245076133524:O=-.0789123467863741:t[3]>99.50000000000001?O=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?O=.06447639919732716:O=-.05457561977645972:t[306]>1e-35?O=-.029995903305383882:t[191]>1e-35?O=.030596508110850414:t[242]>1e-35?O=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?O=.09518584795377832:O=-.018197744600833596:t[13]>1e-35?O=.006751790086127549:t[148]>1e-35?O=.01904174573618417:t[99]>1e-35?O=.025287735102561926:t[4]>14.500000000000002?O=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?O=-.09467943982430241:t[243]>1e-35?O=-.02521824751996268:O=.005437570718352172:O=-.022476214821960674;let U;t[0]>384.50000000000006?t[84]>1e-35?U=-.06088131453064195:t[147]>1e-35?U=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?U=.04219361472548491:U=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?U=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?U=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?U=-.11431764534511478:U=.013549717238356157:U=-.020987333767091276:t[6]>2.5000000000000004?U=-.02914877855133127:U=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?U=-.10087072787978416:t[37]>1e-35?U=-.030467397753331196:t[229]>1e-35?U=-.1017559811057469:t[4]>20.500000000000004?U=-.00413177742240167:t[20]>1e-35?U=.05213315982685969:U=.0037921635866823133:t[8]>51.50000000000001?U=.07327913092421544:t[6]>49.50000000000001?U=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?U=.02744420891894289:U=.11288946357194463:U=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?U=-.012329314369909049:U=.026816658655600168:U=-.0872405354618811:U=.007872673500247845:t[1]>42.50000000000001?U=-.04309044198258254:t[145]>1e-35?U=.07572529147860785:t[7]>5.500000000000001?U=-.013837187093264945:t[1]>17.500000000000004?U=.04208698439539668:U=-.06284346769019863;let q;t[294]>1e-35?q=-.0384794324818203:t[266]>1e-35?q=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?q=.07432960094940501:q=-.035248735855751855:t[134]>1e-35?q=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?q=-.01706896375068821:q=.08212247914968074:t[2]>59.50000000000001?q=-.09546478958824225:t[6]>53.50000000000001?q=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?q=.02816463285971267:q=.15449139016588445:q=-.10199787406123524:q=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?q=-.13924786681478077:q=-.0072772442570213335:t[39]>1e-35?q=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?q=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?q=-.11174465335620831:q=.00013144040097180107:q=-.08493919336681105:t[42]>1e-35?q=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?q=-.015540659878839153:q=-.14442609417300142:t[21]>1e-35?q=-.025251979447574083:q=.0023698372645272847:t[18]>1e-35?q=.07269739695712212:t[8]>2592.5000000000005?q=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?q=-.01835130329646532:t[9]>45.50000000000001?q=.02023047454629885:q=.16469378262221102:q=-.042975030085836426;let Q;t[8]>2915.5000000000005?t[297]>1e-35?Q=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?Q=-.01034964686484714:Q=-.07357437440667927:Q=-.11987794734779106:t[298]>1e-35?t[8]>81.50000000000001?t[0]>3370.5000000000005?t[8]>155.50000000000003?t[8]>660.5000000000001?t[8]>2134.5000000000005?Q=-.09476398869062203:t[9]>72.50000000000001?Q=-.0757383854264379:Q=.02806542779508718:Q=-.05147742568418084:Q=.10212721564444344:Q=.0518263760642861:Q=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?Q=-.10669213185972036:Q=.027050434286384796:t[302]>1e-35?Q=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?Q=.06354599160071946:t[1]>67.50000000000001?Q=.05317447949011187:Q=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?Q=-.09369289448773599:t[0]>2215.5000000000005?Q=.04077965380363924:t[0]>807.5000000000001?Q=-.0591771776458298:Q=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?Q=-.016323380219241672:Q=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?Q=.03720704290087811:Q=-.008730548158766654:t[4]>80.50000000000001?Q=-.05346644687473197:Q=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?Q=.019984510398089086:Q=-.03917825025861855:t[9]>170.50000000000003?Q=-.09759719821334525:Q=-.0023586682752856298;let Y;t[183]>1e-35?t[17]>1e-35?Y=.030100940443356424:t[10]>1.5000000000000002?Y=-.10861112216742408:Y=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?Y=-.032062878390325456:Y=-.10808232631806887:t[8]>1641.5000000000002?Y=-.06147013392655731:t[4]>12.500000000000002?Y=.03324767551088266:t[145]>1e-35?Y=.028851633810612017:Y=-.054871239091792784:t[134]>1e-35?Y=-.023813968121342108:t[266]>1e-35?Y=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?Y=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?Y=-.025350325484720576:Y=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?Y=.056817276537534815:Y=-.07674158463557636:Y=-.06335553143454145:t[1]>56.50000000000001?Y=.16390494217299284:Y=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?Y=.041717597065890205:Y=-.10357913492269129:t[10]>29.500000000000004?Y=.1365512866715726:Y=.020600048310575665:Y=.09708785634773187:Y=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?Y=-.03146213719547347:Y=.11784024316238083:Y=-.050940520532045355:Y=-.047988344143075616:t[191]>1e-35?Y=.028764654731460032:Y=.0011911575567860023;let W;t[294]>1e-35?t[10]>50.50000000000001?W=-.11630092297244568:t[0]>2432.5000000000005?t[0]>4199.500000000001?W=-.05103908560370243:W=.05002066201169583:W=-.09976646725732496:t[32]>1e-35?t[0]>4242.500000000001?W=-.0648838712201258:t[5]>3721.5000000000005?t[9]>4.500000000000001?W=.127983140816313:W=-.05436534163636867:W=-.024514536544596455:t[121]>1e-35?t[0]>4449.500000000001?t[4]>9.500000000000002?W=-.009504203657088933:t[8]>819.5000000000001?W=.18689664822602375:W=.03635576744011826:W=-.029862411809998525:t[223]>1e-35?W=-.06474496692999487:t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?W=-.09405026597863717:t[0]>4153.500000000001?W=.053577663326799765:W=-.05062127873995668:W=.06512222894425874:t[39]>1e-35?W=-.04985311717827547:t[51]>1e-35?W=-.04541229517934797:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?W=-.02860634573675884:W=.08863753005590103:W=.11158892111063744:t[0]>655.5000000000001?W=-.031005736641654926:W=-.1439827004505974:t[222]>1e-35?t[1]>11.500000000000002?t[0]>612.5000000000001?W=-.00843386136334982:W=-.05273594615999777:W=.1060183822015004:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?W=-.015774115523598486:W=.10147367091236065:W=-.048307000563071016:W=.002118376117677254;let V;t[8]>1014.5000000000001?t[9]>137.50000000000003?V=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?V=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?V=.07211107542565391:V=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?V=-.0751486415451188:t[1]>59.50000000000001?V=.13459005084554104:V=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?V=.06715575425741895:V=-.005895690393702183:t[8]>2915.5000000000005?V=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?V=-.00029068886245881074:V=.0613467393188786:t[148]>1e-35?V=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?V=.003887223773199377:V=-.08553893131979015:V=.025654192706396767:V=-.05651733979610658:V=-.02039913645229667:t[2]>7.500000000000001?V=-.1058450646728524:V=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?V=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?V=.1283258201586378:V=-.01718135372229775:V=-.07702452408491414:t[125]>1e-35?V=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?V=.04273051857848212:V=-.04533122948101463:t[2]>196.50000000000003?V=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?V=.0231032972703664:V=-.04807386814498683:V=.002729435991332102;let z;t[179]>1e-35?z=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?z=.026484626664041125:t[10]>1.5000000000000002?z=-.10187000872941615:z=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?z=.09574540795390041:z=-.06454986703691233:z=-.11411849349353141:t[266]>1e-35?z=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?z=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?z=-.04403391373512386:z=.1132928075412222:t[2]>47.50000000000001?z=-.09700191391838056:z=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?z=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?z=-.001668912999010927:z=-.02363511102970245:t[8]>58.50000000000001?z=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?z=.0911011436534449:t[1]>28.500000000000004?z=-.07192390493729035:z=.06913818091291246:z=-.012312625373699222:z=.06784496312307986:z=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?z=.0026564453057705273:z=-.025425772389361445:t[122]>1e-35?z=-.12046786388602149:t[0]>3183.5000000000005?z=.01162092842804907:t[91]>1e-35?z=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?z=-.0001647792543020228:z=-.023664538532907665:z=.01609078206180752;let ie;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ie=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ie=-.017696526862422682:ie=.1450050954613223:ie=-.05406930069823832:ie=-.08308700260259043:t[120]>1e-35?ie=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ie=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ie=.038431826961746934:ie=-.05937462906539856:t[9]>65.50000000000001?ie=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ie=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ie=-.09579030954062734:ie=.025064711572811746:ie=.02579440518821548:ie=.1044440128091862:ie=-.058348633139536844:ie=.07766788227934436:ie=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ie=.07463684068207214:ie=.18244269035484484:t[6]>39.50000000000001?ie=-.06050050067471004:ie=.05787759066913493:ie=.010783225857972171:ie=.1674891243602606:t[4]>9.500000000000002?ie=-.004814132027475892:ie=-.14543299413454813:ie=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ie=-.07634466313617769:ie=.0287825335169114:ie=-.06894721943300268:ie=-.00023988459059521937;let H;t[131]>1e-35?t[1]>93.50000000000001?H=-.05706887458825395:t[2]>1.5000000000000002?H=.011446637886629108:H=-.10616119878749211:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?H=.08424281276381033:t[3]>17.500000000000004?t[20]>1e-35?H=.11146885439601915:t[8]>61.50000000000001?t[0]>3530.5000000000005?t[9]>48.50000000000001?t[9]>61.50000000000001?H=.026278724448495064:H=.17053138400480508:t[0]>4463.500000000001?H=-.06482289890096041:H=.03026516489536295:H=-.031785170717683144:H=.1312690622980455:t[13]>1e-35?H=.14336922540461444:H=.03523850945454039:H=-.015407465968975714:t[39]>1e-35?H=-.054809635385158186:t[32]>1e-35?t[0]>4242.500000000001?H=-.0659975068798723:H=-.008386582621403979:t[4]>60.50000000000001?t[10]>75.50000000000001?t[3]>107.50000000000001?H=-.04225314193574262:t[3]>70.50000000000001?t[1]>29.500000000000004?H=.057409156184759516:H=.2024322059866388:H=-.030670938454461245:t[10]>1e-35?t[0]>4733.500000000001?H=.010648654146284154:t[308]>1e-35?H=.008728141696325391:t[4]>64.50000000000001?t[298]>1e-35?H=.12364025998551711:H=-.02247495081065243:t[1]>22.500000000000004?H=-.0726295464624251:H=.03481895086048152:t[0]>4331.500000000001?H=-.04775443357020673:H=.07172377425057568:t[2]>89.50000000000001?H=-.11782645274716962:H=.00010092665257989378;let te;t[147]>1e-35?te=-.041560228567115574:t[302]>1e-35?t[10]>47.50000000000001?te=.062292114082780084:t[10]>5.500000000000001?t[7]>22.500000000000004?te=-.016101990375700172:t[0]>2579.5000000000005?te=-.13045089661551845:te=-.02874367814784938:te=.025835149631944995:t[167]>1e-35?t[0]>3928.5000000000005?te=.17084176915326055:te=-.019195947948312853:t[222]>1e-35?t[30]>1e-35?t[1]>36.50000000000001?t[8]>45.50000000000001?t[8]>578.5000000000001?t[1]>67.50000000000001?te=.10591712319944074:te=-.024082167264285:te=.16497698867036126:te=-.04985066326861431:t[0]>1937.5000000000002?t[2]>16.500000000000004?te=-.021012910475524206:te=-.13058422554298485:t[0]>1102.5000000000002?te=.10955864175201457:te=-.03566689354348996:t[1]>11.500000000000002?te=-.02093884208606101:te=.09107244766183857:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?te=-.013861861436128482:te=.09756849802202777:t[224]>1e-35?t[1]>51.50000000000001?te=.10163873449625677:te=-.02779270277623805:t[1]>26.500000000000004?te=-.08035058228527389:te=.0005719695099064484:t[191]>1e-35?t[9]>9.500000000000002?te=-.007028075523033826:te=.0489470913925288:t[1]>61.50000000000001?t[132]>1e-35?te=.11230846723576784:t[0]>350.50000000000006?t[2]>1.5000000000000002?te=-.0032075580718124892:te=-.04442829143298883:te=-.06597073245775804:te=.0015594090939337751;let le;t[223]>1e-35?t[8]>668.5000000000001?le=-.12803889879260094:le=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?le=.08967966612917375:t[1]>39.50000000000001?le=-.059791671514498074:le=.05648934961902822:t[2]>59.50000000000001?le=-.08633234097449628:t[6]>53.50000000000001?le=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?le=.025606129643140924:le=.13835395886271978:le=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?le=-.09975506556937946:t[10]>36.50000000000001?le=-.09427724661655643:t[10]>24.500000000000004?le=.07329330653410447:le=-.02271182965807972:le=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?le=-.05082091374050816:le=.1687114435254966:t[0]>2314.5000000000005?le=-.06422664016383926:le=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?le=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?le=-.1274167728754332:le=.01308079126447365:t[4]>73.50000000000001?le=.13854015371106546:t[4]>48.50000000000001?le=-.03684255740123261:t[6]>45.50000000000001?le=.10329912215813097:t[10]>77.50000000000001?le=-.08630788656925215:le=.031022006843800853:t[1]>25.500000000000004?le=-.08278381528048026:le=.06664374548141594:t[84]>1e-35?le=-.05624227409079396:le=.00012184182357340415;let Le;t[179]>1e-35?Le=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Le=-.07595415373151816:Le=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Le=.022822510448266862:Le=.17491569312933697:Le=-.058362287133533565:t[2]>2.5000000000000004?Le=-.03633895806364428:Le=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Le=-.07294848747514579:Le=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Le=-.07009535282685533:t[8]>2640.0000000000005?Le=-.051761240111316276:t[131]>1e-35?Le=-.06245774419231631:Le=.03495606662854905:Le=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Le=.0015036626973581122:Le=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Le=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Le=.022343994371919224:Le=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Le=.07724450228328664:t[0]>3853.5000000000005?Le=-.15671707454435677:t[10]>28.500000000000004?Le=-.10179090671841723:Le=.014878216919760927:Le=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Le=.14054154485273487:Le=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Le=-.08632985141410315:Le=.005524157938954954:Le=-.08802502622523681:Le=-.0004649168897260341;let ge;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ge=-.007458687464321174:ge=-.09444966249102484:t[1]>23.500000000000004?ge=.08564129697360716:ge=-.07105002902845851:ge=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ge=-.10326216566705966:t[1]>26.500000000000004?ge=.0050539832484585365:ge=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ge=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ge=.05783632021087773:t[10]>17.500000000000004?ge=-.06720598671764105:t[1]>47.50000000000001?ge=.097495825172558:ge=-.013372242800584872:ge=-.06463226787713715:t[42]>1e-35?ge=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ge=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ge=.11051270080118503:ge=.027719462817590454:t[8]>597.5000000000001?ge=-.08441503592016869:ge=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ge=-.12190088985091102:ge=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ge=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ge=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ge=.016585157185448045:ge=-.11032043771149425:ge=.01586986028570486:t[8]>388.50000000000006?ge=-.10592413013261853:ge=.04930703248769364:t[13]>1e-35?ge=.003621937787920821:ge=-.0013786331198611841;let Oe;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Oe=.009769895322846493:Oe=-.10620052926943656:t[9]>19.500000000000004?Oe=.03781202525403449:t[9]>14.500000000000002?Oe=-.11485785321365344:t[9]>6.500000000000001?Oe=.07677177833073881:t[0]>4342.500000000001?Oe=-.07079285609687631:t[49]>1e-35?Oe=.06156814809246001:Oe=-.014788509042554625:Oe=-.032659201618470655:t[5]>5207.500000000001?Oe=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Oe=-.03094160322187924:t[1]>29.500000000000004?Oe=.09474646043921069:Oe=.023445783928231618:Oe=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Oe=-.07164443768784848:t[1]>29.500000000000004?Oe=.089473622509272:t[8]>597.5000000000001?Oe=-.08155349903101317:Oe=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Oe=-.004003900679358653:t[190]>1e-35?Oe=-.09236113461485262:t[8]>3198.5000000000005?Oe=-.0124130160451179:Oe=.018453070064009328:t[15]>1e-35?Oe=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Oe=-.0009580759587680961:Oe=-.03227283036698222:Oe=.01369287669536875:t[1]>50.50000000000001?Oe=-.04213060332500437:t[35]>1e-35?Oe=-.11508095777767471:t[190]>1e-35?Oe=-.08611884672400155:t[297]>1e-35?Oe=.05723551879433584:Oe=-.004829340082311461;let we;t[183]>1e-35?we=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?we=-.11753465135886734:we=-.007515490299047085:we=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?we=-.12371142493530439:t[1]>36.50000000000001?we=.032189417575190435:we=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?we=-.0784518658439288:t[2]>54.50000000000001?we=.12477882322370665:we=.000313468482399738:we=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?we=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?we=.0353146070135579:we=-.06327619611098285:we=.02813577701641991:we=-.12354390728506215:t[34]>1e-35?we=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?we=-.01245803535276381:we=-.07169472553475001:t[1]>11.500000000000002?we=.12989984824561698:we=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?we=.010390226893521422:t[10]>14.500000000000002?we=.16790888126487719:we=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?we=-.043398307129729134:we=.09963544907820426:t[9]>30.500000000000004?we=-.13540713124984502:t[9]>17.500000000000004?we=.0509435850590757:we=-.04761897852404613:t[4]>78.50000000000001?we=.09197086656470652:we=.0006771050176682337;let re;t[122]>1e-35?t[6]>36.50000000000001?re=.05686884451670743:re=-.05334759543084309:t[266]>1e-35?re=-.08603579519816038:t[157]>1e-35?re=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?re=-.0499592651503952:t[0]>725.5000000000001?re=.11780353905132664:re=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?re=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?re=-.03190157229022304:re=.07985197845805492:re=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?re=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?re=-.027174047777029083:re=.057117284879796476:t[3]>43.50000000000001?re=-.0016147040913107311:re=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?re=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?re=-.01466076988151239:re=.13375695925484857:re=-.04885873081899647:t[0]>5566.500000000001?re=.11086813028591343:t[8]>992.5000000000001?re=-.07622304217072383:re=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?re=.03285858361708423:re=-.12354858211764992:re=.0672788301823281:t[15]>1e-35?re=.08658836986585006:re=-.02741484278509758:t[290]>1e-35?re=-.08161310335133287:t[135]>1e-35?re=-.04824156054814152:re=.0009156904299554183;let ee;t[3]>7.500000000000001?ee=.0006791852818377787:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ee=.03642374718166293:ee=.16379973756366603:ee=-.03946685266127979:t[186]>1e-35?ee=.07618896623420895:t[96]>1e-35?ee=.0680272261319657:t[107]>1e-35?t[1]>48.50000000000001?ee=-.022822371600847505:ee=.0501405836324949:t[203]>1e-35?t[1]>77.50000000000001?ee=.044416424920571296:ee=-.0648450593196238:t[5]>3921.5000000000005?t[1]>110.50000000000001?ee=-.11110466767595227:t[9]>5.500000000000001?t[9]>52.50000000000001?t[1]>50.50000000000001?ee=.1061937286809567:t[7]>54.50000000000001?ee=.11487507743121311:t[8]>819.5000000000001?ee=-.07181278009001418:t[10]>25.500000000000004?ee=.13499019430369633:t[1]>31.500000000000004?ee=.09032979489780704:ee=-.12754166393372374:t[9]>37.50000000000001?ee=-.05093963635361407:ee=-.005026651151683848:t[9]>2.5000000000000004?ee=.07619735785573735:ee=.012363301341532136:t[26]>1e-35?ee=-.10685800454968203:t[8]>125.50000000000001?t[8]>446.50000000000006?t[0]>3842.5000000000005?ee=-.08783796894105043:t[282]>1e-35?t[1]>47.50000000000001?t[9]>40.50000000000001?ee=-.10764172927882483:ee=.01890760098464703:ee=.06573095405846417:t[8]>634.5000000000001?ee=-.00783575973273707:ee=-.050612689680229306:t[1]>22.500000000000004?ee=-.0016842490401359626:ee=.0738227088444087:ee=-.02663970950432175;let K;t[31]>1e-35?t[8]>17.500000000000004?K=.013678038624884814:t[1]>35.50000000000001?t[1]>51.50000000000001?K=.007191286124908192:K=-.09347881647636902:t[10]>1.5000000000000002?K=.07938758708008091:K=-.008702935600305113:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?K=.12321804057595996:K=-.018281109320672437:t[23]>1e-35?t[4]>62.50000000000001?K=-.04644244754790671:K=.024546310702263208:t[8]>862.5000000000001?t[0]>3429.5000000000005?t[4]>9.500000000000002?t[52]>1e-35?K=.0706108609273337:t[2]>40.50000000000001?K=-.028046629962303716:K=-.06497613993109329:K=.01076489668586676:t[1]>33.50000000000001?t[0]>966.5000000000001?t[2]>14.500000000000002?t[1]>38.50000000000001?K=-.03056331974267756:K=-.11886389712497057:K=.053364962175658184:t[8]>2233.5000000000005?K=-.0448152521157682:K=.1508651602190868:t[2]>33.50000000000001?t[0]>2882.5000000000005?t[0]>3183.5000000000005?K=.03818796510453344:K=.23673992112982362:K=.02858814226507374:t[10]>44.50000000000001?K=-.1125863771551199:K=.009129996952394916:t[1]>7.500000000000001?K=-.004374525302461639:K=-.07858519434925451:t[149]>1e-35?t[6]>23.500000000000004?K=.0005231594491642136:t[0]>4053.5000000000005?t[8]>660.5000000000001?K=-.13677189943034931:t[10]>2.5000000000000004?K=.039591891437078086:K=-.09312596849507347:K=-.02423172142089822:K=.0009836986075266283;let he;t[189]>1e-35?t[0]>5269.500000000001?he=-.103183298350443:t[2]>51.50000000000001?he=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?he=-.05186168947388339:he=.0496996365539082:t[10]>23.500000000000004?he=.1404445738719:t[93]>1e-35?he=.0027146310074558505:t[5]>3821.5000000000005?he=.002153033152069652:t[4]>2.5000000000000004?he=.007663539551317215:he=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?he=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?he=-.021479467709980358:he=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?he=.021660293256233334:he=-.0927396152303864:he=.0665074081601698:t[0]>1550.5000000000002?he=.08972407105958534:he=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?he=.06761927942466854:he=-.015762168112653286:t[17]>1e-35?he=.10311304131145381:he=-.017672785252336027:he=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?he=-.10638321435298535:he=.0007073011744385905:t[18]>1e-35?he=-.027056185501334325:t[145]>1e-35?he=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?he=.09762140519655171:t[9]>110.50000000000001?he=-.06581942957595835:t[6]>54.50000000000001?he=.04959634035251596:he=.0022616298654554207:he=-.007437620924990854;let X;t[179]>1e-35?X=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?X=.1470294450403005:X=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?X=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?X=.07965955447707423:t[10]>10.500000000000002?X=-.09236156404262426:X=.03396273196231458:X=-.13246465021467432:X=.07092822261735353:X=-.08753829085942:X=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?X=.004705878789890202:X=.13775378964952867:X=-.04770928980587811:t[10]>29.500000000000004?X=.011221519891071544:t[0]>3853.5000000000005?X=.06365381191628273:X=.15506252245336827:t[1]>37.50000000000001?X=-.07254777021042061:X=.026514587757252385:t[308]>1e-35?X=.04115804816617256:t[10]>26.500000000000004?X=.02077721353011946:t[5]>3548.5000000000005?X=-.1280907116663952:X=-.021974774274438:t[306]>1e-35?X=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?X=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?X=-.005710865560475598:t[94]>1e-35?X=-.06751507982853555:X=.027250040757588703:t[9]>52.50000000000001?X=.07060357924595577:X=-.030297760713011795:X=-.0006005400085266517;let de;t[113]>1e-35?de=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?de=-.06996356565314456:de=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?de=-.08317707559926495:t[21]>1e-35?de=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?de=-.010538203005984922:de=.08454819465349446:t[9]>124.50000000000001?de=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?de=-.08542251249346582:t[9]>50.50000000000001?de=-.023428882537657472:de=.010042500833979073:de=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?de=.03006025206979096:t[9]>108.50000000000001?de=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?de=.04222035773042132:de=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?de=-.07209095448054853:de=.028065954981903313:de=.08714651929917122:de=-.006678820669279169:t[10]>40.50000000000001?de=.006982396294941626:de=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?de=-.09351114982645548:t[4]>3.5000000000000004?de=-.004837550129223451:de=-.08324141237464677:t[303]>1e-35?de=.10703037493990825:t[9]>156.50000000000003?de=-.10803018621648303:t[116]>1e-35?de=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?de=.10261721665006701:de=.018994509090668264:de=.0011244262442038839;let qe;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?qe=-.08404263465005328:t[0]>3682.5000000000005?qe=.041259223920298876:t[1]>29.500000000000004?qe=-.09541257493441671:qe=.001482192721625409:qe=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?qe=-.08268996098437432:t[230]>1e-35?qe=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?qe=-913218977737457e-19:t[4]>10.500000000000002?qe=-.056334165674005156:t[127]>1e-35?qe=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?qe=-.04231200150318989:t[10]>42.50000000000001?qe=.10182973257894812:qe=.015934763950068445:qe=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?qe=-.041117068322885315:qe=.1167767830037126:qe=.13611206992387337:t[10]>41.50000000000001?qe=-.07120286010564107:qe=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?qe=-.07702290997669524:t[198]>1e-35?qe=.08776558554437136:qe=-.008290740324975692:t[2]>32.50000000000001?qe=.07198457624219955:qe=.005463113714361629:qe=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?qe=.03295785445437507:qe=.15140250150674536:qe=-.035613213948910254:t[186]>1e-35?qe=.06849425535860769:t[96]>1e-35?qe=.06028225812727254:qe=-.007582543288662308;let ne;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ne=.08396556264106572:ne=-.0562516995099192:ne=-.10593011018789432:t[183]>1e-35?t[15]>1e-35?ne=-.09705176473553752:t[7]>18.500000000000004?t[2]>37.50000000000001?ne=.0052017514017035915:ne=-.11194119432743639:ne=.03724337696163019:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?ne=-.025692451287403446:ne=-.09511862672123193:t[8]>1661.5000000000002?t[10]>37.50000000000001?ne=-.11892250746801664:t[10]>22.500000000000004?ne=.07548493166973796:ne=-.05973048107712209:t[4]>12.500000000000002?t[0]>4319.500000000001?t[10]>4.500000000000001?t[10]>37.50000000000001?ne=.13750699058082427:t[18]>1e-35?ne=.06535408879552801:ne=-.054118179035040674:ne=.1344282838979622:t[0]>3982.5000000000005?ne=-.10409582202467015:t[19]>1e-35?ne=.12672850705810795:t[8]>587.5000000000001?t[1]>35.50000000000001?ne=.012705935670766466:ne=.14149359442527545:ne=-.047977876173706004:t[20]>1e-35?ne=.057945228080337946:t[0]>3642.5000000000005?ne=-.008726535792122467:ne=-.08424769891378858:t[34]>1e-35?ne=-.0699329538228602:t[134]>1e-35?t[11]>1e-35?t[4]>15.500000000000002?t[0]>1187.5000000000002?ne=.01196849566739346:ne=.1614642278429876:ne=-.043022338150701625:t[3]>5.500000000000001?ne=-.03907848255033881:ne=.018280601026175593:ne=.0006654540402589085;let ue;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?ue=-.01386103677247845:ue=.11386694333005128:t[4]>27.500000000000004?ue=-.021862617610091336:t[2]>31.500000000000004?ue=.0828858469030438:ue=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?ue=.11303635767048735:ue=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?ue=-.04238798044549342:ue=.022091190130494303:t[5]>5082.500000000001?ue=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?ue=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?ue=-.04291104140431434:t[17]>1e-35?ue=.11256797532342613:ue=-.017206916368289193:ue=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?ue=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?ue=.03581712466863222:ue=.14770264307668884:t[8]>73.50000000000001?ue=-.13093289429740068:ue=.042461737442702936:t[52]>1e-35?ue=.0501831919044939:ue=-.010450249720465756:ue=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?ue=.0005381332165438493:ue=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?ue=.04849637311285226:ue=-.036671377119808564:t[0]>421.50000000000006?ue=.00020968499911058945:ue=.11636422423182405:ue=-.12687837788222575:ue=.0012774367867215346;let Ne;t[120]>1e-35?Ne=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Ne=-.042799574885345304:Ne=.07412430171193245:Ne=-.11248270469336048:t[193]>1e-35?Ne=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Ne=.028911612178122104:Ne=.12326369727728437:t[0]>4091.5000000000005?Ne=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ne=.1159839898100149:Ne=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Ne=-.0216343737351583:Ne=-.1220272260878369:t[2]>18.500000000000004?Ne=.09152924475072398:t[8]>55.50000000000001?Ne=.039508716651005665:Ne=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Ne=.06793009902674053:Ne=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Ne=-.04391068849624096:Ne=.04009967593394672:t[8]>1085.5000000000002?Ne=-.024773826356034825:Ne=-.13919707884246582:Ne=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Ne=-.11567917501901476:Ne=-.006813640337684114:t[3]>7.500000000000001?Ne=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Ne=-.001754586408351048:Ne=-.055422422450722056:Ne=-.06090032532532226:t[0]>5269.500000000001?Ne=.11787981735983527:Ne=-.00198119768540783:Ne=.00210412924303036;let Ie;t[294]>1e-35?t[10]>50.50000000000001?Ie=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?Ie=-.06063239096209816:Ie=.03317022411417386:Ie=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?Ie=-.013608609329298802:Ie=.09078000157330264:t[99]>1e-35?Ie=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?Ie=-.07536137260189814:Ie=.006253266595455118:t[10]>28.500000000000004?Ie=-.006106041147592768:t[9]>156.50000000000003?Ie=-.11828932797811101:t[94]>1e-35?Ie=-.02566078479505714:t[303]>1e-35?Ie=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?Ie=-.08401252789168523:t[5]>4244.500000000001?Ie=.026372887658499107:t[1]>16.500000000000004?Ie=-.027836756345634026:Ie=.09205362097909099:Ie=.00934612788718244:t[203]>1e-35?Ie=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?Ie=-.09580979052540028:t[1]>50.50000000000001?Ie=-.06402211827281554:Ie=.08342858760095972:t[2]>36.50000000000001?Ie=.008114897658204584:t[92]>1e-35?Ie=.09541587072672864:Ie=-.022342147210555434:Ie=-.01660492519175128:Ie=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?Ie=.15846731118501817:Ie=.039498507912023195:t[245]>1e-35?Ie=.07008718676813333:Ie=.0019806389728814727;let Be;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Be=-.01192072916082109:Be=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Be=.06874032717466054:t[4]>40.50000000000001?Be=-.07752510020707537:t[1]>76.50000000000001?Be=-.09944032260703917:t[8]>1381.5000000000002?Be=-.054466635810800745:t[1]>32.50000000000001?Be=.05974084520839573:Be=-.0384718740755954:Be=-.11374190719134032:t[0]>2151.5000000000005?Be=-.13703645155803298:Be=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Be=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Be=.013539805885738608:Be=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Be=.09941880179344399:Be=-.01608127391210995:Be=.08025226531247417:t[9]>67.50000000000001?Be=.13525448212444113:t[6]>61.50000000000001?Be=-.05511099182158894:t[94]>1e-35?Be=-.06821509831783572:t[128]>1e-35?Be=.11361314817714643:Be=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Be=-.09954181329804547:t[197]>1e-35?Be=.10102833149755386:t[188]>1e-35?Be=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Be=-.03781554214742005:Be=.09927933385592314:Be=-.020006000056720083:Be=-.10520473615957895:Be=-.12006990846253787:Be=-.00026111570975317574;let tt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[0]>1725.5000000000002?t[7]>14.500000000000002?t[2]>38.50000000000001?tt=-.019188245509744628:tt=-.13354864350075848:t[0]>2461.5000000000005?tt=.051885477468354396:tt=-.0833581968852119:tt=.08233441701532287:tt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?tt=.09926337893072812:tt=-.027753610497327715:t[0]>1972.5000000000002?tt=-.09780045823152517:tt=.032380915168504935:tt=.11502632261226381:t[17]>1e-35?tt=-.06094965899579662:t[10]>40.50000000000001?tt=-.07500475582440802:tt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?tt=-.09584538995220808:tt=-.00908705814304442:tt=.03203281520813893:t[10]>49.50000000000001?tt=-.03146271513986384:t[2]>63.50000000000001?tt=.13172001315536286:t[224]>1e-35?tt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?tt=.09521549382082259:tt=-.04414925613522197:t[0]>1847.5000000000002?tt=-.09118580379557353:tt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?tt=.03525144509943896:tt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?tt=-.04766112322938157:t[2]>10.500000000000002?tt=.0728516504357201:tt=-.05049625965272536:tt=-.10868663055825774:tt=.0005382613419948969;let st;t[147]>1e-35?t[1]>53.50000000000001?st=-.10615739288764095:t[0]>2604.5000000000005?t[0]>3629.5000000000005?st=-.030504020655417463:st=.07102458639110094:st=-.07058131985243714:t[302]>1e-35?t[10]>47.50000000000001?st=.055304563442710876:t[1]>53.50000000000001?st=.033723409577443623:t[8]>175.50000000000003?t[0]>2628.5000000000005?t[9]>40.50000000000001?st=-.1568835288372895:st=-.0279829124400056:st=.04493843959601833:st=-.11637042729644327:t[191]>1e-35?t[282]>1e-35?st=-.054133834303687026:t[9]>48.50000000000001?st=.11263810289007213:t[9]>9.500000000000002?st=-.02202034562838259:t[4]>45.50000000000001?st=-.03410927569045158:st=.04381615166534081:t[242]>1e-35?t[0]>3615.5000000000005?t[3]>19.500000000000004?t[1]>56.50000000000001?t[4]>28.500000000000004?st=-.029687297407295893:st=.10673602850001934:t[4]>42.50000000000001?st=.0036275562945108117:st=-.0760789221330622:st=-.10385623431741903:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?st=.08274426793676076:st=-.07076234425516396:st=.13890177606150175:st=-.019863286503635686:t[53]>1e-35?t[18]>1e-35?st=-.09250637750836187:st=-.0031531727902009026:t[2]>107.50000000000001?t[4]>91.50000000000001?t[1]>16.500000000000004?st=-.01897867921812603:st=.04890781705365262:st=-.11569892307597907:t[2]>106.50000000000001?st=.09032697440623969:st=.00047935919155035045;let _t;t[115]>1e-35?_t=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?_t=-.10131179514695865:t[8]>938.5000000000001?_t=.10203729808015481:_t=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?_t=.03574015165562999:_t=-.07763042506449493:_t=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?_t=.0665706259130275:_t=-.06586817559309924:_t=.11925564412287476:_t=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?_t=.046017146627455346:_t=-.08623321630086885:t[8]>1765.5000000000002?_t=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?_t=.11143827902215087:_t=-.01817808730473413:_t=.16980985030210127:_t=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?_t=.010168994879727824:_t=-.09099594488792513:t[9]>1.5000000000000002?_t=.0533459678147928:_t=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?_t=-.062346959148773695:t[1]>47.50000000000001?_t=-.0021578343835599316:t[2]>27.500000000000004?_t=.19567373210166172:_t=.07851555379116423:t[18]>1e-35?_t=.03711549097804649:t[8]>359.50000000000006?_t=.012492346746905587:t[4]>20.500000000000004?_t=.047511695735697544:_t=-.07999269063948773:_t=6802045404471004e-20;let kt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?kt=.0011484728213539738:kt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?kt=-.09828874964938798:t[8]>1586.5000000000002?kt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?kt=.011938269926919522:kt=.17541983715953954:t[19]>1e-35?kt=.023002786011088672:kt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?kt=.06508934844183291:kt=-.10168553534835639:kt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?kt=.021140806225203937:kt=-.1167833342453639:t[2]>33.50000000000001?kt=.13163585734056618:kt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?kt=.06314479201263888:kt=-.09639088327091713:t[10]>29.500000000000004?kt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?kt=40577156464836036e-21:kt=.12322387121810757:kt=-.03697224045046014:t[1]>22.500000000000004?kt=.016474835887320276:kt=.16919298733903063:kt=.07633203630214054:kt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?kt=.14150493354700563:kt=-.01831155354975749:t[1]>28.500000000000004?kt=-.07952557178685365:t[10]>28.500000000000004?kt=.0665695554984927:kt=-.053640139319277094:kt=.0004754840665898665;let Ht;t[76]>1e-35?Ht=-.06814884255939921:t[179]>1e-35?Ht=-.06325743795510681:t[122]>1e-35?t[6]>36.50000000000001?Ht=.05052338063261613:t[8]>626.5000000000001?t[1]>38.50000000000001?Ht=.004193658608848433:Ht=-.1066968975983452:t[8]>302.50000000000006?Ht=.05476730110440451:Ht=-.06382970920394895:t[218]>1e-35?t[2]>3.5000000000000004?t[6]>13.500000000000002?t[2]>19.500000000000004?t[0]>3200.5000000000005?t[4]>91.50000000000001?Ht=-.12156071809840739:t[9]>21.500000000000004?t[5]>3883.5000000000005?t[8]>919.5000000000001?t[8]>1085.5000000000002?Ht=.013555772109446666:Ht=-.09856116699770784:Ht=.0284329611813383:t[2]>52.50000000000001?Ht=.04008708444763762:t[9]>29.500000000000004?Ht=-.1289599546008197:Ht=-.018566534248335896:t[8]>747.5000000000001?Ht=.02236484980076122:Ht=.1148871655157582:t[8]>3084.0000000000005?Ht=-.05573875952902531:t[10]>17.500000000000004?t[2]>51.50000000000001?Ht=.03164751204281298:Ht=.11752140436184891:t[9]>42.50000000000001?Ht=-.07180559595410106:t[22]>1e-35?Ht=.09325040416256854:Ht=-.016041122807939914:Ht=-.02765708954618808:t[1]>30.500000000000004?t[1]>66.50000000000001?Ht=-.010718250133458515:Ht=.09818827994853763:Ht=.010180038981174032:Ht=-.039472162599295535:t[9]>170.50000000000003?Ht=-.08536729235976731:t[189]>1e-35?t[0]>5269.500000000001?Ht=-.08674788057474031:Ht=.02077653508548371:Ht=-.0003536561382007414;let F;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?F=.018337297491457794:F=-.05926206443180149:F=.024026520855881126:t[288]>1e-35?t[184]>1e-35?F=.10747078482128616:t[126]>1e-35?F=-.10550625192391357:t[7]>71.50000000000001?F=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?F=.1317396472229434:F=-.025035791351328947:F=-.0728334305864372:t[8]>963.5000000000001?F=.023642201723096064:F=.183010326734258:t[128]>1e-35?F=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?F=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?F=-.1088876900335281:F=.02758317023002635:F=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?F=-.01928020117446408:F=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?F=.07893723375925096:F=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?F=-.10301657587280551:F=.005787463140224318:F=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?F=-.019296977889522397:F=-.07274529751752634:t[1]>30.500000000000004?F=-.050368901143148286:F=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?F=.0015332402792773946:F=.09930153676749967:F=-.06370844564357069:F=.00042272155209927616;let se;t[71]>1e-35?t[4]>17.500000000000004?se=.12586844370423247:se=-.006791999603126354:t[222]>1e-35?t[1]>10.500000000000002?t[30]>1e-35?t[1]>36.50000000000001?t[9]>1.5000000000000002?t[10]>25.500000000000004?se=-.08474891624263797:t[8]>125.50000000000001?se=.08125086980439704:se=-.04082085238068532:t[0]>3863.5000000000005?se=.020481535807469208:se=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?se=-.019110200161573936:se=-.12387719685855114:t[0]>1102.5000000000002?se=.08376595701957407:se=-.031821919580524834:t[9]>4.500000000000001?se=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?se=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?se=.1349841206807871:se=.011864053595560297:t[1]>41.50000000000001?se=-.08203662486612544:t[2]>18.500000000000004?se=-.009541865642346947:se=.08345043168501759:t[2]>10.500000000000002?se=-.09585031818030947:se=.019432330487099865:se=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?se=.11951517733981365:se=-.016651014735738538:t[1]>28.500000000000004?se=-.07410922545030711:t[10]>28.500000000000004?se=.05886430683844788:se=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?se=.04802269879144705:se=-.026208212831796737:t[4]>45.50000000000001?se=-.03227476944664786:se=.05124575625622705:se=.00020506696916003137;let be;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?be=-.03042091758483443:t[10]>14.500000000000002?be=.09816619204768777:be=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?be=-.02381165060401718:be=-.10950361804974783:be=.03538211665111128:t[212]>1e-35?t[19]>1e-35?be=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?be=-.06371052144380579:be=.0835500621252692:be=-.10408255929333915:t[1]>74.50000000000001?be=.13208968122712403:t[1]>64.50000000000001?be=-.04778844603644965:t[8]>51.50000000000001?t[8]>201.50000000000003?t[8]>660.5000000000001?t[6]>4.500000000000001?t[9]>5.500000000000001?t[1]>29.500000000000004?t[0]>3830.5000000000005?be=.09922816902423433:be=.016366955328796718:be=.1592412560903584:t[1]>39.50000000000001?be=.05409467990258923:be=-.08260633210459611:be=-.06307205775247567:t[9]>36.50000000000001?be=.040253940015648144:be=.14202568969471283:be=-.028761848341594044:be=.08994073058773508:t[0]>807.5000000000001?be=-.043427848826323195:be=.04573516446846493:t[20]>1e-35?t[188]>1e-35?be=-.0758877731600639:t[23]>1e-35?be=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?be=.08124700978741987:be=.013296063087086852:t[7]>5.500000000000001?be=-.01640196088612987:be=-.12685498840146067:be=-.0004940792382459551;let Fe;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?Fe=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?Fe=.08513773825688947:Fe=-.1184664832315282:Fe=.05676963535893477:Fe=.14263843210340613:Fe=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?Fe=-.10669720555606924:Fe=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?Fe=.0664744575868955:Fe=-.08469256188890871:Fe=-.026746678040592144:t[281]>1e-35?Fe=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?Fe=.012131807587207655:Fe=-.12776015795398743:Fe=.04320472481083551:Fe=.08390980661550446:t[10]>227.50000000000003?Fe=-.09771783809101153:t[10]>130.50000000000003?Fe=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?Fe=-.07610698254064358:t[8]>902.5000000000001?Fe=-.03136381213599649:t[131]>1e-35?Fe=.0704821739127936:t[224]>1e-35?Fe=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?Fe=.10431473040024908:t[8]>841.5000000000001?Fe=.07304745320500514:Fe=-.038011541882439825:Fe=-.01679746695007364:t[0]>3129.5000000000005?Fe=.05589952587431965:t[210]>1e-35?Fe=.06227198085800842:Fe=-.0011341890997947812:t[8]>740.5000000000001?Fe=.04817300084412584:Fe=-.000577001010789238;let Ue;t[187]>1e-35?t[6]>12.500000000000002?t[10]>8.500000000000002?t[10]>16.500000000000004?t[8]>234.50000000000003?t[4]>43.50000000000001?t[0]>4476.500000000001?Ue=-.10504730480402079:t[5]>3341.5000000000005?Ue=.11087894671081754:Ue=-.0406668834674614:Ue=.03308382165616109:t[8]>104.50000000000001?Ue=-.10431436764549162:Ue=.0073928337244891455:t[4]>34.50000000000001?Ue=-.10571751512748416:Ue=-.006081128814142983:t[13]>1e-35?Ue=.1299673566095023:t[4]>60.50000000000001?Ue=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?Ue=.04857126072645073:Ue=-.03431365358104773:t[4]>16.500000000000004?Ue=.04101865986596709:Ue=.16480274980378218:t[10]>26.500000000000004?Ue=.03673978504199255:t[10]>9.500000000000002?Ue=-.10996402743800027:t[308]>1e-35?Ue=.0553693735082498:Ue=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?Ue=.010902983761213922:Ue=.1325118659895645:Ue=-.064362945508595:t[1]>66.50000000000001?Ue=.033416767779331176:Ue=-.054080316225040496:t[42]>1e-35?Ue=-.07762364337810815:t[10]>1089.5000000000002?Ue=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?Ue=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?Ue=.0220102041325908:Ue=-.06516708740003069:Ue=.012833498905748267:t[224]>1e-35?Ue=-.007038418272997865:Ue=.00037666304316290967;let me;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?me=.07554189644995735:me=-.052089349455904946:me=-.10148206848169845:t[113]>1e-35?me=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?me=.07172653627995676:me=-.07602959317610998:me=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?me=-.0399322883690891:me=.06523495517476098:me=-.10358715295743802:t[193]>1e-35?me=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?me=.015928764772252406:me=.1341513061552287:me=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?me=-.033592997607280156:me=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?me=-.08402551858097379:me=.017401984506038796:t[1]>25.500000000000004?me=.13337205393591278:me=-.01160208350090984:me=.06708317942315471:t[8]>227.50000000000003?me=-.08486943882418681:me=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?me=-.10496268177586783:me=-.020921489532370493:me=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?me=.11639296062157028:me=-.004275784356569115:t[32]>1e-35?me=-.07297384970166025:me=.006026841626381599:me=.002034611134960428;let Z;t[248]>1e-35?Z=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Z=-.06455513326540585:t[1]>29.500000000000004?Z=.07718474591552532:t[4]>7.500000000000001?Z=.040139336931404826:Z=-.09685734690563386:Z=.00015327283570347363:t[9]>88.50000000000001?Z=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?Z=-.04077257804338707:Z=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?Z=.03778141591008941:Z=-.06459919920634845:Z=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?Z=.14063930759326346:t[0]>179.50000000000003?Z=.07287482250668585:t[8]>1180.5000000000002?Z=-.14419393112726253:t[10]>28.500000000000004?Z=-.07993142770099469:t[17]>1e-35?Z=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?Z=.05527969663610186:Z=-.10824385941441346:t[3]>11.500000000000002?Z=.12358502961047915:Z=-.017509147119622873:t[0]>74.50000000000001?Z=-.014907705458730486:t[8]>95.50000000000001?Z=-.02225118168342062:Z=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?Z=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?Z=.04962819555610421:Z=-.07213577821855309:Z=.09139529824708481:t[19]>1e-35?Z=.013439401088345224:Z=-.049274647207292056:Z=.10531673719686951;let ve;t[40]>1e-35?t[0]>1937.5000000000002?ve=-.06421671152073961:ve=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?ve=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?ve=-.03520420769287065:t[8]>1085.5000000000002?ve=-.019817352506127633:ve=.11444439424520964:ve=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?ve=-.010490117519863269:ve=.08104430117757461:t[121]>1e-35?t[243]>1e-35?ve=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?ve=.06619344145920268:t[0]>4091.5000000000005?ve=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?ve=.10016091391222309:ve=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?ve=-.019511460451434884:ve=-.11643672465055221:t[2]>18.500000000000004?ve=.07848228087333317:t[8]>55.50000000000001?ve=.032583027899956235:ve=-.11209832692153521:t[11]>1e-35?ve=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?ve=-.09996887746328006:t[9]>2.5000000000000004?ve=.02157682011863397:ve=-.05247727848991843:ve=.07409150201483244:t[1]>38.50000000000001?ve=-.11378466075449625:t[224]>1e-35?ve=-.10741749127732923:t[1]>26.500000000000004?ve=.07343136534146562:ve=-.07013573628594773:t[25]>1e-35?ve=-.04626669734164317:ve=.05518333197956482:ve=.00032434010867555516;let Ge;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?Ge=.026313251010808853:Ge=-.08997339150292381:Ge=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?Ge=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?Ge=.0905155504503746:t[8]>1049.5000000000002?Ge=-.062312558183394054:t[8]>719.5000000000001?Ge=.09583836191410239:t[0]>3719.5000000000005?Ge=-.0778097309430818:Ge=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?Ge=-.12920865648544927:t[0]>2699.5000000000005?Ge=-.07086587879041864:Ge=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?Ge=-.11377786322600797:Ge=-.009486325820117998:t[1]>55.50000000000001?Ge=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?Ge=-.07938291201004219:t[2]>36.50000000000001?Ge=.01520046732530246:Ge=.13649854049662832:Ge=-.07145015938528873:t[8]>407.50000000000006?Ge=-.00350257360822279:Ge=.11332047082193297:Ge=-.10060624458629897:Ge=.05429496612497562:t[8]>1446.5000000000002?Ge=.006073419197482838:Ge=-.08718676350883998:Ge=-.11532497988252638:Ge=.10766270463068293:t[34]>1e-35?Ge=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?Ge=-.0004109812623829506:Ge=.021601073497455662:Ge=-7343540098965853e-20;let Qe;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?Qe=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?Qe=.05995640200798119:t[0]>3443.5000000000005?Qe=-.14698883458733583:Qe=-.030039164579240187:t[189]>1e-35?Qe=-.06086763220538141:t[1]>86.50000000000001?Qe=-.05096727866142538:t[4]>64.50000000000001?Qe=.11240554253834577:t[4]>45.50000000000001?Qe=-.030279760168394117:t[6]>45.50000000000001?Qe=.10161088917815142:t[10]>77.50000000000001?Qe=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?Qe=-.06672020005240323:Qe=.08831457502630258:t[8]>2592.5000000000005?Qe=-.052617701047376654:t[10]>29.500000000000004?Qe=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?Qe=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?Qe=-.064099222705728:Qe=.044332487521538365:t[0]>2882.5000000000005?Qe=.031099546885005065:Qe=.12938467051623853:t[0]>4221.500000000001?Qe=-.0928676413498701:t[9]>30.500000000000004?Qe=-.05781824812803708:Qe=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?Qe=-.06648105454098469:Qe=.05985487552383097:Qe=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?Qe=.05282385499619401:t[1]>66.50000000000001?Qe=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?Qe=.027885690791379255:Qe=-.08407126408362446:Qe=.014432924125571093:Qe=-9903435845205118e-20;let je;t[76]>1e-35?je=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?je=.013633653464240465:je=-.10164319411983509:je=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?je=.00632864847804078:je=-.08393000368134668:je=.07870508617440916:t[284]>1e-35?je=.1092302727710421:je=-.0025505047582483234:t[248]>1e-35?je=.07101822393621864:t[274]>1e-35?je=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?je=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?je=.025081789181021243:je=-.014813325803582618:t[9]>33.50000000000001?je=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?je=.11926990418060353:je=.01852125513565268:je=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?je=-.1178464984373743:t[283]>1e-35?je=.043370859226927405:t[5]>4320.500000000001?je=-.01103141226366587:t[8]>1104.5000000000002?je=-.023053423988095886:je=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?je=.000579145585864887:je=.03389152834202143:t[128]>1e-35?je=-.14527722052568462:t[210]>1e-35?je=-.08915971541902741:t[7]>9.500000000000002?je=-.03307314577076116:t[18]>1e-35?je=-.05521712302023565:je=.009315605032770029:je=.0036332551852289933;let J;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?J=-.07583539600416284:t[188]>1e-35?J=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?J=-.011038193049597113:J=.08154028164397753:t[1]>85.50000000000001?J=.10259361975201933:J=.011640408330521594:J=-.00023319159023748508:t[92]>1e-35?J=.13771692859530546:J=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?J=.09967230141007705:t[30]>1e-35?J=-.08888529037551285:J=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?J=.08284665960761373:J=-.029292565021289504:t[7]>7.500000000000001?J=-.09945093355204493:J=-.008381393701708593:t[20]>1e-35?J=-.04218678460370465:t[10]>6.500000000000001?t[9]>2.5000000000000004?t[1]>13.500000000000002?t[8]>143.50000000000003?t[4]>7.500000000000001?t[2]>36.50000000000001?J=.07585582641438211:t[8]>284.50000000000006?J=-.029387993239886723:J=.07716738177321587:t[1]>18.500000000000004?J=.026745348497993746:J=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?J=.02337306890530338:J=-.10390355904767366:J=.07390521199638532:J=-.06788247515155237:J=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?J=-.06360325615644084:J=.04342192339836601:J=-.10598779152030145:J=.05253384605768211;let ae;t[3]>7.500000000000001?t[157]>1e-35?ae=-.07514182877923786:ae=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ae=.028692053800951845:ae=.14081686716133598:ae=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?ae=.0037139292567243084:ae=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?ae=.01202688580305612:ae=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?ae=.043935495082738626:ae=-.05639305759669704:t[247]>1e-35?ae=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?ae=.10331836202616368:ae=.0006926658459781341:t[96]>1e-35?ae=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?ae=-.0741403257305367:ae=.022900127535540854:t[7]>3.5000000000000004?ae=.038110741403836294:ae=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?ae=-.09552842289807008:t[1]>27.500000000000004?ae=.012505935885798007:ae=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?ae=-.1046104767723845:ae=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?ae=.023466328488582572:ae=.11730925774586994:ae=-.04771965631104874:ae=.17059689880751394:ae=-.08181850955999449:t[26]>1e-35?ae=-.12727482696678769:ae=-.014343123272734182;let Ce;t[147]>1e-35?t[1]>53.50000000000001?Ce=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Ce=-.02763546051134888:Ce=.06423344777499343:Ce=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?Ce=.049825139823021586:t[7]>22.500000000000004?Ce=-.01131680751379858:t[0]>2579.5000000000005?Ce=-.10673674485369694:Ce=-.015387212937189957:Ce=.04347325151148724:t[179]>1e-35?Ce=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?Ce=.0650355590939066:Ce=-.0473332870892226:Ce=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?Ce=.11139543329789044:t[126]>1e-35?Ce=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?Ce=.06370903833231022:t[10]>29.500000000000004?Ce=.03415223859607161:t[10]>3.5000000000000004?Ce=-.07415518117873297:Ce=-.0014119203473324082:Ce=.12617652343819508:t[9]>41.50000000000001?Ce=-.10311145857176976:t[8]>2757.5000000000005?Ce=-.08106484219011428:t[7]>71.50000000000001?Ce=-.09783384432091176:t[1]>88.50000000000001?Ce=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?Ce=-.008884084501608536:Ce=.061339437777743616:Ce=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?Ce=.01526664064166223:Ce=.13534828515415498:Ce=-.06985484465894776:Ce=.0005758961943178744;let Re;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Re=-.029152732370514342:Re=.07173628916139178:t[1]>36.50000000000001?Re=-.08859111297255318:Re=.0018030071815630785:Re=.13652461563759322:Re=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Re=-.07145140450454163:t[21]>1e-35?Re=-.07422841663493233:Re=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Re=.11864240653986852:t[3]>33.50000000000001?Re=-.08821209591953476:Re=.05706392280054726:Re=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Re=.01953613016837112:Re=-.059781039130025006:t[148]>1e-35?Re=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Re=.07207826841738371:t[202]>1e-35?Re=.08163917539410503:Re=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Re=-.06858280496900336:Re=-.1781828899516648:Re=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Re=.018232649414147116:Re=-.04419781124222661:Re=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Re=.11452368095776105:Re=-.036496437259924026:Re=-.040445338739465486:Re=.0816572651001145:Re=-.08968914517368663:Re=.0002826343082585516;let $e;t[189]>1e-35?t[0]>5269.500000000001?$e=-.08839493050459957:t[10]>85.50000000000001?$e=.10046908365702462:t[8]>2592.5000000000005?$e=-.09632233975926387:t[8]>2000.5000000000002?$e=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?$e=.035504970430426296:t[1]>31.500000000000004?$e=-.1133764813142531:$e=-.01138280942244812:t[8]>1125.5000000000002?$e=.09800530246229806:$e=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?$e=.07316772160107896:$e=-.059095014819051765:$e=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?$e=-.09150209066166894:t[8]>3084.0000000000005?$e=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?$e=-.04449234460408263:$e=.05568837973347338:$e=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?$e=.12741077850267066:$e=.007372371864985329:t[2]>39.50000000000001?$e=.02295917234617787:$e=.14966532083907075:t[1]>39.50000000000001?$e=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?$e=-.02511861881285652:t[1]>27.500000000000004?$e=.08683660011672288:$e=.02956214835267301:t[9]>15.500000000000002?$e=-.016538805462996232:$e=.04352738094981517:$e=-.05561856645643868:t[9]>170.50000000000003?$e=-.07996752635874248:t[179]>1e-35?$e=-.09065975936933919:$e=-.00042817975060427177;let Ye;t[39]>1e-35?t[4]>25.500000000000004?Ye=.03443173196222934:Ye=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?Ye=-.0013415395759330318:Ye=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?Ye=.002297618040307216:Ye=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?Ye=-.015297257305397608:Ye=.09651828834062742:Ye=-.06636003334371929:t[10]>11.500000000000002?Ye=.17631616138309397:t[0]>1639.5000000000002?Ye=3804386478092585e-20:Ye=-.09099296398683193:Ye=-.06874415876172972:t[0]>2151.5000000000005?Ye=-.1311264883406766:Ye=.00809052010141122:t[253]>1e-35?Ye=-.06338558211939296:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?t[10]>10.500000000000002?t[0]>3615.5000000000005?Ye=.045038497754638605:Ye=-.07770167665661752:Ye=-.08596294280650517:Ye=.08538655727027213:Ye=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?Ye=.054627956617973275:t[1]>61.50000000000001?Ye=-.11994465088415499:t[4]>8.500000000000002?Ye=.06676200239406452:Ye=-.027503148069376867:t[8]>676.5000000000001?Ye=-.10363964928357075:t[4]>8.500000000000002?Ye=-.07589816227175682:Ye=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?Ye=.009093153189012338:Ye=-.06119765876605404:Ye=.0004668642103528348;let lt;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?lt=-.10100794502567233:lt=.08000205636470442:lt=-.11945419826856896:t[113]>1e-35?lt=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?lt=.1224302423880318:lt=-.01875566982911468:t[222]>1e-35?t[1]>8.500000000000002?t[1]>24.500000000000004?t[4]>3.5000000000000004?t[0]>725.5000000000001?t[0]>1682.5000000000002?t[0]>2860.5000000000005?lt=.0019277012166729114:t[1]>28.500000000000004?lt=-.054445821715687494:lt=.045645722976713245:t[30]>1e-35?lt=.13402660155331655:lt=.008921176001777645:lt=-.058547426505451076:lt=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?lt=-.13526418192218206:lt=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?lt=.0007263224246135398:lt=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?lt=-.11575657261278308:lt=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?lt=-.01995960178292952:lt=.11216586049153021:lt=-.10050961087149474:lt=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?lt=.10303451081526649:lt=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?lt=-.043799548968209395:lt=-.12451444314954115:t[4]>12.500000000000002?lt=-.03838117361958468:lt=.06504990789767144:t[57]>1e-35?lt=.06890006938293915:lt=.0003914274695562949;let yt;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?yt=.004271749009686975:yt=-.10523878297127605:yt=.04633982158107851:yt=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?yt=-.08655730561951676:t[8]>919.5000000000001?yt=-.0676453705610183:t[7]>18.500000000000004?yt=-.027787974193650575:yt=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?yt=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?yt=-.03473877164537313:t[8]>719.5000000000001?yt=.10471053866934404:yt=.008236107678382981:t[4]>57.50000000000001?yt=.09412219478825269:t[10]>66.50000000000001?yt=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?yt=-.040681323751002293:yt=.06374650297561021:yt=.12884615227401788:t[10]>5.500000000000001?yt=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?yt=-.05474068967150784:yt=.03744700650806603:yt=-.07846396348680855:t[1]>42.50000000000001?yt=.018972315810821302:yt=.10953621007604744:t[5]>4439.500000000001?yt=.010999776705494586:t[1]>40.50000000000001?yt=-.12394200059775967:t[10]>2.5000000000000004?yt=.013528093962849453:yt=-.09222088417048682:yt=-.12662967149701485:yt=.09327296405849603:t[3]>99.50000000000001?yt=-.013581954439986752:yt=.0005526498251862075;let $t;t[187]>1e-35?t[243]>1e-35?$t=-.08392792551692502:t[10]>68.50000000000001?$t=.07871769409454053:t[10]>8.500000000000002?t[10]>16.500000000000004?t[2]>17.500000000000004?t[3]>31.500000000000004?t[91]>1e-35?t[10]>21.500000000000004?t[10]>33.50000000000001?t[10]>48.50000000000001?$t=-.0825306209711224:$t=.049559996084532945:$t=-.1064938580886302:$t=.03353240732240275:$t=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?$t=.16966001471529374:t[1]>57.50000000000001?$t=-.005772777673676247:$t=.09383677041525058:t[8]>747.5000000000001?$t=.054068175469351235:$t=-.049968216310277036:t[8]>753.5000000000001?$t=-.0679383555784074:t[4]>8.500000000000002?$t=-.059757341189735386:$t=.05701083682780414:$t=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?$t=.05820296128730006:$t=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?$t=.15340611616954566:$t=.04385036188666874:t[0]>4449.500000000001?$t=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?$t=.004840354641006495:$t=.09967827580276283:$t=.11605363537391578:t[9]>19.500000000000004?$t=-.0735831692725717:$t=.019973331823355176:t[306]>1e-35?t[149]>1e-35?$t=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?$t=-.02442182361342386:$t=.10334853004243093:$t=-.030431948680167104:$t=-956078595250818e-19;let St;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?St=-.040232505718244854:t[0]>3030.5000000000005?St=.0634109586813073:St=-.04043617034245621:St=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?St=-.007859096946435131:St=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?St=.05515771679628051:St=-.04214471312668263:St=-.09589322222261765:t[193]>1e-35?St=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?St=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?St=-.08152604001147906:t[11]>1e-35?St=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?St=.13100930780107503:t[10]>25.500000000000004?St=.05921074710011526:St=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?St=.0009447118243153454:St=-.09820565036865991:St=.057146909749745546:t[0]>2115.5000000000005?St=-.12331216726611678:St=.007281983677694285:t[2]>56.50000000000001?St=.012310154675612615:St=-.08873665774670461:t[6]>25.500000000000004?St=.134708740821879:t[9]>5.500000000000001?St=-.0805901581148979:t[224]>1e-35?St=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?St=.10842593386554122:t[2]>13.500000000000002?St=.06466798320378395:St=-.08578130788886655:St=-.03590892078300114:St=.0003499894043880708;let We;t[134]>1e-35?t[6]>50.50000000000001?t[0]>3601.5000000000005?We=.10839808814624702:We=-.028043875308180352:t[7]>30.500000000000004?t[8]>932.5000000000001?We=-.007478368069393829:We=-.09066751344326617:t[0]>3588.5000000000005?t[5]>4748.500000000001?We=.04035247751736232:t[0]>4255.500000000001?We=-.1310865624507367:t[0]>4004.5000000000005?We=.06647367311982634:We=-.08339693352955757:t[4]>10.500000000000002?t[1]>34.50000000000001?We=-.011618902907510411:We=.1114646660406691:t[10]>2.5000000000000004?t[0]>3072.5000000000005?We=.09356028223727986:We=-.03811765057032162:We=-.09456215497345526:t[280]>1e-35?t[7]>70.50000000000001?We=.10322956436499003:t[2]>22.500000000000004?t[1]>83.50000000000001?We=.1146142460964847:t[1]>62.50000000000001?We=-.09679869865322362:t[9]>71.50000000000001?We=-.07377580769927583:t[4]>19.500000000000004?t[0]>4571.500000000001?We=-.039046426387852974:We=.04558778688367152:We=.11220830937352602:t[7]>5.500000000000001?t[9]>17.500000000000004?t[8]>1067.5000000000002?We=.03261697816211156:t[15]>1e-35?We=.02586252542264368:t[2]>14.500000000000002?We=-.016420452667484604:We=-.1011799626006976:We=-.13787471318963773:t[6]>4.500000000000001?t[8]>427.50000000000006?t[10]>36.50000000000001?We=.010193588102560583:We=.11748729525930773:We=-.04468162226743652:We=-.028365274393617957:t[71]>1e-35?We=.05115139346588793:We=-.0001510425316936658;let ce;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ce=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ce=.020637047900190317:ce=-.1017300802134141:t[1]>23.500000000000004?t[9]>12.500000000000002?t[0]>2815.5000000000005?t[0]>3183.5000000000005?t[3]>23.500000000000004?t[3]>45.50000000000001?t[4]>48.50000000000001?ce=-.04632587527094407:ce=.08603684785510396:ce=-.05101401015448496:ce=.025466432054358498:ce=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ce=.020385355430046367:ce=.12032592051335252:ce=-.012387370292173013:t[2]>23.500000000000004?ce=-.12568545484492677:ce=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ce=.043528764484784536:ce=.14352071657196003:ce=-.009332833816977268:ce=.11186782227735846:ce=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ce=-.05649104643152564:ce=.03884200719305747:t[42]>1e-35?ce=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ce=-.04103416502526736:ce=.04881823954656287:t[4]>15.500000000000002?ce=.009342724662897898:t[0]>3969.5000000000005?ce=-.025637309961309498:ce=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ce=-.08185697075265091:t[0]>2215.5000000000005?ce=.030063975892297354:t[0]>807.5000000000001?ce=-.03924325550733229:ce=.0415330999189793:ce=-.00024374664461674863;let Pe;t[3]>7.500000000000001?Pe=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Pe=.025798416259686565:Pe=.13251610353146012:Pe=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?Pe=-.11098564237775424:Pe=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?Pe=.15347826616466054:t[3]>4.500000000000001?Pe=.10379320730958941:Pe=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?Pe=.03159791088468647:Pe=-.10612873364104258:Pe=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?Pe=-.02335760775001469:Pe=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?Pe=-.011164334474672973:Pe=-.06594044410501655:t[207]>1e-35?Pe=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?Pe=-.01725821503981916:Pe=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?Pe=-.04226531631656534:Pe=-.14409800530171432:Pe=-.03245576341206398:t[8]>4214.500000000001?Pe=.0895409165534886:t[247]>1e-35?Pe=-.06506383629143335:t[118]>1e-35?Pe=-.07214270121257443:t[8]>546.5000000000001?Pe=-.004385020865473831:Pe=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?Pe=.046278501133958524:Pe=-.030835570926968044:t[0]>493.50000000000006?Pe=-.12794504651610425:Pe=.009415039807550776;let Me;t[304]>1e-35?Me=-.04717777269217453:t[76]>1e-35?Me=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Me=-.09648224457374217:t[132]>1e-35?Me=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Me=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Me=.10838431695638147:t[230]>1e-35?Me=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Me=.050071316251979:Me=-.006356941111525215:t[6]>8.500000000000002?Me=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Me=.10217402850540398:Me=-.048840949025349197:Me=-.03668313197909846:t[7]>39.50000000000001?Me=-.0562642841496003:t[10]>2.5000000000000004?Me=.09749777369987417:Me=-.04848223121417616:t[0]>5453.500000000001?Me=.08316648226133942:Me=-.0261979698267618:t[212]>1e-35?Me=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Me=.04837009746506856:Me=-.09184360565631328:Me=.0032411047845613606:t[0]>4733.500000000001?Me=.0977378556864798:Me=.010776545559325588:Me=-.012483310473120218:Me=-.049284121449103935:Me=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Me=-.08380361910948711:Me=.07375088778585813:Me=-.1084864186071348:Me=.0007819503469605476;let ye;t[7]>17.500000000000004?t[115]>1e-35?ye=.08741852531696623:t[167]>1e-35?ye=.10078975495600809:ye=-.0018324767784017562:t[290]>1e-35?ye=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?ye=.1379733311640402:ye=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?ye=-.09360083033774169:ye=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?ye=-.015599362579530679:t[0]>4593.500000000001?ye=-.12029549262691491:ye=-.018917032256501397:ye=.04632831686576592:ye=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?ye=-.05894883236412263:ye=.05213944998315824:ye=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?ye=.07577412405680808:ye=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?ye=-.0277076900736147:t[1]>65.50000000000001?ye=-.023587471585763506:ye=.10184896592433082:ye=-.057699270527916825:ye=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?ye=.06566902102799584:t[10]>25.500000000000004?ye=-.07033633753181047:ye=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?ye=-.08108035861059537:ye=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?ye=-.12431182772561139:ye=.01886235886984271:ye=.0025579594894418116;let oe;t[8]>2915.5000000000005?t[101]>1e-35?oe=.08648323956719083:t[0]>93.50000000000001?t[196]>1e-35?oe=-.09509320772734361:t[4]>1.5000000000000002?t[5]>1106.5000000000002?t[5]>1191.5000000000002?t[283]>1e-35?oe=-.11268313808648661:t[10]>12.500000000000002?t[131]>1e-35?oe=.0687641681341721:t[10]>102.50000000000001?oe=-.09667920080214842:t[4]>15.500000000000002?t[8]>2992.5000000000005?t[1]>24.500000000000004?t[1]>71.50000000000001?oe=-.06762578396473291:t[10]>65.50000000000001?oe=-.05226727783610509:t[282]>1e-35?oe=.09911438410640917:t[19]>1e-35?oe=.06915156336429933:oe=-.006565637886508241:oe=-.08344300251849307:oe=-.0928863907927501:t[1]>60.50000000000001?t[2]>17.500000000000004?oe=.19428463865406298:oe=.016073883020956765:t[13]>1e-35?oe=.06864077097923665:oe=-.01388867527034731:t[0]>1847.5000000000002?oe=.004655280608161356:t[1]>40.50000000000001?oe=.031406054057765996:oe=.12798062439212832:oe=.09859670536264255:t[10]>2.5000000000000004?t[9]>68.50000000000001?oe=.08821759640665892:t[9]>32.50000000000001?t[8]>3960.0000000000005?t[1]>31.500000000000004?oe=-.0706095614785733:oe=.04227164041372561:oe=-.1056906923176064:t[2]>8.500000000000002?t[19]>1e-35?oe=-.07139533369873902:oe=.008952586782921625:oe=.06086212582180936:oe=-.0816938490403437:oe=-.051224901945956025:oe=-.10525399124186095:oe=.000270924147208224;let Ke;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?Ke=.029186512383291244:t[7]>1.5000000000000002?Ke=-.14984127276725573:t[1]>40.50000000000001?Ke=.032757060730648144:Ke=-.07675575422749602:t[6]>8.500000000000002?Ke=.10599766037117893:Ke=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?Ke=-.051394622947855385:Ke=.03237141302699347:Ke=.12526173027943244:Ke=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Ke=-.07383912482657777:t[0]>5147.500000000001?Ke=.07008813937042091:t[10]>38.50000000000001?Ke=-.06779203808365307:Ke=-.013782769999524498:Ke=.0880038869117715:Ke=-.12846294176070952:t[281]>1e-35?Ke=-.06810806903850834:t[10]>227.50000000000003?Ke=-.08937977001661111:t[10]>130.50000000000003?Ke=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?Ke=.011036530162093841:Ke=-.11500797478569702:Ke=.03702229366129399:Ke=.07242026683784307:t[189]>1e-35?Ke=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?Ke=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?Ke=-.02608892716555304:Ke=.09609599320761308:t[9]>105.50000000000001?Ke=-.06848127135991534:Ke=.0023675721254089715:t[86]>1e-35?Ke=-.11049635625500497:Ke=-.004847764219432233;let at;t[125]>1e-35?t[0]>3969.5000000000005?at=-.09462233499115416:at=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?at=-.030700661288166148:at=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?at=.03149547314036763:at=-.08166208257451366:t[0]>5850.500000000001?at=-.10228136324773157:t[102]>1e-35?at=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?at=.01782894842128785:t[13]>1e-35?at=.002680190260979968:at=.1773965720476949:t[2]>72.50000000000001?at=.09090831938627947:t[1]>59.50000000000001?at=-.12297206702816128:t[0]>4977.500000000001?at=.09899015653118268:at=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?at=-.0675900954187773:at=.012336403425364092:at=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?at=-.02671721777458802:at=-.09242452991958029:t[284]>1e-35?at=-.08585691288582491:at=.013332890564324447:t[4]>14.500000000000002?at=-.005245022074799553:t[23]>1e-35?at=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?at=-.09289852307936758:t[116]>1e-35?at=-.09686573010015055:t[8]>804.5000000000001?at=.03812547148215318:at=.005162744968176633:t[9]>43.50000000000001?at=-.059246106396159376:at=.050370113808135275:at=.000794041852811028;let Gt;t[3]>7.500000000000001?Gt=.0004981426543104341:t[9]>114.50000000000001?Gt=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Gt=-.019061766497948867:Gt=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Gt=-.006044199577160493:Gt=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Gt=.11486607015912494:t[9]>16.500000000000004?Gt=-.08686820858087294:Gt=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Gt=-.022230207980026437:Gt=.1056683690528792:Gt=-.05859530800943035:Gt=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Gt=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Gt=-.05177544573528314:Gt=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Gt=.15159657923771555:Gt=-.0060542654587671055:t[9]>5.500000000000001?Gt=-.042808028205051786:t[1]>48.50000000000001?Gt=-.010449538258110742:Gt=.10026907521968294:Gt=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Gt=-.02272452389409874:Gt=-.11202691218244319:t[5]>1809.5000000000002?Gt=-.04460413584255906:Gt=.08196329474205256:t[10]>69.50000000000001?Gt=.10221481166238167:Gt=.0004063052701699382:t[243]>1e-35?Gt=-.07563941678849846:t[18]>1e-35?Gt=.02563513231103432:Gt=-.004740081147303786;let gr;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?gr=.057446442918106:gr=-.04404018270156349:gr=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?gr=-.05930486238817954:t[1]>29.500000000000004?gr=.06955866121256543:t[8]>597.5000000000001?gr=-.06538593556505168:gr=.06212512595497445:gr=.00021102929959182257:t[9]>90.50000000000001?gr=.0958061289119631:t[102]>1e-35?gr=.07172059675638813:t[1]>47.50000000000001?gr=-.03879798603977766:t[297]>1e-35?gr=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?gr=.003805910996312012:gr=.09304295674749524:t[11]>1e-35?t[18]>1e-35?gr=.11252376801858695:t[288]>1e-35?gr=-.10293901912180432:gr=.014669268837893872:t[1]>42.50000000000001?gr=-.05988274123836837:t[145]>1e-35?gr=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?gr=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?gr=-.03366718308159971:gr=.11936550608549797:t[1]>31.500000000000004?gr=-.07454716789539667:gr=.027859650621164217:t[10]>10.500000000000002?gr=-.11806374092321247:gr=-.03506042229223101:gr=-.0007080765837654515:t[10]>6.500000000000001?gr=-.028077713664996503:t[2]>7.500000000000001?gr=.15803724124216814:gr=.0351381284833169:gr=-.07877953381054767;let ar;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?ar=.14144941521975005:ar=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?ar=.10514088112381886:t[7]>18.500000000000004?ar=-.10370643555956745:ar=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?ar=-.0508129468802936:t[224]>1e-35?ar=-.037816066368733595:t[10]>43.50000000000001?ar=.07793408602607932:ar=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?ar=.036972453794202324:ar=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?ar=.09475302525132188:ar=-.03580104945898193:ar=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?ar=-.1282448778804823:ar=-.014395808269207212:ar=-.008940927190750592:ar=-.1459118815453748:t[0]>4897.500000000001?ar=-.09733068457286576:t[1]>57.50000000000001?ar=.06575271409540207:ar=-.019556422817450115:ar=-.10623959222984136:t[18]>1e-35?ar=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?ar=.008125645893104896:ar=-.11084368630465868:ar=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?ar=-.05854904579626861:t[4]>5.500000000000001?ar=.02985784951394175:ar=-.03247600140149334:ar=-.11152899295304973:ar=-.00035424577714215764;let Or;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Or=-.06563670567578264:Or=.067656954313663:Or=-.10388217548685377:t[8]>2302.5000000000005?Or=.07190621943790435:t[4]>67.50000000000001?Or=.060020507643618604:t[4]>38.50000000000001?Or=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Or=-.06568134366461277:t[8]>1075.5000000000002?Or=-.004768057709758692:Or=.11785959165999467:Or=-.05080221682879267:Or=.14814206127494542:Or=-.07241946332311736:t[253]>1e-35?Or=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Or=-.02471195342450034:Or=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Or=-.10741850739482771:Or=.010051635824944:Or=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Or=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Or=-.08992396138178163:Or=.010944365997007212:Or=.06221307021813793:Or=.1286024087559141:t[127]>1e-35?Or=.06568148624531012:t[10]>40.50000000000001?Or=-.07567979134643352:t[5]>5647.500000000001?Or=.07594672895572069:Or=-.018158016446439187:t[6]>55.50000000000001?Or=.009293422430111872:t[4]>45.50000000000001?Or=-.017749818406964022:t[2]>46.50000000000001?Or=.01714136511113982:Or=-724762291423549e-19;let Hr;t[1]>24.500000000000004?t[103]>1e-35?t[8]>48.50000000000001?t[17]>1e-35?Hr=-.048689215588703864:t[9]>27.500000000000004?t[0]>3916.5000000000005?Hr=.07084726276890757:Hr=-.11232323677722932:Hr=.04812773089510436:Hr=.11757502216780046:t[5]>1464.5000000000002?t[5]>1505.5000000000002?t[167]>1e-35?Hr=.07470606002425358:t[1]>53.50000000000001?t[132]>1e-35?Hr=.0879462816013881:Hr=-.002966662093626573:t[306]>1e-35?Hr=-.04588085188342676:Hr=.0031910005157084823:t[3]>10.500000000000002?t[10]>20.500000000000004?Hr=-.006600332774461143:Hr=.1272481351557754:Hr=-.09030973597154808:t[284]>1e-35?t[1]>38.50000000000001?t[10]>2.5000000000000004?Hr=.011884312066620044:Hr=.11678751052403374:t[4]>8.500000000000002?Hr=.03627129613273813:Hr=-.12132783497902287:Hr=-.006784372643244717:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Hr=-.06830131718398992:t[0]>5147.500000000001?Hr=.062360406249609306:t[4]>4.500000000000001?Hr=-.013162203864592055:Hr=-.07153029184927609:Hr=.07628618062271557:Hr=-.12085065687320373:t[190]>1e-35?Hr=-.045816889524231186:t[137]>1e-35?Hr=-.07956001795911584:t[199]>1e-35?t[0]>3853.5000000000005?Hr=.025895337822752502:Hr=-.06503949350616421:t[10]>227.50000000000003?Hr=-.09989456525790491:t[10]>130.50000000000003?Hr=.08616651057030683:Hr=.0001234981796706021;let Gr;t[8]>1014.5000000000001?t[9]>137.50000000000003?Gr=-.08778879924617534:t[8]>1022.5000000000001?t[285]>1e-35?t[9]>64.50000000000001?Gr=.04955806187281689:t[0]>3670.5000000000005?t[10]>32.50000000000001?Gr=-.141732381961068:Gr=-.0317152307496497:Gr=-.02074638849097191:t[0]>93.50000000000001?t[0]>3072.5000000000005?t[10]>100.50000000000001?t[4]>24.500000000000004?t[8]>1336.5000000000002?Gr=.12191801556691254:Gr=-.0003444689085397977:Gr=.005739668504631604:t[146]>1e-35?t[308]>1e-35?Gr=.015237524791728777:t[6]>61.50000000000001?t[4]>63.50000000000001?Gr=-.05676033995381961:Gr=.10933961076803381:t[4]>26.500000000000004?Gr=-.11667582544549814:t[8]>1765.5000000000002?Gr=.032174455312047705:Gr=-.0755016390126608:t[293]>1e-35?Gr=-.08234885407658332:t[9]>41.50000000000001?t[0]>3830.5000000000005?Gr=.026571311956824436:t[15]>1e-35?Gr=.06175459479851121:Gr=-.018778084411148754:t[9]>40.50000000000001?Gr=-.09420232889965811:Gr=-.004578248021263184:t[2]>1.5000000000000002?Gr=.005453714644971445:Gr=-.03907138175699279:Gr=-.055296364182154736:t[23]>1e-35?Gr=.036555134842143476:t[0]>4188.500000000001?t[6]>29.500000000000004?Gr=-.09358146510580179:Gr=.060524657996178094:Gr=-.11245101144669545:t[125]>1e-35?t[9]>1.5000000000000002?Gr=-.12698331085931538:Gr=.006059605604079918:t[2]>196.50000000000003?Gr=-.09451315810804783:Gr=.0011390147031687425;let zt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?zt=.05517359070460923:zt=-.04758751221404857:zt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?zt=.1040436595565776:t[9]>21.500000000000004?zt=.04032250517675179:t[107]>1e-35?zt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?zt=.1192453009230486:t[1]>51.50000000000001?zt=.0443376336292195:zt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?zt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?zt=-.08999822408398037:zt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?zt=-.061850439226075:zt=.08849196353361093:zt=.10536348167793089:t[92]>1e-35?zt=.04894947712119185:t[9]>16.500000000000004?zt=.05900227903883853:t[9]>5.500000000000001?zt=-.11946594348916476:zt=-.03652096348071964:t[1]>41.50000000000001?zt=-.07411603110840567:zt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?zt=.08493634342741495:t[11]>1e-35?zt=-.10899097825564363:zt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?zt=.08356655906359918:t[7]>25.500000000000004?zt=-.09475076526194888:t[10]>5.500000000000001?zt=-.01999406228763778:zt=.06696212545889428:t[6]>20.500000000000004?zt=.14713592661393468:zt=.0459917279002218:zt=.00027445928493734093;let _r;t[223]>1e-35?t[1]>31.500000000000004?t[8]>634.5000000000001?_r=-.06904501553217077:_r=.05696231672035904:_r=-.1124703178077813:t[99]>1e-35?t[1]>89.50000000000001?_r=-.05074261170009721:t[1]>57.50000000000001?t[8]>969.5000000000001?_r=-.011419256378538392:t[0]>3830.5000000000005?_r=.140315841503076:_r=.02403434913963024:t[1]>31.500000000000004?t[8]>65.50000000000001?t[2]>10.500000000000002?_r=-.04027822909411164:_r=.03176085103667189:_r=.06779515865838849:t[4]>15.500000000000002?_r=.0762878389015175:t[8]>175.50000000000003?t[0]>3030.5000000000005?t[8]>1041.5000000000002?_r=.06124039747298539:_r=-.04312732764434027:_r=.09161522761808062:_r=-.09663512235460074:t[280]>1e-35?t[6]>45.50000000000001?t[1]>46.50000000000001?_r=.11211681010488772:t[13]>1e-35?_r=.06725735814960367:_r=-.046744031455827846:t[10]>44.50000000000001?t[0]>3400.5000000000005?t[0]>4004.5000000000005?t[2]>22.500000000000004?_r=.11743605068905603:_r=-.011309033539148687:_r=-.07896094707523052:_r=.12862714793172117:t[10]>1.5000000000000002?t[8]>455.50000000000006?t[0]>4706.500000000001?_r=-.09218756798869711:t[10]>19.500000000000004?t[0]>1894.5000000000002?t[0]>3719.5000000000005?_r=.02836295848998302:_r=.12210680366745175:_r=-.058302317470509096:t[5]>4144.500000000001?_r=.06123341960495106:_r=-.03840046906926525:_r=-.05221474543453495:_r=.03988215485860711:_r=-.00033074684693083496;let W0=dzs(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+E+_+v+b+T+w+R+x+P+D+N+L+B+j+M+O+U+q+Q+Y+W+V+z+ie+H+te+le+Le+ge+Oe+we+re+ee+K+he+X+de+qe+ne+ue+Ne+Ie+Be+tt+st+_t+kt+Ht+F+se+be+Fe+Ue+me+Z+ve+Ge+Qe+je+J+ae+Ce+Re+$e+Ye+lt+yt+$t+St+We+ce+Pe+Me+ye+oe+Ke+at+Gt+gr+ar+Or+Hr+Gr+zt+_r);return[1-W0,W0]}a(fei,"multilineModelPredict");function dzs(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(dzs,"sigmoid");var fzs={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},pei={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function hei(t,e,r,n=!0){let o=t.split(` +`);if(n&&(o=o.filter(l=>l.trim().length>0)),Math.abs(e)>o.length||e>=o.length)return!1;e<0&&(e=o.length+e);let s=o[e];return(fzs[r]??[]).some(l=>s.includes(l))}a(hei,"hasComment");var Klt=class{static{a(this,"PromptFeatures")}constructor(e,r){let[n,o]=this.firstAndLast(e),s=this.firstAndLast(e.trimEnd());this.language=r,this.length=e.length,this.firstLineLength=n.length,this.lastLineLength=o.length,this.lastLineRstripLength=o.trimEnd().length,this.lastLineStripLength=o.trim().length,this.rstripLength=e.trimEnd().length,this.stripLength=e.trim().length,this.rstripLastLineLength=s[1].length,this.rstripLastLineStripLength=s[1].trim().length,this.secondToLastLineHasComment=hei(e,-2,r),this.rstripSecondToLastLineHasComment=hei(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` `),this.lastChar=e.slice(-1),this.rstripLastChar=e.trimEnd().slice(-1),this.firstChar=e[0],this.lstripFirstChar=e.trimStart().slice(0,1)}firstAndLast(e){let r=e.split(` -`),n=r.length,o=r[0],s=r[n-1];return s==""&&n>1&&(s=r[n-2]),[o,s]}},Pfr=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new Blt(e,n),this.suffixFeatures=new Blt(r,n)}constructFeatures(){let e=new Array(14).fill(0);e[0]=this.prefixFeatures.length,e[1]=this.prefixFeatures.firstLineLength,e[2]=this.prefixFeatures.lastLineLength,e[3]=this.prefixFeatures.lastLineRstripLength,e[4]=this.prefixFeatures.lastLineStripLength,e[5]=this.prefixFeatures.rstripLength,e[6]=this.prefixFeatures.rstripLastLineLength,e[7]=this.prefixFeatures.rstripLastLineStripLength,e[8]=this.suffixFeatures.length,e[9]=this.suffixFeatures.firstLineLength,e[10]=this.suffixFeatures.lastLineLength,e[11]=this.prefixFeatures.secondToLastLineHasComment?1:0,e[12]=this.prefixFeatures.rstripSecondToLastLineHasComment?1:0,e[13]=this.prefixFeatures.prefixEndsWithNewline?1:0;let r=new Array(Object.keys(xXn).length+1).fill(0);r[xXn[this.language]??0]=1;let n=new Array(Object.keys(E8).length+1).fill(0);n[E8[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(E8).length+1).fill(0);o[E8[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(E8).length+1).fill(0);s[E8[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(E8).length+1).fill(0);return c[E8[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};function MVs(t,e){return new Pfr(t.prefix,t.suffix,e)}a(MVs,"constructMultilineFeatures");function RXn(t,e){let r=MVs(t,e).constructFeatures();return IXn(r)[1]}a(RXn,"requestMultilineScore");p();var Dfr=class t{constructor(e,r){this.index=e;this.documentPrefix=r;this.startOffset=0;this.text="";this.trimCount=0}static{a(this,"StreamingCompletion")}updateText(e){this.text=e}get addedToPrefix(){return this.text.substring(0,this.startOffset)}get effectivePrefix(){return this.documentPrefix+this.addedToPrefix}get effectiveText(){return this.text.substring(this.startOffset)}get isFirstCompletion(){return this.trimCount===0}get firstNewlineOffset(){let e=[...this.text.matchAll(/\r?\n/g)];return e.length>0&&e[0].index===0&&e.shift(),e.length>0?e[0].index:-1}trimAt(e){let r=new t(this.index,this.documentPrefix);return r.startOffset=this.startOffset,r.text=this.text.substring(0,this.startOffset+e),r.trimCount=this.trimCount,this.startOffset+=e,this.trimCount++,r}},Flt=class{constructor(e,r,n,o,s,c){this.ctx=e;this.prefix=r;this.languageId=n;this.initialSingleLine=o;this.trimmerLookahead=s;this.cacheFunction=c;this.lineLimit=3;this.completions=new Map}static{a(this,"StreamedCompletionSplitter")}getFinishedCallback(){return async(e,r)=>{let n=r.index??0,o=this.getCompletion(n,e);if(o.isFirstCompletion&&this.initialSingleLine&&o.firstNewlineOffset>=0){let s={yieldSolution:!0,continueStreaming:!0,finishOffset:o.firstNewlineOffset};return o.trimAt(s.finishOffset),r.finished&&await this.trimAll(r,o),s}return r.finished?await this.trimAll(r,o):await this.trimOnce(r,o)}}getCompletion(e,r){let n=this.completions.get(e);return n||(n=new Dfr(e,this.prefix),this.completions.set(e,n)),n.updateText(r),n}async trimOnce(e,r){let n=await this.trim(r);return n===void 0?{yieldSolution:!1,continueStreaming:!0}:r.isFirstCompletion?(r.trimAt(n),{yieldSolution:!0,continueStreaming:!0,finishOffset:n}):(this.cacheCompletion(e,r,n),{yieldSolution:!1,continueStreaming:!0})}async trimAll(e,r){let n,o;do n=await this.trim(r),r.isFirstCompletion?(o=n,r.trimAt(n??r.effectiveText.length)):this.cacheCompletion(e,r,n);while(n!==void 0);return o!==void 0?{yieldSolution:!0,continueStreaming:!0,finishOffset:o}:{yieldSolution:!1,continueStreaming:!0}}async trim(e){return await new eVe(this.languageId,e.effectivePrefix,e.effectiveText,this.lineLimit,this.trimmerLookahead).getCompletionTrimOffset()}cacheCompletion(e,r,n){let o=r.trimAt(n??r.effectiveText.length);if(o.effectiveText.trim()==="")return;let s=cYe(this.ctx,o.effectiveText.trimEnd(),e.getAPIJsonData(),o.index,e.requestId,n!==void 0,e.telemetryData);s.copilotAnnotations=this.adjustedAnnotations(s,r,o),s.generatedChoiceIndex=o.trimCount,this.cacheFunction(o.addedToPrefix,s)}adjustedAnnotations(e,r,n){if(e.copilotAnnotations===void 0)return;let o=n.addedToPrefix.length,c=o+e.completionText.length>=r.text.length,l={};for(let[u,d]of Object.entries(e.copilotAnnotations)){let f=d.filter(h=>h.start_offset-o0).map(h=>{let m={...h};return m.start_offset-=o,m.stop_offset-=o,c||(m.stop_offset=Math.min(m.stop_offset,e.completionText.length)),m});f.length>0&&(l[u]=f)}return Object.keys(l).length>0?l:void 0}};p();p();var ry=class{static{a(this,"InlineCompletionManager")}};var Ult=new fe("getCompletions"),aNe="legacy",cNe=["activeDocumentLanguageId","afterAccept","afterCursorWhitespace","beforeCursorWhitespace","blockMode","cancelledNetworkRequest","choiceIndex","clientCompletionId","completionsImplementation","contextProviders","disposalReason","endpoint","engineChoiceSource","engineName","headerRequestId","isCycling","isMultiline","isSpeculative","languageId","modelName","n","neighborSource","opportunityId","performanceMetrics","promptMetadata","reason","request_option_code_annotations","request_option_extra","request_option_max_tokens","request_option_n","request_option_stream","request_option_temperature","request_option_top_p","status","temperature","uiKind","acceptance"];function Qlt(t,e,r){t.get(ry).triggerSpeculativeRequests(r);let n=r.telemetry,o=`${e}.shown`;n.markAsDisplayed(),n.properties.reason=rme(r.resultType),n.properties.completionsImplementation??=aNe,Et(t,o,n),At(t,o,fU(n.properties,cNe),n.measurements)}a(Qlt,"telemetryShown");function kXn(t,e,r){let n=`${e}.accepted`;r.properties.completionsImplementation??=aNe,Et(t,n,r),At(t,n,fU(r.properties,cNe),r.measurements)}a(kXn,"telemetryAccepted");function PXn(t,e,r){let n=`${e}.rejected`;r.properties.completionsImplementation??=aNe,Et(t,n,r),At(t,n,fU(r.properties,cNe),r.measurements)}a(PXn,"telemetryRejected");function kH(t,e={}){return t.properties.completionsImplementation??=aNe,{...e,telemetryBlob:t}}a(kH,"mkCanceledResultTelemetry");function yp(t,e){let r={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId,completionsImplementation:t.properties.completionsImplementation??aNe};t.properties.sku!==void 0&&(r.sku=t.properties.sku),t.properties.opportunityId!==void 0&&(r.opportunityId=t.properties.opportunityId),t.properties.organizations_list!==void 0&&(r.organizations_list=t.properties.organizations_list),t.properties.enterprise_list!==void 0&&(r.enterprise_list=t.properties.enterprise_list),t.properties.clientCompletionId!==void 0&&(r.clientCompletionId=t.properties.clientCompletionId);let n=t.filtersAndExp.exp.assignmentContext;if(e){let s=e.get(kk).inlineCompletionsUnificationState.expAssignments.filter(c=>!n.includes(c));n=[n,...s].filter(Boolean).join(";")}return r["abexp.assignmentcontext"]=n,r}a(yp,"mkBasicResultTelemetry");function DXn(t,e){if(e.type!=="promptOnly"){if(e.type==="success"){let r=yl()-e.telemetryBlob.issuedTime,n=rme(e.resultType),o=JSON.stringify(e.performanceMetrics),s={...e.telemetryData,reason:n,performanceMetrics:o},{foundOffset:c}=e.telemetryBlob.measurements,l=e.performanceMetrics?.map(([u,d])=>` -${d.toFixed(2)} ${u}`).join("")??"";return Ult.debug(t,`ghostText produced from ${n} in ${Math.round(r)}ms with foundOffset ${c}${l}`),vse(t,"ghostText.produced",s,{timeToProduceMs:r,foundOffset:c}),e.value}if(Ult.debug(t,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){Et(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}vse(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(DXn,"handleGhostTextResultTelemetry");function rme(t){switch(t){case 0:return"network";case 1:return"cache";case 3:return"cycling";case 2:return"typingAsSuggested";case 4:return"async"}}a(rme,"resultTypeToString");p();p();p();var OVs={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},LVs="ms-vscode.cpptools",BVs="CppCompletionContextProvider";function NXn(t,e,r,n){(e.includes(BVs)||e.length===1&&e[0]==="*")&&OXn(t,r,n)}a(NXn,"fillInCppVSActiveExperiments");function MXn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(LVs))&&OXn(t,r,n)}a(MXn,"fillInCppVSCodeActiveExperiments");function OXn(t,e,r){try{let n=OVs,o=t.get(Zt).cppContextProviderParams(r);if(o)try{n=JSON.parse(o)}catch(s){Nr.error(t,"Failed to parse cppContextProviderParams",s)}for(let[s,c]of Object.entries(n))e.set(s,c)}catch(n){Nr.exception(t,n,"fillInCppActiveExperiments")}}a(OXn,"addActiveExperiments");p();function qlt(t,e,r){try{let n=t.get(Zt).csharpContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Nr.debug(t,"Failed to get the active C# experiments for the Context Provider API",n),!1}return!0}a(qlt,"fillInCSharpActiveExperiments");p();var Nfr="fallbackContextProvider",Mfr={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function LXn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(Nfr))&&FVs(t,r,n)}a(LXn,"fillInMultiLanguageActiveExperiments");function FVs(t,e,r){try{let n=UVs(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){Nr.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(FVs,"addActiveExperiments");function UVs(t,e){let r=Mfr,n=t.get(Zt).multiLanguageContextProviderParams(e);if(n)try{r=JSON.parse(n)}catch(o){Nr.error(t,"Failed to parse multiLanguageContextProviderParams",o)}return r}a(UVs,"getMultiLanguageContextProviderParamsFromExp");p();var QVs="typescript-ai-context-provider";function BXn(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(QVs)))return!1;try{let o=t.get(Zt).tsContextProviderParams(n);if(o){let s=JSON.parse(o);for(let[c,l]of Object.entries(s))r.set(c,l)}}catch(o){return Nr.debug(t,"Failed to get the active TypeScript experiments for the Context Provider API",o),!1}return!0}a(BXn,"fillInTsActiveExperiments");p();Mo();var FXn=S.Object({importance:S.Optional(S.Integer({minimum:0,maximum:100})),id:S.Optional(S.String()),origin:S.Optional(S.Union([S.Literal("request"),S.Literal("update")]))}),UXn=S.Intersect([S.Object({name:S.String(),value:S.String()}),FXn]),QXn=S.Intersect([S.Object({uri:S.String(),value:S.String(),additionalUris:S.Optional(S.Array(S.String()))}),FXn]),qVs=[UXn,QXn],jVs=S.Union(qVs),HVs=new Map([["Trait",qu.Compile(UXn)],["CodeSnippet",qu.Compile(QXn)]]),GVs=a(t=>t,"ensureTypesAreEqual");GVs(!0);var $Vs=S.Object({contextItems:S.Array(jVs)}),VVs=S.Object({selector:S.Array(S.Union([S.String(),S.Object({language:S.Optional(S.String()),scheme:S.Optional(S.String()),pattern:S.Optional(S.String())})]))}),Ofr=S.Object({id:S.String()}),WVs=S.Intersect([Ofr,VVs]),zVs=S.Intersect([Ofr,$Vs]),qXn=S.Object({providers:S.Array(WVs)}),jXn=S.Object({providers:S.Array(Ofr)}),Lfr=S.Object({providers:S.Array(zVs),updating:S.Optional(S.Array(S.String()))}),HXn=S.Intersect([_vn,S.Object({contextItems:S.Optional(Lfr)})]);function jlt(t,e){return t.map(r=>{let n=r.data.filter(o=>o.type===e);return n.length>0?{...r,data:n}:void 0}).filter(r=>r!==void 0)}a(jlt,"filterContextItemsByType");function GXn(t){let e=[],r=0;return t.forEach(n=>{let o=!1;for(let[s,c]of HVs.entries())if(c.Check(n)){e.push({...n,type:s}),o=!0;break}o||r++}),[e,r]}a(GXn,"filterSupportedContextItems");function YVs(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(YVs,"validateContextItemId");function $Xn(t,e){let r=new Set,n=[];for(let o of e){let s=o.id??Mt();if(!YVs(s)){let c=Mt();Nr.error(t,`Invalid context item ID ${s}, replacing with ${c}`),s=c}if(r.has(s)){let c=Mt();Nr.error(t,`Duplicate context item ID ${s}, replacing with ${c}`),s=c}r.add(s),n.push({...o,id:s})}return n}a($Xn,"addOrValidateContextItemsIDs");p();var pm=class{constructor(e=()=>new Bfr){this.createStatistics=e;this.statistics=new Cn(25)}static{a(this,"ContextProviderStatistics")}getStatisticsForCompletion(e){let r=this.statistics.get(e);if(r)return r;let n=this.createStatistics();return this.statistics.set(e,n),n}getPreviousStatisticsForCompletion(e){let r=Array.from(this.statistics.keys());for(let n=r.length-1;n>=0;n--){let o=r[n];if(o!==e)return this.statistics.peek(o)}}},Bfr=class{constructor(){this._expectations=new Map;this._lastResolution=new Map;this._statistics=new Map}static{a(this,"PerCompletionContextProviderStatistics")}addExpectations(e,r){let n=this._expectations.get(e)??[];this._expectations.set(e,[...n,...r])}clearExpectations(){this._expectations.clear()}setLastResolution(e,r){this._lastResolution.set(e,r)}get(e){return this._statistics.get(e)}computeMatch(e){try{for(let[r,n]of this._expectations){if(n.length===0)continue;let o=this._lastResolution.get(r)??"none";if(o==="none"||o==="error"){this._statistics.set(r,{usage:"none",resolution:o});continue}let s=[];for(let[d,f]of n){let h={id:d.id,type:d.type};if(d.origin&&(h.origin=d.origin),f==="content_excluded"){s.push({...h,usage:"none_content_excluded"});continue}let m=e.find(g=>g.source===d);m===void 0?s.push({...h,usage:"error"}):s.push({...h,usage:m.expectedTokens>0&&m.expectedTokens===m.actualTokens?"full":m.actualTokens>0?"partial":"none",expectedTokens:m.expectedTokens,actualTokens:m.actualTokens})}let l=s.reduce((d,f)=>f.usage==="full"?d+1:f.usage==="partial"?d+.5:d,0)/n.length,u=l===1?"full":l===0?"none":"partial";this._statistics.set(r,{resolution:o,usage:u,usageDetails:s})}}finally{this.clearExpectations(),this._lastResolution.clear()}}};function Hlt(t){return t.map(e=>{if(!(e.source===void 0||e.expectedTokens===void 0||e.actualTokens===void 0))return{source:e.source,expectedTokens:e.expectedTokens,actualTokens:e.actualTokens}}).filter(e=>e!==void 0)}a(Hlt,"componentStatisticsToPromptMatcher");var VXn=de(ri());var hm=class{static{a(this,"ContextProviderRegistry")}},r4=class{static{a(this,"DefaultContextProviders")}},nme=class extends r4{constructor(){super();this.ids=[]}static{a(this,"DefaultContextProvidersContainer")}add(r){this.ids.push(r)}getIds(){return this.ids}},Ffr=class extends hm{constructor(r,n){super();this.ctx=r;this.match=n;this._providers=[]}static{a(this,"CoreContextProviderRegistry")}registerContextProvider(r){if(r.id.includes(",")||r.id.includes("*"))throw new Error(`A context provider id cannot contain a comma or an asterisk. The id ${r.id} is invalid.`);if(this._providers.find(n=>n.id===r.id))throw new Error(`A context provider with id ${r.id} has already been registered`);this._providers.push(r)}unregisterContextProvider(r){this._providers=this._providers.filter(n=>n.id!==r)}get providers(){return this._providers.slice()}async resolveAllProviders(r,n,o,s,c,l){if(c?.isCancellationRequested)return Nr.debug(this.ctx,"Resolving context providers cancelled"),[];let u=new Map;qlt(this.ctx,u,s);let d=[];if(this._providers.length===0)return d;let f=await this.matchProviders(o,s),h=f.filter(T=>T[1]>0);if(f.filter(T=>T[1]<=0).forEach(([T,w])=>{let R={providerId:T.id,matchScore:w,resolution:"none",resolutionTimeMs:0,data:[]};d.push(R)}),h.length===0)return d;if(c?.isCancellationRequested)return Nr.debug(this.ctx,"Resolving context providers cancelled"),[];MXn(this.ctx,h.map(T=>T[0].id),u,s),LXn(this.ctx,h.map(T=>T[0].id),u,s),BXn(this.ctx,h.map(T=>T[0].id),u,s);let g=new VXn.CancellationTokenSource;if(c){let T=c.onCancellationRequested(w=>{g.cancel(),T.dispose()})}let A=kCe(this.ctx)&&!Q9e(this.ctx)?0:KVs(this.ctx,s),y=A>0?Date.now()+A:Number.MAX_SAFE_INTEGER,E;A>0&&(E=setTimeout(()=>{g.cancel(),g.dispose()},A));let _=new Map,v={completionId:r,opportunityId:n,documentContext:o,activeExperiments:u,timeBudget:A,timeoutEnd:y,data:l};for(let[T]of h){let w=this.ctx.get(pm).getPreviousStatisticsForCompletion(r)?.get(T.id);w&&(v.previousUsageStatistics=w);let R=T.resolver.resolve(v,g.token);_.set(T.id,R)}let b=await Rfn(_,g.token);E&&clearTimeout(E);for(let[T,w]of h){let R=b.get(T.id);if(R){if(R.status==="error")xP(R.reason)||Nr.error(this.ctx,`Error resolving context from ${T.id}: `,R.reason),d.push({providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:[]});else{let x=[...R.value??[]];if((R.status==="none"||R.status==="partial")&&(Nr.info(this.ctx,`Context provider ${T.id} exceeded time budget of ${A}ms`),T.resolver.resolveOnTimeout))try{let B=T.resolver.resolveOnTimeout(v);l6t(B)?x.push(...B):B&&x.push(B),x.length>0&&(R.status="partial")}catch(B){Nr.error(this.ctx,`Error in fallback logic for context provider ${T.id}: `,B)}let[P,D]=GXn(x);D&&Nr.error(this.ctx,`Dropped ${D} context items from ${T.id} due to invalid schema`);let N=$Xn(this.ctx,P),L={providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:N};d.push(L)}this.ctx.get(pm).getStatisticsForCompletion(r).setLastResolution(T.id,R.status)}else Nr.error(this.ctx,`Context provider ${T.id} not found in results`)}return d.sort((T,w)=>w.matchScore-T.matchScore)}async matchProviders(r,n){let o=WXn(this.ctx,n),s=o.length===1&&o[0]==="*";return await Promise.all(this._providers.map(async l=>{if(!s&&!o.includes(l.id))return[l,0];let u=await this.match(this.ctx,l.selector,r);return[l,u]}))}get matchFunction(){return this.match}},Ufr=class extends hm{constructor(r){super();this.delegate=r;this._cachedContextItems=new Cn(5)}static{a(this,"CachedContextProviderRegistry")}registerContextProvider(r){this.delegate.registerContextProvider(r)}unregisterContextProvider(r){this.delegate.unregisterContextProvider(r)}get providers(){return this.delegate.providers}async resolveAllProviders(r,n,o,s,c,l){let u=this._cachedContextItems.get(r);if(r&&u&&u.length>0)return u;let d=await this.delegate.resolveAllProviders(r,n,o,s,c,l);return d.length>0&&r&&this._cachedContextItems.set(r,d),d}get matchFunction(){return this.delegate.matchFunction}};function Glt(t,e){return new Ufr(new Ffr(t,e))}a(Glt,"getContextProviderRegistry");function $lt(t,e,r){let n=t.get(pm).getStatisticsForCompletion(e);return r.map(s=>{let{providerId:c,resolution:l,resolutionTimeMs:u,matchScore:d,data:f}=s,h=n.get(c),m=h?.usage??"none";(d<=0||l==="none"||l==="error")&&(m="none");let g={providerId:c,resolution:l,resolutionTimeMs:u,usage:m,usageDetails:h?.usageDetails,matched:d>0,numResolvedItems:f.length},A=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="full"||E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0,y=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0;return A!==void 0&&(g.numUsedItems=A),y!==void 0&&(g.numPartiallyUsedItems=y),g})}a($lt,"telemetrizeContextItems");function Vlt(t){return t.matchScore>0&&t.resolution!=="error"}a(Vlt,"matchContextItems");function WXn(t,e){let r=Qfr(t,e),n=Ft(t,Ye.ContextProviders)??[];if(r.length===1&&r[0]==="*"||n.length===1&&n[0]==="*")return["*"];let o=t.get(r4).getIds();return Array.from(new Set([...o,...r,...n]))}a(WXn,"getActiveContextProviders");function Qfr(t,e){return kCe(t)?["*"]:t.get(Zt).contextProviders(e)}a(Qfr,"getExpContextProviders");function ime(t,e){return WXn(t,e).length>0}a(ime,"useContextProviderAPI");function KVs(t,e){let r=Ft(t,Ye.ContextProviderTimeBudget);return r!==void 0&&typeof r=="number"?r:t.get(Zt).contextProviderTimeBudget(e)}a(KVs,"getContextProviderTimeBudget");var Nb=class{constructor(e){this.ctx=e;this.scheduledResolutions=new Cn(25)}static{a(this,"ContextProviderBridge")}schedule(e,r,n,o,s,c){let l=this.ctx.get(hm),{textDocument:u,originalPosition:d,originalOffset:f,originalVersion:h,editsWithPosition:m}=e,g=l.resolveAllProviders(r,n,{uri:u.uri,languageId:u.detectedLanguageId,version:h,offset:f,position:d,proposedEdits:m.length>0?m:void 0},o,s,c?.data);this.scheduledResolutions.set(r,g)}async resolution(e){let r=this.scheduledResolutions.get(e);return r?await r:[]}};p();p();var Wlt=class{constructor(e,r,n){this.languageId=e;this.nodeMatch=r;this.nodeTypesWithBlockOrStmtChild=n}static{a(this,"BaseBlockParser")}async getNodeMatchAtPosition(e,r,n){let o=await AQ(this.languageId,e);try{let c=o.rootNode.descendantForIndex(r);for(;c;){let l=this.nodeMatch[c.type];if(l){if(!this.nodeTypesWithBlockOrStmtChild.has(c.type))break;let u=this.nodeTypesWithBlockOrStmtChild.get(c.type);if((u==""?c.namedChildren[0]:c.childForFieldName(u))?.type==l)break}c=c.parent}return c?n(c):void 0}finally{o.delete()}}getNextBlockAtPosition(e,r,n){return this.getNodeMatchAtPosition(e,r,o=>{let s=o.children.reverse().find(c=>c.type==this.nodeMatch[o.type]);if(s){if(this.languageId=="python"&&s.parent){let c=s.parent.type==":"?s.parent.parent:s.parent,l=c?.nextSibling;for(;l&&l.type=="comment";){let u=l.startPosition.row==s.endPosition.row&&l.startPosition.column>=s.endPosition.column,d=l.startPosition.row>c.endPosition.row&&l.startPosition.column>c.startPosition.column;if(u||d)s=l,l=l.nextSibling;else break}}if(!(s.endIndex>=s.tree.rootNode.endIndex-1&&(s.hasError||s.parent.hasError)))return n(s)}})}async isBlockBodyFinished(e,r,n){let o=(e+r).trimEnd(),s=await this.getNextBlockAtPosition(o,n,c=>c.endIndex);if(s!==void 0&&s0?c:void 0}}getNodeStart(e,r){let n=e.trimEnd();return this.getNodeMatchAtPosition(n,r,o=>o.startIndex)}},zlt=class extends Wlt{constructor(r,n,o,s,c){super(r,s,c);this.blockEmptyMatch=n;this.lineMatch=o}static{a(this,"RegexBasedBlockParser")}isBlockStart(r){return this.lineMatch.test(r.trimStart())}async isBlockBodyEmpty(r,n){let o=await this.getNextBlockAtPosition(r,n,s=>{s.startIndex1&&(s=r[n-2]),[o,s]}},rpr=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new Klt(e,n),this.suffixFeatures=new Klt(r,n)}constructFeatures(){let e=new Array(14).fill(0);e[0]=this.prefixFeatures.length,e[1]=this.prefixFeatures.firstLineLength,e[2]=this.prefixFeatures.lastLineLength,e[3]=this.prefixFeatures.lastLineRstripLength,e[4]=this.prefixFeatures.lastLineStripLength,e[5]=this.prefixFeatures.rstripLength,e[6]=this.prefixFeatures.rstripLastLineLength,e[7]=this.prefixFeatures.rstripLastLineStripLength,e[8]=this.suffixFeatures.length,e[9]=this.suffixFeatures.firstLineLength,e[10]=this.suffixFeatures.lastLineLength,e[11]=this.prefixFeatures.secondToLastLineHasComment?1:0,e[12]=this.prefixFeatures.rstripSecondToLastLineHasComment?1:0,e[13]=this.prefixFeatures.prefixEndsWithNewline?1:0;let r=new Array(Object.keys(pei).length+1).fill(0);r[pei[this.language]??0]=1;let n=new Array(Object.keys(R8).length+1).fill(0);n[R8[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(R8).length+1).fill(0);o[R8[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(R8).length+1).fill(0);s[R8[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(R8).length+1).fill(0);return c[R8[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};function pzs(t,e){return new rpr(t.prefix,t.suffix,e)}a(pzs,"constructMultilineFeatures");function mei(t,e){let r=pzs(t,e).constructFeatures();return fei(r)[1]}a(mei,"requestMultilineScore");p();var npr=class t{constructor(e,r){this.index=e;this.documentPrefix=r;this.startOffset=0;this.text="";this.trimCount=0}static{a(this,"StreamingCompletion")}updateText(e){this.text=e}get addedToPrefix(){return this.text.substring(0,this.startOffset)}get effectivePrefix(){return this.documentPrefix+this.addedToPrefix}get effectiveText(){return this.text.substring(this.startOffset)}get isFirstCompletion(){return this.trimCount===0}get firstNewlineOffset(){let e=[...this.text.matchAll(/\r?\n/g)];return e.length>0&&e[0].index===0&&e.shift(),e.length>0?e[0].index:-1}trimAt(e){let r=new t(this.index,this.documentPrefix);return r.startOffset=this.startOffset,r.text=this.text.substring(0,this.startOffset+e),r.trimCount=this.trimCount,this.startOffset+=e,this.trimCount++,r}},Jlt=class{constructor(e,r,n,o,s,c){this.ctx=e;this.prefix=r;this.languageId=n;this.initialSingleLine=o;this.trimmerLookahead=s;this.cacheFunction=c;this.lineLimit=3;this.completions=new Map}static{a(this,"StreamedCompletionSplitter")}getFinishedCallback(){return async(e,r)=>{let n=r.index??0,o=this.getCompletion(n,e);if(o.isFirstCompletion&&this.initialSingleLine&&o.firstNewlineOffset>=0){let s={yieldSolution:!0,continueStreaming:!0,finishOffset:o.firstNewlineOffset};return o.trimAt(s.finishOffset),r.finished&&await this.trimAll(r,o),s}return r.finished?await this.trimAll(r,o):await this.trimOnce(r,o)}}getCompletion(e,r){let n=this.completions.get(e);return n||(n=new npr(e,this.prefix),this.completions.set(e,n)),n.updateText(r),n}async trimOnce(e,r){let n=await this.trim(r);return n===void 0?{yieldSolution:!1,continueStreaming:!0}:r.isFirstCompletion?(r.trimAt(n),{yieldSolution:!0,continueStreaming:!0,finishOffset:n}):(this.cacheCompletion(e,r,n),{yieldSolution:!1,continueStreaming:!0})}async trimAll(e,r){let n,o;do n=await this.trim(r),r.isFirstCompletion?(o=n,r.trimAt(n??r.effectiveText.length)):this.cacheCompletion(e,r,n);while(n!==void 0);return o!==void 0?{yieldSolution:!0,continueStreaming:!0,finishOffset:o}:{yieldSolution:!1,continueStreaming:!0}}async trim(e){return await new IVe(this.languageId,e.effectivePrefix,e.effectiveText,this.lineLimit,this.trimmerLookahead).getCompletionTrimOffset()}cacheCompletion(e,r,n){let o=r.trimAt(n??r.effectiveText.length);if(o.effectiveText.trim()==="")return;let s=LYe(this.ctx,o.effectiveText.trimEnd(),e.getAPIJsonData(),o.index,e.requestId,n!==void 0,e.telemetryData);s.copilotAnnotations=this.adjustedAnnotations(s,r,o),s.generatedChoiceIndex=o.trimCount,this.cacheFunction(o.addedToPrefix,s)}adjustedAnnotations(e,r,n){if(e.copilotAnnotations===void 0)return;let o=n.addedToPrefix.length,c=o+e.completionText.length>=r.text.length,l={};for(let[u,d]of Object.entries(e.copilotAnnotations)){let f=d.filter(h=>h.start_offset-o0).map(h=>{let m={...h};return m.start_offset-=o,m.stop_offset-=o,c||(m.stop_offset=Math.min(m.stop_offset,e.completionText.length)),m});f.length>0&&(l[u]=f)}return Object.keys(l).length>0?l:void 0}};p();p();var sy=class{static{a(this,"InlineCompletionManager")}};var Zlt=new pe("getCompletions"),vNe="legacy",CNe=["activeDocumentLanguageId","afterAccept","afterCursorWhitespace","beforeCursorWhitespace","blockMode","cancelledNetworkRequest","choiceIndex","clientCompletionId","completionsImplementation","contextProviders","disposalReason","endpoint","engineChoiceSource","engineName","headerRequestId","isCycling","isMultiline","isSpeculative","languageId","modelName","n","neighborSource","opportunityId","performanceMetrics","promptMetadata","reason","request_option_code_annotations","request_option_extra","request_option_max_tokens","request_option_n","request_option_stream","request_option_temperature","request_option_top_p","status","temperature","uiKind","acceptance"];function Xlt(t,e,r){t.get(sy).triggerSpeculativeRequests(r);let n=r.telemetry,o=`${e}.shown`;n.markAsDisplayed(),n.properties.reason=hme(r.resultType),n.properties.completionsImplementation??=vNe,ft(t,o,n),cr(t,o,SU(n.properties,CNe),n.measurements)}a(Xlt,"telemetryShown");function gei(t,e,r){let n=`${e}.accepted`;r.properties.completionsImplementation??=vNe,ft(t,n,r),cr(t,n,SU(r.properties,CNe),r.measurements)}a(gei,"telemetryAccepted");function Aei(t,e,r){let n=`${e}.rejected`;r.properties.completionsImplementation??=vNe,ft(t,n,r),cr(t,n,SU(r.properties,CNe),r.measurements)}a(Aei,"telemetryRejected");function qH(t,e={}){return t.properties.completionsImplementation??=vNe,{...e,telemetryBlob:t}}a(qH,"mkCanceledResultTelemetry");function vp(t,e){let r={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId,completionsImplementation:t.properties.completionsImplementation??vNe};t.properties.sku!==void 0&&(r.sku=t.properties.sku),t.properties.opportunityId!==void 0&&(r.opportunityId=t.properties.opportunityId),t.properties.organizations_list!==void 0&&(r.organizations_list=t.properties.organizations_list),t.properties.enterprise_list!==void 0&&(r.enterprise_list=t.properties.enterprise_list),t.properties.clientCompletionId!==void 0&&(r.clientCompletionId=t.properties.clientCompletionId);let n=t.filtersAndExp.exp.assignmentContext;if(e){let s=e.get(Uk).inlineCompletionsUnificationState.expAssignments.filter(c=>!n.includes(c));n=[n,...s].filter(Boolean).join(";")}return r["abexp.assignmentcontext"]=n,r}a(vp,"mkBasicResultTelemetry");function yei(t,e){if(e.type!=="promptOnly"){if(e.type==="success"){let r=El()-e.telemetryBlob.issuedTime,n=hme(e.resultType),o=JSON.stringify(e.performanceMetrics),s={...e.telemetryData,reason:n,performanceMetrics:o},{foundOffset:c}=e.telemetryBlob.measurements,l=e.performanceMetrics?.map(([u,d])=>` +${d.toFixed(2)} ${u}`).join("")??"";return Zlt.debug(t,`ghostText produced from ${n} in ${Math.round(r)}ms with foundOffset ${c}${l}`),Pse(t,"ghostText.produced",s,{timeToProduceMs:r,foundOffset:c}),e.value}if(Zlt.debug(t,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){ft(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}Pse(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(yei,"handleGhostTextResultTelemetry");function hme(t){switch(t){case 0:return"network";case 1:return"cache";case 3:return"cycling";case 2:return"typingAsSuggested";case 4:return"async"}}a(hme,"resultTypeToString");p();p();p();var hzs={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},mzs="ms-vscode.cpptools",gzs="CppCompletionContextProvider";function Eei(t,e,r,n){(e.includes(gzs)||e.length===1&&e[0]==="*")&&vei(t,r,n)}a(Eei,"fillInCppVSActiveExperiments");function _ei(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(mzs))&&vei(t,r,n)}a(_ei,"fillInCppVSCodeActiveExperiments");function vei(t,e,r){try{let n=hzs,o=t.get(Jt).cppContextProviderParams(r);if(o)try{n=JSON.parse(o)}catch(s){Nr.error(t,"Failed to parse cppContextProviderParams",s)}for(let[s,c]of Object.entries(n))e.set(s,c)}catch(n){Nr.exception(t,n,"fillInCppActiveExperiments")}}a(vei,"addActiveExperiments");p();function eut(t,e,r){try{let n=t.get(Jt).csharpContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Nr.debug(t,"Failed to get the active C# experiments for the Context Provider API",n),!1}return!0}a(eut,"fillInCSharpActiveExperiments");p();var ipr="fallbackContextProvider",opr={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function Cei(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(ipr))&&Azs(t,r,n)}a(Cei,"fillInMultiLanguageActiveExperiments");function Azs(t,e,r){try{let n=yzs(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){Nr.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(Azs,"addActiveExperiments");function yzs(t,e){let r=opr,n=t.get(Jt).multiLanguageContextProviderParams(e);if(n)try{r=JSON.parse(n)}catch(o){Nr.error(t,"Failed to parse multiLanguageContextProviderParams",o)}return r}a(yzs,"getMultiLanguageContextProviderParamsFromExp");p();var Ezs="typescript-ai-context-provider";function bei(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(Ezs)))return!1;try{let o=t.get(Jt).tsContextProviderParams(n);if(o){let s=JSON.parse(o);for(let[c,l]of Object.entries(s))r.set(c,l)}}catch(o){return Nr.debug(t,"Failed to get the active TypeScript experiments for the Context Provider API",o),!1}return!0}a(bei,"fillInTsActiveExperiments");p();Mo();var Sei=S.Object({importance:S.Optional(S.Integer({minimum:0,maximum:100})),id:S.Optional(S.String()),origin:S.Optional(S.Union([S.Literal("request"),S.Literal("update")]))}),Tei=S.Intersect([S.Object({name:S.String(),value:S.String()}),Sei]),Iei=S.Intersect([S.Object({uri:S.String(),value:S.String(),additionalUris:S.Optional(S.Array(S.String()))}),Sei]),_zs=[Tei,Iei],vzs=S.Union(_zs),Czs=new Map([["Trait",$u.Compile(Tei)],["CodeSnippet",$u.Compile(Iei)]]),bzs=a(t=>t,"ensureTypesAreEqual");bzs(!0);var Szs=S.Object({contextItems:S.Array(vzs)}),Tzs=S.Object({selector:S.Array(S.Union([S.String(),S.Object({language:S.Optional(S.String()),scheme:S.Optional(S.String()),pattern:S.Optional(S.String())})]))}),spr=S.Object({id:S.String()}),Izs=S.Intersect([spr,Tzs]),xzs=S.Intersect([spr,Szs]),xei=S.Object({providers:S.Array(Izs)}),wei=S.Object({providers:S.Array(spr)}),apr=S.Object({providers:S.Array(xzs),updating:S.Optional(S.Array(S.String()))}),Rei=S.Intersect([KCn,S.Object({contextItems:S.Optional(apr)})]);function tut(t,e){return t.map(r=>{let n=r.data.filter(o=>o.type===e);return n.length>0?{...r,data:n}:void 0}).filter(r=>r!==void 0)}a(tut,"filterContextItemsByType");function kei(t){let e=[],r=0;return t.forEach(n=>{let o=!1;for(let[s,c]of Czs.entries())if(c.Check(n)){e.push({...n,type:s}),o=!0;break}o||r++}),[e,r]}a(kei,"filterSupportedContextItems");function wzs(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(wzs,"validateContextItemId");function Pei(t,e){let r=new Set,n=[];for(let o of e){let s=o.id??Nt();if(!wzs(s)){let c=Nt();Nr.error(t,`Invalid context item ID ${s}, replacing with ${c}`),s=c}if(r.has(s)){let c=Nt();Nr.error(t,`Duplicate context item ID ${s}, replacing with ${c}`),s=c}r.add(s),n.push({...o,id:s})}return n}a(Pei,"addOrValidateContextItemsIDs");p();var ym=class{constructor(e=()=>new cpr){this.createStatistics=e;this.statistics=new Cn(25)}static{a(this,"ContextProviderStatistics")}getStatisticsForCompletion(e){let r=this.statistics.get(e);if(r)return r;let n=this.createStatistics();return this.statistics.set(e,n),n}getPreviousStatisticsForCompletion(e){let r=Array.from(this.statistics.keys());for(let n=r.length-1;n>=0;n--){let o=r[n];if(o!==e)return this.statistics.peek(o)}}},cpr=class{constructor(){this._expectations=new Map;this._lastResolution=new Map;this._statistics=new Map}static{a(this,"PerCompletionContextProviderStatistics")}addExpectations(e,r){let n=this._expectations.get(e)??[];this._expectations.set(e,[...n,...r])}clearExpectations(){this._expectations.clear()}setLastResolution(e,r){this._lastResolution.set(e,r)}get(e){return this._statistics.get(e)}computeMatch(e){try{for(let[r,n]of this._expectations){if(n.length===0)continue;let o=this._lastResolution.get(r)??"none";if(o==="none"||o==="error"){this._statistics.set(r,{usage:"none",resolution:o});continue}let s=[];for(let[d,f]of n){let h={id:d.id,type:d.type};if(d.origin&&(h.origin=d.origin),f==="content_excluded"){s.push({...h,usage:"none_content_excluded"});continue}let m=e.find(g=>g.source===d);m===void 0?s.push({...h,usage:"error"}):s.push({...h,usage:m.expectedTokens>0&&m.expectedTokens===m.actualTokens?"full":m.actualTokens>0?"partial":"none",expectedTokens:m.expectedTokens,actualTokens:m.actualTokens})}let l=s.reduce((d,f)=>f.usage==="full"?d+1:f.usage==="partial"?d+.5:d,0)/n.length,u=l===1?"full":l===0?"none":"partial";this._statistics.set(r,{resolution:o,usage:u,usageDetails:s})}}finally{this.clearExpectations(),this._lastResolution.clear()}}};function rut(t){return t.map(e=>{if(!(e.source===void 0||e.expectedTokens===void 0||e.actualTokens===void 0))return{source:e.source,expectedTokens:e.expectedTokens,actualTokens:e.actualTokens}}).filter(e=>e!==void 0)}a(rut,"componentStatisticsToPromptMatcher");var Dei=fe(ei());var Em=class{static{a(this,"ContextProviderRegistry")}},i4=class{static{a(this,"DefaultContextProviders")}},mme=class extends i4{constructor(){super();this.ids=[]}static{a(this,"DefaultContextProvidersContainer")}add(r){this.ids.push(r)}getIds(){return this.ids}},lpr=class extends Em{constructor(r,n){super();this.ctx=r;this.match=n;this._providers=[]}static{a(this,"CoreContextProviderRegistry")}registerContextProvider(r){if(r.id.includes(",")||r.id.includes("*"))throw new Error(`A context provider id cannot contain a comma or an asterisk. The id ${r.id} is invalid.`);if(this._providers.find(n=>n.id===r.id))throw new Error(`A context provider with id ${r.id} has already been registered`);this._providers.push(r)}unregisterContextProvider(r){this._providers=this._providers.filter(n=>n.id!==r)}get providers(){return this._providers.slice()}async resolveAllProviders(r,n,o,s,c,l){if(c?.isCancellationRequested)return Nr.debug(this.ctx,"Resolving context providers cancelled"),[];let u=new Map;eut(this.ctx,u,s);let d=[];if(this._providers.length===0)return d;let f=await this.matchProviders(o,s),h=f.filter(T=>T[1]>0);if(f.filter(T=>T[1]<=0).forEach(([T,w])=>{let R={providerId:T.id,matchScore:w,resolution:"none",resolutionTimeMs:0,data:[]};d.push(R)}),h.length===0)return d;if(c?.isCancellationRequested)return Nr.debug(this.ctx,"Resolving context providers cancelled"),[];_ei(this.ctx,h.map(T=>T[0].id),u,s),Cei(this.ctx,h.map(T=>T[0].id),u,s),bei(this.ctx,h.map(T=>T[0].id),u,s);let g=new Dei.CancellationTokenSource;if(c){let T=c.onCancellationRequested(w=>{g.cancel(),T.dispose()})}let A=KCe(this.ctx)&&!fUe(this.ctx)?0:Rzs(this.ctx,s),y=A>0?Date.now()+A:Number.MAX_SAFE_INTEGER,E;A>0&&(E=setTimeout(()=>{g.cancel(),g.dispose()},A));let _=new Map,v={completionId:r,opportunityId:n,documentContext:o,activeExperiments:u,timeBudget:A,timeoutEnd:y,data:l};for(let[T]of h){let w=this.ctx.get(ym).getPreviousStatisticsForCompletion(r)?.get(T.id);w&&(v.previousUsageStatistics=w);let R=T.resolver.resolve(v,g.token);_.set(T.id,R)}let b=await Opn(_,g.token);E&&clearTimeout(E);for(let[T,w]of h){let R=b.get(T.id);if(R){if(R.status==="error")LP(R.reason)||Nr.error(this.ctx,`Error resolving context from ${T.id}: `,R.reason),d.push({providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:[]});else{let x=[...R.value??[]];if((R.status==="none"||R.status==="partial")&&(Nr.info(this.ctx,`Context provider ${T.id} exceeded time budget of ${A}ms`),T.resolver.resolveOnTimeout))try{let B=T.resolver.resolveOnTimeout(v);N6t(B)?x.push(...B):B&&x.push(B),x.length>0&&(R.status="partial")}catch(B){Nr.error(this.ctx,`Error in fallback logic for context provider ${T.id}: `,B)}let[P,D]=kei(x);D&&Nr.error(this.ctx,`Dropped ${D} context items from ${T.id} due to invalid schema`);let N=Pei(this.ctx,P),L={providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:N};d.push(L)}this.ctx.get(ym).getStatisticsForCompletion(r).setLastResolution(T.id,R.status)}else Nr.error(this.ctx,`Context provider ${T.id} not found in results`)}return d.sort((T,w)=>w.matchScore-T.matchScore)}async matchProviders(r,n){let o=Nei(this.ctx,n),s=o.length===1&&o[0]==="*";return await Promise.all(this._providers.map(async l=>{if(!s&&!o.includes(l.id))return[l,0];let u=await this.match(this.ctx,l.selector,r);return[l,u]}))}get matchFunction(){return this.match}},upr=class extends Em{constructor(r){super();this.delegate=r;this._cachedContextItems=new Cn(5)}static{a(this,"CachedContextProviderRegistry")}registerContextProvider(r){this.delegate.registerContextProvider(r)}unregisterContextProvider(r){this.delegate.unregisterContextProvider(r)}get providers(){return this.delegate.providers}async resolveAllProviders(r,n,o,s,c,l){let u=this._cachedContextItems.get(r);if(r&&u&&u.length>0)return u;let d=await this.delegate.resolveAllProviders(r,n,o,s,c,l);return d.length>0&&r&&this._cachedContextItems.set(r,d),d}get matchFunction(){return this.delegate.matchFunction}};function nut(t,e){return new upr(new lpr(t,e))}a(nut,"getContextProviderRegistry");function iut(t,e,r){let n=t.get(ym).getStatisticsForCompletion(e);return r.map(s=>{let{providerId:c,resolution:l,resolutionTimeMs:u,matchScore:d,data:f}=s,h=n.get(c),m=h?.usage??"none";(d<=0||l==="none"||l==="error")&&(m="none");let g={providerId:c,resolution:l,resolutionTimeMs:u,usage:m,usageDetails:h?.usageDetails,matched:d>0,numResolvedItems:f.length},A=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="full"||E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0,y=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0;return A!==void 0&&(g.numUsedItems=A),y!==void 0&&(g.numPartiallyUsedItems=y),g})}a(iut,"telemetrizeContextItems");function sut(t){return t.matchScore>0&&t.resolution!=="error"}a(sut,"matchContextItems");function Nei(t,e){let r=dpr(t,e),n=Rt(t,ze.ContextProviders)??[];if(r.length===1&&r[0]==="*"||n.length===1&&n[0]==="*")return["*"];let o=t.get(i4).getIds();return Array.from(new Set([...o,...r,...n]))}a(Nei,"getActiveContextProviders");function dpr(t,e){return KCe(t)?["*"]:t.get(Jt).contextProviders(e)}a(dpr,"getExpContextProviders");function gme(t,e){return Nei(t,e).length>0}a(gme,"useContextProviderAPI");function Rzs(t,e){let r=Rt(t,ze.ContextProviderTimeBudget);return r!==void 0&&typeof r=="number"?r:t.get(Jt).contextProviderTimeBudget(e)}a(Rzs,"getContextProviderTimeBudget");var Nb=class{constructor(e){this.ctx=e;this.scheduledResolutions=new Cn(25)}static{a(this,"ContextProviderBridge")}schedule(e,r,n,o,s,c){let l=this.ctx.get(Em),{textDocument:u,originalPosition:d,originalOffset:f,originalVersion:h,editsWithPosition:m}=e,g=l.resolveAllProviders(r,n,{uri:u.uri,languageId:u.detectedLanguageId,version:h,offset:f,position:d,proposedEdits:m.length>0?m:void 0},o,s,c?.data);this.scheduledResolutions.set(r,g)}async resolution(e){let r=this.scheduledResolutions.get(e);return r?await r:[]}};p();p();var aut=class{constructor(e,r,n){this.languageId=e;this.nodeMatch=r;this.nodeTypesWithBlockOrStmtChild=n}static{a(this,"BaseBlockParser")}async getNodeMatchAtPosition(e,r,n){let o=await xQ(this.languageId,e);try{let c=o.rootNode.descendantForIndex(r);for(;c;){let l=this.nodeMatch[c.type];if(l){if(!this.nodeTypesWithBlockOrStmtChild.has(c.type))break;let u=this.nodeTypesWithBlockOrStmtChild.get(c.type);if((u==""?c.namedChildren[0]:c.childForFieldName(u))?.type==l)break}c=c.parent}return c?n(c):void 0}finally{o.delete()}}getNextBlockAtPosition(e,r,n){return this.getNodeMatchAtPosition(e,r,o=>{let s=o.children.reverse().find(c=>c.type==this.nodeMatch[o.type]);if(s){if(this.languageId=="python"&&s.parent){let c=s.parent.type==":"?s.parent.parent:s.parent,l=c?.nextSibling;for(;l&&l.type=="comment";){let u=l.startPosition.row==s.endPosition.row&&l.startPosition.column>=s.endPosition.column,d=l.startPosition.row>c.endPosition.row&&l.startPosition.column>c.startPosition.column;if(u||d)s=l,l=l.nextSibling;else break}}if(!(s.endIndex>=s.tree.rootNode.endIndex-1&&(s.hasError||s.parent.hasError)))return n(s)}})}async isBlockBodyFinished(e,r,n){let o=(e+r).trimEnd(),s=await this.getNextBlockAtPosition(o,n,c=>c.endIndex);if(s!==void 0&&s0?c:void 0}}getNodeStart(e,r){let n=e.trimEnd();return this.getNodeMatchAtPosition(n,r,o=>o.startIndex)}},cut=class extends aut{constructor(r,n,o,s,c){super(r,s,c);this.blockEmptyMatch=n;this.lineMatch=o}static{a(this,"RegexBasedBlockParser")}isBlockStart(r){return this.lineMatch.test(r.trimStart())}async isBlockBodyEmpty(r,n){let o=await this.getNextBlockAtPosition(r,n,s=>{s.startIndex0&&/\s/.test(t.charAt(r-1));)r--;return r}a(YXn,"rewindToNearestNonWs");function zXn(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(zXn,"indent");function ZVs(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=zXn(t,r),o=zXn(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(ZVs,"outdented");var n4=class extends Wlt{constructor(r,n,o,s,c,l,u){super(r,n,o);this.startKeywords=s;this.blockNodeType=c;this.emptyStatementType=l;this.curlyBraceLanguage=u}static{a(this,"TreeSitterBasedBlockParser")}isBlockEmpty(r,n){let o=r.text.trim();return this.curlyBraceLanguage&&(o.startsWith("{")&&(o=o.slice(1)),o.endsWith("}")&&(o=o.slice(0,-1)),o=o.trim()),!!(o.length==0||this.languageId=="python"&&(r.parent?.type=="class_definition"||r.parent?.type=="function_definition")&&r.children.length==1&&Ddn(r.parent))}async isEmptyBlockStart(r,n){if(n>r.length)throw new RangeError("Invalid offset");for(let c=n;cA.type==";")&&h.endIndex<=n}h=h.parent}}let l=null,u=null,d=null,f=c;for(;f!=null;){if(f.type==this.blockNodeType){u=f;break}if(this.nodeMatch[f.type]){d=f;break}if(f.type=="ERROR"){l=f;break}f=f.parent}if(u!=null){if(!u.parent||!this.nodeMatch[u.parent.type])return!1;if(this.languageId=="python"){let h=u.previousSibling;if(h!=null&&h.hasError&&(h.text.startsWith('"""')||h.text.startsWith("'''")))return!0}return this.isBlockEmpty(u,n)}if(l!=null){if(l.previousSibling?.type=="module"||l.previousSibling?.type=="internal_module"||l.previousSibling?.type=="def")return!0;if(this.languageId==="python"&&s>=14&&l.hasError&&(l.text.startsWith('"')||l.text.startsWith("'"))){let A=l.parent?.type;if(A==="function_definition"||A==="class_definition"||A==="module")return!0}let h=[...l.children].reverse(),m=h.find(A=>this.startKeywords.includes(A.type)),g=h.find(A=>A.type==this.blockNodeType);if(m){switch(this.languageId){case"python":{m.type=="try"&&c.type=="identifier"&&c.text.length>4&&(g=h.find(E=>E.hasError)?.children.find(E=>E.type=="block"));let A,y=0;for(let E of l.children){if(E.type==":"&&y==0){A=E;break}E.type=="("&&(y+=1),E.type==")"&&(y-=1)}if(A&&m.endIndex<=A.startIndex&&A.nextSibling){if(m.type=="def"){let E=A.nextSibling;if(E.type=='"'||E.type=="'"||E.type=="ERROR"&&(E.text=='"""'||E.text=="'''"))return!0}return!1}break}case"javascript":{if(m.type==="class")if(s<=13){if(h.find(_=>_.type==="formal_parameters"))return!0}else{let E=l.children;for(let _=0;_E.type=="{");if(A&&A.startIndex>m.endIndex&&A.nextSibling!=null||h.find(E=>E.type=="do")&&m.type=="while"||m.type=="=>"&&m.nextSibling&&m.nextSibling.type!="{")return!1;break}case"typescript":{let A=h.find(E=>E.type=="{");if(A&&A.startIndex>m.endIndex&&A.nextSibling!=null||h.find(E=>E.type=="do")&&m.type=="while"||m.type=="=>"&&m.nextSibling&&m.nextSibling.type!="{")return!1;break}}return g&&g.startIndex>m.endIndex?this.isBlockEmpty(g,n):!0}}if(d!=null){let h=this.nodeMatch[d.type],m=d.children.slice().reverse().find(g=>g.type==h);if(m)return this.isBlockEmpty(m,n);if(this.nodeTypesWithBlockOrStmtChild.has(d.type)){let g=this.nodeTypesWithBlockOrStmtChild.get(d.type),A=g==""?d.children[0]:d.childForFieldName(g);if(A&&A.type!=this.blockNodeType&&A.type!=this.emptyStatementType)return!1}return!0}return!1}finally{o.delete()}}},XVs={python:new n4("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new n4("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new n4("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),tsx:new n4("typescriptreact",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new zlt("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new zlt("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map),"c-sharp":new n4("csharp",{},new Map([]),[],"block",null,!0),java:new n4("java",{},new Map([]),[],"block",null,!0),php:new n4("php",{},new Map([]),[],"block",null,!0),cpp:new n4("cpp",{},new Map([]),[],"block",null,!0)};function qfr(t){if(!kS(t))throw new Error(`Language ${t} is not supported`);return XVs[Z$e(t)]}a(qfr,"getBlockParser");async function KXn(t,e,r){return kS(t)?qfr(t).isEmptyBlockStart(e,r):!1}a(KXn,"isEmptyBlockStart");async function JXn(t,e,r,n){if(kS(t))return qfr(t).isBlockBodyFinished(e,r,n)}a(JXn,"isBlockBodyFinished");async function ZXn(t,e,r){if(kS(t))return qfr(t).getNodeStart(e,r)}a(ZXn,"getNodeStart");var T3f=new fe("parseBlock");function lNe(t,e,r){let n=e.getText(gu.range(gu.position(0,0),r)),o=e.offsetAt(r),s=e.detectedLanguageId;return c=>JXn(s,n,c,o)}a(lNe,"parsingBlockFinished");function Klt(t,e){return KXn(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(Klt,"isEmptyBlockStartUtil");async function XXn(t,e,r,n){let s=e.getText(gu.range(gu.position(0,0),r))+n,c=await ZXn(e.detectedLanguageId,s,e.offsetAt(r));if(c)return e.positionAt(c)}a(XXn,"getNodeStartUtil");var eWs=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),tWs=new RegExp(`^(${eWs.join("|")})`);function rWs(t){return tWs.test(t.trimLeft().toLowerCase())}a(rWs,"isContinuationLine");function Ylt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(Ylt,"indentationOfLine");function Jlt(t,e){let r=t.getText(),n=t.offsetAt(e);return jfr(r,n,t.detectedLanguageId)}a(Jlt,"contextIndentation");function jfr(t,e,r){let n=t.slice(0,e).split(` +`,e);return n<0&&(n=t.length),t.slice(r+1,n)}a(kzs,"getLineAtOffset");function Oei(t,e){let r=e;for(;r>0&&/\s/.test(t.charAt(r-1));)r--;return r}a(Oei,"rewindToNearestNonWs");function Mei(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(Mei,"indent");function Pzs(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=Mei(t,r),o=Mei(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(Pzs,"outdented");var o4=class extends aut{constructor(r,n,o,s,c,l,u){super(r,n,o);this.startKeywords=s;this.blockNodeType=c;this.emptyStatementType=l;this.curlyBraceLanguage=u}static{a(this,"TreeSitterBasedBlockParser")}isBlockEmpty(r,n){let o=r.text.trim();return this.curlyBraceLanguage&&(o.startsWith("{")&&(o=o.slice(1)),o.endsWith("}")&&(o=o.slice(0,-1)),o=o.trim()),!!(o.length==0||this.languageId=="python"&&(r.parent?.type=="class_definition"||r.parent?.type=="function_definition")&&r.children.length==1&&Bfn(r.parent))}async isEmptyBlockStart(r,n){if(n>r.length)throw new RangeError("Invalid offset");for(let c=n;cA.type==";")&&h.endIndex<=n}h=h.parent}}let l=null,u=null,d=null,f=c;for(;f!=null;){if(f.type==this.blockNodeType){u=f;break}if(this.nodeMatch[f.type]){d=f;break}if(f.type=="ERROR"){l=f;break}f=f.parent}if(u!=null){if(!u.parent||!this.nodeMatch[u.parent.type])return!1;if(this.languageId=="python"){let h=u.previousSibling;if(h!=null&&h.hasError&&(h.text.startsWith('"""')||h.text.startsWith("'''")))return!0}return this.isBlockEmpty(u,n)}if(l!=null){if(l.previousSibling?.type=="module"||l.previousSibling?.type=="internal_module"||l.previousSibling?.type=="def")return!0;if(this.languageId==="python"&&s>=14&&l.hasError&&(l.text.startsWith('"')||l.text.startsWith("'"))){let A=l.parent?.type;if(A==="function_definition"||A==="class_definition"||A==="module")return!0}let h=[...l.children].reverse(),m=h.find(A=>this.startKeywords.includes(A.type)),g=h.find(A=>A.type==this.blockNodeType);if(m){switch(this.languageId){case"python":{m.type=="try"&&c.type=="identifier"&&c.text.length>4&&(g=h.find(E=>E.hasError)?.children.find(E=>E.type=="block"));let A,y=0;for(let E of l.children){if(E.type==":"&&y==0){A=E;break}E.type=="("&&(y+=1),E.type==")"&&(y-=1)}if(A&&m.endIndex<=A.startIndex&&A.nextSibling){if(m.type=="def"){let E=A.nextSibling;if(E.type=='"'||E.type=="'"||E.type=="ERROR"&&(E.text=='"""'||E.text=="'''"))return!0}return!1}break}case"javascript":{if(m.type==="class")if(s<=13){if(h.find(_=>_.type==="formal_parameters"))return!0}else{let E=l.children;for(let _=0;_E.type=="{");if(A&&A.startIndex>m.endIndex&&A.nextSibling!=null||h.find(E=>E.type=="do")&&m.type=="while"||m.type=="=>"&&m.nextSibling&&m.nextSibling.type!="{")return!1;break}case"typescript":{let A=h.find(E=>E.type=="{");if(A&&A.startIndex>m.endIndex&&A.nextSibling!=null||h.find(E=>E.type=="do")&&m.type=="while"||m.type=="=>"&&m.nextSibling&&m.nextSibling.type!="{")return!1;break}}return g&&g.startIndex>m.endIndex?this.isBlockEmpty(g,n):!0}}if(d!=null){let h=this.nodeMatch[d.type],m=d.children.slice().reverse().find(g=>g.type==h);if(m)return this.isBlockEmpty(m,n);if(this.nodeTypesWithBlockOrStmtChild.has(d.type)){let g=this.nodeTypesWithBlockOrStmtChild.get(d.type),A=g==""?d.children[0]:d.childForFieldName(g);if(A&&A.type!=this.blockNodeType&&A.type!=this.emptyStatementType)return!1}return!0}return!1}finally{o.delete()}}},Dzs={python:new o4("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new o4("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new o4("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),tsx:new o4("typescriptreact",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new cut("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new cut("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map),"c-sharp":new o4("csharp",{},new Map([]),[],"block",null,!0),java:new o4("java",{},new Map([]),[],"block",null,!0),php:new o4("php",{},new Map([]),[],"block",null,!0),cpp:new o4("cpp",{},new Map([]),[],"block",null,!0)};function fpr(t){if(!OS(t))throw new Error(`Language ${t} is not supported`);return Dzs[SVe(t)]}a(fpr,"getBlockParser");async function Lei(t,e,r){return OS(t)?fpr(t).isEmptyBlockStart(e,r):!1}a(Lei,"isEmptyBlockStart");async function Bei(t,e,r,n){if(OS(t))return fpr(t).isBlockBodyFinished(e,r,n)}a(Bei,"isBlockBodyFinished");async function Fei(t,e,r){if(OS(t))return fpr(t).getNodeStart(e,r)}a(Fei,"getNodeStart");var C3f=new pe("parseBlock");function bNe(t,e,r){let n=e.getText(Au.range(Au.position(0,0),r)),o=e.offsetAt(r),s=e.detectedLanguageId;return c=>Bei(s,n,c,o)}a(bNe,"parsingBlockFinished");function uut(t,e){return Lei(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(uut,"isEmptyBlockStartUtil");async function Uei(t,e,r,n){let s=e.getText(Au.range(Au.position(0,0),r))+n,c=await Fei(e.detectedLanguageId,s,e.offsetAt(r));if(c)return e.positionAt(c)}a(Uei,"getNodeStartUtil");var Nzs=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),Mzs=new RegExp(`^(${Nzs.join("|")})`);function Ozs(t){return Mzs.test(t.trimLeft().toLowerCase())}a(Ozs,"isContinuationLine");function lut(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(lut,"indentationOfLine");function dut(t,e){let r=t.getText(),n=t.offsetAt(e);return ppr(r,n,t.detectedLanguageId)}a(dut,"contextIndentation");function ppr(t,e,r){let n=t.slice(0,e).split(` `),o=t.slice(e).split(` -`);function s(f,h,m){let g=h,A,y;for(;A===void 0&&g>=0&&g=0&&!f[g].trim().startsWith('"""');)g--;if(g>=0)for(A=void 0,g--;A===void 0&&g>=0;)A=Ylt(f[g]),y=g,g--}}return[A,y]}a(s,"seekNonBlank");let[c,l]=s(n,n.length-1,-1),u=(()=>{if(!(c===void 0||l===void 0))for(let f=l-1;f>=0;f--){let h=Ylt(n[f]);if(h!==void 0&&h=0&&g=0&&!f[g].trim().startsWith('"""');)g--;if(g>=0)for(A=void 0,g--;A===void 0&&g>=0;)A=lut(f[g]),y=g,g--}}return[A,y]}a(s,"seekNonBlank");let[c,l]=s(n,n.length-1,-1),u=(()=>{if(!(c===void 0||l===void 0))for(let f=l-1;f>=0;f--){let h=lut(n[f]);if(h!==void 0&&h{let n=iWs(r,t,e);return n==="continue"?void 0:n}}a(eei,"indentationBlockFinished");p();p();p();p();p();p();var oWs={tokenizerName:"o200k_base"};function sWs(t){return{...oWs,...t}}a(sWs,"cursorContextOptions");function uNe(t,e={}){let r=sWs(e),n=ws(r.tokenizerName);if(r.maxLineCount!==void 0&&r.maxLineCount<0)throw new Error("maxLineCount must be non-negative if defined");if(r.maxTokenLength!==void 0&&r.maxTokenLength<0)throw new Error("maxTokenLength must be non-negative if defined");if(r.maxLineCount===0||r.maxTokenLength===0)return{context:"",lineCount:0,tokenLength:0,tokenizerName:r.tokenizerName};let o=t.source.slice(0,t.offset);return r.maxLineCount!==void 0&&(o=o.split(` +`).pop(),c=0;if(o&&s?.trim()!=""&&n[0].trim()!==""&&c++,!o&&Lzs&&n[0].trim()===""&&c++,o||c++,n.length===c)return"continue";let l=Math.max(e.current,e.next??0);for(let u=c;u{let n=Bzs(r,t,e);return n==="continue"?void 0:n}}a(Qei,"indentationBlockFinished");p();p();p();p();p();p();var Fzs={tokenizerName:"o200k_base"};function Uzs(t){return{...Fzs,...t}}a(Uzs,"cursorContextOptions");function SNe(t,e={}){let r=Uzs(e),n=ws(r.tokenizerName);if(r.maxLineCount!==void 0&&r.maxLineCount<0)throw new Error("maxLineCount must be non-negative if defined");if(r.maxTokenLength!==void 0&&r.maxTokenLength<0)throw new Error("maxTokenLength must be non-negative if defined");if(r.maxLineCount===0||r.maxTokenLength===0)return{context:"",lineCount:0,tokenLength:0,tokenizerName:r.tokenizerName};let o=t.source.slice(0,t.offset);return r.maxLineCount!==void 0&&(o=o.split(` `).slice(-r.maxLineCount).join(` `)),r.maxTokenLength!==void 0&&(o=n.takeLastLinesTokens(o,r.maxTokenLength)),{context:o,lineCount:o.split(` -`).length,tokenLength:n.tokenLength(o),tokenizerName:r.tokenizerName}}a(uNe,"getCursorContext");p();p();var aWs={function:"function",snippet:"snippet",snippets:"snippets",variable:"variable",parameter:"parameter",method:"method",class:"class",module:"module",alias:"alias","enum member":"enum member",interface:"interface"};function tei(t){let e=aWs[t.semantics],r=["snippets"].includes(t.semantics)?"these":"this";return{headline:t.relativePath?`Compare ${r} ${e} from ${t.relativePath}:`:`Compare ${r} ${e}:`,snippet:t.snippet}}a(tei,"announceSnippet");var Hfr=class{constructor(e){this.keys=[];this.cache={};this.size=e}static{a(this,"FifoCache")}put(e,r){if(this.cache[e]=r,this.keys.length>this.size){this.keys.push(e);let n=this.keys.shift()??"";delete this.cache[n]}}get(e){return this.cache[e]}};var Gfr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=dWs.get(e.languageId)??uWs}tokenize(e){return new Set(cWs(e).filter(r=>!this.stopsForLanguage.has(r)))}},rei=new Hfr(20),ome=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new Gfr(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r="descending"){return r=="ascending"?e.sort((n,o)=>n.score>o.score?1:-1):r=="descending"?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r="descending"){let n=[];if(e.source.length===0||(await this.referenceTokens).size===0)return n;let o=e.source.split(` -`),s=this.id()+":"+e.source,c=rei.get(s)??[],l=c.length==0,u=l?o.map(d=>this.tokenizer.tokenize(d),this.tokenizer):[];for(let[d,[f,h]]of this.getWindowsDelineations(o).entries()){if(l){let A=new Set;u.slice(f,h).forEach(y=>y.forEach(E=>A.add(E),A)),c.push(A)}let m=c[d],g=this.similarityScore(m,await this.referenceTokens);if(n.length&&f>0&&n[n.length-1].endLine>f){n[n.length-1].scorethis.size){this.keys.push(e);let n=this.keys.shift()??"";delete this.cache[n]}}get(e){return this.cache[e]}};var mpr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=Gzs.get(e.languageId)??Hzs}tokenize(e){return new Set(qzs(e).filter(r=>!this.stopsForLanguage.has(r)))}},jei=new hpr(20),Ame=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new mpr(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r="descending"){return r=="ascending"?e.sort((n,o)=>n.score>o.score?1:-1):r=="descending"?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r="descending"){let n=[];if(e.source.length===0||(await this.referenceTokens).size===0)return n;let o=e.source.split(` +`),s=this.id()+":"+e.source,c=jei.get(s)??[],l=c.length==0,u=l?o.map(d=>this.tokenizer.tokenize(d),this.tokenizer):[];for(let[d,[f,h]]of this.getWindowsDelineations(o).entries()){if(l){let A=new Set;u.slice(f,h).forEach(y=>y.forEach(E=>A.add(E),A)),c.push(A)}let m=c[d],g=this.similarityScore(m,await this.referenceTokens);if(n.length&&f>0&&n[n.length-1].endLine>f){n[n.length-1].scoree.length>0)}a(cWs,"splitIntoWords");var lWs=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),uWs=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...lWs]),dWs=new Map([]);p();function Zlt(t,e){let r=[],n=e.length;if(n==0)return[];if(n({to:a(r=>new t(r,e),"to")}),"FACTORY")}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return Zlt(this.windowLength,e)}_getCursorContextInfo(e){return uNe(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return fWs(e,r)}};function fWs(t,e){let r=new Set;return t.forEach(n=>{e.has(n)&&r.add(n)}),r.size/(t.size+e.size-r.size)}a(fWs,"computeScore");p();var eut=class t extends ome{static{a(this,"BlockTokenSubsetMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=a(e=>({to:a(r=>new t(r,e),"to")}),"FACTORY")}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return Zlt(this.windowLength,e)}_getCursorContextInfo(e){return uNe(e,{maxLineCount:this.windowLength})}get referenceTokens(){return this.createReferenceTokensForLanguage()}async createReferenceTokensForLanguage(){return this.referenceTokensCache?this.referenceTokensCache:(this.referenceTokensCache=t.syntaxAwareSupportsLanguage(this.referenceDoc.languageId)?await this.syntaxAwareReferenceTokens():await super.referenceTokens,this.referenceTokensCache)}async syntaxAwareReferenceTokens(){let e=(await this.getEnclosingMemberStart(this.referenceDoc.source,this.referenceDoc.offset))?.startIndex,r=this.referenceDoc.offset,n=e?this.referenceDoc.source.slice(e,r):uNe(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return pWs(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await AQ(this.referenceDoc.languageId,e);let o=n.rootNode.namedDescendantForIndex(r);for(;o&&!(t.isMember(o)||t.isBlock(o));)o=o.parent??void 0;return o}finally{n?.delete()}}static isMember(e){switch(e?.type){case"method_declaration":case"property_declaration":case"field_declaration":case"constructor_declaration":return!0;default:return!1}}static isBlock(e){switch(e?.type){case"class_declaration":case"struct_declaration":case"record_declaration":case"enum_declaration":case"interface_declaration":return!0;default:return!1}}};function pWs(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(pWs,"computeScore");var hWs=0,mWs=60,gWs=4,AWs=1,yWs=20,EWs=1e4,nei={snippetLength:mWs,threshold:hWs,maxTopSnippets:gWs,maxCharPerFile:EWs,maxNumberOfFiles:yWs,maxSnippetsPerFile:AWs,useSubsetMatching:!1};var $fr={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function _Ws(t,e){return(e.useSubsetMatching?eut.FACTORY(e.snippetLength):Xlt.FACTORY(e.snippetLength)).to(t)}a(_Ws,"getMatcher");async function iei(t,e,r){let n=_Ws(t,r);return r.maxTopSnippets===0?[]:(await e.filter(s=>s.source.length0).slice(0,r.maxNumberOfFiles).reduce(async(s,c)=>(await s).concat((await n.findMatches(c,r.maxSnippetsPerFile)).map(l=>({relativePath:c.relativePath,...l}))),Promise.resolve([]))).filter(s=>s.score&&s.snippet&&s.score>r.threshold).sort((s,c)=>s.score-c.score).slice(-r.maxTopSnippets)}a(iei,"getSimilarSnippets");function oei(t,e){return{...$fr,useSubsetMatching:Vfr(t,e)}}a(oei,"getCppSimilarFilesOptions");function sei(t){return $fr.maxTopSnippets}a(sei,"getCppNumberOfSnippets");var vWs=new Map([["cpp",oei]]);function tut(t,e,r){let n=vWs.get(r);return n?n(t,e):{...nei,useSubsetMatching:Vfr(t,e)}}a(tut,"getSimilarFilesOptions");var CWs=new Map([["cpp",sei]]);function aei(t,e){let r=CWs.get(e);return r?r(t):xdn}a(aei,"getNumberOfSnippets");function Vfr(t,e){return(e.filtersAndExp.exp.variables.copilotsubsetmatching||Ft(t,Ye.UseSubsetMatching))??!1}a(Vfr,"useSubsetMatching");p();p();p();p();var bWs="content_excluded";async function rut(t,e,r,n){let o=jlt(r,"CodeSnippet");if(o.length===0)return[];let s=new Set,c=o.flatMap(f=>f.data.map(h=>(s.add(h.uri),h.additionalUris?.forEach(m=>s.add(m)),{providerId:f.providerId,data:h}))),l=t.get($r),u=new Map;await Promise.all(Array.from(s).map(async f=>{u.set(f,await l.getTextDocumentValidation({uri:f}))}));let d=t.get(pm).getStatisticsForCompletion(e);return c.filter(f=>{let m=[f.data.uri,...f.data.additionalUris??[]].every(g=>u.get(g)?.status==="valid");return m?d.addExpectations(f.providerId,[[f.data,"included"]]):d.addExpectations(f.providerId,[[f.data,bWs]]),m}).map(f=>f.data)}a(rut,"getCodeSnippetsFromContextItems");function cei(t,e){let r=t.get($r);return e.map(n=>({snippet:n,relativePath:r.getRelativePath(n)}))}a(cei,"addRelativePathToCodeSnippets");p();function Ep(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(Ep,"Text");function PH(t){return t.children}a(PH,"Chunk");p();function Kn(t,e,r){let n=[];Array.isArray(e.children)?n=e.children:e.children&&(n=[e.children]);let o={...e,children:n};return r&&(o.key=r),{type:t,props:o}}a(Kn,"functionComponentFunction");function j2(t){return{type:"f",children:t}}a(j2,"fragmentFunction");j2.isFragmentFunction=!0;var nut=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(Mb,d=>{d.codeSnippets!==r&&n(d.codeSnippets),d.document.uri!==o?.uri&&s(d.document)}),!r||r.length===0||!o)return;let c=cei(t.ctx,r),l=new Map;for(let d of c){let f=d.relativePath??d.snippet.uri,h=l.get(f);h===void 0&&(h=[],l.set(f,h)),h.push(d)}let u=[];for(let[d,f]of l.entries()){let h=f.filter(m=>m.snippet.value.length>0);h.length>0&&u.push({chunkElements:h.map(m=>m.snippet),importance:Math.max(...h.map(m=>m.snippet.importance??0)),uri:d})}if(u.length!==0)return u.sort((d,f)=>f.importance-d.importance),u.reverse(),u.map(d=>{let f=[];return f.push(Kn(Ep,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push(Kn(Ep,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&mArray.from({length:e.length}).map(()=>0));for(let n=0;n{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=Kfr(c);return Kn(j2,{children:[Kn(zX,{document:r,position:o,maxCharacters:m}),Kn(aut,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(fNe,"CurrentFile");function zX(t){if(t.document===void 0||t.position===void 0)return Kn(Ep,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),Kn(Ep,{children:e})}a(zX,"BeforeCursor");function aut(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return Kn(Ep,{});let o=t.document.getText({start:t.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}});o.length>t.maxCharacters&&(o=o.slice(0,t.maxCharacters));let s=o.replace(/^.*/,"").trimStart();if(s==="")return Kn(Ep,{});if(r===s)return Kn(Ep,{children:r});let c=s;if(r!==""){let l=ws(t.tokenizer),u=l.takeFirstTokens(s,dNe);u.tokens.length>0&&100*sut(u.tokens,l.takeFirstTokens(r,dNe).tokens)?.score<(t.suffixMatchThreshold??z$e)*u.tokens.length&&(c=r)}return c!==r&&n(c),Kn(Ep,{children:c})}a(aut,"AfterCursor");function lei(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(Mb,d=>{let f=d.document;(d.document.uri!==r?.uri||f.getText()!==r?.getText())&&n(f),d.position!==o&&s(d.position),d.maxPromptTokens!==c&&l(d.maxPromptTokens)});let u=Kfr(c);return Kn(zX,{document:r,position:o,maxCharacters:u})}a(lei,"DocumentPrefix");function uei(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(Mb,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=Kfr(c);return Kn(aut,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(uei,"DocumentSuffix");p();var cut=class{static{a(this,"WishlistElision")}elide(e,r,n,o,s){if(r<=0)throw new Error("Prefix limit must be greater than 0");let[c,l]=this.preparePrefixBlocks(e,s),{elidedSuffix:u,adjustedPrefixTokenLimit:d}=this.elideSuffix(n,o,r,l,s),f=this.elidePrefix(c,d,l,s);return{blocks:[u,...f],cycles:1}}preparePrefixBlocks(e,r){let n=0,o=new Set;return[e.map((c,l)=>{let u=0,f=c.value.split(/([^\n]*\n+)/).filter(m=>m!=="").map(m=>{let g=r.tokenLength(m);return u+=g,n+=g,{line:m,componentPath:c.componentPath,tokens:g}}),h=c.componentPath;if(o.has(h))throw new Error(`Duplicate component path in prefix blocks: ${h}`);return o.add(h),{...c,tokens:u,markedForRemoval:!1,originalIndex:l,lines:f}}),n]}elideSuffix(e,r,n,o,s){let c=e.value;if(c.length===0||r<=0)return{elidedSuffix:{...e,tokens:0,elidedValue:"",elidedTokens:0},adjustedPrefixTokenLimit:n+Math.max(0,r)};o!f.markedForRemoval).flatMap(f=>f.lines);if(c.length===0)return[];let[l,u]=this.trimPrefixLinesToFit(c,r,o),d=u;return s.map(f=>{if(f.markedForRemoval)return d+f.tokens<=r&&!f.chunks?(d+=f.tokens,{...f,elidedValue:f.value,elidedTokens:f.tokens}):{...f,elidedValue:"",elidedTokens:0};let h=l.filter(g=>g.componentPath===f.componentPath&&g.line!=="").map(g=>g.line).join(""),m=f.tokens;return h!==f.value&&(m=h!==""?o.tokenLength(h):0),{...f,elidedValue:h,elidedTokens:m}})}removeLowWeightPrefixBlocks(e,r,n){let o=n;e.sort((s,c)=>s.weight-c.weight);for(let s of e){if(o<=r)break;if(s.weight!==1&&!(s.chunks&&s.markedForRemoval))if(s.chunks&&s.chunks.size>0)for(let c of e)!c.markedForRemoval&&c.chunks&&[...s.chunks].every(l=>c.chunks?.has(l))&&(c.markedForRemoval=!0,o-=c.tokens);else s.markedForRemoval=!0,o-=s.tokens}return e.sort((s,c)=>s.originalIndex-c.originalIndex)}trimPrefixLinesToFit(e,r,n){let o=0,s=[];for(let c=e.length-1;c>=0;c--){let l=e[c],u=l.tokens;if(o+u<=r)s.unshift(l),o+=u;else break}if(s.length===0){let c=e[e.length-1];if(c&&c.line.length>0){let u=n.takeLastTokens(c.line,r);return s.push({line:u.text,componentPath:c.componentPath,tokens:u.tokens.length}),[s,u.tokens.length]}let l=`Cannot fit prefix within limit of ${r} tokens`;throw new Error(l)}return[s,o]}};function dei(t){return t.map(e=>e.elidedValue).join("")}a(dei,"makePrompt");function fei(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(fei,"makePrefixPrompt");function pei(t){if(t.length===0)return[];let e=new Map;for(let o of t)if(o.type==="context"&&o.index!==void 0){e.has(o.index)||e.set(o.index,[]);let s=o.elidedValue.trim();s.length>0&&e.get(o.index).push(s)}let r=Math.max(...Array.from(e.keys()),-1),n=[];for(let o=0;o<=r;o++){let s=e.get(o);if(s&&s.length>0){let c=s.join(` -`).trim();n.push(c)}else n.push("")}return n}a(pei,"makeContextPrompt");p();var sme=class{constructor(e,r=Jfr()){this.snapshot=e;this.transformers=r}static{a(this,"SnapshotWalker")}walkSnapshot(e){this.walkSnapshotNode(this.snapshot,void 0,e,{})}walkSnapshotNode(e,r,n,o){let s=this.transformers.reduce((l,u)=>u(e,r,l),{...o});if(n(e,r,s))for(let l of e.children??[])this.walkSnapshotNode(l,e,n,s)}};function Jfr(){return[(t,e,r)=>{r.weight===void 0&&(r.weight=1);let n=t.props?.weight??1,o=typeof n=="number"?Math.max(0,Math.min(1,n)):1;return{...r,weight:o*r.weight}},(t,e,r)=>{if(t.name===PH.name){let n=r.chunks?new Set(r.chunks):new Set;return n.add(t.path),{...r,chunks:n}}return r},(t,e,r)=>t.props?.source!==void 0?{...r,source:t.props.source}:r]}a(Jfr,"defaultTransformers");p();var Zfr={abap:{lineComment:{start:'"',end:""},markdownLanguageIds:["abap","sap-abap"]},aspdotnet:{lineComment:{start:"<%--",end:"--%>"}},bat:{lineComment:{start:"REM",end:""}},bibtex:{lineComment:{start:"%",end:""},markdownLanguageIds:["bibtex"]},blade:{lineComment:{start:"#",end:""}},BluespecSystemVerilog:{lineComment:{start:"//",end:""}},c:{lineComment:{start:"//",end:""},markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";",end:""},markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["coffeescript","coffee","cson","iced"]},cpp:{lineComment:{start:"//",end:""},markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"]},csharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["csharp","cs"]},css:{lineComment:{start:"/*",end:"*/"}},cuda:{lineComment:{start:"//",end:""}},dart:{lineComment:{start:"//",end:""}},dockerfile:{lineComment:{start:"#",end:""},markdownLanguageIds:["dockerfile","docker"]},dotenv:{lineComment:{start:"#",end:""}},elixir:{lineComment:{start:"#",end:""}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%",end:""},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"]},go:{lineComment:{start:"//",end:""},markdownLanguageIds:["go","golang"]},graphql:{lineComment:{start:"#",end:""}},groovy:{lineComment:{start:"//",end:""}},haml:{lineComment:{start:"-#",end:""}},handlebars:{lineComment:{start:"{{!",end:"}}"},markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"]},haskell:{lineComment:{start:"--",end:""},markdownLanguageIds:["haskell","hs"]},hlsl:{lineComment:{start:"//",end:""}},html:{lineComment:{start:""},markdownLanguageIds:["html","xhtml"]},ini:{lineComment:{start:";",end:""}},java:{lineComment:{start:"//",end:""},markdownLanguageIds:["java","jsp"]},javascript:{lineComment:{start:"//",end:""},markdownLanguageIds:["javascript","js"]},javascriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},jsonc:{lineComment:{start:"//",end:""}},jsx:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#",end:""},markdownLanguageIds:["julia","jl"]},kotlin:{lineComment:{start:"//",end:""},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%",end:""},markdownLanguageIds:["tex"]},legend:{lineComment:{start:"//",end:""}},less:{lineComment:{start:"//",end:""}},lua:{lineComment:{start:"--",end:""},markdownLanguageIds:["lua","pluto"]},makefile:{lineComment:{start:"#",end:""},markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:"[]: #",end:""},markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec","mm","objc","obj-c"]},"objective-cpp":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#",end:""},markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//",end:""}},powershell:{lineComment:{start:"#",end:""},markdownLanguageIds:["powershell","ps","ps1"]},pug:{lineComment:{start:"//",end:""}},python:{lineComment:{start:"#",end:""},markdownLanguageIds:["python","py","gyp"]},ql:{lineComment:{start:"//",end:""}},r:{lineComment:{start:"#",end:""}},razor:{lineComment:{start:""},markdownLanguageIds:["cshtml","razor","razor-cshtml"]},ruby:{lineComment:{start:"#",end:""},markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"]},rust:{lineComment:{start:"//",end:""},markdownLanguageIds:["rust","rs"]},sass:{lineComment:{start:"//",end:""}},scala:{lineComment:{start:"//",end:""}},scss:{lineComment:{start:"//",end:""}},shellscript:{lineComment:{start:"#",end:""},markdownLanguageIds:["bash","sh","zsh"]},slang:{lineComment:{start:"//",end:""}},slim:{lineComment:{start:"/",end:""}},solidity:{lineComment:{start:"//",end:""},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--",end:""}},stylus:{lineComment:{start:"//",end:""}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//",end:""}},systemverilog:{lineComment:{start:"//",end:""}},terraform:{lineComment:{start:"#",end:""}},tex:{lineComment:{start:"%",end:""}},typescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["typescript","ts"]},typescriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["tsx"]},vb:{lineComment:{start:"'",end:""},markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//",end:""}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//",end:""}},xml:{lineComment:{start:""}},xsl:{lineComment:{start:""}},yaml:{lineComment:{start:"#",end:""},markdownLanguageIds:["yaml","yml"]}},hei={};for(let[t,e]of Object.entries(Zfr))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)hei[r]=t;else hei[t]=t;var SWs={start:"//",end:""},TWs=["php","plaintext"],Xfr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function mei(t){return Object.values(Xfr).includes(t.trim())}a(mei,"isShebangLine");function IWs({source:t}){return t.startsWith("#!")||t.startsWith("e.length>0)}a(qzs,"splitIntoWords");var jzs=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),Hzs=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...jzs]),Gzs=new Map([]);p();function fut(t,e){let r=[],n=e.length;if(n==0)return[];if(n({to:a(r=>new t(r,e),"to")}),"FACTORY")}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return fut(this.windowLength,e)}_getCursorContextInfo(e){return SNe(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return $zs(e,r)}};function $zs(t,e){let r=new Set;return t.forEach(n=>{e.has(n)&&r.add(n)}),r.size/(t.size+e.size-r.size)}a($zs,"computeScore");p();var hut=class t extends Ame{static{a(this,"BlockTokenSubsetMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=a(e=>({to:a(r=>new t(r,e),"to")}),"FACTORY")}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return fut(this.windowLength,e)}_getCursorContextInfo(e){return SNe(e,{maxLineCount:this.windowLength})}get referenceTokens(){return this.createReferenceTokensForLanguage()}async createReferenceTokensForLanguage(){return this.referenceTokensCache?this.referenceTokensCache:(this.referenceTokensCache=t.syntaxAwareSupportsLanguage(this.referenceDoc.languageId)?await this.syntaxAwareReferenceTokens():await super.referenceTokens,this.referenceTokensCache)}async syntaxAwareReferenceTokens(){let e=(await this.getEnclosingMemberStart(this.referenceDoc.source,this.referenceDoc.offset))?.startIndex,r=this.referenceDoc.offset,n=e?this.referenceDoc.source.slice(e,r):SNe(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return Vzs(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await xQ(this.referenceDoc.languageId,e);let o=n.rootNode.namedDescendantForIndex(r);for(;o&&!(t.isMember(o)||t.isBlock(o));)o=o.parent??void 0;return o}finally{n?.delete()}}static isMember(e){switch(e?.type){case"method_declaration":case"property_declaration":case"field_declaration":case"constructor_declaration":return!0;default:return!1}}static isBlock(e){switch(e?.type){case"class_declaration":case"struct_declaration":case"record_declaration":case"enum_declaration":case"interface_declaration":return!0;default:return!1}}};function Vzs(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(Vzs,"computeScore");var Wzs=0,zzs=60,Yzs=4,Kzs=1,Jzs=20,Zzs=1e4,Hei={snippetLength:zzs,threshold:Wzs,maxTopSnippets:Yzs,maxCharPerFile:Zzs,maxNumberOfFiles:Jzs,maxSnippetsPerFile:Kzs,useSubsetMatching:!1};var gpr={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function Xzs(t,e){return(e.useSubsetMatching?hut.FACTORY(e.snippetLength):put.FACTORY(e.snippetLength)).to(t)}a(Xzs,"getMatcher");async function Gei(t,e,r){let n=Xzs(t,r);return r.maxTopSnippets===0?[]:(await e.filter(s=>s.source.length0).slice(0,r.maxNumberOfFiles).reduce(async(s,c)=>(await s).concat((await n.findMatches(c,r.maxSnippetsPerFile)).map(l=>({relativePath:c.relativePath,...l}))),Promise.resolve([]))).filter(s=>s.score&&s.snippet&&s.score>r.threshold).sort((s,c)=>s.score-c.score).slice(-r.maxTopSnippets)}a(Gei,"getSimilarSnippets");function $ei(t,e){return{...gpr,useSubsetMatching:Apr(t,e)}}a($ei,"getCppSimilarFilesOptions");function Vei(t){return gpr.maxTopSnippets}a(Vei,"getCppNumberOfSnippets");var eYs=new Map([["cpp",$ei]]);function mut(t,e,r){let n=eYs.get(r);return n?n(t,e):{...Hei,useSubsetMatching:Apr(t,e)}}a(mut,"getSimilarFilesOptions");var tYs=new Map([["cpp",Vei]]);function Wei(t,e){let r=tYs.get(e);return r?r(t):Nfn}a(Wei,"getNumberOfSnippets");function Apr(t,e){return(e.filtersAndExp.exp.variables.copilotsubsetmatching||Rt(t,ze.UseSubsetMatching))??!1}a(Apr,"useSubsetMatching");p();p();p();p();var rYs="content_excluded";async function gut(t,e,r,n){let o=tut(r,"CodeSnippet");if(o.length===0)return[];let s=new Set,c=o.flatMap(f=>f.data.map(h=>(s.add(h.uri),h.additionalUris?.forEach(m=>s.add(m)),{providerId:f.providerId,data:h}))),l=t.get($r),u=new Map;await Promise.all(Array.from(s).map(async f=>{u.set(f,await l.getTextDocumentValidation({uri:f}))}));let d=t.get(ym).getStatisticsForCompletion(e);return c.filter(f=>{let m=[f.data.uri,...f.data.additionalUris??[]].every(g=>u.get(g)?.status==="valid");return m?d.addExpectations(f.providerId,[[f.data,"included"]]):d.addExpectations(f.providerId,[[f.data,rYs]]),m}).map(f=>f.data)}a(gut,"getCodeSnippetsFromContextItems");function zei(t,e){let r=t.get($r);return e.map(n=>({snippet:n,relativePath:r.getRelativePath(n)}))}a(zei,"addRelativePathToCodeSnippets");p();function Cp(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(Cp,"Text");function jH(t){return t.children}a(jH,"Chunk");p();function zn(t,e,r){let n=[];Array.isArray(e.children)?n=e.children:e.children&&(n=[e.children]);let o={...e,children:n};return r&&(o.key=r),{type:t,props:o}}a(zn,"functionComponentFunction");function K2(t){return{type:"f",children:t}}a(K2,"fragmentFunction");K2.isFragmentFunction=!0;var Aut=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(Mb,d=>{d.codeSnippets!==r&&n(d.codeSnippets),d.document.uri!==o?.uri&&s(d.document)}),!r||r.length===0||!o)return;let c=zei(t.ctx,r),l=new Map;for(let d of c){let f=d.relativePath??d.snippet.uri,h=l.get(f);h===void 0&&(h=[],l.set(f,h)),h.push(d)}let u=[];for(let[d,f]of l.entries()){let h=f.filter(m=>m.snippet.value.length>0);h.length>0&&u.push({chunkElements:h.map(m=>m.snippet),importance:Math.max(...h.map(m=>m.snippet.importance??0)),uri:d})}if(u.length!==0)return u.sort((d,f)=>f.importance-d.importance),u.reverse(),u.map(d=>{let f=[];return f.push(zn(Cp,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push(zn(Cp,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&mArray.from({length:e.length}).map(()=>0));for(let n=0;n{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=vpr(c);return zn(K2,{children:[zn(ZX,{document:r,position:o,maxCharacters:m}),zn(_ut,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(INe,"CurrentFile");function ZX(t){if(t.document===void 0||t.position===void 0)return zn(Cp,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),zn(Cp,{children:e})}a(ZX,"BeforeCursor");function _ut(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return zn(Cp,{});let o=t.document.getText({start:t.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}});o.length>t.maxCharacters&&(o=o.slice(0,t.maxCharacters));let s=o.replace(/^.*/,"").trimStart();if(s==="")return zn(Cp,{});if(r===s)return zn(Cp,{children:r});let c=s;if(r!==""){let l=ws(t.tokenizer),u=l.takeFirstTokens(s,TNe);u.tokens.length>0&&100*Eut(u.tokens,l.takeFirstTokens(r,TNe).tokens)?.score<(t.suffixMatchThreshold??_Ve)*u.tokens.length&&(c=r)}return c!==r&&n(c),zn(Cp,{children:c})}a(_ut,"AfterCursor");function Yei(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(Mb,d=>{let f=d.document;(d.document.uri!==r?.uri||f.getText()!==r?.getText())&&n(f),d.position!==o&&s(d.position),d.maxPromptTokens!==c&&l(d.maxPromptTokens)});let u=vpr(c);return zn(ZX,{document:r,position:o,maxCharacters:u})}a(Yei,"DocumentPrefix");function Kei(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(Mb,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=vpr(c);return zn(_ut,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(Kei,"DocumentSuffix");p();var vut=class{static{a(this,"WishlistElision")}elide(e,r,n,o,s){if(r<=0)throw new Error("Prefix limit must be greater than 0");let[c,l]=this.preparePrefixBlocks(e,s),{elidedSuffix:u,adjustedPrefixTokenLimit:d}=this.elideSuffix(n,o,r,l,s),f=this.elidePrefix(c,d,l,s);return{blocks:[u,...f],cycles:1}}preparePrefixBlocks(e,r){let n=0,o=new Set;return[e.map((c,l)=>{let u=0,f=c.value.split(/([^\n]*\n+)/).filter(m=>m!=="").map(m=>{let g=r.tokenLength(m);return u+=g,n+=g,{line:m,componentPath:c.componentPath,tokens:g}}),h=c.componentPath;if(o.has(h))throw new Error(`Duplicate component path in prefix blocks: ${h}`);return o.add(h),{...c,tokens:u,markedForRemoval:!1,originalIndex:l,lines:f}}),n]}elideSuffix(e,r,n,o,s){let c=e.value;if(c.length===0||r<=0)return{elidedSuffix:{...e,tokens:0,elidedValue:"",elidedTokens:0},adjustedPrefixTokenLimit:n+Math.max(0,r)};o!f.markedForRemoval).flatMap(f=>f.lines);if(c.length===0)return[];let[l,u]=this.trimPrefixLinesToFit(c,r,o),d=u;return s.map(f=>{if(f.markedForRemoval)return d+f.tokens<=r&&!f.chunks?(d+=f.tokens,{...f,elidedValue:f.value,elidedTokens:f.tokens}):{...f,elidedValue:"",elidedTokens:0};let h=l.filter(g=>g.componentPath===f.componentPath&&g.line!=="").map(g=>g.line).join(""),m=f.tokens;return h!==f.value&&(m=h!==""?o.tokenLength(h):0),{...f,elidedValue:h,elidedTokens:m}})}removeLowWeightPrefixBlocks(e,r,n){let o=n;e.sort((s,c)=>s.weight-c.weight);for(let s of e){if(o<=r)break;if(s.weight!==1&&!(s.chunks&&s.markedForRemoval))if(s.chunks&&s.chunks.size>0)for(let c of e)!c.markedForRemoval&&c.chunks&&[...s.chunks].every(l=>c.chunks?.has(l))&&(c.markedForRemoval=!0,o-=c.tokens);else s.markedForRemoval=!0,o-=s.tokens}return e.sort((s,c)=>s.originalIndex-c.originalIndex)}trimPrefixLinesToFit(e,r,n){let o=0,s=[];for(let c=e.length-1;c>=0;c--){let l=e[c],u=l.tokens;if(o+u<=r)s.unshift(l),o+=u;else break}if(s.length===0){let c=e[e.length-1];if(c&&c.line.length>0){let u=n.takeLastTokens(c.line,r);return s.push({line:u.text,componentPath:c.componentPath,tokens:u.tokens.length}),[s,u.tokens.length]}let l=`Cannot fit prefix within limit of ${r} tokens`;throw new Error(l)}return[s,o]}};function Jei(t){return t.map(e=>e.elidedValue).join("")}a(Jei,"makePrompt");function Zei(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(Zei,"makePrefixPrompt");function Xei(t){if(t.length===0)return[];let e=new Map;for(let o of t)if(o.type==="context"&&o.index!==void 0){e.has(o.index)||e.set(o.index,[]);let s=o.elidedValue.trim();s.length>0&&e.get(o.index).push(s)}let r=Math.max(...Array.from(e.keys()),-1),n=[];for(let o=0;o<=r;o++){let s=e.get(o);if(s&&s.length>0){let c=s.join(` +`).trim();n.push(c)}else n.push("")}return n}a(Xei,"makeContextPrompt");p();var yme=class{constructor(e,r=Cpr()){this.snapshot=e;this.transformers=r}static{a(this,"SnapshotWalker")}walkSnapshot(e){this.walkSnapshotNode(this.snapshot,void 0,e,{})}walkSnapshotNode(e,r,n,o){let s=this.transformers.reduce((l,u)=>u(e,r,l),{...o});if(n(e,r,s))for(let l of e.children??[])this.walkSnapshotNode(l,e,n,s)}};function Cpr(){return[(t,e,r)=>{r.weight===void 0&&(r.weight=1);let n=t.props?.weight??1,o=typeof n=="number"?Math.max(0,Math.min(1,n)):1;return{...r,weight:o*r.weight}},(t,e,r)=>{if(t.name===jH.name){let n=r.chunks?new Set(r.chunks):new Set;return n.add(t.path),{...r,chunks:n}}return r},(t,e,r)=>t.props?.source!==void 0?{...r,source:t.props.source}:r]}a(Cpr,"defaultTransformers");p();var bpr={abap:{lineComment:{start:'"',end:""},markdownLanguageIds:["abap","sap-abap"]},aspdotnet:{lineComment:{start:"<%--",end:"--%>"}},bat:{lineComment:{start:"REM",end:""}},bibtex:{lineComment:{start:"%",end:""},markdownLanguageIds:["bibtex"]},blade:{lineComment:{start:"#",end:""}},BluespecSystemVerilog:{lineComment:{start:"//",end:""}},c:{lineComment:{start:"//",end:""},markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";",end:""},markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["coffeescript","coffee","cson","iced"]},cpp:{lineComment:{start:"//",end:""},markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"]},csharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["csharp","cs"]},css:{lineComment:{start:"/*",end:"*/"}},cuda:{lineComment:{start:"//",end:""}},dart:{lineComment:{start:"//",end:""}},dockerfile:{lineComment:{start:"#",end:""},markdownLanguageIds:["dockerfile","docker"]},dotenv:{lineComment:{start:"#",end:""}},elixir:{lineComment:{start:"#",end:""}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%",end:""},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"]},go:{lineComment:{start:"//",end:""},markdownLanguageIds:["go","golang"]},graphql:{lineComment:{start:"#",end:""}},groovy:{lineComment:{start:"//",end:""}},haml:{lineComment:{start:"-#",end:""}},handlebars:{lineComment:{start:"{{!",end:"}}"},markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"]},haskell:{lineComment:{start:"--",end:""},markdownLanguageIds:["haskell","hs"]},hlsl:{lineComment:{start:"//",end:""}},html:{lineComment:{start:""},markdownLanguageIds:["html","xhtml"]},ini:{lineComment:{start:";",end:""}},java:{lineComment:{start:"//",end:""},markdownLanguageIds:["java","jsp"]},javascript:{lineComment:{start:"//",end:""},markdownLanguageIds:["javascript","js"]},javascriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},jsonc:{lineComment:{start:"//",end:""}},jsx:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#",end:""},markdownLanguageIds:["julia","jl"]},kotlin:{lineComment:{start:"//",end:""},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%",end:""},markdownLanguageIds:["tex"]},legend:{lineComment:{start:"//",end:""}},less:{lineComment:{start:"//",end:""}},lua:{lineComment:{start:"--",end:""},markdownLanguageIds:["lua","pluto"]},makefile:{lineComment:{start:"#",end:""},markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:"[]: #",end:""},markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec","mm","objc","obj-c"]},"objective-cpp":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#",end:""},markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//",end:""}},powershell:{lineComment:{start:"#",end:""},markdownLanguageIds:["powershell","ps","ps1"]},pug:{lineComment:{start:"//",end:""}},python:{lineComment:{start:"#",end:""},markdownLanguageIds:["python","py","gyp"]},ql:{lineComment:{start:"//",end:""}},r:{lineComment:{start:"#",end:""}},razor:{lineComment:{start:""},markdownLanguageIds:["cshtml","razor","razor-cshtml"]},ruby:{lineComment:{start:"#",end:""},markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"]},rust:{lineComment:{start:"//",end:""},markdownLanguageIds:["rust","rs"]},sass:{lineComment:{start:"//",end:""}},scala:{lineComment:{start:"//",end:""}},scss:{lineComment:{start:"//",end:""}},shellscript:{lineComment:{start:"#",end:""},markdownLanguageIds:["bash","sh","zsh"]},slang:{lineComment:{start:"//",end:""}},slim:{lineComment:{start:"/",end:""}},solidity:{lineComment:{start:"//",end:""},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--",end:""}},stylus:{lineComment:{start:"//",end:""}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//",end:""}},systemverilog:{lineComment:{start:"//",end:""}},terraform:{lineComment:{start:"#",end:""}},tex:{lineComment:{start:"%",end:""}},typescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["typescript","ts"]},typescriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["tsx"]},vb:{lineComment:{start:"'",end:""},markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//",end:""}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//",end:""}},xml:{lineComment:{start:""}},xsl:{lineComment:{start:""}},yaml:{lineComment:{start:"#",end:""},markdownLanguageIds:["yaml","yml"]}},eti={};for(let[t,e]of Object.entries(bpr))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)eti[r]=t;else eti[t]=t;var nYs={start:"//",end:""},iYs=["php","plaintext"],Spr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function tti(t){return Object.values(Spr).includes(t.trim())}a(tti,"isShebangLine");function oYs({source:t}){return t.startsWith("#!")||t.startsWith("xWs(s,e)).join(` +`).map(s=>sYs(s,e)).join(` `);return r?o+` -`:o}a(i4,"commentBlockAsSingles");function lut(t){let{languageId:e}=t;return TWs.indexOf(e)===-1&&!IWs(t)?e in Xfr?Xfr[e]:`Language: ${e}`:""}a(lut,"getLanguageMarker");function uut(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(uut,"getPathMarker");function pNe(t){return t===""||t.endsWith(` +`:o}a(s4,"commentBlockAsSingles");function Cut(t){let{languageId:e}=t;return iYs.indexOf(e)===-1&&!oYs(t)?e in Spr?Spr[e]:`Language: ${e}`:""}a(Cut,"getLanguageMarker");function but(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(but,"getPathMarker");function xNe(t){return t===""||t.endsWith(` `)?t:t+` -`}a(pNe,"newLineEnded");var wWs=5,ame=class{constructor(){this.renderId=0;this.formatPrefix=dei}static{a(this,"CompletionsPromptRenderer")}render(e,r,n){let o=this.renderId++,s=performance.now();try{if(n?.isCancellationRequested)return{status:"cancelled"};let c=r.delimiter??"",l=r.tokenizer??"o200k_base",{prefixBlocks:u,suffixBlock:d,componentStatistics:f}=this.processSnapshot(e,c,r.languageId),{prefixTokenLimit:h,suffixTokenLimit:m}=this.getPromptLimits(d,r),g=performance.now(),A=new cut,{blocks:[y,...E]}=A.elide(u,h,d,m,ws(l)),_=performance.now(),v=this.formatPrefix(E),b=this.formatContext?this.formatContext(E):void 0,T=y.elidedValue,w=E.reduce((R,x)=>R+x.elidedTokens,0);return f.push(...RWs([...E,y])),{prefix:v,prefixTokens:w,suffix:T,suffixTokens:y.elidedTokens,context:b,status:"ok",metadata:{renderId:o,rendererName:"c",tokenizer:l,elisionTimeMs:_-g,renderTimeMs:performance.now()-s,componentStatistics:f,updateDataTimeMs:f.reduce((R,x)=>R+(x.updateDataTimeMs??0),0)}}}catch(c){return{status:"error",error:c}}}getPromptLimits(e,r){let n=e?.value??"",o=r.promptTokenLimit,s=r.suffixPercent;if(n.length==0||s==0)return{prefixTokenLimit:o,suffixTokenLimit:0};o=n.length>0?o-wWs:o;let c=Math.ceil(o*(s/100));return{prefixTokenLimit:o-c,suffixTokenLimit:c}}processSnapshot(e,r,n){let o=[],s=[],c=[],l=!1;if(new sme(e,epr).walkSnapshot((f,h,m)=>{if(f===e||(f.name===fNe.name&&(l=!0),f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.value===void 0||f.value===""))return!0;let g=m.chunks;if(m.type==="suffix")s.push({value:hNe(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let A=f.value.endsWith(r)?f.value:f.value+r,y=A;m.type==="prefix"?y=f.value:mei(f.value)?y=A:y=i4(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:hNe(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${fNe.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}},epr=[...Jfr(),(t,e,r)=>iut(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===zX.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===aut.name?{...r,type:"suffix"}:r];function RWs(t){return t.map(e=>{let r={componentPath:e.componentPath};return e.tokens!==0&&(r.expectedTokens=e.tokens,r.actualTokens=e.elidedTokens),e.nodeStatistics.updateDataTimeMs!==void 0&&(r.updateDataTimeMs=e.nodeStatistics.updateDataTimeMs),e.source&&(r.source=e.source),r})}a(RWs,"computeComponentStatistics");function hNe(t){return t.replace(/\r\n?/g,` -`)}a(hNe,"normalizeLineEndings");p();var dut=a((t,e)=>{let[r,n]=e.useState();if(e.useData(Mb,o=>{o.document.uri!==r?.uri&&n(o.document)}),r){let o=t.ctx.get($r),s=o.getRelativePath(r),c={uri:r.uri,source:r.getText(),relativePath:s,languageId:r.detectedLanguageId},l=o.findNotebook(r);return c.relativePath&&!l?Kn(kWs,{docInfo:c}):Kn(PWs,{docInfo:c})}},"DocumentMarker"),kWs=a(t=>Kn(Ep,{children:uut(t.docInfo)}),"PathMarker"),PWs=a(t=>Kn(Ep,{children:lut(t.docInfo)}),"LanguageMarker");p();p();p();var PKs=de(cee()),DKs=de(h4()),sri=de(Ro()),NKs=de(Dut());var m4=class extends sri.Disposable{static{a(this,"RecentEditsProvider")}};function MKs(t,e=!1,r=void 0,n){if(e&&(r===void 0||n===void 0))throw new Error("cursorLine and activeDocDistanceLimitFromCursor are required when filterByCursorLine is true");let o=t.startLine-1,s=t.endLine-1;return!!(e&&(Math.abs(o-r)<=n||Math.abs(s-r)<=n))}a(MKs,"editIsTooCloseToCursor");var odt=a((t,e)=>{let[r,n]=e.useState();return e.useData(Mb,async o=>{if(!o.document)return;let s=t.ctx.get(m4);if(s.isEnabled())s.start();else return;let c=s.config,l=s.getRecentEdits(),u=new Set,d=t.ctx.get($r),f=[];for(let m=l.length-1;m>=0&&!(f.length>=c.maxEdits);m--){let g=l[m];if(!await d.getTextDocument({uri:g.file}))continue;let A=!u.has(g.file);if(u.size+(A?1:0)>c.maxFiles)break;let E=g.file===o.document?.uri,_=E?o.position.line:void 0;if(MKs(g,E,_,c.activeDocDistanceLimitFromCursor))continue;let b=s.getEditSummary(g);if(b){u.add(g.file);let T=d.getRelativePath({uri:g.file});f.unshift(pNe(`File: ${T}`)+pNe(b))}}if(f.length===0){n(void 0);return}let h=pNe("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+pNe("End of recent edits");n(h)}),r?Kn(PH,{children:Kn(Ep,{children:r})}):void 0},"RecentEdits");p();p();p();var sdt=class{constructor(e){this.docManager=e}static{a(this,"OpenTabFiles")}truncateDocs(e,r,n,o){let s=new Map,c=0;for(let l of e)if(!(c+l.getText().length>uee.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&adt(n,l.detectedLanguageId)&&(s.set(l.uri.toString(),{uri:l.uri.toString(),relativePath:this.docManager.getRelativePath(l),source:l.getText()}),c+=l.getText().length),s.size>=o))break;return s}async getNeighborFiles(e,r,n){let o=new Map,s=new Map;return o=this.truncateDocs(CXn(await this.docManager.textDocuments()),e,r,n),s.set("opentabs",Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};p();p();function ari(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(ari,"shortCircuit");p();function LKs(...t){return JSON.stringify(t,(e,r)=>typeof r=="object"?r:String(r))}a(LKs,"defaultHash");function nhr(t,e={}){let{hash:r=LKs,cache:n=new Map}=e;return function(...o){let s=r.apply(this,o);if(n.has(s))return n.get(s);let c=t.apply(this,o);return c instanceof Promise&&(c=c.catch(l=>{throw n.delete(s),l})),n.set(s,c),c}}a(nhr,"memoize");var cri={entries:[],traits:[]},cdt={entries:new Map,traits:[]},ihr=class extends Cn{constructor(r,n=120*1e3){super(r);this.defaultEvictionTimeMs=n;this._cacheTimestamps=new Map}static{a(this,"PromiseExpirationCacheMap")}bumpRetryCount(r){let n=this._cacheTimestamps.get(r);return n?++n.retryCount:(this._cacheTimestamps.set(r,{timestamp:Date.now(),retryCount:0}),0)}has(r){return this.isValid(r)?super.has(r):(this.deleteExpiredEntry(r),!1)}get(r){let n=super.get(r);if(this.isValid(r))return n;this.deleteExpiredEntry(r)}set(r,n){let o=super.set(r,n);return this.isValid(r)||this._cacheTimestamps.set(r,{timestamp:Date.now(),retryCount:0}),o}clear(){super.clear(),this._cacheTimestamps.clear()}isValid(r){let n=this._cacheTimestamps.get(r);return n!==void 0&&Date.now()-n.timestamp=FKs?c=cdt:c=void 0);let l=performance.now()-s;if(v0.debug(t,c!==void 0?`Fetched ${[...c.entries.values()].map(u=>u.size).reduce((u,d)=>u+d,0)} related files for '${e.uri}' in ${l}ms.`:`Failing fetching files for '${e.uri}' in ${l}ms.`),c===void 0)throw new ldt;return c}a(uri,"getRelatedFiles");var ohr=nhr(uri,{cache:lri,hash:a((t,e,r,n,o)=>`${e.uri}`,"hash")});ohr=ari(ohr,200,cdt);async function udt(t,e,r,n,o,s=!1){let c=t.get(dee),l=cdt;try{let u={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};l=s?await uri(t,u,r,n,c):await ohr(t,u,r,n,c)}catch(u){l=cdt,u instanceof ldt&&Et(t,"getRelatedFilesList",r)}return v0.debug(t,l!=null?`Fetched following traits ${l.traits.map(u=>`{${u.name} : ${u.value}}`).join("")} for '${e.uri}'`:`Failing fecthing traits for '${e.uri}'.`),l}a(udt,"getRelatedFilesAndTraits");function adt(t,e){return JTe(t)===JTe(e)}a(adt,"considerNeighborFile");var uee=class t{static{a(this,"NeighborSource")}static{this.MAX_NEIGHBOR_AGGREGATE_LENGTH=2e5}static{this.MAX_NEIGHBOR_FILES=20}static{this.EXCLUDED_NEIGHBORS=["node_modules","dist","site-packages"]}static defaultEmptyResult(){return{docs:new Map,neighborSource:new Map,traits:[]}}static reset(){t.instance=void 0}static async getNeighborFilesAndTraits(e,r,n,o,s,c,l){let u=e.get($r);t.instance===void 0&&(t.instance=new sdt(u));let d={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(UKs(e,o))return d;let f=await u.getTextDocument({uri:r});if(!f)return v0.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: failed to get the document ${r}`),d;let h=u.getWorkspaceFolder(f);if(!h)return v0.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),d;let m=await udt(e,f,o,s,c,l);return m.entries.size===0?(v0.debug(e,"neighborFiles.getNeighborFilesAndTraits",`0 related files found for ${r}`),d.traits.push(...m.traits),d):(m.entries.forEach((g,A)=>{let y=[];g.forEach((E,_)=>{let v=t.getRelativePath(_,h.uri);if(!v||d.docs.has(_))return;let b={relativePath:v,uri:_,source:E};y.unshift(b),d.docs.set(_,b)}),y.length>0&&d.neighborSource.set(A,y.map(E=>E.uri.toString()))}),d.traits.push(...m.traits),d)}static basename(e){return decodeURIComponent(e.replace(/[#?].*$/,"").replace(/^.*[/:]/,""))}static getRelativePath(e,r){let n=r.toString().replace(/[#?].*/,"").replace(/\/?$/,"/");return e.toString().startsWith(n)?e.toString().slice(n.length):t.basename(e)}};function UKs(t,e){return t.get(Zt).excludeRelatedFiles(e)||Ft(t,Ye.ExcludeRelatedFiles)}a(UKs,"isExcludeRelatedFilesActive");function dri(t,e){return t.get(Zt).includeNeighboringFiles(e)||Ft(t,Ye.IncludeNeighboringFiles)}a(dri,"isIncludeNeighborFilesActive");var ddt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(Mb,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=uee.defaultEmptyResult();u.turnOffSimilarFiles||(d=await uee.getNeighborFilesAndTraits(t.ctx,u.document.uri,u.document.detectedLanguageId,u.telemetryData,u.cancellationToken,u.data));let f=await c(u.telemetryData,u.document,u,d);s(f)});async function c(u,d,f,h){let m=xme(t.ctx,u,d.detectedLanguageId);return(await l(m,u,d,f,h)).filter(A=>A.snippet.length>0).sort((A,y)=>A.score-y.score).map(A=>({...tei(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||tut(t.ctx,d,f.detectedLanguageId),y=t.ctx.get($r).getRelativePath(f),E={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await iei(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),Kn(j2,{children:[...o.map((u,d)=>Kn(QKs,{snippet:u}))]})},"SimilarFiles"),QKs=a((t,e)=>Kn(PH,{children:[Kn(Ep,{children:t.snippet.headline}),Kn(Ep,{children:t.snippet.snippet})]}),"SimilarFile");p();p();var fdt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(Mb,c=>{c.traits!==r&&n(c.traits);let l=JTe(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return Kn(j2,{children:[Kn(Ep,{children:`Consider this related information: -`}),...r.map(c=>Kn(Ep,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");function fri(t,e){return Ft(t,Ye.UseSplitContextPrompt)??t.get(Zt).enablePromptContextProxyField(e)}a(fri,"shouldUseSplitContextPrompt");function pri(t){return Kn(j2,{children:[Kn(zfr,{children:[Kn(dut,{ctx:t,weight:.7}),Kn(fdt,{weight:.6}),Kn(nut,{ctx:t,weight:.9}),Kn(ddt,{ctx:t,weight:.8})]}),Kn(uei,{weight:1}),Kn(Yfr,{children:Kn(odt,{ctx:t,weight:.99})}),Kn(lei,{weight:1})]})}a(pri,"splitContextCompletionsPrompt");p();var hri=0;function qKs(){hri=0}a(qKs,"resetContextIndex");function jKs(){return hri++}a(jKs,"getNextContextIndex");var pdt=class extends ame{constructor(){super(...arguments);this.formatPrefix=fei;this.formatContext=pei}static{a(this,"SplitContextPromptRenderer")}processSnapshot(r,n){let o=[],s=[],c=[],l=!1;if(qKs(),new sme(r,HKs).walkSnapshot((f,h,m)=>{if(f===r||(f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.name===zX.name&&(l=!0),f.value===void 0||f.value===""))return!0;let g=m.chunks,A=m.type;if(A==="suffix")s.push({value:hNe(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let y=A==="prefix",E=y||f.value.endsWith(n)?f.value:f.value+n;o.push({type:y?"prefix":"context",value:hNe(E),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source,index:y?void 0:m.index})}return!0}),!l)throw new Error(`Node of type ${zX.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}},HKs=[...epr,(t,e,r)=>iut(t)?{...r,index:jKs()}:r];p();function hdt(t,e,r){let n=jlt(r,"Trait");for(let s of n)GKs(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(hdt,"getTraitsFromContextItems");function GKs(t,e,r,n){let o=t.get(pm).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(GKs,"setupExpectationsForTraits");var $Ks=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function mdt(t,e,r,n,o,s){if(r.length>0){let c={};c.detectedLanguageId=n,c.languageId=o;for(let u of r){let d=$Ks.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return Et(e,t,l)}}a(mdt,"ReportTraitsTelemetry");p();p();p();var gdt=class{constructor(e){this.states=e;this.currentIndex=0;this.stateChanged=!1}static{a(this,"UseState")}useState(e){let r=this.currentIndex;if(this.states[r]===void 0){let o=typeof e=="function"?e():e;this.states[r]=o}let n=a(o=>{let s=typeof o=="function"?o(this.states[r]):o;this.states[r]=s,this.stateChanged=!0},"setState");return this.currentIndex++,[this.states[r],n]}hasChanged(){return this.stateChanged}},Adt=class{constructor(e){this.measureUpdateTime=e;this.consumers=[]}static{a(this,"UseData")}useData(e,r){this.consumers.push(n=>{if(e(n))return r(n)})}async updateData(e){if(this.consumers.length>0){let r=performance.now();for(let n of this.consumers)await n(e);this.measureUpdateTime(performance.now()-r)}}};var ydt=class{constructor(e){this.lifecycleData=new Map;this.vTree=this.virtualizeElement(e,"$",0)}static{a(this,"VirtualPromptReconciler")}reconcile(e){if(!this.vTree)throw new Error("No tree to reconcile, make sure to pass a valid prompt");return e?.isCancellationRequested?this.vTree:(this.vTree=this.reconcileNode(this.vTree,"$",0,e),this.vTree)}reconcileNode(e,r,n,o){if(!e.children&&!e.lifecycle)return e;let s=e;if(e.lifecycle?.isRemountRequired()){let l=this.collectChildPaths(e);s=this.virtualizeElement(e.component,r,n);let u=this.collectChildPaths(s);this.cleanupState(l,u)}else if(e.children){let l=[];for(let u=0;u"u")){if(typeof e=="string"||typeof e=="number")return{name:typeof e,path:`${r}[${n}]`,props:{value:e},component:e};if(VKs(e.type)){let o=e.type(e.props.children),s=r!=="$"?`[${n}]`:"",c=`${r}${s}.${o.type}`,l=o.children.map((u,d)=>this.virtualizeElement(u,c,d));return this.ensureUniqueKeys(l),{name:o.type,path:c,children:l.flat().filter(u=>u!==void 0),component:e}}return this.virtualizeFunctionComponent(r,n,e,e.type)}}virtualizeFunctionComponent(e,r,n,o){let s=n.props.key?`["${n.props.key}"]`:`[${r}]`,c=`${e}${s}.${o.name}`,l=new ahr(this.getOrCreateLifecycleData(c)),u=o(n.props,l),h=(Array.isArray(u)?u:[u]).map((m,g)=>this.virtualizeElement(m,c,g)).flat().filter(m=>m!==void 0);return this.ensureUniqueKeys(h),{name:o.name,path:c,props:n.props,children:h,component:n,lifecycle:l}}ensureUniqueKeys(e){let r=new Map;for(let o of e){if(!o)continue;let s=o.props?.key;s&&r.set(s,(r.get(s)||0)+1)}let n=Array.from(r.entries()).filter(([o,s])=>s>1).map(([o])=>o);if(n.length>0)throw new Error(`Duplicate keys found: ${n.join(", ")}`)}collectChildPaths(e){let r=[];if(e?.children)for(let n of e.children)n&&(r.push(n.path),r.push(...this.collectChildPaths(n)));return r}cleanupState(e,r){for(let n of e)r.includes(n)||this.lifecycleData.delete(n)}getOrCreateLifecycleData(e){return this.lifecycleData.has(e)||this.lifecycleData.set(e,new shr([])),this.lifecycleData.get(e)}createPipe(){return{pump:a(async e=>{await this.pumpData(e)},"pump")}}async pumpData(e){if(!this.vTree)throw new Error("No tree to pump data into. Pumping data before initializing?");await this.recursivelyPumpData(e,this.vTree)}async recursivelyPumpData(e,r){if(!r)throw new Error("Can't pump data into undefined node.");await r.lifecycle?.dataHook.updateData(e);for(let n of r.children||[])await this.recursivelyPumpData(e,n)}},shr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},ahr=class{constructor(e){this.lifecycleData=e;this.stateHook=new gdt(e.state),this.dataHook=new Adt(r=>{e._updateTimeMs=r})}static{a(this,"PromptElementLifecycle")}useState(e){return this.stateHook.useState(e)}useData(e,r){this.dataHook.useData(e,r)}isRemountRequired(){return this.stateHook.hasChanged()}};function VKs(t){return typeof t=="function"&&"isFragmentFunction"in t}a(VKs,"isFragmentFunction");var NNe=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new ydt(e)}snapshotNode(e,r){if(!e)return;if(r?.isCancellationRequested)return"cancelled";let n=[];for(let o of e.children??[]){let s=this.snapshotNode(o,r);if(s==="cancelled")return"cancelled";s!==void 0&&n.push(s)}return{value:e.props?.value?.toString(),name:e.name,path:e.path,props:e.props,children:n,statistics:{updateDataTimeMs:e.lifecycle?.lifecycleData.getUpdateTimeMsAndReset()}}}snapshot(e){try{let r=this.reconciler.reconcile(e);if(e?.isCancellationRequested)return{snapshot:void 0,status:"cancelled"};if(!r)throw new Error("Invalid virtual prompt tree");let n=this.snapshotNode(r,e);return n==="cancelled"||e?.isCancellationRequested?{snapshot:void 0,status:"cancelled"}:{snapshot:n,status:"ok"}}catch(r){return{snapshot:void 0,status:"error",error:r}}}createPipe(){return this.reconciler.createPipe()}};function Mb(t){if(!t||typeof t!="object")return!1;let e=t;return!(!e.document||!e.position||e.position.line===void 0||e.position.character===void 0||!e.telemetryData)}a(Mb,"isCompletionRequestData");var chr={default:{promptFunction:mri,renderer:ame},splitContext:{promptFunction:pri,renderer:pdt}};function mri(t){return Kn(j2,{children:[Kn(Wfr,{children:[Kn(dut,{ctx:t,weight:.7}),Kn(fdt,{weight:.6}),Kn(nut,{ctx:t,weight:.9}),Kn(ddt,{ctx:t,weight:.8}),Kn(odt,{ctx:t,weight:.99})]}),Kn(fNe,{weight:1})]})}a(mri,"defaultCompletionsPrompt");var Edt=class{constructor(e,r,n){this.ctx=e;this.promptOrdering=n??"default",this.virtualPrompt=r??new NNe(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe(),this.renderer=this.getRenderer()}static{a(this,"ComponentsCompletionsPromptFactory")}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}async createPromptUnsafe({completionId:e,completionState:r,telemetryData:n,promptOpts:o},s){let{maxPromptLength:c,suffixPercent:l,suffixMatchThreshold:u}=xme(this.ctx,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?"splitContext":"default";this.setPromptOrdering(f);let h=performance.now(),{traits:m,codeSnippets:g,turnOffSimilarFiles:A,resolvedContextItems:y}=await this.resolveContext(e,r,n,s,o);if(await this.updateComponentData(r.textDocument,r.position,m,g,n,A,c,s,o,u,o?.tokenizer),s?.isCancellationRequested)return S8;let E=this.virtualPrompt.snapshot(s),_=E.status;if(_==="cancelled")return S8;if(_==="error")return this.errorPrompt(E.error);let v=this.renderer.render(E.snapshot,{delimiter:` -`,tokenizer:o?.tokenizer,promptTokenLimit:c,suffixPercent:l,languageId:r.textDocument.detectedLanguageId},s);if(v.status==="cancelled")return S8;if(v.status==="error")return this.errorPrompt(v.error);let[b,T]=FH(v.prefix),w={...v,prefix:b},R;if(ime(this.ctx,n)){let P=Hlt(v.metadata.componentStatistics);this.ctx.get(pm).getStatisticsForCompletion(e).computeMatch(P),R=$lt(this.ctx,e,y),Nr.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(R)}'`)}let x=performance.now();return this.resetIfEmpty(v),this.successPrompt(w,x,h,T,R)}async updateComponentData(e,r,n,o,s,c,l,u,d={},f,h){let m=this.createRequestData(e,r,s,u,d,l,n,o,c,f,h);await this.pipe.pump(m)}async resolveContext(e,r,n,o,s={}){let c=[],l,u,d=!1;if(ime(this.ctx,n)){c=await this.ctx.get(Nb).resolution(e);let{textDocument:f}=r,h=c.filter(Vlt);zKs(this.ctx,f.detectedLanguageId,h,n)||(d=!0),l=hdt(this.ctx,e,h),mdt("contextProvider.traits",this.ctx,l,f.detectedLanguageId,f.detectedLanguageId,n),u=await rut(this.ctx,e,h,f.detectedLanguageId)}return{traits:l,codeSnippets:u,turnOffSimilarFiles:d,resolvedContextItems:c}}async failFastPrompt(e,r,n,o){if(o?.isCancellationRequested)return S8;if((await this.ctx.get(nc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Cdt;if((n>0?e.getText().length:e.offsetAt(r))<_dt)return vdt}createRequestData(e,r,n,o,s,c,l,u,d,f,h){return{document:e,position:r,telemetryData:n,cancellationToken:o,data:s.data,traits:l,codeSnippets:u,turnOffSimilarFiles:d,suffixMatchThreshold:f,maxPromptTokens:c,tokenizer:h}}resetIfEmpty(e){e.prefix.length===0&&e.suffix.length===0&&this.reset()}successPrompt(e,r,n,o,s){return{type:"prompt",prompt:{prefix:e.prefix,prefixTokens:e.prefixTokens,suffix:e.suffix,suffixTokens:e.suffixTokens,context:e.context,isFimEnabled:e.suffix.length>0},computeTimeMs:r-n,trailingWs:o,neighborSource:new Map,metadata:e.metadata,contextProvidersTelemetry:s}}errorPrompt(e){return qa(this.ctx,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),wme}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new NNe(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){return(chr[this.promptOrdering]?.promptFunction??mri)(this.ctx)}getRenderer(){let e=chr[this.promptOrdering]??chr.default;return new e.renderer}};function zKs(t,e,r,n){let o=["cpp","c"];return dri(t,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(zKs,"similarFilesEnabled");p();p();p();var Eri=2e4,gri=0,Ari=new Cn;function _ri(t,e,r,n){gri++;let o=r.promptOpts?.tokenizer??"o200k_base",s=performance.now(),{root:c,mask:l,statistics:u}=t.snapshot(r,n),d=performance.now(),f=new Set(l),h=Ari?.get(c.id),m;if(h&&h.budget>=e&&h.render.cost<=e&&h.tokenizer===o&&f.size===h.mask.size&&[...f].every(v=>h.mask.has(v)))m=h.render;else{let v=ws(o);m=Nfn(c,{budget:e,mask:l,costFunction:a(T=>v.tokenLength(T),"costFunction")}),Ari.set(c.id,{budget:e,mask:f,tokenizer:o,render:m})}let{text:g,cost:A,renderedNodes:y}=m,E=performance.now();for(let[v,b]of u?.entries()??[])b.actualTokens=y.get(v)?.cost??0;let _={renderId:gri,rendererName:"renderNode",tokenizer:o,elisionTimeMs:E-d,renderTimeMs:d-s,updateDataTimeMs:0,componentStatistics:[{componentPath:t.name,actualTokens:A}]};return{root:c,renderedNodes:y,text:g,cost:A,metadata:_}}a(_ri,"renderWithMetadata");function vri(t,e){return r=>{let n=r.text.join("")+` -`;return o0(e,n,()=>t.tokenLength(n)+1)}}a(vri,"cachedLineCostFunction");function Cri(t,e,r){let o=t.split(` -`).map(f=>({id:Ef(),text:[f],children:[],canMerge:!0})),s=[""];o.length>=1&&s.push(...Array(o.length-1).fill(` -`),"");let c={id:Ef(),text:s,children:o,canMerge:!0},u=EIe(c,a(f=>f.id===c.id?0:e(f),"nodeCostFunction")),d=r?o.length:1;for(let f of u.children)f.weight=d*Math.max(1,f.cost),d+=r?-1:1;return u}a(Cri,"getLinewiseNode");var bdt=class{constructor(){this.name="basicPrefix";this.costCache=new Cn(Eri)}static{a(this,"BasicPrefixComponent")}snapshot(e){let{completionState:r,promptOpts:n}=e,o=r.textDocument.getText({start:{line:0,character:0},end:r.position}),s=ws(n?.tokenizer),c=vri(s,this.costCache);return{root:Cri(o,c,!1)}}},yri={root:xQ,text:"",cost:0},Sdt=class{constructor(e){this.ctx=e;this.name="cachedSuffix";this.cache=new Cn(5);this.costCache=new Cn(Eri)}static{a(this,"CachedSuffixComponent")}snapshot(e){return{root:this.getCachedSuffix(e).root}}estimatedCost(e,r){return this.getCachedSuffix(e).cost}getCachedSuffix(e){let{completionState:r,telemetryData:n,promptOpts:o}=e,c=r.textDocument.getText({start:r.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}}).replace(/^.*/,"").trimStart();if(c==="")return yri;let l=this.cache.get(r.textDocument.uri)||yri;if(l.text===c)return l;let u=this.ctx.get(Zt).suffixMatchThreshold(n);if(l.text!==""){let g=new pQ,A=g.takeFirstTokens(c,dNe);if(A.tokens.length>0&&100*sut(A.tokens,g.takeFirstTokens(l.text,dNe).tokens)?.scoreg+A.cost+1,0);return{root:h,cost:m,text:c}}},Tdt=class{constructor(){this.name="traitProvider"}static{a(this,"TraitComponent")}snapshot(e,r){let{promptOpts:n}=e,o=ws(n?.tokenizer);if(!r||r.traits.length===0)return{root:xQ};let s=new Map,c=0,l=[],u=new Map;for(let m of r.traits){let g=Ef(),A=`${m.name}: ${m.value}`,y={id:g,text:[A],children:[],cost:o.tokenLength(A),weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};l.push(y),u.set(g,{componentPath:m.id,source:m,expectedTokens:y.cost}),s.set(g,m.importance??0),c+=m.importance??0}c=Math.max(c,1);let f=[`Related context: +`}a(xNe,"newLineEnded");var aYs=5,Eme=class{constructor(){this.renderId=0;this.formatPrefix=Jei}static{a(this,"CompletionsPromptRenderer")}render(e,r,n){let o=this.renderId++,s=performance.now();try{if(n?.isCancellationRequested)return{status:"cancelled"};let c=r.delimiter??"",l=r.tokenizer??"o200k_base",{prefixBlocks:u,suffixBlock:d,componentStatistics:f}=this.processSnapshot(e,c,r.languageId),{prefixTokenLimit:h,suffixTokenLimit:m}=this.getPromptLimits(d,r),g=performance.now(),A=new vut,{blocks:[y,...E]}=A.elide(u,h,d,m,ws(l)),_=performance.now(),v=this.formatPrefix(E),b=this.formatContext?this.formatContext(E):void 0,T=y.elidedValue,w=E.reduce((R,x)=>R+x.elidedTokens,0);return f.push(...cYs([...E,y])),{prefix:v,prefixTokens:w,suffix:T,suffixTokens:y.elidedTokens,context:b,status:"ok",metadata:{renderId:o,rendererName:"c",tokenizer:l,elisionTimeMs:_-g,renderTimeMs:performance.now()-s,componentStatistics:f,updateDataTimeMs:f.reduce((R,x)=>R+(x.updateDataTimeMs??0),0)}}}catch(c){return{status:"error",error:c}}}getPromptLimits(e,r){let n=e?.value??"",o=r.promptTokenLimit,s=r.suffixPercent;if(n.length==0||s==0)return{prefixTokenLimit:o,suffixTokenLimit:0};o=n.length>0?o-aYs:o;let c=Math.ceil(o*(s/100));return{prefixTokenLimit:o-c,suffixTokenLimit:c}}processSnapshot(e,r,n){let o=[],s=[],c=[],l=!1;if(new yme(e,Tpr).walkSnapshot((f,h,m)=>{if(f===e||(f.name===INe.name&&(l=!0),f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.value===void 0||f.value===""))return!0;let g=m.chunks;if(m.type==="suffix")s.push({value:wNe(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let A=f.value.endsWith(r)?f.value:f.value+r,y=A;m.type==="prefix"?y=f.value:tti(f.value)?y=A:y=s4(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:wNe(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${INe.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}},Tpr=[...Cpr(),(t,e,r)=>yut(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===ZX.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===_ut.name?{...r,type:"suffix"}:r];function cYs(t){return t.map(e=>{let r={componentPath:e.componentPath};return e.tokens!==0&&(r.expectedTokens=e.tokens,r.actualTokens=e.elidedTokens),e.nodeStatistics.updateDataTimeMs!==void 0&&(r.updateDataTimeMs=e.nodeStatistics.updateDataTimeMs),e.source&&(r.source=e.source),r})}a(cYs,"computeComponentStatistics");function wNe(t){return t.replace(/\r\n?/g,` +`)}a(wNe,"normalizeLineEndings");p();var Sut=a((t,e)=>{let[r,n]=e.useState();if(e.useData(Mb,o=>{o.document.uri!==r?.uri&&n(o.document)}),r){let o=t.ctx.get($r),s=o.getRelativePath(r),c={uri:r.uri,source:r.getText(),relativePath:s,languageId:r.detectedLanguageId},l=o.findNotebook(r);return c.relativePath&&!l?zn(lYs,{docInfo:c}):zn(uYs,{docInfo:c})}},"DocumentMarker"),lYs=a(t=>zn(Cp,{children:but(t.docInfo)}),"PathMarker"),uYs=a(t=>zn(Cp,{children:Cut(t.docInfo)}),"LanguageMarker");p();p();p();var uZs=fe(fee()),dZs=fe(g4()),Vri=fe(Ro()),fZs=fe($ut());var A4=class extends Vri.Disposable{static{a(this,"RecentEditsProvider")}};function pZs(t,e=!1,r=void 0,n){if(e&&(r===void 0||n===void 0))throw new Error("cursorLine and activeDocDistanceLimitFromCursor are required when filterByCursorLine is true");let o=t.startLine-1,s=t.endLine-1;return!!(e&&(Math.abs(o-r)<=n||Math.abs(s-r)<=n))}a(pZs,"editIsTooCloseToCursor");var ydt=a((t,e)=>{let[r,n]=e.useState();return e.useData(Mb,async o=>{if(!o.document)return;let s=t.ctx.get(A4);if(s.isEnabled())s.start();else return;let c=s.config,l=s.getRecentEdits(),u=new Set,d=t.ctx.get($r),f=[];for(let m=l.length-1;m>=0&&!(f.length>=c.maxEdits);m--){let g=l[m];if(!await d.getTextDocument({uri:g.file}))continue;let A=!u.has(g.file);if(u.size+(A?1:0)>c.maxFiles)break;let E=g.file===o.document?.uri,_=E?o.position.line:void 0;if(pZs(g,E,_,c.activeDocDistanceLimitFromCursor))continue;let b=s.getEditSummary(g);if(b){u.add(g.file);let T=d.getRelativePath({uri:g.file});f.unshift(xNe(`File: ${T}`)+xNe(b))}}if(f.length===0){n(void 0);return}let h=xNe("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+xNe("End of recent edits");n(h)}),r?zn(jH,{children:zn(Cp,{children:r})}):void 0},"RecentEdits");p();p();p();var Edt=class{constructor(e){this.docManager=e}static{a(this,"OpenTabFiles")}truncateDocs(e,r,n,o){let s=new Map,c=0;for(let l of e)if(!(c+l.getText().length>hee.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&_dt(n,l.detectedLanguageId)&&(s.set(l.uri.toString(),{uri:l.uri.toString(),relativePath:this.docManager.getRelativePath(l),source:l.getText()}),c+=l.getText().length),s.size>=o))break;return s}async getNeighborFiles(e,r,n){let o=new Map,s=new Map;return o=this.truncateDocs(cei(await this.docManager.textDocuments()),e,r,n),s.set("opentabs",Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};p();p();function Wri(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(Wri,"shortCircuit");p();function mZs(...t){return JSON.stringify(t,(e,r)=>typeof r=="object"?r:String(r))}a(mZs,"defaultHash");function whr(t,e={}){let{hash:r=mZs,cache:n=new Map}=e;return function(...o){let s=r.apply(this,o);if(n.has(s))return n.get(s);let c=t.apply(this,o);return c instanceof Promise&&(c=c.catch(l=>{throw n.delete(s),l})),n.set(s,c),c}}a(whr,"memoize");var zri={entries:[],traits:[]},vdt={entries:new Map,traits:[]},Rhr=class extends Cn{constructor(r,n=120*1e3){super(r);this.defaultEvictionTimeMs=n;this._cacheTimestamps=new Map}static{a(this,"PromiseExpirationCacheMap")}bumpRetryCount(r){let n=this._cacheTimestamps.get(r);return n?++n.retryCount:(this._cacheTimestamps.set(r,{timestamp:Date.now(),retryCount:0}),0)}has(r){return this.isValid(r)?super.has(r):(this.deleteExpiredEntry(r),!1)}get(r){let n=super.get(r);if(this.isValid(r))return n;this.deleteExpiredEntry(r)}set(r,n){let o=super.set(r,n);return this.isValid(r)||this._cacheTimestamps.set(r,{timestamp:Date.now(),retryCount:0}),o}clear(){super.clear(),this._cacheTimestamps.clear()}isValid(r){let n=this._cacheTimestamps.get(r);return n!==void 0&&Date.now()-n.timestamp=AZs?c=vdt:c=void 0);let l=performance.now()-s;if(b0.debug(t,c!==void 0?`Fetched ${[...c.entries.values()].map(u=>u.size).reduce((u,d)=>u+d,0)} related files for '${e.uri}' in ${l}ms.`:`Failing fetching files for '${e.uri}' in ${l}ms.`),c===void 0)throw new Cdt;return c}a(Kri,"getRelatedFiles");var khr=whr(Kri,{cache:Yri,hash:a((t,e,r,n,o)=>`${e.uri}`,"hash")});khr=Wri(khr,200,vdt);async function bdt(t,e,r,n,o,s=!1){let c=t.get(mee),l=vdt;try{let u={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};l=s?await Kri(t,u,r,n,c):await khr(t,u,r,n,c)}catch(u){l=vdt,u instanceof Cdt&&ft(t,"getRelatedFilesList",r)}return b0.debug(t,l!=null?`Fetched following traits ${l.traits.map(u=>`{${u.name} : ${u.value}}`).join("")} for '${e.uri}'`:`Failing fecthing traits for '${e.uri}'.`),l}a(bdt,"getRelatedFilesAndTraits");function _dt(t,e){return AIe(t)===AIe(e)}a(_dt,"considerNeighborFile");var hee=class t{static{a(this,"NeighborSource")}static{this.MAX_NEIGHBOR_AGGREGATE_LENGTH=2e5}static{this.MAX_NEIGHBOR_FILES=20}static{this.EXCLUDED_NEIGHBORS=["node_modules","dist","site-packages"]}static defaultEmptyResult(){return{docs:new Map,neighborSource:new Map,traits:[]}}static reset(){t.instance=void 0}static async getNeighborFilesAndTraits(e,r,n,o,s,c,l){let u=e.get($r);t.instance===void 0&&(t.instance=new Edt(u));let d={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(yZs(e,o))return d;let f=await u.getTextDocument({uri:r});if(!f)return b0.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: failed to get the document ${r}`),d;let h=u.getWorkspaceFolder(f);if(!h)return b0.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),d;let m=await bdt(e,f,o,s,c,l);return m.entries.size===0?(b0.debug(e,"neighborFiles.getNeighborFilesAndTraits",`0 related files found for ${r}`),d.traits.push(...m.traits),d):(m.entries.forEach((g,A)=>{let y=[];g.forEach((E,_)=>{let v=t.getRelativePath(_,h.uri);if(!v||d.docs.has(_))return;let b={relativePath:v,uri:_,source:E};y.unshift(b),d.docs.set(_,b)}),y.length>0&&d.neighborSource.set(A,y.map(E=>E.uri.toString()))}),d.traits.push(...m.traits),d)}static basename(e){return decodeURIComponent(e.replace(/[#?].*$/,"").replace(/^.*[/:]/,""))}static getRelativePath(e,r){let n=r.toString().replace(/[#?].*/,"").replace(/\/?$/,"/");return e.toString().startsWith(n)?e.toString().slice(n.length):t.basename(e)}};function yZs(t,e){return t.get(Jt).excludeRelatedFiles(e)||Rt(t,ze.ExcludeRelatedFiles)}a(yZs,"isExcludeRelatedFilesActive");function Jri(t,e){return t.get(Jt).includeNeighboringFiles(e)||Rt(t,ze.IncludeNeighboringFiles)}a(Jri,"isIncludeNeighborFilesActive");var Sdt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(Mb,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=hee.defaultEmptyResult();u.turnOffSimilarFiles||(d=await hee.getNeighborFilesAndTraits(t.ctx,u.document.uri,u.document.detectedLanguageId,u.telemetryData,u.cancellationToken,u.data));let f=await c(u.telemetryData,u.document,u,d);s(f)});async function c(u,d,f,h){let m=Ume(t.ctx,u,d.detectedLanguageId);return(await l(m,u,d,f,h)).filter(A=>A.snippet.length>0).sort((A,y)=>A.score-y.score).map(A=>({...qei(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||mut(t.ctx,d,f.detectedLanguageId),y=t.ctx.get($r).getRelativePath(f),E={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await Gei(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),zn(K2,{children:[...o.map((u,d)=>zn(EZs,{snippet:u}))]})},"SimilarFiles"),EZs=a((t,e)=>zn(jH,{children:[zn(Cp,{children:t.snippet.headline}),zn(Cp,{children:t.snippet.snippet})]}),"SimilarFile");p();p();var Tdt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(Mb,c=>{c.traits!==r&&n(c.traits);let l=AIe(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return zn(K2,{children:[zn(Cp,{children:`Consider this related information: +`}),...r.map(c=>zn(Cp,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");function Zri(t,e){return Rt(t,ze.UseSplitContextPrompt)??t.get(Jt).enablePromptContextProxyField(e)}a(Zri,"shouldUseSplitContextPrompt");function Xri(t){return zn(K2,{children:[zn(Epr,{children:[zn(Sut,{ctx:t,weight:.7}),zn(Tdt,{weight:.6}),zn(Aut,{ctx:t,weight:.9}),zn(Sdt,{ctx:t,weight:.8})]}),zn(Kei,{weight:1}),zn(_pr,{children:zn(ydt,{ctx:t,weight:.99})}),zn(Yei,{weight:1})]})}a(Xri,"splitContextCompletionsPrompt");p();var eni=0;function _Zs(){eni=0}a(_Zs,"resetContextIndex");function vZs(){return eni++}a(vZs,"getNextContextIndex");var Idt=class extends Eme{constructor(){super(...arguments);this.formatPrefix=Zei;this.formatContext=Xei}static{a(this,"SplitContextPromptRenderer")}processSnapshot(r,n){let o=[],s=[],c=[],l=!1;if(_Zs(),new yme(r,CZs).walkSnapshot((f,h,m)=>{if(f===r||(f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.name===ZX.name&&(l=!0),f.value===void 0||f.value===""))return!0;let g=m.chunks,A=m.type;if(A==="suffix")s.push({value:wNe(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let y=A==="prefix",E=y||f.value.endsWith(n)?f.value:f.value+n;o.push({type:y?"prefix":"context",value:wNe(E),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source,index:y?void 0:m.index})}return!0}),!l)throw new Error(`Node of type ${ZX.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}},CZs=[...Tpr,(t,e,r)=>yut(t)?{...r,index:vZs()}:r];p();function xdt(t,e,r){let n=tut(r,"Trait");for(let s of n)bZs(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(xdt,"getTraitsFromContextItems");function bZs(t,e,r,n){let o=t.get(ym).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(bZs,"setupExpectationsForTraits");var SZs=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function wdt(t,e,r,n,o,s){if(r.length>0){let c={};c.detectedLanguageId=n,c.languageId=o;for(let u of r){let d=SZs.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return ft(e,t,l)}}a(wdt,"ReportTraitsTelemetry");p();p();p();var Rdt=class{constructor(e){this.states=e;this.currentIndex=0;this.stateChanged=!1}static{a(this,"UseState")}useState(e){let r=this.currentIndex;if(this.states[r]===void 0){let o=typeof e=="function"?e():e;this.states[r]=o}let n=a(o=>{let s=typeof o=="function"?o(this.states[r]):o;this.states[r]=s,this.stateChanged=!0},"setState");return this.currentIndex++,[this.states[r],n]}hasChanged(){return this.stateChanged}},kdt=class{constructor(e){this.measureUpdateTime=e;this.consumers=[]}static{a(this,"UseData")}useData(e,r){this.consumers.push(n=>{if(e(n))return r(n)})}async updateData(e){if(this.consumers.length>0){let r=performance.now();for(let n of this.consumers)await n(e);this.measureUpdateTime(performance.now()-r)}}};var Pdt=class{constructor(e){this.lifecycleData=new Map;this.vTree=this.virtualizeElement(e,"$",0)}static{a(this,"VirtualPromptReconciler")}reconcile(e){if(!this.vTree)throw new Error("No tree to reconcile, make sure to pass a valid prompt");return e?.isCancellationRequested?this.vTree:(this.vTree=this.reconcileNode(this.vTree,"$",0,e),this.vTree)}reconcileNode(e,r,n,o){if(!e.children&&!e.lifecycle)return e;let s=e;if(e.lifecycle?.isRemountRequired()){let l=this.collectChildPaths(e);s=this.virtualizeElement(e.component,r,n);let u=this.collectChildPaths(s);this.cleanupState(l,u)}else if(e.children){let l=[];for(let u=0;u"u")){if(typeof e=="string"||typeof e=="number")return{name:typeof e,path:`${r}[${n}]`,props:{value:e},component:e};if(TZs(e.type)){let o=e.type(e.props.children),s=r!=="$"?`[${n}]`:"",c=`${r}${s}.${o.type}`,l=o.children.map((u,d)=>this.virtualizeElement(u,c,d));return this.ensureUniqueKeys(l),{name:o.type,path:c,children:l.flat().filter(u=>u!==void 0),component:e}}return this.virtualizeFunctionComponent(r,n,e,e.type)}}virtualizeFunctionComponent(e,r,n,o){let s=n.props.key?`["${n.props.key}"]`:`[${r}]`,c=`${e}${s}.${o.name}`,l=new Dhr(this.getOrCreateLifecycleData(c)),u=o(n.props,l),h=(Array.isArray(u)?u:[u]).map((m,g)=>this.virtualizeElement(m,c,g)).flat().filter(m=>m!==void 0);return this.ensureUniqueKeys(h),{name:o.name,path:c,props:n.props,children:h,component:n,lifecycle:l}}ensureUniqueKeys(e){let r=new Map;for(let o of e){if(!o)continue;let s=o.props?.key;s&&r.set(s,(r.get(s)||0)+1)}let n=Array.from(r.entries()).filter(([o,s])=>s>1).map(([o])=>o);if(n.length>0)throw new Error(`Duplicate keys found: ${n.join(", ")}`)}collectChildPaths(e){let r=[];if(e?.children)for(let n of e.children)n&&(r.push(n.path),r.push(...this.collectChildPaths(n)));return r}cleanupState(e,r){for(let n of e)r.includes(n)||this.lifecycleData.delete(n)}getOrCreateLifecycleData(e){return this.lifecycleData.has(e)||this.lifecycleData.set(e,new Phr([])),this.lifecycleData.get(e)}createPipe(){return{pump:a(async e=>{await this.pumpData(e)},"pump")}}async pumpData(e){if(!this.vTree)throw new Error("No tree to pump data into. Pumping data before initializing?");await this.recursivelyPumpData(e,this.vTree)}async recursivelyPumpData(e,r){if(!r)throw new Error("Can't pump data into undefined node.");await r.lifecycle?.dataHook.updateData(e);for(let n of r.children||[])await this.recursivelyPumpData(e,n)}},Phr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},Dhr=class{constructor(e){this.lifecycleData=e;this.stateHook=new Rdt(e.state),this.dataHook=new kdt(r=>{e._updateTimeMs=r})}static{a(this,"PromptElementLifecycle")}useState(e){return this.stateHook.useState(e)}useData(e,r){this.dataHook.useData(e,r)}isRemountRequired(){return this.stateHook.hasChanged()}};function TZs(t){return typeof t=="function"&&"isFragmentFunction"in t}a(TZs,"isFragmentFunction");var WNe=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new Pdt(e)}snapshotNode(e,r){if(!e)return;if(r?.isCancellationRequested)return"cancelled";let n=[];for(let o of e.children??[]){let s=this.snapshotNode(o,r);if(s==="cancelled")return"cancelled";s!==void 0&&n.push(s)}return{value:e.props?.value?.toString(),name:e.name,path:e.path,props:e.props,children:n,statistics:{updateDataTimeMs:e.lifecycle?.lifecycleData.getUpdateTimeMsAndReset()}}}snapshot(e){try{let r=this.reconciler.reconcile(e);if(e?.isCancellationRequested)return{snapshot:void 0,status:"cancelled"};if(!r)throw new Error("Invalid virtual prompt tree");let n=this.snapshotNode(r,e);return n==="cancelled"||e?.isCancellationRequested?{snapshot:void 0,status:"cancelled"}:{snapshot:n,status:"ok"}}catch(r){return{snapshot:void 0,status:"error",error:r}}}createPipe(){return this.reconciler.createPipe()}};function Mb(t){if(!t||typeof t!="object")return!1;let e=t;return!(!e.document||!e.position||e.position.line===void 0||e.position.character===void 0||!e.telemetryData)}a(Mb,"isCompletionRequestData");var Nhr={default:{promptFunction:tni,renderer:Eme},splitContext:{promptFunction:Xri,renderer:Idt}};function tni(t){return zn(K2,{children:[zn(ypr,{children:[zn(Sut,{ctx:t,weight:.7}),zn(Tdt,{weight:.6}),zn(Aut,{ctx:t,weight:.9}),zn(Sdt,{ctx:t,weight:.8}),zn(ydt,{ctx:t,weight:.99})]}),zn(INe,{weight:1})]})}a(tni,"defaultCompletionsPrompt");var Ddt=class{constructor(e,r,n){this.ctx=e;this.promptOrdering=n??"default",this.virtualPrompt=r??new WNe(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe(),this.renderer=this.getRenderer()}static{a(this,"ComponentsCompletionsPromptFactory")}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}async createPromptUnsafe({completionId:e,completionState:r,telemetryData:n,promptOpts:o},s){let{maxPromptLength:c,suffixPercent:l,suffixMatchThreshold:u}=Ume(this.ctx,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?"splitContext":"default";this.setPromptOrdering(f);let h=performance.now(),{traits:m,codeSnippets:g,turnOffSimilarFiles:A,resolvedContextItems:y}=await this.resolveContext(e,r,n,s,o);if(await this.updateComponentData(r.textDocument,r.position,m,g,n,A,c,s,o,u,o?.tokenizer),s?.isCancellationRequested)return M8;let E=this.virtualPrompt.snapshot(s),_=E.status;if(_==="cancelled")return M8;if(_==="error")return this.errorPrompt(E.error);let v=this.renderer.render(E.snapshot,{delimiter:` +`,tokenizer:o?.tokenizer,promptTokenLimit:c,suffixPercent:l,languageId:r.textDocument.detectedLanguageId},s);if(v.status==="cancelled")return M8;if(v.status==="error")return this.errorPrompt(v.error);let[b,T]=YH(v.prefix),w={...v,prefix:b},R;if(gme(this.ctx,n)){let P=rut(v.metadata.componentStatistics);this.ctx.get(ym).getStatisticsForCompletion(e).computeMatch(P),R=iut(this.ctx,e,y),Nr.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(R)}'`)}let x=performance.now();return this.resetIfEmpty(v),this.successPrompt(w,x,h,T,R)}async updateComponentData(e,r,n,o,s,c,l,u,d={},f,h){let m=this.createRequestData(e,r,s,u,d,l,n,o,c,f,h);await this.pipe.pump(m)}async resolveContext(e,r,n,o,s={}){let c=[],l,u,d=!1;if(gme(this.ctx,n)){c=await this.ctx.get(Nb).resolution(e);let{textDocument:f}=r,h=c.filter(sut);xZs(this.ctx,f.detectedLanguageId,h,n)||(d=!0),l=xdt(this.ctx,e,h),wdt("contextProvider.traits",this.ctx,l,f.detectedLanguageId,f.detectedLanguageId,n),u=await gut(this.ctx,e,h,f.detectedLanguageId)}return{traits:l,codeSnippets:u,turnOffSimilarFiles:d,resolvedContextItems:c}}async failFastPrompt(e,r,n,o){if(o?.isCancellationRequested)return M8;if((await this.ctx.get(sc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Odt;if((n>0?e.getText().length:e.offsetAt(r))0},computeTimeMs:r-n,trailingWs:o,neighborSource:new Map,metadata:e.metadata,contextProvidersTelemetry:s}}errorPrompt(e){return xa(this.ctx,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),Qme}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new WNe(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){return(Nhr[this.promptOrdering]?.promptFunction??tni)(this.ctx)}getRenderer(){let e=Nhr[this.promptOrdering]??Nhr.default;return new e.renderer}};function xZs(t,e,r,n){let o=["cpp","c"];return Jri(t,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(xZs,"similarFilesEnabled");p();p();p();var oni=2e4,rni=0,nni=new Cn;function sni(t,e,r,n){rni++;let o=r.promptOpts?.tokenizer??"o200k_base",s=performance.now(),{root:c,mask:l,statistics:u}=t.snapshot(r,n),d=performance.now(),f=new Set(l),h=nni?.get(c.id),m;if(h&&h.budget>=e&&h.render.cost<=e&&h.tokenizer===o&&f.size===h.mask.size&&[...f].every(v=>h.mask.has(v)))m=h.render;else{let v=ws(o);m=Upn(c,{budget:e,mask:l,costFunction:a(T=>v.tokenLength(T),"costFunction")}),nni.set(c.id,{budget:e,mask:f,tokenizer:o,render:m})}let{text:g,cost:A,renderedNodes:y}=m,E=performance.now();for(let[v,b]of u?.entries()??[])b.actualTokens=y.get(v)?.cost??0;let _={renderId:rni,rendererName:"renderNode",tokenizer:o,elisionTimeMs:E-d,renderTimeMs:d-s,updateDataTimeMs:0,componentStatistics:[{componentPath:t.name,actualTokens:A}]};return{root:c,renderedNodes:y,text:g,cost:A,metadata:_}}a(sni,"renderWithMetadata");function ani(t,e){return r=>{let n=r.text.join("")+` +`;return l0(e,n,()=>t.tokenLength(n)+1)}}a(ani,"cachedLineCostFunction");function cni(t,e,r){let o=t.split(` +`).map(f=>({id:Sf(),text:[f],children:[],canMerge:!0})),s=[""];o.length>=1&&s.push(...Array(o.length-1).fill(` +`),"");let c={id:Sf(),text:s,children:o,canMerge:!0},u=UIe(c,a(f=>f.id===c.id?0:e(f),"nodeCostFunction")),d=r?o.length:1;for(let f of u.children)f.weight=d*Math.max(1,f.cost),d+=r?-1:1;return u}a(cni,"getLinewiseNode");var Ldt=class{constructor(){this.name="basicPrefix";this.costCache=new Cn(oni)}static{a(this,"BasicPrefixComponent")}snapshot(e){let{completionState:r,promptOpts:n}=e,o=r.textDocument.getText({start:{line:0,character:0},end:r.position}),s=ws(n?.tokenizer),c=ani(s,this.costCache);return{root:cni(o,c,!1)}}},ini={root:FQ,text:"",cost:0},Bdt=class{constructor(e){this.ctx=e;this.name="cachedSuffix";this.cache=new Cn(5);this.costCache=new Cn(oni)}static{a(this,"CachedSuffixComponent")}snapshot(e){return{root:this.getCachedSuffix(e).root}}estimatedCost(e,r){return this.getCachedSuffix(e).cost}getCachedSuffix(e){let{completionState:r,telemetryData:n,promptOpts:o}=e,c=r.textDocument.getText({start:r.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}}).replace(/^.*/,"").trimStart();if(c==="")return ini;let l=this.cache.get(r.textDocument.uri)||ini;if(l.text===c)return l;let u=this.ctx.get(Jt).suffixMatchThreshold(n);if(l.text!==""){let g=new bQ,A=g.takeFirstTokens(c,TNe);if(A.tokens.length>0&&100*Eut(A.tokens,g.takeFirstTokens(l.text,TNe).tokens)?.scoreg+A.cost+1,0);return{root:h,cost:m,text:c}}},Fdt=class{constructor(){this.name="traitProvider"}static{a(this,"TraitComponent")}snapshot(e,r){let{promptOpts:n}=e,o=ws(n?.tokenizer);if(!r||r.traits.length===0)return{root:FQ};let s=new Map,c=0,l=[],u=new Map;for(let m of r.traits){let g=Sf(),A=`${m.name}: ${m.value}`,y={id:g,text:[A],children:[],cost:o.tokenLength(A),weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};l.push(y),u.set(g,{componentPath:m.id,source:m,expectedTokens:y.cost}),s.set(g,m.importance??0),c+=m.importance??0}c=Math.max(c,1);let f=[`Related context: `,...new Array(l.length).fill(` -`)],h={id:Ef(),text:f,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return yIe(h,m=>(s.get(m.id)??0)/c),{root:h,statistics:u}}},Idt=class{constructor(e){this.ctx=e;this.name="contextProvider"}static{a(this,"CodeSnippetComponent")}snapshot(e,r){let{promptOpts:n}=e,o=ws(n?.tokenizer);if(!r||r.codeSnippets.length===0)return{root:xQ};let s=new Map;for(let g of r.codeSnippets){let A=g.uri;o0(s,A,()=>[]).push(g)}let c=new Map,l=[],u=new Map,d=0,f=this.ctx.get($r);for(let[g,A]of s.entries()){let y=f.getRelativePath({uri:g})??g,_=[`Compare ${A.length>1?"these snippets":"this snippet"} from ${y}: +`)],h={id:Sf(),text:f,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return FIe(h,m=>(s.get(m.id)??0)/c),{root:h,statistics:u}}},Udt=class{constructor(e){this.ctx=e;this.name="contextProvider"}static{a(this,"CodeSnippetComponent")}snapshot(e,r){let{promptOpts:n}=e,o=ws(n?.tokenizer);if(!r||r.codeSnippets.length===0)return{root:FQ};let s=new Map;for(let g of r.codeSnippets){let A=g.uri;l0(s,A,()=>[]).push(g)}let c=new Map,l=[],u=new Map,d=0,f=this.ctx.get($r);for(let[g,A]of s.entries()){let y=f.getRelativePath({uri:g})??g,_=[`Compare ${A.length>1?"these snippets":"this snippet"} from ${y}: `,...new Array(A.length).fill(` -`)],v=[];for(let b of A){let T=Ef();u.set(T,b.importance??0);let w={id:T,text:[b.value],children:[],cost:o.tokenLength(b.value),weight:b.importance??0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};v.push(w),d+=b.importance??0,c.set(T,{componentPath:b.id,source:b,expectedTokens:w.cost})}l.push({id:Ef(),text:_,children:v,cost:o.tokenLength(_.join("")),weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0})}d=Math.max(d,1);let h=new Array(l.length+1).fill(""),m={id:Ef(),text:h,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return yIe(m,g=>(u.get(g.id)??0)/d),{root:m,statistics:c}}},xdt=class{constructor(e,r){this.name=e;this.components=r}static{a(this,"ConcatenatedContextComponent")}snapshot(e,r){let n=this.components.map(d=>d.snapshot(e,r)),o=n.map(d=>d.root).filter(d=>d.id!==xQ.id);if(o.length===0)return{root:xQ};let s=["",...Array(o.length-1).fill(` -`),""],c={id:Ef(),text:s,children:o,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1},l=[],u=new Map;for(let d of n){for(let[f,h]of d.statistics?.entries()??[])u.set(f,h);d.mask&&l.push(...d.mask)}return{root:c,mask:l,statistics:u}}};var YKs=.8,wdt=class{constructor(e,r){this.ctx=e;this.components=r;this.renderId=0}static{a(this,"CascadingPromptFactory")}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}getComponentAllocation(e){let r=this.ctx.get(Zt).suffixPercent(e),n=this.ctx.get(Zt).stableContextPercent(e),o=this.ctx.get(Zt).volatileContextPercent(e);if(r<0||r>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${r}`);if(n<0||n>100)throw new Error(`stableContextPercent must be between 0 and 100, but was ${n}`);if(o<0||o>100)throw new Error(`volatileContextPercent must be between 0 and 100, but was ${o}`);let s=100-r-n-o;if(s<=1||s>100)throw new Error(`prefixPercent must be between 1 and 100, but was ${s}`);return{prefix:s/100,suffix:r/100,stableContext:n/100,volatileContext:o/100}}async createPromptUnsafe(e,r){this.renderId++;let{completionId:n,completionState:o,telemetryData:s,promptOpts:c}=e,l=await this.failFastPrompt(o.textDocument,r);if(l)return l;let u=performance.now(),d;ime(this.ctx,s)&&(d=await this.resolveContext(n,o,s,r));let f=performance.now()-u,h={},m={renderId:this.renderId,rendererName:"w",tokenizer:c?.tokenizer??"o200k_base",elisionTimeMs:0,renderTimeMs:0,updateDataTimeMs:f,componentStatistics:[]},g=o.textDocument.detectedLanguageId,{maxPromptLength:A}=xme(this.ctx,s,g),y=this.getComponentAllocation(s),E=y.suffix*A,_=this.components.suffix.estimatedCost?.(e,d),v=["stableContext","volatileContext","prefix","suffix"];E>YKs*(_??0)&&(v=["stableContext","volatileContext","suffix","prefix"]);let b=0;for(let N of v){let L=b+A*y[N],B=_ri(this.components[N],L,e,d);b=L-B.cost,h[N]=B,KKs(m,B.metadata)}let[T,w]=FH(h.prefix.text),R=performance.now(),x=ime(this.ctx,s)?this.telemetrizeContext(n,m.componentStatistics,d?.resolvedContextItems??[]):[],P=[h.stableContext.text.trim(),h.volatileContext.text.trim()];return{type:"prompt",prompt:{prefix:c?.separateContext?T:i4(P.join(` +`)],v=[];for(let b of A){let T=Sf();u.set(T,b.importance??0);let w={id:T,text:[b.value],children:[],cost:o.tokenLength(b.value),weight:b.importance??0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};v.push(w),d+=b.importance??0,c.set(T,{componentPath:b.id,source:b,expectedTokens:w.cost})}l.push({id:Sf(),text:_,children:v,cost:o.tokenLength(_.join("")),weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0})}d=Math.max(d,1);let h=new Array(l.length+1).fill(""),m={id:Sf(),text:h,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return FIe(m,g=>(u.get(g.id)??0)/d),{root:m,statistics:c}}},Qdt=class{constructor(e,r){this.name=e;this.components=r}static{a(this,"ConcatenatedContextComponent")}snapshot(e,r){let n=this.components.map(d=>d.snapshot(e,r)),o=n.map(d=>d.root).filter(d=>d.id!==FQ.id);if(o.length===0)return{root:FQ};let s=["",...Array(o.length-1).fill(` +`),""],c={id:Sf(),text:s,children:o,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1},l=[],u=new Map;for(let d of n){for(let[f,h]of d.statistics?.entries()??[])u.set(f,h);d.mask&&l.push(...d.mask)}return{root:c,mask:l,statistics:u}}};var wZs=.8,qdt=class{constructor(e,r){this.ctx=e;this.components=r;this.renderId=0}static{a(this,"CascadingPromptFactory")}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}getComponentAllocation(e){let r=this.ctx.get(Jt).suffixPercent(e),n=this.ctx.get(Jt).stableContextPercent(e),o=this.ctx.get(Jt).volatileContextPercent(e);if(r<0||r>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${r}`);if(n<0||n>100)throw new Error(`stableContextPercent must be between 0 and 100, but was ${n}`);if(o<0||o>100)throw new Error(`volatileContextPercent must be between 0 and 100, but was ${o}`);let s=100-r-n-o;if(s<=1||s>100)throw new Error(`prefixPercent must be between 1 and 100, but was ${s}`);return{prefix:s/100,suffix:r/100,stableContext:n/100,volatileContext:o/100}}async createPromptUnsafe(e,r){this.renderId++;let{completionId:n,completionState:o,telemetryData:s,promptOpts:c}=e,l=await this.failFastPrompt(o.textDocument,r);if(l)return l;let u=performance.now(),d;gme(this.ctx,s)&&(d=await this.resolveContext(n,o,s,r));let f=performance.now()-u,h={},m={renderId:this.renderId,rendererName:"w",tokenizer:c?.tokenizer??"o200k_base",elisionTimeMs:0,renderTimeMs:0,updateDataTimeMs:f,componentStatistics:[]},g=o.textDocument.detectedLanguageId,{maxPromptLength:A}=Ume(this.ctx,s,g),y=this.getComponentAllocation(s),E=y.suffix*A,_=this.components.suffix.estimatedCost?.(e,d),v=["stableContext","volatileContext","prefix","suffix"];E>wZs*(_??0)&&(v=["stableContext","volatileContext","suffix","prefix"]);let b=0;for(let N of v){let L=b+A*y[N],B=sni(this.components[N],L,e,d);b=L-B.cost,h[N]=B,RZs(m,B.metadata)}let[T,w]=YH(h.prefix.text),R=performance.now(),x=gme(this.ctx,s)?this.telemetrizeContext(n,m.componentStatistics,d?.resolvedContextItems??[]):[],P=[h.stableContext.text.trim(),h.volatileContext.text.trim()];return{type:"prompt",prompt:{prefix:c?.separateContext?T:s4(P.join(` `),g)+` -`+T,prefixTokens:h.prefix.cost+h.stableContext.cost+h.volatileContext.cost,suffix:h.suffix.text,suffixTokens:h.suffix.cost,context:c?.separateContext?P:void 0,isFimEnabled:h.suffix.text.length>0},computeTimeMs:R-u,trailingWs:w,neighborSource:new Map,metadata:m,contextProvidersTelemetry:x}}async resolveContext(e,r,n,o){let s=await this.ctx.get(Nb).resolution(e),{textDocument:c}=r,l=s.filter(Vlt),u=hdt(this.ctx,e,l);mdt("contextProvider.traits",this.ctx,u,c.detectedLanguageId,c.detectedLanguageId,n);let d=await rut(this.ctx,e,l,c.detectedLanguageId);return{traits:u,codeSnippets:d,resolvedContextItems:s}}telemetrizeContext(e,r,n){let o=Hlt(r);this.ctx.get(pm).getStatisticsForCompletion(e).computeMatch(o);let s=$lt(this.ctx,e,n);return Nr.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(s)}'`),s}async failFastPrompt(e,r){if(r?.isCancellationRequested)return S8;if((await this.ctx.get(nc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Cdt;if(e.getText().length<_dt)return vdt}errorPrompt(e){return qa(this.ctx,e,"WorkspaceContextPromptFactory"),wme}};function KKs(t,e){t.elisionTimeMs+=e.elisionTimeMs,t.renderTimeMs+=e.renderTimeMs,t.updateDataTimeMs+=e.updateDataTimeMs,t.componentStatistics.push(...e.componentStatistics)}a(KKs,"aggregateMetadata");p();p();var bri=de(require("events"));var JKs={UpdateInterval:1e3,InvalidCacheTime:1e3*60*10,StaleWeightHalflife:1e3*10,MinNodeSize:100,Laziness:.5,MaxActiveFiles:8,MaxActiveNodes:2e3},ZKs=5,z2=class t{constructor(e){this.ctx=e;this.didDispose=!1;this.deferredStart=new vA;this.config=JKs;this.emitter=new bri.default;this.client=void 0;this.nextRequest={};this.lastEvent=void 0;this.emitter.setMaxListeners(27)}static{a(this,"WorkspaceContextFeature")}static{this.UpdateEventName="WorkspaceContextUpdate"}static{this.DisposeEventName="WorkspaceContextDispose"}get didStart(){return this.client!==void 0}async maybeStart(e,r){if(this.didStart||this.didDispose)return;let n=Ft(this.ctx,Ye.UseWorkspaceContextCoordinator);if(n===void 0&&r){let o=await this.ctx.get(Zt).updateExPValuesAndAssignments(r);n=this.isEnabled(o)}n&&this.start(e)}isActive(){return this.didStart&&!this.didDispose&&this.client!==void 0&&this.client.isActive()}get activation(){return this.deferredStart.promise}isEnabled(e){return Ft(this.ctx,Ye.UseWorkspaceContextCoordinator)??this.ctx.get(Zt).workspaceContextCoordinator(e)}start(e){!this.didStart&&!this.didDispose&&(this.client=e,this.fileChangeDisposable=this.ctx.get($r).onDidChangeTextDocument(r=>{this.nextRequest.changedFiles===void 0&&(this.nextRequest.changedFiles=[]),this.nextRequest.changedFiles.push(r.document.uri)}),this.deferredStart.resolve(),this.loop())}dispose(){this.isActive()&&(this.didDispose=!0,this.emitter.emit(t.DisposeEventName),this.fileChangeDisposable?.dispose(),this.client?.exit())}pushWorkspaceContext(e,r){this.nextRequest.sources={...this.nextRequest.sources,[e]:r}}recordWorkspaceContextActivity(e,r,n){this.nextRequest.recentActivity===void 0&&(this.nextRequest.recentActivity=[]),this.nextRequest.recentActivity.push({sourceId:e,locations:r,timestamp:n})}getLastEvent(){return this.lastEvent}onUpdate(e){return this.emitter.on(t.UpdateEventName,e),Fn.Disposable.create(()=>this.emitter.off(t.UpdateEventName,e))}onDisposal(e){return this.emitter.on(t.DisposeEventName,e),Fn.Disposable.create(()=>this.emitter.off(t.DisposeEventName,e))}setContextLanguages(e){this.nextRequest.languages=e}async loop(){let e=0;for(;this.isActive();){try{let r=this.nextRequest;this.nextRequest={},this.lastEvent=await this.client.updateContext(r),this.emitter.emit(t.UpdateEventName,this.lastEvent),e=0}catch(r){if(LY(this.ctx,r,"WorkspaceContextFeature.loop"),e++,e>=ZKs){this.dispose();break}}await bC(this.config.UpdateInterval)}}};function Sri(t,e){let r=z0(t,e,"event.WorkspaceContextUpdate");return t.get(z2).onUpdate(r)}a(Sri,"onWorkspaceContextUpdate");p();var Rdt=class{constructor(e){this.ctx=e;this.name="workspaceContext";this.documents=new Map;this.root=xQ;this.disposables=[];this.rootWithPathCache=new Cn;this.disposables.push(Sri(e,r=>{(this.nextUpdateTime===void 0||performance.now()>=this.nextUpdateTime)&&setTimeout(()=>{this.update(r)},0)}))}static{a(this,"WorkspaceContextPromptComponent")}snapshot(e){let{completionState:r,telemetryData:n}=e;this.nextUpdateTime=this.lastUpdateTime!==void 0?this.lastUpdateTime+this.ctx.get(Zt).workspaceContextCacheTime(n):performance.now();let o=o0(this.rootWithPathCache,r.textDocument.uri,()=>{let c=this.getPathMarker(r);return{id:Ef(),text:[`${c} -`,""],children:[this.root],cost:1,weight:1,elisionMarker:"",canMerge:!0,requireRenderedChild:!1}}),s=this.getMask(r.textDocument.uri);return{root:o,mask:s}}getRoot(){return this.root}getMask(e){let r=this.documents.get(e);return r===void 0?[]:[r.id]}getPathMarker(e){let r=e.textDocument,n=this.ctx.get($r),o=n.getRelativePath(e.textDocument),s={uri:r.uri,source:"",relativePath:o,languageId:r.detectedLanguageId},c=n.findNotebook(r);return s.relativePath&&!c?i4(uut(s),s.languageId):i4(lut(s),s.languageId)}update(e){this.rootWithPathCache.clear(),this.documents.clear();for(let[r,n]of Object.entries(e.documents)){let o=this.createAnnotatedDocumentRoot(r,n);n.requireRenderedChild=n.children.length>0,this.documents.set(r,o)}this.root=this.createRootNode(),this.lastUpdateTime=performance.now()}createRootNode(){let e=new Array(this.documents.size+1).fill(""),r=[...this.documents.values()];return{id:Ef(),text:e,children:r,cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}createAnnotatedDocumentRoot(e,r){let n=nO({uri:e,languageId:"UNKNOWN"}),o=this.getDocumentAnnotation(e,n);return{id:Ef(),text:[o,` +`+T,prefixTokens:h.prefix.cost+h.stableContext.cost+h.volatileContext.cost,suffix:h.suffix.text,suffixTokens:h.suffix.cost,context:c?.separateContext?P:void 0,isFimEnabled:h.suffix.text.length>0},computeTimeMs:R-u,trailingWs:w,neighborSource:new Map,metadata:m,contextProvidersTelemetry:x}}async resolveContext(e,r,n,o){let s=await this.ctx.get(Nb).resolution(e),{textDocument:c}=r,l=s.filter(sut),u=xdt(this.ctx,e,l);wdt("contextProvider.traits",this.ctx,u,c.detectedLanguageId,c.detectedLanguageId,n);let d=await gut(this.ctx,e,l,c.detectedLanguageId);return{traits:u,codeSnippets:d,resolvedContextItems:s}}telemetrizeContext(e,r,n){let o=rut(r);this.ctx.get(ym).getStatisticsForCompletion(e).computeMatch(o);let s=iut(this.ctx,e,n);return Nr.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(s)}'`),s}async failFastPrompt(e,r){if(r?.isCancellationRequested)return M8;if((await this.ctx.get(sc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Odt;if(e.getText().length{this.nextRequest.changedFiles===void 0&&(this.nextRequest.changedFiles=[]),this.nextRequest.changedFiles.push(r.document.uri)}),this.deferredStart.resolve(),this.loop())}dispose(){this.isActive()&&(this.didDispose=!0,this.emitter.emit(t.DisposeEventName),this.fileChangeDisposable?.dispose(),this.client?.exit())}pushWorkspaceContext(e,r){this.nextRequest.sources={...this.nextRequest.sources,[e]:r}}recordWorkspaceContextActivity(e,r,n){this.nextRequest.recentActivity===void 0&&(this.nextRequest.recentActivity=[]),this.nextRequest.recentActivity.push({sourceId:e,locations:r,timestamp:n})}getLastEvent(){return this.lastEvent}onUpdate(e){return this.emitter.on(t.UpdateEventName,e),Fn.Disposable.create(()=>this.emitter.off(t.UpdateEventName,e))}onDisposal(e){return this.emitter.on(t.DisposeEventName,e),Fn.Disposable.create(()=>this.emitter.off(t.DisposeEventName,e))}setContextLanguages(e){this.nextRequest.languages=e}async loop(){let e=0;for(;this.isActive();){try{let r=this.nextRequest;this.nextRequest={},this.lastEvent=await this.client.updateContext(r),this.emitter.emit(t.UpdateEventName,this.lastEvent),e=0}catch(r){if(zY(this.ctx,r,"WorkspaceContextFeature.loop"),e++,e>=PZs){this.dispose();break}}await MC(this.config.UpdateInterval)}}};function uni(t,e){let r=K0(t,e,"event.WorkspaceContextUpdate");return t.get(rD).onUpdate(r)}a(uni,"onWorkspaceContextUpdate");p();var jdt=class{constructor(e){this.ctx=e;this.name="workspaceContext";this.documents=new Map;this.root=FQ;this.disposables=[];this.rootWithPathCache=new Cn;this.disposables.push(uni(e,r=>{(this.nextUpdateTime===void 0||performance.now()>=this.nextUpdateTime)&&setTimeout(()=>{this.update(r)},0)}))}static{a(this,"WorkspaceContextPromptComponent")}snapshot(e){let{completionState:r,telemetryData:n}=e;this.nextUpdateTime=this.lastUpdateTime!==void 0?this.lastUpdateTime+this.ctx.get(Jt).workspaceContextCacheTime(n):performance.now();let o=l0(this.rootWithPathCache,r.textDocument.uri,()=>{let c=this.getPathMarker(r);return{id:Sf(),text:[`${c} +`,""],children:[this.root],cost:1,weight:1,elisionMarker:"",canMerge:!0,requireRenderedChild:!1}}),s=this.getMask(r.textDocument.uri);return{root:o,mask:s}}getRoot(){return this.root}getMask(e){let r=this.documents.get(e);return r===void 0?[]:[r.id]}getPathMarker(e){let r=e.textDocument,n=this.ctx.get($r),o=n.getRelativePath(e.textDocument),s={uri:r.uri,source:"",relativePath:o,languageId:r.detectedLanguageId},c=n.findNotebook(r);return s.relativePath&&!c?s4(but(s),s.languageId):s4(Cut(s),s.languageId)}update(e){this.rootWithPathCache.clear(),this.documents.clear();for(let[r,n]of Object.entries(e.documents)){let o=this.createAnnotatedDocumentRoot(r,n);n.requireRenderedChild=n.children.length>0,this.documents.set(r,o)}this.root=this.createRootNode(),this.lastUpdateTime=performance.now()}createRootNode(){let e=new Array(this.documents.size+1).fill(""),r=[...this.documents.values()];return{id:Sf(),text:e,children:r,cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}createAnnotatedDocumentRoot(e,r){let n=uO({uri:e,languageId:"UNKNOWN"}),o=this.getDocumentAnnotation(e,n);return{id:Sf(),text:[o,` -`],children:[r],cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}getDocumentAnnotation(e,r){let o=this.ctx.get($r).getRelativePath({uri:e});return i4(`Related portions of ${o??e}: -`,r)}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};p();var kdt=class extends wdt{static{a(this,"WorkspaceContextPromptFactory")}constructor(e){let r={stableContext:new Rdt(e),prefix:new bdt,suffix:new Sdt(e),volatileContext:new xdt("volatileContext",[new Tdt,new Idt(e)])};super(e,r)}};var Tri=de(ri());var T8=class{static{a(this,"CompletionsPromptFactory")}};function Pdt(t,e,r){return new lhr(new uhr(new dhr(t,new Edt(t,e,r),new kdt(t),eJs)))}a(Pdt,"createCompletionsPromptFactory");var lhr=class extends T8{constructor(r){super();this.delegate=r}static{a(this,"SequentialCompletionsPromptFactory")}async prompt(r,n){return this.lastPromise=this.promptAsync(r,n),this.lastPromise}async promptAsync(r,n){if(await this.lastPromise,n?.isCancellationRequested)return S8;try{return await this.delegate.prompt(r,n)}catch{return wme}}},XKs=1200,uhr=class{constructor(e){this.delegate=e}static{a(this,"TimeoutHandlingCompletionsPromptFactory")}async prompt(e,r){let n=new Tri.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(Iri)},XKs)})])}},dhr=class{constructor(e,r,n,o){this.ctx=e;this.defaultDelegate=r;this.experimentalDelegate=n;this.fn=o}static{a(this,"ExperimentalCompletionsPromptFactory")}async prompt(e,r){return this.fn(this.ctx,e.telemetryData)?this.experimentalDelegate.prompt(e,r):this.defaultDelegate.prompt(e,r)}};function eJs(t,e){let r=t.get(z2);return r.isEnabled(e)&&r.isActive()}a(eJs,"workspaceContextEnabledAndActive");var _dt=10,vdt={type:"contextTooShort"},Cdt={type:"copilotContentExclusion"},wme={type:"promptError"},S8={type:"promptCancelled"},Iri={type:"promptTimeout"};function FH(t){let e=t.split(` -`),r=e[e.length-1],n=r.length-r.trimEnd().length,o=t.slice(0,t.length-n),s=t.slice(o.length);return[r.length==n?o:t,s]}a(FH,"trimLastLine");function Rme(t,e,r,n,o,s={}){let l=t.get($r).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);l&&u&&(r=rJs(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys();let d=fri(t,n);return t.get(T8).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:d}},o)}a(Rme,"extractPrompt");function tJs(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:i4(n,e)}a(tJs,"addNeighboringCellsToPrompt");function rJs(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>tJs(l,r.document.detectedLanguageId)).join(` +`],children:[r],cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}getDocumentAnnotation(e,r){let o=this.ctx.get($r).getRelativePath({uri:e});return s4(`Related portions of ${o??e}: +`,r)}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};p();var Hdt=class extends qdt{static{a(this,"WorkspaceContextPromptFactory")}constructor(e){let r={stableContext:new jdt(e),prefix:new Ldt,suffix:new Bdt(e),volatileContext:new Qdt("volatileContext",[new Fdt,new Udt(e)])};super(e,r)}};var dni=fe(ei());var O8=class{static{a(this,"CompletionsPromptFactory")}};function Gdt(t,e,r){return new Mhr(new Ohr(new Lhr(t,new Ddt(t,e,r),new Hdt(t),NZs)))}a(Gdt,"createCompletionsPromptFactory");var Mhr=class extends O8{constructor(r){super();this.delegate=r}static{a(this,"SequentialCompletionsPromptFactory")}async prompt(r,n){return this.lastPromise=this.promptAsync(r,n),this.lastPromise}async promptAsync(r,n){if(await this.lastPromise,n?.isCancellationRequested)return M8;try{return await this.delegate.prompt(r,n)}catch{return Qme}}},DZs=1200,Ohr=class{constructor(e){this.delegate=e}static{a(this,"TimeoutHandlingCompletionsPromptFactory")}async prompt(e,r){let n=new dni.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(fni)},DZs)})])}},Lhr=class{constructor(e,r,n,o){this.ctx=e;this.defaultDelegate=r;this.experimentalDelegate=n;this.fn=o}static{a(this,"ExperimentalCompletionsPromptFactory")}async prompt(e,r){return this.fn(this.ctx,e.telemetryData)?this.experimentalDelegate.prompt(e,r):this.defaultDelegate.prompt(e,r)}};function NZs(t,e){let r=t.get(rD);return r.isEnabled(e)&&r.isActive()}a(NZs,"workspaceContextEnabledAndActive");var Ndt=10,Mdt={type:"contextTooShort"},Odt={type:"copilotContentExclusion"},Qme={type:"promptError"},M8={type:"promptCancelled"},fni={type:"promptTimeout"};function YH(t){let e=t.split(` +`),r=e[e.length-1],n=r.length-r.trimEnd().length,o=t.slice(0,t.length-n),s=t.slice(o.length);return[r.length==n?o:t,s]}a(YH,"trimLastLine");function qme(t,e,r,n,o,s={}){let l=t.get($r).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);l&&u&&(r=OZs(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys();let d=Zri(t,n);return t.get(O8).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:d}},o)}a(qme,"extractPrompt");function MZs(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:s4(n,e)}a(MZs,"addNeighboringCellsToPrompt");function OZs(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>MZs(l,r.document.detectedLanguageId)).join(` `)+` -`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(rJs,"applyEditsForNotebook");function xme(t,e,r){let o=t.get(Zt).maxPromptCompletionTokens(e)-lYe(t),s=aei(e,r),c=tut(t,e,r),l=t.get(Zt).suffixPercent(e),u=t.get(Zt).suffixMatchThreshold(e);if(l<0||l>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${l}`);if(u<0||u>100)throw new Error(`suffixMatchThreshold must be between 0 and 100, but was ${u}`);return{maxPromptLength:o,similarFilesOptions:c,numberOfSnippets:s,suffixPercent:l,suffixMatchThreshold:u}}a(xme,"getPromptOptions");p();p();var xri=2.98410452738298,wri=-.838732736843507,Rri=1.50314646255716,kri=-.237798634012662,Ddt={python:.314368072478742},Pri={"0.01":.225800751784931,"0.02":.290204307767402,"0.03":.333153496466045,"0.05":.404516749849559,"0.1":.513216040545626,"0.2":.626904979128674,"0.3":.694880719658273,"0.4":.743100684947291,"0.5":.782524520571946,"0.6":.816856186092243,"0.7":.84922977716585,"0.8":.883694877241999,"0.9":.921859050950077,"0.95":.944571268106974,"0.99":.969535563141733};var nJs={link:a(t=>Math.exp(t)/(1+Math.exp(t)),"link"),unlink:a(t=>Math.log(t/(1-t)),"unlink")};function iJs(t,e){let r=Math.min(...Array.from(e.keys()).filter(c=>c>=t)),n=Math.max(...Array.from(e.keys()).filter(c=>co)}contribution(e){return this.coefficient*this.transformation(e)}},fhr=class{constructor(e,r,n){this.link=nJs;if(this.intercept=e,this.coefficients=r,this.logitsToQuantiles=new Map,this.logitsToQuantiles.set(0,0),this.logitsToQuantiles.set(1,1),n)for(let o in n)this.logitsToQuantiles.set(n[o],Number(o))}static{a(this,"LogisticRegression")}predict(e,r){let n=this.intercept;for(let o of this.coefficients){let s=r[o.name];if(s===void 0)return NaN;n+=o.contribution(s)}return this.link.link(n)}quantile(e,r){let n=this.predict(e,r);return iJs(n,this.logitsToQuantiles)}},Dri=new fhr(xri,[new kme("compCharLen",wri,t=>Math.log(1+t)),new kme("meanLogProb",Rri),new kme("meanAlternativeLogProb",kri)].concat(Object.entries(Ddt).map(t=>new kme(t[0],t[1]))),Pri);function Nri(t,e){let r={...e.measurements};return Object.keys(Ddt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),Dri.predict(t,r)}a(Nri,"ghostTextScoreConfidence");function Mri(t,e){let r={...e.measurements};return Object.keys(Ddt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),Dri.quantile(t,r)}a(Mri,"ghostTextScoreQuantile");p();function oJs(t,e,r,n){let o="}";try{o=Pdn(e.detectedLanguageId)??"}"}catch{}return sJs({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(oJs,"maybeSnipCompletion");function sJs(t,e,r,n){let o=aJs(r),s=o.lines;if(s.length===1)return r;for(let c=1;c=t.getLineCount()?void 0:t.getLineText(y),h!==void 0&&h.trim()==="")u++;else break}let m,g;for(;m=c+f+d,g=m>=s.length?void 0:s[m],g!==void 0&&g.trim()==="";)d++;let A=m===s.length-1;if(!g||!(h&&(A?h.startsWith(g)||g.startsWith(h):h===g&&g.trim()===n))){l=!1;break}}if(l)return s.slice(0,c).join(o.newLineCharacter)}return r}a(sJs,"maybeSnipCompletionImpl");function aJs(t){let e=t.includes(`\r +`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(OZs,"applyEditsForNotebook");function Ume(t,e,r){let o=t.get(Jt).maxPromptCompletionTokens(e)-BYe(t),s=Wei(e,r),c=mut(t,e,r),l=t.get(Jt).suffixPercent(e),u=t.get(Jt).suffixMatchThreshold(e);if(l<0||l>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${l}`);if(u<0||u>100)throw new Error(`suffixMatchThreshold must be between 0 and 100, but was ${u}`);return{maxPromptLength:o,similarFilesOptions:c,numberOfSnippets:s,suffixPercent:l,suffixMatchThreshold:u}}a(Ume,"getPromptOptions");p();p();var pni=2.98410452738298,hni=-.838732736843507,mni=1.50314646255716,gni=-.237798634012662,$dt={python:.314368072478742},Ani={"0.01":.225800751784931,"0.02":.290204307767402,"0.03":.333153496466045,"0.05":.404516749849559,"0.1":.513216040545626,"0.2":.626904979128674,"0.3":.694880719658273,"0.4":.743100684947291,"0.5":.782524520571946,"0.6":.816856186092243,"0.7":.84922977716585,"0.8":.883694877241999,"0.9":.921859050950077,"0.95":.944571268106974,"0.99":.969535563141733};var LZs={link:a(t=>Math.exp(t)/(1+Math.exp(t)),"link"),unlink:a(t=>Math.log(t/(1-t)),"unlink")};function BZs(t,e){let r=Math.min(...Array.from(e.keys()).filter(c=>c>=t)),n=Math.max(...Array.from(e.keys()).filter(c=>co)}contribution(e){return this.coefficient*this.transformation(e)}},Bhr=class{constructor(e,r,n){this.link=LZs;if(this.intercept=e,this.coefficients=r,this.logitsToQuantiles=new Map,this.logitsToQuantiles.set(0,0),this.logitsToQuantiles.set(1,1),n)for(let o in n)this.logitsToQuantiles.set(n[o],Number(o))}static{a(this,"LogisticRegression")}predict(e,r){let n=this.intercept;for(let o of this.coefficients){let s=r[o.name];if(s===void 0)return NaN;n+=o.contribution(s)}return this.link.link(n)}quantile(e,r){let n=this.predict(e,r);return BZs(n,this.logitsToQuantiles)}},yni=new Bhr(pni,[new jme("compCharLen",hni,t=>Math.log(1+t)),new jme("meanLogProb",mni),new jme("meanAlternativeLogProb",gni)].concat(Object.entries($dt).map(t=>new jme(t[0],t[1]))),Ani);function Eni(t,e){let r={...e.measurements};return Object.keys($dt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),yni.predict(t,r)}a(Eni,"ghostTextScoreConfidence");function _ni(t,e){let r={...e.measurements};return Object.keys($dt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),yni.quantile(t,r)}a(_ni,"ghostTextScoreQuantile");p();function FZs(t,e,r,n){let o="}";try{o=Lfn(e.detectedLanguageId)??"}"}catch{}return UZs({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(FZs,"maybeSnipCompletion");function UZs(t,e,r,n){let o=QZs(r),s=o.lines;if(s.length===1)return r;for(let c=1;c=t.getLineCount()?void 0:t.getLineText(y),h!==void 0&&h.trim()==="")u++;else break}let m,g;for(;m=c+f+d,g=m>=s.length?void 0:s[m],g!==void 0&&g.trim()==="";)d++;let A=m===s.length-1;if(!g||!(h&&(A?h.startsWith(g)||g.startsWith(h):h===g&&g.trim()===n))){l=!1;break}}if(l)return s.slice(0,c).join(o.newLineCharacter)}return r}a(UZs,"maybeSnipCompletionImpl");function QZs(t){let e=t.includes(`\r `)?`\r `:` -`;return{lines:t.split(e),newLineCharacter:e}}a(aJs,"splitByNewLine");function cJs(t,e,r,n){let o="",s=e.line+1,c=n?r.trim():r;for(;o===""&&s0){if(r.completionText.indexOf(o)!==-1)return o.length;{let s=-1,c=0;for(let l of o){let u=r.completionText.indexOf(l,s+1);if(u>s)c++,s=u;else break}return c}}return 0}a(Ori,"checkSuffix");var Uri=de(dU());Mo();var ul=new fe("ghostText");var Lri=20;async function Qri(t,e,r,n,o,s,c){ul.debug(t,`Getting ${s} from network`),r=r.extendedBy();let l=e.isCycling?3:1,u=Yle(t,l),d={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:Ldn(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},f={n:l,temperature:u,code_annotations:!1},h=Ft(t,Ye.ModelAlwaysTerminatesSingleline)??t.get(Zt).modelAlwaysTerminatesSingleline(r),m=e.blockMode==="moremultiline"&&tO.isSupported(e.languageId)&&!h;!e.multiline&&!m?f.stop=[` -`]:e.stop&&(f.stop=e.stop),e.maxTokens!==void 0&&(f.max_tokens=e.maxTokens);let g=Date.now(),A={endpoint:"completions",uiKind:"ghostText",temperature:JSON.stringify(u),n:JSON.stringify(l),stop:JSON.stringify(f.stop)??"unset",logit_bias:JSON.stringify(null)};Object.assign(r.properties,A);try{let y={prompt:e.prompt,languageId:e.languageId,repoInfo:e.repoInfo,ourRequestId:e.ourRequestId,engineModelId:e.engineModelId,count:l,uiKind:"ghostText",postOptions:f,headers:e.headers,extra:d},E=await t.get(AO).fetchAndStreamCompletions(t,y,r,o,n);return E.type==="failed"?{type:"failed",reason:E.reason,telemetryData:yp(r,t)}:E.type==="canceled"?(ul.debug(t,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:E.reason,telemetryData:kH(r)}):c(g,E.getProcessingTime(),E.choices)}catch(y){if(Gm(y))return{type:"canceled",reason:"network request aborted",telemetryData:kH(r,{cancelledNetworkRequest:!0})};if(ul.exception(t,y,"Error on ghost text request"),t.get(CC).notifyUser(t,y),RCe(t))throw y;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:yp(r,t)}}}a(Qri,"genericGetCompletionsFromNetwork");function phr(t,e,r){if(r||(r=[]),t.completionText=t.completionText.trimEnd(),!!t.completionText&&r.findIndex(n=>n.completionText.trim()===t.completionText.trim())===-1)return t}a(phr,"postProcessChoices");async function uJs(t,e,r,n,o){return Qri(t,e,r,n,o,"completions",async(s,c,l)=>{let d=await l[Symbol.asyncIterator]().next();if(d.done)return ul.debug(t,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:yp(r,t)};if(n?.isCancellationRequested)return ul.debug(t,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:kH(r)};let f=d.value;if(f===void 0)return ul.debug(t,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:yp(r,t)};jri(t,"performance",f,s,c),ul.debug(t,`Awaited first result, id: ${f.choiceIndex}`);let h=phr(f,e);h&&(Ndt(t,e,h),ul.debug(t,`GhostText first completion (index ${h?.choiceIndex}): ${JSON.stringify(h?.completionText)}`));let m=(async()=>{let g=h!==void 0?[h]:[];for await(let A of l){if(A===void 0)continue;ul.debug(t,`GhostText later completion (index ${A?.choiceIndex}): ${JSON.stringify(A.completionText)}`);let y=phr(A,e,g);y&&(g.push(y),Ndt(t,e,y))}})();return O1(t)&&await m,h?{type:"success",value:[hhr(h,{forceSingleLine:!1}),m],telemetryData:yp(r,t),telemetryBlob:r,resultType:0}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:yp(r,t)}})}a(uJs,"getCompletionsFromNetwork");async function dJs(t,e,r,n,o){return Qri(t,e,r,n,o,"all completions",async(s,c,l)=>{let u=[];for await(let d of l){if(n?.isCancellationRequested)return ul.debug(t,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:kH(r)};let f=phr(d,e,u);f&&u.push(f)}if(u.length>0){for(let d of u)Ndt(t,e,d);jri(t,"cyclingPerformance",u[0],s,c)}return{type:"success",value:[u,Promise.resolve()],telemetryData:yp(r,t),telemetryBlob:r,resultType:3}})}a(dJs,"getAllCompletionsFromNetwork");function hhr(t,e){let r={...t};if(e.forceSingleLine){let{completionText:n}=r,o=n.match(/^\r?\n/);o?r.completionText=o[0]+n.split(` +`;return{lines:t.split(e),newLineCharacter:e}}a(QZs,"splitByNewLine");function qZs(t,e,r,n){let o="",s=e.line+1,c=n?r.trim():r;for(;o===""&&s0){if(r.completionText.indexOf(o)!==-1)return o.length;{let s=-1,c=0;for(let l of o){let u=r.completionText.indexOf(l,s+1);if(u>s)c++,s=u;else break}return c}}return 0}a(vni,"checkSuffix");var Tni=fe(bU());Mo();var dl=new pe("ghostText");var Cni=20;async function Ini(t,e,r,n,o,s,c){dl.debug(t,`Getting ${s} from network`),r=r.extendedBy();let l=e.isCycling?3:1,u=oue(t,l),d={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:qfn(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},f={n:l,temperature:u,code_annotations:!1},h=Rt(t,ze.ModelAlwaysTerminatesSingleline)??t.get(Jt).modelAlwaysTerminatesSingleline(r),m=e.blockMode==="moremultiline"&&lO.isSupported(e.languageId)&&!h;!e.multiline&&!m?f.stop=[` +`]:e.stop&&(f.stop=e.stop),e.maxTokens!==void 0&&(f.max_tokens=e.maxTokens);let g=Date.now(),A={endpoint:"completions",uiKind:"ghostText",temperature:JSON.stringify(u),n:JSON.stringify(l),stop:JSON.stringify(f.stop)??"unset",logit_bias:JSON.stringify(null)};Object.assign(r.properties,A);try{let y={prompt:e.prompt,languageId:e.languageId,repoInfo:e.repoInfo,ourRequestId:e.ourRequestId,engineModelId:e.engineModelId,count:l,uiKind:"ghostText",postOptions:f,headers:e.headers,extra:d},E=await t.get(bO).fetchAndStreamCompletions(t,y,r,o,n);return E.type==="failed"?{type:"failed",reason:E.reason,telemetryData:vp(r,t)}:E.type==="canceled"?(dl.debug(t,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:E.reason,telemetryData:qH(r)}):c(g,E.getProcessingTime(),E.choices)}catch(y){if(Ym(y))return{type:"canceled",reason:"network request aborted",telemetryData:qH(r,{cancelledNetworkRequest:!0})};if(dl.exception(t,y,"Error on ghost text request"),t.get(TC).notifyUser(t,y),YCe(t))throw y;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:vp(r,t)}}}a(Ini,"genericGetCompletionsFromNetwork");function Fhr(t,e,r){if(r||(r=[]),t.completionText=t.completionText.trimEnd(),!!t.completionText&&r.findIndex(n=>n.completionText.trim()===t.completionText.trim())===-1)return t}a(Fhr,"postProcessChoices");async function HZs(t,e,r,n,o){return Ini(t,e,r,n,o,"completions",async(s,c,l)=>{let d=await l[Symbol.asyncIterator]().next();if(d.done)return dl.debug(t,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:vp(r,t)};if(n?.isCancellationRequested)return dl.debug(t,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:qH(r)};let f=d.value;if(f===void 0)return dl.debug(t,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:vp(r,t)};wni(t,"performance",f,s,c),dl.debug(t,`Awaited first result, id: ${f.choiceIndex}`);let h=Fhr(f,e);h&&(Vdt(t,e,h),dl.debug(t,`GhostText first completion (index ${h?.choiceIndex}): ${JSON.stringify(h?.completionText)}`));let m=(async()=>{let g=h!==void 0?[h]:[];for await(let A of l){if(A===void 0)continue;dl.debug(t,`GhostText later completion (index ${A?.choiceIndex}): ${JSON.stringify(A.completionText)}`);let y=Fhr(A,e,g);y&&(g.push(y),Vdt(t,e,y))}})();return Q1(t)&&await m,h?{type:"success",value:[Uhr(h,{forceSingleLine:!1}),m],telemetryData:vp(r,t),telemetryBlob:r,resultType:0}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:vp(r,t)}})}a(HZs,"getCompletionsFromNetwork");async function GZs(t,e,r,n,o){return Ini(t,e,r,n,o,"all completions",async(s,c,l)=>{let u=[];for await(let d of l){if(n?.isCancellationRequested)return dl.debug(t,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:qH(r)};let f=Fhr(d,e,u);f&&u.push(f)}if(u.length>0){for(let d of u)Vdt(t,e,d);wni(t,"cyclingPerformance",u[0],s,c)}return{type:"success",value:[u,Promise.resolve()],telemetryData:vp(r,t),telemetryBlob:r,resultType:3}})}a(GZs,"getAllCompletionsFromNetwork");function Uhr(t,e){let r={...t};if(e.forceSingleLine){let{completionText:n}=r,o=n.match(/^\r?\n/);o?r.completionText=o[0]+n.split(` `)[1]:r.completionText=n.split(` -`)[0]}return r}a(hhr,"makeGhostAPIChoice");function Bri(t){return e=>{let r=e?.split(` +`)[0]}return r}a(Uhr,"makeGhostAPIChoice");function bni(t){return e=>{let r=e?.split(` `)??[];if(r.length>t+1)return r.slice(0,t+1).join(` -`).length}}a(Bri,"takeNLines");async function fJs(t,e,r,n,o,s,c,l){let u=t.get(Zt).multilineAfterAcceptLines(l),d=t.get(TP).forLanguage(t,e.textDocument.detectedLanguageId,l);switch(d){case"server":return c?{blockMode:"parsing",requestMultiline:!0,finishedCb:Bri(u),stop:[` +`).length}}a(bni,"takeNLines");async function $Zs(t,e,r,n,o,s,c,l){let u=t.get(Jt).multilineAfterAcceptLines(l),d=t.get(MP).forLanguage(t,e.textDocument.detectedLanguageId,l);switch(d){case"server":return c?{blockMode:"parsing",requestMultiline:!0,finishedCb:bni(u),stop:[` -`],maxTokens:Lri*u}:{blockMode:"server",requestMultiline:!0,finishedCb:a(f=>{},"finishedCb")};case"parsing":case"parsingandserver":case"moremultiline":default:{let f;try{f=await vJs(t,d,e.textDocument,e.position,s,c,n)}catch{f={requestMultiline:!1}}if(!c&&f.requestMultiline&&t.get(Zt).singleLineUnlessAccepted(l)&&(f.requestMultiline=!1),f.requestMultiline){let h;return n.trailingWs.length>0&&!n.prompt.prefix.endsWith(n.trailingWs)?h=gu.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):h=e.position,{blockMode:d,requestMultiline:!0,...Fri(t,d,e.textDocument,h,f.blockPosition,r,!0,n.prompt,l)}}if(c){let h={blockMode:"parsing",requestMultiline:!0,finishedCb:Bri(u),stop:[` +`],maxTokens:Cni*u}:{blockMode:"server",requestMultiline:!0,finishedCb:a(f=>{},"finishedCb")};case"parsing":case"parsingandserver":case"moremultiline":default:{let f;try{f=await eXs(t,d,e.textDocument,e.position,s,c,n)}catch{f={requestMultiline:!1}}if(!c&&f.requestMultiline&&t.get(Jt).singleLineUnlessAccepted(l)&&(f.requestMultiline=!1),f.requestMultiline){let h;return n.trailingWs.length>0&&!n.prompt.prefix.endsWith(n.trailingWs)?h=Au.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):h=e.position,{blockMode:d,requestMultiline:!0,...Sni(t,d,e.textDocument,h,f.blockPosition,r,!0,n.prompt,l)}}if(c){let h={blockMode:"parsing",requestMultiline:!0,finishedCb:bni(u),stop:[` -`],maxTokens:Lri*u};return d==="moremultiline"&&(h.blockMode="moremultiline"),h}return{blockMode:d,requestMultiline:!1,...Fri(t,d,e.textDocument,e.position,f.blockPosition,r,!1,n.prompt,l)}}}}a(fJs,"getGhostTextStrategy");function Fri(t,e,r,n,o,s,c,l,u){if(c&&e==="moremultiline"&&tO.isSupported(r.detectedLanguageId)){let d=o==="empty-block"||o==="block-end"?t.get(Zt).longLookaheadSize(u):t.get(Zt).shortLookaheadSize(u);return{finishedCb:new Flt(t,s,r.detectedLanguageId,!1,d,(h,m)=>{let g={prefix:s+h,prompt:{...l,prefix:l.prefix+h}};Ndt(t,g,m)}).getFinishedCallback(),maxTokens:t.get(Zt).maxMultilineTokens(u)}}return{finishedCb:c?lNe(t,r,n):d=>{}}}a(Fri,"buildFinishedCallback");var pJs={isCycling:!1,promptOnly:!1,isSpeculative:!1};function hJs(t,e,r){let n=Ft(t,Ye.CompletionsDebounce)??t.get(Zt).completionsDebounce(r)??e.debounceMs;if(n===void 0)return 0;let o=yl()-r.issuedTime;return Math.max(0,n-o)}a(hJs,"getRemainingDebounceMs");function ONe(t,e,r){return r?.isCancellationRequested||e!==t.get(Db).currentRequestId}a(ONe,"inlineCompletionRequestCancelled");async function mJs(t,e,r,n,o,s){let c=n.issuedTime,l=[];function u(E){let _=yl();l.push([E,_-c]),c=_}a(u,"recordPerformance"),u("telemetry");let d=t.get(Zt);if(ONe(t,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:yp(n,t)};let f=AJs(e.textDocument,e.position);if(f===void 0)return ul.debug(t,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:yp(n,t)};let h=mQ(t,n),m={...pJs,...s,tokenizer:h.tokenizer},g=await Rme(t,r,e,n,void 0,m);if(u("prompt"),g.type==="copilotContentExclusion")return ul.debug(t,"Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:yp(n,t)};if(g.type==="contextTooShort")return ul.debug(t,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:yp(n,t)};if(g.type==="promptError")return ul.debug(t,"Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:yp(n,t)};if(m.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:g};if(g.type==="promptCancelled")return ul.debug(t,"Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:yp(n,t)};if(g.type==="promptTimeout")return ul.debug(t,"Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:yp(n,t)};if(g.prompt.prefix.length===0&&g.prompt.suffix.length===0)return ul.debug(t,"Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:yp(n,t)};let A=hJs(t,m,n);return A>0&&(ul.debug(t,`Debouncing ghost text request for ${A}ms`),await bC(A),ONe(t,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:yp(n,t)}:t.get(ps).trackCompletionJob(async()=>{let[E]=FH(e.textDocument.getText(gu.range(gu.position(0,0),e.position))),_=t.get(Db).hasAcceptedCurrentCompletion(E,g.prompt.suffix),v=g.prompt,b=await fJs(t,e,E,g,m.isCycling,f,_,n);u("strategy");let T=gJs(t,E,v,b.requestMultiline);u("cache");let w=gQ(t,e.textDocument.uri),R={blockMode:b.blockMode,languageId:e.textDocument.detectedLanguageId,repoInfo:w,engineModelId:h.modelId,ourRequestId:r,prefix:E,prompt:g.prompt,multiline:b.requestMultiline,indentation:Jlt(e.textDocument,e.position),isCycling:m.isCycling,headers:h.headers,stop:b.stop,maxTokens:b.maxTokens,afterAccept:_};R.headers={...R.headers,"X-Copilot-Async":"true","X-Copilot-Speculative":m.isSpeculative?"true":"false"};let x=IJs(t,e.textDocument,R,e.position,g,n,h,m);if(T===void 0&&!m.isCycling&&t.get(Pb).shouldWaitForAsyncCompletions(E,g.prompt)){let j=await t.get(Pb).getFirstMatchingRequestWithTimeout(r,E,g.prompt,m.isSpeculative,x);if(u("asyncWait"),j){let Q=!b.requestMultiline;T=[[hhr(j[0],{forceSingleLine:Q})],4]}if(ONe(t,r,o))return ul.debug(t,"Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:yp(x,t)}}let P=b.blockMode==="moremultiline"&&tO.isSupported(e.textDocument.detectedLanguageId);if(T!==void 0&&(T[0]=T[0].map(j=>MNe(t,e.textDocument,e.position,j,P,ul)).filter(j=>j!==void 0)),T!==void 0&&T[0].length===0)return ul.debug(t,`Found empty inline suggestions locally via ${rme(T[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:yp(x,t)};if(T!==void 0&&T[0].length>0&&(!m.isCycling||T[0].length>1))ul.debug(t,`Found inline suggestions locally via ${rme(T[1])}`);else{if(m.isCycling){let j=await dJs(t,R,x,o,b.finishedCb);if(j.type==="success"){let Q=T?.[0]??[];j.value[0].forEach(U=>{Q.findIndex(Y=>Y.completionText.trim()===U.completionText.trim())===-1&&Q.push(U)}),T=[Q,3]}else if(T===void 0)return j}else{let j=a((W,V)=>(t.get(Pb).updateCompletion(r,W),b.finishedCb(W,V)),"finishedCb"),Q=new Fn.CancellationTokenSource,U=uJs(t,R,x,Q.token,j);t.get(Pb).queueCompletionRequest(r,E,g.prompt,Q,U);let Y=await t.get(Pb).getFirstMatchingRequest(r,E,g.prompt,m.isSpeculative);if(Y===void 0)return{type:"empty",reason:"received no results from async completions",telemetryData:yp(x,t)};T=[[Y[0]],4]}u("network")}if(T===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:yp(x,t)};let[D,N]=T,L=D.map(j=>MNe(t,e.textDocument,e.position,j,P,ul)).filter(j=>j!==void 0),B=Ft(t,Ye.CompletionsDelay)??d.completionsDelay(n),q=yl()-n.issuedTime,M=Math.max(B-q,0);if(N!==2&&!m.isCycling&&M>0&&(ul.debug(t,`Waiting ${M}ms before returning completion`),await bC(M),ONe(t,r,o)))return ul.debug(t,"Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:kH(x)};let O=[];for(let j of L){let Q=TJs(t,e.textDocument,R,j,x),U=f?Ori(e.textDocument,e.position,j):0,W={completion:CJs(j.choiceIndex,j.completionText,g.trailingWs),telemetry:Q,isMiddleOfTheLine:f,suffixCoverage:U,copilotAnnotations:j.copilotAnnotations,clientCompletionId:j.clientCompletionId};O.push(W)}return x.properties.clientCompletionId=O[0]?.clientCompletionId,x.measurements.foundOffset=O?.[0]?.telemetry?.measurements?.foundOffset??-1,ul.debug(t,`Produced ${O.length} results from ${rme(N)} at ${x.measurements.foundOffset} offset`),ONe(t,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:kH(x)}:(m.isSpeculative||t.get(Db).setGhostText(E,g.prompt.suffix,L,N),u("complete"),{type:"success",value:[O,N],telemetryData:yp(x,t),telemetryBlob:x,resultType:N,performanceMetrics:l})})}a(mJs,"getGhostTextWithoutAbortHandling");async function mhr(t,e,r,n){let o=Mt();t.get(Db).currentRequestId=o;let s=await SJs(t,e.textDocument,o,n);await hQ().catch(()=>{});try{return t.get(Nb).schedule(e,o,n?.opportunityId??"",s,r,n),t.get(t4).notifyRequest(e,o,s,r,n),await mJs(t,e,o,s,r,n)}catch(c){if(Gm(c))return{type:"canceled",reason:"aborted at unknown location",telemetryData:kH(s,{cancelledNetworkRequest:!0})};throw c}}a(mhr,"getGhostText");function gJs(t,e,r,n){let o=t.get(Db).getCompletionsForUserTyping(e,r.suffix),s=bJs(t,e,r.suffix,n);if(o&&o.length>0){let c=(s??[]).filter(l=>!o.some(u=>u.completionText===l.completionText));return[o.concat(c),2]}if(s&&s.length>0)return[s,1]}a(gJs,"getLocalInlineSuggestion");function AJs(t,e){let r=yJs(e,t),n=EJs(e,t);return r&&!n?void 0:r&&n}a(AJs,"isInlineSuggestion");function yJs(t,e){return e.lineAt(t).text.substr(t.character).trim().length!=0}a(yJs,"isMiddleOfTheLine");function EJs(t,e){let n=e.lineAt(t).text.substr(t.character).trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(n)}a(EJs,"isValidMiddleOfTheLinePosition");function _Js(t,e){return e.lineAt(t).text.trim().length===0}a(_Js,"isNewLine");var I8=class t{constructor(e=!1){this.requestMultilineOverride=e}static{a(this,"ForceMultiLine")}static{this.default=new t}};async function vJs(t,e,r,n,o,s,c){if(t.get(I8).requestMultilineOverride)return{requestMultiline:!0};if(r.lineCount>=8e3)Et(t,"ghostText.longFileMultilineSkip",Wt.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e=="moremultiline"&&tO.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await Ndn(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&_Js(n,r))return{requestMultiline:!0};let u=!1;return!o&&kS(r.detectedLanguageId)?u=await Klt(r,n):o&&kS(r.detectedLanguageId)&&(u=await Klt(r,n)||await Klt(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=RXn(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(vJs,"shouldRequestMultiline");function Ndt(t,e,r){t.get(q2).append(e.prefix,e.prompt.suffix,r)}a(Ndt,"appendToCache");function CJs(t,e,r){if(r.length>0){if(e.startsWith(r))return{completionIndex:t,completionText:e,displayText:e.substring(r.length),displayNeedsWsOffset:!1};{let n=e.substring(0,e.length-e.trimStart().length);return r.startsWith(n)?{completionIndex:t,completionText:e,displayText:e.trimStart(),displayNeedsWsOffset:!0}:{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}}else return{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}a(CJs,"adjustLeadingWhitespace");function bJs(t,e,r,n){let o=t.get(q2).findAll(e,r);return o.length===0?(ul.debug(t,"Found no completions in cache"),[]):(ul.debug(t,`Found ${o.length} completions in cache`),o.map(s=>hhr(s,{forceSingleLine:!n})))}a(bJs,"getCompletionsFromCache");async function SJs(t,e,r,n){let o={headerRequestId:r};n?.opportunityId&&(o.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(o.completionsActive="true"),n?.isSpeculative&&(o.reason="speculative");let s=Wt.createAndMarkAsIssued(o);return await t.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},s)}a(SJs,"createTelemetryWithExp");function TJs(t,e,r,n,o){let s=n.requestId,c={choiceIndex:n.choiceIndex.toString(),clientCompletionId:n.clientCompletionId};n.generatedChoiceIndex!==void 0&&(c.originalChoiceIndex=c.choiceIndex,c.choiceIndex=(1e4*(n.generatedChoiceIndex+1)+n.choiceIndex).toString());let l={compCharLen:n.completionText.length,numLines:n.completionText.trim().split(` -`).length};n.meanLogProb&&(l.meanLogProb=n.meanLogProb),n.meanAlternativeLogProb&&(l.meanAlternativeLogProb=n.meanAlternativeLogProb);let u=n.telemetryData.extendedBy(c,l);return u.issuedTime=o.issuedTime,u.measurements.timeToProduceMs=performance.now()-o.issuedTime,qri(u,e),u.extendWithRequestId(s),u.measurements.confidence=Nri(t,u),u.measurements.quantile=Mri(t,u),ul.debug(t,`Extended telemetry for ${n.telemetryData.properties.headerRequestId} with retention confidence ${u.measurements.confidence} (expected as good or better than about ${u.measurements.quantile} of all suggestions)`),u}a(TJs,"telemetryWithAddData");function IJs(t,e,r,n,o,s,c,l){let u={languageId:e.detectedLanguageId};u.afterAccept=r.afterAccept.toString(),u.isSpeculative=l.isSpeculative.toString();let d=s.extendedBy(u);qri(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===0?"pending":"available",f!==void 0&&f!==0&&(d.properties.gitRepoUrl=f.url,d.properties.gitRepoHost=f.hostname,d.properties.gitRepoOwner=f.owner,d.properties.gitRepoName=f.repo,d.properties.gitRepoPath=f.pathname),d.properties.engineName=c.modelId,d.properties.engineChoiceSource=c.engineChoiceSource,d.properties.isMultiline=JSON.stringify(r.multiline),d.properties.isCycling=JSON.stringify(r.isCycling);let h=e.lineAt(n.line),m=e.getText(gu.range(h.range.start,n)),g=e.getText(gu.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,Uri.SHA256)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...Ese(o.prompt),promptEndPos:e.offsetAt(n),promptComputeTimeMs:o.computeTimeMs};o.metadata&&(y.promptMetadata=JSON.stringify(o.metadata)),o.contextProvidersTelemetry&&(y.contextProviders=JSON.stringify(o.contextProvidersTelemetry));let _=d.extendedBy(y,E);return Et(t,"ghostText.issued",_),d}a(IJs,"telemetryIssued");function qri(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(qri,"addDocumentTelemetry");function jri(t,e,r,n,o){let s=Date.now()-n,c=s-o,l=r.telemetryData.extendedBy({},{completionCharLen:r.completionText.length,requestTimeMs:s,processingTimeMs:o,deltaMs:c,meanLogProb:r.meanLogProb||NaN,meanAlternativeLogProb:r.meanAlternativeLogProb||NaN});l.extendWithRequestId(r.requestId),Et(t,`ghostText.${e}`,l)}a(jri,"telemetryPerformance");p();p();var fee=class{constructor(e,r,n){this._referenceCount=0;this._isDisposed=!1;this._offset=n;let o=e.get($r);this._tracker=o.onDidChangeTextDocument(s=>{if(s.document.uri===r){for(let c of s.contentChanges)if(c.rangeOffset+c.rangeLength<=this.offset){let l=c.text.length-c.rangeLength;this._offset=this._offset+l}}})}static{a(this,"ChangeTracker")}get offset(){return this._offset}push(e,r){if(this._isDisposed)throw new Error("Unable to push new actions to a disposed ChangeTracker");this._referenceCount++,setTimeout(()=>{e(),this._referenceCount--,this._referenceCount===0&&(this._tracker.dispose(),this._isDisposed=!0)},r)}};p();var jT=class{static{a(this,"CitationManager")}},Mdt=class extends jT{static{a(this,"NoOpCitationManager")}async handleIPCodeCitation(e,r){}};p();var ghr=class t{constructor(e,r,n=[],o,s,c){this._textDocument=e;this._position=r;this.originalPosition=o??Fn.Position.create(r.line,r.character),this.originalVersion=s??e.version,this.originalOffset=c??e.offsetAt(this.originalPosition),this._editsWithPosition=[...n]}static{a(this,"CompletionState")}get textDocument(){return this._textDocument}get position(){return this._position}get editsWithPosition(){return[...this._editsWithPosition]}updateState(e,r,n){return new t(e,r,n??this.editsWithPosition,this.originalPosition,this.originalVersion,this.originalOffset)}updatePosition(e){return this.updateState(this._textDocument,e)}addSelectedCompletionInfo(e){if(this.editsWithPosition.find(n=>n.source==="selectedCompletionInfo"))throw new Error("Selected completion info already applied");let r={range:e.range,newText:e.text};return this.applyEdits([r],!0)}applyEdits(e,r=!1){if(r&&e.length>1)throw new Error("Selected completion info should be a single edit");let n=this._textDocument,o=this._position,s=n.offsetAt(o),c=this.editsWithPosition;for(let{range:l,newText:u}of e){let d=n.getText(l),f=n.offsetAt(l.end);if(n=n.applyEdits([{range:l,newText:u}]),s{let v=Ldt.indexOf(_);v!==-1&&Ldt.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of Ldt)_()}a(e,"afterUpdateConnection");function r(_){Y2.connection!==_&&(Y2.connection=_,e())}a(r,"updateConnection");function n(){return Y2.connection==="connected"}a(n,"isConnected");function o(){return Y2.connection==="disconnected"}a(o,"isDisconnected");function s(){return Y2.connection==="retry"}a(s,"isRetrying");function c(){return Y2.connection==="disabled"}a(c,"isDisabled");function l(){r("connected"),h(!1)}a(l,"setConnected");function u(){r("disconnected")}a(u,"setDisconnected");function d(){r("retry")}a(d,"setRetrying");function f(){r("disabled")}a(f,"setDisabled");function h(_){Y2.initialWait!==_&&(Y2.initialWait=_)}a(h,"setInitialWait");function m(_,v=xJs){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return Y2.initialWait}a(g,"isInitialWait");async function A(_,v){Ob.info(_,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);let b=_.get(tr);function T(w,R){if(w>Gri){Ob.info(R,"Max retry time reached, disabling."),f();return}let x=a(async()=>{Y2.retryAttempts=Math.min(Y2.retryAttempts+1,$ri);try{Ob.info(R,`Pinging service after ${w} second(s)`);let P=await b.fetch(new URL("_ping",bB(R)["origin-tracker"]).href,{method:"GET",headers:{"content-type":"application/json"}});if(P.status!==200||!P.ok)T(w**2,R);else{Ob.info(R,"Successfully reconnected."),l();return}}catch{T(w**2,R)}},"tryAgain");setTimeout(()=>{x()},w*1e3)}a(T,"succeedOrRetry"),Ob.info(_,"Attempting to reconnect."),T(Ahr,_)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),Odt={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},Odt}a(wJs,"registerConnectionState");var hee=wJs();p();var qg={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"},LNe={[qg.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[qg.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[qg.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function yhr(t){return t===401?qg.Unauthorized:t===400?qg.BadArguments:t===404?qg.NotFound:t===429?qg.RateLimit:t>=500&&t<600?qg.InternalError:t>=600?qg.ConnectionError:qg.Unknown}a(yhr,"getErrorType");function g4(t,e,r={}){return{kind:"failure",reason:yhr(Number(t)),code:Number(t),msg:e,meta:r}}a(g4,"createErrorResponse");p();var RJs=/^[1-6][0-9][0-9]$/,kJs=/([A-Z][a-z]+)/,PJs="code_referencing",BNe=class{constructor(e){this.baseKey=e}static{a(this,"CodeQuoteTelemetry")}buildKey(...e){return[PJs,this.baseKey,...e].join(".")}},Ehr=class extends BNe{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({context:e}){let r=this.buildKey("open","count"),n=Wt.createAndMarkAsIssued();Et(e,r,n)}handleFocus({context:e}){let r=Wt.createAndMarkAsIssued(),n=this.buildKey("focus","count");Et(e,n,r)}handleWrite({context:e}){let r=Wt.createAndMarkAsIssued(),n=this.buildKey("write","count");Et(e,n,r)}},v$f=new Ehr,_hr=class extends BNe{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({context:e,actor:r}){let n=Wt.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");Et(e,o,n)}handleDismiss({context:e,actor:r}){let n=Wt.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");Et(e,o,n)}},C$f=new _hr,vhr=class extends BNe{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({context:e,origin:r,reason:n}){let o=Wt.createAndMarkAsIssued({origin:r,reason:n});eg(e,this.buildKey("unexpectedError"),o)}handleCompletionMissing({context:e,origin:r,reason:n}){let o=Wt.createAndMarkAsIssued({origin:r,reason:n});eg(e,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({context:e,origin:r,reason:n,message:o}){if(!r.match(RJs)){Ob.debug(e,"Invalid status code, not sending telemetry",{origin:r});return}let s=n.split(kJs).filter(l=>!!l).join("_").toLowerCase(),c=Wt.createAndMarkAsIssued({message:o});eg(e,this.buildKey(s,r),c)}},Bdt=new vhr;var DJs="twirp/github.snippy.v1.SnippyAPI";async function Chr(t,e,r,n){let o;try{o=await t.get(Qt).getToken()}catch{return hee.setDisconnected(),g4(401,LNe[qg.Unauthorized])}if(Ob.info(t,`Calling ${e}`),hee.isRetrying())return g4(600,"Attempting to reconnect to the public code matching service.");if(hee.isDisconnected())return g4(601,"The public code matching service is offline.");let s;try{s=await t.get(tr).fetch(tx(t,o,"origin-tracker",`${DJs}/${e}`),{method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...Gy(t)},signal:n})}catch{return hee.enableRetry(t),g4(602,"Network error detected. Check your internet connection.")}!s.ok&&(s.status===401||s.status===403)&&t.get(Qt).resetToken("snippy",s.status);let c;try{c=await s.json()}catch(A){let y=A.message;throw Bdt.handleUnexpectedError({context:t,origin:"snippyNetwork",reason:y}),A}if(s.ok)return{kind:"success",...c};let l={...c,code:Number(s.status)},{code:u,msg:d,meta:f}=l,h=Number(u),m=yhr(h),g=d||"unknown error";switch(m){case qg.Unauthorized:return g4(u,LNe[qg.Unauthorized],f);case qg.BadArguments:return g4(u,g,f);case qg.RateLimit:return hee.enableRetry(t,60*1e3),g4(u,LNe.RateLimitError,f);case qg.InternalError:return hee.enableRetry(t),g4(u,LNe[qg.InternalError],f);default:return g4(u,g,f)}}a(Chr,"call");p();var Fdt=S.Object({kind:S.Literal("failure"),reason:S.String(),code:S.Number(),msg:S.String(),meta:S.Optional(S.Any())}),MJs=S.Object({matched_source:S.String(),occurrences:S.String(),capped:S.Boolean(),cursor:S.String(),github_url:S.String()}),Vri=S.Object({source:S.String()}),OJs=S.Object({snippets:S.Array(MJs)}),Wri=S.Union([OJs,Fdt]),zri=S.Object({cursor:S.String()}),LJs=S.Object({commit_id:S.String(),license:S.String(),nwo:S.String(),path:S.String(),url:S.String()}),BJs=S.Object({has_next_page:S.Boolean(),cursor:S.String()}),FJs=S.Object({count:S.Record(S.String(),S.String())}),UJs=S.Object({file_matches:S.Array(LJs),page_info:BJs,license_stats:FJs}),Yri=S.Union([UJs,Fdt]);async function Kri(t,e,r){let n=await Chr(t,"Match",{method:"POST",body:mK(Vri,{source:e})},r);return mK(Wri,n)}a(Kri,"Match");async function Jri(t,{cursor:e},r){let n=await Chr(t,"FilesForMatch",{method:"POST",body:mK(zri,{cursor:e})},r);return mK(Yri,n)}a(Jri,"FilesForMatch");p();var FNe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu"),Udt=65;function jJs(t){let e=0,r;FNe.lastIndex=0;do if(r=FNe.exec(t),r&&(e+=1),e>=Udt)break;while(r);return e}a(jJs,"lexemeLength");function HJs(t,e){let r=0,n;FNe.lastIndex=0;do if(n=FNe.exec(t),n&&(r+=1,r>=e))return FNe.lastIndex;while(n);return t.length}a(HJs,"offsetFirstLexemes");function Zri(t,e){let r=t.split("").reverse().join(""),n=HJs(r,e);return r.length-n}a(Zri,"offsetLastLexemes");function UNe(t){return jJs(t)>=Udt}a(UNe,"hasMinLexemeLength");function $Js(t){return XM.Check(Fdt,t)}a($Js,"isError");async function Xri(t,e){let r=await e();if($Js(r)){Bdt.handleSnippyNetworkError({context:t,origin:String(r.code),reason:r.reason,message:r.msg});return}return r}a(Xri,"snippyRequest");function eni(t){return"kind"in t&&t.kind==="failure"}a(eni,"isMatchError");async function tni(t,e,r,n){let s=await t.get($r).getTextDocument({uri:e});if(!s){Ob.debug(t,`Expected document matching ${e}, got nothing.`);return}let c=s.getText();if(!UNe(c)||!UNe(c))return;let l=r;if(!UNe(r)){let g=c.slice(0,n),A=Zri(g,Udt);l=c.slice(A,n+r.length)}if(!UNe(l))return;let u=await Xri(t,()=>Kri(t,l));if(!u||eni(u)||!u.snippets.length){Ob.info(t,"No match found");return}Ob.info(t,"Match found");let{snippets:d}=u,f=d.map(async g=>{let A=await Xri(t,()=>Jri(t,{cursor:g.cursor}));if(!A||eni(A))return;let y=A.file_matches,E=A.license_stats;return{match:g,files:y,licenseStats:E}}),m=(await Promise.all(f)).filter(g=>g!==void 0);if(m.length)for(let g of m){let A=new Set(Object.keys(g.licenseStats?.count??{}));A.has("NOASSERTION")&&(A.delete("NOASSERTION"),A.add("unknown"));let y=Array.from(A).sort(),E=n,_=n+g.match.matched_source.length,v=s.positionAt(E),b=s.positionAt(_);await t.get(jT).handleIPCodeCitation(t,{inDocumentUri:e,offsetStart:E,offsetEnd:_,version:s.version,location:{start:v,end:b},matchingText:l,details:y.map(T=>({license:T,url:g.match.github_url}))})}}a(tni,"fetchCitations");p();function bhr(t,e,r=(n,o)=>n===o?0:1){if(e.length===0||t.length===0)return{distance:e.length,startOffset:0,endOffset:0};let n=new Array(e.length+1).fill(0),o=new Array(e.length+1).fill(0),s=new Array(t.length+1).fill(0),c=new Array(t.length+1).fill(0),l=e[0];for(let d=0;d0?d-1:0;for(let d=1;d(l[l.Word=0]="Word",l[l.Space=1]="Space",l[l.Other=2]="Other"))(r||={});let n=0;for(let o of t){let s;new RegExp("(\\p{L}|\\p{Nd}|_)","u").test(o)?s=0:o===" "?s=1:s=2,s===n&&s!==2?e+=o:(e.length>0&&(yield e),e=o,n=s)}e.length>0&&(yield e)}a(zJs,"lexGeneratorWords");function rni(t,e,r,n){let o=[],s=0;for(let c of r(t))n(c)&&(e.has(c)||e.set(c,e.size),o.push([e.get(c),s])),s+=c.length;return[o,e]}a(rni,"lexicalAnalyzer");function nni(t){return t!==" "}a(nni,"notSingleSpace");function ini(t,e,r=zJs){let[n,o]=rni(t,VJs(),r,nni),[s,c]=rni(e,o,r,nni);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=WJs(c),u=s.length,d=l[s[0][0]],f=l[s[u-1][0]];function h(y,E,_,v){if(v===0||v===u-1){let b=l[n[_][0]];return v==0&&b.endsWith(d)||v==u-1&&b.startsWith(f)?0:1}else return y===E?0:1}a(h,"compare");let m=bhr(n.map(y=>y[0]),s.map(y=>y[0]),h),g=n[m.startOffset][1],A=m.endOffset0&&t[A-1]===" "&&--A,{lexDistance:m.distance,startOffset:g,endOffset:A,haystackLexLength:n.length,needleLexLength:s.length}}a(ini,"lexEditDistance");p();function UH(t){return t.length===0?0:t.split(` -`).length}a(UH,"countLines");function oni(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(oni,"computeCompletionText");var QH=new fe("postInsertion"),sni=[{seconds:15,captureCode:!1,captureRejection:!1},{seconds:30,captureCode:!0,captureRejection:!0},{seconds:120,captureCode:!1,captureRejection:!1},{seconds:300,captureCode:!1,captureRejection:!1},{seconds:600,captureCode:!1,captureRejection:!1}],ani=50,YJs=1500,KJs=.5,JJs=500,Shr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function cni(t,e,r,n,o){let s=await t.get(ii).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(s.status!=="valid")return QH.info(t,`Could not get document for ${e}. Maybe it was closed by the editor.`),{prompt:{prefix:"",suffix:"",isFimEnabled:!1},capturedCode:"",terminationOffset:0};let c=s.document,l=c.getText(),u=l.substring(0,n),d=c.positionAt(n),f=await Rme(t,r.properties.headerRequestId,pee(c,d),r),h=f.type==="prompt"?f.prompt:{prefix:u,suffix:"",isFimEnabled:!1};if(h.isFimEnabled&&o!==void 0){let m=l.substring(n,o);return h.suffix=l.substring(o),{prompt:h,capturedCode:m,terminationOffset:0}}else{let m=l.substring(n),g=jfr(u,n,c.detectedLanguageId),y=eei(g,void 0)(m),E=Math.min(l.length,n+(y?y*2:JJs)),_=l.substring(n,E);return{prompt:h,capturedCode:_,terminationOffset:y??-1}}}a(cni,"captureCode");function Qdt(t,e,r,n,o){o.forEach(({completionText:u,completionTelemetryData:d})=>{QH.debug(t,`${e}.rejected choiceIndex: ${d.properties.choiceIndex}`),PXn(t,e,d)});let s=new fee(t,n,r-1),c=new fee(t,n,r),l=a(async u=>{QH.debug(t,`Original offset: ${r}, Tracked offset: ${s.offset}`);let{completionTelemetryData:d}=o[0],{prompt:f,capturedCode:h,terminationOffset:m}=await cni(t,n,d,s.offset+1,c.offset),g={hypotheticalPromptJson:JSON.stringify({prefix:f.prefix,context:f.context}),hypotheticalPromptSuffixJson:JSON.stringify(f.suffix)},A=d.extendedBy({...g,capturedCodeJson:JSON.stringify(h)},{timeout:u.seconds,insertionOffset:r,trackedOffset:s.offset,terminationOffsetInCapturedCode:m});QH.debug(t,`${e}.capturedAfterRejected choiceIndex: ${d.properties.choiceIndex}`,A),Et(t,e+".capturedAfterRejected",A,1)},"checkInCode");sni.filter(u=>u.captureRejection).map(u=>s.push(z0(t,()=>l(u),"postRejectionTasks"),u.seconds*1e3))}a(Qdt,"postRejectionTasks");function QNe(t,e,r,n,o,s,c,l){let u=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});QH.debug(t,`${e}.accepted choiceIndex: ${u.properties.choiceIndex}`),kXn(t,e,u);let d=r;r=oni(r,c);let f=r.trim(),h=new fee(t,o,n),m=new fee(t,o,n+r.length),g=a(async A=>{await tZs(t,e,f,n,o,A,u,h,m)},"stillInCodeCheck");if(Shr.triggerPostInsertionSynchroneously&&O1(t)){let A=g({seconds:0,captureCode:Shr.captureCode,captureRejection:Shr.captureRejection});t.get(xd).register(A)}else sni.map(A=>h.push(z0(t,()=>g(A),"postInsertionTasks"),A.seconds*1e3));z0(t,ZJs,"post insertion citation check")(t,o,d,r,n,l)}a(QNe,"postInsertionTasks");async function ZJs(t,e,r,n,o,s){if(!s||(s.ip_code_citations?.length??0)<1){if(rx(t)?.getTokenValue("sn")==="1")return;await tni(t,e,n,o);return}let c=await t.get($r).getTextDocument({uri:e});if(c){let l=Thr(c.getText(),n,ani,o);l.stillInCodeHeuristic&&(o=l.foundOffset)}for(let l of s.ip_code_citations){let u=XJs(r.length,n.length,l.start_offset);if(u===void 0){QH.info(t,`Full completion for ${e} contains a reference matching public code, but the partially inserted text did not include the match.`);continue}let d=o+u,f=c?.positionAt(d),h=o+eZs(r.length,n.length,l.stop_offset),m=c?.positionAt(h),g=f&&m?c?.getText({start:f,end:m}):"";await t.get(jT).handleIPCodeCitation(t,{inDocumentUri:e,offsetStart:d,offsetEnd:h,version:c?.version,location:f&&m?{start:f,end:m}:void 0,matchingText:g,details:l.details.citations})}}a(ZJs,"citationCheck");function XJs(t,e,r){if(!(ee))return r}a(XJs,"computeCitationStart");function eZs(t,e,r){return e{if(r.displayText&&r.telemetry){let n,o;t.partiallyAcceptedLength?(n=r.displayText.substring(t.partiallyAcceptedLength-1),o=r.telemetry.extendedBy({compType:"partial"},{compCharLen:n.length})):(n=r.displayText,o=r.telemetry);let s={completionText:n,completionTelemetryData:o,offset:r.offset};e.push(s)}}),e}a(iZs,"computeRejectedCompletions");function Ihr(t,e){let r=t.get(iy);if(!r.position||!r.uri)return;let n=iZs(r);n.length>0&&Qdt(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(Ihr,"rejectLastShown");function lni(t,e,r,n){let o=t.get(iy);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==2&&Ihr(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(lni,"setLastShown");function uni(t,e){let r=t.get(iy);if(r.index=e.index,!r.shownCompletions.find(n=>n.index===e.index)&&(e.uri===r.uri&&r.position?.line===e.position.line&&r.position?.character==e.position.character&&r.shownCompletions.push(e),e.displayText)){let n=e.resultType!==0;nZs.debug(t,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${n}`),e.telemetry.measurements.compCharLen=e.displayText.length,Qlt(t,"ghostText",e)}}a(uni,"handleGhostTextShown");function oZs(t,e,r){let n=t.get(iy);n.linesLeft===void 0&&(n.linesAccepted=UH(e.insertText.substring(0,r)),n.linesLeft=UH(e.displayText));let o=UH(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(oZs,"handleLineAcceptance");function Pme(t,e,r="ghostText"){let n=t.get(iy),o;return n.partiallyAcceptedLength?o={compType:"full",acceptedLength:(n.partiallyAcceptedLength||0)+e.displayText.length,acceptedLines:n.linesAccepted+(n.linesLeft??0)}:o={compType:"full",acceptedLength:e.displayText.length,acceptedLines:UH(e.displayText)},n.resetState(),QNe(t,r,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(Pme,"handleGhostTextPostInsert");function qdt(t,e,r,n=0,o="ghostText",s="line"){let c=t.get(iy),l;return s==="cumulative"?(sZs(t,e,r),l={compType:c.totalLength!=null?"full":"partial",acceptedLength:c.totalLength??(c.partiallyAcceptedLength||0),acceptedLines:c.linesAccepted},l.compType==="full"&&c.resetState()):(oZs(t,e,r),l={compType:"partial",acceptedLength:c.partiallyAcceptedLength||0,acceptedLines:c.linesAccepted}),QNe(t,o,e.displayText,e.offset,e.uri,e.telemetry,l,e.copilotAnnotations)}a(qdt,"handlePartialGhostTextPostInsert");function sZs(t,e,r){let n=t.get(iy);n.partiallyAcceptedLength=(n.partiallyAcceptedLength||0)+r,n.linesAccepted=UH(e.insertText.substring(0,n.partiallyAcceptedLength)),n.partiallyAcceptedLength>=e.insertText.length&&(n.totalLength=n.partiallyAcceptedLength)}a(sZs,"handleCumulativeAcceptance");p();var A4=new Map;A4.set("copilot",{app:"copilot-client",catalog_service:"CopilotCompletionsVSCode"});A4.set("copilot-intellij",{app:"copilot-intellij",catalog_service:"CopilotIntelliJ"});A4.set("copilot-xcode",{app:"copilot-xcode",catalog_service:"CopilotXcode"});A4.set("copilot-eclipse",{app:"copilot-eclipse",catalog_service:"CopilotEclipse"});A4.set("copilot.vim",{app:"copilot-vim",catalog_service:"CopilotVim"});A4.set("copilot-vs",{app:"copilot-vs",catalog_service:"CopilotVS"});var aZs=new fe("sdk");function jdt(t,e){A4.has(t.get(Ir).getEditorPluginInfo().name)||aZs.warn(t,...e)}a(jdt,"deprecationWarning");var wYi=de(AP()),TI=de(PP());p();p();p();p();var Hdt={NewGitHubLogin:"auth.new_github_login",GitHubLoginResult:"auth.github_login_result",CodeFlowInnerError:"auth.code_flow_inner_error"};function Dme(t,e){let r=Wt.createAndMarkAsIssued({authType:e});Et(t,Hdt.NewGitHubLogin,r),At(t,Hdt.NewGitHubLogin,{authType:e})}a(Dme,"telemetryNewGitHubLogin");function K2(t,e,r,n,o){Vn(t,Hdt.GitHubLoginResult,o,{authType:e,authStatus:r},{totalTimeMs:n})}a(K2,"telemetryGitHubLoginResult");function qNe(t,e,r){Vn(t,Hdt.CodeFlowInnerError,e,{loopbackServerPath:r??""})}a(qNe,"telemetryCodeFlowError");var dni=["repo","workflow"],xhr=class extends yi{static{a(this,"DeviceFlowError")}constructor(e){super(e.error_description),this.code=e.error,this.uri=e.error_uri,this.name="DeviceFlowError"}};async function cZs(t,e,{serverUrl:r}){let n={method:"POST",headers:{Accept:"application/json",...Gy(t)},json:{client_id:e,scope:dni.join(" ")},timeout:3e4},o,s=new URL("login/device/code",r).href;try{o=await t.get(tr).fetch(s,n)}catch(c){throw c instanceof Error&&XI(c)?new yi(`Could not log in with device flow on ${r}: ${c.message}`):c}if(!o.ok)throw new yi(`Could not log in with device flow on ${r}: HTTP ${o.status}`);return await o.json()}a(cZs,"requestDeviceFlowStage1");async function lZs(t,e,r,{serverUrl:n}){let o={method:"POST",headers:{Accept:"application/json",...Gy(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s=await t.get(tr).fetch(new URL("login/oauth/access_token",n).href,o),c=await s.json();if(c.access_token||c.error==="authorization_pending"||c.error==="slow_down")return c;throw c.error&&c.error_description?new xhr(c):new yi(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(lZs,"requestDeviceFlowStage2");async function uZs(t,e){let n=await(await Gf(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new yi(`Error retrieving user information: ${String(n.errors)}`);return n}a(uZs,"requestUserInfo");var HT=class{constructor(e){this.ctx=e;this.pendingSignIn=void 0}static{a(this,"GitHubDeviceFlow")}get authManager(){return this.ctx.get(Ur)}async save(e){let r=new URL(e.serverUrl).hostname;return await this.authManager.signInEditor({accessToken:e.accessToken,user:e.login,githubAppId:e.githubAppId,authAuthority:r,scopes:e.scopes})}async initiate(e,r){let n=e?.githubAppId??this.ctx.get(zp).findAppIdToAuthenticate();r??=this.authManager.getConfiguredUrls();let o=performance.now(),s=a(()=>performance.now()-o,"getElapsedTimeMs");try{let c=await this.getTokenUnguarded(n,r),l=c.waitForAuth.then(async u=>{this.ctx.get(zp).githubAppId=n;let d=await this.save(u);return K2(this.ctx,"deviceFlow",d.status,s()),d});return l.catch(u=>{K2(this.ctx,"deviceFlow","NotSignedIn",s(),u)}),this.pendingSignIn={verificationUri:c.verification_uri,status:l},c}catch(c){throw K2(this.ctx,"deviceFlow","NotSignedIn",s(),c),this.ctx.get(CC).notifyUser(this.ctx,c),c}}async getTokenUnguarded(e,r){let n=this.ctx;Dme(n,"deviceFlow");let o=await cZs(n,e,r),s=(async()=>{let c=o.expires_in,l=o.interval,u;do{await new Promise(f=>setTimeout(f,1e3*l)),u=await lZs(n,o.device_code,e,r),c-=l;let d=u.access_token;if(d){let f=await uZs(n,{...r,accessToken:d}),h=u.scope?u.scope.split(" ").filter(m=>m.length>0):dni;return{...r,githubAppId:e,login:f.login,accessToken:d,scopes:h}}l=u.interval??l}while(c>0);throw new yi(`Timed out polling for access token. Last response was ${JSON.stringify(u)}`)})();return{...o,waitForAuth:s}}};var whr=de(ri());p();var cR=class{constructor(e){this.ctx=e}static{a(this,"AbstractCommand")}};var Gdt="github.copilot.finishDeviceFlow",Rhr=class extends cR{constructor(){super(...arguments);this.name=Gdt;this.arguments=S.Tuple([])}static{a(this,"FinishDeviceFlowCommand")}async handle(r,n){let o=this.ctx.get(HT),s=o.pendingSignIn;if(!s)throw new whr.ResponseError(Ze.InvalidRequest,"No pending sign in");try{await this.ctx.get(Vm).open(s.verificationUri)}catch(c){b_.warn(this.ctx,"Failed to open",s.verificationUri),b_.exception(this.ctx,c,Gdt)}try{return await s.status}catch(c){throw new whr.ResponseError(Ze.DeviceFlowFailed,String(c))}finally{o.pendingSignIn=void 0}}},fni=[Rhr];p();p();var Ru=class extends Cn{static{a(this,"CopilotCompletionCache")}constructor(e=100){super(e)}};var jNe="github.copilot.didAcceptCompletionItem",khr=class extends cR{constructor(){super(...arguments);this.name=jNe;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}handle(r,[n]){let s=this.ctx.get(Ru).get(n);return s?(Pme(this.ctx,s),!0):!1}},pni=[khr];p();p();p();var d1t=de(u1t()),mQi=de(K$());function Zwc(t){switch(t){case d1t.TokenizerName.cl100k:return"cl100k_base";case d1t.TokenizerName.o200k:return"o200k_base";case d1t.TokenizerName.mock:return"mock"}}a(Zwc,"toClsTokenizerName");var gQi={getTokenizer:a(t=>ws(Zwc(t)),"getTokenizer"),ensureLoaded:a(()=>Lun(),"ensureLoaded")},Xwc=new pQ,eRc={encode:a(t=>Xwc.tokenize(t),"encode")},f1t=class extends mQi.TokenizerProvider{constructor(){super(!1,void 0);this.rewired=new WeakSet}static{a(this,"ApproximateNesTokenizerProvider")}acquireTokenizer(r){let n=super.acquireTokenizer(r);return this.useApproximateEncoder(n),n}useApproximateEncoder(r){if(this.rewired.has(r))return;this.rewired.add(r);let n=r;n.doInitTokenizer=()=>Promise.resolve(eRc)}};p();p();p();p();function AQi(t,e,r){function n(s,c,l){let u=new RegExp(`^(${c})+`,"g");return s.split(` +`],maxTokens:Cni*u};return d==="moremultiline"&&(h.blockMode="moremultiline"),h}return{blockMode:d,requestMultiline:!1,...Sni(t,d,e.textDocument,e.position,f.blockPosition,r,!1,n.prompt,l)}}}}a($Zs,"getGhostTextStrategy");function Sni(t,e,r,n,o,s,c,l,u){if(c&&e==="moremultiline"&&lO.isSupported(r.detectedLanguageId)){let d=o==="empty-block"||o==="block-end"?t.get(Jt).longLookaheadSize(u):t.get(Jt).shortLookaheadSize(u);return{finishedCb:new Jlt(t,s,r.detectedLanguageId,!1,d,(h,m)=>{let g={prefix:s+h,prompt:{...l,prefix:l.prefix+h}};Vdt(t,g,m)}).getFinishedCallback(),maxTokens:t.get(Jt).maxMultilineTokens(u)}}return{finishedCb:c?bNe(t,r,n):d=>{}}}a(Sni,"buildFinishedCallback");var VZs={isCycling:!1,promptOnly:!1,isSpeculative:!1};function WZs(t,e,r){let n=Rt(t,ze.CompletionsDebounce)??t.get(Jt).completionsDebounce(r)??e.debounceMs;if(n===void 0)return 0;let o=El()-r.issuedTime;return Math.max(0,n-o)}a(WZs,"getRemainingDebounceMs");function YNe(t,e,r){return r?.isCancellationRequested||e!==t.get(Db).currentRequestId}a(YNe,"inlineCompletionRequestCancelled");async function zZs(t,e,r,n,o,s){let c=n.issuedTime,l=[];function u(E){let _=El();l.push([E,_-c]),c=_}a(u,"recordPerformance"),u("telemetry");let d=t.get(Jt);if(YNe(t,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:vp(n,t)};let f=KZs(e.textDocument,e.position);if(f===void 0)return dl.debug(t,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:vp(n,t)};let h=TQ(t,n),m={...VZs,...s,tokenizer:h.tokenizer},g=await qme(t,r,e,n,void 0,m);if(u("prompt"),g.type==="copilotContentExclusion")return dl.debug(t,"Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:vp(n,t)};if(g.type==="contextTooShort")return dl.debug(t,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:vp(n,t)};if(g.type==="promptError")return dl.debug(t,"Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:vp(n,t)};if(m.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:g};if(g.type==="promptCancelled")return dl.debug(t,"Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:vp(n,t)};if(g.type==="promptTimeout")return dl.debug(t,"Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:vp(n,t)};if(g.prompt.prefix.length===0&&g.prompt.suffix.length===0)return dl.debug(t,"Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:vp(n,t)};let A=WZs(t,m,n);return A>0&&(dl.debug(t,`Debouncing ghost text request for ${A}ms`),await MC(A),YNe(t,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:vp(n,t)}:t.get(Ss).trackCompletionJob(async()=>{let[E]=YH(e.textDocument.getText(Au.range(Au.position(0,0),e.position))),_=t.get(Db).hasAcceptedCurrentCompletion(E,g.prompt.suffix),v=g.prompt,b=await $Zs(t,e,E,g,m.isCycling,f,_,n);u("strategy");let T=YZs(t,E,v,b.requestMultiline);u("cache");let w=IQ(t,e.textDocument.uri),R={blockMode:b.blockMode,languageId:e.textDocument.detectedLanguageId,repoInfo:w,engineModelId:h.modelId,ourRequestId:r,prefix:E,prompt:g.prompt,multiline:b.requestMultiline,indentation:dut(e.textDocument,e.position),isCycling:m.isCycling,headers:h.headers,stop:b.stop,maxTokens:b.maxTokens,afterAccept:_};R.headers={...R.headers,"X-Copilot-Async":"true","X-Copilot-Speculative":m.isSpeculative?"true":"false"};let x=oXs(t,e.textDocument,R,e.position,g,n,h,m);if(T===void 0&&!m.isCycling&&t.get(Pb).shouldWaitForAsyncCompletions(E,g.prompt)){let U=await t.get(Pb).getFirstMatchingRequestWithTimeout(r,E,g.prompt,m.isSpeculative,x);if(u("asyncWait"),U){let q=!b.requestMultiline;T=[[Uhr(U[0],{forceSingleLine:q})],4]}if(YNe(t,r,o))return dl.debug(t,"Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:vp(x,t)}}let P=b.blockMode==="moremultiline"&&lO.isSupported(e.textDocument.detectedLanguageId);if(T!==void 0&&(T[0]=T[0].map(U=>zNe(t,e.textDocument,e.position,U,P,dl)).filter(U=>U!==void 0)),T!==void 0&&T[0].length===0)return dl.debug(t,`Found empty inline suggestions locally via ${hme(T[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:vp(x,t)};if(T!==void 0&&T[0].length>0&&(!m.isCycling||T[0].length>1))dl.debug(t,`Found inline suggestions locally via ${hme(T[1])}`);else{if(m.isCycling){let U=await GZs(t,R,x,o,b.finishedCb);if(U.type==="success"){let q=T?.[0]??[];U.value[0].forEach(Q=>{q.findIndex(Y=>Y.completionText.trim()===Q.completionText.trim())===-1&&q.push(Q)}),T=[q,3]}else if(T===void 0)return U}else{let U=a((W,V)=>(t.get(Pb).updateCompletion(r,W),b.finishedCb(W,V)),"finishedCb"),q=new Fn.CancellationTokenSource,Q=HZs(t,R,x,q.token,U);t.get(Pb).queueCompletionRequest(r,E,g.prompt,q,Q);let Y=await t.get(Pb).getFirstMatchingRequest(r,E,g.prompt,m.isSpeculative);if(Y===void 0)return{type:"empty",reason:"received no results from async completions",telemetryData:vp(x,t)};T=[[Y[0]],4]}u("network")}if(T===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:vp(x,t)};let[D,N]=T,L=D.map(U=>zNe(t,e.textDocument,e.position,U,P,dl)).filter(U=>U!==void 0),B=Rt(t,ze.CompletionsDelay)??d.completionsDelay(n),j=El()-n.issuedTime,M=Math.max(B-j,0);if(N!==2&&!m.isCycling&&M>0&&(dl.debug(t,`Waiting ${M}ms before returning completion`),await MC(M),YNe(t,r,o)))return dl.debug(t,"Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:qH(x)};let O=[];for(let U of L){let q=iXs(t,e.textDocument,R,U,x),Q=f?vni(e.textDocument,e.position,U):0,W={completion:tXs(U.choiceIndex,U.completionText,g.trailingWs),telemetry:q,isMiddleOfTheLine:f,suffixCoverage:Q,copilotAnnotations:U.copilotAnnotations,clientCompletionId:U.clientCompletionId};O.push(W)}return x.properties.clientCompletionId=O[0]?.clientCompletionId,x.measurements.foundOffset=O?.[0]?.telemetry?.measurements?.foundOffset??-1,dl.debug(t,`Produced ${O.length} results from ${hme(N)} at ${x.measurements.foundOffset} offset`),YNe(t,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:qH(x)}:(m.isSpeculative||t.get(Db).setGhostText(E,g.prompt.suffix,L,N),u("complete"),{type:"success",value:[O,N],telemetryData:vp(x,t),telemetryBlob:x,resultType:N,performanceMetrics:l})})}a(zZs,"getGhostTextWithoutAbortHandling");async function Qhr(t,e,r,n){let o=Nt();t.get(Db).currentRequestId=o;let s=await nXs(t,e.textDocument,o,n);await SQ().catch(()=>{});try{return t.get(Nb).schedule(e,o,n?.opportunityId??"",s,r,n),t.get(n4).notifyRequest(e,o,s,r,n),await zZs(t,e,o,s,r,n)}catch(c){if(Ym(c))return{type:"canceled",reason:"aborted at unknown location",telemetryData:qH(s,{cancelledNetworkRequest:!0})};throw c}}a(Qhr,"getGhostText");function YZs(t,e,r,n){let o=t.get(Db).getCompletionsForUserTyping(e,r.suffix),s=rXs(t,e,r.suffix,n);if(o&&o.length>0){let c=(s??[]).filter(l=>!o.some(u=>u.completionText===l.completionText));return[o.concat(c),2]}if(s&&s.length>0)return[s,1]}a(YZs,"getLocalInlineSuggestion");function KZs(t,e){let r=JZs(e,t),n=ZZs(e,t);return r&&!n?void 0:r&&n}a(KZs,"isInlineSuggestion");function JZs(t,e){return e.lineAt(t).text.substr(t.character).trim().length!=0}a(JZs,"isMiddleOfTheLine");function ZZs(t,e){let n=e.lineAt(t).text.substr(t.character).trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(n)}a(ZZs,"isValidMiddleOfTheLinePosition");function XZs(t,e){return e.lineAt(t).text.trim().length===0}a(XZs,"isNewLine");var L8=class t{constructor(e=!1){this.requestMultilineOverride=e}static{a(this,"ForceMultiLine")}static{this.default=new t}};async function eXs(t,e,r,n,o,s,c){if(t.get(L8).requestMultilineOverride)return{requestMultiline:!0};if(r.lineCount>=8e3)ft(t,"ghostText.longFileMultilineSkip",Vt.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e=="moremultiline"&&lO.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await Ffn(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&XZs(n,r))return{requestMultiline:!0};let u=!1;return!o&&OS(r.detectedLanguageId)?u=await uut(r,n):o&&OS(r.detectedLanguageId)&&(u=await uut(r,n)||await uut(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=mei(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(eXs,"shouldRequestMultiline");function Vdt(t,e,r){t.get(Y2).append(e.prefix,e.prompt.suffix,r)}a(Vdt,"appendToCache");function tXs(t,e,r){if(r.length>0){if(e.startsWith(r))return{completionIndex:t,completionText:e,displayText:e.substring(r.length),displayNeedsWsOffset:!1};{let n=e.substring(0,e.length-e.trimStart().length);return r.startsWith(n)?{completionIndex:t,completionText:e,displayText:e.trimStart(),displayNeedsWsOffset:!0}:{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}}else return{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}a(tXs,"adjustLeadingWhitespace");function rXs(t,e,r,n){let o=t.get(Y2).findAll(e,r);return o.length===0?(dl.debug(t,"Found no completions in cache"),[]):(dl.debug(t,`Found ${o.length} completions in cache`),o.map(s=>Uhr(s,{forceSingleLine:!n})))}a(rXs,"getCompletionsFromCache");async function nXs(t,e,r,n){let o={headerRequestId:r};n?.opportunityId&&(o.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(o.completionsActive="true"),n?.isSpeculative&&(o.reason="speculative");let s=Vt.createAndMarkAsIssued(o);return await t.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},s)}a(nXs,"createTelemetryWithExp");function iXs(t,e,r,n,o){let s=n.requestId,c={choiceIndex:n.choiceIndex.toString(),clientCompletionId:n.clientCompletionId};n.generatedChoiceIndex!==void 0&&(c.originalChoiceIndex=c.choiceIndex,c.choiceIndex=(1e4*(n.generatedChoiceIndex+1)+n.choiceIndex).toString());let l={compCharLen:n.completionText.length,numLines:n.completionText.trim().split(` +`).length};n.meanLogProb&&(l.meanLogProb=n.meanLogProb),n.meanAlternativeLogProb&&(l.meanAlternativeLogProb=n.meanAlternativeLogProb);let u=n.telemetryData.extendedBy(c,l);return u.issuedTime=o.issuedTime,u.measurements.timeToProduceMs=performance.now()-o.issuedTime,xni(u,e),u.extendWithRequestId(s),u.measurements.confidence=Eni(t,u),u.measurements.quantile=_ni(t,u),dl.debug(t,`Extended telemetry for ${n.telemetryData.properties.headerRequestId} with retention confidence ${u.measurements.confidence} (expected as good or better than about ${u.measurements.quantile} of all suggestions)`),u}a(iXs,"telemetryWithAddData");function oXs(t,e,r,n,o,s,c,l){let u={languageId:e.detectedLanguageId};u.afterAccept=r.afterAccept.toString(),u.isSpeculative=l.isSpeculative.toString();let d=s.extendedBy(u);xni(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===0?"pending":"available",f!==void 0&&f!==0&&(d.properties.gitRepoUrl=f.url,d.properties.gitRepoHost=f.hostname,d.properties.gitRepoOwner=f.owner,d.properties.gitRepoName=f.repo,d.properties.gitRepoPath=f.pathname),d.properties.engineName=c.modelId,d.properties.engineChoiceSource=c.engineChoiceSource,d.properties.isMultiline=JSON.stringify(r.multiline),d.properties.isCycling=JSON.stringify(r.isCycling);let h=e.lineAt(n.line),m=e.getText(Au.range(h.range.start,n)),g=e.getText(Au.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,Tni.SHA256)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...Rse(o.prompt),promptEndPos:e.offsetAt(n),promptComputeTimeMs:o.computeTimeMs};o.metadata&&(y.promptMetadata=JSON.stringify(o.metadata)),o.contextProvidersTelemetry&&(y.contextProviders=JSON.stringify(o.contextProvidersTelemetry));let _=d.extendedBy(y,E);return ft(t,"ghostText.issued",_),d}a(oXs,"telemetryIssued");function xni(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(xni,"addDocumentTelemetry");function wni(t,e,r,n,o){let s=Date.now()-n,c=s-o,l=r.telemetryData.extendedBy({},{completionCharLen:r.completionText.length,requestTimeMs:s,processingTimeMs:o,deltaMs:c,meanLogProb:r.meanLogProb||NaN,meanAlternativeLogProb:r.meanAlternativeLogProb||NaN});l.extendWithRequestId(r.requestId),ft(t,`ghostText.${e}`,l)}a(wni,"telemetryPerformance");p();p();var gee=class{constructor(e,r,n){this._referenceCount=0;this._isDisposed=!1;this._offset=n;let o=e.get($r);this._tracker=o.onDidChangeTextDocument(s=>{if(s.document.uri===r){for(let c of s.contentChanges)if(c.rangeOffset+c.rangeLength<=this.offset){let l=c.text.length-c.rangeLength;this._offset=this._offset+l}}})}static{a(this,"ChangeTracker")}get offset(){return this._offset}push(e,r){if(this._isDisposed)throw new Error("Unable to push new actions to a disposed ChangeTracker");this._referenceCount++,setTimeout(()=>{e(),this._referenceCount--,this._referenceCount===0&&(this._tracker.dispose(),this._isDisposed=!0)},r)}};p();var VT=class{static{a(this,"CitationManager")}},Wdt=class extends VT{static{a(this,"NoOpCitationManager")}async handleIPCodeCitation(e,r){}};p();var qhr=class t{constructor(e,r,n=[],o,s,c){this._textDocument=e;this._position=r;this.originalPosition=o??Fn.Position.create(r.line,r.character),this.originalVersion=s??e.version,this.originalOffset=c??e.offsetAt(this.originalPosition),this._editsWithPosition=[...n]}static{a(this,"CompletionState")}get textDocument(){return this._textDocument}get position(){return this._position}get editsWithPosition(){return[...this._editsWithPosition]}updateState(e,r,n){return new t(e,r,n??this.editsWithPosition,this.originalPosition,this.originalVersion,this.originalOffset)}updatePosition(e){return this.updateState(this._textDocument,e)}addSelectedCompletionInfo(e){if(this.editsWithPosition.find(n=>n.source==="selectedCompletionInfo"))throw new Error("Selected completion info already applied");let r={range:e.range,newText:e.text};return this.applyEdits([r],!0)}applyEdits(e,r=!1){if(r&&e.length>1)throw new Error("Selected completion info should be a single edit");let n=this._textDocument,o=this._position,s=n.offsetAt(o),c=this.editsWithPosition;for(let{range:l,newText:u}of e){let d=n.getText(l),f=n.offsetAt(l.end);if(n=n.applyEdits([{range:l,newText:u}]),s{let v=Ydt.indexOf(_);v!==-1&&Ydt.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of Ydt)_()}a(e,"afterUpdateConnection");function r(_){nD.connection!==_&&(nD.connection=_,e())}a(r,"updateConnection");function n(){return nD.connection==="connected"}a(n,"isConnected");function o(){return nD.connection==="disconnected"}a(o,"isDisconnected");function s(){return nD.connection==="retry"}a(s,"isRetrying");function c(){return nD.connection==="disabled"}a(c,"isDisabled");function l(){r("connected"),h(!1)}a(l,"setConnected");function u(){r("disconnected")}a(u,"setDisconnected");function d(){r("retry")}a(d,"setRetrying");function f(){r("disabled")}a(f,"setDisabled");function h(_){nD.initialWait!==_&&(nD.initialWait=_)}a(h,"setInitialWait");function m(_,v=sXs){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return nD.initialWait}a(g,"isInitialWait");async function A(_,v){Ob.info(_,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);let b=_.get(nr);function T(w,R){if(w>kni){Ob.info(R,"Max retry time reached, disabling."),f();return}let x=a(async()=>{nD.retryAttempts=Math.min(nD.retryAttempts+1,Pni);try{Ob.info(R,`Pinging service after ${w} second(s)`);let P=await b.fetch(new URL("_ping",RB(R)["origin-tracker"]).href,{method:"GET",headers:{"content-type":"application/json"}});if(P.status!==200||!P.ok)T(w**2,R);else{Ob.info(R,"Successfully reconnected."),l();return}}catch{T(w**2,R)}},"tryAgain");setTimeout(()=>{x()},w*1e3)}a(T,"succeedOrRetry"),Ob.info(_,"Attempting to reconnect."),T(jhr,_)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),zdt={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},zdt}a(aXs,"registerConnectionState");var yee=aXs();p();var Gg={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"},KNe={[Gg.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[Gg.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[Gg.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function Hhr(t){return t===401?Gg.Unauthorized:t===400?Gg.BadArguments:t===404?Gg.NotFound:t===429?Gg.RateLimit:t>=500&&t<600?Gg.InternalError:t>=600?Gg.ConnectionError:Gg.Unknown}a(Hhr,"getErrorType");function y4(t,e,r={}){return{kind:"failure",reason:Hhr(Number(t)),code:Number(t),msg:e,meta:r}}a(y4,"createErrorResponse");p();var cXs=/^[1-6][0-9][0-9]$/,lXs=/([A-Z][a-z]+)/,uXs="code_referencing",JNe=class{constructor(e){this.baseKey=e}static{a(this,"CodeQuoteTelemetry")}buildKey(...e){return[uXs,this.baseKey,...e].join(".")}},Ghr=class extends JNe{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({context:e}){let r=this.buildKey("open","count"),n=Vt.createAndMarkAsIssued();ft(e,r,n)}handleFocus({context:e}){let r=Vt.createAndMarkAsIssued(),n=this.buildKey("focus","count");ft(e,n,r)}handleWrite({context:e}){let r=Vt.createAndMarkAsIssued(),n=this.buildKey("write","count");ft(e,n,r)}},y$f=new Ghr,$hr=class extends JNe{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({context:e,actor:r}){let n=Vt.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");ft(e,o,n)}handleDismiss({context:e,actor:r}){let n=Vt.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");ft(e,o,n)}},E$f=new $hr,Vhr=class extends JNe{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({context:e,origin:r,reason:n}){let o=Vt.createAndMarkAsIssued({origin:r,reason:n});rg(e,this.buildKey("unexpectedError"),o)}handleCompletionMissing({context:e,origin:r,reason:n}){let o=Vt.createAndMarkAsIssued({origin:r,reason:n});rg(e,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({context:e,origin:r,reason:n,message:o}){if(!r.match(cXs)){Ob.debug(e,"Invalid status code, not sending telemetry",{origin:r});return}let s=n.split(lXs).filter(l=>!!l).join("_").toLowerCase(),c=Vt.createAndMarkAsIssued({message:o});rg(e,this.buildKey(s,r),c)}},Kdt=new Vhr;var dXs="twirp/github.snippy.v1.SnippyAPI";async function Whr(t,e,r,n){let o;try{o=await t.get(Ft).getToken()}catch{return yee.setDisconnected(),y4(401,KNe[Gg.Unauthorized])}if(Ob.info(t,`Calling ${e}`),yee.isRetrying())return y4(600,"Attempting to reconnect to the public code matching service.");if(yee.isDisconnected())return y4(601,"The public code matching service is offline.");let s;try{s=await t.get(nr).fetch(ux(t,o,"origin-tracker",`${dXs}/${e}`),{method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...zy(t)},signal:n})}catch{return yee.enableRetry(t),y4(602,"Network error detected. Check your internet connection.")}!s.ok&&(s.status===401||s.status===403)&&t.get(Ft).resetToken("snippy",s.status);let c;try{c=await s.json()}catch(A){let y=A.message;throw Kdt.handleUnexpectedError({context:t,origin:"snippyNetwork",reason:y}),A}if(s.ok)return{kind:"success",...c};let l={...c,code:Number(s.status)},{code:u,msg:d,meta:f}=l,h=Number(u),m=Hhr(h),g=d||"unknown error";switch(m){case Gg.Unauthorized:return y4(u,KNe[Gg.Unauthorized],f);case Gg.BadArguments:return y4(u,g,f);case Gg.RateLimit:return yee.enableRetry(t,60*1e3),y4(u,KNe.RateLimitError,f);case Gg.InternalError:return yee.enableRetry(t),y4(u,KNe[Gg.InternalError],f);default:return y4(u,g,f)}}a(Whr,"call");p();var Jdt=S.Object({kind:S.Literal("failure"),reason:S.String(),code:S.Number(),msg:S.String(),meta:S.Optional(S.Any())}),pXs=S.Object({matched_source:S.String(),occurrences:S.String(),capped:S.Boolean(),cursor:S.String(),github_url:S.String()}),Dni=S.Object({source:S.String()}),hXs=S.Object({snippets:S.Array(pXs)}),Nni=S.Union([hXs,Jdt]),Mni=S.Object({cursor:S.String()}),mXs=S.Object({commit_id:S.String(),license:S.String(),nwo:S.String(),path:S.String(),url:S.String()}),gXs=S.Object({has_next_page:S.Boolean(),cursor:S.String()}),AXs=S.Object({count:S.Record(S.String(),S.String())}),yXs=S.Object({file_matches:S.Array(mXs),page_info:gXs,license_stats:AXs}),Oni=S.Union([yXs,Jdt]);async function Lni(t,e,r){let n=await Whr(t,"Match",{method:"POST",body:IK(Dni,{source:e})},r);return IK(Nni,n)}a(Lni,"Match");async function Bni(t,{cursor:e},r){let n=await Whr(t,"FilesForMatch",{method:"POST",body:IK(Mni,{cursor:e})},r);return IK(Oni,n)}a(Bni,"FilesForMatch");p();var ZNe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu"),Zdt=65;function vXs(t){let e=0,r;ZNe.lastIndex=0;do if(r=ZNe.exec(t),r&&(e+=1),e>=Zdt)break;while(r);return e}a(vXs,"lexemeLength");function CXs(t,e){let r=0,n;ZNe.lastIndex=0;do if(n=ZNe.exec(t),n&&(r+=1,r>=e))return ZNe.lastIndex;while(n);return t.length}a(CXs,"offsetFirstLexemes");function Fni(t,e){let r=t.split("").reverse().join(""),n=CXs(r,e);return r.length-n}a(Fni,"offsetLastLexemes");function XNe(t){return vXs(t)>=Zdt}a(XNe,"hasMinLexemeLength");function SXs(t){return aO.Check(Jdt,t)}a(SXs,"isError");async function Uni(t,e){let r=await e();if(SXs(r)){Kdt.handleSnippyNetworkError({context:t,origin:String(r.code),reason:r.reason,message:r.msg});return}return r}a(Uni,"snippyRequest");function Qni(t){return"kind"in t&&t.kind==="failure"}a(Qni,"isMatchError");async function qni(t,e,r,n){let s=await t.get($r).getTextDocument({uri:e});if(!s){Ob.debug(t,`Expected document matching ${e}, got nothing.`);return}let c=s.getText();if(!XNe(c)||!XNe(c))return;let l=r;if(!XNe(r)){let g=c.slice(0,n),A=Fni(g,Zdt);l=c.slice(A,n+r.length)}if(!XNe(l))return;let u=await Uni(t,()=>Lni(t,l));if(!u||Qni(u)||!u.snippets.length){Ob.info(t,"No match found");return}Ob.info(t,"Match found");let{snippets:d}=u,f=d.map(async g=>{let A=await Uni(t,()=>Bni(t,{cursor:g.cursor}));if(!A||Qni(A))return;let y=A.file_matches,E=A.license_stats;return{match:g,files:y,licenseStats:E}}),m=(await Promise.all(f)).filter(g=>g!==void 0);if(m.length)for(let g of m){let A=new Set(Object.keys(g.licenseStats?.count??{}));A.has("NOASSERTION")&&(A.delete("NOASSERTION"),A.add("unknown"));let y=Array.from(A).sort(),E=n,_=n+g.match.matched_source.length,v=s.positionAt(E),b=s.positionAt(_);await t.get(VT).handleIPCodeCitation(t,{inDocumentUri:e,offsetStart:E,offsetEnd:_,version:s.version,location:{start:v,end:b},matchingText:l,details:y.map(T=>({license:T,url:g.match.github_url}))})}}a(qni,"fetchCitations");p();function zhr(t,e,r=(n,o)=>n===o?0:1){if(e.length===0||t.length===0)return{distance:e.length,startOffset:0,endOffset:0};let n=new Array(e.length+1).fill(0),o=new Array(e.length+1).fill(0),s=new Array(t.length+1).fill(0),c=new Array(t.length+1).fill(0),l=e[0];for(let d=0;d0?d-1:0;for(let d=1;d(l[l.Word=0]="Word",l[l.Space=1]="Space",l[l.Other=2]="Other"))(r||={});let n=0;for(let o of t){let s;new RegExp("(\\p{L}|\\p{Nd}|_)","u").test(o)?s=0:o===" "?s=1:s=2,s===n&&s!==2?e+=o:(e.length>0&&(yield e),e=o,n=s)}e.length>0&&(yield e)}a(xXs,"lexGeneratorWords");function jni(t,e,r,n){let o=[],s=0;for(let c of r(t))n(c)&&(e.has(c)||e.set(c,e.size),o.push([e.get(c),s])),s+=c.length;return[o,e]}a(jni,"lexicalAnalyzer");function Hni(t){return t!==" "}a(Hni,"notSingleSpace");function Gni(t,e,r=xXs){let[n,o]=jni(t,TXs(),r,Hni),[s,c]=jni(e,o,r,Hni);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=IXs(c),u=s.length,d=l[s[0][0]],f=l[s[u-1][0]];function h(y,E,_,v){if(v===0||v===u-1){let b=l[n[_][0]];return v==0&&b.endsWith(d)||v==u-1&&b.startsWith(f)?0:1}else return y===E?0:1}a(h,"compare");let m=zhr(n.map(y=>y[0]),s.map(y=>y[0]),h),g=n[m.startOffset][1],A=m.endOffset0&&t[A-1]===" "&&--A,{lexDistance:m.distance,startOffset:g,endOffset:A,haystackLexLength:n.length,needleLexLength:s.length}}a(Gni,"lexEditDistance");p();function KH(t){return t.length===0?0:t.split(` +`).length}a(KH,"countLines");function $ni(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a($ni,"computeCompletionText");var JH=new pe("postInsertion"),Vni=[{seconds:15,captureCode:!1,captureRejection:!1},{seconds:30,captureCode:!0,captureRejection:!0},{seconds:120,captureCode:!1,captureRejection:!1},{seconds:300,captureCode:!1,captureRejection:!1},{seconds:600,captureCode:!1,captureRejection:!1}],Wni=50,wXs=1500,RXs=.5,kXs=500,Yhr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function zni(t,e,r,n,o){let s=await t.get(ni).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(s.status!=="valid")return JH.info(t,`Could not get document for ${e}. Maybe it was closed by the editor.`),{prompt:{prefix:"",suffix:"",isFimEnabled:!1},capturedCode:"",terminationOffset:0};let c=s.document,l=c.getText(),u=l.substring(0,n),d=c.positionAt(n),f=await qme(t,r.properties.headerRequestId,Aee(c,d),r),h=f.type==="prompt"?f.prompt:{prefix:u,suffix:"",isFimEnabled:!1};if(h.isFimEnabled&&o!==void 0){let m=l.substring(n,o);return h.suffix=l.substring(o),{prompt:h,capturedCode:m,terminationOffset:0}}else{let m=l.substring(n),g=ppr(u,n,c.detectedLanguageId),y=Qei(g,void 0)(m),E=Math.min(l.length,n+(y?y*2:kXs)),_=l.substring(n,E);return{prompt:h,capturedCode:_,terminationOffset:y??-1}}}a(zni,"captureCode");function Xdt(t,e,r,n,o){o.forEach(({completionText:u,completionTelemetryData:d})=>{JH.debug(t,`${e}.rejected choiceIndex: ${d.properties.choiceIndex}`),Aei(t,e,d)});let s=new gee(t,n,r-1),c=new gee(t,n,r),l=a(async u=>{JH.debug(t,`Original offset: ${r}, Tracked offset: ${s.offset}`);let{completionTelemetryData:d}=o[0],{prompt:f,capturedCode:h,terminationOffset:m}=await zni(t,n,d,s.offset+1,c.offset),g={hypotheticalPromptJson:JSON.stringify({prefix:f.prefix,context:f.context}),hypotheticalPromptSuffixJson:JSON.stringify(f.suffix)},A=d.extendedBy({...g,capturedCodeJson:JSON.stringify(h)},{timeout:u.seconds,insertionOffset:r,trackedOffset:s.offset,terminationOffsetInCapturedCode:m});JH.debug(t,`${e}.capturedAfterRejected choiceIndex: ${d.properties.choiceIndex}`,A),ft(t,e+".capturedAfterRejected",A,1)},"checkInCode");Vni.filter(u=>u.captureRejection).map(u=>s.push(K0(t,()=>l(u),"postRejectionTasks"),u.seconds*1e3))}a(Xdt,"postRejectionTasks");function eMe(t,e,r,n,o,s,c,l){let u=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});JH.debug(t,`${e}.accepted choiceIndex: ${u.properties.choiceIndex}`),gei(t,e,u);let d=r;r=$ni(r,c);let f=r.trim(),h=new gee(t,o,n),m=new gee(t,o,n+r.length),g=a(async A=>{await MXs(t,e,f,n,o,A,u,h,m)},"stillInCodeCheck");if(Yhr.triggerPostInsertionSynchroneously&&Q1(t)){let A=g({seconds:0,captureCode:Yhr.captureCode,captureRejection:Yhr.captureRejection});t.get(Dd).register(A)}else Vni.map(A=>h.push(K0(t,()=>g(A),"postInsertionTasks"),A.seconds*1e3));K0(t,PXs,"post insertion citation check")(t,o,d,r,n,l)}a(eMe,"postInsertionTasks");async function PXs(t,e,r,n,o,s){if(!s||(s.ip_code_citations?.length??0)<1){if(dx(t)?.getTokenValue("sn")==="1")return;await qni(t,e,n,o);return}let c=await t.get($r).getTextDocument({uri:e});if(c){let l=Khr(c.getText(),n,Wni,o);l.stillInCodeHeuristic&&(o=l.foundOffset)}for(let l of s.ip_code_citations){let u=DXs(r.length,n.length,l.start_offset);if(u===void 0){JH.info(t,`Full completion for ${e} contains a reference matching public code, but the partially inserted text did not include the match.`);continue}let d=o+u,f=c?.positionAt(d),h=o+NXs(r.length,n.length,l.stop_offset),m=c?.positionAt(h),g=f&&m?c?.getText({start:f,end:m}):"";await t.get(VT).handleIPCodeCitation(t,{inDocumentUri:e,offsetStart:d,offsetEnd:h,version:c?.version,location:f&&m?{start:f,end:m}:void 0,matchingText:g,details:l.details.citations})}}a(PXs,"citationCheck");function DXs(t,e,r){if(!(ee))return r}a(DXs,"computeCitationStart");function NXs(t,e,r){return e{if(r.displayText&&r.telemetry){let n,o;t.partiallyAcceptedLength?(n=r.displayText.substring(t.partiallyAcceptedLength-1),o=r.telemetry.extendedBy({compType:"partial"},{compCharLen:n.length})):(n=r.displayText,o=r.telemetry);let s={completionText:n,completionTelemetryData:o,offset:r.offset};e.push(s)}}),e}a(BXs,"computeRejectedCompletions");function Jhr(t,e){let r=t.get(cy);if(!r.position||!r.uri)return;let n=BXs(r);n.length>0&&Xdt(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(Jhr,"rejectLastShown");function Yni(t,e,r,n){let o=t.get(cy);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==2&&Jhr(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(Yni,"setLastShown");function Kni(t,e){let r=t.get(cy);if(r.index=e.index,!r.shownCompletions.find(n=>n.index===e.index)&&(e.uri===r.uri&&r.position?.line===e.position.line&&r.position?.character==e.position.character&&r.shownCompletions.push(e),e.displayText)){let n=e.resultType!==0;LXs.debug(t,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${n}`),e.telemetry.measurements.compCharLen=e.displayText.length,Xlt(t,"ghostText",e)}}a(Kni,"handleGhostTextShown");function FXs(t,e,r){let n=t.get(cy);n.linesLeft===void 0&&(n.linesAccepted=KH(e.insertText.substring(0,r)),n.linesLeft=KH(e.displayText));let o=KH(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(FXs,"handleLineAcceptance");function Hme(t,e,r="ghostText"){let n=t.get(cy),o;return n.partiallyAcceptedLength?o={compType:"full",acceptedLength:(n.partiallyAcceptedLength||0)+e.displayText.length,acceptedLines:n.linesAccepted+(n.linesLeft??0)}:o={compType:"full",acceptedLength:e.displayText.length,acceptedLines:KH(e.displayText)},n.resetState(),eMe(t,r,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(Hme,"handleGhostTextPostInsert");function eft(t,e,r,n=0,o="ghostText",s="line"){let c=t.get(cy),l;return s==="cumulative"?(UXs(t,e,r),l={compType:c.totalLength!=null?"full":"partial",acceptedLength:c.totalLength??(c.partiallyAcceptedLength||0),acceptedLines:c.linesAccepted},l.compType==="full"&&c.resetState()):(FXs(t,e,r),l={compType:"partial",acceptedLength:c.partiallyAcceptedLength||0,acceptedLines:c.linesAccepted}),eMe(t,o,e.displayText,e.offset,e.uri,e.telemetry,l,e.copilotAnnotations)}a(eft,"handlePartialGhostTextPostInsert");function UXs(t,e,r){let n=t.get(cy);n.partiallyAcceptedLength=(n.partiallyAcceptedLength||0)+r,n.linesAccepted=KH(e.insertText.substring(0,n.partiallyAcceptedLength)),n.partiallyAcceptedLength>=e.insertText.length&&(n.totalLength=n.partiallyAcceptedLength)}a(UXs,"handleCumulativeAcceptance");p();var E4=new Map;E4.set("copilot",{app:"copilot-client",catalog_service:"CopilotCompletionsVSCode"});E4.set("copilot-intellij",{app:"copilot-intellij",catalog_service:"CopilotIntelliJ"});E4.set("copilot-xcode",{app:"copilot-xcode",catalog_service:"CopilotXcode"});E4.set("copilot-eclipse",{app:"copilot-eclipse",catalog_service:"CopilotEclipse"});E4.set("copilot.vim",{app:"copilot-vim",catalog_service:"CopilotVim"});E4.set("copilot-vs",{app:"copilot-vs",catalog_service:"CopilotVS"});var QXs=new pe("sdk");function tft(t,e){E4.has(t.get(Ir).getEditorPluginInfo().name)||QXs.warn(t,...e)}a(tft,"deprecationWarning");var xJi=fe(IP()),PI=fe(QP());p();p();p();p();var rft={NewGitHubLogin:"auth.new_github_login",GitHubLoginResult:"auth.github_login_result",CodeFlowInnerError:"auth.code_flow_inner_error"};function Gme(t,e){let r=Vt.createAndMarkAsIssued({authType:e});ft(t,rft.NewGitHubLogin,r),cr(t,rft.NewGitHubLogin,{authType:e})}a(Gme,"telemetryNewGitHubLogin");function iD(t,e,r,n,o){Cs(t,rft.GitHubLoginResult,o,{authType:e,authStatus:r},{totalTimeMs:n})}a(iD,"telemetryGitHubLoginResult");function tMe(t,e,r){Cs(t,rft.CodeFlowInnerError,e,{loopbackServerPath:r??""})}a(tMe,"telemetryCodeFlowError");var Jni=["repo","workflow"],Zhr=class extends yi{static{a(this,"DeviceFlowError")}constructor(e){super(e.error_description),this.code=e.error,this.uri=e.error_uri,this.name="DeviceFlowError"}};async function qXs(t,e,{serverUrl:r}){let n={method:"POST",headers:{Accept:"application/json",...zy(t)},json:{client_id:e,scope:Jni.join(" ")},timeout:3e4},o,s=new URL("login/device/code",r).href;try{o=await t.get(nr).fetch(s,n)}catch(c){throw c instanceof Error&&ax(c)?new yi(`Could not log in with device flow on ${r}: ${c.message}`):c}if(!o.ok)throw new yi(`Could not log in with device flow on ${r}: HTTP ${o.status}`);return await o.json()}a(qXs,"requestDeviceFlowStage1");async function jXs(t,e,r,{serverUrl:n}){let o={method:"POST",headers:{Accept:"application/json",...zy(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s=await t.get(nr).fetch(new URL("login/oauth/access_token",n).href,o),c=await s.json();if(c.access_token||c.error==="authorization_pending"||c.error==="slow_down")return c;throw c.error&&c.error_description?new Zhr(c):new yi(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(jXs,"requestDeviceFlowStage2");async function HXs(t,e){let n=await(await Bd(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new yi(`Error retrieving user information: ${String(n.errors)}`);return n}a(HXs,"requestUserInfo");var WT=class{constructor(e){this.ctx=e;this.pendingSignIn=void 0}static{a(this,"GitHubDeviceFlow")}get authManager(){return this.ctx.get(Mr)}async save(e){let r=new URL(e.serverUrl).hostname;return await this.authManager.signInEditor({accessToken:e.accessToken,user:e.login,githubAppId:e.githubAppId,authAuthority:r,scopes:e.scopes})}async initiate(e,r){let n=e?.githubAppId??this.ctx.get(Jp).findAppIdToAuthenticate();r??=this.authManager.getConfiguredUrls();let o=performance.now(),s=a(()=>performance.now()-o,"getElapsedTimeMs");try{let c=await this.getTokenUnguarded(n,r),l=c.waitForAuth.then(async u=>{this.ctx.get(Jp).githubAppId=n;let d=await this.save(u);return iD(this.ctx,"deviceFlow",d.status,s()),d});return l.catch(u=>{iD(this.ctx,"deviceFlow","NotSignedIn",s(),u)}),this.pendingSignIn={verificationUri:c.verification_uri,status:l},c}catch(c){throw iD(this.ctx,"deviceFlow","NotSignedIn",s(),c),this.ctx.get(TC).notifyUser(this.ctx,c),c}}async getTokenUnguarded(e,r){let n=this.ctx;Gme(n,"deviceFlow");let o=await qXs(n,e,r),s=(async()=>{let c=o.expires_in,l=o.interval,u;do{await new Promise(f=>setTimeout(f,1e3*l)),u=await jXs(n,o.device_code,e,r),c-=l;let d=u.access_token;if(d){let f=await HXs(n,{...r,accessToken:d}),h=u.scope?u.scope.split(" ").filter(m=>m.length>0):Jni;return{...r,githubAppId:e,login:f.login,accessToken:d,scopes:h}}l=u.interval??l}while(c>0);throw new yi(`Timed out polling for access token. Last response was ${JSON.stringify(u)}`)})();return{...o,waitForAuth:s}}};var Xhr=fe(ei());p();var AR=class{constructor(e){this.ctx=e}static{a(this,"AbstractCommand")}};var nft="github.copilot.finishDeviceFlow",emr=class extends AR{constructor(){super(...arguments);this.name=nft;this.arguments=S.Tuple([])}static{a(this,"FinishDeviceFlowCommand")}async handle(r,n){let o=this.ctx.get(WT),s=o.pendingSignIn;if(!s)throw new Xhr.ResponseError(Xe.InvalidRequest,"No pending sign in");try{await this.ctx.get(Jm).open(s.verificationUri)}catch(c){mC.warn(this.ctx,"Failed to open",s.verificationUri),mC.exception(this.ctx,c,nft)}try{return await s.status}catch(c){throw new Xhr.ResponseError(Xe.DeviceFlowFailed,String(c))}finally{o.pendingSignIn=void 0}}},Zni=[emr];p();p();var ku=class extends Cn{static{a(this,"CopilotCompletionCache")}constructor(e=100){super(e)}};var rMe="github.copilot.didAcceptCompletionItem",tmr=class extends AR{constructor(){super(...arguments);this.name=rMe;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}handle(r,[n]){let s=this.ctx.get(ku).get(n);return s?(Hme(this.ctx,s),!0):!1}},Xni=[tmr];p();p();p();var B1t=fe(L1t()),aji=fe(cV());function bPc(t){switch(t){case B1t.TokenizerName.cl100k:return"cl100k_base";case B1t.TokenizerName.o200k:return"o200k_base";case B1t.TokenizerName.mock:return"mock"}}a(bPc,"toClsTokenizerName");var cji={getTokenizer:a(t=>ws(bPc(t)),"getTokenizer"),ensureLoaded:a(()=>Hdn(),"ensureLoaded")},SPc=new bQ,TPc={encode:a(t=>SPc.tokenize(t),"encode")},F1t=class extends aji.TokenizerProvider{constructor(){super(!1,void 0);this.rewired=new WeakSet}static{a(this,"ApproximateNesTokenizerProvider")}acquireTokenizer(r){let n=super.acquireTokenizer(r);return this.useApproximateEncoder(n),n}useApproximateEncoder(r){if(this.rewired.has(r))return;this.rewired.add(r);let n=r;n.doInitTokenizer=()=>Promise.resolve(TPc)}};p();p();p();p();function lji(t,e,r){function n(s,c,l){let u=new RegExp(`^(${c})+`,"g");return s.split(` `).map(d=>{let f=d.replace(u,""),h=d.length-f.length;return l(h)+f}).join(` `)}a(n,"replace");let o;if(t.tabSize===void 0||typeof t.tabSize=="string"?o=4:o=t.tabSize,t.insertSpaces===!1){let s=a(c=>n(c," ",l=>" ".repeat(Math.floor(l/o))+" ".repeat(l%o)),"r");e.displayText=s(e.displayText),e.completionText=s(e.completionText)}else if(t.insertSpaces===!0){let s=a(c=>n(c," ",l=>" ".repeat(l*o)),"r");if(e.displayText=s(e.displayText),e.completionText=s(e.completionText),r){let c=a(l=>{if(l==="")return l;let u=l.split(` -`)[0],d=u.length-u.trimStart().length,f=d%o;if(f!==0&&d>0){let h=" ".repeat(f);return n(l,h,m=>" ".repeat((Math.floor(m/o)+1)*o))}else return l},"re");e.displayText=c(e.displayText),e.completionText=c(e.completionText)}}return e}a(AQi,"normalizeIndentCharacter");Mo();function yQi(t,e,r,n,o,s,c){let l=n.lineAt(o),u=e.map(d=>{let f=gu.range(gu.position(o.line,0),gu.position(o.line,o.character+d.suffixCoverage)),h="";if(s&&(d.completion=AQi(s,d.completion,l.isEmptyOrWhitespace)),l.isEmptyOrWhitespace&&(d.completion.displayNeedsWsOffset||d.completion.completionText.startsWith(l.text)))h=d.completion.completionText;else{let g=gu.range(f.start,o);h=n.getText(g)+d.completion.displayText}return{uuid:Mt(),insertText:h,range:f,uri:n.uri,index:d.completion.completionIndex,telemetry:d.telemetry,displayText:d.completion.displayText,position:o,offset:n.offsetAt(o),resultType:r,copilotAnnotations:d.copilotAnnotations,clientCompletionId:d.clientCompletionId}});if(r===2&&c!==void 0){let d=u.find(f=>f.index===c);if(d){let f=u.filter(h=>h.index!==c);u=[d,...f]}}return u}a(yQi,"completionsFromGhostTextResults");p();var CN=class{constructor(){this.cache=new Cn(100)}static{a(this,"SpeculativeRequestCache")}set(e,r){this.cache.set(e,r)}async request(e){let r=this.cache.get(e);r!==void 0&&(this.cache.delete(e),await r())}};var dEe=class extends ry{constructor(r){super();this.ctx=r}static{a(this,"GhostTextInlineCompletionManager")}async getInlineCompletionsResult(r,n,o={}){let s=this.ctx,c=0;o.selectedCompletionInfo?.text&&!o.selectedCompletionInfo.text.includes(")")&&(r=r.addSelectedCompletionInfo(o.selectedCompletionInfo),c=r.position.character-o.selectedCompletionInfo.range.end.character);let l=await mhr(s,r,n,o);if(l.type!=="success")return l;let[u,d]=l.value;if(n?.isCancellationRequested)return{type:"canceled",reason:"after getGhostText",telemetryData:{telemetryBlob:l.telemetryBlob}};let f=lni(s,r.textDocument,r.position,d),h=yQi(s,u,d,r.textDocument,r.position,o.formattingOptions,f);if(h.length===0)return{type:"empty",reason:"no completions in final result",telemetryData:l.telemetryData};if(d!==2){r=r.applyEdits([{newText:h[0].insertText,range:h[0].range}]);let g={isSpeculative:!0,opportunityId:o.opportunityId},A=a(()=>mhr(s,r,void 0,g),"fn");s.get(CN).set(h[0].clientCompletionId,A)}let m=h.map(g=>{let{start:A,end:y}=g.range,E=Fn.Range.create(A,Fn.Position.create(y.line,y.character-c));return{...g,range:E}});return{...l,value:m}}async getPrompt(r,n,o,s={}){let c=await this.getInlineCompletionsResult(pee(r,n),o,{...s,promptOnly:!0});if(c.type!=="promptOnly")throw new Error(`Unexpected result type ${c.type}`);return c.prompt}async getCompletions(r,n,o,s={}){this.logCompletionLocation(r,n);let c=await this.getInlineCompletionsResult(pee(r,n),o,s);return DXn(this.ctx,c)}logCompletionLocation(r,n){let o=r.getText({start:{line:Math.max(n.line-1,0),character:0},end:n}),s=r.getText({start:n,end:{line:Math.min(n.line+2,r.lineCount-1),character:r.lineCount-1>n.line?0:n.character}});Ult.debug(this.ctx,`Requesting for ${r.uri} at ${n.line}:${n.character}`,`between ${JSON.stringify(o)} and ${JSON.stringify(s)}.`)}triggerSpeculativeRequests(r){return this.ctx.get(CN).request(r.clientCompletionId)}};p();var fEe=de(Vne()),EQi=de(iN()),p4r=de(rdt()),m1t=de(cee()),_Qi=de(Rs()),vQi=de(W2()),n3e=de(kE()),h1t=de(q_()),h4r=de(hd()),CQi=de(qT()),bQi=de(ri());p();var p1t=class{constructor(e){this.ctx=e;this._onDidOpenTextDocument=new Wi;this._onDidChangeTextDocument=new Wi;this._onDidCloseTextDocument=new Wi;this._onDidSelectTextDocument=new Wi;this.onDidOpenTextDocument=this._onDidOpenTextDocument.event;this.onDidChangeTextDocument=this._onDidChangeTextDocument.event;this.onDidCloseTextDocument=this._onDidCloseTextDocument.event;this.onDidSelectTextDocument=this._onDidSelectTextDocument.event;this.bufferedEvents=[];this.forwardedAsOpen=new Set;this.started=!1;this.documentManager=this.ctx.get($r)}static{a(this,"DocumentChangeFilter")}start(){if(!this.started){this.started=!0;for(let e of this.documentManager.getTextDocumentsUnsafe())this.bufferedEvents.push({type:"addition",event:{document:{uri:e.uri,languageId:e.clientLanguageId,version:e.version,text:e.getText()}}});this.documentManager.onDidOpenTextDocument(e=>{this.bufferedEvents.push({type:"addition",event:e})}),this.documentManager.onDidChangeTextDocument(e=>{this.bufferedEvents.push({type:"change",event:e})}),this.documentManager.onDidCloseTextDocument(e=>{this.bufferedEvents.push({type:"removal",event:e})})}}addSelectionEvent(e){this.bufferedEvents.push({type:"selection",event:e})}async syncSafeDocuments(){let e=[...this.bufferedEvents];this.bufferedEvents.length=0;for(let r of e){let n=r.type==="selection"?r.event.uri:r.event.document.uri;if(r.type==="removal"){this.forwardedAsOpen.has(n)&&(this.forwardedAsOpen.delete(n),this._onDidCloseTextDocument.fire(r.event));continue}let o=await this.documentManager.getTextDocument({uri:n});if(o===void 0){this.forwardedAsOpen.has(n)&&(this.forwardedAsOpen.delete(n),this._onDidCloseTextDocument.fire({document:{uri:n}}));continue}r.type==="addition"?(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire(r.event)):r.type==="change"?this.forwardedAsOpen.has(n)?this._onDidChangeTextDocument.fire(r.event):(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire({document:{uri:o.clientUri,languageId:o.clientLanguageId,version:o.version,text:o.getText()}})):r.type==="selection"&&(this.forwardedAsOpen.has(n)||(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire({document:{uri:o.clientUri,languageId:o.clientLanguageId,version:o.version,text:o.getText()}})),this._onDidSelectTextDocument.fire(r.event))}}};var bV=class extends m1t.ObservableWorkspace{constructor(r,n,o){super();this._openDocuments=(0,vQi.observableValue)(this,[]);this.openDocuments=this._openDocuments;this._documents=new Map;this.ctx=r,n&&(this.documentChangeFilter=new p1t(r)),this._started=!1,o||this.start()}static{a(this,"ObservableLspWorkspace")}start(){if(this._started)return;this._started=!0;let r=this.ctx.get($r);if(this.documentChangeFilter)this.documentChangeFilter.start();else for(let o of r.getTextDocumentsUnsafe())this.addLspDocument(o.uri,o.clientLanguageId,o.getText());let n=this.documentChangeFilter??r;n.onDidOpenTextDocument(o=>{this.addLspDocument(o.document.uri,o.document.languageId,o.document.text)}),n.onDidCloseTextDocument(o=>{this.removeClosedLspDocument(o.document.uri)}),n.onDidChangeTextDocument(o=>{this.onDidChangeLspDocument(o.document.uri,o.contentChanges)}),this.documentChangeFilter?.onDidSelectTextDocument(o=>{let s=fEe.DocumentId.create(Fs(o.uri)),c=this._documents.get(s);c&&c.updateSelectionFromLspPosition(o.position)})}addLspDocument(r,n,o){let s=fEe.DocumentId.create(Fs(Fs(r)));return this.addDocument({id:s,initialValue:o,languageId:p4r.LanguageId.create(n)},void 0)}onDidChangeLspDocument(r,n){let o=fEe.DocumentId.create(Fs(Fs(r))),s=this._documents.get(o);s&&s.applyLspContentChanges(n)}onUserPositionChange(r,n){if(this.documentChangeFilter)this.documentChangeFilter.addSelectionEvent({uri:r,position:n});else{let o=fEe.DocumentId.create(Fs(r)),s=this._documents.get(o);s&&s.updateSelectionFromLspPosition(n)}}removeClosedLspDocument(r){let n=fEe.DocumentId.create(Fs(r));this._documents.get(n)?.dispose()}addDocument(r,n=void 0){let o=this._documents.get(r.id);if(o)return o;let s=new m4r(r.id,new CQi.StringText(r.initialValue??""),[],r.languageId??p4r.LanguageId.PlainText,()=>{this._documents.delete(r.id);let c=this._openDocuments.get(),l=c.filter(u=>u.id!==s.id);l.length!==c.length&&this._openDocuments.set(l,n,{added:[],removed:[s]})},r.workspaceRoot);return this._documents.set(r.id,s),this._openDocuments.set([...this._openDocuments.get(),s],n,{added:[s],removed:[]}),s}getDocument(r){return this._documents.get(r)}clear(){this._openDocuments.set([],void 0,{added:[],removed:this._openDocuments.get()});for(let r of this._documents.values())r.dispose();this._documents.clear()}getWorkspaceRoot(r){return this._documents.get(r)?.workspaceRoot}async syncSafeDocuments(){this.start(),await this.documentChangeFilter?.syncSafeDocuments()}},m4r=class extends m1t.MutableObservableDocument{static{a(this,"MutableObservableLspDocument")}constructor(e,r,n,o,s,c){super(e,r,n,o,s,0,c)}applyLspContentChanges(e){let r=this.editFromLspContentChanges(e);this.applyEdit(r.compose(),void 0)}updateSelectionFromLspPosition(e){let r=this.value.get().getTransformer().getOffset(new h1t.Position(e.lineNumber+1,e.column+1));this.updateSelection([new h4r.OffsetRange(r,r)])}editFromLspContentChanges(e){return new EQi.Edits(n3e.StringEdit,e.map((n,o)=>this.editFromLspContentChange(n,o)))}editFromLspContentChange(e,r){if(bQi.TextDocumentContentChangeEvent.isIncremental(e)){let n=this.value.get().getTransformer(),o=n.getOffset(new h1t.Position(e.range.start.line+1,e.range.start.character+1)),s=n.getOffset(new h1t.Position(e.range.end.line+1,e.range.end.character+1));if(o>s){let c=this.value.get().value,l=c.split(/\r\n|\n/).length,u=c.split(/\r\n|\r|\n/).length,d=new _Qi.BugIndicatingError(`Invalid range: [${o}, ${s}) from ${JSON.stringify(e.range)}. Line counts: nes=${l}, lsp=${u}`);throw lu?d.code="ObservableWorkspace_TooManyLines":d.code="ObservableWorkspace_InvalidRange",d.code+=r>0?"_SubsequentChange":"_FirstChange",d}return n3e.StringEdit.single(new n3e.StringReplacement(new h4r.OffsetRange(o,s),e.text))}throw new Error("Full replacement edits are not supported")}};var SQi=de(u1t()),TQi=de(hgt()),g4r=de(cee()),pEe=de(Ic()),C4r=de(Ro());var A4r=class extends C4r.Disposable{constructor(r){super();this.ctx=r;this.isMinimalMode=!0;this.permissiveGitHubSession=void 0;this.hasCopilotTokenSource=!0;this._tokenChangedEverFired=!1;this._onDidAuthenticationChange=this._register(new pEe.Emitter);this.onDidAuthenticationChange=this._onDidAuthenticationChange.event;this._onDidAccessTokenChange=this._register(new pEe.Emitter);this.onDidAccessTokenChange=this._onDidAccessTokenChange.event;this._onDidCopilotTokenChange=this._register(new pEe.Emitter);this.onDidCopilotTokenChange=this._onDidCopilotTokenChange.event;this._onDidAdoAuthenticationChange=this._register(new pEe.Emitter);this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event;this.anyGitHubSession=void 0;this._register(bs(r,()=>{this.fireTokenChanged()}))}static{a(this,"AuthServiceAdapter")}fireTokenChanged(){this._tokenChangedEverFired=!0,this._onDidAccessTokenChange.fire(),this._onDidCopilotTokenChange.fire(),this._onDidAuthenticationChange.fire()}ensureTokenChangedFired(){this._tokenChangedEverFired||this.fireTokenChanged()}async getAnyGitHubSession(r){let n=await this.ctx.get(Ur).resolveSession();if(n!==void 0)return{id:n.login,accessToken:n.accessToken,account:{id:n.login,label:n.serverUrl},scopes:[]}}async getGitHubSession(r,n){if(r!=="permissive")return this.getAnyGitHubSession(n)}getPermissiveGitHubSession(r){return Promise.resolve(void 0)}get copilotToken(){let r=this.ctx.get(Qt).getLastToken();if(r!==void 0)return this.ensureTokenChangedFired(),g1t(r,this.ctx)}async getCopilotToken(r){let n=this.ctx.get(Qt);r&&n.resetToken("inline_completion_force_refresh");let o=await n.getToken();this.ensureTokenChangedFired();let s=await this.ctx.get(Ur).resolveSession();return g1t(o,this.ctx,s?.login)}resetCopilotToken(r){this.ctx.get(Qt).resetToken("inline_completion",r)}getAdoAccessTokenBase64(r){return Promise.resolve(void 0)}};function g1t(t,e,r){let n=t.envelope.refresh_in??Math.max(0,t.expiresAt-Math.floor(Date.now()/1e3));return new TQi.CopilotToken({token:t.envelope.token,expires_at:t.envelope.expires_at,refresh_in:n,organization_list:t.envelope.organization_list,code_quote_enabled:t.envelope.code_quote_enabled??!1,copilotignore_enabled:t.envelope.copilotignore_enabled??!1,endpoints:t.envelope.endpoints,limited_user_quotas:t.envelope.limited_user_quotas,enterprise_list:t.envelope.enterprise_list?t.envelope.enterprise_list.map(Number):void 0,sku:t.getTokenValue("sku")??"",individual:t.userInfo.isIndividualUser,blackbird_clientside_indexing:!1,code_review_enabled:t.isCopilotCodeReviewEnabled,codesearch:t.envelope.codesearch??!1,public_suggestions:"unconfigured",telemetry:e.get(pf).isEnabled?"enabled":"disabled",username:r??"",isVscodeTeamMember:!1,copilot_plan:t.userInfo.copilotPlan,organization_login_list:t.userInfo.raw?.organization_login_list??[]})}a(g1t,"asChatLibCopilotToken");var y4r=class extends C4r.Disposable{constructor(r){super();this.ctx=r;this._onDidModelsRefresh=this._register(new pEe.Emitter);this.onDidModelsRefresh=this._onDidModelsRefresh.event;this._register(bs(r,()=>{this.models=void 0}))}static{a(this,"EndpointProviderAdapter")}async getAllModels(r=!1){if(this.models===void 0||r)try{let n=this.ctx.get(Ox),o=await this.ctx.get(Qt).getToken();this.models=await n.fetchModels(o)??[],this._onDidModelsRefresh.fire()}catch(n){qa(this.ctx,n,"AvailableModelsManager.fetchModels"),this.models=[]}return this.models}async getAllCompletionModels(r){return(await this.getAllModels(r)).filter(o=>o.capabilities.type==="completion")}getAllChatEndpoints(){throw new Error("getAllChatEndpoints is not supported.")}getChatEndpoint(r){throw new Error("getChatEndpoint is not supported.")}getEmbeddingsEndpoint(r){throw new Error("getEmbeddingsEndpoint is not supported.")}},E4r=class{constructor(e){this.ctx=e}static{a(this,"IgnoreServiceAdapter")}get isEnabled(){return this.ctx.get(nc).enabled}get isRegexExclusionsEnabled(){return!0}dispose(){}init(){return Promise.resolve()}async isCopilotIgnored(e,r){let n=e.toString();return(await this.ctx.get($r).getTextDocumentValidation({uri:n})).status==="invalid"}asMinimatchPattern(){return Promise.resolve(void 0)}},_4r=class{constructor(e){this.statusReporter=e}static{a(this,"StatusHandlerAdapter")}didChange(e){switch(this.statusReporter.didChangeV1(e),e.kind){case"Inactive":{this.statusReporter.forceNormalV2("cls",{message:e.message??"",inactive:!0});break}case"Error":{this.statusReporter.setErrorV2("cls",{message:e.message??""});break}case"Warning":{this.statusReporter.setWarningV2("cls",{message:e.message??""});break}case"Normal":{this.statusReporter.forceNormalV2("cls",{inactive:!1});break}}}},v4r=class extends ry{constructor(r){super();this.ctx=r;this._telemetrySender=new i3e(this.ctx)}static{a(this,"ChatLibInlineCompletionManager")}get completionProvider(){return this._completionProvider||(this._completionProvider=this.createCompletionProvider()),this._completionProvider}createCompletionProvider(){let r=this.ctx,n=r.get(hm).matchFunction,o=new s3e(this.ctx.get(tr)),s=ple(r),c={fetcher:o,authService:new A4r(r),telemetrySender:this._telemetrySender,logTarget:new o3e(r),isRunningInTest:O1(r),contextProviderMatch:a(async(u,d)=>await n(r,u,d),"contextProviderMatch"),languageContextProvider:void 0,statusHandler:new _4r(r.get(ps)),documentManager:r.get($r),workspace:r.get(g4r.ObservableWorkspace),urlOpener:r.get(Vm),editorInfo:r.get(Ir).getEditorInfo(),editorPluginInfo:r.get(Ir).getEditorPluginInfo(),relatedPluginInfo:r.get(Ir).getRelatedPluginInfo(),editorSession:r.get(Ua),notificationSender:r.get(ts),ignoreService:new E4r(r),waitForTreatmentVariables:!1,endpointProvider:new y4r(r),capiClientService:void 0,citationHandler:void 0,configOverrides:s,tokenizerProvider:gQi},l=(0,SQi.createInlineCompletionsProvider)(c);return this.ctx.get(Lo).onDidChangeCopilotSettings(()=>{let u=ple(this.ctx);l.setConfigs(u).catch(d=>{qa(this.ctx,d,"inlineCompletionsProvider.setConfigs")})}),l}async getCompletions(r,n,o,s={}){let c=this.completionProvider,l=this.ctx.get(g4r.ObservableWorkspace);l instanceof bV&&await l.syncSafeDocuments();let u=await this.ctx.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments();return this._telemetrySender.updateExpConfig(u.filtersAndExp.exp),c.updateTreatmentVariables(u.filtersAndExp.exp.variables),this.asLocalResult(await c.getInlineCompletions(r,n,o,s),u)}asLocalResult(r,n){if(r!==void 0)return r.map(o=>({uuid:o.uuid,insertText:o.insertText,range:o.range,uri:o.uri,telemetry:new JI({"abexp.assignmentcontext":n.filtersAndExp.exp.assignmentContext,...o.telemetry.properties},o.telemetry.measurements,o.telemetry.issuedTime,{filters:new iB(o.telemetry.filtersAndExp.filters.toHeaders()),exp:new nC(o.telemetry.filtersAndExp.exp.variables,n.filtersAndExp.exp.assignmentContext,o.telemetry.filtersAndExp.exp.features)}),displayText:o.displayText,position:o.position,offset:o.offset,index:o.index,resultType:o.resultType,copilotAnnotations:o.copilotAnnotations,clientCompletionId:o.clientCompletionId}))}triggerSpeculativeRequests(r){return this.completionProvider.inlineCompletionShown(r.clientCompletionId)}},A1t=class extends ry{constructor(r){super();this.ctx=r}static{a(this,"ConfigurableInlineCompletionManager")}get ghostTextImpl(){return this._ghostTextImpl||(this._ghostTextImpl=new dEe(this.ctx)),this._ghostTextImpl}get chatLibImpl(){return this._chatLibImpl||(this._chatLibImpl=new v4r(this.ctx)),this._chatLibImpl}async isChatLibEnabled(){let r=await this.ctx.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments();return Ft(this.ctx,Ye.UseChatLibCompletions)??this.ctx.get(Zt).useChatLibCompletions(r)}async getCompletions(r,n,o,s={}){return await this.isChatLibEnabled()?this.chatLibImpl.getCompletions(r,n,o,s):this.ghostTextImpl.getCompletions(r,n,o,s)}async triggerSpeculativeRequests(r){return await this.isChatLibEnabled()?this.chatLibImpl.triggerSpeculativeRequests(r):this.ghostTextImpl.triggerSpeculativeRequests(r)}},i3e=class{constructor(e){this.ctx=e;this.ctx=e}static{a(this,"TelemetrySender")}updateExpConfig(e){this._expConfig=e}sendTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),vse(this.ctx,e,o.properties,o.measurements,0),At(this.ctx,e,fU(o.properties,cNe),o.measurements)}sendEnhancedTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),vse(this.ctx,e,o.properties,o.measurements,1)}asTelemetryData(e,r){let n=Object.fromEntries(Object.entries(e??{}).filter(([s,c])=>c!==void 0)),o=Object.fromEntries(Object.entries(r??{}).filter(([s,c])=>c!==void 0));return n["abexp.assignmentcontext"]===void 0&&this._expConfig?.assignmentContext!==void 0&&(n["abexp.assignmentcontext"]=this._expConfig.assignmentContext),n.completionsImplementation="chat-lib",Wt.createAndMarkAsIssued(n,o)}};p();var IQi=de(T$()),xQi=de(Ic()),a3e=de(BIr()),wQi=de(nL());var tRc=16,h9=class extends IQi.AbstractLanguageDiagnosticsService{constructor(){super(...arguments);this._map=new Cn(tRc);this._onDidChangeDiagnostics=new xQi.Emitter;this.onDidChangeDiagnostics=this._onDidChangeDiagnostics.event}static{a(this,"LspLanguageDiagnosticsService")}getDiagnostics(r){return this._map.get(r.toString())?.diagnostics??[]}getAllDiagnostics(){return Array.from(this._map.values()).map(r=>[r.uri,r.diagnostics])}setForRequest(r,n){let o=n.map(rRc);this._map.set(r.toString(),{uri:r,diagnostics:o}),this._onDidChangeDiagnostics.fire({uris:[r]})}clear(r){this._map.delete(r.toString())&&this._onDidChangeDiagnostics.fire({uris:[r]})}clearAll(){let r=Array.from(this._map.values()).map(n=>n.uri);this._map.clear(),r.length>0&&this._onDidChangeDiagnostics.fire({uris:r})}};function rRc(t){let e=new wQi.Range(t.range.start.line,t.range.start.character,t.range.end.line,t.range.end.character),r=t.severity==="error"?a3e.DiagnosticSeverity.Error:a3e.DiagnosticSeverity.Warning,n=new a3e.Diagnostic(e,t.message,r);return t.code!==void 0&&(n.code=t.code),t.source!==void 0&&(n.source=t.source),n}a(rRc,"toVscodeDiagnostic");p();var nRc="nes.reportInlineEditArc";function RQi(t,e){if(e.originalCharCount===void 0||e.originalCharCount===0)return;let r={opportunityId:e.opportunityId,languageId:e.languageId??""},n={arc:e.arc??0,originalCharCount:e.originalCharCount,originalLineCount:e.originalLineCount??0,originalDeletedLineCount:e.originalDeletedLineCount??0,currentLineCount:e.currentLineCount??0,currentDeletedLineCount:e.currentDeletedLineCount??0,didBranchChange:e.didBranchChange,timeDelayMs:e.timeDelayMs};At(t,nRc,r,n)}a(RQi,"emitNESArcTelemetry");var m9=de(u1t()),PQi=de(Vne()),S4r=de(cee()),DQi=de(_y()),NQi=de(abt()),MQi=de(Ic()),T4r=require("node:stream");Mo();var kQi=10,iRc=[0,30*1e3,120*1e3,300*1e3,600*1e3,900*1e3],b4r=new fe("nextEditSuggestions"),oRc={[m9.LogLevel.Off]:4,[m9.LogLevel.Trace]:4,[m9.LogLevel.Debug]:4,[m9.LogLevel.Info]:3,[m9.LogLevel.Warning]:2,[m9.LogLevel.Error]:1},o3e=class{constructor(e){this.ctx=e}static{a(this,"ForwardingLogTarget")}logIt(e,r,...n){this.ctx.get(qf).logIt(this.ctx,oRc[e],r,...n)}},Vv=class{constructor(e){this.lastResultsById=new Cn(kQi);this.lastResultsByUri=new Cn(kQi);this.ctx=e,this.telemetrySender=new i3e(this.ctx)}static{a(this,"NextEditSuggestionsManager")}async handleNextEditRequest(e,r,n){let o=await(this.nextEditProvider??=this.createNextEditProvider()),s=this.ctx.get(S4r.ObservableWorkspace);if(s instanceof bV&&await s.syncSafeDocuments(),!this.shouldUseExplicitRejection()){let A=this.lastResultsByUri.get(e);A&&(this.lastResultsByUri.delete(e),this.lastResultsById.delete(A.resultId),A.isShown&&o.handleRejection(A.nextEditResult))}let c=Fs(e),l=PQi.DocumentId.create(c),u=await this.ctx.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments();o.updateTreatmentVariables(u.filtersAndExp.exp.variables),this.telemetrySender.updateExpConfig(u.filtersAndExp.exp);let d=await o.getNextEdit(l.toUri(),n);if(d.result==null)return;let f=await aRc({textDocumentManager:this.ctx.get($r)},d.result,{normalizedUri:c,version:r});if(!f)return;f.isCrossFile&&b4r.debug(this.ctx,`Cross-file NES: edit requested for ${l.uri} targets ${f.document.uri}`);let h=sRc(d)??Mt(),m={resultId:h,nextEditResult:d,documentId:l,targetUri:f.document.uri,isShown:!1,originalText:f.document.getText(),languageId:f.document.detectedLanguageId};return this.lastResultsById.set(h,m),this.lastResultsByUri.set(e,m),[{edit:{text:d.result.newText,range:f.range,textDocument:f.textDocument},id:h}]}async handleAcceptance(e){let r=await this.nextEditProvider,n=this.lastResultsById.get(e);!r||!n||(this.lastResultsByUri.delete(n.documentId.uri),this.lastResultsById.delete(n.resultId),this.startNESArcTelemetry(n),await r.handleAcceptance(n.nextEditResult))}startNESArcTelemetry(e){try{let r=e.nextEditResult.result;if(!r)return;let n=e.originalText.slice(0,r.range.start)+r.newText+e.originalText.slice(r.range.endExclusive);this.ctx.get($r).getTextDocument({uri:e.targetUri}).then(o=>{if(!o)return;this.ctx.get(nT).initialize(o,e.originalText,n,{timeouts:iRc}).startReporter(c=>{RQi(this.ctx,{...c,opportunityId:e.resultId,languageId:e.languageId})})}).catch(o=>{b4r.warn(this.ctx,"Failed to start NES ARC telemetry",o)})}catch(r){b4r.warn(this.ctx,"Failed to start NES ARC telemetry",r)}}async handleRejection(e,r){await this.doHandleDismiss(e,!0,r)}async handleIgnored(e){await this.doHandleDismiss(e,!1)}async doHandleDismiss(e,r,n){let o=await this.nextEditProvider,s=this.lastResultsById.get(e);!o||!s||(this.lastResultsByUri.delete(s.documentId.uri),this.lastResultsById.delete(s.resultId),s.isShown&&(r?(n&&cRc(this.ctx,s.nextEditResult,n),o.handleRejection(s.nextEditResult)):o.handleIgnored(s.nextEditResult,void 0)))}async handleShown(e){let r=await this.nextEditProvider,n=this.lastResultsById.get(e);!r||!n||(n.isShown=!0,r.handleShown(n.nextEditResult))}async createNextEditProvider(){let e=this.ctx.get(S4r.ObservableWorkspace),r=new s3e(this.ctx.get(tr)),n=new I4r(this.ctx),o=ple(this.ctx),s=await(0,m9.createNESProvider)({configOverrides:o,workspace:e,fetcher:r,copilotTokenManager:n,terminalService:NQi.NullTerminalService.Instance,telemetrySender:this.telemetrySender,logTarget:new o3e(this.ctx),languageDiagnosticsService:this.ctx.get(h9),tokenizerProvider:new f1t});return this.ctx.get(Lo).onDidChangeCopilotSettings(()=>{let c=ple(this.ctx);s.setConfigs(c).catch(l=>{qa(this.ctx,l,"nesProvider.setConfigs")})}),s}shouldUseExplicitRejection(){return Ft(this.ctx,Ye.NESUseExplicitRejection)}};function sRc(t){let e=t.requestUuid;return typeof e=="string"&&e.length>0?e:void 0}a(sRc,"readOpportunityId");async function aRc(t,e,r){let n=r.normalizedUri,o=e.targetDocumentUri,s=o!==void 0&&Fs(o)!==n,c=s?o:n,l=await t.textDocumentManager.getTextDocument({uri:c});if(!l)return;let u=l.positionAt(e.range.start),d=l.positionAt(e.range.endExclusive);return{textDocument:{uri:l.uri,version:s?l.version:r.version},range:{start:u,end:d},document:l,isCrossFile:s}}a(aRc,"resolveNextEditTarget");function cRc(t,e,r){let n=e;try{n.telemetryBuilder?.setDisposalReason?.(r)}catch(o){qa(t,o,"nesProvider.setDisposalReason")}}a(cRc,"trySetChatLibDisposalReason");var I4r=class{constructor(e){this._ctx=e;this.didChangeTokenResult=new MQi.Emitter;this.onDidCopilotTokenRefresh=this.didChangeTokenResult.event;this._ctx.get(Qt).onDidChangeTokenResult(()=>{this.didChangeTokenResult.fire()})}static{a(this,"CopilotTokenManagerAdapter")}async getCopilotToken(e){let r=this._ctx.get(Qt);e&&r.resetToken("nes_force_refresh");let n=await r.getToken(),o=await this._ctx.get(Ur).resolveSession();return g1t(n,this._ctx,o?.login)}resetCopilotToken(e){this._ctx.get(Qt).resetToken("nes",e)}},s3e=class{constructor(e){this._delegate=e}static{a(this,"FetcherAdapter")}getUserAgentLibrary(){return this._delegate.name}async fetch(e,r){let n={headers:r.headers,body:r.body,timeout:r.timeout,json:r.json,method:r.method,signal:r.signal},o=await this._delegate.fetch(e,n),s=o.body(),c=null;return s&&(s instanceof T4r.Readable?c=T4r.Readable.toWeb(s):c=s),new DQi.Response(o.status,o.statusText,o.headers,c,this.fetcherId(),()=>{},Mt(),new URL(e).hostname)}fetcherId(){switch(this._delegate.name){case"EditorFetcher":case"ElectronFetcher":return"electron-fetch";case"FetchFetcher":case"NodeFetchFetcher":return"node-fetch";case"FakeFetcher":return"test-stub";default:return"helix-fetch"}}async disconnectAll(){return this._delegate.disconnectAll()}makeAbortController(){return new AbortController}isAbortError(e){return e&&e.name==="AbortError"}isInternetDisconnectedError(e){return!1}isFetcherError(e){return XI(e)}isNetworkProcessCrashedError(e){return!1}getUserMessageForFetcherError(e){return`Fetcher error: ${e.message}`}async fetchWithPagination(e,r){let n=[],o=r.pageSize??20,s=r.startPage??1,c=!1;do{let l=r.buildUrl(e,o,s),u=await this.fetch(l,r);if(!u.ok)return n;let d=await u.json(),f=r.getItemsFromResponse(d);n.push(...f),c=f.length===o,s++}while(c);return n}};var lRc="github.copilot.didAcceptNextEditSuggestionItem",x4r=class extends cR{constructor(){super(...arguments);this.name=lRc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}async handle(r,[n]){return await this.ctx.get(Vv).handleAcceptance(n),!0}},uRc="github.copilot.didRejectNextEditSuggestionItem",w4r=class extends cR{constructor(){super(...arguments);this.name=uRc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidRejectCommand")}async handle(r,[n]){return await this.ctx.get(Vv).handleRejection(n),!0}},dRc="github.copilot.didIgnoreNextEditSuggestionItem",R4r=class extends cR{constructor(){super(...arguments);this.name=dRc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidIgnoreCommand")}async handle(r,[n]){return await this.ctx.get(Vv).handleIgnored(n),!0}},OQi=[x4r,w4r,R4r];p();var P4r="github.copilot.didAcceptPanelCompletionItem",k4r=class extends cR{constructor(){super(...arguments);this.name=P4r;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptPanelCompletionItemCommand")}handle(r,n){let[o]=n,c=this.ctx.get(Ru).get(o);return c?(QNe(this.ctx,c.triggerCategory,c.displayText,c.offset,c.uri,c.telemetry,{compType:"full",acceptedLength:c.displayText.length,acceptedLines:UH(c.displayText)},c.copilotAnnotations),!0):!1}},LQi=[k4r];var fRc=[...fni,...pni,...OQi,...LQi];function BQi(t,e){let r=new Map;for(let n of fRc){let o=new n(t),s=qu.Compile(o.arguments);r.set(o.name,{typeCheck:s,command:o})}return e.onExecuteCommand((n,o)=>{let s=r.get(n.command);if(!s)throw new Error(`Unknown command: ${n.command}`);let c=g9(n.arguments??[]);if(c.length0}async markInstalled(e){let r=e.get(Ir).getEditorPluginInfo();await e.get(Yn).update("versions",r.name,r.version)}wasPreviouslyInstalled(e){return Promise.resolve(!1)}async isNewUpgrade(e){try{let r=e.get(Ir).getEditorPluginInfo(),n=await e.get(Yn).read("versions",r.name);return n===void 0&&await this.hasPersistedSettings(e)?!0:(0,c3e.gt)((0,c3e.coerce)(r.version),(0,c3e.coerce)(n))}catch{return!1}}async markUpgraded(e){await this.markInstalled(e)}async uninstall(e){await super.uninstall(e);let r=e.get(Ir).getEditorPluginInfo();await e.get(Yn).delete("versions",r.name),(await e.get(Yn).listKeys("versions")).length===0&&await e.get(Yn).deleteSetting("versions")}};p();var jQi=de(nl()),HQi=require("crypto"),C1t=de(require("path")),mEe=de(Xc());var mRc={watchedFiles:[],contentRestrictedFiles:[],unknownFileExtensions:[]},gRc=new mEe.ProgressType,bN=class t{constructor(e){this.ctx=e;this.#e=new Wi;this._changeHandlerLimiter=new jQi.Limiter(1);this.onDidChangeWatchedFiles=this.#e.event}static{a(this,"LspFileWatcher")}#e;static{this.requestType=new mEe.ProtocolRequestType("copilot/watchedFiles")}get connection(){return this.ctx.get(ar).connection}init(){this.ctx.get(bn).getCapabilities().watchedFiles&&this.connection.onNotification(mEe.DidChangeWatchedFilesNotification.type,r=>{if("workspaceUri"in r&&typeof r.workspaceUri=="string"){let n=r;this._changeHandlerLimiter.queue(()=>this.didChangeWatchedFilesHandler(n))}})}async getWatchedFiles(e){if(!this.ctx.get(bn).getCapabilities().watchedFiles)return mRc;let n=await this.fetchWatchedFileEntries(e);return this.buildWatchedFilesResponse(n)}async getWatchedFileUris(e){if(!this.ctx.get(bn).getCapabilities().watchedFiles)return[];let n=await this.fetchWatchedFileEntries(e),o=[],s=new Set;for(let c of n){let l=typeof c=="string"?c:c?.uri;if(!l||s.has(l))continue;s.add(l);let u=C1t.extname(l).toLowerCase();_Q.includes(u)&&o.push({uri:l})}return o}async didChangeWatchedFilesHandler(e){let r=[],n=[],o=[];for(let s of e.changes){let c=s.uri,l={uri:c,isRestricted:!1,isUnknownFileExtension:!1},u=C1t.extname(s.uri).toLowerCase();if(!_Q.includes(u))l.isUnknownFileExtension=!0;else{let d=await this.resolveWatchedDocument(c);d===void 0?l.isRestricted=!0:l.document=d}switch(s.type){case 1:n.push(l);break;case 2:r.push(l);break;case 3:o.push(l);break}}this.#e.fire({workspaceFolder:{uri:e.workspaceUri},created:n,changed:r,deleted:o})}async resolveWatchedDocument(e){return this.ctx.get(nc).enabled?this.getValidDocument(e):NS.create(e,"UNKNOWN",-1,"")}async getValidDocument(e){let n=await this.ctx.get(ii).getOrReadTextDocument({uri:e});return n.status==="valid"?n.document:void 0}async fetchWatchedFileEntries(e){let r=e.partialResultToken??(0,HQi.randomUUID)(),n=[],o=this.connection.onProgress(gRc,r,s=>{s?.files?.length&&n.push(...s.files)});try{let s=await this.connection.sendRequest(t.requestType,{...e,partialResultToken:r});Array.isArray(s.files)&&n.push(...s.files)}finally{o.dispose()}return n}async buildWatchedFilesResponse(e){let r=[],n=[],o=[],s=new Set;for(let c of e){let l=typeof c=="string"?c:c?.uri;if(!l||s.has(l))continue;s.add(l);let u=C1t.extname(l).toLowerCase();if(!_Q.includes(u)){o.push({uri:l});continue}let d=await this.getValidDocument(l);if(d===void 0){n.push({uri:l});continue}r.push(d)}return{watchedFiles:r,contentRestrictedFiles:n,unknownFileExtensions:o}}};p();var ARc=new fe("mcpGateway.projectCleanup"),iie=class{constructor(e){this._dispose=e}static{a(this,"McpProjectCleanupSubscription")}dispose(){this._dispose()}};function GQi(t){let e=t.get($r),r=t.get(ey),n=e.onDidChangeWorkspaceFolders(o=>{if(o.removed.length!==0)for(let s of o.removed)r.removeProject(s.uri).catch(c=>{ARc.warn(t,"removeProject failed during workspace-folder cleanup",{workspaceFolder:s.uri,error:c instanceof Error?c.message:String(c)})})});return new iie(()=>n.dispose())}a(GQi,"installMcpProjectCleanup");p();p();p();p();p();var WQi=require("crypto");var yRc=new fe("CloudAgentLogParser"),ERc=new Set(["run_setup","run_custom_setup_step"]),b1t=class{constructor(){this.counter=0}static{a(this,"CloudAgentIdSource")}next(){return++this.counter}};function SN(t){if(t!=null)return typeof t=="string"?t:JSON.stringify(t)}a(SN,"asString");function _Rc(t){return typeof t=="number"&&Number.isFinite(t)?new Date(t*1e3).toISOString():new Date().toISOString()}a(_Rc,"chunkTimestamp");function gEe(t,e,r){return{id:(0,WQi.randomUUID)(),timestamp:r,parentId:null,type:t,data:e}}a(gEe,"event");function S1t(t,e,r){if(!e||e.trim().length===0)return[];let n=[];return bRc(t,e,o=>{let s=_Rc(o.created),c=o.choices;if(Array.isArray(c))for(let l of c){if(!l||typeof l!="object")continue;let u=l,d=u.delta;!d||typeof d!="object"||SN(d.role)==="assistant"&&vRc(d,u,n,r,s)}}),n}a(S1t,"parseCloudAgentLogs");function vRc(t,e,r,n,o){let s=t.tool_calls,c=Array.isArray(s)&&s.length>0?s:void 0,l=SN(t.content),u=SN(e.finish_reason);if(u==="tool_calls"&&c){let m=c[0],g=m.function,A=SN(g?.name);if(A&&ERc.has(A)){if(l&&l.trim().length>0){let y=VQi(SN(g?.arguments)),E=SN(y?.name)??l,_=SN(m.id)??`setup-${E}`;zQi(r,_,A,{name:E},E,o)}return}}let d=l?.trimStart(),f=d?.startsWith("")===!0,h=d&&!d.startsWith("")&&!d.startsWith("")?d.trim():"";if(c){h.length>0&&r.push($Qi(h,n,o));for(let m of c){let g=m,A=g.function,y=SN(A?.name);if(!y)continue;let E=VQi(SN(A?.arguments));CRc(r,g,y,l,E,n,o)}if(f){let m=(l??"").replace(/^\s*\s*/i,"").replace(/\s*<\/error>\s*$/i,"").trim(),g=`command-error-${n.next()}`;r.push(gEe("tool.execution_start",{toolCallId:g,toolName:"command",arguments:{}},o)),r.push(gEe("tool.execution_complete",{toolCallId:g,success:!1,error:{message:m.length>0?m:"Command failed"}},o))}return}h.length>0&&(u==="stop"?r.push($Qi(h,n,o)):r.push(YQi(h,n,o)))}a(vRc,"processAssistantDelta");function CRc(t,e,r,n,o,s,c){if(r==="reply_to_comment")return;let l=SN(e.id);if(!l)return;if(r==="think"){let d=SN(o?.thought)??n;d&&d.trim().length>0&&t.push(YQi(d,s,c));return}let u=n?.trim();zQi(t,l,r,o,u&&u.length>0?u:void 0,c)}a(CRc,"appendToolPart");function zQi(t,e,r,n,o,s){t.push(gEe("tool.execution_start",{toolCallId:e,toolName:r,arguments:n??{}},s)),t.push(gEe("tool.execution_complete",{toolCallId:e,success:!0,result:{content:o??""}},s))}a(zQi,"pushToolCall");function $Qi(t,e,r){return gEe("assistant.message",{messageId:`cloud-text-${e.next()}`,content:t},r)}a($Qi,"textEvent");function YQi(t,e,r){return gEe("assistant.reasoning",{reasoningId:`cloud-reasoning-${e.next()}`,content:t},r)}a(YQi,"reasoningEvent");function VQi(t){if(!(!t||t.trim().length===0))try{let e=JSON.parse(t);return e&&typeof e=="object"?e:void 0}catch{return}}a(VQi,"parseArguments");function bRc(t,e,r){for(let n of e.split(/\r?\n/)){let o=n.trimStart();if(!o.startsWith("data:"))continue;let s=o.slice(5).trim();if(s.length===0)continue;let c;try{c=JSON.parse(s)}catch{yRc.debug(t,"parseCloudAgentLogs: skipping malformed SSE data chunk",{data:s});continue}c&&typeof c=="object"&&r(c)}}a(bRc,"forEachDataChunk");p();var T1t=require("crypto");var oie=new fe("CloudAgentSession"),sie="CloudAgentSession",KQi="cloud:",SRc="cloud.pull_request_card";function N4r(t,e){let r=e?new Date(e):null,n=r&&!isNaN(r.getTime())?r.toISOString():new Date().toISOString();return{id:(0,T1t.randomUUID)(),timestamp:n,parentId:null,type:SRc,data:{number:t.number,title:t.title?.trim()||`Pull request #${t.number}`,body:t.body?.trim()||null,htmlUrl:t.html_url??null}}}a(N4r,"buildCloudPullRequestCardEvent");function ZQi(t){if(!t.startsWith(KQi))return;let e=t.slice(KQi.length),r=Number(e);return e.length>0&&Number.isInteger(r)&&r>0?r:void 0}a(ZQi,"parseCloudPullRequestNumber");var DL={InProgress:"in_progress",Queued:"queued",Completed:"completed",Failed:"failed"},D4r=3e3,TRc=120*1e3,IRc=300*1e3,JQi=10,I1t=class{constructor(e,r,n,o){this.ctx=e;this.notificationSender=r;this.client=n;this._ids=new b1t;this.localSessionId=o.localSessionId,this.workspaceFolder=o.workspaceFolder,this._cwd=un(o.workspaceFolder.uri),this._pullRequest=o.pullRequest}static{a(this,"CloudAgentSession")}get cwd(){return this._cwd}get pullRequest(){return this._pullRequest}get idSource(){return this._ids}get hasPullRequest(){return this._pullRequest!==void 0}async startInitialJob(e){let n=this.resetCancellation().token;try{let{owner:o,name:s,baseRef:c}=await this.resolveRepo(n),l=hue(e),u=await this.client.createCodingTask(l,e,o,s,c,n);if(n.isCancellationRequested)return{stream:Promise.resolve()};let d=u.pullRequest;return this._pullRequest=d,this.emit(N4r(d)),oie.info(this.ctx,`${sie}.startInitialJob: job created`,{localSessionId:this.localSessionId,pullRequestNumber:d.number,cloudSessionId:u.sessionId}),{stream:this.streamSessionSafe(u.sessionId,0,void 0,n)}}catch(o){if(n.isCancellationRequested||exe(o))return{stream:Promise.resolve()};throw o}}async submitFollowUp(e){let r=this._pullRequest;if(!r)throw new Error("submitFollowUp called before a pull request was created");let o=this.resetCancellation().token,s=await this.snapshotSessionIds(r.id,o);if(o.isCancellationRequested)return{stream:Promise.resolve()};await new Zh(this.ctx).addPullRequestComment(r.repository.owner.login,r.repository.name,r.number,`@copilot ${e}`);let l=await this.waitForNewSession(r.id,s,o);return o.isCancellationRequested?{stream:Promise.resolve()}:l?{stream:this.streamSessionSafe(l,0,void 0,o)}:(this.emitError("Timed out waiting for the cloud agent to start a new session."),{stream:Promise.resolve()})}resumeStreaming(e){let r=this.resetCancellation();return{stream:this.streamSessionSafe(e.cloudSessionId,e.initialLogLength,e.state,r.token)}}async streamSessionSafe(e,r,n,o){try{await this.streamSession(e,r,n,o)}catch(s){if(o.isCancellationRequested)return;this.emitError(this.errorMessage(s)||"Cloud agent session stream failed")}}stop(){this._cts?.cancel(),this._cts?.dispose(),this._cts=void 0}stopByUser(){this.stop(),this.emitIdle()}async streamSession(e,r,n,o){if(this.emit(this.event("assistant.turn_start",{turnId:(0,T1t.randomUUID)(),interactionId:this.localSessionId})),n!==DL.InProgress){let s=await this.waitForInProgress(e,o);if(o.isCancellationRequested)return;switch(s?.state){case DL.InProgress:break;case DL.Failed:this.emitError(s.error?.message??"The cloud agent session failed.");return;case DL.Completed:this.emitIdle();return;default:this.emitError("The cloud agent session did not start in time.");return}}await this.streamSessionLogs(e,r,o)}async waitForInProgress(e,r){let n=Date.now()+TRc;for(;!r.isCancellationRequested&&Date.now()=JQi){this.emitError("The cloud agent stream stopped after repeated failures.");return}continue}if(!c){oie.warn(this.ctx,`${sie}.streamSessionLogs: session no longer in list; stopping`,{cloudSessionId:e}),this.emitIdle();return}let l;try{l=await this.client.getSessionLogs(e,n)}catch(f){if(oie.warn(this.ctx,`${sie}.streamSessionLogs: log fetch failed; will retry`,{cloudSessionId:e,error:this.errorMessage(f)}),++s>=JQi){this.emitError("The cloud agent stream stopped after repeated failures.");return}continue}s=0;let u=c.state,d=u!==DL.InProgress&&u!==DL.Queued;if(l.length>o){let f=l.slice(o);o=l.length;let h=S1t(this.ctx,f,this._ids);for(let m of h)this.emit(m)}if(d){u===DL.Failed?this.emitError(c.error?.message??"The cloud agent session failed."):this.emitIdle();return}}}async waitForNewSession(e,r,n){let o=Date.now()+IRc;for(;!n.isCancellationRequested&&Date.now()!r.has(l.id)).sort((l,u)=>new Date(u.created_at).getTime()-new Date(l.created_at).getTime())[0];if(c)return c.id}await this.delay(D4r,n)}}async snapshotSessionIds(e,r){let n=await this.client.getAllSessions(e,r);return new Set((n??[]).map(o=>o.id))}async getSessionInfo(e,r){let n=this._pullRequest;return n?(await this.client.getAllSessions(n.id,r)??[]).find(s=>s.id===e):void 0}async resolveRepo(e){let r={uri:this.workspaceFolder.uri},o=await new _f(this.ctx).getRepo(r);if(!o||!o.isGitHub())throw new Error("No GitHub repository found in the workspace folder.");if(!o.owner||!o.name)throw new Error("Could not determine repository owner and name.");let c=await new kO([new PO,new DO]).getBranchInfo(this.ctx,r);if(!c?.currentBranch||c.isDetachedHead)throw new Error("No current branch found or detached HEAD state \u2014 cannot create a cloud agent job.");if(e.isCancellationRequested)throw new Error("Request was cancelled");return{owner:o.owner,name:o.name,baseRef:c.currentBranch}}emit(e){this.notificationSender.sendBackgroundAgentSessionUpdate(this.localSessionId,e,"CLOUD").catch(r=>{oie.warn(this.ctx,`${sie}.emit: failed to send session update`,{localSessionId:this.localSessionId,error:this.errorMessage(r)})})}emitIdle(){this.emit(this.event("session.idle",{}))}emitError(e){this.emit(this.event("session.error",{errorType:"cloudAgent",message:e})),this.emitIdle()}event(e,r){return{id:(0,T1t.randomUUID)(),timestamp:new Date().toISOString(),parentId:null,type:e,data:r}}resetCancellation(){this.stop();let e=new Fn.CancellationTokenSource;return this._cts=e,e}delay(e,r){return new Promise(n=>{let o=setTimeout(()=>{s?.dispose(),n()},e),s=r.onCancellationRequested(()=>{clearTimeout(o),s?.dispose(),n()})})}errorMessage(e){return e instanceof Error?e.message:String(e)}};var XQi=require("crypto");Mo();var y9=new fe("CloudAgent"),E9="CloudAgentService";function xRc(){return{id:"auto",name:"Auto",preview:!1,capabilities:{family:"auto",supports:{vision:!0},limits:{max_context_window_tokens:0}}}}a(xRc,"buildCloudAutoModel");var aie=class{constructor(e){this.ctx=e;this._sessions=new Map;this.notificationSender=e.get(ts),this.client=new HC(e)}static{a(this,"CloudAgentService")}async createSession(e){let r=e.sessionId??Mt(),n=await this.getOrCreateSession(r,e.workspaceFolder);return{sessionId:r,workspacePath:n.cwd}}async resumeSession(e){let{sessionId:r}=e,n=await this.getOrCreateSession(r,e.workspaceFolder);if(!n.pullRequest)return{sessionId:r,workspacePath:n.cwd,events:[]};let{events:o,streamStatus:s}=await this.loadSessionHistory(n.pullRequest,n.idSource);if(s&&(s.state==="in_progress"||s.state==="queued")){let{stream:c}=n.resumeStreaming(s);c.catch(l=>{y9.warn(this.ctx,`${E9}.resumeSession: stream failed`,{sessionId:r,error:l instanceof Error?l.message:String(l)})})}return y9.info(this.ctx,`${E9}.resumeSession`,{sessionId:r,pullRequestNumber:n.pullRequest.number,events:o.length}),{sessionId:r,workspacePath:n.cwd,events:o}}async sendMessage(e,r){let n=this._sessions.get(e.sessionId);if(!n)return Promise.reject(new Error(`Cannot start cloud session ${e.sessionId}: session was not created or resumed first.`));let o=Mt(),s=n.hasPullRequest,{stream:c}=s?await n.submitFollowUp(e.message):await n.startInitialJob(e.message);return c.catch(l=>{y9.warn(this.ctx,`${E9}.sendMessage: turn failed`,{sessionId:e.sessionId,isFollowUp:s,error:l instanceof Error?l.message:String(l)})}),{messageId:o}}stopSession(e){let r=this._sessions.get(e);return r?(r.stopByUser(),y9.info(this.ctx,`${E9}.stopSession`,{sessionId:e}),Promise.resolve()):(y9.warn(this.ctx,`${E9}.stopSession: unknown session`,{sessionId:e}),Promise.resolve())}destroySession(e){return Promise.reject(this.unsupported("destroySession"))}listSessions(e){return Promise.reject(this.unsupported("listSessions"))}listModels(e){return Promise.resolve({models:[xRc()]})}createCloudSession(e,r,n){return new I1t(this.ctx,this.notificationSender,this.client,{localSessionId:e,workspaceFolder:r,pullRequest:n})}async getOrCreateSession(e,r){let n=this._sessions.get(e);if(n)return n;let o=await this.resolvePullRequest(e,r),s=this.createCloudSession(e,r,o);return this._sessions.set(e,s),s}async loadSessionHistory(e,r){let o=(await this.client.getAllSessions(e.id)??[]).slice().sort((u,d)=>new Date(u.created_at).getTime()-new Date(d.created_at).getTime()),s=[],c,l=0;for(let u of o){let d=u.event_content?.trim()||u.name?.trim()||e.title;d?s.push(this.userMessageEvent(d,u.created_at)):y9.warn(this.ctx,`${E9}.loadSessionHistory: session has no prompt`,{cloudSessionId:u.id,pullRequestNumber:e.number}),l===0&&s.push(N4r(e,u.created_at)),l++;let f;try{f=await this.client.getSessionLogs(u.id)}catch(h){y9.warn(this.ctx,`${E9}.loadSessionHistory: log fetch failed`,{cloudSessionId:u.id,error:h instanceof Error?h.message:String(h)});continue}s.push(...S1t(this.ctx,f,r)),c={cloudSessionId:u.id,initialLogLength:f.length,state:u.state}}return{events:s,streamStatus:c}}userMessageEvent(e,r){let n=new Date(r),o=isNaN(n.getTime())?new Date().toISOString():n.toISOString();return{id:(0,XQi.randomUUID)(),timestamp:o,parentId:null,type:"user.message",data:{content:e}}}async resolvePullRequest(e,r){let n=ZQi(e);if(n!==void 0)try{let o=await this.ctx.get(_f).getRepo({uri:r.uri});if(!o||!o.isGitHub()||!o.owner||!o.name){y9.warn(this.ctx,`${E9}.resolvePullRequest: workspace is not a GitHub repo`,{sessionId:e});return}return await new Zh(this.ctx).getPullRequest(o.owner,o.name,n)}catch(o){y9.warn(this.ctx,`${E9}.resolvePullRequest: failed`,{sessionId:e,error:o instanceof Error?o.message:String(o)});return}}unsupported(e){return new Error(`${e} is not supported by CloudAgentService`)}truncateHistory(e){return Promise.reject(this.unsupported("truncateHistory"))}handleInteraction(e){return Promise.resolve({success:!1})}getPlanPath(e){return Promise.reject(this.unsupported("getPlanPath"))}enableRemote(e){return Promise.reject(this.unsupported("enableRemote"))}disableRemote(e){return Promise.reject(this.unsupported("disableRemote"))}getRemoteStatus(e){throw this.unsupported("getRemoteStatus")}compactHistory(e){return Promise.reject(this.unsupported("compactHistory"))}stopCompactHistory(e){return Promise.reject(this.unsupported("stopCompactHistory"))}};p();p();var eqi=require("node:child_process"),tqi=require("node:events"),M4r=de(require("node:readline"));var SV=new fe("CodexProcessManager"),x1t=class extends tqi.EventEmitter{constructor(r,n,o,s){super();this.ctx=r;this.codexPath=n;this.proxyPort=o;this.cwd=s;this.rpcId=0;this.pendingRequests=new Map;this.notificationHandlers=[];this.stopping=!1}static{a(this,"CodexProcessManager")}start(){if(this.process)return;this.stopping=!1;let r=this.codexPath,n=["app-server","-c",'model_provider="copilot"',"-c",'model_providers.copilot.name="copilot"',"-c",`model_providers.copilot.base_url="http://127.0.0.1:${this.proxyPort}/v1"`,"-c",'model_providers.copilot.wire_api="responses"',"-c",'sandbox_permissions=["disk-full-read-access","disk-write-cwd","disk-write-platform-user-temp","network-full-access"]'];SV.debug(this.ctx,`start: cmd=${r} args=${JSON.stringify(n)} cwd=${this.cwd}`);try{this.process=(0,eqi.spawn)(r,n,{env:{...process.env,OPENAI_API_KEY:"copilot-proxy"},stdio:["pipe","pipe","pipe"],cwd:this.cwd||void 0}),SV.debug(this.ctx,`start: spawn succeeded, pid=${this.process.pid}`)}catch(o){let s=o instanceof Error?o.message:String(o);throw SV.error(this.ctx,`start: spawn failed: ${s}`),new Error(`Failed to spawn codex app-server: ${s}`)}this.process.on("error",o=>{SV.error(this.ctx,`process error event: ${o.message}`),this.handleProcessExit(-1)}),this.process.on("exit",o=>{SV.debug(this.ctx,`process exit event: code=${o}`),this.handleProcessExit(o??-1)}),this.process.stdout&&(this.rl=M4r.default.createInterface({input:this.process.stdout}),this.rl.on("line",o=>this.handleLine(o))),this.process.stderr&&M4r.default.createInterface({input:this.process.stderr}).on("line",s=>{SV.debug(this.ctx,`CodexProcessManager [stderr]: ${s}`)})}async stop(){if(this.stopping=!0,!this.process)return;this.rejectAllPending(new Error("Process stopping")),this.process.kill("SIGTERM");let r=setTimeout(()=>{this.process&&!this.process.killed&&this.process.kill("SIGKILL")},5e3);await new Promise(n=>{if(!this.process){n();return}this.process.on("exit",()=>{clearTimeout(r),n()})}),this.process=void 0,this.rl=void 0}sendRequest(r,n){if(!this.process?.stdin)return Promise.reject(new Error("Codex process not running"));let o=++this.rpcId,s=JSON.stringify({jsonrpc:"2.0",id:o,method:r,params:n??{}});return this.process.stdin.write(s+` -`),new Promise((c,l)=>{let u=setTimeout(()=>{this.pendingRequests.delete(o),l(new Error(`Timeout waiting for response to ${r} (id=${o})`))},3e4);this.pendingRequests.set(o,{resolve:c,reject:l,timer:u})})}sendNotification(r,n){if(!this.process?.stdin)return;let o=JSON.stringify({jsonrpc:"2.0",method:r,params:n??{}});this.process.stdin.write(o+` -`)}onNotification(r){this.notificationHandlers.push(r)}isRunning(){return this.process!==void 0&&!this.process.killed}handleLine(r){if(r.trim())try{let n=JSON.parse(r);if(n.id!==void 0&&this.pendingRequests.has(n.id)){let o=this.pendingRequests.get(n.id);this.pendingRequests.delete(n.id),clearTimeout(o.timer),n.error?o.reject(new Error(JSON.stringify(n.error))):o.resolve(n.result)}else if(n.id!==void 0&&n.method)SV.info(this.ctx,`CodexProcessManager: \u2190 REQUEST ${n.method} (id=${n.id}) params=${JSON.stringify(n.params).slice(0,500)}`),this.handleServerRequest(n.id,n.method,n.params);else if(n.method)for(let o of this.notificationHandlers)o(n.method,n.params)}catch{}}handleServerRequest(r,n,o){SV.debug(this.ctx,`CodexProcessManager: server request ${n} (id=${r})`);let s;n.includes("applyPatch")?s={decision:"approved"}:s={decision:"accept"};let c=JSON.stringify({jsonrpc:"2.0",id:r,result:s});this.process?.stdin?.write(c+` -`);for(let l of this.notificationHandlers)l(n,o)}handleProcessExit(r){if(this.process=void 0,this.rl=void 0,this.stopping)return;let n=new Error(`Codex process exited unexpectedly (code: ${r})`);this.rejectAllPending(n),this.emit("error",n)}rejectAllPending(r){for(let[,n]of this.pendingRequests)clearTimeout(n.timer),n.reject(r);this.pendingRequests.clear()}};p();var rqi=de(require("node:http")),nqi=require("node:stream/promises");var _9=new fe("CodexResponsesProxyServer"),wRc=16*1024*1024,w1t=class{constructor(e){this.ctx=e;this.port=0}static{a(this,"CodexResponsesProxyServer")}async start(){if(this.server)return this.port;let e=rqi.createServer((r,n)=>{this.handleRequest(r,n)});return this.server=e,new Promise((r,n)=>{e.once("error",n),e.listen(0,"127.0.0.1",()=>{let o=e.address();o&&typeof o=="object"?(this.port=o.port,_9.info(this.ctx,`CodexResponsesProxyServer listening on port ${o.port}`),e.removeListener("error",n),r(this.port)):n(new Error("Failed to get server address"))})})}async stop(){let e=this.server;e&&(await new Promise(r=>{e.close(()=>r())}),this.server=void 0,this.port=0)}getPort(){return this.port}async handleRequest(e,r){try{if(_9.info(this.ctx,`handleRequest: ${e.method} ${e.url}`),e.method==="POST"&&e.url?.includes("/responses")){let n=await this.readBody(e);_9.info(this.ctx,`proxyToCapiResponses: forwarding ${n.length} bytes`),await this.proxyToCapiResponses(n,r),_9.info(this.ctx,"proxyToCapiResponses: completed")}else _9.debug(this.ctx,`CodexResponsesProxyServer: unhandled ${e.method} ${e.url}`),r.writeHead(404),r.end("{}")}catch(n){_9.exception(this.ctx,n,".handleRequest"),r.headersSent||r.writeHead(500,{"Content-Type":"application/json"}),r.writableEnded||r.end(JSON.stringify({error:{message:"Internal proxy error"}}))}}async proxyToCapiResponses(e,r){let n=this.ctx.get(Qt),o=this.ctx.get(tr),s;try{s=await n.getToken()}catch(h){_9.exception(this.ctx,h,".proxyToCapiResponses/getToken"),r.writeHead(401,{"Content-Type":"application/json"}),r.end(JSON.stringify({error:{message:"Failed to acquire Copilot token"}}));return}let c=ile(this.ctx,s,"v1/responses"),l={...i0(this.ctx),"Content-Type":"application/json"},{headers:u}=await nle(this.ctx,l,s.token),d=new AbortController,f=a(()=>{d.signal.aborted||d.abort()},"onClose");r.on("close",f);try{let h=await o.fetch(c,{method:"POST",headers:u,body:e,signal:d.signal});ole(this.ctx,h,"v1/responses");let m=h.headers.get("content-type")||"application/json";r.writeHead(h.status,{"Content-Type":m});let g=h.body();g?await(0,nqi.pipeline)(g,r):r.end()}catch(h){if(d.signal.aborted){_9.debug(this.ctx,"upstream fetch aborted by client disconnect"),r.writableEnded||r.end();return}if(_9.exception(this.ctx,h,".proxyToCapiResponses"),r.headersSent||r.writableEnded){r.destroy();return}r.writeHead(500,{"Content-Type":"application/json"}),r.end(JSON.stringify({error:{message:"Upstream request failed"}}))}finally{r.removeListener("close",f)}}readBody(e){return new Promise((r,n)=>{let o=[],s=0;e.on("data",c=>{if(s+=c.length,s>wRc){n(new Error("Request body exceeds maximum allowed size")),e.destroy();return}o.push(c)}),e.on("end",()=>r(Buffer.concat(o).toString("utf8"))),e.on("error",n)})}};p();var O4r=require("node:fs"),iqi=de(require("node:os")),R1t=de(require("node:path"));Mo();function RRc(){let t=process.env.CODEX_HOME;return t||R1t.join(iqi.homedir(),".codex")}a(RRc,"codexHome");async function oqi(t){let e=R1t.join(RRc(),"sessions");try{return await sqi(e,t)}catch{return null}}a(oqi,"findRolloutFile");async function sqi(t,e){let r;try{r=await O4r.promises.readdir(t,{withFileTypes:!0})}catch{return null}for(let n of r){let o=R1t.join(t,n.name);if(n.isDirectory()){let s=await sqi(o,e);if(s)return s}else if(n.isFile()&&n.name.endsWith(".jsonl")&&n.name.includes(e))return o}return null}a(sqi,"searchForRollout");async function aqi(t){let e;try{e=await O4r.promises.readFile(t,"utf8")}catch{return null}let r=e.split(` -`).filter(c=>c.trim().length>0),n=[];for(let c of r)try{n.push(JSON.parse(c))}catch{}let o=[],s={sessionStarted:!1,currentTurnId:void 0,eventMsgCompletionCallIds:kRc(n),sealedCallIds:new Set};for(let c of n){let l=PRc(c,s);l&&(Array.isArray(l)?o.push(...l):o.push(l))}return o}a(aqi,"readAndTranslateRollout");function kRc(t){let e=new Set;for(let r of t){if(r.type!=="event_msg")continue;let n=r.payload.type;if(n!=="patch_apply_end"&&n!=="web_search_end")continue;let o=r.payload.call_id;typeof o=="string"&&o.length>0&&e.add(o)}return e}a(kRc,"collectEventMsgCompletionCallIds");function PRc(t,e){switch(t.type){case"event_msg":return DRc(t.timestamp,t.payload,e);case"response_item":return NRc(t.timestamp,t.payload,e);case"turn_context":return null;default:return null}}a(PRc,"translateRolloutLine");function DRc(t,e,r){switch(e.type){case"task_started":return r.currentTurnId=e.turn_id||void 0,r.sessionStarted?null:(r.sessionStarted=!0,{id:Mt(),timestamp:t,type:"session.start",data:{producer:"codex",startTime:t}});case"user_message":{let o=e.message||"",{content:s,attachments:c}=jRc(o),l={content:s};return c.length>0&&(l.attachments=c),{id:Mt(),timestamp:t,type:"user.message",data:l}}case"agent_message":{let o=e.message||"",s=Mt(),c=r.currentTurnId||s;return[{id:Mt(),timestamp:t,type:"assistant.turn_start",data:{turnId:s,interactionId:c}},{id:s,timestamp:t,type:"assistant.message",data:{content:o,messageId:s}}]}case"token_count":{let s=e.info?.last_token_usage;return s?{id:Mt(),timestamp:t,type:"assistant.usage",data:{inputTokens:s.input_tokens,outputTokens:s.output_tokens,cacheReadTokens:s.cached_input_tokens}}:null}case"task_complete":return r.currentTurnId=void 0,{id:Mt(),timestamp:t,type:"session.idle"};case"patch_apply_end":{let o=e.call_id||"";if(!o||r.sealedCallIds.has(o))return null;r.sealedCallIds.add(o);let s=e.success===!0,c=e.changes,l=typeof e.stderr=="string"?e.stderr:"",u=typeof e.status=="string"?e.status:"failed";return{id:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:o,success:s,result:s?{changes:c}:void 0,error:s?void 0:{message:l||`Patch apply ${u}`}}}}case"web_search_end":{let o=e.call_id||"";return!o||r.sealedCallIds.has(o)?null:(r.sealedCallIds.add(o),[{id:Mt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:o,toolName:"web_search",arguments:{query:e.query,action:e.action}}},{id:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:o,success:!0}}])}default:return null}}a(DRc,"translateEventMsg");function NRc(t,e,r){switch(e.type){case"message":return null;case"reasoning":return MRc(t,e);case"function_call":return LRc(t,e,r);case"function_call_output":return BRc(t,e,r);case"custom_tool_call":return FRc(t,e,r);case"custom_tool_call_output":return URc(t,e,r);case"web_search_call":return null;default:return null}}a(NRc,"translateResponseItem");function MRc(t,e){let r=ORc(e);if(!r)return null;let n=e.id||Mt();return{id:Mt(),timestamp:t,type:"assistant.reasoning",data:{reasoningId:n,content:r}}}a(MRc,"translateReasoningItem");function ORc(t){let e=[];for(let r of["summary","content"]){let n=t[r];if(Array.isArray(n)){for(let o of n)if(typeof o=="string")o.length>0&&e.push(o);else if(o&&typeof o=="object"){let s=o.text;typeof s=="string"&&s.length>0&&e.push(s)}}}return e.join(` -`).trim()}a(ORc,"extractReasoningText");function LRc(t,e,r){let n=e.call_id||e.id||"";if(!n)return null;let o=e.name||"unknown",s=o==="shell_command"?"shell":o,c=QRc(e.arguments);return{id:Mt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:n,toolName:s,arguments:c??{}}}}a(LRc,"translateFunctionCall");function BRc(t,e,r){let n=e.call_id||"";if(!n||r.sealedCallIds.has(n))return null;r.sealedCallIds.add(n);let o=typeof e.output=="string"?e.output:"";return{id:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:n,success:!0,result:{content:o}}}}a(BRc,"translateFunctionCallOutput");function FRc(t,e,r){let n=e.call_id||e.id||"";if(!n)return null;let o=e.name||"unknown",s=o==="apply_patch"?"file_change":o;return{id:Mt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:n,toolName:s,arguments:{input:e.input}}}}a(FRc,"translateCustomToolCall");function URc(t,e,r){let n=e.call_id||"";if(!n||r.eventMsgCompletionCallIds.has(n)||r.sealedCallIds.has(n))return null;r.sealedCallIds.add(n);let o=typeof e.output=="string"?e.output:"";return{id:Mt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:n,success:!0,result:{content:o}}}}a(URc,"translateCustomToolCallOutput");function QRc(t){if(typeof t!="string")return null;try{let e=JSON.parse(t);return e&&typeof e=="object"&&!Array.isArray(e)?e:null}catch{return null}}a(QRc,"parseJsonSafe");var qRc=/^\[Referenced files:([^\]]*)\]\r?\n\r?\n/;function jRc(t){let e=qRc.exec(t);if(!e)return{content:t,attachments:[]};let r=e[1].split(",").map(n=>n.trim()).filter(n=>n.length>0).map(n=>({type:"file",path:n,displayName:HRc(n)}));return{content:t.slice(e[0].length),attachments:r}}a(jRc,"extractReferencedFiles");function HRc(t){let e=t.replace(/\\/g,"/"),r=e.lastIndexOf("/");return r===-1?e:e.slice(r+1)}a(HRc,"basename");p();Mo();function Fm(t,e,r){return{id:Mt(),timestamp:new Date().toISOString(),type:t,...e!==void 0?{data:e}:{},...r?{ephemeral:r}:{}}}a(Fm,"envelope");function AEe(){return{turnStreamCtx:new Map}}a(AEe,"createCodexTranslatorState");function cqi(t,e){let r=t.turnStreamCtx.get(e);return r||(r={agentMessageIds:[],reasoningIds:[]},t.turnStreamCtx.set(e,r)),r}a(cqi,"ctxFor");function lqi(t,e,r){switch(t){case"turn/started":return GRc(e);case"turn/completed":return $Rc(e,r);case"item/started":return VRc(e,r);case"item/completed":return WRc(e,r);case"thread/tokenUsage/updated":return zRc(e);case"item/agentMessage/delta":return KRc(e);case"item/reasoning/summaryTextDelta":return hkc(e,r);case"item/commandExecution/outputDelta":return tkc(e);default:return null}}a(lqi,"translateCodexNotification");function GRc(t){return null}a(GRc,"translateTurnStarted");function $Rc(t,e){let r=[];return r.push(Fm("assistant.usage",{model:"codex",duration:t.turn?.durationMs??void 0},!0)),r.push(Fm("session.idle",{},!0)),t.turn?.id&&e.turnStreamCtx.delete(t.turn.id),r}a($Rc,"translateTurnCompleted");function VRc(t,e){let r=t.item;if(!r)return null;switch(r.type){case"agentMessage":return YRc(e,t.turnId,r);case"commandExecution":return XRc(r);case"fileChange":return rkc(r);case"mcpToolCall":return ikc(r);case"webSearch":return akc(r);case"imageView":return lkc(r);case"dynamicToolCall":return dkc(r);case"reasoning":return pkc(e,t.turnId,r);default:return null}}a(VRc,"translateItemStarted");function WRc(t,e){let r=t.item;if(!r)return null;switch(r.type){case"agentMessage":return JRc(e,t.turnId,r);case"commandExecution":return ekc(r);case"fileChange":return nkc(r);case"mcpToolCall":return okc(r);case"webSearch":return ckc(r);case"imageView":return ukc(r);case"dynamicToolCall":return fkc(r);case"reasoning":return mkc(e,t.turnId,r);default:return null}}a(WRc,"translateItemCompleted");function zRc(t){let e=t.tokenUsage.last;return Fm("assistant.usage",{inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheReadTokens:e.cachedInputTokens})}a(zRc,"translateTokenUsageUpdated");function YRc(t,e,r){return cqi(t,e).agentMessageIds.push(r.id),Fm("assistant.turn_start",{turnId:r.id,interactionId:e})}a(YRc,"translateAgentMessageItemStarted");function KRc(t){return Fm("assistant.message_delta",{messageId:t.itemId||t.turnId,deltaContent:t.delta},!0)}a(KRc,"translateAgentMessageDelta");function JRc(t,e,r){let n=r.text??"";if(n.length===0)return null;let o=t.turnStreamCtx.get(e)?.agentMessageIds.shift()??r.id;return Fm("assistant.message",{messageId:o,content:n})}a(JRc,"translateAgentMessageItemCompleted");function yEe(t){return t==="failed"||t==="cancelled"||t==="declined"}a(yEe,"isFailedStatus");var L4r=4096;function ZRc(t){return t.length<=L4r?t:`${t.slice(0,L4r)} -\u2026 [truncated ${t.length-L4r} chars]`}a(ZRc,"truncateForError");function XRc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:"shell",arguments:{command:t.command,cwd:t.cwd,commandActions:t.commandActions}})}a(XRc,"translateCommandExecutionItemStarted");function ekc(t){let e=!yEe(t.status),r=t.aggregatedOutput??"";return Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{content:r}:void 0,error:e?void 0:{message:r.length>0?ZRc(r):`Command ${t.status??"failed"} with exit code ${t.exitCode??"unknown"}`},durationMs:t.durationMs??void 0,exitCode:t.exitCode??void 0})}a(ekc,"translateCommandExecutionItemCompleted");function tkc(t){return null}a(tkc,"translateCommandExecutionOutputDelta");function rkc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:"file_change",arguments:{changes:t.changes}})}a(rkc,"translateFileChangeItemStarted");function nkc(t){let e=!yEe(t.status);return Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{changes:t.changes}:void 0,error:e?void 0:{message:`File change ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(nkc,"translateFileChangeItemCompleted");function ikc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:`mcp:${t.server}.${t.tool}`,arguments:t.arguments??{}})}a(ikc,"translateMcpToolCallItemStarted");function okc(t){let e=!yEe(t.status)&&!t.error;return Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?skc(t.result):void 0,error:e?void 0:{message:t.error??`MCP tool ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(okc,"translateMcpToolCallItemCompleted");function skc(t){return t&&typeof t=="object"&&!Array.isArray(t)&&"content"in t?t:{content:t}}a(skc,"wrapMcpResult");function akc(t){return null}a(akc,"translateWebSearchItemStarted");function ckc(t){let e=!yEe(t.status),r=t.query?.trim()?t.query:t.action?.query??t.action?.queries?.join(", "),n=t.results!==void 0&&t.results!==null;return[Fm("tool.execution_start",{toolCallId:t.id,toolName:"web_search",arguments:{query:r,action:t.action}}),Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e&&n?{content:t.results}:void 0,error:e?void 0:{message:`Web search ${t.status??"failed"}`},durationMs:t.durationMs??void 0})]}a(ckc,"translateWebSearchItemCompleted");function lkc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:"view_image",arguments:{path:t.path}})}a(lkc,"translateImageViewItemStarted");function ukc(t){let e=!yEe(t.status);return Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{path:t.path}:void 0,error:e?void 0:{message:`Image view ${t.status??"failed"}`}})}a(ukc,"translateImageViewItemCompleted");function dkc(t){return Fm("tool.execution_start",{toolCallId:t.id,toolName:t.tool,arguments:t.arguments??{}})}a(dkc,"translateDynamicToolCallItemStarted");function fkc(t){let e=t.success!==void 0?t.success:!yEe(t.status)&&!t.error;return Fm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{content:t.contentItems}:void 0,error:e?void 0:{message:t.error??`Tool ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(fkc,"translateDynamicToolCallItemCompleted");function pkc(t,e,r){return cqi(t,e).reasoningIds.push(r.id),null}a(pkc,"translateReasoningItemStarted");function hkc(t,e){let r=e.turnStreamCtx.get(t.turnId)?.reasoningIds,n=r&&r.length>0?r[r.length-1]:void 0;return Fm("assistant.reasoning_delta",{reasoningId:t.itemId||t.reasoningId||n||`codex-reasoning:${t.turnId}`,deltaContent:t.delta},!0)}a(hkc,"translateReasoningDelta");function mkc(t,e,r){let n=t.turnStreamCtx.get(e)?.reasoningIds.shift()??r.id,o=gkc(r);return o?Fm("assistant.reasoning",{reasoningId:n,content:o}):null}a(mkc,"translateReasoningItemCompleted");function gkc(t){let e=[];for(let r of[t.summary,t.content])if(Array.isArray(r))for(let n of r)typeof n=="string"?n.length>0&&e.push(n):n&&typeof n.text=="string"&&n.text.length>0&&e.push(n.text);return e.join(` -`).trim()}a(gkc,"extractReasoningText");Mo();var nA=new fe("CodexAgentService"),cie=class{constructor(e){this.ctx=e;this.initialized=!1;this.sessions=new Map;this.proxyServer=new w1t(e),this.notificationSender=e.get(ts),this.codexPath=this.resolveCodexPath()}static{a(this,"CodexAgentService")}resolveCodexPath(){let e=Ft(this.ctx,Ye.CodexCliPath);if(e)return e;let r=process.env.CODEX_CLI_PATH;return r||(process.platform==="win32"?"codex.exe":"codex")}async ensureRunning(){if(this.processManager?.isRunning())return;if(this.codexPath=this.resolveCodexPath(),this.initialized=!1,!this.workspaceCwd)try{let r=this.ctx.get($r).getWorkspaceFolders();if(r.length>0){let n=new URL(r[0].uri);this.workspaceCwd=n.pathname.replace(/^\/([A-Za-z]:)/,"$1")}}catch{}let e=await this.proxyServer.start();this.processManager=new x1t(this.ctx,this.codexPath,e,this.workspaceCwd),this.processManager.onNotification((r,n)=>{this.handleNotification(r,n)}),this.processManager.on("error",r=>{nA.error(this.ctx,"Codex process died",{error:r.message}),this.emitErrorToAllSessions(r.message)}),this.processManager.start(),await new Promise(r=>setTimeout(r,1e3))}async ensureInitialized(){if(await this.ensureRunning(),!this.initialized)try{await this.processManager.sendRequest("initialize",{clientInfo:{name:"copilot-jetbrains",title:"GitHub Copilot for JetBrains",version:"1.0.0"},capabilities:{}}),this.processManager.sendNotification("initialized",{}),this.initialized=!0,await new Promise(e=>setTimeout(e,300))}catch(e){let r=e instanceof Error?e.message:String(e);throw new Error(`Failed to initialize Codex process: ${r}`)}}async createSession(e){return kb(this.ctx,"codexAgent.createSession",async r=>{if(nA.info(this.ctx,"createSession",{clientSessionId:e.sessionId,model:e.model}),!this.workspaceCwd&&e.workspaceFolder?.uri)try{let c=new URL(e.workspaceFolder.uri);this.workspaceCwd=c.pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{this.workspaceCwd=e.workspaceFolder.uri}await this.ensureInitialized();let n=await this.processManager.sendRequest("thread/start"),o=n.thread.id,s=new Date().toISOString();return this.sessions.set(o,{sessionId:o,threadId:n.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,startTime:s,modifiedTime:s,translatorState:AEe()}),r.properties.sessionId=o,r.properties.modelId=e.model??"",{sessionId:o,workspacePath:e.workspaceFolder?.uri}})}async resumeSession(e){return kb(this.ctx,"codexAgent.resumeSession",async r=>{let n=e.sessionId;nA.info(this.ctx,"resumeSession",{threadId:n}),r.properties.sessionId=n;let o=this.sessions.get(n);if(o){r.properties.reason="inMemory";let c=await this.loadHistoricalEvents(n,r,e.model??o.model);return r.measurements.eventCount=c?.length??0,{sessionId:n,workspacePath:o.workspacePath,events:c}}if(!this.workspaceCwd&&e.workspaceFolder?.uri)try{let c=new URL(e.workspaceFolder.uri);this.workspaceCwd=c.pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{this.workspaceCwd=e.workspaceFolder.uri}await this.ensureInitialized();try{let c=await this.processManager.sendRequest("thread/resume",{threadId:n}),l=new Date().toISOString();this.sessions.set(n,{sessionId:n,threadId:c.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,startTime:l,modifiedTime:l,summary:"(resumed)",translatorState:AEe()})}catch(c){let l=c instanceof Error?c.message:String(c);nA.warn(this.ctx,"resumeSession: thread/resume failed, creating fresh thread",{threadId:n,error:l});let u=await this.processManager.sendRequest("thread/start",{}),d=new Date().toISOString();this.sessions.set(n,{sessionId:n,threadId:u.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,startTime:d,modifiedTime:d,summary:"(resumed - fresh)",translatorState:AEe()}),r.properties.freshThread="true"}let s=await this.loadHistoricalEvents(n,r,e.model);return r.measurements.eventCount=s?.length??0,{sessionId:n,workspacePath:e.workspaceFolder?.uri,events:s}})}async loadHistoricalEvents(e,r,n){try{let o=await oqi(e);if(!o){r.properties.rolloutMissing="true",nA.debug(this.ctx,"loadHistoricalEvents: rollout file not found",{threadId:e});return}let s=await aqi(o);if(!s){r.properties.rolloutReadFailed="true",nA.warn(this.ctx,"loadHistoricalEvents: rollout translation returned null",{threadId:e,rolloutPath:o});return}if(n)for(let c of s)c.type==="assistant.usage"&&c.data&&(c.data.model=n);return s}catch(o){let s=o instanceof Error?o.message:String(o);r.properties.rolloutReadFailed="true",nA.warn(this.ctx,"loadHistoricalEvents: error reading rollout",{threadId:e,error:s});return}}async sendMessage(e,r){return kb(this.ctx,"codexAgent.sendMessage",async n=>{nA.info(this.ctx,"sendMessage",{sessionId:e.sessionId}),n.properties.sessionId=e.sessionId,n.properties.modelId=e.model??"",await this.ensureInitialized();let o=this.sessions.get(e.sessionId);if(!o){nA.info(this.ctx,"sendMessage: session not in memory, auto-recovering");try{let l=await this.processManager.sendRequest("thread/resume",{threadId:e.sessionId}),u=new Date().toISOString();o={sessionId:e.sessionId,threadId:l.thread.id,workspacePath:this.workspaceCwd,model:e.model,startTime:u,modifiedTime:u,translatorState:AEe()},this.sessions.set(e.sessionId,o)}catch(l){nA.warn(this.ctx,"sendMessage: thread/resume failed, creating fresh thread",{error:String(l)});let u=await this.processManager.sendRequest("thread/start",{}),d=new Date().toISOString();o={sessionId:e.sessionId,threadId:u.thread.id,workspacePath:this.workspaceCwd,model:e.model,startTime:d,modifiedTime:d,translatorState:AEe()},this.sessions.set(e.sessionId,o)}}let s=[];if(e.references?.length){let l=e.references.filter(u=>u.type==="file").map(u=>{try{return new URL(u.uri).pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{return u.uri}});l.length>0&&s.push({type:"text",text:`[Referenced files: ${l.join(", ")}] - -`})}s.push({type:"text",text:e.message});let c=await this.processManager.sendRequest("turn/start",{threadId:o.threadId,input:s});return o.turnId=c.turnId,e.model&&(o.model=e.model),o.modifiedTime=new Date().toISOString(),o.summary||(o.summary=e.message.slice(0,100)),n.measurements.messageCharLen=e.message.length,{messageId:c.turnId}})}truncateHistory(e){return Promise.reject(new Error("truncateHistory is not supported for Codex sessions"))}async stopSession(e){let r=this.sessions.get(e);!r||!r.turnId||(await this.processManager?.sendRequest("turn/interrupt",{threadId:r.threadId,turnId:r.turnId}),nA.info(this.ctx,"CodexAgentService.stopSession",{sessionId:e}))}destroySession(e){return this.sessions.delete(e.sessionId),nA.info(this.ctx,"CodexAgentService.destroySession",{sessionId:e.sessionId}),Promise.resolve({success:!0})}listSessions(e){let r=Array.from(this.sessions.values()).map(n=>{let o;if(n.workspacePath)try{o=new URL(n.workspacePath).pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{o=n.workspacePath}return{sessionId:n.sessionId,startTime:n.startTime,modifiedTime:n.modifiedTime,summary:n.summary,isRemote:!1,context:o?{cwd:o}:void 0}});return r.sort((n,o)=>o.modifiedTime.localeCompare(n.modifiedTime)),nA.info(this.ctx,`CodexAgentService.listSessions: ${r.length} sessions`),Promise.resolve({sessions:r})}async listModels(e){try{let o=(await this.ctx.get(xs).getMetadata(e)).filter(s=>s.supported_endpoints?.includes(x$e.Responses)&&s.model_picker_enabled&&s.capabilities.type==="chat");if(o.length>0){let s=o.map((c,l)=>({id:c.id,name:c.name,vendor:c.vendor,preview:c.preview??!1,isDefault:c.is_chat_default??l===0,modelPickerEnabled:c.model_picker_enabled,modelPickerCategory:c.model_picker_category,modelPickerPriceCategory:c.model_picker_price_category,capabilities:{family:c.capabilities.family,supports:{vision:c.capabilities.supports?.vision??!1,reasoningEfforts:c.capabilities.supports?.reasoning_effort},limits:c.capabilities.limits?{max_context_window_tokens:c.capabilities.limits.max_context_window_tokens,max_output_tokens:c.capabilities.limits.max_output_tokens}:{max_context_window_tokens:128e3}},billing:c.billing?{isPremium:c.billing.is_premium??!0,multiplier:c.billing.multiplier??0}:void 0,policy:c.policy}));return nA.info(this.ctx,`CodexAgentService.listModels: ${s.length} responses-capable models from CAPI`),{models:s}}nA.warn(this.ctx,"CodexAgentService.listModels: no responses-capable models found in CAPI")}catch(r){let n=r instanceof Error?r.message:String(r);nA.warn(this.ctx,`CodexAgentService.listModels: CAPI query failed: ${n}, using fallback`)}return{models:[{id:"codex-default",name:"Codex (Default)",preview:!1,capabilities:{family:"codex",supports:{vision:!1},limits:{max_context_window_tokens:128e3}}}]}}handleInteraction(e){return Promise.reject(new Error("Codex interaction handling not yet implemented"))}getPlanPath(e){return Promise.resolve(null)}async enableRemote(e){await this.ensureInitialized();try{return await this.processManager.sendRequest("remoteControl/enable",{}),{remoteSteerable:!0}}catch{throw new Error("Codex remote control not available")}}async disableRemote(e){await this.ensureInitialized(),await this.processManager.sendRequest("remoteControl/disable",{})}getRemoteStatus(e){return{remoteSteerable:!1}}async compactHistory(e){await this.ensureInitialized();let r=this.sessions.get(e);return r?(await this.processManager.sendRequest("thread/compact/start",{threadId:r.threadId}),{success:!0,tokensRemoved:0,messagesRemoved:0,summaryContent:""}):{success:!1,tokensRemoved:0,messagesRemoved:0,summaryContent:""}}async stopCompactHistory(e){let r=this.sessions.get(e);return!r||!r.turnId?{aborted:!1}:(await this.processManager?.sendRequest("turn/interrupt",{threadId:r.threadId,turnId:r.turnId}),{aborted:!0})}handleNotification(e,r){nA.info(this.ctx,`handleNotification: method=${e}`,{params:JSON.stringify(r).slice(0,500)});let o=r?.threadId;if(!o){nA.warn(this.ctx,`handleNotification: no threadId in params for method=${e}`);return}let s=this.findSessionByThreadId(o);if(!s)return;if(e==="turn/started"){let u=r;u.turn?.id&&(s.turnId=u.turn.id)}let c=lqi(e,r,s.translatorState);if(!c)return;let l=Array.isArray(c)?c:[c];for(let u of l)u.type==="assistant.usage"&&u.data&&s.model&&(u.data.model=s.model),this.notificationSender.sendBackgroundAgentSessionUpdate(s.sessionId,u,"CODEX")}findSessionByThreadId(e){for(let r of this.sessions.values())if(r.threadId===e)return r}emitErrorToAllSessions(e){for(let r of this.sessions.values()){let n={id:Mt(),timestamp:new Date().toISOString(),type:"session.error",data:{errorType:"process_crash",message:`Codex process terminated unexpectedly: ${e}. Send a new message to retry.`}};this.notificationSender.sendBackgroundAgentSessionUpdate(r.sessionId,n,"CODEX");let o={id:Mt(),timestamp:new Date().toISOString(),type:"session.idle"};this.notificationSender.sendBackgroundAgentSessionUpdate(r.sessionId,o,"CODEX")}}async dispose(){await this.processManager?.stop(),await this.proxyServer.stop()}};var uqi=new fe("AgentRouter"),dqi="AgentRouter";function AI(t){return t.agentProvider??"BACKGROUND"}a(AI,"resolveProvider");var fc=class{constructor(e){this.ctx=e}static{a(this,"AgentRouter")}serviceFor(e){switch(e){case"BACKGROUND":return this.ctx.get(Hs);case"CLAUDE":return this.ctx.get(y8);case"CODEX":return this.ctx.get(cie);case"CLOUD":return this.ctx.get(aie)}}logDispatch(e,r){uqi.debug(this.ctx,`${dqi}.${e}`,r)}create(e){this.logDispatch("create",e);let r=AI(e);return this.serviceFor(r).createSession(e)}resume(e){this.logDispatch("resume",e);let r=AI(e);return this.serviceFor(r).resumeSession(e)}send(e,r){this.logDispatch("send",e);let n=AI(e);return this.serviceFor(n).sendMessage(e,r)}truncateHistory(e){this.logDispatch("truncateHistory",e);let r=e.providerName;return this.serviceFor(r).truncateHistory({sessionId:e.sessionId,eventId:e.eventId,providerName:e.providerName})}stop(e){this.logDispatch("stop",e);let r=AI(e);return this.serviceFor(r).stopSession(e.sessionId)}destroy(e){this.logDispatch("destroy",e);let r=AI(e);return this.serviceFor(r).destroySession(e)}listSessions(e){this.logDispatch("listSessions",e);let r=AI(e);return this.serviceFor(r).listSessions(e)}listModels(e){this.logDispatch("listModels",e);let r=AI(e);return this.serviceFor(r).listModels(e.forceRefresh)}interaction(e){this.logDispatch("interaction",e);let r=AI(e);return this.serviceFor(r).handleInteraction(e)}async getPlanPath(e){this.logDispatch("getPlanPath",e);let r=AI(e);return{path:await this.serviceFor(r).getPlanPath(e.sessionId)}}enableRemote(e){this.logDispatch("enableRemote",e);let r=AI(e);return this.serviceFor(r).enableRemote(e.sessionId)}async disableRemote(e){this.logDispatch("disableRemote",e);let r=AI(e);return await this.serviceFor(r).disableRemote(e.sessionId),{success:!0}}getRemoteStatus(e){this.logDispatch("getRemoteStatus",e);let r=AI(e);try{return Promise.resolve(this.serviceFor(r).getRemoteStatus(e.sessionId))}catch(n){return Promise.reject(n instanceof Error?n:new Error(String(n)))}}async compactHistory(e,r){this.logDispatch("compactHistory",e);let n=AI(e),o=this.serviceFor(n),s=r?.onCancellationRequested(()=>{uqi.info(this.ctx,`${dqi}.compactHistory: cancellation requested, aborting compaction`,{sessionId:e.sessionId}),o.stopCompactHistory(e.sessionId)});try{return await o.compactHistory(e.sessionId)}finally{s?.dispose()}}};p();p();var Akc=S.Union([S.String(),S.Number()]),wi=S.String(),EEe=S.Optional(S.String()),ykc=S.Object({name:S.String(),description:S.String(),title:S.Optional(S.String()),parameters:S.Optional(S.Record(S.String(),S.Unknown())),overridesBuiltInTool:S.Optional(S.Boolean()),skipPermission:S.Optional(S.Boolean())}),B4r=S.Array(ykc),l3e=S.Union([S.Literal("default"),S.Literal("long_context")]),_Ee=S.Object({model:S.Optional(S.String()),reasoningEffort:EEe,workspaceFolder:S.Object({uri:S.String(),name:S.Optional(S.String())}),globalAgentsMdInstructions:S.Optional(S.String()),globalClaudeMdInstructions:S.Optional(S.String()),externalToolDefinitions:S.Optional(B4r),useAgentsMdFile:S.Optional(S.Boolean()),useNestedAgentsMdFiles:S.Optional(S.Boolean()),useClaudeMdFile:S.Optional(S.Boolean()),useNestedClaudeMdFiles:S.Optional(S.Boolean()),inlineConfinedFile:S.Optional(S.String()),mcpDirectory:S.Optional(S.String())});async function _i(t){try{return[await t(),null]}catch(e){let r=Mrt(e),n=e instanceof UJ?e.data:void 0;return[null,{code:Ze.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(_i,"withServiceErrorHandling");var fqi=new fe("BackgroundAgent.compactHistory"),Ekc=S.Object({sessionId:wi});async function F4r(t,e,r){fqi.info(t,"handleBackgroundAgentCompactHistory called",{sessionId:r.sessionId});let n=t.get(Hs),o=e.onCancellationRequested(()=>{fqi.info(t,"handleBackgroundAgentCompactHistory: cancellation requested, aborting compaction",{sessionId:r.sessionId}),n.stopCompactHistory(r.sessionId)});try{return await _i(async()=>n.compactHistory(r.sessionId))}finally{o.dispose()}}a(F4r,"handleBackgroundAgentCompactHistoryChecked");var Eth=Oe(Ekc,F4r);p();var U4r=S.Union(Object.values(Ap).map(t=>S.Literal(t))),Fl=S.Optional(U4r),k1t=S.Intersect([_Ee,S.Object({agentProvider:Fl})]);var pqi=new fe("BackgroundAgent.compactHistory"),_kc=S.Object({sessionId:wi,agentProvider:Fl});async function vkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return F4r(t,e,r);pqi.info(t,"handleAgentCompactHistory called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.compactHistory(s,e);return pqi.info(t,"compactHistory succeeded"),c})}a(vkc,"handleAgentCompactHistoryChecked");var hqi=Oe(_kc,vkc);p();p();var mqi=new fe("BackgroundAgent.create"),Ckc=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),_Ee]);async function Q4r(t,e,r){mqi.info(t,"handleBackgroundAgentCreate called",{model:r.model,workspaceFolder:r.workspaceFolder});let n=t.get(Hs),o={sessionId:r.sessionId,model:r.model,reasoningEffort:r.reasoningEffort,workspaceFolder:r.workspaceFolder,globalAgentsMdInstructions:r.globalAgentsMdInstructions,globalClaudeMdInstructions:r.globalClaudeMdInstructions,externalToolDefinitions:r.externalToolDefinitions,useAgentsMdFile:r.useAgentsMdFile,useNestedAgentsMdFiles:r.useNestedAgentsMdFiles,useClaudeMdFile:r.useClaudeMdFile,useNestedClaudeMdFiles:r.useNestedClaudeMdFiles,inlineConfinedFile:r.inlineConfinedFile,mcpDirectory:r.mcpDirectory};return _i(async()=>{let s=await n.createSession(o);return mqi.info(t,"createSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath}})}a(Q4r,"handleBackgroundAgentCreateChecked");var Wth=Oe(Ckc,Q4r);var gqi=new fe("BackgroundAgent.create"),bkc=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),k1t]);async function Skc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return Q4r(t,e,r);gqi.info(t,"handleAgentCreate called",{agentProvider:r.agentProvider,model:r.model,workspaceFolder:r.workspaceFolder});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.create(s);return gqi.info(t,"create succeeded:",c.sessionId),c})}a(Skc,"handleAgentCreateChecked");var Aqi=Oe(bkc,Skc);p();p();var Tkc=S.Object({sessionId:wi});async function q4r(t,e,r){let n=t.get(Hs);return _i(async()=>({success:(await n.destroySession({sessionId:r.sessionId})).success}))}a(q4r,"handleBackgroundAgentDestroyChecked");var prh=Oe(Tkc,q4r);var Ikc=new fe("BackgroundAgent.destroy"),xkc=S.Object({sessionId:wi,agentProvider:Fl});async function wkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return q4r(t,e,r);Ikc.info(t,"handleAgentDestroy called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.destroy(s))}a(wkc,"handleAgentDestroyChecked");var yqi=Oe(xkc,wkc);p();p();var Rkc=new fe("BackgroundAgent.disableRemote"),kkc=S.Object({sessionId:wi});async function j4r(t,e,r){Rkc.info(t,"handleBackgroundAgentDisableRemote called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(async()=>(await n.disableRemote(r.sessionId),{success:!0}))}a(j4r,"handleBackgroundAgentDisableRemoteChecked");var Mrh=Oe(kkc,j4r);var Eqi=new fe("BackgroundAgent.disableRemote"),Pkc=S.Object({sessionId:wi,agentProvider:Fl});async function Dkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return j4r(t,e,r);Eqi.info(t,"handleAgentDisableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.disableRemote(s);return Eqi.info(t,"disableRemote succeeded"),c})}a(Dkc,"handleAgentDisableRemoteChecked");var _qi=Oe(Pkc,Dkc);p();p();var Nkc=new fe("BackgroundAgent.enableRemote"),Mkc=S.Object({sessionId:wi});async function H4r(t,e,r){Nkc.info(t,"handleBackgroundAgentEnableRemote called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(async()=>n.enableRemote(r.sessionId))}a(H4r,"handleBackgroundAgentEnableRemoteChecked");var tnh=Oe(Mkc,H4r);var vqi=new fe("BackgroundAgent.enableRemote"),Okc=S.Object({sessionId:wi,agentProvider:Fl});async function Lkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return H4r(t,e,r);vqi.info(t,"handleAgentEnableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.enableRemote(s);return vqi.info(t,"enableRemote succeeded"),c})}a(Lkc,"handleAgentEnableRemoteChecked");var Cqi=Oe(Okc,Lkc);p();p();var Bkc=S.Object({sessionId:wi});async function G4r(t,e,r){let n=t.get(Hs);return _i(async()=>({path:await n.getPlanPath(r.sessionId)}))}a(G4r,"handleBackgroundAgentGetPlanPathChecked");var vnh=Oe(Bkc,G4r);var Fkc=new fe("BackgroundAgent.getPlanPath"),Ukc=S.Object({sessionId:wi,agentProvider:Fl});async function Qkc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return G4r(t,e,r);Fkc.info(t,"handleAgentGetPlanPath called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.getPlanPath(s))}a(Qkc,"handleAgentGetPlanPathChecked");var bqi=Oe(Ukc,Qkc);p();p();var qkc=new fe("BackgroundAgent.getRemoteStatus"),jkc=S.Object({sessionId:wi});async function $4r(t,e,r){qkc.info(t,"handleBackgroundAgentGetRemoteStatus called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(()=>Promise.resolve(n.getRemoteStatus(r.sessionId)))}a($4r,"handleBackgroundAgentGetRemoteStatusChecked");var jnh=Oe(jkc,$4r);var Hkc=new fe("BackgroundAgent.getRemoteStatus"),Gkc=S.Object({sessionId:wi,agentProvider:Fl});async function $kc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return $4r(t,e,r);Hkc.info(t,"handleAgentGetRemoteStatus called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.getRemoteStatus(s))}a($kc,"handleAgentGetRemoteStatusChecked");var Sqi=Oe(Gkc,$kc);p();p();var Vkc=new fe("BackgroundAgent.interaction"),Wkc=S.Union([S.Object({kind:S.Literal("approve-once")}),S.Object({kind:S.Literal("denied-by-rules"),rules:S.Array(S.Unknown())}),S.Object({kind:S.Literal("denied-no-approval-rule-and-could-not-request-from-user")}),S.Object({kind:S.Literal("denied-interactively-by-user"),feedback:S.Optional(S.String())}),S.Object({kind:S.Literal("denied-by-content-exclusion-policy"),path:S.String(),message:S.String()})]),zkc=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),Ykc=S.Object({action:S.Union([S.Literal("accept"),S.Literal("decline"),S.Literal("cancel")]),content:S.Optional(S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean(),S.Array(S.String())])))}),Kkc=S.Object({approved:S.Boolean(),selectedAction:S.Optional(S.Union([S.Literal("exit_only"),S.Literal("interactive"),S.Literal("autopilot"),S.Literal("autopilot_fleet")])),autoApproveEdits:S.Optional(S.Boolean()),feedback:S.Optional(S.String())}),Jkc=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),Zkc=S.Union([S.String(),S.Object({textResultForLlm:S.String(),binaryResultsForLlm:S.Optional(S.Array(S.Object({data:S.String(),mimeType:S.String(),type:S.Union([S.Literal("resource"),S.Literal("image")]),description:S.Optional(S.String())}))),resultType:S.Union([S.Literal("success"),S.Literal("failure"),S.Literal("rejected"),S.Literal("denied")]),error:S.Optional(S.String())})]),Xkc=S.Union([S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("permission"),result:Wkc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("user_input"),response:zkc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("elicitation"),response:Ykc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:Kkc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("queued_command"),result:Jkc}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("external_tool"),result:Zkc})]);async function V4r(t,e,r){Vkc.info(t,"handleBackgroundAgentInteraction called",{sessionId:r.sessionId,type:r.type,requestId:r.requestId});let n=t.get(Hs);return _i(async()=>await n.handleInteraction(r))}a(V4r,"handleBackgroundAgentInteractionChecked");var lih=Oe(Xkc,V4r);var Tqi=new fe("BackgroundAgent.interaction"),ePc=S.Union([S.Object({kind:S.Literal("approve-once")}),S.Object({kind:S.Literal("denied-by-rules"),rules:S.Array(S.Unknown())}),S.Object({kind:S.Literal("denied-no-approval-rule-and-could-not-request-from-user")}),S.Object({kind:S.Literal("denied-interactively-by-user"),feedback:S.Optional(S.String())}),S.Object({kind:S.Literal("denied-by-content-exclusion-policy"),path:S.String(),message:S.String()})]),tPc=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),rPc=S.Object({action:S.Union([S.Literal("accept"),S.Literal("decline"),S.Literal("cancel")]),content:S.Optional(S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean(),S.Array(S.String())])))}),nPc=S.Object({approved:S.Boolean(),selectedAction:S.Optional(S.Union([S.Literal("exit_only"),S.Literal("interactive"),S.Literal("autopilot"),S.Literal("autopilot_fleet")])),autoApproveEdits:S.Optional(S.Boolean()),feedback:S.Optional(S.String())}),iPc=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),oPc=S.Union([S.String(),S.Object({textResultForLlm:S.String(),binaryResultsForLlm:S.Optional(S.Array(S.Object({data:S.String(),mimeType:S.String(),type:S.Union([S.Literal("resource"),S.Literal("image")]),description:S.Optional(S.String())}))),resultType:S.Union([S.Literal("success"),S.Literal("failure"),S.Literal("rejected"),S.Literal("denied")]),error:S.Optional(S.String())})]),sPc=S.Union([S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("permission"),result:ePc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("user_input"),response:tPc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("elicitation"),response:rPc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:nPc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("queued_command"),result:iPc,agentProvider:Fl}),S.Object({sessionId:wi,requestId:S.String(),type:S.Literal("external_tool"),result:oPc,agentProvider:Fl})]);async function aPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return V4r(t,e,r);Tqi.info(t,"handleAgentInteraction called",{agentProvider:r.agentProvider,sessionId:r.sessionId,type:r.type,requestId:r.requestId});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.interaction(s);return Tqi.info(t,"interaction succeeded"),c})}a(aPc,"handleAgentInteractionChecked");var Iqi=Oe(sPc,aPc);p();p();var xqi=new fe("BackgroundAgent.listSessions"),cPc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String())});async function W4r(t,e,r){xqi.info(t,"handleBackgroundAgentSessionsList called",r);let n=t.get(Hs);return _i(async()=>{let o=await n.listSessions(r);return xqi.info(t,"listSessions succeeded, returning",o.sessions.length,"sessions"),o})}a(W4r,"handleBackgroundAgentSessionsListChecked");var Pih=Oe(cPc,W4r);var wqi=new fe("BackgroundAgent.listSessions"),lPc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String()),agentProvider:Fl});async function uPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return W4r(t,e,r);wqi.info(t,"handleAgentSessionsList called",r);let o=t.get(fc),s=r;return _i(async()=>{let c=await o.listSessions(s);return wqi.info(t,"listSessions succeeded, returning",c.sessions.length,"sessions"),c})}a(uPc,"handleAgentSessionsListChecked");var Rqi=Oe(lPc,uPc);p();p();var kqi=new fe("BackgroundAgent.listModels"),dPc=S.Object({forceRefresh:S.Optional(S.Boolean())});async function z4r(t,e,r){kqi.info(t,"handleBackgroundAgentListModels called",{forceRefresh:r.forceRefresh});let n=t.get(Hs);return _i(async()=>{let o=await n.listModels(r.forceRefresh);return kqi.info(t,"listModels succeeded, returning",o.models.length,"models"),o})}a(z4r,"handleBackgroundAgentListModelsChecked");var Xih=Oe(dPc,z4r);var Pqi=new fe("BackgroundAgent.listModels"),fPc=S.Object({forceRefresh:S.Optional(S.Boolean()),agentProvider:Fl});async function pPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return z4r(t,e,r);Pqi.info(t,"handleAgentListModels called",{agentProvider:r.agentProvider,forceRefresh:r.forceRefresh});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.listModels(s);return Pqi.info(t,"listModels succeeded, returning",c.models.length,"models"),c})}a(pPc,"handleAgentListModelsChecked");var Dqi=Oe(fPc,pPc);p();p();var Nqi=new fe("BackgroundAgent.resume"),hPc=S.Intersect([S.Object({sessionId:wi}),_Ee]);async function Y4r(t,e,r){Nqi.info(t,"handleBackgroundAgentResume called",{sessionId:r.sessionId,model:r.model});let n=t.get(Hs),o={sessionId:r.sessionId,model:r.model,reasoningEffort:r.reasoningEffort,workspaceFolder:r.workspaceFolder,globalAgentsMdInstructions:r.globalAgentsMdInstructions,globalClaudeMdInstructions:r.globalClaudeMdInstructions,externalToolDefinitions:r.externalToolDefinitions,useAgentsMdFile:r.useAgentsMdFile,useNestedAgentsMdFiles:r.useNestedAgentsMdFiles,useClaudeMdFile:r.useClaudeMdFile,useNestedClaudeMdFiles:r.useNestedClaudeMdFiles,mcpDirectory:r.mcpDirectory};return _i(async()=>{let s=await n.resumeSession(o);return Nqi.info(t,"resumeSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath,events:s.events}})}a(Y4r,"handleBackgroundAgentResumeChecked");var _oh=Oe(hPc,Y4r);var Mqi=new fe("BackgroundAgent.resume"),mPc=S.Intersect([S.Object({sessionId:wi}),k1t]);async function gPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return Y4r(t,e,r);Mqi.info(t,"handleAgentResume called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.resume(s);return Mqi.info(t,"resume succeeded:",c.sessionId),c})}a(gPc,"handleAgentResumeChecked");var Oqi=Oe(mPc,gPc);p();p();var APc=S.String(),P1t=["interactive","plan","autopilot"],yPc=S.Union(P1t.map(t=>S.Literal(t))),EPc=S.String({minLength:1}),_Pc=S.Object({sessionId:wi,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(APc),reasoningEffort:EEe,references:S.Optional(S.Array(OO)),agentMode:S.Optional(yPc),chatMode:S.Optional(EPc),contextTier:S.Optional(l3e),sendMode:S.Optional(S.Union([S.Literal("enqueue"),S.Literal("immediate")]))});async function K4r(t,e,r){let n=t.get(Hs),o={sessionId:r.sessionId,message:r.message,model:r.model,providerName:r.providerName,reasoningEffort:r.reasoningEffort,references:r.references,agentMode:r.agentMode,chatMode:r.chatMode,contextTier:r.contextTier,sendMode:r.sendMode};return _i(async()=>({messageId:(await n.sendMessage(o,e)).messageId}))}a(K4r,"handleBackgroundAgentSendChecked");var joh=Oe(_Pc,K4r);var Lqi=new fe("BackgroundAgent.send"),vPc=S.String(),CPc=S.String(),bPc=S.String({minLength:1}),SPc=S.Object({sessionId:wi,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(vPc),reasoningEffort:EEe,references:S.Optional(S.Array(OO)),agentMode:S.Optional(CPc),chatMode:S.Optional(bPc),contextTier:S.Optional(l3e),agentProvider:Fl});async function TPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return r.agentMode!==void 0&&!P1t.includes(r.agentMode)?[null,{code:Ze.InvalidParams,message:`Unknown agentMode for Background provider: ${JSON.stringify(r.agentMode)}. Expected one of ${P1t.join(", ")}.`}]:K4r(t,e,{...r,agentMode:r.agentMode});Lqi.info(t,"handleAgentSend called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(fc),s=r;return _i(async()=>{let c=await o.send(s,e);return Lqi.info(t,"resume succeeded:",c.messageId),c})}a(TPc,"handleAgentSendChecked");var Bqi=Oe(SPc,TPc);p();p();var IPc=new fe("BackgroundAgent.stop"),xPc=S.Object({sessionId:wi});async function J4r(t,e,r){IPc.info(t,"handleBackgroundAgentStop called",{sessionId:r.sessionId});let n=t.get(Hs);return _i(async()=>(await n.stopSession(r.sessionId),{success:!0}))}a(J4r,"handleBackgroundAgentStopChecked");var dsh=Oe(xPc,J4r);var wPc=new fe("BackgroundAgent.stop"),RPc=S.Object({sessionId:wi,agentProvider:Fl});async function kPc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND"){let[,c]=await J4r(t,e,r);return c?[null,c]:[void 0,null]}wPc.info(t,"handleAgentStop called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(fc),s=r;return _i(async()=>o.stop(s))}a(kPc,"handleAgentStopChecked");var Fqi=Oe(RPc,kPc);p();var PPc=S.Object({sessionId:wi,eventId:S.String(),agentProvider:U4r});async function DPc(t,e,r){let n=t.get(fc),o={sessionId:r.sessionId,eventId:r.eventId,providerName:r.agentProvider};return _i(async()=>n.truncateHistory(o))}a(DPc,"handleAgentTruncateHistoryChecked");var Uqi=Oe(PPc,DPc);p();var NPc=S.Object({});async function MPc(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:[{tokens:await t.get(Ur).listAvailableTokens()},null]}a(MPc,"handleListAvailableTokensChecked");var Qqi=Oe(NPc,MPc);p();var OPc=S.Object({tokenId:S.Number()});async function LPc(t,e,r){return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:[await t.get(Ur).useExistingToken(r.tokenId),null]}a(LPc,"handleUseExistingTokenChecked");var qqi=Oe(OPc,LPc);p();var BPc=S.Object({providerName:S.String()});async function FPc(t,e,r){try{let{providerName:n}=r,o=pO(n);if(o!==0)return[null,{code:Ze.InvalidParams,message:`deleteApiKey is only supported for providers with GlobalApiKey auth type. Provider ${n} has auth type: ${o}`}];let s=new da(t.get(Yn));return await s.removeAllModelConfigs(n),await s.deleteAPIKey(n,o),await s.deleteProviderConfig(n),[{success:!0,message:`API key and all model configurations deleted successfully for provider ${n}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to delete API key: ${n instanceof Error?n.message:String(n)}`}]}}a(FPc,"handleBYOKDeleteApiKeyChecked");var jqi=Oe(BPc,FPc);p();var UPc=S.Object({providerName:S.String(),modelId:S.String()});async function QPc(t,e,r){try{let n=new da(t.get(Yn)),{providerName:o,modelId:s}=r,c=pO(o);return await n.removeModelConfig(o,s),c===1&&await n.deleteAPIKey(o,c,s),[{success:!0,message:`Model ${s} deleted successfully for provider ${o}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to delete model: ${n instanceof Error?n.message:String(n)}`}]}}a(QPc,"handleBYOKDeleteModelChecked");var Hqi=Oe(UPc,QPc);p();var qPc=S.Object({providerName:S.Optional(S.String()),modelId:S.Optional(S.String())}),Gqi="-api-key";async function jPc(t,e){let r=await e.listKeys("byok"),n=new Set(await t.listCustomProviderNames()),o=new Set(Object.keys(await t.getStoredModelConfigs(io.Azure))),s=new Set(Object.values(io).filter(u=>u!==io.Azure)),c=`${io.Azure}-`,l=[];for(let u of r){if(!u.endsWith(Gqi))continue;let d=await e.read("byok",u);if(!d)continue;let f=u.slice(0,-Gqi.length),h=f.startsWith(c)?f.slice(c.length):void 0;if(h!==void 0&&o.has(h)&&!n.has(f)){l.push({providerName:io.Azure,modelId:h,apiKey:d});continue}(s.has(f)||n.has(f))&&l.push({providerName:f,apiKey:d})}return l}a(jPc,"listAllApiKeys");async function HPc(t,e,r){try{let n=new da(t.get(Yn)),{providerName:o,modelId:s}=r;return o?[{apiKeys:[{apiKey:await n.getAPIKey(o,s)||void 0,providerName:o,modelId:s}]},null]:[{apiKeys:await jPc(n,t.get(Yn))},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to get API key: ${n instanceof Error?n.message:String(n)}`}]}}a(HPc,"handleBYOKListApiKeysChecked");var $qi=Oe(qPc,HPc);p();var GPc=S.Object({providerName:S.Optional(S.String())});async function $Pc(t,e,r){try{let n=new da(t.get(Yn)),o=r.providerName?[r.providerName]:await n.listCustomProviderNames(),s=[];for(let c of o){let l=await n.getProviderConfig(c);s.push({providerName:c,groupName:l?.groupName,apiType:l?.apiType})}return[{providers:s},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to list provider configs: ${n instanceof Error?n.message:String(n)}`}]}}a($Pc,"handleBYOKListCustomProviderConfigsChecked");var Vqi=Oe(GPc,$Pc);p();p();p();qLr();var USt=class extends Zx{static{a(this,"AnthropicProvider")}constructor(e){super(io.Anthropic,e)}async getAllModels(){await this.ensureKnownModelsCache();let e=await new da(this.ctx.get(Yn)).getAPIKey(this.providerName);if(!e)throw new Error(`API key not found for provider: ${this.providerName}`);let r=new BL({apiKey:e,fetch:zDc(this.ctx.get(tr))});try{let n=await r.models.list(),o=[];for(let s of n.data){let c=this._knownModels?.[s.id];c&&o.push({providerName:this.providerName,modelId:s.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:c})}return o}catch(n){throw rxe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,n),n}}};function zDc(t){return async(e,r)=>{let n=YDc(e,r),o=JDc(r),s=await t.fetch(n,o);return XDc(s)}}a(zDc,"createAnthropicFetchAdapter");function YDc(t,e){return t instanceof Request?(KDc(t,e),t.url):t instanceof URL?t.toString():t}a(YDc,"convertInputToString");function KDc(t,e){e&&(e.headers??=t.headers,e.method??=t.method,!e.body&&!t.bodyUsed&&(e.body=t.body))}a(KDc,"mergeRequestInit");function JDc(t){let e;return t?.headers&&(e=ZDc(t.headers)),{method:t?.method||"GET",headers:e,body:t?.body,signal:t?.signal||void 0}}a(JDc,"convertToFetchOptions");function ZDc(t){let e={};if(t instanceof Headers)for(let[r,n]of t.entries())e[r]=n;else if(Array.isArray(t))for(let[r,n]of t)e[r]=n;else return t;return e}a(ZDc,"convertHeaders");async function XDc(t){let e=t.body(),r=null;if(e)r=eNc(e);else{let n=await t.text();r=rNc(n)}return new globalThis.Response(r,{status:t.status,statusText:t.statusText,headers:new Headers(t.headers)})}a(XDc,"convertToWebResponse");function eNc(t){return new ReadableStream({start(e){let r=tNc(t,e);return()=>r()},cancel(){"destroy"in t&&typeof t.destroy=="function"&&t.destroy()}})}a(eNc,"createReadableStreamFromNodeStream");function tNc(t,e){let r=a(c=>{e.enqueue(new Uint8Array(c))},"onData"),n=a(()=>{e.close(),s()},"onEnd"),o=a(c=>{e.error(c),s()},"onError"),s=a(()=>{t.off("data",r),t.off("end",n),t.off("error",o)},"cleanup");return t.on("data",r),t.on("end",n),t.on("error",o),s}a(tNc,"setupStreamHandlers");function rNc(t){return new ReadableStream({start(e){e.enqueue(new TextEncoder().encode(t)),e.close()}})}a(rNc,"createReadableStreamFromText");p();var QSt=class extends Zx{static{a(this,"GeminiProvider")}constructor(e){super(io.Gemini,e)}};p();var qSt=class extends Zx{static{a(this,"GroqProvider")}constructor(e){super(io.Groq,e)}};p();var jSt=class extends Zx{static{a(this,"OpenAIProvider")}constructor(e){super(io.OpenAI,e)}};p();var hGi=16e3,HSt=class extends Zx{static{a(this,"OpenRouterProvider")}constructor(e){super(io.OpenRouter,e)}async getAllModels(){try{let e=this.getFetchModelUrl(),r={"Content-Type":"application/json"},n=await new da(this.ctx.get(Yn)).getAPIKey(this.providerName);n&&(r.Authorization=`Bearer ${n}`);let o=await this.ctx.get(tr).fetch(e,{method:"GET",headers:r});if(!o.ok)throw new Error(`Failed to fetch models: ${o.status} ${o.statusText}`);let s=await o.json();if(s.error)throw new Error(`API Error: ${JSON.stringify(s.error)}`);let c=[];for(let l of s.data)c.push({providerName:this.providerName,modelId:l.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:{name:l.name,maxInputTokens:Math.max(0,l.top_provider.context_length-hGi),maxOutputTokens:hGi,toolCalling:l.supported_parameters?.includes("tools")??!1,vision:l.architecture?.input_modalities?.includes("image")??!1}});return c}catch(e){throw rxe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}getFetchModelUrl(){return`${this.getBaseUrl()}/models?supported_parameters=tools`}};var wie=class{static{a(this,"BYOKProviderFactory")}constructor(e){this.providers=new Map([[io.OpenAI,new jSt(e)],[io.Gemini,new QSt(e)],[io.Groq,new qSt(e)],[io.OpenRouter,new HSt(e)],[io.Anthropic,new USt(e)]])}getBYOKProvider(e){return this.providers.get(e)}};var nNc=S.Object({providerName:S.Optional(S.String()),enableFetchUrl:S.Optional(S.Boolean())});async function iNc(t,e,r){try{let{providerName:n,enableFetchUrl:o}=r,s=new da(t.get(Yn)),c=[];if(n)if(o){if(!jle(n))return[null,{code:Ze.InvalidRequest,message:`enableFetchUrl is not supported for the ${n} provider`}];if(!await s.getAPIKey(n))return[null,{code:Ze.InvalidRequest,message:`API key is required to fetch models from ${n}`}];let u=t.get(wie).getBYOKProvider(n);if(u){let d=await u.getAllModels(),f=new Map;d.forEach(g=>{let A=`${g.providerName}_${g.modelId}`;f.set(A,g)});let h=await s.getStoredModelConfigs(n),m=[];Object.entries(h).forEach(([g,A])=>{m.push({providerName:n,modelId:g,deploymentUrl:A.deploymentUrl,isRegistered:A.isRegistered,isCustomModel:A.isCustomModel,modelCapabilities:A.modelCapabilities})}),m.forEach(g=>{let A=`${g.providerName}_${g.modelId}`;f.set(A,g)}),c.push(...f.values())}}else{let l=await s.getStoredModelConfigs(n);Object.entries(l).forEach(([u,d])=>{c.push({providerName:n,modelId:u,deploymentUrl:d.deploymentUrl,isRegistered:d.isRegistered,isCustomModel:d.isCustomModel,modelCapabilities:d.modelCapabilities})})}else{let l=await s.listAllProviderNames();for(let u of l){let d=await s.getStoredModelConfigs(u);Object.entries(d).forEach(([f,h])=>{c.push({providerName:u,modelId:f,deploymentUrl:h.deploymentUrl,isRegistered:h.isRegistered,isCustomModel:h.isCustomModel,modelCapabilities:h.modelCapabilities})})}}return[{models:c},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to get models: ${n instanceof Error?n.message:String(n)}`}]}}a(iNc,"handleBYOKListModelsChecked");var mGi=Oe(nNc,iNc);p();var oNc=S.Object({providerName:S.String(),apiKey:S.String(),modelId:S.Optional(S.String())});async function sNc(t,e,r){try{let n=new da(t.get(Yn)),{providerName:o,apiKey:s,modelId:c}=r,l=pO(o);if(l===1&&!c)return[null,{code:Ze.InvalidRequest,message:"modelId is required for PerModelDeployment auth type"}];await n.storeAPIKey(o,s,l,c);let u=`API key saved successfully for provider ${o}`;return[{success:!0,message:c?`${u} and model ${c}`:u},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to save API key: ${n instanceof Error?n.message:String(n)}`}]}}a(sNc,"handleBYOKSaveApiKeyChecked");var gGi=Oe(oNc,sNc);p();var aNc=S.Object({providerName:S.String(),apiKey:S.String(),groupName:S.String(),apiType:S.Optional(S.Union([S.Literal("chatCompletions"),S.Literal("responses"),S.Literal("messages")]))});async function cNc(t,e,r){try{let n=r.providerName,{apiKey:o,groupName:s,apiType:c}=r;if(!n)return[null,{code:Ze.InvalidRequest,message:"Provider name must not be empty."}];if(!o)return[null,{code:Ze.InvalidRequest,message:"API key must not be empty."}];if(!vK(n))return[null,{code:Ze.InvalidRequest,message:`Provider '${n}' is a built-in provider; custom provider config is only supported for user-named providers.`}];let l=new da(t.get(Yn));return await l.storeAPIKey(n,o,pO(n)),await l.saveProviderConfig(n,{groupName:s,apiType:c}),[{success:!0,message:`Provider config saved successfully for provider ${n}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to save provider config: ${n instanceof Error?n.message:String(n)}`}]}}a(cNc,"handleBYOKSaveCustomProviderConfigChecked");var AGi=Oe(aNc,cNc);p();var lNc=S.Object({providerName:S.String(),modelId:S.String(),isRegistered:S.Boolean(),isCustomModel:S.Boolean(),deploymentUrl:S.Optional(S.String()),apiKey:S.Optional(S.String()),modelCapabilities:S.Optional(S.Object({name:S.String(),maxInputTokens:S.Optional(S.Number()),maxOutputTokens:S.Optional(S.Number()),toolCalling:S.Boolean(),vision:S.Boolean(),thinking:S.Optional(S.Boolean())}))});async function uNc(t,e,r){try{let{providerName:n,modelId:o,isRegistered:s,isCustomModel:c,deploymentUrl:l,apiKey:u,modelCapabilities:d}=r,f=new da(t.get(Yn)),h=pO(n);if(h===1&&!l)return[null,{code:Ze.InvalidRequest,message:`deploymentUrl is required for the ${n} provider`}];if(vK(n)){if(!l)return[null,{code:Ze.InvalidRequest,message:`deploymentUrl is required for custom endpoint provider '${n}'`}];if(!await f.getProviderConfig(n))return[null,{code:Ze.InvalidRequest,message:`Custom endpoint provider '${n}' must be configured via saveCustomProviderConfig before registering models.`}]}if(l||d){let m={deploymentUrl:l,isRegistered:s,isCustomModel:c,modelCapabilities:d};await f.saveModelConfig(n,o,m,u,h)}else u!==void 0&&await f.storeAPIKey(n,u,h,o);return[{success:!0,message:`Model ${o} saved successfully for provider ${n}`},null]}catch(n){return[null,{code:Ze.InternalError,message:`Failed to save model: ${n instanceof Error?n.message:String(n)}`}]}}a(uNc,"handleBYOKSaveModelChecked");var yGi=Oe(lNc,uNc);p();var dNc=S.Object({cliPath:S.String()});async function fNc(t,e,r){return[await Xhe.check(r.cliPath),null]}a(fNc,"handleCheckClaudeCliCompatibilityChecked");var EGi=Oe(dNc,fNc);p();p();var vGi=de(AP()),_Gi="0.135.0",GSt=new Zhe({displayName:"Codex CLI",notConfiguredMessage:"Codex CLI path is not configured. Install the Codex CLI (e.g. `npm install -g @openai/codex`), then set the Codex CLI Path in your editor's Copilot settings to the absolute path of the `codex` binary.",validateVersion(t,e){if(vGi.lt(t,_Gi))return{severity:"error",message:`Codex CLI at "${e}" reports version ${t.version}, but version ${_Gi} or later is required. Run \`npm install -g @openai/codex\` to upgrade.`}}});var pNc=S.Object({cliPath:S.String()});async function hNc(t,e,r){return[await GSt.check(r.cliPath),null]}a(hNc,"handleCheckCodexCliCompatibilityChecked");var CGi=Oe(pNc,hNc);p();var mNc=S.Object({uri:S.String({minLength:1})});async function gNc(t,e,r){let n=await t.get(ii).getOrReadTextDocument(r);return[{status:td(n),...n.status==="invalid"&&{reason:n.reason},...n.status==="notfound"&&{reason:n.message}},null]}a(gNc,"handleCheckFileStatusChecked");var bGi=Oe(mNc,gNc);p();var ANc=S.Object({});function SGi(t,e){return typeof t!="number"||typeof e!="number"||e===0?0:Math.max(0,Math.min(100,t/e*100))}a(SGi,"calculatePercentRemaining");function GBr(t){return{percentRemaining:t?.percent_remaining??100,unlimited:t?.unlimited??!1,overagePermitted:t?.overage_permitted??!1,overageCount:t?.overage_count,entitlement:t?.entitlement,quotaRemaining:t?.quota_remaining,timeStamp:t?.timestamp_utc}}a(GBr,"buildQuotaSnapshot");async function yNc(t,e,r){let n=await t.get(Ur).resolveSession();if(!n)return[null,{code:Ze.InternalError,message:"Not signed in"}];let o=await cbe(t,n);if(o.ok){let s=await o.json();return t.get(Au).processUserInfoQuotaSnapshot(s),s.token_based_billing?[{chat:GBr(s.quota_snapshots?.chat),completions:GBr(s.quota_snapshots?.completions),premiumInteractions:GBr(s.quota_snapshots?.premium_interactions),resetDate:s.quota_reset_date??"",resetDateUtc:s.quota_reset_date_utc,copilotPlan:s.access_type_sku==="free_limited_copilot"?"free":s.copilot_plan,tokenBasedBillingEnabled:!0,canUpgradePlan:s.can_upgrade_plan},null]:s.access_type_sku==="free_limited_copilot"?[{chat:{percentRemaining:SGi(s.limited_user_quotas?.chat,s.monthly_quotas?.chat),unlimited:!1,overagePermitted:!1},completions:{percentRemaining:SGi(s.limited_user_quotas?.completions,s.monthly_quotas?.completions),unlimited:!1,overagePermitted:!1},premiumInteractions:{percentRemaining:0,unlimited:!1,overagePermitted:!1},resetDate:s.limited_user_reset_date??"",copilotPlan:"free",tokenBasedBillingEnabled:!1,canUpgradePlan:s.can_upgrade_plan},null]:[{chat:{percentRemaining:s.quota_snapshots?.chat?.percent_remaining??100,unlimited:s.quota_snapshots?.chat?.unlimited??!1,overagePermitted:s.quota_snapshots?.chat?.overage_permitted??!1},completions:{percentRemaining:s.quota_snapshots?.completions?.percent_remaining??100,unlimited:s.quota_snapshots?.completions?.unlimited??!1,overagePermitted:s.quota_snapshots?.completions?.overage_permitted??!1},premiumInteractions:{percentRemaining:s.quota_snapshots?.premium_interactions?.percent_remaining??100,unlimited:s.quota_snapshots?.premium_interactions?.unlimited??!1,overagePermitted:s.quota_snapshots?.premium_interactions?.overage_permitted??!1},resetDate:s.quota_reset_date??"",copilotPlan:s.copilot_plan,tokenBasedBillingEnabled:!1,canUpgradePlan:s.can_upgrade_plan},null]}return[null,{code:Ze.InternalError,message:"Failed to fetch quota info"}]}a(yNc,"handleCheckQuotaChecked");var TGi=Oe(ANc,yNc);p();var ENc=S.Object({options:S.Optional(S.Object({localChecksOnly:S.Optional(S.Boolean()),forceRefresh:S.Optional(S.Boolean())}))});async function _Nc(t,e,r){return[await t.get(Ur).checkAndUpdateStatus(r.options),null]}a(_Nc,"handleCheckStatusChecked");var IGi=Oe(ENc,_Nc);p();var vNc=S.Object({pullRequestNumber:S.Integer({minimum:1}),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),body:S.String({minLength:1})});async function CNc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let o=await new Zh(t).addPullRequestComment(r.repoOwner,r.repoName,r.pullRequestNumber,r.body);return At(t,"cloudAgent.addPullRequestComment",{result:"success"}),[{html_url:o.html_url},null]}catch(n){if(Vn(t,"cloudAgent.addPullRequestComment",n,{result:"error"}),n instanceof uE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof Fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(CNc,"handleCloudAgentAddPullRequestCommentChecked");var xGi=Oe(vNc,CNc);p();var bNc=S.Object({pullRequestId:S.Number(),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1})});async function SNc(t,e,r){try{let o=await new HC(t).getAllSessions(r.pullRequestId,e);if(!o||o.length===0)return[null,{code:Ze.InvalidRequest,message:"No session found for this pull request"}];let s=o[0];return s.state==="completed"?(Et(t,"githubApi.cancelCodingAgent",Wt.createAndMarkAsIssued()),At(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):s.workflow_run_id?(await new Zh(t).cancelWorkflow(r.repoOwner,r.repoName,s.workflow_run_id),Et(t,"githubApi.cancelCodingAgent",Wt.createAndMarkAsIssued()),At(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):[null,{code:Ze.InternalError,message:"No workflow run ID found in session"}]}catch(n){if(qa(t,n,"githubApi.cancelCodingAgent"),Vn(t,"githubApi.cancelCodingAgent",n),n instanceof tw)return[null,{code:Ze.NoCopilotToken,message:n.message}];if(n instanceof sp)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof l0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof uE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof Fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(SNc,"handleCancelCodingAgentChecked");var wGi=Oe(bNc,SNc);p();var TNc=S.Object({problemStatement:S.String({minLength:1}),workspaceFolder:S.Optional(S.String({minLength:1})),workspaceFolders:S.Optional(S.Array(Bc))});function INc(t){if(t.workspaceFolders&&t.workspaceFolders.length>0)return{uri:t.workspaceFolders[0].uri};if(t.workspaceFolder)return{uri:t.workspaceFolder}}a(INc,"pickWorkspaceFolder");async function xNc(t,e,r){try{let n=INc(r);if(!n)return[null,{code:Ze.InvalidRequest,message:"No workspace folder provided \u2014 cannot create a cloud agent job."}];let s=await new _f(t).getRepo(n);if(!s||!s.isGitHub())return[null,{code:Ze.InvalidRequest,message:"No GitHub repository found in the workspace folder."}];if(!s.owner||!s.name)return[null,{code:Ze.InvalidRequest,message:"Could not determine repository owner and name."}];let l=await new kO([new PO,new DO]).getBranchInfo(t,n);if(!l?.currentBranch||l.isDetachedHead)return[null,{code:Ze.InvalidRequest,message:"No current branch found or detached HEAD state \u2014 cannot create a cloud agent job."}];let u=l.currentBranch,d=hue(r.problemStatement);if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let h=await new HC(t).createCodingTask(d,r.problemStatement,s.owner,s.name,u,e);return At(t,"cloudAgent.createJob",{result:"success"}),[h,null]}catch(n){if(Vn(t,"cloudAgent.createJob",n,{result:"error"}),exe(n))return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];if(n instanceof tw)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof sp)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof l0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof uE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof Fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(xNc,"handleCloudAgentCreateJobChecked");var RGi=Oe(TNc,xNc);p();var wNc=S.Object({sessionId:S.String({minLength:1})});async function RNc(t,e,r){try{let o=await new HC(t).getSessionLogs(r.sessionId,e);return At(t,"cloudAgent.getSessionLogs",{result:"success"}),[{logs:o},null]}catch(n){if(Vn(t,"cloudAgent.getSessionLogs",n,{result:"error"}),n instanceof tw)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof sp||n instanceof l0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(RNc,"handleCloudAgentGetSessionLogsChecked");var kGi=Oe(wNc,RNc);p();var kNc=S.Object({pullRequestId:S.Integer()});async function PNc(t,e,r){try{let o=await new HC(t).getAllSessions(r.pullRequestId,e);return At(t,"cloudAgent.listSessions",void 0,{totalSessions:o?.length??0}),[{sessions:o??[]},null]}catch(n){if(Vn(t,"cloudAgent.listSessions",n),n instanceof tw)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof sp||n instanceof l0)return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(PNc,"handleCloudAgentListSessionsChecked");var PGi=Oe(kNc,PNc);p();var DNc=S.Object({});async function NNc(t,e,r){return[(await ew(t)).map(s=>({slug:s.slug,name:s.name,description:s.description,avatarUrl:s.avatarUrl})),null]}a(NNc,"handleConversationAgentsChecked");var DGi=Oe(DNc,NNc);p();p();var Y3e=de(Xc());function MNc(t,e,r){let n=Wt.createAndMarkAsIssued({languageId:String(e.detectedLanguageId),requestedDocumentVersion:String(r),actualDocumentVersion:String(e.version)});return Et(t,"getCompletions.docVersionMismatch",n)}a(MNc,"telemetryVersionMismatch");async function P9(t,e,r){let o=t.get($r).getTextDocumentUnsafe(e);if(!o)throw new Y3e.ResponseError(Ze.InvalidParams,`Document for URI could not be found: ${e.uri}`);let s=await Ble(t,e,o.getText());if(s.status==="invalid")throw t.get(ps).setClsInactive(s.reason),new Y3e.ResponseError(Ze.CopilotNotAvailable,s.reason);if(e.version!==void 0&&o.version!==e.version)throw r?.isCancellationRequested||(MNc(t,o,e.version),$o.debug(t,`Requested document version was ${e.version} but actual document version was ${o.version}.`)),new Y3e.ResponseError(Ze.ContentModified,"Document Version Mismatch");return o}a(P9,"getTextDocument");async function FL(t,e,r){let n=e.textDocument??e.doc;if(n)try{return await P9(t,n,r)}catch(o){if(o instanceof Y3e.ResponseError){if(o.code===Ze.CopilotNotAvailable)return;if(o.code===Ze.InvalidParams){$o.warn(t,`Document not found for conversation: ${n.uri}. Continuing without this file.`);return}}throw o}}a(FL,"getTextDocumentIfAvailable");var ONc=S.Union([S.Literal("keyboard"),S.Literal("toolbar")]),LNc=S.Object({turnId:WK,codeBlockIndex:S.Number(),source:ONc,copiedCharacters:S.Number(),totalCharacters:S.Number(),copiedText:S.String(),doc:S.Optional(gJe),textDocument:S.Optional(jC),position:S.Optional(c0),conversationSource:S.Optional(LO)});async function BNc(t,e,r){let n=await FL(t,r,e),o={totalCharacters:r.totalCharacters,copiedCharacters:r.copiedCharacters},s=r.position??r.doc?.position;n&&s&&(o={...o,currentLine:s.line});let c=nq(r.conversationSource),l=t.get(zo).findByTurnId(r.turnId),u=await tl(t,l,{languageId:n?.detectedLanguageId??""});return HS(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,mode:l?.turn.getChatModeForTelemetry()??"unknown",modelId:l?.turn.getResolvedModelId()??"unknown"},o,`${aE(c)}.acceptedCopy`,u),["OK",null]}a(BNc,"handleConversationCodeCopyChecked");var NGi=Oe(LNc,BNc);p();var FNc=S.Union([S.Literal("keyboard"),S.Literal("toolbar"),S.Literal("diff")]),UNc=S.Object({turnId:WK,source:FNc,codeBlockIndex:S.Number(),acceptedLength:S.Optional(S.Number()),totalCharacters:S.Number(),newFile:S.Optional(S.Boolean()),doc:S.Optional(gJe),textDocument:S.Optional(jC),position:S.Optional(c0),conversationSource:S.Optional(LO)});async function QNc(t,e,r){let n=await FL(t,r,e),o={totalCharacters:r.totalCharacters,acceptedLength:r.acceptedLength??r.totalCharacters},s=r.position??r.doc?.position;n&&s&&(o={...o,insertionOffset:n.offsetAt(s),currentLine:s.line});let c=nq(r.conversationSource),l=t.get(zo).findByTurnId(r.turnId),u=await tl(t,l,{languageId:n?.detectedLanguageId??""});return HS(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,compType:r.acceptedLength&&r.acceptedLength0&&(e+=` +`)[0],d=u.length-u.trimStart().length,f=d%o;if(f!==0&&d>0){let h=" ".repeat(f);return n(l,h,m=>" ".repeat((Math.floor(m/o)+1)*o))}else return l},"re");e.displayText=c(e.displayText),e.completionText=c(e.completionText)}}return e}a(lji,"normalizeIndentCharacter");Mo();function uji(t,e,r,n,o,s,c){let l=n.lineAt(o),u=e.map(d=>{let f=Au.range(Au.position(o.line,0),Au.position(o.line,o.character+d.suffixCoverage)),h="";if(s&&(d.completion=lji(s,d.completion,l.isEmptyOrWhitespace)),l.isEmptyOrWhitespace&&(d.completion.displayNeedsWsOffset||d.completion.completionText.startsWith(l.text)))h=d.completion.completionText;else{let g=Au.range(f.start,o);h=n.getText(g)+d.completion.displayText}return{uuid:Nt(),insertText:h,range:f,uri:n.uri,index:d.completion.completionIndex,telemetry:d.telemetry,displayText:d.completion.displayText,position:o,offset:n.offsetAt(o),resultType:r,copilotAnnotations:d.copilotAnnotations,clientCompletionId:d.clientCompletionId}});if(r===2&&c!==void 0){let d=u.find(f=>f.index===c);if(d){let f=u.filter(h=>h.index!==c);u=[d,...f]}}return u}a(uji,"completionsFromGhostTextResults");p();var kN=class{constructor(){this.cache=new Cn(100)}static{a(this,"SpeculativeRequestCache")}set(e,r){this.cache.set(e,r)}async request(e){let r=this.cache.get(e);r!==void 0&&(this.cache.delete(e),await r())}};var xEe=class extends sy{constructor(r){super();this.ctx=r}static{a(this,"GhostTextInlineCompletionManager")}async getInlineCompletionsResult(r,n,o={}){let s=this.ctx,c=0;o.selectedCompletionInfo?.text&&!o.selectedCompletionInfo.text.includes(")")&&(r=r.addSelectedCompletionInfo(o.selectedCompletionInfo),c=r.position.character-o.selectedCompletionInfo.range.end.character);let l=await Qhr(s,r,n,o);if(l.type!=="success")return l;let[u,d]=l.value;if(n?.isCancellationRequested)return{type:"canceled",reason:"after getGhostText",telemetryData:{telemetryBlob:l.telemetryBlob}};let f=Yni(s,r.textDocument,r.position,d),h=uji(s,u,d,r.textDocument,r.position,o.formattingOptions,f);if(h.length===0)return{type:"empty",reason:"no completions in final result",telemetryData:l.telemetryData};if(d!==2){r=r.applyEdits([{newText:h[0].insertText,range:h[0].range}]);let g={isSpeculative:!0,opportunityId:o.opportunityId},A=a(()=>Qhr(s,r,void 0,g),"fn");s.get(kN).set(h[0].clientCompletionId,A)}let m=h.map(g=>{let{start:A,end:y}=g.range,E=Fn.Range.create(A,Fn.Position.create(y.line,y.character-c));return{...g,range:E}});return{...l,value:m}}async getPrompt(r,n,o,s={}){let c=await this.getInlineCompletionsResult(Aee(r,n),o,{...s,promptOnly:!0});if(c.type!=="promptOnly")throw new Error(`Unexpected result type ${c.type}`);return c.prompt}async getCompletions(r,n,o,s={}){this.logCompletionLocation(r,n);let c=await this.getInlineCompletionsResult(Aee(r,n),o,s);return yei(this.ctx,c)}logCompletionLocation(r,n){let o=r.getText({start:{line:Math.max(n.line-1,0),character:0},end:n}),s=r.getText({start:n,end:{line:Math.min(n.line+2,r.lineCount-1),character:r.lineCount-1>n.line?0:n.character}});Zlt.debug(this.ctx,`Requesting for ${r.uri} at ${n.line}:${n.character}`,`between ${JSON.stringify(o)} and ${JSON.stringify(s)}.`)}triggerSpeculativeRequests(r){return this.ctx.get(kN).request(r.clientCompletionId)}};p();var wEe=fe(tie()),dji=fe(fN()),cLr=fe(mdt()),q1t=fe(fee()),fji=fe(Rs()),pji=fe(tD()),I3e=fe(ME()),Q1t=fe($_()),lLr=fe(Ed()),hji=fe($T()),mji=fe(ei());p();var U1t=class{constructor(e){this.ctx=e;this._onDidOpenTextDocument=new Vi;this._onDidChangeTextDocument=new Vi;this._onDidCloseTextDocument=new Vi;this._onDidSelectTextDocument=new Vi;this.onDidOpenTextDocument=this._onDidOpenTextDocument.event;this.onDidChangeTextDocument=this._onDidChangeTextDocument.event;this.onDidCloseTextDocument=this._onDidCloseTextDocument.event;this.onDidSelectTextDocument=this._onDidSelectTextDocument.event;this.bufferedEvents=[];this.forwardedAsOpen=new Set;this.started=!1;this.documentManager=this.ctx.get($r)}static{a(this,"DocumentChangeFilter")}start(){if(!this.started){this.started=!0;for(let e of this.documentManager.getTextDocumentsUnsafe())this.bufferedEvents.push({type:"addition",event:{document:{uri:e.uri,languageId:e.clientLanguageId,version:e.version,text:e.getText()}}});this.documentManager.onDidOpenTextDocument(e=>{this.bufferedEvents.push({type:"addition",event:e})}),this.documentManager.onDidChangeTextDocument(e=>{this.bufferedEvents.push({type:"change",event:e})}),this.documentManager.onDidCloseTextDocument(e=>{this.bufferedEvents.push({type:"removal",event:e})})}}addSelectionEvent(e){this.bufferedEvents.push({type:"selection",event:e})}async syncSafeDocuments(){let e=[...this.bufferedEvents];this.bufferedEvents.length=0;for(let r of e){let n=r.type==="selection"?r.event.uri:r.event.document.uri;if(r.type==="removal"){this.forwardedAsOpen.has(n)&&(this.forwardedAsOpen.delete(n),this._onDidCloseTextDocument.fire(r.event));continue}let o=await this.documentManager.getTextDocument({uri:n});if(o===void 0){this.forwardedAsOpen.has(n)&&(this.forwardedAsOpen.delete(n),this._onDidCloseTextDocument.fire({document:{uri:n}}));continue}r.type==="addition"?(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire(r.event)):r.type==="change"?this.forwardedAsOpen.has(n)?this._onDidChangeTextDocument.fire(r.event):(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire({document:{uri:o.clientUri,languageId:o.clientLanguageId,version:o.version,text:o.getText()}})):r.type==="selection"&&(this.forwardedAsOpen.has(n)||(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire({document:{uri:o.clientUri,languageId:o.clientLanguageId,version:o.version,text:o.getText()}})),this._onDidSelectTextDocument.fire(r.event))}}};var OV=class extends q1t.ObservableWorkspace{constructor(r,n,o){super();this._openDocuments=(0,pji.observableValue)(this,[]);this.openDocuments=this._openDocuments;this._documents=new Map;this.ctx=r,n&&(this.documentChangeFilter=new U1t(r)),this._started=!1,o||this.start()}static{a(this,"ObservableLspWorkspace")}start(){if(this._started)return;this._started=!0;let r=this.ctx.get($r);if(this.documentChangeFilter)this.documentChangeFilter.start();else for(let o of r.getTextDocumentsUnsafe())this.addLspDocument(o.uri,o.clientLanguageId,o.getText());let n=this.documentChangeFilter??r;n.onDidOpenTextDocument(o=>{this.addLspDocument(o.document.uri,o.document.languageId,o.document.text)}),n.onDidCloseTextDocument(o=>{this.removeClosedLspDocument(o.document.uri)}),n.onDidChangeTextDocument(o=>{this.onDidChangeLspDocument(o.document.uri,o.contentChanges)}),this.documentChangeFilter?.onDidSelectTextDocument(o=>{let s=wEe.DocumentId.create(Fs(o.uri)),c=this._documents.get(s);c&&c.updateSelectionFromLspPosition(o.position)})}addLspDocument(r,n,o){let s=wEe.DocumentId.create(Fs(Fs(r)));return this.addDocument({id:s,initialValue:o,languageId:cLr.LanguageId.create(n)},void 0)}onDidChangeLspDocument(r,n){let o=wEe.DocumentId.create(Fs(Fs(r))),s=this._documents.get(o);s&&s.applyLspContentChanges(n)}onUserPositionChange(r,n){if(this.documentChangeFilter)this.documentChangeFilter.addSelectionEvent({uri:r,position:n});else{let o=wEe.DocumentId.create(Fs(r)),s=this._documents.get(o);s&&s.updateSelectionFromLspPosition(n)}}removeClosedLspDocument(r){let n=wEe.DocumentId.create(Fs(r));this._documents.get(n)?.dispose()}addDocument(r,n=void 0){let o=this._documents.get(r.id);if(o)return o;let s=new uLr(r.id,new hji.StringText(r.initialValue??""),[],r.languageId??cLr.LanguageId.PlainText,()=>{this._documents.delete(r.id);let c=this._openDocuments.get(),l=c.filter(u=>u.id!==s.id);l.length!==c.length&&this._openDocuments.set(l,n,{added:[],removed:[s]})},r.workspaceRoot);return this._documents.set(r.id,s),this._openDocuments.set([...this._openDocuments.get(),s],n,{added:[s],removed:[]}),s}getDocument(r){return this._documents.get(r)}clear(){this._openDocuments.set([],void 0,{added:[],removed:this._openDocuments.get()});for(let r of this._documents.values())r.dispose();this._documents.clear()}getWorkspaceRoot(r){return this._documents.get(r)?.workspaceRoot}async syncSafeDocuments(){this.start(),await this.documentChangeFilter?.syncSafeDocuments()}},uLr=class extends q1t.MutableObservableDocument{static{a(this,"MutableObservableLspDocument")}constructor(e,r,n,o,s,c){super(e,r,n,o,s,0,c)}applyLspContentChanges(e){let r=this.editFromLspContentChanges(e);this.applyEdit(r.compose(),void 0)}updateSelectionFromLspPosition(e){let r=this.value.get().getTransformer().getOffset(new Q1t.Position(e.lineNumber+1,e.column+1));this.updateSelection([new lLr.OffsetRange(r,r)])}editFromLspContentChanges(e){return new dji.Edits(I3e.StringEdit,e.map((n,o)=>this.editFromLspContentChange(n,o)))}editFromLspContentChange(e,r){if(mji.TextDocumentContentChangeEvent.isIncremental(e)){let n=this.value.get().getTransformer(),o=n.getOffset(new Q1t.Position(e.range.start.line+1,e.range.start.character+1)),s=n.getOffset(new Q1t.Position(e.range.end.line+1,e.range.end.character+1));if(o>s){let c=this.value.get().value,l=c.split(/\r\n|\n/).length,u=c.split(/\r\n|\r|\n/).length,d=new fji.BugIndicatingError(`Invalid range: [${o}, ${s}) from ${JSON.stringify(e.range)}. Line counts: nes=${l}, lsp=${u}`);throw lu?d.code="ObservableWorkspace_TooManyLines":d.code="ObservableWorkspace_InvalidRange",d.code+=r>0?"_SubsequentChange":"_FirstChange",d}return I3e.StringEdit.single(new I3e.StringReplacement(new lLr.OffsetRange(o,s),e.text))}throw new Error("Full replacement edits are not supported")}};var gji=fe(L1t()),Aji=fe(Qgt()),dLr=fe(fee()),REe=fe(Rc()),ALr=fe(Ro());var fLr=class extends ALr.Disposable{constructor(r){super();this.ctx=r;this.isMinimalMode=!0;this.permissiveGitHubSession=void 0;this.hasCopilotTokenSource=!0;this._tokenChangedEverFired=!1;this._onDidAuthenticationChange=this._register(new REe.Emitter);this.onDidAuthenticationChange=this._onDidAuthenticationChange.event;this._onDidAccessTokenChange=this._register(new REe.Emitter);this.onDidAccessTokenChange=this._onDidAccessTokenChange.event;this._onDidCopilotTokenChange=this._register(new REe.Emitter);this.onDidCopilotTokenChange=this._onDidCopilotTokenChange.event;this._onDidAdoAuthenticationChange=this._register(new REe.Emitter);this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event;this.anyGitHubSession=void 0;this._register(vs(r,()=>{this.fireTokenChanged()}))}static{a(this,"AuthServiceAdapter")}fireTokenChanged(){this._tokenChangedEverFired=!0,this._onDidAccessTokenChange.fire(),this._onDidCopilotTokenChange.fire(),this._onDidAuthenticationChange.fire()}ensureTokenChangedFired(){this._tokenChangedEverFired||this.fireTokenChanged()}async getAnyGitHubSession(r){let n=await this.ctx.get(Mr).resolveSession();if(n!==void 0)return{id:n.login,accessToken:n.accessToken,account:{id:n.login,label:n.serverUrl},scopes:[]}}async getGitHubSession(r,n){if(r!=="permissive")return this.getAnyGitHubSession(n)}getPermissiveGitHubSession(r){return Promise.resolve(void 0)}get copilotToken(){let r=this.ctx.get(Ft).getLastToken();if(r!==void 0)return this.ensureTokenChangedFired(),j1t(r,this.ctx)}async getCopilotToken(r){let n=this.ctx.get(Ft);r&&n.resetToken("inline_completion_force_refresh");let o=await n.getToken();this.ensureTokenChangedFired();let s=await this.ctx.get(Mr).resolveSession();return j1t(o,this.ctx,s?.login)}resetCopilotToken(r){this.ctx.get(Ft).resetToken("inline_completion",r)}getAdoAccessTokenBase64(r){return Promise.resolve(void 0)}};function j1t(t,e,r){let n=t.envelope.refresh_in??Math.max(0,t.expiresAt-Math.floor(Date.now()/1e3));return new Aji.CopilotToken({token:t.envelope.token,expires_at:t.envelope.expires_at,refresh_in:n,organization_list:t.envelope.organization_list,code_quote_enabled:t.envelope.code_quote_enabled??!1,copilotignore_enabled:t.envelope.copilotignore_enabled??!1,endpoints:t.envelope.endpoints,limited_user_quotas:t.envelope.limited_user_quotas,enterprise_list:t.envelope.enterprise_list?t.envelope.enterprise_list.map(Number):void 0,sku:t.getTokenValue("sku")??"",individual:t.userInfo.isIndividualUser,blackbird_clientside_indexing:!1,code_review_enabled:t.isCopilotCodeReviewEnabled,codesearch:t.envelope.codesearch??!1,public_suggestions:"unconfigured",telemetry:e.get(yf).isEnabled?"enabled":"disabled",username:r??"",isVscodeTeamMember:!1,copilot_plan:t.userInfo.copilotPlan,organization_login_list:t.userInfo.raw?.organization_login_list??[]})}a(j1t,"asChatLibCopilotToken");var pLr=class extends ALr.Disposable{constructor(r){super();this.ctx=r;this._onDidModelsRefresh=this._register(new REe.Emitter);this.onDidModelsRefresh=this._onDidModelsRefresh.event;this._register(vs(r,()=>{this.models=void 0}))}static{a(this,"EndpointProviderAdapter")}async getAllModels(r=!1){if(this.models===void 0||r)try{let n=this.ctx.get(jx),o=await this.ctx.get(Ft).getToken();this.models=await n.fetchModels(o)??[],this._onDidModelsRefresh.fire()}catch(n){xa(this.ctx,n,"AvailableModelsManager.fetchModels"),this.models=[]}return this.models}async getAllCompletionModels(r){return(await this.getAllModels(r)).filter(o=>o.capabilities.type==="completion")}getAllChatEndpoints(){throw new Error("getAllChatEndpoints is not supported.")}getChatEndpoint(r){throw new Error("getChatEndpoint is not supported.")}getEmbeddingsEndpoint(r){throw new Error("getEmbeddingsEndpoint is not supported.")}},hLr=class{constructor(e){this.ctx=e}static{a(this,"IgnoreServiceAdapter")}get isEnabled(){return this.ctx.get(sc).enabled}get isRegexExclusionsEnabled(){return!0}dispose(){}init(){return Promise.resolve()}async isCopilotIgnored(e,r){let n=e.toString();return(await this.ctx.get($r).getTextDocumentValidation({uri:n})).status==="invalid"}asMinimatchPattern(){return Promise.resolve(void 0)}},mLr=class{constructor(e){this.statusReporter=e}static{a(this,"StatusHandlerAdapter")}didChange(e){switch(this.statusReporter.didChangeV1(e),e.kind){case"Inactive":{this.statusReporter.forceNormalV2("cls",{message:e.message??"",inactive:!0});break}case"Error":{this.statusReporter.setErrorV2("cls",{message:e.message??""});break}case"Warning":{this.statusReporter.setWarningV2("cls",{message:e.message??""});break}case"Normal":{this.statusReporter.forceNormalV2("cls",{inactive:!1});break}}}},gLr=class extends sy{constructor(r){super();this.ctx=r;this._telemetrySender=new x3e(this.ctx)}static{a(this,"ChatLibInlineCompletionManager")}get completionProvider(){return this._completionProvider||(this._completionProvider=this.createCompletionProvider()),this._completionProvider}createCompletionProvider(){let r=this.ctx,n=r.get(Em).matchFunction,o=new R3e(this.ctx.get(nr)),s=vle(r),c={fetcher:o,authService:new fLr(r),telemetrySender:this._telemetrySender,logTarget:new w3e(r),isRunningInTest:Q1(r),contextProviderMatch:a(async(u,d)=>await n(r,u,d),"contextProviderMatch"),languageContextProvider:void 0,statusHandler:new mLr(r.get(Ss)),documentManager:r.get($r),workspace:r.get(dLr.ObservableWorkspace),urlOpener:r.get(Jm),editorInfo:r.get(Ir).getEditorInfo(),editorPluginInfo:r.get(Ir).getEditorPluginInfo(),relatedPluginInfo:r.get(Ir).getRelatedPluginInfo(),editorSession:r.get(qa),notificationSender:r.get(es),ignoreService:new hLr(r),waitForTreatmentVariables:!1,endpointProvider:new pLr(r),capiClientService:void 0,citationHandler:void 0,configOverrides:s,tokenizerProvider:cji},l=(0,gji.createInlineCompletionsProvider)(c);return this.ctx.get(Lo).onDidChangeCopilotSettings(()=>{let u=vle(this.ctx);l.setConfigs(u).catch(d=>{xa(this.ctx,d,"inlineCompletionsProvider.setConfigs")})}),l}async getCompletions(r,n,o,s={}){let c=this.completionProvider,l=this.ctx.get(dLr.ObservableWorkspace);l instanceof OV&&await l.syncSafeDocuments();let u=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments();return this._telemetrySender.updateExpConfig(u.filtersAndExp.exp),c.updateTreatmentVariables(u.filtersAndExp.exp.variables),this.asLocalResult(await c.getInlineCompletions(r,n,o,s),u)}asLocalResult(r,n){if(r!==void 0)return r.map(o=>({uuid:o.uuid,insertText:o.insertText,range:o.range,uri:o.uri,telemetry:new ix({"abexp.assignmentcontext":n.filtersAndExp.exp.assignmentContext,...o.telemetry.properties},o.telemetry.measurements,o.telemetry.issuedTime,{filters:new uB(o.telemetry.filtersAndExp.filters.toHeaders()),exp:new VI(o.telemetry.filtersAndExp.exp.variables,n.filtersAndExp.exp.assignmentContext,o.telemetry.filtersAndExp.exp.features)}),displayText:o.displayText,position:o.position,offset:o.offset,index:o.index,resultType:o.resultType,copilotAnnotations:o.copilotAnnotations,clientCompletionId:o.clientCompletionId}))}triggerSpeculativeRequests(r){return this.completionProvider.inlineCompletionShown(r.clientCompletionId)}},H1t=class extends sy{constructor(r){super();this.ctx=r}static{a(this,"ConfigurableInlineCompletionManager")}get ghostTextImpl(){return this._ghostTextImpl||(this._ghostTextImpl=new xEe(this.ctx)),this._ghostTextImpl}get chatLibImpl(){return this._chatLibImpl||(this._chatLibImpl=new gLr(this.ctx)),this._chatLibImpl}async isChatLibEnabled(){let r=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments();return Rt(this.ctx,ze.UseChatLibCompletions)??this.ctx.get(Jt).useChatLibCompletions(r)}async getCompletions(r,n,o,s={}){return await this.isChatLibEnabled()?this.chatLibImpl.getCompletions(r,n,o,s):this.ghostTextImpl.getCompletions(r,n,o,s)}async triggerSpeculativeRequests(r){return await this.isChatLibEnabled()?this.chatLibImpl.triggerSpeculativeRequests(r):this.ghostTextImpl.triggerSpeculativeRequests(r)}},x3e=class{constructor(e){this.ctx=e;this.ctx=e}static{a(this,"TelemetrySender")}updateExpConfig(e){this._expConfig=e}sendTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),Pse(this.ctx,e,o.properties,o.measurements,0),cr(this.ctx,e,SU(o.properties,CNe),o.measurements)}sendEnhancedTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),Pse(this.ctx,e,o.properties,o.measurements,1)}asTelemetryData(e,r){let n=Object.fromEntries(Object.entries(e??{}).filter(([s,c])=>c!==void 0)),o=Object.fromEntries(Object.entries(r??{}).filter(([s,c])=>c!==void 0));return n["abexp.assignmentcontext"]===void 0&&this._expConfig?.assignmentContext!==void 0&&(n["abexp.assignmentcontext"]=this._expConfig.assignmentContext),n.completionsImplementation="chat-lib",Vt.createAndMarkAsIssued(n,o)}};p();var yji=fe(F$()),Eji=fe(Rc()),k3e=fe(kxr()),_ji=fe(aL());var IPc=16,x9=class extends yji.AbstractLanguageDiagnosticsService{constructor(){super(...arguments);this._map=new Cn(IPc);this._onDidChangeDiagnostics=new Eji.Emitter;this.onDidChangeDiagnostics=this._onDidChangeDiagnostics.event}static{a(this,"LspLanguageDiagnosticsService")}getDiagnostics(r){return this._map.get(r.toString())?.diagnostics??[]}getAllDiagnostics(){return Array.from(this._map.values()).map(r=>[r.uri,r.diagnostics])}setForRequest(r,n){let o=n.map(xPc);this._map.set(r.toString(),{uri:r,diagnostics:o}),this._onDidChangeDiagnostics.fire({uris:[r]})}clear(r){this._map.delete(r.toString())&&this._onDidChangeDiagnostics.fire({uris:[r]})}clearAll(){let r=Array.from(this._map.values()).map(n=>n.uri);this._map.clear(),r.length>0&&this._onDidChangeDiagnostics.fire({uris:r})}};function xPc(t){let e=new _ji.Range(t.range.start.line,t.range.start.character,t.range.end.line,t.range.end.character),r=t.severity==="error"?k3e.DiagnosticSeverity.Error:k3e.DiagnosticSeverity.Warning,n=new k3e.Diagnostic(e,t.message,r);return t.code!==void 0&&(n.code=t.code),t.source!==void 0&&(n.source=t.source),n}a(xPc,"toVscodeDiagnostic");p();var wPc="nes.reportInlineEditArc";function vji(t,e){if(e.originalCharCount===void 0||e.originalCharCount===0)return;let r={opportunityId:e.opportunityId,languageId:e.languageId??""},n={arc:e.arc??0,originalCharCount:e.originalCharCount,originalLineCount:e.originalLineCount??0,originalDeletedLineCount:e.originalDeletedLineCount??0,currentLineCount:e.currentLineCount??0,currentDeletedLineCount:e.currentDeletedLineCount??0,didBranchChange:e.didBranchChange,timeDelayMs:e.timeDelayMs};cr(t,wPc,r,n)}a(vji,"emitNESArcTelemetry");var w9=fe(L1t()),bji=fe(tie()),ELr=fe(fee()),Sji=fe(Sy()),Tji=fe(Nbt()),Iji=fe(Rc()),_Lr=require("node:stream");Mo();var Cji=10,RPc=[0,30*1e3,120*1e3,300*1e3,600*1e3,900*1e3],yLr=new pe("nextEditSuggestions"),kPc={[w9.LogLevel.Off]:4,[w9.LogLevel.Trace]:4,[w9.LogLevel.Debug]:4,[w9.LogLevel.Info]:3,[w9.LogLevel.Warning]:2,[w9.LogLevel.Error]:1},w3e=class{constructor(e){this.ctx=e}static{a(this,"ForwardingLogTarget")}logIt(e,r,...n){this.ctx.get(Vf).logIt(this.ctx,kPc[e],r,...n)}},Yv=class{constructor(e){this.lastResultsById=new Cn(Cji);this.lastResultsByUri=new Cn(Cji);this.ctx=e,this.telemetrySender=new x3e(this.ctx)}static{a(this,"NextEditSuggestionsManager")}async handleNextEditRequest(e,r,n){let o=await(this.nextEditProvider??=this.createNextEditProvider()),s=this.ctx.get(ELr.ObservableWorkspace);if(s instanceof OV&&await s.syncSafeDocuments(),!this.shouldUseExplicitRejection()){let A=this.lastResultsByUri.get(e);A&&(this.lastResultsByUri.delete(e),this.lastResultsById.delete(A.resultId),A.isShown&&o.handleRejection(A.nextEditResult))}let c=Fs(e),l=bji.DocumentId.create(c),u=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments();if(o.updateTreatmentVariables(u.filtersAndExp.exp.variables),this.telemetrySender.updateExpConfig(u.filtersAndExp.exp),!s.getDocument(l))return;let d=await o.getNextEdit(l.toUri(),n);if(d.result==null)return;let f=await DPc({textDocumentManager:this.ctx.get($r)},d.result,{normalizedUri:c,version:r});if(!f)return;f.isCrossFile&&yLr.debug(this.ctx,`Cross-file NES: edit requested for ${l.uri} targets ${f.document.uri}`);let h=PPc(d)??Nt(),m={resultId:h,nextEditResult:d,documentId:l,targetUri:f.document.uri,isShown:!1,originalText:f.document.getText(),languageId:f.document.detectedLanguageId};return this.lastResultsById.set(h,m),this.lastResultsByUri.set(e,m),[{edit:{text:d.result.newText,range:f.range,textDocument:f.textDocument},id:h}]}async handleAcceptance(e){let r=await this.nextEditProvider,n=this.lastResultsById.get(e);!r||!n||(this.lastResultsByUri.delete(n.documentId.uri),this.lastResultsById.delete(n.resultId),this.startNESArcTelemetry(n),await r.handleAcceptance(n.nextEditResult))}startNESArcTelemetry(e){try{let r=e.nextEditResult.result;if(!r)return;let n=e.originalText.slice(0,r.range.start)+r.newText+e.originalText.slice(r.range.endExclusive);this.ctx.get($r).getTextDocument({uri:e.targetUri}).then(o=>{if(!o)return;this.ctx.get(uT).initialize(o,e.originalText,n,{timeouts:RPc}).startReporter(c=>{vji(this.ctx,{...c,opportunityId:e.resultId,languageId:e.languageId})})}).catch(o=>{yLr.warn(this.ctx,"Failed to start NES ARC telemetry",o)})}catch(r){yLr.warn(this.ctx,"Failed to start NES ARC telemetry",r)}}async handleRejection(e,r){await this.doHandleDismiss(e,!0,r)}async handleIgnored(e){await this.doHandleDismiss(e,!1)}async doHandleDismiss(e,r,n){let o=await this.nextEditProvider,s=this.lastResultsById.get(e);!o||!s||(this.lastResultsByUri.delete(s.documentId.uri),this.lastResultsById.delete(s.resultId),s.isShown&&(r?(n&&NPc(this.ctx,s.nextEditResult,n),o.handleRejection(s.nextEditResult)):o.handleIgnored(s.nextEditResult,void 0)))}async handleShown(e){let r=await this.nextEditProvider,n=this.lastResultsById.get(e);!r||!n||(n.isShown=!0,r.handleShown(n.nextEditResult))}async createNextEditProvider(){let e=this.ctx.get(ELr.ObservableWorkspace),r=new R3e(this.ctx.get(nr)),n=new vLr(this.ctx),o=vle(this.ctx),s=await(0,w9.createNESProvider)({configOverrides:o,workspace:e,fetcher:r,copilotTokenManager:n,terminalService:Tji.NullTerminalService.Instance,telemetrySender:this.telemetrySender,logTarget:new w3e(this.ctx),languageDiagnosticsService:this.ctx.get(x9),tokenizerProvider:new F1t});return this.ctx.get(Lo).onDidChangeCopilotSettings(()=>{let c=vle(this.ctx);s.setConfigs(c).catch(l=>{xa(this.ctx,l,"nesProvider.setConfigs")})}),s}shouldUseExplicitRejection(){return Rt(this.ctx,ze.NESUseExplicitRejection)}};function PPc(t){let e=t.requestUuid;return typeof e=="string"&&e.length>0?e:void 0}a(PPc,"readOpportunityId");async function DPc(t,e,r){let n=r.normalizedUri,o=e.targetDocumentUri,s=o!==void 0&&Fs(o)!==n,c=s?o:n,l=await t.textDocumentManager.getTextDocument({uri:c});if(!l)return;let u=l.positionAt(e.range.start),d=l.positionAt(e.range.endExclusive);return{textDocument:{uri:l.uri,version:s?l.version:r.version},range:{start:u,end:d},document:l,isCrossFile:s}}a(DPc,"resolveNextEditTarget");function NPc(t,e,r){let n=e;try{n.telemetryBuilder?.setDisposalReason?.(r)}catch(o){xa(t,o,"nesProvider.setDisposalReason")}}a(NPc,"trySetChatLibDisposalReason");var vLr=class{constructor(e){this._ctx=e;this.didChangeTokenResult=new Iji.Emitter;this.onDidCopilotTokenRefresh=this.didChangeTokenResult.event;this._ctx.get(Ft).onDidChangeTokenResult(()=>{this.didChangeTokenResult.fire()})}static{a(this,"CopilotTokenManagerAdapter")}async getCopilotToken(e){let r=this._ctx.get(Ft);e&&r.resetToken("nes_force_refresh");let n=await r.getToken(),o=await this._ctx.get(Mr).resolveSession();return j1t(n,this._ctx,o?.login)}resetCopilotToken(e){this._ctx.get(Ft).resetToken("nes",e)}},R3e=class{constructor(e){this._delegate=e}static{a(this,"FetcherAdapter")}getUserAgentLibrary(){return this._delegate.name}async fetch(e,r){let n={headers:r.headers,body:r.body,timeout:r.timeout,json:r.json,method:r.method,signal:r.signal},o=await this._delegate.fetch(e,n),s=o.body(),c=null;return s&&(s instanceof _Lr.Readable?c=_Lr.Readable.toWeb(s):c=s),new Sji.Response(o.status,o.statusText,o.headers,c,this.fetcherId(),()=>{},Nt(),new URL(e).hostname)}fetcherId(){switch(this._delegate.name){case"EditorFetcher":case"ElectronFetcher":return"electron-fetch";case"FetchFetcher":case"NodeFetchFetcher":return"node-fetch";case"FakeFetcher":return"test-stub";default:return"helix-fetch"}}async disconnectAll(){return this._delegate.disconnectAll()}makeAbortController(){return new AbortController}isAbortError(e){return e&&e.name==="AbortError"}isInternetDisconnectedError(e){return!1}isFetcherError(e){return ax(e)}isNetworkProcessCrashedError(e){return!1}getUserMessageForFetcherError(e){return`Fetcher error: ${e.message}`}async fetchWithPagination(e,r){let n=[],o=r.pageSize??20,s=r.startPage??1,c=!1;do{let l=r.buildUrl(e,o,s),u=await this.fetch(l,r);if(!u.ok)return n;let d=await u.json(),f=r.getItemsFromResponse(d);n.push(...f),c=f.length===o,s++}while(c);return n}};var MPc="github.copilot.didAcceptNextEditSuggestionItem",CLr=class extends AR{constructor(){super(...arguments);this.name=MPc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}async handle(r,[n]){return await this.ctx.get(Yv).handleAcceptance(n),!0}},OPc="github.copilot.didRejectNextEditSuggestionItem",bLr=class extends AR{constructor(){super(...arguments);this.name=OPc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidRejectCommand")}async handle(r,[n]){return await this.ctx.get(Yv).handleRejection(n),!0}},LPc="github.copilot.didIgnoreNextEditSuggestionItem",SLr=class extends AR{constructor(){super(...arguments);this.name=LPc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidIgnoreCommand")}async handle(r,[n]){return await this.ctx.get(Yv).handleIgnored(n),!0}},xji=[CLr,bLr,SLr];p();var ILr="github.copilot.didAcceptPanelCompletionItem",TLr=class extends AR{constructor(){super(...arguments);this.name=ILr;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptPanelCompletionItemCommand")}handle(r,n){let[o]=n,c=this.ctx.get(ku).get(o);return c?(eMe(this.ctx,c.triggerCategory,c.displayText,c.offset,c.uri,c.telemetry,{compType:"full",acceptedLength:c.displayText.length,acceptedLines:KH(c.displayText)},c.copilotAnnotations),!0):!1}},wji=[TLr];var BPc=[...Zni,...Xni,...xji,...wji];function Rji(t,e){let r=new Map;for(let n of BPc){let o=new n(t),s=$u.Compile(o.arguments);r.set(o.name,{typeCheck:s,command:o})}return e.onExecuteCommand((n,o)=>{let s=r.get(n.command);if(!s)throw new Error(`Unknown command: ${n.command}`);let c=R9(n.arguments??[]);if(c.length0}async markInstalled(e){let r=e.get(Ir).getEditorPluginInfo();await e.get(ti).update("versions",r.name,r.version)}wasPreviouslyInstalled(e){return Promise.resolve(!1)}async isNewUpgrade(e){try{let r=e.get(Ir).getEditorPluginInfo(),n=await e.get(ti).read("versions",r.name);return n===void 0&&await this.hasPersistedSettings(e)?!0:(0,P3e.gt)((0,P3e.coerce)(r.version),(0,P3e.coerce)(n))}catch{return!1}}async markUpgraded(e){await this.markInstalled(e)}async uninstall(e){await super.uninstall(e);let r=e.get(Ir).getEditorPluginInfo();await e.get(ti).delete("versions",r.name),(await e.get(ti).listKeys("versions")).length===0&&await e.get(ti).deleteSetting("versions")}};p();var Mji=fe(nl()),Oji=require("crypto"),z1t=fe(require("path")),PEe=fe(Fc());var QPc={watchedFiles:[],contentRestrictedFiles:[],unknownFileExtensions:[]},qPc=new PEe.ProgressType,PN=class t{constructor(e){this.ctx=e;this.#e=new Vi;this._changeHandlerLimiter=new Mji.Limiter(1);this.onDidChangeWatchedFiles=this.#e.event}static{a(this,"LspFileWatcher")}#e;static{this.requestType=new PEe.ProtocolRequestType("copilot/watchedFiles")}get connection(){return this.ctx.get(Xt).connection}init(){this.ctx.get(kn).getCapabilities().watchedFiles&&this.connection.onNotification(PEe.DidChangeWatchedFilesNotification.type,r=>{if("workspaceUri"in r&&typeof r.workspaceUri=="string"){let n=r;this._changeHandlerLimiter.queue(()=>this.didChangeWatchedFilesHandler(n))}})}async getWatchedFiles(e){if(!this.ctx.get(kn).getCapabilities().watchedFiles)return QPc;let n=await this.fetchWatchedFileEntries(e);return this.buildWatchedFilesResponse(n)}async getWatchedFileUris(e){if(!this.ctx.get(kn).getCapabilities().watchedFiles)return[];let n=await this.fetchWatchedFileEntries(e),o=[],s=new Set;for(let c of n){let l=typeof c=="string"?c:c?.uri;if(!l||s.has(l))continue;s.add(l);let u=z1t.extname(l).toLowerCase();PQ.includes(u)&&o.push({uri:l})}return o}async didChangeWatchedFilesHandler(e){let r=[],n=[],o=[];for(let s of e.changes){let c=s.uri,l={uri:c,isRestricted:!1,isUnknownFileExtension:!1},u=z1t.extname(s.uri).toLowerCase();if(!PQ.includes(u))l.isUnknownFileExtension=!0;else{let d=await this.resolveWatchedDocument(c);d===void 0?l.isRestricted=!0:l.document=d}switch(s.type){case 1:n.push(l);break;case 2:r.push(l);break;case 3:o.push(l);break}}this.#e.fire({workspaceFolder:{uri:e.workspaceUri},created:n,changed:r,deleted:o})}async resolveWatchedDocument(e){return this.ctx.get(sc).enabled?this.getValidDocument(e):US.create(e,"UNKNOWN",-1,"")}async getValidDocument(e){let n=await this.ctx.get(ni).getOrReadTextDocument({uri:e});return n.status==="valid"?n.document:void 0}async fetchWatchedFileEntries(e){let r=e.partialResultToken??(0,Oji.randomUUID)(),n=[],o=this.connection.onProgress(qPc,r,s=>{s?.files?.length&&n.push(...s.files)});try{let s=await this.connection.sendRequest(t.requestType,{...e,partialResultToken:r});Array.isArray(s.files)&&n.push(...s.files)}finally{o.dispose()}return n}async buildWatchedFilesResponse(e){let r=[],n=[],o=[],s=new Set;for(let c of e){let l=typeof c=="string"?c:c?.uri;if(!l||s.has(l))continue;s.add(l);let u=z1t.extname(l).toLowerCase();if(!PQ.includes(u)){o.push({uri:l});continue}let d=await this.getValidDocument(l);if(d===void 0){n.push({uri:l});continue}r.push(d)}return{watchedFiles:r,contentRestrictedFiles:n,unknownFileExtensions:o}}};p();var jPc=new pe("mcpGateway.projectCleanup"),pie=class{constructor(e){this._dispose=e}static{a(this,"McpProjectCleanupSubscription")}dispose(){this._dispose()}};function Lji(t){let e=t.get($r),r=t.get(ny),n=e.onDidChangeWorkspaceFolders(o=>{if(o.removed.length!==0)for(let s of o.removed)r.removeProject(s.uri).catch(c=>{jPc.warn(t,"removeProject failed during workspace-folder cleanup",{workspaceFolder:s.uri,error:c instanceof Error?c.message:String(c)})})});return new pie(()=>n.dispose())}a(Lji,"installMcpProjectCleanup");p();p();p();p();p();var Uji=require("crypto");var HPc=new pe("CloudAgentLogParser"),GPc=new Set(["run_setup","run_custom_setup_step"]),Y1t=class{constructor(){this.counter=0}static{a(this,"CloudAgentIdSource")}next(){return++this.counter}};function DN(t){if(t!=null)return typeof t=="string"?t:JSON.stringify(t)}a(DN,"asString");function $Pc(t){return typeof t=="number"&&Number.isFinite(t)?new Date(t*1e3).toISOString():new Date().toISOString()}a($Pc,"chunkTimestamp");function DEe(t,e,r){return{id:(0,Uji.randomUUID)(),timestamp:r,parentId:null,type:t,data:e}}a(DEe,"event");function K1t(t,e,r){if(!e||e.trim().length===0)return[];let n=[];return zPc(t,e,o=>{let s=$Pc(o.created),c=o.choices;if(Array.isArray(c))for(let l of c){if(!l||typeof l!="object")continue;let u=l,d=u.delta;!d||typeof d!="object"||DN(d.role)==="assistant"&&VPc(d,u,n,r,s)}}),n}a(K1t,"parseCloudAgentLogs");function VPc(t,e,r,n,o){let s=t.tool_calls,c=Array.isArray(s)&&s.length>0?s:void 0,l=DN(t.content),u=DN(e.finish_reason);if(u==="tool_calls"&&c){let m=c[0],g=m.function,A=DN(g?.name);if(A&&GPc.has(A)){if(l&&l.trim().length>0){let y=Fji(DN(g?.arguments)),E=DN(y?.name)??l,_=DN(m.id)??`setup-${E}`;Qji(r,_,A,{name:E},E,o)}return}}let d=l?.trimStart(),f=d?.startsWith("")===!0,h=d&&!d.startsWith("")&&!d.startsWith("")?d.trim():"";if(c){h.length>0&&r.push(Bji(h,n,o));for(let m of c){let g=m,A=g.function,y=DN(A?.name);if(!y)continue;let E=Fji(DN(A?.arguments));WPc(r,g,y,l,E,n,o)}if(f){let m=(l??"").replace(/^\s*\s*/i,"").replace(/\s*<\/error>\s*$/i,"").trim(),g=`command-error-${n.next()}`;r.push(DEe("tool.execution_start",{toolCallId:g,toolName:"command",arguments:{}},o)),r.push(DEe("tool.execution_complete",{toolCallId:g,success:!1,error:{message:m.length>0?m:"Command failed"}},o))}return}h.length>0&&(u==="stop"?r.push(Bji(h,n,o)):r.push(qji(h,n,o)))}a(VPc,"processAssistantDelta");function WPc(t,e,r,n,o,s,c){if(r==="reply_to_comment")return;let l=DN(e.id);if(!l)return;if(r==="think"){let d=DN(o?.thought)??n;d&&d.trim().length>0&&t.push(qji(d,s,c));return}let u=n?.trim();Qji(t,l,r,o,u&&u.length>0?u:void 0,c)}a(WPc,"appendToolPart");function Qji(t,e,r,n,o,s){t.push(DEe("tool.execution_start",{toolCallId:e,toolName:r,arguments:n??{}},s)),t.push(DEe("tool.execution_complete",{toolCallId:e,success:!0,result:{content:o??""}},s))}a(Qji,"pushToolCall");function Bji(t,e,r){return DEe("assistant.message",{messageId:`cloud-text-${e.next()}`,content:t},r)}a(Bji,"textEvent");function qji(t,e,r){return DEe("assistant.reasoning",{reasoningId:`cloud-reasoning-${e.next()}`,content:t},r)}a(qji,"reasoningEvent");function Fji(t){if(!(!t||t.trim().length===0))try{let e=JSON.parse(t);return e&&typeof e=="object"?e:void 0}catch{return}}a(Fji,"parseArguments");function zPc(t,e,r){for(let n of e.split(/\r?\n/)){let o=n.trimStart();if(!o.startsWith("data:"))continue;let s=o.slice(5).trim();if(s.length===0)continue;let c;try{c=JSON.parse(s)}catch{HPc.debug(t,"parseCloudAgentLogs: skipping malformed SSE data chunk",{data:s});continue}c&&typeof c=="object"&&r(c)}}a(zPc,"forEachDataChunk");p();var J1t=require("crypto");var hie=new pe("CloudAgentSession"),mie="CloudAgentSession",wLr="cloud:",YPc="github.pull_request_card";function RLr(t,e){let r=e?new Date(e):null,n=r&&!isNaN(r.getTime())?r.toISOString():new Date().toISOString();return{id:(0,J1t.randomUUID)(),timestamp:n,parentId:null,type:YPc,data:{number:t.number,title:t.title?.trim()||`Pull request #${t.number}`,body:t.body?.trim()||null,htmlUrl:t.html_url}}}a(RLr,"buildCloudPullRequestCardEvent");function kLr(t,e,r){return`${wLr}${t}/${e}#${r}`}a(kLr,"buildCloudSessionId");function PLr(t){if(!t.startsWith(wLr))return;let e=t.slice(wLr.length),r=e.lastIndexOf("#");if(r<=0||r===e.length-1)return;let n=e.slice(0,r),o=e.slice(r+1),s=n.indexOf("/");if(s<=0||s===n.length-1)return;let c=n.slice(0,s),l=n.slice(s+1),u=Number(o);if(Number.isInteger(u)&&u>0)return{owner:c,repo:l,pullRequestNumber:u}}a(PLr,"parseCloudSessionId");var LL={InProgress:"in_progress",Queued:"queued",Completed:"completed",Failed:"failed"},xLr=3e3,KPc=120*1e3,JPc=300*1e3,jji=10,Z1t=class{constructor(e,r,n,o){this.ctx=e;this.notificationSender=r;this.client=n;this._ids=new Y1t;this.localSessionId=o.localSessionId,this.workspaceFolder=o.workspaceFolder,this._cwd=ln(o.workspaceFolder.uri),this._pullRequest=o.pullRequest}static{a(this,"CloudAgentSession")}get cwd(){return this._cwd}get pullRequest(){return this._pullRequest}get idSource(){return this._ids}get hasPullRequest(){return this._pullRequest!==void 0}updatePullRequest(e){this._pullRequest=e}async startInitialJob(e){let n=this.resetCancellation().token;try{let{owner:o,name:s,baseRef:c}=await this.resolveRepo(n),l=Tue(e),u=await this.client.createCodingTask(l,e,o,s,c,n);if(n.isCancellationRequested)return{stream:Promise.resolve()};let d=u.pullRequest;return this._pullRequest=d,this.emit(RLr(d)),hie.info(this.ctx,`${mie}.startInitialJob: job created`,{localSessionId:this.localSessionId,pullRequestNumber:d.number,cloudSessionId:u.sessionId}),{stream:this.streamSessionSafe(u.sessionId,0,void 0,n)}}catch(o){if(n.isCancellationRequested||vxe(o))return{stream:Promise.resolve()};throw o}}async submitFollowUp(e){let r=this._pullRequest;if(!r)throw new Error("submitFollowUp called before a pull request was created");let o=this.resetCancellation().token,s=await this.snapshotSessionIds(r.id,o);if(o.isCancellationRequested)return{stream:Promise.resolve()};await new nm(this.ctx).addPullRequestComment(r.repository.owner.login,r.repository.name,r.number,`@copilot ${e}`);let l=await this.waitForNewSession(r.id,s,o);return o.isCancellationRequested?{stream:Promise.resolve()}:l?{stream:this.streamSessionSafe(l,0,void 0,o)}:(this.emitError("Timed out waiting for the cloud agent to start a new session."),{stream:Promise.resolve()})}resumeStreaming(e){let r=this.resetCancellation();return{stream:this.streamSessionSafe(e.cloudSessionId,e.initialLogLength,e.state,r.token)}}async streamSessionSafe(e,r,n,o){try{await this.streamSession(e,r,n,o)}catch(s){if(o.isCancellationRequested)return;this.emitError(this.errorMessage(s)||"Cloud agent session stream failed")}}stop(){this._cts?.cancel(),this._cts?.dispose(),this._cts=void 0}stopByUser(){this.stop(),this.emitIdle()}async streamSession(e,r,n,o){if(this.emit(this.event("assistant.turn_start",{turnId:(0,J1t.randomUUID)(),interactionId:this.localSessionId})),n!==LL.InProgress){let s=await this.waitForInProgress(e,o);if(o.isCancellationRequested)return;switch(s?.state){case LL.InProgress:break;case LL.Failed:this.emitError(s.error?.message??"The cloud agent session failed.");return;case LL.Completed:this.emitIdle();return;default:this.emitError("The cloud agent session did not start in time.");return}}await this.streamSessionLogs(e,r,o)}async waitForInProgress(e,r){let n=Date.now()+KPc;for(;!r.isCancellationRequested&&Date.now()=jji){this.emitError("The cloud agent stream stopped after repeated failures.");return}continue}if(!c){hie.warn(this.ctx,`${mie}.streamSessionLogs: session no longer in list; stopping`,{cloudSessionId:e}),this.emitIdle();return}let l;try{l=await this.client.getSessionLogs(e,n)}catch(f){if(hie.warn(this.ctx,`${mie}.streamSessionLogs: log fetch failed; will retry`,{cloudSessionId:e,error:this.errorMessage(f)}),++s>=jji){this.emitError("The cloud agent stream stopped after repeated failures.");return}continue}s=0;let u=c.state,d=u!==LL.InProgress&&u!==LL.Queued;if(l.length>o){let f=l.slice(o);o=l.length;let h=K1t(this.ctx,f,this._ids);for(let m of h)this.emit(m)}if(d){u===LL.Failed?this.emitError(c.error?.message??"The cloud agent session failed."):this.emitIdle();return}}}async waitForNewSession(e,r,n){let o=Date.now()+JPc;for(;!n.isCancellationRequested&&Date.now()!r.has(l.id)).sort((l,u)=>new Date(u.created_at).getTime()-new Date(l.created_at).getTime())[0];if(c)return c.id}await this.delay(xLr,n)}}async snapshotSessionIds(e,r){let n=await this.client.getAllSessions(e,r);return new Set((n??[]).map(o=>o.id))}async getSessionInfo(e,r){let n=this._pullRequest;return n?(await this.client.getAllSessions(n.id,r)??[]).find(s=>s.id===e):void 0}async resolveRepo(e){let r={uri:this.workspaceFolder.uri},o=await new Tf(this.ctx).getRepo(r);if(!o||!o.isGitHub())throw new Error("No GitHub repository found in the workspace folder.");if(!o.owner||!o.name)throw new Error("Could not determine repository owner and name.");let c=await new LO([new BO,new FO]).getBranchInfo(this.ctx,r);if(!c?.currentBranch||c.isDetachedHead)throw new Error("No current branch found or detached HEAD state \u2014 cannot create a cloud agent job.");if(e.isCancellationRequested)throw new Error("Request was cancelled");return{owner:o.owner,name:o.name,baseRef:c.currentBranch}}emit(e){this.notificationSender.sendBackgroundAgentSessionUpdate(this.localSessionId,e,"CLOUD").catch(r=>{hie.warn(this.ctx,`${mie}.emit: failed to send session update`,{localSessionId:this.localSessionId,error:this.errorMessage(r)})})}emitIdle(){this.emit(this.event("session.idle",{}))}emitError(e){this.emit(this.event("session.error",{errorType:"cloudAgent",message:e})),this.emitIdle()}event(e,r){return{id:(0,J1t.randomUUID)(),timestamp:new Date().toISOString(),parentId:null,type:e,data:r}}resetCancellation(){this.stop();let e=new Fn.CancellationTokenSource;return this._cts=e,e}delay(e,r){return new Promise(n=>{let o=setTimeout(()=>{s?.dispose(),n()},e),s=r.onCancellationRequested(()=>{clearTimeout(o),s?.dispose(),n()})})}errorMessage(e){return e instanceof Error?e.message:String(e)}};p();var NEe=new pe("GitHubGraphQLClient"),MEe=class{constructor(e){this.ctx=e;this.graphqlClient=null}static{a(this,"GitHubGraphQLClient")}async getGraphQLClient(){if(this.graphqlClient)return this.graphqlClient;let e=await this.getApiSession(),r=this.ctx.get(nr);return this.graphqlClient=Ybn.defaults({headers:{authorization:`token ${e.accessToken}`},baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.graphqlClient}async searchPullRequests(e){NEe.debug(this.ctx,`Searching pull requests with query: ${e}`);let r=await this.getGraphQLClient();try{let n=[],o=null,s=!0,c=0;for(;s;){c++,NEe.debug(this.ctx,`Fetching page ${c} of pull requests search results`);let u=await r(` + query searchPullRequests($searchQuery: String!, $cursor: String) { + search(query: $searchQuery, type: ISSUE, first: 100, after: $cursor) { + nodes { + ... on PullRequest { + fullDatabaseId + number + title + author { + login + } + url + isDraft + body + updatedAt + repository { + owner { + login + } + name + } + } + } + pageInfo { + hasNextPage + endCursor + } + } + } + `,{searchQuery:e,cursor:o}),d=u.search.nodes.map(f=>({id:f.fullDatabaseId,number:f.number,title:f.title,user:f.author,html_url:f.url,draft:f.isDraft,body:f.body,updated_at:f.updatedAt,repository:f.repository}));n.push(...d),s=u.search.pageInfo.hasNextPage,o=u.search.pageInfo.endCursor}return NEe.debug(this.ctx,`Found ${n.length} pull requests`),n}catch(n){if(NEe.error(this.ctx,`Failed to search pull requests with query '${e}':`,n),n&&typeof n=="object"&&"status"in n){let o=n;throw new od(o.status,o.message||"GitHub GraphQL API failed")}throw n}}async getPullRequestsFromGlobalIds(e){let r=new Map,n=[...new Set(e)];if(n.length===0)return r;NEe.debug(this.ctx,`Fetching ${n.length} pull request(s) by global id`);let o=await this.getGraphQLClient(),s=100;try{for(let c=0;c{T1.warn(this.ctx,`${I1}.resumeSession: stream failed`,{sessionId:n,error:l instanceof Error?l.message:String(l)})})}return T1.info(this.ctx,`${I1}.resumeSession`,{sessionId:n,pullRequestNumber:r.pullRequest.number,events:o.length}),{sessionId:n,workspacePath:r.cwd,events:o,status:s?.state}}async sendMessage(e,r){let n=this._sessions.get(e.sessionId);if(!n)return Promise.reject(new Error(`Cannot start cloud session ${e.sessionId}: session was not created or resumed first.`));let o=Nt(),s=n.hasPullRequest,{stream:c}=s?await n.submitFollowUp(e.message):await n.startInitialJob(e.message);return n.pullRequest&&this._pullRequestSessionId.set(this.sessionIdForPullRequest(n.pullRequest),n.localSessionId),c.catch(l=>{T1.warn(this.ctx,`${I1}.sendMessage: turn failed`,{sessionId:e.sessionId,isFollowUp:s,error:l instanceof Error?l.message:String(l)})}),{messageId:o}}stopSession(e){let r=this._sessions.get(e);return r?(r.stopByUser(),T1.info(this.ctx,`${I1}.stopSession`,{sessionId:e}),Promise.resolve()):(T1.warn(this.ctx,`${I1}.stopSession: unknown session`,{sessionId:e}),Promise.resolve())}destroySession(e){return Promise.reject(this.unsupported("destroySession"))}async listSessions(e){let r=e?.cwd;if(!r)return T1.warn(this.ctx,`${I1}.listSessions: missing cwd in params`),{sessions:[]};try{let n=await this.ctx.get(Tf).getRepo({uri:this.toWorkspaceUri(r)});if(!n||!n.isGitHub()||!n.owner||!n.name)return T1.warn(this.ctx,`${I1}.listSessions: workspace is not a GitHub repo`),{sessions:[]};let o=`${n.owner}/${n.name}`,s=await this.client.getRepoSessions(o),c=new Map;for(let f of s){let h=c.get(f.resource_id);(!h||new Date(f.created_at).getTime()>new Date(h.created_at).getTime())&&c.set(f.resource_id,f)}let l=Array.from(new Set(Array.from(c.values()).map(f=>f.resource_global_id).filter(f=>!!f))),u=await new MEe(this.ctx).getPullRequestsFromGlobalIds(l),d=[];for(let f of c.values()){if(!f.resource_global_id){T1.warn(this.ctx,`${I1}.listSessions: session has no resource_global_id`,{cloudSessionId:f.id,resourceId:f.resource_id});continue}let h=u.get(f.resource_global_id);if(!h){T1.warn(this.ctx,`${I1}.listSessions: pull request not found`,{cloudSessionId:f.id,resourceId:f.resource_id});continue}let m=this.ensurePullRequestSession(h,r);d.push({sessionId:m,summary:h.title,startTime:this.toIsoString(f.created_at),modifiedTime:this.toIsoString(f.last_updated_at),status:f.state,isRemote:!1})}return T1.info(this.ctx,`${I1}.listSessions: success`,{nwo:o,count:d.length}),{sessions:d}}catch(n){return T1.warn(this.ctx,`${I1}.listSessions: failed`,{error:n instanceof Error?n.message:String(n)}),{sessions:[]}}}listModels(e){return Promise.resolve({models:[ZPc()]})}toWorkspaceUri(e){return/^[A-Za-z][A-Za-z0-9+.-]+:/.test(e)?e:ts(e)}createCloudSession(e,r,n){return new Z1t(this.ctx,this.notificationSender,this.client,{localSessionId:e,workspaceFolder:r,pullRequest:n})}ensurePullRequestSession(e,r){let n=this.sessionIdForPullRequest(e),o=this.cachedSessionForCanonicalId(n);if(o)return o.updatePullRequest(e),o.localSessionId;let s=this.createCloudSession(n,{uri:r},e);return this._sessions.set(n,s),this._pullRequestSessionId.set(n,n),n}cachedSessionForCanonicalId(e){let r=this._pullRequestSessionId.get(e)??e;return this._sessions.get(r)}findReusableSession(e){let r=this._sessions.get(e);if(r)return r;let n=PLr(e);if(n)return this.cachedSessionForCanonicalId(kLr(n.owner,n.repo,n.pullRequestNumber))}sessionIdForPullRequest(e){return kLr(e.repository.owner.login,e.repository.name,e.number)}async getOrCreateSession(e,r){return this._sessions.get(e)??await this.createAndCacheSession(e,r)}async createAndCacheSession(e,r){let n=await this.resolvePullRequest(e),o=this.createCloudSession(e,r,n);return this._sessions.set(e,o),n&&this._pullRequestSessionId.set(this.sessionIdForPullRequest(n),e),o}async loadSessionHistory(e,r){let o=(await this.client.getAllSessions(e.id)??[]).slice().sort((u,d)=>new Date(u.created_at).getTime()-new Date(d.created_at).getTime()),s=[],c,l=0;for(let u of o){let d=u.event_content?.trim()||u.name?.trim()||e.title;d?s.push(this.userMessageEvent(d,u.created_at)):T1.warn(this.ctx,`${I1}.loadSessionHistory: session has no prompt`,{cloudSessionId:u.id,pullRequestNumber:e.number}),l===0&&s.push(RLr(e,u.created_at)),l++;let f;try{f=await this.client.getSessionLogs(u.id)}catch(h){T1.warn(this.ctx,`${I1}.loadSessionHistory: log fetch failed`,{cloudSessionId:u.id,error:h instanceof Error?h.message:String(h)});continue}s.push(...K1t(this.ctx,f,r)),c={cloudSessionId:u.id,initialLogLength:f.length,state:u.state}}return{events:s,streamStatus:c}}userMessageEvent(e,r){let n=new Date(r),o=isNaN(n.getTime())?new Date().toISOString():n.toISOString();return{id:(0,Hji.randomUUID)(),timestamp:o,parentId:null,type:"user.message",data:{content:e}}}toIsoString(e){let r=new Date(e);return isNaN(r.getTime())?new Date().toISOString():r.toISOString()}async resolvePullRequest(e){let r=PLr(e);if(r)try{return await new nm(this.ctx).getPullRequest(r.owner,r.repo,r.pullRequestNumber)}catch(n){T1.warn(this.ctx,`${I1}.resolvePullRequest: failed`,{sessionId:e,error:n instanceof Error?n.message:String(n)});return}}unsupported(e){return new Error(`${e} is not supported by CloudAgentService`)}truncateHistory(e){return Promise.reject(this.unsupported("truncateHistory"))}forkSession(e){return Promise.reject(this.unsupported("forkSession"))}handleInteraction(e){return Promise.resolve({success:!1})}getPlanPath(e){return Promise.reject(this.unsupported("getPlanPath"))}enableRemote(e){return Promise.reject(this.unsupported("enableRemote"))}disableRemote(e){return Promise.reject(this.unsupported("disableRemote"))}getRemoteStatus(e){throw this.unsupported("getRemoteStatus")}compactHistory(e){return Promise.reject(this.unsupported("compactHistory"))}stopCompactHistory(e){return Promise.reject(this.unsupported("stopCompactHistory"))}};p();p();var Gji=require("node:child_process"),$ji=require("node:events"),DLr=fe(require("node:readline"));var lk=new pe("CodexProcessManager"),X1t=class extends $ji.EventEmitter{constructor(r,n,o,s){super();this.ctx=r;this.codexPath=n;this.proxyPort=o;this.cwd=s;this.rpcId=0;this.pendingRequests=new Map;this.notificationHandlers=[];this.serverRequestHandlers=new Map;this.stopping=!1}static{a(this,"CodexProcessManager")}start(){if(this.process)return;this.stopping=!1;let r=this.codexPath,n=["app-server","-c",'model_provider="copilot"',"-c",'model_providers.copilot.name="copilot"',"-c",`model_providers.copilot.base_url="http://127.0.0.1:${this.proxyPort}/v1"`,"-c",'model_providers.copilot.wire_api="responses"',"-c",'sandbox_permissions=["disk-full-read-access","disk-write-cwd","disk-write-platform-user-temp","network-full-access"]',"-c","features.default_mode_request_user_input = true"];lk.debug(this.ctx,`start: cmd=${r} args=${JSON.stringify(n)} cwd=${this.cwd}`);try{this.process=(0,Gji.spawn)(r,n,{env:{...process.env,OPENAI_API_KEY:"copilot-proxy"},stdio:["pipe","pipe","pipe"],cwd:this.cwd||void 0}),lk.debug(this.ctx,`start: spawn succeeded, pid=${this.process.pid}`)}catch(o){let s=o instanceof Error?o.message:String(o);throw lk.error(this.ctx,`start: spawn failed: ${s}`),new Error(`Failed to spawn codex app-server: ${s}`)}this.process.on("error",o=>{lk.error(this.ctx,`process error event: ${o.message}`),this.handleProcessExit(-1)}),this.process.on("exit",o=>{lk.debug(this.ctx,`process exit event: code=${o}`),this.handleProcessExit(o??-1)}),this.process.stdout&&(this.rl=DLr.default.createInterface({input:this.process.stdout}),this.rl.on("line",o=>this.handleLine(o))),this.process.stderr&&DLr.default.createInterface({input:this.process.stderr}).on("line",s=>{lk.debug(this.ctx,`CodexProcessManager [stderr]: ${s}`)})}async stop(){if(this.stopping=!0,!this.process)return;this.rejectAllPending(new Error("Process stopping")),this.process.kill("SIGTERM");let r=setTimeout(()=>{this.process&&!this.process.killed&&this.process.kill("SIGKILL")},5e3);await new Promise(n=>{if(!this.process){n();return}this.process.on("exit",()=>{clearTimeout(r),n()})}),this.process=void 0,this.rl=void 0}sendRequest(r,n){if(!this.process?.stdin)return Promise.reject(new Error("Codex process not running"));let o=++this.rpcId,s=JSON.stringify({jsonrpc:"2.0",id:o,method:r,params:n??{}});return this.process.stdin.write(s+` +`),new Promise((c,l)=>{let u=setTimeout(()=>{this.pendingRequests.delete(o),l(new Error(`Timeout waiting for response to ${r} (id=${o})`))},3e4);this.pendingRequests.set(o,{resolve:c,reject:l,timer:u})})}sendNotification(r,n){if(!this.process?.stdin||!this.process.stdin.writable)return lk.warn(this.ctx,`sendNotification: stdin unavailable, dropping ${r}`),!1;let o=JSON.stringify({jsonrpc:"2.0",method:r,params:n??{}});try{return this.process.stdin.write(o+` +`),!0}catch(s){let c=s instanceof Error?s.message:String(s);return lk.warn(this.ctx,`sendNotification: write failed for ${r}: ${c}`),!1}}onNotification(r){this.notificationHandlers.push(r)}onServerRequest(r,n){this.serverRequestHandlers.set(r,n)}sendRawResponse(r,n){if(!this.process?.stdin||!this.process.stdin.writable)return lk.warn(this.ctx,`sendRawResponse: stdin unavailable, dropping response id=${r}`),!1;let o=JSON.stringify({jsonrpc:"2.0",id:r,result:n});try{return this.process.stdin.write(o+` +`),!0}catch(s){let c=s instanceof Error?s.message:String(s);return lk.warn(this.ctx,`sendRawResponse: write failed for id=${r}: ${c}`),!1}}isRunning(){return this.process!==void 0&&!this.process.killed}handleLine(r){if(r.trim())try{let n=JSON.parse(r);if(n.id!==void 0&&this.pendingRequests.has(n.id)){let o=this.pendingRequests.get(n.id);this.pendingRequests.delete(n.id),clearTimeout(o.timer),n.error?o.reject(new Error(JSON.stringify(n.error))):o.resolve(n.result)}else if(n.id!==void 0&&n.method)lk.info(this.ctx,`CodexProcessManager: \u2190 REQUEST ${n.method} (id=${n.id}) params=${JSON.stringify(n.params).slice(0,500)}`),this.handleServerRequest(n.id,n.method,n.params);else if(n.method)for(let o of this.notificationHandlers)o(n.method,n.params)}catch{}}handleServerRequest(r,n,o){lk.debug(this.ctx,`CodexProcessManager: server request ${n} (id=${r})`);let s=this.serverRequestHandlers.get(n);if(s){s(o,r);return}let c=n.includes("applyPatch")?{decision:"approved"}:{decision:"accept"};this.sendRawResponse(r,c);for(let l of this.notificationHandlers)l(n,o)}handleProcessExit(r){if(this.process=void 0,this.rl=void 0,this.stopping)return;let n=new Error(`Codex process exited unexpectedly (code: ${r})`);this.rejectAllPending(n),this.emit("error",n)}rejectAllPending(r){for(let[,n]of this.pendingRequests)clearTimeout(n.timer),n.reject(r);this.pendingRequests.clear()}};p();p();var OEe=class{constructor(){this._copilotUsage=new fme}static{a(this,"CodexSessionStateService")}setActiveThread(e){this._activeThreadId=e}getActiveThread(){return this._activeThreadId}addCopilotUsageNanoAiuForThread(e,r){this._copilotUsage.add(e,r)}takeCopilotUsageNanoAiuForThread(e){return this._copilotUsage.take(e)}clear(e){this._copilotUsage.clear(e),this._activeThreadId===e&&(this._activeThreadId=void 0)}};var Vji=fe(require("node:http")),NLr=require("node:stream/promises");var P9=new pe("CodexResponsesProxyServer"),XPc=16*1024*1024,eSt=class{constructor(e,r=new OEe){this.ctx=e;this.stateService=r;this.port=0}static{a(this,"CodexResponsesProxyServer")}async start(){if(this.server)return this.port;let e=Vji.createServer((r,n)=>{this.handleRequest(r,n)});return this.server=e,new Promise((r,n)=>{e.once("error",n),e.listen(0,"127.0.0.1",()=>{let o=e.address();o&&typeof o=="object"?(this.port=o.port,P9.info(this.ctx,`CodexResponsesProxyServer listening on port ${o.port}`),e.removeListener("error",n),r(this.port)):n(new Error("Failed to get server address"))})})}async stop(){let e=this.server;e&&(await new Promise(r=>{e.close(()=>r())}),this.server=void 0,this.port=0)}getPort(){return this.port}async handleRequest(e,r){try{if(P9.info(this.ctx,`handleRequest: ${e.method} ${e.url}`),e.method==="POST"&&e.url?.includes("/responses")){let n=await this.readBody(e);P9.info(this.ctx,`proxyToCapiResponses: forwarding ${n.length} bytes`),await this.proxyToCapiResponses(n,r),P9.info(this.ctx,"proxyToCapiResponses: completed")}else P9.debug(this.ctx,`CodexResponsesProxyServer: unhandled ${e.method} ${e.url}`),r.writeHead(404),r.end("{}")}catch(n){P9.exception(this.ctx,n,".handleRequest"),r.headersSent||r.writeHead(500,{"Content-Type":"application/json"}),r.writableEnded||r.end(JSON.stringify({error:{message:"Internal proxy error"}}))}}async proxyToCapiResponses(e,r){let n=this.ctx.get(Ft),o=this.ctx.get(nr),s;try{s=await n.getToken()}catch(h){P9.exception(this.ctx,h,".proxyToCapiResponses/getToken"),r.writeHead(401,{"Content-Type":"application/json"}),r.end(JSON.stringify({error:{message:"Failed to acquire Copilot token"}}));return}let c=fle(this.ctx,s,"v1/responses"),l={...Vh(this.ctx),"Content-Type":"application/json"},{headers:u}=await dle(this.ctx,l,s.token),d=new AbortController,f=a(()=>{d.signal.aborted||d.abort()},"onClose");r.on("close",f);try{let h=await o.fetch(c,{method:"POST",headers:u,body:e,signal:d.signal});ple(this.ctx,h,"v1/responses");let m=h.headers.get("content-type")||"application/json";r.writeHead(h.status,{"Content-Type":m});let g=h.body();if(!g){r.end();return}let A=m.toLowerCase().includes("text/event-stream"),y=this.stateService.getActiveThread();if(A&&y){let E=ANe(_=>{this.stateService.addCopilotUsageNanoAiuForThread(y,_)});await(0,NLr.pipeline)(g,E,r)}else await(0,NLr.pipeline)(g,r)}catch(h){if(d.signal.aborted){P9.debug(this.ctx,"upstream fetch aborted by client disconnect"),r.writableEnded||r.end();return}if(P9.exception(this.ctx,h,".proxyToCapiResponses"),r.headersSent||r.writableEnded){r.destroy();return}r.writeHead(500,{"Content-Type":"application/json"}),r.end(JSON.stringify({error:{message:"Upstream request failed"}}))}finally{r.removeListener("close",f)}}readBody(e){return new Promise((r,n)=>{let o=[],s=0;e.on("data",c=>{if(s+=c.length,s>XPc){n(new Error("Request body exceeds maximum allowed size")),e.destroy();return}o.push(c)}),e.on("end",()=>r(Buffer.concat(o).toString("utf8"))),e.on("error",n)})}};p();var MLr=require("node:fs"),Wji=fe(require("node:os")),tSt=fe(require("node:path"));Mo();function e2c(){let t=process.env.CODEX_HOME;return t||tSt.join(Wji.homedir(),".codex")}a(e2c,"codexHome");async function zji(t){let e=tSt.join(e2c(),"sessions");try{return await Yji(e,t)}catch{return null}}a(zji,"findRolloutFile");async function Yji(t,e){let r;try{r=await MLr.promises.readdir(t,{withFileTypes:!0})}catch{return null}for(let n of r){let o=tSt.join(t,n.name);if(n.isDirectory()){let s=await Yji(o,e);if(s)return s}else if(n.isFile()&&n.name.endsWith(".jsonl")&&n.name.includes(e))return o}return null}a(Yji,"searchForRollout");async function Kji(t){let e;try{e=await MLr.promises.readFile(t,"utf8")}catch{return null}let r=e.split(` +`).filter(c=>c.trim().length>0),n=[];for(let c of r)try{n.push(JSON.parse(c))}catch{}let o=[],s={sessionStarted:!1,currentTurnId:void 0,eventMsgCompletionCallIds:t2c(n),sealedCallIds:new Set};for(let c of n){let l=r2c(c,s);l&&(Array.isArray(l)?o.push(...l):o.push(l))}return o}a(Kji,"readAndTranslateRollout");function t2c(t){let e=new Set;for(let r of t){if(r.type!=="event_msg")continue;let n=r.payload.type;if(n!=="patch_apply_end"&&n!=="web_search_end")continue;let o=r.payload.call_id;typeof o=="string"&&o.length>0&&e.add(o)}return e}a(t2c,"collectEventMsgCompletionCallIds");function r2c(t,e){switch(t.type){case"event_msg":return n2c(t.timestamp,t.payload,e);case"response_item":return i2c(t.timestamp,t.payload,e);case"turn_context":return null;default:return null}}a(r2c,"translateRolloutLine");function n2c(t,e,r){switch(e.type){case"task_started":return r.currentTurnId=e.turn_id||void 0,r.sessionStarted?null:(r.sessionStarted=!0,{id:Nt(),timestamp:t,type:"session.start",data:{producer:"codex",startTime:t}});case"user_message":{let o=e.message||"",{content:s,attachments:c}=p2c(o),l={content:s};return c.length>0&&(l.attachments=c),{id:Nt(),timestamp:t,type:"user.message",data:l}}case"agent_message":{let o=e.message||"",s=Nt(),c=r.currentTurnId||s;return[{id:Nt(),timestamp:t,type:"assistant.turn_start",data:{turnId:s,interactionId:c}},{id:s,timestamp:t,type:"assistant.message",data:{content:o,messageId:s}}]}case"token_count":{let s=e.info?.last_token_usage;return s?{id:Nt(),timestamp:t,type:"assistant.usage",data:{inputTokens:s.input_tokens,outputTokens:s.output_tokens,cacheReadTokens:s.cached_input_tokens}}:null}case"task_complete":return r.currentTurnId=void 0,{id:Nt(),timestamp:t,type:"session.idle"};case"patch_apply_end":{let o=e.call_id||"";if(!o||r.sealedCallIds.has(o))return null;r.sealedCallIds.add(o);let s=e.success===!0,c=e.changes,l=typeof e.stderr=="string"?e.stderr:"",u=typeof e.status=="string"?e.status:"failed";return{id:Nt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:o,success:s,result:s?{changes:c}:void 0,error:s?void 0:{message:l||`Patch apply ${u}`}}}}case"web_search_end":{let o=e.call_id||"";return!o||r.sealedCallIds.has(o)?null:(r.sealedCallIds.add(o),[{id:Nt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:o,toolName:"web_search",arguments:{query:e.query,action:e.action}}},{id:Nt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:o,success:!0}}])}default:return null}}a(n2c,"translateEventMsg");function i2c(t,e,r){switch(e.type){case"message":return null;case"reasoning":return o2c(t,e);case"function_call":return a2c(t,e,r);case"function_call_output":return c2c(t,e,r);case"custom_tool_call":return l2c(t,e,r);case"custom_tool_call_output":return u2c(t,e,r);case"web_search_call":return null;default:return null}}a(i2c,"translateResponseItem");function o2c(t,e){let r=s2c(e);if(!r)return null;let n=e.id||Nt();return{id:Nt(),timestamp:t,type:"assistant.reasoning",data:{reasoningId:n,content:r}}}a(o2c,"translateReasoningItem");function s2c(t){let e=[];for(let r of["summary","content"]){let n=t[r];if(Array.isArray(n)){for(let o of n)if(typeof o=="string")o.length>0&&e.push(o);else if(o&&typeof o=="object"){let s=o.text;typeof s=="string"&&s.length>0&&e.push(s)}}}return e.join(` +`).trim()}a(s2c,"extractReasoningText");function a2c(t,e,r){let n=e.call_id||e.id||"";if(!n)return null;let o=e.name||"unknown",s=o==="shell_command"?"shell":o,c=d2c(e.arguments);return{id:Nt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:n,toolName:s,arguments:c??{}}}}a(a2c,"translateFunctionCall");function c2c(t,e,r){let n=e.call_id||"";if(!n||r.sealedCallIds.has(n))return null;r.sealedCallIds.add(n);let o=typeof e.output=="string"?e.output:"";return{id:Nt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:n,success:!0,result:{content:o}}}}a(c2c,"translateFunctionCallOutput");function l2c(t,e,r){let n=e.call_id||e.id||"";if(!n)return null;let s=e.name||"unknown";return{id:Nt(),timestamp:t,type:"tool.execution_start",data:{toolCallId:n,toolName:s,arguments:{input:e.input}}}}a(l2c,"translateCustomToolCall");function u2c(t,e,r){let n=e.call_id||"";if(!n||r.eventMsgCompletionCallIds.has(n)||r.sealedCallIds.has(n))return null;r.sealedCallIds.add(n);let o=typeof e.output=="string"?e.output:"";return{id:Nt(),timestamp:t,type:"tool.execution_complete",data:{toolCallId:n,success:!0,result:{content:o}}}}a(u2c,"translateCustomToolCallOutput");function d2c(t){if(typeof t!="string")return null;try{let e=JSON.parse(t);return e&&typeof e=="object"&&!Array.isArray(e)?e:null}catch{return null}}a(d2c,"parseJsonSafe");var f2c=/^\[Referenced files:([^\]]*)\]\r?\n\r?\n/;function p2c(t){let e=f2c.exec(t);if(!e)return{content:t,attachments:[]};let r=e[1].split(",").map(n=>n.trim()).filter(n=>n.length>0).map(n=>({type:"file",path:n,displayName:h2c(n)}));return{content:t.slice(e[0].length),attachments:r}}a(p2c,"extractReferencedFiles");function h2c(t){let e=t.replace(/\\/g,"/"),r=e.lastIndexOf("/");return r===-1?e:e.slice(r+1)}a(h2c,"basename");p();Mo();function Hm(t,e,r){return{id:Nt(),timestamp:new Date().toISOString(),type:t,...e!==void 0?{data:e}:{},...r?{ephemeral:r}:{}}}a(Hm,"envelope");function LEe(){return{turnStreamCtx:new Map,pendingUserInputs:new Map,pendingUserInputAggregates:new Map}}a(LEe,"createCodexTranslatorState");function LLr(t,e){return`${t}:${e}`}a(LLr,"composeUserInputRequestId");function BLr(t,e){let r=t.turnStreamCtx.get(e);return r||(r={agentMessageIds:[],reasoningIds:[],tokenUsageSum:{inputTokens:0,outputTokens:0,cachedInputTokens:0},tokenUsageObserved:!1},t.turnStreamCtx.set(e,r)),r}a(BLr,"ctxFor");function Jji(t,e,r,n,o){switch(t){case"turn/started":return m2c(e);case"turn/completed":return g2c(e,r,o);case"item/started":return A2c(e,r);case"item/completed":return y2c(e,r);case"thread/tokenUsage/updated":return E2c(e,r);case"item/agentMessage/delta":return v2c(e);case"item/reasoning/summaryTextDelta":return U2c(e,r);case"item/commandExecution/outputDelta":return I2c(e);case"item/tool/requestUserInput":return j2c(e,r,n);default:return null}}a(Jji,"translateCodexNotification");function m2c(t){return null}a(m2c,"translateTurnStarted");function g2c(t,e,r){let n=[],o=t.turn?.id,s=o?e.turnStreamCtx.get(o):void 0,c=s?.tokenUsageObserved?s.tokenUsageSum:void 0,l=r?.copilotUsageNanoAiu;return n.push(Hm("assistant.usage",{model:"codex",duration:t.turn?.durationMs??void 0,...c?{inputTokens:c.inputTokens,outputTokens:c.outputTokens,cacheReadTokens:c.cachedInputTokens}:{},...l!==void 0&&l>0?{copilotUsage:{totalNanoAiu:l}}:{}},!0)),n.push(Hm("session.idle",{},!0)),o&&e.turnStreamCtx.delete(o),n}a(g2c,"translateTurnCompleted");function A2c(t,e){let r=t.item;if(!r)return null;switch(r.type){case"agentMessage":return _2c(e,t.turnId,r);case"commandExecution":return S2c(r);case"fileChange":return x2c(r);case"mcpToolCall":return R2c(r);case"webSearch":return D2c(r);case"imageView":return M2c(r);case"dynamicToolCall":return L2c(r);case"reasoning":return F2c(e,t.turnId,r);default:return null}}a(A2c,"translateItemStarted");function y2c(t,e){let r=t.item;if(!r)return null;switch(r.type){case"agentMessage":return C2c(e,t.turnId,r);case"commandExecution":return T2c(r);case"fileChange":return w2c(r);case"mcpToolCall":return k2c(r);case"webSearch":return N2c(r);case"imageView":return O2c(r);case"dynamicToolCall":return B2c(r);case"reasoning":return Q2c(e,t.turnId,r);default:return null}}a(y2c,"translateItemCompleted");function E2c(t,e){let r=BLr(e,t.turnId),n=t.tokenUsage?.last;return n&&(typeof n.inputTokens=="number"&&Number.isFinite(n.inputTokens)&&(r.tokenUsageSum.inputTokens+=n.inputTokens),typeof n.outputTokens=="number"&&Number.isFinite(n.outputTokens)&&(r.tokenUsageSum.outputTokens+=n.outputTokens),typeof n.cachedInputTokens=="number"&&Number.isFinite(n.cachedInputTokens)&&(r.tokenUsageSum.cachedInputTokens+=n.cachedInputTokens),r.tokenUsageObserved=!0),null}a(E2c,"translateTokenUsageUpdated");function _2c(t,e,r){return BLr(t,e).agentMessageIds.push(r.id),Hm("assistant.turn_start",{turnId:r.id,interactionId:e})}a(_2c,"translateAgentMessageItemStarted");function v2c(t){return Hm("assistant.message_delta",{messageId:t.itemId||t.turnId,deltaContent:t.delta},!0)}a(v2c,"translateAgentMessageDelta");function C2c(t,e,r){let n=r.text??"";if(n.length===0)return null;let o=t.turnStreamCtx.get(e)?.agentMessageIds.shift()??r.id;return Hm("assistant.message",{messageId:o,content:n})}a(C2c,"translateAgentMessageItemCompleted");function BEe(t){return t==="failed"||t==="cancelled"||t==="declined"}a(BEe,"isFailedStatus");var OLr=4096;function b2c(t){return t.length<=OLr?t:`${t.slice(0,OLr)} +\u2026 [truncated ${t.length-OLr} chars]`}a(b2c,"truncateForError");function S2c(t){return Hm("tool.execution_start",{toolCallId:t.id,toolName:"shell",arguments:{command:t.command,cwd:t.cwd,commandActions:t.commandActions}})}a(S2c,"translateCommandExecutionItemStarted");function T2c(t){let e=!BEe(t.status),r=t.aggregatedOutput??"";return Hm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{content:r}:void 0,error:e?void 0:{message:r.length>0?b2c(r):`Command ${t.status??"failed"} with exit code ${t.exitCode??"unknown"}`},durationMs:t.durationMs??void 0,exitCode:t.exitCode??void 0})}a(T2c,"translateCommandExecutionItemCompleted");function I2c(t){return null}a(I2c,"translateCommandExecutionOutputDelta");function x2c(t){return t.changes.map(e=>Hm("tool.execution_start",{toolCallId:Zji(t.id,e),toolName:"file_change",arguments:{...e}}))}a(x2c,"translateFileChangeItemStarted");function w2c(t){let e=!BEe(t.status);return t.changes.map(r=>Hm("tool.execution_complete",{toolCallId:Zji(t.id,r),success:e,result:e?{...r}:void 0,error:e?void 0:{message:`File change ${t.status??"failed"}`},durationMs:t.durationMs??void 0}))}a(w2c,"translateFileChangeItemCompleted");function Zji(t,e){return`${t}:${e.kind}:${encodeURIComponent(e.path)}`}a(Zji,"fileChangeToolCallId");function R2c(t){return Hm("tool.execution_start",{toolCallId:t.id,toolName:`mcp:${t.server}.${t.tool}`,arguments:t.arguments??{}})}a(R2c,"translateMcpToolCallItemStarted");function k2c(t){let e=!BEe(t.status)&&!t.error;return Hm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?P2c(t.result):void 0,error:e?void 0:{message:t.error??`MCP tool ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(k2c,"translateMcpToolCallItemCompleted");function P2c(t){return t&&typeof t=="object"&&!Array.isArray(t)&&"content"in t?t:{content:t}}a(P2c,"wrapMcpResult");function D2c(t){return null}a(D2c,"translateWebSearchItemStarted");function N2c(t){let e=!BEe(t.status),r=t.query?.trim()?t.query:t.action?.query??t.action?.queries?.join(", "),n=t.results!==void 0&&t.results!==null;return[Hm("tool.execution_start",{toolCallId:t.id,toolName:"web_search",arguments:{query:r,action:t.action}}),Hm("tool.execution_complete",{toolCallId:t.id,success:e,result:e&&n?{content:t.results}:void 0,error:e?void 0:{message:`Web search ${t.status??"failed"}`},durationMs:t.durationMs??void 0})]}a(N2c,"translateWebSearchItemCompleted");function M2c(t){return Hm("tool.execution_start",{toolCallId:t.id,toolName:"view_image",arguments:{path:t.path}})}a(M2c,"translateImageViewItemStarted");function O2c(t){let e=!BEe(t.status);return Hm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{path:t.path}:void 0,error:e?void 0:{message:`Image view ${t.status??"failed"}`}})}a(O2c,"translateImageViewItemCompleted");function L2c(t){return Hm("tool.execution_start",{toolCallId:t.id,toolName:t.tool,arguments:t.arguments??{}})}a(L2c,"translateDynamicToolCallItemStarted");function B2c(t){let e=t.success!==void 0?t.success:!BEe(t.status)&&!t.error;return Hm("tool.execution_complete",{toolCallId:t.id,success:e,result:e?{content:t.contentItems}:void 0,error:e?void 0:{message:t.error??`Tool ${t.status??"failed"}`},durationMs:t.durationMs??void 0})}a(B2c,"translateDynamicToolCallItemCompleted");function F2c(t,e,r){return BLr(t,e).reasoningIds.push(r.id),null}a(F2c,"translateReasoningItemStarted");function U2c(t,e){let r=e.turnStreamCtx.get(t.turnId)?.reasoningIds,n=r&&r.length>0?r[r.length-1]:void 0;return Hm("assistant.reasoning_delta",{reasoningId:t.itemId||t.reasoningId||n||`codex-reasoning:${t.turnId}`,deltaContent:t.delta},!0)}a(U2c,"translateReasoningDelta");function Q2c(t,e,r){let n=t.turnStreamCtx.get(e)?.reasoningIds.shift()??r.id,o=q2c(r);return o?Hm("assistant.reasoning",{reasoningId:n,content:o}):null}a(Q2c,"translateReasoningItemCompleted");function q2c(t){let e=[];for(let r of[t.summary,t.content])if(Array.isArray(r))for(let n of r)typeof n=="string"?n.length>0&&e.push(n):n&&typeof n.text=="string"&&n.text.length>0&&e.push(n.text);return e.join(` +`).trim()}a(q2c,"extractReasoningText");function j2c(t,e,r){if(!t?.itemId||!t.threadId||r===void 0)return null;let n=t.questions??[];if(n.length===0)return null;let o=t.autoResolutionMs??void 0,s=new Set,c=[];for(let l of n){if(typeof l?.id!="string"||l.id.length===0||s.has(l.id)||typeof l.question!="string"||l.question.length===0)continue;let u=LLr(t.itemId,l.id);e.pendingUserInputs.set(u,{itemId:t.itemId,questionId:l.id}),s.add(l.id);let d=l.options&&l.options.length>0?l.options.map(f=>f.label):void 0;c.push(Hm("user_input.requested",{requestId:u,question:l.header?`${l.header} +${l.question}`:l.question,...d!==void 0?{choices:d}:{},allowFreeform:!0,...o!==void 0?{autoResolutionMs:o}:{}}))}return c.length===0?null:(e.pendingUserInputAggregates.set(t.itemId,{requestJsonRpcId:r,expectedQuestionIds:s,answers:new Map}),c)}a(j2c,"translateRequestUserInput");Mo();var Fu=new pe("CodexAgentService"),Aie=class{constructor(e){this.ctx=e;this.initialized=!1;this.sessions=new Map;this.stateService=new OEe,this.proxyServer=new eSt(e,this.stateService),this.notificationSender=e.get(es),this.codexPath=this.resolveCodexPath()}static{a(this,"CodexAgentService")}resolveCodexPath(){let e=Rt(this.ctx,ze.CodexCliPath);if(e)return e;let r=process.env.CODEX_CLI_PATH;return r||(process.platform==="win32"?"codex.exe":"codex")}async ensureRunning(){if(this.processManager?.isRunning())return;if(this.codexPath=this.resolveCodexPath(),this.initialized=!1,!this.workspaceCwd)try{let r=this.ctx.get($r).getWorkspaceFolders();if(r.length>0){let n=new URL(r[0].uri);this.workspaceCwd=n.pathname.replace(/^\/([A-Za-z]:)/,"$1")}}catch{}let e=await this.proxyServer.start();this.processManager=new X1t(this.ctx,this.codexPath,e,this.workspaceCwd),this.processManager.onNotification((r,n)=>{this.handleNotification(r,n)}),this.processManager.onServerRequest("item/tool/requestUserInput",(r,n)=>{this.handleNotification("item/tool/requestUserInput",r,n)}),this.processManager.on("error",r=>{Fu.error(this.ctx,"Codex process died",{error:r.message}),this.emitErrorToAllSessions(r.message)}),this.processManager.start(),await new Promise(r=>setTimeout(r,1e3))}async ensureInitialized(){if(await this.ensureRunning(),!this.initialized)try{await this.processManager.sendRequest("initialize",{clientInfo:{name:"copilot-jetbrains",title:"GitHub Copilot for JetBrains",version:"1.0.0"},capabilities:{experimentalApi:!0}}),this.processManager.sendNotification("initialized",{}),this.initialized=!0,await new Promise(e=>setTimeout(e,300))}catch(e){let r=e instanceof Error?e.message:String(e);throw new Error(`Failed to initialize Codex process: ${r}`)}}async createSession(e){return kb(this.ctx,"codexAgent.createSession",async r=>{if(Fu.info(this.ctx,"createSession",{clientSessionId:e.sessionId,model:e.model}),!this.workspaceCwd&&e.workspaceFolder?.uri)try{let c=new URL(e.workspaceFolder.uri);this.workspaceCwd=c.pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{this.workspaceCwd=e.workspaceFolder.uri}await this.ensureInitialized();let n=await this.processManager.sendRequest("thread/start"),o=n.thread.id,s=new Date().toISOString();return this.sessions.set(o,{sessionId:o,threadId:n.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,reasoningEffort:e.reasoningEffort,startTime:s,modifiedTime:s,translatorState:LEe()}),r.properties.sessionId=o,r.properties.modelId=e.model??"",{sessionId:o,workspacePath:e.workspaceFolder?.uri}})}async resumeSession(e){return kb(this.ctx,"codexAgent.resumeSession",async r=>{let n=e.sessionId;Fu.info(this.ctx,"resumeSession",{threadId:n}),r.properties.sessionId=n;let o=this.sessions.get(n);if(o){r.properties.reason="inMemory";let c=await this.loadHistoricalEvents(n,r,e.model??o.model);return r.measurements.eventCount=c?.length??0,{sessionId:n,workspacePath:o.workspacePath,events:c}}if(!this.workspaceCwd&&e.workspaceFolder?.uri)try{let c=new URL(e.workspaceFolder.uri);this.workspaceCwd=c.pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{this.workspaceCwd=e.workspaceFolder.uri}await this.ensureInitialized();try{let c=await this.processManager.sendRequest("thread/resume",{threadId:n}),l=new Date().toISOString();this.sessions.set(n,{sessionId:n,threadId:c.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,reasoningEffort:e.reasoningEffort,startTime:l,modifiedTime:l,summary:"(resumed)",translatorState:LEe()})}catch(c){let l=c instanceof Error?c.message:String(c);Fu.warn(this.ctx,"resumeSession: thread/resume failed, creating fresh thread",{threadId:n,error:l});let u=await this.processManager.sendRequest("thread/start",{}),d=new Date().toISOString();this.sessions.set(n,{sessionId:n,threadId:u.thread.id,workspacePath:e.workspaceFolder?.uri,model:e.model,reasoningEffort:e.reasoningEffort,startTime:d,modifiedTime:d,summary:"(resumed - fresh)",translatorState:LEe()}),r.properties.freshThread="true"}let s=await this.loadHistoricalEvents(n,r,e.model);return r.measurements.eventCount=s?.length??0,{sessionId:n,workspacePath:e.workspaceFolder?.uri,events:s}})}async loadHistoricalEvents(e,r,n){try{let o=await zji(e);if(!o){r.properties.rolloutMissing="true",Fu.debug(this.ctx,"loadHistoricalEvents: rollout file not found",{threadId:e});return}let s=await Kji(o);if(!s){r.properties.rolloutReadFailed="true",Fu.warn(this.ctx,"loadHistoricalEvents: rollout translation returned null",{threadId:e,rolloutPath:o});return}if(n)for(let c of s)c.type==="assistant.usage"&&c.data&&(c.data.model=n);return s}catch(o){let s=o instanceof Error?o.message:String(o);r.properties.rolloutReadFailed="true",Fu.warn(this.ctx,"loadHistoricalEvents: error reading rollout",{threadId:e,error:s});return}}async sendMessage(e,r){return kb(this.ctx,"codexAgent.sendMessage",async n=>{Fu.info(this.ctx,"sendMessage",{sessionId:e.sessionId}),n.properties.sessionId=e.sessionId,n.properties.modelId=e.model??"",await this.ensureInitialized();let o=this.sessions.get(e.sessionId);if(!o){Fu.info(this.ctx,"sendMessage: session not in memory, auto-recovering");try{let d=await this.processManager.sendRequest("thread/resume",{threadId:e.sessionId}),f=new Date().toISOString();o={sessionId:e.sessionId,threadId:d.thread.id,workspacePath:this.workspaceCwd,model:e.model,reasoningEffort:e.reasoningEffort,startTime:f,modifiedTime:f,translatorState:LEe()},this.sessions.set(e.sessionId,o)}catch(d){Fu.warn(this.ctx,"sendMessage: thread/resume failed, creating fresh thread",{error:String(d)});let f=await this.processManager.sendRequest("thread/start",{}),h=new Date().toISOString();o={sessionId:e.sessionId,threadId:f.thread.id,workspacePath:this.workspaceCwd,model:e.model,reasoningEffort:e.reasoningEffort,startTime:h,modifiedTime:h,translatorState:LEe()},this.sessions.set(e.sessionId,o)}}let s=[];if(e.references?.length){let d=e.references.filter(f=>f.type==="file").map(f=>{try{return new URL(f.uri).pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{return f.uri}});d.length>0&&s.push({type:"text",text:`[Referenced files: ${d.join(", ")}] + +`})}s.push({type:"text",text:e.message});let c=e.model||o.model,l=e.reasoningEffort??o.reasoningEffort;this.stateService.setActiveThread(o.threadId);let u=await this.processManager.sendRequest("turn/start",{...c?{model:c}:{},...l?{effort:l}:{},threadId:o.threadId,input:s});return o.turnId=u.turnId,e.model&&(o.model=e.model),e.reasoningEffort&&(o.reasoningEffort=e.reasoningEffort),o.modifiedTime=new Date().toISOString(),o.summary||(o.summary=e.message.slice(0,100)),n.measurements.messageCharLen=e.message.length,{messageId:u.turnId}})}truncateHistory(e){return Promise.reject(new Error("truncateHistory is not supported for Codex sessions"))}forkSession(e){return Promise.reject(new Error("forkSession is not supported for Codex sessions"))}async stopSession(e){let r=this.sessions.get(e);r&&(this.drainAndCloseUserInputs(r,!0),r.turnId&&(await this.processManager?.sendRequest("turn/interrupt",{threadId:r.threadId,turnId:r.turnId}),Fu.info(this.ctx,"CodexAgentService.stopSession",{sessionId:e})))}destroySession(e){let r=this.sessions.get(e.sessionId);return r&&(this.drainAndCloseUserInputs(r,!0),this.stateService.clear(r.threadId)),this.sessions.delete(e.sessionId),Fu.info(this.ctx,"CodexAgentService.destroySession",{sessionId:e.sessionId}),Promise.resolve({success:!0})}listSessions(e){let r=Array.from(this.sessions.values()).map(n=>{let o;if(n.workspacePath)try{o=new URL(n.workspacePath).pathname.replace(/^\/([A-Za-z]:)/,"$1")}catch{o=n.workspacePath}return{sessionId:n.sessionId,startTime:n.startTime,modifiedTime:n.modifiedTime,summary:n.summary,isRemote:!1,context:o?{cwd:o}:void 0}});return r.sort((n,o)=>o.modifiedTime.localeCompare(n.modifiedTime)),Fu.info(this.ctx,`CodexAgentService.listSessions: ${r.length} sessions`),Promise.resolve({sessions:r})}async listModels(e){try{let o=(await this.ctx.get(xs).getMetadata(e)).filter(s=>s.supported_endpoints?.includes(X$e.Responses)&&s.model_picker_enabled&&s.capabilities.type==="chat");if(o.length>0){let s=o.map(tfe);return s.forEach(H2c),Fu.info(this.ctx,`CodexAgentService.listModels: ${s.length} responses-capable models from CAPI`),{models:s}}Fu.warn(this.ctx,"CodexAgentService.listModels: no responses-capable models found in CAPI")}catch(r){let n=r instanceof Error?r.message:String(r);Fu.warn(this.ctx,`CodexAgentService.listModels: CAPI query failed: ${n}, using fallback`)}return{models:[{id:"codex-default",name:"Codex (Default)",preview:!1,capabilities:{family:"codex",supports:{vision:!1},limits:{max_context_window_tokens:128e3}}}]}}handleInteraction(e){Fu.info(this.ctx,"handleInteraction",{sessionId:e.sessionId,requestId:e.requestId,type:e.type});let r=this.sessions.get(e.sessionId);return r?e.type==="user_input"?this.handleUserInputInteraction(r,e):(Fu.warn(this.ctx,"handleInteraction: unsupported type for Codex",{sessionId:e.sessionId,type:e.type}),Promise.resolve({success:!1})):(Fu.warn(this.ctx,"handleInteraction: unknown session",{sessionId:e.sessionId}),Promise.resolve({success:!1}))}handleUserInputInteraction(e,r){let n=e.translatorState,o=n.pendingUserInputs.get(r.requestId);if(!o)return Fu.warn(this.ctx,"handleInteraction: user_input for unknown requestId",{sessionId:r.sessionId,requestId:r.requestId}),Promise.resolve({success:!1});n.pendingUserInputs.delete(r.requestId),this.emitUserInputCompleted(e.sessionId,r.requestId,r.response);let s=n.pendingUserInputAggregates.get(o.itemId);if(!s)return Fu.warn(this.ctx,"handleInteraction: user_input aggregate missing",{sessionId:r.sessionId,requestId:r.requestId,itemId:o.itemId}),Promise.resolve({success:!1});if(s.answers.set(o.questionId,{answer:r.response.answer,wasFreeform:r.response.wasFreeform}),s.answers.size0?t.billing.token_prices=n:(delete t.billing.token_prices,Object.keys(t.billing).length===0&&delete t.billing)}a(H2c,"stripLongContextPricing");var Xji=new pe("AgentRouter"),eHi="AgentRouter";function bI(t){return t.agentProvider??"BACKGROUND"}a(bI,"resolveProvider");var Ua=class{constructor(e){this.ctx=e}static{a(this,"AgentRouter")}serviceFor(e){switch(e){case"BACKGROUND":return this.ctx.get(Gs);case"CLAUDE":return this.ctx.get(w8);case"CODEX":return this.ctx.get(Aie);case"CLOUD":return this.ctx.get(gie)}}logDispatch(e,r){Xji.debug(this.ctx,`${eHi}.${e}`,r)}create(e){this.logDispatch("create",e);let r=bI(e);return this.serviceFor(r).createSession(e)}resume(e){this.logDispatch("resume",e);let r=bI(e);return this.serviceFor(r).resumeSession(e)}send(e,r){this.logDispatch("send",e);let n=bI(e);return this.serviceFor(n).sendMessage(e,r)}truncateHistory(e){this.logDispatch("truncateHistory",e);let r=e.providerName;return this.serviceFor(r).truncateHistory({sessionId:e.sessionId,eventId:e.eventId,providerName:e.providerName})}forkSession(e){this.logDispatch("forkSession",e);let r=e.providerName;return this.serviceFor(r).forkSession(e)}stop(e){this.logDispatch("stop",e);let r=bI(e);return this.serviceFor(r).stopSession(e.sessionId)}destroy(e){this.logDispatch("destroy",e);let r=bI(e);return this.serviceFor(r).destroySession(e)}listSessions(e){this.logDispatch("listSessions",e);let r=bI(e);return this.serviceFor(r).listSessions(e)}listModels(e){this.logDispatch("listModels",e);let r=bI(e);return this.serviceFor(r).listModels(e.forceRefresh)}interaction(e){this.logDispatch("interaction",e);let r=bI(e);return this.serviceFor(r).handleInteraction(e)}async getPlanPath(e){this.logDispatch("getPlanPath",e);let r=bI(e);return{path:await this.serviceFor(r).getPlanPath(e.sessionId)}}enableRemote(e){this.logDispatch("enableRemote",e);let r=bI(e);return this.serviceFor(r).enableRemote(e.sessionId)}async disableRemote(e){this.logDispatch("disableRemote",e);let r=bI(e);return await this.serviceFor(r).disableRemote(e.sessionId),{success:!0}}getRemoteStatus(e){this.logDispatch("getRemoteStatus",e);let r=bI(e);try{return Promise.resolve(this.serviceFor(r).getRemoteStatus(e.sessionId))}catch(n){return Promise.reject(n instanceof Error?n:new Error(String(n)))}}async compactHistory(e,r){this.logDispatch("compactHistory",e);let n=bI(e),o=this.serviceFor(n),s=r?.onCancellationRequested(()=>{Xji.info(this.ctx,`${eHi}.compactHistory: cancellation requested, aborting compaction`,{sessionId:e.sessionId}),o.stopCompactHistory(e.sessionId)});try{return await o.compactHistory(e.sessionId)}finally{s?.dispose()}}};p();p();var G2c=S.Union([S.String(),S.Number()]),_i=S.String(),FEe=S.Optional(S.String()),$2c=S.Object({name:S.String(),description:S.String(),title:S.Optional(S.String()),parameters:S.Optional(S.Record(S.String(),S.Unknown())),overridesBuiltInTool:S.Optional(S.Boolean()),skipPermission:S.Optional(S.Boolean())}),FLr=S.Array($2c),D3e=S.Union([S.Literal("default"),S.Literal("long_context")]),UEe=S.Object({model:S.Optional(S.String()),reasoningEffort:FEe,workspaceFolder:S.Object({uri:S.String(),name:S.Optional(S.String())}),globalAgentsMdInstructions:S.Optional(S.String()),globalClaudeMdInstructions:S.Optional(S.String()),externalToolDefinitions:S.Optional(FLr),useAgentsMdFile:S.Optional(S.Boolean()),useNestedAgentsMdFiles:S.Optional(S.Boolean()),useClaudeMdFile:S.Optional(S.Boolean()),useNestedClaudeMdFiles:S.Optional(S.Boolean()),inlineConfinedFile:S.Optional(S.String()),mcpDirectory:S.Optional(S.String())});async function di(t){try{return[await t(),null]}catch(e){let r=snt(e),n=e instanceof YJ?e.data:void 0;return[null,{code:Xe.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(di,"withServiceErrorHandling");var tHi=new pe("BackgroundAgent.compactHistory"),V2c=S.Object({sessionId:_i});async function ULr(t,e,r){tHi.info(t,"handleBackgroundAgentCompactHistory called",{sessionId:r.sessionId});let n=t.get(Gs),o=e.onCancellationRequested(()=>{tHi.info(t,"handleBackgroundAgentCompactHistory: cancellation requested, aborting compaction",{sessionId:r.sessionId}),n.stopCompactHistory(r.sessionId)});try{return await di(async()=>n.compactHistory(r.sessionId))}finally{o.dispose()}}a(ULr,"handleBackgroundAgentCompactHistoryChecked");var boh=xe(V2c,ULr);p();var N3e=S.Union(Object.values(_p).map(t=>S.Literal(t))),Fl=S.Optional(N3e),rSt=S.Intersect([UEe,S.Object({agentProvider:Fl})]);var rHi=new pe("BackgroundAgent.compactHistory"),W2c=S.Object({sessionId:_i,agentProvider:Fl});async function z2c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return ULr(t,e,r);rHi.info(t,"handleAgentCompactHistory called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Ua),s=r;return di(async()=>{let c=await o.compactHistory(s,e);return rHi.info(t,"compactHistory succeeded"),c})}a(z2c,"handleAgentCompactHistoryChecked");var nHi=xe(W2c,z2c);p();p();var iHi=new pe("BackgroundAgent.create"),Y2c=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),UEe]);async function QLr(t,e,r){iHi.info(t,"handleBackgroundAgentCreate called",{model:r.model,workspaceFolder:r.workspaceFolder});let n=t.get(Gs),o={sessionId:r.sessionId,model:r.model,reasoningEffort:r.reasoningEffort,workspaceFolder:r.workspaceFolder,globalAgentsMdInstructions:r.globalAgentsMdInstructions,globalClaudeMdInstructions:r.globalClaudeMdInstructions,externalToolDefinitions:r.externalToolDefinitions,useAgentsMdFile:r.useAgentsMdFile,useNestedAgentsMdFiles:r.useNestedAgentsMdFiles,useClaudeMdFile:r.useClaudeMdFile,useNestedClaudeMdFiles:r.useNestedClaudeMdFiles,inlineConfinedFile:r.inlineConfinedFile,mcpDirectory:r.mcpDirectory};return di(async()=>{let s=await n.createSession(o);return iHi.info(t,"createSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath}})}a(QLr,"handleBackgroundAgentCreateChecked");var Joh=xe(Y2c,QLr);var oHi=new pe("BackgroundAgent.create"),K2c=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),rSt]);async function J2c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return QLr(t,e,r);oHi.info(t,"handleAgentCreate called",{agentProvider:r.agentProvider,model:r.model,workspaceFolder:r.workspaceFolder});let o=t.get(Ua),s=r;return di(async()=>{let c=await o.create(s);return oHi.info(t,"create succeeded:",c.sessionId),c})}a(J2c,"handleAgentCreateChecked");var sHi=xe(K2c,J2c);p();p();var Z2c=S.Object({sessionId:_i});async function qLr(t,e,r){let n=t.get(Gs);return di(async()=>({success:(await n.destroySession({sessionId:r.sessionId})).success}))}a(qLr,"handleBackgroundAgentDestroyChecked");var Ash=xe(Z2c,qLr);var X2c=new pe("BackgroundAgent.destroy"),eDc=S.Object({sessionId:_i,agentProvider:Fl});async function tDc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return qLr(t,e,r);X2c.info(t,"handleAgentDestroy called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Ua),s=r;return di(async()=>o.destroy(s))}a(tDc,"handleAgentDestroyChecked");var aHi=xe(eDc,tDc);p();p();var rDc=new pe("BackgroundAgent.disableRemote"),nDc=S.Object({sessionId:_i});async function jLr(t,e,r){rDc.info(t,"handleBackgroundAgentDisableRemote called",{sessionId:r.sessionId});let n=t.get(Gs);return di(async()=>(await n.disableRemote(r.sessionId),{success:!0}))}a(jLr,"handleBackgroundAgentDisableRemoteChecked");var Fsh=xe(nDc,jLr);var cHi=new pe("BackgroundAgent.disableRemote"),iDc=S.Object({sessionId:_i,agentProvider:Fl});async function oDc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return jLr(t,e,r);cHi.info(t,"handleAgentDisableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Ua),s=r;return di(async()=>{let c=await o.disableRemote(s);return cHi.info(t,"disableRemote succeeded"),c})}a(oDc,"handleAgentDisableRemoteChecked");var lHi=xe(iDc,oDc);p();p();var sDc=new pe("BackgroundAgent.enableRemote"),aDc=S.Object({sessionId:_i});async function HLr(t,e,r){sDc.info(t,"handleBackgroundAgentEnableRemote called",{sessionId:r.sessionId});let n=t.get(Gs);return di(async()=>n.enableRemote(r.sessionId))}a(HLr,"handleBackgroundAgentEnableRemoteChecked");var oah=xe(aDc,HLr);var uHi=new pe("BackgroundAgent.enableRemote"),cDc=S.Object({sessionId:_i,agentProvider:Fl});async function lDc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return HLr(t,e,r);uHi.info(t,"handleAgentEnableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Ua),s=r;return di(async()=>{let c=await o.enableRemote(s);return uHi.info(t,"enableRemote succeeded"),c})}a(lDc,"handleAgentEnableRemoteChecked");var dHi=xe(cDc,lDc);p();var uDc=S.Object({sessionId:_i,toEventId:S.Optional(S.String()),name:S.Optional(S.String()),agentProvider:N3e});async function dDc(t,e,r){let n=t.get(Ua);return di(async()=>n.forkSession({sessionId:r.sessionId,toEventId:r.toEventId,name:r.name,providerName:r.agentProvider}))}a(dDc,"handleAgentForkChecked");var fHi=xe(uDc,dDc);p();p();var fDc=S.Object({sessionId:_i});async function GLr(t,e,r){let n=t.get(Gs);return di(async()=>({path:await n.getPlanPath(r.sessionId)}))}a(GLr,"handleBackgroundAgentGetPlanPathChecked");var Nah=xe(fDc,GLr);var pDc=new pe("BackgroundAgent.getPlanPath"),hDc=S.Object({sessionId:_i,agentProvider:Fl});async function mDc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return GLr(t,e,r);pDc.info(t,"handleAgentGetPlanPath called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Ua),s=r;return di(async()=>o.getPlanPath(s))}a(mDc,"handleAgentGetPlanPathChecked");var pHi=xe(hDc,mDc);p();p();var gDc=new pe("BackgroundAgent.getRemoteStatus"),ADc=S.Object({sessionId:_i});async function $Lr(t,e,r){gDc.info(t,"handleBackgroundAgentGetRemoteStatus called",{sessionId:r.sessionId});let n=t.get(Gs);return di(()=>Promise.resolve(n.getRemoteStatus(r.sessionId)))}a($Lr,"handleBackgroundAgentGetRemoteStatusChecked");var ech=xe(ADc,$Lr);var yDc=new pe("BackgroundAgent.getRemoteStatus"),EDc=S.Object({sessionId:_i,agentProvider:Fl});async function _Dc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return $Lr(t,e,r);yDc.info(t,"handleAgentGetRemoteStatus called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Ua),s=r;return di(async()=>o.getRemoteStatus(s))}a(_Dc,"handleAgentGetRemoteStatusChecked");var hHi=xe(EDc,_Dc);p();p();var vDc=new pe("BackgroundAgent.interaction"),CDc=S.Union([S.Object({kind:S.Literal("approve-once")}),S.Object({kind:S.Literal("denied-by-rules"),rules:S.Array(S.Unknown())}),S.Object({kind:S.Literal("denied-no-approval-rule-and-could-not-request-from-user")}),S.Object({kind:S.Literal("denied-interactively-by-user"),feedback:S.Optional(S.String())}),S.Object({kind:S.Literal("denied-by-content-exclusion-policy"),path:S.String(),message:S.String()})]),bDc=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),SDc=S.Object({action:S.Union([S.Literal("accept"),S.Literal("decline"),S.Literal("cancel")]),content:S.Optional(S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean(),S.Array(S.String())])))}),TDc=S.Object({approved:S.Boolean(),selectedAction:S.Optional(S.Union([S.Literal("exit_only"),S.Literal("interactive"),S.Literal("autopilot"),S.Literal("autopilot_fleet")])),autoApproveEdits:S.Optional(S.Boolean()),feedback:S.Optional(S.String())}),IDc=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),xDc=S.Union([S.String(),S.Object({textResultForLlm:S.String(),binaryResultsForLlm:S.Optional(S.Array(S.Object({data:S.String(),mimeType:S.String(),type:S.Union([S.Literal("resource"),S.Literal("image")]),description:S.Optional(S.String())}))),resultType:S.Union([S.Literal("success"),S.Literal("failure"),S.Literal("rejected"),S.Literal("denied")]),error:S.Optional(S.String())})]),wDc=S.Union([S.Object({sessionId:_i,requestId:S.String(),type:S.Literal("permission"),result:CDc}),S.Object({sessionId:_i,requestId:S.String(),type:S.Literal("user_input"),response:bDc}),S.Object({sessionId:_i,requestId:S.String(),type:S.Literal("elicitation"),response:SDc}),S.Object({sessionId:_i,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:TDc}),S.Object({sessionId:_i,requestId:S.String(),type:S.Literal("queued_command"),result:IDc}),S.Object({sessionId:_i,requestId:S.String(),type:S.Literal("external_tool"),result:xDc})]);async function VLr(t,e,r){vDc.info(t,"handleBackgroundAgentInteraction called",{sessionId:r.sessionId,type:r.type,requestId:r.requestId});let n=t.get(Gs);return di(async()=>await n.handleInteraction(r))}a(VLr,"handleBackgroundAgentInteractionChecked");var vch=xe(wDc,VLr);var mHi=new pe("BackgroundAgent.interaction"),RDc=S.Union([S.Object({kind:S.Literal("approve-once")}),S.Object({kind:S.Literal("denied-by-rules"),rules:S.Array(S.Unknown())}),S.Object({kind:S.Literal("denied-no-approval-rule-and-could-not-request-from-user")}),S.Object({kind:S.Literal("denied-interactively-by-user"),feedback:S.Optional(S.String())}),S.Object({kind:S.Literal("denied-by-content-exclusion-policy"),path:S.String(),message:S.String()})]),kDc=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),PDc=S.Object({action:S.Union([S.Literal("accept"),S.Literal("decline"),S.Literal("cancel")]),content:S.Optional(S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean(),S.Array(S.String())])))}),DDc=S.Object({approved:S.Boolean(),selectedAction:S.Optional(S.Union([S.Literal("exit_only"),S.Literal("interactive"),S.Literal("autopilot"),S.Literal("autopilot_fleet")])),autoApproveEdits:S.Optional(S.Boolean()),feedback:S.Optional(S.String())}),NDc=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),MDc=S.Union([S.String(),S.Object({textResultForLlm:S.String(),binaryResultsForLlm:S.Optional(S.Array(S.Object({data:S.String(),mimeType:S.String(),type:S.Union([S.Literal("resource"),S.Literal("image")]),description:S.Optional(S.String())}))),resultType:S.Union([S.Literal("success"),S.Literal("failure"),S.Literal("rejected"),S.Literal("denied")]),error:S.Optional(S.String())})]),ODc=S.Union([S.Object({sessionId:_i,requestId:S.String(),type:S.Literal("permission"),result:RDc,agentProvider:Fl}),S.Object({sessionId:_i,requestId:S.String(),type:S.Literal("user_input"),response:kDc,agentProvider:Fl}),S.Object({sessionId:_i,requestId:S.String(),type:S.Literal("elicitation"),response:PDc,agentProvider:Fl}),S.Object({sessionId:_i,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:DDc,agentProvider:Fl}),S.Object({sessionId:_i,requestId:S.String(),type:S.Literal("queued_command"),result:NDc,agentProvider:Fl}),S.Object({sessionId:_i,requestId:S.String(),type:S.Literal("external_tool"),result:MDc,agentProvider:Fl})]);async function LDc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return VLr(t,e,r);mHi.info(t,"handleAgentInteraction called",{agentProvider:r.agentProvider,sessionId:r.sessionId,type:r.type,requestId:r.requestId});let o=t.get(Ua),s=r;return di(async()=>{let c=await o.interaction(s);return mHi.info(t,"interaction succeeded"),c})}a(LDc,"handleAgentInteractionChecked");var gHi=xe(ODc,LDc);p();p();var AHi=new pe("BackgroundAgent.listSessions"),BDc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String())});async function WLr(t,e,r){AHi.info(t,"handleBackgroundAgentSessionsList called",r);let n=t.get(Gs);return di(async()=>{let o=await n.listSessions(r);return AHi.info(t,"listSessions succeeded, returning",o.sessions.length,"sessions"),o})}a(WLr,"handleBackgroundAgentSessionsListChecked");var Hch=xe(BDc,WLr);var yHi=new pe("BackgroundAgent.listSessions"),FDc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String()),agentProvider:Fl});async function UDc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return WLr(t,e,r);yHi.info(t,"handleAgentSessionsList called",r);let o=t.get(Ua),s=r;return di(async()=>{let c=await o.listSessions(s);return yHi.info(t,"listSessions succeeded, returning",c.sessions.length,"sessions"),c})}a(UDc,"handleAgentSessionsListChecked");var EHi=xe(FDc,UDc);p();p();var _Hi=new pe("BackgroundAgent.listModels"),QDc=S.Object({forceRefresh:S.Optional(S.Boolean())});async function zLr(t,e,r){_Hi.info(t,"handleBackgroundAgentListModels called",{forceRefresh:r.forceRefresh});let n=t.get(Gs);return di(async()=>{let o=await n.listModels(r.forceRefresh);return _Hi.info(t,"listModels succeeded, returning",o.models.length,"models"),o})}a(zLr,"handleBackgroundAgentListModelsChecked");var dlh=xe(QDc,zLr);var vHi=new pe("BackgroundAgent.listModels"),qDc=S.Object({forceRefresh:S.Optional(S.Boolean()),agentProvider:Fl});async function jDc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return zLr(t,e,r);vHi.info(t,"handleAgentListModels called",{agentProvider:r.agentProvider,forceRefresh:r.forceRefresh});let o=t.get(Ua),s=r;return di(async()=>{let c=await o.listModels(s);return vHi.info(t,"listModels succeeded, returning",c.models.length,"models"),c})}a(jDc,"handleAgentListModelsChecked");var CHi=xe(qDc,jDc);p();p();var bHi=new pe("BackgroundAgent.resume"),HDc=S.Intersect([S.Object({sessionId:_i}),UEe]);async function YLr(t,e,r){bHi.info(t,"handleBackgroundAgentResume called",{sessionId:r.sessionId,model:r.model});let n=t.get(Gs),o={sessionId:r.sessionId,model:r.model,reasoningEffort:r.reasoningEffort,workspaceFolder:r.workspaceFolder,globalAgentsMdInstructions:r.globalAgentsMdInstructions,globalClaudeMdInstructions:r.globalClaudeMdInstructions,externalToolDefinitions:r.externalToolDefinitions,useAgentsMdFile:r.useAgentsMdFile,useNestedAgentsMdFiles:r.useNestedAgentsMdFiles,useClaudeMdFile:r.useClaudeMdFile,useNestedClaudeMdFiles:r.useNestedClaudeMdFiles,mcpDirectory:r.mcpDirectory};return di(async()=>{let s=await n.resumeSession(o);return bHi.info(t,"resumeSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath,events:s.events}})}a(YLr,"handleBackgroundAgentResumeChecked");var Dlh=xe(HDc,YLr);var SHi=new pe("BackgroundAgent.resume"),GDc=S.Intersect([S.Object({sessionId:_i}),rSt]);async function $Dc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return YLr(t,e,r);SHi.info(t,"handleAgentResume called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(Ua),s=r;return di(async()=>{let c=await o.resume(s);return SHi.info(t,"resume succeeded:",c.sessionId),c})}a($Dc,"handleAgentResumeChecked");var THi=xe(GDc,$Dc);p();p();var VDc=S.String(),nSt=["interactive","plan","autopilot"],WDc=S.Union(nSt.map(t=>S.Literal(t))),zDc=S.String({minLength:1}),YDc=S.Object({sessionId:_i,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(VDc),reasoningEffort:FEe,references:S.Optional(S.Array(qO)),agentMode:S.Optional(WDc),chatMode:S.Optional(zDc),contextTier:S.Optional(D3e),sendMode:S.Optional(S.Union([S.Literal("enqueue"),S.Literal("immediate")]))});async function KLr(t,e,r){let n=t.get(Gs),o={sessionId:r.sessionId,message:r.message,model:r.model,providerName:r.providerName,reasoningEffort:r.reasoningEffort,references:r.references,agentMode:r.agentMode,chatMode:r.chatMode,contextTier:r.contextTier,sendMode:r.sendMode};return di(async()=>({messageId:(await n.sendMessage(o,e)).messageId}))}a(KLr,"handleBackgroundAgentSendChecked");var euh=xe(YDc,KLr);var IHi=new pe("BackgroundAgent.send"),KDc=S.String(),JDc=S.String(),ZDc=S.String({minLength:1}),XDc=S.Object({sessionId:_i,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(KDc),reasoningEffort:FEe,references:S.Optional(S.Array(qO)),agentMode:S.Optional(JDc),chatMode:S.Optional(ZDc),contextTier:S.Optional(D3e),agentProvider:Fl});async function eNc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return r.agentMode!==void 0&&!nSt.includes(r.agentMode)?[null,{code:Xe.InvalidParams,message:`Unknown agentMode for Background provider: ${JSON.stringify(r.agentMode)}. Expected one of ${nSt.join(", ")}.`}]:KLr(t,e,{...r,agentMode:r.agentMode});IHi.info(t,"handleAgentSend called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(Ua),s=r;return di(async()=>{let c=await o.send(s,e);return IHi.info(t,"resume succeeded:",c.messageId),c})}a(eNc,"handleAgentSendChecked");var xHi=xe(XDc,eNc);p();p();var tNc=new pe("BackgroundAgent.stop"),rNc=S.Object({sessionId:_i});async function JLr(t,e,r){tNc.info(t,"handleBackgroundAgentStop called",{sessionId:r.sessionId});let n=t.get(Gs);return di(async()=>(await n.stopSession(r.sessionId),{success:!0}))}a(JLr,"handleBackgroundAgentStopChecked");var buh=xe(rNc,JLr);var nNc=new pe("BackgroundAgent.stop"),iNc=S.Object({sessionId:_i,agentProvider:Fl});async function oNc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND"){let[,c]=await JLr(t,e,r);return c?[null,c]:[void 0,null]}nNc.info(t,"handleAgentStop called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(Ua),s=r;return di(async()=>o.stop(s))}a(oNc,"handleAgentStopChecked");var wHi=xe(iNc,oNc);p();var sNc=S.Object({sessionId:_i,eventId:S.String(),agentProvider:N3e});async function aNc(t,e,r){let n=t.get(Ua),o={sessionId:r.sessionId,eventId:r.eventId,providerName:r.agentProvider};return di(async()=>n.truncateHistory(o))}a(aNc,"handleAgentTruncateHistoryChecked");var RHi=xe(sNc,aNc);p();var cNc=S.Object({});async function lNc(t,e,r){return e.isCancellationRequested?[null,{code:Xe.RequestCancelled,message:"Request was cancelled"}]:[{tokens:await t.get(Mr).listAvailableTokens()},null]}a(lNc,"handleListAvailableTokensChecked");var kHi=xe(cNc,lNc);p();var uNc=S.Object({tokenId:S.Number()});async function dNc(t,e,r){return e.isCancellationRequested?[null,{code:Xe.RequestCancelled,message:"Request was cancelled"}]:(await t.get(Mr).revokeTokenById(r.tokenId,"user_action"),[null,null])}a(dNc,"handleRemoveTokenChecked");var PHi=xe(uNc,dNc);p();var fNc=S.Object({tokenId:S.Number()});async function pNc(t,e,r){return e.isCancellationRequested?[null,{code:Xe.RequestCancelled,message:"Request was cancelled"}]:[await t.get(Mr).useExistingToken(r.tokenId),null]}a(pNc,"handleUseExistingTokenChecked");var DHi=xe(fNc,pNc);p();var hNc=S.Object({providerName:S.String()});async function mNc(t,e,r){try{let{providerName:n}=r,o=EO(n);if(o!==0)return[null,{code:Xe.InvalidParams,message:`deleteApiKey is only supported for providers with GlobalApiKey auth type. Provider ${n} has auth type: ${o}`}];let s=new $a(t.get(ti));return await s.removeAllModelConfigs(n),await s.deleteAPIKey(n,o),await s.deleteProviderConfig(n),[{success:!0,message:`API key and all model configurations deleted successfully for provider ${n}`},null]}catch(n){return[null,{code:Xe.InternalError,message:`Failed to delete API key: ${n instanceof Error?n.message:String(n)}`}]}}a(mNc,"handleBYOKDeleteApiKeyChecked");var NHi=xe(hNc,mNc);p();var gNc=S.Object({providerName:S.String(),modelId:S.String()});async function ANc(t,e,r){try{let n=new $a(t.get(ti)),{providerName:o,modelId:s}=r,c=EO(o);return await n.removeModelConfig(o,s),c===1&&await n.deleteAPIKey(o,c,s),[{success:!0,message:`Model ${s} deleted successfully for provider ${o}`},null]}catch(n){return[null,{code:Xe.InternalError,message:`Failed to delete model: ${n instanceof Error?n.message:String(n)}`}]}}a(ANc,"handleBYOKDeleteModelChecked");var MHi=xe(gNc,ANc);p();var yNc=S.Object({providerName:S.Optional(S.String()),modelId:S.Optional(S.String())}),OHi="-api-key";async function ENc(t,e){let r=await e.listKeys("byok"),n=new Set(await t.listCustomProviderNames()),o=new Set(Object.keys(await t.getStoredModelConfigs(no.Azure))),s=new Set(Object.values(no).filter(u=>u!==no.Azure)),c=`${no.Azure}-`,l=[];for(let u of r){if(!u.endsWith(OHi))continue;let d=await e.read("byok",u);if(!d)continue;let f=u.slice(0,-OHi.length),h=f.startsWith(c)?f.slice(c.length):void 0;if(h!==void 0&&o.has(h)&&!n.has(f)){l.push({providerName:no.Azure,modelId:h,apiKey:d});continue}(s.has(f)||n.has(f))&&l.push({providerName:f,apiKey:d})}return l}a(ENc,"listAllApiKeys");async function _Nc(t,e,r){try{let n=new $a(t.get(ti)),{providerName:o,modelId:s}=r;return o?[{apiKeys:[{apiKey:await n.getAPIKey(o,s)||void 0,providerName:o,modelId:s}]},null]:[{apiKeys:await ENc(n,t.get(ti))},null]}catch(n){return[null,{code:Xe.InternalError,message:`Failed to get API key: ${n instanceof Error?n.message:String(n)}`}]}}a(_Nc,"handleBYOKListApiKeysChecked");var LHi=xe(yNc,_Nc);p();var vNc=S.Object({providerName:S.Optional(S.String())});async function CNc(t,e,r){try{let n=new $a(t.get(ti)),o=r.providerName?[r.providerName]:await n.listCustomProviderNames(),s=[];for(let c of o){let l=await n.getProviderConfig(c);s.push({providerName:c,groupName:l?.groupName,apiType:l?.apiType})}return[{providers:s},null]}catch(n){return[null,{code:Xe.InternalError,message:`Failed to list provider configs: ${n instanceof Error?n.message:String(n)}`}]}}a(CNc,"handleBYOKListCustomProviderConfigsChecked");var BHi=xe(vNc,CNc);p();p();p();qBr();var dTt=class extends ow{static{a(this,"AnthropicProvider")}constructor(e){super(no.Anthropic,e)}async getAllModels(){await this.ensureKnownModelsCache();let e=await new $a(this.ctx.get(ti)).getAPIKey(this.providerName);if(!e)throw new Error(`API key not found for provider: ${this.providerName}`);let r=new qL({apiKey:e,fetch:TOc(this.ctx.get(nr))});try{let n=await r.models.list(),o=[];for(let s of n.data){let c=this._knownModels?.[s.id];c&&o.push({providerName:this.providerName,modelId:s.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:c})}return o}catch(n){throw RYe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,n),n}}};function TOc(t){return async(e,r)=>{let n=IOc(e,r),o=wOc(r),s=await t.fetch(n,o);return kOc(s)}}a(TOc,"createAnthropicFetchAdapter");function IOc(t,e){return t instanceof Request?(xOc(t,e),t.url):t instanceof URL?t.toString():t}a(IOc,"convertInputToString");function xOc(t,e){e&&(e.headers??=t.headers,e.method??=t.method,!e.body&&!t.bodyUsed&&(e.body=t.body))}a(xOc,"mergeRequestInit");function wOc(t){let e;return t?.headers&&(e=ROc(t.headers)),{method:t?.method||"GET",headers:e,body:t?.body,signal:t?.signal||void 0}}a(wOc,"convertToFetchOptions");function ROc(t){let e={};if(t instanceof Headers)for(let[r,n]of t.entries())e[r]=n;else if(Array.isArray(t))for(let[r,n]of t)e[r]=n;else return t;return e}a(ROc,"convertHeaders");async function kOc(t){let e=t.body(),r=null;if(e)r=POc(e);else{let n=await t.text();r=NOc(n)}return new globalThis.Response(r,{status:t.status,statusText:t.statusText,headers:new Headers(t.headers)})}a(kOc,"convertToWebResponse");function POc(t){return new ReadableStream({start(e){let r=DOc(t,e);return()=>r()},cancel(){"destroy"in t&&typeof t.destroy=="function"&&t.destroy()}})}a(POc,"createReadableStreamFromNodeStream");function DOc(t,e){let r=a(c=>{e.enqueue(new Uint8Array(c))},"onData"),n=a(()=>{e.close(),s()},"onEnd"),o=a(c=>{e.error(c),s()},"onError"),s=a(()=>{t.off("data",r),t.off("end",n),t.off("error",o)},"cleanup");return t.on("data",r),t.on("end",n),t.on("error",o),s}a(DOc,"setupStreamHandlers");function NOc(t){return new ReadableStream({start(e){e.enqueue(new TextEncoder().encode(t)),e.close()}})}a(NOc,"createReadableStreamFromText");p();var fTt=class extends ow{static{a(this,"GeminiProvider")}constructor(e){super(no.Gemini,e)}};p();var pTt=class extends ow{static{a(this,"GroqProvider")}constructor(e){super(no.Groq,e)}};p();var hTt=class extends ow{static{a(this,"OpenAIProvider")}constructor(e){super(no.OpenAI,e)}};p();var oVi=16e3,mTt=class extends ow{static{a(this,"OpenRouterProvider")}constructor(e){super(no.OpenRouter,e)}getFetchModelUrl(){return`${this.getBaseUrl()}/models?supported_parameters=tools`}resolveModelCapabilities(e){let r=e,n=r.top_provider?.context_length;if(typeof r.name!="string"||typeof n!="number")return;let o=r.supported_parameters??[],s=o.includes("reasoning")||o.includes("reasoning_effort")?["low","medium","high"]:void 0;return{name:r.name,maxInputTokens:Math.max(0,n-oVi),maxOutputTokens:oVi,toolCalling:o.includes("tools"),vision:r.architecture?.input_modalities?.includes("image")??!1,supportsReasoningEffort:s}}};var Bie=class{static{a(this,"BYOKProviderFactory")}constructor(e){this.providers=new Map([[no.OpenAI,new hTt(e)],[no.Gemini,new fTt(e)],[no.Groq,new pTt(e)],[no.OpenRouter,new mTt(e)],[no.Anthropic,new dTt(e)]])}getBYOKProvider(e){return this.providers.get(e)}};var MOc=S.Object({providerName:S.Optional(S.String()),enableFetchUrl:S.Optional(S.Boolean())});function G3r(t,e){if(!e)return e;let r=_xe(t);return{...e,maxInputTokens:e.maxInputTokens??r.maxInputTokens,maxOutputTokens:e.maxOutputTokens??r.maxOutputTokens}}a(G3r,"withDefaultTokenLimits");async function OOc(t,e,r){try{let{providerName:n,enableFetchUrl:o}=r,s=new $a(t.get(ti)),c=[];if(n)if(o){if(!Zle(n))return[null,{code:Xe.InvalidRequest,message:`enableFetchUrl is not supported for the ${n} provider`}];if(!await s.getAPIKey(n))return[null,{code:Xe.InvalidRequest,message:`API key is required to fetch models from ${n}`}];let u=t.get(Bie).getBYOKProvider(n);if(u){let d=await u.getAllModels(),f=new Map;d.forEach(g=>{let A=`${g.providerName}_${g.modelId}`;f.set(A,g)});let h=await s.getStoredModelConfigs(n),m=[];Object.entries(h).forEach(([g,A])=>{m.push({providerName:n,modelId:g,deploymentUrl:A.deploymentUrl,isRegistered:A.isRegistered,isCustomModel:A.isCustomModel,modelCapabilities:G3r(n,A.modelCapabilities)})}),m.forEach(g=>{let A=`${g.providerName}_${g.modelId}`;f.set(A,g)}),c.push(...f.values())}}else{let l=await s.getStoredModelConfigs(n);Object.entries(l).forEach(([u,d])=>{c.push({providerName:n,modelId:u,deploymentUrl:d.deploymentUrl,isRegistered:d.isRegistered,isCustomModel:d.isCustomModel,modelCapabilities:G3r(n,d.modelCapabilities)})})}else{let l=await s.listAllProviderNames();for(let u of l){let d=await s.getStoredModelConfigs(u);Object.entries(d).forEach(([f,h])=>{c.push({providerName:u,modelId:f,deploymentUrl:h.deploymentUrl,isRegistered:h.isRegistered,isCustomModel:h.isCustomModel,modelCapabilities:G3r(u,h.modelCapabilities)})})}}return[{models:c},null]}catch(n){return[null,{code:Xe.InternalError,message:`Failed to get models: ${n instanceof Error?n.message:String(n)}`}]}}a(OOc,"handleBYOKListModelsChecked");var sVi=xe(MOc,OOc);p();var LOc=S.Object({providerName:S.String(),apiKey:S.String(),modelId:S.Optional(S.String())});async function BOc(t,e,r){try{let n=new $a(t.get(ti)),{providerName:o,apiKey:s,modelId:c}=r,l=EO(o);if(l===1&&!c)return[null,{code:Xe.InvalidRequest,message:"modelId is required for PerModelDeployment auth type"}];await n.storeAPIKey(o,s,l,c);let u=`API key saved successfully for provider ${o}`;return[{success:!0,message:c?`${u} and model ${c}`:u},null]}catch(n){return[null,{code:Xe.InternalError,message:`Failed to save API key: ${n instanceof Error?n.message:String(n)}`}]}}a(BOc,"handleBYOKSaveApiKeyChecked");var aVi=xe(LOc,BOc);p();var FOc=S.Object({providerName:S.String(),apiKey:S.String(),groupName:S.String(),apiType:S.Optional(S.Union([S.Literal("chatCompletions"),S.Literal("responses"),S.Literal("messages")]))});async function UOc(t,e,r){try{let n=r.providerName,{apiKey:o,groupName:s,apiType:c}=r;if(!n)return[null,{code:Xe.InvalidRequest,message:"Provider name must not be empty."}];if(!o)return[null,{code:Xe.InvalidRequest,message:"API key must not be empty."}];if(!dq(n))return[null,{code:Xe.InvalidRequest,message:`Provider '${n}' is a built-in provider; custom provider config is only supported for user-named providers.`}];let l=new $a(t.get(ti));return await l.storeAPIKey(n,o,EO(n)),await l.saveProviderConfig(n,{groupName:s,apiType:c}),[{success:!0,message:`Provider config saved successfully for provider ${n}`},null]}catch(n){return[null,{code:Xe.InternalError,message:`Failed to save provider config: ${n instanceof Error?n.message:String(n)}`}]}}a(UOc,"handleBYOKSaveCustomProviderConfigChecked");var cVi=xe(FOc,UOc);p();var QOc=S.Object({providerName:S.String(),modelId:S.String(),isRegistered:S.Boolean(),isCustomModel:S.Boolean(),deploymentUrl:S.Optional(S.String()),apiKey:S.Optional(S.String()),modelCapabilities:S.Optional(S.Object({name:S.String(),maxInputTokens:S.Optional(S.Number()),maxOutputTokens:S.Optional(S.Number()),toolCalling:S.Boolean(),vision:S.Boolean(),thinking:S.Optional(S.Boolean())}))});async function qOc(t,e,r){try{let{providerName:n,modelId:o,isRegistered:s,isCustomModel:c,deploymentUrl:l,apiKey:u,modelCapabilities:d}=r,f=new $a(t.get(ti)),h=EO(n);if(h===1&&!l)return[null,{code:Xe.InvalidRequest,message:`deploymentUrl is required for the ${n} provider`}];if(dq(n)){if(!l)return[null,{code:Xe.InvalidRequest,message:`deploymentUrl is required for custom endpoint provider '${n}'`}];if(!await f.getProviderConfig(n))return[null,{code:Xe.InvalidRequest,message:`Custom endpoint provider '${n}' must be configured via saveCustomProviderConfig before registering models.`}]}if(l||d){let m={deploymentUrl:l,isRegistered:s,isCustomModel:c,modelCapabilities:d};await f.saveModelConfig(n,o,m,u,h)}else u!==void 0&&await f.storeAPIKey(n,u,h,o);return[{success:!0,message:`Model ${o} saved successfully for provider ${n}`},null]}catch(n){return[null,{code:Xe.InternalError,message:`Failed to save model: ${n instanceof Error?n.message:String(n)}`}]}}a(qOc,"handleBYOKSaveModelChecked");var lVi=xe(QOc,qOc);p();var jOc=S.Object({cliPath:S.String()});async function HOc(t,e,r){return[await ume.check(r.cliPath),null]}a(HOc,"handleCheckClaudeCliCompatibilityChecked");var uVi=xe(jOc,HOc);p();p();var fVi=fe(IP()),dVi="0.135.0",gTt=new lme({displayName:"Codex CLI",notConfiguredMessage:"Codex CLI path is not configured. Install the Codex CLI (e.g. `npm install -g @openai/codex`), then set the Codex CLI Path in your editor's Copilot settings to the absolute path of the `codex` binary.",validateVersion(t){if(fVi.lt(t,dVi))return{severity:"error",message:`Codex CLI at the input path reports version ${t.version}, but version ${dVi} or later is required. Run \`npm install -g @openai/codex\` to upgrade.`}}});var GOc=S.Object({cliPath:S.String()});async function $Oc(t,e,r){return[await gTt.check(r.cliPath),null]}a($Oc,"handleCheckCodexCliCompatibilityChecked");var pVi=xe(GOc,$Oc);p();var VOc=S.Object({uri:S.String({minLength:1})});async function WOc(t,e,r){let n=await t.get(ni).getOrReadTextDocument(r);return[{status:id(n),...n.status==="invalid"&&{reason:n.reason},...n.status==="notfound"&&{reason:n.message}},null]}a(WOc,"handleCheckFileStatusChecked");var hVi=xe(VOc,WOc);p();var zOc=S.Object({});function mVi(t,e){return typeof t!="number"||typeof e!="number"||e===0?0:Math.max(0,Math.min(100,t/e*100))}a(mVi,"calculatePercentRemaining");function $3r(t){return{percentRemaining:t?.percent_remaining??100,unlimited:t?.unlimited??!1,overagePermitted:t?.overage_permitted??!1,overageCount:t?.overage_count,overageEntitlement:t?.overage_entitlement,creditsUsed:t?.credits_used,entitlement:t?.entitlement,quotaRemaining:t?.quota_remaining,timeStamp:t?.timestamp_utc}}a($3r,"buildQuotaSnapshot");async function YOc(t,e,r){let n=await t.get(Mr).resolveSession();if(!n)return[null,{code:Xe.InternalError,message:"Not signed in"}];let o=await wbe(t,n);if(o.ok){let s=await o.json();return t.get(Eu).processUserInfoQuotaSnapshot(s),s.token_based_billing?[{chat:$3r(s.quota_snapshots?.chat),completions:$3r(s.quota_snapshots?.completions),premiumInteractions:$3r(s.quota_snapshots?.premium_interactions),resetDate:s.quota_reset_date??"",resetDateUtc:s.quota_reset_date_utc,copilotPlan:s.access_type_sku==="free_limited_copilot"?"free":s.copilot_plan,tokenBasedBillingEnabled:!0,canUpgradePlan:s.can_upgrade_plan},null]:s.access_type_sku==="free_limited_copilot"?[{chat:{percentRemaining:mVi(s.limited_user_quotas?.chat,s.monthly_quotas?.chat),unlimited:!1,overagePermitted:!1},completions:{percentRemaining:mVi(s.limited_user_quotas?.completions,s.monthly_quotas?.completions),unlimited:!1,overagePermitted:!1},premiumInteractions:{percentRemaining:0,unlimited:!1,overagePermitted:!1},resetDate:s.limited_user_reset_date??"",copilotPlan:"free",tokenBasedBillingEnabled:!1,canUpgradePlan:s.can_upgrade_plan},null]:[{chat:{percentRemaining:s.quota_snapshots?.chat?.percent_remaining??100,unlimited:s.quota_snapshots?.chat?.unlimited??!1,overagePermitted:s.quota_snapshots?.chat?.overage_permitted??!1},completions:{percentRemaining:s.quota_snapshots?.completions?.percent_remaining??100,unlimited:s.quota_snapshots?.completions?.unlimited??!1,overagePermitted:s.quota_snapshots?.completions?.overage_permitted??!1},premiumInteractions:{percentRemaining:s.quota_snapshots?.premium_interactions?.percent_remaining??100,unlimited:s.quota_snapshots?.premium_interactions?.unlimited??!1,overagePermitted:s.quota_snapshots?.premium_interactions?.overage_permitted??!1},resetDate:s.quota_reset_date??"",copilotPlan:s.copilot_plan,tokenBasedBillingEnabled:!1,canUpgradePlan:s.can_upgrade_plan},null]}return[null,{code:Xe.InternalError,message:"Failed to fetch quota info"}]}a(YOc,"handleCheckQuotaChecked");var gVi=xe(zOc,YOc);p();var KOc=S.Object({options:S.Optional(S.Object({localChecksOnly:S.Optional(S.Boolean()),forceRefresh:S.Optional(S.Boolean())}))});async function JOc(t,e,r){return[await t.get(Mr).checkAndUpdateStatus(r.options),null]}a(JOc,"handleCheckStatusChecked");var AVi=xe(KOc,JOc);p();var ZOc=S.Object({pullRequestNumber:S.Integer({minimum:1}),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),body:S.String({minLength:1})});async function XOc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Xe.RequestCancelled,message:"Request was cancelled"}];let o=await new nm(t).addPullRequestComment(r.repoOwner,r.repoName,r.pullRequestNumber,r.body);return jl(t,"cloudAgent.addPullRequestComment",{result:"success"}),[{html_url:o.html_url},null]}catch(n){if(ng(t,"cloudAgent.addPullRequestComment",n,{result:"error"}),n instanceof mE)return[null,{code:Xe.NoGitHubToken,message:n.message}];if(n instanceof od&&n.isClientError())return[null,{code:Xe.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Xe.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Xe.InternalError,message:`Unexpected error happened: ${o}`}]}}a(XOc,"handleCloudAgentAddPullRequestCommentChecked");var yVi=xe(ZOc,XOc);p();var e5c=S.Object({pullRequestId:S.Number(),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1})});async function t5c(t,e,r){try{let o=await new VC(t).getAllSessions(r.pullRequestId,e);if(!o||o.length===0)return[null,{code:Xe.InvalidRequest,message:"No session found for this pull request"}];let s=o[0];return s.state==="completed"?(ft(t,"githubApi.cancelCodingAgent",Vt.createAndMarkAsIssued()),cr(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):s.workflow_run_id?(await new nm(t).cancelWorkflow(r.repoOwner,r.repoName,s.workflow_run_id),ft(t,"githubApi.cancelCodingAgent",Vt.createAndMarkAsIssued()),cr(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):[null,{code:Xe.InternalError,message:"No workflow run ID found in session"}]}catch(n){if(xa(t,n,"githubApi.cancelCodingAgent"),Cs(t,"githubApi.cancelCodingAgent",n),n instanceof lw)return[null,{code:Xe.NoCopilotToken,message:n.message}];if(n instanceof lp)return[null,{code:Xe.InvalidRequest,message:n.message}];if(n instanceof rm)return[null,{code:Xe.InvalidRequest,message:n.message}];if(n instanceof mE)return[null,{code:Xe.NoGitHubToken,message:n.message}];if(n instanceof od&&n.isClientError())return[null,{code:Xe.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Xe.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Xe.InternalError,message:`Unexpected error happened: ${o}`}]}}a(t5c,"handleCancelCodingAgentChecked");var EVi=xe(e5c,t5c);p();var r5c=S.Object({problemStatement:S.String({minLength:1}),workspaceFolder:S.Optional(S.String({minLength:1})),workspaceFolders:S.Optional(S.Array(qc))});function n5c(t){if(t.workspaceFolders&&t.workspaceFolders.length>0)return{uri:t.workspaceFolders[0].uri};if(t.workspaceFolder)return{uri:t.workspaceFolder}}a(n5c,"pickWorkspaceFolder");async function i5c(t,e,r){try{let n=n5c(r);if(!n)return[null,{code:Xe.InvalidRequest,message:"No workspace folder provided \u2014 cannot create a cloud agent job."}];let s=await new Tf(t).getRepo(n);if(!s||!s.isGitHub())return[null,{code:Xe.InvalidRequest,message:"No GitHub repository found in the workspace folder."}];if(!s.owner||!s.name)return[null,{code:Xe.InvalidRequest,message:"Could not determine repository owner and name."}];let l=await new LO([new BO,new FO]).getBranchInfo(t,n);if(!l?.currentBranch||l.isDetachedHead)return[null,{code:Xe.InvalidRequest,message:"No current branch found or detached HEAD state \u2014 cannot create a cloud agent job."}];let u=l.currentBranch,d=Tue(r.problemStatement);if(e.isCancellationRequested)return[null,{code:Xe.RequestCancelled,message:"Request was cancelled"}];let h=await new VC(t).createCodingTask(d,r.problemStatement,s.owner,s.name,u,e);return jl(t,"cloudAgent.createJob",{result:"success"}),[h,null]}catch(n){if(ng(t,"cloudAgent.createJob",n,{result:"error"}),vxe(n))return[null,{code:Xe.RequestCancelled,message:"Request was cancelled"}];if(n instanceof lw)return[null,{code:Xe.NoGitHubToken,message:n.message}];if(n instanceof lp)return[null,{code:Xe.InvalidRequest,message:n.message}];if(n instanceof rm)return[null,{code:Xe.InvalidRequest,message:n.message}];if(n instanceof mE)return[null,{code:Xe.NoGitHubToken,message:n.message}];if(n instanceof od&&n.isClientError())return[null,{code:Xe.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Xe.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Xe.InternalError,message:`Unexpected error happened: ${o}`}]}}a(i5c,"handleCloudAgentCreateJobChecked");var _Vi=xe(r5c,i5c);p();var o5c=S.Object({sessionId:S.String({minLength:1})});async function s5c(t,e,r){try{let o=await new VC(t).getSessionLogs(r.sessionId,e);return jl(t,"cloudAgent.getSessionLogs",{result:"success"}),[{logs:o},null]}catch(n){if(ng(t,"cloudAgent.getSessionLogs",n,{result:"error"}),n instanceof lw)return[null,{code:Xe.NoGitHubToken,message:n.message}];if(n instanceof lp||n instanceof rm)return[null,{code:Xe.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Xe.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Xe.InternalError,message:`Unexpected error happened: ${o}`}]}}a(s5c,"handleCloudAgentGetSessionLogsChecked");var vVi=xe(o5c,s5c);p();var a5c=S.Object({pullRequestId:S.Integer()});async function c5c(t,e,r){try{let o=await new VC(t).getAllSessions(r.pullRequestId,e);return jl(t,"cloudAgent.listSessions",void 0,{totalSessions:o?.length??0}),[{sessions:o??[]},null]}catch(n){if(ng(t,"cloudAgent.listSessions",n),n instanceof lw)return[null,{code:Xe.NoGitHubToken,message:n.message}];if(n instanceof lp||n instanceof rm)return[null,{code:Xe.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Xe.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Xe.InternalError,message:`Unexpected error happened: ${o}`}]}}a(c5c,"handleCloudAgentListSessionsChecked");var CVi=xe(a5c,c5c);p();var l5c=S.Object({});async function u5c(t,e,r){return[(await aw(t)).map(s=>({slug:s.slug,name:s.name,description:s.description,avatarUrl:s.avatarUrl})),null]}a(u5c,"handleConversationAgentsChecked");var bVi=xe(l5c,u5c);p();p();var EFe=fe(Fc());function d5c(t,e,r){let n=Vt.createAndMarkAsIssued({languageId:String(e.detectedLanguageId),requestedDocumentVersion:String(r),actualDocumentVersion:String(e.version)});return ft(t,"getCompletions.docVersionMismatch",n)}a(d5c,"telemetryVersionMismatch");async function j9(t,e,r){let o=t.get($r).getTextDocumentUnsafe(e);if(!o)throw new EFe.ResponseError(Xe.InvalidParams,`Document for URI could not be found: ${e.uri}`);let s=await Wle(t,e,o.getText());if(s.status==="invalid")throw t.get(Ss).setClsInactive(s.reason),new EFe.ResponseError(Xe.CopilotNotAvailable,s.reason);if(e.version!==void 0&&o.version!==e.version)throw r?.isCancellationRequested||(d5c(t,o,e.version),$o.debug(t,`Requested document version was ${e.version} but actual document version was ${o.version}.`)),new EFe.ResponseError(Xe.ContentModified,"Document Version Mismatch");return o}a(j9,"getTextDocument");async function jL(t,e,r){let n=e.textDocument??e.doc;if(n)try{return await j9(t,n,r)}catch(o){if(o instanceof EFe.ResponseError){if(o.code===Xe.CopilotNotAvailable)return;if(o.code===Xe.InvalidParams){$o.warn(t,`Document not found for conversation: ${n.uri}. Continuing without this file.`);return}}throw o}}a(jL,"getTextDocumentIfAvailable");var f5c=S.Union([S.Literal("keyboard"),S.Literal("toolbar")]),p5c=S.Object({turnId:nJ,codeBlockIndex:S.Number(),source:f5c,copiedCharacters:S.Number(),totalCharacters:S.Number(),copiedText:S.String(),doc:S.Optional(GJe),textDocument:S.Optional($C),position:S.Optional(f0),conversationSource:S.Optional(jO)});async function h5c(t,e,r){let n=await jL(t,r,e),o={totalCharacters:r.totalCharacters,copiedCharacters:r.copiedCharacters},s=r.position??r.doc?.position;n&&s&&(o={...o,currentLine:s.line});let c=gq(r.conversationSource),l=t.get(zo).findByTurnId(r.turnId),u=await rl(t,l,{languageId:n?.detectedLanguageId??""});return KS(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,mode:l?.turn.getChatModeForTelemetry()??"unknown",modelId:l?.turn.getResolvedModelId()??"unknown"},o,`${fE(c)}.acceptedCopy`,u),["OK",null]}a(h5c,"handleConversationCodeCopyChecked");var SVi=xe(p5c,h5c);p();var m5c=S.Union([S.Literal("keyboard"),S.Literal("toolbar"),S.Literal("diff")]),g5c=S.Object({turnId:nJ,source:m5c,codeBlockIndex:S.Number(),acceptedLength:S.Optional(S.Number()),totalCharacters:S.Number(),newFile:S.Optional(S.Boolean()),doc:S.Optional(GJe),textDocument:S.Optional($C),position:S.Optional(f0),conversationSource:S.Optional(jO)});async function A5c(t,e,r){let n=await jL(t,r,e),o={totalCharacters:r.totalCharacters,acceptedLength:r.acceptedLength??r.totalCharacters},s=r.position??r.doc?.position;n&&s&&(o={...o,insertionOffset:n.offsetAt(s),currentLine:s.line});let c=gq(r.conversationSource),l=t.get(zo).findByTurnId(r.turnId),u=await rl(t,l,{languageId:n?.detectedLanguageId??""});return KS(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,compType:r.acceptedLength&&r.acceptedLength0&&(e+=` ## Latest Todo List \`\`\`json ${JSON.stringify(o,null,2)} -\`\`\``),e}sendStartedTelemetry(e,r,n,o,s){let c=Wt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:s},{turnCount:n});Et(this.ctx,"conversationPartition.compression.started",c,0)}sendArchivedTelemetry(e,r,n,o){let s=Wt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{turnCount:n});Et(this.ctx,"conversationPartition.compression.archived",s,0)}sendSummarizedTelemetry(e,r,n,o){let s=Wt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{summaryLength:n});Et(this.ctx,"conversationPartition.compression.summarized",s,0)}sendCompletedTelemetry(e,r,n,o,s,c,l){let u=Wt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),newPartitionId:String(n),modelId:l},{archivedTurnCount:o,summaryLength:s,compressionTimeMs:c});Et(this.ctx,"conversationPartition.compression.completed",u,0)}sendFailedTelemetry(e,r,n,o,s){let c=Wt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),error:n,modelId:s},{compressionTimeMs:o});Et(this.ctx,"conversationPartition.compression.failed",c,0)}sendCancelledTelemetry(e,r,n,o){let s=Date.now()-n,c=Wt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:o},{compressionTimeMs:s});Et(this.ctx,"conversationPartition.compression.cancelled",c,0)}async recordPartitionTranscriptEvents(e,r,n,o,s){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.initializePartition(e,n,{compressedFrom:r,source:"compression",summary:o,turnId:s?String(s):void 0})}catch(c){ot.error(this.ctx,`Failed to initialize new partition transcript: ${c instanceof Error?c.message:String(c)}`)}}};p();p();var WSt=de(Io());var VSt=class extends lr{static{a(this,"ConversationSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(WSt.SystemMessage,{priority:100},vscpp(vscppf,null,this.renderSummarizationInstructions())),this.renderPartitionTurns(),vscpp(WSt.UserMessage,{priority:90},vscpp(vscppf,null,this.renderFinalInstructions())))}renderSummarizationInstructions(){return`You are an expert at summarizing chat conversations for context compression. +\`\`\``),e}sendStartedTelemetry(e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:s},{turnCount:n});ft(this.ctx,"conversationPartition.compression.started",c,0)}sendArchivedTelemetry(e,r,n,o){let s=Vt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{turnCount:n});ft(this.ctx,"conversationPartition.compression.archived",s,0)}sendSummarizedTelemetry(e,r,n,o){let s=Vt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{summaryLength:n});ft(this.ctx,"conversationPartition.compression.summarized",s,0)}sendCompletedTelemetry(e,r,n,o,s,c,l){let u=Vt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),newPartitionId:String(n),modelId:l},{archivedTurnCount:o,summaryLength:s,compressionTimeMs:c});ft(this.ctx,"conversationPartition.compression.completed",u,0)}sendFailedTelemetry(e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),error:n,modelId:s},{compressionTimeMs:o});ft(this.ctx,"conversationPartition.compression.failed",c,0)}sendCancelledTelemetry(e,r,n,o){let s=Date.now()-n,c=Vt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:o},{compressionTimeMs:s});ft(this.ctx,"conversationPartition.compression.cancelled",c,0)}async recordPartitionTranscriptEvents(e,r,n,o,s){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.initializePartition(e,n,{compressedFrom:r,source:"compression",summary:o,turnId:s?String(s):void 0})}catch(c){ot.error(this.ctx,`Failed to initialize new partition transcript: ${c instanceof Error?c.message:String(c)}`)}}};p();p();var ETt=fe(Io());var yTt=class extends lr{static{a(this,"ConversationSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(ETt.SystemMessage,{priority:100},vscpp(vscppf,null,this.renderSummarizationInstructions())),this.renderPartitionTurns(),vscpp(ETt.UserMessage,{priority:90},vscpp(vscppf,null,this.renderFinalInstructions())))}renderSummarizationInstructions(){return`You are an expert at summarizing chat conversations for context compression. You will be provided with a series of user/assistant message pairs from a conversation partition that needs to be compressed. @@ -3987,7 +4041,7 @@ Summary: 1. **Analysis Section** = Chronological story for understanding flow 2. **Summary Section** = Structured lookup reference for key facts 3. **Redundancy is acceptable** - same info can appear in both sections -4. **Completeness over brevity** - better to include too much than too little`}renderPartitionTurns(){let{partition:e,ctx:r}=this.props,n=[];if(!e.turns||e.turns.length===0)return n;for(let o of e.turns)if(o.request&&n.push(aJe({role:"user",content:GS(o.request.message)})),o.response){let s=yO(o.response.message,!0),c=RO(s,{ctx:r,identifier:"partition summary",enableWarnings:!1});c.length>0&&n.push(vscpp(rw,{assistantRounds:c,ctx:r,isHistorical:!0,identifier:"partition-summary"}))}return n}renderFinalInstructions(){let{partition:e,ctx:r,userLanguage:n}=this.props,o=new p0(r),s=o.isEnabled()?this.getTranscriptReferenceMessage(o.getTranscriptPath(e.conversationId,e.partitionId),n):"";return`The conversation above contains ${e.turnCount} turn(s) from partition ${e.partitionId}. +4. **Completeness over brevity** - better to include too much than too little`}renderPartitionTurns(){let{partition:e,ctx:r}=this.props,n=[];if(!e.turns||e.turns.length===0)return n;for(let o of e.turns)if(o.request&&n.push(OJe({role:"user",content:JS(o.request.message)})),o.response){let s=SO(o.response.message,!0),c=OO(s,{ctx:r,identifier:"partition summary",enableWarnings:!1});c.length>0&&n.push(vscpp(uw,{assistantRounds:c,ctx:r,isHistorical:!0,identifier:"partition-summary"}))}return n}renderFinalInstructions(){let{partition:e,ctx:r,userLanguage:n}=this.props,o=new g0(r),s=o.isEnabled()?this.getTranscriptReferenceMessage(o.getTranscriptPath(e.conversationId,e.partitionId),n):"";return`The conversation above contains ${e.turnCount} turn(s) from partition ${e.partitionId}. Please create a comprehensive summary following the exact format specified in the system instructions. @@ -4005,7 +4059,7 @@ If you need specific details from before compaction (like exact code snippets, e \u5727\u7E2E\u524D\u306E\u5177\u4F53\u7684\u306A\u8A73\u7D30\uFF08\u6B63\u78BA\u306A\u30B3\u30FC\u30C9\u30B9\u30CB\u30DA\u30C3\u30C8\u3001\u30A8\u30E9\u30FC\u30E1\u30C3\u30BB\u30FC\u30B8\u3001\u751F\u6210\u3055\u308C\u305F\u30B3\u30F3\u30C6\u30F3\u30C4\u306A\u3069\uFF09\u304C\u5FC5\u8981\u306A\u5834\u5408\u306F\u3001\u5B8C\u5168\u306A\u30C8\u30E9\u30F3\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u304A\u8AAD\u307F\u304F\u3060\u3055\u3044\uFF1A${e}`,es:` -Si necesita detalles espec\xEDficos de antes de la compactaci\xF3n (como fragmentos de c\xF3digo exactos, mensajes de error o contenido que gener\xF3), lea la transcripci\xF3n completa en: ${e}`},s=n.split("-")[0];return o[n]||o[s]||o.en}};Mo();var xN=class{constructor(e){this.ctx=e}static{a(this,"ConversationSummaryManager")}async generateSummary(e,r,n,o="conversation-other",s){let c=Date.now();try{if(this.sendStartedTelemetry(e,r),n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let u=await ap.create(VSt,{ctx:this.ctx,partition:e},r).renderPrompt(void 0,n);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let d=OA.user(o,Mt()),f=JI.createEmptyConfigForTesting(),h;try{h=this.ctx.get(oc)}catch{h=new oc(this.ctx)}let m={messages:u.messages,uiKind:"conversationPanel",llmInteraction:d,modelConfiguration:r,turnId:s},g=await h.fetchResponse(m,n,f,void 0);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";if(g.type==="success"){let A=g.value.trim();return this.sendSuccessTelemetry(e,c,A,r),ot.debug(this.ctx,`Generated partition summary: conversationId=${e.conversationId}, partitionId=${e.partitionId}, length=${A.length}`),A}else{let A="reason"in g?g.reason:"Unknown error";return ot.error(this.ctx,`Failed to generate partition summary: conversationId=${e.conversationId}, partitionId=${e.partitionId}, type=${g.type}, reason=${A}`),this.sendErrorTelemetry(e,c,g.type,r,A),""}}catch(l){let u=l instanceof Error?l.message:String(l);return ot.exception(this.ctx,l,`Error generating partition summary for conversationId=${e.conversationId}, partitionId=${e.partitionId}`),this.sendErrorTelemetry(e,c,"exception",r,u),""}}sendStartedTelemetry(e,r){let n=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:r.modelId},{turnCount:e.turnCount});Et(this.ctx,"partition.summary.started",n,0)}sendSuccessTelemetry(e,r,n,o){let s=Date.now()-r,c=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:o.modelId},{summaryLength:n.length,generationTimeMs:s,turnCount:e.turnCount});Et(this.ctx,"partition.summary.success",c,0)}sendErrorTelemetry(e,r,n,o,s){let c=Date.now()-r,l=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),errorType:n,errorMessage:s||"Unknown error",modelId:o.modelId},{generationTimeMs:c});Et(this.ctx,"partition.summary.error",l,0)}sendCancelledTelemetry(e,r,n){let o=Date.now()-r,s=Wt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:n.modelId},{generationTimeMs:o});Et(this.ctx,"partition.summary.cancelled",s,0)}};var qNc=S.Object({conversationId:S.String()});async function jNc(t,e,r){let{conversationId:n}=r,o=Date.now();ot.debug(t,`Manual compression started for conversation: ${n}`);let s=t.get(bI);HNc(t,n,o);try{if(e.isCancellationRequested)return ot.debug(t,`Manual compression cancelled before start: ${n}`),[K3e(n,"Compression cancelled"),null];let c=t.get(zo),l;try{l=c.get(n)}catch{return ot.warn(t,`Conversation not found: ${n}`),J3e(t,n,0,"Conversation not found",Date.now()-o),[K3e(n,`Conversation not found: ${n}`),null]}let u=l.turns.length;if(u===0)return ot.warn(t,`Cannot compress conversation with 0 turns: ${n}`),J3e(t,n,0,"No turns to compress",Date.now()-o),[K3e(n,`Cannot compress conversation with 0 turns: ${n}`),null];let d=l.turns.filter(v=>v.request.type!=="meta").length;if(l.currentPartitionId>1&&d===0)return ot.warn(t,`Cannot compress - no new turns since last compression: ${n}`),J3e(t,n,l.currentPartitionId,"No new turns since last compression",Date.now()-o),[K3e(n,`Cannot compress - no new turns since last compression: ${n}`),null];let h=l.turns[l.turns.length-1],m=h?.resolvedModelConfiguration,g=h?.userRequestedModel;if(!m)if(g)m=await t.get(el).getBestChatModelConfig([g]);else throw new Error("No model available for compression");let A=t.get(xN),y=new sk(A,t),E=l.currentPartitionId;await s.notifyCompressionStarted({conversationId:n,partitionId:E,reason:"manual"});let _=await y.compressCurrentPartition(l,m,e);if(_.success){let v=l.turns[0],b=typeof v?.request?.message=="string"?v.request.message:"",T=Date.now()-o;ot.debug(t,`Manual compression completed: conversationId=${n}, archivedPartitionId=${_.archivedPartitionId}, newPartitionId=${_.newPartitionId}, turnCount=${u}, summaryLength=${b.length}, durationMs=${T}`);let w;try{w=new qq().calculateContextSize(t,l,m)}catch(R){ot.warn(t,`Failed to calculate context size after compression: ${R instanceof Error?R.message:String(R)}`)}return await s.notifyCompressionCompleted({conversationId:n,archivedPartitionId:_.archivedPartitionId,newPartitionId:_.newPartitionId,summaryLength:b.length,turnCount:u,durationMs:T,contextInfo:w}),GNc(t,n,_.archivedPartitionId,_.newPartitionId,u,b.length,T,m.modelId),[{success:!0,conversationId:n,archivedPartitionId:_.archivedPartitionId,newPartitionId:_.newPartitionId,summaryContent:b,summaryLength:b.length,turnCount:u,contextInfo:w},null]}else{let v=_.error||"Compression failed",b=Date.now()-o;return ot.warn(t,`Manual compression failed: conversationId=${n}, error=${v}`),J3e(t,n,_.archivedPartitionId,v,b,m.modelId),[{success:!1,conversationId:n,archivedPartitionId:_.archivedPartitionId,newPartitionId:_.newPartitionId,summaryContent:"",summaryLength:0,turnCount:u,error:v},null]}}catch(c){let l=c instanceof Error?c.message:String(c),u=Date.now()-o;return ot.exception(t,c,`Manual compression error: conversationId=${n}`),J3e(t,n,0,l,u),[K3e(n,`Compression failed: ${l}`),null]}}a(jNc,"handleConversationCompressChecked");function K3e(t,e){return{success:!1,conversationId:t,archivedPartitionId:0,newPartitionId:0,summaryContent:"",summaryLength:0,turnCount:0,error:e,contextInfo:void 0}}a(K3e,"createErrorResult");function HNc(t,e,r,n){let o=Wt.createAndMarkAsIssued({conversationId:e,...n?{modelId:n}:{}},{});Et(t,"conversationPartition.manualCompression.started",o,0)}a(HNc,"sendStartedTelemetry");function GNc(t,e,r,n,o,s,c,l){let u=Wt.createAndMarkAsIssued({conversationId:e,archivedPartitionId:String(r),newPartitionId:String(n),success:"true",...l?{modelId:l}:{}},{turnCount:o,summaryLength:s,durationMs:c});Et(t,"conversationPartition.manualCompression.completed",u,0)}a(GNc,"sendCompletedTelemetry");function J3e(t,e,r,n,o,s){let c=Wt.createAndMarkAsIssued({conversationId:e,partitionId:String(r),success:"false",error:n,...s?{modelId:s}:{}},{durationMs:o});Et(t,"conversationPartition.manualCompression.failed",c,0)}a(J3e,"sendFailedTelemetry");var OGi=Oe(qNc,jNc);p();p();var zSt=S.Array(Sf);function YSt(t){if(t.textDocument?.uri)return{uri:t.textDocument.uri,selection:t.selection,visibleRange:t.visibleRanges?.[0]}}a(YSt,"resolveAsActiveEditor");p();var LGi=de(Xc());var KSt=new LGi.ProgressType,$Br=class{constructor(e){this.progressToken=e;this.tokenBudgetEstimator=new qq}static{a(this,"WorkDoneProgressHandler")}async begin(e,r,n,o){await e.get(ar).connection.sendProgress(KSt,this.progressToken,{kind:"begin",title:`Conversation ${r.id} Turn ${n.id}`,conversationId:r.id,turnId:n.id,agentSlug:n.agent?.agentSlug,...o})}async report(e,r,n,o){let s=o.contextSize;s||(s=this.calculateContextSize(e,r,n)),await e.get(ar).connection.sendProgress(KSt,this.progressToken,{kind:"report",conversationId:r.id,turnId:n.id,...o,contextSize:s})}async end(e,r,n,o){await e.get(ar).connection.sendProgress(KSt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,...o})}async cancel(e,r,n,o){await e.get(ar).connection.sendProgress(KSt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,cancellationReason:"CancelledByUser",error:o})}calculateContextSize(e,r,n){try{let o=n.resolvedModelConfiguration;return o?this.tokenBudgetEstimator.calculateContextSize(e,r,o):void 0}catch(o){ot.error(e,"Failed to calculate context size",o);return}}};function m_e(t){return new $Br(t.workDoneToken)}a(m_e,"createProgressHandler");p();var BGi=de(Xc());var g_e=class{static{a(this,"WorkspaceFoldersValidator")}static validate(e){if(!e)return;let r=new Set;for(let n of e){if(r.has(n.uri))throw new BGi.ResponseError(Ze.InvalidParams,`Duplicate workspace folder uri ${n.uri}`);r.add(n.uri)}}};p();function JSt(t){if(t&&t.uri.length>0)return[{uri:t.uri,name:Ji(t.uri)}]}a(JSt,"resolveAsWorkspaceFolders");p();p();var $Nc=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),i_=class{constructor(e){this.tokens=[];this.handlers=[];this._isCancelled=!1;this.onCancellationRequested=a((e,r)=>this._isCancelled?$Nc(e,r):(this.handlers.push(e.bind(r)),{dispose:a(()=>{},"dispose")}),"onCancellationRequested");this.tokens=e,this._isCancelled=e.some(r=>r.isCancellationRequested),e.forEach(r=>{r.onCancellationRequested(n=>this.cancel(n))})}static{a(this,"MergedToken")}cancel(e){this._isCancelled||(this._isCancelled=!0,this.handlers.forEach(r=>r(e)))}get isCancellationRequested(){return this.tokens.some(e=>e.isCancellationRequested)}};var wN=class{constructor(){this.tokens=new Cn(250)}static{a(this,"ProgressTokens")}add(e,r){let n=new Fn.CancellationTokenSource,o=new i_([r,n.token]);return this.tokens.set(e.toString(),n),o}cancel(e){let r=this.tokens.get(e.toString());r&&(r.cancel(),this.tokens.delete(e.toString()))}};p();p();function FGi(t){if(t?.originalBillingMultiplier===void 0)return;let e=t.autoModeDiscountedCost??0;return Math.round((t.originalBillingMultiplier??0)*(1-e)*100)/100}a(FGi,"calculateBillingMultiplier");async function ZSt(t,e){let r=e,n=e.modelInfo?.id;if(!n&&r.model&&(n=r.modelProviderName?r.model:await xo.resolveModelIdFromFamily(t,r.model)),!n)throw new Error("A model id is required: provide `modelInfo.id` or the deprecated `model` field.");return{...e.modelInfo,id:n,providerName:e.modelInfo?.providerName??r.modelProviderName}}a(ZSt,"resolveTurnModelInfo");function XSt(t,e){let r=t.resolvedModelConfiguration;return{modelName:r?.uiName??e.id,modelProviderName:e.providerName,userRequestedModel:e.id,reasoningEffort:e.reasoningEffort,chatMode:t.chatMode?.kind,agentSlug:t.agent?.agentSlug,billingMultiplier:FGi(r)}}a(XSt,"buildTurnSummary");p();function eTt(t,e,r,n,o,s){let{properties:c,measurements:l}=WNc(e,r,n,o,s),u=VNc(e,r,n,o,s);Et(t,"conversation.turnCompleted",Wt.createAndMarkAsIssued(u)),At(t,"conversation.turnCompleted",c,l)}a(eTt,"sendTurnTelemetry");function VNc(t,e,r,n,o){let s={lspMethod:t,conversationId:String(e.id),turnId:String(r.id)};return ak(s,"chatMode",n.chatMode),ak(s,"conversationSource",o?.conversationSource),s}a(VNc,"buildGithubTurnTelemetryProperties");function WNc(t,e,r,n,o){let s={lspMethod:t,conversationId:String(e.id),turnId:String(r.id)};ak(s,"modelName",n.modelName),ak(s,"modelProviderName",n.modelProviderName),ak(s,"userRequestedModel",n.userRequestedModel),ak(s,"reasoningEffort",n.reasoningEffort),ak(s,"chatMode",n.chatMode),ak(s,"agentSlug",n.agentSlug),ak(s,"conversationSource",o?.conversationSource);let c={};return ak(c,"billingMultiplier",n.billingMultiplier),ak(c,"credits",o?.credits),ak(c,"totalTimeMs",o?.totalTimeMs),{properties:s,measurements:c}}a(WNc,"buildTurnTelemetryData");function tTt(t){if(t!==void 0)return t%1===0?t.toString():t.toFixed(1)}a(tTt,"formatCredits");function ak(t,e,r){r!==void 0&&(t[e]=r)}a(ak,"assignDefined");var zNc=S.Object({conversationId:S.Optional(mJe),workDoneToken:S.Union([S.String(),S.Number()]),turns:S.Array(zCn,{minItems:1}),capabilities:S.Optional(S.Object({allSkills:S.Optional(S.Boolean()),skills:S.Optional(S.Array(S.String()))})),doc:S.Optional(jC),textDocument:S.Optional(jC),selection:S.Optional(Sf),visibleRanges:S.Optional(zSt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(OO)),source:S.Optional(LO),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),ignoredSkills:S.Optional(S.Array(S.String())),userLanguage:S.Optional(S.String()),model:S.Optional(S.String()),modelProviderName:S.Optional(S.String()),modelInfo:S.Optional(S.Object({id:S.Optional(S.String()),providerName:S.Optional(S.String()),reasoningEffort:S.Optional(S.String()),contextSize:S.Optional(S.Number())})),chatMode:S.Optional(EJe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),todoList:S.Optional(S.Array(_Je)),restoreToTurnId:S.Optional(S.String())});async function YNc(t,e,r){g_e.validate(r.workspaceFolders);let n=await FL(t,r,e),o=await t.get(zo).createOrRestore({...r,restoreToTurnId:r.restoreToTurnId});r.todoList!==void 0&&t.get(m0).setTodos(o,r.todoList);let s=await ZSt(t,r),c=o.turns.length>0?r.turns.slice(-1):r.turns;await KNc(t,o,{...r,turns:c},s.id,n);let l=o.turns[o.turns.length-1],u=m_e(r),d=t.get(wN).add(u.progressToken,e),f=new hw(t,o,l,d),h=await t.get(RN).createProcessor(f,u.progressToken,r.computeSuggestions),m=t.get(Au),g=String(l.id);m.resetTurnCredits(g);let A,y=performance.now();try{await h.process(u,d,void 0,n,s),A=m.getCreditsForTurn(g)}finally{m.resetTurnCredits(g)}let E=Math.round(performance.now()-y),_=XSt(l,s);return eTt(t,"conversation/create",o,l,_,{totalTimeMs:E,credits:A,conversationSource:o.source}),[{conversationId:o.id,turnId:l.id,agentSlug:_.agentSlug,modelName:_.modelName,modelProviderName:_.modelProviderName,billingMultiplier:_.billingMultiplier,modelInfo:r.modelInfo,credits:tTt(A),preciseCredits:A},null]}a(YNc,"handleConversationCreateChecked");async function KNc(t,e,r,n,o){for(let s of r.turns){let c=AJe(s.request),l=new Xf({message:c,type:"user"},s.turnId);s.response&&(l.response={message:s.response,type:"model"}),s.agentSlug&&(l.agent={agentSlug:s.agentSlug});let u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:JSt(u),f=t.get(j_),h=qQ(r.chatMode);l.chatMode=await f.getChatMode(h,r.customChatModeId,d),l.userRequestedModel=s.model??n,l.needToolCallConfirmation=r.needToolCallConfirmation;let m=YSt({textDocument:o,selection:r.selection,visibleRanges:r.visibleRanges});await t.get(zo).addTurn(e.id,l,r.references,m,u,d,r.ignoredSkills,void 0)}}a(KNc,"addTurns");var UGi=Oe(zNc,YNc);p();var JNc=S.Object({conversationId:S.String()});function ZNc(t,e,r){return t.get(zo).destroy(r.conversationId),["OK",null]}a(ZNc,"handleConversationDestroyChecked");var QGi=Oe(JNc,ZNc);p();var XNc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function eMc(t,e,r){return[(await t.get(j_).listChatModes(r.workspaceFolders)).map(c=>({id:c.id,name:c.name,kind:c.kind,isBuiltIn:c.isBuiltIn,uri:c.uri,description:c.description,customTools:c.customTools,model:c.model,handOffs:c.handOffs})),null]}a(eMc,"handleConversationModesChecked");var qGi=Oe(XNc,eMc);p();var tMc=S.Object({turnId:S.String(),acceptedFileCount:S.Number({minimum:0}),totalFileCount:S.Number({minimum:1})}),rMc=new fe("conversationNotifyCodeAcceptance");async function nMc(t,e,r){let n=t.get(zo).findByTurnId(r.turnId);if(!n)return rMc.warn(t,`Turn with id ${r.turnId} not found`),["OK",null];let o=await tl(t,n,{languageId:""});return HS(t,void 0,{mode:n?.turn.getChatModeForTelemetry()??"unknown",modelId:n?.turn.getResolvedModelId()??"unknown"},{acceptedFileCount:r.acceptedFileCount,totalFileCount:r.totalFileCount},`${aE("agentPanel")}.codeAcceptance`,o),["OK",null]}a(nMc,"handleConversationNotifyCodeAcceptanceChecked");var jGi=Oe(tMc,nMc);p();var iMc=S.Object({});function oMc(t,e,r){return[{path:t.get(Yn).directory},null]}a(oMc,"handleConversationPersistenceChecked");var HGi=Oe(iMc,oMc);p();p();var VBr=class{static{a(this,"TokenPreconditionCheck")}async check(e){return await e.get(Ur).resolveSession()?{type:"token",status:"ok"}:{type:"token",status:"failed"}}},WBr=class{static{a(this,"ChatEnabledPreconditionCheck")}async check(e){return{type:"chat_enabled",status:(await e.get(Qt).getToken()).envelope.chat_enabled?"ok":"failed"}}},sMc=[new VBr,new WBr],ck=class{constructor(e,r=sMc){this.ctx=e;this.checks=r;this.emitter=new Wi;this.onChange=this.emitter.event;bs(e,async()=>{await this.check()})}static{a(this,"PreconditionsCheck")}check(e){return e&&(this.result=void 0),this.result===void 0&&(this.result=this.requestChecks()),this.result}async requestChecks(){let e=[];this.checks.length>0&&(e=await Promise.all(this.checks.map(o=>o.check(this.ctx))));let r=e.every(o=>o.status==="ok")?"ok":"failed",n={results:e,status:r};return this.emitter.fire(n),n}};var aMc=S.Object({forceCheck:S.Optional(S.Boolean())});async function cMc(t,e,r){let n=r.forceCheck??!1;return[await t.get(ck).check(n),null]}a(cMc,"handleConversationPreconditionsChecked");var GGi=Oe(aMc,cMc);p();var lMc=S.Object({turnId:S.Optional(S.String()),rating:S.Number(),doc:S.Optional(jC),textDocument:S.Optional(jC),source:S.Optional(LO)});async function uMc(t,e,r){let n=await FL(t,r,e),o=nq(r.source),s="unrated";r.rating>0?s="positive":r.rating<0&&(s="negative");let c=await tl(t,r.turnId?t.get(zo).findByTurnId(r.turnId):void 0,{languageId:n?.detectedLanguageId??""}),l=`${aE(o)}.messageRating`,u=HS(t,n,{rating:s,uiKind:o},{},l,c);return ZI(t,l,u),["OK",null]}a(uMc,"handleConversationRatingChecked");var $Gi=Oe(lMc,uMc);p();var dMc=S.Object({tools:S.Array(YCn)});function fMc(t,e,r){let n=t.get(gs);return r.tools.forEach(s=>{n.registerTool(new Xq({name:s.name,description:s.description,inputSchema:s.inputSchema,confirmationMessages:s.confirmationMessages}))}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(fMc,"conversationRegisterToolsChecked");var VGi=Oe(dMc,fMc);p();var pMc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function hMc(t,e,r){let n=v$t(t).map(u=>({id:u.id,description:u.description,shortDescription:u.shortDescription,scopes:u.scopes,source:"builtin"})),o=t.get(Cg),s=r.workspaceFolders??[],l=(await o.listCustomPrompts(s)).map(u=>({id:u.uri,name:u.name,description:u.description||"",shortDescription:"",scopes:mMc(u.mode),source:"prompt",mode:u.mode,model:u.model}));if(n.push(...l),r.workspaceFolders&&r.workspaceFolders.length>0){let f=(await t.get(h0).listSkills(r.workspaceFolders)).map(h=>({id:`skill:${Ji(uf(h.uri))}`,description:h.description||"",shortDescription:h.name,scopes:["agent-panel"],source:"skill"})).filter(h=>!n.some(m=>m.id===h.id));n.push(...f)}return[n,null]}a(hMc,"handleConversationTemplatesChecked");function mMc(t){let e=t?.trim().toLowerCase();return e==="agent"?["agent-panel"]:e==="ask"||e==="chat"?["chat-panel"]:["chat-panel","agent-panel"]}a(mMc,"getCustomPromptScopes");var WGi=Oe(pMc,hMc);p();var gMc=S.Object({workDoneToken:S.Union([S.String(),S.Number()]),conversationId:mJe,turnId:S.Optional(WK),message:Dqt,followUp:S.Optional(S.Object({id:S.String(),type:S.String()})),doc:S.Optional(jC),textDocument:S.Optional(jC),selection:S.Optional(Sf),visibleRanges:S.Optional(zSt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(OO)),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),ignoredSkills:S.Optional(S.Array(S.String())),confirmationResponse:Myn,model:S.Optional(S.String()),modelProviderName:S.Optional(S.String()),modelInfo:S.Optional(S.Object({id:S.Optional(S.String()),providerName:S.Optional(S.String()),reasoningEffort:S.Optional(S.String()),contextSize:S.Optional(S.Number())})),chatMode:S.Optional(EJe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),agentSlug:S.Optional(S.String()),todoList:S.Optional(S.Array(_Je))});async function AMc(t,e,r){g_e.validate(r.workspaceFolders);let n=await FL(t,r,e),o=t.get(zo),s=o.get(r.conversationId);r.todoList!==void 0&&t.get(m0).setTodos(s,r.todoList);let c=AJe(r.message),l=new Xf({message:c,type:"user"},r.turnId),u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:JSt(u),f=await ZSt(t,r),h=t.get(j_),m=qQ(r.chatMode);l.chatMode=await h.getChatMode(m,r.customChatModeId,d),l.userRequestedModel=f.id,l.needToolCallConfirmation=r.needToolCallConfirmation,r.agentSlug&&(l.agent={agentSlug:r.agentSlug});let g=YSt({textDocument:n,selection:r.selection,visibleRanges:r.visibleRanges});l=await o.addTurn(s.id,l,r.references,g,u,d,r.ignoredSkills,r.confirmationResponse);let A=m_e(r),y=t.get(wN).add(A.progressToken,e),E=new hw(t,s,l,y),_=await t.get(RN).createProcessor(E,A.progressToken,r.computeSuggestions),v=t.get(Au),b=String(l.id);v.resetTurnCredits(b);let T,w=performance.now();try{await _.process(A,y,r.followUp,n,f),T=v.getCreditsForTurn(b)}finally{v.resetTurnCredits(b)}let R=Math.round(performance.now()-w),x=XSt(l,f);return eTt(t,"conversation/turn",s,l,x,{totalTimeMs:R,credits:T,conversationSource:s.source}),[{conversationId:s.id,turnId:l.id,agentSlug:x.agentSlug,modelName:x.modelName,modelProviderName:x.modelProviderName,billingMultiplier:x.billingMultiplier,modelInfo:r.modelInfo,credits:tTt(T),preciseCredits:T},null]}a(AMc,"handleConversationTurnChecked");var zGi=Oe(gMc,AMc);p();var yMc=S.Object({conversationId:S.String(),turnId:S.String(),source:S.Optional(LO)});async function EMc(t,e,r){t.get(zo).deleteTurn(r.conversationId,r.turnId);let o=nq(r.source),s=await tl(t,t.get(zo).findByTurnId(r.turnId),{languageId:""});return HS(t,void 0,{messageId:r.turnId,uiKind:o,conversationId:r.conversationId},{},`${aE(o)}.messageDelete`,s),["OK",null]}a(EMc,"handleConversationTurnDeleteChecked");var YGi=Oe(yMc,EMc);p();var _Mc=S.Object({toolIds:S.Array(S.String())});function vMc(t,e,r){let n=t.get(gs);return r.toolIds.forEach(s=>{n.unregisterTool(s)}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(vMc,"conversationUnregisterToolsChecked");var KGi=Oe(_Mc,vMc);p();var CMc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),tools:S.Array(S.Object({name:S.String(),status:S.Enum(P3)}))});async function bMc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(j_).getChatMode(n?qQ(n):"Agent",o,s),l=t.get(gs),u=r.tools.map(({name:f,status:h})=>({toolName:f,status:h}));return await l.updateToolsStatusByName(c,u),[l.getToolsForModel(c).filter(f=>f.type!=="mcp"),null]}a(bMc,"conversationUpdateToolsStatusChecked");var JGi=Oe(CMc,bMc);p();p();Mo();var SMc=5e3,Rie=class{static{a(this,"ThinkingTitleGenerateService")}buildPrompt(e){let r;return e.extractedTitles&&e.extractedTitles.length>0?r=e.extractedTitles.join(", "):r=(e.thinkingContent??"").substring(0,1e3),`Summarize the following content in a SINGLE sentence (under 10 words) using past tense. Follow these rules strictly: +Si necesita detalles espec\xEDficos de antes de la compactaci\xF3n (como fragmentos de c\xF3digo exactos, mensajes de error o contenido que gener\xF3), lea la transcripci\xF3n completa en: ${e}`},s=n.split("-")[0];return o[n]||o[s]||o.en}};Mo();var ON=class{constructor(e){this.ctx=e}static{a(this,"ConversationSummaryManager")}async generateSummary(e,r,n,o="conversation-other",s){let c=Date.now();try{if(this.sendStartedTelemetry(e,r),n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let u=await up.create(yTt,{ctx:this.ctx,partition:e},r).renderPrompt(void 0,n);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let d=FA.user(o,Nt()),f=ix.createEmptyConfigForTesting(),h;try{h=this.ctx.get(cc)}catch{h=new cc(this.ctx)}let m={messages:u.messages,uiKind:"conversationPanel",llmInteraction:d,modelConfiguration:r,turnId:s},g=await h.fetchResponse(m,n,f,void 0);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";if(g.type==="success"){let A=g.value.trim();return this.sendSuccessTelemetry(e,c,A,r),ot.debug(this.ctx,`Generated partition summary: conversationId=${e.conversationId}, partitionId=${e.partitionId}, length=${A.length}`),A}else{let A="reason"in g?g.reason:"Unknown error";return ot.error(this.ctx,`Failed to generate partition summary: conversationId=${e.conversationId}, partitionId=${e.partitionId}, type=${g.type}, reason=${A}`),this.sendErrorTelemetry(e,c,g.type,r,A),""}}catch(l){let u=l instanceof Error?l.message:String(l);return ot.exception(this.ctx,l,`Error generating partition summary for conversationId=${e.conversationId}, partitionId=${e.partitionId}`),this.sendErrorTelemetry(e,c,"exception",r,u),""}}sendStartedTelemetry(e,r){let n=Vt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:r.modelId},{turnCount:e.turnCount});ft(this.ctx,"partition.summary.started",n,0)}sendSuccessTelemetry(e,r,n,o){let s=Date.now()-r,c=Vt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:o.modelId},{summaryLength:n.length,generationTimeMs:s,turnCount:e.turnCount});ft(this.ctx,"partition.summary.success",c,0)}sendErrorTelemetry(e,r,n,o,s){let c=Date.now()-r,l=Vt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),errorType:n,errorMessage:s||"Unknown error",modelId:o.modelId},{generationTimeMs:c});ft(this.ctx,"partition.summary.error",l,0)}sendCancelledTelemetry(e,r,n){let o=Date.now()-r,s=Vt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:n.modelId},{generationTimeMs:o});ft(this.ctx,"partition.summary.cancelled",s,0)}};var y5c=S.Object({conversationId:S.String()});async function E5c(t,e,r){let{conversationId:n}=r,o=Date.now();ot.debug(t,`Manual compression started for conversation: ${n}`);let s=t.get(RI);_5c(t,n,o);try{if(e.isCancellationRequested)return ot.debug(t,`Manual compression cancelled before start: ${n}`),[_Fe(n,"Compression cancelled"),null];let c=t.get(zo),l;try{l=c.get(n)}catch{return ot.warn(t,`Conversation not found: ${n}`),vFe(t,n,0,"Conversation not found",Date.now()-o),[_Fe(n,`Conversation not found: ${n}`),null]}let u=l.turns.length;if(u===0)return ot.warn(t,`Cannot compress conversation with 0 turns: ${n}`),vFe(t,n,0,"No turns to compress",Date.now()-o),[_Fe(n,`Cannot compress conversation with 0 turns: ${n}`),null];let d=l.turns.filter(v=>v.request.type!=="meta").length;if(l.currentPartitionId>1&&d===0)return ot.warn(t,`Cannot compress - no new turns since last compression: ${n}`),vFe(t,n,l.currentPartitionId,"No new turns since last compression",Date.now()-o),[_Fe(n,`Cannot compress - no new turns since last compression: ${n}`),null];let h=l.turns[l.turns.length-1],m=h?.resolvedModelConfiguration,g=h?.userRequestedModel;if(!m)if(g)m=await t.get(tl).getBestChatModelConfig([g]);else throw new Error("No model available for compression");let A=t.get(ON),y=new gk(A,t),E=l.currentPartitionId;await s.notifyCompressionStarted({conversationId:n,partitionId:E,reason:"manual"});let _=await y.compressCurrentPartition(l,m,e);if(_.success){let v=l.turns[0],b=typeof v?.request?.message=="string"?v.request.message:"",T=Date.now()-o;ot.debug(t,`Manual compression completed: conversationId=${n}, archivedPartitionId=${_.archivedPartitionId}, newPartitionId=${_.newPartitionId}, turnCount=${u}, summaryLength=${b.length}, durationMs=${T}`);let w;try{w=new ej().calculateContextSize(t,l,m)}catch(R){ot.warn(t,`Failed to calculate context size after compression: ${R instanceof Error?R.message:String(R)}`)}return await s.notifyCompressionCompleted({conversationId:n,archivedPartitionId:_.archivedPartitionId,newPartitionId:_.newPartitionId,summaryLength:b.length,turnCount:u,durationMs:T,contextInfo:w}),v5c(t,n,_.archivedPartitionId,_.newPartitionId,u,b.length,T,m.modelId),[{success:!0,conversationId:n,archivedPartitionId:_.archivedPartitionId,newPartitionId:_.newPartitionId,summaryContent:b,summaryLength:b.length,turnCount:u,contextInfo:w},null]}else{let v=_.error||"Compression failed",b=Date.now()-o;return ot.warn(t,`Manual compression failed: conversationId=${n}, error=${v}`),vFe(t,n,_.archivedPartitionId,v,b,m.modelId),[{success:!1,conversationId:n,archivedPartitionId:_.archivedPartitionId,newPartitionId:_.newPartitionId,summaryContent:"",summaryLength:0,turnCount:u,error:v},null]}}catch(c){let l=c instanceof Error?c.message:String(c),u=Date.now()-o;return ot.exception(t,c,`Manual compression error: conversationId=${n}`),vFe(t,n,0,l,u),[_Fe(n,`Compression failed: ${l}`),null]}}a(E5c,"handleConversationCompressChecked");function _Fe(t,e){return{success:!1,conversationId:t,archivedPartitionId:0,newPartitionId:0,summaryContent:"",summaryLength:0,turnCount:0,error:e,contextInfo:void 0}}a(_Fe,"createErrorResult");function _5c(t,e,r,n){let o=Vt.createAndMarkAsIssued({conversationId:e,...n?{modelId:n}:{}},{});ft(t,"conversationPartition.manualCompression.started",o,0)}a(_5c,"sendStartedTelemetry");function v5c(t,e,r,n,o,s,c,l){let u=Vt.createAndMarkAsIssued({conversationId:e,archivedPartitionId:String(r),newPartitionId:String(n),success:"true",...l?{modelId:l}:{}},{turnCount:o,summaryLength:s,durationMs:c});ft(t,"conversationPartition.manualCompression.completed",u,0)}a(v5c,"sendCompletedTelemetry");function vFe(t,e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:e,partitionId:String(r),success:"false",error:n,...s?{modelId:s}:{}},{durationMs:o});ft(t,"conversationPartition.manualCompression.failed",c,0)}a(vFe,"sendFailedTelemetry");var IVi=xe(y5c,E5c);p();p();var _Tt=S.Array(Rf);function vTt(t){if(t.textDocument?.uri)return{uri:t.textDocument.uri,selection:t.selection,visibleRange:t.visibleRanges?.[0]}}a(vTt,"resolveAsActiveEditor");p();var xVi=fe(Fc());var CTt=new xVi.ProgressType,V3r=class{constructor(e){this.progressToken=e;this.tokenBudgetEstimator=new ej}static{a(this,"WorkDoneProgressHandler")}async begin(e,r,n,o){await e.get(Xt).connection.sendProgress(CTt,this.progressToken,{kind:"begin",title:`Conversation ${r.id} Turn ${n.id}`,conversationId:r.id,turnId:n.id,agentSlug:n.agent?.agentSlug,...o})}async report(e,r,n,o){let s=o.contextSize;s||(s=this.calculateContextSize(e,r,n)),await e.get(Xt).connection.sendProgress(CTt,this.progressToken,{kind:"report",conversationId:r.id,turnId:n.id,...o,contextSize:s})}async end(e,r,n,o){await e.get(Xt).connection.sendProgress(CTt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,...o})}async cancel(e,r,n,o){await e.get(Xt).connection.sendProgress(CTt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,cancellationReason:"CancelledByUser",error:o})}calculateContextSize(e,r,n){try{let o=n.resolvedModelConfiguration;return o?this.tokenBudgetEstimator.calculateContextSize(e,r,o):void 0}catch(o){ot.error(e,"Failed to calculate context size",o);return}}};function M_e(t){return new V3r(t.workDoneToken)}a(M_e,"createProgressHandler");p();var wVi=fe(Fc());var O_e=class{static{a(this,"WorkspaceFoldersValidator")}static validate(e){if(!e)return;let r=new Set;for(let n of e){if(r.has(n.uri))throw new wVi.ResponseError(Xe.InvalidParams,`Duplicate workspace folder uri ${n.uri}`);r.add(n.uri)}}};p();function bTt(t){if(t&&t.uri.length>0)return[{uri:t.uri,name:Ki(t.uri)}]}a(bTt,"resolveAsWorkspaceFolders");p();p();var C5c=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),l_=class{constructor(e){this.tokens=[];this.handlers=[];this._isCancelled=!1;this.onCancellationRequested=a((e,r)=>this._isCancelled?C5c(e,r):(this.handlers.push(e.bind(r)),{dispose:a(()=>{},"dispose")}),"onCancellationRequested");this.tokens=e,this._isCancelled=e.some(r=>r.isCancellationRequested),e.forEach(r=>{r.onCancellationRequested(n=>this.cancel(n))})}static{a(this,"MergedToken")}cancel(e){this._isCancelled||(this._isCancelled=!0,this.handlers.forEach(r=>r(e)))}get isCancellationRequested(){return this.tokens.some(e=>e.isCancellationRequested)}};var LN=class{constructor(){this.tokens=new Cn(250)}static{a(this,"ProgressTokens")}add(e,r){let n=new Fn.CancellationTokenSource,o=new l_([r,n.token]);return this.tokens.set(e.toString(),n),o}cancel(e){let r=this.tokens.get(e.toString());r&&(r.cancel(),this.tokens.delete(e.toString()))}};p();p();function RVi(t){if(t?.originalBillingMultiplier===void 0)return;let e=t.autoModeDiscountedCost??0;return Math.round((t.originalBillingMultiplier??0)*(1-e)*100)/100}a(RVi,"calculateBillingMultiplier");async function STt(t,e){let r=e,n=e.modelInfo?.id;if(!n&&r.model&&(n=r.modelProviderName?r.model:await xo.resolveModelIdFromFamily(t,r.model)),!n)throw new Error("A model id is required: provide `modelInfo.id` or the deprecated `model` field.");return{...e.modelInfo,id:n,providerName:e.modelInfo?.providerName??r.modelProviderName}}a(STt,"resolveTurnModelInfo");function TTt(t,e){let r=t.resolvedModelConfiguration;return{modelName:r?.uiName??e.id,modelProviderName:e.providerName,userRequestedModel:e.id,reasoningEffort:e.reasoningEffort,chatMode:t.chatMode?.kind,agentSlug:t.agent?.agentSlug,billingMultiplier:RVi(r)}}a(TTt,"buildTurnSummary");p();function ITt(t,e,r,n,o,s){let{properties:c,measurements:l}=b5c(e,r,n,o,s);ft(t,"conversation.turnCompleted",Vt.createAndMarkAsIssued(c,l)),cr(t,"conversation.turnCompleted",c,l)}a(ITt,"sendTurnTelemetry");function b5c(t,e,r,n,o){let s={lspMethod:t,conversationId:String(e.id),turnId:String(r.id)};HL(s,"modelName",n.modelName),HL(s,"modelProviderName",n.modelProviderName),HL(s,"userRequestedModel",n.userRequestedModel),HL(s,"reasoningEffort",n.reasoningEffort),HL(s,"chatMode",n.chatMode),HL(s,"agentSlug",n.agentSlug),HL(s,"conversationSource",o?.conversationSource);let c={};return HL(c,"billingMultiplier",n.billingMultiplier),HL(c,"credits",o?.credits),HL(c,"totalTimeMs",o?.totalTimeMs),{properties:s,measurements:c}}a(b5c,"buildTurnTelemetryData");function xTt(t){if(t!==void 0)return t%1===0?t.toString():t.toFixed(1)}a(xTt,"formatCredits");function HL(t,e,r){r!==void 0&&(t[e]=r)}a(HL,"assignDefined");var S5c=S.Object({conversationId:S.Optional(HJe),workDoneToken:S.Union([S.String(),S.Number()]),turns:S.Array(S1n,{minItems:1}),capabilities:S.Optional(S.Object({allSkills:S.Optional(S.Boolean()),skills:S.Optional(S.Array(S.String()))})),doc:S.Optional($C),textDocument:S.Optional($C),selection:S.Optional(Rf),visibleRanges:S.Optional(_Tt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(qO)),source:S.Optional(jO),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(qc)),ignoredSkills:S.Optional(S.Array(S.String())),userLanguage:S.Optional(S.String()),model:S.Optional(S.String()),modelProviderName:S.Optional(S.String()),modelInfo:S.Optional(S.Object({id:S.Optional(S.String()),providerName:S.Optional(S.String()),reasoningEffort:S.Optional(S.String()),contextSize:S.Optional(S.Number())})),chatMode:S.Optional(WJe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),todoList:S.Optional(S.Array(zJe)),restoreToTurnId:S.Optional(S.String())});async function T5c(t,e,r){O_e.validate(r.workspaceFolders);let n=await jL(t,r,e),o=await t.get(zo).createOrRestore({...r,restoreToTurnId:r.restoreToTurnId});r.todoList!==void 0&&t.get(y0).setTodos(o,r.todoList);let s=await STt(t,r),c=o.turns.length>0?r.turns.slice(-1):r.turns;await I5c(t,o,{...r,turns:c},s.id,n);let l=o.turns[o.turns.length-1],u=M_e(r),d=t.get(LN).add(u.progressToken,e),f=new Cw(t,o,l,d),h=await t.get(BN).createProcessor(f,u.progressToken,r.computeSuggestions),m=t.get(Eu),g=String(l.id);m.resetTurnCredits(g);let A,y=performance.now();try{await h.process(u,d,void 0,n,s),A=m.getCreditsForTurn(g)}finally{m.resetTurnCredits(g)}let E=Math.round(performance.now()-y),_=TTt(l,s);return ITt(t,"conversation/create",o,l,_,{totalTimeMs:E,credits:A,conversationSource:o.source}),[{conversationId:o.id,turnId:l.id,agentSlug:_.agentSlug,modelName:_.modelName,modelProviderName:_.modelProviderName,billingMultiplier:_.billingMultiplier,modelInfo:r.modelInfo,credits:xTt(A),preciseCredits:A},null]}a(T5c,"handleConversationCreateChecked");async function I5c(t,e,r,n,o){for(let s of r.turns){let c=$Je(s.request),l=new np({message:c,type:"user"},s.turnId);s.response&&(l.response={message:s.response,type:"model"}),s.agentSlug&&(l.agent={agentSlug:s.agentSlug});let u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:bTt(u),f=t.get(V_),h=ZQ(r.chatMode);l.chatMode=await f.getChatMode(h,r.customChatModeId,d),l.userRequestedModel=s.model??n,l.needToolCallConfirmation=r.needToolCallConfirmation;let m=vTt({textDocument:o,selection:r.selection,visibleRanges:r.visibleRanges});await t.get(zo).addTurn(e.id,l,r.references,m,u,d,r.ignoredSkills,void 0)}}a(I5c,"addTurns");var kVi=xe(S5c,T5c);p();var x5c=S.Object({conversationId:S.String()});function w5c(t,e,r){return t.get(zo).destroy(r.conversationId),["OK",null]}a(w5c,"handleConversationDestroyChecked");var PVi=xe(x5c,w5c);p();var R5c=S.Object({workspaceFolders:S.Optional(S.Array(qc))});async function k5c(t,e,r){return[(await t.get(V_).listChatModes(r.workspaceFolders)).map(c=>({id:c.id,name:c.name,kind:c.kind,isBuiltIn:c.isBuiltIn,uri:c.uri,description:c.description,customTools:c.customTools,model:c.model,handOffs:c.handOffs})),null]}a(k5c,"handleConversationModesChecked");var DVi=xe(R5c,k5c);p();var P5c=S.Object({turnId:S.String(),acceptedFileCount:S.Number({minimum:0}),totalFileCount:S.Number({minimum:1})}),D5c=new pe("conversationNotifyCodeAcceptance");async function N5c(t,e,r){let n=t.get(zo).findByTurnId(r.turnId);if(!n)return D5c.warn(t,`Turn with id ${r.turnId} not found`),["OK",null];let o=await rl(t,n,{languageId:""});return KS(t,void 0,{mode:n?.turn.getChatModeForTelemetry()??"unknown",modelId:n?.turn.getResolvedModelId()??"unknown"},{acceptedFileCount:r.acceptedFileCount,totalFileCount:r.totalFileCount},`${fE("agentPanel")}.codeAcceptance`,o),["OK",null]}a(N5c,"handleConversationNotifyCodeAcceptanceChecked");var NVi=xe(P5c,N5c);p();var M5c=S.Object({});function O5c(t,e,r){return[{path:t.get(ti).directory},null]}a(O5c,"handleConversationPersistenceChecked");var MVi=xe(M5c,O5c);p();p();var W3r=class{static{a(this,"TokenPreconditionCheck")}async check(e){return await e.get(Mr).resolveSession()?{type:"token",status:"ok"}:{type:"token",status:"failed"}}},z3r=class{static{a(this,"ChatEnabledPreconditionCheck")}async check(e){return{type:"chat_enabled",status:(await e.get(Ft).getToken()).envelope.chat_enabled?"ok":"failed"}}},L5c=[new W3r,new z3r],Ak=class{constructor(e,r=L5c){this.ctx=e;this.checks=r;this.emitter=new Vi;this.onChange=this.emitter.event;vs(e,async()=>{await this.check()})}static{a(this,"PreconditionsCheck")}check(e){return e&&(this.result=void 0),this.result===void 0&&(this.result=this.requestChecks()),this.result}async requestChecks(){let e=[];this.checks.length>0&&(e=await Promise.all(this.checks.map(o=>o.check(this.ctx))));let r=e.every(o=>o.status==="ok")?"ok":"failed",n={results:e,status:r};return this.emitter.fire(n),n}};var B5c=S.Object({forceCheck:S.Optional(S.Boolean())});async function F5c(t,e,r){let n=r.forceCheck??!1;return[await t.get(Ak).check(n),null]}a(F5c,"handleConversationPreconditionsChecked");var OVi=xe(B5c,F5c);p();var U5c=S.Object({turnId:S.Optional(S.String()),rating:S.Number(),doc:S.Optional($C),textDocument:S.Optional($C),source:S.Optional(jO)});async function Q5c(t,e,r){let n=await jL(t,r,e),o=gq(r.source),s="unrated";r.rating>0?s="positive":r.rating<0&&(s="negative");let c=await rl(t,r.turnId?t.get(zo).findByTurnId(r.turnId):void 0,{languageId:n?.detectedLanguageId??""}),l=`${fE(o)}.messageRating`,u=KS(t,n,{rating:s,uiKind:o},{},l,c);return ox(t,l,u),["OK",null]}a(Q5c,"handleConversationRatingChecked");var LVi=xe(U5c,Q5c);p();var q5c=S.Object({tools:S.Array(T1n)});function j5c(t,e,r){let n=t.get(hs);return r.tools.forEach(s=>{n.registerTool(new fj({name:s.name,description:s.description,inputSchema:s.inputSchema,confirmationMessages:s.confirmationMessages}))}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(j5c,"conversationRegisterToolsChecked");var BVi=xe(q5c,j5c);p();var H5c=S.Object({workspaceFolders:S.Optional(S.Array(qc)),providers:S.Optional(S.Array(S.Enum(M3)))});async function G5c(t,e,r){let n=r.providers?.length?r.providers:void 0,o=n?.includes("BACKGROUND")===!0,s=a(h=>n===void 0||h.providers.some(m=>n.includes(m)),"appliesToRequest"),c=pVt(t).map(h=>({id:h.id,description:h.description,shortDescription:h.shortDescription,scopes:h.scopes,source:"builtin",providers:["LOCAL"]})).filter(s),l=t.get(Ig),u=r.workspaceFolders??[],f=(await l.listCustomPrompts(u,{includePlugins:o})).map(h=>{let m=h.pluginUri!==void 0;return{id:h.uri,name:h.name,description:h.description||"",shortDescription:"",scopes:m?["agent-panel"]:$5c(h.mode),source:"prompt",mode:h.mode,model:h.model,providers:$S(m,h.providers)}}).filter(s);if(c.push(...f),r.workspaceFolders&&r.workspaceFolders.length>0){let g=(await t.get(A0).listSkills(r.workspaceFolders,{includePlugins:o})).map(A=>({id:`skill:${Ki(mf(A.uri))}`,description:A.description||"",shortDescription:A.name,scopes:["agent-panel"],source:"skill",providers:$S(A.pluginUri!==void 0,A.providers)})).filter(s).filter(A=>!c.some(y=>y.id===A.id));c.push(...g)}return[c,null]}a(G5c,"handleConversationTemplatesChecked");function $5c(t){let e=t?.trim().toLowerCase();return e==="agent"?["agent-panel"]:e==="ask"||e==="chat"?["chat-panel"]:["chat-panel","agent-panel"]}a($5c,"getCustomPromptScopes");var FVi=xe(H5c,G5c);p();var V5c=S.Object({workDoneToken:S.Union([S.String(),S.Number()]),conversationId:HJe,turnId:S.Optional(nJ),message:Sjt,followUp:S.Optional(S.Object({id:S.String(),type:S.String()})),doc:S.Optional($C),textDocument:S.Optional($C),selection:S.Optional(Rf),visibleRanges:S.Optional(_Tt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(qO)),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(qc)),ignoredSkills:S.Optional(S.Array(S.String())),confirmationResponse:u_n,model:S.Optional(S.String()),modelProviderName:S.Optional(S.String()),modelInfo:S.Optional(S.Object({id:S.Optional(S.String()),providerName:S.Optional(S.String()),reasoningEffort:S.Optional(S.String()),contextSize:S.Optional(S.Number())})),chatMode:S.Optional(WJe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),agentSlug:S.Optional(S.String()),todoList:S.Optional(S.Array(zJe))});async function W5c(t,e,r){O_e.validate(r.workspaceFolders);let n=await jL(t,r,e),o=t.get(zo),s=o.get(r.conversationId);r.todoList!==void 0&&t.get(y0).setTodos(s,r.todoList);let c=$Je(r.message),l=new np({message:c,type:"user"},r.turnId),u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:bTt(u),f=await STt(t,r),h=t.get(V_),m=ZQ(r.chatMode);l.chatMode=await h.getChatMode(m,r.customChatModeId,d),l.userRequestedModel=f.id,l.needToolCallConfirmation=r.needToolCallConfirmation,r.agentSlug&&(l.agent={agentSlug:r.agentSlug});let g=vTt({textDocument:n,selection:r.selection,visibleRanges:r.visibleRanges});l=await o.addTurn(s.id,l,r.references,g,u,d,r.ignoredSkills,r.confirmationResponse);let A=M_e(r),y=t.get(LN).add(A.progressToken,e),E=new Cw(t,s,l,y),_=await t.get(BN).createProcessor(E,A.progressToken,r.computeSuggestions),v=t.get(Eu),b=String(l.id);v.resetTurnCredits(b);let T,w=performance.now();try{await _.process(A,y,r.followUp,n,f),T=v.getCreditsForTurn(b)}finally{v.resetTurnCredits(b)}let R=Math.round(performance.now()-w),x=TTt(l,f);return ITt(t,"conversation/turn",s,l,x,{totalTimeMs:R,credits:T,conversationSource:s.source}),[{conversationId:s.id,turnId:l.id,agentSlug:x.agentSlug,modelName:x.modelName,modelProviderName:x.modelProviderName,billingMultiplier:x.billingMultiplier,modelInfo:r.modelInfo,credits:xTt(T),preciseCredits:T},null]}a(W5c,"handleConversationTurnChecked");var UVi=xe(V5c,W5c);p();var z5c=S.Object({conversationId:S.String(),turnId:S.String(),source:S.Optional(jO)});async function Y5c(t,e,r){t.get(zo).deleteTurn(r.conversationId,r.turnId);let o=gq(r.source),s=await rl(t,t.get(zo).findByTurnId(r.turnId),{languageId:""});return KS(t,void 0,{messageId:r.turnId,uiKind:o,conversationId:r.conversationId},{},`${fE(o)}.messageDelete`,s),["OK",null]}a(Y5c,"handleConversationTurnDeleteChecked");var QVi=xe(z5c,Y5c);p();var K5c=S.Object({toolIds:S.Array(S.String())});function J5c(t,e,r){let n=t.get(hs);return r.toolIds.forEach(s=>{n.unregisterTool(s)}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(J5c,"conversationUnregisterToolsChecked");var qVi=xe(K5c,J5c);p();var Z5c=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(qc)),tools:S.Array(S.Object({name:S.String(),status:S.Enum(U3)}))});async function X5c(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(V_).getChatMode(n?ZQ(n):"Agent",o,s),l=t.get(hs),u=r.tools.map(({name:f,status:h})=>({toolName:f,status:h}));return await l.updateToolsStatusByName(c,u),[l.getToolsForModel(c).filter(f=>f.type!=="mcp"),null]}a(X5c,"conversationUpdateToolsStatusChecked");var jVi=xe(Z5c,X5c);p();p();Mo();var e4c=5e3,Fie=class{static{a(this,"ThinkingTitleGenerateService")}buildPrompt(e){let r;return e.extractedTitles&&e.extractedTitles.length>0?r=e.extractedTitles.join(", "):r=(e.thinkingContent??"").substring(0,1e3),`Summarize the following content in a SINGLE sentence (under 10 words) using past tense. Follow these rules strictly: OUTPUT FORMAT: - MUST be a single sentence @@ -4047,45 +4101,16 @@ EXAMPLES WITH RAW THINKING TEXT: - "The error seems to be coming from the database connection..." \u2192 "Investigated database connection issue" - "Looking at the UserService class, I see it handles..." \u2192 "Reviewed UserService implementation" -Content: ${r}`}async generateTitle(e,r,n){let o=new Fn.CancellationTokenSource,s=setTimeout(()=>o.cancel(),SMc),c=r.onCancellationRequested(()=>o.cancel());try{let l=new oc(e),u=await xo.getModelConfiguration(e,"suggestions"),d=[{role:"user",content:this.buildPrompt(n)}],f=await e.get(Qt).getToken(),h=await e.get(Zt).updateExPValuesAndAssignments(f),m=await l.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:OA.user("conversation-panel",Mt())},o.token,h);if(m.type!=="success"){let A="reason"in m?m.reason:"unknown";this.reportFailure(e,m.type,A);return}let g=m.value.trim();if(g.includes("can't assist with that")){this.reportFailure(e,"refused","model refused to assist");return}return g}catch(l){let u=l instanceof Error?l.message:String(l);this.reportFailure(e,"exception",u);return}finally{clearTimeout(s),c.dispose(),o.dispose()}}reportFailure(e,r,n){let o=n.replace(/\n/g," ").substring(0,360);ot.debug(e,`Failed to generate thinking title: errorType='${r}', reason: ${o}`),At(e,"thinkingTitle.generateFailed",{errorType:r,errorMessage:o})}};var TMc=S.Object({thinkingContent:S.Optional(S.String()),extractedTitles:S.Optional(S.Array(S.String()))});async function IMc(t,e,r){if(!r.thinkingContent&&(!r.extractedTitles||r.extractedTitles.length===0))return[null,{code:Ze.InvalidRequest,message:"No thinking content or extracted titles provided"}];if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let o=await t.get(Rie).generateTitle(t,e,{thinkingContent:r.thinkingContent,extractedTitles:r.extractedTitles});return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}]:o?[{title:o},null]:[null,{code:Ze.InternalError,message:"Failed to generate thinking title"}]}a(IMc,"handleThinkingTitleGenerateChecked");var ZGi=Oe(TMc,IMc);p();p();p();var rTt=/```suggestion(\u0020*(\r\n|\n))((?[\s\S]*?)(\r\n|\n))?```/g;var A_e=class t{static{a(this,"CodeReviewResponseParser")}static findFirstNonWhitespaceCharacterIndex(e){let r=e.match(/\S/);return r?r.index:e.length}static removeSuggestion(e){return e.replaceAll(rTt,"")}static extractSuggestionAndText(e){rTt.lastIndex=0;let n=rTt.exec(e)?.groups?.suggestion||null,o=t.removeSuggestion(e);return{suggestion:n,textWithoutSuggestion:o}}static ghCommentToReviewComment(e,r){let n=r.headContent.split(` +Content: ${r}`}async generateTitle(e,r,n){let o=new Fn.CancellationTokenSource,s=setTimeout(()=>o.cancel(),e4c),c=r.onCancellationRequested(()=>o.cancel());try{let l=new cc(e),u=await xo.getModelConfiguration(e,"suggestions"),d=[{role:"user",content:this.buildPrompt(n)}],f=await e.get(Ft).getToken(),h=await e.get(Jt).updateExPValuesAndAssignments(f),m=await l.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:FA.user("conversation-panel",Nt())},o.token,h);if(m.type!=="success"){let A="reason"in m?m.reason:"unknown";this.reportFailure(e,m.type,A);return}let g=m.value.trim();if(g.includes("can't assist with that")){this.reportFailure(e,"refused","model refused to assist");return}return g}catch(l){let u=l instanceof Error?l.message:String(l);this.reportFailure(e,"exception",u);return}finally{clearTimeout(s),c.dispose(),o.dispose()}}reportFailure(e,r,n){let o=n.replace(/\n/g," ").substring(0,360);ot.debug(e,`Failed to generate thinking title: errorType='${r}', reason: ${o}`),jl(e,"thinkingTitle.generateFailed",{errorType:r,errorMessage:o})}};var t4c=S.Object({thinkingContent:S.Optional(S.String()),extractedTitles:S.Optional(S.Array(S.String()))});async function r4c(t,e,r){if(!r.thinkingContent&&(!r.extractedTitles||r.extractedTitles.length===0))return[null,{code:Xe.InvalidRequest,message:"No thinking content or extracted titles provided"}];if(e.isCancellationRequested)return[null,{code:Xe.RequestCancelled,message:"Request was cancelled"}];let o=await t.get(Fie).generateTitle(t,e,{thinkingContent:r.thinkingContent,extractedTitles:r.extractedTitles});return e.isCancellationRequested?[null,{code:Xe.RequestCancelled,message:"Request was cancelled"}]:o?[{title:o},null]:[null,{code:Xe.InternalError,message:"Failed to generate thinking title"}]}a(r4c,"handleThinkingTitleGenerateChecked");var HVi=xe(t4c,r4c);p();p();p();var wTt=/```suggestion(\u0020*(\r\n|\n))((?[\s\S]*?)(\r\n|\n))?```/g;var L_e=class t{static{a(this,"CodeReviewResponseParser")}static findFirstNonWhitespaceCharacterIndex(e){let r=e.match(/\S/);return r?r.index:e.length}static removeSuggestion(e){return e.replaceAll(wTt,"")}static extractSuggestionAndText(e){wTt.lastIndex=0;let n=wTt.exec(e)?.groups?.suggestion||null,o=t.removeSuggestion(e);return{suggestion:n,textWithoutSuggestion:o}}static ghCommentToReviewComment(e,r){let n=r.headContent.split(` `),o=n[e.data.line-1],s=e.data.start_line?e.data.start_line-1:e.data.line-1,c=n[s],l=o.trimEnd().length,u={start:{line:e.data.start_line?e.data.start_line+r.startLineOffset-1:e.data.line+r.startLineOffset-1,character:t.findFirstNonWhitespaceCharacterIndex(c)},end:{line:e.data.line+r.startLineOffset-1,character:l}},d=e.data.body,{suggestion:f,textWithoutSuggestion:h}=t.extractSuggestionAndText(d);return{uri:r.uri,range:u,message:h,kind:e.data.problem_type,severity:"medium",suggestion:f}}static parseLine(e){if(e==="data: [DONE]")return[];if(e==="")return[];let r=JSON.parse(e.replace("data: ",""));return Array.isArray(r.copilot_references)&&r.copilot_references.length>0?r.copilot_references.filter(n=>n.type):[]}static parseReviewResponse(e,r){let n=e.split(` -`),o=[];for(let s of n){let c=t.parseLine(s);for(let l of c.filter(u=>u.type==="github.generated-pull-request-comment")){if(l.data.side!=="RIGHT")continue;let u=r.find(f=>f.path===l.data.path);if(!u)continue;let d=t.ghCommentToReviewComment(l,u);o.push(d)}}return o}};p();p();var nTt=require("path");var y_e=class t{constructor(e,r){this.ctx=e;this.workspaceFolders=r}static{a(this,"BaseReviewProvider")}static{this.DEFAULT_TIMEOUT=120*1e3}static{this.CODING_GUIDELINES_START_INDEX=2}static{this.CODE_REVIEW_ENDPOINT_SERVICE="api"}static{this.CODE_REVIEW_ENDPOINT_PATH="agents/github-code-review"}static{this.CODE_REVIEW_MODE_HEADER="X-Copilot-Code-Review-Mode"}static{this.CODE_REVIEW_MODE_VALUE="ide"}static{this.COPILOT_INTEGRATION_ID_HEADER="Copilot-Integration-Id"}static{this.GITHUB_CODING_GUIDELINE="github.coding_guideline"}static{this.CODING_GUIDELINE="coding-guideline"}static{this.UI_KIND="codeReview"}async fetchCodeReview(e,r){let n=await this.ctx.get(Qt).getToken(),o=tx(this.ctx,n,t.CODE_REVIEW_ENDPOINT_SERVICE,t.CODE_REVIEW_ENDPOINT_PATH),c=i0(this.ctx)[t.COPILOT_INTEGRATION_ID_HEADER];this.telemetryTracker.telemetrySent();let l=yl();try{return await HW(this.ctx,o,n.token,void 0,this.telemetryTracker.headerRequestId,e,r,{[t.CODE_REVIEW_MODE_HEADER]:t.CODE_REVIEW_MODE_VALUE,[t.COPILOT_INTEGRATION_ID_HEADER]:c},t.DEFAULT_TIMEOUT).then(d=>{let f=M3(d);this.telemetryTracker.telemetryData.extendWithRequestId(f);let h=yl()-l;return this.telemetryTracker.telemetryData.measurements.totalTimeMs=h,this.telemetryTracker.telemetryResponse(),(d.status===401||d.status===403)&&this.ctx.get(Qt).resetToken("code_review_fetch",d.status),d}).catch(d=>{if(Gm(d))throw d;let f=yl()-l;throw this.telemetryTracker.telemetryData.measurements.totalTimeMs=f,this.telemetryTracker.telemetryError(d),d})}finally{tYe(this.ctx).catch(()=>{})}}getCodingGuidelineName(e){return(0,nTt.basename)(e,(0,nTt.extname)(e))}async buildCodingGuideline(e){return!this.workspaceFolders||this.workspaceFolders.length===0?[]:(await this.ctx.get(bf).collectAllInstructions(this.ctx,this.workspaceFolders.map(o=>({uri:o.uri})),{includeCopilotInstructions:!0,includeCustomInstructionFiles:!0},e)).map((o,s)=>({type:"github.coding_guideline",id:(s+t.CODING_GUIDELINES_START_INDEX).toString(),data:{id:s+t.CODING_GUIDELINES_START_INDEX,type:"coding-guideline",name:o.description??this.getCodingGuidelineName(o.uri),description:o.content,filePatterns:o.applyTo?[o.applyTo]:[]}}))}};p();Mo();var E_e=class t{constructor(e,r={}){this.ctx=e;this.id=Mt(),this.telemetryData=t.createTelemetryData(this.id).extendedBy(r)}static{a(this,"CopilotCodeReviewTelemetry")}static createTelemetryData(e){let r={headerRequestId:e};return Wt.createAndMarkAsIssued(r)}telemetrySent(){Et(this.ctx,"request.sent",this.telemetryData),At(this.ctx,"request.sent",this.telemetryData.properties,this.telemetryData.measurements)}telemetryResponse(){Et(this.ctx,"request.response",this.telemetryData),At(this.ctx,"request.response",this.telemetryData.properties,this.telemetryData.measurements)}telemetryError(e){this.telemetryData.properties.message=String(Wh(e,"name")??""),this.telemetryData.properties.code=String(Wh(e,"code")??""),this.telemetryData.properties.errno=String(Wh(e,"errno")??""),this.telemetryData.properties.type=String(Wh(e,"type")??""),Et(this.ctx,"request.error",this.telemetryData),At(this.ctx,"request.error",this.telemetryData.properties,this.telemetryData.measurements)}get headerRequestId(){return this.id}};var iTt=class t extends y_e{constructor(r,n,o){super(r,o);this.changes=n;this.name="ReviewChangesProvider";this.telemetryTracker=new E_e(r,{mode:"reviewChanges",uiKind:t.UI_KIND})}static{a(this,"ReviewChangesProvider")}async fetchCodeReview(r,n){return super.fetchCodeReview(r,n)}async changesToReference(){let r=this.ctx.get(nc),n=[],o=await Promise.allSettled(this.changes.map(s=>r.evaluate(s.uri,s.headContent)));for(let s=0;s({path:s.path,content:s.headContent})),baseFileContents:n.map(s=>({path:s.path,content:s.baseContent}))}}}async buildCodingGuideline(){return super.buildCodingGuideline(this.changes.map(r=>r.uri))}async createReviewRequest(){return{messages:[{role:"user",copilot_references:[await this.changesToReference(),...await this.buildCodingGuideline()]}]}}};var xMc=S.Object({uri:S.String(),path:S.String(),baseContent:S.String(),headContent:S.String()}),wMc=S.Object({changes:S.Array(xMc),workspaceFolders:S.Optional(S.Array(Bc))}),Z3e;async function RMc(t,e,r){Z3e&&(Z3e.cancel(),Z3e.dispose()),Z3e=new Fn.CancellationTokenSource;let n=new i_([e,Z3e.token]),o=new iTt(t,r.changes,r.workspaceFolders);if(!(await t.get(Qt).getToken()).isCopilotCodeReviewEnabled)return[null,{code:Ze.InternalError,message:"GitHub Copilot Code Review is not enabled."}];let c=await o.createReviewRequest(),l=await o.fetchCodeReview(c,n),u=await l.text();if(!l.ok)return l.status===402?[null,{code:l.status,message:"You have reached your GitHub Copilot Code Review quota limit."}]:(Nr.error(t,`Code review request failed: ${l.status}. Response: ${u}`),[null,{code:Ze.InternalError,message:"Failed to generate code review."}]);let d=r.changes.map(h=>({uri:h.uri,path:h.path,headContent:h.headContent,startLineOffset:0}));return[{comments:A_e.parseReviewResponse(u,d)},null]}a(RMc,"handleCopilotCodeReviewReviewChangesChecked");var XGi=Oe(wMc,RMc);p();p();var oTt=class t extends y_e{constructor(r,n){super(r,n);this.name="ReviewSnippetsProvider";this.telemetryTracker=new E_e(r,{mode:"reviewSnippets",uiKind:t.UI_KIND})}static{a(this,"ReviewSnippetsProvider")}static{this.SNIPPET_REVIEW_TYPE="snippet"}async fetchCodeReview(r,n){return super.fetchCodeReview(r,n)}async buildCodingGuideline(r){return super.buildCodingGuideline(r)}snippetsToReference(r){return{type:"github.pull_request",id:"1",data:{type:"pull-request",headFileContents:r.map(n=>({path:n.path,content:n.content})),baseFileContents:[]}}}static snippetsToSnippetFile(r){let n=r[0];return n?.startLine!==void 0&&n?.endLine!==void 0?{path:n.path,start_line:n.startLine,end_line:n.endLine}:void 0}async createReviewRequest(r){let n=this.ctx.get(nc),o=await Promise.allSettled(r.map(u=>n.evaluate(u.uri,u.content))),s=[];for(let u=0;uu.uri),l=await this.buildCodingGuideline(c);return{messages:[{role:"user",review_type:t.SNIPPET_REVIEW_TYPE,copilot_references:[this.snippetsToReference(s),...l],snippet_file:t.snippetsToSnippetFile(s)}]}}};var kMc=S.Object({uri:S.String(),path:S.String(),content:S.String(),startLine:S.Number(),endLine:S.Number()}),PMc=S.Object({snippets:S.Array(kMc),workspaceFolders:S.Optional(S.Array(Bc))}),X3e;async function DMc(t,e,r){X3e&&(X3e.cancel(),X3e.dispose()),X3e=new Fn.CancellationTokenSource;let n=new i_([e,X3e.token]),o=new oTt(t,r.workspaceFolders);if(!(await t.get(Qt).getToken()).isCopilotCodeReviewEnabled)return[null,{code:Ze.InternalError,message:"GitHub Copilot Code Review is not enabled."}];let c=await o.createReviewRequest(r.snippets),l=await o.fetchCodeReview(c,n);if(!l.ok)return l.status===402?[null,{code:l.status,message:"You have reached your GitHub Copilot Code Review quota limit."}]:[null,{code:Ze.InternalError,message:"Failed to generate code review."}];let u=await l.text(),d=r.snippets.map(h=>({uri:h.uri,path:h.path,headContent:h.content,startLineOffset:h.startLine-1}));return[{comments:A_e.parseReviewResponse(u,d)},null]}a(DMc,"handleCopilotCodeReviewReviewSnippetsChecked");var e$i=Oe(PMc,DMc);p();p();var sTt=Symbol("onMCPToolsListChanged"),aTt=Symbol("onMCPResourcesListChanged"),cTt=Symbol("onMCPPromptsListChanged"),t$i=Symbol("onMCPResourceUpdated"),FV=Symbol("onMCPCacheUpdated");function eFe(t){let e={};for(let[r,n]of Object.entries(t)){if(n===null||typeof n!="object"||!("url"in n)||n.headers===void 0){e[r]=n;continue}let{headers:o,...s}=n;e[r]={...s,requestInit:{...s.requestInit,headers:{...o,...s.requestInit?.headers}}}}return e}a(eFe,"normalizeMcpHeaders");var o_=class{static{a(this,"McpManager")}};var NMc=S.Object({}),MMc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc)),servers:S.Array(S.Object({name:S.String(),tools:S.Array(S.Object({name:S.String(),status:S.Enum(P3)}))}))}),OMc=S.Object({serverName:S.String(),promptName:S.String(),arguments:S.Optional(S.Record(S.String(),S.String()))}),LMc=S.Object({serverName:S.String(),promptName:S.String(),argumentName:S.String(),prefix:S.String(),alreadyResolved:S.Optional(S.Record(S.String(),S.String()))}),BMc=S.Object({serverName:S.String(),uri:S.String()}),FMc=S.Object({serverName:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});function UMc(t,e,r){return[t.get(o_).getAllContents(),null]}a(UMc,"handleGetMCPContentsChecked");async function QMc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(j_).getChatMode(n?qQ(n):"Agent",o,s),l=r.servers.flatMap(({name:d,tools:f})=>f.map(({name:h,status:m})=>({serverName:d,toolName:h,status:m})));return await t.get(o_).updateMCPToolsStatus(c,l),[t.get(o_).getAllContents(c),null]}a(QMc,"handleUpdateMCPToolsStatusChecked");async function qMc(t,e,r){return[await t.get(o_).readResource(r.serverName,r.uri),null]}a(qMc,"handleReadResourceChecked");async function jMc(t,e,r){let{serverName:n,promptName:o,arguments:s={}}=r;return[await t.get(o_).getPrompt(n,o,s),null]}a(jMc,"handleGetPromptChecked");async function HMc(t,e,r){let{serverName:n,promptName:o,argumentName:s,prefix:c,alreadyResolved:l={}}=r;return[await t.get(o_).completePrompt(n,o,s,c,l),null]}a(HMc,"handleCompletePromptChecked");async function GMc(t,e,r){let n=t.get(o_),{serverName:o,action:s}=r;switch(s){case"start":await n.startMCPServer(o);break;case"stop":await n.stopMCPServer(o);break;case"restart":await n.restartMCPServer(o);break;case"logout":await n.logoutMCPServer(o);break;case"clearOAuth":await n.clearOAuthMCPServer(o);break}return[null,null]}a(GMc,"handleMCPServerActionChecked");var r$i=Oe(NMc,UMc),n$i=Oe(MMc,QMc),i$i=Oe(BMc,qMc),o$i=Oe(OMc,jMc),s$i=Oe(LMc,HMc),a$i=Oe(FMc,GMc);p();var $Mc=S.Object({});async function VMc(t,e,r){let n=await t.get(Qt).getToken();return[KMc(t,await t.get(xs).getMetadata(),n),null]}a(VMc,"handleCopilotModelsChecked");function WMc(t){return(t.capabilities.supports?.reasoning_effort?.length??0)<=1?!1:t.supported_endpoints?.includes(x$e.Messages)?t.capabilities.supports?.adaptive_thinking===!0:!0}a(WMc,"supportReasoningEffortLevel");function zMc(t){if(t.capabilities.type==="chat"){let e=["chat-panel","inline"];return!sle.has(t.capabilities.family)&&t.capabilities.supports?.tool_calls&&(t.capabilities.limits?.max_prompt_tokens??0)>4e4&&e.push("agent-panel"),e}else if(t.capabilities.type==="completion")return["completion"];return[]}a(zMc,"getModelScopes");function YMc(t){return t.capabilities.type==="completion"?!0:t.model_picker_enabled===!0}a(YMc,"shouldExposeModel");function KMc(t,e,r){let n=[];return e.forEach(o=>{YMc(o)&&n.push({modelFamily:o.capabilities.family,modelName:o.name,modelPolicy:o.policy,scopes:zMc(o),id:o.id,vendor:o.vendor,preview:o.preview??!1,isChatDefault:o.is_chat_default??!1,isChatFallback:o.is_chat_fallback??!1,capabilities:{supports:{vision:o.capabilities.supports?.vision??!1,reasoningEfforts:o.capabilities.supports?.reasoning_effort,supportsReasoningEffortLevel:WMc(o)},limits:o.capabilities.limits?{maxContextWindowTokens:o.capabilities.limits.max_context_window_tokens,maxOutputTokens:o.capabilities.limits.max_output_tokens,maxInputTokens:o.capabilities.limits.max_prompt_tokens,maxNonStreamingOutputTokens:o.capabilities.limits.max_non_streaming_output_tokens}:void 0},billing:o.billing?{isPremium:o.billing?.is_premium??!0,multiplier:o.billing?.multiplier??0,tokenBasedBillingEnabled:r.userInfo?.isTBBEnabled,tokenPrices:o.billing?.token_prices?{batchSize:o.billing.token_prices.batch_size,default:o.billing.token_prices.default?{cachePrice:o.billing.token_prices.default.cache_price,inputPrice:o.billing.token_prices.default.input_price,outputPrice:o.billing.token_prices.default.output_price,maxContext:o.billing.token_prices.default.context_max}:void 0,longContext:o.billing.token_prices.long_context?{cachePrice:o.billing.token_prices.long_context.cache_price,inputPrice:o.billing.token_prices.long_context.input_price,outputPrice:o.billing.token_prices.long_context.output_price,maxContext:o.billing.token_prices.long_context.context_max}:void 0}:void 0}:void 0,customModel:o.custom_model?{keyName:o.custom_model.key_name,ownerName:o.custom_model.owner_name,ownerType:o.custom_model.owner_type,provider:o.custom_model.provider}:void 0,degradationReason:xun(o),modelPickerCategory:o.model_picker_category,modelPickerPriceCategory:o.model_picker_price_category})}),t.get(jl).getPolicyValue("autoModel.enabled")!==!1&&n.push({modelFamily:V_,modelName:oKe,modelPolicy:void 0,scopes:["inline","chat-panel","agent-panel"],id:V_,preview:!1,isChatDefault:!1,isChatFallback:!1,capabilities:{supports:{vision:!0,supportsReasoningEffortLevel:!1}},billing:void 0,degradationReason:void 0}),n}a(KMc,"filterModels");var c$i=Oe($Mc,VMc);p();var JMc=S.Object({});async function ZMc(t,e,r){let{models:n,xGithubRequestId:o}=await t.get(xs).getModelMetadataList();return[{models:n,xGithubRequestId:o},null]}a(ZMc,"handleCopilotModelsGetModelMetadataListChecked");var l$i=Oe(JMc,ZMc);p();var XMc=S.Object({model:S.Optional(S.String()),status:S.Optional(S.String())});async function eOc(t,e,r){return r.model&&r.status==="enabled"?await t.get(xs).acceptModelPolicy(r.model)?["OK",null]:[null,{code:Ze.InternalError,message:"Failed to accept model policy"}]:[null,{code:Ze.InvalidRequest,message:"Invalid model or status"}]}a(eOc,"handleCopilotModelsPolicyChecked");var u$i=Oe(XMc,eOc);p();p();p();p();Mo();function tOc(t,e){let r=e,n=t.lineAt(e.line);return n.isEmptyOrWhitespace||(r=n.range.end),r}a(tOc,"panelPositionForDocument");async function*d$i(t){for await(let e of t){let r={...e};r.completionText=r.completionText.trimEnd(),yield r}}a(d$i,"trimChoices");var __e=class{constructor(e,r,n,o){this.textDocument=e;this.startPosition=r;this.cancellationToken=n;this.solutionCountTarget=o;this.targetPosition=tOc(this.textDocument,this.startPosition)}static{a(this,"SolutionManager")}get savedTelemetryData(){return this._savedTelemetryData}set savedTelemetryData(e){this._savedTelemetryData=e}};async function zBr(t,e){let r=await t;switch(r.status){case"Solution":await e.onSolution(r.solution),await zBr(r.next,e);break;case"FinishedNormally":await e.onFinishedNormally();break;case"FinishedWithError":await e.onFinishedWithError(r.error);break}}a(zBr,"reportSolutions");async function YBr(t,e){if(t.isCancellationRequested)return{status:"FinishedWithError",error:"Cancelled"};let r=await e.next();return r.done===!0?{status:"FinishedNormally"}:{status:"Solution",solution:r.value,next:YBr(t,e)}}a(YBr,"generateSolutionsStream");function lTt(t){return t.replace(/\s+/g,"")}a(lTt,"normalizeCompletionText");async function f$i(t,e,r,n,o,s){let c=e.targetPosition,l=e.textDocument,u=gQ(t,l.uri),d=Mt(),f=Wt.createAndMarkAsIssued({headerRequestId:d,languageId:l.detectedLanguageId,source:r},{});e.savedTelemetryData=await t.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments({uri:l.uri,languageId:l.detectedLanguageId},f),o&&(e.savedTelemetryData=e.savedTelemetryData.extendedBy({engineName:o})),s&&(e.savedTelemetryData=e.savedTelemetryData.extendedBy({comparisonRequestId:s}));let h=await Rme(t,d,pee(l,c),e.savedTelemetryData);if(h.type==="copilotContentExclusion")return{status:"FinishedNormally"};if(h.type==="contextTooShort")return{status:"FinishedWithError",error:"Context too short"};if(h.type==="promptCancelled")return{status:"FinishedWithError",error:"Prompt cancelled"};if(h.type==="promptTimeout")return{status:"FinishedWithError",error:"Prompt timeout"};if(h.type==="promptError")return{status:"FinishedWithError",error:"Prompt error"};let m=h.prompt,g=h.trailingWs;return g.length>0&&(e.startPosition=gu.position(e.startPosition.line,e.startPosition.character-g.length)),e.savedTelemetryData=e.savedTelemetryData.extendedBy({},{...Ese(m),solutionCount:e.solutionCountTarget,promptEndPos:l.offsetAt(c)}),n.debug(t,"prompt:",m),Et(t,"solution.requested",e.savedTelemetryData),{prompt:m,trailingWs:g,telemetryData:e.savedTelemetryData,repoInfo:u,ourRequestId:d}}a(f$i,"setupPromptAndTelemetry");function p$i(t,e,r,n,o,s){let c=t.get(TP).forLanguage(t,e.detectedLanguageId,s),l=kS(e.detectedLanguageId),u=Jlt(e,r),d={language:e.detectedLanguageId,next_indent:u.next??0,prompt_tokens:n.prefixTokens??0,suffix_tokens:n.suffixTokens??0},f={};c==="parsing"&&!l&&(f.stop=[` +`),o=[];for(let s of n){let c=t.parseLine(s);for(let l of c.filter(u=>u.type==="github.generated-pull-request-comment")){if(l.data.side!=="RIGHT")continue;let u=r.find(f=>f.path===l.data.path);if(!u)continue;let d=t.ghCommentToReviewComment(l,u);o.push(d)}}return o}};p();p();var RTt=require("path");var B_e=class t{constructor(e,r){this.ctx=e;this.workspaceFolders=r}static{a(this,"BaseReviewProvider")}static{this.DEFAULT_TIMEOUT=120*1e3}static{this.CODING_GUIDELINES_START_INDEX=2}static{this.CODE_REVIEW_ENDPOINT_SERVICE="api"}static{this.CODE_REVIEW_ENDPOINT_PATH="agents/github-code-review"}static{this.CODE_REVIEW_MODE_HEADER="X-Copilot-Code-Review-Mode"}static{this.CODE_REVIEW_MODE_VALUE="ide"}static{this.COPILOT_INTEGRATION_ID_HEADER="Copilot-Integration-Id"}static{this.GITHUB_CODING_GUIDELINE="github.coding_guideline"}static{this.CODING_GUIDELINE="coding-guideline"}static{this.UI_KIND="codeReview"}async fetchCodeReview(e,r){let n=await this.ctx.get(Ft).getToken(),o=ux(this.ctx,n,t.CODE_REVIEW_ENDPOINT_SERVICE,t.CODE_REVIEW_ENDPOINT_PATH),c=Vh(this.ctx)[t.COPILOT_INTEGRATION_ID_HEADER];this.telemetryTracker.telemetrySent();let l=El();try{return await tz(this.ctx,o,n.token,void 0,this.telemetryTracker.headerRequestId,e,r,{[t.CODE_REVIEW_MODE_HEADER]:t.CODE_REVIEW_MODE_VALUE,[t.COPILOT_INTEGRATION_ID_HEADER]:c},t.DEFAULT_TIMEOUT).then(d=>{let f=j3(d);this.telemetryTracker.telemetryData.extendWithRequestId(f);let h=El()-l;return this.telemetryTracker.telemetryData.measurements.totalTimeMs=h,this.telemetryTracker.telemetryResponse(),(d.status===401||d.status===403)&&this.ctx.get(Ft).resetToken("code_review_fetch",d.status),d}).catch(d=>{if(Ym(d))throw d;let f=El()-l;throw this.telemetryTracker.telemetryData.measurements.totalTimeMs=f,this.telemetryTracker.telemetryError(d),d})}finally{wYe(this.ctx).catch(()=>{})}}getCodingGuidelineName(e){return(0,RTt.basename)(e,(0,RTt.extname)(e))}async buildCodingGuideline(e){return!this.workspaceFolders||this.workspaceFolders.length===0?[]:(await this.ctx.get(wf).collectAllInstructions(this.ctx,this.workspaceFolders.map(o=>({uri:o.uri})),{includeCopilotInstructions:!0,includeCustomInstructionFiles:!0},e)).map((o,s)=>({type:"github.coding_guideline",id:(s+t.CODING_GUIDELINES_START_INDEX).toString(),data:{id:s+t.CODING_GUIDELINES_START_INDEX,type:"coding-guideline",name:o.description??this.getCodingGuidelineName(o.uri),description:o.content,filePatterns:o.applyTo?[o.applyTo]:[]}}))}};p();Mo();var F_e=class t{constructor(e,r={}){this.ctx=e;this.id=Nt(),this.telemetryData=t.createTelemetryData(this.id).extendedBy(r)}static{a(this,"CopilotCodeReviewTelemetry")}static createTelemetryData(e){let r={headerRequestId:e};return Vt.createAndMarkAsIssued(r)}telemetrySent(){ft(this.ctx,"request.sent",this.telemetryData),cr(this.ctx,"request.sent",this.telemetryData.properties,this.telemetryData.measurements)}telemetryResponse(){ft(this.ctx,"request.response",this.telemetryData),cr(this.ctx,"request.response",this.telemetryData.properties,this.telemetryData.measurements)}telemetryError(e){this.telemetryData.properties.message=String(Jh(e,"name")??""),this.telemetryData.properties.code=String(Jh(e,"code")??""),this.telemetryData.properties.errno=String(Jh(e,"errno")??""),this.telemetryData.properties.type=String(Jh(e,"type")??""),ft(this.ctx,"request.error",this.telemetryData),cr(this.ctx,"request.error",this.telemetryData.properties,this.telemetryData.measurements)}get headerRequestId(){return this.id}};var kTt=class t extends B_e{constructor(r,n,o){super(r,o);this.changes=n;this.name="ReviewChangesProvider";this.telemetryTracker=new F_e(r,{mode:"reviewChanges",uiKind:t.UI_KIND})}static{a(this,"ReviewChangesProvider")}async fetchCodeReview(r,n){return super.fetchCodeReview(r,n)}async changesToReference(){let r=this.ctx.get(sc),n=[],o=await Promise.allSettled(this.changes.map(s=>r.evaluate(s.uri,s.headContent)));for(let s=0;s({path:s.path,content:s.headContent})),baseFileContents:n.map(s=>({path:s.path,content:s.baseContent}))}}}async buildCodingGuideline(){return super.buildCodingGuideline(this.changes.map(r=>r.uri))}async createReviewRequest(){return{messages:[{role:"user",copilot_references:[await this.changesToReference(),...await this.buildCodingGuideline()]}]}}};var n4c=S.Object({uri:S.String(),path:S.String(),baseContent:S.String(),headContent:S.String()}),i4c=S.Object({changes:S.Array(n4c),workspaceFolders:S.Optional(S.Array(qc))}),CFe;async function o4c(t,e,r){CFe&&(CFe.cancel(),CFe.dispose()),CFe=new Fn.CancellationTokenSource;let n=new l_([e,CFe.token]),o=new kTt(t,r.changes,r.workspaceFolders);if(!(await t.get(Ft).getToken()).isCopilotCodeReviewEnabled)return[null,{code:Xe.InternalError,message:"GitHub Copilot Code Review is not enabled."}];let c=await o.createReviewRequest(),l=await o.fetchCodeReview(c,n),u=await l.text();if(!l.ok)return l.status===402?[null,{code:l.status,message:"You have reached your GitHub Copilot Code Review quota limit."}]:(Nr.error(t,`Code review request failed: ${l.status}. Response: ${u}`),[null,{code:Xe.InternalError,message:"Failed to generate code review."}]);let d=r.changes.map(h=>({uri:h.uri,path:h.path,headContent:h.headContent,startLineOffset:0}));return[{comments:L_e.parseReviewResponse(u,d)},null]}a(o4c,"handleCopilotCodeReviewReviewChangesChecked");var GVi=xe(i4c,o4c);p();p();var PTt=class t extends B_e{constructor(r,n){super(r,n);this.name="ReviewSnippetsProvider";this.telemetryTracker=new F_e(r,{mode:"reviewSnippets",uiKind:t.UI_KIND})}static{a(this,"ReviewSnippetsProvider")}static{this.SNIPPET_REVIEW_TYPE="snippet"}async fetchCodeReview(r,n){return super.fetchCodeReview(r,n)}async buildCodingGuideline(r){return super.buildCodingGuideline(r)}snippetsToReference(r){return{type:"github.pull_request",id:"1",data:{type:"pull-request",headFileContents:r.map(n=>({path:n.path,content:n.content})),baseFileContents:[]}}}static snippetsToSnippetFile(r){let n=r[0];return n?.startLine!==void 0&&n?.endLine!==void 0?{path:n.path,start_line:n.startLine,end_line:n.endLine}:void 0}async createReviewRequest(r){let n=this.ctx.get(sc),o=await Promise.allSettled(r.map(u=>n.evaluate(u.uri,u.content))),s=[];for(let u=0;uu.uri),l=await this.buildCodingGuideline(c);return{messages:[{role:"user",review_type:t.SNIPPET_REVIEW_TYPE,copilot_references:[this.snippetsToReference(s),...l],snippet_file:t.snippetsToSnippetFile(s)}]}}};var s4c=S.Object({uri:S.String(),path:S.String(),content:S.String(),startLine:S.Number(),endLine:S.Number()}),a4c=S.Object({snippets:S.Array(s4c),workspaceFolders:S.Optional(S.Array(qc))}),bFe;async function c4c(t,e,r){bFe&&(bFe.cancel(),bFe.dispose()),bFe=new Fn.CancellationTokenSource;let n=new l_([e,bFe.token]),o=new PTt(t,r.workspaceFolders);if(!(await t.get(Ft).getToken()).isCopilotCodeReviewEnabled)return[null,{code:Xe.InternalError,message:"GitHub Copilot Code Review is not enabled."}];let c=await o.createReviewRequest(r.snippets),l=await o.fetchCodeReview(c,n);if(!l.ok)return l.status===402?[null,{code:l.status,message:"You have reached your GitHub Copilot Code Review quota limit."}]:[null,{code:Xe.InternalError,message:"Failed to generate code review."}];let u=await l.text(),d=r.snippets.map(h=>({uri:h.uri,path:h.path,headContent:h.content,startLineOffset:h.startLine-1}));return[{comments:L_e.parseReviewResponse(u,d)},null]}a(c4c,"handleCopilotCodeReviewReviewSnippetsChecked");var $Vi=xe(a4c,c4c);p();p();var DTt=Symbol("onMCPToolsListChanged"),NTt=Symbol("onMCPResourcesListChanged"),MTt=Symbol("onMCPPromptsListChanged"),VVi=Symbol("onMCPResourceUpdated"),YV=Symbol("onMCPCacheUpdated");function SFe(t){let e={};for(let[r,n]of Object.entries(t)){if(n===null||typeof n!="object"||!("url"in n)||n.headers===void 0){e[r]=n;continue}let{headers:o,...s}=n;e[r]={...s,requestInit:{...s.requestInit,headers:{...o,...s.requestInit?.headers}}}}return e}a(SFe,"normalizeMcpHeaders");var u_=class{static{a(this,"McpManager")}};var l4c=S.Object({}),u4c=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(qc)),servers:S.Array(S.Object({name:S.String(),tools:S.Array(S.Object({name:S.String(),status:S.Enum(U3)}))}))}),d4c=S.Object({serverName:S.String(),promptName:S.String(),arguments:S.Optional(S.Record(S.String(),S.String()))}),f4c=S.Object({serverName:S.String(),promptName:S.String(),argumentName:S.String(),prefix:S.String(),alreadyResolved:S.Optional(S.Record(S.String(),S.String()))}),p4c=S.Object({serverName:S.String(),uri:S.String()}),h4c=S.Object({serverName:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});function m4c(t,e,r){return[t.get(u_).getAllContents(),null]}a(m4c,"handleGetMCPContentsChecked");async function g4c(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(V_).getChatMode(n?ZQ(n):"Agent",o,s),l=r.servers.flatMap(({name:d,tools:f})=>f.map(({name:h,status:m})=>({serverName:d,toolName:h,status:m})));return await t.get(u_).updateMCPToolsStatus(c,l),[t.get(u_).getAllContents(c),null]}a(g4c,"handleUpdateMCPToolsStatusChecked");async function A4c(t,e,r){return[await t.get(u_).readResource(r.serverName,r.uri),null]}a(A4c,"handleReadResourceChecked");async function y4c(t,e,r){let{serverName:n,promptName:o,arguments:s={}}=r;return[await t.get(u_).getPrompt(n,o,s),null]}a(y4c,"handleGetPromptChecked");async function E4c(t,e,r){let{serverName:n,promptName:o,argumentName:s,prefix:c,alreadyResolved:l={}}=r;return[await t.get(u_).completePrompt(n,o,s,c,l),null]}a(E4c,"handleCompletePromptChecked");async function _4c(t,e,r){let n=t.get(u_),{serverName:o,action:s}=r;switch(s){case"start":await n.startMCPServer(o);break;case"stop":await n.stopMCPServer(o);break;case"restart":await n.restartMCPServer(o);break;case"logout":await n.logoutMCPServer(o);break;case"clearOAuth":await n.clearOAuthMCPServer(o);break}return[null,null]}a(_4c,"handleMCPServerActionChecked");var WVi=xe(l4c,m4c),zVi=xe(u4c,g4c),YVi=xe(p4c,A4c),KVi=xe(d4c,y4c),JVi=xe(f4c,E4c),ZVi=xe(h4c,_4c);p();var v4c=S.Object({});async function C4c(t,e,r){let n=await t.get(Ft).getToken();return[I4c(t,await t.get(xs).getMetadata(),n),null]}a(C4c,"handleCopilotModelsChecked");function b4c(t){return(t.capabilities.supports?.reasoning_effort?.length??0)<=1?!1:t.supported_endpoints?.includes(X$e.Messages)?t.capabilities.supports?.adaptive_thinking===!0:!0}a(b4c,"supportReasoningEffortLevel");function S4c(t){if(t.capabilities.type==="chat"){let e=["chat-panel","inline"];return!hle.has(t.capabilities.family)&&t.capabilities.supports?.tool_calls&&(t.capabilities.limits?.max_prompt_tokens??0)>4e4&&e.push("agent-panel"),e}else if(t.capabilities.type==="completion")return["completion"];return[]}a(S4c,"getModelScopes");function T4c(t){return t.capabilities.type==="completion"?!0:t.model_picker_enabled===!0}a(T4c,"shouldExposeModel");function I4c(t,e,r){let n=[];return e.forEach(o=>{T4c(o)&&n.push({modelFamily:o.capabilities.family,modelName:o.name,modelPolicy:o.policy,scopes:S4c(o),id:o.id,vendor:o.vendor,preview:o.preview??!1,isChatDefault:o.is_chat_default??!1,isChatFallback:o.is_chat_fallback??!1,capabilities:{supports:{vision:o.capabilities.supports?.vision??!1,reasoningEfforts:o.capabilities.supports?.reasoning_effort,supportsReasoningEffortLevel:b4c(o)},limits:o.capabilities.limits?{maxContextWindowTokens:o.capabilities.limits.max_context_window_tokens,maxOutputTokens:o.capabilities.limits.max_output_tokens,maxInputTokens:o.capabilities.limits.max_prompt_tokens,maxNonStreamingOutputTokens:o.capabilities.limits.max_non_streaming_output_tokens}:void 0},billing:o.billing?{isPremium:o.billing?.is_premium??!0,multiplier:o.billing?.multiplier??0,tokenBasedBillingEnabled:r.userInfo?.isTBBEnabled,tokenPrices:o.billing?.token_prices?{batchSize:o.billing.token_prices.batch_size,default:o.billing.token_prices.default?{cachePrice:o.billing.token_prices.default.cache_price,inputPrice:o.billing.token_prices.default.input_price,outputPrice:o.billing.token_prices.default.output_price,maxContext:o.billing.token_prices.default.context_max}:void 0,longContext:o.billing.token_prices.long_context?{cachePrice:o.billing.token_prices.long_context.cache_price,inputPrice:o.billing.token_prices.long_context.input_price,outputPrice:o.billing.token_prices.long_context.output_price,maxContext:o.billing.token_prices.long_context.context_max}:void 0}:void 0}:void 0,customModel:o.custom_model?{keyName:o.custom_model.key_name,ownerName:o.custom_model.owner_name,ownerType:o.custom_model.owner_type,provider:o.custom_model.provider}:void 0,degradationReason:Mdn(o),modelPickerCategory:o.model_picker_category,modelPickerPriceCategory:o.model_picker_price_category})}),t.get(Hl).getPolicyValue("autoModel.enabled")!==!1&&n.push({modelFamily:K_,modelName:NKe,modelPolicy:void 0,scopes:["inline","chat-panel","agent-panel"],id:K_,preview:!1,isChatDefault:!1,isChatFallback:!1,capabilities:{supports:{vision:!0,supportsReasoningEffortLevel:!1}},billing:void 0,degradationReason:void 0}),n}a(I4c,"filterModels");var XVi=xe(v4c,C4c);p();var x4c=S.Object({});async function w4c(t,e,r){let{models:n,xGithubRequestId:o}=await t.get(xs).getModelMetadataList();return[{models:n,xGithubRequestId:o},null]}a(w4c,"handleCopilotModelsGetModelMetadataListChecked");var eWi=xe(x4c,w4c);p();var R4c=S.Object({model:S.Optional(S.String()),status:S.Optional(S.String())});async function k4c(t,e,r){return r.model&&r.status==="enabled"?await t.get(xs).acceptModelPolicy(r.model)?["OK",null]:[null,{code:Xe.InternalError,message:"Failed to accept model policy"}]:[null,{code:Xe.InvalidRequest,message:"Invalid model or status"}]}a(k4c,"handleCopilotModelsPolicyChecked");var tWi=xe(R4c,k4c);p();p();p();p();Mo();function P4c(t,e){let r=e,n=t.lineAt(e.line);return n.isEmptyOrWhitespace||(r=n.range.end),r}a(P4c,"panelPositionForDocument");async function*rWi(t){for await(let e of t){let r={...e};r.completionText=r.completionText.trimEnd(),yield r}}a(rWi,"trimChoices");var U_e=class{constructor(e,r,n,o){this.textDocument=e;this.startPosition=r;this.cancellationToken=n;this.solutionCountTarget=o;this.targetPosition=P4c(this.textDocument,this.startPosition)}static{a(this,"SolutionManager")}get savedTelemetryData(){return this._savedTelemetryData}set savedTelemetryData(e){this._savedTelemetryData=e}};async function Y3r(t,e){let r=await t;switch(r.status){case"Solution":await e.onSolution(r.solution),await Y3r(r.next,e);break;case"FinishedNormally":await e.onFinishedNormally();break;case"FinishedWithError":await e.onFinishedWithError(r.error);break}}a(Y3r,"reportSolutions");async function K3r(t,e){if(t.isCancellationRequested)return{status:"FinishedWithError",error:"Cancelled"};let r=await e.next();return r.done===!0?{status:"FinishedNormally"}:{status:"Solution",solution:r.value,next:K3r(t,e)}}a(K3r,"generateSolutionsStream");function OTt(t){return t.replace(/\s+/g,"")}a(OTt,"normalizeCompletionText");async function nWi(t,e,r,n,o,s){let c=e.targetPosition,l=e.textDocument,u=IQ(t,l.uri),d=Nt(),f=Vt.createAndMarkAsIssued({headerRequestId:d,languageId:l.detectedLanguageId,source:r},{});e.savedTelemetryData=await t.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments({uri:l.uri,languageId:l.detectedLanguageId},f),o&&(e.savedTelemetryData=e.savedTelemetryData.extendedBy({engineName:o})),s&&(e.savedTelemetryData=e.savedTelemetryData.extendedBy({comparisonRequestId:s}));let h=await qme(t,d,Aee(l,c),e.savedTelemetryData);if(h.type==="copilotContentExclusion")return{status:"FinishedNormally"};if(h.type==="contextTooShort")return{status:"FinishedWithError",error:"Context too short"};if(h.type==="promptCancelled")return{status:"FinishedWithError",error:"Prompt cancelled"};if(h.type==="promptTimeout")return{status:"FinishedWithError",error:"Prompt timeout"};if(h.type==="promptError")return{status:"FinishedWithError",error:"Prompt error"};let m=h.prompt,g=h.trailingWs;return g.length>0&&(e.startPosition=Au.position(e.startPosition.line,e.startPosition.character-g.length)),e.savedTelemetryData=e.savedTelemetryData.extendedBy({},{...Rse(m),solutionCount:e.solutionCountTarget,promptEndPos:l.offsetAt(c)}),n.debug(t,"prompt:",m),ft(t,"solution.requested",e.savedTelemetryData),{prompt:m,trailingWs:g,telemetryData:e.savedTelemetryData,repoInfo:u,ourRequestId:d}}a(nWi,"setupPromptAndTelemetry");function iWi(t,e,r,n,o,s){let c=t.get(MP).forLanguage(t,e.detectedLanguageId,s),l=OS(e.detectedLanguageId),u=dut(e,r),d={language:e.detectedLanguageId,next_indent:u.next??0,prompt_tokens:n.prefixTokens??0,suffix_tokens:n.suffixTokens??0},f={};c==="parsing"&&!l&&(f.stop=[` `,`\r \r -`]);let h=mQ(t,s),m;switch(c){case"server":m=a(()=>{},"finishedCb"),d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsingandserver":m=l?lNe(t,e,o.startPosition):()=>{},d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsing":default:m=l?lNe(t,e,o.startPosition):()=>{};break}return{extra:d,postOptions:f,finishedCb:m,engineInfo:h}}a(p$i,"setupCompletionParams");var KBr=new fe("solutions");async function rOc(t,e){let r=e.targetPosition,n=e.textDocument,o=await f$i(t,e,"open copilot",KBr);if("status"in o)return o;let{prompt:s,trailingWs:c,telemetryData:l,repoInfo:u,ourRequestId:d}=o,{extra:f,postOptions:h,finishedCb:m,engineInfo:g}=p$i(t,n,r,s,e,l),A=e.cancellationToken,y={prompt:s,languageId:n.detectedLanguageId,repoInfo:u,ourRequestId:d,engineModelId:g.modelId,count:e.solutionCountTarget,uiKind:"synthesize",postOptions:h,headers:g.headers,extra:f},E=await t.get(AO).fetchAndStreamCompletions(t,y,l.extendedBy(),m,A);if(E.type==="failed"||E.type==="canceled")return{status:"FinishedWithError",error:`${E.type}: ${E.reason}`};let _=E.choices;_=d$i(_),_=ixe(_,T=>MNe(t,n,r,T,!1,KBr));let v=ixe(_,async T=>{let w=T.completionText;KBr.info(t,`Open Copilot completion: [${T.completionText}]`);let R=await XXn(t,n,r,T.completionText)??gu.position(r.line,0),[x]=FH(n.getText(gu.range(R,r)));w=x+w;let P=T.completionText;c.length>0&&P.startsWith(c)&&(P=P.substring(c.length));let D=T.meanLogProb,N=D!==void 0?Math.exp(D):0,L=l.extendedBy({choiceIndex:T.choiceIndex.toString()});return{completionText:P,insertText:w,range:gu.range(R,r),meanProb:N,meanLogProb:D||0,requestId:T.requestId,choiceIndex:T.choiceIndex,telemetryData:L,copilotAnnotations:T.copilotAnnotations}});return YBr(A,v[Symbol.asyncIterator]())}a(rOc,"launchSolutions");async function uTt(t,e,r){return t.get(ps).trackCompletionJob(async()=>{let o=rOc(t,e);return await zBr(o,r)})}a(uTt,"runSolutions");var m$i=de(dU()),rFe=de(Xc());p();Mo();p();function dTt(t,e){let r=t.split(` -`),n=e,o=e,s=r[e.line],c=s.indexOf("%");c!==-1&&(s=s.substring(0,c)+s.substring(c+1),n={line:e.line,character:c});let l=s.indexOf("^");if(l!==-1){let u=s.indexOf("^",l+1);if(u===-1)throw new Error("Challenge document must contain zero or two ^ characters.");s=s.substring(0,l)+s.substring(l+1,u)+s.substring(u+1),n={line:e.line,character:e.character},o={line:e.line,character:e.character+u-l-1}}return{cursorLine:s,lines:r,start:n,end:o}}a(dTt,"parseChallengeDoc");var nOc=S.Object({text:S.String(),score:S.Number()}),iOc=S.Object({documents:S.Array(nOc),options:S.Optional(S.Object({}))});async function fTt(t,e,r){let n=Mt();for(let o=0;oh+m.length+1,0)+d.character,await r.onSolution({requestId:{headerRequestId:n,serverExperiments:"",deploymentId:""},completionText:f,insertText:f,range:{start:t,end:t},meanProb:c,meanLogProb:-1,choiceIndex:o,telemetryData:JI.createEmptyConfigForTesting()})}await r.onFinishedNormally()}a(fTt,"runTestSolutions");var kN=class{constructor(e){this.documents=e}static{a(this,"ExternalTestingPanelCompletionDocuments")}};function oOc(t,e,r){return t.forceSet(kN,new kN(r.documents)),["OK",null]}a(oOc,"handleTestingSetPanelCompletionDocumentsChecked");var h$i=Oe(iOc,oOc);var g$i=TKe.type;function sOc(t,e,r,n,o){let s=lTt(n.completionText),c=(0,m$i.SHA256)(s).toString();return t.get(Ru).set(c,{displayText:n.completionText,insertText:n.insertText,offset:r,uuid:c,range:n.range,uri:e.textDocument.uri,telemetry:n.telemetryData.extendedBy({},{rank:o-1}),index:n.choiceIndex,position:e.position,resultType:0,triggerCategory:"solution",copilotAnnotations:n.copilotAnnotations,clientCompletionId:c}),{range:n.range,insertText:n.insertText,command:{command:P4r,title:`Accept completion ${o}`,arguments:[c]}}}a(sOc,"makeCompletion");function ZBr(t,e){return`${t}/${e}`}a(ZBr,"progressMessage");var JBr=class{constructor(e,r,n){this.ctx=e;this.params=r;this.onCompletion=n;this.offset=0;this.count=0;this.items=new Map}static{a(this,"SolutionHandler")}get service(){return this.ctx.get(ar)}async onSolution(e){this.count+=1;let r=sOc(this.ctx,this.params,this.offset,e,this.items.size+1);this.items.has(r.command.arguments[0])||(this.items.set(r.command.arguments[0],r),await this.onCompletion(r)),this.params.workDoneToken!==void 0&&await this.service.connection.sendProgress(rFe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"report",message:ZBr(this.count,10),percentage:Math.round(100*this.count/10)})}onFinishedNormally(){return aOc(this.params.workDoneToken,this.service,this.count)}async onFinishedWithError(e){if(this.error=e,this.params.workDoneToken!==void 0)return this.service.connection.sendProgress(rFe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"end",message:`Error: ${e}`})}};async function aOc(t,e,r=0){t!==void 0&&await e.connection.sendProgress(rFe.WorkDoneProgress.type,t,{kind:"end",message:ZBr(r,10)})}a(aOc,"reportDone");var tFe;async function cOc(t,e,r){let n=await P9(t,r.textDocument,e),o=r.position;r.workDoneToken!==void 0&&await t.get(ar).connection.sendProgress(rFe.WorkDoneProgress.type,r.workDoneToken,{kind:"begin",title:"GitHub Copilot Completions Panel",cancellable:!0,message:ZBr(0,10),percentage:0});let s=[],c=a(f=>(s.push(f),Promise.resolve()),"onCompletion"),l=r.partialResultToken;l!==void 0&&(c=a(async f=>{await t.get(ar).connection.sendProgress(TKe.partialResult,l,{items:[f]})},"onCompletion"));let u=new JBr(t,r,c),d=t.get(kN);if(d.documents){let f=d.documents;await fTt(o,f,u)}else{u.offset=n.offsetAt(o);let f=new __e(n,o,e,10);await uTt(t,f,u)}return u.error!==void 0?[null,{code:Ze.InternalError,message:u.error}]:[{items:s},null]}a(cOc,"handleChecked");async function lOc(t,e,r){tFe&&(tFe.cancel(),tFe.dispose()),tFe=new Fn.CancellationTokenSource;let n=tFe.token,o=new i_([e,n]);try{return await cOc(t,o,r)}catch(s){if(n.isCancellationRequested&&!e.isCancellationRequested)return[null,{code:Ze.ServerCancelled,message:"Request was superseded by a new request"}];throw s}}a(lOc,"handleCheckedWithAbort");var A$i=Oe(wvn,lOc);p();var dOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function fOc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Ld).listCustomAgents(n,{includePlugins:!0,includeRuntimeAgents:!0})).map(c=>{let l=c.promptFileEntry?.promptPath?.storage;return{id:c.id,name:c.name,description:c.description,extensionId:c.extensionId,pluginUri:c.pluginUri,invokePolicy:c.invokePolicy,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,source:c.source,uri:c.promptFileEntry?.promptPath?.uri??c.id,storage:l,providers:cO(c.pluginUri!==void 0,c.providers)}}),null]}a(fOc,"listCustomAgents");var y$i=Oe(dOc,fOc);p();var pOc=new fe("customAgent/registerExtensionAgents"),hOc=S.Object({uri:S.String(),name:S.String(),description:S.String()}),mOc=S.Object({extensionId:S.String(),agents:S.Array(hOc)});function gOc(t,e,r){try{t.get(Ld).registerExtensionAgent(r.extensionId,r.agents)}catch(n){pOc.warn(t,`Failed to register extension agents for ${r.extensionId}:`,n);let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:`Failed to register extension agents: ${o}`}]}return[null,null]}a(gOc,"registerExtensionAgents");var E$i=Oe(mOc,gOc);p();var AOc=S.Object({extensionId:S.String()});function yOc(t,e,r){return t.get(Ld).unregisterExtensionAgents(r.extensionId),[null,null]}a(yOc,"unregisterExtensionAgents");var _$i=Oe(AOc,yOc);p();var EOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function _Oc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(bf).listCustomInstructions(n,{includePlugins:!0})).map(c=>({uri:c.uri,name:c.name,applyTo:c.applyTo,description:c.description,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,source:c.source,storage:c.promptFileEntry?.promptPath.storage,pluginUri:c.pluginUri,providers:cO(c.pluginUri!==void 0,c.providers)})),null]}a(_Oc,"listCustomInstructions");var v$i=Oe(EOc,_Oc);p();var vOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function COc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Cg).listCustomPrompts(n,{includePlugins:!0})).map(c=>{let l=c.promptFileEntry?.promptPath.storage;return{uri:c.uri,name:c.name,description:c.description,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,storage:l,pluginUri:c.pluginUri,providers:cO(c.pluginUri!==void 0,c.providers)}}),null]}a(COc,"listCustomPrompts");var C$i=Oe(vOc,COc);p();var bOc=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});async function SOc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(h0).listSkills(n,{includePlugins:!0})).map(c=>({id:c.id,name:c.name,description:c.description,uri:c.uri,storage:c.storage,pluginUri:c.pluginUri,providers:cO(c.pluginUri!==void 0,c.providers)})),null]}a(SOc,"listCustomSkills");var b$i=Oe(bOc,SOc);p();p();p();function TOc(t,e,r){let{apiUrl:n,serverUrl:o}=r||t.get($m).getConfiguredUrls(),s=new URL("login/device",o).href,c=new URL("_ping",e.proxy).href,l=new URL("_ping",e.api).href,u=new URL("_ping",e.telemetry).href;function d(f){return new URL(f).host}return a(d,"label"),[{label:d(s),url:s},{label:d(n),url:n,session:r},{label:d(c),url:c},{label:d(l),url:l,session:r},{label:d(u),url:u}]}a(TOc,"urlsToCheck");async function S$i(t,e,r=bB(t),n,o){let s=TOc(t,r,n).map(async({label:c,url:l,session:u})=>{let{message:d,status:f}=await IOc(e,l,u,o);return{label:c,url:l,message:d,status:f}});return await Promise.all(s)}a(S$i,"checkReachability");async function IOc(t,e,r,n){try{let o=new AbortController;n?.onCancellationRequested(()=>o.abort());let s=await t.fetch(e,{headers:r?{Authorization:`Bearer ${r.accessToken}`}:{},signal:o.signal}),c=s.status>=200&&s.status<400?"reachable":"unreachable";return{message:`HTTP ${s.status}`+(s.statusText?` - ${s.statusText}`:""),status:c}}catch(o){return{message:String(o),status:"unreachable"}}}a(IOc,"determineReachability");var SI=de(require("os")),v_e=de(require("tls"));async function I$i(t,e){let r=await t.get(tr).getImplementation(),n=await t.get(Qt).getGitHubSession(),o=await t.get(Qt).getToken().catch(()=>{});return{sections:[wOc(t),xOc(t,n),ROc(t,r),await kOc(t,r,o?.endpoints,n,e)]}}a(I$i,"collectDiagnostics");function x$i(t){return t.sections.map(POc).join(SI.EOL+SI.EOL)+SI.EOL}a(x$i,"formatDiagnosticsAsMarkdown");function xOc(t,e){let r=e&&new URL(e.serverUrl).host,n;return e?r==="github.com"?n=e.login:n=`${e.login} (${r})`:n="not signed in",{name:"Copilot",items:{Version:V1(t),"GitHub Account":n,"Session ID":t.get(Ua).sessionId,"Send Restricted Telemetry":_se(t)?"enabled":"disabled","Content Exclusion":t.get(nc).enabled?"enabled":"unavailable"}}}a(xOc,"collectCopilotSection");function wOc(t){let e={Plugin:NOc(t),Editor:DOc(t),"Operating System":`${SI.type()} ${SI.release()} (${SI.arch()})`};return UL(e,"NODE_OPTIONS"),{name:"Environment",items:e}}a(wOc,"collectEnvironmentSection");function ROc(t,e){let r=t.get(Lo).getHttpSettings(),n={Proxy:r.proxy||void 0,"Proxy Authorization":r.proxyAuthorization?"present":void 0,"Proxy Kerberos SPN":r.proxyKerberosServicePrincipal,"Proxy Strict SSL":r.proxyStrictSSL===!1?"disabled":"enabled","No Proxy":r.noProxy?.join(",")||void 0,Fetcher:e.name.replace(/Fetcher$/,""),"Number of Root Certificates":v_e.rootCertificates.length,"TLS Default Min Version":v_e.DEFAULT_MIN_VERSION,"TLS Default Max Version":v_e.DEFAULT_MAX_VERSION};return UL(n,"http_proxy"),UL(n,"https_proxy"),UL(n,"no_proxy"),UL(n,"SSL_CERT_FILE"),UL(n,"SSL_CERT_DIR"),UL(n,"OPENSSL_CONF"),UL(n,"NODE_EXTRA_CA_CERTS"),UL(n,"NODE_TLS_REJECT_UNAUTHORIZED"),{name:"Network Configuration",items:n}}a(ROc,"collectNetworkConfigSection");async function kOc(t,e,r,n,o){return{name:"Reachability",items:Object.fromEntries((await S$i(t,e,r,n,o)).map(({label:c,message:l})=>[c,l]))}}a(kOc,"collectReachabilitySection");function T$i(t){return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}a(T$i,"quoteCode");function UL(t,e){let r=process.env[e];r&&(t[T$i(e)]=T$i(r)),r!==process.env[e.toUpperCase()]&&UL(t,e.toUpperCase())}a(UL,"addEnvironmentVariable");function POc(t){return`## ${t.name}`+SI.EOL+SI.EOL+Object.keys(t.items).filter(e=>e!=="name").map(e=>`- ${e}: ${t.items[e]??"N/A"}`).join(SI.EOL)}a(POc,"formatSectionAsMarkdown");function DOc(t){let e=t.get(Ir).getEditorInfo();return`${e.readableName||e.name} ${e.version}`}a(DOc,"getEditorDisplayVersion");function NOc(t){let e=t.get(Ir).getEditorPluginInfo();return`${e.readableName||e.name} ${e.version}`}a(NOc,"getPluginDisplayVersion");var MOc=S.Object({});async function OOc(t,e){return[{report:x$i(await I$i(t,e))},null]}a(OOc,"handleDiagnosticsChecked");var w$i=Oe(MOc,OOc);p();var LOc=S.Object({conversationId:S.String(),sessionTitle:S.Optional(S.String())});async function BOc(t,e,r){let o=await t.get(pv).readSpans(r.conversationId),s=JGn(o,{conversationId:r.conversationId,sessionTitle:r.sessionTitle});return[{content:JSON.stringify(s,null,2)},null]}a(BOc,"handleExportAgentDebugLogChecked");var R$i=Oe(LOc,BOc);p();var FOc=S.Object({conversationId:S.String()});async function UOc(t,e,r){return[{spans:await t.get(pv).readSpans(r.conversationId)},null]}a(UOc,"handleGetAgentDebugLogChecked");var k$i=Oe(FOc,UOc);p();Mo();var L$i=de(Xc());p();var P$i=require("crypto");var C_e=class{static{a(this,"LspClientContextProvider")}constructor(e,r,n){this.id=r,this.selector=n,this.resolver=new e3r(e,this.id)}},e3r=class{constructor(e,r){this.ctx=e;this.id=r;this.contextItems=[];this.update=!1}static{a(this,"LspClientContextResolver")}async resolve(e,r){let n=[];if(this.contextItems.length>0)n=this.contextItems;else if(this.update){let o=this.ctx.get(ar),s=(0,P$i.randomUUID)(),c=o.connection.onProgress(bKe.type,s,l=>{n.push(...l)});r.onCancellationRequested(()=>{c?.dispose()});try{let l=await o.connection.sendRequest(bKe.type,{providerId:this.id,data:this.data,textDocument:{uri:e.documentContext.uri,languageId:e.documentContext.languageId,version:e.documentContext.version},position:e.documentContext.position,partialResultToken:s},r);n.push(...l)}finally{c?.dispose()}}return this.reset(),Promise.resolve(n)}setContextItems(e){this.contextItems=e}clearContextItems(){this.contextItems=[]}setUpdate(e){this.update=e}clearData(){this.data=void 0}reset(){this.clearContextItems(),this.clearData(),this.setUpdate(!1)}};function pTt(t,e,r){try{let n=t.get(hm),o=new Map;n.providers.forEach(s=>{o.set(s.id,s)}),e.providers.forEach(s=>{let c=o.get(s.id);c&&c instanceof C_e&&c.resolver.setContextItems(s.contextItems)}),e.updating&&e.updating.length>0&&e.updating.forEach(s=>{let c=o.get(s);c&&c instanceof C_e&&(c.resolver.setUpdate(!0),c.resolver.data=r)})}catch(n){Nr.error(t,"Failed to set context items on context providers",n)}}a(pTt,"setContextItems");var XBr={nocase:!0,matchBase:!0,nonegate:!0,dot:!0};function D$i(t,e,r){return e.map(o=>{try{if(typeof o=="string")return vf(r.uri,o,XBr);if(typeof o=="object"){let s=!0;return"language"in o&&(s&&=r.languageId==(o.language||"")),"scheme"in o&&(s&&=vf(r.uri,o.scheme||"",XBr)),"pattern"in o&&(s&&=vf(r.uri,o.pattern||"",XBr)),s}}catch{return!1}return!1}).some(Boolean)?10:0}a(D$i,"match");p();var QOc=S.Object({documents:S.Array(S.String()),basename:S.Optional(S.String()),options:S.Optional(S.Object({}))}),QV=class{constructor(e,r){this.documents=e;this.basename=r}static{a(this,"ExternalTestingCompletionDocuments")}};function qOc(t,e,r){return t.forceSet(QV,new QV(r.documents,r.basename||"")),["OK",null]}a(qOc,"handleTestingSetCompletionDocumentsChecked");var N$i=new fe("setCompletionDocuments"),O$i=Oe(QOc,qOc);function hTt(t,e,r,n){let o=t.get(QV);if(o.documents){let s=n?3:1;if(r&&o.basename&&o.basename.trim().length>0){N$i.debug(t,`Returning filtered completions by basename ${o.basename}`);let c=jOc(o,r);return c&&c.length>0?M$i(c,s,e):void 0}else return N$i.debug(t,"Returning completions for all pre-set documents"),M$i(o.documents,s,e)}}a(hTt,"getTestCompletions");function M$i(t,e,r){return t.slice(0,e).map(n=>{let{cursorLine:o,lines:s,start:c,end:l}=dTt(n,r);return{insertText:[o.slice(Math.min(c.character,r.character))].concat(s.slice(r.line+1)).join(` -`),range:{start:c,end:l}}})}a(M$i,"sliceAndMapCompletions");function jOc(t,e){return t.basename===Ji(e)?t.documents||[]:[]}a(jOc,"getFilteredDocs");var B$i=S.Object({doc:S.Object({position:c0,insertSpaces:S.Optional(S.Boolean()),tabSize:S.Optional(S.Number()),uri:Nxe,version:S.Number()}),contextItems:S.Optional(Lfr)}),nFe;async function F$i(t,e,r,n){nFe&&(nFe.cancel(),nFe.dispose()),nFe=new Fn.CancellationTokenSource;let o=new i_([e,nFe.token]);r.contextItems&&pTt(t,r.contextItems);let s=hTt(t,r.doc.position,r.doc.uri,n);if(s)return[{completions:s.map(m=>({uuid:Mt(),text:m.insertText,displayText:m.insertText,position:r.doc.position,range:m.range,docVersion:r.doc.version}))},null];let c;try{c=await P9(t,r.doc,o)}catch(h){if(!(h instanceof L$i.ResponseError))throw h;switch(h.code){case Ze.CopilotNotAvailable:case Ze.ContentModified:return[{completions:[]},null]}throw h}let l=r.doc.position,u=await t.get(ry).getCompletions(c,l,o,{isCycling:n,formattingOptions:r.doc});if(!u)return[{completions:[]},null];let d=t.get(Ru);for(let h of u)d.set(h.uuid,{...h,triggerCategory:"ghostText"});return[{completions:u.map(h=>({uuid:h.uuid,text:h.insertText,range:h.range,displayText:h.displayText,position:h.position,docVersion:c.version}))},null]}a(F$i,"handleGetCompletionsHelper");var U$i=Oe(B$i,(t,e,r)=>F$i(t,e,r,!1)),Q$i=Oe(B$i,(t,e,r)=>F$i(t,e,r,!0));p();var HOc=S.Object({});function GOc(t,e,r){return[{defaultRules:t.get(mw).getDefaultRules()},null]}a(GOc,"handleGetDefaultFileSafetyRulesChecked");var q$i=Oe(HOc,GOc);p();var j$i=de(dU()),b_e=de(Xc());var $Oc=S.Object({doc:S.Object({position:c0,uri:Nxe,version:S.Number()}),panelId:S.String()});function VOc(t,e,r,n,o){let s=lTt(o.completionText),c=(0,j$i.SHA256)(s).toString();return t.get(Ru).set(c,{displayText:o.insertText,insertText:o.completionText,offset:n,uuid:c,range:r,uri:e.doc.uri,telemetry:o.telemetryData,index:o.choiceIndex,position:r.end,resultType:0,triggerCategory:"solution",copilotAnnotations:o.copilotAnnotations,clientCompletionId:c}),{panelId:e.panelId,range:r,completionText:o.completionText,displayText:o.insertText,score:o.meanProb,solutionId:c}}a(VOc,"makeSolution");var t3r=class{constructor(e,r,n){this.ctx=e;this.params=r;this.range=n;this.offset=0}static{a(this,"SolutionHandler")}get service(){return this.ctx.get(ar)}onSolution(e){return this.service.connection.sendNotification(new b_e.NotificationType("PanelSolution"),VOc(this.ctx,this.params,this.range,this.offset,e))}onFinishedNormally(){return H$i(this.params.panelId,this.service)}onFinishedWithError(e){return this.service.connection.sendNotification(new b_e.NotificationType("PanelSolutionsDone"),{status:"Error",message:e,panelId:this.params.panelId})}};async function H$i(t,e){return e.connection.sendNotification(new b_e.NotificationType("PanelSolutionsDone"),{status:"OK",panelId:t})}a(H$i,"reportDone");var iFe;async function WOc(t,e,r){iFe&&(iFe.cancel(),iFe.dispose()),iFe=new Fn.CancellationTokenSource;let n=new i_([e,iFe.token]),o=r.doc.position,s=gu.range(o,o),c=new t3r(t,r,s),l=t.get(kN);if(l.documents){let u=l.documents;fTt(o,u,c)}else{let u;try{u=await P9(t,r.doc,n)}catch(f){if(!(f instanceof b_e.ResponseError))throw f;switch(f.code){case Ze.CopilotNotAvailable:case Ze.ContentModified:return zOc(t,r)}throw f}c.offset=u.offsetAt(o);let d=new __e(u,o,n,10);uTt(t,d,c)}return[{solutionCountTarget:10},null]}a(WOc,"handleGetPanelCompletionsChecked");async function zOc(t,e){return await H$i(e.panelId,t.get(ar)),[{solutionCountTarget:0},null]}a(zOc,"produceEmptySolutions");var G$i=Oe($Oc,WOc);p();var YOc=S.Object({});async function KOc(t,e,r){let o=(await t.get(Qt).getToken()).userInfo,s=o.raw,l=(await t.get(Ur).resolveSession())?.login;return!s||!l?[null,null]:[{userName:l,copilotPlan:o.copilotPlan,rawUserInfo:s},null]}a(KOc,"handleGetUserInfoChecked");var $$i=Oe(YOc,KOc);p();var JOc=S.Object({});function ZOc(t,e,r){return[{version:t.get(ds).getDisplayVersion(),buildType:MU(t),runtimeVersion:`node/${process.versions.node}`},null]}a(ZOc,"handleGetVersionChecked");var V$i=Oe(JOc,ZOc);p();Mo();var XOc=S.Object({changes:S.Array(S.String()),userCommits:S.Array(S.String()),recentCommits:S.Array(S.String()),workspaceFolder:S.Optional(S.String()),userLanguage:S.Optional(S.String())});async function e5c(t,e,r){if(r.changes.length===0)return[null,{code:Ze.InvalidRequest,message:"No changes provided"}];let n=t.get(zo),o=n.create({capabilities:{skills:[MO]}}),s=new Xf({message:"",type:"user"});await n.addTurn(o.id,s);let c=m_e({workDoneToken:Mt()});await t.get(Tc).begin(o,s,c);let d=(await new hw(t,o,s,e).skillResolver.resolve(MO))?.head?.name,h=await t.get(HX).generateCommitMessage(t,e,r,d);return h==null?[null,{code:Ze.InternalError,message:"Failed to generate commit message"}]:[{commitMessage:h},null]}a(e5c,"handleGitCommitGenerateChecked");var W$i=Oe(XOc,e5c);p();var t5c=S.Object({repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),pullRequestNumber:S.Number()});async function r5c(t,e,r){try{let o=await new Zh(t).listPullRequestFiles(r.repoOwner,r.repoName,r.pullRequestNumber);return Et(t,"githubApi.listPullRequestChangedFiles",Wt.createAndMarkAsIssued()),At(t,"githubApi.listPullRequestChangedFiles"),[{files:o},null]}catch(n){if(qa(t,n,"githubApi.listPullRequestChangedFiles"),Vn(t,"githubApi.listPullRequestChangedFiles",n),n instanceof uE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(n instanceof Fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(r5c,"handleListPullRequestChangedFilesChecked");var z$i=Oe(t5c,r5c);p();p();var mTt=new fe("GitHubGraphQLClient"),gTt=class{constructor(e){this.ctx=e;this.graphqlClient=null}static{a(this,"GitHubGraphQLClient")}async getGraphQLClient(){if(this.graphqlClient)return this.graphqlClient;let e=await this.getApiSession(),r=this.ctx.get(tr);return this.graphqlClient=ECn.defaults({headers:{authorization:`token ${e.accessToken}`},baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.graphqlClient}async searchPullRequests(e){mTt.debug(this.ctx,`Searching pull requests with query: ${e}`);let r=await this.getGraphQLClient();try{let n=[],o=null,s=!0,c=0;for(;s;){c++,mTt.debug(this.ctx,`Fetching page ${c} of pull requests search results`);let u=await r(` - query searchPullRequests($searchQuery: String!, $cursor: String) { - search(query: $searchQuery, type: ISSUE, first: 100, after: $cursor) { - nodes { - ... on PullRequest { - fullDatabaseId - number - title - author { - login - } - url - isDraft - body - updatedAt - repository { - owner { - login - } - name - } - } - } - pageInfo { - hasNextPage - endCursor - } - } - } - `,{searchQuery:e,cursor:o}),d=u.search.nodes.map(f=>({id:f.fullDatabaseId,number:f.number,title:f.title,user:f.author,html_url:f.url,draft:f.isDraft,body:f.body,updated_at:f.updatedAt,repository:f.repository}));n.push(...d),s=u.search.pageInfo.hasNextPage,o=u.search.pageInfo.endCursor}return mTt.debug(this.ctx,`Found ${n.length} pull requests`),n}catch(n){if(mTt.error(this.ctx,`Failed to search pull requests with query '${e}':`,n),n&&typeof n=="object"&&"status"in n){let o=n;throw new Fd(o.status,o.message||"GitHub GraphQL API failed")}throw n}}async getApiSession(){let e=await this.ctx.get(Ur).resolveSession();if(!e)throw new uE;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var n5c=S.Object({query:S.String(),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Bc))}),Y$i=4,S_e=class extends Error{static{a(this,"TemplateVariableSubstituteError")}constructor(e,r){super(e),this.errorCode=r}};async function i5c(t,e,r){try{let n=new gTt(t),o=await s5c(t,r),s=await n.searchPullRequests(o);await o5c(t,s);let c=a5c(s);return Et(t,"githubApi.searchPR",Wt.createAndMarkAsIssued()),At(t,"githubApi.searchPR",void 0,c),[{pullRequests:s},null]}catch(n){if(n instanceof S_e)return[null,{code:n.errorCode,message:n.message}];if(n instanceof uE)return[null,{code:Ze.NoGitHubToken,message:n.message}];if(qa(t,n,"githubApi.searchPR"),Vn(t,"githubApi.searchPR",n),n instanceof Fd&&n.isClientError())return[null,{code:Ze.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ze.InternalError,message:`Unexpected error happened: ${o}`}]}}a(i5c,"handleSearchPRChecked");async function o5c(t,e){let r=new Zh(t);for(let n=0;n{try{c.copilotWorkStatus=await r.getCopilotWorkingStatus(c.repository.owner.login,c.repository.name,c.number,c.user?.login)}catch{c.copilotWorkStatus="not_copilot_issue"}});await Promise.all(s)}}a(o5c,"appendCopilotWorkStatus");async function s5c(t,e){let r=e.query;if(r.includes("${user}")){let n=await t.get(Ur).resolveSession();if(!n)throw new S_e("The user is not logged in.",Ze.NoGitHubToken);r=r.replace(/\$\{user\}/g,n.login)}if(r.includes("${owner}")||r.includes("${repository}")){let n;if(e.workspaceFolders&&e.workspaceFolders.length>0)n=e.workspaceFolders[0];else if(e.workspaceFolder)n={uri:e.workspaceFolder};else throw new S_e("No workspace folder provided",Ze.InvalidRequest);let s=await t.get(_f).getRepo(n);if(s&&s.isGitHub()&&s.owner&&s.name)r=r.replace(/\$\{owner\}/g,s.owner),r=r.replace(/\$\{repository\}/g,s.name);else{let c;!s||!s.isGitHub()?c="The workspace folder is not a GitHub repository.":!s.owner&&!s.name?c="Git repository detected but both owner and repository name information are missing. Ensure the repository has a valid remote origin.":s.owner?s.name||(c="Git repository detected but repository name is missing. Ensure the repository has a valid remote origin."):c="Git repository detected but owner information is missing. Ensure the repository has a valid remote origin.";let l=`Cannot obtain GitHub information for workspace folder: ${n.uri}. Template variables \${owner} and \${repository} require a valid Git repository with remote GitHub origin configured: ${c}`;throw new S_e(l,Ze.NoGitHubRepository)}}return r}a(s5c,"replaceTemplateVariables");function a5c(t){let e=0,r=0,n=0,o=0;for(let s of t)switch(s.copilotWorkStatus){case"in_progress":e++;break;case"done":r++;break;case"error":n++;break;case"not_copilot_issue":default:o++;break}return{totalPRs:t.length,inProgressPRs:e,donePRs:r,errorPRs:n,notCopilotPRs:o}}a(a5c,"buildCopilotWorkStatusMeasurements");var K$i=Oe(n5c,i5c);p();var c5c=new fe("hook.list"),l5c=S.Object({workspaceFolders:S.Optional(S.Array(Bc))});function u5c(t){let e=[];for(let r of t){let n=new Map;for(let o of r.hooks){let s=ufr[o.type];if(s===void 0)continue;let c=o.hooks.map(u=>dfr(u,"")).filter(u=>u!==void 0);if(c.length===0)continue;let l=n.get(o.uri);l===void 0&&(l={},n.set(o.uri,l)),(l[s]??=[]).push(...c)}for(let[o,s]of n)e.push({uri:o,source:"plugin",pluginUri:r.uri,providers:["BACKGROUND"],hooks:s})}return e}a(u5c,"pluginHookRows");async function d5c(t,e,r){let n=r.workspaceFolders??[],o=W5(t)&&fJ(t)?(async()=>{try{let l=(await t.get(uc).listPlugins()).filter(u=>u.enabled);return u5c(l)}catch(l){return l instanceof bl||c5c.warn(t,"failed to list plugin hooks for hook/list",{err:String(l)}),[]}})():void 0,c=(await t.get(mE).listHooks(n)).map(l=>{let u={};for(let[d,f]of Object.entries(l.parsedPromptFile.hooks))f!==void 0&&(u[d]=[...f]);return{uri:l.promptPath.uri,storage:l.promptPath.storage,providers:["LOCAL","BACKGROUND"],hooks:u}});return o&&c.push(...await o),[c,null]}a(d5c,"listHooks");var J$i=Oe(l5c,d5c);p();Mo();var X$i=WQt.type,oFe;function Z$i(t){return{title:"Completion Accepted",command:jNe,arguments:[t]}}a(Z$i,"makeCommand");async function f5c(t,e,r){oFe&&(oFe.cancel(),oFe.dispose());let n=r.context.triggerKind===1;oFe=new Fn.CancellationTokenSource;let o=oFe.token,s=new i_([e,o]);r.contextItems&&pTt(t,r.contextItems,r.data);let c=hTt(t,r.position,r.textDocument.uri,n);if(c)return[{items:c.map(g=>({command:Z$i(Mt()),...g}))},null];let l=await P9(t,r.textDocument,s),u=r.position,d=await t.get(ry).getCompletions(l,u,s,{isCycling:n,selectedCompletionInfo:r.context.selectedCompletionInfo,formattingOptions:r.formattingOptions,data:r.data});if(!d)return e.isCancellationRequested?[null,{code:Ze.RequestCancelled,message:"Request was canceled"}]:o.isCancellationRequested?[null,{code:Ze.ServerCancelled,message:"Request was superseded by a new request"}]:[{items:[]},null];let f=t.get(Ru);for(let m of d)f.set(m.uuid,{...m,triggerCategory:"ghostText"});return[{items:d.map(m=>({command:Z$i(m.uuid),insertText:m.insertText,range:m.range}))},null]}a(f5c,"handleChecked");var eVi=Oe(HXn,(t,e,r)=>f5c(t,e,r));p();p();function r3r(t){let e=t.indexOf("-----BEGIN CERTIFICATE-----")+27,r=t.indexOf("-----END CERTIFICATE-----"),n=30,o=t.substring(e,e+n)+"..."+t.substring(r-n,r-1);return T_e(o)}a(r3r,"asReadableCert");function T_e(t){return t.replace(/\s/g,"")}a(T_e,"normalizeNewlines");var h5c=S.Object({});async function m5c(t){return[{certificates:(await t.get(pp).getAllRootCAs()).map(T_e)},null]}a(m5c,"handleListCertificatesChecked");var tVi=Oe(h5c,m5c);p();var nVi="mcpGateway/serversChanged",iVi="mcpGateway/serverDetailsChanged",oVi=S.Union([S.Object({kind:S.Literal("user")}),S.Object({kind:S.Literal("project"),workspaceFolder:S.String()}),S.Object({kind:S.Literal("plugin"),pluginId:S.String()})]),g5c=S.Object({source:oVi,name:S.String()}),A5c=S.Union([S.Object({kind:S.Literal("user")}),S.Object({kind:S.Literal("project"),workspaceFolder:S.String()})]),rVi=S.Record(S.String(),S.Unknown()),y5c=S.Object({workspaceFolder:S.String(),user:rVi,project:rVi});async function E5c(t,e,r){let n=eFe(r.user),o=eFe(r.project);return await t.get(ey).applyConfig({workspaceFolder:r.workspaceFolder,user:n,project:o}),[null,null]}a(E5c,"handleApplyConfigChecked");var sVi=Oe(y5c,E5c),_5c=S.Object({scope:A5c});function v5c(t,e,r){return[{servers:t.get(ey).listServers(r.scope).map(s=>({...s,providers:cO(s.source.kind==="plugin",void 0)}))},null]}a(v5c,"handleListServersChecked");var aVi=Oe(_5c,v5c),C5c=g5c;function b5c(t,e,r){return[{details:t.get(ey).getServerDetails(r)},null]}a(b5c,"handleGetServerDetailsChecked");var cVi=Oe(C5c,b5c),S5c=S.Object({source:oVi,name:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});async function T5c(t,e,r){try{return await t.get(ey).serverAction({source:r.source,name:r.name},r.action),[null,null]}catch(n){if(n instanceof bH)return[null,{code:Ze.InvalidRequest,message:n.message,data:{kind:n.code}}];let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:o}]}}a(T5c,"handleServerActionChecked");var lVi=Oe(S5c,T5c);p();p();p();var uVi=de(Xc());var n3r=class extends uVi.ResponseError{static{a(this,"BaseMcpRegistryError")}constructor(e,r,n,o=Ze.InternalError){super(o,e,{errorType:r,...n})}},kie=class extends n3r{static{a(this,"HttpStatusError")}constructor(e,r,n,o=Ze.InternalError){super(e,r,{status:n},o)}},ATt=class extends kie{static{a(this,"AuthError")}constructor(e){super("Missing or invalid authentication token for MCP registry allowlist","authError",e,Ze.NoCopilotToken)}},yTt=class extends kie{static{a(this,"PermissionError")}constructor(e){super("MCP is disabled for this user","permissionError",e)}};var ETt=class extends kie{static{a(this,"TransientError")}constructor(e){let r=`Transient server error when fetching MCP registry allowlist: HTTP ${e}`;super(r,"transientError",e)}};p();function dVi(t){try{if(!("x-metadata"in t))return null;let e=t["x-metadata"];if(typeof e!="object"||e===null)return null;let r=e.registry;if(typeof r!="object"||r===null)return null;let n=r,o=n.api,s=n.mcpServer;if(typeof o!="object"||o===null||typeof s!="object"||s===null)return null;let c=o,l=s;return typeof c.baseUrl=="string"&&c.baseUrl.length>0&&typeof c.version=="string"&&c.version.length>0&&typeof l.name=="string"&&l.name.length>0&&typeof l.version=="string"&&l.version.length>0?{api:{baseUrl:c.baseUrl,version:c.version},mcpServer:{name:l.name,version:l.version},...Object.fromEntries(Object.entries(n).filter(([u])=>!["api","mcpServer"].includes(u)))}:null}catch{return null}}a(dVi,"getRegistryMetadataFromConfig");function fVi(t,e){try{let r=e.server;return"command"in t?!0:"url"in t?I5c(t,r):!1}catch{return!1}}a(fVi,"validateServerConfigurationMatch");function I5c(t,e){if(!e.remotes||e.remotes.length===0)return!1;let r=a(o=>o.replace(/\/+$/,""),"normalizeUrl"),n=r(t.url);return e.remotes.some(o=>r(o.url)===n)}a(I5c,"validateRemoteURL");var pVi=300*1e3,PN=class{constructor(e){this.allowlistCache=null;this.serverCache=null;this.ctx=e}static{a(this,"McpRegistryService")}isAllowlistCacheValid(e,r){return Date.now()-e=500&&u<600?[null,new ETt(u)]:[null,new kie(`Failed to fetch MCP registry allowlist: HTTP ${u}`,"httpError",u)]}}try{let u=await s.text();c=JSON.parse(u)}catch(u){return[null,{code:Ze.InternalError,message:`Failed to parse MCP registry allowlist: ${u instanceof Error?u.message:String(u)}`}]}return!c.mcp_registries||!Array.isArray(c.mcp_registries)?[null,{code:Ze.InternalError,message:"Invalid allowlist format: expected mcp_registries array"}]:c.mcp_registries.some(u=>!u.url||!u.registry_access)?[null,{code:Ze.InternalError,message:"Invalid allowlist format: registry entries missing required fields"}]:(this.allowlistCache={timestamp:Date.now(),data:c,userLogin:r},[c,null])}catch(e){return[null,{code:Ze.InternalError,message:`Failed to fetch MCP registry allowlist: ${e instanceof Error?e.message:String(e)}`}]}}async validateServerConfig(e,r){try{let n=await this.getRegistryInfo();if(n.accessMode==="fallback")return{serverName:e,serverConfig:r,isBlocked:!1};let o=n.registryUrl,s=n.owner,c=await this.checkServerInRegistry(r,o);if(n.accessMode==="allow_all")return{serverName:e,serverConfig:r,isBlocked:!1,registryInfo:c.isFoundInRegistry?s?`Provided by ${s.login} organization`:"Provided by organization":void 0};{let l=!c.isFoundInRegistry;return{serverName:e,serverConfig:r,isBlocked:l,blockReason:l?c.validationError:void 0,registryInfo:l?s?`Blocked by ${s.login} organization registry policy`:"Blocked by organization registry policy":s?`Provided by ${s.login} organization`:"Provided by organization"}}}catch(n){return{serverName:e,serverConfig:r,isBlocked:!0,blockReason:`validation failed: ${n instanceof Error?n.message:String(n)}`,registryInfo:"Blocked by organization registry policy"}}}async checkServerInRegistry(e,r){let n=dVi(e);if(!n)return{isFoundInRegistry:!1,validationError:"does not have valid registry config"};let o=n.mcpServer.name,s=n.mcpServer.version,c=n.api.baseUrl,l=n.api.version,u=a(m=>m.replace(/\/+$/,""),"normalizeUrl");if(u(c)!==u(r))return{isFoundInRegistry:!1,validationError:`does not match allowed registry Url, expected: ${r}, found: ${c}`};let d=`${c.replace(/\/+$/,"")}/${l}/servers`,[f,h]=await this.fetchServer(d,o,s);return f&&!h?fVi(e,f)?{isFoundInRegistry:!0}:{isFoundInRegistry:!1,validationError:"url"in e?"remote server URL does not match any registry remote URL":"local configuration does not match registry server configuration"}:{isFoundInRegistry:!1,validationError:h?`Server validation failed: ${h.message}`:`Server not found in registry ${c}`}}async getRegistryInfo(){let[e,r]=await this.fetchMcpRegistryAllowlist();if(r)return{accessMode:"fallback",errorMessage:`Failed to fetch registry allowlist: ${r.message}`};if(!e?.mcp_registries?.length)return{accessMode:"fallback",errorMessage:"Registry allowlist is empty - allowlist feature is disabled"};let n=e.mcp_registries[0];return{accessMode:n.registry_access,registryUrl:n.url,owner:n.owner}}async fetchServer(e,r,n){let o=encodeURIComponent(r),s=encodeURIComponent(n),c=`${e}/${o}/versions/${s}`;if(this.serverCache&&this.isServerCacheValid(this.serverCache.timestamp)){let l=this.serverCache.data.get(c);if(l)return[l,null]}try{let u=await this.ctx.get(tr).fetch(c,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(u.status===404)return[null,{code:Ze.InternalError,message:"Server not found"}];if(!u.ok)return[null,{code:Ze.InternalError,message:`Failed to fetch server from registry: HTTP ${u.status}`}];let d=await u.text(),f=JSON.parse(d);return(!this.serverCache||!this.isServerCacheValid(this.serverCache.timestamp))&&(this.serverCache={timestamp:Date.now(),data:new Map}),this.serverCache.data.set(c,f),[f,null]}catch(l){return[null,{code:Ze.InternalError,message:`Failed to fetch server from registry: ${l instanceof Error?l.message:String(l)}`}]}}};p();var x5c=S.Object({url:S.String(),source:S.String(),id:S.String(),subfolder:S.Optional(S.String())}),hVi=S.Object({description:S.Optional(S.String()),isRequired:S.Optional(S.Boolean()),format:S.Optional(S.Union([S.Literal("string"),S.Literal("number"),S.Literal("boolean"),S.Literal("filepath")])),value:S.Optional(S.String()),isSecret:S.Optional(S.Boolean()),default:S.Optional(S.String()),placeholder:S.Optional(S.String()),choices:S.Optional(S.Array(S.String()))}),i3r=S.Intersect([hVi,S.Object({variables:S.Optional(S.Record(S.String(),hVi))})]),w5c=S.Intersect([i3r,S.Object({type:S.Literal("positional"),valueHint:S.Optional(S.String()),isRepeated:S.Optional(S.Boolean())})]),R5c=S.Intersect([i3r,S.Object({type:S.Literal("named"),name:S.String(),isRepeated:S.Optional(S.Boolean())})]),mVi=S.Union([w5c,R5c]),sFe=S.Intersect([i3r,S.Object({name:S.String()})]),k5c=S.Object({registryType:S.String(),registryBaseUrl:S.Optional(S.String()),identifier:S.String(),version:S.Optional(S.String()),fileSha256:S.Optional(S.String()),runtimeHint:S.Optional(S.String()),transport:S.Optional(S.Union([S.Object({type:S.Literal("stdio")}),S.Object({type:S.Literal("streamable-http"),url:S.String(),headers:S.Optional(S.Array(sFe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(sFe))})])),runtimeArguments:S.Optional(S.Array(mVi)),packageArguments:S.Optional(S.Array(mVi)),environmentVariables:S.Optional(S.Array(sFe))}),P5c=S.Union([S.Object({type:S.Literal("streamable-http"),url:S.String(),headers:S.Optional(S.Array(sFe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(sFe))})]),D5c=S.Object({src:S.String(),mimeType:S.Optional(S.Union([S.Literal("image/png"),S.Literal("image/jpeg"),S.Literal("image/jpg"),S.Literal("image/svg+xml"),S.Literal("image/webp")])),sizes:S.Optional(S.Array(S.String())),theme:S.Optional(S.Union([S.Literal("light"),S.Literal("dark")]))}),N5c=S.Object({status:S.Optional(S.Union([S.Literal("active"),S.Literal("deprecated"),S.Literal("deleted")])),publishedAt:S.Optional(S.String()),updatedAt:S.Optional(S.String()),isLatest:S.Optional(S.Boolean())},{additionalProperties:!1}),M5c=S.Object({"io.modelcontextprotocol.registry/publisher-provided":S.Optional(S.Object({tool:S.Optional(S.String()),version:S.Optional(S.String()),buildInfo:S.Optional(S.Object({commit:S.Optional(S.String()),timestamp:S.Optional(S.String()),pipelineId:S.Optional(S.String())}))},{additionalProperties:!0}))},{additionalProperties:!0}),O5c=S.Object({"io.modelcontextprotocol.registry/official":S.Optional(N5c)},{additionalProperties:!0}),L5c=S.Object({name:S.String(),description:S.String(),title:S.Optional(S.String()),repository:S.Optional(x5c),version:S.String(),websiteUrl:S.Optional(S.String()),icons:S.Optional(S.Array(D5c)),$schema:S.Optional(S.String()),packages:S.Optional(S.Array(k5c)),remotes:S.Optional(S.Array(P5c)),_meta:S.Optional(M5c)}),B5c=S.Object({server:L5c,_meta:O5c}),INh=S.Object({servers:S.Array(B5c),metadata:S.Optional(S.Object({nextCursor:S.Optional(S.String()),count:S.Optional(S.Number())}))}),gVi=S.Object({baseUrl:S.String(),cursor:S.Optional(S.String()),limit:S.Optional(S.Number({minimum:1})),search:S.Optional(S.String()),updatedSince:S.Optional(S.String()),version:S.Optional(S.String())}),AVi=S.Object({baseUrl:S.String(),serverName:S.String(),version:S.String()});var aFe="mcp.registry.listServers",I_e="mcp.registry.getServer";async function F5c(t,e,r,n){return await t.get(PN).fetchServer(e,r,n)}a(F5c,"fetchServer");async function U5c(t,e,r){if(!r.baseUrl)return[null,{code:Ze.InvalidParams,message:"Base URL is required"}];let n=t.get(tr),o=new URLSearchParams;r.limit!==void 0&&o.append("limit",r.limit.toString()),r.cursor!==void 0&&o.append("cursor",r.cursor),r.search!==void 0&&o.append("search",r.search),r.updatedSince!==void 0&&o.append("updated_since",r.updatedSince),r.version!==void 0&&o.append("version",r.version);let s=`${r.baseUrl}${o.toString()?`?${o.toString()}`:""}`;try{let c=await n.fetch(s,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(!c.ok){let d=`MCP Registry API error: HTTP ${c.status}`;return eg(t,aFe,Wt.createAndMarkAsIssued({message:d})),[null,{code:Ze.InternalError,message:d}]}let l=await c.text(),u=JSON.parse(l);return Et(t,aFe,Wt.createAndMarkAsIssued()),At(t,aFe),[u,null]}catch(c){Vn(t,aFe,c);let l=`Failed to fetch servers from MCP Registry: ${c instanceof Error?c.message:String(c)}`;return eg(t,aFe,Wt.createAndMarkAsIssued({message:l})),[null,{code:Ze.InternalError,message:l}]}}a(U5c,"handleListServersChecked");async function Q5c(t,e,r){if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];if(!r.baseUrl)return[null,{code:Ze.InvalidParams,message:"Base URL is required"}];if(!r.serverName)return[null,{code:Ze.InvalidParams,message:"Server name is required"}];if(!r.version)return[null,{code:Ze.InvalidParams,message:"Version is required"}];let[n,o]=await F5c(t,r.baseUrl,r.serverName,r.version);if(o){let s={message:o.message};return eg(t,I_e,Wt.createAndMarkAsIssued(s)),At(t,I_e,s),[null,o]}if(!n){let s="Failed to retrieve server data",c={message:s};return eg(t,I_e,Wt.createAndMarkAsIssued(c)),At(t,I_e,c),[null,{code:Ze.InternalError,message:s}]}return Et(t,I_e,Wt.createAndMarkAsIssued()),At(t,I_e),[n,null]}a(Q5c,"handleGetServerChecked");var yVi=Oe(gVi,U5c),EVi=Oe(AVi,Q5c);p();p();var _Vi=S.Object({}),q5c=S.Object({login:S.String(),id:S.Number(),type:S.String(),parent_login:S.Union([S.String(),S.Null()]),parent_id:S.Union([S.Number(),S.Null()])}),j5c=S.Object({url:S.String(),registry_access:S.Union([S.Literal("registry_only"),S.Literal("allow_all")]),owner:q5c}),HNh=S.Object({mcp_registries:S.Array(j5c)});async function H5c(t){return await t.get(PN).fetchMcpRegistryAllowlist()}a(H5c,"fetchMcpRegistryAllowlist");async function G5c(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Request was cancelled"}];let[n,o]=await H5c(t);return o?[null,o]:n?n.mcp_registries.length===0?[n,null]:[n,null]:[null,{code:Ze.InternalError,message:"Failed to retrieve MCP registry allowlist data"}]}catch(n){return[null,{code:Ze.InternalError,message:`Unexpected error in MCP registry allowlist handler: ${n instanceof Error?n.message:String(n)}`}]}}a(G5c,"handleGetMcpRegistryAllowlistChecked");var vVi=Oe(_Vi,G5c);p();var SVi=de(cee()),TVi=de(nd()),IVi=de(q_());p();Mo();var $5c=S.Object({edits:S.Array(S.Object({text:S.String(),range:S.Object({start:S.Object({line:S.Number(),character:S.Number()}),end:S.Object({line:S.Number(),character:S.Number()})}),predictedCursorPosition:S.Object({line:S.Number(),character:S.Number()})}))}),qV=class{constructor(e){this.edits=e}static{a(this,"ExternalTestingNextEditDocuments")}},o3r=new fe("setNextEditDocument");function V5c(t,e,r){return o3r.debug(t,`Set Next Edit documents: ${JSON.stringify(r)}`),t.forceSet(qV,new qV(r.edits)),["OK",null]}a(V5c,"handleTestingSetNextEditDocumentChecked");var CVi=Oe($5c,V5c);function bVi(t,e,r,n){let o=t.get(qV);if(o.edits&&o.edits.length>0){let s=o.edits.filter(c=>e.line===c.predictedCursorPosition.line&&e.character===c.predictedCursorPosition.character);return s.length===0?(o3r.debug(t,`No edits match current position ${JSON.stringify(e)}, returning empty results`),[]):(o3r.debug(t,`Returning ${s.length} matching Next Edit documents`),s.map(c=>W5c(c,r,n)))}}a(bVi,"getTestNextEditSuggestions");function W5c(t,e,r){return{text:t.text,textDocument:{uri:e,version:r},range:t.range,command:{title:"Accept inline edit",command:"github.copilot.didAcceptNextEditSuggestionItem",arguments:[Mt()]}}}a(W5c,"createNextEditSuggestion");async function z5c(t,e,r){if(r.textDocument.version===void 0)throw new Error("textDocument.version is undefined");let n=Fs(r.textDocument.uri);t.get(h9).setForRequest(TVi.URI.parse(n),r.diagnostics??[]);let o=bVi(t,r.position,n,r.textDocument.version);if(o)return[{edits:o},null];let s=t.get(Vv);t.get(SVi.ObservableWorkspace).onUserPositionChange(n,new IVi.Position(r.position.line,r.position.character));let c=await s.handleNextEditRequest(n,r.textDocument.version,e);return c?[{edits:c.map(u=>({text:u.edit.text,textDocument:u.edit.textDocument,range:u.edit.range,command:{title:"Accept inline edit",command:jNe,arguments:[u.id]}}))},null]:[{edits:[]},null]}a(z5c,"handleChecked");var xVi=Oe(Ivn,z5c);p();var K5c=S.Object({uuid:S.String({minLength:1}),acceptedLength:S.Optional(S.Number({minimum:1}))});function J5c(t,e,r){let n=t.get(Ru),o=n.get(r.uuid);return o&&(Z5c(r,o)==="full"?(n.delete(r.uuid),Pme(t,o,o.triggerCategory)):qdt(t,o,r.acceptedLength,0,o.triggerCategory,"cumulative")),["OK",null]}a(J5c,"notifyAcceptedChecked");function Z5c(t,e){return t.acceptedLength===void 0?"full":t.acceptedLengthn.get(s)??[]);if(o.length>0){let s=o[0];for(let l of r.uuids)n.delete(l);let c=o.map(l=>({completionText:l.displayText,completionTelemetryData:l.telemetry}));Qdt(t,"ghostText",s.offset,s.uri,c),t.get(iy).resetState()}return["OK",null]}a(r4c,"notifyRejectedChecked");var kVi=Oe(t4c,r4c);p();var n4c=S.Object({uuid:S.String({minLength:1})});function i4c(t,e,r){let o=t.get(Ru).get(r.uuid);return o&&Qlt(t,o.triggerCategory,o),["OK",null]}a(i4c,"notifyShownChecked");var PVi=Oe(n4c,i4c);p();var o4c=S.Object({commandLine:S.String(),shell:S.Optional(S.String())});async function s4c(t,e,r){let n=t.get(tT),o=r.shell||"sh",{subCommands:s,commandNames:c}=await n.parseTerminalCommandDetailed(r.commandLine,o);return[{subCommands:s,commandNames:c},null]}a(s4c,"handleParseTerminalCommandChecked");var DVi=Oe(o4c,s4c);p();p();function NVi(t){return S.Union(Object.values(t).map(e=>S.Literal(e)))}a(NVi,"enumSchema");var a4c=S.Union([S.Object({kind:S.Literal("relativePath"),path:S.String()}),S.Object({kind:S.Literal("github"),repo:S.String(),ref:S.Optional(S.String()),sha:S.Optional(S.String()),path:S.Optional(S.String())}),S.Object({kind:S.Literal("url"),url:S.String(),ref:S.Optional(S.String()),sha:S.Optional(S.String()),path:S.Optional(S.String())}),S.Object({kind:S.Literal("npm"),package:S.String(),version:S.Optional(S.String()),registry:S.Optional(S.String())}),S.Object({kind:S.Literal("pip"),package:S.String(),version:S.Optional(S.String()),registry:S.Optional(S.String())})]),c4c=S.Object({rawValue:S.String(),displayLabel:S.String(),cloneUrl:S.String(),canonicalId:S.String(),cacheSegments:S.Array(S.String()),kind:NVi(MX),ref:S.Optional(S.String()),githubRepo:S.Optional(S.String()),localRepositoryUri:S.Optional(S.String())}),MVi=S.Object({name:S.String(),description:S.String(),version:S.String(),sourceDescriptor:a4c,marketplace:S.String(),marketplaceReference:c4c,marketplaceType:NVi(UDe),readmeUri:S.Optional(S.String())}),jV=S.Object({pluginUri:S.String()}),_Tt=S.Object({source:S.String()});p();var l4c="_direct";function OVi(t,e){let r=t.fromMarketplace,n=r?.name??t.label,o=r?.marketplaceReference.canonicalId??l4c;return{qualifiedId:`${n}@${o}`,name:n,label:t.label,pluginUri:t.uri,...r?.marketplace!==void 0&&{marketplace:r.marketplace},enabled:t.enabled,disabledByPolicy:t.policyBlocked===!0,readOnly:e(t.uri),...r?.description!==void 0&&{description:r.description},...r?.version!==void 0&&{version:r.version},...r?.readmeUri!==void 0&&{readmeUri:r.readmeUri},...r?.marketplaceType!==void 0&&{marketplaceType:r.marketplaceType},...r?.sourceDescriptor!==void 0&&{sourceDescriptor:r.sourceDescriptor},hooks:t.hooks,commands:t.commands,skills:t.skills,agents:t.agents,instructions:t.instructions,mcpServerDefinitions:t.mcpServerDefinitions}}a(OVi,"toPluginListRow");async function Dp(t){try{return[await t(),null]}catch(e){let r=e instanceof Error?e.message:String(e),n=e instanceof xH?e.data:void 0;return[null,{code:Ze.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(Dp,"withPluginErrorHandling");async function u4c(t,e,r){return Dp(()=>t.get(uc).disablePlugin(r.pluginUri))}a(u4c,"handlePluginsDisableChecked");var LVi=Oe(jV,u4c);p();async function d4c(t,e,r){return Dp(()=>t.get(uc).enablePlugin(r.pluginUri))}a(d4c,"handlePluginsEnableChecked");var BVi=Oe(jV,d4c);p();var f4c=S.Object({plugin:MVi});async function p4c(t,e,r){return Dp(async()=>({pluginUri:await t.get(uc).installPlugin(r.plugin)}))}a(p4c,"handlePluginsInstallChecked");var FVi=Oe(f4c,p4c);p();var h4c=S.Object({source:S.String(),pluginName:S.Optional(S.String())});async function m4c(t,e,r){return Dp(()=>t.get(uc).installPluginFromSource(r.source,r.pluginName))}a(m4c,"handlePluginsInstallFromSourceChecked");var UVi=Oe(h4c,m4c);p();var g4c=S.Object({});async function A4c(t,e,r){return Dp(async()=>{let n=t.get(uc);return(await n.listPlugins()).map(s=>OVi(s,c=>n.isReadOnlyPlugin(c)))})}a(A4c,"handlePluginsListChecked");var QVi=Oe(g4c,A4c);p();async function y4c(t,e,r){return Dp(()=>t.get(uc).addMarketplace(r.source))}a(y4c,"handleMarketplaceAddChecked");var qVi=Oe(_Tt,y4c);p();var E4c=S.Object({source:S.Optional(S.String())});async function _4c(t,e,r){return Dp(()=>t.get(uc).browseMarketplace(r.source))}a(_4c,"handleMarketplaceBrowseChecked");var jVi=Oe(E4c,_4c);p();var v4c=S.Object({});async function C4c(t,e,r){return Dp(async()=>[...await t.get(uc).listMarketplaces()])}a(C4c,"handleMarketplaceListChecked");var HVi=Oe(v4c,C4c);p();async function b4c(t,e,r){return Dp(()=>t.get(uc).removeMarketplace(r.source))}a(b4c,"handleMarketplaceRemoveChecked");var GVi=Oe(_Tt,b4c);p();async function S4c(t,e,r){return Dp(()=>t.get(uc).uninstallPlugin(r.pluginUri))}a(S4c,"handlePluginsUninstallChecked");var $Vi=Oe(jV,S4c);p();async function T4c(t,e,r){return Dp(async()=>({updated:await t.get(uc).updatePlugin(r.pluginUri)}))}a(T4c,"handlePluginsUpdateChecked");var VVi=Oe(jV,T4c);p();var I4c=qXn;function x4c(t,e,r){let n=t.get(hm),o={unregistered:[],registered:[]};return r.providers.forEach(s=>{try{let c=new C_e(t,s.id,s.selector);n.registerContextProvider(c),o.registered.push(s.id)}catch{o.unregistered.push(s.id)}}),[o,null]}a(x4c,"registerContextProviders");var WVi=Oe(I4c,x4c);p();p();var w4c=S.Object({uri:S.Optional(S.String())}),R4c=S.Object({showEditorCompletions:S.Optional(S.Boolean()),enableAutoCompletions:S.Optional(S.Boolean()),delayCompletions:S.Optional(S.Boolean()),filterCompletions:S.Optional(S.Boolean())}),YVi=S.Object({github:S.Optional(S.Object({copilot:S.Optional(S.Object({}))})),[gQr]:S.Optional(w4c),http:S.Optional(Mdn),telemetry:S.Optional(S.Object({telemetryLevel:S.Optional(S.String())}))}),cFe=Object.keys(YVi.properties).filter(t=>t!=="github"),k4c=S.Intersect([YVi,R4c]),P4c=S.Object({settings:S.Optional(S.Union([S.Object({}),S.Array(S.Unknown(),{maxItems:0})])),authProvider:S.Optional(S.Never())}),zVi=qu.Compile(P4c),s3r=qu.Compile(k4c);function QL(t){if(typeof t=="string")return{type:"content",content:t};if(t&&typeof t=="object"){let e=t;if(e.type==="file"&&typeof e.uri=="string")return{type:"file",uri:e.uri};if(e.type==="location"&&typeof e.path=="string")return{type:"location",path:e.path};if(e.type==="content"&&typeof e.content=="string")return{type:"content",content:e.content};if(typeof e.uri=="string")return{type:"file",uri:e.uri};if(typeof e.content=="string")return{type:"content",content:e.content}}return{type:"content",content:""}}a(QL,"normalizePromptSetting");async function CTt(t,e){if(!zVi.Check(e))throw vTt(t),new QA(zVi.Errors(e));let r=Array.isArray(e.settings)?{}:e.settings;return r&&D4c(t,r),vTt(t,r),Promise.resolve()}a(CTt,"notifyChangeConfiguration");function D4c(t,e){for(let n of s3r.Errors(e)){let o=n.path.split("/")?.[1];$o.warn(t,`Invalid ${n.path.slice(1).replace(/\//g,".")} setting:`,n.message),delete e[o]}if(!s3r.Check(e))throw new QA(s3r.Errors(e));e.http&&a3r(t,e.http);let r=e["github-enterprise"];r&&l7e(t,r.uri),e.github?.copilot&&N4c(t,e.github.copilot)}a(D4c,"applySettingsToConfiguration");function N4c(t,e){let r=t.get(rb),n={};for(let o of Object.values(Ye)){let s=Bdn(e,o);n[o]=s}r.setCopilotSettings(n),Xhe.clearCache(),GSt.clearCache(),typeof e.mcp=="string"&&W4c(t,e.mcp),e.agent&&typeof e.agent=="object"&&(z4c(t,e.agent),Y4c(t,e.agent),K4c(t,e.agent)),M4c(t,e.globalCopilotInstructions),O4c(t,e.globalGitCommitInstructions),L4c(t,e.globalAgentsMdInstructions),B4c(t,e.globalClaudeMdInstructions),F4c(t,e.globalInstructionFiles),U4c(t,e.globalPromptFiles),H4c(t,e.instructionFileLocations),G4c(t,e.promptFileLocations),$4c(t,e.agentFileLocations),V4c(t,e.skillFileLocations)}a(N4c,"applyCopilotConfiguration");function M4c(t,e){try{let r=t.get(bf),n=QL(e);r.setGlobalCopilotInstructions(n)}catch(r){$o.error(t,"Failed to apply global Copilot instructions configuration",r)}}a(M4c,"applyGlobalCopilotInstructionsConfiguration");function O4c(t,e){try{let r=t.get(bf),n=QL(e);r.setGlobalGitCommitInstructions(n)}catch(r){$o.error(t,"Failed to apply global Git commit instructions configuration",r)}}a(O4c,"applyGlobalGitCommitInstructionsConfiguration");function L4c(t,e){try{let r=t.get(bf),n=QL(e);r.setGlobalAgentsMdInstructions(n)}catch(r){$o.error(t,"Failed to apply global Agents.md instructions configuration",r)}}a(L4c,"applyGlobalAgentsMdInstructionsConfiguration");function B4c(t,e){try{let r=t.get(bf),n=QL(e);r.setGlobalClaudeMdInstructions(n)}catch(r){$o.error(t,"Failed to apply global Claude.md instructions configuration",r)}}a(B4c,"applyGlobalClaudeMdInstructionsConfiguration");function F4c(t,e){try{let r=t.get(bf),n=(e||[]).map(QL);r.setGlobalInstructionFiles(n)}catch(r){$o.error(t,"Failed to apply global instruction files configuration",r)}}a(F4c,"applyGlobalInstructionFilesConfiguration");function U4c(t,e){try{let r=t.get(Cg),n=(e||[]).map(QL);r.setGlobalPromptFiles(n)}catch(r){$o.error(t,"Failed to apply global prompt files configuration",r)}}a(U4c,"applyGlobalPromptFilesConfiguration");function Q4c(t){return t?Array.isArray(t)?t.map(QL):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(Q4c,"normalizeFileLocations");function q4c(t){let e=QL(t);if(t&&typeof t=="object"){let r=t.source;if(typeof r=="string")return{...e,source:r}}return e}a(q4c,"normalizeInstructionPromptSetting");function j4c(t){return t?Array.isArray(t)?t.map(q4c):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(j4c,"normalizeInstructionFileLocations");function H4c(t,e){try{let r=t.get(bf);if(e===void 0)return;r.setInstructionFileLocations(j4c(e))}catch(r){$o.error(t,"Failed to apply instruction file locations configuration",r)}}a(H4c,"applyInstructionFileLocationsConfiguration");function G4c(t,e){try{let r=t.get(Cg);if(e===void 0)return;r.setPromptFileLocations(Q4c(e))}catch(r){$o.error(t,"Failed to apply prompt file locations configuration",r)}}a(G4c,"applyPromptFileLocationsConfiguration");function $4c(t,e){try{let r=t.get(Ld);if(e===void 0)return;let n=e.map(QL);r.setAgentFileLocations(n)}catch(r){$o.error(t,"Failed to apply agent file locations configuration",r)}}a($4c,"applyAgentFileLocationsConfiguration");function V4c(t,e){try{let r=t.get(h0);if(e===void 0)return;let n=e.map(QL);r.setSkillFileLocations(n)}catch(r){$o.error(t,"Failed to apply skill file locations configuration",r)}}a(V4c,"applySkillFileLocationsConfiguration");function a3r(t,e){let r=t.get(rb);e.proxy===void 0&&(e=Odn(r.env));try{r.setHttpSettings(iIe(e))}catch(n){if(!(n instanceof TypeError))throw n;$o.warn(t,"Invalid proxy URL",e.proxy,n),r.setHttpSettings({proxy:""})}}a(a3r,"applyHttpConfiguration");async function W4c(t,e){let r;try{r=eFe(JSON.parse(e||"{}"))}catch(n){$o.error(t,"Failed to parse MCP configuration JSON",n);return}try{await t.get(o_).updateMCPServers(r)}catch(n){$o.error(t,"Failed to apply MCP configuration to McpManager",n)}}a(W4c,"applyMCPConfiguration");function z4c(t,e){try{let r=e;t.get(tT).updateConfiguration(r.tools?.terminal?.autoApprove)}catch(r){$o.error(t,"Failed to apply settings configuration",r)}}a(z4c,"applyTerminalAutoApproveConfiguration");function Y4c(t,e){try{let r=e;t.get(mw).updateRulesFromConfiguration(r.tools?.edit?.autoApprove)}catch(r){$o.error(t,"Failed to apply edit auto approve configuration",r)}}a(Y4c,"applyEditAutoApproveConfiguration");function K4c(t,e){try{let r=e;t.get(dF).updateConfiguration(r.tools?.mcp?.autoApprove)}catch(r){$o.error(t,"Failed to apply MCP auto approve configuration",r)}}a(K4c,"applyMCPAutoApproveConfiguration");function vTt(t,e){if(t.get(rb).markReady(),!t.get(bn).getCapabilities().redirectedTelemetry){let r=(e?.telemetry?.telemetryLevel??"all")==="all";t.get(pf).initialize(r)}}a(vTt,"initializePostConfigurationDependencies");var KVi=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),J4c=S.Object({editorInfo:KVi,editorPluginInfo:KVi,editorConfiguration:S.Optional(S.Object({}))});async function Z4c(t,e,r){t.get(Ir).setEditorAndPluginInfo(r.editorPluginInfo,r.editorInfo),jdt(t,["setEditorInfo is deprecated. Use initializationOptions for editorInfo and editorPluginInfo","and workspace/didChangeConfiguration for editorConfiguration."]),await CTt(t,{settings:r.editorConfiguration}),Et(t,"setEditorInfo");for(let n of["github",...cFe])r.editorConfiguration&&n in r.editorConfiguration&&Et(t,`setEditorInfo.editorConfiguration.${n}`);return["OK",null]}a(Z4c,"handleSetEditorInfoChecked");var JVi=Oe(J4c,Z4c);p();var X4c=S.Object({options:S.Optional(S.Object({}))});async function eLc(t,e,r){let n=t.get(HT),o=n.pendingSignIn?.status;if(o===void 0)return[null,{code:Ze.InvalidRequest,message:"No pending sign in"}];let s;try{return s=await o,[s,null]}catch(c){return[null,{code:Ze.DeviceFlowFailed,message:String(c)}]}finally{n.pendingSignIn=void 0}}a(eLc,"handleSignInConfirmChecked");var ZVi=Oe(X4c,eLc);p();var tLc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function rLc(t,e,r){try{let o=await t.get(Ur).checkAndUpdateStatus({githubAppId:r.githubAppId});if(o.status==="OK")return[{status:"AlreadySignedIn",user:o.user},null];let c=await t.get(HT).initiate(r);return[{status:"PromptUserDeviceFlow",userCode:c.user_code,verificationUri:c.verification_uri,expiresIn:c.expires_in,interval:c.interval,command:{command:Gdt,title:"Sign in with GitHub",arguments:[]}},null]}catch(n){if(!(n instanceof yi))throw n;return[null,{code:Ze.DeviceFlowFailed,message:n.message}]}}a(rLc,"handleSignInInitiateChecked");var c3r=Oe(tLc,rLc);p();p();p();var XVi=["google","apple"],bTt=S.Optional(S.Union(XVi.map(t=>S.Literal(t))));function eWi(t){return typeof t=="string"&&XVi.includes(t)}a(eWi,"isGitHubSocialProvider");function l3r(t){let e=t.toLowerCase();return e==="github.com"||e.endsWith(".github.com")}a(l3r,"isGitHubSocialProviderApplicableHostname");function tWi(t,e){if(!e)return t;try{let r=new URL(t);return l3r(r.hostname)?(r.searchParams.set("provider",e),r.toString()):t}catch{return t}}a(tWi,"addGitHubSocialProviderToVerificationUri");p();function rWi(){return!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY||(process.platform==="linux"||process.platform==="freebsd"||process.platform==="openbsd")&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)}a(rWi,"isBrowserAvailable");function nLc(t){let e=t.replace(/\/$/,"");return{issuer:e,authorization_endpoint:`${e}/login/oauth/authorize`,token_endpoint:`${e}/login/oauth/access_token`,response_types_supported:["code"],code_challenge_methods_supported:["S256"],grant_types_supported:["authorization_code"],scopes_supported:["repo","workflow","user","read:org"]}}a(nLc,"getGitHubOAuthServerMetadata");async function STt(t,e,r={},n){let o=performance.now();Dme(t,"codeFlow");let s={status:"NotSignedIn"};try{if(!rWi())throw new FU("Browser not available (SSH session or headless environment). Cannot perform OAuth code flow.");let{serverUrl:c,authAuthority:l}=UU(t,r.authAuthority),u=nLc(c),d=e(t,u),f=r.scopes??["repo","workflow"],h=l3r(new URL(c).hostname)?r.socialProvider:void 0,m=await d.createSession(f,{cancellationToken:n,provider:h,loginHint:r.loginHint}),g=m.scopes||f,A=t.get(zp).findAppIdToAuthenticate(),y=m.account.label;if(!y)throw new yi("Could not resolve GitHub username during sign-in. Please try again.");return s=await t.get(Ur).signInEditor({accessToken:m.accessToken,user:y,githubAppId:A,authAuthority:l,scopes:g?[...g]:void 0}),K2(t,"codeFlow",s.status,performance.now()-o),s}catch(c){throw K2(t,"codeFlow",s.status,performance.now()-o,c),c}}a(STt,"performGitHubOAuthCodeFlow");p();p();p();p$e();var x_e=class extends Vm{constructor(r,n=new u3r){super();this.ctx=r;this.fallback=n}static{a(this,"AgentUrlOpener")}async open(r){let n=this.ctx.get(ar);if(!(n.clientCapabilities?.window?.showDocument?.support&&(await Promise.race([n.connection.window.showDocument({uri:r,external:!0}),new Promise((s,c)=>setTimeout(()=>c(new Error("window/showDocument timed out")),15e3))])).success))return this.fallback.open(r)}},u3r=class extends Vm{static{a(this,"SpawnUrlOpener")}async open(e){await PTe(e)}};p();var nWi=require("crypto"),iWi=de(require("http"));p();var TTt=new fe("OAuth Code Flow");function d3r(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n{},"finishedCb"),d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsingandserver":m=l?bNe(t,e,o.startPosition):()=>{},d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsing":default:m=l?bNe(t,e,o.startPosition):()=>{};break}return{extra:d,postOptions:f,finishedCb:m,engineInfo:h}}a(iWi,"setupCompletionParams");var J3r=new pe("solutions");async function D4c(t,e){let r=e.targetPosition,n=e.textDocument,o=await nWi(t,e,"open copilot",J3r);if("status"in o)return o;let{prompt:s,trailingWs:c,telemetryData:l,repoInfo:u,ourRequestId:d}=o,{extra:f,postOptions:h,finishedCb:m,engineInfo:g}=iWi(t,n,r,s,e,l),A=e.cancellationToken,y={prompt:s,languageId:n.detectedLanguageId,repoInfo:u,ourRequestId:d,engineModelId:g.modelId,count:e.solutionCountTarget,uiKind:"synthesize",postOptions:h,headers:g.headers,extra:f},E=await t.get(bO).fetchAndStreamCompletions(t,y,l.extendedBy(),m,A);if(E.type==="failed"||E.type==="canceled")return{status:"FinishedWithError",error:`${E.type}: ${E.reason}`};let _=E.choices;_=rWi(_),_=Sxe(_,T=>zNe(t,n,r,T,!1,J3r));let v=Sxe(_,async T=>{let w=T.completionText;J3r.info(t,`Open Copilot completion: [${T.completionText}]`);let R=await Uei(t,n,r,T.completionText)??Au.position(r.line,0),[x]=YH(n.getText(Au.range(R,r)));w=x+w;let P=T.completionText;c.length>0&&P.startsWith(c)&&(P=P.substring(c.length));let D=T.meanLogProb,N=D!==void 0?Math.exp(D):0,L=l.extendedBy({choiceIndex:T.choiceIndex.toString()});return{completionText:P,insertText:w,range:Au.range(R,r),meanProb:N,meanLogProb:D||0,requestId:T.requestId,choiceIndex:T.choiceIndex,telemetryData:L,copilotAnnotations:T.copilotAnnotations}});return K3r(A,v[Symbol.asyncIterator]())}a(D4c,"launchSolutions");async function LTt(t,e,r){return t.get(Ss).trackCompletionJob(async()=>{let o=D4c(t,e);return await Y3r(o,r)})}a(LTt,"runSolutions");var sWi=fe(bU()),IFe=fe(Fc());p();Mo();p();function BTt(t,e){let r=t.split(` +`),n=e,o=e,s=r[e.line],c=s.indexOf("%");c!==-1&&(s=s.substring(0,c)+s.substring(c+1),n={line:e.line,character:c});let l=s.indexOf("^");if(l!==-1){let u=s.indexOf("^",l+1);if(u===-1)throw new Error("Challenge document must contain zero or two ^ characters.");s=s.substring(0,l)+s.substring(l+1,u)+s.substring(u+1),n={line:e.line,character:e.character},o={line:e.line,character:e.character+u-l-1}}return{cursorLine:s,lines:r,start:n,end:o}}a(BTt,"parseChallengeDoc");var N4c=S.Object({text:S.String(),score:S.Number()}),M4c=S.Object({documents:S.Array(N4c),options:S.Optional(S.Object({}))});async function FTt(t,e,r){let n=Nt();for(let o=0;oh+m.length+1,0)+d.character,await r.onSolution({requestId:{headerRequestId:n,serverExperiments:"",deploymentId:""},completionText:f,insertText:f,range:{start:t,end:t},meanProb:c,meanLogProb:-1,choiceIndex:o,telemetryData:ix.createEmptyConfigForTesting()})}await r.onFinishedNormally()}a(FTt,"runTestSolutions");var FN=class{constructor(e){this.documents=e}static{a(this,"ExternalTestingPanelCompletionDocuments")}};function O4c(t,e,r){return t.forceSet(FN,new FN(r.documents)),["OK",null]}a(O4c,"handleTestingSetPanelCompletionDocumentsChecked");var oWi=xe(M4c,O4c);var aWi=XKe.type;function L4c(t,e,r,n,o){let s=OTt(n.completionText),c=(0,sWi.SHA256)(s).toString();return t.get(ku).set(c,{displayText:n.completionText,insertText:n.insertText,offset:r,uuid:c,range:n.range,uri:e.textDocument.uri,telemetry:n.telemetryData.extendedBy({},{rank:o-1}),index:n.choiceIndex,position:e.position,resultType:0,triggerCategory:"solution",copilotAnnotations:n.copilotAnnotations,clientCompletionId:c}),{range:n.range,insertText:n.insertText,command:{command:ILr,title:`Accept completion ${o}`,arguments:[c]}}}a(L4c,"makeCompletion");function X3r(t,e){return`${t}/${e}`}a(X3r,"progressMessage");var Z3r=class{constructor(e,r,n){this.ctx=e;this.params=r;this.onCompletion=n;this.offset=0;this.count=0;this.items=new Map}static{a(this,"SolutionHandler")}get service(){return this.ctx.get(Xt)}async onSolution(e){this.count+=1;let r=L4c(this.ctx,this.params,this.offset,e,this.items.size+1);this.items.has(r.command.arguments[0])||(this.items.set(r.command.arguments[0],r),await this.onCompletion(r)),this.params.workDoneToken!==void 0&&await this.service.connection.sendProgress(IFe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"report",message:X3r(this.count,10),percentage:Math.round(100*this.count/10)})}onFinishedNormally(){return B4c(this.params.workDoneToken,this.service,this.count)}async onFinishedWithError(e){if(this.error=e,this.params.workDoneToken!==void 0)return this.service.connection.sendProgress(IFe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"end",message:`Error: ${e}`})}};async function B4c(t,e,r=0){t!==void 0&&await e.connection.sendProgress(IFe.WorkDoneProgress.type,t,{kind:"end",message:X3r(r,10)})}a(B4c,"reportDone");var TFe;async function F4c(t,e,r){let n=await j9(t,r.textDocument,e),o=r.position;r.workDoneToken!==void 0&&await t.get(Xt).connection.sendProgress(IFe.WorkDoneProgress.type,r.workDoneToken,{kind:"begin",title:"GitHub Copilot Completions Panel",cancellable:!0,message:X3r(0,10),percentage:0});let s=[],c=a(f=>(s.push(f),Promise.resolve()),"onCompletion"),l=r.partialResultToken;l!==void 0&&(c=a(async f=>{await t.get(Xt).connection.sendProgress(XKe.partialResult,l,{items:[f]})},"onCompletion"));let u=new Z3r(t,r,c),d=t.get(FN);if(d.documents){let f=d.documents;await FTt(o,f,u)}else{u.offset=n.offsetAt(o);let f=new U_e(n,o,e,10);await LTt(t,f,u)}return u.error!==void 0?[null,{code:Xe.InternalError,message:u.error}]:[{items:s},null]}a(F4c,"handleChecked");async function U4c(t,e,r){TFe&&(TFe.cancel(),TFe.dispose()),TFe=new Fn.CancellationTokenSource;let n=TFe.token,o=new l_([e,n]);try{return await F4c(t,o,r)}catch(s){if(n.isCancellationRequested&&!e.isCancellationRequested)return[null,{code:Xe.ServerCancelled,message:"Request was superseded by a new request"}];throw s}}a(U4c,"handleCheckedWithAbort");var cWi=xe(ibn,U4c);p();var q4c=S.Object({workspaceFolders:S.Optional(S.Array(qc))});async function j4c(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(jd).listCustomAgents(n,{includePlugins:!0,includeRuntimeAgents:!0})).map(c=>{let l=c.promptFileEntry?.promptPath?.storage;return{id:c.id,name:c.name,description:c.description,extensionId:c.extensionId,pluginUri:c.pluginUri,invokePolicy:c.invokePolicy,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,source:c.source,uri:c.promptFileEntry?.promptPath?.uri??c.id,storage:l,providers:$S(c.pluginUri!==void 0,c.providers)}}),null]}a(j4c,"listCustomAgents");var lWi=xe(q4c,j4c);p();var H4c=new pe("customAgent/registerExtensionAgents"),G4c=S.Object({uri:S.String(),name:S.String(),description:S.String()}),$4c=S.Object({extensionId:S.String(),agents:S.Array(G4c)});function V4c(t,e,r){try{t.get(jd).registerExtensionAgent(r.extensionId,r.agents)}catch(n){H4c.warn(t,`Failed to register extension agents for ${r.extensionId}:`,n);let o=n instanceof Error?n.message:String(n);return[null,{code:Xe.InternalError,message:`Failed to register extension agents: ${o}`}]}return[null,null]}a(V4c,"registerExtensionAgents");var uWi=xe($4c,V4c);p();var W4c=S.Object({extensionId:S.String()});function z4c(t,e,r){return t.get(jd).unregisterExtensionAgents(r.extensionId),[null,null]}a(z4c,"unregisterExtensionAgents");var dWi=xe(W4c,z4c);p();var Y4c=S.Object({workspaceFolders:S.Optional(S.Array(qc))});async function K4c(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(wf).listCustomInstructions(n,{includePlugins:!0})).map(c=>({uri:c.uri,name:c.name,applyTo:c.applyTo,description:c.description,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,source:c.source,storage:c.promptFileEntry?.promptPath.storage,pluginUri:c.pluginUri,providers:$S(c.pluginUri!==void 0,c.providers)})),null]}a(K4c,"listCustomInstructions");var fWi=xe(Y4c,K4c);p();var J4c=S.Object({workspaceFolders:S.Optional(S.Array(qc))});async function Z4c(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Ig).listCustomPrompts(n,{includePlugins:!0})).map(c=>{let l=c.promptFileEntry?.promptPath.storage;return{uri:c.uri,name:c.name,description:c.description,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,storage:l,pluginUri:c.pluginUri,providers:$S(c.pluginUri!==void 0,c.providers)}}),null]}a(Z4c,"listCustomPrompts");var pWi=xe(J4c,Z4c);p();var X4c=S.Object({workspaceFolders:S.Optional(S.Array(qc))});async function eLc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(A0).listSkills(n,{includePlugins:!0})).map(c=>({id:c.id,name:c.name,description:c.description,uri:c.uri,storage:c.storage,pluginUri:c.pluginUri,providers:$S(c.pluginUri!==void 0,c.providers)})),null]}a(eLc,"listCustomSkills");var hWi=xe(X4c,eLc);p();p();p();function tLc(t,e,r){let{apiUrl:n,serverUrl:o}=r||t.get(Km).getConfiguredUrls(),s=new URL("login/device",o).href,c=new URL("_ping",e.proxy).href,l=new URL("_ping",e.api).href,u=new URL("_ping",e.telemetry).href;function d(f){return new URL(f).host}return a(d,"label"),[{label:d(s),url:s},{label:d(n),url:n,session:r},{label:d(c),url:c},{label:d(l),url:l,session:r},{label:d(u),url:u}]}a(tLc,"urlsToCheck");async function mWi(t,e,r=RB(t),n,o){let s=tLc(t,r,n).map(async({label:c,url:l,session:u})=>{let{message:d,status:f}=await rLc(e,l,u,o);return{label:c,url:l,message:d,status:f}});return await Promise.all(s)}a(mWi,"checkReachability");async function rLc(t,e,r,n){try{let o=new AbortController;n?.onCancellationRequested(()=>o.abort());let s=await t.fetch(e,{headers:r?{Authorization:`Bearer ${r.accessToken}`}:{},signal:o.signal}),c=s.status>=200&&s.status<400?"reachable":"unreachable";return{message:`HTTP ${s.status}`+(s.statusText?` - ${s.statusText}`:""),status:c}}catch(o){return{message:String(o),status:"unreachable"}}}a(rLc,"determineReachability");var kI=fe(require("os")),Q_e=fe(require("tls"));async function AWi(t,e){let r=await t.get(nr).getImplementation(),n=await t.get(Ft).getGitHubSession(),o=await t.get(Ft).getToken().catch(()=>{});return{sections:[iLc(t),nLc(t,n),oLc(t,r),await sLc(t,r,o?.endpoints,n,e)]}}a(AWi,"collectDiagnostics");function yWi(t){return t.sections.map(aLc).join(kI.EOL+kI.EOL)+kI.EOL}a(yWi,"formatDiagnosticsAsMarkdown");function nLc(t,e){let r=e&&new URL(e.serverUrl).host,n;return e?r==="github.com"?n=e.login:n=`${e.login} (${r})`:n="not signed in",{name:"Copilot",items:{Version:J1(t),"GitHub Account":n,"Session ID":t.get(qa).sessionId,"Send Restricted Telemetry":kse(t)?"enabled":"disabled","Content Exclusion":t.get(sc).enabled?"enabled":"unavailable"}}}a(nLc,"collectCopilotSection");function iLc(t){let e={Plugin:lLc(t),Editor:cLc(t),"Operating System":`${kI.type()} ${kI.release()} (${kI.arch()})`};return GL(e,"NODE_OPTIONS"),{name:"Environment",items:e}}a(iLc,"collectEnvironmentSection");function oLc(t,e){let r=t.get(Lo).getHttpSettings(),n={Proxy:r.proxy||void 0,"Proxy Authorization":r.proxyAuthorization?"present":void 0,"Proxy Kerberos SPN":r.proxyKerberosServicePrincipal,"Proxy Strict SSL":r.proxyStrictSSL===!1?"disabled":"enabled","No Proxy":r.noProxy?.join(",")||void 0,Fetcher:e.name.replace(/Fetcher$/,""),"Number of Root Certificates":Q_e.rootCertificates.length,"TLS Default Min Version":Q_e.DEFAULT_MIN_VERSION,"TLS Default Max Version":Q_e.DEFAULT_MAX_VERSION};return GL(n,"http_proxy"),GL(n,"https_proxy"),GL(n,"no_proxy"),GL(n,"SSL_CERT_FILE"),GL(n,"SSL_CERT_DIR"),GL(n,"OPENSSL_CONF"),GL(n,"NODE_EXTRA_CA_CERTS"),GL(n,"NODE_TLS_REJECT_UNAUTHORIZED"),{name:"Network Configuration",items:n}}a(oLc,"collectNetworkConfigSection");async function sLc(t,e,r,n,o){return{name:"Reachability",items:Object.fromEntries((await mWi(t,e,r,n,o)).map(({label:c,message:l})=>[c,l]))}}a(sLc,"collectReachabilitySection");function gWi(t){return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}a(gWi,"quoteCode");function GL(t,e){let r=process.env[e];r&&(t[gWi(e)]=gWi(r)),r!==process.env[e.toUpperCase()]&&GL(t,e.toUpperCase())}a(GL,"addEnvironmentVariable");function aLc(t){return`## ${t.name}`+kI.EOL+kI.EOL+Object.keys(t.items).filter(e=>e!=="name").map(e=>`- ${e}: ${t.items[e]??"N/A"}`).join(kI.EOL)}a(aLc,"formatSectionAsMarkdown");function cLc(t){let e=t.get(Ir).getEditorInfo();return`${e.readableName||e.name} ${e.version}`}a(cLc,"getEditorDisplayVersion");function lLc(t){let e=t.get(Ir).getEditorPluginInfo();return`${e.readableName||e.name} ${e.version}`}a(lLc,"getPluginDisplayVersion");var uLc=S.Object({});async function dLc(t,e){return[{report:yWi(await AWi(t,e))},null]}a(dLc,"handleDiagnosticsChecked");var EWi=xe(uLc,dLc);p();var fLc=S.Object({conversationId:S.String(),sessionTitle:S.Optional(S.String())});async function pLc(t,e,r){let o=await t.get(iy).readSpans(r.conversationId),s=Qlt(o,{conversationId:r.conversationId,sessionTitle:r.sessionTitle});return[{content:JSON.stringify(s,null,2)},null]}a(pLc,"handleExportAgentDebugLogChecked");var _Wi=xe(fLc,pLc);p();var vWi=require("fs"),CWi=fe(require("path"));var hLc=S.Object({conversationId:S.String(),targetPath:S.String(),sessionTitle:S.Optional(S.String())});async function mLc(t,e,r){if(!CWi.isAbsolute(r.targetPath))return[null,{code:Xe.InvalidParams,message:`targetPath must be an absolute path, got: ${r.targetPath}`}];let o=await t.get(iy).readSpans(r.conversationId),s=Qlt(o,{conversationId:r.conversationId,sessionTitle:r.sessionTitle});try{await vWi.promises.writeFile(r.targetPath,JSON.stringify(s,null,2),"utf8")}catch(c){return[null,{code:Xe.InternalError,message:`Failed to write export to ${r.targetPath}: ${c instanceof Error?c.message:String(c)}`}]}return[{exportFilePath:r.targetPath},null]}a(mLc,"handleExportAgentDebugLogToPathChecked");var bWi=xe(hLc,mLc);p();var gLc=S.Object({conversationId:S.String()});async function ALc(t,e,r){return[{spans:await t.get(iy).readSpans(r.conversationId)},null]}a(ALc,"handleGetAgentDebugLogChecked");var SWi=xe(gLc,ALc);p();var yLc=S.Object({conversationId:S.String()});async function ELc(t,e,r){return[{logFilePath:await t.get(iy).getLogFilePath(r.conversationId)},null]}a(ELc,"handleGetAgentDebugLogPathChecked");var TWi=xe(yLc,ELc);p();Mo();var PWi=fe(Fc());p();var IWi=require("crypto");var q_e=class{static{a(this,"LspClientContextProvider")}constructor(e,r,n){this.id=r,this.selector=n,this.resolver=new tFr(e,this.id)}},tFr=class{constructor(e,r){this.ctx=e;this.id=r;this.contextItems=[];this.update=!1}static{a(this,"LspClientContextResolver")}async resolve(e,r){let n=[];if(this.contextItems.length>0)n=this.contextItems;else if(this.update){let o=this.ctx.get(Xt),s=(0,IWi.randomUUID)(),c=o.connection.onProgress(JKe.type,s,l=>{n.push(...l)});r.onCancellationRequested(()=>{c?.dispose()});try{let l=await o.connection.sendRequest(JKe.type,{providerId:this.id,data:this.data,textDocument:{uri:e.documentContext.uri,languageId:e.documentContext.languageId,version:e.documentContext.version},position:e.documentContext.position,partialResultToken:s},r);n.push(...l)}finally{c?.dispose()}}return this.reset(),Promise.resolve(n)}setContextItems(e){this.contextItems=e}clearContextItems(){this.contextItems=[]}setUpdate(e){this.update=e}clearData(){this.data=void 0}reset(){this.clearContextItems(),this.clearData(),this.setUpdate(!1)}};function UTt(t,e,r){try{let n=t.get(Em),o=new Map;n.providers.forEach(s=>{o.set(s.id,s)}),e.providers.forEach(s=>{let c=o.get(s.id);c&&c instanceof q_e&&c.resolver.setContextItems(s.contextItems)}),e.updating&&e.updating.length>0&&e.updating.forEach(s=>{let c=o.get(s);c&&c instanceof q_e&&(c.resolver.setUpdate(!0),c.resolver.data=r)})}catch(n){Nr.error(t,"Failed to set context items on context providers",n)}}a(UTt,"setContextItems");var eFr={nocase:!0,matchBase:!0,nonegate:!0,dot:!0};function xWi(t,e,r){return e.map(o=>{try{if(typeof o=="string")return If(r.uri,o,eFr);if(typeof o=="object"){let s=!0;return"language"in o&&(s&&=r.languageId==(o.language||"")),"scheme"in o&&(s&&=If(r.uri,o.scheme||"",eFr)),"pattern"in o&&(s&&=If(r.uri,o.pattern||"",eFr)),s}}catch{return!1}return!1}).some(Boolean)?10:0}a(xWi,"match");p();var _Lc=S.Object({documents:S.Array(S.String()),basename:S.Optional(S.String()),options:S.Optional(S.Object({}))}),JV=class{constructor(e,r){this.documents=e;this.basename=r}static{a(this,"ExternalTestingCompletionDocuments")}};function vLc(t,e,r){return t.forceSet(JV,new JV(r.documents,r.basename||"")),["OK",null]}a(vLc,"handleTestingSetCompletionDocumentsChecked");var wWi=new pe("setCompletionDocuments"),kWi=xe(_Lc,vLc);function QTt(t,e,r,n){let o=t.get(JV);if(o.documents){let s=n?3:1;if(r&&o.basename&&o.basename.trim().length>0){wWi.debug(t,`Returning filtered completions by basename ${o.basename}`);let c=CLc(o,r);return c&&c.length>0?RWi(c,s,e):void 0}else return wWi.debug(t,"Returning completions for all pre-set documents"),RWi(o.documents,s,e)}}a(QTt,"getTestCompletions");function RWi(t,e,r){return t.slice(0,e).map(n=>{let{cursorLine:o,lines:s,start:c,end:l}=BTt(n,r);return{insertText:[o.slice(Math.min(c.character,r.character))].concat(s.slice(r.line+1)).join(` +`),range:{start:c,end:l}}})}a(RWi,"sliceAndMapCompletions");function CLc(t,e){return t.basename===Ki(e)?t.documents||[]:[]}a(CLc,"getFilteredDocs");var DWi=S.Object({doc:S.Object({position:f0,insertSpaces:S.Optional(S.Boolean()),tabSize:S.Optional(S.Number()),uri:Xxe,version:S.Number()}),contextItems:S.Optional(apr)}),xFe;async function NWi(t,e,r,n){xFe&&(xFe.cancel(),xFe.dispose()),xFe=new Fn.CancellationTokenSource;let o=new l_([e,xFe.token]);r.contextItems&&UTt(t,r.contextItems);let s=QTt(t,r.doc.position,r.doc.uri,n);if(s)return[{completions:s.map(m=>({uuid:Nt(),text:m.insertText,displayText:m.insertText,position:r.doc.position,range:m.range,docVersion:r.doc.version}))},null];let c;try{c=await j9(t,r.doc,o)}catch(h){if(!(h instanceof PWi.ResponseError))throw h;switch(h.code){case Xe.CopilotNotAvailable:case Xe.ContentModified:return[{completions:[]},null]}throw h}let l=r.doc.position;if(l.line>=c.lineCount)return[{completions:[]},null];let u=await t.get(sy).getCompletions(c,l,o,{isCycling:n,formattingOptions:r.doc});if(!u)return[{completions:[]},null];let d=t.get(ku);for(let h of u)d.set(h.uuid,{...h,triggerCategory:"ghostText"});return[{completions:u.map(h=>({uuid:h.uuid,text:h.insertText,range:h.range,displayText:h.displayText,position:h.position,docVersion:c.version}))},null]}a(NWi,"handleGetCompletionsHelper");var MWi=xe(DWi,(t,e,r)=>NWi(t,e,r,!1)),OWi=xe(DWi,(t,e,r)=>NWi(t,e,r,!0));p();var bLc=S.Object({});function SLc(t,e,r){return[{defaultRules:t.get(bw).getDefaultRules()},null]}a(SLc,"handleGetDefaultFileSafetyRulesChecked");var LWi=xe(bLc,SLc);p();var BWi=fe(bU()),j_e=fe(Fc());var TLc=S.Object({doc:S.Object({position:f0,uri:Xxe,version:S.Number()}),panelId:S.String()});function ILc(t,e,r,n,o){let s=OTt(o.completionText),c=(0,BWi.SHA256)(s).toString();return t.get(ku).set(c,{displayText:o.insertText,insertText:o.completionText,offset:n,uuid:c,range:r,uri:e.doc.uri,telemetry:o.telemetryData,index:o.choiceIndex,position:r.end,resultType:0,triggerCategory:"solution",copilotAnnotations:o.copilotAnnotations,clientCompletionId:c}),{panelId:e.panelId,range:r,completionText:o.completionText,displayText:o.insertText,score:o.meanProb,solutionId:c}}a(ILc,"makeSolution");var rFr=class{constructor(e,r,n){this.ctx=e;this.params=r;this.range=n;this.offset=0}static{a(this,"SolutionHandler")}get service(){return this.ctx.get(Xt)}onSolution(e){return this.service.connection.sendNotification(new j_e.NotificationType("PanelSolution"),ILc(this.ctx,this.params,this.range,this.offset,e))}onFinishedNormally(){return FWi(this.params.panelId,this.service)}onFinishedWithError(e){return this.service.connection.sendNotification(new j_e.NotificationType("PanelSolutionsDone"),{status:"Error",message:e,panelId:this.params.panelId})}};async function FWi(t,e){return e.connection.sendNotification(new j_e.NotificationType("PanelSolutionsDone"),{status:"OK",panelId:t})}a(FWi,"reportDone");var wFe;async function xLc(t,e,r){wFe&&(wFe.cancel(),wFe.dispose()),wFe=new Fn.CancellationTokenSource;let n=new l_([e,wFe.token]),o=r.doc.position,s=Au.range(o,o),c=new rFr(t,r,s),l=t.get(FN);if(l.documents){let u=l.documents;FTt(o,u,c)}else{let u;try{u=await j9(t,r.doc,n)}catch(f){if(!(f instanceof j_e.ResponseError))throw f;switch(f.code){case Xe.CopilotNotAvailable:case Xe.ContentModified:return wLc(t,r)}throw f}c.offset=u.offsetAt(o);let d=new U_e(u,o,n,10);LTt(t,d,c)}return[{solutionCountTarget:10},null]}a(xLc,"handleGetPanelCompletionsChecked");async function wLc(t,e){return await FWi(e.panelId,t.get(Xt)),[{solutionCountTarget:0},null]}a(wLc,"produceEmptySolutions");var UWi=xe(TLc,xLc);p();var RLc=S.Object({});async function kLc(t,e,r){let o=(await t.get(Ft).getToken()).userInfo,s=o.raw,l=(await t.get(Mr).resolveSession())?.login;return!s||!l?[null,null]:[{userName:l,copilotPlan:o.copilotPlan,rawUserInfo:s},null]}a(kLc,"handleGetUserInfoChecked");var QWi=xe(RLc,kLc);p();var PLc=S.Object({});function DLc(t,e,r){return[{version:t.get(us).getDisplayVersion(),buildType:VU(t),runtimeVersion:`node/${process.versions.node}`},null]}a(DLc,"handleGetVersionChecked");var qWi=xe(PLc,DLc);p();Mo();var NLc=S.Object({changes:S.Array(S.String()),userCommits:S.Array(S.String()),recentCommits:S.Array(S.String()),workspaceFolder:S.Optional(S.String()),userLanguage:S.Optional(S.String())});async function MLc(t,e,r){if(r.changes.length===0)return[null,{code:Xe.InvalidRequest,message:"No changes provided"}];let n=t.get(zo),o=n.create({capabilities:{skills:[QO]}}),s=new np({message:"",type:"user"});await n.addTurn(o.id,s);let c=M_e({workDoneToken:Nt()});await t.get(wc).begin(o,s,c);let d=(await new Cw(t,o,s,e).skillResolver.resolve(QO))?.head?.name,h=await t.get(SX).generateCommitMessage(t,e,r,d);return h==null?[null,{code:Xe.InternalError,message:"Failed to generate commit message"}]:[{commitMessage:h},null]}a(MLc,"handleGitCommitGenerateChecked");var jWi=xe(NLc,MLc);p();var OLc=S.Object({repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),pullRequestNumber:S.Number()});async function LLc(t,e,r){try{let o=await new nm(t).listPullRequestFiles(r.repoOwner,r.repoName,r.pullRequestNumber);return ft(t,"githubApi.listPullRequestChangedFiles",Vt.createAndMarkAsIssued()),cr(t,"githubApi.listPullRequestChangedFiles"),[{files:o},null]}catch(n){if(xa(t,n,"githubApi.listPullRequestChangedFiles"),Cs(t,"githubApi.listPullRequestChangedFiles",n),n instanceof mE)return[null,{code:Xe.NoGitHubToken,message:n.message}];if(n instanceof od&&n.isClientError())return[null,{code:Xe.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Xe.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Xe.InternalError,message:`Unexpected error happened: ${o}`}]}}a(LLc,"handleListPullRequestChangedFilesChecked");var HWi=xe(OLc,LLc);p();var BLc=S.Object({query:S.String(),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(qc))}),GWi=4,H_e=class extends Error{static{a(this,"TemplateVariableSubstituteError")}constructor(e,r){super(e),this.errorCode=r}};async function FLc(t,e,r){try{let n=new MEe(t),o=await QLc(t,r),s=await n.searchPullRequests(o);await ULc(t,s);let c=qLc(s);return ft(t,"githubApi.searchPR",Vt.createAndMarkAsIssued()),cr(t,"githubApi.searchPR",void 0,c),[{pullRequests:s},null]}catch(n){if(n instanceof H_e)return[null,{code:n.errorCode,message:n.message}];if(n instanceof mE)return[null,{code:Xe.NoGitHubToken,message:n.message}];if(xa(t,n,"githubApi.searchPR"),Cs(t,"githubApi.searchPR",n),n instanceof od&&n.isClientError())return[null,{code:Xe.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Xe.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Xe.InternalError,message:`Unexpected error happened: ${o}`}]}}a(FLc,"handleSearchPRChecked");async function ULc(t,e){let r=new nm(t);for(let n=0;n{try{c.copilotWorkStatus=await r.getCopilotWorkingStatus(c.repository.owner.login,c.repository.name,c.number,c.user?.login)}catch{c.copilotWorkStatus="not_copilot_issue"}});await Promise.all(s)}}a(ULc,"appendCopilotWorkStatus");async function QLc(t,e){let r=e.query;if(r.includes("${user}")){let n=await t.get(Mr).resolveSession();if(!n)throw new H_e("The user is not logged in.",Xe.NoGitHubToken);r=r.replace(/\$\{user\}/g,n.login)}if(r.includes("${owner}")||r.includes("${repository}")){let n;if(e.workspaceFolders&&e.workspaceFolders.length>0)n=e.workspaceFolders[0];else if(e.workspaceFolder)n={uri:e.workspaceFolder};else throw new H_e("No workspace folder provided",Xe.InvalidRequest);let s=await t.get(Tf).getRepo(n);if(s&&s.isGitHub()&&s.owner&&s.name)r=r.replace(/\$\{owner\}/g,s.owner),r=r.replace(/\$\{repository\}/g,s.name);else{let c;!s||!s.isGitHub()?c="The workspace folder is not a GitHub repository.":!s.owner&&!s.name?c="Git repository detected but both owner and repository name information are missing. Ensure the repository has a valid remote origin.":s.owner?s.name||(c="Git repository detected but repository name is missing. Ensure the repository has a valid remote origin."):c="Git repository detected but owner information is missing. Ensure the repository has a valid remote origin.";let l=`Cannot obtain GitHub information for workspace folder: ${n.uri}. Template variables \${owner} and \${repository} require a valid Git repository with remote GitHub origin configured: ${c}`;throw new H_e(l,Xe.NoGitHubRepository)}}return r}a(QLc,"replaceTemplateVariables");function qLc(t){let e=0,r=0,n=0,o=0;for(let s of t)switch(s.copilotWorkStatus){case"in_progress":e++;break;case"done":r++;break;case"error":n++;break;case"not_copilot_issue":default:o++;break}return{totalPRs:t.length,inProgressPRs:e,donePRs:r,errorPRs:n,notCopilotPRs:o}}a(qLc,"buildCopilotWorkStatusMeasurements");var $Wi=xe(BLc,FLc);p();var jLc=new pe("hook.list"),HLc=S.Object({workspaceFolders:S.Optional(S.Array(qc))});function GLc(t){let e=[];for(let r of t){let n=new Map;for(let o of r.hooks){let s=Nlr[o.type];if(s===void 0)continue;let c=o.hooks.map(u=>Mlr(u,"")).filter(u=>u!==void 0);if(c.length===0)continue;let l=n.get(o.uri);l===void 0&&(l={},n.set(o.uri,l)),(l[s]??=[]).push(...c)}for(let[o,s]of n)e.push({uri:o,source:"plugin",pluginUri:r.uri,providers:["BACKGROUND"],hooks:s})}return e}a(GLc,"pluginHookRows");async function $Lc(t,e,r){let n=r.workspaceFolders??[],o=CH(t)&&CJ(t)?(async()=>{try{let l=(await t.get(dc).listPlugins()).filter(u=>u.enabled);return GLc(l)}catch(l){return l instanceof $l||jLc.warn(t,"failed to list plugin hooks for hook/list",{err:String(l)}),[]}})():void 0,c=(await t.get(_E).listHooks(n)).map(l=>{let u={};for(let[d,f]of Object.entries(l.parsedPromptFile.hooks))f!==void 0&&(u[d]=[...f]);return{uri:l.promptPath.uri,storage:l.promptPath.storage,providers:["LOCAL","BACKGROUND"],hooks:u}});return o&&c.push(...await o),[c,null]}a($Lc,"listHooks");var VWi=xe(HLc,$Lc);p();Mo();var zWi=Uqt.type,RFe;function WWi(t){return{title:"Completion Accepted",command:rMe,arguments:[t]}}a(WWi,"makeCommand");async function VLc(t,e,r){RFe&&(RFe.cancel(),RFe.dispose());let n=r.context.triggerKind===1;RFe=new Fn.CancellationTokenSource;let o=RFe.token,s=new l_([e,o]);r.contextItems&&UTt(t,r.contextItems,r.data);let c=QTt(t,r.position,r.textDocument.uri,n);if(c)return[{items:c.map(g=>({command:WWi(Nt()),...g}))},null];let l=await j9(t,r.textDocument,s),u=r.position;if(u.line>=l.lineCount)return[{items:[]},null];let d=await t.get(sy).getCompletions(l,u,s,{isCycling:n,selectedCompletionInfo:r.context.selectedCompletionInfo,formattingOptions:r.formattingOptions,data:r.data});if(!d)return e.isCancellationRequested?[null,{code:Xe.RequestCancelled,message:"Request was canceled"}]:o.isCancellationRequested?[null,{code:Xe.ServerCancelled,message:"Request was superseded by a new request"}]:[{items:[]},null];let f=t.get(ku);for(let m of d)f.set(m.uuid,{...m,triggerCategory:"ghostText"});return[{items:d.map(m=>({command:WWi(m.uuid),insertText:m.insertText,range:m.range}))},null]}a(VLc,"handleChecked");var YWi=xe(Rei,(t,e,r)=>VLc(t,e,r));p();p();function nFr(t){let e=t.indexOf("-----BEGIN CERTIFICATE-----")+27,r=t.indexOf("-----END CERTIFICATE-----"),n=30,o=t.substring(e,e+n)+"..."+t.substring(r-n,r-1);return G_e(o)}a(nFr,"asReadableCert");function G_e(t){return t.replace(/\s/g,"")}a(G_e,"normalizeNewlines");var zLc=S.Object({});async function YLc(t){return[{certificates:(await t.get(gp).getAllRootCAs()).map(G_e)},null]}a(YLc,"handleListCertificatesChecked");var KWi=xe(zLc,YLc);p();p();p();var kFe=require("node:util");var KLc=new Map([["",{strategy:"merge-properties"}],["permissions",{strategy:"merge-properties"}],["permissions.disableBypassPermissionsMode",{strategy:"enum-order-wins",order:["disable"]}],["permissions.model",{strategy:"enum-order-wins",order:["auto"]}],["enabledPlugins",{strategy:"deny-wins"}],["extraKnownMarketplaces",{strategy:"allowlist-intersection"}],["strictKnownMarketplaces",{strategy:"allowlist-intersection"}],["telemetry",{strategy:"most-restrictive-wins",restrictiveBooleans:{enabled:!0,lockCaptureContent:!0}}]]),JWi=new Set(["__proto__","constructor","prototype"]);function Uie(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(Uie,"isObject");function iFr(t){let e=new Set;for(let r of t)if(Uie(r))for(let n of Object.keys(r))JWi.has(n)||e.add(n);return e}a(iFr,"safeKeys");function oFr(t,e){return t.map(r=>Uie(r)&&Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0)}a(oFr,"childValues");function JLc(t,e){for(let r of e){let n=t.find(o=>(0,kFe.isDeepStrictEqual)(o,r));if(n!==void 0)return n}return t[0]}a(JLc,"composeEnumOrder");function ZLc(t,e){if(!t.every(Uie))return t[0];let r=[];for(let n of iFr(t)){let o=e?`${e}.${n}`:n,s=sFr(oFr(t,n),o);s!==void 0&&r.push([n,s])}return Object.fromEntries(r)}a(ZLc,"composeProperties");function XLc(t){if(!t.every(Uie))return t[0];let e=[];for(let r of iFr(t)){let n=oFr(t,r).filter(o=>typeof o=="boolean");n.includes(!1)?e.push([r,!1]):n.includes(!0)&&e.push([r,!0])}return Object.fromEntries(e)}a(XLc,"composeDenyWins");function eBc(t){let e=t[0];if(Array.isArray(e)){if(!t.every(Array.isArray))return[];let r=[];for(let n of e)t.slice(1).every(o=>o.some(s=>(0,kFe.isDeepStrictEqual)(s,n)))&&!r.some(o=>(0,kFe.isDeepStrictEqual)(o,n))&&r.push(n);return r}if(Uie(e)){if(!t.every(Uie))return{};let r=[];for(let[n,o]of Object.entries(e))!JWi.has(n)&&t.slice(1).every(s=>Object.prototype.hasOwnProperty.call(s,n)&&(0,kFe.isDeepStrictEqual)(s[n],o))&&r.push([n,o]);return Object.fromEntries(r)}return e}a(eBc,"composeAllowlistIntersection");function tBc(t,e,r){if(!t.every(Uie))return t[0];let n=[];for(let o of iFr(t)){let s=oFr(t,o),c=Object.prototype.hasOwnProperty.call(r,o)?r[o]:void 0,l;if(c!==void 0){let u=s.filter(d=>typeof d=="boolean");l=u.includes(c)?c:u[0]}else l=sFr(s,`${e}.${o}`);l!==void 0&&n.push([o,l])}return Object.fromEntries(n)}a(tBc,"composeMostRestrictive");function rBc(t,e,r){switch(t.strategy){case"merge-properties":return ZLc(e,r);case"enum-order-wins":return JLc(e,t.order);case"deny-wins":return XLc(e);case"allowlist-intersection":return eBc(e);case"most-restrictive-wins":return tBc(e,r,t.restrictiveBooleans)}}a(rBc,"applyCompositionRule");function sFr(t,e){let r=t.filter(s=>s!==void 0),n=r[0];if(n===void 0)return;let o=KLc.get(e);return o?rBc(o,r,e):n}a(sFr,"mergeManagedValues");function ZWi(t){return sFr(t,"")??{}}a(ZWi,"mergeManagedSettingsByComposition");p();var XWi=["nativeMdm","server","file"];var aFr=require("node:util");var H9=class{constructor(e){this.sources=e;this.didChangeEmitter=new yu;this.disposed=!1;this.current=this.mergeSources(),this.sourceSubscriptions=e.map(r=>r.onDidChange(()=>this.recompute()))}static{a(this,"ManagedSettingsService")}get(){return this.current}observe(e,r){let n=r?e:c=>c,o=r??e,s=n(this.current);return o(s),this.didChangeEmitter.event(c=>{let l=n(c);(0,aFr.isDeepStrictEqual)(s,l)||(s=l,o(l))})}async refresh(e){return await Promise.allSettled(this.sources.map(r=>r.refresh(e))),this.recompute(),this.current}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.sourceSubscriptions)e.dispose();this.didChangeEmitter.dispose();for(let e of this.sources)e.dispose()}}recompute(){let e=this.mergeSources();(0,aFr.isDeepStrictEqual)(this.current,e)||(this.current=e,this.didChangeEmitter.fire(e))}mergeSources(){let e=XWi.flatMap(r=>this.sources.flatMap(n=>n.channel===r&&n.current?[n.current]:[]));return ZWi(e)}};var nBc=S.Object({forceRefresh:S.Optional(S.Boolean())});async function iBc(t,e,r){let n=t.get(H9);return[r.forceRefresh?await n.refresh({force:!0}):await n.refresh(),null]}a(iBc,"handleManagedSettingsGetChecked");var ezi=xe(nBc,iBc);p();var rzi="mcpGateway/serversChanged",nzi="mcpGateway/serverDetailsChanged",izi=S.Union([S.Object({kind:S.Literal("user")}),S.Object({kind:S.Literal("project"),workspaceFolder:S.String()}),S.Object({kind:S.Literal("plugin"),pluginId:S.String()})]),oBc=S.Object({source:izi,name:S.String()}),sBc=S.Union([S.Object({kind:S.Literal("user")}),S.Object({kind:S.Literal("project"),workspaceFolder:S.String()})]),tzi=S.Record(S.String(),S.Unknown()),aBc=S.Object({workspaceFolder:S.String(),user:tzi,project:tzi});async function cBc(t,e,r){let n=SFe(r.user),o=SFe(r.project);return await t.get(ny).applyConfig({workspaceFolder:r.workspaceFolder,user:n,project:o}),[null,null]}a(cBc,"handleApplyConfigChecked");var ozi=xe(aBc,cBc),lBc=S.Object({scope:sBc});function uBc(t,e,r){return[{servers:t.get(ny).listServers(r.scope).map(s=>({...s,providers:$S(s.source.kind==="plugin",void 0)}))},null]}a(uBc,"handleListServersChecked");var szi=xe(lBc,uBc),dBc=oBc;function fBc(t,e,r){return[{details:t.get(ny).getServerDetails(r)},null]}a(fBc,"handleGetServerDetailsChecked");var azi=xe(dBc,fBc),pBc=S.Object({source:izi,name:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});async function hBc(t,e,r){try{return await t.get(ny).serverAction({source:r.source,name:r.name},r.action),[null,null]}catch(n){if(n instanceof FH)return[null,{code:Xe.InvalidRequest,message:n.message,data:{kind:n.code}}];let o=n instanceof Error?n.message:String(n);return[null,{code:Xe.InternalError,message:o}]}}a(hBc,"handleServerActionChecked");var czi=xe(pBc,hBc);p();p();p();var lzi=fe(Fc());var cFr=class extends lzi.ResponseError{static{a(this,"BaseMcpRegistryError")}constructor(e,r,n,o=Xe.InternalError){super(o,e,{errorType:r,...n})}},Qie=class extends cFr{static{a(this,"HttpStatusError")}constructor(e,r,n,o=Xe.InternalError){super(e,r,{status:n},o)}},qTt=class extends Qie{static{a(this,"AuthError")}constructor(e){super("Missing or invalid authentication token for MCP registry allowlist","authError",e,Xe.NoCopilotToken)}},jTt=class extends Qie{static{a(this,"PermissionError")}constructor(e){super("MCP is disabled for this user","permissionError",e)}};var HTt=class extends Qie{static{a(this,"TransientError")}constructor(e){let r=`Transient server error when fetching MCP registry allowlist: HTTP ${e}`;super(r,"transientError",e)}};p();function uzi(t){try{if(!("x-metadata"in t))return null;let e=t["x-metadata"];if(typeof e!="object"||e===null)return null;let r=e.registry;if(typeof r!="object"||r===null)return null;let n=r,o=n.api,s=n.mcpServer;if(typeof o!="object"||o===null||typeof s!="object"||s===null)return null;let c=o,l=s;return typeof c.baseUrl=="string"&&c.baseUrl.length>0&&typeof c.version=="string"&&c.version.length>0&&typeof l.name=="string"&&l.name.length>0&&typeof l.version=="string"&&l.version.length>0?{api:{baseUrl:c.baseUrl,version:c.version},mcpServer:{name:l.name,version:l.version},...Object.fromEntries(Object.entries(n).filter(([u])=>!["api","mcpServer"].includes(u)))}:null}catch{return null}}a(uzi,"getRegistryMetadataFromConfig");function dzi(t,e){try{let r=e.server;return"command"in t?!0:"url"in t?mBc(t,r):!1}catch{return!1}}a(dzi,"validateServerConfigurationMatch");function mBc(t,e){if(!e.remotes||e.remotes.length===0)return!1;let r=a(o=>o.replace(/\/+$/,""),"normalizeUrl"),n=r(t.url);return e.remotes.some(o=>r(o.url)===n)}a(mBc,"validateRemoteURL");var fzi=300*1e3,UN=class{constructor(e){this.allowlistCache=null;this.serverCache=null;this.ctx=e}static{a(this,"McpRegistryService")}isAllowlistCacheValid(e,r){return Date.now()-e=500&&u<600?[null,new HTt(u)]:[null,new Qie(`Failed to fetch MCP registry allowlist: HTTP ${u}`,"httpError",u)]}}try{let u=await s.text();c=JSON.parse(u)}catch(u){return[null,{code:Xe.InternalError,message:`Failed to parse MCP registry allowlist: ${u instanceof Error?u.message:String(u)}`}]}return!c.mcp_registries||!Array.isArray(c.mcp_registries)?[null,{code:Xe.InternalError,message:"Invalid allowlist format: expected mcp_registries array"}]:c.mcp_registries.some(u=>!u.url||!u.registry_access)?[null,{code:Xe.InternalError,message:"Invalid allowlist format: registry entries missing required fields"}]:(this.allowlistCache={timestamp:Date.now(),data:c,userLogin:r},[c,null])}catch(e){return[null,{code:Xe.InternalError,message:`Failed to fetch MCP registry allowlist: ${e instanceof Error?e.message:String(e)}`}]}}async validateServerConfig(e,r){try{let n=await this.getRegistryInfo();if(n.accessMode==="fallback")return{serverName:e,serverConfig:r,isBlocked:!1};let o=n.registryUrl,s=n.owner,c=await this.checkServerInRegistry(r,o);if(n.accessMode==="allow_all")return{serverName:e,serverConfig:r,isBlocked:!1,registryInfo:c.isFoundInRegistry?s?`Provided by ${s.login} organization`:"Provided by organization":void 0};{let l=!c.isFoundInRegistry;return{serverName:e,serverConfig:r,isBlocked:l,blockReason:l?c.validationError:void 0,registryInfo:l?s?`Blocked by ${s.login} organization registry policy`:"Blocked by organization registry policy":s?`Provided by ${s.login} organization`:"Provided by organization"}}}catch(n){return{serverName:e,serverConfig:r,isBlocked:!0,blockReason:`validation failed: ${n instanceof Error?n.message:String(n)}`,registryInfo:"Blocked by organization registry policy"}}}async checkServerInRegistry(e,r){let n=uzi(e);if(!n)return{isFoundInRegistry:!1,validationError:"does not have valid registry config"};let o=n.mcpServer.name,s=n.mcpServer.version,c=n.api.baseUrl,l=n.api.version,u=a(m=>m.replace(/\/+$/,""),"normalizeUrl");if(u(c)!==u(r))return{isFoundInRegistry:!1,validationError:`does not match allowed registry Url, expected: ${r}, found: ${c}`};let d=`${c.replace(/\/+$/,"")}/${l}/servers`,[f,h]=await this.fetchServer(d,o,s);return f&&!h?dzi(e,f)?{isFoundInRegistry:!0}:{isFoundInRegistry:!1,validationError:"url"in e?"remote server URL does not match any registry remote URL":"local configuration does not match registry server configuration"}:{isFoundInRegistry:!1,validationError:h?`Server validation failed: ${h.message}`:`Server not found in registry ${c}`}}async getRegistryInfo(){let[e,r]=await this.fetchMcpRegistryAllowlist();if(r)return{accessMode:"fallback",errorMessage:`Failed to fetch registry allowlist: ${r.message}`};if(!e?.mcp_registries?.length)return{accessMode:"fallback",errorMessage:"Registry allowlist is empty - allowlist feature is disabled"};let n=e.mcp_registries[0];return{accessMode:n.registry_access,registryUrl:n.url,owner:n.owner}}async fetchServer(e,r,n){let o=encodeURIComponent(r),s=encodeURIComponent(n),c=`${e}/${o}/versions/${s}`;if(this.serverCache&&this.isServerCacheValid(this.serverCache.timestamp)){let l=this.serverCache.data.get(c);if(l)return[l,null]}try{let u=await this.ctx.get(nr).fetch(c,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(u.status===404)return[null,{code:Xe.InternalError,message:"Server not found"}];if(!u.ok)return[null,{code:Xe.InternalError,message:`Failed to fetch server from registry: HTTP ${u.status}`}];let d=await u.text(),f=JSON.parse(d);return(!this.serverCache||!this.isServerCacheValid(this.serverCache.timestamp))&&(this.serverCache={timestamp:Date.now(),data:new Map}),this.serverCache.data.set(c,f),[f,null]}catch(l){return[null,{code:Xe.InternalError,message:`Failed to fetch server from registry: ${l instanceof Error?l.message:String(l)}`}]}}};p();var gBc=S.Object({url:S.String(),source:S.String(),id:S.String(),subfolder:S.Optional(S.String())}),pzi=S.Object({description:S.Optional(S.String()),isRequired:S.Optional(S.Boolean()),format:S.Optional(S.Union([S.Literal("string"),S.Literal("number"),S.Literal("boolean"),S.Literal("filepath")])),value:S.Optional(S.String()),isSecret:S.Optional(S.Boolean()),default:S.Optional(S.String()),placeholder:S.Optional(S.String()),choices:S.Optional(S.Array(S.String()))}),lFr=S.Intersect([pzi,S.Object({variables:S.Optional(S.Record(S.String(),pzi))})]),ABc=S.Intersect([lFr,S.Object({type:S.Literal("positional"),valueHint:S.Optional(S.String()),isRepeated:S.Optional(S.Boolean())})]),yBc=S.Intersect([lFr,S.Object({type:S.Literal("named"),name:S.String(),isRepeated:S.Optional(S.Boolean())})]),hzi=S.Union([ABc,yBc]),PFe=S.Intersect([lFr,S.Object({name:S.String()})]),EBc=S.Object({registryType:S.String(),registryBaseUrl:S.Optional(S.String()),identifier:S.String(),version:S.Optional(S.String()),fileSha256:S.Optional(S.String()),runtimeHint:S.Optional(S.String()),transport:S.Optional(S.Union([S.Object({type:S.Literal("stdio")}),S.Object({type:S.Literal("streamable-http"),url:S.String(),headers:S.Optional(S.Array(PFe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(PFe))})])),runtimeArguments:S.Optional(S.Array(hzi)),packageArguments:S.Optional(S.Array(hzi)),environmentVariables:S.Optional(S.Array(PFe))}),_Bc=S.Union([S.Object({type:S.Literal("streamable-http"),url:S.String(),headers:S.Optional(S.Array(PFe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(PFe))})]),vBc=S.Object({src:S.String(),mimeType:S.Optional(S.Union([S.Literal("image/png"),S.Literal("image/jpeg"),S.Literal("image/jpg"),S.Literal("image/svg+xml"),S.Literal("image/webp")])),sizes:S.Optional(S.Array(S.String())),theme:S.Optional(S.Union([S.Literal("light"),S.Literal("dark")]))}),CBc=S.Object({status:S.Optional(S.Union([S.Literal("active"),S.Literal("deprecated"),S.Literal("deleted")])),publishedAt:S.Optional(S.String()),updatedAt:S.Optional(S.String()),isLatest:S.Optional(S.Boolean())},{additionalProperties:!1}),bBc=S.Object({"io.modelcontextprotocol.registry/publisher-provided":S.Optional(S.Object({tool:S.Optional(S.String()),version:S.Optional(S.String()),buildInfo:S.Optional(S.Object({commit:S.Optional(S.String()),timestamp:S.Optional(S.String()),pipelineId:S.Optional(S.String())}))},{additionalProperties:!0}))},{additionalProperties:!0}),SBc=S.Object({"io.modelcontextprotocol.registry/official":S.Optional(CBc)},{additionalProperties:!0}),TBc=S.Object({name:S.String(),description:S.String(),title:S.Optional(S.String()),repository:S.Optional(gBc),version:S.String(),websiteUrl:S.Optional(S.String()),icons:S.Optional(S.Array(vBc)),$schema:S.Optional(S.String()),packages:S.Optional(S.Array(EBc)),remotes:S.Optional(S.Array(_Bc)),_meta:S.Optional(bBc)}),IBc=S.Object({server:TBc,_meta:SBc}),ALh=S.Object({servers:S.Array(IBc),metadata:S.Optional(S.Object({nextCursor:S.Optional(S.String()),count:S.Optional(S.Number())}))}),mzi=S.Object({baseUrl:S.String(),cursor:S.Optional(S.String()),limit:S.Optional(S.Number({minimum:1})),search:S.Optional(S.String()),updatedSince:S.Optional(S.String()),version:S.Optional(S.String())}),gzi=S.Object({baseUrl:S.String(),serverName:S.String(),version:S.String()});var DFe="mcp.registry.listServers",$_e="mcp.registry.getServer";async function xBc(t,e,r,n){return await t.get(UN).fetchServer(e,r,n)}a(xBc,"fetchServer");async function wBc(t,e,r){if(!r.baseUrl)return[null,{code:Xe.InvalidParams,message:"Base URL is required"}];let n=t.get(nr),o=new URLSearchParams;r.limit!==void 0&&o.append("limit",r.limit.toString()),r.cursor!==void 0&&o.append("cursor",r.cursor),r.search!==void 0&&o.append("search",r.search),r.updatedSince!==void 0&&o.append("updated_since",r.updatedSince),r.version!==void 0&&o.append("version",r.version);let s=`${r.baseUrl}${o.toString()?`?${o.toString()}`:""}`;try{let c=await n.fetch(s,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(!c.ok){let d=`MCP Registry API error: HTTP ${c.status}`;return rg(t,DFe,Vt.createAndMarkAsIssued({message:d})),[null,{code:Xe.InternalError,message:d}]}let l=await c.text(),u=JSON.parse(l);return ft(t,DFe,Vt.createAndMarkAsIssued()),cr(t,DFe),[u,null]}catch(c){Cs(t,DFe,c);let l=`Failed to fetch servers from MCP Registry: ${c instanceof Error?c.message:String(c)}`;return rg(t,DFe,Vt.createAndMarkAsIssued({message:l})),[null,{code:Xe.InternalError,message:l}]}}a(wBc,"handleListServersChecked");async function RBc(t,e,r){if(e.isCancellationRequested)return[null,{code:Xe.RequestCancelled,message:"Request was cancelled"}];if(!r.baseUrl)return[null,{code:Xe.InvalidParams,message:"Base URL is required"}];if(!r.serverName)return[null,{code:Xe.InvalidParams,message:"Server name is required"}];if(!r.version)return[null,{code:Xe.InvalidParams,message:"Version is required"}];let[n,o]=await xBc(t,r.baseUrl,r.serverName,r.version);if(o){let s={message:o.message};return rg(t,$_e,Vt.createAndMarkAsIssued(s)),cr(t,$_e,s),[null,o]}if(!n){let s="Failed to retrieve server data",c={message:s};return rg(t,$_e,Vt.createAndMarkAsIssued(c)),cr(t,$_e,c),[null,{code:Xe.InternalError,message:s}]}return ft(t,$_e,Vt.createAndMarkAsIssued()),cr(t,$_e),[n,null]}a(RBc,"handleGetServerChecked");var Azi=xe(mzi,wBc),yzi=xe(gzi,RBc);p();p();var Ezi=S.Object({}),kBc=S.Object({login:S.String(),id:S.Number(),type:S.String(),parent_login:S.Union([S.String(),S.Null()]),parent_id:S.Union([S.Number(),S.Null()])}),PBc=S.Object({url:S.String(),registry_access:S.Union([S.Literal("registry_only"),S.Literal("allow_all")]),owner:kBc}),MLh=S.Object({mcp_registries:S.Array(PBc)});async function DBc(t){return await t.get(UN).fetchMcpRegistryAllowlist()}a(DBc,"fetchMcpRegistryAllowlist");async function NBc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Xe.RequestCancelled,message:"Request was cancelled"}];let[n,o]=await DBc(t);return o?[null,o]:n?n.mcp_registries.length===0?[n,null]:[n,null]:[null,{code:Xe.InternalError,message:"Failed to retrieve MCP registry allowlist data"}]}catch(n){return[null,{code:Xe.InternalError,message:`Unexpected error in MCP registry allowlist handler: ${n instanceof Error?n.message:String(n)}`}]}}a(NBc,"handleGetMcpRegistryAllowlistChecked");var _zi=xe(Ezi,NBc);p();var bzi=fe(fee()),Szi=fe(ad()),Tzi=fe($_());p();Mo();var MBc=S.Object({edits:S.Array(S.Object({text:S.String(),range:S.Object({start:S.Object({line:S.Number(),character:S.Number()}),end:S.Object({line:S.Number(),character:S.Number()})}),predictedCursorPosition:S.Object({line:S.Number(),character:S.Number()})}))}),ZV=class{constructor(e){this.edits=e}static{a(this,"ExternalTestingNextEditDocuments")}},uFr=new pe("setNextEditDocument");function OBc(t,e,r){return uFr.debug(t,`Set Next Edit documents: ${JSON.stringify(r)}`),t.forceSet(ZV,new ZV(r.edits)),["OK",null]}a(OBc,"handleTestingSetNextEditDocumentChecked");var vzi=xe(MBc,OBc);function Czi(t,e,r,n){let o=t.get(ZV);if(o.edits&&o.edits.length>0){let s=o.edits.filter(c=>e.line===c.predictedCursorPosition.line&&e.character===c.predictedCursorPosition.character);return s.length===0?(uFr.debug(t,`No edits match current position ${JSON.stringify(e)}, returning empty results`),[]):(uFr.debug(t,`Returning ${s.length} matching Next Edit documents`),s.map(c=>LBc(c,r,n)))}}a(Czi,"getTestNextEditSuggestions");function LBc(t,e,r){return{text:t.text,textDocument:{uri:e,version:r},range:t.range,command:{title:"Accept inline edit",command:"github.copilot.didAcceptNextEditSuggestionItem",arguments:[Nt()]}}}a(LBc,"createNextEditSuggestion");async function BBc(t,e,r){if(r.textDocument.version===void 0)throw new Error("textDocument.version is undefined");let n=Fs(r.textDocument.uri);t.get(x9).setForRequest(Szi.URI.parse(n),r.diagnostics??[]);let o=Czi(t,r.position,n,r.textDocument.version);if(o)return[{edits:o},null];let s=t.get(Yv);t.get(bzi.ObservableWorkspace).onUserPositionChange(n,new Tzi.Position(r.position.line,r.position.character));let c=await s.handleNextEditRequest(n,r.textDocument.version,e);return c?[{edits:c.map(u=>({text:u.edit.text,textDocument:u.edit.textDocument,range:u.edit.range,command:{title:"Accept inline edit",command:rMe,arguments:[u.id]}}))},null]:[{edits:[]},null]}a(BBc,"handleChecked");var Izi=xe(rbn,BBc);p();var UBc=S.Object({uuid:S.String({minLength:1}),acceptedLength:S.Optional(S.Number({minimum:1}))});function QBc(t,e,r){let n=t.get(ku),o=n.get(r.uuid);return o&&(qBc(r,o)==="full"?(n.delete(r.uuid),Hme(t,o,o.triggerCategory)):eft(t,o,r.acceptedLength,0,o.triggerCategory,"cumulative")),["OK",null]}a(QBc,"notifyAcceptedChecked");function qBc(t,e){return t.acceptedLength===void 0?"full":t.acceptedLengthn.get(s)??[]);if(o.length>0){let s=o[0];for(let l of r.uuids)n.delete(l);let c=o.map(l=>({completionText:l.displayText,completionTelemetryData:l.telemetry}));Xdt(t,"ghostText",s.offset,s.uri,c),t.get(cy).resetState()}return["OK",null]}a($Bc,"notifyRejectedChecked");var Rzi=xe(GBc,$Bc);p();var VBc=S.Object({uuid:S.String({minLength:1})});function WBc(t,e,r){let o=t.get(ku).get(r.uuid);return o&&Xlt(t,o.triggerCategory,o),["OK",null]}a(WBc,"notifyShownChecked");var kzi=xe(VBc,WBc);p();var zBc=S.Object({commandLine:S.String(),shell:S.Optional(S.String())});async function YBc(t,e,r){let n=t.get(cT),o=r.shell||"sh",{subCommands:s,commandNames:c}=await n.parseTerminalCommandDetailed(r.commandLine,o);return[{subCommands:s,commandNames:c},null]}a(YBc,"handleParseTerminalCommandChecked");var Pzi=xe(zBc,YBc);p();p();function Dzi(t){return S.Union(Object.values(t).map(e=>S.Literal(e)))}a(Dzi,"enumSchema");var KBc=S.Union([S.Object({kind:S.Literal("relativePath"),path:S.String()}),S.Object({kind:S.Literal("github"),repo:S.String(),ref:S.Optional(S.String()),sha:S.Optional(S.String()),path:S.Optional(S.String())}),S.Object({kind:S.Literal("url"),url:S.String(),ref:S.Optional(S.String()),sha:S.Optional(S.String()),path:S.Optional(S.String())}),S.Object({kind:S.Literal("npm"),package:S.String(),version:S.Optional(S.String()),registry:S.Optional(S.String())}),S.Object({kind:S.Literal("pip"),package:S.String(),version:S.Optional(S.String()),registry:S.Optional(S.String())})]),JBc=S.Object({rawValue:S.String(),displayLabel:S.String(),cloneUrl:S.String(),canonicalId:S.String(),cacheSegments:S.Array(S.String()),kind:Dzi(mX),ref:S.Optional(S.String()),githubRepo:S.Optional(S.String()),localRepositoryUri:S.Optional(S.String())}),Nzi=S.Object({name:S.String(),description:S.String(),version:S.String(),sourceDescriptor:KBc,marketplace:S.String(),marketplaceReference:JBc,marketplaceType:Dzi(Q2e),readmeUri:S.Optional(S.String())}),XV=S.Object({pluginUri:S.String()}),GTt=S.Object({source:S.String()});p();var ZBc="_direct";function Mzi(t,e){let r=t.fromMarketplace,n=r?.name??t.label,o=r?.marketplaceReference.canonicalId??ZBc;return{qualifiedId:`${n}@${o}`,name:n,label:t.label,pluginUri:t.uri,...r?.marketplace!==void 0&&{marketplace:r.marketplace},enabled:t.enabled,disabledByPolicy:t.policyBlocked===!0,readOnly:e(t.uri),...r?.description!==void 0&&{description:r.description},...r?.version!==void 0&&{version:r.version},...r?.readmeUri!==void 0&&{readmeUri:r.readmeUri},...r?.marketplaceType!==void 0&&{marketplaceType:r.marketplaceType},...r?.sourceDescriptor!==void 0&&{sourceDescriptor:r.sourceDescriptor},hooks:t.hooks,commands:t.commands,skills:t.skills,agents:t.agents,instructions:t.instructions,mcpServerDefinitions:t.mcpServerDefinitions}}a(Mzi,"toPluginListRow");async function Op(t){try{return[await t(),null]}catch(e){let r=e instanceof Error?e.message:String(e),n=e instanceof yj?e.data:void 0;return[null,{code:Xe.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(Op,"withPluginErrorHandling");async function XBc(t,e,r){return Op(()=>t.get(dc).disablePlugin(r.pluginUri))}a(XBc,"handlePluginsDisableChecked");var Ozi=xe(XV,XBc);p();async function e3c(t,e,r){return Op(()=>t.get(dc).enablePlugin(r.pluginUri))}a(e3c,"handlePluginsEnableChecked");var Lzi=xe(XV,e3c);p();var t3c=S.Object({plugin:Nzi});async function r3c(t,e,r){return Op(async()=>({pluginUri:await t.get(dc).installPlugin(r.plugin)}))}a(r3c,"handlePluginsInstallChecked");var Bzi=xe(t3c,r3c);p();var n3c=S.Object({source:S.String(),pluginName:S.Optional(S.String())});async function i3c(t,e,r){return Op(()=>t.get(dc).installPluginFromSource(r.source,r.pluginName))}a(i3c,"handlePluginsInstallFromSourceChecked");var Fzi=xe(n3c,i3c);p();var o3c=S.Object({});async function s3c(t,e,r){return Op(async()=>{let n=t.get(dc);return(await n.listPlugins()).map(s=>Mzi(s,c=>n.isReadOnlyPlugin(c)))})}a(s3c,"handlePluginsListChecked");var Uzi=xe(o3c,s3c);p();async function a3c(t,e,r){return Op(()=>t.get(dc).addMarketplace(r.source))}a(a3c,"handleMarketplaceAddChecked");var Qzi=xe(GTt,a3c);p();var c3c=S.Object({source:S.Optional(S.String())});async function l3c(t,e,r){return Op(()=>t.get(dc).browseMarketplace(r.source))}a(l3c,"handleMarketplaceBrowseChecked");var qzi=xe(c3c,l3c);p();var u3c=S.Object({});async function d3c(t,e,r){return Op(async()=>[...await t.get(dc).listMarketplaces()])}a(d3c,"handleMarketplaceListChecked");var jzi=xe(u3c,d3c);p();async function f3c(t,e,r){return Op(()=>t.get(dc).removeMarketplace(r.source))}a(f3c,"handleMarketplaceRemoveChecked");var Hzi=xe(GTt,f3c);p();async function p3c(t,e,r){return Op(()=>t.get(dc).uninstallPlugin(r.pluginUri))}a(p3c,"handlePluginsUninstallChecked");var Gzi=xe(XV,p3c);p();async function h3c(t,e,r){return Op(async()=>({updated:await t.get(dc).updatePlugin(r.pluginUri)}))}a(h3c,"handlePluginsUpdateChecked");var $zi=xe(XV,h3c);p();var m3c=xei;function g3c(t,e,r){let n=t.get(Em),o={unregistered:[],registered:[]};return r.providers.forEach(s=>{try{let c=new q_e(t,s.id,s.selector);n.registerContextProvider(c),o.registered.push(s.id)}catch{o.unregistered.push(s.id)}}),[o,null]}a(g3c,"registerContextProviders");var Vzi=xe(m3c,g3c);p();p();var A3c=S.Object({uri:S.Optional(S.String())}),y3c=S.Object({showEditorCompletions:S.Optional(S.Boolean()),enableAutoCompletions:S.Optional(S.Boolean()),delayCompletions:S.Optional(S.Boolean()),filterCompletions:S.Optional(S.Boolean())}),zzi=S.Object({github:S.Optional(S.Object({copilot:S.Optional(S.Object({}))})),[Sqr]:S.Optional(A3c),http:S.Optional(Ufn),telemetry:S.Optional(S.Object({telemetryLevel:S.Optional(S.String())}))}),NFe=Object.keys(zzi.properties).filter(t=>t!=="github"),E3c=S.Intersect([zzi,y3c]),_3c=S.Object({settings:S.Optional(S.Union([S.Object({}),S.Array(S.Unknown(),{maxItems:0})])),authProvider:S.Optional(S.Never())}),Wzi=$u.Compile(_3c),dFr=$u.Compile(E3c);function $L(t){if(typeof t=="string")return{type:"content",content:t};if(t&&typeof t=="object"){let e=t;if(e.type==="file"&&typeof e.uri=="string")return{type:"file",uri:e.uri};if(e.type==="location"&&typeof e.path=="string")return{type:"location",path:e.path};if(e.type==="content"&&typeof e.content=="string")return{type:"content",content:e.content};if(typeof e.uri=="string")return{type:"file",uri:e.uri};if(typeof e.content=="string")return{type:"content",content:e.content}}return{type:"content",content:""}}a($L,"normalizePromptSetting");async function VTt(t,e){if(!Wzi.Check(e))throw $Tt(t),new HA(Wzi.Errors(e));let r=Array.isArray(e.settings)?{}:e.settings;return r&&v3c(t,r),$Tt(t,r),Promise.resolve()}a(VTt,"notifyChangeConfiguration");function v3c(t,e){for(let n of dFr.Errors(e)){let o=n.path.split("/")?.[1];$o.warn(t,`Invalid ${n.path.slice(1).replace(/\//g,".")} setting:`,n.message),delete e[o]}if(!dFr.Check(e))throw new HA(dFr.Errors(e));e.http&&fFr(t,e.http);let r=e["github-enterprise"];r&&O7e(t,r.uri),e.github?.copilot&&C3c(t,e.github.copilot)}a(v3c,"applySettingsToConfiguration");function C3c(t,e){let r=t.get(ob),n={};for(let o of Object.values(ze)){let s=jfn(e,o);n[o]=s}r.setCopilotSettings(n),ume.clearCache(),gTt.clearCache(),typeof e.mcp=="string"&&L3c(t,e.mcp),e.agent&&typeof e.agent=="object"&&(B3c(t,e.agent),F3c(t,e.agent),U3c(t,e.agent)),b3c(t,e.globalCopilotInstructions),S3c(t,e.globalGitCommitInstructions),T3c(t,e.globalAgentsMdInstructions),I3c(t,e.globalClaudeMdInstructions),x3c(t,e.globalInstructionFiles),w3c(t,e.globalPromptFiles),D3c(t,e.instructionFileLocations),N3c(t,e.promptFileLocations),M3c(t,e.agentFileLocations),O3c(t,e.skillFileLocations)}a(C3c,"applyCopilotConfiguration");function b3c(t,e){try{let r=t.get(wf),n=$L(e);r.setGlobalCopilotInstructions(n)}catch(r){$o.error(t,"Failed to apply global Copilot instructions configuration",r)}}a(b3c,"applyGlobalCopilotInstructionsConfiguration");function S3c(t,e){try{let r=t.get(wf),n=$L(e);r.setGlobalGitCommitInstructions(n)}catch(r){$o.error(t,"Failed to apply global Git commit instructions configuration",r)}}a(S3c,"applyGlobalGitCommitInstructionsConfiguration");function T3c(t,e){try{let r=t.get(wf),n=$L(e);r.setGlobalAgentsMdInstructions(n)}catch(r){$o.error(t,"Failed to apply global Agents.md instructions configuration",r)}}a(T3c,"applyGlobalAgentsMdInstructionsConfiguration");function I3c(t,e){try{let r=t.get(wf),n=$L(e);r.setGlobalClaudeMdInstructions(n)}catch(r){$o.error(t,"Failed to apply global Claude.md instructions configuration",r)}}a(I3c,"applyGlobalClaudeMdInstructionsConfiguration");function x3c(t,e){try{let r=t.get(wf),n=(e||[]).map($L);r.setGlobalInstructionFiles(n)}catch(r){$o.error(t,"Failed to apply global instruction files configuration",r)}}a(x3c,"applyGlobalInstructionFilesConfiguration");function w3c(t,e){try{let r=t.get(Ig),n=(e||[]).map($L);r.setGlobalPromptFiles(n)}catch(r){$o.error(t,"Failed to apply global prompt files configuration",r)}}a(w3c,"applyGlobalPromptFilesConfiguration");function R3c(t){return t?Array.isArray(t)?t.map($L):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(R3c,"normalizeFileLocations");function k3c(t){let e=$L(t);if(t&&typeof t=="object"){let r=t.source;if(typeof r=="string")return{...e,source:r}}return e}a(k3c,"normalizeInstructionPromptSetting");function P3c(t){return t?Array.isArray(t)?t.map(k3c):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(P3c,"normalizeInstructionFileLocations");function D3c(t,e){try{let r=t.get(wf);if(e===void 0)return;r.setInstructionFileLocations(P3c(e))}catch(r){$o.error(t,"Failed to apply instruction file locations configuration",r)}}a(D3c,"applyInstructionFileLocationsConfiguration");function N3c(t,e){try{let r=t.get(Ig);if(e===void 0)return;r.setPromptFileLocations(R3c(e))}catch(r){$o.error(t,"Failed to apply prompt file locations configuration",r)}}a(N3c,"applyPromptFileLocationsConfiguration");function M3c(t,e){try{let r=t.get(jd);if(e===void 0)return;let n=e.map($L);r.setAgentFileLocations(n)}catch(r){$o.error(t,"Failed to apply agent file locations configuration",r)}}a(M3c,"applyAgentFileLocationsConfiguration");function O3c(t,e){try{let r=t.get(A0);if(e===void 0)return;let n=e.map($L);r.setSkillFileLocations(n)}catch(r){$o.error(t,"Failed to apply skill file locations configuration",r)}}a(O3c,"applySkillFileLocationsConfiguration");function fFr(t,e){let r=t.get(ob);e.proxy===void 0&&(e=Qfn(r.env));try{r.setHttpSettings(SIe(e))}catch(n){if(!(n instanceof TypeError))throw n;$o.warn(t,"Invalid proxy URL",e.proxy,n),r.setHttpSettings({proxy:""})}}a(fFr,"applyHttpConfiguration");async function L3c(t,e){let r;try{r=SFe(JSON.parse(e||"{}"))}catch(n){$o.error(t,"Failed to parse MCP configuration JSON",n);return}try{await t.get(u_).updateMCPServers(r)}catch(n){$o.error(t,"Failed to apply MCP configuration to McpManager",n)}}a(L3c,"applyMCPConfiguration");function B3c(t,e){try{let r=e;t.get(cT).updateConfiguration(r.tools?.terminal?.autoApprove)}catch(r){$o.error(t,"Failed to apply settings configuration",r)}}a(B3c,"applyTerminalAutoApproveConfiguration");function F3c(t,e){try{let r=e;t.get(bw).updateRulesFromConfiguration(r.tools?.edit?.autoApprove)}catch(r){$o.error(t,"Failed to apply edit auto approve configuration",r)}}a(F3c,"applyEditAutoApproveConfiguration");function U3c(t,e){try{let r=e;t.get(EF).updateConfiguration(r.tools?.mcp?.autoApprove)}catch(r){$o.error(t,"Failed to apply MCP auto approve configuration",r)}}a(U3c,"applyMCPAutoApproveConfiguration");function $Tt(t,e){if(t.get(ob).markReady(),!t.get(kn).getCapabilities().redirectedTelemetry){let r=(e?.telemetry?.telemetryLevel??"all")==="all";t.get(yf).initialize(r)}}a($Tt,"initializePostConfigurationDependencies");var Yzi=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),Q3c=S.Object({editorInfo:Yzi,editorPluginInfo:Yzi,editorConfiguration:S.Optional(S.Object({}))});async function q3c(t,e,r){t.get(Ir).setEditorAndPluginInfo(r.editorPluginInfo,r.editorInfo),tft(t,["setEditorInfo is deprecated. Use initializationOptions for editorInfo and editorPluginInfo","and workspace/didChangeConfiguration for editorConfiguration."]),await VTt(t,{settings:r.editorConfiguration}),ft(t,"setEditorInfo");for(let n of["github",...NFe])r.editorConfiguration&&n in r.editorConfiguration&&ft(t,`setEditorInfo.editorConfiguration.${n}`);return["OK",null]}a(q3c,"handleSetEditorInfoChecked");var Kzi=xe(Q3c,q3c);p();var j3c=S.Object({options:S.Optional(S.Object({}))});async function H3c(t,e,r){let n=t.get(WT),o=n.pendingSignIn?.status;if(o===void 0)return[null,{code:Xe.InvalidRequest,message:"No pending sign in"}];let s;try{return s=await o,[s,null]}catch(c){return[null,{code:Xe.DeviceFlowFailed,message:String(c)}]}finally{n.pendingSignIn=void 0}}a(H3c,"handleSignInConfirmChecked");var Jzi=xe(j3c,H3c);p();var G3c=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function $3c(t,e,r){try{let o=await t.get(Mr).checkAndUpdateStatus({githubAppId:r.githubAppId});if(o.status==="OK")return[{status:"AlreadySignedIn",user:o.user},null];let c=await t.get(WT).initiate(r);return[{status:"PromptUserDeviceFlow",userCode:c.user_code,verificationUri:c.verification_uri,expiresIn:c.expires_in,interval:c.interval,command:{command:nft,title:"Sign in with GitHub",arguments:[]}},null]}catch(n){if(!(n instanceof yi))throw n;return[null,{code:Xe.DeviceFlowFailed,message:n.message}]}}a($3c,"handleSignInInitiateChecked");var pFr=xe(G3c,$3c);p();p();p();var Zzi=["google","apple"],WTt=S.Optional(S.Union(Zzi.map(t=>S.Literal(t))));function Xzi(t){return typeof t=="string"&&Zzi.includes(t)}a(Xzi,"isGitHubSocialProvider");function hFr(t){let e=t.toLowerCase();return e==="github.com"||e.endsWith(".github.com")}a(hFr,"isGitHubSocialProviderApplicableHostname");function eYi(t,e){if(!e)return t;try{let r=new URL(t);return hFr(r.hostname)?(r.searchParams.set("provider",e),r.toString()):t}catch{return t}}a(eYi,"addGitHubSocialProviderToVerificationUri");p();function tYi(){return!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY||(process.platform==="linux"||process.platform==="freebsd"||process.platform==="openbsd")&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)}a(tYi,"isBrowserAvailable");function V3c(t){let e=t.replace(/\/$/,"");return{issuer:e,authorization_endpoint:`${e}/login/oauth/authorize`,token_endpoint:`${e}/login/oauth/access_token`,response_types_supported:["code"],code_challenge_methods_supported:["S256"],grant_types_supported:["authorization_code"],scopes_supported:["repo","workflow","user","read:org"]}}a(V3c,"getGitHubOAuthServerMetadata");async function zTt(t,e,r={},n){let o=performance.now();Gme(t,"codeFlow");let s={status:"NotSignedIn"};try{if(!tYi())throw new YU("Browser not available (SSH session or headless environment). Cannot perform OAuth code flow.");let{serverUrl:c,authAuthority:l}=KU(t,r.authAuthority),u=V3c(c),d=e(t,u),f=r.scopes??["repo","workflow"],h=hFr(new URL(c).hostname)?r.socialProvider:void 0,m=await d.createSession(f,{cancellationToken:n,provider:h,loginHint:r.loginHint}),g=m.scopes||f,A=t.get(Jp).findAppIdToAuthenticate(),y=m.account.label;if(!y)throw new yi("Could not resolve GitHub username during sign-in. Please try again.");return s=await t.get(Mr).signInEditor({accessToken:m.accessToken,user:y,githubAppId:A,authAuthority:l,scopes:g?[...g]:void 0}),iD(t,"codeFlow",s.status,performance.now()-o),s}catch(c){throw iD(t,"codeFlow",s.status,performance.now()-o,c),c}}a(zTt,"performGitHubOAuthCodeFlow");p();p();p();U$e();var V_e=class extends Jm{constructor(r,n=new mFr){super();this.ctx=r;this.fallback=n}static{a(this,"AgentUrlOpener")}async open(r){let n=this.ctx.get(Xt);if(!(n.clientCapabilities?.window?.showDocument?.support&&(await Promise.race([n.connection.window.showDocument({uri:r,external:!0}),new Promise((s,c)=>setTimeout(()=>c(new Error("window/showDocument timed out")),15e3))])).success))return this.fallback.open(r)}},mFr=class extends Jm{static{a(this,"SpawnUrlOpener")}async open(e){await JTe(e)}};p();var rYi=require("crypto"),nYi=fe(require("http"));p();var YTt=new pe("OAuth Code Flow");function gFr(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n @@ -4159,49 +4184,49 @@ Content: ${r}`}async generateTitle(e,r,n){let o=new Fn.CancellationTokenSource,s } -`;var p3r=["authorization_code","refresh_token"],w_e=33428,ITt=class{constructor(e,r){this._logger=new fe("LoopbackAuthServer");this.nonce=(0,nWi.randomBytes)(16).toString("hex");if(!e)throw new Error("startingRedirect must be defined");this._startingRedirect=new URL(e),this._ctx=r;let n;this._resultPromise=new Promise((s,c)=>n={resolve:s,reject:c}),this._responseSentPromise=new Promise(s=>{this._resolveResponseSent=s});let o=`&app_name=${encodeURIComponent("GitHub Copilot")}`;this._server=iWi.createServer((s,c)=>{let l=new URL(s.url,`http://${s.headers.host}`);switch(l.pathname){case"/signin":{let u=(l.searchParams.get("nonce")??"").replace(/ /g,"+");if(u!==this.nonce){let d=new yi("Nonce does not match.");this._logger.warn(this._ctx,"Nonce mismatch in /signin request",{receivedNonce:u,expectedNonce:this.nonce}),qNe(this._ctx,d,"/signin"),c.writeHead(302,{location:`/?error=${encodeURIComponent("Nonce does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(d);return}this._startingRedirect.searchParams.set("redirect_uri",`http://127.0.0.1:${this.port}/callback`),this._logger.info(this._ctx,"Redirecting to auth server"),c.writeHead(302,{location:this._startingRedirect.toString()}),c.end();break}case"/callback":{let u=l.search||"",d=/[?&]code=([^&]+)/.exec(u),f=/[?&]state=([^&]+)/.exec(u),h=d&&d.length>1?decodeURIComponent(d[1]):void 0,m=f&&f.length>1?decodeURIComponent(f[1]):void 0,g=new URL(m||"").searchParams.get("nonce")??void 0;if(!h||!m||!g){let A="Missing required parameters, at least one from code, state, nonce is needed.",y=new yi(A);this._logger.warn(this._ctx,"OAuth callback missing required parameters",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url}),qNe(this._ctx,y,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent(A)}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(y);return}if(this.state!==m){let A=new yi("State does not match.");this._logger.warn(this._ctx,"OAuth callback state mismatch",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url,receivedState:m,expectedState:this.state}),qNe(this._ctx,A,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent("State does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(A);return}if(this.nonce!==g){let A=new yi("Nonce does not match.");this._logger.warn(this._ctx,"OAuth callback nonce mismatch",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url,receivedNonce:g,expectedNonce:this.nonce}),qNe(this._ctx,A,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent("Nonce does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(A);return}this._logger.info(this._ctx,"OAuth callback validation successful"),n.resolve({code:h,state:m}),c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(f3r,()=>this._resolveResponseSent());break}default:c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(f3r)}})}static{a(this,"LoopbackAuthServer")}get redirectUri(){if(this.port===void 0)throw new Error("Server is not started yet");return`http://127.0.0.1:${this.port}/callback`}set state(e){e?this._startingRedirect.searchParams.set("state",e):this._startingRedirect.searchParams.delete("state")}get state(){return this._startingRedirect.searchParams.get("state")??void 0}start(){return new Promise((e,r)=>{if(this._server.listening)throw new Error("Server is already started");let n=setTimeout(()=>{r(new Error("Timeout waiting for port"))},5e3);this._server.on("listening",()=>{let o=this._server.address();if(typeof o=="string")this.port=parseInt(o);else if(o instanceof Object)this.port=o.port;else throw new Error("Unable to determine port");clearTimeout(n),this.state=`http://127.0.0.1:${this.port}/callback?nonce=${this.nonce}`,this._logger.info(this._ctx,"OAuth server started and state configured",{port:this.port,redirectUri:this.redirectUri}),e(this.port)}),this._server.on("error",o=>{if(o.code==="EADDRINUSE"){console.warn(`Port ${w_e} is in use, retrying with a random port...`),this._server.listen(0,"127.0.0.1");return}clearTimeout(n),r(new Error(`Error listening to server: ${o.message}`))}),this._server.on("close",()=>{clearTimeout(n),r(new Error("Server closed unexpectedly"))}),this._server.listen(w_e,"127.0.0.1")})}stop(){return new Promise((e,r)=>{if(!this._server.listening){e();return}let n,o=a(()=>{n&&(clearTimeout(n),n=void 0)},"cleanup");n=setTimeout(()=>{o(),r(new Error("Timeout waiting for server to close"))},5e3),this._server.close(s=>{o(),s?r(s):e()}),this._server.closeAllConnections()})}waitForOAuthResponse(){return this._resultPromise}waitForResponseSent(){return this._responseSentPromise}};p();var xTt=require("crypto");var lFe=class{static{a(this,"PKCEUtils")}static generateCodeVerifier(){let e=this.generateRandomBytes(32);return this.base64UrlEncode(e)}static generateCodeChallenge(e){let r=(0,xTt.createHash)("sha256");r.update(e,"ascii");let n=r.digest();return this.base64UrlEncode(n)}static getCodeChallengeMethod(){return"S256"}static generateRandomBytes(e){return(0,xTt.randomBytes)(e)}static base64UrlEncode(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static getSupportedMethods(){return[this.getCodeChallengeMethod()]}static isServerSupported(e){if(!e||e.length===0)return!1;let r=this.getSupportedMethods();return e.some(n=>r.includes(n))}static createPKCEParameters(){let e=this.generateCodeVerifier(),r=this.generateCodeChallenge(e),n=this.getCodeChallengeMethod();return{codeVerifier:e,codeChallenge:r,codeChallengeMethod:n}}};var iLc="Timed out",oWi="Sign-in request was cancelled",h3r=class{static{a(this,"CodeFlow")}},R_e=class extends h3r{static{a(this,"CLSCodeFlow")}constructor(e){super(),this.ctx=e}async auth(e,r,n,o,s,c){let{clientId:l,clientSecret:u}=e,d=o?.resource,f=lFe.isServerSupported(n.code_challenge_methods_supported),h=f?lFe.createPKCEParameters():void 0;f?Nr.info(this.ctx,`PKCE supported by server with methods: [${n.code_challenge_methods_supported?.join(", ")}], using ${h.codeChallengeMethod}`):Nr.info(this.ctx,"PKCE not supported by server, falling back to standard OAuth flow");let m=this.buildAuthorizationParams({clientId:l,scope:r.join(" "),pkceParams:h,resource:d,...s??{}}),g=new URLSearchParams(m),A=n.authorization_endpoint+"?"+g.toString(),y=new ITt(A,this.ctx),_=`http://127.0.0.1:${await y.start()}/signin?nonce=${encodeURIComponent(y.nonce)}`;Nr.info(this.ctx,"Auth URL created and opening browser for sign-in"),await new x_e(this.ctx).open(_);let v,b=[];try{let w=[y.waitForOAuthResponse(),new Promise((x,P)=>{let D=setTimeout(()=>P(new Error(iLc)),3e5);b.push({dispose:a(()=>clearTimeout(D),"dispose")})})];if(c){let x=c;w.push(new Promise((P,D)=>{if(x.isCancellationRequested){Nr.info(this.ctx,"OAuth flow cancelled (already requested)"),D(new Error(oWi));return}let N=x.onCancellationRequested(()=>{Nr.info(this.ctx,"OAuth flow cancelled"),D(new Error(oWi))});b.push(N)}))}v=(await Promise.race(w)).code,Nr.info(this.ctx,"OAuth response received successfully")}catch(w){throw Nr.error(this.ctx,"OAuth flow error",w),w}finally{for(let x of b)x.dispose();let w,R=new Promise(x=>w=setTimeout(x,5e3));await Promise.race([y.waitForResponseSent().finally(()=>clearTimeout(w)),R]).catch(()=>{}),await y.stop().catch(x=>{Nr.warn(this.ctx,"Failed to stop loopback auth server",x)})}return await this.exchangeCodeForToken({endpointUri:n.token_endpoint,redirectUri:y.redirectUri,code:v,clientId:l,clientSecret:u,codeVerifier:h?.codeVerifier,resource:d})}async exchangeCodeForToken({endpointUri:e,redirectUri:r,code:n,clientId:o,clientSecret:s,codeVerifier:c,resource:l}){let u=[["grant_type","authorization_code"],["code",n],["client_id",o],["redirect_uri",r]];s&&u.push(["client_secret",s]),c&&u.push(["code_verifier",c]),l&&u.push(["resource",l]);let d=new URLSearchParams(u);Nr.info(this.ctx,"Exchanging authorization code for token",{endpointUri:e,clientId:o,redirectUri:r});let f=await PX(this.ctx,e,"POST",{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},d.toString());if(f.ok){let h=await f.json();return Nr.info(this.ctx,"Token exchange successful"),h}else{let h=await f.text(),m=new Error(h);throw m.name="Token Exchange Error",m}}buildAuthorizationParams({clientId:e,scope:r,pkceParams:n,resource:o,...s}){let c=[["client_id",e],["response_type","code"],["scope",r]];n&&c.push(["code_challenge",n.codeChallenge],["code_challenge_method",n.codeChallengeMethod]),o&&c.push(["resource",o]);for(let[l,u]of Object.entries(s??{}))u!==void 0&&c.push([l,String(u)]);return c}};var DN=class t{constructor(e,r,n,o){this.id=t.providerId;this.label="GitHub";this.supportsMultipleAccounts=!1;this.authorizationServers=[t.providerId];this.ctx=e,this.serverMetadata=n,this.resourceMetadata=o,this._sessionsPromise=this.readSessions().then(s=>(setTimeout(()=>s.forEach(c=>{this.afterSessionLoad(c)}),1e3),s))}static{a(this,"GitHubAuthenticationProvider")}static{this.providerId="https://github.com/login/oauth"}async getSessions(e,r){await this.checkSessionsExpiration();let n=await this._sessionsPromise,o=e?.sort()||[];return o.length?n.filter(c=>d3r([...c.scopes].sort(),o)):n}async afterSessionLoad(e){}async readSessions(){let e=await this.ctx.get(Yn).read("oauth",this.id);return e||[]}async createSession(e,r){let n=[...e].sort(),o=await this._sessionsPromise,s=this.ctx.get(zp),c=s.findAppIdToAuthenticate(),l=s.findAppSecretToAuthenticate(),u=eWi(r.provider)?r.provider:void 0,d=typeof r.loginHint=="string"?r.loginHint:void 0,f=d?{login:d,provider:u}:{prompt:"select_account",provider:u},h=await new R_e(this.ctx).auth({clientId:c,clientSecret:l},n,this.serverMetadata,this.resourceMetadata,f,r.cancellationToken),m=await this.tokenToSession(h.access_token,e);this.afterSessionLoad(m);let g=o.findIndex(y=>y.account.id===m.account.id&&d3r([...y.scopes].sort(),n)),A=new Array;return g>-1?A.push(...o.splice(g,1,m)):o.push(m),await this.storeSessions(o),m}async storeSessions(e){this._sessionsPromise=Promise.resolve(e),await this.ctx.get(Yn).update("oauth",this.id,e)}async tokenToSession(e,r){let n=await this.getUserInfo(e);return{id:crypto.getRandomValues(new Uint32Array(2)).reduce((o,s)=>o+=s.toString(16),""),accessToken:e,account:{label:n.accountName,id:n.id},scopes:r}}buildGetUserInfoUrl(){try{let e=new URL(this.serverMetadata?.issuer);return e.hostname.toLowerCase()==="github.com"?"https://api.github.com/user":`${e.origin.replace(/\/+$/,"")}/api/v3/user`}catch{return"https://api.github.com/user"}}async getUserInfo(e){let r=this.buildGetUserInfoUrl(),n;try{n=await this.ctx.get(tr).fetch(new URL(r).href,{method:"GET",headers:{Authorization:`token ${e}`}})}catch(o){return TTt.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}if(n.ok)try{let o=await n.json();return{id:`${o.id}`,accountName:o.login}}catch(o){return TTt.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}else{let o=n.statusText;try{let s=await n.json();s.message&&(o=s.message)}catch{}return TTt.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}}async removeSession(e){let r=await this._sessionsPromise,n=r.findIndex(o=>o.id===e);if(n>-1)r.splice(n,1),await this.storeSessions(r);else throw new Error(`No session with id '${e}' found.`)}async checkSessionsExpiration(){let e=await this._sessionsPromise;if(e.length!==0)for(let r of e)await this.isSessionExpired(r)&&await this.removeSession(r.id)}async isSessionExpired(e){let{accessToken:r}=e,{id:n,accountName:o}=await this.getUserInfo(r);return!n||!o}};var oLc=S.Object({scopes:S.Optional(S.Array(S.String({minLength:1}),{minItems:1})),authServer:S.Optional(S.String({minLength:1})),socialProvider:bTt,loginHint:S.Optional(S.String({minLength:1}))});async function sLc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ze.RequestCancelled,message:"Sign-in request was cancelled"}];let n=t.get(Ur),{status:o,user:s,sourceEnvVar:c}=await n.checkAndUpdateStatus({authAuthority:r.authServer});if(o==="OK")return[{status:o,user:s},null];if(c)return[null,{code:Ze.AuthEnvVarConflict,message:d7e(c)}];let l=await STt(t,(u,d)=>new DN(u,DN.providerId,d,void 0),{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider,loginHint:r.loginHint},e);if(!["OK","MaybeOK"].includes(l.status))throw new yi("OAuth authentication failed for unknown reasons. Please try again later.");return[l,null]}catch(n){if(n instanceof FU)return[null,{code:Ze.NoBrowserAvailable,message:n.message}];if(!(n instanceof yi))throw n;return[null,{code:Ze.CodeFlowFailed,message:n.message}]}}a(sLc,"handleSignInWithCodeFlowChecked");var sWi=Oe(oLc,sLc);p();p();p();var D9=class extends Error{static{a(this,"OperationCancelledError")}constructor(e="Operation was cancelled"){super(e),this.name="OperationCancelledError"}},uFe=class extends Error{static{a(this,"OperationTimeoutError")}constructor(e="Operation timed out"){super(e),this.name="OperationTimeoutError"}};function aWi(t,e,r){return e.isCancellationRequested?Promise.reject(new D9):new Promise((n,o)=>{let s=!1,c=e.onCancellationRequested(()=>{s||(s=!0,clearTimeout(l),c.dispose(),o(new D9))}),l=setTimeout(()=>{s||(s=!0,c.dispose(),o(new uFe))},r);t.then(u=>{s||(s=!0,clearTimeout(l),c.dispose(),n(u))},u=>{s||(s=!0,clearTimeout(l),c.dispose(),o(u instanceof Error?u:new Error(String(u))))})})}a(aWi,"raceWithCancellationAndTimeout");var aLc=["repo","workflow"];async function cLc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...Gy(t)},json:{client_id:e,scope:n.join(" ")},timeout:3e4},s=new URL("login/device/code",r).href,c;try{c=await t.get(tr).fetch(s,o)}catch(l){throw l instanceof Error&&XI(l)?new yi(`Could not log in with device flow on ${r}: ${l.message}`):l}if(!c.ok)throw new yi(`Could not log in with device flow on ${r}: HTTP ${c.status}`);return await c.json()}a(cLc,"requestDeviceCode");async function lLc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...Gy(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s;try{s=await t.get(tr).fetch(new URL("login/oauth/access_token",n).href,o)}catch(l){throw l instanceof Error&&XI(l)?new yi(`Device flow token request failed on ${n}: ${l.message}`):l}let c=await s.json();if(c.access_token||c.error==="authorization_pending"||c.error==="slow_down")return c;throw c.error&&c.error_description?new yi(c.error_description):new yi(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(lLc,"requestAccessToken");async function uLc(t,e){let n=await(await Gf(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new yi(`Error retrieving user information: ${String(n.errors)}`);return n}a(uLc,"requestUserInfo");async function dLc(t,e,r){let n=r?.githubAppId??t.get(zp).findAppIdToAuthenticate(),o=r?.scopes??aLc,{serverUrl:s,apiUrl:c,authAuthority:l}=UU(t,r?.authAuthority),u=await cLc(t,n,s,o),d=(async()=>{let f=Date.now()+u.expires_in*1e3,h=u.interval,m;do{if(await new Promise(A=>setTimeout(A,1e3*h)),e.isCancellationRequested)throw new D9("Sign-in request was cancelled");m=await lLc(t,u.device_code,n,s);let g=m.access_token;if(g){let A=await uLc(t,{apiUrl:c,accessToken:g});if(e.isCancellationRequested)throw new D9("Sign-in request was cancelled");let y=m.scope?m.scope.split(" ").filter(E=>E.length>0):o;return{authAuthority:l,githubAppId:n,username:A.login,accessToken:g,scopes:y}}h=m.interval??h}while(Date.now()performance.now()-n,"getElapsedTimeMs");try{let s=t.get(Ur),{status:c,user:l,sourceEnvVar:u}=await s.checkAndUpdateStatus({authAuthority:r.authServer});if(c==="OK")return[{status:c,user:l},null];if(u)return[null,{code:Ze.AuthEnvVarConflict,message:d7e(u)}];Dme(t,"deviceFlow");let d=t.get(Pie),f=await d.initiate(e,{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider});await t.get(ar).connection.sendNotification(hLc,{userCode:f.userCode,verificationUri:f.verificationUri,expiresIn:f.expiresIn});let h=await aWi(f.waitForAuth,e,mLc),m=await d.save(h);return K2(t,"deviceFlow",m.status,o()),[m,null]}catch(s){if(s instanceof D9)return[null,{code:Ze.RequestCancelled,message:"Sign-in request was cancelled"}];if(s instanceof uFe)return K2(t,"deviceFlow","NotSignedIn",o(),s),[null,{code:Ze.DeviceFlowFailed,message:"Sign-in request timed out"}];if(K2(t,"deviceFlow","NotSignedIn",o(),s),!(s instanceof yi))throw s;return[null,{code:Ze.DeviceFlowFailed,message:s.message}]}}a(gLc,"handleSignInWithDeviceFlowChecked");var lWi=Oe(pLc,gLc);p();var ALc=S.Object({githubToken:S.String({minLength:1}),user:S.String({minLength:1}),githubAppId:S.Optional(S.String({minLength:1}))});async function yLc(t,e,r){let n=r.githubToken,o=r.user,s=r.githubAppId,c=t.get(Ur);return[await t.get(HT).save({...c.getConfiguredUrls(),accessToken:n,login:o,githubAppId:s}),null]}a(yLc,"handleSignInWithGithubTokenChecked");var uWi=Oe(ALc,yLc);p();var ELc=S.Object({options:S.Optional(S.Object({}))});async function _Lc(t,e,r){return[await t.get(Ur).signOutEditor(),null]}a(_Lc,"handleSignOutChecked");var dWi=Oe(ELc,_Lc);p();var vLc=S.Object({transaction:S.Optional(S.String()),stacktrace:S.Optional(S.String()),properties:S.Optional(S.Record(S.String(),S.String())),platform:S.Optional(S.String()),exception_detail:S.Optional(S.Array(S.Object({type:S.Optional(S.String()),value:S.Optional(S.String()),stacktrace:S.Optional(S.Array(S.Object({filename:S.Optional(S.String()),lineno:S.Optional(S.Union([S.String(),S.Integer()])),colno:S.Optional(S.Union([S.String(),S.Integer()])),function:S.Optional(S.String()),in_app:S.Optional(S.Boolean())})))})))}),m3r=class extends Error{constructor(r,n){super(r);this.code=n;this.name="AgentEditorError"}static{a(this,"AgentEditorError")}};function CLc(t,e,r){let n=t.get(ds),o=t.get(Ir).getEditorPluginInfo(),s=r.properties||{},c;r.platform&&r.exception_detail&&A4.has(o.name)&&(c=Object.assign({rollup_id:"auto",context:cPt(t),sensitive_context:{},deployed_to:n.getBuildType(),platform:r.platform,exception_detail:r.exception_detail},A4.get(o.name)),r.transaction&&(c.transaction=r.transaction),n.getBuildType()!=="dev"&&(c.release=`${c.app}@${o.version}`));let l=new m3r(r.stacktrace??"N/A",o.name);return l.stack=void 0,qa(t,l,r.transaction??"",s,c),["OK",null]}a(CLc,"handleTelemetryExceptionChecked");var fWi=Oe(vLc,CLc);p();p();p();Mo();function g3r(t,e){let r=Date.now()+((t?.refresh_in??0)+QDt)*1e3;return new WW({token:`test token ${Mt()}`,refresh_in:0,expires_at:r,...t},e,r)}a(g3r,"createTestCopilotToken");var k_e=class extends Rh{constructor(){super(...arguments);this.defaultToken=g3r({token:"tid=test;rt=1"})}static{a(this,"FakeCopilotTokenFetcherFromSession")}fetchTokenResult(r,n){switch(n.accessToken){case"":return{copilotToken:this.defaultToken};case"valid-github-token":return{copilotToken:g3r({token:"tid=valid-copilot-token"})};case void 0:return{failureKind:"NotSignedIn"};case"notauth-github-token":return{failureKind:"NotAuthorized",message:"notauth",canSignUpForLimited:!0};case"bogus-github-token":return{failureKind:"NotAuthorized",message:"bogus",canSignUpForLimited:!1};case"expired-github-token":return{failureKind:"HTTP401",message:"expired"};default:throw new Error("Don't have a valid GitHub token")}}};var wTt=class extends Rh{constructor(r){super();this.envelopeFn=r}static{a(this,"StaticCopilotTokenFetcher")}async fetchTokenResult(){return{copilotToken:g3r(await this.envelopeFn())}}};var bLc=S.Object({options:S.Optional(S.Object({}))});async function SLc(t,e,r){let n=new k_e;return t.get(Ur).setTransientSession({accessToken:"valid-github-token",login:"always auth"}),t.forceSet(Rh,n),t.get(ps).forceNormal("auth",{result:{status:"OK",user:"always auth"}}),await new Promise(o=>setTimeout(o,0)),["OK",null]}a(SLc,"handleTestingAlwaysAuthChecked");var A3r=Oe(bLc,SLc);p();Mo();var TLc=S.Object({messages:S.Array(S.Object({role:S.Enum(ic),content:S.String(),name:S.Optional(S.String())})),modelFamily:S.Optional(S.Enum(Rn)),stop:S.Optional(S.Array(S.String())),conversationOptions:S.Optional(S.Object({maxResponseTokens:S.Optional(S.Number()),temperature:S.Optional(S.Number())}))});async function ILc(t,e,r){let n=new oc(t),s=await yq(t)?Rn.Gpt35turbo:Rn.CopilotBase,c=await t.get(el).getBestChatModelConfig([r.modelFamily??s]),l=await axe(t,"","");return[await n.fetchResponse({modelConfiguration:c,messages:r.messages,uiKind:"conversationIntegrationTest",stop:r.stop,intentParams:{intent:!0},llmInteraction:OA.user("test",Mt())},e,l),null]}a(ILc,"handleChatMLChecked");var pWi=Oe(TLc,ILc);p();p();p();var O_e=de(Azi(),1),v8h={ALPN_HTTP2:O_e.default.ALPN_HTTP2,ALPN_HTTP2C:O_e.default.ALPN_HTTP2C,ALPN_HTTP1_1:O_e.default.ALPN_HTTP1_1,ALPN_HTTP1_0:O_e.default.ALPN_HTTP1_0},{fetch:C8h,context:yzi,reset:b8h,noCache:S8h,h1:T8h,keepAlive:I8h,h1NoCache:x8h,keepAliveNoCache:w8h,cacheStats:R8h,clearCache:k8h,offPush:P8h,onPush:D8h,createUrl:N8h,timeoutSignal:M8h,Body:O8h,Headers:Ezi,Request:L8h,Response:B8h,AbortController:F8h,AbortError:$Tt,AbortSignal:U8h,FetchBaseError:Q8h,FetchError:q8h,ALPN_HTTP2:j8h,ALPN_HTTP2C:H8h,ALPN_HTTP1_1:G8h,ALPN_HTTP1_0:$8h}=O_e.default;var vzi=require("crypto"),Czi=require("http"),bzi=require("stream"),Szi=require("util"),B_e=de(PP());var z3c=6e5,Y3c=new B_e.ProtocolRequestType("copilot/fetch"),K3c=new B_e.ProtocolRequestType("copilot/fetchCancel"),J3c=new B_e.ProgressType,Z3c=new B_e.ProtocolRequestType("copilot/fetchDisconnectAll"),qL=class extends Error{static{a(this,"EditorFetcherError")}constructor(e){super(e),this.name="EditorFetcherError"}},L_e=class extends tr{constructor(r){super();this.ctx=r;this.name="EditorFetcher";this.userAgent=`GithubCopilot/${r.get(ds).getVersion()}`}static{a(this,"EditorFetcher")}disconnectAll(){return this.ctx.get(ar).connection.sendRequest(Z3c,{})}async fetch(r,n){n.headers||={},n.headers["user-agent"]=this.userAgent;let{signal:o}=n,s=this.ctx.get(ar).connection,c=(0,vzi.randomUUID)(),l=new Fn.CancellationTokenSource,u=new bzi.PassThrough,d=a(()=>{s.sendRequest(K3c,{workDoneToken:c})},"sendCancelRequest"),f=a(()=>{u.emit("error",new $Tt("EditorFetch request aborted")),u.end()},"destroyBodyStream");if(o){if(!(o instanceof AbortSignal))throw new qL("EditorFetcher received unexpected abort signal");if(o.aborted)throw new $Tt("EditorFetcher signal aborted before fetch");o.addEventListener("abort",d)}s.onProgress(J3c,c,m=>{m.kind==="end"?(o?.removeEventListener("abort",d),o?.removeEventListener("abort",f),m.error&&u.emit("error",new qL(m.error)),u.end()):m.kind==="report"&&u.write(m.chunk)});let h=await new Promise((m,g)=>{let A=n.timeout??z3c,y=setTimeout(()=>{At(this.ctx,"editorFetcher.requestTimeout",{method:n.method??"GET",timeoutMs:String(A)}),g(new qL("Request timed out from lsp server"))},A),E=a(()=>{g(new $Tt("EditorFetcher request aborted"))},"rejectIfAborted");o?.addEventListener("abort",E),s.sendRequest(Y3c,eFc(r,c,n),l.token).then(m).catch(_=>{let v="EditorFetcher request failed";_&&typeof _=="object"&&"message"in _&&(v+=`: ${String(_.message)}`),_&&typeof _=="object"&&"data"in _&&(v+=`: ${(0,Szi.inspect)(_.data)}`),g(new qL(v))}).finally(()=>{o?.removeEventListener("abort",E),clearTimeout(y)})});if(!h.status)throw new qL("EditorFetcher received invalid response");return o?.addEventListener("abort",f),new ex(h.status,Czi.STATUS_CODES[h.status]??"",new Ezi(h.headers),()=>X3c(u),()=>u)}};function X3c(t){return new Promise((e,r)=>{let n="";t.on("error",r),t.on("end",()=>e(n)),t.on("data",o=>n+=String(o))})}a(X3c,"consumeStream");function eFc(t,e,r){let{timeout:n,method:o}=r,s=r.headers??{},c=r.json?JSON.stringify(r.json):r.body;return r.json&&(s["content-type"]="application/json"),{url:t,headers:s,body:c,timeout:n,method:o,workDoneToken:e}}a(eFc,"convertOptionsToParams");var tFc=S.Object({url:S.String(),headers:S.Optional(S.Record(S.String(),S.String())),body:S.Optional(S.String()),timeout:S.Optional(S.Number()),method:S.Optional(S.Union([S.Literal("GET"),S.Literal("POST"),S.Literal("DELETE")])),cancelBeforeRequest:S.Optional(S.Boolean()),cancelAfterRequest:S.Optional(S.Boolean()),cancelAfterFirstChunk:S.Optional(S.Boolean())});async function rFc(t,e,r){let n=new L_e(t),o=new AbortController,s=o.signal,{url:c,cancelBeforeRequest:l,cancelAfterRequest:u,cancelAfterFirstChunk:d,...f}=r;l&&o.abort();let h=n.fetch(c,{signal:s,...f});u&&o.abort();let m;try{m=await h}catch(y){return[{error:`Fetch stream error: ${y instanceof qL?y.message:String(y)}`},null]}let{status:g}=m,A=Object.fromEntries(Array.from(m.headers));try{if(d){let E=m.body();for await(let _ of E){let v=_.toString();return o.abort(),[{status:g,headers:A,body:v},null]}}let y=await m.text();return[{status:g,headers:A,body:y},null]}catch(y){return[{error:`Fetch stream error: ${y instanceof qL?y.message:String(y)}`},null]}}a(rFc,"handleTestingFetchChecked");var Tzi=Oe(tFc,rFc);p();var nFc=S.Object({});async function iFc(t,e,r){return await t.get(xd).flush(),["OK",null]}a(iFc,"handleTestingFlushPromiseQueueChecked");var Izi=Oe(nFc,iFc);p();p();p();var $V=class{static{a(this,"FileSearch")}};p();p();p();var VTt=class{constructor(e){this.maxDegreeOfParalellism=e;this.outstandingPromises=[],this.runningPromises=0}static{a(this,"PriorityLimiter")}queue(e,r=!1){return new Promise((n,o)=>{r?this.outstandingPromises.unshift({factory:e,c:n,e:o}):this.outstandingPromises.push({factory:e,c:n,e:o}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.consumed(),()=>this.consumed())}}consumed(){this.runningPromises--,this.outstandingPromises.length>0&&this.consume()}};var xzi=de(ri());var WTt="main.js",zTt=class{constructor(e,r,n=3){this.promiseResolvers=new Map;this.id=0;try{let o={cwd:process.cwd(),indexWorkspaceRoots:e,params:r};this.worker=shn(WTt,o),this.worker.on("message",this.handleWorkerMessage.bind(this)),this.worker.on("error",s=>{this.handleUnexpectedError(s)}),this.postMessageQueue=new VTt(n)}catch(o){throw console.error(`Failed to create worker: ${o.message}`),o}}static{a(this,"IndexClient")}dispose(){return this.postMessageInQueue(new jVe(this.id++),xzi.CancellationToken.None,!0)}async indexFile(e,r,n){return await this.postMessageInQueue(new UVe(this.id++,e,r),n)}async getAllFileNames(e,r){return this.postMessageInQueue(new QVe(this.id++,e),r)}getContext(e,r,n,o,s,c){return this.postMessageInQueue(new qVe(this.id++,e,r,n,o,s),c,!0)}tryCreateIndex(e,r,n){return this.postMessageInQueue(new BVe(this.id++,e,r),n)}async postMessageInQueue(e,r,n=!1){return this.postMessageQueue.queue(()=>this.postMessageAndWait(e,r),n)}tryRemoveIndex(e,r){return this.postMessageAndWait(new FVe(this.id++,e),r)}async postMessageAndWait(e,r){if(this.fatalError)return Promise.reject(this.fatalError);let n=new Promise((s,c)=>{this.promiseResolvers.set(e.id,{resolve:s,reject:c})});this.worker.postMessage(e);let o=r.onCancellationRequested(()=>{this.worker.postMessage(new LVe(e.id))});try{return await n}finally{o.dispose()}}handleWorkerMessage(e){if(e.operation!=="response")throw new Error("Unexpected message operation");let r=this.promiseResolvers.get(e.id);if(!r)throw new Error(`Received response for message that isn't in progress: ${e.id}`);this.promiseResolvers.delete(e.id),e.error?(e.error.code=e.code,r.reject(e.error)):r.resolve(e.data)}handleUnexpectedError(e){let r;if(e instanceof Error){r=e,r.code==="MODULE_NOT_FOUND"&&r.message?.endsWith(WTt+"'")&&(r=new Error(`Failed to load ${WTt}`),r.code="CopilotPromptLoadFailure");let n=new Error().stack;r.stack&&n?.match(/^Error\n/)&&(r.stack+=n.replace(/^Error/,""))}else e&&typeof e=="object"&&"name"in e&&"status"in e&&e.name==="ExitStatus"&&typeof e.status=="number"?(r=new Error(`${WTt} exited with status ${e.status}`),r.code=`CopilotPromptWorkerExit${e.status}`):r=new Error(`Non-error thrown: ${JSON.stringify(e)}`);for(let n of this.promiseResolvers.values())n.reject(r);this.promiseResolvers.clear(),this.fatalError=r}};var yFe=de(ri());var B9=new fe(Nfr),YTt=class{constructor(e,r,n,o,s){this.ctx=e;this.watcher=r;this.workspaceDatabasePersistenceManager=n;this.workspaceInit=new Map;this.watcher.onFileChange(async(c,l)=>{await this.indexFile(l,this.languageId(l)??"plaintext")}),this.watcher.onWorkspaceChange(async(c,l)=>{if(c===1){B9.debug(this.ctx,`workspace removed: ${l}`),await this.indexClient.tryRemoveIndex(l,yFe.CancellationToken.None);return}B9.debug(this.ctx,`workspace added: ${l}`),await this.indexAddedWorkspace(l)}),this.indexClient=new zTt(o,s);for(let c of o){let l=c.rootPath;this.workspaceInit.set(l,this.doWorkspaceIndex(l).then(()=>{B9.debug(this.ctx,`workspace ${l} indexed`),this.workspaceInit.delete(l)}))}}static{a(this,"MultiLanguageContextIndexWatcher")}isInitializing(e){for(let[r]of this.workspaceInit)if(e.startsWith(r))return!0;return!1}dispose(){return this.indexClient.dispose()}async indexAddedWorkspace(e){let r=await oFc(e,this.workspaceDatabasePersistenceManager);await this.indexClient.tryCreateIndex(r.rootPath,r.databaseFilePath,yFe.CancellationToken.None),this.workspaceInit.has(e)&&await this.workspaceInit.get(e);let n=this.doWorkspaceIndex(e).then(()=>{B9.debug(this.ctx,`workspace ${e} indexed`),this.workspaceInit.delete(e)});this.workspaceInit.set(e,n)}async doWorkspaceIndex(e){B9.debug(this.ctx,`indexing workspace ${e}`);let r=Y8t.map(f=>`*${f}`);if(r.length===0)return;let o=`**/${Y8t.length===1?r[0]:`{${r.join(",")}}`}`,s=this.ctx.get($V),c=await Promise.all([s.findFiles(o,{uri:e},{excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0,excludeIDESearchIgnoredFiles:!0}),this.indexClient.getAllFileNames(e,yFe.CancellationToken.None)]),l=c[0],u=c[1],d=Array.from(new Set([...l,...u]));B9.debug(this.ctx,`found ${d.length} files to index in ${e}`),await Promise.all(d.map(async f=>{let h=this.languageId(f);h&&await this.indexFile(f.replace(/\/+$/,""),h)})),B9.debug(this.ctx,`finished indexing workspace ${e}`)}async indexFile(e,r){try{B9.debug(this.ctx,`index triggered for ${e}`),await this.indexClient.indexFile(e,r,yFe.CancellationToken.None)}catch(n){B9.debug(this.ctx,`failed to index ${e} with ${n}`)}}languageId(e){return cfn(e)}};async function oFc(t,e){return{databaseFilePath:await e.getDBFilePath(t),rootPath:t}}a(oFc,"createIndexableWorkspaceFolder");var sFc=S.Object({filePath:S.String(),code:S.String(),offset:S.Number(),languageId:S.String(),timeout:S.Optional(S.Number()),waitForContext:S.Optional(S.Boolean())});async function aFc(t,e,r){try{await t.get(US).start();let n=t.get(YTt),o=r.timeout??1e3,s=Date.now(),c=[],l=!0;for(;l;)try{c=await n.indexClient.getContext(r.filePath,r.code,r.offset,r.languageId,Mfr,e)}catch{}finally{l=(r.waitForContext??!1)&&c.length==0&&Date.now()-ssetTimeout(n,0)),["OK",null]}a(dFc,"handleTestingNeverAuthChecked");var V3r=Oe(uFc,dFc);p();p();p();var W3r=class extends pp{constructor(r){super();this.certificates=r}static{a(this,"TestCertificateReader")}getAllRootCAs(){return this.certificates}},kzi=a(t=>new W3r(t),"createTestCertificateReader");function Y3r(t,e,r){let n=new z3r;n.set("x-github-request-id","1");for(let[o,s]of Object.entries(r||{}))n.set(o,s);return new ex(t,"status text",n,()=>Promise.resolve(e??""),()=>null)}a(Y3r,"createFakeResponse");function Pzi(t,e,r){let n;return typeof e=="string"?n=e:n=JSON.stringify(e),Y3r(t,n,Object.assign({"content-type":"application/json"},r))}a(Pzi,"createFakeJsonResponse");var EFe=class extends tr{constructor(){super(...arguments);this.name="FakeFetcher"}static{a(this,"FakeFetcher")}disconnectAll(){throw new Error("Method not implemented.")}};var KTt=class extends EFe{static{a(this,"NoFetchFetcher")}fetch(e,r){throw new Error("NoFetchFetcher does not support fetching")}};var z3r=class{constructor(){this.headers=new Map}static{a(this,"FakeHeaders")}append(e,r){this.headers.set(e.toLowerCase(),r)}delete(e){this.headers.delete(e.toLowerCase())}get(e){return this.headers.get(e.toLowerCase())??null}has(e){return this.headers.has(e.toLowerCase())}set(e,r){this.headers.set(e.toLowerCase(),r)}entries(){return this.headers.entries()}keys(){return this.headers.keys()}values(){return this.headers.values()}[Symbol.iterator](){return this.headers.entries()}};var K3r=class extends EFe{static{a(this,"ExpConfigFetcher")}constructor(e){super(),this.fullConfig={Features:[],Flights:{},Configs:[{Id:"vscode",Parameters:e.Parameters}],ParameterGroups:[],AssignmentContext:e.AssignmentContext}}fetch(e,r){return e.endsWith("telemetry")?Promise.resolve(Pzi(200,this.fullConfig)):Promise.resolve(Y3r(404,""))}},JTt=class extends K3r{constructor(r,n){super(r);this.delegate=n}static{a(this,"ExpConfigFetcherWithDelegate")}fetch(r,n){return r.endsWith("telemetry")?super.fetch(r,n):this.delegate.fetch(r,n)}};var fFc=S.Object({expFlags:S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean()]))});function pFc(t,e,r){if(r.expFlags){let n={AssignmentContext:"assignmentcontext",Parameters:{...r.expFlags}};t.forceSet(tr,new JTt(n,t.get(tr)))}return["OK",null]}a(pFc,"handleTestingOverrideExpFlagsChecked");var Dzi=Oe(fFc,pFc);p();var hFc=S.Object({rules:oUt});function mFc(t,e,r){return t.get(nc).setTestingRules(r.rules),["OK",null]}a(mFc,"handleTestingSetContentExclusionRulesChecked");var Nzi=Oe(hFc,mFc);p();var gFc=S.Object({workDoneToken:S.Union([S.String(),S.Number()]),chunks:S.Array(S.String()),followUp:S.Optional(S.String()),suggestedTitle:S.Optional(S.String()),skills:S.Optional(S.Array(S.String())),references:S.Optional(S.Array(OO)),options:S.Optional(S.Object({}))});function AFc(t,e,r){return t.get(F9).add(r.workDoneToken,r.chunks,r.followUp,r.suggestedTitle,r.skills,r.references),["OK",null]}a(AFc,"handleTestingSetSyntheticTurnsChecked");var Mzi=Oe(gFc,AFc);p();var yFc=S.Object({});async function EFc(t,e,r){let n=t.get(ts),o=t.get(qf);return await n.showWarningMessage("This is a test message",{title:"Some Action"}).then(c=>s(3,"response from message request",c?.title)).catch(c=>s(1,"error sending show message request",c)),["OK",null];function s(c,l,u){return o.logIt(t,c,"triggerShowMessage",`${l} (${String(u)})`)}a(s,"sendNotification")}a(EFc,"handleTriggerShowMessageChecked");var Ozi=Oe(yFc,EFc);p();p();p();p();var Lzi=de(require("tls"));var F_e=class{static{a(this,"RootCertificateConfigurator")}#e;constructor(e){this._certificateReader=e.get(pp)}async getCertificates(){let e=await this._certificateReader.getAllRootCAs();if(e.length!==0)return e}async createSecureContext(){let e=await this._certificateReader.getAllRootCAs(),n=Lzi.createSecureContext({_vscodeAdditionalCaCerts:e}),o=n.context;for(let s of e)o.addCACert(s);return{secureContext:n,certs:e}}async applyToRequestOptions(e){this.#e??=this.createSecureContext();let r=await this.#e;e.secureContext=r.secureContext,e.ca=r.certs,e.cert=r.certs}};p();var zzi=de(require("http"));var GFc=407,wy=new fe("proxySocketFactory"),uk=class{static{a(this,"ProxySocketFactory")}},Lie=class extends Error{static{a(this,"ProxySocketError")}constructor(e,r,n){super(e),this.code=r?.code,this.syscall=r?.syscall,this.errno=r?.errno,/^Failed to establish a socket connection to proxies:/.test(r?.message??"")?this.code="ProxyFailedToEstablishSocketConnection":/^InitializeSecurityContext:/.test(r?.message??"")?this.code="ProxyInitializeSecurityContext":r?.message==="Miscellaneous failure (see text): Server not found in Kerberos database"?this.code="ProxyKerberosServerNotFound":/^Unspecified GSS failure. {2}Minor code may provide more information: No Kerberos credentials available/.test(r?.message??"")&&(this.code="ProxyGSSFailureNoKerberosCredentialsAvailable"),n!==void 0&&(this.code=n);let o=/^ProxyStatusCode(\d+)$/.exec(this.code??"");o&&(this.statusCode=Number(o[1]))}};function ZTt(t){return new X3r(t,new eFr(t))}a(ZTt,"getProxySocketFactory");var X3r=class extends uk{constructor(r,n,o=new vFe,s=process.platform){super();this.ctx=r;this.delegate=n;this.kerberosLoader=o;this.platform=s;this.successfullyAuthorized=new Cn(20)}static{a(this,"KerberosProxySocketFactory")}async createSocket(r,n){this.successfullyAuthorized.get(this.getProxyCacheKey(n))&&(wy.debug(this.ctx,"Proxy authorization already successful once, skipping 407 round trip"),await this.reauthorize(r,n));try{return await this.delegate.createSocket(r,n)}catch(o){if(o instanceof Lie&&o.code===`ProxyStatusCode${GFc}`){wy.debug(this.ctx,"Proxy authorization required, trying to authorize first time");let s=await this.authorizeAndCreateSocket(r,n);if(s)return wy.debug(this.ctx,"Proxy authorization successful, caching result"),Et(this.ctx,"proxy.kerberosAuthorized"),this.successfullyAuthorized.set(this.getProxyCacheKey(n),!0),s}throw o}}async reauthorize(r,n){let o=await this.authorize(n);o&&(wy.debug(this.ctx,"Proxy re-authorization successful, received token"),r.headers["Proxy-Authorization"]="Negotiate "+o)}async authorizeAndCreateSocket(r,n){let o=await this.authorize(n);if(wy.debug(this.ctx,"Proxy authorization successful, received token"),o)return wy.debug(this.ctx,"Trying to create socket with proxy authorization"),r.headers["Proxy-Authorization"]="Negotiate "+o,await this.delegate.createSocket(r,n)}async authorize(r){wy.debug(this.ctx,"Loading kerberos module");let n=await this.kerberosLoader.load(),o=this.computeSpn(r);wy.debug(this.ctx,"Initializing kerberos client using spn",o);let s=await n.initializeClient(o);wy.debug(this.ctx,"Perform client side kerberos step");let c=await s.step("");return wy.debug(this.ctx,"Received kerberos server response"),c}computeSpn(r){let n=r.kerberosServicePrincipal;if(n)return wy.debug(this.ctx,"Using configured kerberos spn",n),n;let o=this.platform==="win32"?`HTTP/${r.hostname}`:`HTTP@${r.hostname}`;return wy.debug(this.ctx,"Using default kerberos spn",o),o}getProxyCacheKey(r){return`${r.hostname}:${r.port}`}},eFr=class extends uk{constructor(r){super();this.ctx=r;this.userAgent=`GithubCopilot/${this.ctx.get(ds).getVersion()}`}static{a(this,"TunnelingProxySocketFactory")}async createSocket(r,n){let o=this.createConnectRequestOptions(r,n);return new Promise((s,c)=>{wy.debug(this.ctx,"Attempting to establish connection to proxy");let l=zzi.request(o);l.useChunkedEncodingByDefault=!1,l.once("connect",(u,d,f)=>{wy.debug(this.ctx,"Socket Connect returned status code",u.statusCode),l.removeAllListeners(),d.removeAllListeners(),u.statusCode!==200?(d.destroy(),c(new Lie(`tunneling socket could not be established, statusCode=${u.statusCode}`,void 0,`ProxyStatusCode${u.statusCode}`))):f.length>0?(d.destroy(),c(new Lie(`got non-empty response body from proxy, length=${f.length}`,void 0,"ProxyNonEmptyResponseBody"))):(wy.debug(this.ctx,"Successfully established tunneling connection to proxy"),s(d))}),l.once("error",u=>{wy.debug(this.ctx,"Proxy socket connection error",u.message),l.removeAllListeners(),c(new Lie(`tunneling socket could not be established, cause=${u.message}`,u))}),l.on("timeout",()=>{wy.debug(this.ctx,"Proxy socket connection timeout"),c(new Lie(`tunneling socket could not be established, proxy socket connection timeout while connecting to ${o.hostname}:${o.port}`,void 0,"ProxyTimeout"))}),l.end()})}createConnectRequestOptions(r,n){let o=`${r.hostname}:${r.port}`,s={hostname:n.hostname,port:n.port,method:"CONNECT",path:o,agent:!1,headers:{host:o,"Proxy-Connection":"keep-alive","User-Agent":this.userAgent},timeout:r.timeout};return r.localAddress&&(s.localAddress=r.localAddress),this.configureProxyAuthorization(s,r,n.authorization),s}configureProxyAuthorization(r,n,o){r.headers["Proxy-Authorization"]=[],o&&r.headers["Proxy-Authorization"].push("Basic "+Buffer.from(o).toString("base64")),typeof n.headers?.["Proxy-Authorization"]=="string"&&r.headers["Proxy-Authorization"].push(n.headers["Proxy-Authorization"])}},vFe=class{static{a(this,"KerberosLoader")}load(){return Promise.resolve().then(()=>de(Wzi()))}};var Bie=class extends tr{constructor(r,n){super();this.name="HelixFetcher";this.certificateConfigurator=new F_e(r),this.proxySocketFactory=r.get(uk),this.proxySocketTimeoutForTesting=n?.proxySocketTimeoutForTesting,r.get(Lo).onDidChangeHttpSettings(o=>{this.fetchApi=this.createFetchApi(r,o),this.updateNoProxy(o.noProxy)}),this.fetchApi=this.createFetchApi(r,r.get(Lo).getHttpSettings()),this.updateNoProxy(r.get(Lo).getHttpSettings().noProxy),this.fetchApiByPass=this.createFetchApi(r,{proxy:""})}static{a(this,"HelixFetcher")}maybeCreateSocketFactory(r,n){if(!r?.proxy)return;let o=new URL(r.proxy);return async s=>(s.rejectUnauthorized=r.proxyStrictSSL,s.timeout=n,await this.certificateConfigurator.applyToRequestOptions(s),await this.proxySocketFactory.createSocket(s,{hostname:o.hostname,port:o.port,authorization:r.proxyAuthorization,kerberosServicePrincipal:r.proxyKerberosServicePrincipal}))}createFetchApi(r,n){let o=r.get(ds),s=this.proxySocketTimeoutForTesting;return yzi({userAgent:`GithubCopilot/${o.getVersion()}`,socketFactory:this.maybeCreateSocketFactory(n,s),rejectUnauthorized:n.proxyStrictSSL})}parseNoProxy(r){return r?.map(n=>n.trim()).filter(n=>n.length>0)||[]}updateNoProxy(r){if(this.noProxy=this.parseNoProxy(r),this.proxyExceptionFilters=void 0,!this.noProxy.length)return;if(this.noProxy.includes("*")){this.proxyExceptionFilters=[{regex:/.*/i}];return}let n=a(s=>{if(!s)return;s.startsWith(".")&&(s=`*${s}`);let c=s.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${c}$`,"i")}catch{return}},"toRegex"),o=[];for(let s of this.noProxy){let c=s,l;if(c.startsWith("[")){let d=c.indexOf("]");if(d!==-1){let f=c.slice(1,d),h=c.slice(d+1);h.startsWith(":")&&(l=h.slice(1)),c=f}}else{let d=c.split(":");d.length===2&&(c=d[0],l=d[1])}let u=n(c);u&&o.push({regex:u,port:l})}o.length&&(this.proxyExceptionFilters=o)}shouldBypassProxy(r){if(!this.proxyExceptionFilters||!this.proxyExceptionFilters.length)return!1;let n;try{n=new URL(r)}catch{return!1}let o=n.hostname;if(!o)return!1;let s=n.port||(n.protocol==="https:"?"443":"80"),c=o.toLowerCase();return this.proxyExceptionFilters.some(l=>l.regex.test(c)&&(!l.port||l.port===s))}async fetch(r,n){let o=n.signal,s=!1;if(n.timeout){let f=new AbortController;setTimeout(()=>{f.abort(),s=!0},n.timeout),n.signal?.addEventListener("abort",()=>f.abort()),n.signal?.aborted&&f.abort(),o=f.signal}let c={...n,body:n.body?n.body:n.json,signal:o},l=this.shouldBypassProxy(r);if(!l){await this.certificateConfigurator.applyToRequestOptions(c);let f=await this.certificateConfigurator.getCertificates();this.fetchApi.setCA(f)}let d=await(l?this.fetchApiByPass:this.fetchApi).fetch(r,c).catch(f=>{throw s?new jW(`Request to <${r}> timed out after ${n.timeout}ms`,f):f});return new ex(d.status,d.statusText,d.headers,()=>d.text(),()=>d.body)}disconnectAll(){return this.fetchApi.reset()}};p();p();var q_e=class extends $m{constructor(r,n={}){super();this.env=n;this.recalculateUrlDefaults(r,this.getDefaultUrls())}static{a(this,"DefaultNetworkConfiguration")}getAuthAuthority(){return this.baseUrlObject.hostname}getConfiguredUrls(){return{serverUrl:this.baseUrlObject.href,apiUrl:this.apiUrl}}setConfiguredUrls(r,n){let o=this.getConfiguredUrls();this.recalculateUrlDefaults(r,n);let s=this.getConfiguredUrls();(o.apiUrl!==s.apiUrl||o.serverUrl!==s.serverUrl)&&r.get(Qt).resetToken("config_urls_changed"),r.get(pf).updateSessionConfig(s)}recalculateUrlDefaults(r,n){let{serverUrl:o,apiUrl:s}=$y({serverUrl:c7e(r,n.serverUrl),apiUrl:c7e(r,n.apiUrl)});this.baseUrlObject=new URL(o),this.apiUrl=s}getDefaultUrls(){return this.env.CODESPACES==="true"&&this.env.GITHUB_TOKEN&&this.env.GITHUB_SERVER_URL&&this.env.GITHUB_API_URL&&!this.env.GITHUB_COPILOT_TOKEN&&!this.env.GH_COPILOT_TOKEN?{apiUrl:this.env.GITHUB_API_URL,serverUrl:this.env.GITHUB_SERVER_URL}:{}}};p();var j_e=class extends ZL{static{a(this,"TelemetryLogSenderImpl")}sendException(e,r,n){qa(e,r,n)}};p();var H_e=class extends m4{static{a(this,"EmptyRecentEditsProvider")}isEnabled(){return!1}start(){}getRecentEdits(){return[]}getEditSummary(e){return null}};p();var XTt=class extends WP{constructor(r=[]){super();this._agents=r}static{a(this,"TestRemoteAgentRegistry")}agents(){return this._agents}};p();var eIt=class extends zh{constructor(){super(...arguments);this.prompts=[];this.fetchResults=[];this.diffs=[]}static{a(this,"TestConversationInspector")}shouldInspect(){return!0}inspectPrompt(r){this.shouldInspect()&&this.prompts.push(r)}inspectFetchResult(r){this.shouldInspect()&&this.fetchResults.push(r)}documentDiff(r){this.shouldInspect()&&this.diffs.push(r)}};p();var tIt=class extends $V{constructor(){super(...arguments);this.allowedFiles=[]}static{a(this,"TestingFileSearch")}addAllowedFiles(r){this.allowedFiles.push(...r)}findFiles(r,{uri:n},o){return Promise.resolve(this.allowedFiles)}};p();function Yzi(t,e="cl100k_base"){return{modelId:"gpt-3.5-turbo",modelFamily:t,uiName:"Test GPT",maxRequestTokens:6144,maxResponseTokens:2048,baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:e,isExperimental:!1,stream:!0,toolCalls:!0}}a(Yzi,"fakeChatModelConfiguration");function $Fc(t){return{modelId:"embedding-test",modelFamily:t,maxBatchSize:1,maxTokens:50,tokenizer:"cl100k_base"}}a($Fc,"fakeEmbeddingModelConfiguration");var rIt=class extends el{static{a(this,"TestModelConfigurationProvider")}getBestChatModelConfig(e){let r=e[0];return Promise.resolve(Yzi(r))}getModelConfigurationById(e){return Promise.resolve({...Yzi(e),modelId:e})}getFirstMatchingEmbeddingModelConfiguration(e){return Promise.resolve($Fc(e))}};p();var nIt=class extends Vm{constructor(){super(...arguments);this.openedUrls=[];this.opened=new vA}static{a(this,"TestUrlOpener")}open(r){return this.openedUrls.push(r),this.opened.resolve(),Promise.resolve()}},iIt=class extends ts{constructor(){super();this.sentMessages=[];this.warningPromises=[];this.informationPromises=[]}static{a(this,"TestNotificationSender")}performDismiss(){this.actionToPerform="DISMISS"}performAction(r){this.actionToPerform=r}showWarningMessage(r,...n){this.sentMessages.push(r);let o;if(this.actionToPerform)if(this.actionToPerform==="DISMISS")o=Promise.resolve(void 0);else{let s=n.find(c=>c.title===this.actionToPerform);o=s?Promise.resolve(s):Promise.resolve(void 0)}else o=n?Promise.resolve(n[0]):Promise.resolve(void 0);return this.warningPromises.push(o),o}showInformationMessage(r,...n){this.sentMessages.push(r);let o;if(this.actionToPerform)if(this.actionToPerform==="DISMISS")o=Promise.resolve(void 0);else{let s=n.find(c=>c.title===this.actionToPerform);o=s?Promise.resolve(s):Promise.resolve(void 0)}else o=n?Promise.resolve(n[0]):Promise.resolve(void 0);return this.informationPromises.push(o),o}showInformationModal(r,...n){return this.showInformationMessage(r,...n)}sendBackgroundAgentSessionUpdate(r,n,o,s){return Promise.resolve()}async waitForMessages(){await Promise.all(this.warningPromises),await Promise.all(this.informationPromises)}};p();function Kzi(t,e,r,n){return NS.create(a7e(t),e,r,n,e)}a(Kzi,"createTextDocument");var tFr=class extends $r{constructor(r,n){super(r,n);this._openTextDocuments=[];this._notebookDocuments=new Map;this._workspaceFolders=[];this.didFocusTextDocumentEmitter=new Wi;this.onDidFocusTextDocument=this.didFocusTextDocumentEmitter.event;this.didChangeTextDocumentEmitter=new Wi;this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event;this.didOpenTextDocumentEmitter=new Wi;this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event;this.didCloseTextDocumentEmitter=new Wi;this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event;this.didChangeWorkspaceFoldersEmitter=new Wi;this.onDidChangeWorkspaceFolders=this.didChangeWorkspaceFoldersEmitter.event}static{a(this,"SimpleTestTextDocumentManager")}init(r){this._workspaceFolders=r.map(n=>({uri:n.uri,name:n.name??Ji(n.uri)}))}async readTextDocumentFromDisk(r){return super.readTextDocumentFromDisk(r)}getTextDocumentsUnsafe(){return this._openTextDocuments}setTextDocument(r,n,o){let s=Kzi(r,n,0,o);return this._openTextDocuments.push(s),s}updateTextDocument(r,n){let o=this._openTextDocuments.findIndex(c=>c.uri===r.toString());if(o<0)throw new Error("Document not found");let s=this._openTextDocuments[o];this._openTextDocuments[o]=Kzi(r,s.clientLanguageId,s.version+1,n)}setNotebookDocument(r,n){this._notebookDocuments.set(r.uri.replace(/#.*/,""),n)}findNotebook({uri:r}){return this._notebookDocuments.get(r.replace(/#.*/,""))}getWorkspaceFolders(){return this._workspaceFolders}},oIt=class extends tFr{constructor(r){super(r);this.contents=new Map}static{a(this,"TestTextDocumentManager")}readTextDocumentFromDisk(r){return Promise.resolve(this.contents.get(r))}setDiskContents(r,n){this.contents.set(r,n)}};var rFr=class extends qf{static{a(this,"NullLog")}logIt(...e){}},nFr=class extends Ur{static{a(this,"TestAuthManager")}constructor(e,r){super(e,{}),this.transientSession=r&&Promise.resolve(r)}resolvePersistedSession(){return Promise.resolve(void 0)}signInEditor(e){return Promise.resolve({status:"OK",user:"test-user"})}signOutEditor(){return Promise.resolve({status:"NotSignedIn"})}revokeTokenById(){return Promise.resolve({affectedEditors:0})}useExistingToken(e){return Promise.resolve({status:"revoked"})}listAvailableTokens(){return Promise.resolve([])}};function VFc(t){let e=new sue;e.set(Lo,t),e.set(OY,t);let r=new nFr(e,{accessToken:"",login:"user"});e.set(Ur,r),e.set(ds,new ds),e.set(tp,new tp),e.set(QI,new QI({debug:!1,verboseLogging:!1,testMode:!0,simulation:!1})),e.set(pp,kzi([])),e.set(uk,ZTt(e)),e.set(Cx,new Cx),e.set(dP,new gje);let n=new k_e;e.set(Rh,n);let o=new Qt(e,!0);e.set(Qt,o);let s=new Op(e);return s.updateFromToken(n.defaultToken),e.set(Op,s),e.set(X0,new X0),e.set(XN,new XN),e.set(ts,new iIt),e.set(Vm,new nIt),e.set(ZL,new j_e),e.set(qf,new rFr),e.set(CC,new CC),e.set(Ua,new Ua("test-session","test-machine","test-device")),e.set(UI,new UI(()=>Promise.resolve("test-device"))),e.set($m,new q_e(e)),e.set(kk,new boe),e.set(pf,new pf(e,"copilot-test")),e.set(Zt,new Zt(e)),e.set(rO,new rO(e,o)),e.set(q2,new q2),e.set(TP,new dle),e.set(ps,new pje),e.set(xd,new xd),e.set(t4,new t4(e)),e.set($V,new tIt),e.set(z2,new z2(e)),e.set(T8,Pdt(e)),e.set(iy,new iy),e.set(Db,new Db),e.set(I8,I8.default),e.set(Ox,new Ox(e,!1)),e.set(zp,new zp),e.set(ii,new ii(e)),e.set(jT,new Mdt),e.set(pm,new pm),e.set(hm,Glt(e,(c,l,u)=>l.find(d=>d==="*")?1:l.find(d=>typeof d!="string"&&d.language===u.languageId)?10:0)),e.set(Nb,new Nb(e)),WFc(e),e.set(Pb,new Pb(e)),e.set(bn,new bn),e.set(m4,new H_e),e.set(CN,new CN),e.set(Aw,new Aw),e.set(nT,new nT(e)),e}a(VFc,"_createBaselineContext");function WFc(t){t.set(zo,new zo(t)),t.set(Tc,new Tc(t)),t.set(kA,new kA(t)),t.set(Yh,new Yh),t.set(Ag,new Ag),t.set(zh,new eIt),t.set(ck,new ck(t,[])),t.set(el,new rIt),t.set(WP,new XTt),t.set(NO,new NO(t));let e=new xN(t);t.set(xN,e),t.set(sk,new sk(e,t)),t.set(HO,new HO(t)),t.set(bI,new $St),t.set(ZC,new ZC(t.get(sk),t.get(bI),t)),t.set(m0,new m0)}a(WFc,"registerConversation");function Jzi(){let t=VFc(new OY(new fle,new Map));return t.set(tr,new KTt),t.set(Ir,new iFr),t.set($r,new oIt(t)),t.set(Qo,new SQ),t.set(nc,new nc(t)),t.set(Au,new Au(t)),t.set(qS,new aYe),t.set(gO,new gO(t)),t.set(r4,new nme),t.set(F2,new Bct),t.set(jl,new Gze),t.set(wA,new wA(t)),t.set(a0,new Rze),t.set(fm,new fm),wze(t),t.set(ry,new dEe(t)),t}a(Jzi,"createLibTestingContext");var iFr=class extends Ir{constructor(r={name:"lib-tests-plugin",version:"2"},n={name:"lib-tests-editor",version:"1"},o=[{name:"lib-tests-related-plugin",version:"3"}]){super();this.editorPluginInfo=r;this.editorInfo=n;this.relatedPluginInfo=o}static{a(this,"LibTestsEditorInfo")}getEditorInfo(){return this.editorInfo}getEditorPluginInfo(){return this.editorPluginInfo}getRelatedPluginInfo(){return this.relatedPluginInfo}};var Xzi=de(require("fs"));var Zzi=`${process.env.HOME}/.copilot-testing-gh-token`,sIt,aIt;function eYi(t){let e=tYi(),r=new wTt(zFc);return t.forceSet(Rh,r),t.get(Ur).setTransientSession(e),r}a(eYi,"setIntegrationTokenManager");var zFc=a(async()=>{if(aIt)return aIt;let t=await tYi(),e=Jzi(),r=new Bie(e);return e.forceSet(tr,r),aIt=qDt(e,t).then(n=>{if(n.copilotToken)return{token:n.copilotToken.token,refresh_in:n.copilotToken.envelope.refresh_in};throw new yi('Could not fetch testing Copilot token. Try running "npm run get_token" again?')}),aIt},"getEnvelope");async function tYi(){let{session:t}=R5t(process.env);if(t)return t;try{sIt??=(await Xzi.promises.readFile(Zzi)).toString().trim()}catch{sIt??=process.env.GITHUB_TOKEN??""}if(!sIt)throw new Error(`Tests: either GH_COPILOT_TOKEN, GITHUB_COPILOT_TOKEN, or GITHUB_TOKEN must be set, or there must be a GitHub token from an app with access to Copilot in ${Zzi}. Run "npm run get_token" to get one.`);return{...$y({}),accessToken:sIt,login:"copilot-client tests"}}a(tYi,"getTestingGitHubSession");var YFc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function KFc(t,e,r){return eYi(t),await t.get(Qt).primeToken(),["OK",null]}a(KFc,"handleTestingUseTestingTokenChecked");var rYi=Oe(YFc,KFc);p();var JFc=S.Object({});async function ZFc(t,e,r){return await new hEe().uninstall(t),["OK",null]}a(ZFc,"handleUninstallChecked");var nYi=Oe(JFc,ZFc);p();var XFc=jXn;function e8c(t,e,r){let n=t.get(hm),o={unregistered:[],notUnregistered:[]};return r.providers.forEach(s=>{try{n.unregisterContextProvider(s.id),o.unregistered.push(s.id)}catch{o.notUnregistered.push(s.id)}}),[o,null]}a(e8c,"unregisterContextProviders");var iYi=Oe(XFc,e8c);p();var oFr=de(require("os"));var t8c=S.Object({expectedCertificate:S.String()});async function r8c(t,e,r){let o=(await fot(t).getAllRootCAs()).map(T_e),s=T_e(r.expectedCertificate);return o.includes(s)?[{status:!0,message:"Certificate verified"},null]:[{status:!1,message:`expected certificate not found - Expected to find certificate ${r3r(s)}. Only found those installed on the system:${oFr.EOL}${o.map(c=>"- "+r3r(c)).join(oFr.EOL)}`},null]}a(r8c,"handleVerifyCertificateChecked");var oYi=Oe(t8c,r8c);p();var n8c=S.Object({});async function i8c(){return[{status:!!await new vFe().load()},null]}a(i8c,"handleVerifyKerberosChecked");var sYi=Oe(n8c,i8c);p();var o8c=S.Object({source:S.String(),version:S.Number(),uri:S.String()});async function s8c(t,e,r){let o=await t.get($r).getTextDocument(r);return o?o.getText()!==r.source?[{status:!1,message:`Source mismatch: [State] ${o.getText()} !== [Request] ${r.source}`},null]:o.version!==r.version?[{status:!1,message:`Version mismatch: [State] ${o.version} !== [Request] ${r.version}`},null]:[{status:!0,message:""},null]:[{status:!1,message:`Document not found: <${r.uri}>`},null]}a(s8c,"handleVerifyStateChecked");var aYi=Oe(o8c,s8c);p();var a8c=S.Object({});function c8c(t,e,r){return[t.get($r).getWorkspaceFolders().map(o=>{let s=new URL(o.uri),c=decodeURIComponent(s.pathname);return{...o,path:c}}),null]}a(c8c,"handleVerifyWorkspaceStateChecked");var cYi=Oe(a8c,c8c);p();p();var $_e=de(require("fs/promises")),lYi=de(require("os")),Xd=de(require("path"));var Np=new fe("GitWorktreeService"),l8c=20,G_e=class{constructor(e){this.ctx=e;this.gitInstances=new Cn(l8c)}static{a(this,"GitWorktreeService")}getGitInstance(e){let r=Xd.resolve(e),n=this.gitInstances.get(r);return n||(n=Gue(r),this.gitInstances.set(r,n)),n}generateTimestamp(){return new Date().toISOString().replace(/[:.]/g,"-").slice(0,19)}async runGitOperation(e,r,n,o){let s=Xd.resolve(e);Np.info(this.ctx,`[git] ${r} started for ${s}`);try{let c=await n(this.getGitInstance(s)),l=o?.(c);return Np.info(this.ctx,`[git] ${r} finished for ${s}${l?` (${l})`:""}`),c}catch(c){let l=c instanceof Error?c.message:String(c);throw Np.error(this.ctx,`[git] ${r} failed for ${s}: ${l}`),c}}async isGitRepository(e){try{return await this.runGitOperation(e,"checkIsRepo",r=>r.checkIsRepo(),r=>`isRepo=${r}`)}catch{return!1}}async getHeadCommit(e){return(await this.runGitOperation(e,"rev-parse HEAD",n=>n.raw(["rev-parse","HEAD"]),n=>`head=${n.trim()}`)).trim()}async commitWorktreeChanges(e,r,n){let o=await this.runGitOperation(e,"status",s=>s.status(),s=>`files=${s.files.length}`);return o.files.length===0?(Np.info(this.ctx,`Skipping checkpoint commit for ${Xd.resolve(e)} because there are no changes`),!1):(await this.runGitOperation(e,"add -A -- .",s=>s.raw(["add","-A","--","."])),await this.runGitOperation(e,`commit ${r}`,s=>s.commit(r)),Np.info(this.ctx,`Created ${n} commit for ${Xd.resolve(e)} with ${o.files.length} changed file(s)`),!0)}async snapshotCopiedChanges(e){Np.info(this.ctx,`Snapshotting copied changes in ${Xd.resolve(e)} to establish the apply baseline`),await this.commitWorktreeChanges(e,"chore: snapshot copied worktree changes","copied worktree changes");let r=await this.getHeadCommit(e);return Np.info(this.ctx,`Using copied-changes snapshot commit ${r} as the worktree baseCommit`),r}async applyPatchToRepository(e,r){let n=await $_e.mkdtemp(Xd.join(lYi.tmpdir(),"copilot-worktree-")),o=Xd.join(n,"changes.patch");try{Np.info(this.ctx,`Writing temporary patch for ${Xd.resolve(e)} to ${o} (${r.length} chars)`),await $_e.writeFile(o,r,"utf8"),await this.runGitOperation(e,`apply --check ${o}`,s=>s.raw(["apply","--check",o])),await this.runGitOperation(e,`apply ${o}`,s=>s.raw(["apply",o]))}finally{await $_e.rm(n,{recursive:!0,force:!0}),Np.info(this.ctx,`Removed temporary patch file ${o}`)}}async createWorktree(e){let{repositoryPath:r}=e;if(!await this.isGitRepository(r))throw new Error(`${r} is not a git repository`);let s=(await this.runGitOperation(r,"branch",g=>g.branch(),g=>`current=${g.current||"HEAD"}`)).current||"HEAD",c=await this.getHeadCommit(r),l=this.generateTimestamp(),u=`copilot/worktree-${l}`,d=`copilot-worktree-${l}`,f=Xd.basename(r),h=Xd.join(Xd.dirname(r),`${f}.worktrees`),m=Xd.join(h,d);return Np.info(this.ctx,`Preparing worktree creation for ${Xd.resolve(r)} with branch ${u}, baseBranch ${s}, baseCommit ${c}`),await this.runGitOperation(r,`worktree add -b ${u} ${m} ${s}`,g=>g.raw(["worktree","add","-b",u,m,s])),Np.info(this.ctx,`Created worktree ${m} from ${Xd.resolve(r)}`),{worktreePath:m,worktreeDirName:d,branchName:u,baseBranchName:s,baseCommit:c,repositoryPath:r}}async removeWorktree(e,r){Np.info(this.ctx,`Preparing to remove worktree ${e} from ${Xd.resolve(r)}`),await this.runGitOperation(r,`worktree remove --force ${e}`,n=>n.raw(["worktree","remove","--force",e])),Np.info(this.ctx,`Removed worktree ${e}`)}async getUncommittedChanges(e){if(!await this.isGitRepository(e))return Np.info(this.ctx,`Skipping status lookup for ${Xd.resolve(e)} because it is not a git repository`),[];let r=await this.runGitOperation(e,"status",n=>n.status(),n=>`files=${n.files.length}`);return[...new Set(r.files.map(n=>n.path))]}async applyWorktreeChanges(e,r,n){Np.info(this.ctx,`Applying worktree changes from ${Xd.resolve(e)} to ${Xd.resolve(r)} using baseCommit ${n}`);let o=await this.commitWorktreeChanges(e,"chore: checkpoint worktree changes","checkpoint worktree changes");Np.info(this.ctx,o?`Committed pending worktree changes in ${Xd.resolve(e)} before generating patch`:`No pending worktree changes to commit in ${Xd.resolve(e)}`);let s=await this.getHeadCommit(e);if(s===n)return Np.info(this.ctx,"No new commits to apply from worktree"),{baseCommit:s};let c=await this.runGitOperation(e,`diff --binary --full-index ${n}..${s}`,l=>l.raw(["diff","--binary","--full-index",`${n}..${s}`]),l=>`outputLength=${l.length}`);if(!c.trim())return Np.info(this.ctx,"No patch content to apply from worktree"),{baseCommit:s};try{await this.applyPatchToRepository(r,c)}catch(l){let u=l instanceof Error?l.message:String(l);throw new Error(`Failed to apply worktree patch: ${u}`)}return Np.info(this.ctx,`Applied worktree patch from ${n} to ${s}`),{baseCommit:s}}async stash(e){await this.runGitOperation(e,"stash push --include-untracked",r=>r.stash(["push","--include-untracked"])),Np.info(this.ctx,`Stashed changes in ${e}`)}async stashApply(e){await this.runGitOperation(e,"stash apply",r=>r.stash(["apply"])),Np.info(this.ctx,`Applied stash in ${e}`)}async stashPop(e){await this.runGitOperation(e,"stash pop",r=>r.stash(["pop"])),Np.info(this.ctx,`Popped stash in ${e}`)}};p();var uYi=de(ri());var x1=new fe("WorktreeService");var u8c=new uYi.ProtocolRequestType("worktree/requestUserDecision"),CFe=class{constructor(e,r){this.ctx=e;this.gitService=r}static{a(this,"WorktreeService")}async requestUserDecision(e){let r=await this.gitService.getUncommittedChanges(e);if(r.length===0)return x1.info(this.ctx,`No uncommitted changes found in ${e}, skipping user decision prompt`),"skip";x1.info(this.ctx,`Found ${r.length} uncommitted changes, requesting user decision`);let o=await this.ctx.get(ar).connection.sendRequest(u8c,{type:"uncommitted-changes",title:"Handle Uncommitted Changes",message:`You have ${r.length} uncommitted changes. How would you like to proceed?`,options:[{id:"copy",label:"Copy changes",description:"Copy uncommitted changes into the new worktree",recommended:!0},{id:"move",label:"Move changes",description:"Move uncommitted changes to the new worktree and clean the original"},{id:"skip",label:"Skip changes",description:"Create worktree from clean state, leave local changes untouched"},{id:"cancel",label:"Cancel",description:"Cancel worktree creation",destructive:!0}],defaultOption:"copy"});return o.cancelled?(x1.info(this.ctx,`User cancelled worktree creation for ${e}`),"cancel"):(x1.info(this.ctx,`User selected worktree migration strategy ${o.selectedOption} for ${e}`),o.selectedOption)}async createWorktree(e,r){x1.info(this.ctx,`Starting worktree creation for ${e} with strategy ${r}`);let n=r==="copy"||r==="move";n&&(x1.info(this.ctx,`Stashing original repository changes before worktree creation for ${e}`),await this.gitService.stash(e));let o;try{o=await this.gitService.createWorktree({repositoryPath:e})}catch(s){throw n&&(x1.warn(this.ctx,`Worktree creation failed for ${e}, restoring original stash`),await this.gitService.stashPop(e).catch(()=>{})),s}if(n)try{if(x1.info(this.ctx,`Migrating changes into worktree ${o.worktreePath} using strategy ${r}`),r==="copy"){await this.gitService.stashApply(o.worktreePath),await this.gitService.stashPop(e);let s=await this.gitService.snapshotCopiedChanges(o.worktreePath);o={...o,baseCommit:s},x1.info(this.ctx,`Updated worktree baseCommit to copied-changes snapshot ${s} for ${o.worktreePath}`)}else await this.gitService.stashPop(o.worktreePath);x1.info(this.ctx,`Finished migrating changes into worktree ${o.worktreePath}`)}catch(s){throw x1.warn(this.ctx,`Failed to migrate changes to worktree: ${s instanceof Error?s.message:String(s)}`),await this.gitService.stashPop(e).catch(()=>{}),s}return x1.info(this.ctx,`Completed worktree creation for ${e}; worktreePath=${o.worktreePath}, baseCommit=${o.baseCommit}`),o}async applyWorktreeChanges(e,r,n){x1.info(this.ctx,`Starting worktree apply from ${r} to ${e} with baseCommit ${n}`);let o=await this.gitService.applyWorktreeChanges(r,e,n);return x1.info(this.ctx,`Completed worktree apply from ${r} to ${e}; nextBaseCommit=${o.baseCommit}`),o}};var d8c="Failed to apply changes to the current workspace. Please stage or commit your changes in the current workspace and try again.",f8c=["already exists in working directory","patch does not apply","patch failed"];function p8c(t){let e=t instanceof Error?t.message:String(t);return e.includes("Failed to apply worktree patch:")&&f8c.some(n=>e.includes(n))?d8c:`Failed to apply worktree changes: ${e}`}a(p8c,"getWorktreeCompleteErrorMessage");var h8c=S.Object({repositoryPath:S.String()});async function m8c(t,e,r){try{let n=new G_e(t),o=new CFe(t,n),s=await o.requestUserDecision(r.repositoryPath);if(s==="cancel")return[{success:!1,error:"Worktree creation cancelled by user"},null];let c=await o.createWorktree(r.repositoryPath,s);return[{success:!0,worktreePath:c.worktreePath,worktreeDirName:c.worktreeDirName,branchName:c.branchName,baseBranchName:c.baseBranchName,baseCommit:c.baseCommit},null]}catch(n){let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:`Failed to create worktree: ${o}`}]}}a(m8c,"handleWorktreeCreateChecked");var dYi=Oe(h8c,m8c),g8c=S.Object({repositoryPath:S.String(),worktreePath:S.String(),baseCommit:S.String()});async function A8c(t,e,r){try{let n=new G_e(t);return[{success:!0,baseCommit:(await new CFe(t,n).applyWorktreeChanges(r.repositoryPath,r.worktreePath,r.baseCommit)).baseCommit},null]}catch(n){return[null,{code:Ze.InternalError,message:p8c(n)}]}}a(A8c,"handleWorktreeCompleteChecked");var fYi=Oe(g8c,A8c),y8c=S.Object({worktreePath:S.String(),repositoryPath:S.String()});async function E8c(t,e,r){try{return await new G_e(t).removeWorktree(r.worktreePath,r.repositoryPath),[{success:!0},null]}catch(n){let o=n instanceof Error?n.message:String(n);return[null,{code:Ze.InternalError,message:`Failed to delete worktree: ${o}`}]}}a(E8c,"handleWorktreeDeleteChecked");var pYi=Oe(y8c,E8c);var Fie=class{constructor(e){this.handlers=e}static{a(this,"MethodHandlers")}};function hYi(){let t=new Map;return t.set(X$i.method,eVi),t.set("getCompletions",U$i),t.set("getCompletionsCycling",Q$i),t.set("getDefaultFileSafetyRules",q$i),t.set("copilot/parseTerminalCommand",DVi),t.set("getPanelCompletions",G$i),t.set(g$i.method,A$i),t.set("getVersion",V$i),t.set("getUserInfo",$$i),t.set("setEditorInfo",JVi),t.set("checkStatus",IGi),t.set("checkQuota",TGi),t.set("checkFileStatus",bGi),t.set("claude/checkCliCompatibility",EGi),t.set("codex/checkCliCompatibility",CGi),t.set("signInInitiate",c3r),t.set("signIn",c3r),t.set("signInWithCodeFlow",sWi),t.set("signInWithDeviceFlow",lWi),t.set("signInConfirm",ZVi),t.set("signInWithGithubToken",uWi),t.set("signOut",dWi),t.set("auth/listAvailableTokens",Qqi),t.set("auth/useExistingToken",qqi),t.set("notifyShown",PVi),t.set("notifyAccepted",wVi),t.set("notifyRejected",kVi),t.set("notifyNextEditRejected",RVi),t.set("telemetry/exception",fWi),t.set("textDocument/copilotInlineEdit",xVi),t.set("testing/overrideExpFlags",Dzi),t.set("testing/alwaysAuth",A3r),t.set("testing/setAlwaysAuthed",A3r),t.set("testing/neverAuth",V3r),t.set("testing/setNeverAuthed",V3r),t.set("testing/useTestingToken",rYi),t.set("testing/setCompletionDocuments",O$i),t.set("testing/setPanelCompletionDocuments",h$i),t.set("testing/setNextEditDocument",CVi),t.set("testing/triggerShowMessageRequest",Ozi),t.set("testing/flushPromiseQueue",Izi),t.set("testing/getDocument",Rzi),t.set("testing/chatml",pWi),t.set("testing/setSyntheticTurns",Mzi),t.set("testing/fetch",Tzi),t.set("testing/setContentExclusionRules",Nzi),t.set("testing/getContext",wzi),t.set("uninstall",nYi),t.set("debug/diagnostics",w$i),t.set("debug/listCertificates",tVi),t.set("debug/verifyState",aYi),t.set("debug/verifyCertificate",oYi),t.set("debug/verifyKerberos",sYi),t.set("debug/verifyWorkspaceState",cYi),t.set("debug/getAgentDebugLog",k$i),t.set("debug/exportAgentDebugLog",R$i),t.set("context/registerProviders",WVi),t.set("context/unregisterProviders",iYi),t.set("conversation/preconditions",GGi),t.set("conversation/persistence",HGi),t.set("conversation/create",UGi),t.set("conversation/turn",zGi),t.set("conversation/turnDelete",YGi),t.set("conversation/destroy",QGi),t.set("conversation/compress",OGi),t.set("conversation/rating",$Gi),t.set("conversation/copyCode",NGi),t.set("conversation/insertCode",MGi),t.set("conversation/templates",WGi),t.set("conversation/modes",qGi),t.set("conversation/agents",DGi),t.set("conversation/registerTools",VGi),t.set("conversation/unregisterTools",KGi),t.set("conversation/updateToolsStatus",JGi),t.set("conversation/notifyCodeAcceptance",jGi),t.set("customAgent/registerExtensionAgents",E$i),t.set("customAgent/unregisterExtensionAgents",_$i),t.set("copilot/customAgent/list",y$i),t.set("copilot/customSkill/list",b$i),t.set("copilot/customPrompt/list",C$i),t.set("copilot/customInstruction/list",v$i),t.set("copilot/hook/list",J$i),t.set("copilot/models",c$i),t.set("copilot/models/getModelMetadataList",l$i),t.set("copilot/byok/saveModel",yGi),t.set("copilot/byok/deleteModel",Hqi),t.set("copilot/byok/listModels",mGi),t.set("copilot/byok/saveApiKey",gGi),t.set("copilot/byok/deleteApiKey",jqi),t.set("copilot/byok/listApiKeys",$qi),t.set("copilot/byok/saveCustomProviderConfig",AGi),t.set("copilot/byok/listCustomProviderConfigs",Vqi),t.set("copilot/setModelPolicy",u$i),t.set("copilot/codeReview/reviewChanges",XGi),t.set("copilot/codeReview/reviewSnippets",e$i),t.set("git/commitGenerate",W$i),t.set("thinking/generateTitle",ZGi),t.set("mcp/getTools",r$i),t.set("mcp/updateToolsStatus",n$i),t.set("mcp/readResource",i$i),t.set("mcp/registry/listServers",yVi),t.set("mcp/registry/getServer",EVi),t.set("mcp/registry/getAllowlist",vVi),t.set("mcp/getPrompt",o$i),t.set("mcp/completePrompt",s$i),t.set("mcp/serverAction",a$i),t.set("mcpGateway/listServers",aVi),t.set("mcpGateway/getServerDetails",cVi),t.set("mcpGateway/serverAction",lVi),t.set("mcpGateway/applyConfig",sVi),t.set("plugins/list",QVi),t.set("plugins/install",FVi),t.set("plugins/installFromSource",UVi),t.set("plugins/uninstall",$Vi),t.set("plugins/enable",BVi),t.set("plugins/disable",LVi),t.set("plugins/update",VVi),t.set("plugins/marketplace/add",qVi),t.set("plugins/marketplace/remove",GVi),t.set("plugins/marketplace/list",HVi),t.set("plugins/marketplace/browse",jVi),t.set("githubApi/searchPR",K$i),t.set("githubApi/cancelCodingAgent",wGi),t.set("cloudAgent/listSessions",PGi),t.set("cloudAgent/getSessionLogs",kGi),t.set("cloudAgent/createJob",RGi),t.set("cloudAgent/addPullRequestComment",xGi),t.set("githubApi/listPullRequestChangedFiles",z$i),t.set("worktree/create",dYi),t.set("worktree/complete",fYi),t.set("worktree/delete",pYi),t.set("backgroundAgent/create",Aqi),t.set("backgroundAgent/send",Bqi),t.set("backgroundAgent/truncateHistory",Uqi),t.set("backgroundAgent/destroy",yqi),t.set("backgroundAgent/listModels",Dqi),t.set("backgroundAgent/listSessions",Rqi),t.set("backgroundAgent/resume",Oqi),t.set("backgroundAgent/stop",Fqi),t.set("backgroundAgent/interaction",Iqi),t.set("backgroundAgent/enableRemote",Cqi),t.set("backgroundAgent/disableRemote",_qi),t.set("backgroundAgent/getRemoteStatus",Sqi),t.set("backgroundAgent/getPlanPath",bqi),t.set("backgroundAgent/compactHistory",hqi),new Fie(t)}a(hYi,"getAllMethods");p();p();p();var mYi=de(PP());var Ry=class{constructor(e){this.ctx=e}static{a(this,"AbstractNotification")}get type(){return new mYi.NotificationType(this.name)}};var _8c=new fe("BackgroundAgent.notifications"),sFr=class extends Ry{constructor(){super(...arguments);this.name="backgroundAgent/sessionUpdate";this.params=S.Object({sessionId:S.String(),event:S.Unknown()})}static{a(this,"BackgroundAgentSessionUpdateNotification")}handle(){}},aFr=class extends Ry{constructor(){super(...arguments);this.name="backgroundAgent/registerExternalTools";this.params=S.Object({sessionId:S.String(),externalToolDefinitions:B4r})}static{a(this,"BackgroundAgentRegisterExternalToolsNotification")}handle(r){_8c.info(this.ctx,"registerExternalTools received",{sessionId:r.sessionId,toolCount:r.externalToolDefinitions.length}),this.ctx.get(Hs).registerExternalTools(r.sessionId,r.externalToolDefinitions)}},gYi=[sFr,aFr];p();var cFr=class extends Ry{constructor(){super(...arguments);this.name="copilot/didChangeToken";this.params=S.Unknown()}static{a(this,"DidChangeTokenNotificationHandler")}handle(){this.ctx.get(Qt).resetToken("did_change_token_notification")}},AYi=[cFr];p();var v8c=new fe("agentCopilotTokenManager");function uFr(t){try{let e=new URL(t||"https://api.github.com");if(e.protocol==="https:"&&e.hostname.startsWith("api."))return`${e.origin}/`}catch{}}a(uFr,"tokenEndpointToApiUrl");function C8c(t,e){if(!e.tokenEndpoint)return $y(e);let r=uFr(e.tokenEndpoint);return r||v8c.warn(t,`Invalid token endpoint URL <${e.tokenEndpoint}>`),$y({apiUrl:r})}a(C8c,"getUrlsFromParams");var lFr=class extends Ry{constructor(){super(...arguments);this.name=jQt.method;this.params=hvn}static{a(this,"DidChangeAuthNotificationHandler")}handle(r){let n=this.ctx.get(Ur),o=C8c(this.ctx,r);this.ctx.get($m).setConfiguredUrls(this.ctx,o);let s=r.handle||r.login;s&&r?.accessToken?n.setTransientSession({accessToken:r.accessToken,login:s,githubAppId:r.githubAppId,...o}):n.setTransientSession({githubAppId:r.githubAppId,...o})}},yYi=[lFr];p();var dFr=class extends Ry{constructor(){super(...arguments);this.name=zQt.method;this.params=Cvn}static{a(this,"DidShowCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],s=this.ctx.get(Ru).get(n);s&&uni(this.ctx,s)}},fFr=class extends Ry{constructor(){super(...arguments);this.name=KQt.method;this.params=xvn}static{a(this,"DidShowInlineEditNotificationHandler")}async handle(r){let n=r.item.command.arguments[0];await this.ctx.get(Vv).handleShown(n)}},pFr=class extends Ry{constructor(){super(...arguments);this.name=YQt.method;this.params=bvn}static{a(this,"DidPartiallyAcceptCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],o=r.acceptedLength,s=this.ctx.get(Ru),c=s.get(n);c&&(o>=c.insertText.length?(s.delete(n),Pme(this.ctx,c)):qdt(this.ctx,c,o,void 0,void 0,"cumulative"))}},EYi=[dFr,fFr,pFr];p();var cIt=class extends Ry{constructor(){super(...arguments);this.name="window/workDoneProgress/cancel";this.params=S.Object({token:S.Union([S.String(),S.Number()])})}static{a(this,"WorkDoneProgressCancelNotification")}handle(r){this.ctx.get(wN).cancel(r.token)}};p();var hFr=class extends Ry{constructor(){super(...arguments);this.name="copilot/workspace/didChangeTrust";this.params=S.Object({items:S.Array(S.Object({folderUri:S.String(),trusted:S.Boolean()}))})}static{a(this,"WorkspaceDidChangeTrustNotificationHandler")}handle(r){let n=this.ctx.get(tp);for(let o of r.items)n.setTrust(o.folderUri,o.trusted)}},_Yi=[hFr];var b8c=[...gYi,...AYi,...yYi,...EYi,..._Yi,cIt];function vYi(t,e){for(let r of b8c){let n=new r(t),o=qu.Compile(n.params);e.onNotification(n.type,z0(t,async s=>{g9(s),o.Check(s)?await n.handle(s):$o.error(t,`Notification ${n.name}:`,new QA(o.Errors(s)))},`Notification ${n.name}`))}}a(vYi,"registerNotifications");p();var CYi=de(Xc());p();var V_e=de(Xc());var S8c=new V_e.ProtocolNotificationType("copilot/customAgent/didChange"),T8c=new V_e.ProtocolNotificationType("copilot/customSkill/didChange"),I8c=new V_e.ProtocolNotificationType("copilot/customPrompt/didChange"),x8c=new V_e.ProtocolNotificationType("copilot/customInstruction/didChange"),mFr=new V_e.ProtocolNotificationType("copilot/hook/didChange");function w8c(t){switch(t){case"agent":return S8c;case"skill":return T8c;case"prompt":return I8c;case"instructions":return x8c;case"hook":return mFr;default:return}}a(w8c,"notificationTypeFor");var lIt=class extends a0{constructor(r){super();this.ctx=r;this.logger=new fe("promptChangeNotifier")}static{a(this,"CLSPromptChangeNotifier")}async notify(r){let n=w8c(r);if(!n){this.logger.debug(this.ctx,`No notification type mapped for PromptsType '${r}'; skipping.`);return}try{await this.ctx.get(ar).connection.sendNotification(n,{})}catch(o){this.logger.debug(this.ctx,`Failed to send ${n.method}:`,o)}}};var R8c=new CYi.ProtocolNotificationType("copilot/plugins/didChange"),Uie=class{constructor(e,r){this.ctx=e;this.logger=new fe("pluginChangeNotifier");this.subscription=r.onDidChangePlugins(()=>{this.notify()})}static{a(this,"CLSPluginChangeNotifier")}async notify(){let e;try{e=this.ctx.get(ar).connection}catch(n){this.logger.debug(this.ctx,"Failed to resolve connection for copilot/plugins/didChange:",n);return}let r=await Promise.allSettled([e.sendNotification(R8c,{}),e.sendNotification(mFr,{})]);for(let n of r)n.status==="rejected"&&this.logger.debug(this.ctx,"Failed to send a plugin change notification:",n.reason)}dispose(){this.subscription.dispose()}};p();p();var bYi=de(require("crypto")),SYi=require("os");Mo();var k8c=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function P8c(t){let e=t.replace(/-/g,":").toLowerCase();return!k8c.has(e)}a(P8c,"validateMacAddress");function D8c(){let t=(0,SYi.networkInterfaces)();for(let e in t){let r=t[e];if(r){for(let{mac:n}of r)if(P8c(n))return n}}throw new Error("Unable to retrieve mac address (unexpected format)")}a(D8c,"getMac");var gFr;function N8c(){try{let t=D8c();return bYi.createHash("sha256").update(t,"utf8").digest("hex")}catch{return}}a(N8c,"getMacMachineId");function AFr(){return gFr||(gFr=N8c()||Mt()),gFr}a(AFr,"getMachineId");Mo();function yFr(t){let e=t??Mt()+Date.now();return new Ua(e,AFr(),AFr())}a(yFr,"createEditorSession");var TYi=yFr();p();var uIt=de(Xc());var EFr=new fe("AgentTextDocumentConfiguration"),_Fr=class{constructor(e){this.ctx=e;this.#e=new Wi;this.onDidChange=this.#e.event}static{a(this,"AgentTextDocumentsConfiguration")}#e;create(e,r,n,o){try{return NS.create(e,r,n,o)}catch(s){throw EFr.exception(this.ctx,s,".create"),s}}update(e,r,n){try{let o=[],s=NS.withChanges(e,r,n);for(let l of r)if(uIt.TextDocumentContentChangeEvent.isIncremental(l)){let u=e.offsetAt(l.range.start),d=e.offsetAt(l.range.end),f={start:e.positionAt(u),end:e.positionAt(d)};for(let m of["start","end"])if(f[m].line!==l.range[m].line||f[m].character!==l.range[m].character){let g=`invalid range ${m} position ${JSON.stringify(l.range[m])}. Assuming ${JSON.stringify(f[m])}.`;EFr.warn(this.ctx,`textDocument/didChange for ${e.uri} has ${g}`);let A=Wt.createAndMarkAsIssued({message:`Received ${g}`});Et(this.ctx,`invalidRange.${m}`,A)}let h={range:f,rangeOffset:u,rangeLength:d-u,text:l.text};o.push(h),e=e.applyEdits([{range:h.range,newText:h.text}])}else{let u=e.getText().length,f={range:{start:e.positionAt(0),end:e.positionAt(u)},rangeOffset:0,rangeLength:u,text:l.text};o.push(f),e=e.applyEdits([{range:f.range,newText:f.text}])}let c={document:{uri:e.uri,version:n},contentChanges:o};return this.#e.fire(c),s}catch(o){throw EFr.exception(this.ctx,o,".update"),o}}},WV=class extends $r{constructor(){super(...arguments);this.#e=new Wi;this.onDidOpenTextDocument=this.#e.event;this.#t=new Wi;this.onDidCloseTextDocument=this.#t.event;this.#r=new Wi;this.onDidFocusTextDocument=this.#r.event;this._textDocumentConfiguration=new _Fr(this.ctx);this.onDidChangeTextDocument=this._textDocumentConfiguration.onDidChange;this._documents=new Map;this._notebookDocuments=new uIt.NotebookDocuments(this._textDocumentConfiguration);this.workspaceFolders=[];this.#n=new Wi;this.onDidChangeWorkspaceFolders=this.#n.event}static{a(this,"AgentTextDocumentManager")}#e;#t;#r;#n;get connection(){return this.ctx.get(ar).connection}init(r){this.connection.onDidOpenTextDocument(o=>{let s=o.textDocument,c=this._textDocumentConfiguration.create(s.uri,s.languageId,s.version,s.text);this._documents.set(Fs(s.uri),c),this.#e.fire({document:{...s,uri:c.uri}})}),this.connection.onDidChangeTextDocument(o=>{let s=o.textDocument,c=o.contentChanges,{version:l}=s;if(l==null)throw new Error(`Received document change event for ${s.uri} without valid version identifier`);let u=Fs(s.uri),d=this._documents.get(u);d!==void 0&&(d=this._textDocumentConfiguration.update(d,c,l),this._documents.set(u,d))}),this.connection.onDidCloseTextDocument(o=>{let s=Fs(o.textDocument.uri);this._documents.delete(s),this.#t.fire({document:{uri:s}})}),this.connection.onNotification($Qt.type,o=>{let s=("textDocument"in o?o.textDocument:o)??{};this.#r.fire("uri"in s?{document:s}:{})}),this._notebookDocuments.listen(this.connection),this.workspaceFolders.length=0;let n=this.ctx.get(tp);for(let o of r){let s=o.trusted;typeof s=="boolean"&&n.setTrust(o.uri,s)}this.workspaceFolders.push(...r),r.length>0&&this.#n.fire({workspaceFolders:this.workspaceFolders,added:r,removed:[]})}didChangeWorkspaceFolders(r){r.added.forEach(n=>this.registerWorkspaceFolder(n)),r.removed.forEach(n=>this.unregisterWorkspaceFolder(n)),this.#n.fire({workspaceFolders:this.workspaceFolders,added:r.added,removed:r.removed})}unregisterWorkspaceFolder(r){let n=this.workspaceFolders.findIndex(o=>o.uri===r.uri);n>=0&&this.workspaceFolders.splice(n,1),this.ctx.get(tp).forget(r.uri)}registerWorkspaceFolder(r){let n=r.trusted;typeof n=="boolean"&&this.ctx.get(tp).setTrust(r.uri,n),!this.workspaceFolders.find(o=>o.uri===r.uri)&&this.workspaceFolders.push(r)}getTextDocumentsUnsafe(){return[...this._documents.values()]}getTextDocumentUnsafe(r){return this._documents.get(Fs(r.uri))}getWorkspaceFolders(){return this.workspaceFolders}findNotebook(r){let n=this._notebookDocuments.findNotebookDocumentForCell(r.uri);if(n)return{getCells:a(()=>n.cells.map((o,s)=>this.wrapCell(o,s)).filter(o=>!!o),"getCells"),getCellFor:a(({uri:o})=>{let s=n.cells.findIndex(c=>c.document===o);return s!==-1?this.wrapCell(n.cells[s],s):void 0},"getCellFor")}}wrapCell(r,n){let o=this._notebookDocuments.getCellTextDocument(r);if(o)return{kind:r.kind,metadata:r.metadata??{},index:n,document:o}}};var IYi=qu.Compile(Evn);function g9(t){if(t!==null){if(Array.isArray(t))for(let e=0;e{try{if(this.#r?.workspace?.configuration&&e&&typeof e=="object"&&!("settings"in e)){let n=await this.connection.workspace.getConfiguration(xYi.map(s=>({section:s}))),o={github:{copilot:n.shift()}};for(let s of cFe)o[s]=n.shift();e.settings=o}if(e&&typeof e=="object"&&"settings"in e)try{this.ctx.get(SO).handleConfigurationChange(e.settings)}catch(n){$o.exception(this.ctx,n,"EncodingConfigurationService.handleConfigurationChange")}return CTt(this.ctx,g9(e))}catch(r){$o.exception(this.ctx,r,"didChangeConfiguration")}},"handleDidChangeConfiguration");this.#n=this.ctx.get(qf)}static{a(this,"Service")}#e;#t;#r;#n;get clientCapabilities(){return this.#r}isWorkspaceTrustGateEnabled(){return this.#r?.experimental?.workspaceTrustGate===!0}listen(){let e=this.ctx,r=this.connection;r.onRequest(this.messageHandler.bind(this)),vYi(e,r);let n={name:"GitHub Copilot Language Server",version:e.get(ds).getDisplayVersion(),nodeVersion:process.versions.node};function o(c){try{e.get(WV).didChangeWorkspaceFolders(c)}catch(l){$o.exception(e,l,"didChangeWorkspaceFolders")}}a(o,"didChangeWorkspaceFolders"),this.connection.onNotification("vs/didAddWorkspaceFolder",({name:c,uri:l})=>o({added:[{uri:l,name:c??l}],removed:[]})),this.connection.onNotification("vs/didRemoveWorkspaceFolder",({name:c,uri:l})=>o({added:[],removed:[{uri:l,name:c??l}]})),r.onInitialize(c=>{if(this.initialized)throw new Error("initialize request sent after initialized notification");this.#r=c.capabilities,e.get(tp).setCapabilityEnabled(this.isWorkspaceTrustGateEnabled());let l=c.capabilities.copilot,u=g9(c.initializationOptions);if(u){if(!IYi.Check(u))throw new QA(IYi.Errors(u));let m=u,g=e.get(Ir);m.editorPluginInfo?g.setEditorAndPluginInfo({version:"unknown",...m.editorPluginInfo},m.editorInfo&&{version:"unknown",...m.editorInfo},m.relatedPluginInfo??[]):$o.warn(e,"editorInfo and editorPluginInfo will soon be required in initializationOptions. This will replace setEditorInfo."),m.copilotIntegrationId&&g.setCopilotIntegrationId(m.copilotIntegrationId),m.githubAppId&&(e.get(zp).githubAppId=m.githubAppId),m.copilotCapabilities&&(l=m.copilotCapabilities),m.sessionId&&e.forceSet(Ua,yFr(m.sessionId))}let d=c.capabilities.workspace?.workspaceFolders??!1;e.get(WV).init(c.workspaceFolders??[]),bXn(this.ctx),l&&(e.get(bn).setCapabilities(l),l.contentProvider&&la.registerSchemes(l.contentProvider),"openURL"in l&&jdt(e,["The openURL Copilot capability has been removed in favor of window/showDocument."]));let h=a(async()=>{this.initialized||(this.initialized=!0,$o.info(e,`${n.name} ${n.version} initialized`),e.get(Qt).primeToken().catch(m=>{e.get(ps).setErrorV2("auth",{message:`Failed while initializing: ${m}`,askToReSignin:!1,result:{status:"NotSignedIn"}})}),d&&r.workspace.onDidChangeWorkspaceFolders(o),c.capabilities.workspace?.didChangeConfiguration?.dynamicRegistration&&await r.client.register(TI.DidChangeConfigurationNotification.type,{section:xYi}),c.capabilities.workspace?.configuration?await this.handleDidChangeConfiguration({}):await Promise.race([this.ctx.get(rb).requireReady().then(()=>!0),new Promise(A=>setTimeout(()=>A(!1),200))])||vTt(e),!this.deactivated&&(this.activationEmitter.fire(),e.get(ps).sendInitNonAuthStatus(),new hEe().startup(e).catch(()=>{})))},"onInitialized");return r.onInitialized(z0(e,h,"onInitialized")),e.get(bN).init(),l?.token&&e.get(Ur).setTransientSession({}),l?.redirectedTelemetry&&qQi(e),wYi.lt(process.versions.node,"22.0.0")&&$o.warn(e,`Node.js ${process.versions.node} support is deprecated. Please upgrade to Node.js 22 or newer.`),{capabilities:{textDocumentSync:{openClose:!0,change:TI.TextDocumentSyncKind.Incremental},notebookDocumentSync:{notebookSelector:[{notebook:"*"}]},workspace:{workspaceFolders:{supported:d,changeNotifications:d}},executeCommandProvider:{commands:BQi(e,r)},inlineCompletionProvider:{}},serverInfo:n}}),r.onShutdown(async()=>{await(this.#e??=this.deactivate())}),r.onExit(()=>{this.onExit()}),r.onDidChangeConfiguration(c=>{this.handleDidChangeConfiguration(c)}),r.listen();let s=new E1t;this.ctx.forceSet(qf,s)}telemetryMethodFailure(e,r){let n=e.replaceAll("/",".");Vn(this.ctx,"lsp.method.failure",r,{method:n})}async messageHandler(e,r,n){let o=this.ctx.get(Fie).handlers.get(e);if(!o)return new TI.ResponseError(Ze.MethodNotFound,`Method not found: ${e}`);if(!this.initialized)return new TI.ResponseError(Ze.ServerNotInitialized,"Agent service not initialized.");if(this.#e)return new TI.ResponseError(Ze.InvalidRequest,"Agent service shut down.");if(e!=="setEditorInfo"&&!this.ctx.get(Ir).isEditorPluginInfoKnown())throw new TI.ResponseError(Ze.ServerNotInitialized,"editorInfo and editorPluginInfo not set in initializationOptions");Array.isArray(r)&&(r=r[0]),g9(r);try{let[s,c]=await o(this.ctx,n,r);return c?new TI.ResponseError(c.code,c.message,c.data):s}catch(s){if(n.isCancellationRequested)return new TI.ResponseError(Ze.RequestCancelled,"Request was canceled");if(s instanceof yi)return this.telemetryMethodFailure(e,s),new TI.ResponseError(Ze.NoCopilotToken,`Not authenticated: ${s.message}`);throw s instanceof TI.ResponseError||$o.exception(this.ctx,s,`Request ${e}`),this.telemetryMethodFailure(e,s),s}}async onExit(){return this.#t??=this.doExit()}async doExit(){try{this.ctx.get(GY).stop()}catch(e){$o.exception(this.ctx,e,"failed to stop perf monitor")}try{this.ctx.get(yF).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose ripgrep process manager")}try{this.ctx.get(g8).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose plugin contribution injector")}try{this.ctx.get(Uie).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose plugin change notifier")}try{this.ctx.get(iie).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose MCP project cleanup subscription")}try{this.ctx.get(ey).dispose().catch(e=>{$o.exception(this.ctx,e,"failed to dispose MCP server manager")})}catch(e){$o.exception(this.ctx,e,"failed to dispose MCP server manager")}try{this.ctx.get(TH).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose MCP gateway service")}try{this.ctx.get(t2).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose workspace chunk search service")}try{this.ctx.get(y8).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose Claude Code agent service")}try{this.ctx.get(uc).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose agent plugin service")}this.ctx.get(Hs).shutdown().catch(e=>{$o.exception(this.ctx,e,"failed to shutdown background agent service")});try{this.ctx.get(ug).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose prompt service")}this.ctx.forceSet(qf,this.#n),await(this.#e??=this.deactivate())}markDeactivated(){this.deactivated||(this.deactivated=!0,this.deactivationEmitter.fire(),this.ctx.get(rb).markReady())}async deactivate(){let e=this.ctx;this.markDeactivated(),Ihr(e),await Promise.race([new Promise(r=>setTimeout(r,100).unref()),e.get(xd).flush()]),await Promise.race([new Promise(r=>setTimeout(r,1800).unref()),e.get(X0).deactivate()])}dispose(){this.markDeactivated(),this.connection.dispose()}},$o=new fe("lsp");var zv=class{constructor(e,r,n){this.ctx=e;this.skillId=r;this.requestType=new RYi.ProtocolRequestType("conversation/context");this.typeCheck=qu.Compile(n)}static{a(this,"AgentSkillResolver")}async resolveSkill(e){let r=this.ctx.get(ar).connection,n={conversationId:e.conversation.id,turnId:e.turn.id,skillId:this.skillId},o;try{let s=await r.sendRequest(this.requestType,n),[c,l]=s;if(l){let u=new kYi.ResponseError(l.code,l.message,l.data);ot.error(this.ctx,`ResponseError while resolving skill ${this.skillId}`,u);return}o=c}catch(s){ot.error(this.ctx,`Error while resolving skill ${this.skillId}`,s);return}if(o!=null){if(!this.typeCheck.Check(o))throw new QA(this.typeCheck.Errors(o));return o}}};var vFr=class{constructor(e,r,n="",o="",s=[],c=[]){this.progressToken=e;this.chunks=r;this.followUp=n;this.suggestedTitle=o;this.skills=s;this.references=c}static{a(this,"SyntheticTurn")}},F9=class{constructor(){this.turns=[]}static{a(this,"SyntheticTurns")}add(e,r,n="",o="",s=[],c=[]){let l=new vFr(e,r,n,o,s,c);return this.turns.push(l),l}get(e){return this.turns.find(r=>r.progressToken===e)}},dIt=class{constructor(e,r){this.turnContext=e;this.syntheticTurn=r;this.conversationProgress=e.ctx.get(Tc)}static{a(this,"SyntheticTurnProcessor")}async process(e,r){try{await this.processWithSyntheticTurns(this.syntheticTurn,e,r)}catch(n){ot.error(this.turnContext.ctx,`Error processing turn ${this.turnContext.turn.id}`,n);let o=n.message;this.turnContext.turn.status="error",this.turnContext.turn.response={message:o,type:"meta"},await this.conversationProgress.end(this.turnContext.conversation,this.turnContext.turn,{error:{message:o,responseIsIncomplete:!0}})}}async processWithSyntheticTurns(e,r,n){await this.conversationProgress.begin(this.turnContext.conversation,this.turnContext.turn,r),await this.resolveSyntheticSkill(e,n),await this.processSyntheticChunks(e,n),await this.endSyntheticProgress(e,n),this.turnContext.turn.response={type:"model",message:e.chunks.join("")},this.turnContext.turn.status=n.isCancellationRequested?"cancelled":"success"}async resolveSyntheticSkill(e,r){let n=this.turnContext.ctx.get(zo).getCapabilities(this.turnContext.conversation.id),o=e.skills.filter(s=>n.skills.includes(s));for(let s of o){let l=await new zv(this.turnContext.ctx,s,S.Object({value:S.String()})).resolveSkill(this.turnContext);l&&!r.isCancellationRequested&&await this.conversationProgress.report(this.turnContext.conversation,this.turnContext.turn,{reply:l.value})}}async processSyntheticChunks(e,r){for(let n of e.chunks)r.isCancellationRequested||(await this.conversationProgress.report(this.turnContext.conversation,this.turnContext.turn,{reply:n}),await bC(1))}async endSyntheticProgress(e,r){r.isCancellationRequested?await this.conversationProgress.cancel(this.turnContext.conversation,this.turnContext.turn):await this.conversationProgress.end(this.turnContext.conversation,this.turnContext.turn,{followUp:{message:e.followUp,type:"followup",id:Mt()},suggestedTitle:e.suggestedTitle,updatedDocuments:this.turnContext.conversation.source==="inline"?[{uri:"fakeUpdatedDoc.ts",text:"fake"}]:void 0})}};var RN=class{static{a(this,"TurnProcessorFactory")}async createProcessor(e,r,n){let o=e.ctx.get(F9).get(r);if(o)return new dIt(e,o);let c=(await ew(e.ctx)).find(u=>u.slug===e.turn.agent?.agentSlug);if(c?.turnProcessor)return c.turnProcessor(e);let l;return e.conversation.source==="inline"?l=new fJe(e.ctx):l=new yue(e.ctx),n!==void 0&&(l.computeSuggestions=n),e.turn.chatMode?.kind==="Agent"||e.turn.chatMode?.kind==="InlineAgent"?new WRe(e,l):e.turn.chatMode?.kind==="Ask"&&e.conversation.source!=="inline"?new WRe(e,l):new Prt(e,l)}};p();var zV=class extends F_{constructor(r){super(r);this.connection=null;this.capabilities={readTextFile:!1,writeTextFile:!1};this.currentSessionId=null}static{a(this,"ACPClientToolInvoker")}setACPContext(r,n,o){this.connection=r,this.capabilities=n,this.currentSessionId=o}clearACPContext(){this.currentSessionId=null}async invokeClientTool(r,n){if(!this.connection||!this.currentSessionId)return this.errorResult("ACP connection not available for tool invocation");switch(n.name){case"create_file":return this.handleCreateFile(n.input,n.toolCallId);case"insert_edit_into_file":return this.handleEditFile(n.input,n.toolCallId);default:return this.errorResult(`Tool ${n.name} is not supported in ACP mode`)}}async handleCreateFile(r,n){if(!this.capabilities.writeTextFile)return this.errorResult("Client does not support file writing");if(!r?.filePath||r.content===void 0)return this.errorResult("create_file requires filePath and content");try{let o=r.content;return await this.connection.writeTextFile({sessionId:this.currentSessionId,path:r.filePath,content:o}),await this.sendDiffUpdate(n,r.filePath,null,o),this.successResult(`Successfully created file: ${r.filePath}`)}catch(o){return this.errorResult(`Failed to create file ${r.filePath}: ${String(o)}`)}}async handleEditFile(r,n){if(!this.capabilities.writeTextFile)return this.errorResult("Client does not support file writing");if(!r?.filePath||r.code===void 0)return this.errorResult("insert_edit_into_file requires filePath and code");try{let o=null;if(this.capabilities.readTextFile)try{o=(await this.connection.readTextFile({sessionId:this.currentSessionId,path:r.filePath})).content}catch{}let s=r.code.replace(/\r\n/g,` -`);return await this.connection.writeTextFile({sessionId:this.currentSessionId,path:r.filePath,content:s}),await this.sendDiffUpdate(n,r.filePath,o,s),this.successResult(`Successfully edited file: ${r.filePath}`)}catch(o){return this.errorResult(`Failed to edit file ${r.filePath}: ${String(o)}`)}}async sendDiffUpdate(r,n,o,s){await this.connection.sessionUpdate({sessionId:this.currentSessionId,update:{sessionUpdate:"tool_call_update",toolCallId:r,content:[{type:"diff",path:n,oldText:o,newText:s}]}})}successResult(r){return new Lr([new Rr(r)],"success")}errorResult(r){return new Lr([new Rr(r)],"error")}};p();function M8c(t){switch(t){case"read_file":case"list_dir":case"get_errors":return"read";case"insert_edit_into_file":case"create_file":case"replace_string_in_file":return"edit";case"semantic_search":case"file_search":case"grep_search":return"search";case"run_in_terminal":case"run_subagent":return"execute";case"update_user_preferences":case"validate_cves":default:return"other"}}a(M8c,"mapToolNameToKind");function O8c(t,e){if(!e)return;let r=[];switch(t){case"read_file":case"insert_edit_into_file":case"create_file":case"replace_string_in_file":{let n=e.filePath;if(n){let o=e.startLine;r.push({path:n,line:o??void 0})}break}case"list_dir":{let n=e.path;n&&r.push({path:n});break}case"get_errors":{let n=e.filePaths;if(n&&Array.isArray(n))for(let o of n)r.push({path:o});break}}return r.length>0?r:void 0}a(O8c,"extractLocationsFromInput");function L8c(t){switch(t){case"not started":return"pending";case"running":return"in_progress";case"completed":return"completed";case"error":case"cancelled":return"failed";default:return"pending"}}a(L8c,"mapToolCallStatus");var fIt=class{constructor(e,r){this.connection=e;this.sessionId=r;this.activeToolCalls=new Map;this.messageChunkBuffer=""}static{a(this,"ACPProgressReporter")}async begin(e,r,n,o){}async report(e,r,n,o){if(o.reply&&await this.reportTextChunk(o.reply),o.editAgentRounds){for(let s of o.editAgentRounds)if(s.reply&&await this.reportTextChunk(s.reply),s.toolCalls)for(let c of s.toolCalls){let l=L8c(c.status),u=!this.activeToolCalls.has(c.id);if(u&&(c.status==="running"||c.status==="not started")){let d=O8c(c.name,c.input);await this.reportToolCallStart(c.id,c.name,M8c(c.name),l,c.input,d)}else c.status==="completed"?await this.reportToolCallComplete(c.id):c.status==="error"?await this.reportToolCallError(c.id,c.error||"Unknown error"):c.status==="cancelled"?await this.reportToolCallCancelled(c.id):u||await this.reportToolCallProgress(c.id,l)}}}async end(e,r,n,o){if(o?.error&&await this.reportTextChunk(` +`;var yFr=["authorization_code","refresh_token"],W_e=33428,KTt=class{constructor(e,r){this._logger=new pe("LoopbackAuthServer");this.nonce=(0,rYi.randomBytes)(16).toString("hex");if(!e)throw new Error("startingRedirect must be defined");this._startingRedirect=new URL(e),this._ctx=r;let n;this._resultPromise=new Promise((s,c)=>n={resolve:s,reject:c}),this._responseSentPromise=new Promise(s=>{this._resolveResponseSent=s});let o=`&app_name=${encodeURIComponent("GitHub Copilot")}`;this._server=nYi.createServer((s,c)=>{let l=new URL(s.url,`http://${s.headers.host}`);switch(l.pathname){case"/signin":{let u=(l.searchParams.get("nonce")??"").replace(/ /g,"+");if(u!==this.nonce){let d=new yi("Nonce does not match.");this._logger.warn(this._ctx,"Nonce mismatch in /signin request",{receivedNonce:u,expectedNonce:this.nonce}),tMe(this._ctx,d,"/signin"),c.writeHead(302,{location:`/?error=${encodeURIComponent("Nonce does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(d);return}this._startingRedirect.searchParams.set("redirect_uri",`http://127.0.0.1:${this.port}/callback`),this._logger.info(this._ctx,"Redirecting to auth server"),c.writeHead(302,{location:this._startingRedirect.toString()}),c.end();break}case"/callback":{let u=l.search||"",d=/[?&]code=([^&]+)/.exec(u),f=/[?&]state=([^&]+)/.exec(u),h=d&&d.length>1?decodeURIComponent(d[1]):void 0,m=f&&f.length>1?decodeURIComponent(f[1]):void 0,g=new URL(m||"").searchParams.get("nonce")??void 0;if(!h||!m||!g){let A="Missing required parameters, at least one from code, state, nonce is needed.",y=new yi(A);this._logger.warn(this._ctx,"OAuth callback missing required parameters",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url}),tMe(this._ctx,y,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent(A)}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(y);return}if(this.state!==m){let A=new yi("State does not match.");this._logger.warn(this._ctx,"OAuth callback state mismatch",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url,receivedState:m,expectedState:this.state}),tMe(this._ctx,A,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent("State does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(A);return}if(this.nonce!==g){let A=new yi("Nonce does not match.");this._logger.warn(this._ctx,"OAuth callback nonce mismatch",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url,receivedNonce:g,expectedNonce:this.nonce}),tMe(this._ctx,A,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent("Nonce does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(A);return}this._logger.info(this._ctx,"OAuth callback validation successful"),n.resolve({code:h,state:m}),c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(AFr,()=>this._resolveResponseSent());break}default:c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(AFr)}})}static{a(this,"LoopbackAuthServer")}get redirectUri(){if(this.port===void 0)throw new Error("Server is not started yet");return`http://127.0.0.1:${this.port}/callback`}set state(e){e?this._startingRedirect.searchParams.set("state",e):this._startingRedirect.searchParams.delete("state")}get state(){return this._startingRedirect.searchParams.get("state")??void 0}start(){return new Promise((e,r)=>{if(this._server.listening)throw new Error("Server is already started");let n=setTimeout(()=>{r(new Error("Timeout waiting for port"))},5e3);this._server.on("listening",()=>{let o=this._server.address();if(typeof o=="string")this.port=parseInt(o);else if(o instanceof Object)this.port=o.port;else throw new Error("Unable to determine port");clearTimeout(n),this.state=`http://127.0.0.1:${this.port}/callback?nonce=${this.nonce}`,this._logger.info(this._ctx,"OAuth server started and state configured",{port:this.port,redirectUri:this.redirectUri}),e(this.port)}),this._server.on("error",o=>{if(o.code==="EADDRINUSE"){console.warn(`Port ${W_e} is in use, retrying with a random port...`),this._server.listen(0,"127.0.0.1");return}clearTimeout(n),r(new Error(`Error listening to server: ${o.message}`))}),this._server.on("close",()=>{clearTimeout(n),r(new Error("Server closed unexpectedly"))}),this._server.listen(W_e,"127.0.0.1")})}stop(){return new Promise((e,r)=>{if(!this._server.listening){e();return}let n,o=a(()=>{n&&(clearTimeout(n),n=void 0)},"cleanup");n=setTimeout(()=>{o(),r(new Error("Timeout waiting for server to close"))},5e3),this._server.close(s=>{o(),s?r(s):e()}),this._server.closeAllConnections()})}waitForOAuthResponse(){return this._resultPromise}waitForResponseSent(){return this._responseSentPromise}};p();var JTt=require("crypto");var MFe=class{static{a(this,"PKCEUtils")}static generateCodeVerifier(){let e=this.generateRandomBytes(32);return this.base64UrlEncode(e)}static generateCodeChallenge(e){let r=(0,JTt.createHash)("sha256");r.update(e,"ascii");let n=r.digest();return this.base64UrlEncode(n)}static getCodeChallengeMethod(){return"S256"}static generateRandomBytes(e){return(0,JTt.randomBytes)(e)}static base64UrlEncode(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static getSupportedMethods(){return[this.getCodeChallengeMethod()]}static isServerSupported(e){if(!e||e.length===0)return!1;let r=this.getSupportedMethods();return e.some(n=>r.includes(n))}static createPKCEParameters(){let e=this.generateCodeVerifier(),r=this.generateCodeChallenge(e),n=this.getCodeChallengeMethod();return{codeVerifier:e,codeChallenge:r,codeChallengeMethod:n}}};var W3c="Timed out",iYi="Sign-in request was cancelled",EFr=class{static{a(this,"CodeFlow")}},z_e=class extends EFr{static{a(this,"CLSCodeFlow")}constructor(e){super(),this.ctx=e}async auth(e,r,n,o,s,c){let{clientId:l,clientSecret:u}=e,d=o?.resource,f=MFe.isServerSupported(n.code_challenge_methods_supported),h=f?MFe.createPKCEParameters():void 0;f?Nr.info(this.ctx,`PKCE supported by server with methods: [${n.code_challenge_methods_supported?.join(", ")}], using ${h.codeChallengeMethod}`):Nr.info(this.ctx,"PKCE not supported by server, falling back to standard OAuth flow");let m=this.buildAuthorizationParams({clientId:l,scope:r.join(" "),pkceParams:h,resource:d,...s??{}}),g=new URLSearchParams(m),A=n.authorization_endpoint+"?"+g.toString(),y=new KTt(A,this.ctx),_=`http://127.0.0.1:${await y.start()}/signin?nonce=${encodeURIComponent(y.nonce)}`;Nr.info(this.ctx,"Auth URL created and opening browser for sign-in"),await new V_e(this.ctx).open(_);let v,b=[];try{let w=[y.waitForOAuthResponse(),new Promise((x,P)=>{let D=setTimeout(()=>P(new Error(W3c)),3e5);b.push({dispose:a(()=>clearTimeout(D),"dispose")})})];if(c){let x=c;w.push(new Promise((P,D)=>{if(x.isCancellationRequested){Nr.info(this.ctx,"OAuth flow cancelled (already requested)"),D(new Error(iYi));return}let N=x.onCancellationRequested(()=>{Nr.info(this.ctx,"OAuth flow cancelled"),D(new Error(iYi))});b.push(N)}))}v=(await Promise.race(w)).code,Nr.info(this.ctx,"OAuth response received successfully")}catch(w){throw Nr.error(this.ctx,"OAuth flow error",w),w}finally{for(let x of b)x.dispose();let w,R=new Promise(x=>w=setTimeout(x,5e3));await Promise.race([y.waitForResponseSent().finally(()=>clearTimeout(w)),R]).catch(()=>{}),await y.stop().catch(x=>{Nr.warn(this.ctx,"Failed to stop loopback auth server",x)})}return await this.exchangeCodeForToken({endpointUri:n.token_endpoint,redirectUri:y.redirectUri,code:v,clientId:l,clientSecret:u,codeVerifier:h?.codeVerifier,resource:d})}async exchangeCodeForToken({endpointUri:e,redirectUri:r,code:n,clientId:o,clientSecret:s,codeVerifier:c,resource:l}){let u=[["grant_type","authorization_code"],["code",n],["client_id",o],["redirect_uri",r]];s&&u.push(["client_secret",s]),c&&u.push(["code_verifier",c]),l&&u.push(["resource",l]);let d=new URLSearchParams(u);Nr.info(this.ctx,"Exchanging authorization code for token",{endpointUri:e,clientId:o,redirectUri:r});let f=await VX(this.ctx,e,"POST",{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},d.toString());if(f.ok){let h=await f.json();return Nr.info(this.ctx,"Token exchange successful"),h}else{let h=await f.text(),m=new Error(h);throw m.name="Token Exchange Error",m}}buildAuthorizationParams({clientId:e,scope:r,pkceParams:n,resource:o,...s}){let c=[["client_id",e],["response_type","code"],["scope",r]];n&&c.push(["code_challenge",n.codeChallenge],["code_challenge_method",n.codeChallengeMethod]),o&&c.push(["resource",o]);for(let[l,u]of Object.entries(s??{}))u!==void 0&&c.push([l,String(u)]);return c}};var QN=class t{constructor(e,r,n,o){this.id=t.providerId;this.label="GitHub";this.supportsMultipleAccounts=!1;this.authorizationServers=[t.providerId];this.ctx=e,this.serverMetadata=n,this.resourceMetadata=o,this._sessionsPromise=this.readSessions().then(s=>(setTimeout(()=>s.forEach(c=>{this.afterSessionLoad(c)}),1e3),s))}static{a(this,"GitHubAuthenticationProvider")}static{this.providerId="https://github.com/login/oauth"}async getSessions(e,r){await this.checkSessionsExpiration();let n=await this._sessionsPromise,o=e?.sort()||[];return o.length?n.filter(c=>gFr([...c.scopes].sort(),o)):n}async afterSessionLoad(e){}async readSessions(){let e=await this.ctx.get(ti).read("oauth",this.id);return e||[]}async createSession(e,r){let n=[...e].sort(),o=await this._sessionsPromise,s=this.ctx.get(Jp),c=s.findAppIdToAuthenticate(),l=s.findAppSecretToAuthenticate(),u=Xzi(r.provider)?r.provider:void 0,d=typeof r.loginHint=="string"?r.loginHint:void 0,f=d?{login:d,provider:u}:{prompt:"select_account",provider:u},h=await new z_e(this.ctx).auth({clientId:c,clientSecret:l},n,this.serverMetadata,this.resourceMetadata,f,r.cancellationToken),m=await this.tokenToSession(h.access_token,e);this.afterSessionLoad(m);let g=o.findIndex(y=>y.account.id===m.account.id&&gFr([...y.scopes].sort(),n)),A=new Array;return g>-1?A.push(...o.splice(g,1,m)):o.push(m),await this.storeSessions(o),m}async storeSessions(e){this._sessionsPromise=Promise.resolve(e),await this.ctx.get(ti).update("oauth",this.id,e)}async tokenToSession(e,r){let n=await this.getUserInfo(e);return{id:crypto.getRandomValues(new Uint32Array(2)).reduce((o,s)=>o+=s.toString(16),""),accessToken:e,account:{label:n.accountName,id:n.id},scopes:r}}buildGetUserInfoUrl(){try{let e=new URL(this.serverMetadata?.issuer);return e.hostname.toLowerCase()==="github.com"?"https://api.github.com/user":`${e.origin.replace(/\/+$/,"")}/api/v3/user`}catch{return"https://api.github.com/user"}}async getUserInfo(e){let r=this.buildGetUserInfoUrl(),n;try{n=await this.ctx.get(nr).fetch(new URL(r).href,{method:"GET",headers:{Authorization:`token ${e}`}})}catch(o){return YTt.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}if(n.ok)try{let o=await n.json();return{id:`${o.id}`,accountName:o.login}}catch(o){return YTt.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}else{let o=n.statusText;try{let s=await n.json();s.message&&(o=s.message)}catch{}return YTt.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}}async removeSession(e){let r=await this._sessionsPromise,n=r.findIndex(o=>o.id===e);if(n>-1)r.splice(n,1),await this.storeSessions(r);else throw new Error(`No session with id '${e}' found.`)}async checkSessionsExpiration(){let e=await this._sessionsPromise;if(e.length!==0)for(let r of e)await this.isSessionExpired(r)&&await this.removeSession(r.id)}async isSessionExpired(e){let{accessToken:r}=e,{id:n,accountName:o}=await this.getUserInfo(r);return!n||!o}};var z3c=S.Object({scopes:S.Optional(S.Array(S.String({minLength:1}),{minItems:1})),authServer:S.Optional(S.String({minLength:1})),socialProvider:WTt,loginHint:S.Optional(S.String({minLength:1}))});async function Y3c(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Xe.RequestCancelled,message:"Sign-in request was cancelled"}];let n=t.get(Mr),{status:o,user:s,sourceEnvVar:c}=await n.checkAndUpdateStatus({authAuthority:r.authServer});if(o==="OK")return[{status:o,user:s},null];if(c)return[null,{code:Xe.AuthEnvVarConflict,message:B7e(c)}];let l=await zTt(t,(u,d)=>new QN(u,QN.providerId,d,void 0),{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider,loginHint:r.loginHint},e);if(!["OK","MaybeOK"].includes(l.status))throw new yi("OAuth authentication failed for unknown reasons. Please try again later.");return[l,null]}catch(n){if(n instanceof YU)return[null,{code:Xe.NoBrowserAvailable,message:n.message}];if(!(n instanceof yi))throw n;return[null,{code:Xe.CodeFlowFailed,message:n.message}]}}a(Y3c,"handleSignInWithCodeFlowChecked");var oYi=xe(z3c,Y3c);p();p();p();var G9=class extends Error{static{a(this,"OperationCancelledError")}constructor(e="Operation was cancelled"){super(e),this.name="OperationCancelledError"}},OFe=class extends Error{static{a(this,"OperationTimeoutError")}constructor(e="Operation timed out"){super(e),this.name="OperationTimeoutError"}};function sYi(t,e,r){return e.isCancellationRequested?Promise.reject(new G9):new Promise((n,o)=>{let s=!1,c=e.onCancellationRequested(()=>{s||(s=!0,clearTimeout(l),c.dispose(),o(new G9))}),l=setTimeout(()=>{s||(s=!0,c.dispose(),o(new OFe))},r);t.then(u=>{s||(s=!0,clearTimeout(l),c.dispose(),n(u))},u=>{s||(s=!0,clearTimeout(l),c.dispose(),o(u instanceof Error?u:new Error(String(u))))})})}a(sYi,"raceWithCancellationAndTimeout");var K3c=["repo","workflow"];async function J3c(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...zy(t)},json:{client_id:e,scope:n.join(" ")},timeout:3e4},s=new URL("login/device/code",r).href,c;try{c=await t.get(nr).fetch(s,o)}catch(l){throw l instanceof Error&&ax(l)?new yi(`Could not log in with device flow on ${r}: ${l.message}`):l}if(!c.ok)throw new yi(`Could not log in with device flow on ${r}: HTTP ${c.status}`);return await c.json()}a(J3c,"requestDeviceCode");async function Z3c(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...zy(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s;try{s=await t.get(nr).fetch(new URL("login/oauth/access_token",n).href,o)}catch(l){throw l instanceof Error&&ax(l)?new yi(`Device flow token request failed on ${n}: ${l.message}`):l}let c=await s.json();if(c.access_token||c.error==="authorization_pending"||c.error==="slow_down")return c;throw c.error&&c.error_description?new yi(c.error_description):new yi(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(Z3c,"requestAccessToken");async function X3c(t,e){let n=await(await Bd(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new yi(`Error retrieving user information: ${String(n.errors)}`);return n}a(X3c,"requestUserInfo");async function eFc(t,e,r){let n=r?.githubAppId??t.get(Jp).findAppIdToAuthenticate(),o=r?.scopes??K3c,{serverUrl:s,apiUrl:c,authAuthority:l}=KU(t,r?.authAuthority),u=await J3c(t,n,s,o),d=(async()=>{let f=Date.now()+u.expires_in*1e3,h=u.interval,m;do{if(await new Promise(A=>setTimeout(A,1e3*h)),e.isCancellationRequested)throw new G9("Sign-in request was cancelled");m=await Z3c(t,u.device_code,n,s);let g=m.access_token;if(g){let A=await X3c(t,{apiUrl:c,accessToken:g});if(e.isCancellationRequested)throw new G9("Sign-in request was cancelled");let y=m.scope?m.scope.split(" ").filter(E=>E.length>0):o;return{authAuthority:l,githubAppId:n,username:A.login,accessToken:g,scopes:y}}h=m.interval??h}while(Date.now()performance.now()-n,"getElapsedTimeMs");try{let s=t.get(Mr),{status:c,user:l,sourceEnvVar:u}=await s.checkAndUpdateStatus({authAuthority:r.authServer});if(c==="OK")return[{status:c,user:l},null];if(u)return[null,{code:Xe.AuthEnvVarConflict,message:B7e(u)}];Gme(t,"deviceFlow");let d=t.get(qie),f=await d.initiate(e,{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider});await t.get(Xt).connection.sendNotification(nFc,{userCode:f.userCode,verificationUri:f.verificationUri,expiresIn:f.expiresIn});let h=await sYi(f.waitForAuth,e,iFc),m=await d.save(h);return iD(t,"deviceFlow",m.status,o()),[m,null]}catch(s){if(s instanceof G9)return[null,{code:Xe.RequestCancelled,message:"Sign-in request was cancelled"}];if(s instanceof OFe)return iD(t,"deviceFlow","NotSignedIn",o(),s),[null,{code:Xe.DeviceFlowFailed,message:"Sign-in request timed out"}];if(iD(t,"deviceFlow","NotSignedIn",o(),s),!(s instanceof yi))throw s;return[null,{code:Xe.DeviceFlowFailed,message:s.message}]}}a(oFc,"handleSignInWithDeviceFlowChecked");var cYi=xe(rFc,oFc);p();var sFc=S.Object({githubToken:S.String({minLength:1}),user:S.String({minLength:1}),githubAppId:S.Optional(S.String({minLength:1}))});async function aFc(t,e,r){let n=r.githubToken,o=r.user,s=r.githubAppId,c=t.get(Mr);return[await t.get(WT).save({...c.getConfiguredUrls(),accessToken:n,login:o,githubAppId:s}),null]}a(aFc,"handleSignInWithGithubTokenChecked");var lYi=xe(sFc,aFc);p();var cFc=S.Object({options:S.Optional(S.Object({}))});async function lFc(t,e,r){return[await t.get(Mr).signOutEditor(),null]}a(lFc,"handleSignOutChecked");var uYi=xe(cFc,lFc);p();var uFc=S.Object({transaction:S.Optional(S.String()),stacktrace:S.Optional(S.String()),properties:S.Optional(S.Record(S.String(),S.String())),platform:S.Optional(S.String()),exception_detail:S.Optional(S.Array(S.Object({type:S.Optional(S.String()),value:S.Optional(S.String()),stacktrace:S.Optional(S.Array(S.Object({filename:S.Optional(S.String()),lineno:S.Optional(S.Union([S.String(),S.Integer()])),colno:S.Optional(S.Union([S.String(),S.Integer()])),function:S.Optional(S.String()),in_app:S.Optional(S.Boolean())})))})))}),_Fr=class extends Error{constructor(r,n){super(r);this.code=n;this.name="AgentEditorError"}static{a(this,"AgentEditorError")}};function dFc(t,e,r){let n=t.get(us),o=t.get(Ir).getEditorPluginInfo(),s=r.properties||{},c;r.platform&&r.exception_detail&&E4.has(o.name)&&(c=Object.assign({rollup_id:"auto",context:NPt(t),sensitive_context:{},deployed_to:n.getBuildType(),platform:r.platform,exception_detail:r.exception_detail},E4.get(o.name)),r.transaction&&(c.transaction=r.transaction),n.getBuildType()!=="dev"&&(c.release=`${c.app}@${o.version}`));let l=new _Fr(r.stacktrace??"N/A",o.name);return l.stack=void 0,xa(t,l,r.transaction??"",s,c),["OK",null]}a(dFc,"handleTelemetryExceptionChecked");var dYi=xe(uFc,dFc);p();p();p();Mo();function vFr(t,e){let r=Date.now()+((t?.refresh_in??0)+dNt)*1e3;return new oz({token:`test token ${Nt()}`,refresh_in:0,expires_at:r,...t},e,r)}a(vFr,"createTestCopilotToken");var Y_e=class extends Dh{constructor(){super(...arguments);this.defaultToken=vFr({token:"tid=test;rt=1"})}static{a(this,"FakeCopilotTokenFetcherFromSession")}fetchTokenResult(r,n){switch(n.accessToken){case"":return{copilotToken:this.defaultToken};case"valid-github-token":return{copilotToken:vFr({token:"tid=valid-copilot-token"})};case void 0:return{failureKind:"NotSignedIn"};case"notauth-github-token":return{failureKind:"NotAuthorized",message:"notauth",canSignUpForLimited:!0};case"bogus-github-token":return{failureKind:"NotAuthorized",message:"bogus",canSignUpForLimited:!1};case"expired-github-token":return{failureKind:"HTTP401",message:"expired"};default:throw new Error("Don't have a valid GitHub token")}}};var ZTt=class extends Dh{constructor(r){super();this.envelopeFn=r}static{a(this,"StaticCopilotTokenFetcher")}async fetchTokenResult(){return{copilotToken:vFr(await this.envelopeFn())}}};var fFc=S.Object({options:S.Optional(S.Object({}))});async function pFc(t,e,r){let n=new Y_e;return t.get(Mr).setTransientSession({accessToken:"valid-github-token",login:"always auth"}),t.forceSet(Dh,n),t.get(Ss).forceNormal("auth",{result:{status:"OK",user:"always auth"}}),await new Promise(o=>setTimeout(o,0)),["OK",null]}a(pFc,"handleTestingAlwaysAuthChecked");var CFr=xe(fFc,pFc);p();Mo();var hFc=S.Object({messages:S.Array(S.Object({role:S.Enum(ac),content:S.String(),name:S.Optional(S.String())})),modelFamily:S.Optional(S.Enum(wn)),stop:S.Optional(S.Array(S.String())),conversationOptions:S.Optional(S.Object({maxResponseTokens:S.Optional(S.Number()),temperature:S.Optional(S.Number())}))});async function mFc(t,e,r){let n=new cc(t),s=await Pq(t)?wn.Gpt35turbo:wn.CopilotBase,c=await t.get(tl).getBestChatModelConfig([r.modelFamily??s]),l=await xxe(t,"","");return[await n.fetchResponse({modelConfiguration:c,messages:r.messages,uiKind:"conversationIntegrationTest",stop:r.stop,intentParams:{intent:!0},llmInteraction:FA.user("test",Nt())},e,l),null]}a(mFc,"handleChatMLChecked");var fYi=xe(hFc,mFc);p();p();p();var eve=fe(gKi(),1),fQh={ALPN_HTTP2:eve.default.ALPN_HTTP2,ALPN_HTTP2C:eve.default.ALPN_HTTP2C,ALPN_HTTP1_1:eve.default.ALPN_HTTP1_1,ALPN_HTTP1_0:eve.default.ALPN_HTTP1_0},{fetch:pQh,context:AKi,reset:hQh,noCache:mQh,h1:gQh,keepAlive:AQh,h1NoCache:yQh,keepAliveNoCache:EQh,cacheStats:_Qh,clearCache:vQh,offPush:CQh,onPush:bQh,createUrl:SQh,timeoutSignal:TQh,Body:IQh,Headers:yKi,Request:xQh,Response:wQh,AbortController:RQh,AbortError:mIt,AbortSignal:kQh,FetchBaseError:PQh,FetchError:DQh,ALPN_HTTP2:NQh,ALPN_HTTP2C:MQh,ALPN_HTTP1_1:OQh,ALPN_HTTP1_0:LQh}=eve.default;var _Ki=require("crypto"),vKi=require("http"),CKi=require("stream"),bKi=require("util"),rve=fe(QP());var B6c=6e5,F6c=new rve.ProtocolRequestType("copilot/fetch"),U6c=new rve.ProtocolRequestType("copilot/fetchCancel"),Q6c=new rve.ProgressType,q6c=new rve.ProtocolRequestType("copilot/fetchDisconnectAll"),VL=class extends Error{static{a(this,"EditorFetcherError")}constructor(e){super(e),this.name="EditorFetcherError"}},tve=class extends nr{constructor(r){super();this.ctx=r;this.name="EditorFetcher";this.userAgent=`GithubCopilot/${r.get(us).getVersion()}`}static{a(this,"EditorFetcher")}disconnectAll(){return this.ctx.get(Xt).connection.sendRequest(q6c,{})}async fetch(r,n){n.headers||={},n.headers["user-agent"]=this.userAgent;let{signal:o}=n,s=this.ctx.get(Xt).connection,c=(0,_Ki.randomUUID)(),l=new Fn.CancellationTokenSource,u=new CKi.PassThrough,d=a(()=>{s.sendRequest(U6c,{workDoneToken:c})},"sendCancelRequest"),f=a(()=>{u.emit("error",new mIt("EditorFetch request aborted")),u.end()},"destroyBodyStream");if(o){if(!(o instanceof AbortSignal))throw new VL("EditorFetcher received unexpected abort signal");if(o.aborted)throw new mIt("EditorFetcher signal aborted before fetch");o.addEventListener("abort",d)}s.onProgress(Q6c,c,m=>{m.kind==="end"?(o?.removeEventListener("abort",d),o?.removeEventListener("abort",f),m.error&&u.emit("error",new VL(m.error)),u.end()):m.kind==="report"&&u.write(m.chunk)});let h=await new Promise((m,g)=>{let A=n.timeout??B6c,y=setTimeout(()=>{cr(this.ctx,"editorFetcher.requestTimeout",{method:n.method??"GET",timeoutMs:String(A)}),g(new VL("Request timed out from lsp server"))},A),E=a(()=>{g(new mIt("EditorFetcher request aborted"))},"rejectIfAborted");o?.addEventListener("abort",E),s.sendRequest(F6c,H6c(r,c,n),l.token).then(m).catch(_=>{let v="EditorFetcher request failed";_&&typeof _=="object"&&"message"in _&&(v+=`: ${String(_.message)}`),_&&typeof _=="object"&&"data"in _&&(v+=`: ${(0,bKi.inspect)(_.data)}`),g(new VL(v))}).finally(()=>{o?.removeEventListener("abort",E),clearTimeout(y)})});if(!h.status)throw new VL("EditorFetcher received invalid response");return o?.addEventListener("abort",f),new lx(h.status,vKi.STATUS_CODES[h.status]??"",new yKi(h.headers),()=>j6c(u),()=>u)}};function j6c(t){return new Promise((e,r)=>{let n="";t.on("error",r),t.on("end",()=>e(n)),t.on("data",o=>n+=String(o))})}a(j6c,"consumeStream");function H6c(t,e,r){let{timeout:n,method:o}=r,s=r.headers??{},c=r.json?JSON.stringify(r.json):r.body;return r.json&&(s["content-type"]="application/json"),{url:t,headers:s,body:c,timeout:n,method:o,workDoneToken:e}}a(H6c,"convertOptionsToParams");var G6c=S.Object({url:S.String(),headers:S.Optional(S.Record(S.String(),S.String())),body:S.Optional(S.String()),timeout:S.Optional(S.Number()),method:S.Optional(S.Union([S.Literal("GET"),S.Literal("POST"),S.Literal("DELETE")])),cancelBeforeRequest:S.Optional(S.Boolean()),cancelAfterRequest:S.Optional(S.Boolean()),cancelAfterFirstChunk:S.Optional(S.Boolean())});async function $6c(t,e,r){let n=new tve(t),o=new AbortController,s=o.signal,{url:c,cancelBeforeRequest:l,cancelAfterRequest:u,cancelAfterFirstChunk:d,...f}=r;l&&o.abort();let h=n.fetch(c,{signal:s,...f});u&&o.abort();let m;try{m=await h}catch(y){return[{error:`Fetch stream error: ${y instanceof VL?y.message:String(y)}`},null]}let{status:g}=m,A=Object.fromEntries(Array.from(m.headers));try{if(d){let E=m.body();for await(let _ of E){let v=_.toString();return o.abort(),[{status:g,headers:A,body:v},null]}}let y=await m.text();return[{status:g,headers:A,body:y},null]}catch(y){return[{error:`Fetch stream error: ${y instanceof VL?y.message:String(y)}`},null]}}a($6c,"handleTestingFetchChecked");var SKi=xe(G6c,$6c);p();var V6c=S.Object({});async function W6c(t,e,r){return await t.get(Dd).flush(),["OK",null]}a(W6c,"handleTestingFlushPromiseQueueChecked");var TKi=xe(V6c,W6c);p();p();p();var rW=class{static{a(this,"FileSearch")}};p();p();p();var gIt=class{constructor(e){this.maxDegreeOfParalellism=e;this.outstandingPromises=[],this.runningPromises=0}static{a(this,"PriorityLimiter")}queue(e,r=!1){return new Promise((n,o)=>{r?this.outstandingPromises.unshift({factory:e,c:n,e:o}):this.outstandingPromises.push({factory:e,c:n,e:o}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.consumed(),()=>this.consumed())}}consumed(){this.runningPromises--,this.outstandingPromises.length>0&&this.consume()}};var IKi=fe(ei());var AIt="main.js",yIt=class{constructor(e,r,n=3){this.promiseResolvers=new Map;this.id=0;try{let o={cwd:process.cwd(),indexWorkspaceRoots:e,params:r};this.worker=fmn(AIt,o),this.worker.on("message",this.handleWorkerMessage.bind(this)),this.worker.on("error",s=>{this.handleUnexpectedError(s)}),this.postMessageQueue=new gIt(n)}catch(o){throw console.error(`Failed to create worker: ${o.message}`),o}}static{a(this,"IndexClient")}dispose(){return this.postMessageInQueue(new hWe(this.id++),IKi.CancellationToken.None,!0)}async indexFile(e,r,n){return await this.postMessageInQueue(new dWe(this.id++,e,r),n)}async getAllFileNames(e,r){return this.postMessageInQueue(new fWe(this.id++,e),r)}getContext(e,r,n,o,s,c){return this.postMessageInQueue(new pWe(this.id++,e,r,n,o,s),c,!0)}tryCreateIndex(e,r,n){return this.postMessageInQueue(new lWe(this.id++,e,r),n)}async postMessageInQueue(e,r,n=!1){return this.postMessageQueue.queue(()=>this.postMessageAndWait(e,r),n)}tryRemoveIndex(e,r){return this.postMessageAndWait(new uWe(this.id++,e),r)}async postMessageAndWait(e,r){if(this.fatalError)return Promise.reject(this.fatalError);let n=new Promise((s,c)=>{this.promiseResolvers.set(e.id,{resolve:s,reject:c})});this.worker.postMessage(e);let o=r.onCancellationRequested(()=>{this.worker.postMessage(new cWe(e.id))});try{return await n}finally{o.dispose()}}handleWorkerMessage(e){if(e.operation!=="response")throw new Error("Unexpected message operation");let r=this.promiseResolvers.get(e.id);if(!r)throw new Error(`Received response for message that isn't in progress: ${e.id}`);this.promiseResolvers.delete(e.id),e.error?(e.error.code=e.code,r.reject(e.error)):r.resolve(e.data)}handleUnexpectedError(e){let r;if(e instanceof Error){r=e,r.code==="MODULE_NOT_FOUND"&&r.message?.endsWith(AIt+"'")&&(r=new Error(`Failed to load ${AIt}`),r.code="CopilotPromptLoadFailure");let n=new Error().stack;r.stack&&n?.match(/^Error\n/)&&(r.stack+=n.replace(/^Error/,""))}else e&&typeof e=="object"&&"name"in e&&"status"in e&&e.name==="ExitStatus"&&typeof e.status=="number"?(r=new Error(`${AIt} exited with status ${e.status}`),r.code=`CopilotPromptWorkerExit${e.status}`):r=new Error(`Non-error thrown: ${JSON.stringify(e)}`);for(let n of this.promiseResolvers.values())n.reject(r);this.promiseResolvers.clear(),this.fatalError=r}};var HFe=fe(ei());var Y9=new pe(ipr),EIt=class{constructor(e,r,n,o,s){this.ctx=e;this.watcher=r;this.workspaceDatabasePersistenceManager=n;this.workspaceInit=new Map;this.watcher.onFileChange(async(c,l)=>{await this.indexFile(l,this.languageId(l)??"plaintext")}),this.watcher.onWorkspaceChange(async(c,l)=>{if(c===1){Y9.debug(this.ctx,`workspace removed: ${l}`),await this.indexClient.tryRemoveIndex(l,HFe.CancellationToken.None);return}Y9.debug(this.ctx,`workspace added: ${l}`),await this.indexAddedWorkspace(l)}),this.indexClient=new yIt(o,s);for(let c of o){let l=c.rootPath;this.workspaceInit.set(l,this.doWorkspaceIndex(l).then(()=>{Y9.debug(this.ctx,`workspace ${l} indexed`),this.workspaceInit.delete(l)}))}}static{a(this,"MultiLanguageContextIndexWatcher")}isInitializing(e){for(let[r]of this.workspaceInit)if(e.startsWith(r))return!0;return!1}dispose(){return this.indexClient.dispose()}async indexAddedWorkspace(e){let r=await z6c(e,this.workspaceDatabasePersistenceManager);await this.indexClient.tryCreateIndex(r.rootPath,r.databaseFilePath,HFe.CancellationToken.None),this.workspaceInit.has(e)&&await this.workspaceInit.get(e);let n=this.doWorkspaceIndex(e).then(()=>{Y9.debug(this.ctx,`workspace ${e} indexed`),this.workspaceInit.delete(e)});this.workspaceInit.set(e,n)}async doWorkspaceIndex(e){Y9.debug(this.ctx,`indexing workspace ${e}`);let r=E6t.map(f=>`*${f}`);if(r.length===0)return;let o=`**/${E6t.length===1?r[0]:`{${r.join(",")}}`}`,s=this.ctx.get(rW),c=await Promise.all([s.findFiles(o,{uri:e},{excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0,excludeIDESearchIgnoredFiles:!0}),this.indexClient.getAllFileNames(e,HFe.CancellationToken.None)]),l=c[0],u=c[1],d=Array.from(new Set([...l,...u]));Y9.debug(this.ctx,`found ${d.length} files to index in ${e}`),await Promise.all(d.map(async f=>{let h=this.languageId(f);h&&await this.indexFile(f.replace(/\/+$/,""),h)})),Y9.debug(this.ctx,`finished indexing workspace ${e}`)}async indexFile(e,r){try{Y9.debug(this.ctx,`index triggered for ${e}`),await this.indexClient.indexFile(e,r,HFe.CancellationToken.None)}catch(n){Y9.debug(this.ctx,`failed to index ${e} with ${n}`)}}languageId(e){return ppn(e)}};async function z6c(t,e){return{databaseFilePath:await e.getDBFilePath(t),rootPath:t}}a(z6c,"createIndexableWorkspaceFolder");var Y6c=S.Object({filePath:S.String(),code:S.String(),offset:S.Number(),languageId:S.String(),timeout:S.Optional(S.Number()),waitForContext:S.Optional(S.Boolean())});async function K6c(t,e,r){try{await t.get(VS).start();let n=t.get(EIt),o=r.timeout??1e3,s=Date.now(),c=[],l=!0;for(;l;)try{c=await n.indexClient.getContext(r.filePath,r.code,r.offset,r.languageId,opr,e)}catch{}finally{l=(r.waitForContext??!1)&&c.length==0&&Date.now()-ssetTimeout(n,0)),["OK",null]}a(e9c,"handleTestingNeverAuthChecked");var JFr=xe(X6c,e9c);p();p();p();var ZFr=class extends gp{constructor(r){super();this.certificates=r}static{a(this,"TestCertificateReader")}getAllRootCAs(){return this.certificates}},RKi=a(t=>new ZFr(t),"createTestCertificateReader");function e8r(t,e,r){let n=new XFr;n.set("x-github-request-id","1");for(let[o,s]of Object.entries(r||{}))n.set(o,s);return new lx(t,"status text",n,()=>Promise.resolve(e??""),()=>null)}a(e8r,"createFakeResponse");function kKi(t,e,r){let n;return typeof e=="string"?n=e:n=JSON.stringify(e),e8r(t,n,Object.assign({"content-type":"application/json"},r))}a(kKi,"createFakeJsonResponse");var GFe=class extends nr{constructor(){super(...arguments);this.name="FakeFetcher"}static{a(this,"FakeFetcher")}disconnectAll(){throw new Error("Method not implemented.")}};var _It=class extends GFe{static{a(this,"NoFetchFetcher")}fetch(e,r){throw new Error("NoFetchFetcher does not support fetching")}};var XFr=class{constructor(){this.headers=new Map}static{a(this,"FakeHeaders")}append(e,r){this.headers.set(e.toLowerCase(),r)}delete(e){this.headers.delete(e.toLowerCase())}get(e){return this.headers.get(e.toLowerCase())??null}has(e){return this.headers.has(e.toLowerCase())}set(e,r){this.headers.set(e.toLowerCase(),r)}entries(){return this.headers.entries()}keys(){return this.headers.keys()}values(){return this.headers.values()}[Symbol.iterator](){return this.headers.entries()}};var t8r=class extends GFe{static{a(this,"ExpConfigFetcher")}constructor(e){super(),this.fullConfig={Features:[],Flights:{},Configs:[{Id:"vscode",Parameters:e.Parameters}],ParameterGroups:[],AssignmentContext:e.AssignmentContext}}fetch(e,r){return e.endsWith("telemetry")?Promise.resolve(kKi(200,this.fullConfig)):Promise.resolve(e8r(404,""))}},vIt=class extends t8r{constructor(r,n){super(r);this.delegate=n}static{a(this,"ExpConfigFetcherWithDelegate")}fetch(r,n){return r.endsWith("telemetry")?super.fetch(r,n):this.delegate.fetch(r,n)}};var t9c=S.Object({expFlags:S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean()]))});function r9c(t,e,r){if(r.expFlags){let n={AssignmentContext:"assignmentcontext",Parameters:{...r.expFlags}};t.forceSet(nr,new vIt(n,t.get(nr)))}return["OK",null]}a(r9c,"handleTestingOverrideExpFlagsChecked");var PKi=xe(t9c,r9c);p();var n9c=S.Object({rules:JUt});function i9c(t,e,r){return t.get(sc).setTestingRules(r.rules),["OK",null]}a(i9c,"handleTestingSetContentExclusionRulesChecked");var DKi=xe(n9c,i9c);p();var o9c=S.Object({workDoneToken:S.Union([S.String(),S.Number()]),chunks:S.Array(S.String()),followUp:S.Optional(S.String()),suggestedTitle:S.Optional(S.String()),skills:S.Optional(S.Array(S.String())),references:S.Optional(S.Array(qO)),options:S.Optional(S.Object({}))});function s9c(t,e,r){return t.get(K9).add(r.workDoneToken,r.chunks,r.followUp,r.suggestedTitle,r.skills,r.references),["OK",null]}a(s9c,"handleTestingSetSyntheticTurnsChecked");var NKi=xe(o9c,s9c);p();var a9c=S.Object({});async function c9c(t,e,r){let n=t.get(es),o=t.get(Vf);return await n.showWarningMessage("This is a test message",{title:"Some Action"}).then(c=>s(3,"response from message request",c?.title)).catch(c=>s(1,"error sending show message request",c)),["OK",null];function s(c,l,u){return o.logIt(t,c,"triggerShowMessage",`${l} (${String(u)})`)}a(s,"sendNotification")}a(c9c,"handleTriggerShowMessageChecked");var MKi=xe(a9c,c9c);p();p();p();p();var OKi=fe(require("tls"));var nve=class{static{a(this,"RootCertificateConfigurator")}#e;constructor(e){this._certificateReader=e.get(gp)}async getCertificates(){let e=await this._certificateReader.getAllRootCAs();if(e.length!==0)return e}async createSecureContext(){let e=await this._certificateReader.getAllRootCAs(),n=OKi.createSecureContext({_vscodeAdditionalCaCerts:e}),o=n.context;for(let s of e)o.addCACert(s);return{secureContext:n,certs:e}}async applyToRequestOptions(e){this.#e??=this.createSecureContext();let r=await this.#e;e.secureContext=r.secureContext,e.ca=r.certs,e.cert=r.certs}};p();var WKi=fe(require("http"));var N9c=407,Dy=new pe("proxySocketFactory"),Ek=class{static{a(this,"ProxySocketFactory")}},Vie=class extends Error{static{a(this,"ProxySocketError")}constructor(e,r,n){super(e),this.code=r?.code,this.syscall=r?.syscall,this.errno=r?.errno,/^Failed to establish a socket connection to proxies:/.test(r?.message??"")?this.code="ProxyFailedToEstablishSocketConnection":/^InitializeSecurityContext:/.test(r?.message??"")?this.code="ProxyInitializeSecurityContext":r?.message==="Miscellaneous failure (see text): Server not found in Kerberos database"?this.code="ProxyKerberosServerNotFound":/^Unspecified GSS failure. {2}Minor code may provide more information: No Kerberos credentials available/.test(r?.message??"")&&(this.code="ProxyGSSFailureNoKerberosCredentialsAvailable"),n!==void 0&&(this.code=n);let o=/^ProxyStatusCode(\d+)$/.exec(this.code??"");o&&(this.statusCode=Number(o[1]))}};function CIt(t){return new i8r(t,new o8r(t))}a(CIt,"getProxySocketFactory");var i8r=class extends Ek{constructor(r,n,o=new VFe,s=process.platform){super();this.ctx=r;this.delegate=n;this.kerberosLoader=o;this.platform=s;this.successfullyAuthorized=new Cn(20)}static{a(this,"KerberosProxySocketFactory")}async createSocket(r,n){this.successfullyAuthorized.get(this.getProxyCacheKey(n))&&(Dy.debug(this.ctx,"Proxy authorization already successful once, skipping 407 round trip"),await this.reauthorize(r,n));try{return await this.delegate.createSocket(r,n)}catch(o){if(o instanceof Vie&&o.code===`ProxyStatusCode${N9c}`){Dy.debug(this.ctx,"Proxy authorization required, trying to authorize first time");let s=await this.authorizeAndCreateSocket(r,n);if(s)return Dy.debug(this.ctx,"Proxy authorization successful, caching result"),ft(this.ctx,"proxy.kerberosAuthorized"),this.successfullyAuthorized.set(this.getProxyCacheKey(n),!0),s}throw o}}async reauthorize(r,n){let o=await this.authorize(n);o&&(Dy.debug(this.ctx,"Proxy re-authorization successful, received token"),r.headers["Proxy-Authorization"]="Negotiate "+o)}async authorizeAndCreateSocket(r,n){let o=await this.authorize(n);if(Dy.debug(this.ctx,"Proxy authorization successful, received token"),o)return Dy.debug(this.ctx,"Trying to create socket with proxy authorization"),r.headers["Proxy-Authorization"]="Negotiate "+o,await this.delegate.createSocket(r,n)}async authorize(r){Dy.debug(this.ctx,"Loading kerberos module");let n=await this.kerberosLoader.load(),o=this.computeSpn(r);Dy.debug(this.ctx,"Initializing kerberos client using spn",o);let s=await n.initializeClient(o);Dy.debug(this.ctx,"Perform client side kerberos step");let c=await s.step("");return Dy.debug(this.ctx,"Received kerberos server response"),c}computeSpn(r){let n=r.kerberosServicePrincipal;if(n)return Dy.debug(this.ctx,"Using configured kerberos spn",n),n;let o=this.platform==="win32"?`HTTP/${r.hostname}`:`HTTP@${r.hostname}`;return Dy.debug(this.ctx,"Using default kerberos spn",o),o}getProxyCacheKey(r){return`${r.hostname}:${r.port}`}},o8r=class extends Ek{constructor(r){super();this.ctx=r;this.userAgent=`GithubCopilot/${this.ctx.get(us).getVersion()}`}static{a(this,"TunnelingProxySocketFactory")}async createSocket(r,n){let o=this.createConnectRequestOptions(r,n);return new Promise((s,c)=>{Dy.debug(this.ctx,"Attempting to establish connection to proxy");let l=WKi.request(o);l.useChunkedEncodingByDefault=!1,l.once("connect",(u,d,f)=>{Dy.debug(this.ctx,"Socket Connect returned status code",u.statusCode),l.removeAllListeners(),d.removeAllListeners(),u.statusCode!==200?(d.destroy(),c(new Vie(`tunneling socket could not be established, statusCode=${u.statusCode}`,void 0,`ProxyStatusCode${u.statusCode}`))):f.length>0?(d.destroy(),c(new Vie(`got non-empty response body from proxy, length=${f.length}`,void 0,"ProxyNonEmptyResponseBody"))):(Dy.debug(this.ctx,"Successfully established tunneling connection to proxy"),s(d))}),l.once("error",u=>{Dy.debug(this.ctx,"Proxy socket connection error",u.message),l.removeAllListeners(),c(new Vie(`tunneling socket could not be established, cause=${u.message}`,u))}),l.on("timeout",()=>{Dy.debug(this.ctx,"Proxy socket connection timeout"),c(new Vie(`tunneling socket could not be established, proxy socket connection timeout while connecting to ${o.hostname}:${o.port}`,void 0,"ProxyTimeout"))}),l.end()})}createConnectRequestOptions(r,n){let o=`${r.hostname}:${r.port}`,s={hostname:n.hostname,port:n.port,method:"CONNECT",path:o,agent:!1,headers:{host:o,"Proxy-Connection":"keep-alive","User-Agent":this.userAgent},timeout:r.timeout};return r.localAddress&&(s.localAddress=r.localAddress),this.configureProxyAuthorization(s,r,n.authorization),s}configureProxyAuthorization(r,n,o){r.headers["Proxy-Authorization"]=[],o&&r.headers["Proxy-Authorization"].push("Basic "+Buffer.from(o).toString("base64")),typeof n.headers?.["Proxy-Authorization"]=="string"&&r.headers["Proxy-Authorization"].push(n.headers["Proxy-Authorization"])}},VFe=class{static{a(this,"KerberosLoader")}load(){return Promise.resolve().then(()=>fe(VKi()))}};var Wie=class extends nr{constructor(r,n){super();this.name="HelixFetcher";this.certificateConfigurator=new nve(r),this.proxySocketFactory=r.get(Ek),this.proxySocketTimeoutForTesting=n?.proxySocketTimeoutForTesting,r.get(Lo).onDidChangeHttpSettings(o=>{this.fetchApi=this.createFetchApi(r,o),this.updateNoProxy(o.noProxy)}),this.fetchApi=this.createFetchApi(r,r.get(Lo).getHttpSettings()),this.updateNoProxy(r.get(Lo).getHttpSettings().noProxy),this.fetchApiByPass=this.createFetchApi(r,{proxy:""})}static{a(this,"HelixFetcher")}maybeCreateSocketFactory(r,n){if(!r?.proxy)return;let o=new URL(r.proxy);return async s=>(s.rejectUnauthorized=r.proxyStrictSSL,s.timeout=n,await this.certificateConfigurator.applyToRequestOptions(s),await this.proxySocketFactory.createSocket(s,{hostname:o.hostname,port:o.port,authorization:r.proxyAuthorization,kerberosServicePrincipal:r.proxyKerberosServicePrincipal}))}createFetchApi(r,n){let o=r.get(us),s=this.proxySocketTimeoutForTesting;return AKi({userAgent:`GithubCopilot/${o.getVersion()}`,socketFactory:this.maybeCreateSocketFactory(n,s),rejectUnauthorized:n.proxyStrictSSL})}parseNoProxy(r){return r?.map(n=>n.trim()).filter(n=>n.length>0)||[]}updateNoProxy(r){if(this.noProxy=this.parseNoProxy(r),this.proxyExceptionFilters=void 0,!this.noProxy.length)return;if(this.noProxy.includes("*")){this.proxyExceptionFilters=[{regex:/.*/i}];return}let n=a(s=>{if(!s)return;s.startsWith(".")&&(s=`*${s}`);let c=s.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${c}$`,"i")}catch{return}},"toRegex"),o=[];for(let s of this.noProxy){let c=s,l;if(c.startsWith("[")){let d=c.indexOf("]");if(d!==-1){let f=c.slice(1,d),h=c.slice(d+1);h.startsWith(":")&&(l=h.slice(1)),c=f}}else{let d=c.split(":");d.length===2&&(c=d[0],l=d[1])}let u=n(c);u&&o.push({regex:u,port:l})}o.length&&(this.proxyExceptionFilters=o)}shouldBypassProxy(r){if(!this.proxyExceptionFilters||!this.proxyExceptionFilters.length)return!1;let n;try{n=new URL(r)}catch{return!1}let o=n.hostname;if(!o)return!1;let s=n.port||(n.protocol==="https:"?"443":"80"),c=o.toLowerCase();return this.proxyExceptionFilters.some(l=>l.regex.test(c)&&(!l.port||l.port===s))}async fetch(r,n){let o=n.signal,s=!1;if(n.timeout){let f=new AbortController;setTimeout(()=>{f.abort(),s=!0},n.timeout),n.signal?.addEventListener("abort",()=>f.abort()),n.signal?.aborted&&f.abort(),o=f.signal}let c={...n,body:n.body?n.body:n.json,signal:o},l=this.shouldBypassProxy(r);if(!l){await this.certificateConfigurator.applyToRequestOptions(c);let f=await this.certificateConfigurator.getCertificates();this.fetchApi.setCA(f)}let d=await(l?this.fetchApiByPass:this.fetchApi).fetch(r,c).catch(f=>{throw s?new ez(`Request to <${r}> timed out after ${n.timeout}ms`,f):f});return new lx(d.status,d.statusText,d.headers,()=>d.text(),()=>d.body)}disconnectAll(){return this.fetchApi.reset()}};p();p();var sve=class extends Km{constructor(r,n={}){super();this.env=n;this.recalculateUrlDefaults(r,this.getDefaultUrls())}static{a(this,"DefaultNetworkConfiguration")}getAuthAuthority(){return this.baseUrlObject.hostname}getConfiguredUrls(){return{serverUrl:this.baseUrlObject.href,apiUrl:this.apiUrl}}setConfiguredUrls(r,n){let o=this.getConfiguredUrls();this.recalculateUrlDefaults(r,n);let s=this.getConfiguredUrls();(o.apiUrl!==s.apiUrl||o.serverUrl!==s.serverUrl)&&r.get(Ft).resetToken("config_urls_changed"),r.get(yf).updateSessionConfig(s)}recalculateUrlDefaults(r,n){let{serverUrl:o,apiUrl:s}=Yy({serverUrl:M7e(r,n.serverUrl),apiUrl:M7e(r,n.apiUrl)});this.baseUrlObject=new URL(o),this.apiUrl=s}getDefaultUrls(){return this.env.CODESPACES==="true"&&this.env.GITHUB_TOKEN&&this.env.GITHUB_SERVER_URL&&this.env.GITHUB_API_URL&&!this.env.GITHUB_COPILOT_TOKEN&&!this.env.GH_COPILOT_TOKEN?{apiUrl:this.env.GITHUB_API_URL,serverUrl:this.env.GITHUB_SERVER_URL}:{}}};p();var M9c=new pe("expConfigManager"),O9c=3600*1e3,iW=class{constructor(e,r){this.ctx=e;this.fetchedAt=0;r.onDidChangeTokenResult(n=>{n.copilotToken&&this.refresh({force:!0})})}static{a(this,"ExpConfigManager")}getBoolean(e){let r=this.cached?.variables[e];return typeof r=="boolean"?r:void 0}getNumber(e){let r=this.cached?.variables[e];return typeof r=="number"?r:void 0}getString(e){let r=this.cached?.variables[e];return typeof r=="string"?r:void 0}getRaw(e){return this.cached?.variables[e]}refresh({force:e=!1}={}){return this.inflight?this.inflight:!e&&this.cached!==void 0&&Date.now()-this.fetchedAt{try{let{exp:r}=await this.ctx.get(Jt).getFallbackExpAndFilters();this.cached=r,this.fetchedAt=Date.now()}catch(r){M9c.exception(this.ctx,r,".refresh")}finally{this.inflight=void 0}})(),this.inflight)}};p();var ave=class extends iB{static{a(this,"TelemetryLogSenderImpl")}sendException(e,r,n){xa(e,r,n)}};p();var cve=class extends A4{static{a(this,"EmptyRecentEditsProvider")}isEnabled(){return!1}start(){}getRecentEdits(){return[]}getEditSummary(e){return null}};p();var bIt=class extends t2{constructor(r=[]){super();this._agents=r}static{a(this,"TestRemoteAgentRegistry")}agents(){return this._agents}};p();var SIt=class extends Zh{constructor(){super(...arguments);this.prompts=[];this.fetchResults=[];this.diffs=[]}static{a(this,"TestConversationInspector")}shouldInspect(){return!0}inspectPrompt(r){this.shouldInspect()&&this.prompts.push(r)}inspectFetchResult(r){this.shouldInspect()&&this.fetchResults.push(r)}documentDiff(r){this.shouldInspect()&&this.diffs.push(r)}};p();var TIt=class extends rW{constructor(){super(...arguments);this.allowedFiles=[]}static{a(this,"TestingFileSearch")}addAllowedFiles(r){this.allowedFiles.push(...r)}findFiles(r,{uri:n},o){return Promise.resolve(this.allowedFiles)}};p();function zKi(t,e="cl100k_base"){return{modelId:"gpt-3.5-turbo",modelFamily:t,uiName:"Test GPT",maxRequestTokens:6144,maxResponseTokens:2048,baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:e,isExperimental:!1,stream:!0,toolCalls:!0}}a(zKi,"fakeChatModelConfiguration");function L9c(t){return{modelId:"embedding-test",modelFamily:t,maxBatchSize:1,maxTokens:50,tokenizer:"cl100k_base"}}a(L9c,"fakeEmbeddingModelConfiguration");var IIt=class extends tl{static{a(this,"TestModelConfigurationProvider")}getBestChatModelConfig(e){let r=e[0];return Promise.resolve(zKi(r))}getModelConfigurationById(e){return Promise.resolve({...zKi(e),modelId:e})}getFirstMatchingEmbeddingModelConfiguration(e){return Promise.resolve(L9c(e))}};p();var xIt=class extends Jm{constructor(){super(...arguments);this.openedUrls=[];this.opened=new kA}static{a(this,"TestUrlOpener")}open(r){return this.openedUrls.push(r),this.opened.resolve(),Promise.resolve()}},wIt=class extends es{constructor(){super();this.sentMessages=[];this.warningPromises=[];this.informationPromises=[]}static{a(this,"TestNotificationSender")}performDismiss(){this.actionToPerform="DISMISS"}performAction(r){this.actionToPerform=r}showWarningMessage(r,...n){this.sentMessages.push(r);let o;if(this.actionToPerform)if(this.actionToPerform==="DISMISS")o=Promise.resolve(void 0);else{let s=n.find(c=>c.title===this.actionToPerform);o=s?Promise.resolve(s):Promise.resolve(void 0)}else o=n?Promise.resolve(n[0]):Promise.resolve(void 0);return this.warningPromises.push(o),o}showInformationMessage(r,...n){this.sentMessages.push(r);let o;if(this.actionToPerform)if(this.actionToPerform==="DISMISS")o=Promise.resolve(void 0);else{let s=n.find(c=>c.title===this.actionToPerform);o=s?Promise.resolve(s):Promise.resolve(void 0)}else o=n?Promise.resolve(n[0]):Promise.resolve(void 0);return this.informationPromises.push(o),o}showInformationModal(r,...n){return this.showInformationMessage(r,...n)}sendBackgroundAgentSessionUpdate(r,n,o,s){return Promise.resolve()}sendBackgroundAgentTodosChanged(r){return Promise.resolve()}async waitForMessages(){await Promise.all(this.warningPromises),await Promise.all(this.informationPromises)}};p();function YKi(t,e,r,n){return US.create(N7e(t),e,r,n,e)}a(YKi,"createTextDocument");var s8r=class extends $r{constructor(r,n){super(r,n);this._openTextDocuments=[];this._notebookDocuments=new Map;this._workspaceFolders=[];this.didFocusTextDocumentEmitter=new Vi;this.onDidFocusTextDocument=this.didFocusTextDocumentEmitter.event;this.didChangeTextDocumentEmitter=new Vi;this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event;this.didOpenTextDocumentEmitter=new Vi;this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event;this.didCloseTextDocumentEmitter=new Vi;this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event;this.didChangeWorkspaceFoldersEmitter=new Vi;this.onDidChangeWorkspaceFolders=this.didChangeWorkspaceFoldersEmitter.event}static{a(this,"SimpleTestTextDocumentManager")}init(r){this._workspaceFolders=r.map(n=>({uri:n.uri,name:n.name??Ki(n.uri)}))}async readTextDocumentFromDisk(r){return super.readTextDocumentFromDisk(r)}getTextDocumentsUnsafe(){return this._openTextDocuments}setTextDocument(r,n,o){let s=YKi(r,n,0,o);return this._openTextDocuments.push(s),s}updateTextDocument(r,n){let o=this._openTextDocuments.findIndex(c=>c.uri===r.toString());if(o<0)throw new Error("Document not found");let s=this._openTextDocuments[o];this._openTextDocuments[o]=YKi(r,s.clientLanguageId,s.version+1,n)}setNotebookDocument(r,n){this._notebookDocuments.set(r.uri.replace(/#.*/,""),n)}findNotebook({uri:r}){return this._notebookDocuments.get(r.replace(/#.*/,""))}getWorkspaceFolders(){return this._workspaceFolders}},RIt=class extends s8r{constructor(r){super(r);this.contents=new Map}static{a(this,"TestTextDocumentManager")}readTextDocumentFromDisk(r){return Promise.resolve(this.contents.get(r))}setDiskContents(r,n){this.contents.set(r,n)}};var a8r=class extends Vf{static{a(this,"NullLog")}logIt(...e){}},c8r=class extends Mr{static{a(this,"TestAuthManager")}constructor(e,r){super(e,{}),this.transientSession=r&&Promise.resolve(r)}resolvePersistedSession(){return Promise.resolve(void 0)}signInEditor(e){return Promise.resolve({status:"OK",user:"test-user"})}signOutEditor(){return Promise.resolve({status:"NotSignedIn"})}revokeTokenById(){return Promise.resolve({affectedEditors:0})}useExistingToken(e){return Promise.resolve({status:"revoked"})}listAvailableTokens(){return Promise.resolve([])}};function B9c(t){let e=new gue;e.set(Lo,t),e.set(WY,t);let r=new c8r(e,{accessToken:"",login:"user"});e.set(Mr,r),e.set(us,new us),e.set(ip,new ip),e.set(WI,new WI({debug:!1,verboseLogging:!1,testMode:!0,simulation:!1})),e.set(gp,RKi([])),e.set(Ek,CIt(e)),e.set(IC,new IC),e.set(_P,new jje);let n=new Y_e;e.set(Dh,n);let o=new Ft(e,!0);e.set(Ft,o);let s=new Fp(e);return s.updateFromToken(n.defaultToken),e.set(Fp,s),e.set(tg,new tg),e.set(aM,new aM),e.set(es,new wIt),e.set(Jm,new xIt),e.set(iB,new ave),e.set(Vf,new a8r),e.set(TC,new TC),e.set(qa,new qa("test-session","test-machine","test-device")),e.set($I,new $I(()=>Promise.resolve("test-device"))),e.set(Km,new sve(e)),e.set(Uk,new Noe),e.set(yf,new yf(e,"copilot-test")),e.set(Jt,new Jt(e)),e.set(iW,new iW(e,o)),e.set(Y2,new Y2),e.set(MP,new Ele),e.set(Ss,new Uje),e.set(Dd,new Dd),e.set(n4,new n4(e)),e.set(rW,new TIt),e.set(rD,new rD(e)),e.set(O8,Gdt(e)),e.set(cy,new cy),e.set(Db,new Db),e.set(L8,L8.default),e.set(jx,new jx(e,!1)),e.set(Jp,new Jp),e.set(ni,new ni(e)),e.set(VT,new Wdt),e.set(ym,new ym),e.set(Em,nut(e,(c,l,u)=>l.find(d=>d==="*")?1:l.find(d=>typeof d!="string"&&d.language===u.languageId)?10:0)),e.set(Nb,new Nb(e)),F9c(e),e.set(Pb,new Pb(e)),e.set(kn,new kn),e.set(A4,new cve),e.set(kN,new kN),e.set(Tw,new Tw),e.set(uT,new uT(e)),e}a(B9c,"_createBaselineContext");function F9c(t){t.set(zo,new zo(t)),t.set(wc,new wc(t)),t.set(NA,new NA(t)),t.set(Xh,new Xh),t.set(vg,new vg),t.set(Zh,new SIt),t.set(Ak,new Ak(t,[])),t.set(tl,new IIt),t.set(t2,new bIt),t.set(UO,new UO(t));let e=new ON(t);t.set(ON,e),t.set(gk,new gk(e,t)),t.set(YO,new YO(t)),t.set(RI,new ATt),t.set(tb,new tb(t.get(gk),t.get(RI),t)),t.set(y0,new y0)}a(F9c,"registerConversation");function KKi(){let t=B9c(new WY(new _le,new Map));return t.set(nr,new _It),t.set(Ir,new l8r),t.set($r,new RIt(t)),t.set(Qo,new OQ),t.set(sc,new sc(t)),t.set(Eu,new Eu(t)),t.set(zS,new OYe),t.set(CO,new CO(t)),t.set(i4,new mme),t.set(V2,new xlt),t.set(Hl,new AYe),t.set(PA,new PA(t)),t.set(d0,new rYe),t.set(Am,new Am),tYe(t),t.set(sy,new xEe(t)),t}a(KKi,"createLibTestingContext");var l8r=class extends Ir{constructor(r={name:"lib-tests-plugin",version:"2"},n={name:"lib-tests-editor",version:"1"},o=[{name:"lib-tests-related-plugin",version:"3"}]){super();this.editorPluginInfo=r;this.editorInfo=n;this.relatedPluginInfo=o}static{a(this,"LibTestsEditorInfo")}getEditorInfo(){return this.editorInfo}getEditorPluginInfo(){return this.editorPluginInfo}getRelatedPluginInfo(){return this.relatedPluginInfo}};var ZKi=fe(require("fs"));var JKi=`${process.env.HOME}/.copilot-testing-gh-token`,kIt,PIt;function XKi(t){let e=eJi(),r=new ZTt(U9c);return t.forceSet(Dh,r),t.get(Mr).setTransientSession(e),r}a(XKi,"setIntegrationTokenManager");var U9c=a(async()=>{if(PIt)return PIt;let t=await eJi(),e=KKi(),r=new Wie(e);return e.forceSet(nr,r),PIt=fNt(e,t).then(n=>{if(n.copilotToken)return{token:n.copilotToken.token,refresh_in:n.copilotToken.envelope.refresh_in};throw new yi('Could not fetch testing Copilot token. Try running "npm run get_token" again?')}),PIt},"getEnvelope");async function eJi(){let{session:t}=e4t(process.env);if(t)return t;try{kIt??=(await ZKi.promises.readFile(JKi)).toString().trim()}catch{kIt??=process.env.GITHUB_TOKEN??""}if(!kIt)throw new Error(`Tests: either GH_COPILOT_TOKEN, GITHUB_COPILOT_TOKEN, or GITHUB_TOKEN must be set, or there must be a GitHub token from an app with access to Copilot in ${JKi}. Run "npm run get_token" to get one.`);return{...Yy({}),accessToken:kIt,login:"copilot-client tests"}}a(eJi,"getTestingGitHubSession");var Q9c=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function q9c(t,e,r){return XKi(t),await t.get(Ft).primeToken(),["OK",null]}a(q9c,"handleTestingUseTestingTokenChecked");var tJi=xe(Q9c,q9c);p();var j9c=S.Object({});async function H9c(t,e,r){return await new kEe().uninstall(t),["OK",null]}a(H9c,"handleUninstallChecked");var rJi=xe(j9c,H9c);p();var G9c=wei;function $9c(t,e,r){let n=t.get(Em),o={unregistered:[],notUnregistered:[]};return r.providers.forEach(s=>{try{n.unregisterContextProvider(s.id),o.unregistered.push(s.id)}catch{o.notUnregistered.push(s.id)}}),[o,null]}a($9c,"unregisterContextProviders");var nJi=xe(G9c,$9c);p();var u8r=fe(require("os"));var V9c=S.Object({expectedCertificate:S.String()});async function W9c(t,e,r){let o=(await Qot(t).getAllRootCAs()).map(G_e),s=G_e(r.expectedCertificate);return o.includes(s)?[{status:!0,message:"Certificate verified"},null]:[{status:!1,message:`expected certificate not found - Expected to find certificate ${nFr(s)}. Only found those installed on the system:${u8r.EOL}${o.map(c=>"- "+nFr(c)).join(u8r.EOL)}`},null]}a(W9c,"handleVerifyCertificateChecked");var iJi=xe(V9c,W9c);p();var z9c=S.Object({});async function Y9c(){return[{status:!!await new VFe().load()},null]}a(Y9c,"handleVerifyKerberosChecked");var oJi=xe(z9c,Y9c);p();var K9c=S.Object({source:S.String(),version:S.Number(),uri:S.String()});async function J9c(t,e,r){let o=await t.get($r).getTextDocument(r);return o?o.getText()!==r.source?[{status:!1,message:`Source mismatch: [State] ${o.getText()} !== [Request] ${r.source}`},null]:o.version!==r.version?[{status:!1,message:`Version mismatch: [State] ${o.version} !== [Request] ${r.version}`},null]:[{status:!0,message:""},null]:[{status:!1,message:`Document not found: <${r.uri}>`},null]}a(J9c,"handleVerifyStateChecked");var sJi=xe(K9c,J9c);p();var Z9c=S.Object({});function X9c(t,e,r){return[t.get($r).getWorkspaceFolders().map(o=>{let s=new URL(o.uri),c=decodeURIComponent(s.pathname);return{...o,path:c}}),null]}a(X9c,"handleVerifyWorkspaceStateChecked");var aJi=xe(Z9c,X9c);p();p();var uve=fe(require("fs/promises")),cJi=fe(require("os")),of=fe(require("path"));var Lp=new pe("GitWorktreeService"),eUc=20,lve=class{constructor(e){this.ctx=e;this.gitInstances=new Cn(eUc)}static{a(this,"GitWorktreeService")}getGitInstance(e){let r=of.resolve(e),n=this.gitInstances.get(r);return n||(n=tde(r),this.gitInstances.set(r,n)),n}generateTimestamp(){return new Date().toISOString().replace(/[:.]/g,"-").slice(0,19)}async runGitOperation(e,r,n,o){let s=of.resolve(e);Lp.info(this.ctx,`[git] ${r} started for ${s}`);try{let c=await n(this.getGitInstance(s)),l=o?.(c);return Lp.info(this.ctx,`[git] ${r} finished for ${s}${l?` (${l})`:""}`),c}catch(c){let l=c instanceof Error?c.message:String(c);throw Lp.error(this.ctx,`[git] ${r} failed for ${s}: ${l}`),c}}async isGitRepository(e){try{return await this.runGitOperation(e,"checkIsRepo",r=>r.checkIsRepo(),r=>`isRepo=${r}`)}catch{return!1}}async getHeadCommit(e){return(await this.runGitOperation(e,"rev-parse HEAD",n=>n.raw(["rev-parse","HEAD"]),n=>`head=${n.trim()}`)).trim()}async commitWorktreeChanges(e,r,n){let o=await this.runGitOperation(e,"status",s=>s.status(),s=>`files=${s.files.length}`);return o.files.length===0?(Lp.info(this.ctx,`Skipping checkpoint commit for ${of.resolve(e)} because there are no changes`),!1):(await this.runGitOperation(e,"add -A -- .",s=>s.raw(["add","-A","--","."])),await this.runGitOperation(e,`commit ${r}`,s=>s.commit(r)),Lp.info(this.ctx,`Created ${n} commit for ${of.resolve(e)} with ${o.files.length} changed file(s)`),!0)}async snapshotCopiedChanges(e){Lp.info(this.ctx,`Snapshotting copied changes in ${of.resolve(e)} to establish the apply baseline`),await this.commitWorktreeChanges(e,"chore: snapshot copied worktree changes","copied worktree changes");let r=await this.getHeadCommit(e);return Lp.info(this.ctx,`Using copied-changes snapshot commit ${r} as the worktree baseCommit`),r}async applyPatchToRepository(e,r){let n=await uve.mkdtemp(of.join(cJi.tmpdir(),"copilot-worktree-")),o=of.join(n,"changes.patch");try{Lp.info(this.ctx,`Writing temporary patch for ${of.resolve(e)} to ${o} (${r.length} chars)`),await uve.writeFile(o,r,"utf8"),await this.runGitOperation(e,`apply --check ${o}`,s=>s.raw(["apply","--check",o])),await this.runGitOperation(e,`apply ${o}`,s=>s.raw(["apply",o]))}finally{await uve.rm(n,{recursive:!0,force:!0}),Lp.info(this.ctx,`Removed temporary patch file ${o}`)}}async createWorktree(e){let{repositoryPath:r}=e;if(!await this.isGitRepository(r))throw new Error(`${r} is not a git repository`);let s=(await this.runGitOperation(r,"branch",g=>g.branch(),g=>`current=${g.current||"HEAD"}`)).current||"HEAD",c=await this.getHeadCommit(r),l=this.generateTimestamp(),u=`copilot/worktree-${l}`,d=`copilot-worktree-${l}`,f=of.basename(r),h=of.join(of.dirname(r),`${f}.worktrees`),m=of.join(h,d);return Lp.info(this.ctx,`Preparing worktree creation for ${of.resolve(r)} with branch ${u}, baseBranch ${s}, baseCommit ${c}`),await this.runGitOperation(r,`worktree add -b ${u} ${m} ${s}`,g=>g.raw(["worktree","add","-b",u,m,s])),Lp.info(this.ctx,`Created worktree ${m} from ${of.resolve(r)}`),{worktreePath:m,worktreeDirName:d,branchName:u,baseBranchName:s,baseCommit:c,repositoryPath:r}}async removeWorktree(e,r){Lp.info(this.ctx,`Preparing to remove worktree ${e} from ${of.resolve(r)}`),await this.runGitOperation(r,`worktree remove --force ${e}`,n=>n.raw(["worktree","remove","--force",e])),Lp.info(this.ctx,`Removed worktree ${e}`)}async getUncommittedChanges(e){if(!await this.isGitRepository(e))return Lp.info(this.ctx,`Skipping status lookup for ${of.resolve(e)} because it is not a git repository`),[];let r=await this.runGitOperation(e,"status",n=>n.status(),n=>`files=${n.files.length}`);return[...new Set(r.files.map(n=>n.path))]}async applyWorktreeChanges(e,r,n){Lp.info(this.ctx,`Applying worktree changes from ${of.resolve(e)} to ${of.resolve(r)} using baseCommit ${n}`);let o=await this.commitWorktreeChanges(e,"chore: checkpoint worktree changes","checkpoint worktree changes");Lp.info(this.ctx,o?`Committed pending worktree changes in ${of.resolve(e)} before generating patch`:`No pending worktree changes to commit in ${of.resolve(e)}`);let s=await this.getHeadCommit(e);if(s===n)return Lp.info(this.ctx,"No new commits to apply from worktree"),{baseCommit:s};let c=await this.runGitOperation(e,`diff --binary --full-index ${n}..${s}`,l=>l.raw(["diff","--binary","--full-index",`${n}..${s}`]),l=>`outputLength=${l.length}`);if(!c.trim())return Lp.info(this.ctx,"No patch content to apply from worktree"),{baseCommit:s};try{await this.applyPatchToRepository(r,c)}catch(l){let u=l instanceof Error?l.message:String(l);throw new Error(`Failed to apply worktree patch: ${u}`)}return Lp.info(this.ctx,`Applied worktree patch from ${n} to ${s}`),{baseCommit:s}}async stash(e){await this.runGitOperation(e,"stash push --include-untracked",r=>r.stash(["push","--include-untracked"])),Lp.info(this.ctx,`Stashed changes in ${e}`)}async stashApply(e){await this.runGitOperation(e,"stash apply",r=>r.stash(["apply"])),Lp.info(this.ctx,`Applied stash in ${e}`)}async stashPop(e){await this.runGitOperation(e,"stash pop",r=>r.stash(["pop"])),Lp.info(this.ctx,`Popped stash in ${e}`)}};p();var lJi=fe(ei());var D1=new pe("WorktreeService");var tUc=new lJi.ProtocolRequestType("worktree/requestUserDecision"),WFe=class{constructor(e,r){this.ctx=e;this.gitService=r}static{a(this,"WorktreeService")}async requestUserDecision(e){let r=await this.gitService.getUncommittedChanges(e);if(r.length===0)return D1.info(this.ctx,`No uncommitted changes found in ${e}, skipping user decision prompt`),"skip";D1.info(this.ctx,`Found ${r.length} uncommitted changes, requesting user decision`);let o=await this.ctx.get(Xt).connection.sendRequest(tUc,{type:"uncommitted-changes",title:"Handle Uncommitted Changes",message:`You have ${r.length} uncommitted changes. How would you like to proceed?`,options:[{id:"copy",label:"Copy changes",description:"Copy uncommitted changes into the new worktree",recommended:!0},{id:"move",label:"Move changes",description:"Move uncommitted changes to the new worktree and clean the original"},{id:"skip",label:"Skip changes",description:"Create worktree from clean state, leave local changes untouched"},{id:"cancel",label:"Cancel",description:"Cancel worktree creation",destructive:!0}],defaultOption:"copy"});return o.cancelled?(D1.info(this.ctx,`User cancelled worktree creation for ${e}`),"cancel"):(D1.info(this.ctx,`User selected worktree migration strategy ${o.selectedOption} for ${e}`),o.selectedOption)}async createWorktree(e,r){D1.info(this.ctx,`Starting worktree creation for ${e} with strategy ${r}`);let n=r==="copy"||r==="move";n&&(D1.info(this.ctx,`Stashing original repository changes before worktree creation for ${e}`),await this.gitService.stash(e));let o;try{o=await this.gitService.createWorktree({repositoryPath:e})}catch(s){throw n&&(D1.warn(this.ctx,`Worktree creation failed for ${e}, restoring original stash`),await this.gitService.stashPop(e).catch(()=>{})),s}if(n)try{if(D1.info(this.ctx,`Migrating changes into worktree ${o.worktreePath} using strategy ${r}`),r==="copy"){await this.gitService.stashApply(o.worktreePath),await this.gitService.stashPop(e);let s=await this.gitService.snapshotCopiedChanges(o.worktreePath);o={...o,baseCommit:s},D1.info(this.ctx,`Updated worktree baseCommit to copied-changes snapshot ${s} for ${o.worktreePath}`)}else await this.gitService.stashPop(o.worktreePath);D1.info(this.ctx,`Finished migrating changes into worktree ${o.worktreePath}`)}catch(s){throw D1.warn(this.ctx,`Failed to migrate changes to worktree: ${s instanceof Error?s.message:String(s)}`),await this.gitService.stashPop(e).catch(()=>{}),s}return D1.info(this.ctx,`Completed worktree creation for ${e}; worktreePath=${o.worktreePath}, baseCommit=${o.baseCommit}`),o}async applyWorktreeChanges(e,r,n){D1.info(this.ctx,`Starting worktree apply from ${r} to ${e} with baseCommit ${n}`);let o=await this.gitService.applyWorktreeChanges(r,e,n);return D1.info(this.ctx,`Completed worktree apply from ${r} to ${e}; nextBaseCommit=${o.baseCommit}`),o}};var rUc="Failed to apply changes to the current workspace. Please stage or commit your changes in the current workspace and try again.",nUc=["already exists in working directory","patch does not apply","patch failed"];function iUc(t){let e=t instanceof Error?t.message:String(t);return e.includes("Failed to apply worktree patch:")&&nUc.some(n=>e.includes(n))?rUc:`Failed to apply worktree changes: ${e}`}a(iUc,"getWorktreeCompleteErrorMessage");var oUc=S.Object({repositoryPath:S.String()});async function sUc(t,e,r){try{let n=new lve(t),o=new WFe(t,n),s=await o.requestUserDecision(r.repositoryPath);if(s==="cancel")return[{success:!1,error:"Worktree creation cancelled by user"},null];let c=await o.createWorktree(r.repositoryPath,s);return[{success:!0,worktreePath:c.worktreePath,worktreeDirName:c.worktreeDirName,branchName:c.branchName,baseBranchName:c.baseBranchName,baseCommit:c.baseCommit},null]}catch(n){let o=n instanceof Error?n.message:String(n);return[null,{code:Xe.InternalError,message:`Failed to create worktree: ${o}`}]}}a(sUc,"handleWorktreeCreateChecked");var uJi=xe(oUc,sUc),aUc=S.Object({repositoryPath:S.String(),worktreePath:S.String(),baseCommit:S.String()});async function cUc(t,e,r){try{let n=new lve(t);return[{success:!0,baseCommit:(await new WFe(t,n).applyWorktreeChanges(r.repositoryPath,r.worktreePath,r.baseCommit)).baseCommit},null]}catch(n){return[null,{code:Xe.InternalError,message:iUc(n)}]}}a(cUc,"handleWorktreeCompleteChecked");var dJi=xe(aUc,cUc),lUc=S.Object({worktreePath:S.String(),repositoryPath:S.String()});async function uUc(t,e,r){try{return await new lve(t).removeWorktree(r.worktreePath,r.repositoryPath),[{success:!0},null]}catch(n){let o=n instanceof Error?n.message:String(n);return[null,{code:Xe.InternalError,message:`Failed to delete worktree: ${o}`}]}}a(uUc,"handleWorktreeDeleteChecked");var fJi=xe(lUc,uUc);var zie=class{constructor(e){this.handlers=e}static{a(this,"MethodHandlers")}};function pJi(){let t=new Map;return t.set(zWi.method,YWi),t.set("getCompletions",MWi),t.set("getCompletionsCycling",OWi),t.set("getDefaultFileSafetyRules",LWi),t.set("copilot/parseTerminalCommand",Pzi),t.set("getPanelCompletions",UWi),t.set(aWi.method,cWi),t.set("getVersion",qWi),t.set("getUserInfo",QWi),t.set("setEditorInfo",Kzi),t.set("checkStatus",AVi),t.set("checkQuota",gVi),t.set("checkFileStatus",hVi),t.set("claude/checkCliCompatibility",uVi),t.set("codex/checkCliCompatibility",pVi),t.set("signInInitiate",pFr),t.set("signIn",pFr),t.set("signInWithCodeFlow",oYi),t.set("signInWithDeviceFlow",cYi),t.set("signInConfirm",Jzi),t.set("signInWithGithubToken",lYi),t.set("signOut",uYi),t.set("auth/listAvailableTokens",kHi),t.set("auth/removeToken",PHi),t.set("auth/useExistingToken",DHi),t.set("notifyShown",kzi),t.set("notifyAccepted",xzi),t.set("notifyRejected",Rzi),t.set("notifyNextEditRejected",wzi),t.set("telemetry/exception",dYi),t.set("textDocument/copilotInlineEdit",Izi),t.set("testing/overrideExpFlags",PKi),t.set("testing/alwaysAuth",CFr),t.set("testing/setAlwaysAuthed",CFr),t.set("testing/neverAuth",JFr),t.set("testing/setNeverAuthed",JFr),t.set("testing/useTestingToken",tJi),t.set("testing/setCompletionDocuments",kWi),t.set("testing/setPanelCompletionDocuments",oWi),t.set("testing/setNextEditDocument",vzi),t.set("testing/triggerShowMessageRequest",MKi),t.set("testing/flushPromiseQueue",TKi),t.set("testing/getDocument",wKi),t.set("testing/chatml",fYi),t.set("testing/setSyntheticTurns",NKi),t.set("testing/fetch",SKi),t.set("testing/setContentExclusionRules",DKi),t.set("testing/getContext",xKi),t.set("uninstall",rJi),t.set("debug/diagnostics",EWi),t.set("debug/listCertificates",KWi),t.set("debug/verifyState",sJi),t.set("debug/verifyCertificate",iJi),t.set("debug/verifyKerberos",oJi),t.set("debug/verifyWorkspaceState",aJi),t.set("debug/getAgentDebugLog",SWi),t.set("debug/getAgentDebugLogPath",TWi),t.set("debug/exportAgentDebugLog",_Wi),t.set("debug/exportAgentDebugLogToPath",bWi),t.set("context/registerProviders",Vzi),t.set("context/unregisterProviders",nJi),t.set("conversation/preconditions",OVi),t.set("conversation/persistence",MVi),t.set("conversation/create",kVi),t.set("conversation/turn",UVi),t.set("conversation/turnDelete",QVi),t.set("conversation/destroy",PVi),t.set("conversation/compress",IVi),t.set("conversation/rating",LVi),t.set("conversation/copyCode",SVi),t.set("conversation/insertCode",TVi),t.set("conversation/templates",FVi),t.set("conversation/modes",DVi),t.set("conversation/agents",bVi),t.set("conversation/registerTools",BVi),t.set("conversation/unregisterTools",qVi),t.set("conversation/updateToolsStatus",jVi),t.set("conversation/notifyCodeAcceptance",NVi),t.set("customAgent/registerExtensionAgents",uWi),t.set("customAgent/unregisterExtensionAgents",dWi),t.set("copilot/customAgent/list",lWi),t.set("copilot/customSkill/list",hWi),t.set("copilot/customPrompt/list",pWi),t.set("copilot/customInstruction/list",fWi),t.set("copilot/hook/list",VWi),t.set("copilot/models",XVi),t.set("copilot/managedSettings/get",ezi),t.set("copilot/models/getModelMetadataList",eWi),t.set("copilot/byok/saveModel",lVi),t.set("copilot/byok/deleteModel",MHi),t.set("copilot/byok/listModels",sVi),t.set("copilot/byok/saveApiKey",aVi),t.set("copilot/byok/deleteApiKey",NHi),t.set("copilot/byok/listApiKeys",LHi),t.set("copilot/byok/saveCustomProviderConfig",cVi),t.set("copilot/byok/listCustomProviderConfigs",BHi),t.set("copilot/setModelPolicy",tWi),t.set("copilot/codeReview/reviewChanges",GVi),t.set("copilot/codeReview/reviewSnippets",$Vi),t.set("git/commitGenerate",jWi),t.set("thinking/generateTitle",HVi),t.set("mcp/getTools",WVi),t.set("mcp/updateToolsStatus",zVi),t.set("mcp/readResource",YVi),t.set("mcp/registry/listServers",Azi),t.set("mcp/registry/getServer",yzi),t.set("mcp/registry/getAllowlist",_zi),t.set("mcp/getPrompt",KVi),t.set("mcp/completePrompt",JVi),t.set("mcp/serverAction",ZVi),t.set("mcpGateway/listServers",szi),t.set("mcpGateway/getServerDetails",azi),t.set("mcpGateway/serverAction",czi),t.set("mcpGateway/applyConfig",ozi),t.set("plugins/list",Uzi),t.set("plugins/install",Bzi),t.set("plugins/installFromSource",Fzi),t.set("plugins/uninstall",Gzi),t.set("plugins/enable",Lzi),t.set("plugins/disable",Ozi),t.set("plugins/update",$zi),t.set("plugins/marketplace/add",Qzi),t.set("plugins/marketplace/remove",Hzi),t.set("plugins/marketplace/list",jzi),t.set("plugins/marketplace/browse",qzi),t.set("githubApi/searchPR",$Wi),t.set("githubApi/cancelCodingAgent",EVi),t.set("cloudAgent/listSessions",CVi),t.set("cloudAgent/getSessionLogs",vVi),t.set("cloudAgent/createJob",_Vi),t.set("cloudAgent/addPullRequestComment",yVi),t.set("githubApi/listPullRequestChangedFiles",HWi),t.set("worktree/create",uJi),t.set("worktree/complete",dJi),t.set("worktree/delete",fJi),t.set("backgroundAgent/create",sHi),t.set("backgroundAgent/send",xHi),t.set("backgroundAgent/truncateHistory",RHi),t.set("backgroundAgent/fork",fHi),t.set("backgroundAgent/destroy",aHi),t.set("backgroundAgent/listModels",CHi),t.set("backgroundAgent/listSessions",EHi),t.set("backgroundAgent/resume",THi),t.set("backgroundAgent/stop",wHi),t.set("backgroundAgent/interaction",gHi),t.set("backgroundAgent/enableRemote",dHi),t.set("backgroundAgent/disableRemote",lHi),t.set("backgroundAgent/getRemoteStatus",hHi),t.set("backgroundAgent/getPlanPath",pHi),t.set("backgroundAgent/compactHistory",nHi),new zie(t)}a(pJi,"getAllMethods");p();p();p();var hJi=fe(QP());var Ny=class{constructor(e){this.ctx=e}static{a(this,"AbstractNotification")}get type(){return new hJi.NotificationType(this.name)}};var dUc=new pe("BackgroundAgent.notifications"),d8r=class extends Ny{constructor(){super(...arguments);this.name="backgroundAgent/sessionUpdate";this.params=S.Object({sessionId:S.String(),event:S.Unknown()})}static{a(this,"BackgroundAgentSessionUpdateNotification")}handle(){}},f8r=class extends Ny{constructor(){super(...arguments);this.name="backgroundAgent/registerExternalTools";this.params=S.Object({sessionId:S.String(),externalToolDefinitions:FLr})}static{a(this,"BackgroundAgentRegisterExternalToolsNotification")}handle(r){dUc.info(this.ctx,"registerExternalTools received",{sessionId:r.sessionId,toolCount:r.externalToolDefinitions.length}),this.ctx.get(Gs).registerExternalTools(r.sessionId,r.externalToolDefinitions)}},mJi=[d8r,f8r];p();var p8r=class extends Ny{constructor(){super(...arguments);this.name="copilot/didChangeToken";this.params=S.Unknown()}static{a(this,"DidChangeTokenNotificationHandler")}handle(){this.ctx.get(Ft).resetToken("did_change_token_notification")}},gJi=[p8r];p();var fUc=new pe("agentCopilotTokenManager");function m8r(t){try{let e=new URL(t||"https://api.github.com");if(e.protocol==="https:"&&e.hostname.startsWith("api."))return`${e.origin}/`}catch{}}a(m8r,"tokenEndpointToApiUrl");function pUc(t,e){if(!e.tokenEndpoint)return Yy(e);let r=m8r(e.tokenEndpoint);return r||fUc.warn(t,`Invalid token endpoint URL <${e.tokenEndpoint}>`),Yy({apiUrl:r})}a(pUc,"getUrlsFromParams");var h8r=class extends Ny{constructor(){super(...arguments);this.name=Mqt.method;this.params=GCn}static{a(this,"DidChangeAuthNotificationHandler")}handle(r){let n=this.ctx.get(Mr),o=pUc(this.ctx,r);this.ctx.get(Km).setConfiguredUrls(this.ctx,o);let s=r.handle||r.login;s&&r?.accessToken?n.setTransientSession({accessToken:r.accessToken,login:s,githubAppId:r.githubAppId,...o}):n.setTransientSession({githubAppId:r.githubAppId,...o})}},AJi=[h8r];p();var g8r=class extends Ny{constructor(){super(...arguments);this.name=Qqt.method;this.params=ZCn}static{a(this,"DidShowCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],s=this.ctx.get(ku).get(n);s&&Kni(this.ctx,s)}},A8r=class extends Ny{constructor(){super(...arguments);this.name=jqt.method;this.params=nbn}static{a(this,"DidShowInlineEditNotificationHandler")}async handle(r){let n=r.item.command.arguments[0];await this.ctx.get(Yv).handleShown(n)}},y8r=class extends Ny{constructor(){super(...arguments);this.name=qqt.method;this.params=XCn}static{a(this,"DidPartiallyAcceptCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],o=r.acceptedLength,s=this.ctx.get(ku),c=s.get(n);c&&(o>=c.insertText.length?(s.delete(n),Hme(this.ctx,c)):eft(this.ctx,c,o,void 0,void 0,"cumulative"))}},yJi=[g8r,A8r,y8r];p();var DIt=class extends Ny{constructor(){super(...arguments);this.name="window/workDoneProgress/cancel";this.params=S.Object({token:S.Union([S.String(),S.Number()])})}static{a(this,"WorkDoneProgressCancelNotification")}handle(r){this.ctx.get(LN).cancel(r.token)}};p();var E8r=class extends Ny{constructor(){super(...arguments);this.name="copilot/workspace/didChangeTrust";this.params=S.Object({items:S.Array(S.Object({folderUri:S.String(),trusted:S.Boolean()}))})}static{a(this,"WorkspaceDidChangeTrustNotificationHandler")}handle(r){let n=this.ctx.get(ip);for(let o of r.items)n.setTrust(o.folderUri,o.trusted)}},EJi=[E8r];var hUc=[...mJi,...gJi,...AJi,...yJi,...EJi,DIt];function _Ji(t,e){for(let r of hUc){let n=new r(t),o=$u.Compile(n.params);e.onNotification(n.type,K0(t,async s=>{R9(s),o.Check(s)?await n.handle(s):$o.error(t,`Notification ${n.name}:`,new HA(o.Errors(s)))},`Notification ${n.name}`))}}a(_Ji,"registerNotifications");p();var vJi=fe(Fc());p();var dve=fe(Fc());var mUc=new dve.ProtocolNotificationType("copilot/customAgent/didChange"),gUc=new dve.ProtocolNotificationType("copilot/customSkill/didChange"),AUc=new dve.ProtocolNotificationType("copilot/customPrompt/didChange"),yUc=new dve.ProtocolNotificationType("copilot/customInstruction/didChange"),_8r=new dve.ProtocolNotificationType("copilot/hook/didChange");function EUc(t){switch(t){case"agent":return mUc;case"skill":return gUc;case"prompt":return AUc;case"instructions":return yUc;case"hook":return _8r;default:return}}a(EUc,"notificationTypeFor");var NIt=class extends d0{constructor(r){super();this.ctx=r;this.logger=new pe("promptChangeNotifier")}static{a(this,"CLSPromptChangeNotifier")}async notify(r){let n=EUc(r);if(!n){this.logger.debug(this.ctx,`No notification type mapped for PromptsType '${r}'; skipping.`);return}try{await this.ctx.get(Xt).connection.sendNotification(n,{})}catch(o){this.logger.debug(this.ctx,`Failed to send ${n.method}:`,o)}}};var _Uc=new vJi.ProtocolNotificationType("copilot/plugins/didChange"),Yie=class{constructor(e,r){this.ctx=e;this.logger=new pe("pluginChangeNotifier");this.subscription=r.onDidChangePlugins(()=>{this.notify()})}static{a(this,"CLSPluginChangeNotifier")}async notify(){let e;try{e=this.ctx.get(Xt).connection}catch(n){this.logger.debug(this.ctx,"Failed to resolve connection for copilot/plugins/didChange:",n);return}let r=await Promise.allSettled([e.sendNotification(_Uc,{}),e.sendNotification(_8r,{})]);for(let n of r)n.status==="rejected"&&this.logger.debug(this.ctx,"Failed to send a plugin change notification:",n.reason)}dispose(){this.subscription.dispose()}};p();p();var CJi=fe(require("crypto")),bJi=require("os");Mo();var vUc=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function CUc(t){let e=t.replace(/-/g,":").toLowerCase();return!vUc.has(e)}a(CUc,"validateMacAddress");function bUc(){let t=(0,bJi.networkInterfaces)();for(let e in t){let r=t[e];if(r){for(let{mac:n}of r)if(CUc(n))return n}}throw new Error("Unable to retrieve mac address (unexpected format)")}a(bUc,"getMac");var v8r;function SUc(){try{let t=bUc();return CJi.createHash("sha256").update(t,"utf8").digest("hex")}catch{return}}a(SUc,"getMacMachineId");function C8r(){return v8r||(v8r=SUc()||Nt()),v8r}a(C8r,"getMachineId");Mo();function b8r(t){let e=t??Nt()+Date.now();return new qa(e,C8r(),C8r())}a(b8r,"createEditorSession");var SJi=b8r();p();var MIt=fe(Fc());var S8r=new pe("AgentTextDocumentConfiguration"),T8r=class{constructor(e){this.ctx=e;this.#e=new Vi;this.onDidChange=this.#e.event}static{a(this,"AgentTextDocumentsConfiguration")}#e;create(e,r,n,o){try{return US.create(e,r,n,o)}catch(s){throw S8r.exception(this.ctx,s,".create"),s}}update(e,r,n){try{let o=[],s=US.withChanges(e,r,n);for(let l of r)if(MIt.TextDocumentContentChangeEvent.isIncremental(l)){let u=e.offsetAt(l.range.start),d=e.offsetAt(l.range.end),f={start:e.positionAt(u),end:e.positionAt(d)};for(let m of["start","end"])if(f[m].line!==l.range[m].line||f[m].character!==l.range[m].character){let g=`invalid range ${m} position ${JSON.stringify(l.range[m])}. Assuming ${JSON.stringify(f[m])}.`;S8r.warn(this.ctx,`textDocument/didChange for ${e.uri} has ${g}`);let A=Vt.createAndMarkAsIssued({message:`Received ${g}`});ft(this.ctx,`invalidRange.${m}`,A)}let h={range:f,rangeOffset:u,rangeLength:d-u,text:l.text};o.push(h),e=e.applyEdits([{range:h.range,newText:h.text}])}else{let u=e.getText().length,f={range:{start:e.positionAt(0),end:e.positionAt(u)},rangeOffset:0,rangeLength:u,text:l.text};o.push(f),e=e.applyEdits([{range:f.range,newText:f.text}])}let c={document:{uri:e.uri,version:n},contentChanges:o};return this.#e.fire(c),s}catch(o){throw S8r.exception(this.ctx,o,".update"),o}}},oW=class extends $r{constructor(){super(...arguments);this.#e=new Vi;this.onDidOpenTextDocument=this.#e.event;this.#t=new Vi;this.onDidCloseTextDocument=this.#t.event;this.#r=new Vi;this.onDidFocusTextDocument=this.#r.event;this._textDocumentConfiguration=new T8r(this.ctx);this.onDidChangeTextDocument=this._textDocumentConfiguration.onDidChange;this._documents=new Map;this._notebookDocuments=new MIt.NotebookDocuments(this._textDocumentConfiguration);this.workspaceFolders=[];this.#n=new Vi;this.onDidChangeWorkspaceFolders=this.#n.event}static{a(this,"AgentTextDocumentManager")}#e;#t;#r;#n;get connection(){return this.ctx.get(Xt).connection}init(r){this.connection.onDidOpenTextDocument(o=>{let s=o.textDocument,c=this._textDocumentConfiguration.create(s.uri,s.languageId,s.version,s.text);this._documents.set(Fs(s.uri),c),this.#e.fire({document:{...s,uri:c.uri}})}),this.connection.onDidChangeTextDocument(o=>{let s=o.textDocument,c=o.contentChanges,{version:l}=s;if(l==null)throw new Error(`Received document change event for ${s.uri} without valid version identifier`);let u=Fs(s.uri),d=this._documents.get(u);d!==void 0&&(d=this._textDocumentConfiguration.update(d,c,l),this._documents.set(u,d))}),this.connection.onDidCloseTextDocument(o=>{let s=Fs(o.textDocument.uri);this._documents.delete(s),this.#t.fire({document:{uri:s}})}),this.connection.onNotification(Bqt.type,o=>{let s=("textDocument"in o?o.textDocument:o)??{};this.#r.fire("uri"in s?{document:s}:{})}),this._notebookDocuments.listen(this.connection),this.workspaceFolders.length=0;let n=this.ctx.get(ip);for(let o of r){let s=o.trusted;typeof s=="boolean"&&n.setTrust(o.uri,s)}this.workspaceFolders.push(...r),r.length>0&&this.#n.fire({workspaceFolders:this.workspaceFolders,added:r,removed:[]})}didChangeWorkspaceFolders(r){r.added.forEach(n=>this.registerWorkspaceFolder(n)),r.removed.forEach(n=>this.unregisterWorkspaceFolder(n)),this.#n.fire({workspaceFolders:this.workspaceFolders,added:r.added,removed:r.removed})}unregisterWorkspaceFolder(r){let n=this.workspaceFolders.findIndex(o=>o.uri===r.uri);n>=0&&this.workspaceFolders.splice(n,1),this.ctx.get(ip).forget(r.uri)}registerWorkspaceFolder(r){let n=r.trusted;typeof n=="boolean"&&this.ctx.get(ip).setTrust(r.uri,n),!this.workspaceFolders.find(o=>o.uri===r.uri)&&this.workspaceFolders.push(r)}getTextDocumentsUnsafe(){return[...this._documents.values()]}getTextDocumentUnsafe(r){return this._documents.get(Fs(r.uri))}getWorkspaceFolders(){return this.workspaceFolders}findNotebook(r){let n=this._notebookDocuments.findNotebookDocumentForCell(r.uri);if(n)return{getCells:a(()=>n.cells.map((o,s)=>this.wrapCell(o,s)).filter(o=>!!o),"getCells"),getCellFor:a(({uri:o})=>{let s=n.cells.findIndex(c=>c.document===o);return s!==-1?this.wrapCell(n.cells[s],s):void 0},"getCellFor")}}wrapCell(r,n){let o=this._notebookDocuments.getCellTextDocument(r);if(o)return{kind:r.kind,metadata:r.metadata??{},index:n,document:o}}};var TJi=$u.Compile(YCn);function R9(t){if(t!==null){if(Array.isArray(t))for(let e=0;e{try{if(this.#r?.workspace?.configuration&&e&&typeof e=="object"&&!("settings"in e)){let n=await this.connection.workspace.getConfiguration(IJi.map(s=>({section:s}))),o={github:{copilot:n.shift()}};for(let s of NFe)o[s]=n.shift();e.settings=o}if(e&&typeof e=="object"&&"settings"in e)try{this.ctx.get(kO).handleConfigurationChange(e.settings)}catch(n){$o.exception(this.ctx,n,"EncodingConfigurationService.handleConfigurationChange")}return VTt(this.ctx,R9(e))}catch(r){$o.exception(this.ctx,r,"didChangeConfiguration")}},"handleDidChangeConfiguration");this.#n=this.ctx.get(Vf)}static{a(this,"Service")}#e;#t;#r;#n;get clientCapabilities(){return this.#r}isWorkspaceTrustGateEnabled(){return this.#r?.experimental?.workspaceTrustGate===!0}listen(){let e=this.ctx,r=this.connection;r.onRequest(this.messageHandler.bind(this)),_Ji(e,r);let n={name:"GitHub Copilot Language Server",version:e.get(us).getDisplayVersion(),nodeVersion:process.versions.node};function o(c){try{e.get(oW).didChangeWorkspaceFolders(c)}catch(l){$o.exception(e,l,"didChangeWorkspaceFolders")}}a(o,"didChangeWorkspaceFolders"),this.connection.onNotification("vs/didAddWorkspaceFolder",({name:c,uri:l})=>o({added:[{uri:l,name:c??l}],removed:[]})),this.connection.onNotification("vs/didRemoveWorkspaceFolder",({name:c,uri:l})=>o({added:[],removed:[{uri:l,name:c??l}]})),r.onInitialize(c=>{if(this.initialized)throw new Error("initialize request sent after initialized notification");this.#r=c.capabilities,e.get(ip).setCapabilityEnabled(this.isWorkspaceTrustGateEnabled());let l=c.capabilities.copilot,u=R9(c.initializationOptions);if(u){if(!TJi.Check(u))throw new HA(TJi.Errors(u));let m=u,g=e.get(Ir);m.editorPluginInfo?g.setEditorAndPluginInfo({version:"unknown",...m.editorPluginInfo},m.editorInfo&&{version:"unknown",...m.editorInfo},m.relatedPluginInfo??[]):$o.warn(e,"editorInfo and editorPluginInfo will soon be required in initializationOptions. This will replace setEditorInfo."),m.copilotIntegrationId&&g.setCopilotIntegrationId(m.copilotIntegrationId),m.githubAppId&&(e.get(Jp).githubAppId=m.githubAppId),m.copilotCapabilities&&(l=m.copilotCapabilities),m.sessionId&&e.forceSet(qa,b8r(m.sessionId))}let d=c.capabilities.workspace?.workspaceFolders??!1;e.get(oW).init(c.workspaceFolders??[]),lei(this.ctx),l&&(e.get(kn).setCapabilities(l),l.contentProvider&&ua.registerSchemes(l.contentProvider),"openURL"in l&&tft(e,["The openURL Copilot capability has been removed in favor of window/showDocument."]));let h=a(async()=>{this.initialized||(this.initialized=!0,$o.info(e,`${n.name} ${n.version} initialized`),e.get(Ft).primeToken().catch(m=>{e.get(Ss).setErrorV2("auth",{message:`Failed while initializing: ${m}`,askToReSignin:!1,result:{status:"NotSignedIn"}})}),d&&r.workspace.onDidChangeWorkspaceFolders(o),c.capabilities.workspace?.didChangeConfiguration?.dynamicRegistration&&await r.client.register(PI.DidChangeConfigurationNotification.type,{section:IJi}),c.capabilities.workspace?.configuration?await this.handleDidChangeConfiguration({}):await Promise.race([this.ctx.get(ob).requireReady().then(()=>!0),new Promise(A=>setTimeout(()=>A(!1),200))])||$Tt(e),!this.deactivated&&(this.activationEmitter.fire(),e.get(Ss).sendInitNonAuthStatus(),new kEe().startup(e).catch(()=>{})))},"onInitialized");return r.onInitialized(K0(e,h,"onInitialized")),e.get(PN).init(),l?.token&&e.get(Mr).setTransientSession({}),l?.redirectedTelemetry&&Nji(e),xJi.lt(process.versions.node,"22.0.0")&&$o.warn(e,`Node.js ${process.versions.node} support is deprecated. Please upgrade to Node.js 22 or newer.`),{capabilities:{textDocumentSync:{openClose:!0,change:PI.TextDocumentSyncKind.Incremental},notebookDocumentSync:{notebookSelector:[{notebook:"*"}]},workspace:{workspaceFolders:{supported:d,changeNotifications:d}},executeCommandProvider:{commands:Rji(e,r)},inlineCompletionProvider:{}},serverInfo:n}}),r.onShutdown(async()=>{await(this.#e??=this.deactivate())}),r.onExit(()=>{this.onExit()}),r.onDidChangeConfiguration(c=>{this.handleDidChangeConfiguration(c)}),r.listen();let s=new $1t;this.ctx.forceSet(Vf,s)}telemetryMethodFailure(e,r){let n=e.replaceAll("/",".");ng(this.ctx,"lsp.method.failure",r,{method:n})}async messageHandler(e,r,n){let o=this.ctx.get(zie).handlers.get(e);if(!o)return new PI.ResponseError(Xe.MethodNotFound,`Method not found: ${e}`);if(!this.initialized)return new PI.ResponseError(Xe.ServerNotInitialized,"Agent service not initialized.");if(this.#e)return new PI.ResponseError(Xe.InvalidRequest,"Agent service shut down.");if(e!=="setEditorInfo"&&!this.ctx.get(Ir).isEditorPluginInfoKnown())throw new PI.ResponseError(Xe.ServerNotInitialized,"editorInfo and editorPluginInfo not set in initializationOptions");Array.isArray(r)&&(r=r[0]),R9(r);try{let[s,c]=await o(this.ctx,n,r);return c?new PI.ResponseError(c.code,c.message,c.data):s}catch(s){if(n.isCancellationRequested)return new PI.ResponseError(Xe.RequestCancelled,"Request was canceled");if(s instanceof yi)return this.telemetryMethodFailure(e,s),new PI.ResponseError(Xe.NoCopilotToken,`Not authenticated: ${s.message}`);throw s instanceof PI.ResponseError||$o.exception(this.ctx,s,`Request ${e}`),this.telemetryMethodFailure(e,s),s}}async onExit(){return this.#t??=this.doExit()}async doExit(){try{this.ctx.get(rK).stop()}catch(e){$o.exception(this.ctx,e,"failed to stop perf monitor")}try{this.ctx.get(IF).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose ripgrep process manager")}try{this.ctx.get(S8).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose plugin contribution injector")}try{this.ctx.get(Yie).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose plugin change notifier")}try{this.ctx.get(pie).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose MCP project cleanup subscription")}try{this.ctx.get(ny).dispose().catch(e=>{$o.exception(this.ctx,e,"failed to dispose MCP server manager")})}catch(e){$o.exception(this.ctx,e,"failed to dispose MCP server manager")}try{this.ctx.get(QH).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose MCP gateway service")}try{this.ctx.get(l2).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose workspace chunk search service")}try{this.ctx.get(w8).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose Claude Code agent service")}try{this.ctx.get(dc).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose agent plugin service")}this.ctx.get(Gs).shutdown().catch(e=>{$o.exception(this.ctx,e,"failed to shutdown background agent service")});try{this.ctx.get(pg).dispose()}catch(e){$o.exception(this.ctx,e,"failed to dispose prompt service")}this.ctx.forceSet(Vf,this.#n),await(this.#e??=this.deactivate())}markDeactivated(){this.deactivated||(this.deactivated=!0,this.deactivationEmitter.fire(),this.ctx.get(ob).markReady())}async deactivate(){let e=this.ctx;this.markDeactivated(),Jhr(e),await Promise.race([new Promise(r=>setTimeout(r,100).unref()),e.get(Dd).flush()]),await Promise.race([new Promise(r=>setTimeout(r,1800).unref()),e.get(tg).deactivate()])}dispose(){this.markDeactivated(),this.connection.dispose()}},$o=new pe("lsp");var Jv=class{constructor(e,r,n){this.ctx=e;this.skillId=r;this.requestType=new wJi.ProtocolRequestType("conversation/context");this.typeCheck=$u.Compile(n)}static{a(this,"AgentSkillResolver")}async resolveSkill(e){let r=this.ctx.get(Xt).connection,n={conversationId:e.conversation.id,turnId:e.turn.id,skillId:this.skillId},o;try{let s=await r.sendRequest(this.requestType,n),[c,l]=s;if(l){let u=new RJi.ResponseError(l.code,l.message,l.data);ot.error(this.ctx,`ResponseError while resolving skill ${this.skillId}`,u);return}o=c}catch(s){ot.error(this.ctx,`Error while resolving skill ${this.skillId}`,s);return}if(o!=null){if(!this.typeCheck.Check(o))throw new HA(this.typeCheck.Errors(o));return o}}};var I8r=class{constructor(e,r,n="",o="",s=[],c=[]){this.progressToken=e;this.chunks=r;this.followUp=n;this.suggestedTitle=o;this.skills=s;this.references=c}static{a(this,"SyntheticTurn")}},K9=class{constructor(){this.turns=[]}static{a(this,"SyntheticTurns")}add(e,r,n="",o="",s=[],c=[]){let l=new I8r(e,r,n,o,s,c);return this.turns.push(l),l}get(e){return this.turns.find(r=>r.progressToken===e)}},OIt=class{constructor(e,r){this.turnContext=e;this.syntheticTurn=r;this.conversationProgress=e.ctx.get(wc)}static{a(this,"SyntheticTurnProcessor")}async process(e,r){try{await this.processWithSyntheticTurns(this.syntheticTurn,e,r)}catch(n){ot.error(this.turnContext.ctx,`Error processing turn ${this.turnContext.turn.id}`,n);let o=n.message;this.turnContext.turn.status="error",this.turnContext.turn.response={message:o,type:"meta"},await this.conversationProgress.end(this.turnContext.conversation,this.turnContext.turn,{error:{message:o,responseIsIncomplete:!0}})}}async processWithSyntheticTurns(e,r,n){await this.conversationProgress.begin(this.turnContext.conversation,this.turnContext.turn,r),await this.resolveSyntheticSkill(e,n),await this.processSyntheticChunks(e,n),await this.endSyntheticProgress(e,n),this.turnContext.turn.response={type:"model",message:e.chunks.join("")},this.turnContext.turn.status=n.isCancellationRequested?"cancelled":"success"}async resolveSyntheticSkill(e,r){let n=this.turnContext.ctx.get(zo).getCapabilities(this.turnContext.conversation.id),o=e.skills.filter(s=>n.skills.includes(s));for(let s of o){let l=await new Jv(this.turnContext.ctx,s,S.Object({value:S.String()})).resolveSkill(this.turnContext);l&&!r.isCancellationRequested&&await this.conversationProgress.report(this.turnContext.conversation,this.turnContext.turn,{reply:l.value})}}async processSyntheticChunks(e,r){for(let n of e.chunks)r.isCancellationRequested||(await this.conversationProgress.report(this.turnContext.conversation,this.turnContext.turn,{reply:n}),await MC(1))}async endSyntheticProgress(e,r){r.isCancellationRequested?await this.conversationProgress.cancel(this.turnContext.conversation,this.turnContext.turn):await this.conversationProgress.end(this.turnContext.conversation,this.turnContext.turn,{followUp:{message:e.followUp,type:"followup",id:Nt()},suggestedTitle:e.suggestedTitle,updatedDocuments:this.turnContext.conversation.source==="inline"?[{uri:"fakeUpdatedDoc.ts",text:"fake"}]:void 0})}};var BN=class{static{a(this,"TurnProcessorFactory")}async createProcessor(e,r,n){let o=e.ctx.get(K9).get(r);if(o)return new OIt(e,o);let c=(await aw(e.ctx)).find(u=>u.slug===e.turn.agent?.agentSlug);if(c?.turnProcessor)return c.turnProcessor(e);let l;return e.conversation.source==="inline"?l=new QJe(e.ctx):l=new Rue(e.ctx),n!==void 0&&(l.computeSuggestions=n),e.turn.chatMode?.kind==="Agent"||e.turn.chatMode?.kind==="InlineAgent"?new fke(e,l):e.turn.chatMode?.kind==="Ask"&&e.conversation.source!=="inline"?new fke(e,l):new int(e,l)}};p();var sW=class extends j_{constructor(r){super(r);this.connection=null;this.capabilities={readTextFile:!1,writeTextFile:!1};this.currentSessionId=null}static{a(this,"ACPClientToolInvoker")}setACPContext(r,n,o){this.connection=r,this.capabilities=n,this.currentSessionId=o}clearACPContext(){this.currentSessionId=null}async invokeClientTool(r,n){if(!this.connection||!this.currentSessionId)return this.errorResult("ACP connection not available for tool invocation");switch(n.name){case"create_file":return this.handleCreateFile(n.input,n.toolCallId);case"insert_edit_into_file":return this.handleEditFile(n.input,n.toolCallId);default:return this.errorResult(`Tool ${n.name} is not supported in ACP mode`)}}async handleCreateFile(r,n){if(!this.capabilities.writeTextFile)return this.errorResult("Client does not support file writing");if(!r?.filePath||r.content===void 0)return this.errorResult("create_file requires filePath and content");try{let o=r.content;return await this.connection.writeTextFile({sessionId:this.currentSessionId,path:r.filePath,content:o}),await this.sendDiffUpdate(n,r.filePath,null,o),this.successResult(`Successfully created file: ${r.filePath}`)}catch(o){return this.errorResult(`Failed to create file ${r.filePath}: ${String(o)}`)}}async handleEditFile(r,n){if(!this.capabilities.writeTextFile)return this.errorResult("Client does not support file writing");if(!r?.filePath||r.code===void 0)return this.errorResult("insert_edit_into_file requires filePath and code");try{let o=null;if(this.capabilities.readTextFile)try{o=(await this.connection.readTextFile({sessionId:this.currentSessionId,path:r.filePath})).content}catch{}let s=r.code.replace(/\r\n/g,` +`);return await this.connection.writeTextFile({sessionId:this.currentSessionId,path:r.filePath,content:s}),await this.sendDiffUpdate(n,r.filePath,o,s),this.successResult(`Successfully edited file: ${r.filePath}`)}catch(o){return this.errorResult(`Failed to edit file ${r.filePath}: ${String(o)}`)}}async sendDiffUpdate(r,n,o,s){await this.connection.sessionUpdate({sessionId:this.currentSessionId,update:{sessionUpdate:"tool_call_update",toolCallId:r,content:[{type:"diff",path:n,oldText:o,newText:s}]}})}successResult(r){return new Fr([new Pr(r)],"success")}errorResult(r){return new Fr([new Pr(r)],"error")}};p();function TUc(t){switch(t){case"read_file":case"list_dir":case"get_errors":return"read";case"insert_edit_into_file":case"create_file":case"replace_string_in_file":return"edit";case"semantic_search":case"file_search":case"grep_search":return"search";case"run_in_terminal":case"run_subagent":return"execute";case"update_user_preferences":case"validate_cves":default:return"other"}}a(TUc,"mapToolNameToKind");function IUc(t,e){if(!e)return;let r=[];switch(t){case"read_file":case"insert_edit_into_file":case"create_file":case"replace_string_in_file":{let n=e.filePath;if(n){let o=e.startLine;r.push({path:n,line:o??void 0})}break}case"list_dir":{let n=e.path;n&&r.push({path:n});break}case"get_errors":{let n=e.filePaths;if(n&&Array.isArray(n))for(let o of n)r.push({path:o});break}}return r.length>0?r:void 0}a(IUc,"extractLocationsFromInput");function xUc(t){switch(t){case"not started":return"pending";case"running":return"in_progress";case"completed":return"completed";case"error":case"cancelled":return"failed";default:return"pending"}}a(xUc,"mapToolCallStatus");var LIt=class{constructor(e,r){this.connection=e;this.sessionId=r;this.activeToolCalls=new Map;this.messageChunkBuffer=""}static{a(this,"ACPProgressReporter")}async begin(e,r,n,o){}async report(e,r,n,o){if(o.reply&&await this.reportTextChunk(o.reply),o.editAgentRounds){for(let s of o.editAgentRounds)if(s.reply&&await this.reportTextChunk(s.reply),s.toolCalls)for(let c of s.toolCalls){let l=xUc(c.status),u=!this.activeToolCalls.has(c.id);if(u&&(c.status==="running"||c.status==="not started")){let d=IUc(c.name,c.input);await this.reportToolCallStart(c.id,c.name,TUc(c.name),l,c.input,d)}else c.status==="completed"?await this.reportToolCallComplete(c.id):c.status==="error"?await this.reportToolCallError(c.id,c.error||"Unknown error"):c.status==="cancelled"?await this.reportToolCallCancelled(c.id):u||await this.reportToolCallProgress(c.id,l)}}}async end(e,r,n,o){if(o?.error&&await this.reportTextChunk(` Error: ${o.error.message}`),this.messageChunkBuffer===""&&n.response?.message){let s=typeof n.response.message=="string"?n.response.message:JSON.stringify(n.response.message);await this.reportTextChunk(s)}await this.complete()}async cancel(e,r,n,o){o&&await this.reportTextChunk(` -Cancelled: ${o.message}`),await this.complete()}async reportTextChunk(e){this.messageChunkBuffer+=e,await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"agent_message_chunk",content:{type:"text",text:e}}})}async reportToolCallStart(e,r,n="other",o="pending",s,c){let l={toolCallId:e,title:r,kind:n,status:o};this.activeToolCalls.set(e,l),await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"tool_call",toolCallId:e,title:r,kind:n,status:o,rawInput:s,locations:c}})}async reportToolCallProgress(e,r="in_progress",n){let o=this.activeToolCalls.get(e);o&&(o.status=r,await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"tool_call_update",toolCallId:e,status:r,content:n}}))}async reportToolCallComplete(e,r){let n=this.activeToolCalls.get(e);n&&(n.status="completed",await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"tool_call_update",toolCallId:e,status:"completed",content:r}}),this.activeToolCalls.delete(e))}async reportToolCallError(e,r){let n=this.activeToolCalls.get(e);n&&(n.status="failed",await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"tool_call_update",toolCallId:e,status:"failed",content:[{type:"content",content:{type:"text",text:r}}]}}),this.activeToolCalls.delete(e))}async reportToolCallCancelled(e){let r=this.activeToolCalls.get(e);r&&(r.status="failed",await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"tool_call_update",toolCallId:e,status:"failed",content:[{type:"content",content:{type:"text",text:"Cancelled"}}]}}),this.activeToolCalls.delete(e))}async complete(){for(let[e]of this.activeToolCalls)await this.reportToolCallComplete(e)}};p();async function pIt(t){try{if((await t.get(Ur).checkAndUpdateStatus()).status==="OK")return;let n=await STt(t,(o,s)=>new DN(o,DN.providerId,s,void 0));if(n.status!=="OK"&&n.status!=="MaybeOK")throw new fo(Ze.CodeFlowFailed,`Authentication failed: ${n.status}`)}catch(e){throw e instanceof FU?new fo(Ze.CodeFlowFailed,`OAuth code flow requires a browser but none is available: ${e.message}`):e instanceof yi?new fo(Ze.CodeFlowFailed,`Authentication failed: ${e.message}`):e}}a(pIt,"performACPGitHubOAuth");function hIt(t){if(t!=="github_oauth")throw new fo(Ze.InvalidParams,`Unknown authentication method: ${t}`)}a(hIt,"validateAuthMethodId");async function mIt(t){let r=await t.get(Ur).checkAndUpdateStatus({localChecksOnly:!0});if(r.status!=="OK"&&r.status!=="MaybeOK")throw fo.authRequired()}a(mIt,"requireACPAuthenticated");var PYi=[{id:Cl.Ask.id,name:Cl.Ask.name,description:Cl.Ask.description},{id:Cl.Agent.id,name:Cl.Agent.name,description:Cl.Agent.description}],gIt=class{constructor(e,r){this.connection=e;this.ctx=r;this.sessions=new Map;this.clientCapabilities={readTextFile:!1,writeTextFile:!1}}static{a(this,"CopilotACPAgent")}initialize(e){if(e.clientInfo){let o=this.ctx.get(Ir);o instanceof ij&&o.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}At(this.ctx,"acp.initialize");let r=e.clientCapabilities?.fs;r&&(this.clientCapabilities={readTextFile:r.readTextFile??!1,writeTextFile:r.writeTextFile??!1});let n=[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}];return Promise.resolve({protocolVersion:Crt,agentCapabilities:{loadSession:!1,promptCapabilities:{audio:!1,embeddedContext:!0,image:!1}},agentInfo:{name:"GitHub Copilot",version:V1(this.ctx)},authMethods:n})}async newSession(e){At(this.ctx,"acp.newSession"),await this.requireAuthenticated();let r=Mt(),n=Mt(),s=this.ctx.get(zo).create({source:"panel",conversationId:n}),c=e.cwd?{uri:Ks(e.cwd)}:null,l=this.getAvailableModes(),u=this.getDefaultModeId(),{availableModels:d,defaultModelId:f}=await this.getAvailableModels(),h=f;return this.sessions.set(r,{conversationId:n,conversation:s,pendingPrompt:null,cancellationTokenSource:null,workspaceFolder:c,currentModeId:u,currentModelId:h}),{sessionId:r,modes:{currentModeId:u,availableModes:l},models:{currentModelId:h,availableModels:d}}}async authenticate(e){return At(this.ctx,"acp.authenticate"),hIt(e.methodId),await pIt(this.ctx),{}}async requireAuthenticated(){await mIt(this.ctx)}async prompt(e){At(this.ctx,"acp.prompt"),await this.requireAuthenticated();let r=this.sessions.get(e.sessionId);if(!r)throw new Error(`Session ${e.sessionId} not found`);let n=process.env.GITHUB_COPILOT_ACP_MODEL_ID??r.currentModelId;r.pendingPrompt?.abort(),r.cancellationTokenSource?.cancel(),r.pendingPrompt=new AbortController,r.cancellationTokenSource=new Fn.CancellationTokenSource,r.pendingPrompt.signal.addEventListener("abort",()=>{r.cancellationTokenSource?.cancel()});try{let s={message:this.extractTextFromPrompt(e.prompt),type:"user"},c=Mt(),l=new Xf(s,c),u=r.currentModeId===Cl.Ask.id?Cl.Ask:Cl.Agent;l.chatMode=u,l.userRequestedModel=n;let d=this.extractReferencesFromPrompt(e.prompt),f=this.ctx.get(zo),h=r.workspaceFolder?[{uri:r.workspaceFolder.uri,name:""}]:void 0;await f.addTurn(r.conversation.id,l,d,void 0,r.workspaceFolder??void 0,h);let m=new fIt(this.connection,e.sessionId),g=new hw(this.ctx,r.conversation,l,r.cancellationTokenSource.token),A=this.ctx.get(F_);A instanceof zV&&A.setACPContext(this.connection,this.clientCapabilities,e.sessionId);let E=await this.ctx.get(RN).createProcessor(g,e.sessionId);try{await E.process(m,r.cancellationTokenSource.token,void 0,void 0,{id:n})}finally{A instanceof zV&&A.clearACPContext()}return r.pendingPrompt=null,r.cancellationTokenSource=null,{stopReason:"end_turn"}}catch(o){let s=this.ctx.get(F_);if(s instanceof zV&&s.clearACPContext(),r.pendingPrompt?.signal.aborted)return{stopReason:"cancelled"};throw o}}cancel(e){At(this.ctx,"acp.cancel");let r=this.sessions.get(e.sessionId);return r?.pendingPrompt?.abort(),r?.cancellationTokenSource?.cancel(),Promise.resolve()}async setSessionMode(e){At(this.ctx,"acp.setSessionMode");let r=this.sessions.get(e.sessionId);if(!r)throw new fo(Ze.InvalidParams,`Session ${e.sessionId} not found`);let n=this.getAvailableModes();if(!n.some(s=>s.id===e.modeId))throw new fo(Ze.InvalidParams,`Mode '${e.modeId}' is not available. Available modes: ${n.map(s=>s.id).join(", ")}`);return r.currentModeId=e.modeId,Promise.resolve({})}async unstable_setSessionModel(e){At(this.ctx,"acp.setSessionModel");let r=this.sessions.get(e.sessionId);if(!r)throw new fo(Ze.InvalidParams,`Session ${e.sessionId} not found`);let{availableModels:n}=await this.getAvailableModels();if(!n.some(s=>s.modelId===e.modelId))throw new fo(Ze.InvalidParams,`Model '${e.modelId}' is not available. Available models: ${n.map(s=>s.modelId).join(", ")}`);return r.currentModelId=e.modelId,{}}isAgentModeEnabled(){return rx(this.ctx)?.getTokenValue("agent_mode")!=="0"}getAvailableModes(){return this.isAgentModeEnabled()?PYi:PYi.filter(e=>e.id===Cl.Ask.id)}getDefaultModeId(){return this.isAgentModeEnabled()?Cl.Agent.id:Cl.Ask.id}async getAvailableModels(){let e=await this.ctx.get(xs).getMetadata(),r=[],n=V_;r.push({modelId:V_,name:"Auto",description:"Automatically selects the best model for the task"});for(let o of e)o.model_picker_enabled&&o.capabilities.type==="chat"&&this.isModelCompatibleWithAgentMode(o)&&r.push({modelId:o.id,name:o.name,description:this.getModelDescription(o)});return{availableModels:r,defaultModelId:n}}isModelCompatibleWithAgentMode(e){return!(sle.has(e.capabilities.family)||!e.capabilities.supports?.tool_calls||(e.capabilities.limits?.max_prompt_tokens??0)<4e4)}getModelDescription(e){let r=e.billing?.multiplier;if(r!==void 0)return`${r}x`}extractTextFromPrompt(e){return e.filter(r=>r.type==="text").map(r=>r.text).join(` -`)}extractReferencesFromPrompt(e){let r=[];for(let n of e)if(n.type==="resource_link"){let o=n;r.push({type:"file",uri:o.uri})}else if(n.type==="resource"){let o=n;o.resource?.uri&&r.push({type:"file",uri:o.resource.uri})}return r}getFileSystemCapabilities(){return this.clientCapabilities}getConnection(){return this.connection}};p();var DYi=require("node:child_process"),yIt=require("node:stream");var AIt=class{constructor(e,r){this.cliInfo=e;this.ctx=r;this.cliProcess=null;this._cliConnection=null;this.disposed=!1}static{a(this,"CLIProcessManager")}start(e,r){if(this.disposed)throw new Error("CLIProcessManager has been disposed");if(this.cliProcess)throw new Error("CLI process is already running");let n={...process.env,COPILOT_AUTO_UPDATE:"false"};r&&(n.GH_TOKEN=r);let o=[...this.cliInfo.args,"--acp","--stdio"];if(this.cliProcess=(0,DYi.spawn)(this.cliInfo.path,o,{stdio:["pipe","pipe","inherit"],env:n,shell:H9t}),!this.cliProcess.stdin||!this.cliProcess.stdout)throw new Error("Failed to start Copilot CLI process with piped stdio");this.cliProcess.on("error",u=>{Vn(this.ctx,"acp.cli.process.error",u)}),this.cliProcess.on("exit",(u,d)=>{this.disposed||At(this.ctx,"acp.cli.process.exit",{exitCode:String(u??""),exitSignal:d??""}),this.cliProcess=null});let s=yIt.Writable.toWeb(this.cliProcess.stdin),c=yIt.Readable.toWeb(this.cliProcess.stdout),l=GRe(s,c);return this._cliConnection=new wrt(e,l),this._cliConnection}get connection(){return this._cliConnection}get isRunning(){return this.cliProcess!==null&&this.cliProcess.exitCode===null}async kill(){await this.terminateProcess()}async dispose(){this.disposed=!0,await this.terminateProcess()}async terminateProcess(){if(this.cliProcess){try{this.cliProcess.stdin?.end(),this.cliProcess.kill("SIGTERM")}catch{}await new Promise(e=>{if(!this.cliProcess){e();return}let r=setTimeout(()=>{this.cliProcess?.kill("SIGKILL"),e()},3e3);this.cliProcess.once("exit",()=>{clearTimeout(r),e()})}),this.cliProcess=null}this._cliConnection=null}};p();var EIt=class{constructor(e,r,n){this.externalConnection=e;this.ctx=r;this.cliProcessManager=n;this.cliConnection=null;this.initParams=null;this.ensureCLIPromise=null}static{a(this,"CLIProxyAgent")}initialize(e){if(e.clientInfo){let r=this.ctx.get(Ir);r instanceof ij&&r.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}return At(this.ctx,"acp.cli.initialize"),this.initParams=e,Promise.resolve({protocolVersion:Crt,agentCapabilities:{loadSession:!0,sessionCapabilities:{list:{}},mcpCapabilities:{http:!0,sse:!0},promptCapabilities:{audio:!1,embeddedContext:!0,image:!0}},agentInfo:{name:"GitHub Copilot",version:V1(this.ctx)},authMethods:[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}]})}async authenticate(e){return At(this.ctx,"acp.cli.authenticate"),hIt(e.methodId),await pIt(this.ctx),{}}async newSession(e){return At(this.ctx,"acp.cli.newSession"),await this.requireAuthenticated(),(await this.ensureCLI()).newSession(e)}async prompt(e){return At(this.ctx,"acp.cli.prompt"),await this.requireAuthenticated(),(await this.ensureCLI()).prompt(e)}async cancel(e){return At(this.ctx,"acp.cli.cancel"),(await this.ensureCLI()).cancel(e)}async setSessionMode(e){return At(this.ctx,"acp.cli.setSessionMode"),(await this.ensureCLI()).setSessionMode(e)}async unstable_setSessionModel(e){return At(this.ctx,"acp.cli.setSessionModel"),(await this.ensureCLI()).unstable_setSessionModel(e)}async setSessionConfigOption(e){return At(this.ctx,"acp.cli.setSessionConfigOption"),(await this.ensureCLI()).setSessionConfigOption(e)}async loadSession(e){return At(this.ctx,"acp.cli.loadSession"),await this.requireAuthenticated(),(await this.ensureCLI()).loadSession(e)}async listSessions(e){return At(this.ctx,"acp.cli.listSessions"),await this.requireAuthenticated(),(await this.ensureCLI()).listSessions(e)}async ensureCLI(){if(this.cliConnection)return this.cliConnection;if(!this.initParams)throw new fo(Ze.InternalError,"CLI connection not initialized. Call initialize() first.");if(this.ensureCLIPromise)return this.ensureCLIPromise;this.ensureCLIPromise=this.spawnAndInitializeCLI();try{return await this.ensureCLIPromise}finally{this.ensureCLIPromise=null}}async spawnAndInitializeCLI(){try{let r=(await this.ctx.get(Qt).getGitHubSession())?.accessToken;this.cliConnection=this.cliProcessManager.start(u=>this.createCLIClientHandler(),r);let n=this.initParams.clientInfo,o={name:"GitHub Copilot Language Server",version:V1(this.ctx)},s=n?{...n,_meta:{...n._meta??{},proxyClientInfo:o}}:o,c=this.cliConnection.initialize({protocolVersion:this.initParams.protocolVersion,clientCapabilities:this.initParams.clientCapabilities,clientInfo:s}),l=this.cliConnection.closed.then(()=>{throw new Error("CLI connection closed before initialize response was received")});l.catch(()=>{}),await Promise.race([c,l]),At(this.ctx,"acp.cli.handshake",{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source})}catch(e){throw Vn(this.ctx,"acp.cli.handshake.error",e,{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source}),this.cliConnection=null,await this.cliProcessManager.kill(),new fo(Ze.InternalError,`Failed to initialize Copilot CLI: ${e instanceof Error?e.message:String(e)}`)}return this.cliConnection}async requireAuthenticated(){await mIt(this.ctx)}createCLIClientHandler(){return{sessionUpdate:a(async e=>{await this.externalConnection.sessionUpdate(e)},"sessionUpdate"),requestPermission:a(async e=>this.externalConnection.requestPermission(e),"requestPermission"),readTextFile:a(async e=>this.externalConnection.readTextFile(e),"readTextFile"),writeTextFile:a(async e=>this.externalConnection.writeTextFile(e),"writeTextFile"),createTerminal:a(async e=>({terminalId:(await this.externalConnection.createTerminal(e)).id}),"createTerminal"),extMethod:a(async(e,r)=>this.externalConnection.extMethod(e,r),"extMethod"),extNotification:a(async(e,r)=>this.externalConnection.extNotification(e,r),"extNotification")}}async dispose(){await this.cliProcessManager.dispose()}};p();p();var Xwt=class{static{a(this,"ClaudeCodeSdkWrapper")}_loadSdk(){return this._sdkPromise??=Promise.resolve().then(()=>(voo(),_oo)),this._sdkPromise}async query(e){return(await this._loadSdk()).query(e)}async listSessions(e){return(await this._loadSdk()).listSessions(e)}async getSessionInfo(e,r){return(await this._loadSdk()).getSessionInfo(e,r)}async getSessionMessages(e,r){return(await this._loadSdk()).getSessionMessages(e,r)}async forkSession(e,r){return(await this._loadSdk()).forkSession(e,r)}};p();p();function Coo(t){let e=new sue;e.set(Lo,t),e.set(Cx,new Cx),e.set(ds,new ds),e.set(q2,new q2);let r=new Qt(e);return e.set(Qt,r),e.set(Zt,new Zt(e)),e.set(rO,new rO(e,r)),e.set(XN,new XN),e.set(Op,new Op(e)),e.set(X0,new X0),e.set(CC,new CC),e.set(AO,new oxe),e.set(TP,new dle),e.set(dP,new aSe),e.set(xd,new xd),e.set(t4,new t4(e)),e.set(ii,new ii(e)),e.set(z2,new z2(e)),e.set(T8,Pdt(e)),e.set(iy,new iy),e.set(Db,new Db),e.set(I8,I8.default),e.set(_f,new _f(e)),e.set(Ox,new Ox(e)),e.set(zp,new zp),e.set(Pb,new Pb(e)),e.set(bn,new bn),e.set(Au,new Au(e)),e.set(gO,new gO(e)),e.set(CN,new CN),e.set(LK,new LK(e)),e}a(Coo,"createCommonContext");p();var eRt=class extends qf{constructor(r){super();this.console=r}static{a(this,"ConsoleLog")}logIt(r,n,o,...s){n==1?this.console.error(`[${o}]`,...s):(n==2||y1t(r))&&this.console.warn(`[${o}]`,...s)}};p();var Ioo=require("node:os");var grl=new fe("repository"),uoe="\\\\",xoo="(?:[#;].*)",zve=`(?:[^"${uoe}]|${uoe}.)`,Arl="[0-9A-Za-z-]",boo=`[A-Za-z]${Arl}*`,woo=`\\s*${xoo}?$`,Roo=`(?:[^"${uoe};#]|${uoe}.)`,yrl=`(?:"${zve}*"|"${zve}*(?${uoe})$)`,Erl=`(?:${Roo}|${yrl})+`,_rl=`(?:(?${uoe})$)`,koo=`(?${Erl})${_rl}?${woo}`,Soo=new RegExp(`^${koo}`),vrl=new RegExp(`^(?${zve}*(?:(?${uoe})$|(?")))`),Crl=new RegExp(`^\\s*(?:(?${boo})\\s*=\\s*${koo}|(?${boo})${woo})`),brl=new RegExp(`(?${Roo}+)|"(?${zve}*)"`,"g"),Too="[-.0-9A-Za-z]+",Srl=`\\s+"(?${zve}*)"`,Trl=`\\s+"(?${zve}*)"`,Irl=new RegExp(`^\\s*\\[(?:(?${Too})${Srl}|${Trl}|(?${Too}))\\]`),xrl=new RegExp(`^\\s*${xoo}$`),l7r=class{constructor(e){this.content=e;this.stopped=!1;this.section="";this.line="";this.lineNum=0;this.lines=[];this.linesWithErrors=[]}static{a(this,"GitConfigParser")}parse(e){for(this.stopped=!1,this.section="",this.line="",this.linesWithErrors=[],this.configValueHandler=e,this.lines=this.content.split(/\r?\n/),this.lineNum=0;!this.stopped&&this.lineNum0}errorAt(e){this.linesWithErrors.push(e)}parseSectionStart(){let e=this.line.match(Irl);e&&(e.groups?.simple?this.section=e.groups.simple.toLowerCase()+"."+this.unescapeBaseValue(e.groups.ext):e.groups?.extOnly?this.section="."+this.unescapeBaseValue(e.groups.extOnly):this.section=e.groups.simpleOnly.toLowerCase(),this.line=this.line.slice(e[0].length))}unescapeBaseValue(e){return e.replace(/\\(.)/g,"$1")}parseConfigPair(){let e=this.line.match(Crl);if(e){if(e.groups?.key){let r=this.handleContinued(e);this.configValueHandler?.(this.nameWithSection(e.groups.key.toLowerCase()),r)}else e.groups?.soloKey&&this.configValueHandler?.(this.nameWithSection(e.groups.soloKey.toLowerCase()),"");this.line=""}}handleContinued(e){let r=e,n=[this.matchedValue(r)];for(;r?.groups?.cont||r?.groups?.strCont;){if(this.line=this.lines[++this.lineNum],this.lineNum>=this.lines.length){this.errorAt(this.lineNum);break}r.groups.strCont?(r=this.line.match(vrl),r?(n.push(this.matchedValue(r)),r.groups?.quote&&(r=this.line.slice(r[0].length).match(Soo),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))):this.errorAt(this.lineNum+1)):(r=this.line.match(Soo),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))}return this.normalizeValue(n.join(""))}matchedValue(e){return e.groups.strCont?e.groups.value.slice(0,-1):e.groups.value}normalizeValue(e){let r=!1,n=[...e.matchAll(brl)].map(o=>o.groups?.value?(r=!0,this.unescapeValue(o.groups.value.replace(/\s/g," "))):(r=!1,this.unescapeValue(o.groups.string))).join("");return r?n.trimEnd():n}unescapeValue(e){let r={n:` -`,t:" ",b:"\b"};return e.replace(/\\(.)/g,(n,o)=>r[o]||o)}nameWithSection(e){return this.section?this.section+"."+e:e}parseComment(){xrl.test(this.line)&&(this.line="")}},tRt=class extends NP{static{a(this,"GitParsingConfigLoader")}async getConfig(e,r){let n=await _f.getRepoConfigLocation(e,r);if(!n)return;let o=await this.getParsedConfig(e,n);if(o)return this.mergeConfig(await this.baseConfig(e,n),o)}mergeConfig(...e){return e.filter(r=>r!==void 0).reduce((r,n)=>r.concat(n),new hK)}async getParsedConfig(e,r,n=!0){let o=await this.tryLoadConfig(e,r,n);if(!o)return;let s=new l7r(o),c=new hK;return s.parse((l,u)=>c.add(l,u)),c}async tryLoadConfig(e,r,n){try{return await e.get(Qo).readFileString(r)}catch(o){(n||!(o instanceof Error)||o.code!=="ENOENT")&&grl.warn(e,`Failed to load git config from ${JSON.stringify(r)}:`,o);return}}async baseConfig(e,r){let n=await this.commondirConfigUri(e,r),o=wa(this.xdgConfigUri(),"git","config"),s=wa(this.homeUri(),".gitconfig");return this.mergeConfig(await this.getParsedConfig(e,o,!1),await this.getParsedConfig(e,s,!1),n?await this.getParsedConfig(e,n,!1):void 0)}async commondirConfigUri(e,r){if(Ji(r).toLowerCase()!=="config.worktree")return;let n=uf(r),o=wa(n,"commondir");try{let s=(await e.get(Qo).readFileString(o)).trimEnd();return wa($W(n,s),"config")}catch{return}}xdgConfigUri(){return typeof process<"u"&&process.env.XDG_CONFIG_HOME?Ks(process.env.XDG_CONFIG_HOME):wa(this.homeUri(),".config")}homeUri(){return Ks((0,Ioo.homedir)())}};p();var Poo=require("child_process");var rRt=class extends NP{static{a(this,"GitCLIConfigLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,Poo.execFile)(r,n,{cwd:e},(c,l)=>{c?s(c):o(l)})})}async tryRunCommand(e,r,n,o){try{return await this.runCommand(r,n,o)}catch(s){Y9t.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getConfig(e,r){let n=rs(r);if(n===void 0)return;let o;try{o=(await lO()).path}catch(c){Y9t.info(e,`Skipping git config lookup: ${c.message}`);return}let s=await this.tryRunCommand(e,n,o,["-c","safe.directory=*","config","--list","--null",...this.extraArgs()]);return s?this.extractConfig(s):void 0}extractConfig(e){let r=new hK;for(let n of e.split("\0").filter(o=>o)){let o=n.split(` -`,1)[0],s=n.slice(o.length+1);r.add(o,s)}return r}extraArgs(){return[]}};function Doo(t){let e=Coo(t);return wrl(e),e.set(pp,fot(e)),e.set(uk,ZTt(e)),e.set(NP,new Eze([new rRt,new tRt])),e}a(Doo,"createProductionContext");function wrl(t){t.set(QI,QI.fromEnvironment(!1)),t.set(ZL,new j_e),t.set(qf,new eRt(console))}a(wrl,"setupRudimentaryLogging");var nXh=new fe("context");p();var aso=require("fs");p();p();var rso=require("node:url");p();p();var Yve=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Moo=new Set,u7r=typeof process=="object"&&process?process:{},Ooo=a((t,e,r,n)=>{typeof u7r.emitWarning=="function"?u7r.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"emitWarning"),nRt=globalThis.AbortController,Noo=globalThis.AbortSignal;if(typeof nRt>"u"){Noo=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(n,o){this._onabort.push(o)}},nRt=class{static{a(this,"AbortController")}constructor(){e()}signal=new Noo;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let o of this.signal._onabort)o(n);this.signal.onabort?.(n)}}};let t=u7r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,Ooo("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var Rrl=a(t=>!Moo.has(t),"shouldWarn");var gW=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),Loo=a(t=>gW(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Kve:null:null,"getUintArray"),Kve=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},d7r=class t{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let r=Loo(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},J8e=class t{static{a(this,"LRUCache")}#e;#t;#r;#n;#i;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#a;#c;#u;#l;#p;#g;#A;#h;#v;#m;#b;#T;#E;#C;#S;#y;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#E,sizes:e.#b,keyMap:e.#c,keyList:e.#u,valList:e.#l,next:e.#p,prev:e.#g,get head(){return e.#A},get tail(){return e.#h},free:e.#v,isBackgroundFetch:a(r=>e.#f(r),"isBackgroundFetch"),backgroundFetch:a((r,n,o,s)=>e.#U(r,n,o,s),"backgroundFetch"),moveToTail:a(r=>e.#O(r),"moveToTail"),indexes:a(r=>e.#I(r),"indexes"),rindexes:a(r=>e.#x(r),"rindexes"),isStale:a(r=>e.#_(r),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#a}get size(){return this.#s}get fetchMethod(){return this.#i}get memoMethod(){return this.#o}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(e){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,maxEntrySize:A=0,sizeCalculation:y,fetchMethod:E,memoMethod:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:R}=e;if(r!==0&&!gW(r))throw new TypeError("max option must be a nonnegative integer");let x=r?Loo(r):Array;if(!x)throw new Error("invalid max value: "+r);if(this.#e=r,this.#t=g,this.maxEntrySize=A||this.#t,this.sizeCalculation=y,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#o=_,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#i=E,this.#S=!!E,this.#c=new Map,this.#u=new Array(r).fill(void 0),this.#l=new Array(r).fill(void 0),this.#p=new x(r),this.#g=new x(r),this.#A=0,this.#h=0,this.#v=d7r.create(r),this.#s=0,this.#a=0,typeof d=="function"&&(this.#r=d),typeof f=="function"?(this.#n=f,this.#m=[]):(this.#n=void 0,this.#m=void 0),this.#C=!!this.#r,this.#y=!!this.#n,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!w,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!gW(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!gW(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=gW(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!gW(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let P="LRU_CACHE_UNBOUNDED";Rrl(P)&&(Moo.add(P),Ooo("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,t))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#k(){let e=new Kve(this.#e),r=new Kve(this.#e);this.#E=e,this.#T=r,this.#L=(s,c,l=Yve.now())=>{if(r[s]=c!==0?l:0,e[s]=c,c!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#_(s)&&this.#w(this.#u[s],"expire")},c+1);u.unref&&u.unref()}},this.#R=s=>{r[s]=e[s]!==0?Yve.now():0},this.#d=(s,c)=>{if(e[c]){let l=e[c],u=r[c];if(!l||!u)return;s.ttl=l,s.start=u,s.now=n||o();let d=s.now-u;s.remainingTTL=l-d}};let n=0,o=a(()=>{let s=Yve.now();if(this.ttlResolution>0){n=s;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref()}return s},"getNow");this.getRemainingTTL=s=>{let c=this.#c.get(s);if(c===void 0)return 0;let l=e[c],u=r[c];if(!l||!u)return 1/0;let d=(n||o())-u;return l-d},this.#_=s=>{let c=r[s],l=e[s];return!!l&&!!c&&(n||o())-c>l}}#R=a(()=>{},"#updateItemAge");#d=a(()=>{},"#statusTTL");#L=a(()=>{},"#setItemTTL");#_=a(()=>!1,"#isStale");#D(){let e=new Kve(this.#e);this.#a=0,this.#b=e,this.#P=r=>{this.#a-=e[r],e[r]=0},this.#B=(r,n,o,s)=>{if(this.#f(n))return 0;if(!gW(o))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(o=s(n,r),!gW(o))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o},this.#N=(r,n,o)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#a>s;)this.#M(!0)}this.#a+=e[r],o&&(o.entrySize=n,o.totalCalculatedSize=this.#a)}}#P=a(e=>{},"#removeItemSize");#N=a((e,r,n)=>{},"#addItemSize");#B=a((e,r,n,o)=>{if(n||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#I({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#h;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#A));)r=this.#g[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#A;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#h));)r=this.#p[r]}#F(e){return e!==void 0&&this.#c.get(this.#u[e])===e}*entries(){for(let e of this.#I())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*rentries(){for(let e of this.#x())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*keys(){for(let e of this.#I()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*values(){for(let e of this.#I())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}*rvalues(){for(let e of this.#x())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;if(s!==void 0&&e(s,this.#u[n],this))return this.get(this.#u[n],r)}}forEach(e,r=this){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}rforEach(e,r=this){for(let n of this.#x()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#_(r)&&(this.#w(this.#u[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let n=this.#l[r],o=this.#f(n)?n.__staleWhileFetching:n;if(o===void 0)return;let s={value:o};if(this.#E&&this.#T){let c=this.#E[r],l=this.#T[r];if(c&&l){let u=c-(Yve.now()-l);s.ttl=u,s.start=Date.now()}}return this.#b&&(s.size=this.#b[r]),s}dump(){let e=[];for(let r of this.#I({allowStale:!0})){let n=this.#u[r],o=this.#l[r],s=this.#f(o)?o.__staleWhileFetching:o;if(s===void 0||n===void 0)continue;let c={value:s};if(this.#E&&this.#T){c.ttl=this.#E[r];let l=Yve.now()-this.#T[r];c.start=Math.floor(Date.now()-l)}this.#b&&(c.size=this.#b[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=Yve.now()-o}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:s,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,f=this.#B(e,r,n.size||0,l);if(this.maxEntrySize&&f>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#w(e,"set"),this;let h=this.#s===0?void 0:this.#c.get(e);if(h===void 0)h=this.#s===0?this.#h:this.#v.length!==0?this.#v.pop():this.#s===this.#e?this.#M(!1):this.#s,this.#u[h]=e,this.#l[h]=r,this.#c.set(e,h),this.#p[this.#h]=h,this.#g[h]=this.#h,this.#h=h,this.#s++,this.#N(h,f,u),u&&(u.set="add"),d=!1;else{this.#O(h);let m=this.#l[h];if(r!==m){if(this.#S&&this.#f(m)){m.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!c&&(this.#C&&this.#r?.(g,e,"set"),this.#y&&this.#m?.push([g,e,"set"]))}else c||(this.#C&&this.#r?.(m,e,"set"),this.#y&&this.#m?.push([m,e,"set"]));if(this.#P(h),this.#N(h,f,u),this.#l[h]=r,u){u.set="replace";let g=m&&this.#f(m)?m.__staleWhileFetching:m;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(o!==0&&!this.#E&&this.#k(),this.#E&&(d||this.#L(h,o,s),u&&this.#d(u,h)),!c&&this.#y&&this.#m){let m=this.#m,g;for(;g=m?.shift();)this.#n?.(...g)}return this}pop(){try{for(;this.#s;){let e=this.#l[this.#A];if(this.#M(!0),this.#f(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#y&&this.#m){let e=this.#m,r;for(;r=e?.shift();)this.#n?.(...r)}}}#M(e){let r=this.#A,n=this.#u[r],o=this.#l[r];return this.#S&&this.#f(o)?o.__abortController.abort(new Error("evicted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(o,n,"evict"),this.#y&&this.#m?.push([o,n,"evict"])),this.#P(r),e&&(this.#u[r]=void 0,this.#l[r]=void 0,this.#v.push(r)),this.#s===1?(this.#A=this.#h=0,this.#v.length=0):this.#A=this.#p[r],this.#c.delete(n),this.#s--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:o}=r,s=this.#c.get(e);if(s!==void 0){let c=this.#l[s];if(this.#f(c)&&c.__staleWhileFetching===void 0)return!1;if(this.#_(s))o&&(o.has="stale",this.#d(o,s));else return n&&this.#R(s),o&&(o.has="hit",this.#d(o,s)),!0}else o&&(o.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,o=this.#c.get(e);if(o===void 0||!n&&this.#_(o))return;let s=this.#l[o];return this.#f(s)?s.__staleWhileFetching:s}#U(e,r,n,o){let s=r===void 0?void 0:this.#l[r];if(this.#f(s))return s;let c=new nRt,{signal:l}=n;l?.addEventListener("abort",()=>c.abort(l.reason),{signal:c.signal});let u={signal:c.signal,options:n,context:o},d=a((y,E=!1)=>{let{aborted:_}=c.signal,v=n.ignoreFetchAbort&&y!==void 0;if(n.status&&(_&&!E?(n.status.fetchAborted=!0,n.status.fetchError=c.signal.reason,v&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),_&&!v&&!E)return h(c.signal.reason);let b=g;return this.#l[r]===g&&(y===void 0?b.__staleWhileFetching?this.#l[r]=b.__staleWhileFetching:this.#w(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,y,u.options))),y},"cb"),f=a(y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=y),h(y)),"eb"),h=a(y=>{let{aborted:E}=c.signal,_=E&&n.allowStaleOnFetchAbort,v=_||n.allowStaleOnFetchRejection,b=v||n.noDeleteOnFetchRejection,T=g;if(this.#l[r]===g&&(!b||T.__staleWhileFetching===void 0?this.#w(e,"fetch"):_||(this.#l[r]=T.__staleWhileFetching)),v)return n.status&&T.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw y},"fetchFail"),m=a((y,E)=>{let _=this.#i?.(e,s,u);_&&_ instanceof Promise&&_.then(v=>y(v===void 0?void 0:v),E),c.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(y(void 0),n.allowStaleOnFetchAbort&&(y=a(v=>d(v,!0),"res")))})},"pcall");n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(d,f),A=Object.assign(g,{__abortController:c,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,A,{...u.options,status:void 0}),r=this.#c.get(e)):this.#l[r]=A,A}#f(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof nRt}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:y,forceRefresh:E=!1,status:_,signal:v}=r;if(!this.#S)return _&&(_.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:_});let b={allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,ttl:c,noDisposeOnSet:l,size:u,sizeCalculation:d,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:g,status:_,signal:v},T=this.#c.get(e);if(T===void 0){_&&(_.fetch="miss");let w=this.#U(e,T,b,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let N=n&&w.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",N&&(_.returnedStale=!0)),N?w.__staleWhileFetching:w.__returned=w}let R=this.#_(T);if(!E&&!R)return _&&(_.fetch="hit"),this.#O(T),o&&this.#R(T),_&&this.#d(_,T),w;let x=this.#U(e,T,b,y),D=x.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=R?"stale":"refresh",D&&R&&(_.returnedStale=!0)),D?x.__staleWhileFetching:x.__returned=x}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#o;if(!n)throw new Error("no memoMethod provided to constructor");let{context:o,forceRefresh:s,...c}=r,l=this.get(e,c);if(!s&&l!==void 0)return l;let u=n(e,l,{options:c,context:o});return this.set(e,u,c),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:c}=r,l=this.#c.get(e);if(l!==void 0){let u=this.#l[l],d=this.#f(u);return c&&this.#d(c,l),this.#_(l)?(c&&(c.get="stale"),d?(c&&n&&u.__staleWhileFetching!==void 0&&(c.returnedStale=!0),n?u.__staleWhileFetching:void 0):(s||this.#w(e,"expire"),c&&n&&(c.returnedStale=!0),n?u:void 0)):(c&&(c.get="hit"),d?u.__staleWhileFetching:(this.#O(l),o&&this.#R(l),u))}else c&&(c.get="miss")}#Q(e,r){this.#g[r]=e,this.#p[e]=r}#O(e){e!==this.#h&&(e===this.#A?this.#A=this.#p[e]:this.#Q(this.#g[e],this.#p[e]),this.#Q(this.#h,e),this.#h=e)}delete(e){return this.#w(e,"delete")}#w(e,r){let n=!1;if(this.#s!==0){let o=this.#c.get(e);if(o!==void 0)if(n=!0,this.#s===1)this.#q(r);else{this.#P(o);let s=this.#l[o];if(this.#f(s)?s.__abortController.abort(new Error("deleted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(s,e,r),this.#y&&this.#m?.push([s,e,r])),this.#c.delete(e),this.#u[o]=void 0,this.#l[o]=void 0,o===this.#h)this.#h=this.#g[o];else if(o===this.#A)this.#A=this.#p[o];else{let c=this.#g[o];this.#p[c]=this.#p[o];let l=this.#p[o];this.#g[l]=this.#g[o]}this.#s--,this.#v.push(o)}}if(this.#y&&this.#m?.length){let o=this.#m,s;for(;s=o?.shift();)this.#n?.(...s)}return n}clear(){return this.#q("delete")}#q(e){for(let r of this.#x({allowStale:!0})){let n=this.#l[r];if(this.#f(n))n.__abortController.abort(new Error("deleted"));else{let o=this.#u[r];this.#C&&this.#r?.(n,o,e),this.#y&&this.#m?.push([n,o,e])}}if(this.#c.clear(),this.#l.fill(void 0),this.#u.fill(void 0),this.#E&&this.#T&&(this.#E.fill(0),this.#T.fill(0)),this.#b&&this.#b.fill(0),this.#A=0,this.#h=0,this.#v.length=0,this.#a=0,this.#s=0,this.#y&&this.#m){let r=this.#m,n;for(;n=r?.shift();)this.#n?.(...n)}}};var Xve=require("node:path"),Voo=require("node:url"),KL=require("fs"),Url=de(require("node:fs"),1),EW=require("node:fs/promises");p();var uRt=require("node:events"),y7r=de(require("node:stream"),1),qoo=require("node:string_decoder");var Boo=typeof process=="object"&&process?process:{stdout:null,stderr:null},krl=a(t=>!!t&&typeof t=="object"&&(t instanceof yW||t instanceof y7r.default||Prl(t)||Drl(t)),"isStream"),Prl=a(t=>!!t&&typeof t=="object"&&t instanceof uRt.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==y7r.default.Writable.prototype.pipe,"isReadable"),Drl=a(t=>!!t&&typeof t=="object"&&t instanceof uRt.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function","isWritable"),J9=Symbol("EOF"),Z9=Symbol("maybeEmitEnd"),AW=Symbol("emittedEnd"),iRt=Symbol("emittingEnd"),Z8e=Symbol("emittedError"),oRt=Symbol("closed"),Foo=Symbol("read"),sRt=Symbol("flush"),Uoo=Symbol("flushChunk"),VN=Symbol("encoding"),Jve=Symbol("decoder"),aA=Symbol("flowing"),X8e=Symbol("paused"),Zve=Symbol("resume"),cA=Symbol("buffer"),eC=Symbol("pipes"),lA=Symbol("bufferLength"),f7r=Symbol("bufferPush"),aRt=Symbol("bufferShift"),u_=Symbol("objectMode"),Th=Symbol("destroyed"),p7r=Symbol("error"),h7r=Symbol("emitData"),Qoo=Symbol("emitEnd"),m7r=Symbol("emitEnd2"),zL=Symbol("async"),g7r=Symbol("abort"),cRt=Symbol("aborted"),e6e=Symbol("signal"),doe=Symbol("dataListeners"),OI=Symbol("discarded"),t6e=a(t=>Promise.resolve().then(t),"defer"),Nrl=a(t=>t(),"nodefer"),Mrl=a(t=>t==="end"||t==="finish"||t==="prefinish","isEndish"),Orl=a(t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,"isArrayBufferLike"),Lrl=a(t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),"isArrayBufferView"),lRt=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[Zve](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},A7r=class extends lRt{static{a(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=o=>r.emit("error",o),e.on("error",this.proxyErrors)}},Brl=a(t=>!!t.objectMode,"isObjectModeOptions"),Frl=a(t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer","isEncodingOptions"),yW=class extends uRt.EventEmitter{static{a(this,"Minipass")}[aA]=!1;[X8e]=!1;[eC]=[];[cA]=[];[u_];[VN];[zL];[Jve];[J9]=!1;[AW]=!1;[iRt]=!1;[oRt]=!1;[Z8e]=null;[lA]=0;[Th]=!1;[e6e];[cRt]=!1;[doe]=0;[OI]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Brl(r)?(this[u_]=!0,this[VN]=null):Frl(r)?(this[VN]=r.encoding,this[u_]=!1):(this[u_]=!1,this[VN]=null),this[zL]=!!r.async,this[Jve]=this[VN]?new qoo.StringDecoder(this[VN]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[cA],"get")}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[eC],"get")});let{signal:n}=r;n&&(this[e6e]=n,n.aborted?this[g7r]():n.addEventListener("abort",()=>this[g7r]()))}get bufferLength(){return this[lA]}get encoding(){return this[VN]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[u_]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[zL]}set async(e){this[zL]=this[zL]||!!e}[g7r](){this[cRt]=!0,this.emit("abort",this[e6e]?.reason),this.destroy(this[e6e]?.reason)}get aborted(){return this[cRt]}set aborted(e){}write(e,r,n){if(this[cRt])return!1;if(this[J9])throw new Error("write after end");if(this[Th])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let o=this[zL]?t6e:Nrl;if(!this[u_]&&!Buffer.isBuffer(e)){if(Lrl(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Orl(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[u_]?(this[aA]&&this[lA]!==0&&this[sRt](!0),this[aA]?this.emit("data",e):this[f7r](e),this[lA]!==0&&this.emit("readable"),n&&o(n),this[aA]):e.length?(typeof e=="string"&&!(r===this[VN]&&!this[Jve]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[VN]&&(e=this[Jve].write(e)),this[aA]&&this[lA]!==0&&this[sRt](!0),this[aA]?this.emit("data",e):this[f7r](e),this[lA]!==0&&this.emit("readable"),n&&o(n),this[aA]):(this[lA]!==0&&this.emit("readable"),n&&o(n),this[aA])}read(e){if(this[Th])return null;if(this[OI]=!1,this[lA]===0||e===0||e&&e>this[lA])return this[Z9](),null;this[u_]&&(e=null),this[cA].length>1&&!this[u_]&&(this[cA]=[this[VN]?this[cA].join(""):Buffer.concat(this[cA],this[lA])]);let r=this[Foo](e||null,this[cA][0]);return this[Z9](),r}[Foo](e,r){if(this[u_])this[aRt]();else{let n=r;e===n.length||e===null?this[aRt]():typeof n=="string"?(this[cA][0]=n.slice(e),r=n.slice(0,e),this[lA]-=e):(this[cA][0]=n.subarray(e),r=n.subarray(0,e),this[lA]-=e)}return this.emit("data",r),!this[cA].length&&!this[J9]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r="utf8"),e!==void 0&&this.write(e,r),n&&this.once("end",n),this[J9]=!0,this.writable=!1,(this[aA]||!this[X8e])&&this[Z9](),this}[Zve](){this[Th]||(!this[doe]&&!this[eC].length&&(this[OI]=!0),this[X8e]=!1,this[aA]=!0,this.emit("resume"),this[cA].length?this[sRt]():this[J9]?this[Z9]():this.emit("drain"))}resume(){return this[Zve]()}pause(){this[aA]=!1,this[X8e]=!0,this[OI]=!1}get destroyed(){return this[Th]}get flowing(){return this[aA]}get paused(){return this[X8e]}[f7r](e){this[u_]?this[lA]+=1:this[lA]+=e.length,this[cA].push(e)}[aRt](){return this[u_]?this[lA]-=1:this[lA]-=this[cA][0].length,this[cA].shift()}[sRt](e=!1){do;while(this[Uoo](this[aRt]())&&this[cA].length);!e&&!this[cA].length&&!this[J9]&&this.emit("drain")}[Uoo](e){return this.emit("data",e),this[aA]}pipe(e,r){if(this[Th])return e;this[OI]=!1;let n=this[AW];return r=r||{},e===Boo.stdout||e===Boo.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[eC].push(r.proxyErrors?new A7r(this,e,r):new lRt(this,e,r)),this[zL]?t6e(()=>this[Zve]()):this[Zve]()),e}unpipe(e){let r=this[eC].find(n=>n.dest===e);r&&(this[eC].length===1?(this[aA]&&this[doe]===0&&(this[aA]=!1),this[eC]=[]):this[eC].splice(this[eC].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);if(e==="data")this[OI]=!1,this[doe]++,!this[eC].length&&!this[aA]&&this[Zve]();else if(e==="readable"&&this[lA]!==0)super.emit("readable");else if(Mrl(e)&&this[AW])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Z8e]){let o=r;this[zL]?t6e(()=>o.call(this,this[Z8e])):o.call(this,this[Z8e])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[doe]=this.listeners("data").length,this[doe]===0&&!this[OI]&&!this[eC].length&&(this[aA]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[doe]=0,!this[OI]&&!this[eC].length&&(this[aA]=!1)),r}get emittedEnd(){return this[AW]}[Z9](){!this[iRt]&&!this[AW]&&!this[Th]&&this[cA].length===0&&this[J9]&&(this[iRt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[oRt]&&this.emit("close"),this[iRt]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==Th&&this[Th])return!1;if(e==="data")return!this[u_]&&!n?!1:this[zL]?(t6e(()=>this[h7r](n)),!0):this[h7r](n);if(e==="end")return this[Qoo]();if(e==="close"){if(this[oRt]=!0,!this[AW]&&!this[Th])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Z8e]=n,super.emit(p7r,n);let s=!this[e6e]||this.listeners("error").length?super.emit("error",n):!1;return this[Z9](),s}else if(e==="resume"){let s=super.emit("resume");return this[Z9](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let o=super.emit(e,...r);return this[Z9](),o}[h7r](e){for(let n of this[eC])n.dest.write(e)===!1&&this.pause();let r=this[OI]?!1:super.emit("data",e);return this[Z9](),r}[Qoo](){return this[AW]?!1:(this[AW]=!0,this.readable=!1,this[zL]?(t6e(()=>this[m7r]()),!0):this[m7r]())}[m7r](){if(this[Jve]){let r=this[Jve].end();if(r){for(let n of this[eC])n.dest.write(r);this[OI]||super.emit("data",r)}}for(let r of this[eC])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[u_]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[u_]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[u_])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[VN]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(Th,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[OI]=!1;let e=!1,r=a(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:a(()=>{if(e)return r();let o=this.read();if(o!==null)return Promise.resolve({done:!1,value:o});if(this[J9])return r();let s,c,l=a(h=>{this.off("data",u),this.off("end",d),this.off(Th,f),r(),c(h)},"onerr"),u=a(h=>{this.off("error",l),this.off("end",d),this.off(Th,f),this.pause(),s({value:h,done:!!this[J9]})},"ondata"),d=a(()=>{this.off("error",l),this.off("data",u),this.off(Th,f),r(),s({done:!0,value:void 0})},"onend"),f=a(()=>l(new Error("stream destroyed")),"ondestroy");return new Promise((h,m)=>{c=m,s=h,this.once(Th,f),this.once("error",l),this.once("end",d),this.once("data",u)})},"next"),throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[OI]=!1;let e=!1,r=a(()=>(this.pause(),this.off(p7r,r),this.off(Th,r),this.off("end",r),e=!0,{done:!0,value:void 0}),"stop"),n=a(()=>{if(e)return r();let o=this.read();return o===null?r():{done:!1,value:o}},"next");return this.once("end",r),this.once(p7r,r),this.once(Th,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[Th])return e?this.emit("error",e):this.emit(Th),this;this[Th]=!0,this[OI]=!0,this[cA].length=0,this[lA]=0;let r=this;return typeof r.close=="function"&&!this[oRt]&&r.close(),e?this.emit("error",e):this.emit(Th),this}static get isStream(){return krl}};var Qrl=KL.realpathSync.native,n6e={lstatSync:KL.lstatSync,readdir:KL.readdir,readdirSync:KL.readdirSync,readlinkSync:KL.readlinkSync,realpathSync:Qrl,promises:{lstat:EW.lstat,readdir:EW.readdir,readlink:EW.readlink,realpath:EW.realpath}},Woo=a(t=>!t||t===n6e||t===Url?n6e:{...n6e,...t,promises:{...n6e.promises,...t.promises||{}}},"fsFromOption"),zoo=/^\\\\\?\\([a-z]:)\\?$/i,qrl=a(t=>t.replace(/\//g,"\\").replace(zoo,"$1\\"),"uncToDrive"),jrl=/[\\\/]/,Tk=0,Yoo=1,Koo=2,YL=4,Joo=6,Zoo=8,foe=10,Xoo=12,Sk=15,r6e=~Sk,E7r=16,joo=32,i6e=64,WN=128,dRt=256,pRt=512,Hoo=i6e|WN|pRt,Hrl=1023,_7r=a(t=>t.isFile()?Zoo:t.isDirectory()?YL:t.isSymbolicLink()?foe:t.isCharacterDevice()?Koo:t.isBlockDevice()?Joo:t.isSocket()?Xoo:t.isFIFO()?Yoo:Tk,"entToType"),Goo=new Map,o6e=a(t=>{let e=Goo.get(t);if(e)return e;let r=t.normalize("NFKD");return Goo.set(t,r),r},"normalize"),$oo=new Map,fRt=a(t=>{let e=$oo.get(t);if(e)return e;let r=o6e(t.toLowerCase());return $oo.set(t,r),r},"normalizeNocase"),hRt=class extends J8e{static{a(this,"ResolveCache")}constructor(){super({max:256})}},v7r=class extends J8e{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(r=>r.length+1,"sizeCalculation")})}},eso=Symbol("PathScurry setAsCwd"),d_=class{static{a(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#r;get mode(){return this.#r}#n;get nlink(){return this.#n}#i;get uid(){return this.#i}#o;get gid(){return this.#o}#s;get rdev(){return this.#s}#a;get blksize(){return this.#a}#c;get ino(){return this.#c}#u;get size(){return this.#u}#l;get blocks(){return this.#l}#p;get atimeMs(){return this.#p}#g;get mtimeMs(){return this.#g}#A;get ctimeMs(){return this.#A}#h;get birthtimeMs(){return this.#h}#v;get atime(){return this.#v}#m;get mtime(){return this.#m}#b;get ctime(){return this.#b}#T;get birthtime(){return this.#T}#E;#C;#S;#y;#k;#R;#d;#L;#_;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=Tk,n,o,s,c,l){this.name=e,this.#E=s?fRt(e):o6e(e),this.#d=r&Hrl,this.nocase=s,this.roots=o,this.root=n||this,this.#L=c,this.#S=l.fullpath,this.#k=l.relative,this.#R=l.relativePosix,this.parent=l.parent,this.parent?this.#e=this.parent.#e:this.#e=Woo(l.fs)}depth(){return this.#C!==void 0?this.#C:this.parent?this.#C=this.parent.depth()+1:this.#C=0}childrenCache(){return this.#L}resolve(e){if(!e)return this;let r=this.getRootString(e),o=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#P(o):this.#P(o)}#P(e){let r=this;for(let n of e)r=r.child(n);return r}children(){let e=this.#L.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#L.set(this,r),this.#d&=~E7r,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),o=this.nocase?fRt(e):o6e(e);for(let u of n)if(u.#E===o)return u;let s=this.parent?this.sep:"",c=this.#S?this.#S+s+e:void 0,l=this.newChild(e,Tk,{...r,parent:this,fullpath:c});return this.canReaddir()||(l.#d|=WN),n.push(l),l}relative(){if(this.isCWD)return"";if(this.#k!==void 0)return this.#k;let e=this.name,r=this.parent;if(!r)return this.#k=this.name;let n=r.relative();return n+(!n||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,r=this.parent;if(!r)return this.#R=this.fullpathPosix();let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.name;let o=r.fullpath()+(r.parent?this.sep:"")+e;return this.#S=o}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let o=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(o)?this.#y=`//?/${o}`:this.#y=o}let e=this.parent,r=e.fullpathPosix(),n=r+(!r||!e.parent?"":"/")+this.name;return this.#y=n}isUnknown(){return(this.#d&Sk)===Tk}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#d&Sk)===Zoo}isDirectory(){return(this.#d&Sk)===YL}isCharacterDevice(){return(this.#d&Sk)===Koo}isBlockDevice(){return(this.#d&Sk)===Joo}isFIFO(){return(this.#d&Sk)===Yoo}isSocket(){return(this.#d&Sk)===Xoo}isSymbolicLink(){return(this.#d&foe)===foe}lstatCached(){return this.#d&joo?this:void 0}readlinkCached(){return this.#_}realpathCached(){return this.#D}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#_)return!0;if(!this.parent)return!1;let e=this.#d&Sk;return!(e!==Tk&&e!==foe||this.#d&dRt||this.#d&WN)}calledReaddir(){return!!(this.#d&E7r)}isENOENT(){return!!(this.#d&WN)}isNamed(e){return this.nocase?this.#E===fRt(e):this.#E===o6e(e)}async readlink(){let e=this.#_;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(r);if(n)return this.#_=n}catch(r){this.#f(r.code);return}}readlinkSync(){let e=this.#_;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(r);if(n)return this.#_=n}catch(r){this.#f(r.code);return}}#N(e){this.#d|=E7r;for(let r=e.provisional;rn(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);r?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#H.push(e),this.#G)return;this.#G=!0;let o=this.fullpath();this.#e.readdir(o,{withFileTypes:!0},(s,c)=>{if(s)this.#M(s.code),n.provisional=0;else{for(let l of c)this.#Q(l,n);this.#N(n)}this.#V(n.slice(0,n.provisional))})}#j;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#j)await this.#j;else{let n=a(()=>{},"resolve");this.#j=new Promise(o=>n=o);try{for(let o of await this.#e.promises.readdir(r,{withFileTypes:!0}))this.#Q(o,e);this.#N(e)}catch(o){this.#M(o.code),e.provisional=0}this.#j=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let n of this.#e.readdirSync(r,{withFileTypes:!0}))this.#Q(n,e);this.#N(e)}catch(n){this.#M(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#d&Hoo)return!1;let e=Sk&this.#d;return e===Tk||e===YL||e===foe}shouldWalk(e,r){return(this.#d&YL)===YL&&!(this.#d&Hoo)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#D)return this.#D;if(!((pRt|dRt|WN)&this.#d))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}realpathSync(){if(this.#D)return this.#D;if(!((pRt|dRt|WN)&this.#d))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}[eso](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],o=this;for(;o&&o.parent;)r.add(o),o.#k=n.join(this.sep),o.#R=n.join("/"),o=o.parent,n.push("..");for(o=e;o&&o.parent&&!r.has(o);)o.#k=void 0,o.#R=void 0,o=o.parent}},mRt=class t extends d_{static{a(this,"PathWin32")}sep="\\";splitSep=jrl;constructor(e,r=Tk,n,o,s,c,l){super(e,r,n,o,s,c,l)}newChild(e,r=Tk,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return Xve.win32.parse(e).root}getRoot(e){if(e=qrl(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=n;return this.roots[e]=new eCe(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(zoo,"$1\\"),e===r}},gRt=class t extends d_{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,r=Tk,n,o,s,c,l){super(e,r,n,o,s,c,l)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=Tk,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},ARt=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#t;#r;nocase;#n;constructor(e=process.cwd(),r,n,{nocase:o,childrenCacheSize:s=16*1024,fs:c=n6e}={}){this.#n=Woo(c),(e instanceof URL||e.startsWith("file://"))&&(e=(0,Voo.fileURLToPath)(e));let l=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),this.#e=new hRt,this.#t=new hRt,this.#r=new v7r(s);let u=l.substring(this.rootPath.length).split(n);if(u.length===1&&!u[0]&&u.pop(),o===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=o,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let d=this.root,f=u.length-1,h=r.sep,m=this.rootPath,g=!1;for(let A of u){let y=f--;d=d.child(A,{relative:new Array(y).fill("..").join(h),relativePosix:new Array(y).fill("..").join("/"),fullpath:m+=(g?"":h)+A}),g=!0}this.cwd=d}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let r="";for(let s=e.length-1;s>=0;s--){let c=e[s];if(!(!c||c===".")&&(r=r?`${c}/${r}`:c,this.isAbsolute(c)))break}let n=this.#e.get(r);if(n!==void 0)return n;let o=this.cwd.resolve(r).fullpath();return this.#e.set(r,o),o}resolvePosix(...e){let r="";for(let s=e.length-1;s>=0;s--){let c=e[s];if(!(!c||c===".")&&(r=r?`${c}/${r}`:c,this.isAbsolute(c)))break}let n=this.#t.get(r);if(n!==void 0)return n;let o=this.cwd.resolve(r).fullpathPosix();return this.#t.set(r,o),o}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof d_||(r=e,e=this.cwd);let{withFileTypes:n}=r;if(e.canReaddir()){let o=await e.readdir();return n?o:o.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof d_||(r=e,e=this.cwd);let{withFileTypes:n=!0}=r;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(o=>o.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof d_||(r=e.withFileTypes,e=this.cwd);let n=await e.readlink();return r?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof d_||(r=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return r?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof d_||(r=e.withFileTypes,e=this.cwd);let n=await e.realpath();return r?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof d_||(r=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return r?n:n?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof d_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=[];(!s||s(e))&&l.push(n?e:e.fullpath());let u=new Set,d=a((h,m)=>{u.add(h),h.readdirCB((g,A)=>{if(g)return m(g);let y=A.length;if(!y)return m();let E=a(()=>{--y===0&&m()},"next");for(let _ of A)(!s||s(_))&&l.push(n?_:_.fullpath()),o&&_.isSymbolicLink()?_.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(u,c)?d(v,E):E()):_.shouldWalk(u,c)?d(_,E):E()},!0)},"walk"),f=e;return new Promise((h,m)=>{d(f,g=>{if(g)return m(g);h(l)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof d_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=[];(!s||s(e))&&l.push(n?e:e.fullpath());let u=new Set([e]);for(let d of u){let f=d.readdirSync();for(let h of f){(!s||s(h))&&l.push(n?h:h.fullpath());let m=h;if(h.isSymbolicLink()){if(!(o&&(m=h.realpathSync())))continue;m.isUnknown()&&m.lstatSync()}m.shouldWalk(u,c)&&u.add(m)}}return l}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof d_||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof d_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r;(!s||s(e))&&(yield n?e:e.fullpath());let l=new Set([e]);for(let u of l){let d=u.readdirSync();for(let f of d){(!s||s(f))&&(yield n?f:f.fullpath());let h=f;if(f.isSymbolicLink()){if(!(o&&(h=f.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(l,c)&&l.add(h)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof d_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new yW({objectMode:!0});(!s||s(e))&&l.write(n?e:e.fullpath());let u=new Set,d=[e],f=0,h=a(()=>{let m=!1;for(;!m;){let g=d.shift();if(!g){f===0&&l.end();return}f++,u.add(g);let A=a((E,_,v=!1)=>{if(E)return l.emit("error",E);if(o&&!v){let b=[];for(let T of _)T.isSymbolicLink()&&b.push(T.realpath().then(w=>w?.isUnknown()?w.lstat():w));if(b.length){Promise.all(b).then(()=>A(null,_,!0));return}}for(let b of _)b&&(!s||s(b))&&(l.write(n?b:b.fullpath())||(m=!0));f--;for(let b of _){let T=b.realpathCached()||b;T.shouldWalk(u,c)&&d.push(T)}m&&!l.flowing?l.once("drain",h):y||h()},"onReaddir"),y=!0;g.readdirCB(A,!0),y=!1}},"process");return h(),l}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof d_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new yW({objectMode:!0}),u=new Set;(!s||s(e))&&l.write(n?e:e.fullpath());let d=[e],f=0,h=a(()=>{let m=!1;for(;!m;){let g=d.shift();if(!g){f===0&&l.end();return}f++,u.add(g);let A=g.readdirSync();for(let y of A)(!s||s(y))&&(l.write(n?y:y.fullpath())||(m=!0));f--;for(let y of A){let E=y;if(y.isSymbolicLink()){if(!(o&&(E=y.realpathSync())))continue;E.isUnknown()&&E.lstatSync()}E.shouldWalk(u,c)&&d.push(E)}}m&&!l.flowing&&l.once("drain",h)},"process");return h(),l}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[eso](r)}},eCe=class extends ARt{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,Xve.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let o=this.cwd;o;o=o.parent)o.nocase=this.nocase}parseRootPath(e){return Xve.win32.parse(e).root.toUpperCase()}newRoot(e){return new mRt(this.rootPath,YL,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},tCe=class extends ARt{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,Xve.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new gRt(this.rootPath,YL,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},s6e=class extends tCe{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},AXh=process.platform==="win32"?mRt:gRt,tso=process.platform==="win32"?eCe:process.platform==="darwin"?s6e:tCe;p();var Grl=a(t=>t.length>=1,"isPatternList"),$rl=a(t=>t.length>=1,"isGlobList"),rCe=class t{static{a(this,"Pattern")}#e;#t;#r;length;#n;#i;#o;#s;#a;#c;#u=!0;constructor(e,r,n,o){if(!Grl(e))throw new TypeError("empty pattern list");if(!$rl(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=r,this.#r=n,this.#n=o,this.#r===0){if(this.isUNC()){let[s,c,l,u,...d]=this.#e,[f,h,m,g,...A]=this.#t;d[0]===""&&(d.shift(),A.shift());let y=[s,c,l,u,""].join("/"),E=[f,h,m,g,""].join("/");this.#e=[y,...d],this.#t=[E,...A],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...c]=this.#e,[l,...u]=this.#t;c[0]===""&&(c.shift(),u.shift());let d=s+"/",f=l+"/";this.#e=[d,...c],this.#t=[f,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===Jp}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#o=this.#o||(this.#r===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new t(this.#e,this.#t,this.#r+1,this.#n),this.#i.#c=this.#c,this.#i.#a=this.#a,this.#i.#s=this.#s,this.#i):this.#i=null}isUNC(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=this.#n==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#s!==void 0?this.#s:this.#s=this.#n==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};p();p();var Vrl=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",nCe=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:o,noglobstar:s,platform:c=Vrl}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=c,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:o,noglobstar:s,optimizationLevel:2,platform:c,nocomment:!0,nonegate:!0};for(let l of e)this.add(l)}add(e){let r=new Q_(e,this.mmopts);for(let n=0;n[e,!!(r&2),!!(r&1)])}},S7r=class{static{a(this,"SubWalks")}store=new Map;add(e,r){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(o=>o.globString()===r.globString())||n.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},a6e=class t{static{a(this,"Processor")}hasWalkedCache;matches=new b7r;subwalks=new S7r;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new C7r}processPatterns(e,r){this.patterns=r;let n=r.map(o=>[e,o]);for(let[o,s]of n){this.hasWalkedCache.storeWalked(o,s);let c=s.root(),l=s.isAbsolute()&&this.opts.absolute!==!1;if(c){o=o.resolve(c==="/"&&this.opts.root!==void 0?this.opts.root:c);let h=s.rest();if(h)s=h;else{this.matches.add(o,!0,!1);continue}}if(o.isENOENT())continue;let u,d,f=!1;for(;typeof(u=s.pattern())=="string"&&(d=s.rest());)o=o.resolve(u),s=d,f=!0;if(u=s.pattern(),d=s.rest(),f){if(this.hasWalkedCache.hasWalked(o,s))continue;this.hasWalkedCache.storeWalked(o,s)}if(typeof u=="string"){let h=u===".."||u===""||u===".";this.matches.add(o.resolve(u),l,h);continue}else if(u===Jp){(!o.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(o,s);let h=d?.pattern(),m=d?.rest();if(!d||(h===""||h===".")&&!m)this.matches.add(o,l,h===""||h===".");else if(h===".."){let g=o.parent||o;m?this.hasWalkedCache.hasWalked(g,m)||this.subwalks.add(g,m):this.matches.add(g,l,!0)}}else u instanceof RegExp&&this.subwalks.add(o,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let n=this.subwalks.get(e),o=this.child();for(let s of r)for(let c of n){let l=c.isAbsolute(),u=c.pattern(),d=c.rest();u===Jp?o.testGlobstar(s,c,d,l):u instanceof RegExp?o.testRegExp(s,u,d,l):o.testString(s,u,d,l)}return o}testGlobstar(e,r,n,o){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,o,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(e,n):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),o);else if(s===".."){let c=e.parent||e;this.subwalks.add(c,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),o)}}testRegExp(e,r,n,o){r.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,o,!1))}testString(e,r,n,o){e.isNamed(r)&&(n?this.subwalks.add(e,n):this.matches.add(e,o,!1))}};var Wrl=a((t,e)=>typeof t=="string"?new nCe([t],e):Array.isArray(t)?new nCe(t,e):t,"makeIgnore"),yRt=class{static{a(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#r;signal;maxDepth;includeChildMatches;constructor(e,r,n){if(this.patterns=e,this.path=r,this.opts=n,this.#r=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=Wrl(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!="function")){let o="cannot ignore child matches, ignore lacks add() method.";throw new Error(o)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#i(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let c=await s.realpath();c&&(c.isUnknown()||this.opts.stat)&&await c.lstat()}return this.matchCheckTest(s,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let c=s.realpathSync();c&&(c?.isUnknown()||this.opts.stat)&&c.lstatSync()}return this.matchCheckTest(s,r)}matchFinish(e,r){if(this.#n(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let o=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+o)}else{let s=this.opts.posix?e.relativePosix():e.relative(),c=this.opts.dotRelative&&!s.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(s?c+s+o:"."+o)}}async match(e,r,n){let o=await this.matchCheck(e,n);o&&this.matchFinish(o,r)}matchSync(e,r,n){let o=this.matchCheckSync(e,n);o&&this.matchFinish(o,r)}walkCB(e,r,n){this.signal?.aborted&&n(),this.walkCB2(e,r,new a6e(this.opts),n)}walkCB2(e,r,n,o){if(this.#i(e))return o();if(this.signal?.aborted&&o(),this.paused){this.onResume(()=>this.walkCB2(e,r,n,o));return}n.processPatterns(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||(s++,this.match(l,u,d).then(()=>c()));for(let l of n.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let u=l.readdirCached();l.calledReaddir()?this.walkCB3(l,u,n,c):l.readdirCB((d,f)=>this.walkCB3(l,f,n,c),!0)}c()}walkCB3(e,r,n,o){n=n.filterEntries(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||(s++,this.match(l,u,d).then(()=>c()));for(let[l,u]of n.subwalks.entries())s++,this.walkCB2(l,u,n.child(),c);c()}walkCBSync(e,r,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,r,new a6e(this.opts),n)}walkCB2Sync(e,r,n,o){if(this.#i(e))return o();if(this.signal?.aborted&&o(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,n,o));return}n.processPatterns(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||this.matchSync(l,u,d);for(let l of n.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let u=l.readdirSync();this.walkCB3Sync(l,u,n,c)}c()}walkCB3Sync(e,r,n,o){n=n.filterEntries(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||this.matchSync(l,u,d);for(let[l,u]of n.subwalks.entries())s++,this.walkCB2Sync(l,u,n.child(),c);c()}},c6e=class extends yRt{static{a(this,"GlobWalker")}matches=new Set;constructor(e,r,n){super(e,r,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},l6e=class extends yRt{static{a(this,"GlobStream")}results;constructor(e,r,n){super(e,r,n),this.results=new yW({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var zrl=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",zN=class{static{a(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,rso.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=r.platform||zrl,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=r.platform==="win32"?eCe:r.platform==="darwin"?s6e:r.platform?tCe:tso;this.scurry=new u(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",o={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(u=>new Q_(u,o)),[c,l]=s.reduce((u,d)=>(u[0].push(...d.set),u[1].push(...d.globParts),u),[[],[]]);this.patterns=c.map((u,d)=>{let f=l[d];if(!f)throw new Error("invalid pattern object");return new rCe(u,f,0,this.platform)})}async walk(){return[...await new c6e(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new c6e(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new l6e(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new l6e(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};p();var T7r=a((t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new Q_(r,e).hasMagic())return!0;return!1},"hasMagic");function _Rt(t,e={}){return new zN(t,e).streamSync()}a(_Rt,"globStreamSync");function iso(t,e={}){return new zN(t,e).stream()}a(iso,"globStream");function oso(t,e={}){return new zN(t,e).walkSync()}a(oso,"globSync");async function nso(t,e={}){return new zN(t,e).walk()}a(nso,"glob_");function vRt(t,e={}){return new zN(t,e).iterateSync()}a(vRt,"globIterateSync");function sso(t,e={}){return new zN(t,e).iterate()}a(sso,"globIterate");var Yrl=_Rt,Krl=Object.assign(iso,{sync:_Rt}),Jrl=vRt,Zrl=Object.assign(sso,{sync:vRt}),Xrl=Object.assign(oso,{stream:_Rt,iterate:vRt}),ERt=Object.assign(nso,{glob:nso,globSync:oso,sync:Xrl,globStream:iso,stream:Krl,globStreamSync:_Rt,streamSync:Yrl,globIterate:sso,iterate:Zrl,globIterateSync:vRt,iterateSync:Jrl,Glob:zN,hasMagic:T7r,escape:Lle,unescape:MP});ERt.glob=ERt;var u6e=class t{constructor(){this.logger=new fe("PromptFileLocator")}static{a(this,"PromptFileLocator")}static{this.STAT_CONCURRENCY=32}async listFiles(e,r,n){let o=e.get(wA),s=r.map(d=>un(d.uri)),l=o.resolvePatterns(n,s).map(async d=>{let f=d.metadata?[d.metadata]:void 0,h=a((m,g)=>({uri:m,watchable:d.watchable,cacheable:d.cacheable,metadata:f,classification:d.classification,timestamp:g}),"build");if(d.isGlob)return(await this.globFiles(d.pattern,e)).map(g=>h(Ks(g.path),g.timestamp));{let m=await this.getExactFile(e,d.pattern);return m?[h(m.uri,m.timestamp)]:[]}}),u=await Promise.all(l);return this.deduplicateFiles(u.flat())}async globFiles(e,r){let n;try{n=await ERt(e,{dot:!0,nodir:!0,absolute:!0})}catch{return[]}return this.statGlobMatches(r,n)}async statGlobMatches(e,r){let n=[];for(let o=0;o{try{let u=await aso.promises.stat(l);return u.isFile()?{path:l,timestamp:u.mtimeMs}:void 0}catch(u){this.logger.warn(e,`Skipping prompt file ${l} because it could not be stat'd:`,u);return}}));n.push(...c.filter(l=>l!==void 0))}return n}async getExactFile(e,r){let n=Ks(r);try{let o=await e.get(Qo).stat(n);return(o.type&1)!==0?{uri:n,timestamp:o.mtime}:void 0}catch{return}}deduplicateFiles(e){let r=new Map;for(let n of e){let o=r.get(n.uri);if(!o){r.set(n.uri,n);continue}let s=o.watchable||n.watchable,c=o.cacheable||n.cacheable,l=n.metadata?.length?[...o.metadata??[],...n.metadata]:o.metadata,u=Math.max(o.timestamp,n.timestamp);(s!==o.watchable||c!==o.cacheable||l!==o.metadata||u!==o.timestamp)&&r.set(n.uri,{...o,watchable:s,cacheable:c,metadata:l,timestamp:u})}return Array.from(r.values())}};p();var Tem=new fe("exp");function lso(t){let e=t.get(Zt);e.registerStaticFilters(rnl(t)),e.registerDynamicFilter("X-Copilot-OverrideEngine",()=>Ft(t,Ye.DebugOverrideEngine)||Ft(t,Ye.DebugOverrideEngineLegacy)),e.registerDynamicFilter("X-VSCode-ExtensionName",()=>o7e()?"copilot-web":t.get(Ir).getEditorPluginInfo().name),e.registerDynamicFilter("X-VSCode-ExtensionVersion",()=>cso(t)),e.registerDynamicFilter(Soe.CopilotRelatedPluginVersionGithubCopilot,()=>cso(t)),e.registerDynamicFilter("X-VSCode-ExtensionRelease",()=>enl(t)),e.registerDynamicFilter("X-VSCode-Build",()=>t.get(Ir).getEditorInfo().name),e.registerDynamicFilter("X-VSCode-AppVersion",()=>CRt(t.get(Ir).getEditorInfo().version)),e.registerDynamicFilter("X-VSCode-TargetPopulation",()=>tnl(t)),e.registerDynamicFilter("X-VSCode-DevDeviceId",()=>t.get(UI).getIdSync()),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getRelatedPluginInfo()){let o=E_+n.name.replace(/[^A-Za-z]/g,"").toLowerCase();if(!Object.values(Soe).includes(o)){K6e(t,{reason:`A filter could not be registered for the unrecognized related plugin "${n.name}".`});continue}r[o]=CRt(n.version)}return r}),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getEditorPluginSpecificFilters()){let o=n.isVersion?CRt(n.value):n.value;r[n.filter]=o}return r})}a(lso,"setupExperimentationService");function cso(t){return CRt(!t.get(ds).isProduction()&&t.get(Ir).getEditorPluginInfo().name==="copilot"?"1.999.0":t.get(Ir).getEditorPluginInfo().version)}a(cso,"getEditorPluginVersion");function enl(t){let e=t.get(Ir).getEditorPluginInfo();return e.name==="copilot-intellij"&&e.version.endsWith("nightly")?"nightly":"stable"}a(enl,"getPluginRelease");function tnl(t){let e=t.get(Ir).getEditorInfo();return e.name==="vscode"&&e.version.endsWith("-insider")?"insider":"public"}a(tnl,"getTargetPopulation");function rnl(t){return nnl(t)}a(rnl,"createAllFilters");function nnl(t){let e=t.get(Ua);return{"X-MSEdge-ClientId":e.machineId,"X-Copilot-ClientVersion":t.get(ds).isProduction()?V1(t):"1.999.0"}}a(nnl,"createDefaultFilters");function CRt(t){return t.split("-")[0]}a(CRt,"trimVersionSuffix");p();var _W=class{static{a(this,"AbstractCopilotMcpSamplingConfigSender")}};p();var iCe=class{static{a(this,"AbstractCopilotMessageSender")}};p();var uso=100,dso=1e3*60*5;function fso(t){let e=new I7r(t);t.get(hm).registerContextProvider(e),t.get(r4).add(e.id)}a(fso,"registerRelatedFilesShim");var I7r=class{constructor(e){this.ctx=e;this.id="relatedFilesShim";this.selector=["*"];this.traitCache=new Pk(uso,dso);this.relatedFilesCache=new Pk(uso,dso);this.resolver={resolve:a(async(r,n)=>{let o=r.documentContext.uri,s=r.documentContext.languageId;return await this.getTraits(o,s,n)},"resolve")}}static{a(this,"RelatedFilesShim")}async getTraits(e,r,n){return this.traitCache.has(e)||await this.requestRelatedFilesAndTraits(e,r,r,n),this.traitCache.get(e)??[]}async requestRelatedFilesAndTraits(e,r,n,o){try{let s=await this.ctx.get(Zt).fetchTokenAndUpdateExPValuesAndAssignments({uri:e,languageId:n}),c={uri:e,clientLanguageId:r,detectedLanguageId:n},l=await udt(this.ctx,c,s,o,!0);if(o?.isCancellationRequested)return;let u=l.traits.filter(f=>f.includeInPrompt).map(f=>f.promptTextOverride?{name:"OtherInformation",value:f.promptTextOverride}:f),d=new Set;for(let f of l.entries.values())for(let h of f.keys())d.add(h);this.traitCache.set(e,u),this.relatedFilesCache.set(e,Array.from(d))}catch(s){LY(this.ctx,s,"relatedFilesShim")}}};var oao=de(cee()),sao=de(require("path"));p();var d6e=de(ri());var inl=new d6e.ProtocolRequestType("workspace/readFile"),onl=new d6e.ProtocolRequestType("workspace/readDirectory"),snl=new d6e.ProtocolRequestType("workspace/findFiles"),anl=new d6e.ProtocolRequestType("workspace/findTextInFiles"),bRt=class extends la{constructor(r){super();this.ctx=r}static{a(this,"AgentContentProvider")}async readFile(r){return this.sendRequestWithTelemetry(inl,r,"readFile")}async readDirectory(r){return this.sendRequestWithTelemetry(onl,r,"readDirectory",n=>({entryCount:n.entries.length}))}async findFiles(r){return this.sendRequestWithTelemetry(snl,r,"findFiles",n=>({fileCount:n.uris.length}))}async findTextInFiles(r){return this.sendRequestWithTelemetry(anl,r,"findTextInFiles",n=>({matchCount:n.matches.length}))}get connection(){return this.ctx.get(ar).connection}async sendRequestWithTelemetry(r,n,o,s){let c=performance.now();try{let l=await this.connection.sendRequest(r,n),u=Math.round(performance.now()-c);return At(this.ctx,`contentProvider.${o}`,{},{durationMs:u,...s?.(l)}),l}catch(l){let u=Math.round(performance.now()-c);throw Vn(this.ctx,`contentProvider.${o}.failure`,l,{},{durationMs:u}),l}}};p();var SRt=class extends wO{constructor(r){super();this.ctx=r}static{a(this,"AgentLSPRequestSender")}async sendRequest(r,n){let o=this.ctx.get(ar);try{return await o.connection.sendRequest(r,n)}catch(s){throw Vn(this.ctx,"lsp.requestToClient.failure",s,{method:r.method.replaceAll("/",".")}),s}}};p();var TRt=class t extends dee{constructor(r){super(r);this.reportedUnknownProviders=new Set}static{a(this,"AgentRelatedFilesProvider")}get service(){return this.context.get(ar)}static mapProviderNameToNeighboringFileType(r){let n="CSharpCopilotCompletionContextProvider",o="CSharpRoslynCompletionRelatedContextProvider",s="CppCopilotCompletionContextProvider",c="CppCopilotCompletionSemanticCodeContextProvider";switch(r){case n:return"related/csharp";case o:return"related/csharproslyn";case s:return"related/cpp";case c:return"related/cppsemanticcodecontext";default:return"related/other"}}convert(r){let n={entries:[],traits:r.traits};for(let o of r.entries){let s={type:t.mapProviderNameToNeighboringFileType(o.providerName),uris:o.uris};n.entries.push(s),s.type==="related/other"&&!this.reportedUnknownProviders.has(o.providerName)&&(this.reportedUnknownProviders.add(o.providerName),v0.warn(this.context,`unknown providerName ${o.providerName}`))}return n}async getRelatedFilesResponse(r,n,o){v0.debug(this.context,`Fetching related files for ${r.uri}`);let s=this.context.get(bn).getCapabilities().related??!1;if(t.relatedCapabilityTelemetry(this.context,n,s),!s)return v0.debug(this.context,"`copilot/related` not supported"),cri;try{let c=await this.service.connection.sendRequest(JQt.type,{textDocument:{uri:r.uri},data:r.data,telemetry:{properties:n.properties,measurements:n.measurements}},o);return this.convert(c)}catch(c){v0.exception(this.context,c,".copilotRelated");return}}static{this.telemetrySent=!1}static relatedCapabilityTelemetry(r,n,o){try{if(!o||t.telemetrySent)return;t.telemetrySent=!0,Et(r,"copilotRelated.hasRelatedCapability",n)}catch(s){v0.exception(r,s,"copilotRelated")}}};p();p();var Eso=de(ri());p();p();function pso(t,e){return(e<<5)-e+t|0}a(pso,"numberHash");function hso(t,e){e=pso(149417,e);for(let r=0,n=t.length;rnew QN(o,QN.providerId,s,void 0));if(n.status!=="OK"&&n.status!=="MaybeOK")throw new lo(Xe.CodeFlowFailed,`Authentication failed: ${n.status}`)}catch(e){throw e instanceof YU?new lo(Xe.CodeFlowFailed,`OAuth code flow requires a browser but none is available: ${e.message}`):e instanceof yi?new lo(Xe.CodeFlowFailed,`Authentication failed: ${e.message}`):e}}a(BIt,"performACPGitHubOAuth");function FIt(t){if(t!=="github_oauth")throw new lo(Xe.InvalidParams,`Unknown authentication method: ${t}`)}a(FIt,"validateAuthMethodId");async function UIt(t){let r=await t.get(Mr).checkAndUpdateStatus({localChecksOnly:!0});if(r.status!=="OK"&&r.status!=="MaybeOK")throw lo.authRequired()}a(UIt,"requireACPAuthenticated");p();function Uu(t,e,r,n){jl(t,e,r,n)}a(Uu,"telemetryAcp");function fve(t,e,r,n,o){ng(t,e,r,n,o)}a(fve,"telemetryAcpWithError");var kJi=[{id:bl.Ask.id,name:bl.Ask.name,description:bl.Ask.description},{id:bl.Agent.id,name:bl.Agent.name,description:bl.Agent.description}],QIt=class{constructor(e,r){this.connection=e;this.ctx=r;this.sessions=new Map;this.clientCapabilities={readTextFile:!1,writeTextFile:!1}}static{a(this,"CopilotACPAgent")}initialize(e){if(e.clientInfo){let o=this.ctx.get(Ir);o instanceof Aj&&o.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}Uu(this.ctx,"acp.initialize");let r=e.clientCapabilities?.fs;r&&(this.clientCapabilities={readTextFile:r.readTextFile??!1,writeTextFile:r.writeTextFile??!1});let n=[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}];return Promise.resolve({protocolVersion:Yrt,agentCapabilities:{loadSession:!1,promptCapabilities:{audio:!1,embeddedContext:!0,image:!1}},agentInfo:{name:"GitHub Copilot",version:J1(this.ctx)},authMethods:n})}async newSession(e){Uu(this.ctx,"acp.newSession"),await this.requireAuthenticated();let r=Nt(),n=Nt(),s=this.ctx.get(zo).create({source:"panel",conversationId:n}),c=e.cwd?{uri:ts(e.cwd)}:null,l=this.getAvailableModes(),u=this.getDefaultModeId(),{availableModels:d,defaultModelId:f}=await this.getAvailableModels(),h=f;return this.sessions.set(r,{conversationId:n,conversation:s,pendingPrompt:null,cancellationTokenSource:null,workspaceFolder:c,currentModeId:u,currentModelId:h}),{sessionId:r,modes:{currentModeId:u,availableModes:l},models:{currentModelId:h,availableModels:d}}}async authenticate(e){return Uu(this.ctx,"acp.authenticate"),FIt(e.methodId),await BIt(this.ctx),{}}async requireAuthenticated(){await UIt(this.ctx)}async prompt(e){Uu(this.ctx,"acp.prompt"),await this.requireAuthenticated();let r=this.sessions.get(e.sessionId);if(!r)throw new Error(`Session ${e.sessionId} not found`);let n=process.env.GITHUB_COPILOT_ACP_MODEL_ID??r.currentModelId;r.pendingPrompt?.abort(),r.cancellationTokenSource?.cancel(),r.pendingPrompt=new AbortController,r.cancellationTokenSource=new Fn.CancellationTokenSource,r.pendingPrompt.signal.addEventListener("abort",()=>{r.cancellationTokenSource?.cancel()});try{let s={message:this.extractTextFromPrompt(e.prompt),type:"user"},c=Nt(),l=new np(s,c),u=r.currentModeId===bl.Ask.id?bl.Ask:bl.Agent;l.chatMode=u,l.userRequestedModel=n;let d=this.extractReferencesFromPrompt(e.prompt),f=this.ctx.get(zo),h=r.workspaceFolder?[{uri:r.workspaceFolder.uri,name:""}]:void 0;await f.addTurn(r.conversation.id,l,d,void 0,r.workspaceFolder??void 0,h);let m=new LIt(this.connection,e.sessionId),g=new Cw(this.ctx,r.conversation,l,r.cancellationTokenSource.token),A=this.ctx.get(j_);A instanceof sW&&A.setACPContext(this.connection,this.clientCapabilities,e.sessionId);let E=await this.ctx.get(BN).createProcessor(g,e.sessionId);try{await E.process(m,r.cancellationTokenSource.token,void 0,void 0,{id:n})}finally{A instanceof sW&&A.clearACPContext()}return r.pendingPrompt=null,r.cancellationTokenSource=null,{stopReason:"end_turn"}}catch(o){let s=this.ctx.get(j_);if(s instanceof sW&&s.clearACPContext(),r.pendingPrompt?.signal.aborted)return{stopReason:"cancelled"};throw o}}cancel(e){Uu(this.ctx,"acp.cancel");let r=this.sessions.get(e.sessionId);return r?.pendingPrompt?.abort(),r?.cancellationTokenSource?.cancel(),Promise.resolve()}async setSessionMode(e){Uu(this.ctx,"acp.setSessionMode");let r=this.sessions.get(e.sessionId);if(!r)throw new lo(Xe.InvalidParams,`Session ${e.sessionId} not found`);let n=this.getAvailableModes();if(!n.some(s=>s.id===e.modeId))throw new lo(Xe.InvalidParams,`Mode '${e.modeId}' is not available. Available modes: ${n.map(s=>s.id).join(", ")}`);return r.currentModeId=e.modeId,Promise.resolve({})}async unstable_setSessionModel(e){Uu(this.ctx,"acp.setSessionModel");let r=this.sessions.get(e.sessionId);if(!r)throw new lo(Xe.InvalidParams,`Session ${e.sessionId} not found`);let{availableModels:n}=await this.getAvailableModels();if(!n.some(s=>s.modelId===e.modelId))throw new lo(Xe.InvalidParams,`Model '${e.modelId}' is not available. Available models: ${n.map(s=>s.modelId).join(", ")}`);return r.currentModelId=e.modelId,{}}isAgentModeEnabled(){return dx(this.ctx)?.getTokenValue("agent_mode")!=="0"}getAvailableModes(){return this.isAgentModeEnabled()?kJi:kJi.filter(e=>e.id===bl.Ask.id)}getDefaultModeId(){return this.isAgentModeEnabled()?bl.Agent.id:bl.Ask.id}async getAvailableModels(){let e=await this.ctx.get(xs).getMetadata(),r=[],n=K_;r.push({modelId:K_,name:"Auto",description:"Automatically selects the best model for the task"});for(let o of e)o.model_picker_enabled&&o.capabilities.type==="chat"&&this.isModelCompatibleWithAgentMode(o)&&r.push({modelId:o.id,name:o.name,description:this.getModelDescription(o)});return{availableModels:r,defaultModelId:n}}isModelCompatibleWithAgentMode(e){return!(hle.has(e.capabilities.family)||!e.capabilities.supports?.tool_calls||(e.capabilities.limits?.max_prompt_tokens??0)<4e4)}getModelDescription(e){let r=e.billing?.multiplier;if(r!==void 0)return`${r}x`}extractTextFromPrompt(e){return e.filter(r=>r.type==="text").map(r=>r.text).join(` +`)}extractReferencesFromPrompt(e){let r=[];for(let n of e)if(n.type==="resource_link"){let o=n;r.push({type:"file",uri:o.uri})}else if(n.type==="resource"){let o=n;o.resource?.uri&&r.push({type:"file",uri:o.resource.uri})}return r}getFileSystemCapabilities(){return this.clientCapabilities}getConnection(){return this.connection}};p();var PJi=require("node:child_process"),jIt=require("node:stream");var qIt=class{constructor(e,r){this.cliInfo=e;this.ctx=r;this.cliProcess=null;this._cliConnection=null;this.disposed=!1}static{a(this,"CLIProcessManager")}start(e,r){if(this.disposed)throw new Error("CLIProcessManager has been disposed");if(this.cliProcess)throw new Error("CLI process is already running");let n={...process.env,COPILOT_AUTO_UPDATE:"false"};r&&(n.GH_TOKEN=r);let o=[...this.cliInfo.args,"--acp","--stdio"];if(this.cliProcess=(0,PJi.spawn)(this.cliInfo.path,o,{stdio:["pipe","pipe","inherit"],env:n,shell:pUt}),!this.cliProcess.stdin||!this.cliProcess.stdout)throw new Error("Failed to start Copilot CLI process with piped stdio");this.cliProcess.on("error",u=>{fve(this.ctx,"acp.cli.process.error",u)}),this.cliProcess.on("exit",(u,d)=>{this.disposed||Uu(this.ctx,"acp.cli.process.exit",{exitCode:String(u??""),exitSignal:d??""}),this.cliProcess=null});let s=jIt.Writable.toWeb(this.cliProcess.stdin),c=jIt.Readable.toWeb(this.cliProcess.stdout),l=lke(s,c);return this._cliConnection=new tnt(e,l),this._cliConnection}get connection(){return this._cliConnection}get isRunning(){return this.cliProcess!==null&&this.cliProcess.exitCode===null}async kill(){await this.terminateProcess()}async dispose(){this.disposed=!0,await this.terminateProcess()}async terminateProcess(){if(this.cliProcess){try{this.cliProcess.stdin?.end(),this.cliProcess.kill("SIGTERM")}catch{}await new Promise(e=>{if(!this.cliProcess){e();return}let r=setTimeout(()=>{this.cliProcess?.kill("SIGKILL"),e()},3e3);this.cliProcess.once("exit",()=>{clearTimeout(r),e()})}),this.cliProcess=null}this._cliConnection=null}};p();var HIt=class{constructor(e,r,n){this.externalConnection=e;this.ctx=r;this.cliProcessManager=n;this.cliConnection=null;this.initParams=null;this.ensureCLIPromise=null}static{a(this,"CLIProxyAgent")}initialize(e){if(e.clientInfo){let r=this.ctx.get(Ir);r instanceof Aj&&r.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}return Uu(this.ctx,"acp.cli.initialize"),this.initParams=e,Promise.resolve({protocolVersion:Yrt,agentCapabilities:{loadSession:!0,sessionCapabilities:{list:{}},mcpCapabilities:{http:!0,sse:!0},promptCapabilities:{audio:!1,embeddedContext:!0,image:!0}},agentInfo:{name:"GitHub Copilot",version:J1(this.ctx)},authMethods:[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}]})}async authenticate(e){return Uu(this.ctx,"acp.cli.authenticate"),FIt(e.methodId),await BIt(this.ctx),{}}async newSession(e){return Uu(this.ctx,"acp.cli.newSession"),await this.requireAuthenticated(),(await this.ensureCLI()).newSession(e)}async prompt(e){return Uu(this.ctx,"acp.cli.prompt"),await this.requireAuthenticated(),(await this.ensureCLI()).prompt(e)}async cancel(e){return Uu(this.ctx,"acp.cli.cancel"),(await this.ensureCLI()).cancel(e)}async setSessionMode(e){return Uu(this.ctx,"acp.cli.setSessionMode"),(await this.ensureCLI()).setSessionMode(e)}async unstable_setSessionModel(e){return Uu(this.ctx,"acp.cli.setSessionModel"),(await this.ensureCLI()).unstable_setSessionModel(e)}async setSessionConfigOption(e){return Uu(this.ctx,"acp.cli.setSessionConfigOption"),(await this.ensureCLI()).setSessionConfigOption(e)}async loadSession(e){return Uu(this.ctx,"acp.cli.loadSession"),await this.requireAuthenticated(),(await this.ensureCLI()).loadSession(e)}async listSessions(e){return Uu(this.ctx,"acp.cli.listSessions"),await this.requireAuthenticated(),(await this.ensureCLI()).listSessions(e)}async ensureCLI(){if(this.cliConnection)return this.cliConnection;if(!this.initParams)throw new lo(Xe.InternalError,"CLI connection not initialized. Call initialize() first.");if(this.ensureCLIPromise)return this.ensureCLIPromise;this.ensureCLIPromise=this.spawnAndInitializeCLI();try{return await this.ensureCLIPromise}finally{this.ensureCLIPromise=null}}async spawnAndInitializeCLI(){try{let r=(await this.ctx.get(Ft).getGitHubSession())?.accessToken;this.cliConnection=this.cliProcessManager.start(u=>this.createCLIClientHandler(),r);let n=this.initParams.clientInfo,o={name:"GitHub Copilot Language Server",version:J1(this.ctx)},s=n?{...n,_meta:{...n._meta??{},proxyClientInfo:o}}:o,c=this.cliConnection.initialize({protocolVersion:this.initParams.protocolVersion,clientCapabilities:this.initParams.clientCapabilities,clientInfo:s}),l=this.cliConnection.closed.then(()=>{throw new Error("CLI connection closed before initialize response was received")});l.catch(()=>{}),await Promise.race([c,l]),Uu(this.ctx,"acp.cli.handshake",{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source})}catch(e){throw fve(this.ctx,"acp.cli.handshake.error",e,{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source}),this.cliConnection=null,await this.cliProcessManager.kill(),new lo(Xe.InternalError,`Failed to initialize Copilot CLI: ${e instanceof Error?e.message:String(e)}`)}return this.cliConnection}async requireAuthenticated(){await UIt(this.ctx)}createCLIClientHandler(){return{sessionUpdate:a(async e=>{await this.externalConnection.sessionUpdate(e)},"sessionUpdate"),requestPermission:a(async e=>this.externalConnection.requestPermission(e),"requestPermission"),readTextFile:a(async e=>this.externalConnection.readTextFile(e),"readTextFile"),writeTextFile:a(async e=>this.externalConnection.writeTextFile(e),"writeTextFile"),createTerminal:a(async e=>({terminalId:(await this.externalConnection.createTerminal(e)).id}),"createTerminal"),extMethod:a(async(e,r)=>this.externalConnection.extMethod(e,r),"extMethod"),extNotification:a(async(e,r)=>this.externalConnection.extNotification(e,r),"extNotification")}}async dispose(){await this.cliProcessManager.dispose()}};p();p();var bRt=class{static{a(this,"ClaudeCodeSdkWrapper")}_loadSdk(){return this._sdkPromise??=Promise.resolve().then(()=>(_ao(),Eao)),this._sdkPromise}async query(e){return(await this._loadSdk()).query(e)}async listSessions(e){return(await this._loadSdk()).listSessions(e)}async getSessionInfo(e,r){return(await this._loadSdk()).getSessionInfo(e,r)}async getSessionMessages(e,r){return(await this._loadSdk()).getSessionMessages(e,r)}async forkSession(e,r){return(await this._loadSdk()).forkSession(e,r)}};p();p();function vao(t){let e=new gue;e.set(Lo,t),e.set(IC,new IC),e.set(us,new us),e.set(Y2,new Y2);let r=new Ft(e);return e.set(Ft,r),e.set(Jt,new Jt(e)),e.set(iW,new iW(e,r)),e.set(aM,new aM),e.set(Fp,new Fp(e)),e.set(tg,new tg),e.set(TC,new TC),e.set(bO,new Txe),e.set(MP,new Ele),e.set(_P,new xSe),e.set(Dd,new Dd),e.set(n4,new n4(e)),e.set(ni,new ni(e)),e.set(rD,new rD(e)),e.set(O8,Gdt(e)),e.set(cy,new cy),e.set(Db,new Db),e.set(L8,L8.default),e.set(Tf,new Tf(e)),e.set(jx,new jx(e)),e.set(Jp,new Jp),e.set(Pb,new Pb(e)),e.set(kn,new kn),e.set(Eu,new Eu(e)),e.set(CO,new CO(e)),e.set(kN,new kN),e.set(VK,new VK(e)),e}a(vao,"createCommonContext");p();var SRt=class extends Vf{constructor(r){super();this.console=r}static{a(this,"ConsoleLog")}logIt(r,n,o,...s){n==1?this.console.error(`[${o}]`,...s):(n==2||G1t(r))&&this.console.warn(`[${o}]`,...s)}};p();var Tao=require("node:os");var aol=new pe("repository"),_oe="\\\\",Iao="(?:[#;].*)",hCe=`(?:[^"${_oe}]|${_oe}.)`,col="[0-9A-Za-z-]",Cao=`[A-Za-z]${col}*`,xao=`\\s*${Iao}?$`,wao=`(?:[^"${_oe};#]|${_oe}.)`,lol=`(?:"${hCe}*"|"${hCe}*(?${_oe})$)`,uol=`(?:${wao}|${lol})+`,dol=`(?:(?${_oe})$)`,Rao=`(?${uol})${dol}?${xao}`,bao=new RegExp(`^${Rao}`),fol=new RegExp(`^(?${hCe}*(?:(?${_oe})$|(?")))`),pol=new RegExp(`^\\s*(?:(?${Cao})\\s*=\\s*${Rao}|(?${Cao})${xao})`),hol=new RegExp(`(?${wao}+)|"(?${hCe}*)"`,"g"),Sao="[-.0-9A-Za-z]+",mol=`\\s+"(?${hCe}*)"`,gol=`\\s+"(?${hCe}*)"`,Aol=new RegExp(`^\\s*\\[(?:(?${Sao})${mol}|${gol}|(?${Sao}))\\]`),yol=new RegExp(`^\\s*${Iao}$`),hQr=class{constructor(e){this.content=e;this.stopped=!1;this.section="";this.line="";this.lineNum=0;this.lines=[];this.linesWithErrors=[]}static{a(this,"GitConfigParser")}parse(e){for(this.stopped=!1,this.section="",this.line="",this.linesWithErrors=[],this.configValueHandler=e,this.lines=this.content.split(/\r?\n/),this.lineNum=0;!this.stopped&&this.lineNum0}errorAt(e){this.linesWithErrors.push(e)}parseSectionStart(){let e=this.line.match(Aol);e&&(e.groups?.simple?this.section=e.groups.simple.toLowerCase()+"."+this.unescapeBaseValue(e.groups.ext):e.groups?.extOnly?this.section="."+this.unescapeBaseValue(e.groups.extOnly):this.section=e.groups.simpleOnly.toLowerCase(),this.line=this.line.slice(e[0].length))}unescapeBaseValue(e){return e.replace(/\\(.)/g,"$1")}parseConfigPair(){let e=this.line.match(pol);if(e){if(e.groups?.key){let r=this.handleContinued(e);this.configValueHandler?.(this.nameWithSection(e.groups.key.toLowerCase()),r)}else e.groups?.soloKey&&this.configValueHandler?.(this.nameWithSection(e.groups.soloKey.toLowerCase()),"");this.line=""}}handleContinued(e){let r=e,n=[this.matchedValue(r)];for(;r?.groups?.cont||r?.groups?.strCont;){if(this.line=this.lines[++this.lineNum],this.lineNum>=this.lines.length){this.errorAt(this.lineNum);break}r.groups.strCont?(r=this.line.match(fol),r?(n.push(this.matchedValue(r)),r.groups?.quote&&(r=this.line.slice(r[0].length).match(bao),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))):this.errorAt(this.lineNum+1)):(r=this.line.match(bao),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))}return this.normalizeValue(n.join(""))}matchedValue(e){return e.groups.strCont?e.groups.value.slice(0,-1):e.groups.value}normalizeValue(e){let r=!1,n=[...e.matchAll(hol)].map(o=>o.groups?.value?(r=!0,this.unescapeValue(o.groups.value.replace(/\s/g," "))):(r=!1,this.unescapeValue(o.groups.string))).join("");return r?n.trimEnd():n}unescapeValue(e){let r={n:` +`,t:" ",b:"\b"};return e.replace(/\\(.)/g,(n,o)=>r[o]||o)}nameWithSection(e){return this.section?this.section+"."+e:e}parseComment(){yol.test(this.line)&&(this.line="")}},TRt=class extends jP{static{a(this,"GitParsingConfigLoader")}async getConfig(e,r){let n=await Tf.getRepoConfigLocation(e,r);if(!n)return;let o=await this.getParsedConfig(e,n);if(o)return this.mergeConfig(await this.baseConfig(e,n),o)}mergeConfig(...e){return e.filter(r=>r!==void 0).reduce((r,n)=>r.concat(n),new TK)}async getParsedConfig(e,r,n=!0){let o=await this.tryLoadConfig(e,r,n);if(!o)return;let s=new hQr(o),c=new TK;return s.parse((l,u)=>c.add(l,u)),c}async tryLoadConfig(e,r,n){try{return await e.get(Qo).readFileString(r)}catch(o){(n||!(o instanceof Error)||o.code!=="ENOENT")&&aol.warn(e,`Failed to load git config from ${JSON.stringify(r)}:`,o);return}}async baseConfig(e,r){let n=await this.commondirConfigUri(e,r),o=wa(this.xdgConfigUri(),"git","config"),s=wa(this.homeUri(),".gitconfig");return this.mergeConfig(await this.getParsedConfig(e,o,!1),await this.getParsedConfig(e,s,!1),n?await this.getParsedConfig(e,n,!1):void 0)}async commondirConfigUri(e,r){if(Ki(r).toLowerCase()!=="config.worktree")return;let n=mf(r),o=wa(n,"commondir");try{let s=(await e.get(Qo).readFileString(o)).trimEnd();return wa(nz(n,s),"config")}catch{return}}xdgConfigUri(){return typeof process<"u"&&process.env.XDG_CONFIG_HOME?ts(process.env.XDG_CONFIG_HOME):wa(this.homeUri(),".config")}homeUri(){return ts((0,Tao.homedir)())}};p();var kao=require("child_process");var IRt=class extends jP{static{a(this,"GitCLIConfigLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,kao.execFile)(r,n,{cwd:e},(c,l)=>{c?s(c):o(l)})})}async tryRunCommand(e,r,n,o){try{return await this.runCommand(r,n,o)}catch(s){qUt.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getConfig(e,r){let n=Us(r);if(n===void 0)return;let o;try{o=(await mO()).path}catch(c){qUt.info(e,`Skipping git config lookup: ${c.message}`);return}let s=await this.tryRunCommand(e,n,o,["-c","safe.directory=*","config","--list","--null",...this.extraArgs()]);return s?this.extractConfig(s):void 0}extractConfig(e){let r=new TK;for(let n of e.split("\0").filter(o=>o)){let o=n.split(` +`,1)[0],s=n.slice(o.length+1);r.add(o,s)}return r}extraArgs(){return[]}};function Pao(t){let e=vao(t);return Eol(e),e.set(gp,Qot(e)),e.set(Ek,CIt(e)),e.set(jP,new Vze([new IRt,new TRt])),e}a(Pao,"createProductionContext");function Eol(t){t.set(WI,WI.fromEnvironment(!1)),t.set(iB,new ave),t.set(Vf,new SRt(console))}a(Eol,"setupRudimentaryLogging");var uim=new pe("context");p();var sco=require("fs");p();p();var tco=require("node:url");p();p();var mCe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Nao=new Set,mQr=typeof process=="object"&&process?process:{},Mao=a((t,e,r,n)=>{typeof mQr.emitWarning=="function"?mQr.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"emitWarning"),xRt=globalThis.AbortController,Dao=globalThis.AbortSignal;if(typeof xRt>"u"){Dao=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(n,o){this._onabort.push(o)}},xRt=class{static{a(this,"AbortController")}constructor(){e()}signal=new Dao;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let o of this.signal._onabort)o(n);this.signal.onabort?.(n)}}};let t=mQr.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,Mao("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var _ol=a(t=>!Nao.has(t),"shouldWarn");var wW=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),Oao=a(t=>wW(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?gCe:null:null,"getUintArray"),gCe=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},gQr=class t{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let r=Oao(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},C6e=class t{static{a(this,"LRUCache")}#e;#t;#r;#n;#i;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#a;#c;#u;#l;#p;#g;#A;#h;#v;#m;#b;#T;#E;#C;#S;#y;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#E,sizes:e.#b,keyMap:e.#c,keyList:e.#u,valList:e.#l,next:e.#p,prev:e.#g,get head(){return e.#A},get tail(){return e.#h},free:e.#v,isBackgroundFetch:a(r=>e.#f(r),"isBackgroundFetch"),backgroundFetch:a((r,n,o,s)=>e.#U(r,n,o,s),"backgroundFetch"),moveToTail:a(r=>e.#O(r),"moveToTail"),indexes:a(r=>e.#I(r),"indexes"),rindexes:a(r=>e.#x(r),"rindexes"),isStale:a(r=>e.#_(r),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#a}get size(){return this.#s}get fetchMethod(){return this.#i}get memoMethod(){return this.#o}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(e){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,maxEntrySize:A=0,sizeCalculation:y,fetchMethod:E,memoMethod:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:R}=e;if(r!==0&&!wW(r))throw new TypeError("max option must be a nonnegative integer");let x=r?Oao(r):Array;if(!x)throw new Error("invalid max value: "+r);if(this.#e=r,this.#t=g,this.maxEntrySize=A||this.#t,this.sizeCalculation=y,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#o=_,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#i=E,this.#S=!!E,this.#c=new Map,this.#u=new Array(r).fill(void 0),this.#l=new Array(r).fill(void 0),this.#p=new x(r),this.#g=new x(r),this.#A=0,this.#h=0,this.#v=gQr.create(r),this.#s=0,this.#a=0,typeof d=="function"&&(this.#r=d),typeof f=="function"?(this.#n=f,this.#m=[]):(this.#n=void 0,this.#m=void 0),this.#C=!!this.#r,this.#y=!!this.#n,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!w,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!wW(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!wW(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=wW(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!wW(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let P="LRU_CACHE_UNBOUNDED";_ol(P)&&(Nao.add(P),Mao("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,t))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#k(){let e=new gCe(this.#e),r=new gCe(this.#e);this.#E=e,this.#T=r,this.#L=(s,c,l=mCe.now())=>{if(r[s]=c!==0?l:0,e[s]=c,c!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#_(s)&&this.#w(this.#u[s],"expire")},c+1);u.unref&&u.unref()}},this.#R=s=>{r[s]=e[s]!==0?mCe.now():0},this.#d=(s,c)=>{if(e[c]){let l=e[c],u=r[c];if(!l||!u)return;s.ttl=l,s.start=u,s.now=n||o();let d=s.now-u;s.remainingTTL=l-d}};let n=0,o=a(()=>{let s=mCe.now();if(this.ttlResolution>0){n=s;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref()}return s},"getNow");this.getRemainingTTL=s=>{let c=this.#c.get(s);if(c===void 0)return 0;let l=e[c],u=r[c];if(!l||!u)return 1/0;let d=(n||o())-u;return l-d},this.#_=s=>{let c=r[s],l=e[s];return!!l&&!!c&&(n||o())-c>l}}#R=a(()=>{},"#updateItemAge");#d=a(()=>{},"#statusTTL");#L=a(()=>{},"#setItemTTL");#_=a(()=>!1,"#isStale");#D(){let e=new gCe(this.#e);this.#a=0,this.#b=e,this.#P=r=>{this.#a-=e[r],e[r]=0},this.#B=(r,n,o,s)=>{if(this.#f(n))return 0;if(!wW(o))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(o=s(n,r),!wW(o))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o},this.#N=(r,n,o)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#a>s;)this.#M(!0)}this.#a+=e[r],o&&(o.entrySize=n,o.totalCalculatedSize=this.#a)}}#P=a(e=>{},"#removeItemSize");#N=a((e,r,n)=>{},"#addItemSize");#B=a((e,r,n,o)=>{if(n||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#I({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#h;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#A));)r=this.#g[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#A;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#h));)r=this.#p[r]}#F(e){return e!==void 0&&this.#c.get(this.#u[e])===e}*entries(){for(let e of this.#I())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*rentries(){for(let e of this.#x())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*keys(){for(let e of this.#I()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*values(){for(let e of this.#I())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}*rvalues(){for(let e of this.#x())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;if(s!==void 0&&e(s,this.#u[n],this))return this.get(this.#u[n],r)}}forEach(e,r=this){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}rforEach(e,r=this){for(let n of this.#x()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#_(r)&&(this.#w(this.#u[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let n=this.#l[r],o=this.#f(n)?n.__staleWhileFetching:n;if(o===void 0)return;let s={value:o};if(this.#E&&this.#T){let c=this.#E[r],l=this.#T[r];if(c&&l){let u=c-(mCe.now()-l);s.ttl=u,s.start=Date.now()}}return this.#b&&(s.size=this.#b[r]),s}dump(){let e=[];for(let r of this.#I({allowStale:!0})){let n=this.#u[r],o=this.#l[r],s=this.#f(o)?o.__staleWhileFetching:o;if(s===void 0||n===void 0)continue;let c={value:s};if(this.#E&&this.#T){c.ttl=this.#E[r];let l=mCe.now()-this.#T[r];c.start=Math.floor(Date.now()-l)}this.#b&&(c.size=this.#b[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=mCe.now()-o}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:s,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,f=this.#B(e,r,n.size||0,l);if(this.maxEntrySize&&f>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#w(e,"set"),this;let h=this.#s===0?void 0:this.#c.get(e);if(h===void 0)h=this.#s===0?this.#h:this.#v.length!==0?this.#v.pop():this.#s===this.#e?this.#M(!1):this.#s,this.#u[h]=e,this.#l[h]=r,this.#c.set(e,h),this.#p[this.#h]=h,this.#g[h]=this.#h,this.#h=h,this.#s++,this.#N(h,f,u),u&&(u.set="add"),d=!1;else{this.#O(h);let m=this.#l[h];if(r!==m){if(this.#S&&this.#f(m)){m.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!c&&(this.#C&&this.#r?.(g,e,"set"),this.#y&&this.#m?.push([g,e,"set"]))}else c||(this.#C&&this.#r?.(m,e,"set"),this.#y&&this.#m?.push([m,e,"set"]));if(this.#P(h),this.#N(h,f,u),this.#l[h]=r,u){u.set="replace";let g=m&&this.#f(m)?m.__staleWhileFetching:m;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(o!==0&&!this.#E&&this.#k(),this.#E&&(d||this.#L(h,o,s),u&&this.#d(u,h)),!c&&this.#y&&this.#m){let m=this.#m,g;for(;g=m?.shift();)this.#n?.(...g)}return this}pop(){try{for(;this.#s;){let e=this.#l[this.#A];if(this.#M(!0),this.#f(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#y&&this.#m){let e=this.#m,r;for(;r=e?.shift();)this.#n?.(...r)}}}#M(e){let r=this.#A,n=this.#u[r],o=this.#l[r];return this.#S&&this.#f(o)?o.__abortController.abort(new Error("evicted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(o,n,"evict"),this.#y&&this.#m?.push([o,n,"evict"])),this.#P(r),e&&(this.#u[r]=void 0,this.#l[r]=void 0,this.#v.push(r)),this.#s===1?(this.#A=this.#h=0,this.#v.length=0):this.#A=this.#p[r],this.#c.delete(n),this.#s--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:o}=r,s=this.#c.get(e);if(s!==void 0){let c=this.#l[s];if(this.#f(c)&&c.__staleWhileFetching===void 0)return!1;if(this.#_(s))o&&(o.has="stale",this.#d(o,s));else return n&&this.#R(s),o&&(o.has="hit",this.#d(o,s)),!0}else o&&(o.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,o=this.#c.get(e);if(o===void 0||!n&&this.#_(o))return;let s=this.#l[o];return this.#f(s)?s.__staleWhileFetching:s}#U(e,r,n,o){let s=r===void 0?void 0:this.#l[r];if(this.#f(s))return s;let c=new xRt,{signal:l}=n;l?.addEventListener("abort",()=>c.abort(l.reason),{signal:c.signal});let u={signal:c.signal,options:n,context:o},d=a((y,E=!1)=>{let{aborted:_}=c.signal,v=n.ignoreFetchAbort&&y!==void 0;if(n.status&&(_&&!E?(n.status.fetchAborted=!0,n.status.fetchError=c.signal.reason,v&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),_&&!v&&!E)return h(c.signal.reason);let b=g;return this.#l[r]===g&&(y===void 0?b.__staleWhileFetching?this.#l[r]=b.__staleWhileFetching:this.#w(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,y,u.options))),y},"cb"),f=a(y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=y),h(y)),"eb"),h=a(y=>{let{aborted:E}=c.signal,_=E&&n.allowStaleOnFetchAbort,v=_||n.allowStaleOnFetchRejection,b=v||n.noDeleteOnFetchRejection,T=g;if(this.#l[r]===g&&(!b||T.__staleWhileFetching===void 0?this.#w(e,"fetch"):_||(this.#l[r]=T.__staleWhileFetching)),v)return n.status&&T.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw y},"fetchFail"),m=a((y,E)=>{let _=this.#i?.(e,s,u);_&&_ instanceof Promise&&_.then(v=>y(v===void 0?void 0:v),E),c.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(y(void 0),n.allowStaleOnFetchAbort&&(y=a(v=>d(v,!0),"res")))})},"pcall");n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(d,f),A=Object.assign(g,{__abortController:c,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,A,{...u.options,status:void 0}),r=this.#c.get(e)):this.#l[r]=A,A}#f(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof xRt}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:y,forceRefresh:E=!1,status:_,signal:v}=r;if(!this.#S)return _&&(_.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:_});let b={allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,ttl:c,noDisposeOnSet:l,size:u,sizeCalculation:d,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:g,status:_,signal:v},T=this.#c.get(e);if(T===void 0){_&&(_.fetch="miss");let w=this.#U(e,T,b,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let N=n&&w.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",N&&(_.returnedStale=!0)),N?w.__staleWhileFetching:w.__returned=w}let R=this.#_(T);if(!E&&!R)return _&&(_.fetch="hit"),this.#O(T),o&&this.#R(T),_&&this.#d(_,T),w;let x=this.#U(e,T,b,y),D=x.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=R?"stale":"refresh",D&&R&&(_.returnedStale=!0)),D?x.__staleWhileFetching:x.__returned=x}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#o;if(!n)throw new Error("no memoMethod provided to constructor");let{context:o,forceRefresh:s,...c}=r,l=this.get(e,c);if(!s&&l!==void 0)return l;let u=n(e,l,{options:c,context:o});return this.set(e,u,c),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:c}=r,l=this.#c.get(e);if(l!==void 0){let u=this.#l[l],d=this.#f(u);return c&&this.#d(c,l),this.#_(l)?(c&&(c.get="stale"),d?(c&&n&&u.__staleWhileFetching!==void 0&&(c.returnedStale=!0),n?u.__staleWhileFetching:void 0):(s||this.#w(e,"expire"),c&&n&&(c.returnedStale=!0),n?u:void 0)):(c&&(c.get="hit"),d?u.__staleWhileFetching:(this.#O(l),o&&this.#R(l),u))}else c&&(c.get="miss")}#Q(e,r){this.#g[r]=e,this.#p[e]=r}#O(e){e!==this.#h&&(e===this.#A?this.#A=this.#p[e]:this.#Q(this.#g[e],this.#p[e]),this.#Q(this.#h,e),this.#h=e)}delete(e){return this.#w(e,"delete")}#w(e,r){let n=!1;if(this.#s!==0){let o=this.#c.get(e);if(o!==void 0)if(n=!0,this.#s===1)this.#q(r);else{this.#P(o);let s=this.#l[o];if(this.#f(s)?s.__abortController.abort(new Error("deleted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(s,e,r),this.#y&&this.#m?.push([s,e,r])),this.#c.delete(e),this.#u[o]=void 0,this.#l[o]=void 0,o===this.#h)this.#h=this.#g[o];else if(o===this.#A)this.#A=this.#p[o];else{let c=this.#g[o];this.#p[c]=this.#p[o];let l=this.#p[o];this.#g[l]=this.#g[o]}this.#s--,this.#v.push(o)}}if(this.#y&&this.#m?.length){let o=this.#m,s;for(;s=o?.shift();)this.#n?.(...s)}return n}clear(){return this.#q("delete")}#q(e){for(let r of this.#x({allowStale:!0})){let n=this.#l[r];if(this.#f(n))n.__abortController.abort(new Error("deleted"));else{let o=this.#u[r];this.#C&&this.#r?.(n,o,e),this.#y&&this.#m?.push([n,o,e])}}if(this.#c.clear(),this.#l.fill(void 0),this.#u.fill(void 0),this.#E&&this.#T&&(this.#E.fill(0),this.#T.fill(0)),this.#b&&this.#b.fill(0),this.#A=0,this.#h=0,this.#v.length=0,this.#a=0,this.#s=0,this.#y&&this.#m){let r=this.#m,n;for(;n=r?.shift();)this.#n?.(...n)}}};var ECe=require("node:path"),$ao=require("node:url"),tB=require("fs"),kol=fe(require("node:fs"),1),PW=require("node:fs/promises");p();var MRt=require("node:events"),bQr=fe(require("node:stream"),1),Qao=require("node:string_decoder");var Lao=typeof process=="object"&&process?process:{stdout:null,stderr:null},vol=a(t=>!!t&&typeof t=="object"&&(t instanceof kW||t instanceof bQr.default||Col(t)||bol(t)),"isStream"),Col=a(t=>!!t&&typeof t=="object"&&t instanceof MRt.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==bQr.default.Writable.prototype.pipe,"isReadable"),bol=a(t=>!!t&&typeof t=="object"&&t instanceof MRt.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function","isWritable"),lU=Symbol("EOF"),uU=Symbol("maybeEmitEnd"),RW=Symbol("emittedEnd"),wRt=Symbol("emittingEnd"),b6e=Symbol("emittedError"),RRt=Symbol("closed"),Bao=Symbol("read"),kRt=Symbol("flush"),Fao=Symbol("flushChunk"),eM=Symbol("encoding"),ACe=Symbol("decoder"),uA=Symbol("flowing"),S6e=Symbol("paused"),yCe=Symbol("resume"),dA=Symbol("buffer"),nC=Symbol("pipes"),fA=Symbol("bufferLength"),AQr=Symbol("bufferPush"),PRt=Symbol("bufferShift"),m_=Symbol("objectMode"),wh=Symbol("destroyed"),yQr=Symbol("error"),EQr=Symbol("emitData"),Uao=Symbol("emitEnd"),_Qr=Symbol("emitEnd2"),XL=Symbol("async"),vQr=Symbol("abort"),DRt=Symbol("aborted"),T6e=Symbol("signal"),voe=Symbol("dataListeners"),qI=Symbol("discarded"),I6e=a(t=>Promise.resolve().then(t),"defer"),Sol=a(t=>t(),"nodefer"),Tol=a(t=>t==="end"||t==="finish"||t==="prefinish","isEndish"),Iol=a(t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,"isArrayBufferLike"),xol=a(t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),"isArrayBufferView"),NRt=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[yCe](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},CQr=class extends NRt{static{a(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=o=>r.emit("error",o),e.on("error",this.proxyErrors)}},wol=a(t=>!!t.objectMode,"isObjectModeOptions"),Rol=a(t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer","isEncodingOptions"),kW=class extends MRt.EventEmitter{static{a(this,"Minipass")}[uA]=!1;[S6e]=!1;[nC]=[];[dA]=[];[m_];[eM];[XL];[ACe];[lU]=!1;[RW]=!1;[wRt]=!1;[RRt]=!1;[b6e]=null;[fA]=0;[wh]=!1;[T6e];[DRt]=!1;[voe]=0;[qI]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");wol(r)?(this[m_]=!0,this[eM]=null):Rol(r)?(this[eM]=r.encoding,this[m_]=!1):(this[m_]=!1,this[eM]=null),this[XL]=!!r.async,this[ACe]=this[eM]?new Qao.StringDecoder(this[eM]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[dA],"get")}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[nC],"get")});let{signal:n}=r;n&&(this[T6e]=n,n.aborted?this[vQr]():n.addEventListener("abort",()=>this[vQr]()))}get bufferLength(){return this[fA]}get encoding(){return this[eM]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[m_]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[XL]}set async(e){this[XL]=this[XL]||!!e}[vQr](){this[DRt]=!0,this.emit("abort",this[T6e]?.reason),this.destroy(this[T6e]?.reason)}get aborted(){return this[DRt]}set aborted(e){}write(e,r,n){if(this[DRt])return!1;if(this[lU])throw new Error("write after end");if(this[wh])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let o=this[XL]?I6e:Sol;if(!this[m_]&&!Buffer.isBuffer(e)){if(xol(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Iol(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[m_]?(this[uA]&&this[fA]!==0&&this[kRt](!0),this[uA]?this.emit("data",e):this[AQr](e),this[fA]!==0&&this.emit("readable"),n&&o(n),this[uA]):e.length?(typeof e=="string"&&!(r===this[eM]&&!this[ACe]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[eM]&&(e=this[ACe].write(e)),this[uA]&&this[fA]!==0&&this[kRt](!0),this[uA]?this.emit("data",e):this[AQr](e),this[fA]!==0&&this.emit("readable"),n&&o(n),this[uA]):(this[fA]!==0&&this.emit("readable"),n&&o(n),this[uA])}read(e){if(this[wh])return null;if(this[qI]=!1,this[fA]===0||e===0||e&&e>this[fA])return this[uU](),null;this[m_]&&(e=null),this[dA].length>1&&!this[m_]&&(this[dA]=[this[eM]?this[dA].join(""):Buffer.concat(this[dA],this[fA])]);let r=this[Bao](e||null,this[dA][0]);return this[uU](),r}[Bao](e,r){if(this[m_])this[PRt]();else{let n=r;e===n.length||e===null?this[PRt]():typeof n=="string"?(this[dA][0]=n.slice(e),r=n.slice(0,e),this[fA]-=e):(this[dA][0]=n.subarray(e),r=n.subarray(0,e),this[fA]-=e)}return this.emit("data",r),!this[dA].length&&!this[lU]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r="utf8"),e!==void 0&&this.write(e,r),n&&this.once("end",n),this[lU]=!0,this.writable=!1,(this[uA]||!this[S6e])&&this[uU](),this}[yCe](){this[wh]||(!this[voe]&&!this[nC].length&&(this[qI]=!0),this[S6e]=!1,this[uA]=!0,this.emit("resume"),this[dA].length?this[kRt]():this[lU]?this[uU]():this.emit("drain"))}resume(){return this[yCe]()}pause(){this[uA]=!1,this[S6e]=!0,this[qI]=!1}get destroyed(){return this[wh]}get flowing(){return this[uA]}get paused(){return this[S6e]}[AQr](e){this[m_]?this[fA]+=1:this[fA]+=e.length,this[dA].push(e)}[PRt](){return this[m_]?this[fA]-=1:this[fA]-=this[dA][0].length,this[dA].shift()}[kRt](e=!1){do;while(this[Fao](this[PRt]())&&this[dA].length);!e&&!this[dA].length&&!this[lU]&&this.emit("drain")}[Fao](e){return this.emit("data",e),this[uA]}pipe(e,r){if(this[wh])return e;this[qI]=!1;let n=this[RW];return r=r||{},e===Lao.stdout||e===Lao.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[nC].push(r.proxyErrors?new CQr(this,e,r):new NRt(this,e,r)),this[XL]?I6e(()=>this[yCe]()):this[yCe]()),e}unpipe(e){let r=this[nC].find(n=>n.dest===e);r&&(this[nC].length===1?(this[uA]&&this[voe]===0&&(this[uA]=!1),this[nC]=[]):this[nC].splice(this[nC].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);if(e==="data")this[qI]=!1,this[voe]++,!this[nC].length&&!this[uA]&&this[yCe]();else if(e==="readable"&&this[fA]!==0)super.emit("readable");else if(Tol(e)&&this[RW])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[b6e]){let o=r;this[XL]?I6e(()=>o.call(this,this[b6e])):o.call(this,this[b6e])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[voe]=this.listeners("data").length,this[voe]===0&&!this[qI]&&!this[nC].length&&(this[uA]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[voe]=0,!this[qI]&&!this[nC].length&&(this[uA]=!1)),r}get emittedEnd(){return this[RW]}[uU](){!this[wRt]&&!this[RW]&&!this[wh]&&this[dA].length===0&&this[lU]&&(this[wRt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[RRt]&&this.emit("close"),this[wRt]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==wh&&this[wh])return!1;if(e==="data")return!this[m_]&&!n?!1:this[XL]?(I6e(()=>this[EQr](n)),!0):this[EQr](n);if(e==="end")return this[Uao]();if(e==="close"){if(this[RRt]=!0,!this[RW]&&!this[wh])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[b6e]=n,super.emit(yQr,n);let s=!this[T6e]||this.listeners("error").length?super.emit("error",n):!1;return this[uU](),s}else if(e==="resume"){let s=super.emit("resume");return this[uU](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let o=super.emit(e,...r);return this[uU](),o}[EQr](e){for(let n of this[nC])n.dest.write(e)===!1&&this.pause();let r=this[qI]?!1:super.emit("data",e);return this[uU](),r}[Uao](){return this[RW]?!1:(this[RW]=!0,this.readable=!1,this[XL]?(I6e(()=>this[_Qr]()),!0):this[_Qr]())}[_Qr](){if(this[ACe]){let r=this[ACe].end();if(r){for(let n of this[nC])n.dest.write(r);this[qI]||super.emit("data",r)}}for(let r of this[nC])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[m_]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[m_]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[m_])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[eM]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(wh,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[qI]=!1;let e=!1,r=a(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:a(()=>{if(e)return r();let o=this.read();if(o!==null)return Promise.resolve({done:!1,value:o});if(this[lU])return r();let s,c,l=a(h=>{this.off("data",u),this.off("end",d),this.off(wh,f),r(),c(h)},"onerr"),u=a(h=>{this.off("error",l),this.off("end",d),this.off(wh,f),this.pause(),s({value:h,done:!!this[lU]})},"ondata"),d=a(()=>{this.off("error",l),this.off("data",u),this.off(wh,f),r(),s({done:!0,value:void 0})},"onend"),f=a(()=>l(new Error("stream destroyed")),"ondestroy");return new Promise((h,m)=>{c=m,s=h,this.once(wh,f),this.once("error",l),this.once("end",d),this.once("data",u)})},"next"),throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[qI]=!1;let e=!1,r=a(()=>(this.pause(),this.off(yQr,r),this.off(wh,r),this.off("end",r),e=!0,{done:!0,value:void 0}),"stop"),n=a(()=>{if(e)return r();let o=this.read();return o===null?r():{done:!1,value:o}},"next");return this.once("end",r),this.once(yQr,r),this.once(wh,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[wh])return e?this.emit("error",e):this.emit(wh),this;this[wh]=!0,this[qI]=!0,this[dA].length=0,this[fA]=0;let r=this;return typeof r.close=="function"&&!this[RRt]&&r.close(),e?this.emit("error",e):this.emit(wh),this}static get isStream(){return vol}};var Pol=tB.realpathSync.native,w6e={lstatSync:tB.lstatSync,readdir:tB.readdir,readdirSync:tB.readdirSync,readlinkSync:tB.readlinkSync,realpathSync:Pol,promises:{lstat:PW.lstat,readdir:PW.readdir,readlink:PW.readlink,realpath:PW.realpath}},Vao=a(t=>!t||t===w6e||t===kol?w6e:{...w6e,...t,promises:{...w6e.promises,...t.promises||{}}},"fsFromOption"),Wao=/^\\\\\?\\([a-z]:)\\?$/i,Dol=a(t=>t.replace(/\//g,"\\").replace(Wao,"$1\\"),"uncToDrive"),Nol=/[\\\/]/,Mk=0,zao=1,Yao=2,eB=4,Kao=6,Jao=8,Coe=10,Zao=12,Nk=15,x6e=~Nk,SQr=16,qao=32,R6e=64,tM=128,ORt=256,BRt=512,jao=R6e|tM|BRt,Mol=1023,TQr=a(t=>t.isFile()?Jao:t.isDirectory()?eB:t.isSymbolicLink()?Coe:t.isCharacterDevice()?Yao:t.isBlockDevice()?Kao:t.isSocket()?Zao:t.isFIFO()?zao:Mk,"entToType"),Hao=new Map,k6e=a(t=>{let e=Hao.get(t);if(e)return e;let r=t.normalize("NFKD");return Hao.set(t,r),r},"normalize"),Gao=new Map,LRt=a(t=>{let e=Gao.get(t);if(e)return e;let r=k6e(t.toLowerCase());return Gao.set(t,r),r},"normalizeNocase"),FRt=class extends C6e{static{a(this,"ResolveCache")}constructor(){super({max:256})}},IQr=class extends C6e{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(r=>r.length+1,"sizeCalculation")})}},Xao=Symbol("PathScurry setAsCwd"),g_=class{static{a(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#r;get mode(){return this.#r}#n;get nlink(){return this.#n}#i;get uid(){return this.#i}#o;get gid(){return this.#o}#s;get rdev(){return this.#s}#a;get blksize(){return this.#a}#c;get ino(){return this.#c}#u;get size(){return this.#u}#l;get blocks(){return this.#l}#p;get atimeMs(){return this.#p}#g;get mtimeMs(){return this.#g}#A;get ctimeMs(){return this.#A}#h;get birthtimeMs(){return this.#h}#v;get atime(){return this.#v}#m;get mtime(){return this.#m}#b;get ctime(){return this.#b}#T;get birthtime(){return this.#T}#E;#C;#S;#y;#k;#R;#d;#L;#_;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=Mk,n,o,s,c,l){this.name=e,this.#E=s?LRt(e):k6e(e),this.#d=r&Mol,this.nocase=s,this.roots=o,this.root=n||this,this.#L=c,this.#S=l.fullpath,this.#k=l.relative,this.#R=l.relativePosix,this.parent=l.parent,this.parent?this.#e=this.parent.#e:this.#e=Vao(l.fs)}depth(){return this.#C!==void 0?this.#C:this.parent?this.#C=this.parent.depth()+1:this.#C=0}childrenCache(){return this.#L}resolve(e){if(!e)return this;let r=this.getRootString(e),o=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#P(o):this.#P(o)}#P(e){let r=this;for(let n of e)r=r.child(n);return r}children(){let e=this.#L.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#L.set(this,r),this.#d&=~SQr,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),o=this.nocase?LRt(e):k6e(e);for(let u of n)if(u.#E===o)return u;let s=this.parent?this.sep:"",c=this.#S?this.#S+s+e:void 0,l=this.newChild(e,Mk,{...r,parent:this,fullpath:c});return this.canReaddir()||(l.#d|=tM),n.push(l),l}relative(){if(this.isCWD)return"";if(this.#k!==void 0)return this.#k;let e=this.name,r=this.parent;if(!r)return this.#k=this.name;let n=r.relative();return n+(!n||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,r=this.parent;if(!r)return this.#R=this.fullpathPosix();let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.name;let o=r.fullpath()+(r.parent?this.sep:"")+e;return this.#S=o}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let o=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(o)?this.#y=`//?/${o}`:this.#y=o}let e=this.parent,r=e.fullpathPosix(),n=r+(!r||!e.parent?"":"/")+this.name;return this.#y=n}isUnknown(){return(this.#d&Nk)===Mk}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#d&Nk)===Jao}isDirectory(){return(this.#d&Nk)===eB}isCharacterDevice(){return(this.#d&Nk)===Yao}isBlockDevice(){return(this.#d&Nk)===Kao}isFIFO(){return(this.#d&Nk)===zao}isSocket(){return(this.#d&Nk)===Zao}isSymbolicLink(){return(this.#d&Coe)===Coe}lstatCached(){return this.#d&qao?this:void 0}readlinkCached(){return this.#_}realpathCached(){return this.#D}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#_)return!0;if(!this.parent)return!1;let e=this.#d&Nk;return!(e!==Mk&&e!==Coe||this.#d&ORt||this.#d&tM)}calledReaddir(){return!!(this.#d&SQr)}isENOENT(){return!!(this.#d&tM)}isNamed(e){return this.nocase?this.#E===LRt(e):this.#E===k6e(e)}async readlink(){let e=this.#_;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(r);if(n)return this.#_=n}catch(r){this.#f(r.code);return}}readlinkSync(){let e=this.#_;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(r);if(n)return this.#_=n}catch(r){this.#f(r.code);return}}#N(e){this.#d|=SQr;for(let r=e.provisional;rn(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);r?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#H.push(e),this.#G)return;this.#G=!0;let o=this.fullpath();this.#e.readdir(o,{withFileTypes:!0},(s,c)=>{if(s)this.#M(s.code),n.provisional=0;else{for(let l of c)this.#Q(l,n);this.#N(n)}this.#V(n.slice(0,n.provisional))})}#j;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#j)await this.#j;else{let n=a(()=>{},"resolve");this.#j=new Promise(o=>n=o);try{for(let o of await this.#e.promises.readdir(r,{withFileTypes:!0}))this.#Q(o,e);this.#N(e)}catch(o){this.#M(o.code),e.provisional=0}this.#j=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let n of this.#e.readdirSync(r,{withFileTypes:!0}))this.#Q(n,e);this.#N(e)}catch(n){this.#M(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#d&jao)return!1;let e=Nk&this.#d;return e===Mk||e===eB||e===Coe}shouldWalk(e,r){return(this.#d&eB)===eB&&!(this.#d&jao)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#D)return this.#D;if(!((BRt|ORt|tM)&this.#d))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}realpathSync(){if(this.#D)return this.#D;if(!((BRt|ORt|tM)&this.#d))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}[Xao](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],o=this;for(;o&&o.parent;)r.add(o),o.#k=n.join(this.sep),o.#R=n.join("/"),o=o.parent,n.push("..");for(o=e;o&&o.parent&&!r.has(o);)o.#k=void 0,o.#R=void 0,o=o.parent}},URt=class t extends g_{static{a(this,"PathWin32")}sep="\\";splitSep=Nol;constructor(e,r=Mk,n,o,s,c,l){super(e,r,n,o,s,c,l)}newChild(e,r=Mk,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return ECe.win32.parse(e).root}getRoot(e){if(e=Dol(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=n;return this.roots[e]=new _Ce(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Wao,"$1\\"),e===r}},QRt=class t extends g_{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,r=Mk,n,o,s,c,l){super(e,r,n,o,s,c,l)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=Mk,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},qRt=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#t;#r;nocase;#n;constructor(e=process.cwd(),r,n,{nocase:o,childrenCacheSize:s=16*1024,fs:c=w6e}={}){this.#n=Vao(c),(e instanceof URL||e.startsWith("file://"))&&(e=(0,$ao.fileURLToPath)(e));let l=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),this.#e=new FRt,this.#t=new FRt,this.#r=new IQr(s);let u=l.substring(this.rootPath.length).split(n);if(u.length===1&&!u[0]&&u.pop(),o===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=o,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let d=this.root,f=u.length-1,h=r.sep,m=this.rootPath,g=!1;for(let A of u){let y=f--;d=d.child(A,{relative:new Array(y).fill("..").join(h),relativePosix:new Array(y).fill("..").join("/"),fullpath:m+=(g?"":h)+A}),g=!0}this.cwd=d}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let r="";for(let s=e.length-1;s>=0;s--){let c=e[s];if(!(!c||c===".")&&(r=r?`${c}/${r}`:c,this.isAbsolute(c)))break}let n=this.#e.get(r);if(n!==void 0)return n;let o=this.cwd.resolve(r).fullpath();return this.#e.set(r,o),o}resolvePosix(...e){let r="";for(let s=e.length-1;s>=0;s--){let c=e[s];if(!(!c||c===".")&&(r=r?`${c}/${r}`:c,this.isAbsolute(c)))break}let n=this.#t.get(r);if(n!==void 0)return n;let o=this.cwd.resolve(r).fullpathPosix();return this.#t.set(r,o),o}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof g_||(r=e,e=this.cwd);let{withFileTypes:n}=r;if(e.canReaddir()){let o=await e.readdir();return n?o:o.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof g_||(r=e,e=this.cwd);let{withFileTypes:n=!0}=r;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(o=>o.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof g_||(r=e.withFileTypes,e=this.cwd);let n=await e.readlink();return r?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof g_||(r=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return r?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof g_||(r=e.withFileTypes,e=this.cwd);let n=await e.realpath();return r?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof g_||(r=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return r?n:n?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof g_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=[];(!s||s(e))&&l.push(n?e:e.fullpath());let u=new Set,d=a((h,m)=>{u.add(h),h.readdirCB((g,A)=>{if(g)return m(g);let y=A.length;if(!y)return m();let E=a(()=>{--y===0&&m()},"next");for(let _ of A)(!s||s(_))&&l.push(n?_:_.fullpath()),o&&_.isSymbolicLink()?_.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(u,c)?d(v,E):E()):_.shouldWalk(u,c)?d(_,E):E()},!0)},"walk"),f=e;return new Promise((h,m)=>{d(f,g=>{if(g)return m(g);h(l)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof g_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=[];(!s||s(e))&&l.push(n?e:e.fullpath());let u=new Set([e]);for(let d of u){let f=d.readdirSync();for(let h of f){(!s||s(h))&&l.push(n?h:h.fullpath());let m=h;if(h.isSymbolicLink()){if(!(o&&(m=h.realpathSync())))continue;m.isUnknown()&&m.lstatSync()}m.shouldWalk(u,c)&&u.add(m)}}return l}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof g_||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof g_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r;(!s||s(e))&&(yield n?e:e.fullpath());let l=new Set([e]);for(let u of l){let d=u.readdirSync();for(let f of d){(!s||s(f))&&(yield n?f:f.fullpath());let h=f;if(f.isSymbolicLink()){if(!(o&&(h=f.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(l,c)&&l.add(h)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof g_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new kW({objectMode:!0});(!s||s(e))&&l.write(n?e:e.fullpath());let u=new Set,d=[e],f=0,h=a(()=>{let m=!1;for(;!m;){let g=d.shift();if(!g){f===0&&l.end();return}f++,u.add(g);let A=a((E,_,v=!1)=>{if(E)return l.emit("error",E);if(o&&!v){let b=[];for(let T of _)T.isSymbolicLink()&&b.push(T.realpath().then(w=>w?.isUnknown()?w.lstat():w));if(b.length){Promise.all(b).then(()=>A(null,_,!0));return}}for(let b of _)b&&(!s||s(b))&&(l.write(n?b:b.fullpath())||(m=!0));f--;for(let b of _){let T=b.realpathCached()||b;T.shouldWalk(u,c)&&d.push(T)}m&&!l.flowing?l.once("drain",h):y||h()},"onReaddir"),y=!0;g.readdirCB(A,!0),y=!1}},"process");return h(),l}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof g_||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new kW({objectMode:!0}),u=new Set;(!s||s(e))&&l.write(n?e:e.fullpath());let d=[e],f=0,h=a(()=>{let m=!1;for(;!m;){let g=d.shift();if(!g){f===0&&l.end();return}f++,u.add(g);let A=g.readdirSync();for(let y of A)(!s||s(y))&&(l.write(n?y:y.fullpath())||(m=!0));f--;for(let y of A){let E=y;if(y.isSymbolicLink()){if(!(o&&(E=y.realpathSync())))continue;E.isUnknown()&&E.lstatSync()}E.shouldWalk(u,c)&&d.push(E)}}m&&!l.flowing&&l.once("drain",h)},"process");return h(),l}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[Xao](r)}},_Ce=class extends qRt{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,ECe.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let o=this.cwd;o;o=o.parent)o.nocase=this.nocase}parseRootPath(e){return ECe.win32.parse(e).root.toUpperCase()}newRoot(e){return new URt(this.rootPath,eB,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},vCe=class extends qRt{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,ECe.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new QRt(this.rootPath,eB,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},P6e=class extends vCe{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},Sim=process.platform==="win32"?URt:QRt,eco=process.platform==="win32"?_Ce:process.platform==="darwin"?P6e:vCe;p();var Ool=a(t=>t.length>=1,"isPatternList"),Lol=a(t=>t.length>=1,"isGlobList"),CCe=class t{static{a(this,"Pattern")}#e;#t;#r;length;#n;#i;#o;#s;#a;#c;#u=!0;constructor(e,r,n,o){if(!Ool(e))throw new TypeError("empty pattern list");if(!Lol(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=r,this.#r=n,this.#n=o,this.#r===0){if(this.isUNC()){let[s,c,l,u,...d]=this.#e,[f,h,m,g,...A]=this.#t;d[0]===""&&(d.shift(),A.shift());let y=[s,c,l,u,""].join("/"),E=[f,h,m,g,""].join("/");this.#e=[y,...d],this.#t=[E,...A],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...c]=this.#e,[l,...u]=this.#t;c[0]===""&&(c.shift(),u.shift());let d=s+"/",f=l+"/";this.#e=[d,...c],this.#t=[f,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===eh}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#o=this.#o||(this.#r===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new t(this.#e,this.#t,this.#r+1,this.#n),this.#i.#c=this.#c,this.#i.#a=this.#a,this.#i.#s=this.#s,this.#i):this.#i=null}isUNC(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=this.#n==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#s!==void 0?this.#s:this.#s=this.#n==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};p();p();var Bol=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",bCe=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:o,noglobstar:s,platform:c=Bol}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=c,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:o,noglobstar:s,optimizationLevel:2,platform:c,nocomment:!0,nonegate:!0};for(let l of e)this.add(l)}add(e){let r=new G_(e,this.mmopts);for(let n=0;n[e,!!(r&2),!!(r&1)])}},RQr=class{static{a(this,"SubWalks")}store=new Map;add(e,r){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(o=>o.globString()===r.globString())||n.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},D6e=class t{static{a(this,"Processor")}hasWalkedCache;matches=new wQr;subwalks=new RQr;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new xQr}processPatterns(e,r){this.patterns=r;let n=r.map(o=>[e,o]);for(let[o,s]of n){this.hasWalkedCache.storeWalked(o,s);let c=s.root(),l=s.isAbsolute()&&this.opts.absolute!==!1;if(c){o=o.resolve(c==="/"&&this.opts.root!==void 0?this.opts.root:c);let h=s.rest();if(h)s=h;else{this.matches.add(o,!0,!1);continue}}if(o.isENOENT())continue;let u,d,f=!1;for(;typeof(u=s.pattern())=="string"&&(d=s.rest());)o=o.resolve(u),s=d,f=!0;if(u=s.pattern(),d=s.rest(),f){if(this.hasWalkedCache.hasWalked(o,s))continue;this.hasWalkedCache.storeWalked(o,s)}if(typeof u=="string"){let h=u===".."||u===""||u===".";this.matches.add(o.resolve(u),l,h);continue}else if(u===eh){(!o.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(o,s);let h=d?.pattern(),m=d?.rest();if(!d||(h===""||h===".")&&!m)this.matches.add(o,l,h===""||h===".");else if(h===".."){let g=o.parent||o;m?this.hasWalkedCache.hasWalked(g,m)||this.subwalks.add(g,m):this.matches.add(g,l,!0)}}else u instanceof RegExp&&this.subwalks.add(o,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let n=this.subwalks.get(e),o=this.child();for(let s of r)for(let c of n){let l=c.isAbsolute(),u=c.pattern(),d=c.rest();u===eh?o.testGlobstar(s,c,d,l):u instanceof RegExp?o.testRegExp(s,u,d,l):o.testString(s,u,d,l)}return o}testGlobstar(e,r,n,o){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,o,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(e,n):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),o);else if(s===".."){let c=e.parent||e;this.subwalks.add(c,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),o)}}testRegExp(e,r,n,o){r.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,o,!1))}testString(e,r,n,o){e.isNamed(r)&&(n?this.subwalks.add(e,n):this.matches.add(e,o,!1))}};var Fol=a((t,e)=>typeof t=="string"?new bCe([t],e):Array.isArray(t)?new bCe(t,e):t,"makeIgnore"),jRt=class{static{a(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#r;signal;maxDepth;includeChildMatches;constructor(e,r,n){if(this.patterns=e,this.path=r,this.opts=n,this.#r=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=Fol(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!="function")){let o="cannot ignore child matches, ignore lacks add() method.";throw new Error(o)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#i(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let c=await s.realpath();c&&(c.isUnknown()||this.opts.stat)&&await c.lstat()}return this.matchCheckTest(s,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let c=s.realpathSync();c&&(c?.isUnknown()||this.opts.stat)&&c.lstatSync()}return this.matchCheckTest(s,r)}matchFinish(e,r){if(this.#n(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let o=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+o)}else{let s=this.opts.posix?e.relativePosix():e.relative(),c=this.opts.dotRelative&&!s.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(s?c+s+o:"."+o)}}async match(e,r,n){let o=await this.matchCheck(e,n);o&&this.matchFinish(o,r)}matchSync(e,r,n){let o=this.matchCheckSync(e,n);o&&this.matchFinish(o,r)}walkCB(e,r,n){this.signal?.aborted&&n(),this.walkCB2(e,r,new D6e(this.opts),n)}walkCB2(e,r,n,o){if(this.#i(e))return o();if(this.signal?.aborted&&o(),this.paused){this.onResume(()=>this.walkCB2(e,r,n,o));return}n.processPatterns(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||(s++,this.match(l,u,d).then(()=>c()));for(let l of n.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let u=l.readdirCached();l.calledReaddir()?this.walkCB3(l,u,n,c):l.readdirCB((d,f)=>this.walkCB3(l,f,n,c),!0)}c()}walkCB3(e,r,n,o){n=n.filterEntries(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||(s++,this.match(l,u,d).then(()=>c()));for(let[l,u]of n.subwalks.entries())s++,this.walkCB2(l,u,n.child(),c);c()}walkCBSync(e,r,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,r,new D6e(this.opts),n)}walkCB2Sync(e,r,n,o){if(this.#i(e))return o();if(this.signal?.aborted&&o(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,n,o));return}n.processPatterns(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||this.matchSync(l,u,d);for(let l of n.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let u=l.readdirSync();this.walkCB3Sync(l,u,n,c)}c()}walkCB3Sync(e,r,n,o){n=n.filterEntries(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||this.matchSync(l,u,d);for(let[l,u]of n.subwalks.entries())s++,this.walkCB2Sync(l,u,n.child(),c);c()}},N6e=class extends jRt{static{a(this,"GlobWalker")}matches=new Set;constructor(e,r,n){super(e,r,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},M6e=class extends jRt{static{a(this,"GlobStream")}results;constructor(e,r,n){super(e,r,n),this.results=new kW({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var Uol=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",rM=class{static{a(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,tco.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=r.platform||Uol,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=r.platform==="win32"?_Ce:r.platform==="darwin"?P6e:r.platform?vCe:eco;this.scurry=new u(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",o={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(u=>new G_(u,o)),[c,l]=s.reduce((u,d)=>(u[0].push(...d.set),u[1].push(...d.globParts),u),[[],[]]);this.patterns=c.map((u,d)=>{let f=l[d];if(!f)throw new Error("invalid pattern object");return new CCe(u,f,0,this.platform)})}async walk(){return[...await new N6e(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new N6e(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new M6e(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new M6e(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};p();var kQr=a((t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new G_(r,e).hasMagic())return!0;return!1},"hasMagic");function GRt(t,e={}){return new rM(t,e).streamSync()}a(GRt,"globStreamSync");function nco(t,e={}){return new rM(t,e).stream()}a(nco,"globStream");function ico(t,e={}){return new rM(t,e).walkSync()}a(ico,"globSync");async function rco(t,e={}){return new rM(t,e).walk()}a(rco,"glob_");function $Rt(t,e={}){return new rM(t,e).iterateSync()}a($Rt,"globIterateSync");function oco(t,e={}){return new rM(t,e).iterate()}a(oco,"globIterate");var Qol=GRt,qol=Object.assign(nco,{sync:GRt}),jol=$Rt,Hol=Object.assign(oco,{sync:$Rt}),Gol=Object.assign(ico,{stream:GRt,iterate:$Rt}),HRt=Object.assign(rco,{glob:rco,globSync:ico,sync:Gol,globStream:nco,stream:qol,globStreamSync:GRt,streamSync:Qol,globIterate:oco,iterate:Hol,globIterateSync:$Rt,iterateSync:jol,Glob:rM,hasMagic:kQr,escape:Vle,unescape:HP});HRt.glob=HRt;var O6e=class t{constructor(){this.logger=new pe("PromptFileLocator")}static{a(this,"PromptFileLocator")}static{this.STAT_CONCURRENCY=32}async listFiles(e,r,n){let o=e.get(PA),s=r.map(d=>ln(d.uri)),l=o.resolvePatterns(n,s).map(async d=>{let f=d.metadata?[d.metadata]:void 0,h=a((m,g)=>({uri:m,watchable:d.watchable,cacheable:d.cacheable,metadata:f,classification:d.classification,timestamp:g}),"build");if(d.isGlob)return(await this.globFiles(d.pattern,e)).map(g=>h(ts(g.path),g.timestamp));{let m=await this.getExactFile(e,d.pattern);return m?[h(m.uri,m.timestamp)]:[]}}),u=await Promise.all(l);return this.deduplicateFiles(u.flat())}async globFiles(e,r){let n;try{n=await HRt(e,{dot:!0,nodir:!0,absolute:!0})}catch{return[]}return this.statGlobMatches(r,n)}async statGlobMatches(e,r){let n=[];for(let o=0;o{try{let u=await sco.promises.stat(l);return u.isFile()?{path:l,timestamp:u.mtimeMs}:void 0}catch(u){this.logger.warn(e,`Skipping prompt file ${l} because it could not be stat'd:`,u);return}}));n.push(...c.filter(l=>l!==void 0))}return n}async getExactFile(e,r){let n=ts(r);try{let o=await e.get(Qo).stat(n);return(o.type&1)!==0?{uri:n,timestamp:o.mtime}:void 0}catch{return}}deduplicateFiles(e){let r=new Map;for(let n of e){let o=r.get(n.uri);if(!o){r.set(n.uri,n);continue}let s=o.watchable||n.watchable,c=o.cacheable||n.cacheable,l=n.metadata?.length?[...o.metadata??[],...n.metadata]:o.metadata,u=Math.max(o.timestamp,n.timestamp);(s!==o.watchable||c!==o.cacheable||l!==o.metadata||u!==o.timestamp)&&r.set(n.uri,{...o,watchable:s,cacheable:c,metadata:l,timestamp:u})}return Array.from(r.values())}};p();var Dom=new pe("exp");function cco(t){let e=t.get(Jt);e.registerStaticFilters(Wol(t)),e.registerDynamicFilter("X-Copilot-OverrideEngine",()=>Rt(t,ze.DebugOverrideEngine)||Rt(t,ze.DebugOverrideEngineLegacy)),e.registerDynamicFilter("X-VSCode-ExtensionName",()=>P7e()?"copilot-web":t.get(Ir).getEditorPluginInfo().name),e.registerDynamicFilter("X-VSCode-ExtensionVersion",()=>aco(t)),e.registerDynamicFilter(Moe.CopilotRelatedPluginVersionGithubCopilot,()=>aco(t)),e.registerDynamicFilter("X-VSCode-ExtensionRelease",()=>$ol(t)),e.registerDynamicFilter("X-VSCode-Build",()=>t.get(Ir).getEditorInfo().name),e.registerDynamicFilter("X-VSCode-AppVersion",()=>VRt(t.get(Ir).getEditorInfo().version)),e.registerDynamicFilter("X-VSCode-TargetPopulation",()=>Vol(t)),e.registerDynamicFilter("X-VSCode-DevDeviceId",()=>t.get($I).getIdSync()),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getRelatedPluginInfo()){let o=S_+n.name.replace(/[^A-Za-z]/g,"").toLowerCase();if(!Object.values(Moe).includes(o)){C9e(t,{reason:`A filter could not be registered for the unrecognized related plugin "${n.name}".`});continue}r[o]=VRt(n.version)}return r}),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Ir).getEditorPluginSpecificFilters()){let o=n.isVersion?VRt(n.value):n.value;r[n.filter]=o}return r})}a(cco,"setupExperimentationService");function aco(t){return VRt(!t.get(us).isProduction()&&t.get(Ir).getEditorPluginInfo().name==="copilot"?"1.999.0":t.get(Ir).getEditorPluginInfo().version)}a(aco,"getEditorPluginVersion");function $ol(t){let e=t.get(Ir).getEditorPluginInfo();return e.name==="copilot-intellij"&&e.version.endsWith("nightly")?"nightly":"stable"}a($ol,"getPluginRelease");function Vol(t){let e=t.get(Ir).getEditorInfo();return e.name==="vscode"&&e.version.endsWith("-insider")?"insider":"public"}a(Vol,"getTargetPopulation");function Wol(t){return zol(t)}a(Wol,"createAllFilters");function zol(t){let e=t.get(qa);return{"X-MSEdge-ClientId":e.machineId,"X-Copilot-ClientVersion":t.get(us).isProduction()?J1(t):"1.999.0"}}a(zol,"createDefaultFilters");function VRt(t){return t.split("-")[0]}a(VRt,"trimVersionSuffix");p();p();var Yol=new Set(["__proto__","constructor","prototype"]);function rB(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}a(rB,"asObject");function WRt(t){return Object.entries(t).filter(([e])=>!Yol.has(e))}a(WRt,"safeEntries");function PQr(t){if(Array.isArray(t))return t.map(PQr);let e=rB(t);return e?Object.fromEntries(WRt(e).map(([r,n])=>[r,PQr(n)])):t}a(PQr,"sanitizeRaw");function DQr(t){let e=rB(t);if(!e)return;let r={};for(let[n,o]of WRt(e))typeof o=="string"&&(r[n]=o);return r}a(DQr,"normalizeStringRecord");function Kol(t){let e=rB(t);if(!e)return;let r={};return e.disableBypassPermissionsMode==="disable"&&(r.disableBypassPermissionsMode="disable"),typeof e.model=="string"&&(r.model=e.model),r}a(Kol,"normalizePermissions");function Jol(t){let e=rB(t);if(!e)return;let r={};for(let[n,o]of WRt(e))typeof o=="boolean"&&(r[n]=o);return r}a(Jol,"normalizeEnabledPlugins");function lco(t){let e=rB(t);if(!(!e||typeof e.source!="string"))switch(e.source){case"github":return typeof e.repo!="string"||!/^[^/:]+\/[^/:]+$/.test(e.repo)?void 0:{source:"github",repo:e.repo,...typeof e.ref=="string"&&{ref:e.ref},...typeof e.path=="string"&&{path:e.path}};case"git":return typeof e.url!="string"?void 0:{source:"git",url:e.url,...typeof e.ref=="string"&&{ref:e.ref},...typeof e.path=="string"&&{path:e.path}};case"directory":return typeof e.path=="string"?{source:"directory",path:e.path}:void 0;default:return}}a(lco,"normalizeMarketplaceSource");function Zol(t){let e=rB(t);if(!e)return;let r={};for(let[n,o]of WRt(e)){let s=rB(o),c=lco(s?.source);c&&(r[n]={source:c})}return r}a(Zol,"normalizeExtraKnownMarketplaces");function Xol(t){let e=rB(t);if(!(!e||typeof e.source!="string"))switch(e.source){case"github":case"git":case"directory":return lco(t);case"url":{if(typeof e.url!="string")return;let r=DQr(e.headers);return{source:"url",url:e.url,...r!==void 0&&{headers:r}}}case"npm":return typeof e.package=="string"?{source:"npm",package:e.package}:void 0;case"file":return typeof e.path=="string"?{source:"file",path:e.path}:void 0;case"hostPattern":return typeof e.hostPattern=="string"?{source:"hostPattern",hostPattern:e.hostPattern}:void 0;case"pathPattern":return typeof e.pathPattern=="string"?{source:"pathPattern",pathPattern:e.pathPattern}:void 0;default:return}}a(Xol,"normalizeStrictMarketplaceEntry");function esl(t){if(!Array.isArray(t))return;let e=[];for(let r of t){let n=Xol(r);n&&e.push(n)}return e}a(esl,"normalizeStrictKnownMarketplaces");function tsl(t){let e=rB(t);if(!e)return;let r={};typeof e.enabled=="boolean"&&(r.enabled=e.enabled),typeof e.endpoint=="string"&&(r.endpoint=e.endpoint),typeof e.protocol=="string"&&(r.protocol=e.protocol),typeof e.captureContent=="boolean"&&(r.captureContent=e.captureContent),typeof e.lockCaptureContent=="boolean"&&(r.lockCaptureContent=e.lockCaptureContent),typeof e.serviceName=="string"&&(r.serviceName=e.serviceName);let n=DQr(e.headers);n&&(r.headers=n);let o=DQr(e.resourceAttributes);return o&&(r.resourceAttributes=o),r}a(tsl,"normalizeTelemetry");function uco(t){let e=rB(t);if(!e)return{};let r=PQr(e),n=Kol(r.permissions),o=Jol(r.enabledPlugins),s=Zol(r.extraKnownMarketplaces),c=esl(r.strictKnownMarketplaces),l=tsl(r.telemetry);return{...n!==void 0&&{permissions:n},...o!==void 0&&{enabledPlugins:o},...s!==void 0&&{extraKnownMarketplaces:s},...c!==void 0&&{strictKnownMarketplaces:c},...l!==void 0&&{telemetry:l},raw:r}}a(uco,"normalizeManagedSettings");p();var rsl="managedSettings.fetch";function dco(t,e,r){jl(t,rsl,{result:r.result,channel:e,force:String(r.force),retainedLastKnownGood:String(r.retainedLastKnownGood)},{...r.durationMs!==void 0&&{durationMs:r.durationMs},...r.payloadBytes!==void 0&&{payloadBytes:r.payloadBytes},...r.httpStatus!==void 0&&{httpStatus:r.httpStatus}})}a(dco,"emitManagedSettingsFetchTelemetry");var pco=require("node:util");var nsl=new pe("managedSettings.serverSource"),isl="copilot_internal/managed_settings",fco=3600*1e3,osl="COPILOT_MANAGED_SETTINGS_REFRESH_INTERVAL_MS",ssl=5*1e3,asl=60*1e3;function hco(t,e=process.env){let r=t.get(Ft);return new NQr({resolveSession:a(async()=>await t.get(Mr).resolveSession(),"resolveSession"),fetch:a(async(n,o,s)=>await Bd(t,n,o,s),"fetch"),onDidChangeAuth:a(n=>{let o=[r.onDidChangeTokenResult(n),r.onDidResetToken(n)];return{dispose:a(()=>{for(let s of o)s.dispose()},"dispose")}},"onDidChangeAuth"),now:a(()=>t.get(IC).now().getTime(),"now"),refreshIntervalMs:csl(e),reportError:a(n=>nsl.exception(t,n,".refresh"),"reportError"),emitTelemetry:a(n=>dco(t,"server",n),"emitTelemetry")})}a(hco,"createServerManagedSettingsSource");function csl(t){let e=t[osl];if(e===void 0||e.trim()==="")return fco;let r=Number(e);return Number.isFinite(r)&&r>=0?r:fco}a(csl,"getRefreshIntervalMs");function lsl(t){if(t===null)return;let e=Number(t);return Number.isFinite(e)&&e>=0?e:void 0}a(lsl,"parseContentLength");var NQr=class{constructor(e){this.dependencies=e;this.channel="server";this.didChangeEmitter=new yu;this.onDidChange=this.didChangeEmitter.event;this.inflightByAccount=new Map;this.retryAfterByAccount=new Map;this.authGeneration=0;this.disposed=!1}static{a(this,"ServerManagedSettingsSource")}get current(){return this.currentValue}async refresh({force:e=!1}={}){if(this.disposed)return;this.startWatchingAuthChanges();let r=this.authGeneration;try{let n=await this.dependencies.resolveSession();if(this.disposed||r!==this.authGeneration)return;if(!n){this.currentAccountKey=void 0,this.lastSuccessfulFetch=void 0,this.updateCurrent(void 0);return}let o=this.getAccountKey(n);o!==this.currentAccountKey&&(this.currentAccountKey=o,this.lastSuccessfulFetch=void 0,this.updateCurrent(void 0));let s=this.inflightByAccount.get(o);if(s){await s;return}let c=this.dependencies.now(),l=this.retryAfterByAccount.get(o);if(l!==void 0&&cthis.dependencies.reportError(f)).finally(()=>{this.inflightByAccount.get(o)===d&&this.inflightByAccount.delete(o)});this.inflightByAccount.set(o,d),await d}catch(n){this.dependencies.reportError(n)}}dispose(){this.disposed||(this.disposed=!0,this.authSubscription?.dispose(),this.didChangeEmitter.dispose())}startWatchingAuthChanges(){this.authSubscription??=this.dependencies.onDidChangeAuth(()=>{this.authGeneration++,this.refresh()})}async fetchAndUpdate(e,r,n){let o=this.dependencies.now(),s={result:"error",force:n,retainedLastKnownGood:!1};try{let c=await this.dependencies.fetch(e,isl,{method:"GET",timeout:ssl,headers:{Accept:"application/json"}});if(s.httpStatus=c.status,s.payloadBytes=lsl(c.headers.get("content-length")),this.isStale(r)){s.result="stale";return}if(c.status===404){this.retryAfterByAccount.delete(r),this.lastSuccessfulFetch={accountKey:r,fetchedAt:this.dependencies.now()},this.updateCurrent(void 0),s.result="not_found";return}if(!c.ok){if(c.status===403||c.status===429){let u=(mM(c)??asl/1e3)*1e3,d=this.dependencies.now()+u;this.retryAfterByAccount.set(r,Math.max(this.retryAfterByAccount.get(r)??0,d)),s.result="rate_limited"}else s.result="http_error";throw new cx(c)}let l=uco(await c.json());if(this.isStale(r)){s.result="stale";return}this.retryAfterByAccount.delete(r),this.lastSuccessfulFetch={accountKey:r,fetchedAt:this.dependencies.now()},this.updateCurrent(l),s.result="success"}finally{s.durationMs=this.dependencies.now()-o,s.retainedLastKnownGood=(s.result==="error"||s.result==="http_error"||s.result==="rate_limited")&&this.currentValue!==void 0,this.dependencies.emitTelemetry(s)}}isStale(e){return this.disposed||e!==this.currentAccountKey}updateCurrent(e){(0,pco.isDeepStrictEqual)(this.currentValue,e)||(this.currentValue=e,this.didChangeEmitter.fire())}getAccountKey(e){return`${e.apiUrl}\0${e.login}`}};p();var DW=class{static{a(this,"AbstractCopilotMcpSamplingConfigSender")}};p();var SCe=class{static{a(this,"AbstractCopilotMessageSender")}};p();var mco=100,gco=1e3*60*5;function Aco(t){let e=new MQr(t);t.get(Em).registerContextProvider(e),t.get(i4).add(e.id)}a(Aco,"registerRelatedFilesShim");var MQr=class{constructor(e){this.ctx=e;this.id="relatedFilesShim";this.selector=["*"];this.traitCache=new Qk(mco,gco);this.relatedFilesCache=new Qk(mco,gco);this.resolver={resolve:a(async(r,n)=>{let o=r.documentContext.uri,s=r.documentContext.languageId;return await this.getTraits(o,s,n)},"resolve")}}static{a(this,"RelatedFilesShim")}async getTraits(e,r,n){return this.traitCache.has(e)||await this.requestRelatedFilesAndTraits(e,r,r,n),this.traitCache.get(e)??[]}async requestRelatedFilesAndTraits(e,r,n,o){try{let s=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments({uri:e,languageId:n}),c={uri:e,clientLanguageId:r,detectedLanguageId:n},l=await bdt(this.ctx,c,s,o,!0);if(o?.isCancellationRequested)return;let u=l.traits.filter(f=>f.includeInPrompt).map(f=>f.promptTextOverride?{name:"OtherInformation",value:f.promptTextOverride}:f),d=new Set;for(let f of l.entries.values())for(let h of f.keys())d.add(h);this.traitCache.set(e,u),this.relatedFilesCache.set(e,Array.from(d))}catch(s){zY(this.ctx,s,"relatedFilesShim")}}};var flo=fe(fee()),plo=fe(require("path"));p();var L6e=fe(ei());var usl=new L6e.ProtocolRequestType("workspace/readFile"),dsl=new L6e.ProtocolRequestType("workspace/readDirectory"),fsl=new L6e.ProtocolRequestType("workspace/findFiles"),psl=new L6e.ProtocolRequestType("workspace/findTextInFiles"),zRt=class extends ua{constructor(r){super();this.ctx=r}static{a(this,"AgentContentProvider")}async readFile(r){return this.sendRequestWithTelemetry(usl,r,"readFile")}async readDirectory(r){return this.sendRequestWithTelemetry(dsl,r,"readDirectory",n=>({entryCount:n.entries.length}))}async findFiles(r){return this.sendRequestWithTelemetry(fsl,r,"findFiles",n=>({fileCount:n.uris.length}))}async findTextInFiles(r){return this.sendRequestWithTelemetry(psl,r,"findTextInFiles",n=>({matchCount:n.matches.length}))}get connection(){return this.ctx.get(Xt).connection}async sendRequestWithTelemetry(r,n,o,s){let c=performance.now();try{let l=await this.connection.sendRequest(r,n),u=Math.round(performance.now()-c);return cr(this.ctx,`contentProvider.${o}`,{},{durationMs:u,...s?.(l)}),l}catch(l){let u=Math.round(performance.now()-c);throw Cs(this.ctx,`contentProvider.${o}.failure`,l,{},{durationMs:u}),l}}};p();var YRt=class extends MO{constructor(r){super();this.ctx=r}static{a(this,"AgentLSPRequestSender")}async sendRequest(r,n){let o=this.ctx.get(Xt);try{return await o.connection.sendRequest(r,n)}catch(s){throw Cs(this.ctx,"lsp.requestToClient.failure",s,{method:r.method.replaceAll("/",".")}),s}}};p();var KRt=class t extends mee{constructor(r){super(r);this.reportedUnknownProviders=new Set}static{a(this,"AgentRelatedFilesProvider")}get service(){return this.context.get(Xt)}static mapProviderNameToNeighboringFileType(r){let n="CSharpCopilotCompletionContextProvider",o="CSharpRoslynCompletionRelatedContextProvider",s="CppCopilotCompletionContextProvider",c="CppCopilotCompletionSemanticCodeContextProvider";switch(r){case n:return"related/csharp";case o:return"related/csharproslyn";case s:return"related/cpp";case c:return"related/cppsemanticcodecontext";default:return"related/other"}}convert(r){let n={entries:[],traits:r.traits};for(let o of r.entries){let s={type:t.mapProviderNameToNeighboringFileType(o.providerName),uris:o.uris};n.entries.push(s),s.type==="related/other"&&!this.reportedUnknownProviders.has(o.providerName)&&(this.reportedUnknownProviders.add(o.providerName),b0.warn(this.context,`unknown providerName ${o.providerName}`))}return n}async getRelatedFilesResponse(r,n,o){b0.debug(this.context,`Fetching related files for ${r.uri}`);let s=this.context.get(kn).getCapabilities().related??!1;if(t.relatedCapabilityTelemetry(this.context,n,s),!s)return b0.debug(this.context,"`copilot/related` not supported"),zri;try{let c=await this.service.connection.sendRequest(Hqt.type,{textDocument:{uri:r.uri},data:r.data,telemetry:{properties:n.properties,measurements:n.measurements}},o);return this.convert(c)}catch(c){b0.exception(this.context,c,".copilotRelated");return}}static{this.telemetrySent=!1}static relatedCapabilityTelemetry(r,n,o){try{if(!o||t.telemetrySent)return;t.telemetrySent=!0,ft(r,"copilotRelated.hasRelatedCapability",n)}catch(s){b0.exception(r,s,"copilotRelated")}}};p();p();var Sco=fe(ei());p();p();function yco(t,e){return(e<<5)-e+t|0}a(yco,"numberHash");function Eco(t,e){e=yco(149417,e);for(let r=0,n=t.length;r{this.initialize()})}static{a(this,"StateDatabase")}get isClosed(){return this.state===3}get canPersist(){return this.persistenceEnabled&&!this.initializationFailed&&!this.isClosed}get canPerformDatabaseOperation(){return this.persistenceEnabled&&!this.initializationFailed}get onDidChange(){return this.changeEmitter.event}get initialized(){return this.state===2&&this.persistenceEnabled&&!this.initializationFailed&&this.database!==void 0}get size(){return this.cache.size}has(e){return this.cache.has(e)}clear(){if(this.isClosed)return;let e=this.getAllKeys();for(let r of e)this.delete(r)}getAllKeys(){return[...this.cache.keys()]}get(e){return this.cache.get(e)}set(e,r){if(this.isClosed)return;let n=kwn(r)||Array.isArray(r)?JSON.stringify(r):String(r);this.cache.get(e)!==n&&(this.cache.set(e,n),this.changeEmitter.fire({key:e,value:n}),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this.scheduleFlush())}delete(e){this.isClosed||!this.cache.delete(e)||(this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this.changeEmitter.fire({key:e,value:void 0}),this.scheduleFlush())}initialize(){if(this.state!==0)return;let e=this.ctx.get(bn).getCapabilities().stateDatabase??!1;if(this.state=1,this.persistenceEnabled=e,!e){this.state=2,this.initializationFailed=!1,this.database=void 0;return}this.initializationTask||(this.initializationTask=this.initializeWithTimeout().catch(r=>{this.handleInitializationError("Failed to initialize state database",r)})),this.state=2}handleInitializationError(e,r){this.initializationFailed=!0,this.state=0,oCe.error(this.ctx,e,r)}async waitForInitialization(){await this.initializationTask?.catch(()=>{})}async dispose(){this.state=3,this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0);try{await this.forceFlush()}catch(e){oCe.error(this.ctx,"Failed to flush data before closing",e)}await this.waitForInitialization(),await this.writeQueue.catch(()=>{}),this.database&&(this.close(this.database),this.database=void 0),this.persistenceEnabled=!1}async forceFlush(){if(!this.canPersist)return;this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0),await this.flushPendingChanges()&&await this.writeQueue}async initializeWithTimeout(){await Promise.race([this.initializeInternal(),(0,yso.setTimeout)(unl).then(()=>{throw new Error("State database initialization timed out")})])}async initializeInternal(){let e;try{e=await this.resolveDatabasePath()}catch(o){this.handleInitializationError("State database disabled - unable to resolve storage path",o);return}let r;try{r=new gso.default.DatabaseSync(e,{open:!0})}catch(o){this.handleInitializationError("Failed to open state database file",o);return}this.database=r,r.exec(` - ${dnl}; - ${fnl}; - ${pnl}; - ${hnl}; - ${mnl}; - `);let n=this.all(r,Anl,[]);for(let o of n)try{let s=JSON.parse(o.value);s!==void 0?this.cache.set(o.key,s):oCe.warn(this.ctx,`Skipping corrupted state value for key '${o.key}' - parsed to undefined`)}catch(s){oCe.warn(this.ctx,`Failed to parse state value for key '${o.key}'`,s)}}async resolveDatabasePath(){let r=this.ctx.get(Yn).directory;await mso.mkdir(r,{recursive:!0,mode:448});let n=this.getSanitizedDatabaseName();return Aso.default.join(r,`${n}.db`)}getSanitizedDatabaseName(){return this.ctx.get(Ir).getEditorPluginInfo().name.replace(/[^a-zA-Z0-9._-]+/g,"_").replace(/_+/g,"_")||lnl}scheduleFlush(){if(this.isClosed||this.flushTimer)return;let e=cnl;this.flushTimer=setTimeout(()=>{this.flushTimer=void 0,this.flushPendingChanges()},e),typeof this.flushTimer.unref=="function"&&this.flushTimer.unref()}enqueue(e){return this.writeQueue=this.writeQueue.then(e).catch(r=>{oCe.error(this.ctx,"State database write failed",r)}),this.writeQueue}async flushPendingChanges(){let e=new Map(this.pendingInserts.entries()),r=new Set(this.pendingDeletes.values());return this.pendingInserts.clear(),this.pendingDeletes.clear(),!e.size&&!r.size?!1:(await this.enqueue(()=>this.persistWrites(e,r)),!0)}async persistWrites(e,r){if(!e.size&&!r.size)return;let n=await this.awaitDatabase();if(!n){for(let[o,s]of e)this.pendingInserts.set(o,s);for(let o of r)this.pendingDeletes.add(o);return}this.run(n,"BEGIN IMMEDIATE",[]);try{for(let o of r)this.run(n,"DELETE FROM state WHERE key = ?",[o]);for(let[o,s]of e){let c;try{c=JSON.stringify(s)}catch(l){oCe.warn(this.ctx,`Failed to serialize state value for key '${o}'`,l);continue}this.run(n,gnl,[o,c,Date.now()])}this.run(n,"COMMIT",[])}catch(o){try{this.run(n,"ROLLBACK",[])}catch{}for(let[s,c]of e)this.pendingInserts.set(s,c);for(let s of r)this.pendingDeletes.add(s);throw this.scheduleFlush(),o}}async awaitDatabase(){if(this.canPerformDatabaseOperation)return await this.waitForInitialization(),this.database}run(e,r,n){let o=n;o.length>0?e.prepare(r).run(...o):e.prepare(r).run()}all(e,r,n){let o=n;return o.length>0?e.prepare(r).all(...o):e.prepare(r).all()}close(e){e.close()}};var tC=class{static{a(this,"DynamicAuthenticationProviderStorageService")}},IRt=class extends tC{static{a(this,"CLSDynamicAuthenticationProviderStorageService")}constructor(e){super(),this.ctx=e}getClientRegistration(e){let r=this._getClientRegistration(e);if(r)try{let n=JSON.parse(r);if(n&&(n.clientId||n.clientSecret))return n}catch{this._removeClientRegistration(e)}}storeClientRegistration(e,r,n,o,s){let c={providerId:e,label:s||e,authorizationServer:r,clientId:n,clientSecret:o};this._updateClientRegistration(e,c)}removeDynamicProvider(e){this._removeClientRegistration(e)}getSessionsForDynamicAuthProvider(e,r){let n=this._getSessions(e,r);if(n)try{let o=JSON.parse(n);if(!Array.isArray(o)||!o.every(s=>typeof s.created_at=="number"&&Uct(s))){this._removeSessions(e,r);return}return o}catch{this._removeSessions(e,r)}}setSessionsForDynamicAuthProvider(e,r,n){this._updateSessions(e,r,n)}_generateClientKey(e){return`dynamicAuthProvider:clientRegistration:${e}`}_generateSessionKey(e,r){return`dynamicAuthProvider:sessions:${e}:${r}`}_getClientRegistration(e){let r=this._generateClientKey(e);return this.ctx.get(uA).get(r)}_updateClientRegistration(e,r){let n=this._generateClientKey(e);this.ctx.get(uA).set(n,r)}_removeClientRegistration(e){let r=this._generateClientKey(e);this.ctx.get(uA).delete(r)}_getSessions(e,r){let n=this._generateSessionKey(e,r);return this.ctx.get(uA).get(n)}_updateSessions(e,r,n){let o=this._generateSessionKey(e,r);this.ctx.get(uA).set(o,n)}_removeSessions(e,r){let n=this._generateSessionKey(e,r);this.ctx.get(uA).delete(n)}};var f_=new fe("DynamicAuthenticationProvider"),xRt=class{static{a(this,"DynamicAuthenticationProvider")}constructor(e,r,n,o,s,c,l){this.ctx=e,this.authorizationServer=r,this.serverMetadata=n,this.resourceMetadata=o,this.clientId=s,this.clientSecret=c,this.initialTokens=l,this.id=o?.resource?r+" "+o?.resource:r,this.label=o?.resource_name??r,this.authorizationServers=[r],this.supportsMultipleAccounts=!0,this._tokenStore=new x7r(e,l,{set:a(u=>{this.ctx.get(tC).setSessionsForDynamicAuthProvider(this.id,this.clientId,u)},"set")})}async getSessions(e,r){if(f_.info(this.ctx,`Getting sessions for scopes: ${e?.join(" ")??"all"}`),!e)return this._tokenStore.sessions;let n=[...e].sort(),o=e.join(" "),s=this._tokenStore.sessions.filter(c=>Lwe([...c.scopes].sort(),n));if(f_.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s.length){let c=[],l=[],u=new Map(this._tokenStore.tokens.map(d=>[d.access_token,d]));for(let d of s){let f=u.get(d.accessToken);if(f&&f.expires_in){let h=Date.now(),m=f.expires_in*1e3;if(h>f.created_at+m-300*1e3){if(f_.info(this.ctx,`Token for session ${d.id} is about to expire, refreshing...`),l.push(f),!f.refresh_token){f_.warn(this.ctx,`No refresh token available for scopes ${d.scopes.join(" ")}. Throwing away token.`);continue}try{let g=await this.exchangeRefreshTokenForToken(f.refresh_token);g.scope!==o&&(f_.warn(this.ctx,`Token scopes '${g.scope}' do not match requested scopes '${o}'. Overwriting token with what was requested...`),g.scope=o),f_.info(this.ctx,`Successfully created a new token for scopes ${d.scopes.join(" ")}.`),c.push(g)}catch(g){f_.error(this.ctx,"Failed to refresh token: ",g)}}}}return(c.length||l.length)&&(this._tokenStore.update({added:c,removed:l}),s=this._tokenStore.sessions.filter(d=>Lwe([...d.scopes].sort(),n))),f_.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s}return[]}async createSession(e,r){let n=[...e].sort(),o=await new R_e(this.ctx).auth({clientId:this.clientId,clientSecret:this.clientSecret},n,this.serverMetadata,this.resourceMetadata);o.scope!==e.join(" ")&&(f_.warn(this.ctx,`Token scopes '${o.scope}' do not match requested scopes '${e.join(" ")}'. Overwriting token with what was requested...`),o.scope=e.join(" ")),this._tokenStore.update({added:[{...o,created_at:Date.now()}],removed:[]});let s=this._tokenStore.sessions.find(c=>c.accessToken===o.access_token);return f_.info(this.ctx,`Created ${o.refresh_token?"refreshable":"non-refreshable"} session for scopes: ${o.scope}${o.expires_in?` that expires in ${o.expires_in} seconds`:""}`),s}removeSession(e){f_.info(this.ctx,`Removing session with id: ${e}`);let r=this._tokenStore.sessions.find(o=>o.id===e);if(!r)return f_.error(this.ctx,`Session with id ${e} not found`),Promise.resolve();let n=this._tokenStore.tokens.find(o=>o.access_token===r.accessToken);return n?(this._tokenStore.update({added:[],removed:[n]}),f_.info(this.ctx,`Removed token for session: ${r.id} with scopes: ${r.scopes.join(" ")}`),Promise.resolve()):(f_.error(this.ctx,`Failed to retrieve token for removed session: ${r.id}`),Promise.resolve())}async exchangeRefreshTokenForToken(e){if(!this.serverMetadata.token_endpoint)throw new Error("Token endpoint not available in server metadata");let r=new URLSearchParams;r.append("client_id",this.clientId),r.append("grant_type","refresh_token"),r.append("refresh_token",e),this.resourceMetadata?.resource&&r.append("resource",this.resourceMetadata.resource),this.clientSecret&&r.append("client_secret",this.clientSecret);let o=await(await this.ctx.get(tr).fetch(this.serverMetadata.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:r.toString()})).json();if(Uct(o))return{...o,created_at:Date.now()};throw new Error(`Invalid authorization token response: ${JSON.stringify(o)}`)}},x7r=class{static{a(this,"TokenStore")}constructor(e,r,n){this.ctx=e,this.tokens=r??[],this._persistence=n}get sessions(){return this.tokens.map(e=>this._getSessionFromToken(e))}update({added:e,removed:r}){f_.info(this.ctx,`Updating tokens: added ${e.length}, removed ${r.length}`);let n=[...this.tokens];for(let o of r){let s=n.findIndex(c=>c.access_token===o.access_token);s!==-1&&n.splice(s,1)}for(let o of e){let s=n.findIndex(c=>c.access_token===o.access_token);s===-1?n.push(o):n[s]=o}(e.length||r.length)&&(this.tokens=n,this._persistence.set(n)),f_.info(this.ctx,`Tokens updated: ${n.length} tokens stored.`)}_getSessionFromToken(e){let r;if(e.id_token)try{r=ddr(e.id_token)}catch{}if(!r)try{r=ddr(e.access_token)}catch{}let n=e.scope?e.scope.split(" "):r?.scope?r.scope.split(" "):[];return{id:hso(e.access_token,0).toString(),accessToken:e.access_token,account:{id:r?.sub||"unknown",label:r?.preferred_username||r?.name||r?.email||"MCP"},scopes:n,idToken:e.id_token}}};var LI=new fe("DynamicAuthProviderService"),YN=class t{static{a(this,"DynamicAuthenticationProviderService")}static{this.dynamicOAuthRequestType=new Eso.ProtocolRequestType("copilot/dynamicOAuth")}constructor(e){this.ctx=e}async registerDynamicAuthProvider(e,r,n,o,s,c){if(!o){let u=await this.getDynamicClientRegistration(e,r,n);o=u.clientId,s=u.clientSecret}let l=new xRt(this.ctx,e,r,n,o,s,c);return this.registerDynamicAuthenticationProvider(l),l}async getDynamicClientRegistration(e,r,n){let o,s;if(r.registration_endpoint)try{let c=await this.fetchDynamicRegistration(r,n?.scopes_supported);o=c.client_id,s=c.client_secret}catch(c){LI.error(this.ctx,`Dynamic registration failed for ${e.toString()}: ${Xu(c)}. Prompting user for client ID and client secret...`)}if(!o){let c=[`http://127.0.0.1:${w_e}/callback`,"http://127.0.0.1/callback"],l;try{l=await this.ctx.get(ar).connection.sendRequest(t.dynamicOAuthRequestType,{title:"Add Client Registration Details",header:`The authorization server '${e.toString()}' does not support automatic client registration.`,detail:`Do you want to proceed by manually providing a client registration (client ID)? +`,bsl="SELECT key, value FROM state",TCe=new pe("state-database"),pA=class{constructor(e){this.cache=new Map;this.changeEmitter=new Vi;this.pendingInserts=new Map;this.pendingDeletes=new Set;this.writeQueue=Promise.resolve();this.persistenceEnabled=!1;this.initializationFailed=!1;this.state=0;this.ctx=e,e.get(kn).onDidSetCapabilities(()=>{this.initialize()})}static{a(this,"StateDatabase")}get isClosed(){return this.state===3}get canPersist(){return this.persistenceEnabled&&!this.initializationFailed&&!this.isClosed}get canPerformDatabaseOperation(){return this.persistenceEnabled&&!this.initializationFailed}get onDidChange(){return this.changeEmitter.event}get initialized(){return this.state===2&&this.persistenceEnabled&&!this.initializationFailed&&this.database!==void 0}get size(){return this.cache.size}has(e){return this.cache.has(e)}clear(){if(this.isClosed)return;let e=this.getAllKeys();for(let r of e)this.delete(r)}getAllKeys(){return[...this.cache.keys()]}get(e){return this.cache.get(e)}set(e,r){if(this.isClosed)return;let n=akn(r)||Array.isArray(r)?JSON.stringify(r):String(r);this.cache.get(e)!==n&&(this.cache.set(e,n),this.changeEmitter.fire({key:e,value:n}),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this.scheduleFlush())}delete(e){this.isClosed||!this.cache.delete(e)||(this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this.changeEmitter.fire({key:e,value:void 0}),this.scheduleFlush())}initialize(){if(this.state!==0)return;let e=this.ctx.get(kn).getCapabilities().stateDatabase??!1;if(this.state=1,this.persistenceEnabled=e,!e){this.state=2,this.initializationFailed=!1,this.database=void 0;return}this.initializationTask||(this.initializationTask=this.initializeWithTimeout().catch(r=>{this.handleInitializationError("Failed to initialize state database",r)})),this.state=2}handleInitializationError(e,r){this.initializationFailed=!0,this.state=0,TCe.error(this.ctx,e,r)}async waitForInitialization(){await this.initializationTask?.catch(()=>{})}async dispose(){this.state=3,this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0);try{await this.forceFlush()}catch(e){TCe.error(this.ctx,"Failed to flush data before closing",e)}await this.waitForInitialization(),await this.writeQueue.catch(()=>{}),this.database&&(this.close(this.database),this.database=void 0),this.persistenceEnabled=!1}async forceFlush(){if(!this.canPersist)return;this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0),await this.flushPendingChanges()&&await this.writeQueue}async initializeWithTimeout(){await Promise.race([this.initializeInternal(),(0,bco.setTimeout)(gsl).then(()=>{throw new Error("State database initialization timed out")})])}async initializeInternal(){let e;try{e=await this.resolveDatabasePath()}catch(o){this.handleInitializationError("State database disabled - unable to resolve storage path",o);return}let r;try{r=new vco.default.DatabaseSync(e,{open:!0})}catch(o){this.handleInitializationError("Failed to open state database file",o);return}this.database=r,r.exec(` + ${Asl}; + ${ysl}; + ${Esl}; + ${_sl}; + ${vsl}; + `);let n=this.all(r,bsl,[]);for(let o of n)try{let s=JSON.parse(o.value);s!==void 0?this.cache.set(o.key,s):TCe.warn(this.ctx,`Skipping corrupted state value for key '${o.key}' - parsed to undefined`)}catch(s){TCe.warn(this.ctx,`Failed to parse state value for key '${o.key}'`,s)}}async resolveDatabasePath(){let r=this.ctx.get(ti).directory;await _co.mkdir(r,{recursive:!0,mode:448});let n=this.getSanitizedDatabaseName();return Cco.default.join(r,`${n}.db`)}getSanitizedDatabaseName(){return this.ctx.get(Ir).getEditorPluginInfo().name.replace(/[^a-zA-Z0-9._-]+/g,"_").replace(/_+/g,"_")||msl}scheduleFlush(){if(this.isClosed||this.flushTimer)return;let e=hsl;this.flushTimer=setTimeout(()=>{this.flushTimer=void 0,this.flushPendingChanges()},e),typeof this.flushTimer.unref=="function"&&this.flushTimer.unref()}enqueue(e){return this.writeQueue=this.writeQueue.then(e).catch(r=>{TCe.error(this.ctx,"State database write failed",r)}),this.writeQueue}async flushPendingChanges(){let e=new Map(this.pendingInserts.entries()),r=new Set(this.pendingDeletes.values());return this.pendingInserts.clear(),this.pendingDeletes.clear(),!e.size&&!r.size?!1:(await this.enqueue(()=>this.persistWrites(e,r)),!0)}async persistWrites(e,r){if(!e.size&&!r.size)return;let n=await this.awaitDatabase();if(!n){for(let[o,s]of e)this.pendingInserts.set(o,s);for(let o of r)this.pendingDeletes.add(o);return}this.run(n,"BEGIN IMMEDIATE",[]);try{for(let o of r)this.run(n,"DELETE FROM state WHERE key = ?",[o]);for(let[o,s]of e){let c;try{c=JSON.stringify(s)}catch(l){TCe.warn(this.ctx,`Failed to serialize state value for key '${o}'`,l);continue}this.run(n,Csl,[o,c,Date.now()])}this.run(n,"COMMIT",[])}catch(o){try{this.run(n,"ROLLBACK",[])}catch{}for(let[s,c]of e)this.pendingInserts.set(s,c);for(let s of r)this.pendingDeletes.add(s);throw this.scheduleFlush(),o}}async awaitDatabase(){if(this.canPerformDatabaseOperation)return await this.waitForInitialization(),this.database}run(e,r,n){let o=n;o.length>0?e.prepare(r).run(...o):e.prepare(r).run()}all(e,r,n){let o=n;return o.length>0?e.prepare(r).all(...o):e.prepare(r).all()}close(e){e.close()}};var iC=class{static{a(this,"DynamicAuthenticationProviderStorageService")}},JRt=class extends iC{static{a(this,"CLSDynamicAuthenticationProviderStorageService")}constructor(e){super(),this.ctx=e}getClientRegistration(e){let r=this._getClientRegistration(e);if(r)try{let n=JSON.parse(r);if(n&&(n.clientId||n.clientSecret))return n}catch{this._removeClientRegistration(e)}}storeClientRegistration(e,r,n,o,s){let c={providerId:e,label:s||e,authorizationServer:r,clientId:n,clientSecret:o};this._updateClientRegistration(e,c)}removeDynamicProvider(e){this._removeClientRegistration(e)}getSessionsForDynamicAuthProvider(e,r){let n=this._getSessions(e,r);if(n)try{let o=JSON.parse(n);if(!Array.isArray(o)||!o.every(s=>typeof s.created_at=="number"&&Rlt(s))){this._removeSessions(e,r);return}return o}catch{this._removeSessions(e,r)}}setSessionsForDynamicAuthProvider(e,r,n){this._updateSessions(e,r,n)}_generateClientKey(e){return`dynamicAuthProvider:clientRegistration:${e}`}_generateSessionKey(e,r){return`dynamicAuthProvider:sessions:${e}:${r}`}_getClientRegistration(e){let r=this._generateClientKey(e);return this.ctx.get(pA).get(r)}_updateClientRegistration(e,r){let n=this._generateClientKey(e);this.ctx.get(pA).set(n,r)}_removeClientRegistration(e){let r=this._generateClientKey(e);this.ctx.get(pA).delete(r)}_getSessions(e,r){let n=this._generateSessionKey(e,r);return this.ctx.get(pA).get(n)}_updateSessions(e,r,n){let o=this._generateSessionKey(e,r);this.ctx.get(pA).set(o,n)}_removeSessions(e,r){let n=this._generateSessionKey(e,r);this.ctx.get(pA).delete(n)}};var A_=new pe("DynamicAuthenticationProvider"),ZRt=class{static{a(this,"DynamicAuthenticationProvider")}constructor(e,r,n,o,s,c,l){this.ctx=e,this.authorizationServer=r,this.serverMetadata=n,this.resourceMetadata=o,this.clientId=s,this.clientSecret=c,this.initialTokens=l,this.id=o?.resource?r+" "+o?.resource:r,this.label=o?.resource_name??r,this.authorizationServers=[r],this.supportsMultipleAccounts=!0,this._tokenStore=new OQr(e,l,{set:a(u=>{this.ctx.get(iC).setSessionsForDynamicAuthProvider(this.id,this.clientId,u)},"set")})}async getSessions(e,r){if(A_.info(this.ctx,`Getting sessions for scopes: ${e?.join(" ")??"all"}`),!e)return this._tokenStore.sessions;let n=[...e].sort(),o=e.join(" "),s=this._tokenStore.sessions.filter(c=>tRe([...c.scopes].sort(),n));if(A_.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s.length){let c=[],l=[],u=new Map(this._tokenStore.tokens.map(d=>[d.access_token,d]));for(let d of s){let f=u.get(d.accessToken);if(f&&f.expires_in){let h=Date.now(),m=f.expires_in*1e3;if(h>f.created_at+m-300*1e3){if(A_.info(this.ctx,`Token for session ${d.id} is about to expire, refreshing...`),l.push(f),!f.refresh_token){A_.warn(this.ctx,`No refresh token available for scopes ${d.scopes.join(" ")}. Throwing away token.`);continue}try{let g=await this.exchangeRefreshTokenForToken(f.refresh_token);g.scope!==o&&(A_.warn(this.ctx,`Token scopes '${g.scope}' do not match requested scopes '${o}'. Overwriting token with what was requested...`),g.scope=o),A_.info(this.ctx,`Successfully created a new token for scopes ${d.scopes.join(" ")}.`),c.push(g)}catch(g){A_.error(this.ctx,"Failed to refresh token: ",g)}}}}return(c.length||l.length)&&(this._tokenStore.update({added:c,removed:l}),s=this._tokenStore.sessions.filter(d=>tRe([...d.scopes].sort(),n))),A_.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s}return[]}async createSession(e,r){let n=[...e].sort(),o=await new z_e(this.ctx).auth({clientId:this.clientId,clientSecret:this.clientSecret},n,this.serverMetadata,this.resourceMetadata);o.scope!==e.join(" ")&&(A_.warn(this.ctx,`Token scopes '${o.scope}' do not match requested scopes '${e.join(" ")}'. Overwriting token with what was requested...`),o.scope=e.join(" ")),this._tokenStore.update({added:[{...o,created_at:Date.now()}],removed:[]});let s=this._tokenStore.sessions.find(c=>c.accessToken===o.access_token);return A_.info(this.ctx,`Created ${o.refresh_token?"refreshable":"non-refreshable"} session for scopes: ${o.scope}${o.expires_in?` that expires in ${o.expires_in} seconds`:""}`),s}removeSession(e){A_.info(this.ctx,`Removing session with id: ${e}`);let r=this._tokenStore.sessions.find(o=>o.id===e);if(!r)return A_.error(this.ctx,`Session with id ${e} not found`),Promise.resolve();let n=this._tokenStore.tokens.find(o=>o.access_token===r.accessToken);return n?(this._tokenStore.update({added:[],removed:[n]}),A_.info(this.ctx,`Removed token for session: ${r.id} with scopes: ${r.scopes.join(" ")}`),Promise.resolve()):(A_.error(this.ctx,`Failed to retrieve token for removed session: ${r.id}`),Promise.resolve())}async exchangeRefreshTokenForToken(e){if(!this.serverMetadata.token_endpoint)throw new Error("Token endpoint not available in server metadata");let r=new URLSearchParams;r.append("client_id",this.clientId),r.append("grant_type","refresh_token"),r.append("refresh_token",e),this.resourceMetadata?.resource&&r.append("resource",this.resourceMetadata.resource),this.clientSecret&&r.append("client_secret",this.clientSecret);let o=await(await this.ctx.get(nr).fetch(this.serverMetadata.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:r.toString()})).json();if(Rlt(o))return{...o,created_at:Date.now()};throw new Error(`Invalid authorization token response: ${JSON.stringify(o)}`)}},OQr=class{static{a(this,"TokenStore")}constructor(e,r,n){this.ctx=e,this.tokens=r??[],this._persistence=n}get sessions(){return this.tokens.map(e=>this._getSessionFromToken(e))}update({added:e,removed:r}){A_.info(this.ctx,`Updating tokens: added ${e.length}, removed ${r.length}`);let n=[...this.tokens];for(let o of r){let s=n.findIndex(c=>c.access_token===o.access_token);s!==-1&&n.splice(s,1)}for(let o of e){let s=n.findIndex(c=>c.access_token===o.access_token);s===-1?n.push(o):n[s]=o}(e.length||r.length)&&(this.tokens=n,this._persistence.set(n)),A_.info(this.ctx,`Tokens updated: ${n.length} tokens stored.`)}_getSessionFromToken(e){let r;if(e.id_token)try{r=bfr(e.id_token)}catch{}if(!r)try{r=bfr(e.access_token)}catch{}let n=e.scope?e.scope.split(" "):r?.scope?r.scope.split(" "):[];return{id:Eco(e.access_token,0).toString(),accessToken:e.access_token,account:{id:r?.sub||"unknown",label:r?.preferred_username||r?.name||r?.email||"MCP"},scopes:n,idToken:e.id_token}}};var jI=new pe("DynamicAuthProviderService"),nM=class t{static{a(this,"DynamicAuthenticationProviderService")}static{this.dynamicOAuthRequestType=new Sco.ProtocolRequestType("copilot/dynamicOAuth")}constructor(e){this.ctx=e}async registerDynamicAuthProvider(e,r,n,o,s,c){if(!o){let u=await this.getDynamicClientRegistration(e,r,n);o=u.clientId,s=u.clientSecret}let l=new ZRt(this.ctx,e,r,n,o,s,c);return this.registerDynamicAuthenticationProvider(l),l}async getDynamicClientRegistration(e,r,n){let o,s;if(r.registration_endpoint)try{let c=await this.fetchDynamicRegistration(r,n?.scopes_supported);o=c.client_id,s=c.client_secret}catch(c){jI.error(this.ctx,`Dynamic registration failed for ${e.toString()}: ${rd(c)}. Prompting user for client ID and client secret...`)}if(!o){let c=[`http://127.0.0.1:${W_e}/callback`,"http://127.0.0.1/callback"],l;try{l=await this.ctx.get(Xt).connection.sendRequest(t.dynamicOAuthRequestType,{title:"Add Client Registration Details",header:`The authorization server '${e.toString()}' does not support automatic client registration.`,detail:`Do you want to proceed by manually providing a client registration (client ID)? Note: When registering your OAuth application, make sure to include these redirect URIs: ${c.join(` -`)}`,inputs:[{title:"Client ID",value:"clientId",description:`Enter an existing client ID that has been registered with the following redirect URIs: ${c.join(", ")}`,placeholder:"OAuth client ID (azye39d...)",required:!0},{title:"Client Secret",value:"clientSecret",description:"(optional) Enter an existing client secret associated with the previous client id or leave this field blank",placeholder:"OAuth client secret (wer32o50f...) or leave it blank",required:!1}]})}catch(u){LI.error(this.ctx,`Failed to get client ID and secret from user: ${Xu(u)}`)}if(!l)throw new Error("User did not provide client details");o=l.clientId,s=l.clientSecret,LI.info(this.ctx,`User provided client registration for ${e.toString()}`),s?LI.info(this.ctx,`User provided client secret for ${e.toString()}`):LI.info(this.ctx,`User did not provide client secret for ${e.toString()}`)}return{clientId:o,clientSecret:s}}async fetchDynamicRegistration(e,r){if(!e.registration_endpoint)throw new Error("Server does not support dynamic registration");let n=await this.ctx.get(tr).fetch(e.registration_endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_name:"GitHub Copilot",client_uri:"https://github.com/features/copilot",grant_types:e.grant_types_supported?e.grant_types_supported.filter(s=>p3r.includes(s)):p3r,response_types:["code"],redirect_uris:["http://127.0.0.1/callback","http://localhost/callback",`http://localhost:${w_e}/callback`,`http://127.0.0.1:${w_e}/callback`],scope:r?.join(GYn),token_endpoint_auth_method:"none",application_type:"native"})});if(!n.ok)throw new Error(`Dynamic client registration failed: ${n.status} ${n.statusText}`);let o=await n.json();if(KYn(o))return o;throw new Error(`Invalid authorization dynamic client registration response: ${JSON.stringify(o)}`)}registerDynamicAuthenticationProvider(e){this.ctx.get(dm).registerAuthenticationProvider(e.id,e),this.ctx.get(tC).storeClientRegistration(e.id,e.authorizationServer,e.clientId,e.clientSecret,e.label)}async removeSessionByAccountName(e,r){let n=this.ctx.get(dm);try{let o=n.getProvider(e),c=(await o.getSessions(void 0,{})).filter(l=>l.account.label===r);LI.info(this.ctx,`Removing ${c.length} session(s) for account ${r} in provider ${e}`);for(let l of c)await o.removeSession(l.id);LI.info(this.ctx,`Successfully removed session(s) for account ${r} in provider ${e}`)}catch(o){throw LI.error(this.ctx,`Failed to remove session for account ${r} in provider ${e}:`,o),o}}async removeAllSessions(e){let r=this.ctx.get(dm);try{let n=r.getProvider(e),o=await n.getSessions(void 0,{});LI.info(this.ctx,`Removing ${o.length} sessions for provider ${e}`);for(let s of o)await n.removeSession(s.id);LI.info(this.ctx,`Successfully removed all sessions for provider ${e}`)}catch(n){throw LI.error(this.ctx,`Failed to remove sessions for provider ${e}:`,n),n}}async unregisterProvider(e){let r=this.ctx.get(dm),n=this.ctx.get(tC);try{await this.removeAllSessions(e),n.removeDynamicProvider(e),r.unregisterAuthenticationProvider(e),LI.info(this.ctx,`Successfully unregistered provider ${e} and removed all associated data`)}catch(o){throw LI.error(this.ctx,`Failed to unregister provider ${e}:`,o),o}}};var wRt=class extends dm{constructor(r){super();this._authenticationProviders=new Map;this.ctx=r}static{a(this,"CLSAuthenticationService")}registerAuthenticationProvider(r,n){this._authenticationProviders.set(r,n)}unregisterAuthenticationProvider(r){this._authenticationProviders.delete(r)}getOrActivateProviderIdForServer(r){for(let n of this._authenticationProviders.values())if(n.authorizationServers?.some(o=>o===r))return n.id}createAuthenticationProvider(r,n,o){if(r===DN.providerId){let s=new DN(this.ctx,r,n,o);return this.registerAuthenticationProvider(s.id,s),s}}async createDynamicAuthenticationProvider(r,n,o){let s=o?`${r.toString()} ${o.resource}`:r.toString(),c=this.ctx.get(tC).getClientRegistration(s),l=c?.clientId,u=c?.clientSecret,d;return l&&(d=this.ctx.get(tC).getSessionsForDynamicAuthProvider(s,l)),await this.ctx.get(YN).registerDynamicAuthProvider(r,n,o,l,u,d)}getProvider(r){if(this._authenticationProviders.has(r))return this._authenticationProviders.get(r);throw new Error(`No authentication provider '${r}' is currently registered.`)}async getSessions(r,n,o,s=!1){let c=this._authenticationProviders.get(r);if(c){if(o?.authorizationServer){let l=o.authorizationServer;if(!c.authorizationServers?.some(u=>u===l))throw new Error(`The authorization server '${l}' is not supported by the authentication provider '${r}'.`)}return await c.getSessions(n,{...o})}else throw new Error(`No authentication provider '${r}' is currently registered.`)}};p();var vso=de(Xc());var _so=new fe("agentCopilotTokenManager"),ynl={type:new vso.ProtocolRequestType("copilot/token")},RRt=class extends Rh{constructor(){super(...arguments);this.networkFetcher=new u7e}static{a(this,"AgentCopilotTokenFetcher")}async fetchTokenResult(r,n,o){if(!r.get(bn).getCapabilities().token)return this.networkFetcher.fetchTokenResult(r,n,o);let s=r.get(ar).connection;try{let c=await s.sendRequest(ynl.type,{force:!1,session:n});if(!c?.envelope)throw new yi("Editor did not return a token");let{envelope:l,tokenEndpoint:u}=c;if(_so.debug(r,"Retrieved envelope from copilot/token"),l.expires_at*1e3this.updateCapabilities(r))}static{a(this,"CapabilitiesUpdater")}async updateCapabilities(e){let r=this.ctx.get(bn),n=this.isPreviewFeaturesDisabled(e);n&&!this.isJetBrains()&&r.setCapabilities({mcpAllowlist:!1}),await this.updateCveRemediatorCapability(e,n)}async updateCveRemediatorCapability(e,r){let n=this.ctx.get(bn),o=this.ctx.get(Zt),s=n.getCapabilities().cveRemediatorAgent??!1,c=await o.updateExPValuesAndAssignments(e),l=o.cveRemediatorAgentEnabled(c),u=s&&l&&!r;n.setCapabilities({cveRemediatorAgent:u})}isPreviewFeaturesDisabled(e){return e.getTokenValue("editor_preview_features")==="0"}isJetBrains(){return this.ctx.get(Ir).getEditorPluginInfo().name==="copilot-intellij"}};p();var Enl=new fe("Public Code References"),kRt=class extends jT{static{a(this,"CLSCitationManager")}async handleIPCodeCitation(e,r){let n=r.location?.start.line!==void 0?r.location.start.line+1:"-",o=r.location?.start.character!==void 0?r.location.start.character+1:"-",s=(r.matchingText??"").replace(/[\r\n]/g," ");Enl.info(e,`Text found matching public code in ${r.inDocumentUri} [Ln ${n}, Col ${o}] near ${s}...:`+r.details.map((c,l)=>` - ${l+1}) [${c.license}] ${c.url}`).join("")),!(r.version===void 0||r.location===void 0)&&e.get(bn).getCapabilities().ipCodeCitation===!0&&await e.get(ar).connection.sendNotification(HQt.type,{uri:r.inDocumentUri,version:r.version,range:r.location,matchingText:r.matchingText??"",citations:r.details})}};p();var w7r=de(Xc());var _nl=new w7r.ProtocolNotificationType("$/copilot/compressionStarted"),vnl=new w7r.ProtocolNotificationType("$/copilot/compressionCompleted"),PRt=class extends bI{constructor(r){super();this.ctx=r}static{a(this,"CLSCompressionNotifier")}async notifyCompressionStarted(r){await this.ctx.get(ar).connection.sendNotification(_nl,r)}async notifyCompressionCompleted(r){await this.ctx.get(ar).connection.sendNotification(vnl,r)}};p();p();function Cso(t){Cnl(t)}a(Cso,"activateExtensibilityPlatformFeature");function Cnl(t){t.set(WP,new bJe(t)),t.set(NO,new NO(t))}a(Cnl,"registerContextDependencies");p();var bso=S.String(),R7r=class{constructor(e){this.turnContext=e}static{a(this,"BuildLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(NRt,"build logs"),`The contents of the application build logs: +`)}`,inputs:[{title:"Client ID",value:"clientId",description:`Enter an existing client ID that has been registered with the following redirect URIs: ${c.join(", ")}`,placeholder:"OAuth client ID (azye39d...)",required:!0},{title:"Client Secret",value:"clientSecret",description:"(optional) Enter an existing client secret associated with the previous client id or leave this field blank",placeholder:"OAuth client secret (wer32o50f...) or leave it blank",required:!1}]})}catch(u){jI.error(this.ctx,`Failed to get client ID and secret from user: ${rd(u)}`)}if(!l)throw new Error("User did not provide client details");o=l.clientId,s=l.clientSecret,jI.info(this.ctx,`User provided client registration for ${e.toString()}`),s?jI.info(this.ctx,`User provided client secret for ${e.toString()}`):jI.info(this.ctx,`User did not provide client secret for ${e.toString()}`)}return{clientId:o,clientSecret:s}}async fetchDynamicRegistration(e,r){if(!e.registration_endpoint)throw new Error("Server does not support dynamic registration");let n=await this.ctx.get(nr).fetch(e.registration_endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_name:"GitHub Copilot",client_uri:"https://github.com/features/copilot",grant_types:e.grant_types_supported?e.grant_types_supported.filter(s=>yFr.includes(s)):yFr,response_types:["code"],redirect_uris:["http://127.0.0.1/callback","http://localhost/callback",`http://localhost:${W_e}/callback`,`http://127.0.0.1:${W_e}/callback`],scope:r?.join($Jn),token_endpoint_auth_method:"none",application_type:"native"})});if(!n.ok)throw new Error(`Dynamic client registration failed: ${n.status} ${n.statusText}`);let o=await n.json();if(JJn(o))return o;throw new Error(`Invalid authorization dynamic client registration response: ${JSON.stringify(o)}`)}registerDynamicAuthenticationProvider(e){this.ctx.get(gm).registerAuthenticationProvider(e.id,e),this.ctx.get(iC).storeClientRegistration(e.id,e.authorizationServer,e.clientId,e.clientSecret,e.label)}async removeSessionByAccountName(e,r){let n=this.ctx.get(gm);try{let o=n.getProvider(e),c=(await o.getSessions(void 0,{})).filter(l=>l.account.label===r);jI.info(this.ctx,`Removing ${c.length} session(s) for account ${r} in provider ${e}`);for(let l of c)await o.removeSession(l.id);jI.info(this.ctx,`Successfully removed session(s) for account ${r} in provider ${e}`)}catch(o){throw jI.error(this.ctx,`Failed to remove session for account ${r} in provider ${e}:`,o),o}}async removeAllSessions(e){let r=this.ctx.get(gm);try{let n=r.getProvider(e),o=await n.getSessions(void 0,{});jI.info(this.ctx,`Removing ${o.length} sessions for provider ${e}`);for(let s of o)await n.removeSession(s.id);jI.info(this.ctx,`Successfully removed all sessions for provider ${e}`)}catch(n){throw jI.error(this.ctx,`Failed to remove sessions for provider ${e}:`,n),n}}async unregisterProvider(e){let r=this.ctx.get(gm),n=this.ctx.get(iC);try{await this.removeAllSessions(e),n.removeDynamicProvider(e),r.unregisterAuthenticationProvider(e),jI.info(this.ctx,`Successfully unregistered provider ${e} and removed all associated data`)}catch(o){throw jI.error(this.ctx,`Failed to unregister provider ${e}:`,o),o}}};var XRt=class extends gm{constructor(r){super();this._authenticationProviders=new Map;this.ctx=r}static{a(this,"CLSAuthenticationService")}registerAuthenticationProvider(r,n){this._authenticationProviders.set(r,n)}unregisterAuthenticationProvider(r){this._authenticationProviders.delete(r)}getOrActivateProviderIdForServer(r){for(let n of this._authenticationProviders.values())if(n.authorizationServers?.some(o=>o===r))return n.id}createAuthenticationProvider(r,n,o){if(r===QN.providerId){let s=new QN(this.ctx,r,n,o);return this.registerAuthenticationProvider(s.id,s),s}}async createDynamicAuthenticationProvider(r,n,o){let s=o?`${r.toString()} ${o.resource}`:r.toString(),c=this.ctx.get(iC).getClientRegistration(s),l=c?.clientId,u=c?.clientSecret,d;return l&&(d=this.ctx.get(iC).getSessionsForDynamicAuthProvider(s,l)),await this.ctx.get(nM).registerDynamicAuthProvider(r,n,o,l,u,d)}getProvider(r){if(this._authenticationProviders.has(r))return this._authenticationProviders.get(r);throw new Error(`No authentication provider '${r}' is currently registered.`)}async getSessions(r,n,o,s=!1){let c=this._authenticationProviders.get(r);if(c){if(o?.authorizationServer){let l=o.authorizationServer;if(!c.authorizationServers?.some(u=>u===l))throw new Error(`The authorization server '${l}' is not supported by the authentication provider '${r}'.`)}return await c.getSessions(n,{...o})}else throw new Error(`No authentication provider '${r}' is currently registered.`)}};p();var Ico=fe(Fc());var Tco=new pe("agentCopilotTokenManager"),Ssl={type:new Ico.ProtocolRequestType("copilot/token")},ekt=class extends Dh{constructor(){super(...arguments);this.networkFetcher=new L7e}static{a(this,"AgentCopilotTokenFetcher")}async fetchTokenResult(r,n,o){if(!r.get(kn).getCapabilities().token)return this.networkFetcher.fetchTokenResult(r,n,o);let s=r.get(Xt).connection;try{let c=await s.sendRequest(Ssl.type,{force:!1,session:n});if(!c?.envelope)throw new yi("Editor did not return a token");let{envelope:l,tokenEndpoint:u}=c;if(Tco.debug(r,"Retrieved envelope from copilot/token"),l.expires_at*1e3this.updateCapabilities(r))}static{a(this,"CapabilitiesUpdater")}async updateCapabilities(e){let r=this.ctx.get(kn),n=this.isPreviewFeaturesDisabled(e);n&&!this.isJetBrains()&&r.setCapabilities({mcpAllowlist:!1}),await this.updateCveRemediatorCapability(e,n)}async updateCveRemediatorCapability(e,r){let n=this.ctx.get(kn),o=this.ctx.get(Jt),s=n.getCapabilities().cveRemediatorAgent??!1,c=await o.updateExPValuesAndAssignments(e),l=o.cveRemediatorAgentEnabled(c),u=s&&l&&!r;n.setCapabilities({cveRemediatorAgent:u})}isPreviewFeaturesDisabled(e){return e.getTokenValue("editor_preview_features")==="0"}isJetBrains(){return this.ctx.get(Ir).getEditorPluginInfo().name==="copilot-intellij"}};p();var Tsl=new pe("Public Code References"),tkt=class extends VT{static{a(this,"CLSCitationManager")}async handleIPCodeCitation(e,r){let n=r.location?.start.line!==void 0?r.location.start.line+1:"-",o=r.location?.start.character!==void 0?r.location.start.character+1:"-",s=(r.matchingText??"").replace(/[\r\n]/g," ");Tsl.info(e,`Text found matching public code in ${r.inDocumentUri} [Ln ${n}, Col ${o}] near ${s}...:`+r.details.map((c,l)=>` + ${l+1}) [${c.license}] ${c.url}`).join("")),!(r.version===void 0||r.location===void 0)&&e.get(kn).getCapabilities().ipCodeCitation===!0&&await e.get(Xt).connection.sendNotification(Oqt.type,{uri:r.inDocumentUri,version:r.version,range:r.location,matchingText:r.matchingText??"",citations:r.details})}};p();var LQr=fe(Fc());var Isl=new LQr.ProtocolNotificationType("$/copilot/compressionStarted"),xsl=new LQr.ProtocolNotificationType("$/copilot/compressionCompleted"),rkt=class extends RI{constructor(r){super();this.ctx=r}static{a(this,"CLSCompressionNotifier")}async notifyCompressionStarted(r){await this.ctx.get(Xt).connection.sendNotification(Isl,r)}async notifyCompressionCompleted(r){await this.ctx.get(Xt).connection.sendNotification(xsl,r)}};p();p();function xco(t){wsl(t)}a(xco,"activateExtensibilityPlatformFeature");function wsl(t){t.set(t2,new JJe(t)),t.set(UO,new UO(t))}a(wsl,"registerContextDependencies");p();var wco=S.String(),BQr=class{constructor(e){this.turnContext=e}static{a(this,"BuildLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(ikt,"build logs"),`The contents of the application build logs: \`\`\` ${e} -\`\`\``}},NRt="build-logs",DRt=class extends gg{static{a(this,"BuildLogsSkill")}constructor(e){super(NRt,"The application build logs, which can be used to fix build or compilation errors.","Reading build logs",()=>e,r=>new R7r(r))}};p();var k7r=class{constructor(e){this.turnContext=e}static{a(this,"DirectoryReferencesSkillProcessor")}value(){return 1}async processSkill(e){let r=this.filterDirectoryReferences(e);if(r.length===0)return;let n=await LXe(this.turnContext.ctx,this.turnContext.cancelationToken,r);if(n.length>0){let o=[[new Ar(["The user wants you to consider the following directory structures when computing your answer."]),1]];for(let s of n)o.push([new Ar([s]),1]);return new Ar(o)}}filterDirectoryReferences(e){return e.filter(r=>r.type==="directory")}},P7r=class{static{a(this,"DirectoryReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},bnl="directory-references",MRt=class{constructor(){this.id=bnl;this.type="implicit"}static{a(this,"DirectoryReferencesSkill")}description(){return"The directory structure from the user's referenced directories"}resolver(){return new P7r}processor(e){return new k7r(e)}};p();var Snl=S.Object({uri:S.String(),visibleRange:S.Optional(Sf),openedAt:S.Optional(S.String()),activeAt:S.Optional(S.String())}),Sso=S.Object({files:S.Array(Snl)}),Tnl=3,D7r=class{constructor(e){this.turnContext=e}static{a(this,"RecentFilesSkillProcessor")}value(){return .7}async processSkill(e){let r=await this.getDocuments(e);if(r.length>0){let n=this.toElidableDocs(r),o=Cq(n,"inversePositional");return await this.preElideDocuments(o)}}async getDocuments(e){let r=this.sortFiles(e.files);r=this.filterIncludedDocs(r);let n=this.turnContext.ctx.get(ii),o=[];for(let s of r){let c=await n.getOrReadTextDocument(s),l=td(c);if(await this.turnContext.collectFile(LRt,s.uri,l),c.status==="valid"&&l!=="empty"&&(o.push([c.document,s]),o.length===Tnl))break}return o.reverse()}sortFiles(e){return e.sort((r,n)=>r.activeAt&&n.activeAt?new Date(r.activeAt).getTime()-new Date(n.activeAt).getTime():r.activeAt?-1:n.activeAt?1:0).reverse()}filterIncludedDocs(e){return e.filter(r=>!this.turnContext.isFileIncluded(r.uri))}toElidableDocs(e){return e.map(r=>{let[n,o]=r,s=this.turnContext.ctx.get(ii).getRelativePath(n),c=new IO(n,void 0,o.visibleRange);return new Ar([[`Code excerpt from file \`${s}\`:`,1],[c.fromAllCode({addLineNumbers:!1}),.9]])})}async preElideDocuments(e){let r=(await xo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},LRt="recent-files",ORt=class extends gg{static{a(this,"RecentFilesSkill")}constructor(e){super(LRt,"Provides code examples helpful for creating, explaining, refactoring, or fixing code. It's based on the files the user has worked on in the editor.","Resolving recent files",()=>e,r=>new D7r(r))}};p();var Tso=S.String(),N7r=class{constructor(e){this.turnContext=e}static{a(this,"RuntimeLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(FRt,"runtime logs"),`The contents of the application runtime logs: +\`\`\``}},ikt="build-logs",nkt=class extends _g{static{a(this,"BuildLogsSkill")}constructor(e){super(ikt,"The application build logs, which can be used to fix build or compilation errors.","Reading build logs",()=>e,r=>new BQr(r))}};p();var FQr=class{constructor(e){this.turnContext=e}static{a(this,"DirectoryReferencesSkillProcessor")}value(){return 1}async processSkill(e){let r=this.filterDirectoryReferences(e);if(r.length===0)return;let n=await det(this.turnContext.ctx,this.turnContext.cancelationToken,r);if(n.length>0){let o=[[new Ar(["The user wants you to consider the following directory structures when computing your answer."]),1]];for(let s of n)o.push([new Ar([s]),1]);return new Ar(o)}}filterDirectoryReferences(e){return e.filter(r=>r.type==="directory")}},UQr=class{static{a(this,"DirectoryReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},Rsl="directory-references",okt=class{constructor(){this.id=Rsl;this.type="implicit"}static{a(this,"DirectoryReferencesSkill")}description(){return"The directory structure from the user's referenced directories"}resolver(){return new UQr}processor(e){return new FQr(e)}};p();var ksl=S.Object({uri:S.String(),visibleRange:S.Optional(Rf),openedAt:S.Optional(S.String()),activeAt:S.Optional(S.String())}),Rco=S.Object({files:S.Array(ksl)}),Psl=3,QQr=class{constructor(e){this.turnContext=e}static{a(this,"RecentFilesSkillProcessor")}value(){return .7}async processSkill(e){let r=await this.getDocuments(e);if(r.length>0){let n=this.toElidableDocs(r),o=Oq(n,"inversePositional");return await this.preElideDocuments(o)}}async getDocuments(e){let r=this.sortFiles(e.files);r=this.filterIncludedDocs(r);let n=this.turnContext.ctx.get(ni),o=[];for(let s of r){let c=await n.getOrReadTextDocument(s),l=id(c);if(await this.turnContext.collectFile(akt,s.uri,l),c.status==="valid"&&l!=="empty"&&(o.push([c.document,s]),o.length===Psl))break}return o.reverse()}sortFiles(e){return e.sort((r,n)=>r.activeAt&&n.activeAt?new Date(r.activeAt).getTime()-new Date(n.activeAt).getTime():r.activeAt?-1:n.activeAt?1:0).reverse()}filterIncludedDocs(e){return e.filter(r=>!this.turnContext.isFileIncluded(r.uri))}toElidableDocs(e){return e.map(r=>{let[n,o]=r,s=this.turnContext.ctx.get(ni).getRelativePath(n),c=new DO(n,void 0,o.visibleRange);return new Ar([[`Code excerpt from file \`${s}\`:`,1],[c.fromAllCode({addLineNumbers:!1}),.9]])})}async preElideDocuments(e){let r=(await xo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},akt="recent-files",skt=class extends _g{static{a(this,"RecentFilesSkill")}constructor(e){super(akt,"Provides code examples helpful for creating, explaining, refactoring, or fixing code. It's based on the files the user has worked on in the editor.","Resolving recent files",()=>e,r=>new QQr(r))}};p();var kco=S.String(),qQr=class{constructor(e){this.turnContext=e}static{a(this,"RuntimeLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(lkt,"runtime logs"),`The contents of the application runtime logs: \`\`\` ${e} -\`\`\``}},FRt="runtime-logs",BRt=class extends gg{static{a(this,"RuntimeLogsSkill")}constructor(e){super(FRt,"The application runtime or debug logs, which are used to view output logs from the console. This is useful for debugging and troubleshooting runtime issues.","Reading runtime logs",()=>e,r=>new N7r(r))}};p();var URt=de(PP());var QRt=class extends zh{constructor(r){super();this.ctx=r}static{a(this,"AgentConversationInspector")}shouldInspect(){return Q9e(this.ctx)}get connection(){if(this.shouldInspect())return this.ctx.get(ar).connection}async inspectPrompt(r){return this.connection?.sendNotification(new URt.NotificationType("conversation/inspectPrompt"),r)}async inspectFetchResult(r){return this.connection?.sendNotification(new URt.NotificationType("conversation/inspectFetchResult"),r)}async documentDiff(r){return this.connection?.sendNotification(new URt.NotificationType("conversation/documentDiff"),r)}};p();var Iso=de(Xc());var p6e=class{constructor(e){this.ctx=e;this.notificationEndpoint="conversation/preconditionsNotification";e.get(ck).onChange(r=>{this.sendNotification(r)})}static{a(this,"PreconditionsNotifier")}sendNotification(e){return this.ctx.get(ar).connection.sendNotification(new Iso.NotificationType(this.notificationEndpoint),e)}};function xso(t){Inl(t),xnl(t),Cso(t)}a(xso,"activateConversationFeature");function Inl(t){t.set(zo,new zo(t)),t.set(Ag,new Ag),t.set(kA,new kA(t)),t.set(el,new nYe(t)),t.set(F9,new F9),t.set(Tc,new Tc(t)),t.set(ck,new ck(t)),t.set(p6e,new p6e(t)),t.set(xs,new I$e(t,new T$e(t))),t.set(RN,new RN),t.set(zh,new QRt(t)),t.set(t2,new t2(t))}a(Inl,"registerContextDependencies");function xnl(t){let e=new Yh;e.registerSkill(new uXe(new lXe)),e.registerSkill(new UKe(new zv(t,xO,Bvn))),e.registerSkill(new xKe(new zv(t,GP,Dvn))),e.registerSkill(new IKe(new zv(t,lE,Pvn))),e.registerSkill(new QKe),e.registerSkill(new MRt),e.registerSkill(new ORt(new zv(t,LRt,Sso))),e.registerSkill(new hJe(new zv(t,MO,$Cn))),e.registerSkill(new hXe(new zv(t,Qq,kxn))),e.registerSkill(new BRt(new zv(t,FRt,Tso))),e.registerSkill(new DRt(new zv(t,NRt,bso))),e.registerSkill(new gXe(new zv(t,r2,Pxn))),e.registerSkill(new AXe(new zv(t,cJ,Dxn))),t.set(Yh,e)}a(xnl,"registerSkills");p();var wso=de(Xc()),Rso=de(PP());var qRt=class extends qd{constructor(){super(...arguments);this.requestType=new wso.ProtocolRequestType("conversation/invokeClientToolConfirmation");this.typeCheck=qu.Compile(QAn)}static{a(this,"AgentClientToolConfirmationInvoker")}async invokeClientToolConfirmation(r,n){let o=this.ctx.get(ar).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Rso.ResponseError(u.code,u.message,u.data);throw ot.error(this.ctx,`ResponseError while invoking client tool confirmation ${n.name}`,d),new Error(`Failed to invoke client tool confirmation ${n.name}: ${u.message}`)}s=l}catch(c){throw new Error(`Failed to invoke client tool confirmation ${n.name}: ${String(c)}`)}if(s==null)throw new Error(`Failed to invoke client tool confirmation ${n.name}: No result returned`);if(!this.typeCheck.Check(s))throw new QA(this.typeCheck.Errors(s));return s}};p();var kso=de(Xc()),Pso=de(PP());var jRt=class extends F_{constructor(){super(...arguments);this.requestType=new kso.ProtocolRequestType("conversation/invokeClientTool");this.typeCheck=qu.Compile(UAn)}static{a(this,"AgentClientToolInvoker")}async invokeClientTool(r,n){let o=this.ctx.get(ar).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Pso.ResponseError(u.code,u.message,u.data);throw ot.error(this.ctx,`ResponseError while invoking client tool ${n.name}`,d),new Error(`Failed to invoke client tool ${n.name}: ${u.message}`)}s=l}catch(c){throw new Error(`Failed to invoke client tool ${n.name}: ${String(c)}`)}if(s==null)throw new Error(`Failed to invoke client tool ${n.name}: No result returned`);if(!this.typeCheck.Check(s))throw new QA(this.typeCheck.Errors(s));return this.transformToToolResult(s)}transformToToolResult(r){let n=r.content.map(o=>typeof o.value=="string"?new Rr(o.value):new _K(o.value));return new Lr(n,r.status??"success")}};p();p();function Dso(t,e,r){try{let n=t.get(Zt).javaContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Nr.debug(t,"Failed to get the active Java experiments for the Context Provider API",n),!1}return!0}a(Dso,"fillInJavaActiveExperiments");var M7r=de(PP());var wnl={type:new M7r.NotificationType("featureFlagsNotification")},Rnl={type:new M7r.NotificationType("copilot/didChangeFeatureFlags")},h6e=class{constructor(e){this.ctx=e;bs(e,r=>this.sendNotification(r))}static{a(this,"FeatureFlagsNotifier")}async sendNotification(e){let r=this.ctx,n=!1,o=!1,s=!1,c=!1,l=!1,u=!1,d=r.get(Zt),f=await d.updateExPValuesAndAssignments(e);n=d.ideDataMigrationCompleted(f),o=d.appmodContextMenuEnabled(f),s=d.appmodProblemsViewEnabled(f),c=d.cliAsDefaultAgentProviderEnabled(f),l=kdn(r,f),u=d.inlineChatUseCliEnabled(f);let h={};r.get(Zt).excludeRelatedFiles(f)&&(h.ExcludeRelatedFiles=!0);let m=Qfr(r,f);m.length>0&&(h.ExpContextProviders=m);let g=new Map;NXn(r,m,g,f),qlt(r,g,f),Dso(r,g,f);for(let[E,_]of g.entries())h[E]=_;let A=r.get(bn),y=r.get(ar).connection;if(A.getCapabilities().didChangeFeatureFlags)await y.sendNotification(Rnl.type,{envelope:{...e.envelope,token:void 0,expires_at:void 0,refresh_in:void 0,limited_user_quotas:void 0,limited_user_reset_date:void 0,error_details:void 0,organization_list:void 0,enterprise_list:void 0,endpoints:void 0},token:e.getTokenValues(),activeExps:h,byok:XQ(e),data_migration_completed:n,appmod_context_menu_enabled:o,appmod_problems_view_enabled:s,cli_as_default_agent_provider_enabled:c,ide_enable_copilot_nes_nonfree_enabled:l,inline_chat_use_cli_enabled:u,user_info__cli_enabled:e.userInfo.cliEnabled,copilot_plan:e.userInfo.copilotPlan});else{let E={rt:e.getTokenValue("rt")==="1",sn:e.getTokenValue("sn")==="1",chat:e.envelope.chat_enabled??!1,ic:e.envelope.chat_enabled??!1,pc:!0,ae:h,byok:XQ(e),data_migration_completed:n,appmod_context_menu_enabled:o,appmod_problems_view_enabled:s,cli_as_default_agent_provider_enabled:c,ide_enable_copilot_nes_nonfree_enabled:l,inline_chat_use_cli_enabled:u};e.getTokenValue("agent_mode")==="0"&&(E.agent_mode=!1),e.getTokenValue("agent_mode_auto_approval")==="0"&&(E.agent_mode_auto_approval=!1),e.getTokenValue("mcp")==="0"&&(E.mcp=!1),e.envelope.chat_enabled&&(E.xc=!0),e.userInfo.cliEnabled!==void 0&&(E.user_info__cli_enabled=e.userInfo.cliEnabled),await y.sendNotification(wnl.type,E)}}};p();var HRt=class extends ps{constructor(r){super();this.ctx=r;this.notificationEndpoint="statusNotification"}static{a(this,"NotificationStatusReporter")}didChangeV1(r){let n=r.kind;r.busy&&n!=="Error"&&(n="InProgress"),this.ctx.get(ar).connection.sendNotification(XQt.type,{busy:r.busy,kind:r.kind,status:n,message:r.message??""}),this.ctx.get(ar).connection.sendNotification("didChangeStatus",{busy:r.busy,kind:r.kind,message:r.message,command:r.command})}didChangeV2(r){this.ctx.get(ar).connection.sendNotification(eqt.type,r)}};p();var Nso=new fe("AgentEncodingConfigurationService"),GRt=class extends SO{static{a(this,"AgentEncodingConfigurationService")}constructor(e){super(e),this.service=e.get(ar)}async requestEncodingFromClient(e){if(!this.service.clientCapabilities?.workspace?.configuration){Nso.debug(this.ctx,"Client does not support workspace/configuration, using UTF-8 fallback");return}try{let o=(await this.service.connection.workspace.getConfiguration([{scopeUri:e,section:"copilot.file.encoding"}]))[0];return o&&["utf8","utf-8","utf16le","ucs2","ucs-2","base64","base64url","latin1","binary","hex","ascii"].includes(o)?o:void 0}catch(n){Nso.debug(this.ctx,`Unable to request encoding for ${e}, using UTF-8 fallback`,n);return}}};p();var Mso=new SQ;p();var Bso=de(ri());var Fso={"mcp.contributionPoint.enabled":{description:"Whether extension-contributed MCP servers are enabled",defaultValue:!0,type:"boolean"},"customAgent.enabled":{description:"Whether custom agent functionality is enabled",defaultValue:!0,type:"boolean"},"customHook.enabled":{description:"Whether custom hook functionality is enabled",defaultValue:!0,type:"boolean"},"customSkill.enabled":{description:"Whether custom skill functionality is enabled",defaultValue:!0,type:"boolean"},"subagent.enabled":{description:"Whether subagent functionality is enabled",defaultValue:!0,type:"boolean"},"autoModel.enabled":{description:"Whether auto model functionality is enabled",defaultValue:!0,type:"boolean"},"cveRemediatorAgent.enabled":{description:"Whether CVE remediator agent functionality is enabled",defaultValue:!0,type:"boolean"},"agentMode.autoApproval.enabled":{description:"Whether agent mode auto-approval is enabled",defaultValue:!0,type:"boolean"}},knl=new Bso.NotificationType("policy/didChange"),Pnl=Object.fromEntries(Object.entries(Fso).map(([t,e])=>[t,{type:e.type}])),m6e=class extends jl{constructor(r,n){super();this.ctx=r;this.connection=n;this.disposed=!1;this.policyValues=new Map(Object.entries(Fso).map(([r,n])=>[r,n.defaultValue]));let o=r.get(ar);o.onActivation(()=>{this.startWatching().catch(s=>{Nr.error(this.ctx,"Unexpected error starting policy watcher:",s)})}),o.onDeactivation(()=>{this.dispose()})}static{a(this,"GroupPolicyWatcher")}async startWatching(){try{let{createWatcher:r}=await Promise.resolve().then(()=>de(Lso()));this.policyWatcher=r("IDEGitHubCopilot",Pnl,n=>{this.handlePolicyUpdate(n).catch(o=>{Nr.error(this.ctx,"Error in handlePolicyUpdate:",o)})}),Nr.info(this.ctx,"Policy watcher started for GitHub Copilot Plugin")}catch(r){process.platform==="darwin"||process.platform==="win32"?Nr.exception(this.ctx,r,"Policy watcher failed to load on supported platform"):Nr.warn(this.ctx,"Policy watcher not available - continuing without policy watching:",r instanceof Error?r.message:String(r))}}async handlePolicyUpdate(r){Nr.debug(this.ctx,"GroupPolicyWatcher - policy update triggered",r);let n=!1;for(let[o,s]of Object.entries(r))if(s!==void 0){let c=o;this.policyValues.get(c)!==s&&(n=!0),this.policyValues.set(c,s),Nr.debug(this.ctx,`Policy change: ${o} = ${s}`)}n&&this.policyChangeEmitter.fire(void 0),this.policyValues.get("subagent.enabled")===!1&&this.ctx.get(bn).setCapabilities({subAgent:!1}),this.policyValues.get("cveRemediatorAgent.enabled")===!1&&this.ctx.get(bn).setCapabilities({cveRemediatorAgent:!1}),await this.sendPolicyChangeNotification()}getAllPolicyValues(){let r={};for(let[n,o]of this.policyValues.entries())r[n]=o;return r}getPolicyValue(r){return this.policyValues.get(r)}sendPolicyChangeNotification(){if(this.disposed)return Promise.resolve();let r=this.getAllPolicyValues();try{return this.connection.sendNotification(knl,r)}catch{return Promise.resolve()}}dispose(){if(!this.disposed){if(this.disposed=!0,this.policyWatcher){try{this.policyWatcher.dispose()}catch(r){Nr.error(this.ctx,"Error disposing policy watcher:",r)}this.policyWatcher=void 0}Nr.debug(this.ctx,"Policy watcher stopped")}}};p();var $Rt=class{constructor(e){this.ctx=e}static{a(this,"McpServerManagerAdapter")}serversChanged(e){this.ctx.get(ar).connection.sendNotification(nVi,{scope:e}).catch(()=>{})}serverDetailsChanged(e){this.ctx.get(ar).connection.sendNotification(iVi,{source:e.source,name:e.name}).catch(()=>{})}unregisterProvider(e){return this.ctx.get(YN).unregisterProvider(e)}};p();var VRt=class extends wb{static{a(this,"CLSMcpAuthServer")}constructor(e){super(),this.ctx=e}getAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);return this.ctx.get(uA).get(n)}updateAccountPreference(e,r,n){let o=this._getAccountPreferenceKey(e,r);this.ctx.get(uA).set(o,n.label)}removeAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);this.ctx.get(uA).delete(n)}_getAccountPreferenceKey(e,r){return`mcp-${e}-${r}`}};p();p();p();p();var Uso=de(ri());var WRt="mcp.elicitation",zRt=class{constructor(){this.ongoingMcpElicitationCalls=!1;this.elicitationRequestType=new Uso.ProtocolRequestType("copilot/mcpElicitation")}static{a(this,"ElicitationHandler")}async handleRequest(e,r,n,o,s){if(this.ongoingMcpElicitationCalls)throw new Un(ei.InternalError,"Another MCP elicitation request is already in progress.");this.ongoingMcpElicitationCalls=!0;try{let c=n.params.message;if("url"in n.params)throw new Un(ei.InvalidRequest,"URL mode elicitation is not supported");let l=n.params.requestedSchema;sr.info(e.ctx,`MCP server ${r} elicitation request received: ${c}`),await lc(e.ctx,{message:`MCP server ${r} elicitation request received: ${c}`,server:r});let d=await e.ctx.get(wO).sendRequest(this.elicitationRequestType,{mcpServer:r,message:c,requestedSchema:l,conversationId:e.conversation.id.toString(),roundId:o??e.agentToolCalls.getRound(0).roundId,turnId:e.turn.id.toString(),toolCallId:s??e.agentToolCalls.getRound(0).toolCalls[0].id});return Et(e.ctx,WRt,Wt.createAndMarkAsIssued()),At(e.ctx,WRt),d}catch(c){let l=`Failed to process elicitation request: ${c instanceof Error?c.message:String(c)}`;throw sr.error(e.ctx,l,c),await _0(e.ctx,{message:l,server:r}),qa(e.ctx,c,WRt),Vn(e.ctx,WRt,c),new Un(ei.InternalError,l)}finally{this.ongoingMcpElicitationCalls=!1}}};p();p();p();var Ik=class{static{a(this,"MCPNotificationHandler")}constructor(e,r){this.ctx=e,this.serverName=r}};var g6e=class extends Ik{static{a(this,"LoggingMessageNotificationHandler")}constructor(e,r){super(e,r)}handle(e){let r=typeof e.params.data=="string"?e.params.data:JSON.stringify(e.params.data);switch(e.params.logger&&(r=`${e.params.logger}: ${r}`),e.params?.level){case"debug":case"info":case"notice":sr.info(this.ctx,`MCP server ${this.serverName} log:`,r),lc(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"warning":sr.warn(this.ctx,`MCP server ${this.serverName} log:`,r),kX(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"error":case"critical":case"alert":case"emergency":sr.error(this.ctx,`MCP server ${this.serverName} log:`,r),_0(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;default:sr.info(this.ctx,`MCP server ${this.serverName} log:`,r),lc(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break}}};p();var A6e=class extends Ik{static{a(this,"PromptListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Prompts list changed, refreshing prompts..."),lc(this.ctx,{message:"Prompts list changed, refreshing prompts...",server:this.serverName}),this.emitter.emit(cTt)}};p();var y6e=class extends Ik{static{a(this,"ResourceListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Resource list changed, refreshing resources..."),lc(this.ctx,{message:"Resource list changed, refreshing resources...",server:this.serverName}),this.emitter.emit(aTt)}};p();var E6e=class extends Ik{static{a(this,"ResourceUpdatedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,`Resource updated for URI: ${e.params.uri}`),lc(this.ctx,{message:`Resource updated: ${e.params.uri}`,server:this.serverName}),this.emitter.emit(t$i)}};p();var YRt=class{static{a(this,"MCPRequestHandler")}constructor(e,r){this.ctx=e,this.serverName=r}},_6e=class extends YRt{static{a(this,"ListRootsRequestHandler")}constructor(e,r){super(e,r)}handle(e){sr.info(this.ctx,`MCP server ${this.serverName} requested roots list`);let r=[];try{(this.ctx.get($r).getWorkspaceFolders()||[]).forEach(o=>{r.push(o)}),lc(this.ctx,{message:`Requested roots list and found ${r.length} root(s).`,server:this.serverName})}catch(n){sr.error(this.ctx,`Error getting workspace folders for MCP server ${this.serverName}:`,n),_0(this.ctx,{message:`Error getting workspace folders for MCP server ${this.serverName}: ${n instanceof Error?n.message:String(n)}`,server:this.serverName})}return{roots:r}}};p();var v6e=class extends Ik{static{a(this,"ToolListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Tool list changed, refreshing tools..."),lc(this.ctx,{message:"Tool list changed, refreshing tools...",server:this.serverName}),this.emitter.emit(sTt)}};p();var Qso="mcp.sampling",KRt=class{constructor(){this.defaultTemperature=.7;this.ongoingMcpSamplingCalls=!1}static{a(this,"McpSamplingService")}async handleSamplingRequest(e,r,n,o,s,c){try{if(this.ongoingMcpSamplingCalls)throw new Un(ei.InternalError,"Another MCP sampling request is already in progress.");this.ongoingMcpSamplingCalls=!0,sr.info(e.ctx,`MCP server ${o} requested sampling:`,n.params),await lc(e.ctx,{message:`Sampling request received from ${o}: ${JSON.stringify({messageCount:n.params.messages.length,systemPrompt:n.params.systemPrompt?"provided":"none",maxTokens:n.params.maxTokens,temperature:n.params.temperature})}`,server:o});let l=await e.ctx.get(_W).readMcpSamplingConfig({serverName:o});if(l.alwaysDeny)throw new Error("User has chosen to always deny MCP tools with this mcp server.");if(!l.alwaysAllow){let y=n.params.messages.filter(v=>v.role==="user"),E=y[y.length-1];if((await e.ctx.get(qd).invokeClientToolConfirmation(e,{name:o,title:`Allow MCP tools from "${o}" to make LLM requests?`,message:`The MCP server "${o}" has issued a request to make a language model call. Do you want to allow it to make requests during chat?`,input:{...E,toolType:"mcp_tool",mcpType:"sampling",mcpServerName:o},conversationId:e.conversation.id,roundId:s??e.agentToolCalls.getRound(0).roundId,turnId:e.turn.id,toolCallId:c??e.agentToolCalls.getRound(0).toolCalls[0].id})).result==="dismiss")throw new Oc}let u=await this.getModelConfiguration(e.ctx,n,l),d=this.convertMCPMessagesToChatML(e.ctx,n.params.messages,n.params.systemPrompt),f=(await axe(e.ctx,e.turn.telemetryId,e.conversation.telemetryId)).extendedBy({messageSource:"mcp.sampling"}),m=new Fn.CancellationTokenSource().token,g=await r.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:e.toLlmInteraction(),temperature:n.params.temperature??this.defaultTemperature,stop:n.params.stopSequences,turnId:String(e.turn.id)},m,f),A=this.processFetchResult(g,u.uiName);return At(e.ctx,Qso,{userPreference:l.alwaysAllow?"autoApprove":l.alwaysDeny?"autoDeny":"none",selectedModel:u.uiName,success:"true"}),A}catch(l){let u=`Failed to process sampling request: ${l instanceof Error?l.message:String(l)}`;throw sr.error(e.ctx,u,l),await _0(e.ctx,{message:u,server:o}),At(e.ctx,Qso,{success:"false",errorMessage:u}),new Un(ei.InternalError,u)}finally{this.ongoingMcpSamplingCalls=!1}}convertMCPMessagesToChatML(e,r,n){let o=[];n&&o.push({role:"system",content:n});for(let s of r){let c,l=Array.isArray(s.content)?s.content[0]:s.content;if(!l){sr.warn(e,"Empty content in MCP message, skipping");continue}if(l.type==="text")c=l.text;else if(l.type==="image")c=[{type:"image_url",image_url:{url:atob(l.data)}}];else throw sr.warn(e,`Unknown MCP content type: ${l.type}, defaulting to empty array`),new Error(`Unknown MCP content type: ${l.type}`);let u;switch(s.role){case"user":u="user";break;case"assistant":u="assistant";break;default:u="user",sr.warn(e,`Unknown MCP role: ${s.role}, defaulting to user`)}o.push({role:u,content:c})}return o}processFetchResult(e,r){if(e.type!=="success"){let n=`Unexpected fetch result type: ${e.type}.`;throw"reason"in e&&(n+=` Reason: ${e.reason}`),new Error(n)}return{model:r,role:"assistant",content:{type:"text",text:e.value}}}async getModelConfiguration(e,r,n){let o=await this.getAvailableBYOKModels(e),s=[...await this.getAvailableModels(e),...o.map(d=>d.name)];if(!s)throw new Error("No available models found");let c=n.allowedModels&&n.allowedModels.length>0?s.filter(d=>n.allowedModels.some(f=>f.toLowerCase()===d.toLowerCase())):s;if(!c||c.length===0)throw new Error("No available models found");let l;r.params.modelPreferences?.hints&&(l=this.mapFindFirst(r.params.modelPreferences.hints,d=>c.find(f=>f.toLowerCase().includes(d.name.toLowerCase())))),l=l??c[0];let u=o.find(d=>d.name===l);return u?hO(e,u.provider,l):await e.get(el).getBestChatModelConfig([l])}async getAvailableModels(e){return(await e.get(xs).getMetadata()).filter(n=>n.capabilities.type&&!sle.has(n.capabilities.family)&&n.capabilities.supports?.tool_calls&&(n.capabilities.limits?.max_prompt_tokens??!1)).map(n=>n.capabilities.family)}async getAvailableBYOKModels(e){return(await new da(e.get(Yn)).getAllModels(e)).filter(n=>n.capabilities?.toolCalling)}mapFindFirst(e,r){for(let n of e){let o=r(n);if(o!==void 0)return o}}};p();var sCe=class extends Error{constructor(r,n){super(r);this.challengeInfo=n;this.name="ScopeChallengeError"}static{a(this,"ScopeChallengeError")}};function qso(t,e){if(t!==403||!e)return null;let{scheme:r,params:n}=Fct(e);if(r!=="Bearer"||n.error!=="insufficient_scope")return null;let o=n.scope;if(!o)return null;let s=o.split(" ").filter(c=>c.length>0);return{error:n.error,requiredScopes:s,resourceMetadata:n.resource_metadata,errorDescription:n.error_description}}a(qso,"parseScopeChallenge");p();var L7r=/[^a-z0-9_-]/gi;var Dnl=process.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function jso(){let t={};for(let e of Dnl){let r=process.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(jso,"getDefaultEnvironment");async function Hso(t,e,r){if(!e.description){let n=`Tool ${e.name} does not have a description. Tools must be accurately described to be called.`;sr.warn(t,n),await kX(t,{message:n,server:r,tool:e.name}),e.description=""}if(L7r.lastIndex=0,L7r.test(e.name)){let n=`Tool ${e.name} is invalid. Tools names may only contain [a-zA-Z0-9_-]`;sr.warn(t,n),await kX(t,{message:n,server:r,tool:e.name}),e._nameForModel=e.name.replace(L7r,"_")}else e._nameForModel=e.name;return e}a(Hso,"normalizeTool");var JRt=class{constructor(){this.seenPrefixes=new Set}static{a(this,"McpPrefixGenerator")}generate(e){let r="mcp_"+e.toLowerCase().replace(/[^a-z0-9_.-]+/g,"_").slice(0,13),n=r;for(let o=2;this.seenPrefixes.has(n);o++)n=r+o;return this.seenPrefixes.add(n),n}};p();async function*B7r(t,e,r){let n;do{let o=await t(n),s=e(o);s.length>0&&(yield s),n=r(o)}while(n!==void 0)}a(B7r,"paginateRequest");async function F7r(t){let e=[];for await(let r of t)e.push(...r);return e}a(F7r,"flattenAsyncIterable");var Gso=de(require("events"));var U7r=6e4,vW=class{constructor(e,r,n){this.transport=null;this.emitter=new Gso.default;this.ongoingMcpToolCalls=[];this.isSamplingEnabled=!1;this.isElicitationEnabled=!1;this.cachedTools=[];this.cachedResources=[];this.cachedResourceTemplates=[];this.cachedPrompts=[];this.ctx=e;let o=e.get(bn);this.isSamplingEnabled=o.getCapabilities().mcpSampling,this.isSamplingEnabled&&(this.samplingService=new KRt),this.isElicitationEnabled=o.getCapabilities().mcpElicitation,this.isElicitationEnabled&&(this.elicitationHandler=new zRt);let s=this.ctx.get(Ir).getEditorInfo(),c=this.ctx.get(Ir).getEditorPluginInfo();this.mcp=new _H({name:`${s.name}/${c.name}`,version:`${s.version}/${c.version}`},{capabilities:{roots:{listChanged:!0},...this.isSamplingEnabled?{sampling:{}}:{},...this.isElicitationEnabled?{elicitation:{}}:{}}}),this.name=r}static{a(this,"MCPBaseServer")}get isConnected(){return this.transport!==null}async connect(e){if(this.transport=this.initTransport(e),!this.transport){let r=new Error("Failed to initialize transport");throw sr.error(this.ctx,"Transport initialization failed:",r),r}this.addListeners();try{await this.mcp.connect(this.transport),this.initializeCache()}catch(r){throw sr.error(this.ctx,"Connection failed:",r),await _0(this.ctx,{message:`Failed to connect to MCP server: ${r instanceof Error?r.message:String(r)}`,server:this.name}),this.transport=null,r}}async initializeCache(){await Promise.all([this.refreshToolsCache(!0),this.refreshResourcesCache(!0),this.refreshPromptsCache(!0)]),this.emitter.emit(FV)}getCachedTools(){return this.cachedTools}getCachedResources(){return this.cachedResources}getCachedResourceTemplates(){return this.cachedResourceTemplates}getCachedPrompts(){return this.cachedPrompts}restoreCacheFromPersistence(e){this.cachedTools=[...e.tools],this.cachedResources=[...e.resources],this.cachedResourceTemplates=[...e.resourceTemplates],this.cachedPrompts=[...e.prompts]}async createMcpTool(e,r){let n={name:e.name,description:e.description,inputSchema:{...e.inputSchema||{},properties:e.inputSchema?.properties||{},type:e.inputSchema?.type||"object"},_status:r??"enabled",_nameForModel:e.name,annotations:e.annotations};return await Hso(this.ctx,n,this.name),n}async handleMCPOperationError(e,r,n){try{return await e()}catch(o){let s=o;if(s instanceof sCe){let l=`OAuth scope challenge during ${r} from server ${this.name}. Required scopes: ${s.challengeInfo.requiredScopes.join(", ")}`;if(n.scopeChallengeHandler)return n.scopeChallengeHandler(s.challengeInfo.requiredScopes);if(sr.info(this.ctx,l),await _0(this.ctx,{message:l,server:this.name}),n.errorHandler)return n.errorHandler(l);if("defaultValue"in n)return n.defaultValue;throw s}if(s.code===ei.MethodNotFound){if(sr.info(this.ctx,`${r} not supported by server ${this.name}:`,s.message),"methodNotFoundValue"in n)return n.methodNotFoundValue;if(n.errorHandler)return n.errorHandler("Method not found");if("defaultValue"in n)return n.defaultValue;throw new Error("No default value or error handler provided")}let c=`Failed to ${r} from server ${this.name}: ${s.message||String(s)}`;if(sr.error(this.ctx,c),await _0(this.ctx,{message:c,server:this.name}),n.errorHandler)return n.errorHandler(c);if("defaultValue"in n)return n.defaultValue;throw new Error("No default value or error handler provided")}}async*getResourcesIterable(e){if(!this.transport)return;let r=B7r(n=>this.mcp.listResources({cursor:n},{signal:e}),n=>n.resources,n=>n.nextCursor);for await(let n of r)yield n}async getResources(e){return await this.handleMCPOperationError(async()=>{let r=await F7r(this.getResourcesIterable(e));return lc(this.ctx,{message:`Discovered ${r.length} resources`,server:this.name}),r},"get resources",{defaultValue:[]})}async*getResourceTemplatesIterable(e){if(!this.transport)return;let r=B7r(n=>this.mcp.listResourceTemplates({cursor:n},{signal:e}),n=>n.resourceTemplates,n=>n.nextCursor);for await(let n of r)yield n}async getResourceTemplates(e){return await this.handleMCPOperationError(async()=>{let r=await F7r(this.getResourceTemplatesIterable(e));return lc(this.ctx,{message:`Discovered ${r.length} resource templates`,server:this.name}),r},"get resource templates",{defaultValue:[]})}async readResource(e){return this.transport?await this.handleMCPOperationError(async()=>await this.mcp.readResource({uri:e}),`read resource ${e}`,{defaultValue:null,methodNotFoundValue:{contents:[]}}):null}async subscribeResource(e){this.transport&&await this.handleMCPOperationError(async()=>{await this.mcp.subscribeResource({uri:e})},`subscribe resource ${e}`,{defaultValue:void 0})}async unsubscribeResource(e){this.transport&&await this.handleMCPOperationError(async()=>{await this.mcp.unsubscribeResource({uri:e})},`unsubscribe resource ${e}`,{defaultValue:void 0})}async callTool(e,r,n,o,s,c){let l=RJ();this.ongoingMcpToolCalls.push({requestId:l,toolName:e,turnContext:o,roundId:s,toolCallId:c});let u=a(d=>{let f=new Lr([],"error");return f.content.push(new Rr(d)),f},"createErrorResult");try{return await this.handleMCPOperationError(async()=>{let d=new AbortController;n.onCancellationRequested(()=>{d.abort()});let f=await this.mcp.callTool({name:e,arguments:r,_meta:{progressToken:l}},uH,{onprogress:a(m=>{sr.info(this.ctx,`${e} calling progress`,m),lc(this.ctx,{message:`${e} calling progress:`+JSON.stringify(m),server:this.name})},"onprogress"),resetTimeoutOnProgress:!0,signal:d.signal});if(f&&typeof f=="object"){if(f.content||f.structuredContent)return this.formatToolResult(f);let m=`Error calling tool ${e}: `+JSON.stringify(f);return sr.error(this.ctx,m),await _0(this.ctx,{message:m,server:this.name,tool:e}),u(m)}let h=`Error calling tool ${e}: `+JSON.stringify(f);return sr.error(this.ctx,h),await _0(this.ctx,{message:h,server:this.name,tool:e}),u(h)},`call tool ${e}`,{errorHandler:u})}finally{this.ongoingMcpToolCalls=this.ongoingMcpToolCalls.filter(d=>d.requestId!==l)}}async getPrompt(e,r){return(await this.mcp.getPrompt({name:e,arguments:r})).messages}async completePrompt(e,r,n,o){return(await this.mcp.complete({ref:{type:"ref/prompt",name:e},argument:{name:r,value:n},context:{arguments:o}})).completion.values}addListeners(){this.mcp.onclose=()=>{sr.info(this.ctx,`MCP server ${this.name} connection closed.`),lc(this.ctx,{message:"Connection state: Stopped",server:this.name})},this.mcp.onerror=e=>{sr.error(this.ctx,`MCP server ${this.name} error:`,e),_0(this.ctx,{message:`Connection state: Error: ${e.message}`,server:this.name})},this.mcp.setNotificationHandler(fX,e=>new g6e(this.ctx,this.name).handle(e)),this.mcp.setNotificationHandler(a8,e=>new v6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(s8,e=>new A6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(o8,e=>new y6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(Fcr,e=>new E6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setRequestHandler(Kcr,e=>(this.initRootsTracker(),new _6e(this.ctx,this.name).handle(e))),this.isSamplingEnabled&&this.mcp.setRequestHandler(B2e,async(e,r)=>{if(!this.samplingService){let o="Sampling is not enabled.";throw sr.error(this.ctx,o),new Un(ei.InternalError,o)}if(this.ongoingMcpToolCalls.length===0){let o="No ongoing tool call context found for sampling request.";throw sr.error(this.ctx,o),new Un(ei.InternalError,o)}let n=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return await this.samplingService.handleSamplingRequest(n.turnContext,new oc(this.ctx),e,this.name,n.roundId,n.toolCallId)}),this.isElicitationEnabled&&this.mcp.setRequestHandler(F2e,async e=>{if(this.ongoingMcpToolCalls.length===0){let n="No ongoing tool call context found for elicitation request.";throw sr.error(this.ctx,n),new Un(ei.InternalError,n)}let r=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return this.elicitationHandler.handleRequest(r.turnContext,this.name,e,r.roundId,r.toolCallId)}),this.setupDataRefreshListeners()}setupDataRefreshListeners(){this.emitter.on(sTt,()=>{this.refreshToolsCache()}),this.emitter.on(aTt,()=>{this.refreshResourcesCache()}),this.emitter.on(cTt,()=>{this.refreshPromptsCache()})}async refreshToolsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout(U7r),n=await this.mcp.listTools({},{signal:r}),o=new Map(this.cachedTools.map(s=>[s.name,s._status]));this.cachedTools=await Promise.all(n.tools.map(s=>this.createMcpTool(s,o.get(s.name)))),sr.info(this.ctx,`Refreshed ${this.cachedTools.length} tools for server ${this.name}`),e||this.emitter.emit(FV)},"refresh tools",{defaultValue:void 0})}async refreshResourcesCache(e=!1){if(this.transport)try{let r=AbortSignal.timeout(U7r),[n,o]=await Promise.all([this.getResources(r),this.getResourceTemplates(r)]);this.cachedResources=n,this.cachedResourceTemplates=o,sr.info(this.ctx,`Refreshed ${this.cachedResources.length} resources and ${this.cachedResourceTemplates.length} templates for server ${this.name}`),e||this.emitter.emit(FV)}catch(r){sr.error(this.ctx,`Failed to refresh resources cache for ${this.name}:`,r)}}async refreshPromptsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout(U7r),n=await this.mcp.listPrompts({},{signal:r});this.cachedPrompts=n.prompts,sr.info(this.ctx,`Refreshed ${this.cachedPrompts.length} prompts for server ${this.name}`),e||this.emitter.emit(FV)},"refresh prompts",{defaultValue:void 0})}formatToolResult(e){let r=new Lr([],e.isError===!0?"error":"success");for(let n of e.content??[])if(n.type==="text")r.content.push(new Rr(n.text));else if(n.type==="image"||n.type==="audio")r.content.push(new KQ({mimeType:n.mimeType,data:n.data}));else if(n.type==="resource"){let o=n.resource;if("text"in o)r.content.push(new Rr(o.text));else if("blob"in o){let s=o.mimeType||"application/octet-stream";r.content.push(new KQ({mimeType:s,data:o.blob}))}}return e.structuredContent&&r.content.push(new Rr(JSON.stringify(e.structuredContent))),r}initRootsTracker(){let e=this.ctx.get($r);this.rootsTracker=e.onDidChangeWorkspaceFolders(r=>{this.mcp.sendRootsListChanged().then(()=>{this.rootsTracker?.dispose()})})}getEmitter(){return this.emitter}async cleanup(){this.transport&&(await this.mcp.close(),this.mcp.transport&&this.mcp.transport.onclose?.(),this.rootsTracker?.dispose(),this.transport=null)}};p();function Nnl(t){return a(async(r,n)=>{let o=r instanceof URL?r.toString():r,s;if(n?.headers)if(n.headers instanceof Headers){s={};for(let[f,h]of n.headers.entries())s[f]=h}else if(Array.isArray(n.headers)){s={};for(let[f,h]of n.headers)s[f]=h}else s=n.headers;let c={method:n?.method||"GET",headers:s,body:n?.body,signal:n?.signal||void 0},l=await t.fetch(o,c);if(l.status===403){let f=l.headers.get("WWW-Authenticate"),h=qso(l.status,f);if(h){let m=h.errorDescription||"Insufficient scope for this operation";throw new sCe(m,h)}}let u=l.body(),d=null;if(u)d=new ReadableStream({start(f){let h=a(y=>{f.enqueue(new Uint8Array(y))},"onData"),m=a(()=>{f.close(),A()},"onEnd"),g=a(y=>{f.error(y),A()},"onError"),A=a(()=>{u.off("data",h),u.off("end",m),u.off("error",g)},"cleanup");u.on("data",h),u.on("end",m),u.on("error",g)},cancel(){u&&"destroy"in u&&typeof u.destroy=="function"&&u.destroy()}});else{let f=await l.text();d=new ReadableStream({start(h){h.enqueue(new TextEncoder().encode(f)),h.close()}})}return new globalThis.Response(d,{status:l.status,statusText:l.statusText,headers:new Headers(l.headers)})},"fetchLike")}a(Nnl,"createFetchAdapter");function ZRt(t,e){let r=t.get(tr),n=Nnl(r);return{...e,fetch:n}}a(ZRt,"createConfigWithFetch");var XRt=class extends vW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPSSEServer")}initTransport(r){let n=ZRt(this.ctx,r),{url:o,...s}=n;return new vhe(new URL(o),s)}};p();var $so=require("child_process"),Vso=require("util");var ekt=class extends vW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStdioServer")}initTransport(r){return r.env={...jso(),...r.env||{}},r.stderr="pipe",new xhe(r)}addListeners(){super.addListeners(),this.transport&&this.transport.stderr&&this.transport.stderr.on("data",r=>{kX(this.ctx,{message:`[server stderr] ${r.toString().trimEnd()}`,server:this.name})})}async cleanup(){if(this.transport){if(process.platform==="win32"){let r=null;"pid"in this.transport&&typeof this.transport.pid=="number"&&(r=this.transport.pid),r&&await this.forceKillWindowsProcess(r)}await super.cleanup()}}async forceKillWindowsProcess(r){try{let n=(0,Vso.promisify)($so.exec);sr.info(this.ctx,`Force killing Windows process with PID ${r} for MCP server ${this.name}`),lc(this.ctx,{message:`Force killing Windows process with PID ${r}`,server:this.name}),await n(`taskkill /pid ${r} /t /f`,{timeout:1e4}),sr.info(this.ctx,`Successfully force killed process ${r}`)}catch(n){sr.debug(this.ctx,`Failed to kill process ${r} (process may not exist):`,n),_0(this.ctx,{message:`Failed to kill process ${r} (process may not exist): ${n instanceof Error?n.message:String(n)}`,server:this.name})}}};p();var C6e=class extends vW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStreamableServer")}initTransport(r){let n=ZRt(this.ctx,r),{url:o,...s}=n;return new Che(new URL(o),s)}};p();var tkt=class extends YQ{static{a(this,"McpLanguageModelTool")}constructor(e,r){super({...e,toolProvider:{id:e.serverName,displayNamePrefix:e.serverNamePrefix,displayName:e.serverName,description:e.serverName,isFirstPartyTool:!1},type:"mcp"}),this.invoker=r}prepareInvocation(e,r){let n={title:`Confirm MCP Tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`,message:`Do you want to allow the external MCP tool "${this.toolProvider.displayName}/${this.displayName}" to run?`};return{progressMessage:`Running MCP tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`,confirmationMessages:n}}prepareCompletion(e,r){return{completionMessage:`Ran MCP tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`}}async invoke(e,r,n){return await this.invoker(e,r,r.input,n)}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Oc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations};try{return await e.ctx.get(qd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};var Kso=de(Xc());p();var Wso="mcp-servers-cache",zso="mcp-first-boot-completed",rkt=class{static{a(this,"McpServerMetadataCache")}constructor(e){this.stateDb=e.get(uA),this.initPromise=this.initialize()}async initialize(){await this.stateDb.waitForInitialization()}async isFirstBoot(){return await this.initPromise,this.stateDb.get(zso)!=="true"}async markFirstBootCompleted(){await this.initPromise,this.stateDb.set(zso,"true")}parseCache(){let e=this.stateDb.get(Wso);if(!e)return{};try{return JSON.parse(e)}catch{return{}}}async get(e){return await this.initPromise,this.parseCache()[e]}async store(e){await this.initPromise,this.stateDb.set(Wso,e)}};p();function Yso(t){let e=t.get(Ir).getEditorPluginInfo();if(e.name==="copilot-intellij"){let r=e.version.endsWith("nightly"),n=e.version==="42.0.0.0";return r||n}if(e.name==="copilot-xcode"){let r=e.version.split(".");if(r.length>=3){let[n,o,s]=r;return n==="0"&&o==="0"&&s==="0"||n==="0"&&s!=="0"}}if(e.name==="copilot-eclipse"){let r=e.version.endsWith("nightly"),n=e.version.endsWith("qualifier");return r||n}return!1}a(Yso,"isNightlyOrDevBuild");var nkt=class t extends o_{constructor(r){super();this.MCPServersMap=new Map;this.updateServersQueue=Promise.resolve();this.serverOperationSequencer=new Vx;this.prefixGenerator=new JRt;this.serverPrefixes=new Map;this.isMcpEnabled=!1;this.previousMcpAllowlist=!1;this.storedMCPServersConfig={};this.ctx=r,this.cache=new rkt(r),this.registryService=r.get(PN),bs(this.ctx,async n=>{let o=this.isMcpEnabled;this.isMcpEnabled=this.isTokenMcpEnabled(n),o!==this.isMcpEnabled&&(sr.info(this.ctx,`MCP state changed from ${o} to ${this.isMcpEnabled}`),this.registryService.clearAllCaches(),this.isMcpEnabled?await this.updateMCPServers(this.storedMCPServersConfig):(sr.info(this.ctx,"MCP is disabled, clearing all servers and tools"),this.clearAllServers()))}),this.ctx.get(bn).onDidSetCapabilities(n=>{let o=n.mcpAllowlist;o!==this.previousMcpAllowlist&&(this.previousMcpAllowlist=o,this.registryService.clearAllCaches(),this.isMcpEnabled&&(sr.info(this.ctx,`mcpAllowlist changed to ${o}, updating MCP servers`),this.updateMCPServers(this.storedMCPServersConfig)))})}static{a(this,"CLSMCPManager")}static{this.contentsNotificationType=new Kso.ProtocolNotificationType("copilot/mcpTools")}isTokenMcpEnabled(r){if(!r)return!0;try{return r.getTokenValue("mcp")!=="0"}catch(n){return sr.warn(this.ctx,`Error reading MCP value from token: ${n instanceof Error?n.message:String(n)}`),!0}}isAllowlistFeatureEnabled(){if(this.ctx.get(bn).getCapabilities().mcpAllowlist)return sr.debug(this.ctx,"Allowlist feature enabled via copilotCapabilities.mcpAllowlist"),!0;let n=Yso(this.ctx);return n||sr.debug(this.ctx,"Allowlist feature disabled for stable version, only enabled for nightly/prerelease/dev (use copilotCapabilities.mcpAllowlist to override)"),n}ensureMcpEnabledOrThrow(r){if(!this.isMcpEnabled)throw new Error(`MCP is disabled, cannot ${r}`)}getActiveServerEntry(r){let n=this.MCPServersMap.get(r);if(!n)throw new Error(`MCP server ${r} does not exist`);if(n.isBlocked)throw new Error(`MCP server ${r} is blocked by registry`);return n}async ensureServerConnection(r,n,o){return n.server.isConnected?n.server:(sr.info(this.ctx,`Auto-starting MCP server ${r} for ${o}`),await this.startMCPServer(r),this.getActiveServerEntry(r).server)}async updateMCPServers(r){let n=this.storedMCPServersConfig;if(this.storedMCPServersConfig=r,!this.isMcpEnabled)return;let o=this.ctx.get(bn).getCapabilities().mcpServerManagement??!1,s=new Set(Object.keys(r)),c=new Set(this.MCPServersMap.keys()),l=[...c].filter(m=>!s.has(m)),u=new Set([...s].filter(m=>c.has(m)&&!this.areServerConfigsEqual(n[m],r[m]))),d=new Set;for(let m of u){let g=this.MCPServersMap.get(m);g&&!g.isBlocked&&(g.server.isConnected||g.hasError)&&d.add(m)}let f=[...l,...u];for(let m of f){let g=this.MCPServersMap.get(m);g&&!g.isBlocked&&(this.unregisterServerTools(m),await this.stopMCPServer(m)),u.has(m)||(this.removeServerAccountPreferences(m),this.serverPrefixes.delete(m)),this.MCPServersMap.delete(m)}f.length>0&&await this.persistAllServersCache();for(let m of s)this.MCPServersMap.has(m)||await this.upsertServerDefinition(m,r[m]);if(await this.cache.isFirstBoot()||!o){if(await this.cache.markFirstBootCompleted(),s.size>0){let m=Array.from(s).map(async g=>{try{await this.startServer(g);let A=this.MCPServersMap.get(g);A&&(A.hasError=!1,A.errorMessage=void 0,A.isStarting=!1)}catch(A){let y=this.MCPServersMap.get(g);y&&(y.hasError=!0,y.errorMessage=A instanceof Error?A.message:String(A),y.isStarting=!1),sr.warn(this.ctx,`Failed to auto-start MCP server ${g} during first boot:`,A)}});await Promise.allSettled(m)}}else if(d.size>0){let m=Array.from(d).map(async g=>{try{await this.startServer(g);let A=this.MCPServersMap.get(g);A&&!A.isBlocked&&(A.hasError=!1,A.errorMessage=void 0,A.isStarting=!1)}catch(A){let y=this.MCPServersMap.get(g);y&&!y.isBlocked&&(y.hasError=!0,y.errorMessage=A instanceof Error?A.message:String(A),y.isStarting=!1),sr.warn(this.ctx,`Failed to restart MCP server ${g} after config update:`,A)}});await Promise.allSettled(m)}await this.updateServersList()}areServerConfigsEqual(r,n){return this.stableStringify(r)===this.stableStringify(n)}stableStringify(r){if(Array.isArray(r))return`[${r.map(n=>this.stableStringify(n)).join(",")}]`;if(r&&typeof r=="object"){let n=r;return`{${Object.keys(n).sort().map(s=>`${JSON.stringify(s)}:${this.stableStringify(n[s])}`).join(",")}}`}return JSON.stringify(r)??"undefined"}async upsertServerDefinition(r,n){let o=this.toManagedServerDefinition(r,n),s=this.MCPServersMap.get(r);if(this.isAllowlistFeatureEnabled()){let c=await this.registryService.validateServerConfig(r,n),{registryInfo:l,isBlocked:u,blockReason:d}=c;u?(this.addBlockedServer(o),sr.info(this.ctx,`MCP server ${r} is blocked: ${d}`)):s&&!s.isBlocked?await this.updateServerDefinition(s,o):await this.addServer(o),l&&this.updateRegistryInfo(r,l);return}s&&!s.isBlocked?await this.updateServerDefinition(s,o):await this.addServer(o)}toManagedServerDefinition(r,n){let o=n.type,s="command"in n?"stdio":o??"streamable";return{...n,name:r,type:s}}addBlockedServer(r){this.MCPServersMap.set(r.name,{server:null,definition:r,hasError:!1,errorMessage:void 0,isStarting:!1,isBlocked:!0,authInfo:void 0})}updateRegistryInfo(r,n){let o=this.MCPServersMap.get(r);o&&(o.registryInfo=n)}getAllContents(r){return this.isMcpEnabled?this.getAllMCPServerCapabilities(r):[]}getAllMCPServerCapabilities(r){let n=[];for(let[o,s]of this.MCPServersMap)try{let c=this.createServerSnapshot(o,s);n.push(c)}catch(c){let l=`Failed to create snapshot for MCP server ${o}.`+(c instanceof Error?` message: ${c.message}`:` ${String(c)}`);sr.error(this.ctx,l);let u={name:o,prefix:this.getServerPrefix(o),status:"error",tools:[],resources:[],resourceTemplates:[],prompts:[],error:l};n.push(u)}return r&&!r.isBuiltIn&&r.customTools?n.map(o=>(o.tools=o.tools.map(s=>{let c=this.createMcpLanguageModelTool(o.name,this.getServerPrefix(o.name),s);return s._status=r.customTools.includes(c.configurationKey)?"enabled":"disabled",s}),o)):n}async updateMCPToolsStatus(r,n){this.ensureMcpEnabledOrThrow("batch update tools status");for(let{serverName:o,toolName:s,status:c}of n){let d=this.getActiveServerEntry(o).server.getCachedTools().find(m=>m.name===s),f=this.getServerPrefix(o);if(!d){sr.error(this.ctx,`Not found MCP ${o} server ${s} tool`);continue}ZIe(r)&&(d._status=c),this.ctx.get(gs).getToolById(`${o}.${s}`)||this.registerTool(o,f,d)}await this.ctx.get(gs).updateToolsStatus(r,n.map(({serverName:o,toolName:s,status:c})=>({toolId:`${o}.${s}`,status:c}))),this.persistAllServersCache()}async callTool(r,n,o,s,c,l,u){this.ensureMcpEnabledOrThrow(`call tool ${r}.${n}`);let d=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,d,"tool call")).callTool(n,o,s,c,l,u)}async getPrompt(r,n,o){this.ensureMcpEnabledOrThrow(`get prompt ${r}.${n}`);let s=this.getActiveServerEntry(r),l=await(await this.ensureServerConnection(r,s,"get prompt")).getPrompt(n,o);return Et(this.ctx,"mcp.getPrompt",Wt.createAndMarkAsIssued()),At(this.ctx,"mcp.getPrompt"),l}async completePrompt(r,n,o,s,c){this.ensureMcpEnabledOrThrow(`complete prompt ${r}.${n}`);let l=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,l,"complete prompt")).completePrompt(n,o,s,c)}async readResource(r,n){this.ensureMcpEnabledOrThrow(`read resource from ${r}: ${n}`);let o=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,o,"read resource")).readResource(n)}async startMCPServer(r){return this.ensureMcpEnabledOrThrow(`start server ${r}`),this.serverOperationSequencer.queue(r,async()=>{await this.startMCPServerInternal(r)})}async startMCPServerInternal(r){let n=this.getActiveServerEntry(r);if(n.server.isConnected){sr.info(this.ctx,`MCP server ${r} is already running`);return}if(n.isStarting){sr.info(this.ctx,`MCP server ${r} is already starting, skipping duplicate request`);return}n.isStarting=!0,await lc(this.ctx,{message:`Starting server ${r}`,server:r}),await this.updateServersList(!1),this.unregisterServerTools(r);try{await this.startServer(r);let o=this.MCPServersMap.get(r);o&&(o.hasError=!1,o.errorMessage=void 0,o.isStarting=!1)}catch(o){let s=this.MCPServersMap.get(r);throw s&&(s.hasError=!0,s.errorMessage=o instanceof Error?o.message:String(o),s.isStarting=!1),o}finally{this.registerServerTools(r),await this.updateServersList(!1)}}async stopMCPServer(r){return this.serverOperationSequencer.queue(r,async()=>{await this.stopMCPServerInternal(r)})}async stopMCPServerInternal(r){let n=this.getActiveServerEntry(r);if(n.isStarting){sr.info(this.ctx,`MCP server ${r} is starting, cannot stop now`);return}await lc(this.ctx,{message:`Stopping server ${r}`,server:r}),n.server.getEmitter().removeAllListeners(FV),n.server.isConnected&&await n.server.cleanup(),n.hasError=!1,n.errorMessage=void 0,n.isStarting=!1,await lc(this.ctx,{message:`Server ${r} stopped`,server:r}),await this.updateServersList(!1)}async restartMCPServer(r){return this.ensureMcpEnabledOrThrow(`restart server ${r}`),await lc(this.ctx,{message:`Restarting server ${r}`,server:r}),this.serverOperationSequencer.queue(r,async()=>{await this.stopMCPServerInternal(r),await new Promise(n=>setTimeout(n,100)),await this.startMCPServerInternal(r)})}async logoutMCPServer(r){return this.ensureMcpEnabledOrThrow(`logout server ${r}`),this.serverOperationSequencer.queue(r,async()=>{await lc(this.ctx,{message:`Logging out MCP server ${r}`,server:r}),await this.performLogout(r)})}async clearOAuthMCPServer(r){return this.ensureMcpEnabledOrThrow(`clear OAuth for server ${r}`),this.serverOperationSequencer.queue(r,async()=>{let o=this.getActiveServerEntry(r).authInfo?.providerId;if(!o){sr.warn(this.ctx,`No OAuth provider found for server ${r}, nothing to clear`);return}await lc(this.ctx,{message:`Clearing OAuth provider registration for MCP server ${r}`,server:r}),await this.performLogout(r),sr.info(this.ctx,`Unregistering provider ${o} for server ${r}`);try{await this.ctx.get(YN).unregisterProvider(o)}catch{sr.debug(this.ctx,`Provider ${o} is not a dynamic OAuth provider, skipping unregistration`)}})}async performLogout(r){let n=this.getActiveServerEntry(r);if(n.authInfo){let{providerId:c,accountName:l}=n.authInfo;sr.info(this.ctx,`Removing account preference and session for account ${l} on server ${r} with provider ${c}`),this.ctx.get(wb).removeAccountPreference(r,c);try{let u=this.ctx.get(dm).getProvider(c),f=(await u.getSessions(void 0,{})).find(h=>h.account.label===l);f?(await u.removeSession(f.id),sr.info(this.ctx,`Successfully removed session for account ${l}`)):sr.warn(this.ctx,`No session found for account ${l}`)}catch(u){sr.error(this.ctx,`Failed to remove session for account ${l}:`,u)}n.authInfo=void 0}await this.stopMCPServerInternal(r);let o=this.storedMCPServersConfig[r];if(!o){let c=`Original config not found for server ${r}`;throw sr.error(this.ctx,c),new Error(c)}let s=this.toManagedServerDefinition(r,o);this.MCPServersMap.delete(r),await this.addServer(s),sr.info(this.ctx,`Server ${r} logged out and restored to original configuration`),await this.updateServersList(!1)}async startServer(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;if(n.server.isConnected){sr.info(this.ctx,`MCP server ${r} is already running`);return}let{server:o,definition:s}=n;try{o.getEmitter().on(FV,()=>{this.unregisterServerTools(r),this.persistAllServersCache(),this.registerServerTools(r),this.notifyClient()}),await o.connect(s),await lc(this.ctx,{message:"Connection state: Running",server:r})}catch(c){sr.error(this.ctx,`Error initializing MCP server ${r}:`,c);let l=c instanceof Jw||c instanceof PDe,u=l?c.code:void 0;if(l&&u!==void 0&&"url"in s&&s.type!=="sse"&&o instanceof C6e&&u!==401&&u>=400&&u<500){let f=`${u} status sending message to ${s.url}, will attempt to fall back to legacy SSE`;sr.info(this.ctx,f),lc(this.ctx,{message:f,server:r});let h={...s,name:r,type:"sse"};return await o.cleanup().catch(()=>{}),await this.updateServerDefinition(n,h),await this.startServer(r)}else if(l&&"url"in s&&u===401){let f=await this.getAuthMetadata(s),h=await this.getToken(s.name,s.url,f.authorizationServer,f.serverMetadata,f.resourceMetadata);if(!h){let g=`Failed to get token for server: ${r}`;throw sr.error(this.ctx,g),new Error(g)}let m={...s,name:r,requestInit:{...s.requestInit??{},headers:{...s.requestInit?.headers??{},Authorization:`Bearer ${h}`}}};return await o.cleanup().catch(()=>{}),await this.updateServerDefinition(n,m),await this.startServer(r)}let d=c instanceof Error?`message: ${c.message} stack: ${c.stack}`:String(c);throw await _0(this.ctx,{message:d,server:r}),this.ctx.get(ts).showWarningMessageOnlyOnce(`${r}.initialize`,`Failed to initialize MCP server '${r}'. Please check the logs for more details.`),c}}async updateServersList(r=!0){return this.updateServersQueue=this.updateServersQueue.then(async()=>{r&&this.registerTools(),await this.notifyClient()}).catch(n=>{sr.error(this.ctx,"updateServersList: Update failed",n)}),this.updateServersQueue}getServerPrefix(r){let n=this.serverPrefixes.get(r);if(n)return n;let o=this.prefixGenerator.generate(r);return this.serverPrefixes.set(r,o),o}async persistAllServersCache(){try{let r={};for(let[n,o]of this.MCPServersMap){let s=o.server?.getCachedTools()??[],c=o.server?.getCachedResources()??[],l=o.server?.getCachedResourceTemplates()??[],u=o.server?.getCachedPrompts()??[];r[n]={tools:s,resources:c,resourceTemplates:l,prompts:u}}await this.cache.store(r)}catch(r){sr.error(this.ctx,"Failed to persist MCP servers cache:",r)}}createMCPServer(r){return r.type==="sse"?new XRt(this.ctx,r.name,r.version||"1.0.0"):r.type==="streamable"||"url"in r?new C6e(this.ctx,r.name,r.version||"1.0.0"):new ekt(this.ctx,r.name,r.version||"1.0.0")}async addServer(r){let n=this.createMCPServer(r),o=await this.cache.get(r.name);o&&n.restoreCacheFromPersistence(o),this.MCPServersMap.set(r.name,{server:n,definition:r,hasError:!1,errorMessage:void 0,isStarting:!1,isBlocked:!1})}async updateServerDefinition(r,n){let o=this.createMCPServer(n),s=await this.cache.get(n.name);s&&o.restoreCacheFromPersistence(s),r.server=o,r.definition=n}async notifyClient(){let r=this.getAllContents();await this.ctx.get(ar).connection.sendNotification(t.contentsNotificationType,{servers:r})}registerTools(){for(let[r]of this.MCPServersMap)this.registerServerTools(r)}registerServerTools(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;let o=this.getServerPrefix(r),s=n.server?.getCachedTools()??[];for(let c of s)this.registerTool(r,o,c)}unregisterServerTools(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;let o=n.server?.getCachedTools()??[];for(let s of o)this.unregisterTool(r,s.name)}registerTool(r,n,o){sr.debug(this.ctx,"register MCP Tool:",{...o}),this.ctx.get(gs).registerTool(this.createMcpLanguageModelTool(r,n,o))}createMcpLanguageModelTool(r,n,o){let{name:s,description:c,inputSchema:l,_status:u,_nameForModel:d,annotations:f}=o;return new tkt({serverName:r,serverNamePrefix:n,name:d,displayName:s,description:c||"",displayDescription:c||"",inputSchema:l,annotations:f,status:u},(h,m,g,A)=>(sr.info(this.ctx,"copilot MCP Invoker:",r,s,g),this.callTool(r,s,g,A,h,m.roundId,m.toolCallId?.toString())))}unregisterAllTools(){for(let[r,n]of this.MCPServersMap){if(n.isBlocked)continue;let o=n.server?.getCachedTools()??[];for(let s of o)this.unregisterTool(r,s.name)}}unregisterTool(r,n){sr.debug(this.ctx,"unregister MCP Tool:",{serverName:r,toolName:n}),this.ctx.get(gs).unregisterTool(`${r}.${n}`)}async clearAllServers(){this.unregisterAllTools();for(let r of this.MCPServersMap.keys())if(!this.MCPServersMap.get(r).isBlocked)try{await this.stopMCPServer(r)}catch(o){sr.error(this.ctx,`Error stopping server ${r} during clearAllServers:`,o)}this.MCPServersMap.clear(),this.serverPrefixes.clear()}determineServerStatus(r){return r.isBlocked?"blocked":r.isStarting?"starting":r.server.isConnected?"running":r.hasError?"error":"stopped"}createServerSnapshot(r,n){return{name:r,prefix:this.getServerPrefix(r),status:this.determineServerStatus(n),tools:n.server?.getCachedTools()??[],resources:n.server?.getCachedResources()??[],resourceTemplates:n.server?.getCachedResourceTemplates()??[],prompts:n.server?.getCachedPrompts()??[],error:n.isBlocked?void 0:n.errorMessage,registryInfo:n.registryInfo,authInfo:n.isBlocked?void 0:n.authInfo}}updateAuthInfo(r,n,o,s){let c=this.MCPServersMap.get(r);c&&!c.isBlocked&&(c.authInfo={providerId:n,accountName:o,isDynamic:s})}removeServerAccountPreferences(r){let n=this.MCPServersMap.get(r);if(n?.isBlocked||!n?.authInfo){sr.debug(this.ctx,`No auth info found for server ${r}, nothing to remove`);return}let{providerId:o}=n.authInfo;sr.info(this.ctx,`Removing account preference for server ${r} with provider ${o}`),this.ctx.get(wb).removeAccountPreference(r,o),n.authInfo=void 0}async getAuthMetadata(r){try{return await new She(this.ctx).getMetadataFromOriginalUrl(r.url,r.requestInit?.headers)}catch(n){throw sr.error(this.ctx,`Failed to get auth metadata for ${r.url}: ${n instanceof Error?n.message:String(n)}`,n),n}}async getToken(r,n,o,s,c){let l=this.ctx.get(dm).getOrActivateProviderIdForServer(o);if(!l){let A=this.ctx.get(dm).createAuthenticationProvider(o,s,c);if(!A&&(A=await this.ctx.get(dm).createDynamicAuthenticationProvider(o,s,c),!A)){sr.warn(this.ctx,`Failed to create authentication provider for server ${r} (authServer: ${o})`);return}l=A.id}let u=c?.scopes_supported||s.scopes_supported||[],d=await this.ctx.get(dm).getSessions(l,u,{authorizationServer:o},!0),f=this.ctx.get(wb).getAccountPreference(r,l),h;f&&(h=d.find(A=>A.account.label===f));let m=this.ctx.get(dm).getProvider(l),g=!!this.ctx.get(tC).getClientRegistration(l);if(d.length){if(h)return this.updateAuthInfo(r,l,h.account.label,g),h.accessToken;try{let A=m?.label||l,y="Sign in to another account",E=d.map(v=>({title:v.account.label}));E.push({title:y}),E.push({title:"Cancel"});let _=await this.ctx.get(ts).showInformationModal(`The MCP server ${r} wants to access a ${A} account, Select an account for ${r} to use`,...E);if(!_||_.title==="Cancel"){sr.warn(this.ctx,"user cancelled the account selection");return}if(_.title!==y){let v=d.find(b=>b.account.label===_.title);if(!v){sr.warn(this.ctx,"selected account not found in sessions");return}return this.ctx.get(wb).updateAccountPreference(r,l,v.account),this.updateAuthInfo(r,l,v.account.label,g),v.accessToken}}catch(A){sr.error(this.ctx,"Failed during account selection:",A);return}}else try{if((await this.ctx.get(ts).showInformationModal(`The MCP Server Definition '${n}' wants to authenticate to ${m.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){sr.warn(this.ctx,"user cancelled the authentication request");return}}catch(A){sr.error(this.ctx,"Failed to show authentication request dialog:",A);return}try{let A=await m.createSession(u,{});return this.ctx.get(ts).showInformationMessageOnlyOnce("Authentication successful",`You have already authenticated with ${m.label}.`),this.ctx.get(wb).updateAccountPreference(r,l,A.account),this.updateAuthInfo(r,l,A.account.label,g),A.accessToken}catch(A){sr.error(this.ctx,`Failed to create authentication session for server ${r}:`,A),this.ctx.get(ts).showWarningMessageOnlyOnce("Authentication failed",`You need to restart the IDE to authenticate the MCP server again. ${A instanceof Error?A.message:String(A)}`);return}}};p();var Jso=de(Xc());var ikt=class t extends F2{static{a(this,"CLSMCPRuntimeNotifier")}static{this.notificationType=new Jso.ProtocolNotificationType("copilot/mcpRuntimeLogs")}constructor(e){super(),this.ctx=e}async notifyLog(e){await this.ctx.get(ar).connection.sendNotification(t.notificationType,{...e,time:Date.now()})}};p();var Zso=de(Xc());var Mnl=new Zso.ProtocolRequestType("copilot/readMcpSamplingConfig"),okt=class extends _W{constructor(r){super();this.ctx=r}static{a(this,"CopilotMcpSamplingConfigSender")}async readMcpSamplingConfig(r){let n=this.ctx.get(ar).connection,o;try{o=await n.sendRequest(Mnl,r)}catch(l){throw new Error(`Request copilot/readMcpSamplingConfig failed with message: ${Xu(l)}`)}let[s,c]=o;if(c)throw new Error(`Request copilot/readMcpSamplingConfig failed with code: ${c.code}, message: ${c.message}`);return s}};p();var akt=de(Xc());var Onl=new akt.ProtocolRequestType("copilot/showPanelMessageRequest"),Lnl=new akt.ProtocolNotificationType("copilot/showPanelMessage"),skt=class extends iCe{constructor(r){super();this.ctx=r}static{a(this,"CopilotMessageSender")}async sendPanelMessageNotification(r){return this.ctx.get(ar).connection.sendNotification(Lnl,r)}async sendPanelMessageRequest(r){let n=this.ctx.get(ar).connection,o;try{o=await n.sendRequest(Onl,r)}catch(l){throw new Error(`Request copilot/showPanelMessageRequest failed with message: ${Xu(l)}`)}let[s,c]=o;if(c)throw new Error(`Request copilot/showPanelMessageRequest failed with code: ${c.code}, message: ${c.message}`);return s}};p();p();var eao=require("node:stream"),poe=de($ar());var X9=new fe("UndiciFetcher"),lkt=class extends tr{constructor(r){super();this.ctx=r;this.name="UndiciFetcher";this.userAgent=`GithubCopilot/${r.get(ds).getVersion()}`,this.certificateConfigurator=new F_e(r),this.proxySocketFactory=r.get(uk),this.settings=r.get(Lo).getHttpSettings(),this.updateNoProxyFilters(this.settings.noProxy),X9.info(this.ctx,"Initialized UndiciFetcher.",this.getSettingsLogProperties()),r.get(Lo).onDidChangeHttpSettings(n=>{this.settings=n,this.updateNoProxyFilters(n.noProxy),X9.info(this.ctx,"HTTP settings changed; resetting Undici dispatchers.",this.getSettingsLogProperties()),this.resetDispatchers()})}static{a(this,"UndiciFetcher")}async fetch(r,n){let o={...n.headers??{}};o["User-Agent"]=this.userAgent;let s=n.body;if(n.json!==void 0){if(n.body!==void 0)throw new Error("Illegal arguments! Cannot pass in both 'body' and 'json'!");o["Content-Type"]="application/json",s=JSON.stringify(n.json)}let c=n.method??"GET";if(c!=="GET"&&c!=="POST"&&c!=="DELETE")throw new Error("Illegal arguments! 'method' must be 'GET', 'POST', or 'DELETE'!");let l=!1,u,d=Unl(n.signal),f=d.signal;if(n.timeout){let h=new AbortController;u=setTimeout(()=>{l=!0,h.abort()},n.timeout),f=f?AbortSignal.any([f,h.signal]):h.signal}try{let h={method:c,headers:o,body:s,signal:f};X9.debug(this.ctx,"Starting Undici fetch.",{target:ckt(r),method:c,hasBody:s!==void 0,hasTimeout:n.timeout!==void 0,hasSignal:f!==void 0});let{dispatcher:m,isProxy:g}=await this.getDispatcher(r),A=await(0,poe.fetch)(r,{...h,dispatcher:m});return X9.debug(this.ctx,"Undici fetch completed.",{target:ckt(r),status:A.status,isProxy:g}),new ex(A.status,A.statusText,A.headers,()=>A.text(),()=>A.body?eao.Readable.fromWeb(A.body):null)}catch(h){throw l?(X9.warn(this.ctx,"Undici fetch timed out.",{target:ckt(r),timeout:n.timeout}),new jW(`Request to <${r}> timed out after ${n.timeout}ms`,h)):Qnl(h)}finally{u&&clearTimeout(u),d.cleanup()}}async disconnectAll(){await this.resetDispatchers()}async getDispatcher(r){let n=await this.certificateConfigurator.getCertificates(),o=n?n.join("\0"):"";this.dispatcherCertsKey!==o&&(X9.info(this.ctx,"Root certificate set changed; resetting Undici dispatchers.",{certificateCount:n?.length??0}),await this.resetDispatchers()),this.dispatcherCertsKey=o;let s={allowH2:!0,ca:n,rejectUnauthorized:this.settings.proxyStrictSSL??!0};return!this.settings.proxy||this.shouldBypassProxy(r)?(this.noProxyAgent||(X9.debug(this.ctx,"Creating direct Undici agent.",{target:ckt(r),bypassedProxy:!!this.settings.proxy,rejectUnauthorized:s.rejectUnauthorized}),this.noProxyAgent=new poe.Agent({allowH2:!0,connect:s})),{dispatcher:this.noProxyAgent,isProxy:!1}):(this.proxyAgent||(this.proxyAgent=this.buildProxyAgent(s)),{dispatcher:this.proxyAgent,isProxy:!0})}buildProxyAgent(r){let n=this.settings.proxy,o=new URL(n),s=(0,poe.buildConnector)(r);return X9.debug(this.ctx,"Creating proxied Undici agent.",{proxy:Xso(n),hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal,rejectUnauthorized:r.rejectUnauthorized}),new poe.Agent({allowH2:!0,connect:a((c,l)=>{let u=c.port!==void 0&&c.port!==""?Number(c.port):c.protocol==="https:"?443:80,d={hostname:c.hostname,port:u,headers:{}};this.proxySocketFactory.createSocket(d,{hostname:o.hostname,port:o.port,authorization:this.settings.proxyAuthorization,kerberosServicePrincipal:this.settings.proxyKerberosServicePrincipal}).then(f=>{if(c.protocol!=="https:"){l(null,f);return}s({...c,httpSocket:f},l)}).catch(f=>{l(f instanceof Error?f:new Error(String(f)),null)})},"connect")})}async resetDispatchers(){let r=this.noProxyAgent,n=this.proxyAgent;this.noProxyAgent=void 0,this.proxyAgent=void 0,this.dispatcherCertsKey=void 0,(r||n)&&X9.debug(this.ctx,"Closing Undici dispatchers.",{hasDirectAgent:!!r,hasProxyAgent:!!n}),await Promise.all([r?.close().catch(()=>{}),n?.close().catch(()=>{})])}updateNoProxyFilters(r){let n=(r??[]).map(s=>s.trim()).filter(s=>s.length>0);if(this.noProxyFilters=void 0,n.length===0)return;if(n.includes("*")){this.noProxyFilters=[{regex:/.*/i}];return}let o=[];for(let s of n){let{host:c,port:l}=Bnl(s),u=Fnl(c);u&&o.push({regex:u,port:l})}o.length&&(this.noProxyFilters=o)}getSettingsLogProperties(){return{proxy:Xso(this.settings.proxy),noProxyCount:this.settings.noProxy?.length??0,proxyStrictSSL:this.settings.proxyStrictSSL,hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal}}shouldBypassProxy(r){if(!this.noProxyFilters?.length)return!1;let n;try{n=new URL(r)}catch{return!1}let o=n.hostname;if(!o)return!1;let s=n.port||(n.protocol==="https:"?"443":"80"),c=o.toLowerCase();return this.noProxyFilters.some(l=>l.regex.test(c)&&(!l.port||l.port===s))}};function Bnl(t){if(t.startsWith("[")){let r=t.indexOf("]");if(r!==-1){let n=t.slice(1,r),o=t.slice(r+1);return{host:n,port:o.startsWith(":")?o.slice(1):void 0}}}let e=t.split(":");return e.length===2?{host:e[0],port:e[1]}:{host:t}}a(Bnl,"splitHostPort");function Fnl(t){if(!t)return;t.startsWith(".")&&(t=`*${t}`);let e=t.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${e}$`,"i")}catch{return}}a(Fnl,"compileHostPattern");function ckt(t){try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(ckt,"describeUrl");function Xso(t){if(!t)return"none";try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(Xso,"describeProxy");function Unl(t){if(!t||t instanceof AbortSignal)return{signal:t,cleanup:a(()=>{},"cleanup")};let e=new AbortController,r=a(()=>e.abort(),"abort");return t.addEventListener("abort",r),t.aborted&&e.abort(),{signal:e.signal,cleanup:a(()=>t.removeEventListener("abort",r),"cleanup")}}a(Unl,"toNativeAbortSignal");function Qnl(t){if(!(t instanceof Error)||!("cause"in t)||!t.cause||typeof t.cause!="object")return t;let e=t.cause,r=new Error(t.message,{cause:t.cause});r.stack=t.stack,r.name=t.name,r.code=t.code??e.code,r.syscall=t.syscall??e.syscall,r.errno=t.errno??e.errno;let n=e.statusCode;return typeof n=="number"&&(r.statusCode=n),r}a(Qnl,"withCauseNetworkProperties");p();var b6e=new fe("fetcher"),qnl="https://default.exp-tas.com/",S6e=class extends tr{constructor(r,n,o,s){super();this.ctx=r;this.defaultFetcher=n;this.fallbackFetcher=o;this.onFallbackSuccess=s}static{a(this,"FallbackFetcher")}async fetch(r,n){try{return await this.defaultFetcher.fetch(r,n)}catch(o){if(Gm(o)||`${r}/`.startsWith(qnl))throw o;b6e.info(this.ctx,`Request to <${r}> failed, attempting fallback.`,o);let s=await this.fallbackFetcher.fetch(r,n);return this.onFallbackSuccess(o,r),b6e.info(this.ctx,`Fallback fetch for <${r}> succeeded.`),s}}getImplementation(){return this.defaultFetcher.getImplementation()}get name(){return this.defaultFetcher.name}async disconnectAll(){await this.defaultFetcher.disconnectAll()}},ukt=class extends tr{constructor(r,n,o){super();this.ctx=r;this.primary=n;this.secondary=o;this.default=new S6e(r,n,o,(s,c)=>{this.current!==o&&(b6e.info(r,`${n.name} failed; switching to ${o.name} for subsequent requests.`),this.current=o,Vn(r,"fetcher.stickyFallback",s,{primary:n.name,secondary:o.name,failingHost:Hnl(c),...Gnl(s),...$nl(r)}),n.disconnectAll().catch(l=>{b6e.info(r,`Failed to disconnect ${n.name} after sticky fallback.`,l)}))}),this.current=this.default}static{a(this,"StickyFallbackFetcher")}reset(){this.current!==this.default&&(b6e.info(this.ctx,`Re-arming sticky fallback; ${this.primary.name} will be retried on the next request.`),this.current=this.default)}get name(){return this.current.name}getImplementation(){return this.current.getImplementation()}fetch(r,n){return this.current.fetch(r,n)}async disconnectAll(){await Promise.all([this.primary.disconnectAll(),this.secondary.disconnectAll()])}},jnl=["githubusercontent.com","githubcopilot.com","github.com","exp-tas.com","vscode-cdn.net"];function Hnl(t){let e;try{e=new URL(t).host}catch{return""}let r=e.split(":")[0].toLowerCase();return jnl.some(o=>r===o||r.endsWith(`.${o}`))?e:""}a(Hnl,"describeHost");function Gnl(t){try{if(!(t instanceof Error)||!t.cause)return{};let e=t.cause;Array.isArray(e.errors)&&e.errors.length>0&&e.errors[0]instanceof Error&&(e=e.errors[0]);let r={};for(let[n,o]of Object.entries({errorCauseName:e.name,errorCauseCode:e.code,errorCauseSyscall:e.syscall}))typeof o=="string"&&o&&(r[n]=o.slice(0,100));return typeof e.statusCode=="number"&&(r.errorCauseStatusCode=String(e.statusCode)),r}catch{return{}}}a(Gnl,"buildErrorCauseProperties");function $nl(t){try{let e=t.get(Lo).getHttpSettings(),r=!!e.proxy,n="none";return r&&(n=e.proxyKerberosServicePrincipal?"kerberos":e.proxyAuthorization?"basic":"none"),{proxyConfigured:r?"true":"false",proxyAuth:n,proxyStrictSSL:e.proxyStrictSSL!==!1?"true":"false"}}catch{return{}}}a($nl,"describeHttpContext");var tao=new fe("fetcher");function Vnl(t){return Ft(t,Ye.UseHelixFetcher)==="true"}a(Vnl,"isHelixFetcherForced");function Wnl(t){if(Vnl(t))return new Bie(t);let e=new ukt(t,new lkt(t),new Bie(t));return t.get(Lo).onDidChangeHttpSettings(()=>e.reset()),e}a(Wnl,"createDefaultFetcher");var dkt=class extends tr{constructor(r,n=Wnl(r),o=new L_e(r)){super();this.ctx=r;this.defaultFetcher=n;this.editorFetcher=o;this.updateFetcher=a(()=>{let r,n;if(!this.editorFetcherCapability)n=`Using ${this.defaultFetcher.name}, editor does not have fetch capability.`,r=this.defaultFetcher;else if(this.fetchStrategy==="client")n="Using editor fetcher, fetch strategy set to client.",r=this.editorFetcher;else if(this.fetchStrategy==="native")n=`Using ${this.defaultFetcher.name}, fetch strategy set to native.`,r=this.defaultFetcher;else{let o=Ft(this.ctx,Ye.DebugUseEditorFetcher);o?.toString()==="true"?(n="Using editor fetcher, debug flag is enabled.",r=this.editorFetcher):o?.toString()==="false"?(n=`Using ${this.defaultFetcher.name}, debug flag is disabled.`,r=this.defaultFetcher):(n="Editor fetcher capability available, will fallback if needed.",r=this.fallbackFetcher)}this.currentFetcher!=r&&(tao.debug(this.ctx,n),this.currentFetcher=r)},"updateFetcher");this.currentFetcher=this.defaultFetcher,this.fallbackFetcher=new S6e(r,n,o,()=>{tao.info(this.ctx,"Fallback fetch succeeded, switching to editor fetcher."),this.currentFetcher=this.editorFetcher}),r.get(bn).onDidSetCapabilities(this.updateFetcher),r.get(Lo).onDidChangeCopilotSettings(this.updateFetcher)}static{a(this,"AgentDelegatingFetcher")}get fetchStrategy(){return Ft(this.ctx,Ye.FetchStrategy)}get editorFetcherCapability(){return this.ctx.get(bn).getCapabilities().fetch??!1}getImplementation(){return this.currentFetcher.getImplementation()}get name(){return this.currentFetcher.name}fetch(r,n){return this.currentFetcher.fetch(r,n)}async disconnectAll(){await Promise.all([this.defaultFetcher.disconnectAll(),this.editorFetcher.disconnectAll()])}};p();var pkt=de(ri());var fkt=class extends ts{constructor(r){super();this.ctx=r}static{a(this,"ConnectionNotificationSender")}get connection(){return this.ctx.get(ar).connection}showWarningMessage(r,...n){return this.connection.window.showWarningMessage(r,...n)}showInformationMessage(r,...n){return this.connection.window.showInformationMessage(r,...n)}showInformationModal(r,...n){return this.connection.sendRequest(pkt.ShowMessageRequest.type,{type:pkt.MessageType.Info,message:r,actions:n,modal:!0}).then(o=>o||void 0)}async sendBackgroundAgentSessionUpdate(r,n,o,s){await this.connection.sendNotification("backgroundAgent/sessionUpdate",{sessionId:r,event:n,agentProvider:o,turnIndex:s})}};p();var rao=de(Xc());var hkt=class t extends bK{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaChangeNotifier")}static{this.notificationType=new rao.ProtocolNotificationType("copilot/quotaChange")}async notifyQuotaChange(r){await this.ctx.get(ar).connection.sendNotification(t.notificationType,r)}};p();var nao=de(Xc());var mkt=class t extends tq{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaWarningNotifier")}static{this.notificationType=new nao.ProtocolNotificationType("copilot/quotaWarning")}async notifyQuotaWarning(r){await this.ctx.get(ar).connection.sendNotification(t.notificationType,r)}};p();var iao=de(Xc());var znl=new iao.ProtocolNotificationType("$/copilot/rateLimitWarning"),gkt=class extends qS{constructor(r){super();this.ctx=r}static{a(this,"CLSRateLimitNotifier")}async notifyRateLimitWarning(r){await this.ctx.get(ar).connection.sendNotification(znl,r)}};p();p();var Akt=class extends xze{static{a(this,"AgentWorkspaceWatcher")}async getWatchedFiles(){return(await this.ctx.get(bN).getWatchedFiles({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})).watchedFiles}async getWatchedFileUris(){return this.ctx.get(bN).getWatchedFileUris({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})}startWatching(){if(this.status==="ready")return;let e=this.ctx.get(bN);this._watcher=e.onDidChangeWatchedFiles(this.onDidChangeWatchedFilesHandler.bind(this)),this.status="ready"}stopWatching(){this.status="stopped",this._watcher?.dispose(),this._watcher=void 0}onDidChangeWatchedFilesHandler(e){if(e.workspaceFolder.uri!==this.workspaceFolder.uri)return;let n=e.created.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);if(n.length){let c=n.map(l=>l.document).filter(l=>l!==void 0);this.emitFilesCreated(c)}let o=e.changed.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);if(o.length){let c=o.map(l=>l.document).filter(l=>l!==void 0);this.emitFilesUpdated(c)}let s=e.deleted.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);s.length&&this.emitFilesDeleted(s.map(c=>({uri:c.uri})))}};var ykt=class extends zx{static{a(this,"AgentWorkspaceWatcherProvider")}createWatcher(e){return new Akt(this.ctx,e)}shouldStartWatching(e){return IP(this.ctx)?!1:!!this.ctx.get(bn).getCapabilities().watchedFiles&&(!this.hasWatcher(e)||this.getStatus(e)==="stopped")}};function Ekt(t){let e=new rb(process.env),r=Doo(e);r.set(rb,e),r.set(tr,new dkt(r)),r.set(oc,new oc(r)),a3r(r,{});let n=mtn();r.set(Yn,n),r.set(uA,new uA(r));let o=new RRt;r.set(Rh,o);let s=sao.join(n.directory,mQr),c=v3.plaintextOnly();r.set(v3,c);let{repo:l,diagnostics:u}=Xdn(r,s,c);r.set(nx,l),r.set(Ur,new mje(r,process.env)),r.set(HT,new HT(r)),r.set(Pie,new Pie(r));let d=new pf(r,"agent");d.onInitialized(()=>tfn(r,u)),r.set(pf,d),r.set(Ua,TYi),r.set(UI,new UI),r.set(Ir,new ij),r.set(Fie,hYi()),r.set(Ru,new Ru),r.set(Qo,Mso),r.set(la,new bRt(r)),r.set(dee,new TRt(r)),r.set(zx,new ykt(r)),r.set(bN,new bN(r)),r.set(pm,new pm),r.set(hm,Glt(r,D$i)),r.set(Nb,new Nb(r)),r.set(r4,new nme),fso(r),wze(r),rfn(r),r.set(ar,new ar(r,t)),r.set(wO,new SRt(r)),r.set(ts,new fkt(r)),efn(r,u),r.set(iCe,new skt(r)),r.set(_W,new okt(r)),r.set(Vm,new x_e(r)),r.set(ps,new HRt(r));let f=new m6e(r,t);r.set(m6e,f),r.set(jl,f),r.set(h6e,new h6e(r)),r.set(f6e,new f6e(r)),r.set(tp,new tp);let h=new WV(r);r.set($r,h),r.set(WV,h),r.set($m,new q_e(r,process.env)),r.set(kk,new boe),r.set(nc,new nc(r)),xso(r),lso(r),r.set(wN,new wN),r.set(QV,new QV),r.set(kN,new kN),r.set(qV,new qV([])),r.set(jT,new kRt),r.set(oao.ObservableWorkspace,new bV(r,!0,!0)),r.set(m4,new H_e),r.set(h9,new h9),r.set(Vv,new Vv(r)),r.set(ry,new A1t(r)),r.set(F_,new jRt(r)),r.set(qd,new qRt(r)),r.set(mw,new mw(r)),r.set(gs,new gs(r)),r.set(gF,new gF(r)),r.set(yF,new yF(r)),r.set(tT,new tT(r)),r.set(yJ,new yJ(r)),r.set(XO,new XO),r.set(m0,new m0),r.set(PN,new PN(r)),r.set(o_,new nkt(r)),r.set(F2,new ikt(r)),r.set(dF,new dF(r)),r.set(wb,new VRt(r));let m=new TH(r);r.set(TH,m);let g=new ey(r,m,new $Rt(r));r.set(ey,g),r.set(PT,new PT(r,m,g)),r.set(iie,GQi(r)),r.set(qS,new gkt(r)),r.set(HX,new HX),r.set(Rie,new Rie),r.set(dm,new wRt(r)),r.set(tC,new IRt(r)),r.set(YN,new YN(r));let A=new wA(r);r.set(wA,A),r.set(bf,new bf(r,A)),r.set(Cg,new Cg(r,A)),r.set(Ld,new Ld(r,A)),r.set(h0,new h0(r,e,A));let y=new w3(r,A,n);r.set(w3,y),r.get(US).addListener(y.lifecycleListener);let E=new u6e;r.set(u6e,E),r.set(a0,new lIt(r)),r.set(ug,new ug(r,E)),r.set(Aw,new Aw),r.set(nT,new nT(r)),r.set(Zq,new Zq(r)),r.set(nw,new kO([new PO,new DO])),r.set(wie,new wie(r)),r.set(j_,new j_(r)),r.set(tq,new mkt(r)),r.set(bK,new hkt(r)),r.set(pv,new pv(r)),r.set(Hs,new Hs(r)),r.set(fm,new fm),r.set(WX,new WX(r)),r.set(y8,new y8(r,new Xwt)),r.set(cie,new cie(r)),r.set(aie,new aie(r)),r.set(fc,new fc(r)),r.set(SO,new GRt(r)),r.set(xN,new xN(r)),r.set(sk,new sk(r.get(xN),r)),r.set(HO,new HO(r)),r.set(bI,new PRt(r)),r.set(ZC,new ZC(r.get(sk),r.get(bI),r)),r.set(mE,new mE(r));let _=new uc(r);r.set(uc,_);let v=new g8(r,_);return r.set(g8,v),r.set(Uie,new Uie(r,_)),r.get(ar).onActivation(()=>{v.ensureInitialSync()}),r}a(Ekt,"createLanguageServerContext");var KN=new fe("ACP");async function aao(t){let e=t.get(ds);KN.info(t,`Starting Copilot ACP Agent v${e.getDisplayVersion()}`),t.get(rb).markReady(),t.get(zp).githubAppId=Kae,Jnl(t),Knl(t),t.get(bn).setCapabilities({subAgent:!0,cveRemediatorAgent:!1}),await t.get(Qt).primeToken()?KN.info(t,"Token primed successfully"):KN.warn(t,"Token priming failed - set GH_COPILOT_TOKEN or GITHUB_COPILOT_TOKEN environment variable"),t.get(pf).initialize(!0),T0n()?await Ynl(t):(At(t,"acp.server.start",{acpPipeline:"internal"}),await cao(t))}a(aao,"startACPServer");async function cao(t){KN.info(t,"Starting ACP server with internal pipeline");let e=aCe.Writable.toWeb(process.stdout),r=aCe.Readable.toWeb(process.stdin),n=GRe(e,r),o=new $Re(s=>new gIt(s,t),n);o.signal.addEventListener("abort",()=>{KN.info(t,"ACP connection closed"),process.exit(0)}),await o.closed}a(cao,"startACPServerInternal");async function Ynl(t){KN.info(t,"Starting ACP server with CLI proxy"),At(t,"acp.cli.discover");let e;try{e=await I0n()}catch(u){let d=u instanceof Error?u.message:String(u);KN.warn(t,`CLI discovery failed, falling back to internal pipeline: ${d}`),Vn(t,"acp.server.start",u,{acpPipeline:"internal-fallback"}),await cao(t);return}let r=e.args.length>0?`${e.path} ${e.args.join(" ")}`:e.path;KN.info(t,`Found Copilot CLI: ${r} v${e.version}`),At(t,"acp.server.start",{acpPipeline:"cli",cliVersion:e.version,cliSource:e.source});let n=new AIt(e,t),o=aCe.Writable.toWeb(process.stdout),s=aCe.Readable.toWeb(process.stdin),c=GRe(o,s),l=new $Re(u=>new EIt(u,t,n),c);l.signal.addEventListener("abort",()=>{KN.info(t,"ACP connection closed, disposing CLI process"),n.dispose().then(()=>{process.exit(0)})}),await l.closed}a(Ynl,"startACPServerWithCLI");function Knl(t){let e=t.get(gs);e.registerTool(new Xq({name:"create_file",description:"Create a new file in the workspace with the specified content.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to create."}),content:S.String({description:"The content to write to the new file."})})})),e.registerTool(new Xq({name:"insert_edit_into_file",description:"Edit an existing file by inserting, replacing, or deleting content.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),content:S.Optional(S.String({description:"The new content for the file."})),edits:S.Optional(S.Array(S.Object({startLine:S.Number({description:"The starting line number (1-based)."}),endLine:S.Number({description:"The ending line number (1-based)."}),newContent:S.String({description:"The new content to replace the range with."})})))})})),e.registerTool(new Xq({name:"replace_string_in_file",description:"Replace a specific string in a file with a new string.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),oldString:S.String({description:"The string to find and replace."}),newString:S.String({description:"The string to replace it with."})})})),KN.info(t,"Registered ACP client tools: create_file, insert_edit_into_file, replace_string_in_file")}a(Knl,"registerACPClientTools");function lao(){let e=Ekt({onRequest:a(()=>{},"onRequest"),onNotification:a(()=>{},"onNotification"),listen:a(()=>{},"listen"),sendNotification:a(()=>{},"sendNotification"),sendRequest:a(()=>Promise.resolve({}),"sendRequest"),workspace:{onDidChangeWorkspaceFolders:a(()=>{},"onDidChangeWorkspaceFolders")},client:{register:a(()=>Promise.resolve({}),"register")},console:{log:a(()=>{},"log"),info:a(()=>{},"info"),warn:a(()=>{},"warn"),error:a(()=>{},"error")},window:{showWarningMessage:a(()=>Promise.resolve(void 0),"showWarningMessage"),showInformationMessage:a(()=>Promise.resolve(void 0),"showInformationMessage")}}),r=new zV(e);return e.forceSet(F_,r),{ctx:e,acpToolInvoker:r}}a(lao,"createACPContext");function Jnl(t,e=process.env){let r=e.GITHUB_ENTERPRISE_URL;r&&(KN.info(t,"Configuring GitHub Enterprise URL from GITHUB_ENTERPRISE_URL"),l7e(t,r))}a(Jnl,"configureGitHubEnterpriseUrl");p();var Q7r=require("events"),T6e=de(require("fs"));p$e();var vkt=de(Xc());p();var dao=de(require("fs")),fao=de(require("http")),cCe=de(require("path"));var _kt=class{constructor(e,r){this.port=e;let n;this.server=fao.createServer((o,s)=>{if(o.headers.accept&&o.headers.accept=="text/event-stream")switch(s.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),o.url){case"/stdin":r.on("read",l=>{uao(s,JSON.stringify(l))});return;case"/stdout":r.on("write",l=>{uao(s,JSON.stringify(l))});return;default:s.writeHead(404),s.end();return}s.writeHead(200,{"Content-Type":"text/html"});let c=__dirname;cCe.basename(__dirname)!=="debug"&&(c=cCe.dirname(__dirname)),n??=dao.readFileSync(cCe.join(c,"dist","debugServer.html")).toString(),s.write(n),s.end()}),this.server.on("error",o=>{console.error(o)})}static{a(this,"DebugServer")}listen(){return this.server.listen(this.port),this}getPort(){return this.server.address().port}};function uao(t,e){t.write("data: "+e.toString().replace(/\n/g,` +\`\`\``}},lkt="runtime-logs",ckt=class extends _g{static{a(this,"RuntimeLogsSkill")}constructor(e){super(lkt,"The application runtime or debug logs, which are used to view output logs from the console. This is useful for debugging and troubleshooting runtime issues.","Reading runtime logs",()=>e,r=>new qQr(r))}};p();var ukt=fe(QP());var dkt=class extends Zh{constructor(r){super();this.ctx=r}static{a(this,"AgentConversationInspector")}shouldInspect(){return fUe(this.ctx)}get connection(){if(this.shouldInspect())return this.ctx.get(Xt).connection}async inspectPrompt(r){return this.connection?.sendNotification(new ukt.NotificationType("conversation/inspectPrompt"),r)}async inspectFetchResult(r){return this.connection?.sendNotification(new ukt.NotificationType("conversation/inspectFetchResult"),r)}async documentDiff(r){return this.connection?.sendNotification(new ukt.NotificationType("conversation/documentDiff"),r)}};p();var Pco=fe(Fc());var F6e=class{constructor(e){this.ctx=e;this.notificationEndpoint="conversation/preconditionsNotification";e.get(Ak).onChange(r=>{this.sendNotification(r)})}static{a(this,"PreconditionsNotifier")}sendNotification(e){return this.ctx.get(Xt).connection.sendNotification(new Pco.NotificationType(this.notificationEndpoint),e)}};function Dco(t){Dsl(t),Nsl(t),xco(t)}a(Dco,"activateConversationFeature");function Dsl(t){t.set(zo,new zo(t)),t.set(vg,new vg),t.set(NA,new NA(t)),t.set(tl,new PYe(t)),t.set(K9,new K9),t.set(wc,new wc(t)),t.set(Ak,new Ak(t)),t.set(F6e,new F6e(t)),t.set(xs,new Z$e(t,new J$e(t))),t.set(BN,new BN),t.set(Zh,new dkt(t)),t.set(l2,new l2(t))}a(Dsl,"registerContextDependencies");function Nsl(t){let e=new Xh;e.registerSkill(new FXe(new BXe)),e.registerSkill(new pJe(new Jv(t,NO,pbn))),e.registerSkill(new tJe(new Jv(t,XP,cbn))),e.registerSkill(new eJe(new Jv(t,hE,abn))),e.registerSkill(new hJe),e.registerSkill(new okt),e.registerSkill(new skt(new Jv(t,akt,Rco))),e.registerSkill(new jJe(new Jv(t,QO,v1n))),e.registerSkill(new jXe(new Jv(t,Xq,sRn))),e.registerSkill(new ckt(new Jv(t,lkt,kco))),e.registerSkill(new nkt(new Jv(t,ikt,wco))),e.registerSkill(new GXe(new Jv(t,u2,aRn))),e.registerSkill(new $Xe(new Jv(t,yJ,cRn))),t.set(Xh,e)}a(Nsl,"registerSkills");p();var Nco=fe(Fc()),Mco=fe(QP());var fkt=class extends Vd{constructor(){super(...arguments);this.requestType=new Nco.ProtocolRequestType("conversation/invokeClientToolConfirmation");this.typeCheck=$u.Compile(gEn)}static{a(this,"AgentClientToolConfirmationInvoker")}async invokeClientToolConfirmation(r,n){let o=this.ctx.get(Xt).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Mco.ResponseError(u.code,u.message,u.data);throw ot.error(this.ctx,`ResponseError while invoking client tool confirmation ${n.name}`,d),new Error(`Failed to invoke client tool confirmation ${n.name}: ${u.message}`)}s=l}catch(c){throw new Error(`Failed to invoke client tool confirmation ${n.name}: ${String(c)}`)}if(s==null)throw new Error(`Failed to invoke client tool confirmation ${n.name}: No result returned`);if(!this.typeCheck.Check(s))throw new HA(this.typeCheck.Errors(s));return s}};p();var Oco=fe(Fc()),Lco=fe(QP());var pkt=class extends j_{constructor(){super(...arguments);this.requestType=new Oco.ProtocolRequestType("conversation/invokeClientTool");this.typeCheck=$u.Compile(mEn)}static{a(this,"AgentClientToolInvoker")}async invokeClientTool(r,n){let o=this.ctx.get(Xt).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Lco.ResponseError(u.code,u.message,u.data);throw ot.error(this.ctx,`ResponseError while invoking client tool ${n.name}`,d),new Error(`Failed to invoke client tool ${n.name}: ${u.message}`)}s=l}catch(c){throw new Error(`Failed to invoke client tool ${n.name}: ${String(c)}`)}if(s==null)throw new Error(`Failed to invoke client tool ${n.name}: No result returned`);if(!this.typeCheck.Check(s))throw new HA(this.typeCheck.Errors(s));return this.transformToToolResult(s)}transformToToolResult(r){let n=r.content.map(o=>typeof o.value=="string"?new Pr(o.value):new PK(o.value));return new Fr(n,r.status??"success")}};p();p();function Bco(t,e,r){try{let n=t.get(Jt).javaContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Nr.debug(t,"Failed to get the active Java experiments for the Context Provider API",n),!1}return!0}a(Bco,"fillInJavaActiveExperiments");var jQr=fe(QP());var Msl={type:new jQr.NotificationType("featureFlagsNotification")},Osl={type:new jQr.NotificationType("copilot/didChangeFeatureFlags")},U6e=class{constructor(e){this.ctx=e;vs(e,r=>this.sendNotification(r))}static{a(this,"FeatureFlagsNotifier")}async sendNotification(e){let r=this.ctx,n=!1,o=!1,s=!1,c=!1,l=!1,u=!1,d=r.get(Jt),f=await d.updateExPValuesAndAssignments(e);n=d.ideDataMigrationCompleted(f),o=d.appmodContextMenuEnabled(f),s=d.appmodProblemsViewEnabled(f),c=d.cliAsDefaultAgentProviderEnabled(f),l=Ofn(r,f),u=d.inlineChatUseCliEnabled(f);let h={};r.get(Jt).excludeRelatedFiles(f)&&(h.ExcludeRelatedFiles=!0);let m=dpr(r,f);m.length>0&&(h.ExpContextProviders=m);let g=new Map;Eei(r,m,g,f),eut(r,g,f),Bco(r,g,f);for(let[E,_]of g.entries())h[E]=_;let A=r.get(kn),y=r.get(Xt).connection;if(A.getCapabilities().didChangeFeatureFlags)await y.sendNotification(Osl.type,{envelope:{...e.envelope,token:void 0,expires_at:void 0,refresh_in:void 0,limited_user_quotas:void 0,limited_user_reset_date:void 0,error_details:void 0,organization_list:void 0,enterprise_list:void 0,endpoints:void 0},token:e.getTokenValues(),activeExps:h,byok:fq(e),data_migration_completed:n,appmod_context_menu_enabled:o,appmod_problems_view_enabled:s,cli_as_default_agent_provider_enabled:c,ide_enable_copilot_nes_nonfree_enabled:l,inline_chat_use_cli_enabled:u,user_info__cli_enabled:e.userInfo.cliEnabled,copilot_plan:e.userInfo.copilotPlan,abexp_features:f.filtersAndExp.exp.features,abexp_assignment_context:f.filtersAndExp.exp.assignmentContext});else{let E={rt:e.getTokenValue("rt")==="1",sn:e.getTokenValue("sn")==="1",chat:e.envelope.chat_enabled??!1,ic:e.envelope.chat_enabled??!1,pc:!0,ae:h,byok:fq(e),data_migration_completed:n,appmod_context_menu_enabled:o,appmod_problems_view_enabled:s,cli_as_default_agent_provider_enabled:c,ide_enable_copilot_nes_nonfree_enabled:l,inline_chat_use_cli_enabled:u};e.getTokenValue("agent_mode")==="0"&&(E.agent_mode=!1),e.getTokenValue("agent_mode_auto_approval")==="0"&&(E.agent_mode_auto_approval=!1),e.getTokenValue("mcp")==="0"&&(E.mcp=!1),e.envelope.chat_enabled&&(E.xc=!0),e.userInfo.cliEnabled!==void 0&&(E.user_info__cli_enabled=e.userInfo.cliEnabled),await y.sendNotification(Msl.type,E)}}};p();var hkt=class extends Ss{constructor(r){super();this.ctx=r;this.notificationEndpoint="statusNotification"}static{a(this,"NotificationStatusReporter")}didChangeV1(r){let n=r.kind;r.busy&&n!=="Error"&&(n="InProgress"),this.ctx.get(Xt).connection.sendNotification($qt.type,{busy:r.busy,kind:r.kind,status:n,message:r.message??""}),this.ctx.get(Xt).connection.sendNotification("didChangeStatus",{busy:r.busy,kind:r.kind,message:r.message,command:r.command})}didChangeV2(r){this.ctx.get(Xt).connection.sendNotification(Vqt.type,r)}};p();var Fco=new pe("AgentEncodingConfigurationService"),mkt=class extends kO{static{a(this,"AgentEncodingConfigurationService")}constructor(e){super(e),this.service=e.get(Xt)}async requestEncodingFromClient(e){if(!this.service.clientCapabilities?.workspace?.configuration){Fco.debug(this.ctx,"Client does not support workspace/configuration, using UTF-8 fallback");return}try{let o=(await this.service.connection.workspace.getConfiguration([{scopeUri:e,section:"copilot.file.encoding"}]))[0];return o&&["utf8","utf-8","utf16le","ucs2","ucs-2","base64","base64url","latin1","binary","hex","ascii"].includes(o)?o:void 0}catch(n){Fco.debug(this.ctx,`Unable to request encoding for ${e}, using UTF-8 fallback`,n);return}}};p();var Uco=new OQ;p();var jco=fe(ei());var Hco={"mcp.contributionPoint.enabled":{description:"Whether extension-contributed MCP servers are enabled",defaultValue:!0,type:"boolean"},"customAgent.enabled":{description:"Whether custom agent functionality is enabled",defaultValue:!0,type:"boolean"},"customHook.enabled":{description:"Whether custom hook functionality is enabled",defaultValue:!0,type:"boolean"},"customSkill.enabled":{description:"Whether custom skill functionality is enabled",defaultValue:!0,type:"boolean"},"subagent.enabled":{description:"Whether subagent functionality is enabled",defaultValue:!0,type:"boolean"},"autoModel.enabled":{description:"Whether auto model functionality is enabled",defaultValue:!0,type:"boolean"},"cveRemediatorAgent.enabled":{description:"Whether CVE remediator agent functionality is enabled",defaultValue:!0,type:"boolean"},"agentMode.autoApproval.enabled":{description:"Whether agent mode auto-approval is enabled",defaultValue:!0,type:"boolean"}},Lsl=new jco.NotificationType("policy/didChange"),Bsl=Object.fromEntries(Object.entries(Hco).map(([t,e])=>[t,{type:e.type}])),Q6e=class extends Hl{constructor(r,n){super();this.ctx=r;this.connection=n;this.disposed=!1;this.policyValues=new Map(Object.entries(Hco).map(([r,n])=>[r,n.defaultValue]));let o=r.get(Xt);o.onActivation(()=>{this.startWatching().catch(s=>{Nr.error(this.ctx,"Unexpected error starting policy watcher:",s)})}),o.onDeactivation(()=>{this.dispose()})}static{a(this,"GroupPolicyWatcher")}async startWatching(){try{let{createWatcher:r}=await Promise.resolve().then(()=>fe(qco()));this.policyWatcher=r("IDEGitHubCopilot",Bsl,n=>{this.handlePolicyUpdate(n).catch(o=>{Nr.error(this.ctx,"Error in handlePolicyUpdate:",o)})}),Nr.info(this.ctx,"Policy watcher started for GitHub Copilot Plugin")}catch(r){process.platform==="darwin"||process.platform==="win32"?Nr.exception(this.ctx,r,"Policy watcher failed to load on supported platform"):Nr.warn(this.ctx,"Policy watcher not available - continuing without policy watching:",r instanceof Error?r.message:String(r))}}async handlePolicyUpdate(r){Nr.debug(this.ctx,"GroupPolicyWatcher - policy update triggered",r);let n=!1;for(let[o,s]of Object.entries(r))if(s!==void 0){let c=o;this.policyValues.get(c)!==s&&(n=!0),this.policyValues.set(c,s),Nr.debug(this.ctx,`Policy change: ${o} = ${s}`)}n&&this.policyChangeEmitter.fire(void 0),this.policyValues.get("subagent.enabled")===!1&&this.ctx.get(kn).setCapabilities({subAgent:!1}),this.policyValues.get("cveRemediatorAgent.enabled")===!1&&this.ctx.get(kn).setCapabilities({cveRemediatorAgent:!1}),await this.sendPolicyChangeNotification()}getAllPolicyValues(){let r={};for(let[n,o]of this.policyValues.entries())r[n]=o;return r}getPolicyValue(r){return this.policyValues.get(r)}sendPolicyChangeNotification(){if(this.disposed)return Promise.resolve();let r=this.getAllPolicyValues();try{return this.connection.sendNotification(Lsl,r)}catch{return Promise.resolve()}}dispose(){if(!this.disposed){if(this.disposed=!0,this.policyWatcher){try{this.policyWatcher.dispose()}catch(r){Nr.error(this.ctx,"Error disposing policy watcher:",r)}this.policyWatcher=void 0}Nr.debug(this.ctx,"Policy watcher stopped")}}};p();var $co=fe(Fc());var Gco=new pe("managedSettings.notifier"),Fsl=new $co.ProtocolNotificationType("copilot/didChangeManagedSettings"),q6e=class{constructor(e){this.ctx=e;this.disposed=!1;let r=e.get(Xt);this.lifecycleSubscriptions=[r.onActivation(()=>{e.get(kn).getCapabilities().didChangeManagedSettings&&this.activate().catch(n=>Gco.exception(e,n,".activate"))}),r.onDeactivation(()=>this.dispose())]}static{a(this,"ManagedSettingsNotifier")}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.lifecycleSubscriptions)e.dispose();this.settingsSubscription?.dispose()}}async activate(){let e=this.ctx.get(H9);await e.refresh(),!this.disposed&&!this.settingsSubscription&&(this.settingsSubscription=e.observe(r=>this.notify(r)))}notify(e){this.ctx.get(Xt).connection.sendNotification(Fsl,e).catch(r=>Gco.debug(this.ctx,"Failed to send managed settings notification:",r))}};p();var gkt=class{constructor(e){this.ctx=e}static{a(this,"McpServerManagerAdapter")}serversChanged(e){this.ctx.get(Xt).connection.sendNotification(rzi,{scope:e}).catch(()=>{})}serverDetailsChanged(e){this.ctx.get(Xt).connection.sendNotification(nzi,{source:e.source,name:e.name}).catch(()=>{})}unregisterProvider(e){return this.ctx.get(nM).unregisterProvider(e)}};p();var Akt=class extends Rb{static{a(this,"CLSMcpAuthServer")}constructor(e){super(),this.ctx=e}getAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);return this.ctx.get(pA).get(n)}updateAccountPreference(e,r,n){let o=this._getAccountPreferenceKey(e,r);this.ctx.get(pA).set(o,n.label)}removeAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);this.ctx.get(pA).delete(n)}_getAccountPreferenceKey(e,r){return`mcp-${e}-${r}`}};p();p();p();p();var Vco=fe(ei());var ykt="mcp.elicitation",Ekt=class{constructor(){this.ongoingMcpElicitationCalls=!1;this.elicitationRequestType=new Vco.ProtocolRequestType("copilot/mcpElicitation")}static{a(this,"ElicitationHandler")}async handleRequest(e,r,n,o,s){if(this.ongoingMcpElicitationCalls)throw new Un(Zn.InternalError,"Another MCP elicitation request is already in progress.");this.ongoingMcpElicitationCalls=!0;try{let c=n.params.message;if("url"in n.params)throw new Un(Zn.InvalidRequest,"URL mode elicitation is not supported");let l=n.params.requestedSchema;sr.info(e.ctx,`MCP server ${r} elicitation request received: ${c}`),await ia(e.ctx,{message:`MCP server ${r} elicitation request received: ${c}`,server:r});let d=await e.ctx.get(MO).sendRequest(this.elicitationRequestType,{mcpServer:r,message:c,requestedSchema:l,conversationId:e.conversation.id.toString(),roundId:o??e.agentToolCalls.getRound(0).roundId,turnId:e.turn.id.toString(),toolCallId:s??e.agentToolCalls.getRound(0).toolCalls[0].id});return ft(e.ctx,ykt,Vt.createAndMarkAsIssued()),cr(e.ctx,ykt),d}catch(c){let l=`Failed to process elicitation request: ${c instanceof Error?c.message:String(c)}`;throw sr.error(e.ctx,l,c),await yd(e.ctx,{message:l,server:r}),xa(e.ctx,c,ykt),Cs(e.ctx,ykt,c),new Un(Zn.InternalError,l)}finally{this.ongoingMcpElicitationCalls=!1}}};p();p();p();var Ok=class{static{a(this,"MCPNotificationHandler")}constructor(e,r){this.ctx=e,this.serverName=r}};var j6e=class extends Ok{static{a(this,"LoggingMessageNotificationHandler")}constructor(e,r){super(e,r)}handle(e){let r=typeof e.params.data=="string"?e.params.data:JSON.stringify(e.params.data);switch(e.params.logger&&(r=`${e.params.logger}: ${r}`),e.params?.level){case"debug":case"info":case"notice":sr.info(this.ctx,`MCP server ${this.serverName} log:`,r),ia(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"warning":sr.warn(this.ctx,`MCP server ${this.serverName} log:`,r),W2(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"error":case"critical":case"alert":case"emergency":sr.error(this.ctx,`MCP server ${this.serverName} log:`,r),yd(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;default:sr.info(this.ctx,`MCP server ${this.serverName} log:`,r),ia(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break}}};p();var H6e=class extends Ok{static{a(this,"PromptListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Prompts list changed, refreshing prompts..."),ia(this.ctx,{message:"Prompts list changed, refreshing prompts...",server:this.serverName}),this.emitter.emit(MTt)}};p();var G6e=class extends Ok{static{a(this,"ResourceListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Resource list changed, refreshing resources..."),ia(this.ctx,{message:"Resource list changed, refreshing resources...",server:this.serverName}),this.emitter.emit(NTt)}};p();var $6e=class extends Ok{static{a(this,"ResourceUpdatedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,`Resource updated for URI: ${e.params.uri}`),ia(this.ctx,{message:`Resource updated: ${e.params.uri}`,server:this.serverName}),this.emitter.emit(VVi)}};p();var _kt=class{static{a(this,"MCPRequestHandler")}constructor(e,r){this.ctx=e,this.serverName=r}},V6e=class extends _kt{static{a(this,"ListRootsRequestHandler")}constructor(e,r){super(e,r)}handle(e){sr.info(this.ctx,`MCP server ${this.serverName} requested roots list`);let r=[];try{(this.ctx.get($r).getWorkspaceFolders()||[]).forEach(o=>{r.push(o)}),ia(this.ctx,{message:`Requested roots list and found ${r.length} root(s).`,server:this.serverName})}catch(n){sr.error(this.ctx,`Error getting workspace folders for MCP server ${this.serverName}:`,n),yd(this.ctx,{message:`Error getting workspace folders for MCP server ${this.serverName}: ${n instanceof Error?n.message:String(n)}`,server:this.serverName})}return{roots:r}}};p();var W6e=class extends Ok{static{a(this,"ToolListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){sr.info(this.ctx,"Tool list changed, refreshing tools..."),ia(this.ctx,{message:"Tool list changed, refreshing tools...",server:this.serverName}),this.emitter.emit(DTt)}};p();var Wco="mcp.sampling",vkt=class{constructor(){this.defaultTemperature=.7;this.ongoingMcpSamplingCalls=!1}static{a(this,"McpSamplingService")}async handleSamplingRequest(e,r,n,o,s,c){try{if(this.ongoingMcpSamplingCalls)throw new Un(Zn.InternalError,"Another MCP sampling request is already in progress.");this.ongoingMcpSamplingCalls=!0,sr.info(e.ctx,`MCP server ${o} requested sampling:`,n.params),await ia(e.ctx,{message:`Sampling request received from ${o}: ${JSON.stringify({messageCount:n.params.messages.length,systemPrompt:n.params.systemPrompt?"provided":"none",maxTokens:n.params.maxTokens,temperature:n.params.temperature})}`,server:o});let l=await e.ctx.get(DW).readMcpSamplingConfig({serverName:o});if(l.alwaysDeny)throw new Error("User has chosen to always deny MCP tools with this mcp server.");if(!l.alwaysAllow){let y=n.params.messages.filter(v=>v.role==="user"),E=y[y.length-1];if((await e.ctx.get(Vd).invokeClientToolConfirmation(e,{name:o,title:`Allow MCP tools from "${o}" to make LLM requests?`,message:`The MCP server "${o}" has issued a request to make a language model call. Do you want to allow it to make requests during chat?`,input:{...E,toolType:"mcp_tool",mcpType:"sampling",mcpServerName:o},conversationId:e.conversation.id,roundId:s??e.agentToolCalls.getRound(0).roundId,turnId:e.turn.id,toolCallId:c??e.agentToolCalls.getRound(0).toolCalls[0].id})).result==="dismiss")throw new Uc}let u=await this.getModelConfiguration(e.ctx,n,l),d=this.convertMCPMessagesToChatML(e.ctx,n.params.messages,n.params.systemPrompt),f=(await xxe(e.ctx,e.turn.telemetryId,e.conversation.telemetryId)).extendedBy({messageSource:"mcp.sampling"}),m=new Fn.CancellationTokenSource().token,g=await r.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:e.toLlmInteraction(),temperature:n.params.temperature??this.defaultTemperature,stop:n.params.stopSequences,turnId:String(e.turn.id)},m,f),A=this.processFetchResult(g,u.uiName);return jl(e.ctx,Wco,{userPreference:l.alwaysAllow?"autoApprove":l.alwaysDeny?"autoDeny":"none",selectedModel:u.uiName,success:"true"}),A}catch(l){let u=`Failed to process sampling request: ${l instanceof Error?l.message:String(l)}`;throw sr.error(e.ctx,u,l),await yd(e.ctx,{message:u,server:o}),jl(e.ctx,Wco,{success:"false",errorMessage:u}),new Un(Zn.InternalError,u)}finally{this.ongoingMcpSamplingCalls=!1}}convertMCPMessagesToChatML(e,r,n){let o=[];n&&o.push({role:"system",content:n});for(let s of r){let c,l=Array.isArray(s.content)?s.content[0]:s.content;if(!l){sr.warn(e,"Empty content in MCP message, skipping");continue}if(l.type==="text")c=l.text;else if(l.type==="image")c=[{type:"image_url",image_url:{url:atob(l.data)}}];else throw sr.warn(e,`Unknown MCP content type: ${l.type}, defaulting to empty array`),new Error(`Unknown MCP content type: ${l.type}`);let u;switch(s.role){case"user":u="user";break;case"assistant":u="assistant";break;default:u="user",sr.warn(e,`Unknown MCP role: ${s.role}, defaulting to user`)}o.push({role:u,content:c})}return o}processFetchResult(e,r){if(e.type!=="success"){let n=`Unexpected fetch result type: ${e.type}.`;throw"reason"in e&&(n+=` Reason: ${e.reason}`),new Error(n)}return{model:r,role:"assistant",content:{type:"text",text:e.value}}}async getModelConfiguration(e,r,n){let o=await this.getAvailableBYOKModels(e),s=[...await this.getAvailableModels(e),...o.map(d=>d.name)];if(!s)throw new Error("No available models found");let c=n.allowedModels&&n.allowedModels.length>0?s.filter(d=>n.allowedModels.some(f=>f.toLowerCase()===d.toLowerCase())):s;if(!c||c.length===0)throw new Error("No available models found");let l;r.params.modelPreferences?.hints&&(l=this.mapFindFirst(r.params.modelPreferences.hints,d=>c.find(f=>f.toLowerCase().includes(d.name.toLowerCase())))),l=l??c[0];let u=o.find(d=>d.name===l);return u?_O(e,u.provider,l):await e.get(tl).getBestChatModelConfig([l])}async getAvailableModels(e){return(await e.get(xs).getMetadata()).filter(n=>n.capabilities.type&&!hle.has(n.capabilities.family)&&n.capabilities.supports?.tool_calls&&(n.capabilities.limits?.max_prompt_tokens??!1)).map(n=>n.capabilities.family)}async getAvailableBYOKModels(e){return(await new $a(e.get(ti)).getAllModels(e)).filter(n=>n.capabilities?.toolCalling)}mapFindFirst(e,r){for(let n of e){let o=r(n);if(o!==void 0)return o}}};p();var ICe=class extends Error{constructor(r,n){super(r);this.challengeInfo=n;this.name="ScopeChallengeError"}static{a(this,"ScopeChallengeError")}};function zco(t,e){if(t!==403||!e)return null;let{scheme:r,params:n}=wlt(e);if(r!=="Bearer"||n.error!=="insufficient_scope")return null;let o=n.scope;if(!o)return null;let s=o.split(" ").filter(c=>c.length>0);return{error:n.error,requiredScopes:s,resourceMetadata:n.resource_metadata,errorDescription:n.error_description}}a(zco,"parseScopeChallenge");p();var GQr=/[^a-z0-9_-]/gi;var Usl=process.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function Yco(){let t={};for(let e of Usl){let r=process.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(Yco,"getDefaultEnvironment");async function Kco(t,e,r){if(!e.description){let n=`Tool ${e.name} does not have a description. Tools must be accurately described to be called.`;sr.warn(t,n),await W2(t,{message:n,server:r,tool:e.name}),e.description=""}if(GQr.lastIndex=0,GQr.test(e.name)){let n=`Tool ${e.name} is invalid. Tools names may only contain [a-zA-Z0-9_-]`;sr.warn(t,n),await W2(t,{message:n,server:r,tool:e.name}),e._nameForModel=e.name.replace(GQr,"_")}else e._nameForModel=e.name;return e}a(Kco,"normalizeTool");var Ckt=class{constructor(){this.seenPrefixes=new Set}static{a(this,"McpPrefixGenerator")}generate(e){let r="mcp_"+e.toLowerCase().replace(/[^a-z0-9_.-]+/g,"_").slice(0,13),n=r;for(let o=2;this.seenPrefixes.has(n);o++)n=r+o;return this.seenPrefixes.add(n),n}};p();async function*$Qr(t,e,r){let n;do{let o=await t(n),s=e(o);s.length>0&&(yield s),n=r(o)}while(n!==void 0)}a($Qr,"paginateRequest");async function VQr(t){let e=[];for await(let r of t)e.push(...r);return e}a(VQr,"flattenAsyncIterable");var Jco=fe(require("events"));var WQr=6e4,NW=class{constructor(e,r,n){this.transport=null;this.emitter=new Jco.default;this.ongoingMcpToolCalls=[];this.isSamplingEnabled=!1;this.isElicitationEnabled=!1;this.cachedTools=[];this.cachedResources=[];this.cachedResourceTemplates=[];this.cachedPrompts=[];this.ctx=e;let o=e.get(kn);this.isSamplingEnabled=o.getCapabilities().mcpSampling,this.isSamplingEnabled&&(this.samplingService=new vkt),this.isElicitationEnabled=o.getCapabilities().mcpElicitation,this.isElicitationEnabled&&(this.elicitationHandler=new Ekt);let s=this.ctx.get(Ir).getEditorInfo(),c=this.ctx.get(Ir).getEditorPluginInfo();this.mcp=new OH({name:`${s.name}/${c.name}`,version:`${s.version}/${c.version}`},{capabilities:{roots:{listChanged:!0},...this.isSamplingEnabled?{sampling:{}}:{},...this.isElicitationEnabled?{elicitation:{}}:{}}}),this.name=r}static{a(this,"MCPBaseServer")}get isConnected(){return this.transport!==null}async connect(e){if(this.transport=this.initTransport(e),!this.transport){let r=new Error("Failed to initialize transport");throw sr.error(this.ctx,"Transport initialization failed:",r),r}this.addListeners();try{await this.mcp.connect(this.transport),this.initializeCache()}catch(r){throw sr.error(this.ctx,"Connection failed:",r),await yd(this.ctx,{message:`Failed to connect to MCP server: ${r instanceof Error?r.message:String(r)}`,server:this.name}),this.transport=null,r}}async initializeCache(){await Promise.all([this.refreshToolsCache(!0),this.refreshResourcesCache(!0),this.refreshPromptsCache(!0)]),this.emitter.emit(YV)}getCachedTools(){return this.cachedTools}getCachedResources(){return this.cachedResources}getCachedResourceTemplates(){return this.cachedResourceTemplates}getCachedPrompts(){return this.cachedPrompts}restoreCacheFromPersistence(e){this.cachedTools=[...e.tools],this.cachedResources=[...e.resources],this.cachedResourceTemplates=[...e.resourceTemplates],this.cachedPrompts=[...e.prompts]}async createMcpTool(e,r){let n={name:e.name,description:e.description,inputSchema:{...e.inputSchema||{},properties:e.inputSchema?.properties||{},type:e.inputSchema?.type||"object"},_status:r??"enabled",_nameForModel:e.name,annotations:e.annotations};return await Kco(this.ctx,n,this.name),n}async handleMCPOperationError(e,r,n){try{return await e()}catch(o){let s=o;if(s instanceof ICe){let l=`OAuth scope challenge during ${r} from server ${this.name}. Required scopes: ${s.challengeInfo.requiredScopes.join(", ")}`;if(n.scopeChallengeHandler)return n.scopeChallengeHandler(s.challengeInfo.requiredScopes);if(sr.info(this.ctx,l),await yd(this.ctx,{message:l,server:this.name}),n.errorHandler)return n.errorHandler(l);if("defaultValue"in n)return n.defaultValue;throw s}if(s.code===Zn.MethodNotFound){if(sr.info(this.ctx,`${r} not supported by server ${this.name}:`,s.message),"methodNotFoundValue"in n)return n.methodNotFoundValue;if(n.errorHandler)return n.errorHandler("Method not found");if("defaultValue"in n)return n.defaultValue;throw new Error("No default value or error handler provided")}let c=`Failed to ${r} from server ${this.name}: ${s.message||String(s)}`;if(sr.error(this.ctx,c),await yd(this.ctx,{message:c,server:this.name}),n.errorHandler)return n.errorHandler(c);if("defaultValue"in n)return n.defaultValue;throw new Error("No default value or error handler provided")}}async*getResourcesIterable(e){if(!this.transport)return;let r=$Qr(n=>this.mcp.listResources({cursor:n},{signal:e}),n=>n.resources,n=>n.nextCursor);for await(let n of r)yield n}async getResources(e){return await this.handleMCPOperationError(async()=>{let r=await VQr(this.getResourcesIterable(e));return ia(this.ctx,{message:`Discovered ${r.length} resources`,server:this.name}),r},"get resources",{defaultValue:[]})}async*getResourceTemplatesIterable(e){if(!this.transport)return;let r=$Qr(n=>this.mcp.listResourceTemplates({cursor:n},{signal:e}),n=>n.resourceTemplates,n=>n.nextCursor);for await(let n of r)yield n}async getResourceTemplates(e){return await this.handleMCPOperationError(async()=>{let r=await VQr(this.getResourceTemplatesIterable(e));return ia(this.ctx,{message:`Discovered ${r.length} resource templates`,server:this.name}),r},"get resource templates",{defaultValue:[]})}async readResource(e){return this.transport?await this.handleMCPOperationError(async()=>await this.mcp.readResource({uri:e}),`read resource ${e}`,{defaultValue:null,methodNotFoundValue:{contents:[]}}):null}async subscribeResource(e){this.transport&&await this.handleMCPOperationError(async()=>{await this.mcp.subscribeResource({uri:e})},`subscribe resource ${e}`,{defaultValue:void 0})}async unsubscribeResource(e){this.transport&&await this.handleMCPOperationError(async()=>{await this.mcp.unsubscribeResource({uri:e})},`unsubscribe resource ${e}`,{defaultValue:void 0})}async callTool(e,r,n,o,s,c){let l=UJ();this.ongoingMcpToolCalls.push({requestId:l,toolName:e,turnContext:o,roundId:s,toolCallId:c});let u=a(d=>{let f=new Fr([],"error");return f.content.push(new Pr(d)),f},"createErrorResult");try{return await this.handleMCPOperationError(async()=>{let d=new AbortController;n.onCancellationRequested(()=>{d.abort()});let f=await this.mcp.callTool({name:e,arguments:r,_meta:{progressToken:l}},TH,{onprogress:a(m=>{sr.info(this.ctx,`${e} calling progress`,m),ia(this.ctx,{message:`${e} calling progress:`+JSON.stringify(m),server:this.name})},"onprogress"),resetTimeoutOnProgress:!0,signal:d.signal});if(f&&typeof f=="object"){if(f.content||f.structuredContent)return this.formatToolResult(f);let m=`Error calling tool ${e}: `+JSON.stringify(f);return sr.error(this.ctx,m),await yd(this.ctx,{message:m,server:this.name,tool:e}),u(m)}let h=`Error calling tool ${e}: `+JSON.stringify(f);return sr.error(this.ctx,h),await yd(this.ctx,{message:h,server:this.name,tool:e}),u(h)},`call tool ${e}`,{errorHandler:u})}finally{this.ongoingMcpToolCalls=this.ongoingMcpToolCalls.filter(d=>d.requestId!==l)}}async getPrompt(e,r){return(await this.mcp.getPrompt({name:e,arguments:r})).messages}async completePrompt(e,r,n,o){return(await this.mcp.complete({ref:{type:"ref/prompt",name:e},argument:{name:r,value:n},context:{arguments:o}})).completion.values}addListeners(){this.mcp.onclose=()=>{sr.info(this.ctx,`MCP server ${this.name} connection closed.`),ia(this.ctx,{message:"Connection state: Stopped",server:this.name})},this.mcp.onerror=e=>{sr.error(this.ctx,`MCP server ${this.name} error:`,e),yd(this.ctx,{message:`Connection state: Error: ${e.message}`,server:this.name})},this.mcp.setNotificationHandler(wX,e=>new j6e(this.ctx,this.name).handle(e)),this.mcp.setNotificationHandler(m8,e=>new W6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(h8,e=>new H6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(p8,e=>new G6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(zlr,e=>new $6e(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setRequestHandler(sur,e=>(this.initRootsTracker(),new V6e(this.ctx,this.name).handle(e))),this.isSamplingEnabled&&this.mcp.setRequestHandler(fDe,async(e,r)=>{if(!this.samplingService){let o="Sampling is not enabled.";throw sr.error(this.ctx,o),new Un(Zn.InternalError,o)}if(this.ongoingMcpToolCalls.length===0){let o="No ongoing tool call context found for sampling request.";throw sr.error(this.ctx,o),new Un(Zn.InternalError,o)}let n=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return await this.samplingService.handleSamplingRequest(n.turnContext,new cc(this.ctx),e,this.name,n.roundId,n.toolCallId)}),this.isElicitationEnabled&&this.mcp.setRequestHandler(pDe,async e=>{if(this.ongoingMcpToolCalls.length===0){let n="No ongoing tool call context found for elicitation request.";throw sr.error(this.ctx,n),new Un(Zn.InternalError,n)}let r=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return this.elicitationHandler.handleRequest(r.turnContext,this.name,e,r.roundId,r.toolCallId)}),this.setupDataRefreshListeners()}setupDataRefreshListeners(){this.emitter.on(DTt,()=>{this.refreshToolsCache()}),this.emitter.on(NTt,()=>{this.refreshResourcesCache()}),this.emitter.on(MTt,()=>{this.refreshPromptsCache()})}async refreshToolsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout(WQr),n=await this.mcp.listTools({},{signal:r}),o=new Map(this.cachedTools.map(s=>[s.name,s._status]));this.cachedTools=await Promise.all(n.tools.map(s=>this.createMcpTool(s,o.get(s.name)))),sr.info(this.ctx,`Refreshed ${this.cachedTools.length} tools for server ${this.name}`),e||this.emitter.emit(YV)},"refresh tools",{defaultValue:void 0})}async refreshResourcesCache(e=!1){if(this.transport)try{let r=AbortSignal.timeout(WQr),[n,o]=await Promise.all([this.getResources(r),this.getResourceTemplates(r)]);this.cachedResources=n,this.cachedResourceTemplates=o,sr.info(this.ctx,`Refreshed ${this.cachedResources.length} resources and ${this.cachedResourceTemplates.length} templates for server ${this.name}`),e||this.emitter.emit(YV)}catch(r){sr.error(this.ctx,`Failed to refresh resources cache for ${this.name}:`,r)}}async refreshPromptsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout(WQr),n=await this.mcp.listPrompts({},{signal:r});this.cachedPrompts=n.prompts,sr.info(this.ctx,`Refreshed ${this.cachedPrompts.length} prompts for server ${this.name}`),e||this.emitter.emit(YV)},"refresh prompts",{defaultValue:void 0})}formatToolResult(e){let r=new Fr([],e.isError===!0?"error":"success");for(let n of e.content??[])if(n.type==="text")r.content.push(new Pr(n.text));else if(n.type==="image"||n.type==="audio")r.content.push(new cq({mimeType:n.mimeType,data:n.data}));else if(n.type==="resource"){let o=n.resource;if("text"in o)r.content.push(new Pr(o.text));else if("blob"in o){let s=o.mimeType||"application/octet-stream";r.content.push(new cq({mimeType:s,data:o.blob}))}}return e.structuredContent&&r.content.push(new Pr(JSON.stringify(e.structuredContent))),r}initRootsTracker(){let e=this.ctx.get($r);this.rootsTracker=e.onDidChangeWorkspaceFolders(r=>{this.mcp.sendRootsListChanged().then(()=>{this.rootsTracker?.dispose()})})}getEmitter(){return this.emitter}async cleanup(){this.transport&&(await this.mcp.close(),this.mcp.transport&&this.mcp.transport.onclose?.(),this.rootsTracker?.dispose(),this.transport=null)}};p();function Qsl(t){return a(async(r,n)=>{let o=r instanceof URL?r.toString():r,s;if(n?.headers)if(n.headers instanceof Headers){s={};for(let[f,h]of n.headers.entries())s[f]=h}else if(Array.isArray(n.headers)){s={};for(let[f,h]of n.headers)s[f]=h}else s=n.headers;let c={method:n?.method||"GET",headers:s,body:n?.body,signal:n?.signal||void 0},l=await t.fetch(o,c);if(l.status===403){let f=l.headers.get("WWW-Authenticate"),h=zco(l.status,f);if(h){let m=h.errorDescription||"Insufficient scope for this operation";throw new ICe(m,h)}}let u=l.body(),d=null;if(u)d=new ReadableStream({start(f){let h=a(y=>{f.enqueue(new Uint8Array(y))},"onData"),m=a(()=>{f.close(),A()},"onEnd"),g=a(y=>{f.error(y),A()},"onError"),A=a(()=>{u.off("data",h),u.off("end",m),u.off("error",g)},"cleanup");u.on("data",h),u.on("end",m),u.on("error",g)},cancel(){u&&"destroy"in u&&typeof u.destroy=="function"&&u.destroy()}});else{let f=await l.text();d=new ReadableStream({start(h){h.enqueue(new TextEncoder().encode(f)),h.close()}})}return new globalThis.Response(d,{status:l.status,statusText:l.statusText,headers:new Headers(l.headers)})},"fetchLike")}a(Qsl,"createFetchAdapter");function bkt(t,e){let r=t.get(nr),n=Qsl(r);return{...e,fetch:n}}a(bkt,"createConfigWithFetch");var Skt=class extends NW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPSSEServer")}initTransport(r){let n=bkt(this.ctx,r),{url:o,...s}=n;return new Yhe(new URL(o),s)}};p();var Zco=require("child_process"),Xco=require("util");var Tkt=class extends NW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStdioServer")}initTransport(r){return r.env={...Yco(),...r.env||{}},r.stderr="pipe",new tme(r)}addListeners(){super.addListeners(),this.transport&&this.transport.stderr&&this.transport.stderr.on("data",r=>{W2(this.ctx,{message:`[server stderr] ${r.toString().trimEnd()}`,server:this.name})})}async cleanup(){if(this.transport){if(process.platform==="win32"){let r=null;"pid"in this.transport&&typeof this.transport.pid=="number"&&(r=this.transport.pid),r&&await this.forceKillWindowsProcess(r)}await super.cleanup()}}async forceKillWindowsProcess(r){try{let n=(0,Xco.promisify)(Zco.exec);sr.info(this.ctx,`Force killing Windows process with PID ${r} for MCP server ${this.name}`),ia(this.ctx,{message:`Force killing Windows process with PID ${r}`,server:this.name}),await n(`taskkill /pid ${r} /t /f`,{timeout:1e4}),sr.info(this.ctx,`Successfully force killed process ${r}`)}catch(n){sr.debug(this.ctx,`Failed to kill process ${r} (process may not exist):`,n),yd(this.ctx,{message:`Failed to kill process ${r} (process may not exist): ${n instanceof Error?n.message:String(n)}`,server:this.name})}}};p();var z6e=class extends NW{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStreamableServer")}initTransport(r){let n=bkt(this.ctx,r),{url:o,...s}=n;return new Khe(new URL(o),s)}};p();var Ikt=class extends aq{static{a(this,"McpLanguageModelTool")}constructor(e,r){super({...e,toolProvider:{id:e.serverName,displayNamePrefix:e.serverNamePrefix,displayName:e.serverName,description:e.serverName,isFirstPartyTool:!1},type:"mcp"}),this.invoker=r}prepareInvocation(e,r){let n={title:`Confirm MCP Tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`,message:`Do you want to allow the external MCP tool "${this.toolProvider.displayName}/${this.displayName}" to run?`};return{progressMessage:`Running MCP tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`,confirmationMessages:n}}prepareCompletion(e,r){return{completionMessage:`Ran MCP tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`}}async invoke(e,r,n){return await this.invoker(e,r,r.input,n)}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Uc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations};try{return await e.ctx.get(Vd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};var nlo=fe(Fc());p();var elo="mcp-servers-cache",tlo="mcp-first-boot-completed",xkt=class{static{a(this,"McpServerMetadataCache")}constructor(e){this.stateDb=e.get(pA),this.initPromise=this.initialize()}async initialize(){await this.stateDb.waitForInitialization()}async isFirstBoot(){return await this.initPromise,this.stateDb.get(tlo)!=="true"}async markFirstBootCompleted(){await this.initPromise,this.stateDb.set(tlo,"true")}parseCache(){let e=this.stateDb.get(elo);if(!e)return{};try{return JSON.parse(e)}catch{return{}}}async get(e){return await this.initPromise,this.parseCache()[e]}async store(e){await this.initPromise,this.stateDb.set(elo,e)}};p();function rlo(t){let e=t.get(Ir).getEditorPluginInfo();if(e.name==="copilot-intellij"){let r=e.version.endsWith("nightly"),n=e.version==="42.0.0.0";return r||n}if(e.name==="copilot-xcode"){let r=e.version.split(".");if(r.length>=3){let[n,o,s]=r;return n==="0"&&o==="0"&&s==="0"||n==="0"&&s!=="0"}}if(e.name==="copilot-eclipse"){let r=e.version.endsWith("nightly"),n=e.version.endsWith("qualifier");return r||n}return!1}a(rlo,"isNightlyOrDevBuild");var wkt=class t extends u_{constructor(r){super();this.MCPServersMap=new Map;this.updateServersQueue=Promise.resolve();this.serverOperationSequencer=new Xx;this.prefixGenerator=new Ckt;this.serverPrefixes=new Map;this.isMcpEnabled=!1;this.previousMcpAllowlist=!1;this.storedMCPServersConfig={};this.ctx=r,this.cache=new xkt(r),this.registryService=r.get(UN),vs(this.ctx,async n=>{let o=this.isMcpEnabled;this.isMcpEnabled=this.isTokenMcpEnabled(n),o!==this.isMcpEnabled&&(sr.info(this.ctx,`MCP state changed from ${o} to ${this.isMcpEnabled}`),this.registryService.clearAllCaches(),this.isMcpEnabled?await this.updateMCPServers(this.storedMCPServersConfig):(sr.info(this.ctx,"MCP is disabled, clearing all servers and tools"),this.clearAllServers()))}),this.ctx.get(kn).onDidSetCapabilities(n=>{let o=n.mcpAllowlist;o!==this.previousMcpAllowlist&&(this.previousMcpAllowlist=o,this.registryService.clearAllCaches(),this.isMcpEnabled&&(sr.info(this.ctx,`mcpAllowlist changed to ${o}, updating MCP servers`),this.updateMCPServers(this.storedMCPServersConfig)))})}static{a(this,"CLSMCPManager")}static{this.contentsNotificationType=new nlo.ProtocolNotificationType("copilot/mcpTools")}isTokenMcpEnabled(r){if(!r)return!0;try{return r.getTokenValue("mcp")!=="0"}catch(n){return sr.warn(this.ctx,`Error reading MCP value from token: ${n instanceof Error?n.message:String(n)}`),!0}}isAllowlistFeatureEnabled(){if(this.ctx.get(kn).getCapabilities().mcpAllowlist)return sr.debug(this.ctx,"Allowlist feature enabled via copilotCapabilities.mcpAllowlist"),!0;let n=rlo(this.ctx);return n||sr.debug(this.ctx,"Allowlist feature disabled for stable version, only enabled for nightly/prerelease/dev (use copilotCapabilities.mcpAllowlist to override)"),n}ensureMcpEnabledOrThrow(r){if(!this.isMcpEnabled)throw new Error(`MCP is disabled, cannot ${r}`)}getActiveServerEntry(r){let n=this.MCPServersMap.get(r);if(!n)throw new Error(`MCP server ${r} does not exist`);if(n.isBlocked)throw new Error(`MCP server ${r} is blocked by registry`);return n}async ensureServerConnection(r,n,o){return n.server.isConnected?n.server:(sr.info(this.ctx,`Auto-starting MCP server ${r} for ${o}`),await this.startMCPServer(r),this.getActiveServerEntry(r).server)}async updateMCPServers(r){let n=this.storedMCPServersConfig;if(this.storedMCPServersConfig=r,!this.isMcpEnabled)return;let o=this.ctx.get(kn).getCapabilities().mcpServerManagement??!1,s=new Set(Object.keys(r)),c=new Set(this.MCPServersMap.keys()),l=[...c].filter(m=>!s.has(m)),u=new Set([...s].filter(m=>c.has(m)&&!this.areServerConfigsEqual(n[m],r[m]))),d=new Set;for(let m of u){let g=this.MCPServersMap.get(m);g&&!g.isBlocked&&(g.server.isConnected||g.hasError)&&d.add(m)}let f=[...l,...u];for(let m of f){let g=this.MCPServersMap.get(m);g&&!g.isBlocked&&(this.unregisterServerTools(m),await this.stopMCPServer(m)),u.has(m)||(this.removeServerAccountPreferences(m),this.serverPrefixes.delete(m)),this.MCPServersMap.delete(m)}f.length>0&&await this.persistAllServersCache();for(let m of s)this.MCPServersMap.has(m)||await this.upsertServerDefinition(m,r[m]);if(await this.cache.isFirstBoot()||!o){if(await this.cache.markFirstBootCompleted(),s.size>0){let m=Array.from(s).map(async g=>{try{await this.startServer(g);let A=this.MCPServersMap.get(g);A&&(A.hasError=!1,A.errorMessage=void 0,A.isStarting=!1)}catch(A){let y=this.MCPServersMap.get(g);y&&(y.hasError=!0,y.errorMessage=A instanceof Error?A.message:String(A),y.isStarting=!1),sr.warn(this.ctx,`Failed to auto-start MCP server ${g} during first boot:`,A)}});await Promise.allSettled(m)}}else if(d.size>0){let m=Array.from(d).map(async g=>{try{await this.startServer(g);let A=this.MCPServersMap.get(g);A&&!A.isBlocked&&(A.hasError=!1,A.errorMessage=void 0,A.isStarting=!1)}catch(A){let y=this.MCPServersMap.get(g);y&&!y.isBlocked&&(y.hasError=!0,y.errorMessage=A instanceof Error?A.message:String(A),y.isStarting=!1),sr.warn(this.ctx,`Failed to restart MCP server ${g} after config update:`,A)}});await Promise.allSettled(m)}await this.updateServersList()}areServerConfigsEqual(r,n){return this.stableStringify(r)===this.stableStringify(n)}stableStringify(r){if(Array.isArray(r))return`[${r.map(n=>this.stableStringify(n)).join(",")}]`;if(r&&typeof r=="object"){let n=r;return`{${Object.keys(n).sort().map(s=>`${JSON.stringify(s)}:${this.stableStringify(n[s])}`).join(",")}}`}return JSON.stringify(r)??"undefined"}async upsertServerDefinition(r,n){let o=this.toManagedServerDefinition(r,n),s=this.MCPServersMap.get(r);if(this.isAllowlistFeatureEnabled()){let c=await this.registryService.validateServerConfig(r,n),{registryInfo:l,isBlocked:u,blockReason:d}=c;u?(this.addBlockedServer(o),sr.info(this.ctx,`MCP server ${r} is blocked: ${d}`)):s&&!s.isBlocked?await this.updateServerDefinition(s,o):await this.addServer(o),l&&this.updateRegistryInfo(r,l);return}s&&!s.isBlocked?await this.updateServerDefinition(s,o):await this.addServer(o)}toManagedServerDefinition(r,n){let o=n.type,s="command"in n?"stdio":o??"streamable";return{...n,name:r,type:s}}addBlockedServer(r){this.MCPServersMap.set(r.name,{server:null,definition:r,hasError:!1,errorMessage:void 0,isStarting:!1,isBlocked:!0,authInfo:void 0})}updateRegistryInfo(r,n){let o=this.MCPServersMap.get(r);o&&(o.registryInfo=n)}getAllContents(r){return this.isMcpEnabled?this.getAllMCPServerCapabilities(r):[]}getAllMCPServerCapabilities(r){let n=[];for(let[o,s]of this.MCPServersMap)try{let c=this.createServerSnapshot(o,s);n.push(c)}catch(c){let l=`Failed to create snapshot for MCP server ${o}.`+(c instanceof Error?` message: ${c.message}`:` ${String(c)}`);sr.error(this.ctx,l);let u={name:o,prefix:this.getServerPrefix(o),status:"error",tools:[],resources:[],resourceTemplates:[],prompts:[],error:l};n.push(u)}return r&&!r.isBuiltIn&&r.customTools?n.map(o=>(o.tools=o.tools.map(s=>{let c=this.createMcpLanguageModelTool(o.name,this.getServerPrefix(o.name),s);return s._status=r.customTools.includes(c.configurationKey)?"enabled":"disabled",s}),o)):n}async updateMCPToolsStatus(r,n){this.ensureMcpEnabledOrThrow("batch update tools status");for(let{serverName:o,toolName:s,status:c}of n){let d=this.getActiveServerEntry(o).server.getCachedTools().find(m=>m.name===s),f=this.getServerPrefix(o);if(!d){sr.error(this.ctx,`Not found MCP ${o} server ${s} tool`);continue}yxe(r)&&(d._status=c),this.ctx.get(hs).getToolById(`${o}.${s}`)||this.registerTool(o,f,d)}await this.ctx.get(hs).updateToolsStatus(r,n.map(({serverName:o,toolName:s,status:c})=>({toolId:`${o}.${s}`,status:c}))),this.persistAllServersCache()}async callTool(r,n,o,s,c,l,u){this.ensureMcpEnabledOrThrow(`call tool ${r}.${n}`);let d=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,d,"tool call")).callTool(n,o,s,c,l,u)}async getPrompt(r,n,o){this.ensureMcpEnabledOrThrow(`get prompt ${r}.${n}`);let s=this.getActiveServerEntry(r),l=await(await this.ensureServerConnection(r,s,"get prompt")).getPrompt(n,o);return ft(this.ctx,"mcp.getPrompt",Vt.createAndMarkAsIssued()),cr(this.ctx,"mcp.getPrompt"),l}async completePrompt(r,n,o,s,c){this.ensureMcpEnabledOrThrow(`complete prompt ${r}.${n}`);let l=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,l,"complete prompt")).completePrompt(n,o,s,c)}async readResource(r,n){this.ensureMcpEnabledOrThrow(`read resource from ${r}: ${n}`);let o=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,o,"read resource")).readResource(n)}async startMCPServer(r){return this.ensureMcpEnabledOrThrow(`start server ${r}`),this.serverOperationSequencer.queue(r,async()=>{await this.startMCPServerInternal(r)})}async startMCPServerInternal(r){let n=this.getActiveServerEntry(r);if(n.server.isConnected){sr.info(this.ctx,`MCP server ${r} is already running`);return}if(n.isStarting){sr.info(this.ctx,`MCP server ${r} is already starting, skipping duplicate request`);return}n.isStarting=!0,await ia(this.ctx,{message:`Starting server ${r}`,server:r}),await this.updateServersList(!1),this.unregisterServerTools(r);try{await this.startServer(r);let o=this.MCPServersMap.get(r);o&&(o.hasError=!1,o.errorMessage=void 0,o.isStarting=!1)}catch(o){let s=this.MCPServersMap.get(r);throw s&&(s.hasError=!0,s.errorMessage=o instanceof Error?o.message:String(o),s.isStarting=!1),o}finally{this.registerServerTools(r),await this.updateServersList(!1)}}async stopMCPServer(r){return this.serverOperationSequencer.queue(r,async()=>{await this.stopMCPServerInternal(r)})}async stopMCPServerInternal(r){let n=this.getActiveServerEntry(r);if(n.isStarting){sr.info(this.ctx,`MCP server ${r} is starting, cannot stop now`);return}await ia(this.ctx,{message:`Stopping server ${r}`,server:r}),n.server.getEmitter().removeAllListeners(YV),n.server.isConnected&&await n.server.cleanup(),n.hasError=!1,n.errorMessage=void 0,n.isStarting=!1,await ia(this.ctx,{message:`Server ${r} stopped`,server:r}),await this.updateServersList(!1)}async restartMCPServer(r){return this.ensureMcpEnabledOrThrow(`restart server ${r}`),await ia(this.ctx,{message:`Restarting server ${r}`,server:r}),this.serverOperationSequencer.queue(r,async()=>{await this.stopMCPServerInternal(r),await new Promise(n=>setTimeout(n,100)),await this.startMCPServerInternal(r)})}async logoutMCPServer(r){return this.ensureMcpEnabledOrThrow(`logout server ${r}`),this.serverOperationSequencer.queue(r,async()=>{await ia(this.ctx,{message:`Logging out MCP server ${r}`,server:r}),await this.performLogout(r)})}async clearOAuthMCPServer(r){return this.ensureMcpEnabledOrThrow(`clear OAuth for server ${r}`),this.serverOperationSequencer.queue(r,async()=>{let o=this.getActiveServerEntry(r).authInfo?.providerId;if(!o){sr.warn(this.ctx,`No OAuth provider found for server ${r}, nothing to clear`);return}await ia(this.ctx,{message:`Clearing OAuth provider registration for MCP server ${r}`,server:r}),await this.performLogout(r),sr.info(this.ctx,`Unregistering provider ${o} for server ${r}`);try{await this.ctx.get(nM).unregisterProvider(o)}catch{sr.debug(this.ctx,`Provider ${o} is not a dynamic OAuth provider, skipping unregistration`)}})}async performLogout(r){let n=this.getActiveServerEntry(r);if(n.authInfo){let{providerId:c,accountName:l}=n.authInfo;sr.info(this.ctx,`Removing account preference and session for account ${l} on server ${r} with provider ${c}`),this.ctx.get(Rb).removeAccountPreference(r,c);try{let u=this.ctx.get(gm).getProvider(c),f=(await u.getSessions(void 0,{})).find(h=>h.account.label===l);f?(await u.removeSession(f.id),sr.info(this.ctx,`Successfully removed session for account ${l}`)):sr.warn(this.ctx,`No session found for account ${l}`)}catch(u){sr.error(this.ctx,`Failed to remove session for account ${l}:`,u)}n.authInfo=void 0}await this.stopMCPServerInternal(r);let o=this.storedMCPServersConfig[r];if(!o){let c=`Original config not found for server ${r}`;throw sr.error(this.ctx,c),new Error(c)}let s=this.toManagedServerDefinition(r,o);this.MCPServersMap.delete(r),await this.addServer(s),sr.info(this.ctx,`Server ${r} logged out and restored to original configuration`),await this.updateServersList(!1)}async startServer(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;if(n.server.isConnected){sr.info(this.ctx,`MCP server ${r} is already running`);return}let{server:o,definition:s}=n;try{o.getEmitter().on(YV,()=>{this.unregisterServerTools(r),this.persistAllServersCache(),this.registerServerTools(r),this.notifyClient()}),await o.connect(s),await ia(this.ctx,{message:"Connection state: Running",server:r})}catch(c){sr.error(this.ctx,`Error initializing MCP server ${r}:`,c);let l=c instanceof aR||c instanceof sNe,u=l?c.code:void 0;if(l&&u!==void 0&&"url"in s&&s.type!=="sse"&&o instanceof z6e&&u!==401&&u>=400&&u<500){let f=`${u} status sending message to ${s.url}, will attempt to fall back to legacy SSE`;sr.info(this.ctx,f),ia(this.ctx,{message:f,server:r});let h={...s,name:r,type:"sse"};return await o.cleanup().catch(()=>{}),await this.updateServerDefinition(n,h),await this.startServer(r)}else if(l&&"url"in s&&u===401){let f=await this.getAuthMetadata(s),h=await this.getToken(s.name,s.url,f.authorizationServer,f.serverMetadata,f.resourceMetadata);if(!h){let g=`Failed to get token for server: ${r}`;throw sr.error(this.ctx,g),new Error(g)}let m={...s,name:r,requestInit:{...s.requestInit??{},headers:{...s.requestInit?.headers??{},Authorization:`Bearer ${h}`}}};return await o.cleanup().catch(()=>{}),await this.updateServerDefinition(n,m),await this.startServer(r)}let d=c instanceof Error?`message: ${c.message} stack: ${c.stack}`:String(c);throw await yd(this.ctx,{message:d,server:r}),this.ctx.get(es).showWarningMessageOnlyOnce(`${r}.initialize`,`Failed to initialize MCP server '${r}'. Please check the logs for more details.`),c}}async updateServersList(r=!0){return this.updateServersQueue=this.updateServersQueue.then(async()=>{r&&this.registerTools(),await this.notifyClient()}).catch(n=>{sr.error(this.ctx,"updateServersList: Update failed",n)}),this.updateServersQueue}getServerPrefix(r){let n=this.serverPrefixes.get(r);if(n)return n;let o=this.prefixGenerator.generate(r);return this.serverPrefixes.set(r,o),o}async persistAllServersCache(){try{let r={};for(let[n,o]of this.MCPServersMap){let s=o.server?.getCachedTools()??[],c=o.server?.getCachedResources()??[],l=o.server?.getCachedResourceTemplates()??[],u=o.server?.getCachedPrompts()??[];r[n]={tools:s,resources:c,resourceTemplates:l,prompts:u}}await this.cache.store(r)}catch(r){sr.error(this.ctx,"Failed to persist MCP servers cache:",r)}}createMCPServer(r){return r.type==="sse"?new Skt(this.ctx,r.name,r.version||"1.0.0"):r.type==="streamable"||"url"in r?new z6e(this.ctx,r.name,r.version||"1.0.0"):new Tkt(this.ctx,r.name,r.version||"1.0.0")}async addServer(r){let n=this.createMCPServer(r),o=await this.cache.get(r.name);o&&n.restoreCacheFromPersistence(o),this.MCPServersMap.set(r.name,{server:n,definition:r,hasError:!1,errorMessage:void 0,isStarting:!1,isBlocked:!1})}async updateServerDefinition(r,n){let o=this.createMCPServer(n),s=await this.cache.get(n.name);s&&o.restoreCacheFromPersistence(s),r.server=o,r.definition=n}async notifyClient(){let r=this.getAllContents();await this.ctx.get(Xt).connection.sendNotification(t.contentsNotificationType,{servers:r})}registerTools(){for(let[r]of this.MCPServersMap)this.registerServerTools(r)}registerServerTools(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;let o=this.getServerPrefix(r),s=n.server?.getCachedTools()??[];for(let c of s)this.registerTool(r,o,c)}unregisterServerTools(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;let o=n.server?.getCachedTools()??[];for(let s of o)this.unregisterTool(r,s.name)}registerTool(r,n,o){sr.debug(this.ctx,"register MCP Tool:",{...o}),this.ctx.get(hs).registerTool(this.createMcpLanguageModelTool(r,n,o))}createMcpLanguageModelTool(r,n,o){let{name:s,description:c,inputSchema:l,_status:u,_nameForModel:d,annotations:f}=o;return new Ikt({serverName:r,serverNamePrefix:n,name:d,displayName:s,description:c||"",displayDescription:c||"",inputSchema:l,annotations:f,status:u},(h,m,g,A)=>(sr.info(this.ctx,"copilot MCP Invoker:",r,s,g),this.callTool(r,s,g,A,h,m.roundId,m.toolCallId?.toString())))}unregisterAllTools(){for(let[r,n]of this.MCPServersMap){if(n.isBlocked)continue;let o=n.server?.getCachedTools()??[];for(let s of o)this.unregisterTool(r,s.name)}}unregisterTool(r,n){sr.debug(this.ctx,"unregister MCP Tool:",{serverName:r,toolName:n}),this.ctx.get(hs).unregisterTool(`${r}.${n}`)}async clearAllServers(){this.unregisterAllTools();for(let r of this.MCPServersMap.keys())if(!this.MCPServersMap.get(r).isBlocked)try{await this.stopMCPServer(r)}catch(o){sr.error(this.ctx,`Error stopping server ${r} during clearAllServers:`,o)}this.MCPServersMap.clear(),this.serverPrefixes.clear()}determineServerStatus(r){return r.isBlocked?"blocked":r.isStarting?"starting":r.server.isConnected?"running":r.hasError?"error":"stopped"}createServerSnapshot(r,n){return{name:r,prefix:this.getServerPrefix(r),status:this.determineServerStatus(n),tools:n.server?.getCachedTools()??[],resources:n.server?.getCachedResources()??[],resourceTemplates:n.server?.getCachedResourceTemplates()??[],prompts:n.server?.getCachedPrompts()??[],error:n.isBlocked?void 0:n.errorMessage,registryInfo:n.registryInfo,authInfo:n.isBlocked?void 0:n.authInfo}}updateAuthInfo(r,n,o,s){let c=this.MCPServersMap.get(r);c&&!c.isBlocked&&(c.authInfo={providerId:n,accountName:o,isDynamic:s})}removeServerAccountPreferences(r){let n=this.MCPServersMap.get(r);if(n?.isBlocked||!n?.authInfo){sr.debug(this.ctx,`No auth info found for server ${r}, nothing to remove`);return}let{providerId:o}=n.authInfo;sr.info(this.ctx,`Removing account preference for server ${r} with provider ${o}`),this.ctx.get(Rb).removeAccountPreference(r,o),n.authInfo=void 0}async getAuthMetadata(r){try{return await new Zhe(this.ctx).getMetadataFromOriginalUrl(r.url,r.requestInit?.headers)}catch(n){throw sr.error(this.ctx,`Failed to get auth metadata for ${r.url}: ${n instanceof Error?n.message:String(n)}`,n),n}}async getToken(r,n,o,s,c){let l=this.ctx.get(gm).getOrActivateProviderIdForServer(o);if(!l){let A=this.ctx.get(gm).createAuthenticationProvider(o,s,c);if(!A&&(A=await this.ctx.get(gm).createDynamicAuthenticationProvider(o,s,c),!A)){sr.warn(this.ctx,`Failed to create authentication provider for server ${r} (authServer: ${o})`);return}l=A.id}let u=c?.scopes_supported||s.scopes_supported||[],d=await this.ctx.get(gm).getSessions(l,u,{authorizationServer:o},!0),f=this.ctx.get(Rb).getAccountPreference(r,l),h;f&&(h=d.find(A=>A.account.label===f));let m=this.ctx.get(gm).getProvider(l),g=!!this.ctx.get(iC).getClientRegistration(l);if(d.length){if(h)return this.updateAuthInfo(r,l,h.account.label,g),h.accessToken;try{let A=m?.label||l,y="Sign in to another account",E=d.map(v=>({title:v.account.label}));E.push({title:y}),E.push({title:"Cancel"});let _=await this.ctx.get(es).showInformationModal(`The MCP server ${r} wants to access a ${A} account, Select an account for ${r} to use`,...E);if(!_||_.title==="Cancel"){sr.warn(this.ctx,"user cancelled the account selection");return}if(_.title!==y){let v=d.find(b=>b.account.label===_.title);if(!v){sr.warn(this.ctx,"selected account not found in sessions");return}return this.ctx.get(Rb).updateAccountPreference(r,l,v.account),this.updateAuthInfo(r,l,v.account.label,g),v.accessToken}}catch(A){sr.error(this.ctx,"Failed during account selection:",A);return}}else try{if((await this.ctx.get(es).showInformationModal(`The MCP Server Definition '${n}' wants to authenticate to ${m.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){sr.warn(this.ctx,"user cancelled the authentication request");return}}catch(A){sr.error(this.ctx,"Failed to show authentication request dialog:",A);return}try{let A=await m.createSession(u,{});return this.ctx.get(es).showInformationMessageOnlyOnce("Authentication successful",`You have already authenticated with ${m.label}.`),this.ctx.get(Rb).updateAccountPreference(r,l,A.account),this.updateAuthInfo(r,l,A.account.label,g),A.accessToken}catch(A){sr.error(this.ctx,`Failed to create authentication session for server ${r}:`,A),this.ctx.get(es).showWarningMessageOnlyOnce("Authentication failed",`You need to restart the IDE to authenticate the MCP server again. ${A instanceof Error?A.message:String(A)}`);return}}};p();var ilo=fe(Fc());var Rkt=class t extends V2{static{a(this,"CLSMCPRuntimeNotifier")}static{this.notificationType=new ilo.ProtocolNotificationType("copilot/mcpRuntimeLogs")}constructor(e){super(),this.ctx=e}async notifyLog(e){await this.ctx.get(Xt).connection.sendNotification(t.notificationType,{...e,time:Date.now()})}};p();var olo=fe(Fc());var qsl=new olo.ProtocolRequestType("copilot/readMcpSamplingConfig"),kkt=class extends DW{constructor(r){super();this.ctx=r}static{a(this,"CopilotMcpSamplingConfigSender")}async readMcpSamplingConfig(r){let n=this.ctx.get(Xt).connection,o;try{o=await n.sendRequest(qsl,r)}catch(l){throw new Error(`Request copilot/readMcpSamplingConfig failed with message: ${rd(l)}`)}let[s,c]=o;if(c)throw new Error(`Request copilot/readMcpSamplingConfig failed with code: ${c.code}, message: ${c.message}`);return s}};p();var Dkt=fe(Fc());var jsl=new Dkt.ProtocolRequestType("copilot/showPanelMessageRequest"),Hsl=new Dkt.ProtocolNotificationType("copilot/showPanelMessage"),Pkt=class extends SCe{constructor(r){super();this.ctx=r}static{a(this,"CopilotMessageSender")}async sendPanelMessageNotification(r){return this.ctx.get(Xt).connection.sendNotification(Hsl,r)}async sendPanelMessageRequest(r){let n=this.ctx.get(Xt).connection,o;try{o=await n.sendRequest(jsl,r)}catch(l){throw new Error(`Request copilot/showPanelMessageRequest failed with message: ${rd(l)}`)}let[s,c]=o;if(c)throw new Error(`Request copilot/showPanelMessageRequest failed with code: ${c.code}, message: ${c.message}`);return s}};p();p();var alo=require("node:stream"),boe=fe(Bcr());var dU=new pe("UndiciFetcher"),Mkt=class extends nr{constructor(r){super();this.ctx=r;this.name="UndiciFetcher";this.userAgent=`GithubCopilot/${r.get(us).getVersion()}`,this.certificateConfigurator=new nve(r),this.proxySocketFactory=r.get(Ek),this.settings=r.get(Lo).getHttpSettings(),this.updateNoProxyFilters(this.settings.noProxy),dU.info(this.ctx,"Initialized UndiciFetcher.",this.getSettingsLogProperties()),r.get(Lo).onDidChangeHttpSettings(n=>{this.settings=n,this.updateNoProxyFilters(n.noProxy),dU.info(this.ctx,"HTTP settings changed; resetting Undici dispatchers.",this.getSettingsLogProperties()),this.resetDispatchers()})}static{a(this,"UndiciFetcher")}async fetch(r,n){let o={...n.headers??{}};o["User-Agent"]=this.userAgent;let s=n.body;if(n.json!==void 0){if(n.body!==void 0)throw new Error("Illegal arguments! Cannot pass in both 'body' and 'json'!");o["Content-Type"]="application/json",s=JSON.stringify(n.json)}let c=n.method??"GET";if(c!=="GET"&&c!=="POST"&&c!=="DELETE")throw new Error("Illegal arguments! 'method' must be 'GET', 'POST', or 'DELETE'!");let l=!1,u,d=Vsl(n.signal),f=d.signal;if(n.timeout){let h=new AbortController;u=setTimeout(()=>{l=!0,h.abort()},n.timeout),f=f?AbortSignal.any([f,h.signal]):h.signal}try{let h={method:c,headers:o,body:s,signal:f};dU.debug(this.ctx,"Starting Undici fetch.",{target:Nkt(r),method:c,hasBody:s!==void 0,hasTimeout:n.timeout!==void 0,hasSignal:f!==void 0});let{dispatcher:m,isProxy:g}=await this.getDispatcher(r),A=await(0,boe.fetch)(r,{...h,dispatcher:m});return dU.debug(this.ctx,"Undici fetch completed.",{target:Nkt(r),status:A.status,isProxy:g}),new lx(A.status,A.statusText,A.headers,()=>A.text(),()=>A.body?alo.Readable.fromWeb(A.body):null)}catch(h){throw l?(dU.warn(this.ctx,"Undici fetch timed out.",{target:Nkt(r),timeout:n.timeout}),new ez(`Request to <${r}> timed out after ${n.timeout}ms`,h)):Wsl(h)}finally{u&&clearTimeout(u),d.cleanup()}}async disconnectAll(){await this.resetDispatchers()}async getDispatcher(r){let n=await this.certificateConfigurator.getCertificates(),o=n?n.join("\0"):"";this.dispatcherCertsKey!==o&&(dU.info(this.ctx,"Root certificate set changed; resetting Undici dispatchers.",{certificateCount:n?.length??0}),await this.resetDispatchers()),this.dispatcherCertsKey=o;let s={allowH2:!0,ca:n,rejectUnauthorized:this.settings.proxyStrictSSL??!0};return!this.settings.proxy||this.shouldBypassProxy(r)?(this.noProxyAgent||(dU.debug(this.ctx,"Creating direct Undici agent.",{target:Nkt(r),bypassedProxy:!!this.settings.proxy,rejectUnauthorized:s.rejectUnauthorized}),this.noProxyAgent=new boe.Agent({allowH2:!0,connect:s})),{dispatcher:this.noProxyAgent,isProxy:!1}):(this.proxyAgent||(this.proxyAgent=this.buildProxyAgent(s)),{dispatcher:this.proxyAgent,isProxy:!0})}buildProxyAgent(r){let n=this.settings.proxy,o=new URL(n),s=(0,boe.buildConnector)(r);return dU.debug(this.ctx,"Creating proxied Undici agent.",{proxy:slo(n),hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal,rejectUnauthorized:r.rejectUnauthorized}),new boe.Agent({allowH2:!0,connect:a((c,l)=>{let u=c.port!==void 0&&c.port!==""?Number(c.port):c.protocol==="https:"?443:80,d={hostname:c.hostname,port:u,headers:{}};this.proxySocketFactory.createSocket(d,{hostname:o.hostname,port:o.port,authorization:this.settings.proxyAuthorization,kerberosServicePrincipal:this.settings.proxyKerberosServicePrincipal}).then(f=>{if(c.protocol!=="https:"){l(null,f);return}s({...c,httpSocket:f},l)}).catch(f=>{l(f instanceof Error?f:new Error(String(f)),null)})},"connect")})}async resetDispatchers(){let r=this.noProxyAgent,n=this.proxyAgent;this.noProxyAgent=void 0,this.proxyAgent=void 0,this.dispatcherCertsKey=void 0,(r||n)&&dU.debug(this.ctx,"Closing Undici dispatchers.",{hasDirectAgent:!!r,hasProxyAgent:!!n}),await Promise.all([r?.close().catch(()=>{}),n?.close().catch(()=>{})])}updateNoProxyFilters(r){let n=(r??[]).map(s=>s.trim()).filter(s=>s.length>0);if(this.noProxyFilters=void 0,n.length===0)return;if(n.includes("*")){this.noProxyFilters=[{regex:/.*/i}];return}let o=[];for(let s of n){let{host:c,port:l}=Gsl(s),u=$sl(c);u&&o.push({regex:u,port:l})}o.length&&(this.noProxyFilters=o)}getSettingsLogProperties(){return{proxy:slo(this.settings.proxy),noProxyCount:this.settings.noProxy?.length??0,proxyStrictSSL:this.settings.proxyStrictSSL,hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal}}shouldBypassProxy(r){if(!this.noProxyFilters?.length)return!1;let n;try{n=new URL(r)}catch{return!1}let o=n.hostname;if(!o)return!1;let s=n.port||(n.protocol==="https:"?"443":"80"),c=o.toLowerCase();return this.noProxyFilters.some(l=>l.regex.test(c)&&(!l.port||l.port===s))}};function Gsl(t){if(t.startsWith("[")){let r=t.indexOf("]");if(r!==-1){let n=t.slice(1,r),o=t.slice(r+1);return{host:n,port:o.startsWith(":")?o.slice(1):void 0}}}let e=t.split(":");return e.length===2?{host:e[0],port:e[1]}:{host:t}}a(Gsl,"splitHostPort");function $sl(t){if(!t)return;t.startsWith(".")&&(t=`*${t}`);let e=t.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${e}$`,"i")}catch{return}}a($sl,"compileHostPattern");function Nkt(t){try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(Nkt,"describeUrl");function slo(t){if(!t)return"none";try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(slo,"describeProxy");function Vsl(t){if(!t||t instanceof AbortSignal)return{signal:t,cleanup:a(()=>{},"cleanup")};let e=new AbortController,r=a(()=>e.abort(),"abort");return t.addEventListener("abort",r),t.aborted&&e.abort(),{signal:e.signal,cleanup:a(()=>t.removeEventListener("abort",r),"cleanup")}}a(Vsl,"toNativeAbortSignal");function Wsl(t){if(!(t instanceof Error)||!("cause"in t)||!t.cause||typeof t.cause!="object")return t;let e=t.cause,r=new Error(t.message,{cause:t.cause});r.stack=t.stack,r.name=t.name,r.code=t.code??e.code,r.syscall=t.syscall??e.syscall,r.errno=t.errno??e.errno;let n=e.statusCode;return typeof n=="number"&&(r.statusCode=n),r}a(Wsl,"withCauseNetworkProperties");p();var Y6e=new pe("fetcher"),zsl="https://default.exp-tas.com/",K6e=class extends nr{constructor(r,n,o,s){super();this.ctx=r;this.defaultFetcher=n;this.fallbackFetcher=o;this.onFallbackSuccess=s}static{a(this,"FallbackFetcher")}async fetch(r,n){try{return await this.defaultFetcher.fetch(r,n)}catch(o){if(Ym(o)||`${r}/`.startsWith(zsl))throw o;Y6e.info(this.ctx,`Request to <${r}> failed, attempting fallback.`,o);let s=await this.fallbackFetcher.fetch(r,n);return this.onFallbackSuccess(o,r),Y6e.info(this.ctx,`Fallback fetch for <${r}> succeeded.`),s}}getImplementation(){return this.defaultFetcher.getImplementation()}get name(){return this.defaultFetcher.name}async disconnectAll(){await this.defaultFetcher.disconnectAll()}},Okt=class extends nr{constructor(r,n,o){super();this.ctx=r;this.primary=n;this.secondary=o;this.default=new K6e(r,n,o,(s,c)=>{this.current!==o&&(Y6e.info(r,`${n.name} failed; switching to ${o.name} for subsequent requests.`),this.current=o,Cs(r,"fetcher.stickyFallback",s,{primary:n.name,secondary:o.name,failingHost:Ksl(c),...Jsl(s),...Zsl(r)}),n.disconnectAll().catch(l=>{Y6e.info(r,`Failed to disconnect ${n.name} after sticky fallback.`,l)}))}),this.current=this.default}static{a(this,"StickyFallbackFetcher")}reset(){this.current!==this.default&&(Y6e.info(this.ctx,`Re-arming sticky fallback; ${this.primary.name} will be retried on the next request.`),this.current=this.default)}get name(){return this.current.name}getImplementation(){return this.current.getImplementation()}fetch(r,n){return this.current.fetch(r,n)}async disconnectAll(){await Promise.all([this.primary.disconnectAll(),this.secondary.disconnectAll()])}},Ysl=["githubusercontent.com","githubcopilot.com","github.com","exp-tas.com","vscode-cdn.net"];function Ksl(t){let e;try{e=new URL(t).host}catch{return""}let r=e.split(":")[0].toLowerCase();return Ysl.some(o=>r===o||r.endsWith(`.${o}`))?e:""}a(Ksl,"describeHost");function Jsl(t){try{if(!(t instanceof Error)||!t.cause)return{};let e=t.cause;Array.isArray(e.errors)&&e.errors.length>0&&e.errors[0]instanceof Error&&(e=e.errors[0]);let r={};for(let[n,o]of Object.entries({errorCauseName:e.name,errorCauseCode:e.code,errorCauseSyscall:e.syscall}))typeof o=="string"&&o&&(r[n]=o.slice(0,100));return typeof e.statusCode=="number"&&(r.errorCauseStatusCode=String(e.statusCode)),r}catch{return{}}}a(Jsl,"buildErrorCauseProperties");function Zsl(t){try{let e=t.get(Lo).getHttpSettings(),r=!!e.proxy,n="none";return r&&(n=e.proxyKerberosServicePrincipal?"kerberos":e.proxyAuthorization?"basic":"none"),{proxyConfigured:r?"true":"false",proxyAuth:n,proxyStrictSSL:e.proxyStrictSSL!==!1?"true":"false"}}catch{return{}}}a(Zsl,"describeHttpContext");var clo=new pe("fetcher");function Xsl(t){return Rt(t,ze.UseHelixFetcher)==="true"}a(Xsl,"isHelixFetcherForced");function eal(t){if(Xsl(t))return new Wie(t);let e=new Okt(t,new Mkt(t),new Wie(t));return t.get(Lo).onDidChangeHttpSettings(()=>e.reset()),e}a(eal,"createDefaultFetcher");var Lkt=class extends nr{constructor(r,n=eal(r),o=new tve(r)){super();this.ctx=r;this.defaultFetcher=n;this.editorFetcher=o;this.updateFetcher=a(()=>{let r,n;if(!this.editorFetcherCapability)n=`Using ${this.defaultFetcher.name}, editor does not have fetch capability.`,r=this.defaultFetcher;else if(this.fetchStrategy==="client")n="Using editor fetcher, fetch strategy set to client.",r=this.editorFetcher;else if(this.fetchStrategy==="native")n=`Using ${this.defaultFetcher.name}, fetch strategy set to native.`,r=this.defaultFetcher;else{let o=Rt(this.ctx,ze.DebugUseEditorFetcher);o?.toString()==="true"?(n="Using editor fetcher, debug flag is enabled.",r=this.editorFetcher):o?.toString()==="false"?(n=`Using ${this.defaultFetcher.name}, debug flag is disabled.`,r=this.defaultFetcher):(n="Editor fetcher capability available, will fallback if needed.",r=this.fallbackFetcher)}this.currentFetcher!=r&&(clo.debug(this.ctx,n),this.currentFetcher=r)},"updateFetcher");this.currentFetcher=this.defaultFetcher,this.fallbackFetcher=new K6e(r,n,o,()=>{clo.info(this.ctx,"Fallback fetch succeeded, switching to editor fetcher."),this.currentFetcher=this.editorFetcher}),r.get(kn).onDidSetCapabilities(this.updateFetcher),r.get(Lo).onDidChangeCopilotSettings(this.updateFetcher)}static{a(this,"AgentDelegatingFetcher")}get fetchStrategy(){return Rt(this.ctx,ze.FetchStrategy)}get editorFetcherCapability(){return this.ctx.get(kn).getCapabilities().fetch??!1}getImplementation(){return this.currentFetcher.getImplementation()}get name(){return this.currentFetcher.name}fetch(r,n){return this.currentFetcher.fetch(r,n)}async disconnectAll(){await Promise.all([this.defaultFetcher.disconnectAll(),this.editorFetcher.disconnectAll()])}};p();var Fkt=fe(ei());var Bkt=class extends es{constructor(r){super();this.ctx=r}static{a(this,"ConnectionNotificationSender")}get connection(){return this.ctx.get(Xt).connection}showWarningMessage(r,...n){return this.connection.window.showWarningMessage(r,...n)}showInformationMessage(r,...n){return this.connection.window.showInformationMessage(r,...n)}showInformationModal(r,...n){return this.connection.sendRequest(Fkt.ShowMessageRequest.type,{type:Fkt.MessageType.Info,message:r,actions:n,modal:!0}).then(o=>o||void 0)}async sendBackgroundAgentSessionUpdate(r,n,o,s){await this.connection.sendNotification("backgroundAgent/sessionUpdate",{sessionId:r,event:n,agentProvider:o,turnIndex:s})}async sendBackgroundAgentTodosChanged(r){await this.connection.sendNotification("backgroundAgent/todosChanged",r)}};p();var llo=fe(Fc());var Ukt=class t extends NK{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaChangeNotifier")}static{this.notificationType=new llo.ProtocolNotificationType("copilot/quotaChange")}async notifyQuotaChange(r){await this.ctx.get(Xt).connection.sendNotification(t.notificationType,r)}};p();var ulo=fe(Fc());var Qkt=class t extends hq{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaWarningNotifier")}static{this.notificationType=new ulo.ProtocolNotificationType("copilot/quotaWarning")}async notifyQuotaWarning(r){await this.ctx.get(Xt).connection.sendNotification(t.notificationType,r)}};p();var dlo=fe(Fc());var tal=new dlo.ProtocolNotificationType("$/copilot/rateLimitWarning"),qkt=class extends zS{constructor(r){super();this.ctx=r}static{a(this,"CLSRateLimitNotifier")}async notifyRateLimitWarning(r){await this.ctx.get(Xt).connection.sendNotification(tal,r)}};p();p();var jkt=class extends eYe{static{a(this,"AgentWorkspaceWatcher")}async getWatchedFiles(){return(await this.ctx.get(PN).getWatchedFiles({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})).watchedFiles}async getWatchedFileUris(){return this.ctx.get(PN).getWatchedFileUris({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})}startWatching(){if(this.status==="ready")return;let e=this.ctx.get(PN);this._watcher=e.onDidChangeWatchedFiles(this.onDidChangeWatchedFilesHandler.bind(this)),this.status="ready"}stopWatching(){this.status="stopped",this._watcher?.dispose(),this._watcher=void 0}onDidChangeWatchedFilesHandler(e){if(e.workspaceFolder.uri!==this.workspaceFolder.uri)return;let n=e.created.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);if(n.length){let c=n.map(l=>l.document).filter(l=>l!==void 0);this.emitFilesCreated(c)}let o=e.changed.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);if(o.length){let c=o.map(l=>l.document).filter(l=>l!==void 0);this.emitFilesUpdated(c)}let s=e.deleted.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);s.length&&this.emitFilesDeleted(s.map(c=>({uri:c.uri})))}};var Hkt=class extends tw{static{a(this,"AgentWorkspaceWatcherProvider")}createWatcher(e){return new jkt(this.ctx,e)}shouldStartWatching(e){return OP(this.ctx)?!1:!!this.ctx.get(kn).getCapabilities().watchedFiles&&(!this.hasWatcher(e)||this.getStatus(e)==="stopped")}};function Gkt(t){let e=new ob(process.env),r=Pao(e);r.set(ob,e),r.set(nr,new Lkt(r)),r.set(cc,new cc(r)),fFr(r,{});let n=Srn();r.set(ti,n),r.set(pA,new pA(r));let o=new ekt;r.set(Dh,o);let s=plo.join(n.directory,bqr),c=x3.plaintextOnly();r.set(x3,c);let{repo:l,diagnostics:u}=ipn(r,s,c);r.set(fx,l),r.set(Mr,new qje(r,process.env)),r.set(WT,new WT(r)),r.set(qie,new qie(r));let d=new yf(r,"agent");d.onInitialized(()=>spn(r,u)),r.set(yf,d),r.set(qa,SJi),r.set($I,new $I),r.set(Ir,new Aj),r.set(zie,pJi()),r.set(ku,new ku),r.set(Qo,Uco),r.set(ua,new zRt(r)),r.set(mee,new KRt(r)),r.set(tw,new Hkt(r)),r.set(PN,new PN(r)),r.set(ym,new ym),r.set(Em,nut(r,xWi)),r.set(Nb,new Nb(r)),r.set(i4,new mme),Aco(r),tYe(r),apn(r),r.set(Xt,new Xt(r,t));let f=new H9([hco(r)]);r.set(H9,f),r.set(q6e,new q6e(r)),r.get(Xt).onDeactivation(()=>f.dispose()),r.set(MO,new YRt(r)),r.set(es,new Bkt(r)),opn(r,u),r.set(SCe,new Pkt(r)),r.set(DW,new kkt(r)),r.set(Jm,new V_e(r)),r.set(Ss,new hkt(r));let h=new Q6e(r,t);r.set(Q6e,h),r.set(Hl,h),r.set(U6e,new U6e(r)),r.set(B6e,new B6e(r)),r.set(ip,new ip);let m=new oW(r);r.set($r,m),r.set(oW,m),r.set(Km,new sve(r,process.env)),r.set(Uk,new Noe),r.set(sc,new sc(r)),Dco(r),cco(r),r.set(LN,new LN),r.set(JV,new JV),r.set(FN,new FN),r.set(ZV,new ZV([])),r.set(VT,new tkt),r.set(flo.ObservableWorkspace,new OV(r,!0,!0)),r.set(A4,new cve),r.set(x9,new x9),r.set(Yv,new Yv(r)),r.set(sy,new H1t(r)),r.set(j_,new pkt(r)),r.set(Vd,new fkt(r)),r.set(bw,new bw(r)),r.set(hs,new hs(r)),r.set(SF,new SF(r)),r.set(IF,new IF(r)),r.set(cT,new cT(r)),r.set(wJ,new wJ(r)),r.set(s5,new s5),r.set(y0,new y0),r.set(UN,new UN(r)),r.set(u_,new wkt(r)),r.set(V2,new Rkt(r)),r.set(EF,new EF(r)),r.set(Rb,new Akt(r));let g=new QH(r);r.set(QH,g);let A=new ny(r,g,new gkt(r));r.set(ny,A),r.set(Xw,new Xw(g,A)),r.set(pie,Lji(r)),r.set(zS,new qkt(r)),r.set(SX,new SX),r.set(Fie,new Fie),r.set(gm,new XRt(r)),r.set(iC,new JRt(r)),r.set(nM,new nM(r));let y=new PA(r);r.set(PA,y),r.set(wf,new wf(r,y)),r.set(Ig,new Ig(r,y)),r.set(jd,new jd(r,y)),r.set(A0,new A0(r,e,y));let E=new L3(r,y,n);r.set(L3,E),r.get(VS).addListener(E.lifecycleListener);let _=new O6e;r.set(O6e,_),r.set(d0,new NIt(r)),r.set(pg,new pg(r,_)),r.set(Tw,new Tw),r.set(uT,new uT(r)),r.set(dj,new dj(r)),r.set(dw,new LO([new BO,new FO])),r.set(Bie,new Bie(r)),r.set(V_,new V_(r)),r.set(hq,new Qkt(r)),r.set(NK,new Ukt(r)),r.set(iy,new iy(r)),r.set(Gs,new Gs(r)),r.set(Am,new Am),r.set(JX,new JX(r)),r.set(w8,new w8(r,new bRt)),r.set(Aie,new Aie(r)),r.set(gie,new gie(r)),r.set(Ua,new Ua(r)),r.set(kO,new mkt(r)),r.set(ON,new ON(r)),r.set(gk,new gk(r.get(ON),r)),r.set(YO,new YO(r)),r.set(RI,new rkt(r)),r.set(tb,new tb(r.get(gk),r.get(RI),r)),r.set(_E,new _E(r));let v=new dc(r);r.set(dc,v);let b=new S8(r,v);return r.set(S8,b),r.set(Yie,new Yie(r,v)),r.get(Xt).onActivation(()=>{b.ensureInitialSync()}),r}a(Gkt,"createLanguageServerContext");var iM=new pe("ACP");async function hlo(t){let e=t.get(us);iM.info(t,`Starting Copilot ACP Agent v${e.getDisplayVersion()}`),t.get(ob).markReady(),t.get(Jp).githubAppId=sce,ial(t),nal(t),t.get(kn).setCapabilities({subAgent:!0,cveRemediatorAgent:!1}),await t.get(Ft).primeToken()?iM.info(t,"Token primed successfully"):iM.warn(t,"Token priming failed - set GH_COPILOT_TOKEN or GITHUB_COPILOT_TOKEN environment variable"),t.get(yf).initialize(!0),Pgn()?await ral(t):(Uu(t,"acp.server.start",{acpPipeline:"internal"}),await mlo(t))}a(hlo,"startACPServer");async function mlo(t){iM.info(t,"Starting ACP server with internal pipeline");let e=xCe.Writable.toWeb(process.stdout),r=xCe.Readable.toWeb(process.stdin),n=lke(e,r),o=new uke(s=>new QIt(s,t),n);o.signal.addEventListener("abort",()=>{iM.info(t,"ACP connection closed"),process.exit(0)}),await o.closed}a(mlo,"startACPServerInternal");async function ral(t){iM.info(t,"Starting ACP server with CLI proxy"),Uu(t,"acp.cli.discover");let e;try{e=await Dgn()}catch(u){let d=u instanceof Error?u.message:String(u);iM.warn(t,`CLI discovery failed, falling back to internal pipeline: ${d}`),fve(t,"acp.server.start",u,{acpPipeline:"internal-fallback"}),await mlo(t);return}let r=e.args.length>0?`${e.path} ${e.args.join(" ")}`:e.path;iM.info(t,`Found Copilot CLI: ${r} v${e.version}`),Uu(t,"acp.server.start",{acpPipeline:"cli",cliVersion:e.version,cliSource:e.source});let n=new qIt(e,t),o=xCe.Writable.toWeb(process.stdout),s=xCe.Readable.toWeb(process.stdin),c=lke(o,s),l=new uke(u=>new HIt(u,t,n),c);l.signal.addEventListener("abort",()=>{iM.info(t,"ACP connection closed, disposing CLI process"),n.dispose().then(()=>{process.exit(0)})}),await l.closed}a(ral,"startACPServerWithCLI");function nal(t){let e=t.get(hs);e.registerTool(new fj({name:"create_file",description:"Create a new file in the workspace with the specified content.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to create."}),content:S.String({description:"The content to write to the new file."})})})),e.registerTool(new fj({name:"insert_edit_into_file",description:"Edit an existing file by inserting, replacing, or deleting content.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),content:S.Optional(S.String({description:"The new content for the file."})),edits:S.Optional(S.Array(S.Object({startLine:S.Number({description:"The starting line number (1-based)."}),endLine:S.Number({description:"The ending line number (1-based)."}),newContent:S.String({description:"The new content to replace the range with."})})))})})),e.registerTool(new fj({name:"replace_string_in_file",description:"Replace a specific string in a file with a new string.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),oldString:S.String({description:"The string to find and replace."}),newString:S.String({description:"The string to replace it with."})})})),iM.info(t,"Registered ACP client tools: create_file, insert_edit_into_file, replace_string_in_file")}a(nal,"registerACPClientTools");function glo(){let e=Gkt({onRequest:a(()=>{},"onRequest"),onNotification:a(()=>{},"onNotification"),listen:a(()=>{},"listen"),sendNotification:a(()=>{},"sendNotification"),sendRequest:a(()=>Promise.resolve({}),"sendRequest"),workspace:{onDidChangeWorkspaceFolders:a(()=>{},"onDidChangeWorkspaceFolders")},client:{register:a(()=>Promise.resolve({}),"register")},console:{log:a(()=>{},"log"),info:a(()=>{},"info"),warn:a(()=>{},"warn"),error:a(()=>{},"error")},window:{showWarningMessage:a(()=>Promise.resolve(void 0),"showWarningMessage"),showInformationMessage:a(()=>Promise.resolve(void 0),"showInformationMessage")}}),r=new sW(e);return e.forceSet(j_,r),{ctx:e,acpToolInvoker:r}}a(glo,"createACPContext");function ial(t,e=process.env){let r=e.GITHUB_ENTERPRISE_URL;r&&(iM.info(t,"Configuring GitHub Enterprise URL from GITHUB_ENTERPRISE_URL"),O7e(t,r))}a(ial,"configureGitHubEnterpriseUrl");p();var zQr=require("events"),J6e=fe(require("fs"));U$e();var Vkt=fe(Fc());p();var ylo=fe(require("fs")),Elo=fe(require("http")),wCe=fe(require("path"));var $kt=class{constructor(e,r){this.port=e;let n;this.server=Elo.createServer((o,s)=>{if(o.headers.accept&&o.headers.accept=="text/event-stream")switch(s.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),o.url){case"/stdin":r.on("read",l=>{Alo(s,JSON.stringify(l))});return;case"/stdout":r.on("write",l=>{Alo(s,JSON.stringify(l))});return;default:s.writeHead(404),s.end();return}s.writeHead(200,{"Content-Type":"text/html"});let c=__dirname;wCe.basename(__dirname)!=="debug"&&(c=wCe.dirname(__dirname)),n??=ylo.readFileSync(wCe.join(c,"dist","debugServer.html")).toString(),s.write(n),s.end()}),this.server.on("error",o=>{console.error(o)})}static{a(this,"DebugServer")}listen(){return this.server.listen(this.port),this}getPort(){return this.server.address().port}};function Alo(t,e){t.write("data: "+e.toString().replace(/\n/g,` data: `)+` -`)}a(uao,"writeData");var q7r=class extends vkt.AbstractMessageWriter{constructor(r,n){super();this.delegate=r;this.ev=n}static{a(this,"DebugMessageWriter")}async write(r){return this.ev.emit("write",r),this.delegate.write(r)}end(){this.ev.emit("end"),this.delegate.end()}},j7r=class extends vkt.AbstractMessageReader{constructor(r,n){super();this.delegate=r;this.ev=n}static{a(this,"DebugMessageReader")}listen(r){return this.delegate.listen(n=>{this.ev.emit("read",n),r(n)})}};async function pao(t,e,r){let n,o=parseInt(t.GH_COPILOT_DEBUG_UI_PORT??t.GITHUB_COPILOT_DEBUG_UI_PORT);if(!isNaN(o)){n??=new Q7r.EventEmitter;let l=new _kt(o,n).listen();o===0&&await PTe(`http://localhost:${l.getPort()}`)}let s=t.GITHUB_COPILOT_RECORD??"",c;try{let l=Date.now().toString();s==="1"||s==="true"?c=T6e.openSync(`stdio${l}.log`,"w"):s&&s!=="0"&&s!=="false"&&(c=T6e.openSync(s.replaceAll("%s",l),"w"))}catch(l){console.error(l)}if(c){let l=a(u=>{c&&T6e.appendFile(c,u,d=>{d&&(c=void 0,console.error(d))})},"log");n??=new Q7r.EventEmitter,n.on("read",u=>l(`<-- ${JSON.stringify(u)} +`)}a(Alo,"writeData");var YQr=class extends Vkt.AbstractMessageWriter{constructor(r,n){super();this.delegate=r;this.ev=n}static{a(this,"DebugMessageWriter")}async write(r){return this.ev.emit("write",r),this.delegate.write(r)}end(){this.ev.emit("end"),this.delegate.end()}},KQr=class extends Vkt.AbstractMessageReader{constructor(r,n){super();this.delegate=r;this.ev=n}static{a(this,"DebugMessageReader")}listen(r){return this.delegate.listen(n=>{this.ev.emit("read",n),r(n)})}};async function _lo(t,e,r){let n,o=parseInt(t.GH_COPILOT_DEBUG_UI_PORT??t.GITHUB_COPILOT_DEBUG_UI_PORT);if(!isNaN(o)){n??=new zQr.EventEmitter;let l=new $kt(o,n).listen();o===0&&await JTe(`http://localhost:${l.getPort()}`)}let s=t.GITHUB_COPILOT_RECORD??"",c;try{let l=Date.now().toString();s==="1"||s==="true"?c=J6e.openSync(`stdio${l}.log`,"w"):s&&s!=="0"&&s!=="false"&&(c=J6e.openSync(s.replaceAll("%s",l),"w"))}catch(l){console.error(l)}if(c){let l=a(u=>{c&&J6e.appendFile(c,u,d=>{d&&(c=void 0,console.error(d))})},"log");n??=new zQr.EventEmitter,n.on("read",u=>l(`<-- ${JSON.stringify(u)} `)),n.on("write",u=>l(`--> ${JSON.stringify(u)} -`))}return n&&(e=new j7r(e,n),r=new q7r(r,n)),[e,r]}a(pao,"wrapTransports");p();var Ckt=de(require("fs/promises")),hao=de(require("os")),mao=de(require("path"));var Znl={tmpdir:a(()=>hao.default.tmpdir(),"tmpdir"),isPkg:"pkg"in process};async function gao(t=Znl){if(t.isPkg&&process.platform!=="win32"){let e=t.tmpdir();await Ckt.mkdir(e,{recursive:!0}),process.env.TMPDIR=await Ckt.mkdtemp(mao.join(e,"github-copilot-"))}}a(gao,"mitigateTempFolder");function Bil(){let t=process.env.GH_COPILOT_DEBUG??process.env.GITHUB_COPILOT_DEBUG;return process.argv.includes("--debug")||t!==void 0&&t!=="0"&&t.toLowerCase()!=="false"}a(Bil,"shouldEnableSourceMapSupport");Bil()&&Jao();async function Xao(){let t=_0n(process.argv.slice(2)).version(new ds().getDisplayVersion()).strict().option("debug",{type:"boolean",hidden:!0}).option("clientProcessId",{type:"string",hidden:!0}).option("stdio",{type:"boolean",describe:"Use stdio"}).option("acp",{type:"boolean",describe:"Run as Agent Client Protocol (ACP) agent"});"pkg"in process||t.option("node-ipc",{type:"boolean",describe:"Use node IPC",conflicts:"stdio"});let e=await t.parse();if(e.acp){let{ctx:u}=lao();await j8t(u),await aao(u);return}let r,n;e["node-ipc"]?(r=new wk.IPCMessageReader(process),n=new wk.IPCMessageWriter(process)):e.stdio?(r=new wk.StreamMessageReader(process.stdin),n=new wk.StreamMessageWriter(process.stdout)):(console.error("error: required option '--stdio' not specified"),process.exit(1)),await gao();let o=(0,wk.createConnection)(wk.ProposedFeatures.all,...await pao(process.env,r,n)),s=Ekt(o);console=ihn(s),await j8t(s);let c=s.get(ar),l=new GY(s);s.set(GY,l),c.onActivation(()=>{l.start(),nfn()}),Fil(c,r),c.listen()}a(Xao,"main");function Fil(t,e){let r=!1,n=a((o,s)=>{r||(r=!0,console.error(`copilot-language-server: shutting down (${o})`),t.onExit().finally(()=>process.exit(s)).catch(()=>{}),setTimeout(()=>process.kill(process.pid,"SIGKILL"),500))},"shutdown");e.onClose(()=>n("reader closed",0)),process.on("SIGINT",()=>n("SIGINT",130)),process.on("SIGTERM",()=>n("SIGTERM",143))}a(Fil,"setupExitHandlers");Zao.isMainThread?require.main===module&&Xao():(Tfn()&&Ifn(),B6t()&&nhn());0&&(module.exports={getTokenizer,getTokenizerAsync,main}); +`))}return n&&(e=new KQr(e,n),r=new YQr(r,n)),[e,r]}a(_lo,"wrapTransports");p();var Wkt=fe(require("fs/promises")),vlo=fe(require("os")),Clo=fe(require("path"));var oal={tmpdir:a(()=>vlo.default.tmpdir(),"tmpdir"),isPkg:"pkg"in process};async function blo(t=oal){if(t.isPkg&&process.platform!=="win32"){let e=t.tmpdir();await Wkt.mkdir(e,{recursive:!0}),process.env.TMPDIR=await Wkt.mkdtemp(Clo.join(e,"github-copilot-"))}}a(blo,"mitigateTempFolder");function Gal(){let t=process.env.GH_COPILOT_DEBUG??process.env.GITHUB_COPILOT_DEBUG;return process.argv.includes("--debug")||t!==void 0&&t!=="0"&&t.toLowerCase()!=="false"}a(Gal,"shouldEnableSourceMapSupport");Gal()&&iuo();async function suo(){let t=Ign(process.argv.slice(2)).version(new us().getDisplayVersion()).strict().option("debug",{type:"boolean",hidden:!0}).option("clientProcessId",{type:"string",hidden:!0}).option("stdio",{type:"boolean",describe:"Use stdio"}).option("acp",{type:"boolean",describe:"Run as Agent Client Protocol (ACP) agent"});"pkg"in process||t.option("node-ipc",{type:"boolean",describe:"Use node IPC",conflicts:"stdio"});let e=await t.parse();if(e.acp){let{ctx:u}=glo();await f6t(u),await hlo(u);return}let r,n;e["node-ipc"]?(r=new Bk.IPCMessageReader(process),n=new Bk.IPCMessageWriter(process)):e.stdio?(r=new Bk.StreamMessageReader(process.stdin),n=new Bk.StreamMessageWriter(process.stdout)):(console.error("error: required option '--stdio' not specified"),process.exit(1)),await blo();let o=(0,Bk.createConnection)(Bk.ProposedFeatures.all,...await _lo(process.env,r,n)),s=Gkt(o);console=umn(s),await f6t(s);let c=s.get(Xt),l=new rK(s);s.set(rK,l),c.onActivation(()=>{l.start(),cpn()}),$al(c,r),c.listen()}a(suo,"main");function $al(t,e){let r=!1,n=a((o,s)=>{r||(r=!0,console.error(`copilot-language-server: shutting down (${o})`),t.onExit().finally(()=>process.exit(s)).catch(()=>{}),setTimeout(()=>process.kill(process.pid,"SIGKILL"),500))},"shutdown");e.onClose(()=>n("reader closed",0)),process.on("SIGINT",()=>n("SIGINT",130)),process.on("SIGTERM",()=>n("SIGTERM",143))}a($al,"setupExitHandlers");ouo.isMainThread?require.main===module&&suo():(kpn()&&Ppn(),a9t()&&lmn());0&&(module.exports={getTokenizer,getTokenizerAsync,main}); //!!! DO NOT modify, this file was COPIED from 'microsoft/vscode' /*! Bundled license information: @@ -4544,9 +4569,6 @@ yargs-parser/build/lib/index.js: * SPDX-License-Identifier: ISC *) -js-yaml/dist/js-yaml.mjs: - (*! js-yaml 4.2.0 https://github.com/nodeca/js-yaml @license MIT *) - @octokit/request-error/dist-src/index.js: (* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist *) diff --git a/lua/copilot/util.lua b/lua/copilot/util.lua index 0a246189..8b3002e0 100644 --- a/lua/copilot/util.lua +++ b/lua/copilot/util.lua @@ -21,7 +21,7 @@ function M.get_editor_info() editorPluginInfo = { name = "copilot.lua", -- reflects version of github/copilot-language-server-release - version = "1.517.0", + version = "1.522.0", }, } return info